From f840319eeff0464d8f4a51ca047cfea8d1a2a39c Mon Sep 17 00:00:00 2001 From: albdert Date: Fri, 25 Sep 2026 15:08:19 +0200 Subject: [PATCH] setup: frontend with vite-setup and backend --- .github/ISSUE_TEMPLATE/bug_report.md | 23 + .github/ISSUE_TEMPLATE/cleanup.md | 15 + .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/documentation.md | 14 + .github/ISSUE_TEMPLATE/feature.md | 19 + .github/ISSUE_TEMPLATE/fix.md | 14 + .github/ISSUE_TEMPLATE/task.md | 15 + .github/PULL_REQUEST_TEMPLATE.md | 21 + .github/dependabot.yml | 18 + .github/workflows/ci.yml | 37 + backend/node_modules/.modules.yaml | 391 + .../.pnpm-workspace-state-v1.json | 38 + .../@apollo/cache-control-types/LICENSE | 21 + .../@apollo/cache-control-types/README.md | 6 + .../cache-control-types/dist/cjs/index.d.ts | 22 + .../dist/cjs/index.d.ts.map | 1 + .../cache-control-types/dist/cjs/index.js | 25 + .../cache-control-types/dist/cjs/index.js.map | 1 + .../cache-control-types/dist/cjs/package.json | 1 + .../cache-control-types/dist/esm/index.d.ts | 22 + .../dist/esm/index.d.ts.map | 1 + .../cache-control-types/dist/esm/index.js | 20 + .../cache-control-types/dist/esm/index.js.map | 1 + .../cache-control-types/dist/esm/package.json | 1 + .../dist/tsconfig.cjs.tsbuildinfo | 1 + .../dist/tsconfig.tsbuildinfo | 1 + .../@apollo/cache-control-types/package.json | 42 + .../@apollo/cache-control-types/src/index.ts | 114 + .../node_modules/graphql | 1 + .../node_modules/@apollo/protobufjs/LICENSE | 39 + .../node_modules/@apollo/protobufjs/README.md | 911 + .../node_modules/@apollo/protobufjs/bin/pbjs | 6 + .../node_modules/@apollo/protobufjs/bin/pbts | 6 + .../@apollo/protobufjs/cli/LICENSE | 33 + .../@apollo/protobufjs/cli/README.md | 11 + .../@apollo/protobufjs/cli/bin/pbjs | 6 + .../@apollo/protobufjs/cli/bin/pbts | 6 + .../@apollo/protobufjs/cli/index.d.ts | 3 + .../@apollo/protobufjs/cli/index.js | 3 + .../@apollo/protobufjs/cli/lib/tsd-jsdoc.json | 18 + .../protobufjs/cli/lib/tsd-jsdoc/LICENSE | 21 + .../protobufjs/cli/lib/tsd-jsdoc/README.md | 23 + .../protobufjs/cli/lib/tsd-jsdoc/plugin.js | 21 + .../protobufjs/cli/lib/tsd-jsdoc/publish.js | 693 + .../@apollo/protobufjs/cli/package-lock.json | 183 + .../@apollo/protobufjs/cli/package.json | 7 + .../protobufjs/cli/package.standalone.json | 32 + .../@apollo/protobufjs/cli/pbjs.d.ts | 9 + .../@apollo/protobufjs/cli/pbjs.js | 331 + .../@apollo/protobufjs/cli/pbts.d.ts | 9 + .../@apollo/protobufjs/cli/pbts.js | 198 + .../protobufjs/cli/targets/json-module.js | 38 + .../@apollo/protobufjs/cli/targets/json.js | 8 + .../@apollo/protobufjs/cli/targets/proto.js | 326 + .../@apollo/protobufjs/cli/targets/proto2.js | 10 + .../@apollo/protobufjs/cli/targets/proto3.js | 10 + .../protobufjs/cli/targets/static-module.js | 29 + .../@apollo/protobufjs/cli/targets/static.js | 709 + .../@apollo/protobufjs/cli/util.js | 183 + .../@apollo/protobufjs/cli/wrappers/amd.js | 7 + .../protobufjs/cli/wrappers/closure.js | 7 + .../protobufjs/cli/wrappers/commonjs.js | 7 + .../protobufjs/cli/wrappers/default.js | 15 + .../@apollo/protobufjs/cli/wrappers/es6.js | 5 + .../@apollo/protobufjs/dist/README.md | 31 + .../@apollo/protobufjs/dist/light/README.md | 31 + .../@apollo/protobufjs/dist/light/protobuf.js | 7199 ++++++ .../protobufjs/dist/light/protobuf.js.map | 1 + .../protobufjs/dist/light/protobuf.min.js | 7 + .../protobufjs/dist/light/protobuf.min.js.map | 1 + .../@apollo/protobufjs/dist/minimal/README.md | 31 + .../protobufjs/dist/minimal/protobuf.js | 2675 +++ .../protobufjs/dist/minimal/protobuf.js.map | 1 + .../protobufjs/dist/minimal/protobuf.min.js | 7 + .../dist/minimal/protobuf.min.js.map | 1 + .../@apollo/protobufjs/dist/protobuf.js | 8776 ++++++++ .../@apollo/protobufjs/dist/protobuf.js.map | 1 + .../@apollo/protobufjs/dist/protobuf.min.js | 7 + .../protobufjs/dist/protobuf.min.js.map | 1 + .../@apollo/protobufjs/ext/debug/README.md | 4 + .../@apollo/protobufjs/ext/debug/index.js | 71 + .../protobufjs/ext/descriptor/README.md | 72 + .../protobufjs/ext/descriptor/index.d.ts | 191 + .../protobufjs/ext/descriptor/index.js | 1052 + .../@apollo/protobufjs/ext/descriptor/test.js | 54 + .../@apollo/protobufjs/google/LICENSE | 27 + .../@apollo/protobufjs/google/README.md | 1 + .../protobufjs/google/api/annotations.json | 83 + .../protobufjs/google/api/annotations.proto | 11 + .../@apollo/protobufjs/google/api/http.json | 86 + .../@apollo/protobufjs/google/api/http.proto | 31 + .../protobufjs/google/protobuf/api.json | 118 + .../protobufjs/google/protobuf/api.proto | 34 + .../google/protobuf/descriptor.json | 739 + .../google/protobuf/descriptor.proto | 286 + .../google/protobuf/source_context.json | 20 + .../google/protobuf/source_context.proto | 7 + .../protobufjs/google/protobuf/type.json | 202 + .../protobufjs/google/protobuf/type.proto | 89 + .../@apollo/protobufjs/index.d.ts | 2628 +++ .../node_modules/@apollo/protobufjs/index.js | 4 + .../@apollo/protobufjs/light.d.ts | 2 + .../node_modules/@apollo/protobufjs/light.js | 4 + .../@apollo/protobufjs/minimal.d.ts | 2 + .../@apollo/protobufjs/minimal.js | 4 + .../protobufjs/node_modules/.bin/apollo-pbjs | 74 + .../protobufjs/node_modules/.bin/apollo-pbts | 74 + .../@apollo/protobufjs/package.json | 126 + .../@apollo/protobufjs/scripts/postinstall.js | 35 + .../@apollo/protobufjs/src/common.js | 399 + .../@apollo/protobufjs/src/converter.js | 304 + .../@apollo/protobufjs/src/decoder.js | 106 + .../@apollo/protobufjs/src/encoder.js | 119 + .../@apollo/protobufjs/src/enum.js | 181 + .../@apollo/protobufjs/src/field.js | 379 + .../@apollo/protobufjs/src/index-light.js | 104 + .../@apollo/protobufjs/src/index-minimal.js | 36 + .../@apollo/protobufjs/src/index.js | 12 + .../@apollo/protobufjs/src/mapfield.js | 126 + .../@apollo/protobufjs/src/message.js | 139 + .../@apollo/protobufjs/src/method.js | 151 + .../@apollo/protobufjs/src/namespace.js | 433 + .../@apollo/protobufjs/src/object.js | 200 + .../@apollo/protobufjs/src/oneof.js | 203 + .../@apollo/protobufjs/src/parse.js | 761 + .../@apollo/protobufjs/src/reader.js | 405 + .../@apollo/protobufjs/src/reader_buffer.js | 44 + .../@apollo/protobufjs/src/root.js | 353 + .../@apollo/protobufjs/src/roots.js | 18 + .../@apollo/protobufjs/src/rpc.js | 36 + .../@apollo/protobufjs/src/rpc/service.js | 142 + .../@apollo/protobufjs/src/service.js | 167 + .../@apollo/protobufjs/src/tokenize.js | 397 + .../@apollo/protobufjs/src/type.js | 590 + .../@apollo/protobufjs/src/types.js | 196 + .../@apollo/protobufjs/src/typescript.jsdoc | 22 + .../@apollo/protobufjs/src/util.js | 178 + .../@apollo/protobufjs/src/util/longbits.js | 200 + .../@apollo/protobufjs/src/util/minimal.js | 406 + .../@apollo/protobufjs/src/verifier.js | 191 + .../@apollo/protobufjs/src/wrappers.js | 83 + .../@apollo/protobufjs/src/writer.js | 459 + .../@apollo/protobufjs/src/writer_buffer.js | 81 + .../@apollo/protobufjs/tsconfig.json | 7 + .../node_modules/@protobufjs/aspromise | 1 + .../node_modules/@protobufjs/base64 | 1 + .../node_modules/@protobufjs/codegen | 1 + .../node_modules/@protobufjs/eventemitter | 1 + .../node_modules/@protobufjs/fetch | 1 + .../node_modules/@protobufjs/float | 1 + .../node_modules/@protobufjs/inquire | 1 + .../node_modules/@protobufjs/path | 1 + .../node_modules/@protobufjs/pool | 1 + .../node_modules/@protobufjs/utf8 | 1 + .../node_modules/@types/long | 1 + .../node_modules/long | 1 + .../server-gateway-interface/README.md | 11 + .../dist/cjs/index.d.ts | 96 + .../dist/cjs/index.d.ts.map | 1 + .../dist/cjs/index.js | 3 + .../dist/cjs/index.js.map | 1 + .../dist/cjs/package.json | 1 + .../dist/esm/index.d.ts | 96 + .../dist/esm/index.d.ts.map | 1 + .../dist/esm/index.js | 2 + .../dist/esm/index.js.map | 1 + .../dist/esm/package.json | 1 + .../dist/tsconfig.cjs.tsbuildinfo | 1 + .../dist/tsconfig.tsbuildinfo | 1 + .../server-gateway-interface/package.json | 37 + .../server-gateway-interface/src/index.ts | 139 + .../@apollo/usage-reporting-protobuf | 1 + .../node_modules/@apollo/utils.fetcher | 1 + .../node_modules/@apollo/utils.keyvaluecache | 1 + .../node_modules/@apollo/utils.logger | 1 + .../node_modules/graphql | 1 + .../node_modules/@apollo/cache-control-types | 1 + .../@apollo/server-gateway-interface | 1 + .../node_modules/@apollo/server/README.md | 158 + .../@apollo/server/dist/cjs/ApolloServer.d.ts | 126 + .../server/dist/cjs/ApolloServer.d.ts.map | 1 + .../@apollo/server/dist/cjs/ApolloServer.js | 726 + .../server/dist/cjs/ApolloServer.js.map | 1 + .../@apollo/server/dist/cjs/cachePolicy.d.ts | 3 + .../server/dist/cjs/cachePolicy.d.ts.map | 1 + .../@apollo/server/dist/cjs/cachePolicy.js | 33 + .../server/dist/cjs/cachePolicy.js.map | 1 + .../dist/cjs/determineApolloConfig.d.ts | 4 + .../dist/cjs/determineApolloConfig.d.ts.map | 1 + .../server/dist/cjs/determineApolloConfig.js | 58 + .../dist/cjs/determineApolloConfig.js.map | 1 + .../server/dist/cjs/errorNormalize.d.ts | 12 + .../server/dist/cjs/errorNormalize.d.ts.map | 1 + .../@apollo/server/dist/cjs/errorNormalize.js | 71 + .../server/dist/cjs/errorNormalize.js.map | 1 + .../@apollo/server/dist/cjs/errors/index.d.ts | 16 + .../server/dist/cjs/errors/index.d.ts.map | 1 + .../@apollo/server/dist/cjs/errors/index.js | 28 + .../server/dist/cjs/errors/index.js.map | 1 + .../dist/cjs/externalTypes/constructor.d.ts | 78 + .../cjs/externalTypes/constructor.d.ts.map | 1 + .../dist/cjs/externalTypes/constructor.js | 3 + .../dist/cjs/externalTypes/constructor.js.map | 1 + .../dist/cjs/externalTypes/context.d.ts | 4 + .../dist/cjs/externalTypes/context.d.ts.map | 1 + .../server/dist/cjs/externalTypes/context.js | 3 + .../dist/cjs/externalTypes/context.js.map | 1 + .../dist/cjs/externalTypes/graphql.d.ts | 41 + .../dist/cjs/externalTypes/graphql.d.ts.map | 1 + .../server/dist/cjs/externalTypes/graphql.js | 3 + .../dist/cjs/externalTypes/graphql.js.map | 1 + .../server/dist/cjs/externalTypes/http.d.ts | 22 + .../dist/cjs/externalTypes/http.d.ts.map | 1 + .../server/dist/cjs/externalTypes/http.js | 3 + .../server/dist/cjs/externalTypes/http.js.map | 1 + .../incrementalDeliveryPolyfillAlpha2.d.ts | 28 + ...incrementalDeliveryPolyfillAlpha2.d.ts.map | 1 + .../incrementalDeliveryPolyfillAlpha2.js | 3 + .../incrementalDeliveryPolyfillAlpha2.js.map | 1 + .../incrementalDeliveryPolyfillAlpha9.d.ts | 43 + ...incrementalDeliveryPolyfillAlpha9.d.ts.map | 1 + .../incrementalDeliveryPolyfillAlpha9.js | 3 + .../incrementalDeliveryPolyfillAlpha9.js.map | 1 + .../server/dist/cjs/externalTypes/index.d.ts | 9 + .../dist/cjs/externalTypes/index.d.ts.map | 1 + .../server/dist/cjs/externalTypes/index.js | 3 + .../dist/cjs/externalTypes/index.js.map | 1 + .../dist/cjs/externalTypes/plugins.d.ts | 75 + .../dist/cjs/externalTypes/plugins.d.ts.map | 1 + .../server/dist/cjs/externalTypes/plugins.js | 3 + .../dist/cjs/externalTypes/plugins.js.map | 1 + .../cjs/externalTypes/requestPipeline.d.ts | 50 + .../externalTypes/requestPipeline.d.ts.map | 1 + .../dist/cjs/externalTypes/requestPipeline.js | 3 + .../cjs/externalTypes/requestPipeline.js.map | 1 + .../dist/cjs/generated/packageVersion.d.ts | 2 + .../cjs/generated/packageVersion.d.ts.map | 1 + .../dist/cjs/generated/packageVersion.js | 5 + .../dist/cjs/generated/packageVersion.js.map | 1 + .../@apollo/server/dist/cjs/httpBatching.d.ts | 4 + .../server/dist/cjs/httpBatching.d.ts.map | 1 + .../@apollo/server/dist/cjs/httpBatching.js | 58 + .../server/dist/cjs/httpBatching.js.map | 1 + .../dist/cjs/incrementalDeliveryPolyfill.d.ts | 82 + .../cjs/incrementalDeliveryPolyfill.d.ts.map | 1 + .../dist/cjs/incrementalDeliveryPolyfill.js | 74 + .../cjs/incrementalDeliveryPolyfill.js.map | 1 + .../@apollo/server/dist/cjs/index.d.ts | 4 + .../@apollo/server/dist/cjs/index.d.ts.map | 1 + .../@apollo/server/dist/cjs/index.js | 23 + .../@apollo/server/dist/cjs/index.js.map | 1 + .../server/dist/cjs/internalErrorClasses.d.ts | 28 + .../dist/cjs/internalErrorClasses.d.ts.map | 1 + .../server/dist/cjs/internalErrorClasses.js | 91 + .../dist/cjs/internalErrorClasses.js.map | 1 + .../server/dist/cjs/internalPlugin.d.ts | 9 + .../server/dist/cjs/internalPlugin.d.ts.map | 1 + .../@apollo/server/dist/cjs/internalPlugin.js | 11 + .../server/dist/cjs/internalPlugin.js.map | 1 + .../@apollo/server/dist/cjs/package.json | 1 + .../dist/cjs/plugin/cacheControl/index.d.ts | 9 + .../cjs/plugin/cacheControl/index.d.ts.map | 1 + .../dist/cjs/plugin/cacheControl/index.js | 223 + .../dist/cjs/plugin/cacheControl/index.js.map | 1 + .../cjs/plugin/disableSuggestions/index.d.ts | 3 + .../plugin/disableSuggestions/index.d.ts.map | 1 + .../cjs/plugin/disableSuggestions/index.js | 22 + .../plugin/disableSuggestions/index.js.map | 1 + .../dist/cjs/plugin/disabled/index.d.ts | 7 + .../dist/cjs/plugin/disabled/index.d.ts.map | 1 + .../server/dist/cjs/plugin/disabled/index.js | 30 + .../dist/cjs/plugin/disabled/index.js.map | 1 + .../cjs/plugin/drainHttpServer/index.d.ts | 8 + .../cjs/plugin/drainHttpServer/index.d.ts.map | 1 + .../dist/cjs/plugin/drainHttpServer/index.js | 19 + .../cjs/plugin/drainHttpServer/index.js.map | 1 + .../cjs/plugin/drainHttpServer/stoppable.d.ts | 10 + .../plugin/drainHttpServer/stoppable.d.ts.map | 1 + .../cjs/plugin/drainHttpServer/stoppable.js | 54 + .../plugin/drainHttpServer/stoppable.js.map | 1 + .../dist/cjs/plugin/inlineTrace/index.d.ts | 8 + .../cjs/plugin/inlineTrace/index.d.ts.map | 1 + .../dist/cjs/plugin/inlineTrace/index.js | 70 + .../dist/cjs/plugin/inlineTrace/index.js.map | 1 + .../landingPage/default/getEmbeddedHTML.d.ts | 4 + .../default/getEmbeddedHTML.d.ts.map | 1 + .../landingPage/default/getEmbeddedHTML.js | 143 + .../default/getEmbeddedHTML.js.map | 1 + .../cjs/plugin/landingPage/default/index.d.ts | 9 + .../plugin/landingPage/default/index.d.ts.map | 1 + .../cjs/plugin/landingPage/default/index.js | 147 + .../plugin/landingPage/default/index.js.map | 1 + .../cjs/plugin/landingPage/default/types.d.ts | 56 + .../plugin/landingPage/default/types.d.ts.map | 1 + .../cjs/plugin/landingPage/default/types.js | 3 + .../plugin/landingPage/default/types.js.map | 1 + .../dist/cjs/plugin/schemaIsSubgraph.d.ts | 3 + .../dist/cjs/plugin/schemaIsSubgraph.d.ts.map | 1 + .../dist/cjs/plugin/schemaIsSubgraph.js | 23 + .../dist/cjs/plugin/schemaIsSubgraph.js.map | 1 + .../cjs/plugin/schemaReporting/index.d.ts | 10 + .../cjs/plugin/schemaReporting/index.d.ts.map | 1 + .../dist/cjs/plugin/schemaReporting/index.js | 103 + .../cjs/plugin/schemaReporting/index.js.map | 1 + .../schemaReporting/schemaReporter.d.ts | 33 + .../schemaReporting/schemaReporter.d.ts.map | 1 + .../plugin/schemaReporting/schemaReporter.js | 147 + .../schemaReporting/schemaReporter.js.map | 1 + .../plugin/subscriptionCallback/index.d.ts | 12 + .../subscriptionCallback/index.d.ts.map | 1 + .../cjs/plugin/subscriptionCallback/index.js | 434 + .../plugin/subscriptionCallback/index.js.map | 1 + .../dist/cjs/plugin/traceTreeBuilder.d.ts | 25 + .../dist/cjs/plugin/traceTreeBuilder.d.ts.map | 1 + .../dist/cjs/plugin/traceTreeBuilder.js | 201 + .../dist/cjs/plugin/traceTreeBuilder.js.map | 1 + .../defaultSendOperationsAsTrace.d.ts | 3 + .../defaultSendOperationsAsTrace.d.ts.map | 1 + .../defaultSendOperationsAsTrace.js | 44 + .../defaultSendOperationsAsTrace.js.map | 1 + .../usageReporting/durationHistogram.d.ts | 16 + .../usageReporting/durationHistogram.d.ts.map | 1 + .../usageReporting/durationHistogram.js | 68 + .../usageReporting/durationHistogram.js.map | 1 + .../dist/cjs/plugin/usageReporting/index.d.ts | 3 + .../cjs/plugin/usageReporting/index.d.ts.map | 1 + .../dist/cjs/plugin/usageReporting/index.js | 6 + .../cjs/plugin/usageReporting/index.js.map | 1 + .../usageReporting/iterateOverTrace.d.ts | 7 + .../usageReporting/iterateOverTrace.d.ts.map | 1 + .../plugin/usageReporting/iterateOverTrace.js | 81 + .../usageReporting/iterateOverTrace.js.map | 1 + .../operationDerivedDataCache.d.ts | 12 + .../operationDerivedDataCache.d.ts.map | 1 + .../operationDerivedDataCache.js | 33 + .../operationDerivedDataCache.js.map | 1 + .../cjs/plugin/usageReporting/options.d.ts | 60 + .../plugin/usageReporting/options.d.ts.map | 1 + .../dist/cjs/plugin/usageReporting/options.js | 3 + .../cjs/plugin/usageReporting/options.js.map | 1 + .../cjs/plugin/usageReporting/plugin.d.ts | 7 + .../cjs/plugin/usageReporting/plugin.d.ts.map | 1 + .../dist/cjs/plugin/usageReporting/plugin.js | 494 + .../cjs/plugin/usageReporting/plugin.js.map | 1 + .../dist/cjs/plugin/usageReporting/stats.d.ts | 96 + .../cjs/plugin/usageReporting/stats.d.ts.map | 1 + .../dist/cjs/plugin/usageReporting/stats.js | 289 + .../cjs/plugin/usageReporting/stats.js.map | 1 + .../plugin/usageReporting/traceDetails.d.ts | 4 + .../usageReporting/traceDetails.d.ts.map | 1 + .../cjs/plugin/usageReporting/traceDetails.js | 63 + .../plugin/usageReporting/traceDetails.js.map | 1 + .../@apollo/server/dist/cjs/preventCsrf.d.ts | 4 + .../server/dist/cjs/preventCsrf.d.ts.map | 1 + .../@apollo/server/dist/cjs/preventCsrf.js | 41 + .../server/dist/cjs/preventCsrf.js.map | 1 + .../server/dist/cjs/requestPipeline.d.ts | 9 + .../server/dist/cjs/requestPipeline.d.ts.map | 1 + .../server/dist/cjs/requestPipeline.js | 371 + .../server/dist/cjs/requestPipeline.js.map | 1 + .../@apollo/server/dist/cjs/runHttpQuery.d.ts | 15 + .../server/dist/cjs/runHttpQuery.d.ts.map | 1 + .../@apollo/server/dist/cjs/runHttpQuery.js | 230 + .../server/dist/cjs/runHttpQuery.js.map | 1 + .../server/dist/cjs/standalone/index.d.ts | 25 + .../server/dist/cjs/standalone/index.d.ts.map | 1 + .../server/dist/cjs/standalone/index.js | 97 + .../server/dist/cjs/standalone/index.js.map | 1 + .../server/dist/cjs/utils/HeaderMap.d.ts | 8 + .../server/dist/cjs/utils/HeaderMap.d.ts.map | 1 + .../server/dist/cjs/utils/HeaderMap.js | 20 + .../server/dist/cjs/utils/HeaderMap.js.map | 1 + .../dist/cjs/utils/UnreachableCaseError.d.ts | 4 + .../cjs/utils/UnreachableCaseError.d.ts.map | 1 + .../dist/cjs/utils/UnreachableCaseError.js | 10 + .../cjs/utils/UnreachableCaseError.js.map | 1 + .../dist/cjs/utils/computeCoreSchemaHash.d.ts | 2 + .../cjs/utils/computeCoreSchemaHash.d.ts.map | 1 + .../dist/cjs/utils/computeCoreSchemaHash.js | 8 + .../cjs/utils/computeCoreSchemaHash.js.map | 1 + .../server/dist/cjs/utils/invokeHooks.d.ts | 7 + .../dist/cjs/utils/invokeHooks.d.ts.map | 1 + .../server/dist/cjs/utils/invokeHooks.js | 36 + .../server/dist/cjs/utils/invokeHooks.js.map | 1 + .../server/dist/cjs/utils/isDefined.d.ts | 2 + .../server/dist/cjs/utils/isDefined.d.ts.map | 1 + .../server/dist/cjs/utils/isDefined.js | 7 + .../server/dist/cjs/utils/isDefined.js.map | 1 + .../makeGatewayGraphQLRequestContext.d.ts | 5 + .../makeGatewayGraphQLRequestContext.d.ts.map | 1 + .../utils/makeGatewayGraphQLRequestContext.js | 96 + .../makeGatewayGraphQLRequestContext.js.map | 1 + .../server/dist/cjs/utils/resolvable.d.ts | 7 + .../server/dist/cjs/utils/resolvable.d.ts.map | 1 + .../server/dist/cjs/utils/resolvable.js | 14 + .../server/dist/cjs/utils/resolvable.js.map | 1 + .../dist/cjs/utils/schemaInstrumentation.d.ts | 16 + .../cjs/utils/schemaInstrumentation.d.ts.map | 1 + .../dist/cjs/utils/schemaInstrumentation.js | 75 + .../cjs/utils/schemaInstrumentation.js.map | 1 + .../server/dist/cjs/utils/schemaManager.d.ts | 31 + .../dist/cjs/utils/schemaManager.d.ts.map | 1 + .../server/dist/cjs/utils/schemaManager.js | 103 + .../dist/cjs/utils/schemaManager.js.map | 1 + .../dist/cjs/utils/urlForHttpServer.d.ts | 3 + .../dist/cjs/utils/urlForHttpServer.d.ts.map | 1 + .../server/dist/cjs/utils/urlForHttpServer.js | 15 + .../dist/cjs/utils/urlForHttpServer.js.map | 1 + .../cjs/validationRules/NoIntrospection.d.ts | 3 + .../validationRules/NoIntrospection.d.ts.map | 1 + .../cjs/validationRules/NoIntrospection.js | 19 + .../validationRules/NoIntrospection.js.map | 1 + .../RecursiveSelectionsLimit.d.ts | 4 + .../RecursiveSelectionsLimit.d.ts.map | 1 + .../RecursiveSelectionsLimit.js | 150 + .../RecursiveSelectionsLimit.js.map | 1 + .../dist/cjs/validationRules/index.d.ts | 3 + .../dist/cjs/validationRules/index.d.ts.map | 1 + .../server/dist/cjs/validationRules/index.js | 9 + .../dist/cjs/validationRules/index.js.map | 1 + .../@apollo/server/dist/esm/ApolloServer.d.ts | 126 + .../server/dist/esm/ApolloServer.d.ts.map | 1 + .../@apollo/server/dist/esm/ApolloServer.js | 683 + .../server/dist/esm/ApolloServer.js.map | 1 + .../@apollo/server/dist/esm/cachePolicy.d.ts | 3 + .../server/dist/esm/cachePolicy.d.ts.map | 1 + .../@apollo/server/dist/esm/cachePolicy.js | 30 + .../server/dist/esm/cachePolicy.js.map | 1 + .../dist/esm/determineApolloConfig.d.ts | 4 + .../dist/esm/determineApolloConfig.d.ts.map | 1 + .../server/dist/esm/determineApolloConfig.js | 55 + .../dist/esm/determineApolloConfig.js.map | 1 + .../server/dist/esm/errorNormalize.d.ts | 12 + .../server/dist/esm/errorNormalize.d.ts.map | 1 + .../@apollo/server/dist/esm/errorNormalize.js | 66 + .../server/dist/esm/errorNormalize.js.map | 1 + .../@apollo/server/dist/esm/errors/index.d.ts | 16 + .../server/dist/esm/errors/index.d.ts.map | 1 + .../@apollo/server/dist/esm/errors/index.js | 24 + .../server/dist/esm/errors/index.js.map | 1 + .../dist/esm/externalTypes/constructor.d.ts | 78 + .../esm/externalTypes/constructor.d.ts.map | 1 + .../dist/esm/externalTypes/constructor.js | 2 + .../dist/esm/externalTypes/constructor.js.map | 1 + .../dist/esm/externalTypes/context.d.ts | 4 + .../dist/esm/externalTypes/context.d.ts.map | 1 + .../server/dist/esm/externalTypes/context.js | 2 + .../dist/esm/externalTypes/context.js.map | 1 + .../dist/esm/externalTypes/graphql.d.ts | 41 + .../dist/esm/externalTypes/graphql.d.ts.map | 1 + .../server/dist/esm/externalTypes/graphql.js | 2 + .../dist/esm/externalTypes/graphql.js.map | 1 + .../server/dist/esm/externalTypes/http.d.ts | 22 + .../dist/esm/externalTypes/http.d.ts.map | 1 + .../server/dist/esm/externalTypes/http.js | 2 + .../server/dist/esm/externalTypes/http.js.map | 1 + .../incrementalDeliveryPolyfillAlpha2.d.ts | 28 + ...incrementalDeliveryPolyfillAlpha2.d.ts.map | 1 + .../incrementalDeliveryPolyfillAlpha2.js | 2 + .../incrementalDeliveryPolyfillAlpha2.js.map | 1 + .../incrementalDeliveryPolyfillAlpha9.d.ts | 43 + ...incrementalDeliveryPolyfillAlpha9.d.ts.map | 1 + .../incrementalDeliveryPolyfillAlpha9.js | 2 + .../incrementalDeliveryPolyfillAlpha9.js.map | 1 + .../server/dist/esm/externalTypes/index.d.ts | 9 + .../dist/esm/externalTypes/index.d.ts.map | 1 + .../server/dist/esm/externalTypes/index.js | 2 + .../dist/esm/externalTypes/index.js.map | 1 + .../dist/esm/externalTypes/plugins.d.ts | 75 + .../dist/esm/externalTypes/plugins.d.ts.map | 1 + .../server/dist/esm/externalTypes/plugins.js | 2 + .../dist/esm/externalTypes/plugins.js.map | 1 + .../esm/externalTypes/requestPipeline.d.ts | 50 + .../externalTypes/requestPipeline.d.ts.map | 1 + .../dist/esm/externalTypes/requestPipeline.js | 2 + .../esm/externalTypes/requestPipeline.js.map | 1 + .../dist/esm/generated/packageVersion.d.ts | 2 + .../esm/generated/packageVersion.d.ts.map | 1 + .../dist/esm/generated/packageVersion.js | 2 + .../dist/esm/generated/packageVersion.js.map | 1 + .../@apollo/server/dist/esm/httpBatching.d.ts | 4 + .../server/dist/esm/httpBatching.d.ts.map | 1 + .../@apollo/server/dist/esm/httpBatching.js | 55 + .../server/dist/esm/httpBatching.js.map | 1 + .../dist/esm/incrementalDeliveryPolyfill.d.ts | 82 + .../esm/incrementalDeliveryPolyfill.d.ts.map | 1 + .../dist/esm/incrementalDeliveryPolyfill.js | 38 + .../esm/incrementalDeliveryPolyfill.js.map | 1 + .../@apollo/server/dist/esm/index.d.ts | 4 + .../@apollo/server/dist/esm/index.d.ts.map | 1 + .../@apollo/server/dist/esm/index.js | 4 + .../@apollo/server/dist/esm/index.js.map | 1 + .../server/dist/esm/internalErrorClasses.d.ts | 28 + .../dist/esm/internalErrorClasses.d.ts.map | 1 + .../server/dist/esm/internalErrorClasses.js | 81 + .../dist/esm/internalErrorClasses.js.map | 1 + .../server/dist/esm/internalPlugin.d.ts | 9 + .../server/dist/esm/internalPlugin.d.ts.map | 1 + .../@apollo/server/dist/esm/internalPlugin.js | 7 + .../server/dist/esm/internalPlugin.js.map | 1 + .../@apollo/server/dist/esm/package.json | 1 + .../dist/esm/plugin/cacheControl/index.d.ts | 9 + .../esm/plugin/cacheControl/index.d.ts.map | 1 + .../dist/esm/plugin/cacheControl/index.js | 220 + .../dist/esm/plugin/cacheControl/index.js.map | 1 + .../esm/plugin/disableSuggestions/index.d.ts | 3 + .../plugin/disableSuggestions/index.d.ts.map | 1 + .../esm/plugin/disableSuggestions/index.js | 19 + .../plugin/disableSuggestions/index.js.map | 1 + .../dist/esm/plugin/disabled/index.d.ts | 7 + .../dist/esm/plugin/disabled/index.d.ts.map | 1 + .../server/dist/esm/plugin/disabled/index.js | 23 + .../dist/esm/plugin/disabled/index.js.map | 1 + .../esm/plugin/drainHttpServer/index.d.ts | 8 + .../esm/plugin/drainHttpServer/index.d.ts.map | 1 + .../dist/esm/plugin/drainHttpServer/index.js | 16 + .../esm/plugin/drainHttpServer/index.js.map | 1 + .../esm/plugin/drainHttpServer/stoppable.d.ts | 10 + .../plugin/drainHttpServer/stoppable.d.ts.map | 1 + .../esm/plugin/drainHttpServer/stoppable.js | 47 + .../plugin/drainHttpServer/stoppable.js.map | 1 + .../dist/esm/plugin/inlineTrace/index.d.ts | 8 + .../esm/plugin/inlineTrace/index.d.ts.map | 1 + .../dist/esm/plugin/inlineTrace/index.js | 67 + .../dist/esm/plugin/inlineTrace/index.js.map | 1 + .../landingPage/default/getEmbeddedHTML.d.ts | 4 + .../default/getEmbeddedHTML.d.ts.map | 1 + .../landingPage/default/getEmbeddedHTML.js | 138 + .../default/getEmbeddedHTML.js.map | 1 + .../esm/plugin/landingPage/default/index.d.ts | 9 + .../plugin/landingPage/default/index.d.ts.map | 1 + .../esm/plugin/landingPage/default/index.js | 142 + .../plugin/landingPage/default/index.js.map | 1 + .../esm/plugin/landingPage/default/types.d.ts | 56 + .../plugin/landingPage/default/types.d.ts.map | 1 + .../esm/plugin/landingPage/default/types.js | 2 + .../plugin/landingPage/default/types.js.map | 1 + .../dist/esm/plugin/schemaIsSubgraph.d.ts | 3 + .../dist/esm/plugin/schemaIsSubgraph.d.ts.map | 1 + .../dist/esm/plugin/schemaIsSubgraph.js | 20 + .../dist/esm/plugin/schemaIsSubgraph.js.map | 1 + .../esm/plugin/schemaReporting/index.d.ts | 10 + .../esm/plugin/schemaReporting/index.d.ts.map | 1 + .../dist/esm/plugin/schemaReporting/index.js | 97 + .../esm/plugin/schemaReporting/index.js.map | 1 + .../schemaReporting/schemaReporter.d.ts | 33 + .../schemaReporting/schemaReporter.d.ts.map | 1 + .../plugin/schemaReporting/schemaReporter.js | 143 + .../schemaReporting/schemaReporter.js.map | 1 + .../plugin/subscriptionCallback/index.d.ts | 12 + .../subscriptionCallback/index.d.ts.map | 1 + .../esm/plugin/subscriptionCallback/index.js | 428 + .../plugin/subscriptionCallback/index.js.map | 1 + .../dist/esm/plugin/traceTreeBuilder.d.ts | 25 + .../dist/esm/plugin/traceTreeBuilder.d.ts.map | 1 + .../dist/esm/plugin/traceTreeBuilder.js | 196 + .../dist/esm/plugin/traceTreeBuilder.js.map | 1 + .../defaultSendOperationsAsTrace.d.ts | 3 + .../defaultSendOperationsAsTrace.d.ts.map | 1 + .../defaultSendOperationsAsTrace.js | 41 + .../defaultSendOperationsAsTrace.js.map | 1 + .../usageReporting/durationHistogram.d.ts | 16 + .../usageReporting/durationHistogram.d.ts.map | 1 + .../usageReporting/durationHistogram.js | 64 + .../usageReporting/durationHistogram.js.map | 1 + .../dist/esm/plugin/usageReporting/index.d.ts | 3 + .../esm/plugin/usageReporting/index.d.ts.map | 1 + .../dist/esm/plugin/usageReporting/index.js | 2 + .../esm/plugin/usageReporting/index.js.map | 1 + .../usageReporting/iterateOverTrace.d.ts | 7 + .../usageReporting/iterateOverTrace.d.ts.map | 1 + .../plugin/usageReporting/iterateOverTrace.js | 78 + .../usageReporting/iterateOverTrace.js.map | 1 + .../operationDerivedDataCache.d.ts | 12 + .../operationDerivedDataCache.d.ts.map | 1 + .../operationDerivedDataCache.js | 29 + .../operationDerivedDataCache.js.map | 1 + .../esm/plugin/usageReporting/options.d.ts | 60 + .../plugin/usageReporting/options.d.ts.map | 1 + .../dist/esm/plugin/usageReporting/options.js | 2 + .../esm/plugin/usageReporting/options.js.map | 1 + .../esm/plugin/usageReporting/plugin.d.ts | 7 + .../esm/plugin/usageReporting/plugin.d.ts.map | 1 + .../dist/esm/plugin/usageReporting/plugin.js | 487 + .../esm/plugin/usageReporting/plugin.js.map | 1 + .../dist/esm/plugin/usageReporting/stats.d.ts | 96 + .../esm/plugin/usageReporting/stats.d.ts.map | 1 + .../dist/esm/plugin/usageReporting/stats.js | 283 + .../esm/plugin/usageReporting/stats.js.map | 1 + .../plugin/usageReporting/traceDetails.d.ts | 4 + .../usageReporting/traceDetails.d.ts.map | 1 + .../esm/plugin/usageReporting/traceDetails.js | 60 + .../plugin/usageReporting/traceDetails.js.map | 1 + .../@apollo/server/dist/esm/preventCsrf.d.ts | 4 + .../server/dist/esm/preventCsrf.d.ts.map | 1 + .../@apollo/server/dist/esm/preventCsrf.js | 34 + .../server/dist/esm/preventCsrf.js.map | 1 + .../server/dist/esm/requestPipeline.d.ts | 9 + .../server/dist/esm/requestPipeline.d.ts.map | 1 + .../server/dist/esm/requestPipeline.js | 364 + .../server/dist/esm/requestPipeline.js.map | 1 + .../@apollo/server/dist/esm/runHttpQuery.d.ts | 15 + .../server/dist/esm/runHttpQuery.d.ts.map | 1 + .../@apollo/server/dist/esm/runHttpQuery.js | 221 + .../server/dist/esm/runHttpQuery.js.map | 1 + .../server/dist/esm/standalone/index.d.ts | 25 + .../server/dist/esm/standalone/index.d.ts.map | 1 + .../server/dist/esm/standalone/index.js | 91 + .../server/dist/esm/standalone/index.js.map | 1 + .../server/dist/esm/utils/HeaderMap.d.ts | 8 + .../server/dist/esm/utils/HeaderMap.d.ts.map | 1 + .../server/dist/esm/utils/HeaderMap.js | 16 + .../server/dist/esm/utils/HeaderMap.js.map | 1 + .../dist/esm/utils/UnreachableCaseError.d.ts | 4 + .../esm/utils/UnreachableCaseError.d.ts.map | 1 + .../dist/esm/utils/UnreachableCaseError.js | 6 + .../esm/utils/UnreachableCaseError.js.map | 1 + .../dist/esm/utils/computeCoreSchemaHash.d.ts | 2 + .../esm/utils/computeCoreSchemaHash.d.ts.map | 1 + .../dist/esm/utils/computeCoreSchemaHash.js | 5 + .../esm/utils/computeCoreSchemaHash.js.map | 1 + .../server/dist/esm/utils/invokeHooks.d.ts | 7 + .../dist/esm/utils/invokeHooks.d.ts.map | 1 + .../server/dist/esm/utils/invokeHooks.js | 31 + .../server/dist/esm/utils/invokeHooks.js.map | 1 + .../server/dist/esm/utils/isDefined.d.ts | 2 + .../server/dist/esm/utils/isDefined.d.ts.map | 1 + .../server/dist/esm/utils/isDefined.js | 4 + .../server/dist/esm/utils/isDefined.js.map | 1 + .../makeGatewayGraphQLRequestContext.d.ts | 5 + .../makeGatewayGraphQLRequestContext.d.ts.map | 1 + .../utils/makeGatewayGraphQLRequestContext.js | 93 + .../makeGatewayGraphQLRequestContext.js.map | 1 + .../server/dist/esm/utils/resolvable.d.ts | 7 + .../server/dist/esm/utils/resolvable.d.ts.map | 1 + .../server/dist/esm/utils/resolvable.js | 12 + .../server/dist/esm/utils/resolvable.js.map | 1 + .../dist/esm/utils/schemaInstrumentation.d.ts | 16 + .../esm/utils/schemaInstrumentation.d.ts.map | 1 + .../dist/esm/utils/schemaInstrumentation.js | 69 + .../esm/utils/schemaInstrumentation.js.map | 1 + .../server/dist/esm/utils/schemaManager.d.ts | 31 + .../dist/esm/utils/schemaManager.d.ts.map | 1 + .../server/dist/esm/utils/schemaManager.js | 99 + .../dist/esm/utils/schemaManager.js.map | 1 + .../dist/esm/utils/urlForHttpServer.d.ts | 3 + .../dist/esm/utils/urlForHttpServer.d.ts.map | 1 + .../server/dist/esm/utils/urlForHttpServer.js | 12 + .../dist/esm/utils/urlForHttpServer.js.map | 1 + .../esm/validationRules/NoIntrospection.d.ts | 3 + .../validationRules/NoIntrospection.d.ts.map | 1 + .../esm/validationRules/NoIntrospection.js | 15 + .../validationRules/NoIntrospection.js.map | 1 + .../RecursiveSelectionsLimit.d.ts | 4 + .../RecursiveSelectionsLimit.d.ts.map | 1 + .../RecursiveSelectionsLimit.js | 146 + .../RecursiveSelectionsLimit.js.map | 1 + .../dist/esm/validationRules/index.d.ts | 3 + .../dist/esm/validationRules/index.d.ts.map | 1 + .../server/dist/esm/validationRules/index.js | 3 + .../dist/esm/validationRules/index.js.map | 1 + .../@apollo/server/errors/package.json | 8 + .../node_modules/@apollo/server/package.json | 152 + .../server/plugin/cacheControl/package.json | 8 + .../plugin/disableSuggestions/package.json | 8 + .../server/plugin/disabled/package.json | 8 + .../plugin/drainHttpServer/package.json | 8 + .../server/plugin/inlineTrace/package.json | 8 + .../plugin/landingPage/default/package.json | 8 + .../plugin/schemaReporting/package.json | 8 + .../plugin/subscriptionCallback/package.json | 8 + .../server/plugin/usageReporting/package.json | 8 + .../@apollo/server/src/ApolloServer.ts | 1456 ++ .../@apollo/server/src/cachePolicy.ts | 33 + .../server/src/determineApolloConfig.ts | 95 + .../@apollo/server/src/errorNormalize.ts | 114 + .../@apollo/server/src/errors/index.ts | 33 + .../server/src/externalTypes/constructor.ts | 174 + .../server/src/externalTypes/context.ts | 18 + .../server/src/externalTypes/graphql.ts | 81 + .../@apollo/server/src/externalTypes/http.ts | 44 + .../incrementalDeliveryPolyfillAlpha2.ts | 63 + .../incrementalDeliveryPolyfillAlpha9.ts | 82 + .../@apollo/server/src/externalTypes/index.ts | 73 + .../server/src/externalTypes/plugins.ts | 222 + .../src/externalTypes/requestPipeline.ts | 123 + .../server/src/generated/packageVersion.ts | 1 + .../@apollo/server/src/httpBatching.ts | 105 + .../server/src/incrementalDeliveryPolyfill.ts | 253 + .../node_modules/@apollo/server/src/index.ts | 4 + .../server/src/internalErrorClasses.ts | 123 + .../@apollo/server/src/internalPlugin.ts | 42 + .../server/src/plugin/cacheControl/index.ts | 453 + .../src/plugin/disableSuggestions/index.ts | 23 + .../server/src/plugin/disabled/index.ts | 41 + .../src/plugin/drainHttpServer/index.ts | 42 + .../src/plugin/drainHttpServer/stoppable.ts | 109 + .../server/src/plugin/inlineTrace/index.ts | 156 + .../landingPage/default/getEmbeddedHTML.ts | 204 + .../src/plugin/landingPage/default/index.ts | 220 + .../src/plugin/landingPage/default/types.ts | 198 + .../server/src/plugin/schemaIsSubgraph.ts | 41 + .../schemaReporting/generated/operations.d.ts | 18359 ++++++++++++++++ .../src/plugin/schemaReporting/index.ts | 197 + .../plugin/schemaReporting/schemaReporter.ts | 207 + .../src/plugin/subscriptionCallback/index.ts | 724 + .../server/src/plugin/traceTreeBuilder.ts | 356 + .../defaultSendOperationsAsTrace.ts | 74 + .../usageReporting/durationHistogram.ts | 87 + .../server/src/plugin/usageReporting/index.ts | 9 + .../plugin/usageReporting/iterateOverTrace.ts | 140 + .../operationDerivedDataCache.ts | 61 + .../src/plugin/usageReporting/options.ts | 414 + .../src/plugin/usageReporting/plugin.ts | 871 + .../server/src/plugin/usageReporting/stats.ts | 492 + .../src/plugin/usageReporting/traceDetails.ts | 96 + .../@apollo/server/src/preventCsrf.ts | 99 + .../@apollo/server/src/requestPipeline.ts | 821 + .../@apollo/server/src/runHttpQuery.ts | 408 + .../@apollo/server/src/standalone/index.ts | 155 + .../@apollo/server/src/utils/HeaderMap.ts | 22 + .../server/src/utils/UnreachableCaseError.ts | 10 + .../server/src/utils/computeCoreSchemaHash.ts | 9 + .../@apollo/server/src/utils/invokeHooks.ts | 53 + .../@apollo/server/src/utils/isDefined.ts | 3 + .../utils/makeGatewayGraphQLRequestContext.ts | 197 + .../@apollo/server/src/utils/resolvable.ts | 30 + .../server/src/utils/schemaInstrumentation.ts | 132 + .../@apollo/server/src/utils/schemaManager.ts | 212 + .../server/src/utils/urlForHttpServer.ts | 21 + .../src/validationRules/NoIntrospection.ts | 27 + .../RecursiveSelectionsLimit.ts | 198 + .../server/src/validationRules/index.ts | 5 + .../@apollo/server/standalone/package.json | 8 + .../@apollo/usage-reporting-protobuf | 1 + .../node_modules/@apollo/utils.createhash | 1 + .../node_modules/@apollo/utils.fetcher | 1 + .../node_modules/@apollo/utils.isnodelike | 1 + .../node_modules/@apollo/utils.keyvaluecache | 1 + .../node_modules/@apollo/utils.logger | 1 + .../node_modules/@apollo/utils.usagereporting | 1 + .../node_modules/@apollo/utils.withrequired | 1 + .../node_modules/@graphql-tools/schema | 1 + .../node_modules/async-retry | 1 + .../node_modules/body-parser | 1 + .../node_modules/content-type | 1 + .../node_modules/cors | 1 + .../node_modules/finalhandler | 1 + .../node_modules/graphql | 1 + .../node_modules/loglevel | 1 + .../node_modules/lru-cache | 1 + .../node_modules/negotiator | 1 + .../node_modules/whatwg-mimetype | 1 + .../node_modules/@apollo/protobufjs | 1 + .../usage-reporting-protobuf/README.md | 40 + .../generated/cjs/package.json | 1 + .../generated/cjs/protobuf.d.ts | 3276 +++ .../generated/cjs/protobuf.js | 8244 +++++++ .../generated/esm/package.json | 1 + .../generated/esm/protobuf.d.ts | 3276 +++ .../generated/esm/protobuf.js | 8242 +++++++ .../node_modules/.bin/apollo-pbjs | 74 + .../node_modules/.bin/apollo-pbts | 74 + .../usage-reporting-protobuf/package.json | 49 + .../src/.editorconfig | 12 + .../src/reports.proto | 476 + .../@apollo/utils.createhash/LICENSE | 21 + .../@apollo/utils.createhash/README.md | 12 + .../@apollo/utils.createhash/dist/index.d.ts | 3 + .../utils.createhash/dist/index.d.ts.map | 1 + .../@apollo/utils.createhash/dist/index.js | 12 + .../utils.createhash/dist/index.js.map | 1 + .../utils.createhash/node_modules/.bin/sha.js | 74 + .../@apollo/utils.createhash/package.json | 27 + .../src/__tests__/createHash.test.ts | 9 + .../src/__tests__/exports.test.ts | 6 + .../src/__tests__/tsconfig.json | 5 + .../@apollo/utils.createhash/src/index.ts | 16 + .../node_modules/@apollo/utils.isnodelike | 1 + .../node_modules/sha.js | 1 + .../utils.dropunuseddefinitions/LICENSE | 21 + .../utils.dropunuseddefinitions/README.md | 30 + .../dist/index.d.ts | 3 + .../dist/index.d.ts.map | 1 + .../utils.dropunuseddefinitions/dist/index.js | 13 + .../dist/index.js.map | 1 + .../utils.dropunuseddefinitions/package.json | 26 + .../__tests__/dropUnusedDefinitions.test.ts | 86 + .../src/__tests__/tsconfig.json | 5 + .../utils.dropunuseddefinitions/src/index.ts | 19 + .../node_modules/graphql | 1 + .../@apollo/utils.fetcher/LICENSE | 21 + .../@apollo/utils.fetcher/README.md | 13 + .../@apollo/utils.fetcher/dist/index.d.ts | 34 + .../@apollo/utils.fetcher/dist/index.d.ts.map | 1 + .../@apollo/utils.fetcher/dist/index.js | 3 + .../@apollo/utils.fetcher/dist/index.js.map | 1 + .../@apollo/utils.fetcher/package.json | 23 + .../utils.fetcher/src/__tests__/index.test.ts | 19 + .../utils.fetcher/src/__tests__/tsconfig.json | 5 + .../@apollo/utils.fetcher/src/index.ts | 82 + .../@apollo/utils.isnodelike/LICENSE | 21 + .../@apollo/utils.isnodelike/README.md | 14 + .../@apollo/utils.isnodelike/dist/index.d.ts | 2 + .../utils.isnodelike/dist/index.d.ts.map | 1 + .../@apollo/utils.isnodelike/dist/index.js | 9 + .../utils.isnodelike/dist/index.js.map | 1 + .../@apollo/utils.isnodelike/package.json | 23 + .../@apollo/utils.isnodelike/src/index.ts | 12 + .../@apollo/utils.keyvaluecache/LICENSE | 21 + .../@apollo/utils.keyvaluecache/README.md | 70 + .../dist/ErrorsAreMissesCache.d.ts | 11 + .../dist/ErrorsAreMissesCache.d.ts.map | 1 + .../dist/ErrorsAreMissesCache.js | 33 + .../dist/ErrorsAreMissesCache.js.map | 1 + .../dist/InMemoryLRUCache.d.ts | 14 + .../dist/InMemoryLRUCache.d.ts.map | 1 + .../dist/InMemoryLRUCache.js | 42 + .../dist/InMemoryLRUCache.js.map | 1 + .../dist/KeyValueCache.d.ts | 9 + .../dist/KeyValueCache.d.ts.map | 1 + .../utils.keyvaluecache/dist/KeyValueCache.js | 3 + .../dist/KeyValueCache.js.map | 1 + .../dist/PrefixingKeyValueCache.d.ts | 15 + .../dist/PrefixingKeyValueCache.d.ts.map | 1 + .../dist/PrefixingKeyValueCache.js | 50 + .../dist/PrefixingKeyValueCache.js.map | 1 + .../utils.keyvaluecache/dist/index.d.ts | 5 + .../utils.keyvaluecache/dist/index.d.ts.map | 1 + .../@apollo/utils.keyvaluecache/dist/index.js | 10 + .../utils.keyvaluecache/dist/index.js.map | 1 + .../@apollo/utils.keyvaluecache/package.json | 27 + .../src/ErrorsAreMissesCache.ts | 41 + .../src/InMemoryLRUCache.ts | 67 + .../utils.keyvaluecache/src/KeyValueCache.ts | 16 + .../src/PrefixingKeyValueCache.ts | 89 + .../__tests__/ErrorsAreMissesCache.test.ts | 69 + .../src/__tests__/InMemoryLRUCache.test.ts | 81 + .../__tests__/PrefixingKeyValueCache.test.ts | 81 + .../src/__tests__/keyValueCache.test.ts | 101 + .../src/__tests__/tsconfig.json | 12 + .../@apollo/utils.keyvaluecache/src/index.ts | 7 + .../node_modules/@apollo/utils.logger | 1 + .../node_modules/lru-cache | 1 + .../node_modules/@apollo/utils.logger/LICENSE | 21 + .../@apollo/utils.logger/README.md | 36 + .../@apollo/utils.logger/dist/index.d.ts | 7 + .../@apollo/utils.logger/dist/index.d.ts.map | 1 + .../@apollo/utils.logger/dist/index.js | 3 + .../@apollo/utils.logger/dist/index.js.map | 1 + .../@apollo/utils.logger/package.json | 23 + .../utils.logger/src/__tests__/index.test.ts | 179 + .../utils.logger/src/__tests__/tsconfig.json | 5 + .../@apollo/utils.logger/src/index.ts | 6 + .../utils.printwithreducedwhitespace/LICENSE | 21 + .../README.md | 20 + .../dist/index.d.ts | 3 + .../dist/index.d.ts.map | 1 + .../dist/index.js | 23 + .../dist/index.js.map | 1 + .../package.json | 26 + .../printWithReducedWhitespace.test.ts | 28 + .../src/__tests__/tsconfig.json | 5 + .../src/index.ts | 33 + .../node_modules/graphql | 1 + .../@apollo/utils.removealiases/LICENSE | 21 + .../@apollo/utils.removealiases/README.md | 12 + .../utils.removealiases/dist/index.d.ts | 3 + .../utils.removealiases/dist/index.d.ts.map | 1 + .../@apollo/utils.removealiases/dist/index.js | 14 + .../utils.removealiases/dist/index.js.map | 1 + .../@apollo/utils.removealiases/package.json | 26 + .../src/__tests__/removeAliases.test.ts | 39 + .../src/__tests__/tsconfig.json | 12 + .../@apollo/utils.removealiases/src/index.ts | 17 + .../node_modules/graphql | 1 + .../@apollo/utils.sortast/LICENSE | 21 + .../@apollo/utils.sortast/README.md | 18 + .../@apollo/utils.sortast/dist/index.d.ts | 3 + .../@apollo/utils.sortast/dist/index.d.ts.map | 1 + .../@apollo/utils.sortast/dist/index.js | 62 + .../@apollo/utils.sortast/dist/index.js.map | 1 + .../@apollo/utils.sortast/package.json | 29 + .../@apollo/utils.sortast/src/index.ts | 94 + .../node_modules/graphql | 1 + .../node_modules/lodash.sortby | 1 + .../utils.stripsensitiveliterals/LICENSE | 21 + .../utils.stripsensitiveliterals/README.md | 24 + .../dist/index.d.ts | 5 + .../dist/index.d.ts.map | 1 + .../dist/index.js | 32 + .../dist/index.js.map | 1 + .../utils.stripsensitiveliterals/package.json | 26 + .../__tests__/stripSensitiveLiterals.test.ts | 152 + .../src/__tests__/tsconfig.json | 12 + .../utils.stripsensitiveliterals/src/index.ts | 43 + .../node_modules/graphql | 1 + .../@apollo/usage-reporting-protobuf | 1 + .../@apollo/utils.dropunuseddefinitions | 1 + .../@apollo/utils.printwithreducedwhitespace | 1 + .../node_modules/@apollo/utils.removealiases | 1 + .../node_modules/@apollo/utils.sortast | 1 + .../@apollo/utils.stripsensitiveliterals | 1 + .../@apollo/utils.usagereporting/LICENSE | 21 + .../@apollo/utils.usagereporting/README.md | 21 + .../dist/calculateReferencedFieldsByType.d.ts | 13 + .../calculateReferencedFieldsByType.d.ts.map | 1 + .../dist/calculateReferencedFieldsByType.js | 42 + .../calculateReferencedFieldsByType.js.map | 1 + .../utils.usagereporting/dist/index.d.ts | 4 + .../utils.usagereporting/dist/index.d.ts.map | 1 + .../utils.usagereporting/dist/index.js | 8 + .../utils.usagereporting/dist/index.js.map | 1 + .../utils.usagereporting/dist/signature.d.ts | 3 + .../dist/signature.d.ts.map | 1 + .../utils.usagereporting/dist/signature.js | 15 + .../dist/signature.js.map | 1 + .../@apollo/utils.usagereporting/package.json | 34 + .../__snapshots__/signature.test.ts.snap | 17 + .../calculateReferencedFieldsByType.test.ts | 299 + .../src/__tests__/signature.test.ts | 141 + .../src/__tests__/tsconfig.json | 10 + .../src/calculateReferencedFieldsByType.ts | 89 + .../@apollo/utils.usagereporting/src/index.ts | 6 + .../utils.usagereporting/src/signature.ts | 42 + .../node_modules/graphql | 1 + .../@apollo/utils.withrequired/LICENSE | 21 + .../@apollo/utils.withrequired/README.md | 20 + .../utils.withrequired/dist/index.d.ts | 2 + .../utils.withrequired/dist/index.d.ts.map | 1 + .../@apollo/utils.withrequired/dist/index.js | 3 + .../utils.withrequired/dist/index.js.map | 1 + .../@apollo/utils.withrequired/package.json | 23 + .../src/__tests__/index.test.ts | 29 + .../src/__tests__/tsconfig.json | 5 + .../@apollo/utils.withrequired/src/index.ts | 1 + .../@graphql-tools/merge/README.md | 5 + .../@graphql-tools/merge/cjs/extensions.js | 54 + .../@graphql-tools/merge/cjs/index.js | 6 + .../@graphql-tools/merge/cjs/links.js | 162 + .../merge/cjs/merge-resolvers.js | 71 + .../@graphql-tools/merge/cjs/package.json | 1 + .../merge/cjs/typedefs-mergers/arguments.js | 23 + .../merge/cjs/typedefs-mergers/directives.js | 172 + .../merge/cjs/typedefs-mergers/enum-values.js | 39 + .../merge/cjs/typedefs-mergers/enum.js | 28 + .../merge/cjs/typedefs-mergers/fields.js | 81 + .../merge/cjs/typedefs-mergers/index.js | 17 + .../merge/cjs/typedefs-mergers/input-type.js | 33 + .../merge/cjs/typedefs-mergers/interface.js | 37 + .../merge-named-type-array.js | 14 + .../merge/cjs/typedefs-mergers/merge-nodes.js | 83 + .../cjs/typedefs-mergers/merge-typedefs.js | 155 + .../merge/cjs/typedefs-mergers/scalar.js | 26 + .../merge/cjs/typedefs-mergers/schema-def.js | 40 + .../merge/cjs/typedefs-mergers/type.js | 35 + .../merge/cjs/typedefs-mergers/union.js | 29 + .../merge/cjs/typedefs-mergers/utils.js | 65 + .../@graphql-tools/merge/esm/extensions.js | 48 + .../@graphql-tools/merge/esm/index.js | 3 + .../@graphql-tools/merge/esm/links.js | 158 + .../merge/esm/merge-resolvers.js | 68 + .../merge/esm/typedefs-mergers/arguments.js | 20 + .../merge/esm/typedefs-mergers/directives.js | 168 + .../merge/esm/typedefs-mergers/enum-values.js | 36 + .../merge/esm/typedefs-mergers/enum.js | 25 + .../merge/esm/typedefs-mergers/fields.js | 78 + .../merge/esm/typedefs-mergers/index.js | 14 + .../merge/esm/typedefs-mergers/input-type.js | 30 + .../merge/esm/typedefs-mergers/interface.js | 34 + .../merge-named-type-array.js | 11 + .../merge/esm/typedefs-mergers/merge-nodes.js | 78 + .../esm/typedefs-mergers/merge-typedefs.js | 151 + .../merge/esm/typedefs-mergers/scalar.js | 23 + .../merge/esm/typedefs-mergers/schema-def.js | 36 + .../merge/esm/typedefs-mergers/type.js | 32 + .../merge/esm/typedefs-mergers/union.js | 26 + .../merge/esm/typedefs-mergers/utils.js | 54 + .../@graphql-tools/merge/package.json | 61 + .../merge/typings/extensions.d.cts | 5 + .../merge/typings/extensions.d.ts | 5 + .../@graphql-tools/merge/typings/index.d.cts | 3 + .../@graphql-tools/merge/typings/index.d.ts | 3 + .../@graphql-tools/merge/typings/links.d.cts | 24 + .../@graphql-tools/merge/typings/links.d.ts | 24 + .../merge/typings/merge-resolvers.d.cts | 37 + .../merge/typings/merge-resolvers.d.ts | 37 + .../typings/typedefs-mergers/arguments.d.cts | 3 + .../typings/typedefs-mergers/arguments.d.ts | 3 + .../typings/typedefs-mergers/directives.d.cts | 4 + .../typings/typedefs-mergers/directives.d.ts | 4 + .../typedefs-mergers/enum-values.d.cts | 3 + .../typings/typedefs-mergers/enum-values.d.ts | 3 + .../merge/typings/typedefs-mergers/enum.d.cts | 3 + .../merge/typings/typedefs-mergers/enum.d.ts | 3 + .../typings/typedefs-mergers/fields.d.cts | 11 + .../typings/typedefs-mergers/fields.d.ts | 11 + .../typings/typedefs-mergers/index.d.cts | 14 + .../merge/typings/typedefs-mergers/index.d.ts | 14 + .../typings/typedefs-mergers/input-type.d.cts | 3 + .../typings/typedefs-mergers/input-type.d.ts | 3 + .../typings/typedefs-mergers/interface.d.cts | 3 + .../typings/typedefs-mergers/interface.d.ts | 3 + .../merge-named-type-array.d.cts | 3 + .../merge-named-type-array.d.ts | 3 + .../typedefs-mergers/merge-nodes.d.cts | 9 + .../typings/typedefs-mergers/merge-nodes.d.ts | 9 + .../typedefs-mergers/merge-typedefs.d.cts | 91 + .../typedefs-mergers/merge-typedefs.d.ts | 91 + .../typings/typedefs-mergers/scalar.d.cts | 3 + .../typings/typedefs-mergers/scalar.d.ts | 3 + .../typings/typedefs-mergers/schema-def.d.cts | 8 + .../typings/typedefs-mergers/schema-def.d.ts | 8 + .../merge/typings/typedefs-mergers/type.d.cts | 3 + .../merge/typings/typedefs-mergers/type.d.ts | 3 + .../typings/typedefs-mergers/union.d.cts | 3 + .../merge/typings/typedefs-mergers/union.d.ts | 3 + .../typings/typedefs-mergers/utils.d.cts | 15 + .../merge/typings/typedefs-mergers/utils.d.ts | 15 + .../node_modules/@graphql-tools/utils | 1 + .../node_modules/graphql | 1 + .../node_modules/tslib | 1 + .../node_modules/@graphql-tools/merge | 1 + .../@graphql-tools/schema/README.md | 5 + .../schema/cjs/addResolversToSchema.js | 363 + .../schema/cjs/assertResolversPresent.js | 46 + .../schema/cjs/chainResolvers.js | 12 + .../schema/cjs/checkForResolveTypeResolver.js | 22 + .../cjs/extendResolversFromInterfaces.js | 34 + .../@graphql-tools/schema/cjs/index.js | 19 + .../schema/cjs/makeExecutableSchema.js | 93 + .../schema/cjs/merge-schemas.js | 38 + .../@graphql-tools/schema/cjs/package.json | 1 + .../@graphql-tools/schema/cjs/types.js | 0 .../schema/esm/addResolversToSchema.js | 360 + .../schema/esm/assertResolversPresent.js | 43 + .../schema/esm/chainResolvers.js | 9 + .../schema/esm/checkForResolveTypeResolver.js | 19 + .../esm/extendResolversFromInterfaces.js | 31 + .../@graphql-tools/schema/esm/index.js | 9 + .../schema/esm/makeExecutableSchema.js | 90 + .../schema/esm/merge-schemas.js | 35 + .../@graphql-tools/schema/esm/types.js | 0 .../@graphql-tools/schema/package.json | 61 + .../schema/typings/addResolversToSchema.d.cts | 3 + .../schema/typings/addResolversToSchema.d.ts | 3 + .../typings/assertResolversPresent.d.cts | 3 + .../typings/assertResolversPresent.d.ts | 3 + .../schema/typings/chainResolvers.d.cts | 5 + .../schema/typings/chainResolvers.d.ts | 5 + .../typings/checkForResolveTypeResolver.d.cts | 3 + .../typings/checkForResolveTypeResolver.d.ts | 3 + .../extendResolversFromInterfaces.d.cts | 3 + .../extendResolversFromInterfaces.d.ts | 3 + .../@graphql-tools/schema/typings/index.d.cts | 9 + .../@graphql-tools/schema/typings/index.d.ts | 9 + .../schema/typings/makeExecutableSchema.d.cts | 46 + .../schema/typings/makeExecutableSchema.d.ts | 46 + .../schema/typings/merge-schemas.d.cts | 16 + .../schema/typings/merge-schemas.d.ts | 16 + .../@graphql-tools/schema/typings/types.d.cts | 39 + .../@graphql-tools/schema/typings/types.d.ts | 39 + .../node_modules/@graphql-tools/utils | 1 + .../node_modules/graphql | 1 + .../node_modules/tslib | 1 + .../utils/cjs/AccumulatorMap.js | 21 + .../@graphql-tools/utils/cjs/Interfaces.js | 31 + .../@graphql-tools/utils/cjs/Path.js | 31 + .../@graphql-tools/utils/cjs/addTypes.js | 61 + .../@graphql-tools/utils/cjs/astFromType.js | 30 + .../@graphql-tools/utils/cjs/astFromValue.js | 115 + .../utils/cjs/astFromValueUntyped.js | 84 + .../utils/cjs/build-operation-for-field.js | 363 + .../@graphql-tools/utils/cjs/collectFields.js | 168 + .../@graphql-tools/utils/cjs/comments.js | 400 + .../@graphql-tools/utils/cjs/debugTimer.js | 17 + .../utils/cjs/defaultValueAstFromType.js | 32 + .../utils/cjs/descriptionFromObject.js | 21 + .../@graphql-tools/utils/cjs/directives.js | 47 + .../@graphql-tools/utils/cjs/errors.js | 69 + .../@graphql-tools/utils/cjs/executor.js | 0 .../utils/cjs/extractExtensionsFromSchema.js | 102 + .../@graphql-tools/utils/cjs/fields.js | 114 + .../@graphql-tools/utils/cjs/filterSchema.js | 67 + .../@graphql-tools/utils/cjs/fixSchemaAst.js | 25 + .../utils/cjs/forEachDefaultValue.js | 28 + .../@graphql-tools/utils/cjs/forEachField.js | 18 + .../cjs/get-arguments-with-directives.js | 31 + .../utils/cjs/get-directives.js | 35 + .../utils/cjs/get-fields-with-directives.js | 30 + .../utils/cjs/get-implementing-types.js | 17 + .../utils/cjs/getArgumentValues.js | 79 + .../utils/cjs/getDirectiveExtensions.js | 86 + .../utils/cjs/getDirectiveValues.js | 15 + .../utils/cjs/getObjectTypeFromTypeMap.js | 12 + .../utils/cjs/getOperationASTFromRequest.js | 16 + .../utils/cjs/getResolversFromSchema.js | 71 + .../utils/cjs/getResponseKeyFromInfo.js | 11 + .../@graphql-tools/utils/cjs/heal.js | 180 + .../@graphql-tools/utils/cjs/helpers.js | 134 + .../utils/cjs/implementsAbstractType.js | 16 + .../@graphql-tools/utils/cjs/index.js | 69 + .../utils/cjs/isAsyncIterable.js | 6 + .../utils/cjs/isDocumentNode.js | 7 + .../@graphql-tools/utils/cjs/jsutils.js | 25 + .../@graphql-tools/utils/cjs/loaders.js | 0 .../@graphql-tools/utils/cjs/mapSchema.js | 471 + .../@graphql-tools/utils/cjs/memoize.js | 209 + .../@graphql-tools/utils/cjs/mergeDeep.js | 108 + .../utils/cjs/mergeIncrementalResult.js | 53 + .../utils/cjs/observableToAsyncIterable.js | 97 + .../@graphql-tools/utils/cjs/package.json | 1 + .../utils/cjs/parse-graphql-json.js | 43 + .../utils/cjs/parse-graphql-sdl.js | 83 + .../utils/cjs/print-schema-with-directives.js | 386 + .../@graphql-tools/utils/cjs/prune.js | 170 + .../utils/cjs/registerAbortSignalListener.js | 46 + .../@graphql-tools/utils/cjs/renameType.js | 151 + .../@graphql-tools/utils/cjs/rewire.js | 159 + .../@graphql-tools/utils/cjs/rootTypes.js | 40 + .../@graphql-tools/utils/cjs/selectionSets.js | 8 + .../@graphql-tools/utils/cjs/stub.js | 68 + .../utils/cjs/transformInputValue.js | 59 + .../@graphql-tools/utils/cjs/types.js | 27 + .../utils/cjs/updateArgument.js | 54 + .../utils/cjs/validate-documents.js | 40 + .../utils/cjs/valueMatchesCriteria.js | 21 + .../@graphql-tools/utils/cjs/visitResult.js | 263 + .../@graphql-tools/utils/cjs/withCancel.js | 55 + .../utils/esm/AccumulatorMap.js | 17 + .../@graphql-tools/utils/esm/Interfaces.js | 28 + .../@graphql-tools/utils/esm/Path.js | 26 + .../@graphql-tools/utils/esm/addTypes.js | 58 + .../@graphql-tools/utils/esm/astFromType.js | 27 + .../@graphql-tools/utils/esm/astFromValue.js | 112 + .../utils/esm/astFromValueUntyped.js | 81 + .../utils/esm/build-operation-for-field.js | 360 + .../@graphql-tools/utils/esm/collectFields.js | 160 + .../@graphql-tools/utils/esm/comments.js | 388 + .../@graphql-tools/utils/esm/debugTimer.js | 13 + .../utils/esm/defaultValueAstFromType.js | 28 + .../utils/esm/descriptionFromObject.js | 18 + .../@graphql-tools/utils/esm/directives.js | 44 + .../@graphql-tools/utils/esm/errors.js | 62 + .../@graphql-tools/utils/esm/executor.js | 0 .../utils/esm/extractExtensionsFromSchema.js | 99 + .../@graphql-tools/utils/esm/fields.js | 108 + .../@graphql-tools/utils/esm/filterSchema.js | 64 + .../@graphql-tools/utils/esm/fixSchemaAst.js | 22 + .../utils/esm/forEachDefaultValue.js | 25 + .../@graphql-tools/utils/esm/forEachField.js | 15 + .../esm/get-arguments-with-directives.js | 28 + .../utils/esm/get-directives.js | 29 + .../utils/esm/get-fields-with-directives.js | 27 + .../utils/esm/get-implementing-types.js | 14 + .../utils/esm/getArgumentValues.js | 76 + .../utils/esm/getDirectiveExtensions.js | 83 + .../utils/esm/getDirectiveValues.js | 12 + .../utils/esm/getObjectTypeFromTypeMap.js | 9 + .../utils/esm/getOperationASTFromRequest.js | 12 + .../utils/esm/getResolversFromSchema.js | 68 + .../utils/esm/getResponseKeyFromInfo.js | 8 + .../@graphql-tools/utils/esm/heal.js | 176 + .../@graphql-tools/utils/esm/helpers.js | 122 + .../utils/esm/implementsAbstractType.js | 13 + .../@graphql-tools/utils/esm/index.js | 60 + .../utils/esm/isAsyncIterable.js | 3 + .../utils/esm/isDocumentNode.js | 4 + .../@graphql-tools/utils/esm/jsutils.js | 18 + .../@graphql-tools/utils/esm/loaders.js | 0 .../@graphql-tools/utils/esm/mapSchema.js | 467 + .../@graphql-tools/utils/esm/memoize.js | 200 + .../@graphql-tools/utils/esm/mergeDeep.js | 105 + .../utils/esm/mergeIncrementalResult.js | 50 + .../utils/esm/observableToAsyncIterable.js | 94 + .../utils/esm/parse-graphql-json.js | 40 + .../utils/esm/parse-graphql-sdl.js | 78 + .../utils/esm/print-schema-with-directives.js | 366 + .../@graphql-tools/utils/esm/prune.js | 167 + .../utils/esm/registerAbortSignalListener.js | 42 + .../@graphql-tools/utils/esm/renameType.js | 148 + .../@graphql-tools/utils/esm/rewire.js | 156 + .../@graphql-tools/utils/esm/rootTypes.js | 36 + .../@graphql-tools/utils/esm/selectionSets.js | 5 + .../@graphql-tools/utils/esm/stub.js | 62 + .../utils/esm/transformInputValue.js | 53 + .../@graphql-tools/utils/esm/types.js | 24 + .../utils/esm/updateArgument.js | 50 + .../utils/esm/validate-documents.js | 36 + .../utils/esm/valueMatchesCriteria.js | 18 + .../@graphql-tools/utils/esm/visitResult.js | 258 + .../@graphql-tools/utils/esm/withCancel.js | 51 + .../@graphql-tools/utils/package.json | 49 + .../utils/typings/AccumulatorMap.d.cts | 7 + .../utils/typings/AccumulatorMap.d.ts | 7 + .../utils/typings/Interfaces.d.cts | 302 + .../utils/typings/Interfaces.d.ts | 302 + .../@graphql-tools/utils/typings/Path.d.cts | 18 + .../@graphql-tools/utils/typings/Path.d.ts | 18 + .../utils/typings/addTypes.d.cts | 2 + .../utils/typings/addTypes.d.ts | 2 + .../utils/typings/astFromType.d.cts | 2 + .../utils/typings/astFromType.d.ts | 2 + .../utils/typings/astFromValue.d.cts | 25 + .../utils/typings/astFromValue.d.ts | 25 + .../utils/typings/astFromValueUntyped.d.cts | 18 + .../utils/typings/astFromValueUntyped.d.ts | 18 + .../typings/build-operation-for-field.d.cts | 18 + .../typings/build-operation-for-field.d.ts | 18 + .../utils/typings/collectFields.d.cts | 50 + .../utils/typings/collectFields.d.ts | 50 + .../utils/typings/comments.d.cts | 30 + .../utils/typings/comments.d.ts | 30 + .../utils/typings/debugTimer.d.cts | 2 + .../utils/typings/debugTimer.d.ts | 2 + .../typings/defaultValueAstFromType.d.cts | 9 + .../typings/defaultValueAstFromType.d.ts | 9 + .../utils/typings/descriptionFromObject.d.cts | 9 + .../utils/typings/descriptionFromObject.d.ts | 9 + .../utils/typings/directives.d.cts | 9 + .../utils/typings/directives.d.ts | 9 + .../@graphql-tools/utils/typings/errors.d.cts | 33 + .../@graphql-tools/utils/typings/errors.d.ts | 33 + .../utils/typings/executor.d.cts | 10 + .../utils/typings/executor.d.ts | 10 + .../typings/extractExtensionsFromSchema.d.cts | 3 + .../typings/extractExtensionsFromSchema.d.ts | 3 + .../@graphql-tools/utils/typings/fields.d.cts | 5 + .../@graphql-tools/utils/typings/fields.d.ts | 5 + .../utils/typings/filterSchema.d.cts | 14 + .../utils/typings/filterSchema.d.ts | 14 + .../utils/typings/fixSchemaAst.d.cts | 3 + .../utils/typings/fixSchemaAst.d.ts | 3 + .../utils/typings/forEachDefaultValue.d.cts | 3 + .../utils/typings/forEachDefaultValue.d.ts | 3 + .../utils/typings/forEachField.d.cts | 3 + .../utils/typings/forEachField.d.ts | 3 + .../get-arguments-with-directives.d.cts | 9 + .../get-arguments-with-directives.d.ts | 9 + .../utils/typings/get-directives.d.cts | 11 + .../utils/typings/get-directives.d.ts | 11 + .../typings/get-fields-with-directives.d.cts | 10 + .../typings/get-fields-with-directives.d.ts | 10 + .../typings/get-implementing-types.d.cts | 2 + .../utils/typings/get-implementing-types.d.ts | 2 + .../utils/typings/getArgumentValues.d.cts | 10 + .../utils/typings/getArgumentValues.d.ts | 10 + .../typings/getDirectiveExtensions.d.cts | 14 + .../utils/typings/getDirectiveExtensions.d.ts | 14 + .../utils/typings/getDirectiveValues.d.cts | 10 + .../utils/typings/getDirectiveValues.d.ts | 10 + .../typings/getObjectTypeFromTypeMap.d.cts | 3 + .../typings/getObjectTypeFromTypeMap.d.ts | 3 + .../typings/getOperationASTFromRequest.d.cts | 4 + .../typings/getOperationASTFromRequest.d.ts | 4 + .../typings/getResolversFromSchema.d.cts | 3 + .../utils/typings/getResolversFromSchema.d.ts | 3 + .../typings/getResponseKeyFromInfo.d.cts | 7 + .../utils/typings/getResponseKeyFromInfo.d.ts | 7 + .../@graphql-tools/utils/typings/heal.d.cts | 3 + .../@graphql-tools/utils/typings/heal.d.ts | 3 + .../utils/typings/helpers.d.cts | 43 + .../@graphql-tools/utils/typings/helpers.d.ts | 43 + .../typings/implementsAbstractType.d.cts | 3 + .../utils/typings/implementsAbstractType.d.ts | 3 + .../@graphql-tools/utils/typings/index.d.cts | 60 + .../@graphql-tools/utils/typings/index.d.ts | 60 + .../utils/typings/isAsyncIterable.d.cts | 1 + .../utils/typings/isAsyncIterable.d.ts | 1 + .../utils/typings/isDocumentNode.d.cts | 2 + .../utils/typings/isDocumentNode.d.ts | 2 + .../utils/typings/jsutils.d.cts | 8 + .../@graphql-tools/utils/typings/jsutils.d.ts | 8 + .../utils/typings/loaders.d.cts | 19 + .../@graphql-tools/utils/typings/loaders.d.ts | 19 + .../utils/typings/mapSchema.d.cts | 7 + .../utils/typings/mapSchema.d.ts | 7 + .../utils/typings/memoize.d.cts | 7 + .../@graphql-tools/utils/typings/memoize.d.ts | 7 + .../utils/typings/mergeDeep.d.cts | 9 + .../utils/typings/mergeDeep.d.ts | 9 + .../typings/mergeIncrementalResult.d.cts | 5 + .../utils/typings/mergeIncrementalResult.d.ts | 5 + .../typings/observableToAsyncIterable.d.cts | 12 + .../typings/observableToAsyncIterable.d.ts | 12 + .../utils/typings/parse-graphql-json.d.cts | 4 + .../utils/typings/parse-graphql-json.d.ts | 4 + .../utils/typings/parse-graphql-sdl.d.cts | 13 + .../utils/typings/parse-graphql-sdl.d.ts | 13 + .../print-schema-with-directives.d.cts | 26 + .../typings/print-schema-with-directives.d.ts | 26 + .../@graphql-tools/utils/typings/prune.d.cts | 8 + .../@graphql-tools/utils/typings/prune.d.ts | 8 + .../typings/registerAbortSignalListener.d.cts | 8 + .../typings/registerAbortSignalListener.d.ts | 8 + .../utils/typings/renameType.d.cts | 8 + .../utils/typings/renameType.d.ts | 8 + .../@graphql-tools/utils/typings/rewire.d.cts | 5 + .../@graphql-tools/utils/typings/rewire.d.ts | 5 + .../utils/typings/rootTypes.d.cts | 5 + .../utils/typings/rootTypes.d.ts | 5 + .../utils/typings/selectionSets.d.cts | 3 + .../utils/typings/selectionSets.d.ts | 3 + .../@graphql-tools/utils/typings/stub.d.cts | 9 + .../@graphql-tools/utils/typings/stub.d.ts | 9 + .../utils/typings/transformInputValue.d.cts | 6 + .../utils/typings/transformInputValue.d.ts | 6 + .../@graphql-tools/utils/typings/types.d.cts | 143 + .../@graphql-tools/utils/typings/types.d.ts | 143 + .../utils/typings/updateArgument.d.cts | 3 + .../utils/typings/updateArgument.d.ts | 3 + .../utils/typings/validate-documents.d.cts | 4 + .../utils/typings/validate-documents.d.ts | 4 + .../utils/typings/valueMatchesCriteria.d.cts | 1 + .../utils/typings/valueMatchesCriteria.d.ts | 1 + .../utils/typings/visitResult.d.cts | 15 + .../utils/typings/visitResult.d.ts | 15 + .../utils/typings/withCancel.d.cts | 3 + .../utils/typings/withCancel.d.ts | 3 + .../@graphql-typed-document-node/core | 1 + .../node_modules/@whatwg-node/promise-helpers | 1 + .../node_modules/cross-inspect | 1 + .../node_modules/graphql | 1 + .../node_modules/tslib | 1 + .../@graphql-typed-document-node/core/LICENSE | 9 + .../core/package.json | 15 + .../core/typings/index.d.ts | 29 + .../node_modules/graphql | 1 + .../node_modules/@mongodb-js/saslprep/LICENSE | 22 + .../saslprep/dist/.esm-wrapper.mjs | 4 + .../@mongodb-js/saslprep/dist/browser.d.ts | 5 + .../saslprep/dist/browser.d.ts.map | 1 + .../@mongodb-js/saslprep/dist/browser.js | 12 + .../@mongodb-js/saslprep/dist/browser.js.map | 1 + .../dist/code-points-data-browser.d.ts | 3 + .../dist/code-points-data-browser.d.ts.map | 1 + .../saslprep/dist/code-points-data-browser.js | 5 + .../dist/code-points-data-browser.js.map | 1 + .../saslprep/dist/code-points-data.d.ts | 3 + .../saslprep/dist/code-points-data.d.ts.map | 1 + .../saslprep/dist/code-points-data.js | 5 + .../saslprep/dist/code-points-data.js.map | 1 + .../saslprep/dist/code-points-src.d.ts | 7 + .../saslprep/dist/code-points-src.d.ts.map | 1 + .../saslprep/dist/code-points-src.js | 881 + .../saslprep/dist/code-points-src.js.map | 1 + .../saslprep/dist/generate-code-points.d.ts | 2 + .../dist/generate-code-points.d.ts.map | 1 + .../saslprep/dist/generate-code-points.js | 83 + .../saslprep/dist/generate-code-points.js.map | 1 + .../@mongodb-js/saslprep/dist/index.d.ts | 11 + .../@mongodb-js/saslprep/dist/index.d.ts.map | 1 + .../@mongodb-js/saslprep/dist/index.js | 65 + .../@mongodb-js/saslprep/dist/index.js.map | 1 + .../saslprep/dist/memory-code-points.d.ts | 10 + .../saslprep/dist/memory-code-points.d.ts.map | 1 + .../saslprep/dist/memory-code-points.js | 32 + .../saslprep/dist/memory-code-points.js.map | 1 + .../@mongodb-js/saslprep/dist/node.d.ts | 10 + .../@mongodb-js/saslprep/dist/node.d.ts.map | 1 + .../@mongodb-js/saslprep/dist/node.js | 15 + .../@mongodb-js/saslprep/dist/node.js.map | 1 + .../@mongodb-js/saslprep/dist/util.d.ts | 2 + .../@mongodb-js/saslprep/dist/util.d.ts.map | 1 + .../@mongodb-js/saslprep/dist/util.js | 11 + .../@mongodb-js/saslprep/dist/util.js.map | 1 + .../@mongodb-js/saslprep/package.json | 86 + .../@mongodb-js/saslprep/readme.md | 29 + .../node_modules/sparse-bitfield | 1 + .../@protobufjs/aspromise/LICENSE | 26 + .../@protobufjs/aspromise/README.md | 13 + .../@protobufjs/aspromise/index.d.ts | 13 + .../@protobufjs/aspromise/index.js | 52 + .../@protobufjs/aspromise/package.json | 21 + .../@protobufjs/aspromise/tests/index.js | 130 + .../node_modules/@protobufjs/base64/LICENSE | 26 + .../node_modules/@protobufjs/base64/README.md | 19 + .../@protobufjs/base64/index.d.ts | 32 + .../node_modules/@protobufjs/base64/index.js | 139 + .../@protobufjs/base64/package.json | 21 + .../@protobufjs/base64/tests/index.js | 46 + .../node_modules/@protobufjs/codegen/LICENSE | 26 + .../@protobufjs/codegen/README.md | 49 + .../@protobufjs/codegen/index.d.ts | 31 + .../node_modules/@protobufjs/codegen/index.js | 112 + .../@protobufjs/codegen/package.json | 13 + .../@protobufjs/codegen/tests/index.js | 13 + .../@protobufjs/eventemitter/CHANGELOG.md | 8 + .../@protobufjs/eventemitter/LICENSE | 26 + .../@protobufjs/eventemitter/README.md | 22 + .../@protobufjs/eventemitter/index.d.ts | 45 + .../@protobufjs/eventemitter/index.js | 86 + .../@protobufjs/eventemitter/package.json | 21 + .../@protobufjs/eventemitter/tests/index.js | 83 + .../node_modules/@protobufjs/aspromise | 1 + .../@protobufjs/fetch/CHANGELOG.md | 8 + .../node_modules/@protobufjs/fetch/LICENSE | 26 + .../node_modules/@protobufjs/fetch/README.md | 13 + .../node_modules/@protobufjs/fetch/index.d.ts | 56 + .../node_modules/@protobufjs/fetch/index.js | 112 + .../@protobufjs/fetch/package.json | 27 + .../@protobufjs/fetch/tests/data/file.txt | 1 + .../@protobufjs/fetch/tests/index.js | 158 + .../node_modules/@protobufjs/fetch/util/fs.js | 11 + .../node_modules/@protobufjs/float/LICENSE | 26 + .../node_modules/@protobufjs/float/README.md | 102 + .../@protobufjs/float/bench/index.js | 87 + .../@protobufjs/float/bench/suite.js | 46 + .../node_modules/@protobufjs/float/index.d.ts | 83 + .../node_modules/@protobufjs/float/index.js | 335 + .../@protobufjs/float/package.json | 26 + .../@protobufjs/float/tests/index.js | 100 + .../@protobufjs/inquire/CHANGELOG.md | 8 + .../node_modules/@protobufjs/inquire/LICENSE | 26 + .../@protobufjs/inquire/README.md | 13 + .../@protobufjs/inquire/index.d.ts | 10 + .../node_modules/@protobufjs/inquire/index.js | 38 + .../@protobufjs/inquire/package.json | 21 + .../@protobufjs/inquire/tests/data/array.js | 1 + .../inquire/tests/data/emptyArray.js | 1 + .../inquire/tests/data/emptyObject.js | 1 + .../@protobufjs/inquire/tests/data/object.js | 1 + .../@protobufjs/inquire/tests/index.js | 20 + .../node_modules/@protobufjs/path/LICENSE | 26 + .../node_modules/@protobufjs/path/README.md | 19 + .../node_modules/@protobufjs/path/index.d.ts | 22 + .../node_modules/@protobufjs/path/index.js | 65 + .../@protobufjs/path/package.json | 21 + .../@protobufjs/path/tests/index.js | 60 + .../node_modules/@protobufjs/pool/.npmignore | 3 + .../node_modules/@protobufjs/pool/LICENSE | 26 + .../node_modules/@protobufjs/pool/README.md | 13 + .../node_modules/@protobufjs/pool/index.d.ts | 32 + .../node_modules/@protobufjs/pool/index.js | 48 + .../@protobufjs/pool/package.json | 21 + .../@protobufjs/pool/tests/index.js | 33 + .../@protobufjs/utf8/CHANGELOG.md | 8 + .../node_modules/@protobufjs/utf8/LICENSE | 26 + .../node_modules/@protobufjs/utf8/README.md | 20 + .../node_modules/@protobufjs/utf8/index.d.ts | 24 + .../node_modules/@protobufjs/utf8/index.js | 115 + .../@protobufjs/utf8/package.json | 21 + .../utf8/tests/data/surrogate_pair_bug.txt | 207 + .../@protobufjs/utf8/tests/data/utf8.txt | 216 + .../@protobufjs/utf8/tests/index.js | 79 + .../@standard-schema/spec/LICENSE | 21 + .../@standard-schema/spec/README.md | 198 + .../@standard-schema/spec/dist/index.cjs | 18 + .../@standard-schema/spec/dist/index.d.cts | 119 + .../@standard-schema/spec/dist/index.d.ts | 119 + .../@standard-schema/spec/dist/index.js | 0 .../@standard-schema/spec/package.json | 52 + .../node_modules/@types/long/LICENSE | 21 + .../node_modules/@types/long/README.md | 16 + .../node_modules/@types/long/index.d.ts | 389 + .../node_modules/@types/long/package.json | 25 + .../@types/webidl-conversions/LICENSE | 21 + .../@types/webidl-conversions/README.md | 15 + .../@types/webidl-conversions/index.d.ts | 91 + .../@types/webidl-conversions/package.json | 30 + .../node_modules/@types/webidl-conversions | 1 + .../node_modules/@types/whatwg-url/LICENSE | 21 + .../node_modules/@types/whatwg-url/README.md | 15 + .../node_modules/@types/whatwg-url/index.d.ts | 172 + .../@types/whatwg-url/lib/URL-impl.d.ts | 22 + .../@types/whatwg-url/lib/URL.d.ts | 66 + .../whatwg-url/lib/URLSearchParams-impl.d.ts | 20 + .../whatwg-url/lib/URLSearchParams.d.ts | 92 + .../@types/whatwg-url/package.json | 38 + .../@types/whatwg-url/webidl2js-wrapper.d.ts | 4 + .../@whatwg-node/promise-helpers/cjs/index.js | 270 + .../promise-helpers/cjs/package.json | 1 + .../@whatwg-node/promise-helpers/esm/index.js | 257 + .../@whatwg-node/promise-helpers/package.json | 43 + .../promise-helpers/typings/index.d.cts | 31 + .../promise-helpers/typings/index.d.ts | 31 + .../node_modules/tslib | 1 + .../node_modules/async-retry/LICENSE.md | 21 + .../node_modules/async-retry/README.md | 53 + .../node_modules/async-retry/lib/index.js | 61 + .../node_modules/async-retry/package.json | 55 + .../async-retry@1.3.3/node_modules/retry | 1 + .../available-typed-arrays/.eslintrc | 5 + .../.github/FUNDING.yml | 12 + .../available-typed-arrays/.nycrc | 9 + .../available-typed-arrays/CHANGELOG.md | 100 + .../available-typed-arrays/LICENSE | 21 + .../available-typed-arrays/README.md | 55 + .../available-typed-arrays/index.d.ts | 8 + .../available-typed-arrays/index.js | 17 + .../available-typed-arrays/package.json | 93 + .../available-typed-arrays/test/index.js | 18 + .../available-typed-arrays/tsconfig.json | 49 + .../node_modules/possible-typed-array-names | 1 + .../node_modules/body-parser/LICENSE | 23 + .../node_modules/body-parser/README.md | 509 + .../node_modules/body-parser/index.js | 55 + .../node_modules/body-parser/lib/read.js | 247 + .../body-parser/lib/types/json.js | 186 + .../node_modules/body-parser/lib/types/raw.js | 42 + .../body-parser/lib/types/text.js | 36 + .../body-parser/lib/types/urlencoded.js | 138 + .../node_modules/body-parser/lib/utils.js | 100 + .../node_modules/body-parser/package.json | 65 + .../body-parser@2.3.0/node_modules/bytes | 1 + .../node_modules/content-type | 1 + .../body-parser@2.3.0/node_modules/debug | 1 + .../node_modules/http-errors | 1 + .../body-parser@2.3.0/node_modules/iconv-lite | 1 + .../node_modules/on-finished | 1 + .../.pnpm/body-parser@2.3.0/node_modules/qs | 1 + .../body-parser@2.3.0/node_modules/raw-body | 1 + .../body-parser@2.3.0/node_modules/type-is | 1 + .../bson@7.3.3/node_modules/bson/LICENSE.md | 201 + .../bson@7.3.3/node_modules/bson/README.md | 321 + .../bson@7.3.3/node_modules/bson/bson.d.ts | 1901 ++ .../node_modules/bson/etc/prepare.js | 24 + .../node_modules/bson/lib/bson.bundle.js | 4878 ++++ .../node_modules/bson/lib/bson.bundle.js.map | 1 + .../bson@7.3.3/node_modules/bson/lib/bson.cjs | 4873 ++++ .../node_modules/bson/lib/bson.cjs.map | 1 + .../bson@7.3.3/node_modules/bson/lib/bson.mjs | 4840 ++++ .../node_modules/bson/lib/bson.mjs.map | 1 + .../node_modules/bson/lib/bson.node.mjs | 4840 ++++ .../node_modules/bson/lib/bson.node.mjs.map | 1 + .../node_modules/bson/lib/bson.rn.cjs | 4881 ++++ .../node_modules/bson/lib/bson.rn.cjs.map | 1 + .../bson@7.3.3/node_modules/bson/package.json | 118 + .../node_modules/bson/src/binary.ts | 751 + .../bson@7.3.3/node_modules/bson/src/bson.ts | 253 + .../node_modules/bson/src/bson_value.ts | 55 + .../bson@7.3.3/node_modules/bson/src/code.ts | 69 + .../node_modules/bson/src/constants.ts | 147 + .../node_modules/bson/src/db_ref.ts | 128 + .../node_modules/bson/src/decimal128.ts | 855 + .../node_modules/bson/src/double.ts | 115 + .../bson@7.3.3/node_modules/bson/src/error.ts | 105 + .../node_modules/bson/src/extended_json.ts | 557 + .../bson@7.3.3/node_modules/bson/src/index.ts | 19 + .../node_modules/bson/src/int_32.ts | 101 + .../bson@7.3.3/node_modules/bson/src/long.ts | 1241 ++ .../node_modules/bson/src/max_key.ts | 31 + .../node_modules/bson/src/min_key.ts | 31 + .../node_modules/bson/src/objectid.ts | 546 + .../node_modules/bson/src/parse_utf8.ts | 35 + .../bson/src/parser/calculate_size.ts | 277 + .../bson/src/parser/deserializer.ts | 793 + .../bson/src/parser/on_demand/index.ts | 32 + .../src/parser/on_demand/parse_to_elements.ts | 190 + .../bson/src/parser/serializer.ts | 749 + .../node_modules/bson/src/parser/utils.ts | 69 + .../node_modules/bson/src/regexp.ts | 116 + .../node_modules/bson/src/symbol.ts | 55 + .../node_modules/bson/src/timestamp.ts | 331 + .../node_modules/bson/src/utils/byte_utils.ts | 80 + .../node_modules/bson/src/utils/latin.ts | 104 + .../bson/src/utils/node_byte_utils.ts | 193 + .../bson/src/utils/number_utils.ts | 204 + .../bson/src/utils/string_utils.ts | 44 + .../bson/src/utils/web_byte_utils.ts | 304 + .../bytes@3.1.2/node_modules/bytes/History.md | 97 + .../bytes@3.1.2/node_modules/bytes/LICENSE | 23 + .../bytes@3.1.2/node_modules/bytes/Readme.md | 152 + .../bytes@3.1.2/node_modules/bytes/index.js | 170 + .../node_modules/bytes/package.json | 42 + .../call-bind-apply-helpers/.eslintrc | 17 + .../.github/FUNDING.yml | 12 + .../call-bind-apply-helpers/.nycrc | 9 + .../call-bind-apply-helpers/CHANGELOG.md | 30 + .../call-bind-apply-helpers/LICENSE | 21 + .../call-bind-apply-helpers/README.md | 62 + .../call-bind-apply-helpers/actualApply.d.ts | 1 + .../call-bind-apply-helpers/actualApply.js | 10 + .../call-bind-apply-helpers/applyBind.d.ts | 19 + .../call-bind-apply-helpers/applyBind.js | 10 + .../functionApply.d.ts | 1 + .../call-bind-apply-helpers/functionApply.js | 4 + .../call-bind-apply-helpers/functionCall.d.ts | 1 + .../call-bind-apply-helpers/functionCall.js | 4 + .../call-bind-apply-helpers/index.d.ts | 64 + .../call-bind-apply-helpers/index.js | 15 + .../call-bind-apply-helpers/package.json | 85 + .../call-bind-apply-helpers/reflectApply.d.ts | 3 + .../call-bind-apply-helpers/reflectApply.js | 4 + .../call-bind-apply-helpers/test/index.js | 63 + .../call-bind-apply-helpers/tsconfig.json | 9 + .../node_modules/es-errors | 1 + .../node_modules/function-bind | 1 + .../node_modules/call-bind-apply-helpers | 1 + .../node_modules/call-bind/.eslintignore | 1 + .../node_modules/call-bind/.eslintrc | 16 + .../call-bind/.github/FUNDING.yml | 12 + .../node_modules/call-bind/.nycrc | 9 + .../node_modules/call-bind/CHANGELOG.md | 115 + .../node_modules/call-bind/LICENSE | 21 + .../node_modules/call-bind/README.md | 64 + .../node_modules/call-bind/callBound.js | 15 + .../node_modules/call-bind/index.js | 24 + .../node_modules/call-bind/package.json | 93 + .../node_modules/call-bind/test/callBound.js | 54 + .../node_modules/call-bind/test/index.js | 82 + .../node_modules/es-define-property | 1 + .../node_modules/get-intrinsic | 1 + .../node_modules/set-function-length | 1 + .../node_modules/call-bind-apply-helpers | 1 + .../node_modules/call-bound/.eslintrc | 13 + .../call-bound/.github/FUNDING.yml | 12 + .../node_modules/call-bound/.nycrc | 9 + .../node_modules/call-bound/CHANGELOG.md | 42 + .../node_modules/call-bound/LICENSE | 21 + .../node_modules/call-bound/README.md | 53 + .../node_modules/call-bound/index.d.ts | 94 + .../node_modules/call-bound/index.js | 19 + .../node_modules/call-bound/package.json | 99 + .../node_modules/call-bound/test/index.js | 61 + .../node_modules/call-bound/tsconfig.json | 10 + .../node_modules/get-intrinsic | 1 + .../node_modules/content-type/HISTORY.md | 29 + .../node_modules/content-type/LICENSE | 22 + .../node_modules/content-type/README.md | 94 + .../node_modules/content-type/index.js | 225 + .../node_modules/content-type/package.json | 42 + .../node_modules/content-type/LICENSE | 22 + .../node_modules/content-type/README.md | 71 + .../node_modules/content-type/dist/index.d.ts | 46 + .../node_modules/content-type/dist/index.js | 176 + .../content-type/dist/index.js.map | 1 + .../node_modules/content-type/package.json | 52 + .../cors@2.8.6/node_modules/cors/LICENSE | 22 + .../cors@2.8.6/node_modules/cors/README.md | 277 + .../cors@2.8.6/node_modules/cors/lib/index.js | 238 + .../cors@2.8.6/node_modules/cors/package.json | 42 + .../cors@2.8.6/node_modules/object-assign | 1 + .../.pnpm/cors@2.8.6/node_modules/vary | 1 + .../node_modules/cross-inspect/cjs/index.js | 101 + .../cross-inspect/cjs/package.json | 1 + .../node_modules/cross-inspect/esm/index.js | 97 + .../node_modules/cross-inspect/package.json | 43 + .../cross-inspect/typings/index.d.cts | 4 + .../cross-inspect/typings/index.d.ts | 4 + .../cross-inspect@1.0.1/node_modules/tslib | 1 + .../debug@4.4.3/node_modules/debug/LICENSE | 20 + .../debug@4.4.3/node_modules/debug/README.md | 481 + .../node_modules/debug/package.json | 64 + .../node_modules/debug/src/browser.js | 272 + .../node_modules/debug/src/common.js | 292 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/node.js | 263 + .../.pnpm/debug@4.4.3/node_modules/ms | 1 + .../define-data-property/.eslintrc | 24 + .../define-data-property/.github/FUNDING.yml | 12 + .../node_modules/define-data-property/.nycrc | 13 + .../define-data-property/CHANGELOG.md | 70 + .../node_modules/define-data-property/LICENSE | 21 + .../define-data-property/README.md | 67 + .../define-data-property/index.d.ts | 12 + .../define-data-property/index.js | 56 + .../define-data-property/package.json | 106 + .../define-data-property/test/index.js | 392 + .../define-data-property/tsconfig.json | 59 + .../node_modules/es-define-property | 1 + .../node_modules/es-errors | 1 + .../node_modules/gopd | 1 + .../depd@2.0.0/node_modules/depd/History.md | 103 + .../depd@2.0.0/node_modules/depd/LICENSE | 22 + .../depd@2.0.0/node_modules/depd/Readme.md | 280 + .../depd@2.0.0/node_modules/depd/index.js | 538 + .../node_modules/depd/lib/browser/index.js | 77 + .../depd@2.0.0/node_modules/depd/package.json | 45 + .../node_modules/call-bind-apply-helpers | 1 + .../node_modules/dunder-proto/.eslintrc | 5 + .../dunder-proto/.github/FUNDING.yml | 12 + .../node_modules/dunder-proto/.nycrc | 13 + .../node_modules/dunder-proto/CHANGELOG.md | 24 + .../node_modules/dunder-proto/LICENSE | 21 + .../node_modules/dunder-proto/README.md | 54 + .../node_modules/dunder-proto/get.d.ts | 5 + .../node_modules/dunder-proto/get.js | 30 + .../node_modules/dunder-proto/package.json | 76 + .../node_modules/dunder-proto/set.d.ts | 5 + .../node_modules/dunder-proto/set.js | 35 + .../node_modules/dunder-proto/test/get.js | 34 + .../node_modules/dunder-proto/test/index.js | 4 + .../node_modules/dunder-proto/test/set.js | 50 + .../node_modules/dunder-proto/tsconfig.json | 9 + .../dunder-proto@1.0.1/node_modules/es-errors | 1 + .../dunder-proto@1.0.1/node_modules/gopd | 1 + .../node_modules/ee-first/LICENSE | 22 + .../node_modules/ee-first/README.md | 80 + .../node_modules/ee-first/index.js | 95 + .../node_modules/ee-first/package.json | 29 + .../node_modules/encodeurl/LICENSE | 22 + .../node_modules/encodeurl/README.md | 109 + .../node_modules/encodeurl/index.js | 60 + .../node_modules/encodeurl/package.json | 40 + .../node_modules/es-define-property/.eslintrc | 13 + .../es-define-property/.github/FUNDING.yml | 12 + .../node_modules/es-define-property/.nycrc | 9 + .../es-define-property/CHANGELOG.md | 29 + .../node_modules/es-define-property/LICENSE | 21 + .../node_modules/es-define-property/README.md | 49 + .../es-define-property/index.d.ts | 3 + .../node_modules/es-define-property/index.js | 14 + .../es-define-property/package.json | 81 + .../es-define-property/test/index.js | 56 + .../es-define-property/tsconfig.json | 10 + .../node_modules/es-errors/.eslintrc | 5 + .../es-errors/.github/FUNDING.yml | 12 + .../node_modules/es-errors/CHANGELOG.md | 40 + .../node_modules/es-errors/LICENSE | 21 + .../node_modules/es-errors/README.md | 55 + .../node_modules/es-errors/eval.d.ts | 3 + .../node_modules/es-errors/eval.js | 4 + .../node_modules/es-errors/index.d.ts | 3 + .../node_modules/es-errors/index.js | 4 + .../node_modules/es-errors/package.json | 80 + .../node_modules/es-errors/range.d.ts | 3 + .../node_modules/es-errors/range.js | 4 + .../node_modules/es-errors/ref.d.ts | 3 + .../node_modules/es-errors/ref.js | 4 + .../node_modules/es-errors/syntax.d.ts | 3 + .../node_modules/es-errors/syntax.js | 4 + .../node_modules/es-errors/test/index.js | 19 + .../node_modules/es-errors/tsconfig.json | 49 + .../node_modules/es-errors/type.d.ts | 3 + .../node_modules/es-errors/type.js | 4 + .../node_modules/es-errors/uri.d.ts | 3 + .../node_modules/es-errors/uri.js | 4 + .../node_modules/es-errors | 1 + .../node_modules/es-object-atoms/.eslintrc | 16 + .../es-object-atoms/.github/FUNDING.yml | 12 + .../node_modules/es-object-atoms/CHANGELOG.md | 44 + .../node_modules/es-object-atoms/LICENSE | 21 + .../node_modules/es-object-atoms/README.md | 63 + .../RequireObjectCoercible.d.ts | 3 + .../es-object-atoms/RequireObjectCoercible.js | 11 + .../es-object-atoms/ToObject.d.ts | 7 + .../node_modules/es-object-atoms/ToObject.js | 10 + .../node_modules/es-object-atoms/index.d.ts | 3 + .../node_modules/es-object-atoms/index.js | 4 + .../es-object-atoms/isObject.d.ts | 3 + .../node_modules/es-object-atoms/isObject.js | 6 + .../node_modules/es-object-atoms/package.json | 79 + .../es-object-atoms/test/index.js | 38 + .../es-object-atoms/tsconfig.json | 7 + .../node_modules/escape-html/LICENSE | 24 + .../node_modules/escape-html/Readme.md | 43 + .../node_modules/escape-html/index.js | 78 + .../node_modules/escape-html/package.json | 24 + .../finalhandler@2.1.1/node_modules/debug | 1 + .../finalhandler@2.1.1/node_modules/encodeurl | 1 + .../node_modules/escape-html | 1 + .../node_modules/finalhandler/HISTORY.md | 239 + .../node_modules/finalhandler/LICENSE | 22 + .../node_modules/finalhandler/README.md | 150 + .../node_modules/finalhandler/index.js | 293 + .../node_modules/finalhandler/package.json | 47 + .../node_modules/on-finished | 1 + .../finalhandler@2.1.1/node_modules/parseurl | 1 + .../finalhandler@2.1.1/node_modules/statuses | 1 + .../node_modules/for-each/.editorconfig | 20 + .../node_modules/for-each/.eslintrc | 30 + .../node_modules/for-each/.github/FUNDING.yml | 12 + .../node_modules/for-each/.github/SECURITY.md | 3 + .../node_modules/for-each/.nycrc | 8 + .../node_modules/for-each/CHANGELOG.md | 107 + .../node_modules/for-each/LICENSE | 22 + .../node_modules/for-each/README.md | 39 + .../node_modules/for-each/index.d.ts | 35 + .../node_modules/for-each/index.js | 69 + .../node_modules/for-each/package.json | 76 + .../node_modules/for-each/test/test.js | 224 + .../node_modules/for-each/tsconfig.json | 8 + .../for-each@0.3.5/node_modules/is-callable | 1 + .../node_modules/function-bind/.eslintrc | 21 + .../function-bind/.github/FUNDING.yml | 12 + .../function-bind/.github/SECURITY.md | 3 + .../node_modules/function-bind/.nycrc | 13 + .../node_modules/function-bind/CHANGELOG.md | 136 + .../node_modules/function-bind/LICENSE | 20 + .../node_modules/function-bind/README.md | 46 + .../function-bind/implementation.js | 84 + .../node_modules/function-bind/index.js | 5 + .../node_modules/function-bind/package.json | 87 + .../node_modules/function-bind/test/.eslintrc | 9 + .../node_modules/function-bind/test/index.js | 252 + .../node_modules/call-bind-apply-helpers | 1 + .../node_modules/es-define-property | 1 + .../node_modules/es-errors | 1 + .../node_modules/es-object-atoms | 1 + .../node_modules/function-bind | 1 + .../node_modules/get-intrinsic/.eslintrc | 42 + .../get-intrinsic/.github/FUNDING.yml | 12 + .../node_modules/get-intrinsic/.nycrc | 9 + .../node_modules/get-intrinsic/CHANGELOG.md | 186 + .../node_modules/get-intrinsic/LICENSE | 21 + .../node_modules/get-intrinsic/README.md | 71 + .../node_modules/get-intrinsic/index.js | 378 + .../node_modules/get-intrinsic/package.json | 97 + .../get-intrinsic/test/GetIntrinsic.js | 274 + .../node_modules/get-proto | 1 + .../get-intrinsic@1.3.0/node_modules/gopd | 1 + .../node_modules/has-symbols | 1 + .../get-intrinsic@1.3.0/node_modules/hasown | 1 + .../node_modules/math-intrinsics | 1 + .../get-proto@1.0.1/node_modules/dunder-proto | 1 + .../node_modules/es-object-atoms | 1 + .../node_modules/get-proto/.eslintrc | 10 + .../get-proto/.github/FUNDING.yml | 12 + .../node_modules/get-proto/.nycrc | 9 + .../node_modules/get-proto/CHANGELOG.md | 21 + .../node_modules/get-proto/LICENSE | 21 + .../get-proto/Object.getPrototypeOf.d.ts | 5 + .../get-proto/Object.getPrototypeOf.js | 6 + .../node_modules/get-proto/README.md | 50 + .../get-proto/Reflect.getPrototypeOf.d.ts | 3 + .../get-proto/Reflect.getPrototypeOf.js | 4 + .../node_modules/get-proto/index.d.ts | 5 + .../node_modules/get-proto/index.js | 27 + .../node_modules/get-proto/package.json | 81 + .../node_modules/get-proto/test/index.js | 68 + .../node_modules/get-proto/tsconfig.json | 9 + .../gopd@1.2.0/node_modules/gopd/.eslintrc | 16 + .../node_modules/gopd/.github/FUNDING.yml | 12 + .../gopd@1.2.0/node_modules/gopd/CHANGELOG.md | 45 + .../gopd@1.2.0/node_modules/gopd/LICENSE | 21 + .../gopd@1.2.0/node_modules/gopd/README.md | 40 + .../gopd@1.2.0/node_modules/gopd/gOPD.d.ts | 1 + .../gopd@1.2.0/node_modules/gopd/gOPD.js | 4 + .../gopd@1.2.0/node_modules/gopd/index.d.ts | 5 + .../gopd@1.2.0/node_modules/gopd/index.js | 15 + .../gopd@1.2.0/node_modules/gopd/package.json | 77 + .../node_modules/gopd/test/index.js | 36 + .../node_modules/gopd/tsconfig.json | 9 + .../node_modules/graphql | 1 + .../node_modules/graphql-tag/LICENSE | 21 + .../node_modules/graphql-tag/README.md | 251 + .../graphql-tag/lib/graphql-tag.umd.js | 137 + .../graphql-tag/lib/graphql-tag.umd.js.flow | 7 + .../graphql-tag/lib/graphql-tag.umd.js.map | 1 + .../node_modules/graphql-tag/lib/index.d.ts | 15 + .../graphql-tag/lib/index.d.ts.map | 1 + .../node_modules/graphql-tag/lib/index.js | 122 + .../node_modules/graphql-tag/lib/index.js.map | 1 + .../node_modules/graphql-tag/lib/tests.cjs.js | 425 + .../graphql-tag/lib/tests.cjs.js.map | 1 + .../node_modules/graphql-tag/lib/tests.d.ts | 2 + .../graphql-tag/lib/tests.d.ts.map | 1 + .../node_modules/graphql-tag/lib/tests.js | 303 + .../node_modules/graphql-tag/lib/tests.js.map | 1 + .../node_modules/graphql-tag/loader.js | 191 + .../node_modules/graphql-tag/main.js | 3 + .../node_modules/graphql-tag/package.json | 65 + .../graphql-tag/src/index.js.flow | 7 + .../node_modules/graphql-tag/src/index.ts | 178 + .../node_modules/graphql-tag/src/tests.ts | 516 + .../node_modules/tslib | 1 + .../node_modules/graphql/LICENSE | 21 + .../graphql/NotSupportedTSVersion.d.ts | 1 + .../node_modules/graphql/README.md | 197 + .../graphql/__dev__/devMode.d.mts | 1 + .../node_modules/graphql/__dev__/devMode.d.ts | 1 + .../node_modules/graphql/__dev__/devMode.js | 3 + .../node_modules/graphql/__dev__/devMode.mjs | 3 + .../graphql/__dev__/diagnostics.d.mts | 1 + .../graphql/__dev__/diagnostics.d.ts | 1 + .../graphql/__dev__/diagnostics.js | 3 + .../graphql/__dev__/diagnostics.mjs | 3 + .../graphql/__dev__/error/GraphQLError.d.mts | 1 + .../graphql/__dev__/error/GraphQLError.d.ts | 1 + .../graphql/__dev__/error/GraphQLError.js | 3 + .../graphql/__dev__/error/GraphQLError.mjs | 3 + .../__dev__/error/ensureGraphQLError.d.mts | 1 + .../__dev__/error/ensureGraphQLError.d.ts | 1 + .../__dev__/error/ensureGraphQLError.js | 3 + .../__dev__/error/ensureGraphQLError.mjs | 3 + .../graphql/__dev__/error/index.d.mts | 1 + .../graphql/__dev__/error/index.d.ts | 1 + .../graphql/__dev__/error/index.js | 3 + .../graphql/__dev__/error/index.mjs | 3 + .../graphql/__dev__/error/locatedError.d.mts | 1 + .../graphql/__dev__/error/locatedError.d.ts | 1 + .../graphql/__dev__/error/locatedError.js | 3 + .../graphql/__dev__/error/locatedError.mjs | 3 + .../graphql/__dev__/error/syntaxError.d.mts | 1 + .../graphql/__dev__/error/syntaxError.d.ts | 1 + .../graphql/__dev__/error/syntaxError.js | 3 + .../graphql/__dev__/error/syntaxError.mjs | 3 + .../AbortedGraphQLExecutionError.d.mts | 1 + .../AbortedGraphQLExecutionError.d.ts | 1 + .../execution/AbortedGraphQLExecutionError.js | 3 + .../AbortedGraphQLExecutionError.mjs | 3 + .../__dev__/execution/AsyncWorkTracker.d.mts | 1 + .../__dev__/execution/AsyncWorkTracker.d.ts | 1 + .../__dev__/execution/AsyncWorkTracker.js | 3 + .../__dev__/execution/AsyncWorkTracker.mjs | 3 + .../__dev__/execution/ExecutionArgs.d.mts | 1 + .../__dev__/execution/ExecutionArgs.d.ts | 1 + .../__dev__/execution/ExecutionArgs.js | 3 + .../__dev__/execution/ExecutionArgs.mjs | 3 + .../graphql/__dev__/execution/Executor.d.mts | 1 + .../graphql/__dev__/execution/Executor.d.ts | 1 + .../graphql/__dev__/execution/Executor.js | 3 + .../graphql/__dev__/execution/Executor.mjs | 3 + .../ExecutorThrowingOnIncremental.d.mts | 1 + .../ExecutorThrowingOnIncremental.d.ts | 1 + .../ExecutorThrowingOnIncremental.js | 3 + .../ExecutorThrowingOnIncremental.mjs | 3 + .../__dev__/execution/buildResolveInfo.d.mts | 1 + .../__dev__/execution/buildResolveInfo.d.ts | 1 + .../__dev__/execution/buildResolveInfo.js | 3 + .../__dev__/execution/buildResolveInfo.mjs | 3 + .../execution/cancellablePromise.d.mts | 1 + .../__dev__/execution/cancellablePromise.d.ts | 1 + .../__dev__/execution/cancellablePromise.js | 3 + .../__dev__/execution/cancellablePromise.mjs | 3 + .../__dev__/execution/collectFields.d.mts | 1 + .../__dev__/execution/collectFields.d.ts | 1 + .../__dev__/execution/collectFields.js | 3 + .../__dev__/execution/collectFields.mjs | 3 + .../execution/collectIteratorPromises.d.mts | 1 + .../execution/collectIteratorPromises.d.ts | 1 + .../execution/collectIteratorPromises.js | 3 + .../execution/collectIteratorPromises.mjs | 3 + .../createSharedExecutionContext.d.mts | 1 + .../createSharedExecutionContext.d.ts | 1 + .../execution/createSharedExecutionContext.js | 3 + .../createSharedExecutionContext.mjs | 3 + .../graphql/__dev__/execution/execute.d.mts | 1 + .../graphql/__dev__/execution/execute.d.ts | 1 + .../graphql/__dev__/execution/execute.js | 3 + .../graphql/__dev__/execution/execute.mjs | 3 + .../__dev__/execution/getStreamUsage.d.mts | 1 + .../__dev__/execution/getStreamUsage.d.ts | 1 + .../__dev__/execution/getStreamUsage.js | 3 + .../__dev__/execution/getStreamUsage.mjs | 3 + .../execution/getVariableSignature.d.mts | 1 + .../execution/getVariableSignature.d.ts | 1 + .../__dev__/execution/getVariableSignature.js | 3 + .../execution/getVariableSignature.mjs | 3 + .../graphql/__dev__/execution/hooks.d.mts | 1 + .../graphql/__dev__/execution/hooks.d.ts | 1 + .../graphql/__dev__/execution/hooks.js | 3 + .../graphql/__dev__/execution/hooks.mjs | 3 + .../execution/incremental/Computation.d.mts | 1 + .../execution/incremental/Computation.d.ts | 1 + .../execution/incremental/Computation.js | 3 + .../execution/incremental/Computation.mjs | 3 + .../incremental/IncrementalExecutor.d.mts | 1 + .../incremental/IncrementalExecutor.d.ts | 1 + .../incremental/IncrementalExecutor.js | 3 + .../incremental/IncrementalExecutor.mjs | 3 + .../incremental/IncrementalPublisher.d.mts | 1 + .../incremental/IncrementalPublisher.d.ts | 1 + .../incremental/IncrementalPublisher.js | 3 + .../incremental/IncrementalPublisher.mjs | 3 + .../__dev__/execution/incremental/Queue.d.mts | 1 + .../__dev__/execution/incremental/Queue.d.ts | 1 + .../__dev__/execution/incremental/Queue.js | 3 + .../__dev__/execution/incremental/Queue.mjs | 3 + .../execution/incremental/WorkQueue.d.mts | 1 + .../execution/incremental/WorkQueue.d.ts | 1 + .../execution/incremental/WorkQueue.js | 3 + .../execution/incremental/WorkQueue.mjs | 3 + .../incremental/buildExecutionPlan.d.mts | 1 + .../incremental/buildExecutionPlan.d.ts | 1 + .../incremental/buildExecutionPlan.js | 3 + .../incremental/buildExecutionPlan.mjs | 3 + .../graphql/__dev__/execution/index.d.mts | 1 + .../graphql/__dev__/execution/index.d.ts | 1 + .../graphql/__dev__/execution/index.js | 3 + .../graphql/__dev__/execution/index.mjs | 3 + .../BranchingIncrementalExecutor.d.mts | 1 + .../BranchingIncrementalExecutor.d.ts | 1 + .../BranchingIncrementalExecutor.js | 3 + .../BranchingIncrementalExecutor.mjs | 3 + .../BranchingIncrementalPublisher.d.mts | 1 + .../BranchingIncrementalPublisher.d.ts | 1 + .../BranchingIncrementalPublisher.js | 3 + .../BranchingIncrementalPublisher.mjs | 3 + .../legacyExecuteIncrementally.d.mts | 1 + .../legacyExecuteIncrementally.d.ts | 1 + .../legacyExecuteIncrementally.js | 3 + .../legacyExecuteIncrementally.mjs | 3 + .../__dev__/execution/mapAsyncIterable.d.mts | 1 + .../__dev__/execution/mapAsyncIterable.d.ts | 1 + .../__dev__/execution/mapAsyncIterable.js | 3 + .../__dev__/execution/mapAsyncIterable.mjs | 3 + .../returnIteratorCatchingErrors.d.mts | 1 + .../returnIteratorCatchingErrors.d.ts | 1 + .../execution/returnIteratorCatchingErrors.js | 3 + .../returnIteratorCatchingErrors.mjs | 3 + .../graphql/__dev__/execution/values.d.mts | 1 + .../graphql/__dev__/execution/values.d.ts | 1 + .../graphql/__dev__/execution/values.js | 3 + .../graphql/__dev__/execution/values.mjs | 3 + .../execution/withConcurrentAbruptClose.d.mts | 1 + .../execution/withConcurrentAbruptClose.d.ts | 1 + .../execution/withConcurrentAbruptClose.js | 3 + .../execution/withConcurrentAbruptClose.mjs | 3 + .../graphql/__dev__/graphql.d.mts | 1 + .../node_modules/graphql/__dev__/graphql.d.ts | 1 + .../node_modules/graphql/__dev__/graphql.js | 3 + .../node_modules/graphql/__dev__/graphql.mjs | 3 + .../graphql/__dev__/harness.d.mts | 1 + .../node_modules/graphql/__dev__/harness.d.ts | 1 + .../node_modules/graphql/__dev__/harness.js | 3 + .../node_modules/graphql/__dev__/harness.mjs | 3 + .../node_modules/graphql/__dev__/index.d.mts | 1 + .../node_modules/graphql/__dev__/index.d.ts | 1 + .../node_modules/graphql/__dev__/index.js | 3 + .../node_modules/graphql/__dev__/index.mjs | 3 + .../__dev__/jsutils/AccumulatorMap.d.mts | 1 + .../__dev__/jsutils/AccumulatorMap.d.ts | 1 + .../graphql/__dev__/jsutils/AccumulatorMap.js | 3 + .../__dev__/jsutils/AccumulatorMap.mjs | 3 + .../graphql/__dev__/jsutils/Maybe.d.mts | 1 + .../graphql/__dev__/jsutils/Maybe.d.ts | 1 + .../graphql/__dev__/jsutils/Maybe.js | 3 + .../graphql/__dev__/jsutils/Maybe.mjs | 3 + .../graphql/__dev__/jsutils/ObjMap.d.mts | 1 + .../graphql/__dev__/jsutils/ObjMap.d.ts | 1 + .../graphql/__dev__/jsutils/ObjMap.js | 3 + .../graphql/__dev__/jsutils/ObjMap.mjs | 3 + .../graphql/__dev__/jsutils/Path.d.mts | 1 + .../graphql/__dev__/jsutils/Path.d.ts | 1 + .../graphql/__dev__/jsutils/Path.js | 3 + .../graphql/__dev__/jsutils/Path.mjs | 3 + .../__dev__/jsutils/PromiseOrValue.d.mts | 1 + .../__dev__/jsutils/PromiseOrValue.d.ts | 1 + .../graphql/__dev__/jsutils/PromiseOrValue.js | 3 + .../__dev__/jsutils/PromiseOrValue.mjs | 3 + .../graphql/__dev__/jsutils/capitalize.d.mts | 1 + .../graphql/__dev__/jsutils/capitalize.d.ts | 1 + .../graphql/__dev__/jsutils/capitalize.js | 3 + .../graphql/__dev__/jsutils/capitalize.mjs | 3 + .../graphql/__dev__/jsutils/devAssert.d.mts | 1 + .../graphql/__dev__/jsutils/devAssert.d.ts | 1 + .../graphql/__dev__/jsutils/devAssert.js | 3 + .../graphql/__dev__/jsutils/devAssert.mjs | 3 + .../graphql/__dev__/jsutils/didYouMean.d.mts | 1 + .../graphql/__dev__/jsutils/didYouMean.d.ts | 1 + .../graphql/__dev__/jsutils/didYouMean.js | 3 + .../graphql/__dev__/jsutils/didYouMean.mjs | 3 + .../graphql/__dev__/jsutils/formatList.d.mts | 1 + .../graphql/__dev__/jsutils/formatList.d.ts | 1 + .../graphql/__dev__/jsutils/formatList.js | 3 + .../graphql/__dev__/jsutils/formatList.mjs | 3 + .../graphql/__dev__/jsutils/getBySet.d.mts | 1 + .../graphql/__dev__/jsutils/getBySet.d.ts | 1 + .../graphql/__dev__/jsutils/getBySet.js | 3 + .../graphql/__dev__/jsutils/getBySet.mjs | 3 + .../graphql/__dev__/jsutils/groupBy.d.mts | 1 + .../graphql/__dev__/jsutils/groupBy.d.ts | 1 + .../graphql/__dev__/jsutils/groupBy.js | 3 + .../graphql/__dev__/jsutils/groupBy.mjs | 3 + .../__dev__/jsutils/identityFunc.d.mts | 1 + .../graphql/__dev__/jsutils/identityFunc.d.ts | 1 + .../graphql/__dev__/jsutils/identityFunc.js | 3 + .../graphql/__dev__/jsutils/identityFunc.mjs | 3 + .../graphql/__dev__/jsutils/inspect.d.mts | 1 + .../graphql/__dev__/jsutils/inspect.d.ts | 1 + .../graphql/__dev__/jsutils/inspect.js | 3 + .../graphql/__dev__/jsutils/inspect.mjs | 3 + .../graphql/__dev__/jsutils/instanceOf.d.mts | 1 + .../graphql/__dev__/jsutils/instanceOf.d.ts | 1 + .../graphql/__dev__/jsutils/instanceOf.js | 3 + .../graphql/__dev__/jsutils/instanceOf.mjs | 3 + .../graphql/__dev__/jsutils/invariant.d.mts | 1 + .../graphql/__dev__/jsutils/invariant.d.ts | 1 + .../graphql/__dev__/jsutils/invariant.js | 3 + .../graphql/__dev__/jsutils/invariant.mjs | 3 + .../__dev__/jsutils/isAsyncIterable.d.mts | 1 + .../__dev__/jsutils/isAsyncIterable.d.ts | 1 + .../__dev__/jsutils/isAsyncIterable.js | 3 + .../__dev__/jsutils/isAsyncIterable.mjs | 3 + .../__dev__/jsutils/isIterableObject.d.mts | 1 + .../__dev__/jsutils/isIterableObject.d.ts | 1 + .../__dev__/jsutils/isIterableObject.js | 3 + .../__dev__/jsutils/isIterableObject.mjs | 3 + .../__dev__/jsutils/isObjectLike.d.mts | 1 + .../graphql/__dev__/jsutils/isObjectLike.d.ts | 1 + .../graphql/__dev__/jsutils/isObjectLike.js | 3 + .../graphql/__dev__/jsutils/isObjectLike.mjs | 3 + .../graphql/__dev__/jsutils/isPromise.d.mts | 1 + .../graphql/__dev__/jsutils/isPromise.d.ts | 1 + .../graphql/__dev__/jsutils/isPromise.js | 3 + .../graphql/__dev__/jsutils/isPromise.mjs | 3 + .../graphql/__dev__/jsutils/isSameSet.d.mts | 1 + .../graphql/__dev__/jsutils/isSameSet.d.ts | 1 + .../graphql/__dev__/jsutils/isSameSet.js | 3 + .../graphql/__dev__/jsutils/isSameSet.mjs | 3 + .../graphql/__dev__/jsutils/keyMap.d.mts | 1 + .../graphql/__dev__/jsutils/keyMap.d.ts | 1 + .../graphql/__dev__/jsutils/keyMap.js | 3 + .../graphql/__dev__/jsutils/keyMap.mjs | 3 + .../graphql/__dev__/jsutils/keyValMap.d.mts | 1 + .../graphql/__dev__/jsutils/keyValMap.d.ts | 1 + .../graphql/__dev__/jsutils/keyValMap.js | 3 + .../graphql/__dev__/jsutils/keyValMap.mjs | 3 + .../graphql/__dev__/jsutils/mapValue.d.mts | 1 + .../graphql/__dev__/jsutils/mapValue.d.ts | 1 + .../graphql/__dev__/jsutils/mapValue.js | 3 + .../graphql/__dev__/jsutils/mapValue.mjs | 3 + .../graphql/__dev__/jsutils/memoize1.d.mts | 1 + .../graphql/__dev__/jsutils/memoize1.d.ts | 1 + .../graphql/__dev__/jsutils/memoize1.js | 3 + .../graphql/__dev__/jsutils/memoize1.mjs | 3 + .../graphql/__dev__/jsutils/memoize2.d.mts | 1 + .../graphql/__dev__/jsutils/memoize2.d.ts | 1 + .../graphql/__dev__/jsutils/memoize2.js | 3 + .../graphql/__dev__/jsutils/memoize2.mjs | 3 + .../graphql/__dev__/jsutils/memoize3.d.mts | 1 + .../graphql/__dev__/jsutils/memoize3.d.ts | 1 + .../graphql/__dev__/jsutils/memoize3.js | 3 + .../graphql/__dev__/jsutils/memoize3.mjs | 3 + .../__dev__/jsutils/naturalCompare.d.mts | 1 + .../__dev__/jsutils/naturalCompare.d.ts | 1 + .../graphql/__dev__/jsutils/naturalCompare.js | 3 + .../__dev__/jsutils/naturalCompare.mjs | 3 + .../__dev__/jsutils/printPathArray.d.mts | 1 + .../__dev__/jsutils/printPathArray.d.ts | 1 + .../graphql/__dev__/jsutils/printPathArray.js | 3 + .../__dev__/jsutils/printPathArray.mjs | 3 + .../__dev__/jsutils/promiseForObject.d.mts | 1 + .../__dev__/jsutils/promiseForObject.d.ts | 1 + .../__dev__/jsutils/promiseForObject.js | 3 + .../__dev__/jsutils/promiseForObject.mjs | 3 + .../__dev__/jsutils/promiseReduce.d.mts | 1 + .../__dev__/jsutils/promiseReduce.d.ts | 1 + .../graphql/__dev__/jsutils/promiseReduce.js | 3 + .../graphql/__dev__/jsutils/promiseReduce.mjs | 3 + .../jsutils/promiseWithResolvers.d.mts | 1 + .../__dev__/jsutils/promiseWithResolvers.d.ts | 1 + .../__dev__/jsutils/promiseWithResolvers.js | 3 + .../__dev__/jsutils/promiseWithResolvers.mjs | 3 + .../__dev__/jsutils/suggestionList.d.mts | 1 + .../__dev__/jsutils/suggestionList.d.ts | 1 + .../graphql/__dev__/jsutils/suggestionList.js | 3 + .../__dev__/jsutils/suggestionList.mjs | 3 + .../graphql/__dev__/jsutils/toError.d.mts | 1 + .../graphql/__dev__/jsutils/toError.d.ts | 1 + .../graphql/__dev__/jsutils/toError.js | 3 + .../graphql/__dev__/jsutils/toError.mjs | 3 + .../graphql/__dev__/jsutils/toObjMap.d.mts | 1 + .../graphql/__dev__/jsutils/toObjMap.d.ts | 1 + .../graphql/__dev__/jsutils/toObjMap.js | 3 + .../graphql/__dev__/jsutils/toObjMap.mjs | 3 + .../__dev__/language/KindTypeMap.d.mts | 1 + .../graphql/__dev__/language/KindTypeMap.d.ts | 1 + .../graphql/__dev__/language/KindTypeMap.js | 3 + .../graphql/__dev__/language/KindTypeMap.mjs | 3 + .../graphql/__dev__/language/ast.d.mts | 1 + .../graphql/__dev__/language/ast.d.ts | 1 + .../graphql/__dev__/language/ast.js | 3 + .../graphql/__dev__/language/ast.mjs | 3 + .../__dev__/language/blockString.d.mts | 1 + .../graphql/__dev__/language/blockString.d.ts | 1 + .../graphql/__dev__/language/blockString.js | 3 + .../graphql/__dev__/language/blockString.mjs | 3 + .../__dev__/language/characterClasses.d.mts | 1 + .../__dev__/language/characterClasses.d.ts | 1 + .../__dev__/language/characterClasses.js | 3 + .../__dev__/language/characterClasses.mjs | 3 + .../__dev__/language/directiveLocation.d.mts | 1 + .../__dev__/language/directiveLocation.d.ts | 1 + .../__dev__/language/directiveLocation.js | 3 + .../__dev__/language/directiveLocation.mjs | 3 + .../graphql/__dev__/language/index.d.mts | 1 + .../graphql/__dev__/language/index.d.ts | 1 + .../graphql/__dev__/language/index.js | 3 + .../graphql/__dev__/language/index.mjs | 3 + .../graphql/__dev__/language/kinds.d.mts | 1 + .../graphql/__dev__/language/kinds.d.ts | 1 + .../graphql/__dev__/language/kinds.js | 3 + .../graphql/__dev__/language/kinds.mjs | 3 + .../graphql/__dev__/language/kinds_.d.mts | 1 + .../graphql/__dev__/language/kinds_.d.ts | 1 + .../graphql/__dev__/language/kinds_.js | 3 + .../graphql/__dev__/language/kinds_.mjs | 3 + .../graphql/__dev__/language/lexer.d.mts | 1 + .../graphql/__dev__/language/lexer.d.ts | 1 + .../graphql/__dev__/language/lexer.js | 3 + .../graphql/__dev__/language/lexer.mjs | 3 + .../graphql/__dev__/language/location.d.mts | 1 + .../graphql/__dev__/language/location.d.ts | 1 + .../graphql/__dev__/language/location.js | 3 + .../graphql/__dev__/language/location.mjs | 3 + .../graphql/__dev__/language/parser.d.mts | 1 + .../graphql/__dev__/language/parser.d.ts | 1 + .../graphql/__dev__/language/parser.js | 3 + .../graphql/__dev__/language/parser.mjs | 3 + .../graphql/__dev__/language/predicates.d.mts | 1 + .../graphql/__dev__/language/predicates.d.ts | 1 + .../graphql/__dev__/language/predicates.js | 3 + .../graphql/__dev__/language/predicates.mjs | 3 + .../__dev__/language/printLocation.d.mts | 1 + .../__dev__/language/printLocation.d.ts | 1 + .../graphql/__dev__/language/printLocation.js | 3 + .../__dev__/language/printLocation.mjs | 3 + .../__dev__/language/printString.d.mts | 1 + .../graphql/__dev__/language/printString.d.ts | 1 + .../graphql/__dev__/language/printString.js | 3 + .../graphql/__dev__/language/printString.mjs | 3 + .../graphql/__dev__/language/printer.d.mts | 1 + .../graphql/__dev__/language/printer.d.ts | 1 + .../graphql/__dev__/language/printer.js | 3 + .../graphql/__dev__/language/printer.mjs | 3 + .../language/schemaCoordinateLexer.d.mts | 1 + .../language/schemaCoordinateLexer.d.ts | 1 + .../__dev__/language/schemaCoordinateLexer.js | 3 + .../language/schemaCoordinateLexer.mjs | 3 + .../graphql/__dev__/language/source.d.mts | 1 + .../graphql/__dev__/language/source.d.ts | 1 + .../graphql/__dev__/language/source.js | 3 + .../graphql/__dev__/language/source.mjs | 3 + .../graphql/__dev__/language/tokenKind.d.mts | 1 + .../graphql/__dev__/language/tokenKind.d.ts | 1 + .../graphql/__dev__/language/tokenKind.js | 3 + .../graphql/__dev__/language/tokenKind.mjs | 3 + .../graphql/__dev__/language/visitor.d.mts | 1 + .../graphql/__dev__/language/visitor.d.ts | 1 + .../graphql/__dev__/language/visitor.js | 3 + .../graphql/__dev__/language/visitor.mjs | 3 + .../graphql/__dev__/type/assertName.d.mts | 1 + .../graphql/__dev__/type/assertName.d.ts | 1 + .../graphql/__dev__/type/assertName.js | 3 + .../graphql/__dev__/type/assertName.mjs | 3 + .../graphql/__dev__/type/definition.d.mts | 1 + .../graphql/__dev__/type/definition.d.ts | 1 + .../graphql/__dev__/type/definition.js | 3 + .../graphql/__dev__/type/definition.mjs | 3 + .../graphql/__dev__/type/directives.d.mts | 1 + .../graphql/__dev__/type/directives.d.ts | 1 + .../graphql/__dev__/type/directives.js | 3 + .../graphql/__dev__/type/directives.mjs | 3 + .../graphql/__dev__/type/index.d.mts | 1 + .../graphql/__dev__/type/index.d.ts | 1 + .../graphql/__dev__/type/index.js | 3 + .../graphql/__dev__/type/index.mjs | 3 + .../graphql/__dev__/type/introspection.d.mts | 1 + .../graphql/__dev__/type/introspection.d.ts | 1 + .../graphql/__dev__/type/introspection.js | 3 + .../graphql/__dev__/type/introspection.mjs | 3 + .../graphql/__dev__/type/scalars.d.mts | 1 + .../graphql/__dev__/type/scalars.d.ts | 1 + .../graphql/__dev__/type/scalars.js | 3 + .../graphql/__dev__/type/scalars.mjs | 3 + .../graphql/__dev__/type/schema.d.mts | 1 + .../graphql/__dev__/type/schema.d.ts | 1 + .../graphql/__dev__/type/schema.js | 3 + .../graphql/__dev__/type/schema.mjs | 3 + .../graphql/__dev__/type/validate.d.mts | 1 + .../graphql/__dev__/type/validate.d.ts | 1 + .../graphql/__dev__/type/validate.js | 3 + .../graphql/__dev__/type/validate.mjs | 3 + .../graphql/__dev__/utilities/TypeInfo.d.mts | 1 + .../graphql/__dev__/utilities/TypeInfo.d.ts | 1 + .../graphql/__dev__/utilities/TypeInfo.js | 3 + .../graphql/__dev__/utilities/TypeInfo.mjs | 3 + .../__dev__/utilities/astFromValue.d.mts | 1 + .../__dev__/utilities/astFromValue.d.ts | 1 + .../graphql/__dev__/utilities/astFromValue.js | 3 + .../__dev__/utilities/astFromValue.mjs | 3 + .../__dev__/utilities/buildASTSchema.d.mts | 1 + .../__dev__/utilities/buildASTSchema.d.ts | 1 + .../__dev__/utilities/buildASTSchema.js | 3 + .../__dev__/utilities/buildASTSchema.mjs | 3 + .../__dev__/utilities/buildClientSchema.d.mts | 1 + .../__dev__/utilities/buildClientSchema.d.ts | 1 + .../__dev__/utilities/buildClientSchema.js | 3 + .../__dev__/utilities/buildClientSchema.mjs | 3 + .../__dev__/utilities/coerceInputValue.d.mts | 1 + .../__dev__/utilities/coerceInputValue.d.ts | 1 + .../__dev__/utilities/coerceInputValue.js | 3 + .../__dev__/utilities/coerceInputValue.mjs | 3 + .../graphql/__dev__/utilities/concatAST.d.mts | 1 + .../graphql/__dev__/utilities/concatAST.d.ts | 1 + .../graphql/__dev__/utilities/concatAST.js | 3 + .../graphql/__dev__/utilities/concatAST.mjs | 3 + .../__dev__/utilities/extendSchema.d.mts | 1 + .../__dev__/utilities/extendSchema.d.ts | 1 + .../graphql/__dev__/utilities/extendSchema.js | 3 + .../__dev__/utilities/extendSchema.mjs | 3 + .../__dev__/utilities/findSchemaChanges.d.mts | 1 + .../__dev__/utilities/findSchemaChanges.d.ts | 1 + .../__dev__/utilities/findSchemaChanges.js | 3 + .../__dev__/utilities/findSchemaChanges.mjs | 3 + .../utilities/getDefaultValueAST.d.mts | 1 + .../__dev__/utilities/getDefaultValueAST.d.ts | 1 + .../__dev__/utilities/getDefaultValueAST.js | 3 + .../__dev__/utilities/getDefaultValueAST.mjs | 3 + .../utilities/getIntrospectionQuery.d.mts | 1 + .../utilities/getIntrospectionQuery.d.ts | 1 + .../utilities/getIntrospectionQuery.js | 3 + .../utilities/getIntrospectionQuery.mjs | 3 + .../__dev__/utilities/getOperationAST.d.mts | 1 + .../__dev__/utilities/getOperationAST.d.ts | 1 + .../__dev__/utilities/getOperationAST.js | 3 + .../__dev__/utilities/getOperationAST.mjs | 3 + .../graphql/__dev__/utilities/index.d.mts | 1 + .../graphql/__dev__/utilities/index.d.ts | 1 + .../graphql/__dev__/utilities/index.js | 3 + .../graphql/__dev__/utilities/index.mjs | 3 + .../utilities/introspectionFromSchema.d.mts | 1 + .../utilities/introspectionFromSchema.d.ts | 1 + .../utilities/introspectionFromSchema.js | 3 + .../utilities/introspectionFromSchema.mjs | 3 + .../utilities/lexicographicSortSchema.d.mts | 1 + .../utilities/lexicographicSortSchema.d.ts | 1 + .../utilities/lexicographicSortSchema.js | 3 + .../utilities/lexicographicSortSchema.mjs | 3 + .../__dev__/utilities/mapSchemaConfig.d.mts | 1 + .../__dev__/utilities/mapSchemaConfig.d.ts | 1 + .../__dev__/utilities/mapSchemaConfig.js | 3 + .../__dev__/utilities/mapSchemaConfig.mjs | 3 + .../__dev__/utilities/printSchema.d.mts | 1 + .../__dev__/utilities/printSchema.d.ts | 1 + .../graphql/__dev__/utilities/printSchema.js | 3 + .../graphql/__dev__/utilities/printSchema.mjs | 3 + .../__dev__/utilities/replaceVariables.d.mts | 1 + .../__dev__/utilities/replaceVariables.d.ts | 1 + .../__dev__/utilities/replaceVariables.js | 3 + .../__dev__/utilities/replaceVariables.mjs | 3 + .../utilities/resolveSchemaCoordinate.d.mts | 1 + .../utilities/resolveSchemaCoordinate.d.ts | 1 + .../utilities/resolveSchemaCoordinate.js | 3 + .../utilities/resolveSchemaCoordinate.mjs | 3 + .../utilities/separateOperations.d.mts | 1 + .../__dev__/utilities/separateOperations.d.ts | 1 + .../__dev__/utilities/separateOperations.js | 3 + .../__dev__/utilities/separateOperations.mjs | 3 + .../__dev__/utilities/sortValueNode.d.mts | 1 + .../__dev__/utilities/sortValueNode.d.ts | 1 + .../__dev__/utilities/sortValueNode.js | 3 + .../__dev__/utilities/sortValueNode.mjs | 3 + .../utilities/stripIgnoredCharacters.d.mts | 1 + .../utilities/stripIgnoredCharacters.d.ts | 1 + .../utilities/stripIgnoredCharacters.js | 3 + .../utilities/stripIgnoredCharacters.mjs | 3 + .../__dev__/utilities/typeComparators.d.mts | 1 + .../__dev__/utilities/typeComparators.d.ts | 1 + .../__dev__/utilities/typeComparators.js | 3 + .../__dev__/utilities/typeComparators.mjs | 3 + .../__dev__/utilities/typeFromAST.d.mts | 1 + .../__dev__/utilities/typeFromAST.d.ts | 1 + .../graphql/__dev__/utilities/typeFromAST.js | 3 + .../graphql/__dev__/utilities/typeFromAST.mjs | 3 + .../utilities/typedQueryDocumentNode.d.mts | 1 + .../utilities/typedQueryDocumentNode.d.ts | 1 + .../utilities/typedQueryDocumentNode.js | 3 + .../utilities/typedQueryDocumentNode.mjs | 3 + .../utilities/validateInputValue.d.mts | 1 + .../__dev__/utilities/validateInputValue.d.ts | 1 + .../__dev__/utilities/validateInputValue.js | 3 + .../__dev__/utilities/validateInputValue.mjs | 3 + .../__dev__/utilities/valueFromAST.d.mts | 1 + .../__dev__/utilities/valueFromAST.d.ts | 1 + .../graphql/__dev__/utilities/valueFromAST.js | 3 + .../__dev__/utilities/valueFromAST.mjs | 3 + .../utilities/valueFromASTUntyped.d.mts | 1 + .../utilities/valueFromASTUntyped.d.ts | 1 + .../__dev__/utilities/valueFromASTUntyped.js | 3 + .../__dev__/utilities/valueFromASTUntyped.mjs | 3 + .../__dev__/utilities/valueToLiteral.d.mts | 1 + .../__dev__/utilities/valueToLiteral.d.ts | 1 + .../__dev__/utilities/valueToLiteral.js | 3 + .../__dev__/utilities/valueToLiteral.mjs | 3 + .../validation/ValidationContext.d.mts | 1 + .../__dev__/validation/ValidationContext.d.ts | 1 + .../__dev__/validation/ValidationContext.js | 3 + .../__dev__/validation/ValidationContext.mjs | 3 + .../graphql/__dev__/validation/index.d.mts | 1 + .../graphql/__dev__/validation/index.d.ts | 1 + .../graphql/__dev__/validation/index.js | 3 + .../graphql/__dev__/validation/index.mjs | 3 + .../rules/DeferStreamDirectiveLabelRule.d.mts | 1 + .../rules/DeferStreamDirectiveLabelRule.d.ts | 1 + .../rules/DeferStreamDirectiveLabelRule.js | 3 + .../rules/DeferStreamDirectiveLabelRule.mjs | 3 + .../DeferStreamDirectiveOnRootFieldRule.d.mts | 1 + .../DeferStreamDirectiveOnRootFieldRule.d.ts | 1 + .../DeferStreamDirectiveOnRootFieldRule.js | 3 + .../DeferStreamDirectiveOnRootFieldRule.mjs | 3 + ...StreamDirectiveOnValidOperationsRule.d.mts | 1 + ...rStreamDirectiveOnValidOperationsRule.d.ts | 1 + ...ferStreamDirectiveOnValidOperationsRule.js | 3 + ...erStreamDirectiveOnValidOperationsRule.mjs | 3 + .../rules/ExecutableDefinitionsRule.d.mts | 1 + .../rules/ExecutableDefinitionsRule.d.ts | 1 + .../rules/ExecutableDefinitionsRule.js | 3 + .../rules/ExecutableDefinitionsRule.mjs | 3 + .../rules/FieldsOnCorrectTypeRule.d.mts | 1 + .../rules/FieldsOnCorrectTypeRule.d.ts | 1 + .../rules/FieldsOnCorrectTypeRule.js | 3 + .../rules/FieldsOnCorrectTypeRule.mjs | 3 + .../rules/FragmentsOnCompositeTypesRule.d.mts | 1 + .../rules/FragmentsOnCompositeTypesRule.d.ts | 1 + .../rules/FragmentsOnCompositeTypesRule.js | 3 + .../rules/FragmentsOnCompositeTypesRule.mjs | 3 + .../rules/KnownArgumentNamesRule.d.mts | 1 + .../rules/KnownArgumentNamesRule.d.ts | 1 + .../rules/KnownArgumentNamesRule.js | 3 + .../rules/KnownArgumentNamesRule.mjs | 3 + .../rules/KnownDirectivesRule.d.mts | 1 + .../validation/rules/KnownDirectivesRule.d.ts | 1 + .../validation/rules/KnownDirectivesRule.js | 3 + .../validation/rules/KnownDirectivesRule.mjs | 3 + .../rules/KnownFragmentNamesRule.d.mts | 1 + .../rules/KnownFragmentNamesRule.d.ts | 1 + .../rules/KnownFragmentNamesRule.js | 3 + .../rules/KnownFragmentNamesRule.mjs | 3 + .../rules/KnownOperationTypesRule.d.mts | 1 + .../rules/KnownOperationTypesRule.d.ts | 1 + .../rules/KnownOperationTypesRule.js | 3 + .../rules/KnownOperationTypesRule.mjs | 3 + .../validation/rules/KnownTypeNamesRule.d.mts | 1 + .../validation/rules/KnownTypeNamesRule.d.ts | 1 + .../validation/rules/KnownTypeNamesRule.js | 3 + .../validation/rules/KnownTypeNamesRule.mjs | 3 + .../rules/LoneAnonymousOperationRule.d.mts | 1 + .../rules/LoneAnonymousOperationRule.d.ts | 1 + .../rules/LoneAnonymousOperationRule.js | 3 + .../rules/LoneAnonymousOperationRule.mjs | 3 + .../rules/LoneSchemaDefinitionRule.d.mts | 1 + .../rules/LoneSchemaDefinitionRule.d.ts | 1 + .../rules/LoneSchemaDefinitionRule.js | 3 + .../rules/LoneSchemaDefinitionRule.mjs | 3 + .../rules/MaxIntrospectionDepthRule.d.mts | 1 + .../rules/MaxIntrospectionDepthRule.d.ts | 1 + .../rules/MaxIntrospectionDepthRule.js | 3 + .../rules/MaxIntrospectionDepthRule.mjs | 3 + .../rules/NoFragmentCyclesRule.d.mts | 1 + .../rules/NoFragmentCyclesRule.d.ts | 1 + .../validation/rules/NoFragmentCyclesRule.js | 3 + .../validation/rules/NoFragmentCyclesRule.mjs | 3 + .../rules/NoUndefinedVariablesRule.d.mts | 1 + .../rules/NoUndefinedVariablesRule.d.ts | 1 + .../rules/NoUndefinedVariablesRule.js | 3 + .../rules/NoUndefinedVariablesRule.mjs | 3 + .../rules/NoUnusedFragmentsRule.d.mts | 1 + .../rules/NoUnusedFragmentsRule.d.ts | 1 + .../validation/rules/NoUnusedFragmentsRule.js | 3 + .../rules/NoUnusedFragmentsRule.mjs | 3 + .../rules/NoUnusedVariablesRule.d.mts | 1 + .../rules/NoUnusedVariablesRule.d.ts | 1 + .../validation/rules/NoUnusedVariablesRule.js | 3 + .../rules/NoUnusedVariablesRule.mjs | 3 + .../OverlappingFieldsCanBeMergedRule.d.mts | 1 + .../OverlappingFieldsCanBeMergedRule.d.ts | 1 + .../rules/OverlappingFieldsCanBeMergedRule.js | 3 + .../OverlappingFieldsCanBeMergedRule.mjs | 3 + .../rules/PossibleFragmentSpreadsRule.d.mts | 1 + .../rules/PossibleFragmentSpreadsRule.d.ts | 1 + .../rules/PossibleFragmentSpreadsRule.js | 3 + .../rules/PossibleFragmentSpreadsRule.mjs | 3 + .../rules/PossibleTypeExtensionsRule.d.mts | 1 + .../rules/PossibleTypeExtensionsRule.d.ts | 1 + .../rules/PossibleTypeExtensionsRule.js | 3 + .../rules/PossibleTypeExtensionsRule.mjs | 3 + .../rules/ProvidedRequiredArgumentsRule.d.mts | 1 + .../rules/ProvidedRequiredArgumentsRule.d.ts | 1 + .../rules/ProvidedRequiredArgumentsRule.js | 3 + .../rules/ProvidedRequiredArgumentsRule.mjs | 3 + .../validation/rules/ScalarLeafsRule.d.mts | 1 + .../validation/rules/ScalarLeafsRule.d.ts | 1 + .../validation/rules/ScalarLeafsRule.js | 3 + .../validation/rules/ScalarLeafsRule.mjs | 3 + .../rules/SingleFieldSubscriptionsRule.d.mts | 1 + .../rules/SingleFieldSubscriptionsRule.d.ts | 1 + .../rules/SingleFieldSubscriptionsRule.js | 3 + .../rules/SingleFieldSubscriptionsRule.mjs | 3 + .../StreamDirectiveOnListFieldRule.d.mts | 1 + .../rules/StreamDirectiveOnListFieldRule.d.ts | 1 + .../rules/StreamDirectiveOnListFieldRule.js | 3 + .../rules/StreamDirectiveOnListFieldRule.mjs | 3 + .../UniqueArgumentDefinitionNamesRule.d.mts | 1 + .../UniqueArgumentDefinitionNamesRule.d.ts | 1 + .../UniqueArgumentDefinitionNamesRule.js | 3 + .../UniqueArgumentDefinitionNamesRule.mjs | 3 + .../rules/UniqueArgumentNamesRule.d.mts | 1 + .../rules/UniqueArgumentNamesRule.d.ts | 1 + .../rules/UniqueArgumentNamesRule.js | 3 + .../rules/UniqueArgumentNamesRule.mjs | 3 + .../rules/UniqueDirectiveNamesRule.d.mts | 1 + .../rules/UniqueDirectiveNamesRule.d.ts | 1 + .../rules/UniqueDirectiveNamesRule.js | 3 + .../rules/UniqueDirectiveNamesRule.mjs | 3 + .../UniqueDirectivesPerLocationRule.d.mts | 1 + .../UniqueDirectivesPerLocationRule.d.ts | 1 + .../rules/UniqueDirectivesPerLocationRule.js | 3 + .../rules/UniqueDirectivesPerLocationRule.mjs | 3 + .../rules/UniqueEnumValueNamesRule.d.mts | 1 + .../rules/UniqueEnumValueNamesRule.d.ts | 1 + .../rules/UniqueEnumValueNamesRule.js | 3 + .../rules/UniqueEnumValueNamesRule.mjs | 3 + .../UniqueFieldDefinitionNamesRule.d.mts | 1 + .../rules/UniqueFieldDefinitionNamesRule.d.ts | 1 + .../rules/UniqueFieldDefinitionNamesRule.js | 3 + .../rules/UniqueFieldDefinitionNamesRule.mjs | 3 + .../rules/UniqueFragmentNamesRule.d.mts | 1 + .../rules/UniqueFragmentNamesRule.d.ts | 1 + .../rules/UniqueFragmentNamesRule.js | 3 + .../rules/UniqueFragmentNamesRule.mjs | 3 + .../rules/UniqueInputFieldNamesRule.d.mts | 1 + .../rules/UniqueInputFieldNamesRule.d.ts | 1 + .../rules/UniqueInputFieldNamesRule.js | 3 + .../rules/UniqueInputFieldNamesRule.mjs | 3 + .../rules/UniqueOperationNamesRule.d.mts | 1 + .../rules/UniqueOperationNamesRule.d.ts | 1 + .../rules/UniqueOperationNamesRule.js | 3 + .../rules/UniqueOperationNamesRule.mjs | 3 + .../rules/UniqueOperationTypesRule.d.mts | 1 + .../rules/UniqueOperationTypesRule.d.ts | 1 + .../rules/UniqueOperationTypesRule.js | 3 + .../rules/UniqueOperationTypesRule.mjs | 3 + .../rules/UniqueTypeNamesRule.d.mts | 1 + .../validation/rules/UniqueTypeNamesRule.d.ts | 1 + .../validation/rules/UniqueTypeNamesRule.js | 3 + .../validation/rules/UniqueTypeNamesRule.mjs | 3 + .../rules/UniqueVariableNamesRule.d.mts | 1 + .../rules/UniqueVariableNamesRule.d.ts | 1 + .../rules/UniqueVariableNamesRule.js | 3 + .../rules/UniqueVariableNamesRule.mjs | 3 + .../rules/ValuesOfCorrectTypeRule.d.mts | 1 + .../rules/ValuesOfCorrectTypeRule.d.ts | 1 + .../rules/ValuesOfCorrectTypeRule.js | 3 + .../rules/ValuesOfCorrectTypeRule.mjs | 3 + .../rules/VariablesAreInputTypesRule.d.mts | 1 + .../rules/VariablesAreInputTypesRule.d.ts | 1 + .../rules/VariablesAreInputTypesRule.js | 3 + .../rules/VariablesAreInputTypesRule.mjs | 3 + .../VariablesInAllowedPositionRule.d.mts | 1 + .../rules/VariablesInAllowedPositionRule.d.ts | 1 + .../rules/VariablesInAllowedPositionRule.js | 3 + .../rules/VariablesInAllowedPositionRule.mjs | 3 + .../rules/custom/NoDeprecatedCustomRule.d.mts | 1 + .../rules/custom/NoDeprecatedCustomRule.d.ts | 1 + .../rules/custom/NoDeprecatedCustomRule.js | 3 + .../rules/custom/NoDeprecatedCustomRule.mjs | 3 + .../NoSchemaIntrospectionCustomRule.d.mts | 1 + .../NoSchemaIntrospectionCustomRule.d.ts | 1 + .../custom/NoSchemaIntrospectionCustomRule.js | 3 + .../NoSchemaIntrospectionCustomRule.mjs | 3 + .../__dev__/validation/specifiedRules.d.mts | 1 + .../__dev__/validation/specifiedRules.d.ts | 1 + .../__dev__/validation/specifiedRules.js | 3 + .../__dev__/validation/specifiedRules.mjs | 3 + .../graphql/__dev__/validation/validate.d.mts | 1 + .../graphql/__dev__/validation/validate.d.ts | 1 + .../graphql/__dev__/validation/validate.js | 3 + .../graphql/__dev__/validation/validate.mjs | 3 + .../graphql/__dev__/version.d.mts | 1 + .../node_modules/graphql/__dev__/version.d.ts | 1 + .../node_modules/graphql/__dev__/version.js | 3 + .../node_modules/graphql/__dev__/version.mjs | 3 + .../node_modules/graphql/devMode.d.mts | 31 + .../node_modules/graphql/devMode.d.ts | 31 + .../node_modules/graphql/devMode.js | 14 + .../node_modules/graphql/devMode.js.map | 1 + .../node_modules/graphql/devMode.mjs | 10 + .../node_modules/graphql/devMode.mjs.map | 1 + .../node_modules/graphql/diagnostics.d.mts | 307 + .../node_modules/graphql/diagnostics.d.ts | 307 + .../node_modules/graphql/diagnostics.js | 76 + .../node_modules/graphql/diagnostics.js.map | 1 + .../node_modules/graphql/diagnostics.mjs | 71 + .../node_modules/graphql/diagnostics.mjs.map | 1 + .../graphql/error/GraphQLError.d.mts | 206 + .../graphql/error/GraphQLError.d.ts | 206 + .../graphql/error/GraphQLError.js | 100 + .../graphql/error/GraphQLError.js.map | 1 + .../graphql/error/GraphQLError.mjs | 96 + .../graphql/error/GraphQLError.mjs.map | 1 + .../graphql/error/ensureGraphQLError.d.mts | 7 + .../graphql/error/ensureGraphQLError.d.ts | 7 + .../graphql/error/ensureGraphQLError.js | 13 + .../graphql/error/ensureGraphQLError.js.map | 1 + .../graphql/error/ensureGraphQLError.mjs | 10 + .../graphql/error/ensureGraphQLError.mjs.map | 1 + .../node_modules/graphql/error/index.d.mts | 10 + .../node_modules/graphql/error/index.d.ts | 10 + .../node_modules/graphql/error/index.js | 10 + .../node_modules/graphql/error/index.js.map | 1 + .../node_modules/graphql/error/index.mjs | 4 + .../node_modules/graphql/error/index.mjs.map | 1 + .../graphql/error/locatedError.d.mts | 27 + .../graphql/error/locatedError.d.ts | 27 + .../graphql/error/locatedError.js | 22 + .../graphql/error/locatedError.js.map | 1 + .../graphql/error/locatedError.mjs | 19 + .../graphql/error/locatedError.mjs.map | 1 + .../graphql/error/syntaxError.d.mts | 22 + .../graphql/error/syntaxError.d.ts | 22 + .../node_modules/graphql/error/syntaxError.js | 11 + .../graphql/error/syntaxError.js.map | 1 + .../graphql/error/syntaxError.mjs | 8 + .../graphql/error/syntaxError.mjs.map | 1 + .../AbortedGraphQLExecutionError.d.mts | 33 + .../AbortedGraphQLExecutionError.d.ts | 33 + .../execution/AbortedGraphQLExecutionError.js | 27 + .../AbortedGraphQLExecutionError.js.map | 1 + .../AbortedGraphQLExecutionError.mjs | 23 + .../AbortedGraphQLExecutionError.mjs.map | 1 + .../graphql/execution/AsyncWorkTracker.d.mts | 10 + .../graphql/execution/AsyncWorkTracker.d.ts | 10 + .../graphql/execution/AsyncWorkTracker.js | 45 + .../graphql/execution/AsyncWorkTracker.js.map | 1 + .../graphql/execution/AsyncWorkTracker.mjs | 41 + .../execution/AsyncWorkTracker.mjs.map | 1 + .../graphql/execution/ExecutionArgs.d.mts | 107 + .../graphql/execution/ExecutionArgs.d.ts | 107 + .../graphql/execution/ExecutionArgs.js | 3 + .../graphql/execution/ExecutionArgs.js.map | 1 + .../graphql/execution/ExecutionArgs.mjs | 2 + .../graphql/execution/ExecutionArgs.mjs.map | 1 + .../graphql/execution/Executor.d.mts | 233 + .../graphql/execution/Executor.d.ts | 233 + .../graphql/execution/Executor.js | 578 + .../graphql/execution/Executor.js.map | 1 + .../graphql/execution/Executor.mjs | 574 + .../graphql/execution/Executor.mjs.map | 1 + .../ExecutorThrowingOnIncremental.d.mts | 12 + .../ExecutorThrowingOnIncremental.d.ts | 12 + .../ExecutorThrowingOnIncremental.js | 45 + .../ExecutorThrowingOnIncremental.js.map | 1 + .../ExecutorThrowingOnIncremental.mjs | 41 + .../ExecutorThrowingOnIncremental.mjs.map | 1 + .../graphql/execution/buildResolveInfo.d.mts | 16 + .../graphql/execution/buildResolveInfo.d.ts | 16 + .../graphql/execution/buildResolveInfo.js | 21 + .../graphql/execution/buildResolveInfo.js.map | 1 + .../graphql/execution/buildResolveInfo.mjs | 18 + .../execution/buildResolveInfo.mjs.map | 1 + .../execution/cancellablePromise.d.mts | 9 + .../graphql/execution/cancellablePromise.d.ts | 9 + .../graphql/execution/cancellablePromise.js | 49 + .../execution/cancellablePromise.js.map | 1 + .../graphql/execution/cancellablePromise.mjs | 45 + .../execution/cancellablePromise.mjs.map | 1 + .../graphql/execution/collectFields.d.mts | 65 + .../graphql/execution/collectFields.d.ts | 65 + .../graphql/execution/collectFields.js | 180 + .../graphql/execution/collectFields.js.map | 1 + .../graphql/execution/collectFields.mjs | 176 + .../graphql/execution/collectFields.mjs.map | 1 + .../execution/collectIteratorPromises.d.mts | 7 + .../execution/collectIteratorPromises.d.ts | 7 + .../execution/collectIteratorPromises.js | 22 + .../execution/collectIteratorPromises.js.map | 1 + .../execution/collectIteratorPromises.mjs | 19 + .../execution/collectIteratorPromises.mjs.map | 1 + .../createSharedExecutionContext.d.mts | 11 + .../createSharedExecutionContext.d.ts | 11 + .../execution/createSharedExecutionContext.js | 20 + .../createSharedExecutionContext.js.map | 1 + .../createSharedExecutionContext.mjs | 17 + .../createSharedExecutionContext.mjs.map | 1 + .../graphql/execution/execute.d.mts | 566 + .../graphql/execution/execute.d.ts | 566 + .../node_modules/graphql/execution/execute.js | 393 + .../graphql/execution/execute.js.map | 1 + .../graphql/execution/execute.mjs | 375 + .../graphql/execution/execute.mjs.map | 1 + .../graphql/execution/getStreamUsage.d.mts | 16 + .../graphql/execution/getStreamUsage.d.ts | 16 + .../graphql/execution/getStreamUsage.js | 34 + .../graphql/execution/getStreamUsage.js.map | 1 + .../graphql/execution/getStreamUsage.mjs | 31 + .../graphql/execution/getStreamUsage.mjs.map | 1 + .../execution/getVariableSignature.d.mts | 21 + .../execution/getVariableSignature.d.ts | 21 + .../graphql/execution/getVariableSignature.js | 22 + .../execution/getVariableSignature.js.map | 1 + .../execution/getVariableSignature.mjs | 19 + .../execution/getVariableSignature.mjs.map | 1 + .../graphql/execution/hooks.d.mts | 5 + .../node_modules/graphql/execution/hooks.d.ts | 5 + .../node_modules/graphql/execution/hooks.js | 23 + .../graphql/execution/hooks.js.map | 1 + .../node_modules/graphql/execution/hooks.mjs | 20 + .../graphql/execution/hooks.mjs.map | 1 + .../execution/incremental/Computation.d.mts | 22 + .../execution/incremental/Computation.d.ts | 22 + .../execution/incremental/Computation.js | 67 + .../execution/incremental/Computation.js.map | 1 + .../execution/incremental/Computation.mjs | 63 + .../execution/incremental/Computation.mjs.map | 1 + .../incremental/IncrementalExecutor.d.mts | 297 + .../incremental/IncrementalExecutor.d.ts | 297 + .../incremental/IncrementalExecutor.js | 360 + .../incremental/IncrementalExecutor.js.map | 1 + .../incremental/IncrementalExecutor.mjs | 356 + .../incremental/IncrementalExecutor.mjs.map | 1 + .../incremental/IncrementalPublisher.d.mts | 15 + .../incremental/IncrementalPublisher.d.ts | 15 + .../incremental/IncrementalPublisher.js | 195 + .../incremental/IncrementalPublisher.js.map | 1 + .../incremental/IncrementalPublisher.mjs | 191 + .../incremental/IncrementalPublisher.mjs.map | 1 + .../graphql/execution/incremental/Queue.d.mts | 86 + .../graphql/execution/incremental/Queue.d.ts | 86 + .../graphql/execution/incremental/Queue.js | 273 + .../execution/incremental/Queue.js.map | 1 + .../graphql/execution/incremental/Queue.mjs | 269 + .../execution/incremental/Queue.mjs.map | 1 + .../execution/incremental/WorkQueue.d.mts | 75 + .../execution/incremental/WorkQueue.d.ts | 75 + .../execution/incremental/WorkQueue.js | 381 + .../execution/incremental/WorkQueue.js.map | 1 + .../execution/incremental/WorkQueue.mjs | 378 + .../execution/incremental/WorkQueue.mjs.map | 1 + .../incremental/buildExecutionPlan.d.mts | 10 + .../incremental/buildExecutionPlan.d.ts | 10 + .../incremental/buildExecutionPlan.js | 49 + .../incremental/buildExecutionPlan.js.map | 1 + .../incremental/buildExecutionPlan.mjs | 46 + .../incremental/buildExecutionPlan.mjs.map | 1 + .../graphql/execution/index.d.mts | 17 + .../node_modules/graphql/execution/index.d.ts | 17 + .../node_modules/graphql/execution/index.js | 29 + .../graphql/execution/index.js.map | 1 + .../node_modules/graphql/execution/index.mjs | 6 + .../graphql/execution/index.mjs.map | 1 + .../BranchingIncrementalExecutor.d.mts | 175 + .../BranchingIncrementalExecutor.d.ts | 175 + .../BranchingIncrementalExecutor.js | 69 + .../BranchingIncrementalExecutor.js.map | 1 + .../BranchingIncrementalExecutor.mjs | 65 + .../BranchingIncrementalExecutor.mjs.map | 1 + .../BranchingIncrementalPublisher.d.mts | 12 + .../BranchingIncrementalPublisher.d.ts | 12 + .../BranchingIncrementalPublisher.js | 131 + .../BranchingIncrementalPublisher.js.map | 1 + .../BranchingIncrementalPublisher.mjs | 127 + .../BranchingIncrementalPublisher.mjs.map | 1 + .../legacyExecuteIncrementally.d.mts | 165 + .../legacyExecuteIncrementally.d.ts | 165 + .../legacyExecuteIncrementally.js | 17 + .../legacyExecuteIncrementally.js.map | 1 + .../legacyExecuteIncrementally.mjs | 13 + .../legacyExecuteIncrementally.mjs.map | 1 + .../graphql/execution/mapAsyncIterable.d.mts | 8 + .../graphql/execution/mapAsyncIterable.d.ts | 8 + .../graphql/execution/mapAsyncIterable.js | 35 + .../graphql/execution/mapAsyncIterable.js.map | 1 + .../graphql/execution/mapAsyncIterable.mjs | 32 + .../execution/mapAsyncIterable.mjs.map | 1 + .../returnIteratorCatchingErrors.d.mts | 2 + .../returnIteratorCatchingErrors.d.ts | 2 + .../execution/returnIteratorCatchingErrors.js | 11 + .../returnIteratorCatchingErrors.js.map | 1 + .../returnIteratorCatchingErrors.mjs | 8 + .../returnIteratorCatchingErrors.mjs.map | 1 + .../graphql/execution/values.d.mts | 243 + .../graphql/execution/values.d.ts | 243 + .../node_modules/graphql/execution/values.js | 178 + .../graphql/execution/values.js.map | 1 + .../node_modules/graphql/execution/values.mjs | 172 + .../graphql/execution/values.mjs.map | 1 + .../execution/withConcurrentAbruptClose.d.mts | 15 + .../execution/withConcurrentAbruptClose.d.ts | 15 + .../execution/withConcurrentAbruptClose.js | 58 + .../withConcurrentAbruptClose.js.map | 1 + .../execution/withConcurrentAbruptClose.mjs | 55 + .../withConcurrentAbruptClose.mjs.map | 1 + .../node_modules/graphql/graphql.d.mts | 209 + .../node_modules/graphql/graphql.d.ts | 209 + .../node_modules/graphql/graphql.js | 51 + .../node_modules/graphql/graphql.js.map | 1 + .../node_modules/graphql/graphql.mjs | 47 + .../node_modules/graphql/graphql.mjs.map | 1 + .../node_modules/graphql/harness.d.mts | 32 + .../node_modules/graphql/harness.d.ts | 32 + .../node_modules/graphql/harness.js | 13 + .../node_modules/graphql/harness.js.map | 1 + .../node_modules/graphql/harness.mjs | 10 + .../node_modules/graphql/harness.mjs.map | 1 + .../node_modules/graphql/index.d.mts | 54 + .../node_modules/graphql/index.d.ts | 54 + .../node_modules/graphql/index.js | 265 + .../node_modules/graphql/index.js.map | 1 + .../node_modules/graphql/index.mjs | 12 + .../node_modules/graphql/index.mjs.map | 1 + .../graphql/jsutils/AccumulatorMap.d.mts | 9 + .../graphql/jsutils/AccumulatorMap.d.ts | 9 + .../graphql/jsutils/AccumulatorMap.js | 19 + .../graphql/jsutils/AccumulatorMap.js.map | 1 + .../graphql/jsutils/AccumulatorMap.mjs | 15 + .../graphql/jsutils/AccumulatorMap.mjs.map | 1 + .../node_modules/graphql/jsutils/Maybe.d.mts | 6 + .../node_modules/graphql/jsutils/Maybe.d.ts | 6 + .../node_modules/graphql/jsutils/Maybe.js | 3 + .../node_modules/graphql/jsutils/Maybe.js.map | 1 + .../node_modules/graphql/jsutils/Maybe.mjs | 2 + .../graphql/jsutils/Maybe.mjs.map | 1 + .../node_modules/graphql/jsutils/ObjMap.d.mts | 24 + .../node_modules/graphql/jsutils/ObjMap.d.ts | 24 + .../node_modules/graphql/jsutils/ObjMap.js | 3 + .../graphql/jsutils/ObjMap.js.map | 1 + .../node_modules/graphql/jsutils/ObjMap.mjs | 2 + .../graphql/jsutils/ObjMap.mjs.map | 1 + .../node_modules/graphql/jsutils/Path.d.mts | 44 + .../node_modules/graphql/jsutils/Path.d.ts | 44 + .../node_modules/graphql/jsutils/Path.js | 17 + .../node_modules/graphql/jsutils/Path.js.map | 1 + .../node_modules/graphql/jsutils/Path.mjs | 13 + .../node_modules/graphql/jsutils/Path.mjs.map | 1 + .../graphql/jsutils/PromiseOrValue.d.mts | 2 + .../graphql/jsutils/PromiseOrValue.d.ts | 2 + .../graphql/jsutils/PromiseOrValue.js | 3 + .../graphql/jsutils/PromiseOrValue.js.map | 1 + .../graphql/jsutils/PromiseOrValue.mjs | 2 + .../graphql/jsutils/PromiseOrValue.mjs.map | 1 + .../graphql/jsutils/capitalize.d.mts | 6 + .../graphql/jsutils/capitalize.d.ts | 6 + .../graphql/jsutils/capitalize.js | 7 + .../graphql/jsutils/capitalize.js.map | 1 + .../graphql/jsutils/capitalize.mjs | 4 + .../graphql/jsutils/capitalize.mjs.map | 1 + .../graphql/jsutils/devAssert.d.mts | 2 + .../graphql/jsutils/devAssert.d.ts | 2 + .../node_modules/graphql/jsutils/devAssert.js | 9 + .../graphql/jsutils/devAssert.js.map | 1 + .../graphql/jsutils/devAssert.mjs | 6 + .../graphql/jsutils/devAssert.mjs.map | 1 + .../graphql/jsutils/didYouMean.d.mts | 8 + .../graphql/jsutils/didYouMean.d.ts | 8 + .../graphql/jsutils/didYouMean.js | 20 + .../graphql/jsutils/didYouMean.js.map | 1 + .../graphql/jsutils/didYouMean.mjs | 17 + .../graphql/jsutils/didYouMean.mjs.map | 1 + .../graphql/jsutils/formatList.d.mts | 12 + .../graphql/jsutils/formatList.d.ts | 12 + .../graphql/jsutils/formatList.js | 25 + .../graphql/jsutils/formatList.js.map | 1 + .../graphql/jsutils/formatList.mjs | 21 + .../graphql/jsutils/formatList.mjs.map | 1 + .../graphql/jsutils/getBySet.d.mts | 2 + .../graphql/jsutils/getBySet.d.ts | 2 + .../node_modules/graphql/jsutils/getBySet.js | 13 + .../graphql/jsutils/getBySet.js.map | 1 + .../node_modules/graphql/jsutils/getBySet.mjs | 10 + .../graphql/jsutils/getBySet.mjs.map | 1 + .../graphql/jsutils/groupBy.d.mts | 6 + .../node_modules/graphql/jsutils/groupBy.d.ts | 6 + .../node_modules/graphql/jsutils/groupBy.js | 12 + .../graphql/jsutils/groupBy.js.map | 1 + .../node_modules/graphql/jsutils/groupBy.mjs | 9 + .../graphql/jsutils/groupBy.mjs.map | 1 + .../graphql/jsutils/identityFunc.d.mts | 6 + .../graphql/jsutils/identityFunc.d.ts | 6 + .../graphql/jsutils/identityFunc.js | 7 + .../graphql/jsutils/identityFunc.js.map | 1 + .../graphql/jsutils/identityFunc.mjs | 4 + .../graphql/jsutils/identityFunc.mjs.map | 1 + .../graphql/jsutils/inspect.d.mts | 6 + .../node_modules/graphql/jsutils/inspect.d.ts | 6 + .../node_modules/graphql/jsutils/inspect.js | 90 + .../graphql/jsutils/inspect.js.map | 1 + .../node_modules/graphql/jsutils/inspect.mjs | 87 + .../graphql/jsutils/inspect.mjs.map | 1 + .../graphql/jsutils/instanceOf.d.mts | 17 + .../graphql/jsutils/instanceOf.d.ts | 17 + .../graphql/jsutils/instanceOf.js | 40 + .../graphql/jsutils/instanceOf.js.map | 1 + .../graphql/jsutils/instanceOf.mjs | 36 + .../graphql/jsutils/instanceOf.mjs.map | 1 + .../graphql/jsutils/invariant.d.mts | 2 + .../graphql/jsutils/invariant.d.ts | 2 + .../node_modules/graphql/jsutils/invariant.js | 9 + .../graphql/jsutils/invariant.js.map | 1 + .../graphql/jsutils/invariant.mjs | 6 + .../graphql/jsutils/invariant.mjs.map | 1 + .../graphql/jsutils/isAsyncIterable.d.mts | 7 + .../graphql/jsutils/isAsyncIterable.d.ts | 7 + .../graphql/jsutils/isAsyncIterable.js | 7 + .../graphql/jsutils/isAsyncIterable.js.map | 1 + .../graphql/jsutils/isAsyncIterable.mjs | 4 + .../graphql/jsutils/isAsyncIterable.mjs.map | 1 + .../graphql/jsutils/isIterableObject.d.mts | 19 + .../graphql/jsutils/isIterableObject.d.ts | 19 + .../graphql/jsutils/isIterableObject.js | 8 + .../graphql/jsutils/isIterableObject.js.map | 1 + .../graphql/jsutils/isIterableObject.mjs | 5 + .../graphql/jsutils/isIterableObject.mjs.map | 1 + .../graphql/jsutils/isObjectLike.d.mts | 9 + .../graphql/jsutils/isObjectLike.d.ts | 9 + .../graphql/jsutils/isObjectLike.js | 7 + .../graphql/jsutils/isObjectLike.js.map | 1 + .../graphql/jsutils/isObjectLike.mjs | 4 + .../graphql/jsutils/isObjectLike.mjs.map | 1 + .../graphql/jsutils/isPromise.d.mts | 9 + .../graphql/jsutils/isPromise.d.ts | 9 + .../node_modules/graphql/jsutils/isPromise.js | 11 + .../graphql/jsutils/isPromise.js.map | 1 + .../graphql/jsutils/isPromise.mjs | 7 + .../graphql/jsutils/isPromise.mjs.map | 1 + .../graphql/jsutils/isSameSet.d.mts | 2 + .../graphql/jsutils/isSameSet.d.ts | 2 + .../node_modules/graphql/jsutils/isSameSet.js | 15 + .../graphql/jsutils/isSameSet.js.map | 1 + .../graphql/jsutils/isSameSet.mjs | 12 + .../graphql/jsutils/isSameSet.mjs.map | 1 + .../node_modules/graphql/jsutils/keyMap.d.mts | 22 + .../node_modules/graphql/jsutils/keyMap.d.ts | 22 + .../node_modules/graphql/jsutils/keyMap.js | 11 + .../graphql/jsutils/keyMap.js.map | 1 + .../node_modules/graphql/jsutils/keyMap.mjs | 8 + .../graphql/jsutils/keyMap.mjs.map | 1 + .../graphql/jsutils/keyValMap.d.mts | 22 + .../graphql/jsutils/keyValMap.d.ts | 22 + .../node_modules/graphql/jsutils/keyValMap.js | 11 + .../graphql/jsutils/keyValMap.js.map | 1 + .../graphql/jsutils/keyValMap.mjs | 8 + .../graphql/jsutils/keyValMap.mjs.map | 1 + .../graphql/jsutils/mapValue.d.mts | 8 + .../graphql/jsutils/mapValue.d.ts | 8 + .../node_modules/graphql/jsutils/mapValue.js | 11 + .../graphql/jsutils/mapValue.js.map | 1 + .../node_modules/graphql/jsutils/mapValue.mjs | 8 + .../graphql/jsutils/mapValue.mjs.map | 1 + .../graphql/jsutils/memoize1.d.mts | 6 + .../graphql/jsutils/memoize1.d.ts | 6 + .../node_modules/graphql/jsutils/memoize1.js | 16 + .../graphql/jsutils/memoize1.js.map | 1 + .../node_modules/graphql/jsutils/memoize1.mjs | 13 + .../graphql/jsutils/memoize1.mjs.map | 1 + .../graphql/jsutils/memoize2.d.mts | 6 + .../graphql/jsutils/memoize2.d.ts | 6 + .../node_modules/graphql/jsutils/memoize2.js | 21 + .../graphql/jsutils/memoize2.js.map | 1 + .../node_modules/graphql/jsutils/memoize2.mjs | 18 + .../graphql/jsutils/memoize2.mjs.map | 1 + .../graphql/jsutils/memoize3.d.mts | 6 + .../graphql/jsutils/memoize3.d.ts | 6 + .../node_modules/graphql/jsutils/memoize3.js | 26 + .../graphql/jsutils/memoize3.js.map | 1 + .../node_modules/graphql/jsutils/memoize3.mjs | 23 + .../graphql/jsutils/memoize3.mjs.map | 1 + .../graphql/jsutils/naturalCompare.d.mts | 9 + .../graphql/jsutils/naturalCompare.d.ts | 9 + .../graphql/jsutils/naturalCompare.js | 48 + .../graphql/jsutils/naturalCompare.js.map | 1 + .../graphql/jsutils/naturalCompare.mjs | 45 + .../graphql/jsutils/naturalCompare.mjs.map | 1 + .../graphql/jsutils/printPathArray.d.mts | 6 + .../graphql/jsutils/printPathArray.d.ts | 6 + .../graphql/jsutils/printPathArray.js | 12 + .../graphql/jsutils/printPathArray.js.map | 1 + .../graphql/jsutils/printPathArray.mjs | 9 + .../graphql/jsutils/printPathArray.mjs.map | 1 + .../graphql/jsutils/promiseForObject.d.mts | 12 + .../graphql/jsutils/promiseForObject.d.ts | 12 + .../graphql/jsutils/promiseForObject.js | 15 + .../graphql/jsutils/promiseForObject.js.map | 1 + .../graphql/jsutils/promiseForObject.mjs | 12 + .../graphql/jsutils/promiseForObject.mjs.map | 1 + .../graphql/jsutils/promiseReduce.d.mts | 11 + .../graphql/jsutils/promiseReduce.d.ts | 11 + .../graphql/jsutils/promiseReduce.js | 14 + .../graphql/jsutils/promiseReduce.js.map | 1 + .../graphql/jsutils/promiseReduce.mjs | 11 + .../graphql/jsutils/promiseReduce.mjs.map | 1 + .../jsutils/promiseWithResolvers.d.mts | 12 + .../graphql/jsutils/promiseWithResolvers.d.ts | 12 + .../graphql/jsutils/promiseWithResolvers.js | 13 + .../jsutils/promiseWithResolvers.js.map | 1 + .../graphql/jsutils/promiseWithResolvers.mjs | 10 + .../jsutils/promiseWithResolvers.mjs.map | 1 + .../graphql/jsutils/suggestionList.d.mts | 7 + .../graphql/jsutils/suggestionList.d.ts | 7 + .../graphql/jsutils/suggestionList.js | 87 + .../graphql/jsutils/suggestionList.js.map | 1 + .../graphql/jsutils/suggestionList.mjs | 84 + .../graphql/jsutils/suggestionList.mjs.map | 1 + .../graphql/jsutils/toError.d.mts | 6 + .../node_modules/graphql/jsutils/toError.d.ts | 6 + .../node_modules/graphql/jsutils/toError.js | 17 + .../graphql/jsutils/toError.js.map | 1 + .../node_modules/graphql/jsutils/toError.mjs | 14 + .../graphql/jsutils/toError.mjs.map | 1 + .../graphql/jsutils/toObjMap.d.mts | 6 + .../graphql/jsutils/toObjMap.d.ts | 6 + .../node_modules/graphql/jsutils/toObjMap.js | 34 + .../graphql/jsutils/toObjMap.js.map | 1 + .../node_modules/graphql/jsutils/toObjMap.mjs | 30 + .../graphql/jsutils/toObjMap.mjs.map | 1 + .../graphql/language/KindTypeMap.d.mts | 3 + .../graphql/language/KindTypeMap.d.ts | 3 + .../graphql/language/KindTypeMap.js | 3 + .../graphql/language/KindTypeMap.js.map | 1 + .../graphql/language/KindTypeMap.mjs | 2 + .../graphql/language/KindTypeMap.mjs.map | 1 + .../node_modules/graphql/language/ast.d.mts | 862 + .../node_modules/graphql/language/ast.d.ts | 862 + .../node_modules/graphql/language/ast.js | 154 + .../node_modules/graphql/language/ast.js.map | 1 + .../node_modules/graphql/language/ast.mjs | 148 + .../node_modules/graphql/language/ast.mjs.map | 1 + .../graphql/language/blockString.d.mts | 21 + .../graphql/language/blockString.d.ts | 21 + .../graphql/language/blockString.js | 114 + .../graphql/language/blockString.js.map | 1 + .../graphql/language/blockString.mjs | 109 + .../graphql/language/blockString.mjs.map | 1 + .../graphql/language/characterClasses.d.mts | 47 + .../graphql/language/characterClasses.d.ts | 47 + .../graphql/language/characterClasses.js | 24 + .../graphql/language/characterClasses.js.map | 1 + .../graphql/language/characterClasses.mjs | 17 + .../graphql/language/characterClasses.mjs.map | 1 + .../graphql/language/directiveLocation.d.mts | 48 + .../graphql/language/directiveLocation.d.ts | 48 + .../graphql/language/directiveLocation.js | 27 + .../graphql/language/directiveLocation.js.map | 1 + .../graphql/language/directiveLocation.mjs | 24 + .../language/directiveLocation.mjs.map | 1 + .../node_modules/graphql/language/index.d.mts | 22 + .../node_modules/graphql/language/index.d.ts | 22 + .../node_modules/graphql/language/index.js | 49 + .../graphql/language/index.js.map | 1 + .../node_modules/graphql/language/index.mjs | 13 + .../graphql/language/index.mjs.map | 1 + .../node_modules/graphql/language/kinds.d.mts | 6 + .../node_modules/graphql/language/kinds.d.ts | 6 + .../node_modules/graphql/language/kinds.js | 38 + .../graphql/language/kinds.js.map | 1 + .../node_modules/graphql/language/kinds.mjs | 2 + .../graphql/language/kinds.mjs.map | 1 + .../graphql/language/kinds_.d.mts | 199 + .../node_modules/graphql/language/kinds_.d.ts | 199 + .../node_modules/graphql/language/kinds_.js | 54 + .../graphql/language/kinds_.js.map | 1 + .../node_modules/graphql/language/kinds_.mjs | 51 + .../graphql/language/kinds_.mjs.map | 1 + .../node_modules/graphql/language/lexer.d.mts | 120 + .../node_modules/graphql/language/lexer.d.ts | 120 + .../node_modules/graphql/language/lexer.js | 439 + .../graphql/language/lexer.js.map | 1 + .../node_modules/graphql/language/lexer.mjs | 431 + .../graphql/language/lexer.mjs.map | 1 + .../graphql/language/location.d.mts | 26 + .../graphql/language/location.d.ts | 26 + .../node_modules/graphql/language/location.js | 20 + .../graphql/language/location.js.map | 1 + .../graphql/language/location.mjs | 17 + .../graphql/language/location.mjs.map | 1 + .../graphql/language/parser.d.mts | 740 + .../node_modules/graphql/language/parser.d.ts | 740 + .../node_modules/graphql/language/parser.js | 1016 + .../graphql/language/parser.js.map | 1 + .../node_modules/graphql/language/parser.mjs | 1007 + .../graphql/language/parser.mjs.map | 1 + .../graphql/language/predicates.d.mts | 204 + .../graphql/language/predicates.d.ts | 204 + .../graphql/language/predicates.js | 91 + .../graphql/language/predicates.js.map | 1 + .../graphql/language/predicates.mjs | 77 + .../graphql/language/predicates.mjs.map | 1 + .../graphql/language/printLocation.d.mts | 39 + .../graphql/language/printLocation.d.ts | 39 + .../graphql/language/printLocation.js | 52 + .../graphql/language/printLocation.js.map | 1 + .../graphql/language/printLocation.mjs | 48 + .../graphql/language/printLocation.mjs.map | 1 + .../graphql/language/printString.d.mts | 7 + .../graphql/language/printString.d.ts | 7 + .../graphql/language/printString.js | 33 + .../graphql/language/printString.js.map | 1 + .../graphql/language/printString.mjs | 30 + .../graphql/language/printString.mjs.map | 1 + .../graphql/language/printer.d.mts | 18 + .../graphql/language/printer.d.ts | 18 + .../node_modules/graphql/language/printer.js | 251 + .../graphql/language/printer.js.map | 1 + .../node_modules/graphql/language/printer.mjs | 248 + .../graphql/language/printer.mjs.map | 1 + .../language/schemaCoordinateLexer.d.mts | 57 + .../language/schemaCoordinateLexer.d.ts | 57 + .../graphql/language/schemaCoordinateLexer.js | 63 + .../language/schemaCoordinateLexer.js.map | 1 + .../language/schemaCoordinateLexer.mjs | 59 + .../language/schemaCoordinateLexer.mjs.map | 1 + .../graphql/language/source.d.mts | 52 + .../node_modules/graphql/language/source.d.ts | 52 + .../node_modules/graphql/language/source.js | 27 + .../graphql/language/source.js.map | 1 + .../node_modules/graphql/language/source.mjs | 22 + .../graphql/language/source.mjs.map | 1 + .../graphql/language/tokenKind.d.mts | 35 + .../graphql/language/tokenKind.d.ts | 35 + .../graphql/language/tokenKind.js | 29 + .../graphql/language/tokenKind.js.map | 1 + .../graphql/language/tokenKind.mjs | 26 + .../graphql/language/tokenKind.mjs.map | 1 + .../graphql/language/visitor.d.mts | 278 + .../graphql/language/visitor.d.ts | 278 + .../node_modules/graphql/language/visitor.js | 190 + .../graphql/language/visitor.js.map | 1 + .../node_modules/graphql/language/visitor.mjs | 184 + .../graphql/language/visitor.mjs.map | 1 + .../node_modules/graphql/package.json | 203 + .../graphql/type/assertName.d.mts | 27 + .../node_modules/graphql/type/assertName.d.ts | 27 + .../node_modules/graphql/type/assertName.js | 27 + .../graphql/type/assertName.js.map | 1 + .../node_modules/graphql/type/assertName.mjs | 23 + .../graphql/type/assertName.mjs.map | 1 + .../graphql/type/definition.d.mts | 4095 ++++ .../node_modules/graphql/type/definition.d.ts | 4095 ++++ .../node_modules/graphql/type/definition.js | 846 + .../graphql/type/definition.js.map | 1 + .../node_modules/graphql/type/definition.mjs | 783 + .../graphql/type/definition.mjs.map | 1 + .../graphql/type/directives.d.mts | 291 + .../node_modules/graphql/type/directives.d.ts | 291 + .../node_modules/graphql/type/directives.js | 194 + .../graphql/type/directives.js.map | 1 + .../node_modules/graphql/type/directives.mjs | 187 + .../graphql/type/directives.mjs.map | 1 + .../node_modules/graphql/type/index.d.mts | 18 + .../node_modules/graphql/type/index.d.ts | 18 + .../node_modules/graphql/type/index.js | 111 + .../node_modules/graphql/type/index.js.map | 1 + .../node_modules/graphql/type/index.mjs | 8 + .../node_modules/graphql/type/index.mjs.map | 1 + .../graphql/type/introspection.d.mts | 62 + .../graphql/type/introspection.d.ts | 62 + .../graphql/type/introspection.js | 496 + .../graphql/type/introspection.js.map | 1 + .../graphql/type/introspection.mjs | 492 + .../graphql/type/introspection.mjs.map | 1 + .../node_modules/graphql/type/scalars.d.mts | 46 + .../node_modules/graphql/type/scalars.d.ts | 46 + .../node_modules/graphql/type/scalars.js | 320 + .../node_modules/graphql/type/scalars.js.map | 1 + .../node_modules/graphql/type/scalars.mjs | 316 + .../node_modules/graphql/type/scalars.mjs.map | 1 + .../node_modules/graphql/type/schema.d.mts | 644 + .../node_modules/graphql/type/schema.d.ts | 644 + .../node_modules/graphql/type/schema.js | 220 + .../node_modules/graphql/type/schema.js.map | 1 + .../node_modules/graphql/type/schema.mjs | 214 + .../node_modules/graphql/type/schema.mjs.map | 1 + .../node_modules/graphql/type/validate.d.mts | 50 + .../node_modules/graphql/type/validate.d.ts | 50 + .../node_modules/graphql/type/validate.js | 593 + .../node_modules/graphql/type/validate.js.map | 1 + .../node_modules/graphql/type/validate.mjs | 588 + .../graphql/type/validate.mjs.map | 1 + .../graphql/utilities/TypeInfo.d.mts | 618 + .../graphql/utilities/TypeInfo.d.ts | 618 + .../graphql/utilities/TypeInfo.js | 284 + .../graphql/utilities/TypeInfo.js.map | 1 + .../graphql/utilities/TypeInfo.mjs | 279 + .../graphql/utilities/TypeInfo.mjs.map | 1 + .../graphql/utilities/astFromValue.d.mts | 60 + .../graphql/utilities/astFromValue.d.ts | 60 + .../graphql/utilities/astFromValue.js | 90 + .../graphql/utilities/astFromValue.js.map | 1 + .../graphql/utilities/astFromValue.mjs | 87 + .../graphql/utilities/astFromValue.mjs.map | 1 + .../graphql/utilities/buildASTSchema.d.mts | 88 + .../graphql/utilities/buildASTSchema.d.ts | 88 + .../graphql/utilities/buildASTSchema.js | 54 + .../graphql/utilities/buildASTSchema.js.map | 1 + .../graphql/utilities/buildASTSchema.mjs | 50 + .../graphql/utilities/buildASTSchema.mjs.map | 1 + .../graphql/utilities/buildClientSchema.d.mts | 35 + .../graphql/utilities/buildClientSchema.d.ts | 35 + .../graphql/utilities/buildClientSchema.js | 232 + .../utilities/buildClientSchema.js.map | 1 + .../graphql/utilities/buildClientSchema.mjs | 229 + .../utilities/buildClientSchema.mjs.map | 1 + .../graphql/utilities/coerceInputValue.d.mts | 117 + .../graphql/utilities/coerceInputValue.d.ts | 117 + .../graphql/utilities/coerceInputValue.js | 228 + .../graphql/utilities/coerceInputValue.js.map | 1 + .../graphql/utilities/coerceInputValue.mjs | 223 + .../utilities/coerceInputValue.mjs.map | 1 + .../graphql/utilities/concatAST.d.mts | 22 + .../graphql/utilities/concatAST.d.ts | 22 + .../graphql/utilities/concatAST.js | 12 + .../graphql/utilities/concatAST.js.map | 1 + .../graphql/utilities/concatAST.mjs | 9 + .../graphql/utilities/concatAST.mjs.map | 1 + .../graphql/utilities/extendSchema.d.mts | 84 + .../graphql/utilities/extendSchema.d.ts | 84 + .../graphql/utilities/extendSchema.js | 413 + .../graphql/utilities/extendSchema.js.map | 1 + .../graphql/utilities/extendSchema.mjs | 409 + .../graphql/utilities/extendSchema.mjs.map | 1 + .../graphql/utilities/findSchemaChanges.d.mts | 172 + .../graphql/utilities/findSchemaChanges.d.ts | 172 + .../graphql/utilities/findSchemaChanges.js | 553 + .../utilities/findSchemaChanges.js.map | 1 + .../graphql/utilities/findSchemaChanges.mjs | 547 + .../utilities/findSchemaChanges.mjs.map | 1 + .../utilities/getDefaultValueAST.d.mts | 4 + .../graphql/utilities/getDefaultValueAST.d.ts | 4 + .../graphql/utilities/getDefaultValueAST.js | 25 + .../utilities/getDefaultValueAST.js.map | 1 + .../graphql/utilities/getDefaultValueAST.mjs | 22 + .../utilities/getDefaultValueAST.mjs.map | 1 + .../utilities/getIntrospectionQuery.d.mts | 286 + .../utilities/getIntrospectionQuery.d.ts | 286 + .../utilities/getIntrospectionQuery.js | 120 + .../utilities/getIntrospectionQuery.js.map | 1 + .../utilities/getIntrospectionQuery.mjs | 117 + .../utilities/getIntrospectionQuery.mjs.map | 1 + .../graphql/utilities/getOperationAST.d.mts | 23 + .../graphql/utilities/getOperationAST.d.ts | 23 + .../graphql/utilities/getOperationAST.js | 22 + .../graphql/utilities/getOperationAST.js.map | 1 + .../graphql/utilities/getOperationAST.mjs | 19 + .../graphql/utilities/getOperationAST.mjs.map | 1 + .../graphql/utilities/index.d.mts | 47 + .../node_modules/graphql/utilities/index.d.ts | 47 + .../node_modules/graphql/utilities/index.js | 65 + .../graphql/utilities/index.js.map | 1 + .../node_modules/graphql/utilities/index.mjs | 24 + .../graphql/utilities/index.mjs.map | 1 + .../utilities/introspectionFromSchema.d.mts | 70 + .../utilities/introspectionFromSchema.d.ts | 70 + .../utilities/introspectionFromSchema.js | 24 + .../utilities/introspectionFromSchema.js.map | 1 + .../utilities/introspectionFromSchema.mjs | 21 + .../utilities/introspectionFromSchema.mjs.map | 1 + .../utilities/lexicographicSortSchema.d.mts | 46 + .../utilities/lexicographicSortSchema.d.ts | 46 + .../utilities/lexicographicSortSchema.js | 64 + .../utilities/lexicographicSortSchema.js.map | 1 + .../utilities/lexicographicSortSchema.mjs | 61 + .../utilities/lexicographicSortSchema.mjs.map | 1 + .../graphql/utilities/mapSchemaConfig.d.mts | 69 + .../graphql/utilities/mapSchemaConfig.d.ts | 69 + .../graphql/utilities/mapSchemaConfig.js | 243 + .../graphql/utilities/mapSchemaConfig.js.map | 1 + .../graphql/utilities/mapSchemaConfig.mjs | 239 + .../graphql/utilities/mapSchemaConfig.mjs.map | 1 + .../graphql/utilities/printSchema.d.mts | 95 + .../graphql/utilities/printSchema.d.ts | 95 + .../graphql/utilities/printSchema.js | 202 + .../graphql/utilities/printSchema.js.map | 1 + .../graphql/utilities/printSchema.mjs | 196 + .../graphql/utilities/printSchema.mjs.map | 1 + .../graphql/utilities/replaceVariables.d.mts | 45 + .../graphql/utilities/replaceVariables.d.ts | 45 + .../graphql/utilities/replaceVariables.js | 72 + .../graphql/utilities/replaceVariables.js.map | 1 + .../graphql/utilities/replaceVariables.mjs | 69 + .../utilities/replaceVariables.mjs.map | 1 + .../utilities/resolveSchemaCoordinate.d.mts | 119 + .../utilities/resolveSchemaCoordinate.d.ts | 119 + .../utilities/resolveSchemaCoordinate.js | 111 + .../utilities/resolveSchemaCoordinate.js.map | 1 + .../utilities/resolveSchemaCoordinate.mjs | 107 + .../utilities/resolveSchemaCoordinate.mjs.map | 1 + .../utilities/separateOperations.d.mts | 39 + .../graphql/utilities/separateOperations.d.ts | 39 + .../graphql/utilities/separateOperations.js | 56 + .../utilities/separateOperations.js.map | 1 + .../graphql/utilities/separateOperations.mjs | 53 + .../utilities/separateOperations.mjs.map | 1 + .../graphql/utilities/sortValueNode.d.mts | 9 + .../graphql/utilities/sortValueNode.d.ts | 9 + .../graphql/utilities/sortValueNode.js | 36 + .../graphql/utilities/sortValueNode.js.map | 1 + .../graphql/utilities/sortValueNode.mjs | 33 + .../graphql/utilities/sortValueNode.mjs.map | 1 + .../utilities/stripIgnoredCharacters.d.mts | 69 + .../utilities/stripIgnoredCharacters.d.ts | 69 + .../utilities/stripIgnoredCharacters.js | 34 + .../utilities/stripIgnoredCharacters.js.map | 1 + .../utilities/stripIgnoredCharacters.mjs | 31 + .../utilities/stripIgnoredCharacters.mjs.map | 1 + .../graphql/utilities/typeComparators.d.mts | 101 + .../graphql/utilities/typeComparators.d.ts | 101 + .../graphql/utilities/typeComparators.js | 62 + .../graphql/utilities/typeComparators.js.map | 1 + .../graphql/utilities/typeComparators.mjs | 57 + .../graphql/utilities/typeComparators.mjs.map | 1 + .../graphql/utilities/typeFromAST.d.mts | 101 + .../graphql/utilities/typeFromAST.d.ts | 101 + .../graphql/utilities/typeFromAST.js | 20 + .../graphql/utilities/typeFromAST.js.map | 1 + .../graphql/utilities/typeFromAST.mjs | 17 + .../graphql/utilities/typeFromAST.mjs.map | 1 + .../utilities/typedQueryDocumentNode.d.mts | 21 + .../utilities/typedQueryDocumentNode.d.ts | 21 + .../utilities/typedQueryDocumentNode.js | 3 + .../utilities/typedQueryDocumentNode.js.map | 1 + .../utilities/typedQueryDocumentNode.mjs | 2 + .../utilities/typedQueryDocumentNode.mjs.map | 1 + .../utilities/validateInputValue.d.mts | 144 + .../graphql/utilities/validateInputValue.d.ts | 144 + .../graphql/utilities/validateInputValue.js | 270 + .../utilities/validateInputValue.js.map | 1 + .../graphql/utilities/validateInputValue.mjs | 266 + .../utilities/validateInputValue.mjs.map | 1 + .../graphql/utilities/valueFromAST.d.mts | 67 + .../graphql/utilities/valueFromAST.d.ts | 67 + .../graphql/utilities/valueFromAST.js | 124 + .../graphql/utilities/valueFromAST.js.map | 1 + .../graphql/utilities/valueFromAST.mjs | 121 + .../graphql/utilities/valueFromAST.mjs.map | 1 + .../utilities/valueFromASTUntyped.d.mts | 33 + .../utilities/valueFromASTUntyped.d.ts | 33 + .../graphql/utilities/valueFromASTUntyped.js | 26 + .../utilities/valueFromASTUntyped.js.map | 1 + .../graphql/utilities/valueFromASTUntyped.mjs | 23 + .../utilities/valueFromASTUntyped.mjs.map | 1 + .../graphql/utilities/valueToLiteral.d.mts | 60 + .../graphql/utilities/valueToLiteral.d.ts | 60 + .../graphql/utilities/valueToLiteral.js | 120 + .../graphql/utilities/valueToLiteral.js.map | 1 + .../graphql/utilities/valueToLiteral.mjs | 116 + .../graphql/utilities/valueToLiteral.mjs.map | 1 + .../validation/ValidationContext.d.mts | 560 + .../graphql/validation/ValidationContext.d.ts | 560 + .../graphql/validation/ValidationContext.js | 201 + .../validation/ValidationContext.js.map | 1 + .../graphql/validation/ValidationContext.mjs | 195 + .../validation/ValidationContext.mjs.map | 1 + .../graphql/validation/index.d.mts | 53 + .../graphql/validation/index.d.ts | 53 + .../node_modules/graphql/validation/index.js | 95 + .../graphql/validation/index.js.map | 1 + .../node_modules/graphql/validation/index.mjs | 46 + .../graphql/validation/index.mjs.map | 1 + .../rules/DeferStreamDirectiveLabelRule.d.mts | 38 + .../rules/DeferStreamDirectiveLabelRule.d.ts | 38 + .../rules/DeferStreamDirectiveLabelRule.js | 33 + .../DeferStreamDirectiveLabelRule.js.map | 1 + .../rules/DeferStreamDirectiveLabelRule.mjs | 30 + .../DeferStreamDirectiveLabelRule.mjs.map | 1 + .../DeferStreamDirectiveOnRootFieldRule.d.mts | 39 + .../DeferStreamDirectiveOnRootFieldRule.d.ts | 39 + .../DeferStreamDirectiveOnRootFieldRule.js | 84 + ...DeferStreamDirectiveOnRootFieldRule.js.map | 1 + .../DeferStreamDirectiveOnRootFieldRule.mjs | 81 + ...eferStreamDirectiveOnRootFieldRule.mjs.map | 1 + ...StreamDirectiveOnValidOperationsRule.d.mts | 60 + ...rStreamDirectiveOnValidOperationsRule.d.ts | 60 + ...ferStreamDirectiveOnValidOperationsRule.js | 123 + ...treamDirectiveOnValidOperationsRule.js.map | 1 + ...erStreamDirectiveOnValidOperationsRule.mjs | 120 + ...reamDirectiveOnValidOperationsRule.mjs.map | 1 + .../rules/ExecutableDefinitionsRule.d.mts | 43 + .../rules/ExecutableDefinitionsRule.d.ts | 43 + .../rules/ExecutableDefinitionsRule.js | 25 + .../rules/ExecutableDefinitionsRule.js.map | 1 + .../rules/ExecutableDefinitionsRule.mjs | 22 + .../rules/ExecutableDefinitionsRule.mjs.map | 1 + .../rules/FieldsOnCorrectTypeRule.d.mts | 41 + .../rules/FieldsOnCorrectTypeRule.d.ts | 41 + .../rules/FieldsOnCorrectTypeRule.js | 77 + .../rules/FieldsOnCorrectTypeRule.js.map | 1 + .../rules/FieldsOnCorrectTypeRule.mjs | 74 + .../rules/FieldsOnCorrectTypeRule.mjs.map | 1 + .../rules/FragmentsOnCompositeTypesRule.d.mts | 44 + .../rules/FragmentsOnCompositeTypesRule.d.ts | 44 + .../rules/FragmentsOnCompositeTypesRule.js | 29 + .../FragmentsOnCompositeTypesRule.js.map | 1 + .../rules/FragmentsOnCompositeTypesRule.mjs | 26 + .../FragmentsOnCompositeTypesRule.mjs.map | 1 + .../rules/KnownArgumentNamesRule.d.mts | 44 + .../rules/KnownArgumentNamesRule.d.ts | 44 + .../rules/KnownArgumentNamesRule.js | 75 + .../rules/KnownArgumentNamesRule.js.map | 1 + .../rules/KnownArgumentNamesRule.mjs | 71 + .../rules/KnownArgumentNamesRule.mjs.map | 1 + .../rules/KnownDirectivesRule.d.mts | 39 + .../validation/rules/KnownDirectivesRule.d.ts | 39 + .../validation/rules/KnownDirectivesRule.js | 115 + .../rules/KnownDirectivesRule.js.map | 1 + .../validation/rules/KnownDirectivesRule.mjs | 112 + .../rules/KnownDirectivesRule.mjs.map | 1 + .../rules/KnownFragmentNamesRule.d.mts | 41 + .../rules/KnownFragmentNamesRule.d.ts | 41 + .../rules/KnownFragmentNamesRule.js | 18 + .../rules/KnownFragmentNamesRule.js.map | 1 + .../rules/KnownFragmentNamesRule.mjs | 15 + .../rules/KnownFragmentNamesRule.mjs.map | 1 + .../rules/KnownOperationTypesRule.d.mts | 31 + .../rules/KnownOperationTypesRule.d.ts | 31 + .../rules/KnownOperationTypesRule.js | 16 + .../rules/KnownOperationTypesRule.js.map | 1 + .../rules/KnownOperationTypesRule.mjs | 13 + .../rules/KnownOperationTypesRule.mjs.map | 1 + .../validation/rules/KnownTypeNamesRule.d.mts | 39 + .../validation/rules/KnownTypeNamesRule.d.ts | 39 + .../validation/rules/KnownTypeNamesRule.js | 39 + .../rules/KnownTypeNamesRule.js.map | 1 + .../validation/rules/KnownTypeNamesRule.mjs | 36 + .../rules/KnownTypeNamesRule.mjs.map | 1 + .../rules/LoneAnonymousOperationRule.d.mts | 43 + .../rules/LoneAnonymousOperationRule.d.ts | 43 + .../rules/LoneAnonymousOperationRule.js | 19 + .../rules/LoneAnonymousOperationRule.js.map | 1 + .../rules/LoneAnonymousOperationRule.mjs | 16 + .../rules/LoneAnonymousOperationRule.mjs.map | 1 + .../rules/LoneSchemaDefinitionRule.d.mts | 29 + .../rules/LoneSchemaDefinitionRule.d.ts | 29 + .../rules/LoneSchemaDefinitionRule.js | 27 + .../rules/LoneSchemaDefinitionRule.js.map | 1 + .../rules/LoneSchemaDefinitionRule.mjs | 24 + .../rules/LoneSchemaDefinitionRule.mjs.map | 1 + .../rules/MaxIntrospectionDepthRule.d.mts | 38 + .../rules/MaxIntrospectionDepthRule.d.ts | 38 + .../rules/MaxIntrospectionDepthRule.js | 58 + .../rules/MaxIntrospectionDepthRule.js.map | 1 + .../rules/MaxIntrospectionDepthRule.mjs | 55 + .../rules/MaxIntrospectionDepthRule.mjs.map | 1 + .../rules/NoFragmentCyclesRule.d.mts | 39 + .../rules/NoFragmentCyclesRule.d.ts | 39 + .../validation/rules/NoFragmentCyclesRule.js | 51 + .../rules/NoFragmentCyclesRule.js.map | 1 + .../validation/rules/NoFragmentCyclesRule.mjs | 48 + .../rules/NoFragmentCyclesRule.mjs.map | 1 + .../rules/NoUndefinedVariablesRule.d.mts | 41 + .../rules/NoUndefinedVariablesRule.d.ts | 41 + .../rules/NoUndefinedVariablesRule.js | 24 + .../rules/NoUndefinedVariablesRule.js.map | 1 + .../rules/NoUndefinedVariablesRule.mjs | 21 + .../rules/NoUndefinedVariablesRule.mjs.map | 1 + .../rules/NoUnusedFragmentsRule.d.mts | 41 + .../rules/NoUnusedFragmentsRule.d.ts | 41 + .../validation/rules/NoUnusedFragmentsRule.js | 33 + .../rules/NoUnusedFragmentsRule.js.map | 1 + .../rules/NoUnusedFragmentsRule.mjs | 30 + .../rules/NoUnusedFragmentsRule.mjs.map | 1 + .../rules/NoUnusedVariablesRule.d.mts | 42 + .../rules/NoUnusedVariablesRule.d.ts | 42 + .../validation/rules/NoUnusedVariablesRule.js | 39 + .../rules/NoUnusedVariablesRule.js.map | 1 + .../rules/NoUnusedVariablesRule.mjs | 36 + .../rules/NoUnusedVariablesRule.mjs.map | 1 + .../OverlappingFieldsCanBeMergedRule.d.mts | 49 + .../OverlappingFieldsCanBeMergedRule.d.ts | 49 + .../rules/OverlappingFieldsCanBeMergedRule.js | 422 + .../OverlappingFieldsCanBeMergedRule.js.map | 1 + .../OverlappingFieldsCanBeMergedRule.mjs | 419 + .../OverlappingFieldsCanBeMergedRule.mjs.map | 1 + .../rules/PossibleFragmentSpreadsRule.d.mts | 50 + .../rules/PossibleFragmentSpreadsRule.d.ts | 50 + .../rules/PossibleFragmentSpreadsRule.js | 45 + .../rules/PossibleFragmentSpreadsRule.js.map | 1 + .../rules/PossibleFragmentSpreadsRule.mjs | 42 + .../rules/PossibleFragmentSpreadsRule.mjs.map | 1 + .../rules/PossibleTypeExtensionsRule.d.mts | 29 + .../rules/PossibleTypeExtensionsRule.d.ts | 29 + .../rules/PossibleTypeExtensionsRule.js | 104 + .../rules/PossibleTypeExtensionsRule.js.map | 1 + .../rules/PossibleTypeExtensionsRule.mjs | 101 + .../rules/PossibleTypeExtensionsRule.mjs.map | 1 + .../rules/ProvidedRequiredArgumentsRule.d.mts | 43 + .../rules/ProvidedRequiredArgumentsRule.d.ts | 43 + .../rules/ProvidedRequiredArgumentsRule.js | 88 + .../ProvidedRequiredArgumentsRule.js.map | 1 + .../rules/ProvidedRequiredArgumentsRule.mjs | 84 + .../ProvidedRequiredArgumentsRule.mjs.map | 1 + .../validation/rules/ScalarLeafsRule.d.mts | 37 + .../validation/rules/ScalarLeafsRule.d.ts | 37 + .../validation/rules/ScalarLeafsRule.js | 34 + .../validation/rules/ScalarLeafsRule.js.map | 1 + .../validation/rules/ScalarLeafsRule.mjs | 31 + .../validation/rules/ScalarLeafsRule.mjs.map | 1 + .../rules/SingleFieldSubscriptionsRule.d.mts | 48 + .../rules/SingleFieldSubscriptionsRule.d.ts | 48 + .../rules/SingleFieldSubscriptionsRule.js | 54 + .../rules/SingleFieldSubscriptionsRule.js.map | 1 + .../rules/SingleFieldSubscriptionsRule.mjs | 51 + .../SingleFieldSubscriptionsRule.mjs.map | 1 + .../StreamDirectiveOnListFieldRule.d.mts | 29 + .../rules/StreamDirectiveOnListFieldRule.d.ts | 29 + .../rules/StreamDirectiveOnListFieldRule.js | 22 + .../StreamDirectiveOnListFieldRule.js.map | 1 + .../rules/StreamDirectiveOnListFieldRule.mjs | 19 + .../StreamDirectiveOnListFieldRule.mjs.map | 1 + .../UniqueArgumentDefinitionNamesRule.d.mts | 30 + .../UniqueArgumentDefinitionNamesRule.d.ts | 30 + .../UniqueArgumentDefinitionNamesRule.js | 37 + .../UniqueArgumentDefinitionNamesRule.js.map | 1 + .../UniqueArgumentDefinitionNamesRule.mjs | 34 + .../UniqueArgumentDefinitionNamesRule.mjs.map | 1 + .../rules/UniqueArgumentNamesRule.d.mts | 41 + .../rules/UniqueArgumentNamesRule.d.ts | 41 + .../rules/UniqueArgumentNamesRule.js | 21 + .../rules/UniqueArgumentNamesRule.js.map | 1 + .../rules/UniqueArgumentNamesRule.mjs | 18 + .../rules/UniqueArgumentNamesRule.mjs.map | 1 + .../rules/UniqueDirectiveNamesRule.d.mts | 29 + .../rules/UniqueDirectiveNamesRule.d.ts | 29 + .../rules/UniqueDirectiveNamesRule.js | 26 + .../rules/UniqueDirectiveNamesRule.js.map | 1 + .../rules/UniqueDirectiveNamesRule.mjs | 23 + .../rules/UniqueDirectiveNamesRule.mjs.map | 1 + .../UniqueDirectivesPerLocationRule.d.mts | 43 + .../UniqueDirectivesPerLocationRule.d.ts | 43 + .../rules/UniqueDirectivesPerLocationRule.js | 71 + .../UniqueDirectivesPerLocationRule.js.map | 1 + .../rules/UniqueDirectivesPerLocationRule.mjs | 68 + .../UniqueDirectivesPerLocationRule.mjs.map | 1 + .../rules/UniqueEnumValueNamesRule.d.mts | 29 + .../rules/UniqueEnumValueNamesRule.d.ts | 29 + .../rules/UniqueEnumValueNamesRule.js | 40 + .../rules/UniqueEnumValueNamesRule.js.map | 1 + .../rules/UniqueEnumValueNamesRule.mjs | 37 + .../rules/UniqueEnumValueNamesRule.mjs.map | 1 + .../UniqueFieldDefinitionNamesRule.d.mts | 29 + .../rules/UniqueFieldDefinitionNamesRule.d.ts | 29 + .../rules/UniqueFieldDefinitionNamesRule.js | 49 + .../UniqueFieldDefinitionNamesRule.js.map | 1 + .../rules/UniqueFieldDefinitionNamesRule.mjs | 46 + .../UniqueFieldDefinitionNamesRule.mjs.map | 1 + .../rules/UniqueFragmentNamesRule.d.mts | 40 + .../rules/UniqueFragmentNamesRule.d.ts | 40 + .../rules/UniqueFragmentNamesRule.js | 22 + .../rules/UniqueFragmentNamesRule.js.map | 1 + .../rules/UniqueFragmentNamesRule.mjs | 19 + .../rules/UniqueFragmentNamesRule.mjs.map | 1 + .../rules/UniqueInputFieldNamesRule.d.mts | 47 + .../rules/UniqueInputFieldNamesRule.d.ts | 47 + .../rules/UniqueInputFieldNamesRule.js | 34 + .../rules/UniqueInputFieldNamesRule.js.map | 1 + .../rules/UniqueInputFieldNamesRule.mjs | 31 + .../rules/UniqueInputFieldNamesRule.mjs.map | 1 + .../rules/UniqueOperationNamesRule.d.mts | 40 + .../rules/UniqueOperationNamesRule.d.ts | 40 + .../rules/UniqueOperationNamesRule.js | 24 + .../rules/UniqueOperationNamesRule.js.map | 1 + .../rules/UniqueOperationNamesRule.mjs | 21 + .../rules/UniqueOperationNamesRule.mjs.map | 1 + .../rules/UniqueOperationTypesRule.d.mts | 29 + .../rules/UniqueOperationTypesRule.d.ts | 29 + .../rules/UniqueOperationTypesRule.js | 37 + .../rules/UniqueOperationTypesRule.js.map | 1 + .../rules/UniqueOperationTypesRule.mjs | 34 + .../rules/UniqueOperationTypesRule.mjs.map | 1 + .../rules/UniqueTypeNamesRule.d.mts | 29 + .../validation/rules/UniqueTypeNamesRule.d.ts | 29 + .../validation/rules/UniqueTypeNamesRule.js | 34 + .../rules/UniqueTypeNamesRule.js.map | 1 + .../validation/rules/UniqueTypeNamesRule.mjs | 31 + .../rules/UniqueTypeNamesRule.mjs.map | 1 + .../rules/UniqueVariableNamesRule.d.mts | 38 + .../rules/UniqueVariableNamesRule.d.ts | 38 + .../rules/UniqueVariableNamesRule.js | 19 + .../rules/UniqueVariableNamesRule.js.map | 1 + .../rules/UniqueVariableNamesRule.mjs | 16 + .../rules/UniqueVariableNamesRule.mjs.map | 1 + .../rules/ValuesOfCorrectTypeRule.d.mts | 41 + .../rules/ValuesOfCorrectTypeRule.d.ts | 41 + .../rules/ValuesOfCorrectTypeRule.js | 25 + .../rules/ValuesOfCorrectTypeRule.js.map | 1 + .../rules/ValuesOfCorrectTypeRule.mjs | 22 + .../rules/ValuesOfCorrectTypeRule.mjs.map | 1 + .../rules/VariablesAreInputTypesRule.d.mts | 47 + .../rules/VariablesAreInputTypesRule.d.ts | 47 + .../rules/VariablesAreInputTypesRule.js | 20 + .../rules/VariablesAreInputTypesRule.js.map | 1 + .../rules/VariablesAreInputTypesRule.mjs | 17 + .../rules/VariablesAreInputTypesRule.mjs.map | 1 + .../VariablesInAllowedPositionRule.d.mts | 42 + .../rules/VariablesInAllowedPositionRule.d.ts | 42 + .../rules/VariablesInAllowedPositionRule.js | 55 + .../VariablesInAllowedPositionRule.js.map | 1 + .../rules/VariablesInAllowedPositionRule.mjs | 52 + .../VariablesInAllowedPositionRule.mjs.map | 1 + .../rules/custom/NoDeprecatedCustomRule.d.mts | 56 + .../rules/custom/NoDeprecatedCustomRule.d.ts | 56 + .../rules/custom/NoDeprecatedCustomRule.js | 41 + .../custom/NoDeprecatedCustomRule.js.map | 1 + .../rules/custom/NoDeprecatedCustomRule.mjs | 38 + .../custom/NoDeprecatedCustomRule.mjs.map | 1 + .../NoSchemaIntrospectionCustomRule.d.mts | 45 + .../NoSchemaIntrospectionCustomRule.d.ts | 45 + .../custom/NoSchemaIntrospectionCustomRule.js | 17 + .../NoSchemaIntrospectionCustomRule.js.map | 1 + .../NoSchemaIntrospectionCustomRule.mjs | 14 + .../NoSchemaIntrospectionCustomRule.mjs.map | 1 + .../graphql/validation/specifiedRules.d.mts | 16 + .../graphql/validation/specifiedRules.d.ts | 16 + .../graphql/validation/specifiedRules.js | 98 + .../graphql/validation/specifiedRules.js.map | 1 + .../graphql/validation/specifiedRules.mjs | 95 + .../graphql/validation/specifiedRules.mjs.map | 1 + .../graphql/validation/validate.d.mts | 103 + .../graphql/validation/validate.d.ts | 103 + .../graphql/validation/validate.js | 70 + .../graphql/validation/validate.js.map | 1 + .../graphql/validation/validate.mjs | 64 + .../graphql/validation/validate.mjs.map | 1 + .../node_modules/graphql/version.d.mts | 10 + .../node_modules/graphql/version.d.ts | 10 + .../node_modules/graphql/version.js | 11 + .../node_modules/graphql/version.js.map | 1 + .../node_modules/graphql/version.mjs | 8 + .../node_modules/graphql/version.mjs.map | 1 + .../node_modules/es-define-property | 1 + .../has-property-descriptors/.eslintrc | 13 + .../.github/FUNDING.yml | 12 + .../has-property-descriptors/.nycrc | 9 + .../has-property-descriptors/CHANGELOG.md | 35 + .../has-property-descriptors/LICENSE | 21 + .../has-property-descriptors/README.md | 43 + .../has-property-descriptors/index.js | 22 + .../has-property-descriptors/package.json | 77 + .../has-property-descriptors/test/index.js | 57 + .../node_modules/has-symbols/.eslintrc | 11 + .../has-symbols/.github/FUNDING.yml | 12 + .../node_modules/has-symbols/.nycrc | 9 + .../node_modules/has-symbols/CHANGELOG.md | 91 + .../node_modules/has-symbols/LICENSE | 21 + .../node_modules/has-symbols/README.md | 46 + .../node_modules/has-symbols/index.d.ts | 3 + .../node_modules/has-symbols/index.js | 14 + .../node_modules/has-symbols/package.json | 111 + .../node_modules/has-symbols/shams.d.ts | 3 + .../node_modules/has-symbols/shams.js | 45 + .../node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 29 + .../test/shams/get-own-property-symbols.js | 29 + .../node_modules/has-symbols/test/tests.js | 58 + .../node_modules/has-symbols/tsconfig.json | 10 + .../node_modules/has-symbols | 1 + .../node_modules/has-tostringtag/.eslintrc | 5 + .../has-tostringtag/.github/FUNDING.yml | 12 + .../node_modules/has-tostringtag/.nycrc | 13 + .../node_modules/has-tostringtag/CHANGELOG.md | 42 + .../node_modules/has-tostringtag/LICENSE | 21 + .../node_modules/has-tostringtag/README.md | 46 + .../node_modules/has-tostringtag/index.d.ts | 3 + .../node_modules/has-tostringtag/index.js | 8 + .../node_modules/has-tostringtag/package.json | 108 + .../node_modules/has-tostringtag/shams.d.ts | 3 + .../node_modules/has-tostringtag/shams.js | 8 + .../has-tostringtag/test/index.js | 21 + .../has-tostringtag/test/shams/core-js.js | 31 + .../test/shams/get-own-property-symbols.js | 30 + .../has-tostringtag/test/tests.js | 15 + .../has-tostringtag/tsconfig.json | 49 + .../hasown@2.0.4/node_modules/function-bind | 1 + .../node_modules/hasown/.github/FUNDING.yml | 12 + .../hasown@2.0.4/node_modules/hasown/.nycrc | 13 + .../node_modules/hasown/CHANGELOG.md | 58 + .../hasown@2.0.4/node_modules/hasown/LICENSE | 21 + .../node_modules/hasown/README.md | 40 + .../node_modules/hasown/eslint.config.mjs | 6 + .../node_modules/hasown/index.d.ts | 3 + .../hasown@2.0.4/node_modules/hasown/index.js | 8 + .../node_modules/hasown/package.json | 91 + .../node_modules/hasown/tsconfig.json | 6 + .../.pnpm/http-errors@2.0.1/node_modules/depd | 1 + .../node_modules/http-errors/HISTORY.md | 186 + .../node_modules/http-errors/LICENSE | 23 + .../node_modules/http-errors/README.md | 169 + .../node_modules/http-errors/index.js | 290 + .../node_modules/http-errors/package.json | 54 + .../http-errors@2.0.1/node_modules/inherits | 1 + .../node_modules/setprototypeof | 1 + .../http-errors@2.0.1/node_modules/statuses | 1 + .../node_modules/toidentifier | 1 + .../node_modules/iconv-lite/LICENSE | 21 + .../node_modules/iconv-lite/README.md | 138 + .../iconv-lite/encodings/dbcs-codec.js | 532 + .../iconv-lite/encodings/dbcs-data.js | 185 + .../iconv-lite/encodings/index.js | 23 + .../iconv-lite/encodings/internal.js | 218 + .../iconv-lite/encodings/sbcs-codec.js | 75 + .../encodings/sbcs-data-generated.js | 451 + .../iconv-lite/encodings/sbcs-data.js | 180 + .../encodings/tables/big5-added.json | 122 + .../iconv-lite/encodings/tables/cp936.json | 264 + .../iconv-lite/encodings/tables/cp949.json | 273 + .../iconv-lite/encodings/tables/cp950.json | 177 + .../iconv-lite/encodings/tables/eucjp.json | 182 + .../encodings/tables/gb18030-ranges.json | 1 + .../encodings/tables/gbk-added.json | 56 + .../iconv-lite/encodings/tables/shiftjis.json | 125 + .../iconv-lite/encodings/utf16.js | 187 + .../iconv-lite/encodings/utf32.js | 314 + .../node_modules/iconv-lite/encodings/utf7.js | 283 + .../iconv-lite/lib/bom-handling.js | 48 + .../iconv-lite/lib/helpers/merge-exports.js | 13 + .../node_modules/iconv-lite/lib/index.d.ts | 129 + .../node_modules/iconv-lite/lib/index.js | 182 + .../node_modules/iconv-lite/lib/streams.js | 105 + .../node_modules/iconv-lite/package.json | 70 + .../iconv-lite/types/encodings.d.ts | 425 + .../node_modules/safer-buffer | 1 + .../node_modules/inherits/LICENSE | 16 + .../node_modules/inherits/README.md | 42 + .../node_modules/inherits/inherits.js | 9 + .../node_modules/inherits/inherits_browser.js | 27 + .../node_modules/inherits/package.json | 29 + .../node_modules/is-callable/.editorconfig | 31 + .../node_modules/is-callable/.eslintrc | 10 + .../is-callable/.github/FUNDING.yml | 12 + .../node_modules/is-callable/.nycrc | 9 + .../node_modules/is-callable/CHANGELOG.md | 158 + .../node_modules/is-callable/LICENSE | 22 + .../node_modules/is-callable/README.md | 83 + .../node_modules/is-callable/index.js | 101 + .../node_modules/is-callable/package.json | 106 + .../node_modules/is-callable/test/index.js | 244 + .../node_modules/is-typed-array/.editorconfig | 20 + .../node_modules/is-typed-array/.eslintrc | 13 + .../is-typed-array/.github/FUNDING.yml | 12 + .../node_modules/is-typed-array/.nycrc | 9 + .../node_modules/is-typed-array/CHANGELOG.md | 166 + .../node_modules/is-typed-array/LICENSE | 22 + .../node_modules/is-typed-array/README.md | 70 + .../node_modules/is-typed-array/index.d.ts | 9 + .../node_modules/is-typed-array/index.js | 8 + .../node_modules/is-typed-array/package.json | 129 + .../node_modules/is-typed-array/test/index.js | 111 + .../node_modules/is-typed-array/tsconfig.json | 6 + .../node_modules/which-typed-array | 1 + .../node_modules/isarray/LICENSE | 21 + .../node_modules/isarray/README.md | 38 + .../node_modules/isarray/index.js | 5 + .../node_modules/isarray/package.json | 48 + .../node_modules/kareem/CHANGELOG.md | 850 + .../kareem@3.4.0/node_modules/kareem/LICENSE | 202 + .../node_modules/kareem/README.md | 440 + .../node_modules/kareem/SECURITY.md | 5 + .../node_modules/kareem/index.d.ts | 61 + .../kareem@3.4.0/node_modules/kareem/index.js | 560 + .../node_modules/kareem/package.json | 29 + backend/node_modules/.pnpm/lock.yaml | 1089 + .../node_modules/lodash.sortby/LICENSE | 47 + .../node_modules/lodash.sortby/README.md | 18 + .../node_modules/lodash.sortby/index.js | 2630 +++ .../node_modules/lodash.sortby/package.json | 17 + .../node_modules/loglevel/.editorconfig | 27 + .../node_modules/loglevel/CONTRIBUTING.md | 98 + .../node_modules/loglevel/Gruntfile.js | 165 + .../node_modules/loglevel/LICENSE-MIT | 22 + .../node_modules/loglevel/README.md | 408 + .../node_modules/loglevel/_config.yml | 1 + .../node_modules/loglevel/bower.json | 11 + .../node_modules/loglevel/demo/index.html | 139 + .../node_modules/loglevel/demo/script.js | 86 + .../node_modules/loglevel/demo/styles.css | 107 + .../node_modules/loglevel/dist/loglevel.js | 352 + .../loglevel/dist/loglevel.min.js | 3 + .../node_modules/loglevel/index.d.ts | 203 + .../node_modules/loglevel/lib/loglevel.js | 357 + .../node_modules/loglevel/package.json | 63 + .../long@4.0.0/node_modules/long/LICENSE | 202 + .../long@4.0.0/node_modules/long/README.md | 246 + .../long@4.0.0/node_modules/long/dist/long.js | 2 + .../node_modules/long/dist/long.js.map | 1 + .../long@4.0.0/node_modules/long/index.js | 1 + .../long@4.0.0/node_modules/long/package.json | 34 + .../long@4.0.0/node_modules/long/src/long.js | 1323 ++ .../node_modules/lru-cache/LICENSE.md | 55 + .../node_modules/lru-cache/README.md | 469 + .../diagnostics-channel-browser.d.ts.map | 1 + .../diagnostics-channel-browser.js.map | 1 + .../commonjs/browser/diagnostics-channel.d.ts | 5 + .../commonjs/browser/diagnostics-channel.js | 7 + .../dist/commonjs/browser/index.d.ts | 1400 ++ .../dist/commonjs/browser/index.d.ts.map | 1 + .../lru-cache/dist/commonjs/browser/index.js | 1733 ++ .../dist/commonjs/browser/index.js.map | 1 + .../dist/commonjs/browser/index.min.js | 2 + .../dist/commonjs/browser/index.min.js.map | 7 + .../lru-cache/dist/commonjs/browser/perf.d.ts | 12 + .../dist/commonjs/browser/perf.d.ts.map | 1 + .../lru-cache/dist/commonjs/browser/perf.js | 10 + .../dist/commonjs/browser/perf.js.map | 1 + .../commonjs/diagnostics-channel-cjs.cjs.map | 1 + .../diagnostics-channel-cjs.d.cts.map | 1 + .../dist/commonjs/diagnostics-channel.d.ts | 5 + .../dist/commonjs/diagnostics-channel.js | 7 + .../lru-cache/dist/commonjs/index.d.ts | 1400 ++ .../lru-cache/dist/commonjs/index.d.ts.map | 1 + .../lru-cache/dist/commonjs/index.js | 1733 ++ .../lru-cache/dist/commonjs/index.js.map | 1 + .../lru-cache/dist/commonjs/index.min.js | 2 + .../lru-cache/dist/commonjs/index.min.js.map | 7 + .../node/diagnostics-channel-node.d.ts.map | 1 + .../node/diagnostics-channel-node.js.map | 1 + .../commonjs/node/diagnostics-channel.d.ts | 5 + .../dist/commonjs/node/diagnostics-channel.js | 9 + .../lru-cache/dist/commonjs/node/index.d.ts | 1400 ++ .../dist/commonjs/node/index.d.ts.map | 1 + .../lru-cache/dist/commonjs/node/index.js | 1733 ++ .../lru-cache/dist/commonjs/node/index.js.map | 1 + .../lru-cache/dist/commonjs/node/index.min.js | 2 + .../dist/commonjs/node/index.min.js.map | 7 + .../lru-cache/dist/commonjs/node/perf.d.ts | 12 + .../dist/commonjs/node/perf.d.ts.map | 1 + .../lru-cache/dist/commonjs/node/perf.js | 10 + .../lru-cache/dist/commonjs/node/perf.js.map | 1 + .../lru-cache/dist/commonjs/package.json | 3 + .../lru-cache/dist/commonjs/perf.d.ts | 12 + .../lru-cache/dist/commonjs/perf.d.ts.map | 1 + .../lru-cache/dist/commonjs/perf.js | 10 + .../lru-cache/dist/commonjs/perf.js.map | 1 + .../diagnostics-channel-react-native.d.ts.map | 1 + .../diagnostics-channel-react-native.js.map | 1 + .../react-native/diagnostics-channel.d.ts | 5 + .../react-native/diagnostics-channel.js | 7 + .../dist/commonjs/react-native/index.d.ts | 1400 ++ .../dist/commonjs/react-native/index.d.ts.map | 1 + .../dist/commonjs/react-native/index.js | 1733 ++ .../dist/commonjs/react-native/index.js.map | 1 + .../dist/commonjs/react-native/perf.d.ts | 12 + .../dist/commonjs/react-native/perf.d.ts.map | 1 + .../dist/commonjs/react-native/perf.js | 10 + .../dist/commonjs/react-native/perf.js.map | 1 + .../diagnostics-channel-browser.d.ts.map | 1 + .../diagnostics-channel-browser.js.map | 1 + .../dist/esm/browser/diagnostics-channel.d.ts | 5 + .../dist/esm/browser/diagnostics-channel.js | 4 + .../lru-cache/dist/esm/browser/index.d.ts | 1400 ++ .../lru-cache/dist/esm/browser/index.d.ts.map | 1 + .../lru-cache/dist/esm/browser/index.js | 1729 ++ .../lru-cache/dist/esm/browser/index.js.map | 1 + .../lru-cache/dist/esm/browser/index.min.js | 2 + .../dist/esm/browser/index.min.js.map | 7 + .../lru-cache/dist/esm/browser/perf.d.ts | 12 + .../lru-cache/dist/esm/browser/perf.d.ts.map | 1 + .../lru-cache/dist/esm/browser/perf.js | 7 + .../lru-cache/dist/esm/browser/perf.js.map | 1 + .../esm/diagnostics-channel-esm.d.mts.map | 1 + .../dist/esm/diagnostics-channel-esm.mjs.map | 1 + .../dist/esm/diagnostics-channel.d.ts | 5 + .../lru-cache/dist/esm/diagnostics-channel.js | 19 + .../lru-cache/dist/esm/index.d.ts | 1400 ++ .../lru-cache/dist/esm/index.d.ts.map | 1 + .../node_modules/lru-cache/dist/esm/index.js | 1729 ++ .../lru-cache/dist/esm/index.js.map | 1 + .../lru-cache/dist/esm/index.min.js | 2 + .../lru-cache/dist/esm/index.min.js.map | 7 + .../node/diagnostics-channel-node.d.ts.map | 1 + .../esm/node/diagnostics-channel-node.js.map | 1 + .../dist/esm/node/diagnostics-channel.d.ts | 5 + .../dist/esm/node/diagnostics-channel.js | 6 + .../lru-cache/dist/esm/node/index.d.ts | 1400 ++ .../lru-cache/dist/esm/node/index.d.ts.map | 1 + .../lru-cache/dist/esm/node/index.js | 1729 ++ .../lru-cache/dist/esm/node/index.js.map | 1 + .../lru-cache/dist/esm/node/index.min.js | 2 + .../lru-cache/dist/esm/node/index.min.js.map | 7 + .../lru-cache/dist/esm/node/perf.d.ts | 12 + .../lru-cache/dist/esm/node/perf.d.ts.map | 1 + .../lru-cache/dist/esm/node/perf.js | 7 + .../lru-cache/dist/esm/node/perf.js.map | 1 + .../lru-cache/dist/esm/package.json | 3 + .../node_modules/lru-cache/dist/esm/perf.d.ts | 12 + .../lru-cache/dist/esm/perf.d.ts.map | 1 + .../node_modules/lru-cache/dist/esm/perf.js | 7 + .../lru-cache/dist/esm/perf.js.map | 1 + .../diagnostics-channel-react-native.d.ts.map | 1 + .../diagnostics-channel-react-native.js.map | 1 + .../esm/react-native/diagnostics-channel.d.ts | 5 + .../esm/react-native/diagnostics-channel.js | 4 + .../dist/esm/react-native/index.d.ts | 1400 ++ .../dist/esm/react-native/index.d.ts.map | 1 + .../lru-cache/dist/esm/react-native/index.js | 1729 ++ .../dist/esm/react-native/index.js.map | 1 + .../lru-cache/dist/esm/react-native/perf.d.ts | 12 + .../dist/esm/react-native/perf.d.ts.map | 1 + .../lru-cache/dist/esm/react-native/perf.js | 7 + .../dist/esm/react-native/perf.js.map | 1 + .../node_modules/lru-cache/package.json | 180 + .../node_modules/math-intrinsics/.eslintrc | 16 + .../math-intrinsics/.github/FUNDING.yml | 12 + .../node_modules/math-intrinsics/CHANGELOG.md | 24 + .../node_modules/math-intrinsics/LICENSE | 21 + .../node_modules/math-intrinsics/README.md | 50 + .../node_modules/math-intrinsics/abs.d.ts | 1 + .../node_modules/math-intrinsics/abs.js | 4 + .../constants/maxArrayLength.d.ts | 3 + .../constants/maxArrayLength.js | 4 + .../constants/maxSafeInteger.d.ts | 3 + .../constants/maxSafeInteger.js | 5 + .../math-intrinsics/constants/maxValue.d.ts | 3 + .../math-intrinsics/constants/maxValue.js | 5 + .../node_modules/math-intrinsics/floor.d.ts | 1 + .../node_modules/math-intrinsics/floor.js | 4 + .../math-intrinsics/isFinite.d.ts | 3 + .../node_modules/math-intrinsics/isFinite.js | 12 + .../math-intrinsics/isInteger.d.ts | 3 + .../node_modules/math-intrinsics/isInteger.js | 16 + .../node_modules/math-intrinsics/isNaN.d.ts | 1 + .../node_modules/math-intrinsics/isNaN.js | 6 + .../math-intrinsics/isNegativeZero.d.ts | 3 + .../math-intrinsics/isNegativeZero.js | 6 + .../node_modules/math-intrinsics/max.d.ts | 1 + .../node_modules/math-intrinsics/max.js | 4 + .../node_modules/math-intrinsics/min.d.ts | 1 + .../node_modules/math-intrinsics/min.js | 4 + .../node_modules/math-intrinsics/mod.d.ts | 3 + .../node_modules/math-intrinsics/mod.js | 9 + .../node_modules/math-intrinsics/package.json | 86 + .../node_modules/math-intrinsics/pow.d.ts | 1 + .../node_modules/math-intrinsics/pow.js | 4 + .../node_modules/math-intrinsics/round.d.ts | 1 + .../node_modules/math-intrinsics/round.js | 4 + .../node_modules/math-intrinsics/sign.d.ts | 3 + .../node_modules/math-intrinsics/sign.js | 11 + .../math-intrinsics/test/index.js | 192 + .../math-intrinsics/tsconfig.json | 3 + .../node_modules/media-typer/HISTORY.md | 50 + .../node_modules/media-typer/LICENSE | 22 + .../node_modules/media-typer/README.md | 94 + .../node_modules/media-typer/index.js | 135 + .../node_modules/media-typer/package.json | 37 + .../node_modules/memory-pager/.travis.yml | 4 + .../node_modules/memory-pager/LICENSE | 21 + .../node_modules/memory-pager/README.md | 65 + .../node_modules/memory-pager/index.js | 160 + .../node_modules/memory-pager/package.json | 24 + .../node_modules/memory-pager/test.js | 80 + .../node_modules/mime-db/HISTORY.md | 541 + .../node_modules/mime-db/LICENSE | 23 + .../node_modules/mime-db/README.md | 109 + .../node_modules/mime-db/db.json | 9342 ++++++++ .../node_modules/mime-db/index.js | 12 + .../node_modules/mime-db/package.json | 56 + .../mime-types@3.0.2/node_modules/mime-db | 1 + .../node_modules/mime-types/HISTORY.md | 428 + .../node_modules/mime-types/LICENSE | 23 + .../node_modules/mime-types/README.md | 126 + .../node_modules/mime-types/index.js | 211 + .../node_modules/mime-types/mimeScore.js | 57 + .../node_modules/mime-types/package.json | 49 + .../node_modules/@types/whatwg-url | 1 + .../.esm-wrapper.mjs | 6 + .../mongodb-connection-string-url/LICENSE | 192 + .../mongodb-connection-string-url/README.md | 25 + .../lib/index.d.ts | 63 + .../lib/index.js | 241 + .../lib/index.js.map | 1 + .../lib/redact.d.ts | 7 + .../lib/redact.js | 97 + .../lib/redact.js.map | 1 + .../package.json | 81 + .../node_modules/whatwg-url | 1 + .../node_modules/@mongodb-js/saslprep | 1 + .../.pnpm/mongodb@7.6.0/node_modules/bson | 1 + .../mongodb-connection-string-url | 1 + .../node_modules/mongodb/LICENSE.md | 201 + .../node_modules/mongodb/README.md | 380 + .../node_modules/mongodb/etc/prepare.js | 12 + .../node_modules/mongodb/lib/admin.js | 136 + .../node_modules/mongodb/lib/admin.js.map | 1 + .../node_modules/mongodb/lib/bson.js | 112 + .../node_modules/mongodb/lib/bson.js.map | 1 + .../node_modules/mongodb/lib/bulk/common.js | 857 + .../mongodb/lib/bulk/common.js.map | 1 + .../node_modules/mongodb/lib/bulk/ordered.js | 85 + .../mongodb/lib/bulk/ordered.js.map | 1 + .../mongodb/lib/bulk/unordered.js | 110 + .../mongodb/lib/bulk/unordered.js.map | 1 + .../node_modules/mongodb/lib/change_stream.js | 516 + .../mongodb/lib/change_stream.js.map | 1 + .../client-side-encryption/auto_encrypter.js | 287 + .../auto_encrypter.js.map | 1 + .../client_encryption.js | 616 + .../client_encryption.js.map | 1 + .../lib/client-side-encryption/errors.js | 138 + .../lib/client-side-encryption/errors.js.map | 1 + .../lib/client-side-encryption/kms_options.js | 3 + .../client-side-encryption/kms_options.js.map | 1 + .../mongocryptd_manager.js | 85 + .../mongocryptd_manager.js.map | 1 + .../client-side-encryption/providers/aws.js | 23 + .../providers/aws.js.map | 1 + .../client-side-encryption/providers/azure.js | 132 + .../providers/azure.js.map | 1 + .../client-side-encryption/providers/gcp.js | 16 + .../providers/gcp.js.map | 1 + .../client-side-encryption/providers/index.js | 43 + .../providers/index.js.map | 1 + .../client-side-encryption/state_machine.js | 474 + .../state_machine.js.map | 1 + .../mongodb/lib/cmap/auth/auth_provider.js | 51 + .../lib/cmap/auth/auth_provider.js.map | 1 + .../mongodb/lib/cmap/auth/aws4.js | 161 + .../mongodb/lib/cmap/auth/aws4.js.map | 1 + .../cmap/auth/aws_temporary_credentials.js | 103 + .../auth/aws_temporary_credentials.js.map | 1 + .../mongodb/lib/cmap/auth/gssapi.js | 153 + .../mongodb/lib/cmap/auth/gssapi.js.map | 1 + .../lib/cmap/auth/mongo_credentials.js | 168 + .../lib/cmap/auth/mongo_credentials.js.map | 1 + .../mongodb/lib/cmap/auth/mongodb_aws.js | 126 + .../mongodb/lib/cmap/auth/mongodb_aws.js.map | 1 + .../mongodb/lib/cmap/auth/mongodb_oidc.js | 73 + .../mongodb/lib/cmap/auth/mongodb_oidc.js.map | 1 + .../automated_callback_workflow.js | 84 + .../automated_callback_workflow.js.map | 1 + .../mongodb_oidc/azure_machine_workflow.js | 62 + .../azure_machine_workflow.js.map | 1 + .../auth/mongodb_oidc/callback_workflow.js | 141 + .../mongodb_oidc/callback_workflow.js.map | 1 + .../auth/mongodb_oidc/command_builders.js | 44 + .../auth/mongodb_oidc/command_builders.js.map | 1 + .../auth/mongodb_oidc/gcp_machine_workflow.js | 39 + .../mongodb_oidc/gcp_machine_workflow.js.map | 1 + .../mongodb_oidc/human_callback_workflow.js | 122 + .../human_callback_workflow.js.map | 1 + .../auth/mongodb_oidc/k8s_machine_workflow.js | 32 + .../mongodb_oidc/k8s_machine_workflow.js.map | 1 + .../lib/cmap/auth/mongodb_oidc/token_cache.js | 52 + .../cmap/auth/mongodb_oidc/token_cache.js.map | 1 + .../mongodb_oidc/token_machine_workflow.js | 23 + .../token_machine_workflow.js.map | 1 + .../mongodb/lib/cmap/auth/plain.js | 26 + .../mongodb/lib/cmap/auth/plain.js.map | 1 + .../mongodb/lib/cmap/auth/providers.js | 22 + .../mongodb/lib/cmap/auth/providers.js.map | 1 + .../mongodb/lib/cmap/auth/scram.js | 266 + .../mongodb/lib/cmap/auth/scram.js.map | 1 + .../mongodb/lib/cmap/auth/x509.js | 36 + .../mongodb/lib/cmap/auth/x509.js.map | 1 + .../lib/cmap/command_monitoring_events.js | 222 + .../lib/cmap/command_monitoring_events.js.map | 1 + .../node_modules/mongodb/lib/cmap/commands.js | 555 + .../mongodb/lib/cmap/commands.js.map | 1 + .../node_modules/mongodb/lib/cmap/connect.js | 398 + .../mongodb/lib/cmap/connect.js.map | 1 + .../mongodb/lib/cmap/connection.js | 576 + .../mongodb/lib/cmap/connection.js.map | 1 + .../mongodb/lib/cmap/connection_pool.js | 558 + .../mongodb/lib/cmap/connection_pool.js.map | 1 + .../lib/cmap/connection_pool_events.js | 190 + .../lib/cmap/connection_pool_events.js.map | 1 + .../node_modules/mongodb/lib/cmap/errors.js | 108 + .../mongodb/lib/cmap/errors.js.map | 1 + .../lib/cmap/handshake/client_metadata.js | 242 + .../lib/cmap/handshake/client_metadata.js.map | 1 + .../node_modules/mongodb/lib/cmap/metrics.js | 62 + .../mongodb/lib/cmap/metrics.js.map | 1 + .../mongodb/lib/cmap/stream_description.js | 70 + .../lib/cmap/stream_description.js.map | 1 + .../lib/cmap/wire_protocol/compression.js | 179 + .../lib/cmap/wire_protocol/compression.js.map | 1 + .../lib/cmap/wire_protocol/constants.js | 21 + .../lib/cmap/wire_protocol/constants.js.map | 1 + .../mongodb/lib/cmap/wire_protocol/on_data.js | 111 + .../lib/cmap/wire_protocol/on_data.js.map | 1 + .../cmap/wire_protocol/on_demand/document.js | 222 + .../wire_protocol/on_demand/document.js.map | 1 + .../lib/cmap/wire_protocol/responses.js | 315 + .../lib/cmap/wire_protocol/responses.js.map | 1 + .../mongodb/lib/cmap/wire_protocol/shared.js | 35 + .../lib/cmap/wire_protocol/shared.js.map | 1 + .../node_modules/mongodb/lib/collection.js | 751 + .../mongodb/lib/collection.js.map | 1 + .../mongodb/lib/connection_string.js | 1110 + .../mongodb/lib/connection_string.js.map | 1 + .../node_modules/mongodb/lib/constants.js | 170 + .../node_modules/mongodb/lib/constants.js.map | 1 + .../mongodb/lib/cursor/abstract_cursor.js | 923 + .../mongodb/lib/cursor/abstract_cursor.js.map | 1 + .../mongodb/lib/cursor/aggregation_cursor.js | 164 + .../lib/cursor/aggregation_cursor.js.map | 1 + .../lib/cursor/change_stream_cursor.js | 104 + .../lib/cursor/change_stream_cursor.js.map | 1 + .../lib/cursor/client_bulk_write_cursor.js | 52 + .../cursor/client_bulk_write_cursor.js.map | 1 + .../mongodb/lib/cursor/explainable_cursor.js | 36 + .../lib/cursor/explainable_cursor.js.map | 1 + .../mongodb/lib/cursor/find_cursor.js | 399 + .../mongodb/lib/cursor/find_cursor.js.map | 1 + .../lib/cursor/list_collections_cursor.js | 34 + .../lib/cursor/list_collections_cursor.js.map | 1 + .../mongodb/lib/cursor/list_indexes_cursor.js | 32 + .../lib/cursor/list_indexes_cursor.js.map | 1 + .../lib/cursor/list_search_indexes_cursor.js | 14 + .../cursor/list_search_indexes_cursor.js.map | 1 + .../mongodb/lib/cursor/run_command_cursor.js | 94 + .../lib/cursor/run_command_cursor.js.map | 1 + .../node_modules/mongodb/lib/db.js | 419 + .../node_modules/mongodb/lib/db.js.map | 1 + .../node_modules/mongodb/lib/deps.js | 112 + .../node_modules/mongodb/lib/deps.js.map | 1 + .../node_modules/mongodb/lib/encrypter.js | 106 + .../node_modules/mongodb/lib/encrypter.js.map | 1 + .../node_modules/mongodb/lib/error.js | 1376 ++ .../node_modules/mongodb/lib/error.js.map | 1 + .../node_modules/mongodb/lib/explain.js | 59 + .../node_modules/mongodb/lib/explain.js.map | 1 + .../mongodb/lib/gridfs/download.js | 306 + .../mongodb/lib/gridfs/download.js.map | 1 + .../node_modules/mongodb/lib/gridfs/index.js | 164 + .../mongodb/lib/gridfs/index.js.map | 1 + .../node_modules/mongodb/lib/gridfs/upload.js | 358 + .../mongodb/lib/gridfs/upload.js.map | 1 + .../node_modules/mongodb/lib/index.js | 193 + .../node_modules/mongodb/lib/index.js.map | 1 + .../node_modules/mongodb/lib/mongo_client.js | 556 + .../mongodb/lib/mongo_client.js.map | 1 + .../lib/mongo_client_auth_providers.js | 80 + .../lib/mongo_client_auth_providers.js.map | 1 + .../node_modules/mongodb/lib/mongo_logger.js | 655 + .../mongodb/lib/mongo_logger.js.map | 1 + .../node_modules/mongodb/lib/mongo_types.js | 56 + .../mongodb/lib/mongo_types.js.map | 1 + .../mongodb/lib/operations/aggregate.js | 90 + .../mongodb/lib/operations/aggregate.js.map | 1 + .../client_bulk_write/client_bulk_write.js | 51 + .../client_bulk_write.js.map | 1 + .../client_bulk_write/command_builder.js | 340 + .../client_bulk_write/command_builder.js.map | 1 + .../operations/client_bulk_write/common.js | 3 + .../client_bulk_write/common.js.map | 1 + .../operations/client_bulk_write/executor.js | 120 + .../client_bulk_write/executor.js.map | 1 + .../client_bulk_write/results_merger.js | 204 + .../client_bulk_write/results_merger.js.map | 1 + .../mongodb/lib/operations/command.js | 83 + .../mongodb/lib/operations/command.js.map | 1 + .../mongodb/lib/operations/count.js | 45 + .../mongodb/lib/operations/count.js.map | 1 + .../lib/operations/create_collection.js | 109 + .../lib/operations/create_collection.js.map | 1 + .../mongodb/lib/operations/delete.js | 122 + .../mongodb/lib/operations/delete.js.map | 1 + .../mongodb/lib/operations/distinct.js | 61 + .../mongodb/lib/operations/distinct.js.map | 1 + .../mongodb/lib/operations/drop.js | 93 + .../mongodb/lib/operations/drop.js.map | 1 + .../mongodb/lib/operations/end_sessions.js | 34 + .../lib/operations/end_sessions.js.map | 1 + .../operations/estimated_document_count.js | 41 + .../estimated_document_count.js.map | 1 + .../lib/operations/execute_operation.js | 339 + .../lib/operations/execute_operation.js.map | 1 + .../mongodb/lib/operations/find.js | 148 + .../mongodb/lib/operations/find.js.map | 1 + .../mongodb/lib/operations/find_and_modify.js | 154 + .../lib/operations/find_and_modify.js.map | 1 + .../mongodb/lib/operations/get_more.js | 61 + .../mongodb/lib/operations/get_more.js.map | 1 + .../mongodb/lib/operations/indexes.js | 180 + .../mongodb/lib/operations/indexes.js.map | 1 + .../mongodb/lib/operations/insert.js | 74 + .../mongodb/lib/operations/insert.js.map | 1 + .../mongodb/lib/operations/kill_cursors.js | 43 + .../lib/operations/kill_cursors.js.map | 1 + .../lib/operations/list_collections.js | 52 + .../lib/operations/list_collections.js.map | 1 + .../mongodb/lib/operations/list_databases.js | 40 + .../lib/operations/list_databases.js.map | 1 + .../mongodb/lib/operations/operation.js | 103 + .../mongodb/lib/operations/operation.js.map | 1 + .../mongodb/lib/operations/profiling_level.js | 43 + .../lib/operations/profiling_level.js.map | 1 + .../mongodb/lib/operations/remove_user.js | 27 + .../mongodb/lib/operations/remove_user.js.map | 1 + .../mongodb/lib/operations/rename.js | 38 + .../mongodb/lib/operations/rename.js.map | 1 + .../mongodb/lib/operations/run_command.js | 47 + .../mongodb/lib/operations/run_command.js.map | 1 + .../lib/operations/search_indexes/create.js | 33 + .../operations/search_indexes/create.js.map | 1 + .../lib/operations/search_indexes/drop.js | 43 + .../lib/operations/search_indexes/drop.js.map | 1 + .../lib/operations/search_indexes/update.js | 35 + .../operations/search_indexes/update.js.map | 1 + .../lib/operations/set_profiling_level.js | 53 + .../lib/operations/set_profiling_level.js.map | 1 + .../mongodb/lib/operations/stats.js | 27 + .../mongodb/lib/operations/stats.js.map | 1 + .../mongodb/lib/operations/update.js | 192 + .../mongodb/lib/operations/update.js.map | 1 + .../lib/operations/validate_collection.js | 37 + .../lib/operations/validate_collection.js.map | 1 + .../node_modules/mongodb/lib/read_concern.js | 73 + .../mongodb/lib/read_concern.js.map | 1 + .../mongodb/lib/read_preference.js | 191 + .../mongodb/lib/read_preference.js.map | 1 + .../mongodb/lib/runtime_adapters.js | 31 + .../mongodb/lib/runtime_adapters.js.map | 1 + .../node_modules/mongodb/lib/sdam/common.js | 49 + .../mongodb/lib/sdam/common.js.map | 1 + .../node_modules/mongodb/lib/sdam/events.js | 146 + .../mongodb/lib/sdam/events.js.map | 1 + .../node_modules/mongodb/lib/sdam/monitor.js | 544 + .../mongodb/lib/sdam/monitor.js.map | 1 + .../node_modules/mongodb/lib/sdam/server.js | 404 + .../mongodb/lib/sdam/server.js.map | 1 + .../mongodb/lib/sdam/server_description.js | 204 + .../lib/sdam/server_description.js.map | 1 + .../mongodb/lib/sdam/server_selection.js | 294 + .../mongodb/lib/sdam/server_selection.js.map | 1 + .../lib/sdam/server_selection_events.js | 85 + .../lib/sdam/server_selection_events.js.map | 1 + .../mongodb/lib/sdam/srv_polling.js | 108 + .../mongodb/lib/sdam/srv_polling.js.map | 1 + .../node_modules/mongodb/lib/sdam/topology.js | 654 + .../mongodb/lib/sdam/topology.js.map | 1 + .../mongodb/lib/sdam/topology_description.js | 383 + .../lib/sdam/topology_description.js.map | 1 + .../node_modules/mongodb/lib/sessions.js | 936 + .../node_modules/mongodb/lib/sessions.js.map | 1 + .../node_modules/mongodb/lib/sort.js | 103 + .../node_modules/mongodb/lib/sort.js.map | 1 + .../node_modules/mongodb/lib/timeout.js | 296 + .../node_modules/mongodb/lib/timeout.js.map | 1 + .../node_modules/mongodb/lib/transactions.js | 135 + .../mongodb/lib/transactions.js.map | 1 + .../node_modules/mongodb/lib/utils.js | 1177 + .../node_modules/mongodb/lib/utils.js.map | 1 + .../node_modules/mongodb/lib/write_concern.js | 100 + .../mongodb/lib/write_concern.js.map | 1 + .../node_modules/mongodb/mongodb.d.ts | 9133 ++++++++ .../node_modules/mongodb/package.json | 184 + .../node_modules/mongodb/src/admin.ts | 173 + .../node_modules/mongodb/src/bson.ts | 178 + .../node_modules/mongodb/src/bulk/common.ts | 1283 ++ .../node_modules/mongodb/src/bulk/ordered.ts | 99 + .../mongodb/src/bulk/unordered.ts | 130 + .../node_modules/mongodb/src/change_stream.ts | 1164 + .../client-side-encryption/auto_encrypter.ts | 491 + .../client_encryption.ts | 1198 + .../src/client-side-encryption/errors.ts | 144 + .../src/client-side-encryption/kms_options.ts | 93 + .../mongocryptd_manager.ts | 100 + .../client-side-encryption/providers/aws.ts | 33 + .../client-side-encryption/providers/azure.ts | 181 + .../client-side-encryption/providers/gcp.ts | 16 + .../client-side-encryption/providers/index.ts | 207 + .../client-side-encryption/state_machine.ts | 672 + .../mongodb/src/cmap/auth/auth_provider.ts | 77 + .../mongodb/src/cmap/auth/aws4.ts | 207 + .../cmap/auth/aws_temporary_credentials.ts | 129 + .../mongodb/src/cmap/auth/gssapi.ts | 205 + .../src/cmap/auth/mongo_credentials.ts | 291 + .../mongodb/src/cmap/auth/mongodb_aws.ts | 169 + .../mongodb/src/cmap/auth/mongodb_oidc.ts | 185 + .../automated_callback_workflow.ts | 88 + .../mongodb_oidc/azure_machine_workflow.ts | 73 + .../auth/mongodb_oidc/callback_workflow.ts | 188 + .../auth/mongodb_oidc/command_builders.ts | 53 + .../auth/mongodb_oidc/gcp_machine_workflow.ts | 46 + .../mongodb_oidc/human_callback_workflow.ts | 141 + .../auth/mongodb_oidc/k8s_machine_workflow.ts | 31 + .../src/cmap/auth/mongodb_oidc/token_cache.ts | 62 + .../mongodb_oidc/token_machine_workflow.ts | 22 + .../mongodb/src/cmap/auth/plain.ts | 25 + .../mongodb/src/cmap/auth/providers.ts | 22 + .../mongodb/src/cmap/auth/scram.ts | 370 + .../mongodb/src/cmap/auth/x509.ts | 43 + .../src/cmap/command_monitoring_events.ts | 315 + .../node_modules/mongodb/src/cmap/commands.ts | 824 + .../node_modules/mongodb/src/cmap/connect.ts | 538 + .../mongodb/src/cmap/connection.ts | 940 + .../mongodb/src/cmap/connection_pool.ts | 831 + .../src/cmap/connection_pool_events.ts | 300 + .../node_modules/mongodb/src/cmap/errors.ts | 119 + .../src/cmap/handshake/client_metadata.ts | 354 + .../node_modules/mongodb/src/cmap/metrics.ts | 58 + .../mongodb/src/cmap/stream_description.ts | 96 + .../src/cmap/wire_protocol/compression.ts | 215 + .../src/cmap/wire_protocol/constants.ts | 17 + .../mongodb/src/cmap/wire_protocol/on_data.ts | 139 + .../cmap/wire_protocol/on_demand/document.ts | 356 + .../src/cmap/wire_protocol/responses.ts | 393 + .../mongodb/src/cmap/wire_protocol/shared.ts | 48 + .../node_modules/mongodb/src/collection.ts | 1314 ++ .../mongodb/src/connection_string.ts | 1319 ++ .../node_modules/mongodb/src/constants.ts | 176 + .../mongodb/src/cursor/abstract_cursor.ts | 1241 ++ .../mongodb/src/cursor/aggregation_cursor.ts | 245 + .../src/cursor/change_stream_cursor.ts | 171 + .../src/cursor/client_bulk_write_cursor.ts | 83 + .../mongodb/src/cursor/explainable_cursor.ts | 51 + .../mongodb/src/cursor/find_cursor.ts | 497 + .../src/cursor/list_collections_cursor.ts | 50 + .../mongodb/src/cursor/list_indexes_cursor.ts | 37 + .../src/cursor/list_search_indexes_cursor.ts | 20 + .../mongodb/src/cursor/run_command_cursor.ts | 178 + .../node_modules/mongodb/src/db.ts | 621 + .../node_modules/mongodb/src/deps.ts | 227 + .../node_modules/mongodb/src/encrypter.ts | 127 + .../node_modules/mongodb/src/error.ts | 1555 ++ .../node_modules/mongodb/src/explain.ts | 124 + .../mongodb/src/gridfs/download.ts | 483 + .../node_modules/mongodb/src/gridfs/index.ts | 264 + .../node_modules/mongodb/src/gridfs/upload.ts | 538 + .../node_modules/mongodb/src/index.ts | 636 + .../node_modules/mongodb/src/mongo_client.ts | 1182 + .../src/mongo_client_auth_providers.ts | 87 + .../node_modules/mongodb/src/mongo_logger.ts | 1081 + .../node_modules/mongodb/src/mongo_types.ts | 678 + .../mongodb/src/operations/aggregate.ts | 153 + .../client_bulk_write/client_bulk_write.ts | 72 + .../client_bulk_write/command_builder.ts | 487 + .../operations/client_bulk_write/common.ts | 276 + .../operations/client_bulk_write/executor.ts | 149 + .../client_bulk_write/results_merger.ts | 260 + .../mongodb/src/operations/command.ts | 166 + .../mongodb/src/operations/count.ts | 73 + .../src/operations/create_collection.ts | 218 + .../mongodb/src/operations/delete.ts | 185 + .../mongodb/src/operations/distinct.ts | 92 + .../mongodb/src/operations/drop.ts | 130 + .../mongodb/src/operations/end_sessions.ts | 44 + .../operations/estimated_document_count.ts | 61 + .../src/operations/execute_operation.ts | 447 + .../mongodb/src/operations/find.ts | 254 + .../mongodb/src/operations/find_and_modify.ts | 307 + .../mongodb/src/operations/get_more.ts | 106 + .../mongodb/src/operations/indexes.ts | 408 + .../mongodb/src/operations/insert.ts | 119 + .../mongodb/src/operations/kill_cursors.ts | 64 + .../src/operations/list_collections.ts | 107 + .../mongodb/src/operations/list_databases.ts | 68 + .../mongodb/src/operations/operation.ts | 189 + .../mongodb/src/operations/profiling_level.ts | 46 + .../mongodb/src/operations/remove_user.ts | 36 + .../mongodb/src/operations/rename.ts | 60 + .../mongodb/src/operations/run_command.ts | 79 + .../src/operations/search_indexes/create.ts | 56 + .../src/operations/search_indexes/drop.ts | 58 + .../src/operations/search_indexes/update.ts | 45 + .../src/operations/set_profiling_level.ts | 74 + .../mongodb/src/operations/stats.ts | 37 + .../mongodb/src/operations/update.ts | 325 + .../src/operations/validate_collection.ts | 50 + .../node_modules/mongodb/src/read_concern.ts | 88 + .../mongodb/src/read_preference.ts | 256 + .../mongodb/src/runtime_adapters.ts | 65 + .../node_modules/mongodb/src/sdam/common.ts | 74 + .../node_modules/mongodb/src/sdam/events.ts | 219 + .../node_modules/mongodb/src/sdam/monitor.ts | 771 + .../node_modules/mongodb/src/sdam/server.ts | 595 + .../mongodb/src/sdam/server_description.ts | 297 + .../mongodb/src/sdam/server_selection.ts | 415 + .../src/sdam/server_selection_events.ts | 142 + .../mongodb/src/sdam/srv_polling.ts | 146 + .../node_modules/mongodb/src/sdam/topology.ts | 1103 + .../mongodb/src/sdam/topology_description.ts | 548 + .../node_modules/mongodb/src/sessions.ts | 1284 ++ .../node_modules/mongodb/src/sort.ts | 141 + .../node_modules/mongodb/src/timeout.ts | 405 + .../node_modules/mongodb/src/transactions.ts | 181 + .../node_modules/mongodb/src/utils.ts | 1454 ++ .../node_modules/mongodb/src/write_concern.ts | 183 + .../node_modules/mongodb/tsconfig.json | 53 + .../node_modules/@standard-schema/spec | 1 + .../.pnpm/mongoose@9.10.2/node_modules/kareem | 1 + .../mongoose@9.10.2/node_modules/mongodb | 1 + .../node_modules/mongoose/LICENSE.md | 22 + .../node_modules/mongoose/README.md | 397 + .../node_modules/mongoose/SECURITY.md | 1 + .../node_modules/mongoose/eslint.config.mjs | 202 + .../node_modules/mongoose/index.js | 64 + .../node_modules/mongoose/lib/aggregate.js | 1263 ++ .../node_modules/mongoose/lib/cast.js | 436 + .../node_modules/mongoose/lib/cast/bigint.js | 46 + .../node_modules/mongoose/lib/cast/boolean.js | 32 + .../node_modules/mongoose/lib/cast/date.js | 41 + .../mongoose/lib/cast/decimal128.js | 39 + .../node_modules/mongoose/lib/cast/double.js | 56 + .../node_modules/mongoose/lib/cast/int32.js | 42 + .../node_modules/mongoose/lib/cast/number.js | 42 + .../mongoose/lib/cast/objectid.js | 29 + .../node_modules/mongoose/lib/cast/string.js | 37 + .../node_modules/mongoose/lib/cast/uuid.js | 35 + .../node_modules/mongoose/lib/collection.js | 321 + .../node_modules/mongoose/lib/connection.js | 1848 ++ .../mongoose/lib/connectionState.js | 26 + .../node_modules/mongoose/lib/constants.js | 73 + .../mongoose/lib/cursor/aggregationCursor.js | 513 + .../mongoose/lib/cursor/changeStream.js | 218 + .../mongoose/lib/cursor/queryCursor.js | 653 + .../node_modules/mongoose/lib/document.js | 5848 +++++ .../node_modules/mongoose/lib/driver.js | 15 + .../node_modules/mongoose/lib/drivers/SPEC.md | 4 + .../node-mongodb-native/bulkWriteResult.js | 5 + .../drivers/node-mongodb-native/collection.js | 426 + .../drivers/node-mongodb-native/connection.js | 519 + .../lib/drivers/node-mongodb-native/index.js | 10 + .../lib/error/browserMissingSchema.js | 29 + .../lib/error/bulkSaveIncompleteError.js | 44 + .../mongoose/lib/error/bulkWriteError.js | 41 + .../node_modules/mongoose/lib/error/cast.js | 167 + .../lib/error/createCollectionsError.js | 26 + .../mongoose/lib/error/divergentArray.js | 40 + .../mongoose/lib/error/eachAsyncMultiError.js | 41 + .../node_modules/mongoose/lib/error/index.js | 237 + .../mongoose/lib/error/invalidSchemaOption.js | 32 + .../mongoose/lib/error/messages.js | 48 + .../mongoose/lib/error/missingSchema.js | 33 + .../mongoose/lib/error/mongooseError.js | 13 + .../mongoose/lib/error/notFound.js | 47 + .../mongoose/lib/error/objectExpected.js | 31 + .../mongoose/lib/error/objectParameter.js | 31 + .../mongoose/lib/error/overwriteModel.js | 31 + .../mongoose/lib/error/parallelSave.js | 33 + .../mongoose/lib/error/parallelValidate.js | 33 + .../mongoose/lib/error/serverSelection.js | 62 + .../mongoose/lib/error/setOptionError.js | 103 + .../node_modules/mongoose/lib/error/strict.js | 35 + .../mongoose/lib/error/strictPopulate.js | 31 + .../mongoose/lib/error/syncIndexes.js | 30 + .../mongoose/lib/error/validation.js | 97 + .../mongoose/lib/error/validator.js | 100 + .../mongoose/lib/error/version.js | 38 + .../aggregate/prepareDiscriminatorPipeline.js | 39 + .../aggregate/stringifyFunctionOperators.js | 50 + .../mongoose/lib/helpers/arrayDepth.js | 33 + .../lib/helpers/buildMiddlewareFilter.js | 42 + .../mongoose/lib/helpers/clone.js | 262 + .../mongoose/lib/helpers/common.js | 127 + .../mongoose/lib/helpers/cursor/eachAsync.js | 225 + .../applyEmbeddedDiscriminators.js | 36 + .../areDiscriminatorValuesEqual.js | 16 + ...checkEmbeddedDiscriminatorKeyProjection.js | 12 + .../helpers/discriminator/getConstructor.js | 29 + .../discriminator/getDiscriminatorByValue.js | 28 + .../getSchemaDiscriminatorByValue.js | 27 + .../discriminator/mergeDiscriminatorSchema.js | 96 + .../lib/helpers/document/applyDefaults.js | 201 + .../lib/helpers/document/applyTimestamps.js | 106 + .../lib/helpers/document/applyVirtuals.js | 147 + .../helpers/document/cleanModifiedSubpaths.js | 45 + .../mongoose/lib/helpers/document/compile.js | 241 + .../document/getDeepestSubdocumentForPath.js | 38 + .../document/getEmbeddedDiscriminatorPath.js | 53 + .../lib/helpers/document/handleSpreadDoc.js | 35 + .../lib/helpers/document/isInPathsToSave.js | 24 + .../node_modules/mongoose/lib/helpers/each.js | 25 + .../lib/helpers/error/combinePathErrors.js | 22 + .../mongoose/lib/helpers/firstKey.js | 8 + .../node_modules/mongoose/lib/helpers/get.js | 65 + .../lib/helpers/getConstructorName.js | 16 + .../lib/helpers/getDefaultBulkwriteResult.js | 18 + .../mongoose/lib/helpers/getFunctionName.js | 10 + .../mongoose/lib/helpers/immediate.js | 16 + .../helpers/indexes/applySchemaCollation.js | 13 + .../decorateDiscriminatorIndexOptions.js | 14 + .../lib/helpers/indexes/getRelatedIndexes.js | 63 + .../lib/helpers/indexes/isDefaultIdIndex.js | 18 + .../lib/helpers/indexes/isIndexEqual.js | 95 + .../lib/helpers/indexes/isIndexSpecEqual.js | 32 + .../lib/helpers/indexes/isTextIndex.js | 16 + .../lib/helpers/indexes/isTimeseriesIndex.js | 16 + .../mongoose/lib/helpers/isAsyncFunction.js | 9 + .../mongoose/lib/helpers/isBsonType.js | 15 + .../mongoose/lib/helpers/isMongooseObject.js | 22 + .../mongoose/lib/helpers/isObject.js | 16 + .../mongoose/lib/helpers/isPOJO.js | 12 + .../mongoose/lib/helpers/isPromise.js | 6 + .../mongoose/lib/helpers/isSimpleValidator.js | 22 + .../mongoose/lib/helpers/minimize.js | 41 + .../lib/helpers/model/applyDefaultsToPOJO.js | 52 + .../mongoose/lib/helpers/model/applyHooks.js | 158 + .../lib/helpers/model/applyMethods.js | 70 + .../lib/helpers/model/applyStaticHooks.js | 41 + .../lib/helpers/model/applyStatics.js | 13 + .../lib/helpers/model/castBulkWrite.js | 322 + .../helpers/model/decorateBulkWriteResult.js | 8 + .../lib/helpers/model/discriminator.js | 265 + .../lib/helpers/model/pushNestedArrayPaths.js | 15 + .../mongoose/lib/helpers/omitUndefined.js | 20 + .../node_modules/mongoose/lib/helpers/once.js | 12 + .../mongoose/lib/helpers/parallelLimit.js | 62 + .../mongoose/lib/helpers/path/parentPaths.js | 18 + .../lib/helpers/path/setDottedPath.js | 33 + .../mongoose/lib/helpers/pathTrie.js | 167 + .../mongoose/lib/helpers/pluralize.js | 95 + .../populate/assignRawDocsToIdStructure.js | 129 + .../lib/helpers/populate/assignVals.js | 360 + .../populate/createPopulateQueryFilter.js | 105 + .../populate/getModelsMapForPopulate.js | 896 + .../lib/helpers/populate/getSchemaTypes.js | 229 + .../lib/helpers/populate/getVirtual.js | 103 + .../lib/helpers/populate/leanPopulateMap.js | 7 + .../lib/helpers/populate/lookupLocalFields.js | 40 + .../populate/markArraySubdocsPopulated.js | 49 + .../helpers/populate/modelNamesFromRefPath.js | 74 + .../populate/removeDeselectedForeignField.js | 31 + .../populate/setPopulatedVirtualValue.js | 33 + .../lib/helpers/populate/skipPopulateValue.js | 10 + .../helpers/populate/splitPopulateQuery.js | 81 + .../lib/helpers/populate/validateRef.js | 19 + .../mongoose/lib/helpers/printJestWarning.js | 21 + .../lib/helpers/processConnectionOptions.js | 65 + .../lib/helpers/projection/applyProjection.js | 83 + .../helpers/projection/hasIncludedChildren.js | 41 + .../projection/isDefiningProjection.js | 18 + .../lib/helpers/projection/isExclusive.js | 37 + .../lib/helpers/projection/isInclusive.js | 39 + .../helpers/projection/isNestedProjection.js | 8 + .../lib/helpers/projection/isPathExcluded.js | 40 + .../projection/isPathSelectedInclusive.js | 18 + .../lib/helpers/projection/isSubpath.js | 14 + .../lib/helpers/projection/parseProjection.js | 38 + .../lib/helpers/query/applyGlobalOption.js | 29 + .../mongoose/lib/helpers/query/cast$expr.js | 287 + .../lib/helpers/query/castFilterPath.js | 54 + .../mongoose/lib/helpers/query/castUpdate.js | 664 + .../query/getEmbeddedDiscriminatorPath.js | 103 + .../lib/helpers/query/handleImmutable.js | 44 + .../query/handleReadPreferenceAliases.js | 23 + .../lib/helpers/query/hasDollarKeys.js | 23 + .../mongoose/lib/helpers/query/isOperator.js | 14 + .../lib/helpers/query/sanitizeFilter.js | 41 + .../lib/helpers/query/sanitizeProjection.js | 14 + .../helpers/query/selectPopulatedFields.js | 62 + .../mongoose/lib/helpers/query/trusted.js | 13 + .../mongoose/lib/helpers/query/validOps.js | 3 + .../mongoose/lib/helpers/schema/addAutoId.js | 7 + .../lib/helpers/schema/applyBuiltinPlugins.js | 12 + .../lib/helpers/schema/applyPlugins.js | 55 + .../lib/helpers/schema/applyReadConcern.js | 20 + .../lib/helpers/schema/applyWriteConcern.js | 39 + .../schema/cleanPositionalOperators.js | 12 + .../mongoose/lib/helpers/schema/getIndexes.js | 171 + .../helpers/schema/getKeysInSchemaOrder.js | 25 + .../mongoose/lib/helpers/schema/getPath.js | 43 + .../schema/getSubdocumentStrictValue.js | 32 + .../lib/helpers/schema/handleIdOption.js | 20 + .../helpers/schema/handleTimestampOption.js | 24 + .../mongoose/lib/helpers/schema/idGetter.js | 37 + .../mongoose/lib/helpers/schema/merge.js | 36 + .../lib/helpers/schematype/handleImmutable.js | 50 + .../lib/helpers/setDefaultsOnInsert.js | 174 + .../mongoose/lib/helpers/specialProperties.js | 3 + .../mongoose/lib/helpers/symbols.js | 20 + .../mongoose/lib/helpers/timers.js | 3 + .../timestamps/setDocumentTimestamps.js | 26 + .../lib/helpers/timestamps/setupTimestamps.js | 133 + .../lib/helpers/topology/allServersUnknown.js | 12 + .../mongoose/lib/helpers/topology/isAtlas.js | 31 + .../lib/helpers/topology/isSSLError.js | 16 + .../update/applyTimestampsToChildren.js | 193 + .../helpers/update/applyTimestampsToUpdate.js | 132 + .../lib/helpers/update/castArrayFilters.js | 113 + .../update/decorateUpdateWithVersionKey.js | 35 + .../lib/helpers/update/modifiedPaths.js | 33 + .../helpers/update/moveImmutableProperties.js | 53 + .../update/removeUnusedArrayFilters.js | 37 + .../update/updatedPathsByArrayFilter.js | 27 + .../mongoose/lib/helpers/updateValidators.js | 186 + .../node_modules/mongoose/lib/index.js | 17 + .../node_modules/mongoose/lib/internal.js | 48 + .../node_modules/mongoose/lib/model.js | 5407 +++++ .../mongoose/lib/modifiedPathsSnapshot.js | 9 + .../node_modules/mongoose/lib/mongoose.js | 1435 ++ .../node_modules/mongoose/lib/options.js | 18 + .../mongoose/lib/options/populateOptions.js | 36 + .../mongoose/lib/options/propertyOptions.js | 8 + .../mongoose/lib/options/saveOptions.js | 16 + .../lib/options/schemaArrayOptions.js | 78 + .../lib/options/schemaBufferOptions.js | 38 + .../mongoose/lib/options/schemaDateOptions.js | 71 + .../lib/options/schemaDocumentArrayOptions.js | 91 + .../mongoose/lib/options/schemaMapOptions.js | 43 + .../lib/options/schemaNumberOptions.js | 101 + .../lib/options/schemaObjectIdOptions.js | 64 + .../lib/options/schemaStringOptions.js | 138 + .../lib/options/schemaSubdocumentOptions.js | 89 + .../mongoose/lib/options/schemaTypeOptions.js | 258 + .../lib/options/schemaUnionOptions.js | 32 + .../mongoose/lib/options/virtualOptions.js | 164 + .../mongoose/lib/plugins/index.js | 5 + .../mongoose/lib/plugins/saveSubdocs.js | 97 + .../mongoose/lib/plugins/sharding.js | 101 + .../mongoose/lib/plugins/trackTransaction.js | 104 + .../node_modules/mongoose/lib/query.js | 5872 +++++ .../node_modules/mongoose/lib/queryHelpers.js | 418 + .../node_modules/mongoose/lib/schema.js | 3382 +++ .../node_modules/mongoose/lib/schema/array.js | 708 + .../mongoose/lib/schema/bigint.js | 280 + .../mongoose/lib/schema/boolean.js | 330 + .../mongoose/lib/schema/buffer.js | 341 + .../node_modules/mongoose/lib/schema/date.js | 467 + .../mongoose/lib/schema/decimal128.js | 261 + .../mongoose/lib/schema/documentArray.js | 664 + .../lib/schema/documentArrayElement.js | 148 + .../mongoose/lib/schema/double.js | 244 + .../node_modules/mongoose/lib/schema/index.js | 32 + .../node_modules/mongoose/lib/schema/int32.js | 287 + .../node_modules/mongoose/lib/schema/map.js | 193 + .../node_modules/mongoose/lib/schema/mixed.js | 146 + .../mongoose/lib/schema/number.js | 508 + .../mongoose/lib/schema/objectId.js | 337 + .../mongoose/lib/schema/operators/bitwise.js | 38 + .../mongoose/lib/schema/operators/exists.js | 12 + .../lib/schema/operators/geospatial.js | 107 + .../mongoose/lib/schema/operators/helpers.js | 32 + .../mongoose/lib/schema/operators/text.js | 39 + .../mongoose/lib/schema/operators/type.js | 20 + .../mongoose/lib/schema/string.js | 748 + .../mongoose/lib/schema/subdocument.js | 434 + .../mongoose/lib/schema/symbols.js | 5 + .../node_modules/mongoose/lib/schema/union.js | 163 + .../node_modules/mongoose/lib/schema/uuid.js | 303 + .../node_modules/mongoose/lib/schemaType.js | 1955 ++ .../standardSchema/convertErrorToIssues.js | 20 + .../node_modules/mongoose/lib/stateMachine.js | 253 + .../node_modules/mongoose/lib/tracing.js | 38 + .../mongoose/lib/types/array/index.js | 119 + .../lib/types/array/isMongooseArray.js | 5 + .../mongoose/lib/types/array/methods/index.js | 1095 + .../mongoose/lib/types/arraySubdocument.js | 208 + .../node_modules/mongoose/lib/types/buffer.js | 294 + .../mongoose/lib/types/decimal128.js | 13 + .../mongoose/lib/types/documentArray/index.js | 113 + .../documentArray/isMongooseDocumentArray.js | 5 + .../lib/types/documentArray/methods/index.js | 549 + .../node_modules/mongoose/lib/types/double.js | 13 + .../node_modules/mongoose/lib/types/index.js | 23 + .../node_modules/mongoose/lib/types/map.js | 368 + .../mongoose/lib/types/objectid.js | 41 + .../mongoose/lib/types/subdocument.js | 445 + .../node_modules/mongoose/lib/types/uuid.js | 13 + .../node_modules/mongoose/lib/utils.js | 1055 + .../node_modules/mongoose/lib/validOptions.js | 44 + .../node_modules/mongoose/lib/virtualType.js | 204 + .../node_modules/mongoose/package.json | 141 + .../node_modules/mongoose/tstyche.json | 7 + .../mongoose/types/aggregate.d.ts | 198 + .../mongoose/types/augmentations.d.ts | 9 + .../node_modules/mongoose/types/callback.d.ts | 8 + .../mongoose/types/collection.d.ts | 49 + .../mongoose/types/connection.d.ts | 297 + .../node_modules/mongoose/types/cursor.d.ts | 67 + .../node_modules/mongoose/types/document.d.ts | 345 + .../node_modules/mongoose/types/error.d.ts | 143 + .../mongoose/types/expressions.d.ts | 3069 +++ .../node_modules/mongoose/types/helpers.d.ts | 32 + .../node_modules/mongoose/types/index.d.ts | 1239 ++ .../node_modules/mongoose/types/indexes.d.ts | 170 + .../mongoose/types/inferhydrateddoctype.d.ts | 151 + .../mongoose/types/inferrawdoctype.d.ts | 201 + .../mongoose/types/inferschematype.d.ts | 387 + .../mongoose/types/middlewares.d.ts | 75 + .../node_modules/mongoose/types/models.d.ts | 1736 ++ .../mongoose/types/mongooseoptions.d.ts | 240 + .../mongoose/types/pipelinestage.d.ts | 334 + .../node_modules/mongoose/types/populate.d.ts | 105 + .../node_modules/mongoose/types/query.d.ts | 982 + .../mongoose/types/schemaoptions.d.ts | 290 + .../mongoose/types/schematypes.d.ts | 667 + .../node_modules/mongoose/types/session.d.ts | 32 + .../node_modules/mongoose/types/tracing.d.ts | 10 + .../node_modules/mongoose/types/types.d.ts | 109 + .../node_modules/mongoose/types/utility.d.ts | 224 + .../mongoose/types/validation.d.ts | 39 + .../node_modules/mongoose/types/virtuals.d.ts | 14 + .../.pnpm/mongoose@9.10.2/node_modules/mpath | 1 + .../.pnpm/mongoose@9.10.2/node_modules/mquery | 1 + .../.pnpm/mongoose@9.10.2/node_modules/ms | 1 + .../.pnpm/mongoose@9.10.2/node_modules/sift | 1 + .../node_modules/mpath/.travis.yml | 9 + .../mpath@0.9.0/node_modules/mpath/History.md | 88 + .../mpath@0.9.0/node_modules/mpath/LICENSE | 22 + .../mpath@0.9.0/node_modules/mpath/README.md | 278 + .../node_modules/mpath/SECURITY.md | 5 + .../mpath@0.9.0/node_modules/mpath/index.js | 3 + .../node_modules/mpath/lib/index.js | 336 + .../node_modules/mpath/lib/stringToParts.js | 48 + .../node_modules/mpath/package.json | 144 + .../node_modules/mpath/test/.eslintrc.yml | 4 + .../node_modules/mpath/test/index.js | 1879 ++ .../node_modules/mpath/test/stringToParts.js | 30 + .../mquery/.github/ISSUE_TEMPLATE.md | 11 + .../mquery/.github/PULL_REQUEST_TEMPLATE.md | 9 + .../node_modules/mquery/History.md | 393 + .../mquery@6.0.0/node_modules/mquery/LICENSE | 22 + .../node_modules/mquery/README.md | 1387 ++ .../node_modules/mquery/SECURITY.md | 1 + .../mquery/lib/collection/collection.js | 47 + .../mquery/lib/collection/index.js | 13 + .../mquery/lib/collection/node.js | 128 + .../node_modules/mquery/lib/env.js | 22 + .../node_modules/mquery/lib/mquery.js | 2748 +++ .../node_modules/mquery/lib/permissions.js | 93 + .../node_modules/mquery/lib/utils.js | 297 + .../node_modules/mquery/package.json | 35 + .../.pnpm/ms@2.1.3/node_modules/ms/index.js | 162 + .../.pnpm/ms@2.1.3/node_modules/ms/license.md | 21 + .../ms@2.1.3/node_modules/ms/package.json | 38 + .../.pnpm/ms@2.1.3/node_modules/ms/readme.md | 59 + .../node_modules/content-type | 1 + .../node_modules/negotiator/LICENSE | 24 + .../node_modules/negotiator/README.md | 212 + .../node_modules/negotiator/index.js | 83 + .../node_modules/negotiator/lib/accept.js | 54 + .../node_modules/negotiator/lib/charset.js | 145 + .../node_modules/negotiator/lib/encoding.js | 184 + .../node_modules/negotiator/lib/language.js | 158 + .../node_modules/negotiator/lib/mediaType.js | 176 + .../node_modules/negotiator/package.json | 49 + .../.pnpm/node_modules/.bin/apollo-pbjs | 74 + .../.pnpm/node_modules/.bin/apollo-pbts | 74 + .../.pnpm/node_modules/.bin/sha.js | 74 + .../node_modules/@apollo/cache-control-types | 1 + .../.pnpm/node_modules/@apollo/protobufjs | 1 + .../@apollo/server-gateway-interface | 1 + .../@apollo/usage-reporting-protobuf | 1 + .../node_modules/@apollo/utils.createhash | 1 + .../@apollo/utils.dropunuseddefinitions | 1 + .../.pnpm/node_modules/@apollo/utils.fetcher | 1 + .../node_modules/@apollo/utils.isnodelike | 1 + .../node_modules/@apollo/utils.keyvaluecache | 1 + .../.pnpm/node_modules/@apollo/utils.logger | 1 + .../@apollo/utils.printwithreducedwhitespace | 1 + .../node_modules/@apollo/utils.removealiases | 1 + .../.pnpm/node_modules/@apollo/utils.sortast | 1 + .../@apollo/utils.stripsensitiveliterals | 1 + .../node_modules/@apollo/utils.usagereporting | 1 + .../node_modules/@apollo/utils.withrequired | 1 + .../.pnpm/node_modules/@graphql-tools/merge | 1 + .../.pnpm/node_modules/@graphql-tools/schema | 1 + .../.pnpm/node_modules/@graphql-tools/utils | 1 + .../@graphql-typed-document-node/core | 1 + .../.pnpm/node_modules/@mongodb-js/saslprep | 1 + .../.pnpm/node_modules/@protobufjs/aspromise | 1 + .../.pnpm/node_modules/@protobufjs/base64 | 1 + .../.pnpm/node_modules/@protobufjs/codegen | 1 + .../node_modules/@protobufjs/eventemitter | 1 + .../.pnpm/node_modules/@protobufjs/fetch | 1 + .../.pnpm/node_modules/@protobufjs/float | 1 + .../.pnpm/node_modules/@protobufjs/inquire | 1 + .../.pnpm/node_modules/@protobufjs/path | 1 + .../.pnpm/node_modules/@protobufjs/pool | 1 + .../.pnpm/node_modules/@protobufjs/utf8 | 1 + .../.pnpm/node_modules/@standard-schema/spec | 1 + .../.pnpm/node_modules/@types/long | 1 + .../node_modules/@types/webidl-conversions | 1 + .../.pnpm/node_modules/@types/whatwg-url | 1 + .../node_modules/@whatwg-node/promise-helpers | 1 + .../.pnpm/node_modules/async-retry | 1 + .../.pnpm/node_modules/available-typed-arrays | 1 + .../.pnpm/node_modules/body-parser | 1 + backend/node_modules/.pnpm/node_modules/bson | 1 + backend/node_modules/.pnpm/node_modules/bytes | 1 + .../node_modules/.pnpm/node_modules/call-bind | 1 + .../node_modules/call-bind-apply-helpers | 1 + .../.pnpm/node_modules/call-bound | 1 + .../.pnpm/node_modules/content-type | 1 + backend/node_modules/.pnpm/node_modules/cors | 1 + .../.pnpm/node_modules/cross-inspect | 1 + backend/node_modules/.pnpm/node_modules/debug | 1 + .../.pnpm/node_modules/define-data-property | 1 + backend/node_modules/.pnpm/node_modules/depd | 1 + .../.pnpm/node_modules/dunder-proto | 1 + .../node_modules/.pnpm/node_modules/ee-first | 1 + .../node_modules/.pnpm/node_modules/encodeurl | 1 + .../.pnpm/node_modules/es-define-property | 1 + .../node_modules/.pnpm/node_modules/es-errors | 1 + .../.pnpm/node_modules/es-object-atoms | 1 + .../.pnpm/node_modules/escape-html | 1 + .../.pnpm/node_modules/finalhandler | 1 + .../node_modules/.pnpm/node_modules/for-each | 1 + .../.pnpm/node_modules/function-bind | 1 + .../.pnpm/node_modules/get-intrinsic | 1 + .../node_modules/.pnpm/node_modules/get-proto | 1 + backend/node_modules/.pnpm/node_modules/gopd | 1 + .../node_modules/has-property-descriptors | 1 + .../.pnpm/node_modules/has-symbols | 1 + .../.pnpm/node_modules/has-tostringtag | 1 + .../node_modules/.pnpm/node_modules/hasown | 1 + .../.pnpm/node_modules/http-errors | 1 + .../.pnpm/node_modules/iconv-lite | 1 + .../node_modules/.pnpm/node_modules/inherits | 1 + .../.pnpm/node_modules/is-callable | 1 + .../.pnpm/node_modules/is-typed-array | 1 + .../node_modules/.pnpm/node_modules/isarray | 1 + .../node_modules/.pnpm/node_modules/kareem | 1 + .../.pnpm/node_modules/lodash.sortby | 1 + .../node_modules/.pnpm/node_modules/loglevel | 1 + backend/node_modules/.pnpm/node_modules/long | 1 + .../node_modules/.pnpm/node_modules/lru-cache | 1 + .../.pnpm/node_modules/math-intrinsics | 1 + .../.pnpm/node_modules/media-typer | 1 + .../.pnpm/node_modules/memory-pager | 1 + .../node_modules/.pnpm/node_modules/mime-db | 1 + .../.pnpm/node_modules/mime-types | 1 + .../node_modules/.pnpm/node_modules/mongodb | 1 + .../mongodb-connection-string-url | 1 + backend/node_modules/.pnpm/node_modules/mpath | 1 + .../node_modules/.pnpm/node_modules/mquery | 1 + backend/node_modules/.pnpm/node_modules/ms | 1 + .../.pnpm/node_modules/negotiator | 1 + .../.pnpm/node_modules/object-assign | 1 + .../.pnpm/node_modules/object-inspect | 1 + .../.pnpm/node_modules/on-finished | 1 + .../node_modules/.pnpm/node_modules/parseurl | 1 + .../node_modules/possible-typed-array-names | 1 + .../node_modules/.pnpm/node_modules/punycode | 1 + backend/node_modules/.pnpm/node_modules/qs | 1 + .../node_modules/.pnpm/node_modules/raw-body | 1 + backend/node_modules/.pnpm/node_modules/retry | 1 + .../.pnpm/node_modules/safe-buffer | 1 + .../.pnpm/node_modules/safer-buffer | 1 + .../.pnpm/node_modules/set-function-length | 1 + .../.pnpm/node_modules/setprototypeof | 1 + .../node_modules/.pnpm/node_modules/sha.js | 1 + .../.pnpm/node_modules/side-channel | 1 + .../.pnpm/node_modules/side-channel-list | 1 + .../.pnpm/node_modules/side-channel-map | 1 + .../.pnpm/node_modules/side-channel-weakmap | 1 + backend/node_modules/.pnpm/node_modules/sift | 1 + .../.pnpm/node_modules/sparse-bitfield | 1 + .../node_modules/.pnpm/node_modules/statuses | 1 + .../node_modules/.pnpm/node_modules/to-buffer | 1 + .../.pnpm/node_modules/toidentifier | 1 + backend/node_modules/.pnpm/node_modules/tr46 | 1 + backend/node_modules/.pnpm/node_modules/tslib | 1 + .../node_modules/.pnpm/node_modules/type-is | 1 + .../.pnpm/node_modules/typed-array-buffer | 1 + .../node_modules/.pnpm/node_modules/unpipe | 1 + backend/node_modules/.pnpm/node_modules/vary | 1 + .../.pnpm/node_modules/webidl-conversions | 1 + .../.pnpm/node_modules/whatwg-mimetype | 1 + .../.pnpm/node_modules/whatwg-url | 1 + .../.pnpm/node_modules/which-typed-array | 1 + .../node_modules/object-assign/index.js | 90 + .../node_modules/object-assign/license | 21 + .../node_modules/object-assign/package.json | 42 + .../node_modules/object-assign/readme.md | 61 + .../node_modules/object-inspect/.eslintrc | 53 + .../object-inspect/.github/FUNDING.yml | 12 + .../node_modules/object-inspect/.nycrc | 13 + .../node_modules/object-inspect/CHANGELOG.md | 424 + .../node_modules/object-inspect/LICENSE | 21 + .../object-inspect/example/all.js | 23 + .../object-inspect/example/circular.js | 6 + .../node_modules/object-inspect/example/fn.js | 5 + .../object-inspect/example/inspect.js | 10 + .../node_modules/object-inspect/index.js | 544 + .../object-inspect/package-support.json | 20 + .../node_modules/object-inspect/package.json | 105 + .../object-inspect/readme.markdown | 84 + .../object-inspect/test-core-js.js | 26 + .../object-inspect/test/bigint.js | 58 + .../object-inspect/test/browser/dom.js | 15 + .../object-inspect/test/circular.js | 16 + .../node_modules/object-inspect/test/deep.js | 12 + .../object-inspect/test/element.js | 53 + .../node_modules/object-inspect/test/err.js | 48 + .../node_modules/object-inspect/test/fakes.js | 29 + .../node_modules/object-inspect/test/fn.js | 76 + .../object-inspect/test/global.js | 17 + .../node_modules/object-inspect/test/has.js | 15 + .../node_modules/object-inspect/test/holes.js | 15 + .../object-inspect/test/indent-option.js | 271 + .../object-inspect/test/inspect.js | 139 + .../object-inspect/test/lowbyte.js | 12 + .../object-inspect/test/number.js | 58 + .../object-inspect/test/quoteStyle.js | 26 + .../object-inspect/test/toStringTag.js | 40 + .../node_modules/object-inspect/test/undef.js | 12 + .../object-inspect/test/values.js | 261 + .../object-inspect/util.inspect.js | 1 + .../on-finished@2.4.1/node_modules/ee-first | 1 + .../node_modules/on-finished/HISTORY.md | 98 + .../node_modules/on-finished/LICENSE | 23 + .../node_modules/on-finished/README.md | 162 + .../node_modules/on-finished/index.js | 234 + .../node_modules/on-finished/package.json | 39 + .../node_modules/parseurl/HISTORY.md | 58 + .../node_modules/parseurl/LICENSE | 24 + .../node_modules/parseurl/README.md | 133 + .../node_modules/parseurl/index.js | 158 + .../node_modules/parseurl/package.json | 40 + .../possible-typed-array-names/.eslintrc | 5 + .../.github/FUNDING.yml | 12 + .../possible-typed-array-names/CHANGELOG.md | 29 + .../possible-typed-array-names/LICENSE | 21 + .../possible-typed-array-names/README.md | 50 + .../possible-typed-array-names/index.d.ts | 16 + .../possible-typed-array-names/index.js | 17 + .../possible-typed-array-names/package.json | 84 + .../possible-typed-array-names/test/index.js | 19 + .../possible-typed-array-names/tsconfig.json | 9 + .../node_modules/punycode/LICENSE-MIT.txt | 20 + .../node_modules/punycode/README.md | 148 + .../node_modules/punycode/package.json | 58 + .../node_modules/punycode/punycode.es6.js | 444 + .../node_modules/punycode/punycode.js | 443 + .../qs@6.16.0/node_modules/es-define-property | 1 + .../qs@6.16.0/node_modules/qs/.editorconfig | 46 + .../node_modules/qs/.github/FUNDING.yml | 12 + .../node_modules/qs/.github/SECURITY.md | 11 + .../node_modules/qs/.github/THREAT_MODEL.md | 78 + .../.pnpm/qs@6.16.0/node_modules/qs/.nycrc | 13 + .../qs@6.16.0/node_modules/qs/CHANGELOG.md | 848 + .../qs@6.16.0/node_modules/qs/LICENSE.md | 29 + .../.pnpm/qs@6.16.0/node_modules/qs/README.md | 776 + .../qs@6.16.0/node_modules/qs/dist/qs.js | 141 + .../node_modules/qs/eslint.config.mjs | 57 + .../qs@6.16.0/node_modules/qs/lib/formats.js | 23 + .../qs@6.16.0/node_modules/qs/lib/index.js | 11 + .../qs@6.16.0/node_modules/qs/lib/parse.js | 413 + .../node_modules/qs/lib/stringify.js | 378 + .../qs@6.16.0/node_modules/qs/lib/utils.js | 388 + .../qs@6.16.0/node_modules/qs/package.json | 95 + .../node_modules/qs/test/empty-keys-cases.js | 267 + .../qs@6.16.0/node_modules/qs/test/parse.js | 2122 ++ .../node_modules/qs/test/stringify.js | 1765 ++ .../qs@6.16.0/node_modules/qs/test/utils.js | 638 + .../.pnpm/qs@6.16.0/node_modules/side-channel | 1 + .../.pnpm/raw-body@3.0.2/node_modules/bytes | 1 + .../raw-body@3.0.2/node_modules/http-errors | 1 + .../raw-body@3.0.2/node_modules/iconv-lite | 1 + .../node_modules/raw-body/LICENSE | 22 + .../node_modules/raw-body/README.md | 223 + .../node_modules/raw-body/index.d.ts | 85 + .../node_modules/raw-body/index.js | 336 + .../node_modules/raw-body/package.json | 46 + .../.pnpm/raw-body@3.0.2/node_modules/unpipe | 1 + .../retry@0.13.1/node_modules/retry/License | 21 + .../retry@0.13.1/node_modules/retry/README.md | 227 + .../node_modules/retry/example/dns.js | 31 + .../node_modules/retry/example/stop.js | 40 + .../retry@0.13.1/node_modules/retry/index.js | 1 + .../node_modules/retry/lib/retry.js | 100 + .../node_modules/retry/lib/retry_operation.js | 162 + .../node_modules/retry/package.json | 36 + .../node_modules/safe-buffer/LICENSE | 21 + .../node_modules/safe-buffer/README.md | 584 + .../node_modules/safe-buffer/index.d.ts | 187 + .../node_modules/safe-buffer/index.js | 65 + .../node_modules/safe-buffer/package.json | 51 + .../node_modules/safer-buffer/LICENSE | 21 + .../safer-buffer/Porting-Buffer.md | 268 + .../node_modules/safer-buffer/Readme.md | 156 + .../node_modules/safer-buffer/dangerous.js | 58 + .../node_modules/safer-buffer/package.json | 34 + .../node_modules/safer-buffer/safer.js | 77 + .../node_modules/safer-buffer/tests.js | 406 + .../node_modules/define-data-property | 1 + .../node_modules/es-errors | 1 + .../node_modules/function-bind | 1 + .../node_modules/get-intrinsic | 1 + .../node_modules/gopd | 1 + .../node_modules/has-property-descriptors | 1 + .../set-function-length/.eslintrc | 27 + .../set-function-length/.github/FUNDING.yml | 12 + .../node_modules/set-function-length/.nycrc | 13 + .../set-function-length/CHANGELOG.md | 70 + .../node_modules/set-function-length/LICENSE | 21 + .../set-function-length/README.md | 56 + .../node_modules/set-function-length/env.d.ts | 9 + .../node_modules/set-function-length/env.js | 25 + .../set-function-length/index.d.ts | 7 + .../node_modules/set-function-length/index.js | 42 + .../set-function-length/package.json | 102 + .../set-function-length/tsconfig.json | 9 + .../node_modules/setprototypeof/LICENSE | 13 + .../node_modules/setprototypeof/README.md | 31 + .../node_modules/setprototypeof/index.d.ts | 2 + .../node_modules/setprototypeof/index.js | 17 + .../node_modules/setprototypeof/package.json | 38 + .../node_modules/setprototypeof/test/index.js | 24 + .../.pnpm/sha.js@2.4.12/node_modules/inherits | 1 + .../sha.js@2.4.12/node_modules/safe-buffer | 1 + .../node_modules/sha.js/.eslintrc | 76 + .../node_modules/sha.js/CHANGELOG.md | 423 + .../sha.js@2.4.12/node_modules/sha.js/LICENSE | 49 + .../node_modules/sha.js/README.md | 44 + .../sha.js@2.4.12/node_modules/sha.js/bin.js | 44 + .../sha.js@2.4.12/node_modules/sha.js/hash.js | 84 + .../node_modules/sha.js/index.js | 19 + .../sha.js/node_modules/.bin/sha.js | 74 + .../node_modules/sha.js/package.json | 58 + .../sha.js@2.4.12/node_modules/sha.js/sha.js | 104 + .../sha.js@2.4.12/node_modules/sha.js/sha1.js | 109 + .../node_modules/sha.js/sha224.js | 55 + .../node_modules/sha.js/sha256.js | 189 + .../node_modules/sha.js/sha384.js | 59 + .../node_modules/sha.js/sha512.js | 382 + .../node_modules/sha.js/test/hash.js | 80 + .../node_modules/sha.js/test/test.js | 138 + .../node_modules/sha.js/test/vectors.js | 72 + .../sha.js@2.4.12/node_modules/to-buffer | 1 + .../node_modules/es-errors | 1 + .../node_modules/object-inspect | 1 + .../side-channel-list/.editorconfig | 9 + .../node_modules/side-channel-list/.eslintrc | 11 + .../side-channel-list/.github/FUNDING.yml | 12 + .../node_modules/side-channel-list/.nycrc | 13 + .../side-channel-list/CHANGELOG.md | 36 + .../node_modules/side-channel-list/LICENSE | 21 + .../node_modules/side-channel-list/README.md | 62 + .../node_modules/side-channel-list/index.d.ts | 13 + .../node_modules/side-channel-list/index.js | 111 + .../node_modules/side-channel-list/list.d.ts | 14 + .../side-channel-list/package.json | 77 + .../side-channel-list/test/index.js | 154 + .../side-channel-list/tsconfig.json | 9 + .../node_modules/call-bound | 1 + .../node_modules/es-errors | 1 + .../node_modules/get-intrinsic | 1 + .../node_modules/object-inspect | 1 + .../side-channel-map/.editorconfig | 9 + .../node_modules/side-channel-map/.eslintrc | 11 + .../side-channel-map/.github/FUNDING.yml | 12 + .../node_modules/side-channel-map/.nycrc | 13 + .../side-channel-map/CHANGELOG.md | 22 + .../node_modules/side-channel-map/LICENSE | 21 + .../node_modules/side-channel-map/README.md | 62 + .../node_modules/side-channel-map/index.d.ts | 15 + .../node_modules/side-channel-map/index.js | 68 + .../side-channel-map/package.json | 80 + .../side-channel-map/test/index.js | 114 + .../side-channel-map/tsconfig.json | 9 + .../node_modules/call-bound | 1 + .../node_modules/es-errors | 1 + .../node_modules/get-intrinsic | 1 + .../node_modules/object-inspect | 1 + .../node_modules/side-channel-map | 1 + .../side-channel-weakmap/.editorconfig | 9 + .../side-channel-weakmap/.eslintrc | 12 + .../side-channel-weakmap/.github/FUNDING.yml | 12 + .../node_modules/side-channel-weakmap/.nycrc | 13 + .../side-channel-weakmap/CHANGELOG.md | 28 + .../node_modules/side-channel-weakmap/LICENSE | 21 + .../side-channel-weakmap/README.md | 62 + .../side-channel-weakmap/index.d.ts | 15 + .../side-channel-weakmap/index.js | 84 + .../side-channel-weakmap/package.json | 87 + .../side-channel-weakmap/test/index.js | 114 + .../side-channel-weakmap/tsconfig.json | 9 + .../side-channel@1.1.1/node_modules/es-errors | 1 + .../node_modules/object-inspect | 1 + .../node_modules/side-channel-list | 1 + .../node_modules/side-channel-map | 1 + .../node_modules/side-channel-weakmap | 1 + .../node_modules/side-channel/.editorconfig | 9 + .../node_modules/side-channel/.eslintrc | 12 + .../side-channel/.github/FUNDING.yml | 12 + .../node_modules/side-channel/.nycrc | 13 + .../node_modules/side-channel/CHANGELOG.md | 120 + .../node_modules/side-channel/LICENSE | 21 + .../node_modules/side-channel/README.md | 61 + .../node_modules/side-channel/index.d.ts | 14 + .../node_modules/side-channel/index.js | 46 + .../node_modules/side-channel/package.json | 85 + .../node_modules/side-channel/test/index.js | 120 + .../node_modules/side-channel/tsconfig.json | 9 + .../node_modules/sift/MIT-LICENSE.txt | 20 + .../sift@17.1.3/node_modules/sift/README.md | 465 + .../sift@17.1.3/node_modules/sift/es/index.js | 632 + .../node_modules/sift/es/index.js.map | 1 + .../node_modules/sift/es5m/index.js | 743 + .../node_modules/sift/es5m/index.js.map | 1 + .../sift@17.1.3/node_modules/sift/index.d.ts | 4 + .../sift@17.1.3/node_modules/sift/index.js | 4 + .../node_modules/sift/lib/core.d.ts | 116 + .../node_modules/sift/lib/index.d.ts | 6 + .../node_modules/sift/lib/index.js | 781 + .../node_modules/sift/lib/index.js.map | 1 + .../node_modules/sift/lib/operations.d.ts | 88 + .../node_modules/sift/lib/utils.d.ts | 11 + .../node_modules/sift/package.json | 61 + .../node_modules/sift/sift.csp.min.js | 778 + .../node_modules/sift/sift.csp.min.js.map | 1 + .../sift@17.1.3/node_modules/sift/sift.min.js | 2 + .../node_modules/sift/sift.min.js.map | 1 + .../sift@17.1.3/node_modules/sift/src/core.ts | 494 + .../node_modules/sift/src/index.ts | 54 + .../node_modules/sift/src/operations.ts | 422 + .../node_modules/sift/src/utils.ts | 74 + .../node_modules/memory-pager | 1 + .../node_modules/sparse-bitfield/.npmignore | 1 + .../node_modules/sparse-bitfield/.travis.yml | 6 + .../node_modules/sparse-bitfield/LICENSE | 21 + .../node_modules/sparse-bitfield/README.md | 62 + .../node_modules/sparse-bitfield/index.js | 95 + .../node_modules/sparse-bitfield/package.json | 27 + .../node_modules/sparse-bitfield/test.js | 79 + .../node_modules/statuses/HISTORY.md | 87 + .../node_modules/statuses/LICENSE | 23 + .../node_modules/statuses/README.md | 139 + .../node_modules/statuses/codes.json | 65 + .../node_modules/statuses/index.js | 146 + .../node_modules/statuses/package.json | 49 + .../to-buffer@1.2.2/node_modules/isarray | 1 + .../to-buffer@1.2.2/node_modules/safe-buffer | 1 + .../to-buffer/.github/FUNDING.yml | 12 + .../node_modules/to-buffer/CHANGELOG.md | 81 + .../node_modules/to-buffer/LICENSE | 21 + .../node_modules/to-buffer/README.md | 44 + .../node_modules/to-buffer/index.js | 109 + .../node_modules/to-buffer/package.json | 62 + .../node_modules/typed-array-buffer | 1 + .../node_modules/toidentifier/HISTORY.md | 9 + .../node_modules/toidentifier/LICENSE | 21 + .../node_modules/toidentifier/README.md | 61 + .../node_modules/toidentifier/index.js | 32 + .../node_modules/toidentifier/package.json | 38 + .../.pnpm/tr46@5.1.1/node_modules/punycode | 1 + .../tr46@5.1.1/node_modules/tr46/LICENSE.md | 21 + .../tr46@5.1.1/node_modules/tr46/README.md | 76 + .../tr46@5.1.1/node_modules/tr46/index.js | 344 + .../node_modules/tr46/lib/mappingTable.json | 1 + .../node_modules/tr46/lib/regexes.js | 29 + .../node_modules/tr46/lib/statusMapping.js | 9 + .../tr46@5.1.1/node_modules/tr46/package.json | 44 + .../node_modules/tslib/CopyrightNotice.txt | 15 + .../node_modules/tslib/LICENSE.txt | 12 + .../tslib@2.8.1/node_modules/tslib/README.md | 164 + .../node_modules/tslib/SECURITY.md | 41 + .../node_modules/tslib/modules/index.d.ts | 38 + .../node_modules/tslib/modules/index.js | 70 + .../node_modules/tslib/modules/package.json | 3 + .../node_modules/tslib/package.json | 47 + .../tslib@2.8.1/node_modules/tslib/tslib.d.ts | 460 + .../node_modules/tslib/tslib.es6.html | 1 + .../node_modules/tslib/tslib.es6.js | 402 + .../node_modules/tslib/tslib.es6.mjs | 401 + .../tslib@2.8.1/node_modules/tslib/tslib.html | 1 + .../tslib@2.8.1/node_modules/tslib/tslib.js | 484 + .../type-is@2.1.0/node_modules/content-type | 1 + .../type-is@2.1.0/node_modules/media-typer | 1 + .../type-is@2.1.0/node_modules/mime-types | 1 + .../node_modules/type-is/HISTORY.md | 292 + .../node_modules/type-is/LICENSE | 23 + .../node_modules/type-is/README.md | 198 + .../node_modules/type-is/index.js | 240 + .../node_modules/type-is/package.json | 51 + .../node_modules/call-bound | 1 + .../node_modules/es-errors | 1 + .../node_modules/is-typed-array | 1 + .../node_modules/typed-array-buffer/.eslintrc | 13 + .../typed-array-buffer/.github/FUNDING.yml | 12 + .../node_modules/typed-array-buffer/.nycrc | 13 + .../typed-array-buffer/CHANGELOG.md | 50 + .../node_modules/typed-array-buffer/LICENSE | 21 + .../node_modules/typed-array-buffer/README.md | 42 + .../typed-array-buffer/index.d.ts | 9 + .../node_modules/typed-array-buffer/index.js | 19 + .../typed-array-buffer/package.json | 82 + .../typed-array-buffer/test/index.js | 23 + .../typed-array-buffer/tsconfig.json | 9 + .../node_modules/unpipe/HISTORY.md | 4 + .../unpipe@1.0.0/node_modules/unpipe/LICENSE | 22 + .../node_modules/unpipe/README.md | 43 + .../unpipe@1.0.0/node_modules/unpipe/index.js | 69 + .../node_modules/unpipe/package.json | 27 + .../vary@1.1.2/node_modules/vary/HISTORY.md | 39 + .../vary@1.1.2/node_modules/vary/LICENSE | 22 + .../vary@1.1.2/node_modules/vary/README.md | 101 + .../vary@1.1.2/node_modules/vary/index.js | 149 + .../vary@1.1.2/node_modules/vary/package.json | 43 + .../webidl-conversions/LICENSE.md | 12 + .../node_modules/webidl-conversions/README.md | 99 + .../webidl-conversions/lib/index.js | 450 + .../webidl-conversions/package.json | 35 + .../node_modules/whatwg-mimetype/LICENSE.txt | 7 + .../node_modules/whatwg-mimetype/README.md | 101 + .../lib/mime-type-parameters.js | 70 + .../whatwg-mimetype/lib/mime-type.js | 127 + .../whatwg-mimetype/lib/parser.js | 105 + .../whatwg-mimetype/lib/serializer.js | 25 + .../node_modules/whatwg-mimetype/lib/utils.js | 60 + .../node_modules/whatwg-mimetype/package.json | 45 + .../.pnpm/whatwg-url@14.2.0/node_modules/tr46 | 1 + .../node_modules/webidl-conversions | 1 + .../node_modules/whatwg-url/LICENSE.txt | 21 + .../node_modules/whatwg-url/README.md | 106 + .../node_modules/whatwg-url/index.js | 27 + .../node_modules/whatwg-url/lib/Function.js | 42 + .../node_modules/whatwg-url/lib/URL-impl.js | 233 + .../node_modules/whatwg-url/lib/URL.js | 499 + .../whatwg-url/lib/URLSearchParams-impl.js | 135 + .../whatwg-url/lib/URLSearchParams.js | 505 + .../whatwg-url/lib/VoidFunction.js | 26 + .../node_modules/whatwg-url/lib/encoding.js | 16 + .../node_modules/whatwg-url/lib/infra.js | 26 + .../whatwg-url/lib/percent-encoding.js | 142 + .../whatwg-url/lib/url-state-machine.js | 1274 ++ .../node_modules/whatwg-url/lib/urlencoded.js | 89 + .../node_modules/whatwg-url/lib/utils.js | 190 + .../node_modules/whatwg-url/package.json | 53 + .../whatwg-url/webidl2js-wrapper.js | 7 + .../node_modules/available-typed-arrays | 1 + .../node_modules/call-bind | 1 + .../node_modules/call-bound | 1 + .../node_modules/for-each | 1 + .../node_modules/get-proto | 1 + .../node_modules/gopd | 1 + .../node_modules/has-tostringtag | 1 + .../which-typed-array/.editorconfig | 20 + .../which-typed-array/.github/FUNDING.yml | 12 + .../node_modules/which-typed-array/.nycrc | 13 + .../which-typed-array/CHANGELOG.md | 301 + .../node_modules/which-typed-array/LICENSE | 22 + .../node_modules/which-typed-array/README.md | 68 + .../node_modules/which-typed-array/index.d.ts | 312 + .../node_modules/which-typed-array/index.js | 134 + .../which-typed-array/package.json | 131 + .../which-typed-array/tsconfig.json | 9 + backend/node_modules/@apollo/server | 1 + backend/node_modules/graphql | 1 + backend/node_modules/graphql-tag | 1 + backend/node_modules/mongoose | 1 + backend/package.json | 27 + backend/pnpm-lock.yaml | 1247 ++ backend/pnpm-workspace.yaml | 2 + frontend/.gitignore | 24 + frontend/README.md | 78 + frontend/eslint.config.js | 22 + frontend/index.html | 13 + frontend/package.json | 36 + frontend/pnpm-lock.yaml | 1932 ++ frontend/public/favicon.svg | 1 + frontend/public/icons.svg | 24 + frontend/src/App.css | 184 + frontend/src/App.tsx | 122 + frontend/src/assets/hero.png | Bin 0 -> 13057 bytes frontend/src/assets/react.svg | 1 + frontend/src/assets/vite.svg | 1 + frontend/src/index.css | 111 + frontend/src/main.tsx | 10 + frontend/tsconfig.app.json | 26 + frontend/tsconfig.json | 7 + frontend/tsconfig.node.json | 23 + frontend/vite.config.ts | 11 + 5228 files changed, 503546 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/cleanup.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation.md create mode 100644 .github/ISSUE_TEMPLATE/feature.md create mode 100644 .github/ISSUE_TEMPLATE/fix.md create mode 100644 .github/ISSUE_TEMPLATE/task.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 backend/node_modules/.modules.yaml create mode 100644 backend/node_modules/.pnpm-workspace-state-v1.json create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.cjs.tsbuildinfo create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.tsbuildinfo create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/graphql create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/README.md create mode 100755 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs create mode 100755 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/README.md create mode 100755 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbjs create mode 100755 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/plugin.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/publish.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package-lock.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.standalone.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json-module.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto2.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto3.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static-module.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/util.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/amd.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/closure.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/commonjs.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/default.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/es6.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/test.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.proto create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.proto create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.proto create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.proto create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.proto create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.proto create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.js create mode 100755 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbjs create mode 100755 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbts create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/scripts/postinstall.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/common.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/converter.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/decoder.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/encoder.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/enum.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/field.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-light.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-minimal.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/mapfield.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/message.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/method.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/namespace.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/object.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/oneof.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/parse.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader_buffer.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/root.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/roots.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc/service.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/service.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/tokenize.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/type.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/types.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/typescript.jsdoc create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/longbits.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/minimal.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/verifier.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/wrappers.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer_buffer.js create mode 100644 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/tsconfig.json create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/aspromise create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/base64 create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/codegen create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/eventemitter create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/fetch create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/float create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/inquire create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/path create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/pool create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/utf8 create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@types/long create mode 120000 backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/long create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.cjs.tsbuildinfo create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.tsbuildinfo create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf create mode 120000 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.fetcher create mode 120000 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache create mode 120000 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.logger create mode 120000 backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/graphql create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/cache-control-types create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server-gateway-interface create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/errors/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/cacheControl/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disableSuggestions/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disabled/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/drainHttpServer/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/inlineTrace/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/landingPage/default/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/schemaReporting/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/subscriptionCallback/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/usageReporting/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/ApolloServer.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/cachePolicy.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/determineApolloConfig.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errorNormalize.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errors/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/constructor.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/context.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/graphql.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/http.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/plugins.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/requestPipeline.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/generated/packageVersion.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/httpBatching.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/incrementalDeliveryPolyfill.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalErrorClasses.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalPlugin.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/cacheControl/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disableSuggestions/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disabled/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/stoppable.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/inlineTrace/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/getEmbeddedHTML.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/types.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaIsSubgraph.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/generated/operations.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/schemaReporter.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/subscriptionCallback/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/traceTreeBuilder.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/durationHistogram.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/iterateOverTrace.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/operationDerivedDataCache.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/options.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/plugin.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/stats.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/traceDetails.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/preventCsrf.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/requestPipeline.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/runHttpQuery.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/standalone/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/HeaderMap.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/UnreachableCaseError.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/computeCoreSchemaHash.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/invokeHooks.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/isDefined.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/makeGatewayGraphQLRequestContext.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/resolvable.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaInstrumentation.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaManager.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/urlForHttpServer.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/NoIntrospection.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/RecursiveSelectionsLimit.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/standalone/package.json create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.createhash create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.fetcher create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.isnodelike create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.logger create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.usagereporting create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.withrequired create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@graphql-tools/schema create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/async-retry create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/body-parser create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/content-type create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/cors create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/finalhandler create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/graphql create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/loglevel create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/lru-cache create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/negotiator create mode 120000 backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/whatwg-mimetype create mode 120000 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/protobufjs create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.js create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.js create mode 100755 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbjs create mode 100755 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbts create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/.editorconfig create mode 100644 backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/reports.proto create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js.map create mode 100755 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/node_modules/.bin/sha.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/createHash.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/exports.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.isnodelike create mode 120000 backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/sha.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/dropUnusedDefinitions.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/graphql create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/index.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/src/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/ErrorsAreMissesCache.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/InMemoryLRUCache.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/KeyValueCache.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/PrefixingKeyValueCache.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/ErrorsAreMissesCache.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/InMemoryLRUCache.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/PrefixingKeyValueCache.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/keyValueCache.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.logger create mode 120000 backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/lru-cache create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/index.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/printWithReducedWhitespace.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/graphql create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/removeAliases.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/graphql create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/graphql create mode 120000 backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/lodash.sortby create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/stripSensitiveLiterals.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/index.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/graphql create mode 120000 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf create mode 120000 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions create mode 120000 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace create mode 120000 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.removealiases create mode 120000 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.sortast create mode 120000 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/__snapshots__/signature.test.ts.snap create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/calculateReferencedFieldsByType.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/signature.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/calculateReferencedFieldsByType.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/index.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/signature.ts create mode 120000 backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/graphql create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/LICENSE create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/README.md create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/package.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/index.test.ts create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/tsconfig.json create mode 100644 backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/index.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/README.md create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/extensions.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/links.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/merge-resolvers.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/arguments.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum-values.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/fields.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/input-type.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/interface.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-named-type-array.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-nodes.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-typedefs.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/scalar.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/schema-def.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/type.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/union.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/utils.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/extensions.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/links.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/merge-resolvers.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum-values.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/fields.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/package.json create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.ts create mode 120000 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/utils create mode 120000 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/graphql create mode 120000 backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/tslib create mode 120000 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/merge create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/README.md create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/addResolversToSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/assertResolversPresent.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/chainResolvers.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/checkForResolveTypeResolver.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/extendResolversFromInterfaces.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/merge-schemas.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/types.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/addResolversToSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/assertResolversPresent.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/chainResolvers.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/checkForResolveTypeResolver.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/extendResolversFromInterfaces.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/makeExecutableSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/merge-schemas.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/types.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/package.json create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.ts create mode 120000 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/utils create mode 120000 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/graphql create mode 120000 backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/tslib create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/AccumulatorMap.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Interfaces.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Path.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/addTypes.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValue.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValueUntyped.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/build-operation-for-field.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/collectFields.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/comments.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/debugTimer.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/defaultValueAstFromType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/descriptionFromObject.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/errors.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/executor.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/extractExtensionsFromSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fields.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/filterSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fixSchemaAst.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachDefaultValue.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachField.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-arguments-with-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-fields-with-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-implementing-types.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getArgumentValues.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveExtensions.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveValues.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getObjectTypeFromTypeMap.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getOperationASTFromRequest.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResolversFromSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResponseKeyFromInfo.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/heal.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/helpers.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/implementsAbstractType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isDocumentNode.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/jsutils.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/loaders.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mapSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/memoize.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeDeep.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeIncrementalResult.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/observableToAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-json.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-sdl.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/print-schema-with-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/prune.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/registerAbortSignalListener.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/renameType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rewire.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rootTypes.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/selectionSets.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/stub.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/transformInputValue.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/types.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/updateArgument.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/validate-documents.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/valueMatchesCriteria.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/visitResult.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/withCancel.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/AccumulatorMap.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Interfaces.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Path.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/addTypes.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValue.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/build-operation-for-field.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/collectFields.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/comments.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/debugTimer.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/defaultValueAstFromType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/descriptionFromObject.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/errors.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/executor.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/extractExtensionsFromSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fields.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/filterSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fixSchemaAst.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachDefaultValue.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachField.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-arguments-with-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-fields-with-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-implementing-types.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getArgumentValues.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveExtensions.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveValues.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getObjectTypeFromTypeMap.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getOperationASTFromRequest.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResolversFromSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResponseKeyFromInfo.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/heal.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/helpers.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/implementsAbstractType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/index.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isDocumentNode.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/jsutils.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/loaders.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mapSchema.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/memoize.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeDeep.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeIncrementalResult.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/observableToAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-json.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-sdl.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/prune.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/registerAbortSignalListener.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/renameType.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rewire.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rootTypes.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/selectionSets.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/stub.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/transformInputValue.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/types.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/updateArgument.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/validate-documents.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/valueMatchesCriteria.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/visitResult.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/withCancel.js create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/package.json create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.ts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.cts create mode 100644 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.ts create mode 120000 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-typed-document-node/core create mode 120000 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@whatwg-node/promise-helpers create mode 120000 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/cross-inspect create mode 120000 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/graphql create mode 120000 backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/tslib create mode 100644 backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/LICENSE create mode 100644 backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/package.json create mode 100644 backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/typings/index.d.ts create mode 120000 backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/graphql create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/LICENSE create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/.esm-wrapper.mjs create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js.map create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/package.json create mode 100644 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/readme.md create mode 120000 backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/sparse-bitfield create mode 100644 backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/tests/index.js create mode 120000 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/aspromise create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/data/file.txt create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/util/fs.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/suite.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/array.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyArray.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyObject.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/object.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/.npmignore create mode 100644 backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/tests/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/LICENSE create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/README.md create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.d.ts create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.js create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/package.json create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/utf8.txt create mode 100644 backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/index.js create mode 100644 backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/LICENSE create mode 100644 backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/README.md create mode 100644 backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.cjs create mode 100644 backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.cts create mode 100644 backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.js create mode 100644 backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/package.json create mode 100755 backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/LICENSE create mode 100755 backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/README.md create mode 100755 backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/index.d.ts create mode 100755 backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/package.json create mode 100644 backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/LICENSE create mode 100644 backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/README.md create mode 100644 backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/index.d.ts create mode 100644 backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/package.json create mode 120000 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/webidl-conversions create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/LICENSE create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/README.md create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/index.d.ts create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL-impl.d.ts create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL.d.ts create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams-impl.d.ts create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams.d.ts create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/package.json create mode 100644 backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/webidl2js-wrapper.d.ts create mode 100644 backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/index.js create mode 100644 backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/package.json create mode 100644 backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/esm/index.js create mode 100644 backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/package.json create mode 100644 backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.cts create mode 100644 backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.ts create mode 120000 backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/tslib create mode 100644 backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/LICENSE.md create mode 100644 backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/README.md create mode 100644 backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/lib/index.js create mode 100644 backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/package.json create mode 120000 backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/retry create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.eslintrc create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.nycrc create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/LICENSE create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/README.md create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.d.ts create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/package.json create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/test/index.js create mode 100644 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/tsconfig.json create mode 120000 backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/possible-typed-array-names create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/LICENSE create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/README.md create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/index.js create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/read.js create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/json.js create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/raw.js create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/text.js create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/urlencoded.js create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/utils.js create mode 100644 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/package.json create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/bytes create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/content-type create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/debug create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/http-errors create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/iconv-lite create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/on-finished create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/qs create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/raw-body create mode 120000 backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/type-is create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/LICENSE.md create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/README.md create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/bson.d.ts create mode 100755 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/etc/prepare.js create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js.map create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs.map create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs.map create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs.map create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.rn.cjs create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.rn.cjs.map create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/package.json create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/binary.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson_value.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/code.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/constants.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/db_ref.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/decimal128.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/double.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/error.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/extended_json.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/index.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/int_32.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/long.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/max_key.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/min_key.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/objectid.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parse_utf8.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/calculate_size.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/deserializer.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/index.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/parse_to_elements.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/serializer.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/utils.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/regexp.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/symbol.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/timestamp.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/byte_utils.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/latin.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/node_byte_utils.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/number_utils.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/string_utils.ts create mode 100644 backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/web_byte_utils.ts create mode 100644 backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/History.md create mode 100644 backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/LICENSE create mode 100644 backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/Readme.md create mode 100644 backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/index.js create mode 100644 backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/package.json create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.eslintrc create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.nycrc create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/LICENSE create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/README.md create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.d.ts create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.d.ts create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.d.ts create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.d.ts create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.d.ts create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/package.json create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.d.ts create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/test/index.js create mode 100644 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/tsconfig.json create mode 120000 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/function-bind create mode 120000 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind-apply-helpers create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintignore create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintrc create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.nycrc create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/LICENSE create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/README.md create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/callBound.js create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/package.json create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/callBound.js create mode 100644 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/index.js create mode 120000 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/es-define-property create mode 120000 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/get-intrinsic create mode 120000 backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/set-function-length create mode 120000 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bind-apply-helpers create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.eslintrc create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.nycrc create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/LICENSE create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/README.md create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.d.ts create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/package.json create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/test/index.js create mode 100644 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/tsconfig.json create mode 120000 backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/get-intrinsic create mode 100644 backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/HISTORY.md create mode 100644 backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/LICENSE create mode 100644 backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/README.md create mode 100644 backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js create mode 100644 backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/package.json create mode 100644 backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/LICENSE create mode 100644 backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/README.md create mode 100644 backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.d.ts create mode 100644 backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js create mode 100644 backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js.map create mode 100644 backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/package.json create mode 100644 backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/LICENSE create mode 100644 backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/README.md create mode 100644 backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js create mode 100644 backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/package.json create mode 120000 backend/node_modules/.pnpm/cors@2.8.6/node_modules/object-assign create mode 120000 backend/node_modules/.pnpm/cors@2.8.6/node_modules/vary create mode 100644 backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/index.js create mode 100644 backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/package.json create mode 100644 backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/esm/index.js create mode 100644 backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/package.json create mode 100644 backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.cts create mode 100644 backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.ts create mode 120000 backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/tslib create mode 100644 backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/LICENSE create mode 100644 backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/README.md create mode 100644 backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/package.json create mode 100644 backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js create mode 100644 backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js create mode 100644 backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js create mode 100644 backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js create mode 120000 backend/node_modules/.pnpm/debug@4.4.3/node_modules/ms create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.eslintrc create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.nycrc create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/LICENSE create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/README.md create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.d.ts create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/package.json create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/test/index.js create mode 100644 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/tsconfig.json create mode 120000 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-define-property create mode 120000 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/gopd create mode 100644 backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/History.md create mode 100644 backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/LICENSE create mode 100644 backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/Readme.md create mode 100644 backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js create mode 100644 backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/lib/browser/index.js create mode 100644 backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/package.json create mode 120000 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/call-bind-apply-helpers create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.eslintrc create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.nycrc create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/LICENSE create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/README.md create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.d.ts create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/package.json create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.d.ts create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.js create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/get.js create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/index.js create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/set.js create mode 100644 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/tsconfig.json create mode 120000 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/gopd create mode 100644 backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/LICENSE create mode 100644 backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/README.md create mode 100644 backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js create mode 100644 backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/package.json create mode 100644 backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/LICENSE create mode 100644 backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/README.md create mode 100644 backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js create mode 100644 backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/package.json create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.eslintrc create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.nycrc create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/LICENSE create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/README.md create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.d.ts create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/package.json create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/test/index.js create mode 100644 backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/tsconfig.json create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.eslintrc create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/LICENSE create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/README.md create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.d.ts create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.d.ts create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/package.json create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.d.ts create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.d.ts create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.d.ts create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/test/index.js create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/tsconfig.json create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.d.ts create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.d.ts create mode 100644 backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js create mode 120000 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-errors create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.eslintrc create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/LICENSE create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/README.md create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.d.ts create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.js create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.d.ts create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.js create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.d.ts create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.js create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.d.ts create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.js create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/package.json create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/test/index.js create mode 100644 backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/tsconfig.json create mode 100644 backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/LICENSE create mode 100644 backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/Readme.md create mode 100644 backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js create mode 100644 backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/package.json create mode 120000 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/debug create mode 120000 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/encodeurl create mode 120000 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/escape-html create mode 100644 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/HISTORY.md create mode 100644 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/LICENSE create mode 100644 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/README.md create mode 100644 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/index.js create mode 100644 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/package.json create mode 120000 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/on-finished create mode 120000 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/parseurl create mode 120000 backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/statuses create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.editorconfig create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.eslintrc create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/SECURITY.md create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.nycrc create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/LICENSE create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/README.md create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.d.ts create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/package.json create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/test/test.js create mode 100644 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/tsconfig.json create mode 120000 backend/node_modules/.pnpm/for-each@0.3.5/node_modules/is-callable create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.eslintrc create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/SECURITY.md create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.nycrc create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/LICENSE create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/README.md create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/package.json create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/.eslintrc create mode 100644 backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/index.js create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/call-bind-apply-helpers create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-define-property create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-object-atoms create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/function-bind create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.eslintrc create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.nycrc create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/LICENSE create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/README.md create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/package.json create mode 100644 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/test/GetIntrinsic.js create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-proto create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/gopd create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/has-symbols create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/hasown create mode 120000 backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/math-intrinsics create mode 120000 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/dunder-proto create mode 120000 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/es-object-atoms create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.eslintrc create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.nycrc create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/LICENSE create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.d.ts create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/README.md create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.d.ts create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.d.ts create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/package.json create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/test/index.js create mode 100644 backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/tsconfig.json create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.eslintrc create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/LICENSE create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/README.md create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.d.ts create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.d.ts create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/package.json create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/test/index.js create mode 100644 backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/tsconfig.json create mode 120000 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/LICENSE create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/README.md create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.map create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js.map create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts.map create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js.map create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/loader.js create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/main.js create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/package.json create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.js.flow create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.ts create mode 100644 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/tests.ts create mode 120000 backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/tslib create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/LICENSE create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/NotSupportedTSVersion.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/README.md create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/package.json create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.mts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.ts create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js.map create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs create mode 100644 backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs.map create mode 120000 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/es-define-property create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.eslintrc create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.nycrc create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/LICENSE create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/README.md create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/package.json create mode 100644 backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/test/index.js create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.eslintrc create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.nycrc create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/LICENSE create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/README.md create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.d.ts create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/package.json create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.d.ts create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/index.js create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/core-js.js create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/tests.js create mode 100644 backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/tsconfig.json create mode 120000 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-symbols create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.eslintrc create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.nycrc create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/LICENSE create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/README.md create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.d.ts create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.js create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/package.json create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.d.ts create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/index.js create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/core-js.js create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/tests.js create mode 100644 backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/tsconfig.json create mode 120000 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/function-bind create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.nycrc create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/LICENSE create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/README.md create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/eslint.config.mjs create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.d.ts create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/package.json create mode 100644 backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/tsconfig.json create mode 120000 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/depd create mode 100644 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/HISTORY.md create mode 100644 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/LICENSE create mode 100644 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/README.md create mode 100644 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js create mode 100644 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/package.json create mode 120000 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/inherits create mode 120000 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/setprototypeof create mode 120000 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/statuses create mode 120000 backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/toidentifier create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/LICENSE create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/README.md create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-codec.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-data.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/index.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/internal.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-codec.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data-generated.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/big5-added.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp936.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp949.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp950.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/eucjp.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gbk-added.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/shiftjis.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf16.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf32.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf7.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/bom-handling.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/helpers/merge-exports.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.d.ts create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/streams.js create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/package.json create mode 100644 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/types/encodings.d.ts create mode 120000 backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/safer-buffer create mode 100644 backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/LICENSE create mode 100644 backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/README.md create mode 100644 backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js create mode 100644 backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js create mode 100644 backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/package.json create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.editorconfig create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.eslintrc create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.nycrc create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/LICENSE create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/README.md create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/package.json create mode 100644 backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/test/index.js create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.editorconfig create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.eslintrc create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.nycrc create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/LICENSE create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/README.md create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.d.ts create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/package.json create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/test/index.js create mode 100644 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/tsconfig.json create mode 120000 backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/which-typed-array create mode 100644 backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/LICENSE create mode 100644 backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/README.md create mode 100644 backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js create mode 100644 backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/package.json create mode 100644 backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/LICENSE create mode 100644 backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/README.md create mode 100644 backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/SECURITY.md create mode 100644 backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.d.ts create mode 100644 backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.js create mode 100644 backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/package.json create mode 100644 backend/node_modules/.pnpm/lock.yaml create mode 100644 backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/LICENSE create mode 100644 backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/README.md create mode 100644 backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/index.js create mode 100644 backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/package.json create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/.editorconfig create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/CONTRIBUTING.md create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/Gruntfile.js create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/LICENSE-MIT create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/README.md create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/_config.yml create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/bower.json create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/index.html create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/script.js create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/styles.css create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.js create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.min.js create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/index.d.ts create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/lib/loglevel.js create mode 100644 backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/package.json create mode 100644 backend/node_modules/.pnpm/long@4.0.0/node_modules/long/LICENSE create mode 100644 backend/node_modules/.pnpm/long@4.0.0/node_modules/long/README.md create mode 100644 backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js create mode 100644 backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js.map create mode 100644 backend/node_modules/.pnpm/long@4.0.0/node_modules/long/index.js create mode 100644 backend/node_modules/.pnpm/long@4.0.0/node_modules/long/package.json create mode 100644 backend/node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/LICENSE.md create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/README.md create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/package.json create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/package.json create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js.map create mode 100644 backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/package.json create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.eslintrc create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/LICENSE create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/README.md create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/package.json create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.d.ts create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/test/index.js create mode 100644 backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/tsconfig.json create mode 100644 backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/HISTORY.md create mode 100644 backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/LICENSE create mode 100644 backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/README.md create mode 100644 backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/index.js create mode 100644 backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/package.json create mode 100644 backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/.travis.yml create mode 100644 backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/LICENSE create mode 100644 backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/README.md create mode 100644 backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.js create mode 100644 backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/package.json create mode 100644 backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/test.js create mode 100644 backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/HISTORY.md create mode 100644 backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/LICENSE create mode 100644 backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/README.md create mode 100644 backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/db.json create mode 100644 backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js create mode 100644 backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/package.json create mode 120000 backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-db create mode 100644 backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/HISTORY.md create mode 100644 backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/LICENSE create mode 100644 backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/README.md create mode 100644 backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js create mode 100644 backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/mimeScore.js create mode 100644 backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/package.json create mode 120000 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/@types/whatwg-url create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/LICENSE create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/README.md create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.d.ts create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js.map create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.d.ts create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js.map create mode 100644 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/package.json create mode 120000 backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/whatwg-url create mode 120000 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/@mongodb-js/saslprep create mode 120000 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/bson create mode 120000 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb-connection-string-url create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/LICENSE.md create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/README.md create mode 100755 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/etc/prepare.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/auth_provider.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/execute_operation.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/execute_operation.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js.map create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/mongodb.d.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/package.json create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/admin.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bson.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/common.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/ordered.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/unordered.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/change_stream.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/auto_encrypter.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/client_encryption.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/errors.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/kms_options.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/mongocryptd_manager.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/aws.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/azure.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/index.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/state_machine.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/auth_provider.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws4.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws_temporary_credentials.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/gssapi.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/automated_callback_workflow.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_machine_workflow.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_workflow.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/command_builders.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/gcp_machine_workflow.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/human_callback_workflow.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_cache.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/plain.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/providers.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/scram.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/x509.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/command_monitoring_events.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/commands.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connect.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool_events.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/errors.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/handshake/client_metadata.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/metrics.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/stream_description.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/compression.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/constants.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_data.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_demand/document.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/responses.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/shared.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/collection.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/connection_string.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/constants.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/abstract_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/aggregation_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/change_stream_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/client_bulk_write_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/explainable_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/find_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_collections_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_indexes_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_search_indexes_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/run_command_cursor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/db.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/deps.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/encrypter.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/error.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/explain.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/download.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/index.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/upload.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/index.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client_auth_providers.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_logger.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_types.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/aggregate.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/client_bulk_write.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/command_builder.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/common.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/executor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/results_merger.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/command.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/count.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/create_collection.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/delete.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/distinct.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/drop.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/end_sessions.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/estimated_document_count.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/execute_operation.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find_and_modify.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/get_more.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/indexes.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/insert.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/kill_cursors.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_collections.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_databases.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/operation.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/profiling_level.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/remove_user.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/rename.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/run_command.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/create.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/drop.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/update.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/set_profiling_level.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/stats.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/update.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/validate_collection.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_concern.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_preference.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/runtime_adapters.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/common.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/events.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/monitor.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_description.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection_events.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/srv_polling.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology_description.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sessions.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sort.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/timeout.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/transactions.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/utils.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/write_concern.ts create mode 100644 backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/tsconfig.json create mode 120000 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/@standard-schema/spec create mode 120000 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/kareem create mode 120000 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongodb create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/LICENSE.md create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/README.md create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/SECURITY.md create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/eslint.config.mjs create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/aggregate.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/bigint.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/boolean.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/date.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/decimal128.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/double.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/int32.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/number.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/objectid.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/string.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/uuid.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/collection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connectionState.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/constants.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/aggregationCursor.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/changeStream.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/queryCursor.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/document.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/driver.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/SPEC.md create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/browserMissingSchema.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkSaveIncompleteError.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkWriteError.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/cast.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/createCollectionsError.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/divergentArray.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/eachAsyncMultiError.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/invalidSchemaOption.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/messages.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/missingSchema.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/mongooseError.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/notFound.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectExpected.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectParameter.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/overwriteModel.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelSave.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelValidate.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/serverSelection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/setOptionError.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strict.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strictPopulate.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/syncIndexes.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validation.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validator.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/version.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/arrayDepth.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/buildMiddlewareFilter.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/clone.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/common.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/cursor/eachAsync.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyDefaults.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyTimestamps.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyVirtuals.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/compile.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/isInPathsToSave.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/each.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/error/combinePathErrors.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/firstKey.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/get.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getConstructorName.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getFunctionName.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/immediate.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isAsyncFunction.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isBsonType.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isMongooseObject.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isObject.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPOJO.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPromise.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isSimpleValidator.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/minimize.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyHooks.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyMethods.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStatics.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/castBulkWrite.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/discriminator.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/omitUndefined.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/once.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/parallelLimit.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/parentPaths.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/setDottedPath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pathTrie.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pluralize.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignVals.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getVirtual.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/splitPopulateQuery.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/validateRef.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/printJestWarning.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/processConnectionOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/applyProjection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isExclusive.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isInclusive.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isSubpath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/parseProjection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/cast$expr.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castFilterPath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castUpdate.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleImmutable.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/isOperator.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/trusted.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/validOps.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/addAutoId.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyPlugins.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getIndexes.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getPath.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleIdOption.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/idGetter.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/merge.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/specialProperties.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/symbols.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timers.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isAtlas.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isSSLError.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/castArrayFilters.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/modifiedPaths.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/updateValidators.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/internal.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/model.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/modifiedPathsSnapshot.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/mongoose.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/populateOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/propertyOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/saveOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaArrayOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaBufferOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDateOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaMapOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaNumberOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaObjectIdOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaStringOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaTypeOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaUnionOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/virtualOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/saveSubdocs.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/sharding.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/trackTransaction.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/query.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/queryHelpers.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/array.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/bigint.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/boolean.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/buffer.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/date.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/decimal128.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArray.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArrayElement.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/double.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/int32.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/map.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/mixed.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/number.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/objectId.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/bitwise.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/exists.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/geospatial.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/helpers.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/text.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/type.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/string.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/subdocument.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/symbols.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/union.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/uuid.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schemaType.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/standardSchema/convertErrorToIssues.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/stateMachine.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/tracing.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/isMongooseArray.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/methods/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/arraySubdocument.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/buffer.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/decimal128.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/methods/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/double.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/index.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/map.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/objectid.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/subdocument.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/uuid.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/utils.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/validOptions.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/virtualType.js create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/package.json create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/tstyche.json create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/aggregate.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/augmentations.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/callback.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/collection.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/connection.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/cursor.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/document.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/error.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/expressions.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/helpers.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/index.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/indexes.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferhydrateddoctype.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferrawdoctype.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferschematype.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/middlewares.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/models.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/mongooseoptions.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/pipelinestage.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/populate.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/query.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schemaoptions.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schematypes.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/session.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/tracing.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/types.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/utility.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/validation.d.ts create mode 100644 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/virtuals.d.ts create mode 120000 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mpath create mode 120000 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mquery create mode 120000 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/ms create mode 120000 backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/sift create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/.travis.yml create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/History.md create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/LICENSE create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/README.md create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/SECURITY.md create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/index.js create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/index.js create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/stringToParts.js create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/package.json create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/.eslintrc.yml create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/index.js create mode 100644 backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/stringToParts.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/ISSUE_TEMPLATE.md create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/History.md create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/LICENSE create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/README.md create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/SECURITY.md create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/collection.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/index.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/node.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/env.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/mquery.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/permissions.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/utils.js create mode 100644 backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/package.json create mode 100644 backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js create mode 100644 backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/license.md create mode 100644 backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/package.json create mode 100644 backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/readme.md create mode 120000 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/content-type create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/LICENSE create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/README.md create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/index.js create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/accept.js create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/charset.js create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/encoding.js create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/language.js create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/mediaType.js create mode 100644 backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/package.json create mode 100755 backend/node_modules/.pnpm/node_modules/.bin/apollo-pbjs create mode 100755 backend/node_modules/.pnpm/node_modules/.bin/apollo-pbts create mode 100755 backend/node_modules/.pnpm/node_modules/.bin/sha.js create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/cache-control-types create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/protobufjs create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/server-gateway-interface create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/usage-reporting-protobuf create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.createhash create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.dropunuseddefinitions create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.fetcher create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.isnodelike create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.keyvaluecache create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.logger create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.printwithreducedwhitespace create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.removealiases create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.sortast create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.stripsensitiveliterals create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.usagereporting create mode 120000 backend/node_modules/.pnpm/node_modules/@apollo/utils.withrequired create mode 120000 backend/node_modules/.pnpm/node_modules/@graphql-tools/merge create mode 120000 backend/node_modules/.pnpm/node_modules/@graphql-tools/schema create mode 120000 backend/node_modules/.pnpm/node_modules/@graphql-tools/utils create mode 120000 backend/node_modules/.pnpm/node_modules/@graphql-typed-document-node/core create mode 120000 backend/node_modules/.pnpm/node_modules/@mongodb-js/saslprep create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/aspromise create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/base64 create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/codegen create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/eventemitter create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/fetch create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/float create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/inquire create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/path create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/pool create mode 120000 backend/node_modules/.pnpm/node_modules/@protobufjs/utf8 create mode 120000 backend/node_modules/.pnpm/node_modules/@standard-schema/spec create mode 120000 backend/node_modules/.pnpm/node_modules/@types/long create mode 120000 backend/node_modules/.pnpm/node_modules/@types/webidl-conversions create mode 120000 backend/node_modules/.pnpm/node_modules/@types/whatwg-url create mode 120000 backend/node_modules/.pnpm/node_modules/@whatwg-node/promise-helpers create mode 120000 backend/node_modules/.pnpm/node_modules/async-retry create mode 120000 backend/node_modules/.pnpm/node_modules/available-typed-arrays create mode 120000 backend/node_modules/.pnpm/node_modules/body-parser create mode 120000 backend/node_modules/.pnpm/node_modules/bson create mode 120000 backend/node_modules/.pnpm/node_modules/bytes create mode 120000 backend/node_modules/.pnpm/node_modules/call-bind create mode 120000 backend/node_modules/.pnpm/node_modules/call-bind-apply-helpers create mode 120000 backend/node_modules/.pnpm/node_modules/call-bound create mode 120000 backend/node_modules/.pnpm/node_modules/content-type create mode 120000 backend/node_modules/.pnpm/node_modules/cors create mode 120000 backend/node_modules/.pnpm/node_modules/cross-inspect create mode 120000 backend/node_modules/.pnpm/node_modules/debug create mode 120000 backend/node_modules/.pnpm/node_modules/define-data-property create mode 120000 backend/node_modules/.pnpm/node_modules/depd create mode 120000 backend/node_modules/.pnpm/node_modules/dunder-proto create mode 120000 backend/node_modules/.pnpm/node_modules/ee-first create mode 120000 backend/node_modules/.pnpm/node_modules/encodeurl create mode 120000 backend/node_modules/.pnpm/node_modules/es-define-property create mode 120000 backend/node_modules/.pnpm/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/node_modules/es-object-atoms create mode 120000 backend/node_modules/.pnpm/node_modules/escape-html create mode 120000 backend/node_modules/.pnpm/node_modules/finalhandler create mode 120000 backend/node_modules/.pnpm/node_modules/for-each create mode 120000 backend/node_modules/.pnpm/node_modules/function-bind create mode 120000 backend/node_modules/.pnpm/node_modules/get-intrinsic create mode 120000 backend/node_modules/.pnpm/node_modules/get-proto create mode 120000 backend/node_modules/.pnpm/node_modules/gopd create mode 120000 backend/node_modules/.pnpm/node_modules/has-property-descriptors create mode 120000 backend/node_modules/.pnpm/node_modules/has-symbols create mode 120000 backend/node_modules/.pnpm/node_modules/has-tostringtag create mode 120000 backend/node_modules/.pnpm/node_modules/hasown create mode 120000 backend/node_modules/.pnpm/node_modules/http-errors create mode 120000 backend/node_modules/.pnpm/node_modules/iconv-lite create mode 120000 backend/node_modules/.pnpm/node_modules/inherits create mode 120000 backend/node_modules/.pnpm/node_modules/is-callable create mode 120000 backend/node_modules/.pnpm/node_modules/is-typed-array create mode 120000 backend/node_modules/.pnpm/node_modules/isarray create mode 120000 backend/node_modules/.pnpm/node_modules/kareem create mode 120000 backend/node_modules/.pnpm/node_modules/lodash.sortby create mode 120000 backend/node_modules/.pnpm/node_modules/loglevel create mode 120000 backend/node_modules/.pnpm/node_modules/long create mode 120000 backend/node_modules/.pnpm/node_modules/lru-cache create mode 120000 backend/node_modules/.pnpm/node_modules/math-intrinsics create mode 120000 backend/node_modules/.pnpm/node_modules/media-typer create mode 120000 backend/node_modules/.pnpm/node_modules/memory-pager create mode 120000 backend/node_modules/.pnpm/node_modules/mime-db create mode 120000 backend/node_modules/.pnpm/node_modules/mime-types create mode 120000 backend/node_modules/.pnpm/node_modules/mongodb create mode 120000 backend/node_modules/.pnpm/node_modules/mongodb-connection-string-url create mode 120000 backend/node_modules/.pnpm/node_modules/mpath create mode 120000 backend/node_modules/.pnpm/node_modules/mquery create mode 120000 backend/node_modules/.pnpm/node_modules/ms create mode 120000 backend/node_modules/.pnpm/node_modules/negotiator create mode 120000 backend/node_modules/.pnpm/node_modules/object-assign create mode 120000 backend/node_modules/.pnpm/node_modules/object-inspect create mode 120000 backend/node_modules/.pnpm/node_modules/on-finished create mode 120000 backend/node_modules/.pnpm/node_modules/parseurl create mode 120000 backend/node_modules/.pnpm/node_modules/possible-typed-array-names create mode 120000 backend/node_modules/.pnpm/node_modules/punycode create mode 120000 backend/node_modules/.pnpm/node_modules/qs create mode 120000 backend/node_modules/.pnpm/node_modules/raw-body create mode 120000 backend/node_modules/.pnpm/node_modules/retry create mode 120000 backend/node_modules/.pnpm/node_modules/safe-buffer create mode 120000 backend/node_modules/.pnpm/node_modules/safer-buffer create mode 120000 backend/node_modules/.pnpm/node_modules/set-function-length create mode 120000 backend/node_modules/.pnpm/node_modules/setprototypeof create mode 120000 backend/node_modules/.pnpm/node_modules/sha.js create mode 120000 backend/node_modules/.pnpm/node_modules/side-channel create mode 120000 backend/node_modules/.pnpm/node_modules/side-channel-list create mode 120000 backend/node_modules/.pnpm/node_modules/side-channel-map create mode 120000 backend/node_modules/.pnpm/node_modules/side-channel-weakmap create mode 120000 backend/node_modules/.pnpm/node_modules/sift create mode 120000 backend/node_modules/.pnpm/node_modules/sparse-bitfield create mode 120000 backend/node_modules/.pnpm/node_modules/statuses create mode 120000 backend/node_modules/.pnpm/node_modules/to-buffer create mode 120000 backend/node_modules/.pnpm/node_modules/toidentifier create mode 120000 backend/node_modules/.pnpm/node_modules/tr46 create mode 120000 backend/node_modules/.pnpm/node_modules/tslib create mode 120000 backend/node_modules/.pnpm/node_modules/type-is create mode 120000 backend/node_modules/.pnpm/node_modules/typed-array-buffer create mode 120000 backend/node_modules/.pnpm/node_modules/unpipe create mode 120000 backend/node_modules/.pnpm/node_modules/vary create mode 120000 backend/node_modules/.pnpm/node_modules/webidl-conversions create mode 120000 backend/node_modules/.pnpm/node_modules/whatwg-mimetype create mode 120000 backend/node_modules/.pnpm/node_modules/whatwg-url create mode 120000 backend/node_modules/.pnpm/node_modules/which-typed-array create mode 100644 backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js create mode 100644 backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/license create mode 100644 backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/package.json create mode 100644 backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/readme.md create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.eslintrc create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.nycrc create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/LICENSE create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/all.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/circular.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/fn.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/inspect.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package-support.json create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package.json create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/readme.markdown create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test-core-js.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/bigint.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/browser/dom.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/circular.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/deep.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/element.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/err.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fakes.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fn.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/global.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/has.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/holes.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/indent-option.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/inspect.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/lowbyte.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/number.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/quoteStyle.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/toStringTag.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/undef.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/values.js create mode 100644 backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js create mode 120000 backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/ee-first create mode 100644 backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/HISTORY.md create mode 100644 backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/LICENSE create mode 100644 backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/README.md create mode 100644 backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js create mode 100644 backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/package.json create mode 100644 backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/HISTORY.md create mode 100644 backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/LICENSE create mode 100644 backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/README.md create mode 100644 backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js create mode 100644 backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/package.json create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.eslintrc create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/LICENSE create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/README.md create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.d.ts create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.js create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/package.json create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/test/index.js create mode 100644 backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/tsconfig.json create mode 100644 backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/LICENSE-MIT.txt create mode 100644 backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/README.md create mode 100644 backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/package.json create mode 100644 backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.es6.js create mode 100644 backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.js create mode 120000 backend/node_modules/.pnpm/qs@6.16.0/node_modules/es-define-property create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.editorconfig create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/SECURITY.md create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/THREAT_MODEL.md create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.nycrc create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/LICENSE.md create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/README.md create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/dist/qs.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/eslint.config.mjs create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/formats.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/index.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/parse.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/stringify.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/utils.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/package.json create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/empty-keys-cases.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/parse.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/stringify.js create mode 100644 backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/utils.js create mode 120000 backend/node_modules/.pnpm/qs@6.16.0/node_modules/side-channel create mode 120000 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/bytes create mode 120000 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/http-errors create mode 120000 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/iconv-lite create mode 100644 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/LICENSE create mode 100644 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/README.md create mode 100644 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.d.ts create mode 100644 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.js create mode 100644 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/package.json create mode 120000 backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/unpipe create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/License create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/README.md create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/dns.js create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/stop.js create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js create mode 100644 backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/package.json create mode 100644 backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/LICENSE create mode 100644 backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/README.md create mode 100644 backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.d.ts create mode 100644 backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js create mode 100644 backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/package.json create mode 100644 backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/LICENSE create mode 100644 backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Porting-Buffer.md create mode 100644 backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Readme.md create mode 100644 backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/dangerous.js create mode 100644 backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/package.json create mode 100644 backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js create mode 100644 backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/tests.js create mode 120000 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/define-data-property create mode 120000 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/function-bind create mode 120000 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/get-intrinsic create mode 120000 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/gopd create mode 120000 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/has-property-descriptors create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.eslintrc create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.nycrc create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/LICENSE create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/README.md create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.d.ts create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.js create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.d.ts create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/package.json create mode 100644 backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/tsconfig.json create mode 100644 backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/LICENSE create mode 100644 backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/README.md create mode 100644 backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.d.ts create mode 100644 backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.js create mode 100644 backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/package.json create mode 100644 backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/test/index.js create mode 120000 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/inherits create mode 120000 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/safe-buffer create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/.eslintrc create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/LICENSE create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/README.md create mode 100755 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/bin.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/hash.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/index.js create mode 100755 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/node_modules/.bin/sha.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/package.json create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha1.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha224.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha256.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha384.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha512.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/hash.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/test.js create mode 100644 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/vectors.js create mode 120000 backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/to-buffer create mode 120000 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/object-inspect create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.editorconfig create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.eslintrc create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.nycrc create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/LICENSE create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/README.md create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.d.ts create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/list.d.ts create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/package.json create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/test/index.js create mode 100644 backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/tsconfig.json create mode 120000 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/call-bound create mode 120000 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/get-intrinsic create mode 120000 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/object-inspect create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.editorconfig create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.eslintrc create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.nycrc create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/LICENSE create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/README.md create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.d.ts create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/package.json create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/test/index.js create mode 100644 backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/tsconfig.json create mode 120000 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/call-bound create mode 120000 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/get-intrinsic create mode 120000 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/object-inspect create mode 120000 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-map create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.editorconfig create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.eslintrc create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.nycrc create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/LICENSE create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/README.md create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.d.ts create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/package.json create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/test/index.js create mode 100644 backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/tsconfig.json create mode 120000 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/object-inspect create mode 120000 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-list create mode 120000 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-map create mode 120000 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-weakmap create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.editorconfig create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.eslintrc create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.nycrc create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/LICENSE create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/README.md create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.d.ts create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.js create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/package.json create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/test/index.js create mode 100644 backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/tsconfig.json create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/MIT-LICENSE.txt create mode 100755 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/README.md create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js.map create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js.map create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.d.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.js create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/core.d.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.d.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js.map create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/operations.d.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/utils.d.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/package.json create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js.map create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js.map create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/core.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/index.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/operations.ts create mode 100644 backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/utils.ts create mode 120000 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/memory-pager create mode 100644 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.npmignore create mode 100644 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.travis.yml create mode 100644 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/LICENSE create mode 100644 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/README.md create mode 100644 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.js create mode 100644 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/package.json create mode 100644 backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/test.js create mode 100644 backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/HISTORY.md create mode 100644 backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/LICENSE create mode 100644 backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/README.md create mode 100644 backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/codes.json create mode 100644 backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js create mode 100644 backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/package.json create mode 120000 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/isarray create mode 120000 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/safe-buffer create mode 100644 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/LICENSE create mode 100644 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/README.md create mode 100644 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/index.js create mode 100644 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/package.json create mode 120000 backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/typed-array-buffer create mode 100644 backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/HISTORY.md create mode 100644 backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/LICENSE create mode 100644 backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/README.md create mode 100644 backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/index.js create mode 100644 backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/package.json create mode 120000 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/punycode create mode 100644 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/LICENSE.md create mode 100644 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/README.md create mode 100644 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.js create mode 100644 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.json create mode 100644 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.js create mode 100644 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.js create mode 100644 backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/package.json create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/CopyrightNotice.txt create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/LICENSE.txt create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/README.md create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/SECURITY.md create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.d.ts create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.js create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/package.json create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/package.json create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.html create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.html create mode 100644 backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.js create mode 120000 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/content-type create mode 120000 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/media-typer create mode 120000 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/mime-types create mode 100644 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/HISTORY.md create mode 100644 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/LICENSE create mode 100644 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/README.md create mode 100644 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/index.js create mode 100644 backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/package.json create mode 120000 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/call-bound create mode 120000 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/es-errors create mode 120000 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/is-typed-array create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.eslintrc create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.nycrc create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/LICENSE create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/README.md create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.d.ts create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.js create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/package.json create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/test/index.js create mode 100644 backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/tsconfig.json create mode 100644 backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/HISTORY.md create mode 100644 backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/LICENSE create mode 100644 backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/README.md create mode 100644 backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/index.js create mode 100644 backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/package.json create mode 100644 backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/HISTORY.md create mode 100644 backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/LICENSE create mode 100644 backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/README.md create mode 100644 backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js create mode 100644 backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/package.json create mode 100644 backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/LICENSE.md create mode 100644 backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/README.md create mode 100644 backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.js create mode 100644 backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/package.json create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/LICENSE.txt create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/README.md create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type-parameters.js create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type.js create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/parser.js create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/serializer.js create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.js create mode 100644 backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/package.json create mode 120000 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/tr46 create mode 120000 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/webidl-conversions create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/LICENSE.txt create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/README.md create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/VoidFunction.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.js create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/package.json create mode 100644 backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.js create mode 120000 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/available-typed-arrays create mode 120000 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bind create mode 120000 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bound create mode 120000 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/for-each create mode 120000 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/get-proto create mode 120000 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/gopd create mode 120000 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/has-tostringtag create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.editorconfig create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.github/FUNDING.yml create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.nycrc create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/CHANGELOG.md create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/LICENSE create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/README.md create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.d.ts create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.js create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/package.json create mode 100644 backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/tsconfig.json create mode 120000 backend/node_modules/@apollo/server create mode 120000 backend/node_modules/graphql create mode 120000 backend/node_modules/graphql-tag create mode 120000 backend/node_modules/mongoose create mode 100644 backend/package.json create mode 100644 backend/pnpm-lock.yaml create mode 100644 backend/pnpm-workspace.yaml create mode 100644 frontend/.gitignore create mode 100644 frontend/README.md create mode 100644 frontend/eslint.config.js create mode 100644 frontend/index.html create mode 100644 frontend/package.json create mode 100644 frontend/pnpm-lock.yaml create mode 100644 frontend/public/favicon.svg create mode 100644 frontend/public/icons.svg create mode 100644 frontend/src/App.css create mode 100644 frontend/src/App.tsx create mode 100644 frontend/src/assets/hero.png create mode 100644 frontend/src/assets/react.svg create mode 100644 frontend/src/assets/vite.svg create mode 100644 frontend/src/index.css create mode 100644 frontend/src/main.tsx create mode 100644 frontend/tsconfig.app.json create mode 100644 frontend/tsconfig.json create mode 100644 frontend/tsconfig.node.json create mode 100644 frontend/vite.config.ts diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..d57d3ffb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug Report +about: Report a bug in the project. +title: "bug: " +labels: ["bug"] +assignees: '' +--- + +## Beskrivelse + +## Steg for å reprodusere +1. Gå til '...' +2. Klikk på '...' +3. Se feil + +## Forventet atferd + +## Faktisk atferd + +## Miljø +- Browser: +- OS: +- Branch/commit: diff --git a/.github/ISSUE_TEMPLATE/cleanup.md b/.github/ISSUE_TEMPLATE/cleanup.md new file mode 100644 index 00000000..79bcec8e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/cleanup.md @@ -0,0 +1,15 @@ +--- +name: Clean Up +about: Something's messy or unclear in the code. +title: "cleanup: " +labels: ["cleanup"] +assignees: '' +--- + +## Hva er rotete/uklart +Fil(er)/funksjon(er) det gjelder. + +## Forslag til opprydding + +## Risiko +Påvirker dette annen funksjonalitet? diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..3ba13e0c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 00000000..58d5a876 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,14 @@ +--- +name: Documentation +about: Suggest updates or additions to documentation. +title: "docs: " +labels: ["documentation"] +assignees: '' +--- + +## Hva mangler/er feil + +## Hvor +Fil/seksjon (README, kode-kommentarer, etc.) + +## Forslag til endring diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 00000000..30ed6a93 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,19 @@ +--- +name: Feature +about: Propose a new feature or improvement. +title: "feat: " +labels: ["enhancement"] +assignees: '' +--- + +## Beskrivelse +Hva skal implementeres og hvorfor. + +## Akseptansekriterier +- [ ] +- [ ] + +## Design/mockup +Lenke eller skisse hvis relevant. + +## Avhengigheter diff --git a/.github/ISSUE_TEMPLATE/fix.md b/.github/ISSUE_TEMPLATE/fix.md new file mode 100644 index 00000000..d3231803 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/fix.md @@ -0,0 +1,14 @@ +--- +name: Fix +about: Report a small fix that needs to be made. +title: "fix: " +labels: ["fix"] +assignees: '' +--- + +## Hva må fikses + +## Hvor +Fil/linje/komponent. + +## Forventet resultat diff --git a/.github/ISSUE_TEMPLATE/task.md b/.github/ISSUE_TEMPLATE/task.md new file mode 100644 index 00000000..5a393490 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/task.md @@ -0,0 +1,15 @@ +--- +name: Task +about: Provide general feedback or inquiries. +title: "task: " +labels: ["general"] +assignees: '' +--- + +## Hva skal gjøres + +## Hvorfor + +## Definition of done +- [ ] +- [ ] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..b21c8042 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +## Description + +## Related Issue +Liste over relaterte issues som er med i denne PR. + +Includes: #, ... + +## Changes made +- [ ] Bug fix +- [ ] Ny funksjonalitet +- [ ] Refactor +- [ ] Dokumentasjon +- [ ] Testing + +## Checklist +- [ ] Testet lokalt +- [ ] Dokumentert endringer +- [ ] Sjekket for feilmeldinger + +## Skjermbilder +Hvis UI-endring. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..64cd4333 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/frontend" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + + - package-ecosystem: "npm" + directory: "/backend" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..e7b7a335 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI + +on: + pull_request: + branches: [main, dev] + push: + branches: [main, dev] + +jobs: + lint-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + workspace: [frontend, backend] + defaults: + run: + working-directory: ${{ matrix.workspace }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: ${{ matrix.workspace }}/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Typecheck + run: npm run typecheck --if-present + + - name: Test + run: npm run test --if-present --run diff --git a/backend/node_modules/.modules.yaml b/backend/node_modules/.modules.yaml new file mode 100644 index 00000000..fefb20d1 --- /dev/null +++ b/backend/node_modules/.modules.yaml @@ -0,0 +1,391 @@ +{ + "hoistedDependencies": { + "@apollo/cache-control-types@1.0.3(graphql@17.0.2)": { + "@apollo/cache-control-types": "private" + }, + "@apollo/server-gateway-interface@2.0.0(graphql@17.0.2)": { + "@apollo/server-gateway-interface": "private" + }, + "@apollo/usage-reporting-protobuf@4.1.2": { + "@apollo/usage-reporting-protobuf": "private" + }, + "@apollo/utils.createhash@3.0.1": { + "@apollo/utils.createhash": "private" + }, + "@apollo/utils.fetcher@3.1.0": { + "@apollo/utils.fetcher": "private" + }, + "@apollo/utils.isnodelike@3.0.0": { + "@apollo/utils.isnodelike": "private" + }, + "@apollo/utils.keyvaluecache@4.0.0": { + "@apollo/utils.keyvaluecache": "private" + }, + "@apollo/utils.logger@3.0.0": { + "@apollo/utils.logger": "private" + }, + "@apollo/utils.usagereporting@2.1.0(graphql@17.0.2)": { + "@apollo/utils.usagereporting": "private" + }, + "@apollo/utils.withrequired@3.0.0": { + "@apollo/utils.withrequired": "private" + }, + "@graphql-tools/schema@10.1.1(graphql@17.0.2)": { + "@graphql-tools/schema": "private" + }, + "async-retry@1.3.3": { + "async-retry": "private" + }, + "body-parser@2.3.0": { + "body-parser": "private" + }, + "content-type@1.0.5": { + "content-type": "private" + }, + "cors@2.8.6": { + "cors": "private" + }, + "finalhandler@2.1.1": { + "finalhandler": "private" + }, + "loglevel@1.9.2": { + "loglevel": "private" + }, + "lru-cache@11.5.3": { + "lru-cache": "private" + }, + "negotiator@1.1.0": { + "negotiator": "private" + }, + "whatwg-mimetype@4.0.0": { + "whatwg-mimetype": "private" + }, + "tslib@2.8.1": { + "tslib": "private" + }, + "@standard-schema/spec@1.1.0": { + "@standard-schema/spec": "private" + }, + "kareem@3.4.0": { + "kareem": "private" + }, + "mongodb@7.6.0": { + "mongodb": "private" + }, + "mpath@0.9.0": { + "mpath": "private" + }, + "mquery@6.0.0": { + "mquery": "private" + }, + "ms@2.1.3": { + "ms": "private" + }, + "sift@17.1.3": { + "sift": "private" + }, + "@apollo/protobufjs@1.2.8": { + "@apollo/protobufjs": "private" + }, + "sha.js@2.4.12": { + "sha.js": "private" + }, + "@apollo/utils.dropunuseddefinitions@2.0.1(graphql@17.0.2)": { + "@apollo/utils.dropunuseddefinitions": "private" + }, + "@apollo/utils.printwithreducedwhitespace@2.0.1(graphql@17.0.2)": { + "@apollo/utils.printwithreducedwhitespace": "private" + }, + "@apollo/utils.removealiases@2.0.1(graphql@17.0.2)": { + "@apollo/utils.removealiases": "private" + }, + "@apollo/utils.sortast@2.0.1(graphql@17.0.2)": { + "@apollo/utils.sortast": "private" + }, + "@apollo/utils.stripsensitiveliterals@2.0.1(graphql@17.0.2)": { + "@apollo/utils.stripsensitiveliterals": "private" + }, + "@graphql-tools/merge@9.2.4(graphql@17.0.2)": { + "@graphql-tools/merge": "private" + }, + "@graphql-tools/utils@12.0.1(graphql@17.0.2)": { + "@graphql-tools/utils": "private" + }, + "retry@0.13.1": { + "retry": "private" + }, + "bytes@3.1.2": { + "bytes": "private" + }, + "debug@4.4.3": { + "debug": "private" + }, + "http-errors@2.0.1": { + "http-errors": "private" + }, + "iconv-lite@0.7.3": { + "iconv-lite": "private" + }, + "on-finished@2.4.1": { + "on-finished": "private" + }, + "qs@6.16.0": { + "qs": "private" + }, + "raw-body@3.0.2": { + "raw-body": "private" + }, + "type-is@2.1.0": { + "type-is": "private" + }, + "object-assign@4.1.1": { + "object-assign": "private" + }, + "vary@1.1.2": { + "vary": "private" + }, + "encodeurl@2.0.0": { + "encodeurl": "private" + }, + "escape-html@1.0.3": { + "escape-html": "private" + }, + "parseurl@1.3.3": { + "parseurl": "private" + }, + "statuses@2.0.2": { + "statuses": "private" + }, + "@mongodb-js/saslprep@1.5.4": { + "@mongodb-js/saslprep": "private" + }, + "bson@7.3.3": { + "bson": "private" + }, + "mongodb-connection-string-url@7.0.2": { + "mongodb-connection-string-url": "private" + }, + "@protobufjs/aspromise@1.1.2": { + "@protobufjs/aspromise": "private" + }, + "@protobufjs/base64@1.1.2": { + "@protobufjs/base64": "private" + }, + "@protobufjs/codegen@2.0.5": { + "@protobufjs/codegen": "private" + }, + "@protobufjs/eventemitter@1.1.1": { + "@protobufjs/eventemitter": "private" + }, + "@protobufjs/fetch@1.1.1": { + "@protobufjs/fetch": "private" + }, + "@protobufjs/float@1.0.2": { + "@protobufjs/float": "private" + }, + "@protobufjs/inquire@1.1.2": { + "@protobufjs/inquire": "private" + }, + "@protobufjs/path@1.1.2": { + "@protobufjs/path": "private" + }, + "@protobufjs/pool@1.1.0": { + "@protobufjs/pool": "private" + }, + "@protobufjs/utf8@1.1.2": { + "@protobufjs/utf8": "private" + }, + "@types/long@4.0.2": { + "@types/long": "private" + }, + "long@4.0.0": { + "long": "private" + }, + "lodash.sortby@4.7.0": { + "lodash.sortby": "private" + }, + "@graphql-typed-document-node/core@3.2.0(graphql@17.0.2)": { + "@graphql-typed-document-node/core": "private" + }, + "@whatwg-node/promise-helpers@1.3.2": { + "@whatwg-node/promise-helpers": "private" + }, + "cross-inspect@1.0.1": { + "cross-inspect": "private" + }, + "sparse-bitfield@3.0.3": { + "sparse-bitfield": "private" + }, + "depd@2.0.0": { + "depd": "private" + }, + "inherits@2.0.4": { + "inherits": "private" + }, + "setprototypeof@1.2.0": { + "setprototypeof": "private" + }, + "toidentifier@1.0.1": { + "toidentifier": "private" + }, + "safer-buffer@2.1.2": { + "safer-buffer": "private" + }, + "@types/whatwg-url@13.0.0": { + "@types/whatwg-url": "private" + }, + "whatwg-url@14.2.0": { + "whatwg-url": "private" + }, + "ee-first@1.1.1": { + "ee-first": "private" + }, + "es-define-property@1.0.1": { + "es-define-property": "private" + }, + "side-channel@1.1.1": { + "side-channel": "private" + }, + "unpipe@1.0.0": { + "unpipe": "private" + }, + "safe-buffer@5.2.1": { + "safe-buffer": "private" + }, + "to-buffer@1.2.2": { + "to-buffer": "private" + }, + "media-typer@1.1.1": { + "media-typer": "private" + }, + "mime-types@3.0.2": { + "mime-types": "private" + }, + "@types/webidl-conversions@7.0.3": { + "@types/webidl-conversions": "private" + }, + "mime-db@1.54.0": { + "mime-db": "private" + }, + "es-errors@1.3.0": { + "es-errors": "private" + }, + "object-inspect@1.13.4": { + "object-inspect": "private" + }, + "side-channel-list@1.0.1": { + "side-channel-list": "private" + }, + "side-channel-map@1.0.1": { + "side-channel-map": "private" + }, + "side-channel-weakmap@1.0.2": { + "side-channel-weakmap": "private" + }, + "memory-pager@1.5.0": { + "memory-pager": "private" + }, + "isarray@2.0.5": { + "isarray": "private" + }, + "typed-array-buffer@1.0.3": { + "typed-array-buffer": "private" + }, + "tr46@5.1.1": { + "tr46": "private" + }, + "webidl-conversions@7.0.0": { + "webidl-conversions": "private" + }, + "call-bound@1.0.4": { + "call-bound": "private" + }, + "get-intrinsic@1.3.0": { + "get-intrinsic": "private" + }, + "punycode@2.3.1": { + "punycode": "private" + }, + "is-typed-array@1.1.15": { + "is-typed-array": "private" + }, + "call-bind-apply-helpers@1.0.2": { + "call-bind-apply-helpers": "private" + }, + "which-typed-array@1.1.24": { + "which-typed-array": "private" + }, + "function-bind@1.1.2": { + "function-bind": "private" + }, + "es-object-atoms@1.1.2": { + "es-object-atoms": "private" + }, + "get-proto@1.0.1": { + "get-proto": "private" + }, + "gopd@1.2.0": { + "gopd": "private" + }, + "has-symbols@1.1.0": { + "has-symbols": "private" + }, + "hasown@2.0.4": { + "hasown": "private" + }, + "math-intrinsics@1.1.0": { + "math-intrinsics": "private" + }, + "available-typed-arrays@1.0.7": { + "available-typed-arrays": "private" + }, + "call-bind@1.0.9": { + "call-bind": "private" + }, + "for-each@0.3.5": { + "for-each": "private" + }, + "has-tostringtag@1.0.2": { + "has-tostringtag": "private" + }, + "possible-typed-array-names@1.1.0": { + "possible-typed-array-names": "private" + }, + "set-function-length@1.2.2": { + "set-function-length": "private" + }, + "is-callable@1.2.7": { + "is-callable": "private" + }, + "dunder-proto@1.0.1": { + "dunder-proto": "private" + }, + "define-data-property@1.1.4": { + "define-data-property": "private" + }, + "has-property-descriptors@1.0.2": { + "has-property-descriptors": "private" + } + }, + "hoistPattern": [ + "*" + ], + "included": { + "dependencies": true, + "devDependencies": true, + "optionalDependencies": true + }, + "layoutVersion": 5, + "nodeLinker": "isolated", + "packageManager": "pnpm@12.6.0", + "pendingBuilds": [], + "prunedAt": "Fri, 25 Sep 2026 12:50:33 GMT", + "publicHoistPattern": [], + "skipped": [], + "storeDir": "/home/albert/.local/share/pnpm/store/v11", + "virtualStoreDir": ".pnpm", + "virtualStoreDirMaxLength": 120, + "allowBuilds": { + "@apollo/protobufjs": false + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm-workspace-state-v1.json b/backend/node_modules/.pnpm-workspace-state-v1.json new file mode 100644 index 00000000..b4b2a6de --- /dev/null +++ b/backend/node_modules/.pnpm-workspace-state-v1.json @@ -0,0 +1,38 @@ +{ + "lastValidatedTimestamp": 1790340706223, + "projects": { + "/home/albert/Documents/projects/webutvikling/project2/backend": { + "name": "backend", + "version": "1.0.0" + } + }, + "pnpmfiles": [], + "filteredInstall": false, + "settings": { + "allowBuilds": { + "@apollo/protobufjs": false + }, + "autoInstallPeers": true, + "catalogs": {}, + "dedupeDirectDeps": false, + "dedupeInjectedDeps": true, + "dedupePeerDependents": true, + "dedupePeers": false, + "dev": true, + "excludeLinksFromLockfile": false, + "hoistPattern": [ + "*" + ], + "hoistWorkspacePackages": true, + "injectWorkspacePackages": false, + "linkWorkspacePackages": false, + "minimumReleaseAge": 1440, + "minimumReleaseAgeIgnoreMissingTime": true, + "nodeLinker": "isolated", + "optional": true, + "peersSuffixMaxLength": 1000, + "preferWorkspacePackages": false, + "production": true, + "publicHoistPattern": [] + } +} diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/LICENSE b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/README.md b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/README.md new file mode 100644 index 00000000..e6d069d7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/README.md @@ -0,0 +1,6 @@ +# Cache Control types + +This package exports various TypeScript types related to Apollo Server's cache +policy calculation. + +Specifically, it gives a type-safe way to get the `info.cacheControl` field in resolvers. Either declare your resolver's `info` argument to be of type `GraphQLResolveInfoWithCacheControl` (perhaps with the graphql-code-generator typescript-resolvers customResolveInfo option), or use the `maybeCacheControlFromInfo` or `cacheControlFromInfo` functions to extract `info.cacheControl` in a type-safe way. diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts new file mode 100644 index 00000000..cb3c994b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts @@ -0,0 +1,22 @@ +import type { GraphQLCompositeType, GraphQLResolveInfo } from 'graphql'; +export type CacheScope = 'PUBLIC' | 'PRIVATE'; +export interface CacheHint { + maxAge?: number; + scope?: CacheScope; +} +export interface CachePolicy extends CacheHint { + replace(hint: CacheHint): void; + restrict(hint: CacheHint): void; + policyIfCacheable(): Required | null; +} +export interface ResolveInfoCacheControl { + cacheHint: CachePolicy; + setCacheHint(hint: CacheHint): void; + cacheHintFromType(t: GraphQLCompositeType): CacheHint | undefined; +} +export interface GraphQLResolveInfoWithCacheControl extends Omit { + cacheControl: ResolveInfoCacheControl; +} +export declare function maybeCacheControlFromInfo(info: GraphQLResolveInfo): ResolveInfoCacheControl | null; +export declare function cacheControlFromInfo(info: GraphQLResolveInfo): ResolveInfoCacheControl; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts.map new file mode 100644 index 00000000..76a3b3a1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAMxE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAM9C,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAMD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAK5C,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAO/B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAMhC,iBAAiB,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CACjD;AAMD,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,WAAW,CAAC;IAGvB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAEpC,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,SAAS,GAAG,SAAS,CAAC;CACnE;AAMD,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC;IAYhD,YAAY,EAAE,uBAAuB,CAAC;CACvC;AAKD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,kBAAkB,GACvB,uBAAuB,GAAG,IAAI,CAKhC;AAKD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,kBAAkB,GACvB,uBAAuB,CAgBzB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js new file mode 100644 index 00000000..7fd3141a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cacheControlFromInfo = exports.maybeCacheControlFromInfo = void 0; +function maybeCacheControlFromInfo(info) { + if (info.cacheControl?.cacheHint?.restrict) { + return info.cacheControl; + } + return null; +} +exports.maybeCacheControlFromInfo = maybeCacheControlFromInfo; +function cacheControlFromInfo(info) { + if (!('cacheControl' in info)) { + throw new Error('The `info` argument does not appear to have a cacheControl field. ' + + "Check that you are using Apollo Server 3 or newer and that you aren't using " + + 'ApolloServerPluginCacheControlDisabled.'); + } + if (!info.cacheControl?.cacheHint?.restrict) { + throw new Error('The `info` argument has a cacheControl field but it does not appear to be from Apollo' + + "Server 3 or newer. Check that you are using Apollo Server 3 or newer and that you aren't using " + + 'ApolloServerPluginCacheControlDisabled.'); + } + return info.cacheControl; +} +exports.cacheControlFromInfo = cacheControlFromInfo; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js.map b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js.map new file mode 100644 index 00000000..2647db69 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAmFA,SAAgB,yBAAyB,CACvC,IAAwB;IAExB,IAAK,IAAY,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE;QACnD,OAAQ,IAAY,CAAC,YAAY,CAAC;KACnC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAPD,8DAOC;AAKD,SAAgB,oBAAoB,CAClC,IAAwB;IAExB,IAAI,CAAC,CAAC,cAAc,IAAI,IAAI,CAAC,EAAE;QAC7B,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8EAA8E;YAC9E,yCAAyC,CAC5C,CAAC;KACH;IACD,IAAI,CAAE,IAAY,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE;QACpD,MAAM,IAAI,KAAK,CACb,uFAAuF;YACrF,iGAAiG;YACjG,yCAAyC,CAC5C,CAAC;KACH;IACD,OAAQ,IAAY,CAAC,YAAY,CAAC;AACpC,CAAC;AAlBD,oDAkBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/package.json b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts new file mode 100644 index 00000000..cb3c994b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts @@ -0,0 +1,22 @@ +import type { GraphQLCompositeType, GraphQLResolveInfo } from 'graphql'; +export type CacheScope = 'PUBLIC' | 'PRIVATE'; +export interface CacheHint { + maxAge?: number; + scope?: CacheScope; +} +export interface CachePolicy extends CacheHint { + replace(hint: CacheHint): void; + restrict(hint: CacheHint): void; + policyIfCacheable(): Required | null; +} +export interface ResolveInfoCacheControl { + cacheHint: CachePolicy; + setCacheHint(hint: CacheHint): void; + cacheHintFromType(t: GraphQLCompositeType): CacheHint | undefined; +} +export interface GraphQLResolveInfoWithCacheControl extends Omit { + cacheControl: ResolveInfoCacheControl; +} +export declare function maybeCacheControlFromInfo(info: GraphQLResolveInfo): ResolveInfoCacheControl | null; +export declare function cacheControlFromInfo(info: GraphQLResolveInfo): ResolveInfoCacheControl; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts.map new file mode 100644 index 00000000..76a3b3a1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAMxE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAM9C,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAMD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAK5C,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAO/B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAMhC,iBAAiB,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CACjD;AAMD,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,WAAW,CAAC;IAGvB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAEpC,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,SAAS,GAAG,SAAS,CAAC;CACnE;AAMD,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC;IAYhD,YAAY,EAAE,uBAAuB,CAAC;CACvC;AAKD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,kBAAkB,GACvB,uBAAuB,GAAG,IAAI,CAKhC;AAKD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,kBAAkB,GACvB,uBAAuB,CAgBzB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js new file mode 100644 index 00000000..85bb3809 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js @@ -0,0 +1,20 @@ +export function maybeCacheControlFromInfo(info) { + if (info.cacheControl?.cacheHint?.restrict) { + return info.cacheControl; + } + return null; +} +export function cacheControlFromInfo(info) { + if (!('cacheControl' in info)) { + throw new Error('The `info` argument does not appear to have a cacheControl field. ' + + "Check that you are using Apollo Server 3 or newer and that you aren't using " + + 'ApolloServerPluginCacheControlDisabled.'); + } + if (!info.cacheControl?.cacheHint?.restrict) { + throw new Error('The `info` argument has a cacheControl field but it does not appear to be from Apollo' + + "Server 3 or newer. Check that you are using Apollo Server 3 or newer and that you aren't using " + + 'ApolloServerPluginCacheControlDisabled.'); + } + return info.cacheControl; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js.map b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js.map new file mode 100644 index 00000000..50339756 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAmFA,MAAM,UAAU,yBAAyB,CACvC,IAAwB;IAExB,IAAK,IAAY,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE;QACnD,OAAQ,IAAY,CAAC,YAAY,CAAC;KACnC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAKD,MAAM,UAAU,oBAAoB,CAClC,IAAwB;IAExB,IAAI,CAAC,CAAC,cAAc,IAAI,IAAI,CAAC,EAAE;QAC7B,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8EAA8E;YAC9E,yCAAyC,CAC5C,CAAC;KACH;IACD,IAAI,CAAE,IAAY,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE;QACpD,MAAM,IAAI,KAAK,CACb,uFAAuF;YACrF,iGAAiG;YACjG,yCAAyC,CAC5C,CAAC;KACH;IACD,OAAQ,IAAY,CAAC,YAAY,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/package.json b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/package.json new file mode 100644 index 00000000..7c34deb5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.cjs.tsbuildinfo b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.cjs.tsbuildinfo new file mode 100644 index 00000000..8b3d5148 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.cjs.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/graphql/version.d.ts","../../../node_modules/graphql/jsutils/Maybe.d.ts","../../../node_modules/graphql/language/source.d.ts","../../../node_modules/graphql/jsutils/ObjMap.d.ts","../../../node_modules/graphql/jsutils/Path.d.ts","../../../node_modules/graphql/jsutils/PromiseOrValue.d.ts","../../../node_modules/graphql/language/kinds.d.ts","../../../node_modules/graphql/language/tokenKind.d.ts","../../../node_modules/graphql/language/ast.d.ts","../../../node_modules/graphql/language/location.d.ts","../../../node_modules/graphql/error/GraphQLError.d.ts","../../../node_modules/graphql/language/directiveLocation.d.ts","../../../node_modules/graphql/type/directives.d.ts","../../../node_modules/graphql/type/schema.d.ts","../../../node_modules/graphql/type/definition.d.ts","../../../node_modules/graphql/execution/execute.d.ts","../../../node_modules/graphql/graphql.d.ts","../../../node_modules/graphql/type/scalars.d.ts","../../../node_modules/graphql/type/introspection.d.ts","../../../node_modules/graphql/type/validate.d.ts","../../../node_modules/graphql/type/assertName.d.ts","../../../node_modules/graphql/type/index.d.ts","../../../node_modules/graphql/language/printLocation.d.ts","../../../node_modules/graphql/language/lexer.d.ts","../../../node_modules/graphql/language/parser.d.ts","../../../node_modules/graphql/language/printer.d.ts","../../../node_modules/graphql/language/visitor.d.ts","../../../node_modules/graphql/language/predicates.d.ts","../../../node_modules/graphql/language/index.d.ts","../../../node_modules/graphql/execution/subscribe.d.ts","../../../node_modules/graphql/execution/values.d.ts","../../../node_modules/graphql/execution/index.d.ts","../../../node_modules/graphql/subscription/index.d.ts","../../../node_modules/graphql/utilities/TypeInfo.d.ts","../../../node_modules/graphql/validation/ValidationContext.d.ts","../../../node_modules/graphql/validation/validate.d.ts","../../../node_modules/graphql/validation/specifiedRules.d.ts","../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts","../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts","../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts","../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts","../../../node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts","../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts","../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts","../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts","../../../node_modules/graphql/validation/index.d.ts","../../../node_modules/graphql/error/syntaxError.d.ts","../../../node_modules/graphql/error/locatedError.d.ts","../../../node_modules/graphql/error/index.d.ts","../../../node_modules/graphql/utilities/getIntrospectionQuery.d.ts","../../../node_modules/graphql/utilities/getOperationAST.d.ts","../../../node_modules/graphql/utilities/getOperationRootType.d.ts","../../../node_modules/graphql/utilities/introspectionFromSchema.d.ts","../../../node_modules/graphql/utilities/buildClientSchema.d.ts","../../../node_modules/graphql/utilities/buildASTSchema.d.ts","../../../node_modules/graphql/utilities/extendSchema.d.ts","../../../node_modules/graphql/utilities/lexicographicSortSchema.d.ts","../../../node_modules/graphql/utilities/printSchema.d.ts","../../../node_modules/graphql/utilities/typeFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromASTUntyped.d.ts","../../../node_modules/graphql/utilities/astFromValue.d.ts","../../../node_modules/graphql/utilities/coerceInputValue.d.ts","../../../node_modules/graphql/utilities/concatAST.d.ts","../../../node_modules/graphql/utilities/separateOperations.d.ts","../../../node_modules/graphql/utilities/stripIgnoredCharacters.d.ts","../../../node_modules/graphql/utilities/typeComparators.d.ts","../../../node_modules/graphql/utilities/assertValidName.d.ts","../../../node_modules/graphql/utilities/findBreakingChanges.d.ts","../../../node_modules/graphql/utilities/typedQueryDocumentNode.d.ts","../../../node_modules/graphql/utilities/index.d.ts","../../../node_modules/graphql/index.d.ts","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"78647004e18e4c16b8a2e8345fca9267573d1c5a29e11ddfee71858fd077ef6e","0804044cd0488cb7212ddbc1d0f8e1a5bd32970335dbfc613052304a1b0318f9","b725acb041d2a18fde8f46c48a1408418489c4aa222f559b1ef47bf267cb4be0","85084ae98c1d319e38ef99b1216d3372a9afd7a368022c01c3351b339d52cb58","898ec2410fae172e0a9416448b0838bed286322a5c0c8959e8e39400cd4c5697","692345a43bac37c507fa7065c554258435ab821bbe4fb44b513a70063e932b45","cddd50d7bd9d7fddda91a576db9f61655d1a55e2d870f154485812f6e39d4c15","0539583b089247b73a21eb4a5f7e43208a129df6300d6b829dc1039b79b6c8c4","7aba43bc7764fcd02232382c780c3e99ef8dbfdac3c58605a0b3781fab3d8044","522edc786ed48304671b935cf7d3ed63acc6636ab9888c6e130b97a6aea92b46","1e1ed5600d80406a10428e349af8b6f09949cd5054043ea8588903e8f9e8d705","de21641eb8edcbc08dd0db4ee70eea907cd07fe72267340b5571c92647f10a77","a53039ba614075aeb702271701981babbd0d4f4dcbf319ddee4c08fb8196cc7a","6758f7b72fa4d38f4f4b865516d3d031795c947a45cc24f2cfba43c91446d678","da679a5bb46df3c6d84f637f09e6689d6c2d07e907ea16adc161e4529a4954d6","dc1a664c33f6ddd2791569999db2b3a476e52c5eeb5474768ffa542b136d78c0","bdf7abbd7df4f29b3e0728684c790e80590b69d92ed8d3bf8e66d4bd713941fe","8decb32fc5d44b403b46c3bb4741188df4fbc3c66d6c65669000c5c9cd506523","4beaf337ee755b8c6115ff8a17e22ceab986b588722a52c776b8834af64e0f38","c26dd198f2793bbdcc55103823a2767d6223a7fdb92486c18b86deaf63208354","93551b302a808f226f0846ad8012354f2d53d6dedc33b540d6ca69836781a574","f0ff1c010d5046af3874d3b4df746c6f3921e4b3fbdec61dee0792fc0cb36ccd","778b684ebc6b006fcffeab77d25b34bf6e400100e0ec0c76056e165c6399ab05","463851fa993af55fb0296e0d6afa27407ef91bf6917098dd665aba1200d250c7","67c6de7a9c490bda48eb401bea93904b6bbfc60e47427e887e6a3da6195540be","be8f369f8d7e887eab87a3e4e41f1afcf61bf06056801383152aa83bda1f6a72","352bfb5f3a9d8a9c2464ad2dc0b2dc56a8212650a541fb550739c286dd341de1","a5aae636d9afdacb22d98e4242487436d8296e5a345348325ccc68481fe1b690","d007c769e33e72e51286b816d82cd7c3a280cba714e7f958691155068bd7150a","764150c107451d2fd5b6de305cff0a9dcecf799e08e6f14b5a6748724db46d8a","b04cf223c338c09285010f5308b980ee6d8bfa203824ed2537516f15e92e8c43","4b387f208d1e468193a45a51005b1ed5b666010fc22a15dc1baf4234078b636e","70441eda704feffd132be0c1541f2c7f6bbaafce25cb9b54b181e26af3068e79","d1addb12403afea87a1603121396261a45190886c486c88e1a5d456be17c2049","15d43873064dc8787ca1e4c39149be59183c404d48a8cd5a0ea019bb5fdf8d58","ea4b5d319625203a5a96897b057fddf6017d0f9a902c16060466fe69cc007243","3d06897c536b4aad2b2b015d529270439f2cadd89ca2ff7bd8898ee84898dd88","ab01d8fcb89fae8eda22075153053fefac69f7d9571a389632099e7a53f1922d","bac0ec1f4c61abc7c54ccebb0f739acb0cdbc22b1b19c91854dc142019492961","566b0806f9016fa067b7fecf3951fcc295c30127e5141223393bde16ad04aa4a","8e801abfeda45b1b93e599750a0a8d25074d30d4cc01e3563e56c0ff70edeb68","902997f91b09620835afd88e292eb217fbd55d01706b82b9a014ff408f357559","a3727a926e697919fb59407938bd8573964b3bf543413b685996a47df5645863","83f36c0792d352f641a213ee547d21ea02084a148355aa26b6ef82c4f61c1280","dce7d69c17a438554c11bbf930dec2bee5b62184c0494d74da336daee088ab69","1e8f2cda9735002728017933c54ccea7ebee94b9c68a59a4aac1c9a58aa7da7d","e327a2b222cf9e5c93d7c1ed6468ece2e7b9d738e5da04897f1a99f49d42cca1","65165246b59654ec4e1501dd87927a0ef95d57359709e00e95d1154ad8443bc7","f1bacba19e2fa2eb26c499e36b5ab93d6764f2dba44be3816f12d2bc9ac9a35b","bce38da5fd851520d0cb4d1e6c3c04968cec2faa674ed321c118e97e59872edc","3398f46037f21fb6c33560ceca257259bd6d2ea03737179b61ea9e17cbe07455","6e14fc6c27cb2cb203fe1727bb3a923588f0be8c2604673ad9f879182548daca","12b9bcf8395d33837f301a8e6d545a24dfff80db9e32f8e8e6cf4b11671bb442","04295cc38689e32a4ea194c954ea6604e6afb6f1c102104f74737cb8cf744422","7418f434c136734b23f634e711cf44613ca4c74e63a5ae7429acaee46c7024c8","27d40290b7caba1c04468f2b53cf7112f247f8acdd7c20589cd7decf9f762ad0","2608b8b83639baf3f07316df29202eead703102f1a7e32f74a1b18cf1eee54b5","c93657567a39bd589effe89e863aaadbc339675fca6805ae4d97eafbcce0a05d","909d5db5b3b19f03dfb4a8f1d00cf41d2f679857c28775faf1f10794cbbe9db9","e4504bffce13574bab83ab900b843590d85a0fd38faab7eff83d84ec55de4aff","8ab707f3c833fc1e8a51106b8746c8bc0ce125083ea6200ad881625ae35ce11e","730ddc2386276ac66312edbcc60853fedbb1608a99cb0b1ff82ebf26911dba1f","c1b3fa201aa037110c43c05ea97800eb66fea3f2ecc5f07c6fd47f2b6b5b21d2","636b44188dc6eb326fd566085e6c1c6035b71f839d62c343c299a35888c6f0a9","3b2105bf9823b53c269cabb38011c5a71360c8daabc618fec03102c9514d230c","f96e63eb56e736304c3aef6c745b9fe93db235ddd1fec10b45319c479de1a432","acb4f3cee79f38ceba975e7ee3114eb5cd96ccc02742b0a4c7478b4619f87cd6","cfc85d17c1493b6217bad9052a8edc332d1fde81a919228edab33c14aa762939","eebda441c4486c26de7a8a7343ebbc361d2b0109abff34c2471e45e34a93020a","727b4b8eb62dd98fa4e3a0937172c1a0041eb715b9071c3de96dad597deddcab","708e2a347a1b9868ccdb48f3e43647c6eccec47b8591b220afcafc9e7eeb3784","6bb598e2d45a170f302f113a5b68e518c8d7661ae3b59baf076be9120afa4813","c28e058db8fed2c81d324546f53d2a7aaefff380cbe70f924276dbad89acd7d1","ebe8f07bb402102c5a764b0f8e34bd92d6f50bd7ac61a2452e76b80e02f9bb4b","826a98cb79deab45ccc4e5a8b90fa64510b2169781a7cbb83c4a0a8867f4cc58","618189f94a473b7fdc5cb5ba8b94d146a0d58834cd77cd24d56995f41643ccd5","5baadaca408128671536b3cb77fea44330e169ada70ce50b902c8d992fe64cf1","a4cc469f3561ea3edc57e091f4c9dcaf7485a70d3836be23a6945db46f0acd0b","91b0965538a5eaafa8c09cf9f62b46d6125aa1b3c0e0629dce871f5f41413f90","2978e33a00b4b5fb98337c5e473ab7337030b2f69d1480eccef0290814af0d51","ba71e9777cb5460e3278f0934fd6354041cb25853feca542312807ce1f18e611","608dbaf8c8bb64f4024013e73d7107c16dba4664999a8c6e58f3e71545e48f66","61937cefd7f4d6fa76013d33d5a3c5f9b0fc382e90da34790764a0d17d6277fb","af7db74826f455bfef6a55a188eb6659fd85fdc16f720a89a515c48724ee4c42","d6ce98a960f1b99a72de771fb0ba773cb202c656b8483f22d47d01d68f59ea86","2a47dc4a362214f31689870f809c7d62024afb4297a37b22cb86f679c4d04088","42d907ac511459d7c4828ee4f3f81cc331a08dc98d7b3cb98e3ff5797c095d2e","63d010bff70619e0cdf7900e954a7e188d3175461182f887b869c312a77ecfbd","1452816d619e636de512ca98546aafb9a48382d570af1473f0432a9178c4b1ff","9e3e3932fe16b9288ec8c948048aef4edf1295b09a5412630d63f4a42265370e","8bdba132259883bac06056f7bacd29a4dcf07e3f14ce89edb022fe9b78dcf9b3","5a5406107d9949d83e1225273bcee1f559bb5588942907d923165d83251a0e37","ca0ca4ca5ad4772161ee2a99741d616fea780d777549ba9f05f4a24493ab44e1","e7ee7be996db0d7cce41a85e4cae3a5fc86cf26501ad94e0a20f8b6c1c55b2d4","72263ae386d6a49392a03bde2f88660625da1eca5df8d95120d8ccf507483d20","b498375d015f01585269588b6221008aae6f0c0dc53ead8796ace64bdfcf62ea","c37aa3657fa4d1e7d22565ae609b1370c6b92bafb8c92b914403d45f0e610ddc","34534c0ead52cc753bdfdd486430ef67f615ace54a4c0e5a3652b4116af84d6d","a1079b54643537f75fa4f4bb963d787a302bddbe3a6001c4b0a524b746e6a9de","7fc9b18b6aafa8a1fc1441670c6c9da63e3d7942c7f451300c48bafd988545e9",{"version":"6dc344651e78ab0b0c878196458e12894c8a5563faecb43bea823c065a03b90d","signature":"6a0d02ea3868cbbecffc40e314a8cf76ae69b14102b14b007b6d43edd7d4b078"},"4c2c4f53e8eedd970f8afa369d7371544fb6231bf95e659f8602e09abe74d5a5",{"version":"9c9461d480b1812281abffc647107904970791c170cd0ab97563daa10c6e0171","affectsGlobalScope":true},"c2b5085f47e41d6940bbc5b0d3bd7cc0037c752efb18aecd243c9cf83ad0c0b7","3143a5add0467b83150961ecd33773b561a1207aec727002aa1d70333068eb1b","f87191b7fafe7a0edad375710d99f900e49cef560b66bf309cf3f8e1b7177126","586af7d2abe2f9d59c5e757c370087d6c6baea81b033250f43b8df808d6dfb33",{"version":"1a048ff164b8d9609f5de3139d4e37f6e8a82af82087ac414b9208f52ef8aac7","affectsGlobalScope":true},"3111079f3cb5f2b9c812ca3f46161562bce5bfb355e915f46ed46c41714dc1c3","e7bee4a6d9bb78afa390b25e0ce97a2f94787a1eb17f0a16e732dcbebba3f3ee","b32b6b16cb0bda68199582ad6f22242d07ee75fac9b1f28a98cd838afc5eea45","4441ee4119824bfaebc49308559edd7545978f9cb41a40f115074e1031dde75f",{"version":"60693a88462d0e97900123b5bf7c73e146ce0cc94da46a61fe6775b430d2ff05","affectsGlobalScope":true},{"version":"588c69eda58b9202676ec7ca11a72c3762819b46a0ed72462c769846153c447c","affectsGlobalScope":true},"ae064ed4f855716b7ff348639ddcd6a6d354a72fae82f506608a7dc9266aa24c","92f019c55b21c939616f6a48f678e714ac7b109444cbbf23ad69310ce66ecbdc","bba259efdf9ab95e0c7d3cc8e99250f56bb6b31d6129efdf733ca4eb1d01feea","97f837637f01e274ada9de388e99b1a5c5a82ae4184f8c924209fe201f4ffc9e","139fd681eff7771a38d0c025d13c7a11c5474f6aab61e01c41511d71496df173","f614c3f61e46ccc2cb58702d5a158338ea57ee09099fde5db4cfc63ed0ce4d74","44e42ed6ec9c4451ebe89524e80ac8564e9dd0988c56e6c58f393c810730595d","a504c109b872b0e653549bd258eb06584c148c98d79406c7516995865a6d5089","155865f5f76db0996cd5e20cc5760613ea170ee5ad594c1f3d76fcaa05382161","e92852d673c836fc64e10c38640abcd67c463456e5df55723ac699b8e6ab3a8a","4455c78d226d061b1203c7614c6c6eb5f4f9db5f00d44ff47d0112de8766fbc4",{"version":"ec369bb9d97c4dc09dd2a4093b7ca3ba69ad284831fccac8a1977785e9e38ce5","affectsGlobalScope":true},"4465a636f5f6e9665a90e30691862c9e0a3ac2edc0e66296704f10865e924f2a","9af781f03d44f5635ed7844be0ce370d9d595d4b4ec67cad88f0fac03255257e","f9fd4c3ef6de27fa0e256f4e75b61711c4be05a3399f7714621d3edc832e36b0","e49290b7a927995c0d7e6b2b9c8296284b68a9036d9966531de65185269258d7","aa95cc73ea5315e4f6fc8c6db43d49e3b7de3780cae20a4f1319032809013038","874ca809b79276460011480a2829f4c8d4db29416dd411f71efbf8f497f0ac09","6c903bceaf3f3bc04f2d4c7dcd89ce9fb148b3ba0a5f5408d8f6de2b7eecc7ea","504d049d9e550a65466b73ca39da6469ab41786074ea1d16d37c8853f9f6ab2e","23a28f834a078986bbf58f4e3705956983ff81c3c2493f3db3e5f0e8a9507779","4febdf7f3ec92706c58e0b4e8159cd6de718284ef384260b07c9641c13fc70ce",{"version":"7d0a3356909df08e5df9af2cfd43e8780f24bb12d07b00daaf7ed2a891fa60e5","affectsGlobalScope":true},"7335933d9f30dcfd2c4b6080a8b78e81912a7fcefb1dafccb67ca4cb4b3ac23d","a6bfe9de9adef749010c118104b071d14943802ff0614732b47ce4f1c3e383cd","4c3d0e10396646db4a1e917fb852077ee77ae62e512913bef9cccc2bb0f8bd0e","3b220849d58140dcc6718f5b52dcd29fdb79c45bc28f561cbd29eb1cac6cce13","0ee22fce41f7417a24c808d266e91b850629113c104713a35854393d55994beb","22d1b1d965baba05766613e2e6c753bb005d4386c448cafd72c309ba689e8c24",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"c6c0bd221bb1e94768e94218f8298e47633495529d60cae7d8da9374247a1cf5"],"root":[144],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./cjs","removeComments":true,"rootDir":"../src","sourceMap":true,"strict":true,"target":7},"fileIdsList":[[145],[147],[148,153],[149,157,158,165,174],[149,150,157,165],[151,181],[152,153,158,166],[153,174],[154,155,157,165],[155],[156,157],[157],[157,158,159,174,180],[158,159],[157,160,165,174,180],[157,158,160,161,165,174,177,180],[160,162,174,177,180],[145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187],[157,163],[164,180],[155,157,165,174],[166],[167],[147,168],[169,179],[170],[171],[157,172],[172,173,181,183],[157,174],[175],[176],[165,174,177],[178],[165,179],[160,171,180],[181],[174,182],[183],[184],[157,159,174,180,183,185],[174,186],[45,46,52,53],[54,118,119],[45,52,54],[46,54],[45,47,48,49,52,54,57,58],[48,59,73,74],[45,52,57,58,59],[45,47,52,54,56,57,58],[45,46,57,58,59],[44,60,65,72,75,76,117,120,142],[45],[46,50,51],[46,50,51,52,53,55,66,67,68,69,70,71],[46,51,52],[46],[45,46,51,52,54,67],[52],[46,52,53],[50,52],[59,73],[45,47,48,49,52,57],[45,52,55,58],[48,56,57,58,61,62,63,64],[58],[45,47,52,54,56,58],[54,57],[45,52,56,57,58,70],[54],[45,52,58],[46,52,57,68],[57,121],[54,58],[52,57],[57],[45,55],[45,52],[52,57,58],[77,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141],[57,58],[47,52],[45,47,52,58],[45,47,52],[45,52,54,56,57,58,70,77],[78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116],[70,78],[78],[45,52,54,57,77,78],[143]],"referencedMap":[[145,1],[147,2],[148,3],[149,4],[150,5],[151,6],[152,7],[153,8],[154,9],[155,10],[156,11],[157,12],[158,13],[159,14],[160,15],[161,16],[162,17],[188,18],[163,19],[164,20],[165,21],[166,22],[167,23],[168,24],[169,25],[170,26],[171,27],[172,28],[173,29],[174,30],[175,31],[176,32],[177,33],[178,34],[179,35],[180,36],[181,37],[182,38],[183,39],[184,40],[185,41],[186,42],[54,43],[120,44],[119,45],[118,46],[59,47],[75,48],[73,49],[74,50],[60,51],[143,52],[48,53],[52,54],[72,55],[67,56],[53,57],[68,58],[71,59],[66,60],[69,59],[70,61],[76,62],[58,63],[56,64],[65,65],[62,66],[61,66],[57,67],[63,68],[77,69],[139,70],[133,71],[126,72],[125,73],[134,74],[135,59],[127,75],[140,76],[121,77],[122,78],[123,79],[142,80],[124,73],[128,76],[129,81],[136,82],[137,57],[138,81],[130,79],[141,59],[131,83],[132,84],[78,85],[117,86],[81,87],[82,87],[83,87],[84,87],[85,87],[86,87],[87,87],[88,87],[107,87],[89,87],[90,87],[91,87],[92,87],[93,87],[94,87],[114,87],[95,87],[96,87],[97,87],[112,87],[98,87],[113,87],[99,87],[110,87],[111,87],[100,87],[101,87],[102,87],[108,87],[109,87],[103,87],[104,87],[105,87],[106,87],[115,87],[116,87],[80,88],[79,89],[144,90]],"exportedModulesMap":[[145,1],[147,2],[148,3],[149,4],[150,5],[151,6],[152,7],[153,8],[154,9],[155,10],[156,11],[157,12],[158,13],[159,14],[160,15],[161,16],[162,17],[188,18],[163,19],[164,20],[165,21],[166,22],[167,23],[168,24],[169,25],[170,26],[171,27],[172,28],[173,29],[174,30],[175,31],[176,32],[177,33],[178,34],[179,35],[180,36],[181,37],[182,38],[183,39],[184,40],[185,41],[186,42],[54,43],[120,44],[119,45],[118,46],[59,47],[75,48],[73,49],[74,50],[60,51],[143,52],[48,53],[52,54],[72,55],[67,56],[53,57],[68,58],[71,59],[66,60],[69,59],[70,61],[76,62],[58,63],[56,64],[65,65],[62,66],[61,66],[57,67],[63,68],[77,69],[139,70],[133,71],[126,72],[125,73],[134,74],[135,59],[127,75],[140,76],[121,77],[122,78],[123,79],[142,80],[124,73],[128,76],[129,81],[136,82],[137,57],[138,81],[130,79],[141,59],[131,83],[132,84],[78,85],[117,86],[81,87],[82,87],[83,87],[84,87],[85,87],[86,87],[87,87],[88,87],[107,87],[89,87],[90,87],[91,87],[92,87],[93,87],[94,87],[114,87],[95,87],[96,87],[97,87],[112,87],[98,87],[113,87],[99,87],[110,87],[111,87],[100,87],[101,87],[102,87],[108,87],[109,87],[103,87],[104,87],[105,87],[106,87],[115,87],[116,87],[80,88],[79,89],[144,90]],"semanticDiagnosticsPerFile":[145,147,148,149,150,151,152,153,154,155,156,157,158,159,146,187,160,161,162,188,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,54,120,119,118,59,75,73,74,60,143,45,47,48,49,52,55,72,50,67,53,68,71,66,69,46,51,70,76,64,58,56,65,62,61,57,63,77,139,133,126,125,134,135,127,140,121,122,123,142,124,128,129,136,137,138,130,141,131,132,78,117,81,82,83,84,85,86,87,88,107,89,90,91,92,93,94,114,95,96,97,112,98,113,99,110,111,100,101,102,108,109,103,104,105,106,115,116,80,79,44,42,43,9,8,2,10,11,12,13,14,15,16,17,3,4,21,18,19,20,22,23,24,5,25,26,27,28,6,32,29,30,31,33,7,34,39,40,35,36,37,38,1,41,144],"latestChangedDtsFile":"./cjs/index.d.ts"},"version":"5.1.3"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.tsbuildinfo b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.tsbuildinfo new file mode 100644 index 00000000..8d5cf3a5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/graphql/version.d.ts","../../../node_modules/graphql/jsutils/Maybe.d.ts","../../../node_modules/graphql/language/source.d.ts","../../../node_modules/graphql/jsutils/ObjMap.d.ts","../../../node_modules/graphql/jsutils/Path.d.ts","../../../node_modules/graphql/jsutils/PromiseOrValue.d.ts","../../../node_modules/graphql/language/kinds.d.ts","../../../node_modules/graphql/language/tokenKind.d.ts","../../../node_modules/graphql/language/ast.d.ts","../../../node_modules/graphql/language/location.d.ts","../../../node_modules/graphql/error/GraphQLError.d.ts","../../../node_modules/graphql/language/directiveLocation.d.ts","../../../node_modules/graphql/type/directives.d.ts","../../../node_modules/graphql/type/schema.d.ts","../../../node_modules/graphql/type/definition.d.ts","../../../node_modules/graphql/execution/execute.d.ts","../../../node_modules/graphql/graphql.d.ts","../../../node_modules/graphql/type/scalars.d.ts","../../../node_modules/graphql/type/introspection.d.ts","../../../node_modules/graphql/type/validate.d.ts","../../../node_modules/graphql/type/assertName.d.ts","../../../node_modules/graphql/type/index.d.ts","../../../node_modules/graphql/language/printLocation.d.ts","../../../node_modules/graphql/language/lexer.d.ts","../../../node_modules/graphql/language/parser.d.ts","../../../node_modules/graphql/language/printer.d.ts","../../../node_modules/graphql/language/visitor.d.ts","../../../node_modules/graphql/language/predicates.d.ts","../../../node_modules/graphql/language/index.d.ts","../../../node_modules/graphql/execution/subscribe.d.ts","../../../node_modules/graphql/execution/values.d.ts","../../../node_modules/graphql/execution/index.d.ts","../../../node_modules/graphql/subscription/index.d.ts","../../../node_modules/graphql/utilities/TypeInfo.d.ts","../../../node_modules/graphql/validation/ValidationContext.d.ts","../../../node_modules/graphql/validation/validate.d.ts","../../../node_modules/graphql/validation/specifiedRules.d.ts","../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts","../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts","../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts","../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts","../../../node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts","../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts","../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts","../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts","../../../node_modules/graphql/validation/index.d.ts","../../../node_modules/graphql/error/syntaxError.d.ts","../../../node_modules/graphql/error/locatedError.d.ts","../../../node_modules/graphql/error/index.d.ts","../../../node_modules/graphql/utilities/getIntrospectionQuery.d.ts","../../../node_modules/graphql/utilities/getOperationAST.d.ts","../../../node_modules/graphql/utilities/getOperationRootType.d.ts","../../../node_modules/graphql/utilities/introspectionFromSchema.d.ts","../../../node_modules/graphql/utilities/buildClientSchema.d.ts","../../../node_modules/graphql/utilities/buildASTSchema.d.ts","../../../node_modules/graphql/utilities/extendSchema.d.ts","../../../node_modules/graphql/utilities/lexicographicSortSchema.d.ts","../../../node_modules/graphql/utilities/printSchema.d.ts","../../../node_modules/graphql/utilities/typeFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromASTUntyped.d.ts","../../../node_modules/graphql/utilities/astFromValue.d.ts","../../../node_modules/graphql/utilities/coerceInputValue.d.ts","../../../node_modules/graphql/utilities/concatAST.d.ts","../../../node_modules/graphql/utilities/separateOperations.d.ts","../../../node_modules/graphql/utilities/stripIgnoredCharacters.d.ts","../../../node_modules/graphql/utilities/typeComparators.d.ts","../../../node_modules/graphql/utilities/assertValidName.d.ts","../../../node_modules/graphql/utilities/findBreakingChanges.d.ts","../../../node_modules/graphql/utilities/typedQueryDocumentNode.d.ts","../../../node_modules/graphql/utilities/index.d.ts","../../../node_modules/graphql/index.d.ts","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"78647004e18e4c16b8a2e8345fca9267573d1c5a29e11ddfee71858fd077ef6e","0804044cd0488cb7212ddbc1d0f8e1a5bd32970335dbfc613052304a1b0318f9","b725acb041d2a18fde8f46c48a1408418489c4aa222f559b1ef47bf267cb4be0","85084ae98c1d319e38ef99b1216d3372a9afd7a368022c01c3351b339d52cb58","898ec2410fae172e0a9416448b0838bed286322a5c0c8959e8e39400cd4c5697","692345a43bac37c507fa7065c554258435ab821bbe4fb44b513a70063e932b45","cddd50d7bd9d7fddda91a576db9f61655d1a55e2d870f154485812f6e39d4c15","0539583b089247b73a21eb4a5f7e43208a129df6300d6b829dc1039b79b6c8c4","7aba43bc7764fcd02232382c780c3e99ef8dbfdac3c58605a0b3781fab3d8044","522edc786ed48304671b935cf7d3ed63acc6636ab9888c6e130b97a6aea92b46","1e1ed5600d80406a10428e349af8b6f09949cd5054043ea8588903e8f9e8d705","de21641eb8edcbc08dd0db4ee70eea907cd07fe72267340b5571c92647f10a77","a53039ba614075aeb702271701981babbd0d4f4dcbf319ddee4c08fb8196cc7a","6758f7b72fa4d38f4f4b865516d3d031795c947a45cc24f2cfba43c91446d678","da679a5bb46df3c6d84f637f09e6689d6c2d07e907ea16adc161e4529a4954d6","dc1a664c33f6ddd2791569999db2b3a476e52c5eeb5474768ffa542b136d78c0","bdf7abbd7df4f29b3e0728684c790e80590b69d92ed8d3bf8e66d4bd713941fe","8decb32fc5d44b403b46c3bb4741188df4fbc3c66d6c65669000c5c9cd506523","4beaf337ee755b8c6115ff8a17e22ceab986b588722a52c776b8834af64e0f38","c26dd198f2793bbdcc55103823a2767d6223a7fdb92486c18b86deaf63208354","93551b302a808f226f0846ad8012354f2d53d6dedc33b540d6ca69836781a574","f0ff1c010d5046af3874d3b4df746c6f3921e4b3fbdec61dee0792fc0cb36ccd","778b684ebc6b006fcffeab77d25b34bf6e400100e0ec0c76056e165c6399ab05","463851fa993af55fb0296e0d6afa27407ef91bf6917098dd665aba1200d250c7","67c6de7a9c490bda48eb401bea93904b6bbfc60e47427e887e6a3da6195540be","be8f369f8d7e887eab87a3e4e41f1afcf61bf06056801383152aa83bda1f6a72","352bfb5f3a9d8a9c2464ad2dc0b2dc56a8212650a541fb550739c286dd341de1","a5aae636d9afdacb22d98e4242487436d8296e5a345348325ccc68481fe1b690","d007c769e33e72e51286b816d82cd7c3a280cba714e7f958691155068bd7150a","764150c107451d2fd5b6de305cff0a9dcecf799e08e6f14b5a6748724db46d8a","b04cf223c338c09285010f5308b980ee6d8bfa203824ed2537516f15e92e8c43","4b387f208d1e468193a45a51005b1ed5b666010fc22a15dc1baf4234078b636e","70441eda704feffd132be0c1541f2c7f6bbaafce25cb9b54b181e26af3068e79","d1addb12403afea87a1603121396261a45190886c486c88e1a5d456be17c2049","15d43873064dc8787ca1e4c39149be59183c404d48a8cd5a0ea019bb5fdf8d58","ea4b5d319625203a5a96897b057fddf6017d0f9a902c16060466fe69cc007243","3d06897c536b4aad2b2b015d529270439f2cadd89ca2ff7bd8898ee84898dd88","ab01d8fcb89fae8eda22075153053fefac69f7d9571a389632099e7a53f1922d","bac0ec1f4c61abc7c54ccebb0f739acb0cdbc22b1b19c91854dc142019492961","566b0806f9016fa067b7fecf3951fcc295c30127e5141223393bde16ad04aa4a","8e801abfeda45b1b93e599750a0a8d25074d30d4cc01e3563e56c0ff70edeb68","902997f91b09620835afd88e292eb217fbd55d01706b82b9a014ff408f357559","a3727a926e697919fb59407938bd8573964b3bf543413b685996a47df5645863","83f36c0792d352f641a213ee547d21ea02084a148355aa26b6ef82c4f61c1280","dce7d69c17a438554c11bbf930dec2bee5b62184c0494d74da336daee088ab69","1e8f2cda9735002728017933c54ccea7ebee94b9c68a59a4aac1c9a58aa7da7d","e327a2b222cf9e5c93d7c1ed6468ece2e7b9d738e5da04897f1a99f49d42cca1","65165246b59654ec4e1501dd87927a0ef95d57359709e00e95d1154ad8443bc7","f1bacba19e2fa2eb26c499e36b5ab93d6764f2dba44be3816f12d2bc9ac9a35b","bce38da5fd851520d0cb4d1e6c3c04968cec2faa674ed321c118e97e59872edc","3398f46037f21fb6c33560ceca257259bd6d2ea03737179b61ea9e17cbe07455","6e14fc6c27cb2cb203fe1727bb3a923588f0be8c2604673ad9f879182548daca","12b9bcf8395d33837f301a8e6d545a24dfff80db9e32f8e8e6cf4b11671bb442","04295cc38689e32a4ea194c954ea6604e6afb6f1c102104f74737cb8cf744422","7418f434c136734b23f634e711cf44613ca4c74e63a5ae7429acaee46c7024c8","27d40290b7caba1c04468f2b53cf7112f247f8acdd7c20589cd7decf9f762ad0","2608b8b83639baf3f07316df29202eead703102f1a7e32f74a1b18cf1eee54b5","c93657567a39bd589effe89e863aaadbc339675fca6805ae4d97eafbcce0a05d","909d5db5b3b19f03dfb4a8f1d00cf41d2f679857c28775faf1f10794cbbe9db9","e4504bffce13574bab83ab900b843590d85a0fd38faab7eff83d84ec55de4aff","8ab707f3c833fc1e8a51106b8746c8bc0ce125083ea6200ad881625ae35ce11e","730ddc2386276ac66312edbcc60853fedbb1608a99cb0b1ff82ebf26911dba1f","c1b3fa201aa037110c43c05ea97800eb66fea3f2ecc5f07c6fd47f2b6b5b21d2","636b44188dc6eb326fd566085e6c1c6035b71f839d62c343c299a35888c6f0a9","3b2105bf9823b53c269cabb38011c5a71360c8daabc618fec03102c9514d230c","f96e63eb56e736304c3aef6c745b9fe93db235ddd1fec10b45319c479de1a432","acb4f3cee79f38ceba975e7ee3114eb5cd96ccc02742b0a4c7478b4619f87cd6","cfc85d17c1493b6217bad9052a8edc332d1fde81a919228edab33c14aa762939","eebda441c4486c26de7a8a7343ebbc361d2b0109abff34c2471e45e34a93020a","727b4b8eb62dd98fa4e3a0937172c1a0041eb715b9071c3de96dad597deddcab","708e2a347a1b9868ccdb48f3e43647c6eccec47b8591b220afcafc9e7eeb3784","6bb598e2d45a170f302f113a5b68e518c8d7661ae3b59baf076be9120afa4813","c28e058db8fed2c81d324546f53d2a7aaefff380cbe70f924276dbad89acd7d1","ebe8f07bb402102c5a764b0f8e34bd92d6f50bd7ac61a2452e76b80e02f9bb4b","826a98cb79deab45ccc4e5a8b90fa64510b2169781a7cbb83c4a0a8867f4cc58","618189f94a473b7fdc5cb5ba8b94d146a0d58834cd77cd24d56995f41643ccd5","5baadaca408128671536b3cb77fea44330e169ada70ce50b902c8d992fe64cf1","a4cc469f3561ea3edc57e091f4c9dcaf7485a70d3836be23a6945db46f0acd0b","91b0965538a5eaafa8c09cf9f62b46d6125aa1b3c0e0629dce871f5f41413f90","2978e33a00b4b5fb98337c5e473ab7337030b2f69d1480eccef0290814af0d51","ba71e9777cb5460e3278f0934fd6354041cb25853feca542312807ce1f18e611","608dbaf8c8bb64f4024013e73d7107c16dba4664999a8c6e58f3e71545e48f66","61937cefd7f4d6fa76013d33d5a3c5f9b0fc382e90da34790764a0d17d6277fb","af7db74826f455bfef6a55a188eb6659fd85fdc16f720a89a515c48724ee4c42","d6ce98a960f1b99a72de771fb0ba773cb202c656b8483f22d47d01d68f59ea86","2a47dc4a362214f31689870f809c7d62024afb4297a37b22cb86f679c4d04088","42d907ac511459d7c4828ee4f3f81cc331a08dc98d7b3cb98e3ff5797c095d2e","63d010bff70619e0cdf7900e954a7e188d3175461182f887b869c312a77ecfbd","1452816d619e636de512ca98546aafb9a48382d570af1473f0432a9178c4b1ff","9e3e3932fe16b9288ec8c948048aef4edf1295b09a5412630d63f4a42265370e","8bdba132259883bac06056f7bacd29a4dcf07e3f14ce89edb022fe9b78dcf9b3","5a5406107d9949d83e1225273bcee1f559bb5588942907d923165d83251a0e37","ca0ca4ca5ad4772161ee2a99741d616fea780d777549ba9f05f4a24493ab44e1","e7ee7be996db0d7cce41a85e4cae3a5fc86cf26501ad94e0a20f8b6c1c55b2d4","72263ae386d6a49392a03bde2f88660625da1eca5df8d95120d8ccf507483d20","b498375d015f01585269588b6221008aae6f0c0dc53ead8796ace64bdfcf62ea","c37aa3657fa4d1e7d22565ae609b1370c6b92bafb8c92b914403d45f0e610ddc","34534c0ead52cc753bdfdd486430ef67f615ace54a4c0e5a3652b4116af84d6d","a1079b54643537f75fa4f4bb963d787a302bddbe3a6001c4b0a524b746e6a9de","7fc9b18b6aafa8a1fc1441670c6c9da63e3d7942c7f451300c48bafd988545e9",{"version":"6dc344651e78ab0b0c878196458e12894c8a5563faecb43bea823c065a03b90d","signature":"6a0d02ea3868cbbecffc40e314a8cf76ae69b14102b14b007b6d43edd7d4b078"},"4c2c4f53e8eedd970f8afa369d7371544fb6231bf95e659f8602e09abe74d5a5",{"version":"9c9461d480b1812281abffc647107904970791c170cd0ab97563daa10c6e0171","affectsGlobalScope":true},"c2b5085f47e41d6940bbc5b0d3bd7cc0037c752efb18aecd243c9cf83ad0c0b7","3143a5add0467b83150961ecd33773b561a1207aec727002aa1d70333068eb1b","f87191b7fafe7a0edad375710d99f900e49cef560b66bf309cf3f8e1b7177126","586af7d2abe2f9d59c5e757c370087d6c6baea81b033250f43b8df808d6dfb33",{"version":"1a048ff164b8d9609f5de3139d4e37f6e8a82af82087ac414b9208f52ef8aac7","affectsGlobalScope":true},"3111079f3cb5f2b9c812ca3f46161562bce5bfb355e915f46ed46c41714dc1c3","e7bee4a6d9bb78afa390b25e0ce97a2f94787a1eb17f0a16e732dcbebba3f3ee","b32b6b16cb0bda68199582ad6f22242d07ee75fac9b1f28a98cd838afc5eea45","4441ee4119824bfaebc49308559edd7545978f9cb41a40f115074e1031dde75f",{"version":"60693a88462d0e97900123b5bf7c73e146ce0cc94da46a61fe6775b430d2ff05","affectsGlobalScope":true},{"version":"588c69eda58b9202676ec7ca11a72c3762819b46a0ed72462c769846153c447c","affectsGlobalScope":true},"ae064ed4f855716b7ff348639ddcd6a6d354a72fae82f506608a7dc9266aa24c","92f019c55b21c939616f6a48f678e714ac7b109444cbbf23ad69310ce66ecbdc","bba259efdf9ab95e0c7d3cc8e99250f56bb6b31d6129efdf733ca4eb1d01feea","97f837637f01e274ada9de388e99b1a5c5a82ae4184f8c924209fe201f4ffc9e","139fd681eff7771a38d0c025d13c7a11c5474f6aab61e01c41511d71496df173","f614c3f61e46ccc2cb58702d5a158338ea57ee09099fde5db4cfc63ed0ce4d74","44e42ed6ec9c4451ebe89524e80ac8564e9dd0988c56e6c58f393c810730595d","a504c109b872b0e653549bd258eb06584c148c98d79406c7516995865a6d5089","155865f5f76db0996cd5e20cc5760613ea170ee5ad594c1f3d76fcaa05382161","e92852d673c836fc64e10c38640abcd67c463456e5df55723ac699b8e6ab3a8a","4455c78d226d061b1203c7614c6c6eb5f4f9db5f00d44ff47d0112de8766fbc4",{"version":"ec369bb9d97c4dc09dd2a4093b7ca3ba69ad284831fccac8a1977785e9e38ce5","affectsGlobalScope":true},"4465a636f5f6e9665a90e30691862c9e0a3ac2edc0e66296704f10865e924f2a","9af781f03d44f5635ed7844be0ce370d9d595d4b4ec67cad88f0fac03255257e","f9fd4c3ef6de27fa0e256f4e75b61711c4be05a3399f7714621d3edc832e36b0","e49290b7a927995c0d7e6b2b9c8296284b68a9036d9966531de65185269258d7","aa95cc73ea5315e4f6fc8c6db43d49e3b7de3780cae20a4f1319032809013038","874ca809b79276460011480a2829f4c8d4db29416dd411f71efbf8f497f0ac09","6c903bceaf3f3bc04f2d4c7dcd89ce9fb148b3ba0a5f5408d8f6de2b7eecc7ea","504d049d9e550a65466b73ca39da6469ab41786074ea1d16d37c8853f9f6ab2e","23a28f834a078986bbf58f4e3705956983ff81c3c2493f3db3e5f0e8a9507779","4febdf7f3ec92706c58e0b4e8159cd6de718284ef384260b07c9641c13fc70ce",{"version":"7d0a3356909df08e5df9af2cfd43e8780f24bb12d07b00daaf7ed2a891fa60e5","affectsGlobalScope":true},"7335933d9f30dcfd2c4b6080a8b78e81912a7fcefb1dafccb67ca4cb4b3ac23d","a6bfe9de9adef749010c118104b071d14943802ff0614732b47ce4f1c3e383cd","4c3d0e10396646db4a1e917fb852077ee77ae62e512913bef9cccc2bb0f8bd0e","3b220849d58140dcc6718f5b52dcd29fdb79c45bc28f561cbd29eb1cac6cce13","0ee22fce41f7417a24c808d266e91b850629113c104713a35854393d55994beb","22d1b1d965baba05766613e2e6c753bb005d4386c448cafd72c309ba689e8c24",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"c6c0bd221bb1e94768e94218f8298e47633495529d60cae7d8da9374247a1cf5"],"root":[144],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","removeComments":true,"rootDir":"../src","sourceMap":true,"strict":true,"target":7},"fileIdsList":[[145],[147],[148,153],[149,157,158,165,174],[149,150,157,165],[151,181],[152,153,158,166],[153,174],[154,155,157,165],[155],[156,157],[157],[157,158,159,174,180],[158,159],[157,160,165,174,180],[157,158,160,161,165,174,177,180],[160,162,174,177,180],[145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187],[157,163],[164,180],[155,157,165,174],[166],[167],[147,168],[169,179],[170],[171],[157,172],[172,173,181,183],[157,174],[175],[176],[165,174,177],[178],[165,179],[160,171,180],[181],[174,182],[183],[184],[157,159,174,180,183,185],[174,186],[45,46,52,53],[54,118,119],[45,52,54],[46,54],[45,47,48,49,52,54,57,58],[48,59,73,74],[45,52,57,58,59],[45,47,52,54,56,57,58],[45,46,57,58,59],[44,60,65,72,75,76,117,120,142],[45],[46,50,51],[46,50,51,52,53,55,66,67,68,69,70,71],[46,51,52],[46],[45,46,51,52,54,67],[52],[46,52,53],[50,52],[59,73],[45,47,48,49,52,57],[45,52,55,58],[48,56,57,58,61,62,63,64],[58],[45,47,52,54,56,58],[54,57],[45,52,56,57,58,70],[54],[45,52,58],[46,52,57,68],[57,121],[54,58],[52,57],[57],[45,55],[45,52],[52,57,58],[77,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141],[57,58],[47,52],[45,47,52,58],[45,47,52],[45,52,54,56,57,58,70,77],[78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116],[70,78],[78],[45,52,54,57,77,78],[143]],"referencedMap":[[145,1],[147,2],[148,3],[149,4],[150,5],[151,6],[152,7],[153,8],[154,9],[155,10],[156,11],[157,12],[158,13],[159,14],[160,15],[161,16],[162,17],[188,18],[163,19],[164,20],[165,21],[166,22],[167,23],[168,24],[169,25],[170,26],[171,27],[172,28],[173,29],[174,30],[175,31],[176,32],[177,33],[178,34],[179,35],[180,36],[181,37],[182,38],[183,39],[184,40],[185,41],[186,42],[54,43],[120,44],[119,45],[118,46],[59,47],[75,48],[73,49],[74,50],[60,51],[143,52],[48,53],[52,54],[72,55],[67,56],[53,57],[68,58],[71,59],[66,60],[69,59],[70,61],[76,62],[58,63],[56,64],[65,65],[62,66],[61,66],[57,67],[63,68],[77,69],[139,70],[133,71],[126,72],[125,73],[134,74],[135,59],[127,75],[140,76],[121,77],[122,78],[123,79],[142,80],[124,73],[128,76],[129,81],[136,82],[137,57],[138,81],[130,79],[141,59],[131,83],[132,84],[78,85],[117,86],[81,87],[82,87],[83,87],[84,87],[85,87],[86,87],[87,87],[88,87],[107,87],[89,87],[90,87],[91,87],[92,87],[93,87],[94,87],[114,87],[95,87],[96,87],[97,87],[112,87],[98,87],[113,87],[99,87],[110,87],[111,87],[100,87],[101,87],[102,87],[108,87],[109,87],[103,87],[104,87],[105,87],[106,87],[115,87],[116,87],[80,88],[79,89],[144,90]],"exportedModulesMap":[[145,1],[147,2],[148,3],[149,4],[150,5],[151,6],[152,7],[153,8],[154,9],[155,10],[156,11],[157,12],[158,13],[159,14],[160,15],[161,16],[162,17],[188,18],[163,19],[164,20],[165,21],[166,22],[167,23],[168,24],[169,25],[170,26],[171,27],[172,28],[173,29],[174,30],[175,31],[176,32],[177,33],[178,34],[179,35],[180,36],[181,37],[182,38],[183,39],[184,40],[185,41],[186,42],[54,43],[120,44],[119,45],[118,46],[59,47],[75,48],[73,49],[74,50],[60,51],[143,52],[48,53],[52,54],[72,55],[67,56],[53,57],[68,58],[71,59],[66,60],[69,59],[70,61],[76,62],[58,63],[56,64],[65,65],[62,66],[61,66],[57,67],[63,68],[77,69],[139,70],[133,71],[126,72],[125,73],[134,74],[135,59],[127,75],[140,76],[121,77],[122,78],[123,79],[142,80],[124,73],[128,76],[129,81],[136,82],[137,57],[138,81],[130,79],[141,59],[131,83],[132,84],[78,85],[117,86],[81,87],[82,87],[83,87],[84,87],[85,87],[86,87],[87,87],[88,87],[107,87],[89,87],[90,87],[91,87],[92,87],[93,87],[94,87],[114,87],[95,87],[96,87],[97,87],[112,87],[98,87],[113,87],[99,87],[110,87],[111,87],[100,87],[101,87],[102,87],[108,87],[109,87],[103,87],[104,87],[105,87],[106,87],[115,87],[116,87],[80,88],[79,89],[144,90]],"semanticDiagnosticsPerFile":[145,147,148,149,150,151,152,153,154,155,156,157,158,159,146,187,160,161,162,188,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,54,120,119,118,59,75,73,74,60,143,45,47,48,49,52,55,72,50,67,53,68,71,66,69,46,51,70,76,64,58,56,65,62,61,57,63,77,139,133,126,125,134,135,127,140,121,122,123,142,124,128,129,136,137,138,130,141,131,132,78,117,81,82,83,84,85,86,87,88,107,89,90,91,92,93,94,114,95,96,97,112,98,113,99,110,111,100,101,102,108,109,103,104,105,106,115,116,80,79,44,42,43,9,8,2,10,11,12,13,14,15,16,17,3,4,21,18,19,20,22,23,24,5,25,26,27,28,6,32,29,30,31,33,7,34,39,40,35,36,37,38,1,41,144],"latestChangedDtsFile":"./esm/index.d.ts"},"version":"5.1.3"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/package.json b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/package.json new file mode 100644 index 00000000..209a3513 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/package.json @@ -0,0 +1,42 @@ +{ + "name": "@apollo/cache-control-types", + "version": "1.0.3", + "description": "TypeScript types for Apollo Server info.cacheControl", + "type": "module", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/esm/index.d.ts", + "exports": { + ".": { + "types": { + "require": "./dist/cjs/index.d.ts", + "default": "./dist/esm/index.d.ts" + }, + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-server.git", + "directory": "packages/cache-control-types/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/apollographql/apollo-server/issues" + }, + "homepage": "https://github.com/apollographql/apollo-server#readme", + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + }, + "volta": { + "extends": "../../package.json" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/src/index.ts b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/src/index.ts new file mode 100644 index 00000000..7d5c7f66 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types/src/index.ts @@ -0,0 +1,114 @@ +// NOTE: Once Apollo Server 4 is released, move this package into the +// apollo-server repo. We're placing it in the apollo-utils repo for now to +// enable us to make non-alpha releases that can be used on the apollo-server +// version-4 branch. + +import type { GraphQLCompositeType, GraphQLResolveInfo } from 'graphql'; + +/** + * CacheScope represents whether cacheable data should be shared across sessions + * (PUBLIC) or considered session-specific (PRIVATE). + */ +export type CacheScope = 'PUBLIC' | 'PRIVATE'; + +/** + * CacheHint represents a contribution to an overall cache policy. It can + * specify a maxAge and/or a scope. + */ +export interface CacheHint { + maxAge?: number; + scope?: CacheScope; +} + +/** + * CachePolicy is a mutable CacheHint with helpful methods for updating its + * fields. + */ +export interface CachePolicy extends CacheHint { + /** + * Mutate this CachePolicy by replacing each field defined in `hint`. This can + * make the policy more restrictive or less restrictive. + */ + replace(hint: CacheHint): void; + + /** + * Mutate this CachePolicy by restricting each field defined in `hint`. This + * can only make the policy more restrictive: a previously defined `maxAge` + * can only be reduced, and a previously Private scope cannot be made Public. + */ + restrict(hint: CacheHint): void; + + /** + * If this policy has a positive `maxAge`, then return a copy of itself as a + * `CacheHint` with both fields defined. Otherwise return null. + */ + policyIfCacheable(): Required | null; +} + +/** + * When using Apollo Server with the cache control plugin (on by default), an + * object of this kind is available to resolvers on `info.cacheControl`. + */ +export interface ResolveInfoCacheControl { + cacheHint: CachePolicy; + // Shorthand for `cacheHint.replace(hint)`; also for compatibility with + // the Apollo Server 2.x API. + setCacheHint(hint: CacheHint): void; + + cacheHintFromType(t: GraphQLCompositeType): CacheHint | undefined; +} + +/** When using Apollo Server with the cache control plugin (on by default), the + * `info` argument to resolvers can be considered to be of this type. (You can + * use this type with the customResolveInfo option to the graphql-code-generator + * typescript-resolvers plugin, for example.) */ +export interface GraphQLResolveInfoWithCacheControl + extends Omit { + // Why the Omit above? If you happen to have AS2 `apollo-cache-control` or AS3 + // `apollo-server-core` in your TypeScript build, then there's an ambient + // `declare module` floating around that monkey-patches GraphQLResolveInfo to + // have a cacheControl field. This led to lots of problems, which is why in + // AS4 we're moving towards the approach in this file where don't assume every + // GraphQLResolveInfo is a GraphQLResolveInfoWithCacheControl. The AS3 type is + // very slightly incompatible with the type in the file, since we changed + // CacheScope to be a union of strings rather than an enum. They have the same + // runtime representation so it's safe to ignore, but in order for the + // `extends` to not error out if you're building with the old ambient + // definition floating around too, we need the Omit. + cacheControl: ResolveInfoCacheControl; +} + +/** Given an `info` resolver argument, returns the cacheControl field if it + * exists and appears to be from Apollo Server 3 or newer; returns null + * otherwise.*/ +export function maybeCacheControlFromInfo( + info: GraphQLResolveInfo, +): ResolveInfoCacheControl | null { + if ((info as any).cacheControl?.cacheHint?.restrict) { + return (info as any).cacheControl; + } + return null; +} + +/** Given an `info` resolver argument, returns the cacheControl field if it + * exists and appears to be from Apollo Server 3 or newer; throws + * otherwise.*/ +export function cacheControlFromInfo( + info: GraphQLResolveInfo, +): ResolveInfoCacheControl { + if (!('cacheControl' in info)) { + throw new Error( + 'The `info` argument does not appear to have a cacheControl field. ' + + "Check that you are using Apollo Server 3 or newer and that you aren't using " + + 'ApolloServerPluginCacheControlDisabled.', + ); + } + if (!(info as any).cacheControl?.cacheHint?.restrict) { + throw new Error( + 'The `info` argument has a cacheControl field but it does not appear to be from Apollo' + + "Server 3 or newer. Check that you are using Apollo Server 3 or newer and that you aren't using " + + 'ApolloServerPluginCacheControlDisabled.', + ); + } + return (info as any).cacheControl; +} diff --git a/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/LICENSE b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/LICENSE new file mode 100644 index 00000000..57b7e309 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/LICENSE @@ -0,0 +1,39 @@ +This license applies to all parts of protobuf.js except those files +either explicitly including or referencing a different license or +located in a directory containing a different LICENSE file. + +--- + +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +Code generated by the command line utilities is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/README.md new file mode 100644 index 00000000..d793e377 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/README.md @@ -0,0 +1,911 @@ +# Apollo fork + +We have forked the [source repo](https://github.com/dcodeIO/protobuf.js) because we need to make changes to the package for use in Apollo Server. + +**THIS PACKAGE IS ONLY FOR INTERNAL USE BY APOLLO SERVER.** You should not use it directly in any other context. It should only be used with the specific protobuf definitions from Apollo Server, and certainly should not be used with user-controlled protobuf definitions (Apollo has not endeavored to patch all upstream vulnerabilities that only affect usage with user-controlled protobuf definitions.) + +Version 1.0.0 was forked from `master` which contained version 6.8.8 plus a few unreleased commits. [sha](https://github.com/protobufjs/protobuf.js/commit/4d490eb1bf71f5c5c4c9d253a2ffd36edea12386) + + + +

protobuf.js

+

donate ❤

+ +**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/)). + +**protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [node.js](https://nodejs.org) and the browser. It's easy to use, blazingly fast and works out of the box with [.proto](https://developers.google.com/protocol-buffers/docs/proto) files! + +Contents +-------- + +* [Installation](#installation)
+ How to include protobuf.js in your project. + +* [Usage](#usage)
+ A brief introduction to using the toolset. + + * [Valid Message](#valid-message) + * [Toolset](#toolset)
+ +* [Examples](#examples)
+ A few examples to get you started. + + * [Using .proto files](#using-proto-files) + * [Using JSON descriptors](#using-json-descriptors) + * [Using reflection only](#using-reflection-only) + * [Using custom classes](#using-custom-classes) + * [Using services](#using-services) + * [Usage with TypeScript](#usage-with-typescript)
+ +* [Command line](#command-line)
+ How to use the command line utility. + + * [pbjs for JavaScript](#pbjs-for-javascript) + * [pbts for TypeScript](#pbts-for-typescript) + * [Reflection vs. static code](#reflection-vs-static-code) + * [Command line API](#command-line-api)
+ +* [Additional documentation](#additional-documentation)
+ A list of available documentation resources. + +* [Performance](#performance)
+ A few internals and a benchmark on performance. + +* [Compatibility](#compatibility)
+ Notes on compatibility regarding browsers and optional libraries. + +* [Building](#building)
+ How to build the library and its components yourself. + +Installation +--------------- + +### node.js + +``` +$> npm install @apollo/protobufjs [--save --save-prefix=~] +``` + +```js +var protobuf = require("@apollo/protobufjs"); +``` + +**Note** that this library's versioning scheme is not semver-compatible for historical reasons. For guaranteed backward compatibility, always depend on `~6.A.B` instead of `^6.A.B` (hence the `--save-prefix` above). + +### Browsers + +Development: + +``` + +``` + +Production: + +``` + +``` + +**Remember** to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +The library supports CommonJS and AMD loaders and also exports globally as `protobuf`. + +### Distributions + +Where bundle size is a factor, there are additional stripped-down versions of the [full library][dist-full] (~19kb gzipped) available that exclude certain functionality: + +* When working with JSON descriptors (i.e. generated by [pbjs](#pbjs-for-javascript)) and/or reflection only, see the [light library][dist-light] (~16kb gzipped) that excludes the parser. CommonJS entry point is: + + ```js + var protobuf = require("@apollo/protobufjs/light"); + ``` + +* When working with statically generated code only, see the [minimal library][dist-minimal] (~6.5kb gzipped) that also excludes reflection. CommonJS entry point is: + + ```js + var protobuf = require("@apollo/protobufjs/minimal"); + ``` + +[dist-full]: https://github.com/dcodeIO/protobuf.js/tree/master/dist +[dist-light]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/light +[dist-minimal]: https://github.com/dcodeIO/protobuf.js/tree/master/dist/minimal + +Usage +----- + +Because JavaScript is a dynamically typed language, protobuf.js introduces the concept of a **valid message** in order to provide the best possible [performance](#performance) (and, as a side product, proper typings): + +### Valid message + +> A valid message is an object (1) not missing any required fields and (2) exclusively composed of JS types understood by the wire format writer. + +There are two possible types of valid messages and the encoder is able to work with both of these for convenience: + +* **Message instances** (explicit instances of message classes with default values on their prototype) always (have to) satisfy the requirements of a valid message by design and +* **Plain JavaScript objects** that just so happen to be composed in a way satisfying the requirements of a valid message as well. + +In a nutshell, the wire format writer understands the following types: + +| Field type | Expected JS type (create, encode) | Conversion (fromObject) +|------------|-----------------------------------|------------------------ +| s-/u-/int32
s-/fixed32 | `number` (32 bit integer) | value | 0 if signed
`value >>> 0` if unsigned +| s-/u-/int64
s-/fixed64 | `Long`-like (optimal)
`number` (53 bit integer) | `Long.fromValue(value)` with long.js
`parseInt(value, 10)` otherwise +| float
double | `number` | `Number(value)` +| bool | `boolean` | `Boolean(value)` +| string | `string` | `String(value)` +| bytes | `Uint8Array` (optimal)
`Buffer` (optimal under node)
`Array.` (8 bit integers) | `base64.decode(value)` if a `string`
`Object` with non-zero `.length` is assumed to be buffer-like +| enum | `number` (32 bit integer) | Looks up the numeric id if a `string` +| message | Valid message | `Message.fromObject(value)` + +* Explicit `undefined` and `null` are considered as not set if the field is optional. +* Repeated fields are `Array.`. +* Map fields are `Object.` with the key being the string representation of the respective value or an 8 characters long binary hash string for `Long`-likes. +* Types marked as *optimal* provide the best performance because no conversion step (i.e. number to low and high bits or base64 string to buffer) is required. + +### Toolset + +With that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / redundant operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input. + +**Note** that `Message` below refers to any message class. + +* **Message.verify**(message: `Object`): `null|string`
+ verifies that a **plain JavaScript object** satisfies the requirements of a valid message and thus can be encoded without issues. Instead of throwing, it returns the error message as a string, if any. + + ```js + var payload = "invalid (not an object)"; + var err = AwesomeMessage.verify(payload); + if (err) + throw Error(err); + ``` + +* **Message.encode**(message: `Message|Object` [, writer: `Writer`]): `Writer`
+ encodes a **message instance** or valid **plain JavaScript object**. This method does not implicitly verify the message and it's up to the user to make sure that the payload is a valid message. + + ```js + var buffer = AwesomeMessage.encode(message).finish(); + ``` + +* **Message.encodeDelimited**(message: `Message|Object` [, writer: `Writer`]): `Writer`
+ works like `Message.encode` but additionally prepends the length of the message as a varint. + +* **Message.decode**(reader: `Reader|Uint8Array`): `Message`
+ decodes a buffer to a **message instance**. If required fields are missing, it throws a `util.ProtocolError` with an `instance` property set to the so far decoded message. If the wire format is invalid, it throws an `Error`. + + ```js + try { + var decodedMessage = AwesomeMessage.decode(buffer); + } catch (e) { + if (e instanceof protobuf.util.ProtocolError) { + // e.instance holds the so far decoded message with missing required fields + } else { + // wire format is invalid + } + } + ``` + +* **Message.decodeDelimited**(reader: `Reader|Uint8Array`): `Message`
+ works like `Message.decode` but additionally reads the length of the message prepended as a varint. + +* **Message.create**(properties: `Object`): `Message`
+ creates a new **message instance** from a set of properties that satisfy the requirements of a valid message. Where applicable, it is recommended to prefer `Message.create` over `Message.fromObject` because it doesn't perform possibly redundant conversion. + + ```js + var message = AwesomeMessage.create({ awesomeField: "AwesomeString" }); + ``` + +* **Message.fromObject**(object: `Object`): `Message`
+ converts any non-valid **plain JavaScript object** to a **message instance** using the conversion steps outlined within the table above. + + ```js + var message = AwesomeMessage.fromObject({ awesomeField: 42 }); + // converts awesomeField to a string + ``` + +* **Message.toObject**(message: `Message` [, options: `ConversionOptions`]): `Object`
+ converts a **message instance** to an arbitrary **plain JavaScript object** for interoperability with other libraries or storage. The resulting plain JavaScript object *might* still satisfy the requirements of a valid message depending on the actual conversion options specified, but most of the time it does not. + + ```js + var object = AwesomeMessage.toObject(message, { + enums: String, // enums as string names + longs: String, // longs as strings (requires long.js) + bytes: String, // bytes as base64 encoded strings + defaults: true, // includes default values + arrays: true, // populates empty arrays (repeated fields) even if defaults=false + objects: true, // populates empty objects (map fields) even if defaults=false + oneofs: true // includes virtual oneof fields set to the present field's name + }); + ``` + +For reference, the following diagram aims to display relationships between the different methods and the concept of a valid message: + +

Toolset Diagram

+ +> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/dcodeIO/protobuf.js/issues/748#issuecomment-291925749)) + +Examples +-------- + +### Using .proto files + +It is possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use (reflection-based) message classes: + +```protobuf +// awesome.proto +package awesomepackage; +syntax = "proto3"; + +message AwesomeMessage { + string awesome_field = 1; // becomes awesomeField +} +``` + +```js +protobuf.load("awesome.proto", function(err, root) { + if (err) + throw err; + + // Obtain a message type + var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); + + // Exemplary payload + var payload = { awesomeField: "AwesomeString" }; + + // Verify the payload if necessary (i.e. when possibly incomplete or invalid) + var errMsg = AwesomeMessage.verify(payload); + if (errMsg) + throw Error(errMsg); + + // Create a new message + var message = AwesomeMessage.create(payload); // or use .fromObject if conversion is necessary + + // Encode a message to an Uint8Array (browser) or Buffer (node) + var buffer = AwesomeMessage.encode(message).finish(); + // ... do something with buffer + + // Decode an Uint8Array (browser) or Buffer (node) to a message + var message = AwesomeMessage.decode(buffer); + // ... do something with message + + // If the application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited. + + // Maybe convert the message back to a plain object + var object = AwesomeMessage.toObject(message, { + longs: String, + enums: String, + bytes: String, + // see ConversionOptions + }); +}); +``` + +Additionally, promise syntax can be used by omitting the callback, if preferred: + +```js +protobuf.load("awesome.proto") + .then(function(root) { + ... + }); +``` + +### Using JSON descriptors + +The library utilizes JSON descriptors that are equivalent to a .proto definition. For example, the following is identical to the .proto definition seen above: + +```json +// awesome.json +{ + "nested": { + "AwesomeMessage": { + "fields": { + "awesomeField": { + "type": "string", + "id": 1 + } + } + } + } +} +``` + +JSON descriptors closely resemble the internal reflection structure: + +| Type (T) | Extends | Type-specific properties +|--------------------|--------------------|------------------------- +| *ReflectionObject* | | options +| *Namespace* | *ReflectionObject* | nested +| Root | *Namespace* | **nested** +| Type | *Namespace* | **fields** +| Enum | *ReflectionObject* | **values** +| Field | *ReflectionObject* | rule, **type**, **id** +| MapField | Field | **keyType** +| OneOf | *ReflectionObject* | **oneof** (array of field names) +| Service | *Namespace* | **methods** +| Method | *ReflectionObject* | type, **requestType**, **responseType**, requestStream, responseStream + +* **Bold properties** are required. *Italic types* are abstract. +* `T.fromJSON(name, json)` creates the respective reflection object from a JSON descriptor +* `T#toJSON()` creates a JSON descriptor from the respective reflection object (its name is used as the key within the parent) + +Exclusively using JSON descriptors instead of .proto files enables the use of just the light library (the parser isn't required in this case). + +A JSON descriptor can either be loaded the usual way: + +```js +protobuf.load("awesome.json", function(err, root) { + if (err) throw err; + + // Continue at "Obtain a message type" above +}); +``` + +Or it can be loaded inline: + +```js +var jsonDescriptor = require("./awesome.json"); // exemplary for node + +var root = protobuf.Root.fromJSON(jsonDescriptor); + +// Continue at "Obtain a message type" above +``` + +### Using reflection only + +Both the full and the light library include full reflection support. One could, for example, define the .proto definitions seen in the examples above using just reflection: + +```js +... +var Root = protobuf.Root, + Type = protobuf.Type, + Field = protobuf.Field; + +var AwesomeMessage = new Type("AwesomeMessage").add(new Field("awesomeField", 1, "string")); + +var root = new Root().define("awesomepackage").add(AwesomeMessage); + +// Continue at "Create a new message" above +... +``` + +Detailed information on the reflection structure is available within the [API documentation](#additional-documentation). + +### Using custom classes + +Message classes can also be extended with custom functionality and it is also possible to register a custom constructor with a reflected message type: + +```js +... + +// Define a custom constructor +function AwesomeMessage(properties) { + // custom initialization code + ... +} + +// Register the custom constructor with its reflected type (*) +root.lookupType("awesomepackage.AwesomeMessage").ctor = AwesomeMessage; + +// Define custom functionality +AwesomeMessage.customStaticMethod = function() { ... }; +AwesomeMessage.prototype.customInstanceMethod = function() { ... }; + +// Continue at "Create a new message" above +``` + +(*) Besides referencing its reflected type through `AwesomeMessage.$type` and `AwesomeMesage#$type`, the respective custom class is automatically populated with: + +* `AwesomeMessage.create` +* `AwesomeMessage.encode` and `AwesomeMessage.encodeDelimited` +* `AwesomeMessage.decode` and `AwesomeMessage.decodeDelimited` +* `AwesomeMessage.verify` +* `AwesomeMessage.fromObject`, `AwesomeMessage.toObject` and `AwesomeMessage#toJSON` + +Afterwards, decoded messages of this type are `instanceof AwesomeMessage`. + +Alternatively, it is also possible to reuse and extend the internal constructor if custom initialization code is not required: + +```js +... + +// Reuse the internal constructor +var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage").ctor; + +// Define custom functionality +AwesomeMessage.customStaticMethod = function() { ... }; +AwesomeMessage.prototype.customInstanceMethod = function() { ... }; + +// Continue at "Create a new message" above +``` + +### Using services + +The library also supports consuming services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary request and a node-style callback as its parameters: + +```js +function rpcImpl(method, requestData, callback) { + // perform the request using an HTTP request or a WebSocket for example + var responseData = ...; + // and call the callback with the binary response afterwards: + callback(null, responseData); +} +``` + +Below is a working example with a typescript implementation using grpc npm package. +```ts +const grpc = require('grpc') + +const Client = grpc.makeGenericClientConstructor({}) +const client = new Client( + grpcServerUrl, + grpc.credentials.createInsecure() +) + +const rpcImpl = function(method, requestData, callback) { + client.makeUnaryRequest( + method.name, + arg => arg, + arg => arg, + requestData, + callback + ) +} +``` + +Example: + +```protobuf +// greeter.proto +syntax = "proto3"; + +service Greeter { + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +message HelloRequest { + string name = 1; +} + +message HelloReply { + string message = 1; +} +``` + +```js +... +var Greeter = root.lookup("Greeter"); +var greeter = Greeter.create(/* see above */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false); + +greeter.sayHello({ name: 'you' }, function(err, response) { + console.log('Greeting:', response.message); +}); +``` + +Services also support promises: + +```js +greeter.sayHello({ name: 'you' }) + .then(function(response) { + console.log('Greeting:', response.message); + }); +``` + +There is also an [example for streaming RPC](https://github.com/dcodeIO/protobuf.js/blob/master/examples/streaming-rpc.js). + +Note that the service API is meant for clients. Implementing a server-side endpoint pretty much always requires transport channel (i.e. http, websocket, etc.) specific code with the only common denominator being that it decodes and encodes messages. + +### Usage with TypeScript + +The library ships with its own [type definitions](https://github.com/dcodeIO/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion. + +The npm package depends on [@types/long](https://www.npmjs.com/package/@types/long) because of `Long`. If you are not building for node and/or not using long.js, it should be safe to exclude them manually. + +#### Using the JS API + +The API shown above works pretty much the same with TypeScript. However, because everything is typed, accessing fields on instances of dynamically generated message classes requires either using bracket-notation (i.e. `message["awesomeField"]`) or explicit casts. Alternatively, it is possible to use a [typings file generated for its static counterpart](#pbts-for-typescript). + +```ts +import { load } from "@apollo/protobufjs"; // respectively "./node_modules/protobufjs" + +load("awesome.proto", function(err, root) { + if (err) + throw err; + + // example code + const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); + + let message = AwesomeMessage.create({ awesomeField: "hello" }); + console.log(`message = ${JSON.stringify(message)}`); + + let buffer = AwesomeMessage.encode(message).finish(); + console.log(`buffer = ${Array.prototype.toString.call(buffer)}`); + + let decoded = AwesomeMessage.decode(buffer); + console.log(`decoded = ${JSON.stringify(decoded)}`); +}); +``` + +#### Using generated static code + +If you generated static code to `bundle.js` using the CLI and its type definitions to `bundle.d.ts`, then you can just do: + +```ts +import { AwesomeMessage } from "./bundle.js"; + +// example code +let message = AwesomeMessage.create({ awesomeField: "hello" }); +let buffer = AwesomeMessage.encode(message).finish(); +let decoded = AwesomeMessage.decode(buffer); +``` + +#### Using decorators + +The library also includes an early implementation of [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html). + +**Note** that decorators are an experimental feature in TypeScript and that declaration order is important depending on the JS target. For example, `@Field.d(2, AwesomeArrayMessage)` requires that `AwesomeArrayMessage` has been defined earlier when targeting `ES5`. + +```ts +import { Message, Type, Field, OneOf } from "@apollo/protobufjs/light"; // respectively "./node_modules/protobufjs/light.js" + +export class AwesomeSubMessage extends Message { + + @Field.d(1, "string") + public awesomeString: string; + +} + +export enum AwesomeEnum { + ONE = 1, + TWO = 2 +} + +@Type.d("SuperAwesomeMessage") +export class AwesomeMessage extends Message { + + @Field.d(1, "string", "optional", "awesome default string") + public awesomeField: string; + + @Field.d(2, AwesomeSubMessage) + public awesomeSubMessage: AwesomeSubMessage; + + @Field.d(3, AwesomeEnum, "optional", AwesomeEnum.ONE) + public awesomeEnum: AwesomeEnum; + + @OneOf.d("awesomeSubMessage", "awesomeEnum") + public which: string; + +} + +// example code +let message = new AwesomeMessage({ awesomeField: "hello" }); +let buffer = AwesomeMessage.encode(message).finish(); +let decoded = AwesomeMessage.decode(buffer); +``` + +Supported decorators are: + +* **Type.d(typeName?: `string`)**   *(optional)*
+ annotates a class as a protobuf message type. If `typeName` is not specified, the constructor's runtime function name is used for the reflected type. + +* **Field.d<T>(fieldId: `number`, fieldType: `string | Constructor`, fieldRule?: `"optional" | "required" | "repeated"`, defaultValue?: `T`)**
+ annotates a property as a protobuf field with the specified id and protobuf type. + +* **MapField.d<T extends { [key: string]: any }>(fieldId: `number`, fieldKeyType: `string`, fieldValueType. `string | Constructor<{}>`)**
+ annotates a property as a protobuf map field with the specified id, protobuf key and value type. + +* **OneOf.d<T extends string>(...fieldNames: `string[]`)**
+ annotates a property as a protobuf oneof covering the specified fields. + +Other notes: + +* Decorated types reside in `protobuf.roots["decorated"]` using a flat structure, so no duplicate names. +* Enums are copied to a reflected enum with a generic name on decorator evaluation because referenced enum objects have no runtime name the decorator could use. +* Default values must be specified as arguments to the decorator instead of using a property initializer for proper prototype behavior. +* Property names on decorated classes must not be renamed on compile time (i.e. by a minifier) because decorators just receive the original field name as a string. + +**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/dcodeIO/protobuf.js/blob/master/examples/js-decorators.js) as well. + +Command line +------------ + +**Note** that moving the CLI to [its own package](./cli) is a work in progress. At the moment, it's still part of the main package. + +The command line interface (CLI) can be used to translate between file formats and to generate static code as well as TypeScript definitions. + +### pbjs for JavaScript + +``` +Translates between file formats and generates static code. + + -t, --target Specifies the target format. Also accepts a path to require a custom target. + + json JSON representation + json-module JSON representation as a module + proto2 Protocol Buffers, Version 2 + proto3 Protocol Buffers, Version 3 + static Static code without reflection (non-functional on its own) + static-module Static code without reflection as a module + + -p, --path Adds a directory to the include path. + + -o, --out Saves to a file instead of writing to stdout. + + --sparse Exports only those types referenced from a main file (experimental). + + Module targets only: + + -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper. + + default Default wrapper supporting both CommonJS and AMD + commonjs CommonJS wrapper + amd AMD wrapper + es6 ES6 wrapper (implies --es6) + closure A closure adding to protobuf.roots where protobuf is a global + + -r, --root Specifies an alternative protobuf.roots name. + + -l, --lint Linter configuration. Defaults to protobuf.js-compatible rules: + + eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins + + --es6 Enables ES6 syntax (const/let instead of var) + + Proto sources only: + + --keep-case Keeps field casing instead of converting to camel case. + + Static targets only: + + --no-create Does not generate create functions used for reflection compatibility. + --no-encode Does not generate encode functions. + --no-decode Does not generate decode functions. + --no-verify Does not generate verify functions. + --no-convert Does not generate convert functions like from/toObject + --no-delimited Does not generate delimited encode/decode functions. + --no-beautify Does not beautify generated code. + --no-comments Does not output any JSDoc comments. + + --force-long Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields. + --force-number Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields. + --force-message Enforces the use of message instances instead of plain objects. + +usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] - +``` + +For production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library): + +``` +$> pbjs -t json file1.proto file2.proto > bundle.json +``` + +Now, either include this file in your final bundle: + +```js +var root = protobuf.Root.fromJSON(require("./bundle.json")); +``` + +or load it the usual way: + +```js +protobuf.load("bundle.json", function(err, root) { + ... +}); +``` + +Generated static code, on the other hand, works with just the **minimal** library. For example + +``` +$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto +``` + +will generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`. + +**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code. + + +### pbts for TypeScript + +``` +Generates TypeScript definitions from annotated JavaScript files. + + -o, --out Saves to a file instead of writing to stdout. + + -g, --global Name of the global object in browser environments, if any. + + --no-comments Does not output any JSDoc comments. + + Internal flags: + + -n, --name Wraps everything in a module of the specified name. + + -m, --main Whether building the main library without any imports. + +usage: pbts [options] file1.js file2.js ... (or) other | pbts [options] - +``` + +Picking up on the example above, the following not only generates static code to a CommonJS module `compiled.js` but also its respective TypeScript definitions to `compiled.d.ts`: + +``` +$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto +$> pbts -o compiled.d.ts compiled.js +``` + +Additionally, TypeScript definitions of static modules are compatible with their reflection-based counterparts (i.e. as exported by JSON modules), as long as the following conditions are met: + +1. Instead of using `new SomeMessage(...)`, always use `SomeMessage.create(...)` because reflection objects do not provide a constructor. +2. Types, services and enums must start with an uppercase letter to become available as properties of the reflected types as well (i.e. to be able to use `MyMessage.MyEnum` instead of `root.lookup("MyMessage.MyEnum")`). + +For example, the following generates a JSON module `bundle.js` and a `bundle.d.ts`, but no static code: + +``` +$> pbjs -t json-module -w commonjs -o bundle.js file1.proto file2.proto +$> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts - +``` + +### Reflection vs. static code + +While using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared. + +Static code, on the other hand, requires just the minimal library, but generates additional source code without any reflection features. This also implies that there is a break-even point where statically generated code becomes larger than descriptor-based code once the amount of code generated exceeds the size of the full respectively light library. + +There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section. + +| Source | Library | Advantages | Tradeoffs +|--------|---------|------------|----------- +| .proto | full | Easily editable
Interoperability with other libraries
No compile step | Some parsing and possibly network overhead +| JSON | light | Easily editable
No parsing overhead
Single bundle (no network overhead) | protobuf.js specific
Has a compile step +| static | minimal | Works where `eval` access is restricted
Fully documented
Small footprint for small protos | Can be hard to edit
No reflection
Has a compile step + +### Command line API + +Both utilities can be used programmatically by providing command line arguments and a callback to their respective `main` functions: + +```js +var pbjs = require("@apollo/protobufjs/cli/pbjs"); // or require("@apollo/protobufjs/cli").pbjs / .pbts + +pbjs.main([ "--target", "json-module", "path/to/myproto.proto" ], function(err, output) { + if (err) + throw err; + // do something with output +}); +``` + +Additional documentation +------------------------ + +#### Protocol Buffers +* [Google's Developer Guide](https://developers.google.com/protocol-buffers/docs/overview) + +#### protobuf.js +* [API Documentation](https://protobufjs.github.io/protobuf.js) +* [CHANGELOG](https://github.com/dcodeIO/protobuf.js/blob/master/CHANGELOG.md) +* [Frequently asked questions](https://github.com/dcodeIO/protobuf.js/wiki) on our wiki + +#### Community +* [Questions and answers](http://stackoverflow.com/search?tab=newest&q=protobuf.js) on StackOverflow + +Performance +----------- +The package includes a benchmark that compares protobuf.js performance to native JSON (as far as this is possible) and [Google's JS implementation](https://github.com/google/protobuf/tree/master/js). On an i7-2600K running node 6.9.1 it yields: + +``` +benchmarking encoding performance ... + +protobuf.js (reflect) x 541,707 ops/sec ±1.13% (87 runs sampled) +protobuf.js (static) x 548,134 ops/sec ±1.38% (89 runs sampled) +JSON (string) x 318,076 ops/sec ±0.63% (93 runs sampled) +JSON (buffer) x 179,165 ops/sec ±2.26% (91 runs sampled) +google-protobuf x 74,406 ops/sec ±0.85% (86 runs sampled) + + protobuf.js (static) was fastest + protobuf.js (reflect) was 0.9% ops/sec slower (factor 1.0) + JSON (string) was 41.5% ops/sec slower (factor 1.7) + JSON (buffer) was 67.6% ops/sec slower (factor 3.1) + google-protobuf was 86.4% ops/sec slower (factor 7.3) + +benchmarking decoding performance ... + +protobuf.js (reflect) x 1,383,981 ops/sec ±0.88% (93 runs sampled) +protobuf.js (static) x 1,378,925 ops/sec ±0.81% (93 runs sampled) +JSON (string) x 302,444 ops/sec ±0.81% (93 runs sampled) +JSON (buffer) x 264,882 ops/sec ±0.81% (93 runs sampled) +google-protobuf x 179,180 ops/sec ±0.64% (94 runs sampled) + + protobuf.js (reflect) was fastest + protobuf.js (static) was 0.3% ops/sec slower (factor 1.0) + JSON (string) was 78.1% ops/sec slower (factor 4.6) + JSON (buffer) was 80.8% ops/sec slower (factor 5.2) + google-protobuf was 87.0% ops/sec slower (factor 7.7) + +benchmarking combined performance ... + +protobuf.js (reflect) x 275,900 ops/sec ±0.78% (90 runs sampled) +protobuf.js (static) x 290,096 ops/sec ±0.96% (90 runs sampled) +JSON (string) x 129,381 ops/sec ±0.77% (90 runs sampled) +JSON (buffer) x 91,051 ops/sec ±0.94% (90 runs sampled) +google-protobuf x 42,050 ops/sec ±0.85% (91 runs sampled) + + protobuf.js (static) was fastest + protobuf.js (reflect) was 4.7% ops/sec slower (factor 1.0) + JSON (string) was 55.3% ops/sec slower (factor 2.2) + JSON (buffer) was 68.6% ops/sec slower (factor 3.2) + google-protobuf was 85.5% ops/sec slower (factor 6.9) +``` + +These results are achieved by + +* generating type-specific encoders, decoders, verifiers and converters at runtime +* configuring the reader/writer interface according to the environment +* using node-specific functionality where beneficial and, of course +* avoiding unnecessary operations through splitting up [the toolset](#toolset). + +You can also run [the benchmark](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js) ... + +``` +$> npm run bench +``` + +and [the profiler](https://github.com/dcodeIO/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node): + +``` +$> npm run prof [iterations=10000000] +``` + +Note that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths. + +Compatibility +------------- + +* Works in all modern and not-so-modern browsers except IE8. +* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally. +* If typed arrays are not supported by the environment, plain arrays will be used instead. +* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/polyfill.js). +* Support for [Content Security Policy](https://w3c.github.io/webappsec-csp/)-restricted environments (like Chrome extensions without [unsafe-eval](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval)) can be achieved by generating and using static code instead. +* If a proper way to work with 64 bit values (uint64, int64 etc.) is required, just install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)). +* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/dcodeIO/protobuf.js/tree/master/ext/descriptor) + +Building +-------- + +To build the library or its components yourself, clone it from GitHub and install the development dependencies: + +``` +$> git clone https://github.com/dcodeIO/protobuf.js.git +$> cd protobuf.js +$> npm install +``` + +Building the respective development and production versions with their respective source maps to `dist/`: + +``` +$> npm run build +``` + +Building the documentation to `docs/`: + +``` +$> npm run docs +``` + +Building the TypeScript definition to `index.d.ts`: + +``` +$> npm run types +``` + +### Browserify integration + +By default, protobuf.js integrates into any browserify build-process without requiring any optional modules. Hence: + +* If int64 support is required, explicitly require the `long` module somewhere in your project as it will be excluded otherwise. This assumes that a global `require` function is present that protobuf.js can call to obtain the long module. + + If there is no global `require` function present after bundling, it's also possible to assign the long module programmatically: + + ```js + var Long = ...; + + protobuf.util.Long = Long; + protobuf.configure(); + ``` + +* If you have any special requirements, there is [the bundler](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/bundle.js) for reference. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs new file mode 100755 index 00000000..6a5d49ad --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "cli", "pbjs.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts new file mode 100755 index 00000000..cb1cdaf5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "cli", "pbts.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/LICENSE b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/LICENSE new file mode 100644 index 00000000..e5f7a5c9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/LICENSE @@ -0,0 +1,33 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +Code generated by the command line utilities is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/README.md new file mode 100644 index 00000000..1eb4c868 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/README.md @@ -0,0 +1,11 @@ +protobufjs-cli +============== +[![npm](https://img.shields.io/npm/v/protobufjscli.svg)](https://www.npmjs.com/package/protobufjs-cli) + +Command line interface (CLI) for [protobuf.js](https://github.com/dcodeIO/protobuf.js). Translates between file formats and generates static code as well as TypeScript definitions. + +* [CLI Documentation](https://github.com/dcodeIO/protobuf.js#command-line) + +**Note** that moving the CLI to its own package is a work in progress. At the moment, it's still part of the main package. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbjs b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbjs new file mode 100755 index 00000000..9bfedb31 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbjs @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "pbjs.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbts new file mode 100755 index 00000000..48d392c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/bin/pbts @@ -0,0 +1,6 @@ +#!/usr/bin/env node +var path = require("path"), + cli = require(path.join(__dirname, "..", "pbts.js")); +var ret = cli.main(process.argv.slice(2)); +if (typeof ret === 'number') + process.exit(ret); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.d.ts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.d.ts new file mode 100644 index 00000000..09c20269 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.d.ts @@ -0,0 +1,3 @@ +import * as pbjs from "./pbjs.js"; +import * as pbts from "./pbts.js"; +export { pbjs, pbts }; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.js new file mode 100644 index 00000000..c565aa6f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/index.js @@ -0,0 +1,3 @@ +"use strict"; +exports.pbjs = require("./pbjs"); +exports.pbts = require("./pbts"); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc.json new file mode 100644 index 00000000..b5fe1d90 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc.json @@ -0,0 +1,18 @@ +{ + "tags": { + "allowUnknownTags": false + }, + "plugins": [ + "./tsd-jsdoc/plugin" + ], + "opts": { + "encoding" : "utf8", + "recurse" : true, + "lenient" : true, + "template" : "./tsd-jsdoc", + + "private" : false, + "comments" : true, + "destination" : false + } +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/LICENSE b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/LICENSE new file mode 100644 index 00000000..e5aebc9f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2016 Chad Engler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/README.md new file mode 100644 index 00000000..beed748f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/README.md @@ -0,0 +1,23 @@ +protobuf.js fork of tsd-jsdoc +============================= + +This is a modified version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) v1.0.1 for use with protobuf.js, parked here so we can process issues and pull requests. The ultimate goal is to switch back to the a recent version of tsd-jsdoc once it meets our needs. + +Options +------- + +* **module: `string`**
+ Wraps everything in a module of the specified name. + +* **private: `boolean`**
+ Includes private members when set to `true`. + +* **comments: `boolean`**
+ Skips comments when explicitly set to `false`. + +* **destination: `string|boolean`**
+ Saves to the specified destination file or to console when set to `false`. + +Setting options on the command line +----------------------------------- +Providing `-q, --query ` on the command line will set respectively override existing options. Example: `-q module=protobufjs` diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/plugin.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/plugin.js new file mode 100644 index 00000000..1bf4f42f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/plugin.js @@ -0,0 +1,21 @@ +"use strict"; +exports.defineTags = function(dictionary) { + + dictionary.defineTag("template", { + mustHaveValue: true, + canHaveType: false, + canHaveName: false, + onTagged: function(doclet, tag) { + (doclet.templates || (doclet.templates = [])).push(tag.text); + } + }); + + dictionary.defineTag("tstype", { + mustHaveValue: true, + canHaveType: false, + canHaveName: false, + onTagged: function(doclet, tag) { + doclet.tsType = tag.text; + } + }); +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/publish.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/publish.js new file mode 100644 index 00000000..47be4e56 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/lib/tsd-jsdoc/publish.js @@ -0,0 +1,693 @@ +"use strict"; + +var fs = require("fs"); + +// output stream +var out = null; + +// documentation data +var data = null; + +// already handled objects, by name +var seen = {}; + +// indentation level +var indent = 0; + +// whether indent has been written for the current line yet +var indentWritten = false; + +// provided options +var options = {}; + +// queued interfaces +var queuedInterfaces = []; + +// whether writing the first line +var firstLine = true; + +// JSDoc hook +exports.publish = function publish(taffy, opts) { + options = opts || {}; + + // query overrides options + if (options.query) + Object.keys(options.query).forEach(function(key) { + if (key !== "query") + switch (options[key] = options.query[key]) { + case "true": + options[key] = true; + break; + case "false": + options[key] = false; + break; + case "null": + options[key] = null; + break; + } + }); + + // remove undocumented + taffy({ undocumented: true }).remove(); + taffy({ ignore: true }).remove(); + taffy({ inherited: true }).remove(); + + // remove private + if (!options.private) + taffy({ access: "private" }).remove(); + + // setup output + out = options.destination + ? fs.createWriteStream(options.destination) + : process.stdout; + + try { + // setup environment + data = taffy().get(); + indent = 0; + indentWritten = false; + firstLine = true; + + // wrap everything in a module if configured + if (options.module) { + writeln("export = ", options.module, ";"); + writeln(); + writeln("declare namespace ", options.module, " {"); + writeln(); + ++indent; + } + + // handle all + getChildrenOf(undefined).forEach(function(child) { + handleElement(child, null); + }); + + // process queued + while (queuedInterfaces.length) { + var element = queuedInterfaces.shift(); + begin(element); + writeInterface(element); + writeln(";"); + } + + // end wrap + if (options.module) { + --indent; + writeln("}"); + } + + // close file output + if (out !== process.stdout) + out.end(); + + } finally { + // gc environment objects + out = data = null; + seen = options = {}; + queuedInterfaces = []; + } +}; + +// +// Utility +// + +// writes one or multiple strings +function write() { + var s = Array.prototype.slice.call(arguments).join(""); + if (!indentWritten) { + for (var i = 0; i < indent; ++i) + s = " " + s; + indentWritten = true; + } + out.write(s); + firstLine = false; +} + +// writes zero or multiple strings, followed by a new line +function writeln() { + var s = Array.prototype.slice.call(arguments).join(""); + if (s.length) + write(s, "\n"); + else if (!firstLine) + out.write("\n"); + indentWritten = false; +} + +var keepTags = [ + "param", + "returns", + "throws", + "see" +]; + +// parses a comment into text and tags +function parseComment(comment) { + var lines = comment.replace(/^ *\/\*\* *|^ *\*\/| *\*\/ *$|^ *\* */mg, "").trim().split(/\r?\n|\r/g); // property.description has just "\r" ?! + var desc; + var text = []; + var tags = null; + for (var i = 0; i < lines.length; ++i) { + var match = /^@(\w+)\b/.exec(lines[i]); + if (match) { + if (!tags) { + tags = []; + desc = text; + } + text = []; + tags.push({ name: match[1], text: text }); + lines[i] = lines[i].substring(match[1].length + 1).trim(); + } + if (lines[i].length || text.length) + text.push(lines[i]); + } + return { + text: desc || text, + tags: tags || [] + }; +} + +// writes a comment +function writeComment(comment, otherwiseNewline) { + if (!comment || options.comments === false) { + if (otherwiseNewline) + writeln(); + return; + } + if (typeof comment !== "object") + comment = parseComment(comment); + comment.tags = comment.tags.filter(function(tag) { + return keepTags.indexOf(tag.name) > -1 && (tag.name !== "returns" || tag.text[0] !== "{undefined}"); + }); + writeln(); + if (!comment.tags.length && comment.text.length < 2) { + writeln("/** " + comment.text[0] + " */"); + return; + } + writeln("/**"); + comment.text.forEach(function(line) { + if (line.length) + writeln(" * ", line); + else + writeln(" *"); + }); + comment.tags.forEach(function(tag) { + var started = false; + if (tag.text.length) { + tag.text.forEach(function(line, i) { + if (i > 0) + write(" * "); + else if (tag.name !== "throws") + line = line.replace(/^\{[^\s]*} ?/, ""); + if (!line.length) + return; + if (!started) { + write(" * @", tag.name, " "); + started = true; + } + writeln(line); + }); + } + }); + writeln(" */"); +} + +// recursively replaces all occurencies of re's match +function replaceRecursive(name, re, fn) { + var found; + + function replacer() { + found = true; + return fn.apply(null, arguments); + } + + do { + found = false; + name = name.replace(re, replacer); + } while (found); + return name; +} + +// tests if an element is considered to be a class or class-like +function isClassLike(element) { + return isClass(element) || isInterface(element); +} + +// tests if an element is considered to be a class +function isClass(element) { + return element && element.kind === "class"; +} + +// tests if an element is considered to be an interface +function isInterface(element) { + return element && (element.kind === "interface" || element.kind === "mixin"); +} + +// tests if an element is considered to be a namespace +function isNamespace(element) { + return element && (element.kind === "namespace" || element.kind === "module"); +} + +// gets all children of the specified parent +function getChildrenOf(parent) { + var memberof = parent ? parent.longname : undefined; + return data.filter(function(element) { + return element.memberof === memberof; + }); +} + +// gets the literal type of an element +function getTypeOf(element) { + if (element.tsType) + return element.tsType.replace(/\r?\n|\r/g, "\n"); + var name = "any"; + var type = element.type; + if (type && type.names && type.names.length) { + if (type.names.length === 1) + name = element.type.names[0].trim(); + else + name = "(" + element.type.names.join("|") + ")"; + } else + return name; + + // Replace catchalls with any + name = name.replace(/\*|\bmixed\b/g, "any"); + + // Ensure upper case Object for map expressions below + name = name.replace(/\bobject\b/g, "Object"); + + // Correct Something. to Something + name = replaceRecursive(name, /\b(?!Object|Array)([\w$]+)\.<([^>]*)>/gi, function($0, $1, $2) { + return $1 + "<" + $2 + ">"; + }); + + // Replace Array. with string[] + name = replaceRecursive(name, /\bArray\.?<([^>]*)>/gi, function($0, $1) { + return $1 + "[]"; + }); + + // Replace Object. with { [k: string]: number } + name = replaceRecursive(name, /\bObject\.?<([^,]*), *([^>]*)>/gi, function($0, $1, $2) { + return "{ [k: " + $1 + "]: " + $2 + " }"; + }); + + // Replace functions (there are no signatures) with Function + name = name.replace(/\bfunction(?:\(\))?\b/g, "Function"); + + // Convert plain Object back to just object + name = name.replace(/\b(Object\b(?!\.))/g, function($0, $1) { + return $1.toLowerCase(); + }); + + return name; +} + +// begins writing the definition of the specified element +function begin(element, is_interface) { + if (!seen[element.longname]) { + if (isClass(element)) { + var comment = parseComment(element.comment); + var classdesc = comment.tags.find(function(tag) { return tag.name === "classdesc"; }); + if (classdesc) { + comment.text = classdesc.text; + comment.tags = []; + } + writeComment(comment, true); + } else + writeComment(element.comment, is_interface || isClassLike(element) || isNamespace(element) || element.isEnum || element.scope === "global"); + seen[element.longname] = element; + } else + writeln(); + if (element.scope !== "global" || options.module) + return; + write("export "); +} + +// writes the function signature describing element +function writeFunctionSignature(element, isConstructor, isTypeDef) { + write("("); + + var params = {}; + + // this type + if (element.this) + params["this"] = { + type: element.this.replace(/^{|}$/g, ""), + optional: false + }; + + // parameter types + if (element.params) + element.params.forEach(function(param) { + var path = param.name.split(/\./g); + if (path.length === 1) + params[param.name] = { + type: getTypeOf(param), + variable: param.variable === true, + optional: param.optional === true, + defaultValue: param.defaultvalue // Not used yet (TODO) + }; + else // Property syntax (TODO) + params[path[0]].type = "{ [k: string]: any }"; + }); + + var paramNames = Object.keys(params); + paramNames.forEach(function(name, i) { + var param = params[name]; + var type = param.type; + if (param.variable) { + name = "..." + name; + type = param.type.charAt(0) === "(" ? "any[]" : param.type + "[]"; + } + write(name, !param.variable && param.optional ? "?: " : ": ", type); + if (i < paramNames.length - 1) + write(", "); + }); + + write(")"); + + // return type + if (!isConstructor) { + write(isTypeDef ? " => " : ": "); + var typeName; + if (element.returns && element.returns.length && (typeName = getTypeOf(element.returns[0])) !== "undefined") + write(typeName); + else + write("void"); + } +} + +// writes (a typedef as) an interface +function writeInterface(element) { + write("interface ", element.name); + writeInterfaceBody(element); + writeln(); +} + +function writeInterfaceBody(element) { + writeln("{"); + ++indent; + if (element.tsType) + writeln(element.tsType.replace(/\r?\n|\r/g, "\n")); + else if (element.properties && element.properties.length) + element.properties.forEach(writeProperty); + --indent; + write("}"); +} + +function writeProperty(property, declare) { + writeComment(property.description); + if (declare) + write("let "); + write(property.name); + if (property.optional) + write("?"); + writeln(": ", getTypeOf(property), ";"); +} + +// +// Handlers +// + +// handles a single element of any understood type +function handleElement(element, parent) { + if (element.scope === "inner") + return false; + + if (element.optional !== true && element.type && element.type.names && element.type.names.length) { + for (var i = 0; i < element.type.names.length; i++) { + if (element.type.names[i].toLowerCase() === "undefined") { + // This element is actually optional. Set optional to true and + // remove the 'undefined' type + element.optional = true; + element.type.names.splice(i, 1); + i--; + } + } + } + + if (seen[element.longname]) + return true; + if (isClassLike(element)) + handleClass(element, parent); + else switch (element.kind) { + case "module": + case "namespace": + handleNamespace(element, parent); + break; + case "constant": + case "member": + handleMember(element, parent); + break; + case "function": + handleFunction(element, parent); + break; + case "typedef": + handleTypeDef(element, parent); + break; + case "package": + break; + } + seen[element.longname] = element; + return true; +} + +// handles (just) a namespace +function handleNamespace(element/*, parent*/) { + var children = getChildrenOf(element); + if (!children.length) + return; + var first = true; + if (element.properties) + element.properties.forEach(function(property) { + if (!/^[$\w]+$/.test(property.name)) // incompatible in namespace + return; + if (first) { + begin(element); + writeln("namespace ", element.name, " {"); + ++indent; + first = false; + } + writeProperty(property, true); + }); + children.forEach(function(child) { + if (child.scope === "inner" || seen[child.longname]) + return; + if (first) { + begin(element); + writeln("namespace ", element.name, " {"); + ++indent; + first = false; + } + handleElement(child, element); + }); + if (!first) { + --indent; + writeln("}"); + } +} + +// a filter function to remove any module references +function notAModuleReference(ref) { + return ref.indexOf("module:") === -1; +} + +// handles a class or class-like +function handleClass(element, parent) { + var is_interface = isInterface(element); + begin(element, is_interface); + if (is_interface) + write("interface "); + else { + if (element.virtual) + write("abstract "); + write("class "); + } + write(element.name); + if (element.templates && element.templates.length) + write("<", element.templates.join(", "), ">"); + write(" "); + + // extended classes + if (element.augments) { + var augments = element.augments.filter(notAModuleReference); + if (augments.length) + write("extends ", augments[0], " "); + } + + // implemented interfaces + var impls = []; + if (element.implements) + Array.prototype.push.apply(impls, element.implements); + if (element.mixes) + Array.prototype.push.apply(impls, element.mixes); + impls = impls.filter(notAModuleReference); + if (impls.length) + write("implements ", impls.join(", "), " "); + + writeln("{"); + ++indent; + + if (element.tsType) + writeln(element.tsType.replace(/\r?\n|\r/g, "\n")); + + // constructor + if (!is_interface && !element.virtual) + handleFunction(element, parent, true); + + // properties + if (is_interface && element.properties) + element.properties.forEach(function(property) { + writeProperty(property); + }); + + // class-compatible members + var incompatible = []; + getChildrenOf(element).forEach(function(child) { + if (isClassLike(child) || child.kind === "module" || child.kind === "typedef" || child.isEnum) { + incompatible.push(child); + return; + } + handleElement(child, element); + }); + + --indent; + writeln("}"); + + // class-incompatible members + if (incompatible.length) { + writeln(); + if (element.scope === "global" && !options.module) + write("export "); + writeln("namespace ", element.name, " {"); + ++indent; + incompatible.forEach(function(child) { + handleElement(child, element); + }); + --indent; + writeln("}"); + } +} + +// handles a namespace or class member +function handleMember(element, parent) { + begin(element); + + if (element.isEnum) { + var stringEnum = false; + element.properties.forEach(function(property) { + if (isNaN(property.defaultvalue)) { + stringEnum = true; + } + }); + if (stringEnum) { + writeln("type ", element.name, " ="); + ++indent; + element.properties.forEach(function(property, i) { + write(i === 0 ? "" : "| ", JSON.stringify(property.defaultvalue)); + }); + --indent; + writeln(";"); + } else { + writeln("enum ", element.name, " {"); + ++indent; + element.properties.forEach(function(property, i) { + write(property.name); + if (property.defaultvalue !== undefined) + write(" = ", JSON.stringify(property.defaultvalue)); + if (i < element.properties.length - 1) + writeln(","); + else + writeln(); + }); + --indent; + writeln("}"); + } + + } else { + + var inClass = isClassLike(parent); + if (inClass) { + write(element.access || "public", " "); + if (element.scope === "static") + write("static "); + if (element.readonly) + write("readonly "); + } else + write(element.kind === "constant" ? "const " : "let "); + + write(element.name); + if (element.optional) + write("?"); + write(": "); + + if (element.type && element.type.names && /^Object\b/i.test(element.type.names[0]) && element.properties) { + writeln("{"); + ++indent; + element.properties.forEach(function(property, i) { + writeln(JSON.stringify(property.name), ": ", getTypeOf(property), i < element.properties.length - 1 ? "," : ""); + }); + --indent; + writeln("};"); + } else + writeln(getTypeOf(element), ";"); + } +} + +// handles a function or method +function handleFunction(element, parent, isConstructor) { + var insideClass = true; + if (isConstructor) { + writeComment(element.comment); + write("constructor"); + } else { + begin(element); + insideClass = isClassLike(parent); + if (insideClass) { + write(element.access || "public", " "); + if (element.scope === "static") + write("static "); + } else + write("function "); + write(element.name); + if (element.templates && element.templates.length) + write("<", element.templates.join(", "), ">"); + } + writeFunctionSignature(element, isConstructor, false); + writeln(";"); + if (!insideClass) + handleNamespace(element); +} + +// handles a type definition (not a real type) +function handleTypeDef(element, parent) { + if (isInterface(element)) { + if (isClassLike(parent)) + queuedInterfaces.push(element); + else { + begin(element); + writeInterface(element); + } + } else { + writeComment(element.comment, true); + write("type ", element.name); + if (element.templates && element.templates.length) + write("<", element.templates.join(", "), ">"); + write(" = "); + if (element.tsType) + write(element.tsType.replace(/\r?\n|\r/g, "\n")); + else { + var type = getTypeOf(element); + if (element.type && element.type.names.length === 1 && element.type.names[0] === "function") + writeFunctionSignature(element, false, true); + else if (type === "object") { + if (element.properties && element.properties.length) + writeInterfaceBody(element); + else + write("{}"); + } else + write(type); + } + writeln(";"); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package-lock.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package-lock.json new file mode 100644 index 00000000..5615138d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package-lock.json @@ -0,0 +1,183 @@ +{ + "version": "6.7.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/parser": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", + "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "bluebird": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", + "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==" + }, + "catharsis": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", + "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", + "requires": { + "lodash": "^4.17.14" + } + }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + }, + "js2xmlparser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.0.tgz", + "integrity": "sha512-WuNgdZOXVmBk5kUPMcTcVUpbGRzLfNkv7+7APq7WiDihpXVKrgxo6wwRpRl9OQeEBgKCVk9mR7RbzrnNWC8oBw==", + "requires": { + "xmlcreate": "^2.0.0" + } + }, + "jsdoc": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.3.tgz", + "integrity": "sha512-Yf1ZKA3r9nvtMWHO1kEuMZTlHOF8uoQ0vyo5eH7SQy5YeIiHM+B0DgKnn+X6y6KDYZcF7G2SPkKF+JORCXWE/A==", + "requires": { + "@babel/parser": "^7.4.4", + "bluebird": "^3.5.4", + "catharsis": "^0.8.11", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.0", + "klaw": "^3.0.0", + "markdown-it": "^8.4.2", + "markdown-it-anchor": "^5.0.2", + "marked": "^0.7.0", + "mkdirp": "^0.5.1", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.0.1", + "taffydb": "2.6.2", + "underscore": "~1.9.1" + } + }, + "klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.5.tgz", + "integrity": "sha512-xLIjLQmtym3QpoY9llBgApknl7pxAcN3WDRc2d3rwpl+/YvDZHPmKscGs+L6E05xf2KrCXPBvosWt7MZukwSpQ==" + }, + "marked": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", + "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==" + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "requires": { + "lodash": "^4.17.14" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==" + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=" + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, + "xmlcreate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", + "integrity": "sha512-MjGsXhKG8YjTKrDCXseFo3ClbMGvUD4en29H2Cev1dv4P/chlpw6KdYmlCWDkhosBVKRDjM836+3e3pm1cBNJA==" + } + } +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.json new file mode 100644 index 00000000..8bdebc24 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.json @@ -0,0 +1,7 @@ +{ + "version": "6.7.0", + "dependencies": { + "jsdoc": "^3.6.3", + "minimist": "^1.2.0" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.standalone.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.standalone.json new file mode 100644 index 00000000..4266b6d5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/package.standalone.json @@ -0,0 +1,32 @@ +{ + "name": "protobufjs-cli", + "description": "Translates between file formats and generates static code as well as TypeScript definitions.", + "version": "6.7.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + }, + "peerDependencies": { + "@apollo/protobufjs": "~1.0.5" + }, + "dependencies": { + "chalk": "^1.1.3", + "escodegen": "^1.8.1", + "espree": "^3.1.3", + "estraverse": "^4.2.0", + "glob": "^7.1.1", + "jsdoc": "^3.4.2", + "minimist": "^1.2.0", + "semver": "^5.3.0", + "tmp": "0.0.31", + "uglify-js": "^2.8.15" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.d.ts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.d.ts new file mode 100644 index 00000000..ead1f3c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.d.ts @@ -0,0 +1,9 @@ +type pbjsCallback = (err: Error|null, output?: string) => void; + +/** + * Runs pbjs programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +export function main(args: string[], callback?: pbjsCallback): number|undefined; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.js new file mode 100644 index 00000000..74b00231 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbjs.js @@ -0,0 +1,331 @@ +"use strict"; +var path = require("path"), + fs = require("fs"), + pkg = require("./package.json"), + util = require("./util"); + +util.setup(); + +var protobuf = require(util.pathToProtobufJs), + minimist = require("minimist"), + chalk = require("chalk"), + glob = require("glob"); + +var targets = util.requireAll("./targets"); + +/** + * Runs pbjs programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +exports.main = function main(args, callback) { + var lintDefault = "eslint-disable " + [ + "block-scoped-var", + "id-length", + "no-control-regex", + "no-magic-numbers", + "no-prototype-builtins", + "no-redeclare", + "no-shadow", + "no-var", + "sort-vars" + ].join(", "); + var argv = minimist(args, { + alias: { + target: "t", + out: "o", + path: "p", + wrap: "w", + root: "r", + lint: "l", + // backward compatibility: + "force-long": "strict-long", + "force-message": "strict-message" + }, + string: [ "target", "out", "path", "wrap", "dependency", "root", "lint" ], + boolean: [ "create", "encode", "decode", "verify", "convert", "from-object", "delimited", "beautify", "comments", "es6", "sparse", "keep-case", "force-long", "force-number", "force-enum-string", "force-message" ], + default: { + target: "json", + create: true, + encode: true, + decode: true, + verify: true, + convert: true, + "from-object": true, + delimited: true, + beautify: true, + comments: true, + es6: null, + lint: lintDefault, + "keep-case": false, + "force-long": false, + "force-number": false, + "force-enum-string": false, + "force-message": false + } + }); + + var target = targets[argv.target], + files = argv._, + paths = typeof argv.path === "string" ? [ argv.path ] : argv.path || []; + + // alias hyphen args in camel case + Object.keys(argv).forEach(function(key) { + var camelKey = key.replace(/-([a-z])/g, function($0, $1) { return $1.toUpperCase(); }); + if (camelKey !== key) + argv[camelKey] = argv[key]; + }); + + // protobuf.js package directory contains additional, otherwise non-bundled google types + paths.push(path.relative(process.cwd(), path.join(__dirname, "..")) || "."); + + if (!files.length) { + var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) { + return " " + util.pad(key, 14, true) + targets[key].description; + }); + if (callback) + callback(Error("usage")); // eslint-disable-line callback-return + else + process.stderr.write([ + "protobuf.js v" + pkg.version + " CLI for JavaScript", + "", + chalk.bold.white("Translates between file formats and generates static code."), + "", + " -t, --target Specifies the target format. Also accepts a path to require a custom target.", + "", + descs.join("\n"), + "", + " -p, --path Adds a directory to the include path.", + "", + " -o, --out Saves to a file instead of writing to stdout.", + "", + " --sparse Exports only those types referenced from a main file (experimental).", + "", + chalk.bold.gray(" Module targets only:"), + "", + " -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.", + "", + " default Default wrapper supporting both CommonJS and AMD", + " commonjs CommonJS wrapper", + " amd AMD wrapper", + " es6 ES6 wrapper (implies --es6)", + " closure A closure adding to protobuf.roots where protobuf is a global", + "", + " --dependency Specifies which version of protobuf to require. Accepts any valid module id", + "", + " -r, --root Specifies an alternative protobuf.roots name.", + "", + " -l, --lint Linter configuration. Defaults to protobuf.js-compatible rules:", + "", + " " + lintDefault, + "", + " --es6 Enables ES6 syntax (const/let instead of var)", + "", + chalk.bold.gray(" Proto sources only:"), + "", + " --keep-case Keeps field casing instead of converting to camel case.", + "", + chalk.bold.gray(" Static targets only:"), + "", + " --no-create Does not generate create functions used for reflection compatibility.", + " --no-encode Does not generate encode functions.", + " --no-decode Does not generate decode functions.", + " --no-verify Does not generate verify functions.", + " --no-convert Does not generate convert functions like from/toObject", + " --no-from-object Does not generate fromObject", + " --no-delimited Does not generate delimited encode/decode functions.", + " --no-beautify Does not beautify generated code.", + " --no-comments Does not output any JSDoc comments.", + "", + " --force-long Enfores the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.", + " --force-number Enfores the use of 'number' for s-/u-/int64 and s-/fixed64 fields.", + " --force-message Enfores the use of message instances instead of plain objects.", + "", + "usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..." + chalk.gray(" (or pipe) ") + "other | " + chalk.bold.green("pbjs") + " [options] -", + "" + ].join("\n")); + return 1; + } + + if (typeof argv["strict-long"] === "boolean") + argv["force-long"] = argv["strict-long"]; + + // Resolve glob expressions + for (var i = 0; i < files.length;) { + if (glob.hasMagic(files[i])) { + var matches = glob.sync(files[i]); + Array.prototype.splice.apply(files, [i, 1].concat(matches)); + i += matches.length; + } else + ++i; + } + + // Require custom target + if (!target) + target = require(path.resolve(process.cwd(), argv.target)); + + var root = new protobuf.Root(); + + var mainFiles = []; + + // Search include paths when resolving imports + root.resolvePath = function pbjsResolvePath(origin, target) { + var normOrigin = protobuf.util.path.normalize(origin), + normTarget = protobuf.util.path.normalize(target); + if (!normOrigin) + mainFiles.push(normTarget); + + var resolved = protobuf.util.path.resolve(normOrigin, normTarget, true); + var idx = resolved.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = resolved.substring(idx); + if (altname in protobuf.common) + resolved = altname; + } + + if (fs.existsSync(resolved)) + return resolved; + + for (var i = 0; i < paths.length; ++i) { + var iresolved = protobuf.util.path.resolve(paths[i] + "/", target); + if (fs.existsSync(iresolved)) + return iresolved; + } + + return resolved; + }; + + // Use es6 syntax if not explicitly specified on the command line and the es6 wrapper is used + if (argv.wrap === "es6" || argv.es6) { + argv.wrap = "es6"; + argv.es6 = true; + } + + var parseOptions = { + "keepCase": argv["keep-case"] || false + }; + + // Read from stdin + if (files.length === 1 && files[0] === "-") { + var data = []; + process.stdin.on("data", function(chunk) { + data.push(chunk); + }); + process.stdin.on("end", function() { + var source = Buffer.concat(data).toString("utf8"); + try { + if (source.charAt(0) !== "{") { + protobuf.parse.filename = "-"; + protobuf.parse(source, root, parseOptions); + } else { + var json = JSON.parse(source); + root.setOptions(json.options).addJSON(json); + } + callTarget(); + } catch (err) { + if (callback) { + callback(err); + return; + } + throw err; + } + }); + + // Load from disk + } else { + try { + root.loadSync(files, parseOptions).resolveAll(); // sync is deterministic while async is not + if (argv.sparse) + sparsify(root); + callTarget(); + } catch (err) { + if (callback) { + callback(err); + return undefined; + } + throw err; + } + } + + function markReferenced(tobj) { + tobj.referenced = true; + // also mark a type's fields and oneofs + if (tobj.fieldsArray) + tobj.fieldsArray.forEach(function(fobj) { + fobj.referenced = true; + }); + if (tobj.oneofsArray) + tobj.oneofsArray.forEach(function(oobj) { + oobj.referenced = true; + }); + // also mark an extension field's extended type, but not its (other) fields + if (tobj.extensionField) + tobj.extensionField.parent.referenced = true; + } + + function sparsify(root) { + + // 1. mark directly or indirectly referenced objects + util.traverse(root, function(obj) { + if (!obj.filename) + return; + if (mainFiles.indexOf(obj.filename) > -1) + util.traverseResolved(obj, markReferenced); + }); + + // 2. empty unreferenced objects + util.traverse(root, function(obj) { + var parent = obj.parent; + if (!parent || obj.referenced) // root or referenced + return; + // remove unreferenced namespaces + if (obj instanceof protobuf.Namespace) { + var hasReferenced = false; + util.traverse(obj, function(iobj) { + if (iobj.referenced) + hasReferenced = true; + }); + if (hasReferenced) { // replace with plain namespace if a namespace subclass + if (obj instanceof protobuf.Type || obj instanceof protobuf.Service) { + var robj = new protobuf.Namespace(obj.name, obj.options); + robj.nested = obj.nested; + parent.add(robj); + } + } else // remove completely if nothing inside is referenced + parent.remove(obj); + + // remove everything else unreferenced + } else if (!(obj instanceof protobuf.Namespace)) + parent.remove(obj); + }); + + // 3. validate that everything is fine + root.resolveAll(); + } + + function callTarget() { + target(root, argv, function targetCallback(err, output) { + if (err) { + if (callback) + return callback(err); + throw err; + } + try { + if (argv.out) + fs.writeFileSync(argv.out, output, { encoding: "utf8" }); + else if (!callback) + process.stdout.write(output, "utf8"); + return callback + ? callback(null, output) + : undefined; + } catch (err) { + if (callback) + return callback(err); + throw err; + } + }); + } + + return undefined; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.d.ts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.d.ts new file mode 100644 index 00000000..35db28c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.d.ts @@ -0,0 +1,9 @@ +type pbtsCallback = (err: Error|null, output?: string) => void; + +/** + * Runs pbts programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +export function main(args: string[], callback?: pbtsCallback): number|undefined; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.js new file mode 100644 index 00000000..8baced48 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/pbts.js @@ -0,0 +1,198 @@ +"use strict"; +var child_process = require("child_process"), + path = require("path"), + fs = require("fs"), + pkg = require("./package.json"), + util = require("./util"); + +util.setup(); + +var minimist = require("minimist"), + chalk = require("chalk"), + glob = require("glob"), + tmp = require("tmp"); + +/** + * Runs pbts programmatically. + * @param {string[]} args Command line arguments + * @param {function(?Error, string=)} [callback] Optional completion callback + * @returns {number|undefined} Exit code, if known + */ +exports.main = function(args, callback) { + var argv = minimist(args, { + alias: { + name: "n", + out : "o", + main: "m", + global: "g", + import: "i" + }, + string: [ "name", "out", "global", "import" ], + boolean: [ "comments", "main" ], + default: { + comments: true, + main: false + } + }); + + var files = argv._; + + if (!files.length) { + if (callback) + callback(Error("usage")); // eslint-disable-line callback-return + else + process.stderr.write([ + "protobuf.js v" + pkg.version + " CLI for TypeScript", + "", + chalk.bold.white("Generates TypeScript definitions from annotated JavaScript files."), + "", + " -o, --out Saves to a file instead of writing to stdout.", + "", + " -g, --global Name of the global object in browser environments, if any.", + "", + " -i, --import Comma delimited list of imports. Local names will equal camelCase of the basename.", + "", + " --no-comments Does not output any JSDoc comments.", + "", + chalk.bold.gray(" Internal flags:"), + "", + " -n, --name Wraps everything in a module of the specified name.", + "", + " -m, --main Whether building the main library without any imports.", + "", + "usage: " + chalk.bold.green("pbts") + " [options] file1.js file2.js ..." + chalk.bold.gray(" (or) ") + "other | " + chalk.bold.green("pbts") + " [options] -", + "" + ].join("\n")); + return 1; + } + + // Resolve glob expressions + for (var i = 0; i < files.length;) { + if (glob.hasMagic(files[i])) { + var matches = glob.sync(files[i]); + Array.prototype.splice.apply(files, [i, 1].concat(matches)); + i += matches.length; + } else + ++i; + } + + var cleanup = []; + + // Read from stdin (to a temporary file) + if (files.length === 1 && files[0] === "-") { + var data = []; + process.stdin.on("data", function(chunk) { + data.push(chunk); + }); + process.stdin.on("end", function() { + files[0] = tmp.tmpNameSync() + ".js"; + fs.writeFileSync(files[0], Buffer.concat(data)); + cleanup.push(files[0]); + callJsdoc(); + }); + + // Load from disk + } else { + callJsdoc(); + } + + function callJsdoc() { + + // There is no proper API for jsdoc, so this executes the CLI and pipes the output + var basedir = path.join(__dirname, "."); + var moduleName = argv.name || "null"; + var nodePath = process.execPath; + var cmd = "\"" + nodePath + "\" \"" + require.resolve("jsdoc/jsdoc.js") + "\" -c \"" + path.join(basedir, "lib", "tsd-jsdoc.json") + "\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return "\"" + file + "\""; }).join(" "); + var child = child_process.exec(cmd, { + cwd: process.cwd(), + argv0: "node", + stdio: "pipe", + maxBuffer: 1 << 24 // 16mb + }); + var out = []; + var ended = false; + var closed = false; + child.stdout.on("data", function(data) { + out.push(data); + }); + child.stdout.on("end", function() { + if (closed) finish(); + else ended = true; + }); + child.stderr.pipe(process.stderr); + child.on("close", function(code) { + // clean up temporary files, no matter what + try { cleanup.forEach(fs.unlinkSync); } catch(e) {/**/} cleanup = []; + + if (code) { + out = out.join("").replace(/\s*JSDoc \d+\.\d+\.\d+ [^$]+/, ""); + process.stderr.write(out); + var err = Error("code " + code); + if (callback) + return callback(err); + throw err; + } + + if (ended) return finish(); + closed = true; + return undefined; + }); + + function getImportName(importItem) { + return path.basename(importItem, ".js").replace(/([-_~.+]\w)/g, function(match) { + return match[1].toUpperCase(); + }); + } + + function finish() { + var output = []; + if (argv.main) + output.push( + "// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'.", + "" + ); + + if (argv.global) + output.push( + "export as namespace " + argv.global + ";", + "" + ); + + if (!argv.main) { + // Ensure we have a usable array of imports + var importArray = typeof argv.import === "string" ? argv.import.split(",") : argv.import || []; + + // Build an object of imports and paths + var imports = { + $protobuf: "@apollo/protobufjs" + }; + importArray.forEach(function(importItem) { + imports[getImportName(importItem)] = importItem; + }); + + // Write out the imports + Object.keys(imports).forEach(function(key) { + output.push("import * as " + key + " from \"" + imports[key] + "\";"); + }); + } + + output = output.join("\n") + "\n" + out.join(""); + + try { + if (argv.out) + fs.writeFileSync(argv.out, output, { encoding: "utf8" }); + else if (!callback) + process.stdout.write(output, "utf8"); + return callback + ? callback(null, output) + : undefined; + } catch (err) { + if (callback) + return callback(err); + throw err; + } + } + } + + return undefined; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json-module.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json-module.js new file mode 100644 index 00000000..dc5e5ed2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json-module.js @@ -0,0 +1,38 @@ +"use strict"; +module.exports = json_module; + +var util = require("../util"); + +var protobuf = require("../.."); + +json_module.description = "JSON representation as a module"; + +function jsonSafeProp(json) { + return json.replace(/^( +)"(\w+)":/mg, function($0, $1, $2) { + return protobuf.util.safeProp($2).charAt(0) === "." + ? $1 + $2 + ":" + : $0; + }); +} + +function json_module(root, options, callback) { + try { + var rootProp = protobuf.util.safeProp(options.root || "default"); + var output = [ + (options.es6 ? "const" : "var") + " $root = ($protobuf.roots" + rootProp + " || ($protobuf.roots" + rootProp + " = new $protobuf.Root()))\n" + ]; + if (root.options) { + var optionsJson = jsonSafeProp(JSON.stringify(root.options, null, 2)); + output.push(".setOptions(" + optionsJson + ")\n"); + } + var json = jsonSafeProp(JSON.stringify(root.nested, null, 2).trim()); + output.push(".addJSON(" + json + ");"); + output = util.wrap(output.join(""), protobuf.util.merge({ dependency: "@apollo/protobufjs/light" }, options)); + process.nextTick(function() { + callback(null, output); + }); + } catch (e) { + return callback(e); + } + return undefined; +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json.js new file mode 100644 index 00000000..70253723 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/json.js @@ -0,0 +1,8 @@ +"use strict"; +module.exports = json_target; + +json_target.description = "JSON representation"; + +function json_target(root, options, callback) { + callback(null, JSON.stringify(root, null, 2)); +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto.js new file mode 100644 index 00000000..d633f168 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto.js @@ -0,0 +1,326 @@ +"use strict"; +module.exports = proto_target; + +proto_target.private = true; + +var protobuf = require("../.."); + +var Namespace = protobuf.Namespace, + Enum = protobuf.Enum, + Type = protobuf.Type, + Field = protobuf.Field, + OneOf = protobuf.OneOf, + Service = protobuf.Service, + Method = protobuf.Method, + types = protobuf.types, + util = protobuf.util; + +function underScore(str) { + return str.substring(0,1) + + str.substring(1) + .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); +} + +var out = []; +var indent = 0; +var first = false; +var syntax = 3; + +function proto_target(root, options, callback) { + if (options) { + switch (options.syntax) { + case undefined: + case "proto3": + case "3": + syntax = 3; + break; + case "proto2": + case "2": + syntax = 2; + break; + default: + return callback(Error("invalid syntax: " + options.syntax)); + } + } + indent = 0; + first = false; + try { + buildRoot(root); + return callback(null, out.join("\n")); + } catch (err) { + return callback(err); + } finally { + out = []; + syntax = 3; + } +} + +function push(line) { + if (line === "") + out.push(""); + else { + var ind = ""; + for (var i = 0; i < indent; ++i) + ind += " "; + out.push(ind + line); + } +} + +function escape(str) { + return str.replace(/[\\"']/g, "\\$&") + .replace(/\r/g, "\\r") + .replace(/\n/g, "\\n") + .replace(/\u0000/g, "\\0"); // eslint-disable-line no-control-regex +} + +function value(v) { + switch (typeof v) { + case "boolean": + return v ? "true" : "false"; + case "number": + return v.toString(); + default: + return "\"" + escape(String(v)) + "\""; + } +} + +function buildRoot(root) { + root.resolveAll(); + var pkg = []; + var ptr = root; + var repeat = true; + do { + var nested = ptr.nestedArray; + if (nested.length === 1 && nested[0] instanceof Namespace && !(nested[0] instanceof Type || nested[0] instanceof Service)) { + ptr = nested[0]; + if (ptr !== root) + pkg.push(ptr.name); + } else + repeat = false; + } while (repeat); + out.push("syntax = \"proto" + syntax + "\";"); + if (pkg.length) + out.push("", "package " + pkg.join(".") + ";"); + + buildOptions(ptr); + ptr.nestedArray.forEach(build); +} + +function build(object) { + if (object instanceof Enum) + buildEnum(object); + else if (object instanceof Type) + buildType(object); + else if (object instanceof Field) + buildField(object); + else if (object instanceof OneOf) + buildOneOf(object); + else if (object instanceof Service) + buildService(object); + else if (object instanceof Method) + buildMethod(object); + else + buildNamespace(object); +} + +function buildNamespace(namespace) { // just a namespace, not a type etc. + push(""); + push("message " + namespace.name + " {"); + ++indent; + buildOptions(namespace); + consolidateExtends(namespace.nestedArray).remaining.forEach(build); + --indent; + push("}"); +} + +function buildEnum(enm) { + push(""); + push("enum " + enm.name + " {"); + buildOptions(enm); + ++indent; first = true; + Object.keys(enm.values).forEach(function(name) { + var val = enm.values[name]; + if (first) { + push(""); + first = false; + } + push(name + " = " + val + ";"); + }); + --indent; first = false; + push("}"); +} + +function buildRanges(keyword, ranges) { + if (ranges && ranges.length) { + var parts = []; + ranges.forEach(function(range) { + if (typeof range === "string") + parts.push("\"" + escape(range) + "\""); + else if (range[0] === range[1]) + parts.push(range[0]); + else + parts.push(range[0] + " to " + (range[1] === 0x1FFFFFFF ? "max" : range[1])); + }); + push(""); + push(keyword + " " + parts.join(", ") + ";"); + } +} + +function buildType(type) { + if (type.group) + return; // built with the sister-field + push(""); + push("message " + type.name + " {"); + ++indent; + buildOptions(type); + type.oneofsArray.forEach(build); + first = true; + type.fieldsArray.forEach(build); + consolidateExtends(type.nestedArray).remaining.forEach(build); + buildRanges("extensions", type.extensions); + buildRanges("reserved", type.reserved); + --indent; + push("}"); +} + +function buildField(field, passExtend) { + if (field.partOf || field.declaringField || field.extend !== undefined && !passExtend) + return; + if (first) { + first = false; + push(""); + } + if (field.resolvedType && field.resolvedType.group) { + buildGroup(field); + return; + } + var sb = []; + if (field.map) + sb.push("map<" + field.keyType + ", " + field.type + ">"); + else if (field.repeated) + sb.push("repeated", field.type); + else if (syntax === 2 || field.parent.group) + sb.push(field.required ? "required" : "optional", field.type); + else + sb.push(field.type); + sb.push(underScore(field.name), "=", field.id); + var opts = buildFieldOptions(field); + if (opts) + sb.push(opts); + push(sb.join(" ") + ";"); +} + +function buildGroup(field) { + push(field.rule + " group " + field.resolvedType.name + " = " + field.id + " {"); + ++indent; + buildOptions(field.resolvedType); + first = true; + field.resolvedType.fieldsArray.forEach(function(field) { + buildField(field); + }); + --indent; + push("}"); +} + +function buildFieldOptions(field) { + var keys; + if (!field.options || !(keys = Object.keys(field.options)).length) + return null; + var sb = []; + keys.forEach(function(key) { + var val = field.options[key]; + var wireType = types.packed[field.resolvedType instanceof Enum ? "int32" : field.type]; + switch (key) { + case "packed": + val = Boolean(val); + // skip when not packable or syntax default + if (wireType === undefined || syntax === 3 === val) + return; + break; + case "default": + if (syntax === 3) + return; + // skip default (resolved) default values + if (field.long && !util.longNeq(field.defaultValue, types.defaults[field.type]) || !field.long && field.defaultValue === types.defaults[field.type]) + return; + // enum defaults specified as strings are type references and not enclosed in quotes + if (field.resolvedType instanceof Enum) + break; + // otherwise fallthrough + default: + val = value(val); + break; + } + sb.push(key + "=" + val); + }); + return sb.length + ? "[" + sb.join(", ") + "]" + : null; +} + +function consolidateExtends(nested) { + var ext = {}; + nested = nested.filter(function(obj) { + if (!(obj instanceof Field) || obj.extend === undefined) + return true; + (ext[obj.extend] || (ext[obj.extend] = [])).push(obj); + return false; + }); + Object.keys(ext).forEach(function(extend) { + push(""); + push("extend " + extend + " {"); + ++indent; first = true; + ext[extend].forEach(function(field) { + buildField(field, true); + }); + --indent; + push("}"); + }); + return { + remaining: nested + }; +} + +function buildOneOf(oneof) { + push(""); + push("oneof " + underScore(oneof.name) + " {"); + ++indent; first = true; + oneof.oneof.forEach(function(fieldName) { + var field = oneof.parent.get(fieldName); + if (first) { + first = false; + push(""); + } + var opts = buildFieldOptions(field); + push(field.type + " " + underScore(field.name) + " = " + field.id + (opts ? " " + opts : "") + ";"); + }); + --indent; + push("}"); +} + +function buildService(service) { + push("service " + service.name + " {"); + ++indent; + service.methodsArray.forEach(build); + consolidateExtends(service.nestedArray).remaining.forEach(build); + --indent; + push("}"); +} + +function buildMethod(method) { + push(method.type + " " + method.name + " (" + (method.requestStream ? "stream " : "") + method.requestType + ") returns (" + (method.responseStream ? "stream " : "") + method.responseType + ");"); +} + +function buildOptions(object) { + if (!object.options) + return; + first = true; + Object.keys(object.options).forEach(function(key) { + if (first) { + first = false; + push(""); + } + var val = object.options[key]; + push("option " + key + " = " + JSON.stringify(val) + ";"); + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto2.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto2.js new file mode 100644 index 00000000..09521e06 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto2.js @@ -0,0 +1,10 @@ +"use strict"; +module.exports = proto2_target; + +var protobuf = require("../.."); + +proto2_target.description = "Protocol Buffers, Version 2"; + +function proto2_target(root, options, callback) { + require("./proto")(root, protobuf.util.merge(options, { syntax: "proto2" }), callback); +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto3.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto3.js new file mode 100644 index 00000000..661c916b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/proto3.js @@ -0,0 +1,10 @@ +"use strict"; +module.exports = proto3_target; + +var protobuf = require("../.."); + +proto3_target.description = "Protocol Buffers, Version 3"; + +function proto3_target(root, options, callback) { + require("./proto")(root, protobuf.util.merge(options, { syntax: "proto3" }), callback); +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static-module.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static-module.js new file mode 100644 index 00000000..f69eba8e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static-module.js @@ -0,0 +1,29 @@ +"use strict"; +module.exports = static_module_target; + +// - The default wrapper supports AMD, CommonJS and the global scope (as window.root), in this order. +// - You can specify a custom wrapper with the --wrap argument. +// - CommonJS modules depend on the minimal build for reduced package size with browserify. +// - AMD and global scope depend on the full library for now. + +var util = require("../util"); + +var protobuf = require("../.."); + +static_module_target.description = "Static code without reflection as a module"; + +function static_module_target(root, options, callback) { + require("./static")(root, options, function(err, output) { + if (err) { + callback(err); + return; + } + try { + output = util.wrap(output, protobuf.util.merge({ dependency: "@apollo/protobufjs/minimal" }, options)); + } catch (e) { + callback(e); + return; + } + callback(null, output); + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static.js new file mode 100644 index 00000000..e8d15349 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/targets/static.js @@ -0,0 +1,709 @@ +"use strict"; +module.exports = static_target; + +var protobuf = require("../.."), + UglifyJS = require("uglify-js"), + espree = require("espree"), + escodegen = require("escodegen"), + estraverse = require("estraverse"); + +var Type = protobuf.Type, + Service = protobuf.Service, + Enum = protobuf.Enum, + Namespace = protobuf.Namespace, + util = protobuf.util; + +var out = []; +var indent = 0; +var config = {}; + +static_target.description = "Static code without reflection (non-functional on its own)"; + +function static_target(root, options, callback) { + config = options; + try { + var aliases = []; + if (config.decode) + aliases.push("Reader"); + if (config.encode) + aliases.push("Writer"); + aliases.push("util"); + if (aliases.length) { + if (config.comments) + push("// Common aliases"); + push((config.es6 ? "const " : "var ") + aliases.map(function(name) { return "$" + name + " = $protobuf." + name; }).join(", ") + ";"); + push(""); + } + if (config.comments) { + if (root.comment) { + pushComment("@fileoverview " + root.comment); + push(""); + } + push("// Exported root namespace"); + } + var rootProp = util.safeProp(config.root || "default"); + push((config.es6 ? "const" : "var") + " $root = $protobuf.roots" + rootProp + " || ($protobuf.roots" + rootProp + " = {});"); + buildNamespace(null, root); + return callback(null, out.join("\n")); + } catch (err) { + return callback(err); + } finally { + out = []; + indent = 0; + config = {}; + } +} + +function push(line) { + if (line === "") + return out.push(""); + var ind = ""; + for (var i = 0; i < indent; ++i) + ind += " "; + return out.push(ind + line); +} + +function pushComment(lines) { + if (!config.comments) + return; + var split = []; + for (var i = 0; i < lines.length; ++i) + if (lines[i] != null && lines[i].substring(0, 8) !== "@exclude") + Array.prototype.push.apply(split, lines[i].split(/\r?\n/g)); + push("/**"); + split.forEach(function(line) { + if (line === null) + return; + push(" * " + line.replace(/\*\//g, "* /")); + }); + push(" */"); +} + +function exportName(object, asInterface) { + if (asInterface) { + if (object.__interfaceName) + return object.__interfaceName; + } else if (object.__exportName) + return object.__exportName; + var parts = object.fullName.substring(1).split("."), + i = 0; + while (i < parts.length) + parts[i] = escapeName(parts[i++]); + if (asInterface) + parts[i - 1] = "I" + parts[i - 1]; + return object[asInterface ? "__interfaceName" : "__exportName"] = parts.join("."); +} + +function escapeName(name) { + if (!name) + return "$root"; + return util.isReserved(name) ? name + "_" : name; +} + +function aOrAn(name) { + return ((/^[hH](?:ou|on|ei)/.test(name) || /^[aeiouAEIOU][a-z]/.test(name)) && !/^us/i.test(name) + ? "an " + : "a ") + name; +} + +function buildNamespace(ref, ns) { + if (!ns) + return; + if (ns.name !== "") { + push(""); + if (!ref && config.es6) + push("export const " + escapeName(ns.name) + " = " + escapeName(ref) + "." + escapeName(ns.name) + " = (() => {"); + else + push(escapeName(ref) + "." + escapeName(ns.name) + " = (function() {"); + ++indent; + } + + if (ns instanceof Type) { + buildType(undefined, ns); + } else if (ns instanceof Service) + buildService(undefined, ns); + else if (ns.name !== "") { + push(""); + pushComment([ + ns.comment || "Namespace " + ns.name + ".", + ns.parent instanceof protobuf.Root ? "@exports " + escapeName(ns.name) : "@memberof " + exportName(ns.parent), + "@namespace" + ]); + push((config.es6 ? "const" : "var") + " " + escapeName(ns.name) + " = {};"); + } + + ns.nestedArray.forEach(function(nested) { + if (nested instanceof Enum) + buildEnum(ns.name, nested); + else if (nested instanceof Namespace) + buildNamespace(ns.name, nested); + }); + if (ns.name !== "") { + push(""); + push("return " + escapeName(ns.name) + ";"); + --indent; + push("})();"); + } +} + +var reduceableBlockStatements = { + IfStatement: true, + ForStatement: true, + WhileStatement: true +}; + +var shortVars = { + "r": "reader", + "w": "writer", + "m": "message", + "t": "tag", + "l": "length", + "c": "end", "c2": "end2", + "k": "key", + "ks": "keys", "ks2": "keys2", + "e": "error", + "f": "impl", + "o": "options", + "d": "object", + "n": "long", + "p": "properties" +}; + +function beautifyCode(code) { + // Add semicolons + code = UglifyJS.minify(code, { + compress: false, + mangle: false, + output: { beautify: true } + }).code; + // Properly beautify + var ast = espree.parse(code); + estraverse.replace(ast, { + enter: function(node, parent) { + // rename short vars + if (node.type === "Identifier" && (parent.property !== node || parent.computed) && shortVars[node.name]) + return { + "type": "Identifier", + "name": shortVars[node.name] + }; + // replace var with let if es6 + if (config.es6 && node.type === "VariableDeclaration" && node.kind === "var") { + node.kind = "let"; + return undefined; + } + // remove braces around block statements with a single child + if (node.type === "BlockStatement" && reduceableBlockStatements[parent.type] && node.body.length === 1) + return node.body[0]; + return undefined; + } + }); + code = escodegen.generate(ast, { + format: { + newline: "\n", + quotes: "double" + } + }); + // Add id, wireType comments + if (config.comments) + code = code.replace(/\.uint32\((\d+)\)/g, function($0, $1) { + var id = $1 >>> 3, + wireType = $1 & 7; + return ".uint32(/* id " + id + ", wireType " + wireType + " =*/" + $1 + ")"; + }); + return code; +} + +var renameVars = { + "Writer": "$Writer", + "Reader": "$Reader", + "util": "$util" +}; + +function buildFunction(type, functionName, gen, scope) { + var code = gen.toString(functionName) + .replace(/((?!\.)types\[\d+])(\.values)/g, "$1"); // enums: use types[N] instead of reflected types[N].values + + var ast = espree.parse(code); + /* eslint-disable no-extra-parens */ + estraverse.replace(ast, { + enter: function(node, parent) { + // rename vars + if ( + node.type === "Identifier" && renameVars[node.name] + && ( + (parent.type === "MemberExpression" && parent.object === node) + || (parent.type === "BinaryExpression" && parent.right === node) + ) + ) + return { + "type": "Identifier", + "name": renameVars[node.name] + }; + // replace this.ctor with the actual ctor + if ( + node.type === "MemberExpression" + && node.object.type === "ThisExpression" + && node.property.type === "Identifier" && node.property.name === "ctor" + ) + return { + "type": "Identifier", + "name": "$root" + type.fullName + }; + // replace types[N] with the field's actual type + if ( + node.type === "MemberExpression" + && node.object.type === "Identifier" && node.object.name === "types" + && node.property.type === "Literal" + ) + return { + "type": "Identifier", + "name": "$root" + type.fieldsArray[node.property.value].resolvedType.fullName + }; + return undefined; + } + }); + /* eslint-enable no-extra-parens */ + code = escodegen.generate(ast, { + format: { + newline: "\n", + quotes: "double" + } + }); + + if (config.beautify) + code = beautifyCode(code); + + code = code.replace(/ {4}/g, "\t"); + + var hasScope = scope && Object.keys(scope).length, + isCtor = functionName === type.name; + + if (hasScope) // remove unused scope vars + Object.keys(scope).forEach(function(key) { + if (!new RegExp("\\b(" + key + ")\\b", "g").test(code)) + delete scope[key]; + }); + + var lines = code.split(/\n/g); + if (isCtor) // constructor + push(lines[0]); + else if (hasScope) // enclose in an iife + push(escapeName(type.name) + "." + escapeName(functionName) + " = (function(" + Object.keys(scope).map(escapeName).join(", ") + ") { return " + lines[0]); + else + push(escapeName(type.name) + "." + escapeName(functionName) + " = " + lines[0]); + lines.slice(1, lines.length - 1).forEach(function(line) { + var prev = indent; + var i = 0; + while (line.charAt(i++) === "\t") + ++indent; + push(line.trim()); + indent = prev; + }); + if (isCtor) + push("}"); + else if (hasScope) + push("};})(" + Object.keys(scope).map(function(key) { return scope[key]; }).join(", ") + ");"); + else + push("};"); +} + +function toJsType(field, forInterface) { + var type; + + switch (field.type) { + case "double": + case "float": + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": + type = "number"; + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": + type = config.forceLong ? "Long" : config.forceNumber ? "number" : "number|Long"; + break; + case "bool": + type = "boolean"; + break; + case "string": + type = "string"; + break; + case "bytes": + type = "Uint8Array"; + break; + default: + if (field.resolve().resolvedType) + type = exportName(field.resolvedType, !(field.resolvedType instanceof protobuf.Enum || config.forceMessage)); + else + type = "*"; // should not happen + break; + } + if (field.map) + return "Object."; + if (field.repeated) { + var fullType = field.preEncoded() ? type + "|Uint8Array" : type; + if (forInterface && field.useToArray()) { + return "$protobuf.ToArray.<" + fullType + ">|Array.<" + fullType + ">"; + } + return "Array.<" + fullType + ">"; + } + return type; +} + +function buildType(ref, type) { + + if (config.comments) { + var typeDef = [ + "Properties of " + aOrAn(type.name) + ".", + type.parent instanceof protobuf.Root ? "@exports " + escapeName("I" + type.name) : "@memberof " + exportName(type.parent), + "@interface " + escapeName("I" + type.name) + ]; + type.fieldsArray.forEach(function(field) { + var prop = util.safeProp(field.name); // either .name or ["name"] + prop = prop.substring(1, prop.charAt(0) === "[" ? prop.length - 1 : prop.length); + var jsType = toJsType(field, true); + if (field.optional) + jsType = jsType + "|null"; + typeDef.push("@property {" + jsType + "} " + (field.optional ? "[" + prop + "]" : prop) + " " + (field.comment || type.name + " " + field.name)); + }); + push(""); + pushComment(typeDef); + } + + // constructor + push(""); + pushComment([ + "Constructs a new " + type.name + ".", + type.parent instanceof protobuf.Root ? "@exports " + escapeName(type.name) : "@memberof " + exportName(type.parent), + "@classdesc " + (type.comment || "Represents " + aOrAn(type.name) + "."), + config.comments ? "@implements " + escapeName("I" + type.name) : null, + "@constructor", + "@param {" + exportName(type, true) + "=} [" + (config.beautify ? "properties" : "p") + "] Properties to set" + ]); + buildFunction(type, type.name, Type.generateConstructor(type)); + + // default values + var firstField = true; + type.fieldsArray.forEach(function(field) { + field.resolve(); + var prop = util.safeProp(field.name); + if (config.comments) { + push(""); + var jsType = toJsType(field, false); + if (field.optional && !field.map && !field.repeated && field.resolvedType instanceof Type) + jsType = jsType + "|null|undefined"; + pushComment([ + field.comment || type.name + " " + field.name + ".", + "@member {" + jsType + "} " + field.name, + "@memberof " + exportName(type), + "@instance" + ]); + } else if (firstField) { + push(""); + firstField = false; + } + if (field.repeated) + push(escapeName(type.name) + ".prototype" + prop + " = $util.emptyArray;"); // overwritten in constructor + else if (field.map) + push(escapeName(type.name) + ".prototype" + prop + " = $util.emptyObject;"); // overwritten in constructor + else if (field.long) + push(escapeName(type.name) + ".prototype" + prop + " = $util.Long ? $util.Long.fromBits(" + + JSON.stringify(field.typeDefault.low) + "," + + JSON.stringify(field.typeDefault.high) + "," + + JSON.stringify(field.typeDefault.unsigned) + + ") : " + field.typeDefault.toNumber(field.type.charAt(0) === "u") + ";"); + else if (field.bytes) { + push(escapeName(type.name) + ".prototype" + prop + " = $util.newBuffer(" + JSON.stringify(Array.prototype.slice.call(field.typeDefault)) + ");"); + } else + push(escapeName(type.name) + ".prototype" + prop + " = " + JSON.stringify(field.typeDefault) + ";"); + }); + + // virtual oneof fields + var firstOneOf = true; + type.oneofsArray.forEach(function(oneof) { + if (firstOneOf) { + firstOneOf = false; + push(""); + if (config.comments) + push("// OneOf field names bound to virtual getters and setters"); + push((config.es6 ? "let" : "var") + " $oneOfFields;"); + } + oneof.resolve(); + push(""); + pushComment([ + oneof.comment || type.name + " " + oneof.name + ".", + "@member {" + oneof.oneof.map(JSON.stringify).join("|") + "|undefined} " + escapeName(oneof.name), + "@memberof " + exportName(type), + "@instance" + ]); + push("Object.defineProperty(" + escapeName(type.name) + ".prototype, " + JSON.stringify(oneof.name) +", {"); + ++indent; + push("get: $util.oneOfGetter($oneOfFields = [" + oneof.oneof.map(JSON.stringify).join(", ") + "]),"); + push("set: $util.oneOfSetter($oneOfFields)"); + --indent; + push("});"); + }); + + if (config.create) { + push(""); + pushComment([ + "Creates a new " + type.name + " instance using the specified properties.", + "@function create", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type, true) + "=} [properties] Properties to set", + "@returns {" + exportName(type) + "} " + type.name + " instance" + ]); + push(escapeName(type.name) + ".create = function create(properties) {"); + ++indent; + push("return new " + escapeName(type.name) + "(properties);"); + --indent; + push("};"); + } + + if (config.encode) { + push(""); + pushComment([ + "Encodes the specified " + type.name + " message. Does not implicitly {@link " + exportName(type) + ".verify|verify} messages.", + "@function encode", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type, !config.forceMessage) + "} " + (config.beautify ? "message" : "m") + " " + type.name + " message or plain object to encode", + "@param {$protobuf.Writer} [" + (config.beautify ? "writer" : "w") + "] Writer to encode to", + "@returns {$protobuf.Writer} Writer" + ]); + buildFunction(type, "encode", protobuf.encoder(type)); + + if (config.delimited) { + push(""); + pushComment([ + "Encodes the specified " + type.name + " message, length delimited. Does not implicitly {@link " + exportName(type) + ".verify|verify} messages.", + "@function encodeDelimited", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type, !config.forceMessage) + "} message " + type.name + " message or plain object to encode", + "@param {$protobuf.Writer} [writer] Writer to encode to", + "@returns {$protobuf.Writer} Writer" + ]); + push(escapeName(type.name) + ".encodeDelimited = function encodeDelimited(message, writer) {"); + ++indent; + push("return this.encode(message, writer).ldelim();"); + --indent; + push("};"); + } + } + + if (config.decode) { + push(""); + pushComment([ + "Decodes " + aOrAn(type.name) + " message from the specified reader or buffer.", + "@function decode", + "@memberof " + exportName(type), + "@static", + "@param {$protobuf.Reader|Uint8Array} " + (config.beautify ? "reader" : "r") + " Reader or buffer to decode from", + "@param {number} [" + (config.beautify ? "length" : "l") + "] Message length if known beforehand", + "@returns {" + exportName(type) + "} " + type.name, + "@throws {Error} If the payload is not a reader or valid buffer", + "@throws {$protobuf.util.ProtocolError} If required fields are missing" + ]); + buildFunction(type, "decode", protobuf.decoder(type)); + + if (config.delimited) { + push(""); + pushComment([ + "Decodes " + aOrAn(type.name) + " message from the specified reader or buffer, length delimited.", + "@function decodeDelimited", + "@memberof " + exportName(type), + "@static", + "@param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from", + "@returns {" + exportName(type) + "} " + type.name, + "@throws {Error} If the payload is not a reader or valid buffer", + "@throws {$protobuf.util.ProtocolError} If required fields are missing" + ]); + push(escapeName(type.name) + ".decodeDelimited = function decodeDelimited(reader) {"); + ++indent; + push("if (!(reader instanceof $Reader))"); + ++indent; + push("reader = new $Reader(reader);"); + --indent; + push("return this.decode(reader, reader.uint32());"); + --indent; + push("};"); + } + } + + if (config.verify) { + push(""); + pushComment([ + "Verifies " + aOrAn(type.name) + " message.", + "@function verify", + "@memberof " + exportName(type), + "@static", + "@param {Object.} " + (config.beautify ? "message" : "m") + " Plain object to verify", + "@returns {string|null} `null` if valid, otherwise the reason why it is not" + ]); + buildFunction(type, "verify", protobuf.verifier(type)); + } + + if (config.convert) { + if (config.fromObject) { + push(""); + pushComment([ + "Creates " + aOrAn(type.name) + " message from a plain object. Also converts values to their respective internal types.", + "@function fromObject", + "@memberof " + exportName(type), + "@static", + "@param {Object.} " + (config.beautify ? "object" : "d") + " Plain object", + "@returns {" + exportName(type) + "} " + type.name + ]); + buildFunction(type, "fromObject", protobuf.converter.fromObject(type)); + } + + push(""); + pushComment([ + "Creates a plain object from " + aOrAn(type.name) + " message. Also converts values to other types if specified.", + "@function toObject", + "@memberof " + exportName(type), + "@static", + "@param {" + exportName(type) + "} " + (config.beautify ? "message" : "m") + " " + type.name, + "@param {$protobuf.IConversionOptions} [" + (config.beautify ? "options" : "o") + "] Conversion options", + "@returns {Object.} Plain object" + ]); + buildFunction(type, "toObject", protobuf.converter.toObject(type)); + + push(""); + pushComment([ + "Converts this " + type.name + " to JSON.", + "@function toJSON", + "@memberof " + exportName(type), + "@instance", + "@returns {Object.} JSON object" + ]); + push(escapeName(type.name) + ".prototype.toJSON = function toJSON() {"); + ++indent; + push("return this.constructor.toObject(this, $protobuf.util.toJSONOptions);"); + --indent; + push("};"); + } +} + +function buildService(ref, service) { + + push(""); + pushComment([ + "Constructs a new " + service.name + " service.", + service.parent instanceof protobuf.Root ? "@exports " + escapeName(service.name) : "@memberof " + exportName(service.parent), + "@classdesc " + (service.comment || "Represents " + aOrAn(service.name)), + "@extends $protobuf.rpc.Service", + "@constructor", + "@param {$protobuf.RPCImpl} rpcImpl RPC implementation", + "@param {boolean} [requestDelimited=false] Whether requests are length-delimited", + "@param {boolean} [responseDelimited=false] Whether responses are length-delimited" + ]); + push("function " + escapeName(service.name) + "(rpcImpl, requestDelimited, responseDelimited) {"); + ++indent; + push("$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);"); + --indent; + push("}"); + push(""); + push("(" + escapeName(service.name) + ".prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = " + escapeName(service.name) + ";"); + + if (config.create) { + push(""); + pushComment([ + "Creates new " + service.name + " service using the specified rpc implementation.", + "@function create", + "@memberof " + exportName(service), + "@static", + "@param {$protobuf.RPCImpl} rpcImpl RPC implementation", + "@param {boolean} [requestDelimited=false] Whether requests are length-delimited", + "@param {boolean} [responseDelimited=false] Whether responses are length-delimited", + "@returns {" + escapeName(service.name) + "} RPC service. Useful where requests and/or responses are streamed." + ]); + push(escapeName(service.name) + ".create = function create(rpcImpl, requestDelimited, responseDelimited) {"); + ++indent; + push("return new this(rpcImpl, requestDelimited, responseDelimited);"); + --indent; + push("};"); + } + + service.methodsArray.forEach(function(method) { + method.resolve(); + var lcName = protobuf.util.lcFirst(method.name), + cbName = escapeName(method.name + "Callback"); + push(""); + pushComment([ + "Callback as used by {@link " + exportName(service) + "#" + escapeName(lcName) + "}.", + // This is a more specialized version of protobuf.rpc.ServiceCallback + "@memberof " + exportName(service), + "@typedef " + cbName, + "@type {function}", + "@param {Error|null} error Error, if any", + "@param {" + exportName(method.resolvedResponseType) + "} [response] " + method.resolvedResponseType.name + ]); + push(""); + pushComment([ + method.comment || "Calls " + method.name + ".", + "@function " + lcName, + "@memberof " + exportName(service), + "@instance", + "@param {" + exportName(method.resolvedRequestType, !config.forceMessage) + "} request " + method.resolvedRequestType.name + " message or plain object", + "@param {" + exportName(service) + "." + cbName + "} callback Node-style callback called with the error, if any, and " + method.resolvedResponseType.name, + "@returns {undefined}", + "@variation 1" + ]); + push("Object.defineProperty(" + escapeName(service.name) + ".prototype" + util.safeProp(lcName) + " = function " + escapeName(lcName) + "(request, callback) {"); + ++indent; + push("return this.rpcCall(" + escapeName(lcName) + ", $root." + exportName(method.resolvedRequestType) + ", $root." + exportName(method.resolvedResponseType) + ", request, callback);"); + --indent; + push("}, \"name\", { value: " + JSON.stringify(method.name) + " });"); + if (config.comments) + push(""); + pushComment([ + method.comment || "Calls " + method.name + ".", + "@function " + lcName, + "@memberof " + exportName(service), + "@instance", + "@param {" + exportName(method.resolvedRequestType, !config.forceMessage) + "} request " + method.resolvedRequestType.name + " message or plain object", + "@returns {Promise<" + exportName(method.resolvedResponseType) + ">} Promise", + "@variation 2" + ]); + }); +} + +function buildEnum(ref, enm) { + + push(""); + var comment = [ + enm.comment || enm.name + " enum.", + enm.parent instanceof protobuf.Root ? "@exports " + escapeName(enm.name) : "@name " + exportName(enm), + config.forceEnumString ? "@enum {number}" : "@enum {string}", + ]; + Object.keys(enm.values).forEach(function(key) { + var val = config.forceEnumString ? key : enm.values[key]; + comment.push((config.forceEnumString ? "@property {string} " : "@property {number} ") + key + "=" + val + " " + (enm.comments[key] || key + " value")); + }); + pushComment(comment); + push(escapeName(ref) + "." + escapeName(enm.name) + " = (function() {"); + ++indent; + push((config.es6 ? "const" : "var") + " valuesById = {}, values = Object.create(valuesById);"); + var aliased = []; + Object.keys(enm.values).forEach(function(key) { + var valueId = enm.values[key]; + var val = config.forceEnumString ? JSON.stringify(key) : valueId; + if (aliased.indexOf(valueId) > -1) + push("values[" + JSON.stringify(key) + "] = " + val + ";"); + else { + push("values[valuesById[" + valueId + "] = " + JSON.stringify(key) + "] = " + val + ";"); + aliased.push(valueId); + } + }); + push("return values;"); + --indent; + push("})();"); +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/util.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/util.js new file mode 100644 index 00000000..40ad29d4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/util.js @@ -0,0 +1,183 @@ +"use strict"; +var fs = require("fs"), + path = require("path"), + child_process = require("child_process"); + +var semver; + +try { + // installed as a peer dependency + require.resolve("@apollo/protobufjs"); + exports.pathToProtobufJs = "@apollo/protobufjs"; +} catch (e) { + // local development, i.e. forked from github + exports.pathToProtobufJs = ".."; +} + +var protobuf = require(exports.pathToProtobufJs); + +function basenameCompare(a, b) { + var aa = String(a).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g), + bb = String(b).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g); + for (var i = 0, k = Math.min(aa.length, bb.length); i < k; i++) { + var x = parseFloat(aa[i]) || aa[i].toLowerCase(), + y = parseFloat(bb[i]) || bb[i].toLowerCase(); + if (x < y) + return -1; + if (x > y) + return 1; + } + return a.length < b.length ? -1 : 0; +} + +exports.requireAll = function requireAll(dirname) { + dirname = path.join(__dirname, dirname); + var files = fs.readdirSync(dirname).sort(basenameCompare), + all = {}; + files.forEach(function(file) { + var basename = path.basename(file, ".js"), + extname = path.extname(file); + if (extname === ".js") + all[basename] = require(path.join(dirname, file)); + }); + return all; +}; + +exports.traverse = function traverse(current, fn) { + fn(current); + if (current.fieldsArray) + current.fieldsArray.forEach(function(field) { + traverse(field, fn); + }); + if (current.oneofsArray) + current.oneofsArray.forEach(function(oneof) { + traverse(oneof, fn); + }); + if (current.methodsArray) + current.methodsArray.forEach(function(method) { + traverse(method, fn); + }); + if (current.nestedArray) + current.nestedArray.forEach(function(nested) { + traverse(nested, fn); + }); +}; + +exports.traverseResolved = function traverseResolved(current, fn) { + fn(current); + if (current.resolvedType) + traverseResolved(current.resolvedType, fn); + if (current.resolvedKeyType) + traverseResolved(current.resolvedKeyType, fn); + if (current.resolvedRequestType) + traverseResolved(current.resolvedRequestType, fn); + if (current.resolvedResponseType) + traverseResolved(current.resolvedResponseType, fn); +}; + +exports.inspect = function inspect(object, indent) { + if (!object) + return ""; + var chalk = require("chalk"); + var sb = []; + if (!indent) + indent = ""; + var ind = indent ? indent.substring(0, indent.length - 2) + "└ " : ""; + sb.push( + ind + chalk.bold(object.toString()) + (object.visible ? " (visible)" : ""), + indent + chalk.gray("parent: ") + object.parent + ); + if (object instanceof protobuf.Field) { + if (object.extend !== undefined) + sb.push(indent + chalk.gray("extend: ") + object.extend); + if (object.partOf) + sb.push(indent + chalk.gray("oneof : ") + object.oneof); + } + sb.push(""); + if (object.fieldsArray) + object.fieldsArray.forEach(function(field) { + sb.push(inspect(field, indent + " ")); + }); + if (object.oneofsArray) + object.oneofsArray.forEach(function(oneof) { + sb.push(inspect(oneof, indent + " ")); + }); + if (object.methodsArray) + object.methodsArray.forEach(function(service) { + sb.push(inspect(service, indent + " ")); + }); + if (object.nestedArray) + object.nestedArray.forEach(function(nested) { + sb.push(inspect(nested, indent + " ")); + }); + return sb.join("\n"); +}; + +function modExists(name, version) { + for (var i = 0; i < module.paths.length; ++i) { + try { + var pkg = JSON.parse(fs.readFileSync(path.join(module.paths[i], name, "package.json"))); + return semver + ? semver.satisfies(pkg.version, version) + : parseInt(pkg.version, 10) === parseInt(version.replace(/^[\^~]/, ""), 10); // used for semver only + } catch (e) {/**/} + } + return false; +} + +function modInstall(install) { + child_process.execSync("npm --silent install " + (typeof install === "string" ? install : install.join(" ")), { + cwd: __dirname, + stdio: "ignore" + }); +} + +exports.setup = function() { + var pkg = require(path.join(__dirname, "..", "package.json")); + var version = pkg.dependencies["semver"] || pkg.devDependencies["semver"]; + if (!modExists("semver", version)) { + process.stderr.write("installing semver@" + version + "\n"); + modInstall("semver@" + version); + } + semver = require("semver"); // used from now on for version comparison + var install = []; + pkg.cliDependencies.forEach(function(name) { + if (name === "semver") + return; + version = pkg.dependencies[name] || pkg.devDependencies[name]; + if (!modExists(name, version)) { + process.stderr.write("installing " + name + "@" + version + "\n"); + install.push(name + "@" + version); + } + }); + require("../scripts/postinstall"); // emit postinstall warning, if any + if (!install.length) + return; + modInstall(install); +}; + +exports.wrap = function(OUTPUT, options) { + var name = options.wrap || "default"; + var wrap; + try { + // try built-in wrappers first + wrap = fs.readFileSync(path.join(__dirname, "wrappers", name + ".js")).toString("utf8"); + } catch (e) { + // otherwise fetch the custom one + wrap = fs.readFileSync(path.resolve(process.cwd(), name)).toString("utf8"); + } + wrap = wrap.replace(/\$DEPENDENCY/g, JSON.stringify(options.dependency || "@apollo/protobufjs")); + wrap = wrap.replace(/( *)\$OUTPUT;/, function($0, $1) { + return $1.length ? OUTPUT.replace(/^/mg, $1) : OUTPUT; + }); + if (options.lint !== "") + wrap = "/*" + options.lint + "*/\n" + wrap; + return wrap.replace(/\r?\n/g, "\n"); +}; + +exports.pad = function(str, len, l) { + while (str.length < len) + str = l ? str + " " : " " + str; + return str; +}; + diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/amd.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/amd.js new file mode 100644 index 00000000..c43dd73c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/amd.js @@ -0,0 +1,7 @@ +define([$DEPENDENCY], function($protobuf) { + "use strict"; + + $OUTPUT; + + return $root; +}); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/closure.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/closure.js new file mode 100644 index 00000000..c94327c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/closure.js @@ -0,0 +1,7 @@ +(function($protobuf) { + "use strict"; + + $OUTPUT; + + return $root; +})(protobuf); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/commonjs.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/commonjs.js new file mode 100644 index 00000000..6dc91684 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/commonjs.js @@ -0,0 +1,7 @@ +"use strict"; + +var $protobuf = require($DEPENDENCY); + +$OUTPUT; + +module.exports = $root; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/default.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/default.js new file mode 100644 index 00000000..34b29ec7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/default.js @@ -0,0 +1,15 @@ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define([$DEPENDENCY], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require($DEPENDENCY)); + +})(this, function($protobuf) { + "use strict"; + + $OUTPUT; + + return $root; +}); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/es6.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/es6.js new file mode 100644 index 00000000..33246d70 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/cli/wrappers/es6.js @@ -0,0 +1,5 @@ +import $protobuf from $DEPENDENCY; + +$OUTPUT; + +export { $root as default }; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/README.md new file mode 100644 index 00000000..93a54ccd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the full library. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/README.md new file mode 100644 index 00000000..2122c3fd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the light library suitable for use with reflection, static code and JSON descriptors / modules. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js new file mode 100644 index 00000000..8d3676ff --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js @@ -0,0 +1,7199 @@ +/*! + * protobuf.js (c) 2016, daniel wirtz + * licensed under the bsd-3-clause license + * see: https://github.com/apollographql/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + +},{}],4:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = fetch; + +var asPromise = require(1), + inquire = require(7); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; + +},{"1":1,"7":7}],6:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],7:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],8:[function(require,module,exports){ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; + +},{}],9:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],10:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],11:[function(require,module,exports){ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require(14), + util = require(33); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop, ref) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (ref === undefined) { + ref = "d" + prop; + } + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof %s!==\"object\")", ref) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(%s)", prop, fieldIndex, ref); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(%s)", prop, ref); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=%s>>>0", prop, ref); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=%s|0", prop, ref); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(%s)).unsigned=%j", prop, ref, isUnsigned) + ("else if(typeof %s===\"string\")", ref) + ("m%s=parseInt(%s,10)", prop, ref) + ("else if(typeof %s===\"number\")", ref) + ("m%s=%s", prop, ref) + ("else if(typeof %s===\"object\")", ref) + ("m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)", prop, ref, ref, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof %s===\"string\")", ref) + ("util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)", ref, prop, ref) + ("else if(%s.length)", ref) + ("m%s=%s", prop, ref); + break; + case "string": gen + ("m%s=String(%s)", prop, ref); + break; + case "bool": gen + ("m%s=Boolean(%s)", prop, ref); + break; + /* default: gen + ("m%s=%s", prop, ref); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("r.skip().pos++") // assumes id 1 + key wireType + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("k=r.%s()", field.keyType) + ("r.pos++"); // assumes id 2 + value wireType + if (types.long[field.keyType] !== undefined) { + if (types.basic[type] === undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=r.%s()", ref, type); + } else { + if (types.basic[type] === undefined) gen + ("%s[k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[k]=r.%s()", ref, type); + } + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0); + return; + } + var key = (field.id << 3 | 2) >>> 0; + if (field.preEncoded()) { + gen("if (%s instanceof Uint8Array) {", ref) + ("w.uint32(%i)", key) + ("w.bytes(%s)", ref) + ("} else {"); + } + gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, key); + if (field.preEncoded()) { + gen("}") + } +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { + var arrayRef = ref; + if (field.useToArray()) { + arrayRef = "array" + field.id; + gen("var %s", arrayRef); + gen("if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }", + ref, ref, arrayRef, ref, arrayRef, ref); + } + gen("if(%s!=null&&%s.length){", arrayRef, arrayRef); // !== undefined && !== null + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", arrayRef) + ("w.%s(%s[i])", type, arrayRef) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", arrayRef); + if (wireType === undefined) + genTypePartial(gen, field, index, arrayRef + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, arrayRef); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +},{"14":14,"32":32,"33":33}],14:[function(require,module,exports){ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require(21), + util = require(33); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +},{"21":21,"22":22,"33":33}],15:[function(require,module,exports){ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require(14), + types = require(32), + util = require(33); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +Field.prototype.useToArray = function useToArray() { + return !!this.getOption("(js_use_toArray)"); +}; + +Field.prototype.preEncoded = function preEncoded() { + return !!this.getOption("(js_preEncoded)"); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; + +},{"14":14,"22":22,"32":32,"33":33}],16:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(17); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require(13); +protobuf.decoder = require(12); +protobuf.verifier = require(36); +protobuf.converter = require(11); + +// Reflection +protobuf.ReflectionObject = require(22); +protobuf.Namespace = require(21); +protobuf.Root = require(26); +protobuf.Enum = require(14); +protobuf.Type = require(31); +protobuf.Field = require(15); +protobuf.OneOf = require(23); +protobuf.MapField = require(18); +protobuf.Service = require(30); +protobuf.Method = require(20); + +// Runtime +protobuf.Message = require(19); +protobuf.wrappers = require(37); + +// Utility +protobuf.types = require(32); +protobuf.util = require(33); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); + +},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"36":36,"37":37}],17:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(38); +protobuf.BufferWriter = require(39); +protobuf.Reader = require(24); +protobuf.BufferReader = require(25); + +// Utility +protobuf.util = require(35); +protobuf.rpc = require(28); +protobuf.roots = require(27); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); + +},{"24":24,"25":25,"27":27,"28":28,"35":35,"38":38,"39":39}],18:[function(require,module,exports){ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require(15); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require(32), + util = require(33); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; + +},{"15":15,"32":32,"33":33}],19:[function(require,module,exports){ +"use strict"; +module.exports = Message; + +var util = require(35); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ +},{"35":35}],20:[function(require,module,exports){ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require(33); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; + +},{"22":22,"33":33}],21:[function(require,module,exports){ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require(22); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require(15), + util = require(33); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; + +},{"15":15,"22":22,"33":33}],22:[function(require,module,exports){ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require(33); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; + +},{"33":33}],23:[function(require,module,exports){ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require(22); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require(15), + util = require(33); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; + +},{"15":15,"22":22,"33":33}],24:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(35); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"35":35}],25:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(24); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(35); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +},{"24":24,"35":35}],26:[function(require,module,exports){ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require(21); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require(15), + Enum = require(14), + OneOf = require(23), + util = require(33); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Bundled definition existence checking + function getBundledFileName(filename) { + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) return altname; + } + return null; + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = (getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = (getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + util.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; + +},{"14":14,"15":15,"21":21,"23":23,"33":33}],27:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],28:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(29); + +},{"29":29}],29:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(35); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"35":35}],30:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require(21); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require(20), + util = require(33), + rpc = require(28); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; + +},{"20":20,"21":21,"28":28,"33":33}],31:[function(require,module,exports){ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require(21); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require(14), + OneOf = require(23), + Field = require(15), + MapField = require(18), + Service = require(30), + Message = require(19), + Reader = require(24), + Writer = require(38), + util = require(33), + encoder = require(13), + decoder = require(12), + verifier = require(36), + converter = require(11), + wrappers = require(37); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + name = name.replace(/\W/g, ""); + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; + +},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"36":36,"37":37,"38":38}],32:[function(require,module,exports){ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require(33); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); + +},{"33":33}],33:[function(require,module,exports){ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require(35); + +var roots = require(27); + +var Type, // cyclic + Enum; + +util.codegen = require(3); +util.fetch = require(5); +util.path = require(8); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require(31); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require(14); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require(26))()); + } +}); + +},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"5":5,"8":8}],34:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(35); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/* + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"35":35}],35:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(4); + +// float handling accross browsers +util.float = require(6); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(7); + +// converts to / from utf8 encoded strings +util.utf8 = require(10); + +// provides a node-like buffer pool in the browser +util.pool = require(9); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(34); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/* + * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on + * for this package's tests but have it be off in actual usage-reporting-protobuf use. + * (We leave it on for some mode where there is no `process` that is used by tests.) + */ +util.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long")) : undefined; + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/* + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/* + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"10":10,"2":2,"34":34,"4":4,"6":6,"7":7,"9":9}],36:[function(require,module,exports){ +"use strict"; +module.exports = verifier; + +var Enum = require(14), + util = require(33); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require(19); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + var type = this.lookup(object["@type"]); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + return this.create({ + type_url: "/" + type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + var name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + object["@type"] = message.$type.fullName; + return object; + } + + return this.toObject(message, options); + } +}; + +},{"19":19}],38:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(35); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; + +},{"35":35}],39:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(38); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(35); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +},{"35":35,"38":38}]},{},[16]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js.map b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js.map new file mode 100644 index 00000000..7f3b7552 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light","../src/index-minimal.js","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3XA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(14),\n util = require(33);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop, ref) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (ref === undefined) {\n ref = \"d\" + prop;\n }\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof %s!==\\\"object\\\")\", ref)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(%s)\", prop, fieldIndex, ref);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(%s)\", prop, ref); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=%s>>>0\", prop, ref);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=%s|0\", prop, ref);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(%s)).unsigned=%j\", prop, ref, isUnsigned)\n (\"else if(typeof %s===\\\"string\\\")\", ref)\n (\"m%s=parseInt(%s,10)\", prop, ref)\n (\"else if(typeof %s===\\\"number\\\")\", ref)\n (\"m%s=%s\", prop, ref)\n (\"else if(typeof %s===\\\"object\\\")\", ref)\n (\"m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)\", prop, ref, ref, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof %s===\\\"string\\\")\", ref)\n (\"util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)\", ref, prop, ref)\n (\"else if(%s.length)\", ref)\n (\"m%s=%s\", prop, ref);\n break;\n case \"string\": gen\n (\"m%s=String(%s)\", prop, ref);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(%s)\", prop, ref);\n break;\n /* default: gen\n (\"m%s=%s\", prop, ref);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"r.skip().pos++\") // assumes id 1 + key wireType\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"k=r.%s()\", field.keyType)\n (\"r.pos++\"); // assumes id 2 + value wireType\n if (types.long[field.keyType] !== undefined) {\n if (types.basic[type] === undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\n } else {\n if (types.basic[type] === undefined) gen\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[k]=r.%s()\", ref, type);\n }\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0);\n return;\n }\n var key = (field.id << 3 | 2) >>> 0;\n if (field.preEncoded()) {\n gen(\"if (%s instanceof Uint8Array) {\", ref)\n (\"w.uint32(%i)\", key)\n (\"w.bytes(%s)\", ref)\n (\"} else {\");\n }\n gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, key);\n if (field.preEncoded()) {\n gen(\"}\")\n }\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) {\n var arrayRef = ref;\n if (field.useToArray()) {\n arrayRef = \"array\" + field.id;\n gen(\"var %s\", arrayRef);\n gen(\"if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }\",\n ref, ref, arrayRef, ref, arrayRef, ref);\n }\n gen(\"if(%s!=null&&%s.length){\", arrayRef, arrayRef); // !== undefined && !== null\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", arrayRef)\n (\"w.%s(%s[i])\", type, arrayRef)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", arrayRef);\n if (wireType === undefined)\n genTypePartial(gen, field, index, arrayRef + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, arrayRef);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(21),\n util = require(33);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(14),\n types = require(32),\n util = require(33);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\nField.prototype.useToArray = function useToArray() {\n return !!this.getOption(\"(js_use_toArray)\");\n};\n\nField.prototype.preEncoded = function preEncoded() {\n return !!this.getOption(\"(js_preEncoded)\");\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(13);\nprotobuf.decoder = require(12);\nprotobuf.verifier = require(36);\nprotobuf.converter = require(11);\n\n// Reflection\nprotobuf.ReflectionObject = require(22);\nprotobuf.Namespace = require(21);\nprotobuf.Root = require(26);\nprotobuf.Enum = require(14);\nprotobuf.Type = require(31);\nprotobuf.Field = require(15);\nprotobuf.OneOf = require(23);\nprotobuf.MapField = require(18);\nprotobuf.Service = require(30);\nprotobuf.Method = require(20);\n\n// Runtime\nprotobuf.Message = require(19);\nprotobuf.wrappers = require(37);\n\n// Utility\nprotobuf.types = require(32);\nprotobuf.util = require(33);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(38);\nprotobuf.BufferWriter = require(39);\nprotobuf.Reader = require(24);\nprotobuf.BufferReader = require(25);\n\n// Utility\nprotobuf.util = require(35);\nprotobuf.rpc = require(28);\nprotobuf.roots = require(27);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.Reader._configure(protobuf.BufferReader);\n protobuf.util._configure();\n}\n\n// Set up buffer utility according to the environment\nprotobuf.Writer._configure(protobuf.BufferWriter);\nconfigure();\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(15);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(32),\n util = require(33);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(35);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(33);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(15),\n util = require(33);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(33);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(15),\n util = require(33);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(35);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(24);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(35);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\n/* istanbul ignore else */\nif (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(21);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(15),\n Enum = require(14),\n OneOf = require(23),\n util = require(33);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\t\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname; \n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = (getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = (getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n util.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(29);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(35);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(21);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(20),\n util = require(33),\n rpc = require(28);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(21);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(14),\n OneOf = require(23),\n Field = require(15),\n MapField = require(18),\n Service = require(30),\n Message = require(19),\n Reader = require(24),\n Writer = require(38),\n util = require(33),\n encoder = require(13),\n decoder = require(12),\n verifier = require(36),\n converter = require(11),\n wrappers = require(37);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n name = name.replace(/\\W/g, \"\");\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(33);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(35);\n\nvar roots = require(27);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(31);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(14);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(26))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(35);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/*\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(34);\n\n// global object reference\nutil.global = typeof window !== \"undefined\" && window\n || typeof global !== \"undefined\" && global\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n * @const\n */\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/*\n * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on\n * for this package's tests but have it be off in actual usage-reporting-protobuf use.\n * (We leave it on for some mode where there is no `process` that is used by tests.)\n */\nutil.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\")) : undefined;\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/*\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/*\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(14),\n util = require(33);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(19);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n var type = this.lookup(object[\"@type\"]);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n return this.create({\n type_url: \"/\" + type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n object[\"@type\"] = message.$type.fullName;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(35);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(38);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(35);\n\nvar Buffer = util.Buffer;\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\nBufferWriter.alloc = function alloc_buffer(size) {\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\n};\n\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else\n buf.utf8Write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js new file mode 100644 index 00000000..47b8e61f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js @@ -0,0 +1,7 @@ +/*! + * protobuf.js (c) 2016, daniel wirtz + * licensed under the bsd-3-clause license + * see: https://github.com/apollographql/protobuf.js for details + */ +!function(g){"use strict";var r,e,t,i;r={1:[function(t,i){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,u=!0;for(;r>2],r=(3&f)<<4,o=1;break;case 1:s[u++]=h[r|f>>4],r=(15&f)<<2,o=2;break;case 2:s[u++]=h[r|f>>6],s[u++]=h[63&f],o=0}8191>4,r=o,s=2;break;case 2:i[n++]=(15&r)<<4|(60&o)>>2,r=o,s=3;break;case 3:i[n++]=(3&r)<<6|o,s=0}}if(1===s)throw Error(c);return n-e},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i){function a(i,n){"string"==typeof i&&(n=i,i=g);var f=[];function h(t){if("string"!=typeof t){var i=c();if(a.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0,n,r);else if(i<11754943508222875e-54)t((e<<31|Math.round(i/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(i)/Math.LN2);t((e<<31|s+127<<23|8388607&Math.round(i*Math.pow(2,-s)*8388608))>>>0,n,r)}}function i(t,i,n){var r=t(i,n),e=2*(r>>31)+1,s=r>>>23&255,u=8388607&r;return 255===s?u?NaN:e*(1/0):0===s?1401298464324817e-60*e*u:e*Math.pow(2,s-150)*(u+8388608)}o.writeFloatLE=t.bind(null,r),o.writeFloatBE=t.bind(null,e),o.readFloatLE=i.bind(null,s),o.readFloatBE=i.bind(null,u)}(),"undefined"!=typeof Float64Array?function(){var r=new Float64Array([-0]),e=new Uint8Array(r.buffer),t=128===e[7];function i(t,i,n){r[0]=t,i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2],i[n+3]=e[3],i[n+4]=e[4],i[n+5]=e[5],i[n+6]=e[6],i[n+7]=e[7]}function n(t,i,n){r[0]=t,i[n]=e[7],i[n+1]=e[6],i[n+2]=e[5],i[n+3]=e[4],i[n+4]=e[3],i[n+5]=e[2],i[n+6]=e[1],i[n+7]=e[0]}function s(t,i){return e[0]=t[i],e[1]=t[i+1],e[2]=t[i+2],e[3]=t[i+3],e[4]=t[i+4],e[5]=t[i+5],e[6]=t[i+6],e[7]=t[i+7],r[0]}function u(t,i){return e[7]=t[i],e[6]=t[i+1],e[5]=t[i+2],e[4]=t[i+3],e[3]=t[i+4],e[2]=t[i+5],e[1]=t[i+6],e[0]=t[i+7],r[0]}o.writeDoubleLE=t?i:n,o.writeDoubleBE=t?n:i,o.readDoubleLE=t?s:u,o.readDoubleBE=t?u:s}():function(){function t(t,i,n,r,e,s){var u=r<0?1:0;if(u&&(r=-r),0===r)t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n);else if(isNaN(r))t(0,e,s+i),t(2146959360,e,s+n);else if(17976931348623157e292>>0,e,s+n);else{var o;if(r<22250738585072014e-324)t((o=r/5e-324)>>>0,e,s+i),t((u<<31|o/4294967296)>>>0,e,s+n);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(o=r*Math.pow(2,-f))>>>0,e,s+i),t((u<<31|f+1023<<20|1048576*o&1048575)>>>0,e,s+n)}}}function i(t,i,n,r,e){var s=t(r,e+i),u=t(r,e+n),o=2*(u>>31)+1,f=u>>>20&2047,h=4294967296*(1048575&u)+s;return 2047===f?h?NaN:o*(1/0):0===f?5e-324*o*h:o*Math.pow(2,f-1075)*(h+4503599627370496)}o.writeDoubleLE=t.bind(null,r,0,4),o.writeDoubleBE=t.bind(null,e,4,0),o.readDoubleLE=i.bind(null,s,0,4),o.readDoubleBE=i.bind(null,u,4,0)}(),o}function r(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function e(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function s(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function u(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=n(n)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var r=n,s=r.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},e=r.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=s(t),r="";n&&(r=i.shift()+"/");for(var e=0;e>>1,u=null,o=e;return function(t){if(t<1||s>10),s[u++]=56320+(1023&r)):s[u++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(u+1)))?(r=65536+((1023&r)<<10)+(1023&e),++u,i[n++]=r>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i,n){var r=n,l=t(14),v=t(33);function o(t,i,n,r,e){if(e===g&&(e="d"+r),i.resolvedType)if(i.resolvedType instanceof l){t("switch(%s){",e);for(var s=i.resolvedType.values,u=Object.keys(s),o=0;o>>0",r,e);break;case"int32":case"sint32":case"sfixed32":t("m%s=%s|0",r,e);break;case"uint64":f=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(%s)).unsigned=%j",r,e,f)('else if(typeof %s==="string")',e)("m%s=parseInt(%s,10)",r,e)('else if(typeof %s==="number")',e)("m%s=%s",r,e)('else if(typeof %s==="object")',e)("m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)",r,e,e,f?"true":"");break;case"bytes":t('if(typeof %s==="string")',e)("util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)",e,r,e)("else if(%s.length)",e)("m%s=%s",r,e);break;case"string":t("m%s=String(%s)",r,e);break;case"bool":t("m%s=Boolean(%s)",r,e)}}return t}function d(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}r.fromObject=function(t){var i=t.fieldsArray,n=v.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>0,8|a.mapKey[s.keyType],s.keyType),f===g?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,o,i),n("}")("}");else if(s.repeated){var h=i;s.useToArray()&&(h="array"+s.id,n("var %s",h),n("if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }",i,i,h,i,h,i)),n("if(%s!=null&&%s.length){",h,h),s.packed&&a.packed[o]!==g?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",h)("w.%s(%s[i])",o,h)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",h),f===g?v(n,s,u,h+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|f)>>>0,o,h)),n("}")}else s.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),f===g?v(n,s,u,i):n("w.uint32(%i).%s(%s)",(s.id<<3|f)>>>0,o,i)}return n("return w")};var c=t(14),a=t(32),l=t(33);function v(t,i,n,r){if(i.resolvedType.group)t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0);else{var e=(i.id<<3|2)>>>0;i.preEncoded()&&t("if (%s instanceof Uint8Array) {",r)("w.uint32(%i)",e)("w.bytes(%s)",r)("} else {"),t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,e),i.preEncoded()&&t("}")}}},{14:14,32:32,33:33}],14:[function(t,i){i.exports=e;var o=t(22);((e.prototype=Object.create(o.prototype)).constructor=e).className="Enum";var n=t(21),r=t(33);function e(t,i,n,r,e){if(o.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.reserved=g,i)for(var s=Object.keys(i),u=0;ui)return!0;return!1},h.isReservedName=function(t,i){if(t)for(var n=0;n "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}var f,h="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function c(){var t=new e(0,0),i=0;if(!(4=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function a(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function l(){if(this.pos+8>this.len)throw u(this,8);return new e(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}o.create=r.Buffer?function(t){return(o.create=function(t){return r.Buffer.isBuffer(t)?new n(t):h(t)})(t)}:h,o.prototype.f=r.Array.prototype.subarray||r.Array.prototype.slice,o.prototype.uint32=(f=4294967295,function(){if(f=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return f;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return f}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return a(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|a(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.f.call(this.buf,i,n)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.r=function(t){n=t;var i=r.Long?"toLong":"toNumber";r.merge(o.prototype,{int64:function(){return c.call(this)[i](!1)},uint64:function(){return c.call(this)[i](!0)},sint64:function(){return c.call(this).zzDecode()[i](!1)},fixed64:function(){return l.call(this)[i](!0)},sfixed64:function(){return l.call(this)[i](!1)}})}},{35:35}],25:[function(t,i){i.exports=e;var n=t(24);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(35);function e(t){n.call(this,t)}r.Buffer&&(e.prototype.f=r.Buffer.prototype.slice),e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len))}},{24:24,35:35}],26:[function(t,i){i.exports=n;var r=t(21);((n.prototype=Object.create(r.prototype)).constructor=n).className="Root";var e,v,d,s=t(15),u=t(14),o=t(23),y=t(33);function n(t){r.call(this,"",t),this.deferred=[],this.files=[]}function b(){}n.fromJSON=function(t,i){return i||(i=new n),t.options&&i.setOptions(t.options),i.addJSON(t.nested)},n.prototype.resolvePath=y.path.resolve,n.prototype.load=function t(i,s,e){"function"==typeof s&&(e=s,s=g);var u=this;if(!e)return y.asPromise(t,u,i,s);var o=e===b;function f(t,i){if(e){var n=e;if(e=null,o)throw t;n(t,i)}}function h(t){var i=t.lastIndexOf("google/protobuf/");if(-1>>0,this.hi=i>>>0}var s=e.zero=new e(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var r=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(t){if(0===t)return s;var i=t<0;i&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return i&&(r=~r>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++r&&(r=0))),new e(n,r)},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(n.isString(t)){if(!n.Long)return e.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,n=~this.hi>>>0;return i||(n=n+1>>>0),-(i+4294967296*n)}return this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;e.fromHash=function(t){return t===r?s:new e((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{35:35}],35:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function d(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}c.create=r.Buffer?function(){return(c.create=function(){return new n})()}:function(){return new c},c.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(c.alloc=r.pool(c.alloc,r.Array.prototype.subarray)),c.prototype.b=function(t,i,n){return this.tail=this.tail.next=new o(t,i,n),this.len+=i,this},(l.prototype=Object.create(o.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new l((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this.b(v,10,e.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(t){var i=e.from(t);return this.b(v,i.length(),i)},c.prototype.sint64=function(t){var i=e.from(t).zzEncode();return this.b(v,i.length(),i)},c.prototype.bool=function(t){return this.b(a,1,t?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(t){return this.b(d,4,t>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(t){var i=e.from(t);return this.b(d,4,i.lo).b(d,4,i.hi)},c.prototype.float=function(t){return this.b(r.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this.b(r.float.writeDoubleLE,8,t)};var y=r.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;if(!i)return this.b(a,1,0);if(r.isString(t)){var n=c.alloc(i=s.length(t));s.decode(t,n,0),t=n}return this.uint32(i).b(y,i,t)},c.prototype.string=function(t){var i=u.length(t);return i?this.uint32(i).b(u.write,i,t):this.b(a,1,0)},c.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new o(f,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},c.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},c.r=function(t){n=t}},{35:35}],39:[function(t,i){i.exports=s;var n=t(38);(s.prototype=Object.create(n.prototype)).constructor=s;var r=t(35),e=r.Buffer;function s(){n.call(this)}s.alloc=function(t){return(s.alloc=r.y)(t)};var u=e&&e.prototype instanceof Uint8Array&&"set"===e.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.b(u,i,t),this},s.prototype.string=function(t){var i=e.byteLength(t);return this.uint32(i),i&&this.b(o,i,t),this}},{35:35,38:38}]},e={},t=[16],i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]),i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js.map b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js.map new file mode 100644 index 00000000..86075f3f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/light/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light","../src/index-minimal.js","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","charAt","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","codegen","functionParams","functionName","body","Codegen","formatStringOrScope","source","toString","verbose","console","log","scopeKeys","Object","keys","scopeParams","scopeValues","scopeOffset","Function","formatParams","formatOffset","replace","$0","$1","value","floor","JSON","stringify","functionNameOverride","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","fetch","asPromise","fs","inquire","filename","options","callback","xhr","readFile","contents","XMLHttpRequest","binary","onreadystatechange","readyState","status","response","responseText","Uint8Array","overrideMimeType","responseType","open","send","factory","Float32Array","f32","f8b","le","writeFloat_f32_cpy","val","buf","pos","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","writeFloat_ieee754","writeUint","sign","isNaN","round","exponent","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","moduleName","mod","eval","e","path","isAbsolute","normalize","split","absolute","prefix","shift","originPath","includePath","alreadyNormalized","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","converter","Enum","util","genValuePartial_fromObject","gen","field","fieldIndex","prop","ref","resolvedType","values","repeated","typeDefault","fullName","isUnsigned","type","genValuePartial_toObject","fromObject","mtype","fields","fieldsArray","name","safeProp","map","arrayRef","useToArray","id","toObject","sort","compareFieldsById","repeatedFields","mapFields","normalFields","partOf","valuesById","long","low","high","unsigned","toNumber","bytes","arrayDefault","hasKs2","_fieldsArray","indexOf","filter","group","keyType","types","basic","packed","rfield","required","wireType","mapKey","genTypePartial","optional","key","preEncoded","ReflectionObject","create","constructor","className","Namespace","comment","comments","TypeError","reserved","fromJSON","json","enm","toJSON","toJSONOptions","keepComments","add","isString","isInteger","isReservedId","isReservedName","allow_alias","remove","Field","Type","ruleRe","rule","extend","isObject","toLowerCase","message","defaultValue","Long","extensionField","declaringField","_packed","defineProperty","get","getOption","setOption","ifNotSet","resolved","defaults","parent","lookupTypeOrEnum","fromNumber","freeze","newBuffer","emptyObject","emptyArray","ctor","d","fieldId","fieldType","fieldRule","decorateType","decorateEnum","fieldName","default","_configure","Type_","build","load","root","Root","loadSync","encoder","decoder","verifier","OneOf","MapField","Service","Method","Message","wrappers","configure","Reader","BufferReader","Writer","BufferWriter","rpc","roots","resolvedKeyType","fieldKeyType","fieldValueType","properties","$type","writer","encodeDelimited","reader","decodeDelimited","verify","object","requestType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","lookupType","arrayToJSON","array","obj","nested","_nestedArray","clearCache","namespace","addJSON","toArray","nestedArray","nestedJson","names","methods","getEnum","prev","setOptions","onAdd","onRemove","define","isArray","ptr","part","resolveAll","lookup","filterTypes","parentAlreadyChecked","found","lookupEnum","lookupService","Service_","Enum_","defineProperties","unshift","_handleAdd","_handleRemove","Root_","fieldNames","oneof","addFieldsToParent","oneofName","oneOfGetter","set","oneOfSetter","LongBits","indexOutOfRange","writeLength","RangeError","create_array","readLongVarint","bits","readFixed32_end","readFixed64","Buffer","isBuffer","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","skip","skipType","BufferReader_","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","parse","common","deferred","files","SYNC","resolvePath","self","sync","finish","cb","getBundledFileName","idx","lastIndexOf","altname","substring","process","parsed","imports","weakImports","queued","weak","setTimeout","readFileSync","isNode","exposeRe","tryHandleExtension","extendedType","sisterField","parse_","common_","rpcImpl","requestDelimited","responseDelimited","rpcCall","method","requestCtor","responseCtor","request","endedByRPC","_methodsArray","service","inherited","methodsArray","rpcService","methodName","lcFirst","isReserved","m","q","s","oneofs","extensions","_fieldsById","_oneofsArray","_ctor","fieldsById","oneofsArray","generateConstructor","ctorProperties","setup","wrapper","originalThis","fork","ldelim","typeName","target","bake","o","safePropBackslashRe","safePropQuoteRe","ucFirst","str","toUpperCase","camelCaseRe","camelCase","a","decorateRoot","enumerable","decorateEnumIndex","zero","zzEncode","zeroHash","from","parseInt","fromString","toLong","fromHash","hash","toHash","mask","part0","part1","part2","dst","src","newError","CustomError","captureStackTrace","stack","pool","global","window","versions","node","Number","isFinite","isset","isSet","hasOwnProperty","utf8Write","_Buffer_from","_Buffer_allocUnsafe","sizeOrArray","env","ENABLE_LONG","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","ProtocolError","fieldMap","longs","enums","encoding","allocUnsafe","seenFirstField","invalid","genVerifyKey","genVerifyValue","oneofProp","expected","type_url","substr","Op","next","noop","State","head","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","reset","BufferWriter_","writeBytesBuffer","copy","writeStringBuffer","byteLength","$require","$module","amd","isLong"],"mappings":";;;;;CAAA,SAAAA,GAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,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SACA4jB,EAAA5jB,QAGA2jB,CAAAhkB,EAAA,IAGAC,EAAA6L,KAAA2U,OAAAxgB,SAAAA,EAGA,mBAAA0W,QAAAA,OAAAuN,KACAvN,OAAA,CAAA,QAAA,SAAArF,GAKA,OAJAA,GAAAA,EAAA6S,SACAlkB,EAAA6L,KAAAwF,KAAAA,EACArR,EAAAgU,aAEAhU,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(14),\n util = require(33);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop, ref) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (ref === undefined) {\n ref = \"d\" + prop;\n }\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof %s!==\\\"object\\\")\", ref)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(%s)\", prop, fieldIndex, ref);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(%s)\", prop, ref); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=%s>>>0\", prop, ref);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=%s|0\", prop, ref);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(%s)).unsigned=%j\", prop, ref, isUnsigned)\n (\"else if(typeof %s===\\\"string\\\")\", ref)\n (\"m%s=parseInt(%s,10)\", prop, ref)\n (\"else if(typeof %s===\\\"number\\\")\", ref)\n (\"m%s=%s\", prop, ref)\n (\"else if(typeof %s===\\\"object\\\")\", ref)\n (\"m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)\", prop, ref, ref, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof %s===\\\"string\\\")\", ref)\n (\"util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)\", ref, prop, ref)\n (\"else if(%s.length)\", ref)\n (\"m%s=%s\", prop, ref);\n break;\n case \"string\": gen\n (\"m%s=String(%s)\", prop, ref);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(%s)\", prop, ref);\n break;\n /* default: gen\n (\"m%s=%s\", prop, ref);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"r.skip().pos++\") // assumes id 1 + key wireType\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"k=r.%s()\", field.keyType)\n (\"r.pos++\"); // assumes id 2 + value wireType\n if (types.long[field.keyType] !== undefined) {\n if (types.basic[type] === undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\n } else {\n if (types.basic[type] === undefined) gen\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[k]=r.%s()\", ref, type);\n }\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0);\n return;\n }\n var key = (field.id << 3 | 2) >>> 0;\n if (field.preEncoded()) {\n gen(\"if (%s instanceof Uint8Array) {\", ref)\n (\"w.uint32(%i)\", key)\n (\"w.bytes(%s)\", ref)\n (\"} else {\");\n }\n gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, key);\n if (field.preEncoded()) {\n gen(\"}\")\n }\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) {\n var arrayRef = ref;\n if (field.useToArray()) {\n arrayRef = \"array\" + field.id;\n gen(\"var %s\", arrayRef);\n gen(\"if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }\",\n ref, ref, arrayRef, ref, arrayRef, ref);\n }\n gen(\"if(%s!=null&&%s.length){\", arrayRef, arrayRef); // !== undefined && !== null\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", arrayRef)\n (\"w.%s(%s[i])\", type, arrayRef)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", arrayRef);\n if (wireType === undefined)\n genTypePartial(gen, field, index, arrayRef + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, arrayRef);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(21),\n util = require(33);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(14),\n types = require(32),\n util = require(33);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\nField.prototype.useToArray = function useToArray() {\n return !!this.getOption(\"(js_use_toArray)\");\n};\n\nField.prototype.preEncoded = function preEncoded() {\n return !!this.getOption(\"(js_preEncoded)\");\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(13);\nprotobuf.decoder = require(12);\nprotobuf.verifier = require(36);\nprotobuf.converter = require(11);\n\n// Reflection\nprotobuf.ReflectionObject = require(22);\nprotobuf.Namespace = require(21);\nprotobuf.Root = require(26);\nprotobuf.Enum = require(14);\nprotobuf.Type = require(31);\nprotobuf.Field = require(15);\nprotobuf.OneOf = require(23);\nprotobuf.MapField = require(18);\nprotobuf.Service = require(30);\nprotobuf.Method = require(20);\n\n// Runtime\nprotobuf.Message = require(19);\nprotobuf.wrappers = require(37);\n\n// Utility\nprotobuf.types = require(32);\nprotobuf.util = require(33);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(38);\nprotobuf.BufferWriter = require(39);\nprotobuf.Reader = require(24);\nprotobuf.BufferReader = require(25);\n\n// Utility\nprotobuf.util = require(35);\nprotobuf.rpc = require(28);\nprotobuf.roots = require(27);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.Reader._configure(protobuf.BufferReader);\n protobuf.util._configure();\n}\n\n// Set up buffer utility according to the environment\nprotobuf.Writer._configure(protobuf.BufferWriter);\nconfigure();\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(15);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(32),\n util = require(33);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(35);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(33);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(15),\n util = require(33);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(33);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(22);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(15),\n util = require(33);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(35);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(24);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(35);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\n/* istanbul ignore else */\nif (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(21);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(15),\n Enum = require(14),\n OneOf = require(23),\n util = require(33);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\t\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname; \n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = (getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = (getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n util.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(29);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(35);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(21);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(20),\n util = require(33),\n rpc = require(28);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(21);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(14),\n OneOf = require(23),\n Field = require(15),\n MapField = require(18),\n Service = require(30),\n Message = require(19),\n Reader = require(24),\n Writer = require(38),\n util = require(33),\n encoder = require(13),\n decoder = require(12),\n verifier = require(36),\n converter = require(11),\n wrappers = require(37);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n name = name.replace(/\\W/g, \"\");\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(33);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(35);\n\nvar roots = require(27);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(31);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(14);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(26))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(35);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/*\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(34);\n\n// global object reference\nutil.global = typeof window !== \"undefined\" && window\n || typeof global !== \"undefined\" && global\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n * @const\n */\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/*\n * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on\n * for this package's tests but have it be off in actual usage-reporting-protobuf use.\n * (We leave it on for some mode where there is no `process` that is used by tests.)\n */\nutil.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\")) : undefined;\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/*\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/*\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(14),\n util = require(33);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(19);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n var type = this.lookup(object[\"@type\"]);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n return this.create({\n type_url: \"/\" + type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n object[\"@type\"] = message.$type.fullName;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(35);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(38);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(35);\n\nvar Buffer = util.Buffer;\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\nBufferWriter.alloc = function alloc_buffer(size) {\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\n};\n\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else\n buf.utf8Write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/README.md new file mode 100644 index 00000000..5eeb5718 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/README.md @@ -0,0 +1,31 @@ +This folder contains prebuilt browser versions of the minimal library suitable for use with statically generated code only. When sending pull requests, it is not required to update these. + +Prebuilt files are in source control to enable pain-free frontend respectively CDN usage: + +CDN usage +--------- + +Development: +``` + +``` + +Production: +``` + +``` + +**NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon. + +Frontend usage +-------------- + +Development: +``` + +``` + +Production: +``` + +``` diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js new file mode 100644 index 00000000..285bf932 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js @@ -0,0 +1,2675 @@ +/*! + * protobuf.js (c) 2016, daniel wirtz + * licensed under the bsd-3-clause license + * see: https://github.com/apollographql/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],4:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],6:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],7:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],8:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(16); +protobuf.BufferWriter = require(17); +protobuf.Reader = require(9); +protobuf.BufferReader = require(10); + +// Utility +protobuf.util = require(15); +protobuf.rpc = require(12); +protobuf.roots = require(11); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); + +},{"10":10,"11":11,"12":12,"15":15,"16":16,"17":17,"9":9}],9:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(15); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"15":15}],10:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(9); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(15); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +},{"15":15,"9":9}],11:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],12:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(13); + +},{"13":13}],13:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(15); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"15":15}],14:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(15); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/* + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"15":15}],15:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(3); + +// float handling accross browsers +util.float = require(4); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(5); + +// converts to / from utf8 encoded strings +util.utf8 = require(7); + +// provides a node-like buffer pool in the browser +util.pool = require(6); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(14); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/* + * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on + * for this package's tests but have it be off in actual usage-reporting-protobuf use. + * (We leave it on for some mode where there is no `process` that is used by tests.) + */ +util.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long")) : undefined; + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/* + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/* + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"14":14,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7}],16:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(15); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; + +},{"15":15}],17:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(16); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(15); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +},{"15":15,"16":16}]},{},[8]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js.map b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js.map new file mode 100644 index 00000000..19e1df43 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/index-minimal","../src/reader.js","../src/reader_buffer.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/util/longbits.js","../src/util/minimal.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(16);\nprotobuf.BufferWriter = require(17);\nprotobuf.Reader = require(9);\nprotobuf.BufferReader = require(10);\n\n// Utility\nprotobuf.util = require(15);\nprotobuf.rpc = require(12);\nprotobuf.roots = require(11);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.Reader._configure(protobuf.BufferReader);\n protobuf.util._configure();\n}\n\n// Set up buffer utility according to the environment\nprotobuf.Writer._configure(protobuf.BufferWriter);\nconfigure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(15);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(9);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\n/* istanbul ignore else */\nif (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(13);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(15);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(15);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/*\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(3);\n\n// float handling accross browsers\nutil.float = require(4);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(5);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(7);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(6);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(14);\n\n// global object reference\nutil.global = typeof window !== \"undefined\" && window\n || typeof global !== \"undefined\" && global\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n * @const\n */\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/*\n * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on\n * for this package's tests but have it be off in actual usage-reporting-protobuf use.\n * (We leave it on for some mode where there is no `process` that is used by tests.)\n */\nutil.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\")) : undefined;\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/*\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/*\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(15);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(16);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(15);\n\nvar Buffer = util.Buffer;\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\nBufferWriter.alloc = function alloc_buffer(size) {\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\n};\n\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else\n buf.utf8Write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js new file mode 100644 index 00000000..8ef8b51c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js @@ -0,0 +1,7 @@ +/*! + * protobuf.js (c) 2016, daniel wirtz + * licensed under the bsd-3-clause license + * see: https://github.com/apollographql/protobuf.js for details + */ +!function(b){"use strict";var r,u,t,n;r={1:[function(t,n){n.exports=function(t,n){var i=Array(arguments.length-1),e=0,r=2,s=!0;for(;r>2],r=(3&f)<<4,h=1;break;case 1:e[s++]=o[r|f>>4],r=(15&f)<<2,h=2;break;case 2:e[s++]=o[r|f>>6],e[s++]=o[63&f],h=0}8191>4,r=h,e=2;break;case 2:n[i++]=(15&r)<<4|(60&h)>>2,r=h,e=3;break;case 3:n[i++]=(3&r)<<6|h,e=0}}if(1===e)throw Error(c);return i-u},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,n){function i(){this.t={}}(n.exports=i).prototype.on=function(t,n,i){return(this.t[t]||(this.t[t]=[])).push({fn:n,ctx:i||this}),this},i.prototype.off=function(t,n){if(t===b)this.t={};else if(n===b)this.t[t]=[];else for(var i=this.t[t],r=0;r>>0,i,r);else if(n<11754943508222875e-54)t((u<<31|Math.round(n/1401298464324817e-60))>>>0,i,r);else{var e=Math.floor(Math.log(n)/Math.LN2);t((u<<31|e+127<<23|8388607&Math.round(n*Math.pow(2,-e)*8388608))>>>0,i,r)}}function n(t,n,i){var r=t(n,i),u=2*(r>>31)+1,e=r>>>23&255,s=8388607&r;return 255===e?s?NaN:u*(1/0):0===e?1401298464324817e-60*u*s:u*Math.pow(2,e-150)*(s+8388608)}h.writeFloatLE=t.bind(null,r),h.writeFloatBE=t.bind(null,u),h.readFloatLE=n.bind(null,e),h.readFloatBE=n.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var r=new Float64Array([-0]),u=new Uint8Array(r.buffer),t=128===u[7];function n(t,n,i){r[0]=t,n[i]=u[0],n[i+1]=u[1],n[i+2]=u[2],n[i+3]=u[3],n[i+4]=u[4],n[i+5]=u[5],n[i+6]=u[6],n[i+7]=u[7]}function i(t,n,i){r[0]=t,n[i]=u[7],n[i+1]=u[6],n[i+2]=u[5],n[i+3]=u[4],n[i+4]=u[3],n[i+5]=u[2],n[i+6]=u[1],n[i+7]=u[0]}function e(t,n){return u[0]=t[n],u[1]=t[n+1],u[2]=t[n+2],u[3]=t[n+3],u[4]=t[n+4],u[5]=t[n+5],u[6]=t[n+6],u[7]=t[n+7],r[0]}function s(t,n){return u[7]=t[n],u[6]=t[n+1],u[5]=t[n+2],u[4]=t[n+3],u[3]=t[n+4],u[2]=t[n+5],u[1]=t[n+6],u[0]=t[n+7],r[0]}h.writeDoubleLE=t?n:i,h.writeDoubleBE=t?i:n,h.readDoubleLE=t?e:s,h.readDoubleBE=t?s:e}():function(){function t(t,n,i,r,u,e){var s=r<0?1:0;if(s&&(r=-r),0===r)t(0,u,e+n),t(0<1/r?0:2147483648,u,e+i);else if(isNaN(r))t(0,u,e+n),t(2146959360,u,e+i);else if(17976931348623157e292>>0,u,e+i);else{var h;if(r<22250738585072014e-324)t((h=r/5e-324)>>>0,u,e+n),t((s<<31|h/4294967296)>>>0,u,e+i);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(h=r*Math.pow(2,-f))>>>0,u,e+n),t((s<<31|f+1023<<20|1048576*h&1048575)>>>0,u,e+i)}}}function n(t,n,i,r,u){var e=t(r,u+n),s=t(r,u+i),h=2*(s>>31)+1,f=s>>>20&2047,o=4294967296*(1048575&s)+e;return 2047===f?o?NaN:h*(1/0):0===f?5e-324*h*o:h*Math.pow(2,f-1075)*(o+4503599627370496)}h.writeDoubleLE=t.bind(null,r,0,4),h.writeDoubleBE=t.bind(null,u,4,0),h.readDoubleLE=n.bind(null,e,0,4),h.readDoubleBE=n.bind(null,s,4,0)}(),h}function r(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}function u(t,n,i){n[i]=t>>>24,n[i+1]=t>>>16&255,n[i+2]=t>>>8&255,n[i+3]=255&t}function e(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function s(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}n.exports=i(i)},{}],5:[function(t,n,i){function r(t){try{var n=eval("require")(t);if(n&&(n.length||Object.keys(n).length))return n}catch(t){}return null}n.exports=r},{}],6:[function(t,n){n.exports=function(i,r,t){var u=t||8192,e=u>>>1,s=null,h=u;return function(t){if(t<1||e>10),e[s++]=56320+(1023&r)):e[s++]=(15&r)<<12|(63&t[n++])<<6|63&t[n++],8191>6|192:(55296==(64512&r)&&56320==(64512&(u=t.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&u),++s,n[i++]=r>>18|240,n[i++]=r>>12&63|128):n[i++]=r>>12|224,n[i++]=r>>6&63|128),n[i++]=63&r|128);return i-e}},{}],8:[function(t,n,i){var r=i;function u(){r.Reader.n(r.BufferReader),r.util.n()}r.build="minimal",r.Writer=t(16),r.BufferWriter=t(17),r.Reader=t(9),r.BufferReader=t(10),r.util=t(15),r.rpc=t(12),r.roots=t(11),r.configure=u,r.Writer.n(r.BufferWriter),u()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(t,n){n.exports=h;var i,r=t(15),u=r.LongBits,e=r.utf8;function s(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function h(t){this.buf=t,this.pos=0,this.len=t.length}var f,o="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new h(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new h(t);throw Error("illegal buffer")};function c(){var t=new u(0,0),n=0;if(!(4=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function a(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function l(){if(this.pos+8>this.len)throw s(this,8);return new u(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}h.create=r.Buffer?function(t){return(h.create=function(t){return r.Buffer.isBuffer(t)?new i(t):o(t)})(t)}:o,h.prototype.i=r.Array.prototype.subarray||r.Array.prototype.slice,h.prototype.uint32=(f=4294967295,function(){if(f=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return f;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return f}),h.prototype.int32=function(){return 0|this.uint32()},h.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},h.prototype.bool=function(){return 0!==this.uint32()},h.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return a(this.buf,this.pos+=4)},h.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|a(this.buf,this.pos+=4)},h.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},h.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},h.prototype.bytes=function(){var t=this.uint32(),n=this.pos,i=this.pos+t;if(i>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,i):n===i?new this.buf.constructor(0):this.i.call(this.buf,n,i)},h.prototype.string=function(){var t=this.bytes();return e.read(t,0,t.length)},h.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},h.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},h.n=function(t){i=t;var n=r.Long?"toLong":"toNumber";r.merge(h.prototype,{int64:function(){return c.call(this)[n](!1)},uint64:function(){return c.call(this)[n](!0)},sint64:function(){return c.call(this).zzDecode()[n](!1)},fixed64:function(){return l.call(this)[n](!0)},sfixed64:function(){return l.call(this)[n](!1)}})}},{15:15}],10:[function(t,n){n.exports=u;var i=t(9);(u.prototype=Object.create(i.prototype)).constructor=u;var r=t(15);function u(t){i.call(this,t)}r.Buffer&&(u.prototype.i=r.Buffer.prototype.slice),u.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len))}},{15:15,9:9}],11:[function(t,n){n.exports={}},{}],12:[function(t,n,i){i.Service=t(13)},{13:13}],13:[function(t,n){n.exports=i;var h=t(15);function i(t,n,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");h.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!n,this.responseDelimited=!!i}((i.prototype=Object.create(h.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function t(i,n,r,u,e){if(!u)throw TypeError("request must be specified");var s=this;if(!e)return h.asPromise(t,s,i,n,r,u);if(!s.rpcImpl)return setTimeout(function(){e(Error("already ended"))},0),b;try{return s.rpcImpl(i,n[s.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(t,n){if(t)return s.emit("error",t,i),e(t);if(null===n)return s.end(!0),b;if(!(n instanceof r))try{n=r[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,i),e(t)}return s.emit("data",n,i),e(null,n)})}catch(t){return s.emit("error",t,i),setTimeout(function(){e(t)},0),b}},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(t,n){n.exports=u;var i=t(15);function u(t,n){this.lo=t>>>0,this.hi=n>>>0}var e=u.zero=new u(0,0);e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1};var r=u.zeroHash="\0\0\0\0\0\0\0\0";u.fromNumber=function(t){if(0===t)return e;var n=t<0;n&&(t=-t);var i=t>>>0,r=(t-i)/4294967296>>>0;return n&&(r=~r>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++r&&(r=0))),new u(i,r)},u.from=function(t){if("number"==typeof t)return u.fromNumber(t);if(i.isString(t)){if(!i.Long)return u.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new u(t.low>>>0,t.high>>>0):e},u.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var n=1+~this.lo>>>0,i=~this.hi>>>0;return n||(i=i+1>>>0),-(n+4294967296*i)}return this.lo+4294967296*this.hi},u.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var s=String.prototype.charCodeAt;u.fromHash=function(t){return t===r?e:new u((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},u.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},u.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},u.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},u.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:i<128?9:10}},{15:15}],15:[function(t,n,i){var r=i;function u(t,n,i){for(var r=Object.keys(n),u=0;u>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;n[i++]=t.lo}function w(t,n,i){n[i]=255&t,n[i+1]=t>>>8&255,n[i+2]=t>>>16&255,n[i+3]=t>>>24}c.create=r.Buffer?function(){return(c.create=function(){return new i})()}:function(){return new c},c.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(c.alloc=r.pool(c.alloc,r.Array.prototype.subarray)),c.prototype.e=function(t,n,i){return this.tail=this.tail.next=new h(t,n,i),this.len+=n,this},(l.prototype=Object.create(h.prototype)).fn=function(t,n,i){for(;127>>=7;n[i]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new l((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this.e(v,10,u.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.int64=c.prototype.uint64=function(t){var n=u.from(t);return this.e(v,n.length(),n)},c.prototype.sint64=function(t){var n=u.from(t).zzEncode();return this.e(v,n.length(),n)},c.prototype.bool=function(t){return this.e(a,1,t?1:0)},c.prototype.sfixed32=c.prototype.fixed32=function(t){return this.e(w,4,t>>>0)},c.prototype.sfixed64=c.prototype.fixed64=function(t){var n=u.from(t);return this.e(w,4,n.lo).e(w,4,n.hi)},c.prototype.float=function(t){return this.e(r.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this.e(r.float.writeDoubleLE,8,t)};var y=r.Array.prototype.set?function(t,n,i){n.set(t,i)}:function(t,n,i){for(var r=0;r>>0;if(!n)return this.e(a,1,0);if(r.isString(t)){var i=c.alloc(n=e.length(t));e.decode(t,i,0),t=i}return this.uint32(n).e(y,n,t)},c.prototype.string=function(t){var n=s.length(t);return n?this.uint32(n).e(s.write,n,t):this.e(a,1,0)},c.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new h(f,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new h(f,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,n=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=n,this.len+=i),this},c.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,n,i),i+=t.len,t=t.next;return n},c.n=function(t){i=t}},{15:15}],17:[function(t,n){n.exports=e;var i=t(16);(e.prototype=Object.create(i.prototype)).constructor=e;var r=t(15),u=r.Buffer;function e(){i.call(this)}e.alloc=function(t){return(e.alloc=r.u)(t)};var s=u&&u.prototype instanceof Uint8Array&&"set"===u.prototype.set.name?function(t,n,i){n.set(t,i)}:function(t,n,i){if(t.copy)t.copy(n,i,0,t.length);else for(var r=0;r>>0;return this.uint32(n),n&&this.e(s,n,t),this},e.prototype.string=function(t){var n=u.byteLength(t);return this.uint32(n),n&&this.e(h,n,t),this}},{15:15,16:16}]},u={},t=[8],n=function t(n){var i=u[n];return i||r[n][0].call(i=u[n]={exports:{}},t,i,i.exports),i.exports}(t[0]),n.util.global.protobuf=n,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(n.util.Long=t,n.configure()),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js.map b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js.map new file mode 100644 index 00000000..a16a39ef --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/minimal/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/index-minimal","../src/reader.js","../src/reader_buffer.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/util/longbits.js","../src/util/minimal.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","charAt","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","factory","Float32Array","f32","f8b","Uint8Array","le","writeFloat_f32_cpy","val","buf","pos","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","writeFloat_ieee754","writeUint","sign","isNaN","round","exponent","floor","log","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","inquire","moduleName","mod","eval","Object","keys","e","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","configure","Reader","_configure","BufferReader","util","build","Writer","BufferWriter","rpc","roots","LongBits","indexOutOfRange","reader","writeLength","RangeError","value","create_array","isArray","readLongVarint","bits","readFixed32_end","readFixed64","create","Buffer","isBuffer","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","bytes","constructor","skip","skipType","wireType","BufferReader_","Long","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","Service","rpcImpl","requestDelimited","responseDelimited","TypeError","rpcCall","method","requestCtor","responseCtor","request","callback","self","asPromise","setTimeout","finish","response","endedByRPC","zero","toNumber","zzEncode","zeroHash","fromNumber","from","isString","parseInt","fromString","low","high","unsigned","toLong","fromHash","hash","toHash","mask","part0","part1","part2","dst","src","ifNotSet","newError","name","CustomError","message","properties","defineProperty","get","captureStackTrace","stack","toString","pool","global","window","emptyArray","freeze","emptyObject","isNode","process","versions","node","isInteger","Number","isFinite","isObject","isset","isSet","obj","prop","hasOwnProperty","utf8Write","_Buffer_from","_Buffer_allocUnsafe","newBuffer","sizeOrArray","env","ENABLE_LONG","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","lcFirst","str","toLowerCase","substring","ProtocolError","oneOfGetter","fieldNames","fieldMap","oneOfSetter","toJSONOptions","longs","enums","json","encoding","allocUnsafe","Op","next","noop","State","writer","head","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","set","fork","reset","ldelim","BufferWriter_","writeBytesBuffer","copy","writeStringBuffer","byteLength","$require","$module","define","amd","isLong"],"mappings":";;;;;CAAA,SAAAA,GAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,KAAAF,UAAAE,GACAI,EAAAG,MAAA,KAAAX,KAIA,IACAF,EAAAa,MAAAZ,GAAA,KAAAC,GACA,MAAAU,GACAJ,IACAA,GAAA,EACAG,EAAAC,gCCxCA,IAAAE,EAAAf,EAOAe,EAAAT,OAAA,SAAAU,GACA,IAAAC,EAAAD,EAAAV,OACA,IAAAW,EACA,OAAA,EAEA,IADA,IAAAC,EAAA,EAC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EAAAC,EAAAC,GACA,GAAAF,EAAA2O,KACA3O,EAAA2O,KAAA1O,EAAAC,EAAA,EAAAF,EAAAzD,aACA,IAAA,IAAAkB,EAAA,EAAAA,EAAAuC,EAAAzD,QACA0D,EAAAC,KAAAF,EAAAvC,MAgBA,SAAAmR,EAAA5O,EAAAC,EAAAC,GACAF,EAAAzD,OAAA,GACA+H,EAAAV,KAAAG,MAAA/D,EAAAC,EAAAC,GAEAD,EAAAyL,UAAA1L,EAAAE,GAdAuE,EAAAxF,UAAAoH,MAAA,SAAApB,GACAX,EAAAsE,SAAA3D,KACAA,EAAAX,EAAAqH,EAAA1G,EAAA,WACA,IAAApB,EAAAoB,EAAA1I,SAAA,EAIA,OAHAwC,KAAA8G,OAAAhC,GACAA,GACA9E,KAAAoP,EAAAO,EAAA7K,EAAAoB,GACAlG,MAaA0F,EAAAxF,UAAAhC,OAAA,SAAAgI,GACA,IAAApB,EAAA4B,EAAAoJ,WAAA5J,GAIA,OAHAlG,KAAA8G,OAAAhC,GACAA,GACA9E,KAAAoP,EAAAS,EAAA/K,EAAAoB,GACAlG,uBjBvEApD,KAAAC,MAcAC,EAPA,SAAAiT,EAAAhF,GACA,IAAAiF,EAAApT,EAAAmO,GAGA,OAFAiF,GACArT,EAAAoO,GAAA,GAAAnG,KAAAoL,EAAApT,EAAAmO,GAAA,CAAA7N,QAAA,IAAA6S,EAAAC,EAAAA,EAAA9S,SACA8S,EAAA9S,QAGA6S,CAAAlT,EAAA,IAGAC,EAAAyI,KAAAkG,OAAA3O,SAAAA,EAGA,mBAAAmT,QAAAA,OAAAC,KACAD,OAAA,CAAA,QAAA,SAAArI,GAKA,OAJAA,GAAAA,EAAAuI,SACArT,EAAAyI,KAAAqC,KAAAA,EACA9K,EAAAqI,aAEArI,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(16);\nprotobuf.BufferWriter = require(17);\nprotobuf.Reader = require(9);\nprotobuf.BufferReader = require(10);\n\n// Utility\nprotobuf.util = require(15);\nprotobuf.rpc = require(12);\nprotobuf.roots = require(11);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.Reader._configure(protobuf.BufferReader);\n protobuf.util._configure();\n}\n\n// Set up buffer utility according to the environment\nprotobuf.Writer._configure(protobuf.BufferWriter);\nconfigure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(15);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(9);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\n/* istanbul ignore else */\nif (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(13);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(15);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(15);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/*\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(3);\n\n// float handling accross browsers\nutil.float = require(4);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(5);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(7);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(6);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(14);\n\n// global object reference\nutil.global = typeof window !== \"undefined\" && window\n || typeof global !== \"undefined\" && global\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n * @const\n */\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/*\n * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on\n * for this package's tests but have it be off in actual usage-reporting-protobuf use.\n * (We leave it on for some mode where there is no `process` that is used by tests.)\n */\nutil.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\")) : undefined;\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/*\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/*\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(15);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(16);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(15);\n\nvar Buffer = util.Buffer;\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\nBufferWriter.alloc = function alloc_buffer(size) {\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\n};\n\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else\n buf.utf8Write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js new file mode 100644 index 00000000..d1f5a522 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js @@ -0,0 +1,8776 @@ +/*! + * protobuf.js (c) 2016, daniel wirtz + * licensed under the bsd-3-clause license + * see: https://github.com/apollographql/protobuf.js for details + */ +(function(undefined){"use strict";(function prelude(modules, cache, entries) { + + // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS + // sources through a conflict-free require shim and is again wrapped within an iife that + // provides a minification-friendly `undefined` var plus a global "use strict" directive + // so that minification can remove the directives of each module. + + function $require(name) { + var $module = cache[name]; + if (!$module) + modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports); + return $module.exports; + } + + var protobuf = $require(entries[0]); + + // Expose globally + protobuf.util.global.protobuf = protobuf; + + // Be nice to AMD + if (typeof define === "function" && define.amd) + define(["long"], function(Long) { + if (Long && Long.isLong) { + protobuf.util.Long = Long; + protobuf.configure(); + } + return protobuf; + }); + + // Be nice to CommonJS + if (typeof module === "object" && module && module.exports) + module.exports = protobuf; + +})/* end of prelude */({1:[function(require,module,exports){ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + +},{}],2:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + +},{}],3:[function(require,module,exports){ +"use strict"; +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + +},{}],4:[function(require,module,exports){ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + +},{}],5:[function(require,module,exports){ +"use strict"; +module.exports = fetch; + +var asPromise = require(1), + inquire = require(7); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; + +},{"1":1,"7":7}],6:[function(require,module,exports){ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + +},{}],7:[function(require,module,exports){ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + +},{}],8:[function(require,module,exports){ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; + +},{}],9:[function(require,module,exports){ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +},{}],10:[function(require,module,exports){ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + +},{}],11:[function(require,module,exports){ +"use strict"; +module.exports = common; + +var commonRe = /\/|\./; + +/** + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name + * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + * @returns {undefined} + * @property {INamespace} google/protobuf/any.proto Any + * @property {INamespace} google/protobuf/duration.proto Duration + * @property {INamespace} google/protobuf/empty.proto Empty + * @property {INamespace} google/protobuf/field_mask.proto FieldMask + * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue + * @property {INamespace} google/protobuf/timestamp.proto Timestamp + * @property {INamespace} google/protobuf/wrappers.proto Wrappers + * @example + * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) + * protobuf.common("descriptor", descriptorJson); + * + * // manually provides a custom definition (uses my.foo namespace) + * protobuf.common("my/foo/bar.proto", myFooBarJson); + */ +function common(name, json) { + if (!commonRe.test(name)) { + name = "google/protobuf/" + name + ".proto"; + json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; + } + common[name] = json; +} + +// Not provided because of limited use (feel free to discuss or to provide yourself): +// +// google/protobuf/descriptor.proto +// google/protobuf/source_context.proto +// google/protobuf/type.proto +// +// Stripped and pre-parsed versions of these non-bundled files are instead available as part of +// the repository or package within the google/protobuf directory. + +common("any", { + + /** + * Properties of a google.protobuf.Any message. + * @interface IAny + * @type {Object} + * @property {string} [typeUrl] + * @property {Uint8Array} [bytes] + * @memberof common + */ + Any: { + fields: { + type_url: { + type: "string", + id: 1 + }, + value: { + type: "bytes", + id: 2 + } + } + } +}); + +var timeType; + +common("duration", { + + /** + * Properties of a google.protobuf.Duration message. + * @interface IDuration + * @type {Object} + * @property {number} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Duration: timeType = { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } +}); + +common("timestamp", { + + /** + * Properties of a google.protobuf.Timestamp message. + * @interface ITimestamp + * @type {Object} + * @property {number} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Timestamp: timeType +}); + +common("empty", { + + /** + * Properties of a google.protobuf.Empty message. + * @interface IEmpty + * @memberof common + */ + Empty: { + fields: {} + } +}); + +common("struct", { + + /** + * Properties of a google.protobuf.Struct message. + * @interface IStruct + * @type {Object} + * @property {Object.} [fields] + * @memberof common + */ + Struct: { + fields: { + fields: { + keyType: "string", + type: "Value", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Value message. + * @interface IValue + * @type {Object} + * @property {string} [kind] + * @property {0} [nullValue] + * @property {number} [numberValue] + * @property {string} [stringValue] + * @property {boolean} [boolValue] + * @property {IStruct} [structValue] + * @property {IListValue} [listValue] + * @memberof common + */ + Value: { + oneofs: { + kind: { + oneof: [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + fields: { + nullValue: { + type: "NullValue", + id: 1 + }, + numberValue: { + type: "double", + id: 2 + }, + stringValue: { + type: "string", + id: 3 + }, + boolValue: { + type: "bool", + id: 4 + }, + structValue: { + type: "Struct", + id: 5 + }, + listValue: { + type: "ListValue", + id: 6 + } + } + }, + + NullValue: { + values: { + NULL_VALUE: 0 + } + }, + + /** + * Properties of a google.protobuf.ListValue message. + * @interface IListValue + * @type {Object} + * @property {Array.} [values] + * @memberof common + */ + ListValue: { + fields: { + values: { + rule: "repeated", + type: "Value", + id: 1 + } + } + } +}); + +common("wrappers", { + + /** + * Properties of a google.protobuf.DoubleValue message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + DoubleValue: { + fields: { + value: { + type: "double", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.FloatValue message. + * @interface IFloatValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FloatValue: { + fields: { + value: { + type: "float", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int64Value message. + * @interface IInt64Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int64Value: { + fields: { + value: { + type: "int64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt64Value message. + * @interface IUInt64Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt64Value: { + fields: { + value: { + type: "uint64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int32Value message. + * @interface IInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int32Value: { + fields: { + value: { + type: "int32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt32Value message. + * @interface IUInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt32Value: { + fields: { + value: { + type: "uint32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BoolValue message. + * @interface IBoolValue + * @type {Object} + * @property {boolean} [value] + * @memberof common + */ + BoolValue: { + fields: { + value: { + type: "bool", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.StringValue message. + * @interface IStringValue + * @type {Object} + * @property {string} [value] + * @memberof common + */ + StringValue: { + fields: { + value: { + type: "string", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BytesValue message. + * @interface IBytesValue + * @type {Object} + * @property {Uint8Array} [value] + * @memberof common + */ + BytesValue: { + fields: { + value: { + type: "bytes", + id: 1 + } + } + } +}); + +common("field_mask", { + + /** + * Properties of a google.protobuf.FieldMask message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FieldMask: { + fields: { + paths: { + rule: "repeated", + type: "string", + id: 1 + } + } + } +}); + +/** + * Gets the root definition of the specified common proto file. + * + * Bundled definitions are: + * - google/protobuf/any.proto + * - google/protobuf/duration.proto + * - google/protobuf/empty.proto + * - google/protobuf/field_mask.proto + * - google/protobuf/struct.proto + * - google/protobuf/timestamp.proto + * - google/protobuf/wrappers.proto + * + * @param {string} file Proto file name + * @returns {INamespace|null} Root definition or `null` if not defined + */ +common.get = function get(file) { + return common[file] || null; +}; + +},{}],12:[function(require,module,exports){ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require(15), + util = require(37); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop, ref) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (ref === undefined) { + ref = "d" + prop; + } + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof %s!==\"object\")", ref) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(%s)", prop, fieldIndex, ref); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(%s)", prop, ref); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=%s>>>0", prop, ref); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=%s|0", prop, ref); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(%s)).unsigned=%j", prop, ref, isUnsigned) + ("else if(typeof %s===\"string\")", ref) + ("m%s=parseInt(%s,10)", prop, ref) + ("else if(typeof %s===\"number\")", ref) + ("m%s=%s", prop, ref) + ("else if(typeof %s===\"object\")", ref) + ("m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)", prop, ref, ref, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof %s===\"string\")", ref) + ("util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)", ref, prop, ref) + ("else if(%s.length)", ref) + ("m%s=%s", prop, ref); + break; + case "string": gen + ("m%s=String(%s)", prop, ref); + break; + case "bool": gen + ("m%s=Boolean(%s)", prop, ref); + break; + /* default: gen + ("m%s=%s", prop, ref); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("r.skip().pos++") // assumes id 1 + key wireType + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("k=r.%s()", field.keyType) + ("r.pos++"); // assumes id 2 + value wireType + if (types.long[field.keyType] !== undefined) { + if (types.basic[type] === undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=r.%s()", ref, type); + } else { + if (types.basic[type] === undefined) gen + ("%s[k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[k]=r.%s()", ref, type); + } + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0); + return; + } + var key = (field.id << 3 | 2) >>> 0; + if (field.preEncoded()) { + gen("if (%s instanceof Uint8Array) {", ref) + ("w.uint32(%i)", key) + ("w.bytes(%s)", ref) + ("} else {"); + } + gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, key); + if (field.preEncoded()) { + gen("}") + } +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { + var arrayRef = ref; + if (field.useToArray()) { + arrayRef = "array" + field.id; + gen("var %s", arrayRef); + gen("if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }", + ref, ref, arrayRef, ref, arrayRef, ref); + } + gen("if(%s!=null&&%s.length){", arrayRef, arrayRef); // !== undefined && !== null + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", arrayRef) + ("w.%s(%s[i])", type, arrayRef) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", arrayRef); + if (wireType === undefined) + genTypePartial(gen, field, index, arrayRef + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, arrayRef); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +},{"15":15,"36":36,"37":37}],15:[function(require,module,exports){ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require(23), + util = require(37); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +},{"23":23,"24":24,"37":37}],16:[function(require,module,exports){ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require(15), + types = require(36), + util = require(37); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +Field.prototype.useToArray = function useToArray() { + return !!this.getOption("(js_use_toArray)"); +}; + +Field.prototype.preEncoded = function preEncoded() { + return !!this.getOption("(js_preEncoded)"); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; + +},{"15":15,"24":24,"36":36,"37":37}],17:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(18); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require(14); +protobuf.decoder = require(13); +protobuf.verifier = require(40); +protobuf.converter = require(12); + +// Reflection +protobuf.ReflectionObject = require(24); +protobuf.Namespace = require(23); +protobuf.Root = require(29); +protobuf.Enum = require(15); +protobuf.Type = require(35); +protobuf.Field = require(16); +protobuf.OneOf = require(25); +protobuf.MapField = require(20); +protobuf.Service = require(33); +protobuf.Method = require(22); + +// Runtime +protobuf.Message = require(21); +protobuf.wrappers = require(41); + +// Utility +protobuf.types = require(36); +protobuf.util = require(37); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); + +},{"12":12,"13":13,"14":14,"15":15,"16":16,"18":18,"20":20,"21":21,"22":22,"23":23,"24":24,"25":25,"29":29,"33":33,"35":35,"36":36,"37":37,"40":40,"41":41}],18:[function(require,module,exports){ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require(42); +protobuf.BufferWriter = require(43); +protobuf.Reader = require(27); +protobuf.BufferReader = require(28); + +// Utility +protobuf.util = require(39); +protobuf.rpc = require(31); +protobuf.roots = require(30); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); + +},{"27":27,"28":28,"30":30,"31":31,"39":39,"42":42,"43":43}],19:[function(require,module,exports){ +"use strict"; +var protobuf = module.exports = require(17); + +protobuf.build = "full"; + +// Parser +protobuf.tokenize = require(34); +protobuf.parse = require(26); +protobuf.common = require(11); + +// Configure parser +protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); + +},{"11":11,"17":17,"26":26,"34":34}],20:[function(require,module,exports){ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require(16); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require(36), + util = require(37); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; + +},{"16":16,"36":36,"37":37}],21:[function(require,module,exports){ +"use strict"; +module.exports = Message; + +var util = require(39); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ +},{"39":39}],22:[function(require,module,exports){ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require(37); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; + +},{"24":24,"37":37}],23:[function(require,module,exports){ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require(24); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require(16), + util = require(37); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; + +},{"16":16,"24":24,"37":37}],24:[function(require,module,exports){ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require(37); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; + +},{"37":37}],25:[function(require,module,exports){ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require(24); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require(16), + util = require(37); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; + +},{"16":16,"24":24,"37":37}],26:[function(require,module,exports){ +"use strict"; +module.exports = parse; + +parse.filename = null; +parse.defaults = { keepCase: false }; + +var tokenize = require(34), + Root = require(29), + Type = require(35), + Field = require(16), + MapField = require(20), + OneOf = require(25), + Enum = require(15), + Service = require(33), + Method = require(22), + types = require(36), + util = require(37); + +var base10Re = /^[1-9][0-9]*$/, + base10NegRe = /^-?[1-9][0-9]*$/, + base16Re = /^0[x][0-9a-fA-F]+$/, + base16NegRe = /^-?0[x][0-9a-fA-F]+$/, + base8Re = /^0[0-7]+$/, + base8NegRe = /^-?0[0-7]+$/, + numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, + nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, + typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, + fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; + +/** + * Result object returned from {@link parse}. + * @interface IParserResult + * @property {string|undefined} package Package name, if declared + * @property {string[]|undefined} imports Imports, if any + * @property {string[]|undefined} weakImports Weak imports, if any + * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) + * @property {Root} root Populated root instance + */ + +/** + * Options modifying the behavior of {@link parse}. + * @interface IParseOptions + * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case + * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. + */ + +/** + * Options modifying the behavior of JSON serialization. + * @interface IToJSONOptions + * @property {boolean} [keepComments=false] Serializes comments. + */ + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param {string} source Source contents + * @param {Root} root Root to populate + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + */ +function parse(source, root, options) { + /* eslint-disable callback-return */ + if (!(root instanceof Root)) { + options = root; + root = new Root(); + } + if (!options) + options = parse.defaults; + + var tn = tokenize(source, options.alternateCommentMode || false), + next = tn.next, + push = tn.push, + peek = tn.peek, + skip = tn.skip, + cmnt = tn.cmnt; + + var head = true, + pkg, + imports, + weakImports, + syntax, + isProto3 = false; + + var ptr = root; + + var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; + + /* istanbul ignore next */ + function illegal(token, name, insideTryCatch) { + var filename = parse.filename; + if (!insideTryCatch) + parse.filename = null; + return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); + } + + function readString() { + var values = [], + token; + do { + /* istanbul ignore if */ + if ((token = next()) !== "\"" && token !== "'") + throw illegal(token); + + values.push(next()); + skip(token); + token = peek(); + } while (token === "\"" || token === "'"); + return values.join(""); + } + + function readValue(acceptTypeRef) { + var token = next(); + switch (token) { + case "'": + case "\"": + push(token); + return readString(); + case "true": case "TRUE": + return true; + case "false": case "FALSE": + return false; + } + try { + return parseNumber(token, /* insideTryCatch */ true); + } catch (e) { + + /* istanbul ignore else */ + if (acceptTypeRef && typeRefRe.test(token)) + return token; + + /* istanbul ignore next */ + throw illegal(token, "value"); + } + } + + function readRanges(target, acceptStrings) { + var token, start; + do { + if (acceptStrings && ((token = peek()) === "\"" || token === "'")) + target.push(readString()); + else + target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); + } while (skip(",", true)); + skip(";"); + } + + function parseNumber(token, insideTryCatch) { + var sign = 1; + if (token.charAt(0) === "-") { + sign = -1; + token = token.substring(1); + } + switch (token) { + case "inf": case "INF": case "Inf": + return sign * Infinity; + case "nan": case "NAN": case "Nan": case "NaN": + return NaN; + case "0": + return 0; + } + if (base10Re.test(token)) + return sign * parseInt(token, 10); + if (base16Re.test(token)) + return sign * parseInt(token, 16); + if (base8Re.test(token)) + return sign * parseInt(token, 8); + + /* istanbul ignore else */ + if (numberRe.test(token)) + return sign * parseFloat(token); + + /* istanbul ignore next */ + throw illegal(token, "number", insideTryCatch); + } + + function parseId(token, acceptNegative) { + switch (token) { + case "max": case "MAX": case "Max": + return 536870911; + case "0": + return 0; + } + + /* istanbul ignore if */ + if (!acceptNegative && token.charAt(0) === "-") + throw illegal(token, "id"); + + if (base10NegRe.test(token)) + return parseInt(token, 10); + if (base16NegRe.test(token)) + return parseInt(token, 16); + + /* istanbul ignore else */ + if (base8NegRe.test(token)) + return parseInt(token, 8); + + /* istanbul ignore next */ + throw illegal(token, "id"); + } + + function parsePackage() { + + /* istanbul ignore if */ + if (pkg !== undefined) + throw illegal("package"); + + pkg = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(pkg)) + throw illegal(pkg, "name"); + + ptr = ptr.define(pkg); + skip(";"); + } + + function parseImport() { + var token = peek(); + var whichImports; + switch (token) { + case "weak": + whichImports = weakImports || (weakImports = []); + next(); + break; + case "public": + next(); + // eslint-disable-line no-fallthrough + default: + whichImports = imports || (imports = []); + break; + } + token = readString(); + skip(";"); + whichImports.push(token); + } + + function parseSyntax() { + skip("="); + syntax = readString(); + isProto3 = syntax === "proto3"; + + /* istanbul ignore if */ + if (!isProto3 && syntax !== "proto2") + throw illegal(syntax, "syntax"); + + skip(";"); + } + + function parseCommon(parent, token) { + switch (token) { + + case "option": + parseOption(parent, token); + skip(";"); + return true; + + case "message": + parseType(parent, token); + return true; + + case "enum": + parseEnum(parent, token); + return true; + + case "service": + parseService(parent, token); + return true; + + case "extend": + parseExtension(parent, token); + return true; + } + return false; + } + + function ifBlock(obj, fnIf, fnElse) { + var trailingLine = tn.line; + if (obj) { + if(typeof obj.comment !== "string") { + obj.comment = cmnt(); // try block-type comment + } + obj.filename = parse.filename; + } + if (skip("{", true)) { + var token; + while ((token = next()) !== "}") + fnIf(token); + skip(";", true); + } else { + if (fnElse) + fnElse(); + skip(";"); + if (obj && typeof obj.comment !== "string") + obj.comment = cmnt(trailingLine); // try line-type comment if no block + } + } + + function parseType(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "type name"); + + var type = new Type(token); + ifBlock(type, function parseType_block(token) { + if (parseCommon(type, token)) + return; + + switch (token) { + + case "map": + parseMapField(type, token); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + case "oneof": + parseOneOf(type, token); + break; + + case "extensions": + readRanges(type.extensions || (type.extensions = [])); + break; + + case "reserved": + readRanges(type.reserved || (type.reserved = []), true); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + + push(token); + parseField(type, "optional"); + break; + } + }); + parent.add(type); + } + + function parseField(parent, rule, extend) { + var type = next(); + if (type === "group") { + parseGroup(parent, rule); + return; + } + + /* istanbul ignore if */ + if (!typeRefRe.test(type)) + throw illegal(type, "type"); + + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + name = applyCase(name); + skip("="); + + var field = new Field(name, parseId(next()), type, rule, extend); + ifBlock(field, function parseField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseField_line() { + parseInlineOptions(field); + }); + parent.add(field); + + // JSON defaults to packed=true if not set so we have to set packed=false explicity when + // parsing proto2 descriptors without the option, where applicable. This must be done for + // all known packable types and anything that could be an enum (= is not a basic type). + if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) + field.setOption("packed", false, /* ifNotSet */ true); + } + + function parseGroup(parent, rule) { + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + var fieldName = util.lcFirst(name); + if (name === fieldName) + name = util.ucFirst(name); + skip("="); + var id = parseId(next()); + var type = new Type(name); + type.group = true; + var field = new Field(fieldName, id, name, rule); + field.filename = parse.filename; + ifBlock(type, function parseGroup_block(token) { + switch (token) { + + case "option": + parseOption(type, token); + skip(";"); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + /* istanbul ignore next */ + default: + throw illegal(token); // there are no groups with proto3 semantics + } + }); + parent.add(type) + .add(field); + } + + function parseMapField(parent) { + skip("<"); + var keyType = next(); + + /* istanbul ignore if */ + if (types.mapKey[keyType] === undefined) + throw illegal(keyType, "type"); + + skip(","); + var valueType = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(valueType)) + throw illegal(valueType, "type"); + + skip(">"); + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + skip("="); + var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); + ifBlock(field, function parseMapField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseMapField_line() { + parseInlineOptions(field); + }); + parent.add(field); + } + + function parseOneOf(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var oneof = new OneOf(applyCase(token)); + ifBlock(oneof, function parseOneOf_block(token) { + if (token === "option") { + parseOption(oneof, token); + skip(";"); + } else { + push(token); + parseField(oneof, "optional"); + } + }); + parent.add(oneof); + } + + function parseEnum(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var enm = new Enum(token); + ifBlock(enm, function parseEnum_block(token) { + switch(token) { + case "option": + parseOption(enm, token); + skip(";"); + break; + + case "reserved": + readRanges(enm.reserved || (enm.reserved = []), true); + break; + + default: + parseEnumValue(enm, token); + } + }); + parent.add(enm); + } + + function parseEnumValue(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token)) + throw illegal(token, "name"); + + skip("="); + var value = parseId(next(), true), + dummy = {}; + ifBlock(dummy, function parseEnumValue_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(dummy, token); // skip + skip(";"); + } else + throw illegal(token); + + }, function parseEnumValue_line() { + parseInlineOptions(dummy); // skip + }); + parent.add(token, value, dummy.comment); + } + + function parseOption(parent, token) { + var isCustom = skip("(", true); + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "name"); + + var name = token; + if (isCustom) { + skip(")"); + name = "(" + name + ")"; + token = peek(); + if (fqTypeRefRe.test(token)) { + name += token; + next(); + } + } + skip("="); + parseOptionValue(parent, name); + } + + function parseOptionValue(parent, name) { + if (skip("{", true)) { // { a: "foo" b { c: "bar" } } + do { + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else { + skip(":"); + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else + setOption(parent, name + "." + token, readValue(true)); + } + skip(",", true); + } while (!skip("}", true)); + } else + setOption(parent, name, readValue(true)); + // Does not enforce a delimiter to be universal + } + + function setOption(parent, name, value) { + if (parent.setOption) + parent.setOption(name, value); + } + + function parseInlineOptions(parent) { + if (skip("[", true)) { + do { + parseOption(parent, "option"); + } while (skip(",", true)); + skip("]"); + } + return parent; + } + + function parseService(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "service name"); + + var service = new Service(token); + ifBlock(service, function parseService_block(token) { + if (parseCommon(service, token)) + return; + + /* istanbul ignore else */ + if (token === "rpc") + parseMethod(service, token); + else + throw illegal(token); + }); + parent.add(service); + } + + function parseMethod(parent, token) { + // Get the comment of the preceding line now (if one exists) in case the + // method is defined across multiple lines. + var commentText = cmnt(); + + var type = token; + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var name = token, + requestType, requestStream, + responseType, responseStream; + + skip("("); + if (skip("stream", true)) + requestStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + requestType = token; + skip(")"); skip("returns"); skip("("); + if (skip("stream", true)) + responseStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + responseType = token; + skip(")"); + + var method = new Method(name, type, requestType, responseType, requestStream, responseStream); + method.comment = commentText; + ifBlock(method, function parseMethod_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(method, token); + skip(";"); + } else + throw illegal(token); + + }); + parent.add(method); + } + + function parseExtension(parent, token) { + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "reference"); + + var reference = token; + ifBlock(null, function parseExtension_block(token) { + switch (token) { + + case "required": + case "repeated": + case "optional": + parseField(parent, token, reference); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + push(token); + parseField(parent, "optional", reference); + break; + } + }); + } + + var token; + while ((token = next()) !== null) { + switch (token) { + + case "package": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parsePackage(); + break; + + case "import": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseImport(); + break; + + case "syntax": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseSyntax(); + break; + + case "option": + + parseOption(ptr, token); + skip(";"); + break; + + default: + + /* istanbul ignore else */ + if (parseCommon(ptr, token)) { + head = false; + continue; + } + + /* istanbul ignore next */ + throw illegal(token); + } + } + + parse.filename = null; + return { + "package" : pkg, + "imports" : imports, + weakImports : weakImports, + syntax : syntax, + root : root + }; +} + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @name parse + * @function + * @param {string} source Source contents + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + * @variation 2 + */ + +},{"15":15,"16":16,"20":20,"22":22,"25":25,"29":29,"33":33,"34":34,"35":35,"36":36,"37":37}],27:[function(require,module,exports){ +"use strict"; +module.exports = Reader; + +var util = require(39); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; + +},{"39":39}],28:[function(require,module,exports){ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require(27); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require(39); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + +},{"27":27,"39":39}],29:[function(require,module,exports){ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require(23); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require(16), + Enum = require(15), + OneOf = require(25), + util = require(37); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Bundled definition existence checking + function getBundledFileName(filename) { + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) return altname; + } + return null; + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = (getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = (getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + util.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; + +},{"15":15,"16":16,"23":23,"25":25,"37":37}],30:[function(require,module,exports){ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ + +},{}],31:[function(require,module,exports){ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require(32); + +},{"32":32}],32:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +var util = require(39); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; + +},{"39":39}],33:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require(23); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require(22), + util = require(37), + rpc = require(31); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; + +},{"22":22,"23":23,"31":31,"37":37}],34:[function(require,module,exports){ +"use strict"; +module.exports = tokenize; + +var delimRe = /[\s{}=;:[\],'"()<>]/g, + stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; + +var setCommentRe = /^ *[*/]+ */, + setCommentAltRe = /^\s*\*?\/*/, + setCommentSplitRe = /\n/g, + whitespaceRe = /\s/, + unescapeRe = /\\(.?)/g; + +var unescapeMap = { + "0": "\0", + "r": "\r", + "n": "\n", + "t": "\t" +}; + +/** + * Unescapes a string. + * @param {string} str String to unescape + * @returns {string} Unescaped string + * @property {Object.} map Special characters map + * @memberof tokenize + */ +function unescape(str) { + return str.replace(unescapeRe, function($0, $1) { + switch ($1) { + case "\\": + case "": + return $1; + default: + return unescapeMap[$1] || ""; + } + }); +} + +tokenize.unescape = unescape; + +/** + * Gets the next token and advances. + * @typedef TokenizerHandleNext + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Peeks for the next token. + * @typedef TokenizerHandlePeek + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Pushes a token back to the stack. + * @typedef TokenizerHandlePush + * @type {function} + * @param {string} token Token + * @returns {undefined} + */ + +/** + * Skips the next token. + * @typedef TokenizerHandleSkip + * @type {function} + * @param {string} expected Expected token + * @param {boolean} [optional=false] If optional + * @returns {boolean} Whether the token matched + * @throws {Error} If the token didn't match and is not optional + */ + +/** + * Gets the comment on the previous line or, alternatively, the line comment on the specified line. + * @typedef TokenizerHandleCmnt + * @type {function} + * @param {number} [line] Line number + * @returns {string|null} Comment text or `null` if none + */ + +/** + * Handle object returned from {@link tokenize}. + * @interface ITokenizerHandle + * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) + * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) + * @property {TokenizerHandlePush} push Pushes a token back to the stack + * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws + * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any + * @property {number} line Current line number + */ + +/** + * Tokenizes the given .proto source and returns an object with useful utility functions. + * @param {string} source Source contents + * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. + * @returns {ITokenizerHandle} Tokenizer handle + */ +function tokenize(source, alternateCommentMode) { + /* eslint-disable callback-return */ + source = source.toString(); + + var offset = 0, + length = source.length, + line = 1, + commentType = null, + commentText = null, + commentLine = 0, + commentLineEmpty = false; + + var stack = []; + + var stringDelim = null; + + /* istanbul ignore next */ + /** + * Creates an error for illegal syntax. + * @param {string} subject Subject + * @returns {Error} Error created + * @inner + */ + function illegal(subject) { + return Error("illegal " + subject + " (line " + line + ")"); + } + + /** + * Reads a string till its end. + * @returns {string} String read + * @inner + */ + function readString() { + var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; + re.lastIndex = offset - 1; + var match = re.exec(source); + if (!match) + throw illegal("string"); + offset = re.lastIndex; + push(stringDelim); + stringDelim = null; + return unescape(match[1]); + } + + /** + * Gets the character at `pos` within the source. + * @param {number} pos Position + * @returns {string} Character + * @inner + */ + function charAt(pos) { + return source.charAt(pos); + } + + /** + * Sets the current comment text. + * @param {number} start Start offset + * @param {number} end End offset + * @returns {undefined} + * @inner + */ + function setComment(start, end) { + commentType = source.charAt(start++); + commentLine = line; + commentLineEmpty = false; + var lookback; + if (alternateCommentMode) { + lookback = 2; // alternate comment parsing: "//" or "/*" + } else { + lookback = 3; // "///" or "/**" + } + var commentOffset = start - lookback, + c; + do { + if (--commentOffset < 0 || + (c = source.charAt(commentOffset)) === "\n") { + commentLineEmpty = true; + break; + } + } while (c === " " || c === "\t"); + var lines = source + .substring(start, end) + .split(setCommentSplitRe); + for (var i = 0; i < lines.length; ++i) + lines[i] = lines[i] + .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") + .trim(); + commentText = lines + .join("\n") + .trim(); + } + + function isDoubleSlashCommentLine(startOffset) { + var endOffset = findEndOfLine(startOffset); + + // see if remaining line matches comment pattern + var lineText = source.substring(startOffset, endOffset); + // look for 1 or 2 slashes since startOffset would already point past + // the first slash that started the comment. + var isComment = /^\s*\/{1,2}/.test(lineText); + return isComment; + } + + function findEndOfLine(cursor) { + // find end of cursor's line + var endOffset = cursor; + while (endOffset < length && charAt(endOffset) !== "\n") { + endOffset++; + } + return endOffset; + } + + /** + * Obtains the next token. + * @returns {string|null} Next token or `null` on eof + * @inner + */ + function next() { + if (stack.length > 0) + return stack.shift(); + if (stringDelim) + return readString(); + var repeat, + prev, + curr, + start, + isDoc; + do { + if (offset === length) + return null; + repeat = false; + while (whitespaceRe.test(curr = charAt(offset))) { + if (curr === "\n") + ++line; + if (++offset === length) + return null; + } + + if (charAt(offset) === "/") { + if (++offset === length) { + throw illegal("comment"); + } + if (charAt(offset) === "/") { // Line + if (!alternateCommentMode) { + // check for triple-slash comment + isDoc = charAt(start = offset + 1) === "/"; + + while (charAt(++offset) !== "\n") { + if (offset === length) { + return null; + } + } + ++offset; + if (isDoc) { + setComment(start, offset - 1); + } + ++line; + repeat = true; + } else { + // check for double-slash comments, consolidating consecutive lines + start = offset; + isDoc = false; + if (isDoubleSlashCommentLine(offset)) { + isDoc = true; + do { + offset = findEndOfLine(offset); + if (offset === length) { + break; + } + offset++; + } while (isDoubleSlashCommentLine(offset)); + } else { + offset = Math.min(length, findEndOfLine(offset) + 1); + } + if (isDoc) { + setComment(start, offset); + } + line++; + repeat = true; + } + } else if ((curr = charAt(offset)) === "*") { /* Block */ + // check for /** (regular comment mode) or /* (alternate comment mode) + start = offset + 1; + isDoc = alternateCommentMode || charAt(start) === "*"; + do { + if (curr === "\n") { + ++line; + } + if (++offset === length) { + throw illegal("comment"); + } + prev = curr; + curr = charAt(offset); + } while (prev !== "*" || curr !== "/"); + ++offset; + if (isDoc) { + setComment(start, offset - 2); + } + repeat = true; + } else { + return "/"; + } + } + } while (repeat); + + // offset !== length if we got here + + var end = offset; + delimRe.lastIndex = 0; + var delim = delimRe.test(charAt(end++)); + if (!delim) + while (end < length && !delimRe.test(charAt(end))) + ++end; + var token = source.substring(offset, offset = end); + if (token === "\"" || token === "'") + stringDelim = token; + return token; + } + + /** + * Pushes a token back to the stack. + * @param {string} token Token + * @returns {undefined} + * @inner + */ + function push(token) { + stack.push(token); + } + + /** + * Peeks for the next token. + * @returns {string|null} Token or `null` on eof + * @inner + */ + function peek() { + if (!stack.length) { + var token = next(); + if (token === null) + return null; + push(token); + } + return stack[0]; + } + + /** + * Skips a token. + * @param {string} expected Expected token + * @param {boolean} [optional=false] Whether the token is optional + * @returns {boolean} `true` when skipped, `false` if not + * @throws {Error} When a required token is not present + * @inner + */ + function skip(expected, optional) { + var actual = peek(), + equals = actual === expected; + if (equals) { + next(); + return true; + } + if (!optional) + throw illegal("token '" + actual + "', '" + expected + "' expected"); + return false; + } + + /** + * Gets a comment. + * @param {number} [trailingLine] Line number if looking for a trailing comment + * @returns {string|null} Comment text + * @inner + */ + function cmnt(trailingLine) { + var ret = null; + if (trailingLine === undefined) { + if (commentLine === line - 1 && (alternateCommentMode || commentType === "*" || commentLineEmpty)) { + ret = commentText; + } + } else { + /* istanbul ignore else */ + if (commentLine < trailingLine) { + peek(); + } + if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === "/")) { + ret = commentText; + } + } + return ret; + } + + return Object.defineProperty({ + next: next, + peek: peek, + push: push, + skip: skip, + cmnt: cmnt + }, "line", { + get: function() { return line; } + }); + /* eslint-enable callback-return */ +} + +},{}],35:[function(require,module,exports){ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require(23); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require(15), + OneOf = require(25), + Field = require(16), + MapField = require(20), + Service = require(33), + Message = require(21), + Reader = require(27), + Writer = require(42), + util = require(37), + encoder = require(14), + decoder = require(13), + verifier = require(40), + converter = require(12), + wrappers = require(41); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + name = name.replace(/\W/g, ""); + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; + +},{"12":12,"13":13,"14":14,"15":15,"16":16,"20":20,"21":21,"23":23,"25":25,"27":27,"33":33,"37":37,"40":40,"41":41,"42":42}],36:[function(require,module,exports){ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require(37); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); + +},{"37":37}],37:[function(require,module,exports){ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require(39); + +var roots = require(30); + +var Type, // cyclic + Enum; + +util.codegen = require(3); +util.fetch = require(5); +util.path = require(8); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require(35); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require(15); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require(29))()); + } +}); + +},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"5":5,"8":8}],38:[function(require,module,exports){ +"use strict"; +module.exports = LongBits; + +var util = require(39); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/* + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; + +},{"39":39}],39:[function(require,module,exports){ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require(1); + +// converts to / from base64 encoded strings +util.base64 = require(2); + +// base class of rpc.Service +util.EventEmitter = require(4); + +// float handling accross browsers +util.float = require(6); + +// requires modules optionally and hides the call from bundlers +util.inquire = require(7); + +// converts to / from utf8 encoded strings +util.utf8 = require(10); + +// provides a node-like buffer pool in the browser +util.pool = require(9); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require(38); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/* + * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on + * for this package's tests but have it be off in actual usage-reporting-protobuf use. + * (We leave it on for some mode where there is no `process` that is used by tests.) + */ +util.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long")) : undefined; + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/* + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/* + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; + +},{"1":1,"10":10,"2":2,"38":38,"4":4,"6":6,"7":7,"9":9}],40:[function(require,module,exports){ +"use strict"; +module.exports = verifier; + +var Enum = require(15), + util = require(37); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require(21); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + var type = this.lookup(object["@type"]); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + return this.create({ + type_url: "/" + type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + var name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + object["@type"] = message.$type.fullName; + return object; + } + + return this.toObject(message, options); + } +}; + +},{"21":21}],42:[function(require,module,exports){ +"use strict"; +module.exports = Writer; + +var util = require(39); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; + +},{"39":39}],43:[function(require,module,exports){ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require(42); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require(39); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + +},{"39":39,"42":42}]},{},[19]) + +})(); +//# sourceMappingURL=protobuf.js.map diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js.map b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js.map new file mode 100644 index 00000000..c66d9295 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/common.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light.js","../src/index-minimal.js","../src/index","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/parse.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/tokenize.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3XA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nmodule.exports = common;\n\nvar commonRe = /\\/|\\./;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\n * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n * @returns {undefined}\n * @property {INamespace} google/protobuf/any.proto Any\n * @property {INamespace} google/protobuf/duration.proto Duration\n * @property {INamespace} google/protobuf/empty.proto Empty\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\n * @example\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\n * protobuf.common(\"descriptor\", descriptorJson);\n *\n * // manually provides a custom definition (uses my.foo namespace)\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\n */\nfunction common(name, json) {\n if (!commonRe.test(name)) {\n name = \"google/protobuf/\" + name + \".proto\";\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\n }\n common[name] = json;\n}\n\n// Not provided because of limited use (feel free to discuss or to provide yourself):\n//\n// google/protobuf/descriptor.proto\n// google/protobuf/source_context.proto\n// google/protobuf/type.proto\n//\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\n// the repository or package within the google/protobuf directory.\n\ncommon(\"any\", {\n\n /**\n * Properties of a google.protobuf.Any message.\n * @interface IAny\n * @type {Object}\n * @property {string} [typeUrl]\n * @property {Uint8Array} [bytes]\n * @memberof common\n */\n Any: {\n fields: {\n type_url: {\n type: \"string\",\n id: 1\n },\n value: {\n type: \"bytes\",\n id: 2\n }\n }\n }\n});\n\nvar timeType;\n\ncommon(\"duration\", {\n\n /**\n * Properties of a google.protobuf.Duration message.\n * @interface IDuration\n * @type {Object}\n * @property {number} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Duration: timeType = {\n fields: {\n seconds: {\n type: \"int64\",\n id: 1\n },\n nanos: {\n type: \"int32\",\n id: 2\n }\n }\n }\n});\n\ncommon(\"timestamp\", {\n\n /**\n * Properties of a google.protobuf.Timestamp message.\n * @interface ITimestamp\n * @type {Object}\n * @property {number} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Timestamp: timeType\n});\n\ncommon(\"empty\", {\n\n /**\n * Properties of a google.protobuf.Empty message.\n * @interface IEmpty\n * @memberof common\n */\n Empty: {\n fields: {}\n }\n});\n\ncommon(\"struct\", {\n\n /**\n * Properties of a google.protobuf.Struct message.\n * @interface IStruct\n * @type {Object}\n * @property {Object.} [fields]\n * @memberof common\n */\n Struct: {\n fields: {\n fields: {\n keyType: \"string\",\n type: \"Value\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Value message.\n * @interface IValue\n * @type {Object}\n * @property {string} [kind]\n * @property {0} [nullValue]\n * @property {number} [numberValue]\n * @property {string} [stringValue]\n * @property {boolean} [boolValue]\n * @property {IStruct} [structValue]\n * @property {IListValue} [listValue]\n * @memberof common\n */\n Value: {\n oneofs: {\n kind: {\n oneof: [\n \"nullValue\",\n \"numberValue\",\n \"stringValue\",\n \"boolValue\",\n \"structValue\",\n \"listValue\"\n ]\n }\n },\n fields: {\n nullValue: {\n type: \"NullValue\",\n id: 1\n },\n numberValue: {\n type: \"double\",\n id: 2\n },\n stringValue: {\n type: \"string\",\n id: 3\n },\n boolValue: {\n type: \"bool\",\n id: 4\n },\n structValue: {\n type: \"Struct\",\n id: 5\n },\n listValue: {\n type: \"ListValue\",\n id: 6\n }\n }\n },\n\n NullValue: {\n values: {\n NULL_VALUE: 0\n }\n },\n\n /**\n * Properties of a google.protobuf.ListValue message.\n * @interface IListValue\n * @type {Object}\n * @property {Array.} [values]\n * @memberof common\n */\n ListValue: {\n fields: {\n values: {\n rule: \"repeated\",\n type: \"Value\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"wrappers\", {\n\n /**\n * Properties of a google.protobuf.DoubleValue message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n DoubleValue: {\n fields: {\n value: {\n type: \"double\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.FloatValue message.\n * @interface IFloatValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FloatValue: {\n fields: {\n value: {\n type: \"float\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int64Value message.\n * @interface IInt64Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int64Value: {\n fields: {\n value: {\n type: \"int64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt64Value message.\n * @interface IUInt64Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt64Value: {\n fields: {\n value: {\n type: \"uint64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int32Value message.\n * @interface IInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int32Value: {\n fields: {\n value: {\n type: \"int32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt32Value message.\n * @interface IUInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt32Value: {\n fields: {\n value: {\n type: \"uint32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BoolValue message.\n * @interface IBoolValue\n * @type {Object}\n * @property {boolean} [value]\n * @memberof common\n */\n BoolValue: {\n fields: {\n value: {\n type: \"bool\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.StringValue message.\n * @interface IStringValue\n * @type {Object}\n * @property {string} [value]\n * @memberof common\n */\n StringValue: {\n fields: {\n value: {\n type: \"string\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BytesValue message.\n * @interface IBytesValue\n * @type {Object}\n * @property {Uint8Array} [value]\n * @memberof common\n */\n BytesValue: {\n fields: {\n value: {\n type: \"bytes\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"field_mask\", {\n\n /**\n * Properties of a google.protobuf.FieldMask message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FieldMask: {\n fields: {\n paths: {\n rule: \"repeated\",\n type: \"string\",\n id: 1\n }\n }\n }\n});\n\n/**\n * Gets the root definition of the specified common proto file.\n *\n * Bundled definitions are:\n * - google/protobuf/any.proto\n * - google/protobuf/duration.proto\n * - google/protobuf/empty.proto\n * - google/protobuf/field_mask.proto\n * - google/protobuf/struct.proto\n * - google/protobuf/timestamp.proto\n * - google/protobuf/wrappers.proto\n *\n * @param {string} file Proto file name\n * @returns {INamespace|null} Root definition or `null` if not defined\n */\ncommon.get = function get(file) {\n return common[file] || null;\n};\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(15),\n util = require(37);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop, ref) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (ref === undefined) {\n ref = \"d\" + prop;\n }\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof %s!==\\\"object\\\")\", ref)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(%s)\", prop, fieldIndex, ref);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(%s)\", prop, ref); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=%s>>>0\", prop, ref);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=%s|0\", prop, ref);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(%s)).unsigned=%j\", prop, ref, isUnsigned)\n (\"else if(typeof %s===\\\"string\\\")\", ref)\n (\"m%s=parseInt(%s,10)\", prop, ref)\n (\"else if(typeof %s===\\\"number\\\")\", ref)\n (\"m%s=%s\", prop, ref)\n (\"else if(typeof %s===\\\"object\\\")\", ref)\n (\"m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)\", prop, ref, ref, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof %s===\\\"string\\\")\", ref)\n (\"util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)\", ref, prop, ref)\n (\"else if(%s.length)\", ref)\n (\"m%s=%s\", prop, ref);\n break;\n case \"string\": gen\n (\"m%s=String(%s)\", prop, ref);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(%s)\", prop, ref);\n break;\n /* default: gen\n (\"m%s=%s\", prop, ref);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"r.skip().pos++\") // assumes id 1 + key wireType\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"k=r.%s()\", field.keyType)\n (\"r.pos++\"); // assumes id 2 + value wireType\n if (types.long[field.keyType] !== undefined) {\n if (types.basic[type] === undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\n } else {\n if (types.basic[type] === undefined) gen\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[k]=r.%s()\", ref, type);\n }\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0);\n return;\n }\n var key = (field.id << 3 | 2) >>> 0;\n if (field.preEncoded()) {\n gen(\"if (%s instanceof Uint8Array) {\", ref)\n (\"w.uint32(%i)\", key)\n (\"w.bytes(%s)\", ref)\n (\"} else {\");\n }\n gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, key);\n if (field.preEncoded()) {\n gen(\"}\")\n }\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) {\n var arrayRef = ref;\n if (field.useToArray()) {\n arrayRef = \"array\" + field.id;\n gen(\"var %s\", arrayRef);\n gen(\"if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }\",\n ref, ref, arrayRef, ref, arrayRef, ref);\n }\n gen(\"if(%s!=null&&%s.length){\", arrayRef, arrayRef); // !== undefined && !== null\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", arrayRef)\n (\"w.%s(%s[i])\", type, arrayRef)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", arrayRef);\n if (wireType === undefined)\n genTypePartial(gen, field, index, arrayRef + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, arrayRef);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(23),\n util = require(37);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(15),\n types = require(36),\n util = require(37);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\nField.prototype.useToArray = function useToArray() {\n return !!this.getOption(\"(js_use_toArray)\");\n};\n\nField.prototype.preEncoded = function preEncoded() {\n return !!this.getOption(\"(js_preEncoded)\");\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(18);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(14);\nprotobuf.decoder = require(13);\nprotobuf.verifier = require(40);\nprotobuf.converter = require(12);\n\n// Reflection\nprotobuf.ReflectionObject = require(24);\nprotobuf.Namespace = require(23);\nprotobuf.Root = require(29);\nprotobuf.Enum = require(15);\nprotobuf.Type = require(35);\nprotobuf.Field = require(16);\nprotobuf.OneOf = require(25);\nprotobuf.MapField = require(20);\nprotobuf.Service = require(33);\nprotobuf.Method = require(22);\n\n// Runtime\nprotobuf.Message = require(21);\nprotobuf.wrappers = require(41);\n\n// Utility\nprotobuf.types = require(36);\nprotobuf.util = require(37);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(42);\nprotobuf.BufferWriter = require(43);\nprotobuf.Reader = require(27);\nprotobuf.BufferReader = require(28);\n\n// Utility\nprotobuf.util = require(39);\nprotobuf.rpc = require(31);\nprotobuf.roots = require(30);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.Reader._configure(protobuf.BufferReader);\n protobuf.util._configure();\n}\n\n// Set up buffer utility according to the environment\nprotobuf.Writer._configure(protobuf.BufferWriter);\nconfigure();\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"full\";\n\n// Parser\nprotobuf.tokenize = require(34);\nprotobuf.parse = require(26);\nprotobuf.common = require(11);\n\n// Configure parser\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(16);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(36),\n util = require(37);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(39);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(37);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(16),\n util = require(37);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(37);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(16),\n util = require(37);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize = require(34),\n Root = require(29),\n Type = require(35),\n Field = require(16),\n MapField = require(20),\n OneOf = require(25),\n Enum = require(15),\n Service = require(33),\n Method = require(22),\n types = require(36),\n util = require(37);\n\nvar base10Re = /^[1-9][0-9]*$/,\n base10NegRe = /^-?[1-9][0-9]*$/,\n base16Re = /^0[x][0-9a-fA-F]+$/,\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n base8Re = /^0[0-7]+$/,\n base8NegRe = /^-?0[0-7]+$/,\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n /* eslint-disable callback-return */\n if (!(root instanceof Root)) {\n options = root;\n root = new Root();\n }\n if (!options)\n options = parse.defaults;\n\n var tn = tokenize(source, options.alternateCommentMode || false),\n next = tn.next,\n push = tn.push,\n peek = tn.peek,\n skip = tn.skip,\n cmnt = tn.cmnt;\n\n var head = true,\n pkg,\n imports,\n weakImports,\n syntax,\n isProto3 = false;\n\n var ptr = root;\n\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n /* istanbul ignore next */\n function illegal(token, name, insideTryCatch) {\n var filename = parse.filename;\n if (!insideTryCatch)\n parse.filename = null;\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n }\n\n function readString() {\n var values = [],\n token;\n do {\n /* istanbul ignore if */\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\n throw illegal(token);\n\n values.push(next());\n skip(token);\n token = peek();\n } while (token === \"\\\"\" || token === \"'\");\n return values.join(\"\");\n }\n\n function readValue(acceptTypeRef) {\n var token = next();\n switch (token) {\n case \"'\":\n case \"\\\"\":\n push(token);\n return readString();\n case \"true\": case \"TRUE\":\n return true;\n case \"false\": case \"FALSE\":\n return false;\n }\n try {\n return parseNumber(token, /* insideTryCatch */ true);\n } catch (e) {\n\n /* istanbul ignore else */\n if (acceptTypeRef && typeRefRe.test(token))\n return token;\n\n /* istanbul ignore next */\n throw illegal(token, \"value\");\n }\n }\n\n function readRanges(target, acceptStrings) {\n var token, start;\n do {\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\n target.push(readString());\n else\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n } while (skip(\",\", true));\n skip(\";\");\n }\n\n function parseNumber(token, insideTryCatch) {\n var sign = 1;\n if (token.charAt(0) === \"-\") {\n sign = -1;\n token = token.substring(1);\n }\n switch (token) {\n case \"inf\": case \"INF\": case \"Inf\":\n return sign * Infinity;\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n return NaN;\n case \"0\":\n return 0;\n }\n if (base10Re.test(token))\n return sign * parseInt(token, 10);\n if (base16Re.test(token))\n return sign * parseInt(token, 16);\n if (base8Re.test(token))\n return sign * parseInt(token, 8);\n\n /* istanbul ignore else */\n if (numberRe.test(token))\n return sign * parseFloat(token);\n\n /* istanbul ignore next */\n throw illegal(token, \"number\", insideTryCatch);\n }\n\n function parseId(token, acceptNegative) {\n switch (token) {\n case \"max\": case \"MAX\": case \"Max\":\n return 536870911;\n case \"0\":\n return 0;\n }\n\n /* istanbul ignore if */\n if (!acceptNegative && token.charAt(0) === \"-\")\n throw illegal(token, \"id\");\n\n if (base10NegRe.test(token))\n return parseInt(token, 10);\n if (base16NegRe.test(token))\n return parseInt(token, 16);\n\n /* istanbul ignore else */\n if (base8NegRe.test(token))\n return parseInt(token, 8);\n\n /* istanbul ignore next */\n throw illegal(token, \"id\");\n }\n\n function parsePackage() {\n\n /* istanbul ignore if */\n if (pkg !== undefined)\n throw illegal(\"package\");\n\n pkg = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(pkg))\n throw illegal(pkg, \"name\");\n\n ptr = ptr.define(pkg);\n skip(\";\");\n }\n\n function parseImport() {\n var token = peek();\n var whichImports;\n switch (token) {\n case \"weak\":\n whichImports = weakImports || (weakImports = []);\n next();\n break;\n case \"public\":\n next();\n // eslint-disable-line no-fallthrough\n default:\n whichImports = imports || (imports = []);\n break;\n }\n token = readString();\n skip(\";\");\n whichImports.push(token);\n }\n\n function parseSyntax() {\n skip(\"=\");\n syntax = readString();\n isProto3 = syntax === \"proto3\";\n\n /* istanbul ignore if */\n if (!isProto3 && syntax !== \"proto2\")\n throw illegal(syntax, \"syntax\");\n\n skip(\";\");\n }\n\n function parseCommon(parent, token) {\n switch (token) {\n\n case \"option\":\n parseOption(parent, token);\n skip(\";\");\n return true;\n\n case \"message\":\n parseType(parent, token);\n return true;\n\n case \"enum\":\n parseEnum(parent, token);\n return true;\n\n case \"service\":\n parseService(parent, token);\n return true;\n\n case \"extend\":\n parseExtension(parent, token);\n return true;\n }\n return false;\n }\n\n function ifBlock(obj, fnIf, fnElse) {\n var trailingLine = tn.line;\n if (obj) {\n if(typeof obj.comment !== \"string\") {\n obj.comment = cmnt(); // try block-type comment\n }\n obj.filename = parse.filename;\n }\n if (skip(\"{\", true)) {\n var token;\n while ((token = next()) !== \"}\")\n fnIf(token);\n skip(\";\", true);\n } else {\n if (fnElse)\n fnElse();\n skip(\";\");\n if (obj && typeof obj.comment !== \"string\")\n obj.comment = cmnt(trailingLine); // try line-type comment if no block\n }\n }\n\n function parseType(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"type name\");\n\n var type = new Type(token);\n ifBlock(type, function parseType_block(token) {\n if (parseCommon(type, token))\n return;\n\n switch (token) {\n\n case \"map\":\n parseMapField(type, token);\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"oneof\":\n parseOneOf(type, token);\n break;\n\n case \"extensions\":\n readRanges(type.extensions || (type.extensions = []));\n break;\n\n case \"reserved\":\n readRanges(type.reserved || (type.reserved = []), true);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n\n push(token);\n parseField(type, \"optional\");\n break;\n }\n });\n parent.add(type);\n }\n\n function parseField(parent, rule, extend) {\n var type = next();\n if (type === \"group\") {\n parseGroup(parent, rule);\n return;\n }\n\n /* istanbul ignore if */\n if (!typeRefRe.test(type))\n throw illegal(type, \"type\");\n\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n name = applyCase(name);\n skip(\"=\");\n\n var field = new Field(name, parseId(next()), type, rule, extend);\n ifBlock(field, function parseField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\n // parsing proto2 descriptors without the option, where applicable. This must be done for\n // all known packable types and anything that could be an enum (= is not a basic type).\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\n field.setOption(\"packed\", false, /* ifNotSet */ true);\n }\n\n function parseGroup(parent, rule) {\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n var fieldName = util.lcFirst(name);\n if (name === fieldName)\n name = util.ucFirst(name);\n skip(\"=\");\n var id = parseId(next());\n var type = new Type(name);\n type.group = true;\n var field = new Field(fieldName, id, name, rule);\n field.filename = parse.filename;\n ifBlock(type, function parseGroup_block(token) {\n switch (token) {\n\n case \"option\":\n parseOption(type, token);\n skip(\";\");\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n /* istanbul ignore next */\n default:\n throw illegal(token); // there are no groups with proto3 semantics\n }\n });\n parent.add(type)\n .add(field);\n }\n\n function parseMapField(parent) {\n skip(\"<\");\n var keyType = next();\n\n /* istanbul ignore if */\n if (types.mapKey[keyType] === undefined)\n throw illegal(keyType, \"type\");\n\n skip(\",\");\n var valueType = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(valueType))\n throw illegal(valueType, \"type\");\n\n skip(\">\");\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n skip(\"=\");\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n ifBlock(field, function parseMapField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseMapField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n }\n\n function parseOneOf(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var oneof = new OneOf(applyCase(token));\n ifBlock(oneof, function parseOneOf_block(token) {\n if (token === \"option\") {\n parseOption(oneof, token);\n skip(\";\");\n } else {\n push(token);\n parseField(oneof, \"optional\");\n }\n });\n parent.add(oneof);\n }\n\n function parseEnum(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var enm = new Enum(token);\n ifBlock(enm, function parseEnum_block(token) {\n switch(token) {\n case \"option\":\n parseOption(enm, token);\n skip(\";\");\n break;\n\n case \"reserved\":\n readRanges(enm.reserved || (enm.reserved = []), true);\n break;\n\n default:\n parseEnumValue(enm, token);\n }\n });\n parent.add(enm);\n }\n\n function parseEnumValue(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token))\n throw illegal(token, \"name\");\n\n skip(\"=\");\n var value = parseId(next(), true),\n dummy = {};\n ifBlock(dummy, function parseEnumValue_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseEnumValue_line() {\n parseInlineOptions(dummy); // skip\n });\n parent.add(token, value, dummy.comment);\n }\n\n function parseOption(parent, token) {\n var isCustom = skip(\"(\", true);\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token;\n if (isCustom) {\n skip(\")\");\n name = \"(\" + name + \")\";\n token = peek();\n if (fqTypeRefRe.test(token)) {\n name += token;\n next();\n }\n }\n skip(\"=\");\n parseOptionValue(parent, name);\n }\n\n function parseOptionValue(parent, name) {\n if (skip(\"{\", true)) { // { a: \"foo\" b { c: \"bar\" } }\n do {\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n if (peek() === \"{\")\n parseOptionValue(parent, name + \".\" + token);\n else {\n skip(\":\");\n if (peek() === \"{\")\n parseOptionValue(parent, name + \".\" + token);\n else\n setOption(parent, name + \".\" + token, readValue(true));\n }\n skip(\",\", true);\n } while (!skip(\"}\", true));\n } else\n setOption(parent, name, readValue(true));\n // Does not enforce a delimiter to be universal\n }\n\n function setOption(parent, name, value) {\n if (parent.setOption)\n parent.setOption(name, value);\n }\n\n function parseInlineOptions(parent) {\n if (skip(\"[\", true)) {\n do {\n parseOption(parent, \"option\");\n } while (skip(\",\", true));\n skip(\"]\");\n }\n return parent;\n }\n\n function parseService(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"service name\");\n\n var service = new Service(token);\n ifBlock(service, function parseService_block(token) {\n if (parseCommon(service, token))\n return;\n\n /* istanbul ignore else */\n if (token === \"rpc\")\n parseMethod(service, token);\n else\n throw illegal(token);\n });\n parent.add(service);\n }\n\n function parseMethod(parent, token) {\n // Get the comment of the preceding line now (if one exists) in case the\n // method is defined across multiple lines.\n var commentText = cmnt();\n\n var type = token;\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token,\n requestType, requestStream,\n responseType, responseStream;\n\n skip(\"(\");\n if (skip(\"stream\", true))\n requestStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n requestType = token;\n skip(\")\"); skip(\"returns\"); skip(\"(\");\n if (skip(\"stream\", true))\n responseStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n responseType = token;\n skip(\")\");\n\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n method.comment = commentText;\n ifBlock(method, function parseMethod_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(method, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n });\n parent.add(method);\n }\n\n function parseExtension(parent, token) {\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"reference\");\n\n var reference = token;\n ifBlock(null, function parseExtension_block(token) {\n switch (token) {\n\n case \"required\":\n case \"repeated\":\n case \"optional\":\n parseField(parent, token, reference);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n push(token);\n parseField(parent, \"optional\", reference);\n break;\n }\n });\n }\n\n var token;\n while ((token = next()) !== null) {\n switch (token) {\n\n case \"package\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parsePackage();\n break;\n\n case \"import\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseImport();\n break;\n\n case \"syntax\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseSyntax();\n break;\n\n case \"option\":\n\n parseOption(ptr, token);\n skip(\";\");\n break;\n\n default:\n\n /* istanbul ignore else */\n if (parseCommon(ptr, token)) {\n head = false;\n continue;\n }\n\n /* istanbul ignore next */\n throw illegal(token);\n }\n }\n\n parse.filename = null;\n return {\n \"package\" : pkg,\n \"imports\" : imports,\n weakImports : weakImports,\n syntax : syntax,\n root : root\n };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(39);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(27);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(39);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\n/* istanbul ignore else */\nif (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(23);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(16),\n Enum = require(15),\n OneOf = require(25),\n util = require(37);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\t\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname; \n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = (getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = (getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n util.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(32);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(39);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(23);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(22),\n util = require(37),\n rpc = require(31);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = tokenize;\n\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\n\nvar setCommentRe = /^ *[*/]+ */,\n setCommentAltRe = /^\\s*\\*?\\/*/,\n setCommentSplitRe = /\\n/g,\n whitespaceRe = /\\s/,\n unescapeRe = /\\\\(.?)/g;\n\nvar unescapeMap = {\n \"0\": \"\\0\",\n \"r\": \"\\r\",\n \"n\": \"\\n\",\n \"t\": \"\\t\"\n};\n\n/**\n * Unescapes a string.\n * @param {string} str String to unescape\n * @returns {string} Unescaped string\n * @property {Object.} map Special characters map\n * @memberof tokenize\n */\nfunction unescape(str) {\n return str.replace(unescapeRe, function($0, $1) {\n switch ($1) {\n case \"\\\\\":\n case \"\":\n return $1;\n default:\n return unescapeMap[$1] || \"\";\n }\n });\n}\n\ntokenize.unescape = unescape;\n\n/**\n * Gets the next token and advances.\n * @typedef TokenizerHandleNext\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Peeks for the next token.\n * @typedef TokenizerHandlePeek\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Pushes a token back to the stack.\n * @typedef TokenizerHandlePush\n * @type {function}\n * @param {string} token Token\n * @returns {undefined}\n */\n\n/**\n * Skips the next token.\n * @typedef TokenizerHandleSkip\n * @type {function}\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] If optional\n * @returns {boolean} Whether the token matched\n * @throws {Error} If the token didn't match and is not optional\n */\n\n/**\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\n * @typedef TokenizerHandleCmnt\n * @type {function}\n * @param {number} [line] Line number\n * @returns {string|null} Comment text or `null` if none\n */\n\n/**\n * Handle object returned from {@link tokenize}.\n * @interface ITokenizerHandle\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\n * @property {number} line Current line number\n */\n\n/**\n * Tokenizes the given .proto source and returns an object with useful utility functions.\n * @param {string} source Source contents\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\n * @returns {ITokenizerHandle} Tokenizer handle\n */\nfunction tokenize(source, alternateCommentMode) {\n /* eslint-disable callback-return */\n source = source.toString();\n\n var offset = 0,\n length = source.length,\n line = 1,\n commentType = null,\n commentText = null,\n commentLine = 0,\n commentLineEmpty = false;\n\n var stack = [];\n\n var stringDelim = null;\n\n /* istanbul ignore next */\n /**\n * Creates an error for illegal syntax.\n * @param {string} subject Subject\n * @returns {Error} Error created\n * @inner\n */\n function illegal(subject) {\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\n }\n\n /**\n * Reads a string till its end.\n * @returns {string} String read\n * @inner\n */\n function readString() {\n var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\n re.lastIndex = offset - 1;\n var match = re.exec(source);\n if (!match)\n throw illegal(\"string\");\n offset = re.lastIndex;\n push(stringDelim);\n stringDelim = null;\n return unescape(match[1]);\n }\n\n /**\n * Gets the character at `pos` within the source.\n * @param {number} pos Position\n * @returns {string} Character\n * @inner\n */\n function charAt(pos) {\n return source.charAt(pos);\n }\n\n /**\n * Sets the current comment text.\n * @param {number} start Start offset\n * @param {number} end End offset\n * @returns {undefined}\n * @inner\n */\n function setComment(start, end) {\n commentType = source.charAt(start++);\n commentLine = line;\n commentLineEmpty = false;\n var lookback;\n if (alternateCommentMode) {\n lookback = 2; // alternate comment parsing: \"//\" or \"/*\"\n } else {\n lookback = 3; // \"///\" or \"/**\"\n }\n var commentOffset = start - lookback,\n c;\n do {\n if (--commentOffset < 0 ||\n (c = source.charAt(commentOffset)) === \"\\n\") {\n commentLineEmpty = true;\n break;\n }\n } while (c === \" \" || c === \"\\t\");\n var lines = source\n .substring(start, end)\n .split(setCommentSplitRe);\n for (var i = 0; i < lines.length; ++i)\n lines[i] = lines[i]\n .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\n .trim();\n commentText = lines\n .join(\"\\n\")\n .trim();\n }\n\n function isDoubleSlashCommentLine(startOffset) {\n var endOffset = findEndOfLine(startOffset);\n\n // see if remaining line matches comment pattern\n var lineText = source.substring(startOffset, endOffset);\n // look for 1 or 2 slashes since startOffset would already point past\n // the first slash that started the comment.\n var isComment = /^\\s*\\/{1,2}/.test(lineText);\n return isComment;\n }\n\n function findEndOfLine(cursor) {\n // find end of cursor's line\n var endOffset = cursor;\n while (endOffset < length && charAt(endOffset) !== \"\\n\") {\n endOffset++;\n }\n return endOffset;\n }\n\n /**\n * Obtains the next token.\n * @returns {string|null} Next token or `null` on eof\n * @inner\n */\n function next() {\n if (stack.length > 0)\n return stack.shift();\n if (stringDelim)\n return readString();\n var repeat,\n prev,\n curr,\n start,\n isDoc;\n do {\n if (offset === length)\n return null;\n repeat = false;\n while (whitespaceRe.test(curr = charAt(offset))) {\n if (curr === \"\\n\")\n ++line;\n if (++offset === length)\n return null;\n }\n\n if (charAt(offset) === \"/\") {\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n if (charAt(offset) === \"/\") { // Line\n if (!alternateCommentMode) {\n // check for triple-slash comment\n isDoc = charAt(start = offset + 1) === \"/\";\n\n while (charAt(++offset) !== \"\\n\") {\n if (offset === length) {\n return null;\n }\n }\n ++offset;\n if (isDoc) {\n setComment(start, offset - 1);\n }\n ++line;\n repeat = true;\n } else {\n // check for double-slash comments, consolidating consecutive lines\n start = offset;\n isDoc = false;\n if (isDoubleSlashCommentLine(offset)) {\n isDoc = true;\n do {\n offset = findEndOfLine(offset);\n if (offset === length) {\n break;\n }\n offset++;\n } while (isDoubleSlashCommentLine(offset));\n } else {\n offset = Math.min(length, findEndOfLine(offset) + 1);\n }\n if (isDoc) {\n setComment(start, offset);\n }\n line++;\n repeat = true;\n }\n } else if ((curr = charAt(offset)) === \"*\") { /* Block */\n // check for /** (regular comment mode) or /* (alternate comment mode)\n start = offset + 1;\n isDoc = alternateCommentMode || charAt(start) === \"*\";\n do {\n if (curr === \"\\n\") {\n ++line;\n }\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n prev = curr;\n curr = charAt(offset);\n } while (prev !== \"*\" || curr !== \"/\");\n ++offset;\n if (isDoc) {\n setComment(start, offset - 2);\n }\n repeat = true;\n } else {\n return \"/\";\n }\n }\n } while (repeat);\n\n // offset !== length if we got here\n\n var end = offset;\n delimRe.lastIndex = 0;\n var delim = delimRe.test(charAt(end++));\n if (!delim)\n while (end < length && !delimRe.test(charAt(end)))\n ++end;\n var token = source.substring(offset, offset = end);\n if (token === \"\\\"\" || token === \"'\")\n stringDelim = token;\n return token;\n }\n\n /**\n * Pushes a token back to the stack.\n * @param {string} token Token\n * @returns {undefined}\n * @inner\n */\n function push(token) {\n stack.push(token);\n }\n\n /**\n * Peeks for the next token.\n * @returns {string|null} Token or `null` on eof\n * @inner\n */\n function peek() {\n if (!stack.length) {\n var token = next();\n if (token === null)\n return null;\n push(token);\n }\n return stack[0];\n }\n\n /**\n * Skips a token.\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] Whether the token is optional\n * @returns {boolean} `true` when skipped, `false` if not\n * @throws {Error} When a required token is not present\n * @inner\n */\n function skip(expected, optional) {\n var actual = peek(),\n equals = actual === expected;\n if (equals) {\n next();\n return true;\n }\n if (!optional)\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\n return false;\n }\n\n /**\n * Gets a comment.\n * @param {number} [trailingLine] Line number if looking for a trailing comment\n * @returns {string|null} Comment text\n * @inner\n */\n function cmnt(trailingLine) {\n var ret = null;\n if (trailingLine === undefined) {\n if (commentLine === line - 1 && (alternateCommentMode || commentType === \"*\" || commentLineEmpty)) {\n ret = commentText;\n }\n } else {\n /* istanbul ignore else */\n if (commentLine < trailingLine) {\n peek();\n }\n if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === \"/\")) {\n ret = commentText;\n }\n }\n return ret;\n }\n\n return Object.defineProperty({\n next: next,\n peek: peek,\n push: push,\n skip: skip,\n cmnt: cmnt\n }, \"line\", {\n get: function() { return line; }\n });\n /* eslint-enable callback-return */\n}\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(23);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(15),\n OneOf = require(25),\n Field = require(16),\n MapField = require(20),\n Service = require(33),\n Message = require(21),\n Reader = require(27),\n Writer = require(42),\n util = require(37),\n encoder = require(14),\n decoder = require(13),\n verifier = require(40),\n converter = require(12),\n wrappers = require(41);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n name = name.replace(/\\W/g, \"\");\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(37);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(39);\n\nvar roots = require(30);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(35);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(15);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(29))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(39);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/*\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(38);\n\n// global object reference\nutil.global = typeof window !== \"undefined\" && window\n || typeof global !== \"undefined\" && global\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n * @const\n */\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/*\n * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on\n * for this package's tests but have it be off in actual usage-reporting-protobuf use.\n * (We leave it on for some mode where there is no `process` that is used by tests.)\n */\nutil.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\")) : undefined;\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/*\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/*\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(15),\n util = require(37);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(21);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n var type = this.lookup(object[\"@type\"]);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n return this.create({\n type_url: \"/\" + type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n object[\"@type\"] = message.$type.fullName;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(39);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(42);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(39);\n\nvar Buffer = util.Buffer;\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\nBufferWriter.alloc = function alloc_buffer(size) {\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\n};\n\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else\n buf.utf8Write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js new file mode 100644 index 00000000..64391e8d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js @@ -0,0 +1,7 @@ +/*! + * protobuf.js (c) 2016, daniel wirtz + * licensed under the bsd-3-clause license + * see: https://github.com/apollographql/protobuf.js for details + */ +!function(tt){"use strict";var r,e,t,i;r={1:[function(t,i){i.exports=function(t,i){var n=Array(arguments.length-1),s=0,r=2,u=!0;for(;r>2],r=(3&f)<<4,o=1;break;case 1:s[u++]=h[r|f>>4],r=(15&f)<<2,o=2;break;case 2:s[u++]=h[r|f>>6],s[u++]=h[63&f],o=0}8191>4,r=o,s=2;break;case 2:i[n++]=(15&r)<<4|(60&o)>>2,r=o,s=3;break;case 3:i[n++]=(3&r)<<6|o,s=0}}if(1===s)throw Error(a);return n-e},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},{}],3:[function(t,i){function c(i,n){"string"==typeof i&&(n=i,i=tt);var f=[];function h(t){if("string"!=typeof t){var i=a();if(c.verbose&&console.log("codegen: "+i),i="return "+i,t){for(var n=Object.keys(t),r=Array(n.length+1),e=Array(n.length),s=0;s>>0,n,r);else if(i<11754943508222875e-54)t((e<<31|Math.round(i/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(i)/Math.LN2);t((e<<31|s+127<<23|8388607&Math.round(i*Math.pow(2,-s)*8388608))>>>0,n,r)}}function i(t,i,n){var r=t(i,n),e=2*(r>>31)+1,s=r>>>23&255,u=8388607&r;return 255===s?u?NaN:e*(1/0):0===s?1401298464324817e-60*e*u:e*Math.pow(2,s-150)*(u+8388608)}o.writeFloatLE=t.bind(null,r),o.writeFloatBE=t.bind(null,e),o.readFloatLE=i.bind(null,s),o.readFloatBE=i.bind(null,u)}(),"undefined"!=typeof Float64Array?function(){var r=new Float64Array([-0]),e=new Uint8Array(r.buffer),t=128===e[7];function i(t,i,n){r[0]=t,i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2],i[n+3]=e[3],i[n+4]=e[4],i[n+5]=e[5],i[n+6]=e[6],i[n+7]=e[7]}function n(t,i,n){r[0]=t,i[n]=e[7],i[n+1]=e[6],i[n+2]=e[5],i[n+3]=e[4],i[n+4]=e[3],i[n+5]=e[2],i[n+6]=e[1],i[n+7]=e[0]}function s(t,i){return e[0]=t[i],e[1]=t[i+1],e[2]=t[i+2],e[3]=t[i+3],e[4]=t[i+4],e[5]=t[i+5],e[6]=t[i+6],e[7]=t[i+7],r[0]}function u(t,i){return e[7]=t[i],e[6]=t[i+1],e[5]=t[i+2],e[4]=t[i+3],e[3]=t[i+4],e[2]=t[i+5],e[1]=t[i+6],e[0]=t[i+7],r[0]}o.writeDoubleLE=t?i:n,o.writeDoubleBE=t?n:i,o.readDoubleLE=t?s:u,o.readDoubleBE=t?u:s}():function(){function t(t,i,n,r,e,s){var u=r<0?1:0;if(u&&(r=-r),0===r)t(0,e,s+i),t(0<1/r?0:2147483648,e,s+n);else if(isNaN(r))t(0,e,s+i),t(2146959360,e,s+n);else if(17976931348623157e292>>0,e,s+n);else{var o;if(r<22250738585072014e-324)t((o=r/5e-324)>>>0,e,s+i),t((u<<31|o/4294967296)>>>0,e,s+n);else{var f=Math.floor(Math.log(r)/Math.LN2);1024===f&&(f=1023),t(4503599627370496*(o=r*Math.pow(2,-f))>>>0,e,s+i),t((u<<31|f+1023<<20|1048576*o&1048575)>>>0,e,s+n)}}}function i(t,i,n,r,e){var s=t(r,e+i),u=t(r,e+n),o=2*(u>>31)+1,f=u>>>20&2047,h=4294967296*(1048575&u)+s;return 2047===f?h?NaN:o*(1/0):0===f?5e-324*o*h:o*Math.pow(2,f-1075)*(h+4503599627370496)}o.writeDoubleLE=t.bind(null,r,0,4),o.writeDoubleBE=t.bind(null,e,4,0),o.readDoubleLE=i.bind(null,s,0,4),o.readDoubleBE=i.bind(null,u,4,0)}(),o}function r(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}function e(t,i,n){i[n]=t>>>24,i[n+1]=t>>>16&255,i[n+2]=t>>>8&255,i[n+3]=255&t}function s(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0}function u(t,i){return(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0}i.exports=n(n)},{}],7:[function(t,i,n){function r(t){try{var i=eval("require")(t);if(i&&(i.length||Object.keys(i).length))return i}catch(t){}return null}i.exports=r},{}],8:[function(t,i,n){var r=n,s=r.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},e=r.normalize=function(t){var i=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=s(t),r="";n&&(r=i.shift()+"/");for(var e=0;e>>1,u=null,o=e;return function(t){if(t<1||s>10),s[u++]=56320+(1023&r)):s[u++]=(15&r)<<12|(63&t[i++])<<6|63&t[i++],8191>6|192:(55296==(64512&r)&&56320==(64512&(e=t.charCodeAt(u+1)))?(r=65536+((1023&r)<<10)+(1023&e),++u,i[n++]=r>>18|240,i[n++]=r>>12&63|128):i[n++]=r>>12|224,i[n++]=r>>6&63|128),i[n++]=63&r|128);return n-s}},{}],11:[function(t,i){i.exports=e;var n,r=/\/|\./;function e(t,i){r.test(t)||(t="google/protobuf/"+t+".proto",i={nested:{google:{nested:{protobuf:{nested:i}}}}}),e[t]=i}e("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),e("duration",{Duration:n={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),e("timestamp",{Timestamp:n}),e("empty",{Empty:{fields:{}}}),e("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),e("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),e("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),e.get=function(t){return e[t]||null}},{}],12:[function(t,i,n){var r=n,l=t(15),v=t(37);function o(t,i,n,r,e){if(e===tt&&(e="d"+r),i.resolvedType)if(i.resolvedType instanceof l){t("switch(%s){",e);for(var s=i.resolvedType.values,u=Object.keys(s),o=0;o>>0",r,e);break;case"int32":case"sint32":case"sfixed32":t("m%s=%s|0",r,e);break;case"uint64":f=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(%s)).unsigned=%j",r,e,f)('else if(typeof %s==="string")',e)("m%s=parseInt(%s,10)",r,e)('else if(typeof %s==="number")',e)("m%s=%s",r,e)('else if(typeof %s==="object")',e)("m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)",r,e,e,f?"true":"");break;case"bytes":t('if(typeof %s==="string")',e)("util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)",e,r,e)("else if(%s.length)",e)("m%s=%s",r,e);break;case"string":t("m%s=String(%s)",r,e);break;case"bool":t("m%s=Boolean(%s)",r,e)}}return t}function d(t,i,n,r){if(i.resolvedType)i.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",r,n,r,r):t("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var e=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":e=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,e?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:t("d%s=m%s",r,r)}}return t}r.fromObject=function(t){var i=t.fieldsArray,n=v.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!i.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r>>3){");for(var n=0;n>>0,8|c.mapKey[s.keyType],s.keyType),f===tt?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,o,i),n("}")("}");else if(s.repeated){var h=i;s.useToArray()&&(h="array"+s.id,n("var %s",h),n("if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }",i,i,h,i,h,i)),n("if(%s!=null&&%s.length){",h,h),s.packed&&c.packed[o]!==tt?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",h)("w.%s(%s[i])",o,h)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",h),f===tt?v(n,s,u,h+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|f)>>>0,o,h)),n("}")}else s.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),f===tt?v(n,s,u,i):n("w.uint32(%i).%s(%s)",(s.id<<3|f)>>>0,o,i)}return n("return w")};var a=t(15),c=t(36),l=t(37);function v(t,i,n,r){if(i.resolvedType.group)t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0);else{var e=(i.id<<3|2)>>>0;i.preEncoded()&&t("if (%s instanceof Uint8Array) {",r)("w.uint32(%i)",e)("w.bytes(%s)",r)("} else {"),t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,e),i.preEncoded()&&t("}")}}},{15:15,36:36,37:37}],15:[function(t,i){i.exports=e;var o=t(24);((e.prototype=Object.create(o.prototype)).constructor=e).className="Enum";var n=t(23),r=t(37);function e(t,i,n,r,e){if(o.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.reserved=tt,i)for(var s=Object.keys(i),u=0;ui)return!0;return!1},h.isReservedName=function(t,i){if(t)for(var n=0;n");var r=a();if(!G.test(r))throw b(r,"name");l("=");var e=new _(w(r),k(a()),i,n);S(e,function(t){if("option"!==t)throw b(t);N(e,t),l(";")},function(){$(e)}),t.add(e)}(n);break;case"required":case"optional":case"repeated":T(n,t);break;case"oneof":!function(t,i){if(!G.test(i=a()))throw b(i,"name");var n=new L(w(i));S(n,function(t){"option"===t?(N(n,t),l(";")):(h(t),T(n,"optional"))}),t.add(n)}(n,t);break;case"extensions":j(n.extensions||(n.extensions=[]));break;case"reserved":j(n.reserved||(n.reserved=[]),!0);break;default:if(!p||!K.test(t))throw b(t);h(t),T(n,"optional")}}),t.add(n)}(t,i),!0;case"enum":return function(t,i){if(!G.test(i=a()))throw b(i,"name");var n=new q(i);S(n,function(t){switch(t){case"option":N(n,t),l(";");break;case"reserved":j(n.reserved||(n.reserved=[]),!0);break;default:!function(t,i){if(!G.test(i))throw b(i,"name");l("=");var n=k(a(),!0),r={};S(r,function(t){if("option"!==t)throw b(t);N(r,t),l(";")},function(){$(r)}),t.add(i,n,r.comment)}(n,t)}}),t.add(n)}(t,i),!0;case"service":return function(t,i){if(!G.test(i=a()))throw b(i,"service name");var n=new R(i);S(n,function(t){if(!x(n,t)){if("rpc"!==t)throw b(t);!function(t,i){var n=v(),r=i;if(!G.test(i=a()))throw b(i,"name");var e,s,u,o,f=i;l("("),l("stream",!0)&&(s=!0);if(!K.test(i=a()))throw b(i);e=i,l(")"),l("returns"),l("("),l("stream",!0)&&(o=!0);if(!K.test(i=a()))throw b(i);u=i,l(")");var h=new z(f,r,e,u,s,o);h.comment=n,S(h,function(t){if("option"!==t)throw b(t);N(h,t),l(";")}),t.add(h)}(n,t)}}),t.add(n)}(t,i),!0;case"extend":return function(i,t){if(!K.test(t=a()))throw b(t,"reference");var n=t;S(null,function(t){switch(t){case"required":case"repeated":case"optional":T(i,t,n);break;default:if(!p||!K.test(t))throw b(t);h(t),T(i,"optional",n)}})}(t,i),!0}return!1}function S(t,i,n){var r=f.line;if(t&&("string"!=typeof t.comment&&(t.comment=v()),t.filename=Y.filename),l("{",!0)){for(var e;"}"!==(e=a());)i(e);l(";",!0)}else n&&n(),l(";"),t&&"string"!=typeof t.comment&&(t.comment=v(r))}function T(t,i,n){var r=a();if("group"!==r){if(!K.test(r))throw b(r,"type");var e=a();if(!G.test(e))throw b(e,"name");e=w(e),l("=");var s=new U(e,k(a()),r,i,n);S(s,function(t){if("option"!==t)throw b(t);N(s,t),l(";")},function(){$(s)}),t.add(s),p||!s.repeated||Z.packed[r]===tt&&Z.basic[r]!==tt||s.setOption("packed",!1,!0)}else!function(t,i){var n=a();if(!G.test(n))throw b(n,"name");var r=B.lcFirst(n);n===r&&(n=B.ucFirst(n));l("=");var e=k(a()),s=new F(n);s.group=!0;var u=new U(r,e,n,i);u.filename=Y.filename,S(s,function(t){switch(t){case"option":N(s,t),l(";");break;case"required":case"optional":case"repeated":T(s,t);break;default:throw b(t)}}),t.add(s).add(u)}(t,i)}function N(t,i){var n=l("(",!0);if(!K.test(i=a()))throw b(i,"name");var r=i;n&&(l(")"),r="("+r+")",i=c(),Q.test(i)&&(r+=i,a())),l("="),function t(i,n){if(l("{",!0))do{if(!G.test(o=a()))throw b(o,"name");"{"===c()?t(i,n+"."+o):(l(":"),"{"===c()?t(i,n+"."+o):V(i,n+"."+o,g(!0))),l(",",!0)}while(!l("}",!0));else V(i,n,g(!0))}(t,r)}function V(t,i,n){t.setOption&&t.setOption(i,n)}function $(t){if(l("[",!0)){for(;N(t,"option"),l(",",!0););l("]")}return t}for(;null!==(o=a());)switch(o){case"package":if(!d)throw b(o);E();break;case"import":if(!d)throw b(o);O();break;case"syntax":if(!d)throw b(o);A();break;case"option":N(y,o),l(";");break;default:if(x(y,o)){d=!1;continue}throw b(o)}return Y.filename=null,{package:r,imports:e,weakImports:s,syntax:u,root:i}}},{15:15,16:16,20:20,22:22,25:25,29:29,33:33,34:34,35:35,36:36,37:37}],27:[function(t,i){i.exports=o;var n,r=t(39),e=r.LongBits,s=r.utf8;function u(t,i){return RangeError("index out of range: "+t.pos+" + "+(i||1)+" > "+t.len)}function o(t){this.buf=t,this.pos=0,this.len=t.length}var f,h="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new o(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new o(t);throw Error("illegal buffer")};function a(){var t=new e(0,0),i=0;if(!(4=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function c(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function l(){if(this.pos+8>this.len)throw u(this,8);return new e(c(this.buf,this.pos+=4),c(this.buf,this.pos+=4))}o.create=r.Buffer?function(t){return(o.create=function(t){return r.Buffer.isBuffer(t)?new n(t):h(t)})(t)}:h,o.prototype.c=r.Array.prototype.subarray||r.Array.prototype.slice,o.prototype.uint32=(f=4294967295,function(){if(f=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return f;if(f=(f|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return f;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return f}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return c(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|c(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},o.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},o.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,n):i===n?new this.buf.constructor(0):this.c.call(this.buf,i,n)},o.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},o.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},o.o=function(t){n=t;var i=r.Long?"toLong":"toNumber";r.merge(o.prototype,{int64:function(){return a.call(this)[i](!1)},uint64:function(){return a.call(this)[i](!0)},sint64:function(){return a.call(this).zzDecode()[i](!1)},fixed64:function(){return l.call(this)[i](!0)},sfixed64:function(){return l.call(this)[i](!1)}})}},{39:39}],28:[function(t,i){i.exports=e;var n=t(27);(e.prototype=Object.create(n.prototype)).constructor=e;var r=t(39);function e(t){n.call(this,t)}r.Buffer&&(e.prototype.c=r.Buffer.prototype.slice),e.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len))}},{27:27,39:39}],29:[function(t,i){i.exports=n;var r=t(23);((n.prototype=Object.create(r.prototype)).constructor=n).className="Root";var e,v,d,s=t(16),u=t(15),o=t(25),p=t(37);function n(t){r.call(this,"",t),this.deferred=[],this.files=[]}function y(){}n.fromJSON=function(t,i){return i||(i=new n),t.options&&i.setOptions(t.options),i.addJSON(t.nested)},n.prototype.resolvePath=p.path.resolve,n.prototype.load=function t(i,s,e){"function"==typeof s&&(e=s,s=tt);var u=this;if(!e)return p.asPromise(t,u,i,s);var o=e===y;function f(t,i){if(e){var n=e;if(e=null,o)throw t;n(t,i)}}function h(t){var i=t.lastIndexOf("google/protobuf/");if(-1]/g,O=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,A=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,x=/^ *[*/]+ */,S=/^\s*\*?\/*/,T=/\n/g,N=/\s/,n=/\\(.?)/g,r={0:"\0",r:"\r",n:"\n",t:"\t"};function V(t){return t.replace(n,function(t,i){switch(i){case"\\":case"":return i;default:return r[i]||""}})}function e(o,f){o=o.toString();var h=0,a=o.length,c=1,u=null,l=null,v=0,d=!1,p=[],y=null;function w(t){return Error("illegal "+t+" (line "+c+")")}function b(t){return o.charAt(t)}function m(t,i){u=o.charAt(t++),v=c,d=!1;var n,r=t-(f?2:3);do{if(--r<0||"\n"===(n=o.charAt(r))){d=!0;break}}while(" "===n||"\t"===n);for(var e=o.substring(t,i).split(T),s=0;s>>0,this.hi=i>>>0}var s=e.zero=new e(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var r=e.zeroHash="\0\0\0\0\0\0\0\0";e.fromNumber=function(t){if(0===t)return s;var i=t<0;i&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return i&&(r=~r>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++r&&(r=0))),new e(n,r)},e.from=function(t){if("number"==typeof t)return e.fromNumber(t);if(n.isString(t)){if(!n.Long)return e.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new e(t.low>>>0,t.high>>>0):s},e.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,n=~this.hi>>>0;return i||(n=n+1>>>0),-(i+4294967296*n)}return this.lo+4294967296*this.hi},e.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;e.fromHash=function(t){return t===r?s:new e((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},e.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},e.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},e.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},e.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10}},{39:39}],39:[function(t,i,n){var r=n;function e(t,i,n){for(var r=Object.keys(i),e=0;e>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127>>7;i[n++]=t.lo}function d(t,i,n){i[n]=255&t,i[n+1]=t>>>8&255,i[n+2]=t>>>16&255,i[n+3]=t>>>24}a.create=r.Buffer?function(){return(a.create=function(){return new n})()}:function(){return new a},a.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(a.alloc=r.pool(a.alloc,r.Array.prototype.subarray)),a.prototype.g=function(t,i,n){return this.tail=this.tail.next=new o(t,i,n),this.len+=i,this},(l.prototype=Object.create(o.prototype)).fn=function(t,i,n){for(;127>>=7;i[n]=t},a.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new l((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},a.prototype.int32=function(t){return t<0?this.g(v,10,e.fromNumber(t)):this.uint32(t)},a.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},a.prototype.int64=a.prototype.uint64=function(t){var i=e.from(t);return this.g(v,i.length(),i)},a.prototype.sint64=function(t){var i=e.from(t).zzEncode();return this.g(v,i.length(),i)},a.prototype.bool=function(t){return this.g(c,1,t?1:0)},a.prototype.sfixed32=a.prototype.fixed32=function(t){return this.g(d,4,t>>>0)},a.prototype.sfixed64=a.prototype.fixed64=function(t){var i=e.from(t);return this.g(d,4,i.lo).g(d,4,i.hi)},a.prototype.float=function(t){return this.g(r.float.writeFloatLE,4,t)},a.prototype.double=function(t){return this.g(r.float.writeDoubleLE,8,t)};var p=r.Array.prototype.set?function(t,i,n){i.set(t,n)}:function(t,i,n){for(var r=0;r>>0;if(!i)return this.g(c,1,0);if(r.isString(t)){var n=a.alloc(i=s.length(t));s.decode(t,n,0),t=n}return this.uint32(i).g(p,i,t)},a.prototype.string=function(t){var i=u.length(t);return i?this.uint32(i).g(u.write,i,t):this.g(c,1,0)},a.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new o(f,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(f,0,0),this.len=0),this},a.prototype.ldelim=function(){var t=this.head,i=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=i,this.len+=n),this},a.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,i,n),n+=t.len,t=t.next;return i},a.o=function(t){n=t}},{39:39}],43:[function(t,i){i.exports=s;var n=t(42);(s.prototype=Object.create(n.prototype)).constructor=s;var r=t(39),e=r.Buffer;function s(){n.call(this)}s.alloc=function(t){return(s.alloc=r.b)(t)};var u=e&&e.prototype instanceof Uint8Array&&"set"===e.prototype.set.name?function(t,i,n){i.set(t,n)}:function(t,i,n){if(t.copy)t.copy(i,n,0,t.length);else for(var r=0;r>>0;return this.uint32(i),i&&this.g(u,i,t),this},s.prototype.string=function(t){var i=e.byteLength(t);return this.uint32(i),i&&this.g(o,i,t),this}},{39:39,42:42}]},e={},t=[19],i=function t(i){var n=e[i];return n||r[i][0].call(n=e[i]={exports:{}},t,n,n.exports),n.exports}(t[0]),i.util.global.protobuf=i,"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&t.isLong&&(i.util.Long=t,i.configure()),i}),"object"==typeof module&&module&&module.exports&&(module.exports=i)}(); +//# sourceMappingURL=protobuf.min.js.map diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js.map b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js.map new file mode 100644 index 00000000..e20c2c5f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/dist/protobuf.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/prelude.js","../node_modules/@protobufjs/aspromise/index.js","../node_modules/@protobufjs/base64/index.js","../node_modules/@protobufjs/codegen/index.js","../node_modules/@protobufjs/eventemitter/index.js","../node_modules/@protobufjs/fetch/index.js","../node_modules/@protobufjs/float/index.js","../node_modules/@protobufjs/inquire/index.js","../node_modules/@protobufjs/path/index.js","../node_modules/@protobufjs/pool/index.js","../node_modules/@protobufjs/utf8/index.js","../src/common.js","../src/converter.js","../src/decoder.js","../src/encoder.js","../src/enum.js","../src/field.js","../src/index-light.js","../src/index-minimal.js","../src/index","../src/mapfield.js","../src/message.js","../src/method.js","../src/namespace.js","../src/object.js","../src/oneof.js","../src/parse.js","../src/reader.js","../src/reader_buffer.js","../src/root.js","../src/roots.js","../src/rpc.js","../src/rpc/service.js","../src/service.js","../src/tokenize.js","../src/type.js","../src/types.js","../src/util.js","../src/util/longbits.js","../src/util/minimal.js","../src/verifier.js","../src/wrappers.js","../src/writer.js","../src/writer_buffer.js"],"names":["undefined","modules","cache","entries","protobuf","1","require","module","exports","fn","ctx","params","Array","arguments","length","offset","index","pending","Promise","resolve","reject","err","apply","base64","string","p","n","charAt","Math","ceil","b64","s64","i","encode","buffer","start","end","t","parts","chunk","j","b","push","String","fromCharCode","slice","join","invalidEncoding","decode","c","charCodeAt","Error","test","codegen","functionParams","functionName","body","Codegen","formatStringOrScope","source","toString","verbose","console","log","scopeKeys","Object","keys","scopeParams","scopeValues","scopeOffset","Function","formatParams","formatOffset","replace","$0","$1","value","floor","JSON","stringify","functionNameOverride","EventEmitter","this","_listeners","prototype","on","evt","off","listeners","splice","emit","args","fetch","asPromise","fs","inquire","filename","options","callback","xhr","readFile","contents","XMLHttpRequest","binary","onreadystatechange","readyState","status","response","responseText","Uint8Array","overrideMimeType","responseType","open","send","factory","Float32Array","f32","f8b","le","writeFloat_f32_cpy","val","buf","pos","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloatLE","writeFloatBE","readFloatLE","readFloatBE","writeFloat_ieee754","writeUint","sign","isNaN","round","exponent","LN2","pow","readFloat_ieee754","readUint","uint","mantissa","NaN","Infinity","bind","writeUintLE","writeUintBE","readUintLE","readUintBE","Float64Array","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDoubleLE","writeDoubleBE","readDoubleLE","readDoubleBE","writeDouble_ieee754","off0","off1","readDouble_ieee754","lo","hi","moduleName","mod","eval","e","path","isAbsolute","normalize","split","absolute","prefix","shift","originPath","includePath","alreadyNormalized","alloc","size","SIZE","MAX","slab","call","utf8","len","read","write","c1","c2","common","timeType","commonRe","name","json","nested","google","Any","fields","type_url","type","id","Duration","seconds","nanos","Timestamp","Empty","Struct","keyType","Value","oneofs","kind","oneof","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","values","NULL_VALUE","ListValue","rule","DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue","FieldMask","paths","get","file","converter","Enum","util","genValuePartial_fromObject","gen","field","fieldIndex","prop","ref","resolvedType","repeated","typeDefault","fullName","isUnsigned","genValuePartial_toObject","fromObject","mtype","fieldsArray","safeProp","map","arrayRef","useToArray","toObject","sort","compareFieldsById","repeatedFields","mapFields","normalFields","partOf","valuesById","long","low","high","unsigned","toNumber","bytes","arrayDefault","hasKs2","_fieldsArray","indexOf","filter","group","types","basic","packed","rfield","required","wireType","mapKey","genTypePartial","optional","key","preEncoded","ReflectionObject","create","constructor","className","Namespace","comment","comments","TypeError","reserved","fromJSON","enm","toJSON","toJSONOptions","keepComments","add","isString","isInteger","isReservedId","isReservedName","allow_alias","remove","Field","Type","ruleRe","extend","isObject","toLowerCase","message","defaultValue","Long","extensionField","declaringField","_packed","defineProperty","getOption","setOption","ifNotSet","resolved","defaults","parent","lookupTypeOrEnum","fromNumber","freeze","newBuffer","emptyObject","emptyArray","ctor","d","fieldId","fieldType","fieldRule","decorateType","decorateEnum","fieldName","default","_configure","Type_","build","load","root","Root","loadSync","encoder","decoder","verifier","OneOf","MapField","Service","Method","Message","wrappers","configure","Reader","BufferReader","Writer","BufferWriter","rpc","roots","tokenize","parse","resolvedKeyType","fieldKeyType","fieldValueType","properties","$type","writer","encodeDelimited","reader","decodeDelimited","verify","object","requestType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","lookupType","arrayToJSON","array","obj","_nestedArray","clearCache","namespace","addJSON","toArray","nestedArray","nestedJson","names","methods","getEnum","prev","setOptions","onAdd","onRemove","define","isArray","ptr","part","resolveAll","lookup","filterTypes","parentAlreadyChecked","found","lookupEnum","lookupService","Service_","Enum_","defineProperties","unshift","_handleAdd","_handleRemove","Root_","fieldNames","addFieldsToParent","oneofName","oneOfGetter","set","oneOfSetter","keepCase","base10Re","base10NegRe","base16Re","base16NegRe","base8Re","base8NegRe","numberRe","nameRe","typeRefRe","fqTypeRefRe","pkg","imports","weakImports","syntax","token","tn","alternateCommentMode","next","peek","skip","cmnt","head","isProto3","applyCase","camelCase","illegal","insideTryCatch","line","readString","readValue","acceptTypeRef","substring","parseInt","parseFloat","parseNumber","readRanges","target","acceptStrings","parseId","acceptNegative","parsePackage","parseImport","whichImports","parseSyntax","parseCommon","parseOption","ifBlock","valueType","parseInlineOptions","parseMapField","parseField","parseOneOf","extensions","parseType","dummy","parseEnumValue","parseEnum","service","commentText","method","parseMethod","parseService","reference","parseExtension","fnIf","fnElse","trailingLine","lcFirst","ucFirst","parseGroup","isCustom","parseOptionValue","package","LongBits","indexOutOfRange","writeLength","RangeError","create_array","readLongVarint","bits","readFixed32_end","readFixed64","Buffer","isBuffer","_slice","subarray","uint32","int32","sint32","bool","fixed32","sfixed32","float","double","skipType","BufferReader_","merge","int64","uint64","sint64","zzDecode","fixed64","sfixed64","utf8Slice","min","deferred","files","SYNC","resolvePath","self","sync","finish","cb","getBundledFileName","idx","lastIndexOf","altname","process","parsed","queued","weak","setTimeout","readFileSync","isNode","exposeRe","tryHandleExtension","extendedType","sisterField","parse_","common_","rpcImpl","requestDelimited","responseDelimited","rpcCall","requestCtor","responseCtor","request","endedByRPC","_methodsArray","inherited","methodsArray","rpcService","methodName","isReserved","m","q","s","delimRe","stringDoubleRe","stringSingleRe","setCommentRe","setCommentAltRe","setCommentSplitRe","whitespaceRe","unescapeRe","unescapeMap","0","r","unescape","str","commentType","commentLine","commentLineEmpty","stack","stringDelim","subject","setComment","commentOffset","lines","trim","isDoubleSlashCommentLine","startOffset","endOffset","findEndOfLine","lineText","cursor","re","lastIndex","match","exec","repeat","curr","isDoc","expected","actual","ret","_fieldsById","_oneofsArray","_ctor","fieldsById","oneofsArray","generateConstructor","ctorProperties","setup","wrapper","originalThis","fork","ldelim","typeName","bake","o","safePropBackslashRe","safePropQuoteRe","toUpperCase","camelCaseRe","a","decorateRoot","enumerable","decorateEnumIndex","zero","zzEncode","zeroHash","from","fromString","toLong","fromHash","hash","toHash","mask","part0","part1","part2","dst","src","newError","CustomError","captureStackTrace","pool","global","window","versions","node","Number","isFinite","isset","isSet","hasOwnProperty","utf8Write","_Buffer_from","_Buffer_allocUnsafe","sizeOrArray","env","ENABLE_LONG","dcodeIO","key2Re","key32Re","key64Re","longToHash","longFromHash","fromBits","ProtocolError","fieldMap","longs","enums","encoding","allocUnsafe","seenFirstField","invalid","genVerifyKey","genVerifyValue","oneofProp","substr","Op","noop","State","tail","states","writeByte","VarintOp","writeVarint64","writeFixed32","_push","writeBytes","reset","BufferWriter_","writeBytesBuffer","copy","writeStringBuffer","byteLength","$require","$module","amd","isLong"],"mappings":";;;;;CAAA,SAAAA,IAAA,aAAA,IAAAC,EAAAC,EAAAC,EAcAC,EAdAH,EAiCA,CAAAI,EAAA,CAAA,SAAAC,EAAAC,GChCAA,EAAAC,QAmBA,SAAAC,EAAAC,GACA,IAAAC,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACA,KAAAD,EAAAH,UAAAC,QACAH,EAAAI,KAAAF,UAAAG,KACA,OAAA,IAAAE,QAAA,SAAAC,EAAAC,GACAT,EAAAI,GAAA,SAAAM,GACA,GAAAJ,EAEA,GADAA,GAAA,EACAI,EACAD,EAAAC,OACA,CAGA,IAFA,IAAAV,EAAAC,MAAAC,UAAAC,OAAA,GACAC,EAAA,EACAA,EAAAJ,EAAAG,QACAH,EAAAI,K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AAArF,GAKA,OAJAA,GAAAA,EAAAwY,SACApsB,EAAA4O,KAAAgF,KAAAA,EACA5T,EAAAsW,aAEAtW,IAIA,iBAAAG,QAAAA,QAAAA,OAAAC,UACAD,OAAAC,QAAAJ,GA/BA","file":"protobuf.min.js","sourcesContent":["(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @param {string[]} functionParams Function parameter names\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n */\r\nfunction codegen(functionParams, functionName) {\r\n\r\n /* istanbul ignore if */\r\n if (typeof functionParams === \"string\") {\r\n functionName = functionParams;\r\n functionParams = undefined;\r\n }\r\n\r\n var body = [];\r\n\r\n /**\r\n * Appends code to the function's body or finishes generation.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r\n * @param {...*} [formatParams] Format parameters\r\n * @returns {Codegen|Function} Itself or the generated function if finished\r\n * @throws {Error} If format parameter counts do not match\r\n */\r\n\r\n function Codegen(formatStringOrScope) {\r\n // note that explicit array handling below makes this ~50% faster\r\n\r\n // finish the function\r\n if (typeof formatStringOrScope !== \"string\") {\r\n var source = toString();\r\n if (codegen.verbose)\r\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\r\n source = \"return \" + source;\r\n if (formatStringOrScope) {\r\n var scopeKeys = Object.keys(formatStringOrScope),\r\n scopeParams = new Array(scopeKeys.length + 1),\r\n scopeValues = new Array(scopeKeys.length),\r\n scopeOffset = 0;\r\n while (scopeOffset < scopeKeys.length) {\r\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r\n }\r\n scopeParams[scopeOffset] = source;\r\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r\n }\r\n return Function(source)(); // eslint-disable-line no-new-func\r\n }\r\n\r\n // otherwise append to body\r\n var formatParams = new Array(arguments.length - 1),\r\n formatOffset = 0;\r\n while (formatOffset < formatParams.length)\r\n formatParams[formatOffset] = arguments[++formatOffset];\r\n formatOffset = 0;\r\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r\n var value = formatParams[formatOffset++];\r\n switch ($1) {\r\n case \"d\": case \"f\": return String(Number(value));\r\n case \"i\": return String(Math.floor(value));\r\n case \"j\": return JSON.stringify(value);\r\n case \"s\": return String(value);\r\n }\r\n return \"%\";\r\n });\r\n if (formatOffset !== formatParams.length)\r\n throw Error(\"parameter count mismatch\");\r\n body.push(formatStringOrScope);\r\n return Codegen;\r\n }\r\n\r\n function toString(functionNameOverride) {\r\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\r\n }\r\n\r\n Codegen.toString = toString;\r\n return Codegen;\r\n}\r\n\r\n/**\r\n * Begins generating a function.\r\n * @memberof util\r\n * @function codegen\r\n * @param {string} [functionName] Function name if not anonymous\r\n * @returns {Codegen} Appender that appends code to the function's body\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\r\n * @name util.codegen.verbose\r\n * @type {boolean}\r\n */\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(1),\r\n inquire = require(7);\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options)\r\n options = {};\r\n\r\n if (!callback)\r\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n if (!options.xhr && fs && fs.readFile)\r\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n return err && typeof XMLHttpRequest !== \"undefined\"\r\n ? fetch.xhr(filename, options, callback)\r\n : err\r\n ? callback(err)\r\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n });\r\n\r\n // use the XHR version otherwise.\r\n return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n if (xhr.readyState !== 4)\r\n return undefined;\r\n\r\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n // reliably distinguished from an actually empty file for security reasons. feel free\r\n // to send a pull request if you are aware of a solution.\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n\r\n // if binary data is expected, make sure that some sort of array is returned, even if\r\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n if (options.binary) {\r\n var buffer = xhr.response;\r\n if (!buffer) {\r\n buffer = [];\r\n for (var i = 0; i < xhr.responseText.length; ++i)\r\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n }\r\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n }\r\n return callback(null, xhr.responseText);\r\n };\r\n\r\n if (options.binary) {\r\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n if (\"overrideMimeType\" in xhr)\r\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n xhr.open(\"GET\", filename);\r\n xhr.send();\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal path module to resolve Unix, Windows and URL paths alike.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar path = exports;\r\n\r\nvar isAbsolute =\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\npath.isAbsolute = function isAbsolute(path) {\r\n return /^(?:\\/|\\w+:)/.test(path);\r\n};\r\n\r\nvar normalize =\r\n/**\r\n * Normalizes the specified path.\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\npath.normalize = function normalize(path) {\r\n path = path.replace(/\\\\/g, \"/\")\r\n .replace(/\\/{2,}/g, \"/\");\r\n var parts = path.split(\"/\"),\r\n absolute = isAbsolute(path),\r\n prefix = \"\";\r\n if (absolute)\r\n prefix = parts.shift() + \"/\";\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === \"..\") {\r\n if (i > 0 && parts[i - 1] !== \"..\")\r\n parts.splice(--i, 2);\r\n else if (absolute)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === \".\")\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join(\"/\");\r\n};\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path to the origin file\r\n * @param {string} includePath Include path relative to origin path\r\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the include file\r\n */\r\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n includePath = normalize(includePath);\r\n if (isAbsolute(includePath))\r\n return includePath;\r\n if (!alreadyNormalized)\r\n originPath = normalize(originPath);\r\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\nmodule.exports = common;\n\nvar commonRe = /\\/|\\./;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\n * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n * @returns {undefined}\n * @property {INamespace} google/protobuf/any.proto Any\n * @property {INamespace} google/protobuf/duration.proto Duration\n * @property {INamespace} google/protobuf/empty.proto Empty\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\n * @example\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\n * protobuf.common(\"descriptor\", descriptorJson);\n *\n * // manually provides a custom definition (uses my.foo namespace)\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\n */\nfunction common(name, json) {\n if (!commonRe.test(name)) {\n name = \"google/protobuf/\" + name + \".proto\";\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\n }\n common[name] = json;\n}\n\n// Not provided because of limited use (feel free to discuss or to provide yourself):\n//\n// google/protobuf/descriptor.proto\n// google/protobuf/source_context.proto\n// google/protobuf/type.proto\n//\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\n// the repository or package within the google/protobuf directory.\n\ncommon(\"any\", {\n\n /**\n * Properties of a google.protobuf.Any message.\n * @interface IAny\n * @type {Object}\n * @property {string} [typeUrl]\n * @property {Uint8Array} [bytes]\n * @memberof common\n */\n Any: {\n fields: {\n type_url: {\n type: \"string\",\n id: 1\n },\n value: {\n type: \"bytes\",\n id: 2\n }\n }\n }\n});\n\nvar timeType;\n\ncommon(\"duration\", {\n\n /**\n * Properties of a google.protobuf.Duration message.\n * @interface IDuration\n * @type {Object}\n * @property {number} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Duration: timeType = {\n fields: {\n seconds: {\n type: \"int64\",\n id: 1\n },\n nanos: {\n type: \"int32\",\n id: 2\n }\n }\n }\n});\n\ncommon(\"timestamp\", {\n\n /**\n * Properties of a google.protobuf.Timestamp message.\n * @interface ITimestamp\n * @type {Object}\n * @property {number} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Timestamp: timeType\n});\n\ncommon(\"empty\", {\n\n /**\n * Properties of a google.protobuf.Empty message.\n * @interface IEmpty\n * @memberof common\n */\n Empty: {\n fields: {}\n }\n});\n\ncommon(\"struct\", {\n\n /**\n * Properties of a google.protobuf.Struct message.\n * @interface IStruct\n * @type {Object}\n * @property {Object.} [fields]\n * @memberof common\n */\n Struct: {\n fields: {\n fields: {\n keyType: \"string\",\n type: \"Value\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Value message.\n * @interface IValue\n * @type {Object}\n * @property {string} [kind]\n * @property {0} [nullValue]\n * @property {number} [numberValue]\n * @property {string} [stringValue]\n * @property {boolean} [boolValue]\n * @property {IStruct} [structValue]\n * @property {IListValue} [listValue]\n * @memberof common\n */\n Value: {\n oneofs: {\n kind: {\n oneof: [\n \"nullValue\",\n \"numberValue\",\n \"stringValue\",\n \"boolValue\",\n \"structValue\",\n \"listValue\"\n ]\n }\n },\n fields: {\n nullValue: {\n type: \"NullValue\",\n id: 1\n },\n numberValue: {\n type: \"double\",\n id: 2\n },\n stringValue: {\n type: \"string\",\n id: 3\n },\n boolValue: {\n type: \"bool\",\n id: 4\n },\n structValue: {\n type: \"Struct\",\n id: 5\n },\n listValue: {\n type: \"ListValue\",\n id: 6\n }\n }\n },\n\n NullValue: {\n values: {\n NULL_VALUE: 0\n }\n },\n\n /**\n * Properties of a google.protobuf.ListValue message.\n * @interface IListValue\n * @type {Object}\n * @property {Array.} [values]\n * @memberof common\n */\n ListValue: {\n fields: {\n values: {\n rule: \"repeated\",\n type: \"Value\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"wrappers\", {\n\n /**\n * Properties of a google.protobuf.DoubleValue message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n DoubleValue: {\n fields: {\n value: {\n type: \"double\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.FloatValue message.\n * @interface IFloatValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FloatValue: {\n fields: {\n value: {\n type: \"float\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int64Value message.\n * @interface IInt64Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int64Value: {\n fields: {\n value: {\n type: \"int64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt64Value message.\n * @interface IUInt64Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt64Value: {\n fields: {\n value: {\n type: \"uint64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int32Value message.\n * @interface IInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int32Value: {\n fields: {\n value: {\n type: \"int32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt32Value message.\n * @interface IUInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt32Value: {\n fields: {\n value: {\n type: \"uint32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BoolValue message.\n * @interface IBoolValue\n * @type {Object}\n * @property {boolean} [value]\n * @memberof common\n */\n BoolValue: {\n fields: {\n value: {\n type: \"bool\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.StringValue message.\n * @interface IStringValue\n * @type {Object}\n * @property {string} [value]\n * @memberof common\n */\n StringValue: {\n fields: {\n value: {\n type: \"string\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BytesValue message.\n * @interface IBytesValue\n * @type {Object}\n * @property {Uint8Array} [value]\n * @memberof common\n */\n BytesValue: {\n fields: {\n value: {\n type: \"bytes\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"field_mask\", {\n\n /**\n * Properties of a google.protobuf.FieldMask message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FieldMask: {\n fields: {\n paths: {\n rule: \"repeated\",\n type: \"string\",\n id: 1\n }\n }\n }\n});\n\n/**\n * Gets the root definition of the specified common proto file.\n *\n * Bundled definitions are:\n * - google/protobuf/any.proto\n * - google/protobuf/duration.proto\n * - google/protobuf/empty.proto\n * - google/protobuf/field_mask.proto\n * - google/protobuf/struct.proto\n * - google/protobuf/timestamp.proto\n * - google/protobuf/wrappers.proto\n *\n * @param {string} file Proto file name\n * @returns {INamespace|null} Root definition or `null` if not defined\n */\ncommon.get = function get(file) {\n return common[file] || null;\n};\n","\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(15),\n util = require(37);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop, ref) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (ref === undefined) {\n ref = \"d\" + prop;\n }\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof %s!==\\\"object\\\")\", ref)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(%s)\", prop, fieldIndex, ref);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(%s)\", prop, ref); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=%s>>>0\", prop, ref);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=%s|0\", prop, ref);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(%s)).unsigned=%j\", prop, ref, isUnsigned)\n (\"else if(typeof %s===\\\"string\\\")\", ref)\n (\"m%s=parseInt(%s,10)\", prop, ref)\n (\"else if(typeof %s===\\\"number\\\")\", ref)\n (\"m%s=%s\", prop, ref)\n (\"else if(typeof %s===\\\"object\\\")\", ref)\n (\"m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)\", prop, ref, ref, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof %s===\\\"string\\\")\", ref)\n (\"util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)\", ref, prop, ref)\n (\"else if(%s.length)\", ref)\n (\"m%s=%s\", prop, ref);\n break;\n case \"string\": gen\n (\"m%s=String(%s)\", prop, ref);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(%s)\", prop, ref);\n break;\n /* default: gen\n (\"m%s=%s\", prop, ref);\n break; */\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray;\n var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n (\"if(d instanceof this.ctor)\")\n (\"return d\");\n if (!fields.length) return gen\n (\"return new this.ctor\");\n gen\n (\"var m=new this.ctor\");\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n prop = util.safeProp(field.name);\n\n // Map fields\n if (field.map) { gen\n (\"if(d%s){\", prop)\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s={}\", prop)\n (\"for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n break;\n case \"bytes\": gen\n (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n break;\n default: gen\n (\"d%s=m%s\", prop, prop);\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n if (!fields.length)\n return util.codegen()(\"return {}\");\n var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n (\"if(!o)\")\n (\"o={}\")\n (\"var d={}\");\n\n var repeatedFields = [],\n mapFields = [],\n normalFields = [],\n i = 0;\n for (; i < fields.length; ++i)\n if (!fields[i].partOf)\n ( fields[i].resolve().repeated ? repeatedFields\n : fields[i].map ? mapFields\n : normalFields).push(fields[i]);\n\n if (repeatedFields.length) { gen\n (\"if(o.arrays||o.defaults){\");\n for (i = 0; i < repeatedFields.length; ++i) gen\n (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n gen\n (\"}\");\n }\n\n if (mapFields.length) { gen\n (\"if(o.objects||o.defaults){\");\n for (i = 0; i < mapFields.length; ++i) gen\n (\"d%s={}\", util.safeProp(mapFields[i].name));\n gen\n (\"}\");\n }\n\n if (normalFields.length) { gen\n (\"if(o.defaults){\");\n for (i = 0; i < normalFields.length; ++i) {\n var field = normalFields[i],\n prop = util.safeProp(field.name);\n if (field.resolvedType instanceof Enum) gen\n (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n else if (field.long) gen\n (\"if(util.Long){\")\n (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n (\"}else\")\n (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n else if (field.bytes) {\n var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n gen\n (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n (\"else{\")\n (\"d%s=%s\", prop, arrayDefault)\n (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n (\"}\");\n } else gen\n (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n } gen\n (\"}\");\n }\n var hasKs2 = false;\n for (i = 0; i < fields.length; ++i) {\n var field = fields[i],\n index = mtype._fieldsArray.indexOf(field),\n prop = util.safeProp(field.name);\n if (field.map) {\n if (!hasKs2) { hasKs2 = true; gen\n (\"var ks2\");\n } gen\n (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n (\"d%s={}\", prop)\n (\"for(var j=0;j>>3){\");\n\n var i = 0;\n for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n ref = \"m\" + util.safeProp(field.name); gen\n (\"case %i:\", field.id);\n\n // Map fields\n if (field.map) { gen\n (\"r.skip().pos++\") // assumes id 1 + key wireType\n (\"if(%s===util.emptyObject)\", ref)\n (\"%s={}\", ref)\n (\"k=r.%s()\", field.keyType)\n (\"r.pos++\"); // assumes id 2 + value wireType\n if (types.long[field.keyType] !== undefined) {\n if (types.basic[type] === undefined) gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=r.%s()\", ref, type);\n } else {\n if (types.basic[type] === undefined) gen\n (\"%s[k]=types[%i].decode(r,r.uint32())\", ref, i); // can't be groups\n else gen\n (\"%s[k]=r.%s()\", ref, type);\n }\n\n // Repeated fields\n } else if (field.repeated) { gen\n\n (\"if(!(%s&&%s.length))\", ref, ref)\n (\"%s=[]\", ref);\n\n // Packable (always check for forward and backward compatiblity)\n if (types.packed[type] !== undefined) gen\n (\"if((t&7)===2){\")\n (\"var c2=r.uint32()+r.pos\")\n (\"while(r.pos>> 0, (field.id << 3 | 4) >>> 0);\n return;\n }\n var key = (field.id << 3 | 2) >>> 0;\n if (field.preEncoded()) {\n gen(\"if (%s instanceof Uint8Array) {\", ref)\n (\"w.uint32(%i)\", key)\n (\"w.bytes(%s)\", ref)\n (\"} else {\");\n }\n gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, key);\n if (field.preEncoded()) {\n gen(\"}\")\n }\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n (\"if(!w)\")\n (\"w=Writer.create()\");\n\n var i, ref;\n\n // \"when a message is serialized its known fields should be written sequentially by field number\"\n var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n for (var i = 0; i < fields.length; ++i) {\n var field = fields[i].resolve(),\n index = mtype._fieldsArray.indexOf(field),\n type = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n wireType = types.basic[type];\n ref = \"m\" + util.safeProp(field.name);\n\n // Map fields\n if (field.map) {\n gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n (\"for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n if (wireType === undefined) gen\n (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n else gen\n (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n gen\n (\"}\")\n (\"}\");\n\n // Repeated fields\n } else if (field.repeated) {\n var arrayRef = ref;\n if (field.useToArray()) {\n arrayRef = \"array\" + field.id;\n gen(\"var %s\", arrayRef);\n gen(\"if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }\",\n ref, ref, arrayRef, ref, arrayRef, ref);\n }\n gen(\"if(%s!=null&&%s.length){\", arrayRef, arrayRef); // !== undefined && !== null\n // Packed repeated\n if (field.packed && types.packed[type] !== undefined) { gen\n\n (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n (\"for(var i=0;i<%s.length;++i)\", arrayRef)\n (\"w.%s(%s[i])\", type, arrayRef)\n (\"w.ldelim()\");\n\n // Non-packed\n } else { gen\n\n (\"for(var i=0;i<%s.length;++i)\", arrayRef);\n if (wireType === undefined)\n genTypePartial(gen, field, index, arrayRef + \"[i]\");\n else gen\n (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, arrayRef);\n\n } gen\n (\"}\");\n\n // Non-repeated\n } else {\n if (field.optional) gen\n (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n if (wireType === undefined)\n genTypePartial(gen, field, index, ref);\n else gen\n (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n }\n }\n\n return gen\n (\"return w\");\n /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n","\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(23),\n util = require(37);\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.} [values] Enum values as an object, by name\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.} [comments] The value comments for this enum\n */\nfunction Enum(name, values, options, comment, comments) {\n ReflectionObject.call(this, name, options);\n\n if (values && typeof values !== \"object\")\n throw TypeError(\"values must be an object\");\n\n /**\n * Enum values by id.\n * @type {Object.}\n */\n this.valuesById = {};\n\n /**\n * Enum values by name.\n * @type {Object.}\n */\n this.values = Object.create(this.valuesById); // toJSON, marker\n\n /**\n * Enum comment text.\n * @type {string|null}\n */\n this.comment = comment;\n\n /**\n * Value comment texts, if any.\n * @type {Object.}\n */\n this.comments = comments || {};\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n // compatible enum. This is used by pbts to write actual enum definitions that work for\n // static and reflection code alike instead of emitting generic object definitions.\n\n if (values)\n for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n if (typeof values[keys[i]] === \"number\") // use forward entries only\n this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.} values Enum values\n * @property {Object.} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n enm.reserved = json.reserved;\n return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"values\" , this.values,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"comment\" , keepComments ? this.comment : undefined,\n \"comments\" , keepComments ? this.comments : undefined\n ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment) {\n // utilized by the parser but not by .fromJSON\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (!util.isInteger(id))\n throw TypeError(\"id must be an integer\");\n\n if (this.values[name] !== undefined)\n throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n if (this.isReservedId(id))\n throw Error(\"id \" + id + \" is reserved in \" + this);\n\n if (this.isReservedName(name))\n throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n if (this.valuesById[id] !== undefined) {\n if (!(this.options && this.options.allow_alias))\n throw Error(\"duplicate id \" + id + \" in \" + this);\n this.values[name] = id;\n } else\n this.valuesById[this.values[name] = id] = name;\n\n this.comments[name] = comment || null;\n return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n var val = this.values[name];\n if (val == null)\n throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n delete this.valuesById[val];\n delete this.values[name];\n delete this.comments[name];\n\n return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n","\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum = require(15),\n types = require(36),\n util = require(37);\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.} [rule=\"optional\"] Field rule\n * @param {string|Object.} [extend] Extended type if different from parent\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n if (util.isObject(rule)) {\n comment = extend;\n options = rule;\n rule = extend = undefined;\n } else if (util.isObject(extend)) {\n comment = options;\n options = extend;\n extend = undefined;\n }\n\n ReflectionObject.call(this, name, options);\n\n if (!util.isInteger(id) || id < 0)\n throw TypeError(\"id must be a non-negative integer\");\n\n if (!util.isString(type))\n throw TypeError(\"type must be a string\");\n\n if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n throw TypeError(\"rule must be a string rule\");\n\n if (extend !== undefined && !util.isString(extend))\n throw TypeError(\"extend must be a string\");\n\n /**\n * Field rule, if any.\n * @type {string|undefined}\n */\n this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n /**\n * Field type.\n * @type {string}\n */\n this.type = type; // toJSON\n\n /**\n * Unique field id.\n * @type {number}\n */\n this.id = id; // toJSON, marker\n\n /**\n * Extended type if different from parent.\n * @type {string|undefined}\n */\n this.extend = extend || undefined; // toJSON\n\n /**\n * Whether this field is required.\n * @type {boolean}\n */\n this.required = rule === \"required\";\n\n /**\n * Whether this field is optional.\n * @type {boolean}\n */\n this.optional = !this.required;\n\n /**\n * Whether this field is repeated.\n * @type {boolean}\n */\n this.repeated = rule === \"repeated\";\n\n /**\n * Whether this field is a map or not.\n * @type {boolean}\n */\n this.map = false;\n\n /**\n * Message this field belongs to.\n * @type {Type|null}\n */\n this.message = null;\n\n /**\n * OneOf this field belongs to, if any,\n * @type {OneOf|null}\n */\n this.partOf = null;\n\n /**\n * The field type's default value.\n * @type {*}\n */\n this.typeDefault = null;\n\n /**\n * The field's default value on prototypes.\n * @type {*}\n */\n this.defaultValue = null;\n\n /**\n * Whether this field's value should be treated as a long.\n * @type {boolean}\n */\n this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n /**\n * Whether this field's value is a buffer.\n * @type {boolean}\n */\n this.bytes = type === \"bytes\";\n\n /**\n * Resolved type if not a basic type.\n * @type {Type|Enum|null}\n */\n this.resolvedType = null;\n\n /**\n * Sister-field within the extended type if a declaring extension field.\n * @type {Field|null}\n */\n this.extensionField = null;\n\n /**\n * Sister-field within the declaring namespace if an extended field.\n * @type {Field|null}\n */\n this.declaringField = null;\n\n /**\n * Internally remembers whether this field is packed.\n * @type {boolean|null}\n * @private\n */\n this._packed = null;\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n get: function() {\n // defaults to packed=true if not explicity set to false\n if (this._packed === null)\n this._packed = this.getOption(\"packed\") !== false;\n return this._packed;\n }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (name === \"packed\") // clear cached before setting\n this._packed = null;\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"rule\" , this.rule !== \"optional\" && this.rule || undefined,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n if (this.resolved)\n return this;\n\n if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n if (this.resolvedType instanceof Type)\n this.typeDefault = null;\n else // instanceof Enum\n this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n }\n\n // use explicitly set default value if present\n if (this.options && this.options[\"default\"] != null) {\n this.typeDefault = this.options[\"default\"];\n if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n this.typeDefault = this.resolvedType.values[this.typeDefault];\n }\n\n // remove unnecessary options\n if (this.options) {\n if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n delete this.options.packed;\n if (!Object.keys(this.options).length)\n this.options = undefined;\n }\n\n // convert to internal data type if necesssary\n if (this.long) {\n this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n /* istanbul ignore else */\n if (Object.freeze)\n Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n } else if (this.bytes && typeof this.typeDefault === \"string\") {\n var buf;\n if (util.base64.test(this.typeDefault))\n util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n else\n util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n this.typeDefault = buf;\n }\n\n // take special care of maps and repeated fields\n if (this.map)\n this.defaultValue = util.emptyObject;\n else if (this.repeated)\n this.defaultValue = util.emptyArray;\n else\n this.defaultValue = this.typeDefault;\n\n // ensure proper value on prototype\n if (this.parent instanceof Type)\n this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n\nField.prototype.useToArray = function useToArray() {\n return !!this.getOption(\"(js_use_toArray)\");\n};\n\nField.prototype.preEncoded = function preEncoded() {\n return !!this.getOption(\"(js_preEncoded)\");\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n // submessage: decorate the submessage and use its name as the type\n if (typeof fieldType === \"function\")\n fieldType = util.decorateType(fieldType).name;\n\n // enum reference: create a reflected copy of the enum and keep reuseing it\n else if (fieldType && typeof fieldType === \"object\")\n fieldType = util.decorateEnum(fieldType).name;\n\n return function fieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n Type = Type_;\n};\n","\"use strict\";\nvar protobuf = module.exports = require(18);\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n if (typeof root === \"function\") {\n callback = root;\n root = new protobuf.Root();\n } else if (!root)\n root = new protobuf.Root();\n return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n if (!root)\n root = new protobuf.Root();\n return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder = require(14);\nprotobuf.decoder = require(13);\nprotobuf.verifier = require(40);\nprotobuf.converter = require(12);\n\n// Reflection\nprotobuf.ReflectionObject = require(24);\nprotobuf.Namespace = require(23);\nprotobuf.Root = require(29);\nprotobuf.Enum = require(15);\nprotobuf.Type = require(35);\nprotobuf.Field = require(16);\nprotobuf.OneOf = require(25);\nprotobuf.MapField = require(20);\nprotobuf.Service = require(33);\nprotobuf.Method = require(22);\n\n// Runtime\nprotobuf.Message = require(21);\nprotobuf.wrappers = require(41);\n\n// Utility\nprotobuf.types = require(36);\nprotobuf.util = require(37);\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(42);\nprotobuf.BufferWriter = require(43);\nprotobuf.Reader = require(27);\nprotobuf.BufferReader = require(28);\n\n// Utility\nprotobuf.util = require(39);\nprotobuf.rpc = require(31);\nprotobuf.roots = require(30);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.Reader._configure(protobuf.BufferReader);\n protobuf.util._configure();\n}\n\n// Set up buffer utility according to the environment\nprotobuf.Writer._configure(protobuf.BufferWriter);\nconfigure();\n","\"use strict\";\nvar protobuf = module.exports = require(17);\n\nprotobuf.build = \"full\";\n\n// Parser\nprotobuf.tokenize = require(34);\nprotobuf.parse = require(26);\nprotobuf.common = require(11);\n\n// Configure parser\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\n","\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(16);\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types = require(36),\n util = require(37);\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n /* istanbul ignore if */\n if (!util.isString(keyType))\n throw TypeError(\"keyType must be a string\");\n\n /**\n * Key type.\n * @type {string}\n */\n this.keyType = keyType; // toJSON, marker\n\n /**\n * Resolved key type if not a basic type.\n * @type {ReflectionObject|null}\n */\n this.resolvedKeyType = null;\n\n // Overrides Field#map\n this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"keyType\" , this.keyType,\n \"type\" , this.type,\n \"id\" , this.id,\n \"extend\" , this.extend,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n\n // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n if (types.mapKey[this.keyType] === undefined)\n throw Error(\"invalid key type: \" + this.keyType);\n\n return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n // submessage value: decorate the submessage and use its name as the type\n if (typeof fieldValueType === \"function\")\n fieldValueType = util.decorateType(fieldValueType).name;\n\n // enum reference value: create a reflected copy of the enum and keep reuseing it\n else if (fieldValueType && typeof fieldValueType === \"object\")\n fieldValueType = util.decorateEnum(fieldValueType).name;\n\n return function mapFieldDecorator(prototype, fieldName) {\n util.decorateType(prototype.constructor)\n .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n };\n};\n","\"use strict\";\nmodule.exports = Message;\n\nvar util = require(39);\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n // not used internally\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n this[keys[i]] = properties[keys[i]];\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.create = function create(properties) {\n return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encode = function encode(message, writer) {\n return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message\n * @this Constructor\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decode = function decode(reader) {\n return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message\n * @this Constructor\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object\n * @returns {T} Message instance\n * @template T extends Message\n * @this Constructor\n */\nMessage.fromObject = function fromObject(object) {\n return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @template T extends Message\n * @this Constructor\n */\nMessage.toObject = function toObject(message, options) {\n return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/","\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(37);\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.} [requestStream] Whether the request is streamed\n * @param {boolean|Object.} [responseStream] Whether the response is streamed\n * @param {Object.} [options] Declared options\n * @param {string} [comment] The comment for this method\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {\n\n /* istanbul ignore next */\n if (util.isObject(requestStream)) {\n options = requestStream;\n requestStream = responseStream = undefined;\n } else if (util.isObject(responseStream)) {\n options = responseStream;\n responseStream = undefined;\n }\n\n /* istanbul ignore if */\n if (!(type === undefined || util.isString(type)))\n throw TypeError(\"type must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(requestType))\n throw TypeError(\"requestType must be a string\");\n\n /* istanbul ignore if */\n if (!util.isString(responseType))\n throw TypeError(\"responseType must be a string\");\n\n ReflectionObject.call(this, name, options);\n\n /**\n * Method type.\n * @type {string}\n */\n this.type = type || \"rpc\"; // toJSON\n\n /**\n * Request type.\n * @type {string}\n */\n this.requestType = requestType; // toJSON, marker\n\n /**\n * Whether requests are streamed or not.\n * @type {boolean|undefined}\n */\n this.requestStream = requestStream ? true : undefined; // toJSON\n\n /**\n * Response type.\n * @type {string}\n */\n this.responseType = responseType; // toJSON\n\n /**\n * Whether responses are streamed or not.\n * @type {boolean|undefined}\n */\n this.responseStream = responseStream ? true : undefined; // toJSON\n\n /**\n * Resolved request type.\n * @type {Type|null}\n */\n this.resolvedRequestType = null;\n\n /**\n * Resolved response type.\n * @type {Type|null}\n */\n this.resolvedResponseType = null;\n\n /**\n * Comment for this method\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.} [options] Method options\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"type\" , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n \"requestType\" , this.requestType,\n \"requestStream\" , this.requestStream,\n \"responseType\" , this.responseType,\n \"responseStream\" , this.responseStream,\n \"options\" , this.options,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n /* istanbul ignore if */\n if (this.resolved)\n return this;\n\n this.resolvedRequestType = this.parent.lookupType(this.requestType);\n this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n return ReflectionObject.prototype.resolve.call(this);\n};\n","\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field = require(16),\n util = require(37);\n\nvar Type, // cyclic\n Service,\n Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n if (!(array && array.length))\n return undefined;\n var obj = {};\n for (var i = 0; i < array.length; ++i)\n obj[array[i].name] = array[i].toJSON(toJSONOptions);\n return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n return true;\n return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n if (reserved)\n for (var i = 0; i < reserved.length; ++i)\n if (reserved[i] === name)\n return true;\n return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n ReflectionObject.call(this, name, options);\n\n /**\n * Nested objects by name.\n * @type {Object.|undefined}\n */\n this.nested = undefined; // toJSON\n\n /**\n * Cached nested objects as an array.\n * @type {ReflectionObject[]|null}\n * @private\n */\n this._nestedArray = null;\n}\n\nfunction clearCache(namespace) {\n namespace._nestedArray = null;\n return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n get: function() {\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.} [options] Namespace options\n * @property {Object.} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace}\n */\n// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n return util.toObject([\n \"options\" , this.options,\n \"nested\" , arrayToJSON(this.nestedArray, toJSONOptions)\n ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n var ns = this;\n /* istanbul ignore else */\n if (nestedJson) {\n for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n nested = nestedJson[names[i]];\n ns.add( // most to least likely\n ( nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : nested.id !== undefined\n ? Field.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n }\n return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n return this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n if (this.nested && this.nested[name] instanceof Enum)\n return this.nested[name].values;\n throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n throw TypeError(\"object must be a valid nested object\");\n\n if (!this.nested)\n this.nested = {};\n else {\n var prev = this.get(object.name);\n if (prev) {\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n // replace plain namespace but keep existing nested elements and options\n var nested = prev.nestedArray;\n for (var i = 0; i < nested.length; ++i)\n object.add(nested[i]);\n this.remove(prev);\n if (!this.nested)\n this.nested = {};\n object.setOptions(prev.options, true);\n\n } else\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n }\n }\n this.nested[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n if (!(object instanceof ReflectionObject))\n throw TypeError(\"object must be a ReflectionObject\");\n if (object.parent !== this)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.nested[object.name];\n if (!Object.keys(this.nested).length)\n this.nested = undefined;\n\n object.onRemove(this);\n return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n if (util.isString(path))\n path = path.split(\".\");\n else if (!Array.isArray(path))\n throw TypeError(\"illegal path\");\n if (path && path.length && path[0] === \"\")\n throw Error(\"path must be relative\");\n\n var ptr = this;\n while (path.length > 0) {\n var part = path.shift();\n if (ptr.nested && ptr.nested[part]) {\n ptr = ptr.nested[part];\n if (!(ptr instanceof Namespace))\n throw Error(\"path conflicts with non-namespace objects\");\n } else\n ptr.add(ptr = new Namespace(part));\n }\n if (json)\n ptr.addJSON(json);\n return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n var nested = this.nestedArray, i = 0;\n while (i < nested.length)\n if (nested[i] instanceof Namespace)\n nested[i++].resolveAll();\n else\n nested[i++].resolve();\n return this.resolve();\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n\n /* istanbul ignore next */\n if (typeof filterTypes === \"boolean\") {\n parentAlreadyChecked = filterTypes;\n filterTypes = undefined;\n } else if (filterTypes && !Array.isArray(filterTypes))\n filterTypes = [ filterTypes ];\n\n if (util.isString(path) && path.length) {\n if (path === \".\")\n return this.root;\n path = path.split(\".\");\n } else if (!path.length)\n return this;\n\n // Start at root if path is absolute\n if (path[0] === \"\")\n return this.root.lookup(path.slice(1), filterTypes);\n\n // Test if the first part matches any nested object, and if so, traverse if path contains more\n var found = this.get(path[0]);\n if (found) {\n if (path.length === 1) {\n if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)\n return found;\n } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))\n return found;\n\n // Otherwise try each nested namespace\n } else\n for (var i = 0; i < this.nestedArray.length; ++i)\n if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))\n return found;\n\n // If there hasn't been a match, try again at the parent\n if (this.parent === null || parentAlreadyChecked)\n return null;\n return this.parent.lookup(path, filterTypes);\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n var found = this.lookup(path, [ Type ]);\n if (!found)\n throw Error(\"no such type: \" + path);\n return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n var found = this.lookup(path, [ Enum ]);\n if (!found)\n throw Error(\"no such Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n var found = this.lookup(path, [ Type, Enum ]);\n if (!found)\n throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n var found = this.lookup(path, [ Service ]);\n if (!found)\n throw Error(\"no such Service '\" + path + \"' in \" + this);\n return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n Type = Type_;\n Service = Service_;\n Enum = Enum_;\n};\n","\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nvar util = require(37);\n\nvar Root; // cyclic\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n if (!util.isString(name))\n throw TypeError(\"name must be a string\");\n\n if (options && !util.isObject(options))\n throw TypeError(\"options must be an object\");\n\n /**\n * Options.\n * @type {Object.|undefined}\n */\n this.options = options; // toJSON\n\n /**\n * Unique name within its namespace.\n * @type {string}\n */\n this.name = name;\n\n /**\n * Parent namespace.\n * @type {Namespace|null}\n */\n this.parent = null;\n\n /**\n * Whether already resolved or not.\n * @type {boolean}\n */\n this.resolved = false;\n\n /**\n * Comment text, if any.\n * @type {string|null}\n */\n this.comment = null;\n\n /**\n * Defining file name.\n * @type {string|null}\n */\n this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n /**\n * Reference to the root namespace.\n * @name ReflectionObject#root\n * @type {Root}\n * @readonly\n */\n root: {\n get: function() {\n var ptr = this;\n while (ptr.parent !== null)\n ptr = ptr.parent;\n return ptr;\n }\n },\n\n /**\n * Full name including leading dot.\n * @name ReflectionObject#fullName\n * @type {string}\n * @readonly\n */\n fullName: {\n get: function() {\n var path = [ this.name ],\n ptr = this.parent;\n while (ptr) {\n path.unshift(ptr.name);\n ptr = ptr.parent;\n }\n return path.join(\".\");\n }\n }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n if (this.parent && this.parent !== parent)\n this.parent.remove(this);\n this.parent = parent;\n this.resolved = false;\n var root = parent.root;\n if (root instanceof Root)\n root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n var root = parent.root;\n if (root instanceof Root)\n root._handleRemove(this);\n this.parent = null;\n this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n if (this.resolved)\n return this;\n if (this.root instanceof Root)\n this.resolved = true; // only if part of a root\n return this;\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n if (this.options)\n return this.options[name];\n return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n if (!ifNotSet || !this.options || this.options[name] === undefined)\n (this.options || (this.options = {}))[name] = value;\n return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n if (options)\n for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n this.setOption(keys[i], options[keys[i]], ifNotSet);\n return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n var className = this.constructor.className,\n fullName = this.fullName;\n if (fullName.length)\n return className + \" \" + fullName;\n return className;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n Root = Root_;\n};\n","\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(24);\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(16),\n util = require(37);\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.} [fieldNames] Field names\n * @param {Object.} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n if (!Array.isArray(fieldNames)) {\n options = fieldNames;\n fieldNames = undefined;\n }\n ReflectionObject.call(this, name, options);\n\n /* istanbul ignore if */\n if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n throw TypeError(\"fieldNames must be an Array\");\n\n /**\n * Field names that belong to this oneof.\n * @type {string[]}\n */\n this.oneof = fieldNames || []; // toJSON, marker\n\n /**\n * Fields that belong to this oneof as an array for iteration.\n * @type {Field[]}\n * @readonly\n */\n this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n /**\n * Comment for this field.\n * @type {string|null}\n */\n this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.} oneof Oneof field names\n * @property {Object.} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , this.options,\n \"oneof\" , this.oneof,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n if (oneof.parent)\n for (var i = 0; i < oneof.fieldsArray.length; ++i)\n if (!oneof.fieldsArray[i].parent)\n oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n if (field.parent && field.parent !== this.parent)\n field.parent.remove(field);\n this.oneof.push(field.name);\n this.fieldsArray.push(field);\n field.partOf = this; // field.parent remains null\n addFieldsToParent(this);\n return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n /* istanbul ignore if */\n if (!(field instanceof Field))\n throw TypeError(\"field must be a Field\");\n\n var index = this.fieldsArray.indexOf(field);\n\n /* istanbul ignore if */\n if (index < 0)\n throw Error(field + \" is not a member of \" + this);\n\n this.fieldsArray.splice(index, 1);\n index = this.oneof.indexOf(field.name);\n\n /* istanbul ignore else */\n if (index > -1) // theoretical\n this.oneof.splice(index, 1);\n\n field.partOf = null;\n return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n ReflectionObject.prototype.onAdd.call(this, parent);\n var self = this;\n // Collect present fields\n for (var i = 0; i < this.oneof.length; ++i) {\n var field = parent.get(this.oneof[i]);\n if (field && !field.partOf) {\n field.partOf = self;\n self.fieldsArray.push(field);\n }\n }\n // Add not yet present fields\n addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n for (var i = 0, field; i < this.fieldsArray.length; ++i)\n if ((field = this.fieldsArray[i]).parent)\n field.parent.remove(field);\n ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n var fieldNames = new Array(arguments.length),\n index = 0;\n while (index < arguments.length)\n fieldNames[index] = arguments[index++];\n return function oneOfDecorator(prototype, oneofName) {\n util.decorateType(prototype.constructor)\n .add(new OneOf(oneofName, fieldNames));\n Object.defineProperty(prototype, oneofName, {\n get: util.oneOfGetter(fieldNames),\n set: util.oneOfSetter(fieldNames)\n });\n };\n};\n","\"use strict\";\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize = require(34),\n Root = require(29),\n Type = require(35),\n Field = require(16),\n MapField = require(20),\n OneOf = require(25),\n Enum = require(15),\n Service = require(33),\n Method = require(22),\n types = require(36),\n util = require(37);\n\nvar base10Re = /^[1-9][0-9]*$/,\n base10NegRe = /^-?[1-9][0-9]*$/,\n base16Re = /^0[x][0-9a-fA-F]+$/,\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n base8Re = /^0[0-7]+$/,\n base8NegRe = /^-?0[0-7]+$/,\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n /* eslint-disable callback-return */\n if (!(root instanceof Root)) {\n options = root;\n root = new Root();\n }\n if (!options)\n options = parse.defaults;\n\n var tn = tokenize(source, options.alternateCommentMode || false),\n next = tn.next,\n push = tn.push,\n peek = tn.peek,\n skip = tn.skip,\n cmnt = tn.cmnt;\n\n var head = true,\n pkg,\n imports,\n weakImports,\n syntax,\n isProto3 = false;\n\n var ptr = root;\n\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n /* istanbul ignore next */\n function illegal(token, name, insideTryCatch) {\n var filename = parse.filename;\n if (!insideTryCatch)\n parse.filename = null;\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n }\n\n function readString() {\n var values = [],\n token;\n do {\n /* istanbul ignore if */\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\n throw illegal(token);\n\n values.push(next());\n skip(token);\n token = peek();\n } while (token === \"\\\"\" || token === \"'\");\n return values.join(\"\");\n }\n\n function readValue(acceptTypeRef) {\n var token = next();\n switch (token) {\n case \"'\":\n case \"\\\"\":\n push(token);\n return readString();\n case \"true\": case \"TRUE\":\n return true;\n case \"false\": case \"FALSE\":\n return false;\n }\n try {\n return parseNumber(token, /* insideTryCatch */ true);\n } catch (e) {\n\n /* istanbul ignore else */\n if (acceptTypeRef && typeRefRe.test(token))\n return token;\n\n /* istanbul ignore next */\n throw illegal(token, \"value\");\n }\n }\n\n function readRanges(target, acceptStrings) {\n var token, start;\n do {\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\n target.push(readString());\n else\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n } while (skip(\",\", true));\n skip(\";\");\n }\n\n function parseNumber(token, insideTryCatch) {\n var sign = 1;\n if (token.charAt(0) === \"-\") {\n sign = -1;\n token = token.substring(1);\n }\n switch (token) {\n case \"inf\": case \"INF\": case \"Inf\":\n return sign * Infinity;\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n return NaN;\n case \"0\":\n return 0;\n }\n if (base10Re.test(token))\n return sign * parseInt(token, 10);\n if (base16Re.test(token))\n return sign * parseInt(token, 16);\n if (base8Re.test(token))\n return sign * parseInt(token, 8);\n\n /* istanbul ignore else */\n if (numberRe.test(token))\n return sign * parseFloat(token);\n\n /* istanbul ignore next */\n throw illegal(token, \"number\", insideTryCatch);\n }\n\n function parseId(token, acceptNegative) {\n switch (token) {\n case \"max\": case \"MAX\": case \"Max\":\n return 536870911;\n case \"0\":\n return 0;\n }\n\n /* istanbul ignore if */\n if (!acceptNegative && token.charAt(0) === \"-\")\n throw illegal(token, \"id\");\n\n if (base10NegRe.test(token))\n return parseInt(token, 10);\n if (base16NegRe.test(token))\n return parseInt(token, 16);\n\n /* istanbul ignore else */\n if (base8NegRe.test(token))\n return parseInt(token, 8);\n\n /* istanbul ignore next */\n throw illegal(token, \"id\");\n }\n\n function parsePackage() {\n\n /* istanbul ignore if */\n if (pkg !== undefined)\n throw illegal(\"package\");\n\n pkg = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(pkg))\n throw illegal(pkg, \"name\");\n\n ptr = ptr.define(pkg);\n skip(\";\");\n }\n\n function parseImport() {\n var token = peek();\n var whichImports;\n switch (token) {\n case \"weak\":\n whichImports = weakImports || (weakImports = []);\n next();\n break;\n case \"public\":\n next();\n // eslint-disable-line no-fallthrough\n default:\n whichImports = imports || (imports = []);\n break;\n }\n token = readString();\n skip(\";\");\n whichImports.push(token);\n }\n\n function parseSyntax() {\n skip(\"=\");\n syntax = readString();\n isProto3 = syntax === \"proto3\";\n\n /* istanbul ignore if */\n if (!isProto3 && syntax !== \"proto2\")\n throw illegal(syntax, \"syntax\");\n\n skip(\";\");\n }\n\n function parseCommon(parent, token) {\n switch (token) {\n\n case \"option\":\n parseOption(parent, token);\n skip(\";\");\n return true;\n\n case \"message\":\n parseType(parent, token);\n return true;\n\n case \"enum\":\n parseEnum(parent, token);\n return true;\n\n case \"service\":\n parseService(parent, token);\n return true;\n\n case \"extend\":\n parseExtension(parent, token);\n return true;\n }\n return false;\n }\n\n function ifBlock(obj, fnIf, fnElse) {\n var trailingLine = tn.line;\n if (obj) {\n if(typeof obj.comment !== \"string\") {\n obj.comment = cmnt(); // try block-type comment\n }\n obj.filename = parse.filename;\n }\n if (skip(\"{\", true)) {\n var token;\n while ((token = next()) !== \"}\")\n fnIf(token);\n skip(\";\", true);\n } else {\n if (fnElse)\n fnElse();\n skip(\";\");\n if (obj && typeof obj.comment !== \"string\")\n obj.comment = cmnt(trailingLine); // try line-type comment if no block\n }\n }\n\n function parseType(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"type name\");\n\n var type = new Type(token);\n ifBlock(type, function parseType_block(token) {\n if (parseCommon(type, token))\n return;\n\n switch (token) {\n\n case \"map\":\n parseMapField(type, token);\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"oneof\":\n parseOneOf(type, token);\n break;\n\n case \"extensions\":\n readRanges(type.extensions || (type.extensions = []));\n break;\n\n case \"reserved\":\n readRanges(type.reserved || (type.reserved = []), true);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n\n push(token);\n parseField(type, \"optional\");\n break;\n }\n });\n parent.add(type);\n }\n\n function parseField(parent, rule, extend) {\n var type = next();\n if (type === \"group\") {\n parseGroup(parent, rule);\n return;\n }\n\n /* istanbul ignore if */\n if (!typeRefRe.test(type))\n throw illegal(type, \"type\");\n\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n name = applyCase(name);\n skip(\"=\");\n\n var field = new Field(name, parseId(next()), type, rule, extend);\n ifBlock(field, function parseField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\n // parsing proto2 descriptors without the option, where applicable. This must be done for\n // all known packable types and anything that could be an enum (= is not a basic type).\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\n field.setOption(\"packed\", false, /* ifNotSet */ true);\n }\n\n function parseGroup(parent, rule) {\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n var fieldName = util.lcFirst(name);\n if (name === fieldName)\n name = util.ucFirst(name);\n skip(\"=\");\n var id = parseId(next());\n var type = new Type(name);\n type.group = true;\n var field = new Field(fieldName, id, name, rule);\n field.filename = parse.filename;\n ifBlock(type, function parseGroup_block(token) {\n switch (token) {\n\n case \"option\":\n parseOption(type, token);\n skip(\";\");\n break;\n\n case \"required\":\n case \"optional\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n /* istanbul ignore next */\n default:\n throw illegal(token); // there are no groups with proto3 semantics\n }\n });\n parent.add(type)\n .add(field);\n }\n\n function parseMapField(parent) {\n skip(\"<\");\n var keyType = next();\n\n /* istanbul ignore if */\n if (types.mapKey[keyType] === undefined)\n throw illegal(keyType, \"type\");\n\n skip(\",\");\n var valueType = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(valueType))\n throw illegal(valueType, \"type\");\n\n skip(\">\");\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n skip(\"=\");\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n ifBlock(field, function parseMapField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseMapField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n }\n\n function parseOneOf(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var oneof = new OneOf(applyCase(token));\n ifBlock(oneof, function parseOneOf_block(token) {\n if (token === \"option\") {\n parseOption(oneof, token);\n skip(\";\");\n } else {\n push(token);\n parseField(oneof, \"optional\");\n }\n });\n parent.add(oneof);\n }\n\n function parseEnum(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var enm = new Enum(token);\n ifBlock(enm, function parseEnum_block(token) {\n switch(token) {\n case \"option\":\n parseOption(enm, token);\n skip(\";\");\n break;\n\n case \"reserved\":\n readRanges(enm.reserved || (enm.reserved = []), true);\n break;\n\n default:\n parseEnumValue(enm, token);\n }\n });\n parent.add(enm);\n }\n\n function parseEnumValue(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token))\n throw illegal(token, \"name\");\n\n skip(\"=\");\n var value = parseId(next(), true),\n dummy = {};\n ifBlock(dummy, function parseEnumValue_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseEnumValue_line() {\n parseInlineOptions(dummy); // skip\n });\n parent.add(token, value, dummy.comment);\n }\n\n function parseOption(parent, token) {\n var isCustom = skip(\"(\", true);\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token;\n if (isCustom) {\n skip(\")\");\n name = \"(\" + name + \")\";\n token = peek();\n if (fqTypeRefRe.test(token)) {\n name += token;\n next();\n }\n }\n skip(\"=\");\n parseOptionValue(parent, name);\n }\n\n function parseOptionValue(parent, name) {\n if (skip(\"{\", true)) { // { a: \"foo\" b { c: \"bar\" } }\n do {\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n if (peek() === \"{\")\n parseOptionValue(parent, name + \".\" + token);\n else {\n skip(\":\");\n if (peek() === \"{\")\n parseOptionValue(parent, name + \".\" + token);\n else\n setOption(parent, name + \".\" + token, readValue(true));\n }\n skip(\",\", true);\n } while (!skip(\"}\", true));\n } else\n setOption(parent, name, readValue(true));\n // Does not enforce a delimiter to be universal\n }\n\n function setOption(parent, name, value) {\n if (parent.setOption)\n parent.setOption(name, value);\n }\n\n function parseInlineOptions(parent) {\n if (skip(\"[\", true)) {\n do {\n parseOption(parent, \"option\");\n } while (skip(\",\", true));\n skip(\"]\");\n }\n return parent;\n }\n\n function parseService(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"service name\");\n\n var service = new Service(token);\n ifBlock(service, function parseService_block(token) {\n if (parseCommon(service, token))\n return;\n\n /* istanbul ignore else */\n if (token === \"rpc\")\n parseMethod(service, token);\n else\n throw illegal(token);\n });\n parent.add(service);\n }\n\n function parseMethod(parent, token) {\n // Get the comment of the preceding line now (if one exists) in case the\n // method is defined across multiple lines.\n var commentText = cmnt();\n\n var type = token;\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token,\n requestType, requestStream,\n responseType, responseStream;\n\n skip(\"(\");\n if (skip(\"stream\", true))\n requestStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n requestType = token;\n skip(\")\"); skip(\"returns\"); skip(\"(\");\n if (skip(\"stream\", true))\n responseStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n responseType = token;\n skip(\")\");\n\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n method.comment = commentText;\n ifBlock(method, function parseMethod_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(method, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n });\n parent.add(method);\n }\n\n function parseExtension(parent, token) {\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"reference\");\n\n var reference = token;\n ifBlock(null, function parseExtension_block(token) {\n switch (token) {\n\n case \"required\":\n case \"repeated\":\n case \"optional\":\n parseField(parent, token, reference);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n push(token);\n parseField(parent, \"optional\", reference);\n break;\n }\n });\n }\n\n var token;\n while ((token = next()) !== null) {\n switch (token) {\n\n case \"package\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parsePackage();\n break;\n\n case \"import\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseImport();\n break;\n\n case \"syntax\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseSyntax();\n break;\n\n case \"option\":\n\n parseOption(ptr, token);\n skip(\";\");\n break;\n\n default:\n\n /* istanbul ignore else */\n if (parseCommon(ptr, token)) {\n head = false;\n continue;\n }\n\n /* istanbul ignore next */\n throw illegal(token);\n }\n }\n\n parse.filename = null;\n return {\n \"package\" : pkg,\n \"imports\" : imports,\n weakImports : weakImports,\n syntax : syntax,\n root : root\n };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(39);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/*\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/*\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(27);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(39);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\n/* istanbul ignore else */\nif (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n","\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(23);\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = require(16),\n Enum = require(15),\n OneOf = require(25),\n util = require(37);\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\t\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname; \n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = (getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = (getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n util.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(32);\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(39);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(23);\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(22),\n util = require(37),\n rpc = require(31);\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n Namespace.call(this, name, options);\n\n /**\n * Service methods.\n * @type {Object.}\n */\n this.methods = {}; // toJSON, marker\n\n /**\n * Cached methods as an array.\n * @type {Method[]|null}\n * @private\n */\n this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n var service = new Service(name, json.options);\n /* istanbul ignore else */\n if (json.methods)\n for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n if (json.nested)\n service.addJSON(json.nested);\n service.comment = json.comment;\n return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n get: function() {\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n }\n});\n\nfunction clearCache(service) {\n service._methodsArray = null;\n return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n return this.methods[name]\n || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n var methods = this.methodsArray;\n for (var i = 0; i < methods.length; ++i)\n methods[i].resolve();\n return Namespace.prototype.resolve.call(this);\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n /* istanbul ignore if */\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Method) {\n this.methods[object.name] = object;\n object.parent = this;\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n if (object instanceof Method) {\n\n /* istanbul ignore if */\n if (this.methods[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.methods[object.name];\n object.parent = null;\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n m: method,\n q: method.resolvedRequestType.ctor,\n s: method.resolvedResponseType.ctor\n });\n }\n return rpcService;\n};\n","\"use strict\";\nmodule.exports = tokenize;\n\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\n\nvar setCommentRe = /^ *[*/]+ */,\n setCommentAltRe = /^\\s*\\*?\\/*/,\n setCommentSplitRe = /\\n/g,\n whitespaceRe = /\\s/,\n unescapeRe = /\\\\(.?)/g;\n\nvar unescapeMap = {\n \"0\": \"\\0\",\n \"r\": \"\\r\",\n \"n\": \"\\n\",\n \"t\": \"\\t\"\n};\n\n/**\n * Unescapes a string.\n * @param {string} str String to unescape\n * @returns {string} Unescaped string\n * @property {Object.} map Special characters map\n * @memberof tokenize\n */\nfunction unescape(str) {\n return str.replace(unescapeRe, function($0, $1) {\n switch ($1) {\n case \"\\\\\":\n case \"\":\n return $1;\n default:\n return unescapeMap[$1] || \"\";\n }\n });\n}\n\ntokenize.unescape = unescape;\n\n/**\n * Gets the next token and advances.\n * @typedef TokenizerHandleNext\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Peeks for the next token.\n * @typedef TokenizerHandlePeek\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Pushes a token back to the stack.\n * @typedef TokenizerHandlePush\n * @type {function}\n * @param {string} token Token\n * @returns {undefined}\n */\n\n/**\n * Skips the next token.\n * @typedef TokenizerHandleSkip\n * @type {function}\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] If optional\n * @returns {boolean} Whether the token matched\n * @throws {Error} If the token didn't match and is not optional\n */\n\n/**\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\n * @typedef TokenizerHandleCmnt\n * @type {function}\n * @param {number} [line] Line number\n * @returns {string|null} Comment text or `null` if none\n */\n\n/**\n * Handle object returned from {@link tokenize}.\n * @interface ITokenizerHandle\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\n * @property {number} line Current line number\n */\n\n/**\n * Tokenizes the given .proto source and returns an object with useful utility functions.\n * @param {string} source Source contents\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\n * @returns {ITokenizerHandle} Tokenizer handle\n */\nfunction tokenize(source, alternateCommentMode) {\n /* eslint-disable callback-return */\n source = source.toString();\n\n var offset = 0,\n length = source.length,\n line = 1,\n commentType = null,\n commentText = null,\n commentLine = 0,\n commentLineEmpty = false;\n\n var stack = [];\n\n var stringDelim = null;\n\n /* istanbul ignore next */\n /**\n * Creates an error for illegal syntax.\n * @param {string} subject Subject\n * @returns {Error} Error created\n * @inner\n */\n function illegal(subject) {\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\n }\n\n /**\n * Reads a string till its end.\n * @returns {string} String read\n * @inner\n */\n function readString() {\n var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\n re.lastIndex = offset - 1;\n var match = re.exec(source);\n if (!match)\n throw illegal(\"string\");\n offset = re.lastIndex;\n push(stringDelim);\n stringDelim = null;\n return unescape(match[1]);\n }\n\n /**\n * Gets the character at `pos` within the source.\n * @param {number} pos Position\n * @returns {string} Character\n * @inner\n */\n function charAt(pos) {\n return source.charAt(pos);\n }\n\n /**\n * Sets the current comment text.\n * @param {number} start Start offset\n * @param {number} end End offset\n * @returns {undefined}\n * @inner\n */\n function setComment(start, end) {\n commentType = source.charAt(start++);\n commentLine = line;\n commentLineEmpty = false;\n var lookback;\n if (alternateCommentMode) {\n lookback = 2; // alternate comment parsing: \"//\" or \"/*\"\n } else {\n lookback = 3; // \"///\" or \"/**\"\n }\n var commentOffset = start - lookback,\n c;\n do {\n if (--commentOffset < 0 ||\n (c = source.charAt(commentOffset)) === \"\\n\") {\n commentLineEmpty = true;\n break;\n }\n } while (c === \" \" || c === \"\\t\");\n var lines = source\n .substring(start, end)\n .split(setCommentSplitRe);\n for (var i = 0; i < lines.length; ++i)\n lines[i] = lines[i]\n .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\n .trim();\n commentText = lines\n .join(\"\\n\")\n .trim();\n }\n\n function isDoubleSlashCommentLine(startOffset) {\n var endOffset = findEndOfLine(startOffset);\n\n // see if remaining line matches comment pattern\n var lineText = source.substring(startOffset, endOffset);\n // look for 1 or 2 slashes since startOffset would already point past\n // the first slash that started the comment.\n var isComment = /^\\s*\\/{1,2}/.test(lineText);\n return isComment;\n }\n\n function findEndOfLine(cursor) {\n // find end of cursor's line\n var endOffset = cursor;\n while (endOffset < length && charAt(endOffset) !== \"\\n\") {\n endOffset++;\n }\n return endOffset;\n }\n\n /**\n * Obtains the next token.\n * @returns {string|null} Next token or `null` on eof\n * @inner\n */\n function next() {\n if (stack.length > 0)\n return stack.shift();\n if (stringDelim)\n return readString();\n var repeat,\n prev,\n curr,\n start,\n isDoc;\n do {\n if (offset === length)\n return null;\n repeat = false;\n while (whitespaceRe.test(curr = charAt(offset))) {\n if (curr === \"\\n\")\n ++line;\n if (++offset === length)\n return null;\n }\n\n if (charAt(offset) === \"/\") {\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n if (charAt(offset) === \"/\") { // Line\n if (!alternateCommentMode) {\n // check for triple-slash comment\n isDoc = charAt(start = offset + 1) === \"/\";\n\n while (charAt(++offset) !== \"\\n\") {\n if (offset === length) {\n return null;\n }\n }\n ++offset;\n if (isDoc) {\n setComment(start, offset - 1);\n }\n ++line;\n repeat = true;\n } else {\n // check for double-slash comments, consolidating consecutive lines\n start = offset;\n isDoc = false;\n if (isDoubleSlashCommentLine(offset)) {\n isDoc = true;\n do {\n offset = findEndOfLine(offset);\n if (offset === length) {\n break;\n }\n offset++;\n } while (isDoubleSlashCommentLine(offset));\n } else {\n offset = Math.min(length, findEndOfLine(offset) + 1);\n }\n if (isDoc) {\n setComment(start, offset);\n }\n line++;\n repeat = true;\n }\n } else if ((curr = charAt(offset)) === \"*\") { /* Block */\n // check for /** (regular comment mode) or /* (alternate comment mode)\n start = offset + 1;\n isDoc = alternateCommentMode || charAt(start) === \"*\";\n do {\n if (curr === \"\\n\") {\n ++line;\n }\n if (++offset === length) {\n throw illegal(\"comment\");\n }\n prev = curr;\n curr = charAt(offset);\n } while (prev !== \"*\" || curr !== \"/\");\n ++offset;\n if (isDoc) {\n setComment(start, offset - 2);\n }\n repeat = true;\n } else {\n return \"/\";\n }\n }\n } while (repeat);\n\n // offset !== length if we got here\n\n var end = offset;\n delimRe.lastIndex = 0;\n var delim = delimRe.test(charAt(end++));\n if (!delim)\n while (end < length && !delimRe.test(charAt(end)))\n ++end;\n var token = source.substring(offset, offset = end);\n if (token === \"\\\"\" || token === \"'\")\n stringDelim = token;\n return token;\n }\n\n /**\n * Pushes a token back to the stack.\n * @param {string} token Token\n * @returns {undefined}\n * @inner\n */\n function push(token) {\n stack.push(token);\n }\n\n /**\n * Peeks for the next token.\n * @returns {string|null} Token or `null` on eof\n * @inner\n */\n function peek() {\n if (!stack.length) {\n var token = next();\n if (token === null)\n return null;\n push(token);\n }\n return stack[0];\n }\n\n /**\n * Skips a token.\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] Whether the token is optional\n * @returns {boolean} `true` when skipped, `false` if not\n * @throws {Error} When a required token is not present\n * @inner\n */\n function skip(expected, optional) {\n var actual = peek(),\n equals = actual === expected;\n if (equals) {\n next();\n return true;\n }\n if (!optional)\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\n return false;\n }\n\n /**\n * Gets a comment.\n * @param {number} [trailingLine] Line number if looking for a trailing comment\n * @returns {string|null} Comment text\n * @inner\n */\n function cmnt(trailingLine) {\n var ret = null;\n if (trailingLine === undefined) {\n if (commentLine === line - 1 && (alternateCommentMode || commentType === \"*\" || commentLineEmpty)) {\n ret = commentText;\n }\n } else {\n /* istanbul ignore else */\n if (commentLine < trailingLine) {\n peek();\n }\n if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === \"/\")) {\n ret = commentText;\n }\n }\n return ret;\n }\n\n return Object.defineProperty({\n next: next,\n peek: peek,\n push: push,\n skip: skip,\n cmnt: cmnt\n }, \"line\", {\n get: function() { return line; }\n });\n /* eslint-enable callback-return */\n}\n","\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(23);\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum = require(15),\n OneOf = require(25),\n Field = require(16),\n MapField = require(20),\n Service = require(33),\n Message = require(21),\n Reader = require(27),\n Writer = require(42),\n util = require(37),\n encoder = require(14),\n decoder = require(13),\n verifier = require(40),\n converter = require(12),\n wrappers = require(41);\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.} [options] Declared options\n */\nfunction Type(name, options) {\n name = name.replace(/\\W/g, \"\");\n Namespace.call(this, name, options);\n\n /**\n * Message fields.\n * @type {Object.}\n */\n this.fields = {}; // toJSON, marker\n\n /**\n * Oneofs declared within this namespace, if any.\n * @type {Object.}\n */\n this.oneofs = undefined; // toJSON\n\n /**\n * Extension ranges, if any.\n * @type {number[][]}\n */\n this.extensions = undefined; // toJSON\n\n /**\n * Reserved ranges, if any.\n * @type {Array.}\n */\n this.reserved = undefined; // toJSON\n\n /*?\n * Whether this type is a legacy group.\n * @type {boolean|undefined}\n */\n this.group = undefined; // toJSON\n\n /**\n * Cached fields by id.\n * @type {Object.|null}\n * @private\n */\n this._fieldsById = null;\n\n /**\n * Cached fields as an array.\n * @type {Field[]|null}\n * @private\n */\n this._fieldsArray = null;\n\n /**\n * Cached oneofs as an array.\n * @type {OneOf[]|null}\n * @private\n */\n this._oneofsArray = null;\n\n /**\n * Cached constructor.\n * @type {Constructor<{}>}\n * @private\n */\n this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n /**\n * Message fields by id.\n * @name Type#fieldsById\n * @type {Object.}\n * @readonly\n */\n fieldsById: {\n get: function() {\n\n /* istanbul ignore if */\n if (this._fieldsById)\n return this._fieldsById;\n\n this._fieldsById = {};\n for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n var field = this.fields[names[i]],\n id = field.id;\n\n /* istanbul ignore if */\n if (this._fieldsById[id])\n throw Error(\"duplicate id \" + id + \" in \" + this);\n\n this._fieldsById[id] = field;\n }\n return this._fieldsById;\n }\n },\n\n /**\n * Fields of this message as an array for iteration.\n * @name Type#fieldsArray\n * @type {Field[]}\n * @readonly\n */\n fieldsArray: {\n get: function() {\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n }\n },\n\n /**\n * Oneofs of this message as an array for iteration.\n * @name Type#oneofsArray\n * @type {OneOf[]}\n * @readonly\n */\n oneofsArray: {\n get: function() {\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n }\n },\n\n /**\n * The registered constructor, if any registered, otherwise a generic constructor.\n * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n * @name Type#ctor\n * @type {Constructor<{}>}\n */\n ctor: {\n get: function() {\n return this._ctor || (this.ctor = Type.generateConstructor(this)());\n },\n set: function(ctor) {\n\n // Ensure proper prototype\n var prototype = ctor.prototype;\n if (!(prototype instanceof Message)) {\n (ctor.prototype = new Message()).constructor = ctor;\n util.merge(ctor.prototype, prototype);\n }\n\n // Classes and messages reference their reflected type\n ctor.$type = ctor.prototype.$type = this;\n\n // Mix in static methods\n util.merge(ctor, Message, true);\n\n this._ctor = ctor;\n\n // Messages have non-enumerable default values on their prototype\n var i = 0;\n for (; i < /* initializes */ this.fieldsArray.length; ++i)\n this._fieldsArray[i].resolve(); // ensures a proper value\n\n // Messages have non-enumerable getters and setters for each virtual oneof field\n var ctorProperties = {};\n for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n ctorProperties[this._oneofsArray[i].resolve().name] = {\n get: util.oneOfGetter(this._oneofsArray[i].oneof),\n set: util.oneOfSetter(this._oneofsArray[i].oneof)\n };\n if (i)\n Object.defineProperties(ctor.prototype, ctorProperties);\n }\n }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n /* eslint-disable no-unexpected-multiline */\n var gen = util.codegen([\"p\"], mtype.name);\n // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n if ((field = mtype._fieldsArray[i]).map) gen\n (\"this%s={}\", util.safeProp(field.name));\n else if (field.repeated) gen\n (\"this%s=[]\", util.safeProp(field.name));\n return gen\n (\"if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors\n * @property {Object.} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {number[][]} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n var type = new Type(name, json.options);\n type.extensions = json.extensions;\n type.reserved = json.reserved;\n var names = Object.keys(json.fields),\n i = 0;\n for (; i < names.length; ++i)\n type.add(\n ( typeof json.fields[names[i]].keyType !== \"undefined\"\n ? MapField.fromJSON\n : Field.fromJSON )(names[i], json.fields[names[i]])\n );\n if (json.oneofs)\n for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n if (json.nested)\n for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n var nested = json.nested[names[i]];\n type.add( // most to least likely\n ( nested.id !== undefined\n ? Field.fromJSON\n : nested.fields !== undefined\n ? Type.fromJSON\n : nested.values !== undefined\n ? Enum.fromJSON\n : nested.methods !== undefined\n ? Service.fromJSON\n : Namespace.fromJSON )(names[i], nested)\n );\n }\n if (json.extensions && json.extensions.length)\n type.extensions = json.extensions;\n if (json.reserved && json.reserved.length)\n type.reserved = json.reserved;\n if (json.group)\n type.group = true;\n if (json.comment)\n type.comment = json.comment;\n return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n return util.toObject([\n \"options\" , inherited && inherited.options || undefined,\n \"oneofs\" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n \"fields\" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n \"reserved\" , this.reserved && this.reserved.length ? this.reserved : undefined,\n \"group\" , this.group || undefined,\n \"nested\" , inherited && inherited.nested || undefined,\n \"comment\" , keepComments ? this.comment : undefined\n ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n var fields = this.fieldsArray, i = 0;\n while (i < fields.length)\n fields[i++].resolve();\n var oneofs = this.oneofsArray; i = 0;\n while (i < oneofs.length)\n oneofs[i++].resolve();\n return Namespace.prototype.resolveAll.call(this);\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n return this.fields[name]\n || this.oneofs && this.oneofs[name]\n || this.nested && this.nested[name]\n || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n if (this.get(object.name))\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n if (object instanceof Field && object.extend === undefined) {\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n // The root object takes care of adding distinct sister-fields to the respective extended\n // type instead.\n\n // avoids calling the getter if not absolutely necessary because it's called quite frequently\n if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\n if (this.isReservedId(object.id))\n throw Error(\"id \" + object.id + \" is reserved in \" + this);\n if (this.isReservedName(object.name))\n throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n if (object.parent)\n object.parent.remove(object);\n this.fields[object.name] = object;\n object.message = this;\n object.onAdd(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n if (!this.oneofs)\n this.oneofs = {};\n this.oneofs[object.name] = object;\n object.onAdd(this);\n return clearCache(this);\n }\n return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n if (object instanceof Field && object.extend === undefined) {\n // See Type#add for the reason why extension fields are excluded here.\n\n /* istanbul ignore if */\n if (!this.fields || this.fields[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.fields[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n if (object instanceof OneOf) {\n\n /* istanbul ignore if */\n if (!this.oneofs || this.oneofs[object.name] !== object)\n throw Error(object + \" is not a member of \" + this);\n\n delete this.oneofs[object.name];\n object.parent = null;\n object.onRemove(this);\n return clearCache(this);\n }\n return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n // multiple times (V8, soft-deopt prototype-check).\n\n var fullName = this.fullName,\n types = [];\n for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n types.push(this._fieldsArray[i].resolve().resolvedType);\n\n // Replace setup methods with type-specific generated functions\n this.encode = encoder(this)({\n Writer : Writer,\n types : types,\n util : util\n });\n this.decode = decoder(this)({\n Reader : Reader,\n types : types,\n util : util\n });\n this.verify = verifier(this)({\n types : types,\n util : util\n });\n this.fromObject = converter.fromObject(this)({\n types : types,\n util : util\n });\n this.toObject = converter.toObject(this)({\n types : types,\n util : util\n });\n\n // Inject custom wrappers for common types\n var wrapper = wrappers[fullName];\n if (wrapper) {\n var originalThis = Object.create(this);\n // if (wrapper.fromObject) {\n originalThis.fromObject = this.fromObject;\n this.fromObject = wrapper.fromObject.bind(originalThis);\n // }\n // if (wrapper.toObject) {\n originalThis.toObject = this.toObject;\n this.toObject = wrapper.toObject.bind(originalThis);\n // }\n }\n\n return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof Reader))\n reader = Reader.create(reader);\n return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor} target Target constructor\n * @returns {undefined}\n * @template T extends Message\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator} Decorator function\n * @template T extends Message\n */\nType.d = function decorateType(typeName) {\n return function typeDecorator(target) {\n util.decorateType(target, typeName);\n };\n};\n","\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(37);\n\nvar s = [\n \"double\", // 0\n \"float\", // 1\n \"int32\", // 2\n \"uint32\", // 3\n \"sint32\", // 4\n \"fixed32\", // 5\n \"sfixed32\", // 6\n \"int64\", // 7\n \"uint64\", // 8\n \"sint64\", // 9\n \"fixed64\", // 10\n \"sfixed64\", // 11\n \"bool\", // 12\n \"string\", // 13\n \"bytes\" // 14\n];\n\nfunction bake(values, offset) {\n var i = 0, o = {};\n offset |= 0;\n while (i < values.length) o[s[i + offset]] = values[i++];\n return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2,\n /* bytes */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n /* double */ 0,\n /* float */ 0,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 0,\n /* sfixed32 */ 0,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 0,\n /* sfixed64 */ 0,\n /* bool */ false,\n /* string */ \"\",\n /* bytes */ util.emptyArray,\n /* message */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0,\n /* string */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n /* double */ 1,\n /* float */ 5,\n /* int32 */ 0,\n /* uint32 */ 0,\n /* sint32 */ 0,\n /* fixed32 */ 5,\n /* sfixed32 */ 5,\n /* int64 */ 0,\n /* uint64 */ 0,\n /* sint64 */ 0,\n /* fixed64 */ 1,\n /* sfixed64 */ 1,\n /* bool */ 0\n]);\n","\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(39);\n\nvar roots = require(30);\n\nvar Type, // cyclic\n Enum;\n\nutil.codegen = require(3);\nutil.fetch = require(5);\nutil.path = require(8);\n\n/**\n * Node's fs module if available.\n * @type {Object.}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n if (object) {\n var keys = Object.keys(object),\n array = new Array(keys.length),\n index = 0;\n while (index < keys.length)\n array[index] = object[keys[index++]];\n return array;\n }\n return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.} Converted object\n */\nutil.toObject = function toObject(array) {\n var object = {},\n index = 0;\n while (index < array.length) {\n var key = array[index++],\n val = array[index++];\n if (val !== undefined)\n object[key] = val;\n }\n return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n safePropQuoteRe = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n return str.substring(0, 1)\n + str.substring(1)\n .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n /* istanbul ignore if */\n if (ctor.$type) {\n if (typeName && ctor.$type.name !== typeName) {\n util.decorateRoot.remove(ctor.$type);\n ctor.$type.name = typeName;\n util.decorateRoot.add(ctor.$type);\n }\n return ctor.$type;\n }\n\n /* istanbul ignore next */\n if (!Type)\n Type = require(35);\n\n var type = new Type(typeName || ctor.name);\n util.decorateRoot.add(type);\n type.ctor = ctor; // sets up .encode, .decode etc.\n Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n /* istanbul ignore if */\n if (object.$type)\n return object.$type;\n\n /* istanbul ignore next */\n if (!Enum)\n Enum = require(15);\n\n var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n util.decorateRoot.add(enm);\n Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n return enm;\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n get: function() {\n return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(29))());\n }\n});\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(39);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/*\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(4);\n\n// float handling accross browsers\nutil.float = require(6);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(7);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(10);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(9);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(38);\n\n// global object reference\nutil.global = typeof window !== \"undefined\" && window\n || typeof global !== \"undefined\" && global\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n * @const\n */\nutil.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/*\n * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on\n * for this package's tests but have it be off in actual usage-reporting-protobuf use.\n * (We leave it on for some mode where there is no `process` that is used by tests.)\n */\nutil.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\")) : undefined;\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/*\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/*\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: (new Error()).stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = verifier;\n\nvar Enum = require(15),\n util = require(37);\n\nfunction invalid(field, expected) {\n return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n /* eslint-disable no-unexpected-multiline */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(%s){\", ref)\n (\"default:\")\n (\"return%j\", invalid(field, \"enum value\"));\n for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n (\"case %i:\", field.resolvedType.values[keys[j]]);\n gen\n (\"break\")\n (\"}\");\n } else {\n gen\n (\"{\")\n (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n (\"if(e)\")\n (\"return%j+e\", field.name + \".\")\n (\"}\");\n }\n } else {\n switch (field.type) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.isInteger(%s))\", ref)\n (\"return%j\", invalid(field, \"integer\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n (\"return%j\", invalid(field, \"integer|Long\"));\n break;\n case \"float\":\n case \"double\": gen\n (\"if(typeof %s!==\\\"number\\\")\", ref)\n (\"return%j\", invalid(field, \"number\"));\n break;\n case \"bool\": gen\n (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n (\"return%j\", invalid(field, \"boolean\"));\n break;\n case \"string\": gen\n (\"if(!util.isString(%s))\", ref)\n (\"return%j\", invalid(field, \"string\"));\n break;\n case \"bytes\": gen\n (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n (\"return%j\", invalid(field, \"buffer\"));\n break;\n }\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n /* eslint-disable no-unexpected-multiline */\n switch (field.keyType) {\n case \"int32\":\n case \"uint32\":\n case \"sint32\":\n case \"fixed32\":\n case \"sfixed32\": gen\n (\"if(!util.key32Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"integer key\"));\n break;\n case \"int64\":\n case \"uint64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n (\"return%j\", invalid(field, \"integer|Long key\"));\n break;\n case \"bool\": gen\n (\"if(!util.key2Re.test(%s))\", ref)\n (\"return%j\", invalid(field, \"boolean key\"));\n break;\n }\n return gen;\n /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n /* eslint-disable no-unexpected-multiline */\n\n var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n (\"if(typeof m!==\\\"object\\\"||m===null)\")\n (\"return%j\", \"object expected\");\n var oneofs = mtype.oneofsArray,\n seenFirstField = {};\n if (oneofs.length) gen\n (\"var p={}\");\n\n for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n var field = mtype._fieldsArray[i].resolve(),\n ref = \"m\" + util.safeProp(field.name);\n\n if (field.optional) gen\n (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n // map fields\n if (field.map) { gen\n (\"if(!util.isObject(%s))\", ref)\n (\"return%j\", invalid(field, \"object\"))\n (\"var k=Object.keys(%s)\", ref)\n (\"for(var i=0;i}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(21);\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n fromObject: function(object) {\n\n // unwrap value type if mapped\n if (object && object[\"@type\"]) {\n var type = this.lookup(object[\"@type\"]);\n /* istanbul ignore else */\n if (type) {\n // type_url does not accept leading \".\"\n var type_url = object[\"@type\"].charAt(0) === \".\" ?\n object[\"@type\"].substr(1) : object[\"@type\"];\n // type_url prefix is optional, but path seperator is required\n return this.create({\n type_url: \"/\" + type_url,\n value: type.encode(type.fromObject(object)).finish()\n });\n }\n }\n\n return this.fromObject(object);\n },\n\n toObject: function(message, options) {\n\n // decode value if requested and unmapped\n if (options && options.json && message.type_url && message.value) {\n // Only use fully qualified type name after the last '/'\n var name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n var type = this.lookup(name);\n /* istanbul ignore else */\n if (type)\n message = type.decode(message.value);\n }\n\n // wrap value if unmapped\n if (!(message instanceof this.ctor) && message instanceof Message) {\n var object = message.$type.toObject(message, options);\n object[\"@type\"] = message.$type.fullName;\n return object;\n }\n\n return this.toObject(message, options);\n }\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(39);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(42);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(39);\n\nvar Buffer = util.Buffer;\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\nBufferWriter.alloc = function alloc_buffer(size) {\n return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size);\n};\n\nvar writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else\n buf.utf8Write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/README.md new file mode 100644 index 00000000..a48517e4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/README.md @@ -0,0 +1,4 @@ +protobufjs/ext/debug +========================= + +Experimental debugging extension. diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/index.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/index.js new file mode 100644 index 00000000..2b797664 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/debug/index.js @@ -0,0 +1,71 @@ +"use strict"; +var protobuf = require("../.."); + +/** + * Debugging utility functions. Only present in debug builds. + * @namespace + */ +var debug = protobuf.debug = module.exports = {}; + +var codegen = protobuf.util.codegen; + +var debugFnRe = /function ([^(]+)\(([^)]*)\) {/g; + +// Counts number of calls to any generated function +function codegen_debug() { + codegen_debug.supported = codegen.supported; + codegen_debug.verbose = codegen.verbose; + var gen = codegen.apply(null, Array.prototype.slice.call(arguments)); + gen.str = (function(str) { return function str_debug() { + return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, "function $1($2) {\n\t$1.calls=($1.calls|0)+1"); + };})(gen.str); + return gen; +} + +/** + * Returns a list of unused types within the specified root. + * @param {NamespaceBase} ns Namespace to search + * @returns {Type[]} Unused types + */ +debug.unusedTypes = function unusedTypes(ns) { + + /* istanbul ignore if */ + if (!(ns instanceof protobuf.Namespace)) + throw TypeError("ns must be a Namespace"); + + /* istanbul ignore if */ + if (!ns.nested) + return []; + + var unused = []; + for (var names = Object.keys(ns.nested), i = 0; i < names.length; ++i) { + var nested = ns.nested[names[i]]; + if (nested instanceof protobuf.Type) { + var calls = (nested.encode.calls|0) + + (nested.decode.calls|0) + + (nested.verify.calls|0) + + (nested.toObject.calls|0) + + (nested.fromObject.calls|0); + if (!calls) + unused.push(nested); + } else if (nested instanceof protobuf.Namespace) + Array.prototype.push.apply(unused, unusedTypes(nested)); + } + return unused; +}; + +/** + * Enables debugging extensions. + * @returns {undefined} + */ +debug.enable = function enable() { + protobuf.util.codegen = codegen_debug; +}; + +/** + * Disables debugging extensions. + * @returns {undefined} + */ +debug.disable = function disable() { + protobuf.util.codegen = codegen; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/README.md new file mode 100644 index 00000000..d95da833 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/README.md @@ -0,0 +1,72 @@ +protobufjs/ext/descriptor +========================= + +Experimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types. + +Usage +----- + +```js +var protobuf = require("@apollo/protobufjs"), // requires the full library + descriptor = require("@apollo/protobufjs/ext/descriptor"); + +var root = ...; + +// convert any existing root instance to the corresponding descriptor type +var descriptorMsg = root.toDescriptor("proto2"); +// ^ returns a FileDescriptorSet message, see table below + +// encode to a descriptor buffer +var buffer = descriptor.FileDescriptorSet.encode(descriptorMsg).finish(); + +// decode from a descriptor buffer +var decodedDescriptor = descriptor.FileDescriptorSet.decode(buffer); + +// convert any existing descriptor to a root instance +root = protobuf.Root.fromDescriptor(decodedDescriptor); +// ^ expects a FileDescriptorSet message or buffer, see table below + +// and start all over again +``` + +API +--- + +The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto: + +| Descriptor type | protobuf.js type | Remarks +|-------------------------------|------------------|--------- +| **FileDescriptorSet** | Root | +| FileDescriptorProto | | dependencies are not supported +| FileOptions | | +| FileOptionsOptimizeMode | | +| SourceCodeInfo | | not supported +| SourceCodeInfoLocation | | +| GeneratedCodeInfo | | not supported +| GeneratedCodeInfoAnnotation | | +| **DescriptorProto** | Type | +| MessageOptions | | +| DescriptorProtoExtensionRange | | +| DescriptorProtoReservedRange | | +| **FieldDescriptorProto** | Field | +| FieldDescriptorProtoLabel | | +| FieldDescriptorProtoType | | +| FieldOptions | | +| FieldOptionsCType | | +| FieldOptionsJSType | | +| **OneofDescriptorProto** | OneOf | +| OneofOptions | | +| **EnumDescriptorProto** | Enum | +| EnumOptions | | +| EnumValueDescriptorProto | | +| EnumValueOptions | | not supported +| **ServiceDescriptorProto** | Service | +| ServiceOptions | | +| **MethodDescriptorProto** | Method | +| MethodOptions | | +| UninterpretedOption | | not supported +| UninterpretedOptionNamePart | | + +Note that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names. + +When using TypeScript, the respective interface types can be used to reference specific message instances (i.e. `protobuf.Message`). diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.d.ts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.d.ts new file mode 100644 index 00000000..1df2efcc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.d.ts @@ -0,0 +1,191 @@ +import * as $protobuf from "../.."; +export const FileDescriptorSet: $protobuf.Type; + +export const FileDescriptorProto: $protobuf.Type; + +export const DescriptorProto: $protobuf.Type & { + ExtensionRange: $protobuf.Type, + ReservedRange: $protobuf.Type +}; + +export const FieldDescriptorProto: $protobuf.Type & { + Label: $protobuf.Enum, + Type: $protobuf.Enum +}; + +export const OneofDescriptorProto: $protobuf.Type; + +export const EnumDescriptorProto: $protobuf.Type; + +export const ServiceDescriptorProto: $protobuf.Type; + +export const EnumValueDescriptorProto: $protobuf.Type; + +export const MethodDescriptorProto: $protobuf.Type; + +export const FileOptions: $protobuf.Type & { + OptimizeMode: $protobuf.Enum +}; + +export const MessageOptions: $protobuf.Type; + +export const FieldOptions: $protobuf.Type & { + CType: $protobuf.Enum, + JSType: $protobuf.Enum +}; + +export const OneofOptions: $protobuf.Type; + +export const EnumOptions: $protobuf.Type; + +export const EnumValueOptions: $protobuf.Type; + +export const ServiceOptions: $protobuf.Type; + +export const MethodOptions: $protobuf.Type; + +export const UninterpretedOption: $protobuf.Type & { + NamePart: $protobuf.Type +}; + +export const SourceCodeInfo: $protobuf.Type & { + Location: $protobuf.Type +}; + +export const GeneratedCodeInfo: $protobuf.Type & { + Annotation: $protobuf.Type +}; + +export interface IFileDescriptorSet { + file: IFileDescriptorProto[]; +} + +export interface IFileDescriptorProto { + name?: string; + package?: string; + dependency?: any; + publicDependency?: any; + weakDependency?: any; + messageType?: IDescriptorProto[]; + enumType?: IEnumDescriptorProto[]; + service?: IServiceDescriptorProto[]; + extension?: IFieldDescriptorProto[]; + options?: IFileOptions; + sourceCodeInfo?: any; + syntax?: string; +} + +export interface IFileOptions { + javaPackage?: string; + javaOuterClassname?: string; + javaMultipleFiles?: boolean; + javaGenerateEqualsAndHash?: boolean; + javaStringCheckUtf8?: boolean; + optimizeFor?: IFileOptionsOptimizeMode; + goPackage?: string; + ccGenericServices?: boolean; + javaGenericServices?: boolean; + pyGenericServices?: boolean; + deprecated?: boolean; + ccEnableArenas?: boolean; + objcClassPrefix?: string; + csharpNamespace?: string; +} + +type IFileOptionsOptimizeMode = number; + +export interface IDescriptorProto { + name?: string; + field?: IFieldDescriptorProto[]; + extension?: IFieldDescriptorProto[]; + nestedType?: IDescriptorProto[]; + enumType?: IEnumDescriptorProto[]; + extensionRange?: IDescriptorProtoExtensionRange[]; + oneofDecl?: IOneofDescriptorProto[]; + options?: IMessageOptions; + reservedRange?: IDescriptorProtoReservedRange[]; + reservedName?: string[]; +} + +export interface IMessageOptions { + mapEntry?: boolean; +} + +export interface IDescriptorProtoExtensionRange { + start?: number; + end?: number; +} + +export interface IDescriptorProtoReservedRange { + start?: number; + end?: number; +} + +export interface IFieldDescriptorProto { + name?: string; + number?: number; + label?: IFieldDescriptorProtoLabel; + type?: IFieldDescriptorProtoType; + typeName?: string; + extendee?: string; + defaultValue?: string; + oneofIndex?: number; + jsonName?: any; + options?: IFieldOptions; +} + +type IFieldDescriptorProtoLabel = number; + +type IFieldDescriptorProtoType = number; + +export interface IFieldOptions { + packed?: boolean; + jstype?: IFieldOptionsJSType; +} + +type IFieldOptionsJSType = number; + +export interface IEnumDescriptorProto { + name?: string; + value?: IEnumValueDescriptorProto[]; + options?: IEnumOptions; +} + +export interface IEnumValueDescriptorProto { + name?: string; + number?: number; + options?: any; +} + +export interface IEnumOptions { + allowAlias?: boolean; + deprecated?: boolean; +} + +export interface IOneofDescriptorProto { + name?: string; + options?: any; +} + +export interface IServiceDescriptorProto { + name?: string; + method?: IMethodDescriptorProto[]; + options?: IServiceOptions; +} + +export interface IServiceOptions { + deprecated?: boolean; +} + +export interface IMethodDescriptorProto { + name?: string; + inputType?: string; + outputType?: string; + options?: IMethodOptions; + clientStreaming?: boolean; + serverStreaming?: boolean; +} + +export interface IMethodOptions { + deprecated?: boolean; +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.js new file mode 100644 index 00000000..6aafd2ab --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/index.js @@ -0,0 +1,1052 @@ +"use strict"; +var $protobuf = require("../.."); +module.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(require("../../google/protobuf/descriptor.json")).lookup(".google.protobuf"); + +var Namespace = $protobuf.Namespace, + Root = $protobuf.Root, + Enum = $protobuf.Enum, + Type = $protobuf.Type, + Field = $protobuf.Field, + MapField = $protobuf.MapField, + OneOf = $protobuf.OneOf, + Service = $protobuf.Service, + Method = $protobuf.Method; + +// --- Root --- + +/** + * Properties of a FileDescriptorSet message. + * @interface IFileDescriptorSet + * @property {IFileDescriptorProto[]} file Files + */ + +/** + * Properties of a FileDescriptorProto message. + * @interface IFileDescriptorProto + * @property {string} [name] File name + * @property {string} [package] Package + * @property {*} [dependency] Not supported + * @property {*} [publicDependency] Not supported + * @property {*} [weakDependency] Not supported + * @property {IDescriptorProto[]} [messageType] Nested message types + * @property {IEnumDescriptorProto[]} [enumType] Nested enums + * @property {IServiceDescriptorProto[]} [service] Nested services + * @property {IFieldDescriptorProto[]} [extension] Nested extension fields + * @property {IFileOptions} [options] Options + * @property {*} [sourceCodeInfo] Not supported + * @property {string} [syntax="proto2"] Syntax + */ + +/** + * Properties of a FileOptions message. + * @interface IFileOptions + * @property {string} [javaPackage] + * @property {string} [javaOuterClassname] + * @property {boolean} [javaMultipleFiles] + * @property {boolean} [javaGenerateEqualsAndHash] + * @property {boolean} [javaStringCheckUtf8] + * @property {IFileOptionsOptimizeMode} [optimizeFor=1] + * @property {string} [goPackage] + * @property {boolean} [ccGenericServices] + * @property {boolean} [javaGenericServices] + * @property {boolean} [pyGenericServices] + * @property {boolean} [deprecated] + * @property {boolean} [ccEnableArenas] + * @property {string} [objcClassPrefix] + * @property {string} [csharpNamespace] + */ + +/** + * Values of he FileOptions.OptimizeMode enum. + * @typedef IFileOptionsOptimizeMode + * @type {number} + * @property {number} SPEED=1 + * @property {number} CODE_SIZE=2 + * @property {number} LITE_RUNTIME=3 + */ + +/** + * Creates a root from a descriptor set. + * @param {IFileDescriptorSet|Reader|Uint8Array} descriptor Descriptor + * @returns {Root} Root instance + */ +Root.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.FileDescriptorSet.decode(descriptor); + + var root = new Root(); + + if (descriptor.file) { + var fileDescriptor, + filePackage; + for (var j = 0, i; j < descriptor.file.length; ++j) { + filePackage = root; + if ((fileDescriptor = descriptor.file[j])["package"] && fileDescriptor["package"].length) + filePackage = root.define(fileDescriptor["package"]); + if (fileDescriptor.name && fileDescriptor.name.length) + root.files.push(filePackage.filename = fileDescriptor.name); + if (fileDescriptor.messageType) + for (i = 0; i < fileDescriptor.messageType.length; ++i) + filePackage.add(Type.fromDescriptor(fileDescriptor.messageType[i], fileDescriptor.syntax)); + if (fileDescriptor.enumType) + for (i = 0; i < fileDescriptor.enumType.length; ++i) + filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i])); + if (fileDescriptor.extension) + for (i = 0; i < fileDescriptor.extension.length; ++i) + filePackage.add(Field.fromDescriptor(fileDescriptor.extension[i])); + if (fileDescriptor.service) + for (i = 0; i < fileDescriptor.service.length; ++i) + filePackage.add(Service.fromDescriptor(fileDescriptor.service[i])); + var opts = fromDescriptorOptions(fileDescriptor.options, exports.FileOptions); + if (opts) { + var ks = Object.keys(opts); + for (i = 0; i < ks.length; ++i) + filePackage.setOption(ks[i], opts[ks[i]]); + } + } + } + + return root; +}; + +/** + * Converts a root to a descriptor set. + * @returns {Message} Descriptor + * @param {string} [syntax="proto2"] Syntax + */ +Root.prototype.toDescriptor = function toDescriptor(syntax) { + var set = exports.FileDescriptorSet.create(); + Root_toDescriptorRecursive(this, set.file, syntax); + return set; +}; + +// Traverses a namespace and assembles the descriptor set +function Root_toDescriptorRecursive(ns, files, syntax) { + + // Create a new file + var file = exports.FileDescriptorProto.create({ name: ns.filename || (ns.fullName.substring(1).replace(/\./g, "_") || "root") + ".proto" }); + if (syntax) + file.syntax = syntax; + if (!(ns instanceof Root)) + file["package"] = ns.fullName.substring(1); + + // Add nested types + for (var i = 0, nested; i < ns.nestedArray.length; ++i) + if ((nested = ns._nestedArray[i]) instanceof Type) + file.messageType.push(nested.toDescriptor(syntax)); + else if (nested instanceof Enum) + file.enumType.push(nested.toDescriptor()); + else if (nested instanceof Field) + file.extension.push(nested.toDescriptor(syntax)); + else if (nested instanceof Service) + file.service.push(nested.toDescriptor()); + else if (nested instanceof /* plain */ Namespace) + Root_toDescriptorRecursive(nested, files, syntax); // requires new file + + // Keep package-level options + file.options = toDescriptorOptions(ns.options, exports.FileOptions); + + // And keep the file only if there is at least one nested object + if (file.messageType.length + file.enumType.length + file.extension.length + file.service.length) + files.push(file); +} + +// --- Type --- + +/** + * Properties of a DescriptorProto message. + * @interface IDescriptorProto + * @property {string} [name] Message type name + * @property {IFieldDescriptorProto[]} [field] Fields + * @property {IFieldDescriptorProto[]} [extension] Extension fields + * @property {IDescriptorProto[]} [nestedType] Nested message types + * @property {IEnumDescriptorProto[]} [enumType] Nested enums + * @property {IDescriptorProtoExtensionRange[]} [extensionRange] Extension ranges + * @property {IOneofDescriptorProto[]} [oneofDecl] Oneofs + * @property {IMessageOptions} [options] Not supported + * @property {IDescriptorProtoReservedRange[]} [reservedRange] Reserved ranges + * @property {string[]} [reservedName] Reserved names + */ + +/** + * Properties of a MessageOptions message. + * @interface IMessageOptions + * @property {boolean} [mapEntry=false] Whether this message is a map entry + */ + +/** + * Properties of an ExtensionRange message. + * @interface IDescriptorProtoExtensionRange + * @property {number} [start] Start field id + * @property {number} [end] End field id + */ + +/** + * Properties of a ReservedRange message. + * @interface IDescriptorProtoReservedRange + * @property {number} [start] Start field id + * @property {number} [end] End field id + */ + +var unnamedMessageIndex = 0; + +/** + * Creates a type from a descriptor. + * @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @param {string} [syntax="proto2"] Syntax + * @returns {Type} Type instance + */ +Type.fromDescriptor = function fromDescriptor(descriptor, syntax) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.DescriptorProto.decode(descriptor); + + // Create the message type + var type = new Type(descriptor.name.length ? descriptor.name : "Type" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports.MessageOptions)), + i; + + /* Oneofs */ if (descriptor.oneofDecl) + for (i = 0; i < descriptor.oneofDecl.length; ++i) + type.add(OneOf.fromDescriptor(descriptor.oneofDecl[i])); + /* Fields */ if (descriptor.field) + for (i = 0; i < descriptor.field.length; ++i) { + var field = Field.fromDescriptor(descriptor.field[i], syntax); + type.add(field); + if (descriptor.field[i].hasOwnProperty("oneofIndex")) // eslint-disable-line no-prototype-builtins + type.oneofsArray[descriptor.field[i].oneofIndex].add(field); + } + /* Extension fields */ if (descriptor.extension) + for (i = 0; i < descriptor.extension.length; ++i) + type.add(Field.fromDescriptor(descriptor.extension[i], syntax)); + /* Nested types */ if (descriptor.nestedType) + for (i = 0; i < descriptor.nestedType.length; ++i) { + type.add(Type.fromDescriptor(descriptor.nestedType[i], syntax)); + if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry) + type.setOption("map_entry", true); + } + /* Nested enums */ if (descriptor.enumType) + for (i = 0; i < descriptor.enumType.length; ++i) + type.add(Enum.fromDescriptor(descriptor.enumType[i])); + /* Extension ranges */ if (descriptor.extensionRange && descriptor.extensionRange.length) { + type.extensions = []; + for (i = 0; i < descriptor.extensionRange.length; ++i) + type.extensions.push([ descriptor.extensionRange[i].start, descriptor.extensionRange[i].end ]); + } + /* Reserved... */ if (descriptor.reservedRange && descriptor.reservedRange.length || descriptor.reservedName && descriptor.reservedName.length) { + type.reserved = []; + /* Ranges */ if (descriptor.reservedRange) + for (i = 0; i < descriptor.reservedRange.length; ++i) + type.reserved.push([ descriptor.reservedRange[i].start, descriptor.reservedRange[i].end ]); + /* Names */ if (descriptor.reservedName) + for (i = 0; i < descriptor.reservedName.length; ++i) + type.reserved.push(descriptor.reservedName[i]); + } + + return type; +}; + +/** + * Converts a type to a descriptor. + * @returns {Message} Descriptor + * @param {string} [syntax="proto2"] Syntax + */ +Type.prototype.toDescriptor = function toDescriptor(syntax) { + var descriptor = exports.DescriptorProto.create({ name: this.name }), + i; + + /* Fields */ for (i = 0; i < this.fieldsArray.length; ++i) { + var fieldDescriptor; + descriptor.field.push(fieldDescriptor = this._fieldsArray[i].toDescriptor(syntax)); + if (this._fieldsArray[i] instanceof MapField) { // map fields are repeated FieldNameEntry + var keyType = toDescriptorType(this._fieldsArray[i].keyType, this._fieldsArray[i].resolvedKeyType), + valueType = toDescriptorType(this._fieldsArray[i].type, this._fieldsArray[i].resolvedType), + valueTypeName = valueType === /* type */ 11 || valueType === /* enum */ 14 + ? this._fieldsArray[i].resolvedType && shortname(this.parent, this._fieldsArray[i].resolvedType) || this._fieldsArray[i].type + : undefined; + descriptor.nestedType.push(exports.DescriptorProto.create({ + name: fieldDescriptor.typeName, + field: [ + exports.FieldDescriptorProto.create({ name: "key", number: 1, label: 1, type: keyType }), // can't reference a type or enum + exports.FieldDescriptorProto.create({ name: "value", number: 2, label: 1, type: valueType, typeName: valueTypeName }) + ], + options: exports.MessageOptions.create({ mapEntry: true }) + })); + } + } + /* Oneofs */ for (i = 0; i < this.oneofsArray.length; ++i) + descriptor.oneofDecl.push(this._oneofsArray[i].toDescriptor()); + /* Nested... */ for (i = 0; i < this.nestedArray.length; ++i) { + /* Extension fields */ if (this._nestedArray[i] instanceof Field) + descriptor.field.push(this._nestedArray[i].toDescriptor(syntax)); + /* Types */ else if (this._nestedArray[i] instanceof Type) + descriptor.nestedType.push(this._nestedArray[i].toDescriptor(syntax)); + /* Enums */ else if (this._nestedArray[i] instanceof Enum) + descriptor.enumType.push(this._nestedArray[i].toDescriptor()); + // plain nested namespaces become packages instead in Root#toDescriptor + } + /* Extension ranges */ if (this.extensions) + for (i = 0; i < this.extensions.length; ++i) + descriptor.extensionRange.push(exports.DescriptorProto.ExtensionRange.create({ start: this.extensions[i][0], end: this.extensions[i][1] })); + /* Reserved... */ if (this.reserved) + for (i = 0; i < this.reserved.length; ++i) + /* Names */ if (typeof this.reserved[i] === "string") + descriptor.reservedName.push(this.reserved[i]); + /* Ranges */ else + descriptor.reservedRange.push(exports.DescriptorProto.ReservedRange.create({ start: this.reserved[i][0], end: this.reserved[i][1] })); + + descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions); + + return descriptor; +}; + +// --- Field --- + +/** + * Properties of a FieldDescriptorProto message. + * @interface IFieldDescriptorProto + * @property {string} [name] Field name + * @property {number} [number] Field id + * @property {IFieldDescriptorProtoLabel} [label] Field rule + * @property {IFieldDescriptorProtoType} [type] Field basic type + * @property {string} [typeName] Field type name + * @property {string} [extendee] Extended type name + * @property {string} [defaultValue] Literal default value + * @property {number} [oneofIndex] Oneof index if part of a oneof + * @property {*} [jsonName] Not supported + * @property {IFieldOptions} [options] Field options + */ + +/** + * Values of the FieldDescriptorProto.Label enum. + * @typedef IFieldDescriptorProtoLabel + * @type {number} + * @property {number} LABEL_OPTIONAL=1 + * @property {number} LABEL_REQUIRED=2 + * @property {number} LABEL_REPEATED=3 + */ + +/** + * Values of the FieldDescriptorProto.Type enum. + * @typedef IFieldDescriptorProtoType + * @type {number} + * @property {number} TYPE_DOUBLE=1 + * @property {number} TYPE_FLOAT=2 + * @property {number} TYPE_INT64=3 + * @property {number} TYPE_UINT64=4 + * @property {number} TYPE_INT32=5 + * @property {number} TYPE_FIXED64=6 + * @property {number} TYPE_FIXED32=7 + * @property {number} TYPE_BOOL=8 + * @property {number} TYPE_STRING=9 + * @property {number} TYPE_GROUP=10 + * @property {number} TYPE_MESSAGE=11 + * @property {number} TYPE_BYTES=12 + * @property {number} TYPE_UINT32=13 + * @property {number} TYPE_ENUM=14 + * @property {number} TYPE_SFIXED32=15 + * @property {number} TYPE_SFIXED64=16 + * @property {number} TYPE_SINT32=17 + * @property {number} TYPE_SINT64=18 + */ + +/** + * Properties of a FieldOptions message. + * @interface IFieldOptions + * @property {boolean} [packed] Whether packed or not (defaults to `false` for proto2 and `true` for proto3) + * @property {IFieldOptionsJSType} [jstype] JavaScript value type (not used by protobuf.js) + */ + +/** + * Values of the FieldOptions.JSType enum. + * @typedef IFieldOptionsJSType + * @type {number} + * @property {number} JS_NORMAL=0 + * @property {number} JS_STRING=1 + * @property {number} JS_NUMBER=2 + */ + +// copied here from parse.js +var numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/; + +/** + * Creates a field from a descriptor. + * @param {IFieldDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @param {string} [syntax="proto2"] Syntax + * @returns {Field} Field instance + */ +Field.fromDescriptor = function fromDescriptor(descriptor, syntax) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.DescriptorProto.decode(descriptor); + + if (typeof descriptor.number !== "number") + throw Error("missing field id"); + + // Rewire field type + var fieldType; + if (descriptor.typeName && descriptor.typeName.length) + fieldType = descriptor.typeName; + else + fieldType = fromDescriptorType(descriptor.type); + + // Rewire field rule + var fieldRule; + switch (descriptor.label) { + // 0 is reserved for errors + case 1: fieldRule = undefined; break; + case 2: fieldRule = "required"; break; + case 3: fieldRule = "repeated"; break; + default: throw Error("illegal label: " + descriptor.label); + } + + var extendee = descriptor.extendee; + if (descriptor.extendee !== undefined) { + extendee = extendee.length ? extendee : undefined; + } + var field = new Field( + descriptor.name.length ? descriptor.name : "field" + descriptor.number, + descriptor.number, + fieldType, + fieldRule, + extendee + ); + + field.options = fromDescriptorOptions(descriptor.options, exports.FieldOptions); + + if (descriptor.defaultValue && descriptor.defaultValue.length) { + var defaultValue = descriptor.defaultValue; + switch (defaultValue) { + case "true": case "TRUE": + defaultValue = true; + break; + case "false": case "FALSE": + defaultValue = false; + break; + default: + var match = numberRe.exec(defaultValue); + if (match) + defaultValue = parseInt(defaultValue); // eslint-disable-line radix + break; + } + field.setOption("default", defaultValue); + } + + if (packableDescriptorType(descriptor.type)) { + if (syntax === "proto3") { // defaults to packed=true (internal preset is packed=true) + if (descriptor.options && !descriptor.options.packed) + field.setOption("packed", false); + } else if (!(descriptor.options && descriptor.options.packed)) // defaults to packed=false + field.setOption("packed", false); + } + + return field; +}; + +/** + * Converts a field to a descriptor. + * @returns {Message} Descriptor + * @param {string} [syntax="proto2"] Syntax + */ +Field.prototype.toDescriptor = function toDescriptor(syntax) { + var descriptor = exports.FieldDescriptorProto.create({ name: this.name, number: this.id }); + + if (this.map) { + + descriptor.type = 11; // message + descriptor.typeName = $protobuf.util.ucFirst(this.name); // fieldName -> FieldNameEntry (built in Type#toDescriptor) + descriptor.label = 3; // repeated + + } else { + + // Rewire field type + switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType)) { + case 10: // group + case 11: // type + case 14: // enum + descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type; + break; + } + + // Rewire field rule + switch (this.rule) { + case "repeated": descriptor.label = 3; break; + case "required": descriptor.label = 2; break; + default: descriptor.label = 1; break; + } + + } + + // Handle extension field + descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend; + + // Handle part of oneof + if (this.partOf) + if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0) + throw Error("missing oneof"); + + if (this.options) { + descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions); + if (this.options["default"] != null) + descriptor.defaultValue = String(this.options["default"]); + } + + if (syntax === "proto3") { // defaults to packed=true + if (!this.packed) + (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = false; + } else if (this.packed) // defaults to packed=false + (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = true; + + return descriptor; +}; + +// --- Enum --- + +/** + * Properties of an EnumDescriptorProto message. + * @interface IEnumDescriptorProto + * @property {string} [name] Enum name + * @property {IEnumValueDescriptorProto[]} [value] Enum values + * @property {IEnumOptions} [options] Enum options + */ + +/** + * Properties of an EnumValueDescriptorProto message. + * @interface IEnumValueDescriptorProto + * @property {string} [name] Name + * @property {number} [number] Value + * @property {*} [options] Not supported + */ + +/** + * Properties of an EnumOptions message. + * @interface IEnumOptions + * @property {boolean} [allowAlias] Whether aliases are allowed + * @property {boolean} [deprecated] + */ + +var unnamedEnumIndex = 0; + +/** + * Creates an enum from a descriptor. + * @param {IEnumDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {Enum} Enum instance + */ +Enum.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.EnumDescriptorProto.decode(descriptor); + + // Construct values object + var values = {}; + if (descriptor.value) + for (var i = 0; i < descriptor.value.length; ++i) { + var name = descriptor.value[i].name, + value = descriptor.value[i].number || 0; + values[name && name.length ? name : "NAME" + value] = value; + } + + return new Enum( + descriptor.name && descriptor.name.length ? descriptor.name : "Enum" + unnamedEnumIndex++, + values, + fromDescriptorOptions(descriptor.options, exports.EnumOptions) + ); +}; + +/** + * Converts an enum to a descriptor. + * @returns {Message} Descriptor + */ +Enum.prototype.toDescriptor = function toDescriptor() { + + // Values + var values = []; + for (var i = 0, ks = Object.keys(this.values); i < ks.length; ++i) + values.push(exports.EnumValueDescriptorProto.create({ name: ks[i], number: this.values[ks[i]] })); + + return exports.EnumDescriptorProto.create({ + name: this.name, + value: values, + options: toDescriptorOptions(this.options, exports.EnumOptions) + }); +}; + +// --- OneOf --- + +/** + * Properties of a OneofDescriptorProto message. + * @interface IOneofDescriptorProto + * @property {string} [name] Oneof name + * @property {*} [options] Not supported + */ + +var unnamedOneofIndex = 0; + +/** + * Creates a oneof from a descriptor. + * @param {IOneofDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {OneOf} OneOf instance + */ +OneOf.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.OneofDescriptorProto.decode(descriptor); + + return new OneOf( + // unnamedOneOfIndex is global, not per type, because we have no ref to a type here + descriptor.name && descriptor.name.length ? descriptor.name : "oneof" + unnamedOneofIndex++ + // fromDescriptorOptions(descriptor.options, exports.OneofOptions) - only uninterpreted_option + ); +}; + +/** + * Converts a oneof to a descriptor. + * @returns {Message} Descriptor + */ +OneOf.prototype.toDescriptor = function toDescriptor() { + return exports.OneofDescriptorProto.create({ + name: this.name + // options: toDescriptorOptions(this.options, exports.OneofOptions) - only uninterpreted_option + }); +}; + +// --- Service --- + +/** + * Properties of a ServiceDescriptorProto message. + * @interface IServiceDescriptorProto + * @property {string} [name] Service name + * @property {IMethodDescriptorProto[]} [method] Methods + * @property {IServiceOptions} [options] Options + */ + +/** + * Properties of a ServiceOptions message. + * @interface IServiceOptions + * @property {boolean} [deprecated] + */ + +var unnamedServiceIndex = 0; + +/** + * Creates a service from a descriptor. + * @param {IServiceDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {Service} Service instance + */ +Service.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.ServiceDescriptorProto.decode(descriptor); + + var service = new Service(descriptor.name && descriptor.name.length ? descriptor.name : "Service" + unnamedServiceIndex++, fromDescriptorOptions(descriptor.options, exports.ServiceOptions)); + if (descriptor.method) + for (var i = 0; i < descriptor.method.length; ++i) + service.add(Method.fromDescriptor(descriptor.method[i])); + + return service; +}; + +/** + * Converts a service to a descriptor. + * @returns {Message} Descriptor + */ +Service.prototype.toDescriptor = function toDescriptor() { + + // Methods + var methods = []; + for (var i = 0; i < this.methodsArray.length; ++i) + methods.push(this._methodsArray[i].toDescriptor()); + + return exports.ServiceDescriptorProto.create({ + name: this.name, + method: methods, + options: toDescriptorOptions(this.options, exports.ServiceOptions) + }); +}; + +// --- Method --- + +/** + * Properties of a MethodDescriptorProto message. + * @interface IMethodDescriptorProto + * @property {string} [name] Method name + * @property {string} [inputType] Request type name + * @property {string} [outputType] Response type name + * @property {IMethodOptions} [options] Not supported + * @property {boolean} [clientStreaming=false] Whether requests are streamed + * @property {boolean} [serverStreaming=false] Whether responses are streamed + */ + +/** + * Properties of a MethodOptions message. + * @interface IMethodOptions + * @property {boolean} [deprecated] + */ + +var unnamedMethodIndex = 0; + +/** + * Creates a method from a descriptor. + * @param {IMethodDescriptorProto|Reader|Uint8Array} descriptor Descriptor + * @returns {Method} Reflected method instance + */ +Method.fromDescriptor = function fromDescriptor(descriptor) { + + // Decode the descriptor message if specified as a buffer: + if (typeof descriptor.length === "number") + descriptor = exports.MethodDescriptorProto.decode(descriptor); + + return new Method( + // unnamedMethodIndex is global, not per service, because we have no ref to a service here + descriptor.name && descriptor.name.length ? descriptor.name : "Method" + unnamedMethodIndex++, + "rpc", + descriptor.inputType, + descriptor.outputType, + Boolean(descriptor.clientStreaming), + Boolean(descriptor.serverStreaming), + fromDescriptorOptions(descriptor.options, exports.MethodOptions) + ); +}; + +/** + * Converts a method to a descriptor. + * @returns {Message} Descriptor + */ +Method.prototype.toDescriptor = function toDescriptor() { + return exports.MethodDescriptorProto.create({ + name: this.name, + inputType: this.resolvedRequestType ? this.resolvedRequestType.fullName : this.requestType, + outputType: this.resolvedResponseType ? this.resolvedResponseType.fullName : this.responseType, + clientStreaming: this.requestStream, + serverStreaming: this.responseStream, + options: toDescriptorOptions(this.options, exports.MethodOptions) + }); +}; + +// --- utility --- + +// Converts a descriptor type to a protobuf.js basic type +function fromDescriptorType(type) { + switch (type) { + // 0 is reserved for errors + case 1: return "double"; + case 2: return "float"; + case 3: return "int64"; + case 4: return "uint64"; + case 5: return "int32"; + case 6: return "fixed64"; + case 7: return "fixed32"; + case 8: return "bool"; + case 9: return "string"; + case 12: return "bytes"; + case 13: return "uint32"; + case 15: return "sfixed32"; + case 16: return "sfixed64"; + case 17: return "sint32"; + case 18: return "sint64"; + } + throw Error("illegal type: " + type); +} + +// Tests if a descriptor type is packable +function packableDescriptorType(type) { + switch (type) { + case 1: // double + case 2: // float + case 3: // int64 + case 4: // uint64 + case 5: // int32 + case 6: // fixed64 + case 7: // fixed32 + case 8: // bool + case 13: // uint32 + case 14: // enum (!) + case 15: // sfixed32 + case 16: // sfixed64 + case 17: // sint32 + case 18: // sint64 + return true; + } + return false; +} + +// Converts a protobuf.js basic type to a descriptor type +function toDescriptorType(type, resolvedType) { + switch (type) { + // 0 is reserved for errors + case "double": return 1; + case "float": return 2; + case "int64": return 3; + case "uint64": return 4; + case "int32": return 5; + case "fixed64": return 6; + case "fixed32": return 7; + case "bool": return 8; + case "string": return 9; + case "bytes": return 12; + case "uint32": return 13; + case "sfixed32": return 15; + case "sfixed64": return 16; + case "sint32": return 17; + case "sint64": return 18; + } + if (resolvedType instanceof Enum) + return 14; + if (resolvedType instanceof Type) + return resolvedType.group ? 10 : 11; + throw Error("illegal type: " + type); +} + +// Converts descriptor options to an options object +function fromDescriptorOptions(options, type) { + if (!options) + return undefined; + var out = []; + for (var i = 0, field, key, val; i < type.fieldsArray.length; ++i) + if ((key = (field = type._fieldsArray[i]).name) !== "uninterpretedOption") + if (options.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins + val = options[key]; + if (field.resolvedType instanceof Enum && typeof val === "number" && field.resolvedType.valuesById[val] !== undefined) + val = field.resolvedType.valuesById[val]; + out.push(underScore(key), val); + } + return out.length ? $protobuf.util.toObject(out) : undefined; +} + +// Converts an options object to descriptor options +function toDescriptorOptions(options, type) { + if (!options) + return undefined; + var out = []; + for (var i = 0, ks = Object.keys(options), key, val; i < ks.length; ++i) { + val = options[key = ks[i]]; + if (key === "default") + continue; + var field = type.fields[key]; + if (!field && !(field = type.fields[key = $protobuf.util.camelCase(key)])) + continue; + out.push(key, val); + } + return out.length ? type.fromObject($protobuf.util.toObject(out)) : undefined; +} + +// Calculates the shortest relative path from `from` to `to`. +function shortname(from, to) { + var fromPath = from.fullName.split("."), + toPath = to.fullName.split("."), + i = 0, + j = 0, + k = toPath.length - 1; + if (!(from instanceof Root) && to instanceof Namespace) + while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) { + var other = to.lookup(fromPath[i++], true); + if (other !== null && other !== to) + break; + ++j; + } + else + for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j); + return toPath.slice(j).join("."); +} + +// copied here from cli/targets/proto.js +function underScore(str) { + return str.substring(0,1) + + str.substring(1) + .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); +} + +// --- exports --- + +/** + * Reflected file descriptor set. + * @name FileDescriptorSet + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected file descriptor proto. + * @name FileDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected descriptor proto. + * @name DescriptorProto + * @type {Type} + * @property {Type} ExtensionRange + * @property {Type} ReservedRange + * @const + * @tstype $protobuf.Type & { + * ExtensionRange: $protobuf.Type, + * ReservedRange: $protobuf.Type + * } + */ + +/** + * Reflected field descriptor proto. + * @name FieldDescriptorProto + * @type {Type} + * @property {Enum} Label + * @property {Enum} Type + * @const + * @tstype $protobuf.Type & { + * Label: $protobuf.Enum, + * Type: $protobuf.Enum + * } + */ + +/** + * Reflected oneof descriptor proto. + * @name OneofDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum descriptor proto. + * @name EnumDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected service descriptor proto. + * @name ServiceDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum value descriptor proto. + * @name EnumValueDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected method descriptor proto. + * @name MethodDescriptorProto + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected file options. + * @name FileOptions + * @type {Type} + * @property {Enum} OptimizeMode + * @const + * @tstype $protobuf.Type & { + * OptimizeMode: $protobuf.Enum + * } + */ + +/** + * Reflected message options. + * @name MessageOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected field options. + * @name FieldOptions + * @type {Type} + * @property {Enum} CType + * @property {Enum} JSType + * @const + * @tstype $protobuf.Type & { + * CType: $protobuf.Enum, + * JSType: $protobuf.Enum + * } + */ + +/** + * Reflected oneof options. + * @name OneofOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum options. + * @name EnumOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected enum value options. + * @name EnumValueOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected service options. + * @name ServiceOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected method options. + * @name MethodOptions + * @type {Type} + * @const + * @tstype $protobuf.Type + */ + +/** + * Reflected uninterpretet option. + * @name UninterpretedOption + * @type {Type} + * @property {Type} NamePart + * @const + * @tstype $protobuf.Type & { + * NamePart: $protobuf.Type + * } + */ + +/** + * Reflected source code info. + * @name SourceCodeInfo + * @type {Type} + * @property {Type} Location + * @const + * @tstype $protobuf.Type & { + * Location: $protobuf.Type + * } + */ + +/** + * Reflected generated code info. + * @name GeneratedCodeInfo + * @type {Type} + * @property {Type} Annotation + * @const + * @tstype $protobuf.Type & { + * Annotation: $protobuf.Type + * } + */ diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/test.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/test.js new file mode 100644 index 00000000..ceb80f82 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/ext/descriptor/test.js @@ -0,0 +1,54 @@ +/*eslint-disable no-console*/ +"use strict"; +var protobuf = require("../../"), + descriptor = require("."); + +/* var proto = { + nested: { + Message: { + fields: { + foo: { + type: "string", + id: 1 + } + }, + nested: { + SubMessage: { + fields: {} + } + } + }, + Enum: { + values: { + ONE: 1, + TWO: 2 + } + } + } +}; */ + +// var root = protobuf.Root.fromJSON(proto).resolveAll(); +var root = protobuf.loadSync("tests/data/google/protobuf/descriptor.proto").resolveAll(); + +// console.log("Original proto", JSON.stringify(root, null, 2)); + +var msg = root.toDescriptor(); + +// console.log("\nDescriptor", JSON.stringify(msg.toObject(), null, 2)); + +var buf = descriptor.FileDescriptorSet.encode(msg).finish(); +var root2 = protobuf.Root.fromDescriptor(buf, "proto2").resolveAll(); + +// console.log("\nDecoded proto", JSON.stringify(root2, null, 2)); + +var diff = require("deep-diff").diff(root.toJSON(), root2.toJSON()); +if (diff) { + diff.forEach(function(diff) { + console.log(diff.kind + " @ " + diff.path.join(".")); + console.log("lhs:", typeof diff.lhs, diff.lhs); + console.log("rhs:", typeof diff.rhs, diff.rhs); + console.log(); + }); + process.exitCode = 1; +} else + console.log("no differences"); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/LICENSE b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/LICENSE new file mode 100644 index 00000000..868bd40d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/LICENSE @@ -0,0 +1,27 @@ +Copyright 2014, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/README.md b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/README.md new file mode 100644 index 00000000..09e3f230 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/README.md @@ -0,0 +1 @@ +This folder contains stripped and pre-parsed definitions of common Google types. These files are not used by protobuf.js directly but are here so you can use or include them where required. diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.json new file mode 100644 index 00000000..3f13a733 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.json @@ -0,0 +1,83 @@ +{ + "nested": { + "google": { + "nested": { + "api": { + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "selector": { + "type": "string", + "id": 1 + }, + "body": { + "type": "string", + "id": 7 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + } + } + }, + "protobuf": { + "nested": { + "MethodOptions": { + "fields": {}, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.proto b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.proto new file mode 100644 index 00000000..63a8eefd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/annotations.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MethodOptions { + + HttpRule http = 72295728; +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.json new file mode 100644 index 00000000..e3a0f4f9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.json @@ -0,0 +1,86 @@ +{ + "nested": { + "google": { + "nested": { + "api": { + "nested": { + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "selector": { + "type": "string", + "id": 1 + }, + "body": { + "type": "string", + "id": 7 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.proto b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.proto new file mode 100644 index 00000000..e9a7e9de --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/api/http.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package google.api; + +message Http { + + repeated HttpRule rules = 1; +} + +message HttpRule { + + oneof pattern { + + string get = 2; + string put = 3; + string post = 4; + string delete = 5; + string patch = 6; + CustomHttpPattern custom = 8; + } + + string selector = 1; + string body = 7; + repeated HttpRule additional_bindings = 11; +} + +message CustomHttpPattern { + + string kind = 1; + string path = 2; +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.json new file mode 100644 index 00000000..5460612f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.json @@ -0,0 +1,118 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "Api": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "methods": { + "rule": "repeated", + "type": "Method", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "mixins": { + "rule": "repeated", + "type": "Mixin", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 + } + } + }, + "Method": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "requestTypeUrl": { + "type": "string", + "id": 2 + }, + "requestStreaming": { + "type": "bool", + "id": 3 + }, + "responseTypeUrl": { + "type": "string", + "id": 4 + }, + "responseStreaming": { + "type": "bool", + "id": 5 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 + } + } + }, + "Mixin": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "root": { + "type": "string", + "id": 2 + } + } + }, + "SourceContext": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + } + } + }, + "Option": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "Any", + "id": 2 + } + } + }, + "Syntax": { + "values": { + "SYNTAX_PROTO2": 0, + "SYNTAX_PROTO3": 1 + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.proto b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.proto new file mode 100644 index 00000000..cf6ae3f3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/api.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +message Api { + + string name = 1; + repeated Method methods = 2; + repeated Option options = 3; + string version = 4; + SourceContext source_context = 5; + repeated Mixin mixins = 6; + Syntax syntax = 7; +} + +message Method { + + string name = 1; + string request_type_url = 2; + bool request_streaming = 3; + string response_type_url = 4; + bool response_streaming = 5; + repeated Option options = 6; + Syntax syntax = 7; +} + +message Mixin { + + string name = 1; + string root = 2; +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.json new file mode 100644 index 00000000..f6c5c112 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.json @@ -0,0 +1,739 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5 + }, + "serverStreaming": { + "type": "bool", + "id": 6 + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10 + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27 + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16 + }, + "javaGenericServices": { + "type": "bool", + "id": 17 + }, + "pyGenericServices": { + "type": "bool", + "id": 18 + }, + "deprecated": { + "type": "bool", + "id": 23 + }, + "ccEnableArenas": { + "type": "bool", + "id": 31 + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1 + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "weak": { + "type": "bool", + "id": 10 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.proto b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.proto new file mode 100644 index 00000000..32794926 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/descriptor.proto @@ -0,0 +1,286 @@ +syntax = "proto2"; + +package google.protobuf; + +message FileDescriptorSet { + + repeated FileDescriptorProto file = 1; +} + +message FileDescriptorProto { + + optional string name = 1; + optional string package = 2; + repeated string dependency = 3; + repeated int32 public_dependency = 10; + repeated int32 weak_dependency = 11; + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + optional FileOptions options = 8; + optional SourceCodeInfo source_code_info = 9; + optional string syntax = 12; +} + +message DescriptorProto { + + optional string name = 1; + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + repeated ExtensionRange extension_range = 5; + repeated OneofDescriptorProto oneof_decl = 8; + optional MessageOptions options = 7; + repeated ReservedRange reserved_range = 9; + repeated string reserved_name = 10; + + message ExtensionRange { + + optional int32 start = 1; + optional int32 end = 2; + } + + message ReservedRange { + + optional int32 start = 1; + optional int32 end = 2; + } +} + +message FieldDescriptorProto { + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + optional Type type = 5; + optional string type_name = 6; + optional string extendee = 2; + optional string default_value = 7; + optional int32 oneof_index = 9; + optional string json_name = 10; + optional FieldOptions options = 8; + + enum Type { + + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; + TYPE_SINT64 = 18; + } + + enum Label { + + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } +} + +message OneofDescriptorProto { + + optional string name = 1; + optional OneofOptions options = 2; +} + +message EnumDescriptorProto { + + optional string name = 1; + repeated EnumValueDescriptorProto value = 2; + optional EnumOptions options = 3; +} + +message EnumValueDescriptorProto { + + optional string name = 1; + optional int32 number = 2; + optional EnumValueOptions options = 3; +} + +message ServiceDescriptorProto { + + optional string name = 1; + repeated MethodDescriptorProto method = 2; + optional ServiceOptions options = 3; +} + +message MethodDescriptorProto { + + optional string name = 1; + optional string input_type = 2; + optional string output_type = 3; + optional MethodOptions options = 4; + optional bool client_streaming = 5; + optional bool server_streaming = 6; +} + +message FileOptions { + + optional string java_package = 1; + optional string java_outer_classname = 8; + optional bool java_multiple_files = 10; + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + optional bool java_string_check_utf8 = 27; + optional OptimizeMode optimize_for = 9 [default=SPEED]; + optional string go_package = 11; + optional bool cc_generic_services = 16; + optional bool java_generic_services = 17; + optional bool py_generic_services = 18; + optional bool deprecated = 23; + optional bool cc_enable_arenas = 31; + optional string objc_class_prefix = 36; + optional string csharp_namespace = 37; + repeated UninterpretedOption uninterpreted_option = 999; + + enum OptimizeMode { + + SPEED = 1; + CODE_SIZE = 2; + LITE_RUNTIME = 3; + } + + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + + optional bool message_set_wire_format = 1; + optional bool no_standard_descriptor_accessor = 2; + optional bool deprecated = 3; + optional bool map_entry = 7; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; + + reserved 8; +} + +message FieldOptions { + + optional CType ctype = 1 [default=STRING]; + optional bool packed = 2; + optional JSType jstype = 6 [default=JS_NORMAL]; + optional bool lazy = 5; + optional bool deprecated = 3; + optional bool weak = 10; + repeated UninterpretedOption uninterpreted_option = 999; + + enum CType { + + STRING = 0; + CORD = 1; + STRING_PIECE = 2; + } + + enum JSType { + + JS_NORMAL = 0; + JS_STRING = 1; + JS_NUMBER = 2; + } + + extensions 1000 to max; + + reserved 4; +} + +message OneofOptions { + + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message EnumOptions { + + optional bool allow_alias = 2; + optional bool deprecated = 3; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message EnumValueOptions { + + optional bool deprecated = 1; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message ServiceOptions { + + optional bool deprecated = 33; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message MethodOptions { + + optional bool deprecated = 33; + repeated UninterpretedOption uninterpreted_option = 999; + + extensions 1000 to max; +} + +message UninterpretedOption { + + repeated NamePart name = 2; + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; + + message NamePart { + + required string name_part = 1; + required bool is_extension = 2; + } +} + +message SourceCodeInfo { + + repeated Location location = 1; + + message Location { + + repeated int32 path = 1 [packed=true]; + repeated int32 span = 2 [packed=true]; + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +message GeneratedCodeInfo { + + repeated Annotation annotation = 1; + + message Annotation { + + repeated int32 path = 1 [packed=true]; + optional string source_file = 2; + optional int32 begin = 3; + optional int32 end = 4; + } +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.json new file mode 100644 index 00000000..51adb63d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.json @@ -0,0 +1,20 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "SourceContext": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.proto b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.proto new file mode 100644 index 00000000..584d36ce --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/source_context.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +package google.protobuf; + +message SourceContext { + string file_name = 1; +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.json new file mode 100644 index 00000000..fffa70d9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.json @@ -0,0 +1,202 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "nested": { + "Type": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "fields": { + "rule": "repeated", + "type": "Field", + "id": 2 + }, + "oneofs": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "syntax": { + "type": "Syntax", + "id": 6 + } + } + }, + "Field": { + "fields": { + "kind": { + "type": "Kind", + "id": 1 + }, + "cardinality": { + "type": "Cardinality", + "id": 2 + }, + "number": { + "type": "int32", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + }, + "typeUrl": { + "type": "string", + "id": 6 + }, + "oneofIndex": { + "type": "int32", + "id": 7 + }, + "packed": { + "type": "bool", + "id": 8 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "defaultValue": { + "type": "string", + "id": 11 + } + }, + "nested": { + "Kind": { + "values": { + "TYPE_UNKNOWN": 0, + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Cardinality": { + "values": { + "CARDINALITY_UNKNOWN": 0, + "CARDINALITY_OPTIONAL": 1, + "CARDINALITY_REQUIRED": 2, + "CARDINALITY_REPEATED": 3 + } + } + } + }, + "Enum": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enumvalue": { + "rule": "repeated", + "type": "EnumValue", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + }, + "sourceContext": { + "type": "SourceContext", + "id": 4 + }, + "syntax": { + "type": "Syntax", + "id": 5 + } + } + }, + "EnumValue": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + } + } + }, + "Option": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "Any", + "id": 2 + } + } + }, + "Syntax": { + "values": { + "SYNTAX_PROTO2": 0, + "SYNTAX_PROTO3": 1 + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "SourceContext": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.proto b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.proto new file mode 100644 index 00000000..8ee445bf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/google/protobuf/type.proto @@ -0,0 +1,89 @@ +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +message Type { + + string name = 1; + repeated Field fields = 2; + repeated string oneofs = 3; + repeated Option options = 4; + SourceContext source_context = 5; + Syntax syntax = 6; +} + +message Field { + + Kind kind = 1; + Cardinality cardinality = 2; + int32 number = 3; + string name = 4; + string type_url = 6; + int32 oneof_index = 7; + bool packed = 8; + repeated Option options = 9; + string json_name = 10; + string default_value = 11; + + enum Kind { + + TYPE_UNKNOWN = 0; + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; + TYPE_SINT64 = 18; + } + + enum Cardinality { + + CARDINALITY_UNKNOWN = 0; + CARDINALITY_OPTIONAL = 1; + CARDINALITY_REQUIRED = 2; + CARDINALITY_REPEATED = 3; + } +} + +message Enum { + + string name = 1; + repeated EnumValue enumvalue = 2; + repeated Option options = 3; + SourceContext source_context = 4; + Syntax syntax = 5; +} + +message EnumValue { + + string name = 1; + int32 number = 2; + repeated Option options = 3; +} + +message Option { + + string name = 1; + Any value = 2; +} + +enum Syntax { + + SYNTAX_PROTO2 = 0; + SYNTAX_PROTO3 = 1; +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.d.ts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.d.ts new file mode 100644 index 00000000..75ef433a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.d.ts @@ -0,0 +1,2628 @@ +// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'. + +export as namespace protobuf; + +/** + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param name Short name as in `google/protobuf/[name].proto` or full file name + * @param json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + */ +export function common(name: string, json: { [k: string]: any }): void; + +export namespace common { + + /** Properties of a google.protobuf.Any message. */ + interface IAny { + typeUrl?: string; + bytes?: Uint8Array; + } + + /** Properties of a google.protobuf.Duration message. */ + interface IDuration { + seconds?: number; + nanos?: number; + } + + /** Properties of a google.protobuf.Timestamp message. */ + interface ITimestamp { + seconds?: number; + nanos?: number; + } + + /** Properties of a google.protobuf.Empty message. */ + interface IEmpty { + } + + /** Properties of a google.protobuf.Struct message. */ + interface IStruct { + fields?: { [k: string]: IValue }; + } + + /** Properties of a google.protobuf.Value message. */ + interface IValue { + kind?: string; + nullValue?: 0; + numberValue?: number; + stringValue?: string; + boolValue?: boolean; + structValue?: IStruct; + listValue?: IListValue; + } + + /** Properties of a google.protobuf.ListValue message. */ + interface IListValue { + values?: IValue[]; + } + + /** Properties of a google.protobuf.DoubleValue message. */ + interface IDoubleValue { + value?: number; + } + + /** Properties of a google.protobuf.FloatValue message. */ + interface IFloatValue { + value?: number; + } + + /** Properties of a google.protobuf.Int64Value message. */ + interface IInt64Value { + value?: number; + } + + /** Properties of a google.protobuf.UInt64Value message. */ + interface IUInt64Value { + value?: number; + } + + /** Properties of a google.protobuf.Int32Value message. */ + interface IInt32Value { + value?: number; + } + + /** Properties of a google.protobuf.UInt32Value message. */ + interface IUInt32Value { + value?: number; + } + + /** Properties of a google.protobuf.BoolValue message. */ + interface IBoolValue { + value?: boolean; + } + + /** Properties of a google.protobuf.StringValue message. */ + interface IStringValue { + value?: string; + } + + /** Properties of a google.protobuf.BytesValue message. */ + interface IBytesValue { + value?: Uint8Array; + } + + /** + * Gets the root definition of the specified common proto file. + * + * Bundled definitions are: + * - google/protobuf/any.proto + * - google/protobuf/duration.proto + * - google/protobuf/empty.proto + * - google/protobuf/field_mask.proto + * - google/protobuf/struct.proto + * - google/protobuf/timestamp.proto + * - google/protobuf/wrappers.proto + * + * @param file Proto file name + * @returns Root definition or `null` if not defined + */ + function get(file: string): (INamespace|null); +} + +/** Runtime message from/to plain object converters. */ +export namespace converter { + + /** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ + function fromObject(mtype: Type): Codegen; + + /** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ + function toObject(mtype: Type): Codegen; +} + +/** + * Generates a decoder specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ +export function decoder(mtype: Type): Codegen; + +/** + * Generates an encoder specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ +export function encoder(mtype: Type): Codegen; + +/** Reflected enum. */ +export class Enum extends ReflectionObject { + + /** + * Constructs a new enum instance. + * @param name Unique name within its namespace + * @param [values] Enum values as an object, by name + * @param [options] Declared options + * @param [comment] The comment for this enum + * @param [comments] The value comments for this enum + */ + constructor(name: string, values?: { [k: string]: number }, options?: { [k: string]: any }, comment?: string, comments?: { [k: string]: string }); + + /** Enum values by id. */ + public valuesById: { [k: number]: string }; + + /** Enum values by name. */ + public values: { [k: string]: number }; + + /** Enum comment text. */ + public comment: (string|null); + + /** Value comment texts, if any. */ + public comments: { [k: string]: string }; + + /** Reserved ranges, if any. */ + public reserved: (number[]|string)[]; + + /** + * Constructs an enum from an enum descriptor. + * @param name Enum name + * @param json Enum descriptor + * @returns Created enum + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IEnum): Enum; + + /** + * Converts this enum to an enum descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Enum descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IEnum; + + /** + * Adds a value to this enum. + * @param name Value name + * @param id Value id + * @param [comment] Comment, if any + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ + public add(name: string, id: number, comment?: string): Enum; + + /** + * Removes a value from this enum + * @param name Value name + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ + public remove(name: string): Enum; + + /** + * Tests if the specified id is reserved. + * @param id Id to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedId(id: number): boolean; + + /** + * Tests if the specified name is reserved. + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedName(name: string): boolean; +} + +/** Enum descriptor. */ +export interface IEnum { + + /** Enum values */ + values: { [k: string]: number }; + + /** Enum options */ + options?: { [k: string]: any }; +} + +/** Reflected message field. */ +export class Field extends FieldBase { + + /** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @param name Unique name within its namespace + * @param id Unique id within its namespace + * @param type Value type + * @param [rule="optional"] Field rule + * @param [extend] Extended type if different from parent + * @param [options] Declared options + */ + constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }); + + /** + * Constructs a field from a field descriptor. + * @param name Field name + * @param json Field descriptor + * @returns Created field + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IField): Field; + + /** Determines whether this field is packed. Only relevant when repeated and working with proto2. */ + public readonly packed: boolean; + + /** + * Field decorator (TypeScript). + * @param fieldId Field id + * @param fieldType Field type + * @param [fieldRule="optional"] Field rule + * @param [defaultValue] Default value + * @returns Decorator function + */ + public static d(fieldId: number, fieldType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|object), fieldRule?: ("optional"|"required"|"repeated"), defaultValue?: T): FieldDecorator; + + /** + * Field decorator (TypeScript). + * @param fieldId Field id + * @param fieldType Field type + * @param [fieldRule="optional"] Field rule + * @returns Decorator function + */ + public static d>(fieldId: number, fieldType: (Constructor|string), fieldRule?: ("optional"|"required"|"repeated")): FieldDecorator; +} + +/** Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. */ +export class FieldBase extends ReflectionObject { + + /** + * Not an actual constructor. Use {@link Field} instead. + * @param name Unique name within its namespace + * @param id Unique id within its namespace + * @param type Value type + * @param [rule="optional"] Field rule + * @param [extend] Extended type if different from parent + * @param [options] Declared options + * @param [comment] Comment associated with this field + */ + constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); + + /** Field rule, if any. */ + public rule?: string; + + /** Field type. */ + public type: string; + + /** Unique field id. */ + public id: number; + + /** Extended type if different from parent. */ + public extend?: string; + + /** Whether this field is required. */ + public required: boolean; + + /** Whether this field is optional. */ + public optional: boolean; + + /** Whether this field is repeated. */ + public repeated: boolean; + + /** Whether this field is a map or not. */ + public map: boolean; + + /** Message this field belongs to. */ + public message: (Type|null); + + /** OneOf this field belongs to, if any, */ + public partOf: (OneOf|null); + + /** The field type's default value. */ + public typeDefault: any; + + /** The field's default value on prototypes. */ + public defaultValue: any; + + /** Whether this field's value should be treated as a long. */ + public long: boolean; + + /** Whether this field's value is a buffer. */ + public bytes: boolean; + + /** Resolved type if not a basic type. */ + public resolvedType: (Type|Enum|null); + + /** Sister-field within the extended type if a declaring extension field. */ + public extensionField: (Field|null); + + /** Sister-field within the declaring namespace if an extended field. */ + public declaringField: (Field|null); + + /** Comment for this field. */ + public comment: (string|null); + + /** + * Converts this field to a field descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Field descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IField; + + /** + * Resolves this field's type references. + * @returns `this` + * @throws {Error} If any reference cannot be resolved + */ + public resolve(): Field; +} + +/** Field descriptor. */ +export interface IField { + + /** Field rule */ + rule?: string; + + /** Field type */ + type: string; + + /** Field id */ + id: number; + + /** Field options */ + options?: { [k: string]: any }; +} + +/** Extension field descriptor. */ +export interface IExtensionField extends IField { + + /** Extended type */ + extend: string; +} + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @param prototype Target prototype + * @param fieldName Field name + */ +type FieldDecorator = (prototype: object, fieldName: string) => void; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @param error Error, if any, otherwise `null` + * @param [root] Root, if there hasn't been an error + */ +type LoadCallback = (error: (Error|null), root?: Root) => void; + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param filename One or multiple files to load + * @param root Root namespace, defaults to create a new one if omitted. + * @param callback Callback function + * @see {@link Root#load} + */ +export function load(filename: (string|string[]), root: Root, callback: LoadCallback): void; + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param filename One or multiple files to load + * @param callback Callback function + * @see {@link Root#load} + */ +export function load(filename: (string|string[]), callback: LoadCallback): void; + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @param filename One or multiple files to load + * @param [root] Root namespace, defaults to create a new one if omitted. + * @returns Promise + * @see {@link Root#load} + */ +export function load(filename: (string|string[]), root?: Root): Promise; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param filename One or multiple files to load + * @param [root] Root namespace, defaults to create a new one if omitted. + * @returns Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +export function loadSync(filename: (string|string[]), root?: Root): Root; + +/** Build type, one of `"full"`, `"light"` or `"minimal"`. */ +export const build: string; + +/** Reconfigures the library according to the environment. */ +export function configure(): void; + +/** Reflected map field. */ +export class MapField extends FieldBase { + + /** + * Constructs a new map field instance. + * @param name Unique name within its namespace + * @param id Unique id within its namespace + * @param keyType Key type + * @param type Value type + * @param [options] Declared options + * @param [comment] Comment associated with this field + */ + constructor(name: string, id: number, keyType: string, type: string, options?: { [k: string]: any }, comment?: string); + + /** Key type. */ + public keyType: string; + + /** Resolved key type if not a basic type. */ + public resolvedKeyType: (ReflectionObject|null); + + /** + * Constructs a map field from a map field descriptor. + * @param name Field name + * @param json Map field descriptor + * @returns Created map field + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IMapField): MapField; + + /** + * Converts this map field to a map field descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Map field descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IMapField; + + /** + * Map field decorator (TypeScript). + * @param fieldId Field id + * @param fieldKeyType Field key type + * @param fieldValueType Field value type + * @returns Decorator function + */ + public static d }>(fieldId: number, fieldKeyType: ("int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"), fieldValueType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|object|Constructor<{}>)): FieldDecorator; +} + +/** Map field descriptor. */ +export interface IMapField extends IField { + + /** Key type */ + keyType: string; +} + +/** Extension map field descriptor. */ +export interface IExtensionMapField extends IMapField { + + /** Extended type */ + extend: string; +} + +/** Abstract runtime message. */ +export class Message { + + /** + * Constructs a new message instance. + * @param [properties] Properties to set + */ + constructor(properties?: Properties); + + /** Reference to the reflected type. */ + public static readonly $type: Type; + + /** Reference to the reflected type. */ + public readonly $type: Type; + + /** + * Creates a new message of this type using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create>(this: Constructor, properties?: { [k: string]: any }): Message; + + /** + * Encodes a message of this type. + * @param message Message to encode + * @param [writer] Writer to use + * @returns Writer + */ + public static encode>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Encodes a message of this type preceeded by its length as a varint. + * @param message Message to encode + * @param [writer] Writer to use + * @returns Writer + */ + public static encodeDelimited>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Decodes a message of this type. + * @param reader Reader or buffer to decode + * @returns Decoded message + */ + public static decode>(this: Constructor, reader: (Reader|Uint8Array)): T; + + /** + * Decodes a message of this type preceeded by its length as a varint. + * @param reader Reader or buffer to decode + * @returns Decoded message + */ + public static decodeDelimited>(this: Constructor, reader: (Reader|Uint8Array)): T; + + /** + * Verifies a message of this type. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message instance + */ + public static fromObject>(this: Constructor, object: { [k: string]: any }): T; + + /** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param message Message instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject>(this: Constructor, message: T, options?: IConversionOptions): { [k: string]: any }; + + /** + * Converts this message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Reflected service method. */ +export class Method extends ReflectionObject { + + /** + * Constructs a new service method instance. + * @param name Method name + * @param type Method type, usually `"rpc"` + * @param requestType Request message type + * @param responseType Response message type + * @param [requestStream] Whether the request is streamed + * @param [responseStream] Whether the response is streamed + * @param [options] Declared options + * @param [comment] The comment for this method + */ + constructor(name: string, type: (string|undefined), requestType: string, responseType: string, requestStream?: (boolean|{ [k: string]: any }), responseStream?: (boolean|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); + + /** Method type. */ + public type: string; + + /** Request type. */ + public requestType: string; + + /** Whether requests are streamed or not. */ + public requestStream?: boolean; + + /** Response type. */ + public responseType: string; + + /** Whether responses are streamed or not. */ + public responseStream?: boolean; + + /** Resolved request type. */ + public resolvedRequestType: (Type|null); + + /** Resolved response type. */ + public resolvedResponseType: (Type|null); + + /** Comment for this method */ + public comment: (string|null); + + /** + * Constructs a method from a method descriptor. + * @param name Method name + * @param json Method descriptor + * @returns Created method + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IMethod): Method; + + /** + * Converts this method to a method descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Method descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IMethod; +} + +/** Method descriptor. */ +export interface IMethod { + + /** Method type */ + type?: string; + + /** Request type */ + requestType: string; + + /** Response type */ + responseType: string; + + /** Whether requests are streamed */ + requestStream?: boolean; + + /** Whether responses are streamed */ + responseStream?: boolean; + + /** Method options */ + options?: { [k: string]: any }; +} + +/** Reflected namespace. */ +export class Namespace extends NamespaceBase { + + /** + * Constructs a new namespace instance. + * @param name Namespace name + * @param [options] Declared options + */ + constructor(name: string, options?: { [k: string]: any }); + + /** + * Constructs a namespace from JSON. + * @param name Namespace name + * @param json JSON object + * @returns Created namespace + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: { [k: string]: any }): Namespace; + + /** + * Converts an array of reflection objects to JSON. + * @param array Object array + * @param [toJSONOptions] JSON conversion options + * @returns JSON object or `undefined` when array is empty + */ + public static arrayToJSON(array: ReflectionObject[], toJSONOptions?: IToJSONOptions): ({ [k: string]: any }|undefined); + + /** + * Tests if the specified id is reserved. + * @param reserved Array of reserved ranges and names + * @param id Id to test + * @returns `true` if reserved, otherwise `false` + */ + public static isReservedId(reserved: ((number[]|string)[]|undefined), id: number): boolean; + + /** + * Tests if the specified name is reserved. + * @param reserved Array of reserved ranges and names + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + public static isReservedName(reserved: ((number[]|string)[]|undefined), name: string): boolean; +} + +/** Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. */ +export abstract class NamespaceBase extends ReflectionObject { + + /** Nested objects by name. */ + public nested?: { [k: string]: ReflectionObject }; + + /** Nested objects of this namespace as an array for iteration. */ + public readonly nestedArray: ReflectionObject[]; + + /** + * Converts this namespace to a namespace descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Namespace descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): INamespace; + + /** + * Adds nested objects to this namespace from nested object descriptors. + * @param nestedJson Any nested object descriptors + * @returns `this` + */ + public addJSON(nestedJson: { [k: string]: AnyNestedObject }): Namespace; + + /** + * Gets the nested object of the specified name. + * @param name Nested object name + * @returns The reflection object or `null` if it doesn't exist + */ + public get(name: string): (ReflectionObject|null); + + /** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param name Nested enum name + * @returns Enum values + * @throws {Error} If there is no such enum + */ + public getEnum(name: string): { [k: string]: number }; + + /** + * Adds a nested object to this namespace. + * @param object Nested object to add + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ + public add(object: ReflectionObject): Namespace; + + /** + * Removes a nested object from this namespace. + * @param object Nested object to remove + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ + public remove(object: ReflectionObject): Namespace; + + /** + * Defines additial namespaces within this one if not yet existing. + * @param path Path to create + * @param [json] Nested types to create from JSON + * @returns Pointer to the last namespace created or `this` if path is empty + */ + public define(path: (string|string[]), json?: any): Namespace; + + /** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns `this` + */ + public resolveAll(): Namespace; + + /** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param path Path to look up + * @param filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns Looked up object or `null` if none could be found + */ + public lookup(path: (string|string[]), filterTypes: (any|any[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); + + /** + * Looks up the reflection object at the specified path, relative to this namespace. + * @param path Path to look up + * @param [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns Looked up object or `null` if none could be found + */ + public lookup(path: (string|string[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); + + /** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up type + * @throws {Error} If `path` does not point to a type + */ + public lookupType(path: (string|string[])): Type; + + /** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up enum + * @throws {Error} If `path` does not point to an enum + */ + public lookupEnum(path: (string|string[])): Enum; + + /** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ + public lookupTypeOrEnum(path: (string|string[])): Type; + + /** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param path Path to look up + * @returns Looked up service + * @throws {Error} If `path` does not point to a service + */ + public lookupService(path: (string|string[])): Service; +} + +/** Namespace descriptor. */ +export interface INamespace { + + /** Namespace options */ + options?: { [k: string]: any }; + + /** Nested object descriptors */ + nested?: { [k: string]: AnyNestedObject }; +} + +/** Any extension field descriptor. */ +type AnyExtensionField = (IExtensionField|IExtensionMapField); + +/** Any nested object descriptor. */ +type AnyNestedObject = (IEnum|IType|IService|AnyExtensionField|INamespace); + +/** Base class of all reflection objects. */ +export abstract class ReflectionObject { + + /** Options. */ + public options?: { [k: string]: any }; + + /** Unique name within its namespace. */ + public name: string; + + /** Parent namespace. */ + public parent: (Namespace|null); + + /** Whether already resolved or not. */ + public resolved: boolean; + + /** Comment text, if any. */ + public comment: (string|null); + + /** Defining file name. */ + public filename: (string|null); + + /** Reference to the root namespace. */ + public readonly root: Root; + + /** Full name including leading dot. */ + public readonly fullName: string; + + /** + * Converts this reflection object to its descriptor representation. + * @returns Descriptor + */ + public toJSON(): { [k: string]: any }; + + /** + * Called when this object is added to a parent. + * @param parent Parent added to + */ + public onAdd(parent: ReflectionObject): void; + + /** + * Called when this object is removed from a parent. + * @param parent Parent removed from + */ + public onRemove(parent: ReflectionObject): void; + + /** + * Resolves this objects type references. + * @returns `this` + */ + public resolve(): ReflectionObject; + + /** + * Gets an option value. + * @param name Option name + * @returns Option value or `undefined` if not set + */ + public getOption(name: string): any; + + /** + * Sets an option. + * @param name Option name + * @param value Option value + * @param [ifNotSet] Sets the option only if it isn't currently set + * @returns `this` + */ + public setOption(name: string, value: any, ifNotSet?: boolean): ReflectionObject; + + /** + * Sets multiple options. + * @param options Options to set + * @param [ifNotSet] Sets an option only if it isn't currently set + * @returns `this` + */ + public setOptions(options: { [k: string]: any }, ifNotSet?: boolean): ReflectionObject; + + /** + * Converts this instance to its string representation. + * @returns Class name[, space, full name] + */ + public toString(): string; +} + +/** Reflected oneof. */ +export class OneOf extends ReflectionObject { + + /** + * Constructs a new oneof instance. + * @param name Oneof name + * @param [fieldNames] Field names + * @param [options] Declared options + * @param [comment] Comment associated with this field + */ + constructor(name: string, fieldNames?: (string[]|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); + + /** Field names that belong to this oneof. */ + public oneof: string[]; + + /** Fields that belong to this oneof as an array for iteration. */ + public readonly fieldsArray: Field[]; + + /** Comment for this field. */ + public comment: (string|null); + + /** + * Constructs a oneof from a oneof descriptor. + * @param name Oneof name + * @param json Oneof descriptor + * @returns Created oneof + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IOneOf): OneOf; + + /** + * Converts this oneof to a oneof descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Oneof descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IOneOf; + + /** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param field Field to add + * @returns `this` + */ + public add(field: Field): OneOf; + + /** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param field Field to remove + * @returns `this` + */ + public remove(field: Field): OneOf; + + /** + * OneOf decorator (TypeScript). + * @param fieldNames Field names + * @returns Decorator function + */ + public static d(...fieldNames: string[]): OneOfDecorator; +} + +/** Oneof descriptor. */ +export interface IOneOf { + + /** Oneof field names */ + oneof: string[]; + + /** Oneof options */ + options?: { [k: string]: any }; +} + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @param prototype Target prototype + * @param oneofName OneOf name + */ +type OneOfDecorator = (prototype: object, oneofName: string) => void; + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param source Source contents + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Parser result + */ +export function parse(source: string, options?: IParseOptions): IParserResult; + +/** Result object returned from {@link parse}. */ +export interface IParserResult { + + /** Package name, if declared */ + package: (string|undefined); + + /** Imports, if any */ + imports: (string[]|undefined); + + /** Weak imports, if any */ + weakImports: (string[]|undefined); + + /** Syntax, if specified (either `"proto2"` or `"proto3"`) */ + syntax: (string|undefined); + + /** Populated root instance */ + root: Root; +} + +/** Options modifying the behavior of {@link parse}. */ +export interface IParseOptions { + + /** Keeps field casing instead of converting to camel case */ + keepCase?: boolean; + + /** Recognize double-slash comments in addition to doc-block comments. */ + alternateCommentMode?: boolean; +} + +/** Options modifying the behavior of JSON serialization. */ +export interface IToJSONOptions { + + /** Serializes comments. */ + keepComments?: boolean; +} + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param source Source contents + * @param root Root to populate + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Parser result + */ +export function parse(source: string, root: Root, options?: IParseOptions): IParserResult; + +/** Wire format reader using `Uint8Array` if available, otherwise `Array`. */ +export class Reader { + + /** + * Constructs a new reader instance using the specified buffer. + * @param buffer Buffer to read from + */ + constructor(buffer: Uint8Array); + + /** Read buffer. */ + public buf: Uint8Array; + + /** Read buffer position. */ + public pos: number; + + /** Read buffer length. */ + public len: number; + + /** + * Creates a new reader using the specified buffer. + * @param buffer Buffer to read from + * @returns A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ + public static create(buffer: (Uint8Array|Buffer)): (Reader|BufferReader); + + /** + * Reads a varint as an unsigned 32 bit value. + * @returns Value read + */ + public uint32(): number; + + /** + * Reads a varint as a signed 32 bit value. + * @returns Value read + */ + public int32(): number; + + /** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns Value read + */ + public sint32(): number; + + /** + * Reads a varint as a boolean. + * @returns Value read + */ + public bool(): boolean; + + /** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns Value read + */ + public fixed32(): number; + + /** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns Value read + */ + public sfixed32(): number; + + /** + * Reads a float (32 bit) as a number. + * @returns Value read + */ + public float(): number; + + /** + * Reads a double (64 bit float) as a number. + * @returns Value read + */ + public double(): number; + + /** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns Value read + */ + public bytes(): Uint8Array; + + /** + * Reads a string preceeded by its byte length as a varint. + * @returns Value read + */ + public string(): string; + + /** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param [length] Length if known, otherwise a varint is assumed + * @returns `this` + */ + public skip(length?: number): Reader; + + /** + * Skips the next element of the specified wire type. + * @param wireType Wire type received + * @returns `this` + */ + public skipType(wireType: number): Reader; +} + +/** Wire format reader using node buffers. */ +export class BufferReader extends Reader { + + /** + * Constructs a new buffer reader instance. + * @param buffer Buffer to read from + */ + constructor(buffer: Buffer); + + /** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns Value read + */ + public bytes(): Buffer; +} + +/** Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. */ +export class Root extends NamespaceBase { + + /** + * Constructs a new root namespace instance. + * @param [options] Top level options + */ + constructor(options?: { [k: string]: any }); + + /** Deferred extension fields. */ + public deferred: Field[]; + + /** Resolved file names of loaded files. */ + public files: string[]; + + /** + * Loads a namespace descriptor into a root namespace. + * @param json Nameespace descriptor + * @param [root] Root namespace, defaults to create a new one if omitted + * @returns Root namespace + */ + public static fromJSON(json: INamespace, root?: Root): Root; + + /** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @param origin The file name of the importing file + * @param target The file name being imported + * @returns Resolved path to `target` or `null` to skip the file + */ + public resolvePath(origin: string, target: string): (string|null); + + /** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param filename Names of one or multiple files to load + * @param options Parse options + * @param callback Callback function + */ + public load(filename: (string|string[]), options: IParseOptions, callback: LoadCallback): void; + + /** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param filename Names of one or multiple files to load + * @param callback Callback function + */ + public load(filename: (string|string[]), callback: LoadCallback): void; + + /** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @param filename Names of one or multiple files to load + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Promise + */ + public load(filename: (string|string[]), options?: IParseOptions): Promise; + + /** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @param filename Names of one or multiple files to load + * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ + public loadSync(filename: (string|string[]), options?: IParseOptions): Root; +} + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + */ +export let roots: { [k: string]: Root }; + +/** Streaming RPC helpers. */ +export namespace rpc { + + /** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @param error Error, if any + * @param [response] Response message + */ + type ServiceMethodCallback> = (error: (Error|null), response?: TRes) => void; + + /** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @param request Request message or plain object + * @param [callback] Node-style callback called with the error, if any, and the response message + * @returns Promise if `callback` has been omitted, otherwise `undefined` + */ + type ServiceMethod, TRes extends Message> = (request: (TReq|Properties), callback?: rpc.ServiceMethodCallback) => Promise>; + + /** An RPC service as returned by {@link Service#create}. */ + class Service extends util.EventEmitter { + + /** + * Constructs a new RPC service instance. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** RPC implementation. Becomes `null` once the service is ended. */ + public rpcImpl: (RPCImpl|null); + + /** Whether requests are length-delimited. */ + public requestDelimited: boolean; + + /** Whether responses are length-delimited. */ + public responseDelimited: boolean; + + /** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param method Reflected or static method + * @param requestCtor Request constructor + * @param responseCtor Response constructor + * @param request Request message or plain object + * @param callback Service callback + */ + public rpcCall, TRes extends Message>(method: (Method|rpc.ServiceMethod), requestCtor: Constructor, responseCtor: Constructor, request: (TReq|Properties), callback: rpc.ServiceMethodCallback): void; + + /** + * Ends this service and emits the `end` event. + * @param [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns `this` + */ + public end(endedByRPC?: boolean): rpc.Service; + } +} + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @param method Reflected or static method being called + * @param requestData Request data + * @param callback Callback function + */ +type RPCImpl = (method: (Method|rpc.ServiceMethod, Message<{}>>), requestData: Uint8Array, callback: RPCImplCallback) => void; + +/** + * Node-style callback as used by {@link RPCImpl}. + * @param error Error, if any, otherwise `null` + * @param [response] Response data or `null` to signal end of stream, if there hasn't been an error + */ +type RPCImplCallback = (error: (Error|null), response?: (Uint8Array|null)) => void; + +/** Reflected service. */ +export class Service extends NamespaceBase { + + /** + * Constructs a new service instance. + * @param name Service name + * @param [options] Service options + * @throws {TypeError} If arguments are invalid + */ + constructor(name: string, options?: { [k: string]: any }); + + /** Service methods. */ + public methods: { [k: string]: Method }; + + /** + * Constructs a service from a service descriptor. + * @param name Service name + * @param json Service descriptor + * @returns Created service + * @throws {TypeError} If arguments are invalid + */ + public static fromJSON(name: string, json: IService): Service; + + /** + * Converts this service to a service descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Service descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IService; + + /** Methods of this service as an array for iteration. */ + public readonly methodsArray: Method[]; + + /** + * Creates a runtime service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public create(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): rpc.Service; +} + +/** Service descriptor. */ +export interface IService extends INamespace { + + /** Method descriptors */ + methods: { [k: string]: IMethod }; +} + +/** + * Gets the next token and advances. + * @returns Next token or `null` on eof + */ +type TokenizerHandleNext = () => (string|null); + +/** + * Peeks for the next token. + * @returns Next token or `null` on eof + */ +type TokenizerHandlePeek = () => (string|null); + +/** + * Pushes a token back to the stack. + * @param token Token + */ +type TokenizerHandlePush = (token: string) => void; + +/** + * Skips the next token. + * @param expected Expected token + * @param [optional=false] If optional + * @returns Whether the token matched + * @throws {Error} If the token didn't match and is not optional + */ +type TokenizerHandleSkip = (expected: string, optional?: boolean) => boolean; + +/** + * Gets the comment on the previous line or, alternatively, the line comment on the specified line. + * @param [line] Line number + * @returns Comment text or `null` if none + */ +type TokenizerHandleCmnt = (line?: number) => (string|null); + +/** Handle object returned from {@link tokenize}. */ +export interface ITokenizerHandle { + + /** Gets the next token and advances (`null` on eof) */ + next: TokenizerHandleNext; + + /** Peeks for the next token (`null` on eof) */ + peek: TokenizerHandlePeek; + + /** Pushes a token back to the stack */ + push: TokenizerHandlePush; + + /** Skips a token, returns its presence and advances or, if non-optional and not present, throws */ + skip: TokenizerHandleSkip; + + /** Gets the comment on the previous line or the line comment on the specified line, if any */ + cmnt: TokenizerHandleCmnt; + + /** Current line number */ + line: number; +} + +/** + * Tokenizes the given .proto source and returns an object with useful utility functions. + * @param source Source contents + * @param alternateCommentMode Whether we should activate alternate comment parsing mode. + * @returns Tokenizer handle + */ +export function tokenize(source: string, alternateCommentMode: boolean): ITokenizerHandle; + +export namespace tokenize { + + /** + * Unescapes a string. + * @param str String to unescape + * @returns Unescaped string + */ + function unescape(str: string): string; +} + +/** Reflected message type. */ +export class Type extends NamespaceBase { + + /** + * Constructs a new reflected message type instance. + * @param name Message name + * @param [options] Declared options + */ + constructor(name: string, options?: { [k: string]: any }); + + /** Message fields. */ + public fields: { [k: string]: Field }; + + /** Oneofs declared within this namespace, if any. */ + public oneofs: { [k: string]: OneOf }; + + /** Extension ranges, if any. */ + public extensions: number[][]; + + /** Reserved ranges, if any. */ + public reserved: (number[]|string)[]; + + /** Message fields by id. */ + public readonly fieldsById: { [k: number]: Field }; + + /** Fields of this message as an array for iteration. */ + public readonly fieldsArray: Field[]; + + /** Oneofs of this message as an array for iteration. */ + public readonly oneofsArray: OneOf[]; + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + */ + public ctor: Constructor<{}>; + + /** + * Generates a constructor function for the specified type. + * @param mtype Message type + * @returns Codegen instance + */ + public static generateConstructor(mtype: Type): Codegen; + + /** + * Creates a message type from a message type descriptor. + * @param name Message name + * @param json Message type descriptor + * @returns Created message type + */ + public static fromJSON(name: string, json: IType): Type; + + /** + * Converts this message type to a message type descriptor. + * @param [toJSONOptions] JSON conversion options + * @returns Message type descriptor + */ + public toJSON(toJSONOptions?: IToJSONOptions): IType; + + /** + * Adds a nested object to this type. + * @param object Nested object to add + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ + public add(object: ReflectionObject): Type; + + /** + * Removes a nested object from this type. + * @param object Nested object to remove + * @returns `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ + public remove(object: ReflectionObject): Type; + + /** + * Tests if the specified id is reserved. + * @param id Id to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedId(id: number): boolean; + + /** + * Tests if the specified name is reserved. + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + public isReservedName(name: string): boolean; + + /** + * Creates a new message of this type using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public create(properties?: { [k: string]: any }): Message<{}>; + + /** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns `this` + */ + public setup(): Type; + + /** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param message Message instance or plain object + * @param [writer] Writer to encode to + * @returns writer + */ + public encode(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param message Message instance or plain object + * @param [writer] Writer to encode to + * @returns writer + */ + public encodeDelimited(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; + + /** + * Decodes a message of this type. + * @param reader Reader or buffer to decode from + * @param [length] Length of the message, if known beforehand + * @returns Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ + public decode(reader: (Reader|Uint8Array), length?: number): Message<{}>; + + /** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param reader Reader or buffer to decode from + * @returns Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ + public decodeDelimited(reader: (Reader|Uint8Array)): Message<{}>; + + /** + * Verifies that field values are valid and that required fields are present. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public verify(message: { [k: string]: any }): (null|string); + + /** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param object Plain object to convert + * @returns Message instance + */ + public fromObject(object: { [k: string]: any }): Message<{}>; + + /** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param message Message instance + * @param [options] Conversion options + * @returns Plain object + */ + public toObject(message: Message<{}>, options?: IConversionOptions): { [k: string]: any }; + + /** + * Type decorator (TypeScript). + * @param [typeName] Type name, defaults to the constructor's name + * @returns Decorator function + */ + public static d>(typeName?: string): TypeDecorator; +} + +/** Message type descriptor. */ +export interface IType extends INamespace { + + /** Oneof descriptors */ + oneofs?: { [k: string]: IOneOf }; + + /** Field descriptors */ + fields: { [k: string]: IField }; + + /** Extension ranges */ + extensions?: number[][]; + + /** Reserved ranges */ + reserved?: number[][]; + + /** Whether a legacy group or not */ + group?: boolean; +} + +/** Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. */ +export interface IConversionOptions { + + /** + * Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + */ + longs?: Function; + + /** + * Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + */ + enums?: Function; + + /** + * Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + */ + bytes?: Function; + + /** Also sets default values on the resulting object */ + defaults?: boolean; + + /** Sets empty arrays for missing repeated fields even if `defaults=false` */ + arrays?: boolean; + + /** Sets empty objects for missing map fields even if `defaults=false` */ + objects?: boolean; + + /** Includes virtual oneof properties set to the present field's name, if any */ + oneofs?: boolean; + + /** Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings */ + json?: boolean; +} + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @param target Target constructor + */ +type TypeDecorator> = (target: Constructor) => void; + +/** Common type constants. */ +export namespace types { + + /** Basic type wire types. */ + const basic: { + "double": number, + "float": number, + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": number, + "string": number, + "bytes": number + }; + + /** Basic type defaults. */ + const defaults: { + "double": number, + "float": number, + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": boolean, + "string": string, + "bytes": number[], + "message": null + }; + + /** Basic long type wire types. */ + const long: { + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number + }; + + /** Allowed types for map keys with their associated wire type. */ + const mapKey: { + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": number, + "string": number + }; + + /** Allowed types for packed repeated fields with their associated wire type. */ + const packed: { + "double": number, + "float": number, + "int32": number, + "uint32": number, + "sint32": number, + "fixed32": number, + "sfixed32": number, + "int64": number, + "uint64": number, + "sint64": number, + "fixed64": number, + "sfixed64": number, + "bool": number + }; +} + +/** Constructor type. */ +export interface Constructor extends Function { + new(...params: any[]): T; prototype: T; +} + +/** Properties type. */ +type Properties = { [P in keyof T]?: T[P] }; + +/** Type that is convertible to array. */ +export interface ToArray { + toArray(): T[]; +} + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + */ +export interface Buffer extends Uint8Array { +} + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @returns Set field name, if any + */ +type OneOfGetter = () => (string|undefined); + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @param value Field name + */ +type OneOfSetter = (value: (string|undefined)) => void; + +/** Various utility functions. */ +export namespace util { + + /** Helper class for working with the low and high bits of a 64 bit value. */ + class LongBits { + + /** + * Constructs new long bits. + * @param lo Low 32 bits, unsigned + * @param hi High 32 bits, unsigned + */ + constructor(lo: number, hi: number); + + /** Low bits. */ + public lo: number; + + /** High bits. */ + public hi: number; + + /** Zero bits. */ + public static zero: util.LongBits; + + /** Zero hash. */ + public static zeroHash: string; + + /** + * Constructs new long bits from the specified number. + * @param value Value + * @returns Instance + */ + public static fromNumber(value: number): util.LongBits; + + /** + * Constructs new long bits from a number, long or string. + * @param value Value + * @returns Instance + */ + public static from(value: (number|string)): util.LongBits; + + /** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param [unsigned=false] Whether unsigned or not + * @returns Possibly unsafe number + */ + public toNumber(unsigned?: boolean): number; + + /** + * Constructs new long bits from the specified 8 characters long hash. + * @param hash Hash + * @returns Bits + */ + public static fromHash(hash: string): util.LongBits; + + /** + * Converts this long bits to a 8 characters long hash. + * @returns Hash + */ + public toHash(): string; + + /** + * Zig-zag encodes this long bits. + * @returns `this` + */ + public zzEncode(): util.LongBits; + + /** + * Zig-zag decodes this long bits. + * @returns `this` + */ + public zzDecode(): util.LongBits; + + /** + * Calculates the length of this longbits when encoded as a varint. + * @returns Length + */ + public length(): number; + } + + /** An immuable empty array. */ + const emptyArray: any[]; + + /** An immutable empty object. */ + const emptyObject: object; + + /** Whether running within node or not. */ + const isNode: boolean; + + /** + * Tests if the specified value is an integer. + * @param value Value to test + * @returns `true` if the value is an integer + */ + function isInteger(value: any): boolean; + + /** + * Tests if the specified value is a string. + * @param value Value to test + * @returns `true` if the value is a string + */ + function isString(value: any): boolean; + + /** + * Tests if the specified value is a non-null object. + * @param value Value to test + * @returns `true` if the value is a non-null object + */ + function isObject(value: any): boolean; + + /** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @param obj Plain object or message instance + * @param prop Property name + * @returns `true` if considered to be present, otherwise `false` + */ + function isset(obj: object, prop: string): boolean; + + /** + * Checks if a property on a message is considered to be present. + * @param obj Plain object or message instance + * @param prop Property name + * @returns `true` if considered to be present, otherwise `false` + */ + function isSet(obj: object, prop: string): boolean; + + /** Node's Buffer class if available. */ + let Buffer: Constructor; + + /** + * Creates a new buffer of whatever type supported by the environment. + * @param [sizeOrArray=0] Buffer size or number array + * @returns Buffer + */ + function newBuffer(sizeOrArray?: (number|number[])): (Uint8Array|Buffer); + + /** Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. */ + let Array: Constructor; + + /** Regular expression used to verify 2 bit (`bool`) map keys. */ + const key2Re: RegExp; + + /** Regular expression used to verify 32 bit (`int32` etc.) map keys. */ + const key32Re: RegExp; + + /** Regular expression used to verify 64 bit (`int64` etc.) map keys. */ + const key64Re: RegExp; + + /** + * Merges the properties of the source object into the destination object. + * @param dst Destination object + * @param src Source object + * @param [ifNotSet=false] Merges only if the key is not already set + * @returns Destination object + */ + function merge(dst: { [k: string]: any }, src: { [k: string]: any }, ifNotSet?: boolean): { [k: string]: any }; + + /** + * Converts the first character of a string to lower case. + * @param str String to convert + * @returns Converted string + */ + function lcFirst(str: string): string; + + /** + * Creates a custom error constructor. + * @param name Error name + * @returns Custom error constructor + */ + function newError(name: string): Constructor; + + /** Error subclass indicating a protocol specifc error. */ + class ProtocolError> extends Error { + + /** + * Constructs a new protocol error. + * @param message Error message + * @param [properties] Additional properties + */ + constructor(message: string, properties?: { [k: string]: any }); + + /** So far decoded message instance. */ + public instance: Message; + } + + /** + * Builds a getter for a oneof's present field name. + * @param fieldNames Field names + * @returns Unbound getter + */ + function oneOfGetter(fieldNames: string[]): OneOfGetter; + + /** + * Builds a setter for a oneof's present field name. + * @param fieldNames Field names + * @returns Unbound setter + */ + function oneOfSetter(fieldNames: string[]): OneOfSetter; + + /** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ + let toJSONOptions: IConversionOptions; + + /** Node's fs module if available. */ + let fs: { [k: string]: any }; + + /** + * Converts an object's values to an array. + * @param object Object to convert + * @returns Converted array + */ + function toArray(object: { [k: string]: any }): any[]; + + /** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param array Array to convert + * @returns Converted object + */ + function toObject(array: any[]): { [k: string]: any }; + + /** + * Tests whether the specified name is a reserved word in JS. + * @param name Name to test + * @returns `true` if reserved, otherwise `false` + */ + function isReserved(name: string): boolean; + + /** + * Returns a safe property accessor for the specified property name. + * @param prop Property name + * @returns Safe accessor + */ + function safeProp(prop: string): string; + + /** + * Converts the first character of a string to upper case. + * @param str String to convert + * @returns Converted string + */ + function ucFirst(str: string): string; + + /** + * Converts a string to camel case. + * @param str String to convert + * @returns Converted string + */ + function camelCase(str: string): string; + + /** + * Compares reflected fields by id. + * @param a First field + * @param b Second field + * @returns Comparison value + */ + function compareFieldsById(a: Field, b: Field): number; + + /** + * Decorator helper for types (TypeScript). + * @param ctor Constructor function + * @param [typeName] Type name, defaults to the constructor's name + * @returns Reflected type + */ + function decorateType>(ctor: Constructor, typeName?: string): Type; + + /** + * Decorator helper for enums (TypeScript). + * @param object Enum object + * @returns Reflected enum + */ + function decorateEnum(object: object): Enum; + + /** Decorator root (TypeScript). */ + let decorateRoot: Root; + + /** + * Returns a promise from a node-style callback function. + * @param fn Function to call + * @param ctx Function context + * @param params Function arguments + * @returns Promisified function + */ + function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise; + + /** A minimal base64 implementation for number arrays. */ + namespace base64 { + + /** + * Calculates the byte length of a base64 encoded string. + * @param string Base64 encoded string + * @returns Byte length + */ + function length(string: string): number; + + /** + * Encodes a buffer to a base64 encoded string. + * @param buffer Source buffer + * @param start Source start + * @param end Source end + * @returns Base64 encoded string + */ + function encode(buffer: Uint8Array, start: number, end: number): string; + + /** + * Decodes a base64 encoded string to a buffer. + * @param string Source string + * @param buffer Destination buffer + * @param offset Destination offset + * @returns Number of bytes written + * @throws {Error} If encoding is invalid + */ + function decode(string: string, buffer: Uint8Array, offset: number): number; + + /** + * Tests if the specified string appears to be base64 encoded. + * @param string String to test + * @returns `true` if probably base64 encoded, otherwise false + */ + function test(string: string): boolean; + } + + /** + * Begins generating a function. + * @param functionParams Function parameter names + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ + function codegen(functionParams: string[], functionName?: string): Codegen; + + namespace codegen { + + /** When set to `true`, codegen will log generated code to console. Useful for debugging. */ + let verbose: boolean; + } + + /** + * Begins generating a function. + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ + function codegen(functionName?: string): Codegen; + + /** A minimal event emitter. */ + class EventEmitter { + + /** Constructs a new event emitter instance. */ + constructor(); + + /** + * Registers an event listener. + * @param evt Event name + * @param fn Listener + * @param [ctx] Listener context + * @returns `this` + */ + public on(evt: string, fn: EventEmitterListener, ctx?: any): this; + + /** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param [evt] Event name. Removes all listeners if omitted. + * @param [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns `this` + */ + public off(evt?: string, fn?: EventEmitterListener): this; + + /** + * Emits an event by calling its listeners with the specified arguments. + * @param evt Event name + * @param args Arguments + * @returns `this` + */ + public emit(evt: string, ...args: any[]): this; + } + + /** Reads / writes floats / doubles from / to buffers. */ + namespace float { + + /** + * Writes a 32 bit float to a buffer using little endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeFloatLE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Writes a 32 bit float to a buffer using big endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeFloatBE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Reads a 32 bit float from a buffer using little endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readFloatLE(buf: Uint8Array, pos: number): number; + + /** + * Reads a 32 bit float from a buffer using big endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readFloatBE(buf: Uint8Array, pos: number): number; + + /** + * Writes a 64 bit double to a buffer using little endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Writes a 64 bit double to a buffer using big endian byte order. + * @param val Value to write + * @param buf Target buffer + * @param pos Target buffer offset + */ + function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void; + + /** + * Reads a 64 bit double from a buffer using little endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readDoubleLE(buf: Uint8Array, pos: number): number; + + /** + * Reads a 64 bit double from a buffer using big endian byte order. + * @param buf Source buffer + * @param pos Source buffer offset + * @returns Value read + */ + function readDoubleBE(buf: Uint8Array, pos: number): number; + } + + /** + * Fetches the contents of a file. + * @param filename File path or url + * @param options Fetch options + * @param callback Callback function + */ + function fetch(filename: string, options: IFetchOptions, callback: FetchCallback): void; + + /** + * Fetches the contents of a file. + * @param path File path or url + * @param callback Callback function + */ + function fetch(path: string, callback: FetchCallback): void; + + /** + * Fetches the contents of a file. + * @param path File path or url + * @param [options] Fetch options + * @returns Promise + */ + function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>; + + /** + * Requires a module only if available. + * @param moduleName Module to require + * @returns Required module if available and not empty, otherwise `null` + */ + function inquire(moduleName: string): object; + + /** A minimal path module to resolve Unix, Windows and URL paths alike. */ + namespace path { + + /** + * Tests if the specified path is absolute. + * @param path Path to test + * @returns `true` if path is absolute + */ + function isAbsolute(path: string): boolean; + + /** + * Normalizes the specified path. + * @param path Path to normalize + * @returns Normalized path + */ + function normalize(path: string): string; + + /** + * Resolves the specified include path against the specified origin path. + * @param originPath Path to the origin file + * @param includePath Include path relative to origin path + * @param [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns Path to the include file + */ + function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string; + } + + /** + * A general purpose buffer pool. + * @param alloc Allocator + * @param slice Slicer + * @param [size=8192] Slab size + * @returns Pooled allocator + */ + function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; + + /** A minimal UTF8 implementation for number arrays. */ + namespace utf8 { + + /** + * Calculates the UTF8 byte length of a string. + * @param string String + * @returns Byte length + */ + function length(string: string): number; + + /** + * Reads UTF8 bytes as a string. + * @param buffer Source buffer + * @param start Source start + * @param end Source end + * @returns String read + */ + function read(buffer: Uint8Array, start: number, end: number): string; + + /** + * Writes a string as UTF8 bytes. + * @param string Source string + * @param buffer Destination buffer + * @param offset Destination offset + * @returns Bytes written + */ + function write(string: string, buffer: Uint8Array, offset: number): number; + } +} + +/** + * Generates a verifier specific to the specified message type. + * @param mtype Message type + * @returns Codegen instance + */ +export function verifier(mtype: Type): Codegen; + +/** Wrappers for common types. */ +export const wrappers: { [k: string]: IWrapper }; + +/** + * From object converter part of an {@link IWrapper}. + * @param object Plain object + * @returns Message instance + */ +type WrapperFromObjectConverter = (this: Type, object: { [k: string]: any }) => Message<{}>; + +/** + * To object converter part of an {@link IWrapper}. + * @param message Message instance + * @param [options] Conversion options + * @returns Plain object + */ +type WrapperToObjectConverter = (this: Type, message: Message<{}>, options?: IConversionOptions) => { [k: string]: any }; + +/** Common type wrapper part of {@link wrappers}. */ +export interface IWrapper { + + /** From object converter */ + fromObject?: WrapperFromObjectConverter; + + /** To object converter */ + toObject?: WrapperToObjectConverter; +} + +/** Wire format writer using `Uint8Array` if available, otherwise `Array`. */ +export class Writer { + + /** Constructs a new writer instance. */ + constructor(); + + /** Current length. */ + public len: number; + + /** Operations head. */ + public head: object; + + /** Operations tail */ + public tail: object; + + /** Linked forked states. */ + public states: (object|null); + + /** + * Creates a new writer. + * @returns A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ + public static create(): (BufferWriter|Writer); + + /** + * Allocates a buffer of the specified size. + * @param size Buffer size + * @returns Buffer + */ + public static alloc(size: number): Uint8Array; + + /** + * Writes an unsigned 32 bit value as a varint. + * @param value Value to write + * @returns `this` + */ + public uint32(value: number): Writer; + + /** + * Writes a signed 32 bit value as a varint. + * @param value Value to write + * @returns `this` + */ + public int32(value: number): Writer; + + /** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param value Value to write + * @returns `this` + */ + public sint32(value: number): Writer; + + /** + * Writes an unsigned 64 bit value as a varint. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public uint64(value: (number|string)): Writer; + + /** + * Writes a signed 64 bit value as a varint. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public int64(value: (number|string)): Writer; + + /** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public sint64(value: (number|string)): Writer; + + /** + * Writes a boolish value as a varint. + * @param value Value to write + * @returns `this` + */ + public bool(value: boolean): Writer; + + /** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param value Value to write + * @returns `this` + */ + public fixed32(value: number): Writer; + + /** + * Writes a signed 32 bit value as fixed 32 bits. + * @param value Value to write + * @returns `this` + */ + public sfixed32(value: number): Writer; + + /** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public fixed64(value: (number|string)): Writer; + + /** + * Writes a signed 64 bit value as fixed 64 bits. + * @param value Value to write + * @returns `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + public sfixed64(value: (number|string)): Writer; + + /** + * Writes a float (32 bit). + * @param value Value to write + * @returns `this` + */ + public float(value: number): Writer; + + /** + * Writes a double (64 bit float). + * @param value Value to write + * @returns `this` + */ + public double(value: number): Writer; + + /** + * Writes a sequence of bytes. + * @param value Buffer or base64 encoded string to write + * @returns `this` + */ + public bytes(value: (Uint8Array|string)): Writer; + + /** + * Writes a string. + * @param value Value to write + * @returns `this` + */ + public string(value: string): Writer; + + /** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns `this` + */ + public fork(): Writer; + + /** + * Resets this instance to the last state. + * @returns `this` + */ + public reset(): Writer; + + /** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns `this` + */ + public ldelim(): Writer; + + /** + * Finishes the write operation. + * @returns Finished buffer + */ + public finish(): Uint8Array; +} + +/** Wire format writer using node buffers. */ +export class BufferWriter extends Writer { + + /** Constructs a new buffer writer instance. */ + constructor(); + + /** + * Finishes the write operation. + * @returns Finished buffer + */ + public finish(): Buffer; + + /** + * Allocates a buffer of the specified size. + * @param size Buffer size + * @returns Buffer + */ + public static alloc(size: number): Buffer; +} + +/** + * Callback as used by {@link util.asPromise}. + * @param error Error, if any + * @param params Additional arguments + */ +type asPromiseCallback = (error: (Error|null), ...params: any[]) => void; + +/** + * Appends code to the function's body or finishes generation. + * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param [formatParams] Format parameters + * @returns Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ +type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function); + +/** + * Event listener as used by {@link util.EventEmitter}. + * @param args Arguments + */ +type EventEmitterListener = (...args: any[]) => void; + +/** + * Node-style callback as used by {@link util.fetch}. + * @param error Error, if any, otherwise `null` + * @param [contents] File contents, if there hasn't been an error + */ +type FetchCallback = (error: Error, contents?: string) => void; + +/** Options as used by {@link util.fetch}. */ +export interface IFetchOptions { + + /** Whether expecting a binary response */ + binary?: boolean; + + /** If `true`, forces the use of XMLHttpRequest */ + xhr?: boolean; +} + +/** + * An allocator as used by {@link util.pool}. + * @param size Buffer size + * @returns Buffer + */ +type PoolAllocator = (size: number) => Uint8Array; + +/** + * A slicer as used by {@link util.pool}. + * @param start Start offset + * @param end End offset + * @returns Buffer slice + */ +type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.js new file mode 100644 index 00000000..042042ae --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/index.js @@ -0,0 +1,4 @@ +// full library entry point. + +"use strict"; +module.exports = require("./src/index"); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.d.ts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.d.ts new file mode 100644 index 00000000..d83e7f99 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.d.ts @@ -0,0 +1,2 @@ +export as namespace protobuf; +export * from "./index"; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.js new file mode 100644 index 00000000..1209e64c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/light.js @@ -0,0 +1,4 @@ +// light library entry point. + +"use strict"; +module.exports = require("./src/index-light"); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.d.ts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.d.ts new file mode 100644 index 00000000..d83e7f99 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.d.ts @@ -0,0 +1,2 @@ +export as namespace protobuf; +export * from "./index"; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.js new file mode 100644 index 00000000..1f35ec99 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/minimal.js @@ -0,0 +1,4 @@ +// minimal library entry point. + +"use strict"; +module.exports = require("./src/index-minimal"); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbjs b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbjs new file mode 100755 index 00000000..73d69afb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbjs @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/..:$basedir_abs/../../../..:$basedir_abs/../../../../../../node_modules" +else + export NODE_PATH="$basedir_abs/..:$basedir_abs/../../../..:$basedir_abs/../../../../../../node_modules:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../bin/pbjs" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../bin/pbjs" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../bin/pbjs" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../bin/pbjs" "$@" +else + exec node "$basedir_abs/../../bin/pbjs" "$@" +fi +# cmd-shim-target=../../bin/pbjs diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbts b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbts new file mode 100755 index 00000000..58830049 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules/.bin/apollo-pbts @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/..:$basedir_abs/../../../..:$basedir_abs/../../../../../../node_modules" +else + export NODE_PATH="$basedir_abs/..:$basedir_abs/../../../..:$basedir_abs/../../../../../../node_modules:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../bin/pbts" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../bin/pbts" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../bin/pbts" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../bin/pbts" "$@" +else + exec node "$basedir_abs/../../bin/pbts" "$@" +fi +# cmd-shim-target=../../bin/pbts diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/package.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/package.json new file mode 100644 index 00000000..56c03ca3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/package.json @@ -0,0 +1,126 @@ +{ + "name": "@apollo/protobufjs", + "version": "1.2.8", + "versionScheme": "~", + "description": "Protocol Buffers for JavaScript (& TypeScript).", + "author": "Daniel Wirtz ", + "license": "BSD-3-Clause", + "repository": { + "type": "git", + "url": "https://github.com/apollographql/protobuf.js.git" + }, + "bugs": "https://github.com/apollographql/protobuf.js/issues", + "homepage": "https://github.com/apollographql/protobuf.js", + "keywords": [ + "protobuf", + "protocol-buffers", + "serialization", + "typescript" + ], + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": "./index.js", + "./minimal": "./minimal.js" + }, + "bin": { + "apollo-pbjs": "bin/pbjs", + "apollo-pbts": "bin/pbts" + }, + "scripts": { + "bench": "node bench", + "build": "gulp --gulpfile scripts/gulpfile.js", + "changelog": "node scripts/changelog -w", + "coverage": "istanbul --config=config/istanbul.json cover node_modules/tape/bin/tape tests/*.js tests/node/*.js", + "docs": "jsdoc -c config/jsdoc.json -R README.md --verbose --pedantic", + "lint": "eslint **/*.js -c config/eslint.json && tslint **/*.d.ts -e **/node_modules/** -t stylish -c config/tslint.json", + "pages": "node scripts/pages", + "prepublish": "node scripts/prepublish", + "postinstall": "node scripts/postinstall", + "prof": "node bench/prof", + "test": "ENABLE_LONG=t tape -r ./lib/tape-adapter tests/*.js tests/node/*.js", + "test-types": "tsc tests/comp_typescript.ts --lib es2015 --strictNullChecks --experimentalDecorators --emitDecoratorMetadata && tsc tests/data/test.js.ts --lib es2015 --noEmit --strictNullChecks && tsc tests/data/rpc.ts --lib es2015 --noEmit --strictNullChecks", + "types": "node bin/pbts --main --global protobuf --out index.d.ts src/ lib/aspromise/index.js lib/base64/index.js lib/codegen/index.js lib/eventemitter/index.js lib/float/index.js lib/fetch/index.js lib/inquire/index.js lib/path/index.js lib/pool/index.js lib/utf8/index.js && npm run test-types", + "make": "npm run test && npm run types && npm run build && npm run lint", + "release": "npm run make && npm run changelog" + }, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "long": "^4.0.0" + }, + "devDependencies": { + "benchmark": "^2.1.4", + "browserify": "^16.2.3", + "browserify-wrap": "^1.0.2", + "bundle-collapser": "^1.3.0", + "chalk": "^2.4.1", + "escodegen": "^1.9.1", + "eslint": "^4.19.1", + "espree": "^3.5.4", + "estraverse": "^4.2.0", + "gh-pages": "^1.2.0", + "git-raw-commits": "^1.3.6", + "git-semver-tags": "^1.3.6", + "glob": "^7.1.2", + "google-protobuf": "^3.5.0", + "gulp": "^4.0.0", + "gulp-header": "^2.0.5", + "gulp-if": "^2.0.1", + "gulp-sourcemaps": "^2.6.4", + "gulp-uglify": "^3.0.0", + "istanbul": "^0.4.5", + "jaguarjs-jsdoc": "github:dcodeIO/jaguarjs-jsdoc", + "jsdoc": "^3.6.3", + "minimist": "^1.2.0", + "reflect-metadata": "^0.1.12", + "semver": "^5.5.0", + "tape": "^4.9.0", + "tmp": "0.0.33", + "tslint": "^5.10.0", + "typescript": "^2.8.3", + "uglify-js": "^3.3.25", + "vinyl-buffer": "^1.0.1", + "vinyl-fs": "^3.0.3", + "vinyl-source-stream": "^2.0.0" + }, + "cliDependencies": [ + "semver", + "chalk", + "glob", + "jsdoc", + "minimist", + "tmp", + "uglify-js", + "espree", + "escodegen", + "estraverse" + ], + "files": [ + "index.js", + "index.d.ts", + "light.d.ts", + "light.js", + "minimal.d.ts", + "minimal.js", + "package-lock.json", + "tsconfig.json", + "scripts/postinstall.js", + "bin/**", + "cli/**", + "dist/**", + "ext/**", + "google/**", + "src/**", + "!**/package-lock.json" + ] +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/scripts/postinstall.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/scripts/postinstall.js new file mode 100644 index 00000000..37898b6d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/scripts/postinstall.js @@ -0,0 +1,35 @@ +"use strict"; + +var path = require("path"), + fs = require("fs"), + pkg = require(path.join(__dirname, "..", "package.json")); + +// ensure that there is a node_modules folder for cli dependencies +try { fs.mkdirSync(path.join(__dirname, "..", "cli", "node_modules")); } catch (e) {/**/} + +// check version scheme used by dependents +if (!pkg.versionScheme) + return; + +var warn = process.stderr.isTTY + ? "\x1b[30m\x1b[43mWARN\x1b[0m \x1b[35m" + path.basename(process.argv[1], ".js") + "\x1b[0m" + : "WARN " + path.basename(process.argv[1], ".js"); + +var basePkg; +try { + basePkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "..", "package.json"))); +} catch (e) { + return; +} + +[ + "dependencies", + "devDependencies", + "optionalDependencies", + "peerDependencies" +] +.forEach(function(check) { + var version = basePkg && basePkg[check] && basePkg[check][pkg.name]; + if (typeof version === "string" && version.charAt(0) !== pkg.versionScheme) + process.stderr.write(pkg.name + " " + warn + " " + pkg.name + "@" + version + " is configured as a dependency of " + basePkg.name + ". use " + pkg.name + "@" + pkg.versionScheme + version.substring(1) + " instead for API compatibility.\n"); +}); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/common.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/common.js new file mode 100644 index 00000000..bc24697d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/common.js @@ -0,0 +1,399 @@ +"use strict"; +module.exports = common; + +var commonRe = /\/|\./; + +/** + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name + * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + * @returns {undefined} + * @property {INamespace} google/protobuf/any.proto Any + * @property {INamespace} google/protobuf/duration.proto Duration + * @property {INamespace} google/protobuf/empty.proto Empty + * @property {INamespace} google/protobuf/field_mask.proto FieldMask + * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue + * @property {INamespace} google/protobuf/timestamp.proto Timestamp + * @property {INamespace} google/protobuf/wrappers.proto Wrappers + * @example + * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) + * protobuf.common("descriptor", descriptorJson); + * + * // manually provides a custom definition (uses my.foo namespace) + * protobuf.common("my/foo/bar.proto", myFooBarJson); + */ +function common(name, json) { + if (!commonRe.test(name)) { + name = "google/protobuf/" + name + ".proto"; + json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; + } + common[name] = json; +} + +// Not provided because of limited use (feel free to discuss or to provide yourself): +// +// google/protobuf/descriptor.proto +// google/protobuf/source_context.proto +// google/protobuf/type.proto +// +// Stripped and pre-parsed versions of these non-bundled files are instead available as part of +// the repository or package within the google/protobuf directory. + +common("any", { + + /** + * Properties of a google.protobuf.Any message. + * @interface IAny + * @type {Object} + * @property {string} [typeUrl] + * @property {Uint8Array} [bytes] + * @memberof common + */ + Any: { + fields: { + type_url: { + type: "string", + id: 1 + }, + value: { + type: "bytes", + id: 2 + } + } + } +}); + +var timeType; + +common("duration", { + + /** + * Properties of a google.protobuf.Duration message. + * @interface IDuration + * @type {Object} + * @property {number} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Duration: timeType = { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } +}); + +common("timestamp", { + + /** + * Properties of a google.protobuf.Timestamp message. + * @interface ITimestamp + * @type {Object} + * @property {number} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Timestamp: timeType +}); + +common("empty", { + + /** + * Properties of a google.protobuf.Empty message. + * @interface IEmpty + * @memberof common + */ + Empty: { + fields: {} + } +}); + +common("struct", { + + /** + * Properties of a google.protobuf.Struct message. + * @interface IStruct + * @type {Object} + * @property {Object.} [fields] + * @memberof common + */ + Struct: { + fields: { + fields: { + keyType: "string", + type: "Value", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Value message. + * @interface IValue + * @type {Object} + * @property {string} [kind] + * @property {0} [nullValue] + * @property {number} [numberValue] + * @property {string} [stringValue] + * @property {boolean} [boolValue] + * @property {IStruct} [structValue] + * @property {IListValue} [listValue] + * @memberof common + */ + Value: { + oneofs: { + kind: { + oneof: [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + fields: { + nullValue: { + type: "NullValue", + id: 1 + }, + numberValue: { + type: "double", + id: 2 + }, + stringValue: { + type: "string", + id: 3 + }, + boolValue: { + type: "bool", + id: 4 + }, + structValue: { + type: "Struct", + id: 5 + }, + listValue: { + type: "ListValue", + id: 6 + } + } + }, + + NullValue: { + values: { + NULL_VALUE: 0 + } + }, + + /** + * Properties of a google.protobuf.ListValue message. + * @interface IListValue + * @type {Object} + * @property {Array.} [values] + * @memberof common + */ + ListValue: { + fields: { + values: { + rule: "repeated", + type: "Value", + id: 1 + } + } + } +}); + +common("wrappers", { + + /** + * Properties of a google.protobuf.DoubleValue message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + DoubleValue: { + fields: { + value: { + type: "double", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.FloatValue message. + * @interface IFloatValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FloatValue: { + fields: { + value: { + type: "float", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int64Value message. + * @interface IInt64Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int64Value: { + fields: { + value: { + type: "int64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt64Value message. + * @interface IUInt64Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt64Value: { + fields: { + value: { + type: "uint64", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.Int32Value message. + * @interface IInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int32Value: { + fields: { + value: { + type: "int32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.UInt32Value message. + * @interface IUInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt32Value: { + fields: { + value: { + type: "uint32", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BoolValue message. + * @interface IBoolValue + * @type {Object} + * @property {boolean} [value] + * @memberof common + */ + BoolValue: { + fields: { + value: { + type: "bool", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.StringValue message. + * @interface IStringValue + * @type {Object} + * @property {string} [value] + * @memberof common + */ + StringValue: { + fields: { + value: { + type: "string", + id: 1 + } + } + }, + + /** + * Properties of a google.protobuf.BytesValue message. + * @interface IBytesValue + * @type {Object} + * @property {Uint8Array} [value] + * @memberof common + */ + BytesValue: { + fields: { + value: { + type: "bytes", + id: 1 + } + } + } +}); + +common("field_mask", { + + /** + * Properties of a google.protobuf.FieldMask message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FieldMask: { + fields: { + paths: { + rule: "repeated", + type: "string", + id: 1 + } + } + } +}); + +/** + * Gets the root definition of the specified common proto file. + * + * Bundled definitions are: + * - google/protobuf/any.proto + * - google/protobuf/duration.proto + * - google/protobuf/empty.proto + * - google/protobuf/field_mask.proto + * - google/protobuf/struct.proto + * - google/protobuf/timestamp.proto + * - google/protobuf/wrappers.proto + * + * @param {string} file Proto file name + * @returns {INamespace|null} Root definition or `null` if not defined + */ +common.get = function get(file) { + return common[file] || null; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/converter.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/converter.js new file mode 100644 index 00000000..92c72055 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/converter.js @@ -0,0 +1,304 @@ +"use strict"; +/** + * Runtime message from/to plain object converters. + * @namespace + */ +var converter = exports; + +var Enum = require("./enum"), + util = require("./util"); + +/** + * Generates a partial value fromObject conveter. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} prop Property reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genValuePartial_fromObject(gen, field, fieldIndex, prop, ref) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + if (ref === undefined) { + ref = "d" + prop; + } + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref); + for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { + if (field.repeated && values[keys[i]] === field.typeDefault) gen + ("default:"); + gen + ("case%j:", keys[i]) + ("case %i:", values[keys[i]]) + ("m%s=%j", prop, values[keys[i]]) + ("break"); + } gen + ("}"); + } else gen + ("if(typeof %s!==\"object\")", ref) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s=types[%i].fromObject(%s)", prop, fieldIndex, ref); + } else { + var isUnsigned = false; + switch (field.type) { + case "double": + case "float": gen + ("m%s=Number(%s)", prop, ref); // also catches "NaN", "Infinity" + break; + case "uint32": + case "fixed32": gen + ("m%s=%s>>>0", prop, ref); + break; + case "int32": + case "sint32": + case "sfixed32": gen + ("m%s=%s|0", prop, ref); + break; + case "uint64": + isUnsigned = true; + // eslint-disable-line no-fallthrough + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(util.Long)") + ("(m%s=util.Long.fromValue(%s)).unsigned=%j", prop, ref, isUnsigned) + ("else if(typeof %s===\"string\")", ref) + ("m%s=parseInt(%s,10)", prop, ref) + ("else if(typeof %s===\"number\")", ref) + ("m%s=%s", prop, ref) + ("else if(typeof %s===\"object\")", ref) + ("m%s=new util.LongBits(%s.low>>>0,%s.high>>>0).toNumber(%s)", prop, ref, ref, isUnsigned ? "true" : ""); + break; + case "bytes": gen + ("if(typeof %s===\"string\")", ref) + ("util.base64.decode(%s,m%s=util.newBuffer(util.base64.length(%s)),0)", ref, prop, ref) + ("else if(%s.length)", ref) + ("m%s=%s", prop, ref); + break; + case "string": gen + ("m%s=String(%s)", prop, ref); + break; + case "bool": gen + ("m%s=Boolean(%s)", prop, ref); + break; + /* default: gen + ("m%s=%s", prop, ref); + break; */ + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a plain object to runtime message converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.fromObject = function fromObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray; + var gen = util.codegen(["d"], mtype.name + "$fromObject") + ("if(d instanceof this.ctor)") + ("return d"); + if (!fields.length) return gen + ("return new this.ctor"); + gen + ("var m=new this.ctor"); + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // Map fields + if (field.map) { gen + ("if(d%s){", prop) + ("if(typeof d%s!==\"object\")", prop) + ("throw TypeError(%j)", field.fullName + ": object expected") + ("m%s={}", prop) + ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); + break; + case "bytes": gen + ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: gen + ("d%s=m%s", prop, prop); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} + +/** + * Generates a runtime message to plain object converter specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +converter.toObject = function toObject(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); + if (!fields.length) + return util.codegen()("return {}"); + var gen = util.codegen(["m", "o"], mtype.name + "$toObject") + ("if(!o)") + ("o={}") + ("var d={}"); + + var repeatedFields = [], + mapFields = [], + normalFields = [], + i = 0; + for (; i < fields.length; ++i) + if (!fields[i].partOf) + ( fields[i].resolve().repeated ? repeatedFields + : fields[i].map ? mapFields + : normalFields).push(fields[i]); + + if (repeatedFields.length) { gen + ("if(o.arrays||o.defaults){"); + for (i = 0; i < repeatedFields.length; ++i) gen + ("d%s=[]", util.safeProp(repeatedFields[i].name)); + gen + ("}"); + } + + if (mapFields.length) { gen + ("if(o.objects||o.defaults){"); + for (i = 0; i < mapFields.length; ++i) gen + ("d%s={}", util.safeProp(mapFields[i].name)); + gen + ("}"); + } + + if (normalFields.length) { gen + ("if(o.defaults){"); + for (i = 0; i < normalFields.length; ++i) { + var field = normalFields[i], + prop = util.safeProp(field.name); + if (field.resolvedType instanceof Enum) gen + ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) gen + ("if(util.Long){") + ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) + ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) + ("}else") + ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen + ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) + ("else{") + ("d%s=%s", prop, arrayDefault) + ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) + ("}"); + } else gen + ("d%s=%j", prop, field.typeDefault); // also messages (=null) + } gen + ("}"); + } + var hasKs2 = false; + for (i = 0; i < fields.length; ++i) { + var field = fields[i], + index = mtype._fieldsArray.indexOf(field), + prop = util.safeProp(field.name); + if (field.map) { + if (!hasKs2) { hasKs2 = true; gen + ("var ks2"); + } gen + ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) + ("d%s={}", prop) + ("for(var j=0;j>>3){"); + + var i = 0; + for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + ref = "m" + util.safeProp(field.name); gen + ("case %i:", field.id); + + // Map fields + if (field.map) { gen + ("r.skip().pos++") // assumes id 1 + key wireType + ("if(%s===util.emptyObject)", ref) + ("%s={}", ref) + ("k=r.%s()", field.keyType) + ("r.pos++"); // assumes id 2 + value wireType + if (types.long[field.keyType] !== undefined) { + if (types.basic[type] === undefined) gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[typeof k===\"object\"?util.longToHash(k):k]=r.%s()", ref, type); + } else { + if (types.basic[type] === undefined) gen + ("%s[k]=types[%i].decode(r,r.uint32())", ref, i); // can't be groups + else gen + ("%s[k]=r.%s()", ref, type); + } + + // Repeated fields + } else if (field.repeated) { gen + + ("if(!(%s&&%s.length))", ref, ref) + ("%s=[]", ref); + + // Packable (always check for forward and backward compatiblity) + if (types.packed[type] !== undefined) gen + ("if((t&7)===2){") + ("var c2=r.uint32()+r.pos") + ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0); + return; + } + var key = (field.id << 3 | 2) >>> 0; + if (field.preEncoded()) { + gen("if (%s instanceof Uint8Array) {", ref) + ("w.uint32(%i)", key) + ("w.bytes(%s)", ref) + ("} else {"); + } + gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, key); + if (field.preEncoded()) { + gen("}") + } +} + +/** + * Generates an encoder specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function encoder(mtype) { + /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ + var gen = util.codegen(["m", "w"], mtype.name + "$encode") + ("if(!w)") + ("w=Writer.create()"); + + var i, ref; + + // "when a message is serialized its known fields should be written sequentially by field number" + var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + index = mtype._fieldsArray.indexOf(field), + type = field.resolvedType instanceof Enum ? "int32" : field.type, + wireType = types.basic[type]; + ref = "m" + util.safeProp(field.name); + + // Map fields + if (field.map) { + gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null + ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); + if (wireType === undefined) gen + ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups + else gen + (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); + gen + ("}") + ("}"); + + // Repeated fields + } else if (field.repeated) { + var arrayRef = ref; + if (field.useToArray()) { + arrayRef = "array" + field.id; + gen("var %s", arrayRef); + gen("if (%s!=null&&%s.toArray) { %s = %s.toArray() } else { %s = %s }", + ref, ref, arrayRef, ref, arrayRef, ref); + } + gen("if(%s!=null&&%s.length){", arrayRef, arrayRef); // !== undefined && !== null + // Packed repeated + if (field.packed && types.packed[type] !== undefined) { gen + + ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) + ("for(var i=0;i<%s.length;++i)", arrayRef) + ("w.%s(%s[i])", type, arrayRef) + ("w.ldelim()"); + + // Non-packed + } else { gen + + ("for(var i=0;i<%s.length;++i)", arrayRef); + if (wireType === undefined) + genTypePartial(gen, field, index, arrayRef + "[i]"); + else gen + ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, arrayRef); + + } gen + ("}"); + + // Non-repeated + } else { + if (field.optional) gen + ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null + + if (wireType === undefined) + genTypePartial(gen, field, index, ref); + else gen + ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); + + } + } + + return gen + ("return w"); + /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/enum.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/enum.js new file mode 100644 index 00000000..b11014be --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/enum.js @@ -0,0 +1,181 @@ +"use strict"; +module.exports = Enum; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; + +var Namespace = require("./namespace"), + util = require("./util"); + +/** + * Constructs a new enum instance. + * @classdesc Reflected enum. + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {Object.} [values] Enum values as an object, by name + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this enum + * @param {Object.} [comments] The value comments for this enum + */ +function Enum(name, values, options, comment, comments) { + ReflectionObject.call(this, name, options); + + if (values && typeof values !== "object") + throw TypeError("values must be an object"); + + /** + * Enum values by id. + * @type {Object.} + */ + this.valuesById = {}; + + /** + * Enum values by name. + * @type {Object.} + */ + this.values = Object.create(this.valuesById); // toJSON, marker + + /** + * Enum comment text. + * @type {string|null} + */ + this.comment = comment; + + /** + * Value comment texts, if any. + * @type {Object.} + */ + this.comments = comments || {}; + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + // Note that values inherit valuesById on their prototype which makes them a TypeScript- + // compatible enum. This is used by pbts to write actual enum definitions that work for + // static and reflection code alike instead of emitting generic object definitions. + + if (values) + for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) + if (typeof values[keys[i]] === "number") // use forward entries only + this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; +} + +/** + * Enum descriptor. + * @interface IEnum + * @property {Object.} values Enum values + * @property {Object.} [options] Enum options + */ + +/** + * Constructs an enum from an enum descriptor. + * @param {string} name Enum name + * @param {IEnum} json Enum descriptor + * @returns {Enum} Created enum + * @throws {TypeError} If arguments are invalid + */ +Enum.fromJSON = function fromJSON(name, json) { + var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + enm.reserved = json.reserved; + return enm; +}; + +/** + * Converts this enum to an enum descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IEnum} Enum descriptor + */ +Enum.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "values" , this.values, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "comment" , keepComments ? this.comment : undefined, + "comments" , keepComments ? this.comments : undefined + ]); +}; + +/** + * Adds a value to this enum. + * @param {string} name Value name + * @param {number} id Value id + * @param {string} [comment] Comment, if any + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a value with this name or id + */ +Enum.prototype.add = function add(name, id, comment) { + // utilized by the parser but not by .fromJSON + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (!util.isInteger(id)) + throw TypeError("id must be an integer"); + + if (this.values[name] !== undefined) + throw Error("duplicate name '" + name + "' in " + this); + + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + + if (this.isReservedName(name)) + throw Error("name '" + name + "' is reserved in " + this); + + if (this.valuesById[id] !== undefined) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name] = id; + } else + this.valuesById[this.values[name] = id] = name; + + this.comments[name] = comment || null; + return this; +}; + +/** + * Removes a value from this enum + * @param {string} name Value name + * @returns {Enum} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `name` is not a name of this enum + */ +Enum.prototype.remove = function remove(name) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + var val = this.values[name]; + if (val == null) + throw Error("name '" + name + "' does not exist in " + this); + + delete this.valuesById[val]; + delete this.values[name]; + delete this.comments[name]; + + return this; +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Enum.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/field.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/field.js new file mode 100644 index 00000000..a448489f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/field.js @@ -0,0 +1,379 @@ +"use strict"; +module.exports = Field; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + +var Enum = require("./enum"), + types = require("./types"), + util = require("./util"); + +var Type; // cyclic + +var ruleRe = /^required|optional|repeated$/; + +/** + * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. + * @name Field + * @classdesc Reflected message field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a field from a field descriptor. + * @param {string} name Field name + * @param {IField} json Field descriptor + * @returns {Field} Created field + * @throws {TypeError} If arguments are invalid + */ +Field.fromJSON = function fromJSON(name, json) { + return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); +}; + +/** + * Not an actual constructor. Use {@link Field} instead. + * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. + * @exports FieldBase + * @extends ReflectionObject + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} type Value type + * @param {string|Object.} [rule="optional"] Field rule + * @param {string|Object.} [extend] Extended type if different from parent + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function Field(name, id, type, rule, extend, options, comment) { + + if (util.isObject(rule)) { + comment = extend; + options = rule; + rule = extend = undefined; + } else if (util.isObject(extend)) { + comment = options; + options = extend; + extend = undefined; + } + + ReflectionObject.call(this, name, options); + + if (!util.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + + if (!util.isString(type)) + throw TypeError("type must be a string"); + + if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + + if (extend !== undefined && !util.isString(extend)) + throw TypeError("extend must be a string"); + + /** + * Field rule, if any. + * @type {string|undefined} + */ + this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON + + /** + * Field type. + * @type {string} + */ + this.type = type; // toJSON + + /** + * Unique field id. + * @type {number} + */ + this.id = id; // toJSON, marker + + /** + * Extended type if different from parent. + * @type {string|undefined} + */ + this.extend = extend || undefined; // toJSON + + /** + * Whether this field is required. + * @type {boolean} + */ + this.required = rule === "required"; + + /** + * Whether this field is optional. + * @type {boolean} + */ + this.optional = !this.required; + + /** + * Whether this field is repeated. + * @type {boolean} + */ + this.repeated = rule === "repeated"; + + /** + * Whether this field is a map or not. + * @type {boolean} + */ + this.map = false; + + /** + * Message this field belongs to. + * @type {Type|null} + */ + this.message = null; + + /** + * OneOf this field belongs to, if any, + * @type {OneOf|null} + */ + this.partOf = null; + + /** + * The field type's default value. + * @type {*} + */ + this.typeDefault = null; + + /** + * The field's default value on prototypes. + * @type {*} + */ + this.defaultValue = null; + + /** + * Whether this field's value should be treated as a long. + * @type {boolean} + */ + this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; + + /** + * Whether this field's value is a buffer. + * @type {boolean} + */ + this.bytes = type === "bytes"; + + /** + * Resolved type if not a basic type. + * @type {Type|Enum|null} + */ + this.resolvedType = null; + + /** + * Sister-field within the extended type if a declaring extension field. + * @type {Field|null} + */ + this.extensionField = null; + + /** + * Sister-field within the declaring namespace if an extended field. + * @type {Field|null} + */ + this.declaringField = null; + + /** + * Internally remembers whether this field is packed. + * @type {boolean|null} + * @private + */ + this._packed = null; + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Determines whether this field is packed. Only relevant when repeated and working with proto2. + * @name Field#packed + * @type {boolean} + * @readonly + */ +Object.defineProperty(Field.prototype, "packed", { + get: function() { + // defaults to packed=true if not explicity set to false + if (this._packed === null) + this._packed = this.getOption("packed") !== false; + return this._packed; + } +}); + +/** + * @override + */ +Field.prototype.setOption = function setOption(name, value, ifNotSet) { + if (name === "packed") // clear cached before setting + this._packed = null; + return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); +}; + +/** + * Field descriptor. + * @interface IField + * @property {string} [rule="optional"] Field rule + * @property {string} type Field type + * @property {number} id Field id + * @property {Object.} [options] Field options + */ + +/** + * Extension field descriptor. + * @interface IExtensionField + * @extends IField + * @property {string} extend Extended type + */ + +/** + * Converts this field to a field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IField} Field descriptor + */ +Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "rule" , this.rule !== "optional" && this.rule || undefined, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Resolves this field's type references. + * @returns {Field} `this` + * @throws {Error} If any reference cannot be resolved + */ +Field.prototype.resolve = function resolve() { + + if (this.resolved) + return this; + + if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type) + this.typeDefault = null; + else // instanceof Enum + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined + } + + // use explicitly set default value if present + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + + // remove unnecessary options + if (this.options) { + if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = undefined; + } + + // convert to internal data type if necesssary + if (this.long) { + this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + + /* istanbul ignore else */ + if (Object.freeze) + Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) + + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util.base64.test(this.typeDefault)) + util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); + else + util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + + // take special care of maps and repeated fields + if (this.map) + this.defaultValue = util.emptyObject; + else if (this.repeated) + this.defaultValue = util.emptyArray; + else + this.defaultValue = this.typeDefault; + + // ensure proper value on prototype + if (this.parent instanceof Type) + this.parent.ctor.prototype[this.name] = this.defaultValue; + + return ReflectionObject.prototype.resolve.call(this); +}; + +Field.prototype.useToArray = function useToArray() { + return !!this.getOption("(js_use_toArray)"); +}; + +Field.prototype.preEncoded = function preEncoded() { + return !!this.getOption("(js_preEncoded)"); +}; + +/** + * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). + * @typedef FieldDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} fieldName Field name + * @returns {undefined} + */ + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @param {T} [defaultValue] Default value + * @returns {FieldDecorator} Decorator function + * @template T extends number | number[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] + */ +Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + + // submessage: decorate the submessage and use its name as the type + if (typeof fieldType === "function") + fieldType = util.decorateType(fieldType).name; + + // enum reference: create a reflected copy of the enum and keep reuseing it + else if (fieldType && typeof fieldType === "object") + fieldType = util.decorateEnum(fieldType).name; + + return function fieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; +}; + +/** + * Field decorator (TypeScript). + * @name Field.d + * @function + * @param {number} fieldId Field id + * @param {Constructor|string} fieldType Field type + * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule + * @returns {FieldDecorator} Decorator function + * @template T extends Message + * @variation 2 + */ +// like Field.d but without a default value + +// Sets up cyclic dependencies (called in index-light) +Field._configure = function configure(Type_) { + Type = Type_; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-light.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-light.js new file mode 100644 index 00000000..32c6a05c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-light.js @@ -0,0 +1,104 @@ +"use strict"; +var protobuf = module.exports = require("./index-minimal"); + +protobuf.build = "light"; + +/** + * A node-style callback as used by {@link load} and {@link Root#load}. + * @typedef LoadCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Root} [root] Root, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @param {string|string[]} filename One or multiple files to load + * @param {Root} root Root namespace, defaults to create a new one if omitted. + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + */ +function load(filename, root, callback) { + if (typeof root === "function") { + callback = root; + root = new protobuf.Root(); + } else if (!root) + root = new protobuf.Root(); + return root.load(filename, callback); +} + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @see {@link Root#load} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. + * @name load + * @function + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Promise} Promise + * @see {@link Root#load} + * @variation 3 + */ +// function load(filename:string, [root:Root]):Promise + +protobuf.load = load; + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). + * @param {string|string[]} filename One or multiple files to load + * @param {Root} [root] Root namespace, defaults to create a new one if omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + * @see {@link Root#loadSync} + */ +function loadSync(filename, root) { + if (!root) + root = new protobuf.Root(); + return root.loadSync(filename); +} + +protobuf.loadSync = loadSync; + +// Serialization +protobuf.encoder = require("./encoder"); +protobuf.decoder = require("./decoder"); +protobuf.verifier = require("./verifier"); +protobuf.converter = require("./converter"); + +// Reflection +protobuf.ReflectionObject = require("./object"); +protobuf.Namespace = require("./namespace"); +protobuf.Root = require("./root"); +protobuf.Enum = require("./enum"); +protobuf.Type = require("./type"); +protobuf.Field = require("./field"); +protobuf.OneOf = require("./oneof"); +protobuf.MapField = require("./mapfield"); +protobuf.Service = require("./service"); +protobuf.Method = require("./method"); + +// Runtime +protobuf.Message = require("./message"); +protobuf.wrappers = require("./wrappers"); + +// Utility +protobuf.types = require("./types"); +protobuf.util = require("./util"); + +// Set up possibly cyclic reflection dependencies +protobuf.ReflectionObject._configure(protobuf.Root); +protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); +protobuf.Root._configure(protobuf.Type); +protobuf.Field._configure(protobuf.Type); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-minimal.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-minimal.js new file mode 100644 index 00000000..9bc051bd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index-minimal.js @@ -0,0 +1,36 @@ +"use strict"; +var protobuf = exports; + +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = require("./writer"); +protobuf.BufferWriter = require("./writer_buffer"); +protobuf.Reader = require("./reader"); +protobuf.BufferReader = require("./reader_buffer"); + +// Utility +protobuf.util = require("./util/minimal"); +protobuf.rpc = require("./rpc"); +protobuf.roots = require("./roots"); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.Reader._configure(protobuf.BufferReader); + protobuf.util._configure(); +} + +// Set up buffer utility according to the environment +protobuf.Writer._configure(protobuf.BufferWriter); +configure(); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index.js new file mode 100644 index 00000000..56bd3d5d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/index.js @@ -0,0 +1,12 @@ +"use strict"; +var protobuf = module.exports = require("./index-light"); + +protobuf.build = "full"; + +// Parser +protobuf.tokenize = require("./tokenize"); +protobuf.parse = require("./parse"); +protobuf.common = require("./common"); + +// Configure parser +protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/mapfield.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/mapfield.js new file mode 100644 index 00000000..d307e226 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/mapfield.js @@ -0,0 +1,126 @@ +"use strict"; +module.exports = MapField; + +// extends Field +var Field = require("./field"); +((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + +var types = require("./types"), + util = require("./util"); + +/** + * Constructs a new map field instance. + * @classdesc Reflected map field. + * @extends FieldBase + * @constructor + * @param {string} name Unique name within its namespace + * @param {number} id Unique id within its namespace + * @param {string} keyType Key type + * @param {string} type Value type + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function MapField(name, id, keyType, type, options, comment) { + Field.call(this, name, id, type, undefined, undefined, options, comment); + + /* istanbul ignore if */ + if (!util.isString(keyType)) + throw TypeError("keyType must be a string"); + + /** + * Key type. + * @type {string} + */ + this.keyType = keyType; // toJSON, marker + + /** + * Resolved key type if not a basic type. + * @type {ReflectionObject|null} + */ + this.resolvedKeyType = null; + + // Overrides Field#map + this.map = true; +} + +/** + * Map field descriptor. + * @interface IMapField + * @extends {IField} + * @property {string} keyType Key type + */ + +/** + * Extension map field descriptor. + * @interface IExtensionMapField + * @extends IMapField + * @property {string} extend Extended type + */ + +/** + * Constructs a map field from a map field descriptor. + * @param {string} name Field name + * @param {IMapField} json Map field descriptor + * @returns {MapField} Created map field + * @throws {TypeError} If arguments are invalid + */ +MapField.fromJSON = function fromJSON(name, json) { + return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); +}; + +/** + * Converts this map field to a map field descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMapField} Map field descriptor + */ +MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "keyType" , this.keyType, + "type" , this.type, + "id" , this.id, + "extend" , this.extend, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +MapField.prototype.resolve = function resolve() { + if (this.resolved) + return this; + + // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" + if (types.mapKey[this.keyType] === undefined) + throw Error("invalid key type: " + this.keyType); + + return Field.prototype.resolve.call(this); +}; + +/** + * Map field decorator (TypeScript). + * @name MapField.d + * @function + * @param {number} fieldId Field id + * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type + * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type + * @returns {FieldDecorator} Decorator function + * @template T extends { [key: string]: number | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } + */ +MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + + // submessage value: decorate the submessage and use its name as the type + if (typeof fieldValueType === "function") + fieldValueType = util.decorateType(fieldValueType).name; + + // enum reference value: create a reflected copy of the enum and keep reuseing it + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util.decorateEnum(fieldValueType).name; + + return function mapFieldDecorator(prototype, fieldName) { + util.decorateType(prototype.constructor) + .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/message.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/message.js new file mode 100644 index 00000000..3f94bf6a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/message.js @@ -0,0 +1,139 @@ +"use strict"; +module.exports = Message; + +var util = require("./util/minimal"); + +/** + * Constructs a new message instance. + * @classdesc Abstract runtime message. + * @constructor + * @param {Properties} [properties] Properties to set + * @template T extends object = object + */ +function Message(properties) { + // not used internally + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + this[keys[i]] = properties[keys[i]]; +} + +/** + * Reference to the reflected type. + * @name Message.$type + * @type {Type} + * @readonly + */ + +/** + * Reference to the reflected type. + * @name Message#$type + * @type {Type} + * @readonly + */ + +/*eslint-disable valid-jsdoc*/ + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message} Message instance + * @template T extends Message + * @this Constructor + */ +Message.create = function create(properties) { + return this.$type.create(properties); +}; + +/** + * Encodes a message of this type. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encode = function encode(message, writer) { + return this.$type.encode(message, writer); +}; + +/** + * Encodes a message of this type preceeded by its length as a varint. + * @param {T|Object.} message Message to encode + * @param {Writer} [writer] Writer to use + * @returns {Writer} Writer + * @template T extends Message + * @this Constructor + */ +Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); +}; + +/** + * Decodes a message of this type. + * @name Message.decode + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decode = function decode(reader) { + return this.$type.decode(reader); +}; + +/** + * Decodes a message of this type preceeded by its length as a varint. + * @name Message.decodeDelimited + * @function + * @param {Reader|Uint8Array} reader Reader or buffer to decode + * @returns {T} Decoded message + * @template T extends Message + * @this Constructor + */ +Message.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); +}; + +/** + * Verifies a message of this type. + * @name Message.verify + * @function + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ +Message.verify = function verify(message) { + return this.$type.verify(message); +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object + * @returns {T} Message instance + * @template T extends Message + * @this Constructor + */ +Message.fromObject = function fromObject(object) { + return this.$type.fromObject(object); +}; + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {T} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @template T extends Message + * @this Constructor + */ +Message.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); +}; + +/** + * Converts this message to JSON. + * @returns {Object.} JSON object + */ +Message.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util.toJSONOptions); +}; + +/*eslint-enable valid-jsdoc*/ \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/method.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/method.js new file mode 100644 index 00000000..f5159225 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/method.js @@ -0,0 +1,151 @@ +"use strict"; +module.exports = Method; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + +var util = require("./util"); + +/** + * Constructs a new service method instance. + * @classdesc Reflected service method. + * @extends ReflectionObject + * @constructor + * @param {string} name Method name + * @param {string|undefined} type Method type, usually `"rpc"` + * @param {string} requestType Request message type + * @param {string} responseType Response message type + * @param {boolean|Object.} [requestStream] Whether the request is streamed + * @param {boolean|Object.} [responseStream] Whether the response is streamed + * @param {Object.} [options] Declared options + * @param {string} [comment] The comment for this method + */ +function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) { + + /* istanbul ignore next */ + if (util.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = undefined; + } else if (util.isObject(responseStream)) { + options = responseStream; + responseStream = undefined; + } + + /* istanbul ignore if */ + if (!(type === undefined || util.isString(type))) + throw TypeError("type must be a string"); + + /* istanbul ignore if */ + if (!util.isString(requestType)) + throw TypeError("requestType must be a string"); + + /* istanbul ignore if */ + if (!util.isString(responseType)) + throw TypeError("responseType must be a string"); + + ReflectionObject.call(this, name, options); + + /** + * Method type. + * @type {string} + */ + this.type = type || "rpc"; // toJSON + + /** + * Request type. + * @type {string} + */ + this.requestType = requestType; // toJSON, marker + + /** + * Whether requests are streamed or not. + * @type {boolean|undefined} + */ + this.requestStream = requestStream ? true : undefined; // toJSON + + /** + * Response type. + * @type {string} + */ + this.responseType = responseType; // toJSON + + /** + * Whether responses are streamed or not. + * @type {boolean|undefined} + */ + this.responseStream = responseStream ? true : undefined; // toJSON + + /** + * Resolved request type. + * @type {Type|null} + */ + this.resolvedRequestType = null; + + /** + * Resolved response type. + * @type {Type|null} + */ + this.resolvedResponseType = null; + + /** + * Comment for this method + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Method descriptor. + * @interface IMethod + * @property {string} [type="rpc"] Method type + * @property {string} requestType Request type + * @property {string} responseType Response type + * @property {boolean} [requestStream=false] Whether requests are streamed + * @property {boolean} [responseStream=false] Whether responses are streamed + * @property {Object.} [options] Method options + */ + +/** + * Constructs a method from a method descriptor. + * @param {string} name Method name + * @param {IMethod} json Method descriptor + * @returns {Method} Created method + * @throws {TypeError} If arguments are invalid + */ +Method.fromJSON = function fromJSON(name, json) { + return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment); +}; + +/** + * Converts this method to a method descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IMethod} Method descriptor + */ +Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, + "requestType" , this.requestType, + "requestStream" , this.requestStream, + "responseType" , this.responseType, + "responseStream" , this.responseStream, + "options" , this.options, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Method.prototype.resolve = function resolve() { + + /* istanbul ignore if */ + if (this.resolved) + return this; + + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + + return ReflectionObject.prototype.resolve.call(this); +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/namespace.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/namespace.js new file mode 100644 index 00000000..de9f4cdb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/namespace.js @@ -0,0 +1,433 @@ +"use strict"; +module.exports = Namespace; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + +var Field = require("./field"), + util = require("./util"); + +var Type, // cyclic + Service, + Enum; + +/** + * Constructs a new namespace instance. + * @name Namespace + * @classdesc Reflected namespace. + * @extends NamespaceBase + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + */ + +/** + * Constructs a namespace from JSON. + * @memberof Namespace + * @function + * @param {string} name Namespace name + * @param {Object.} json JSON object + * @returns {Namespace} Created namespace + * @throws {TypeError} If arguments are invalid + */ +Namespace.fromJSON = function fromJSON(name, json) { + return new Namespace(name, json.options).addJSON(json.nested); +}; + +/** + * Converts an array of reflection objects to JSON. + * @memberof Namespace + * @param {ReflectionObject[]} array Object array + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {Object.|undefined} JSON object or `undefined` when array is empty + */ +function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return undefined; + var obj = {}; + for (var i = 0; i < array.length; ++i) + obj[array[i].name] = array[i].toJSON(toJSONOptions); + return obj; +} + +Namespace.arrayToJSON = arrayToJSON; + +/** + * Tests if the specified id is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) + return true; + return false; +}; + +/** + * Tests if the specified name is reserved. + * @param {Array.|undefined} reserved Array of reserved ranges and names + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Namespace.isReservedName = function isReservedName(reserved, name) { + if (reserved) + for (var i = 0; i < reserved.length; ++i) + if (reserved[i] === name) + return true; + return false; +}; + +/** + * Not an actual constructor. Use {@link Namespace} instead. + * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. + * @exports NamespaceBase + * @extends ReflectionObject + * @abstract + * @constructor + * @param {string} name Namespace name + * @param {Object.} [options] Declared options + * @see {@link Namespace} + */ +function Namespace(name, options) { + ReflectionObject.call(this, name, options); + + /** + * Nested objects by name. + * @type {Object.|undefined} + */ + this.nested = undefined; // toJSON + + /** + * Cached nested objects as an array. + * @type {ReflectionObject[]|null} + * @private + */ + this._nestedArray = null; +} + +function clearCache(namespace) { + namespace._nestedArray = null; + return namespace; +} + +/** + * Nested objects of this namespace as an array for iteration. + * @name NamespaceBase#nestedArray + * @type {ReflectionObject[]} + * @readonly + */ +Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); + } +}); + +/** + * Namespace descriptor. + * @interface INamespace + * @property {Object.} [options] Namespace options + * @property {Object.} [nested] Nested object descriptors + */ + +/** + * Any extension field descriptor. + * @typedef AnyExtensionField + * @type {IExtensionField|IExtensionMapField} + */ + +/** + * Any nested object descriptor. + * @typedef AnyNestedObject + * @type {IEnum|IType|IService|AnyExtensionField|INamespace} + */ +// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) + +/** + * Converts this namespace to a namespace descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {INamespace} Namespace descriptor + */ +Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util.toObject([ + "options" , this.options, + "nested" , arrayToJSON(this.nestedArray, toJSONOptions) + ]); +}; + +/** + * Adds nested objects to this namespace from nested object descriptors. + * @param {Object.} nestedJson Any nested object descriptors + * @returns {Namespace} `this` + */ +Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + /* istanbul ignore else */ + if (nestedJson) { + for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { + nested = nestedJson[names[i]]; + ns.add( // most to least likely + ( nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : nested.id !== undefined + ? Field.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + } + return this; +}; + +/** + * Gets the nested object of the specified name. + * @param {string} name Nested object name + * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist + */ +Namespace.prototype.get = function get(name) { + return this.nested && this.nested[name] + || null; +}; + +/** + * Gets the values of the nested {@link Enum|enum} of the specified name. + * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. + * @param {string} name Nested enum name + * @returns {Object.} Enum values + * @throws {Error} If there is no such enum + */ +Namespace.prototype.getEnum = function getEnum(name) { + if (this.nested && this.nested[name] instanceof Enum) + return this.nested[name].values; + throw Error("no such enum: " + name); +}; + +/** + * Adds a nested object to this namespace. + * @param {ReflectionObject} object Nested object to add + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name + */ +Namespace.prototype.add = function add(object) { + + if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { + // replace plain namespace but keep existing nested elements and options + var nested = prev.nestedArray; + for (var i = 0; i < nested.length; ++i) + object.add(nested[i]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + object.onAdd(this); + return clearCache(this); +}; + +/** + * Removes a nested object from this namespace. + * @param {ReflectionObject} object Nested object to remove + * @returns {Namespace} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this namespace + */ +Namespace.prototype.remove = function remove(object) { + + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = undefined; + + object.onRemove(this); + return clearCache(this); +}; + +/** + * Defines additial namespaces within this one if not yet existing. + * @param {string|string[]} path Path to create + * @param {*} [json] Nested types to create from JSON + * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty + */ +Namespace.prototype.define = function define(path, json) { + + if (util.isString(path)) + path = path.split("."); + else if (!Array.isArray(path)) + throw TypeError("illegal path"); + if (path && path.length && path[0] === "") + throw Error("path must be relative"); + + var ptr = this; + while (path.length > 0) { + var part = path.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json) + ptr.addJSON(json); + return ptr; +}; + +/** + * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. + * @returns {Namespace} `this` + */ +Namespace.prototype.resolveAll = function resolveAll() { + var nested = this.nestedArray, i = 0; + while (i < nested.length) + if (nested[i] instanceof Namespace) + nested[i++].resolveAll(); + else + nested[i++].resolve(); + return this.resolve(); +}; + +/** + * Recursively looks up the reflection object matching the specified path in the scope of this namespace. + * @param {string|string[]} path Path to look up + * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. + * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + */ +Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { + + /* istanbul ignore next */ + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = undefined; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [ filterTypes ]; + + if (util.isString(path) && path.length) { + if (path === ".") + return this.root; + path = path.split("."); + } else if (!path.length) + return this; + + // Start at root if path is absolute + if (path[0] === "") + return this.root.lookup(path.slice(1), filterTypes); + + // Test if the first part matches any nested object, and if so, traverse if path contains more + var found = this.get(path[0]); + if (found) { + if (path.length === 1) { + if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) + return found; + } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) + return found; + + // Otherwise try each nested namespace + } else + for (var i = 0; i < this.nestedArray.length; ++i) + if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) + return found; + + // If there hasn't been a match, try again at the parent + if (this.parent === null || parentAlreadyChecked) + return null; + return this.parent.lookup(path, filterTypes); +}; + +/** + * Looks up the reflection object at the specified path, relative to this namespace. + * @name NamespaceBase#lookup + * @function + * @param {string|string[]} path Path to look up + * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked + * @returns {ReflectionObject|null} Looked up object or `null` if none could be found + * @variation 2 + */ +// lookup(path: string, [parentAlreadyChecked: boolean]) + +/** + * Looks up the {@link Type|type} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type + * @throws {Error} If `path` does not point to a type + */ +Namespace.prototype.lookupType = function lookupType(path) { + var found = this.lookup(path, [ Type ]); + if (!found) + throw Error("no such type: " + path); + return found; +}; + +/** + * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Enum} Looked up enum + * @throws {Error} If `path` does not point to an enum + */ +Namespace.prototype.lookupEnum = function lookupEnum(path) { + var found = this.lookup(path, [ Enum ]); + if (!found) + throw Error("no such Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Type} Looked up type or enum + * @throws {Error} If `path` does not point to a type or enum + */ +Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { + var found = this.lookup(path, [ Type, Enum ]); + if (!found) + throw Error("no such Type or Enum '" + path + "' in " + this); + return found; +}; + +/** + * Looks up the {@link Service|service} at the specified path, relative to this namespace. + * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. + * @param {string|string[]} path Path to look up + * @returns {Service} Looked up service + * @throws {Error} If `path` does not point to a service + */ +Namespace.prototype.lookupService = function lookupService(path) { + var found = this.lookup(path, [ Service ]); + if (!found) + throw Error("no such Service '" + path + "' in " + this); + return found; +}; + +// Sets up cyclic dependencies (called in index-light) +Namespace._configure = function(Type_, Service_, Enum_) { + Type = Type_; + Service = Service_; + Enum = Enum_; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/object.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/object.js new file mode 100644 index 00000000..b6a5e563 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/object.js @@ -0,0 +1,200 @@ +"use strict"; +module.exports = ReflectionObject; + +ReflectionObject.className = "ReflectionObject"; + +var util = require("./util"); + +var Root; // cyclic + +/** + * Constructs a new reflection object instance. + * @classdesc Base class of all reflection objects. + * @constructor + * @param {string} name Object name + * @param {Object.} [options] Declared options + * @abstract + */ +function ReflectionObject(name, options) { + + if (!util.isString(name)) + throw TypeError("name must be a string"); + + if (options && !util.isObject(options)) + throw TypeError("options must be an object"); + + /** + * Options. + * @type {Object.|undefined} + */ + this.options = options; // toJSON + + /** + * Unique name within its namespace. + * @type {string} + */ + this.name = name; + + /** + * Parent namespace. + * @type {Namespace|null} + */ + this.parent = null; + + /** + * Whether already resolved or not. + * @type {boolean} + */ + this.resolved = false; + + /** + * Comment text, if any. + * @type {string|null} + */ + this.comment = null; + + /** + * Defining file name. + * @type {string|null} + */ + this.filename = null; +} + +Object.defineProperties(ReflectionObject.prototype, { + + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path = [ this.name ], + ptr = this.parent; + while (ptr) { + path.unshift(ptr.name); + ptr = ptr.parent; + } + return path.join("."); + } + } +}); + +/** + * Converts this reflection object to its descriptor representation. + * @returns {Object.} Descriptor + * @abstract + */ +ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { + throw Error(); // not implemented, shouldn't happen +}; + +/** + * Called when this object is added to a parent. + * @param {ReflectionObject} parent Parent added to + * @returns {undefined} + */ +ReflectionObject.prototype.onAdd = function onAdd(parent) { + if (this.parent && this.parent !== parent) + this.parent.remove(this); + this.parent = parent; + this.resolved = false; + var root = parent.root; + if (root instanceof Root) + root._handleAdd(this); +}; + +/** + * Called when this object is removed from a parent. + * @param {ReflectionObject} parent Parent removed from + * @returns {undefined} + */ +ReflectionObject.prototype.onRemove = function onRemove(parent) { + var root = parent.root; + if (root instanceof Root) + root._handleRemove(this); + this.parent = null; + this.resolved = false; +}; + +/** + * Resolves this objects type references. + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.resolve = function resolve() { + if (this.resolved) + return this; + if (this.root instanceof Root) + this.resolved = true; // only if part of a root + return this; +}; + +/** + * Gets an option value. + * @param {string} name Option name + * @returns {*} Option value or `undefined` if not set + */ +ReflectionObject.prototype.getOption = function getOption(name) { + if (this.options) + return this.options[name]; + return undefined; +}; + +/** + * Sets an option. + * @param {string} name Option name + * @param {*} value Option value + * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { + if (!ifNotSet || !this.options || this.options[name] === undefined) + (this.options || (this.options = {}))[name] = value; + return this; +}; + +/** + * Sets multiple options. + * @param {Object.} options Options to set + * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set + * @returns {ReflectionObject} `this` + */ +ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) + this.setOption(keys[i], options[keys[i]], ifNotSet); + return this; +}; + +/** + * Converts this instance to its string representation. + * @returns {string} Class name[, space, full name] + */ +ReflectionObject.prototype.toString = function toString() { + var className = this.constructor.className, + fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; +}; + +// Sets up cyclic dependencies (called in index-light) +ReflectionObject._configure = function(Root_) { + Root = Root_; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/oneof.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/oneof.js new file mode 100644 index 00000000..ba0e9027 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/oneof.js @@ -0,0 +1,203 @@ +"use strict"; +module.exports = OneOf; + +// extends ReflectionObject +var ReflectionObject = require("./object"); +((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + +var Field = require("./field"), + util = require("./util"); + +/** + * Constructs a new oneof instance. + * @classdesc Reflected oneof. + * @extends ReflectionObject + * @constructor + * @param {string} name Oneof name + * @param {string[]|Object.} [fieldNames] Field names + * @param {Object.} [options] Declared options + * @param {string} [comment] Comment associated with this field + */ +function OneOf(name, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = undefined; + } + ReflectionObject.call(this, name, options); + + /* istanbul ignore if */ + if (!(fieldNames === undefined || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + + /** + * Field names that belong to this oneof. + * @type {string[]} + */ + this.oneof = fieldNames || []; // toJSON, marker + + /** + * Fields that belong to this oneof as an array for iteration. + * @type {Field[]} + * @readonly + */ + this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent + + /** + * Comment for this field. + * @type {string|null} + */ + this.comment = comment; +} + +/** + * Oneof descriptor. + * @interface IOneOf + * @property {Array.} oneof Oneof field names + * @property {Object.} [options] Oneof options + */ + +/** + * Constructs a oneof from a oneof descriptor. + * @param {string} name Oneof name + * @param {IOneOf} json Oneof descriptor + * @returns {OneOf} Created oneof + * @throws {TypeError} If arguments are invalid + */ +OneOf.fromJSON = function fromJSON(name, json) { + return new OneOf(name, json.oneof, json.options, json.comment); +}; + +/** + * Converts this oneof to a oneof descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IOneOf} Oneof descriptor + */ +OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , this.options, + "oneof" , this.oneof, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Adds the fields of the specified oneof to the parent if not already done so. + * @param {OneOf} oneof The oneof + * @returns {undefined} + * @inner + * @ignore + */ +function addFieldsToParent(oneof) { + if (oneof.parent) + for (var i = 0; i < oneof.fieldsArray.length; ++i) + if (!oneof.fieldsArray[i].parent) + oneof.parent.add(oneof.fieldsArray[i]); +} + +/** + * Adds a field to this oneof and removes it from its current parent, if any. + * @param {Field} field Field to add + * @returns {OneOf} `this` + */ +OneOf.prototype.add = function add(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; // field.parent remains null + addFieldsToParent(this); + return this; +}; + +/** + * Removes a field from this oneof and puts it back to the oneof's parent. + * @param {Field} field Field to remove + * @returns {OneOf} `this` + */ +OneOf.prototype.remove = function remove(field) { + + /* istanbul ignore if */ + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + + var index = this.fieldsArray.indexOf(field); + + /* istanbul ignore if */ + if (index < 0) + throw Error(field + " is not a member of " + this); + + this.fieldsArray.splice(index, 1); + index = this.oneof.indexOf(field.name); + + /* istanbul ignore else */ + if (index > -1) // theoretical + this.oneof.splice(index, 1); + + field.partOf = null; + return this; +}; + +/** + * @override + */ +OneOf.prototype.onAdd = function onAdd(parent) { + ReflectionObject.prototype.onAdd.call(this, parent); + var self = this; + // Collect present fields + for (var i = 0; i < this.oneof.length; ++i) { + var field = parent.get(this.oneof[i]); + if (field && !field.partOf) { + field.partOf = self; + self.fieldsArray.push(field); + } + } + // Add not yet present fields + addFieldsToParent(this); +}; + +/** + * @override + */ +OneOf.prototype.onRemove = function onRemove(parent) { + for (var i = 0, field; i < this.fieldsArray.length; ++i) + if ((field = this.fieldsArray[i]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent); +}; + +/** + * Decorator function as returned by {@link OneOf.d} (TypeScript). + * @typedef OneOfDecorator + * @type {function} + * @param {Object} prototype Target prototype + * @param {string} oneofName OneOf name + * @returns {undefined} + */ + +/** + * OneOf decorator (TypeScript). + * @function + * @param {...string} fieldNames Field names + * @returns {OneOfDecorator} Decorator function + * @template T extends string + */ +OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), + index = 0; + while (index < arguments.length) + fieldNames[index] = arguments[index++]; + return function oneOfDecorator(prototype, oneofName) { + util.decorateType(prototype.constructor) + .add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util.oneOfGetter(fieldNames), + set: util.oneOfSetter(fieldNames) + }); + }; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/parse.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/parse.js new file mode 100644 index 00000000..47f94e49 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/parse.js @@ -0,0 +1,761 @@ +"use strict"; +module.exports = parse; + +parse.filename = null; +parse.defaults = { keepCase: false }; + +var tokenize = require("./tokenize"), + Root = require("./root"), + Type = require("./type"), + Field = require("./field"), + MapField = require("./mapfield"), + OneOf = require("./oneof"), + Enum = require("./enum"), + Service = require("./service"), + Method = require("./method"), + types = require("./types"), + util = require("./util"); + +var base10Re = /^[1-9][0-9]*$/, + base10NegRe = /^-?[1-9][0-9]*$/, + base16Re = /^0[x][0-9a-fA-F]+$/, + base16NegRe = /^-?0[x][0-9a-fA-F]+$/, + base8Re = /^0[0-7]+$/, + base8NegRe = /^-?0[0-7]+$/, + numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, + nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, + typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, + fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; + +/** + * Result object returned from {@link parse}. + * @interface IParserResult + * @property {string|undefined} package Package name, if declared + * @property {string[]|undefined} imports Imports, if any + * @property {string[]|undefined} weakImports Weak imports, if any + * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) + * @property {Root} root Populated root instance + */ + +/** + * Options modifying the behavior of {@link parse}. + * @interface IParseOptions + * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case + * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. + */ + +/** + * Options modifying the behavior of JSON serialization. + * @interface IToJSONOptions + * @property {boolean} [keepComments=false] Serializes comments. + */ + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @param {string} source Source contents + * @param {Root} root Root to populate + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + */ +function parse(source, root, options) { + /* eslint-disable callback-return */ + if (!(root instanceof Root)) { + options = root; + root = new Root(); + } + if (!options) + options = parse.defaults; + + var tn = tokenize(source, options.alternateCommentMode || false), + next = tn.next, + push = tn.push, + peek = tn.peek, + skip = tn.skip, + cmnt = tn.cmnt; + + var head = true, + pkg, + imports, + weakImports, + syntax, + isProto3 = false; + + var ptr = root; + + var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; + + /* istanbul ignore next */ + function illegal(token, name, insideTryCatch) { + var filename = parse.filename; + if (!insideTryCatch) + parse.filename = null; + return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); + } + + function readString() { + var values = [], + token; + do { + /* istanbul ignore if */ + if ((token = next()) !== "\"" && token !== "'") + throw illegal(token); + + values.push(next()); + skip(token); + token = peek(); + } while (token === "\"" || token === "'"); + return values.join(""); + } + + function readValue(acceptTypeRef) { + var token = next(); + switch (token) { + case "'": + case "\"": + push(token); + return readString(); + case "true": case "TRUE": + return true; + case "false": case "FALSE": + return false; + } + try { + return parseNumber(token, /* insideTryCatch */ true); + } catch (e) { + + /* istanbul ignore else */ + if (acceptTypeRef && typeRefRe.test(token)) + return token; + + /* istanbul ignore next */ + throw illegal(token, "value"); + } + } + + function readRanges(target, acceptStrings) { + var token, start; + do { + if (acceptStrings && ((token = peek()) === "\"" || token === "'")) + target.push(readString()); + else + target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); + } while (skip(",", true)); + skip(";"); + } + + function parseNumber(token, insideTryCatch) { + var sign = 1; + if (token.charAt(0) === "-") { + sign = -1; + token = token.substring(1); + } + switch (token) { + case "inf": case "INF": case "Inf": + return sign * Infinity; + case "nan": case "NAN": case "Nan": case "NaN": + return NaN; + case "0": + return 0; + } + if (base10Re.test(token)) + return sign * parseInt(token, 10); + if (base16Re.test(token)) + return sign * parseInt(token, 16); + if (base8Re.test(token)) + return sign * parseInt(token, 8); + + /* istanbul ignore else */ + if (numberRe.test(token)) + return sign * parseFloat(token); + + /* istanbul ignore next */ + throw illegal(token, "number", insideTryCatch); + } + + function parseId(token, acceptNegative) { + switch (token) { + case "max": case "MAX": case "Max": + return 536870911; + case "0": + return 0; + } + + /* istanbul ignore if */ + if (!acceptNegative && token.charAt(0) === "-") + throw illegal(token, "id"); + + if (base10NegRe.test(token)) + return parseInt(token, 10); + if (base16NegRe.test(token)) + return parseInt(token, 16); + + /* istanbul ignore else */ + if (base8NegRe.test(token)) + return parseInt(token, 8); + + /* istanbul ignore next */ + throw illegal(token, "id"); + } + + function parsePackage() { + + /* istanbul ignore if */ + if (pkg !== undefined) + throw illegal("package"); + + pkg = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(pkg)) + throw illegal(pkg, "name"); + + ptr = ptr.define(pkg); + skip(";"); + } + + function parseImport() { + var token = peek(); + var whichImports; + switch (token) { + case "weak": + whichImports = weakImports || (weakImports = []); + next(); + break; + case "public": + next(); + // eslint-disable-line no-fallthrough + default: + whichImports = imports || (imports = []); + break; + } + token = readString(); + skip(";"); + whichImports.push(token); + } + + function parseSyntax() { + skip("="); + syntax = readString(); + isProto3 = syntax === "proto3"; + + /* istanbul ignore if */ + if (!isProto3 && syntax !== "proto2") + throw illegal(syntax, "syntax"); + + skip(";"); + } + + function parseCommon(parent, token) { + switch (token) { + + case "option": + parseOption(parent, token); + skip(";"); + return true; + + case "message": + parseType(parent, token); + return true; + + case "enum": + parseEnum(parent, token); + return true; + + case "service": + parseService(parent, token); + return true; + + case "extend": + parseExtension(parent, token); + return true; + } + return false; + } + + function ifBlock(obj, fnIf, fnElse) { + var trailingLine = tn.line; + if (obj) { + if(typeof obj.comment !== "string") { + obj.comment = cmnt(); // try block-type comment + } + obj.filename = parse.filename; + } + if (skip("{", true)) { + var token; + while ((token = next()) !== "}") + fnIf(token); + skip(";", true); + } else { + if (fnElse) + fnElse(); + skip(";"); + if (obj && typeof obj.comment !== "string") + obj.comment = cmnt(trailingLine); // try line-type comment if no block + } + } + + function parseType(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "type name"); + + var type = new Type(token); + ifBlock(type, function parseType_block(token) { + if (parseCommon(type, token)) + return; + + switch (token) { + + case "map": + parseMapField(type, token); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + case "oneof": + parseOneOf(type, token); + break; + + case "extensions": + readRanges(type.extensions || (type.extensions = [])); + break; + + case "reserved": + readRanges(type.reserved || (type.reserved = []), true); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + + push(token); + parseField(type, "optional"); + break; + } + }); + parent.add(type); + } + + function parseField(parent, rule, extend) { + var type = next(); + if (type === "group") { + parseGroup(parent, rule); + return; + } + + /* istanbul ignore if */ + if (!typeRefRe.test(type)) + throw illegal(type, "type"); + + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + name = applyCase(name); + skip("="); + + var field = new Field(name, parseId(next()), type, rule, extend); + ifBlock(field, function parseField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseField_line() { + parseInlineOptions(field); + }); + parent.add(field); + + // JSON defaults to packed=true if not set so we have to set packed=false explicity when + // parsing proto2 descriptors without the option, where applicable. This must be done for + // all known packable types and anything that could be an enum (= is not a basic type). + if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) + field.setOption("packed", false, /* ifNotSet */ true); + } + + function parseGroup(parent, rule) { + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + var fieldName = util.lcFirst(name); + if (name === fieldName) + name = util.ucFirst(name); + skip("="); + var id = parseId(next()); + var type = new Type(name); + type.group = true; + var field = new Field(fieldName, id, name, rule); + field.filename = parse.filename; + ifBlock(type, function parseGroup_block(token) { + switch (token) { + + case "option": + parseOption(type, token); + skip(";"); + break; + + case "required": + case "optional": + case "repeated": + parseField(type, token); + break; + + /* istanbul ignore next */ + default: + throw illegal(token); // there are no groups with proto3 semantics + } + }); + parent.add(type) + .add(field); + } + + function parseMapField(parent) { + skip("<"); + var keyType = next(); + + /* istanbul ignore if */ + if (types.mapKey[keyType] === undefined) + throw illegal(keyType, "type"); + + skip(","); + var valueType = next(); + + /* istanbul ignore if */ + if (!typeRefRe.test(valueType)) + throw illegal(valueType, "type"); + + skip(">"); + var name = next(); + + /* istanbul ignore if */ + if (!nameRe.test(name)) + throw illegal(name, "name"); + + skip("="); + var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); + ifBlock(field, function parseMapField_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(field, token); + skip(";"); + } else + throw illegal(token); + + }, function parseMapField_line() { + parseInlineOptions(field); + }); + parent.add(field); + } + + function parseOneOf(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var oneof = new OneOf(applyCase(token)); + ifBlock(oneof, function parseOneOf_block(token) { + if (token === "option") { + parseOption(oneof, token); + skip(";"); + } else { + push(token); + parseField(oneof, "optional"); + } + }); + parent.add(oneof); + } + + function parseEnum(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var enm = new Enum(token); + ifBlock(enm, function parseEnum_block(token) { + switch(token) { + case "option": + parseOption(enm, token); + skip(";"); + break; + + case "reserved": + readRanges(enm.reserved || (enm.reserved = []), true); + break; + + default: + parseEnumValue(enm, token); + } + }); + parent.add(enm); + } + + function parseEnumValue(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token)) + throw illegal(token, "name"); + + skip("="); + var value = parseId(next(), true), + dummy = {}; + ifBlock(dummy, function parseEnumValue_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(dummy, token); // skip + skip(";"); + } else + throw illegal(token); + + }, function parseEnumValue_line() { + parseInlineOptions(dummy); // skip + }); + parent.add(token, value, dummy.comment); + } + + function parseOption(parent, token) { + var isCustom = skip("(", true); + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "name"); + + var name = token; + if (isCustom) { + skip(")"); + name = "(" + name + ")"; + token = peek(); + if (fqTypeRefRe.test(token)) { + name += token; + next(); + } + } + skip("="); + parseOptionValue(parent, name); + } + + function parseOptionValue(parent, name) { + if (skip("{", true)) { // { a: "foo" b { c: "bar" } } + do { + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else { + skip(":"); + if (peek() === "{") + parseOptionValue(parent, name + "." + token); + else + setOption(parent, name + "." + token, readValue(true)); + } + skip(",", true); + } while (!skip("}", true)); + } else + setOption(parent, name, readValue(true)); + // Does not enforce a delimiter to be universal + } + + function setOption(parent, name, value) { + if (parent.setOption) + parent.setOption(name, value); + } + + function parseInlineOptions(parent) { + if (skip("[", true)) { + do { + parseOption(parent, "option"); + } while (skip(",", true)); + skip("]"); + } + return parent; + } + + function parseService(parent, token) { + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "service name"); + + var service = new Service(token); + ifBlock(service, function parseService_block(token) { + if (parseCommon(service, token)) + return; + + /* istanbul ignore else */ + if (token === "rpc") + parseMethod(service, token); + else + throw illegal(token); + }); + parent.add(service); + } + + function parseMethod(parent, token) { + // Get the comment of the preceding line now (if one exists) in case the + // method is defined across multiple lines. + var commentText = cmnt(); + + var type = token; + + /* istanbul ignore if */ + if (!nameRe.test(token = next())) + throw illegal(token, "name"); + + var name = token, + requestType, requestStream, + responseType, responseStream; + + skip("("); + if (skip("stream", true)) + requestStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + requestType = token; + skip(")"); skip("returns"); skip("("); + if (skip("stream", true)) + responseStream = true; + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token); + + responseType = token; + skip(")"); + + var method = new Method(name, type, requestType, responseType, requestStream, responseStream); + method.comment = commentText; + ifBlock(method, function parseMethod_block(token) { + + /* istanbul ignore else */ + if (token === "option") { + parseOption(method, token); + skip(";"); + } else + throw illegal(token); + + }); + parent.add(method); + } + + function parseExtension(parent, token) { + + /* istanbul ignore if */ + if (!typeRefRe.test(token = next())) + throw illegal(token, "reference"); + + var reference = token; + ifBlock(null, function parseExtension_block(token) { + switch (token) { + + case "required": + case "repeated": + case "optional": + parseField(parent, token, reference); + break; + + default: + /* istanbul ignore if */ + if (!isProto3 || !typeRefRe.test(token)) + throw illegal(token); + push(token); + parseField(parent, "optional", reference); + break; + } + }); + } + + var token; + while ((token = next()) !== null) { + switch (token) { + + case "package": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parsePackage(); + break; + + case "import": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseImport(); + break; + + case "syntax": + + /* istanbul ignore if */ + if (!head) + throw illegal(token); + + parseSyntax(); + break; + + case "option": + + parseOption(ptr, token); + skip(";"); + break; + + default: + + /* istanbul ignore else */ + if (parseCommon(ptr, token)) { + head = false; + continue; + } + + /* istanbul ignore next */ + throw illegal(token); + } + } + + parse.filename = null; + return { + "package" : pkg, + "imports" : imports, + weakImports : weakImports, + syntax : syntax, + root : root + }; +} + +/** + * Parses the given .proto source and returns an object with the parsed contents. + * @name parse + * @function + * @param {string} source Source contents + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {IParserResult} Parser result + * @property {string} filename=null Currently processing file name for error reporting, if known + * @property {IParseOptions} defaults Default {@link IParseOptions} + * @variation 2 + */ diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader.js new file mode 100644 index 00000000..cb160c81 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader.js @@ -0,0 +1,405 @@ +"use strict"; +module.exports = Reader; + +var util = require("./util/minimal"); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} + +/** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ +function Reader(buffer) { + + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} + +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; + +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; + +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); + +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; + +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; + +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} + +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4); +}; + +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ + +/* + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + +/* + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; + +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; + + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); + + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; + +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; + +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; +}; + +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; + +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { + + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + + }); +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader_buffer.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader_buffer.js new file mode 100644 index 00000000..95189014 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/reader_buffer.js @@ -0,0 +1,44 @@ +"use strict"; +module.exports = BufferReader; + +// extends Reader +var Reader = require("./reader"); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + +var util = require("./util/minimal"); + +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); + + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} + +/* istanbul ignore else */ +if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; + +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/root.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/root.js new file mode 100644 index 00000000..da435d3d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/root.js @@ -0,0 +1,353 @@ +"use strict"; +module.exports = Root; + +// extends Namespace +var Namespace = require("./namespace"); +((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; + +var Field = require("./field"), + Enum = require("./enum"), + OneOf = require("./oneof"), + util = require("./util"); + +var Type, // cyclic + parse, // might be excluded + common; // " + +/** + * Constructs a new root namespace instance. + * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. + * @extends NamespaceBase + * @constructor + * @param {Object.} [options] Top level options + */ +function Root(options) { + Namespace.call(this, "", options); + + /** + * Deferred extension fields. + * @type {Field[]} + */ + this.deferred = []; + + /** + * Resolved file names of loaded files. + * @type {string[]} + */ + this.files = []; +} + +/** + * Loads a namespace descriptor into a root namespace. + * @param {INamespace} json Nameespace descriptor + * @param {Root} [root] Root namespace, defaults to create a new one if omitted + * @returns {Root} Root namespace + */ +Root.fromJSON = function fromJSON(json, root) { + if (!root) + root = new Root(); + if (json.options) + root.setOptions(json.options); + return root.addJSON(json.nested); +}; + +/** + * Resolves the path of an imported file, relative to the importing origin. + * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. + * @function + * @param {string} origin The file name of the importing file + * @param {string} target The file name being imported + * @returns {string|null} Resolved path to `target` or `null` to skip the file + */ +Root.prototype.resolvePath = util.path.resolve; + +// A symbol-like function to safely signal synchronous loading +/* istanbul ignore next */ +function SYNC() {} // eslint-disable-line no-empty-function + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} options Parse options + * @param {LoadCallback} callback Callback function + * @returns {undefined} + */ +Root.prototype.load = function load(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + var self = this; + if (!callback) + return util.asPromise(load, self, filename, options); + + var sync = callback === SYNC; // undocumented + + // Finishes loading by calling the callback (exactly once) + function finish(err, root) { + /* istanbul ignore if */ + if (!callback) + return; + var cb = callback; + callback = null; + if (sync) + throw err; + cb(err, root); + } + + // Bundled definition existence checking + function getBundledFileName(filename) { + var idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename.substring(idx); + if (altname in common) return altname; + } + return null; + } + + // Processes a single file + function process(filename, source) { + try { + if (util.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util.isString(source)) + self.setOptions(source.options).addJSON(source.nested); + else { + parse.filename = filename; + var parsed = parse(source, self, options), + resolved, + i = 0; + if (parsed.imports) + for (; i < parsed.imports.length; ++i) + if (resolved = (getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))) + fetch(resolved); + if (parsed.weakImports) + for (i = 0; i < parsed.weakImports.length; ++i) + if (resolved = (getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))) + fetch(resolved, true); + } + } catch (err) { + finish(err); + } + if (!sync && !queued) + finish(null, self); // only once anyway + } + + // Fetches a single file + function fetch(filename, weak) { + + // Skip if already loaded / attempted + if (self.files.indexOf(filename) > -1) + return; + self.files.push(filename); + + // Shortcut bundled definitions + if (filename in common) { + if (sync) + process(filename, common[filename]); + else { + ++queued; + setTimeout(function() { + --queued; + process(filename, common[filename]); + }); + } + return; + } + + // Otherwise fetch from disk or network + if (sync) { + var source; + try { + source = util.fs.readFileSync(filename).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process(filename, source); + } else { + ++queued; + util.fetch(filename, function(err, source) { + --queued; + /* istanbul ignore if */ + if (!callback) + return; // terminated meanwhile + if (err) { + /* istanbul ignore else */ + if (!weak) + finish(err); + else if (!queued) // can't be covered reliably + finish(null, self); + return; + } + process(filename, source); + }); + } + } + var queued = 0; + + // Assembling the root namespace doesn't require working type + // references anymore, so we can load everything in parallel + if (util.isString(filename)) + filename = [ filename ]; + for (var i = 0, resolved; i < filename.length; ++i) + if (resolved = self.resolvePath("", filename[i])) + fetch(resolved); + + if (sync) + return self; + if (!queued) + finish(null, self); + return undefined; +}; +// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {LoadCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +// function load(filename:string, callback:LoadCallback):undefined + +/** + * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. + * @function Root#load + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Promise} Promise + * @variation 3 + */ +// function load(filename:string, [options:IParseOptions]):Promise + +/** + * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). + * @function Root#loadSync + * @param {string|string[]} filename Names of one or multiple files to load + * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. + * @returns {Root} Root namespace + * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid + */ +Root.prototype.loadSync = function loadSync(filename, options) { + if (!util.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); +}; + +/** + * @override + */ +Root.prototype.resolveAll = function resolveAll() { + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); +}; + +// only uppercased (and thus conflict-free) children are exposed, see below +var exposeRe = /^[A-Z]/; + +/** + * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. + * @param {Root} root Root instance + * @param {Field} field Declaring extension field witin the declaring type + * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise + * @inner + * @ignore + */ +function tryHandleExtension(root, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; +} + +/** + * Called when any object is added to this root or its sub-namespaces. + * @param {ReflectionObject} object Object added + * @returns {undefined} + * @private + */ +Root.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + + if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; // expose enum values as property of its parent + + } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { + + if (object instanceof Type) // Try to handle any deferred extensions + for (var i = 0; i < this.deferred.length;) + if (tryHandleExtension(this, this.deferred[i])) + this.deferred.splice(i, 1); + else + ++i; + for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace + this._handleAdd(object._nestedArray[j]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; // expose namespace as property of its parent + } + + // The above also adds uppercased (and thus conflict-free) nested types, services and enums as + // properties of namespaces just like static code does. This allows using a .d.ts generated for + // a static module with reflection-based solutions where the condition is met. +}; + +/** + * Called when any object is removed from this root or its sub-namespaces. + * @param {ReflectionObject} object Object removed + * @returns {undefined} + * @private + */ +Root.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + + if (/* an extension field */ object.extend !== undefined) { + if (/* already handled */ object.extensionField) { // remove its sister field + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { // cancel the extension + var index = this.deferred.indexOf(object); + /* istanbul ignore else */ + if (index > -1) + this.deferred.splice(index, 1); + } + } + + } else if (object instanceof Enum) { + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose enum values + + } else if (object instanceof Namespace) { + + for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace + this._handleRemove(object._nestedArray[i]); + + if (exposeRe.test(object.name)) + delete object.parent[object.name]; // unexpose namespaces + + } +}; + +// Sets up cyclic dependencies (called in index-light) +Root._configure = function(Type_, parse_, common_) { + Type = Type_; + parse = parse_; + common = common_; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/roots.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/roots.js new file mode 100644 index 00000000..19212115 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/roots.js @@ -0,0 +1,18 @@ +"use strict"; +module.exports = {}; + +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc.js new file mode 100644 index 00000000..894e5c7c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc.js @@ -0,0 +1,36 @@ +"use strict"; + +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; + +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = require("./rpc/service"); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc/service.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc/service.js new file mode 100644 index 00000000..757f382e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/rpc/service.js @@ -0,0 +1,142 @@ +"use strict"; +module.exports = Service; + +var util = require("../util/minimal"); + +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { + + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + + util.EventEmitter.call(this); + + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} + +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + + if (!request) + throw TypeError("request must be specified"); + + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } + + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + + if (err) { + self.emit("error", err, method); + return callback(err); + } + + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; + +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/service.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/service.js new file mode 100644 index 00000000..bc2c3080 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/service.js @@ -0,0 +1,167 @@ +"use strict"; +module.exports = Service; + +// extends Namespace +var Namespace = require("./namespace"); +((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + +var Method = require("./method"), + util = require("./util"), + rpc = require("./rpc"); + +/** + * Constructs a new service instance. + * @classdesc Reflected service. + * @extends NamespaceBase + * @constructor + * @param {string} name Service name + * @param {Object.} [options] Service options + * @throws {TypeError} If arguments are invalid + */ +function Service(name, options) { + Namespace.call(this, name, options); + + /** + * Service methods. + * @type {Object.} + */ + this.methods = {}; // toJSON, marker + + /** + * Cached methods as an array. + * @type {Method[]|null} + * @private + */ + this._methodsArray = null; +} + +/** + * Service descriptor. + * @interface IService + * @extends INamespace + * @property {Object.} methods Method descriptors + */ + +/** + * Constructs a service from a service descriptor. + * @param {string} name Service name + * @param {IService} json Service descriptor + * @returns {Service} Created service + * @throws {TypeError} If arguments are invalid + */ +Service.fromJSON = function fromJSON(name, json) { + var service = new Service(name, json.options); + /* istanbul ignore else */ + if (json.methods) + for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) + service.add(Method.fromJSON(names[i], json.methods[names[i]])); + if (json.nested) + service.addJSON(json.nested); + service.comment = json.comment; + return service; +}; + +/** + * Converts this service to a service descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IService} Service descriptor + */ +Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * Methods of this service as an array for iteration. + * @name Service#methodsArray + * @type {Method[]} + * @readonly + */ +Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); + } +}); + +function clearCache(service) { + service._methodsArray = null; + return service; +} + +/** + * @override + */ +Service.prototype.get = function get(name) { + return this.methods[name] + || Namespace.prototype.get.call(this, name); +}; + +/** + * @override + */ +Service.prototype.resolveAll = function resolveAll() { + var methods = this.methodsArray; + for (var i = 0; i < methods.length; ++i) + methods[i].resolve(); + return Namespace.prototype.resolve.call(this); +}; + +/** + * @override + */ +Service.prototype.add = function add(object) { + + /* istanbul ignore if */ + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * @override + */ +Service.prototype.remove = function remove(object) { + if (object instanceof Method) { + + /* istanbul ignore if */ + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Creates a runtime service using the specified rpc implementation. + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. + */ +Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { + var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method, + q: method.resolvedRequestType.ctor, + s: method.resolvedResponseType.ctor + }); + } + return rpcService; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/tokenize.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/tokenize.js new file mode 100644 index 00000000..b939ef28 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/tokenize.js @@ -0,0 +1,397 @@ +"use strict"; +module.exports = tokenize; + +var delimRe = /[\s{}=;:[\],'"()<>]/g, + stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; + +var setCommentRe = /^ *[*/]+ */, + setCommentAltRe = /^\s*\*?\/*/, + setCommentSplitRe = /\n/g, + whitespaceRe = /\s/, + unescapeRe = /\\(.?)/g; + +var unescapeMap = { + "0": "\0", + "r": "\r", + "n": "\n", + "t": "\t" +}; + +/** + * Unescapes a string. + * @param {string} str String to unescape + * @returns {string} Unescaped string + * @property {Object.} map Special characters map + * @memberof tokenize + */ +function unescape(str) { + return str.replace(unescapeRe, function($0, $1) { + switch ($1) { + case "\\": + case "": + return $1; + default: + return unescapeMap[$1] || ""; + } + }); +} + +tokenize.unescape = unescape; + +/** + * Gets the next token and advances. + * @typedef TokenizerHandleNext + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Peeks for the next token. + * @typedef TokenizerHandlePeek + * @type {function} + * @returns {string|null} Next token or `null` on eof + */ + +/** + * Pushes a token back to the stack. + * @typedef TokenizerHandlePush + * @type {function} + * @param {string} token Token + * @returns {undefined} + */ + +/** + * Skips the next token. + * @typedef TokenizerHandleSkip + * @type {function} + * @param {string} expected Expected token + * @param {boolean} [optional=false] If optional + * @returns {boolean} Whether the token matched + * @throws {Error} If the token didn't match and is not optional + */ + +/** + * Gets the comment on the previous line or, alternatively, the line comment on the specified line. + * @typedef TokenizerHandleCmnt + * @type {function} + * @param {number} [line] Line number + * @returns {string|null} Comment text or `null` if none + */ + +/** + * Handle object returned from {@link tokenize}. + * @interface ITokenizerHandle + * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) + * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) + * @property {TokenizerHandlePush} push Pushes a token back to the stack + * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws + * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any + * @property {number} line Current line number + */ + +/** + * Tokenizes the given .proto source and returns an object with useful utility functions. + * @param {string} source Source contents + * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. + * @returns {ITokenizerHandle} Tokenizer handle + */ +function tokenize(source, alternateCommentMode) { + /* eslint-disable callback-return */ + source = source.toString(); + + var offset = 0, + length = source.length, + line = 1, + commentType = null, + commentText = null, + commentLine = 0, + commentLineEmpty = false; + + var stack = []; + + var stringDelim = null; + + /* istanbul ignore next */ + /** + * Creates an error for illegal syntax. + * @param {string} subject Subject + * @returns {Error} Error created + * @inner + */ + function illegal(subject) { + return Error("illegal " + subject + " (line " + line + ")"); + } + + /** + * Reads a string till its end. + * @returns {string} String read + * @inner + */ + function readString() { + var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; + re.lastIndex = offset - 1; + var match = re.exec(source); + if (!match) + throw illegal("string"); + offset = re.lastIndex; + push(stringDelim); + stringDelim = null; + return unescape(match[1]); + } + + /** + * Gets the character at `pos` within the source. + * @param {number} pos Position + * @returns {string} Character + * @inner + */ + function charAt(pos) { + return source.charAt(pos); + } + + /** + * Sets the current comment text. + * @param {number} start Start offset + * @param {number} end End offset + * @returns {undefined} + * @inner + */ + function setComment(start, end) { + commentType = source.charAt(start++); + commentLine = line; + commentLineEmpty = false; + var lookback; + if (alternateCommentMode) { + lookback = 2; // alternate comment parsing: "//" or "/*" + } else { + lookback = 3; // "///" or "/**" + } + var commentOffset = start - lookback, + c; + do { + if (--commentOffset < 0 || + (c = source.charAt(commentOffset)) === "\n") { + commentLineEmpty = true; + break; + } + } while (c === " " || c === "\t"); + var lines = source + .substring(start, end) + .split(setCommentSplitRe); + for (var i = 0; i < lines.length; ++i) + lines[i] = lines[i] + .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") + .trim(); + commentText = lines + .join("\n") + .trim(); + } + + function isDoubleSlashCommentLine(startOffset) { + var endOffset = findEndOfLine(startOffset); + + // see if remaining line matches comment pattern + var lineText = source.substring(startOffset, endOffset); + // look for 1 or 2 slashes since startOffset would already point past + // the first slash that started the comment. + var isComment = /^\s*\/{1,2}/.test(lineText); + return isComment; + } + + function findEndOfLine(cursor) { + // find end of cursor's line + var endOffset = cursor; + while (endOffset < length && charAt(endOffset) !== "\n") { + endOffset++; + } + return endOffset; + } + + /** + * Obtains the next token. + * @returns {string|null} Next token or `null` on eof + * @inner + */ + function next() { + if (stack.length > 0) + return stack.shift(); + if (stringDelim) + return readString(); + var repeat, + prev, + curr, + start, + isDoc; + do { + if (offset === length) + return null; + repeat = false; + while (whitespaceRe.test(curr = charAt(offset))) { + if (curr === "\n") + ++line; + if (++offset === length) + return null; + } + + if (charAt(offset) === "/") { + if (++offset === length) { + throw illegal("comment"); + } + if (charAt(offset) === "/") { // Line + if (!alternateCommentMode) { + // check for triple-slash comment + isDoc = charAt(start = offset + 1) === "/"; + + while (charAt(++offset) !== "\n") { + if (offset === length) { + return null; + } + } + ++offset; + if (isDoc) { + setComment(start, offset - 1); + } + ++line; + repeat = true; + } else { + // check for double-slash comments, consolidating consecutive lines + start = offset; + isDoc = false; + if (isDoubleSlashCommentLine(offset)) { + isDoc = true; + do { + offset = findEndOfLine(offset); + if (offset === length) { + break; + } + offset++; + } while (isDoubleSlashCommentLine(offset)); + } else { + offset = Math.min(length, findEndOfLine(offset) + 1); + } + if (isDoc) { + setComment(start, offset); + } + line++; + repeat = true; + } + } else if ((curr = charAt(offset)) === "*") { /* Block */ + // check for /** (regular comment mode) or /* (alternate comment mode) + start = offset + 1; + isDoc = alternateCommentMode || charAt(start) === "*"; + do { + if (curr === "\n") { + ++line; + } + if (++offset === length) { + throw illegal("comment"); + } + prev = curr; + curr = charAt(offset); + } while (prev !== "*" || curr !== "/"); + ++offset; + if (isDoc) { + setComment(start, offset - 2); + } + repeat = true; + } else { + return "/"; + } + } + } while (repeat); + + // offset !== length if we got here + + var end = offset; + delimRe.lastIndex = 0; + var delim = delimRe.test(charAt(end++)); + if (!delim) + while (end < length && !delimRe.test(charAt(end))) + ++end; + var token = source.substring(offset, offset = end); + if (token === "\"" || token === "'") + stringDelim = token; + return token; + } + + /** + * Pushes a token back to the stack. + * @param {string} token Token + * @returns {undefined} + * @inner + */ + function push(token) { + stack.push(token); + } + + /** + * Peeks for the next token. + * @returns {string|null} Token or `null` on eof + * @inner + */ + function peek() { + if (!stack.length) { + var token = next(); + if (token === null) + return null; + push(token); + } + return stack[0]; + } + + /** + * Skips a token. + * @param {string} expected Expected token + * @param {boolean} [optional=false] Whether the token is optional + * @returns {boolean} `true` when skipped, `false` if not + * @throws {Error} When a required token is not present + * @inner + */ + function skip(expected, optional) { + var actual = peek(), + equals = actual === expected; + if (equals) { + next(); + return true; + } + if (!optional) + throw illegal("token '" + actual + "', '" + expected + "' expected"); + return false; + } + + /** + * Gets a comment. + * @param {number} [trailingLine] Line number if looking for a trailing comment + * @returns {string|null} Comment text + * @inner + */ + function cmnt(trailingLine) { + var ret = null; + if (trailingLine === undefined) { + if (commentLine === line - 1 && (alternateCommentMode || commentType === "*" || commentLineEmpty)) { + ret = commentText; + } + } else { + /* istanbul ignore else */ + if (commentLine < trailingLine) { + peek(); + } + if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === "/")) { + ret = commentText; + } + } + return ret; + } + + return Object.defineProperty({ + next: next, + peek: peek, + push: push, + skip: skip, + cmnt: cmnt + }, "line", { + get: function() { return line; } + }); + /* eslint-enable callback-return */ +} diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/type.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/type.js new file mode 100644 index 00000000..06ee276b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/type.js @@ -0,0 +1,590 @@ +"use strict"; +module.exports = Type; + +// extends Namespace +var Namespace = require("./namespace"); +((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; + +var Enum = require("./enum"), + OneOf = require("./oneof"), + Field = require("./field"), + MapField = require("./mapfield"), + Service = require("./service"), + Message = require("./message"), + Reader = require("./reader"), + Writer = require("./writer"), + util = require("./util"), + encoder = require("./encoder"), + decoder = require("./decoder"), + verifier = require("./verifier"), + converter = require("./converter"), + wrappers = require("./wrappers"); + +/** + * Constructs a new reflected message type instance. + * @classdesc Reflected message type. + * @extends NamespaceBase + * @constructor + * @param {string} name Message name + * @param {Object.} [options] Declared options + */ +function Type(name, options) { + name = name.replace(/\W/g, ""); + Namespace.call(this, name, options); + + /** + * Message fields. + * @type {Object.} + */ + this.fields = {}; // toJSON, marker + + /** + * Oneofs declared within this namespace, if any. + * @type {Object.} + */ + this.oneofs = undefined; // toJSON + + /** + * Extension ranges, if any. + * @type {number[][]} + */ + this.extensions = undefined; // toJSON + + /** + * Reserved ranges, if any. + * @type {Array.} + */ + this.reserved = undefined; // toJSON + + /*? + * Whether this type is a legacy group. + * @type {boolean|undefined} + */ + this.group = undefined; // toJSON + + /** + * Cached fields by id. + * @type {Object.|null} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields as an array. + * @type {Field[]|null} + * @private + */ + this._fieldsArray = null; + + /** + * Cached oneofs as an array. + * @type {OneOf[]|null} + * @private + */ + this._oneofsArray = null; + + /** + * Cached constructor. + * @type {Constructor<{}>} + * @private + */ + this._ctor = null; +} + +Object.defineProperties(Type.prototype, { + + /** + * Message fields by id. + * @name Type#fieldsById + * @type {Object.} + * @readonly + */ + fieldsById: { + get: function() { + + /* istanbul ignore if */ + if (this._fieldsById) + return this._fieldsById; + + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { + var field = this.fields[names[i]], + id = field.id; + + /* istanbul ignore if */ + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); + } + }, + + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); + } + }, + + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type.generateConstructor(this)()); + }, + set: function(ctor) { + + // Ensure proper prototype + var prototype = ctor.prototype; + if (!(prototype instanceof Message)) { + (ctor.prototype = new Message()).constructor = ctor; + util.merge(ctor.prototype, prototype); + } + + // Classes and messages reference their reflected type + ctor.$type = ctor.prototype.$type = this; + + // Mix in static methods + util.merge(ctor, Message, true); + + this._ctor = ctor; + + // Messages have non-enumerable default values on their prototype + var i = 0; + for (; i < /* initializes */ this.fieldsArray.length; ++i) + this._fieldsArray[i].resolve(); // ensures a proper value + + // Messages have non-enumerable getters and setters for each virtual oneof field + var ctorProperties = {}; + for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) + ctorProperties[this._oneofsArray[i].resolve().name] = { + get: util.oneOfGetter(this._oneofsArray[i].oneof), + set: util.oneOfSetter(this._oneofsArray[i].oneof) + }; + if (i) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } +}); + +/** + * Generates a constructor function for the specified type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +Type.generateConstructor = function generateConstructor(mtype) { + /* eslint-disable no-unexpected-multiline */ + var gen = util.codegen(["p"], mtype.name); + // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype + for (var i = 0, field; i < mtype.fieldsArray.length; ++i) + if ((field = mtype._fieldsArray[i]).map) gen + ("this%s={}", util.safeProp(field.name)); + else if (field.repeated) gen + ("this%s=[]", util.safeProp(field.name)); + return gen + ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors + * @property {Object.} fields Field descriptors + * @property {number[][]} [extensions] Extension ranges + * @property {number[][]} [reserved] Reserved ranges + * @property {boolean} [group=false] Whether a legacy group or not + */ + +/** + * Creates a message type from a message type descriptor. + * @param {string} name Message name + * @param {IType} json Message type descriptor + * @returns {Type} Created message type + */ +Type.fromJSON = function fromJSON(name, json) { + var type = new Type(name, json.options); + type.extensions = json.extensions; + type.reserved = json.reserved; + var names = Object.keys(json.fields), + i = 0; + for (; i < names.length; ++i) + type.add( + ( typeof json.fields[names[i]].keyType !== "undefined" + ? MapField.fromJSON + : Field.fromJSON )(names[i], json.fields[names[i]]) + ); + if (json.oneofs) + for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) + type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); + if (json.nested) + for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { + var nested = json.nested[names[i]]; + type.add( // most to least likely + ( nested.id !== undefined + ? Field.fromJSON + : nested.fields !== undefined + ? Type.fromJSON + : nested.values !== undefined + ? Enum.fromJSON + : nested.methods !== undefined + ? Service.fromJSON + : Namespace.fromJSON )(names[i], nested) + ); + } + if (json.extensions && json.extensions.length) + type.extensions = json.extensions; + if (json.reserved && json.reserved.length) + type.reserved = json.reserved; + if (json.group) + type.group = true; + if (json.comment) + type.comment = json.comment; + return type; +}; + +/** + * Converts this message type to a message type descriptor. + * @param {IToJSONOptions} [toJSONOptions] JSON conversion options + * @returns {IType} Message type descriptor + */ +Type.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util.toObject([ + "options" , inherited && inherited.options || undefined, + "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), + "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, + "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, + "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, + "group" , this.group || undefined, + "nested" , inherited && inherited.nested || undefined, + "comment" , keepComments ? this.comment : undefined + ]); +}; + +/** + * @override + */ +Type.prototype.resolveAll = function resolveAll() { + var fields = this.fieldsArray, i = 0; + while (i < fields.length) + fields[i++].resolve(); + var oneofs = this.oneofsArray; i = 0; + while (i < oneofs.length) + oneofs[i++].resolve(); + return Namespace.prototype.resolveAll.call(this); +}; + +/** + * @override + */ +Type.prototype.get = function get(name) { + return this.fields[name] + || this.oneofs && this.oneofs[name] + || this.nested && this.nested[name] + || null; +}; + +/** + * Adds a nested object to this type. + * @param {ReflectionObject} object Nested object to add + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id + */ +Type.prototype.add = function add(object) { + + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + + if (object instanceof Field && object.extend === undefined) { + // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. + // The root object takes care of adding distinct sister-fields to the respective extended + // type instead. + + // avoids calling the getter if not absolutely necessary because it's called quite frequently + if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); +}; + +/** + * Removes a nested object from this type. + * @param {ReflectionObject} object Nested object to remove + * @returns {Type} `this` + * @throws {TypeError} If arguments are invalid + * @throws {Error} If `object` is not a member of this type + */ +Type.prototype.remove = function remove(object) { + if (object instanceof Field && object.extend === undefined) { + // See Type#add for the reason why extension fields are excluded here. + + /* istanbul ignore if */ + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + + /* istanbul ignore if */ + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); +}; + +/** + * Tests if the specified id is reserved. + * @param {number} id Id to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); +}; + +/** + * Tests if the specified name is reserved. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +Type.prototype.isReservedName = function isReservedName(name) { + return Namespace.isReservedName(this.reserved, name); +}; + +/** + * Creates a new message of this type using the specified properties. + * @param {Object.} [properties] Properties to set + * @returns {Message<{}>} Message instance + */ +Type.prototype.create = function create(properties) { + return new this.ctor(properties); +}; + +/** + * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. + * @returns {Type} `this` + */ +Type.prototype.setup = function setup() { + // Sets up everything at once so that the prototype chain does not have to be re-evaluated + // multiple times (V8, soft-deopt prototype-check). + + var fullName = this.fullName, + types = []; + for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) + types.push(this._fieldsArray[i].resolve().resolvedType); + + // Replace setup methods with type-specific generated functions + this.encode = encoder(this)({ + Writer : Writer, + types : types, + util : util + }); + this.decode = decoder(this)({ + Reader : Reader, + types : types, + util : util + }); + this.verify = verifier(this)({ + types : types, + util : util + }); + this.fromObject = converter.fromObject(this)({ + types : types, + util : util + }); + this.toObject = converter.toObject(this)({ + types : types, + util : util + }); + + // Inject custom wrappers for common types + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + // if (wrapper.fromObject) { + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + // } + // if (wrapper.toObject) { + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + // } + } + + return this; +}; + +/** + * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); // overrides this method +}; + +/** + * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. + * @param {Message<{}>|Object.} message Message instance or plain object + * @param {Writer} [writer] Writer to encode to + * @returns {Writer} writer + */ +Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); +}; + +/** + * Decodes a message of this type. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Length of the message, if known beforehand + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError<{}>} If required fields are missing + */ +Type.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); // overrides this method +}; + +/** + * Decodes a message of this type preceeded by its byte length as a varint. + * @param {Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Message<{}>} Decoded message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {util.ProtocolError} If required fields are missing + */ +Type.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); +}; + +/** + * Verifies that field values are valid and that required fields are present. + * @param {Object.} message Plain object to verify + * @returns {null|string} `null` if valid, otherwise the reason why it is not + */ +Type.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); // overrides this method +}; + +/** + * Creates a new message of this type from a plain object. Also converts values to their respective internal types. + * @param {Object.} object Plain object to convert + * @returns {Message<{}>} Message instance + */ +Type.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); +}; + +/** + * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. + * @interface IConversionOptions + * @property {Function} [longs] Long conversion type. + * Valid values are `String` and `Number` (the global types). + * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. + * @property {Function} [enums] Enum value conversion type. + * Only valid value is `String` (the global type). + * Defaults to copy the present value, which is the numeric id. + * @property {Function} [bytes] Bytes value conversion type. + * Valid values are `Array` and (a base64 encoded) `String` (the global types). + * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. + * @property {boolean} [defaults=false] Also sets default values on the resulting object + * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` + * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` + * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any + * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings + */ + +/** + * Creates a plain object from a message of this type. Also converts values to other types if specified. + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ +Type.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); +}; + +/** + * Decorator function as returned by {@link Type.d} (TypeScript). + * @typedef TypeDecorator + * @type {function} + * @param {Constructor} target Target constructor + * @returns {undefined} + * @template T extends Message + */ + +/** + * Type decorator (TypeScript). + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {TypeDecorator} Decorator function + * @template T extends Message + */ +Type.d = function decorateType(typeName) { + return function typeDecorator(target) { + util.decorateType(target, typeName); + }; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/types.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/types.js new file mode 100644 index 00000000..5fda19a6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/types.js @@ -0,0 +1,196 @@ +"use strict"; + +/** + * Common type constants. + * @namespace + */ +var types = exports; + +var util = require("./util"); + +var s = [ + "double", // 0 + "float", // 1 + "int32", // 2 + "uint32", // 3 + "sint32", // 4 + "fixed32", // 5 + "sfixed32", // 6 + "int64", // 7 + "uint64", // 8 + "sint64", // 9 + "fixed64", // 10 + "sfixed64", // 11 + "bool", // 12 + "string", // 13 + "bytes" // 14 +]; + +function bake(values, offset) { + var i = 0, o = {}; + offset |= 0; + while (i < values.length) o[s[i + offset]] = values[i++]; + return o; +} + +/** + * Basic type wire types. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + * @property {number} bytes=2 Ldelim wire type + */ +types.basic = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2, + /* bytes */ 2 +]); + +/** + * Basic type defaults. + * @type {Object.} + * @const + * @property {number} double=0 Double default + * @property {number} float=0 Float default + * @property {number} int32=0 Int32 default + * @property {number} uint32=0 Uint32 default + * @property {number} sint32=0 Sint32 default + * @property {number} fixed32=0 Fixed32 default + * @property {number} sfixed32=0 Sfixed32 default + * @property {number} int64=0 Int64 default + * @property {number} uint64=0 Uint64 default + * @property {number} sint64=0 Sint32 default + * @property {number} fixed64=0 Fixed64 default + * @property {number} sfixed64=0 Sfixed64 default + * @property {boolean} bool=false Bool default + * @property {string} string="" String default + * @property {Array.} bytes=Array(0) Bytes default + * @property {null} message=null Message default + */ +types.defaults = bake([ + /* double */ 0, + /* float */ 0, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 0, + /* sfixed32 */ 0, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 0, + /* sfixed64 */ 0, + /* bool */ false, + /* string */ "", + /* bytes */ util.emptyArray, + /* message */ null +]); + +/** + * Basic long type wire types. + * @type {Object.} + * @const + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + */ +types.long = bake([ + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1 +], 7); + +/** + * Allowed types for map keys with their associated wire type. + * @type {Object.} + * @const + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + * @property {number} string=2 Ldelim wire type + */ +types.mapKey = bake([ + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0, + /* string */ 2 +], 2); + +/** + * Allowed types for packed repeated fields with their associated wire type. + * @type {Object.} + * @const + * @property {number} double=1 Fixed64 wire type + * @property {number} float=5 Fixed32 wire type + * @property {number} int32=0 Varint wire type + * @property {number} uint32=0 Varint wire type + * @property {number} sint32=0 Varint wire type + * @property {number} fixed32=5 Fixed32 wire type + * @property {number} sfixed32=5 Fixed32 wire type + * @property {number} int64=0 Varint wire type + * @property {number} uint64=0 Varint wire type + * @property {number} sint64=0 Varint wire type + * @property {number} fixed64=1 Fixed64 wire type + * @property {number} sfixed64=1 Fixed64 wire type + * @property {number} bool=0 Varint wire type + */ +types.packed = bake([ + /* double */ 1, + /* float */ 5, + /* int32 */ 0, + /* uint32 */ 0, + /* sint32 */ 0, + /* fixed32 */ 5, + /* sfixed32 */ 5, + /* int64 */ 0, + /* uint64 */ 0, + /* sint64 */ 0, + /* fixed64 */ 1, + /* sfixed64 */ 1, + /* bool */ 0 +]); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/typescript.jsdoc b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/typescript.jsdoc new file mode 100644 index 00000000..33bc5180 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/typescript.jsdoc @@ -0,0 +1,22 @@ +/** + * Constructor type. + * @interface Constructor + * @extends Function + * @template T + * @tstype new(...params: any[]): T; prototype: T; + */ + +/** + * Properties type. + * @typedef Properties + * @template T + * @type {Object.} + * @tstype { [P in keyof T]?: T[P] } + */ + +/** + * Type that is convertible to array. + * @interface ToArray + * @template T + * @tstype toArray(): T[]; + */ diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util.js new file mode 100644 index 00000000..a5a9a835 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util.js @@ -0,0 +1,178 @@ +"use strict"; + +/** + * Various utility functions. + * @namespace + */ +var util = module.exports = require("./util/minimal"); + +var roots = require("./roots"); + +var Type, // cyclic + Enum; + +util.codegen = require("@protobufjs/codegen"); +util.fetch = require("@protobufjs/fetch"); +util.path = require("@protobufjs/path"); + +/** + * Node's fs module if available. + * @type {Object.} + */ +util.fs = util.inquire("fs"); + +/** + * Converts an object's values to an array. + * @param {Object.} object Object to convert + * @returns {Array.<*>} Converted array + */ +util.toArray = function toArray(object) { + if (object) { + var keys = Object.keys(object), + array = new Array(keys.length), + index = 0; + while (index < keys.length) + array[index] = object[keys[index++]]; + return array; + } + return []; +}; + +/** + * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. + * @param {Array.<*>} array Array to convert + * @returns {Object.} Converted object + */ +util.toObject = function toObject(array) { + var object = {}, + index = 0; + while (index < array.length) { + var key = array[index++], + val = array[index++]; + if (val !== undefined) + object[key] = val; + } + return object; +}; + +var safePropBackslashRe = /\\/g, + safePropQuoteRe = /"/g; + +/** + * Tests whether the specified name is a reserved word in JS. + * @param {string} name Name to test + * @returns {boolean} `true` if reserved, otherwise `false` + */ +util.isReserved = function isReserved(name) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); +}; + +/** + * Returns a safe property accessor for the specified property name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) + return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; + return "." + prop; +}; + +/** + * Converts the first character of a string to upper case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.ucFirst = function ucFirst(str) { + return str.charAt(0).toUpperCase() + str.substring(1); +}; + +var camelCaseRe = /_([a-z])/g; + +/** + * Converts a string to camel case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0, 1) + + str.substring(1) + .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Compares reflected fields by id. + * @param {Field} a First field + * @param {Field} b Second field + * @returns {number} Comparison value + */ +util.compareFieldsById = function compareFieldsById(a, b) { + return a.id - b.id; +}; + +/** + * Decorator helper for types (TypeScript). + * @param {Constructor} ctor Constructor function + * @param {string} [typeName] Type name, defaults to the constructor's name + * @returns {Type} Reflected type + * @template T extends Message + * @property {Root} root Decorators root + */ +util.decorateType = function decorateType(ctor, typeName) { + + /* istanbul ignore if */ + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + + /* istanbul ignore next */ + if (!Type) + Type = require("./type"); + + var type = new Type(typeName || ctor.name); + util.decorateRoot.add(type); + type.ctor = ctor; // sets up .encode, .decode etc. + Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); + return type; +}; + +var decorateEnumIndex = 0; + +/** + * Decorator helper for enums (TypeScript). + * @param {Object} object Enum object + * @returns {Enum} Reflected enum + */ +util.decorateEnum = function decorateEnum(object) { + + /* istanbul ignore if */ + if (object.$type) + return object.$type; + + /* istanbul ignore next */ + if (!Enum) + Enum = require("./enum"); + + var enm = new Enum("Enum" + decorateEnumIndex++, object); + util.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; +}; + +/** + * Decorator root (TypeScript). + * @name util.decorateRoot + * @type {Root} + * @readonly + */ +Object.defineProperty(util, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require("./root"))()); + } +}); diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/longbits.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/longbits.js new file mode 100644 index 00000000..e6ef908d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/longbits.js @@ -0,0 +1,200 @@ +"use strict"; +module.exports = LongBits; + +var util = require("../util/minimal"); + +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { + + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} + +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); + +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; + +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); +}; + +/** + * Constructs new long bits from a number, long or string. + * @param {number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; + +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; + +/* + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; + +var charCodeAt = String.prototype.charCodeAt; + +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; + +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; + +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; + +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; + +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/minimal.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/minimal.js new file mode 100644 index 00000000..ca50bb7b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/util/minimal.js @@ -0,0 +1,406 @@ +"use strict"; +var util = exports; + +// used to return a Promise where callback is omitted +util.asPromise = require("@protobufjs/aspromise"); + +// converts to / from base64 encoded strings +util.base64 = require("@protobufjs/base64"); + +// base class of rpc.Service +util.EventEmitter = require("@protobufjs/eventemitter"); + +// float handling accross browsers +util.float = require("@protobufjs/float"); + +// requires modules optionally and hides the call from bundlers +util.inquire = require("@protobufjs/inquire"); + +// converts to / from utf8 encoded strings +util.utf8 = require("@protobufjs/utf8"); + +// provides a node-like buffer pool in the browser +util.pool = require("@protobufjs/pool"); + +// utility to work with the low and high bits of a 64 bit value +util.LongBits = require("./longbits"); + +// global object reference +util.global = typeof window !== "undefined" && window + || typeof global !== "undefined" && global + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this + +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + * @const + */ +util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); + +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; + +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; + +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = + +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; + +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; + } +})(); + +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; + +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; + +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + +/* + * Long.js's Long class if available and $ENABLE_LONG is set. This lets us leave it on + * for this package's tests but have it be off in actual usage-reporting-protobuf use. + * (We leave it on for some mode where there is no `process` that is used by tests.) + */ +util.Long = (typeof process === 'undefined' || process.env.ENABLE_LONG) ? (/* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long")) : undefined; + +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; + +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + +/* + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; + +/* + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; + +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} + +util.merge = merge; + +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; + +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + + function CustomError(message, properties) { + + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function + + Object.defineProperty(this, "message", { get: function() { return message; } }); + + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); + + if (properties) + merge(this, properties); + } + + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; + + return CustomError; +} + +util.newError = newError; + +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); + +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; + +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; + +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; + +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/verifier.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/verifier.js new file mode 100644 index 00000000..b994729e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/verifier.js @@ -0,0 +1,191 @@ +"use strict"; +module.exports = verifier; + +var Enum = require("./enum"), + util = require("./util"); + +function invalid(field, expected) { + return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; +} + +/** + * Generates a partial value verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {number} fieldIndex Field index + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + if (field.resolvedType) { + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen + ("case %i:", field.resolvedType.values[keys[j]]); + gen + ("break") + ("}"); + } else { + gen + ("{") + ("var e=types[%i].verify(%s);", fieldIndex, ref) + ("if(e)") + ("return%j+e", field.name + ".") + ("}"); + } + } else { + switch (field.type) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "float": + case "double": gen + ("if(typeof %s!==\"number\")", ref) + ("return%j", invalid(field, "number")); + break; + case "bool": gen + ("if(typeof %s!==\"boolean\")", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + } + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a partial key verifier. + * @param {Codegen} gen Codegen instance + * @param {Field} field Reflected field + * @param {string} ref Variable reference + * @returns {Codegen} Codegen instance + * @ignore + */ +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.key32Re.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not + ("return%j", invalid(field, "integer|Long key")); + break; + case "bool": gen + ("if(!util.key2Re.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + return gen; + /* eslint-enable no-unexpected-multiline */ +} + +/** + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ +function verifier(mtype) { + /* eslint-disable no-unexpected-multiline */ + + var gen = util.codegen(["m"], mtype.name + "$verify") + ("if(typeof m!==\"object\"||m===null)") + ("return%j", "object expected"); + var oneofs = mtype.oneofsArray, + seenFirstField = {}; + if (oneofs.length) gen + ("var p={}"); + + for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { + var field = mtype._fieldsArray[i].resolve(), + ref = "m" + util.safeProp(field.name); + + if (field.optional) gen + ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null + + // map fields + if (field.map) { gen + ("if(!util.isObject(%s))", ref) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(%s)", ref) + ("for(var i=0;i} + * @const + */ +var wrappers = exports; + +var Message = require("./message"); + +/** + * From object converter part of an {@link IWrapper}. + * @typedef WrapperFromObjectConverter + * @type {function} + * @param {Object.} object Plain object + * @returns {Message<{}>} Message instance + * @this Type + */ + +/** + * To object converter part of an {@link IWrapper}. + * @typedef WrapperToObjectConverter + * @type {function} + * @param {Message<{}>} message Message instance + * @param {IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + * @this Type + */ + +/** + * Common type wrapper part of {@link wrappers}. + * @interface IWrapper + * @property {WrapperFromObjectConverter} [fromObject] From object converter + * @property {WrapperToObjectConverter} [toObject] To object converter + */ + +// Custom wrapper for Any +wrappers[".google.protobuf.Any"] = { + + fromObject: function(object) { + + // unwrap value type if mapped + if (object && object["@type"]) { + var type = this.lookup(object["@type"]); + /* istanbul ignore else */ + if (type) { + // type_url does not accept leading "." + var type_url = object["@type"].charAt(0) === "." ? + object["@type"].substr(1) : object["@type"]; + // type_url prefix is optional, but path seperator is required + return this.create({ + type_url: "/" + type_url, + value: type.encode(type.fromObject(object)).finish() + }); + } + } + + return this.fromObject(object); + }, + + toObject: function(message, options) { + + // decode value if requested and unmapped + if (options && options.json && message.type_url && message.value) { + // Only use fully qualified type name after the last '/' + var name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); + var type = this.lookup(name); + /* istanbul ignore else */ + if (type) + message = type.decode(message.value); + } + + // wrap value if unmapped + if (!(message instanceof this.ctor) && message instanceof Message) { + var object = message.$type.toObject(message, options); + object["@type"] = message.$type.fullName; + return object; + } + + return this.toObject(message, options); + } +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer.js new file mode 100644 index 00000000..55aaf6eb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer.js @@ -0,0 +1,459 @@ +"use strict"; +module.exports = Writer; + +var util = require("./util/minimal"); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; + +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { + + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + + /** + * Value byte length. + * @type {number} + */ + this.len = len; + + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; + + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} + +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function + +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { + + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} + +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { + + /** + * Current length. + * @type {number} + */ + this.len = 0; + + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} + +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; + +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; + +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; + +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; + +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; + +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +/** + * Writes an unsigned 64 bit value as a varint. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; + +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; + +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; + +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; + +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; + +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; + +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; + +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; + +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; + +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; + +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; + +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; + +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; + +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; + +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; + +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; + +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; +}; diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer_buffer.js b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer_buffer.js new file mode 100644 index 00000000..55c479ce --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/src/writer_buffer.js @@ -0,0 +1,81 @@ +"use strict"; +module.exports = BufferWriter; + +// extends Writer +var Writer = require("./writer"); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + +var util = require("./util/minimal"); + +var Buffer = util.Buffer; + +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} + +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ +BufferWriter.alloc = function alloc_buffer(size) { + return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +}; + +var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; + +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(writeBytesBuffer, len, value); + return this; +}; + +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else + buf.utf8Write(val, pos); +} + +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; + + +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/tsconfig.json b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/tsconfig.json new file mode 100644 index 00000000..22852fa6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "target": "ES5", + "experimentalDecorators": true, + "emitDecoratorMetadata": true + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/aspromise b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/aspromise new file mode 120000 index 00000000..b4e9aab1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/aspromise @@ -0,0 +1 @@ +../../../@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/base64 b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/base64 new file mode 120000 index 00000000..44013079 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/base64 @@ -0,0 +1 @@ +../../../@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64 \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/codegen b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/codegen new file mode 120000 index 00000000..8ececa9d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/codegen @@ -0,0 +1 @@ +../../../@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/eventemitter b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/eventemitter new file mode 120000 index 00000000..34e33411 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/eventemitter @@ -0,0 +1 @@ +../../../@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/fetch b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/fetch new file mode 120000 index 00000000..e9f89987 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/fetch @@ -0,0 +1 @@ +../../../@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/float b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/float new file mode 120000 index 00000000..babc9ebf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/float @@ -0,0 +1 @@ +../../../@protobufjs+float@1.0.2/node_modules/@protobufjs/float \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/inquire b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/inquire new file mode 120000 index 00000000..b23855dc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/inquire @@ -0,0 +1 @@ +../../../@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/path b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/path new file mode 120000 index 00000000..742ed6c6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/path @@ -0,0 +1 @@ +../../../@protobufjs+path@1.1.2/node_modules/@protobufjs/path \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/pool b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/pool new file mode 120000 index 00000000..53444f76 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/pool @@ -0,0 +1 @@ +../../../@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/utf8 b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/utf8 new file mode 120000 index 00000000..b28c7958 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@protobufjs/utf8 @@ -0,0 +1 @@ +../../../@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8 \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@types/long b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@types/long new file mode 120000 index 00000000..8defe1fa --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/@types/long @@ -0,0 +1 @@ +../../../@types+long@4.0.2/node_modules/@types/long \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/long b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/long new file mode 120000 index 00000000..8730e09d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+protobufjs@1.2.8/node_modules/long @@ -0,0 +1 @@ +../../long@4.0.0/node_modules/long \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/README.md b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/README.md new file mode 100644 index 00000000..6bbb3da1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/README.md @@ -0,0 +1,11 @@ +# Apollo Server/Gateway interface + +This package defines TypeScript types for the interface between Apollo Server and Apollo Gateway. It contains no runtime code. + +The types in this package describe the API as of Gateway 0.35.0 (ie, with onSchemaLoadOrUpdate). It is extracted from the Apollo Server 3 `apollo-server-types` package. Most of the type names have been changed to start with `Gateway`, so that they coexist better with similarly-named types. (Because TypeScript is generally structurally typed, this is OK.) + +Note that the cache scope field (eg, on `requestContext.overallCachePolicy.scope`) is defined as `any` in this package. That's because in AS3 this type is an enum, and enums in TypeScript are _not_ structurally typed. So we can't actually create an object of this type without depending on AS3 (or updating AS3 to get its definition from somewhere shared). + +We have updated `@apollo/gateway` (v0 and v2) to define its types from this package rather than `apollo-server-types`. This allows Gateway to be compatible with AS v3-v5 (and even AS2, for Gateway 0.x) without needing to pull either package's code into the TypeScript build. + +Apollo Server directly depends on this package and uses its types to construct its calls to the Gateway. diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts new file mode 100644 index 00000000..99113db5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts @@ -0,0 +1,96 @@ +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { DocumentNode, ExecutionResult, GraphQLError, GraphQLFormattedError, GraphQLSchema, OperationDefinitionNode } from 'graphql'; +import type { Logger } from '@apollo/utils.logger'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { FetcherHeaders } from '@apollo/utils.fetcher'; +export interface GatewayInterface { + onSchemaLoadOrUpdate(callback: GatewaySchemaLoadOrUpdateCallback): GatewayUnsubscriber; + load(options: { + apollo: GatewayApolloConfig; + }): Promise; + stop(): Promise; +} +export type GatewaySchemaLoadOrUpdateCallback = (schemaContext: { + apiSchema: GraphQLSchema; + coreSupergraphSdl: string; +}) => void; +export type GatewayUnsubscriber = () => void; +export interface GatewayApolloConfig { + key?: string; + keyHash?: string; + graphRef?: string; +} +export interface GatewayLoadResult { + executor: GatewayExecutor | null; +} +export type GatewayExecutor = (requestContext: GatewayGraphQLRequestContext) => Promise; +export type GatewayExecutionResult = ExecutionResult, Record>; +export interface GatewayGraphQLRequestContext> { + readonly request: GatewayGraphQLRequest; + readonly response?: GatewayGraphQLResponse; + logger: Logger; + readonly schema: GraphQLSchema; + readonly schemaHash: GatewaySchemaHash; + readonly context: TContext; + readonly cache: KeyValueCache; + readonly queryHash: string; + readonly document: DocumentNode; + readonly source: string; + readonly operationName: string | null; + readonly operation: OperationDefinitionNode; + readonly errors?: ReadonlyArray; + readonly metrics: GatewayGraphQLRequestMetrics; + debug?: boolean; + readonly overallCachePolicy: any; + readonly requestIsBatched?: boolean; +} +export interface GatewayGraphQLRequest { + query?: string; + operationName?: string; + variables?: Record; + extensions?: Record; + http?: GatewayHTTPRequest; +} +export interface GatewayHTTPRequest { + readonly method: string; + readonly url: string; + readonly headers: FetcherHeaders; +} +export interface GatewayGraphQLResponse { + data?: Record | null; + errors?: ReadonlyArray; + extensions?: Record; + http?: GatewayHTTPResponse; +} +export interface GatewayHTTPResponse { + readonly headers: FetcherHeaders; + status?: number; +} +export type GatewaySchemaHash = string & { + __fauxpaque: 'SchemaHash'; +}; +export interface NonFtv1ErrorPath { + subgraph: string; + path: GraphQLError['path']; +} +export interface GatewayGraphQLRequestMetrics { + captureTraces?: boolean; + persistedQueryHit?: boolean; + persistedQueryRegister?: boolean; + responseCacheHit?: boolean; + forbiddenOperation?: boolean; + registeredOperation?: boolean; + startHrTime?: [number, number]; + queryPlanTrace?: Trace.QueryPlanNode; + nonFtv1ErrorPaths?: NonFtv1ErrorPath[]; +} +export interface GatewayCachePolicy extends GatewayCacheHint { + replace(hint: GatewayCacheHint): void; + restrict(hint: GatewayCacheHint): void; + policyIfCacheable(): Required | null; +} +export interface GatewayCacheHint { + maxAge?: number; + scope?: any; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts.map new file mode 100644 index 00000000..8e90073a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACxB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACn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/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js new file mode 100644 index 00000000..aa219d8f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js.map b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js.map new file mode 100644 index 00000000..2721744a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/package.json b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts new file mode 100644 index 00000000..99113db5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts @@ -0,0 +1,96 @@ +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { DocumentNode, ExecutionResult, GraphQLError, GraphQLFormattedError, GraphQLSchema, OperationDefinitionNode } from 'graphql'; +import type { Logger } from '@apollo/utils.logger'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { FetcherHeaders } from '@apollo/utils.fetcher'; +export interface GatewayInterface { + onSchemaLoadOrUpdate(callback: GatewaySchemaLoadOrUpdateCallback): GatewayUnsubscriber; + load(options: { + apollo: GatewayApolloConfig; + }): Promise; + stop(): Promise; +} +export type GatewaySchemaLoadOrUpdateCallback = (schemaContext: { + apiSchema: GraphQLSchema; + coreSupergraphSdl: string; +}) => void; +export type GatewayUnsubscriber = () => void; +export interface GatewayApolloConfig { + key?: string; + keyHash?: string; + graphRef?: string; +} +export interface GatewayLoadResult { + executor: GatewayExecutor | null; +} +export type GatewayExecutor = (requestContext: GatewayGraphQLRequestContext) => Promise; +export type GatewayExecutionResult = ExecutionResult, Record>; +export interface GatewayGraphQLRequestContext> { + readonly request: GatewayGraphQLRequest; + readonly response?: GatewayGraphQLResponse; + logger: Logger; + readonly schema: GraphQLSchema; + readonly schemaHash: GatewaySchemaHash; + readonly context: TContext; + readonly cache: KeyValueCache; + readonly queryHash: string; + readonly document: DocumentNode; + readonly source: string; + readonly operationName: string | null; + readonly operation: OperationDefinitionNode; + readonly errors?: ReadonlyArray; + readonly metrics: GatewayGraphQLRequestMetrics; + debug?: boolean; + readonly overallCachePolicy: any; + readonly requestIsBatched?: boolean; +} +export interface GatewayGraphQLRequest { + query?: string; + operationName?: string; + variables?: Record; + extensions?: Record; + http?: GatewayHTTPRequest; +} +export interface GatewayHTTPRequest { + readonly method: string; + readonly url: string; + readonly headers: FetcherHeaders; +} +export interface GatewayGraphQLResponse { + data?: Record | null; + errors?: ReadonlyArray; + extensions?: Record; + http?: GatewayHTTPResponse; +} +export interface GatewayHTTPResponse { + readonly headers: FetcherHeaders; + status?: number; +} +export type GatewaySchemaHash = string & { + __fauxpaque: 'SchemaHash'; +}; +export interface NonFtv1ErrorPath { + subgraph: string; + path: GraphQLError['path']; +} +export interface GatewayGraphQLRequestMetrics { + captureTraces?: boolean; + persistedQueryHit?: boolean; + persistedQueryRegister?: boolean; + responseCacheHit?: boolean; + forbiddenOperation?: boolean; + registeredOperation?: boolean; + startHrTime?: [number, number]; + queryPlanTrace?: Trace.QueryPlanNode; + nonFtv1ErrorPaths?: NonFtv1ErrorPath[]; +} +export interface GatewayCachePolicy extends GatewayCacheHint { + replace(hint: GatewayCacheHint): void; + restrict(hint: GatewayCacheHint): void; + policyIfCacheable(): Required | null; +} +export interface GatewayCacheHint { + maxAge?: number; + scope?: any; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts.map new file mode 100644 index 00000000..8e90073a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,aAAa,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C,EAAE,MAAM,CAAC;IAOhB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js new file mode 100644 index 00000000..f8a711af --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js.map b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js.map new file mode 100644 index 00000000..2721744a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/package.json b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/package.json new file mode 100644 index 00000000..7c34deb5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.cjs.tsbuildinfo b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.cjs.tsbuildinfo new file mode 100644 index 00000000..33662053 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.cjs.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts","../../../node_modules/lru-cache/dist/commonjs/index.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts","../node_modules/@apollo/utils.logger/dist/index.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts","../../../node_modules/graphql/version.d.ts","../../../node_modules/graphql/jsutils/Maybe.d.ts","../../../node_modules/graphql/language/source.d.ts","../../../node_modules/graphql/jsutils/ObjMap.d.ts","../../../node_modules/graphql/jsutils/Path.d.ts","../../../node_modules/graphql/jsutils/PromiseOrValue.d.ts","../../../node_modules/graphql/language/kinds.d.ts","../../../node_modules/graphql/language/tokenKind.d.ts","../../../node_modules/graphql/language/ast.d.ts","../../../node_modules/graphql/language/location.d.ts","../../../node_modules/graphql/error/GraphQLError.d.ts","../../../node_modules/graphql/language/directiveLocation.d.ts","../../../node_modules/graphql/type/directives.d.ts","../../../node_modules/graphql/type/schema.d.ts","../../../node_modules/graphql/type/definition.d.ts","../../../node_modules/graphql/execution/execute.d.ts","../../../node_modules/graphql/graphql.d.ts","../../../node_modules/graphql/type/scalars.d.ts","../../../node_modules/graphql/type/introspection.d.ts","../../../node_modules/graphql/type/validate.d.ts","../../../node_modules/graphql/type/assertName.d.ts","../../../node_modules/graphql/type/index.d.ts","../../../node_modules/graphql/language/printLocation.d.ts","../../../node_modules/graphql/language/lexer.d.ts","../../../node_modules/graphql/language/parser.d.ts","../../../node_modules/graphql/language/printer.d.ts","../../../node_modules/graphql/language/visitor.d.ts","../../../node_modules/graphql/language/predicates.d.ts","../../../node_modules/graphql/language/index.d.ts","../../../node_modules/graphql/execution/subscribe.d.ts","../../../node_modules/graphql/execution/values.d.ts","../../../node_modules/graphql/execution/index.d.ts","../../../node_modules/graphql/subscription/index.d.ts","../../../node_modules/graphql/utilities/TypeInfo.d.ts","../../../node_modules/graphql/validation/ValidationContext.d.ts","../../../node_modules/graphql/validation/validate.d.ts","../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts","../../../node_modules/graphql/validation/specifiedRules.d.ts","../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts","../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts","../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts","../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts","../../../node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts","../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts","../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts","../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts","../../../node_modules/graphql/validation/index.d.ts","../../../node_modules/graphql/error/syntaxError.d.ts","../../../node_modules/graphql/error/locatedError.d.ts","../../../node_modules/graphql/error/index.d.ts","../../../node_modules/graphql/utilities/getIntrospectionQuery.d.ts","../../../node_modules/graphql/utilities/getOperationAST.d.ts","../../../node_modules/graphql/utilities/getOperationRootType.d.ts","../../../node_modules/graphql/utilities/introspectionFromSchema.d.ts","../../../node_modules/graphql/utilities/buildClientSchema.d.ts","../../../node_modules/graphql/utilities/buildASTSchema.d.ts","../../../node_modules/graphql/utilities/extendSchema.d.ts","../../../node_modules/graphql/utilities/lexicographicSortSchema.d.ts","../../../node_modules/graphql/utilities/printSchema.d.ts","../../../node_modules/graphql/utilities/typeFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromASTUntyped.d.ts","../../../node_modules/graphql/utilities/astFromValue.d.ts","../../../node_modules/graphql/utilities/coerceInputValue.d.ts","../../../node_modules/graphql/utilities/concatAST.d.ts","../../../node_modules/graphql/utilities/separateOperations.d.ts","../../../node_modules/graphql/utilities/stripIgnoredCharacters.d.ts","../../../node_modules/graphql/utilities/typeComparators.d.ts","../../../node_modules/graphql/utilities/assertValidName.d.ts","../../../node_modules/graphql/utilities/findBreakingChanges.d.ts","../../../node_modules/graphql/utilities/typedQueryDocumentNode.d.ts","../../../node_modules/graphql/utilities/index.d.ts","../../../node_modules/graphql/index.d.ts","../../../node_modules/@apollo/protobufjs/index.d.ts","../../usage-reporting-protobuf/generated/esm/protobuf.d.ts","../../../node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../node_modules/@apollo/utils.fetcher/dist/index.d.ts","../src/index.ts"],"fileIdsList":[[177,220],[177,217,220],[177,219,220],[220],[177,220,225,254],[177,220,221,226,232,233,240,251,262],[177,220,221,222,232,240],[172,173,174,177,220],[177,220,223,263],[177,220,224,225,233,241],[177,220,225,251,259],[177,220,226,228,232,240],[177,219,220,227],[177,220,228,229],[177,220,230,232],[177,219,220,232],[177,220,232,233,234,251,262],[177,220,232,233,234,247,251,254],[177,215,220],[177,220,228,232,235,240,251,262],[177,220,232,233,235,236,240,251,259,262],[177,220,235,237,251,259,262],[175,176,177,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268],[177,220,232,238],[177,220,239,262,267],[177,220,228,232,240,251],[177,220,241],[177,220,242],[177,219,220,243],[177,217,218,219,220,221,222,223,224,225,226,227,228,229,230,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268],[177,220,245],[177,220,246],[177,220,232,247,248],[177,220,247,249,263,265],[177,220,232,251,252,254],[177,220,253,254],[177,220,251,252],[177,220,254],[177,220,255],[177,217,220,251,256],[177,220,232,257,258],[177,220,257,258],[177,220,225,240,251,259],[177,220,260],[177,220,240,261],[177,220,235,246,262],[177,220,225,263],[177,220,251,264],[177,220,239,265],[177,220,266],[177,220,232,234,243,251,254,262,265,267],[177,220,251,268],[70,71,77,78,177,220],[79,144,145,177,220],[70,77,79,177,220],[71,79,177,220],[70,72,73,74,77,79,82,83,177,220],[73,84,98,99,177,220],[70,77,82,83,84,177,220],[70,72,77,79,81,82,83,177,220],[70,71,82,83,84,177,220],[69,85,90,97,100,101,143,146,168,177,220],[70,177,220],[71,75,76,177,220],[71,75,76,77,78,80,91,92,93,94,95,96,177,220],[71,76,77,177,220],[71,177,220],[70,71,76,77,79,92,177,220],[77,177,220],[71,77,78,177,220],[75,77,177,220],[84,98,177,220],[70,72,73,74,77,82,177,220],[70,77,80,83,177,220],[73,81,82,83,86,87,88,89,177,220],[83,177,220],[70,72,77,79,81,83,177,220],[79,82,177,220],[70,77,81,82,83,95,177,220],[79,177,220],[70,77,83,177,220],[71,77,82,93,177,220],[82,147,177,220],[79,83,177,220],[77,82,177,220],[82,177,220],[70,80,177,220],[70,77,177,220],[77,82,83,177,220],[102,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,177,220],[82,83,177,220],[72,77,177,220],[70,72,77,83,177,220],[70,72,77,177,220],[70,77,79,81,82,83,95,102,177,220],[103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,177,220],[95,103,177,220],[103,105,177,220],[70,77,79,82,102,103,177,220],[177,187,191,220,262],[177,187,220,251,262],[177,182,220],[177,184,187,220,259,262],[177,220,240,259],[177,220,269],[177,182,220,269],[177,184,187,220,240,262],[177,179,180,183,186,220,232,251,262],[177,187,194,220],[177,179,185,220],[177,187,208,209,220],[177,183,187,220,254,262,269],[177,208,220,269],[177,181,182,220,269],[177,187,220],[177,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,220],[177,187,202,220],[177,187,194,195,220],[177,185,187,195,196,220],[177,186,220],[177,179,182,187,220],[177,187,191,195,196,220],[177,191,220],[177,185,187,190,220,262],[177,179,184,187,194,220],[177,220,251],[177,182,187,208,220,267,269],[62,66,177,220],[62,64,177,220],[68,177,220],[62,63,65,67,177,220],[66,68,169,171,177,220,270],[170,177,220]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a08f0772c2acd69cdf321856af995e34533ba770741804b4d82afa7ffb44fc70","impliedFormat":1},{"version":"2a598a1349db30f21eb8f40c9d4794f40f1ef66dbb9d98648377f4d979a54533","impliedFormat":1},{"version":"599b42c2c7227d59788f9239a30b16e465e15127c7c4541d30b801c23ca681e6","impliedFormat":1},{"version":"612d916ad317ce5fe844c68fe72910a8c3561b5cb201b09e8a37ec800f49800a","impliedFormat":1},{"version":"58d9aa65560fbd9932063c2be022c9346ab7c79ccd10522c61b60cc112ac4341","impliedFormat":1},{"version":"fae1ca177e7893674e190443a9408c79ce71a2e46595c0d9ed147b915f44b6c1","impliedFormat":1},{"version":"0d174b13b0caadaa71768315875a8230fb2bcafa413193e537392de59fc0e3d6","impliedFormat":1},{"version":"78647004e18e4c16b8a2e8345fca9267573d1c5a29e11ddfee71858fd077ef6e","impliedFormat":1},{"version":"0804044cd0488cb7212ddbc1d0f8e1a5bd32970335dbfc613052304a1b0318f9","impliedFormat":1},{"version":"b725acb041d2a18fde8f46c48a1408418489c4aa222f559b1ef47bf267cb4be0","impliedFormat":1},{"version":"85084ae98c1d319e38ef99b1216d3372a9afd7a368022c01c3351b339d52cb58","impliedFormat":1},{"version":"898ec2410fae172e0a9416448b0838bed286322a5c0c8959e8e39400cd4c5697","impliedFormat":1},{"version":"692345a43bac37c507fa7065c554258435ab821bbe4fb44b513a70063e932b45","impliedFormat":1},{"version":"cddd50d7bd9d7fddda91a576db9f61655d1a55e2d870f154485812f6e39d4c15","impliedFormat":1},{"version":"0539583b089247b73a21eb4a5f7e43208a129df6300d6b829dc1039b79b6c8c4","impliedFormat":1},{"version":"3f0be705feb148ae75766143c5c849ec4cc77d79386dcfa08f18d4c9063601cc","impliedFormat":1},{"version":"522edc786ed48304671b935cf7d3ed63acc6636ab9888c6e130b97a6aea92b46","impliedFormat":1},{"version":"a9607a8f1ce7582dbeebc0816897925bf9b307cc05235e582b272a48364f8aa0","impliedFormat":1},{"version":"de21641eb8edcbc08dd0db4ee70eea907cd07fe72267340b5571c92647f10a77","impliedFormat":1},{"version":"48af3609dc95fa62c22c8ec047530daf1776504524d284d2c3f9c163725bdbd4","impliedFormat":1},{"version":"6758f7b72fa4d38f4f4b865516d3d031795c947a45cc24f2cfba43c91446d678","impliedFormat":1},{"version":"1fefab6dc739d33b7cb3fd08cd9d35dd279fcd7746965e200500b1a44d32db9e","impliedFormat":1},{"version":"cb719e699d1643112cc137652ed66341602a7d3cc5ec7062f10987ffe81744f6","impliedFormat":1},{"version":"bdf7abbd7df4f29b3e0728684c790e80590b69d92ed8d3bf8e66d4bd713941fe","impliedFormat":1},{"version":"8decb32fc5d44b403b46c3bb4741188df4fbc3c66d6c65669000c5c9cd506523","impliedFormat":1},{"version":"4beaf337ee755b8c6115ff8a17e22ceab986b588722a52c776b8834af64e0f38","impliedFormat":1},{"version":"c26dd198f2793bbdcc55103823a2767d6223a7fdb92486c18b86deaf63208354","impliedFormat":1},{"version":"93551b302a808f226f0846ad8012354f2d53d6dedc33b540d6ca69836781a574","impliedFormat":1},{"version":"040cb635dff5fc934413fa211d3a982122bf0e46acae9f7a369c61811f277047","impliedFormat":1},{"version":"778b684ebc6b006fcffeab77d25b34bf6e400100e0ec0c76056e165c6399ab05","impliedFormat":1},{"version":"463851fa993af55fb0296e0d6afa27407ef91bf6917098dd665aba1200d250c7","impliedFormat":1},{"version":"f0d8459d18cebd8a9699de96bfe1d4fe8bcf772abfa95bbfd74a2ce92d8bc55b","impliedFormat":1},{"version":"be8f369f8d7e887eab87a3e4e41f1afcf61bf06056801383152aa83bda1f6a72","impliedFormat":1},{"version":"352bfb5f3a9d8a9c2464ad2dc0b2dc56a8212650a541fb550739c286dd341de1","impliedFormat":1},{"version":"a5aae636d9afdacb22d98e4242487436d8296e5a345348325ccc68481fe1b690","impliedFormat":1},{"version":"d007c769e33e72e51286b816d82cd7c3a280cba714e7f958691155068bd7150a","impliedFormat":1},{"version":"764150c107451d2fd5b6de305cff0a9dcecf799e08e6f14b5a6748724db46d8a","impliedFormat":1},{"version":"b04cf223c338c09285010f5308b980ee6d8bfa203824ed2537516f15e92e8c43","impliedFormat":1},{"version":"4b387f208d1e468193a45a51005b1ed5b666010fc22a15dc1baf4234078b636e","impliedFormat":1},{"version":"70441eda704feffd132be0c1541f2c7f6bbaafce25cb9b54b181e26af3068e79","impliedFormat":1},{"version":"d1addb12403afea87a1603121396261a45190886c486c88e1a5d456be17c2049","impliedFormat":1},{"version":"1e50bda67542964dbb2cfb21809f9976be97b2f79a4b6f8124463d42c95a704c","impliedFormat":1},{"version":"ea4b5d319625203a5a96897b057fddf6017d0f9a902c16060466fe69cc007243","impliedFormat":1},{"version":"a186fde3b1dde9642dda936e23a21cb73428340eb817e62f4442bb0fca6fa351","impliedFormat":1},{"version":"985ac70f005fb77a2bc0ed4f2c80d55919ded6a9b03d00d94aab75205b0778ec","impliedFormat":1},{"version":"ab01d8fcb89fae8eda22075153053fefac69f7d9571a389632099e7a53f1922d","impliedFormat":1},{"version":"bac0ec1f4c61abc7c54ccebb0f739acb0cdbc22b1b19c91854dc142019492961","impliedFormat":1},{"version":"566b0806f9016fa067b7fecf3951fcc295c30127e5141223393bde16ad04aa4a","impliedFormat":1},{"version":"8e801abfeda45b1b93e599750a0a8d25074d30d4cc01e3563e56c0ff70edeb68","impliedFormat":1},{"version":"902997f91b09620835afd88e292eb217fbd55d01706b82b9a014ff408f357559","impliedFormat":1},{"version":"a3727a926e697919fb59407938bd8573964b3bf543413b685996a47df5645863","impliedFormat":1},{"version":"83f36c0792d352f641a213ee547d21ea02084a148355aa26b6ef82c4f61c1280","impliedFormat":1},{"version":"dce7d69c17a438554c11bbf930dec2bee5b62184c0494d74da336daee088ab69","impliedFormat":1},{"version":"1e8f2cda9735002728017933c54ccea7ebee94b9c68a59a4aac1c9a58aa7da7d","impliedFormat":1},{"version":"e327a2b222cf9e5c93d7c1ed6468ece2e7b9d738e5da04897f1a99f49d42cca1","impliedFormat":1},{"version":"65165246b59654ec4e1501dd87927a0ef95d57359709e00e95d1154ad8443bc7","impliedFormat":1},{"version":"f1bacba19e2fa2eb26c499e36b5ab93d6764f2dba44be3816f12d2bc9ac9a35b","impliedFormat":1},{"version":"bce38da5fd851520d0cb4d1e6c3c04968cec2faa674ed321c118e97e59872edc","impliedFormat":1},{"version":"3398f46037f21fb6c33560ceca257259bd6d2ea03737179b61ea9e17cbe07455","impliedFormat":1},{"version":"6e14fc6c27cb2cb203fe1727bb3a923588f0be8c2604673ad9f879182548daca","impliedFormat":1},{"version":"12b9bcf8395d33837f301a8e6d545a24dfff80db9e32f8e8e6cf4b11671bb442","impliedFormat":1},{"version":"04295cc38689e32a4ea194c954ea6604e6afb6f1c102104f74737cb8cf744422","impliedFormat":1},{"version":"7418f434c136734b23f634e711cf44613ca4c74e63a5ae7429acaee46c7024c8","impliedFormat":1},{"version":"27d40290b7caba1c04468f2b53cf7112f247f8acdd7c20589cd7decf9f762ad0","impliedFormat":1},{"version":"2608b8b83639baf3f07316df29202eead703102f1a7e32f74a1b18cf1eee54b5","impliedFormat":1},{"version":"c93657567a39bd589effe89e863aaadbc339675fca6805ae4d97eafbcce0a05d","impliedFormat":1},{"version":"909d5db5b3b19f03dfb4a8f1d00cf41d2f679857c28775faf1f10794cbbe9db9","impliedFormat":1},{"version":"e4504bffce13574bab83ab900b843590d85a0fd38faab7eff83d84ec55de4aff","impliedFormat":1},{"version":"8ab707f3c833fc1e8a51106b8746c8bc0ce125083ea6200ad881625ae35ce11e","impliedFormat":1},{"version":"730ddc2386276ac66312edbcc60853fedbb1608a99cb0b1ff82ebf26911dba1f","impliedFormat":1},{"version":"c1b3fa201aa037110c43c05ea97800eb66fea3f2ecc5f07c6fd47f2b6b5b21d2","impliedFormat":1},{"version":"636b44188dc6eb326fd566085e6c1c6035b71f839d62c343c299a35888c6f0a9","impliedFormat":1},{"version":"3b2105bf9823b53c269cabb38011c5a71360c8daabc618fec03102c9514d230c","impliedFormat":1},{"version":"f96e63eb56e736304c3aef6c745b9fe93db235ddd1fec10b45319c479de1a432","impliedFormat":1},{"version":"acb4f3cee79f38ceba975e7ee3114eb5cd96ccc02742b0a4c7478b4619f87cd6","impliedFormat":1},{"version":"cfc85d17c1493b6217bad9052a8edc332d1fde81a919228edab33c14aa762939","impliedFormat":1},{"version":"eebda441c4486c26de7a8a7343ebbc361d2b0109abff34c2471e45e34a93020a","impliedFormat":1},{"version":"727b4b8eb62dd98fa4e3a0937172c1a0041eb715b9071c3de96dad597deddcab","impliedFormat":1},{"version":"708e2a347a1b9868ccdb48f3e43647c6eccec47b8591b220afcafc9e7eeb3784","impliedFormat":1},{"version":"6bb598e2d45a170f302f113a5b68e518c8d7661ae3b59baf076be9120afa4813","impliedFormat":1},{"version":"c28e058db8fed2c81d324546f53d2a7aaefff380cbe70f924276dbad89acd7d1","impliedFormat":1},{"version":"89d029475445d677c18cf9a8c75751325616d353925681385da49aeef9260ab7","impliedFormat":1},{"version":"826a98cb79deab45ccc4e5a8b90fa64510b2169781a7cbb83c4a0a8867f4cc58","impliedFormat":1},{"version":"618189f94a473b7fdc5cb5ba8b94d146a0d58834cd77cd24d56995f41643ccd5","impliedFormat":1},{"version":"1645dc6f3dd9a3af97eb5a6a4c794f5b1404cab015832eba67e3882a8198ec27","impliedFormat":1},{"version":"b5267af8d0a1e00092cceed845f69f5c44264cb770befc57d48dcf6a098cb731","impliedFormat":1},{"version":"91b0965538a5eaafa8c09cf9f62b46d6125aa1b3c0e0629dce871f5f41413f90","impliedFormat":1},{"version":"2978e33a00b4b5fb98337c5e473ab7337030b2f69d1480eccef0290814af0d51","impliedFormat":1},{"version":"ba71e9777cb5460e3278f0934fd6354041cb25853feca542312807ce1f18e611","impliedFormat":1},{"version":"608dbaf8c8bb64f4024013e73d7107c16dba4664999a8c6e58f3e71545e48f66","impliedFormat":1},{"version":"61937cefd7f4d6fa76013d33d5a3c5f9b0fc382e90da34790764a0d17d6277fb","impliedFormat":1},{"version":"af7db74826f455bfef6a55a188eb6659fd85fdc16f720a89a515c48724ee4c42","impliedFormat":1},{"version":"d6ce98a960f1b99a72de771fb0ba773cb202c656b8483f22d47d01d68f59ea86","impliedFormat":1},{"version":"2a47dc4a362214f31689870f809c7d62024afb4297a37b22cb86f679c4d04088","impliedFormat":1},{"version":"42d907ac511459d7c4828ee4f3f81cc331a08dc98d7b3cb98e3ff5797c095d2e","impliedFormat":1},{"version":"63d010bff70619e0cdf7900e954a7e188d3175461182f887b869c312a77ecfbd","impliedFormat":1},{"version":"1452816d619e636de512ca98546aafb9a48382d570af1473f0432a9178c4b1ff","impliedFormat":1},{"version":"9e3e3932fe16b9288ec8c948048aef4edf1295b09a5412630d63f4a42265370e","impliedFormat":1},{"version":"8bdba132259883bac06056f7bacd29a4dcf07e3f14ce89edb022fe9b78dcf9b3","impliedFormat":1},{"version":"5a5406107d9949d83e1225273bcee1f559bb5588942907d923165d83251a0e37","impliedFormat":1},{"version":"ca0ca4ca5ad4772161ee2a99741d616fea780d777549ba9f05f4a24493ab44e1","impliedFormat":1},{"version":"e7ee7be996db0d7cce41a85e4cae3a5fc86cf26501ad94e0a20f8b6c1c55b2d4","impliedFormat":1},{"version":"72263ae386d6a49392a03bde2f88660625da1eca5df8d95120d8ccf507483d20","impliedFormat":1},{"version":"b498375d015f01585269588b6221008aae6f0c0dc53ead8796ace64bdfcf62ea","impliedFormat":1},{"version":"c37aa3657fa4d1e7d22565ae609b1370c6b92bafb8c92b914403d45f0e610ddc","impliedFormat":1},{"version":"34534c0ead52cc753bdfdd486430ef67f615ace54a4c0e5a3652b4116af84d6d","impliedFormat":1},{"version":"a1079b54643537f75fa4f4bb963d787a302bddbe3a6001c4b0a524b746e6a9de","impliedFormat":1},{"version":"cea05cc31d2ad2d61a95650a3cff8cf502b779c014585aa6e2f300e0c8b76101","impliedFormat":1},{"version":"42c93fb5d5b061f7f95a3ea59c2f2b31256939e97f5183c827234d32160901ea","impliedFormat":1},"0c27495545631e99af91cebdb55d81320cb7785e05e86a3745fac2949564a12f",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"49a5a44f2e68241a1d2bd9ec894535797998841c09729e506a7cbfcaa40f2180","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"1ca84b44ad1d8e4576f24904d8b95dd23b94ea67e1575f89614ac90062fc67f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d586db0a09a9495ebb5dece28f54df9684bfbd6e1f568426ca153126dac4a40","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"8c0bcd6c6b67b4b503c11e91a1fb91522ed585900eab2ab1f61bba7d7caa9d6f","impliedFormat":1},{"version":"567b7f607f400873151d7bc63a049514b53c3c00f5f56e9e95695d93b66a138e","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"84c1930e33d1bb12ad01bcbe11d656f9646bd21b2fb2afd96e8e10615a021aef","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","impliedFormat":1},{"version":"9d19808c8c291a9010a6c788e8532a2da70f811adb431c97520803e0ec649991","impliedFormat":1},{"version":"2bf469abae4cc9c0f340d4e05d9d26e37f936f9c8ca8f007a6534f109dcc77e4","impliedFormat":1},{"version":"4aacb0dd020eeaef65426153686cc639a78ec2885dc72ad220be1d25f1a439df","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c21aaa8257d7950a5b75a251d9075b6a371208fc948c9c8402f6690ef3b5b55","impliedFormat":1},{"version":"b5895e6353a5d708f55d8685c38a235c3a6d8138e374dee8ceb8ffde5aa8002a","impliedFormat":1},{"version":"4ec3c48b7d89091aafb4e0452e4c971f34cf1615b490b5201044f31ac07f4b16","impliedFormat":1},{"version":"de735eca2c51dd8b860254e9fdb6d9ec19fe402dfe597c23090841ce3937cfc5","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"5650cf3dace09e7c25d384e3e6b818b938f68f4e8de96f52d9c5a1b3db068e86","impliedFormat":1},{"version":"1354ca5c38bd3fd3836a68e0f7c9f91f172582ba30ab15bb8c075891b91502b7","affectsGlobalScope":true,"impliedFormat":1},{"version":"5155da3047ef977944d791a2188ff6e6c225f6975cc1910ab7bb6838ab84cede","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5","impliedFormat":1},{"version":"e16d218a30f6a6810b57f7e968124eaa08c7bb366133ea34bbf01e7cd6b8c0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb8692dea24c27821f77e397272d9ed2eda0b95e4a75beb0fdda31081d15a8ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"b4f70ec656a11d570e1a9edce07d118cd58d9760239e2ece99306ee9dfe61d02","impliedFormat":1},{"version":"3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"5b6844ad931dcc1d3aca53268f4bd671428421464b1286746027aede398094f2","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"0dbcebe2126d03936c70545e96a6e41007cf065be38a1ce4d32a39fcedefead4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"461e54289e6287e8494a0178ba18182acce51a02bca8dea219149bf2cf96f105","impliedFormat":1},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","impliedFormat":1},{"version":"e31e51c55800014d926e3f74208af49cb7352803619855c89296074d1ecbb524","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"dfb96ba5177b68003deec9e773c47257da5c4c8a74053d8956389d832df72002","affectsGlobalScope":true,"impliedFormat":1},{"version":"92d3070580cf72b4bb80959b7f16ede9a3f39e6f4ef2ac87cfa4561844fdc69f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","impliedFormat":1},{"version":"613deebaec53731ff6b74fe1a89f094b708033db6396b601df3e6d5ab0ec0a47","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"e56eb632f0281c9f8210eb8c86cc4839a427a4ffffcfd2a5e40b956050b3e042","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"cac793cc47c29e26e4ac3601dcb00b4435ebed26203485790e44f2ad8b6ad847","impliedFormat":1},{"version":"248127a1de2be832dd6b9a4c2589ea241f3caa9bde05ee788dfa2128c6ee3218","impliedFormat":1},{"version":"08d91049f72dc735e91a5d600c4d1c24ef8c2e2c9d4e20a70403999f25d46657","signature":"b5929098539f514464ac3c468bc3c93ea40996de9eb5e770ecaefcfbb2677758"}],"root":[271],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./cjs","removeComments":true,"rootDir":"../src","sourceMap":true,"strict":true,"target":10},"referencedMap":[[170,1],[217,2],[218,2],[219,3],[177,4],[220,5],[221,6],[222,7],[172,1],[175,8],[173,1],[174,1],[223,9],[224,10],[225,11],[226,12],[227,13],[228,14],[229,14],[231,1],[230,15],[232,16],[233,17],[234,18],[216,19],[176,1],[235,20],[236,21],[237,22],[269,23],[238,24],[239,25],[240,26],[241,27],[242,28],[243,29],[244,30],[245,31],[246,32],[247,33],[248,33],[249,34],[250,1],[251,35],[253,36],[252,37],[254,38],[255,39],[256,40],[257,41],[258,42],[259,43],[260,44],[261,45],[262,46],[263,47],[264,48],[265,49],[266,50],[267,51],[268,52],[178,1],[79,53],[146,54],[145,55],[144,56],[84,57],[100,58],[98,59],[99,60],[85,61],[169,62],[70,1],[72,1],[73,63],[74,1],[77,64],[80,1],[97,65],[75,1],[92,66],[78,67],[93,68],[96,69],[91,70],[94,69],[71,1],[76,1],[95,71],[101,72],[89,1],[83,73],[81,74],[90,75],[87,76],[86,76],[82,77],[88,78],[102,79],[165,80],[159,81],[152,82],[151,83],[160,84],[161,69],[153,85],[166,86],[147,87],[148,88],[149,89],[168,90],[150,83],[154,86],[155,91],[162,92],[163,67],[164,91],[156,89],[167,69],[157,93],[158,94],[103,95],[143,96],[107,97],[108,97],[109,97],[110,97],[111,97],[112,97],[113,97],[114,97],[133,97],[105,97],[115,97],[116,97],[117,97],[118,97],[119,97],[120,97],[140,97],[121,97],[122,97],[123,97],[138,97],[124,97],[139,97],[125,97],[136,97],[137,97],[126,97],[127,97],[128,97],[134,97],[135,97],[129,97],[130,97],[131,97],[132,97],[141,97],[142,97],[106,98],[104,99],[69,1],[64,1],[60,1],[61,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[21,1],[22,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[56,1],[55,1],[57,1],[58,1],[10,1],[59,1],[1,1],[194,100],[204,101],[193,100],[214,102],[185,103],[184,104],[213,105],[207,106],[212,107],[187,108],[201,109],[186,110],[210,111],[182,112],[181,105],[211,113],[183,114],[188,115],[189,1],[192,115],[179,1],[215,116],[205,117],[196,118],[197,119],[199,120],[195,121],[198,122],[208,105],[190,123],[191,124],[200,125],[180,126],[203,117],[202,115],[206,1],[209,127],[270,105],[67,128],[65,129],[62,1],[63,130],[68,131],[66,1],[271,132],[171,133]],"latestChangedDtsFile":"./cjs/index.d.ts","version":"5.8.3"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.tsbuildinfo b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.tsbuildinfo new file mode 100644 index 00000000..239f736d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts","../../../node_modules/lru-cache/dist/commonjs/index.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts","../node_modules/@apollo/utils.logger/dist/index.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts","../node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts","../../../node_modules/graphql/version.d.ts","../../../node_modules/graphql/jsutils/Maybe.d.ts","../../../node_modules/graphql/language/source.d.ts","../../../node_modules/graphql/jsutils/ObjMap.d.ts","../../../node_modules/graphql/jsutils/Path.d.ts","../../../node_modules/graphql/jsutils/PromiseOrValue.d.ts","../../../node_modules/graphql/language/kinds.d.ts","../../../node_modules/graphql/language/tokenKind.d.ts","../../../node_modules/graphql/language/ast.d.ts","../../../node_modules/graphql/language/location.d.ts","../../../node_modules/graphql/error/GraphQLError.d.ts","../../../node_modules/graphql/language/directiveLocation.d.ts","../../../node_modules/graphql/type/directives.d.ts","../../../node_modules/graphql/type/schema.d.ts","../../../node_modules/graphql/type/definition.d.ts","../../../node_modules/graphql/execution/execute.d.ts","../../../node_modules/graphql/graphql.d.ts","../../../node_modules/graphql/type/scalars.d.ts","../../../node_modules/graphql/type/introspection.d.ts","../../../node_modules/graphql/type/validate.d.ts","../../../node_modules/graphql/type/assertName.d.ts","../../../node_modules/graphql/type/index.d.ts","../../../node_modules/graphql/language/printLocation.d.ts","../../../node_modules/graphql/language/lexer.d.ts","../../../node_modules/graphql/language/parser.d.ts","../../../node_modules/graphql/language/printer.d.ts","../../../node_modules/graphql/language/visitor.d.ts","../../../node_modules/graphql/language/predicates.d.ts","../../../node_modules/graphql/language/index.d.ts","../../../node_modules/graphql/execution/subscribe.d.ts","../../../node_modules/graphql/execution/values.d.ts","../../../node_modules/graphql/execution/index.d.ts","../../../node_modules/graphql/subscription/index.d.ts","../../../node_modules/graphql/utilities/TypeInfo.d.ts","../../../node_modules/graphql/validation/ValidationContext.d.ts","../../../node_modules/graphql/validation/validate.d.ts","../../../node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts","../../../node_modules/graphql/validation/specifiedRules.d.ts","../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts","../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts","../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts","../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts","../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts","../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts","../../../node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts","../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts","../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts","../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts","../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts","../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts","../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts","../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts","../../../node_modules/graphql/validation/index.d.ts","../../../node_modules/graphql/error/syntaxError.d.ts","../../../node_modules/graphql/error/locatedError.d.ts","../../../node_modules/graphql/error/index.d.ts","../../../node_modules/graphql/utilities/getIntrospectionQuery.d.ts","../../../node_modules/graphql/utilities/getOperationAST.d.ts","../../../node_modules/graphql/utilities/getOperationRootType.d.ts","../../../node_modules/graphql/utilities/introspectionFromSchema.d.ts","../../../node_modules/graphql/utilities/buildClientSchema.d.ts","../../../node_modules/graphql/utilities/buildASTSchema.d.ts","../../../node_modules/graphql/utilities/extendSchema.d.ts","../../../node_modules/graphql/utilities/lexicographicSortSchema.d.ts","../../../node_modules/graphql/utilities/printSchema.d.ts","../../../node_modules/graphql/utilities/typeFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromAST.d.ts","../../../node_modules/graphql/utilities/valueFromASTUntyped.d.ts","../../../node_modules/graphql/utilities/astFromValue.d.ts","../../../node_modules/graphql/utilities/coerceInputValue.d.ts","../../../node_modules/graphql/utilities/concatAST.d.ts","../../../node_modules/graphql/utilities/separateOperations.d.ts","../../../node_modules/graphql/utilities/stripIgnoredCharacters.d.ts","../../../node_modules/graphql/utilities/typeComparators.d.ts","../../../node_modules/graphql/utilities/assertValidName.d.ts","../../../node_modules/graphql/utilities/findBreakingChanges.d.ts","../../../node_modules/graphql/utilities/typedQueryDocumentNode.d.ts","../../../node_modules/graphql/utilities/index.d.ts","../../../node_modules/graphql/index.d.ts","../../../node_modules/@apollo/protobufjs/index.d.ts","../../usage-reporting-protobuf/generated/esm/protobuf.d.ts","../../../node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../node_modules/@apollo/utils.fetcher/dist/index.d.ts","../src/index.ts"],"fileIdsList":[[177,220],[177,217,220],[177,219,220],[220],[177,220,225,254],[177,220,221,226,232,233,240,251,262],[177,220,221,222,232,240],[172,173,174,177,220],[177,220,223,263],[177,220,224,225,233,241],[177,220,225,251,259],[177,220,226,228,232,240],[177,219,220,227],[177,220,228,229],[177,220,230,232],[177,219,220,232],[177,220,232,233,234,251,262],[177,220,232,233,234,247,251,254],[177,215,220],[177,220,228,232,235,240,251,262],[177,220,232,233,235,236,240,251,259,262],[177,220,235,237,251,259,262],[175,176,177,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268],[177,220,232,238],[177,220,239,262,267],[177,220,228,232,240,251],[177,220,241],[177,220,242],[177,219,220,243],[177,217,218,219,220,221,222,223,224,225,226,227,228,229,230,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268],[177,220,245],[177,220,246],[177,220,232,247,248],[177,220,247,249,263,265],[177,220,232,251,252,254],[177,220,253,254],[177,220,251,252],[177,220,254],[177,220,255],[177,217,220,251,256],[177,220,232,257,258],[177,220,257,258],[177,220,225,240,251,259],[177,220,260],[177,220,240,261],[177,220,235,246,262],[177,220,225,263],[177,220,251,264],[177,220,239,265],[177,220,266],[177,220,232,234,243,251,254,262,265,267],[177,220,251,268],[70,71,77,78,177,220],[79,144,145,177,220],[70,77,79,177,220],[71,79,177,220],[70,72,73,74,77,79,82,83,177,220],[73,84,98,99,177,220],[70,77,82,83,84,177,220],[70,72,77,79,81,82,83,177,220],[70,71,82,83,84,177,220],[69,85,90,97,100,101,143,146,168,177,220],[70,177,220],[71,75,76,177,220],[71,75,76,77,78,80,91,92,93,94,95,96,177,220],[71,76,77,177,220],[71,177,220],[70,71,76,77,79,92,177,220],[77,177,220],[71,77,78,177,220],[75,77,177,220],[84,98,177,220],[70,72,73,74,77,82,177,220],[70,77,80,83,177,220],[73,81,82,83,86,87,88,89,177,220],[83,177,220],[70,72,77,79,81,83,177,220],[79,82,177,220],[70,77,81,82,83,95,177,220],[79,177,220],[70,77,83,177,220],[71,77,82,93,177,220],[82,147,177,220],[79,83,177,220],[77,82,177,220],[82,177,220],[70,80,177,220],[70,77,177,220],[77,82,83,177,220],[102,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,177,220],[82,83,177,220],[72,77,177,220],[70,72,77,83,177,220],[70,72,77,177,220],[70,77,79,81,82,83,95,102,177,220],[103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,177,220],[95,103,177,220],[103,105,177,220],[70,77,79,82,102,103,177,220],[177,187,191,220,262],[177,187,220,251,262],[177,182,220],[177,184,187,220,259,262],[177,220,240,259],[177,220,269],[177,182,220,269],[177,184,187,220,240,262],[177,179,180,183,186,220,232,251,262],[177,187,194,220],[177,179,185,220],[177,187,208,209,220],[177,183,187,220,254,262,269],[177,208,220,269],[177,181,182,220,269],[177,187,220],[177,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,220],[177,187,202,220],[177,187,194,195,220],[177,185,187,195,196,220],[177,186,220],[177,179,182,187,220],[177,187,191,195,196,220],[177,191,220],[177,185,187,190,220,262],[177,179,184,187,194,220],[177,220,251],[177,182,187,208,220,267,269],[62,66,177,220],[62,64,177,220],[68,177,220],[62,63,65,67,177,220],[66,68,169,171,177,220,270],[170,177,220]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a08f0772c2acd69cdf321856af995e34533ba770741804b4d82afa7ffb44fc70","impliedFormat":1},{"version":"2a598a1349db30f21eb8f40c9d4794f40f1ef66dbb9d98648377f4d979a54533","impliedFormat":1},{"version":"599b42c2c7227d59788f9239a30b16e465e15127c7c4541d30b801c23ca681e6","impliedFormat":1},{"version":"612d916ad317ce5fe844c68fe72910a8c3561b5cb201b09e8a37ec800f49800a","impliedFormat":1},{"version":"58d9aa65560fbd9932063c2be022c9346ab7c79ccd10522c61b60cc112ac4341","impliedFormat":1},{"version":"fae1ca177e7893674e190443a9408c79ce71a2e46595c0d9ed147b915f44b6c1","impliedFormat":1},{"version":"0d174b13b0caadaa71768315875a8230fb2bcafa413193e537392de59fc0e3d6","impliedFormat":1},{"version":"78647004e18e4c16b8a2e8345fca9267573d1c5a29e11ddfee71858fd077ef6e","impliedFormat":1},{"version":"0804044cd0488cb7212ddbc1d0f8e1a5bd32970335dbfc613052304a1b0318f9","impliedFormat":1},{"version":"b725acb041d2a18fde8f46c48a1408418489c4aa222f559b1ef47bf267cb4be0","impliedFormat":1},{"version":"85084ae98c1d319e38ef99b1216d3372a9afd7a368022c01c3351b339d52cb58","impliedFormat":1},{"version":"898ec2410fae172e0a9416448b0838bed286322a5c0c8959e8e39400cd4c5697","impliedFormat":1},{"version":"692345a43bac37c507fa7065c554258435ab821bbe4fb44b513a70063e932b45","impliedFormat":1},{"version":"cddd50d7bd9d7fddda91a576db9f61655d1a55e2d870f154485812f6e39d4c15","impliedFormat":1},{"version":"0539583b089247b73a21eb4a5f7e43208a129df6300d6b829dc1039b79b6c8c4","impliedFormat":1},{"version":"3f0be705feb148ae75766143c5c849ec4cc77d79386dcfa08f18d4c9063601cc","impliedFormat":1},{"version":"522edc786ed48304671b935cf7d3ed63acc6636ab9888c6e130b97a6aea92b46","impliedFormat":1},{"version":"a9607a8f1ce7582dbeebc0816897925bf9b307cc05235e582b272a48364f8aa0","impliedFormat":1},{"version":"de21641eb8edcbc08dd0db4ee70eea907cd07fe72267340b5571c92647f10a77","impliedFormat":1},{"version":"48af3609dc95fa62c22c8ec047530daf1776504524d284d2c3f9c163725bdbd4","impliedFormat":1},{"version":"6758f7b72fa4d38f4f4b865516d3d031795c947a45cc24f2cfba43c91446d678","impliedFormat":1},{"version":"1fefab6dc739d33b7cb3fd08cd9d35dd279fcd7746965e200500b1a44d32db9e","impliedFormat":1},{"version":"cb719e699d1643112cc137652ed66341602a7d3cc5ec7062f10987ffe81744f6","impliedFormat":1},{"version":"bdf7abbd7df4f29b3e0728684c790e80590b69d92ed8d3bf8e66d4bd713941fe","impliedFormat":1},{"version":"8decb32fc5d44b403b46c3bb4741188df4fbc3c66d6c65669000c5c9cd506523","impliedFormat":1},{"version":"4beaf337ee755b8c6115ff8a17e22ceab986b588722a52c776b8834af64e0f38","impliedFormat":1},{"version":"c26dd198f2793bbdcc55103823a2767d6223a7fdb92486c18b86deaf63208354","impliedFormat":1},{"version":"93551b302a808f226f0846ad8012354f2d53d6dedc33b540d6ca69836781a574","impliedFormat":1},{"version":"040cb635dff5fc934413fa211d3a982122bf0e46acae9f7a369c61811f277047","impliedFormat":1},{"version":"778b684ebc6b006fcffeab77d25b34bf6e400100e0ec0c76056e165c6399ab05","impliedFormat":1},{"version":"463851fa993af55fb0296e0d6afa27407ef91bf6917098dd665aba1200d250c7","impliedFormat":1},{"version":"f0d8459d18cebd8a9699de96bfe1d4fe8bcf772abfa95bbfd74a2ce92d8bc55b","impliedFormat":1},{"version":"be8f369f8d7e887eab87a3e4e41f1afcf61bf06056801383152aa83bda1f6a72","impliedFormat":1},{"version":"352bfb5f3a9d8a9c2464ad2dc0b2dc56a8212650a541fb550739c286dd341de1","impliedFormat":1},{"version":"a5aae636d9afdacb22d98e4242487436d8296e5a345348325ccc68481fe1b690","impliedFormat":1},{"version":"d007c769e33e72e51286b816d82cd7c3a280cba714e7f958691155068bd7150a","impliedFormat":1},{"version":"764150c107451d2fd5b6de305cff0a9dcecf799e08e6f14b5a6748724db46d8a","impliedFormat":1},{"version":"b04cf223c338c09285010f5308b980ee6d8bfa203824ed2537516f15e92e8c43","impliedFormat":1},{"version":"4b387f208d1e468193a45a51005b1ed5b666010fc22a15dc1baf4234078b636e","impliedFormat":1},{"version":"70441eda704feffd132be0c1541f2c7f6bbaafce25cb9b54b181e26af3068e79","impliedFormat":1},{"version":"d1addb12403afea87a1603121396261a45190886c486c88e1a5d456be17c2049","impliedFormat":1},{"version":"1e50bda67542964dbb2cfb21809f9976be97b2f79a4b6f8124463d42c95a704c","impliedFormat":1},{"version":"ea4b5d319625203a5a96897b057fddf6017d0f9a902c16060466fe69cc007243","impliedFormat":1},{"version":"a186fde3b1dde9642dda936e23a21cb73428340eb817e62f4442bb0fca6fa351","impliedFormat":1},{"version":"985ac70f005fb77a2bc0ed4f2c80d55919ded6a9b03d00d94aab75205b0778ec","impliedFormat":1},{"version":"ab01d8fcb89fae8eda22075153053fefac69f7d9571a389632099e7a53f1922d","impliedFormat":1},{"version":"bac0ec1f4c61abc7c54ccebb0f739acb0cdbc22b1b19c91854dc142019492961","impliedFormat":1},{"version":"566b0806f9016fa067b7fecf3951fcc295c30127e5141223393bde16ad04aa4a","impliedFormat":1},{"version":"8e801abfeda45b1b93e599750a0a8d25074d30d4cc01e3563e56c0ff70edeb68","impliedFormat":1},{"version":"902997f91b09620835afd88e292eb217fbd55d01706b82b9a014ff408f357559","impliedFormat":1},{"version":"a3727a926e697919fb59407938bd8573964b3bf543413b685996a47df5645863","impliedFormat":1},{"version":"83f36c0792d352f641a213ee547d21ea02084a148355aa26b6ef82c4f61c1280","impliedFormat":1},{"version":"dce7d69c17a438554c11bbf930dec2bee5b62184c0494d74da336daee088ab69","impliedFormat":1},{"version":"1e8f2cda9735002728017933c54ccea7ebee94b9c68a59a4aac1c9a58aa7da7d","impliedFormat":1},{"version":"e327a2b222cf9e5c93d7c1ed6468ece2e7b9d738e5da04897f1a99f49d42cca1","impliedFormat":1},{"version":"65165246b59654ec4e1501dd87927a0ef95d57359709e00e95d1154ad8443bc7","impliedFormat":1},{"version":"f1bacba19e2fa2eb26c499e36b5ab93d6764f2dba44be3816f12d2bc9ac9a35b","impliedFormat":1},{"version":"bce38da5fd851520d0cb4d1e6c3c04968cec2faa674ed321c118e97e59872edc","impliedFormat":1},{"version":"3398f46037f21fb6c33560ceca257259bd6d2ea03737179b61ea9e17cbe07455","impliedFormat":1},{"version":"6e14fc6c27cb2cb203fe1727bb3a923588f0be8c2604673ad9f879182548daca","impliedFormat":1},{"version":"12b9bcf8395d33837f301a8e6d545a24dfff80db9e32f8e8e6cf4b11671bb442","impliedFormat":1},{"version":"04295cc38689e32a4ea194c954ea6604e6afb6f1c102104f74737cb8cf744422","impliedFormat":1},{"version":"7418f434c136734b23f634e711cf44613ca4c74e63a5ae7429acaee46c7024c8","impliedFormat":1},{"version":"27d40290b7caba1c04468f2b53cf7112f247f8acdd7c20589cd7decf9f762ad0","impliedFormat":1},{"version":"2608b8b83639baf3f07316df29202eead703102f1a7e32f74a1b18cf1eee54b5","impliedFormat":1},{"version":"c93657567a39bd589effe89e863aaadbc339675fca6805ae4d97eafbcce0a05d","impliedFormat":1},{"version":"909d5db5b3b19f03dfb4a8f1d00cf41d2f679857c28775faf1f10794cbbe9db9","impliedFormat":1},{"version":"e4504bffce13574bab83ab900b843590d85a0fd38faab7eff83d84ec55de4aff","impliedFormat":1},{"version":"8ab707f3c833fc1e8a51106b8746c8bc0ce125083ea6200ad881625ae35ce11e","impliedFormat":1},{"version":"730ddc2386276ac66312edbcc60853fedbb1608a99cb0b1ff82ebf26911dba1f","impliedFormat":1},{"version":"c1b3fa201aa037110c43c05ea97800eb66fea3f2ecc5f07c6fd47f2b6b5b21d2","impliedFormat":1},{"version":"636b44188dc6eb326fd566085e6c1c6035b71f839d62c343c299a35888c6f0a9","impliedFormat":1},{"version":"3b2105bf9823b53c269cabb38011c5a71360c8daabc618fec03102c9514d230c","impliedFormat":1},{"version":"f96e63eb56e736304c3aef6c745b9fe93db235ddd1fec10b45319c479de1a432","impliedFormat":1},{"version":"acb4f3cee79f38ceba975e7ee3114eb5cd96ccc02742b0a4c7478b4619f87cd6","impliedFormat":1},{"version":"cfc85d17c1493b6217bad9052a8edc332d1fde81a919228edab33c14aa762939","impliedFormat":1},{"version":"eebda441c4486c26de7a8a7343ebbc361d2b0109abff34c2471e45e34a93020a","impliedFormat":1},{"version":"727b4b8eb62dd98fa4e3a0937172c1a0041eb715b9071c3de96dad597deddcab","impliedFormat":1},{"version":"708e2a347a1b9868ccdb48f3e43647c6eccec47b8591b220afcafc9e7eeb3784","impliedFormat":1},{"version":"6bb598e2d45a170f302f113a5b68e518c8d7661ae3b59baf076be9120afa4813","impliedFormat":1},{"version":"c28e058db8fed2c81d324546f53d2a7aaefff380cbe70f924276dbad89acd7d1","impliedFormat":1},{"version":"89d029475445d677c18cf9a8c75751325616d353925681385da49aeef9260ab7","impliedFormat":1},{"version":"826a98cb79deab45ccc4e5a8b90fa64510b2169781a7cbb83c4a0a8867f4cc58","impliedFormat":1},{"version":"618189f94a473b7fdc5cb5ba8b94d146a0d58834cd77cd24d56995f41643ccd5","impliedFormat":1},{"version":"1645dc6f3dd9a3af97eb5a6a4c794f5b1404cab015832eba67e3882a8198ec27","impliedFormat":1},{"version":"b5267af8d0a1e00092cceed845f69f5c44264cb770befc57d48dcf6a098cb731","impliedFormat":1},{"version":"91b0965538a5eaafa8c09cf9f62b46d6125aa1b3c0e0629dce871f5f41413f90","impliedFormat":1},{"version":"2978e33a00b4b5fb98337c5e473ab7337030b2f69d1480eccef0290814af0d51","impliedFormat":1},{"version":"ba71e9777cb5460e3278f0934fd6354041cb25853feca542312807ce1f18e611","impliedFormat":1},{"version":"608dbaf8c8bb64f4024013e73d7107c16dba4664999a8c6e58f3e71545e48f66","impliedFormat":1},{"version":"61937cefd7f4d6fa76013d33d5a3c5f9b0fc382e90da34790764a0d17d6277fb","impliedFormat":1},{"version":"af7db74826f455bfef6a55a188eb6659fd85fdc16f720a89a515c48724ee4c42","impliedFormat":1},{"version":"d6ce98a960f1b99a72de771fb0ba773cb202c656b8483f22d47d01d68f59ea86","impliedFormat":1},{"version":"2a47dc4a362214f31689870f809c7d62024afb4297a37b22cb86f679c4d04088","impliedFormat":1},{"version":"42d907ac511459d7c4828ee4f3f81cc331a08dc98d7b3cb98e3ff5797c095d2e","impliedFormat":1},{"version":"63d010bff70619e0cdf7900e954a7e188d3175461182f887b869c312a77ecfbd","impliedFormat":1},{"version":"1452816d619e636de512ca98546aafb9a48382d570af1473f0432a9178c4b1ff","impliedFormat":1},{"version":"9e3e3932fe16b9288ec8c948048aef4edf1295b09a5412630d63f4a42265370e","impliedFormat":1},{"version":"8bdba132259883bac06056f7bacd29a4dcf07e3f14ce89edb022fe9b78dcf9b3","impliedFormat":1},{"version":"5a5406107d9949d83e1225273bcee1f559bb5588942907d923165d83251a0e37","impliedFormat":1},{"version":"ca0ca4ca5ad4772161ee2a99741d616fea780d777549ba9f05f4a24493ab44e1","impliedFormat":1},{"version":"e7ee7be996db0d7cce41a85e4cae3a5fc86cf26501ad94e0a20f8b6c1c55b2d4","impliedFormat":1},{"version":"72263ae386d6a49392a03bde2f88660625da1eca5df8d95120d8ccf507483d20","impliedFormat":1},{"version":"b498375d015f01585269588b6221008aae6f0c0dc53ead8796ace64bdfcf62ea","impliedFormat":1},{"version":"c37aa3657fa4d1e7d22565ae609b1370c6b92bafb8c92b914403d45f0e610ddc","impliedFormat":1},{"version":"34534c0ead52cc753bdfdd486430ef67f615ace54a4c0e5a3652b4116af84d6d","impliedFormat":1},{"version":"a1079b54643537f75fa4f4bb963d787a302bddbe3a6001c4b0a524b746e6a9de","impliedFormat":1},{"version":"cea05cc31d2ad2d61a95650a3cff8cf502b779c014585aa6e2f300e0c8b76101","impliedFormat":1},{"version":"42c93fb5d5b061f7f95a3ea59c2f2b31256939e97f5183c827234d32160901ea","impliedFormat":1},"0c27495545631e99af91cebdb55d81320cb7785e05e86a3745fac2949564a12f",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"49a5a44f2e68241a1d2bd9ec894535797998841c09729e506a7cbfcaa40f2180","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"1ca84b44ad1d8e4576f24904d8b95dd23b94ea67e1575f89614ac90062fc67f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d586db0a09a9495ebb5dece28f54df9684bfbd6e1f568426ca153126dac4a40","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"8c0bcd6c6b67b4b503c11e91a1fb91522ed585900eab2ab1f61bba7d7caa9d6f","impliedFormat":1},{"version":"567b7f607f400873151d7bc63a049514b53c3c00f5f56e9e95695d93b66a138e","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"84c1930e33d1bb12ad01bcbe11d656f9646bd21b2fb2afd96e8e10615a021aef","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","impliedFormat":1},{"version":"9d19808c8c291a9010a6c788e8532a2da70f811adb431c97520803e0ec649991","impliedFormat":1},{"version":"2bf469abae4cc9c0f340d4e05d9d26e37f936f9c8ca8f007a6534f109dcc77e4","impliedFormat":1},{"version":"4aacb0dd020eeaef65426153686cc639a78ec2885dc72ad220be1d25f1a439df","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c21aaa8257d7950a5b75a251d9075b6a371208fc948c9c8402f6690ef3b5b55","impliedFormat":1},{"version":"b5895e6353a5d708f55d8685c38a235c3a6d8138e374dee8ceb8ffde5aa8002a","impliedFormat":1},{"version":"4ec3c48b7d89091aafb4e0452e4c971f34cf1615b490b5201044f31ac07f4b16","impliedFormat":1},{"version":"de735eca2c51dd8b860254e9fdb6d9ec19fe402dfe597c23090841ce3937cfc5","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"5650cf3dace09e7c25d384e3e6b818b938f68f4e8de96f52d9c5a1b3db068e86","impliedFormat":1},{"version":"1354ca5c38bd3fd3836a68e0f7c9f91f172582ba30ab15bb8c075891b91502b7","affectsGlobalScope":true,"impliedFormat":1},{"version":"5155da3047ef977944d791a2188ff6e6c225f6975cc1910ab7bb6838ab84cede","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5","impliedFormat":1},{"version":"e16d218a30f6a6810b57f7e968124eaa08c7bb366133ea34bbf01e7cd6b8c0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb8692dea24c27821f77e397272d9ed2eda0b95e4a75beb0fdda31081d15a8ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"b4f70ec656a11d570e1a9edce07d118cd58d9760239e2ece99306ee9dfe61d02","impliedFormat":1},{"version":"3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"5b6844ad931dcc1d3aca53268f4bd671428421464b1286746027aede398094f2","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"0dbcebe2126d03936c70545e96a6e41007cf065be38a1ce4d32a39fcedefead4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"461e54289e6287e8494a0178ba18182acce51a02bca8dea219149bf2cf96f105","impliedFormat":1},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","impliedFormat":1},{"version":"e31e51c55800014d926e3f74208af49cb7352803619855c89296074d1ecbb524","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"dfb96ba5177b68003deec9e773c47257da5c4c8a74053d8956389d832df72002","affectsGlobalScope":true,"impliedFormat":1},{"version":"92d3070580cf72b4bb80959b7f16ede9a3f39e6f4ef2ac87cfa4561844fdc69f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","impliedFormat":1},{"version":"613deebaec53731ff6b74fe1a89f094b708033db6396b601df3e6d5ab0ec0a47","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"e56eb632f0281c9f8210eb8c86cc4839a427a4ffffcfd2a5e40b956050b3e042","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"cac793cc47c29e26e4ac3601dcb00b4435ebed26203485790e44f2ad8b6ad847","impliedFormat":1},{"version":"248127a1de2be832dd6b9a4c2589ea241f3caa9bde05ee788dfa2128c6ee3218","impliedFormat":1},{"version":"08d91049f72dc735e91a5d600c4d1c24ef8c2e2c9d4e20a70403999f25d46657","signature":"b5929098539f514464ac3c468bc3c93ea40996de9eb5e770ecaefcfbb2677758"}],"root":[271],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","removeComments":true,"rootDir":"../src","sourceMap":true,"strict":true,"target":10},"referencedMap":[[170,1],[217,2],[218,2],[219,3],[177,4],[220,5],[221,6],[222,7],[172,1],[175,8],[173,1],[174,1],[223,9],[224,10],[225,11],[226,12],[227,13],[228,14],[229,14],[231,1],[230,15],[232,16],[233,17],[234,18],[216,19],[176,1],[235,20],[236,21],[237,22],[269,23],[238,24],[239,25],[240,26],[241,27],[242,28],[243,29],[244,30],[245,31],[246,32],[247,33],[248,33],[249,34],[250,1],[251,35],[253,36],[252,37],[254,38],[255,39],[256,40],[257,41],[258,42],[259,43],[260,44],[261,45],[262,46],[263,47],[264,48],[265,49],[266,50],[267,51],[268,52],[178,1],[79,53],[146,54],[145,55],[144,56],[84,57],[100,58],[98,59],[99,60],[85,61],[169,62],[70,1],[72,1],[73,63],[74,1],[77,64],[80,1],[97,65],[75,1],[92,66],[78,67],[93,68],[96,69],[91,70],[94,69],[71,1],[76,1],[95,71],[101,72],[89,1],[83,73],[81,74],[90,75],[87,76],[86,76],[82,77],[88,78],[102,79],[165,80],[159,81],[152,82],[151,83],[160,84],[161,69],[153,85],[166,86],[147,87],[148,88],[149,89],[168,90],[150,83],[154,86],[155,91],[162,92],[163,67],[164,91],[156,89],[167,69],[157,93],[158,94],[103,95],[143,96],[107,97],[108,97],[109,97],[110,97],[111,97],[112,97],[113,97],[114,97],[133,97],[105,97],[115,97],[116,97],[117,97],[118,97],[119,97],[120,97],[140,97],[121,97],[122,97],[123,97],[138,97],[124,97],[139,97],[125,97],[136,97],[137,97],[126,97],[127,97],[128,97],[134,97],[135,97],[129,97],[130,97],[131,97],[132,97],[141,97],[142,97],[106,98],[104,99],[69,1],[64,1],[60,1],[61,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[21,1],[22,1],[4,1],[23,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[53,1],[54,1],[56,1],[55,1],[57,1],[58,1],[10,1],[59,1],[1,1],[194,100],[204,101],[193,100],[214,102],[185,103],[184,104],[213,105],[207,106],[212,107],[187,108],[201,109],[186,110],[210,111],[182,112],[181,105],[211,113],[183,114],[188,115],[189,1],[192,115],[179,1],[215,116],[205,117],[196,118],[197,119],[199,120],[195,121],[198,122],[208,105],[190,123],[191,124],[200,125],[180,126],[203,117],[202,115],[206,1],[209,127],[270,105],[67,128],[65,129],[62,1],[63,130],[68,131],[66,1],[271,132],[171,133]],"latestChangedDtsFile":"./esm/index.d.ts","version":"5.8.3"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/package.json b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/package.json new file mode 100644 index 00000000..1a70b336 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/package.json @@ -0,0 +1,37 @@ +{ + "name": "@apollo/server-gateway-interface", + "version": "2.0.0", + "description": "Interface used to connect Apollo Gateway to Apollo Server", + "type": "module", + "main": "", + "types": "dist/esm/index.d.ts", + "exports": { + ".": { + "types": { + "require": "./dist/cjs/index.d.ts", + "default": "./dist/esm/index.d.ts" + } + } + }, + "repository": { + "type": "git", + "url": "https://github.com/apollographql/apollo-server", + "directory": "packages/gateway-interface" + }, + "keywords": [], + "author": "Apollo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/apollographql/apollo-server/issues" + }, + "homepage": "https://github.com/apollographql/apollo-server#readme", + "dependencies": { + "@apollo/utils.fetcher": "^3.0.0", + "@apollo/utils.logger": "^3.0.0", + "@apollo/utils.keyvaluecache": "^4.0.0", + "@apollo/usage-reporting-protobuf": "^4.1.1" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/src/index.ts b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/src/index.ts new file mode 100644 index 00000000..2a576612 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface/src/index.ts @@ -0,0 +1,139 @@ +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { + DocumentNode, + ExecutionResult, + GraphQLError, + GraphQLFormattedError, + GraphQLSchema, + OperationDefinitionNode, +} from 'graphql'; +import type { Logger } from '@apollo/utils.logger'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { FetcherHeaders } from '@apollo/utils.fetcher'; + +export interface GatewayInterface { + onSchemaLoadOrUpdate( + callback: GatewaySchemaLoadOrUpdateCallback, + ): GatewayUnsubscriber; + load(options: { apollo: GatewayApolloConfig }): Promise; + stop(): Promise; +} + +export type GatewaySchemaLoadOrUpdateCallback = (schemaContext: { + apiSchema: GraphQLSchema; + coreSupergraphSdl: string; +}) => void; + +export type GatewayUnsubscriber = () => void; + +export interface GatewayApolloConfig { + key?: string; + keyHash?: string; + graphRef?: string; +} + +export interface GatewayLoadResult { + executor: GatewayExecutor | null; +} + +export type GatewayExecutor = ( + requestContext: GatewayGraphQLRequestContext, +) => Promise; + +export type GatewayExecutionResult = ExecutionResult< + Record, + Record +>; + +// Note that the default value for TContext is the same as in AS3, not +// BaseContext. +export interface GatewayGraphQLRequestContext> { + readonly request: GatewayGraphQLRequest; + readonly response?: GatewayGraphQLResponse; + logger: Logger; + readonly schema: GraphQLSchema; + readonly schemaHash: GatewaySchemaHash; + readonly context: TContext; + readonly cache: KeyValueCache; + readonly queryHash: string; + readonly document: DocumentNode; + readonly source: string; + readonly operationName: string | null; + readonly operation: OperationDefinitionNode; + readonly errors?: ReadonlyArray; + readonly metrics: GatewayGraphQLRequestMetrics; + debug?: boolean; + // In AS v3-5, this field is always set and is a GatewayCachePolicy, but + // in AS2 it is not always set and is only a GatewayCacheHint. We can't just + // declare this as `readonly overallCachePolicy?: GatewayCachePolicy | + // GatewayCacheHint` because then older versions of Gateway built against AS3 + // types will fail to build. Gateway's own code always probes this field at + // runtime before using it anyway, so let's just make everything build by + // declaring this as `any`. + readonly overallCachePolicy: any; + // This was only added in v3.11/v4.1, so we don't want to declare that it's + // required. (In fact, we made it optional in v3.11.1 for this very reason.) + readonly requestIsBatched?: boolean; +} + +export interface GatewayGraphQLRequest { + query?: string; + operationName?: string; + variables?: Record; + extensions?: Record; + http?: GatewayHTTPRequest; +} + +export interface GatewayHTTPRequest { + readonly method: string; + readonly url: string; + readonly headers: FetcherHeaders; +} + +export interface GatewayGraphQLResponse { + data?: Record | null; + errors?: ReadonlyArray; + extensions?: Record; + http?: GatewayHTTPResponse; +} + +export interface GatewayHTTPResponse { + readonly headers: FetcherHeaders; + status?: number; +} + +export type GatewaySchemaHash = string & { __fauxpaque: 'SchemaHash' }; + +export interface NonFtv1ErrorPath { + subgraph: string; + path: GraphQLError['path']; +} + +export interface GatewayGraphQLRequestMetrics { + captureTraces?: boolean; + persistedQueryHit?: boolean; + persistedQueryRegister?: boolean; + responseCacheHit?: boolean; + forbiddenOperation?: boolean; + registeredOperation?: boolean; + startHrTime?: [number, number]; + queryPlanTrace?: Trace.QueryPlanNode; + nonFtv1ErrorPaths?: NonFtv1ErrorPath[]; +} + +export interface GatewayCachePolicy extends GatewayCacheHint { + replace(hint: GatewayCacheHint): void; + restrict(hint: GatewayCacheHint): void; + policyIfCacheable(): Required | null; +} + +export interface GatewayCacheHint { + maxAge?: number; + // In AS3, this field is an enum. In TypeScript, enums are not structurally + // typed: you need to actually refer directly to the enum's definition to + // produce a value of its type in a typesafe way. Doing that would prevent us + // from severing the dependency on apollo-server-types (AS3), so instead we + // just use 'any'. The legal runtime values of this fields are the strings + // `PUBLIC` and `PRIVATE`. + scope?: any; +} diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf new file mode 120000 index 00000000..c9defaba --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf @@ -0,0 +1 @@ +../../../@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.fetcher b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.fetcher new file mode 120000 index 00000000..48218c4d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.fetcher @@ -0,0 +1 @@ +../../../@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache new file mode 120000 index 00000000..2efb8bc0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache @@ -0,0 +1 @@ +../../../@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.logger b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.logger new file mode 120000 index 00000000..64f1e450 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/utils.logger @@ -0,0 +1 @@ +../../../@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/cache-control-types b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/cache-control-types new file mode 120000 index 00000000..6b446079 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/cache-control-types @@ -0,0 +1 @@ +../../../@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server-gateway-interface b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server-gateway-interface new file mode 120000 index 00000000..7e2df244 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server-gateway-interface @@ -0,0 +1 @@ +../../../@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/README.md b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/README.md new file mode 100644 index 00000000..d6f7840d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/README.md @@ -0,0 +1,158 @@ +# `@apollo/server` + +> This `@apollo/server` package is new since Apollo Server 4. Previous major versions of Apollo Server used a set of package names starting with `apollo-server`, such as `apollo-server`, `apollo-server-express`, `apollo-server-core`, etc. + +[![npm version](https://badge.fury.io/js/%40apollo%2Fserver.svg)](https://badge.fury.io/js/%40apollo%2Fserver) +[![Build Status](https://circleci.com/gh/apollographql/apollo-server.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-server) +[![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](https://community.apollographql.com) + +--- + +**Announcement:** +Join 1000+ engineers at GraphQL Summit 2025 by Apollo for talks, workshops, and office hours. Oct 6-8, 2025 in San Francisco. [Get your pass here ->](https://www.apollographql.com/graphql-summit-2025?utm_campaign=2025-03-04_graphql-summit-github-announcement&utm_medium=github&utm_source=apollo-server) + +--- + +## A TypeScript/JavaScript GraphQL server + +**Apollo Server is an [open-source](https://github.com/apollographql/apollo-server), spec-compliant GraphQL server** that's compatible with any GraphQL client, including [Apollo Client](https://www.apollographql.com/docs/react). It's the best way to build a production-ready, self-documenting GraphQL API that can use data from any source. + + +You can use Apollo Server as: + +* A stand-alone GraphQL server +* The GraphQL server for a [subgraph](https://www.apollographql.com/docs/federation/subgraphs/) in a federated supergraph +* The gateway for a [federated supergraph](https://www.apollographql.com/docs/federation/) + +Apollo Server provides a simple API for integrating with any Node.js web framework or serverless environment. The `@apollo/server` package itself ships with a minimally-configurable, standalone web server which handles CORS and body parsing out of the box. Integrations with other environments are community-maintained. + +Apollo Server provides: + +* **Straightforward setup**, so your client developers can start fetching data quickly +* **Incremental adoption**, enabling you to add features as they're needed +* **Universal compatibility** with any data source, any build tool, and any GraphQL client +* **Production readiness**, enabling you to confidently run your graph in production + +## Documentation + +Full documentation for Apollo Server is available on [our documentation site](https://www.apollographql.com/docs/apollo-server/). This README shows the basics of getting a server running (both standalone and with Express), but most features are only documented on our docs site. + + +## Getting started: standalone server + +> You can also check out the [getting started](https://www.apollographql.com/docs/apollo-server/getting-started) guide in the Apollo Server docs for more details, including examples in both TypeScript and JavaScript. + +Apollo Server's standalone server lets you get a GraphQL server up and running quickly without needing to set up an HTTP server yourself. It allows all the same configuration of GraphQL logic as the Express integration, but does not provide the ability to make fine-grained tweaks to the HTTP-specific behavior of your server. + +First, install Apollo Server and the JavaScript implementation of the core GraphQL algorithms: + +``` +npm install @apollo/server graphql +``` + +Then, write the following to `server.mjs`. (By using the `.mjs` extension, Node lets you use the `await` keyword at the top level.) + +```js +import { ApolloServer } from '@apollo/server'; +import { startStandaloneServer } from '@apollo/server/standalone'; + +// The GraphQL schema +const typeDefs = `#graphql + type Query { + hello: String + } +`; + +// A map of functions which return data for the schema. +const resolvers = { + Query: { + hello: () => 'world', + }, +}; + +const server = new ApolloServer({ + typeDefs, + resolvers, +}); + +const { url } = await startStandaloneServer(server); +console.log(`🚀 Server ready at ${url}`); +``` + +Now run your server with: + +``` +node server.mjs +``` + +Open the URL it prints in a web browser. It will show [Apollo Sandbox](https://www.apollographql.com/docs/studio/explorer/sandbox/), a web-based tool for running GraphQL operations. Try running the operation `query { hello }`! + + +## Getting started: Express middleware + +Apollo Server's Express middleware lets you run your GraphQL server as part of an app built with [Express](https://expressjs.com/), the most popular web framework for Node. + +First, install Apollo Server, its Express middleware, the JavaScript implementation of the core GraphQL algorithms, Express, and the standard Express middleware package for CORS headers: + +``` +npm install @apollo/server @as-integrations/express5 graphql express cors +``` + +If using Typescript you may also need to install additional type declaration packages as development dependencies to avoid common errors when importing the above packages (i.e. Could not find a declaration file for module '`cors`'): + +``` +npm install --save-dev @types/cors @types/express +``` + +Then, write the following to `server.mjs`. (By using the `.mjs` extension, Node lets you use the `await` keyword at the top level.) + +```js +import { ApolloServer } from '@apollo/server'; +import { expressMiddleware } from '@as-integrations/express5'; +import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer' +import express from 'express'; +import http from 'http'; +import cors from 'cors'; + +// The GraphQL schema +const typeDefs = `#graphql + type Query { + hello: String + } +`; + +// A map of functions which return data for the schema. +const resolvers = { + Query: { + hello: () => 'world', + }, +}; + +const app = express(); +const httpServer = http.createServer(app); + +// Set up Apollo Server +const server = new ApolloServer({ + typeDefs, + resolvers, + plugins: [ApolloServerPluginDrainHttpServer({ httpServer })], +}); +await server.start(); + +app.use( + cors(), + express.json(), + expressMiddleware(server), +); + +await new Promise((resolve) => httpServer.listen({ port: 4000 }, resolve)); +console.log(`🚀 Server ready at http://localhost:4000`); +``` + +Now run your server with: + +``` +node server.mjs +``` + +Open the URL it prints in a web browser. It will show [Apollo Sandbox](https://www.apollographql.com/docs/studio/explorer/sandbox/), a web-based tool for running GraphQL operations. Try running the operation `query { hello }`! diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts new file mode 100644 index 00000000..ecc18c69 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts @@ -0,0 +1,126 @@ +import type { GatewayExecutor } from '@apollo/server-gateway-interface'; +import { type KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { Logger } from '@apollo/utils.logger'; +import type { WithRequired } from '@apollo/utils.withrequired'; +import { type Resolvable } from './utils/resolvable.js'; +import { type validate, type DocumentNode, type ExecutionArgs, type FormattedExecutionResult, type GraphQLFieldResolver, type GraphQLFormattedError, type GraphQLSchema, type ParseOptions, type TypedQueryDocumentNode, type ValidationRule } from 'graphql'; +import type { ExecuteOperationOptions, LegacyExperimentalExecuteIncrementally, VariableValues } from './externalTypes/graphql.js'; +import type { ApolloConfig, ApolloServerOptions, ApolloServerPlugin, BaseContext, ContextThunk, DocumentStore, GraphQLRequest, GraphQLResponse, HTTPGraphQLHead, HTTPGraphQLRequest, HTTPGraphQLResponse, LandingPage, PersistedQueryOptions } from './externalTypes/index.js'; +import type { GraphQLExperimentalIncrementalExecutionResultsAlpha2, GraphQLExperimentalIncrementalExecutionResultsAlpha9 } from './incrementalDeliveryPolyfill.js'; +import { SchemaManager } from './utils/schemaManager.js'; +export type SchemaDerivedData = { + schema: GraphQLSchema; + documentStore: DocumentStore | null; + documentStoreKeyPrefix: string; +}; +type RunningServerState = { + schemaManager: SchemaManager; + landingPage: LandingPage | null; +}; +type ServerState = { + phase: 'initialized'; + schemaManager: SchemaManager; +} | { + phase: 'starting'; + barrier: Resolvable; + schemaManager: SchemaManager; + startedInBackground: boolean; +} | { + phase: 'failed to start'; + error: Error; +} | ({ + phase: 'started'; + drainServers: (() => Promise) | null; + toDispose: (() => Promise)[]; + toDisposeLast: (() => Promise)[]; +} & RunningServerState) | ({ + phase: 'draining'; + barrier: Resolvable; +} & RunningServerState) | { + phase: 'stopping'; + barrier: Resolvable; +} | { + phase: 'stopped'; + stopError: Error | null; +}; +export type ValidationOptions = NonNullable[3]>; +export interface ApolloServerInternals { + state: ServerState; + gatewayExecutor: GatewayExecutor | null; + dangerouslyDisableValidation?: boolean; + formatError?: (formattedError: GraphQLFormattedError, error: unknown) => GraphQLFormattedError; + includeStacktraceInErrorResponses: boolean; + persistedQueries?: WithRequired; + nodeEnv: string; + allowBatchedHttpRequests: boolean; + apolloConfig: ApolloConfig; + plugins: ApolloServerPlugin[]; + parseOptions: ParseOptions; + validationOptions: ValidationOptions; + executionOptions?: ExecutionArgs['options']; + stopOnTerminationSignals: boolean | undefined; + csrfPreventionRequestHeaders: string[] | null; + rootValue?: ((parsedQuery: DocumentNode) => unknown) | unknown; + validationRules: Array; + laterValidationRules?: Array; + hideSchemaDetailsFromClientErrors: boolean; + fieldResolver?: GraphQLFieldResolver; + status400ForVariableCoercionErrors?: boolean; + __testing_incrementalExecutionResults?: GraphQLExperimentalIncrementalExecutionResultsAlpha2 | GraphQLExperimentalIncrementalExecutionResultsAlpha9; + stringifyResult: (value: FormattedExecutionResult) => string | Promise; + legacyExperimentalExecuteIncrementally?: LegacyExperimentalExecuteIncrementally; +} +export declare class ApolloServer { + private internals; + readonly cache: KeyValueCache; + readonly logger: Logger; + constructor(config: ApolloServerOptions); + private warnAgainstDeprecatedConfigOptions; + start(): Promise; + startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests(): void; + private _start; + private maybeRegisterTerminationSignalHandlers; + private _ensureStarted; + assertStarted(expressionForError: string): void; + private logStartupError; + private static constructSchema; + private static generateSchemaDerivedData; + stop(): Promise; + private addDefaultPlugins; + addPlugin(plugin: ApolloServerPlugin): void; + executeHTTPGraphQLRequest({ httpGraphQLRequest, context, }: { + httpGraphQLRequest: HTTPGraphQLRequest; + context: ContextThunk; + }): Promise; + private errorResponse; + private prefersHTML; + executeOperation, TVariables extends VariableValues = VariableValues>(this: ApolloServer, request: Omit, 'query'> & { + query?: string | DocumentNode | TypedQueryDocumentNode; + }): Promise>; + executeOperation, TVariables extends VariableValues = VariableValues>(request: Omit, 'query'> & { + query?: string | DocumentNode | TypedQueryDocumentNode; + }, options?: ExecuteOperationOptions): Promise>; +} +export declare function internalExecuteOperation({ server, graphQLRequest, internals, schemaDerivedData, sharedResponseHTTPGraphQLHead, }: { + server: ApolloServer; + graphQLRequest: GraphQLRequest; + internals: ApolloServerInternals; + schemaDerivedData: SchemaDerivedData; + sharedResponseHTTPGraphQLHead: HTTPGraphQLHead | null; +}, options: ExecuteOperationOptions): Promise; +export type ImplicitlyInstallablePlugin = ApolloServerPlugin & { + __internal_installed_implicitly__: boolean; +}; +export declare function isImplicitlyInstallablePlugin(p: ApolloServerPlugin): p is ImplicitlyInstallablePlugin; +export declare const MEDIA_TYPES: { + APPLICATION_JSON: string; + APPLICATION_JSON_GRAPHQL_CALLBACK: string; + APPLICATION_GRAPHQL_RESPONSE_JSON: string; + MULTIPART_MIXED_NO_DEFER_SPEC: string; + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2: string; + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9: string; + TEXT_HTML: string; +}; +export declare function chooseContentTypeForSingleResultResponse(head: HTTPGraphQLHead): string | null; +export {}; +//# sourceMappingURL=ApolloServer.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts.map new file mode 100644 index 00000000..0cf60011 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloServer.d.ts","sourceRoot":"","sources":["../../src/ApolloServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAmB,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAKL,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK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AQ,CAAC,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC3C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,6BAA6B,EAAE,eAAe,GAAG,IAAI,CAAC;CACvD,EACD,OAAO,EAAE,uBAAuB,CAAC,QAAQ,CAAC,GACzC,OAAO,CAAC,eAAe,CAAC,CAuD1B;AAQD,MAAM,MAAM,2BAA2B,CAAC,QAAQ,SAAS,WAAW,IAClE,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IAC7B,iCAAiC,EAAE,OAAO,CAAC;CAC5C,CAAC;AAEJ,wBAAgB,6BAA6B,CAAC,QAAQ,SAAS,WAAW,EACxE,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GAC9B,CAAC,IAAI,2BAA2B,CAAC,QAAQ,CAAC,CAE5C;AAED,eAAO,MAAM,WAAW;;;;;;;;CAcvB,CAAC;AAEF,wBAAgB,wCAAwC,CACtD,IAAI,EAAE,eAAe,GACpB,MAAM,GAAG,IAAI,CAqBf"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js new file mode 100644 index 00000000..2e0496ec --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js @@ -0,0 +1,726 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MEDIA_TYPES = exports.ApolloServer = void 0; +exports.internalExecuteOperation = internalExecuteOperation; +exports.isImplicitlyInstallablePlugin = isImplicitlyInstallablePlugin; +exports.chooseContentTypeForSingleResultResponse = chooseContentTypeForSingleResultResponse; +const utils_isnodelike_1 = require("@apollo/utils.isnodelike"); +const utils_keyvaluecache_1 = require("@apollo/utils.keyvaluecache"); +const schema_1 = require("@graphql-tools/schema"); +const resolvable_js_1 = __importDefault(require("./utils/resolvable.js")); +const graphql_1 = require("graphql"); +const loglevel_1 = __importDefault(require("loglevel")); +const negotiator_1 = __importDefault(require("negotiator")); +const cachePolicy_js_1 = require("./cachePolicy.js"); +const determineApolloConfig_js_1 = require("./determineApolloConfig.js"); +const errorNormalize_js_1 = require("./errorNormalize.js"); +const index_js_1 = require("./errors/index.js"); +const httpBatching_js_1 = require("./httpBatching.js"); +const internalPlugin_js_1 = require("./internalPlugin.js"); +const preventCsrf_js_1 = require("./preventCsrf.js"); +const requestPipeline_js_1 = require("./requestPipeline.js"); +const runHttpQuery_js_1 = require("./runHttpQuery.js"); +const HeaderMap_js_1 = require("./utils/HeaderMap.js"); +const UnreachableCaseError_js_1 = require("./utils/UnreachableCaseError.js"); +const computeCoreSchemaHash_js_1 = require("./utils/computeCoreSchemaHash.js"); +const isDefined_js_1 = require("./utils/isDefined.js"); +const schemaManager_js_1 = require("./utils/schemaManager.js"); +const index_js_2 = require("./validationRules/index.js"); +function defaultLogger() { + const loglevelLogger = loglevel_1.default.getLogger('apollo-server'); + loglevelLogger.setLevel(loglevel_1.default.levels.INFO); + return loglevelLogger; +} +class ApolloServer { + internals; + cache; + logger; + constructor(config) { + const nodeEnv = config.nodeEnv ?? process.env.NODE_ENV ?? ''; + this.logger = config.logger ?? defaultLogger(); + const apolloConfig = (0, determineApolloConfig_js_1.determineApolloConfig)(config.apollo, this.logger); + const isDev = nodeEnv !== 'production'; + if (config.cache && + config.cache !== 'bounded' && + utils_keyvaluecache_1.PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(config.cache)) { + throw new Error('You cannot pass a cache returned from ' + + '`PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation`' + + 'to `new ApolloServer({ cache })`, because Apollo Server may use it for ' + + 'multiple features whose cache keys must be distinct from each other.'); + } + const state = config.gateway + ? + { + phase: 'initialized', + schemaManager: new schemaManager_js_1.SchemaManager({ + gateway: config.gateway, + apolloConfig, + schemaDerivedDataProvider: (schema) => ApolloServer.generateSchemaDerivedData(schema, config.documentStore), + logger: this.logger, + }), + } + : + { + phase: 'initialized', + schemaManager: new schemaManager_js_1.SchemaManager({ + apiSchema: ApolloServer.constructSchema(config), + schemaDerivedDataProvider: (schema) => ApolloServer.generateSchemaDerivedData(schema, config.documentStore), + logger: this.logger, + }), + }; + const introspectionEnabled = config.introspection ?? isDev; + const hideSchemaDetailsFromClientErrors = config.hideSchemaDetailsFromClientErrors ?? false; + this.cache = + config.cache === undefined || config.cache === 'bounded' + ? new utils_keyvaluecache_1.InMemoryLRUCache() + : config.cache; + const maxRecursiveSelectionsRule = config.maxRecursiveSelections === true + ? [(0, index_js_2.createMaxRecursiveSelectionsRule)(index_js_2.DEFAULT_MAX_RECURSIVE_SELECTIONS)] + : typeof config.maxRecursiveSelections === 'number' + ? [(0, index_js_2.createMaxRecursiveSelectionsRule)(config.maxRecursiveSelections)] + : []; + const validationRules = [ + ...(introspectionEnabled ? [] : [index_js_2.NoIntrospection]), + ...maxRecursiveSelectionsRule, + ]; + let laterValidationRules; + if (maxRecursiveSelectionsRule.length > 0) { + laterValidationRules = config.validationRules; + } + else { + validationRules.push(...(config.validationRules ?? [])); + } + this.internals = { + formatError: config.formatError, + rootValue: config.rootValue, + validationRules, + laterValidationRules, + hideSchemaDetailsFromClientErrors, + dangerouslyDisableValidation: config.dangerouslyDisableValidation ?? false, + validationOptions: config.validationOptions ?? {}, + fieldResolver: config.fieldResolver, + includeStacktraceInErrorResponses: config.includeStacktraceInErrorResponses ?? + (nodeEnv !== 'production' && nodeEnv !== 'test'), + persistedQueries: config.persistedQueries === false + ? undefined + : { + ...config.persistedQueries, + cache: new utils_keyvaluecache_1.PrefixingKeyValueCache(config.persistedQueries?.cache ?? this.cache, requestPipeline_js_1.APQ_CACHE_PREFIX), + }, + nodeEnv, + allowBatchedHttpRequests: config.allowBatchedHttpRequests ?? false, + apolloConfig, + plugins: config.plugins ?? [], + parseOptions: config.parseOptions ?? {}, + executionOptions: config.executionOptions ?? {}, + state, + stopOnTerminationSignals: config.stopOnTerminationSignals, + gatewayExecutor: null, + csrfPreventionRequestHeaders: config.csrfPrevention === true || config.csrfPrevention === undefined + ? preventCsrf_js_1.recommendedCsrfPreventionRequestHeaders + : config.csrfPrevention === false + ? null + : (config.csrfPrevention.requestHeaders ?? + preventCsrf_js_1.recommendedCsrfPreventionRequestHeaders), + status400ForVariableCoercionErrors: config.status400ForVariableCoercionErrors ?? true, + __testing_incrementalExecutionResults: config.__testing_incrementalExecutionResults, + stringifyResult: config.stringifyResult ?? runHttpQuery_js_1.prettyJSONStringify, + legacyExperimentalExecuteIncrementally: config.legacyExperimentalExecuteIncrementally, + }; + this.warnAgainstDeprecatedConfigOptions(config); + } + warnAgainstDeprecatedConfigOptions(config) { + if ('status400ForVariableCoercionErrors' in config) { + if (config.status400ForVariableCoercionErrors === true) { + this.logger.warn('The `status400ForVariableCoercionErrors: true` configuration option is now the default behavior and has no effect in Apollo Server v5. You can safely remove this option from your configuration.'); + } + else { + this.logger.warn('The `status400ForVariableCoercionErrors: false` configuration option is deprecated and will be removed in Apollo Server v6. Apollo recommends removing any dependency on this behavior.'); + } + } + } + async start() { + return await this._start(false); + } + startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests() { + this._start(true).catch((e) => this.logStartupError(e)); + } + async _start(startedInBackground) { + if (this.internals.state.phase !== 'initialized') { + throw new Error(`You should only call 'start()' or ` + + `'startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests()' ` + + `once on your ApolloServer.`); + } + const schemaManager = this.internals.state.schemaManager; + const barrier = (0, resolvable_js_1.default)(); + this.internals.state = { + phase: 'starting', + barrier, + schemaManager, + startedInBackground, + }; + try { + await this.addDefaultPlugins(); + const toDispose = []; + const executor = await schemaManager.start(); + if (executor) { + this.internals.gatewayExecutor = executor; + } + toDispose.push(async () => { + await schemaManager.stop(); + }); + const schemaDerivedData = schemaManager.getSchemaDerivedData(); + const service = { + logger: this.logger, + cache: this.cache, + schema: schemaDerivedData.schema, + apollo: this.internals.apolloConfig, + startedInBackground, + }; + const taggedServerListeners = (await Promise.all(this.internals.plugins.map(async (plugin) => ({ + serverListener: plugin.serverWillStart && (await plugin.serverWillStart(service)), + installedImplicitly: isImplicitlyInstallablePlugin(plugin) && + plugin.__internal_installed_implicitly__, + })))).filter((maybeTaggedServerListener) => typeof maybeTaggedServerListener.serverListener === 'object'); + taggedServerListeners.forEach(({ serverListener: { schemaDidLoadOrUpdate } }) => { + if (schemaDidLoadOrUpdate) { + schemaManager.onSchemaLoadOrUpdate(schemaDidLoadOrUpdate); + } + }); + const serverWillStops = taggedServerListeners + .map((l) => l.serverListener.serverWillStop) + .filter(isDefined_js_1.isDefined); + if (serverWillStops.length) { + toDispose.push(async () => { + await Promise.all(serverWillStops.map((serverWillStop) => serverWillStop())); + }); + } + const drainServerCallbacks = taggedServerListeners + .map((l) => l.serverListener.drainServer) + .filter(isDefined_js_1.isDefined); + const drainServers = drainServerCallbacks.length + ? async () => { + await Promise.all(drainServerCallbacks.map((drainServer) => drainServer())); + } + : null; + let taggedServerListenersWithRenderLandingPage = taggedServerListeners.filter((l) => l.serverListener.renderLandingPage); + if (taggedServerListenersWithRenderLandingPage.length > 1) { + taggedServerListenersWithRenderLandingPage = + taggedServerListenersWithRenderLandingPage.filter((l) => !l.installedImplicitly); + } + let landingPage = null; + if (taggedServerListenersWithRenderLandingPage.length > 1) { + throw Error('Only one plugin can implement renderLandingPage.'); + } + else if (taggedServerListenersWithRenderLandingPage.length) { + landingPage = + await taggedServerListenersWithRenderLandingPage[0].serverListener + .renderLandingPage(); + } + const toDisposeLast = this.maybeRegisterTerminationSignalHandlers(['SIGINT', 'SIGTERM'], startedInBackground); + this.internals.state = { + phase: 'started', + schemaManager, + drainServers, + landingPage, + toDispose, + toDisposeLast, + }; + } + catch (maybeError) { + const error = (0, errorNormalize_js_1.ensureError)(maybeError); + try { + await Promise.all(this.internals.plugins.map(async (plugin) => plugin.startupDidFail?.({ error }))); + } + catch (pluginError) { + this.logger.error(`startupDidFail hook threw: ${pluginError}`); + } + this.internals.state = { + phase: 'failed to start', + error, + }; + throw error; + } + finally { + barrier.resolve(); + } + } + maybeRegisterTerminationSignalHandlers(signals, startedInBackground) { + const toDisposeLast = []; + if (this.internals.stopOnTerminationSignals === false || + (this.internals.stopOnTerminationSignals === undefined && + !(utils_isnodelike_1.isNodeLike && + this.internals.nodeEnv !== 'test' && + !startedInBackground))) { + return toDisposeLast; + } + let receivedSignal = false; + const signalHandler = async (signal) => { + if (receivedSignal) { + return; + } + receivedSignal = true; + try { + await this.stop(); + } + catch (e) { + this.logger.error(`stop() threw during ${signal} shutdown`); + this.logger.error(e); + process.exit(1); + } + process.kill(process.pid, signal); + }; + signals.forEach((signal) => { + process.on(signal, signalHandler); + toDisposeLast.push(async () => { + process.removeListener(signal, signalHandler); + }); + }); + return toDisposeLast; + } + async _ensureStarted() { + while (true) { + switch (this.internals.state.phase) { + case 'initialized': + throw new Error('You need to call `server.start()` before using your Apollo Server.'); + case 'starting': + await this.internals.state.barrier; + break; + case 'failed to start': + this.logStartupError(this.internals.state.error); + throw new Error('This data graph is missing a valid configuration. More details may be available in the server logs.'); + case 'started': + case 'draining': + return this.internals.state; + case 'stopping': + case 'stopped': + this.logger.warn('A GraphQL operation was received during server shutdown. The ' + + 'operation will fail. Consider draining the HTTP server on shutdown; ' + + 'see https://go.apollo.dev/s/drain for details.'); + throw new Error(`Cannot execute GraphQL operations ${this.internals.state.phase === 'stopping' + ? 'while the server is stopping' + : 'after the server has stopped'}.'`); + default: + throw new UnreachableCaseError_js_1.UnreachableCaseError(this.internals.state); + } + } + } + assertStarted(expressionForError) { + if (this.internals.state.phase !== 'started' && + this.internals.state.phase !== 'draining' && + !(this.internals.state.phase === 'starting' && + this.internals.state.startedInBackground)) { + throw new Error('You must `await server.start()` before calling `' + + expressionForError + + '`'); + } + } + logStartupError(err) { + this.logger.error('An error occurred during Apollo Server startup. All GraphQL requests ' + + 'will now fail. The startup error was: ' + + (err?.message || err)); + } + static constructSchema(config) { + if (config.schema) { + return config.schema; + } + const { typeDefs, resolvers } = config; + const augmentedTypeDefs = Array.isArray(typeDefs) ? typeDefs : [typeDefs]; + return (0, schema_1.makeExecutableSchema)({ + typeDefs: augmentedTypeDefs, + resolvers, + }); + } + static generateSchemaDerivedData(schema, providedDocumentStore) { + (0, graphql_1.assertValidSchema)(schema); + return { + schema, + documentStore: providedDocumentStore === undefined + ? new utils_keyvaluecache_1.InMemoryLRUCache() + : providedDocumentStore, + documentStoreKeyPrefix: providedDocumentStore + ? `${(0, computeCoreSchemaHash_js_1.computeCoreSchemaHash)((0, graphql_1.printSchema)(schema))}:` + : '', + }; + } + async stop() { + switch (this.internals.state.phase) { + case 'initialized': + case 'starting': + case 'failed to start': + throw Error('apolloServer.stop() should only be called after `await apolloServer.start()` has succeeded'); + case 'stopped': + if (this.internals.state.stopError) { + throw this.internals.state.stopError; + } + return; + case 'stopping': + case 'draining': { + await this.internals.state.barrier; + const state = this.internals.state; + if (state.phase !== 'stopped') { + throw Error(`Surprising post-stopping state ${state.phase}`); + } + if (state.stopError) { + throw state.stopError; + } + return; + } + case 'started': + break; + default: + throw new UnreachableCaseError_js_1.UnreachableCaseError(this.internals.state); + } + const barrier = (0, resolvable_js_1.default)(); + const { schemaManager, drainServers, landingPage, toDispose, toDisposeLast, } = this.internals.state; + this.internals.state = { + phase: 'draining', + barrier, + schemaManager, + landingPage, + }; + try { + await drainServers?.(); + this.internals.state = { phase: 'stopping', barrier }; + await Promise.all([...toDispose].map((dispose) => dispose())); + await Promise.all([...toDisposeLast].map((dispose) => dispose())); + } + catch (stopError) { + this.internals.state = { + phase: 'stopped', + stopError: stopError, + }; + barrier.resolve(); + throw stopError; + } + this.internals.state = { phase: 'stopped', stopError: null }; + } + async addDefaultPlugins() { + const { plugins, apolloConfig, nodeEnv, hideSchemaDetailsFromClientErrors, } = this.internals; + const isDev = nodeEnv !== 'production'; + const alreadyHavePluginWithInternalId = (id) => plugins.some((p) => (0, internalPlugin_js_1.pluginIsInternal)(p) && p.__internal_plugin_id__ === id); + const pluginsByInternalID = new Map(); + for (const p of plugins) { + if ((0, internalPlugin_js_1.pluginIsInternal)(p)) { + const id = p.__internal_plugin_id__; + if (!pluginsByInternalID.has(id)) { + pluginsByInternalID.set(id, { + sawDisabled: false, + sawNonDisabled: false, + }); + } + const seen = pluginsByInternalID.get(id); + if (p.__is_disabled_plugin__) { + seen.sawDisabled = true; + } + else { + seen.sawNonDisabled = true; + } + if (seen.sawDisabled && seen.sawNonDisabled) { + throw new Error(`You have tried to install both ApolloServerPlugin${id} and ` + + `ApolloServerPlugin${id}Disabled in your server. Please choose ` + + `whether or not you want to disable the feature and install the ` + + `appropriate plugin for your use case.`); + } + } + } + { + if (!alreadyHavePluginWithInternalId('CacheControl')) { + const { ApolloServerPluginCacheControl } = await Promise.resolve().then(() => __importStar(require('./plugin/cacheControl/index.js'))); + plugins.push(ApolloServerPluginCacheControl()); + } + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('UsageReporting'); + if (!alreadyHavePlugin && apolloConfig.key) { + if (apolloConfig.graphRef) { + const { ApolloServerPluginUsageReporting } = await Promise.resolve().then(() => __importStar(require('./plugin/usageReporting/index.js'))); + plugins.unshift(ApolloServerPluginUsageReporting({ + __onlyIfSchemaIsNotSubgraph: true, + })); + } + else { + this.logger.warn('You have specified an Apollo key but have not specified a graph ref; usage ' + + 'reporting is disabled. To enable usage reporting, set the `APOLLO_GRAPH_REF` ' + + 'environment variable to `your-graph-id@your-graph-variant`. To disable this ' + + 'warning, install `ApolloServerPluginUsageReportingDisabled`.'); + } + } + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('SchemaReporting'); + const enabledViaEnvVar = process.env.APOLLO_SCHEMA_REPORTING === 'true'; + if (!alreadyHavePlugin && enabledViaEnvVar) { + if (apolloConfig.key) { + const { ApolloServerPluginSchemaReporting } = await Promise.resolve().then(() => __importStar(require('./plugin/schemaReporting/index.js'))); + plugins.push(ApolloServerPluginSchemaReporting()); + } + else { + throw new Error("You've enabled schema reporting by setting the APOLLO_SCHEMA_REPORTING " + + 'environment variable to true, but you also need to provide your ' + + 'Apollo API key, via the APOLLO_KEY environment ' + + 'variable or via `new ApolloServer({apollo: {key})'); + } + } + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('InlineTrace'); + if (!alreadyHavePlugin) { + const { ApolloServerPluginInlineTrace } = await Promise.resolve().then(() => __importStar(require('./plugin/inlineTrace/index.js'))); + plugins.push(ApolloServerPluginInlineTrace({ __onlyIfSchemaIsSubgraph: true })); + } + } + const alreadyHavePlugin = alreadyHavePluginWithInternalId('LandingPageDisabled'); + if (!alreadyHavePlugin) { + const { ApolloServerPluginLandingPageLocalDefault, ApolloServerPluginLandingPageProductionDefault, } = await Promise.resolve().then(() => __importStar(require('./plugin/landingPage/default/index.js'))); + const plugin = isDev + ? ApolloServerPluginLandingPageLocalDefault() + : ApolloServerPluginLandingPageProductionDefault(); + if (!isImplicitlyInstallablePlugin(plugin)) { + throw Error('default landing page plugin should be implicitly installable?'); + } + plugin.__internal_installed_implicitly__ = true; + plugins.push(plugin); + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('DisableSuggestions'); + if (hideSchemaDetailsFromClientErrors && !alreadyHavePlugin) { + const { ApolloServerPluginDisableSuggestions } = await Promise.resolve().then(() => __importStar(require('./plugin/disableSuggestions/index.js'))); + plugins.push(ApolloServerPluginDisableSuggestions()); + } + } + } + addPlugin(plugin) { + if (this.internals.state.phase !== 'initialized') { + throw new Error("Can't add plugins after the server has started"); + } + this.internals.plugins.push(plugin); + } + async executeHTTPGraphQLRequest({ httpGraphQLRequest, context, }) { + try { + let runningServerState; + try { + runningServerState = await this._ensureStarted(); + } + catch (error) { + return await this.errorResponse(error, httpGraphQLRequest); + } + if (runningServerState.landingPage && + this.prefersHTML(httpGraphQLRequest)) { + let renderedHtml; + if (typeof runningServerState.landingPage.html === 'string') { + renderedHtml = runningServerState.landingPage.html; + } + else { + try { + renderedHtml = await runningServerState.landingPage.html(); + } + catch (maybeError) { + const error = (0, errorNormalize_js_1.ensureError)(maybeError); + this.logger.error(`Landing page \`html\` function threw: ${error}`); + return await this.errorResponse(error, httpGraphQLRequest); + } + } + return { + headers: new HeaderMap_js_1.HeaderMap([['content-type', 'text/html']]), + body: { + kind: 'complete', + string: renderedHtml, + }, + }; + } + if (this.internals.csrfPreventionRequestHeaders) { + (0, preventCsrf_js_1.preventCsrf)(httpGraphQLRequest.headers, this.internals.csrfPreventionRequestHeaders); + } + let contextValue; + try { + contextValue = await context(); + } + catch (maybeError) { + const error = (0, errorNormalize_js_1.ensureError)(maybeError); + try { + await Promise.all(this.internals.plugins.map(async (plugin) => plugin.contextCreationDidFail?.({ + error, + }))); + } + catch (pluginError) { + this.logger.error(`contextCreationDidFail hook threw: ${pluginError}`); + } + return await this.errorResponse((0, errorNormalize_js_1.ensureGraphQLError)(error, 'Context creation failed: '), httpGraphQLRequest); + } + return await (0, httpBatching_js_1.runPotentiallyBatchedHttpQuery)(this, httpGraphQLRequest, contextValue, runningServerState.schemaManager.getSchemaDerivedData(), this.internals); + } + catch (maybeError_) { + const maybeError = maybeError_; + if (maybeError instanceof graphql_1.GraphQLError && + maybeError.extensions.code === index_js_1.ApolloServerErrorCode.BAD_REQUEST) { + try { + await Promise.all(this.internals.plugins.map(async (plugin) => plugin.invalidRequestWasReceived?.({ error: maybeError }))); + } + catch (pluginError) { + this.logger.error(`invalidRequestWasReceived hook threw: ${pluginError}`); + } + } + return await this.errorResponse(maybeError, httpGraphQLRequest); + } + } + async errorResponse(error, requestHead) { + const { formattedErrors, httpFromErrors } = (0, errorNormalize_js_1.normalizeAndFormatErrors)([error], { + includeStacktraceInErrorResponses: this.internals.includeStacktraceInErrorResponses, + formatError: this.internals.formatError, + }); + return { + status: httpFromErrors.status ?? 500, + headers: new HeaderMap_js_1.HeaderMap([ + ...httpFromErrors.headers, + [ + 'content-type', + chooseContentTypeForSingleResultResponse(requestHead) ?? + exports.MEDIA_TYPES.APPLICATION_JSON, + ], + ]), + body: { + kind: 'complete', + string: await this.internals.stringifyResult({ + errors: formattedErrors, + }), + }, + }; + } + prefersHTML(request) { + const acceptHeader = request.headers.get('accept'); + return (request.method === 'GET' && + !!acceptHeader && + new negotiator_1.default({ + headers: { accept: acceptHeader }, + }).mediaType([ + exports.MEDIA_TYPES.APPLICATION_JSON, + exports.MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON, + exports.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + exports.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + exports.MEDIA_TYPES.MULTIPART_MIXED_NO_DEFER_SPEC, + exports.MEDIA_TYPES.TEXT_HTML, + ]) === exports.MEDIA_TYPES.TEXT_HTML); + } + async executeOperation(request, options = {}) { + if (this.internals.state.phase === 'initialized') { + await this.start(); + } + const schemaDerivedData = (await this._ensureStarted()).schemaManager.getSchemaDerivedData(); + const graphQLRequest = { + ...request, + query: request.query && typeof request.query !== 'string' + ? (0, graphql_1.print)(request.query) + : request.query, + }; + const response = await internalExecuteOperation({ + server: this, + graphQLRequest, + internals: this.internals, + schemaDerivedData, + sharedResponseHTTPGraphQLHead: null, + }, options); + return response; + } +} +exports.ApolloServer = ApolloServer; +async function internalExecuteOperation({ server, graphQLRequest, internals, schemaDerivedData, sharedResponseHTTPGraphQLHead, }, options) { + const requestContext = { + logger: server.logger, + cache: server.cache, + schema: schemaDerivedData.schema, + request: graphQLRequest, + response: { + http: sharedResponseHTTPGraphQLHead ?? (0, runHttpQuery_js_1.newHTTPGraphQLHead)(), + }, + contextValue: cloneObject(options?.contextValue ?? {}), + metrics: {}, + overallCachePolicy: (0, cachePolicy_js_1.newCachePolicy)(), + requestIsBatched: sharedResponseHTTPGraphQLHead !== null, + }; + try { + return await (0, requestPipeline_js_1.processGraphQLRequest)(schemaDerivedData, server, internals, requestContext); + } + catch (maybeError) { + const error = (0, errorNormalize_js_1.ensureError)(maybeError); + await Promise.all(internals.plugins.map(async (plugin) => plugin.unexpectedErrorProcessingRequest?.({ + requestContext, + error, + }))); + server.logger.error(`Unexpected error processing request: ${error}`); + throw new Error('Internal server error'); + } +} +function isImplicitlyInstallablePlugin(p) { + return '__internal_installed_implicitly__' in p; +} +exports.MEDIA_TYPES = { + APPLICATION_JSON: 'application/json; charset=utf-8', + APPLICATION_JSON_GRAPHQL_CALLBACK: 'application/json; callbackSpec=1.0; charset=utf-8', + APPLICATION_GRAPHQL_RESPONSE_JSON: 'application/graphql-response+json; charset=utf-8', + MULTIPART_MIXED_NO_DEFER_SPEC: 'multipart/mixed', + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2: 'multipart/mixed; deferSpec=20220824', + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9: 'multipart/mixed; incrementalSpec=v0.2', + TEXT_HTML: 'text/html', +}; +function chooseContentTypeForSingleResultResponse(head) { + const acceptHeader = head.headers.get('accept'); + if (!acceptHeader) { + return exports.MEDIA_TYPES.APPLICATION_JSON; + } + else { + const preferred = new negotiator_1.default({ + headers: { accept: head.headers.get('accept') }, + }).mediaType([ + exports.MEDIA_TYPES.APPLICATION_JSON, + exports.MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON, + exports.MEDIA_TYPES.APPLICATION_JSON_GRAPHQL_CALLBACK, + ]); + if (preferred) { + return preferred; + } + else { + return null; + } + } +} +function cloneObject(object) { + return Object.assign(Object.create(Object.getPrototypeOf(object)), object); +} +//# sourceMappingURL=ApolloServer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js.map new file mode 100644 index 00000000..e99aed14 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/ApolloServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloServer.js","sourceRoot":"","sources":["../../src/ApolloServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2yCA,4DAsEC;AAaD,sEAIC;AAkBD,4FAuBC;AA16CD,+DAAsD;AACtD,qEAIqC;AAGrC,kDAA6D;AAC7D,0EAAoE;AACpE,qCAeiB;AACjB,wDAAgC;AAChC,4DAAoC;AACpC,qDAAkD;AAClD,yEAAmE;AACnE,2DAI6B;AAC7B,gDAA0D;AAyB1D,uDAAmE;AAKnE,2DA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AAC;YAC/B,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;SAChD,CAAC,CAAC,SAAS,CAAC;YACX,mBAAW,CAAC,gBAAgB;YAC5B,mBAAW,CAAC,iCAAiC;YAC7C,mBAAW,CAAC,iCAAiC;SAC9C,CAAC,CAAC;QACH,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAmB,MAAS;IAC9C,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts new file mode 100644 index 00000000..c7125b0e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts @@ -0,0 +1,3 @@ +import type { CachePolicy } from '@apollo/cache-control-types'; +export declare function newCachePolicy(): CachePolicy; +//# sourceMappingURL=cachePolicy.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts.map new file mode 100644 index 00000000..983edd8a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cachePolicy.d.ts","sourceRoot":"","sources":["../../src/cachePolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1E,wBAAgB,cAAc,IAAI,WAAW,CA8B5C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js new file mode 100644 index 00000000..0f3b9dd2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.newCachePolicy = newCachePolicy; +function newCachePolicy() { + return { + maxAge: undefined, + scope: undefined, + restrict(hint) { + if (hint.maxAge !== undefined && + (this.maxAge === undefined || hint.maxAge < this.maxAge)) { + this.maxAge = hint.maxAge; + } + if (hint.scope !== undefined && this.scope !== 'PRIVATE') { + this.scope = hint.scope; + } + }, + replace(hint) { + if (hint.maxAge !== undefined) { + this.maxAge = hint.maxAge; + } + if (hint.scope !== undefined) { + this.scope = hint.scope; + } + }, + policyIfCacheable() { + if (this.maxAge === undefined || this.maxAge === 0) { + return null; + } + return { maxAge: this.maxAge, scope: this.scope ?? 'PUBLIC' }; + }, + }; +} +//# sourceMappingURL=cachePolicy.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js.map new file mode 100644 index 00000000..0545c944 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/cachePolicy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cachePolicy.js","sourceRoot":"","sources":["../../src/cachePolicy.ts"],"names":[],"mappings":";;AAEA,wCA8BC;AA9BD,SAAgB,cAAc;IAC5B,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,SAAS;QAChB,QAAQ,CAAC,IAAe;YACtB,IACE,IAAI,CAAC,MAAM,KAAK,SAAS;gBACzB,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,EACxD,CAAC;gBACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5B,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBACzD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,OAAO,CAAC,IAAe;YACrB,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5B,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,iBAAiB;YACf,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts new file mode 100644 index 00000000..5ae600c9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts @@ -0,0 +1,4 @@ +import type { ApolloConfig, ApolloConfigInput } from './externalTypes/index.js'; +import type { Logger } from '@apollo/utils.logger'; +export declare function determineApolloConfig(input: ApolloConfigInput | undefined, logger: Logger): ApolloConfig; +//# sourceMappingURL=determineApolloConfig.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts.map new file mode 100644 index 00000000..c444de30 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"determineApolloConfig.d.ts","sourceRoot":"","sources":["../../src/determineApolloConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAInD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,GACb,YAAY,CAuEd"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js new file mode 100644 index 00000000..84061b66 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.determineApolloConfig = determineApolloConfig; +const utils_createhash_1 = require("@apollo/utils.createhash"); +function determineApolloConfig(input, logger) { + const apolloConfig = {}; + const { APOLLO_KEY, APOLLO_GRAPH_REF, APOLLO_GRAPH_ID, APOLLO_GRAPH_VARIANT, } = process.env; + if (input?.key) { + apolloConfig.key = input.key.trim(); + } + else if (APOLLO_KEY) { + apolloConfig.key = APOLLO_KEY.trim(); + } + if ((input?.key ?? APOLLO_KEY) !== apolloConfig.key) { + logger.warn('The provided API key has unexpected leading or trailing whitespace. ' + + 'Apollo Server will trim the key value before use.'); + } + if (apolloConfig.key) { + assertValidHeaderValue(apolloConfig.key); + } + if (apolloConfig.key) { + apolloConfig.keyHash = (0, utils_createhash_1.createHash)('sha512') + .update(apolloConfig.key) + .digest('hex'); + } + if (input?.graphRef) { + apolloConfig.graphRef = input.graphRef; + } + else if (APOLLO_GRAPH_REF) { + apolloConfig.graphRef = APOLLO_GRAPH_REF; + } + const graphId = input?.graphId ?? APOLLO_GRAPH_ID; + const graphVariant = input?.graphVariant ?? APOLLO_GRAPH_VARIANT; + if (apolloConfig.graphRef) { + if (graphId) { + throw new Error('Cannot specify both graph ref and graph ID. Please use ' + + '`apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph ID.'); + } + if (graphVariant) { + throw new Error('Cannot specify both graph ref and graph variant. Please use ' + + '`apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph variant.'); + } + } + else if (graphId) { + apolloConfig.graphRef = graphVariant + ? `${graphId}@${graphVariant}` + : graphId; + } + return apolloConfig; +} +function assertValidHeaderValue(value) { + const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/g; + if (invalidHeaderCharRegex.test(value)) { + const invalidChars = value.match(invalidHeaderCharRegex); + throw new Error(`The API key provided to Apollo Server contains characters which are invalid as HTTP header values. The following characters found in the key are invalid: ${invalidChars.join(', ')}. Valid header values may only contain ASCII visible characters. If you think there is an issue with your key, please contact Apollo support.`); + } +} +//# sourceMappingURL=determineApolloConfig.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js.map new file mode 100644 index 00000000..8ee319a5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/determineApolloConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"determineApolloConfig.js","sourceRoot":"","sources":["../../src/determineApolloConfig.ts"],"names":[],"mappings":";;AAMA,sDA0EC;AAhFD,+DAAsD;AAMtD,SAAgB,qBAAqB,CACnC,KAAoC,EACpC,MAAc;IAEd,MAAM,YAAY,GAAiB,EAAE,CAAC;IAEtC,MAAM,EACJ,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,GAAG,OAAO,CAAC,GAAG,CAAC;IAGhB,IAAI,KAAK,EAAE,GAAG,EAAE,CAAC;QACf,YAAY,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,YAAY,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,UAAU,CAAC,KAAK,YAAY,CAAC,GAAG,EAAE,CAAC;QACpD,MAAM,CAAC,IAAI,CACT,sEAAsE;YACpE,mDAAmD,CACtD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AAC,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CACb,6JAA6J,YAAY,CAAC,IAAI,CAC5K,IAAI,CACL,+IAA+I,CACjJ,CAAC;IACJ,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts new file mode 100644 index 00000000..cf93e3c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts @@ -0,0 +1,12 @@ +import { GraphQLError, type GraphQLFormattedError } from 'graphql'; +import type { HTTPGraphQLHead } from './externalTypes/http.js'; +export declare function normalizeAndFormatErrors(errors: ReadonlyArray, options?: { + formatError?: (formattedError: GraphQLFormattedError, error: unknown) => GraphQLFormattedError; + includeStacktraceInErrorResponses?: boolean; +}): { + formattedErrors: Array; + httpFromErrors: HTTPGraphQLHead; +}; +export declare function ensureError(maybeError: unknown): Error; +export declare function ensureGraphQLError(maybeError: unknown, messagePrefixIfNotGraphQLError?: string): GraphQLError; +//# sourceMappingURL=errorNormalize.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts.map new file mode 100644 index 00000000..9cce63b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errorNormalize.d.ts","sourceRoot":"","sources":["../../src/errorNormalize.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEZ,KAAK,qBAAqB,EAC3B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAY/D,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAC9B,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,CACZ,cAAc,EAAE,qBAAqB,EACrC,KAAK,EAAE,OAAO,KACX,qBAAqB,CAAC;IAC3B,iCAAiC,CAAC,EAAE,OAAO,CAAC;CACxC,GACL;IACD,eAAe,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC9C,cAAc,EAAE,eAAe,CAAC;CACjC,CAqDA;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,OAAO,GAAG,KAAK,CAItD;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,OAAO,EACnB,8BAA8B,GAAE,MAAW,GAC1C,YAAY,CAQd"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js new file mode 100644 index 00000000..1bbffa8e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.normalizeAndFormatErrors = normalizeAndFormatErrors; +exports.ensureError = ensureError; +exports.ensureGraphQLError = ensureGraphQLError; +const graphql_1 = require("graphql"); +const index_js_1 = require("./errors/index.js"); +const runHttpQuery_js_1 = require("./runHttpQuery.js"); +const HeaderMap_js_1 = require("./utils/HeaderMap.js"); +function normalizeAndFormatErrors(errors, options = {}) { + const formatError = options.formatError ?? ((error) => error); + const httpFromErrors = (0, runHttpQuery_js_1.newHTTPGraphQLHead)(); + return { + httpFromErrors, + formattedErrors: errors.map((error) => { + try { + return formatError(enrichError(error), error); + } + catch (formattingError) { + if (options.includeStacktraceInErrorResponses) { + return enrichError(formattingError); + } + else { + return { + message: 'Internal server error', + extensions: { code: index_js_1.ApolloServerErrorCode.INTERNAL_SERVER_ERROR }, + }; + } + } + }), + }; + function enrichError(maybeError) { + const graphqlError = ensureGraphQLError(maybeError); + const extensions = { + ...graphqlError.extensions, + code: graphqlError.extensions.code ?? + index_js_1.ApolloServerErrorCode.INTERNAL_SERVER_ERROR, + }; + if (isPartialHTTPGraphQLHead(extensions.http)) { + (0, runHttpQuery_js_1.mergeHTTPGraphQLHead)(httpFromErrors, { + headers: new HeaderMap_js_1.HeaderMap(), + ...extensions.http, + }); + delete extensions.http; + } + if (options.includeStacktraceInErrorResponses) { + extensions.stacktrace = graphqlError.stack?.split('\n'); + } + return { ...graphqlError.toJSON(), extensions }; + } +} +function ensureError(maybeError) { + return maybeError instanceof Error + ? maybeError + : new graphql_1.GraphQLError('Unexpected error value: ' + String(maybeError)); +} +function ensureGraphQLError(maybeError, messagePrefixIfNotGraphQLError = '') { + const error = ensureError(maybeError); + return error instanceof graphql_1.GraphQLError + ? error + : new graphql_1.GraphQLError(messagePrefixIfNotGraphQLError + error.message, { + originalError: error, + }); +} +function isPartialHTTPGraphQLHead(x) { + return (!!x && + typeof x === 'object' && + (!('status' in x) || typeof x.status === 'number') && + (!('headers' in x) || x.headers instanceof Map)); +} +//# sourceMappingURL=errorNormalize.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js.map new file mode 100644 index 00000000..64fccbf4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errorNormalize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errorNormalize.js","sourceRoot":"","sources":["../../src/errorNormalize.ts"],"names":[],"mappings":";;AAoBA,4DAiEC;AAED,kCAIC;AAED,gDAWC;AAtGD,qCAIiB;AACjB,gDAA0D;AAE1D,uDAA6E;AAC7E,uDAAiD;AAUjD,SAAgB,wBAAwB,CACtC,MAA8B,EAC9B,UAMI,EAAE;IAKN,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,IAAA,oCAAkB,GAAE,CAAC;IAE5C,OAAO;QACL,cAAc;QACd,eAAe,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACpC,IAAI,CAAC;gBACH,OAAO,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,eAAe,EAAE,CAAC;gBACzB,IAAI,OAAO,CAAC,iCAAiC,EAAE,CAAC;oBAG9C,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC;gBACtC,CAAC;qBAAM,CAAC;oBAEN,OAAO;wBACL,OAAO,EAAE,uBAAuB;wBAChC,UAAU,EAAE,EAAE,IAAI,EAAE,gCAAqB,CAAC,qBAAqB,EAAE;qBAClE,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC,CAAC;KACH,CAAC;IAEF,SAAS,WAAW,CAAC,UAAmB;QACtC,MAAM,YAAY,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAEpD,MAAM,UAAU,GAA2B;YACzC,GAAG,YAAY,CAAC,UAAU;YAC1B,IAAI,EACF,YAAY,CAAC,UAAU,CAAC,IAAI;gBAC5B,gCAAqB,CAAC,qBAAqB;SAC9C,CAAC;QAEF,IAAI,wBAAwB,CAA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ACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts new file mode 100644 index 00000000..48e3927d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts @@ -0,0 +1,16 @@ +export declare enum ApolloServerErrorCode { + INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR", + GRAPHQL_PARSE_FAILED = "GRAPHQL_PARSE_FAILED", + GRAPHQL_VALIDATION_FAILED = "GRAPHQL_VALIDATION_FAILED", + PERSISTED_QUERY_NOT_FOUND = "PERSISTED_QUERY_NOT_FOUND", + PERSISTED_QUERY_NOT_SUPPORTED = "PERSISTED_QUERY_NOT_SUPPORTED", + BAD_USER_INPUT = "BAD_USER_INPUT", + OPERATION_RESOLUTION_FAILURE = "OPERATION_RESOLUTION_FAILURE", + BAD_REQUEST = "BAD_REQUEST" +} +export declare enum ApolloServerValidationErrorCode { + INTROSPECTION_DISABLED = "INTROSPECTION_DISABLED", + MAX_RECURSIVE_SELECTIONS_EXCEEDED = "MAX_RECURSIVE_SELECTIONS_EXCEEDED" +} +export declare function unwrapResolverError(error: unknown): unknown; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts.map new file mode 100644 index 00000000..492b97ba --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAEA,oBAAY,qBAAqB;IAC/B,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,yBAAyB,8BAA8B;IACvD,yBAAyB,8BAA8B;IACvD,6BAA6B,kCAAkC;IAC/D,cAAc,mBAAmB;IACjC,4BAA4B,iCAAiC;IAC7D,WAAW,gBAAgB;CAC5B;AAED,oBAAY,+BAA+B;IACzC,sBAAsB,2BAA2B;IACjD,iCAAiC,sCAAsC;CACxE;AAWD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK3D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js new file mode 100644 index 00000000..2accd571 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerValidationErrorCode = exports.ApolloServerErrorCode = void 0; +exports.unwrapResolverError = unwrapResolverError; +const graphql_1 = require("graphql"); +var ApolloServerErrorCode; +(function (ApolloServerErrorCode) { + ApolloServerErrorCode["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR"; + ApolloServerErrorCode["GRAPHQL_PARSE_FAILED"] = "GRAPHQL_PARSE_FAILED"; + ApolloServerErrorCode["GRAPHQL_VALIDATION_FAILED"] = "GRAPHQL_VALIDATION_FAILED"; + ApolloServerErrorCode["PERSISTED_QUERY_NOT_FOUND"] = "PERSISTED_QUERY_NOT_FOUND"; + ApolloServerErrorCode["PERSISTED_QUERY_NOT_SUPPORTED"] = "PERSISTED_QUERY_NOT_SUPPORTED"; + ApolloServerErrorCode["BAD_USER_INPUT"] = "BAD_USER_INPUT"; + ApolloServerErrorCode["OPERATION_RESOLUTION_FAILURE"] = "OPERATION_RESOLUTION_FAILURE"; + ApolloServerErrorCode["BAD_REQUEST"] = "BAD_REQUEST"; +})(ApolloServerErrorCode || (exports.ApolloServerErrorCode = ApolloServerErrorCode = {})); +var ApolloServerValidationErrorCode; +(function (ApolloServerValidationErrorCode) { + ApolloServerValidationErrorCode["INTROSPECTION_DISABLED"] = "INTROSPECTION_DISABLED"; + ApolloServerValidationErrorCode["MAX_RECURSIVE_SELECTIONS_EXCEEDED"] = "MAX_RECURSIVE_SELECTIONS_EXCEEDED"; +})(ApolloServerValidationErrorCode || (exports.ApolloServerValidationErrorCode = ApolloServerValidationErrorCode = {})); +function unwrapResolverError(error) { + if (error instanceof graphql_1.GraphQLError && error.path && error.originalError) { + return error.originalError; + } + return error; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js.map new file mode 100644 index 00000000..d61ff274 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/errors/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":";;;AA2BA,kDAKC;AAhCD,qCAAuC;AAEvC,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,wEAA+C,CAAA;IAC/C,sEAA6C,CAAA;IAC7C,gFAAuD,CAAA;IACvD,gFAAuD,CAAA;IACvD,wFAA+D,CAAA;IAC/D,0DAAiC,CAAA;IACjC,sFAA6D,CAAA;IAC7D,oDAA2B,CAAA;AAC7B,CAAC,EATW,qBAAqB,qCAArB,qBAAqB,QAShC;AAED,IAAY,+BAGX;AAHD,WAAY,+BAA+B;IACzC,oFAAiD,CAAA;IACjD,0GAAuE,CAAA;AACzE,CAAC,EAHW,+BAA+B,+CAA/B,+BAA+B,QAG1C;AAWD,SAAgB,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,YAAY,sBAAY,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACvE,OAAO,KAAK,CAAC,aAAa,CAAC;IAC7B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts new file mode 100644 index 00000000..fae0e906 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts @@ -0,0 +1,78 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { IExecutableSchemaDefinition } from '@graphql-tools/schema'; +import type { DocumentNode, ExecutionArgs, FormattedExecutionResult, GraphQLFieldResolver, GraphQLFormattedError, GraphQLSchema, ParseOptions, ValidationRule } from 'graphql'; +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { GatewayInterface } from '@apollo/server-gateway-interface'; +import type { ApolloServerPlugin } from './plugins.js'; +import type { BaseContext, LegacyExperimentalExecuteIncrementally } from './index.js'; +import type { GraphQLExperimentalIncrementalExecutionResultsAlpha2, GraphQLExperimentalIncrementalExecutionResultsAlpha9 } from '../incrementalDeliveryPolyfill.js'; +import type { ValidationOptions } from '../ApolloServer.js'; +export type DocumentStore = KeyValueCache; +export interface ApolloConfigInput { + key?: string; + graphRef?: string; + graphId?: string; + graphVariant?: string; +} +export interface ApolloConfig { + key?: string; + keyHash?: string; + graphRef?: string; +} +export interface PersistedQueryOptions { + cache?: KeyValueCache; + ttl?: number | null; +} +export interface CSRFPreventionOptions { + requestHeaders?: string[]; +} +interface ApolloServerOptionsBase { + formatError?: (formattedError: GraphQLFormattedError, error: unknown) => GraphQLFormattedError; + rootValue?: ((parsedQuery: DocumentNode) => unknown) | unknown; + validationRules?: Array; + fieldResolver?: GraphQLFieldResolver; + cache?: KeyValueCache | 'bounded'; + includeStacktraceInErrorResponses?: boolean; + logger?: Logger; + allowBatchedHttpRequests?: boolean; + stringifyResult?: (value: FormattedExecutionResult) => string | Promise; + introspection?: boolean; + maxRecursiveSelections?: boolean | number; + hideSchemaDetailsFromClientErrors?: boolean; + plugins?: ApolloServerPlugin[]; + persistedQueries?: PersistedQueryOptions | false; + stopOnTerminationSignals?: boolean; + apollo?: ApolloConfigInput; + nodeEnv?: string; + documentStore?: DocumentStore | null; + dangerouslyDisableValidation?: boolean; + validationOptions?: ValidationOptions; + csrfPrevention?: CSRFPreventionOptions | boolean; + parseOptions?: ParseOptions; + executionOptions?: ExecutionArgs['options']; + status400ForVariableCoercionErrors?: boolean; + legacyExperimentalExecuteIncrementally?: LegacyExperimentalExecuteIncrementally; + __testing_incrementalExecutionResults?: GraphQLExperimentalIncrementalExecutionResultsAlpha2 | GraphQLExperimentalIncrementalExecutionResultsAlpha9; +} +export interface ApolloServerOptionsWithGateway extends ApolloServerOptionsBase { + gateway: GatewayInterface; + schema?: undefined; + typeDefs?: undefined; + resolvers?: undefined; +} +export interface ApolloServerOptionsWithSchema extends ApolloServerOptionsBase { + schema: GraphQLSchema; + gateway?: undefined; + typeDefs?: undefined; + resolvers?: undefined; +} +export interface ApolloServerOptionsWithTypeDefs extends ApolloServerOptionsBase { + typeDefs: IExecutableSchemaDefinition['typeDefs']; + resolvers?: IExecutableSchemaDefinition['resolvers']; + gateway?: undefined; + schema?: undefined; +} +export type ApolloServerOptionsWithStaticSchema = ApolloServerOptionsWithSchema | ApolloServerOptionsWithTypeDefs; +export type ApolloServerOptions = ApolloServerOptionsWithGateway | ApolloServerOptionsWithStaticSchema; +export {}; +//# sourceMappingURL=constructor.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts.map new file mode 100644 index 00000000..ea686ad1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constructor.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/constructor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EACV,WAAW,EACX,sCAAsC,EACvC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,oDAAoD,EACpD,oDAAoD,EACrD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAKxD,MAAM,WAAW,iBAAiB;IAEhC,GAAG,CAAC,EAAE,MAAM,CAAC;IAK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,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAGD,MAAM,MAAM,mCAAmC,CAAC,QAAQ,SAAS,WAAW,IACxE,6BAA6B,CAAC,QAAQ,CAAC,GACvC,+BAA+B,CAAC,QAAQ,CAAC,CAAC;AAE9C,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,WAAW,IACxD,8BAA8B,CAAC,QAAQ,CAAC,GACxC,mCAAmC,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js new file mode 100644 index 00000000..4d09b838 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=constructor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js.map new file mode 100644 index 00000000..7f8edadb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/constructor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../../src/externalTypes/constructor.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts new file mode 100644 index 00000000..07f49516 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts @@ -0,0 +1,4 @@ +export type BaseContext = {}; +export type ContextFunction = (...integrationContext: TIntegrationSpecificArgs) => Promise; +export type ContextThunk = () => Promise; +//# sourceMappingURL=context.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts.map new file mode 100644 index 00000000..b4ed2bea --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/context.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG,EAAE,CAAC;AAI7B,MAAM,MAAM,eAAe,CACzB,wBAAwB,SAAS,GAAG,EAAE,EACtC,QAAQ,SAAS,WAAW,GAAG,WAAW,IACxC,CAAC,GAAG,kBAAkB,EAAE,wBAAwB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAM3E,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,WAAW,GAAG,WAAW,IACjE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js new file mode 100644 index 00000000..9de85337 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js.map new file mode 100644 index 00000000..84aa5047 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/context.js.map @@ -0,0 +1 @@ +{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/externalTypes/context.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts new file mode 100644 index 00000000..e9558946 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts @@ -0,0 +1,41 @@ +import type { ExecutionArgs, ExecutionResult, FormattedExecutionResult } from 'graphql'; +import type { BaseContext } from './context.js'; +import type { HTTPGraphQLHead, HTTPGraphQLRequest } from './http.js'; +import type { WithRequired } from '@apollo/utils.withrequired'; +import type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 } from './incrementalDeliveryPolyfillAlpha2.js'; +import type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9 } from './incrementalDeliveryPolyfillAlpha9.js'; +import { type GraphQLExperimentalIncrementalExecutionResultsAlpha2 } from '../incrementalDeliveryPolyfill.js'; +export interface GraphQLRequest { + query?: string; + operationName?: string; + variables?: TVariables; + extensions?: Record; + http?: HTTPGraphQLRequest; +} +export type VariableValues = { + [name: string]: any; +}; +export type GraphQLResponseBody> = { + kind: 'single'; + singleResult: FormattedExecutionResult; +} | { + kind: 'incremental'; + initialResult: GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2; + subsequentResults: AsyncIterable; +} | { + kind: 'incremental'; + initialResult: GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9; + subsequentResults: AsyncIterable; +}; +export type GraphQLInProgressResponse> = { + http: HTTPGraphQLHead; + body?: GraphQLResponseBody; +}; +export type GraphQLResponse> = WithRequired, 'body'>; +export interface ExecuteOperationOptions { + contextValue?: TContext; +} +type PromiseOrValue = Promise | T; +export type LegacyExperimentalExecuteIncrementally, TExtensions = Record> = (args: ExecutionArgs) => PromiseOrValue | GraphQLExperimentalIncrementalExecutionResultsAlpha2>; +export {}; +//# sourceMappingURL=graphql.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts.map new file mode 100644 index 00000000..5b1099e6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/externalTyp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BAAiB,EAAE,aAAa,CAAC,sEAAsE,CAAC,CAAC;CAC1G,CAAC;AAEN,MAAM,MAAM,yBAAyB,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACvE,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,YAAY,CACzE,yBAAyB,CAAC,KAAK,CAAC,EAChC,MAAM,CACP,CAAC;AACF,MAAM,WAAW,uBAAuB,CAAC,QAAQ,SAAS,WAAW;IACnE,YAAY,CAAC,EAAE,QAAQ,CAAC;CACzB;AAED,KAAK,cAAc,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAExC,MAAM,MAAM,sCAAsC,CAChD,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACnC,CACF,IAAI,EAAE,aAAa,KAChB,cAAc,CACf,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,GACnC,oDAAoD,CAAC,KAAK,EAAE,WAAW,CAAC,CAC3E,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js new file mode 100644 index 00000000..8939a289 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=graphql.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js.map new file mode 100644 index 00000000..56ed0525 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/graphql.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/externalTypes/graphql.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts new file mode 100644 index 00000000..84ddf2dc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts @@ -0,0 +1,22 @@ +import type { HeaderMap } from '../utils/HeaderMap.js'; +export interface HTTPGraphQLRequest { + method: string; + headers: HeaderMap; + search: string; + body: unknown; +} +export interface HTTPGraphQLHead { + status?: number; + headers: HeaderMap; +} +export type HTTPGraphQLResponseBody = { + kind: 'complete'; + string: string; +} | { + kind: 'chunked'; + asyncIterator: AsyncIterableIterator; +}; +export type HTTPGraphQLResponse = HTTPGraphQLHead & { + body: HTTPGraphQLResponseBody; +}; +//# sourceMappingURL=http.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts.map new file mode 100644 index 00000000..50dd9e36 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/http.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IAEjC,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,SAAS,CAAC;IAQnB,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,SAAS,CAAC;CACpB;AAQD,MAAM,MAAM,uBAAuB,GAC/B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,IAAI,EAAE,uBAAuB,CAAC;CAC/B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js new file mode 100644 index 00000000..82197ccd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js.map new file mode 100644 index 00000000..5acb1f39 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/http.js.map @@ -0,0 +1 @@ +{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/externalTypes/http.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts new file mode 100644 index 00000000..e4f892c6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts @@ -0,0 +1,28 @@ +import type { FormattedExecutionResult, GraphQLFormattedError } from 'graphql'; +interface ObjMap { + [key: string]: T; +} +export interface GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, TExtensions = ObjMap> extends FormattedExecutionResult { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +export interface GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, TExtensions = ObjMap> { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +export type GraphQLExperimentalFormattedIncrementalResultAlpha2, TExtensions = ObjMap> = GraphQLExperimentalFormattedIncrementalDeferResultAlpha2 | GraphQLExperimentalFormattedIncrementalStreamResultAlpha2; +export interface GraphQLExperimentalFormattedIncrementalDeferResultAlpha2, TExtensions = ObjMap> extends FormattedExecutionResult { + path?: ReadonlyArray; + label?: string; +} +export interface GraphQLExperimentalFormattedIncrementalStreamResultAlpha2, TExtensions = ObjMap> { + errors?: ReadonlyArray; + items?: TData | null; + path?: ReadonlyArray; + label?: string; + extensions?: TExtensions; +} +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha2.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map new file mode 100644 index 00000000..dd75bb75 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha2.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAS/E,UAAU,MAAM,CAAC,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,mEAAmE,CAClF,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAC7B,SAAQ,wBAAwB,CAAC,KAAK,EAAE,WAAW,CAAC;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,aAAa,CACzB,mDAAmD,CAAC,KAAK,EAAE,WAAW,CAAC,CACxE,CAAC;IACF,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,sEAAsE,CACrF,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,aAAa,CACzB,mDAAmD,CAAC,KAAK,EAAE,WAAW,CAAC,CACxE,CAAC;IACF,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,MAAM,mDAAmD,CAC7D,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAE3B,wDAAwD,CAAC,KAAK,EAAE,WAAW,CAAC,GAC5E,yDAAyD,CACvD,KAAK,EACL,WAAW,CACZ,CAAC;AAEN,MAAM,WAAW,wDAAwD,CACvE,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAC7B,SAAQ,wBAAwB,CAAC,KAAK,EAAE,WAAW,CAAC;IACpD,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yDAAyD,CACxE,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,EACtB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,MAAM,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js new file mode 100644 index 00000000..64017940 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha2.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map new file mode 100644 index 00000000..42a84074 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha2.js","sourceRoot":"","sources":["../../../src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts new file mode 100644 index 00000000..610c4c86 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts @@ -0,0 +1,43 @@ +import type { FormattedExecutionResult, GraphQLFormattedError } from 'graphql'; +interface ObjMap { + [key: string]: T; +} +export interface GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, TExtensions = ObjMap> extends FormattedExecutionResult { + data: TData; + pending: ReadonlyArray; + hasNext: boolean; + extensions?: TExtensions; +} +export interface GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, TExtensions = ObjMap> { + hasNext: boolean; + pending?: ReadonlyArray; + incremental?: ReadonlyArray>; + completed?: ReadonlyArray; + extensions?: TExtensions; +} +export type GraphQLExperimentalFormattedIncrementalResultAlpha9, TExtensions = ObjMap> = GraphQLExperimentalFormattedIncrementalDeferResultAlpha9 | GraphQLExperimentalFormattedIncrementalStreamResultAlpha9; +export interface GraphQLExperimentalFormattedIncrementalDeferResultAlpha9, TExtensions = ObjMap> { + errors?: ReadonlyArray; + data: TData; + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +export interface GraphQLExperimentalFormattedIncrementalStreamResultAlpha9, TExtensions = ObjMap> { + errors?: ReadonlyArray; + items: TData; + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +export interface GraphQLExperimentalPendingResultAlpha9 { + id: string; + path: ReadonlyArray; + label?: string; +} +export interface GraphQLExperimentalFormattedCompletedResultAlpha9 { + id: string; + errors?: ReadonlyArray; +} +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha9.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map new file mode 100644 index 00000000..ea534d60 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha9.d.ts","sourceRoot":"","sources":["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AE7B,MAAM,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC9C,IAAI,EAAE,KAAK,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,yDAAyD,CACxE,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,EACtB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,MAAM,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC9C,KAAK,EAAE,KAAK,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,sCAAsC;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,MAAM,WAAW,iDAAiD;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;CAC/C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js new file mode 100644 index 00000000..1a17a2a3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha9.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map new file mode 100644 index 00000000..73407f50 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha9.js","sourceRoot":"","sources":["../../../src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts new file mode 100644 index 00000000..f0a994a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts @@ -0,0 +1,9 @@ +export type { BaseContext, ContextFunction, ContextThunk } from './context.js'; +export type { GraphQLRequest, GraphQLResponse, LegacyExperimentalExecuteIncrementally, } from './graphql.js'; +export type { HTTPGraphQLRequest, HTTPGraphQLResponse, HTTPGraphQLHead, } from './http.js'; +export type { ApolloServerPlugin, GraphQLFieldResolverParams, GraphQLRequestExecutionListener, GraphQLRequestListener, GraphQLRequestListenerDidResolveField, GraphQLRequestListenerExecutionDidEnd, GraphQLRequestListenerParsingDidEnd, GraphQLRequestListenerValidationDidEnd, GraphQLSchemaContext, GraphQLServerListener, GraphQLServerContext, LandingPage, } from './plugins.js'; +export type { GraphQLRequestContext, GraphQLRequestMetrics, GraphQLRequestContextDidEncounterErrors, GraphQLRequestContextDidResolveOperation, GraphQLRequestContextDidResolveSource, GraphQLRequestContextExecutionDidStart, GraphQLRequestContextParsingDidStart, GraphQLRequestContextResponseForOperation, GraphQLRequestContextValidationDidStart, GraphQLRequestContextWillSendResponse, } from './requestPipeline.js'; +export type { DocumentStore, ApolloConfigInput, ApolloConfig, PersistedQueryOptions, CSRFPreventionOptions, ApolloServerOptionsWithSchema, ApolloServerOptionsWithTypeDefs, ApolloServerOptionsWithStaticSchema, ApolloServerOptionsWithGateway, ApolloServerOptions, } from './constructor.js'; +export type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, GraphQLExperimentalFormattedIncrementalResultAlpha2, GraphQLExperimentalFormattedIncrementalDeferResultAlpha2, GraphQLExperimentalFormattedIncrementalStreamResultAlpha2, } from './incrementalDeliveryPolyfillAlpha2.js'; +export type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, GraphQLExperimentalFormattedIncrementalStreamResultAlpha9, GraphQLExperimentalFormattedIncrementalDeferResultAlpha9, GraphQLExperimentalFormattedCompletedResultAlpha9, GraphQLExperimentalFormattedIncrementalResultAlpha9, GraphQLExperimentalPendingResultAlpha9, } from './incrementalDeliveryPolyfillAlpha9.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts.map new file mode 100644 index 00000000..20512a9f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/index.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/E,YAAY,EACV,cAAc,EACd,eAAe,EACf,sCAAsC,GACvC,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,+BAA+B,EAC/B,sBAAsB,EACtB,qCAAqC,EACrC,qCAAqC,EACrC,mCAAmC,EACnC,sCAAsC,EACtC,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,uCAAuC,EACvC,wCAAwC,EACxC,qCAAqC,EACrC,sCAAsC,EACtC,oCAAoC,EACpC,yCAAyC,EACzC,uCAAuC,EACvC,qCAAqC,GACtC,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,mEAAmE,EACnE,sEAAsE,EACtE,mDAAmD,EACnD,wDAAwD,EACxD,yDAAyD,GAC1D,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EACV,mEAAmE,EACnE,sEAAsE,EACtE,yDAAyD,EACzD,wDAAwD,EACxD,iDAAiD,EACjD,mDAAmD,EACnD,sCAAsC,GACvC,MAAM,wCAAwC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js new file mode 100644 index 00000000..aa219d8f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js.map new file mode 100644 index 00000000..4dad4658 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/externalTypes/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts new file mode 100644 index 00000000..3f1651c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts @@ -0,0 +1,75 @@ +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { Logger } from '@apollo/utils.logger'; +import type { GraphQLError, GraphQLResolveInfo, GraphQLSchema } from 'graphql'; +import type { ApolloConfig } from './constructor.js'; +import type { BaseContext } from './context.js'; +import type { GraphQLResponse } from './graphql.js'; +import type { GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 } from './incrementalDeliveryPolyfillAlpha2.js'; +import type { GraphQLRequestContext, GraphQLRequestContextDidEncounterErrors, GraphQLRequestContextDidEncounterSubsequentErrors, GraphQLRequestContextDidResolveOperation, GraphQLRequestContextDidResolveSource, GraphQLRequestContextExecutionDidStart, GraphQLRequestContextParsingDidStart, GraphQLRequestContextResponseForOperation, GraphQLRequestContextValidationDidStart, GraphQLRequestContextWillSendResponse, GraphQLRequestContextWillSendSubsequentPayload } from './requestPipeline.js'; +import type { GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9 } from './incrementalDeliveryPolyfillAlpha9.js'; +export interface GraphQLServerContext { + readonly logger: Logger; + readonly cache: KeyValueCache; + schema: GraphQLSchema; + apollo: ApolloConfig; + startedInBackground: boolean; +} +export interface GraphQLSchemaContext { + apiSchema: GraphQLSchema; + coreSupergraphSdl?: string; +} +export interface ApolloServerPlugin { + serverWillStart?(service: GraphQLServerContext): Promise; + requestDidStart?(requestContext: GraphQLRequestContext): Promise | void>; + unexpectedErrorProcessingRequest?({ requestContext, error, }: { + requestContext: GraphQLRequestContext; + error: Error; + }): Promise; + contextCreationDidFail?({ error }: { + error: Error; + }): Promise; + invalidRequestWasReceived?({ error }: { + error: Error; + }): Promise; + startupDidFail?({ error }: { + error: Error; + }): Promise; +} +export interface GraphQLServerListener { + schemaDidLoadOrUpdate?(schemaContext: GraphQLSchemaContext): void; + drainServer?(): Promise; + serverWillStop?(): Promise; + renderLandingPage?(): Promise; +} +export interface LandingPage { + html: string | (() => Promise); +} +export type GraphQLRequestListenerParsingDidEnd = (err?: Error) => Promise; +export type GraphQLRequestListenerValidationDidEnd = (err?: ReadonlyArray) => Promise; +export type GraphQLRequestListenerExecutionDidEnd = (err?: Error) => Promise; +export type GraphQLRequestListenerDidResolveField = (error: Error | null, result?: any) => void; +export interface GraphQLRequestListener { + didResolveSource?(requestContext: GraphQLRequestContextDidResolveSource): Promise; + parsingDidStart?(requestContext: GraphQLRequestContextParsingDidStart): Promise; + validationDidStart?(requestContext: GraphQLRequestContextValidationDidStart): Promise; + didResolveOperation?(requestContext: GraphQLRequestContextDidResolveOperation): Promise; + didEncounterErrors?(requestContext: GraphQLRequestContextDidEncounterErrors): Promise; + responseForOperation?(requestContext: GraphQLRequestContextResponseForOperation): Promise; + executionDidStart?(requestContext: GraphQLRequestContextExecutionDidStart): Promise | void>; + willSendResponse?(requestContext: GraphQLRequestContextWillSendResponse): Promise; + didEncounterSubsequentErrors?(requestContext: GraphQLRequestContextDidEncounterSubsequentErrors, errors: ReadonlyArray): Promise; + willSendSubsequentPayload?(requestContext: GraphQLRequestContextWillSendSubsequentPayload, payload: GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 | GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9): Promise; +} +export type GraphQLFieldResolverParams = { + source: TSource; + args: TArgs; + contextValue: TContext; + info: GraphQLResolveInfo; +}; +export interface GraphQLRequestExecutionListener { + executionDidEnd?: GraphQLRequestListenerExecutionDidEnd; + willResolveField?(fieldResolverParams: GraphQLFieldResolverParams): GraphQLRequestListenerDidResolveField | void; +} +//# sourceMappingURL=plugins.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts.map new file mode 100644 index 00000000..5c178661 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/plugins.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAA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CAAC;IAGjB,yBAAyB,CAAC,CACxB,cAAc,EAAE,8CAA8C,CAAC,QAAQ,CAAC,EACxE,OAAO,EACH,sEAAsE,GACtE,sEAAsE,GACzE,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAYD,MAAM,MAAM,0BAA0B,CACpC,OAAO,EACP,QAAQ,EACR,KAAK,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAChC;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,QAAQ,CAAC;IACvB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,+BAA+B,CAAC,QAAQ,SAAS,WAAW;IAC3E,eAAe,CAAC,EAAE,qCAAqC,CAAC;IAOxD,gBAAgB,CAAC,CACf,mBAAmB,EAAE,0BAA0B,CAAC,GAAG,EAAE,QAAQ,CAAC,GAC7D,qCAAqC,GAAG,IAAI,CAAC;CACjD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js new file mode 100644 index 00000000..1686819c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=plugins.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js.map new file mode 100644 index 00000000..cef3894d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/plugins.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/externalTypes/plugins.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts new file mode 100644 index 00000000..a77ac3a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts @@ -0,0 +1,50 @@ +import type { WithRequired } from '@apollo/utils.withrequired'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { BaseContext } from './context.js'; +import type { GraphQLInProgressResponse, GraphQLRequest, GraphQLResponse } from './graphql.js'; +import type { Logger } from '@apollo/utils.logger'; +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { DocumentNode, GraphQLError, GraphQLSchema, OperationDefinitionNode } from 'graphql'; +import type { CachePolicy } from '@apollo/cache-control-types'; +import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface'; +export interface GraphQLRequestMetrics { + captureTraces?: boolean; + persistedQueryHit?: boolean; + persistedQueryRegister?: boolean; + responseCacheHit?: boolean; + forbiddenOperation?: boolean; + registeredOperation?: boolean; + startHrTime?: [number, number]; + queryPlanTrace?: Trace.QueryPlanNode; + nonFtv1ErrorPaths?: NonFtv1ErrorPath[]; +} +export interface GraphQLRequestContext { + readonly logger: Logger; + readonly cache: KeyValueCache; + readonly request: GraphQLRequest; + readonly response: GraphQLInProgressResponse; + readonly schema: GraphQLSchema; + readonly contextValue: TContext; + readonly queryHash?: string; + readonly document?: DocumentNode; + readonly source?: string; + readonly operationName?: string | null; + readonly operation?: OperationDefinitionNode; + readonly errors?: ReadonlyArray; + readonly metrics: GraphQLRequestMetrics; + readonly overallCachePolicy: CachePolicy; + readonly requestIsBatched: boolean; +} +export type GraphQLRequestContextDidResolveSource = WithRequired, 'source' | 'queryHash'>; +export type GraphQLRequestContextParsingDidStart = GraphQLRequestContextDidResolveSource; +export type GraphQLRequestContextValidationDidStart = GraphQLRequestContextParsingDidStart & WithRequired, 'document'>; +export type GraphQLRequestContextDidResolveOperation = GraphQLRequestContextValidationDidStart & WithRequired, 'operationName'>; +export type GraphQLRequestContextDidEncounterErrors = WithRequired, 'errors'>; +export type GraphQLRequestContextResponseForOperation = WithRequired, 'source' | 'document' | 'operation' | 'operationName'>; +export type GraphQLRequestContextExecutionDidStart = GraphQLRequestContextParsingDidStart & WithRequired, 'document' | 'operation' | 'operationName'>; +export type GraphQLRequestContextWillSendResponse = GraphQLRequestContextDidResolveSource & { + readonly response: GraphQLResponse; +}; +export type GraphQLRequestContextDidEncounterSubsequentErrors = GraphQLRequestContextWillSendResponse; +export type GraphQLRequestContextWillSendSubsequentPayload = GraphQLRequestContextWillSendResponse; +//# sourceMappingURL=requestPipeline.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts.map new file mode 100644 index 00000000..eb547e6b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/requestPipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OA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IAC1B,YAAY,CACd,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,eAAe,CACtD,CAAC;AACF,MAAM,MAAM,sCAAsC,CAChD,QAAQ,SAAS,WAAW,IAC1B,oCAAoC,CAAC,QAAQ,CAAC,GAChD,YAAY,CACV,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,UAAU,GAAG,WAAW,GAAG,eAAe,CAC3C,CAAC;AACJ,MAAM,MAAM,qCAAqC,CAC/C,QAAQ,SAAS,WAAW,IAC1B,qCAAqC,CAAC,QAAQ,CAAC,GAAG;IACpD,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;CACpC,CAAC;AACF,MAAM,MAAM,iDAAiD,CAC3D,QAAQ,SAAS,WAAW,IAC1B,qCAAqC,CAAC,QAAQ,CAAC,CAAC;AACpD,MAAM,MAAM,8CAA8C,CACxD,QAAQ,SAAS,WAAW,IAC1B,qCAAqC,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js new file mode 100644 index 00000000..c203d26e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=requestPipeline.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js.map new file mode 100644 index 00000000..f15830a0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/externalTypes/requestPipeline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.js","sourceRoot":"","sources":["../../../src/externalTypes/requestPipeline.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts new file mode 100644 index 00000000..c42920ed --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts @@ -0,0 +1,2 @@ +export declare const packageVersion = "5.5.1"; +//# sourceMappingURL=packageVersion.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts.map new file mode 100644 index 00000000..311839d9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../../../src/generated/packageVersion.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,UAAU,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js new file mode 100644 index 00000000..300506c8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.packageVersion = void 0; +exports.packageVersion = "5.5.1"; +//# sourceMappingURL=packageVersion.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js.map new file mode 100644 index 00000000..b19c0042 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/generated/packageVersion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../../../src/generated/packageVersion.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,OAAO,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts new file mode 100644 index 00000000..c0d60f07 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts @@ -0,0 +1,4 @@ +import type { BaseContext, HTTPGraphQLRequest, HTTPGraphQLResponse } from './externalTypes/index.js'; +import type { ApolloServer, ApolloServerInternals, SchemaDerivedData } from './ApolloServer'; +export declare function runPotentiallyBatchedHttpQuery(server: ApolloServer, httpGraphQLRequest: HTTPGraphQLRequest, contextValue: TContext, schemaDerivedData: SchemaDerivedData, internals: ApolloServerInternals): Promise; +//# sourceMappingURL=httpBatching.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts.map new file mode 100644 index 00000000..f2e00c91 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"httpBatching.d.ts","sourceRoot":"","sources":["../../src/httpBatching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AA4DxB,wBAAsB,8BAA8B,CAClD,QAAQ,SAAS,WAAW,EAE5B,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,QAAQ,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC,CA2B9B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.js new file mode 100644 index 00000000..e7430b3d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.runPotentiallyBatchedHttpQuery = runPotentiallyBatchedHttpQuery; +const runHttpQuery_js_1 = require("./runHttpQuery.js"); +const internalErrorClasses_js_1 = require("./internalErrorClasses.js"); +async function runBatchedHttpQuery({ server, batchRequest, body, contextValue, schemaDerivedData, internals, }) { + if (body.length === 0) { + throw new internalErrorClasses_js_1.BadRequestError('No operations found in request.'); + } + const sharedResponseHTTPGraphQLHead = (0, runHttpQuery_js_1.newHTTPGraphQLHead)(); + const responseBodies = await Promise.all(body.map(async (bodyPiece) => { + const singleRequest = { + ...batchRequest, + body: bodyPiece, + }; + const response = await (0, runHttpQuery_js_1.runHttpQuery)({ + server, + httpRequest: singleRequest, + contextValue, + schemaDerivedData, + internals, + sharedResponseHTTPGraphQLHead, + }); + if (response.body.kind === 'chunked') { + throw Error('Incremental delivery is not implemented for batch requests'); + } + return response.body.string; + })); + return { + ...sharedResponseHTTPGraphQLHead, + body: { kind: 'complete', string: `[${responseBodies.join(',')}]` }, + }; +} +async function runPotentiallyBatchedHttpQuery(server, httpGraphQLRequest, contextValue, schemaDerivedData, internals) { + if (!(httpGraphQLRequest.method === 'POST' && + Array.isArray(httpGraphQLRequest.body))) { + return await (0, runHttpQuery_js_1.runHttpQuery)({ + server, + httpRequest: httpGraphQLRequest, + contextValue, + schemaDerivedData, + internals, + sharedResponseHTTPGraphQLHead: null, + }); + } + if (internals.allowBatchedHttpRequests) { + return await runBatchedHttpQuery({ + server, + batchRequest: httpGraphQLRequest, + body: httpGraphQLRequest.body, + contextValue, + schemaDerivedData, + internals, + }); + } + throw new internalErrorClasses_js_1.BadRequestError('Operation batching disabled.'); +} +//# sourceMappingURL=httpBatching.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/httpBatching.js.map new file mode 100644 index 00000000..6e957606 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apoll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tB,iBAAoC,EACpC,SAA0C;IAE1C,IACE,CAAC,CACC,kBAAkB,CAAC,MAAM,KAAK,MAAM;QACpC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CACvC,EACD,CAAC;QACD,OAAO,MAAM,IAAA,8BAAY,EAAC;YACxB,MAAM;YACN,WAAW,EAAE,kBAAkB;YAC/B,YAAY;YACZ,iBAAiB;YACjB,SAAS;YACT,6BAA6B,EAAE,IAAI;SACpC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,SAAS,CAAC,wBAAwB,EAAE,CAAC;QACvC,OAAO,MAAM,mBAAmB,CAAC;YAC/B,MAAM;YACN,YAAY,EAAE,kBAAkB;YAChC,IAAI,EAAE,kBAAkB,CAAC,IAAiB;YAC1C,YAAY;YACZ,iBAAiB;YACjB,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,yCAAe,CAAC,8BAA8B,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts new file mode 100644 index 00000000..3e9d24c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts @@ -0,0 +1,82 @@ +import { type ExecutionArgs, type ExecutionResult, type GraphQLError } from 'graphql'; +import { type LegacyExperimentalExecuteIncrementally } from './externalTypes/graphql.js'; +interface ObjMap { + [key: string]: T; +} +export interface GraphQLExperimentalInitialIncrementalExecutionResultAlpha2, TExtensions = ObjMap> extends ExecutionResult { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +export interface GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha2, TExtensions = ObjMap> { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +type GraphQLExperimentalIncrementalResultAlpha2, TExtensions = ObjMap> = GraphQLExperimentalIncrementalDeferResultAlpha2 | GraphQLExperimentalIncrementalStreamResultAlpha2; +interface GraphQLExperimentalIncrementalDeferResultAlpha2, TExtensions = ObjMap> extends ExecutionResult { + path?: ReadonlyArray; + label?: string; +} +interface GraphQLExperimentalIncrementalStreamResultAlpha2, TExtensions = ObjMap> { + errors?: ReadonlyArray; + items?: TData | null; + path?: ReadonlyArray; + label?: string; + extensions?: TExtensions; +} +export interface GraphQLExperimentalIncrementalExecutionResultsAlpha2, TExtensions = ObjMap> { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha2; + subsequentResults: AsyncGenerator, void, void>; +} +export interface GraphQLExperimentalInitialIncrementalExecutionResultAlpha9, TExtensions = ObjMap> extends ExecutionResult { + data: TData; + pending: ReadonlyArray; + hasNext: true; + extensions?: TExtensions; +} +export interface GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha9, TExtensions = ObjMap> { + pending?: ReadonlyArray; + incremental?: ReadonlyArray>; + completed?: ReadonlyArray; + hasNext: boolean; + extensions?: TExtensions; +} +interface GraphQLExperimentalExecutionGroupResultAlpha9> { + errors?: ReadonlyArray; + data: TData; +} +interface GraphQLExperimentalIncrementalDeferResultAlpha9, TExtensions = ObjMap> extends GraphQLExperimentalExecutionGroupResultAlpha9 { + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +interface GraphQLExperimentalStreamItemsRecordResultAlpha9> { + errors?: ReadonlyArray; + items: TData; +} +interface GraphQLExperimentalIncrementalStreamResultAlpha9, TExtensions = ObjMap> extends GraphQLExperimentalStreamItemsRecordResultAlpha9 { + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +type GraphQLExperimentalIncrementalResultAlpha9> = GraphQLExperimentalIncrementalDeferResultAlpha9 | GraphQLExperimentalIncrementalStreamResultAlpha9; +interface GraphQLExperimentalPendingResultAlpha9 { + id: string; + path: ReadonlyArray; + label?: string; +} +interface GraphQLExperimentalCompletedResultAlpha9 { + id: string; + errors?: ReadonlyArray; +} +export interface GraphQLExperimentalIncrementalExecutionResultsAlpha9, TSubsequent = unknown, TExtensions = ObjMap> { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha9; + subsequentResults: AsyncGenerator, void, void>; +} +export declare function executeIncrementally({ useLegacyIncremental, legacyExperimentalExecuteIncrementally, ...args }: ExecutionArgs & { + useLegacyIncremental?: boolean; + legacyExperimentalExecuteIncrementally: LegacyExperimentalExecuteIncrementally | undefined; +}): Promise; +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfill.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts.map new file mode 100644 index 00000000..d609c082 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfill.d.ts","sourceRoot":"","sources":["../../src/incrementalDeliveryPolyfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,KAAK,sCAAsC,EAAE,MAAM,4BAA4B,CAAC;AAOzF,UAAU,MAAM,CAAC,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;CAClB;AAGD,MAAM,WAAW,0DAA0D,CACzE,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,O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AG,OAAO,EACrB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,aAAa,EAAE,0DAA0D,CACvE,QAAQ,EACR,WAAW,CACZ,CAAC;IACF,iBAAiB,EAAE,cAAc,CAC/B,6DAA6D,CAC3D,WAAW,EACX,WAAW,CACZ,EACD,IAAI,EACJ,IAAI,CACL,CAAC;CACH;AAkCD,wBAAsB,oBAAoB,CAAC,EACzC,oBAAoB,EACpB,sCAAsC,EACtC,GAAG,IAAI,EACR,EAAE,aAAa,GAAG;IACjB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,sCAAsC,EAClC,sCAAsC,GACtC,SAAS,CAAC;CACf,GAAG,OAAO,CACP,eAAe,GACf,oDAAoD,GACpD,oDAAoD,CACvD,CA4BA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js new file mode 100644 index 00000000..5dc4efc9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js @@ -0,0 +1,74 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.executeIncrementally = executeIncrementally; +const graphql_1 = require("graphql"); +const internalErrorClasses_js_1 = require("./internalErrorClasses.js"); +const ApolloServer_js_1 = require("./ApolloServer.js"); +let graphqlExperimentalExecuteIncrementally = undefined; +async function tryToLoadGraphQL17() { + if (graphqlExperimentalExecuteIncrementally !== undefined) { + return; + } + const graphql = await Promise.resolve().then(() => __importStar(require('graphql'))); + if (graphql.version === '17.0.0-alpha.9' && + 'experimentalExecuteIncrementally' in graphql) { + graphqlExperimentalExecuteIncrementally = graphql + .experimentalExecuteIncrementally; + } + else { + graphqlExperimentalExecuteIncrementally = null; + } +} +async function executeIncrementally({ useLegacyIncremental, legacyExperimentalExecuteIncrementally, ...args }) { + await tryToLoadGraphQL17(); + if (useLegacyIncremental) { + if (legacyExperimentalExecuteIncrementally) { + return legacyExperimentalExecuteIncrementally(args); + } + if (graphqlExperimentalExecuteIncrementally) { + throw new internalErrorClasses_js_1.BadRequestError('Apollo Server received an operation that uses incremental delivery ' + + '(@defer or @stream) with the legacy incremental format, but the server ' + + 'does not support the legacy incremental delivery format. Add the HTTP ' + + `header: 'Accept: ${ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' ` + + 'to use the current incremental delivery format', { extensions: { http: { status: 406 } } }); + } + } + if (graphqlExperimentalExecuteIncrementally) { + return graphqlExperimentalExecuteIncrementally(args); + } + return (0, graphql_1.execute)(args); +} +//# sourceMappingURL=incrementalDeliveryPolyfill.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js.map new file mode 100644 index 00000000..100ab573 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfill.js","sourceRoot":"","sources":["../../src/incrementalDeliveryPolyfill.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmNA,oDAyCC;AA5PD,qCAKiB;AACjB,uEAA4D;AAC5D,uDAAgD;AAkLhD,IAAI,uCAAuC,GAO3B,SAAS,CAAC;AAE1B,KAAK,UAAU,kBAAkB;IAC/B,IAAI,uCAAuC,KAAK,SAAS,EAAE,CAAC;QAC1D,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,wDAAa,SAAS,GAAC,CAAC;IACxC,IACE,OAAO,CAAC,OAAO,KAAK,gBAAgB;QACpC,kCAAkC,IAAI,OAAO,EAC7C,CAAC;QACD,uCAAuC,GAAI,OAAe;aACvD,gCAAgC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,uCAAuC,GAAG,IAAI,CAAC;IACjD,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,oBAAoB,CAAC,EACzC,oBAAoB,EACpB,sCAAsC,EACtC,GAAG,IAAI,EAMR;IAKC,MAAM,kBAAkB,EAAE,CAAC;IAE3B,IAAI,oBAAoB,EAAE,CAAC;QACzB,IAAI,sCAAsC,EAAE,CAAC;YAC3C,OAAO,sCAAsC,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;QAKD,IAAI,uCAAuC,EAAE,CAAC;YAC5C,MAAM,IAAI,yCAAe,CACvB,qEAAqE;gBACnE,yEAAyE;gBACzE,wEAAwE;gBACxE,oBAAoB,6BAAW,CAAC,oCAAoC,IAAI;gBACxE,gDAAgD,EAElD,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,CAC1C,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,uCAAuC,EAAE,CAAC;QAC5C,OAAO,uCAAuC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,IAAA,iBAAO,EAAC,IAAI,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts new file mode 100644 index 00000000..caee4a82 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts @@ -0,0 +1,4 @@ +export { ApolloServer } from './ApolloServer.js'; +export { HeaderMap } from './utils/HeaderMap.js'; +export * from './externalTypes/index.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts.map new file mode 100644 index 00000000..13e33879 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,cAAc,0BAA0B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js new file mode 100644 index 00000000..e9b3106f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HeaderMap = exports.ApolloServer = void 0; +var ApolloServer_js_1 = require("./ApolloServer.js"); +Object.defineProperty(exports, "ApolloServer", { enumerable: true, get: function () { return ApolloServer_js_1.ApolloServer; } }); +var HeaderMap_js_1 = require("./utils/HeaderMap.js"); +Object.defineProperty(exports, "HeaderMap", { enumerable: true, get: function () { return HeaderMap_js_1.HeaderMap; } }); +__exportStar(require("./externalTypes/index.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js.map new file mode 100644 index 00000000..6f97b903 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AACrB,qDAAiD;AAAxC,yGAAA,SAAS,OAAA;AAElB,2DAAyC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts new file mode 100644 index 00000000..82e9d045 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts @@ -0,0 +1,28 @@ +import { GraphQLError, type GraphQLErrorOptions } from 'graphql'; +import { ApolloServerErrorCode } from './errors/index.js'; +declare class GraphQLErrorWithCode extends GraphQLError { + constructor(message: string, code: ApolloServerErrorCode, options?: GraphQLErrorOptions); +} +export declare class SyntaxError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class ValidationError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class PersistedQueryNotFoundError extends GraphQLErrorWithCode { + constructor(); +} +export declare class PersistedQueryNotSupportedError extends GraphQLErrorWithCode { + constructor(); +} +export declare class UserInputError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class OperationResolutionError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class BadRequestError extends GraphQLErrorWithCode { + constructor(message: string, options?: GraphQLErrorOptions); +} +export {}; +//# sourceMappingURL=internalErrorClasses.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts.map new file mode 100644 index 00000000..cb8bc2da --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"internalErrorClasses.d.ts","sourceRoot":"","sources":["../../src/internalErrorClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAO1D,cAAM,oBAAqB,SAAQ,YAAY;gBAE3C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,mBAAmB;CAQhC;AAED,qBAAa,WAAY,SAAQ,oBAAoB;gBACvC,YAAY,EAAE,YAAY;CAQvC;AAED,qBAAa,eAAgB,SAAQ,oBAAoB;gBAC3C,YAAY,EAAE,YAAY;CAcvC;AAcD,qBAAa,2BAA4B,SAAQ,oBAAoB;;CAQpE;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;;CAYxE;AAED,qBAAa,cAAe,SAAQ,oBAAoB;gBAC1C,YAAY,EAAE,YAAY;CAOvC;AAED,qBAAa,wBAAyB,SAAQ,oBAAoB;gBACpD,YAAY,EAAE,YAAY;CAcvC;AAED,qBAAa,eAAgB,SAAQ,oBAAoB;gBAC3C,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;CAQ3D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js new file mode 100644 index 00000000..bbc8eb5b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BadRequestError = exports.OperationResolutionError = exports.UserInputError = exports.PersistedQueryNotSupportedError = exports.PersistedQueryNotFoundError = exports.ValidationError = exports.SyntaxError = void 0; +const graphql_1 = require("graphql"); +const index_js_1 = require("./errors/index.js"); +const runHttpQuery_js_1 = require("./runHttpQuery.js"); +const HeaderMap_js_1 = require("./utils/HeaderMap.js"); +class GraphQLErrorWithCode extends graphql_1.GraphQLError { + constructor(message, code, options) { + super(message, { + ...options, + extensions: { ...options?.extensions, code }, + }); + this.name = this.constructor.name; + } +} +class SyntaxError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, index_js_1.ApolloServerErrorCode.GRAPHQL_PARSE_FAILED, { + source: graphqlError.source, + positions: graphqlError.positions, + extensions: { http: (0, runHttpQuery_js_1.newHTTPGraphQLHead)(400), ...graphqlError.extensions }, + originalError: graphqlError, + }); + } +} +exports.SyntaxError = SyntaxError; +class ValidationError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, index_js_1.ApolloServerErrorCode.GRAPHQL_VALIDATION_FAILED, { + nodes: graphqlError.nodes, + extensions: { + http: (0, runHttpQuery_js_1.newHTTPGraphQLHead)(400), + ...graphqlError.extensions, + }, + originalError: graphqlError.originalError ?? graphqlError, + }); + } +} +exports.ValidationError = ValidationError; +const getPersistedQueryErrorHttp = () => ({ + status: 200, + headers: new HeaderMap_js_1.HeaderMap([ + ['cache-control', 'private, no-cache, must-revalidate'], + ]), +}); +class PersistedQueryNotFoundError extends GraphQLErrorWithCode { + constructor() { + super('PersistedQueryNotFound', index_js_1.ApolloServerErrorCode.PERSISTED_QUERY_NOT_FOUND, { extensions: { http: getPersistedQueryErrorHttp() } }); + } +} +exports.PersistedQueryNotFoundError = PersistedQueryNotFoundError; +class PersistedQueryNotSupportedError extends GraphQLErrorWithCode { + constructor() { + super('PersistedQueryNotSupported', index_js_1.ApolloServerErrorCode.PERSISTED_QUERY_NOT_SUPPORTED, { extensions: { http: getPersistedQueryErrorHttp() } }); + } +} +exports.PersistedQueryNotSupportedError = PersistedQueryNotSupportedError; +class UserInputError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, index_js_1.ApolloServerErrorCode.BAD_USER_INPUT, { + nodes: graphqlError.nodes, + originalError: graphqlError.originalError ?? graphqlError, + extensions: graphqlError.extensions, + }); + } +} +exports.UserInputError = UserInputError; +class OperationResolutionError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, index_js_1.ApolloServerErrorCode.OPERATION_RESOLUTION_FAILURE, { + nodes: graphqlError.nodes, + originalError: graphqlError.originalError ?? graphqlError, + extensions: { + http: (0, runHttpQuery_js_1.newHTTPGraphQLHead)(400), + ...graphqlError.extensions, + }, + }); + } +} +exports.OperationResolutionError = OperationResolutionError; +class BadRequestError extends GraphQLErrorWithCode { + constructor(message, options) { + super(message, index_js_1.ApolloServerErrorCode.BAD_REQUEST, { + ...options, + extensions: { http: (0, runHttpQuery_js_1.newHTTPGraphQLHead)(400), ...options?.extensions }, + }); + } +} +exports.BadRequestError = BadRequestError; +//# sourceMappingURL=internalErrorClasses.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js.map new file mode 100644 index 00000000..6af31d5f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalErrorClasses.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internalErrorClasses.js","sourceRoot":"","sources":["../../src/internalErr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W,EAAE;YAChD,GAAG,OAAO;YAGV,UAAU,EAAE,EAAE,IAAI,EAAE,IAAA,oCAAkB,EAAC,GAAG,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE;SACtE,CAAC,CAAC;IACL,CAAC;CACF;AATD,0CASC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts new file mode 100644 index 00000000..5d6895db --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts @@ -0,0 +1,9 @@ +import type { BaseContext, ApolloServerPlugin } from './externalTypes/index.js'; +export interface InternalApolloServerPlugin extends ApolloServerPlugin { + __internal_plugin_id__: InternalPluginId; + __is_disabled_plugin__: boolean; +} +export declare function internalPlugin(p: InternalApolloServerPlugin): ApolloServerPlugin; +export type InternalPluginId = 'CacheControl' | 'LandingPageDisabled' | 'SchemaReporting' | 'InlineTrace' | 'UsageReporting' | 'DisableSuggestions'; +export declare function pluginIsInternal(plugin: ApolloServerPlugin): plugin is InternalApolloServerPlugin; +//# sourceMappingURL=internalPlugin.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts.map new file mode 100644 index 00000000..379b16c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"internalPlugin.d.ts","sourceRoot":"","sources":["../../src/internalPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAShF,MAAM,WAAW,0BAA0B,CAAC,QAAQ,SAAS,WAAW,CACtE,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAGpC,sBAAsB,EAAE,gBAAgB,CAAC;IACzC,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAMD,wBAAgB,cAAc,CAAC,QAAQ,SAAS,WAAW,EACzD,CAAC,EAAE,0BAA0B,CAAC,QAAQ,CAAC,GACtC,kBAAkB,CAAC,QAAQ,CAAC,CAE9B;AAED,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,qBAAqB,GACrB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,WAAW,EAC3D,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACnC,MAAM,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAIhD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js new file mode 100644 index 00000000..0585dfbc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.internalPlugin = internalPlugin; +exports.pluginIsInternal = pluginIsInternal; +function internalPlugin(p) { + return p; +} +function pluginIsInternal(plugin) { + return '__internal_plugin_id__' in plugin; +} +//# sourceMappingURL=internalPlugin.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js.map new file mode 100644 index 00000000..4000d535 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/internalPlugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internalPlugin.js","sourceRoot":"","sources":["../../src/internalPlugin.ts"],"names":[],"mappings":";;AAqBA,wCAIC;AAUD,4CAMC;AApBD,SAAgB,cAAc,CAC5B,CAAuC;IAEvC,OAAO,CAAC,CAAC;AACX,CAAC;AAUD,SAAgB,gBAAgB,CAC9B,MAAoC;IAIpC,OAAO,wBAAwB,IAAI,MAAM,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts new file mode 100644 index 00000000..6c8ed8be --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts @@ -0,0 +1,9 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import type { CacheHint } from '@apollo/cache-control-types'; +export interface ApolloServerPluginCacheControlOptions { + defaultMaxAge?: number; + calculateHttpHeaders?: boolean | 'if-cacheable'; + __testing__cacheHints?: Map; +} +export declare function ApolloServerPluginCacheControl(options?: ApolloServerPluginCacheControlOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts.map new file mode 100644 index 00000000..22b02c3c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/cacheControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAcvE,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,6BAA6B,CAAC;AAYrC,MAAM,WAAW,qCAAqC;IASpD,aAAa,CAAC,EAAE,MAAM,CAAC;IAUvB,oBAAoB,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IAEhD,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAChD;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,GAAE,qCAA2D,GACnE,kBAAkB,CAyRpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js new file mode 100644 index 00000000..f5900af1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js @@ -0,0 +1,223 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginCacheControl = ApolloServerPluginCacheControl; +const graphql_1 = require("graphql"); +const cachePolicy_js_1 = require("../../cachePolicy.js"); +const internalPlugin_js_1 = require("../../internalPlugin.js"); +const lru_cache_1 = require("lru-cache"); +function ApolloServerPluginCacheControl(options = Object.create(null)) { + let typeAnnotationCache; + let fieldAnnotationCache; + return (0, internalPlugin_js_1.internalPlugin)({ + __internal_plugin_id__: 'CacheControl', + __is_disabled_plugin__: false, + async serverWillStart({ schema }) { + typeAnnotationCache = new lru_cache_1.LRUCache({ + max: Object.values(schema.getTypeMap()).filter(graphql_1.isCompositeType) + .length, + }); + fieldAnnotationCache = new lru_cache_1.LRUCache({ + max: Object.values(schema.getTypeMap()) + .filter(graphql_1.isObjectType) + .flatMap((t) => Object.values(t.getFields())).length + + Object.values(schema.getTypeMap()) + .filter(graphql_1.isInterfaceType) + .flatMap((t) => Object.values(t.getFields())).length, + }); + return undefined; + }, + async requestDidStart(requestContext) { + function memoizedCacheAnnotationFromType(t) { + const existing = typeAnnotationCache.get(t); + if (existing) { + return existing; + } + const annotation = cacheAnnotationFromType(t); + typeAnnotationCache.set(t, annotation); + return annotation; + } + function memoizedCacheAnnotationFromField(field) { + const existing = fieldAnnotationCache.get(field); + if (existing) { + return existing; + } + const annotation = cacheAnnotationFromField(field); + fieldAnnotationCache.set(field, annotation); + return annotation; + } + const defaultMaxAge = options.defaultMaxAge ?? 0; + const calculateHttpHeaders = options.calculateHttpHeaders ?? true; + const { __testing__cacheHints } = options; + return { + async executionDidStart() { + if (isRestricted(requestContext.overallCachePolicy)) { + const fakeFieldPolicy = (0, cachePolicy_js_1.newCachePolicy)(); + return { + willResolveField({ info }) { + info.cacheControl = { + setCacheHint: (dynamicHint) => { + fakeFieldPolicy.replace(dynamicHint); + }, + cacheHint: fakeFieldPolicy, + cacheHintFromType: memoizedCacheAnnotationFromType, + }; + }, + }; + } + return { + willResolveField({ info }) { + const fieldPolicy = (0, cachePolicy_js_1.newCachePolicy)(); + let inheritMaxAge = false; + const targetType = (0, graphql_1.getNamedType)(info.returnType); + if ((0, graphql_1.isCompositeType)(targetType)) { + const typeAnnotation = memoizedCacheAnnotationFromType(targetType); + fieldPolicy.replace(typeAnnotation); + inheritMaxAge = !!typeAnnotation.inheritMaxAge; + } + const fieldAnnotation = memoizedCacheAnnotationFromField(info.parentType.getFields()[info.fieldName]); + if (fieldAnnotation.inheritMaxAge && + fieldPolicy.maxAge === undefined) { + inheritMaxAge = true; + if (fieldAnnotation.scope) { + fieldPolicy.replace({ scope: fieldAnnotation.scope }); + } + } + else { + fieldPolicy.replace(fieldAnnotation); + } + info.cacheControl = { + setCacheHint: (dynamicHint) => { + fieldPolicy.replace(dynamicHint); + }, + cacheHint: fieldPolicy, + cacheHintFromType: memoizedCacheAnnotationFromType, + }; + return () => { + if (fieldPolicy.maxAge === undefined && + (((0, graphql_1.isCompositeType)(targetType) && !inheritMaxAge) || + !info.path.prev)) { + fieldPolicy.restrict({ maxAge: defaultMaxAge }); + } + if (__testing__cacheHints && isRestricted(fieldPolicy)) { + const path = (0, graphql_1.responsePathAsArray)(info.path).join('.'); + if (__testing__cacheHints.has(path)) { + throw Error("shouldn't happen: addHint should only be called once per path"); + } + __testing__cacheHints.set(path, { + maxAge: fieldPolicy.maxAge, + scope: fieldPolicy.scope, + }); + } + requestContext.overallCachePolicy.restrict(fieldPolicy); + }; + }, + }; + }, + async willSendResponse(requestContext) { + if (!calculateHttpHeaders) { + return; + } + const { response, overallCachePolicy } = requestContext; + const existingCacheControlHeader = parseExistingCacheControlHeader(response.http.headers.get('cache-control')); + if (existingCacheControlHeader.kind === 'unparsable') { + return; + } + const cachePolicy = (0, cachePolicy_js_1.newCachePolicy)(); + cachePolicy.replace(overallCachePolicy); + if (existingCacheControlHeader.kind === 'parsable-and-cacheable') { + cachePolicy.restrict(existingCacheControlHeader.hint); + } + const policyIfCacheable = cachePolicy.policyIfCacheable(); + if (policyIfCacheable && + existingCacheControlHeader.kind !== 'uncacheable' && + response.body.kind === 'single' && + !response.body.singleResult.errors) { + response.http.headers.set('cache-control', `max-age=${policyIfCacheable.maxAge}, ${policyIfCacheable.scope.toLowerCase()}`); + } + else if (calculateHttpHeaders !== 'if-cacheable') { + response.http.headers.set('cache-control', CACHE_CONTROL_HEADER_UNCACHEABLE); + } + }, + }; + }, + }); +} +const CACHE_CONTROL_HEADER_CACHEABLE_REGEXP = /^max-age=(\d+), (public|private)$/; +const CACHE_CONTROL_HEADER_UNCACHEABLE = 'no-store'; +function parseExistingCacheControlHeader(header) { + if (!header) { + return { kind: 'no-header' }; + } + if (header === CACHE_CONTROL_HEADER_UNCACHEABLE) { + return { kind: 'uncacheable' }; + } + const match = CACHE_CONTROL_HEADER_CACHEABLE_REGEXP.exec(header); + if (!match) { + return { kind: 'unparsable' }; + } + return { + kind: 'parsable-and-cacheable', + hint: { + maxAge: +match[1], + scope: match[2] === 'public' ? 'PUBLIC' : 'PRIVATE', + }, + }; +} +function cacheAnnotationFromDirectives(directives) { + if (!directives) + return undefined; + const cacheControlDirective = directives.find((directive) => directive.name.value === 'cacheControl'); + if (!cacheControlDirective) + return undefined; + if (!cacheControlDirective.arguments) + return undefined; + const maxAgeArgument = cacheControlDirective.arguments.find((argument) => argument.name.value === 'maxAge'); + const scopeArgument = cacheControlDirective.arguments.find((argument) => argument.name.value === 'scope'); + const inheritMaxAgeArgument = cacheControlDirective.arguments.find((argument) => argument.name.value === 'inheritMaxAge'); + const scopeString = scopeArgument?.value?.kind === 'EnumValue' + ? scopeArgument.value.value + : undefined; + const scope = scopeString === 'PUBLIC' || scopeString === 'PRIVATE' + ? scopeString + : undefined; + if (inheritMaxAgeArgument?.value?.kind === 'BooleanValue' && + inheritMaxAgeArgument.value.value) { + return { inheritMaxAge: true, scope }; + } + return { + maxAge: maxAgeArgument?.value?.kind === 'IntValue' + ? parseInt(maxAgeArgument.value.value) + : undefined, + scope, + }; +} +function cacheAnnotationFromType(t) { + if (t.astNode) { + const hint = cacheAnnotationFromDirectives(t.astNode.directives); + if (hint) { + return hint; + } + } + if (t.extensionASTNodes) { + for (const node of t.extensionASTNodes) { + const hint = cacheAnnotationFromDirectives(node.directives); + if (hint) { + return hint; + } + } + } + return {}; +} +function cacheAnnotationFromField(field) { + if (field.astNode) { + const hint = cacheAnnotationFromDirectives(field.astNode.directives); + if (hint) { + return hint; + } + } + return {}; +} +function isRestricted(hint) { + return hint.maxAge !== undefined || hint.scope !== undefined; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js.map new file mode 100644 index 00000000..44c7c330 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/cacheControl/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/cacheControl/index.ts"],"names":[],"mappings":";;AAsDA,wEA2RC;AAhVD,qCASiB;AACjB,yDAAsD;AACtD,+DAAyD;AACzD,yCAAqC;AAyCrC,SAAgB,8BAA8B,CAC5C,UAAiD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAEpE,IAAI,mBAAoE,CAAC;IAEzE,IAAI,oBAGH,CAAC;IAEF,OAAO,IAAA,kCAAc,EAAC;QACpB,sBAAsB,EAAE,cAAc;QACtC,sBAAsB,EAAE,KAAK;QAE7B,KAAK,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE;YAS9B,mBAAmB,GAAG,IAAI,oBAAQ,CAChC;gBACE,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,yBAA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UAAU,CAAC,CAAC;QACjE,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;YACvC,MAAM,IAAI,GAAG,6BAA6B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5D,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,wBAAwB,CAC/B,KAAqC;IAErC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,GAAG,6BAA6B,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACrE,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,YAAY,CAAC,IAAe;IACnC,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts new file mode 100644 index 00000000..d525873f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts @@ -0,0 +1,3 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export declare function ApolloServerPluginDisableSuggestions(): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts.map new file mode 100644 index 00000000..4273eaba --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/disableSuggestions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,wBAAgB,oCAAoC,IAAI,kBAAkB,CAmBzE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js new file mode 100644 index 00000000..4c1d74c7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginDisableSuggestions = ApolloServerPluginDisableSuggestions; +const internalPlugin_js_1 = require("../../internalPlugin.js"); +function ApolloServerPluginDisableSuggestions() { + return (0, internalPlugin_js_1.internalPlugin)({ + __internal_plugin_id__: 'DisableSuggestions', + __is_disabled_plugin__: false, + async requestDidStart() { + return { + async validationDidStart() { + return async (validationErrors) => { + validationErrors?.forEach((error) => { + error.message = error.message.replace(/ ?Did you mean(.+?)\?$/, ''); + }); + }; + }, + }; + }, + }); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js.map new file mode 100644 index 00000000..ad20fa17 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disableSuggestions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/disableSuggestions/index.ts"],"names":[],"mappings":";;AAGA,oFAmBC;AArBD,+DAAyD;AAEzD,SAAgB,oCAAoC;IAClD,OAAO,IAAA,kCAAc,EAAC;QACpB,sBAAsB,EAAE,oBAAoB;QAC5C,sBAAsB,EAAE,KAAK;QAC7B,KAAK,CAAC,eAAe;YACnB,OAAO;gBACL,KAAK,CAAC,kBAAkB;oBACtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,EAAE;wBAChC,gBAAgB,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;4BAClC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CACnC,wBAAwB,EACxB,EAAE,CACH,CAAC;wBACJ,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts new file mode 100644 index 00000000..4e5f168a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts @@ -0,0 +1,7 @@ +import type { BaseContext, ApolloServerPlugin } from '../../index.js'; +export declare function ApolloServerPluginCacheControlDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginInlineTraceDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginLandingPageDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginSchemaReportingDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginUsageReportingDisabled(): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts.map new file mode 100644 index 00000000..f6ce2f4e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/disabled/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AActE,wBAAgB,sCAAsC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAExF;AAED,wBAAgB,qCAAqC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAEvF;AAED,wBAAgB,qCAAqC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAEvF;AAED,wBAAgB,yCAAyC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAE3F;AAED,wBAAgB,wCAAwC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAE1F"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js new file mode 100644 index 00000000..3ee4ec84 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginCacheControlDisabled = ApolloServerPluginCacheControlDisabled; +exports.ApolloServerPluginInlineTraceDisabled = ApolloServerPluginInlineTraceDisabled; +exports.ApolloServerPluginLandingPageDisabled = ApolloServerPluginLandingPageDisabled; +exports.ApolloServerPluginSchemaReportingDisabled = ApolloServerPluginSchemaReportingDisabled; +exports.ApolloServerPluginUsageReportingDisabled = ApolloServerPluginUsageReportingDisabled; +function disabledPlugin(id) { + const plugin = { + __internal_plugin_id__: id, + __is_disabled_plugin__: true, + }; + return plugin; +} +function ApolloServerPluginCacheControlDisabled() { + return disabledPlugin('CacheControl'); +} +function ApolloServerPluginInlineTraceDisabled() { + return disabledPlugin('InlineTrace'); +} +function ApolloServerPluginLandingPageDisabled() { + return disabledPlugin('LandingPageDisabled'); +} +function ApolloServerPluginSchemaReportingDisabled() { + return disabledPlugin('SchemaReporting'); +} +function ApolloServerPluginUsageReportingDisabled() { + return disabledPlugin('UsageReporting'); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js.map new file mode 100644 index 00000000..fca2ddac --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/disabled/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/disabled/index.ts"],"names":[],"mappings":";;AAsBA,wFAEC;AAED,sFAEC;AAED,sFAEC;AAED,8FAEC;AAED,4FAEC;AA1BD,SAAS,cAAc,CAAC,EAAoB;IAC1C,MAAM,MAAM,GAA4C;QACtD,sBAAsB,EAAE,EAAE;QAC1B,sBAAsB,EAAE,IAAI;KAC7B,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,sCAAsC;IACpD,OAAO,cAAc,CAAC,cAAc,CAAC,CAAC;AACxC,CAAC;AAED,SAAgB,qCAAqC;IACnD,OAAO,cAAc,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC;AAED,SAAgB,qCAAqC;IACnD,OAAO,cAAc,CAAC,qBAAqB,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,yCAAyC;IACvD,OAAO,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,wCAAwC;IACtD,OAAO,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts new file mode 100644 index 00000000..84d3c574 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts @@ -0,0 +1,8 @@ +import type http from 'http'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export interface ApolloServerPluginDrainHttpServerOptions { + httpServer: http.Server; + stopGracePeriodMillis?: number; +} +export declare function ApolloServerPluginDrainHttpServer(options: ApolloServerPluginDrainHttpServerOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts.map new file mode 100644 index 00000000..5cea3bcc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAMvE,MAAM,WAAW,wCAAwC;IAIvD,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;IAKxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AASD,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wCAAwC,GAChD,kBAAkB,CAapB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js new file mode 100644 index 00000000..24306949 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginDrainHttpServer = ApolloServerPluginDrainHttpServer; +const stoppable_js_1 = require("./stoppable.js"); +function ApolloServerPluginDrainHttpServer(options) { + const stopper = new stoppable_js_1.Stopper(options.httpServer); + return { + async serverWillStart() { + return { + async drainServer() { + const stopGracePeriodMillis = options.stopGracePeriodMillis ?? 10_000; + const signal = AbortSignal.timeout(stopGracePeriodMillis); + await stopper.stop(signal); + }, + }; + }, + }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js.map new file mode 100644 index 00000000..0bef5ea2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/index.ts"],"names":[],"mappings":";;AA0BA,8EAeC;AAvCD,iDAAyC;AAwBzC,SAAgB,iCAAiC,CAC/C,OAAiD;IAEjD,MAAM,OAAO,GAAG,IAAI,sBAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAChD,OAAO;QACL,KAAK,CAAC,eAAe;YACnB,OAAO;gBACL,KAAK,CAAC,WAAW;oBACf,MAAM,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,IAAI,MAAM,CAAC;oBACtE,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;oBAC1D,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC7B,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts new file mode 100644 index 00000000..a16c5b87 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts @@ -0,0 +1,10 @@ +import type http from 'http'; +import https from 'https'; +export declare class Stopper { + private server; + private requestCountPerSocket; + private stopped; + constructor(server: http.Server | https.Server); + stop(hardDestroyAbortSignal?: AbortSignal): Promise; +} +//# sourceMappingURL=stoppable.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts.map new file mode 100644 index 00000000..a3f526bf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stoppable.d.ts","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/stoppable.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,qBAAa,OAAO;IAIN,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,qBAAqB,CAA6B;IAC1D,OAAO,CAAC,OAAO,CAAS;gBAEJ,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM;IA+BhD,IAAI,CAAC,sBAAsB,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAyCnE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js new file mode 100644 index 00000000..c52f67bf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js @@ -0,0 +1,54 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Stopper = void 0; +const https_1 = __importDefault(require("https")); +class Stopper { + server; + requestCountPerSocket = new Map(); + stopped = false; + constructor(server) { + this.server = server; + server.on(server instanceof https_1.default.Server ? 'secureConnection' : 'connection', (socket) => { + this.requestCountPerSocket.set(socket, 0); + socket.once('close', () => this.requestCountPerSocket.delete(socket)); + }); + server.on('request', (req, res) => { + this.requestCountPerSocket.set(req.socket, (this.requestCountPerSocket.get(req.socket) ?? 0) + 1); + res.once('finish', () => { + const pending = (this.requestCountPerSocket.get(req.socket) ?? 0) - 1; + this.requestCountPerSocket.set(req.socket, pending); + if (this.stopped && pending === 0) { + req.socket.end(); + } + }); + }); + } + async stop(hardDestroyAbortSignal) { + let gracefully = true; + await new Promise((resolve) => setImmediate(resolve)); + this.stopped = true; + const onAbort = () => { + gracefully = false; + this.requestCountPerSocket.forEach((_, socket) => socket.end()); + setImmediate(() => { + this.requestCountPerSocket.forEach((_, socket) => socket.destroy()); + }); + }; + hardDestroyAbortSignal?.addEventListener('abort', onAbort); + const closePromise = new Promise((resolve) => this.server.close(() => { + hardDestroyAbortSignal?.removeEventListener('abort', onAbort); + resolve(); + })); + this.requestCountPerSocket.forEach((requests, socket) => { + if (requests === 0) + socket.end(); + }); + await closePromise; + return gracefully; + } +} +exports.Stopper = Stopper; +//# sourceMappingURL=stoppable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js.map new file mode 100644 index 00000000..e26a659e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/drainHttpServer/stoppable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stoppable.js","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/stoppable.ts"],"names":[],"mappings":";;;;;;AA6BA,kDAA0B;AAG1B,MAAa,OAAO;IAIE;IAHZ,qBAAqB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAClD,OAAO,GAAG,KAAK,CAAC;IAExB,YAAoB,MAAkC;QAAlC,WAAM,GAAN,MAAM,CAA4B;QAEpD,MAAM,CAAC,EAAE,CACP,MAAM,YAAY,eAAK,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,YAAY,EAClE,CAAC,MAAc,EAAE,EAAE;YACjB,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACxE,CAAC,CACF,CAAC;QAGF,MAAM,CAAC,EAAE,CACP,SAAS,EACT,CAAC,GAAyB,EAAE,GAAwB,EAAE,EAAE;YACtD,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAC5B,GAAG,CAAC,MAAM,EACV,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CACtD,CAAC;YACF,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;gBACtB,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IA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,qBAAqB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YACtD,IAAI,QAAQ,KAAK,CAAC;gBAAE,MAAM,CAAC,GAAG,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;QAGH,MAAM,YAAY,CAAC;QAEnB,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AA5ED,0BA4EC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts new file mode 100644 index 00000000..d07c950b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts @@ -0,0 +1,8 @@ +import type { SendErrorsOptions } from '../usageReporting/index.js'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export interface ApolloServerPluginInlineTraceOptions { + includeErrors?: SendErrorsOptions; + __onlyIfSchemaIsSubgraph?: boolean; +} +export declare function ApolloServerPluginInlineTrace(options?: ApolloServerPluginInlineTraceOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts.map new file mode 100644 index 00000000..8cb31a51 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/inlineTrace/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,WAAW,oCAAoC;IAoBnD,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAWlC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAOD,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,oCAA0D,GAClE,kBAAkB,CA2GpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js new file mode 100644 index 00000000..8446e4bf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginInlineTrace = ApolloServerPluginInlineTrace; +const usage_reporting_protobuf_1 = require("@apollo/usage-reporting-protobuf"); +const traceTreeBuilder_js_1 = require("../traceTreeBuilder.js"); +const internalPlugin_js_1 = require("../../internalPlugin.js"); +const schemaIsSubgraph_js_1 = require("../schemaIsSubgraph.js"); +function ApolloServerPluginInlineTrace(options = Object.create(null)) { + let enabled = options.__onlyIfSchemaIsSubgraph ? null : true; + return (0, internalPlugin_js_1.internalPlugin)({ + __internal_plugin_id__: 'InlineTrace', + __is_disabled_plugin__: false, + async serverWillStart({ schema, logger }) { + if (enabled === null) { + enabled = (0, schemaIsSubgraph_js_1.schemaIsSubgraph)(schema); + if (enabled) { + logger.info('Enabling inline tracing for this subgraph. To disable, use ' + + 'ApolloServerPluginInlineTraceDisabled.'); + } + } + }, + async requestDidStart({ request: { http }, metrics }) { + if (!enabled) { + return; + } + const treeBuilder = new traceTreeBuilder_js_1.TraceTreeBuilder({ + maskedBy: 'ApolloServerPluginInlineTrace', + sendErrors: options.includeErrors, + }); + if (http?.headers.get('apollo-federation-include-trace') !== 'ftv1') { + return; + } + if (metrics.captureTraces === false) { + return; + } + metrics.captureTraces = true; + treeBuilder.startTiming(); + return { + async executionDidStart() { + return { + willResolveField({ info }) { + return treeBuilder.willResolveField(info); + }, + }; + }, + async didEncounterErrors({ errors }) { + treeBuilder.didEncounterErrors(errors); + }, + async willSendResponse({ response }) { + treeBuilder.stopTiming(); + if (response.body.kind === 'incremental') { + return; + } + if (metrics.queryPlanTrace) { + treeBuilder.trace.queryPlan = metrics.queryPlanTrace; + } + const encodedUint8Array = usage_reporting_protobuf_1.Trace.encode(treeBuilder.trace).finish(); + const encodedBuffer = Buffer.from(encodedUint8Array, encodedUint8Array.byteOffset, encodedUint8Array.byteLength); + const extensions = response.body.singleResult.extensions || + (response.body.singleResult.extensions = Object.create(null)); + if (typeof extensions.ftv1 !== 'undefined') { + throw new Error('The `ftv1` extension was already present.'); + } + extensions.ftv1 = encodedBuffer.toString('base64'); + }, + }; + }, + }); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js.map new file mode 100644 index 00000000..bb2506a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/inlineTrace/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/inlineTrace/index.ts"],"names":[],"mappings":";;AA8CA,sEA6GC;AA3JD,+EAAyD;AACzD,gEAA0D;AAE1D,+DAAyD;AACzD,gEAA0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/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts new file mode 100644 index 00000000..6da72f36 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts @@ -0,0 +1,4 @@ +import type { ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions, ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions } from './types'; +export declare const getEmbeddedExplorerHTML: (explorerCdnVersion: string, config: ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions, apolloServerVersion: string, nonce: string) => string; +export declare const getEmbeddedSandboxHTML: (sandboxCdnVersion: string, config: ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions, apolloServerVersion: string, nonce: string) => string; +//# sourceMappingURL=getEmbeddedHTML.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts.map new file mode 100644 index 00000000..51fd3b18 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getEmbeddedHTML.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/getEmbeddedHTML.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wDAAwD,EACxD,6DAA6D,EAC9D,MAAM,SAAS,CAAC;AAmBjB,eAAO,MAAM,uBAAuB,GAClC,oBAAoB,MAAM,EAC1B,QAAQ,6DAA6D,EACrE,qBAAqB,MAAM,EAC3B,OAAO,MAAM,WAsGd,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,mBAAmB,MAAM,EACzB,QAAQ,wDAAwD,EAChE,qBAAqB,MAAM,EAC3B,OAAO,MAAM,WAqEd,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js new file mode 100644 index 00000000..cfbcf1f1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js @@ -0,0 +1,143 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEmbeddedSandboxHTML = exports.getEmbeddedExplorerHTML = void 0; +function getConfigStringForHtml(config) { + return JSON.stringify(config) + .replace('<', '\\u003c') + .replace('>', '\\u003e') + .replace('&', '\\u0026') + .replace("'", '\\u0027'); +} +const getEmbeddedExplorerHTML = (explorerCdnVersion, config, apolloServerVersion, nonce) => { + const productionLandingPageEmbedConfigOrDefault = { + displayOptions: {}, + persistExplorerState: false, + runTelemetry: true, + ...(typeof config.embed === 'boolean' ? {} : config.embed), + }; + const embeddedExplorerParams = { + graphRef: config.graphRef, + target: '#embeddableExplorer', + initialState: { + ...('document' in config || 'headers' in config || 'variables' in config + ? { + document: config.document, + headers: config.headers, + variables: config.variables, + } + : {}), + ...('collectionId' in config + ? { + collectionId: config.collectionId, + operationId: config.operationId, + } + : {}), + displayOptions: { + ...productionLandingPageEmbedConfigOrDefault.displayOptions, + }, + }, + persistExplorerState: productionLandingPageEmbedConfigOrDefault.persistExplorerState, + includeCookies: config.includeCookies, + runtime: apolloServerVersion, + runTelemetry: productionLandingPageEmbedConfigOrDefault.runTelemetry, + allowDynamicStyles: false, + }; + return ` +
+

Welcome to Apollo Server

+

Apollo Explorer cannot be loaded; it appears that you might be offline.

+
+ +
+ + +`; +}; +exports.getEmbeddedExplorerHTML = getEmbeddedExplorerHTML; +const getEmbeddedSandboxHTML = (sandboxCdnVersion, config, apolloServerVersion, nonce) => { + const localDevelopmentEmbedConfigOrDefault = { + runTelemetry: true, + endpointIsEditable: false, + initialState: {}, + ...(typeof config.embed === 'boolean' ? {} : (config.embed ?? {})), + }; + const embeddedSandboxConfig = { + target: '#embeddableSandbox', + initialState: { + ...('document' in config || 'headers' in config || 'variables' in config + ? { + document: config.document, + variables: config.variables, + headers: config.headers, + } + : {}), + ...('collectionId' in config + ? { + collectionId: config.collectionId, + operationId: config.operationId, + } + : {}), + includeCookies: config.includeCookies, + ...localDevelopmentEmbedConfigOrDefault.initialState, + }, + hideCookieToggle: false, + endpointIsEditable: localDevelopmentEmbedConfigOrDefault.endpointIsEditable, + runtime: apolloServerVersion, + runTelemetry: localDevelopmentEmbedConfigOrDefault.runTelemetry, + allowDynamicStyles: false, + }; + return ` +
+

Welcome to Apollo Server

+

Apollo Sandbox cannot be loaded; it appears that you might be offline.

+
+ +
+ + +`; +}; +exports.getEmbeddedSandboxHTML = getEmbeddedSandboxHTML; +//# sourceMappingURL=getEmbeddedHTML.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js.map new file mode 100644 index 00000000..fecebcb7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getE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AM,CAAC,YAAY;oBACjC,WAAW,EAAE,MAAM,CAAC,WAAW;iBAChC;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,GAAG,oCAAoC,CAAC,YAAY;SACrD;QACD,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,oCAAoC,CAAC,kBAAkB;QAC3E,OAAO,EAAE,mBAAmB;QAC5B,YAAY,EAAE,oCAAoC,CAAC,YAAY;QAC/D,kBAAkB,EAAE,KAAK;KAC1B,CAAC;IACF,OAAO;;;;;eAKM,KAAK;;;;;;;;;;;;;;;iBAeH,KAAK,2DAA2D,kBAAkB,CAC/F,iBAAiB,CAClB,qDAAqD,kBAAkB,CACtE,mBAAmB,CACpB;iBACc,KAAK;;gCAEU,sBAAsB,CAAC,qBAAqB,CAAC;;;;;;;;CAQ5E,CAAC;AACF,CAAC,CAAC;AAzEW,QAAA,sBAAsB,0BAyEjC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts new file mode 100644 index 00000000..b1af9bd0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts @@ -0,0 +1,9 @@ +import type { ApolloServerPlugin } from '../../../externalTypes/index.js'; +import type { ApolloServerPluginLandingPageLocalDefaultOptions, ApolloServerPluginLandingPageProductionDefaultOptions } from './types.js'; +export type { ApolloServerPluginLandingPageLocalDefaultOptions, ApolloServerPluginLandingPageProductionDefaultOptions, }; +export declare function ApolloServerPluginLandingPageLocalDefault(options?: ApolloServerPluginLandingPageLocalDefaultOptions): ApolloServerPlugin; +export declare function ApolloServerPluginLandingPageProductionDefault(options?: ApolloServerPluginLandingPageProductionDefaultOptions): ApolloServerPlugin; +export declare const DEFAULT_EMBEDDED_EXPLORER_VERSION = "v3"; +export declare const DEFAULT_EMBEDDED_SANDBOX_VERSION = "v2"; +export declare const DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION = "_latest"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts.map new file mode 100644 index 00000000..3f6e6dfd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EACV,gDAAgD,EAChD,qDAAqD,EAEtD,MAAM,YAAY,CAAC;AAQpB,YAAY,EACV,gDAAgD,EAChD,qDAAqD,GACtD,CAAC;AAEF,wBAAgB,yCAAyC,CACvD,OAAO,GAAE,gDAAqD,GAC7D,kBAAkB,CAWpB;AAED,wBAAgB,8CAA8C,CAC5D,OAAO,GAAE,qDAA0D,GAClE,kBAAkB,CAOpB;AAiCD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,gCAAgC,OAAO,CAAC;AACrD,eAAO,MAAM,0CAA0C,YAAY,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js new file mode 100644 index 00000000..18af9b7c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION = exports.DEFAULT_EMBEDDED_SANDBOX_VERSION = exports.DEFAULT_EMBEDDED_EXPLORER_VERSION = void 0; +exports.ApolloServerPluginLandingPageLocalDefault = ApolloServerPluginLandingPageLocalDefault; +exports.ApolloServerPluginLandingPageProductionDefault = ApolloServerPluginLandingPageProductionDefault; +const getEmbeddedHTML_js_1 = require("./getEmbeddedHTML.js"); +const packageVersion_js_1 = require("../../../generated/packageVersion.js"); +const utils_createhash_1 = require("@apollo/utils.createhash"); +function ApolloServerPluginLandingPageLocalDefault(options = {}) { + const { version, __internal_apolloStudioEnv__, ...rest } = { + embed: true, + ...options, + }; + return ApolloServerPluginLandingPageDefault(version, { + isProd: false, + apolloStudioEnv: __internal_apolloStudioEnv__, + ...rest, + }); +} +function ApolloServerPluginLandingPageProductionDefault(options = {}) { + const { version, __internal_apolloStudioEnv__, ...rest } = options; + return ApolloServerPluginLandingPageDefault(version, { + isProd: true, + apolloStudioEnv: __internal_apolloStudioEnv__, + ...rest, + }); +} +function encodeConfig(config) { + return JSON.stringify(encodeURIComponent(JSON.stringify(config))); +} +const getNonEmbeddedLandingPageHTML = (cdnVersion, config, apolloServerVersion, nonce) => { + const encodedConfig = encodeConfig(config); + return ` +
+

Welcome to Apollo Server

+

The full landing page cannot be loaded; it appears that you might be offline.

+
+ +`; +}; +exports.DEFAULT_EMBEDDED_EXPLORER_VERSION = 'v3'; +exports.DEFAULT_EMBEDDED_SANDBOX_VERSION = 'v2'; +exports.DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION = '_latest'; +function ApolloServerPluginLandingPageDefault(maybeVersion, config) { + const explorerVersion = maybeVersion ?? exports.DEFAULT_EMBEDDED_EXPLORER_VERSION; + const sandboxVersion = maybeVersion ?? exports.DEFAULT_EMBEDDED_SANDBOX_VERSION; + const apolloServerLandingPageVersion = maybeVersion ?? exports.DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION; + const apolloServerVersion = `@apollo/server@${packageVersion_js_1.packageVersion}`; + const scriptSafeList = [ + 'https://apollo-server-landing-page.cdn.apollographql.com', + 'https://embeddable-sandbox.cdn.apollographql.com', + 'https://embeddable-explorer.cdn.apollographql.com', + ].join(' '); + const styleSafeList = [ + 'https://apollo-server-landing-page.cdn.apollographql.com', + 'https://embeddable-sandbox.cdn.apollographql.com', + 'https://embeddable-explorer.cdn.apollographql.com', + 'https://fonts.googleapis.com', + ].join(' '); + const iframeSafeList = [ + 'https://explorer.embed.apollographql.com', + 'https://sandbox.embed.apollographql.com', + 'https://embed.apollo.local:3000', + ].join(' '); + return { + __internal_installed_implicitly__: false, + async serverWillStart() { + return { + async renderLandingPage() { + const encodedASLandingPageVersion = encodeURIComponent(apolloServerLandingPageVersion); + async function html() { + const nonce = (0, utils_createhash_1.createHash)('sha256') + .update(crypto.randomUUID()) + .digest('hex'); + const scriptCsp = `script-src 'self' 'nonce-${nonce}' ${scriptSafeList}`; + const styleCsp = `style-src 'nonce-${nonce}' ${styleSafeList}`; + const imageCsp = `img-src https://apollo-server-landing-page.cdn.apollographql.com`; + const manifestCsp = `manifest-src https://apollo-server-landing-page.cdn.apollographql.com`; + const frameCsp = `frame-src ${iframeSafeList}`; + return ` + + + + + + + + + + + + + + Apollo Server + + + +
+ + ${config.embed + ? 'graphRef' in config && config.graphRef + ? (0, getEmbeddedHTML_js_1.getEmbeddedExplorerHTML)(explorerVersion, config, apolloServerVersion, nonce) + : !('graphRef' in config) + ? (0, getEmbeddedHTML_js_1.getEmbeddedSandboxHTML)(sandboxVersion, config, apolloServerVersion, nonce) + : getNonEmbeddedLandingPageHTML(apolloServerLandingPageVersion, config, apolloServerVersion, nonce) + : getNonEmbeddedLandingPageHTML(apolloServerLandingPageVersion, config, apolloServerVersion, nonce)} +
+ + + `; + } + return { html }; + }, + }; + }, + }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js.map new file mode 100644 index 00000000..08e8d5d1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/index.ts"],"names":[],"mappings":";;;AAsBA,8FAaC;AAED,wGASC;AApCD,6DAG8B;AAC9B,4EAAsE;AACtE,+DAAsD;AAOtD,SAAgB,yCAAyC,CACvD,UAA4D,EAAE;IAE9D,MAAM,EAAE,OAAO,EAAE,4BAA4B,EAAE,GAAG,IAAI,EAAE,GAAG;QAEzD,KAAK,EAAE,IAAa;QACpB,GAAG,OAAO;KACX,CAAC;IACF,OAAO,oCAAoC,CAAC,OAAO,EAAE;QACnD,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,4BAA4B;QAC7C,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,8CAA8C,CAC5D,UAAiE,EAAE;IAEnE,MAAM,EAAE,OAAO,EAAE,4BAA4B,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACnE,OAAO,oCAAoC,CAAC,OAAO,EAAE;QACnD,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,4BAA4B;QAC7C,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC;AAUD,SAAS,YAAY,CAAC,MAAyB;IAC7C,O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BAClB,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts new file mode 100644 index 00000000..361fcc37 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts @@ -0,0 +1,56 @@ +type InitialDocumentVariablesHeaders = { + document?: string; + variables?: Record; + headers?: Record; + collectionId?: never; + operationId?: never; +}; +type InitialStateForEmbeds = { + collectionId: string; + operationId: string; + document?: never; + variables?: never; + headers?: never; +} | InitialDocumentVariablesHeaders; +export type ApolloServerPluginLandingPageDefaultBaseOptions = { + version?: string; + footer?: boolean; + includeCookies?: boolean; + __internal_apolloStudioEnv__?: 'staging' | 'prod'; +}; +export type ApolloServerPluginNonEmbeddedLandingPageLocalDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & InitialDocumentVariablesHeaders & { + embed: false; +}; +export type ApolloServerPluginNonEmbeddedLandingPageProductionDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & InitialDocumentVariablesHeaders & { + graphRef?: string; + embed?: false; +}; +export type ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & { + embed?: true | EmbeddableSandboxOptions; +} & (InitialDocumentVariablesHeaders | InitialStateForEmbeds); +export type ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & { + graphRef: string; + embed: true | EmbeddableExplorerOptions; +} & InitialStateForEmbeds; +type EmbeddableSandboxOptions = { + runTelemetry?: boolean; + initialState?: { + pollForSchemaUpdates?: boolean; + sharedHeaders?: Record; + }; + endpointIsEditable?: boolean; +}; +type EmbeddableExplorerOptions = { + runTelemetry?: boolean; + displayOptions?: { + showHeadersAndEnvVars: boolean; + docsPanelState: 'open' | 'closed'; + theme: 'light' | 'dark'; + }; + persistExplorerState?: boolean; +}; +export type ApolloServerPluginLandingPageLocalDefaultOptions = ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions | ApolloServerPluginNonEmbeddedLandingPageLocalDefaultOptions; +export type ApolloServerPluginLandingPageProductionDefaultOptions = ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions | ApolloServerPluginNonEmbeddedLandingPageProductionDefaultOptions; +export type LandingPageConfig = ApolloServerPluginLandingPageLocalDefaultOptions | ApolloServerPluginLandingPageProductionDefaultOptions; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts.map new file mode 100644 index 00000000..0dfe36f7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/types.ts"],"names":[],"mappings":"AAAA,KAAK,+BAA+B,GAAG;IAKrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAMhC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC;AAEF,KAAK,qBAAqB,GACtB;IAQE,YAAY,EA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G;IAI/B,YAAY,CAAC,EAAE,OAAO,CAAC;IAIvB,cAAc,CAAC,EAAE;QAQf,qBAAqB,EAAE,OAAO,CAAC;QAO/B,cAAc,EAAE,MAAM,GAAG,QAAQ,CAAC;QAMlC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;KACzB,CAAC;IAWF,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gDAAgD,GACxD,wDAAwD,GACxD,2DAA2D,CAAC;AAEhE,MAAM,MAAM,qDAAqD,GAC7D,6DAA6D,GAC7D,gEAAgE,CAAC;AAErE,MAAM,MAAM,iBAAiB,GACzB,gDAAgD,GAChD,qDAAqD,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js.map new file mode 100644 index 00000000..bb64fe28 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/landingPage/default/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts new file mode 100644 index 00000000..74fee368 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts @@ -0,0 +1,3 @@ +import { type GraphQLSchema } from 'graphql'; +export declare function schemaIsSubgraph(schema: GraphQLSchema): boolean; +//# sourceMappingURL=schemaIsSubgraph.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts.map new file mode 100644 index 00000000..b9c8b724 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaIsSubgraph.d.ts","sourceRoot":"","sources":["../../../src/plugin/schemaIsSubgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,SAAS,CAAC;AAiBjB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAkB/D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js new file mode 100644 index 00000000..fc12a519 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.schemaIsSubgraph = schemaIsSubgraph; +const graphql_1 = require("graphql"); +function schemaIsSubgraph(schema) { + const serviceType = schema.getType('_Service'); + if (!(0, graphql_1.isObjectType)(serviceType)) { + return false; + } + const sdlField = serviceType.getFields().sdl; + if (!sdlField) { + return false; + } + let sdlFieldType = sdlField.type; + if ((0, graphql_1.isNonNullType)(sdlFieldType)) { + sdlFieldType = sdlFieldType.ofType; + } + if (!(0, graphql_1.isScalarType)(sdlFieldType)) { + return false; + } + return sdlFieldType.name == 'String'; +} +//# sourceMappingURL=schemaIsSubgraph.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js.map new file mode 100644 index 00000000..0532417f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaIsSubgraph.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaIsSubgraph.js","sourceRoot":"","sources":["../../../src/plugin/schemaIsSubgraph.ts"],"names":[],"mappings":";;AAsBA,4CAkBC;AAxCD,qCAKiB;AAiBjB,SAAgB,gBAAgB,CAAC,MAAqB;IACpD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAA,sBAAY,EAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC;IAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC;IACjC,IAAI,IAAA,uBAAa,EAAC,YAAY,CAAC,EAAE,CAAC;QAChC,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;IACrC,CAAC;IACD,IAAI,CAAC,IAAA,sBAAY,EAAC,YAAY,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,YAAY,CAAC,IAAI,IAAI,QAAQ,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts new file mode 100644 index 00000000..d1d2dd62 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts @@ -0,0 +1,10 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import type { Fetcher } from '@apollo/utils.fetcher'; +export interface ApolloServerPluginSchemaReportingOptions { + initialDelayMaxMs?: number; + overrideReportedSchema?: string; + endpointUrl?: string; + fetcher?: Fetcher; +} +export declare function ApolloServerPluginSchemaReporting({ initialDelayMaxMs, overrideReportedSchema, endpointUrl, fetcher, }?: ApolloServerPluginSchemaReportingOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts.map new file mode 100644 index 00000000..8143d395 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/schemaReporting/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIrD,MAAM,WAAW,wCAAwC;IAavD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAuB3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAKhC,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,iCAAiC,CAC/C,EACE,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,OAAO,GACR,GAAE,wCAA8D,GAChE,kBAAkB,CAkIpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js new file mode 100644 index 00000000..d85d977c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js @@ -0,0 +1,103 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginSchemaReporting = ApolloServerPluginSchemaReporting; +const os_1 = __importDefault(require("os")); +const internalPlugin_js_1 = require("../../internalPlugin.js"); +const graphql_1 = require("graphql"); +const schemaReporter_js_1 = require("./schemaReporter.js"); +const schemaIsSubgraph_js_1 = require("../schemaIsSubgraph.js"); +const packageVersion_js_1 = require("../../generated/packageVersion.js"); +const computeCoreSchemaHash_js_1 = require("../../utils/computeCoreSchemaHash.js"); +function ApolloServerPluginSchemaReporting({ initialDelayMaxMs, overrideReportedSchema, endpointUrl, fetcher, } = Object.create(null)) { + const bootId = crypto.randomUUID(); + return (0, internalPlugin_js_1.internalPlugin)({ + __internal_plugin_id__: 'SchemaReporting', + __is_disabled_plugin__: false, + async serverWillStart({ apollo, schema, logger }) { + const { key, graphRef } = apollo; + if (!key) { + throw Error('To use ApolloServerPluginSchemaReporting, you must provide an Apollo API ' + + 'key, via the APOLLO_KEY environment variable or via `new ApolloServer({apollo: {key})`'); + } + if (!graphRef) { + throw Error('To use ApolloServerPluginSchemaReporting, you must provide your graph ref (eg, ' + + "'my-graph-id@my-graph-variant'). Try setting the APOLLO_GRAPH_REF environment " + + 'variable or passing `new ApolloServer({apollo: {graphRef}})`.'); + } + if (overrideReportedSchema) { + try { + const validationErrors = (0, graphql_1.validateSchema)((0, graphql_1.buildSchema)(overrideReportedSchema, { noLocation: true })); + if (validationErrors.length) { + throw new Error(validationErrors.map((error) => error.message).join('\n')); + } + } + catch (err) { + throw new Error('The schema provided to overrideReportedSchema failed to parse or ' + + `validate: ${err.message}`); + } + } + if ((0, schemaIsSubgraph_js_1.schemaIsSubgraph)(schema)) { + throw Error([ + 'Schema reporting is not yet compatible with Apollo Federation subgraphs.', + "If you're interested in using schema reporting with subgraphs,", + 'please contact Apollo support. To set up managed federation, see', + 'https://go.apollo.dev/s/managed-federation', + ].join(' ')); + } + if (endpointUrl !== undefined) { + logger.info(`Apollo schema reporting: schema reporting URL override: ${endpointUrl}`); + } + const baseSchemaReport = { + bootId, + graphRef, + platform: process.env.APOLLO_SERVER_PLATFORM || 'local', + runtimeVersion: `node ${process.version}`, + userVersion: process.env.APOLLO_SERVER_USER_VERSION, + serverId: process.env.APOLLO_SERVER_ID || process.env.HOSTNAME || os_1.default.hostname(), + libraryVersion: `@apollo/server@${packageVersion_js_1.packageVersion}`, + }; + let currentSchemaReporter; + return { + schemaDidLoadOrUpdate({ apiSchema, coreSupergraphSdl }) { + if (overrideReportedSchema !== undefined) { + if (currentSchemaReporter) { + return; + } + else { + logger.info('Apollo schema reporting: schema to report has been overridden'); + } + } + const coreSchema = overrideReportedSchema ?? + coreSupergraphSdl ?? + (0, graphql_1.printSchema)(apiSchema); + const coreSchemaHash = (0, computeCoreSchemaHash_js_1.computeCoreSchemaHash)(coreSchema); + const schemaReport = { + ...baseSchemaReport, + coreSchemaHash, + }; + currentSchemaReporter?.stop(); + currentSchemaReporter = new schemaReporter_js_1.SchemaReporter({ + schemaReport, + coreSchema, + apiKey: key, + endpointUrl, + logger, + initialReportingDelayInMs: Math.floor(Math.random() * (initialDelayMaxMs ?? 10_000)), + fallbackReportingDelayInMs: 20_000, + fetcher, + }); + currentSchemaReporter.start(); + logger.info('Apollo schema reporting: reporting a new schema to Studio! See your graph at ' + + `https://studio.apollographql.com/graph/${encodeURI(graphRef)}/ with server info ${JSON.stringify(schemaReport)}`); + }, + async serverWillStop() { + currentSchemaReporter?.stop(); + }, + }; + }, + }); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js.map new file mode 100644 index 00000000..bf813027 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/schemaReporting/index.ts"],"names":[],"mappings":";;;;;AA2DA,8EAyIC;AApMD,4CAAoB;AACpB,+DAAyD;A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;wBACnB,cAAc;qBACf,CAAC;oBAEF,qBAAqB,EAAE,IAAI,EAAE,CAAC;oBAC9B,qBAAqB,GAAG,IAAI,kCAAc,CAAC;wBACzC,YAAY;wBACZ,UAAU;wBACV,MAAM,EAAE,GAAG;wBACX,WAAW;wBACX,MAAM;wBAEN,yBAAyB,EAAE,IAAI,CAAC,KAAK,CACnC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,iBAAiB,IAAI,MAAM,CAAC,CAC9C;wBACD,0BAA0B,EAAE,MAAM;wBAClC,OAAO;qBACR,CAAC,CAAC;oBACH,qBAAqB,CAAC,KAAK,EAAE,CAAC;oBAE9B,MAAM,CAAC,IAAI,CACT,+EAA+E;wBAC7E,0CAA0C,SAAS,CACjD,QAAQ,CACT,sBAAsB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CACxD,CAAC;gBACJ,CAAC;gBACD,KAAK,CAAC,cAAc;oBAClB,qBAAqB,EAAE,IAAI,EAAE,CAAC;gBAChC,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts new file mode 100644 index 00000000..d495772e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts @@ -0,0 +1,33 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { SchemaReport, ReportSchemaResponse } from './generated/operations'; +import type { Fetcher } from '@apollo/utils.fetcher'; +export declare const schemaReportGql = "#graphql\n mutation SchemaReport($report: SchemaReport!, $coreSchema: String) {\n reportSchema(report: $report, coreSchema: $coreSchema) {\n __typename\n ... on ReportSchemaError {\n message\n code\n }\n ... on ReportSchemaResponse {\n inSeconds\n withCoreSchema\n }\n }\n }\n"; +export declare class SchemaReporter { + private readonly schemaReport; + private readonly coreSchema; + private readonly endpointUrl; + private readonly logger; + private readonly initialReportingDelayInMs; + private readonly fallbackReportingDelayInMs; + private readonly fetcher; + private isStopped; + private pollTimer?; + private readonly headers; + constructor(options: { + schemaReport: SchemaReport; + coreSchema: string; + apiKey: string; + endpointUrl: string | undefined; + logger: Logger; + initialReportingDelayInMs: number; + fallbackReportingDelayInMs: number; + fetcher?: Fetcher; + }); + stopped(): boolean; + start(): void; + stop(): void; + private sendOneReportAndScheduleNext; + reportSchema(withCoreSchema: boolean): Promise; + private apolloQuery; +} +//# sourceMappingURL=schemaReporter.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts.map new file mode 100644 index 00000000..b0e674c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaReporter.d.ts","sourceRoot":"","sources":["../../../../src/plugin/schemaReporting/schemaReporter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EACV,YAAY,EAGZ,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAKrD,eAAO,MAAM,eAAe,sVAc3B,CAAC;AAGF,qBAAa,cAAc;IAEzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAS;IACnD,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAS;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAiB;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,OAAO,EAAE;QACnB,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,yBAAyB,EAAE,MAAM,CAAC;QAClC,0BAA0B,EAAE,MAAM,CAAC;QACnC,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;IAqBM,OAAO,IAAI,OAAO;IAIlB,KAAK;IAOL,IAAI;YAQG,4BAA4B;IAiC7B,YAAY,CACvB,cAAc,EAAE,OAAO,GACtB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;YAwCzB,WAAW;CAsC1B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js new file mode 100644 index 00000000..5f192fef --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchemaReporter = exports.schemaReportGql = void 0; +const packageVersion_js_1 = require("../../generated/packageVersion.js"); +exports.schemaReportGql = `#graphql + mutation SchemaReport($report: SchemaReport!, $coreSchema: String) { + reportSchema(report: $report, coreSchema: $coreSchema) { + __typename + ... on ReportSchemaError { + message + code + } + ... on ReportSchemaResponse { + inSeconds + withCoreSchema + } + } + } +`; +class SchemaReporter { + schemaReport; + coreSchema; + endpointUrl; + logger; + initialReportingDelayInMs; + fallbackReportingDelayInMs; + fetcher; + isStopped; + pollTimer; + headers; + constructor(options) { + this.headers = { + 'Content-Type': 'application/json', + 'x-api-key': options.apiKey, + 'apollographql-client-name': 'ApolloServerPluginSchemaReporting', + 'apollographql-client-version': packageVersion_js_1.packageVersion, + }; + this.endpointUrl = + options.endpointUrl || + 'https://schema-reporting.api.apollographql.com/api/graphql'; + this.schemaReport = options.schemaReport; + this.coreSchema = options.coreSchema; + this.isStopped = false; + this.logger = options.logger; + this.initialReportingDelayInMs = options.initialReportingDelayInMs; + this.fallbackReportingDelayInMs = options.fallbackReportingDelayInMs; + this.fetcher = options.fetcher ?? fetch; + } + stopped() { + return this.isStopped; + } + start() { + this.pollTimer = setTimeout(() => this.sendOneReportAndScheduleNext(false), this.initialReportingDelayInMs); + } + stop() { + this.isStopped = true; + if (this.pollTimer) { + clearTimeout(this.pollTimer); + this.pollTimer = undefined; + } + } + async sendOneReportAndScheduleNext(sendNextWithCoreSchema) { + this.pollTimer = undefined; + if (this.stopped()) + return; + try { + const result = await this.reportSchema(sendNextWithCoreSchema); + if (!result) { + return; + } + if (!this.stopped()) { + this.pollTimer = setTimeout(() => this.sendOneReportAndScheduleNext(result.withCoreSchema), result.inSeconds * 1000); + } + return; + } + catch (error) { + this.logger.error(`Error reporting server info to Apollo during schema reporting: ${error}`); + if (!this.stopped()) { + this.pollTimer = setTimeout(() => this.sendOneReportAndScheduleNext(false), this.fallbackReportingDelayInMs); + } + } + } + async reportSchema(withCoreSchema) { + const { data, errors } = await this.apolloQuery({ + report: this.schemaReport, + coreSchema: withCoreSchema ? this.coreSchema : null, + }); + if (errors) { + throw new Error(errors.map((x) => x.message).join('\n')); + } + function msgForUnexpectedResponse(data) { + return [ + 'Unexpected response shape from Apollo when', + 'reporting schema. If this continues, please reach', + 'out to support@apollographql.com.', + 'Received response:', + JSON.stringify(data), + ].join(' '); + } + if (!data || !data.reportSchema) { + throw new Error(msgForUnexpectedResponse(data)); + } + if (data.reportSchema.__typename === 'ReportSchemaResponse') { + return data.reportSchema; + } + else if (data.reportSchema.__typename === 'ReportSchemaError') { + this.logger.error([ + 'Received input validation error from Apollo:', + data.reportSchema.message, + 'Stopping reporting. Please fix the input errors.', + ].join(' ')); + this.stop(); + return null; + } + throw new Error(msgForUnexpectedResponse(data)); + } + async apolloQuery(variables) { + const request = { + query: exports.schemaReportGql, + variables, + }; + const httpResponse = await this.fetcher(this.endpointUrl, { + method: 'POST', + headers: this.headers, + body: JSON.stringify(request), + }); + if (!httpResponse.ok) { + throw new Error([ + `An unexpected HTTP status code (${httpResponse.status}) was`, + 'encountered during schema reporting.', + ].join(' ')); + } + try { + return await httpResponse.json(); + } + catch (error) { + throw new Error([ + "Couldn't report schema to Apollo.", + 'Parsing response as JSON failed.', + 'If this continues please reach out to support@apollographql.com', + error, + ].join(' ')); + } + } +} +exports.SchemaReporter = SchemaReporter; +//# sourceMappingURL=schemaReporter.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js.map new file mode 100644 index 00000000..df5a098b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/schemaReporting/schemaReporter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaReporter.js","sourceRoot":"","sources":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G,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;YACxD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAC9B,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb;gBACE,mCAAmC,YAAY,CAAC,MAAM,OAAO;gBAC7D,sCAAsC;aACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CACZ,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YAGH,OAAO,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb;gBACE,mCAAmC;gBACnC,kCAAkC;gBAClC,iEAAiE;gBACjE,KAAK;aACN,CAAC,IAAI,CAAC,GAAG,CAAC,CACZ,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAhLD,wCAgLC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts new file mode 100644 index 00000000..aabc1602 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts @@ -0,0 +1,12 @@ +import { type Fetcher } from '@apollo/utils.fetcher'; +import type { Logger } from '@apollo/utils.logger'; +import retry from 'async-retry'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export interface ApolloServerPluginSubscriptionCallbackOptions { + maxConsecutiveHeartbeatFailures?: number; + logger?: Logger; + retry?: retry.Options; + fetcher?: Fetcher; +} +export declare function ApolloServerPluginSubscriptionCallback(options?: ApolloServerPluginSubscriptionCallbackOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts.map new file mode 100644 index 00000000..d14f523d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/subscriptionCallback/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,MAAM,aAAa,CAAC;AAIhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,MAAM,WAAW,6CAA6C;IAC5D,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAItB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,sCAAsC,CACpD,OAAO,GAAE,6CAAmE,GAC3E,kBAAkB,CAuLpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js new file mode 100644 index 00000000..87af0ecb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js @@ -0,0 +1,434 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginSubscriptionCallback = ApolloServerPluginSubscriptionCallback; +const async_retry_1 = __importDefault(require("async-retry")); +const graphql_1 = require("graphql"); +const promises_1 = require("node:timers/promises"); +const errorNormalize_js_1 = require("../../errorNormalize.js"); +const HeaderMap_js_1 = require("../../utils/HeaderMap.js"); +function ApolloServerPluginSubscriptionCallback(options = Object.create(null)) { + const subscriptionManager = new SubscriptionManager(options); + const logger = options.logger + ? prefixedLogger(options.logger, 'SubscriptionCallback') + : undefined; + return { + async requestDidStart({ request }) { + const subscriptionExtension = request?.extensions?.subscription; + if (!subscriptionExtension) + return; + let { callbackUrl, subscriptionId: id, verifier, heartbeatIntervalMs, } = subscriptionExtension; + callbackUrl = callbackUrl || subscriptionExtension.callback_url; + id = id || subscriptionExtension.subscription_id; + heartbeatIntervalMs = + heartbeatIntervalMs ?? + subscriptionExtension.heartbeat_interval_ms ?? + 5000; + return { + async responseForOperation() { + logger?.debug('Received new subscription request', id); + return { + http: { + status: 200, + headers: new HeaderMap_js_1.HeaderMap([['content-type', 'application/json']]), + }, + body: { + kind: 'single', + singleResult: { + data: null, + }, + }, + }; + }, + async willSendResponse({ request, schema, document, contextValue, operationName, response, }) { + try { + await subscriptionManager.checkRequest({ + callbackUrl, + id, + verifier, + }); + } + catch (e) { + const graphqlError = (0, errorNormalize_js_1.ensureGraphQLError)(e); + logger?.error(`\`check\` request failed: ${graphqlError.message}`, id); + if (response.body.kind === 'single') { + response.body.singleResult.errors = [graphqlError]; + response.http.status = 500; + } + return; + } + subscriptionManager.initHeartbeat({ + callbackUrl, + id, + verifier, + heartbeatIntervalMs, + }); + logger?.debug(`Starting graphql-js subscription`, id); + let subscription; + try { + subscription = await (0, graphql_1.subscribe)({ + schema, + document: document, + variableValues: request.variables, + contextValue: contextValue, + operationName: operationName, + }); + } + catch (e) { + const graphqlError = (0, errorNormalize_js_1.ensureGraphQLError)(e); + logger?.error(`Programming error: graphql-js subscribe() threw unexpectedly! Please report this bug to Apollo. The error was: ${e}`, id); + subscriptionManager.completeRequest({ + errors: [graphqlError], + callbackUrl, + id, + verifier, + }); + return; + } + if ('errors' in subscription) { + logger?.error(`graphql-js subscription unsuccessful: [\n\t${subscription.errors + ?.map((e) => e.message) + .join(',\n\t')}\n]`, id); + try { + subscriptionManager.completeRequest({ + errors: subscription.errors, + callbackUrl, + id, + verifier, + }); + } + catch (e) { + logger?.error(`\`complete\` request failed: ${e}`, id); + } + } + else if (isAsyncIterable(subscription)) { + logger?.debug('graphql-js subscription successful', id); + subscriptionManager.startConsumingSubscription({ + subscription, + callbackUrl, + id, + verifier, + }); + } + logger?.debug(`Responding to original subscription request`, id); + }, + }; + }, + async serverWillStart() { + return { + async drainServer() { + logger?.debug('Server is shutting down. Cleaning up outstanding subscriptions and heartbeat intervals'); + await subscriptionManager.cleanup(); + await (0, promises_1.setImmediate)(); + logger?.debug('Successfully cleaned up outstanding subscriptions and heartbeat intervals.'); + }, + }; + }, + }; +} +function isAsyncIterable(value) { + return value && typeof value[Symbol.asyncIterator] === 'function'; +} +class SubscriptionManager { + maxConsecutiveHeartbeatFailures; + logger; + retryConfig; + requestsInFlight = new Set(); + subscriptionInfoByCallbackUrl = new Map(); + fetcher; + constructor(options) { + this.maxConsecutiveHeartbeatFailures = + options.maxConsecutiveHeartbeatFailures ?? 5; + this.retryConfig = { + retries: 5, + minTimeout: 100, + maxTimeout: 1000, + ...options.retry, + }; + this.logger = options.logger + ? prefixedLogger(options.logger, 'SubscriptionManager') + : undefined; + this.fetcher = options.fetcher ?? fetch; + } + async retryFetch({ url, action, id, verifier, payload, errors, headers, }) { + let response; + try { + const maybeWithErrors = errors?.length ? ` with errors` : ''; + this.logger?.debug(`Sending \`${action}\` request to router` + maybeWithErrors, id); + return (0, async_retry_1.default)(async (bail) => { + response = this.fetcher(url, { + method: 'POST', + headers: { + 'content-type': 'application/json', + ...headers, + }, + body: JSON.stringify({ + kind: 'subscription', + action, + id, + verifier, + ...(payload && { payload }), + ...(errors?.length && { errors }), + }), + }); + this.requestsInFlight.add(response); + const result = await response; + if (!result.ok) { + if (result.status >= 500) { + throw new Error(`\`${action}\` request failed with unexpected status code: ${result.status}`); + } + else { + if (result.status === 404) { + this.logger?.debug(`\`${action}\` request received 404, terminating subscription`, id); + } + else { + const errMsg = `\`${action}\` request failed with unexpected status code: ${result.status}, terminating subscription`; + this.logger?.debug(errMsg, id); + bail(new Error(errMsg)); + } + this.terminateSubscription(id, url); + return result; + } + } + this.logger?.debug(`\`${action}\` request successful`, id); + return result; + }, { + ...this.retryConfig, + onRetry: (e, attempt) => { + this.requestsInFlight.delete(response); + this.logger?.warn(`Retrying \`${action}\` request (attempt ${attempt}) due to error: ${e.message}`, id); + this.retryConfig?.onRetry?.(e, attempt); + }, + }); + } + finally { + this.requestsInFlight.delete(response); + } + } + async checkRequest({ callbackUrl, id, verifier, }) { + return this.retryFetch({ + url: callbackUrl, + action: 'check', + id, + verifier, + headers: { 'subscription-protocol': 'callback/1.0' }, + }); + } + initHeartbeat({ callbackUrl, id, verifier, heartbeatIntervalMs, }) { + if (!this.subscriptionInfoByCallbackUrl.has(callbackUrl)) { + this.subscriptionInfoByCallbackUrl.set(callbackUrl, {}); + } + if (heartbeatIntervalMs === 0) { + this.logger?.debug(`Heartbeat disabled for ${callbackUrl}`, id); + return; + } + this.logger?.debug(`Starting new heartbeat interval for ${callbackUrl}`, id); + let consecutiveHeartbeatFailureCount = 0; + const heartbeatInterval = setInterval(async () => { + let heartbeatRequest; + let resolveHeartbeatPromise; + const heartbeatPromise = new Promise((r) => { + resolveHeartbeatPromise = r; + }); + const existingSubscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!existingSubscriptionInfo?.heartbeat) { + clearInterval(heartbeatInterval); + this.logger?.error(`Programming error: Heartbeat interval unexpectedly missing for ${callbackUrl}. This is probably a bug in Apollo Server.`); + return; + } + const existingHeartbeat = existingSubscriptionInfo.heartbeat; + const { queue } = existingHeartbeat; + queue.push(heartbeatPromise); + if (queue.length > 1) { + const requestBeforeMe = queue[existingHeartbeat?.queue.length - 2]; + await requestBeforeMe; + } + try { + this.logger?.debug(`Sending \`check\` request to ${callbackUrl} for ID: ${id}`); + heartbeatRequest = this.fetcher(callbackUrl, { + method: 'POST', + body: JSON.stringify({ + kind: 'subscription', + action: 'check', + id, + verifier, + }), + headers: { + 'content-type': 'application/json', + 'subscription-protocol': 'callback/1.0', + }, + }); + this.requestsInFlight.add(heartbeatRequest); + const result = await heartbeatRequest; + this.logger?.debug(`Heartbeat received response for ID: ${id}`); + if (result.ok) { + this.logger?.debug(`Heartbeat request successful, ID: ${id}`); + } + else if (result.status === 400) { + this.logger?.debug(`Heartbeat request received invalid ID: ${id}`); + this.terminateSubscription(id, callbackUrl); + } + else if (result.status === 404) { + this.logger?.debug(`Heartbeat request received invalid ID: ${id}`); + this.terminateSubscription(id, callbackUrl); + } + else { + throw new Error(`Unexpected status code: ${result.status}`); + } + consecutiveHeartbeatFailureCount = 0; + } + catch (e) { + const err = (0, errorNormalize_js_1.ensureError)(e); + this.logger?.error(`Heartbeat request failed (${++consecutiveHeartbeatFailureCount} consecutive): ${err.message}`, existingHeartbeat.id); + if (consecutiveHeartbeatFailureCount >= + this.maxConsecutiveHeartbeatFailures) { + this.logger?.error(`Heartbeat request failed ${consecutiveHeartbeatFailureCount} times, terminating subscriptions and heartbeat interval: ${err.message}`, existingHeartbeat.id); + this.terminateSubscription(id, callbackUrl); + } + return; + } + finally { + if (heartbeatRequest) { + this.requestsInFlight.delete(heartbeatRequest); + } + existingHeartbeat?.queue.shift(); + resolveHeartbeatPromise(); + } + }, heartbeatIntervalMs); + const subscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + subscriptionInfo.heartbeat = { + interval: heartbeatInterval, + id, + verifier, + queue: [], + }; + } + terminateSubscription(id, callbackUrl) { + this.logger?.debug(`Terminating subscriptions for ID: ${id}`); + const subscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!subscriptionInfo) { + this.logger?.error(`No subscriptions found for ${callbackUrl}, skipping termination`); + return; + } + const { subscription, heartbeat } = subscriptionInfo; + if (subscription) { + subscription.cancelled = true; + subscription.asyncIter?.return(); + } + if (heartbeat) { + this.logger?.debug(`Terminating heartbeat interval for ${callbackUrl}`); + clearInterval(heartbeat.interval); + } + this.subscriptionInfoByCallbackUrl.delete(callbackUrl); + } + startConsumingSubscription({ subscription, callbackUrl, id, verifier, }) { + const self = this; + const subscriptionObject = { + asyncIter: subscription, + cancelled: false, + async startConsumingSubscription() { + self.logger?.debug(`Listening to graphql-js subscription`, id); + try { + for await (const payload of subscription) { + if (this.cancelled) { + self.logger?.debug(`Subscription already cancelled, ignoring current and future payloads`, id); + return; + } + try { + await self.retryFetch({ + url: callbackUrl, + action: 'next', + id, + verifier, + payload, + }); + } + catch (e) { + const originalError = (0, errorNormalize_js_1.ensureError)(e); + self.logger?.error(`\`next\` request failed, terminating subscription: ${originalError.message}`, id); + self.terminateSubscription(id, callbackUrl); + } + } + self.logger?.debug(`Subscription completed without errors`, id); + await this.completeSubscription(); + } + catch (e) { + const error = (0, errorNormalize_js_1.ensureGraphQLError)(e); + self.logger?.error(`Generator threw an error, terminating subscription: ${error.message}`, id); + this.completeSubscription([error]); + } + }, + async completeSubscription(errors) { + if (this.cancelled) + return; + this.cancelled = true; + try { + await self.completeRequest({ + callbackUrl, + id, + verifier, + ...(errors && { errors }), + }); + } + catch (e) { + const error = (0, errorNormalize_js_1.ensureError)(e); + self.logger?.error(`\`complete\` request failed: ${error.message}`, id); + } + finally { + self.terminateSubscription(id, callbackUrl); + } + }, + }; + subscriptionObject.startConsumingSubscription(); + const subscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!subscriptionInfo) { + this.logger?.error(`No existing heartbeat found for ${callbackUrl}, skipping subscription`); + } + else { + subscriptionInfo.subscription = subscriptionObject; + } + } + async completeRequest({ errors, callbackUrl, id, verifier, }) { + return this.retryFetch({ + url: callbackUrl, + action: 'complete', + id, + verifier, + errors, + }); + } + collectAllSubscriptions() { + return Array.from(this.subscriptionInfoByCallbackUrl.values()).reduce((subscriptions, { subscription }) => { + if (subscription) { + subscriptions.push(subscription); + } + return subscriptions; + }, []); + } + async cleanup() { + await Promise.allSettled(Array.from(this.subscriptionInfoByCallbackUrl.values()).map(async ({ heartbeat }) => { + clearInterval(heartbeat?.interval); + await heartbeat?.queue[heartbeat.queue.length - 1]; + })); + await Promise.allSettled(this.collectAllSubscriptions() + .filter((s) => !s.cancelled) + .map((s) => s.completeSubscription())); + await Promise.allSettled(this.requestsInFlight.values()); + } +} +function prefixedLogger(logger, prefix) { + function log(level) { + return function (message, id) { + logger[level](`${prefix}${id ? `[${id}]` : ''}: ${message}`); + }; + } + return { + debug: log('debug'), + error: log('error'), + info: log('info'), + warn: log('warn'), + }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js.map new file mode 100644 index 00000000..cc292942 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/subscriptionCallback/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/subscriptionCallback/index.ts"],"names":[],"mappings":";;;;;AAmBA,wFAyLC;AA1MD,8DAAgC;AAChC,qCAA6E;AAC7E,mDAAoD;AACpD,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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;aAC3B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC,CACxC,CAAC;QAEF,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF;AAGD,SAAS,cAAc,CAAC,MAAc,EAAE,MAAc;IACpD,SAAS,GAAG,CAAC,KAAmB;QAC9B,OAAO,UAAU,OAAe,EAAE,EAAW;YAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC,CAAC;QAC/D,CAAC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;QACnB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;QACnB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;KAClB,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts new file mode 100644 index 00000000..817ea63c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts @@ -0,0 +1,25 @@ +import { GraphQLError, type GraphQLResolveInfo } from 'graphql'; +import { Trace, google } from '@apollo/usage-reporting-protobuf'; +import type { SendErrorsOptions } from './usageReporting'; +export declare class TraceTreeBuilder { + private rootNode; + trace: Trace; + startHrTime?: [number, number]; + private stopped; + private nodes; + private readonly transformError; + constructor(options: { + maskedBy: string; + sendErrors?: SendErrorsOptions; + }); + startTiming(): void; + stopTiming(): void; + willResolveField(info: GraphQLResolveInfo): () => void; + didEncounterErrors(errors: readonly GraphQLError[]): void; + private addProtobufError; + private newNode; + private ensureParentNode; + private transformAndNormalizeError; +} +export declare function dateToProtoTimestamp(date: Date): google.protobuf.Timestamp; +//# sourceMappingURL=traceTreeBuilder.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts.map new file mode 100644 index 00000000..b9a3fc5c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"traceTreeBuilder.d.ts","sourceRoot":"","sources":["../../../src/plugin/traceTreeBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EAExB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAO1D,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAoB;IAC7B,KAAK,QAUT;IACI,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAEV;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAEtB;gBAEU,OAAO,EAAE;QAC1B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,iBAAiB,CAAC;KAChC;IAgBM,WAAW;IAWX,UAAU;IAeV,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,IAAI;IAiEtD,kBAAkB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE;IA6BzD,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,0BAA0B;CAkDnC;AAkED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAO1E"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js new file mode 100644 index 00000000..4e7dc0ce --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js @@ -0,0 +1,201 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TraceTreeBuilder = void 0; +exports.dateToProtoTimestamp = dateToProtoTimestamp; +const graphql_1 = require("graphql"); +const usage_reporting_protobuf_1 = require("@apollo/usage-reporting-protobuf"); +const UnreachableCaseError_js_1 = require("../utils/UnreachableCaseError.js"); +function internalError(message) { + return new Error(`[internal apollo-server error] ${message}`); +} +class TraceTreeBuilder { + rootNode = new usage_reporting_protobuf_1.Trace.Node(); + trace = new usage_reporting_protobuf_1.Trace({ + root: this.rootNode, + fieldExecutionWeight: 1, + }); + startHrTime; + stopped = false; + nodes = new Map([ + [responsePathAsString(), this.rootNode], + ]); + transformError; + constructor(options) { + const { sendErrors, maskedBy } = options; + if (!sendErrors || 'masked' in sendErrors) { + this.transformError = () => new graphql_1.GraphQLError('', { + extensions: { maskedBy }, + }); + } + else if ('transform' in sendErrors) { + this.transformError = sendErrors.transform; + } + else if ('unmodified' in sendErrors) { + this.transformError = null; + } + else { + throw new UnreachableCaseError_js_1.UnreachableCaseError(sendErrors); + } + } + startTiming() { + if (this.startHrTime) { + throw internalError('startTiming called twice!'); + } + if (this.stopped) { + throw internalError('startTiming called after stopTiming!'); + } + this.trace.startTime = dateToProtoTimestamp(new Date()); + this.startHrTime = process.hrtime(); + } + stopTiming() { + if (!this.startHrTime) { + throw internalError('stopTiming called before startTiming!'); + } + if (this.stopped) { + throw internalError('stopTiming called twice!'); + } + this.trace.durationNs = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + this.trace.endTime = dateToProtoTimestamp(new Date()); + this.stopped = true; + } + willResolveField(info) { + if (!this.startHrTime) { + throw internalError('willResolveField called before startTiming!'); + } + if (this.stopped) { + return () => { }; + } + const path = info.path; + const node = this.newNode(path); + node.type = info.returnType.toString(); + node.parentType = info.parentType.toString(); + node.startTime = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + if (typeof path.key === 'string' && path.key !== info.fieldName) { + node.originalFieldName = info.fieldName; + } + return () => { + node.endTime = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + }; + } + didEncounterErrors(errors) { + errors.forEach((err) => { + if (err.extensions?.serviceName) { + return; + } + const errorForReporting = this.transformAndNormalizeError(err); + if (errorForReporting === null) { + return; + } + this.addProtobufError(errorForReporting.path, errorToProtobufError(errorForReporting)); + }); + } + addProtobufError(path, error) { + if (!this.startHrTime) { + throw internalError('addProtobufError called before startTiming!'); + } + if (this.stopped) { + throw internalError('addProtobufError called after stopTiming!'); + } + let node = this.rootNode; + if (Array.isArray(path)) { + const specificNode = this.nodes.get(path.join('.')); + if (specificNode) { + node = specificNode; + } + else { + const responsePath = responsePathFromArray(path, this.rootNode); + if (!responsePath) { + throw internalError('addProtobufError called with invalid path!'); + } + node = this.newNode(responsePath); + } + } + node.error.push(error); + } + newNode(path) { + const node = new usage_reporting_protobuf_1.Trace.Node(); + const id = path.key; + if (typeof id === 'number') { + node.index = id; + } + else { + node.responseName = id; + } + this.nodes.set(responsePathAsString(path), node); + const parentNode = this.ensureParentNode(path); + parentNode.child.push(node); + return node; + } + ensureParentNode(path) { + const parentPath = responsePathAsString(path.prev); + const parentNode = this.nodes.get(parentPath); + if (parentNode) { + return parentNode; + } + return this.newNode(path.prev); + } + transformAndNormalizeError(err) { + if (this.transformError) { + const clonedError = Object.assign(Object.create(Object.getPrototypeOf(err)), err); + const rewrittenError = this.transformError(clonedError); + if (rewrittenError === null) { + return null; + } + if (!(rewrittenError instanceof graphql_1.GraphQLError)) { + return err; + } + return new graphql_1.GraphQLError(rewrittenError.message, { + nodes: err.nodes, + source: err.source, + positions: err.positions, + path: err.path, + originalError: err.originalError, + extensions: rewrittenError.extensions || err.extensions, + }); + } + return err; + } +} +exports.TraceTreeBuilder = TraceTreeBuilder; +function durationHrTimeToNanos(hrtime) { + return hrtime[0] * 1e9 + hrtime[1]; +} +function responsePathAsString(p) { + if (p === undefined) { + return ''; + } + let res = String(p.key); + while ((p = p.prev) !== undefined) { + res = `${p.key}.${res}`; + } + return res; +} +function responsePathFromArray(path, node) { + let responsePath; + let nodePtr = node; + for (const key of path) { + nodePtr = nodePtr?.child?.find((child) => child.responseName === key); + responsePath = { + key, + prev: responsePath, + typename: nodePtr?.type ?? undefined, + }; + } + return responsePath; +} +function errorToProtobufError(error) { + return new usage_reporting_protobuf_1.Trace.Error({ + message: error.message, + location: (error.locations || []).map(({ line, column }) => new usage_reporting_protobuf_1.Trace.Location({ line, column })), + json: JSON.stringify(error), + }); +} +function dateToProtoTimestamp(date) { + const totalMillis = +date; + const millis = totalMillis % 1000; + return new usage_reporting_protobuf_1.google.protobuf.Timestamp({ + seconds: (totalMillis - millis) / 1000, + nanos: millis * 1e6, + }); +} +//# sourceMappingURL=traceTreeBuilder.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js.map new file mode 100644 index 00000000..0a7d328b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/traceTreeBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"traceTreeBuilder.js","sourceRoot":"","sources":["../../../src/plugin/traceTreeBuilder.ts"],"names":[],"mappings":";;;AA4VA,oDAOC;AAjWD,qCAIiB;AACjB,+EAAiE;AAEjE,8EAAwE;AAExE,SAAS,aAAa,CAAC,OAAe;IACpC,OAAO,IAAI,KAAK,CAAC,kCAAkC,OAAO,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,MAAa,gBAAgB;IACnB,QAAQ,GAAG,IAAI,gCAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,KAAK,GAAG,IAAI,gCAAK,CAAC;QACvB,IAAI,EAAE,IAAI,CAAC,QAAQ;QAQnB,oBAAoB,EAAE,CAAC;KACxB,CAAC,CAAC;IACI,WAAW,CAAoB;IAC9B,OAAO,GAAG,KAAK,CAAC;IAChB,KAAK,GAAG,IAAI,GAAG,CAAqB;QAC1C,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC;KACxC,CAAC,CAAC;IACc,cAAc,CAEtB;IAET,YAAmB,OAGlB;QACC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QACzC,IAAI,CAAC,UAAU,IAAI,QAAQ,IAAI,UAAU,EAAE,CAAC;YAC1C,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,CACzB,IAAI,sBAAY,CAAC,UAAU,EAAE;gBAC3B,UAAU,EAAE,EAAE,QAAQ,EAAE;aACzB,CAAC,CAAC;QACP,CAAC;aAAM,IAAI,WAAW,IAAI,UAAU,EAAE,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CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CACnC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,gCAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAC3D;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;KAC5B,CAAC,CAAC;AACL,CAAC;AAGD,SAAgB,oBAAoB,CAAC,IAAU;IAC7C,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC;IAC1B,MAAM,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAClC,OAAO,IAAI,iCAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACnC,OAAO,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,GAAG,IAAI;QACtC,KAAK,EAAE,MAAM,GAAG,GAAG;KACpB,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts new file mode 100644 index 00000000..7dd76d66 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts @@ -0,0 +1,3 @@ +import type { Trace } from '@apollo/usage-reporting-protobuf'; +export declare function defaultSendOperationsAsTrace(): (trace: Trace, statsReportKey: string) => boolean; +//# sourceMappingURL=defaultSendOperationsAsTrace.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map new file mode 100644 index 00000000..a2518e3c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"defaultSendOperationsAsTrace.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/defaultSendOperationsAsTrace.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAI9D,wBAAgB,4BAA4B,KA2BlC,OAAO,KAAK,EAAE,gBAAgB,MAAM,KAAG,OAAO,CAyBvD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js new file mode 100644 index 00000000..84cc002b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultSendOperationsAsTrace = defaultSendOperationsAsTrace; +const lru_cache_1 = require("lru-cache"); +const iterateOverTrace_js_1 = require("./iterateOverTrace.js"); +const durationHistogram_js_1 = require("./durationHistogram.js"); +function defaultSendOperationsAsTrace() { + const cache = new lru_cache_1.LRUCache({ + maxSize: Math.pow(2, 20), + sizeCalculation: (_val, key) => { + return (key && Buffer.byteLength(key)) || 0; + }, + }); + return (trace, statsReportKey) => { + const endTimeSeconds = trace.endTime?.seconds; + if (endTimeSeconds == null) { + throw Error('programming error: endTime not set on trace'); + } + const hasErrors = traceHasErrors(trace); + const cacheKey = JSON.stringify([ + statsReportKey, + durationHistogram_js_1.DurationHistogram.durationToBucket(trace.durationNs), + Math.floor(endTimeSeconds / 60), + hasErrors ? Math.floor(endTimeSeconds / 5) : '', + ]); + if (cache.get(cacheKey)) { + return false; + } + cache.set(cacheKey, true); + return true; + }; +} +function traceHasErrors(trace) { + let hasErrors = false; + function traceNodeStats(node) { + if ((node.error?.length ?? 0) > 0) { + hasErrors = true; + } + return hasErrors; + } + (0, iterateOverTrace_js_1.iterateOverTrace)(trace, traceNodeStats, false); + return hasErrors; +} +//# sourceMappingURL=defaultSendOperationsAsTrace.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js.map new file mode 100644 index 00000000..e948d264 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defaultSendOperationsAsTrace.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/defaultSendOperationsAsTrace.ts"],"names":[],"mappings":";;AAKA,oEAoDC;AAzDD,yCAAqC;AAErC,+DAAyD;AACzD,iEAA2D;AAE3D,SAAgB,4BAA4B;IAU1C,MAAM,KAAK,GAAG,IAAI,oBAAQ,CAAe;QAWvC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;QACxB,eAAe,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YAC7B,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,C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1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts new file mode 100644 index 00000000..f4fec59c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts @@ -0,0 +1,16 @@ +export interface DurationHistogramOptions { + initSize?: number; + buckets?: number[]; +} +export declare class DurationHistogram { + private readonly buckets; + static readonly BUCKET_COUNT = 384; + static readonly EXPONENT_LOG: number; + toArray(): number[]; + static durationToBucket(durationNs: number): number; + incrementDuration(durationNs: number, value?: number): DurationHistogram; + incrementBucket(bucket: number, value?: number): void; + combine(otherHistogram: DurationHistogram): void; + constructor(options?: DurationHistogramOptions); +} +//# sourceMappingURL=durationHistogram.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts.map new file mode 100644 index 00000000..2a28b872 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"durationHistogram.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/durationHistogram.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AACD,qBAAa,iBAAiB;IAO5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;IACnC,MAAM,CAAC,QAAQ,CAAC,YAAY,OAAO;IACnC,MAAM,CAAC,QAAQ,CAAC,YAAY,SAAiB;IAE7C,OAAO,IAAI,MAAM,EAAE;IAoBnB,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAYnD,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,iBAAiB;IAKnE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAI;IAgBzC,OAAO,CAAC,cAAc,EAAE,iBAAiB;gBAM7B,OAAO,CAAC,EAAE,wBAAwB;CAY/C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js new file mode 100644 index 00000000..78f9f154 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DurationHistogram = void 0; +class DurationHistogram { + buckets; + static BUCKET_COUNT = 384; + static EXPONENT_LOG = Math.log(1.1); + toArray() { + let bufferedZeroes = 0; + const outputArray = []; + for (const value of this.buckets) { + if (value === 0) { + bufferedZeroes++; + } + else { + if (bufferedZeroes === 1) { + outputArray.push(0); + } + else if (bufferedZeroes !== 0) { + outputArray.push(-bufferedZeroes); + } + outputArray.push(Math.floor(value)); + bufferedZeroes = 0; + } + } + return outputArray; + } + static durationToBucket(durationNs) { + const log = Math.log(durationNs / 1000.0); + const unboundedBucket = Math.ceil(log / DurationHistogram.EXPONENT_LOG); + return unboundedBucket <= 0 || Number.isNaN(unboundedBucket) + ? 0 + : unboundedBucket >= DurationHistogram.BUCKET_COUNT + ? DurationHistogram.BUCKET_COUNT - 1 + : unboundedBucket; + } + incrementDuration(durationNs, value = 1) { + this.incrementBucket(DurationHistogram.durationToBucket(durationNs), value); + return this; + } + incrementBucket(bucket, value = 1) { + if (bucket >= DurationHistogram.BUCKET_COUNT) { + throw Error('Bucket is out of bounds of the buckets array'); + } + if (bucket >= this.buckets.length) { + const oldLength = this.buckets.length; + this.buckets.length = bucket + 1; + this.buckets.fill(0, oldLength); + } + this.buckets[bucket] += value; + } + combine(otherHistogram) { + for (let i = 0; i < otherHistogram.buckets.length; i++) { + this.incrementBucket(i, otherHistogram.buckets[i]); + } + } + constructor(options) { + const initSize = options?.initSize || 74; + const buckets = options?.buckets; + const arrayInitSize = Math.max(buckets?.length || 0, initSize); + this.buckets = Array(arrayInitSize).fill(0); + if (buckets) { + buckets.forEach((val, index) => (this.buckets[index] = val)); + } + } +} +exports.DurationHistogram = DurationHistogram; +//# sourceMappingURL=durationHistogram.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js.map new file mode 100644 index 00000000..f5771ad3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/durationHistogram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"durationHistogram.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/durationHistogram.ts"],"names":[],"mappings":";;;AAIA,MAAa,iBAAiB;IAOX,OAAO,CAAW;IACnC,MAAM,CAAU,YAAY,GAAG,GAAG,CAAC;IACnC,MAAM,CAAU,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE7C,OAAO;QACL,IAAI,cAAc,GAAG,CAAC,CAAC;QAC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,CAAC;QAC/D,CAAC;IACH,CAAC;;AAjFH,8CAkFC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts new file mode 100644 index 00000000..6cdb1f29 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts @@ -0,0 +1,3 @@ +export { ApolloServerPluginUsageReporting } from './plugin.js'; +export type { ApolloServerPluginUsageReportingOptions, SendValuesBaseOptions, VariableValueOptions, SendErrorsOptions, ClientInfo, GenerateClientInfo, } from './options.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts.map new file mode 100644 index 00000000..19d3f366 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EACV,uCAAuC,EACvC,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,GACnB,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js new file mode 100644 index 00000000..5461b236 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginUsageReporting = void 0; +var plugin_js_1 = require("./plugin.js"); +Object.defineProperty(exports, "ApolloServerPluginUsageReporting", { enumerable: true, get: function () { return plugin_js_1.ApolloServerPluginUsageReporting; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js.map new file mode 100644 index 00000000..699da604 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/index.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAAtD,6HAAA,gCAAgC,OAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts new file mode 100644 index 00000000..bb8e5ab1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts @@ -0,0 +1,7 @@ +import type { Trace } from '@apollo/usage-reporting-protobuf'; +export declare function iterateOverTrace(trace: Trace, f: (node: Trace.INode, path: ResponseNamePath) => boolean, includePath: boolean): void; +export interface ResponseNamePath { + toArray(): string[]; + child(responseName: string): ResponseNamePath; +} +//# sourceMappingURL=iterateOverTrace.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts.map new file mode 100644 index 00000000..ef003507 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"iterateOverTrace.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/iterateOverTrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAoB9D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,gBAAgB,KAAK,OAAO,EACzD,WAAW,EAAE,OAAO,QAYrB;AA8DD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC/C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js new file mode 100644 index 00000000..8d5d0380 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.iterateOverTrace = iterateOverTrace; +function iterateOverTrace(trace, f, includePath) { + const rootPath = includePath + ? new RootCollectingPathsResponseNamePath() + : notCollectingPathsResponseNamePath; + if (trace.root) { + if (iterateOverTraceNode(trace.root, rootPath, f)) + return; + } + if (trace.queryPlan) { + if (iterateOverQueryPlan(trace.queryPlan, rootPath, f)) + return; + } +} +function iterateOverQueryPlan(node, rootPath, f) { + if (!node) + return false; + if (node.fetch?.trace?.root && node.fetch.serviceName) { + return iterateOverTraceNode(node.fetch.trace.root, rootPath.child(`service:${node.fetch.serviceName}`), f); + } + if (node.flatten?.node) { + return iterateOverQueryPlan(node.flatten.node, rootPath, f); + } + if (node.parallel?.nodes) { + return node.parallel.nodes.some((node) => iterateOverQueryPlan(node, rootPath, f)); + } + if (node.sequence?.nodes) { + return node.sequence.nodes.some((node) => iterateOverQueryPlan(node, rootPath, f)); + } + return false; +} +function iterateOverTraceNode(node, path, f) { + if (f(node, path)) { + return true; + } + return (node.child?.some((child) => { + const childPath = child.responseName + ? path.child(child.responseName) + : path; + return iterateOverTraceNode(child, childPath, f); + }) ?? false); +} +const notCollectingPathsResponseNamePath = { + toArray() { + throw Error('not collecting paths!'); + }, + child() { + return this; + }, +}; +class RootCollectingPathsResponseNamePath { + toArray() { + return []; + } + child(responseName) { + return new ChildCollectingPathsResponseNamePath(responseName, this); + } +} +class ChildCollectingPathsResponseNamePath { + responseName; + prev; + constructor(responseName, prev) { + this.responseName = responseName; + this.prev = prev; + } + toArray() { + const out = []; + let curr = this; + while (curr instanceof ChildCollectingPathsResponseNamePath) { + out.push(curr.responseName); + curr = curr.prev; + } + return out.reverse(); + } + child(responseName) { + return new ChildCollectingPathsResponseNamePath(responseName, this); + } +} +//# sourceMappingURL=iterateOverTrace.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js.map new file mode 100644 index 00000000..72cd0aaf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/iterateOverTrace.js.map @@ -0,0 +1 @@ +{"version":3,"file":"iterateOverTrace.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/iterateOverTrace.ts"],"names":[],"mappings":";;AAoBA,4CAeC;AAfD,SAAgB,gBAAgB,CAC9B,KAAY,EACZ,CAAyD,EACzD,WAAoB;IAEpB,MAAM,QAAQ,GAAG,WAAW;QAC1B,CAAC,CAAC,IAAI,mCAAmC,EAAE;QAC3C,CAAC,CAAC,kCAAkC,CAAC;IACvC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,IAAI,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YAAE,OAAO;IAC5D,CAAC;IAED,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,IAAI,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;YAAE,OAAO;IACjE,CAAC;AACH,CAAC;AAGD,SAAS,oBAAoB,CAC3B,IAA0B,EAC1B,QAA0B,EAC1B,CAAyD;IAEzD,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,IAAI,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACtD,OAAO,oBAAoB,CACzB,IAAI,CAAC,KAAK,CAAC,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AI,KAAK,CACZ,CAAC;AACJ,CAAC;AAOD,MAAM,kCAAkC,GAAqB;IAC3D,OAAO;QACL,MAAM,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACvC,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAKF,MAAM,mCAAmC;IACvC,OAAO;QACL,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK,CAAC,YAAoB;QACxB,OAAO,IAAI,oCAAoC,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;CACF;AACD,MAAM,oCAAoC;IAE7B;IACA;IAFX,YACW,YAAoB,EACpB,IAAqC;QADrC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,SAAI,GAAJ,IAAI,CAAiC;IAC7C,CAAC;IACJ,OAAO;QACL,MAAM,GAAG,GAAG,EAAE,CAAC;QACf,IAAI,IAAI,GAAoC,IAAI,CAAC;QACjD,OAAO,IAAI,YAAY,oCAAoC,EAAE,CAAC;YAC5D,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC5B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACnB,CAAC;QACD,OAAO,GAAG,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IACD,KAAK,CAAC,YAAoB;QACxB,OAAO,IAAI,oCAAoC,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts new file mode 100644 index 00000000..65961696 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts @@ -0,0 +1,12 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { ReferencedFieldsByType } from '@apollo/utils.usagereporting'; +import { LRUCache } from 'lru-cache'; +export interface OperationDerivedData { + signature: string; + referencedFieldsByType: ReferencedFieldsByType; +} +export declare function createOperationDerivedDataCache({ logger, }: { + logger: Logger; +}): LRUCache; +export declare function operationDerivedDataCacheKey(queryHash: string, operationName: string): string; +//# sourceMappingURL=operationDerivedDataCache.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts.map new file mode 100644 index 00000000..074a9b38 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"operationDerivedDataCache.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/operationDerivedDataCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,sBAAsB,CAAC;CAChD;AAED,wBAAgB,+BAA+B,CAAC,EAC9C,MAAM,GACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAwCzC;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,UAGtB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js new file mode 100644 index 00000000..a4f145c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createOperationDerivedDataCache = createOperationDerivedDataCache; +exports.operationDerivedDataCacheKey = operationDerivedDataCacheKey; +const lru_cache_1 = require("lru-cache"); +function createOperationDerivedDataCache({ logger, }) { + let lastWarn; + let lastDisposals = 0; + return new lru_cache_1.LRUCache({ + sizeCalculation(obj) { + return Buffer.byteLength(JSON.stringify(obj), 'utf8'); + }, + maxSize: Math.pow(2, 20) * 10, + dispose() { + lastDisposals++; + if (!lastWarn || new Date().getTime() - lastWarn.getTime() > 60000) { + lastWarn = new Date(); + logger.warn([ + 'This server is processing a high number of unique operations. ', + `A total of ${lastDisposals} records have been `, + 'ejected from the ApolloServerPluginUsageReporting signature cache in the past ', + 'interval. If you see this warning frequently, please open an ', + 'issue on the Apollo Server repository.', + ].join('')); + lastDisposals = 0; + } + }, + }); +} +function operationDerivedDataCacheKey(queryHash, operationName) { + return `${queryHash}${operationName && ':' + operationName}`; +} +//# sourceMappingURL=operationDerivedDataCache.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js.map new file mode 100644 index 00000000..0701f54d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operationDerivedDataCache.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/operationDerivedDataCache.ts"],"names":[],"mappings":";;AASA,0EA4CC;AAED,oEAKC;AA1DD,yCAAqC;AAOrC,SAAgB,+BAA+B,CAAC,EAC9C,MAAM,GAGP;IACC,IAAI,QAAc,CAAC;IACnB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,oBAAQ,CAA+B;QAEhD,eAAe,CAAC,GAAG;YACjB,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;QACxD,CAAC;QASD,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE;QAC7B,OAAO;YAEL,aAAa,EAAE,CAAC;YAGhB,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;gBAEnE,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CACT;oBACE,iEAAiE;oBACjE,cAAc,aAAa,qBAAqB;oBAChD,gFAAgF;oBAChF,gEAAgE;oBAChE,wCAAwC;iBACzC,CAAC,IAAI,CAAC,EAAE,CAAC,CACX,CAAC;gBAGF,aAAa,GAAG,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,4BAA4B,CAC1C,SAAiB,EACjB,aAAqB;IAErB,OAAO,GAAG,SAAS,GAAG,aAAa,IAAI,GAAG,GAAG,aAAa,EAAE,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts new file mode 100644 index 00000000..e9518cd5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts @@ -0,0 +1,60 @@ +import type { GraphQLError, DocumentNode } from 'graphql'; +import type { GraphQLRequestContextDidResolveOperation, GraphQLRequestContext, GraphQLRequestContextWillSendResponse, BaseContext } from '../../externalTypes/index.js'; +import type { Logger } from '@apollo/utils.logger'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { Fetcher } from '@apollo/utils.fetcher'; +export interface ApolloServerPluginUsageReportingOptions { + sendTraces?: boolean; + sendVariableValues?: VariableValueOptions; + sendHeaders?: SendValuesBaseOptions; + sendErrors?: SendErrorsOptions; + fieldLevelInstrumentation?: number | ((request: GraphQLRequestContextDidResolveOperation) => Promise); + includeRequest?: (request: GraphQLRequestContextDidResolveOperation | GraphQLRequestContextWillSendResponse) => Promise; + generateClientInfo?: GenerateClientInfo; + overrideReportedSchema?: string; + sendUnexecutableOperationDocuments?: boolean; + experimental_sendOperationAsTrace?: (trace: Trace, statsReportKey: string) => boolean; + sendReportsImmediately?: boolean; + fetcher?: Fetcher; + reportIntervalMs?: number; + maxUncompressedReportSize?: number; + maxAttempts?: number; + minimumRetryDelayMs?: number; + requestTimeoutMs?: number; + logger?: Logger; + reportErrorFunction?: (err: Error) => void; + endpointUrl?: string; + debugPrintReports?: boolean; + calculateSignature?: (ast: DocumentNode, operationName: string) => string; + __onlyIfSchemaIsNotSubgraph?: boolean; +} +export type SendValuesBaseOptions = { + onlyNames: Array; +} | { + exceptNames: Array; +} | { + all: true; +} | { + none: true; +}; +type VariableValueTransformOptions = { + variables: Record; + operationString?: string; +}; +export type VariableValueOptions = { + transform: (options: VariableValueTransformOptions) => Record; +} | SendValuesBaseOptions; +export type SendErrorsOptions = { + unmodified: true; +} | { + masked: true; +} | { + transform: (err: GraphQLError) => GraphQLError | null; +}; +export interface ClientInfo { + clientName?: string; + clientVersion?: string; +} +export type GenerateClientInfo = (requestContext: GraphQLRequestContext) => ClientInfo; +export {}; +//# sourceMappingURL=options.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts.map new file mode 100644 index 00000000..442a6580 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EACV,wCAAwC,EACxC,qBAAqB,EACrB,qCAAqC,EACrC,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,uCAAuC,CACtD,QAAQ,SAAS,WAAW;IA+B5B,UAAU,CAAC,EAAE,OAAO,CAAC;IA6BrB,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAoB1C,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAyBpC,UAAU,CAAC,EA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AE,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,GAC9B;IAAE,GAAG,EAAE,IAAI,CAAA;CAAE,GACb;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAEnB,KAAK,6BAA6B,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B;IACE,SAAS,EAAE,CACT,OAAO,EAAE,6BAA6B,KACnC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1B,GACD,qBAAqB,CAAC;AAE1B,MAAM,MAAM,iBAAiB,GACzB;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAChB;IAAE,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,YAAY,GAAG,IAAI,CAAA;CAAE,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,WAAW,IAAI,CAC7D,cAAc,EAAE,qBAAqB,CAAC,QAAQ,CAAC,KAC5C,UAAU,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js new file mode 100644 index 00000000..0dfad076 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=options.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js.map new file mode 100644 index 00000000..f151d498 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/options.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts new file mode 100644 index 00000000..e37a5dbc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts @@ -0,0 +1,7 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +import type { ApolloServerPlugin, BaseContext } from '../../externalTypes/index.js'; +import type { ApolloServerPluginUsageReportingOptions, SendValuesBaseOptions } from './options.js'; +import type { HeaderMap } from '../../utils/HeaderMap.js'; +export declare function ApolloServerPluginUsageReporting(options?: ApolloServerPluginUsageReportingOptions): ApolloServerPlugin; +export declare function makeHTTPRequestHeaders(http: Trace.IHTTP, headers: HeaderMap, sendHeaders?: SendValuesBaseOptions): void; +//# sourceMappingURL=plugin.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts.map new file mode 100644 index 00000000..eb16d681 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAY/E,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EAMZ,MAAM,8BAA8B,CAAC;AAStC,OAAO,KAAK,EACV,uCAAuC,EACvC,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAW1D,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,WAAW,EAC3E,OAAO,GAAE,uCAAuC,CAAC,QAAQ,CAExD,GACA,kBAAkB,CAAC,QAAQ,CAAC,CA4uB9B;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,KAAK,CAAC,KAAK,EACjB,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,qBAAqB,GAClC,IAAI,CAsCN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js new file mode 100644 index 00000000..6d6c8141 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js @@ -0,0 +1,494 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApolloServerPluginUsageReporting = ApolloServerPluginUsageReporting; +exports.makeHTTPRequestHeaders = makeHTTPRequestHeaders; +const usage_reporting_protobuf_1 = require("@apollo/usage-reporting-protobuf"); +const utils_usagereporting_1 = require("@apollo/utils.usagereporting"); +const async_retry_1 = __importDefault(require("async-retry")); +const graphql_1 = require("graphql"); +const os_1 = __importDefault(require("os")); +const zlib_1 = require("zlib"); +const internalPlugin_js_1 = require("../../internalPlugin.js"); +const traceTreeBuilder_js_1 = require("../traceTreeBuilder.js"); +const defaultSendOperationsAsTrace_js_1 = require("./defaultSendOperationsAsTrace.js"); +const operationDerivedDataCache_js_1 = require("./operationDerivedDataCache.js"); +const stats_js_1 = require("./stats.js"); +const traceDetails_js_1 = require("./traceDetails.js"); +const packageVersion_js_1 = require("../../generated/packageVersion.js"); +const computeCoreSchemaHash_js_1 = require("../../utils/computeCoreSchemaHash.js"); +const schemaIsSubgraph_js_1 = require("../schemaIsSubgraph.js"); +const reportHeaderDefaults = { + hostname: os_1.default.hostname(), + agentVersion: `@apollo/server@${packageVersion_js_1.packageVersion}`, + runtimeVersion: `node ${process.version}`, + uname: `${os_1.default.platform()}, ${os_1.default.type()}, ${os_1.default.release()}, ${os_1.default.arch()})`, +}; +function ApolloServerPluginUsageReporting(options = Object.create(null)) { + const fieldLevelInstrumentationOption = options.fieldLevelInstrumentation; + const fieldLevelInstrumentation = typeof fieldLevelInstrumentationOption === 'number' + ? async () => Math.random() < fieldLevelInstrumentationOption + ? 1 / fieldLevelInstrumentationOption + : 0 + : fieldLevelInstrumentationOption + ? fieldLevelInstrumentationOption + : async () => true; + let requestDidStartHandler = null; + return (0, internalPlugin_js_1.internalPlugin)({ + __internal_plugin_id__: 'UsageReporting', + __is_disabled_plugin__: false, + async requestDidStart(requestContext) { + if (requestDidStartHandler) { + return requestDidStartHandler(requestContext); + } + return {}; + }, + async serverWillStart({ logger: serverLogger, apollo, startedInBackground, schema, }) { + const logger = options.logger ?? serverLogger; + const { key, graphRef } = apollo; + if (!(key && graphRef)) { + throw new Error("You've enabled usage reporting via ApolloServerPluginUsageReporting, " + + 'but you also need to provide your Apollo API key and graph ref, via ' + + 'the APOLLO_KEY/APOLLO_GRAPH_REF environment ' + + 'variables or via `new ApolloServer({apollo: {key, graphRef})`.'); + } + if ((0, schemaIsSubgraph_js_1.schemaIsSubgraph)(schema)) { + if (options.__onlyIfSchemaIsNotSubgraph) { + logger.warn('You have specified an Apollo API key and graph ref but this server appears ' + + 'to be a subgraph. Typically usage reports are sent to Apollo by your Router ' + + 'or Gateway, not directly from your subgraph; usage reporting is disabled. To ' + + 'enable usage reporting anyway, explicitly install `ApolloServerPluginUsageReporting`. ' + + 'To disable this warning, install `ApolloServerPluginUsageReportingDisabled`.'); + return {}; + } + else { + logger.warn('You have installed `ApolloServerPluginUsageReporting` but this server appears to ' + + 'be a subgraph. Typically usage reports are sent to Apollo by your Router ' + + 'or Gateway, not directly from your subgraph. If this was unintentional, remove ' + + "`ApolloServerPluginUsageReporting` from your server's `plugins` array."); + } + } + logger.info('Apollo usage reporting starting! See your graph at ' + + `https://studio.apollographql.com/graph/${encodeURI(graphRef)}/`); + const sendReportsImmediately = options.sendReportsImmediately ?? startedInBackground; + let operationDerivedDataCache = null; + const reportByExecutableSchemaId = new Map(); + const getReportWhichMustBeUsedImmediately = (executableSchemaId) => { + const existing = reportByExecutableSchemaId.get(executableSchemaId); + if (existing) { + return existing; + } + const report = new stats_js_1.OurReport(new usage_reporting_protobuf_1.ReportHeader({ + ...reportHeaderDefaults, + executableSchemaId, + graphRef, + })); + reportByExecutableSchemaId.set(executableSchemaId, report); + return report; + }; + const getAndDeleteReport = (executableSchemaId) => { + const report = reportByExecutableSchemaId.get(executableSchemaId); + if (report) { + reportByExecutableSchemaId.delete(executableSchemaId); + return report; + } + return null; + }; + const overriddenExecutableSchemaId = options.overrideReportedSchema + ? (0, computeCoreSchemaHash_js_1.computeCoreSchemaHash)(options.overrideReportedSchema) + : undefined; + let lastSeenExecutableSchemaToId; + let reportTimer; + if (!sendReportsImmediately) { + reportTimer = setInterval(() => sendAllReportsAndReportErrors(), options.reportIntervalMs || 10 * 1000); + } + let sendTraces = options.sendTraces ?? true; + const sendOperationAsTrace = options.experimental_sendOperationAsTrace ?? + (0, defaultSendOperationsAsTrace_js_1.defaultSendOperationsAsTrace)(); + let stopped = false; + function executableSchemaIdForSchema(schema) { + if (lastSeenExecutableSchemaToId?.executableSchema === schema) { + return lastSeenExecutableSchemaToId.executableSchemaId; + } + const id = (0, computeCoreSchemaHash_js_1.computeCoreSchemaHash)((0, graphql_1.printSchema)(schema)); + lastSeenExecutableSchemaToId = { + executableSchema: schema, + executableSchemaId: id, + }; + return id; + } + async function sendAllReportsAndReportErrors() { + await Promise.all([...reportByExecutableSchemaId.keys()].map((executableSchemaId) => sendReportAndReportErrors(executableSchemaId))); + } + async function sendReportAndReportErrors(executableSchemaId) { + return sendReport(executableSchemaId).catch((err) => { + if (options.reportErrorFunction) { + options.reportErrorFunction(err); + } + else { + logger.error(err.message); + } + }); + } + const sendReport = async (executableSchemaId) => { + let report = getAndDeleteReport(executableSchemaId); + if (!report || + (Object.keys(report.tracesPerQuery).length === 0 && + report.operationCount === 0)) { + return; + } + report.endTime = (0, traceTreeBuilder_js_1.dateToProtoTimestamp)(new Date()); + report.ensureCountsAreIntegers(); + const protobufError = usage_reporting_protobuf_1.Report.verify(report); + if (protobufError) { + throw new Error(`Error verifying report: ${protobufError}`); + } + let message = usage_reporting_protobuf_1.Report.encode(report).finish(); + report = null; + if (options.debugPrintReports) { + const decodedReport = usage_reporting_protobuf_1.Report.decode(message); + logger.info(`Apollo usage report: ${JSON.stringify(decodedReport.toJSON())}`); + } + const compressed = await new Promise((resolve, reject) => { + (0, zlib_1.gzip)(message, (error, result) => { + error ? reject(error) : resolve(result); + }); + }); + message = null; + const fetcher = options.fetcher ?? fetch; + const response = await (0, async_retry_1.default)(async () => { + const curResponse = await fetcher((options.endpointUrl || + 'https://usage-reporting.api.apollographql.com') + + '/api/ingress/traces', { + method: 'POST', + headers: { + 'user-agent': 'ApolloServerPluginUsageReporting', + 'x-api-key': key, + 'content-encoding': 'gzip', + accept: 'application/json', + }, + body: compressed, + signal: AbortSignal.timeout(options.requestTimeoutMs ?? 30_000), + }); + if (curResponse.status >= 500 && curResponse.status < 600) { + throw new Error(`HTTP status ${curResponse.status}, ${(await curResponse.text()) || '(no body)'}`); + } + else { + return curResponse; + } + }, { + retries: (options.maxAttempts || 5) - 1, + minTimeout: options.minimumRetryDelayMs || 100, + factor: 2, + }).catch((err) => { + throw new Error(`Error sending report to Apollo servers: ${err.message}`); + }); + if (response.status < 200 || response.status >= 300) { + throw new Error(`Error sending report to Apollo servers: HTTP status ${response.status}, ${(await response.text()) || '(no body)'}`); + } + if (sendTraces && + response.status === 200 && + response.headers + .get('content-type') + ?.match(/^\s*application\/json\s*(?:;|$)/i)) { + const body = await response.text(); + let parsedBody; + try { + parsedBody = JSON.parse(body); + } + catch (e) { + throw new Error(`Error parsing response from Apollo servers: ${e}`); + } + if (parsedBody.tracesIgnored === true) { + logger.debug("This graph's organization does not have access to traces; sending all " + + 'subsequent operations as stats.'); + sendTraces = false; + } + } + if (options.debugPrintReports) { + logger.info(`Apollo usage report: status ${response.status}`); + } + }; + requestDidStartHandler = ({ metrics, schema, request: { http, variables }, }) => { + const treeBuilder = new traceTreeBuilder_js_1.TraceTreeBuilder({ + maskedBy: 'ApolloServerPluginUsageReporting', + sendErrors: options.sendErrors, + }); + treeBuilder.startTiming(); + metrics.startHrTime = treeBuilder.startHrTime; + let graphqlValidationFailure = false; + let graphqlUnknownOperationName = false; + let includeOperationInUsageReporting = null; + if (http) { + treeBuilder.trace.http = new usage_reporting_protobuf_1.Trace.HTTP({ + method: usage_reporting_protobuf_1.Trace.HTTP.Method[http.method] || usage_reporting_protobuf_1.Trace.HTTP.Method.UNKNOWN, + }); + if (options.sendHeaders) { + makeHTTPRequestHeaders(treeBuilder.trace.http, http.headers, options.sendHeaders); + } + } + async function maybeCallIncludeRequestHook(requestContext) { + if (includeOperationInUsageReporting !== null) + return; + if (typeof options.includeRequest !== 'function') { + includeOperationInUsageReporting = true; + return; + } + includeOperationInUsageReporting = + await options.includeRequest(requestContext); + if (typeof includeOperationInUsageReporting !== 'boolean') { + logger.warn("The 'includeRequest' async predicate function must return a boolean value."); + includeOperationInUsageReporting = true; + } + } + let didResolveSource = false; + return { + async didResolveSource(requestContext) { + didResolveSource = true; + if (metrics.persistedQueryHit) { + treeBuilder.trace.persistedQueryHit = true; + } + if (metrics.persistedQueryRegister) { + treeBuilder.trace.persistedQueryRegister = true; + } + if (variables) { + treeBuilder.trace.details = (0, traceDetails_js_1.makeTraceDetails)(variables, options.sendVariableValues, requestContext.source); + } + const clientInfo = (options.generateClientInfo || defaultGenerateClientInfo)(requestContext); + if (clientInfo) { + const { clientName, clientVersion } = clientInfo; + treeBuilder.trace.clientVersion = clientVersion || ''; + treeBuilder.trace.clientName = clientName || ''; + } + }, + async validationDidStart() { + return async (validationErrors) => { + graphqlValidationFailure = validationErrors + ? validationErrors.length !== 0 + : false; + }; + }, + async didResolveOperation(requestContext) { + graphqlUnknownOperationName = + requestContext.operation === undefined; + await maybeCallIncludeRequestHook(requestContext); + if (includeOperationInUsageReporting && + !graphqlUnknownOperationName) { + if (metrics.captureTraces === undefined) { + const rawWeight = await fieldLevelInstrumentation(requestContext); + treeBuilder.trace.fieldExecutionWeight = + typeof rawWeight === 'number' ? rawWeight : rawWeight ? 1 : 0; + metrics.captureTraces = + !!treeBuilder.trace.fieldExecutionWeight; + } + } + }, + async executionDidStart() { + if (!metrics.captureTraces) + return; + return { + willResolveField({ info }) { + return treeBuilder.willResolveField(info); + }, + }; + }, + async didEncounterSubsequentErrors(_requestContext, errors) { + treeBuilder.didEncounterErrors(errors); + }, + async willSendSubsequentPayload(requestContext, payload) { + if (!payload.hasNext) { + await operationFinished(requestContext); + } + }, + async willSendResponse(requestContext) { + if (!didResolveSource) + return; + if (requestContext.errors) { + treeBuilder.didEncounterErrors(requestContext.errors); + } + if (requestContext.response.body.kind === 'single') { + await operationFinished(requestContext); + } + }, + }; + async function operationFinished(requestContext) { + const resolvedOperation = !!requestContext.operation; + await maybeCallIncludeRequestHook(requestContext); + treeBuilder.stopTiming(); + const executableSchemaId = overriddenExecutableSchemaId ?? executableSchemaIdForSchema(schema); + if (includeOperationInUsageReporting === false) { + if (resolvedOperation) { + getReportWhichMustBeUsedImmediately(executableSchemaId) + .operationCount++; + } + return; + } + treeBuilder.trace.fullQueryCacheHit = !!metrics.responseCacheHit; + treeBuilder.trace.forbiddenOperation = !!metrics.forbiddenOperation; + treeBuilder.trace.registeredOperation = !!metrics.registeredOperation; + const policyIfCacheable = requestContext.overallCachePolicy.policyIfCacheable(); + if (policyIfCacheable) { + treeBuilder.trace.cachePolicy = new usage_reporting_protobuf_1.Trace.CachePolicy({ + scope: policyIfCacheable.scope === 'PRIVATE' + ? usage_reporting_protobuf_1.Trace.CachePolicy.Scope.PRIVATE + : policyIfCacheable.scope === 'PUBLIC' + ? usage_reporting_protobuf_1.Trace.CachePolicy.Scope.PUBLIC + : usage_reporting_protobuf_1.Trace.CachePolicy.Scope.UNKNOWN, + maxAgeNs: policyIfCacheable.maxAge * 1e9, + }); + } + if (metrics.queryPlanTrace) { + treeBuilder.trace.queryPlan = metrics.queryPlanTrace; + } + addTrace().catch(logger.error.bind(logger)); + async function addTrace() { + if (stopped) { + return; + } + await new Promise((res) => setImmediate(res)); + const executableSchemaId = overriddenExecutableSchemaId ?? + executableSchemaIdForSchema(schema); + const { trace } = treeBuilder; + let statsReportKey = undefined; + let referencedFieldsByType; + if (!requestContext.document) { + statsReportKey = `## GraphQLParseFailure\n`; + } + else if (graphqlValidationFailure) { + statsReportKey = `## GraphQLValidationFailure\n`; + } + else if (graphqlUnknownOperationName) { + statsReportKey = `## GraphQLUnknownOperationName\n`; + } + const isExecutable = statsReportKey === undefined; + if (statsReportKey) { + if (options.sendUnexecutableOperationDocuments) { + trace.unexecutedOperationBody = requestContext.source; + trace.unexecutedOperationName = + requestContext.request.operationName || ''; + } + referencedFieldsByType = Object.create(null); + } + else { + const operationDerivedData = getOperationDerivedData(); + statsReportKey = `# ${requestContext.operationName || '-'}\n${operationDerivedData.signature}`; + referencedFieldsByType = + operationDerivedData.referencedFieldsByType; + } + const protobufError = usage_reporting_protobuf_1.Trace.verify(trace); + if (protobufError) { + throw new Error(`Error encoding trace: ${protobufError}`); + } + if (resolvedOperation) { + getReportWhichMustBeUsedImmediately(executableSchemaId) + .operationCount++; + } + getReportWhichMustBeUsedImmediately(executableSchemaId).addTrace({ + statsReportKey, + trace, + asTrace: sendTraces && + (!isExecutable || !!metrics.captureTraces) && + !metrics.nonFtv1ErrorPaths?.length && + sendOperationAsTrace(trace, statsReportKey), + referencedFieldsByType, + nonFtv1ErrorPaths: metrics.nonFtv1ErrorPaths ?? [], + }); + if (sendReportsImmediately || + getReportWhichMustBeUsedImmediately(executableSchemaId) + .sizeEstimator.bytes >= + (options.maxUncompressedReportSize || 4 * 1024 * 1024)) { + await sendReportAndReportErrors(executableSchemaId); + } + } + function getOperationDerivedData() { + if (!requestContext.document) { + throw new Error('No document?'); + } + const cacheKey = (0, operationDerivedDataCache_js_1.operationDerivedDataCacheKey)(requestContext.queryHash, requestContext.operationName || ''); + if (!operationDerivedDataCache || + operationDerivedDataCache.forSchema !== schema) { + operationDerivedDataCache = { + forSchema: schema, + cache: (0, operationDerivedDataCache_js_1.createOperationDerivedDataCache)({ logger }), + }; + } + const cachedOperationDerivedData = operationDerivedDataCache.cache.get(cacheKey); + if (cachedOperationDerivedData) { + return cachedOperationDerivedData; + } + const generatedSignature = (options.calculateSignature || utils_usagereporting_1.usageReportingSignature)(requestContext.document, requestContext.operationName || ''); + const generatedOperationDerivedData = { + signature: generatedSignature, + referencedFieldsByType: (0, utils_usagereporting_1.calculateReferencedFieldsByType)({ + document: requestContext.document, + schema, + resolvedOperationName: requestContext.operationName ?? null, + }), + }; + operationDerivedDataCache.cache.set(cacheKey, generatedOperationDerivedData); + return generatedOperationDerivedData; + } + } + }; + return { + async serverWillStop() { + if (reportTimer) { + clearInterval(reportTimer); + reportTimer = undefined; + } + stopped = true; + await sendAllReportsAndReportErrors(); + }, + }; + }, + }); +} +function makeHTTPRequestHeaders(http, headers, sendHeaders) { + if (!sendHeaders || + ('none' in sendHeaders && sendHeaders.none) || + ('all' in sendHeaders && !sendHeaders.all)) { + return; + } + for (const [key, value] of headers) { + if (('exceptNames' in sendHeaders && + sendHeaders.exceptNames.some((exceptHeader) => { + return exceptHeader.toLowerCase() === key; + })) || + ('onlyNames' in sendHeaders && + !sendHeaders.onlyNames.some((header) => { + return header.toLowerCase() === key; + }))) { + continue; + } + switch (key) { + case 'authorization': + case 'cookie': + case 'set-cookie': + break; + default: + http.requestHeaders[key] = new usage_reporting_protobuf_1.Trace.HTTP.Values({ + value: [value], + }); + } + } +} +function defaultGenerateClientInfo({ request, }) { + const clientNameHeaderKey = 'apollographql-client-name'; + const clientVersionHeaderKey = 'apollographql-client-version'; + if (request.http?.headers?.get(clientNameHeaderKey) || + request.http?.headers?.get(clientVersionHeaderKey)) { + return { + clientName: request.http?.headers?.get(clientNameHeaderKey), + clientVersion: request.http?.headers?.get(clientVersionHeaderKey), + }; + } + else if (request.extensions?.clientInfo) { + return request.extensions.clientInfo; + } + else { + return {}; + } +} +//# sourceMappingURL=plugin.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js.map new file mode 100644 index 00000000..f5015e56 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"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C,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,sBAAsB,CAAC;SAClE,CAAC;IACJ,CAAC;SAAM,IAAI,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC;QAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts new file mode 100644 index 00000000..9a56ba22 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts @@ -0,0 +1,96 @@ +import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface'; +import { type google, type IContextualizedStats, type IFieldStat, type IPathErrorStats, type IQueryLatencyStats, type IReport, type IStatsContext, type ITracesAndStats, type ITypeStat, type ReportHeader, Trace } from '@apollo/usage-reporting-protobuf'; +import type { ReferencedFieldsByType } from '@apollo/utils.usagereporting'; +import { DurationHistogram } from './durationHistogram.js'; +export declare class SizeEstimator { + bytes: number; +} +export declare class OurReport implements Required { + readonly header: ReportHeader; + tracesPreAggregated: boolean; + constructor(header: ReportHeader); + readonly tracesPerQuery: Record; + endTime: google.protobuf.ITimestamp | null; + operationCount: number; + readonly sizeEstimator: SizeEstimator; + ensureCountsAreIntegers(): void; + addTrace({ statsReportKey, trace, asTrace, referencedFieldsByType, maxTraceBytes, nonFtv1ErrorPaths, }: { + statsReportKey: string; + trace: Trace; + asTrace: boolean; + referencedFieldsByType: ReferencedFieldsByType; + maxTraceBytes?: number; + nonFtv1ErrorPaths: NonFtv1ErrorPath[]; + }): void; + private getTracesAndStats; +} +declare class OurTracesAndStats implements Required { + readonly referencedFieldsByType: ReferencedFieldsByType; + constructor(referencedFieldsByType: ReferencedFieldsByType); + readonly trace: Uint8Array[]; + readonly statsWithContext: StatsByContext; + readonly internalTracesContributingToStats: Uint8Array[]; + ensureCountsAreIntegers(): void; +} +declare class StatsByContext { + readonly map: { + [k: string]: OurContextualizedStats; + }; + toArray(): IContextualizedStats[]; + ensureCountsAreIntegers(): void; + addTrace(trace: Trace, sizeEstimator: SizeEstimator, nonFtv1ErrorPaths: NonFtv1ErrorPath[]): void; + private getContextualizedStats; +} +export declare class OurContextualizedStats implements Required { + readonly context: IStatsContext; + queryLatencyStats: OurQueryLatencyStats; + perTypeStat: { + [k: string]: OurTypeStat; + }; + constructor(context: IStatsContext); + ensureCountsAreIntegers(): void; + addTrace(trace: Trace, sizeEstimator: SizeEstimator, nonFtv1ErrorPaths?: NonFtv1ErrorPath[]): void; + getTypeStat(parentType: string, sizeEstimator: SizeEstimator): OurTypeStat; +} +declare class OurQueryLatencyStats implements Required { + latencyCount: DurationHistogram; + requestCount: number; + requestsWithoutFieldInstrumentation: number; + cacheHits: number; + persistedQueryHits: number; + persistedQueryMisses: number; + cacheLatencyCount: DurationHistogram; + rootErrorStats: OurPathErrorStats; + requestsWithErrorsCount: number; + publicCacheTtlCount: DurationHistogram; + privateCacheTtlCount: DurationHistogram; + registeredOperationCount: number; + forbiddenOperationCount: number; +} +declare class OurPathErrorStats implements Required { + children: { + [k: string]: OurPathErrorStats; + }; + errorsCount: number; + requestsWithErrorsCount: number; + getChild(subPath: string, sizeEstimator: SizeEstimator): OurPathErrorStats; +} +declare class OurTypeStat implements Required { + perFieldStat: { + [k: string]: OurFieldStat; + }; + getFieldStat(fieldName: string, returnType: string, sizeEstimator: SizeEstimator): OurFieldStat; + ensureCountsAreIntegers(): void; +} +declare class OurFieldStat implements Required { + readonly returnType: string; + errorsCount: number; + observedExecutionCount: number; + estimatedExecutionCount: number; + requestsWithErrorsCount: number; + latencyCount: DurationHistogram; + constructor(returnType: string); + ensureCountsAreIntegers(): void; +} +export {}; +//# sourceMappingURL=stats.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts.map new file mode 100644 index 00000000..54af4768 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,EACN,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAkB3D,qBAAa,aAAa;IACxB,KAAK,SAAK;CACX;AACD,qBAAa,SAAU,YAAW,QAAQ,CAAC,OAAO,CAAC;IAOrC,QAAQ,CAAC,MAAM,EAAE,YAAY;IAFzC,mBAAmB,UAAS;gBAEP,MAAM,EAAE,YAAY;IACzC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CACpC;IACtB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAQ;IAClD,cAA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AAuB,SAAK;IAC5B,YAAY,EAAE,iBAAiB,CAA2B;gBAErC,UAAU,EAAE,MAAM;IAEvC,uBAAuB;CAIxB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js new file mode 100644 index 00000000..b2ec613d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js @@ -0,0 +1,289 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OurContextualizedStats = exports.OurReport = exports.SizeEstimator = void 0; +const usage_reporting_protobuf_1 = require("@apollo/usage-reporting-protobuf"); +const durationHistogram_js_1 = require("./durationHistogram.js"); +const iterateOverTrace_js_1 = require("./iterateOverTrace.js"); +class SizeEstimator { + bytes = 0; +} +exports.SizeEstimator = SizeEstimator; +class OurReport { + header; + tracesPreAggregated = false; + constructor(header) { + this.header = header; + } + tracesPerQuery = Object.create(null); + endTime = null; + operationCount = 0; + sizeEstimator = new SizeEstimator(); + ensureCountsAreIntegers() { + for (const tracesAndStats of Object.values(this.tracesPerQuery)) { + tracesAndStats.ensureCountsAreIntegers(); + } + } + addTrace({ statsReportKey, trace, asTrace, referencedFieldsByType, maxTraceBytes = 10 * 1024 * 1024, nonFtv1ErrorPaths, }) { + const tracesAndStats = this.getTracesAndStats({ + statsReportKey, + referencedFieldsByType, + }); + if (asTrace) { + const encodedTrace = usage_reporting_protobuf_1.Trace.encode(trace).finish(); + if (!isNaN(maxTraceBytes) && encodedTrace.length > maxTraceBytes) { + tracesAndStats.statsWithContext.addTrace(trace, this.sizeEstimator, nonFtv1ErrorPaths); + } + else { + tracesAndStats.trace.push(encodedTrace); + this.sizeEstimator.bytes += 2 + encodedTrace.length; + } + } + else { + tracesAndStats.statsWithContext.addTrace(trace, this.sizeEstimator, nonFtv1ErrorPaths); + } + } + getTracesAndStats({ statsReportKey, referencedFieldsByType, }) { + const existing = this.tracesPerQuery[statsReportKey]; + if (existing) { + return existing; + } + this.sizeEstimator.bytes += estimatedBytesForString(statsReportKey); + for (const [typeName, referencedFieldsForType] of Object.entries(referencedFieldsByType)) { + this.sizeEstimator.bytes += 2 + 2; + if (referencedFieldsForType.isInterface) { + this.sizeEstimator.bytes += 2; + } + this.sizeEstimator.bytes += estimatedBytesForString(typeName); + for (const fieldName of referencedFieldsForType.fieldNames) { + this.sizeEstimator.bytes += estimatedBytesForString(fieldName); + } + } + return (this.tracesPerQuery[statsReportKey] = new OurTracesAndStats(referencedFieldsByType)); + } +} +exports.OurReport = OurReport; +class OurTracesAndStats { + referencedFieldsByType; + constructor(referencedFieldsByType) { + this.referencedFieldsByType = referencedFieldsByType; + } + trace = []; + statsWithContext = new StatsByContext(); + internalTracesContributingToStats = []; + ensureCountsAreIntegers() { + this.statsWithContext.ensureCountsAreIntegers(); + } +} +class StatsByContext { + map = Object.create(null); + toArray() { + return Object.values(this.map); + } + ensureCountsAreIntegers() { + for (const contextualizedStats of Object.values(this.map)) { + contextualizedStats.ensureCountsAreIntegers(); + } + } + addTrace(trace, sizeEstimator, nonFtv1ErrorPaths) { + this.getContextualizedStats(trace, sizeEstimator).addTrace(trace, sizeEstimator, nonFtv1ErrorPaths); + } + getContextualizedStats(trace, sizeEstimator) { + const statsContext = { + clientName: trace.clientName, + clientVersion: trace.clientVersion, + }; + const statsContextKey = JSON.stringify(statsContext); + const existing = this.map[statsContextKey]; + if (existing) { + return existing; + } + sizeEstimator.bytes += + 20 + + estimatedBytesForString(trace.clientName) + + estimatedBytesForString(trace.clientVersion); + const contextualizedStats = new OurContextualizedStats(statsContext); + this.map[statsContextKey] = contextualizedStats; + return contextualizedStats; + } +} +class OurContextualizedStats { + context; + queryLatencyStats = new OurQueryLatencyStats(); + perTypeStat = Object.create(null); + constructor(context) { + this.context = context; + } + ensureCountsAreIntegers() { + for (const typeStat of Object.values(this.perTypeStat)) { + typeStat.ensureCountsAreIntegers(); + } + } + addTrace(trace, sizeEstimator, nonFtv1ErrorPaths = []) { + const { fieldExecutionWeight } = trace; + if (!fieldExecutionWeight) { + this.queryLatencyStats.requestsWithoutFieldInstrumentation++; + } + this.queryLatencyStats.requestCount++; + if (trace.fullQueryCacheHit) { + this.queryLatencyStats.cacheLatencyCount.incrementDuration(trace.durationNs); + this.queryLatencyStats.cacheHits++; + } + else { + this.queryLatencyStats.latencyCount.incrementDuration(trace.durationNs); + } + if (!trace.fullQueryCacheHit && trace.cachePolicy?.maxAgeNs != null) { + switch (trace.cachePolicy.scope) { + case usage_reporting_protobuf_1.Trace.CachePolicy.Scope.PRIVATE: + this.queryLatencyStats.privateCacheTtlCount.incrementDuration(trace.cachePolicy.maxAgeNs); + break; + case usage_reporting_protobuf_1.Trace.CachePolicy.Scope.PUBLIC: + this.queryLatencyStats.publicCacheTtlCount.incrementDuration(trace.cachePolicy.maxAgeNs); + break; + } + } + if (trace.persistedQueryHit) { + this.queryLatencyStats.persistedQueryHits++; + } + if (trace.persistedQueryRegister) { + this.queryLatencyStats.persistedQueryMisses++; + } + if (trace.forbiddenOperation) { + this.queryLatencyStats.forbiddenOperationCount++; + } + if (trace.registeredOperation) { + this.queryLatencyStats.registeredOperationCount++; + } + let hasError = false; + const errorPathStats = new Set(); + const traceNodeStats = (node, path) => { + if (node.error?.length) { + hasError = true; + let currPathErrorStats = this.queryLatencyStats.rootErrorStats; + path.toArray().forEach((subPath) => { + currPathErrorStats = currPathErrorStats.getChild(subPath, sizeEstimator); + }); + errorPathStats.add(currPathErrorStats); + currPathErrorStats.errorsCount += node.error.length; + } + if (fieldExecutionWeight) { + const fieldName = node.originalFieldName || node.responseName; + if (node.parentType && + fieldName && + node.type && + node.endTime != null && + node.startTime != null && + node.endTime >= node.startTime) { + const typeStat = this.getTypeStat(node.parentType, sizeEstimator); + const fieldStat = typeStat.getFieldStat(fieldName, node.type, sizeEstimator); + fieldStat.errorsCount += node.error?.length ?? 0; + fieldStat.observedExecutionCount++; + fieldStat.estimatedExecutionCount += fieldExecutionWeight; + fieldStat.requestsWithErrorsCount += + (node.error?.length ?? 0) > 0 ? 1 : 0; + fieldStat.latencyCount.incrementDuration(node.endTime - node.startTime, fieldExecutionWeight); + } + } + return false; + }; + (0, iterateOverTrace_js_1.iterateOverTrace)(trace, traceNodeStats, true); + for (const { subgraph, path } of nonFtv1ErrorPaths) { + hasError = true; + if (path) { + let currPathErrorStats = this.queryLatencyStats.rootErrorStats.getChild(`service:${subgraph}`, sizeEstimator); + path.forEach((subPath) => { + if (typeof subPath === 'string') { + currPathErrorStats = currPathErrorStats.getChild(subPath, sizeEstimator); + } + }); + errorPathStats.add(currPathErrorStats); + currPathErrorStats.errorsCount += 1; + } + } + for (const errorPath of errorPathStats) { + errorPath.requestsWithErrorsCount += 1; + } + if (hasError) { + this.queryLatencyStats.requestsWithErrorsCount++; + } + } + getTypeStat(parentType, sizeEstimator) { + const existing = this.perTypeStat[parentType]; + if (existing) { + return existing; + } + sizeEstimator.bytes += estimatedBytesForString(parentType); + const typeStat = new OurTypeStat(); + this.perTypeStat[parentType] = typeStat; + return typeStat; + } +} +exports.OurContextualizedStats = OurContextualizedStats; +class OurQueryLatencyStats { + latencyCount = new durationHistogram_js_1.DurationHistogram(); + requestCount = 0; + requestsWithoutFieldInstrumentation = 0; + cacheHits = 0; + persistedQueryHits = 0; + persistedQueryMisses = 0; + cacheLatencyCount = new durationHistogram_js_1.DurationHistogram(); + rootErrorStats = new OurPathErrorStats(); + requestsWithErrorsCount = 0; + publicCacheTtlCount = new durationHistogram_js_1.DurationHistogram(); + privateCacheTtlCount = new durationHistogram_js_1.DurationHistogram(); + registeredOperationCount = 0; + forbiddenOperationCount = 0; +} +class OurPathErrorStats { + children = Object.create(null); + errorsCount = 0; + requestsWithErrorsCount = 0; + getChild(subPath, sizeEstimator) { + const existing = this.children[subPath]; + if (existing) { + return existing; + } + const child = new OurPathErrorStats(); + this.children[subPath] = child; + sizeEstimator.bytes += estimatedBytesForString(subPath) + 4; + return child; + } +} +class OurTypeStat { + perFieldStat = Object.create(null); + getFieldStat(fieldName, returnType, sizeEstimator) { + const existing = this.perFieldStat[fieldName]; + if (existing) { + return existing; + } + sizeEstimator.bytes += + estimatedBytesForString(fieldName) + + estimatedBytesForString(returnType) + + 10; + const fieldStat = new OurFieldStat(returnType); + this.perFieldStat[fieldName] = fieldStat; + return fieldStat; + } + ensureCountsAreIntegers() { + for (const fieldStat of Object.values(this.perFieldStat)) { + fieldStat.ensureCountsAreIntegers(); + } + } +} +class OurFieldStat { + returnType; + errorsCount = 0; + observedExecutionCount = 0; + estimatedExecutionCount = 0; + requestsWithErrorsCount = 0; + latencyCount = new durationHistogram_js_1.DurationHistogram(); + constructor(returnType) { + this.returnType = returnType; + } + ensureCountsAreIntegers() { + this.estimatedExecutionCount = Math.floor(this.estimatedExecutionCount); + } +} +function estimatedBytesForString(s) { + return 2 + Buffer.byteLength(s); +} +//# sourceMappingURL=stats.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js.map new file mode 100644 index 00000000..e9f8a72c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/stats.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/stats.ts"],"names":[],"mappings":";;;AACA,+EAY0C;AAE1C,iEAA2D;AAC3D,+DAAgF;AAiBhF,MAAa,aAAa;IACxB,KAAK,GAAG,CAAC,CAAC;CACX;AAFD,sCAEC;AACD,MAAa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aAAa,CAAC,KAAK;YACjB,uBAAuB,CAAC,SAAS,CAAC;gBAClC,uBAAuB,CAAC,UAAU,CAAC;gBACnC,EAAE,CAAC;QACL,MAAM,SAAS,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;QACzC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,uBAAuB;QACrB,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACzD,SAAS,CAAC,uBAAuB,EAAE,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AAED,MAAM,YAAY;IAUK;IATrB,WAAW,GAAG,CAAC,CAAC;IAChB,sBAAsB,GAAG,CAAC,CAAC;IAI3B,uBAAuB,GAAG,CAAC,CAAC;IAC5B,uBAAuB,GAAG,CAAC,CAAC;IAC5B,YAAY,GAAsB,IAAI,wCAAiB,EAAE,CAAC;IAE1D,YAAqB,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAE3C,uBAAuB;QAErB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC1E,CAAC;CACF;AAED,SAAS,uBAAuB,CAAC,CAAS;IAIxC,OAAO,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts new file mode 100644 index 00000000..c6a42a90 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts @@ -0,0 +1,4 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +import type { VariableValueOptions } from './options.js'; +export declare function makeTraceDetails(variables: Record, sendVariableValues?: VariableValueOptions, operationString?: string): Trace.Details; +//# sourceMappingURL=traceDetails.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts.map new file mode 100644 index 00000000..7840c142 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"traceDetails.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/traceDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASzD,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,kBAAkB,CAAC,EAAE,oBAAoB,EACzC,eAAe,CAAC,EAAE,MAAM,GACvB,KAAK,CAAC,OAAO,CA0Df"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js new file mode 100644 index 00000000..4a635c56 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeTraceDetails = makeTraceDetails; +const usage_reporting_protobuf_1 = require("@apollo/usage-reporting-protobuf"); +function makeTraceDetails(variables, sendVariableValues, operationString) { + const details = new usage_reporting_protobuf_1.Trace.Details(); + const variablesToRecord = (() => { + if (sendVariableValues && 'transform' in sendVariableValues) { + const originalKeys = Object.keys(variables); + try { + const modifiedVariables = sendVariableValues.transform({ + variables: variables, + operationString: operationString, + }); + return cleanModifiedVariables(originalKeys, modifiedVariables); + } + catch (e) { + return handleVariableValueTransformError(originalKeys); + } + } + else { + return variables; + } + })(); + Object.keys(variablesToRecord).forEach((name) => { + if (!sendVariableValues || + ('none' in sendVariableValues && sendVariableValues.none) || + ('all' in sendVariableValues && !sendVariableValues.all) || + ('exceptNames' in sendVariableValues && + sendVariableValues.exceptNames.includes(name)) || + ('onlyNames' in sendVariableValues && + !sendVariableValues.onlyNames.includes(name))) { + details.variablesJson[name] = ''; + } + else { + try { + details.variablesJson[name] = + typeof variablesToRecord[name] === 'undefined' + ? '' + : JSON.stringify(variablesToRecord[name]); + } + catch (e) { + details.variablesJson[name] = JSON.stringify('[Unable to convert value to JSON]'); + } + } + }); + return details; +} +function handleVariableValueTransformError(variableNames) { + const modifiedVariables = Object.create(null); + variableNames.forEach((name) => { + modifiedVariables[name] = '[PREDICATE_FUNCTION_ERROR]'; + }); + return modifiedVariables; +} +function cleanModifiedVariables(originalKeys, modifiedVariables) { + const cleanedVariables = Object.create(null); + originalKeys.forEach((name) => { + cleanedVariables[name] = modifiedVariables[name]; + }); + return cleanedVariables; +} +//# sourceMappingURL=traceDetails.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js.map new file mode 100644 index 00000000..bfa5b748 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/plugin/usageReporting/traceDetails.js.map @@ -0,0 +1 @@ +{"version":3,"file":"traceDetails.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/traceDetails.ts"],"names":[],"mappings":";;AAUA,4CA8DC;AAxED,+EAAyD;AAUzD,SAAgB,gBAAgB,CAC9B,SAA8B,EAC9B,kBAAyC,EACzC,eAAwB;IAExB,MAAM,OAAO,GAAG,IAAI,gCAAK,CAAC,OAAO,EAAE,CAAC;IACpC,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE;QAC9B,IAAI,kBAAkB,IAAI,WAAW,IAAI,kBAAkB,EAAE,CAAC;YAC5D,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC;gBAEH,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,SAAS,CAAC;oBACrD,SAAS,EAAE,SAAS;oBACpB,eAAe,EAAE,eAAe;iBACjC,CAAC,CAAC;gBACH,OAAO,sBAAsB,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;YACjE,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBAGX,OAAO,iCAAiC,CAAC,YAAY,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAOL,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9C,IACE,CAAC,kBAAkB;YACnB,CAAC,MAAM,IAAI,kBAAkB,IAAI,kBAAkB,CAAC,IAAI,CAAC;YACzD,CAAC,KAAK,IAAI,kBAAkB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC;YACxD,CAAC,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CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IACH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts new file mode 100644 index 00000000..33a07e37 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts @@ -0,0 +1,4 @@ +import type { HeaderMap } from './utils/HeaderMap.js'; +export declare const recommendedCsrfPreventionRequestHeaders: string[]; +export declare function preventCsrf(headers: HeaderMap, csrfPreventionRequestHeaders: string[]): void; +//# sourceMappingURL=preventCsrf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts.map new file mode 100644 index 00000000..18f238c4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"preventCsrf.d.ts","sourceRoot":"","sources":["../../src/preventCsrf.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAYtD,eAAO,MAAM,uCAAuC,UAGnD,CAAC;AA4BF,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,EAClB,4BAA4B,EAAE,MAAM,EAAE,QAmDvC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js new file mode 100644 index 00000000..43c12b52 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js @@ -0,0 +1,41 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.recommendedCsrfPreventionRequestHeaders = void 0; +exports.preventCsrf = preventCsrf; +const whatwg_mimetype_1 = __importDefault(require("whatwg-mimetype")); +const internalErrorClasses_js_1 = require("./internalErrorClasses.js"); +exports.recommendedCsrfPreventionRequestHeaders = [ + 'x-apollo-operation-name', + 'apollo-require-preflight', +]; +const NON_PREFLIGHTED_CONTENT_TYPES = [ + 'application/x-www-form-urlencoded', + 'multipart/form-data', + 'text/plain', +]; +function preventCsrf(headers, csrfPreventionRequestHeaders) { + const contentType = headers.get('content-type'); + if (contentType !== undefined) { + const contentTypeParsed = whatwg_mimetype_1.default.parse(contentType); + if (contentTypeParsed === null) { + return; + } + if (!NON_PREFLIGHTED_CONTENT_TYPES.includes(contentTypeParsed.essence)) { + return; + } + } + if (csrfPreventionRequestHeaders.some((header) => { + const value = headers.get(header); + return value !== undefined && value.length > 0; + })) { + return; + } + throw new internalErrorClasses_js_1.BadRequestError(`This operation has been blocked as a potential Cross-Site Request Forgery ` + + `(CSRF). Please either specify a 'content-type' header (with a type that ` + + `is not one of ${NON_PREFLIGHTED_CONTENT_TYPES.join(', ')}) or provide ` + + `a non-empty value for one of the following headers: ${csrfPreventionRequestHeaders.join(', ')}\n`); +} +//# sourceMappingURL=preventCsrf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js.map new file mode 100644 index 00000000..3182270a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/preventCsrf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"preventCsrf.js","sourceRoot":"","sources":["../../src/preventCsrf.ts"],"names":[],"mappings":";;;;;;AA6CA,kCAqDC;AAlGD,sEAAuC;AACvC,uEAA4D;AAa/C,QAAA,uCAAuC,GAAG;IACrD,yBAAyB;IACzB,0BAA0B;CAC3B,CAAC;AAGF,MAAM,6BAA6B,GAAG;IACpC,mCAAmC;IACnC,qBAAqB;IACrB,YAAY;CACb,CAAC;AAqBF,SAAgB,WAAW,CACzB,OAAkB,EAClB,4BAAsC;IAEtC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAOhD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,iBAAiB,GAAG,yBAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,iBAAiB,KAAK,IAAI,EAAE,CAAC;YAQ/B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC;YAKvE,OAAO;QACT,CAAC;IACH,CAAC;IAMD,IACE,4BAA4B,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC,CAAC,EACF,CAAC;QACD,OAAO;IACT,CAAC;IAED,MAAM,IAAI,yCAAe,CACvB,4EAA4E;QAC1E,0EAA0E;QAC1E,iBAAiB,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe;QACxE,uDAAuD,4BAA4B,CAAC,IAAI,CACtF,IAAI,CACL,IAAI,CACR,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts new file mode 100644 index 00000000..1d6bfb5a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts @@ -0,0 +1,9 @@ +import type { GraphQLRequestContext, BaseContext, GraphQLResponse } from './externalTypes/index.js'; +import { type ApolloServer, type ApolloServerInternals, type SchemaDerivedData } from './ApolloServer.js'; +export declare const APQ_CACHE_PREFIX = "apq:"; +type Mutable = { + -readonly [P in keyof T]: T[P]; +}; +export declare function processGraphQLRequest(schemaDerivedData: SchemaDerivedData, server: ApolloServer, internals: ApolloServerInternals, requestContext: Mutable>): Promise; +export {}; +//# sourceMappingURL=requestPipeline.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts.map new file mode 100644 index 00000000..de988818 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.d.ts","sourceRoot":"","sources":["../../src/requestPipeline.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,qBAAqB,EAUrB,WAAW,EACX,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAgB3B,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAMvC,KAAK,OAAO,CAAC,CAAC,IAAI;IAAE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AA0CrD,wBAAsB,qBAAqB,CAAC,QAAQ,SAAS,WAAW,EACtE,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAC1C,cAAc,EAAE,OAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,CAuqB1B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js new file mode 100644 index 00000000..95e934ef --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js @@ -0,0 +1,371 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.APQ_CACHE_PREFIX = void 0; +exports.processGraphQLRequest = processGraphQLRequest; +const utils_createhash_1 = require("@apollo/utils.createhash"); +const graphql_1 = require("graphql"); +const schemaInstrumentation_js_1 = require("./utils/schemaInstrumentation.js"); +const internalErrorClasses_js_1 = require("./internalErrorClasses.js"); +const errorNormalize_js_1 = require("./errorNormalize.js"); +const invokeHooks_js_1 = require("./utils/invokeHooks.js"); +const makeGatewayGraphQLRequestContext_js_1 = require("./utils/makeGatewayGraphQLRequestContext.js"); +const runHttpQuery_js_1 = require("./runHttpQuery.js"); +const ApolloServer_js_1 = require("./ApolloServer.js"); +const isDefined_js_1 = require("./utils/isDefined.js"); +const incrementalDeliveryPolyfill_js_1 = require("./incrementalDeliveryPolyfill.js"); +const HeaderMap_js_1 = require("./utils/HeaderMap.js"); +const negotiator_1 = __importDefault(require("negotiator")); +exports.APQ_CACHE_PREFIX = 'apq:'; +function computeQueryHash(query) { + return (0, utils_createhash_1.createHash)('sha256').update(query).digest('hex'); +} +function isBadUserInputGraphQLError(error) { + return (error.nodes?.length === 1 && + error.nodes[0].kind === graphql_1.Kind.VARIABLE_DEFINITION && + (error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" has invalid value`) || + error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" got invalid value `) || + error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" of required type `) || + error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" of non-null type `))); +} +async function processGraphQLRequest(schemaDerivedData, server, internals, requestContext) { + const requestListeners = (await Promise.all(internals.plugins.map((p) => p.requestDidStart?.(requestContext)))).filter(isDefined_js_1.isDefined); + const request = requestContext.request; + let { query, extensions } = request; + let queryHash; + requestContext.metrics.persistedQueryHit = false; + requestContext.metrics.persistedQueryRegister = false; + if (extensions?.persistedQuery) { + if (!internals.persistedQueries) { + return await sendErrorResponse([new internalErrorClasses_js_1.PersistedQueryNotSupportedError()]); + } + else if (extensions.persistedQuery.version !== 1) { + return await sendErrorResponse([ + new graphql_1.GraphQLError('Unsupported persisted query version', { + extensions: { http: (0, runHttpQuery_js_1.newHTTPGraphQLHead)(400) }, + }), + ]); + } + queryHash = extensions.persistedQuery.sha256Hash; + if (query === undefined) { + query = await internals.persistedQueries.cache.get(queryHash); + if (query) { + requestContext.metrics.persistedQueryHit = true; + } + else { + return await sendErrorResponse([new internalErrorClasses_js_1.PersistedQueryNotFoundError()]); + } + } + else { + const computedQueryHash = computeQueryHash(query); + if (queryHash !== computedQueryHash) { + return await sendErrorResponse([ + new graphql_1.GraphQLError('provided sha does not match query', { + extensions: { http: (0, runHttpQuery_js_1.newHTTPGraphQLHead)(400) }, + }), + ]); + } + requestContext.metrics.persistedQueryRegister = true; + } + } + else if (query) { + queryHash = computeQueryHash(query); + } + else { + return await sendErrorResponse([ + new internalErrorClasses_js_1.BadRequestError('GraphQL operations must contain a non-empty `query` or a `persistedQuery` extension.'), + ]); + } + requestContext.queryHash = queryHash; + requestContext.source = query; + await Promise.all(requestListeners.map((l) => l.didResolveSource?.(requestContext))); + if (schemaDerivedData.documentStore) { + try { + requestContext.document = await schemaDerivedData.documentStore.get(schemaDerivedData.documentStoreKeyPrefix + queryHash); + } + catch (err) { + server.logger.warn('An error occurred while attempting to read from the documentStore. ' + + (0, errorNormalize_js_1.ensureError)(err).message); + } + } + if (!requestContext.document) { + const parsingDidEnd = await (0, invokeHooks_js_1.invokeDidStartHook)(requestListeners, async (l) => l.parsingDidStart?.(requestContext)); + try { + requestContext.document = (0, graphql_1.parse)(query, internals.parseOptions); + } + catch (syntaxMaybeError) { + const error = (0, errorNormalize_js_1.ensureError)(syntaxMaybeError); + await parsingDidEnd(error); + return await sendErrorResponse([ + new internalErrorClasses_js_1.SyntaxError((0, errorNormalize_js_1.ensureGraphQLError)(error)), + ]); + } + await parsingDidEnd(); + if (internals.dangerouslyDisableValidation !== true) { + const validationDidEnd = await (0, invokeHooks_js_1.invokeDidStartHook)(requestListeners, async (l) => l.validationDidStart?.(requestContext)); + let validationErrors = (0, graphql_1.validate)(schemaDerivedData.schema, requestContext.document, [...graphql_1.specifiedRules, ...internals.validationRules], internals.validationOptions); + if (validationErrors.length === 0 && internals.laterValidationRules) { + validationErrors = (0, graphql_1.validate)(schemaDerivedData.schema, requestContext.document, internals.laterValidationRules); + } + if (validationErrors.length === 0) { + await validationDidEnd(); + } + else { + await validationDidEnd(validationErrors); + return await sendErrorResponse(validationErrors.map((error) => new internalErrorClasses_js_1.ValidationError(error))); + } + } + if (schemaDerivedData.documentStore) { + Promise.resolve(schemaDerivedData.documentStore.set(schemaDerivedData.documentStoreKeyPrefix + queryHash, requestContext.document)).catch((err) => server.logger.warn('Could not store validated document. ' + err?.message || err)); + } + } + const operation = (0, graphql_1.getOperationAST)(requestContext.document, request.operationName); + requestContext.operation = operation || undefined; + requestContext.operationName = operation?.name?.value || null; + if (request.http?.method === 'GET' && + operation?.operation && + operation.operation !== 'query') { + return await sendErrorResponse([ + new internalErrorClasses_js_1.BadRequestError(`GET requests only support query operations, not ${operation.operation} operations`, { + extensions: { + http: { status: 405, headers: new HeaderMap_js_1.HeaderMap([['allow', 'POST']]) }, + }, + }), + ]); + } + try { + await Promise.all(requestListeners.map((l) => l.didResolveOperation?.(requestContext))); + } + catch (err) { + return await sendErrorResponse([(0, errorNormalize_js_1.ensureGraphQLError)(err)]); + } + if (requestContext.metrics.persistedQueryRegister && + internals.persistedQueries) { + const ttl = internals.persistedQueries?.ttl; + Promise.resolve(internals.persistedQueries.cache.set(queryHash, query, ttl !== undefined + ? { ttl: internals.persistedQueries?.ttl } + : undefined)).catch(server.logger.warn.bind(server.logger)); + } + const responseFromPlugin = await (0, invokeHooks_js_1.invokeHooksUntilDefinedAndNonNull)(requestListeners, async (l) => await l.responseForOperation?.(requestContext)); + if (responseFromPlugin !== null) { + requestContext.response.body = responseFromPlugin.body; + (0, runHttpQuery_js_1.mergeHTTPGraphQLHead)(requestContext.response.http, responseFromPlugin.http); + } + else { + const executionListeners = (await Promise.all(requestListeners.map((l) => l.executionDidStart?.(requestContext)))).filter(isDefined_js_1.isDefined); + executionListeners.reverse(); + if (executionListeners.some((l) => l.willResolveField)) { + const invokeWillResolveField = (...args) => (0, invokeHooks_js_1.invokeSyncDidStartHook)(executionListeners, (l) => l.willResolveField?.(...args)); + Object.defineProperty(requestContext.contextValue, schemaInstrumentation_js_1.symbolExecutionDispatcherWillResolveField, { value: invokeWillResolveField }); + if (internals.fieldResolver) { + Object.defineProperty(requestContext.contextValue, schemaInstrumentation_js_1.symbolUserFieldResolver, { + value: internals.fieldResolver, + }); + } + (0, schemaInstrumentation_js_1.enablePluginsForSchemaResolvers)(schemaDerivedData.schema); + } + try { + const fullResult = await execute({ + ...requestContext, + useLegacyIncremental: new negotiator_1.default({ + headers: { accept: request.http?.headers.get('accept') }, + }).mediaType([ + ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + ]) === ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + }); + const result = 'singleResult' in fullResult + ? fullResult.singleResult + : fullResult.initialResult; + if (!requestContext.operation) { + if (!result.errors?.length) { + throw new Error('Unexpected error: Apollo Server did not resolve an operation but execute did not return errors'); + } + throw new internalErrorClasses_js_1.OperationResolutionError(result.errors[0]); + } + const resultErrors = result.errors?.map((e) => { + if (isBadUserInputGraphQLError(e) && e.extensions?.code == null) { + return new internalErrorClasses_js_1.UserInputError(e); + } + return e; + }); + if (resultErrors) { + await didEncounterErrors(resultErrors); + } + const { formattedErrors, httpFromErrors } = resultErrors + ? formatErrors(resultErrors) + : { formattedErrors: undefined, httpFromErrors: (0, runHttpQuery_js_1.newHTTPGraphQLHead)() }; + if (internals.status400ForVariableCoercionErrors && + resultErrors?.length && + result.data === undefined && + !httpFromErrors.status) { + httpFromErrors.status = 400; + } + (0, runHttpQuery_js_1.mergeHTTPGraphQLHead)(requestContext.response.http, httpFromErrors); + if ('singleResult' in fullResult) { + requestContext.response.body = { + kind: 'single', + singleResult: { + ...result, + errors: formattedErrors, + }, + }; + } + else { + requestContext.response.body = { + kind: 'incremental', + initialResult: { + ...fullResult.initialResult, + errors: formattedErrors, + }, + subsequentResults: fullResult.subsequentResults, + }; + } + } + catch (executionMaybeError) { + const executionError = (0, errorNormalize_js_1.ensureError)(executionMaybeError); + await Promise.all(executionListeners.map((l) => l.executionDidEnd?.(executionError))); + return await sendErrorResponse([(0, errorNormalize_js_1.ensureGraphQLError)(executionError)]); + } + await Promise.all(executionListeners.map((l) => l.executionDidEnd?.())); + } + await invokeWillSendResponse(); + if (!requestContext.response.body) { + throw Error('got to end of processGraphQLRequest without setting body?'); + } + return requestContext.response; + async function execute({ useLegacyIncremental, ...requestContext }) { + const { request, document } = requestContext; + if (internals.__testing_incrementalExecutionResults) { + return internals.__testing_incrementalExecutionResults; + } + else if (internals.gatewayExecutor) { + const result = await internals.gatewayExecutor((0, makeGatewayGraphQLRequestContext_js_1.makeGatewayGraphQLRequestContext)(requestContext, server, internals)); + return { singleResult: result }; + } + else { + const resultOrResults = await (0, incrementalDeliveryPolyfill_js_1.executeIncrementally)({ + schema: schemaDerivedData.schema, + document, + rootValue: typeof internals.rootValue === 'function' + ? internals.rootValue(document) + : internals.rootValue, + contextValue: requestContext.contextValue, + variableValues: request.variables, + operationName: request.operationName, + fieldResolver: internals.fieldResolver, + useLegacyIncremental, + options: internals.executionOptions, + legacyExperimentalExecuteIncrementally: internals.legacyExperimentalExecuteIncrementally, + }); + if ('initialResult' in resultOrResults) { + return { + initialResult: resultOrResults.initialResult, + subsequentResults: 'pending' in resultOrResults.initialResult + ? formatErrorsInSubsequentResultsAlpha9(resultOrResults.subsequentResults) + : formatErrorsInSubsequentResultsAlpha2(resultOrResults.subsequentResults), + }; + } + else { + return { singleResult: resultOrResults }; + } + } + } + async function* formatErrorsInSubsequentResultsAlpha2(results) { + for await (const result of results) { + const payload = result.incremental + ? { + ...result, + incremental: await seriesAsyncMap(result.incremental, async (incrementalResult) => { + const { errors } = incrementalResult; + if (errors) { + await Promise.all(requestListeners.map((l) => l.didEncounterSubsequentErrors?.(requestContext, errors))); + return { + ...incrementalResult, + errors: formatErrors(errors).formattedErrors, + }; + } + return incrementalResult; + }), + } + : result; + await Promise.all(requestListeners.map((l) => l.willSendSubsequentPayload?.(requestContext, payload))); + yield payload; + } + } + async function* formatErrorsInSubsequentResultsAlpha9(results) { + for await (const result of results) { + const payload = result.incremental + ? { + ...result, + incremental: await seriesAsyncMap(result.incremental, async (incrementalResult) => { + const { errors } = incrementalResult; + if (errors) { + await Promise.all(requestListeners.map((l) => l.didEncounterSubsequentErrors?.(requestContext, errors))); + return { + ...incrementalResult, + errors: formatErrors(errors).formattedErrors, + }; + } + return incrementalResult; + }), + } + : result; + if (result.completed) { + payload.completed = await seriesAsyncMap(result.completed, async (completedResult) => { + const { errors } = completedResult; + if (errors) { + await Promise.all(requestListeners.map((l) => l.didEncounterSubsequentErrors?.(requestContext, errors))); + return { + ...completedResult, + errors: formatErrors(errors).formattedErrors, + }; + } + return completedResult; + }); + } + await Promise.all(requestListeners.map((l) => l.willSendSubsequentPayload?.(requestContext, payload))); + yield payload; + } + } + async function invokeWillSendResponse() { + await Promise.all(requestListeners.map((l) => l.willSendResponse?.(requestContext))); + } + async function didEncounterErrors(errors) { + requestContext.errors = errors; + return await Promise.all(requestListeners.map((l) => l.didEncounterErrors?.(requestContext))); + } + async function sendErrorResponse(errors) { + await didEncounterErrors(errors); + const { formattedErrors, httpFromErrors } = formatErrors(errors); + requestContext.response.body = { + kind: 'single', + singleResult: { + errors: formattedErrors, + }, + }; + (0, runHttpQuery_js_1.mergeHTTPGraphQLHead)(requestContext.response.http, httpFromErrors); + if (!requestContext.response.http.status) { + requestContext.response.http.status = 500; + } + await invokeWillSendResponse(); + return requestContext.response; + } + function formatErrors(errors) { + return (0, errorNormalize_js_1.normalizeAndFormatErrors)(errors, { + formatError: internals.formatError, + includeStacktraceInErrorResponses: internals.includeStacktraceInErrorResponses, + }); + } +} +async function seriesAsyncMap(ts, fn) { + const us = []; + for (const t of ts) { + const u = await fn(t); + us.push(u); + } + return us; +} +//# sourceMappingURL=requestPipeline.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js.map new file mode 100644 index 00000000..f0a05ecc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/requestPipeline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.js","sourceRoot":"","sources":["../../src/requestPipeline.ts"],"names":[],"mappings":";;;;;;AA4HA,sDA4qBC;AAxyBD,+DAAsD;AACtD,qCAQiB;AACjB,+EAI0C;AAC1C,uEAQmC;AACnC,2DAI6B;AAkB7B,2DAIgC;AAEhC,qGAA+F;AAE/F,uDAA6E;AAC7E,uDAK2B;AAC3B,uDAAiD;AAKjD,qFAM0C;AAC1C,uDAAiD;AACjD,4DAAoC;AAEvB,QAAA,gBAAgB,GAAG,MAAM,CAAC;AAEvC,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,IAAA,6BAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAOD,SAAS,0BAA0B,CAAC,KAAmB;IACrD,OAAO,CACL,KAAK,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC;QACzB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,cAAI,CAAC,mBAAmB;QAEhD,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CACvB,cAAc,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,qBAAqB,CACtE;YAEC,KAAK,CAAC,OAAO,CAAC,UAAU,CACtB,cAAc,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,sBAAsB,CACvE;YACD,KAAK,CAAC,OAAO,CAAC,UAAU,CACtB,cAAc,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,qBAAqB,CACtE;YAC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SACF,CAAC;QAEF,IAAA,sCAAoB,EAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAEnE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACzC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAC5C,CAAC;QAED,MAAM,sBAAsB,EAAE,CAAC;QAG/B,OAAO,cAAc,CAAC,QAA2B,CAAC;IACpD,CAAC;IAED,SAAS,YAAY,CACnB,MAAmC;QAEnC,OAAO,IAAA,4CAAwB,EAAC,MAAM,EAAE;YACtC,WAAW,EAAE,SAAS,CAAC,WAAW;YAClC,iCAAiC,EAC/B,SAAS,CAAC,iCAAiC;SAC9C,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,EAAgB,EAChB,EAA4B;IAE5B,MAAM,EAAE,GAAQ,EAAE,CAAC;IACnB,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QACtB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACb,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts new file mode 100644 index 00000000..d7fbe461 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts @@ -0,0 +1,15 @@ +import type { BaseContext, HTTPGraphQLHead, HTTPGraphQLRequest, HTTPGraphQLResponse } from './externalTypes/index.js'; +import { type ApolloServer, type ApolloServerInternals, type SchemaDerivedData } from './ApolloServer.js'; +import { type FormattedExecutionResult } from 'graphql'; +export declare function runHttpQuery({ server, httpRequest, contextValue, schemaDerivedData, internals, sharedResponseHTTPGraphQLHead, }: { + server: ApolloServer; + httpRequest: HTTPGraphQLRequest; + contextValue: TContext; + schemaDerivedData: SchemaDerivedData; + internals: ApolloServerInternals; + sharedResponseHTTPGraphQLHead: HTTPGraphQLHead | null; +}): Promise; +export declare function prettyJSONStringify(value: FormattedExecutionResult): string; +export declare function newHTTPGraphQLHead(status?: number): HTTPGraphQLHead; +export declare function mergeHTTPGraphQLHead(target: HTTPGraphQLHead, source: HTTPGraphQLHead): void; +//# sourceMappingURL=runHttpQuery.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts.map new file mode 100644 index 00000000..ef24db42 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"runHttpQuery.d.ts","sourceRoot":"","sources":["../../src/runHttpQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EAMX,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAI1B,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,wBAAwB,EAAQ,MAAM,SAAS,CAAC;AAkG9D,wBAAsB,YAAY,CAAC,QAAQ,SAAS,WAAW,EAAE,EAC/D,MAAM,EACN,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,6BAA6B,GAC9B,EAAE;IACD,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC/B,WAAW,EAAE,kBAAkB,CAAC;IAChC,YAAY,EAAE,QAAQ,CAAC;IACvB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC3C,6BAA6B,EAAE,eAAe,GAAG,IAAI,CAAC;CACvD,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA6M/B;AA2CD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,UAElE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAKnE;AAKD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,eAAe,QAYxB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js new file mode 100644 index 00000000..0599092a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js @@ -0,0 +1,230 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.runHttpQuery = runHttpQuery; +exports.prettyJSONStringify = prettyJSONStringify; +exports.newHTTPGraphQLHead = newHTTPGraphQLHead; +exports.mergeHTTPGraphQLHead = mergeHTTPGraphQLHead; +const ApolloServer_js_1 = require("./ApolloServer.js"); +const graphql_1 = require("graphql"); +const internalErrorClasses_js_1 = require("./internalErrorClasses.js"); +const negotiator_1 = __importDefault(require("negotiator")); +const HeaderMap_js_1 = require("./utils/HeaderMap.js"); +const whatwg_mimetype_1 = __importDefault(require("whatwg-mimetype")); +function fieldIfString(o, fieldName) { + const value = o[fieldName]; + if (typeof value === 'string') { + return value; + } + return undefined; +} +function searchParamIfSpecifiedOnce(searchParams, paramName) { + const values = searchParams.getAll(paramName); + switch (values.length) { + case 0: + return undefined; + case 1: + return values[0]; + default: + throw new internalErrorClasses_js_1.BadRequestError(`The '${paramName}' search parameter may only be specified once.`); + } +} +function jsonParsedSearchParamIfSpecifiedOnce(searchParams, fieldName) { + const value = searchParamIfSpecifiedOnce(searchParams, fieldName); + if (value === undefined) { + return undefined; + } + let hopefullyRecord; + try { + hopefullyRecord = JSON.parse(value); + } + catch { + throw new internalErrorClasses_js_1.BadRequestError(`The ${fieldName} search parameter contains invalid JSON.`); + } + if (!isStringRecord(hopefullyRecord)) { + throw new internalErrorClasses_js_1.BadRequestError(`The ${fieldName} search parameter should contain a JSON-encoded object.`); + } + return hopefullyRecord; +} +function fieldIfRecord(o, fieldName) { + const value = o[fieldName]; + if (isStringRecord(value)) { + return value; + } + return undefined; +} +function isStringRecord(o) { + return (!!o && typeof o === 'object' && !Buffer.isBuffer(o) && !Array.isArray(o)); +} +function isNonEmptyStringRecord(o) { + return isStringRecord(o) && Object.keys(o).length > 0; +} +function ensureQueryIsStringOrMissing(query) { + if (!query || typeof query === 'string') { + return; + } + if (query.kind === graphql_1.Kind.DOCUMENT) { + throw new internalErrorClasses_js_1.BadRequestError("GraphQL queries must be strings. It looks like you're sending the " + + 'internal graphql-js representation of a parsed query in your ' + + 'request instead of a request in the GraphQL query language. You ' + + 'can convert an AST to a string using the `print` function from ' + + '`graphql`, or use a client like `apollo-client` which converts ' + + 'the internal representation to a string for you.'); + } + else { + throw new internalErrorClasses_js_1.BadRequestError('GraphQL queries must be strings.'); + } +} +async function runHttpQuery({ server, httpRequest, contextValue, schemaDerivedData, internals, sharedResponseHTTPGraphQLHead, }) { + let graphQLRequest; + switch (httpRequest.method) { + case 'POST': { + if (!isNonEmptyStringRecord(httpRequest.body)) { + throw new internalErrorClasses_js_1.BadRequestError('POST body missing, invalid Content-Type, or JSON object has no keys.'); + } + ensureQueryIsStringOrMissing(httpRequest.body.query); + if (typeof httpRequest.body.variables === 'string') { + throw new internalErrorClasses_js_1.BadRequestError('`variables` in a POST body should be provided as an object, not a recursively JSON-encoded string.'); + } + if (typeof httpRequest.body.extensions === 'string') { + throw new internalErrorClasses_js_1.BadRequestError('`extensions` in a POST body should be provided as an object, not a recursively JSON-encoded string.'); + } + if ('extensions' in httpRequest.body && + httpRequest.body.extensions !== null && + !isStringRecord(httpRequest.body.extensions)) { + throw new internalErrorClasses_js_1.BadRequestError('`extensions` in a POST body must be an object if provided.'); + } + if ('variables' in httpRequest.body && + httpRequest.body.variables !== null && + !isStringRecord(httpRequest.body.variables)) { + throw new internalErrorClasses_js_1.BadRequestError('`variables` in a POST body must be an object if provided.'); + } + if ('operationName' in httpRequest.body && + httpRequest.body.operationName !== null && + typeof httpRequest.body.operationName !== 'string') { + throw new internalErrorClasses_js_1.BadRequestError('`operationName` in a POST body must be a string if provided.'); + } + graphQLRequest = { + query: fieldIfString(httpRequest.body, 'query'), + operationName: fieldIfString(httpRequest.body, 'operationName'), + variables: fieldIfRecord(httpRequest.body, 'variables'), + extensions: fieldIfRecord(httpRequest.body, 'extensions'), + http: httpRequest, + }; + break; + } + case 'GET': { + const contentType = httpRequest.headers.get('content-type'); + if (contentType !== undefined) { + const contentTypeParsed = whatwg_mimetype_1.default.parse(contentType); + if (contentTypeParsed === null || + contentTypeParsed.essence !== 'application/json') { + throw new internalErrorClasses_js_1.BadRequestError('GET requests may not have a content-type header other than application/json.', { extensions: { http: newHTTPGraphQLHead(415) } }); + } + } + const searchParams = new URLSearchParams(httpRequest.search); + graphQLRequest = { + query: searchParamIfSpecifiedOnce(searchParams, 'query'), + operationName: searchParamIfSpecifiedOnce(searchParams, 'operationName'), + variables: jsonParsedSearchParamIfSpecifiedOnce(searchParams, 'variables'), + extensions: jsonParsedSearchParamIfSpecifiedOnce(searchParams, 'extensions'), + http: httpRequest, + }; + break; + } + default: + throw new internalErrorClasses_js_1.BadRequestError('Apollo Server supports only GET/POST requests.', { + extensions: { + http: { + status: 405, + headers: new HeaderMap_js_1.HeaderMap([['allow', 'GET, POST']]), + }, + }, + }); + } + const graphQLResponse = await (0, ApolloServer_js_1.internalExecuteOperation)({ + server, + graphQLRequest, + internals, + schemaDerivedData, + sharedResponseHTTPGraphQLHead, + }, { contextValue }); + if (graphQLResponse.body.kind === 'single') { + if (!graphQLResponse.http.headers.get('content-type')) { + const contentType = (0, ApolloServer_js_1.chooseContentTypeForSingleResultResponse)(httpRequest); + if (contentType === null) { + throw new internalErrorClasses_js_1.BadRequestError(`An 'accept' header was provided for this request which does not accept ` + + `${ApolloServer_js_1.MEDIA_TYPES.APPLICATION_JSON} or ${ApolloServer_js_1.MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON}`, { extensions: { http: { status: 406 } } }); + } + graphQLResponse.http.headers.set('content-type', contentType); + } + return { + ...graphQLResponse.http, + body: { + kind: 'complete', + string: await internals.stringifyResult(orderExecutionResultFields(graphQLResponse.body.singleResult)), + }, + }; + } + const acceptHeader = httpRequest.headers.get('accept'); + const negotiator = new negotiator_1.default({ headers: { accept: acceptHeader } }); + const preferredMediaType = negotiator.mediaType([ + ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_NO_DEFER_SPEC, + ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + ]); + if (!acceptHeader || + (preferredMediaType !== ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2 && + preferredMediaType !== ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9)) { + throw new internalErrorClasses_js_1.BadRequestError('Apollo server received an operation that uses incremental delivery ' + + '(@defer or @stream), but the client does not accept multipart/mixed ' + + 'HTTP responses. To enable incremental delivery support, add the HTTP ' + + `header 'Accept: ${ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' ` + + 'if your client supports the current incremental format or ' + + `'Accept: ${ApolloServer_js_1.MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2}' if your ` + + 'client supports the legacy incremental format', { extensions: { http: { status: 406 } } }); + } + graphQLResponse.http.headers.set('content-type', `multipart/mixed; boundary="-"; ${preferredMediaType.replace('multipart/mixed; ', '')}`); + return { + ...graphQLResponse.http, + body: { + kind: 'chunked', + asyncIterator: writeMultipartBody(graphQLResponse.body.initialResult, graphQLResponse.body.subsequentResults), + }, + }; +} +async function* writeMultipartBody(initialResult, subsequentResults) { + yield `\r\n---\r\ncontent-type: application/json; charset=utf-8\r\n\r\n${JSON.stringify(initialResult)}\r\n---${initialResult.hasNext ? '' : '--'}\r\n`; + for await (const result of subsequentResults) { + yield `content-type: application/json; charset=utf-8\r\n\r\n${JSON.stringify(result)}\r\n---${result.hasNext ? '' : '--'}\r\n`; + } +} +function orderExecutionResultFields(result) { + return { + errors: result.errors, + data: result.data, + extensions: result.extensions, + }; +} +function prettyJSONStringify(value) { + return JSON.stringify(value) + '\n'; +} +function newHTTPGraphQLHead(status) { + return { + status, + headers: new HeaderMap_js_1.HeaderMap(), + }; +} +function mergeHTTPGraphQLHead(target, source) { + if (source.status) { + target.status = source.status; + } + if (source.headers) { + for (const [name, value] of source.headers) { + target.headers.set(name, value); + } + } +} +//# sourceMappingURL=runHttpQuery.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js.map new file mode 100644 index 00000000..d49a396f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/runHttpQuery.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runHttpQuery.js","sourceRoot":"","sources":["../../src/runHttpQuery.ts"],"names":[],"mappings":";;;;;AAqHA,oCA2NC;AA2CD,kDAEC;AAED,gDAKC;AAKD,oDAcC;AA5YD,uDAO2B;AAC3B,qCAA8D;AAC9D,uEAA4D;AAC5D,4DAAoC;AACpC,uDAAiD;AACjD,sEAAuC;AAEvC,SAAS,aAAa,CACpB,CAA0B,EAC1B,SAAiB;IAEjB,MAAM,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,0BAA0B,CACjC,YAA6B,EAC7B,SAAiB;IAEjB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,CAAC;YACJ,OAAO,SAAS,CAAC;QACnB,KAAK,CAAC;YACJ,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB;YACE,MAAM,IAAI,yCAAe,CACvB,QAAQ,SAAS,gDAAgD,CAClE,CAAC;IACN,CAAC;AACH,CAAC;AAED,SAAS,oCAAoC,CAC3C,YAA6B,EAC7B,SAAiB;IAEjB,MAAM,KAAK,GAAG,0BAA0B,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAClE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,eAAe,CAAC;IACpB,IAAI,CAAC;QACH,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,yCAAe,CACvB,OAA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ollo/server/dist/cjs/standalone/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.d.ts new file mode 100644 index 00000000..3e0a5443 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.d.ts @@ -0,0 +1,25 @@ +import type { WithRequired } from '@apollo/utils.withrequired'; +import { type IncomingMessage, type ServerResponse } from 'http'; +import type { ListenOptions } from 'net'; +import type { ApolloServer } from '../ApolloServer.js'; +import type { BaseContext, ContextFunction } from '../externalTypes/index.js'; +export interface StandaloneServerContextFunctionArgument { + req: IncomingMessage; + res: ServerResponse; +} +export interface StartStandaloneServerOptions { + context?: ContextFunction<[ + StandaloneServerContextFunctionArgument + ], TContext>; +} +export declare function startStandaloneServer(server: ApolloServer, options?: StartStandaloneServerOptions & { + listen?: ListenOptions; +}): Promise<{ + url: string; +}>; +export declare function startStandaloneServer(server: ApolloServer, options: WithRequired, 'context'> & { + listen?: ListenOptions; +}): Promise<{ + url: string; +}>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.d.ts.map new file mode 100644 index 00000000..b4b3bb3e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/standalone/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAa,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AAMnC,MAAM,WAAW,uCAAuC;IACtD,GAAG,EAAE,eAAe,CAAC;IACrB,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B,CAAC,QAAQ,SAAS,WAAW;IACxE,OAAO,CAAC,EAAE,eAAe,CACvB;QAAC,uCAAuC;KAAC,EACzC,QAAQ,CACT,CAAC;CACH;AAQD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC,EACjC,OAAO,CAAC,EAAE,4BAA4B,CAAC,WAAW,CAAC,GAAG;IACpD,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GACA,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC5B,wBAAsB,qBAAqB,CAAC,QAAQ,SAAS,WAAW,EACtE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,OAAO,EAAE,YAAY,CAAC,4BAA4B,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,GAAG;IACzE,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GACA,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js new file mode 100644 index 00000000..243d4c19 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js @@ -0,0 +1,97 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.startStandaloneServer = startStandaloneServer; +const cors_1 = __importDefault(require("cors")); +const body_parser_1 = __importDefault(require("body-parser")); +const content_type_1 = require("content-type"); +const http_1 = __importDefault(require("http")); +const url_1 = require("url"); +const index_js_1 = require("../plugin/drainHttpServer/index.js"); +const urlForHttpServer_js_1 = require("../utils/urlForHttpServer.js"); +const HeaderMap_js_1 = require("../utils/HeaderMap.js"); +const finalhandler_1 = __importDefault(require("finalhandler")); +const validCharset = /^utf-(8|((16|32)(le|be)?))$/i; +async function startStandaloneServer(server, options) { + const context = options?.context ?? (async () => ({})); + const corsHandler = (0, cors_1.default)(); + const jsonHandler = body_parser_1.default.json({ + verify(req) { + const charset = (0, content_type_1.parse)(req).parameters.charset || 'utf-8'; + if (!charset.match(validCharset)) { + throw Object.assign(new Error(`unsupported charset "${charset.toUpperCase()}"`), { + status: 415, + name: 'UnsupportedMediaTypeError', + charset, + type: 'charset.unsupported', + }); + } + }, + limit: '50mb', + }); + const httpServer = http_1.default.createServer((req, res) => { + const errorHandler = (0, finalhandler_1.default)(req, res, { + onerror(err) { + if (process.env.NODE_ENV !== 'test') { + console.error(err.stack || err.toString()); + } + }, + }); + corsHandler(req, res, (err) => { + if (err) { + errorHandler(err); + return; + } + jsonHandler(req, res, (err) => { + if (err) { + errorHandler(err); + return; + } + const headers = new HeaderMap_js_1.HeaderMap(); + for (const [key, value] of Object.entries(req.headers)) { + if (value !== undefined) { + headers.set(key, Array.isArray(value) ? value.join(', ') : value); + } + } + const httpGraphQLRequest = { + method: req.method.toUpperCase(), + headers, + search: (0, url_1.parse)(req.url).search ?? '', + body: 'body' in req ? req.body : undefined, + }; + server + .executeHTTPGraphQLRequest({ + httpGraphQLRequest, + context: () => context({ req, res }), + }) + .then(async (httpGraphQLResponse) => { + for (const [key, value] of httpGraphQLResponse.headers) { + res.setHeader(key, value); + } + res.statusCode = httpGraphQLResponse.status || 200; + if (httpGraphQLResponse.body.kind === 'complete') { + res.end(httpGraphQLResponse.body.string); + return; + } + for await (const chunk of httpGraphQLResponse.body.asyncIterator) { + res.write(chunk); + } + res.end(); + }) + .catch((err) => { + errorHandler(err); + }); + }); + }); + }); + server.addPlugin((0, index_js_1.ApolloServerPluginDrainHttpServer)({ httpServer: httpServer })); + await server.start(); + const listenOptions = options?.listen ?? { port: 4000 }; + await new Promise((resolve) => { + httpServer.listen(listenOptions, resolve); + }); + return { url: (0, urlForHttpServer_js_1.urlForHttpServer)(httpServer) }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js.map new file mode 100644 index 00000000..75907139 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/standalone/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/standalone/index.ts"],"names":[],"mappings":";;;;;AAgDA,sDA0GC;AAzJD,gDAAwB;AACxB,8DAAqC;AACrC,+CAAyD;AACzD,gDAAuE;AAEvE,6BAAwC;AAOxC,iEAAuF;AACvF,sEAAgE;AAChE,wDAAkD;AAClD,gEAAwC;AAkBxC,MAAM,YAAY,GAAG,8BAA8B,CAAC;AAc7C,KAAK,UAAU,qBAAqB,CACzC,MAA8B,EAC9B,OAA6E;IAE7E,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAa,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,IAAA,cAAI,GAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,qBAAU,CAAC,IAAI,CAAC;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BAED,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,mBAAmB,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;wBACjE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACnB,CAAC;oBACD,GAAG,CAAC,GAAG,EAAE,CAAC;gBACZ,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;oBACb,YAAY,CAAC,GAAG,CAAC,CAAC;gBACpB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,SAAS,CACd,IAAA,4CAAiC,EAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAC9D,CAAC;IAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,MAAM,aAAa,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAExD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,UAAU,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,EAAE,IAAA,sCAAgB,EAAC,UAAU,CAAC,EAAE,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts new file mode 100644 index 00000000..e73267f8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts @@ -0,0 +1,8 @@ +export declare class HeaderMap extends Map { + private __identity; + set(key: string, value: string): this; + get(key: string): string | undefined; + delete(key: string): boolean; + has(key: string): boolean; +} +//# sourceMappingURL=HeaderMap.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts.map new file mode 100644 index 00000000..5852558a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"HeaderMap.d.ts","sourceRoot":"","sources":["../../../src/utils/HeaderMap.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAIhD,OAAO,CAAC,UAAU,CAAuB;IAEhC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIrC,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,GAAG,CAAC,GAAG,EAAE,MAAM;CAGzB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js new file mode 100644 index 00000000..3dbda6e9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HeaderMap = void 0; +class HeaderMap extends Map { + __identity = Symbol('HeaderMap'); + set(key, value) { + return super.set(key.toLowerCase(), value); + } + get(key) { + return super.get(key.toLowerCase()); + } + delete(key) { + return super.delete(key.toLowerCase()); + } + has(key) { + return super.has(key.toLowerCase()); + } +} +exports.HeaderMap = HeaderMap; +//# sourceMappingURL=HeaderMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js.map new file mode 100644 index 00000000..858e2104 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/HeaderMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HeaderMap.js","sourceRoot":"","sources":["../../../src/utils/HeaderMap.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAU,SAAQ,GAAmB;IAIxC,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAEhC,GAAG,CAAC,GAAW,EAAE,KAAa;QACrC,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAEQ,GAAG,CAAC,GAAW;QACtB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACtC,CAAC;IAEQ,MAAM,CAAC,GAAW;QACzB,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACzC,CAAC;IAEQ,GAAG,CAAC,GAAW;QACtB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACtC,CAAC;CACF;AArBD,8BAqBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts new file mode 100644 index 00000000..447bc92b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts @@ -0,0 +1,4 @@ +export declare class UnreachableCaseError extends Error { + constructor(val: never); +} +//# sourceMappingURL=UnreachableCaseError.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts.map new file mode 100644 index 00000000..8f542822 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"UnreachableCaseError.d.ts","sourceRoot":"","sources":["../../../src/utils/UnreachableCaseError.ts"],"names":[],"mappings":"AAKA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,GAAG,EAAE,KAAK;CAGvB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js new file mode 100644 index 00000000..35f06c0b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnreachableCaseError = void 0; +class UnreachableCaseError extends Error { + constructor(val) { + super(`Unreachable case: ${val}`); + } +} +exports.UnreachableCaseError = UnreachableCaseError; +//# sourceMappingURL=UnreachableCaseError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js.map new file mode 100644 index 00000000..7a52e9bf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/UnreachableCaseError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UnreachableCaseError.js","sourceRoot":"","sources":["../../../src/utils/UnreachableCaseError.ts"],"names":[],"mappings":";;;AAKA,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,GAAU;QACpB,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IACpC,CAAC;CACF;AAJD,oDAIC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts new file mode 100644 index 00000000..74ce9c39 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts @@ -0,0 +1,2 @@ +export declare function computeCoreSchemaHash(schema: string): string; +//# sourceMappingURL=computeCoreSchemaHash.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts.map new file mode 100644 index 00000000..94ad4a8f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"computeCoreSchemaHash.d.ts","sourceRoot":"","sources":["../../../src/utils/computeCoreSchemaHash.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js new file mode 100644 index 00000000..2e66ec06 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.computeCoreSchemaHash = computeCoreSchemaHash; +const utils_createhash_1 = require("@apollo/utils.createhash"); +function computeCoreSchemaHash(schema) { + return (0, utils_createhash_1.createHash)('sha256').update(schema).digest('hex'); +} +//# sourceMappingURL=computeCoreSchemaHash.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js.map new file mode 100644 index 00000000..5c09bbd1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/computeCoreSchemaHash.js.map @@ -0,0 +1 @@ +{"version":3,"file":"computeCoreSchemaHash.js","sourceRoot":"","sources":["../../../src/utils/computeCoreSchemaHash.ts"],"names":[],"mappings":";;AAMA,sDAEC;AARD,+DAAsD;AAMtD,SAAgB,qBAAqB,CAAC,MAAc;IAClD,OAAO,IAAA,6BAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts new file mode 100644 index 00000000..1893622c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts @@ -0,0 +1,7 @@ +type AsyncDidEndHook = (...args: TArgs) => Promise; +type SyncDidEndHook = (...args: TArgs) => void; +export declare function invokeDidStartHook(targets: T[], hook: (t: T) => Promise | undefined | void>): Promise>; +export declare function invokeSyncDidStartHook(targets: T[], hook: (t: T) => SyncDidEndHook | undefined | void): SyncDidEndHook; +export declare function invokeHooksUntilDefinedAndNonNull(targets: T[], hook: (t: T) => Promise): Promise; +export {}; +//# sourceMappingURL=invokeHooks.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts.map new file mode 100644 index 00000000..acd49d56 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"invokeHooks.d.ts","sourceRoot":"","sources":["../../../src/utils/invokeHooks.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,CAAC,KAAK,SAAS,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9E,KAAK,cAAc,CAAC,KAAK,SAAS,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;AAEpE,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,YAAY,SAAS,OAAO,EAAE,EACxE,OAAO,EAAE,CAAC,EAAE,EACZ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,GACxE,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAYxC;AAID,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,YAAY,SAAS,OAAO,EAAE,EACtE,OAAO,EAAE,CAAC,EAAE,EACZ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,cAAc,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,IAAI,GAC9D,cAAc,CAAC,YAAY,CAAC,CAY9B;AAED,wBAAsB,iCAAiC,CAAC,CAAC,EAAE,IAAI,EAC7D,OAAO,EAAE,CAAC,EAAE,EACZ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,GAC/C,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAQtB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js new file mode 100644 index 00000000..4bd0a3cb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.invokeDidStartHook = invokeDidStartHook; +exports.invokeSyncDidStartHook = invokeSyncDidStartHook; +exports.invokeHooksUntilDefinedAndNonNull = invokeHooksUntilDefinedAndNonNull; +const isDefined_js_1 = require("./isDefined.js"); +async function invokeDidStartHook(targets, hook) { + const didEndHooks = (await Promise.all(targets.map((target) => hook(target)))).filter(isDefined_js_1.isDefined); + didEndHooks.reverse(); + return async (...args) => { + for (const didEndHook of didEndHooks) { + didEndHook(...args); + } + }; +} +function invokeSyncDidStartHook(targets, hook) { + const didEndHooks = targets + .map((target) => hook(target)) + .filter(isDefined_js_1.isDefined); + didEndHooks.reverse(); + return (...args) => { + for (const didEndHook of didEndHooks) { + didEndHook(...args); + } + }; +} +async function invokeHooksUntilDefinedAndNonNull(targets, hook) { + for (const target of targets) { + const value = await hook(target); + if (value != null) { + return value; + } + } + return null; +} +//# sourceMappingURL=invokeHooks.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js.map new file mode 100644 index 00000000..a8a83269 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/invokeHooks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"invokeHooks.js","sourceRoot":"","sources":["../../../src/utils/invokeHooks.ts"],"names":[],"mappings":";;AAKA,gDAeC;AAID,wDAeC;AAED,8EAWC;AApDD,iDAA2C;AAKpC,KAAK,UAAU,kBAAkB,CACtC,OAAY,EACZ,IAAyE;IAEzE,MAAM,WAAW,GAAG,CAClB,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACzD,CAAC,MAAM,CAAC,wBAAS,CAAC,CAAC;IAEpB,WAAW,CAAC,OAAO,EAAE,CAAC;IAEtB,OAAO,KAAK,EAAE,GAAG,IAAkB,EAAE,EAAE;QACrC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAID,SAAgB,sBAAsB,CACpC,OAAY,EACZ,IAA+D;IAE/D,MAAM,WAAW,GAAmC,OAAO;SACxD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B,MAAM,CAAC,wBAAS,CAAC,CAAC;IAErB,WAAW,CAAC,OAAO,EAAE,CAAC;IAEtB,OAAO,CAAC,GAAG,IAAkB,EAAE,EAAE;QAC/B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,iCAAiC,CACrD,OAAY,EACZ,IAAgD;IAEhD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts new file mode 100644 index 00000000..1465990a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts @@ -0,0 +1,2 @@ +export declare function isDefined(t: T | undefined | null | void): t is T; +//# sourceMappingURL=isDefined.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts.map new file mode 100644 index 00000000..5d4f31b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isDefined.d.ts","sourceRoot":"","sources":["../../../src/utils/isDefined.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAEnE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js new file mode 100644 index 00000000..c3a6b18a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isDefined = isDefined; +function isDefined(t) { + return t != null; +} +//# sourceMappingURL=isDefined.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js.map new file mode 100644 index 00000000..c0fcc13f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/isDefined.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isDefined.js","sourceRoot":"","sources":["../../../src/utils/isDefined.ts"],"names":[],"mappings":";;AAAA,8BAEC;AAFD,SAAgB,SAAS,CAAI,CAA8B;IACzD,OAAO,CAAC,IAAI,IAAI,CAAC;AACnB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts new file mode 100644 index 00000000..b6df59d3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts @@ -0,0 +1,5 @@ +import type { GatewayGraphQLRequestContext } from '@apollo/server-gateway-interface'; +import type { ApolloServer, ApolloServerInternals } from '../ApolloServer'; +import type { BaseContext, GraphQLRequestContextExecutionDidStart } from '../externalTypes'; +export declare function makeGatewayGraphQLRequestContext(newRequestContext: GraphQLRequestContextExecutionDidStart, server: ApolloServer, internals: ApolloServerInternals): GatewayGraphQLRequestContext; +//# sourceMappingURL=makeGatewayGraphQLRequestContext.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts.map new file mode 100644 index 00000000..bc395b76 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"makeGatewayGraphQLRequestContext.d.ts","sourceRoot":"","sources":["../../../src/utils/makeGatewayGraphQLRequestContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,4BAA4B,EAG7B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EACV,WAAW,EACX,sCAAsC,EACvC,MAAM,kBAAkB,CAAC;AAyE1B,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,WAAW,EAC3E,iBAAiB,EAAE,sCAAsC,CAAC,QAAQ,CAAC,EACnE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GACzC,4BAA4B,CAqE9B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js new file mode 100644 index 00000000..3559424b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js @@ -0,0 +1,96 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeGatewayGraphQLRequestContext = makeGatewayGraphQLRequestContext; +function makeGatewayGraphQLRequestContext(newRequestContext, server, internals) { + const request = {}; + if ('query' in newRequestContext.request) { + request.query = newRequestContext.request.query; + } + if ('operationName' in newRequestContext.request) { + request.operationName = newRequestContext.request.operationName; + } + if ('variables' in newRequestContext.request) { + request.variables = newRequestContext.request.variables; + } + if ('extensions' in newRequestContext.request) { + request.extensions = newRequestContext.request.extensions; + } + if (newRequestContext.request.http) { + const newHttp = newRequestContext.request.http; + const needQuestion = newHttp.search !== '' && !newHttp.search.startsWith('?'); + request.http = { + method: newHttp.method, + url: `https://unknown-url.invalid/${needQuestion ? '?' : ''}${newHttp.search}`, + headers: new FetcherHeadersForHeaderMap(newHttp.headers), + }; + } + const response = { + http: { + headers: new FetcherHeadersForHeaderMap(newRequestContext.response.http.headers), + get status() { + return newRequestContext.response.http.status; + }, + set status(newStatus) { + newRequestContext.response.http.status = newStatus; + }, + }, + }; + return { + request, + response, + logger: server.logger, + schema: newRequestContext.schema, + schemaHash: 'schemaHash no longer exists since Apollo Server 4', + context: newRequestContext.contextValue, + cache: server.cache, + queryHash: newRequestContext.queryHash, + document: newRequestContext.document, + source: newRequestContext.source, + operationName: newRequestContext.operationName, + operation: newRequestContext.operation, + errors: newRequestContext.errors, + metrics: newRequestContext.metrics, + debug: internals.includeStacktraceInErrorResponses, + overallCachePolicy: newRequestContext.overallCachePolicy, + requestIsBatched: newRequestContext.requestIsBatched, + }; +} +class FetcherHeadersForHeaderMap { + map; + constructor(map) { + this.map = map; + } + append(name, value) { + if (this.map.has(name)) { + this.map.set(name, this.map.get(name) + ', ' + value); + } + else { + this.map.set(name, value); + } + } + delete(name) { + this.map.delete(name); + } + get(name) { + return this.map.get(name) ?? null; + } + has(name) { + return this.map.has(name); + } + set(name, value) { + this.map.set(name, value); + } + entries() { + return this.map.entries(); + } + keys() { + return this.map.keys(); + } + values() { + return this.map.values(); + } + [Symbol.iterator]() { + return this.map.entries(); + } +} +//# sourceMappingURL=makeGatewayGraphQLRequestContext.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js.map new file mode 100644 index 00000000..640c04a4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/makeGatewayGraphQLRequestContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"makeGatewayGraphQLRequestContext.js","sourceRoot":"","sources":["../../../src/utils/makeGatewayGraphQLRequestContext.ts"],"names":[],"mappings":";;AAoFA,4EAyEC;AAzED,SAAgB,gCAAgC,CAC9C,iBAAmE,EACnE,MAA8B,EAC9B,SAA0C;IAE1C,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,IAAI,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QACzC,OAAO,CAAC,KAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;IAClD,CAAC;IACD,IAAI,eAAe,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QACjD,OAAO,CAAC,aAAa,GAAG,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC;IAClE,CAAC;IACD,IAAI,WAAW,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QAC7C,OAAO,CAAC,SAAS,GAAG,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1D,CAAC;IACD,IAAI,YAAY,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QAC9C,OAAO,CAAC,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC;IAC5D,CAAC;IACD,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC;QAC/C,MAAM,YAAY,GAChB,OAAO,CAAC,MAAM,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC3D,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\ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts new file mode 100644 index 00000000..9b29413a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts @@ -0,0 +1,7 @@ +export type Resolvable = Promise & { + resolve: (t: T) => void; + reject: (e: any) => void; +}; +declare const _default: () => Resolvable; +export default _default; +//# sourceMappingURL=resolvable.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts.map new file mode 100644 index 00000000..b74c017a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolvable.d.ts","sourceRoot":"","sources":["../../../src/utils/resolvable.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG;IACvC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC1B,CAAC;yBAEc,CAAC,GAAG,IAAI,OAAK,UAAU,CAAC,CAAC,CAAC;AAA1C,wBAUE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js new file mode 100644 index 00000000..11a93cd5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = () => { + let resolve; + let reject; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + promise.resolve = resolve; + promise.reject = reject; + return promise; +}; +//# sourceMappingURL=resolvable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js.map new file mode 100644 index 00000000..57c07780 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/resolvable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolvable.js","sourceRoot":"","sources":["../../../src/utils/resolvable.ts"],"names":[],"mappings":";;AAmBA,kBAAe,GAA4B,EAAE;IAC3C,IAAI,OAAyB,CAAC;IAC9B,IAAI,MAA0B,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;QACnD,OAAO,GAAG,QAAQ,CAAC;QACnB,MAAM,GAAG,OAAO,CAAC;IACnB,CAAC,CAAkB,CAAC;IACpB,OAAO,CAAC,OAAO,GAAG,OAAQ,CAAC;IAC3B,OAAO,CAAC,MAAM,GAAG,MAAO,CAAC;IACzB,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts new file mode 100644 index 00000000..2aa5dc9a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts @@ -0,0 +1,16 @@ +import { type GraphQLSchema } from 'graphql'; +import type { BaseContext } from '../externalTypes/index.js'; +export declare const symbolExecutionDispatcherWillResolveField: unique symbol; +export declare const symbolUserFieldResolver: unique symbol; +declare const symbolPluginsEnabled: unique symbol; +export declare function enablePluginsForSchemaResolvers(schema: GraphQLSchema & { + [symbolPluginsEnabled]?: boolean; +}): GraphQLSchema & { + [symbolPluginsEnabled]?: boolean; +}; +export declare function pluginsEnabledForSchemaResolvers(schema: GraphQLSchema & { + [symbolPluginsEnabled]?: boolean; +}): boolean; +export declare function whenResultIsFinished(result: any, callback: (err: Error | null, result?: any) => void): void; +export {}; +//# sourceMappingURL=schemaInstrumentation.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts.map new file mode 100644 index 00000000..c5ea8060 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/utils/schemaInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,WAAW,EAEZ,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,yCAAyC,eAErD,CAAC;AACF,eAAO,MAAM,uBAAuB,eAA0C,CAAC;AAC/E,QAAA,MAAM,oBAAoB,eAAuC,CAAC;AAElE,wBAAgB,+BAA+B,CAAC,QAAQ,SAAS,WAAW,EAC1E,MAAM,EAAE,aAAa,GAAG;IAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAA;CAAE;6BAAT,OAAO;EAuB3D;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,GAAG;IAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3D,OAAO,CAET;AA6DD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,QAmBpD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js new file mode 100644 index 00000000..bf68047f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.symbolUserFieldResolver = exports.symbolExecutionDispatcherWillResolveField = void 0; +exports.enablePluginsForSchemaResolvers = enablePluginsForSchemaResolvers; +exports.pluginsEnabledForSchemaResolvers = pluginsEnabledForSchemaResolvers; +exports.whenResultIsFinished = whenResultIsFinished; +const graphql_1 = require("graphql"); +exports.symbolExecutionDispatcherWillResolveField = Symbol('apolloServerExecutionDispatcherWillResolveField'); +exports.symbolUserFieldResolver = Symbol('apolloServerUserFieldResolver'); +const symbolPluginsEnabled = Symbol('apolloServerPluginsEnabled'); +function enablePluginsForSchemaResolvers(schema) { + if (pluginsEnabledForSchemaResolvers(schema)) { + return schema; + } + Object.defineProperty(schema, symbolPluginsEnabled, { + value: true, + }); + const typeMap = schema.getTypeMap(); + Object.values(typeMap).forEach((type) => { + if (!(0, graphql_1.getNamedType)(type).name.startsWith('__') && + type instanceof graphql_1.GraphQLObjectType) { + const fields = type.getFields(); + Object.values(fields).forEach((field) => { + wrapField(field); + }); + } + }); + return schema; +} +function pluginsEnabledForSchemaResolvers(schema) { + return !!schema[symbolPluginsEnabled]; +} +function wrapField(field) { + const originalFieldResolve = field.resolve; + field.resolve = (source, args, contextValue, info) => { + const willResolveField = contextValue?.[exports.symbolExecutionDispatcherWillResolveField]; + const userFieldResolver = contextValue?.[exports.symbolUserFieldResolver]; + const didResolveField = typeof willResolveField === 'function' && + willResolveField({ source, args, contextValue, info }); + const fieldResolver = originalFieldResolve || userFieldResolver || graphql_1.defaultFieldResolver; + try { + const result = fieldResolver(source, args, contextValue, info); + if (typeof didResolveField === 'function') { + whenResultIsFinished(result, didResolveField); + } + return result; + } + catch (error) { + if (typeof didResolveField === 'function') { + didResolveField(error); + } + throw error; + } + }; +} +function isPromise(x) { + return x && typeof x.then === 'function'; +} +function whenResultIsFinished(result, callback) { + if (isPromise(result)) { + result.then((r) => whenResultIsFinished(r, callback), (err) => callback(err)); + } + else if (Array.isArray(result)) { + if (result.some(isPromise)) { + Promise.all(result).then((r) => callback(null, r), (err) => callback(err)); + } + else { + callback(null, result); + } + } + else { + callback(null, result); + } +} +//# sourceMappingURL=schemaInstrumentation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js.map new file mode 100644 index 00000000..2a509764 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaInstrumentation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaInstrumentation.js","sourceRoot":"","sources":["../../../src/utils/schemaInstrumentation.ts"],"names":[],"mappings":";;;AAmBA,0EAwBC;AAED,4EAIC;AA6DD,oDAqBC;AAnID,qCAOiB;AAMJ,QAAA,yCAAyC,GAAG,MAAM,CAC7D,iDAAiD,CAClD,CAAC;AACW,QAAA,uBAAuB,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAC/E,MAAM,oBAAoB,GAAG,MAAM,CAAC,4BAA4B,CAAC,CAAC;AAElE,SAAgB,+BAA+B,CAC7C,MAA4D;IAE5D,IAAI,gCAAgC,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,oBAAoB,EAAE;QAClD,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACtC,IACE,CAAC,IAAA,sBAAY,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACzC,IAAI,YAAY,2BAAiB,EACjC,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACtC,SAAS,CAAW,KAAK,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,gCAAgC,CAC9C,MAA4D;IAE5D,OAAO,CAAC,CAAC,MAAM,CAAC,oBAAoB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AE,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC7C,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAC9B,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CACtB,CAAC,CAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAC7B,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAC9B,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts new file mode 100644 index 00000000..8a5f0401 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts @@ -0,0 +1,31 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { GraphQLSchema } from 'graphql'; +import type { GatewayExecutor, GatewayInterface, GatewayUnsubscriber } from '@apollo/server-gateway-interface'; +import type { SchemaDerivedData } from '../ApolloServer.js'; +import type { ApolloConfig, GraphQLSchemaContext } from '../externalTypes/index.js'; +type SchemaDerivedDataProvider = (apiSchema: GraphQLSchema) => SchemaDerivedData; +export declare class SchemaManager { + private readonly logger; + private readonly schemaDerivedDataProvider; + private readonly onSchemaLoadOrUpdateListeners; + private isStopped; + private schemaDerivedData?; + private schemaContext?; + private readonly modeSpecificState; + constructor(options: ({ + gateway: GatewayInterface; + apolloConfig: ApolloConfig; + } | { + apiSchema: GraphQLSchema; + }) & { + logger: Logger; + schemaDerivedDataProvider: SchemaDerivedDataProvider; + }); + start(): Promise; + onSchemaLoadOrUpdate(callback: (schemaContext: GraphQLSchemaContext) => void): GatewayUnsubscriber; + getSchemaDerivedData(): SchemaDerivedData; + stop(): Promise; + private processSchemaLoadOrUpdateEvent; +} +export {}; +//# sourceMappingURL=schemaManager.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts.map new file mode 100644 index 00000000..53158c2e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaManager.d.ts","sourceRoot":"","sources":["../../../src/utils/schemaManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,KAAK,yBAAyB,GAAG,CAC/B,SAAS,EAAE,aAAa,KACrB,iBAAiB,CAAC;AAevB,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA4B;IACtE,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAE1C;IACJ,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,iBAAiB,CAAC,CAAoB;IAC9C,OAAO,CAAC,aAAa,CAAC,CAAuB;IAG7C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAW5B;gBAGJ,OAAO,EAAE,CACL;QAAE,OAAO,EAAE,gBAAgB,CAAC;QAAC,YAAY,EAAE,YAAY,CAAA;KAAE,GACzD;QAAE,SAAS,EAAE,aAAa,CAAA;KAAE,CAC/B,GAAG;QACF,MAAM,EAAE,MAAM,CAAC;QACf,yBAAyB,EAAE,yBAAyB,CAAC;KACtD;IA8BU,KAAK,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IA8C9C,oBAAoB,CACzB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,KAAK,IAAI,GACtD,mBAAmB;IA6Bf,oBAAoB,IAAI,iBAAiB;IAcnC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQlC,OAAO,CAAC,8BAA8B;CAqBvC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js new file mode 100644 index 00000000..77e60974 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchemaManager = void 0; +class SchemaManager { + logger; + schemaDerivedDataProvider; + onSchemaLoadOrUpdateListeners = new Set(); + isStopped = false; + schemaDerivedData; + schemaContext; + modeSpecificState; + constructor(options) { + this.logger = options.logger; + this.schemaDerivedDataProvider = options.schemaDerivedDataProvider; + if ('gateway' in options) { + this.modeSpecificState = { + mode: 'gateway', + gateway: options.gateway, + apolloConfig: options.apolloConfig, + }; + } + else { + this.modeSpecificState = { + mode: 'schema', + apiSchema: options.apiSchema, + schemaDerivedData: options.schemaDerivedDataProvider(options.apiSchema), + }; + } + } + async start() { + if (this.modeSpecificState.mode === 'gateway') { + const gateway = this.modeSpecificState.gateway; + if (gateway.onSchemaLoadOrUpdate) { + this.modeSpecificState.unsubscribeFromGateway = + gateway.onSchemaLoadOrUpdate((schemaContext) => { + this.processSchemaLoadOrUpdateEvent(schemaContext); + }); + } + else { + throw new Error("Unexpectedly couldn't find onSchemaLoadOrUpdate on gateway"); + } + const config = await this.modeSpecificState.gateway.load({ + apollo: this.modeSpecificState.apolloConfig, + }); + return config.executor; + } + else { + this.processSchemaLoadOrUpdateEvent({ + apiSchema: this.modeSpecificState.apiSchema, + }, this.modeSpecificState.schemaDerivedData); + return null; + } + } + onSchemaLoadOrUpdate(callback) { + if (!this.schemaContext) { + throw new Error('You must call start() before onSchemaLoadOrUpdate()'); + } + if (!this.isStopped) { + try { + callback(this.schemaContext); + } + catch (e) { + throw new Error(`An error was thrown from an 'onSchemaLoadOrUpdate' listener: ${e.message}`); + } + } + this.onSchemaLoadOrUpdateListeners.add(callback); + return () => { + this.onSchemaLoadOrUpdateListeners.delete(callback); + }; + } + getSchemaDerivedData() { + if (!this.schemaDerivedData) { + throw new Error('You must call start() before getSchemaDerivedData()'); + } + return this.schemaDerivedData; + } + async stop() { + this.isStopped = true; + if (this.modeSpecificState.mode === 'gateway') { + this.modeSpecificState.unsubscribeFromGateway?.(); + await this.modeSpecificState.gateway.stop?.(); + } + } + processSchemaLoadOrUpdateEvent(schemaContext, schemaDerivedData) { + if (!this.isStopped) { + this.schemaDerivedData = + schemaDerivedData ?? + this.schemaDerivedDataProvider(schemaContext.apiSchema); + this.schemaContext = schemaContext; + this.onSchemaLoadOrUpdateListeners.forEach((listener) => { + try { + listener(schemaContext); + } + catch (e) { + this.logger.error("An error was thrown from an 'onSchemaLoadOrUpdate' listener"); + this.logger.error(e); + } + }); + } + } +} +exports.SchemaManager = SchemaManager; +//# sourceMappingURL=schemaManager.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js.map new file mode 100644 index 00000000..48ce0c9c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/schemaManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaManager.js","sourceRoot":"","sources":["../../../src/utils/schemaManager.ts"],"names":[],"mappings":";;;AA8BA,MAAa,aAAa;IACP,MAAM,CAAS;IACf,yBAAyB,CAA4B;IACrD,6BAA6B,GAAG,IAAI,GAAG,EAErD,CAAC;IACI,SAAS,GAAG,KAAK,CAAC;IAClB,iBAAiB,CAAqB;IACtC,aAAa,CAAwB;IAG5B,iBAAiB,CAW5B;IAEN,YACE,OAMC;QAED,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;QACnE,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;YACzB,IAAI,CAAC,iBAAiB,GAAG;gBACvB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;aACnC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,iBAAiB,GAAG;gBACvB,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,OAAO,CAAC,SAAS;gBAI5B,iBAAiB,EAAE,OA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BACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AArLD,sCAqLC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts new file mode 100644 index 00000000..b05e9f69 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts @@ -0,0 +1,3 @@ +import type { Server } from 'http'; +export declare function urlForHttpServer(httpServer: Server): string; +//# sourceMappingURL=urlForHttpServer.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts.map new file mode 100644 index 00000000..e8c4fcfb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"urlForHttpServer.d.ts","sourceRoot":"","sources":["../../../src/utils/urlForHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB3D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js new file mode 100644 index 00000000..11215036 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.urlForHttpServer = urlForHttpServer; +const url_1 = require("url"); +function urlForHttpServer(httpServer) { + const { address, port } = httpServer.address(); + const hostname = address === '' || address === '::' ? 'localhost' : address; + return (0, url_1.format)({ + protocol: 'http', + hostname, + port, + pathname: '/', + }); +} +//# sourceMappingURL=urlForHttpServer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js.map new file mode 100644 index 00000000..55cf20a8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/utils/urlForHttpServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urlForHttpServer.js","sourceRoot":"","sources":["../../../src/utils/urlForHttpServer.ts"],"names":[],"mappings":";;AAIA,4CAgBC;AAlBD,6BAA6B;AAE7B,SAAgB,gBAAgB,CAAC,UAAkB;IACjD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,OAAO,EAAiB,CAAC;IAO9D,MAAM,QAAQ,GAAG,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;IAE5E,OAAO,IAAA,YAAM,EAAC;QACZ,QAAQ,EAAE,MAAM;QAChB,QAAQ;QACR,IAAI;QACJ,QAAQ,EAAE,GAAG;KACd,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts new file mode 100644 index 00000000..67c305d7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts @@ -0,0 +1,3 @@ +import { type ValidationRule } from 'graphql'; +export declare const NoIntrospection: ValidationRule; +//# sourceMappingURL=NoIntrospection.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts.map new file mode 100644 index 00000000..4497a57d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NoIntrospection.d.ts","sourceRoot":"","sources":["../../../src/validationRules/NoIntrospection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,eAAe,EAAE,cAmB5B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js new file mode 100644 index 00000000..b80a3ae8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoIntrospection = void 0; +const graphql_1 = require("graphql"); +const index_js_1 = require("../errors/index.js"); +const NoIntrospection = (context) => ({ + Field(node) { + if (node.name.value === '__schema' || node.name.value === '__type') { + context.reportError(new graphql_1.GraphQLError('GraphQL introspection is not allowed by Apollo Server, but the query contained __schema or __type. To enable introspection, pass introspection: true to ApolloServer in production', { + nodes: [node], + extensions: { + validationErrorCode: index_js_1.ApolloServerValidationErrorCode.INTROSPECTION_DISABLED, + }, + })); + } + }, +}); +exports.NoIntrospection = NoIntrospection; +//# sourceMappingURL=NoIntrospection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js.map new file mode 100644 index 00000000..1a70a75a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/NoIntrospection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoIntrospection.js","sourceRoot":"","sources":["../../../src/validationRules/NoIntrospection.ts"],"names":[],"mappings":";;;AAAA,qCAIiB;AACjB,iDAAqE;AAE9D,MAAM,eAAe,GAAmB,CAC7C,OAA0B,EAC1B,EAAE,CAAC,CAAC;IACJ,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACnE,OAAO,CAAC,WAAW,CACjB,IAAI,sBAAY,CACd,oLAAoL,EACpL;gBACE,KAAK,EAAE,CAAC,IAAI,CAAC;gBACb,UAAU,EAAE;oBACV,mBAAmB,EACjB,0CAA+B,CAAC,sBAAsB;iBACzD;aACF,CACF,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAnBU,QAAA,eAAe,mBAmBzB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts new file mode 100644 index 00000000..cfecc83d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts @@ -0,0 +1,4 @@ +import { type ValidationRule } from 'graphql'; +export declare const DEFAULT_MAX_RECURSIVE_SELECTIONS = 10000000; +export declare function createMaxRecursiveSelectionsRule(limit: number): ValidationRule; +//# sourceMappingURL=RecursiveSelectionsLimit.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts.map new file mode 100644 index 00000000..2279016c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RecursiveSelectionsLimit.d.ts","sourceRoot":"","sources":["../../../src/validationRules/RecursiveSelectionsLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,gCAAgC,WAAa,CAAC;AAoJ3D,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,GACZ,cAAc,CAuChB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js new file mode 100644 index 00000000..50ae1de7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js @@ -0,0 +1,150 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_MAX_RECURSIVE_SELECTIONS = void 0; +exports.createMaxRecursiveSelectionsRule = createMaxRecursiveSelectionsRule; +const graphql_1 = require("graphql"); +const index_js_1 = require("../errors/index.js"); +exports.DEFAULT_MAX_RECURSIVE_SELECTIONS = 10_000_000; +class RecursiveSelectionValidationContext { + selectionCountLimit; + context; + fragmentInfo = new Map(); + operationInfo = new Map(); + currentFragment; + currentOperation; + fragmentRecursiveSelectionCount = new Map(); + constructor(selectionCountLimit, context) { + this.selectionCountLimit = selectionCountLimit; + this.context = context; + } + getExecutionDefinitionInfo() { + if (this.currentFragment !== undefined) { + let entry = this.fragmentInfo.get(this.currentFragment); + if (!entry) { + entry = { + selectionCount: 0, + fragmentSpreads: new Map(), + }; + this.fragmentInfo.set(this.currentFragment, entry); + } + return entry; + } + if (this.currentOperation !== undefined) { + let entry = this.operationInfo.get(this.currentOperation); + if (!entry) { + entry = { + selectionCount: 0, + fragmentSpreads: new Map(), + }; + this.operationInfo.set(this.currentOperation, entry); + } + return entry; + } + return undefined; + } + processSelection(fragmentSpreadName) { + const definitionInfo = this.getExecutionDefinitionInfo(); + if (!definitionInfo) { + return; + } + definitionInfo.selectionCount++; + if (fragmentSpreadName !== undefined) { + let spreadCount = (definitionInfo.fragmentSpreads.get(fragmentSpreadName) ?? 0) + 1; + definitionInfo.fragmentSpreads.set(fragmentSpreadName, spreadCount); + } + } + enterFragment(fragment) { + this.currentFragment = fragment; + } + leaveFragment() { + this.currentFragment = undefined; + } + enterOperation(operation) { + this.currentOperation = operation; + } + leaveOperation() { + this.currentOperation = undefined; + } + computeFragmentRecursiveSelectionsCount(fragment) { + const cachedCount = this.fragmentRecursiveSelectionCount.get(fragment); + if (cachedCount === null) { + return 0; + } + if (cachedCount !== undefined) { + return cachedCount; + } + this.fragmentRecursiveSelectionCount.set(fragment, null); + const definitionInfo = this.fragmentInfo.get(fragment); + let count = 0; + if (definitionInfo) { + count = definitionInfo.selectionCount; + for (const [fragment, spreadCount] of definitionInfo.fragmentSpreads) { + count += + spreadCount * this.computeFragmentRecursiveSelectionsCount(fragment); + } + } + this.fragmentRecursiveSelectionCount.set(fragment, count); + return count; + } + reportError(operation) { + const operationName = operation + ? `Operation "${operation}"` + : 'Anonymous operation'; + this.context.reportError(new graphql_1.GraphQLError(`${operationName} recursively requests too many selections.`, { + nodes: [], + extensions: { + validationErrorCode: index_js_1.ApolloServerValidationErrorCode.MAX_RECURSIVE_SELECTIONS_EXCEEDED, + }, + })); + } + checkLimitExceeded() { + for (const [operation, definitionInfo] of this.operationInfo) { + let count = definitionInfo.selectionCount; + for (const [fragment, spreadCount] of definitionInfo.fragmentSpreads) { + count += + spreadCount * this.computeFragmentRecursiveSelectionsCount(fragment); + } + if (count > this.selectionCountLimit) { + this.reportError(operation); + } + } + } +} +function createMaxRecursiveSelectionsRule(limit) { + return (context) => { + const selectionContext = new RecursiveSelectionValidationContext(limit, context); + return { + Field() { + selectionContext.processSelection(); + }, + InlineFragment() { + selectionContext.processSelection(); + }, + FragmentSpread(node) { + selectionContext.processSelection(node.name.value); + }, + FragmentDefinition: { + enter(node) { + selectionContext.enterFragment(node.name.value); + }, + leave() { + selectionContext.leaveFragment(); + }, + }, + OperationDefinition: { + enter(node) { + selectionContext.enterOperation(node.name?.value ?? null); + }, + leave() { + selectionContext.leaveOperation(); + }, + }, + Document: { + leave() { + selectionContext.checkLimitExceeded(); + }, + }, + }; + }; +} +//# sourceMappingURL=RecursiveSelectionsLimit.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js.map new file mode 100644 index 00000000..612de776 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/RecursiveSelectionsLimit.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RecursiveSelectionsLimit.js","sourceRoot":"","sources":["../../../src/validationRules/RecursiveSelectionsLimit.ts"],"names":[],"mappings":";;;AA4JA,4EAyCC;AArMD,qCAKiB;AACjB,iDAAqE;AAExD,QAAA,gCAAgC,GAAG,UAAU,CAAC;AAO3D,MAAM,mCAAmC;IAWpB;IACA;IAXF,YAAY,GAC3B,IAAI,GAAG,EAAE,CAAC;IACK,aAAa,GAC5B,IAAI,GAAG,EAAE,CAAC;IACJ,eAAe,CAAU;IACzB,gBAAgB,CAAiB;IACxB,+BAA+B,GAC9C,IAAI,GAAG,EAAE,CAAC;IAEZ,YACmB,mBAA2B,EAC3B,OAA0B;QAD1B,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,YAAO,GAAP,OAAO,CAAmB;IAC1C,CAAC;IAEI,0BAA0B;QAChC,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YACvC,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACxD,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,KAAK,GAAG;oBACN,cAAc,EAAE,CAAC;oBACjB,eA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CAAC,CAAC;gBAC5D,CAAC;gBACD,KAAK;oBACH,gBAAgB,CAAC,cAAc,EAAE,CAAC;gBACpC,CAAC;aACF;YACD,QAAQ,EAAE;gBACR,KAAK;oBACH,gBAAgB,CAAC,kBAAkB,EAAE,CAAC;gBACxC,CAAC;aACF;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts new file mode 100644 index 00000000..ebf90217 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts @@ -0,0 +1,3 @@ +export { NoIntrospection } from './NoIntrospection.js'; +export { DEFAULT_MAX_RECURSIVE_SELECTIONS, createMaxRecursiveSelectionsRule, } from './RecursiveSelectionsLimit.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts.map new file mode 100644 index 00000000..dad3e167 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validationRules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,+BAA+B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js new file mode 100644 index 00000000..17e4c021 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createMaxRecursiveSelectionsRule = exports.DEFAULT_MAX_RECURSIVE_SELECTIONS = exports.NoIntrospection = void 0; +var NoIntrospection_js_1 = require("./NoIntrospection.js"); +Object.defineProperty(exports, "NoIntrospection", { enumerable: true, get: function () { return NoIntrospection_js_1.NoIntrospection; } }); +var RecursiveSelectionsLimit_js_1 = require("./RecursiveSelectionsLimit.js"); +Object.defineProperty(exports, "DEFAULT_MAX_RECURSIVE_SELECTIONS", { enumerable: true, get: function () { return RecursiveSelectionsLimit_js_1.DEFAULT_MAX_RECURSIVE_SELECTIONS; } }); +Object.defineProperty(exports, "createMaxRecursiveSelectionsRule", { enumerable: true, get: function () { return RecursiveSelectionsLimit_js_1.createMaxRecursiveSelectionsRule; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js.map new file mode 100644 index 00000000..ea502d93 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/cjs/validationRules/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validationRules/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,6EAGuC;AAFrC,+IAAA,gCAAgC,OAAA;AAChC,+IAAA,gCAAgC,OAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts new file mode 100644 index 00000000..ecc18c69 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts @@ -0,0 +1,126 @@ +import type { GatewayExecutor } from '@apollo/server-gateway-interface'; +import { type KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { Logger } from '@apollo/utils.logger'; +import type { WithRequired } from '@apollo/utils.withrequired'; +import { type Resolvable } from './utils/resolvable.js'; +import { type validate, type DocumentNode, type ExecutionArgs, type FormattedExecutionResult, type GraphQLFieldResolver, type GraphQLFormattedError, type GraphQLSchema, type ParseOptions, type TypedQueryDocumentNode, type ValidationRule } from 'graphql'; +import type { ExecuteOperationOptions, LegacyExperimentalExecuteIncrementally, VariableValues } from './externalTypes/graphql.js'; +import type { ApolloConfig, ApolloServerOptions, ApolloServerPlugin, BaseContext, ContextThunk, DocumentStore, GraphQLRequest, GraphQLResponse, HTTPGraphQLHead, HTTPGraphQLRequest, HTTPGraphQLResponse, LandingPage, PersistedQueryOptions } from './externalTypes/index.js'; +import type { GraphQLExperimentalIncrementalExecutionResultsAlpha2, GraphQLExperimentalIncrementalExecutionResultsAlpha9 } from './incrementalDeliveryPolyfill.js'; +import { SchemaManager } from './utils/schemaManager.js'; +export type SchemaDerivedData = { + schema: GraphQLSchema; + documentStore: DocumentStore | null; + documentStoreKeyPrefix: string; +}; +type RunningServerState = { + schemaManager: SchemaManager; + landingPage: LandingPage | null; +}; +type ServerState = { + phase: 'initialized'; + schemaManager: SchemaManager; +} | { + phase: 'starting'; + barrier: Resolvable; + schemaManager: SchemaManager; + startedInBackground: boolean; +} | { + phase: 'failed to start'; + error: Error; +} | ({ + phase: 'started'; + drainServers: (() => Promise) | null; + toDispose: (() => Promise)[]; + toDisposeLast: (() => Promise)[]; +} & RunningServerState) | ({ + phase: 'draining'; + barrier: Resolvable; +} & RunningServerState) | { + phase: 'stopping'; + barrier: Resolvable; +} | { + phase: 'stopped'; + stopError: Error | null; +}; +export type ValidationOptions = NonNullable[3]>; +export interface ApolloServerInternals { + state: ServerState; + gatewayExecutor: GatewayExecutor | null; + dangerouslyDisableValidation?: boolean; + formatError?: (formattedError: GraphQLFormattedError, error: unknown) => GraphQLFormattedError; + includeStacktraceInErrorResponses: boolean; + persistedQueries?: WithRequired; + nodeEnv: string; + allowBatchedHttpRequests: boolean; + apolloConfig: ApolloConfig; + plugins: ApolloServerPlugin[]; + parseOptions: ParseOptions; + validationOptions: ValidationOptions; + executionOptions?: ExecutionArgs['options']; + stopOnTerminationSignals: boolean | undefined; + csrfPreventionRequestHeaders: string[] | null; + rootValue?: ((parsedQuery: DocumentNode) => unknown) | unknown; + validationRules: Array; + laterValidationRules?: Array; + hideSchemaDetailsFromClientErrors: boolean; + fieldResolver?: GraphQLFieldResolver; + status400ForVariableCoercionErrors?: boolean; + __testing_incrementalExecutionResults?: GraphQLExperimentalIncrementalExecutionResultsAlpha2 | GraphQLExperimentalIncrementalExecutionResultsAlpha9; + stringifyResult: (value: FormattedExecutionResult) => string | Promise; + legacyExperimentalExecuteIncrementally?: LegacyExperimentalExecuteIncrementally; +} +export declare class ApolloServer { + private internals; + readonly cache: KeyValueCache; + readonly logger: Logger; + constructor(config: ApolloServerOptions); + private warnAgainstDeprecatedConfigOptions; + start(): Promise; + startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests(): void; + private _start; + private maybeRegisterTerminationSignalHandlers; + private _ensureStarted; + assertStarted(expressionForError: string): void; + private logStartupError; + private static constructSchema; + private static generateSchemaDerivedData; + stop(): Promise; + private addDefaultPlugins; + addPlugin(plugin: ApolloServerPlugin): void; + executeHTTPGraphQLRequest({ httpGraphQLRequest, context, }: { + httpGraphQLRequest: HTTPGraphQLRequest; + context: ContextThunk; + }): Promise; + private errorResponse; + private prefersHTML; + executeOperation, TVariables extends VariableValues = VariableValues>(this: ApolloServer, request: Omit, 'query'> & { + query?: string | DocumentNode | TypedQueryDocumentNode; + }): Promise>; + executeOperation, TVariables extends VariableValues = VariableValues>(request: Omit, 'query'> & { + query?: string | DocumentNode | TypedQueryDocumentNode; + }, options?: ExecuteOperationOptions): Promise>; +} +export declare function internalExecuteOperation({ server, graphQLRequest, internals, schemaDerivedData, sharedResponseHTTPGraphQLHead, }: { + server: ApolloServer; + graphQLRequest: GraphQLRequest; + internals: ApolloServerInternals; + schemaDerivedData: SchemaDerivedData; + sharedResponseHTTPGraphQLHead: HTTPGraphQLHead | null; +}, options: ExecuteOperationOptions): Promise; +export type ImplicitlyInstallablePlugin = ApolloServerPlugin & { + __internal_installed_implicitly__: boolean; +}; +export declare function isImplicitlyInstallablePlugin(p: ApolloServerPlugin): p is ImplicitlyInstallablePlugin; +export declare const MEDIA_TYPES: { + APPLICATION_JSON: string; + APPLICATION_JSON_GRAPHQL_CALLBACK: string; + APPLICATION_GRAPHQL_RESPONSE_JSON: string; + MULTIPART_MIXED_NO_DEFER_SPEC: string; + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2: string; + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9: string; + TEXT_HTML: string; +}; +export declare function chooseContentTypeForSingleResultResponse(head: HTTPGraphQLHead): string | null; +export {}; +//# sourceMappingURL=ApolloServer.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts.map new file mode 100644 index 00000000..0cf60011 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloServer.d.ts","sourceRoot":"","sources":["../../src/ApolloServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAmB,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAKL,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAYjB,OAAO,KAAK,EACV,uBAAuB,EACvB,sCAAsC,EACtC,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EAEd,eAAe,EAGf,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,oDAAoD,EACpD,oDAAoD,EACrD,MAAM,kCAAkC,CAAC;AAY1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAOzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,aAAa,CAAC;IAItB,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAMpC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;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.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js new file mode 100644 index 00000000..f71699bd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js @@ -0,0 +1,683 @@ +import { isNodeLike } from '@apollo/utils.isnodelike'; +import { InMemoryLRUCache, PrefixingKeyValueCache, } from '@apollo/utils.keyvaluecache'; +import { makeExecutableSchema } from '@graphql-tools/schema'; +import resolvable from './utils/resolvable.js'; +import { GraphQLError, assertValidSchema, print, printSchema, } from 'graphql'; +import loglevel from 'loglevel'; +import Negotiator from 'negotiator'; +import { newCachePolicy } from './cachePolicy.js'; +import { determineApolloConfig } from './determineApolloConfig.js'; +import { ensureError, ensureGraphQLError, normalizeAndFormatErrors, } from './errorNormalize.js'; +import { ApolloServerErrorCode } from './errors/index.js'; +import { runPotentiallyBatchedHttpQuery } from './httpBatching.js'; +import { pluginIsInternal } from './internalPlugin.js'; +import { preventCsrf, recommendedCsrfPreventionRequestHeaders, } from './preventCsrf.js'; +import { APQ_CACHE_PREFIX, processGraphQLRequest } from './requestPipeline.js'; +import { newHTTPGraphQLHead, prettyJSONStringify } from './runHttpQuery.js'; +import { HeaderMap } from './utils/HeaderMap.js'; +import { UnreachableCaseError } from './utils/UnreachableCaseError.js'; +import { computeCoreSchemaHash } from './utils/computeCoreSchemaHash.js'; +import { isDefined } from './utils/isDefined.js'; +import { SchemaManager } from './utils/schemaManager.js'; +import { NoIntrospection, createMaxRecursiveSelectionsRule, DEFAULT_MAX_RECURSIVE_SELECTIONS, } from './validationRules/index.js'; +function defaultLogger() { + const loglevelLogger = loglevel.getLogger('apollo-server'); + loglevelLogger.setLevel(loglevel.levels.INFO); + return loglevelLogger; +} +export class ApolloServer { + internals; + cache; + logger; + constructor(config) { + const nodeEnv = config.nodeEnv ?? process.env.NODE_ENV ?? ''; + this.logger = config.logger ?? defaultLogger(); + const apolloConfig = determineApolloConfig(config.apollo, this.logger); + const isDev = nodeEnv !== 'production'; + if (config.cache && + config.cache !== 'bounded' && + PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(config.cache)) { + throw new Error('You cannot pass a cache returned from ' + + '`PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation`' + + 'to `new ApolloServer({ cache })`, because Apollo Server may use it for ' + + 'multiple features whose cache keys must be distinct from each other.'); + } + const state = config.gateway + ? + { + phase: 'initialized', + schemaManager: new SchemaManager({ + gateway: config.gateway, + apolloConfig, + schemaDerivedDataProvider: (schema) => ApolloServer.generateSchemaDerivedData(schema, config.documentStore), + logger: this.logger, + }), + } + : + { + phase: 'initialized', + schemaManager: new SchemaManager({ + apiSchema: ApolloServer.constructSchema(config), + schemaDerivedDataProvider: (schema) => ApolloServer.generateSchemaDerivedData(schema, config.documentStore), + logger: this.logger, + }), + }; + const introspectionEnabled = config.introspection ?? isDev; + const hideSchemaDetailsFromClientErrors = config.hideSchemaDetailsFromClientErrors ?? false; + this.cache = + config.cache === undefined || config.cache === 'bounded' + ? new InMemoryLRUCache() + : config.cache; + const maxRecursiveSelectionsRule = config.maxRecursiveSelections === true + ? [createMaxRecursiveSelectionsRule(DEFAULT_MAX_RECURSIVE_SELECTIONS)] + : typeof config.maxRecursiveSelections === 'number' + ? [createMaxRecursiveSelectionsRule(config.maxRecursiveSelections)] + : []; + const validationRules = [ + ...(introspectionEnabled ? [] : [NoIntrospection]), + ...maxRecursiveSelectionsRule, + ]; + let laterValidationRules; + if (maxRecursiveSelectionsRule.length > 0) { + laterValidationRules = config.validationRules; + } + else { + validationRules.push(...(config.validationRules ?? [])); + } + this.internals = { + formatError: config.formatError, + rootValue: config.rootValue, + validationRules, + laterValidationRules, + hideSchemaDetailsFromClientErrors, + dangerouslyDisableValidation: config.dangerouslyDisableValidation ?? false, + validationOptions: config.validationOptions ?? {}, + fieldResolver: config.fieldResolver, + includeStacktraceInErrorResponses: config.includeStacktraceInErrorResponses ?? + (nodeEnv !== 'production' && nodeEnv !== 'test'), + persistedQueries: config.persistedQueries === false + ? undefined + : { + ...config.persistedQueries, + cache: new PrefixingKeyValueCache(config.persistedQueries?.cache ?? this.cache, APQ_CACHE_PREFIX), + }, + nodeEnv, + allowBatchedHttpRequests: config.allowBatchedHttpRequests ?? false, + apolloConfig, + plugins: config.plugins ?? [], + parseOptions: config.parseOptions ?? {}, + executionOptions: config.executionOptions ?? {}, + state, + stopOnTerminationSignals: config.stopOnTerminationSignals, + gatewayExecutor: null, + csrfPreventionRequestHeaders: config.csrfPrevention === true || config.csrfPrevention === undefined + ? recommendedCsrfPreventionRequestHeaders + : config.csrfPrevention === false + ? null + : (config.csrfPrevention.requestHeaders ?? + recommendedCsrfPreventionRequestHeaders), + status400ForVariableCoercionErrors: config.status400ForVariableCoercionErrors ?? true, + __testing_incrementalExecutionResults: config.__testing_incrementalExecutionResults, + stringifyResult: config.stringifyResult ?? prettyJSONStringify, + legacyExperimentalExecuteIncrementally: config.legacyExperimentalExecuteIncrementally, + }; + this.warnAgainstDeprecatedConfigOptions(config); + } + warnAgainstDeprecatedConfigOptions(config) { + if ('status400ForVariableCoercionErrors' in config) { + if (config.status400ForVariableCoercionErrors === true) { + this.logger.warn('The `status400ForVariableCoercionErrors: true` configuration option is now the default behavior and has no effect in Apollo Server v5. You can safely remove this option from your configuration.'); + } + else { + this.logger.warn('The `status400ForVariableCoercionErrors: false` configuration option is deprecated and will be removed in Apollo Server v6. Apollo recommends removing any dependency on this behavior.'); + } + } + } + async start() { + return await this._start(false); + } + startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests() { + this._start(true).catch((e) => this.logStartupError(e)); + } + async _start(startedInBackground) { + if (this.internals.state.phase !== 'initialized') { + throw new Error(`You should only call 'start()' or ` + + `'startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests()' ` + + `once on your ApolloServer.`); + } + const schemaManager = this.internals.state.schemaManager; + const barrier = resolvable(); + this.internals.state = { + phase: 'starting', + barrier, + schemaManager, + startedInBackground, + }; + try { + await this.addDefaultPlugins(); + const toDispose = []; + const executor = await schemaManager.start(); + if (executor) { + this.internals.gatewayExecutor = executor; + } + toDispose.push(async () => { + await schemaManager.stop(); + }); + const schemaDerivedData = schemaManager.getSchemaDerivedData(); + const service = { + logger: this.logger, + cache: this.cache, + schema: schemaDerivedData.schema, + apollo: this.internals.apolloConfig, + startedInBackground, + }; + const taggedServerListeners = (await Promise.all(this.internals.plugins.map(async (plugin) => ({ + serverListener: plugin.serverWillStart && (await plugin.serverWillStart(service)), + installedImplicitly: isImplicitlyInstallablePlugin(plugin) && + plugin.__internal_installed_implicitly__, + })))).filter((maybeTaggedServerListener) => typeof maybeTaggedServerListener.serverListener === 'object'); + taggedServerListeners.forEach(({ serverListener: { schemaDidLoadOrUpdate } }) => { + if (schemaDidLoadOrUpdate) { + schemaManager.onSchemaLoadOrUpdate(schemaDidLoadOrUpdate); + } + }); + const serverWillStops = taggedServerListeners + .map((l) => l.serverListener.serverWillStop) + .filter(isDefined); + if (serverWillStops.length) { + toDispose.push(async () => { + await Promise.all(serverWillStops.map((serverWillStop) => serverWillStop())); + }); + } + const drainServerCallbacks = taggedServerListeners + .map((l) => l.serverListener.drainServer) + .filter(isDefined); + const drainServers = drainServerCallbacks.length + ? async () => { + await Promise.all(drainServerCallbacks.map((drainServer) => drainServer())); + } + : null; + let taggedServerListenersWithRenderLandingPage = taggedServerListeners.filter((l) => l.serverListener.renderLandingPage); + if (taggedServerListenersWithRenderLandingPage.length > 1) { + taggedServerListenersWithRenderLandingPage = + taggedServerListenersWithRenderLandingPage.filter((l) => !l.installedImplicitly); + } + let landingPage = null; + if (taggedServerListenersWithRenderLandingPage.length > 1) { + throw Error('Only one plugin can implement renderLandingPage.'); + } + else if (taggedServerListenersWithRenderLandingPage.length) { + landingPage = + await taggedServerListenersWithRenderLandingPage[0].serverListener + .renderLandingPage(); + } + const toDisposeLast = this.maybeRegisterTerminationSignalHandlers(['SIGINT', 'SIGTERM'], startedInBackground); + this.internals.state = { + phase: 'started', + schemaManager, + drainServers, + landingPage, + toDispose, + toDisposeLast, + }; + } + catch (maybeError) { + const error = ensureError(maybeError); + try { + await Promise.all(this.internals.plugins.map(async (plugin) => plugin.startupDidFail?.({ error }))); + } + catch (pluginError) { + this.logger.error(`startupDidFail hook threw: ${pluginError}`); + } + this.internals.state = { + phase: 'failed to start', + error, + }; + throw error; + } + finally { + barrier.resolve(); + } + } + maybeRegisterTerminationSignalHandlers(signals, startedInBackground) { + const toDisposeLast = []; + if (this.internals.stopOnTerminationSignals === false || + (this.internals.stopOnTerminationSignals === undefined && + !(isNodeLike && + this.internals.nodeEnv !== 'test' && + !startedInBackground))) { + return toDisposeLast; + } + let receivedSignal = false; + const signalHandler = async (signal) => { + if (receivedSignal) { + return; + } + receivedSignal = true; + try { + await this.stop(); + } + catch (e) { + this.logger.error(`stop() threw during ${signal} shutdown`); + this.logger.error(e); + process.exit(1); + } + process.kill(process.pid, signal); + }; + signals.forEach((signal) => { + process.on(signal, signalHandler); + toDisposeLast.push(async () => { + process.removeListener(signal, signalHandler); + }); + }); + return toDisposeLast; + } + async _ensureStarted() { + while (true) { + switch (this.internals.state.phase) { + case 'initialized': + throw new Error('You need to call `server.start()` before using your Apollo Server.'); + case 'starting': + await this.internals.state.barrier; + break; + case 'failed to start': + this.logStartupError(this.internals.state.error); + throw new Error('This data graph is missing a valid configuration. More details may be available in the server logs.'); + case 'started': + case 'draining': + return this.internals.state; + case 'stopping': + case 'stopped': + this.logger.warn('A GraphQL operation was received during server shutdown. The ' + + 'operation will fail. Consider draining the HTTP server on shutdown; ' + + 'see https://go.apollo.dev/s/drain for details.'); + throw new Error(`Cannot execute GraphQL operations ${this.internals.state.phase === 'stopping' + ? 'while the server is stopping' + : 'after the server has stopped'}.'`); + default: + throw new UnreachableCaseError(this.internals.state); + } + } + } + assertStarted(expressionForError) { + if (this.internals.state.phase !== 'started' && + this.internals.state.phase !== 'draining' && + !(this.internals.state.phase === 'starting' && + this.internals.state.startedInBackground)) { + throw new Error('You must `await server.start()` before calling `' + + expressionForError + + '`'); + } + } + logStartupError(err) { + this.logger.error('An error occurred during Apollo Server startup. All GraphQL requests ' + + 'will now fail. The startup error was: ' + + (err?.message || err)); + } + static constructSchema(config) { + if (config.schema) { + return config.schema; + } + const { typeDefs, resolvers } = config; + const augmentedTypeDefs = Array.isArray(typeDefs) ? typeDefs : [typeDefs]; + return makeExecutableSchema({ + typeDefs: augmentedTypeDefs, + resolvers, + }); + } + static generateSchemaDerivedData(schema, providedDocumentStore) { + assertValidSchema(schema); + return { + schema, + documentStore: providedDocumentStore === undefined + ? new InMemoryLRUCache() + : providedDocumentStore, + documentStoreKeyPrefix: providedDocumentStore + ? `${computeCoreSchemaHash(printSchema(schema))}:` + : '', + }; + } + async stop() { + switch (this.internals.state.phase) { + case 'initialized': + case 'starting': + case 'failed to start': + throw Error('apolloServer.stop() should only be called after `await apolloServer.start()` has succeeded'); + case 'stopped': + if (this.internals.state.stopError) { + throw this.internals.state.stopError; + } + return; + case 'stopping': + case 'draining': { + await this.internals.state.barrier; + const state = this.internals.state; + if (state.phase !== 'stopped') { + throw Error(`Surprising post-stopping state ${state.phase}`); + } + if (state.stopError) { + throw state.stopError; + } + return; + } + case 'started': + break; + default: + throw new UnreachableCaseError(this.internals.state); + } + const barrier = resolvable(); + const { schemaManager, drainServers, landingPage, toDispose, toDisposeLast, } = this.internals.state; + this.internals.state = { + phase: 'draining', + barrier, + schemaManager, + landingPage, + }; + try { + await drainServers?.(); + this.internals.state = { phase: 'stopping', barrier }; + await Promise.all([...toDispose].map((dispose) => dispose())); + await Promise.all([...toDisposeLast].map((dispose) => dispose())); + } + catch (stopError) { + this.internals.state = { + phase: 'stopped', + stopError: stopError, + }; + barrier.resolve(); + throw stopError; + } + this.internals.state = { phase: 'stopped', stopError: null }; + } + async addDefaultPlugins() { + const { plugins, apolloConfig, nodeEnv, hideSchemaDetailsFromClientErrors, } = this.internals; + const isDev = nodeEnv !== 'production'; + const alreadyHavePluginWithInternalId = (id) => plugins.some((p) => pluginIsInternal(p) && p.__internal_plugin_id__ === id); + const pluginsByInternalID = new Map(); + for (const p of plugins) { + if (pluginIsInternal(p)) { + const id = p.__internal_plugin_id__; + if (!pluginsByInternalID.has(id)) { + pluginsByInternalID.set(id, { + sawDisabled: false, + sawNonDisabled: false, + }); + } + const seen = pluginsByInternalID.get(id); + if (p.__is_disabled_plugin__) { + seen.sawDisabled = true; + } + else { + seen.sawNonDisabled = true; + } + if (seen.sawDisabled && seen.sawNonDisabled) { + throw new Error(`You have tried to install both ApolloServerPlugin${id} and ` + + `ApolloServerPlugin${id}Disabled in your server. Please choose ` + + `whether or not you want to disable the feature and install the ` + + `appropriate plugin for your use case.`); + } + } + } + { + if (!alreadyHavePluginWithInternalId('CacheControl')) { + const { ApolloServerPluginCacheControl } = await import('./plugin/cacheControl/index.js'); + plugins.push(ApolloServerPluginCacheControl()); + } + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('UsageReporting'); + if (!alreadyHavePlugin && apolloConfig.key) { + if (apolloConfig.graphRef) { + const { ApolloServerPluginUsageReporting } = await import('./plugin/usageReporting/index.js'); + plugins.unshift(ApolloServerPluginUsageReporting({ + __onlyIfSchemaIsNotSubgraph: true, + })); + } + else { + this.logger.warn('You have specified an Apollo key but have not specified a graph ref; usage ' + + 'reporting is disabled. To enable usage reporting, set the `APOLLO_GRAPH_REF` ' + + 'environment variable to `your-graph-id@your-graph-variant`. To disable this ' + + 'warning, install `ApolloServerPluginUsageReportingDisabled`.'); + } + } + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('SchemaReporting'); + const enabledViaEnvVar = process.env.APOLLO_SCHEMA_REPORTING === 'true'; + if (!alreadyHavePlugin && enabledViaEnvVar) { + if (apolloConfig.key) { + const { ApolloServerPluginSchemaReporting } = await import('./plugin/schemaReporting/index.js'); + plugins.push(ApolloServerPluginSchemaReporting()); + } + else { + throw new Error("You've enabled schema reporting by setting the APOLLO_SCHEMA_REPORTING " + + 'environment variable to true, but you also need to provide your ' + + 'Apollo API key, via the APOLLO_KEY environment ' + + 'variable or via `new ApolloServer({apollo: {key})'); + } + } + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('InlineTrace'); + if (!alreadyHavePlugin) { + const { ApolloServerPluginInlineTrace } = await import('./plugin/inlineTrace/index.js'); + plugins.push(ApolloServerPluginInlineTrace({ __onlyIfSchemaIsSubgraph: true })); + } + } + const alreadyHavePlugin = alreadyHavePluginWithInternalId('LandingPageDisabled'); + if (!alreadyHavePlugin) { + const { ApolloServerPluginLandingPageLocalDefault, ApolloServerPluginLandingPageProductionDefault, } = await import('./plugin/landingPage/default/index.js'); + const plugin = isDev + ? ApolloServerPluginLandingPageLocalDefault() + : ApolloServerPluginLandingPageProductionDefault(); + if (!isImplicitlyInstallablePlugin(plugin)) { + throw Error('default landing page plugin should be implicitly installable?'); + } + plugin.__internal_installed_implicitly__ = true; + plugins.push(plugin); + } + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('DisableSuggestions'); + if (hideSchemaDetailsFromClientErrors && !alreadyHavePlugin) { + const { ApolloServerPluginDisableSuggestions } = await import('./plugin/disableSuggestions/index.js'); + plugins.push(ApolloServerPluginDisableSuggestions()); + } + } + } + addPlugin(plugin) { + if (this.internals.state.phase !== 'initialized') { + throw new Error("Can't add plugins after the server has started"); + } + this.internals.plugins.push(plugin); + } + async executeHTTPGraphQLRequest({ httpGraphQLRequest, context, }) { + try { + let runningServerState; + try { + runningServerState = await this._ensureStarted(); + } + catch (error) { + return await this.errorResponse(error, httpGraphQLRequest); + } + if (runningServerState.landingPage && + this.prefersHTML(httpGraphQLRequest)) { + let renderedHtml; + if (typeof runningServerState.landingPage.html === 'string') { + renderedHtml = runningServerState.landingPage.html; + } + else { + try { + renderedHtml = await runningServerState.landingPage.html(); + } + catch (maybeError) { + const error = ensureError(maybeError); + this.logger.error(`Landing page \`html\` function threw: ${error}`); + return await this.errorResponse(error, httpGraphQLRequest); + } + } + return { + headers: new HeaderMap([['content-type', 'text/html']]), + body: { + kind: 'complete', + string: renderedHtml, + }, + }; + } + if (this.internals.csrfPreventionRequestHeaders) { + preventCsrf(httpGraphQLRequest.headers, this.internals.csrfPreventionRequestHeaders); + } + let contextValue; + try { + contextValue = await context(); + } + catch (maybeError) { + const error = ensureError(maybeError); + try { + await Promise.all(this.internals.plugins.map(async (plugin) => plugin.contextCreationDidFail?.({ + error, + }))); + } + catch (pluginError) { + this.logger.error(`contextCreationDidFail hook threw: ${pluginError}`); + } + return await this.errorResponse(ensureGraphQLError(error, 'Context creation failed: '), httpGraphQLRequest); + } + return await runPotentiallyBatchedHttpQuery(this, httpGraphQLRequest, contextValue, runningServerState.schemaManager.getSchemaDerivedData(), this.internals); + } + catch (maybeError_) { + const maybeError = maybeError_; + if (maybeError instanceof GraphQLError && + maybeError.extensions.code === ApolloServerErrorCode.BAD_REQUEST) { + try { + await Promise.all(this.internals.plugins.map(async (plugin) => plugin.invalidRequestWasReceived?.({ error: maybeError }))); + } + catch (pluginError) { + this.logger.error(`invalidRequestWasReceived hook threw: ${pluginError}`); + } + } + return await this.errorResponse(maybeError, httpGraphQLRequest); + } + } + async errorResponse(error, requestHead) { + const { formattedErrors, httpFromErrors } = normalizeAndFormatErrors([error], { + includeStacktraceInErrorResponses: this.internals.includeStacktraceInErrorResponses, + formatError: this.internals.formatError, + }); + return { + status: httpFromErrors.status ?? 500, + headers: new HeaderMap([ + ...httpFromErrors.headers, + [ + 'content-type', + chooseContentTypeForSingleResultResponse(requestHead) ?? + MEDIA_TYPES.APPLICATION_JSON, + ], + ]), + body: { + kind: 'complete', + string: await this.internals.stringifyResult({ + errors: formattedErrors, + }), + }, + }; + } + prefersHTML(request) { + const acceptHeader = request.headers.get('accept'); + return (request.method === 'GET' && + !!acceptHeader && + new Negotiator({ + headers: { accept: acceptHeader }, + }).mediaType([ + MEDIA_TYPES.APPLICATION_JSON, + MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + MEDIA_TYPES.MULTIPART_MIXED_NO_DEFER_SPEC, + MEDIA_TYPES.TEXT_HTML, + ]) === MEDIA_TYPES.TEXT_HTML); + } + async executeOperation(request, options = {}) { + if (this.internals.state.phase === 'initialized') { + await this.start(); + } + const schemaDerivedData = (await this._ensureStarted()).schemaManager.getSchemaDerivedData(); + const graphQLRequest = { + ...request, + query: request.query && typeof request.query !== 'string' + ? print(request.query) + : request.query, + }; + const response = await internalExecuteOperation({ + server: this, + graphQLRequest, + internals: this.internals, + schemaDerivedData, + sharedResponseHTTPGraphQLHead: null, + }, options); + return response; + } +} +export async function internalExecuteOperation({ server, graphQLRequest, internals, schemaDerivedData, sharedResponseHTTPGraphQLHead, }, options) { + const requestContext = { + logger: server.logger, + cache: server.cache, + schema: schemaDerivedData.schema, + request: graphQLRequest, + response: { + http: sharedResponseHTTPGraphQLHead ?? newHTTPGraphQLHead(), + }, + contextValue: cloneObject(options?.contextValue ?? {}), + metrics: {}, + overallCachePolicy: newCachePolicy(), + requestIsBatched: sharedResponseHTTPGraphQLHead !== null, + }; + try { + return await processGraphQLRequest(schemaDerivedData, server, internals, requestContext); + } + catch (maybeError) { + const error = ensureError(maybeError); + await Promise.all(internals.plugins.map(async (plugin) => plugin.unexpectedErrorProcessingRequest?.({ + requestContext, + error, + }))); + server.logger.error(`Unexpected error processing request: ${error}`); + throw new Error('Internal server error'); + } +} +export function isImplicitlyInstallablePlugin(p) { + return '__internal_installed_implicitly__' in p; +} +export const MEDIA_TYPES = { + APPLICATION_JSON: 'application/json; charset=utf-8', + APPLICATION_JSON_GRAPHQL_CALLBACK: 'application/json; callbackSpec=1.0; charset=utf-8', + APPLICATION_GRAPHQL_RESPONSE_JSON: 'application/graphql-response+json; charset=utf-8', + MULTIPART_MIXED_NO_DEFER_SPEC: 'multipart/mixed', + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2: 'multipart/mixed; deferSpec=20220824', + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9: 'multipart/mixed; incrementalSpec=v0.2', + TEXT_HTML: 'text/html', +}; +export function chooseContentTypeForSingleResultResponse(head) { + const acceptHeader = head.headers.get('accept'); + if (!acceptHeader) { + return MEDIA_TYPES.APPLICATION_JSON; + } + else { + const preferred = new Negotiator({ + headers: { accept: head.headers.get('accept') }, + }).mediaType([ + MEDIA_TYPES.APPLICATION_JSON, + MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON, + MEDIA_TYPES.APPLICATION_JSON_GRAPHQL_CALLBACK, + ]); + if (preferred) { + return preferred; + } + else { + return null; + } + } +} +function cloneObject(object) { + return Object.assign(Object.create(Object.getPrototypeOf(object)), object); +} +//# sourceMappingURL=ApolloServer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js.map new file mode 100644 index 00000000..b483c71a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/ApolloServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloServer.js","sourceRoot":"","sources":["../../src/ApolloServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GAEvB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,UAA+B,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,K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CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts new file mode 100644 index 00000000..c7125b0e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts @@ -0,0 +1,3 @@ +import type { CachePolicy } from '@apollo/cache-control-types'; +export declare function newCachePolicy(): CachePolicy; +//# sourceMappingURL=cachePolicy.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts.map new file mode 100644 index 00000000..983edd8a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cachePolicy.d.ts","sourceRoot":"","sources":["../../src/cachePolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1E,wBAAgB,cAAc,IAAI,WAAW,CA8B5C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js new file mode 100644 index 00000000..26947c99 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js @@ -0,0 +1,30 @@ +export function newCachePolicy() { + return { + maxAge: undefined, + scope: undefined, + restrict(hint) { + if (hint.maxAge !== undefined && + (this.maxAge === undefined || hint.maxAge < this.maxAge)) { + this.maxAge = hint.maxAge; + } + if (hint.scope !== undefined && this.scope !== 'PRIVATE') { + this.scope = hint.scope; + } + }, + replace(hint) { + if (hint.maxAge !== undefined) { + this.maxAge = hint.maxAge; + } + if (hint.scope !== undefined) { + this.scope = hint.scope; + } + }, + policyIfCacheable() { + if (this.maxAge === undefined || this.maxAge === 0) { + return null; + } + return { maxAge: this.maxAge, scope: this.scope ?? 'PUBLIC' }; + }, + }; +} +//# sourceMappingURL=cachePolicy.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js.map new file mode 100644 index 00000000..7ba6fe6b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/cachePolicy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cachePolicy.js","sourceRoot":"","sources":["../../src/cachePolicy.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,SAAS;QAChB,QAAQ,CAAC,IAAe;YACtB,IACE,IAAI,CAAC,MAAM,KAAK,SAAS;gBACzB,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,EACxD,CAAC;gBACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5B,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBACzD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,OAAO,CAAC,IAAe;YACrB,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5B,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,iBAAiB;YACf,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts new file mode 100644 index 00000000..5ae600c9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts @@ -0,0 +1,4 @@ +import type { ApolloConfig, ApolloConfigInput } from './externalTypes/index.js'; +import type { Logger } from '@apollo/utils.logger'; +export declare function determineApolloConfig(input: ApolloConfigInput | undefined, logger: Logger): ApolloConfig; +//# sourceMappingURL=determineApolloConfig.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts.map new file mode 100644 index 00000000..c444de30 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"determineApolloConfig.d.ts","sourceRoot":"","sources":["../../src/determineApolloConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAInD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,GACb,YAAY,CAuEd"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js new file mode 100644 index 00000000..d1e0ada0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js @@ -0,0 +1,55 @@ +import { createHash } from '@apollo/utils.createhash'; +export function determineApolloConfig(input, logger) { + const apolloConfig = {}; + const { APOLLO_KEY, APOLLO_GRAPH_REF, APOLLO_GRAPH_ID, APOLLO_GRAPH_VARIANT, } = process.env; + if (input?.key) { + apolloConfig.key = input.key.trim(); + } + else if (APOLLO_KEY) { + apolloConfig.key = APOLLO_KEY.trim(); + } + if ((input?.key ?? APOLLO_KEY) !== apolloConfig.key) { + logger.warn('The provided API key has unexpected leading or trailing whitespace. ' + + 'Apollo Server will trim the key value before use.'); + } + if (apolloConfig.key) { + assertValidHeaderValue(apolloConfig.key); + } + if (apolloConfig.key) { + apolloConfig.keyHash = createHash('sha512') + .update(apolloConfig.key) + .digest('hex'); + } + if (input?.graphRef) { + apolloConfig.graphRef = input.graphRef; + } + else if (APOLLO_GRAPH_REF) { + apolloConfig.graphRef = APOLLO_GRAPH_REF; + } + const graphId = input?.graphId ?? APOLLO_GRAPH_ID; + const graphVariant = input?.graphVariant ?? APOLLO_GRAPH_VARIANT; + if (apolloConfig.graphRef) { + if (graphId) { + throw new Error('Cannot specify both graph ref and graph ID. Please use ' + + '`apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph ID.'); + } + if (graphVariant) { + throw new Error('Cannot specify both graph ref and graph variant. Please use ' + + '`apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph variant.'); + } + } + else if (graphId) { + apolloConfig.graphRef = graphVariant + ? `${graphId}@${graphVariant}` + : graphId; + } + return apolloConfig; +} +function assertValidHeaderValue(value) { + const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/g; + if (invalidHeaderCharRegex.test(value)) { + const invalidChars = value.match(invalidHeaderCharRegex); + throw new Error(`The API key provided to Apollo Server contains characters which are invalid as HTTP header values. The following characters found in the key are invalid: ${invalidChars.join(', ')}. Valid header values may only contain ASCII visible characters. If you think there is an issue with your key, please contact Apollo support.`); + } +} +//# sourceMappingURL=determineApolloConfig.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js.map new file mode 100644 index 00000000..2084af7e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/determineApolloConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"determineApolloConfig.js","sourceRoot":"","sources":["../../src/determineApolloConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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AC;IAEjE,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC1B,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,yDAAyD;gBACvD,4EAA4E,CAC/E,CAAC;QACJ,CAAC;QACD,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,8DAA8D;gBAC5D,iFAAiF,CACpF,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,EAAE,CAAC;QAKnB,YAAY,CAAC,QAAQ,GAAG,YAAY;YAClC,CAAC,CAAC,GAAG,OAAO,IAAI,YAAY,EAAE;YAC9B,CAAC,CAAC,OAAO,CAAC;IACd,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAG3C,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;IAC1D,IAAI,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CACb,6JAA6J,YAAY,CAAC,IAAI,CAC5K,IAAI,CACL,+IAA+I,CACjJ,CAAC;IACJ,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts new file mode 100644 index 00000000..cf93e3c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts @@ -0,0 +1,12 @@ +import { GraphQLError, type GraphQLFormattedError } from 'graphql'; +import type { HTTPGraphQLHead } from './externalTypes/http.js'; +export declare function normalizeAndFormatErrors(errors: ReadonlyArray, options?: { + formatError?: (formattedError: GraphQLFormattedError, error: unknown) => GraphQLFormattedError; + includeStacktraceInErrorResponses?: boolean; +}): { + formattedErrors: Array; + httpFromErrors: HTTPGraphQLHead; +}; +export declare function ensureError(maybeError: unknown): Error; +export declare function ensureGraphQLError(maybeError: unknown, messagePrefixIfNotGraphQLError?: string): GraphQLError; +//# sourceMappingURL=errorNormalize.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts.map new file mode 100644 index 00000000..9cce63b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errorNormalize.d.ts","sourceRoot":"","sources":["../../src/errorNormalize.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEZ,KAAK,qBAAqB,EAC3B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAY/D,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAC9B,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,CACZ,cAAc,EAAE,qBAAqB,EACrC,KAAK,EAAE,OAAO,KACX,qBAAqB,CAAC;IAC3B,iCAAiC,CAAC,EAAE,OAAO,CAAC;CACxC,GACL;IACD,eAAe,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC9C,cAAc,EAAE,eAAe,CAAC;CACjC,CAqDA;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,OAAO,GAAG,KAAK,CAItD;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,OAAO,EACnB,8BAA8B,GAAE,MAAW,GAC1C,YAAY,CAQd"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js new file mode 100644 index 00000000..ce2520d3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js @@ -0,0 +1,66 @@ +import { GraphQLError, } from 'graphql'; +import { ApolloServerErrorCode } from './errors/index.js'; +import { mergeHTTPGraphQLHead, newHTTPGraphQLHead } from './runHttpQuery.js'; +import { HeaderMap } from './utils/HeaderMap.js'; +export function normalizeAndFormatErrors(errors, options = {}) { + const formatError = options.formatError ?? ((error) => error); + const httpFromErrors = newHTTPGraphQLHead(); + return { + httpFromErrors, + formattedErrors: errors.map((error) => { + try { + return formatError(enrichError(error), error); + } + catch (formattingError) { + if (options.includeStacktraceInErrorResponses) { + return enrichError(formattingError); + } + else { + return { + message: 'Internal server error', + extensions: { code: ApolloServerErrorCode.INTERNAL_SERVER_ERROR }, + }; + } + } + }), + }; + function enrichError(maybeError) { + const graphqlError = ensureGraphQLError(maybeError); + const extensions = { + ...graphqlError.extensions, + code: graphqlError.extensions.code ?? + ApolloServerErrorCode.INTERNAL_SERVER_ERROR, + }; + if (isPartialHTTPGraphQLHead(extensions.http)) { + mergeHTTPGraphQLHead(httpFromErrors, { + headers: new HeaderMap(), + ...extensions.http, + }); + delete extensions.http; + } + if (options.includeStacktraceInErrorResponses) { + extensions.stacktrace = graphqlError.stack?.split('\n'); + } + return { ...graphqlError.toJSON(), extensions }; + } +} +export function ensureError(maybeError) { + return maybeError instanceof Error + ? maybeError + : new GraphQLError('Unexpected error value: ' + String(maybeError)); +} +export function ensureGraphQLError(maybeError, messagePrefixIfNotGraphQLError = '') { + const error = ensureError(maybeError); + return error instanceof GraphQLError + ? error + : new GraphQLError(messagePrefixIfNotGraphQLError + error.message, { + originalError: error, + }); +} +function isPartialHTTPGraphQLHead(x) { + return (!!x && + typeof x === 'object' && + (!('status' in x) || typeof x.status === 'number') && + (!('headers' in x) || x.headers instanceof Map)); +} +//# sourceMappingURL=errorNormalize.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js.map new file mode 100644 index 00000000..bac1654e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errorNormalize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errorNormalize.js","sourceRoot":"","sources":["../../src/errorNormalize.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,GAGb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAUjD,MAAM,UAAU,wBAAwB,CACtC,MAA8B,EAC9B,UAMI,EAAE;IAKN,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,kBAAkB,EAAE,CAAC;IAE5C,OAAO;QACL,cAAc;QACd,eAAe,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACpC,IAAI,CAAC;gBACH,OAAO,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,eAAe,EAAE,CAAC;gBACzB,IAAI,OAAO,CAAC,iCAAiC,EAAE,CA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C,UAAU,CAAC,CAAC;IAE7C,OAAO,KAAK,YAAY,YAAY;QAClC,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,YAAY,CAAC,8BAA8B,GAAG,KAAK,CAAC,OAAO,EAAE;YAC/D,aAAa,EAAE,KAAK;SACrB,CAAC,CAAC;AACT,CAAC;AAED,SAAS,wBAAwB,CAAC,CAAU;IAC1C,OAAO,CACL,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,QAAQ;QACrB,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,OAAQ,CAAS,CAAC,MAAM,KAAK,QAAQ,CAAC;QAC3D,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAK,CAAS,CAAC,OAAO,YAAY,GAAG,CAAC,CACzD,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts new file mode 100644 index 00000000..48e3927d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts @@ -0,0 +1,16 @@ +export declare enum ApolloServerErrorCode { + INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR", + GRAPHQL_PARSE_FAILED = "GRAPHQL_PARSE_FAILED", + GRAPHQL_VALIDATION_FAILED = "GRAPHQL_VALIDATION_FAILED", + PERSISTED_QUERY_NOT_FOUND = "PERSISTED_QUERY_NOT_FOUND", + PERSISTED_QUERY_NOT_SUPPORTED = "PERSISTED_QUERY_NOT_SUPPORTED", + BAD_USER_INPUT = "BAD_USER_INPUT", + OPERATION_RESOLUTION_FAILURE = "OPERATION_RESOLUTION_FAILURE", + BAD_REQUEST = "BAD_REQUEST" +} +export declare enum ApolloServerValidationErrorCode { + INTROSPECTION_DISABLED = "INTROSPECTION_DISABLED", + MAX_RECURSIVE_SELECTIONS_EXCEEDED = "MAX_RECURSIVE_SELECTIONS_EXCEEDED" +} +export declare function unwrapResolverError(error: unknown): unknown; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts.map new file mode 100644 index 00000000..492b97ba --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAEA,oBAAY,qBAAqB;IAC/B,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,yBAAyB,8BAA8B;IACvD,yBAAyB,8BAA8B;IACvD,6BAA6B,kCAAkC;IAC/D,cAAc,mBAAmB;IACjC,4BAA4B,iCAAiC;IAC7D,WAAW,gBAAgB;CAC5B;AAED,oBAAY,+BAA+B;IACzC,sBAAsB,2BAA2B;IACjD,iCAAiC,sCAAsC;CACxE;AAWD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK3D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js new file mode 100644 index 00000000..224d5c32 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js @@ -0,0 +1,24 @@ +import { GraphQLError } from 'graphql'; +export var ApolloServerErrorCode; +(function (ApolloServerErrorCode) { + ApolloServerErrorCode["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR"; + ApolloServerErrorCode["GRAPHQL_PARSE_FAILED"] = "GRAPHQL_PARSE_FAILED"; + ApolloServerErrorCode["GRAPHQL_VALIDATION_FAILED"] = "GRAPHQL_VALIDATION_FAILED"; + ApolloServerErrorCode["PERSISTED_QUERY_NOT_FOUND"] = "PERSISTED_QUERY_NOT_FOUND"; + ApolloServerErrorCode["PERSISTED_QUERY_NOT_SUPPORTED"] = "PERSISTED_QUERY_NOT_SUPPORTED"; + ApolloServerErrorCode["BAD_USER_INPUT"] = "BAD_USER_INPUT"; + ApolloServerErrorCode["OPERATION_RESOLUTION_FAILURE"] = "OPERATION_RESOLUTION_FAILURE"; + ApolloServerErrorCode["BAD_REQUEST"] = "BAD_REQUEST"; +})(ApolloServerErrorCode || (ApolloServerErrorCode = {})); +export var ApolloServerValidationErrorCode; +(function (ApolloServerValidationErrorCode) { + ApolloServerValidationErrorCode["INTROSPECTION_DISABLED"] = "INTROSPECTION_DISABLED"; + ApolloServerValidationErrorCode["MAX_RECURSIVE_SELECTIONS_EXCEEDED"] = "MAX_RECURSIVE_SELECTIONS_EXCEEDED"; +})(ApolloServerValidationErrorCode || (ApolloServerValidationErrorCode = {})); +export function unwrapResolverError(error) { + if (error instanceof GraphQLError && error.path && error.originalError) { + return error.originalError; + } + return error; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js.map new file mode 100644 index 00000000..f243894e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/errors/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,wEAA+C,CAAA;IAC/C,sEAA6C,CAAA;IAC7C,gFAAuD,CAAA;IACvD,gFAAuD,CAAA;IACvD,wFAA+D,CAAA;IAC/D,0DAAiC,CAAA;IACjC,sFAA6D,CAAA;IAC7D,oDAA2B,CAAA;AAC7B,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAED,MAAM,CAAN,IAAY,+BAGX;AAHD,WAAY,+BAA+B;IACzC,oFAAiD,CAAA;IACjD,0GAAuE,CAAA;AACzE,CAAC,EAHW,+BAA+B,KAA/B,+BAA+B,QAG1C;AAWD,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACvE,OAAO,KAAK,CAAC,aAAa,CAAC;IAC7B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts new file mode 100644 index 00000000..fae0e906 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts @@ -0,0 +1,78 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { IExecutableSchemaDefinition } from '@graphql-tools/schema'; +import type { DocumentNode, ExecutionArgs, FormattedExecutionResult, GraphQLFieldResolver, GraphQLFormattedError, GraphQLSchema, ParseOptions, ValidationRule } from 'graphql'; +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { GatewayInterface } from '@apollo/server-gateway-interface'; +import type { ApolloServerPlugin } from './plugins.js'; +import type { BaseContext, LegacyExperimentalExecuteIncrementally } from './index.js'; +import type { GraphQLExperimentalIncrementalExecutionResultsAlpha2, GraphQLExperimentalIncrementalExecutionResultsAlpha9 } from '../incrementalDeliveryPolyfill.js'; +import type { ValidationOptions } from '../ApolloServer.js'; +export type DocumentStore = KeyValueCache; +export interface ApolloConfigInput { + key?: string; + graphRef?: string; + graphId?: string; + graphVariant?: string; +} +export interface ApolloConfig { + key?: string; + keyHash?: string; + graphRef?: string; +} +export interface PersistedQueryOptions { + cache?: KeyValueCache; + ttl?: number | null; +} +export interface CSRFPreventionOptions { + requestHeaders?: string[]; +} +interface ApolloServerOptionsBase { + formatError?: (formattedError: GraphQLFormattedError, error: unknown) => GraphQLFormattedError; + rootValue?: ((parsedQuery: DocumentNode) => unknown) | unknown; + validationRules?: Array; + fieldResolver?: GraphQLFieldResolver; + cache?: KeyValueCache | 'bounded'; + includeStacktraceInErrorResponses?: boolean; + logger?: Logger; + allowBatchedHttpRequests?: boolean; + stringifyResult?: (value: FormattedExecutionResult) => string | Promise; + introspection?: boolean; + maxRecursiveSelections?: boolean | number; + hideSchemaDetailsFromClientErrors?: boolean; + plugins?: ApolloServerPlugin[]; + persistedQueries?: PersistedQueryOptions | false; + stopOnTerminationSignals?: boolean; + apollo?: ApolloConfigInput; + nodeEnv?: string; + documentStore?: DocumentStore | null; + dangerouslyDisableValidation?: boolean; + validationOptions?: ValidationOptions; + csrfPrevention?: CSRFPreventionOptions | boolean; + parseOptions?: ParseOptions; + executionOptions?: ExecutionArgs['options']; + status400ForVariableCoercionErrors?: boolean; + legacyExperimentalExecuteIncrementally?: LegacyExperimentalExecuteIncrementally; + __testing_incrementalExecutionResults?: GraphQLExperimentalIncrementalExecutionResultsAlpha2 | GraphQLExperimentalIncrementalExecutionResultsAlpha9; +} +export interface ApolloServerOptionsWithGateway extends ApolloServerOptionsBase { + gateway: GatewayInterface; + schema?: undefined; + typeDefs?: undefined; + resolvers?: undefined; +} +export interface ApolloServerOptionsWithSchema extends ApolloServerOptionsBase { + schema: GraphQLSchema; + gateway?: undefined; + typeDefs?: undefined; + resolvers?: undefined; +} +export interface ApolloServerOptionsWithTypeDefs extends ApolloServerOptionsBase { + typeDefs: IExecutableSchemaDefinition['typeDefs']; + resolvers?: IExecutableSchemaDefinition['resolvers']; + gateway?: undefined; + schema?: undefined; +} +export type ApolloServerOptionsWithStaticSchema = ApolloServerOptionsWithSchema | ApolloServerOptionsWithTypeDefs; +export type ApolloServerOptions = ApolloServerOptionsWithGateway | ApolloServerOptionsWithStaticSchema; +export {}; +//# sourceMappingURL=constructor.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts.map new file mode 100644 index 00000000..ea686ad1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constructor.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/constructor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,K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CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B,CAAC,QAAQ,SAAS,WAAW,CACzE,SAAQ,uBAAuB,CAAC,QAAQ,CAAC;IACzC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,+BAA+B,CAAC,QAAQ,SAAS,WAAW,CAC3E,SAAQ,uBAAuB,CAAC,QAAQ,CAAC;IAIzC,QAAQ,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAGD,MAAM,MAAM,mCAAmC,CAAC,QAAQ,SAAS,WAAW,IACxE,6BAA6B,CAAC,QAAQ,CAAC,GACvC,+BAA+B,CAAC,QAAQ,CAAC,CAAC;AAE9C,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,WAAW,IACxD,8BAA8B,CAAC,QAAQ,CAAC,GACxC,mCAAmC,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js new file mode 100644 index 00000000..f78bf690 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=constructor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js.map new file mode 100644 index 00000000..7f8edadb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/constructor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../../src/externalTypes/constructor.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts new file mode 100644 index 00000000..07f49516 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts @@ -0,0 +1,4 @@ +export type BaseContext = {}; +export type ContextFunction = (...integrationContext: TIntegrationSpecificArgs) => Promise; +export type ContextThunk = () => Promise; +//# sourceMappingURL=context.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts.map new file mode 100644 index 00000000..b4ed2bea --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/context.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG,EAAE,CAAC;AAI7B,MAAM,MAAM,eAAe,CACzB,wBAAwB,SAAS,GAAG,EAAE,EACtC,QAAQ,SAAS,WAAW,GAAG,WAAW,IACxC,CAAC,GAAG,kBAAkB,EAAE,wBAAwB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAM3E,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,WAAW,GAAG,WAAW,IACjE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js new file mode 100644 index 00000000..60208482 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js.map new file mode 100644 index 00000000..84aa5047 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/context.js.map @@ -0,0 +1 @@ +{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/externalTypes/context.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts new file mode 100644 index 00000000..e9558946 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts @@ -0,0 +1,41 @@ +import type { ExecutionArgs, ExecutionResult, FormattedExecutionResult } from 'graphql'; +import type { BaseContext } from './context.js'; +import type { HTTPGraphQLHead, HTTPGraphQLRequest } from './http.js'; +import type { WithRequired } from '@apollo/utils.withrequired'; +import type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 } from './incrementalDeliveryPolyfillAlpha2.js'; +import type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9 } from './incrementalDeliveryPolyfillAlpha9.js'; +import { type GraphQLExperimentalIncrementalExecutionResultsAlpha2 } from '../incrementalDeliveryPolyfill.js'; +export interface GraphQLRequest { + query?: string; + operationName?: string; + variables?: TVariables; + extensions?: Record; + http?: HTTPGraphQLRequest; +} +export type VariableValues = { + [name: string]: any; +}; +export type GraphQLResponseBody> = { + kind: 'single'; + singleResult: FormattedExecutionResult; +} | { + kind: 'incremental'; + initialResult: GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2; + subsequentResults: AsyncIterable; +} | { + kind: 'incremental'; + initialResult: GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9; + subsequentResults: AsyncIterable; +}; +export type GraphQLInProgressResponse> = { + http: HTTPGraphQLHead; + body?: GraphQLResponseBody; +}; +export type GraphQLResponse> = WithRequired, 'body'>; +export interface ExecuteOperationOptions { + contextValue?: TContext; +} +type PromiseOrValue = Promise | T; +export type LegacyExperimentalExecuteIncrementally, TExtensions = Record> = (args: ExecutionArgs) => PromiseOrValue | GraphQLExperimentalIncrementalExecutionResultsAlpha2>; +export {}; +//# sourceMappingURL=graphql.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts.map new file mode 100644 index 00000000..5b1099e6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/graphql.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,wBAAwB,EACzB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EACV,mEAAmE,EACnE,sEAAsE,EACvE,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,mEAAmE,EACnE,sEAAsE,EACvE,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,KAAK,oDAAoD,EAAE,MAAM,mCAAmC,CAAC;AAE9G,MAAM,WAAW,cAAc,CAC7B,UAAU,SAAS,cAAc,GAAG,cAAc;IAElD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B;AAED,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAOrD,MAAM,MAAM,mBAAmB,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAC3D;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;CAC/C,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,EAAE,mEAAmE,CAAC;IACnF,iBAAiB,EAAE,aAAa,CAAC,sEAAsE,CAAC,CAAC;CAC1G,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,EAAE,mEAAmE,CAAC;IACnF,iBAAiB,EAAE,aAAa,CAAC,sEAAsE,CAAC,CAAC;CAC1G,CAAC;AAEN,MAAM,MAAM,yBAAyB,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACvE,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,YAAY,CACzE,yBAAyB,CAAC,KAAK,CAAC,EAChC,MAAM,CACP,CAAC;AACF,MAAM,WAAW,uBAAuB,CAAC,QAAQ,SAAS,WAAW;IACnE,YAAY,CAAC,EAAE,QAAQ,CAAC;CACzB;AAED,KAAK,cAAc,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAExC,MAAM,MAAM,sCAAsC,CAChD,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACnC,CACF,IAAI,EAAE,aAAa,KAChB,cAAc,CACf,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,GACnC,oDAAoD,CAAC,KAAK,EAAE,WAAW,CAAC,CAC3E,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js new file mode 100644 index 00000000..87cfa4f7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=graphql.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js.map new file mode 100644 index 00000000..56ed0525 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/graphql.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/externalTypes/graphql.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts new file mode 100644 index 00000000..84ddf2dc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts @@ -0,0 +1,22 @@ +import type { HeaderMap } from '../utils/HeaderMap.js'; +export interface HTTPGraphQLRequest { + method: string; + headers: HeaderMap; + search: string; + body: unknown; +} +export interface HTTPGraphQLHead { + status?: number; + headers: HeaderMap; +} +export type HTTPGraphQLResponseBody = { + kind: 'complete'; + string: string; +} | { + kind: 'chunked'; + asyncIterator: AsyncIterableIterator; +}; +export type HTTPGraphQLResponse = HTTPGraphQLHead & { + body: HTTPGraphQLResponseBody; +}; +//# sourceMappingURL=http.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts.map new file mode 100644 index 00000000..50dd9e36 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/http.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IAEjC,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,SAAS,CAAC;IAQnB,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,SAAS,CAAC;CACpB;AAQD,MAAM,MAAM,uBAAuB,GAC/B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,IAAI,EAAE,uBAAuB,CAAC;CAC/B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js new file mode 100644 index 00000000..1b3af850 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js.map new file mode 100644 index 00000000..5acb1f39 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/http.js.map @@ -0,0 +1 @@ +{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/externalTypes/http.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts new file mode 100644 index 00000000..e4f892c6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts @@ -0,0 +1,28 @@ +import type { FormattedExecutionResult, GraphQLFormattedError } from 'graphql'; +interface ObjMap { + [key: string]: T; +} +export interface GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, TExtensions = ObjMap> extends FormattedExecutionResult { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +export interface GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, TExtensions = ObjMap> { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +export type GraphQLExperimentalFormattedIncrementalResultAlpha2, TExtensions = ObjMap> = GraphQLExperimentalFormattedIncrementalDeferResultAlpha2 | GraphQLExperimentalFormattedIncrementalStreamResultAlpha2; +export interface GraphQLExperimentalFormattedIncrementalDeferResultAlpha2, TExtensions = ObjMap> extends FormattedExecutionResult { + path?: ReadonlyArray; + label?: string; +} +export interface GraphQLExperimentalFormattedIncrementalStreamResultAlpha2, TExtensions = ObjMap> { + errors?: ReadonlyArray; + items?: TData | null; + path?: ReadonlyArray; + label?: string; + extensions?: TExtensions; +} +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha2.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map new file mode 100644 index 00000000..dd75bb75 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha2.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAS/E,UAAU,MAAM,CAAC,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,mEAAmE,CAClF,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAC7B,SAAQ,wBAAwB,CAAC,KAAK,EAAE,WAAW,CAAC;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,aAA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/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js new file mode 100644 index 00000000..721228d6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha2.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map new file mode 100644 index 00000000..42a84074 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha2.js","sourceRoot":"","sources":["../../../src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts new file mode 100644 index 00000000..610c4c86 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts @@ -0,0 +1,43 @@ +import type { FormattedExecutionResult, GraphQLFormattedError } from 'graphql'; +interface ObjMap { + [key: string]: T; +} +export interface GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, TExtensions = ObjMap> extends FormattedExecutionResult { + data: TData; + pending: ReadonlyArray; + hasNext: boolean; + extensions?: TExtensions; +} +export interface GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, TExtensions = ObjMap> { + hasNext: boolean; + pending?: ReadonlyArray; + incremental?: ReadonlyArray>; + completed?: ReadonlyArray; + extensions?: TExtensions; +} +export type GraphQLExperimentalFormattedIncrementalResultAlpha9, TExtensions = ObjMap> = GraphQLExperimentalFormattedIncrementalDeferResultAlpha9 | GraphQLExperimentalFormattedIncrementalStreamResultAlpha9; +export interface GraphQLExperimentalFormattedIncrementalDeferResultAlpha9, TExtensions = ObjMap> { + errors?: ReadonlyArray; + data: TData; + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +export interface GraphQLExperimentalFormattedIncrementalStreamResultAlpha9, TExtensions = ObjMap> { + errors?: ReadonlyArray; + items: TData; + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +export interface GraphQLExperimentalPendingResultAlpha9 { + id: string; + path: ReadonlyArray; + label?: string; +} +export interface GraphQLExperimentalFormattedCompletedResultAlpha9 { + id: string; + errors?: ReadonlyArray; +} +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha9.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map new file mode 100644 index 00000000..ea534d60 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha9.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAS/E,UAAU,MAAM,CAAC,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,mEAAmE,CAClF,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAC7B,SAAQ,wBAAwB,CAAC,KAAK,EAAE,WAAW,CAAC;IACpD,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,aAAa,CAAC,sCAAsC,CAAC,CAAC;IAC/D,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,sEAAsE,CACrF,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC,sCAAsC,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,aAAa,CACzB,mDAAmD,CAAC,KAAK,EAAE,WAAW,CAAC,CACxE,CAAC;IACF,SAAS,CAAC,EAAE,aAAa,CAAC,iDAAiD,CAAC,CAAC;IAC7E,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,MAAM,mDAAmD,CAC7D,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAE3B,wDAAwD,CAAC,KAAK,EAAE,WAAW,CAAC,GAC5E,yDAAyD,CACvD,KAAK,EACL,WAAW,CACZ,CAAC;AAEN,MAAM,WAAW,wDAAwD,CACvE,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,MAAM,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC9C,IAAI,EAAE,KAAK,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,yDAAyD,CACxE,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,EACtB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAE7B,MAAM,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC9C,KAAK,EAAE,KAAK,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,sCAAsC;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,MAAM,WAAW,iDAAiD;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;CAC/C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js new file mode 100644 index 00000000..dd6b82e4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfillAlpha9.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map new file mode 100644 index 00000000..73407f50 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfillAlpha9.js","sourceRoot":"","sources":["../../../src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts new file mode 100644 index 00000000..f0a994a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts @@ -0,0 +1,9 @@ +export type { BaseContext, ContextFunction, ContextThunk } from './context.js'; +export type { GraphQLRequest, GraphQLResponse, LegacyExperimentalExecuteIncrementally, } from './graphql.js'; +export type { HTTPGraphQLRequest, HTTPGraphQLResponse, HTTPGraphQLHead, } from './http.js'; +export type { ApolloServerPlugin, GraphQLFieldResolverParams, GraphQLRequestExecutionListener, GraphQLRequestListener, GraphQLRequestListenerDidResolveField, GraphQLRequestListenerExecutionDidEnd, GraphQLRequestListenerParsingDidEnd, GraphQLRequestListenerValidationDidEnd, GraphQLSchemaContext, GraphQLServerListener, GraphQLServerContext, LandingPage, } from './plugins.js'; +export type { GraphQLRequestContext, GraphQLRequestMetrics, GraphQLRequestContextDidEncounterErrors, GraphQLRequestContextDidResolveOperation, GraphQLRequestContextDidResolveSource, GraphQLRequestContextExecutionDidStart, GraphQLRequestContextParsingDidStart, GraphQLRequestContextResponseForOperation, GraphQLRequestContextValidationDidStart, GraphQLRequestContextWillSendResponse, } from './requestPipeline.js'; +export type { DocumentStore, ApolloConfigInput, ApolloConfig, PersistedQueryOptions, CSRFPreventionOptions, ApolloServerOptionsWithSchema, ApolloServerOptionsWithTypeDefs, ApolloServerOptionsWithStaticSchema, ApolloServerOptionsWithGateway, ApolloServerOptions, } from './constructor.js'; +export type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, GraphQLExperimentalFormattedIncrementalResultAlpha2, GraphQLExperimentalFormattedIncrementalDeferResultAlpha2, GraphQLExperimentalFormattedIncrementalStreamResultAlpha2, } from './incrementalDeliveryPolyfillAlpha2.js'; +export type { GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, GraphQLExperimentalFormattedIncrementalStreamResultAlpha9, GraphQLExperimentalFormattedIncrementalDeferResultAlpha9, GraphQLExperimentalFormattedCompletedResultAlpha9, GraphQLExperimentalFormattedIncrementalResultAlpha9, GraphQLExperimentalPendingResultAlpha9, } from './incrementalDeliveryPolyfillAlpha9.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts.map new file mode 100644 index 00000000..20512a9f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/index.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/E,YAAY,EACV,cAAc,EACd,eAAe,EACf,sCAAsC,GACvC,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,+BAA+B,EAC/B,sBAAsB,EACtB,qCAAqC,EACrC,qCAAqC,EACrC,mCAAmC,EACnC,sCAAsC,EACtC,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,uCAAuC,EACvC,wCAAwC,EACxC,qCAAqC,EACrC,sCAAsC,EACtC,oCAAoC,EACpC,yCAAyC,EACzC,uCAAuC,EACvC,qCAAqC,GACtC,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,mEAAmE,EACnE,sEAAsE,EACtE,mDAAmD,EACnD,wDAAwD,EACxD,yDAAyD,GAC1D,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EACV,mEAAmE,EACnE,sEAAsE,EACtE,yDAAyD,EACzD,wDAAwD,EACxD,iDAAiD,EACjD,mDAAmD,EACnD,sCAAsC,GACvC,MAAM,wCAAwC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js new file mode 100644 index 00000000..f8a711af --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js.map new file mode 100644 index 00000000..4dad4658 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/externalTypes/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts new file mode 100644 index 00000000..3f1651c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts @@ -0,0 +1,75 @@ +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { Logger } from '@apollo/utils.logger'; +import type { GraphQLError, GraphQLResolveInfo, GraphQLSchema } from 'graphql'; +import type { ApolloConfig } from './constructor.js'; +import type { BaseContext } from './context.js'; +import type { GraphQLResponse } from './graphql.js'; +import type { GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 } from './incrementalDeliveryPolyfillAlpha2.js'; +import type { GraphQLRequestContext, GraphQLRequestContextDidEncounterErrors, GraphQLRequestContextDidEncounterSubsequentErrors, GraphQLRequestContextDidResolveOperation, GraphQLRequestContextDidResolveSource, GraphQLRequestContextExecutionDidStart, GraphQLRequestContextParsingDidStart, GraphQLRequestContextResponseForOperation, GraphQLRequestContextValidationDidStart, GraphQLRequestContextWillSendResponse, GraphQLRequestContextWillSendSubsequentPayload } from './requestPipeline.js'; +import type { GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9 } from './incrementalDeliveryPolyfillAlpha9.js'; +export interface GraphQLServerContext { + readonly logger: Logger; + readonly cache: KeyValueCache; + schema: GraphQLSchema; + apollo: ApolloConfig; + startedInBackground: boolean; +} +export interface GraphQLSchemaContext { + apiSchema: GraphQLSchema; + coreSupergraphSdl?: string; +} +export interface ApolloServerPlugin { + serverWillStart?(service: GraphQLServerContext): Promise; + requestDidStart?(requestContext: GraphQLRequestContext): Promise | void>; + unexpectedErrorProcessingRequest?({ requestContext, error, }: { + requestContext: GraphQLRequestContext; + error: Error; + }): Promise; + contextCreationDidFail?({ error }: { + error: Error; + }): Promise; + invalidRequestWasReceived?({ error }: { + error: Error; + }): Promise; + startupDidFail?({ error }: { + error: Error; + }): Promise; +} +export interface GraphQLServerListener { + schemaDidLoadOrUpdate?(schemaContext: GraphQLSchemaContext): void; + drainServer?(): Promise; + serverWillStop?(): Promise; + renderLandingPage?(): Promise; +} +export interface LandingPage { + html: string | (() => Promise); +} +export type GraphQLRequestListenerParsingDidEnd = (err?: Error) => Promise; +export type GraphQLRequestListenerValidationDidEnd = (err?: ReadonlyArray) => Promise; +export type GraphQLRequestListenerExecutionDidEnd = (err?: Error) => Promise; +export type GraphQLRequestListenerDidResolveField = (error: Error | null, result?: any) => void; +export interface GraphQLRequestListener { + didResolveSource?(requestContext: GraphQLRequestContextDidResolveSource): Promise; + parsingDidStart?(requestContext: GraphQLRequestContextParsingDidStart): Promise; + validationDidStart?(requestContext: GraphQLRequestContextValidationDidStart): Promise; + didResolveOperation?(requestContext: GraphQLRequestContextDidResolveOperation): Promise; + didEncounterErrors?(requestContext: GraphQLRequestContextDidEncounterErrors): Promise; + responseForOperation?(requestContext: GraphQLRequestContextResponseForOperation): Promise; + executionDidStart?(requestContext: GraphQLRequestContextExecutionDidStart): Promise | void>; + willSendResponse?(requestContext: GraphQLRequestContextWillSendResponse): Promise; + didEncounterSubsequentErrors?(requestContext: GraphQLRequestContextDidEncounterSubsequentErrors, errors: ReadonlyArray): Promise; + willSendSubsequentPayload?(requestContext: GraphQLRequestContextWillSendSubsequentPayload, payload: GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 | GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9): Promise; +} +export type GraphQLFieldResolverParams = { + source: TSource; + args: TArgs; + contextValue: TContext; + info: GraphQLResolveInfo; +}; +export interface GraphQLRequestExecutionListener { + executionDidEnd?: GraphQLRequestListenerExecutionDidEnd; + willResolveField?(fieldResolverParams: GraphQLFieldResolverParams): GraphQLRequestListenerDidResolveField | void; +} +//# sourceMappingURL=plugins.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts.map new file mode 100644 index 00000000..5c178661 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/plugins.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,E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AAC,YAAY,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC,CAAC;IAGjB,yBAAyB,CAAC,CACxB,cAAc,EAAE,8CAA8C,CAAC,QAAQ,CAAC,EACxE,OAAO,EACH,sEAAsE,GACtE,sEAAsE,GACzE,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAYD,MAAM,MAAM,0BAA0B,CACpC,OAAO,EACP,QAAQ,EACR,KAAK,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAChC;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,QAAQ,CAAC;IACvB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,+BAA+B,CAAC,QAAQ,SAAS,WAAW;IAC3E,eAAe,CAAC,EAAE,qCAAqC,CAAC;IAOxD,gBAAgB,CAAC,CACf,mBAAmB,EAAE,0BAA0B,CAAC,GAAG,EAAE,QAAQ,CAAC,GAC7D,qCAAqC,GAAG,IAAI,CAAC;CACjD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js new file mode 100644 index 00000000..684831f9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=plugins.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js.map new file mode 100644 index 00000000..cef3894d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/plugins.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/externalTypes/plugins.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts new file mode 100644 index 00000000..a77ac3a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts @@ -0,0 +1,50 @@ +import type { WithRequired } from '@apollo/utils.withrequired'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { BaseContext } from './context.js'; +import type { GraphQLInProgressResponse, GraphQLRequest, GraphQLResponse } from './graphql.js'; +import type { Logger } from '@apollo/utils.logger'; +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { DocumentNode, GraphQLError, GraphQLSchema, OperationDefinitionNode } from 'graphql'; +import type { CachePolicy } from '@apollo/cache-control-types'; +import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface'; +export interface GraphQLRequestMetrics { + captureTraces?: boolean; + persistedQueryHit?: boolean; + persistedQueryRegister?: boolean; + responseCacheHit?: boolean; + forbiddenOperation?: boolean; + registeredOperation?: boolean; + startHrTime?: [number, number]; + queryPlanTrace?: Trace.QueryPlanNode; + nonFtv1ErrorPaths?: NonFtv1ErrorPath[]; +} +export interface GraphQLRequestContext { + readonly logger: Logger; + readonly cache: KeyValueCache; + readonly request: GraphQLRequest; + readonly response: GraphQLInProgressResponse; + readonly schema: GraphQLSchema; + readonly contextValue: TContext; + readonly queryHash?: string; + readonly document?: DocumentNode; + readonly source?: string; + readonly operationName?: string | null; + readonly operation?: OperationDefinitionNode; + readonly errors?: ReadonlyArray; + readonly metrics: GraphQLRequestMetrics; + readonly overallCachePolicy: CachePolicy; + readonly requestIsBatched: boolean; +} +export type GraphQLRequestContextDidResolveSource = WithRequired, 'source' | 'queryHash'>; +export type GraphQLRequestContextParsingDidStart = GraphQLRequestContextDidResolveSource; +export type GraphQLRequestContextValidationDidStart = GraphQLRequestContextParsingDidStart & WithRequired, 'document'>; +export type GraphQLRequestContextDidResolveOperation = GraphQLRequestContextValidationDidStart & WithRequired, 'operationName'>; +export type GraphQLRequestContextDidEncounterErrors = WithRequired, 'errors'>; +export type GraphQLRequestContextResponseForOperation = WithRequired, 'source' | 'document' | 'operation' | 'operationName'>; +export type GraphQLRequestContextExecutionDidStart = GraphQLRequestContextParsingDidStart & WithRequired, 'document' | 'operation' | 'operationName'>; +export type GraphQLRequestContextWillSendResponse = GraphQLRequestContextDidResolveSource & { + readonly response: GraphQLResponse; +}; +export type GraphQLRequestContextDidEncounterSubsequentErrors = GraphQLRequestContextWillSendResponse; +export type GraphQLRequestContextWillSendSubsequentPayload = GraphQLRequestContextWillSendResponse; +//# sourceMappingURL=requestPipeline.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts.map new file mode 100644 index 00000000..eb547e6b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.d.ts","sourceRoot":"","sources":["../../../src/externalTypes/requestPipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,O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,IAC1B,YAAY,CACd,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,eAAe,CACtD,CAAC;AACF,MAAM,MAAM,sCAAsC,CAChD,QAAQ,SAAS,WAAW,IAC1B,oCAAoC,CAAC,QAAQ,CAAC,GAChD,YAAY,CACV,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,UAAU,GAAG,WAAW,GAAG,eAAe,CAC3C,CAAC;AACJ,MAAM,MAAM,qCAAqC,CAC/C,QAAQ,SAAS,WAAW,IAC1B,qCAAqC,CAAC,QAAQ,CAAC,GAAG;IACpD,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;CACpC,CAAC;AACF,MAAM,MAAM,iDAAiD,CAC3D,QAAQ,SAAS,WAAW,IAC1B,qCAAqC,CAAC,QAAQ,CAAC,CAAC;AACpD,MAAM,MAAM,8CAA8C,CACxD,QAAQ,SAAS,WAAW,IAC1B,qCAAqC,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js new file mode 100644 index 00000000..5db75e58 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=requestPipeline.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js.map new file mode 100644 index 00000000..f15830a0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/externalTypes/requestPipeline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.js","sourceRoot":"","sources":["../../../src/externalTypes/requestPipeline.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts new file mode 100644 index 00000000..c42920ed --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts @@ -0,0 +1,2 @@ +export declare const packageVersion = "5.5.1"; +//# sourceMappingURL=packageVersion.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts.map new file mode 100644 index 00000000..311839d9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../../../src/generated/packageVersion.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,UAAU,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js new file mode 100644 index 00000000..fe7040d5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js @@ -0,0 +1,2 @@ +export const packageVersion = "5.5.1"; +//# sourceMappingURL=packageVersion.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js.map new file mode 100644 index 00000000..ea9abb0d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/generated/packageVersion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../../../src/generated/packageVersion.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts new file mode 100644 index 00000000..c0d60f07 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts @@ -0,0 +1,4 @@ +import type { BaseContext, HTTPGraphQLRequest, HTTPGraphQLResponse } from './externalTypes/index.js'; +import type { ApolloServer, ApolloServerInternals, SchemaDerivedData } from './ApolloServer'; +export declare function runPotentiallyBatchedHttpQuery(server: ApolloServer, httpGraphQLRequest: HTTPGraphQLRequest, contextValue: TContext, schemaDerivedData: SchemaDerivedData, internals: ApolloServerInternals): Promise; +//# sourceMappingURL=httpBatching.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts.map new file mode 100644 index 00000000..f2e00c91 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"httpBatching.d.ts","sourceRoot":"","sources":["../../src/httpBatching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AA4DxB,wBAAsB,8BAA8B,CAClD,QAAQ,SAAS,WAAW,EAE5B,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,QAAQ,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC,CA2B9B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js new file mode 100644 index 00000000..75c00a27 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js @@ -0,0 +1,55 @@ +import { newHTTPGraphQLHead, runHttpQuery } from './runHttpQuery.js'; +import { BadRequestError } from './internalErrorClasses.js'; +async function runBatchedHttpQuery({ server, batchRequest, body, contextValue, schemaDerivedData, internals, }) { + if (body.length === 0) { + throw new BadRequestError('No operations found in request.'); + } + const sharedResponseHTTPGraphQLHead = newHTTPGraphQLHead(); + const responseBodies = await Promise.all(body.map(async (bodyPiece) => { + const singleRequest = { + ...batchRequest, + body: bodyPiece, + }; + const response = await runHttpQuery({ + server, + httpRequest: singleRequest, + contextValue, + schemaDerivedData, + internals, + sharedResponseHTTPGraphQLHead, + }); + if (response.body.kind === 'chunked') { + throw Error('Incremental delivery is not implemented for batch requests'); + } + return response.body.string; + })); + return { + ...sharedResponseHTTPGraphQLHead, + body: { kind: 'complete', string: `[${responseBodies.join(',')}]` }, + }; +} +export async function runPotentiallyBatchedHttpQuery(server, httpGraphQLRequest, contextValue, schemaDerivedData, internals) { + if (!(httpGraphQLRequest.method === 'POST' && + Array.isArray(httpGraphQLRequest.body))) { + return await runHttpQuery({ + server, + httpRequest: httpGraphQLRequest, + contextValue, + schemaDerivedData, + internals, + sharedResponseHTTPGraphQLHead: null, + }); + } + if (internals.allowBatchedHttpRequests) { + return await runBatchedHttpQuery({ + server, + batchRequest: httpGraphQLRequest, + body: httpGraphQLRequest.body, + contextValue, + schemaDerivedData, + internals, + }); + } + throw new BadRequestError('Operation batching disabled.'); +} +//# sourceMappingURL=httpBatching.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js.map new file mode 100644 index 00000000..d0853b19 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/httpBatching.js.map @@ -0,0 +1 @@ +{"version":3,"file":"httpBatching.js","sourceRoot":"","sources":["../../src/httpBatching.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,KAAK,UAAU,mBAAmB,CAA+B,EAC/D,MAAM,EACN,YAA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kB;YAC/B,YAAY;YACZ,iBAAiB;YACjB,SAAS;YACT,6BAA6B,EAAE,IAAI;SACpC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,SAAS,CAAC,wBAAwB,EAAE,CAAC;QACvC,OAAO,MAAM,mBAAmB,CAAC;YAC/B,MAAM;YACN,YAAY,EAAE,kBAAkB;YAChC,IAAI,EAAE,kBAAkB,CAAC,IAAiB;YAC1C,YAAY;YACZ,iBAAiB;YACjB,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts new file mode 100644 index 00000000..3e9d24c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts @@ -0,0 +1,82 @@ +import { type ExecutionArgs, type ExecutionResult, type GraphQLError } from 'graphql'; +import { type LegacyExperimentalExecuteIncrementally } from './externalTypes/graphql.js'; +interface ObjMap { + [key: string]: T; +} +export interface GraphQLExperimentalInitialIncrementalExecutionResultAlpha2, TExtensions = ObjMap> extends ExecutionResult { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +export interface GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha2, TExtensions = ObjMap> { + hasNext: boolean; + incremental?: ReadonlyArray>; + extensions?: TExtensions; +} +type GraphQLExperimentalIncrementalResultAlpha2, TExtensions = ObjMap> = GraphQLExperimentalIncrementalDeferResultAlpha2 | GraphQLExperimentalIncrementalStreamResultAlpha2; +interface GraphQLExperimentalIncrementalDeferResultAlpha2, TExtensions = ObjMap> extends ExecutionResult { + path?: ReadonlyArray; + label?: string; +} +interface GraphQLExperimentalIncrementalStreamResultAlpha2, TExtensions = ObjMap> { + errors?: ReadonlyArray; + items?: TData | null; + path?: ReadonlyArray; + label?: string; + extensions?: TExtensions; +} +export interface GraphQLExperimentalIncrementalExecutionResultsAlpha2, TExtensions = ObjMap> { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha2; + subsequentResults: AsyncGenerator, void, void>; +} +export interface GraphQLExperimentalInitialIncrementalExecutionResultAlpha9, TExtensions = ObjMap> extends ExecutionResult { + data: TData; + pending: ReadonlyArray; + hasNext: true; + extensions?: TExtensions; +} +export interface GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha9, TExtensions = ObjMap> { + pending?: ReadonlyArray; + incremental?: ReadonlyArray>; + completed?: ReadonlyArray; + hasNext: boolean; + extensions?: TExtensions; +} +interface GraphQLExperimentalExecutionGroupResultAlpha9> { + errors?: ReadonlyArray; + data: TData; +} +interface GraphQLExperimentalIncrementalDeferResultAlpha9, TExtensions = ObjMap> extends GraphQLExperimentalExecutionGroupResultAlpha9 { + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +interface GraphQLExperimentalStreamItemsRecordResultAlpha9> { + errors?: ReadonlyArray; + items: TData; +} +interface GraphQLExperimentalIncrementalStreamResultAlpha9, TExtensions = ObjMap> extends GraphQLExperimentalStreamItemsRecordResultAlpha9 { + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} +type GraphQLExperimentalIncrementalResultAlpha9> = GraphQLExperimentalIncrementalDeferResultAlpha9 | GraphQLExperimentalIncrementalStreamResultAlpha9; +interface GraphQLExperimentalPendingResultAlpha9 { + id: string; + path: ReadonlyArray; + label?: string; +} +interface GraphQLExperimentalCompletedResultAlpha9 { + id: string; + errors?: ReadonlyArray; +} +export interface GraphQLExperimentalIncrementalExecutionResultsAlpha9, TSubsequent = unknown, TExtensions = ObjMap> { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha9; + subsequentResults: AsyncGenerator, void, void>; +} +export declare function executeIncrementally({ useLegacyIncremental, legacyExperimentalExecuteIncrementally, ...args }: ExecutionArgs & { + useLegacyIncremental?: boolean; + legacyExperimentalExecuteIncrementally: LegacyExperimentalExecuteIncrementally | undefined; +}): Promise; +export {}; +//# sourceMappingURL=incrementalDeliveryPolyfill.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts.map new file mode 100644 index 00000000..d609c082 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfill.d.ts","sourceRoot":"","sources":["../../src/incrementalDeliveryPolyfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,KAAK,sCAAsC,EAAE,MAAM,4BAA4B,CAAC;AAOzF,UAAU,MAAM,CAAC,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;CAClB;AAGD,MAAM,WAAW,0DAA0D,CACzE,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAC7B,SAAQ,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,aAAa,CACzB,0CAA0C,CAAC,KAAK,EAAE,WAAW,CAAC,CAC/D,CAAC;IACF,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM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wBAAsB,oBAAoB,CAAC,EACzC,oBAAoB,EACpB,sCAAsC,EACtC,GAAG,IAAI,EACR,EAAE,aAAa,GAAG;IACjB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,sCAAsC,EAClC,sCAAsC,GACtC,SAAS,CAAC;CACf,GAAG,OAAO,CACP,eAAe,GACf,oDAAoD,GACpD,oDAAoD,CACvD,CA4BA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js new file mode 100644 index 00000000..bf717d05 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js @@ -0,0 +1,38 @@ +import { execute, } from 'graphql'; +import { BadRequestError } from './internalErrorClasses.js'; +import { MEDIA_TYPES } from './ApolloServer.js'; +let graphqlExperimentalExecuteIncrementally = undefined; +async function tryToLoadGraphQL17() { + if (graphqlExperimentalExecuteIncrementally !== undefined) { + return; + } + const graphql = await import('graphql'); + if (graphql.version === '17.0.0-alpha.9' && + 'experimentalExecuteIncrementally' in graphql) { + graphqlExperimentalExecuteIncrementally = graphql + .experimentalExecuteIncrementally; + } + else { + graphqlExperimentalExecuteIncrementally = null; + } +} +export async function executeIncrementally({ useLegacyIncremental, legacyExperimentalExecuteIncrementally, ...args }) { + await tryToLoadGraphQL17(); + if (useLegacyIncremental) { + if (legacyExperimentalExecuteIncrementally) { + return legacyExperimentalExecuteIncrementally(args); + } + if (graphqlExperimentalExecuteIncrementally) { + throw new BadRequestError('Apollo Server received an operation that uses incremental delivery ' + + '(@defer or @stream) with the legacy incremental format, but the server ' + + 'does not support the legacy incremental delivery format. Add the HTTP ' + + `header: 'Accept: ${MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' ` + + 'to use the current incremental delivery format', { extensions: { http: { status: 406 } } }); + } + } + if (graphqlExperimentalExecuteIncrementally) { + return graphqlExperimentalExecuteIncrementally(args); + } + return execute(args); +} +//# sourceMappingURL=incrementalDeliveryPolyfill.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js.map new file mode 100644 index 00000000..470a3065 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/incrementalDeliveryPolyfill.js.map @@ -0,0 +1 @@ +{"version":3,"file":"incrementalDeliveryPolyfill.js","sourceRoot":"","sources":["../../src/incrementalDeliveryPolyfill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAIR,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAkLhD,IAAI,uCAAuC,GAO3B,SAAS,CAAC;AAE1B,KAAK,UAAU,kBAAkB;IAC/B,IAAI,uCAAuC,KAAK,SAAS,EAAE,CAAC;QAC1D,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;IACxC,IACE,OAAO,CAAC,OAAO,KAAK,gBAAgB;QACpC,kCAAkC,IAAI,OAAO,EAC7C,CAAC;QACD,uCAAuC,GAAI,OAAe;aACvD,gCAAgC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,uCAAuC,GAAG,IAAI,CAAC;IACjD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,oBAAoB,EACpB,sCAAsC,EACtC,GAAG,IAAI,EAMR;IAKC,MAAM,kBAAkB,EAAE,CAAC;IAE3B,IAAI,oBAAoB,EAAE,CAAC;QACzB,IAAI,sCAAsC,EAAE,CAAC;YAC3C,OAAO,sCAAsC,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;QAKD,IAAI,uCAAuC,EAAE,CAAC;YAC5C,MAAM,IAAI,eAAe,CACvB,qEAAqE;gBACnE,yEAAyE;gBACzE,wEAAwE;gBACxE,oBAAoB,WAAW,CAAC,oCAAoC,IAAI;gBACxE,gDAAgD,EAElD,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,CAC1C,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,uCAAuC,EAAE,CAAC;QAC5C,OAAO,uCAAuC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts new file mode 100644 index 00000000..caee4a82 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts @@ -0,0 +1,4 @@ +export { ApolloServer } from './ApolloServer.js'; +export { HeaderMap } from './utils/HeaderMap.js'; +export * from './externalTypes/index.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts.map new file mode 100644 index 00000000..13e33879 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,cAAc,0BAA0B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js new file mode 100644 index 00000000..d8099e54 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js @@ -0,0 +1,4 @@ +export { ApolloServer } from './ApolloServer.js'; +export { HeaderMap } from './utils/HeaderMap.js'; +export * from './externalTypes/index.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js.map new file mode 100644 index 00000000..6dac6c7a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,cAAc,0BAA0B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts new file mode 100644 index 00000000..82e9d045 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts @@ -0,0 +1,28 @@ +import { GraphQLError, type GraphQLErrorOptions } from 'graphql'; +import { ApolloServerErrorCode } from './errors/index.js'; +declare class GraphQLErrorWithCode extends GraphQLError { + constructor(message: string, code: ApolloServerErrorCode, options?: GraphQLErrorOptions); +} +export declare class SyntaxError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class ValidationError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class PersistedQueryNotFoundError extends GraphQLErrorWithCode { + constructor(); +} +export declare class PersistedQueryNotSupportedError extends GraphQLErrorWithCode { + constructor(); +} +export declare class UserInputError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class OperationResolutionError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError); +} +export declare class BadRequestError extends GraphQLErrorWithCode { + constructor(message: string, options?: GraphQLErrorOptions); +} +export {}; +//# sourceMappingURL=internalErrorClasses.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts.map new file mode 100644 index 00000000..cb8bc2da --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"internalErrorClasses.d.ts","sourceRoot":"","sources":["../../src/internalErrorClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAO1D,cAAM,oBAAqB,SAAQ,YAAY;gBAE3C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,mBAAmB;CAQhC;AAED,qBAAa,WAAY,SAAQ,oBAAoB;gBACvC,YAAY,EAAE,YAAY;CAQvC;AAED,qBAAa,eAAgB,SAAQ,oBAAoB;gBAC3C,YAAY,EAAE,YAAY;CAcvC;AAcD,qBAAa,2BAA4B,SAAQ,oBAAoB;;CAQpE;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;;CAYxE;AAED,qBAAa,cAAe,SAAQ,oBAAoB;gBAC1C,YAAY,EAAE,YAAY;CAOvC;AAED,qBAAa,wBAAyB,SAAQ,oBAAoB;gBACpD,YAAY,EAAE,YAAY;CAcvC;AAED,qBAAa,eAAgB,SAAQ,oBAAoB;gBAC3C,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;CAQ3D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js new file mode 100644 index 00000000..41587124 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js @@ -0,0 +1,81 @@ +import { GraphQLError } from 'graphql'; +import { ApolloServerErrorCode } from './errors/index.js'; +import { newHTTPGraphQLHead } from './runHttpQuery.js'; +import { HeaderMap } from './utils/HeaderMap.js'; +class GraphQLErrorWithCode extends GraphQLError { + constructor(message, code, options) { + super(message, { + ...options, + extensions: { ...options?.extensions, code }, + }); + this.name = this.constructor.name; + } +} +export class SyntaxError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, ApolloServerErrorCode.GRAPHQL_PARSE_FAILED, { + source: graphqlError.source, + positions: graphqlError.positions, + extensions: { http: newHTTPGraphQLHead(400), ...graphqlError.extensions }, + originalError: graphqlError, + }); + } +} +export class ValidationError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, ApolloServerErrorCode.GRAPHQL_VALIDATION_FAILED, { + nodes: graphqlError.nodes, + extensions: { + http: newHTTPGraphQLHead(400), + ...graphqlError.extensions, + }, + originalError: graphqlError.originalError ?? graphqlError, + }); + } +} +const getPersistedQueryErrorHttp = () => ({ + status: 200, + headers: new HeaderMap([ + ['cache-control', 'private, no-cache, must-revalidate'], + ]), +}); +export class PersistedQueryNotFoundError extends GraphQLErrorWithCode { + constructor() { + super('PersistedQueryNotFound', ApolloServerErrorCode.PERSISTED_QUERY_NOT_FOUND, { extensions: { http: getPersistedQueryErrorHttp() } }); + } +} +export class PersistedQueryNotSupportedError extends GraphQLErrorWithCode { + constructor() { + super('PersistedQueryNotSupported', ApolloServerErrorCode.PERSISTED_QUERY_NOT_SUPPORTED, { extensions: { http: getPersistedQueryErrorHttp() } }); + } +} +export class UserInputError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, ApolloServerErrorCode.BAD_USER_INPUT, { + nodes: graphqlError.nodes, + originalError: graphqlError.originalError ?? graphqlError, + extensions: graphqlError.extensions, + }); + } +} +export class OperationResolutionError extends GraphQLErrorWithCode { + constructor(graphqlError) { + super(graphqlError.message, ApolloServerErrorCode.OPERATION_RESOLUTION_FAILURE, { + nodes: graphqlError.nodes, + originalError: graphqlError.originalError ?? graphqlError, + extensions: { + http: newHTTPGraphQLHead(400), + ...graphqlError.extensions, + }, + }); + } +} +export class BadRequestError extends GraphQLErrorWithCode { + constructor(message, options) { + super(message, ApolloServerErrorCode.BAD_REQUEST, { + ...options, + extensions: { http: newHTTPGraphQLHead(400), ...options?.extensions }, + }); + } +} +//# sourceMappingURL=internalErrorClasses.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js.map new file mode 100644 index 00000000..a409703e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalErrorClasses.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internalErrorClasses.js","sourceRoot":"","sources":["../../src/internalErrorClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA4B,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAKjD,MAAM,oBAAqB,SAAQ,YAAY;IAC7C,YACE,OAAe,EACf,IAA2B,EAC3B,OAA6B;QAE7B,KAAK,CAAC,OAAO,EAAE;YACb,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;SAC7C,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,oBAAoB;IACnD,YAAY,YAA0B;QACpC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,qBAAqB,CAAC,oBAAoB,EAAE;YACtE,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,SAAS,EAAE,YAAY,CAAC,SAAS;YACjC,UAAU,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,UAAU,EAAE;YACzE,aAAa,EAAE,YAA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CAAC;CACF;AAED,MAAM,OAAO,wBAAyB,SAAQ,oBAAoB;IAChE,YAAY,YAA0B;QACpC,KAAK,CACH,YAAY,CAAC,OAAO,EACpB,qBAAqB,CAAC,4BAA4B,EAClD;YACE,KAAK,EAAE,YAAY,CAAC,KAAK;YACzB,aAAa,EAAE,YAAY,CAAC,aAAa,IAAI,YAAY;YACzD,UAAU,EAAE;gBACV,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;gBAC7B,GAAG,YAAY,CAAC,UAAU;aAC3B;SACF,CACF,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,oBAAoB;IACvD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,qBAAqB,CAAC,WAAW,EAAE;YAChD,GAAG,OAAO;YAGV,UAAU,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE;SACtE,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts new file mode 100644 index 00000000..5d6895db --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts @@ -0,0 +1,9 @@ +import type { BaseContext, ApolloServerPlugin } from './externalTypes/index.js'; +export interface InternalApolloServerPlugin extends ApolloServerPlugin { + __internal_plugin_id__: InternalPluginId; + __is_disabled_plugin__: boolean; +} +export declare function internalPlugin(p: InternalApolloServerPlugin): ApolloServerPlugin; +export type InternalPluginId = 'CacheControl' | 'LandingPageDisabled' | 'SchemaReporting' | 'InlineTrace' | 'UsageReporting' | 'DisableSuggestions'; +export declare function pluginIsInternal(plugin: ApolloServerPlugin): plugin is InternalApolloServerPlugin; +//# sourceMappingURL=internalPlugin.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts.map new file mode 100644 index 00000000..379b16c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"internalPlugin.d.ts","sourceRoot":"","sources":["../../src/internalPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAShF,MAAM,WAAW,0BAA0B,CAAC,QAAQ,SAAS,WAAW,CACtE,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAGpC,sBAAsB,EAAE,gBAAgB,CAAC;IACzC,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAMD,wBAAgB,cAAc,CAAC,QAAQ,SAAS,WAAW,EACzD,CAAC,EAAE,0BAA0B,CAAC,QAAQ,CAAC,GACtC,kBAAkB,CAAC,QAAQ,CAAC,CAE9B;AAED,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,qBAAqB,GACrB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,WAAW,EAC3D,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACnC,MAAM,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAIhD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js new file mode 100644 index 00000000..21c94fc4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js @@ -0,0 +1,7 @@ +export function internalPlugin(p) { + return p; +} +export function pluginIsInternal(plugin) { + return '__internal_plugin_id__' in plugin; +} +//# sourceMappingURL=internalPlugin.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js.map new file mode 100644 index 00000000..a3ad3ce4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/internalPlugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internalPlugin.js","sourceRoot":"","sources":["../../src/internalPlugin.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,cAAc,CAC5B,CAAuC;IAEvC,OAAO,CAAC,CAAC;AACX,CAAC;AAUD,MAAM,UAAU,gBAAgB,CAC9B,MAAoC;IAIpC,OAAO,wBAAwB,IAAI,MAAM,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/package.json new file mode 100644 index 00000000..7c34deb5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts new file mode 100644 index 00000000..6c8ed8be --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts @@ -0,0 +1,9 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import type { CacheHint } from '@apollo/cache-control-types'; +export interface ApolloServerPluginCacheControlOptions { + defaultMaxAge?: number; + calculateHttpHeaders?: boolean | 'if-cacheable'; + __testing__cacheHints?: Map; +} +export declare function ApolloServerPluginCacheControl(options?: ApolloServerPluginCacheControlOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts.map new file mode 100644 index 00000000..22b02c3c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/cacheControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAcvE,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,6BAA6B,CAAC;AAYrC,MAAM,WAAW,qCAAqC;IASpD,aAAa,CAAC,EAAE,MAAM,CAAC;IAUvB,oBAAoB,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IAEhD,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAChD;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,GAAE,qCAA2D,GACnE,kBAAkB,CAyRpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js new file mode 100644 index 00000000..c245f68d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js @@ -0,0 +1,220 @@ +import { getNamedType, isCompositeType, isInterfaceType, isObjectType, responsePathAsArray, } from 'graphql'; +import { newCachePolicy } from '../../cachePolicy.js'; +import { internalPlugin } from '../../internalPlugin.js'; +import { LRUCache } from 'lru-cache'; +export function ApolloServerPluginCacheControl(options = Object.create(null)) { + let typeAnnotationCache; + let fieldAnnotationCache; + return internalPlugin({ + __internal_plugin_id__: 'CacheControl', + __is_disabled_plugin__: false, + async serverWillStart({ schema }) { + typeAnnotationCache = new LRUCache({ + max: Object.values(schema.getTypeMap()).filter(isCompositeType) + .length, + }); + fieldAnnotationCache = new LRUCache({ + max: Object.values(schema.getTypeMap()) + .filter(isObjectType) + .flatMap((t) => Object.values(t.getFields())).length + + Object.values(schema.getTypeMap()) + .filter(isInterfaceType) + .flatMap((t) => Object.values(t.getFields())).length, + }); + return undefined; + }, + async requestDidStart(requestContext) { + function memoizedCacheAnnotationFromType(t) { + const existing = typeAnnotationCache.get(t); + if (existing) { + return existing; + } + const annotation = cacheAnnotationFromType(t); + typeAnnotationCache.set(t, annotation); + return annotation; + } + function memoizedCacheAnnotationFromField(field) { + const existing = fieldAnnotationCache.get(field); + if (existing) { + return existing; + } + const annotation = cacheAnnotationFromField(field); + fieldAnnotationCache.set(field, annotation); + return annotation; + } + const defaultMaxAge = options.defaultMaxAge ?? 0; + const calculateHttpHeaders = options.calculateHttpHeaders ?? true; + const { __testing__cacheHints } = options; + return { + async executionDidStart() { + if (isRestricted(requestContext.overallCachePolicy)) { + const fakeFieldPolicy = newCachePolicy(); + return { + willResolveField({ info }) { + info.cacheControl = { + setCacheHint: (dynamicHint) => { + fakeFieldPolicy.replace(dynamicHint); + }, + cacheHint: fakeFieldPolicy, + cacheHintFromType: memoizedCacheAnnotationFromType, + }; + }, + }; + } + return { + willResolveField({ info }) { + const fieldPolicy = newCachePolicy(); + let inheritMaxAge = false; + const targetType = getNamedType(info.returnType); + if (isCompositeType(targetType)) { + const typeAnnotation = memoizedCacheAnnotationFromType(targetType); + fieldPolicy.replace(typeAnnotation); + inheritMaxAge = !!typeAnnotation.inheritMaxAge; + } + const fieldAnnotation = memoizedCacheAnnotationFromField(info.parentType.getFields()[info.fieldName]); + if (fieldAnnotation.inheritMaxAge && + fieldPolicy.maxAge === undefined) { + inheritMaxAge = true; + if (fieldAnnotation.scope) { + fieldPolicy.replace({ scope: fieldAnnotation.scope }); + } + } + else { + fieldPolicy.replace(fieldAnnotation); + } + info.cacheControl = { + setCacheHint: (dynamicHint) => { + fieldPolicy.replace(dynamicHint); + }, + cacheHint: fieldPolicy, + cacheHintFromType: memoizedCacheAnnotationFromType, + }; + return () => { + if (fieldPolicy.maxAge === undefined && + ((isCompositeType(targetType) && !inheritMaxAge) || + !info.path.prev)) { + fieldPolicy.restrict({ maxAge: defaultMaxAge }); + } + if (__testing__cacheHints && isRestricted(fieldPolicy)) { + const path = responsePathAsArray(info.path).join('.'); + if (__testing__cacheHints.has(path)) { + throw Error("shouldn't happen: addHint should only be called once per path"); + } + __testing__cacheHints.set(path, { + maxAge: fieldPolicy.maxAge, + scope: fieldPolicy.scope, + }); + } + requestContext.overallCachePolicy.restrict(fieldPolicy); + }; + }, + }; + }, + async willSendResponse(requestContext) { + if (!calculateHttpHeaders) { + return; + } + const { response, overallCachePolicy } = requestContext; + const existingCacheControlHeader = parseExistingCacheControlHeader(response.http.headers.get('cache-control')); + if (existingCacheControlHeader.kind === 'unparsable') { + return; + } + const cachePolicy = newCachePolicy(); + cachePolicy.replace(overallCachePolicy); + if (existingCacheControlHeader.kind === 'parsable-and-cacheable') { + cachePolicy.restrict(existingCacheControlHeader.hint); + } + const policyIfCacheable = cachePolicy.policyIfCacheable(); + if (policyIfCacheable && + existingCacheControlHeader.kind !== 'uncacheable' && + response.body.kind === 'single' && + !response.body.singleResult.errors) { + response.http.headers.set('cache-control', `max-age=${policyIfCacheable.maxAge}, ${policyIfCacheable.scope.toLowerCase()}`); + } + else if (calculateHttpHeaders !== 'if-cacheable') { + response.http.headers.set('cache-control', CACHE_CONTROL_HEADER_UNCACHEABLE); + } + }, + }; + }, + }); +} +const CACHE_CONTROL_HEADER_CACHEABLE_REGEXP = /^max-age=(\d+), (public|private)$/; +const CACHE_CONTROL_HEADER_UNCACHEABLE = 'no-store'; +function parseExistingCacheControlHeader(header) { + if (!header) { + return { kind: 'no-header' }; + } + if (header === CACHE_CONTROL_HEADER_UNCACHEABLE) { + return { kind: 'uncacheable' }; + } + const match = CACHE_CONTROL_HEADER_CACHEABLE_REGEXP.exec(header); + if (!match) { + return { kind: 'unparsable' }; + } + return { + kind: 'parsable-and-cacheable', + hint: { + maxAge: +match[1], + scope: match[2] === 'public' ? 'PUBLIC' : 'PRIVATE', + }, + }; +} +function cacheAnnotationFromDirectives(directives) { + if (!directives) + return undefined; + const cacheControlDirective = directives.find((directive) => directive.name.value === 'cacheControl'); + if (!cacheControlDirective) + return undefined; + if (!cacheControlDirective.arguments) + return undefined; + const maxAgeArgument = cacheControlDirective.arguments.find((argument) => argument.name.value === 'maxAge'); + const scopeArgument = cacheControlDirective.arguments.find((argument) => argument.name.value === 'scope'); + const inheritMaxAgeArgument = cacheControlDirective.arguments.find((argument) => argument.name.value === 'inheritMaxAge'); + const scopeString = scopeArgument?.value?.kind === 'EnumValue' + ? scopeArgument.value.value + : undefined; + const scope = scopeString === 'PUBLIC' || scopeString === 'PRIVATE' + ? scopeString + : undefined; + if (inheritMaxAgeArgument?.value?.kind === 'BooleanValue' && + inheritMaxAgeArgument.value.value) { + return { inheritMaxAge: true, scope }; + } + return { + maxAge: maxAgeArgument?.value?.kind === 'IntValue' + ? parseInt(maxAgeArgument.value.value) + : undefined, + scope, + }; +} +function cacheAnnotationFromType(t) { + if (t.astNode) { + const hint = cacheAnnotationFromDirectives(t.astNode.directives); + if (hint) { + return hint; + } + } + if (t.extensionASTNodes) { + for (const node of t.extensionASTNodes) { + const hint = cacheAnnotationFromDirectives(node.directives); + if (hint) { + return hint; + } + } + } + return {}; +} +function cacheAnnotationFromField(field) { + if (field.astNode) { + const hint = cacheAnnotationFromDirectives(field.astNode.directives); + if (hint) { + return hint; + } + } + return {}; +} +function isRestricted(hint) { + return hint.maxAge !== undefined || hint.scope !== undefined; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js.map new file mode 100644 index 00000000..da0c39af --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/cacheControl/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/cacheControl/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,YAAY,EAGZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAyCrC,MAAM,UAAU,8BAA8B,CAC5C,UAAiD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAEpE,IAAI,mBAAoE,CAAC;I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AC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC;YACtC,CAAC,CAAC,SAAS;QACf,KAAK;KACN,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,CAAuB;IACtD,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACjE,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;YACvC,MAAM,IAAI,GAAG,6BAA6B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5D,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,wBAAwB,CAC/B,KAAqC;IAErC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,GAAG,6BAA6B,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACrE,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,YAAY,CAAC,IAAe;IACnC,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts new file mode 100644 index 00000000..d525873f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts @@ -0,0 +1,3 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export declare function ApolloServerPluginDisableSuggestions(): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts.map new file mode 100644 index 00000000..4273eaba --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/disableSuggestions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,wBAAgB,oCAAoC,IAAI,kBAAkB,CAmBzE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js new file mode 100644 index 00000000..97f6d6cd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js @@ -0,0 +1,19 @@ +import { internalPlugin } from '../../internalPlugin.js'; +export function ApolloServerPluginDisableSuggestions() { + return internalPlugin({ + __internal_plugin_id__: 'DisableSuggestions', + __is_disabled_plugin__: false, + async requestDidStart() { + return { + async validationDidStart() { + return async (validationErrors) => { + validationErrors?.forEach((error) => { + error.message = error.message.replace(/ ?Did you mean(.+?)\?$/, ''); + }); + }; + }, + }; + }, + }); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js.map new file mode 100644 index 00000000..6c506d62 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disableSuggestions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/disableSuggestions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,UAAU,oCAAoC;IAClD,OAAO,cAAc,CAAC;QACpB,sBAAsB,EAAE,oBAAoB;QAC5C,sBAAsB,EAAE,KAAK;QAC7B,KAAK,CAAC,eAAe;YACnB,OAAO;gBACL,KAAK,CAAC,kBAAkB;oBACtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,EAAE;wBAChC,gBAAgB,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;4BAClC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CACnC,wBAAwB,EACxB,EAAE,CACH,CAAC;wBACJ,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts new file mode 100644 index 00000000..4e5f168a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts @@ -0,0 +1,7 @@ +import type { BaseContext, ApolloServerPlugin } from '../../index.js'; +export declare function ApolloServerPluginCacheControlDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginInlineTraceDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginLandingPageDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginSchemaReportingDisabled(): ApolloServerPlugin; +export declare function ApolloServerPluginUsageReportingDisabled(): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts.map new file mode 100644 index 00000000..f6ce2f4e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/disabled/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AActE,wBAAgB,sCAAsC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAExF;AAED,wBAAgB,qCAAqC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAEvF;AAED,wBAAgB,qCAAqC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAEvF;AAED,wBAAgB,yCAAyC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAE3F;AAED,wBAAgB,wCAAwC,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAE1F"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js new file mode 100644 index 00000000..d17f0113 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js @@ -0,0 +1,23 @@ +function disabledPlugin(id) { + const plugin = { + __internal_plugin_id__: id, + __is_disabled_plugin__: true, + }; + return plugin; +} +export function ApolloServerPluginCacheControlDisabled() { + return disabledPlugin('CacheControl'); +} +export function ApolloServerPluginInlineTraceDisabled() { + return disabledPlugin('InlineTrace'); +} +export function ApolloServerPluginLandingPageDisabled() { + return disabledPlugin('LandingPageDisabled'); +} +export function ApolloServerPluginSchemaReportingDisabled() { + return disabledPlugin('SchemaReporting'); +} +export function ApolloServerPluginUsageReportingDisabled() { + return disabledPlugin('UsageReporting'); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js.map new file mode 100644 index 00000000..2c0adf3c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/disabled/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/disabled/index.ts"],"names":[],"mappings":"AAcA,SAAS,cAAc,CAAC,EAAoB;IAC1C,MAAM,MAAM,GAA4C;QACtD,sBAAsB,EAAE,EAAE;QAC1B,sBAAsB,EAAE,IAAI;KAC7B,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,sCAAsC;IACpD,OAAO,cAAc,CAAC,cAAc,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,qCAAqC;IACnD,OAAO,cAAc,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,qCAAqC;IACnD,OAAO,cAAc,CAAC,qBAAqB,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,yCAAyC;IACvD,OAAO,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,wCAAwC;IACtD,OAAO,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts new file mode 100644 index 00000000..84d3c574 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts @@ -0,0 +1,8 @@ +import type http from 'http'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export interface ApolloServerPluginDrainHttpServerOptions { + httpServer: http.Server; + stopGracePeriodMillis?: number; +} +export declare function ApolloServerPluginDrainHttpServer(options: ApolloServerPluginDrainHttpServerOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts.map new file mode 100644 index 00000000..5cea3bcc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAMvE,MAAM,WAAW,wCAAwC;IAIvD,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;IAKxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AASD,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wCAAwC,GAChD,kBAAkB,CAapB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js new file mode 100644 index 00000000..626dde29 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js @@ -0,0 +1,16 @@ +import { Stopper } from './stoppable.js'; +export function ApolloServerPluginDrainHttpServer(options) { + const stopper = new Stopper(options.httpServer); + return { + async serverWillStart() { + return { + async drainServer() { + const stopGracePeriodMillis = options.stopGracePeriodMillis ?? 10_000; + const signal = AbortSignal.timeout(stopGracePeriodMillis); + await stopper.stop(signal); + }, + }; + }, + }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js.map new file mode 100644 index 00000000..12830e63 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAwBzC,MAAM,UAAU,iCAAiC,CAC/C,OAAiD;IAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAChD,OAAO;QACL,KAAK,CAAC,eAAe;YACnB,OAAO;gBACL,KAAK,CAAC,WAAW;oBACf,MAAM,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,IAAI,MAAM,CAAC;oBACtE,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;oBAC1D,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC7B,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts new file mode 100644 index 00000000..a16c5b87 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts @@ -0,0 +1,10 @@ +import type http from 'http'; +import https from 'https'; +export declare class Stopper { + private server; + private requestCountPerSocket; + private stopped; + constructor(server: http.Server | https.Server); + stop(hardDestroyAbortSignal?: AbortSignal): Promise; +} +//# sourceMappingURL=stoppable.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts.map new file mode 100644 index 00000000..a3f526bf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stoppable.d.ts","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/stoppable.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,qBAAa,OAAO;IAIN,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,qBAAqB,CAA6B;IAC1D,OAAO,CAAC,OAAO,CAAS;gBAEJ,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM;IA+BhD,IAAI,CAAC,sBAAsB,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAyCnE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js new file mode 100644 index 00000000..db35ac76 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js @@ -0,0 +1,47 @@ +import https from 'https'; +export class Stopper { + server; + requestCountPerSocket = new Map(); + stopped = false; + constructor(server) { + this.server = server; + server.on(server instanceof https.Server ? 'secureConnection' : 'connection', (socket) => { + this.requestCountPerSocket.set(socket, 0); + socket.once('close', () => this.requestCountPerSocket.delete(socket)); + }); + server.on('request', (req, res) => { + this.requestCountPerSocket.set(req.socket, (this.requestCountPerSocket.get(req.socket) ?? 0) + 1); + res.once('finish', () => { + const pending = (this.requestCountPerSocket.get(req.socket) ?? 0) - 1; + this.requestCountPerSocket.set(req.socket, pending); + if (this.stopped && pending === 0) { + req.socket.end(); + } + }); + }); + } + async stop(hardDestroyAbortSignal) { + let gracefully = true; + await new Promise((resolve) => setImmediate(resolve)); + this.stopped = true; + const onAbort = () => { + gracefully = false; + this.requestCountPerSocket.forEach((_, socket) => socket.end()); + setImmediate(() => { + this.requestCountPerSocket.forEach((_, socket) => socket.destroy()); + }); + }; + hardDestroyAbortSignal?.addEventListener('abort', onAbort); + const closePromise = new Promise((resolve) => this.server.close(() => { + hardDestroyAbortSignal?.removeEventListener('abort', onAbort); + resolve(); + })); + this.requestCountPerSocket.forEach((requests, socket) => { + if (requests === 0) + socket.end(); + }); + await closePromise; + return gracefully; + } +} +//# sourceMappingURL=stoppable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js.map new file mode 100644 index 00000000..734af274 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/drainHttpServer/stoppable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stoppable.js","sourceRoot":"","sources":["../../../../src/plugin/drainHttpServer/stoppable.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,OAAO,OAAO;IAIE;IAHZ,qBAAqB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAClD,OAAO,GAAG,KAAK,CAAC;IAExB,YAAoB,MAAkC;QAAlC,WAAM,GAAN,MAAM,CAA4B;QAEpD,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CAAC,CAAC;QAC5D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAGpB,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,UAAU,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YAGhE,YAAY,CAAC,GAAG,EAAE;gBAChB,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;YACtE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACF,sBAAsB,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAI3D,MAAM,YAAY,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CACjD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YACrB,sBAAsB,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9D,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CACH,CAAC;QAGF,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YACtD,IAAI,QAAQ,KAAK,CAAC;gBAAE,MAAM,CAAC,GAAG,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;QAGH,MAAM,YAAY,CAAC;QAEnB,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts new file mode 100644 index 00000000..d07c950b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts @@ -0,0 +1,8 @@ +import type { SendErrorsOptions } from '../usageReporting/index.js'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export interface ApolloServerPluginInlineTraceOptions { + includeErrors?: SendErrorsOptions; + __onlyIfSchemaIsSubgraph?: boolean; +} +export declare function ApolloServerPluginInlineTrace(options?: ApolloServerPluginInlineTraceOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts.map new file mode 100644 index 00000000..8cb31a51 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/inlineTrace/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,WAAW,oCAAoC;IAoBnD,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAWlC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAOD,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,oCAA0D,GAClE,kBAAkB,CA2GpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js new file mode 100644 index 00000000..8c117b85 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js @@ -0,0 +1,67 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +import { TraceTreeBuilder } from '../traceTreeBuilder.js'; +import { internalPlugin } from '../../internalPlugin.js'; +import { schemaIsSubgraph } from '../schemaIsSubgraph.js'; +export function ApolloServerPluginInlineTrace(options = Object.create(null)) { + let enabled = options.__onlyIfSchemaIsSubgraph ? null : true; + return internalPlugin({ + __internal_plugin_id__: 'InlineTrace', + __is_disabled_plugin__: false, + async serverWillStart({ schema, logger }) { + if (enabled === null) { + enabled = schemaIsSubgraph(schema); + if (enabled) { + logger.info('Enabling inline tracing for this subgraph. To disable, use ' + + 'ApolloServerPluginInlineTraceDisabled.'); + } + } + }, + async requestDidStart({ request: { http }, metrics }) { + if (!enabled) { + return; + } + const treeBuilder = new TraceTreeBuilder({ + maskedBy: 'ApolloServerPluginInlineTrace', + sendErrors: options.includeErrors, + }); + if (http?.headers.get('apollo-federation-include-trace') !== 'ftv1') { + return; + } + if (metrics.captureTraces === false) { + return; + } + metrics.captureTraces = true; + treeBuilder.startTiming(); + return { + async executionDidStart() { + return { + willResolveField({ info }) { + return treeBuilder.willResolveField(info); + }, + }; + }, + async didEncounterErrors({ errors }) { + treeBuilder.didEncounterErrors(errors); + }, + async willSendResponse({ response }) { + treeBuilder.stopTiming(); + if (response.body.kind === 'incremental') { + return; + } + if (metrics.queryPlanTrace) { + treeBuilder.trace.queryPlan = metrics.queryPlanTrace; + } + const encodedUint8Array = Trace.encode(treeBuilder.trace).finish(); + const encodedBuffer = Buffer.from(encodedUint8Array, encodedUint8Array.byteOffset, encodedUint8Array.byteLength); + const extensions = response.body.singleResult.extensions || + (response.body.singleResult.extensions = Object.create(null)); + if (typeof extensions.ftv1 !== 'undefined') { + throw new Error('The `ftv1` extension was already present.'); + } + extensions.ftv1 = encodedBuffer.toString('base64'); + }, + }; + }, + }); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js.map new file mode 100644 index 00000000..3c14a4f3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/inlineTrace/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/inlineTrace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA0C1D,MAAM,UAAU,6BAA6B,CAC3C,UAAgD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAEnE,IAAI,OAAO,GAAmB,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7E,OAAO,cAAc,CAAC;QACpB,sBAAsB,EAAE,aAAa;QACrC,sBAAsB,EAAE,KAAK;QAC7B,KAAK,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;YAKtC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBACnC,IAAI,OAAO,EAAE,CAAC;oBACZ,MAAM,CAAC,IAAI,CACT,6DAA6D;wBAC3D,wCAAwC,CAC3C,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,C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AC,MAAM,EAAE,CAAC;oBACnE,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAC/B,iBAAiB,EACjB,iBAAiB,CAAC,UAAU,EAC5B,iBAAiB,CAAC,UAAU,CAC7B,CAAC;oBAEF,MAAM,UAAU,GACd,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU;wBACrC,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBAIhE,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;wBAC3C,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;oBAC/D,CAAC;oBAED,UAAU,CAAC,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBACrD,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts new file mode 100644 index 00000000..6da72f36 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts @@ -0,0 +1,4 @@ +import type { ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions, ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions } from './types'; +export declare const getEmbeddedExplorerHTML: (explorerCdnVersion: string, config: ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions, apolloServerVersion: string, nonce: string) => string; +export declare const getEmbeddedSandboxHTML: (sandboxCdnVersion: string, config: ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions, apolloServerVersion: string, nonce: string) => string; +//# sourceMappingURL=getEmbeddedHTML.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts.map new file mode 100644 index 00000000..51fd3b18 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getEmbeddedHTML.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/getEmbeddedHTML.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wDAAwD,EACxD,6DAA6D,EAC9D,MAAM,SAAS,CAAC;AAmBjB,eAAO,MAAM,uBAAuB,GAClC,oBAAoB,MAAM,EAC1B,QAAQ,6DAA6D,EACrE,qBAAqB,MAAM,EAC3B,OAAO,MAAM,WAsGd,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,mBAAmB,MAAM,EACzB,QAAQ,wDAAwD,EAChE,qBAAqB,MAAM,EAC3B,OAAO,MAAM,WAqEd,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js new file mode 100644 index 00000000..33e05002 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js @@ -0,0 +1,138 @@ +function getConfigStringForHtml(config) { + return JSON.stringify(config) + .replace('<', '\\u003c') + .replace('>', '\\u003e') + .replace('&', '\\u0026') + .replace("'", '\\u0027'); +} +export const getEmbeddedExplorerHTML = (explorerCdnVersion, config, apolloServerVersion, nonce) => { + const productionLandingPageEmbedConfigOrDefault = { + displayOptions: {}, + persistExplorerState: false, + runTelemetry: true, + ...(typeof config.embed === 'boolean' ? {} : config.embed), + }; + const embeddedExplorerParams = { + graphRef: config.graphRef, + target: '#embeddableExplorer', + initialState: { + ...('document' in config || 'headers' in config || 'variables' in config + ? { + document: config.document, + headers: config.headers, + variables: config.variables, + } + : {}), + ...('collectionId' in config + ? { + collectionId: config.collectionId, + operationId: config.operationId, + } + : {}), + displayOptions: { + ...productionLandingPageEmbedConfigOrDefault.displayOptions, + }, + }, + persistExplorerState: productionLandingPageEmbedConfigOrDefault.persistExplorerState, + includeCookies: config.includeCookies, + runtime: apolloServerVersion, + runTelemetry: productionLandingPageEmbedConfigOrDefault.runTelemetry, + allowDynamicStyles: false, + }; + return ` +
+

Welcome to Apollo Server

+

Apollo Explorer cannot be loaded; it appears that you might be offline.

+
+ +
+ + +`; +}; +export const getEmbeddedSandboxHTML = (sandboxCdnVersion, config, apolloServerVersion, nonce) => { + const localDevelopmentEmbedConfigOrDefault = { + runTelemetry: true, + endpointIsEditable: false, + initialState: {}, + ...(typeof config.embed === 'boolean' ? {} : (config.embed ?? {})), + }; + const embeddedSandboxConfig = { + target: '#embeddableSandbox', + initialState: { + ...('document' in config || 'headers' in config || 'variables' in config + ? { + document: config.document, + variables: config.variables, + headers: config.headers, + } + : {}), + ...('collectionId' in config + ? { + collectionId: config.collectionId, + operationId: config.operationId, + } + : {}), + includeCookies: config.includeCookies, + ...localDevelopmentEmbedConfigOrDefault.initialState, + }, + hideCookieToggle: false, + endpointIsEditable: localDevelopmentEmbedConfigOrDefault.endpointIsEditable, + runtime: apolloServerVersion, + runTelemetry: localDevelopmentEmbedConfigOrDefault.runTelemetry, + allowDynamicStyles: false, + }; + return ` +
+

Welcome to Apollo Server

+

Apollo Sandbox cannot be loaded; it appears that you might be offline.

+
+ +
+ + +`; +}; +//# sourceMappingURL=getEmbeddedHTML.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js.map new file mode 100644 index 00000000..797b7a1b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getEmbeddedHTML.js","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/getEmbeddedHTML.ts"],"names":[],"mappings":"AAcA,SAAS,sBAAsB,CAAC,MAAc;IAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SAC1B,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC;SACvB,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC;SACvB,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC;SACvB,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,kBAA0B,EAC1B,MAAqE,EACrE,mBAA2B,EAC3B,KAAa,EACb,EAAE;IA2BF,MAAM,yCAAyC,GAAG;QAChD,cAAc,EAAE,EAAE;QAClB,oBAAoB,EAAE,KAAK;QAC3B,YAAY,EAAE,IAAI;QAClB,GAAG,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC3D,CAAC;IACF,MAAM,sBAAsB,GAGF;QACxB,QAAQ,EAAE,MAAM,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,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;KACnE,CAAC;IACF,MAAM,qBAAqB,GAAG;QAC5B,MAAM,EAAE,oBAAoB;QAC5B,YAAY,EAAE;YACZ,GAAG,CAAC,UAAU,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,IAAI,WAAW,IAAI,MAAM;gBACtE,CAAC,CAAC;oBACE,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,SAAS,EAAE,MAAM,CAAC,SAAS;oBAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,cAAc,IAAI,MAAM;gBAC1B,CAAC,CAAC;oBACE,YAAY,EAAE,MAAM,CAAC,YAAY;oBACjC,WAAW,EAAE,MAAM,CAAC,WAAW;iBAChC;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,GAAG,oCAAoC,CAAC,YAAY;SACrD;QACD,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,oCAAoC,CAAC,kBAAkB;QAC3E,OAAO,EAAE,mBAAmB;QAC5B,YAAY,EAAE,oCAAoC,CAAC,YAAY;QAC/D,kBAAkB,EAAE,KAAK;KAC1B,CAAC;IACF,OAAO;;;;;eAKM,KAAK;;;;;;;;;;;;;;;iBAeH,KAAK,2DAA2D,kBAAkB,CAC/F,iBAAiB,CAClB,qDAAqD,kBAAkB,CACtE,mBAAmB,CACpB;iBACc,KAAK;;gCAEU,sBAAsB,CAAC,qBAAqB,CAAC;;;;;;;;CAQ5E,CAAC;AACF,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts new file mode 100644 index 00000000..b1af9bd0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts @@ -0,0 +1,9 @@ +import type { ApolloServerPlugin } from '../../../externalTypes/index.js'; +import type { ApolloServerPluginLandingPageLocalDefaultOptions, ApolloServerPluginLandingPageProductionDefaultOptions } from './types.js'; +export type { ApolloServerPluginLandingPageLocalDefaultOptions, ApolloServerPluginLandingPageProductionDefaultOptions, }; +export declare function ApolloServerPluginLandingPageLocalDefault(options?: ApolloServerPluginLandingPageLocalDefaultOptions): ApolloServerPlugin; +export declare function ApolloServerPluginLandingPageProductionDefault(options?: ApolloServerPluginLandingPageProductionDefaultOptions): ApolloServerPlugin; +export declare const DEFAULT_EMBEDDED_EXPLORER_VERSION = "v3"; +export declare const DEFAULT_EMBEDDED_SANDBOX_VERSION = "v2"; +export declare const DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION = "_latest"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts.map new file mode 100644 index 00000000..3f6e6dfd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EACV,gDAAgD,EAChD,qDAAqD,EAEtD,MAAM,YAAY,CAAC;AAQpB,YAAY,EACV,gDAAgD,EAChD,qDAAqD,GACtD,CAAC;AAEF,wBAAgB,yCAAyC,CACvD,OAAO,GAAE,gDAAqD,GAC7D,kBAAkB,CAWpB;AAED,wBAAgB,8CAA8C,CAC5D,OAAO,GAAE,qDAA0D,GAClE,kBAAkB,CAOpB;AAiCD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,gCAAgC,OAAO,CAAC;AACrD,eAAO,MAAM,0CAA0C,YAAY,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js new file mode 100644 index 00000000..d6fd6a79 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js @@ -0,0 +1,142 @@ +import { getEmbeddedExplorerHTML, getEmbeddedSandboxHTML, } from './getEmbeddedHTML.js'; +import { packageVersion } from '../../../generated/packageVersion.js'; +import { createHash } from '@apollo/utils.createhash'; +export function ApolloServerPluginLandingPageLocalDefault(options = {}) { + const { version, __internal_apolloStudioEnv__, ...rest } = { + embed: true, + ...options, + }; + return ApolloServerPluginLandingPageDefault(version, { + isProd: false, + apolloStudioEnv: __internal_apolloStudioEnv__, + ...rest, + }); +} +export function ApolloServerPluginLandingPageProductionDefault(options = {}) { + const { version, __internal_apolloStudioEnv__, ...rest } = options; + return ApolloServerPluginLandingPageDefault(version, { + isProd: true, + apolloStudioEnv: __internal_apolloStudioEnv__, + ...rest, + }); +} +function encodeConfig(config) { + return JSON.stringify(encodeURIComponent(JSON.stringify(config))); +} +const getNonEmbeddedLandingPageHTML = (cdnVersion, config, apolloServerVersion, nonce) => { + const encodedConfig = encodeConfig(config); + return ` +
+

Welcome to Apollo Server

+

The full landing page cannot be loaded; it appears that you might be offline.

+
+ +`; +}; +export const DEFAULT_EMBEDDED_EXPLORER_VERSION = 'v3'; +export const DEFAULT_EMBEDDED_SANDBOX_VERSION = 'v2'; +export const DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION = '_latest'; +function ApolloServerPluginLandingPageDefault(maybeVersion, config) { + const explorerVersion = maybeVersion ?? DEFAULT_EMBEDDED_EXPLORER_VERSION; + const sandboxVersion = maybeVersion ?? DEFAULT_EMBEDDED_SANDBOX_VERSION; + const apolloServerLandingPageVersion = maybeVersion ?? DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION; + const apolloServerVersion = `@apollo/server@${packageVersion}`; + const scriptSafeList = [ + 'https://apollo-server-landing-page.cdn.apollographql.com', + 'https://embeddable-sandbox.cdn.apollographql.com', + 'https://embeddable-explorer.cdn.apollographql.com', + ].join(' '); + const styleSafeList = [ + 'https://apollo-server-landing-page.cdn.apollographql.com', + 'https://embeddable-sandbox.cdn.apollographql.com', + 'https://embeddable-explorer.cdn.apollographql.com', + 'https://fonts.googleapis.com', + ].join(' '); + const iframeSafeList = [ + 'https://explorer.embed.apollographql.com', + 'https://sandbox.embed.apollographql.com', + 'https://embed.apollo.local:3000', + ].join(' '); + return { + __internal_installed_implicitly__: false, + async serverWillStart() { + return { + async renderLandingPage() { + const encodedASLandingPageVersion = encodeURIComponent(apolloServerLandingPageVersion); + async function html() { + const nonce = createHash('sha256') + .update(crypto.randomUUID()) + .digest('hex'); + const scriptCsp = `script-src 'self' 'nonce-${nonce}' ${scriptSafeList}`; + const styleCsp = `style-src 'nonce-${nonce}' ${styleSafeList}`; + const imageCsp = `img-src https://apollo-server-landing-page.cdn.apollographql.com`; + const manifestCsp = `manifest-src https://apollo-server-landing-page.cdn.apollographql.com`; + const frameCsp = `frame-src ${iframeSafeList}`; + return ` + + + + + + + + + + + + + + Apollo Server + + + +
+ + ${config.embed + ? 'graphRef' in config && config.graphRef + ? getEmbeddedExplorerHTML(explorerVersion, config, apolloServerVersion, nonce) + : !('graphRef' in config) + ? getEmbeddedSandboxHTML(sandboxVersion, config, apolloServerVersion, nonce) + : getNonEmbeddedLandingPageHTML(apolloServerLandingPageVersion, config, apolloServerVersion, nonce) + : getNonEmbeddedLandingPageHTML(apolloServerLandingPageVersion, config, apolloServerVersion, nonce)} +
+ + + `; + } + return { html }; + }, + }; + }, + }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js.map new file mode 100644 index 00000000..9f464359 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAOtD,MAAM,UAAU,yCAAyC,CACvD,UAA4D,EAAE;IAE9D,MAAM,EAAE,OAAO,EAAE,4BAA4B,EAAE,GAAG,IAAI,EAAE,GAAG;QAEzD,KAAK,EAAE,IAAa;QACpB,GAAG,OAAO;KACX,CAAC;IACF,OAAO,oCAAoC,CAAC,OAAO,EAAE;QACnD,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,4BAA4B;QAC7C,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,8CAA8C,CAC5D,UAAiE,EAAE;IAEnE,MAAM,EAAE,OAAO,EAAE,4BAA4B,EAAE,GAAG,IAAI,EAAE,GAAG,O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BAA8B,EAC9B,MAAM,EACN,mBAAmB,EACnB,KAAK,CACN;4BACP,CAAC,CAAC,6BAA6B,CAC3B,8BAA8B,EAC9B,MAAM,EACN,mBAAmB,EACnB,KAAK,CAEb;;;;WAIO,CAAC;oBACF,CAAC;oBACD,OAAO,EAAE,IAAI,EAAE,CAAC;gBAClB,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts new file mode 100644 index 00000000..361fcc37 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts @@ -0,0 +1,56 @@ +type InitialDocumentVariablesHeaders = { + document?: string; + variables?: Record; + headers?: Record; + collectionId?: never; + operationId?: never; +}; +type InitialStateForEmbeds = { + collectionId: string; + operationId: string; + document?: never; + variables?: never; + headers?: never; +} | InitialDocumentVariablesHeaders; +export type ApolloServerPluginLandingPageDefaultBaseOptions = { + version?: string; + footer?: boolean; + includeCookies?: boolean; + __internal_apolloStudioEnv__?: 'staging' | 'prod'; +}; +export type ApolloServerPluginNonEmbeddedLandingPageLocalDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & InitialDocumentVariablesHeaders & { + embed: false; +}; +export type ApolloServerPluginNonEmbeddedLandingPageProductionDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & InitialDocumentVariablesHeaders & { + graphRef?: string; + embed?: false; +}; +export type ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & { + embed?: true | EmbeddableSandboxOptions; +} & (InitialDocumentVariablesHeaders | InitialStateForEmbeds); +export type ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions = ApolloServerPluginLandingPageDefaultBaseOptions & { + graphRef: string; + embed: true | EmbeddableExplorerOptions; +} & InitialStateForEmbeds; +type EmbeddableSandboxOptions = { + runTelemetry?: boolean; + initialState?: { + pollForSchemaUpdates?: boolean; + sharedHeaders?: Record; + }; + endpointIsEditable?: boolean; +}; +type EmbeddableExplorerOptions = { + runTelemetry?: boolean; + displayOptions?: { + showHeadersAndEnvVars: boolean; + docsPanelState: 'open' | 'closed'; + theme: 'light' | 'dark'; + }; + persistExplorerState?: boolean; +}; +export type ApolloServerPluginLandingPageLocalDefaultOptions = ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions | ApolloServerPluginNonEmbeddedLandingPageLocalDefaultOptions; +export type ApolloServerPluginLandingPageProductionDefaultOptions = ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions | ApolloServerPluginNonEmbeddedLandingPageProductionDefaultOptions; +export type LandingPageConfig = ApolloServerPluginLandingPageLocalDefaultOptions | ApolloServerPluginLandingPageProductionDefaultOptions; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts.map new file mode 100644 index 00000000..0dfe36f7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/types.ts"],"names":[],"mappings":"AAAA,KAAK,+BAA+B,GAAG;IAKrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAA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;QAMb,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAY/B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACxC,CAAC;IAOF,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAI/B,YAAY,CAAC,EAAE,OAAO,CAAC;IAIvB,cAAc,CAAC,EAAE;QAQf,qBAAqB,EAAE,OAAO,CAAC;QAO/B,cAAc,EAAE,MAAM,GAAG,QAAQ,CAAC;QAMlC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;KACzB,CAAC;IAWF,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gDAAgD,GACxD,wDAAwD,GACxD,2DAA2D,CAAC;AAEhE,MAAM,MAAM,qDAAqD,GAC7D,6DAA6D,GAC7D,gEAAgE,CAAC;AAErE,MAAM,MAAM,iBAAiB,GACzB,gDAAgD,GAChD,qDAAqD,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js new file mode 100644 index 00000000..718fd38a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js.map new file mode 100644 index 00000000..bb64fe28 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/plugin/landingPage/default/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts new file mode 100644 index 00000000..74fee368 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts @@ -0,0 +1,3 @@ +import { type GraphQLSchema } from 'graphql'; +export declare function schemaIsSubgraph(schema: GraphQLSchema): boolean; +//# sourceMappingURL=schemaIsSubgraph.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts.map new file mode 100644 index 00000000..b9c8b724 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaIsSubgraph.d.ts","sourceRoot":"","sources":["../../../src/plugin/schemaIsSubgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,SAAS,CAAC;AAiBjB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAkB/D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js new file mode 100644 index 00000000..8a10079b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js @@ -0,0 +1,20 @@ +import { isObjectType, isScalarType, isNonNullType, } from 'graphql'; +export function schemaIsSubgraph(schema) { + const serviceType = schema.getType('_Service'); + if (!isObjectType(serviceType)) { + return false; + } + const sdlField = serviceType.getFields().sdl; + if (!sdlField) { + return false; + } + let sdlFieldType = sdlField.type; + if (isNonNullType(sdlFieldType)) { + sdlFieldType = sdlFieldType.ofType; + } + if (!isScalarType(sdlFieldType)) { + return false; + } + return sdlFieldType.name == 'String'; +} +//# sourceMappingURL=schemaIsSubgraph.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js.map new file mode 100644 index 00000000..331b9173 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaIsSubgraph.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaIsSubgraph.js","sourceRoot":"","sources":["../../../src/plugin/schemaIsSubgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AAiBjB,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC;IAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC;IACjC,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;IACrC,CAAC;IACD,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,YAAY,CAAC,IAAI,IAAI,QAAQ,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts new file mode 100644 index 00000000..d1d2dd62 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts @@ -0,0 +1,10 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import type { Fetcher } from '@apollo/utils.fetcher'; +export interface ApolloServerPluginSchemaReportingOptions { + initialDelayMaxMs?: number; + overrideReportedSchema?: string; + endpointUrl?: string; + fetcher?: Fetcher; +} +export declare function ApolloServerPluginSchemaReporting({ initialDelayMaxMs, overrideReportedSchema, endpointUrl, fetcher, }?: ApolloServerPluginSchemaReportingOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts.map new file mode 100644 index 00000000..8143d395 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/schemaReporting/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIrD,MAAM,WAAW,wCAAwC;IAavD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAuB3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAKhC,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,iCAAiC,CAC/C,EACE,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,OAAO,GACR,GAAE,wCAA8D,GAChE,kBAAkB,CAkIpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js new file mode 100644 index 00000000..6cf736a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js @@ -0,0 +1,97 @@ +import os from 'os'; +import { internalPlugin } from '../../internalPlugin.js'; +import { printSchema, validateSchema, buildSchema } from 'graphql'; +import { SchemaReporter } from './schemaReporter.js'; +import { schemaIsSubgraph } from '../schemaIsSubgraph.js'; +import { packageVersion } from '../../generated/packageVersion.js'; +import { computeCoreSchemaHash } from '../../utils/computeCoreSchemaHash.js'; +export function ApolloServerPluginSchemaReporting({ initialDelayMaxMs, overrideReportedSchema, endpointUrl, fetcher, } = Object.create(null)) { + const bootId = crypto.randomUUID(); + return internalPlugin({ + __internal_plugin_id__: 'SchemaReporting', + __is_disabled_plugin__: false, + async serverWillStart({ apollo, schema, logger }) { + const { key, graphRef } = apollo; + if (!key) { + throw Error('To use ApolloServerPluginSchemaReporting, you must provide an Apollo API ' + + 'key, via the APOLLO_KEY environment variable or via `new ApolloServer({apollo: {key})`'); + } + if (!graphRef) { + throw Error('To use ApolloServerPluginSchemaReporting, you must provide your graph ref (eg, ' + + "'my-graph-id@my-graph-variant'). Try setting the APOLLO_GRAPH_REF environment " + + 'variable or passing `new ApolloServer({apollo: {graphRef}})`.'); + } + if (overrideReportedSchema) { + try { + const validationErrors = validateSchema(buildSchema(overrideReportedSchema, { noLocation: true })); + if (validationErrors.length) { + throw new Error(validationErrors.map((error) => error.message).join('\n')); + } + } + catch (err) { + throw new Error('The schema provided to overrideReportedSchema failed to parse or ' + + `validate: ${err.message}`); + } + } + if (schemaIsSubgraph(schema)) { + throw Error([ + 'Schema reporting is not yet compatible with Apollo Federation subgraphs.', + "If you're interested in using schema reporting with subgraphs,", + 'please contact Apollo support. To set up managed federation, see', + 'https://go.apollo.dev/s/managed-federation', + ].join(' ')); + } + if (endpointUrl !== undefined) { + logger.info(`Apollo schema reporting: schema reporting URL override: ${endpointUrl}`); + } + const baseSchemaReport = { + bootId, + graphRef, + platform: process.env.APOLLO_SERVER_PLATFORM || 'local', + runtimeVersion: `node ${process.version}`, + userVersion: process.env.APOLLO_SERVER_USER_VERSION, + serverId: process.env.APOLLO_SERVER_ID || process.env.HOSTNAME || os.hostname(), + libraryVersion: `@apollo/server@${packageVersion}`, + }; + let currentSchemaReporter; + return { + schemaDidLoadOrUpdate({ apiSchema, coreSupergraphSdl }) { + if (overrideReportedSchema !== undefined) { + if (currentSchemaReporter) { + return; + } + else { + logger.info('Apollo schema reporting: schema to report has been overridden'); + } + } + const coreSchema = overrideReportedSchema ?? + coreSupergraphSdl ?? + printSchema(apiSchema); + const coreSchemaHash = computeCoreSchemaHash(coreSchema); + const schemaReport = { + ...baseSchemaReport, + coreSchemaHash, + }; + currentSchemaReporter?.stop(); + currentSchemaReporter = new SchemaReporter({ + schemaReport, + coreSchema, + apiKey: key, + endpointUrl, + logger, + initialReportingDelayInMs: Math.floor(Math.random() * (initialDelayMaxMs ?? 10_000)), + fallbackReportingDelayInMs: 20_000, + fetcher, + }); + currentSchemaReporter.start(); + logger.info('Apollo schema reporting: reporting a new schema to Studio! See your graph at ' + + `https://studio.apollographql.com/graph/${encodeURI(graphRef)}/ with server info ${JSON.stringify(schemaReport)}`); + }, + async serverWillStop() { + currentSchemaReporter?.stop(); + }, + }; + }, + }); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js.map new file mode 100644 index 00000000..9a2bb6b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/schemaReporting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EAAE,cA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oBAEF,qBAAqB,EAAE,IAAI,EAAE,CAAC;oBAC9B,qBAAqB,GAAG,IAAI,cAAc,CAAC;wBACzC,YAAY;wBACZ,UAAU;wBACV,MAAM,EAAE,GAAG;wBACX,WAAW;wBACX,MAAM;wBAEN,yBAAyB,EAAE,IAAI,CAAC,KAAK,CACnC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,iBAAiB,IAAI,MAAM,CAAC,CAC9C;wBACD,0BAA0B,EAAE,MAAM;wBAClC,OAAO;qBACR,CAAC,CAAC;oBACH,qBAAqB,CAAC,KAAK,EAAE,CAAC;oBAE9B,MAAM,CAAC,IAAI,CACT,+EAA+E;wBAC7E,0CAA0C,SAAS,CACjD,QAAQ,CACT,sBAAsB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CACxD,CAAC;gBACJ,CAAC;gBACD,KAAK,CAAC,cAAc;oBAClB,qBAAqB,EAAE,IAAI,EAAE,CAAC;gBAChC,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts new file mode 100644 index 00000000..d495772e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts @@ -0,0 +1,33 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { SchemaReport, ReportSchemaResponse } from './generated/operations'; +import type { Fetcher } from '@apollo/utils.fetcher'; +export declare const schemaReportGql = "#graphql\n mutation SchemaReport($report: SchemaReport!, $coreSchema: String) {\n reportSchema(report: $report, coreSchema: $coreSchema) {\n __typename\n ... on ReportSchemaError {\n message\n code\n }\n ... on ReportSchemaResponse {\n inSeconds\n withCoreSchema\n }\n }\n }\n"; +export declare class SchemaReporter { + private readonly schemaReport; + private readonly coreSchema; + private readonly endpointUrl; + private readonly logger; + private readonly initialReportingDelayInMs; + private readonly fallbackReportingDelayInMs; + private readonly fetcher; + private isStopped; + private pollTimer?; + private readonly headers; + constructor(options: { + schemaReport: SchemaReport; + coreSchema: string; + apiKey: string; + endpointUrl: string | undefined; + logger: Logger; + initialReportingDelayInMs: number; + fallbackReportingDelayInMs: number; + fetcher?: Fetcher; + }); + stopped(): boolean; + start(): void; + stop(): void; + private sendOneReportAndScheduleNext; + reportSchema(withCoreSchema: boolean): Promise; + private apolloQuery; +} +//# sourceMappingURL=schemaReporter.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts.map new file mode 100644 index 00000000..b0e674c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaReporter.d.ts","sourceRoot":"","sources":["../../../../src/plugin/schemaReporting/schemaReporter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EACV,YAAY,EAGZ,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAKrD,eAAO,MAAM,eAAe,sVAc3B,CAAC;AAGF,qBAAa,cAAc;IAEzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAS;IACnD,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAS;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAiB;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,OAAO,EAAE;QACnB,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,yBAAyB,EAAE,MAAM,CAAC;QAClC,0BAA0B,EAAE,MAAM,CAAC;QACnC,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;IAqBM,OAAO,IAAI,OAAO;IAIlB,KAAK;IAOL,IAAI;YAQG,4BAA4B;IAiC7B,YAAY,CACvB,cAAc,EAAE,OAAO,GACtB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;YAwCzB,WAAW;CAsC1B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js new file mode 100644 index 00000000..880bd66d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js @@ -0,0 +1,143 @@ +import { packageVersion } from '../../generated/packageVersion.js'; +export const schemaReportGql = `#graphql + mutation SchemaReport($report: SchemaReport!, $coreSchema: String) { + reportSchema(report: $report, coreSchema: $coreSchema) { + __typename + ... on ReportSchemaError { + message + code + } + ... on ReportSchemaResponse { + inSeconds + withCoreSchema + } + } + } +`; +export class SchemaReporter { + schemaReport; + coreSchema; + endpointUrl; + logger; + initialReportingDelayInMs; + fallbackReportingDelayInMs; + fetcher; + isStopped; + pollTimer; + headers; + constructor(options) { + this.headers = { + 'Content-Type': 'application/json', + 'x-api-key': options.apiKey, + 'apollographql-client-name': 'ApolloServerPluginSchemaReporting', + 'apollographql-client-version': packageVersion, + }; + this.endpointUrl = + options.endpointUrl || + 'https://schema-reporting.api.apollographql.com/api/graphql'; + this.schemaReport = options.schemaReport; + this.coreSchema = options.coreSchema; + this.isStopped = false; + this.logger = options.logger; + this.initialReportingDelayInMs = options.initialReportingDelayInMs; + this.fallbackReportingDelayInMs = options.fallbackReportingDelayInMs; + this.fetcher = options.fetcher ?? fetch; + } + stopped() { + return this.isStopped; + } + start() { + this.pollTimer = setTimeout(() => this.sendOneReportAndScheduleNext(false), this.initialReportingDelayInMs); + } + stop() { + this.isStopped = true; + if (this.pollTimer) { + clearTimeout(this.pollTimer); + this.pollTimer = undefined; + } + } + async sendOneReportAndScheduleNext(sendNextWithCoreSchema) { + this.pollTimer = undefined; + if (this.stopped()) + return; + try { + const result = await this.reportSchema(sendNextWithCoreSchema); + if (!result) { + return; + } + if (!this.stopped()) { + this.pollTimer = setTimeout(() => this.sendOneReportAndScheduleNext(result.withCoreSchema), result.inSeconds * 1000); + } + return; + } + catch (error) { + this.logger.error(`Error reporting server info to Apollo during schema reporting: ${error}`); + if (!this.stopped()) { + this.pollTimer = setTimeout(() => this.sendOneReportAndScheduleNext(false), this.fallbackReportingDelayInMs); + } + } + } + async reportSchema(withCoreSchema) { + const { data, errors } = await this.apolloQuery({ + report: this.schemaReport, + coreSchema: withCoreSchema ? this.coreSchema : null, + }); + if (errors) { + throw new Error(errors.map((x) => x.message).join('\n')); + } + function msgForUnexpectedResponse(data) { + return [ + 'Unexpected response shape from Apollo when', + 'reporting schema. If this continues, please reach', + 'out to support@apollographql.com.', + 'Received response:', + JSON.stringify(data), + ].join(' '); + } + if (!data || !data.reportSchema) { + throw new Error(msgForUnexpectedResponse(data)); + } + if (data.reportSchema.__typename === 'ReportSchemaResponse') { + return data.reportSchema; + } + else if (data.reportSchema.__typename === 'ReportSchemaError') { + this.logger.error([ + 'Received input validation error from Apollo:', + data.reportSchema.message, + 'Stopping reporting. Please fix the input errors.', + ].join(' ')); + this.stop(); + return null; + } + throw new Error(msgForUnexpectedResponse(data)); + } + async apolloQuery(variables) { + const request = { + query: schemaReportGql, + variables, + }; + const httpResponse = await this.fetcher(this.endpointUrl, { + method: 'POST', + headers: this.headers, + body: JSON.stringify(request), + }); + if (!httpResponse.ok) { + throw new Error([ + `An unexpected HTTP status code (${httpResponse.status}) was`, + 'encountered during schema reporting.', + ].join(' ')); + } + try { + return await httpResponse.json(); + } + catch (error) { + throw new Error([ + "Couldn't report schema to Apollo.", + 'Parsing response as JSON failed.', + 'If this continues please reach out to support@apollographql.com', + error, + ].join(' ')); + } + } +} +//# sourceMappingURL=schemaReporter.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js.map new file mode 100644 index 00000000..4f5611ae --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/schemaReporting/schemaReporter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaReporter.js","sourceRoot":"","sources":["../../../../src/plugin/schemaReporting/schemaReporter.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAInE,MAAM,CAAC,MAAM,eAAe,GAAiB;;;;;;;;;;;;;;CAc5C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C,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAC9B,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb;gBACE,mCAAmC,YAAY,CAAC,MAAM,OAAO;gBAC7D,sCAAsC;aACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CACZ,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YAGH,OAAO,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb;gBACE,mCAAmC;gBACnC,kCAAkC;gBAClC,iEAAiE;gBACjE,KAAK;aACN,CAAC,IAAI,CAAC,GAAG,CAAC,CACZ,CAAC;QACJ,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts new file mode 100644 index 00000000..aabc1602 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts @@ -0,0 +1,12 @@ +import { type Fetcher } from '@apollo/utils.fetcher'; +import type { Logger } from '@apollo/utils.logger'; +import retry from 'async-retry'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +export interface ApolloServerPluginSubscriptionCallbackOptions { + maxConsecutiveHeartbeatFailures?: number; + logger?: Logger; + retry?: retry.Options; + fetcher?: Fetcher; +} +export declare function ApolloServerPluginSubscriptionCallback(options?: ApolloServerPluginSubscriptionCallbackOptions): ApolloServerPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts.map new file mode 100644 index 00000000..d14f523d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/subscriptionCallback/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,MAAM,aAAa,CAAC;AAIhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,MAAM,WAAW,6CAA6C;IAC5D,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAItB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,sCAAsC,CACpD,OAAO,GAAE,6CAAmE,GAC3E,kBAAkB,CAuLpB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js new file mode 100644 index 00000000..44ba1a5c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js @@ -0,0 +1,428 @@ +import retry from 'async-retry'; +import { subscribe } from 'graphql'; +import { setImmediate } from 'node:timers/promises'; +import { ensureError, ensureGraphQLError } from '../../errorNormalize.js'; +import { HeaderMap } from '../../utils/HeaderMap.js'; +export function ApolloServerPluginSubscriptionCallback(options = Object.create(null)) { + const subscriptionManager = new SubscriptionManager(options); + const logger = options.logger + ? prefixedLogger(options.logger, 'SubscriptionCallback') + : undefined; + return { + async requestDidStart({ request }) { + const subscriptionExtension = request?.extensions?.subscription; + if (!subscriptionExtension) + return; + let { callbackUrl, subscriptionId: id, verifier, heartbeatIntervalMs, } = subscriptionExtension; + callbackUrl = callbackUrl || subscriptionExtension.callback_url; + id = id || subscriptionExtension.subscription_id; + heartbeatIntervalMs = + heartbeatIntervalMs ?? + subscriptionExtension.heartbeat_interval_ms ?? + 5000; + return { + async responseForOperation() { + logger?.debug('Received new subscription request', id); + return { + http: { + status: 200, + headers: new HeaderMap([['content-type', 'application/json']]), + }, + body: { + kind: 'single', + singleResult: { + data: null, + }, + }, + }; + }, + async willSendResponse({ request, schema, document, contextValue, operationName, response, }) { + try { + await subscriptionManager.checkRequest({ + callbackUrl, + id, + verifier, + }); + } + catch (e) { + const graphqlError = ensureGraphQLError(e); + logger?.error(`\`check\` request failed: ${graphqlError.message}`, id); + if (response.body.kind === 'single') { + response.body.singleResult.errors = [graphqlError]; + response.http.status = 500; + } + return; + } + subscriptionManager.initHeartbeat({ + callbackUrl, + id, + verifier, + heartbeatIntervalMs, + }); + logger?.debug(`Starting graphql-js subscription`, id); + let subscription; + try { + subscription = await subscribe({ + schema, + document: document, + variableValues: request.variables, + contextValue: contextValue, + operationName: operationName, + }); + } + catch (e) { + const graphqlError = ensureGraphQLError(e); + logger?.error(`Programming error: graphql-js subscribe() threw unexpectedly! Please report this bug to Apollo. The error was: ${e}`, id); + subscriptionManager.completeRequest({ + errors: [graphqlError], + callbackUrl, + id, + verifier, + }); + return; + } + if ('errors' in subscription) { + logger?.error(`graphql-js subscription unsuccessful: [\n\t${subscription.errors + ?.map((e) => e.message) + .join(',\n\t')}\n]`, id); + try { + subscriptionManager.completeRequest({ + errors: subscription.errors, + callbackUrl, + id, + verifier, + }); + } + catch (e) { + logger?.error(`\`complete\` request failed: ${e}`, id); + } + } + else if (isAsyncIterable(subscription)) { + logger?.debug('graphql-js subscription successful', id); + subscriptionManager.startConsumingSubscription({ + subscription, + callbackUrl, + id, + verifier, + }); + } + logger?.debug(`Responding to original subscription request`, id); + }, + }; + }, + async serverWillStart() { + return { + async drainServer() { + logger?.debug('Server is shutting down. Cleaning up outstanding subscriptions and heartbeat intervals'); + await subscriptionManager.cleanup(); + await setImmediate(); + logger?.debug('Successfully cleaned up outstanding subscriptions and heartbeat intervals.'); + }, + }; + }, + }; +} +function isAsyncIterable(value) { + return value && typeof value[Symbol.asyncIterator] === 'function'; +} +class SubscriptionManager { + maxConsecutiveHeartbeatFailures; + logger; + retryConfig; + requestsInFlight = new Set(); + subscriptionInfoByCallbackUrl = new Map(); + fetcher; + constructor(options) { + this.maxConsecutiveHeartbeatFailures = + options.maxConsecutiveHeartbeatFailures ?? 5; + this.retryConfig = { + retries: 5, + minTimeout: 100, + maxTimeout: 1000, + ...options.retry, + }; + this.logger = options.logger + ? prefixedLogger(options.logger, 'SubscriptionManager') + : undefined; + this.fetcher = options.fetcher ?? fetch; + } + async retryFetch({ url, action, id, verifier, payload, errors, headers, }) { + let response; + try { + const maybeWithErrors = errors?.length ? ` with errors` : ''; + this.logger?.debug(`Sending \`${action}\` request to router` + maybeWithErrors, id); + return retry(async (bail) => { + response = this.fetcher(url, { + method: 'POST', + headers: { + 'content-type': 'application/json', + ...headers, + }, + body: JSON.stringify({ + kind: 'subscription', + action, + id, + verifier, + ...(payload && { payload }), + ...(errors?.length && { errors }), + }), + }); + this.requestsInFlight.add(response); + const result = await response; + if (!result.ok) { + if (result.status >= 500) { + throw new Error(`\`${action}\` request failed with unexpected status code: ${result.status}`); + } + else { + if (result.status === 404) { + this.logger?.debug(`\`${action}\` request received 404, terminating subscription`, id); + } + else { + const errMsg = `\`${action}\` request failed with unexpected status code: ${result.status}, terminating subscription`; + this.logger?.debug(errMsg, id); + bail(new Error(errMsg)); + } + this.terminateSubscription(id, url); + return result; + } + } + this.logger?.debug(`\`${action}\` request successful`, id); + return result; + }, { + ...this.retryConfig, + onRetry: (e, attempt) => { + this.requestsInFlight.delete(response); + this.logger?.warn(`Retrying \`${action}\` request (attempt ${attempt}) due to error: ${e.message}`, id); + this.retryConfig?.onRetry?.(e, attempt); + }, + }); + } + finally { + this.requestsInFlight.delete(response); + } + } + async checkRequest({ callbackUrl, id, verifier, }) { + return this.retryFetch({ + url: callbackUrl, + action: 'check', + id, + verifier, + headers: { 'subscription-protocol': 'callback/1.0' }, + }); + } + initHeartbeat({ callbackUrl, id, verifier, heartbeatIntervalMs, }) { + if (!this.subscriptionInfoByCallbackUrl.has(callbackUrl)) { + this.subscriptionInfoByCallbackUrl.set(callbackUrl, {}); + } + if (heartbeatIntervalMs === 0) { + this.logger?.debug(`Heartbeat disabled for ${callbackUrl}`, id); + return; + } + this.logger?.debug(`Starting new heartbeat interval for ${callbackUrl}`, id); + let consecutiveHeartbeatFailureCount = 0; + const heartbeatInterval = setInterval(async () => { + let heartbeatRequest; + let resolveHeartbeatPromise; + const heartbeatPromise = new Promise((r) => { + resolveHeartbeatPromise = r; + }); + const existingSubscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!existingSubscriptionInfo?.heartbeat) { + clearInterval(heartbeatInterval); + this.logger?.error(`Programming error: Heartbeat interval unexpectedly missing for ${callbackUrl}. This is probably a bug in Apollo Server.`); + return; + } + const existingHeartbeat = existingSubscriptionInfo.heartbeat; + const { queue } = existingHeartbeat; + queue.push(heartbeatPromise); + if (queue.length > 1) { + const requestBeforeMe = queue[existingHeartbeat?.queue.length - 2]; + await requestBeforeMe; + } + try { + this.logger?.debug(`Sending \`check\` request to ${callbackUrl} for ID: ${id}`); + heartbeatRequest = this.fetcher(callbackUrl, { + method: 'POST', + body: JSON.stringify({ + kind: 'subscription', + action: 'check', + id, + verifier, + }), + headers: { + 'content-type': 'application/json', + 'subscription-protocol': 'callback/1.0', + }, + }); + this.requestsInFlight.add(heartbeatRequest); + const result = await heartbeatRequest; + this.logger?.debug(`Heartbeat received response for ID: ${id}`); + if (result.ok) { + this.logger?.debug(`Heartbeat request successful, ID: ${id}`); + } + else if (result.status === 400) { + this.logger?.debug(`Heartbeat request received invalid ID: ${id}`); + this.terminateSubscription(id, callbackUrl); + } + else if (result.status === 404) { + this.logger?.debug(`Heartbeat request received invalid ID: ${id}`); + this.terminateSubscription(id, callbackUrl); + } + else { + throw new Error(`Unexpected status code: ${result.status}`); + } + consecutiveHeartbeatFailureCount = 0; + } + catch (e) { + const err = ensureError(e); + this.logger?.error(`Heartbeat request failed (${++consecutiveHeartbeatFailureCount} consecutive): ${err.message}`, existingHeartbeat.id); + if (consecutiveHeartbeatFailureCount >= + this.maxConsecutiveHeartbeatFailures) { + this.logger?.error(`Heartbeat request failed ${consecutiveHeartbeatFailureCount} times, terminating subscriptions and heartbeat interval: ${err.message}`, existingHeartbeat.id); + this.terminateSubscription(id, callbackUrl); + } + return; + } + finally { + if (heartbeatRequest) { + this.requestsInFlight.delete(heartbeatRequest); + } + existingHeartbeat?.queue.shift(); + resolveHeartbeatPromise(); + } + }, heartbeatIntervalMs); + const subscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + subscriptionInfo.heartbeat = { + interval: heartbeatInterval, + id, + verifier, + queue: [], + }; + } + terminateSubscription(id, callbackUrl) { + this.logger?.debug(`Terminating subscriptions for ID: ${id}`); + const subscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!subscriptionInfo) { + this.logger?.error(`No subscriptions found for ${callbackUrl}, skipping termination`); + return; + } + const { subscription, heartbeat } = subscriptionInfo; + if (subscription) { + subscription.cancelled = true; + subscription.asyncIter?.return(); + } + if (heartbeat) { + this.logger?.debug(`Terminating heartbeat interval for ${callbackUrl}`); + clearInterval(heartbeat.interval); + } + this.subscriptionInfoByCallbackUrl.delete(callbackUrl); + } + startConsumingSubscription({ subscription, callbackUrl, id, verifier, }) { + const self = this; + const subscriptionObject = { + asyncIter: subscription, + cancelled: false, + async startConsumingSubscription() { + self.logger?.debug(`Listening to graphql-js subscription`, id); + try { + for await (const payload of subscription) { + if (this.cancelled) { + self.logger?.debug(`Subscription already cancelled, ignoring current and future payloads`, id); + return; + } + try { + await self.retryFetch({ + url: callbackUrl, + action: 'next', + id, + verifier, + payload, + }); + } + catch (e) { + const originalError = ensureError(e); + self.logger?.error(`\`next\` request failed, terminating subscription: ${originalError.message}`, id); + self.terminateSubscription(id, callbackUrl); + } + } + self.logger?.debug(`Subscription completed without errors`, id); + await this.completeSubscription(); + } + catch (e) { + const error = ensureGraphQLError(e); + self.logger?.error(`Generator threw an error, terminating subscription: ${error.message}`, id); + this.completeSubscription([error]); + } + }, + async completeSubscription(errors) { + if (this.cancelled) + return; + this.cancelled = true; + try { + await self.completeRequest({ + callbackUrl, + id, + verifier, + ...(errors && { errors }), + }); + } + catch (e) { + const error = ensureError(e); + self.logger?.error(`\`complete\` request failed: ${error.message}`, id); + } + finally { + self.terminateSubscription(id, callbackUrl); + } + }, + }; + subscriptionObject.startConsumingSubscription(); + const subscriptionInfo = this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!subscriptionInfo) { + this.logger?.error(`No existing heartbeat found for ${callbackUrl}, skipping subscription`); + } + else { + subscriptionInfo.subscription = subscriptionObject; + } + } + async completeRequest({ errors, callbackUrl, id, verifier, }) { + return this.retryFetch({ + url: callbackUrl, + action: 'complete', + id, + verifier, + errors, + }); + } + collectAllSubscriptions() { + return Array.from(this.subscriptionInfoByCallbackUrl.values()).reduce((subscriptions, { subscription }) => { + if (subscription) { + subscriptions.push(subscription); + } + return subscriptions; + }, []); + } + async cleanup() { + await Promise.allSettled(Array.from(this.subscriptionInfoByCallbackUrl.values()).map(async ({ heartbeat }) => { + clearInterval(heartbeat?.interval); + await heartbeat?.queue[heartbeat.queue.length - 1]; + })); + await Promise.allSettled(this.collectAllSubscriptions() + .filter((s) => !s.cancelled) + .map((s) => s.completeSubscription())); + await Promise.allSettled(this.requestsInFlight.values()); + } +} +function prefixedLogger(logger, prefix) { + function log(level) { + return function (message, id) { + logger[level](`${prefix}${id ? `[${id}]` : ''}: ${message}`); + }; + } + return { + debug: log('debug'), + error: log('error'), + info: log('info'), + warn: log('warn'), + }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js.map new file mode 100644 index 00000000..50546a8e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/subscriptionCallback/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/subscriptionCallback/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,SAAS,EAA2C,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAYrD,MAAM,UAAU,sCAAsC,CACpD,UAAyD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE5E,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM;QAC3B,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,sBAAsB,CAAC;QACxD,CAAC,CAAC,SA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AAe,EAAE,EAAW;YAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC,CAAC;QAC/D,CAAC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;QACnB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;QACnB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;KAClB,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts new file mode 100644 index 00000000..817ea63c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts @@ -0,0 +1,25 @@ +import { GraphQLError, type GraphQLResolveInfo } from 'graphql'; +import { Trace, google } from '@apollo/usage-reporting-protobuf'; +import type { SendErrorsOptions } from './usageReporting'; +export declare class TraceTreeBuilder { + private rootNode; + trace: Trace; + startHrTime?: [number, number]; + private stopped; + private nodes; + private readonly transformError; + constructor(options: { + maskedBy: string; + sendErrors?: SendErrorsOptions; + }); + startTiming(): void; + stopTiming(): void; + willResolveField(info: GraphQLResolveInfo): () => void; + didEncounterErrors(errors: readonly GraphQLError[]): void; + private addProtobufError; + private newNode; + private ensureParentNode; + private transformAndNormalizeError; +} +export declare function dateToProtoTimestamp(date: Date): google.protobuf.Timestamp; +//# sourceMappingURL=traceTreeBuilder.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts.map new file mode 100644 index 00000000..b9a3fc5c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"traceTreeBuilder.d.ts","sourceRoot":"","sources":["../../../src/plugin/traceTreeBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EAExB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAO1D,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAoB;IAC7B,KAAK,QAUT;IACI,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAEV;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAEtB;gBAEU,OAAO,EAAE;QAC1B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,iBAAiB,CAAC;KAChC;IAgBM,WAAW;IAWX,UAAU;IAeV,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,IAAI;IAiEtD,kBAAkB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE;IA6BzD,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,0BAA0B;CAkDnC;AAkED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAO1E"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js new file mode 100644 index 00000000..06623ab4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js @@ -0,0 +1,196 @@ +import { GraphQLError, } from 'graphql'; +import { Trace, google } from '@apollo/usage-reporting-protobuf'; +import { UnreachableCaseError } from '../utils/UnreachableCaseError.js'; +function internalError(message) { + return new Error(`[internal apollo-server error] ${message}`); +} +export class TraceTreeBuilder { + rootNode = new Trace.Node(); + trace = new Trace({ + root: this.rootNode, + fieldExecutionWeight: 1, + }); + startHrTime; + stopped = false; + nodes = new Map([ + [responsePathAsString(), this.rootNode], + ]); + transformError; + constructor(options) { + const { sendErrors, maskedBy } = options; + if (!sendErrors || 'masked' in sendErrors) { + this.transformError = () => new GraphQLError('', { + extensions: { maskedBy }, + }); + } + else if ('transform' in sendErrors) { + this.transformError = sendErrors.transform; + } + else if ('unmodified' in sendErrors) { + this.transformError = null; + } + else { + throw new UnreachableCaseError(sendErrors); + } + } + startTiming() { + if (this.startHrTime) { + throw internalError('startTiming called twice!'); + } + if (this.stopped) { + throw internalError('startTiming called after stopTiming!'); + } + this.trace.startTime = dateToProtoTimestamp(new Date()); + this.startHrTime = process.hrtime(); + } + stopTiming() { + if (!this.startHrTime) { + throw internalError('stopTiming called before startTiming!'); + } + if (this.stopped) { + throw internalError('stopTiming called twice!'); + } + this.trace.durationNs = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + this.trace.endTime = dateToProtoTimestamp(new Date()); + this.stopped = true; + } + willResolveField(info) { + if (!this.startHrTime) { + throw internalError('willResolveField called before startTiming!'); + } + if (this.stopped) { + return () => { }; + } + const path = info.path; + const node = this.newNode(path); + node.type = info.returnType.toString(); + node.parentType = info.parentType.toString(); + node.startTime = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + if (typeof path.key === 'string' && path.key !== info.fieldName) { + node.originalFieldName = info.fieldName; + } + return () => { + node.endTime = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + }; + } + didEncounterErrors(errors) { + errors.forEach((err) => { + if (err.extensions?.serviceName) { + return; + } + const errorForReporting = this.transformAndNormalizeError(err); + if (errorForReporting === null) { + return; + } + this.addProtobufError(errorForReporting.path, errorToProtobufError(errorForReporting)); + }); + } + addProtobufError(path, error) { + if (!this.startHrTime) { + throw internalError('addProtobufError called before startTiming!'); + } + if (this.stopped) { + throw internalError('addProtobufError called after stopTiming!'); + } + let node = this.rootNode; + if (Array.isArray(path)) { + const specificNode = this.nodes.get(path.join('.')); + if (specificNode) { + node = specificNode; + } + else { + const responsePath = responsePathFromArray(path, this.rootNode); + if (!responsePath) { + throw internalError('addProtobufError called with invalid path!'); + } + node = this.newNode(responsePath); + } + } + node.error.push(error); + } + newNode(path) { + const node = new Trace.Node(); + const id = path.key; + if (typeof id === 'number') { + node.index = id; + } + else { + node.responseName = id; + } + this.nodes.set(responsePathAsString(path), node); + const parentNode = this.ensureParentNode(path); + parentNode.child.push(node); + return node; + } + ensureParentNode(path) { + const parentPath = responsePathAsString(path.prev); + const parentNode = this.nodes.get(parentPath); + if (parentNode) { + return parentNode; + } + return this.newNode(path.prev); + } + transformAndNormalizeError(err) { + if (this.transformError) { + const clonedError = Object.assign(Object.create(Object.getPrototypeOf(err)), err); + const rewrittenError = this.transformError(clonedError); + if (rewrittenError === null) { + return null; + } + if (!(rewrittenError instanceof GraphQLError)) { + return err; + } + return new GraphQLError(rewrittenError.message, { + nodes: err.nodes, + source: err.source, + positions: err.positions, + path: err.path, + originalError: err.originalError, + extensions: rewrittenError.extensions || err.extensions, + }); + } + return err; + } +} +function durationHrTimeToNanos(hrtime) { + return hrtime[0] * 1e9 + hrtime[1]; +} +function responsePathAsString(p) { + if (p === undefined) { + return ''; + } + let res = String(p.key); + while ((p = p.prev) !== undefined) { + res = `${p.key}.${res}`; + } + return res; +} +function responsePathFromArray(path, node) { + let responsePath; + let nodePtr = node; + for (const key of path) { + nodePtr = nodePtr?.child?.find((child) => child.responseName === key); + responsePath = { + key, + prev: responsePath, + typename: nodePtr?.type ?? undefined, + }; + } + return responsePath; +} +function errorToProtobufError(error) { + return new Trace.Error({ + message: error.message, + location: (error.locations || []).map(({ line, column }) => new Trace.Location({ line, column })), + json: JSON.stringify(error), + }); +} +export function dateToProtoTimestamp(date) { + const totalMillis = +date; + const millis = totalMillis % 1000; + return new google.protobuf.Timestamp({ + seconds: (totalMillis - millis) / 1000, + nanos: millis * 1e6, + }); +} +//# sourceMappingURL=traceTreeBuilder.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js.map new file mode 100644 index 00000000..ee934a77 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/traceTreeBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"traceTreeBuilder.js","sourceRoot":"","sources":["../../../src/plugin/traceTreeBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,GAGb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,SAAS,aAAa,CAAC,OAAe;IACpC,OAAO,IAAI,KAAK,CAAC,kCAAkC,OAAO,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,OAAO,gBAA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AAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts new file mode 100644 index 00000000..7dd76d66 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts @@ -0,0 +1,3 @@ +import type { Trace } from '@apollo/usage-reporting-protobuf'; +export declare function defaultSendOperationsAsTrace(): (trace: Trace, statsReportKey: string) => boolean; +//# sourceMappingURL=defaultSendOperationsAsTrace.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map new file mode 100644 index 00000000..a2518e3c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"defaultSendOperationsAsTrace.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/defaultSendOperationsAsTrace.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAI9D,wBAAgB,4BAA4B,KA2BlC,OAAO,KAAK,EAAE,gBAAgB,MAAM,KAAG,OAAO,CAyBvD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js new file mode 100644 index 00000000..effc8c6d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js @@ -0,0 +1,41 @@ +import { LRUCache } from 'lru-cache'; +import { iterateOverTrace } from './iterateOverTrace.js'; +import { DurationHistogram } from './durationHistogram.js'; +export function defaultSendOperationsAsTrace() { + const cache = new LRUCache({ + maxSize: Math.pow(2, 20), + sizeCalculation: (_val, key) => { + return (key && Buffer.byteLength(key)) || 0; + }, + }); + return (trace, statsReportKey) => { + const endTimeSeconds = trace.endTime?.seconds; + if (endTimeSeconds == null) { + throw Error('programming error: endTime not set on trace'); + } + const hasErrors = traceHasErrors(trace); + const cacheKey = JSON.stringify([ + statsReportKey, + DurationHistogram.durationToBucket(trace.durationNs), + Math.floor(endTimeSeconds / 60), + hasErrors ? Math.floor(endTimeSeconds / 5) : '', + ]); + if (cache.get(cacheKey)) { + return false; + } + cache.set(cacheKey, true); + return true; + }; +} +function traceHasErrors(trace) { + let hasErrors = false; + function traceNodeStats(node) { + if ((node.error?.length ?? 0) > 0) { + hasErrors = true; + } + return hasErrors; + } + iterateOverTrace(trace, traceNodeStats, false); + return hasErrors; +} +//# sourceMappingURL=defaultSendOperationsAsTrace.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js.map new file mode 100644 index 00000000..36211854 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defaultSendOperationsAsTrace.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/defaultSendOperationsAsTrace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,UAAU,4BAA4B;IAU1C,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAe;QAWvC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;QACxB,eAAe,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YAC7B,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,KAAY,EAAE,cAAsB,EAAW,EAAE;QACvD,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;QAC9C,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;YAC3B,MAAM,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAC9B,cAAc;YACd,iBAAiB,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC;YAEpD,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,EAAE,CAAC;YAG/B,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SAChD,CAAC,CAAC;QAGH,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAID,SAAS,cAAc,CAAC,KAAY;IAClC,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,SAAS,cAAc,CAAC,IAAiB;QACvC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,SAAS,CAAC;AACnB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts new file mode 100644 index 00000000..f4fec59c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts @@ -0,0 +1,16 @@ +export interface DurationHistogramOptions { + initSize?: number; + buckets?: number[]; +} +export declare class DurationHistogram { + private readonly buckets; + static readonly BUCKET_COUNT = 384; + static readonly EXPONENT_LOG: number; + toArray(): number[]; + static durationToBucket(durationNs: number): number; + incrementDuration(durationNs: number, value?: number): DurationHistogram; + incrementBucket(bucket: number, value?: number): void; + combine(otherHistogram: DurationHistogram): void; + constructor(options?: DurationHistogramOptions); +} +//# sourceMappingURL=durationHistogram.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts.map new file mode 100644 index 00000000..2a28b872 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"durationHistogram.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/durationHistogram.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AACD,qBAAa,iBAAiB;IAO5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;IACnC,MAAM,CAAC,QAAQ,CAAC,YAAY,OAAO;IACnC,MAAM,CAAC,QAAQ,CAAC,YAAY,SAAiB;IAE7C,OAAO,IAAI,MAAM,EAAE;IAoBnB,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAYnD,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,iBAAiB;IAKnE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAI;IAgBzC,OAAO,CAAC,cAAc,EAAE,iBAAiB;gBAM7B,OAAO,CAAC,EAAE,wBAAwB;CAY/C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js new file mode 100644 index 00000000..437825a6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js @@ -0,0 +1,64 @@ +export class DurationHistogram { + buckets; + static BUCKET_COUNT = 384; + static EXPONENT_LOG = Math.log(1.1); + toArray() { + let bufferedZeroes = 0; + const outputArray = []; + for (const value of this.buckets) { + if (value === 0) { + bufferedZeroes++; + } + else { + if (bufferedZeroes === 1) { + outputArray.push(0); + } + else if (bufferedZeroes !== 0) { + outputArray.push(-bufferedZeroes); + } + outputArray.push(Math.floor(value)); + bufferedZeroes = 0; + } + } + return outputArray; + } + static durationToBucket(durationNs) { + const log = Math.log(durationNs / 1000.0); + const unboundedBucket = Math.ceil(log / DurationHistogram.EXPONENT_LOG); + return unboundedBucket <= 0 || Number.isNaN(unboundedBucket) + ? 0 + : unboundedBucket >= DurationHistogram.BUCKET_COUNT + ? DurationHistogram.BUCKET_COUNT - 1 + : unboundedBucket; + } + incrementDuration(durationNs, value = 1) { + this.incrementBucket(DurationHistogram.durationToBucket(durationNs), value); + return this; + } + incrementBucket(bucket, value = 1) { + if (bucket >= DurationHistogram.BUCKET_COUNT) { + throw Error('Bucket is out of bounds of the buckets array'); + } + if (bucket >= this.buckets.length) { + const oldLength = this.buckets.length; + this.buckets.length = bucket + 1; + this.buckets.fill(0, oldLength); + } + this.buckets[bucket] += value; + } + combine(otherHistogram) { + for (let i = 0; i < otherHistogram.buckets.length; i++) { + this.incrementBucket(i, otherHistogram.buckets[i]); + } + } + constructor(options) { + const initSize = options?.initSize || 74; + const buckets = options?.buckets; + const arrayInitSize = Math.max(buckets?.length || 0, initSize); + this.buckets = Array(arrayInitSize).fill(0); + if (buckets) { + buckets.forEach((val, index) => (this.buckets[index] = val)); + } + } +} +//# sourceMappingURL=durationHistogram.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js.map new file mode 100644 index 00000000..2ac889f9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/durationHistogram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"durationHistogram.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/durationHistogram.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,iBAAiB;IAOX,OAAO,CAAW;IACnC,MAAM,CAAU,YAAY,GAAG,GAAG,CAAC;IACnC,MAAM,CAAU,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE7C,OAAO;QACL,IAAI,cAAc,GAAG,CAAC,CAAC;QACvB,MAAM,WAAW,GAAa,EAAE,CAAC;QAEjC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBAChB,cAAc,EAAE,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACN,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;oBACzB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACtB,CAAC;qBAAM,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;oBAChC,WAAW,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC;gBACpC,CAAC;gBACD,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBACpC,cAAc,GAAG,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,UAAkB;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC;QAC1C,MAAM,eAAe,GAAG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C;QACrD,CAAC;IACH,CAAC;IAED,YAAY,OAAkC;QAC5C,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,CAAC;QAEjC,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;QAE/D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAS,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts new file mode 100644 index 00000000..6cdb1f29 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts @@ -0,0 +1,3 @@ +export { ApolloServerPluginUsageReporting } from './plugin.js'; +export type { ApolloServerPluginUsageReportingOptions, SendValuesBaseOptions, VariableValueOptions, SendErrorsOptions, ClientInfo, GenerateClientInfo, } from './options.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts.map new file mode 100644 index 00000000..19d3f366 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EACV,uCAAuC,EACvC,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,GACnB,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js new file mode 100644 index 00000000..43574c76 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js @@ -0,0 +1,2 @@ +export { ApolloServerPluginUsageReporting } from './plugin.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js.map new file mode 100644 index 00000000..f66dc3a1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts new file mode 100644 index 00000000..bb8e5ab1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts @@ -0,0 +1,7 @@ +import type { Trace } from '@apollo/usage-reporting-protobuf'; +export declare function iterateOverTrace(trace: Trace, f: (node: Trace.INode, path: ResponseNamePath) => boolean, includePath: boolean): void; +export interface ResponseNamePath { + toArray(): string[]; + child(responseName: string): ResponseNamePath; +} +//# sourceMappingURL=iterateOverTrace.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts.map new file mode 100644 index 00000000..ef003507 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"iterateOverTrace.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/iterateOverTrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAoB9D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,gBAAgB,KAAK,OAAO,EACzD,WAAW,EAAE,OAAO,QAYrB;AA8DD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC/C"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js new file mode 100644 index 00000000..c43cfe6a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js @@ -0,0 +1,78 @@ +export function iterateOverTrace(trace, f, includePath) { + const rootPath = includePath + ? new RootCollectingPathsResponseNamePath() + : notCollectingPathsResponseNamePath; + if (trace.root) { + if (iterateOverTraceNode(trace.root, rootPath, f)) + return; + } + if (trace.queryPlan) { + if (iterateOverQueryPlan(trace.queryPlan, rootPath, f)) + return; + } +} +function iterateOverQueryPlan(node, rootPath, f) { + if (!node) + return false; + if (node.fetch?.trace?.root && node.fetch.serviceName) { + return iterateOverTraceNode(node.fetch.trace.root, rootPath.child(`service:${node.fetch.serviceName}`), f); + } + if (node.flatten?.node) { + return iterateOverQueryPlan(node.flatten.node, rootPath, f); + } + if (node.parallel?.nodes) { + return node.parallel.nodes.some((node) => iterateOverQueryPlan(node, rootPath, f)); + } + if (node.sequence?.nodes) { + return node.sequence.nodes.some((node) => iterateOverQueryPlan(node, rootPath, f)); + } + return false; +} +function iterateOverTraceNode(node, path, f) { + if (f(node, path)) { + return true; + } + return (node.child?.some((child) => { + const childPath = child.responseName + ? path.child(child.responseName) + : path; + return iterateOverTraceNode(child, childPath, f); + }) ?? false); +} +const notCollectingPathsResponseNamePath = { + toArray() { + throw Error('not collecting paths!'); + }, + child() { + return this; + }, +}; +class RootCollectingPathsResponseNamePath { + toArray() { + return []; + } + child(responseName) { + return new ChildCollectingPathsResponseNamePath(responseName, this); + } +} +class ChildCollectingPathsResponseNamePath { + responseName; + prev; + constructor(responseName, prev) { + this.responseName = responseName; + this.prev = prev; + } + toArray() { + const out = []; + let curr = this; + while (curr instanceof ChildCollectingPathsResponseNamePath) { + out.push(curr.responseName); + curr = curr.prev; + } + return out.reverse(); + } + child(responseName) { + return new ChildCollectingPathsResponseNamePath(responseName, this); + } +} +//# sourceMappingURL=iterateOverTrace.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js.map new file mode 100644 index 00000000..091426c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/iterateOverTrace.js.map @@ -0,0 +1 @@ +{"version":3,"file":"iterateOverTrace.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/iterateOverTrace.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,gBAAgB,CAC9B,KAAY,EACZ,CAAyD,EACzD,WAAoB;IAEpB,MAAM,QAAQ,GAAG,WAAW;QAC1B,CAAC,CAAC,IAAI,mCAAmC,EAAE;QAC3C,CAAC,CAAC,kCAAkC,CAAC;IACvC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,IAAI,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YAAE,OAAO;IAC5D,CAAC;IAED,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,IAAI,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;YAAE,OAAO;IACjE,CAAC;AACH,CAAC;AA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@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts new file mode 100644 index 00000000..65961696 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts @@ -0,0 +1,12 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { ReferencedFieldsByType } from '@apollo/utils.usagereporting'; +import { LRUCache } from 'lru-cache'; +export interface OperationDerivedData { + signature: string; + referencedFieldsByType: ReferencedFieldsByType; +} +export declare function createOperationDerivedDataCache({ logger, }: { + logger: Logger; +}): LRUCache; +export declare function operationDerivedDataCacheKey(queryHash: string, operationName: string): string; +//# sourceMappingURL=operationDerivedDataCache.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts.map new file mode 100644 index 00000000..074a9b38 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"operationDerivedDataCache.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/operationDerivedDataCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,sBAAsB,CAAC;CAChD;AAED,wBAAgB,+BAA+B,CAAC,EAC9C,MAAM,GACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAwCzC;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,UAGtB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js new file mode 100644 index 00000000..da957cd4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js @@ -0,0 +1,29 @@ +import { LRUCache } from 'lru-cache'; +export function createOperationDerivedDataCache({ logger, }) { + let lastWarn; + let lastDisposals = 0; + return new LRUCache({ + sizeCalculation(obj) { + return Buffer.byteLength(JSON.stringify(obj), 'utf8'); + }, + maxSize: Math.pow(2, 20) * 10, + dispose() { + lastDisposals++; + if (!lastWarn || new Date().getTime() - lastWarn.getTime() > 60000) { + lastWarn = new Date(); + logger.warn([ + 'This server is processing a high number of unique operations. ', + `A total of ${lastDisposals} records have been `, + 'ejected from the ApolloServerPluginUsageReporting signature cache in the past ', + 'interval. If you see this warning frequently, please open an ', + 'issue on the Apollo Server repository.', + ].join('')); + lastDisposals = 0; + } + }, + }); +} +export function operationDerivedDataCacheKey(queryHash, operationName) { + return `${queryHash}${operationName && ':' + operationName}`; +} +//# sourceMappingURL=operationDerivedDataCache.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js.map new file mode 100644 index 00000000..04b81423 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/operationDerivedDataCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operationDerivedDataCache.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/operationDerivedDataCache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAOrC,MAAM,UAAU,+BAA+B,CAAC,EAC9C,MAAM,GAGP;IACC,IAAI,QAAc,CAAC;IACnB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,QAAQ,CAA+B;QAEhD,eAAe,CAAC,GAAG;YACjB,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;QACxD,CAAC;QASD,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE;QAC7B,OAAO;YAEL,aAAa,EAAE,CAAC;YAGhB,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;gBAEnE,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CACT;oBACE,iEAAiE;oBACjE,cAAc,aAAa,qBAAqB;oBAChD,gFAAgF;oBAChF,gEAAgE;oBAChE,wCAAwC;iBACzC,CAAC,IAAI,CAAC,EAAE,CAAC,CACX,CAAC;gBAGF,aAAa,GAAG,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,SAAiB,EACjB,aAAqB;IAErB,OAAO,GAAG,SAAS,GAAG,aAAa,IAAI,GAAG,GAAG,aAAa,EAAE,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts new file mode 100644 index 00000000..e9518cd5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts @@ -0,0 +1,60 @@ +import type { GraphQLError, DocumentNode } from 'graphql'; +import type { GraphQLRequestContextDidResolveOperation, GraphQLRequestContext, GraphQLRequestContextWillSendResponse, BaseContext } from '../../externalTypes/index.js'; +import type { Logger } from '@apollo/utils.logger'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { Fetcher } from '@apollo/utils.fetcher'; +export interface ApolloServerPluginUsageReportingOptions { + sendTraces?: boolean; + sendVariableValues?: VariableValueOptions; + sendHeaders?: SendValuesBaseOptions; + sendErrors?: SendErrorsOptions; + fieldLevelInstrumentation?: number | ((request: GraphQLRequestContextDidResolveOperation) => Promise); + includeRequest?: (request: GraphQLRequestContextDidResolveOperation | GraphQLRequestContextWillSendResponse) => Promise; + generateClientInfo?: GenerateClientInfo; + overrideReportedSchema?: string; + sendUnexecutableOperationDocuments?: boolean; + experimental_sendOperationAsTrace?: (trace: Trace, statsReportKey: string) => boolean; + sendReportsImmediately?: boolean; + fetcher?: Fetcher; + reportIntervalMs?: number; + maxUncompressedReportSize?: number; + maxAttempts?: number; + minimumRetryDelayMs?: number; + requestTimeoutMs?: number; + logger?: Logger; + reportErrorFunction?: (err: Error) => void; + endpointUrl?: string; + debugPrintReports?: boolean; + calculateSignature?: (ast: DocumentNode, operationName: string) => string; + __onlyIfSchemaIsNotSubgraph?: boolean; +} +export type SendValuesBaseOptions = { + onlyNames: Array; +} | { + exceptNames: Array; +} | { + all: true; +} | { + none: true; +}; +type VariableValueTransformOptions = { + variables: Record; + operationString?: string; +}; +export type VariableValueOptions = { + transform: (options: VariableValueTransformOptions) => Record; +} | SendValuesBaseOptions; +export type SendErrorsOptions = { + unmodified: true; +} | { + masked: true; +} | { + transform: (err: GraphQLError) => GraphQLError | null; +}; +export interface ClientInfo { + clientName?: string; + clientVersion?: string; +} +export type GenerateClientInfo = (requestContext: GraphQLRequestContext) => ClientInfo; +export {}; +//# sourceMappingURL=options.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts.map new file mode 100644 index 00000000..442a6580 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EACV,wCAAwC,EACxC,qBAAqB,EACrB,qCAAqC,EACrC,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,uCAAuC,CACtD,QAAQ,SAAS,WAAW;IA+B5B,UA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BAA2B,CAAC,EAAE,OAAO,CAAC;CAEvC;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,GAC5B;IAAE,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,GAC9B;IAAE,GAAG,EAAE,IAAI,CAAA;CAAE,GACb;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAEnB,KAAK,6BAA6B,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B;IACE,SAAS,EAAE,CACT,OAAO,EAAE,6BAA6B,KACnC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1B,GACD,qBAAqB,CAAC;AAE1B,MAAM,MAAM,iBAAiB,GACzB;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAChB;IAAE,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,YAAY,GAAG,IAAI,CAAA;CAAE,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,WAAW,IAAI,CAC7D,cAAc,EAAE,qBAAqB,CAAC,QAAQ,CAAC,KAC5C,UAAU,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js new file mode 100644 index 00000000..e9ded40b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=options.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js.map new file mode 100644 index 00000000..f151d498 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/options.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts new file mode 100644 index 00000000..e37a5dbc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts @@ -0,0 +1,7 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +import type { ApolloServerPlugin, BaseContext } from '../../externalTypes/index.js'; +import type { ApolloServerPluginUsageReportingOptions, SendValuesBaseOptions } from './options.js'; +import type { HeaderMap } from '../../utils/HeaderMap.js'; +export declare function ApolloServerPluginUsageReporting(options?: ApolloServerPluginUsageReportingOptions): ApolloServerPlugin; +export declare function makeHTTPRequestHeaders(http: Trace.IHTTP, headers: HeaderMap, sendHeaders?: SendValuesBaseOptions): void; +//# sourceMappingURL=plugin.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts.map new file mode 100644 index 00000000..eb16d681 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAY/E,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EAMZ,MAAM,8BAA8B,CAAC;AAStC,OAAO,KAAK,EACV,uCAAuC,EACvC,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAW1D,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,WAAW,EAC3E,OAAO,GAAE,uCAAuC,CAAC,QAAQ,CAExD,GACA,kBAAkB,CAAC,QAAQ,CAAC,CA4uB9B;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,KAAK,CAAC,KAAK,EACjB,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,qBAAqB,GAClC,IAAI,CAsCN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js new file mode 100644 index 00000000..245d0917 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js @@ -0,0 +1,487 @@ +import { Report, ReportHeader, Trace } from '@apollo/usage-reporting-protobuf'; +import { usageReportingSignature, calculateReferencedFieldsByType, } from '@apollo/utils.usagereporting'; +import retry from 'async-retry'; +import { printSchema } from 'graphql'; +import os from 'os'; +import { gzip } from 'zlib'; +import { internalPlugin } from '../../internalPlugin.js'; +import { dateToProtoTimestamp, TraceTreeBuilder } from '../traceTreeBuilder.js'; +import { defaultSendOperationsAsTrace } from './defaultSendOperationsAsTrace.js'; +import { createOperationDerivedDataCache, operationDerivedDataCacheKey, } from './operationDerivedDataCache.js'; +import { OurReport } from './stats.js'; +import { makeTraceDetails } from './traceDetails.js'; +import { packageVersion } from '../../generated/packageVersion.js'; +import { computeCoreSchemaHash } from '../../utils/computeCoreSchemaHash.js'; +import { schemaIsSubgraph } from '../schemaIsSubgraph.js'; +const reportHeaderDefaults = { + hostname: os.hostname(), + agentVersion: `@apollo/server@${packageVersion}`, + runtimeVersion: `node ${process.version}`, + uname: `${os.platform()}, ${os.type()}, ${os.release()}, ${os.arch()})`, +}; +export function ApolloServerPluginUsageReporting(options = Object.create(null)) { + const fieldLevelInstrumentationOption = options.fieldLevelInstrumentation; + const fieldLevelInstrumentation = typeof fieldLevelInstrumentationOption === 'number' + ? async () => Math.random() < fieldLevelInstrumentationOption + ? 1 / fieldLevelInstrumentationOption + : 0 + : fieldLevelInstrumentationOption + ? fieldLevelInstrumentationOption + : async () => true; + let requestDidStartHandler = null; + return internalPlugin({ + __internal_plugin_id__: 'UsageReporting', + __is_disabled_plugin__: false, + async requestDidStart(requestContext) { + if (requestDidStartHandler) { + return requestDidStartHandler(requestContext); + } + return {}; + }, + async serverWillStart({ logger: serverLogger, apollo, startedInBackground, schema, }) { + const logger = options.logger ?? serverLogger; + const { key, graphRef } = apollo; + if (!(key && graphRef)) { + throw new Error("You've enabled usage reporting via ApolloServerPluginUsageReporting, " + + 'but you also need to provide your Apollo API key and graph ref, via ' + + 'the APOLLO_KEY/APOLLO_GRAPH_REF environment ' + + 'variables or via `new ApolloServer({apollo: {key, graphRef})`.'); + } + if (schemaIsSubgraph(schema)) { + if (options.__onlyIfSchemaIsNotSubgraph) { + logger.warn('You have specified an Apollo API key and graph ref but this server appears ' + + 'to be a subgraph. Typically usage reports are sent to Apollo by your Router ' + + 'or Gateway, not directly from your subgraph; usage reporting is disabled. To ' + + 'enable usage reporting anyway, explicitly install `ApolloServerPluginUsageReporting`. ' + + 'To disable this warning, install `ApolloServerPluginUsageReportingDisabled`.'); + return {}; + } + else { + logger.warn('You have installed `ApolloServerPluginUsageReporting` but this server appears to ' + + 'be a subgraph. Typically usage reports are sent to Apollo by your Router ' + + 'or Gateway, not directly from your subgraph. If this was unintentional, remove ' + + "`ApolloServerPluginUsageReporting` from your server's `plugins` array."); + } + } + logger.info('Apollo usage reporting starting! See your graph at ' + + `https://studio.apollographql.com/graph/${encodeURI(graphRef)}/`); + const sendReportsImmediately = options.sendReportsImmediately ?? startedInBackground; + let operationDerivedDataCache = null; + const reportByExecutableSchemaId = new Map(); + const getReportWhichMustBeUsedImmediately = (executableSchemaId) => { + const existing = reportByExecutableSchemaId.get(executableSchemaId); + if (existing) { + return existing; + } + const report = new OurReport(new ReportHeader({ + ...reportHeaderDefaults, + executableSchemaId, + graphRef, + })); + reportByExecutableSchemaId.set(executableSchemaId, report); + return report; + }; + const getAndDeleteReport = (executableSchemaId) => { + const report = reportByExecutableSchemaId.get(executableSchemaId); + if (report) { + reportByExecutableSchemaId.delete(executableSchemaId); + return report; + } + return null; + }; + const overriddenExecutableSchemaId = options.overrideReportedSchema + ? computeCoreSchemaHash(options.overrideReportedSchema) + : undefined; + let lastSeenExecutableSchemaToId; + let reportTimer; + if (!sendReportsImmediately) { + reportTimer = setInterval(() => sendAllReportsAndReportErrors(), options.reportIntervalMs || 10 * 1000); + } + let sendTraces = options.sendTraces ?? true; + const sendOperationAsTrace = options.experimental_sendOperationAsTrace ?? + defaultSendOperationsAsTrace(); + let stopped = false; + function executableSchemaIdForSchema(schema) { + if (lastSeenExecutableSchemaToId?.executableSchema === schema) { + return lastSeenExecutableSchemaToId.executableSchemaId; + } + const id = computeCoreSchemaHash(printSchema(schema)); + lastSeenExecutableSchemaToId = { + executableSchema: schema, + executableSchemaId: id, + }; + return id; + } + async function sendAllReportsAndReportErrors() { + await Promise.all([...reportByExecutableSchemaId.keys()].map((executableSchemaId) => sendReportAndReportErrors(executableSchemaId))); + } + async function sendReportAndReportErrors(executableSchemaId) { + return sendReport(executableSchemaId).catch((err) => { + if (options.reportErrorFunction) { + options.reportErrorFunction(err); + } + else { + logger.error(err.message); + } + }); + } + const sendReport = async (executableSchemaId) => { + let report = getAndDeleteReport(executableSchemaId); + if (!report || + (Object.keys(report.tracesPerQuery).length === 0 && + report.operationCount === 0)) { + return; + } + report.endTime = dateToProtoTimestamp(new Date()); + report.ensureCountsAreIntegers(); + const protobufError = Report.verify(report); + if (protobufError) { + throw new Error(`Error verifying report: ${protobufError}`); + } + let message = Report.encode(report).finish(); + report = null; + if (options.debugPrintReports) { + const decodedReport = Report.decode(message); + logger.info(`Apollo usage report: ${JSON.stringify(decodedReport.toJSON())}`); + } + const compressed = await new Promise((resolve, reject) => { + gzip(message, (error, result) => { + error ? reject(error) : resolve(result); + }); + }); + message = null; + const fetcher = options.fetcher ?? fetch; + const response = await retry(async () => { + const curResponse = await fetcher((options.endpointUrl || + 'https://usage-reporting.api.apollographql.com') + + '/api/ingress/traces', { + method: 'POST', + headers: { + 'user-agent': 'ApolloServerPluginUsageReporting', + 'x-api-key': key, + 'content-encoding': 'gzip', + accept: 'application/json', + }, + body: compressed, + signal: AbortSignal.timeout(options.requestTimeoutMs ?? 30_000), + }); + if (curResponse.status >= 500 && curResponse.status < 600) { + throw new Error(`HTTP status ${curResponse.status}, ${(await curResponse.text()) || '(no body)'}`); + } + else { + return curResponse; + } + }, { + retries: (options.maxAttempts || 5) - 1, + minTimeout: options.minimumRetryDelayMs || 100, + factor: 2, + }).catch((err) => { + throw new Error(`Error sending report to Apollo servers: ${err.message}`); + }); + if (response.status < 200 || response.status >= 300) { + throw new Error(`Error sending report to Apollo servers: HTTP status ${response.status}, ${(await response.text()) || '(no body)'}`); + } + if (sendTraces && + response.status === 200 && + response.headers + .get('content-type') + ?.match(/^\s*application\/json\s*(?:;|$)/i)) { + const body = await response.text(); + let parsedBody; + try { + parsedBody = JSON.parse(body); + } + catch (e) { + throw new Error(`Error parsing response from Apollo servers: ${e}`); + } + if (parsedBody.tracesIgnored === true) { + logger.debug("This graph's organization does not have access to traces; sending all " + + 'subsequent operations as stats.'); + sendTraces = false; + } + } + if (options.debugPrintReports) { + logger.info(`Apollo usage report: status ${response.status}`); + } + }; + requestDidStartHandler = ({ metrics, schema, request: { http, variables }, }) => { + const treeBuilder = new TraceTreeBuilder({ + maskedBy: 'ApolloServerPluginUsageReporting', + sendErrors: options.sendErrors, + }); + treeBuilder.startTiming(); + metrics.startHrTime = treeBuilder.startHrTime; + let graphqlValidationFailure = false; + let graphqlUnknownOperationName = false; + let includeOperationInUsageReporting = null; + if (http) { + treeBuilder.trace.http = new Trace.HTTP({ + method: Trace.HTTP.Method[http.method] || Trace.HTTP.Method.UNKNOWN, + }); + if (options.sendHeaders) { + makeHTTPRequestHeaders(treeBuilder.trace.http, http.headers, options.sendHeaders); + } + } + async function maybeCallIncludeRequestHook(requestContext) { + if (includeOperationInUsageReporting !== null) + return; + if (typeof options.includeRequest !== 'function') { + includeOperationInUsageReporting = true; + return; + } + includeOperationInUsageReporting = + await options.includeRequest(requestContext); + if (typeof includeOperationInUsageReporting !== 'boolean') { + logger.warn("The 'includeRequest' async predicate function must return a boolean value."); + includeOperationInUsageReporting = true; + } + } + let didResolveSource = false; + return { + async didResolveSource(requestContext) { + didResolveSource = true; + if (metrics.persistedQueryHit) { + treeBuilder.trace.persistedQueryHit = true; + } + if (metrics.persistedQueryRegister) { + treeBuilder.trace.persistedQueryRegister = true; + } + if (variables) { + treeBuilder.trace.details = makeTraceDetails(variables, options.sendVariableValues, requestContext.source); + } + const clientInfo = (options.generateClientInfo || defaultGenerateClientInfo)(requestContext); + if (clientInfo) { + const { clientName, clientVersion } = clientInfo; + treeBuilder.trace.clientVersion = clientVersion || ''; + treeBuilder.trace.clientName = clientName || ''; + } + }, + async validationDidStart() { + return async (validationErrors) => { + graphqlValidationFailure = validationErrors + ? validationErrors.length !== 0 + : false; + }; + }, + async didResolveOperation(requestContext) { + graphqlUnknownOperationName = + requestContext.operation === undefined; + await maybeCallIncludeRequestHook(requestContext); + if (includeOperationInUsageReporting && + !graphqlUnknownOperationName) { + if (metrics.captureTraces === undefined) { + const rawWeight = await fieldLevelInstrumentation(requestContext); + treeBuilder.trace.fieldExecutionWeight = + typeof rawWeight === 'number' ? rawWeight : rawWeight ? 1 : 0; + metrics.captureTraces = + !!treeBuilder.trace.fieldExecutionWeight; + } + } + }, + async executionDidStart() { + if (!metrics.captureTraces) + return; + return { + willResolveField({ info }) { + return treeBuilder.willResolveField(info); + }, + }; + }, + async didEncounterSubsequentErrors(_requestContext, errors) { + treeBuilder.didEncounterErrors(errors); + }, + async willSendSubsequentPayload(requestContext, payload) { + if (!payload.hasNext) { + await operationFinished(requestContext); + } + }, + async willSendResponse(requestContext) { + if (!didResolveSource) + return; + if (requestContext.errors) { + treeBuilder.didEncounterErrors(requestContext.errors); + } + if (requestContext.response.body.kind === 'single') { + await operationFinished(requestContext); + } + }, + }; + async function operationFinished(requestContext) { + const resolvedOperation = !!requestContext.operation; + await maybeCallIncludeRequestHook(requestContext); + treeBuilder.stopTiming(); + const executableSchemaId = overriddenExecutableSchemaId ?? executableSchemaIdForSchema(schema); + if (includeOperationInUsageReporting === false) { + if (resolvedOperation) { + getReportWhichMustBeUsedImmediately(executableSchemaId) + .operationCount++; + } + return; + } + treeBuilder.trace.fullQueryCacheHit = !!metrics.responseCacheHit; + treeBuilder.trace.forbiddenOperation = !!metrics.forbiddenOperation; + treeBuilder.trace.registeredOperation = !!metrics.registeredOperation; + const policyIfCacheable = requestContext.overallCachePolicy.policyIfCacheable(); + if (policyIfCacheable) { + treeBuilder.trace.cachePolicy = new Trace.CachePolicy({ + scope: policyIfCacheable.scope === 'PRIVATE' + ? Trace.CachePolicy.Scope.PRIVATE + : policyIfCacheable.scope === 'PUBLIC' + ? Trace.CachePolicy.Scope.PUBLIC + : Trace.CachePolicy.Scope.UNKNOWN, + maxAgeNs: policyIfCacheable.maxAge * 1e9, + }); + } + if (metrics.queryPlanTrace) { + treeBuilder.trace.queryPlan = metrics.queryPlanTrace; + } + addTrace().catch(logger.error.bind(logger)); + async function addTrace() { + if (stopped) { + return; + } + await new Promise((res) => setImmediate(res)); + const executableSchemaId = overriddenExecutableSchemaId ?? + executableSchemaIdForSchema(schema); + const { trace } = treeBuilder; + let statsReportKey = undefined; + let referencedFieldsByType; + if (!requestContext.document) { + statsReportKey = `## GraphQLParseFailure\n`; + } + else if (graphqlValidationFailure) { + statsReportKey = `## GraphQLValidationFailure\n`; + } + else if (graphqlUnknownOperationName) { + statsReportKey = `## GraphQLUnknownOperationName\n`; + } + const isExecutable = statsReportKey === undefined; + if (statsReportKey) { + if (options.sendUnexecutableOperationDocuments) { + trace.unexecutedOperationBody = requestContext.source; + trace.unexecutedOperationName = + requestContext.request.operationName || ''; + } + referencedFieldsByType = Object.create(null); + } + else { + const operationDerivedData = getOperationDerivedData(); + statsReportKey = `# ${requestContext.operationName || '-'}\n${operationDerivedData.signature}`; + referencedFieldsByType = + operationDerivedData.referencedFieldsByType; + } + const protobufError = Trace.verify(trace); + if (protobufError) { + throw new Error(`Error encoding trace: ${protobufError}`); + } + if (resolvedOperation) { + getReportWhichMustBeUsedImmediately(executableSchemaId) + .operationCount++; + } + getReportWhichMustBeUsedImmediately(executableSchemaId).addTrace({ + statsReportKey, + trace, + asTrace: sendTraces && + (!isExecutable || !!metrics.captureTraces) && + !metrics.nonFtv1ErrorPaths?.length && + sendOperationAsTrace(trace, statsReportKey), + referencedFieldsByType, + nonFtv1ErrorPaths: metrics.nonFtv1ErrorPaths ?? [], + }); + if (sendReportsImmediately || + getReportWhichMustBeUsedImmediately(executableSchemaId) + .sizeEstimator.bytes >= + (options.maxUncompressedReportSize || 4 * 1024 * 1024)) { + await sendReportAndReportErrors(executableSchemaId); + } + } + function getOperationDerivedData() { + if (!requestContext.document) { + throw new Error('No document?'); + } + const cacheKey = operationDerivedDataCacheKey(requestContext.queryHash, requestContext.operationName || ''); + if (!operationDerivedDataCache || + operationDerivedDataCache.forSchema !== schema) { + operationDerivedDataCache = { + forSchema: schema, + cache: createOperationDerivedDataCache({ logger }), + }; + } + const cachedOperationDerivedData = operationDerivedDataCache.cache.get(cacheKey); + if (cachedOperationDerivedData) { + return cachedOperationDerivedData; + } + const generatedSignature = (options.calculateSignature || usageReportingSignature)(requestContext.document, requestContext.operationName || ''); + const generatedOperationDerivedData = { + signature: generatedSignature, + referencedFieldsByType: calculateReferencedFieldsByType({ + document: requestContext.document, + schema, + resolvedOperationName: requestContext.operationName ?? null, + }), + }; + operationDerivedDataCache.cache.set(cacheKey, generatedOperationDerivedData); + return generatedOperationDerivedData; + } + } + }; + return { + async serverWillStop() { + if (reportTimer) { + clearInterval(reportTimer); + reportTimer = undefined; + } + stopped = true; + await sendAllReportsAndReportErrors(); + }, + }; + }, + }); +} +export function makeHTTPRequestHeaders(http, headers, sendHeaders) { + if (!sendHeaders || + ('none' in sendHeaders && sendHeaders.none) || + ('all' in sendHeaders && !sendHeaders.all)) { + return; + } + for (const [key, value] of headers) { + if (('exceptNames' in sendHeaders && + sendHeaders.exceptNames.some((exceptHeader) => { + return exceptHeader.toLowerCase() === key; + })) || + ('onlyNames' in sendHeaders && + !sendHeaders.onlyNames.some((header) => { + return header.toLowerCase() === key; + }))) { + continue; + } + switch (key) { + case 'authorization': + case 'cookie': + case 'set-cookie': + break; + default: + http.requestHeaders[key] = new Trace.HTTP.Values({ + value: [value], + }); + } + } +} +function defaultGenerateClientInfo({ request, }) { + const clientNameHeaderKey = 'apollographql-client-name'; + const clientVersionHeaderKey = 'apollographql-client-version'; + if (request.http?.headers?.get(clientNameHeaderKey) || + request.http?.headers?.get(clientVersionHeaderKey)) { + return { + clientName: request.http?.headers?.get(clientNameHeaderKey), + clientVersion: request.http?.headers?.get(clientVersionHeaderKey), + }; + } + else if (request.extensions?.clientInfo) { + return request.extensions.clientInfo; + } + else { + return {}; + } +} +//# sourceMappingURL=plugin.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js.map new file mode 100644 index 00000000..cf048a50 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EACL,uBAAuB,EACvB,+BAA+B,GAEhC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAsB,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAU5B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EACL,+BAA+B,EAE/B,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AAKxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;A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QACN,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts new file mode 100644 index 00000000..9a56ba22 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts @@ -0,0 +1,96 @@ +import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface'; +import { type google, type IContextualizedStats, type IFieldStat, type IPathErrorStats, type IQueryLatencyStats, type IReport, type IStatsContext, type ITracesAndStats, type ITypeStat, type ReportHeader, Trace } from '@apollo/usage-reporting-protobuf'; +import type { ReferencedFieldsByType } from '@apollo/utils.usagereporting'; +import { DurationHistogram } from './durationHistogram.js'; +export declare class SizeEstimator { + bytes: number; +} +export declare class OurReport implements Required { + readonly header: ReportHeader; + tracesPreAggregated: boolean; + constructor(header: ReportHeader); + readonly tracesPerQuery: Record; + endTime: google.protobuf.ITimestamp | null; + operationCount: number; + readonly sizeEstimator: SizeEstimator; + ensureCountsAreIntegers(): void; + addTrace({ statsReportKey, trace, asTrace, referencedFieldsByType, maxTraceBytes, nonFtv1ErrorPaths, }: { + statsReportKey: string; + trace: Trace; + asTrace: boolean; + referencedFieldsByType: ReferencedFieldsByType; + maxTraceBytes?: number; + nonFtv1ErrorPaths: NonFtv1ErrorPath[]; + }): void; + private getTracesAndStats; +} +declare class OurTracesAndStats implements Required { + readonly referencedFieldsByType: ReferencedFieldsByType; + constructor(referencedFieldsByType: ReferencedFieldsByType); + readonly trace: Uint8Array[]; + readonly statsWithContext: StatsByContext; + readonly internalTracesContributingToStats: Uint8Array[]; + ensureCountsAreIntegers(): void; +} +declare class StatsByContext { + readonly map: { + [k: string]: OurContextualizedStats; + }; + toArray(): IContextualizedStats[]; + ensureCountsAreIntegers(): void; + addTrace(trace: Trace, sizeEstimator: SizeEstimator, nonFtv1ErrorPaths: NonFtv1ErrorPath[]): void; + private getContextualizedStats; +} +export declare class OurContextualizedStats implements Required { + readonly context: IStatsContext; + queryLatencyStats: OurQueryLatencyStats; + perTypeStat: { + [k: string]: OurTypeStat; + }; + constructor(context: IStatsContext); + ensureCountsAreIntegers(): void; + addTrace(trace: Trace, sizeEstimator: SizeEstimator, nonFtv1ErrorPaths?: NonFtv1ErrorPath[]): void; + getTypeStat(parentType: string, sizeEstimator: SizeEstimator): OurTypeStat; +} +declare class OurQueryLatencyStats implements Required { + latencyCount: DurationHistogram; + requestCount: number; + requestsWithoutFieldInstrumentation: number; + cacheHits: number; + persistedQueryHits: number; + persistedQueryMisses: number; + cacheLatencyCount: DurationHistogram; + rootErrorStats: OurPathErrorStats; + requestsWithErrorsCount: number; + publicCacheTtlCount: DurationHistogram; + privateCacheTtlCount: DurationHistogram; + registeredOperationCount: number; + forbiddenOperationCount: number; +} +declare class OurPathErrorStats implements Required { + children: { + [k: string]: OurPathErrorStats; + }; + errorsCount: number; + requestsWithErrorsCount: number; + getChild(subPath: string, sizeEstimator: SizeEstimator): OurPathErrorStats; +} +declare class OurTypeStat implements Required { + perFieldStat: { + [k: string]: OurFieldStat; + }; + getFieldStat(fieldName: string, returnType: string, sizeEstimator: SizeEstimator): OurFieldStat; + ensureCountsAreIntegers(): void; +} +declare class OurFieldStat implements Required { + readonly returnType: string; + errorsCount: number; + observedExecutionCount: number; + estimatedExecutionCount: number; + requestsWithErrorsCount: number; + latencyCount: DurationHistogram; + constructor(returnType: string); + ensureCountsAreIntegers(): void; +} +export {}; +//# sourceMappingURL=stats.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts.map new file mode 100644 index 00000000..54af4768 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,EACN,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAkB3D,qBAAa,aAAa;IACxB,KAAK,SAAK;CACX;AACD,qBAAa,SAAU,YAAW,QAAQ,CAAC,OAAO,CAAC;IAOrC,QAAQ,CAAC,MAAM,EAAE,YAAY;IAFzC,mBAAmB,UAAS;gBAEP,MAAM,EAAE,YAAY;IACzC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CACpC;IACtB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAQ;IAClD,cAAc,SAAK;IAUnB,QAAQ,CAAC,aAAa,gBAAuB;IAE7C,uBAAuB;IAMvB,QAAQ,CAAC,EACP,cAAc,EACd,KAAK,EACL,OAAO,EACP,sBAAsB,EAItB,aAAgC,EAChC,iBAAiB,GAClB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,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kBAAkB,CAAC;IAChE,YAAY,EAAE,iBAAiB,CAA2B;IAC1D,YAAY,SAAK;IACjB,mCAAmC,SAAK;IACxC,SAAS,SAAK;IACd,kBAAkB,SAAK;IACvB,oBAAoB,SAAK;IACzB,iBAAiB,EAAE,iBAAiB,CAA2B;IAC/D,cAAc,EAAE,iBAAiB,CAA2B;IAC5D,uBAAuB,SAAK;IAC5B,mBAAmB,EAAE,iBAAiB,CAA2B;IACjE,oBAAoB,EAAE,iBAAiB,CAA2B;IAClE,wBAAwB,SAAK;IAC7B,uBAAuB,SAAK;CAC7B;AAED,cAAM,iBAAkB,YAAW,QAAQ,CAAC,eAAe,CAAC;IAC1D,QAAQ,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAA;KAAE,CAAuB;IACnE,WAAW,SAAK;IAChB,uBAAuB,SAAK;IAE5B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,iBAAiB;CAW3E;AAED,cAAM,WAAY,YAAW,QAAQ,CAAC,SAAS,CAAC;IAC9C,YAAY,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE,CAAuB;IAElE,YAAY,CACV,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,aAAa,GAC3B,YAAY;IAef,uBAAuB;CAKxB;AAED,cAAM,YAAa,YAAW,QAAQ,CAAC,UAAU,CAAC;IAUpC,QAAQ,CAAC,UAAU,EAAE,MAAM;IATvC,WAAW,SAAK;IAChB,sBAAsB,SAAK;IAI3B,uBAAuB,SAAK;IAC5B,uBAAuB,SAAK;IAC5B,YAAY,EAAE,iBAAiB,CAA2B;gBAErC,UAAU,EAAE,MAAM;IAEvC,uBAAuB;CAIxB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js new file mode 100644 index 00000000..e2937f69 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js @@ -0,0 +1,283 @@ +import { Trace, } from '@apollo/usage-reporting-protobuf'; +import { DurationHistogram } from './durationHistogram.js'; +import { iterateOverTrace } from './iterateOverTrace.js'; +export class SizeEstimator { + bytes = 0; +} +export class OurReport { + header; + tracesPreAggregated = false; + constructor(header) { + this.header = header; + } + tracesPerQuery = Object.create(null); + endTime = null; + operationCount = 0; + sizeEstimator = new SizeEstimator(); + ensureCountsAreIntegers() { + for (const tracesAndStats of Object.values(this.tracesPerQuery)) { + tracesAndStats.ensureCountsAreIntegers(); + } + } + addTrace({ statsReportKey, trace, asTrace, referencedFieldsByType, maxTraceBytes = 10 * 1024 * 1024, nonFtv1ErrorPaths, }) { + const tracesAndStats = this.getTracesAndStats({ + statsReportKey, + referencedFieldsByType, + }); + if (asTrace) { + const encodedTrace = Trace.encode(trace).finish(); + if (!isNaN(maxTraceBytes) && encodedTrace.length > maxTraceBytes) { + tracesAndStats.statsWithContext.addTrace(trace, this.sizeEstimator, nonFtv1ErrorPaths); + } + else { + tracesAndStats.trace.push(encodedTrace); + this.sizeEstimator.bytes += 2 + encodedTrace.length; + } + } + else { + tracesAndStats.statsWithContext.addTrace(trace, this.sizeEstimator, nonFtv1ErrorPaths); + } + } + getTracesAndStats({ statsReportKey, referencedFieldsByType, }) { + const existing = this.tracesPerQuery[statsReportKey]; + if (existing) { + return existing; + } + this.sizeEstimator.bytes += estimatedBytesForString(statsReportKey); + for (const [typeName, referencedFieldsForType] of Object.entries(referencedFieldsByType)) { + this.sizeEstimator.bytes += 2 + 2; + if (referencedFieldsForType.isInterface) { + this.sizeEstimator.bytes += 2; + } + this.sizeEstimator.bytes += estimatedBytesForString(typeName); + for (const fieldName of referencedFieldsForType.fieldNames) { + this.sizeEstimator.bytes += estimatedBytesForString(fieldName); + } + } + return (this.tracesPerQuery[statsReportKey] = new OurTracesAndStats(referencedFieldsByType)); + } +} +class OurTracesAndStats { + referencedFieldsByType; + constructor(referencedFieldsByType) { + this.referencedFieldsByType = referencedFieldsByType; + } + trace = []; + statsWithContext = new StatsByContext(); + internalTracesContributingToStats = []; + ensureCountsAreIntegers() { + this.statsWithContext.ensureCountsAreIntegers(); + } +} +class StatsByContext { + map = Object.create(null); + toArray() { + return Object.values(this.map); + } + ensureCountsAreIntegers() { + for (const contextualizedStats of Object.values(this.map)) { + contextualizedStats.ensureCountsAreIntegers(); + } + } + addTrace(trace, sizeEstimator, nonFtv1ErrorPaths) { + this.getContextualizedStats(trace, sizeEstimator).addTrace(trace, sizeEstimator, nonFtv1ErrorPaths); + } + getContextualizedStats(trace, sizeEstimator) { + const statsContext = { + clientName: trace.clientName, + clientVersion: trace.clientVersion, + }; + const statsContextKey = JSON.stringify(statsContext); + const existing = this.map[statsContextKey]; + if (existing) { + return existing; + } + sizeEstimator.bytes += + 20 + + estimatedBytesForString(trace.clientName) + + estimatedBytesForString(trace.clientVersion); + const contextualizedStats = new OurContextualizedStats(statsContext); + this.map[statsContextKey] = contextualizedStats; + return contextualizedStats; + } +} +export class OurContextualizedStats { + context; + queryLatencyStats = new OurQueryLatencyStats(); + perTypeStat = Object.create(null); + constructor(context) { + this.context = context; + } + ensureCountsAreIntegers() { + for (const typeStat of Object.values(this.perTypeStat)) { + typeStat.ensureCountsAreIntegers(); + } + } + addTrace(trace, sizeEstimator, nonFtv1ErrorPaths = []) { + const { fieldExecutionWeight } = trace; + if (!fieldExecutionWeight) { + this.queryLatencyStats.requestsWithoutFieldInstrumentation++; + } + this.queryLatencyStats.requestCount++; + if (trace.fullQueryCacheHit) { + this.queryLatencyStats.cacheLatencyCount.incrementDuration(trace.durationNs); + this.queryLatencyStats.cacheHits++; + } + else { + this.queryLatencyStats.latencyCount.incrementDuration(trace.durationNs); + } + if (!trace.fullQueryCacheHit && trace.cachePolicy?.maxAgeNs != null) { + switch (trace.cachePolicy.scope) { + case Trace.CachePolicy.Scope.PRIVATE: + this.queryLatencyStats.privateCacheTtlCount.incrementDuration(trace.cachePolicy.maxAgeNs); + break; + case Trace.CachePolicy.Scope.PUBLIC: + this.queryLatencyStats.publicCacheTtlCount.incrementDuration(trace.cachePolicy.maxAgeNs); + break; + } + } + if (trace.persistedQueryHit) { + this.queryLatencyStats.persistedQueryHits++; + } + if (trace.persistedQueryRegister) { + this.queryLatencyStats.persistedQueryMisses++; + } + if (trace.forbiddenOperation) { + this.queryLatencyStats.forbiddenOperationCount++; + } + if (trace.registeredOperation) { + this.queryLatencyStats.registeredOperationCount++; + } + let hasError = false; + const errorPathStats = new Set(); + const traceNodeStats = (node, path) => { + if (node.error?.length) { + hasError = true; + let currPathErrorStats = this.queryLatencyStats.rootErrorStats; + path.toArray().forEach((subPath) => { + currPathErrorStats = currPathErrorStats.getChild(subPath, sizeEstimator); + }); + errorPathStats.add(currPathErrorStats); + currPathErrorStats.errorsCount += node.error.length; + } + if (fieldExecutionWeight) { + const fieldName = node.originalFieldName || node.responseName; + if (node.parentType && + fieldName && + node.type && + node.endTime != null && + node.startTime != null && + node.endTime >= node.startTime) { + const typeStat = this.getTypeStat(node.parentType, sizeEstimator); + const fieldStat = typeStat.getFieldStat(fieldName, node.type, sizeEstimator); + fieldStat.errorsCount += node.error?.length ?? 0; + fieldStat.observedExecutionCount++; + fieldStat.estimatedExecutionCount += fieldExecutionWeight; + fieldStat.requestsWithErrorsCount += + (node.error?.length ?? 0) > 0 ? 1 : 0; + fieldStat.latencyCount.incrementDuration(node.endTime - node.startTime, fieldExecutionWeight); + } + } + return false; + }; + iterateOverTrace(trace, traceNodeStats, true); + for (const { subgraph, path } of nonFtv1ErrorPaths) { + hasError = true; + if (path) { + let currPathErrorStats = this.queryLatencyStats.rootErrorStats.getChild(`service:${subgraph}`, sizeEstimator); + path.forEach((subPath) => { + if (typeof subPath === 'string') { + currPathErrorStats = currPathErrorStats.getChild(subPath, sizeEstimator); + } + }); + errorPathStats.add(currPathErrorStats); + currPathErrorStats.errorsCount += 1; + } + } + for (const errorPath of errorPathStats) { + errorPath.requestsWithErrorsCount += 1; + } + if (hasError) { + this.queryLatencyStats.requestsWithErrorsCount++; + } + } + getTypeStat(parentType, sizeEstimator) { + const existing = this.perTypeStat[parentType]; + if (existing) { + return existing; + } + sizeEstimator.bytes += estimatedBytesForString(parentType); + const typeStat = new OurTypeStat(); + this.perTypeStat[parentType] = typeStat; + return typeStat; + } +} +class OurQueryLatencyStats { + latencyCount = new DurationHistogram(); + requestCount = 0; + requestsWithoutFieldInstrumentation = 0; + cacheHits = 0; + persistedQueryHits = 0; + persistedQueryMisses = 0; + cacheLatencyCount = new DurationHistogram(); + rootErrorStats = new OurPathErrorStats(); + requestsWithErrorsCount = 0; + publicCacheTtlCount = new DurationHistogram(); + privateCacheTtlCount = new DurationHistogram(); + registeredOperationCount = 0; + forbiddenOperationCount = 0; +} +class OurPathErrorStats { + children = Object.create(null); + errorsCount = 0; + requestsWithErrorsCount = 0; + getChild(subPath, sizeEstimator) { + const existing = this.children[subPath]; + if (existing) { + return existing; + } + const child = new OurPathErrorStats(); + this.children[subPath] = child; + sizeEstimator.bytes += estimatedBytesForString(subPath) + 4; + return child; + } +} +class OurTypeStat { + perFieldStat = Object.create(null); + getFieldStat(fieldName, returnType, sizeEstimator) { + const existing = this.perFieldStat[fieldName]; + if (existing) { + return existing; + } + sizeEstimator.bytes += + estimatedBytesForString(fieldName) + + estimatedBytesForString(returnType) + + 10; + const fieldStat = new OurFieldStat(returnType); + this.perFieldStat[fieldName] = fieldStat; + return fieldStat; + } + ensureCountsAreIntegers() { + for (const fieldStat of Object.values(this.perFieldStat)) { + fieldStat.ensureCountsAreIntegers(); + } + } +} +class OurFieldStat { + returnType; + errorsCount = 0; + observedExecutionCount = 0; + estimatedExecutionCount = 0; + requestsWithErrorsCount = 0; + latencyCount = new DurationHistogram(); + constructor(returnType) { + this.returnType = returnType; + } + ensureCountsAreIntegers() { + this.estimatedExecutionCount = Math.floor(this.estimatedExecutionCount); + } +} +function estimatedBytesForString(s) { + return 2 + Buffer.byteLength(s); +} +//# sourceMappingURL=stats.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js.map new file mode 100644 index 00000000..a0ee0207 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/stats.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/stats.ts"],"names":[],"mappings":"AACA,OAAO,EAWL,KAAK,GACN,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,uBAAuB,CAAC;AAiBhF,MAAM,OAAO,aAAa;IACxB,KAAK,GAAG,CAAC,CAAC;CACX;AACD,MAAM,OAAO,SAAS;IAOC;IAFrB,mBAAmB,GAAG,KAAK,CAAC;IAE5B,YAAqB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IACpC,cAAc,GACrB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,GAAsC,IAAI,CAAC;IAClD,cAAc,GAAG,CAAC,CAAC;IAUV,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;IAE7C,uBAAuB;QACrB,KAAK,MAAM,cAAc,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;YAChE,cAAc,CAAC,uBAAuB,EAAE,CAAC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IATrB,WAAW,GAAG,CAAC,CAAC;IAChB,sBAAsB,GAAG,CAAC,CAAC;IAI3B,uBAAuB,GAAG,CAAC,CAAC;IAC5B,uBAAuB,GAAG,CAAC,CAAC;IAC5B,YAAY,GAAsB,IAAI,iBAAiB,EAAE,CAAC;IAE1D,YAAqB,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAE3C,uBAAuB;QAErB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC1E,CAAC;CACF;AAED,SAAS,uBAAuB,CAAC,CAAS;IAIxC,OAAO,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts new file mode 100644 index 00000000..c6a42a90 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts @@ -0,0 +1,4 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +import type { VariableValueOptions } from './options.js'; +export declare function makeTraceDetails(variables: Record, sendVariableValues?: VariableValueOptions, operationString?: string): Trace.Details; +//# sourceMappingURL=traceDetails.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts.map new file mode 100644 index 00000000..7840c142 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"traceDetails.d.ts","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/traceDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASzD,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,kBAAkB,CAAC,EAAE,oBAAoB,EACzC,eAAe,CAAC,EAAE,MAAM,GACvB,KAAK,CAAC,OAAO,CA0Df"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js new file mode 100644 index 00000000..b30e13c9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js @@ -0,0 +1,60 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +export function makeTraceDetails(variables, sendVariableValues, operationString) { + const details = new Trace.Details(); + const variablesToRecord = (() => { + if (sendVariableValues && 'transform' in sendVariableValues) { + const originalKeys = Object.keys(variables); + try { + const modifiedVariables = sendVariableValues.transform({ + variables: variables, + operationString: operationString, + }); + return cleanModifiedVariables(originalKeys, modifiedVariables); + } + catch (e) { + return handleVariableValueTransformError(originalKeys); + } + } + else { + return variables; + } + })(); + Object.keys(variablesToRecord).forEach((name) => { + if (!sendVariableValues || + ('none' in sendVariableValues && sendVariableValues.none) || + ('all' in sendVariableValues && !sendVariableValues.all) || + ('exceptNames' in sendVariableValues && + sendVariableValues.exceptNames.includes(name)) || + ('onlyNames' in sendVariableValues && + !sendVariableValues.onlyNames.includes(name))) { + details.variablesJson[name] = ''; + } + else { + try { + details.variablesJson[name] = + typeof variablesToRecord[name] === 'undefined' + ? '' + : JSON.stringify(variablesToRecord[name]); + } + catch (e) { + details.variablesJson[name] = JSON.stringify('[Unable to convert value to JSON]'); + } + } + }); + return details; +} +function handleVariableValueTransformError(variableNames) { + const modifiedVariables = Object.create(null); + variableNames.forEach((name) => { + modifiedVariables[name] = '[PREDICATE_FUNCTION_ERROR]'; + }); + return modifiedVariables; +} +function cleanModifiedVariables(originalKeys, modifiedVariables) { + const cleanedVariables = Object.create(null); + originalKeys.forEach((name) => { + cleanedVariables[name] = modifiedVariables[name]; + }); + return cleanedVariables; +} +//# sourceMappingURL=traceDetails.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js.map new file mode 100644 index 00000000..96d51ff4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/plugin/usageReporting/traceDetails.js.map @@ -0,0 +1 @@ +{"version":3,"file":"traceDetails.js","sourceRoot":"","sources":["../../../../src/plugin/usageReporting/traceDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAUzD,MAAM,UAAU,gBAAgB,CAC9B,SAA8B,EAC9B,kBAAyC,EACzC,eAAwB;IAExB,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;IACpC,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE;QAC9B,IAAI,kBAAkB,IAAI,WAAW,IAAI,kBAAkB,EAAE,CAAC;YAC5D,MAAM,YAAY,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C,EAAE,CAAC;gBACX,OAAO,CAAC,aAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAC3C,mCAAmC,CACpC,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,iCAAiC,CACxC,aAAuB;IAEvB,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9C,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7B,iBAAiB,CAAC,IAAI,CAAC,GAAG,4BAA4B,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAID,SAAS,sBAAsB,CAC7B,YAA2B,EAC3B,iBAAsC;IAEtC,MAAM,gBAAgB,GAAwB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5B,gBAAgB,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IACH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts new file mode 100644 index 00000000..33a07e37 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts @@ -0,0 +1,4 @@ +import type { HeaderMap } from './utils/HeaderMap.js'; +export declare const recommendedCsrfPreventionRequestHeaders: string[]; +export declare function preventCsrf(headers: HeaderMap, csrfPreventionRequestHeaders: string[]): void; +//# sourceMappingURL=preventCsrf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts.map new file mode 100644 index 00000000..18f238c4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"preventCsrf.d.ts","sourceRoot":"","sources":["../../src/preventCsrf.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAYtD,eAAO,MAAM,uCAAuC,UAGnD,CAAC;AA4BF,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,EAClB,4BAA4B,EAAE,MAAM,EAAE,QAmDvC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js new file mode 100644 index 00000000..11c36e1d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js @@ -0,0 +1,34 @@ +import MIMEType from 'whatwg-mimetype'; +import { BadRequestError } from './internalErrorClasses.js'; +export const recommendedCsrfPreventionRequestHeaders = [ + 'x-apollo-operation-name', + 'apollo-require-preflight', +]; +const NON_PREFLIGHTED_CONTENT_TYPES = [ + 'application/x-www-form-urlencoded', + 'multipart/form-data', + 'text/plain', +]; +export function preventCsrf(headers, csrfPreventionRequestHeaders) { + const contentType = headers.get('content-type'); + if (contentType !== undefined) { + const contentTypeParsed = MIMEType.parse(contentType); + if (contentTypeParsed === null) { + return; + } + if (!NON_PREFLIGHTED_CONTENT_TYPES.includes(contentTypeParsed.essence)) { + return; + } + } + if (csrfPreventionRequestHeaders.some((header) => { + const value = headers.get(header); + return value !== undefined && value.length > 0; + })) { + return; + } + throw new BadRequestError(`This operation has been blocked as a potential Cross-Site Request Forgery ` + + `(CSRF). Please either specify a 'content-type' header (with a type that ` + + `is not one of ${NON_PREFLIGHTED_CONTENT_TYPES.join(', ')}) or provide ` + + `a non-empty value for one of the following headers: ${csrfPreventionRequestHeaders.join(', ')}\n`); +} +//# sourceMappingURL=preventCsrf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js.map new file mode 100644 index 00000000..7d6a8442 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/preventCsrf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"preventCsrf.js","sourceRoot":"","sources":["../../src/preventCsrf.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAa5D,MAAM,CAAC,MAAM,uCAAuC,GAAG;IACrD,yBAAyB;IACzB,0BAA0B;CAC3B,CAAC;AAGF,MAAM,6BAA6B,GAAG;IACpC,mCAAmC;IACnC,qBAAqB;IACrB,YAAY;CACb,CAAC;AAqBF,MAAM,UAAU,WAAW,CACzB,OAAkB,EAClB,4BAAsC;IAEtC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAOhD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,iBAAiB,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,iBAAiB,KAAK,IAAI,EAAE,CAAC;YAQ/B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC;YAKvE,OAAO;QACT,CAAC;IACH,CAAC;IAMD,IACE,4BAA4B,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC,CAAC,EACF,CAAC;QACD,OAAO;IACT,CAAC;IAED,MAAM,IAAI,eAAe,CACvB,4EAA4E;QAC1E,0EAA0E;QAC1E,iBAAiB,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe;QACxE,uDAAuD,4BAA4B,CAAC,IAAI,CACtF,IAAI,CACL,IAAI,CACR,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts new file mode 100644 index 00000000..1d6bfb5a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts @@ -0,0 +1,9 @@ +import type { GraphQLRequestContext, BaseContext, GraphQLResponse } from './externalTypes/index.js'; +import { type ApolloServer, type ApolloServerInternals, type SchemaDerivedData } from './ApolloServer.js'; +export declare const APQ_CACHE_PREFIX = "apq:"; +type Mutable = { + -readonly [P in keyof T]: T[P]; +}; +export declare function processGraphQLRequest(schemaDerivedData: SchemaDerivedData, server: ApolloServer, internals: ApolloServerInternals, requestContext: Mutable>): Promise; +export {}; +//# sourceMappingURL=requestPipeline.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts.map new file mode 100644 index 00000000..de988818 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.d.ts","sourceRoot":"","sources":["../../src/requestPipeline.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,qBAAqB,EAUrB,WAAW,EACX,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAgB3B,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAMvC,KAAK,OAAO,CAAC,CAAC,IAAI;IAAE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AA0CrD,wBAAsB,qBAAqB,CAAC,QAAQ,SAAS,WAAW,EACtE,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAC1C,cAAc,EAAE,OAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,CAuqB1B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js new file mode 100644 index 00000000..b73bb3ab --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js @@ -0,0 +1,364 @@ +import { createHash } from '@apollo/utils.createhash'; +import { specifiedRules, getOperationAST, GraphQLError, validate, parse, Kind, } from 'graphql'; +import { symbolExecutionDispatcherWillResolveField, enablePluginsForSchemaResolvers, symbolUserFieldResolver, } from './utils/schemaInstrumentation.js'; +import { PersistedQueryNotSupportedError, PersistedQueryNotFoundError, UserInputError, BadRequestError, ValidationError, SyntaxError, OperationResolutionError, } from './internalErrorClasses.js'; +import { ensureError, normalizeAndFormatErrors, ensureGraphQLError, } from './errorNormalize.js'; +import { invokeDidStartHook, invokeHooksUntilDefinedAndNonNull, invokeSyncDidStartHook, } from './utils/invokeHooks.js'; +import { makeGatewayGraphQLRequestContext } from './utils/makeGatewayGraphQLRequestContext.js'; +import { mergeHTTPGraphQLHead, newHTTPGraphQLHead } from './runHttpQuery.js'; +import { MEDIA_TYPES, } from './ApolloServer.js'; +import { isDefined } from './utils/isDefined.js'; +import { executeIncrementally, } from './incrementalDeliveryPolyfill.js'; +import { HeaderMap } from './utils/HeaderMap.js'; +import Negotiator from 'negotiator'; +export const APQ_CACHE_PREFIX = 'apq:'; +function computeQueryHash(query) { + return createHash('sha256').update(query).digest('hex'); +} +function isBadUserInputGraphQLError(error) { + return (error.nodes?.length === 1 && + error.nodes[0].kind === Kind.VARIABLE_DEFINITION && + (error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" has invalid value`) || + error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" got invalid value `) || + error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" of required type `) || + error.message.startsWith(`Variable "$${error.nodes[0].variable.name.value}" of non-null type `))); +} +export async function processGraphQLRequest(schemaDerivedData, server, internals, requestContext) { + const requestListeners = (await Promise.all(internals.plugins.map((p) => p.requestDidStart?.(requestContext)))).filter(isDefined); + const request = requestContext.request; + let { query, extensions } = request; + let queryHash; + requestContext.metrics.persistedQueryHit = false; + requestContext.metrics.persistedQueryRegister = false; + if (extensions?.persistedQuery) { + if (!internals.persistedQueries) { + return await sendErrorResponse([new PersistedQueryNotSupportedError()]); + } + else if (extensions.persistedQuery.version !== 1) { + return await sendErrorResponse([ + new GraphQLError('Unsupported persisted query version', { + extensions: { http: newHTTPGraphQLHead(400) }, + }), + ]); + } + queryHash = extensions.persistedQuery.sha256Hash; + if (query === undefined) { + query = await internals.persistedQueries.cache.get(queryHash); + if (query) { + requestContext.metrics.persistedQueryHit = true; + } + else { + return await sendErrorResponse([new PersistedQueryNotFoundError()]); + } + } + else { + const computedQueryHash = computeQueryHash(query); + if (queryHash !== computedQueryHash) { + return await sendErrorResponse([ + new GraphQLError('provided sha does not match query', { + extensions: { http: newHTTPGraphQLHead(400) }, + }), + ]); + } + requestContext.metrics.persistedQueryRegister = true; + } + } + else if (query) { + queryHash = computeQueryHash(query); + } + else { + return await sendErrorResponse([ + new BadRequestError('GraphQL operations must contain a non-empty `query` or a `persistedQuery` extension.'), + ]); + } + requestContext.queryHash = queryHash; + requestContext.source = query; + await Promise.all(requestListeners.map((l) => l.didResolveSource?.(requestContext))); + if (schemaDerivedData.documentStore) { + try { + requestContext.document = await schemaDerivedData.documentStore.get(schemaDerivedData.documentStoreKeyPrefix + queryHash); + } + catch (err) { + server.logger.warn('An error occurred while attempting to read from the documentStore. ' + + ensureError(err).message); + } + } + if (!requestContext.document) { + const parsingDidEnd = await invokeDidStartHook(requestListeners, async (l) => l.parsingDidStart?.(requestContext)); + try { + requestContext.document = parse(query, internals.parseOptions); + } + catch (syntaxMaybeError) { + const error = ensureError(syntaxMaybeError); + await parsingDidEnd(error); + return await sendErrorResponse([ + new SyntaxError(ensureGraphQLError(error)), + ]); + } + await parsingDidEnd(); + if (internals.dangerouslyDisableValidation !== true) { + const validationDidEnd = await invokeDidStartHook(requestListeners, async (l) => l.validationDidStart?.(requestContext)); + let validationErrors = validate(schemaDerivedData.schema, requestContext.document, [...specifiedRules, ...internals.validationRules], internals.validationOptions); + if (validationErrors.length === 0 && internals.laterValidationRules) { + validationErrors = validate(schemaDerivedData.schema, requestContext.document, internals.laterValidationRules); + } + if (validationErrors.length === 0) { + await validationDidEnd(); + } + else { + await validationDidEnd(validationErrors); + return await sendErrorResponse(validationErrors.map((error) => new ValidationError(error))); + } + } + if (schemaDerivedData.documentStore) { + Promise.resolve(schemaDerivedData.documentStore.set(schemaDerivedData.documentStoreKeyPrefix + queryHash, requestContext.document)).catch((err) => server.logger.warn('Could not store validated document. ' + err?.message || err)); + } + } + const operation = getOperationAST(requestContext.document, request.operationName); + requestContext.operation = operation || undefined; + requestContext.operationName = operation?.name?.value || null; + if (request.http?.method === 'GET' && + operation?.operation && + operation.operation !== 'query') { + return await sendErrorResponse([ + new BadRequestError(`GET requests only support query operations, not ${operation.operation} operations`, { + extensions: { + http: { status: 405, headers: new HeaderMap([['allow', 'POST']]) }, + }, + }), + ]); + } + try { + await Promise.all(requestListeners.map((l) => l.didResolveOperation?.(requestContext))); + } + catch (err) { + return await sendErrorResponse([ensureGraphQLError(err)]); + } + if (requestContext.metrics.persistedQueryRegister && + internals.persistedQueries) { + const ttl = internals.persistedQueries?.ttl; + Promise.resolve(internals.persistedQueries.cache.set(queryHash, query, ttl !== undefined + ? { ttl: internals.persistedQueries?.ttl } + : undefined)).catch(server.logger.warn.bind(server.logger)); + } + const responseFromPlugin = await invokeHooksUntilDefinedAndNonNull(requestListeners, async (l) => await l.responseForOperation?.(requestContext)); + if (responseFromPlugin !== null) { + requestContext.response.body = responseFromPlugin.body; + mergeHTTPGraphQLHead(requestContext.response.http, responseFromPlugin.http); + } + else { + const executionListeners = (await Promise.all(requestListeners.map((l) => l.executionDidStart?.(requestContext)))).filter(isDefined); + executionListeners.reverse(); + if (executionListeners.some((l) => l.willResolveField)) { + const invokeWillResolveField = (...args) => invokeSyncDidStartHook(executionListeners, (l) => l.willResolveField?.(...args)); + Object.defineProperty(requestContext.contextValue, symbolExecutionDispatcherWillResolveField, { value: invokeWillResolveField }); + if (internals.fieldResolver) { + Object.defineProperty(requestContext.contextValue, symbolUserFieldResolver, { + value: internals.fieldResolver, + }); + } + enablePluginsForSchemaResolvers(schemaDerivedData.schema); + } + try { + const fullResult = await execute({ + ...requestContext, + useLegacyIncremental: new Negotiator({ + headers: { accept: request.http?.headers.get('accept') }, + }).mediaType([ + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + ]) === MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + }); + const result = 'singleResult' in fullResult + ? fullResult.singleResult + : fullResult.initialResult; + if (!requestContext.operation) { + if (!result.errors?.length) { + throw new Error('Unexpected error: Apollo Server did not resolve an operation but execute did not return errors'); + } + throw new OperationResolutionError(result.errors[0]); + } + const resultErrors = result.errors?.map((e) => { + if (isBadUserInputGraphQLError(e) && e.extensions?.code == null) { + return new UserInputError(e); + } + return e; + }); + if (resultErrors) { + await didEncounterErrors(resultErrors); + } + const { formattedErrors, httpFromErrors } = resultErrors + ? formatErrors(resultErrors) + : { formattedErrors: undefined, httpFromErrors: newHTTPGraphQLHead() }; + if (internals.status400ForVariableCoercionErrors && + resultErrors?.length && + result.data === undefined && + !httpFromErrors.status) { + httpFromErrors.status = 400; + } + mergeHTTPGraphQLHead(requestContext.response.http, httpFromErrors); + if ('singleResult' in fullResult) { + requestContext.response.body = { + kind: 'single', + singleResult: { + ...result, + errors: formattedErrors, + }, + }; + } + else { + requestContext.response.body = { + kind: 'incremental', + initialResult: { + ...fullResult.initialResult, + errors: formattedErrors, + }, + subsequentResults: fullResult.subsequentResults, + }; + } + } + catch (executionMaybeError) { + const executionError = ensureError(executionMaybeError); + await Promise.all(executionListeners.map((l) => l.executionDidEnd?.(executionError))); + return await sendErrorResponse([ensureGraphQLError(executionError)]); + } + await Promise.all(executionListeners.map((l) => l.executionDidEnd?.())); + } + await invokeWillSendResponse(); + if (!requestContext.response.body) { + throw Error('got to end of processGraphQLRequest without setting body?'); + } + return requestContext.response; + async function execute({ useLegacyIncremental, ...requestContext }) { + const { request, document } = requestContext; + if (internals.__testing_incrementalExecutionResults) { + return internals.__testing_incrementalExecutionResults; + } + else if (internals.gatewayExecutor) { + const result = await internals.gatewayExecutor(makeGatewayGraphQLRequestContext(requestContext, server, internals)); + return { singleResult: result }; + } + else { + const resultOrResults = await executeIncrementally({ + schema: schemaDerivedData.schema, + document, + rootValue: typeof internals.rootValue === 'function' + ? internals.rootValue(document) + : internals.rootValue, + contextValue: requestContext.contextValue, + variableValues: request.variables, + operationName: request.operationName, + fieldResolver: internals.fieldResolver, + useLegacyIncremental, + options: internals.executionOptions, + legacyExperimentalExecuteIncrementally: internals.legacyExperimentalExecuteIncrementally, + }); + if ('initialResult' in resultOrResults) { + return { + initialResult: resultOrResults.initialResult, + subsequentResults: 'pending' in resultOrResults.initialResult + ? formatErrorsInSubsequentResultsAlpha9(resultOrResults.subsequentResults) + : formatErrorsInSubsequentResultsAlpha2(resultOrResults.subsequentResults), + }; + } + else { + return { singleResult: resultOrResults }; + } + } + } + async function* formatErrorsInSubsequentResultsAlpha2(results) { + for await (const result of results) { + const payload = result.incremental + ? { + ...result, + incremental: await seriesAsyncMap(result.incremental, async (incrementalResult) => { + const { errors } = incrementalResult; + if (errors) { + await Promise.all(requestListeners.map((l) => l.didEncounterSubsequentErrors?.(requestContext, errors))); + return { + ...incrementalResult, + errors: formatErrors(errors).formattedErrors, + }; + } + return incrementalResult; + }), + } + : result; + await Promise.all(requestListeners.map((l) => l.willSendSubsequentPayload?.(requestContext, payload))); + yield payload; + } + } + async function* formatErrorsInSubsequentResultsAlpha9(results) { + for await (const result of results) { + const payload = result.incremental + ? { + ...result, + incremental: await seriesAsyncMap(result.incremental, async (incrementalResult) => { + const { errors } = incrementalResult; + if (errors) { + await Promise.all(requestListeners.map((l) => l.didEncounterSubsequentErrors?.(requestContext, errors))); + return { + ...incrementalResult, + errors: formatErrors(errors).formattedErrors, + }; + } + return incrementalResult; + }), + } + : result; + if (result.completed) { + payload.completed = await seriesAsyncMap(result.completed, async (completedResult) => { + const { errors } = completedResult; + if (errors) { + await Promise.all(requestListeners.map((l) => l.didEncounterSubsequentErrors?.(requestContext, errors))); + return { + ...completedResult, + errors: formatErrors(errors).formattedErrors, + }; + } + return completedResult; + }); + } + await Promise.all(requestListeners.map((l) => l.willSendSubsequentPayload?.(requestContext, payload))); + yield payload; + } + } + async function invokeWillSendResponse() { + await Promise.all(requestListeners.map((l) => l.willSendResponse?.(requestContext))); + } + async function didEncounterErrors(errors) { + requestContext.errors = errors; + return await Promise.all(requestListeners.map((l) => l.didEncounterErrors?.(requestContext))); + } + async function sendErrorResponse(errors) { + await didEncounterErrors(errors); + const { formattedErrors, httpFromErrors } = formatErrors(errors); + requestContext.response.body = { + kind: 'single', + singleResult: { + errors: formattedErrors, + }, + }; + mergeHTTPGraphQLHead(requestContext.response.http, httpFromErrors); + if (!requestContext.response.http.status) { + requestContext.response.http.status = 500; + } + await invokeWillSendResponse(); + return requestContext.response; + } + function formatErrors(errors) { + return normalizeAndFormatErrors(errors, { + formatError: internals.formatError, + includeStacktraceInErrorResponses: internals.includeStacktraceInErrorResponses, + }); + } +} +async function seriesAsyncMap(ts, fn) { + const us = []; + for (const t of ts) { + const u = await fn(t); + us.push(u); + } + return us; +} +//# sourceMappingURL=requestPipeline.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js.map new file mode 100644 index 00000000..19eda3e8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/requestPipeline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"requestPipeline.js","sourceRoot":"","sources":["../../src/requestPipeline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end/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.d.ts new file mode 100644 index 00000000..d7fbe461 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.d.ts @@ -0,0 +1,15 @@ +import type { BaseContext, HTTPGraphQLHead, HTTPGraphQLRequest, HTTPGraphQLResponse } from './externalTypes/index.js'; +import { type ApolloServer, type ApolloServerInternals, type SchemaDerivedData } from './ApolloServer.js'; +import { type FormattedExecutionResult } from 'graphql'; +export declare function runHttpQuery({ server, httpRequest, contextValue, schemaDerivedData, internals, sharedResponseHTTPGraphQLHead, }: { + server: ApolloServer; + httpRequest: HTTPGraphQLRequest; + contextValue: TContext; + schemaDerivedData: SchemaDerivedData; + internals: ApolloServerInternals; + sharedResponseHTTPGraphQLHead: HTTPGraphQLHead | null; +}): Promise; +export declare function prettyJSONStringify(value: FormattedExecutionResult): string; +export declare function newHTTPGraphQLHead(status?: number): HTTPGraphQLHead; +export declare function mergeHTTPGraphQLHead(target: HTTPGraphQLHead, source: HTTPGraphQLHead): void; +//# sourceMappingURL=runHttpQuery.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.d.ts.map new file mode 100644 index 00000000..ef24db42 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"runHttpQuery.d.ts","sourceRoot":"","sources":["../../src/runHttpQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EAMX,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAI1B,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,wBAAwB,EAAQ,MAAM,SAAS,CAAC;AAkG9D,wBAAsB,YAAY,CAAC,QAAQ,SAAS,WAAW,EAAE,EAC/D,MAAM,EACN,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,6BAA6B,GAC9B,EAAE;IACD,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC/B,WAAW,EAAE,kBAAkB,CAAC;IAChC,YAAY,EAAE,QAAQ,CAAC;IACvB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC3C,6BAA6B,EAAE,eAAe,GAAG,IAAI,CAAC;CACvD,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA6M/B;AA2CD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,UAElE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAKnE;AAKD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,eAAe,QAYxB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js new file mode 100644 index 00000000..e6eed789 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js @@ -0,0 +1,221 @@ +import { chooseContentTypeForSingleResultResponse, internalExecuteOperation, MEDIA_TYPES, } from './ApolloServer.js'; +import { Kind } from 'graphql'; +import { BadRequestError } from './internalErrorClasses.js'; +import Negotiator from 'negotiator'; +import { HeaderMap } from './utils/HeaderMap.js'; +import MIMEType from 'whatwg-mimetype'; +function fieldIfString(o, fieldName) { + const value = o[fieldName]; + if (typeof value === 'string') { + return value; + } + return undefined; +} +function searchParamIfSpecifiedOnce(searchParams, paramName) { + const values = searchParams.getAll(paramName); + switch (values.length) { + case 0: + return undefined; + case 1: + return values[0]; + default: + throw new BadRequestError(`The '${paramName}' search parameter may only be specified once.`); + } +} +function jsonParsedSearchParamIfSpecifiedOnce(searchParams, fieldName) { + const value = searchParamIfSpecifiedOnce(searchParams, fieldName); + if (value === undefined) { + return undefined; + } + let hopefullyRecord; + try { + hopefullyRecord = JSON.parse(value); + } + catch { + throw new BadRequestError(`The ${fieldName} search parameter contains invalid JSON.`); + } + if (!isStringRecord(hopefullyRecord)) { + throw new BadRequestError(`The ${fieldName} search parameter should contain a JSON-encoded object.`); + } + return hopefullyRecord; +} +function fieldIfRecord(o, fieldName) { + const value = o[fieldName]; + if (isStringRecord(value)) { + return value; + } + return undefined; +} +function isStringRecord(o) { + return (!!o && typeof o === 'object' && !Buffer.isBuffer(o) && !Array.isArray(o)); +} +function isNonEmptyStringRecord(o) { + return isStringRecord(o) && Object.keys(o).length > 0; +} +function ensureQueryIsStringOrMissing(query) { + if (!query || typeof query === 'string') { + return; + } + if (query.kind === Kind.DOCUMENT) { + throw new BadRequestError("GraphQL queries must be strings. It looks like you're sending the " + + 'internal graphql-js representation of a parsed query in your ' + + 'request instead of a request in the GraphQL query language. You ' + + 'can convert an AST to a string using the `print` function from ' + + '`graphql`, or use a client like `apollo-client` which converts ' + + 'the internal representation to a string for you.'); + } + else { + throw new BadRequestError('GraphQL queries must be strings.'); + } +} +export async function runHttpQuery({ server, httpRequest, contextValue, schemaDerivedData, internals, sharedResponseHTTPGraphQLHead, }) { + let graphQLRequest; + switch (httpRequest.method) { + case 'POST': { + if (!isNonEmptyStringRecord(httpRequest.body)) { + throw new BadRequestError('POST body missing, invalid Content-Type, or JSON object has no keys.'); + } + ensureQueryIsStringOrMissing(httpRequest.body.query); + if (typeof httpRequest.body.variables === 'string') { + throw new BadRequestError('`variables` in a POST body should be provided as an object, not a recursively JSON-encoded string.'); + } + if (typeof httpRequest.body.extensions === 'string') { + throw new BadRequestError('`extensions` in a POST body should be provided as an object, not a recursively JSON-encoded string.'); + } + if ('extensions' in httpRequest.body && + httpRequest.body.extensions !== null && + !isStringRecord(httpRequest.body.extensions)) { + throw new BadRequestError('`extensions` in a POST body must be an object if provided.'); + } + if ('variables' in httpRequest.body && + httpRequest.body.variables !== null && + !isStringRecord(httpRequest.body.variables)) { + throw new BadRequestError('`variables` in a POST body must be an object if provided.'); + } + if ('operationName' in httpRequest.body && + httpRequest.body.operationName !== null && + typeof httpRequest.body.operationName !== 'string') { + throw new BadRequestError('`operationName` in a POST body must be a string if provided.'); + } + graphQLRequest = { + query: fieldIfString(httpRequest.body, 'query'), + operationName: fieldIfString(httpRequest.body, 'operationName'), + variables: fieldIfRecord(httpRequest.body, 'variables'), + extensions: fieldIfRecord(httpRequest.body, 'extensions'), + http: httpRequest, + }; + break; + } + case 'GET': { + const contentType = httpRequest.headers.get('content-type'); + if (contentType !== undefined) { + const contentTypeParsed = MIMEType.parse(contentType); + if (contentTypeParsed === null || + contentTypeParsed.essence !== 'application/json') { + throw new BadRequestError('GET requests may not have a content-type header other than application/json.', { extensions: { http: newHTTPGraphQLHead(415) } }); + } + } + const searchParams = new URLSearchParams(httpRequest.search); + graphQLRequest = { + query: searchParamIfSpecifiedOnce(searchParams, 'query'), + operationName: searchParamIfSpecifiedOnce(searchParams, 'operationName'), + variables: jsonParsedSearchParamIfSpecifiedOnce(searchParams, 'variables'), + extensions: jsonParsedSearchParamIfSpecifiedOnce(searchParams, 'extensions'), + http: httpRequest, + }; + break; + } + default: + throw new BadRequestError('Apollo Server supports only GET/POST requests.', { + extensions: { + http: { + status: 405, + headers: new HeaderMap([['allow', 'GET, POST']]), + }, + }, + }); + } + const graphQLResponse = await internalExecuteOperation({ + server, + graphQLRequest, + internals, + schemaDerivedData, + sharedResponseHTTPGraphQLHead, + }, { contextValue }); + if (graphQLResponse.body.kind === 'single') { + if (!graphQLResponse.http.headers.get('content-type')) { + const contentType = chooseContentTypeForSingleResultResponse(httpRequest); + if (contentType === null) { + throw new BadRequestError(`An 'accept' header was provided for this request which does not accept ` + + `${MEDIA_TYPES.APPLICATION_JSON} or ${MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON}`, { extensions: { http: { status: 406 } } }); + } + graphQLResponse.http.headers.set('content-type', contentType); + } + return { + ...graphQLResponse.http, + body: { + kind: 'complete', + string: await internals.stringifyResult(orderExecutionResultFields(graphQLResponse.body.singleResult)), + }, + }; + } + const acceptHeader = httpRequest.headers.get('accept'); + const negotiator = new Negotiator({ headers: { accept: acceptHeader } }); + const preferredMediaType = negotiator.mediaType([ + MEDIA_TYPES.MULTIPART_MIXED_NO_DEFER_SPEC, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + ]); + if (!acceptHeader || + (preferredMediaType !== MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2 && + preferredMediaType !== MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9)) { + throw new BadRequestError('Apollo server received an operation that uses incremental delivery ' + + '(@defer or @stream), but the client does not accept multipart/mixed ' + + 'HTTP responses. To enable incremental delivery support, add the HTTP ' + + `header 'Accept: ${MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' ` + + 'if your client supports the current incremental format or ' + + `'Accept: ${MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2}' if your ` + + 'client supports the legacy incremental format', { extensions: { http: { status: 406 } } }); + } + graphQLResponse.http.headers.set('content-type', `multipart/mixed; boundary="-"; ${preferredMediaType.replace('multipart/mixed; ', '')}`); + return { + ...graphQLResponse.http, + body: { + kind: 'chunked', + asyncIterator: writeMultipartBody(graphQLResponse.body.initialResult, graphQLResponse.body.subsequentResults), + }, + }; +} +async function* writeMultipartBody(initialResult, subsequentResults) { + yield `\r\n---\r\ncontent-type: application/json; charset=utf-8\r\n\r\n${JSON.stringify(initialResult)}\r\n---${initialResult.hasNext ? '' : '--'}\r\n`; + for await (const result of subsequentResults) { + yield `content-type: application/json; charset=utf-8\r\n\r\n${JSON.stringify(result)}\r\n---${result.hasNext ? '' : '--'}\r\n`; + } +} +function orderExecutionResultFields(result) { + return { + errors: result.errors, + data: result.data, + extensions: result.extensions, + }; +} +export function prettyJSONStringify(value) { + return JSON.stringify(value) + '\n'; +} +export function newHTTPGraphQLHead(status) { + return { + status, + headers: new HeaderMap(), + }; +} +export function mergeHTTPGraphQLHead(target, source) { + if (source.status) { + target.status = source.status; + } + if (source.headers) { + for (const [name, value] of source.headers) { + target.headers.set(name, value); + } + } +} +//# sourceMappingURL=runHttpQuery.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js.map new file mode 100644 index 00000000..3186efce --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/runHttpQuery.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runHttpQuery.js","sourceRoot":"","sources":["../../src/runHttpQuery.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,wCAAwC,EACxC,wBAAwB,EACxB,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAiC,IAAI,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,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ACP,UAAU,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;IAC9C,CAAC;AACH,CAAC;AAID,SAAS,0BAA0B,CACjC,MAAgC;IAEhC,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC;AACJ,CAAC;AAGD,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAe;IAChD,OAAO;QACL,MAAM;QACN,OAAO,EAAE,IAAI,SAAS,EAAE;KACzB,CAAC;AACJ,CAAC;AAKD,MAAM,UAAU,oBAAoB,CAClC,MAAuB,EACvB,MAAuB;IAEvB,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAChC,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YAG3C,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts new file mode 100644 index 00000000..3e0a5443 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts @@ -0,0 +1,25 @@ +import type { WithRequired } from '@apollo/utils.withrequired'; +import { type IncomingMessage, type ServerResponse } from 'http'; +import type { ListenOptions } from 'net'; +import type { ApolloServer } from '../ApolloServer.js'; +import type { BaseContext, ContextFunction } from '../externalTypes/index.js'; +export interface StandaloneServerContextFunctionArgument { + req: IncomingMessage; + res: ServerResponse; +} +export interface StartStandaloneServerOptions { + context?: ContextFunction<[ + StandaloneServerContextFunctionArgument + ], TContext>; +} +export declare function startStandaloneServer(server: ApolloServer, options?: StartStandaloneServerOptions & { + listen?: ListenOptions; +}): Promise<{ + url: string; +}>; +export declare function startStandaloneServer(server: ApolloServer, options: WithRequired, 'context'> & { + listen?: ListenOptions; +}): Promise<{ + url: string; +}>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts.map new file mode 100644 index 00000000..b4b3bb3e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/standalone/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAa,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AAMnC,MAAM,WAAW,uCAAuC;IACtD,GAAG,EAAE,eAAe,CAAC;IACrB,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B,CAAC,QAAQ,SAAS,WAAW;IACxE,OAAO,CAAC,EAAE,eAAe,CACvB;QAAC,uCAAuC;KAAC,EACzC,QAAQ,CACT,CAAC;CACH;AAQD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC,EACjC,OAAO,CAAC,EAAE,4BAA4B,CAAC,WAAW,CAAC,GAAG;IACpD,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GACA,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC5B,wBAAsB,qBAAqB,CAAC,QAAQ,SAAS,WAAW,EACtE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,OAAO,EAAE,YAAY,CAAC,4BAA4B,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,GAAG;IACzE,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GACA,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js new file mode 100644 index 00000000..bd58a274 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js @@ -0,0 +1,91 @@ +import cors from 'cors'; +import bodyParser from 'body-parser'; +import { parse as parseContentType } from 'content-type'; +import http from 'http'; +import { parse as urlParse } from 'url'; +import { ApolloServerPluginDrainHttpServer } from '../plugin/drainHttpServer/index.js'; +import { urlForHttpServer } from '../utils/urlForHttpServer.js'; +import { HeaderMap } from '../utils/HeaderMap.js'; +import finalhandler from 'finalhandler'; +const validCharset = /^utf-(8|((16|32)(le|be)?))$/i; +export async function startStandaloneServer(server, options) { + const context = options?.context ?? (async () => ({})); + const corsHandler = cors(); + const jsonHandler = bodyParser.json({ + verify(req) { + const charset = parseContentType(req).parameters.charset || 'utf-8'; + if (!charset.match(validCharset)) { + throw Object.assign(new Error(`unsupported charset "${charset.toUpperCase()}"`), { + status: 415, + name: 'UnsupportedMediaTypeError', + charset, + type: 'charset.unsupported', + }); + } + }, + limit: '50mb', + }); + const httpServer = http.createServer((req, res) => { + const errorHandler = finalhandler(req, res, { + onerror(err) { + if (process.env.NODE_ENV !== 'test') { + console.error(err.stack || err.toString()); + } + }, + }); + corsHandler(req, res, (err) => { + if (err) { + errorHandler(err); + return; + } + jsonHandler(req, res, (err) => { + if (err) { + errorHandler(err); + return; + } + const headers = new HeaderMap(); + for (const [key, value] of Object.entries(req.headers)) { + if (value !== undefined) { + headers.set(key, Array.isArray(value) ? value.join(', ') : value); + } + } + const httpGraphQLRequest = { + method: req.method.toUpperCase(), + headers, + search: urlParse(req.url).search ?? '', + body: 'body' in req ? req.body : undefined, + }; + server + .executeHTTPGraphQLRequest({ + httpGraphQLRequest, + context: () => context({ req, res }), + }) + .then(async (httpGraphQLResponse) => { + for (const [key, value] of httpGraphQLResponse.headers) { + res.setHeader(key, value); + } + res.statusCode = httpGraphQLResponse.status || 200; + if (httpGraphQLResponse.body.kind === 'complete') { + res.end(httpGraphQLResponse.body.string); + return; + } + for await (const chunk of httpGraphQLResponse.body.asyncIterator) { + res.write(chunk); + } + res.end(); + }) + .catch((err) => { + errorHandler(err); + }); + }); + }); + }); + server.addPlugin(ApolloServerPluginDrainHttpServer({ httpServer: httpServer })); + await server.start(); + const listenOptions = options?.listen ?? { port: 4000 }; + await new Promise((resolve) => { + httpServer.listen(listenOptions, resolve); + }); + return { url: urlForHttpServer(httpServer) }; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js.map new file mode 100644 index 00000000..bc467213 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/standalone/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/standalone/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,IAAmD,MAAM,MAAM,CAAC;AAEvE,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,KAAK,CAAC;AAOxC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,YAAY,MAAM,cAAc,CAAC;AAkBxC,MAAM,YAAY,GAAG,8BAA8B,CAAC;AAcpD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAA8B,EAC9B,OAA6E;IAE7E,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAa,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,IAAI,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC;QAClC,MAAM,CAAC,GAAG;YACR,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,IAAI,OAAO,CAAC;YACpE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBACjC,MAAM,MAAM,CAAC,MAAM,CACjB,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EAAE;oBACb,YAAY,CAAC,GAAG,CAAC,CAAC;gBACpB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,SAAS,CACd,iCAAiC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAC9D,CAAC;IAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,MAAM,aAAa,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAExD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,UAAU,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts new file mode 100644 index 00000000..e73267f8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts @@ -0,0 +1,8 @@ +export declare class HeaderMap extends Map { + private __identity; + set(key: string, value: string): this; + get(key: string): string | undefined; + delete(key: string): boolean; + has(key: string): boolean; +} +//# sourceMappingURL=HeaderMap.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts.map new file mode 100644 index 00000000..5852558a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"HeaderMap.d.ts","sourceRoot":"","sources":["../../../src/utils/HeaderMap.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAIhD,OAAO,CAAC,UAAU,CAAuB;IAEhC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIrC,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,GAAG,CAAC,GAAG,EAAE,MAAM;CAGzB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js new file mode 100644 index 00000000..aef092c6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js @@ -0,0 +1,16 @@ +export class HeaderMap extends Map { + __identity = Symbol('HeaderMap'); + set(key, value) { + return super.set(key.toLowerCase(), value); + } + get(key) { + return super.get(key.toLowerCase()); + } + delete(key) { + return super.delete(key.toLowerCase()); + } + has(key) { + return super.has(key.toLowerCase()); + } +} +//# sourceMappingURL=HeaderMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js.map new file mode 100644 index 00000000..646ae7e2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/HeaderMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HeaderMap.js","sourceRoot":"","sources":["../../../src/utils/HeaderMap.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,GAAmB;IAIxC,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAEhC,GAAG,CAAC,GAAW,EAAE,KAAa;QACrC,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAEQ,GAAG,CAAC,GAAW;QACtB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACtC,CAAC;IAEQ,MAAM,CAAC,GAAW;QACzB,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACzC,CAAC;IAEQ,GAAG,CAAC,GAAW;QACtB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACtC,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts new file mode 100644 index 00000000..447bc92b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts @@ -0,0 +1,4 @@ +export declare class UnreachableCaseError extends Error { + constructor(val: never); +} +//# sourceMappingURL=UnreachableCaseError.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts.map new file mode 100644 index 00000000..8f542822 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"UnreachableCaseError.d.ts","sourceRoot":"","sources":["../../../src/utils/UnreachableCaseError.ts"],"names":[],"mappings":"AAKA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,GAAG,EAAE,KAAK;CAGvB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js new file mode 100644 index 00000000..4cc90ecc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js @@ -0,0 +1,6 @@ +export class UnreachableCaseError extends Error { + constructor(val) { + super(`Unreachable case: ${val}`); + } +} +//# sourceMappingURL=UnreachableCaseError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js.map new file mode 100644 index 00000000..09d125d5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/UnreachableCaseError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UnreachableCaseError.js","sourceRoot":"","sources":["../../../src/utils/UnreachableCaseError.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,GAAU;QACpB,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IACpC,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts new file mode 100644 index 00000000..74ce9c39 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts @@ -0,0 +1,2 @@ +export declare function computeCoreSchemaHash(schema: string): string; +//# sourceMappingURL=computeCoreSchemaHash.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts.map new file mode 100644 index 00000000..94ad4a8f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"computeCoreSchemaHash.d.ts","sourceRoot":"","sources":["../../../src/utils/computeCoreSchemaHash.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js new file mode 100644 index 00000000..93005027 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js @@ -0,0 +1,5 @@ +import { createHash } from '@apollo/utils.createhash'; +export function computeCoreSchemaHash(schema) { + return createHash('sha256').update(schema).digest('hex'); +} +//# sourceMappingURL=computeCoreSchemaHash.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js.map new file mode 100644 index 00000000..bbad7296 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/computeCoreSchemaHash.js.map @@ -0,0 +1 @@ +{"version":3,"file":"computeCoreSchemaHash.js","sourceRoot":"","sources":["../../../src/utils/computeCoreSchemaHash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAMtD,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts new file mode 100644 index 00000000..1893622c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts @@ -0,0 +1,7 @@ +type AsyncDidEndHook = (...args: TArgs) => Promise; +type SyncDidEndHook = (...args: TArgs) => void; +export declare function invokeDidStartHook(targets: T[], hook: (t: T) => Promise | undefined | void>): Promise>; +export declare function invokeSyncDidStartHook(targets: T[], hook: (t: T) => SyncDidEndHook | undefined | void): SyncDidEndHook; +export declare function invokeHooksUntilDefinedAndNonNull(targets: T[], hook: (t: T) => Promise): Promise; +export {}; +//# sourceMappingURL=invokeHooks.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts.map new file mode 100644 index 00000000..acd49d56 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"invokeHooks.d.ts","sourceRoot":"","sources":["../../../src/utils/invokeHooks.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,CAAC,KAAK,SAAS,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9E,KAAK,cAAc,CAAC,KAAK,SAAS,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;AAEpE,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,YAAY,SAAS,OAAO,EAAE,EACxE,OAAO,EAAE,CAAC,EAAE,EACZ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,GACxE,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAYxC;AAID,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,YAAY,SAAS,OAAO,EAAE,EACtE,OAAO,EAAE,CAAC,EAAE,EACZ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,cAAc,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,IAAI,GAC9D,cAAc,CAAC,YAAY,CAAC,CAY9B;AAED,wBAAsB,iCAAiC,CAAC,CAAC,EAAE,IAAI,EAC7D,OAAO,EAAE,CAAC,EAAE,EACZ,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,GAC/C,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAQtB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js new file mode 100644 index 00000000..e568b2ae --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js @@ -0,0 +1,31 @@ +import { isDefined } from './isDefined.js'; +export async function invokeDidStartHook(targets, hook) { + const didEndHooks = (await Promise.all(targets.map((target) => hook(target)))).filter(isDefined); + didEndHooks.reverse(); + return async (...args) => { + for (const didEndHook of didEndHooks) { + didEndHook(...args); + } + }; +} +export function invokeSyncDidStartHook(targets, hook) { + const didEndHooks = targets + .map((target) => hook(target)) + .filter(isDefined); + didEndHooks.reverse(); + return (...args) => { + for (const didEndHook of didEndHooks) { + didEndHook(...args); + } + }; +} +export async function invokeHooksUntilDefinedAndNonNull(targets, hook) { + for (const target of targets) { + const value = await hook(target); + if (value != null) { + return value; + } + } + return null; +} +//# sourceMappingURL=invokeHooks.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js.map new file mode 100644 index 00000000..e196b0fc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/invokeHooks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"invokeHooks.js","sourceRoot":"","sources":["../../../src/utils/invokeHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAY,EACZ,IAAyE;IAEzE,MAAM,WAAW,GAAG,CAClB,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACzD,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEpB,WAAW,CAAC,OAAO,EAAE,CAAC;IAEtB,OAAO,KAAK,EAAE,GAAG,IAAkB,EAAE,EAAE;QACrC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAID,MAAM,UAAU,sBAAsB,CACpC,OAAY,EACZ,IAA+D;IAE/D,MAAM,WAAW,GAAmC,OAAO;SACxD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B,MAAM,CAAC,SAAS,CAAC,CAAC;IAErB,WAAW,CAAC,OAAO,EAAE,CAAC;IAEtB,OAAO,CAAC,GAAG,IAAkB,EAAE,EAAE;QAC/B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,OAAY,EACZ,IAAgD;IAEhD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts new file mode 100644 index 00000000..1465990a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts @@ -0,0 +1,2 @@ +export declare function isDefined(t: T | undefined | null | void): t is T; +//# sourceMappingURL=isDefined.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts.map new file mode 100644 index 00000000..5d4f31b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isDefined.d.ts","sourceRoot":"","sources":["../../../src/utils/isDefined.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAEnE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js new file mode 100644 index 00000000..afa3498b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js @@ -0,0 +1,4 @@ +export function isDefined(t) { + return t != null; +} +//# sourceMappingURL=isDefined.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js.map new file mode 100644 index 00000000..cd176c06 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/isDefined.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isDefined.js","sourceRoot":"","sources":["../../../src/utils/isDefined.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,CAA8B;IACzD,OAAO,CAAC,IAAI,IAAI,CAAC;AACnB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts new file mode 100644 index 00000000..b6df59d3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts @@ -0,0 +1,5 @@ +import type { GatewayGraphQLRequestContext } from '@apollo/server-gateway-interface'; +import type { ApolloServer, ApolloServerInternals } from '../ApolloServer'; +import type { BaseContext, GraphQLRequestContextExecutionDidStart } from '../externalTypes'; +export declare function makeGatewayGraphQLRequestContext(newRequestContext: GraphQLRequestContextExecutionDidStart, server: ApolloServer, internals: ApolloServerInternals): GatewayGraphQLRequestContext; +//# sourceMappingURL=makeGatewayGraphQLRequestContext.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts.map new file mode 100644 index 00000000..bc395b76 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"makeGatewayGraphQLRequestContext.d.ts","sourceRoot":"","sources":["../../../src/utils/makeGatewayGraphQLRequestContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,4BAA4B,EAG7B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EACV,WAAW,EACX,sCAAsC,EACvC,MAAM,kBAAkB,CAAC;AAyE1B,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,WAAW,EAC3E,iBAAiB,EAAE,sCAAsC,CAAC,QAAQ,CAAC,EACnE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GACzC,4BAA4B,CAqE9B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js new file mode 100644 index 00000000..2ae7a1b1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js @@ -0,0 +1,93 @@ +export function makeGatewayGraphQLRequestContext(newRequestContext, server, internals) { + const request = {}; + if ('query' in newRequestContext.request) { + request.query = newRequestContext.request.query; + } + if ('operationName' in newRequestContext.request) { + request.operationName = newRequestContext.request.operationName; + } + if ('variables' in newRequestContext.request) { + request.variables = newRequestContext.request.variables; + } + if ('extensions' in newRequestContext.request) { + request.extensions = newRequestContext.request.extensions; + } + if (newRequestContext.request.http) { + const newHttp = newRequestContext.request.http; + const needQuestion = newHttp.search !== '' && !newHttp.search.startsWith('?'); + request.http = { + method: newHttp.method, + url: `https://unknown-url.invalid/${needQuestion ? '?' : ''}${newHttp.search}`, + headers: new FetcherHeadersForHeaderMap(newHttp.headers), + }; + } + const response = { + http: { + headers: new FetcherHeadersForHeaderMap(newRequestContext.response.http.headers), + get status() { + return newRequestContext.response.http.status; + }, + set status(newStatus) { + newRequestContext.response.http.status = newStatus; + }, + }, + }; + return { + request, + response, + logger: server.logger, + schema: newRequestContext.schema, + schemaHash: 'schemaHash no longer exists since Apollo Server 4', + context: newRequestContext.contextValue, + cache: server.cache, + queryHash: newRequestContext.queryHash, + document: newRequestContext.document, + source: newRequestContext.source, + operationName: newRequestContext.operationName, + operation: newRequestContext.operation, + errors: newRequestContext.errors, + metrics: newRequestContext.metrics, + debug: internals.includeStacktraceInErrorResponses, + overallCachePolicy: newRequestContext.overallCachePolicy, + requestIsBatched: newRequestContext.requestIsBatched, + }; +} +class FetcherHeadersForHeaderMap { + map; + constructor(map) { + this.map = map; + } + append(name, value) { + if (this.map.has(name)) { + this.map.set(name, this.map.get(name) + ', ' + value); + } + else { + this.map.set(name, value); + } + } + delete(name) { + this.map.delete(name); + } + get(name) { + return this.map.get(name) ?? null; + } + has(name) { + return this.map.has(name); + } + set(name, value) { + this.map.set(name, value); + } + entries() { + return this.map.entries(); + } + keys() { + return this.map.keys(); + } + values() { + return this.map.values(); + } + [Symbol.iterator]() { + return this.map.entries(); + } +} +//# sourceMappingURL=makeGatewayGraphQLRequestContext.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js.map new file mode 100644 index 00000000..57d31f1d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/makeGatewayGraphQLRequestContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"makeGatewayGraphQLRequestContext.js","sourceRoot":"","sources":["../../../src/utils/makeGatewayGraphQLRequestContext.ts"],"names":[],"mappings":"AAoFA,MAAM,UAAU,gCAAgC,CAC9C,iBAAmE,EACnE,MAA8B,EAC9B,SAA0C;IAE1C,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,IAAI,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QACzC,OAAO,CAAC,KAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;IAClD,CAAC;IACD,IAAI,eAAe,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QACjD,OAAO,CAAC,aAAa,GAAG,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC;IAClE,CAAC;IACD,IAAI,WAAW,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QAC7C,OAAO,CAAC,SAAS,GAAG,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1D,CAAC;IACD,IAAI,YAAY,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;QAC9C,OAAO,C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AI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IACD,IAAI;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IAC3B,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts new file mode 100644 index 00000000..9b29413a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts @@ -0,0 +1,7 @@ +export type Resolvable = Promise & { + resolve: (t: T) => void; + reject: (e: any) => void; +}; +declare const _default: () => Resolvable; +export default _default; +//# sourceMappingURL=resolvable.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts.map new file mode 100644 index 00000000..b74c017a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolvable.d.ts","sourceRoot":"","sources":["../../../src/utils/resolvable.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG;IACvC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC1B,CAAC;yBAEc,CAAC,GAAG,IAAI,OAAK,UAAU,CAAC,CAAC,CAAC;AAA1C,wBAUE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js new file mode 100644 index 00000000..17e3ccfe --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js @@ -0,0 +1,12 @@ +export default () => { + let resolve; + let reject; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + promise.resolve = resolve; + promise.reject = reject; + return promise; +}; +//# sourceMappingURL=resolvable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js.map new file mode 100644 index 00000000..b60c5a35 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/resolvable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolvable.js","sourceRoot":"","sources":["../../../src/utils/resolvable.ts"],"names":[],"mappings":"AAmBA,eAAe,GAA4B,EAAE;IAC3C,IAAI,OAAyB,CAAC;IAC9B,IAAI,MAA0B,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;QACnD,OAAO,GAAG,QAAQ,CAAC;QACnB,MAAM,GAAG,OAAO,CAAC;IACnB,CAAC,CAAkB,CAAC;IACpB,OAAO,CAAC,OAAO,GAAG,OAAQ,CAAC;IAC3B,OAAO,CAAC,MAAM,GAAG,MAAO,CAAC;IACzB,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts new file mode 100644 index 00000000..2aa5dc9a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts @@ -0,0 +1,16 @@ +import { type GraphQLSchema } from 'graphql'; +import type { BaseContext } from '../externalTypes/index.js'; +export declare const symbolExecutionDispatcherWillResolveField: unique symbol; +export declare const symbolUserFieldResolver: unique symbol; +declare const symbolPluginsEnabled: unique symbol; +export declare function enablePluginsForSchemaResolvers(schema: GraphQLSchema & { + [symbolPluginsEnabled]?: boolean; +}): GraphQLSchema & { + [symbolPluginsEnabled]?: boolean; +}; +export declare function pluginsEnabledForSchemaResolvers(schema: GraphQLSchema & { + [symbolPluginsEnabled]?: boolean; +}): boolean; +export declare function whenResultIsFinished(result: any, callback: (err: Error | null, result?: any) => void): void; +export {}; +//# sourceMappingURL=schemaInstrumentation.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts.map new file mode 100644 index 00000000..c5ea8060 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/utils/schemaInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,WAAW,EAEZ,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,yCAAyC,eAErD,CAAC;AACF,eAAO,MAAM,uBAAuB,eAA0C,CAAC;AAC/E,QAAA,MAAM,oBAAoB,eAAuC,CAAC;AAElE,wBAAgB,+BAA+B,CAAC,QAAQ,SAAS,WAAW,EAC1E,MAAM,EAAE,aAAa,GAAG;IAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAA;CAAE;6BAAT,OAAO;EAuB3D;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,GAAG;IAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3D,OAAO,CAET;AA6DD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,QAmBpD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js new file mode 100644 index 00000000..152a5291 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js @@ -0,0 +1,69 @@ +import { getNamedType, GraphQLObjectType, defaultFieldResolver, } from 'graphql'; +export const symbolExecutionDispatcherWillResolveField = Symbol('apolloServerExecutionDispatcherWillResolveField'); +export const symbolUserFieldResolver = Symbol('apolloServerUserFieldResolver'); +const symbolPluginsEnabled = Symbol('apolloServerPluginsEnabled'); +export function enablePluginsForSchemaResolvers(schema) { + if (pluginsEnabledForSchemaResolvers(schema)) { + return schema; + } + Object.defineProperty(schema, symbolPluginsEnabled, { + value: true, + }); + const typeMap = schema.getTypeMap(); + Object.values(typeMap).forEach((type) => { + if (!getNamedType(type).name.startsWith('__') && + type instanceof GraphQLObjectType) { + const fields = type.getFields(); + Object.values(fields).forEach((field) => { + wrapField(field); + }); + } + }); + return schema; +} +export function pluginsEnabledForSchemaResolvers(schema) { + return !!schema[symbolPluginsEnabled]; +} +function wrapField(field) { + const originalFieldResolve = field.resolve; + field.resolve = (source, args, contextValue, info) => { + const willResolveField = contextValue?.[symbolExecutionDispatcherWillResolveField]; + const userFieldResolver = contextValue?.[symbolUserFieldResolver]; + const didResolveField = typeof willResolveField === 'function' && + willResolveField({ source, args, contextValue, info }); + const fieldResolver = originalFieldResolve || userFieldResolver || defaultFieldResolver; + try { + const result = fieldResolver(source, args, contextValue, info); + if (typeof didResolveField === 'function') { + whenResultIsFinished(result, didResolveField); + } + return result; + } + catch (error) { + if (typeof didResolveField === 'function') { + didResolveField(error); + } + throw error; + } + }; +} +function isPromise(x) { + return x && typeof x.then === 'function'; +} +export function whenResultIsFinished(result, callback) { + if (isPromise(result)) { + result.then((r) => whenResultIsFinished(r, callback), (err) => callback(err)); + } + else if (Array.isArray(result)) { + if (result.some(isPromise)) { + Promise.all(result).then((r) => callback(null, r), (err) => callback(err)); + } + else { + callback(null, result); + } + } + else { + callback(null, result); + } +} +//# sourceMappingURL=schemaInstrumentation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js.map new file mode 100644 index 00000000..f674da22 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaInstrumentation.js","sourceRoot":"","sources":["../../../src/utils/schemaInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EACZ,iBAAiB,EAEjB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAMjB,MAAM,CAAC,MAAM,yCAAyC,GAAG,MAAM,CAC7D,iDAAiD,CAClD,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAC/E,MAAM,oBAAoB,GAAG,MAAM,CAAC,4BAA4B,CAAC,CAAC;AAElE,MAAM,UAAU,+BAA+B,CAC7C,MAA4D;IAE5D,IAAI,gCAAgC,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,oBAAoB,EAAE;QAClD,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACtC,IACE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACzC,IAAI,YAAY,iBAAiB,EACjC,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACtC,SAAS,CAAW,KAAK,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,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AAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,IAAI,CACT,CAAC,CAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC7C,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAC9B,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CACtB,CAAC,CAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAC7B,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAC9B,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts new file mode 100644 index 00000000..8a5f0401 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts @@ -0,0 +1,31 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { GraphQLSchema } from 'graphql'; +import type { GatewayExecutor, GatewayInterface, GatewayUnsubscriber } from '@apollo/server-gateway-interface'; +import type { SchemaDerivedData } from '../ApolloServer.js'; +import type { ApolloConfig, GraphQLSchemaContext } from '../externalTypes/index.js'; +type SchemaDerivedDataProvider = (apiSchema: GraphQLSchema) => SchemaDerivedData; +export declare class SchemaManager { + private readonly logger; + private readonly schemaDerivedDataProvider; + private readonly onSchemaLoadOrUpdateListeners; + private isStopped; + private schemaDerivedData?; + private schemaContext?; + private readonly modeSpecificState; + constructor(options: ({ + gateway: GatewayInterface; + apolloConfig: ApolloConfig; + } | { + apiSchema: GraphQLSchema; + }) & { + logger: Logger; + schemaDerivedDataProvider: SchemaDerivedDataProvider; + }); + start(): Promise; + onSchemaLoadOrUpdate(callback: (schemaContext: GraphQLSchemaContext) => void): GatewayUnsubscriber; + getSchemaDerivedData(): SchemaDerivedData; + stop(): Promise; + private processSchemaLoadOrUpdateEvent; +} +export {}; +//# sourceMappingURL=schemaManager.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts.map new file mode 100644 index 00000000..53158c2e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaManager.d.ts","sourceRoot":"","sources":["../../../src/utils/schemaManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,KAAK,yBAAyB,GAAG,CAC/B,SAAS,EAAE,aAAa,KACrB,iBAAiB,CAAC;AAevB,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA4B;IACtE,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAE1C;IACJ,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,iBAAiB,CAAC,CAAoB;IAC9C,OAAO,CAAC,aAAa,CAAC,CAAuB;IAG7C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAW5B;gBAGJ,OAAO,EAAE,CACL;QAAE,OAAO,EAAE,gBAAgB,CAAC;QAAC,YAAY,EAAE,YAAY,CAAA;KAAE,GACzD;QAAE,SAAS,EAAE,aAAa,CAAA;KAAE,CAC/B,GAAG;QACF,MAAM,EAAE,MAAM,CAAC;QACf,yBAAyB,EAAE,yBAAyB,CAAC;KACtD;IA8BU,KAAK,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IA8C9C,oBAAoB,CACzB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,KAAK,IAAI,GACtD,mBAAmB;IA6Bf,oBAAoB,IAAI,iBAAiB;IAcnC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQlC,OAAO,CAAC,8BAA8B;CAqBvC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js new file mode 100644 index 00000000..75d6f736 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js @@ -0,0 +1,99 @@ +export class SchemaManager { + logger; + schemaDerivedDataProvider; + onSchemaLoadOrUpdateListeners = new Set(); + isStopped = false; + schemaDerivedData; + schemaContext; + modeSpecificState; + constructor(options) { + this.logger = options.logger; + this.schemaDerivedDataProvider = options.schemaDerivedDataProvider; + if ('gateway' in options) { + this.modeSpecificState = { + mode: 'gateway', + gateway: options.gateway, + apolloConfig: options.apolloConfig, + }; + } + else { + this.modeSpecificState = { + mode: 'schema', + apiSchema: options.apiSchema, + schemaDerivedData: options.schemaDerivedDataProvider(options.apiSchema), + }; + } + } + async start() { + if (this.modeSpecificState.mode === 'gateway') { + const gateway = this.modeSpecificState.gateway; + if (gateway.onSchemaLoadOrUpdate) { + this.modeSpecificState.unsubscribeFromGateway = + gateway.onSchemaLoadOrUpdate((schemaContext) => { + this.processSchemaLoadOrUpdateEvent(schemaContext); + }); + } + else { + throw new Error("Unexpectedly couldn't find onSchemaLoadOrUpdate on gateway"); + } + const config = await this.modeSpecificState.gateway.load({ + apollo: this.modeSpecificState.apolloConfig, + }); + return config.executor; + } + else { + this.processSchemaLoadOrUpdateEvent({ + apiSchema: this.modeSpecificState.apiSchema, + }, this.modeSpecificState.schemaDerivedData); + return null; + } + } + onSchemaLoadOrUpdate(callback) { + if (!this.schemaContext) { + throw new Error('You must call start() before onSchemaLoadOrUpdate()'); + } + if (!this.isStopped) { + try { + callback(this.schemaContext); + } + catch (e) { + throw new Error(`An error was thrown from an 'onSchemaLoadOrUpdate' listener: ${e.message}`); + } + } + this.onSchemaLoadOrUpdateListeners.add(callback); + return () => { + this.onSchemaLoadOrUpdateListeners.delete(callback); + }; + } + getSchemaDerivedData() { + if (!this.schemaDerivedData) { + throw new Error('You must call start() before getSchemaDerivedData()'); + } + return this.schemaDerivedData; + } + async stop() { + this.isStopped = true; + if (this.modeSpecificState.mode === 'gateway') { + this.modeSpecificState.unsubscribeFromGateway?.(); + await this.modeSpecificState.gateway.stop?.(); + } + } + processSchemaLoadOrUpdateEvent(schemaContext, schemaDerivedData) { + if (!this.isStopped) { + this.schemaDerivedData = + schemaDerivedData ?? + this.schemaDerivedDataProvider(schemaContext.apiSchema); + this.schemaContext = schemaContext; + this.onSchemaLoadOrUpdateListeners.forEach((listener) => { + try { + listener(schemaContext); + } + catch (e) { + this.logger.error("An error was thrown from an 'onSchemaLoadOrUpdate' listener"); + this.logger.error(e); + } + }); + } + } +} +//# sourceMappingURL=schemaManager.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js.map new file mode 100644 index 00000000..235eceea --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/schemaManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaManager.js","sourceRoot":"","sources":["../../../src/utils/schemaManager.ts"],"names":[],"mappings":"AA8BA,MAAM,OAAO,aAAa;IACP,MAAM,CAAS;IACf,yBAAyB,CAA4B;IACrD,6BAA6B,GAAG,IAAI,GAAG,EAErD,CAAC;IACI,SAAS,GAAG,KAAK,CAAC;IAClB,iBAAiB,CAAqB;IACtC,aAAa,CAAwB;IAG5B,iBAAiB,CAW5B;IAEN,YACE,OAMC;QAED,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;QACnE,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;YACzB,IAAI,CAAC,iBAAiB,GAAG;gBACvB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;aACnC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,iBAAiB,GAAG;gBACvB,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,OAAO,CAAC,SAAS;gBAI5B,iBAAiB,EAAE,OAAO,CAAC,yB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AAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts new file mode 100644 index 00000000..b05e9f69 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts @@ -0,0 +1,3 @@ +import type { Server } from 'http'; +export declare function urlForHttpServer(httpServer: Server): string; +//# sourceMappingURL=urlForHttpServer.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts.map new file mode 100644 index 00000000..e8c4fcfb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"urlForHttpServer.d.ts","sourceRoot":"","sources":["../../../src/utils/urlForHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB3D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js new file mode 100644 index 00000000..85ab2177 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js @@ -0,0 +1,12 @@ +import { format } from 'url'; +export function urlForHttpServer(httpServer) { + const { address, port } = httpServer.address(); + const hostname = address === '' || address === '::' ? 'localhost' : address; + return format({ + protocol: 'http', + hostname, + port, + pathname: '/', + }); +} +//# sourceMappingURL=urlForHttpServer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js.map new file mode 100644 index 00000000..d4aa823b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/utils/urlForHttpServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urlForHttpServer.js","sourceRoot":"","sources":["../../../src/utils/urlForHttpServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,OAAO,EAAiB,CAAC;IAO9D,MAAM,QAAQ,GAAG,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;IAE5E,OAAO,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM;QAChB,QAAQ;QACR,IAAI;QACJ,QAAQ,EAAE,GAAG;KACd,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts new file mode 100644 index 00000000..67c305d7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts @@ -0,0 +1,3 @@ +import { type ValidationRule } from 'graphql'; +export declare const NoIntrospection: ValidationRule; +//# sourceMappingURL=NoIntrospection.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts.map new file mode 100644 index 00000000..4497a57d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NoIntrospection.d.ts","sourceRoot":"","sources":["../../../src/validationRules/NoIntrospection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,eAAe,EAAE,cAmB5B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js new file mode 100644 index 00000000..a4902926 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js @@ -0,0 +1,15 @@ +import { GraphQLError, } from 'graphql'; +import { ApolloServerValidationErrorCode } from '../errors/index.js'; +export const NoIntrospection = (context) => ({ + Field(node) { + if (node.name.value === '__schema' || node.name.value === '__type') { + context.reportError(new GraphQLError('GraphQL introspection is not allowed by Apollo Server, but the query contained __schema or __type. To enable introspection, pass introspection: true to ApolloServer in production', { + nodes: [node], + extensions: { + validationErrorCode: ApolloServerValidationErrorCode.INTROSPECTION_DISABLED, + }, + })); + } + }, +}); +//# sourceMappingURL=NoIntrospection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js.map new file mode 100644 index 00000000..9e7470d6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/NoIntrospection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoIntrospection.js","sourceRoot":"","sources":["../../../src/validationRules/NoIntrospection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAGb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,CAAC,MAAM,eAAe,GAAmB,CAC7C,OAA0B,EAC1B,EAAE,CAAC,CAAC;IACJ,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACnE,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,oLAAoL,EACpL;gBACE,KAAK,EAAE,CAAC,IAAI,CAAC;gBACb,UAAU,EAAE;oBACV,mBAAmB,EACjB,+BAA+B,CAAC,sBAAsB;iBACzD;aACF,CACF,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts new file mode 100644 index 00000000..cfecc83d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts @@ -0,0 +1,4 @@ +import { type ValidationRule } from 'graphql'; +export declare const DEFAULT_MAX_RECURSIVE_SELECTIONS = 10000000; +export declare function createMaxRecursiveSelectionsRule(limit: number): ValidationRule; +//# sourceMappingURL=RecursiveSelectionsLimit.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts.map new file mode 100644 index 00000000..2279016c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RecursiveSelectionsLimit.d.ts","sourceRoot":"","sources":["../../../src/validationRules/RecursiveSelectionsLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,gCAAgC,WAAa,CAAC;AAoJ3D,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,GACZ,cAAc,CAuChB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js new file mode 100644 index 00000000..283bf63c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js @@ -0,0 +1,146 @@ +import { GraphQLError, } from 'graphql'; +import { ApolloServerValidationErrorCode } from '../errors/index.js'; +export const DEFAULT_MAX_RECURSIVE_SELECTIONS = 10_000_000; +class RecursiveSelectionValidationContext { + selectionCountLimit; + context; + fragmentInfo = new Map(); + operationInfo = new Map(); + currentFragment; + currentOperation; + fragmentRecursiveSelectionCount = new Map(); + constructor(selectionCountLimit, context) { + this.selectionCountLimit = selectionCountLimit; + this.context = context; + } + getExecutionDefinitionInfo() { + if (this.currentFragment !== undefined) { + let entry = this.fragmentInfo.get(this.currentFragment); + if (!entry) { + entry = { + selectionCount: 0, + fragmentSpreads: new Map(), + }; + this.fragmentInfo.set(this.currentFragment, entry); + } + return entry; + } + if (this.currentOperation !== undefined) { + let entry = this.operationInfo.get(this.currentOperation); + if (!entry) { + entry = { + selectionCount: 0, + fragmentSpreads: new Map(), + }; + this.operationInfo.set(this.currentOperation, entry); + } + return entry; + } + return undefined; + } + processSelection(fragmentSpreadName) { + const definitionInfo = this.getExecutionDefinitionInfo(); + if (!definitionInfo) { + return; + } + definitionInfo.selectionCount++; + if (fragmentSpreadName !== undefined) { + let spreadCount = (definitionInfo.fragmentSpreads.get(fragmentSpreadName) ?? 0) + 1; + definitionInfo.fragmentSpreads.set(fragmentSpreadName, spreadCount); + } + } + enterFragment(fragment) { + this.currentFragment = fragment; + } + leaveFragment() { + this.currentFragment = undefined; + } + enterOperation(operation) { + this.currentOperation = operation; + } + leaveOperation() { + this.currentOperation = undefined; + } + computeFragmentRecursiveSelectionsCount(fragment) { + const cachedCount = this.fragmentRecursiveSelectionCount.get(fragment); + if (cachedCount === null) { + return 0; + } + if (cachedCount !== undefined) { + return cachedCount; + } + this.fragmentRecursiveSelectionCount.set(fragment, null); + const definitionInfo = this.fragmentInfo.get(fragment); + let count = 0; + if (definitionInfo) { + count = definitionInfo.selectionCount; + for (const [fragment, spreadCount] of definitionInfo.fragmentSpreads) { + count += + spreadCount * this.computeFragmentRecursiveSelectionsCount(fragment); + } + } + this.fragmentRecursiveSelectionCount.set(fragment, count); + return count; + } + reportError(operation) { + const operationName = operation + ? `Operation "${operation}"` + : 'Anonymous operation'; + this.context.reportError(new GraphQLError(`${operationName} recursively requests too many selections.`, { + nodes: [], + extensions: { + validationErrorCode: ApolloServerValidationErrorCode.MAX_RECURSIVE_SELECTIONS_EXCEEDED, + }, + })); + } + checkLimitExceeded() { + for (const [operation, definitionInfo] of this.operationInfo) { + let count = definitionInfo.selectionCount; + for (const [fragment, spreadCount] of definitionInfo.fragmentSpreads) { + count += + spreadCount * this.computeFragmentRecursiveSelectionsCount(fragment); + } + if (count > this.selectionCountLimit) { + this.reportError(operation); + } + } + } +} +export function createMaxRecursiveSelectionsRule(limit) { + return (context) => { + const selectionContext = new RecursiveSelectionValidationContext(limit, context); + return { + Field() { + selectionContext.processSelection(); + }, + InlineFragment() { + selectionContext.processSelection(); + }, + FragmentSpread(node) { + selectionContext.processSelection(node.name.value); + }, + FragmentDefinition: { + enter(node) { + selectionContext.enterFragment(node.name.value); + }, + leave() { + selectionContext.leaveFragment(); + }, + }, + OperationDefinition: { + enter(node) { + selectionContext.enterOperation(node.name?.value ?? null); + }, + leave() { + selectionContext.leaveOperation(); + }, + }, + Document: { + leave() { + selectionContext.checkLimitExceeded(); + }, + }, + }; + }; +} +//# sourceMappingURL=RecursiveSelectionsLimit.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js.map new file mode 100644 index 00000000..e9363393 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/RecursiveSelectionsLimit.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RecursiveSelectionsLimit.js","sourceRoot":"","sources":["../../../src/validationRules/RecursiveSelectionsLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAIb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,CAAC,MAAM,gCAAgC,GAAG,UAAU,CAAC;AAO3D,MAAM,mCAAmC;IAWpB;IACA;IAXF,YAAY,GAC3B,IAAI,GAAG,EAAE,CAAC;IACK,aAAa,GAC5B,IAAI,GAAG,EAAE,CAAC;IACJ,eAAe,CAAU;IACzB,gBAAgB,CAAiB;IACxB,+BAA+B,GAC9C,IAAI,GAAG,EAAE,CAAC;IAEZ,YACmB,mBAA2B,EAC3B,OAA0B;QAD1B,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,YAAO,GAAP,OAAO,CAAmB;IAC1C,CAAC;IAEI,0BAA0B;QAChC,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YACvC,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACxD,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,KAAK,GAAG;oBACN,cAAc,EAAE,CAAC;oBACjB,eAAe,EAAE,IAAI,GAAG,EAAE;iBAC3B,CAAC;gBACF,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE,CA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AAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts new file mode 100644 index 00000000..ebf90217 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts @@ -0,0 +1,3 @@ +export { NoIntrospection } from './NoIntrospection.js'; +export { DEFAULT_MAX_RECURSIVE_SELECTIONS, createMaxRecursiveSelectionsRule, } from './RecursiveSelectionsLimit.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts.map new file mode 100644 index 00000000..dad3e167 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validationRules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,+BAA+B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js new file mode 100644 index 00000000..4f5b922c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js @@ -0,0 +1,3 @@ +export { NoIntrospection } from './NoIntrospection.js'; +export { DEFAULT_MAX_RECURSIVE_SELECTIONS, createMaxRecursiveSelectionsRule, } from './RecursiveSelectionsLimit.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js.map b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js.map new file mode 100644 index 00000000..b218ffe9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/dist/esm/validationRules/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validationRules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,+BAA+B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/errors/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/errors/package.json new file mode 100644 index 00000000..c5aa87a1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/errors/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/errors", + "type": "module", + "main": "../dist/cjs/errors/index.js", + "module": "../dist/esm/errors/index.js", + "types": "../dist/esm/errors/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/package.json new file mode 100644 index 00000000..ee3bb476 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/package.json @@ -0,0 +1,152 @@ +{ + "name": "@apollo/server", + "version": "5.5.1", + "description": "Core engine for Apollo GraphQL server", + "type": "module", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/esm/index.d.ts", + "exports": { + ".": { + "types": { + "require": "./dist/cjs/index.d.ts", + "default": "./dist/esm/index.d.ts" + }, + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + }, + "./errors": { + "types": { + "require": "./dist/cjs/errors/index.d.ts", + "default": "./dist/esm/errors/index.d.ts" + }, + "import": "./dist/esm/errors/index.js", + "require": "./dist/cjs/errors/index.js" + }, + "./standalone": { + "types": { + "require": "./dist/cjs/standalone/index.d.ts", + "default": "./dist/esm/standalone/index.d.ts" + }, + "import": "./dist/esm/standalone/index.js", + "require": "./dist/cjs/standalone/index.js" + }, + "./plugin/cacheControl": { + "types": { + "require": "./dist/cjs/plugin/cacheControl/index.d.ts", + "default": "./dist/esm/plugin/cacheControl/index.d.ts" + }, + "import": "./dist/esm/plugin/cacheControl/index.js", + "require": "./dist/cjs/plugin/cacheControl/index.js" + }, + "./plugin/disabled": { + "types": { + "require": "./dist/cjs/plugin/disabled/index.d.ts", + "default": "./dist/esm/plugin/disabled/index.d.ts" + }, + "import": "./dist/esm/plugin/disabled/index.js", + "require": "./dist/cjs/plugin/disabled/index.js" + }, + "./plugin/disableSuggestions": { + "types": { + "require": "./dist/cjs/plugin/disableSuggestions/index.d.ts", + "default": "./dist/esm/plugin/disableSuggestions/index.d.ts" + }, + "import": "./dist/esm/plugin/disableSuggestions/index.js", + "require": "./dist/cjs/plugin/disableSuggestions/index.js" + }, + "./plugin/drainHttpServer": { + "types": { + "require": "./dist/cjs/plugin/drainHttpServer/index.d.ts", + "default": "./dist/esm/plugin/drainHttpServer/index.d.ts" + }, + "import": "./dist/esm/plugin/drainHttpServer/index.js", + "require": "./dist/cjs/plugin/drainHttpServer/index.js" + }, + "./plugin/inlineTrace": { + "types": { + "require": "./dist/cjs/plugin/inlineTrace/index.d.ts", + "default": "./dist/esm/plugin/inlineTrace/index.d.ts" + }, + "import": "./dist/esm/plugin/inlineTrace/index.js", + "require": "./dist/cjs/plugin/inlineTrace/index.js" + }, + "./plugin/landingPage/default": { + "types": { + "require": "./dist/cjs/plugin/landingPage/default/index.d.ts", + "default": "./dist/esm/plugin/landingPage/default/index.d.ts" + }, + "import": "./dist/esm/plugin/landingPage/default/index.js", + "require": "./dist/cjs/plugin/landingPage/default/index.js" + }, + "./plugin/schemaReporting": { + "types": { + "require": "./dist/cjs/plugin/schemaReporting/index.d.ts", + "default": "./dist/esm/plugin/schemaReporting/index.d.ts" + }, + "import": "./dist/esm/plugin/schemaReporting/index.js", + "require": "./dist/cjs/plugin/schemaReporting/index.js" + }, + "./plugin/subscriptionCallback": { + "types": { + "require": "./dist/cjs/plugin/subscriptionCallback/index.d.ts", + "default": "./dist/esm/plugin/subscriptionCallback/index.d.ts" + }, + "import": "./dist/esm/plugin/subscriptionCallback/index.js", + "require": "./dist/cjs/plugin/subscriptionCallback/index.js" + }, + "./plugin/usageReporting": { + "types": { + "require": "./dist/cjs/plugin/usageReporting/index.d.ts", + "default": "./dist/esm/plugin/usageReporting/index.d.ts" + }, + "import": "./dist/esm/plugin/usageReporting/index.js", + "require": "./dist/cjs/plugin/usageReporting/index.js" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-server.git", + "directory": "packages/server" + }, + "keywords": [ + "GraphQL", + "Apollo", + "Server", + "Javascript" + ], + "author": "Apollo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/apollographql/apollo-server/issues" + }, + "homepage": "https://github.com/apollographql/apollo-server#readme", + "engines": { + "node": ">=20" + }, + "dependencies": { + "@apollo/cache-control-types": "^1.0.3", + "@apollo/server-gateway-interface": "^2.0.0", + "@apollo/usage-reporting-protobuf": "^4.1.1", + "@apollo/utils.createhash": "^3.0.0", + "@apollo/utils.fetcher": "^3.0.0", + "@apollo/utils.isnodelike": "^3.0.0", + "@apollo/utils.keyvaluecache": "^4.0.0", + "@apollo/utils.logger": "^3.0.0", + "@apollo/utils.usagereporting": "^2.1.0", + "@apollo/utils.withrequired": "^3.0.0", + "@graphql-tools/schema": "^10.0.0", + "async-retry": "^1.2.1", + "body-parser": "^2.2.2", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "finalhandler": "^2.1.0", + "loglevel": "^1.6.8", + "lru-cache": "^11.1.0", + "negotiator": "^1.0.0", + "whatwg-mimetype": "^4.0.0" + }, + "peerDependencies": { + "graphql": "^16.11.0" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/cacheControl/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/cacheControl/package.json new file mode 100644 index 00000000..c6d47168 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/cacheControl/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/cacheControl", + "type": "module", + "main": "../../dist/cjs/plugin/cacheControl/index.js", + "module": "../../dist/esm/plugin/cacheControl/index.js", + "types": "../../dist/esm/plugin/cacheControl/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disableSuggestions/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disableSuggestions/package.json new file mode 100644 index 00000000..e65b8675 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disableSuggestions/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/disableSuggestions", + "type": "module", + "main": "../../dist/cjs/plugin/disableSuggestions/index.js", + "module": "../../dist/esm/plugin/disableSuggestions/index.js", + "types": "../../dist/esm/plugin/disableSuggestions/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disabled/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disabled/package.json new file mode 100644 index 00000000..b0278cbf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/disabled/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/disabled", + "type": "module", + "main": "../../dist/cjs/plugin/disabled/index.js", + "module": "../../dist/esm/plugin/disabled/index.js", + "types": "../../dist/esm/plugin/disabled/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/drainHttpServer/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/drainHttpServer/package.json new file mode 100644 index 00000000..235ad232 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/drainHttpServer/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/drainHttpServer", + "type": "module", + "main": "../../dist/cjs/plugin/drainHttpServer/index.js", + "module": "../../dist/esm/plugin/drainHttpServer/index.js", + "types": "../../dist/esm/plugin/drainHttpServer/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/inlineTrace/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/inlineTrace/package.json new file mode 100644 index 00000000..c37a9044 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/inlineTrace/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/inlineTrace", + "type": "module", + "main": "../../dist/cjs/plugin/inlineTrace/index.js", + "module": "../../dist/esm/plugin/inlineTrace/index.js", + "types": "../../dist/esm/plugin/inlineTrace/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/landingPage/default/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/landingPage/default/package.json new file mode 100644 index 00000000..3a9a0584 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/landingPage/default/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/landingPage/default", + "type": "module", + "main": "../../../dist/cjs/plugin/landingPage/default/index.js", + "module": "../../../dist/esm/plugin/landingPage/default/index.js", + "types": "../../../dist/esm/plugin/landingPage/default/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/schemaReporting/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/schemaReporting/package.json new file mode 100644 index 00000000..6c79ec64 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/schemaReporting/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/schemaReporting", + "type": "module", + "main": "../../dist/cjs/plugin/schemaReporting/index.js", + "module": "../../dist/esm/plugin/schemaReporting/index.js", + "types": "../../dist/esm/plugin/schemaReporting/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/subscriptionCallback/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/subscriptionCallback/package.json new file mode 100644 index 00000000..7892a9c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/subscriptionCallback/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/subscriptionCallback", + "type": "module", + "main": "../../dist/cjs/plugin/subscriptionCallback/index.js", + "module": "../../dist/esm/plugin/subscriptionCallback/index.js", + "types": "../../dist/esm/plugin/subscriptionCallback/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/usageReporting/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/usageReporting/package.json new file mode 100644 index 00000000..7aae1e13 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/plugin/usageReporting/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/plugin/usageReporting", + "type": "module", + "main": "../../dist/cjs/plugin/usageReporting/index.js", + "module": "../../dist/esm/plugin/usageReporting/index.js", + "types": "../../dist/esm/plugin/usageReporting/index.d.ts", + "sideEffects": false +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/ApolloServer.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/ApolloServer.ts new file mode 100644 index 00000000..67859248 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/ApolloServer.ts @@ -0,0 +1,1456 @@ +import type { GatewayExecutor } from '@apollo/server-gateway-interface'; +import { isNodeLike } from '@apollo/utils.isnodelike'; +import { + InMemoryLRUCache, + PrefixingKeyValueCache, + type KeyValueCache, +} from '@apollo/utils.keyvaluecache'; +import type { Logger } from '@apollo/utils.logger'; +import type { WithRequired } from '@apollo/utils.withrequired'; +import { makeExecutableSchema } from '@graphql-tools/schema'; +import resolvable, { type Resolvable } from './utils/resolvable.js'; +import { + GraphQLError, + assertValidSchema, + print, + printSchema, + type validate, + type DocumentNode, + type ExecutionArgs, + type FormattedExecutionResult, + type GraphQLFieldResolver, + type GraphQLFormattedError, + type GraphQLSchema, + type ParseOptions, + type TypedQueryDocumentNode, + type ValidationRule, +} from 'graphql'; +import loglevel from 'loglevel'; +import Negotiator from 'negotiator'; +import { newCachePolicy } from './cachePolicy.js'; +import { determineApolloConfig } from './determineApolloConfig.js'; +import { + ensureError, + ensureGraphQLError, + normalizeAndFormatErrors, +} from './errorNormalize.js'; +import { ApolloServerErrorCode } from './errors/index.js'; +import type { ApolloServerOptionsWithStaticSchema } from './externalTypes/constructor.js'; +import type { + ExecuteOperationOptions, + LegacyExperimentalExecuteIncrementally, + VariableValues, +} from './externalTypes/graphql.js'; +import type { + ApolloConfig, + ApolloServerOptions, + ApolloServerPlugin, + BaseContext, + ContextThunk, + DocumentStore, + GraphQLRequest, + GraphQLRequestContext, + GraphQLResponse, + GraphQLServerContext, + GraphQLServerListener, + HTTPGraphQLHead, + HTTPGraphQLRequest, + HTTPGraphQLResponse, + LandingPage, + PersistedQueryOptions, +} from './externalTypes/index.js'; +import { runPotentiallyBatchedHttpQuery } from './httpBatching.js'; +import type { + GraphQLExperimentalIncrementalExecutionResultsAlpha2, + GraphQLExperimentalIncrementalExecutionResultsAlpha9, +} from './incrementalDeliveryPolyfill.js'; +import { pluginIsInternal, type InternalPluginId } from './internalPlugin.js'; +import { + preventCsrf, + recommendedCsrfPreventionRequestHeaders, +} from './preventCsrf.js'; +import { APQ_CACHE_PREFIX, processGraphQLRequest } from './requestPipeline.js'; +import { newHTTPGraphQLHead, prettyJSONStringify } from './runHttpQuery.js'; +import { HeaderMap } from './utils/HeaderMap.js'; +import { UnreachableCaseError } from './utils/UnreachableCaseError.js'; +import { computeCoreSchemaHash } from './utils/computeCoreSchemaHash.js'; +import { isDefined } from './utils/isDefined.js'; +import { SchemaManager } from './utils/schemaManager.js'; +import { + NoIntrospection, + createMaxRecursiveSelectionsRule, + DEFAULT_MAX_RECURSIVE_SELECTIONS, +} from './validationRules/index.js'; + +export type SchemaDerivedData = { + schema: GraphQLSchema; + // A store that, when enabled (default), will store the parsed and validated + // versions of operations in-memory, allowing subsequent parses/validates + // on the same operation to be executed immediately. + documentStore: DocumentStore | null; + // Prefix for keys in the DocumentStore if a custom one is provided (to + // separate the cache for different schema versions). This is vital to + // security so we do it explicitly so that + // PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation + // doesn't affect it. + documentStoreKeyPrefix: string; +}; + +type RunningServerState = { + schemaManager: SchemaManager; + landingPage: LandingPage | null; +}; + +type ServerState = + | { + phase: 'initialized'; + schemaManager: SchemaManager; + } + | { + phase: 'starting'; + barrier: Resolvable; + schemaManager: SchemaManager; + // This is set to true if you called + // startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests + // instead of start. The main purpose is that assertStarted allows you to + // still be in the starting phase if this is set. (This is the serverless + // use case.) + startedInBackground: boolean; + } + | { + phase: 'failed to start'; + error: Error; + } + | ({ + phase: 'started'; + drainServers: (() => Promise) | null; + toDispose: (() => Promise)[]; + toDisposeLast: (() => Promise)[]; + } & RunningServerState) + | ({ + phase: 'draining'; + barrier: Resolvable; + } & RunningServerState) + | { + phase: 'stopping'; + barrier: Resolvable; + } + | { + phase: 'stopped'; + stopError: Error | null; + }; + +export type ValidationOptions = NonNullable[3]>; + +export interface ApolloServerInternals { + state: ServerState; + gatewayExecutor: GatewayExecutor | null; + dangerouslyDisableValidation?: boolean; + formatError?: ( + formattedError: GraphQLFormattedError, + error: unknown, + ) => GraphQLFormattedError; + includeStacktraceInErrorResponses: boolean; + persistedQueries?: WithRequired; + nodeEnv: string; + allowBatchedHttpRequests: boolean; + apolloConfig: ApolloConfig; + plugins: ApolloServerPlugin[]; + parseOptions: ParseOptions; + validationOptions: ValidationOptions; + executionOptions?: ExecutionArgs['options']; + // `undefined` means we figure out what to do during _start (because + // the default depends on whether or not we used the background version + // of start). + stopOnTerminationSignals: boolean | undefined; + csrfPreventionRequestHeaders: string[] | null; + + rootValue?: ((parsedQuery: DocumentNode) => unknown) | unknown; + validationRules: Array; + laterValidationRules?: Array; + hideSchemaDetailsFromClientErrors: boolean; + fieldResolver?: GraphQLFieldResolver; + // TODO(AS6): remove this option. + status400ForVariableCoercionErrors?: boolean; + __testing_incrementalExecutionResults?: + | GraphQLExperimentalIncrementalExecutionResultsAlpha2 + | GraphQLExperimentalIncrementalExecutionResultsAlpha9; + stringifyResult: ( + value: FormattedExecutionResult, + ) => string | Promise; + legacyExperimentalExecuteIncrementally?: LegacyExperimentalExecuteIncrementally; +} + +function defaultLogger(): Logger { + const loglevelLogger = loglevel.getLogger('apollo-server'); + loglevelLogger.setLevel(loglevel.levels.INFO); + return loglevelLogger; +} + +// We really want to prevent this from being legal: +// +// const s: ApolloServer<{}> = +// new ApolloServer<{importantContextField: boolean}>({ ... }); +// s.executeOperation({query}, {contextValue: {}}); +// +// ie, if you declare an ApolloServer whose context values must be of a certain +// type, you can't assign it to a variable whose context values are less +// constrained and then pass in a context value missing important fields. +// +// We also want this to be illegal: +// +// const sBase = new ApolloServer<{}>({ ... }); +// const s: ApolloServer<{importantContextField: boolean}> = sBase; +// s.addPlugin({async requestDidStart({contextValue: {importantContextField}}) { ... }}) +// sBase.executeOperation({query}, {contextValue: {}}); +// +// so you shouldn't be able to assign an ApolloServer to a variable whose +// context values are more constrained, either. So we want to declare that +// ApolloServer is *invariant* in TContext, which we do with `in out` (a +// TypeScript 4.7 feature). +export class ApolloServer { + private internals: ApolloServerInternals; + + public readonly cache: KeyValueCache; + public readonly logger: Logger; + + constructor(config: ApolloServerOptions) { + const nodeEnv = config.nodeEnv ?? process.env.NODE_ENV ?? ''; + + this.logger = config.logger ?? defaultLogger(); + + const apolloConfig = determineApolloConfig(config.apollo, this.logger); + + const isDev = nodeEnv !== 'production'; + + if ( + config.cache && + config.cache !== 'bounded' && + PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(config.cache) + ) { + throw new Error( + 'You cannot pass a cache returned from ' + + '`PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation`' + + 'to `new ApolloServer({ cache })`, because Apollo Server may use it for ' + + 'multiple features whose cache keys must be distinct from each other.', + ); + } + + const state: ServerState = config.gateway + ? // ApolloServer has been initialized but we have not yet tried to load the + // schema from the gateway. That will wait until `start()` or + // `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests()` + // is called. (These may be called by other helpers; for example, + // `standaloneServer` calls `start` for you inside its `listen` method, + // and a serverless framework integration would call + // startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests + // for you.) + { + phase: 'initialized', + schemaManager: new SchemaManager({ + gateway: config.gateway, + apolloConfig, + schemaDerivedDataProvider: (schema) => + ApolloServer.generateSchemaDerivedData( + schema, + config.documentStore, + ), + logger: this.logger, + }), + } + : // We construct the schema synchronously so that we can fail fast if the + // schema can't be constructed. (This used to be more important because we + // used to have a 'schema' field that was publicly accessible immediately + // after construction, though that field never actually worked with + // gateways.) + { + phase: 'initialized', + schemaManager: new SchemaManager({ + apiSchema: ApolloServer.constructSchema(config), + schemaDerivedDataProvider: (schema) => + ApolloServer.generateSchemaDerivedData( + schema, + config.documentStore, + ), + logger: this.logger, + }), + }; + + const introspectionEnabled = config.introspection ?? isDev; + const hideSchemaDetailsFromClientErrors = + config.hideSchemaDetailsFromClientErrors ?? false; + + // We continue to allow 'bounded' for backwards-compatibility with the AS3.9 + // API. + this.cache = + config.cache === undefined || config.cache === 'bounded' + ? new InMemoryLRUCache() + : config.cache; + + // Check whether the recursive selections limit has been enabled (off by + // default), or whether a custom limit has been specified. + const maxRecursiveSelectionsRule = + config.maxRecursiveSelections === true + ? [createMaxRecursiveSelectionsRule(DEFAULT_MAX_RECURSIVE_SELECTIONS)] + : typeof config.maxRecursiveSelections === 'number' + ? [createMaxRecursiveSelectionsRule(config.maxRecursiveSelections)] + : []; + + // If the recursive selections rule has been enabled, then run configured + // validations in a later validate() pass. + const validationRules = [ + ...(introspectionEnabled ? [] : [NoIntrospection]), + ...maxRecursiveSelectionsRule, + ]; + let laterValidationRules; + if (maxRecursiveSelectionsRule.length > 0) { + laterValidationRules = config.validationRules; + } else { + validationRules.push(...(config.validationRules ?? [])); + } + + // Note that we avoid calling methods on `this` before `this.internals` is assigned + // (thus a bunch of things being static methods above). + this.internals = { + formatError: config.formatError, + rootValue: config.rootValue, + validationRules, + laterValidationRules, + hideSchemaDetailsFromClientErrors, + dangerouslyDisableValidation: + config.dangerouslyDisableValidation ?? false, + validationOptions: config.validationOptions ?? {}, + fieldResolver: config.fieldResolver, + includeStacktraceInErrorResponses: + config.includeStacktraceInErrorResponses ?? + (nodeEnv !== 'production' && nodeEnv !== 'test'), + persistedQueries: + config.persistedQueries === false + ? undefined + : { + ...config.persistedQueries, + cache: new PrefixingKeyValueCache( + config.persistedQueries?.cache ?? this.cache, + APQ_CACHE_PREFIX, + ), + }, + nodeEnv, + allowBatchedHttpRequests: config.allowBatchedHttpRequests ?? false, + apolloConfig, + // Note that more plugins can be added before `start()` with `addPlugin()` + // (eg, plugins that want to take this ApolloServer as an argument), and + // `start()` will call `addDefaultPlugins` to add default plugins. + plugins: config.plugins ?? [], + parseOptions: config.parseOptions ?? {}, + executionOptions: config.executionOptions ?? {}, + state, + stopOnTerminationSignals: config.stopOnTerminationSignals, + + gatewayExecutor: null, // set by _start + + csrfPreventionRequestHeaders: + config.csrfPrevention === true || config.csrfPrevention === undefined + ? recommendedCsrfPreventionRequestHeaders + : config.csrfPrevention === false + ? null + : (config.csrfPrevention.requestHeaders ?? + recommendedCsrfPreventionRequestHeaders), + status400ForVariableCoercionErrors: + config.status400ForVariableCoercionErrors ?? true, + __testing_incrementalExecutionResults: + config.__testing_incrementalExecutionResults, + stringifyResult: config.stringifyResult ?? prettyJSONStringify, + legacyExperimentalExecuteIncrementally: + config.legacyExperimentalExecuteIncrementally, + }; + + this.warnAgainstDeprecatedConfigOptions(config); + } + + private warnAgainstDeprecatedConfigOptions( + config: ApolloServerOptions, + ) { + // TODO(AS6): this option goes away altogether. We should either update or remove this warning. + if ('status400ForVariableCoercionErrors' in config) { + if (config.status400ForVariableCoercionErrors === true) { + this.logger.warn( + 'The `status400ForVariableCoercionErrors: true` configuration option is now the default behavior and has no effect in Apollo Server v5. You can safely remove this option from your configuration.', + ); + } else { + this.logger.warn( + 'The `status400ForVariableCoercionErrors: false` configuration option is deprecated and will be removed in Apollo Server v6. Apollo recommends removing any dependency on this behavior.', + ); + } + } + } + + // Awaiting a call to `start` ensures that a schema has been loaded and that + // all plugin `serverWillStart` hooks have been called. If either of these + // processes throw, `start` will (async) throw as well. + // + // If you're using `standaloneServer`, you don't need to call `start` yourself + // (in fact, it will throw if you do so); its `listen` method takes care of + // that for you. + // + // If instead you're using an integration package for a non-serverless + // framework (like Express), you must await a call to `start` immediately + // after creating your `ApolloServer`, before attaching it to your web + // framework and starting to accept requests. `start` should only be called + // once; if it throws and you'd like to retry, just create another + // `ApolloServer`. (Calling `start` was optional in Apollo Server 2, but in + // Apollo Server 3+ the functions like `expressMiddleware` use `assertStarted` + // to throw if `start` hasn't successfully completed.) + // + // Serverless integrations like Lambda do not support calling `start()`, + // because their lifecycle doesn't allow you to wait before assigning a + // handler or allowing the handler to be called. So they call + // `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests()` + // instead, and don't really differentiate between startup failures and + // request failures. This is hopefully appropriate for a "serverless" + // framework. Serverless startup failures result in returning a redacted error + // to the end user and logging the more detailed error. + public async start(): Promise { + return await this._start(false); + } + + public startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests(): void { + this._start(true).catch((e) => this.logStartupError(e)); + } + + private async _start(startedInBackground: boolean): Promise { + if (this.internals.state.phase !== 'initialized') { + // If we wanted we could make this error detectable and change + // `standaloneServer` to change the message to say not to call start() at + // all. + throw new Error( + `You should only call 'start()' or ` + + `'startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests()' ` + + `once on your ApolloServer.`, + ); + } + const schemaManager = this.internals.state.schemaManager; + const barrier = resolvable(); + this.internals.state = { + phase: 'starting', + barrier, + schemaManager, + startedInBackground, + }; + try { + // Now that you can't call addPlugin any more, add default plugins like + // usage reporting if they're not already added. + await this.addDefaultPlugins(); + + const toDispose: (() => Promise)[] = []; + const executor = await schemaManager.start(); + if (executor) { + this.internals.gatewayExecutor = executor; + } + toDispose.push(async () => { + await schemaManager.stop(); + }); + + const schemaDerivedData = schemaManager.getSchemaDerivedData(); + const service: GraphQLServerContext = { + logger: this.logger, + cache: this.cache, + schema: schemaDerivedData.schema, + apollo: this.internals.apolloConfig, + startedInBackground, + }; + + const taggedServerListeners = ( + await Promise.all( + this.internals.plugins.map(async (plugin) => ({ + serverListener: + plugin.serverWillStart && (await plugin.serverWillStart(service)), + installedImplicitly: + isImplicitlyInstallablePlugin(plugin) && + plugin.__internal_installed_implicitly__, + })), + ) + ).filter( + ( + maybeTaggedServerListener, + ): maybeTaggedServerListener is { + serverListener: GraphQLServerListener; + installedImplicitly: boolean; + } => typeof maybeTaggedServerListener.serverListener === 'object', + ); + + taggedServerListeners.forEach( + ({ serverListener: { schemaDidLoadOrUpdate } }) => { + if (schemaDidLoadOrUpdate) { + schemaManager.onSchemaLoadOrUpdate(schemaDidLoadOrUpdate); + } + }, + ); + + const serverWillStops = taggedServerListeners + .map((l) => l.serverListener.serverWillStop) + .filter(isDefined); + if (serverWillStops.length) { + toDispose.push(async () => { + await Promise.all( + serverWillStops.map((serverWillStop) => serverWillStop()), + ); + }); + } + + const drainServerCallbacks = taggedServerListeners + .map((l) => l.serverListener.drainServer) + .filter(isDefined); + const drainServers = drainServerCallbacks.length + ? async () => { + await Promise.all( + drainServerCallbacks.map((drainServer) => drainServer()), + ); + } + : null; + + // Find the renderLandingPage callback, if one is provided. If the user + // installed ApolloServerPluginLandingPageDisabled then there may be none + // found. On the other hand, if the user installed a landingPage plugin, + // then both the implicit installation of + // ApolloServerPluginLandingPage*Default and the other plugin will be + // found; we skip the implicit plugin. + let taggedServerListenersWithRenderLandingPage = + taggedServerListeners.filter((l) => l.serverListener.renderLandingPage); + if (taggedServerListenersWithRenderLandingPage.length > 1) { + taggedServerListenersWithRenderLandingPage = + taggedServerListenersWithRenderLandingPage.filter( + (l) => !l.installedImplicitly, + ); + } + let landingPage: LandingPage | null = null; + if (taggedServerListenersWithRenderLandingPage.length > 1) { + throw Error('Only one plugin can implement renderLandingPage.'); + } else if (taggedServerListenersWithRenderLandingPage.length) { + landingPage = + await taggedServerListenersWithRenderLandingPage[0].serverListener + .renderLandingPage!(); + } + + const toDisposeLast = this.maybeRegisterTerminationSignalHandlers( + ['SIGINT', 'SIGTERM'], + startedInBackground, + ); + + this.internals.state = { + phase: 'started', + schemaManager, + drainServers, + landingPage, + toDispose, + toDisposeLast, + }; + } catch (maybeError: unknown) { + const error = ensureError(maybeError); + + try { + await Promise.all( + this.internals.plugins.map(async (plugin) => + plugin.startupDidFail?.({ error }), + ), + ); + } catch (pluginError) { + this.logger.error(`startupDidFail hook threw: ${pluginError}`); + } + + this.internals.state = { + phase: 'failed to start', + error, + }; + throw error; + } finally { + barrier.resolve(); + } + } + + private maybeRegisterTerminationSignalHandlers( + signals: NodeJS.Signals[], + startedInBackground: boolean, + ): (() => Promise)[] { + const toDisposeLast: (() => Promise)[] = []; + + // We handle signals if it was explicitly requested + // (stopOnTerminationSignals === true), or if we're in Node, not in a test, + // not in a serverless framework (which we guess based on whether they + // called + // startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests), + // and it wasn't explicitly turned off. (We only actually register the + // signal handlers once we've successfully started up, because there's + // nothing to stop otherwise.) + if ( + this.internals.stopOnTerminationSignals === false || + (this.internals.stopOnTerminationSignals === undefined && + !( + isNodeLike && + this.internals.nodeEnv !== 'test' && + !startedInBackground + )) + ) { + return toDisposeLast; + } + + let receivedSignal = false; + const signalHandler: NodeJS.SignalsListener = async (signal) => { + if (receivedSignal) { + // If we receive another SIGINT or SIGTERM while we're waiting + // for the server to stop, just ignore it. + return; + } + receivedSignal = true; + try { + await this.stop(); + } catch (e) { + this.logger.error(`stop() threw during ${signal} shutdown`); + this.logger.error(e); + // Can't rely on the signal handlers being removed. + process.exit(1); + } + // Note: this.stop will call the toDisposeLast handlers below, so at + // this point this handler will have been removed and we can re-kill + // ourself to die with the appropriate signal exit status. this.stop + // takes care to call toDisposeLast last, so the signal handler isn't + // removed until after the rest of shutdown happens. + process.kill(process.pid, signal); + }; + + signals.forEach((signal) => { + process.on(signal, signalHandler); + toDisposeLast.push(async () => { + process.removeListener(signal, signalHandler); + }); + }); + return toDisposeLast; + } + + // This method is called at the beginning of each GraphQL request by + // `executeHTTPGraphQLRequest` and `executeOperation`. Most of its logic is + // only helpful if you started the server in the background (ie, for + // serverless frameworks): unless you're in a serverless framework, you should + // have called `await server.start()` before the server got to the point of + // running GraphQL requests (`assertStarted` calls in the framework + // integrations verify that) and so the only cases for non-serverless + // frameworks that this should hit are 'started', 'stopping', and 'stopped'. + // But if you started the server in the background (with + // startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests), this + // lets the server wait until fully started before serving operations. + private async _ensureStarted(): Promise { + while (true) { + switch (this.internals.state.phase) { + case 'initialized': + // This error probably won't happen: serverless framework integrations + // should call + // `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests` + // for you, and other frameworks call `assertStarted` before setting + // things up enough to make calling this function possible. + throw new Error( + 'You need to call `server.start()` before using your Apollo Server.', + ); + case 'starting': + await this.internals.state.barrier; + // continue the while loop + break; + case 'failed to start': + // First we log the error that prevented startup (which means it will + // get logged once for every GraphQL operation). + this.logStartupError(this.internals.state.error); + // Now make the operation itself fail. + // We intentionally do not re-throw actual startup error as it may contain + // implementation details and this error will propagate to the client. + throw new Error( + 'This data graph is missing a valid configuration. More details may be available in the server logs.', + ); + case 'started': + case 'draining': // We continue to run operations while draining. + return this.internals.state; + case 'stopping': + case 'stopped': + this.logger.warn( + 'A GraphQL operation was received during server shutdown. The ' + + 'operation will fail. Consider draining the HTTP server on shutdown; ' + + 'see https://go.apollo.dev/s/drain for details.', + ); + throw new Error( + `Cannot execute GraphQL operations ${ + this.internals.state.phase === 'stopping' + ? 'while the server is stopping' + : 'after the server has stopped' + }.'`, + ); + default: + throw new UnreachableCaseError(this.internals.state); + } + } + } + + // Framework integrations should call this to ensure that you've properly + // started your server before you get anywhere close to actually listening for + // incoming requests. + // + // There's a special case that if you called + // `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests` and + // it hasn't finished starting up yet, this works too. This is intended for + // cases like a serverless integration (say, Google Cloud Functions) that + // calls + // `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests` for + // you and then immediately sets up an integration based on another middleware + // like `expressMiddleware` which calls this function. We'd like this to be + // OK, but we still want normal Express users to start their ApolloServer + // before setting up their HTTP server unless they know what they are doing + // well enough to call the function with the long name themselves. + public assertStarted(expressionForError: string) { + if ( + this.internals.state.phase !== 'started' && + this.internals.state.phase !== 'draining' && + !( + this.internals.state.phase === 'starting' && + this.internals.state.startedInBackground + ) + ) { + throw new Error( + 'You must `await server.start()` before calling `' + + expressionForError + + '`', + ); + } + } + + // Given an error that occurred during Apollo Server startup, log it with a + // helpful message. This should happen when you call + // `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests` (ie, + // in serverless frameworks); with other frameworks, you must `await + // server.start()` which will throw the startup error directly instead of + // logging. This gets called both immediately when the startup error happens, + // and on all subsequent requests. + private logStartupError(err: Error) { + this.logger.error( + 'An error occurred during Apollo Server startup. All GraphQL requests ' + + 'will now fail. The startup error was: ' + + (err?.message || err), + ); + } + + private static constructSchema( + config: ApolloServerOptionsWithStaticSchema, + ): GraphQLSchema { + if (config.schema) { + return config.schema; + } + + const { typeDefs, resolvers } = config; + const augmentedTypeDefs = Array.isArray(typeDefs) ? typeDefs : [typeDefs]; + + // For convenience, we allow you to pass a few options that we pass through + // to a particular version of `@graphql-tools/schema`'s + // `makeExecutableSchema`. If you want to use more of this function's + // features or have more control over the version of the packages used, just + // call it yourself like `new ApolloServer({schema: + // makeExecutableSchema(...)})`. + return makeExecutableSchema({ + typeDefs: augmentedTypeDefs, + resolvers, + }); + } + + private static generateSchemaDerivedData( + schema: GraphQLSchema, + // null means don't use a documentStore at all. + // missing/undefined means use the default (creating a new one each + // time). + // defined means wrap this one in a random prefix for each new schema. + providedDocumentStore: DocumentStore | null | undefined, + ): SchemaDerivedData { + // Instead of waiting for the first operation execution against the schema + // to find out if it's a valid schema or not, check right now. In the + // non-gateway case, if this throws then the `new ApolloServer` call will + // throw. In the gateway case if this throws then it will log a message and + // just not update the schema (although oddly the message will claim that + // the schema is updating). + assertValidSchema(schema); + + return { + schema, + // The DocumentStore is schema-derived because we put documents in it + // after checking that they pass GraphQL validation against the schema and + // use this to skip validation as well as parsing. So we can't reuse the + // same DocumentStore for different schemas because that might make us + // treat invalid operations as valid. If we're using the default + // DocumentStore, then we just create it from scratch each time we get a + // new schema. If we're using a user-provided DocumentStore, then we use + // the schema hash as a prefix. + documentStore: + providedDocumentStore === undefined + ? new InMemoryLRUCache() + : providedDocumentStore, + documentStoreKeyPrefix: providedDocumentStore + ? `${computeCoreSchemaHash(printSchema(schema))}:` + : '', + }; + } + + public async stop() { + switch (this.internals.state.phase) { + case 'initialized': + case 'starting': + case 'failed to start': + throw Error( + 'apolloServer.stop() should only be called after `await apolloServer.start()` has succeeded', + ); + + // Calling stop more than once should have the same result as the first time. + case 'stopped': + if (this.internals.state.stopError) { + throw this.internals.state.stopError; + } + return; + + // Two parallel calls to stop; just wait for the other one to finish and + // do whatever it did. + case 'stopping': + case 'draining': { + await this.internals.state.barrier; + // The cast here is because TS doesn't understand that this.state can + // change during the await + // (https://github.com/microsoft/TypeScript/issues/9998). + const state = this.internals.state as ServerState; + if (state.phase !== 'stopped') { + throw Error(`Surprising post-stopping state ${state.phase}`); + } + if (state.stopError) { + throw state.stopError; + } + return; + } + + case 'started': + // This is handled by the rest of the function. + break; + + default: + throw new UnreachableCaseError(this.internals.state); + } + + const barrier = resolvable(); + + const { + schemaManager, + drainServers, + landingPage, + toDispose, + toDisposeLast, + } = this.internals.state; + + // Commit to stopping and start draining servers. + this.internals.state = { + phase: 'draining', + barrier, + schemaManager, + landingPage, + }; + + try { + await drainServers?.(); + + // Servers are drained. Prevent further operations from starting and call + // stop handlers. + this.internals.state = { phase: 'stopping', barrier }; + + // We run shutdown handlers in two phases because we don't want to turn + // off our signal listeners (ie, allow signals to kill the process) until + // we've done the important parts of shutdown like running serverWillStop + // handlers. (We can make this more generic later if it's helpful.) + await Promise.all([...toDispose].map((dispose) => dispose())); + await Promise.all([...toDisposeLast].map((dispose) => dispose())); + } catch (stopError) { + this.internals.state = { + phase: 'stopped', + stopError: stopError as Error, + }; + barrier.resolve(); + throw stopError; + } + this.internals.state = { phase: 'stopped', stopError: null }; + } + + private async addDefaultPlugins() { + const { + plugins, + apolloConfig, + nodeEnv, + hideSchemaDetailsFromClientErrors, + } = this.internals; + const isDev = nodeEnv !== 'production'; + + const alreadyHavePluginWithInternalId = (id: InternalPluginId) => + plugins.some( + (p) => pluginIsInternal(p) && p.__internal_plugin_id__ === id, + ); + + // Make sure we're not trying to explicitly enable and disable the same + // feature. (Be careful: we are not trying to stop people from installing + // the same plugin twice if they have a use case for it, like two usage + // reporting plugins for different variants.) + // + // Note that this check doesn't work for the landing page plugin, because + // users can write their own landing page plugins and we don't know if a + // given plugin is a landing page plugin until the server has started. + const pluginsByInternalID = new Map< + InternalPluginId, + { sawDisabled: boolean; sawNonDisabled: boolean } + >(); + for (const p of plugins) { + if (pluginIsInternal(p)) { + const id = p.__internal_plugin_id__; + if (!pluginsByInternalID.has(id)) { + pluginsByInternalID.set(id, { + sawDisabled: false, + sawNonDisabled: false, + }); + } + const seen = pluginsByInternalID.get(id)!; + if (p.__is_disabled_plugin__) { + seen.sawDisabled = true; + } else { + seen.sawNonDisabled = true; + } + + if (seen.sawDisabled && seen.sawNonDisabled) { + throw new Error( + `You have tried to install both ApolloServerPlugin${id} and ` + + `ApolloServerPlugin${id}Disabled in your server. Please choose ` + + `whether or not you want to disable the feature and install the ` + + `appropriate plugin for your use case.`, + ); + } + } + } + + // Special case: cache control is on unless you explicitly disable it. + { + if (!alreadyHavePluginWithInternalId('CacheControl')) { + const { ApolloServerPluginCacheControl } = await import( + './plugin/cacheControl/index.js' + ); + plugins.push(ApolloServerPluginCacheControl()); + } + } + + // Special case: usage reporting is on by default (and first!) if you + // configure an API key. + { + const alreadyHavePlugin = + alreadyHavePluginWithInternalId('UsageReporting'); + if (!alreadyHavePlugin && apolloConfig.key) { + if (apolloConfig.graphRef) { + // Keep this plugin first so it wraps everything. (Unfortunately despite + // the fact that the person who wrote this line also was the original + // author of the comment above in #1105, they don't quite understand why this was important.) + const { ApolloServerPluginUsageReporting } = await import( + './plugin/usageReporting/index.js' + ); + plugins.unshift( + ApolloServerPluginUsageReporting({ + __onlyIfSchemaIsNotSubgraph: true, + }), + ); + } else { + this.logger.warn( + 'You have specified an Apollo key but have not specified a graph ref; usage ' + + 'reporting is disabled. To enable usage reporting, set the `APOLLO_GRAPH_REF` ' + + 'environment variable to `your-graph-id@your-graph-variant`. To disable this ' + + 'warning, install `ApolloServerPluginUsageReportingDisabled`.', + ); + } + } + } + + // Special case: schema reporting can be turned on via environment variable. + { + const alreadyHavePlugin = + alreadyHavePluginWithInternalId('SchemaReporting'); + const enabledViaEnvVar = process.env.APOLLO_SCHEMA_REPORTING === 'true'; + if (!alreadyHavePlugin && enabledViaEnvVar) { + if (apolloConfig.key) { + const { ApolloServerPluginSchemaReporting } = await import( + './plugin/schemaReporting/index.js' + ); + plugins.push(ApolloServerPluginSchemaReporting()); + } else { + throw new Error( + "You've enabled schema reporting by setting the APOLLO_SCHEMA_REPORTING " + + 'environment variable to true, but you also need to provide your ' + + 'Apollo API key, via the APOLLO_KEY environment ' + + 'variable or via `new ApolloServer({apollo: {key})', + ); + } + } + } + + // Special case: inline tracing is on by default for federated schemas. + { + const alreadyHavePlugin = alreadyHavePluginWithInternalId('InlineTrace'); + if (!alreadyHavePlugin) { + // If we haven't explicitly disabled inline tracing via + // ApolloServerPluginInlineTraceDisabled or explicitly installed our own + // ApolloServerPluginInlineTrace, we set up inline tracing in "only if + // federated" mode. (This is slightly different than the + // pre-ApolloServerPluginInlineTrace where we would also avoid doing + // this if an API key was configured and log a warning.) + const { ApolloServerPluginInlineTrace } = await import( + './plugin/inlineTrace/index.js' + ); + plugins.push( + ApolloServerPluginInlineTrace({ __onlyIfSchemaIsSubgraph: true }), + ); + } + } + + // Special case: If we're not in production, show our default landing page. + // + // This works a bit differently from the other implicitly installed plugins, + // which rely entirely on the __internal_plugin_id__ to decide whether the + // plugin takes effect. That's because we want third-party plugins to be + // able to provide a landing page that overrides the default landing page, + // without them having to know about __internal_plugin_id__. So unless we + // actively disable the default landing page with + // ApolloServerPluginLandingPageDisabled, we install the default landing + // page, but with a special flag that _start() uses to ignore it if some + // other plugin defines a renderLandingPage callback. (We can't just look + // now to see if the plugin defines renderLandingPage because we haven't run + // serverWillStart yet.) + const alreadyHavePlugin = alreadyHavePluginWithInternalId( + 'LandingPageDisabled', + ); + if (!alreadyHavePlugin) { + const { + ApolloServerPluginLandingPageLocalDefault, + ApolloServerPluginLandingPageProductionDefault, + } = await import('./plugin/landingPage/default/index.js'); + const plugin: ApolloServerPlugin = isDev + ? ApolloServerPluginLandingPageLocalDefault() + : ApolloServerPluginLandingPageProductionDefault(); + if (!isImplicitlyInstallablePlugin(plugin)) { + throw Error( + 'default landing page plugin should be implicitly installable?', + ); + } + plugin.__internal_installed_implicitly__ = true; + plugins.push(plugin); + } + + { + const alreadyHavePlugin = + alreadyHavePluginWithInternalId('DisableSuggestions'); + if (hideSchemaDetailsFromClientErrors && !alreadyHavePlugin) { + const { ApolloServerPluginDisableSuggestions } = await import( + './plugin/disableSuggestions/index.js' + ); + plugins.push(ApolloServerPluginDisableSuggestions()); + } + } + } + + public addPlugin(plugin: ApolloServerPlugin) { + if (this.internals.state.phase !== 'initialized') { + throw new Error("Can't add plugins after the server has started"); + } + this.internals.plugins.push(plugin); + } + + public async executeHTTPGraphQLRequest({ + httpGraphQLRequest, + context, + }: { + httpGraphQLRequest: HTTPGraphQLRequest; + context: ContextThunk; + }): Promise { + try { + let runningServerState; + try { + runningServerState = await this._ensureStarted(); + } catch (error: unknown) { + // This is typically either the masked error from when background startup + // failed, or related to invoking this function before startup or + // during/after shutdown (due to lack of draining). + return await this.errorResponse(error, httpGraphQLRequest); + } + + if ( + runningServerState.landingPage && + this.prefersHTML(httpGraphQLRequest) + ) { + let renderedHtml; + if (typeof runningServerState.landingPage.html === 'string') { + renderedHtml = runningServerState.landingPage.html; + } else { + try { + renderedHtml = await runningServerState.landingPage.html(); + } catch (maybeError: unknown) { + const error = ensureError(maybeError); + this.logger.error(`Landing page \`html\` function threw: ${error}`); + return await this.errorResponse(error, httpGraphQLRequest); + } + } + + return { + headers: new HeaderMap([['content-type', 'text/html']]), + body: { + kind: 'complete', + string: renderedHtml, + }, + }; + } + + // If enabled, check to ensure that this request was preflighted before doing + // anything real (such as running the context function). + if (this.internals.csrfPreventionRequestHeaders) { + preventCsrf( + httpGraphQLRequest.headers, + this.internals.csrfPreventionRequestHeaders, + ); + } + + let contextValue: TContext; + try { + contextValue = await context(); + } catch (maybeError: unknown) { + const error = ensureError(maybeError); + try { + await Promise.all( + this.internals.plugins.map(async (plugin) => + plugin.contextCreationDidFail?.({ + error, + }), + ), + ); + } catch (pluginError) { + this.logger.error( + `contextCreationDidFail hook threw: ${pluginError}`, + ); + } + + // If some random function threw, add a helpful prefix when converting + // to GraphQLError. If it was already a GraphQLError, trust that the + // message was chosen thoughtfully and leave off the prefix. + return await this.errorResponse( + ensureGraphQLError(error, 'Context creation failed: '), + httpGraphQLRequest, + ); + } + + return await runPotentiallyBatchedHttpQuery( + this, + httpGraphQLRequest, + contextValue, + runningServerState.schemaManager.getSchemaDerivedData(), + this.internals, + ); + } catch (maybeError_: unknown) { + const maybeError = maybeError_; // fixes inference because catch vars are not const + if ( + maybeError instanceof GraphQLError && + maybeError.extensions.code === ApolloServerErrorCode.BAD_REQUEST + ) { + try { + await Promise.all( + this.internals.plugins.map(async (plugin) => + plugin.invalidRequestWasReceived?.({ error: maybeError }), + ), + ); + } catch (pluginError) { + this.logger.error( + `invalidRequestWasReceived hook threw: ${pluginError}`, + ); + } + } + return await this.errorResponse(maybeError, httpGraphQLRequest); + } + } + + private async errorResponse( + error: unknown, + requestHead: HTTPGraphQLHead, + ): Promise { + const { formattedErrors, httpFromErrors } = normalizeAndFormatErrors( + [error], + { + includeStacktraceInErrorResponses: + this.internals.includeStacktraceInErrorResponses, + formatError: this.internals.formatError, + }, + ); + + return { + status: httpFromErrors.status ?? 500, + headers: new HeaderMap([ + ...httpFromErrors.headers, + [ + 'content-type', + // Note that we may change the default to + // 'application/graphql-response+json' by 2025 as encouraged by the + // graphql-over-http spec. It's maybe a bit bad for us to provide + // an application/json response if they send `accept: foo/bar`, + // but we're already providing some sort of bad request error, and + // it's probably more useful for them to fix the other error before + // they deal with the `accept` header. + chooseContentTypeForSingleResultResponse(requestHead) ?? + MEDIA_TYPES.APPLICATION_JSON, + ], + ]), + body: { + kind: 'complete', + string: await this.internals.stringifyResult({ + errors: formattedErrors, + }), + }, + }; + } + + private prefersHTML(request: HTTPGraphQLRequest): boolean { + const acceptHeader = request.headers.get('accept'); + return ( + request.method === 'GET' && + !!acceptHeader && + new Negotiator({ + headers: { accept: acceptHeader }, + }).mediaType([ + // We need it to actively prefer text/html over less browser-y types; + // eg, `accept: */*' should still go for JSON. Negotiator does tiebreak + // by the order in the list we provide, so we put text/html last. + MEDIA_TYPES.APPLICATION_JSON, + MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + MEDIA_TYPES.MULTIPART_MIXED_NO_DEFER_SPEC, + MEDIA_TYPES.TEXT_HTML, + ]) === MEDIA_TYPES.TEXT_HTML + ); + } + + /** + * This method is primarily meant for testing: it allows you to execute a + * GraphQL operation via the request pipeline without going through the HTTP + * layer. Note that this means that any handling you do in your server at the + * HTTP level will not affect this call! + * + * For convenience, you can provide `request.query` either as a string or a + * DocumentNode, in case you choose to use the gql tag in your tests. This is + * just a convenience, not an optimization (we convert provided ASTs back into + * string). + * + * The second object is an optional options object which includes the optional + * `contextValue` object available in resolvers. + * + * You may specify the TData and TVariables generic types when calling this + * method; Apollo Server does not validate that the returned data actually + * matches the structure of TData. (Typically these types are created by a + * code generation tool.) Note that this does not enforce that `variables` is + * provided at all, just that it has the right type if provided. + */ + public async executeOperation< + TData = Record, + TVariables extends VariableValues = VariableValues, + >( + this: ApolloServer, + request: Omit, 'query'> & { + query?: string | DocumentNode | TypedQueryDocumentNode; + }, + ): Promise>; + public async executeOperation< + TData = Record, + TVariables extends VariableValues = VariableValues, + >( + request: Omit, 'query'> & { + query?: string | DocumentNode | TypedQueryDocumentNode; + }, + options?: ExecuteOperationOptions, + ): Promise>; + + async executeOperation< + TData = Record, + TVariables extends VariableValues = VariableValues, + >( + request: Omit, 'query'> & { + // We should consider supporting TypedDocumentNode from + // `@graphql-typed-document-node/core` as well, as it is more popular than + // the newer built-in type. + query?: string | DocumentNode | TypedQueryDocumentNode; + }, + options: ExecuteOperationOptions = {}, + ): Promise> { + // Since this function is mostly for testing, you don't need to explicitly + // start your server before calling it. (That also means you can use it with + // `apollo-server` which doesn't support `start()`.) + if (this.internals.state.phase === 'initialized') { + await this.start(); + } + + const schemaDerivedData = ( + await this._ensureStarted() + ).schemaManager.getSchemaDerivedData(); + + // For convenience, this function lets you pass either a string or an AST, + // but we normalize to string. + const graphQLRequest: GraphQLRequest = { + ...request, + query: + request.query && typeof request.query !== 'string' + ? print(request.query) + : request.query, + }; + + const response: GraphQLResponse = await internalExecuteOperation( + { + server: this, + graphQLRequest, + internals: this.internals, + schemaDerivedData, + sharedResponseHTTPGraphQLHead: null, + }, + options, + ); + + // It's your job to set an appropriate TData (perhaps using codegen); we + // don't validate it. + return response as GraphQLResponse; + } +} + +// Shared code between runHttpQuery (ie executeHTTPGraphQLRequest) and +// executeOperation to set up a request context and invoke the request pipeline. +export async function internalExecuteOperation( + { + server, + graphQLRequest, + internals, + schemaDerivedData, + sharedResponseHTTPGraphQLHead, + }: { + server: ApolloServer; + graphQLRequest: GraphQLRequest; + internals: ApolloServerInternals; + schemaDerivedData: SchemaDerivedData; + sharedResponseHTTPGraphQLHead: HTTPGraphQLHead | null; + }, + options: ExecuteOperationOptions, +): Promise { + const requestContext: GraphQLRequestContext = { + logger: server.logger, + cache: server.cache, + schema: schemaDerivedData.schema, + request: graphQLRequest, + response: { + http: sharedResponseHTTPGraphQLHead ?? newHTTPGraphQLHead(), + }, + // We clone the context because there are some assumptions that every operation + // execution has a brand new context object; specifically, in order to implement + // willResolveField we put a Symbol on the context that is specific to a particular + // request pipeline execution. We could avoid this if we had a better way of + // instrumenting execution. + // + // We don't want to do a deep clone here, because one of the main advantages of + // using batched HTTP requests is to share context across operations for a + // single request. + // + // The typecast here is safe, because the only way `contextValue` can be + // null-ish is if we used the `contextValue?: BaseContext` override, in + // which case TContext is BaseContext and {} is ok. (This does depend on + // the fact we've hackily forced the class to be contravariant in + // TContext.) + contextValue: cloneObject(options?.contextValue ?? ({} as TContext)), + metrics: {}, + overallCachePolicy: newCachePolicy(), + requestIsBatched: sharedResponseHTTPGraphQLHead !== null, + }; + + try { + return await processGraphQLRequest( + schemaDerivedData, + server, + internals, + requestContext, + ); + } catch (maybeError: unknown) { + // processGraphQLRequest throwing usually means that either there's a bug in + // Apollo Server or some plugin hook threw unexpectedly. + const error = ensureError(maybeError); + // If *these* hooks throw then we'll still get a 500 but won't mask its + // error. + await Promise.all( + internals.plugins.map(async (plugin) => + plugin.unexpectedErrorProcessingRequest?.({ + requestContext, + error, + }), + ), + ); + // Mask unexpected error externally. + server.logger.error(`Unexpected error processing request: ${error}`); + throw new Error('Internal server error'); + } +} + +// Unlike InternalPlugins (where we can decide whether to install the default +// plugin based on looking at which plugins are installed), +// ImplicitlyInstallablePlugins (ie the default landing page plugin) can't +// determine if they're needed until later in startup. Specifically, we can't +// know if we've defined our own landing page until after serverWillStart +// plugins have run. +export type ImplicitlyInstallablePlugin = + ApolloServerPlugin & { + __internal_installed_implicitly__: boolean; + }; + +export function isImplicitlyInstallablePlugin( + p: ApolloServerPlugin, +): p is ImplicitlyInstallablePlugin { + return '__internal_installed_implicitly__' in p; +} + +export const MEDIA_TYPES = { + APPLICATION_JSON: 'application/json; charset=utf-8', + APPLICATION_JSON_GRAPHQL_CALLBACK: + 'application/json; callbackSpec=1.0; charset=utf-8', + APPLICATION_GRAPHQL_RESPONSE_JSON: + 'application/graphql-response+json; charset=utf-8', + // We do *not* currently support this content-type; we will once incremental + // delivery is part of the official GraphQL spec. + MULTIPART_MIXED_NO_DEFER_SPEC: 'multipart/mixed', + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2: 'multipart/mixed; deferSpec=20220824', + // This references the spec stored at + // https://specs.apollo.dev/incremental/v0.2/ + MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9: 'multipart/mixed; incrementalSpec=v0.2', + TEXT_HTML: 'text/html', +}; + +export function chooseContentTypeForSingleResultResponse( + head: HTTPGraphQLHead, +): string | null { + const acceptHeader = head.headers.get('accept'); + if (!acceptHeader) { + // Note that we may change the default to + // 'application/graphql-response+json' by 2025 as encouraged by the + // graphql-over-http spec. + return MEDIA_TYPES.APPLICATION_JSON; + } else { + const preferred = new Negotiator({ + headers: { accept: head.headers.get('accept') }, + }).mediaType([ + MEDIA_TYPES.APPLICATION_JSON, + MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON, + MEDIA_TYPES.APPLICATION_JSON_GRAPHQL_CALLBACK, + ]); + if (preferred) { + return preferred; + } else { + return null; + } + } +} + +function cloneObject(object: T): T { + return Object.assign(Object.create(Object.getPrototypeOf(object)), object); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/cachePolicy.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/cachePolicy.ts new file mode 100644 index 00000000..ac889951 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/cachePolicy.ts @@ -0,0 +1,33 @@ +import type { CacheHint, CachePolicy } from '@apollo/cache-control-types'; + +export function newCachePolicy(): CachePolicy { + return { + maxAge: undefined, + scope: undefined, + restrict(hint: CacheHint) { + if ( + hint.maxAge !== undefined && + (this.maxAge === undefined || hint.maxAge < this.maxAge) + ) { + this.maxAge = hint.maxAge; + } + if (hint.scope !== undefined && this.scope !== 'PRIVATE') { + this.scope = hint.scope; + } + }, + replace(hint: CacheHint) { + if (hint.maxAge !== undefined) { + this.maxAge = hint.maxAge; + } + if (hint.scope !== undefined) { + this.scope = hint.scope; + } + }, + policyIfCacheable() { + if (this.maxAge === undefined || this.maxAge === 0) { + return null; + } + return { maxAge: this.maxAge, scope: this.scope ?? 'PUBLIC' }; + }, + }; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/determineApolloConfig.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/determineApolloConfig.ts new file mode 100644 index 00000000..20a91a53 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/determineApolloConfig.ts @@ -0,0 +1,95 @@ +import { createHash } from '@apollo/utils.createhash'; +import type { ApolloConfig, ApolloConfigInput } from './externalTypes/index.js'; +import type { Logger } from '@apollo/utils.logger'; + +// This function combines the `apollo` constructor argument and some environment +// variables to come up with a full ApolloConfig. +export function determineApolloConfig( + input: ApolloConfigInput | undefined, + logger: Logger, +): ApolloConfig { + const apolloConfig: ApolloConfig = {}; + + const { + APOLLO_KEY, + APOLLO_GRAPH_REF, + APOLLO_GRAPH_ID, + APOLLO_GRAPH_VARIANT, + } = process.env; + + // Determine key. + if (input?.key) { + apolloConfig.key = input.key.trim(); + } else if (APOLLO_KEY) { + apolloConfig.key = APOLLO_KEY.trim(); + } + if ((input?.key ?? APOLLO_KEY) !== apolloConfig.key) { + logger.warn( + 'The provided API key has unexpected leading or trailing whitespace. ' + + 'Apollo Server will trim the key value before use.', + ); + } + + // Assert API key is a valid header value, since it's going to be used as one + // throughout. + if (apolloConfig.key) { + assertValidHeaderValue(apolloConfig.key); + } + + // Determine key hash. + if (apolloConfig.key) { + apolloConfig.keyHash = createHash('sha512') + .update(apolloConfig.key) + .digest('hex'); + } + + // Determine graph ref, if provided together. + if (input?.graphRef) { + apolloConfig.graphRef = input.graphRef; + } else if (APOLLO_GRAPH_REF) { + apolloConfig.graphRef = APOLLO_GRAPH_REF; + } + + // See if graph ID and variant were provided separately. + const graphId = input?.graphId ?? APOLLO_GRAPH_ID; + const graphVariant = input?.graphVariant ?? APOLLO_GRAPH_VARIANT; + + if (apolloConfig.graphRef) { + if (graphId) { + throw new Error( + 'Cannot specify both graph ref and graph ID. Please use ' + + '`apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph ID.', + ); + } + if (graphVariant) { + throw new Error( + 'Cannot specify both graph ref and graph variant. Please use ' + + '`apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph variant.', + ); + } + } else if (graphId) { + // Graph ref is not specified, but the ID is. We can construct the ref + // from the ID and variant. Note that after this, we stop tracking the ID + // and variant, because Apollo Server 3 does not assume that all graph refs + // can be decomposed into ID and variant (except in the op reg plugin). + apolloConfig.graphRef = graphVariant + ? `${graphId}@${graphVariant}` + : graphId; + } + + return apolloConfig; +} + +function assertValidHeaderValue(value: string) { + // Ref: node-fetch@2.x `Headers` validation + // https://github.com/node-fetch/node-fetch/blob/9b9d45881e5ca68757077726b3c0ecf8fdca1f29/src/headers.js#L18 + const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/g; + if (invalidHeaderCharRegex.test(value)) { + const invalidChars = value.match(invalidHeaderCharRegex)!; + throw new Error( + `The API key provided to Apollo Server contains characters which are invalid as HTTP header values. The following characters found in the key are invalid: ${invalidChars.join( + ', ', + )}. Valid header values may only contain ASCII visible characters. If you think there is an issue with your key, please contact Apollo support.`, + ); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errorNormalize.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errorNormalize.ts new file mode 100644 index 00000000..55efdde1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errorNormalize.ts @@ -0,0 +1,114 @@ +// The functions in this file are not part of Apollo Server's external API. + +import { + GraphQLError, + type GraphQLErrorExtensions, + type GraphQLFormattedError, +} from 'graphql'; +import { ApolloServerErrorCode } from './errors/index.js'; +import type { HTTPGraphQLHead } from './externalTypes/http.js'; +import { mergeHTTPGraphQLHead, newHTTPGraphQLHead } from './runHttpQuery.js'; +import { HeaderMap } from './utils/HeaderMap.js'; + +// This function accepts any value that were thrown and convert it to GraphQLFormattedError. +// It also add default extensions.code and copy stack trace onto an extension if requested. +// Additionally, it returns an `HTTPGraphQLHead` created from combining the values of any +// `HTTPGraphqlHead` objects found on `extensions.http` (the behavior when multiple errors +// set a status code or set the same header should be treated as undefined); these extensions +// are removed from the formatted error. +// +// This function should not throw. +export function normalizeAndFormatErrors( + errors: ReadonlyArray, + options: { + formatError?: ( + formattedError: GraphQLFormattedError, + error: unknown, + ) => GraphQLFormattedError; + includeStacktraceInErrorResponses?: boolean; + } = {}, +): { + formattedErrors: Array; + httpFromErrors: HTTPGraphQLHead; +} { + const formatError = options.formatError ?? ((error) => error); + const httpFromErrors = newHTTPGraphQLHead(); + + return { + httpFromErrors, + formattedErrors: errors.map((error) => { + try { + return formatError(enrichError(error), error); + } catch (formattingError) { + if (options.includeStacktraceInErrorResponses) { + // includeStacktraceInErrorResponses is used in development + // so it will be helpful to show errors thrown by formatError hooks in that mode + return enrichError(formattingError); + } else { + // obscure error + return { + message: 'Internal server error', + extensions: { code: ApolloServerErrorCode.INTERNAL_SERVER_ERROR }, + }; + } + } + }), + }; + + function enrichError(maybeError: unknown): GraphQLFormattedError { + const graphqlError = ensureGraphQLError(maybeError); + + const extensions: GraphQLErrorExtensions = { + ...graphqlError.extensions, + code: + graphqlError.extensions.code ?? + ApolloServerErrorCode.INTERNAL_SERVER_ERROR, + }; + + if (isPartialHTTPGraphQLHead(extensions.http)) { + mergeHTTPGraphQLHead(httpFromErrors, { + headers: new HeaderMap(), + ...extensions.http, + }); + delete extensions.http; + } + + if (options.includeStacktraceInErrorResponses) { + // Note that if ensureGraphQLError created graphqlError from an + // originalError, graphqlError.stack will be the same as + // originalError.stack due to some special code in the GraphQLError + // constructor. + extensions.stacktrace = graphqlError.stack?.split('\n'); + } + + return { ...graphqlError.toJSON(), extensions }; + } +} + +export function ensureError(maybeError: unknown): Error { + return maybeError instanceof Error + ? maybeError + : new GraphQLError('Unexpected error value: ' + String(maybeError)); +} + +export function ensureGraphQLError( + maybeError: unknown, + messagePrefixIfNotGraphQLError: string = '', +): GraphQLError { + const error: Error = ensureError(maybeError); + + return error instanceof GraphQLError + ? error + : new GraphQLError(messagePrefixIfNotGraphQLError + error.message, { + originalError: error, + }); +} + +function isPartialHTTPGraphQLHead(x: unknown): x is Partial { + return ( + !!x && + typeof x === 'object' && + (!('status' in x) || typeof (x as any).status === 'number') && + (!('headers' in x) || (x as any).headers instanceof Map) + ); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errors/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errors/index.ts new file mode 100644 index 00000000..3fecc5e7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/errors/index.ts @@ -0,0 +1,33 @@ +import { GraphQLError } from 'graphql'; + +export enum ApolloServerErrorCode { + INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR', + GRAPHQL_PARSE_FAILED = 'GRAPHQL_PARSE_FAILED', + GRAPHQL_VALIDATION_FAILED = 'GRAPHQL_VALIDATION_FAILED', + PERSISTED_QUERY_NOT_FOUND = 'PERSISTED_QUERY_NOT_FOUND', + PERSISTED_QUERY_NOT_SUPPORTED = 'PERSISTED_QUERY_NOT_SUPPORTED', + BAD_USER_INPUT = 'BAD_USER_INPUT', + OPERATION_RESOLUTION_FAILURE = 'OPERATION_RESOLUTION_FAILURE', + BAD_REQUEST = 'BAD_REQUEST', +} + +export enum ApolloServerValidationErrorCode { + INTROSPECTION_DISABLED = 'INTROSPECTION_DISABLED', + MAX_RECURSIVE_SELECTIONS_EXCEEDED = 'MAX_RECURSIVE_SELECTIONS_EXCEEDED', +} + +/** + * unwrapResolverError is a useful helper function for `formatError` hooks. + * Errors thrown in resolvers are wrapped by graphql-js in a GraphQLError that + * adds context such as the `path` to the field in the operation. If you'd like + * to look directly at the original error thrown in the resolver (with whatever + * data is on that error object, but without fields like `path`), you can use + * this function. Note that other GraphQLErrors that contain `originalError` + * (like parse errors) are not unwrapped by this function. + */ +export function unwrapResolverError(error: unknown): unknown { + if (error instanceof GraphQLError && error.path && error.originalError) { + return error.originalError; + } + return error; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/constructor.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/constructor.ts new file mode 100644 index 00000000..541692e9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/constructor.ts @@ -0,0 +1,174 @@ +/** + * This file consists of types used to define the arguments to the ApolloServer + * constructor. The top-level and likely most interesting type exported from + * here is `ApolloServerOptions` which is used to define the input object to the + * `ApolloServer` constructor. + */ +import type { Logger } from '@apollo/utils.logger'; +import type { IExecutableSchemaDefinition } from '@graphql-tools/schema'; +import type { + DocumentNode, + ExecutionArgs, + FormattedExecutionResult, + GraphQLFieldResolver, + GraphQLFormattedError, + GraphQLSchema, + ParseOptions, + ValidationRule, +} from 'graphql'; +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { GatewayInterface } from '@apollo/server-gateway-interface'; +import type { ApolloServerPlugin } from './plugins.js'; +import type { + BaseContext, + LegacyExperimentalExecuteIncrementally, +} from './index.js'; +import type { + GraphQLExperimentalIncrementalExecutionResultsAlpha2, + GraphQLExperimentalIncrementalExecutionResultsAlpha9, +} from '../incrementalDeliveryPolyfill.js'; +import type { ValidationOptions } from '../ApolloServer.js'; + +export type DocumentStore = KeyValueCache; + +// Configuration for how Apollo Server talks to the Apollo registry, as passed +// to the ApolloServer constructor. Each field can also be provided as an +// environment variable. +export interface ApolloConfigInput { + // Your Apollo API key. Environment variable: APOLLO_KEY. + key?: string; + // The graph ref for your graph, eg `my-graph@my-variant` or `my-graph` to use + // your graph's default variant. Environment variable: APOLLO_GRAPH_REF. For + // backwards compatibility, may alternatively specify the ref as graphId and + // graphVariant separately. + graphRef?: string; + // The graph ID of your graph, eg `my-graph`. Environment variable: + // APOLLO_GRAPH_ID. + graphId?: string; + // Your graph's variant name, eg `my-variant`. Environment variable: + // APOLLO_GRAPH_VARIANT. + graphVariant?: string; +} + +// some defaults filled in from the ApolloConfigInput passed to the constructor. +export interface ApolloConfig { + key?: string; + keyHash?: string; + graphRef?: string; +} + +export interface PersistedQueryOptions { + cache?: KeyValueCache; + /** + * Specified in **seconds**, this time-to-live (TTL) value limits the lifespan + * of how long the persisted query should be cached. To specify a desired + * lifespan of "infinite", set this to `null`, in which case the eviction will + * be determined by the cache's eviction policy, but the record will never + * simply expire. + */ + ttl?: number | null; +} + +export interface CSRFPreventionOptions { + // CSRF prevention works by only processing operations from requests whose + // structure indicates that if they were sent by a web browser, then the + // browser would have had to send a preflight OPTIONS request already. We do + // this by specifying some headers that a browser will never automatically set + // and which will trigger the browser to preflight. Apollo Server will reject + // any operation that does not set at least one of these headers *and* does + // not set a content-type (to a header whose parsed type is not + // application/x-www-form-urlencoded, multipart/form-data, or text/plain). If + // CSRF prevention is enabled (eg, with `csrfPrevention: true`) this list + // defaults to ['x-apollo-operation-name', 'apollo-require-preflight']. This + // will allow POST operations from any client and GET operations from Apollo + // Client Web, Apollo iOS, and Apollo Kotlin. + requestHeaders?: string[]; +} + +interface ApolloServerOptionsBase { + formatError?: ( + formattedError: GraphQLFormattedError, + error: unknown, + ) => GraphQLFormattedError; + rootValue?: ((parsedQuery: DocumentNode) => unknown) | unknown; + validationRules?: Array; + fieldResolver?: GraphQLFieldResolver; + cache?: KeyValueCache | 'bounded'; + includeStacktraceInErrorResponses?: boolean; + logger?: Logger; + allowBatchedHttpRequests?: boolean; + stringifyResult?: ( + value: FormattedExecutionResult, + ) => string | Promise; + introspection?: boolean; + maxRecursiveSelections?: boolean | number; + hideSchemaDetailsFromClientErrors?: boolean; + plugins?: ApolloServerPlugin[]; + persistedQueries?: PersistedQueryOptions | false; + stopOnTerminationSignals?: boolean; + apollo?: ApolloConfigInput; + nodeEnv?: string; + documentStore?: DocumentStore | null; + dangerouslyDisableValidation?: boolean; + validationOptions?: ValidationOptions; + csrfPrevention?: CSRFPreventionOptions | boolean; + + // Used for parsing operations; unlike in AS3, this is not also used for + // parsing the schema. + parseOptions?: ParseOptions; + + executionOptions?: ExecutionArgs['options']; + + // TODO(AS6): remove this option. Configuration to `true` is default behavior + // and configuration to `false` is deprecated. If you depend on `false` + // behavior, we recommend migrating away from that at your earliest + // convenience since it won't be supported in the next major version. + /** + * @deprecated `true` is now the default behavior in AS5. `false` will not be + * supported in AS6 since this option will be removed. + */ + status400ForVariableCoercionErrors?: boolean; + + legacyExperimentalExecuteIncrementally?: LegacyExperimentalExecuteIncrementally; + + // For testing only. + __testing_incrementalExecutionResults?: + | GraphQLExperimentalIncrementalExecutionResultsAlpha2 + | GraphQLExperimentalIncrementalExecutionResultsAlpha9; +} + +export interface ApolloServerOptionsWithGateway + extends ApolloServerOptionsBase { + gateway: GatewayInterface; + schema?: undefined; + typeDefs?: undefined; + resolvers?: undefined; +} + +export interface ApolloServerOptionsWithSchema + extends ApolloServerOptionsBase { + schema: GraphQLSchema; + gateway?: undefined; + typeDefs?: undefined; + resolvers?: undefined; +} + +export interface ApolloServerOptionsWithTypeDefs + extends ApolloServerOptionsBase { + // These two options are always only passed directly through to + // makeExecutableSchema. (If you don't want to use makeExecutableSchema, pass + // `schema` instead.) + typeDefs: IExecutableSchemaDefinition['typeDefs']; + resolvers?: IExecutableSchemaDefinition['resolvers']; + gateway?: undefined; + schema?: undefined; +} + +// Used internally in ApolloServer.ts but not publicly exported. +export type ApolloServerOptionsWithStaticSchema = + | ApolloServerOptionsWithSchema + | ApolloServerOptionsWithTypeDefs; + +export type ApolloServerOptions = + | ApolloServerOptionsWithGateway + | ApolloServerOptionsWithStaticSchema; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/context.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/context.ts new file mode 100644 index 00000000..6842c333 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/context.ts @@ -0,0 +1,18 @@ +// The default `contextValue` is an empty object. Generics related to the +// context type of `ApolloServer` should `extends BasedContext` as we do +// throughout this repository. +export type BaseContext = {}; + +// Integration authors should use this type for typing their own user-provided +// context function. See `@as-integrations/express5` for a usage example. +export type ContextFunction< + TIntegrationSpecificArgs extends any[], + TContext extends BaseContext = BaseContext, +> = (...integrationContext: TIntegrationSpecificArgs) => Promise; + +// This is used in `executeHTTPGraphQLRequest` so that that function can apply +// consistent error handling if it throws. Web framework integrations typically +// pass a function which passes integration-specific parameters to a +// user-provided `ContextFunction`. +export type ContextThunk = + () => Promise; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/graphql.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/graphql.ts new file mode 100644 index 00000000..f8a35503 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/graphql.ts @@ -0,0 +1,81 @@ +/** + * This file exports types related specifically to GraphQL execution, most + * notably `GraphQLRequest` and `GraphQLResponse`, used most heavily by + * `executeHTTPGraphQLRequest` and `executeOperation`. The + * `responseForOperation` plugin hook also returns a `GraphQLResponse`. + */ +import type { + ExecutionArgs, + ExecutionResult, + FormattedExecutionResult, +} from 'graphql'; +import type { BaseContext } from './context.js'; +import type { HTTPGraphQLHead, HTTPGraphQLRequest } from './http.js'; +import type { WithRequired } from '@apollo/utils.withrequired'; +import type { + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, +} from './incrementalDeliveryPolyfillAlpha2.js'; +import type { + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, +} from './incrementalDeliveryPolyfillAlpha9.js'; +import { type GraphQLExperimentalIncrementalExecutionResultsAlpha2 } from '../incrementalDeliveryPolyfill.js'; + +export interface GraphQLRequest< + TVariables extends VariableValues = VariableValues, +> { + query?: string; + operationName?: string; + variables?: TVariables; + extensions?: Record; + http?: HTTPGraphQLRequest; +} + +export type VariableValues = { [name: string]: any }; + +// A GraphQL response can either be a single result, or an initial result +// followed by a stream of subsequent results. The latter occurs when the +// GraphQL operation uses incremental delivery directives such as `@defer` or +// `@stream`. Note that incremental delivery currently requires using a +// pre-release of graphql-js v17. +export type GraphQLResponseBody> = + | { + kind: 'single'; + singleResult: FormattedExecutionResult; + } + | { + kind: 'incremental'; + initialResult: GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2; + subsequentResults: AsyncIterable; + } + | { + kind: 'incremental'; + initialResult: GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9; + subsequentResults: AsyncIterable; + }; + +export type GraphQLInProgressResponse> = { + http: HTTPGraphQLHead; + body?: GraphQLResponseBody; +}; + +export type GraphQLResponse> = WithRequired< + GraphQLInProgressResponse, + 'body' +>; +export interface ExecuteOperationOptions { + contextValue?: TContext; +} + +type PromiseOrValue = Promise | T; + +export type LegacyExperimentalExecuteIncrementally< + TData = Record, + TExtensions = Record, +> = ( + args: ExecutionArgs, +) => PromiseOrValue< + | ExecutionResult + | GraphQLExperimentalIncrementalExecutionResultsAlpha2 +>; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/http.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/http.ts new file mode 100644 index 00000000..2157603c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/http.ts @@ -0,0 +1,44 @@ +/** + * This file exports types related to GraphQL execution with respect to HTTP. + * These types define the inputs and outputs for `executeHTTPGraphQLRequest` and + * are most interesting for integration authors. + */ +import type { HeaderMap } from '../utils/HeaderMap.js'; + +export interface HTTPGraphQLRequest { + // capitalized (GET, POST, etc) + method: string; + // lowercase header name, multiple headers joined with ', ' like Headers.get + // does + headers: HeaderMap; + /** + * The part of the URL after the question mark (not including the #fragment), + * or the empty string if there is no question mark. Including the question + * mark in this string is allowed but not required. Do not %-decode this + * string. You can get this from a standard Node request with + * `url.parse(request.url).search ?? ''`. + */ + search: string; + // read by your body-parser or whatever. we poke at it to make it into + // the right real type. + body: unknown; +} + +export interface HTTPGraphQLHead { + status?: number; + headers: HeaderMap; +} + +/** + * Here we use `string`s for the response body since the response can be either + * HTML (for the landing page - see `executeHTTPGraphQLRequest`) or JSON (for a + * GraphQL response). Based on `headers` and `method` on the request, we know + * how to correctly interpret the response body. + */ +export type HTTPGraphQLResponseBody = + | { kind: 'complete'; string: string } + | { kind: 'chunked'; asyncIterator: AsyncIterableIterator }; + +export type HTTPGraphQLResponse = HTTPGraphQLHead & { + body: HTTPGraphQLResponseBody; +}; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts new file mode 100644 index 00000000..c5b6c1cb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts @@ -0,0 +1,63 @@ +import type { FormattedExecutionResult, GraphQLFormattedError } from 'graphql'; + +// This file defines types used in our public interface that will be imported +// from `graphql-js` once graphql 17 is released. It is possible that these +// types will change slightly before the final v17 is released, in which case +// the relevant parts of our API may change incompatibly in a minor version of +// AS5; this should not affect any users who aren't explicitly installing +// pre-releases of graphql 17. + +interface ObjMap { + [key: string]: T; +} + +export interface GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> extends FormattedExecutionResult { + hasNext: boolean; + incremental?: ReadonlyArray< + GraphQLExperimentalFormattedIncrementalResultAlpha2 + >; + extensions?: TExtensions; +} + +export interface GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> { + hasNext: boolean; + incremental?: ReadonlyArray< + GraphQLExperimentalFormattedIncrementalResultAlpha2 + >; + extensions?: TExtensions; +} + +export type GraphQLExperimentalFormattedIncrementalResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> = + | GraphQLExperimentalFormattedIncrementalDeferResultAlpha2 + | GraphQLExperimentalFormattedIncrementalStreamResultAlpha2< + TData, + TExtensions + >; + +export interface GraphQLExperimentalFormattedIncrementalDeferResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> extends FormattedExecutionResult { + path?: ReadonlyArray; + label?: string; +} + +export interface GraphQLExperimentalFormattedIncrementalStreamResultAlpha2< + TData = Array, + TExtensions = ObjMap, +> { + errors?: ReadonlyArray; + items?: TData | null; + path?: ReadonlyArray; + label?: string; + extensions?: TExtensions; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts new file mode 100644 index 00000000..37effbff --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts @@ -0,0 +1,82 @@ +import type { FormattedExecutionResult, GraphQLFormattedError } from 'graphql'; + +// This file defines types used in our public interface that will be imported +// from `graphql-js` once graphql 17 is released. It is possible that these +// types will change slightly before the final v17 is released, in which case +// the relevant parts of our API may change incompatibly in a minor version of +// AS5; this should not affect any users who aren't explicitly installing +// pre-releases of graphql 17. + +interface ObjMap { + [key: string]: T; +} + +export interface GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9< + TData = ObjMap, + TExtensions = ObjMap, +> extends FormattedExecutionResult { + data: TData; + pending: ReadonlyArray; + hasNext: boolean; + extensions?: TExtensions; +} + +export interface GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9< + TData = ObjMap, + TExtensions = ObjMap, +> { + hasNext: boolean; + pending?: ReadonlyArray; + incremental?: ReadonlyArray< + GraphQLExperimentalFormattedIncrementalResultAlpha9 + >; + completed?: ReadonlyArray; + extensions?: TExtensions; +} + +export type GraphQLExperimentalFormattedIncrementalResultAlpha9< + TData = ObjMap, + TExtensions = ObjMap, +> = + | GraphQLExperimentalFormattedIncrementalDeferResultAlpha9 + | GraphQLExperimentalFormattedIncrementalStreamResultAlpha9< + TData, + TExtensions + >; + +export interface GraphQLExperimentalFormattedIncrementalDeferResultAlpha9< + TData = ObjMap, + TExtensions = ObjMap, +> { + errors?: ReadonlyArray; + data: TData; + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} + +export interface GraphQLExperimentalFormattedIncrementalStreamResultAlpha9< + TData = Array, + TExtensions = ObjMap, +> { + errors?: ReadonlyArray; + items: TData; + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} + +export interface GraphQLExperimentalPendingResultAlpha9 { + id: string; + path: ReadonlyArray; + label?: string; +} + +// Deviation. The type implemented in alpha.9 is wrong. The type below is the +// correct type implementation. We may or may not need to provide a patch. +// +// This has been fixed by https://github.com/graphql/graphql-js/pull/4481 +export interface GraphQLExperimentalFormattedCompletedResultAlpha9 { + id: string; + errors?: ReadonlyArray; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/index.ts new file mode 100644 index 00000000..664b7622 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/index.ts @@ -0,0 +1,73 @@ +/** + * This file represents the external type definitions needed by end users, + * integration implementors, and plugin implementors. Everything from this file + * is re-exported by the root (via * export), so add exports to this file with + * intention (it's public API). + */ +export type { BaseContext, ContextFunction, ContextThunk } from './context.js'; +export type { + GraphQLRequest, + GraphQLResponse, + LegacyExperimentalExecuteIncrementally, +} from './graphql.js'; +export type { + HTTPGraphQLRequest, + HTTPGraphQLResponse, + HTTPGraphQLHead, +} from './http.js'; +export type { + ApolloServerPlugin, + GraphQLFieldResolverParams, + GraphQLRequestExecutionListener, + GraphQLRequestListener, + GraphQLRequestListenerDidResolveField, + GraphQLRequestListenerExecutionDidEnd, + GraphQLRequestListenerParsingDidEnd, + GraphQLRequestListenerValidationDidEnd, + GraphQLSchemaContext, + GraphQLServerListener, + GraphQLServerContext, + LandingPage, +} from './plugins.js'; +export type { + GraphQLRequestContext, + GraphQLRequestMetrics, + GraphQLRequestContextDidEncounterErrors, + GraphQLRequestContextDidResolveOperation, + GraphQLRequestContextDidResolveSource, + GraphQLRequestContextExecutionDidStart, + GraphQLRequestContextParsingDidStart, + GraphQLRequestContextResponseForOperation, + GraphQLRequestContextValidationDidStart, + GraphQLRequestContextWillSendResponse, +} from './requestPipeline.js'; +export type { + DocumentStore, + ApolloConfigInput, + ApolloConfig, + PersistedQueryOptions, + CSRFPreventionOptions, + ApolloServerOptionsWithSchema, + ApolloServerOptionsWithTypeDefs, + ApolloServerOptionsWithStaticSchema, + ApolloServerOptionsWithGateway, + ApolloServerOptions, +} from './constructor.js'; + +export type { + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, + GraphQLExperimentalFormattedIncrementalResultAlpha2, + GraphQLExperimentalFormattedIncrementalDeferResultAlpha2, + GraphQLExperimentalFormattedIncrementalStreamResultAlpha2, +} from './incrementalDeliveryPolyfillAlpha2.js'; + +export type { + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, + GraphQLExperimentalFormattedIncrementalStreamResultAlpha9, + GraphQLExperimentalFormattedIncrementalDeferResultAlpha9, + GraphQLExperimentalFormattedCompletedResultAlpha9, + GraphQLExperimentalFormattedIncrementalResultAlpha9, + GraphQLExperimentalPendingResultAlpha9, +} from './incrementalDeliveryPolyfillAlpha9.js'; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/plugins.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/plugins.ts new file mode 100644 index 00000000..57151621 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/plugins.ts @@ -0,0 +1,222 @@ +/** + * The types defined in this file are useful to plugin authors. In particular, + * defining a plugin as an `ApolloServerPlugin` will provide typings for all of + * the hooks that are available to a plugin. + */ +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { Logger } from '@apollo/utils.logger'; +import type { GraphQLError, GraphQLResolveInfo, GraphQLSchema } from 'graphql'; +import type { ApolloConfig } from './constructor.js'; +import type { BaseContext } from './context.js'; +import type { GraphQLResponse } from './graphql.js'; +import type { GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 } from './incrementalDeliveryPolyfillAlpha2.js'; +import type { + GraphQLRequestContext, + GraphQLRequestContextDidEncounterErrors, + GraphQLRequestContextDidEncounterSubsequentErrors, + GraphQLRequestContextDidResolveOperation, + GraphQLRequestContextDidResolveSource, + GraphQLRequestContextExecutionDidStart, + GraphQLRequestContextParsingDidStart, + GraphQLRequestContextResponseForOperation, + GraphQLRequestContextValidationDidStart, + GraphQLRequestContextWillSendResponse, + GraphQLRequestContextWillSendSubsequentPayload, +} from './requestPipeline.js'; +import type { GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9 } from './incrementalDeliveryPolyfillAlpha9.js'; + +export interface GraphQLServerContext { + readonly logger: Logger; + readonly cache: KeyValueCache; + + schema: GraphQLSchema; + apollo: ApolloConfig; + startedInBackground: boolean; +} + +export interface GraphQLSchemaContext { + apiSchema: GraphQLSchema; + coreSupergraphSdl?: string; +} + +export interface ApolloServerPlugin< + in TContext extends BaseContext = BaseContext, +> { + // Called once on server startup, after the schema has been loaded. + serverWillStart?( + service: GraphQLServerContext, + ): Promise; + + // Called once per request, before parsing or validation of the request has + // occurred. This hook can return an object of more fine-grained hooks (see + // `GraphQLRequestListener`) which pertain to the lifecycle of the request. + requestDidStart?( + requestContext: GraphQLRequestContext, + ): Promise | void>; + + /** + * "Unexpected" errors do not include more common errors like validation, + * parsing, or graphql execution errors. Rather, an unexpected error might + * occur when a plugin hook throws unexpectedly or a bug in Apollo Server is + * encountered. Notably, when errors like this occur, the error is masked to + * the client. + */ + unexpectedErrorProcessingRequest?({ + requestContext, + error, + }: { + requestContext: GraphQLRequestContext; + error: Error; + }): Promise; + // Called specifically when the user-provided `context` function throws an + // error. + contextCreationDidFail?({ error }: { error: Error }): Promise; + /** + * This hook is called any time a "Bad Request" error is thrown during request + * execution. This includes CSRF prevention and malformed requests (e.g. + * incorrect headers, invalid JSON body, or invalid search params for GET), + * but does not include malformed GraphQL. + */ + invalidRequestWasReceived?({ error }: { error: Error }): Promise; + // Called on startup fail. This can occur if the schema fails to load or if a + // `serverWillStart` or `renderLandingPage` hook throws. + startupDidFail?({ error }: { error: Error }): Promise; +} + +export interface GraphQLServerListener { + // Called on server startup after a successful schema load and on successful + // schema updates when running in `gateway` mode. + schemaDidLoadOrUpdate?(schemaContext: GraphQLSchemaContext): void; + + // When your server is stopped (by calling `stop()` or via the + // `SIGINT`/`SIGTERM` handlers), Apollo Server first awaits all `drainServer` + // hooks in parallel. GraphQL operations can still execute while `drainServer` + // is in progress. A typical use is to stop listening for new connections and + // wait until all current connections are idle. The built-in + // ApolloServerPluginDrainHttpServer implements this method. + drainServer?(): Promise; + + // When your server is stopped (by calling `stop()` or via the + // `SIGINT`/`SIGTERM` handlers) then (after the `drainServer` phase finishes) + // Apollo Server transitions into a state where no new operations will run and + // then awaits all `drainServer` hooks in parallel. A typical use is to flush + // outstanding observability data. + serverWillStop?(): Promise; + + // At most one plugin's serverWillStart may return a GraphQLServerListener + // with this method. If one does, it is called once on server startup and the + // page it returns is served to clients with `accept: text/html` headers. This + // is an intentionally simple API; if you want to do something fancy to serve + // a landing page, you probably should just define a handler in your web + // framework. + renderLandingPage?(): Promise; +} + +// The page served to clients with `accept: text/html` headers. +export interface LandingPage { + html: string | (() => Promise); +} + +export type GraphQLRequestListenerParsingDidEnd = ( + err?: Error, +) => Promise; +export type GraphQLRequestListenerValidationDidEnd = ( + err?: ReadonlyArray, +) => Promise; +export type GraphQLRequestListenerExecutionDidEnd = ( + err?: Error, +) => Promise; +export type GraphQLRequestListenerDidResolveField = ( + error: Error | null, + result?: any, +) => void; + +export interface GraphQLRequestListener { + didResolveSource?( + requestContext: GraphQLRequestContextDidResolveSource, + ): Promise; + + parsingDidStart?( + requestContext: GraphQLRequestContextParsingDidStart, + ): Promise; + + validationDidStart?( + requestContext: GraphQLRequestContextValidationDidStart, + ): Promise; + + didResolveOperation?( + requestContext: GraphQLRequestContextDidResolveOperation, + ): Promise; + + didEncounterErrors?( + requestContext: GraphQLRequestContextDidEncounterErrors, + ): Promise; + + // If this hook is defined, it is invoked immediately before GraphQL execution + // would take place. If its return value resolves to a non-null + // GraphQLResponse, that result is used instead of executing the query. + // Hooks from different plugins are invoked in series and the first non-null + // response is used. + responseForOperation?( + requestContext: GraphQLRequestContextResponseForOperation, + ): Promise; + + // Note that in the case of incremental delivery, the end hook gets called + // when the initial response is ready to go: further execution can still occur. + executionDidStart?( + requestContext: GraphQLRequestContextExecutionDidStart, + ): Promise | void>; + + // Note that in the case of incremental delivery, this is called when the + // initial response is ready to go. + willSendResponse?( + requestContext: GraphQLRequestContextWillSendResponse, + ): Promise; + + didEncounterSubsequentErrors?( + requestContext: GraphQLRequestContextDidEncounterSubsequentErrors, + errors: ReadonlyArray, + ): Promise; + + // You can use hasNext to tell if this is the end or not. + willSendSubsequentPayload?( + requestContext: GraphQLRequestContextWillSendSubsequentPayload, + payload: + | GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 + | GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, + ): Promise; +} + +/** + * This is an object form of the parameters received by typical + * `graphql-js` resolvers. The function type is `GraphQLFieldResolver` + * and normally uses positional parameters. In order to facilitate better + * ergonomics in the Apollo Server plugin API, these have been converted to + * named properties on the object using their names from the upstream + * `GraphQLFieldResolver` type signature. Ergonomic wins, in this case, + * include not needing to have three unused variables in scope just because + * there was a need to access the `info` property in a wrapped plugin. + */ +export type GraphQLFieldResolverParams< + TSource, + TContext, + TArgs = { [argName: string]: any }, +> = { + source: TSource; + args: TArgs; + contextValue: TContext; + info: GraphQLResolveInfo; +}; + +export interface GraphQLRequestExecutionListener { + executionDidEnd?: GraphQLRequestListenerExecutionDidEnd; + // willResolveField is not async because we've observed that it already has + // quite a performance impact on execution even without involving the Promise + // queue. If we can come up with ways to alleviate the burden (eg having an + // uninstrumented schema and an instrumented schema and only using the + // instrumented schema for a subset of operations that need detailed + // performance traces) we could be happier supporting async willResolveField. + willResolveField?( + fieldResolverParams: GraphQLFieldResolverParams, + ): GraphQLRequestListenerDidResolveField | void; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/requestPipeline.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/requestPipeline.ts new file mode 100644 index 00000000..75445cc7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/externalTypes/requestPipeline.ts @@ -0,0 +1,123 @@ +// This file defines the GraphQLRequestContext type which is an argument to most +// plugin hooks, as well as a variety of variants on it which assert that +// particular sub-fields are set by a particular point in the request pipeline. + +import type { WithRequired } from '@apollo/utils.withrequired'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { BaseContext } from './context.js'; +import type { + GraphQLInProgressResponse, + GraphQLRequest, + GraphQLResponse, +} from './graphql.js'; +import type { Logger } from '@apollo/utils.logger'; +import type { KeyValueCache } from '@apollo/utils.keyvaluecache'; +import type { + DocumentNode, + GraphQLError, + GraphQLSchema, + OperationDefinitionNode, +} from 'graphql'; +import type { CachePolicy } from '@apollo/cache-control-types'; +import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface'; + +export interface GraphQLRequestMetrics { + // It would be more accurate to call this fieldLevelInstrumentation (it is + // true if the hook of that name returns truthy) but for backwards + // compatibility we keep this name (this field is read by `@apollo/gateway` to + // decide whether or not to send the apollo-federation-include-trace header). + captureTraces?: boolean; + persistedQueryHit?: boolean; + persistedQueryRegister?: boolean; + responseCacheHit?: boolean; + forbiddenOperation?: boolean; + registeredOperation?: boolean; + startHrTime?: [number, number]; + queryPlanTrace?: Trace.QueryPlanNode; + nonFtv1ErrorPaths?: NonFtv1ErrorPath[]; +} + +export interface GraphQLRequestContext { + readonly logger: Logger; + readonly cache: KeyValueCache; + + readonly request: GraphQLRequest; + readonly response: GraphQLInProgressResponse; + + readonly schema: GraphQLSchema; + + readonly contextValue: TContext; + + readonly queryHash?: string; + + readonly document?: DocumentNode; + readonly source?: string; + + // `operationName` is set based on the operation AST, so it is defined even if + // no `request.operationName` was passed in. It will be set to `null` for an + // anonymous operation, or if `requestName.operationName` was passed in but + // doesn't resolve to an operation in the document. + readonly operationName?: string | null; + readonly operation?: OperationDefinitionNode; + + /** + * Unformatted errors which have occurred during the request. Note that these + * are present earlier in the request pipeline and differ from **formatted** + * errors which are the result of running the user-configurable `formatError` + * transformation function over specific errors; these can eventually be found + * in `response.result.errors`. + */ + readonly errors?: ReadonlyArray; + + readonly metrics: GraphQLRequestMetrics; + + readonly overallCachePolicy: CachePolicy; + + /** + * True if this request is part of a potentially multi-operation batch. Note + * that if this is true, `response.http` will be shared with the other + * operations in the batch. + */ + readonly requestIsBatched: boolean; +} + +export type GraphQLRequestContextDidResolveSource< + TContext extends BaseContext, +> = WithRequired, 'source' | 'queryHash'>; +export type GraphQLRequestContextParsingDidStart = + GraphQLRequestContextDidResolveSource; +export type GraphQLRequestContextValidationDidStart< + TContext extends BaseContext, +> = GraphQLRequestContextParsingDidStart & + WithRequired, 'document'>; +export type GraphQLRequestContextDidResolveOperation< + TContext extends BaseContext, +> = GraphQLRequestContextValidationDidStart & + WithRequired, 'operationName'>; +export type GraphQLRequestContextDidEncounterErrors< + TContext extends BaseContext, +> = WithRequired, 'errors'>; +export type GraphQLRequestContextResponseForOperation< + TContext extends BaseContext, +> = WithRequired< + GraphQLRequestContext, + 'source' | 'document' | 'operation' | 'operationName' +>; +export type GraphQLRequestContextExecutionDidStart< + TContext extends BaseContext, +> = GraphQLRequestContextParsingDidStart & + WithRequired< + GraphQLRequestContext, + 'document' | 'operation' | 'operationName' + >; +export type GraphQLRequestContextWillSendResponse< + TContext extends BaseContext, +> = GraphQLRequestContextDidResolveSource & { + readonly response: GraphQLResponse; +}; +export type GraphQLRequestContextDidEncounterSubsequentErrors< + TContext extends BaseContext, +> = GraphQLRequestContextWillSendResponse; +export type GraphQLRequestContextWillSendSubsequentPayload< + TContext extends BaseContext, +> = GraphQLRequestContextWillSendResponse; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/generated/packageVersion.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/generated/packageVersion.ts new file mode 100644 index 00000000..d9bce172 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/generated/packageVersion.ts @@ -0,0 +1 @@ +export const packageVersion = "5.5.1"; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/httpBatching.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/httpBatching.ts new file mode 100644 index 00000000..bade864e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/httpBatching.ts @@ -0,0 +1,105 @@ +import type { + BaseContext, + HTTPGraphQLRequest, + HTTPGraphQLResponse, +} from './externalTypes/index.js'; +import type { + ApolloServer, + ApolloServerInternals, + SchemaDerivedData, +} from './ApolloServer'; +import { newHTTPGraphQLHead, runHttpQuery } from './runHttpQuery.js'; +import { BadRequestError } from './internalErrorClasses.js'; + +async function runBatchedHttpQuery({ + server, + batchRequest, + body, + contextValue, + schemaDerivedData, + internals, +}: { + server: ApolloServer; + batchRequest: HTTPGraphQLRequest; + body: unknown[]; + contextValue: TContext; + schemaDerivedData: SchemaDerivedData; + internals: ApolloServerInternals; +}): Promise { + if (body.length === 0) { + throw new BadRequestError('No operations found in request.'); + } + + // This single HTTPGraphQLHead is shared across all the operations in the + // batch. This means that any changes to response headers or status code from + // one operation can be immediately seen by other operations. Plugins that set + // response headers or status code can then choose to combine the data they + // are setting with data that may already be there from another operation as + // they choose. + const sharedResponseHTTPGraphQLHead = newHTTPGraphQLHead(); + const responseBodies = await Promise.all( + body.map(async (bodyPiece: unknown) => { + const singleRequest: HTTPGraphQLRequest = { + ...batchRequest, + body: bodyPiece, + }; + + const response = await runHttpQuery({ + server, + httpRequest: singleRequest, + contextValue, + schemaDerivedData, + internals, + sharedResponseHTTPGraphQLHead, + }); + + if (response.body.kind === 'chunked') { + throw Error( + 'Incremental delivery is not implemented for batch requests', + ); + } + return response.body.string; + }), + ); + return { + ...sharedResponseHTTPGraphQLHead, + body: { kind: 'complete', string: `[${responseBodies.join(',')}]` }, + }; +} + +export async function runPotentiallyBatchedHttpQuery< + TContext extends BaseContext, +>( + server: ApolloServer, + httpGraphQLRequest: HTTPGraphQLRequest, + contextValue: TContext, + schemaDerivedData: SchemaDerivedData, + internals: ApolloServerInternals, +): Promise { + if ( + !( + httpGraphQLRequest.method === 'POST' && + Array.isArray(httpGraphQLRequest.body) + ) + ) { + return await runHttpQuery({ + server, + httpRequest: httpGraphQLRequest, + contextValue, + schemaDerivedData, + internals, + sharedResponseHTTPGraphQLHead: null, + }); + } + if (internals.allowBatchedHttpRequests) { + return await runBatchedHttpQuery({ + server, + batchRequest: httpGraphQLRequest, + body: httpGraphQLRequest.body as unknown[], + contextValue, + schemaDerivedData, + internals, + }); + } + throw new BadRequestError('Operation batching disabled.'); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/incrementalDeliveryPolyfill.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/incrementalDeliveryPolyfill.ts new file mode 100644 index 00000000..97d2b609 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/incrementalDeliveryPolyfill.ts @@ -0,0 +1,253 @@ +import { + execute, + type ExecutionArgs, + type ExecutionResult, + type GraphQLError, +} from 'graphql'; +import { BadRequestError } from './internalErrorClasses.js'; +import { MEDIA_TYPES } from './ApolloServer.js'; +import { type LegacyExperimentalExecuteIncrementally } from './externalTypes/graphql.js'; + +// This file "polyfills" graphql@17's experimentalExecuteIncrementally (by +// returning a function that does not understand incremental directives if +// you're using graphql@16). The types defined in this file are largely copied +// from graphql-js. + +interface ObjMap { + [key: string]: T; +} + +// 17.0.0-alpha.2 +export interface GraphQLExperimentalInitialIncrementalExecutionResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> extends ExecutionResult { + hasNext: boolean; + incremental?: ReadonlyArray< + GraphQLExperimentalIncrementalResultAlpha2 + >; + extensions?: TExtensions; +} + +export interface GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> { + hasNext: boolean; + incremental?: ReadonlyArray< + GraphQLExperimentalIncrementalResultAlpha2 + >; + extensions?: TExtensions; +} + +type GraphQLExperimentalIncrementalResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> = + | GraphQLExperimentalIncrementalDeferResultAlpha2 + | GraphQLExperimentalIncrementalStreamResultAlpha2; + +interface GraphQLExperimentalIncrementalDeferResultAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> extends ExecutionResult { + path?: ReadonlyArray; + label?: string; +} + +interface GraphQLExperimentalIncrementalStreamResultAlpha2< + TData = Array, + TExtensions = ObjMap, +> { + errors?: ReadonlyArray; + items?: TData | null; + path?: ReadonlyArray; + label?: string; + extensions?: TExtensions; +} + +export interface GraphQLExperimentalIncrementalExecutionResultsAlpha2< + TData = ObjMap, + TExtensions = ObjMap, +> { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha2< + TData, + TExtensions + >; + subsequentResults: AsyncGenerator< + GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha2< + TData, + TExtensions + >, + void, + void + >; +} + +// 17.0.0-alpha.9 +export interface GraphQLExperimentalInitialIncrementalExecutionResultAlpha9< + TData = ObjMap, + TExtensions = ObjMap, +> extends ExecutionResult { + data: TData; + pending: ReadonlyArray; + hasNext: true; + extensions?: TExtensions; +} + +export interface GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha9< + TData = ObjMap, + TExtensions = ObjMap, +> { + pending?: ReadonlyArray; + incremental?: ReadonlyArray< + GraphQLExperimentalIncrementalResultAlpha9 + >; + completed?: ReadonlyArray; + hasNext: boolean; + extensions?: TExtensions; +} + +interface GraphQLExperimentalExecutionGroupResultAlpha9< + TData = ObjMap, +> { + errors?: ReadonlyArray; + data: TData; +} + +interface GraphQLExperimentalIncrementalDeferResultAlpha9< + TData = ObjMap, + TExtensions = ObjMap, +> extends GraphQLExperimentalExecutionGroupResultAlpha9 { + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} + +interface GraphQLExperimentalStreamItemsRecordResultAlpha9< + TData = ReadonlyArray, +> { + errors?: ReadonlyArray; + items: TData; +} + +interface GraphQLExperimentalIncrementalStreamResultAlpha9< + TData = ReadonlyArray, + TExtensions = ObjMap, +> extends GraphQLExperimentalStreamItemsRecordResultAlpha9 { + id: string; + subPath?: ReadonlyArray; + extensions?: TExtensions; +} + +type GraphQLExperimentalIncrementalResultAlpha9< + TData = unknown, + TExtensions = ObjMap, +> = + | GraphQLExperimentalIncrementalDeferResultAlpha9 + | GraphQLExperimentalIncrementalStreamResultAlpha9; + +interface GraphQLExperimentalPendingResultAlpha9 { + id: string; + path: ReadonlyArray; + label?: string; +} + +interface GraphQLExperimentalCompletedResultAlpha9 { + id: string; + errors?: ReadonlyArray; +} + +export interface GraphQLExperimentalIncrementalExecutionResultsAlpha9< + TInitial = ObjMap, + TSubsequent = unknown, + TExtensions = ObjMap, +> { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha9< + TInitial, + TExtensions + >; + subsequentResults: AsyncGenerator< + GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha9< + TSubsequent, + TExtensions + >, + void, + void + >; +} + +type PromiseOrValue = Promise | T; + +// This starts as undefined and is set to a function or null by running +// tryToLoadGraphQL17(). If graphql-js 17 is installed, it is set to the +// experimentalExecuteIncrementally function from that package; otherwise it is +// set to null. +let graphqlExperimentalExecuteIncrementally: + | (( + args: ExecutionArgs, + ) => PromiseOrValue< + ExecutionResult | GraphQLExperimentalIncrementalExecutionResultsAlpha9 + >) + | null + | undefined = undefined; + +async function tryToLoadGraphQL17() { + if (graphqlExperimentalExecuteIncrementally !== undefined) { + return; + } + + const graphql = await import('graphql'); + if ( + graphql.version === '17.0.0-alpha.9' && + 'experimentalExecuteIncrementally' in graphql + ) { + graphqlExperimentalExecuteIncrementally = (graphql as any) + .experimentalExecuteIncrementally; + } else { + graphqlExperimentalExecuteIncrementally = null; + } +} + +export async function executeIncrementally({ + useLegacyIncremental, + legacyExperimentalExecuteIncrementally, + ...args +}: ExecutionArgs & { + useLegacyIncremental?: boolean; + legacyExperimentalExecuteIncrementally: + | LegacyExperimentalExecuteIncrementally + | undefined; +}): Promise< + | ExecutionResult + | GraphQLExperimentalIncrementalExecutionResultsAlpha2 + | GraphQLExperimentalIncrementalExecutionResultsAlpha9 +> { + await tryToLoadGraphQL17(); + + if (useLegacyIncremental) { + if (legacyExperimentalExecuteIncrementally) { + return legacyExperimentalExecuteIncrementally(args); + } + + // Only throw if the server supports incremental delivery with the new + // format, but not the legacy format. We don't want to accidentally send + // alpha.9 format when the client requested the legacy format. + if (graphqlExperimentalExecuteIncrementally) { + throw new BadRequestError( + 'Apollo Server received an operation that uses incremental delivery ' + + '(@defer or @stream) with the legacy incremental format, but the server ' + + 'does not support the legacy incremental delivery format. Add the HTTP ' + + `header: 'Accept: ${MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' ` + + 'to use the current incremental delivery format', + // Use 406 Not Accepted + { extensions: { http: { status: 406 } } }, + ); + } + } + + if (graphqlExperimentalExecuteIncrementally) { + return graphqlExperimentalExecuteIncrementally(args); + } + return execute(args); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/index.ts new file mode 100644 index 00000000..aa6e9d4f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/index.ts @@ -0,0 +1,4 @@ +export { ApolloServer } from './ApolloServer.js'; +export { HeaderMap } from './utils/HeaderMap.js'; +// Note that this is purely a type export. +export * from './externalTypes/index.js'; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalErrorClasses.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalErrorClasses.ts new file mode 100644 index 00000000..f5e8ae05 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalErrorClasses.ts @@ -0,0 +1,123 @@ +import { GraphQLError, type GraphQLErrorOptions } from 'graphql'; +import { ApolloServerErrorCode } from './errors/index.js'; +import { newHTTPGraphQLHead } from './runHttpQuery.js'; +import { HeaderMap } from './utils/HeaderMap.js'; + +// These error classes are not part of Apollo Server's external API; the +// ApolloServerErrorCode enum is (exported from `@apollo/server/errors`). + +class GraphQLErrorWithCode extends GraphQLError { + constructor( + message: string, + code: ApolloServerErrorCode, + options?: GraphQLErrorOptions, + ) { + super(message, { + ...options, + extensions: { ...options?.extensions, code }, + }); + this.name = this.constructor.name; + } +} + +export class SyntaxError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError) { + super(graphqlError.message, ApolloServerErrorCode.GRAPHQL_PARSE_FAILED, { + source: graphqlError.source, + positions: graphqlError.positions, + extensions: { http: newHTTPGraphQLHead(400), ...graphqlError.extensions }, + originalError: graphqlError, + }); + } +} + +export class ValidationError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError) { + super( + graphqlError.message, + ApolloServerErrorCode.GRAPHQL_VALIDATION_FAILED, + { + nodes: graphqlError.nodes, + extensions: { + http: newHTTPGraphQLHead(400), + ...graphqlError.extensions, + }, + originalError: graphqlError.originalError ?? graphqlError, + }, + ); + } +} + +// Persisted query errors (especially "not found") need to be uncached, because +// hopefully we're about to fill in the APQ cache and the same request will +// succeed next time. We also want a 200 response to avoid any error handling +// that may mask the contents of an error response. (Otherwise, the default +// status code for a response with `errors` but no `data` (even null) is 400.) +const getPersistedQueryErrorHttp = () => ({ + status: 200, + headers: new HeaderMap([ + ['cache-control', 'private, no-cache, must-revalidate'], + ]), +}); + +export class PersistedQueryNotFoundError extends GraphQLErrorWithCode { + constructor() { + super( + 'PersistedQueryNotFound', + ApolloServerErrorCode.PERSISTED_QUERY_NOT_FOUND, + { extensions: { http: getPersistedQueryErrorHttp() } }, + ); + } +} + +export class PersistedQueryNotSupportedError extends GraphQLErrorWithCode { + constructor() { + super( + 'PersistedQueryNotSupported', + ApolloServerErrorCode.PERSISTED_QUERY_NOT_SUPPORTED, + // Not super clear why we need this to be uncached (makes sense for + // PersistedQueryNotFoundError, because there we're about to fill the + // cache and make the next copy of the same request succeed) but we've + // been doing it for years so :shrug: + { extensions: { http: getPersistedQueryErrorHttp() } }, + ); + } +} + +export class UserInputError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError) { + super(graphqlError.message, ApolloServerErrorCode.BAD_USER_INPUT, { + nodes: graphqlError.nodes, + originalError: graphqlError.originalError ?? graphqlError, + extensions: graphqlError.extensions, + }); + } +} + +export class OperationResolutionError extends GraphQLErrorWithCode { + constructor(graphqlError: GraphQLError) { + super( + graphqlError.message, + ApolloServerErrorCode.OPERATION_RESOLUTION_FAILURE, + { + nodes: graphqlError.nodes, + originalError: graphqlError.originalError ?? graphqlError, + extensions: { + http: newHTTPGraphQLHead(400), + ...graphqlError.extensions, + }, + }, + ); + } +} + +export class BadRequestError extends GraphQLErrorWithCode { + constructor(message: string, options?: GraphQLErrorOptions) { + super(message, ApolloServerErrorCode.BAD_REQUEST, { + ...options, + // Default to 400 status code, but caller can override. (If caller just + // wants to override headers... well, they can't, sorry.) + extensions: { http: newHTTPGraphQLHead(400), ...options?.extensions }, + }); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalPlugin.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalPlugin.ts new file mode 100644 index 00000000..c357ad92 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/internalPlugin.ts @@ -0,0 +1,42 @@ +import type { BaseContext, ApolloServerPlugin } from './externalTypes/index.js'; + +// This file's exports should not be exported from the overall +// @apollo/server module. + +// The internal plugins implement this interface which +// ApolloServer.ensurePluginInstantiation uses to figure out if the plugins have +// already been installed (or explicitly disabled via the matching Disable +// plugins). +export interface InternalApolloServerPlugin + extends ApolloServerPlugin { + // Used to identify a few specific plugins that are instantiated + // by default if not explicitly used or disabled. + __internal_plugin_id__: InternalPluginId; + __is_disabled_plugin__: boolean; +} + +// Helper function for writing internal plugins which lets you write an object +// that is type-checked as InternalApolloServerPlugin but is still only of type +// ApolloServerPlugin (as appropriate for externally-exported plugin-returning +// functions). +export function internalPlugin( + p: InternalApolloServerPlugin, +): ApolloServerPlugin { + return p; +} + +export type InternalPluginId = + | 'CacheControl' + | 'LandingPageDisabled' + | 'SchemaReporting' + | 'InlineTrace' + | 'UsageReporting' + | 'DisableSuggestions'; + +export function pluginIsInternal( + plugin: ApolloServerPlugin, +): plugin is InternalApolloServerPlugin { + // We could call the function and compare it to the list above, but this seems + // good enough. + return '__internal_plugin_id__' in plugin; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/cacheControl/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/cacheControl/index.ts new file mode 100644 index 00000000..bf611689 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/cacheControl/index.ts @@ -0,0 +1,453 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import { + type DirectiveNode, + getNamedType, + type GraphQLCompositeType, + type GraphQLField, + isCompositeType, + isInterfaceType, + isObjectType, + responsePathAsArray, +} from 'graphql'; +import { newCachePolicy } from '../../cachePolicy.js'; +import { internalPlugin } from '../../internalPlugin.js'; +import { LRUCache } from 'lru-cache'; +import type { + CacheHint, + CacheScope, + GraphQLResolveInfoWithCacheControl, +} from '@apollo/cache-control-types'; + +/** + * CacheAnnotation represents the contents of a `@cacheControl` directive. + * (`inheritMaxAge` is part of this interface and not CacheHint, because + * `inheritMaxAge` isn't a contributing piece of a cache policy: it just means + * to not apply default values in some contexts.) + */ +interface CacheAnnotation extends CacheHint { + inheritMaxAge?: true; +} + +export interface ApolloServerPluginCacheControlOptions { + /** + * All root fields and fields returning objects or interfaces have this value + * for `maxAge` unless they set a cache hint with a non-undefined `maxAge` + * using `@cacheControl` or `setCacheHint`. The default is 0, which means "not + * cacheable". (That is: if you don't set `defaultMaxAge`, then every root + * field in your operation and every field with sub-fields must have a cache + * hint or the overall operation will not be cacheable.) + */ + defaultMaxAge?: number; + /** + * Determines whether to set the `Cache-Control` HTTP header. If true (the + * default), the header is written on all responses (with a value of + * `no-store` for non-cacheable responses). If `'if-cacheable'`, the header is + * only written for cacheable responses. If false, the header is never + * written. A response is cacheable if its overall cache policy has a non-zero + * `maxAge`, and the body is a single result rather than an incremental + * delivery response, and the body contains no errors. + */ + calculateHttpHeaders?: boolean | 'if-cacheable'; + // For testing only. + __testing__cacheHints?: Map; +} + +export function ApolloServerPluginCacheControl( + options: ApolloServerPluginCacheControlOptions = Object.create(null), +): ApolloServerPlugin { + let typeAnnotationCache: LRUCache; + + let fieldAnnotationCache: LRUCache< + GraphQLField, + CacheAnnotation + >; + + return internalPlugin({ + __internal_plugin_id__: 'CacheControl', + __is_disabled_plugin__: false, + + async serverWillStart({ schema }) { + // Set the size of the caches to be equal to the number of composite types + // and fields in the schema respectively. This generally means that the + // cache will always have room for all the cache hints in the active + // schema but we won't have a memory leak as schemas are replaced in a + // gateway. (Once we're comfortable breaking compatibility with + // versions of Gateway older than 0.35.0, we should also run this code + // from a schemaDidLoadOrUpdate instead of serverWillStart. Using + // schemaDidLoadOrUpdate throws when combined with old gateways.) + typeAnnotationCache = new LRUCache( + { + max: Object.values(schema.getTypeMap()).filter(isCompositeType) + .length, + }, + ); + + fieldAnnotationCache = new LRUCache< + GraphQLField, + CacheAnnotation + >({ + max: + Object.values(schema.getTypeMap()) + .filter(isObjectType) + .flatMap((t) => Object.values(t.getFields())).length + + Object.values(schema.getTypeMap()) + .filter(isInterfaceType) + .flatMap((t) => Object.values(t.getFields())).length, + }); + + return undefined; + }, + + async requestDidStart(requestContext) { + function memoizedCacheAnnotationFromType( + t: GraphQLCompositeType, + ): CacheAnnotation { + const existing = typeAnnotationCache.get(t); + if (existing) { + return existing; + } + const annotation = cacheAnnotationFromType(t); + typeAnnotationCache.set(t, annotation); + return annotation; + } + + function memoizedCacheAnnotationFromField( + field: GraphQLField, + ): CacheAnnotation { + const existing = fieldAnnotationCache.get(field); + if (existing) { + return existing; + } + const annotation = cacheAnnotationFromField(field); + fieldAnnotationCache.set(field, annotation); + return annotation; + } + + const defaultMaxAge: number = options.defaultMaxAge ?? 0; + const calculateHttpHeaders = options.calculateHttpHeaders ?? true; + const { __testing__cacheHints } = options; + + return { + async executionDidStart() { + // Did something set the overall cache policy before we've even + // started? If so, consider that as an override and don't touch it. + // Just put set up fake `info.cacheControl` objects and otherwise + // don't track cache policy. + // + // (This doesn't happen in practice using the core plugins: the main + // use case for restricting overallCachePolicy outside of this plugin + // is apollo-server-plugin-response-cache, but when it sets the policy + // we never get to execution at all.) + if (isRestricted(requestContext.overallCachePolicy)) { + // This is "fake" in the sense that it never actually affects + // requestContext.overallCachePolicy. + const fakeFieldPolicy = newCachePolicy(); + return { + willResolveField({ info }) { + // This `as` is "safe" in the sense that this is the statement + // that makes a GraphQLResolveInfo into a + // GraphQLResolveInfoWithCacheControl. + (info as GraphQLResolveInfoWithCacheControl).cacheControl = { + setCacheHint: (dynamicHint: CacheHint) => { + fakeFieldPolicy.replace(dynamicHint); + }, + cacheHint: fakeFieldPolicy, + cacheHintFromType: memoizedCacheAnnotationFromType, + }; + }, + }; + } + + return { + willResolveField({ info }) { + const fieldPolicy = newCachePolicy(); + + let inheritMaxAge = false; + + // If this field's resolver returns an object/interface/union + // (maybe wrapped in list/non-null), look for hints on that return + // type. + const targetType = getNamedType(info.returnType); + if (isCompositeType(targetType)) { + const typeAnnotation = + memoizedCacheAnnotationFromType(targetType); + fieldPolicy.replace(typeAnnotation); + inheritMaxAge = !!typeAnnotation.inheritMaxAge; + } + + // Look for hints on the field itself (on its parent type), taking + // precedence over previously calculated hints. + const fieldAnnotation = memoizedCacheAnnotationFromField( + info.parentType.getFields()[info.fieldName], + ); + + // Note that specifying `@cacheControl(inheritMaxAge: true)` on a + // field whose return type defines a `maxAge` gives precedence to + // the type's `maxAge`. (Perhaps this should be some sort of + // error.) + if ( + fieldAnnotation.inheritMaxAge && + fieldPolicy.maxAge === undefined + ) { + inheritMaxAge = true; + // Handle `@cacheControl(inheritMaxAge: true, scope: PRIVATE)`. + // (We ignore any specified `maxAge`; perhaps it should be some + // sort of error.) + if (fieldAnnotation.scope) { + fieldPolicy.replace({ scope: fieldAnnotation.scope }); + } + } else { + fieldPolicy.replace(fieldAnnotation); + } + + // This `as` is "safe" in the sense that this is the statement + // that makes a GraphQLResolveInfo into a + // GraphQLResolveInfoWithCacheControl. + (info as GraphQLResolveInfoWithCacheControl).cacheControl = { + setCacheHint: (dynamicHint: CacheHint) => { + fieldPolicy.replace(dynamicHint); + }, + cacheHint: fieldPolicy, + cacheHintFromType: memoizedCacheAnnotationFromType, + }; + + // When the resolver is done, call restrict once. By calling + // restrict after the resolver instead of before, we don't need to + // "undo" the effect on overallCachePolicy of a static hint that + // gets refined by a dynamic hint. + return () => { + // If this field returns a composite type or is a root field and + // we haven't seen an explicit maxAge hint, set the maxAge to 0 + // (uncached) or the default if specified in the constructor. + // (Non-object fields by default are assumed to inherit their + // cacheability from their parents. But on the other hand, while + // root non-object fields can get explicit hints from their + // definition on the Query/Mutation object, if that doesn't + // exist then there's no parent field that would assign the + // default maxAge, so we do it here.) + // + // You can disable this on a non-root field by writing + // `@cacheControl(inheritMaxAge: true)` on it. If you do this, + // then its children will be treated like root paths, since + // there is no parent maxAge to inherit. + // + // We do this in the end hook so that dynamic cache control + // prevents it from happening (eg, + // `info.cacheControl.cacheHint.restrict({maxAge: 60})` should + // work rather than doing nothing because we've already set the + // max age to the default of 0). This also lets resolvers assume + // any hint in `info.cacheControl.cacheHint` was explicitly set. + if ( + fieldPolicy.maxAge === undefined && + ((isCompositeType(targetType) && !inheritMaxAge) || + !info.path.prev) + ) { + fieldPolicy.restrict({ maxAge: defaultMaxAge }); + } + + if (__testing__cacheHints && isRestricted(fieldPolicy)) { + const path = responsePathAsArray(info.path).join('.'); + if (__testing__cacheHints.has(path)) { + throw Error( + "shouldn't happen: addHint should only be called once per path", + ); + } + __testing__cacheHints.set(path, { + maxAge: fieldPolicy.maxAge, + scope: fieldPolicy.scope, + }); + } + requestContext.overallCachePolicy.restrict(fieldPolicy); + }; + }, + }; + }, + + async willSendResponse(requestContext) { + // This hook is just for setting response headers, so make sure that + // hasn't been disabled. + if (!calculateHttpHeaders) { + return; + } + + const { response, overallCachePolicy } = requestContext; + + // Look to see if something has already set the cache-control header. + // This could be a different plugin... or it could be this very plugin + // operating on a different operation in the same batched HTTP + // request. + const existingCacheControlHeader = parseExistingCacheControlHeader( + response.http.headers.get('cache-control'), + ); + + // If the header contains something other than a value that this + // plugin sets, then we leave it alone. We don't want to mangle + // something important that you set! That said, it's probably best to + // have only one piece of code that writes to a given header, so you + // should probably set `calculateHttpHeaders: false` on this plugin. + if (existingCacheControlHeader.kind === 'unparsable') { + return; + } + + const cachePolicy = newCachePolicy(); + cachePolicy.replace(overallCachePolicy); + if (existingCacheControlHeader.kind === 'parsable-and-cacheable') { + cachePolicy.restrict(existingCacheControlHeader.hint); + } + const policyIfCacheable = cachePolicy.policyIfCacheable(); + + if ( + // This code path is only for if we believe it is cacheable. + policyIfCacheable && + // Either there wasn't a cache-control header already, or we've + // already incorporated it into policyIfCacheable. (If we couldn't + // parse it, that means some other plugin or mechanism set the + // header. This is confusing, so we just don't make any more + // changes. You should probably set `calculateHttpHeaders` to false + // in that case and only set the header from one place.) + existingCacheControlHeader.kind !== 'uncacheable' && + // At least for now, we don't set cache-control headers for + // incremental delivery responses, since we don't know if a later + // part of the execution will affect the cache policy (perhaps + // dynamically). (Note that willSendResponse is called when the + // initial payload is sent, not the final payload.) + response.body.kind === 'single' && + !response.body.singleResult.errors + ) { + response.http.headers.set( + 'cache-control', + `max-age=${ + policyIfCacheable.maxAge + }, ${policyIfCacheable.scope.toLowerCase()}`, + ); + } else if (calculateHttpHeaders !== 'if-cacheable') { + // The response is not cacheable, so make sure it doesn't get + // cached. This is especially important for GET requests, because + // browsers and other agents cache many GET requests by default. + // (But if some other plugin set the header to a value that this + // plugin does not produce, we don't do anything.) + response.http.headers.set( + 'cache-control', + CACHE_CONTROL_HEADER_UNCACHEABLE, + ); + } + }, + }; + }, + }); +} + +const CACHE_CONTROL_HEADER_CACHEABLE_REGEXP = + /^max-age=(\d+), (public|private)$/; +const CACHE_CONTROL_HEADER_UNCACHEABLE = 'no-store'; + +type ExistingCacheControlHeader = + | { kind: 'no-header' } + | { kind: 'uncacheable' } + | { kind: 'parsable-and-cacheable'; hint: CacheHint } + | { kind: 'unparsable' }; + +function parseExistingCacheControlHeader( + header: string | undefined, +): ExistingCacheControlHeader { + if (!header) { + return { kind: 'no-header' }; + } + if (header === CACHE_CONTROL_HEADER_UNCACHEABLE) { + return { kind: 'uncacheable' }; + } + const match = CACHE_CONTROL_HEADER_CACHEABLE_REGEXP.exec(header); + if (!match) { + return { kind: 'unparsable' }; + } + return { + kind: 'parsable-and-cacheable', + hint: { + maxAge: +match[1], + scope: match[2] === 'public' ? 'PUBLIC' : 'PRIVATE', + }, + }; +} + +function cacheAnnotationFromDirectives( + directives: ReadonlyArray | undefined, +): CacheAnnotation | undefined { + if (!directives) return undefined; + + const cacheControlDirective = directives.find( + (directive) => directive.name.value === 'cacheControl', + ); + if (!cacheControlDirective) return undefined; + + if (!cacheControlDirective.arguments) return undefined; + + const maxAgeArgument = cacheControlDirective.arguments.find( + (argument) => argument.name.value === 'maxAge', + ); + const scopeArgument = cacheControlDirective.arguments.find( + (argument) => argument.name.value === 'scope', + ); + const inheritMaxAgeArgument = cacheControlDirective.arguments.find( + (argument) => argument.name.value === 'inheritMaxAge', + ); + + const scopeString = + scopeArgument?.value?.kind === 'EnumValue' + ? scopeArgument.value.value + : undefined; + + const scope: CacheScope | undefined = + scopeString === 'PUBLIC' || scopeString === 'PRIVATE' + ? scopeString + : undefined; + + if ( + inheritMaxAgeArgument?.value?.kind === 'BooleanValue' && + inheritMaxAgeArgument.value.value + ) { + // We ignore maxAge if it is also specified. + return { inheritMaxAge: true, scope }; + } + + return { + maxAge: + maxAgeArgument?.value?.kind === 'IntValue' + ? parseInt(maxAgeArgument.value.value) + : undefined, + scope, + }; +} + +function cacheAnnotationFromType(t: GraphQLCompositeType): CacheAnnotation { + if (t.astNode) { + const hint = cacheAnnotationFromDirectives(t.astNode.directives); + if (hint) { + return hint; + } + } + if (t.extensionASTNodes) { + for (const node of t.extensionASTNodes) { + const hint = cacheAnnotationFromDirectives(node.directives); + if (hint) { + return hint; + } + } + } + return {}; +} + +function cacheAnnotationFromField( + field: GraphQLField, +): CacheAnnotation { + if (field.astNode) { + const hint = cacheAnnotationFromDirectives(field.astNode.directives); + if (hint) { + return hint; + } + } + return {}; +} + +function isRestricted(hint: CacheHint) { + return hint.maxAge !== undefined || hint.scope !== undefined; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disableSuggestions/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disableSuggestions/index.ts new file mode 100644 index 00000000..6a76e843 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disableSuggestions/index.ts @@ -0,0 +1,23 @@ +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import { internalPlugin } from '../../internalPlugin.js'; + +export function ApolloServerPluginDisableSuggestions(): ApolloServerPlugin { + return internalPlugin({ + __internal_plugin_id__: 'DisableSuggestions', + __is_disabled_plugin__: false, + async requestDidStart() { + return { + async validationDidStart() { + return async (validationErrors) => { + validationErrors?.forEach((error) => { + error.message = error.message.replace( + / ?Did you mean(.+?)\?$/, + '', + ); + }); + }; + }, + }; + }, + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disabled/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disabled/index.ts new file mode 100644 index 00000000..b427fef6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/disabled/index.ts @@ -0,0 +1,41 @@ +// This file exports the "disabled" version of various plugins which are +// installed by default under certain circumstances. This lets users explicitly +// choose not to enable these plugins. Note that we explicitly keep these tiny +// plugins separate from the plugins they are enabling; this means that we don't +// have to load (say) the entire `plugin/usageReporting` entry point (which +// includes the whole generated protobuf library, etc) just in order to disable +// usage reporting. + +import type { BaseContext, ApolloServerPlugin } from '../../index.js'; +import type { + InternalApolloServerPlugin, + InternalPluginId, +} from '../../internalPlugin.js'; + +function disabledPlugin(id: InternalPluginId): ApolloServerPlugin { + const plugin: InternalApolloServerPlugin = { + __internal_plugin_id__: id, + __is_disabled_plugin__: true, + }; + return plugin; +} + +export function ApolloServerPluginCacheControlDisabled(): ApolloServerPlugin { + return disabledPlugin('CacheControl'); +} + +export function ApolloServerPluginInlineTraceDisabled(): ApolloServerPlugin { + return disabledPlugin('InlineTrace'); +} + +export function ApolloServerPluginLandingPageDisabled(): ApolloServerPlugin { + return disabledPlugin('LandingPageDisabled'); +} + +export function ApolloServerPluginSchemaReportingDisabled(): ApolloServerPlugin { + return disabledPlugin('SchemaReporting'); +} + +export function ApolloServerPluginUsageReportingDisabled(): ApolloServerPlugin { + return disabledPlugin('UsageReporting'); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/index.ts new file mode 100644 index 00000000..3225d9fa --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/index.ts @@ -0,0 +1,42 @@ +import type http from 'http'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import { Stopper } from './stoppable.js'; + +/** + * Options for ApolloServerPluginDrainHttpServer. + */ +export interface ApolloServerPluginDrainHttpServerOptions { + /** + * The http.Server (or https.Server, etc) to drain. Required. + */ + httpServer: http.Server; + /** + * How long to wait before forcefully closing non-idle connections. + * Defaults to 10_000 (ten seconds). + */ + stopGracePeriodMillis?: number; +} + +/** + * This plugin is used with frameworks built on Node's http.Server + * (`startStandaloneServer`, Express, etc) to drain your HTTP server on + * shutdown. See + * https://www.apollographql.com/docs/apollo-server/api/plugin/drain-http-server/ + * for details. + */ +export function ApolloServerPluginDrainHttpServer( + options: ApolloServerPluginDrainHttpServerOptions, +): ApolloServerPlugin { + const stopper = new Stopper(options.httpServer); + return { + async serverWillStart() { + return { + async drainServer() { + const stopGracePeriodMillis = options.stopGracePeriodMillis ?? 10_000; + const signal = AbortSignal.timeout(stopGracePeriodMillis); + await stopper.stop(signal); + }, + }; + }, + }; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/stoppable.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/stoppable.ts new file mode 100644 index 00000000..ea554d00 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/drainHttpServer/stoppable.ts @@ -0,0 +1,109 @@ +// This file is adapted from the stoppable npm package: +// https://github.com/hunterloftis/stoppable +// +// We've ported it to TypeScript and simplified the API and fixed some bugs. +// Here's the license of the original code: +// +// The MIT License (MIT) +// +// Copyright (c) 2017 Hunter Loftis +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import type http from 'http'; +import https from 'https'; +import type { Socket } from 'net'; + +export class Stopper { + private requestCountPerSocket = new Map(); + private stopped = false; + + constructor(private server: http.Server | https.Server) { + // Keep a number in requestCountPerSocket for each current connection. + server.on( + server instanceof https.Server ? 'secureConnection' : 'connection', + (socket: Socket) => { + this.requestCountPerSocket.set(socket, 0); + socket.once('close', () => this.requestCountPerSocket.delete(socket)); + }, + ); + + // Track how many HTTP requests are active on the socket. + server.on( + 'request', + (req: http.IncomingMessage, res: http.ServerResponse) => { + this.requestCountPerSocket.set( + req.socket, + (this.requestCountPerSocket.get(req.socket) ?? 0) + 1, + ); + res.once('finish', () => { + const pending = (this.requestCountPerSocket.get(req.socket) ?? 0) - 1; + this.requestCountPerSocket.set(req.socket, pending); + // If we're in the process of stopping and it's gone idle, close the + // socket. + if (this.stopped && pending === 0) { + req.socket.end(); + } + }); + }, + ); + } + + async stop(hardDestroyAbortSignal?: AbortSignal): Promise { + let gracefully = true; + + // In the off-chance that we are calling `stop` directly from within the + // HTTP server's request handler (and so we haven't gotten to the + // `connection` event yet), wait a moment so that `connection` can be called + // and this request can actually count. + await new Promise((resolve) => setImmediate(resolve)); + this.stopped = true; + + // When told to, hard-destroy everything. + const onAbort = () => { + gracefully = false; + this.requestCountPerSocket.forEach((_, socket) => socket.end()); + // (FYI, this setImmediate was cargo-culted from the original + // implementation, but we don't understand why it's here.) + setImmediate(() => { + this.requestCountPerSocket.forEach((_, socket) => socket.destroy()); + }); + }; + hardDestroyAbortSignal?.addEventListener('abort', onAbort); + + // Close the server and create a Promise that resolves when all connections + // are closed. Note that we ignore any error from `close` here. + const closePromise = new Promise((resolve) => + this.server.close(() => { + hardDestroyAbortSignal?.removeEventListener('abort', onAbort); + resolve(); + }), + ); + + // Immediately close any idle sockets. + this.requestCountPerSocket.forEach((requests, socket) => { + if (requests === 0) socket.end(); + }); + + // Wait for all connections to be closed. + await closePromise; + + return gracefully; + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/inlineTrace/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/inlineTrace/index.ts new file mode 100644 index 00000000..b150e173 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/inlineTrace/index.ts @@ -0,0 +1,156 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +import { TraceTreeBuilder } from '../traceTreeBuilder.js'; +import type { SendErrorsOptions } from '../usageReporting/index.js'; +import { internalPlugin } from '../../internalPlugin.js'; +import { schemaIsSubgraph } from '../schemaIsSubgraph.js'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; + +export interface ApolloServerPluginInlineTraceOptions { + /** + * By default, if a trace contains errors, the errors are included in the + * trace with the message ``. The errors are associated with specific + * paths in the operation, but do not include the original error message or + * any extensions such as the error `code`, as those details may contain your + * users' private data. The extension `maskedBy: + * 'ApolloServerPluginInlineTrace'` is added. + * + * If you'd like details about the error included in traces, set this option. + * This option can take several forms: + * + * - { masked: true }: mask error messages and omit extensions (DEFAULT) + * - { unmodified: true }: include all error messages and extensions + * - { transform: ... }: a custom function for transforming errors. This + * function receives a `GraphQLError` and may return a `GraphQLError` + * (either a new error, or its potentially-modified argument) or `null`. + * This error is used in the trace; if `null`, the error is not included in + * traces or error statistics. + */ + includeErrors?: SendErrorsOptions; + /** + * This option is for internal use by `@apollo/server` only. + * + * By default we want to enable this plugin for subgraph schemas only, but we + * need to come up with our list of plugins before we have necessarily loaded + * the schema. So (unless the user installs this plugin or + * ApolloServerPluginInlineTraceDisabled themselves), `@apollo/server` always + * installs this plugin and uses this option to make sure traces are only + * included if the schema appears to be a subgraph. + */ + __onlyIfSchemaIsSubgraph?: boolean; +} + +// This ftv1 plugin produces a base64'd Trace protobuf containing only the +// durationNs, startTime, endTime, and root fields. This output is placed +// on the `extensions`.`ftv1` property of the response. The Apollo Gateway +// utilizes this data to construct the full trace and submit it to Apollo's +// usage reporting ingress. +export function ApolloServerPluginInlineTrace( + options: ApolloServerPluginInlineTraceOptions = Object.create(null), +): ApolloServerPlugin { + let enabled: boolean | null = options.__onlyIfSchemaIsSubgraph ? null : true; + return internalPlugin({ + __internal_plugin_id__: 'InlineTrace', + __is_disabled_plugin__: false, + async serverWillStart({ schema, logger }) { + // Handle the case that the plugin was implicitly installed. We only want it + // to actually be active if the schema appears to be federated. If you don't + // like the log line, just install `ApolloServerPluginInlineTrace()` in + // `plugins` yourself. + if (enabled === null) { + enabled = schemaIsSubgraph(schema); + if (enabled) { + logger.info( + 'Enabling inline tracing for this subgraph. To disable, use ' + + 'ApolloServerPluginInlineTraceDisabled.', + ); + } + } + }, + async requestDidStart({ request: { http }, metrics }) { + if (!enabled) { + return; + } + + const treeBuilder = new TraceTreeBuilder({ + maskedBy: 'ApolloServerPluginInlineTrace', + sendErrors: options.includeErrors, + }); + + // XXX Provide a mechanism to customize this logic. + if (http?.headers.get('apollo-federation-include-trace') !== 'ftv1') { + return; + } + + // If some other (user-written?) plugin already decided that we are not + // capturing traces, then we should not capture traces. + if (metrics.captureTraces === false) { + return; + } + + // Note that this will override any `fieldLevelInstrumentation` parameter + // to the usage reporting plugin for requests with the + // `apollo-federation-include-trace` header set. + metrics.captureTraces = true; + + treeBuilder.startTiming(); + + return { + async executionDidStart() { + return { + willResolveField({ info }) { + return treeBuilder.willResolveField(info); + }, + }; + }, + + async didEncounterErrors({ errors }) { + treeBuilder.didEncounterErrors(errors); + }, + + async willSendResponse({ response }) { + // We record the end time at the latest possible time: right before serializing the trace. + // If we wait any longer, the time we record won't actually be sent anywhere! + treeBuilder.stopTiming(); + + // For now, we don't support inline traces on incremental delivery + // responses. (We could perhaps place the trace on the final chunk, or + // even deliver it bit by bit. For now, since Gateway does not support + // incremental delivery and Router does not pass through defers to + // subgraphs, this doesn't affect the "federated tracing" use case, + // though it does affect the ability to look at inline traces in other + // tools like Explorer. + if (response.body.kind === 'incremental') { + return; + } + + // If we're in a gateway, include the query plan (and subgraph traces) + // in the inline trace. This is designed more for manually querying + // your graph while running locally to see what the query planner is + // doing rather than for running in production. + if (metrics.queryPlanTrace) { + treeBuilder.trace.queryPlan = metrics.queryPlanTrace; + } + + const encodedUint8Array = Trace.encode(treeBuilder.trace).finish(); + const encodedBuffer = Buffer.from( + encodedUint8Array, + encodedUint8Array.byteOffset, + encodedUint8Array.byteLength, + ); + + const extensions = + response.body.singleResult.extensions || + (response.body.singleResult.extensions = Object.create(null)); + + // This should only happen if another plugin is using the same name- + // space within the `extensions` object and got to it before us. + if (typeof extensions.ftv1 !== 'undefined') { + throw new Error('The `ftv1` extension was already present.'); + } + + extensions.ftv1 = encodedBuffer.toString('base64'); + }, + }; + }, + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/getEmbeddedHTML.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/getEmbeddedHTML.ts new file mode 100644 index 00000000..475a7716 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/getEmbeddedHTML.ts @@ -0,0 +1,204 @@ +import type { + ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions, + ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions, +} from './types'; + +// This function turns an object into a string and replaces +// <, >, &, ' with their unicode chars to avoid adding html tags to +// the landing page html that might be passed from the config. +// The only place these characters can appear in the output of +// JSON.stringify is within string literals, where they can equally +// well appear \u-escaped. This specifically means that +// `` won't terminate the script block early. +// (Perhaps we should have done this instead of the triple-encoding +// of encodeConfig for the main landing page.) +function getConfigStringForHtml(config: object) { + return JSON.stringify(config) + .replace('<', '\\u003c') + .replace('>', '\\u003e') + .replace('&', '\\u0026') + .replace("'", '\\u0027'); +} + +export const getEmbeddedExplorerHTML = ( + explorerCdnVersion: string, + config: ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions, + apolloServerVersion: string, + nonce: string, +) => { + interface EmbeddableExplorerOptions { + graphRef: string; + target: string; + + initialState?: { + document?: string; + variables?: Record; + headers?: Record; + collectionId?: string; + operationId?: string; + displayOptions: { + docsPanelState?: 'open' | 'closed'; // default to 'open', + showHeadersAndEnvVars?: boolean; // default to `false` + theme?: 'dark' | 'light'; + }; + }; + persistExplorerState?: boolean; // defaults to 'false' + + endpointUrl: string; + + includeCookies?: boolean; // defaults to 'false' + + runTelemetry?: boolean; + + allowDynamicStyles?: boolean; // defaults to 'true' + } + const productionLandingPageEmbedConfigOrDefault = { + displayOptions: {}, + persistExplorerState: false, + runTelemetry: true, + ...(typeof config.embed === 'boolean' ? {} : config.embed), + }; + const embeddedExplorerParams: Omit< + EmbeddableExplorerOptions, + 'endpointUrl' + > & { runtime: string } = { + graphRef: config.graphRef, + target: '#embeddableExplorer', + initialState: { + ...('document' in config || 'headers' in config || 'variables' in config + ? { + document: config.document, + headers: config.headers, + variables: config.variables, + } + : {}), + ...('collectionId' in config + ? { + collectionId: config.collectionId, + operationId: config.operationId, + } + : {}), + displayOptions: { + ...productionLandingPageEmbedConfigOrDefault.displayOptions, + }, + }, + persistExplorerState: + productionLandingPageEmbedConfigOrDefault.persistExplorerState, + includeCookies: config.includeCookies, + runtime: apolloServerVersion, + runTelemetry: productionLandingPageEmbedConfigOrDefault.runTelemetry, + allowDynamicStyles: false, // disabled for CSP - we add the iframe styles ourselves instead + }; + + return ` +
+

Welcome to Apollo Server

+

Apollo Explorer cannot be loaded; it appears that you might be offline.

+
+ +
+ + +`; +}; + +export const getEmbeddedSandboxHTML = ( + sandboxCdnVersion: string, + config: ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions, + apolloServerVersion: string, + nonce: string, +) => { + const localDevelopmentEmbedConfigOrDefault = { + runTelemetry: true, + endpointIsEditable: false, + initialState: {}, + ...(typeof config.embed === 'boolean' ? {} : (config.embed ?? {})), + }; + const embeddedSandboxConfig = { + target: '#embeddableSandbox', + initialState: { + ...('document' in config || 'headers' in config || 'variables' in config + ? { + document: config.document, + variables: config.variables, + headers: config.headers, + } + : {}), + ...('collectionId' in config + ? { + collectionId: config.collectionId, + operationId: config.operationId, + } + : {}), + includeCookies: config.includeCookies, + ...localDevelopmentEmbedConfigOrDefault.initialState, + }, + hideCookieToggle: false, + endpointIsEditable: localDevelopmentEmbedConfigOrDefault.endpointIsEditable, + runtime: apolloServerVersion, + runTelemetry: localDevelopmentEmbedConfigOrDefault.runTelemetry, + allowDynamicStyles: false, // disabled for CSP - we add the iframe styles ourselves instead + }; + return ` +
+

Welcome to Apollo Server

+

Apollo Sandbox cannot be loaded; it appears that you might be offline.

+
+ +
+ + +`; +}; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/index.ts new file mode 100644 index 00000000..e1c73fe1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/index.ts @@ -0,0 +1,220 @@ +import type { + ApolloServerPlugin, + BaseContext, +} from '../../../externalTypes/index.js'; +import type { ImplicitlyInstallablePlugin } from '../../../ApolloServer.js'; +import type { + ApolloServerPluginLandingPageLocalDefaultOptions, + ApolloServerPluginLandingPageProductionDefaultOptions, + LandingPageConfig, +} from './types.js'; +import { + getEmbeddedExplorerHTML, + getEmbeddedSandboxHTML, +} from './getEmbeddedHTML.js'; +import { packageVersion } from '../../../generated/packageVersion.js'; +import { createHash } from '@apollo/utils.createhash'; + +export type { + ApolloServerPluginLandingPageLocalDefaultOptions, + ApolloServerPluginLandingPageProductionDefaultOptions, +}; + +export function ApolloServerPluginLandingPageLocalDefault( + options: ApolloServerPluginLandingPageLocalDefaultOptions = {}, +): ApolloServerPlugin { + const { version, __internal_apolloStudioEnv__, ...rest } = { + // we default to Sandbox unless embed is specified as false + embed: true as const, + ...options, + }; + return ApolloServerPluginLandingPageDefault(version, { + isProd: false, + apolloStudioEnv: __internal_apolloStudioEnv__, + ...rest, + }); +} + +export function ApolloServerPluginLandingPageProductionDefault( + options: ApolloServerPluginLandingPageProductionDefaultOptions = {}, +): ApolloServerPlugin { + const { version, __internal_apolloStudioEnv__, ...rest } = options; + return ApolloServerPluginLandingPageDefault(version, { + isProd: true, + apolloStudioEnv: __internal_apolloStudioEnv__, + ...rest, + }); +} + +// A triple encoding! Wow! First we use JSON.stringify to turn our object into a +// string. Then we encodeURIComponent so we don't have to stress about what +// would happen if the config contained ``. Finally, we JSON.stringify +// it again, which in practice just wraps it in a pair of double quotes (since +// there shouldn't be any backslashes left after encodeURIComponent). The +// consumer of this needs to decodeURIComponent and then JSON.parse; there's +// only one JSON.parse because the outermost JSON string is parsed by the JS +// parser itself. +function encodeConfig(config: LandingPageConfig): string { + return JSON.stringify(encodeURIComponent(JSON.stringify(config))); +} + +const getNonEmbeddedLandingPageHTML = ( + cdnVersion: string, + config: LandingPageConfig, + apolloServerVersion: string, + nonce: string, +) => { + const encodedConfig = encodeConfig(config); + + return ` +
+

Welcome to Apollo Server

+

The full landing page cannot be loaded; it appears that you might be offline.

+
+ +`; +}; + +export const DEFAULT_EMBEDDED_EXPLORER_VERSION = 'v3'; +export const DEFAULT_EMBEDDED_SANDBOX_VERSION = 'v2'; +export const DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION = '_latest'; + +// Helper for the two actual plugin functions. +function ApolloServerPluginLandingPageDefault( + maybeVersion: string | undefined, + config: LandingPageConfig & { + isProd: boolean; + apolloStudioEnv: 'staging' | 'prod' | undefined; + }, +): ImplicitlyInstallablePlugin { + const explorerVersion = maybeVersion ?? DEFAULT_EMBEDDED_EXPLORER_VERSION; + const sandboxVersion = maybeVersion ?? DEFAULT_EMBEDDED_SANDBOX_VERSION; + const apolloServerLandingPageVersion = + maybeVersion ?? DEFAULT_APOLLO_SERVER_LANDING_PAGE_VERSION; + const apolloServerVersion = `@apollo/server@${packageVersion}`; + + const scriptSafeList = [ + 'https://apollo-server-landing-page.cdn.apollographql.com', + 'https://embeddable-sandbox.cdn.apollographql.com', + 'https://embeddable-explorer.cdn.apollographql.com', + ].join(' '); + const styleSafeList = [ + 'https://apollo-server-landing-page.cdn.apollographql.com', + 'https://embeddable-sandbox.cdn.apollographql.com', + 'https://embeddable-explorer.cdn.apollographql.com', + 'https://fonts.googleapis.com', + ].join(' '); + const iframeSafeList = [ + 'https://explorer.embed.apollographql.com', + 'https://sandbox.embed.apollographql.com', + 'https://embed.apollo.local:3000', + ].join(' '); + + return { + __internal_installed_implicitly__: false, + async serverWillStart() { + return { + async renderLandingPage() { + const encodedASLandingPageVersion = encodeURIComponent( + apolloServerLandingPageVersion, + ); + async function html() { + const nonce = createHash('sha256') + .update(crypto.randomUUID()) + .digest('hex'); + const scriptCsp = `script-src 'self' 'nonce-${nonce}' ${scriptSafeList}`; + const styleCsp = `style-src 'nonce-${nonce}' ${styleSafeList}`; + const imageCsp = `img-src https://apollo-server-landing-page.cdn.apollographql.com`; + const manifestCsp = `manifest-src https://apollo-server-landing-page.cdn.apollographql.com`; + const frameCsp = `frame-src ${iframeSafeList}`; + return ` + + + + + + + + + + + + + + Apollo Server + + + +
+ + ${ + config.embed + ? 'graphRef' in config && config.graphRef + ? getEmbeddedExplorerHTML( + explorerVersion, + config, + apolloServerVersion, + nonce, + ) + : !('graphRef' in config) + ? getEmbeddedSandboxHTML( + sandboxVersion, + config, + apolloServerVersion, + nonce, + ) + : getNonEmbeddedLandingPageHTML( + apolloServerLandingPageVersion, + config, + apolloServerVersion, + nonce, + ) + : getNonEmbeddedLandingPageHTML( + apolloServerLandingPageVersion, + config, + apolloServerVersion, + nonce, + ) + } +
+ + + `; + } + return { html }; + }, + }; + }, + }; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/types.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/types.ts new file mode 100644 index 00000000..ddf1ea50 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/landingPage/default/types.ts @@ -0,0 +1,198 @@ +type InitialDocumentVariablesHeaders = { + /** + * Users can configure their landing page to link to Studio Explorer with a + * document loaded in the UI. + */ + document?: string; + /** + * Users can configure their landing page to link to Studio Explorer with + * variables loaded in the UI. + */ + variables?: Record; + + /** + * Users can configure their landing page to link to Studio Explorer with + * headers loaded in the UI. + */ + headers?: Record; + collectionId?: never; + operationId?: never; +}; + +type InitialStateForEmbeds = + | { + /** + * The ID of a collection, paired with an operation ID to populate in the Sandbox on load. + * + * You can find these values from a registered graph in Studio by + * clicking the ... menu next to an operation in the Explorer of that graph and + * selecting View operation details. + */ + collectionId: string; + operationId: string; + document?: never; + variables?: never; + headers?: never; + } + | InitialDocumentVariablesHeaders; + +export type ApolloServerPluginLandingPageDefaultBaseOptions = { + /** + * Specify the major version of the landing page to use, i.e v2 or + * provide a specific commit from the + * [embeddable explorer](https://github.com/apollographql/embeddable-explorer) + * repo. + * We also support a `latest` tag but don't recommend using it + * as it's subject to major version updates. + */ + version?: string; + /** + * Set to false to suppress the footer which explains how to configure the + * landing page. + */ + footer?: boolean; + + includeCookies?: boolean; + + // For Apollo use only. + __internal_apolloStudioEnv__?: 'staging' | 'prod'; +}; + +export type ApolloServerPluginNonEmbeddedLandingPageLocalDefaultOptions = + ApolloServerPluginLandingPageDefaultBaseOptions & + InitialDocumentVariablesHeaders & { + /** + * Users can configure their landing page to render an embedded Explorer if + * given a graphRef, or an embedded Sandbox if there is no graphRef provided. + */ + embed: false; + }; + +export type ApolloServerPluginNonEmbeddedLandingPageProductionDefaultOptions = + ApolloServerPluginLandingPageDefaultBaseOptions & + InitialDocumentVariablesHeaders & { + /** + * If specified, provide a link (with opt-in auto-redirect) to the Studio page + * for the given graphRef. (You need to explicitly pass this here rather than + * relying on the server's ApolloConfig, because if your server is publicly + * accessible you may not want to display the graph ref publicly.) + */ + graphRef?: string; + /** + * Users can configure their landing page to render an embedded Explorer if + * given a graphRef, or an embedded Sandbox if there is no graphRef provided. + */ + embed?: false; + }; + +export type ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions = + ApolloServerPluginLandingPageDefaultBaseOptions & { + /** + * Users can configure their landing page to render an embedded Explorer if + * given a graphRef, or an embedded Sandbox if there is no graphRef provided. + */ + embed?: true | EmbeddableSandboxOptions; + } & (InitialDocumentVariablesHeaders | InitialStateForEmbeds); + +export type ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions = + ApolloServerPluginLandingPageDefaultBaseOptions & { + /** + * Use this registered's graphs schema to populate the embedded Explorer. + * Required if passing `embed: true` + */ + graphRef: string; + /** + * Users can configure their landing page to render an embedded Explorer. + */ + embed: true | EmbeddableExplorerOptions; + } & InitialStateForEmbeds; + +type EmbeddableSandboxOptions = { + /** + * Set to false to disable running telemetry in Apollo Studio from the landing pages. + */ + runTelemetry?: boolean; + initialState?: { + /** + * If true, the embedded Sandbox periodically polls your initialEndpoint for schema updates. + * + * The default value is true. + */ + pollForSchemaUpdates?: boolean; + /** + * Headers that are applied by default to every operation executed by the landing page's Sandbox. + * Users can disable the application of these headers, but they can't modify their values. + * + * The landing page's Sandbox always includes these headers in its introspection queries + * to your endpoint. + */ + // TODO(as5): We currently have `headers` at the top level and `embed.initialState.sharedHeaders` + // at this level. Shared headers populate introspection headers in Sandbox, while `headers` just + // adds headers to your default tab. We should consider changing the behavior such that `headers` + // at the base level populates shared headers as well. + sharedHeaders?: Record; + }; + /** + * By default, the Apollo Server embedded Sandbox has a url input box that is not editable by users. + * + * Set `endpointIsEditable` to `true` to enable users of your + * Apollo Server landing page to change the endpoint url. + */ + endpointIsEditable?: boolean; +}; + +type EmbeddableExplorerOptions = { + /** + * Set to false to disable running telemetry in Apollo Studio from the landing pages. + */ + runTelemetry?: boolean; + /** + * Display options can be configured for the embedded Explorer. + */ + displayOptions?: { + /** + * If true, the embedded Explorer includes the panels for setting + * request headers and environment variables. + * If false, those panels are not present. + * + * The default value is true. + */ + showHeadersAndEnvVars: boolean; + /** + * If open, the Explorer's Documentation panel (the left column) is + * initially expanded. If closed, the panel is initially collapsed. + * + * The default value is open. + */ + docsPanelState: 'open' | 'closed'; + /** + * If dark, the Explorer's dark theme is used. If light, the light theme is used. + * + * The default value is dark. + */ + theme: 'light' | 'dark'; + }; + /** + * If true, the embedded Explorer uses localStorage to persist its state + * (including operations, tabs, variables, and headers) between user sessions. + * This state is automatically populated in the Explorer on page load. + * + * If false, the embedded Explorer loads with an example query + * based on your schema (unless you provide document). + * + * The default value is false. + */ + persistExplorerState?: boolean; +}; + +export type ApolloServerPluginLandingPageLocalDefaultOptions = + | ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions + | ApolloServerPluginNonEmbeddedLandingPageLocalDefaultOptions; + +export type ApolloServerPluginLandingPageProductionDefaultOptions = + | ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions + | ApolloServerPluginNonEmbeddedLandingPageProductionDefaultOptions; + +export type LandingPageConfig = + | ApolloServerPluginLandingPageLocalDefaultOptions + | ApolloServerPluginLandingPageProductionDefaultOptions; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaIsSubgraph.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaIsSubgraph.ts new file mode 100644 index 00000000..fdc3b95a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaIsSubgraph.ts @@ -0,0 +1,41 @@ +import { + type GraphQLSchema, + isObjectType, + isScalarType, + isNonNullType, +} from 'graphql'; + +// Returns true if it appears that the schema was appears to be of a subgraph +// (eg, returned from @apollo/subgraph's buildSubgraphSchema). This strategy +// avoids depending explicitly on @apollo/subgraph or relying on something that +// might not survive transformations like monkey-patching a boolean field onto +// the schema. +// +// This is used for two things: +// 1) Determining whether traces should be added to responses if requested with +// an HTTP header. If you want to include these traces even for non-subgraphs +// (when requested via header, eg for Apollo Explorer's trace view) you can +// use ApolloServerPluginInlineTrace explicitly; if you want to never include +// these traces even for subgraphs you can use +// ApolloServerPluginInlineTraceDisabled. +// 2) Determining whether schema-reporting should be allowed; subgraphs cannot +// report schemas, and we accordingly throw if it's attempted. +export function schemaIsSubgraph(schema: GraphQLSchema): boolean { + const serviceType = schema.getType('_Service'); + if (!isObjectType(serviceType)) { + return false; + } + const sdlField = serviceType.getFields().sdl; + if (!sdlField) { + return false; + } + + let sdlFieldType = sdlField.type; + if (isNonNullType(sdlFieldType)) { + sdlFieldType = sdlFieldType.ofType; + } + if (!isScalarType(sdlFieldType)) { + return false; + } + return sdlFieldType.name == 'String'; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/generated/operations.d.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/generated/operations.d.ts new file mode 100644 index 00000000..21c764af --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/generated/operations.d.ts @@ -0,0 +1,18359 @@ +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + Blob: { input: any; output: any; } + Cursor: { input: any; output: any; } + Date: { input: any; output: any; } + DateTime: { input: any; output: any; } + FederationVersion: { input: any; output: any; } + GraphQLDocument: { input: any; output: any; } + JSON: { input: any; output: any; } + Long: { input: any; output: any; } + NaiveDateTime: { input: any; output: any; } + Object: { input: any; output: any; } + SHA256: { input: any; output: any; } + StringOrInt: { input: any; output: any; } + Timestamp: { input: any; output: any; } + Void: { input: any; output: any; } +}; + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type Account = { + __typename?: 'Account'; + auditLogExports?: Maybe>; + /** These are the roles that the account is able to use */ + availableRoles: Array; + /** + * Get an URL to which an avatar image can be uploaded. Client uploads by sending a PUT request + * with the image data to MediaUploadInfo.url. Client SHOULD set the "Content-Type" header to the + * browser-inferred MIME type, and SHOULD set the "x-apollo-content-filename" header to the + * filename, if such information is available. Client MUST set the "x-apollo-csrf-token" header to + * MediaUploadInfo.csrfToken. + */ + avatarUpload?: Maybe; + /** + * Get an image URL for the account's avatar. Note that CORS is not enabled for these URLs. The size + * argument is used for bandwidth reduction, and should be the size of the image as displayed in the + * application. Apollo's media server will downscale larger images to at least the requested size, + * but this will not happen for third-party media servers. + */ + avatarUrl?: Maybe; + billingContactEmail?: Maybe; + billingInfo?: Maybe; + billingInsights: BillingInsights; + capabilities?: Maybe; + /** Fetch a CloudOnboarding associated with this account */ + cloudOnboarding?: Maybe; + companyUrl?: Maybe; + /** The time at which the account was created */ + createdAt?: Maybe; + currentBillingMonth?: Maybe; + currentPlan: BillingPlan; + currentSubscription?: Maybe; + eligibleForUsageBasedPlan: Scalars['Boolean']['output']; + expiredTrialDismissedAt?: Maybe; + expiredTrialSubscription?: Maybe; + graphIDAvailable: Scalars['Boolean']['output']; + /** Graphs belonging to this organization. */ + graphs: Array; + /** Graphs belonging to this organization. */ + graphsConnection?: Maybe; + hasBeenOnTrial: Scalars['Boolean']['output']; + hasBillingInfo?: Maybe; + /** Globally unique identifier, which isn't guaranteed stable (can be changed by administrators). */ + id: Scalars['ID']['output']; + /** + * Internal immutable identifier for the account. Only visible to Apollo admins (because it really + * shouldn't be used in normal client apps). + */ + internalID: Scalars['ID']['output']; + invitations?: Maybe>; + invoices: Array; + isLocked?: Maybe; + isOnExpiredTrial: Scalars['Boolean']['output']; + isOnTrial: Scalars['Boolean']['output']; + isSelfServiceDeletable?: Maybe; + limits?: Maybe; + lockDetails?: Maybe; + /** The user memberships belonging to an Organization */ + memberships?: Maybe>; + /** Name of the organization, which can change over time and isn't unique. */ + name: Scalars['String']['output']; + /** + * Fetches an offline license for the account. + * (If you need this then please contact your Apollo account manager to discuss your requirements.) + */ + offlineLicense?: Maybe; + /** + * Fetches usage based pricing operations counts for the calling user. If a particular window is not specified, + * totals for the user's current billing period are returned. (Will error if the user is not currently on a usage + * based plan.) + */ + operationUsage: AccountOperationUsage; + /** List the private subgraphs associated with your Apollo account */ + privateSubgraphs: Array; + /** @deprecated use Account.createdAt instead */ + provisionedAt?: Maybe; + /** Returns a different registry related stats pertaining to this account. */ + registryStatsWindow?: Maybe; + requests?: Maybe; + requestsInCurrentBillingPeriod?: Maybe; + roles?: Maybe; + routerEntitlement?: Maybe; + /** How many seats would be included in your next bill, as best estimated today */ + seatCountForNextBill?: Maybe; + seats?: Maybe; + secondaryIDs: Array; + /** + * Graphs belonging to this organization. + * @deprecated Use graphs field instead + */ + services: Array; + /** The session length in seconds for a user in this org */ + sessionDurationInSeconds?: Maybe; + /** + * If non-null, this organization tracks its members through an upstream IdP; + * invitations are not possible on SSO-synchronized account. + */ + sso?: Maybe; + ssoV2?: Maybe; + /** @deprecated no longer relevant; it's only ever populated for enterprise accounts */ + state?: Maybe; + /** A list of reusable invitations for the organization. */ + staticInvitations?: Maybe>; + /** @deprecated use Account.statsWindow instead */ + stats: AccountStatsWindow; + statsWindow?: Maybe; + subscriptions: Array; + /** Gets a ticket for this org, by id */ + supportTicket?: Maybe; + /** List of support tickets submitted for this org */ + supportTickets?: Maybe>; + survey?: Maybe; + /** + * All Variants within the Graphs belonging to this organization. Can be limited to those favorited by the current user. + * @deprecated use Service.variants instead + */ + variants?: Maybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountAvatarUrlArgs = { + size?: Scalars['Int']['input']; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountBillingInsightsArgs = { + from: Scalars['Date']['input']; + limit?: InputMaybe; + to?: InputMaybe; + windowSize?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountCloudOnboardingArgs = { + graphRef: Scalars['String']['input']; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountGraphIdAvailableArgs = { + id: Scalars['ID']['input']; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountGraphsArgs = { + filterBy?: InputMaybe; + includeDeleted?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountGraphsConnectionArgs = { + after?: InputMaybe; + before?: InputMaybe; + filterBy?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountInvitationsArgs = { + includeAccepted?: Scalars['Boolean']['input']; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountOperationUsageArgs = { + forWindow?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountPrivateSubgraphsArgs = { + cloudProvider: CloudProvider; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountRegistryStatsWindowArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountRequestsArgs = { + from: Scalars['Timestamp']['input']; + to: Scalars['Timestamp']['input']; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountServicesArgs = { + includeDeleted?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountStatsArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountStatsWindowArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountSupportTicketArgs = { + id: Scalars['ID']['input']; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountSurveyArgs = { + id: Scalars['String']['input']; +}; + + +/** An organization in Apollo Studio. Can have multiple members and graphs. */ +export type AccountVariantsArgs = { + filterBy?: InputMaybe; +}; + +/** Columns of AccountBillingUsageStats. */ +export enum AccountBillingUsageStatsColumn { + AGENT_ID = 'AGENT_ID', + AGENT_VERSION = 'AGENT_VERSION', + GRAPH_DEPLOYMENT_TYPE = 'GRAPH_DEPLOYMENT_TYPE', + OPERATION_COUNT = 'OPERATION_COUNT', + OPERATION_COUNT_PROVIDED_EXPLICITLY = 'OPERATION_COUNT_PROVIDED_EXPLICITLY', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + ROUTER_FEATURES_ENABLED = 'ROUTER_FEATURES_ENABLED', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountBillingUsageStatsDimensions = { + __typename?: 'AccountBillingUsageStatsDimensions'; + agentId?: Maybe; + agentVersion?: Maybe; + graphDeploymentType?: Maybe; + operationCountProvidedExplicitly?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + routerFeaturesEnabled?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountBillingUsageStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountBillingUsageStatsFilter = { + /** Selects rows whose agentId dimension equals the given value if not null. To query for the null value, use {in: {agentId: [null]}} instead. */ + agentId?: InputMaybe; + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose graphDeploymentType dimension equals the given value if not null. To query for the null value, use {in: {graphDeploymentType: [null]}} instead. */ + graphDeploymentType?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationCountProvidedExplicitly dimension equals the given value if not null. To query for the null value, use {in: {operationCountProvidedExplicitly: [null]}} instead. */ + operationCountProvidedExplicitly?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose routerFeaturesEnabled dimension equals the given value if not null. To query for the null value, use {in: {routerFeaturesEnabled: [null]}} instead. */ + routerFeaturesEnabled?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountBillingUsageStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountBillingUsageStatsFilterIn = { + /** Selects rows whose agentId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentId?: InputMaybe>>; + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose graphDeploymentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + graphDeploymentType?: InputMaybe>>; + /** Selects rows whose operationCountProvidedExplicitly dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationCountProvidedExplicitly?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose routerFeaturesEnabled dimension is in the given list. A null value in the list means a row with null for that dimension. */ + routerFeaturesEnabled?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountBillingUsageStatsMetrics = { + __typename?: 'AccountBillingUsageStatsMetrics'; + operationCount: Scalars['Long']['output']; +}; + +export type AccountBillingUsageStatsOrderBySpec = { + column: AccountBillingUsageStatsColumn; + direction: Ordering; +}; + +export type AccountBillingUsageStatsRecord = { + __typename?: 'AccountBillingUsageStatsRecord'; + /** Dimensions of AccountBillingUsageStats that can be grouped by. */ + groupBy: AccountBillingUsageStatsDimensions; + /** Metrics of AccountBillingUsageStats that can be aggregated over. */ + metrics: AccountBillingUsageStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type AccountCapabilities = { + __typename?: 'AccountCapabilities'; + clientVersions: Scalars['Boolean']['output']; + clients: Scalars['Boolean']['output']; + cloudGraphs: Scalars['Boolean']['output']; + connectorsInRouter: Scalars['Boolean']['output']; + contracts: Scalars['Boolean']['output']; + customSessionLengths: Scalars['Boolean']['output']; + datadog: Scalars['Boolean']['output']; + federation: Scalars['Boolean']['output']; + launches: Scalars['Boolean']['output']; + linting: Scalars['Boolean']['output']; + metrics: Scalars['Boolean']['output']; + notifications: Scalars['Boolean']['output']; + operationRegistry: Scalars['Boolean']['output']; + persistedQueries: Scalars['Boolean']['output']; + proposals: Scalars['Boolean']['output']; + schemaValidation: Scalars['Boolean']['output']; + sso: Scalars['Boolean']['output']; + traces: Scalars['Boolean']['output']; + userRoles: Scalars['Boolean']['output']; + webhooks: Scalars['Boolean']['output']; +}; + +/** Columns of AccountCardinalityStats. */ +export enum AccountCardinalityStatsColumn { + CLIENT_NAME_CARDINALITY = 'CLIENT_NAME_CARDINALITY', + CLIENT_VERSION_CARDINALITY = 'CLIENT_VERSION_CARDINALITY', + OPERATION_SHAPE_CARDINALITY = 'OPERATION_SHAPE_CARDINALITY', + SCHEMA_COORDINATE_CARDINALITY = 'SCHEMA_COORDINATE_CARDINALITY', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountCardinalityStatsDimensions = { + __typename?: 'AccountCardinalityStatsDimensions'; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountCardinalityStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountCardinalityStatsFilter = { + and?: InputMaybe>; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountCardinalityStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountCardinalityStatsFilterIn = { + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountCardinalityStatsMetrics = { + __typename?: 'AccountCardinalityStatsMetrics'; + clientNameCardinality: Scalars['Float']['output']; + clientVersionCardinality: Scalars['Float']['output']; + operationShapeCardinality: Scalars['Float']['output']; + schemaCoordinateCardinality: Scalars['Float']['output']; +}; + +export type AccountCardinalityStatsOrderBySpec = { + column: AccountCardinalityStatsColumn; + direction: Ordering; +}; + +export type AccountCardinalityStatsRecord = { + __typename?: 'AccountCardinalityStatsRecord'; + /** Dimensions of AccountCardinalityStats that can be grouped by. */ + groupBy: AccountCardinalityStatsDimensions; + /** Metrics of AccountCardinalityStats that can be aggregated over. */ + metrics: AccountCardinalityStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type AccountChecksStatsMetrics = { + __typename?: 'AccountChecksStatsMetrics'; + totalFailedChecks: Scalars['Long']['output']; + totalSuccessfulChecks: Scalars['Long']['output']; +}; + +export type AccountChecksStatsRecord = { + __typename?: 'AccountChecksStatsRecord'; + id: Scalars['ID']['output']; + metrics: AccountChecksStatsMetrics; + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountCoordinateUsage. */ +export enum AccountCoordinateUsageColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + KIND = 'KIND', + NAMED_ATTRIBUTE = 'NAMED_ATTRIBUTE', + NAMED_TYPE = 'NAMED_TYPE', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REQUEST_COUNT_NULL = 'REQUEST_COUNT_NULL', + REQUEST_COUNT_UNDEFINED = 'REQUEST_COUNT_UNDEFINED', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountCoordinateUsageDimensions = { + __typename?: 'AccountCoordinateUsageDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + kind?: Maybe; + namedAttribute?: Maybe; + namedType?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountCoordinateUsage. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountCoordinateUsageFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + /** Selects rows whose kind dimension equals the given value if not null. To query for the null value, use {in: {kind: [null]}} instead. */ + kind?: InputMaybe; + /** Selects rows whose namedAttribute dimension equals the given value if not null. To query for the null value, use {in: {namedAttribute: [null]}} instead. */ + namedAttribute?: InputMaybe; + /** Selects rows whose namedType dimension equals the given value if not null. To query for the null value, use {in: {namedType: [null]}} instead. */ + namedType?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountCoordinateUsage. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountCoordinateUsageFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose kind dimension is in the given list. A null value in the list means a row with null for that dimension. */ + kind?: InputMaybe>>; + /** Selects rows whose namedAttribute dimension is in the given list. A null value in the list means a row with null for that dimension. */ + namedAttribute?: InputMaybe>>; + /** Selects rows whose namedType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + namedType?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountCoordinateUsageMetrics = { + __typename?: 'AccountCoordinateUsageMetrics'; + estimatedExecutionCount: Scalars['Long']['output']; + executionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; + requestCountNull: Scalars['Long']['output']; + requestCountUndefined: Scalars['Long']['output']; +}; + +export type AccountCoordinateUsageOrderBySpec = { + column: AccountCoordinateUsageColumn; + direction: Ordering; +}; + +export type AccountCoordinateUsageRecord = { + __typename?: 'AccountCoordinateUsageRecord'; + /** Dimensions of AccountCoordinateUsage that can be grouped by. */ + groupBy: AccountCoordinateUsageDimensions; + /** Metrics of AccountCoordinateUsage that can be aggregated over. */ + metrics: AccountCoordinateUsageMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountEdgeServerInfos. */ +export enum AccountEdgeServerInfosColumn { + BOOT_ID = 'BOOT_ID', + EXECUTABLE_SCHEMA_ID = 'EXECUTABLE_SCHEMA_ID', + LIBRARY_VERSION = 'LIBRARY_VERSION', + PLATFORM = 'PLATFORM', + RUNTIME_VERSION = 'RUNTIME_VERSION', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVER_ID = 'SERVER_ID', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + USER_VERSION = 'USER_VERSION' +} + +export type AccountEdgeServerInfosDimensions = { + __typename?: 'AccountEdgeServerInfosDimensions'; + bootId?: Maybe; + executableSchemaId?: Maybe; + libraryVersion?: Maybe; + platform?: Maybe; + runtimeVersion?: Maybe; + schemaTag?: Maybe; + serverId?: Maybe; + serviceId?: Maybe; + userVersion?: Maybe; +}; + +/** Filter for data in AccountEdgeServerInfos. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountEdgeServerInfosFilter = { + and?: InputMaybe>; + /** Selects rows whose bootId dimension equals the given value if not null. To query for the null value, use {in: {bootId: [null]}} instead. */ + bootId?: InputMaybe; + /** Selects rows whose executableSchemaId dimension equals the given value if not null. To query for the null value, use {in: {executableSchemaId: [null]}} instead. */ + executableSchemaId?: InputMaybe; + in?: InputMaybe; + /** Selects rows whose libraryVersion dimension equals the given value if not null. To query for the null value, use {in: {libraryVersion: [null]}} instead. */ + libraryVersion?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose platform dimension equals the given value if not null. To query for the null value, use {in: {platform: [null]}} instead. */ + platform?: InputMaybe; + /** Selects rows whose runtimeVersion dimension equals the given value if not null. To query for the null value, use {in: {runtimeVersion: [null]}} instead. */ + runtimeVersion?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serverId dimension equals the given value if not null. To query for the null value, use {in: {serverId: [null]}} instead. */ + serverId?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose userVersion dimension equals the given value if not null. To query for the null value, use {in: {userVersion: [null]}} instead. */ + userVersion?: InputMaybe; +}; + +/** Filter for data in AccountEdgeServerInfos. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountEdgeServerInfosFilterIn = { + /** Selects rows whose bootId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + bootId?: InputMaybe>>; + /** Selects rows whose executableSchemaId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + executableSchemaId?: InputMaybe>>; + /** Selects rows whose libraryVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + libraryVersion?: InputMaybe>>; + /** Selects rows whose platform dimension is in the given list. A null value in the list means a row with null for that dimension. */ + platform?: InputMaybe>>; + /** Selects rows whose runtimeVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + runtimeVersion?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serverId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serverId?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose userVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + userVersion?: InputMaybe>>; +}; + +export type AccountEdgeServerInfosOrderBySpec = { + column: AccountEdgeServerInfosColumn; + direction: Ordering; +}; + +export type AccountEdgeServerInfosRecord = { + __typename?: 'AccountEdgeServerInfosRecord'; + /** Dimensions of AccountEdgeServerInfos that can be grouped by. */ + groupBy: AccountEdgeServerInfosDimensions; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountErrorStats. */ +export enum AccountErrorStatsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ERRORS_COUNT = 'ERRORS_COUNT', + PATH = 'PATH', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountErrorStatsDimensions = { + __typename?: 'AccountErrorStatsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + path?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountErrorStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountErrorStatsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose path dimension equals the given value if not null. To query for the null value, use {in: {path: [null]}} instead. */ + path?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountErrorStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountErrorStatsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose path dimension is in the given list. A null value in the list means a row with null for that dimension. */ + path?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountErrorStatsMetrics = { + __typename?: 'AccountErrorStatsMetrics'; + errorsCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; +}; + +export type AccountErrorStatsOrderBySpec = { + column: AccountErrorStatsColumn; + direction: Ordering; +}; + +export type AccountErrorStatsRecord = { + __typename?: 'AccountErrorStatsRecord'; + /** Dimensions of AccountErrorStats that can be grouped by. */ + groupBy: AccountErrorStatsDimensions; + /** Metrics of AccountErrorStats that can be aggregated over. */ + metrics: AccountErrorStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountFederatedErrorStats. */ +export enum AccountFederatedErrorStatsColumn { + AGENT_VERSION = 'AGENT_VERSION', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ERROR_CODE = 'ERROR_CODE', + ERROR_COUNT = 'ERROR_COUNT', + ERROR_PATH = 'ERROR_PATH', + ERROR_SERVICE = 'ERROR_SERVICE', + OPERATION_ID = 'OPERATION_ID', + OPERATION_NAME = 'OPERATION_NAME', + OPERATION_TYPE = 'OPERATION_TYPE', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + SEVERITY = 'SEVERITY', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountFederatedErrorStatsDimensions = { + __typename?: 'AccountFederatedErrorStatsDimensions'; + agentVersion?: Maybe; + clientName?: Maybe; + clientVersion?: Maybe; + errorCode?: Maybe; + errorPath?: Maybe; + errorService?: Maybe; + operationId?: Maybe; + operationName?: Maybe; + operationType?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + severity?: Maybe; +}; + +/** Filter for data in AccountFederatedErrorStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountFederatedErrorStatsFilter = { + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose errorCode dimension equals the given value if not null. To query for the null value, use {in: {errorCode: [null]}} instead. */ + errorCode?: InputMaybe; + /** Selects rows whose errorPath dimension equals the given value if not null. To query for the null value, use {in: {errorPath: [null]}} instead. */ + errorPath?: InputMaybe; + /** Selects rows whose errorService dimension equals the given value if not null. To query for the null value, use {in: {errorService: [null]}} instead. */ + errorService?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationId dimension equals the given value if not null. To query for the null value, use {in: {operationId: [null]}} instead. */ + operationId?: InputMaybe; + /** Selects rows whose operationName dimension equals the given value if not null. To query for the null value, use {in: {operationName: [null]}} instead. */ + operationName?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose severity dimension equals the given value if not null. To query for the null value, use {in: {severity: [null]}} instead. */ + severity?: InputMaybe; +}; + +/** Filter for data in AccountFederatedErrorStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountFederatedErrorStatsFilterIn = { + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose errorCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorCode?: InputMaybe>>; + /** Selects rows whose errorPath dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorPath?: InputMaybe>>; + /** Selects rows whose errorService dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorService?: InputMaybe>>; + /** Selects rows whose operationId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationId?: InputMaybe>>; + /** Selects rows whose operationName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationName?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose severity dimension is in the given list. A null value in the list means a row with null for that dimension. */ + severity?: InputMaybe>>; +}; + +export type AccountFederatedErrorStatsMetrics = { + __typename?: 'AccountFederatedErrorStatsMetrics'; + errorCount: Scalars['Long']['output']; +}; + +export type AccountFederatedErrorStatsOrderBySpec = { + column: AccountFederatedErrorStatsColumn; + direction: Ordering; +}; + +export type AccountFederatedErrorStatsRecord = { + __typename?: 'AccountFederatedErrorStatsRecord'; + /** Dimensions of AccountFederatedErrorStats that can be grouped by. */ + groupBy: AccountFederatedErrorStatsDimensions; + /** Metrics of AccountFederatedErrorStats that can be aggregated over. */ + metrics: AccountFederatedErrorStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountFieldExecutions. */ +export enum AccountFieldExecutionsColumn { + ERRORS_COUNT = 'ERRORS_COUNT', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + FIELD_NAME = 'FIELD_NAME', + OBSERVED_EXECUTION_COUNT = 'OBSERVED_EXECUTION_COUNT', + PARENT_TYPE = 'PARENT_TYPE', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountFieldExecutionsDimensions = { + __typename?: 'AccountFieldExecutionsDimensions'; + fieldName?: Maybe; + parentType?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountFieldExecutions. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountFieldExecutionsFilter = { + and?: InputMaybe>; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountFieldExecutions. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountFieldExecutionsFilterIn = { + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountFieldExecutionsMetrics = { + __typename?: 'AccountFieldExecutionsMetrics'; + errorsCount: Scalars['Long']['output']; + estimatedExecutionCount: Scalars['Long']['output']; + observedExecutionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; +}; + +export type AccountFieldExecutionsOrderBySpec = { + column: AccountFieldExecutionsColumn; + direction: Ordering; +}; + +export type AccountFieldExecutionsRecord = { + __typename?: 'AccountFieldExecutionsRecord'; + /** Dimensions of AccountFieldExecutions that can be grouped by. */ + groupBy: AccountFieldExecutionsDimensions; + /** Metrics of AccountFieldExecutions that can be aggregated over. */ + metrics: AccountFieldExecutionsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountFieldLatencies. */ +export enum AccountFieldLatenciesColumn { + FIELD_HISTOGRAM = 'FIELD_HISTOGRAM', + FIELD_NAME = 'FIELD_NAME', + PARENT_TYPE = 'PARENT_TYPE', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountFieldLatenciesDimensions = { + __typename?: 'AccountFieldLatenciesDimensions'; + field?: Maybe; + fieldName?: Maybe; + parentType?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountFieldLatencies. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountFieldLatenciesFilter = { + and?: InputMaybe>; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountFieldLatencies. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountFieldLatenciesFilterIn = { + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountFieldLatenciesMetrics = { + __typename?: 'AccountFieldLatenciesMetrics'; + fieldHistogram: DurationHistogram; +}; + +export type AccountFieldLatenciesOrderBySpec = { + column: AccountFieldLatenciesColumn; + direction: Ordering; +}; + +export type AccountFieldLatenciesRecord = { + __typename?: 'AccountFieldLatenciesRecord'; + /** Dimensions of AccountFieldLatencies that can be grouped by. */ + groupBy: AccountFieldLatenciesDimensions; + /** Metrics of AccountFieldLatencies that can be aggregated over. */ + metrics: AccountFieldLatenciesMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountFieldUsage. */ +export enum AccountFieldUsageColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + FIELD_NAME = 'FIELD_NAME', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + PARENT_TYPE = 'PARENT_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountFieldUsageDimensions = { + __typename?: 'AccountFieldUsageDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + fieldName?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + parentType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountFieldUsage. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountFieldUsageFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountFieldUsage. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountFieldUsageFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountFieldUsageMetrics = { + __typename?: 'AccountFieldUsageMetrics'; + estimatedExecutionCount: Scalars['Long']['output']; + executionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; +}; + +export type AccountFieldUsageOrderBySpec = { + column: AccountFieldUsageColumn; + direction: Ordering; +}; + +export type AccountFieldUsageRecord = { + __typename?: 'AccountFieldUsageRecord'; + /** Dimensions of AccountFieldUsage that can be grouped by. */ + groupBy: AccountFieldUsageDimensions; + /** Metrics of AccountFieldUsage that can be aggregated over. */ + metrics: AccountFieldUsageMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** A list of graphs that belong to an account. */ +export type AccountGraphConnection = { + __typename?: 'AccountGraphConnection'; + /** A list of edges from the account to its graphs. */ + edges?: Maybe>; + /** A list of graphs attached to the account. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge between an account and a graph. */ +export type AccountGraphEdge = { + __typename?: 'AccountGraphEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** A graph attached to the account. */ + node?: Maybe; +}; + +/** A list of all variants from all graphs attached to the account. */ +export type AccountGraphVariantConnection = { + __typename?: 'AccountGraphVariantConnection'; + /** A list of edges from the account to its variants. */ + edges?: Maybe>; + /** A list of all variants from all graphs attached to the account. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge between an account and a graph variant. */ +export type AccountGraphVariantEdge = { + __typename?: 'AccountGraphVariantEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** A variant from a graph attached to the account. */ + node?: Maybe; +}; + +/** Columns of AccountGraphosCloudMetrics. */ +export enum AccountGraphosCloudMetricsColumn { + AGENT_VERSION = 'AGENT_VERSION', + CLOUD_PROVIDER = 'CLOUD_PROVIDER', + RESPONSE_SIZE = 'RESPONSE_SIZE', + RESPONSE_SIZE_THROTTLED = 'RESPONSE_SIZE_THROTTLED', + ROUTER_ID = 'ROUTER_ID', + ROUTER_OPERATIONS = 'ROUTER_OPERATIONS', + ROUTER_OPERATIONS_THROTTLED = 'ROUTER_OPERATIONS_THROTTLED', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + SUBGRAPH_FETCHES = 'SUBGRAPH_FETCHES', + SUBGRAPH_FETCHES_THROTTLED = 'SUBGRAPH_FETCHES_THROTTLED', + TIER = 'TIER', + TIMESTAMP = 'TIMESTAMP' +} + +export type AccountGraphosCloudMetricsDimensions = { + __typename?: 'AccountGraphosCloudMetricsDimensions'; + agentVersion?: Maybe; + cloudProvider?: Maybe; + routerId?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + tier?: Maybe; +}; + +/** Filter for data in AccountGraphosCloudMetrics. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountGraphosCloudMetricsFilter = { + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose cloudProvider dimension equals the given value if not null. To query for the null value, use {in: {cloudProvider: [null]}} instead. */ + cloudProvider?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose routerId dimension equals the given value if not null. To query for the null value, use {in: {routerId: [null]}} instead. */ + routerId?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose tier dimension equals the given value if not null. To query for the null value, use {in: {tier: [null]}} instead. */ + tier?: InputMaybe; +}; + +/** Filter for data in AccountGraphosCloudMetrics. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountGraphosCloudMetricsFilterIn = { + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose cloudProvider dimension is in the given list. A null value in the list means a row with null for that dimension. */ + cloudProvider?: InputMaybe>>; + /** Selects rows whose routerId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + routerId?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose tier dimension is in the given list. A null value in the list means a row with null for that dimension. */ + tier?: InputMaybe>>; +}; + +export type AccountGraphosCloudMetricsMetrics = { + __typename?: 'AccountGraphosCloudMetricsMetrics'; + responseSize: Scalars['Long']['output']; + responseSizeThrottled: Scalars['Long']['output']; + routerOperations: Scalars['Long']['output']; + routerOperationsThrottled: Scalars['Long']['output']; + subgraphFetches: Scalars['Long']['output']; + subgraphFetchesThrottled: Scalars['Long']['output']; +}; + +export type AccountGraphosCloudMetricsOrderBySpec = { + column: AccountGraphosCloudMetricsColumn; + direction: Ordering; +}; + +export type AccountGraphosCloudMetricsRecord = { + __typename?: 'AccountGraphosCloudMetricsRecord'; + /** Dimensions of AccountGraphosCloudMetrics that can be grouped by. */ + groupBy: AccountGraphosCloudMetricsDimensions; + /** Metrics of AccountGraphosCloudMetrics that can be aggregated over. */ + metrics: AccountGraphosCloudMetricsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** An invitation for a user to join an organization. */ +export type AccountInvitation = { + __typename?: 'AccountInvitation'; + /** An accepted invitation cannot be used anymore */ + acceptedAt?: Maybe; + /** Who accepted the invitation */ + acceptedBy?: Maybe; + /** Time the invitation was created */ + createdAt: Scalars['Timestamp']['output']; + /** Who created the invitation */ + createdBy?: Maybe; + email: Scalars['String']['output']; + id: Scalars['ID']['output']; + /** Last time we sent an email for the invitation */ + lastSentAt?: Maybe; + /** Access role for the invitee */ + role: UserPermission; +}; + +export type AccountLimits = { + __typename?: 'AccountLimits'; + maxAuditInDays?: Maybe; + maxGraphOSSeats?: Maybe; + maxRangeInDays?: Maybe; + maxRangeInDaysForChecks?: Maybe; + maxRequestsPerMonth?: Maybe; +}; + +export type AccountLockDetails = { + __typename?: 'AccountLockDetails'; + actor?: Maybe; + reason?: Maybe; + timestamp?: Maybe; + type?: Maybe; +}; + +export enum AccountLockType { + AUTOMATED_TRIAL_END = 'AUTOMATED_TRIAL_END', + MANUAL = 'MANUAL' +} + +/** The membership association between a user and an organization. */ +export type AccountMembership = { + __typename?: 'AccountMembership'; + account: Account; + /** The timestamp when the user was added to the organization. */ + createdAt: Scalars['Timestamp']['output']; + /** If this membership is a free seat (based on role) */ + free?: Maybe; + /** @deprecated Use role instead. */ + permission: UserPermission; + /** The user's role within the organization'. */ + role: UserPermission; + /** The user that belongs to the organization. */ + user: User; +}; + +export type AccountMutation = { + __typename?: 'AccountMutation'; + addOidcConfigurationToBaseConnection?: Maybe; + addSamlMetadataToBaseConnection?: Maybe; + /** @deprecated Use saml { addVerificationCert } instead */ + addSamlVerificationCert?: Maybe; + auditExport?: Maybe; + /** + * Cancel account subscriptions, subscriptions will remain active until the end of the paid period. + * Currently only works for Recurly subscriptions on team plans. + */ + cancelSubscriptions?: Maybe; + createBaseSsoConnection?: Maybe; + /** Create a CloudOnboarding for this account */ + createCloudOnboarding: CreateOnboardingResult; + createGraph: GraphCreationResult; + createOidcConfigurationUrl?: Maybe; + createStaticInvitation?: Maybe; + currentSubscription?: Maybe; + /** Delete the account's avatar. Requires Account.canUpdateAvatar to be true. */ + deleteAvatar?: Maybe; + ensureRecurlyAccountExists?: Maybe; + /** If the org is on an enterprise trial, extend the trial by the given number of days, or the default number of days for that plan if numDays is not set. */ + extendTrial?: Maybe; + finalizeSsoReconfiguration?: Maybe; + finalizeSsoV2Migration?: Maybe; + /** Hard delete an account and all associated services */ + hardDelete?: Maybe; + /** Get reference to the account ID */ + internalID?: Maybe; + /** Send an invitation to join the organization by E-mail */ + invite?: Maybe; + /** Lock an account, which limits the functionality available with regard to its graphs. */ + lock?: Maybe; + /** See Account type. Field is needed by extending subgraph. */ + name?: Maybe; + /** Mutations for interacting with an Apollo account's private subgraphs on GraphOS */ + privateSubgraph: PrivateSubgraphMutation; + reAddSsoUser?: Maybe; + /** + * Reactivate a canceled current subscription. + * Currently only works for Recurly subscriptions on team plans. + */ + reactivateCurrentSubscription?: Maybe; + /** Delete an invitation */ + removeInvitation?: Maybe; + /** Remove a member of the account */ + removeMember?: Maybe; + replaceSsoConnectionDomains?: Maybe; + /** Trigger a request for an audit export */ + requestAuditExport?: Maybe; + /** Send a new E-mail for an existing invitation */ + resendInvitation?: Maybe; + revokeStaticInvitation?: Maybe; + /** Revokes a user's sessions within the organization */ + revokeUserSessions?: Maybe; + saml?: Maybe; + /** See Account type. Field is needed by extending subgraph. */ + seats?: Maybe; + /** Create or update a custom session length for an org */ + setCustomSessionLength: Scalars['Int']['output']; + /** Apollo admins only: set the billing plan to an arbitrary plan effective immediately terminating any current paid plan. */ + setPlan?: Maybe; + /** This is called by the form shown to users after they cancel their team subscription. */ + submitTeamCancellationFeedback?: Maybe; + /** Apollo admins only: Terminate the ongoing subscription in the account as soon as possible, without refunds. */ + terminateSubscription?: Maybe; + /** + * Apollo admins only: terminate any ongoing subscriptions in the account, without refunds + * Currently only works for Recurly subscriptions. + */ + terminateSubscriptions?: Maybe; + trackTermsAccepted?: Maybe; + /** Unlock a locked account. */ + unlock?: Maybe; + /** Update the billing address for a Recurly token */ + updateBillingAddress?: Maybe; + /** Update the billing information from a Recurly token */ + updateBillingInfo?: Maybe; + updateCompanyUrl?: Maybe; + /** Set the E-mail address of the account, used notably for billing */ + updateEmail?: Maybe; + /** Update the account ID */ + updateID?: Maybe; + updateLegacySsoProvider?: Maybe; + /** Update the company name */ + updateName?: Maybe; + /** Updates the OIDC metadata for an existing SSO connection. Connection must be disabled prior to the update. */ + updateOidcConnectionMetadata?: Maybe; + /** Updates the role assigned to new SSO users. */ + updateSSODefaultRole?: Maybe; + /** Updates the SAML metadata for an existing SSO connection. Connection must be disabled prior to the update. */ + updateSamlConnectionMetadata?: Maybe; + /** + * Update a user's role within an organization + * @deprecated Use updateUserRole instead. + */ + updateUserPermission?: Maybe; + /** Update a user's role within an organization */ + updateUserRole?: Maybe; +}; + + +export type AccountMutationAddOidcConfigurationToBaseConnectionArgs = { + config: OidcConfigurationInput; + connectionId: Scalars['ID']['input']; + enabled?: InputMaybe; +}; + + +export type AccountMutationAddSamlMetadataToBaseConnectionArgs = { + connectionId: Scalars['ID']['input']; + enabled?: InputMaybe; + metadata: SamlConfigurationInput; +}; + + +export type AccountMutationAddSamlVerificationCertArgs = { + pem: Scalars['String']['input']; +}; + + +export type AccountMutationAuditExportArgs = { + id: Scalars['String']['input']; +}; + + +export type AccountMutationCreateBaseSsoConnectionArgs = { + domains: Array; + idpId?: InputMaybe; + useLegacyIdpId?: InputMaybe; +}; + + +export type AccountMutationCreateCloudOnboardingArgs = { + input: CloudOnboardingInput; +}; + + +export type AccountMutationCreateGraphArgs = { + graphType: GraphType; + hiddenFromUninvitedNonAdmin: Scalars['Boolean']['input']; + id: Scalars['ID']['input']; + title: Scalars['String']['input']; + variantCreationConfig?: InputMaybe; +}; + + +export type AccountMutationCreateOidcConfigurationUrlArgs = { + id: Scalars['ID']['input']; +}; + + +export type AccountMutationCreateStaticInvitationArgs = { + role: UserPermission; +}; + + +export type AccountMutationExtendTrialArgs = { + numDays?: InputMaybe; +}; + + +export type AccountMutationFinalizeSsoReconfigurationArgs = { + deleteExistingWebApiKeys?: InputMaybe; + newConnectionId: Scalars['ID']['input']; + verifySsoSessionExists?: InputMaybe; +}; + + +export type AccountMutationFinalizeSsoV2MigrationArgs = { + deleteExistingWebApiKeys?: InputMaybe; + deleteNonSsoMemberships?: InputMaybe; + verifySsoSessionExists?: InputMaybe; +}; + + +export type AccountMutationInviteArgs = { + email: Scalars['String']['input']; + role?: InputMaybe; +}; + + +export type AccountMutationLockArgs = { + reason?: InputMaybe; + type?: InputMaybe; +}; + + +export type AccountMutationReAddSsoUserArgs = { + role: UserPermission; + userId: Scalars['ID']['input']; +}; + + +export type AccountMutationRemoveInvitationArgs = { + id?: InputMaybe; +}; + + +export type AccountMutationRemoveMemberArgs = { + id: Scalars['ID']['input']; +}; + + +export type AccountMutationReplaceSsoConnectionDomainsArgs = { + domains: Array; + id: Scalars['ID']['input']; +}; + + +export type AccountMutationRequestAuditExportArgs = { + actors?: InputMaybe>; + from: Scalars['Timestamp']['input']; + graphIds?: InputMaybe>; + to: Scalars['Timestamp']['input']; +}; + + +export type AccountMutationResendInvitationArgs = { + id?: InputMaybe; +}; + + +export type AccountMutationRevokeStaticInvitationArgs = { + token: Scalars['String']['input']; +}; + + +export type AccountMutationRevokeUserSessionsArgs = { + userId: Scalars['ID']['input']; +}; + + +export type AccountMutationSetCustomSessionLengthArgs = { + sessionDurationInSeconds: Scalars['Int']['input']; +}; + + +export type AccountMutationSetPlanArgs = { + id: Scalars['ID']['input']; +}; + + +export type AccountMutationSubmitTeamCancellationFeedbackArgs = { + feedback: Scalars['String']['input']; +}; + + +export type AccountMutationTerminateSubscriptionArgs = { + providerId: Scalars['ID']['input']; +}; + + +export type AccountMutationTrackTermsAcceptedArgs = { + at: Scalars['Timestamp']['input']; +}; + + +export type AccountMutationUpdateBillingAddressArgs = { + billingAddress: BillingAddressInput; +}; + + +export type AccountMutationUpdateBillingInfoArgs = { + token: Scalars['String']['input']; +}; + + +export type AccountMutationUpdateCompanyUrlArgs = { + companyUrl?: InputMaybe; +}; + + +export type AccountMutationUpdateEmailArgs = { + email: Scalars['String']['input']; +}; + + +export type AccountMutationUpdateIdArgs = { + id: Scalars['ID']['input']; +}; + + +export type AccountMutationUpdateLegacySsoProviderArgs = { + ssoProvider: OrganizationSsoProvider; +}; + + +export type AccountMutationUpdateNameArgs = { + name: Scalars['String']['input']; +}; + + +export type AccountMutationUpdateOidcConnectionMetadataArgs = { + connectionId: Scalars['ID']['input']; + metadata: OidcConfigurationUpdateInput; +}; + + +export type AccountMutationUpdateSsoDefaultRoleArgs = { + role: UserPermission; +}; + + +export type AccountMutationUpdateSamlConnectionMetadataArgs = { + connectionId: Scalars['ID']['input']; + metadata: SamlConfigurationInput; +}; + + +export type AccountMutationUpdateUserPermissionArgs = { + permission: UserPermission; + userID: Scalars['ID']['input']; +}; + + +export type AccountMutationUpdateUserRoleArgs = { + role: UserPermission; + userID: Scalars['ID']['input']; +}; + +/** Columns of AccountOperationCheckStats. */ +export enum AccountOperationCheckStatsColumn { + CACHED_REQUESTS_COUNT = 'CACHED_REQUESTS_COUNT', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + UNCACHED_REQUESTS_COUNT = 'UNCACHED_REQUESTS_COUNT' +} + +export type AccountOperationCheckStatsDimensions = { + __typename?: 'AccountOperationCheckStatsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountOperationCheckStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountOperationCheckStatsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountOperationCheckStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountOperationCheckStatsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountOperationCheckStatsMetrics = { + __typename?: 'AccountOperationCheckStatsMetrics'; + cachedRequestsCount: Scalars['Long']['output']; + uncachedRequestsCount: Scalars['Long']['output']; +}; + +export type AccountOperationCheckStatsOrderBySpec = { + column: AccountOperationCheckStatsColumn; + direction: Ordering; +}; + +export type AccountOperationCheckStatsRecord = { + __typename?: 'AccountOperationCheckStatsRecord'; + /** Dimensions of AccountOperationCheckStats that can be grouped by. */ + groupBy: AccountOperationCheckStatsDimensions; + /** Metrics of AccountOperationCheckStats that can be aggregated over. */ + metrics: AccountOperationCheckStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type AccountOperationUsage = { + __typename?: 'AccountOperationUsage'; + selfHosted: BillableMetricStats; + serverless: BillableMetricStats; + totalOperations: BillableMetricStats; +}; + +export type AccountOperationUsageWindowInput = { + from: Scalars['Date']['input']; + limit?: Scalars['Int']['input']; + to: Scalars['Date']['input']; + windowSize?: BillingUsageStatsWindowSize; +}; + +export type AccountPublishesStatsMetrics = { + __typename?: 'AccountPublishesStatsMetrics'; + totalPublishes: Scalars['Long']['output']; +}; + +export type AccountPublishesStatsRecord = { + __typename?: 'AccountPublishesStatsRecord'; + id: Scalars['ID']['output']; + metrics: AccountPublishesStatsMetrics; + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountQueryStats. */ +export enum AccountQueryStatsColumn { + CACHED_HISTOGRAM = 'CACHED_HISTOGRAM', + CACHED_REQUESTS_COUNT = 'CACHED_REQUESTS_COUNT', + CACHE_TTL_HISTOGRAM = 'CACHE_TTL_HISTOGRAM', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + FORBIDDEN_OPERATION_COUNT = 'FORBIDDEN_OPERATION_COUNT', + FROM_ENGINEPROXY = 'FROM_ENGINEPROXY', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + PERSISTED_QUERY_ID = 'PERSISTED_QUERY_ID', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REGISTERED_OPERATION_COUNT = 'REGISTERED_OPERATION_COUNT', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + UNCACHED_HISTOGRAM = 'UNCACHED_HISTOGRAM', + UNCACHED_REQUESTS_COUNT = 'UNCACHED_REQUESTS_COUNT' +} + +export type AccountQueryStatsDimensions = { + __typename?: 'AccountQueryStatsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + fromEngineproxy?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + persistedQueryId?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + querySignature?: Maybe; + querySignatureLength?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in AccountQueryStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountQueryStatsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose fromEngineproxy dimension equals the given value if not null. To query for the null value, use {in: {fromEngineproxy: [null]}} instead. */ + fromEngineproxy?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose persistedQueryId dimension equals the given value if not null. To query for the null value, use {in: {persistedQueryId: [null]}} instead. */ + persistedQueryId?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in AccountQueryStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountQueryStatsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose fromEngineproxy dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fromEngineproxy?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose persistedQueryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + persistedQueryId?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type AccountQueryStatsMetrics = { + __typename?: 'AccountQueryStatsMetrics'; + cacheTtlHistogram: DurationHistogram; + cachedHistogram: DurationHistogram; + cachedRequestsCount: Scalars['Long']['output']; + forbiddenOperationCount: Scalars['Long']['output']; + registeredOperationCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; + totalLatencyHistogram: DurationHistogram; + totalRequestCount: Scalars['Long']['output']; + uncachedHistogram: DurationHistogram; + uncachedRequestsCount: Scalars['Long']['output']; +}; + +export type AccountQueryStatsOrderBySpec = { + column: AccountQueryStatsColumn; + direction: Ordering; +}; + +export type AccountQueryStatsRecord = { + __typename?: 'AccountQueryStatsRecord'; + /** Dimensions of AccountQueryStats that can be grouped by. */ + groupBy: AccountQueryStatsDimensions; + /** Metrics of AccountQueryStats that can be aggregated over. */ + metrics: AccountQueryStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type AccountRoles = { + __typename?: 'AccountRoles'; + canAudit: Scalars['Boolean']['output']; + canCreateService: Scalars['Boolean']['output']; + canDelete: Scalars['Boolean']['output']; + canManageMembers: Scalars['Boolean']['output']; + canManageSessions: Scalars['Boolean']['output']; + canProvisionSSO: Scalars['Boolean']['output']; + canQuery: Scalars['Boolean']['output']; + canQueryAudit: Scalars['Boolean']['output']; + canQueryBillingInfo: Scalars['Boolean']['output']; + canQueryMembers: Scalars['Boolean']['output']; + canQueryStats: Scalars['Boolean']['output']; + canReadTickets: Scalars['Boolean']['output']; + canRemoveMembers: Scalars['Boolean']['output']; + canSetConstrainedPlan: Scalars['Boolean']['output']; + canUpdateBillingInfo: Scalars['Boolean']['output']; + canUpdateMetadata: Scalars['Boolean']['output']; +}; + +export enum AccountState { + ACTIVE = 'ACTIVE', + CLOSED = 'CLOSED', + UNKNOWN = 'UNKNOWN', + UNPROVISIONED = 'UNPROVISIONED' +} + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindow = { + __typename?: 'AccountStatsWindow'; + billingUsageStats: Array; + cardinalityStats: Array; + coordinateUsage: Array; + edgeServerInfos: Array; + errorStats: Array; + federatedErrorStats: Array; + fieldExecutions: Array; + fieldLatencies: Array; + fieldUsage: Array; + graphosCloudMetrics: Array; + operationCheckStats: Array; + queryStats: Array; + /** From field rounded down to the nearest resolution. */ + roundedDownFrom: Scalars['Timestamp']['output']; + /** To field rounded up to the nearest resolution. */ + roundedUpTo: Scalars['Timestamp']['output']; + tracePathErrorsRefs: Array; + traceRefs: Array; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowBillingUsageStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowCardinalityStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowCoordinateUsageArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowEdgeServerInfosArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowErrorStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowFederatedErrorStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowFieldExecutionsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowFieldLatenciesArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowFieldUsageArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowGraphosCloudMetricsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowOperationCheckStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowQueryStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowTracePathErrorsRefsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given account. */ +export type AccountStatsWindowTraceRefsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + +/** Columns of AccountTracePathErrorsRefs. */ +export enum AccountTracePathErrorsRefsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + DURATION_BUCKET = 'DURATION_BUCKET', + ERRORS_COUNT_IN_PATH = 'ERRORS_COUNT_IN_PATH', + ERRORS_COUNT_IN_TRACE = 'ERRORS_COUNT_IN_TRACE', + ERROR_CODE = 'ERROR_CODE', + ERROR_MESSAGE = 'ERROR_MESSAGE', + ERROR_SERVICE = 'ERROR_SERVICE', + PATH = 'PATH', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + TRACE_HTTP_STATUS_CODE = 'TRACE_HTTP_STATUS_CODE', + TRACE_ID = 'TRACE_ID', + TRACE_SIZE_BYTES = 'TRACE_SIZE_BYTES', + TRACE_STARTS_AT = 'TRACE_STARTS_AT' +} + +export type AccountTracePathErrorsRefsDimensions = { + __typename?: 'AccountTracePathErrorsRefsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + durationBucket?: Maybe; + errorCode?: Maybe; + errorMessage?: Maybe; + errorService?: Maybe; + path?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + traceHttpStatusCode?: Maybe; + traceId?: Maybe; + traceStartsAt?: Maybe; +}; + +/** Filter for data in AccountTracePathErrorsRefs. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountTracePathErrorsRefsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose durationBucket dimension equals the given value if not null. To query for the null value, use {in: {durationBucket: [null]}} instead. */ + durationBucket?: InputMaybe; + /** Selects rows whose errorCode dimension equals the given value if not null. To query for the null value, use {in: {errorCode: [null]}} instead. */ + errorCode?: InputMaybe; + /** Selects rows whose errorMessage dimension equals the given value if not null. To query for the null value, use {in: {errorMessage: [null]}} instead. */ + errorMessage?: InputMaybe; + /** Selects rows whose errorService dimension equals the given value if not null. To query for the null value, use {in: {errorService: [null]}} instead. */ + errorService?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose path dimension equals the given value if not null. To query for the null value, use {in: {path: [null]}} instead. */ + path?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose traceHttpStatusCode dimension equals the given value if not null. To query for the null value, use {in: {traceHttpStatusCode: [null]}} instead. */ + traceHttpStatusCode?: InputMaybe; + /** Selects rows whose traceId dimension equals the given value if not null. To query for the null value, use {in: {traceId: [null]}} instead. */ + traceId?: InputMaybe; +}; + +/** Filter for data in AccountTracePathErrorsRefs. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountTracePathErrorsRefsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose durationBucket dimension is in the given list. A null value in the list means a row with null for that dimension. */ + durationBucket?: InputMaybe>>; + /** Selects rows whose errorCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorCode?: InputMaybe>>; + /** Selects rows whose errorMessage dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorMessage?: InputMaybe>>; + /** Selects rows whose errorService dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorService?: InputMaybe>>; + /** Selects rows whose path dimension is in the given list. A null value in the list means a row with null for that dimension. */ + path?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose traceHttpStatusCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceHttpStatusCode?: InputMaybe>>; + /** Selects rows whose traceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceId?: InputMaybe>>; +}; + +export type AccountTracePathErrorsRefsMetrics = { + __typename?: 'AccountTracePathErrorsRefsMetrics'; + errorsCountInPath: Scalars['Long']['output']; + errorsCountInTrace: Scalars['Long']['output']; + traceSizeBytes: Scalars['Long']['output']; +}; + +export type AccountTracePathErrorsRefsOrderBySpec = { + column: AccountTracePathErrorsRefsColumn; + direction: Ordering; +}; + +export type AccountTracePathErrorsRefsRecord = { + __typename?: 'AccountTracePathErrorsRefsRecord'; + /** Dimensions of AccountTracePathErrorsRefs that can be grouped by. */ + groupBy: AccountTracePathErrorsRefsDimensions; + /** Metrics of AccountTracePathErrorsRefs that can be aggregated over. */ + metrics: AccountTracePathErrorsRefsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of AccountTraceRefs. */ +export enum AccountTraceRefsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + DURATION_BUCKET = 'DURATION_BUCKET', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + TRACE_COUNT = 'TRACE_COUNT', + TRACE_ID = 'TRACE_ID' +} + +export type AccountTraceRefsDimensions = { + __typename?: 'AccountTraceRefsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + durationBucket?: Maybe; + generatedTraceId?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + querySignature?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + traceId?: Maybe; +}; + +/** Filter for data in AccountTraceRefs. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type AccountTraceRefsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose durationBucket dimension equals the given value if not null. To query for the null value, use {in: {durationBucket: [null]}} instead. */ + durationBucket?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose traceId dimension equals the given value if not null. To query for the null value, use {in: {traceId: [null]}} instead. */ + traceId?: InputMaybe; +}; + +/** Filter for data in AccountTraceRefs. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type AccountTraceRefsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose durationBucket dimension is in the given list. A null value in the list means a row with null for that dimension. */ + durationBucket?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose traceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceId?: InputMaybe>>; +}; + +export type AccountTraceRefsMetrics = { + __typename?: 'AccountTraceRefsMetrics'; + traceCount: Scalars['Long']['output']; +}; + +export type AccountTraceRefsOrderBySpec = { + column: AccountTraceRefsColumn; + direction: Ordering; +}; + +export type AccountTraceRefsRecord = { + __typename?: 'AccountTraceRefsRecord'; + /** Dimensions of AccountTraceRefs that can be grouped by. */ + groupBy: AccountTraceRefsDimensions; + /** Metrics of AccountTraceRefs that can be aggregated over. */ + metrics: AccountTraceRefsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Represents an actor that performs actions in Apollo Studio. Most actors are either a `USER` or a `GRAPH` (based on a request's provided API key), and they have the corresponding `ActorType`. */ +export type Actor = { + __typename?: 'Actor'; + actorId: Scalars['ID']['output']; + type: ActorType; +}; + +/** Input type to provide when specifying an `Actor` in operation arguments. See also the `Actor` object type. */ +export type ActorInput = { + actorId: Scalars['ID']['input']; + type: ActorType; +}; + +export enum ActorType { + ANONYMOUS_USER = 'ANONYMOUS_USER', + BACKFILL = 'BACKFILL', + CRON = 'CRON', + GRAPH = 'GRAPH', + INTERNAL_IDENTITY = 'INTERNAL_IDENTITY', + SYNCHRONIZATION = 'SYNCHRONIZATION', + SYSTEM = 'SYSTEM', + USER = 'USER' +} + +/** parentCommentId is only present for replies. schemaCoordinate & subgraph are only present for initial change comments. If all are absent, this is a general parent comment on the proposal. */ +export type AddCommentInput = { + message: Scalars['String']['input']; + parentCommentId?: InputMaybe; + revisionId: Scalars['String']['input']; + schemaCoordinate?: InputMaybe; + schemaScope?: InputMaybe; + usersToNotify?: InputMaybe>; +}; + +export type AddCommentResult = NotFoundError | ParentChangeProposalComment | ParentGeneralProposalComment | ReplyChangeProposalComment | ReplyGeneralProposalComment | ValidationError; + +export type AddOperationCollectionEntriesResult = AddOperationCollectionEntriesSuccess | PermissionError | ValidationError; + +export type AddOperationCollectionEntriesSuccess = { + __typename?: 'AddOperationCollectionEntriesSuccess'; + operationCollectionEntries: Array; +}; + +export type AddOperationCollectionEntryResult = OperationCollectionEntry | PermissionError | ValidationError; + +export type AddOperationCollectionToVariantResult = GraphVariant | InvalidTarget | PermissionError | ValidationError; + +export type AddOperationInput = { + /** The operation's fields. */ + document: OperationCollectionEntryStateInput; + /** The operation's name. */ + name: Scalars['String']['input']; +}; + +export type AffectedClient = { + __typename?: 'AffectedClient'; + /** + * ID, often the name, of the client set by the user and reported alongside metrics + * @deprecated Unsupported. + */ + clientReferenceId?: Maybe; + /** + * version of the client set by the user and reported alongside metrics + * @deprecated Unsupported. + */ + clientVersion?: Maybe; +}; + +export type AffectedQuery = { + __typename?: 'AffectedQuery'; + /** If the operation would be approved if the check ran again. Returns null if queried from SchemaDiff.changes.affectedQueries.alreadyApproved */ + alreadyApproved?: Maybe; + /** If the operation would be ignored if the check ran again */ + alreadyIgnored?: Maybe; + /** List of changes affecting this query. Returns null if queried from SchemaDiff.changes.affectedQueries.changes */ + changes?: Maybe>; + /** Name to display to the user for the operation */ + displayName?: Maybe; + id: Scalars['ID']['output']; + /** Determines if this query validates against the proposed schema */ + isValid?: Maybe; + /** Whether this operation was ignored and its severity was downgraded for that reason */ + markedAsIgnored?: Maybe; + /** Whether the changes were marked as safe and its severity was downgraded for that reason */ + markedAsSafe?: Maybe; + /** Name provided for the operation, which can be empty string if it is an anonymous operation */ + name?: Maybe; + /** First 128 characters of query signature for display */ + signature?: Maybe; +}; + +/** + * Represents an API key that's used to authenticate a + * particular Apollo user or graph. + */ +export type ApiKey = { + /** The API key's ID. */ + id: Scalars['ID']['output']; + /** The API key's name, for distinguishing it from other keys. */ + keyName?: Maybe; + /** The value of the API key. **This is a secret credential!** */ + token: Scalars['String']['output']; +}; + +export type ApiKeyProvision = { + __typename?: 'ApiKeyProvision'; + apiKey: ApiKey; + created: Scalars['Boolean']['output']; +}; + +/** A generic event for the `trackApolloKotlinUsage` mutation */ +export type ApolloKotlinUsageEventInput = { + /** When the event occurred */ + date: Scalars['Timestamp']['input']; + /** Optional parameters attached to the event */ + payload?: InputMaybe; + /** Type of event */ + type: Scalars['ID']['input']; +}; + +/** A generic property for the `trackApolloKotlinUsage` mutation */ +export type ApolloKotlinUsagePropertyInput = { + /** Optional parameters attached to the property */ + payload?: InputMaybe; + /** Type of property */ + type: Scalars['ID']['input']; +}; + +export type AuditLogExport = { + __typename?: 'AuditLogExport'; + /** The list of actors to filter the audit export */ + actors?: Maybe>; + bigqueryTriggeredAt?: Maybe; + /** The time when the audit export was completed */ + completedAt?: Maybe; + /** The time when the audit export was reqeusted */ + createdAt: Scalars['Timestamp']['output']; + /** List of URLs to download the audits for the requested range */ + downloadUrls?: Maybe>; + exportedFiles?: Maybe>; + /** The starting point of audits to include in export */ + from: Scalars['Timestamp']['output']; + /** The list of graphs to filter the audit export */ + graphs?: Maybe>; + /** The id for the audit export */ + id: Scalars['ID']['output']; + /** The user that initiated the audit export */ + requester?: Maybe; + /** The status of the audit export */ + status: AuditStatus; + /** The end point of audits to include in export */ + to: Scalars['Timestamp']['output']; +}; + +export type AuditLogExportMutation = { + __typename?: 'AuditLogExportMutation'; + cancel?: Maybe; + delete?: Maybe; +}; + +export enum AuditStatus { + CANCELLED = 'CANCELLED', + COMPLETED = 'COMPLETED', + EXPIRED = 'EXPIRED', + FAILED = 'FAILED', + IN_PROGRESS = 'IN_PROGRESS', + QUEUED = 'QUEUED' +} + +export type AvatarDeleteError = { + __typename?: 'AvatarDeleteError'; + clientMessage: Scalars['String']['output']; + code: AvatarDeleteErrorCode; + serverMessage: Scalars['String']['output']; +}; + +export enum AvatarDeleteErrorCode { + SSO_USERS_CANNOT_DELETE_SELF_AVATAR = 'SSO_USERS_CANNOT_DELETE_SELF_AVATAR' +} + +export type AvatarUploadError = { + __typename?: 'AvatarUploadError'; + clientMessage: Scalars['String']['output']; + code: AvatarUploadErrorCode; + serverMessage: Scalars['String']['output']; +}; + +export enum AvatarUploadErrorCode { + SSO_USERS_CANNOT_UPLOAD_SELF_AVATAR = 'SSO_USERS_CANNOT_UPLOAD_SELF_AVATAR' +} + +export type AvatarUploadResult = AvatarUploadError | MediaUploadInfo; + +/** AWS Load Balancer information */ +export type AwsLoadBalancer = { + __typename?: 'AwsLoadBalancer'; + /** ARN for the load balancer */ + arn: Scalars['String']['output']; + /** DNS endpoint for the load balancer */ + endpoint: Scalars['String']['output']; + /** ARN for the HTTPS listener for the load balancer */ + listenerArn: Scalars['String']['output']; +}; + +/** Input for AWS Load Balancer */ +export type AwsLoadBalancerInput = { + arn: Scalars['String']['input']; + endpoint: Scalars['String']['input']; + listenerArn: Scalars['String']['input']; +}; + +/** AWS-specific information for a Shard */ +export type AwsShard = { + __typename?: 'AwsShard'; + /** AWS Account ID where the Shard is hosted */ + accountId: Scalars['String']['output']; + /** ARNs of the target groups for sleeping Cloud Routers */ + coldStartTargetGroupArns?: Maybe>; + /** ARN of the ECS Cluster */ + ecsClusterArn: Scalars['String']['output']; + /** ARN of the IAM role to perform provisioning operations on this shard */ + iamRoleArn: Scalars['String']['output']; + /** ID of the security group for the load balancer */ + loadbalancerSecurityGroupId: Scalars['String']['output']; + /** Load balancers for this Cloud Router */ + loadbalancers: Array; + /** ARN of the IAM permissions boundaries for IAM roles provisioned in this shard */ + permissionsBoundaryArn: Scalars['String']['output']; + /** IDs of the subnets */ + subnetIds: Array; + /** ID of the VPC */ + vpcId: Scalars['String']['output']; +}; + +export type BaseConnection = SsoConnection & { + __typename?: 'BaseConnection'; + domains: Array; + id: Scalars['ID']['output']; + idpId: Scalars['ID']['output']; + scim?: Maybe; + /** @deprecated Use stateV2 instead */ + state: SsoConnectionState; + stateV2: SsoConnectionStateV2; +}; + +export type BillableMetricStats = { + __typename?: 'BillableMetricStats'; + planThreshold?: Maybe; + stats: Array; +}; + +export type BillingAddress = { + __typename?: 'BillingAddress'; + address1?: Maybe; + address2?: Maybe; + city?: Maybe; + country?: Maybe; + state?: Maybe; + zip?: Maybe; +}; + +/** Billing address input */ +export type BillingAddressInput = { + address1: Scalars['String']['input']; + address2?: InputMaybe; + city: Scalars['String']['input']; + country: Scalars['String']['input']; + state: Scalars['String']['input']; + zip: Scalars['String']['input']; +}; + +export type BillingAdminQuery = { + __typename?: 'BillingAdminQuery'; + /** Look up the current plan of an account by calling the grpc service */ + currentPlanFromGrpc?: Maybe; +}; + + +export type BillingAdminQueryCurrentPlanFromGrpcArgs = { + internalAccountId: Scalars['ID']['input']; +}; + +export type BillingCapability = { + __typename?: 'BillingCapability'; + defaultValue: Scalars['Boolean']['output']; + intendedUse: Scalars['String']['output']; + label: Scalars['String']['output']; +}; + +/** Billing capability input */ +export type BillingCapabilityInput = { + defaultValue: Scalars['Boolean']['input']; + intendedUse: Scalars['String']['input']; + label: Scalars['String']['input']; +}; + +export type BillingInfo = { + __typename?: 'BillingInfo'; + address: BillingAddress; + cardType?: Maybe; + firstName?: Maybe; + lastFour?: Maybe; + lastName?: Maybe; + month?: Maybe; + name?: Maybe; + vatNumber?: Maybe; + year?: Maybe; +}; + +export type BillingInsights = { + __typename?: 'BillingInsights'; + totalOperations: Array; + totalSampledOperations: Array; +}; + +export type BillingInsightsUsage = { + __typename?: 'BillingInsightsUsage'; + timestamp: Scalars['Timestamp']['output']; + totalOperationCount: Scalars['Long']['output']; +}; + +export type BillingLimit = { + __typename?: 'BillingLimit'; + defaultValue: Scalars['Long']['output']; + intendedUse: Scalars['String']['output']; + label: Scalars['String']['output']; +}; + +/** Billing limit input */ +export type BillingLimitInput = { + defaultValue?: InputMaybe; + intendedUse: Scalars['String']['input']; + label: Scalars['String']['input']; +}; + +export enum BillingModel { + REQUEST_BASED = 'REQUEST_BASED', + SEAT_BASED = 'SEAT_BASED' +} + +export type BillingMonth = { + __typename?: 'BillingMonth'; + end: Scalars['Timestamp']['output']; + requests: Scalars['Long']['output']; + start: Scalars['Timestamp']['output']; +}; + +export type BillingMutation = { + __typename?: 'BillingMutation'; + /** Temporary utility mutation to convert annual team plan orgs to monthly team plans */ + convertAnnualTeamOrgToMonthly?: Maybe; + createSetupIntent?: Maybe; + /** Admin mutation for manually creating usage exports for testing usage-based pricing of Scale plans. */ + createUsageExport?: Maybe; + endPaidUsageBasedPlan?: Maybe; + reloadPlans: Array; + startFreeUsageBasedPlan?: Maybe; + startUsageBasedPlan?: Maybe; + /** @deprecated No longer supported */ + syncAccountWithProviders?: Maybe; + /** Mutation to sync an Apollo Plan with a Stripe product */ + syncStripePlan?: Maybe; + updatePaymentMethod?: Maybe; +}; + + +export type BillingMutationConvertAnnualTeamOrgToMonthlyArgs = { + internalAccountId: Scalars['ID']['input']; +}; + + +export type BillingMutationCreateSetupIntentArgs = { + internalAccountId: Scalars['ID']['input']; +}; + + +export type BillingMutationCreateUsageExportArgs = { + date: Scalars['Date']['input']; + internalAccountIds: Array; + startAtHour: Scalars['Int']['input']; +}; + + +export type BillingMutationEndPaidUsageBasedPlanArgs = { + internalAccountId: Scalars['ID']['input']; +}; + + +export type BillingMutationStartFreeUsageBasedPlanArgs = { + internalAccountId: Scalars['ID']['input']; +}; + + +export type BillingMutationStartUsageBasedPlanArgs = { + internalAccountId: Scalars['ID']['input']; + paymentMethodId: Scalars['String']['input']; +}; + + +export type BillingMutationSyncAccountWithProvidersArgs = { + internalAccountId: Scalars['ID']['input']; +}; + + +export type BillingMutationSyncStripePlanArgs = { + planKind: BillingPlanKind; + planReadableId?: InputMaybe; + stripeProductId: Scalars['ID']['input']; +}; + + +export type BillingMutationUpdatePaymentMethodArgs = { + internalAccountId: Scalars['ID']['input']; + paymentMethodId: Scalars['String']['input']; +}; + +export enum BillingPeriod { + MONTHLY = 'MONTHLY', + QUARTERLY = 'QUARTERLY', + SEMI_ANNUALLY = 'SEMI_ANNUALLY', + YEARLY = 'YEARLY' +} + +export type BillingPlan = { + __typename?: 'BillingPlan'; + addons: Array; + /** Retrieve all capabilities for the plan */ + allCapabilities: Array; + /** Retrieve a list of all effective capability limits for this plan */ + allLimits: Array; + billingModel: BillingModel; + billingPeriod?: Maybe; + /** @deprecated use AccountCapabilities.clientVersions */ + clientVersions: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.clients */ + clients: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.contracts */ + contracts: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.datadog */ + datadog: Scalars['Boolean']['output']; + description?: Maybe; + /** Retrieve the limit applied to this plan for a capability */ + effectiveLimit?: Maybe; + errors: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.federation */ + federation: Scalars['Boolean']['output']; + /** Check whether a capability is enabled for the plan */ + hasCapability?: Maybe; + id: Scalars['ID']['output']; + isTrial: Scalars['Boolean']['output']; + kind: BillingPlanKind; + /** @deprecated use AccountCapabilities.launches */ + launches: Scalars['Boolean']['output']; + /** @deprecated use AccountLimits.maxAuditInDays */ + maxAuditInDays: Scalars['Int']['output']; + /** @deprecated use AccountLimits.maxRangeInDays */ + maxRangeInDays?: Maybe; + /** + * The maximum number of days that checks stats will be stored + * @deprecated use AccountLimits.maxRangeInDaysForChecks + */ + maxRangeInDaysForChecks?: Maybe; + /** @deprecated use AccountLimits.maxRequestsPerMonth */ + maxRequestsPerMonth?: Maybe; + /** @deprecated use AccountCapabilities.metrics */ + metrics: Scalars['Boolean']['output']; + name: Scalars['String']['output']; + /** @deprecated use AccountCapabilities.notifications */ + notifications: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.operationRegistry */ + operationRegistry: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.persistedQueries */ + persistedQueries: Scalars['Boolean']['output']; + /** The price of every seat */ + pricePerSeatInUsdCents?: Maybe; + /** The price of subscribing to this plan with a quantity of 1 (currently always the case) */ + pricePerUnitInUsdCents: Scalars['Int']['output']; + provider?: Maybe; + /** Whether the plan is accessible by all users in QueryRoot.allPlans, QueryRoot.plan, or AccountMutation.setPlan */ + public: Scalars['Boolean']['output']; + ranges: Array; + readableId: Scalars['ID']['output']; + /** @deprecated use AccountCapabilities.schemaValidation */ + schemaValidation: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.sso */ + sso?: Maybe; + tier: BillingPlanTier; + /** @deprecated use AccountCapabilities.traces */ + traces: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.userRoles */ + userRoles: Scalars['Boolean']['output']; + /** @deprecated use AccountCapabilities.webhooks */ + webhooks: Scalars['Boolean']['output']; +}; + + +export type BillingPlanEffectiveLimitArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingPlanHasCapabilityArgs = { + label: Scalars['String']['input']; +}; + +export type BillingPlanAddon = { + __typename?: 'BillingPlanAddon'; + id: Scalars['ID']['output']; + pricePerUnitInUsdCents: Scalars['Int']['output']; +}; + +/** Billing plan addon input */ +export type BillingPlanAddonInput = { + code?: InputMaybe; + usdCentsPrice?: InputMaybe; +}; + +export type BillingPlanCapability = { + __typename?: 'BillingPlanCapability'; + label: Scalars['String']['output']; + plan: BillingPlan; + value: Scalars['Boolean']['output']; +}; + +/** Billing plan input */ +export type BillingPlanInput = { + addons: Array; + billingModel: BillingModel; + billingPeriod: BillingPeriod; + clientVersions?: InputMaybe; + clients?: InputMaybe; + contracts?: InputMaybe; + datadog?: InputMaybe; + description: Scalars['String']['input']; + errors?: InputMaybe; + federation?: InputMaybe; + id: Scalars['ID']['input']; + kind: BillingPlanKind; + launches?: InputMaybe; + maxAuditInDays?: InputMaybe; + maxRangeInDays?: InputMaybe; + maxRangeInDaysForChecks?: InputMaybe; + maxRequestsPerMonth?: InputMaybe; + metrics?: InputMaybe; + name: Scalars['String']['input']; + notifications?: InputMaybe; + operationRegistry?: InputMaybe; + persistedQueries?: InputMaybe; + pricePerSeatInUsdCents?: InputMaybe; + pricePerUnitInUsdCents?: InputMaybe; + public: Scalars['Boolean']['input']; + schemaValidation?: InputMaybe; + traces?: InputMaybe; + userRoles?: InputMaybe; + webhooks?: InputMaybe; +}; + +/** + * Overall class that a billing plan falls into. This is slightly more granular than BillingPlanTier + * because it differentiates between trials, pilots, internal-only plans, etc. + */ +export enum BillingPlanKind { + /** Original version of the default free plan that we still support but is no longer offered */ + COMMUNITY = 'COMMUNITY', + /** Custom plan for serverless customers that is configured and billed manually in Stripe */ + DEDICATED = 'DEDICATED', + ENTERPRISE_INTERNAL = 'ENTERPRISE_INTERNAL', + ENTERPRISE_PAID = 'ENTERPRISE_PAID', + ENTERPRISE_PILOT = 'ENTERPRISE_PILOT', + ENTERPRISE_TRIAL = 'ENTERPRISE_TRIAL', + /** 2025 version of the default free plan */ + FREE = 'FREE', + /** @deprecated Part of initial 2022 serverless implementation; was never used in production */ + ONE_FREE = 'ONE_FREE', + /** @deprecated Part of initial 2022 serverless implementation; was never used in production */ + ONE_PAID = 'ONE_PAID', + PLACEHOLDER_FREE = 'PLACEHOLDER_FREE', + PLACEHOLDER_PAID = 'PLACEHOLDER_PAID', + /** Sales assisted Scale plan currently configured in Recurly. */ + SCALE = 'SCALE', + SCALE_ADVANCED = 'SCALE_ADVANCED', + /** New Scale plans configured in Stripe. */ + SCALE_BASIC = 'SCALE_BASIC', + SCALE_PLATFORM = 'SCALE_PLATFORM', + /** @deprecated Part of initial 2022 serverless implementation; was never used in production */ + SERVERLESS = 'SERVERLESS', + /** 2022 version of the 'serverless' free plan that we still support but is no longer offered */ + SERVERLESS_FREE = 'SERVERLESS_FREE', + /** 2022 version of the 'serverless' paid plan that we still support but is no longer offered */ + SERVERLESS_PAID = 'SERVERLESS_PAID', + /** @deprecated Part of initial 2022 serverless implementation; was never used in production */ + STARTER = 'STARTER', + /** Original version of the non-enterprise paid plan (configured in Recurly) that we still support but is no longer offered */ + TEAM_PAID = 'TEAM_PAID', + /** Original version of the non-enterprise trial plan (configured in Recurly) that we still support but is no longer offered */ + TEAM_TRIAL = 'TEAM_TRIAL', + UNKNOWN = 'UNKNOWN' +} + +export type BillingPlanLimit = { + __typename?: 'BillingPlanLimit'; + label: Scalars['String']['output']; + plan: BillingPlan; + value?: Maybe; +}; + +export type BillingPlanMutation = { + __typename?: 'BillingPlanMutation'; + /** Archive this billing plan */ + archive?: Maybe; + /** Remove the specified capability from this plan */ + clearCapability?: Maybe; + /** Remove the specified limit from this plan */ + clearLimit?: Maybe; + id: Scalars['ID']['output']; + /** Reset the specified capability on this plan to the global default value for the capability */ + resetCapability?: Maybe; + /** Reset the specified limit on this plan to the global default value for the limit */ + resetLimit?: Maybe; + /** Sets the specified capability on this plan to the provided value */ + setCapability?: Maybe; + /** Sets the specified limit on this plan to the provided value */ + setLimit?: Maybe; + updateDescriptors?: Maybe; + /** Update a plan */ + updatePlan?: Maybe; + /** Add Stripe pricing rates for this plan */ + upsertStripeRates?: Maybe; +}; + + +export type BillingPlanMutationClearCapabilityArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingPlanMutationClearLimitArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingPlanMutationResetCapabilityArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingPlanMutationResetLimitArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingPlanMutationSetCapabilityArgs = { + label: Scalars['String']['input']; + value: Scalars['Boolean']['input']; +}; + + +export type BillingPlanMutationSetLimitArgs = { + label: Scalars['String']['input']; + value?: InputMaybe; +}; + + +export type BillingPlanMutationUpdateDescriptorsArgs = { + input?: InputMaybe; +}; + + +export type BillingPlanMutationUpdatePlanArgs = { + input?: InputMaybe; +}; + + +export type BillingPlanMutationUpsertStripeRatesArgs = { + priceIds: Array; +}; + +export enum BillingPlanTier { + /** Original version of the default free plan that we still support but is no longer offered */ + COMMUNITY = 'COMMUNITY', + ENTERPRISE = 'ENTERPRISE', + /** 2025 version of the 'serverless' free plan */ + FREE = 'FREE', + /** @deprecated Part of initial 2022 serverless implementation; was never used in production */ + ONE = 'ONE', + /** 2025 version of the 'serverless' paid plan */ + SCALE = 'SCALE', + /** Original version of the non-enterprise paid plan (configured in Recurly) that we still support but is no longer offered */ + TEAM = 'TEAM', + UNKNOWN = 'UNKNOWN', + /** 2022 version of the 'serverless' free plan that we still support but is no longer offered */ + USAGE_BASED = 'USAGE_BASED' +} + +export enum BillingProvider { + APOLLO_NO_INVOICING = 'APOLLO_NO_INVOICING', + METRONOME = 'METRONOME', + NONE = 'NONE', + RECURLY = 'RECURLY', + STRIPE = 'STRIPE' +} + +export type BillingSubscription = { + __typename?: 'BillingSubscription'; + activatedAt: Scalars['Timestamp']['output']; + addons: Array; + /** Retrieve all capabilities for this subscription */ + allCapabilities: Array; + /** Retrieve a list of all effective capability limits for this subscription */ + allLimits: Array; + autoRenew: Scalars['Boolean']['output']; + canceledAt?: Maybe; + /** + * Draft invoice for this subscription + * @deprecated This data came from Metronome and we no longer use Metronome + */ + currentDraftInvoice?: Maybe; + currentPeriodEndsAt: Scalars['Timestamp']['output']; + currentPeriodStartedAt: Scalars['Timestamp']['output']; + /** Retrieve the limit applied to this subscription for a capability */ + effectiveLimit?: Maybe; + expiresAt?: Maybe; + /** Renewal grace time for updating seat count */ + graceTimeForNextRenewal?: Maybe; + /** Check whether a capability is enabled for the subscription */ + hasCapability?: Maybe; + maxSelfHostedRequestsPerMonth?: Maybe; + maxServerlessRequestsPerMonth?: Maybe; + plan: BillingPlan; + /** The price of every seat */ + pricePerSeatInUsdCents?: Maybe; + /** The price of every unit in the subscription (hence multiplied by quantity to get to the basePriceInUsdCents) */ + pricePerUnitInUsdCents: Scalars['Int']['output']; + quantity: Scalars['Int']['output']; + /** Total price of the subscription when it next renews, including add-ons (such as seats) */ + renewalTotalPriceInUsdCents: Scalars['Long']['output']; + state: SubscriptionState; + /** + * When this subscription's trial period expires (if it is a trial). Not the same as the + * subscription's Recurly expiration). + */ + trialExpiresAt?: Maybe; + uuid: Scalars['ID']['output']; +}; + + +export type BillingSubscriptionEffectiveLimitArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingSubscriptionHasCapabilityArgs = { + label: Scalars['String']['input']; +}; + +export type BillingSubscriptionAddon = { + __typename?: 'BillingSubscriptionAddon'; + id: Scalars['ID']['output']; + pricePerUnitInUsdCents: Scalars['Int']['output']; + quantity: Scalars['Int']['output']; +}; + +export type BillingSubscriptionMutation = { + __typename?: 'BillingSubscriptionMutation'; + /** Remove the specified capability override for this subscription */ + clearCapability?: Maybe; + /** Remove the specified limit override for this subscription */ + clearLimit?: Maybe; + /** Sets the capability override on this subscription to the provided value */ + setCapability?: Maybe; + /** Sets the limit override on this subscription to the provided value */ + setLimit?: Maybe; + uuid: Scalars['ID']['output']; +}; + + +export type BillingSubscriptionMutationClearCapabilityArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingSubscriptionMutationClearLimitArgs = { + label: Scalars['String']['input']; +}; + + +export type BillingSubscriptionMutationSetCapabilityArgs = { + label: Scalars['String']['input']; + value: Scalars['Boolean']['input']; +}; + + +export type BillingSubscriptionMutationSetLimitArgs = { + label: Scalars['String']['input']; + value?: InputMaybe; +}; + +export type BillingTier = { + __typename?: 'BillingTier'; + searchAccounts: Array; + tier: BillingPlanTier; +}; + + +export type BillingTierSearchAccountsArgs = { + search?: InputMaybe; +}; + +/** Columns of BillingUsageStats. */ +export enum BillingUsageStatsColumn { + ACCOUNT_ID = 'ACCOUNT_ID', + AGENT_ID = 'AGENT_ID', + AGENT_VERSION = 'AGENT_VERSION', + GRAPH_DEPLOYMENT_TYPE = 'GRAPH_DEPLOYMENT_TYPE', + OPERATION_COUNT = 'OPERATION_COUNT', + OPERATION_COUNT_PROVIDED_EXPLICITLY = 'OPERATION_COUNT_PROVIDED_EXPLICITLY', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + ROUTER_FEATURES_ENABLED = 'ROUTER_FEATURES_ENABLED', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type BillingUsageStatsDimensions = { + __typename?: 'BillingUsageStatsDimensions'; + accountId?: Maybe; + agentId?: Maybe; + agentVersion?: Maybe; + graphDeploymentType?: Maybe; + operationCountProvidedExplicitly?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + routerFeaturesEnabled?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in BillingUsageStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type BillingUsageStatsFilter = { + /** Selects rows whose accountId dimension equals the given value if not null. To query for the null value, use {in: {accountId: [null]}} instead. */ + accountId?: InputMaybe; + /** Selects rows whose agentId dimension equals the given value if not null. To query for the null value, use {in: {agentId: [null]}} instead. */ + agentId?: InputMaybe; + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose graphDeploymentType dimension equals the given value if not null. To query for the null value, use {in: {graphDeploymentType: [null]}} instead. */ + graphDeploymentType?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationCountProvidedExplicitly dimension equals the given value if not null. To query for the null value, use {in: {operationCountProvidedExplicitly: [null]}} instead. */ + operationCountProvidedExplicitly?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose routerFeaturesEnabled dimension equals the given value if not null. To query for the null value, use {in: {routerFeaturesEnabled: [null]}} instead. */ + routerFeaturesEnabled?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in BillingUsageStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type BillingUsageStatsFilterIn = { + /** Selects rows whose accountId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + accountId?: InputMaybe>>; + /** Selects rows whose agentId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentId?: InputMaybe>>; + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose graphDeploymentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + graphDeploymentType?: InputMaybe>>; + /** Selects rows whose operationCountProvidedExplicitly dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationCountProvidedExplicitly?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose routerFeaturesEnabled dimension is in the given list. A null value in the list means a row with null for that dimension. */ + routerFeaturesEnabled?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type BillingUsageStatsMetrics = { + __typename?: 'BillingUsageStatsMetrics'; + operationCount: Scalars['Long']['output']; +}; + +export type BillingUsageStatsOrderBySpec = { + column: BillingUsageStatsColumn; + direction: Ordering; +}; + +export type BillingUsageStatsRecord = { + __typename?: 'BillingUsageStatsRecord'; + /** Dimensions of BillingUsageStats that can be grouped by. */ + groupBy: BillingUsageStatsDimensions; + /** Metrics of BillingUsageStats that can be aggregated over. */ + metrics: BillingUsageStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export enum BillingUsageStatsWindowSize { + DAY = 'DAY', + HOUR = 'HOUR', + MONTH = 'MONTH', + NONE = 'NONE' +} + +/** The building of a Studio variant (including supergraph composition and any contract filtering) as part of a launch. */ +export type Build = { + __typename?: 'Build'; + /** The unique identifier for this build. */ + id: Scalars['ID']['output']; + /** The inputs provided to the build, including subgraph and contract details. */ + input: BuildInput; + /** The result of the build. This value is null until the build completes. */ + result?: Maybe; +}; + +export type BuildCheckFailed = { + buildInputs: BuildInputs; + buildPipelineTrack: BuildPipelineTrack; + /** A list of errors generated by this build. */ + errors: Array; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + workflowTask: BuildCheckTask; +}; + +export type BuildCheckPassed = { + buildInputs: BuildInputs; + buildPipelineTrack: BuildPipelineTrack; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + /** The SHA-256 of the supergraph schema document generated by this build. */ + supergraphSchemaHash: Scalars['SHA256']['output']; + workflowTask: BuildCheckTask; +}; + +export type BuildCheckResult = { + /** The input to the build task. */ + buildInputs: BuildInputs; + /** + * The build pipeline track of the build task, which indicates what gateway/router versions the + * build pipeline is intended to support (and accordingly controls the version of code). + */ + buildPipelineTrack: BuildPipelineTrack; + id: Scalars['ID']['output']; + /** Whether the build task passed or failed. */ + passed: Scalars['Boolean']['output']; + /** The workflow build task that generated this result. */ + workflowTask: BuildCheckTask; +}; + +export type BuildCheckTask = { + /** The result of the build check. This will be null when the task is initializing or running. */ + buildResult?: Maybe; + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** + * The build input change proposed for this check workflow. Note that for triggered downstream + * workflows, this is not the upstream variant's proposed change, but the changes for the downstream + * variant that are derived from the upstream workflow's results (e.g. the input supergraph schema). + */ + proposedBuildInputChanges: ProposedBuildInputChanges; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +/** The configuration for building a composition graph variant */ +export type BuildConfig = { + __typename?: 'BuildConfig'; + buildPipelineTrack: BuildPipelineTrack; + /** Show all uses of @tag directives to consumers in Schema Reference and Explorer */ + tagInApiSchema: Scalars['Boolean']['output']; +}; + +/** + * Exactly one of the inputs must be set in a build configuration. + * Which build configuration type is set will determine the type + * of variant that is created. Existing variants of a given type + * cannot be updated in-place to be of a different type. + */ +export type BuildConfigInput = { + /** This list will contain any directives that should get passed through to the api schema from the core schema. Anything included in this list will appear in the consumer facing schema */ + apiDirectivePassThrough: Array; + /** if buildPipelineTrack is null use the graph default */ + buildPipelineTrack?: InputMaybe; + composition?: InputMaybe; + contract?: InputMaybe; +}; + +/** A single error that occurred during the failed execution of a build. */ +export type BuildError = { + __typename?: 'BuildError'; + code?: Maybe; + failedStep?: Maybe; + locations: Array; + message: Scalars['String']['output']; +}; + +/** Contains the details of an executed build that failed. */ +export type BuildFailure = { + __typename?: 'BuildFailure'; + errorCount: Scalars['Int']['output']; + /** A list of all errors that occurred during the failed build. */ + errorMessages: Array; +}; + +export type BuildInput = CompositionBuildInput | FilterBuildInput; + +export type BuildInputs = CompositionBuildInputs | FilterBuildInputs; + +export enum BuildPipelineTrack { + FED_1_0 = 'FED_1_0', + FED_1_1 = 'FED_1_1', + FED_2_0 = 'FED_2_0', + FED_2_1 = 'FED_2_1', + FED_2_3 = 'FED_2_3', + FED_2_4 = 'FED_2_4', + FED_2_5 = 'FED_2_5', + FED_2_6 = 'FED_2_6', + FED_2_7 = 'FED_2_7', + FED_2_8 = 'FED_2_8', + FED_2_9 = 'FED_2_9', + FED_2_10 = 'FED_2_10', + FED_2_11 = 'FED_2_11', + FED_NEXT = 'FED_NEXT' +} + +export enum BuildPipelineTrackBadge { + DEPRECATED = 'DEPRECATED', + EXPERIMENTAL = 'EXPERIMENTAL', + LATEST = 'LATEST', + UNSUPPORTED = 'UNSUPPORTED' +} + +export type BuildPipelineTrackDetails = { + __typename?: 'BuildPipelineTrackDetails'; + badge?: Maybe; + buildPipelineTrack: BuildPipelineTrack; + /** currently running version of composition for this track, includes patch updates */ + compositionVersion: Scalars['String']['output']; + deprecatedAt?: Maybe; + displayName: Scalars['String']['output']; + minimumGatewayVersion?: Maybe; + /** Minimum supported router and gateway versions. Min router version can be null since fed 1 doesn't have router support. */ + minimumRouterVersion?: Maybe; + notSupportedAt?: Maybe; +}; + +export type BuildResult = BuildFailure | BuildSuccess; + +export type BuildRouterVersionInput = { + cloudRouterBranch?: InputMaybe; + routerBranch?: InputMaybe; + routerRepository?: InputMaybe; +}; + +export type BuildRouterVersionResult = BuildRouterVersionSuccess | CloudRouterTestingInvalidInputErrors; + +export type BuildRouterVersionSuccess = { + __typename?: 'BuildRouterVersionSuccess'; + jobId: Scalars['ID']['output']; +}; + +/** Contains the details of an executed build that succeeded. */ +export type BuildSuccess = { + __typename?: 'BuildSuccess'; + /** Contains the supergraph and API schemas created by composition. */ + coreSchema: CoreSchema; +}; + +export enum CacheScope { + PRIVATE = 'PRIVATE', + PUBLIC = 'PUBLIC', + UNKNOWN = 'UNKNOWN', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +/** The result of a failed call to PersistedQueryListMutation.delete due to linked variant(s). */ +export type CannotDeleteLinkedPersistedQueryListError = Error & { + __typename?: 'CannotDeleteLinkedPersistedQueryListError'; + message: Scalars['String']['output']; +}; + +export type CannotModifyOperationBodyError = Error & { + __typename?: 'CannotModifyOperationBodyError'; + message: Scalars['String']['output']; +}; + +/** Columns of CardinalityStats. */ +export enum CardinalityStatsColumn { + CLIENT_NAME_CARDINALITY = 'CLIENT_NAME_CARDINALITY', + CLIENT_VERSION_CARDINALITY = 'CLIENT_VERSION_CARDINALITY', + OPERATION_SHAPE_CARDINALITY = 'OPERATION_SHAPE_CARDINALITY', + SCHEMA_COORDINATE_CARDINALITY = 'SCHEMA_COORDINATE_CARDINALITY', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type CardinalityStatsDimensions = { + __typename?: 'CardinalityStatsDimensions'; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in CardinalityStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type CardinalityStatsFilter = { + and?: InputMaybe>; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in CardinalityStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type CardinalityStatsFilterIn = { + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type CardinalityStatsMetrics = { + __typename?: 'CardinalityStatsMetrics'; + clientNameCardinality: Scalars['Float']['output']; + clientVersionCardinality: Scalars['Float']['output']; + operationShapeCardinality: Scalars['Float']['output']; + schemaCoordinateCardinality: Scalars['Float']['output']; +}; + +export type CardinalityStatsOrderBySpec = { + column: CardinalityStatsColumn; + direction: Ordering; +}; + +export type CardinalityStatsRecord = { + __typename?: 'CardinalityStatsRecord'; + /** Dimensions of CardinalityStats that can be grouped by. */ + groupBy: CardinalityStatsDimensions; + /** Metrics of CardinalityStats that can be aggregated over. */ + metrics: CardinalityStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** A single change that was made to a definition in a schema. */ +export type Change = { + __typename?: 'Change'; + affectedQueries?: Maybe>; + /** Target arg of change made. */ + argNode?: Maybe; + /** Indication of the category of the change (e.g. addition, removal, edit). */ + category: ChangeCategory; + /** + * Node related to the top level node that was changed, such as a field in an object, + * a value in an enum or the object of an interface. + */ + childNode?: Maybe; + /** Indicates the type of change that was made, and to what (e.g., 'TYPE_REMOVED'). */ + code: Scalars['String']['output']; + /** A human-readable description of the change. */ + description: Scalars['String']['output']; + /** Top level node affected by the change. */ + parentNode?: Maybe; + /** The severity of the change (e.g., `FAILURE` or `NOTICE`) */ + severity: ChangeSeverity; + /** Short description of the change */ + shortDescription?: Maybe; + /** + * Indication of the success of the overall change, either failure, warning, or notice. + * @deprecated use severity instead + */ + type: ChangeType; +}; + +/** + * Defines a set of categories that a schema change + * can be grouped by. + */ +export enum ChangeCategory { + ADDITION = 'ADDITION', + DEPRECATION = 'DEPRECATION', + EDIT = 'EDIT', + REMOVAL = 'REMOVAL' +} + +/** + * These schema change codes represent all of the possible changes that can + * occur during the schema diff algorithm. + */ +export enum ChangeCode { + /** Type of the argument was changed. */ + ARG_CHANGED_TYPE = 'ARG_CHANGED_TYPE', + /** Argument was changed from nullable to non-nullable. */ + ARG_CHANGED_TYPE_OPTIONAL_TO_REQUIRED = 'ARG_CHANGED_TYPE_OPTIONAL_TO_REQUIRED', + /** Default value added or changed for the argument. */ + ARG_DEFAULT_VALUE_CHANGE = 'ARG_DEFAULT_VALUE_CHANGE', + /** Description was added, removed, or updated for argument. */ + ARG_DESCRIPTION_CHANGE = 'ARG_DESCRIPTION_CHANGE', + /** Argument to a field was removed. */ + ARG_REMOVED = 'ARG_REMOVED', + /** Argument to the directive was removed. */ + DIRECTIVE_ARG_REMOVED = 'DIRECTIVE_ARG_REMOVED', + /** Location of the directive was removed. */ + DIRECTIVE_LOCATION_REMOVED = 'DIRECTIVE_LOCATION_REMOVED', + /** Directive was removed. */ + DIRECTIVE_REMOVED = 'DIRECTIVE_REMOVED', + /** Repeatable flag was removed for directive. */ + DIRECTIVE_REPEATABLE_REMOVED = 'DIRECTIVE_REPEATABLE_REMOVED', + /** Enum was deprecated. */ + ENUM_DEPRECATED = 'ENUM_DEPRECATED', + /** Reason for enum deprecation changed. */ + ENUM_DEPRECATED_REASON_CHANGE = 'ENUM_DEPRECATED_REASON_CHANGE', + /** Enum deprecation was removed. */ + ENUM_DEPRECATION_REMOVED = 'ENUM_DEPRECATION_REMOVED', + /** Description was added, removed, or updated for enum value. */ + ENUM_VALUE_DESCRIPTION_CHANGE = 'ENUM_VALUE_DESCRIPTION_CHANGE', + /** Field was added to the type. */ + FIELD_ADDED = 'FIELD_ADDED', + /** Return type for the field was changed. */ + FIELD_CHANGED_TYPE = 'FIELD_CHANGED_TYPE', + /** Field was deprecated. */ + FIELD_DEPRECATED = 'FIELD_DEPRECATED', + /** Reason for field deprecation changed. */ + FIELD_DEPRECATED_REASON_CHANGE = 'FIELD_DEPRECATED_REASON_CHANGE', + /** Field deprecation removed. */ + FIELD_DEPRECATION_REMOVED = 'FIELD_DEPRECATION_REMOVED', + /** Description was added, removed, or updated for field. */ + FIELD_DESCRIPTION_CHANGE = 'FIELD_DESCRIPTION_CHANGE', + /** Type of the field in the input object was changed. */ + FIELD_ON_INPUT_OBJECT_CHANGED_TYPE = 'FIELD_ON_INPUT_OBJECT_CHANGED_TYPE', + /** Field was removed from the type. */ + FIELD_REMOVED = 'FIELD_REMOVED', + /** Field was removed from the input object. */ + FIELD_REMOVED_FROM_INPUT_OBJECT = 'FIELD_REMOVED_FROM_INPUT_OBJECT', + /** A default value was added to an input object field. */ + INPUT_OBJECT_FIELD_DEFAULT_VALUE_ADDED = 'INPUT_OBJECT_FIELD_DEFAULT_VALUE_ADDED', + /** The default value of an input object field was changed. */ + INPUT_OBJECT_FIELD_DEFAULT_VALUE_CHANGE = 'INPUT_OBJECT_FIELD_DEFAULT_VALUE_CHANGE', + /** The default value of an input object field was removed. */ + INPUT_OBJECT_FIELD_DEFAULT_VALUE_REMOVED = 'INPUT_OBJECT_FIELD_DEFAULT_VALUE_REMOVED', + /** Non-nullable field was added to the input object. (Deprecated.) */ + NON_NULLABLE_FIELD_ADDED_TO_INPUT_OBJECT = 'NON_NULLABLE_FIELD_ADDED_TO_INPUT_OBJECT', + /** Nullable field was added to the input type. (Deprecated.) */ + NULLABLE_FIELD_ADDED_TO_INPUT_OBJECT = 'NULLABLE_FIELD_ADDED_TO_INPUT_OBJECT', + /** Nullable argument was added to the field. */ + OPTIONAL_ARG_ADDED = 'OPTIONAL_ARG_ADDED', + /** Optional field was added to the input type. */ + OPTIONAL_FIELD_ADDED_TO_INPUT_OBJECT = 'OPTIONAL_FIELD_ADDED_TO_INPUT_OBJECT', + /** Non-nullable argument was added to the field. */ + REQUIRED_ARG_ADDED = 'REQUIRED_ARG_ADDED', + /** Non-nullable argument added to directive. */ + REQUIRED_DIRECTIVE_ARG_ADDED = 'REQUIRED_DIRECTIVE_ARG_ADDED', + /** Required field was added to the input object. */ + REQUIRED_FIELD_ADDED_TO_INPUT_OBJECT = 'REQUIRED_FIELD_ADDED_TO_INPUT_OBJECT', + /** Type was added to the schema. */ + TYPE_ADDED = 'TYPE_ADDED', + /** Type now implements the interface. */ + TYPE_ADDED_TO_INTERFACE = 'TYPE_ADDED_TO_INTERFACE', + /** A new value was added to the enum. */ + TYPE_ADDED_TO_UNION = 'TYPE_ADDED_TO_UNION', + /** + * Type was changed from one kind to another. + * Ex: scalar to object or enum to union. + */ + TYPE_CHANGED_KIND = 'TYPE_CHANGED_KIND', + /** Description was added, removed, or updated for type. */ + TYPE_DESCRIPTION_CHANGE = 'TYPE_DESCRIPTION_CHANGE', + /** Type (object or scalar) was removed from the schema. */ + TYPE_REMOVED = 'TYPE_REMOVED', + /** Type no longer implements the interface. */ + TYPE_REMOVED_FROM_INTERFACE = 'TYPE_REMOVED_FROM_INTERFACE', + /** Type is no longer included in the union. */ + TYPE_REMOVED_FROM_UNION = 'TYPE_REMOVED_FROM_UNION', + /** A new value was added to the enum. */ + VALUE_ADDED_TO_ENUM = 'VALUE_ADDED_TO_ENUM', + /** Value was removed from the enum. */ + VALUE_REMOVED_FROM_ENUM = 'VALUE_REMOVED_FROM_ENUM' +} + +/** + * Represents the tuple of static information + * about a particular kind of schema change. + */ +export type ChangeDefinition = { + __typename?: 'ChangeDefinition'; + category: ChangeCategory; + code: ChangeCode; + defaultSeverity: ChangeSeverity; +}; + +/** Info about a change in the context of an operation it affects */ +export type ChangeOnOperation = { + __typename?: 'ChangeOnOperation'; + /** Human-readable explanation of the impact of this change on the operation */ + impact?: Maybe; + /** The semantic info about this change, i.e. info about the change that doesn't depend on the operation */ + semanticChange: SemanticChange; +}; + +export type ChangeProposalComment = { + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + /** true if the schemaCoordinate this comment is on doesn't exist in the diff between the most recent revision & the base sdl */ + outdated: Scalars['Boolean']['output']; + schemaCoordinate: Scalars['String']['output']; + /** '#@!api!@#' for api schema, '#@!supergraph!@#' for supergraph schema, subgraph otherwise */ + schemaScope: Scalars['String']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export enum ChangeSeverity { + FAILURE = 'FAILURE', + NOTICE = 'NOTICE' +} + +/** + * Summary of the changes for a schema diff, computed by placing the changes into categories and then + * counting the size of each category. This categorization can be done in different ways, and + * accordingly there are multiple fields here for each type of categorization. + * + * Note that if an object or interface field is added/removed, there won't be any addition/removal + * changes generated for its arguments or @deprecated usages. If an enum type is added/removed, there + * will be addition/removal changes generated for its values, but not for those values' @deprecated + * usages. Description changes won't be generated for a schema element if that element (or an + * ancestor) was added/removed. + */ +export type ChangeSummary = { + __typename?: 'ChangeSummary'; + /** Counts for changes to fields of objects, input objects, and interfaces. */ + field: FieldChangeSummaryCounts; + /** Counts for all changes. */ + total: TotalChangeSummaryCounts; + /** + * Counts for changes to non-field aspects of objects, input objects, and interfaces, + * and all aspects of enums, unions, and scalars. + */ + type: TypeChangeSummaryCounts; +}; + +export enum ChangeType { + FAILURE = 'FAILURE', + NOTICE = 'NOTICE' +} + +/** An addition made to a Studio variant's changelog after a launch. */ +export type ChangelogLaunchResult = { + __typename?: 'ChangelogLaunchResult'; + createdAt: Scalars['Timestamp']['output']; + schemaTagID: Scalars['ID']['output']; +}; + +/** Destination for notifications */ +export type Channel = { + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + subscriptions: Array; +}; + +export type ChannelSubscription = { + channels: Array; + enabled: Scalars['Boolean']['output']; + id: Scalars['ID']['output']; + variant?: Maybe; +}; + +/** Graph-level configuration of checks. */ +export type CheckConfiguration = { + __typename?: 'CheckConfiguration'; + /** Time when check configuration was created */ + createdAt: Scalars['Timestamp']['output']; + /** + * During operation checks, if this option is enabled, the check will not fail or + * mark any operations as broken/changed if the default value has changed, only + * if the default value is removed completely. + */ + downgradeDefaultValueChange: Scalars['Boolean']['output']; + /** + * During operation checks, if this option is enabled, it evaluates a check + * run against zero operations as a pass instead of a failure. + */ + downgradeStaticChecks: Scalars['Boolean']['output']; + enableCustomChecks: Scalars['Boolean']['output']; + /** Whether to run Linting during schema checks. */ + enableLintChecks: Scalars['Boolean']['output']; + /** Clients to ignore during validation */ + excludedClients: Array; + /** Operation names to ignore during validation */ + excludedOperationNames?: Maybe>>; + /** Operations to ignore during validation */ + excludedOperations: Array; + /** Graph that this check configuration belongs to */ + graphID: Scalars['ID']['output']; + /** ID of the check configuration */ + id: Scalars['ID']['output']; + /** Default configuration to include operations on the base variant. */ + includeBaseVariant: Scalars['Boolean']['output']; + /** Variant overrides for validation */ + includedVariants: Array; + /** Minimum number of requests within the window for an operation to be considered. */ + operationCountThreshold: Scalars['Int']['output']; + /** + * Number of requests within the window for an operation to be considered, relative to + * total request count. Expected values are between 0 and 0.05 (minimum 5% of + * total request volume) + */ + operationCountThresholdPercentage: Scalars['Float']['output']; + /** How submitted build input diffs are handled when they match (or don't) a Proposal */ + proposalChangeMismatchSeverity: ProposalChangeMismatchSeverity; + /** + * Only check operations from the last seconds. + * The default is 7 days (604,800 seconds). + */ + timeRangeSeconds: Scalars['Long']['output']; + /** Time when check configuration was last updated */ + updatedAt: Scalars['Timestamp']['output']; + /** Identity of the last user to update the check configuration */ + updatedBy?: Maybe; +}; + +/** Filter options available when listing checks. */ +export type CheckFilterInput = { + /** A list of git commiters. For cli triggered checks, this is the author. */ + authors?: InputMaybe>; + branches?: InputMaybe>; + /** A list of actors triggering this check. For non cli triggered checks, this is the Studio User / author. */ + createdBy?: InputMaybe>; + ids?: InputMaybe>; + includeProposalChecks?: InputMaybe; + status?: InputMaybe; + subgraphs?: InputMaybe>; + variants?: InputMaybe>; +}; + +/** + * Options for filtering CheckWorkflows by status + * This should always match CheckWorkflowStatus + */ +export enum CheckFilterInputStatusOption { + FAILED = 'FAILED', + PASSED = 'PASSED', + PENDING = 'PENDING' +} + +/** The result of performing a subgraph check, including all steps. */ +export type CheckPartialSchemaResult = { + __typename?: 'CheckPartialSchemaResult'; + /** Overall result of the check. This will be null if composition validation was unsuccessful. */ + checkSchemaResult?: Maybe; + /** Result of compostion run as part of the overall subgraph check. */ + compositionValidationResult: CompositionValidationResult; + /** Whether any modifications were detected in the composed core schema. */ + coreSchemaModified: Scalars['Boolean']['output']; + /** Check workflow associated with the overall subgraph check. */ + workflow?: Maybe; +}; + +/** The possible results of a request to initiate schema checks (either a success object or one of multiple `Error` objects). */ +export type CheckRequestResult = CheckRequestSuccess | InvalidInputError | PermissionError | PlanError | RateLimitExceededError; + +/** Represents a successfully initiated execution of schema checks. This does not indicate the _result_ of the checks, only that they were initiated. */ +export type CheckRequestSuccess = { + __typename?: 'CheckRequestSuccess'; + /** The URL of the Apollo Studio page for this check. */ + targetURL: Scalars['String']['output']; + /** The unique ID for this execution of schema checks. */ + workflowID: Scalars['ID']['output']; +}; + +/** Input type to provide when running schema checks asynchronously for a non-federated graph. */ +export type CheckSchemaAsyncInput = { + /** Configuration options for the check execution. */ + config: HistoricQueryParametersInput; + /** The GitHub context to associate with the check. */ + gitContext: GitContextInput; + /** The URL of the GraphQL endpoint that Apollo Sandbox introspected to obtain the proposed schema. Required if `isSandbox` is `true`. */ + introspectionEndpoint?: InputMaybe; + /** If `true`, the check was initiated automatically by a Proposal update. */ + isProposal?: InputMaybe; + /** If `true`, the check was initiated by Apollo Sandbox. */ + isSandbox: Scalars['Boolean']['input']; + proposedSchemaDocument?: InputMaybe; +}; + +/** The result of running schema checks on a graph variant. */ +export type CheckSchemaResult = { + __typename?: 'CheckSchemaResult'; + /** The schema diff and affected operations generated by the schema check. */ + diffToPrevious: SchemaDiff; + /** The unique ID of this execution of checks. */ + operationsCheckID: Scalars['ID']['output']; + /** The URL to view the schema diff in Studio. */ + targetUrl?: Maybe; + /** Workflow associated with this check result */ + workflow?: Maybe; +}; + +export type CheckStepCompleted = { + __typename?: 'CheckStepCompleted'; + id: Scalars['ID']['output']; + status: CheckStepStatus; +}; + +export type CheckStepFailed = { + __typename?: 'CheckStepFailed'; + message: Scalars['String']['output']; +}; + +export type CheckStepInput = { + graphID: Scalars['String']['input']; + graphVariant: Scalars['String']['input']; + taskID: Scalars['ID']['input']; + workflowID: Scalars['ID']['input']; +}; + +export type CheckStepResult = CheckStepCompleted | CheckStepFailed | PermissionError | ValidationError; + +export enum CheckStepStatus { + FAILURE = 'FAILURE', + SUCCESS = 'SUCCESS' +} + +/** An individual diagnostic violation of a custom check task. */ +export type CheckViolation = { + __typename?: 'CheckViolation'; + /** + * The schema coordinate of this rule violation as defined by RFC: + * https://github.com/graphql/graphql-wg/blob/main/rfcs/SchemaCoordinates.md + * Optional for violations that aren't specific to a single schema element + */ + coordinate?: Maybe; + /** The violation level for the rule. */ + level: ViolationLevel; + /** A human-readable message describing the rule violation, rendered as markdown in Apollo Studio. Maximum length: 512 characters. */ + message: Scalars['String']['output']; + /** The rule being violated. This is used to group multiple violations together in Studio. Max character length is 128. */ + rule: Scalars['String']['output']; + /** The start and end position in the file of the rule violation. Used to display rule violations in the context of your schema diff. */ + sourceLocations?: Maybe>; +}; + +/** An individual diagnostic violation of a custom check task. */ +export type CheckViolationInput = { + /** + * The schema coordinate of this rule violation as defined by RFC: + * https://github.com/graphql/graphql-wg/blob/main/rfcs/SchemaCoordinates.md + * Optional for violations that aren't specific to a single schema element + */ + coordinate?: InputMaybe; + /** The violation level for the rule. */ + level: ViolationLevel; + /** A human-readable message describing the rule violation, rendered as markdown in Apollo Studio. Maximum length: 512 characters. */ + message: Scalars['String']['input']; + /** The rule being violated. This is used to group multiple violations together in Studio. Max character length is 128. */ + rule: Scalars['String']['input']; + /** The start and end position in the file of the rule violation. Used to display rule violations in the context of your schema diff. */ + sourceLocations?: InputMaybe>; +}; + +export type CheckWorkflow = { + __typename?: 'CheckWorkflow'; + /** The supergraph schema provided as the base to check against. */ + baseSchemaHash?: Maybe; + /** The base subgraphs provided as the base to check against. */ + baseSubgraphs?: Maybe>; + /** + * The variant provided as a base to check against. Only the differences from the + * base schema will be tested in operations checks. + */ + baseVariant?: Maybe; + /** The build task associated with this workflow, or null if no such task was scheduled. */ + buildTask?: Maybe; + /** The timestamp when the check workflow completed. */ + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** The downstream task associated with this workflow, or null if no such task kind was scheduled. */ + downstreamTask?: Maybe; + /** Contextual parameters supplied by the runtime environment where the check was run. */ + gitContext?: Maybe; + /** The graph this check workflow belongs to. */ + graph: Service; + id: Scalars['ID']['output']; + /** The name of the implementing service that was responsible for triggering the validation. */ + implementingServiceName?: Maybe; + /** If this check is triggered for an sdl fetched using introspection, this is the endpoint where that schema was being served. */ + introspectionEndpoint?: Maybe; + /** Only true if the check was triggered from a proposal update. */ + isProposalCheck: Scalars['Boolean']['output']; + /** Only true if the check was triggered from Sandbox Checks page. */ + isSandboxCheck: Scalars['Boolean']['output']; + /** The operations task associated with this workflow, or null if no such task was scheduled. */ + operationsTask?: Maybe; + /** If this check came from a proposal, this is the revision that triggered the check. */ + proposalRevision?: Maybe; + /** The proposed supergraph schema being checked by this check workflow. */ + proposedSchemaHash?: Maybe; + /** The proposed subgraphs for this check workflow. */ + proposedSubgraphs?: Maybe>; + /** If this check was created by rerunning, the original check workflow that was rerun. */ + rerunOf?: Maybe; + /** Checks created by re-running this check, most recent first. */ + reruns?: Maybe>; + /** The timestamp when the check workflow started. */ + startedAt?: Maybe; + /** Overall status of the workflow, based on the underlying task statuses. */ + status: CheckWorkflowStatus; + /** The names of the subgraphs with changes that triggered the validation. */ + subgraphNames: Array; + /** The set of check tasks associated with this workflow, e.g. composition, operations, etc. */ + tasks: Array; + /** Identity of the user who ran this check */ + triggeredBy?: Maybe; + /** The upstream workflow that triggered this workflow, or null if such an upstream workflow does not exist. */ + upstreamWorkflow?: Maybe; + /** Configuration of validation at the time the check was run. */ + validationConfig?: Maybe; +}; + + +export type CheckWorkflowRerunsArgs = { + limit?: Scalars['Int']['input']; +}; + +export type CheckWorkflowMutation = { + __typename?: 'CheckWorkflowMutation'; + /** The graph this check workflow belongs to. */ + graph: Service; + id: Scalars['ID']['output']; + /** + * Re-run a check workflow using the current check configuration. The result is either a workflow ID that + * can be used to check the status or an error message that explains what went wrong. + */ + rerunAsync: CheckRequestResult; +}; + + +export type CheckWorkflowMutationRerunAsyncArgs = { + input?: InputMaybe; +}; + +export enum CheckWorkflowStatus { + FAILED = 'FAILED', + PASSED = 'PASSED', + PENDING = 'PENDING' +} + +export type CheckWorkflowTask = { + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** + * The status of this task. All tasks start with the PENDING status while initializing. If any + * prerequisite task fails, then the task status becomes BLOCKED. Otherwise, if all prerequisite + * tasks pass, then this task runs (still having the PENDING status). Once the task completes, the + * task status will become either PASSED or FAILED. + */ + status: CheckWorkflowTaskStatus; + /** A studio UI url to view the details of this check workflow task */ + targetURL?: Maybe; + /** The workflow that this task belongs to. */ + workflow: CheckWorkflow; +}; + +export enum CheckWorkflowTaskStatus { + BLOCKED = 'BLOCKED', + FAILED = 'FAILED', + PASSED = 'PASSED', + PENDING = 'PENDING' +} + +/** A client to be filtered. */ +export type ClientFilter = { + __typename?: 'ClientFilter'; + /** Name of the client is required. */ + name: Scalars['String']['output']; + /** Version string of the client. */ + version?: Maybe; +}; + +/** + * Options to filter by client reference ID, client name, and client version. + * If passing client version, make sure to either provide a client reference ID or client name. + */ +export type ClientFilterInput = { + /** name of the client set by the user and reported alongside metrics */ + name: Scalars['String']['input']; + /** version of the client set by the user and reported alongside metrics */ + version?: InputMaybe; +}; + +/** Filter options to exclude by client reference ID, client name, and client version. */ +export type ClientInfoFilter = { + name: Scalars['String']['input']; + /** Ignored */ + referenceID?: InputMaybe; + version?: InputMaybe; +}; + +/** Filter options to exclude clients. Used as an output type for SchemaDiffValidationConfig. */ +export type ClientInfoFilterOutput = { + __typename?: 'ClientInfoFilterOutput'; + name: Scalars['String']['output']; + version?: Maybe; +}; + +/** Cloud queries */ +export type Cloud = { + __typename?: 'Cloud'; + /** Return a given RouterConfigVersion */ + configVersion?: Maybe; + /** Return all RouterConfigVersions */ + configVersions: Array; + /** Cloud Router constants */ + constants: CloudConstants; + order?: Maybe; + /** The regions where a cloud router can be deployed */ + regions: Array; + /** Return the Cloud Router associated with the provided graphRef */ + router?: Maybe; + /** Retrieve a Cloud Router by its internal ID */ + routerByInternalId?: Maybe; + /** Retrieve all routers */ + routers: Array; + /** Return the Shard associated with the provided id */ + shard?: Maybe; + /** Return all Shards */ + shards: Array; + /** Information about a specific Cloud Router version */ + version: RouterVersionResult; + /** A list of Cloud Router versions */ + versions: RouterVersionsResult; +}; + + +/** Cloud queries */ +export type CloudConfigVersionArgs = { + name: Scalars['String']['input']; +}; + + +/** Cloud queries */ +export type CloudConfigVersionsArgs = { + first?: InputMaybe; + offset?: InputMaybe; +}; + + +/** Cloud queries */ +export type CloudOrderArgs = { + orderId: Scalars['String']['input']; +}; + + +/** Cloud queries */ +export type CloudRegionsArgs = { + provider: CloudProvider; + tier?: InputMaybe; +}; + + +/** Cloud queries */ +export type CloudRouterArgs = { + id: Scalars['ID']['input']; +}; + + +/** Cloud queries */ +export type CloudRouterByInternalIdArgs = { + internalId: Scalars['ID']['input']; +}; + + +/** Cloud queries */ +export type CloudRoutersArgs = { + first?: InputMaybe; + offset?: InputMaybe; + statuses?: InputMaybe>; +}; + + +/** Cloud queries */ +export type CloudShardArgs = { + id: Scalars['ID']['input']; +}; + + +/** Cloud queries */ +export type CloudShardsArgs = { + first?: InputMaybe; + offset?: InputMaybe; + provider?: InputMaybe; + tier?: InputMaybe; +}; + + +/** Cloud queries */ +export type CloudVersionArgs = { + version: Scalars['String']['input']; +}; + + +/** Cloud queries */ +export type CloudVersionsArgs = { + input: RouterVersionsInput; +}; + +/** Constants for Cloud Routers */ +export type CloudConstants = { + __typename?: 'CloudConstants'; + /** Minimum duration between last request and auto-deleting a Serverless Cloud Router */ + durationBeforeDeleteSecs: Scalars['Int']['output']; + /** + * Minimum duration between last request and the auto-delete warning for a Serverless + * Cloud Router + */ + durationBeforeDeleteWarningSecs: Scalars['Int']['output']; + /** Minimum duration between last request and auto-pausing a Serverless Cloud Router */ + durationBeforeSleepSecs: Scalars['Int']['output']; + /** + * Minimum duration between last request and the auto-pause warning for a Serverless + * Cloud Router + */ + durationBeforeSleepWarningSecs: Scalars['Int']['output']; +}; + +/** Invalid input error */ +export type CloudInvalidInputError = { + __typename?: 'CloudInvalidInputError'; + /** Argument related to the error */ + argument: Scalars['String']['output']; + /** Location of the error */ + location?: Maybe; + /** Reason for the error */ + reason: Scalars['String']['output']; +}; + +/** Cloud mutations */ +export type CloudMutation = { + __typename?: 'CloudMutation'; + /** Create a new RouterConfigVersion */ + createConfigVersion: RouterVersionConfigResult; + /** Create a new Cloud Router */ + createRouter: CreateRouterResult; + /** Create a new Shard */ + createShard: ShardResult; + /** Create a new router version */ + createVersion: CreateRouterVersionResult; + /** Destroy an existing Cloud Router */ + destroyRouter: DestroyRouterResult; + order?: Maybe; + /** Fetch a Cloud Router for mutations */ + router?: Maybe; + /** Update a RouterConfigVersion */ + updateConfigVersion: RouterVersionConfigResult; + /** Update an existing Cloud Router */ + updateRouter: UpdateRouterResult; + /** Update an existing Shard */ + updateShard: ShardResult; + /** Update an existing router version */ + updateVersion: UpdateRouterVersionResult; +}; + + +/** Cloud mutations */ +export type CloudMutationCreateConfigVersionArgs = { + input: RouterConfigVersionInput; +}; + + +/** Cloud mutations */ +export type CloudMutationCreateRouterArgs = { + id: Scalars['ID']['input']; + input: CreateRouterInput; +}; + + +/** Cloud mutations */ +export type CloudMutationCreateShardArgs = { + input: CreateShardInput; +}; + + +/** Cloud mutations */ +export type CloudMutationCreateVersionArgs = { + version: RouterVersionCreateInput; +}; + + +/** Cloud mutations */ +export type CloudMutationDestroyRouterArgs = { + id: Scalars['ID']['input']; +}; + + +/** Cloud mutations */ +export type CloudMutationOrderArgs = { + orderId: Scalars['String']['input']; +}; + + +/** Cloud mutations */ +export type CloudMutationRouterArgs = { + id: Scalars['ID']['input']; +}; + + +/** Cloud mutations */ +export type CloudMutationUpdateConfigVersionArgs = { + input: RouterConfigVersionInput; +}; + + +/** Cloud mutations */ +export type CloudMutationUpdateRouterArgs = { + id: Scalars['ID']['input']; + input: UpdateRouterInput; +}; + + +/** Cloud mutations */ +export type CloudMutationUpdateShardArgs = { + input: UpdateShardInput; +}; + + +/** Cloud mutations */ +export type CloudMutationUpdateVersionArgs = { + version: RouterVersionUpdateInput; +}; + +/** Cloud onboarding information */ +export type CloudOnboarding = { + __typename?: 'CloudOnboarding'; + /** Graph variant reference for Cloud Onboarding */ + graphRef: Scalars['String']['output']; + /** Cloud provider for Cloud Onboarding */ + provider: CloudProvider; + /** Region for Cloud Onboarding */ + region: RegionDescription; + /** Tier for Cloud Onboarding */ + tier: CloudTier; +}; + +/** Input to create a new Cloud Onboarding */ +export type CloudOnboardingInput = { + /** graph variant name for the onboarding */ + graphRef: Scalars['String']['input']; + /** The cloud provider */ + provider: CloudProvider; + /** Region for the Cloud Onboarding */ + region: Scalars['String']['input']; + /** Tier for the Cloud Onboarding */ + tier: CloudTier; +}; + +/** List of supported cloud providers */ +export enum CloudProvider { + /** Amazon Web Services */ + AWS = 'AWS', + /** Fly.io */ + FLY = 'FLY' +} + +/** Generic input error */ +export type CloudRouterTestingInvalidInputErrors = { + __typename?: 'CloudRouterTestingInvalidInputErrors'; + errors: Array; + message: Scalars['String']['output']; +}; + +export type CloudRouterTestingToolPaginationInput = { + cursor?: InputMaybe; + limit?: InputMaybe; +}; + +export type CloudTesting = { + __typename?: 'CloudTesting'; + routerVersionBuild?: Maybe; + routerVersionBuilds: RouterVersionBuildPageResults; + testRouter?: Maybe; +}; + + +export type CloudTestingRouterVersionBuildArgs = { + id: Scalars['ID']['input']; +}; + + +export type CloudTestingRouterVersionBuildsArgs = { + input: RouterVersionBuildsInput; +}; + + +export type CloudTestingTestRouterArgs = { + id: Scalars['ID']['input']; +}; + +export type CloudTestingMutation = { + __typename?: 'CloudTestingMutation'; + buildRouterVersion: BuildRouterVersionResult; + cancelAllRouterVersionBuilds: Scalars['Boolean']['output']; + cancelRouterVersionBuild: Scalars['Boolean']['output']; + deleteAllRouterLaunches: Scalars['Boolean']['output']; + deleteAllRouterVersionBuilds: Scalars['Boolean']['output']; + deleteTestRouter: DeleteTestRouterResult; + launchTestRouter: LaunchTestRouterResult; +}; + + +export type CloudTestingMutationBuildRouterVersionArgs = { + input: BuildRouterVersionInput; +}; + + +export type CloudTestingMutationCancelRouterVersionBuildArgs = { + id: Scalars['ID']['input']; +}; + + +export type CloudTestingMutationDeleteTestRouterArgs = { + id: Scalars['ID']['input']; +}; + + +export type CloudTestingMutationLaunchTestRouterArgs = { + input: LaunchTestRouterInput; +}; + +/** Cloud Router tiers */ +export enum CloudTier { + /** Dedicated tier */ + DEDICATED = 'DEDICATED', + /** Enterprise Cloud tier */ + ENTERPRISE = 'ENTERPRISE', + /** Serverless tier */ + SERVERLESS = 'SERVERLESS' +} + +/** Validation result */ +export type CloudValidationResult = CloudValidationSuccess | InternalServerError | InvalidInputErrors; + +/** Config validation success */ +export type CloudValidationSuccess = { + __typename?: 'CloudValidationSuccess'; + message: Scalars['String']['output']; +}; + +export type CommentFilter = { + schemaScope?: InputMaybe; + status?: InputMaybe>; + type: Array; +}; + +export enum CommentStatus { + DELETED = 'DELETED', + OPEN = 'OPEN', + RESOLVED = 'RESOLVED' +} + +export enum CommentType { + CHANGE = 'CHANGE', + GENERAL = 'GENERAL', + REVIEW = 'REVIEW' +} + +export enum ComparisonOperator { + EQUALS = 'EQUALS', + GREATER_THAN = 'GREATER_THAN', + GREATER_THAN_OR_EQUAL_TO = 'GREATER_THAN_OR_EQUAL_TO', + LESS_THAN = 'LESS_THAN', + LESS_THAN_OR_EQUAL_TO = 'LESS_THAN_OR_EQUAL_TO', + NOT_EQUALS = 'NOT_EQUALS', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export type ComposeAndFilterPreviewBuildResults = { + __typename?: 'ComposeAndFilterPreviewBuildResults'; + /** The API schema document/SDL generated from composition/filtering. */ + apiSchemaDocument: Scalars['String']['output']; + /** The supergraph core schema document/SDL generated from composition/filtering. */ + supergraphSchemaDocument: Scalars['String']['output']; +}; + +export type ComposeAndFilterPreviewComposeError = { + __typename?: 'ComposeAndFilterPreviewComposeError'; + /** A machine-readable error code. See https://www.apollographql.com/docs/federation/errors/for more info. */ + code?: Maybe; + /** The step at which composition failed. */ + failedStep?: Maybe; + /** Source locations related to the error. */ + locations?: Maybe>; + /** A human-readable message describing the error. */ + message: Scalars['String']['output']; +}; + +export type ComposeAndFilterPreviewComposeFailure = { + __typename?: 'ComposeAndFilterPreviewComposeFailure'; + /** The list of errors from failed composition. */ + composeErrors: Array; +}; + +export type ComposeAndFilterPreviewFilterError = { + __typename?: 'ComposeAndFilterPreviewFilterError'; + /** The step at which filtering failed. See https://www.apollographql.com/docs/studio/contracts/#contract-errors for more info. */ + failedStep?: Maybe; + /** A human-readable message describing the error. */ + message: Scalars['String']['output']; +}; + +export type ComposeAndFilterPreviewFilterFailure = { + __typename?: 'ComposeAndFilterPreviewFilterFailure'; + /** The results from successful composition. */ + composeResults: ComposeAndFilterPreviewBuildResults; + /** The list of errors from failed filtering. */ + filterErrors: Array; +}; + +export type ComposeAndFilterPreviewResult = ComposeAndFilterPreviewComposeFailure | ComposeAndFilterPreviewFilterFailure | ComposeAndFilterPreviewSuccess; + +export type ComposeAndFilterPreviewSubgraphChange = { + /** + * The info being changed in the named subgraph. If null, indicates that the named + * subgraph should be removed prior to composition. + */ + info?: InputMaybe; + /** The name of the subgraph being changed. */ + name: Scalars['String']['input']; +}; + +export type ComposeAndFilterPreviewSubgraphChangeInfo = { + /** + * The routing URL of the subgraph. If a subgraph with the same name exists, then this + * field can be null to indicate the existing subgraph's info should be used; using + * null otherwise results in an error. + */ + routingUrl?: InputMaybe; + /** + * The schema document/SDL of the subgraph. If a subgraph with the same name exists, + * then this field can be null to indicate the existing subgraph's info should be + * used; using null otherwise results in an error. + */ + schemaDocument?: InputMaybe; +}; + +export type ComposeAndFilterPreviewSuccess = { + __typename?: 'ComposeAndFilterPreviewSuccess'; + /** The results from successful composition. */ + composeResults: ComposeAndFilterPreviewBuildResults; + /** The results from successful filtering, or null if filtering was skipped. */ + filterResults?: Maybe; +}; + +/** The result of supergraph composition that Studio performed in response to an attempted deletion of a subgraph. */ +export type CompositionAndRemoveResult = { + __typename?: 'CompositionAndRemoveResult'; + /** The produced composition config. Will be null if there are any errors */ + compositionConfig?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** Whether the removed implementing service existed. */ + didExist: Scalars['Boolean']['output']; + /** A list of errors that occurred during composition. Errors mean that Apollo was unable to compose the graph variant's subgraphs into a supergraph schema. If any errors are present, gateways / routers are not updated. */ + errors: Array>; + /** ID that points to the results of composition. */ + graphCompositionID: Scalars['String']['output']; + /** List of subgraphs that are included in this composition. */ + subgraphConfigs: Array; + /** Whether this composition result resulted in a new supergraph schema passed to Uplink (`true`), or the build failed for any reason (`false`). For dry runs, this value is `true` if Uplink _would have_ been updated with the result. */ + updatedGateway: Scalars['Boolean']['output']; +}; + +/** The result of supergraph composition that Studio performed in response to an attempted publish of a subgraph. */ +export type CompositionAndUpsertResult = { + __typename?: 'CompositionAndUpsertResult'; + /** The generated composition config, or null if any errors occurred. */ + compositionConfig?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** A list of errors that occurred during composition. Errors mean that Apollo was unable to compose the graph variant's subgraphs into a supergraph schema. If any errors are present, gateways / routers are not updated. */ + errors: Array>; + /** ID that points to the results of composition. */ + graphCompositionID: Scalars['String']['output']; + /** The Launch result part of this subgraph publish. */ + launch?: Maybe; + /** Human-readable text describing the launch result of the subgraph publish. */ + launchCliCopy?: Maybe; + /** The URL of the Studio page for this update's associated launch, if available. */ + launchUrl?: Maybe; + /** List of subgraphs that are included in this composition. */ + subgraphConfigs: Array; + /** All subgraphs that were created from this mutation */ + subgraphsCreated: Array; + /** All subgraphs that were updated from this mutation */ + subgraphsUpdated: Array; + /** Whether this composition result resulted in a new supergraph schema passed to Uplink (`true`), or the build failed for any reason (`false`). For dry runs, this value is `true` if Uplink _would have_ been updated with the result. */ + updatedGateway: Scalars['Boolean']['output']; + /** Whether a new subgraph was created as part of this publish. */ + wasCreated: Scalars['Boolean']['output']; + /** Whether an implementingService was updated as part of this mutation */ + wasUpdated: Scalars['Boolean']['output']; +}; + +export type CompositionBuildCheckFailed = BuildCheckFailed & BuildCheckResult & CompositionBuildCheckResult & { + __typename?: 'CompositionBuildCheckFailed'; + buildInputs: CompositionBuildInputs; + buildPipelineTrack: BuildPipelineTrack; + compositionPackageVersion?: Maybe; + errors: Array; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + workflowTask: CompositionCheckTask; +}; + +export type CompositionBuildCheckPassed = BuildCheckPassed & BuildCheckResult & CompositionBuildCheckResult & { + __typename?: 'CompositionBuildCheckPassed'; + buildInputs: CompositionBuildInputs; + buildPipelineTrack: BuildPipelineTrack; + compositionPackageVersion?: Maybe; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + supergraphSchemaHash: Scalars['SHA256']['output']; + workflowTask: CompositionCheckTask; +}; + +export type CompositionBuildCheckResult = { + buildInputs: CompositionBuildInputs; + buildPipelineTrack: BuildPipelineTrack; + /** The version of the OSS apollo composition package used during build */ + compositionPackageVersion?: Maybe; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + workflowTask: CompositionCheckTask; +}; + +export type CompositionBuildInput = { + __typename?: 'CompositionBuildInput'; + subgraphs: Array; + version?: Maybe; +}; + +export type CompositionBuildInputSubgraph = { + __typename?: 'CompositionBuildInputSubgraph'; + /** The name of the subgraph. */ + name: Scalars['String']['output']; + /** The routing URL of the subgraph. */ + routingUrl: Scalars['String']['output']; + /** The SHA-256 of the schema document of the subgraph. */ + schemaHash: Scalars['SHA256']['output']; +}; + +export type CompositionBuildInputs = { + __typename?: 'CompositionBuildInputs'; + /** + * The build pipeline track used for composition. Note this is also the build pipeline track used + * for any triggered downstream check workflows as well. + */ + buildPipelineTrack: BuildPipelineTrack; + /** The subgraphs used for composition. */ + subgraphs: Array; +}; + +export type CompositionCheckTask = BuildCheckTask & CheckWorkflowTask & { + __typename?: 'CompositionCheckTask'; + /** The result of the composition build check. This will be null when the task is initializing or running. */ + buildResult?: Maybe; + completedAt?: Maybe; + /** + * Whether the build's output supergraph core schema differs from that of the active publish for + * the workflow's variant at the time this field executed (NOT at the time the check workflow + * started). + */ + coreSchemaModified: Scalars['Boolean']['output']; + createdAt: Scalars['Timestamp']['output']; + graphID: Scalars['ID']['output']; + id: Scalars['ID']['output']; + proposedBuildInputChanges: ProposedCompositionBuildInputChanges; + /** + * An old version of buildResult that returns a very old GraphQL type that generally should be + * avoided. This field will soon be deprecated. + */ + result?: Maybe; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +/** Composition configuration exposed to the gateway. */ +export type CompositionConfig = { + __typename?: 'CompositionConfig'; + /** + * List of GCS links for implementing services that comprise a composed graph. Is empty if tag/inaccessible is enabled. + * @deprecated Soon we will stop writing to GCS locations + */ + implementingServiceLocations: Array; + /** The resulting API schema's SHA256 hash, represented as a hexadecimal string. */ + schemaHash: Scalars['String']['output']; +}; + +export type CompositionConfigInput = { + subgraphs: Array; +}; + +/** The result of supergraph composition that Studio performed. */ +export type CompositionPublishResult = CompositionResult & { + __typename?: 'CompositionPublishResult'; + /** The generated composition config, or null if any errors occurred. */ + compositionConfig?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** A list of errors that occurred during composition. Errors mean that Apollo was unable to compose the graph variant's subgraphs into a supergraph schema. If any errors are present, gateways / routers are not updated. */ + errors: Array; + /** The unique ID for this instance of composition. */ + graphCompositionID: Scalars['ID']['output']; + graphID: Scalars['ID']['output']; + /** Null if CompositionPublishResult was not on a Proposal Variant */ + proposalRevision?: Maybe; + /** + * Cloud router configuration associated with this build event. + * It will be non-null for any cloud-router variant, and null for any not cloudy variant/graph + */ + routerConfig?: Maybe; + /** List of subgraphs that are included in this composition. */ + subgraphConfigs: Array; + /** The supergraph SDL generated by composition. */ + supergraphSdl?: Maybe; + /** Whether this composition result updated gateway/router instances via Uplink (`true`), or it was a dry run (`false`). */ + updatedGateway: Scalars['Boolean']['output']; +}; + +/** The result of supergraph composition performed by Apollo Studio, often as the result of a subgraph check or subgraph publish. See individual implementations for more details. */ +export type CompositionResult = { + createdAt: Scalars['Timestamp']['output']; + /** A list of errors that occurred during composition. Errors mean that Apollo was unable to compose the graph variant's subgraphs into a supergraph schema. If any errors are present, gateways / routers are not updated. */ + errors: Array; + /** The unique ID for this instance of composition. */ + graphCompositionID: Scalars['ID']['output']; + /** + * Cloud router configuration associated with this build event. + * It will be non-null for any cloud-router variant, and null for any not cloudy variant/graph + */ + routerConfig?: Maybe; + /** List of subgraphs included in this composition. */ + subgraphConfigs: Array; + /** Supergraph SDL generated by composition. */ + supergraphSdl?: Maybe; +}; + +export type CompositionStatusSubscription = ChannelSubscription & { + __typename?: 'CompositionStatusSubscription'; + channels: Array; + createdAt: Scalars['Timestamp']['output']; + enabled: Scalars['Boolean']['output']; + id: Scalars['ID']['output']; + lastUpdatedAt: Scalars['Timestamp']['output']; + variant?: Maybe; +}; + +/** The composition config exposed to the gateway */ +export type CompositionValidationDetails = { + __typename?: 'CompositionValidationDetails'; + /** Hash of the composed schema */ + schemaHash?: Maybe; +}; + +/** The result of composition validation run by Apollo Studio during a subgraph check. */ +export type CompositionValidationResult = CompositionResult & { + __typename?: 'CompositionValidationResult'; + /** Describes whether composition succeeded. */ + compositionSuccess: Scalars['Boolean']['output']; + /** + * Akin to a composition config, represents the subgraph schemas and corresponding subgraphs that were used + * in running composition. Will be null if any errors are encountered. Also may contain a schema hash if + * one could be computed, which can be used for schema validation. + */ + compositionValidationDetails?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** A list of errors that occurred during composition. Errors mean that Apollo was unable to compose the graph variant's subgraphs into a supergraph schema. If any errors are present, gateways / routers are not updated. */ + errors: Array; + /** The unique ID for this instance of composition. */ + graphCompositionID: Scalars['ID']['output']; + /** + * The implementing service that was responsible for triggering the validation + * @deprecated The proposed subgraph is now exposed under proposedSubgraphs, a list. If a single subgraph check was run the list will be one subgraph long. + */ + proposedImplementingService: FederatedImplementingServicePartialSchema; + /** DO NOT USE, NOT YET IMPLEMENTED. The subgraphs with changes that were responsible for triggering the validation */ + proposedSubgraphs: Array; + /** + * Cloud router configuration associated with this build event. + * It will be non-null for any cloud-router variant, and null for any not cloudy variant/graph + */ + routerConfig?: Maybe; + /** List of subgraphs that are included in this composition. */ + subgraphConfigs: Array; + /** The supergraph schema document generated by composition. */ + supergraphSdl?: Maybe; + /** If created as part of a check workflow, the associated workflow task. */ + workflowTask?: Maybe; +}; + +export type ContractConfigInput = { + baseGraphRef: Scalars['String']['input']; + filterConfigInput: FilterConfigInput; +}; + +export type ContractPreview = { + __typename?: 'ContractPreview'; + result: ContractPreviewResult; + upstreamLaunch: Launch; +}; + +export type ContractPreviewErrors = { + __typename?: 'ContractPreviewErrors'; + errors: Array; + failedAt: ContractVariantFailedStep; +}; + +export type ContractPreviewResult = ContractPreviewErrors | ContractPreviewSuccess; + +export type ContractPreviewSuccess = { + __typename?: 'ContractPreviewSuccess'; + apiDocument: Scalars['String']['output']; + coreDocument: Scalars['String']['output']; + fieldCount: Scalars['Int']['output']; + typeCount: Scalars['Int']['output']; +}; + +export enum ContractVariantFailedStep { + ADD_DIRECTIVE_DEFINITIONS_IF_NOT_PRESENT = 'ADD_DIRECTIVE_DEFINITIONS_IF_NOT_PRESENT', + ADD_INACCESSIBLE_SPEC_PURPOSE = 'ADD_INACCESSIBLE_SPEC_PURPOSE', + DIRECTIVE_DEFINITION_LOCATION_AUGMENTING = 'DIRECTIVE_DEFINITION_LOCATION_AUGMENTING', + EMPTY_ENUM_MASKING = 'EMPTY_ENUM_MASKING', + EMPTY_INPUT_OBJECT_MASKING = 'EMPTY_INPUT_OBJECT_MASKING', + EMPTY_OBJECT_AND_INTERFACE_FIELD_MASKING = 'EMPTY_OBJECT_AND_INTERFACE_FIELD_MASKING', + EMPTY_OBJECT_AND_INTERFACE_MASKING = 'EMPTY_OBJECT_AND_INTERFACE_MASKING', + EMPTY_UNION_MASKING = 'EMPTY_UNION_MASKING', + INPUT_VALIDATION = 'INPUT_VALIDATION', + PARSING = 'PARSING', + PARSING_TAG_DIRECTIVES = 'PARSING_TAG_DIRECTIVES', + PARTIAL_INTERFACE_MASKING = 'PARTIAL_INTERFACE_MASKING', + SCHEMA_RETRIEVAL = 'SCHEMA_RETRIEVAL', + TAG_INHERITING = 'TAG_INHERITING', + TAG_MATCHING = 'TAG_MATCHING', + TO_API_SCHEMA = 'TO_API_SCHEMA', + TO_FILTER_SCHEMA = 'TO_FILTER_SCHEMA', + UNKNOWN = 'UNKNOWN', + UNREACHABLE_TYPE_MASKING = 'UNREACHABLE_TYPE_MASKING', + VERSION_CHECK = 'VERSION_CHECK' +} + +export type ContractVariantUpsertErrors = { + __typename?: 'ContractVariantUpsertErrors'; + /** A list of all errors that occurred when attempting to create or update a contract variant. */ + errorMessages: Array; +}; + +export type ContractVariantUpsertResult = ContractVariantUpsertErrors | ContractVariantUpsertSuccess; + +export type ContractVariantUpsertSuccess = { + __typename?: 'ContractVariantUpsertSuccess'; + /** The updated contract variant */ + contractVariant: GraphVariant; + /** Human-readable text describing the launch result of the contract update. */ + launchCliCopy?: Maybe; + /** The URL of the Studio page for this update's associated launch, if available. */ + launchUrl?: Maybe; +}; + +export type Coordinate = { + __typename?: 'Coordinate'; + byteOffset: Scalars['Int']['output']; + column: Scalars['Int']['output']; + line: Scalars['Int']['output']; +}; + +export type CoordinateInsights = { + __typename?: 'CoordinateInsights'; + /** If the first or last seen timestamps are earlier than this timestamp, we can't tell the exact date that we saw this coordinate since our data is bound by the retention period. */ + earliestRetentionTime?: Maybe; + /** The earliest time we saw references or executions for this coordinate. Null if the coordinate has never been seen or it is not in the schema. */ + firstSeen?: Maybe; + /** The most recent time we saw references or executions for this coordinate. Null if the coordinate has never been seen or it is not in the schema. */ + lastSeen?: Maybe; +}; + +export type CoordinateInsightsListFilterInInput = { + clientName?: InputMaybe>>; + clientVersion?: InputMaybe>>; +}; + +export type CoordinateInsightsListFilterInput = { + clientName?: InputMaybe; + clientVersion?: InputMaybe; + coordinateKind?: InputMaybe; + in?: InputMaybe; + isDeprecated?: InputMaybe; + isUnused?: InputMaybe; + or?: InputMaybe>; + /** Filters on partial string matches of Named Type and Named Attribute */ + search?: InputMaybe; +}; + +export type CoordinateInsightsListItem = { + __typename?: 'CoordinateInsightsListItem'; + /** The estimated number of field executions for this field, based on the field execution sample rate. This can be null depending on the sort order. */ + estimatedExecutionCount?: Maybe; + /** The number of field executions recorded for this field. This can be null depending on the sort order. */ + executionCount?: Maybe; + isDeprecated: Scalars['Boolean']['output']; + isUnused: Scalars['Boolean']['output']; + namedAttribute: Scalars['String']['output']; + namedType: Scalars['String']['output']; + /** The count of operations that reference the coordinate. This can be null depending on the sort order. */ + referencingOperationCount?: Maybe; + /** The count of operations that reference the coordinate per minute. This can be null depending on the sort order. */ + referencingOperationCountPerMin?: Maybe; +}; + +export enum CoordinateInsightsListOrderByColumn { + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REFERENCING_OPERATION_COUNT_PER_MIN = 'REFERENCING_OPERATION_COUNT_PER_MIN', + SCHEMA_COORDINATE = 'SCHEMA_COORDINATE' +} + +export type CoordinateInsightsListOrderByInput = { + column: CoordinateInsightsListOrderByColumn; + direction: Ordering; +}; + +/** Information about pagination in a connection. */ +export type CoordinateInsightsListPageInfo = { + __typename?: 'CoordinateInsightsListPageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export enum CoordinateKind { + ENUM_VALUE = 'ENUM_VALUE', + INPUT_OBJECT_FIELD = 'INPUT_OBJECT_FIELD', + OBJECT_FIELD = 'OBJECT_FIELD' +} + +/** Columns of CoordinateUsage. */ +export enum CoordinateUsageColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + KIND = 'KIND', + NAMED_ATTRIBUTE = 'NAMED_ATTRIBUTE', + NAMED_TYPE = 'NAMED_TYPE', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REQUEST_COUNT_NULL = 'REQUEST_COUNT_NULL', + REQUEST_COUNT_UNDEFINED = 'REQUEST_COUNT_UNDEFINED', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type CoordinateUsageDimensions = { + __typename?: 'CoordinateUsageDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + kind?: Maybe; + namedAttribute?: Maybe; + namedType?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in CoordinateUsage. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type CoordinateUsageFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + /** Selects rows whose kind dimension equals the given value if not null. To query for the null value, use {in: {kind: [null]}} instead. */ + kind?: InputMaybe; + /** Selects rows whose namedAttribute dimension equals the given value if not null. To query for the null value, use {in: {namedAttribute: [null]}} instead. */ + namedAttribute?: InputMaybe; + /** Selects rows whose namedType dimension equals the given value if not null. To query for the null value, use {in: {namedType: [null]}} instead. */ + namedType?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in CoordinateUsage. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type CoordinateUsageFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose kind dimension is in the given list. A null value in the list means a row with null for that dimension. */ + kind?: InputMaybe>>; + /** Selects rows whose namedAttribute dimension is in the given list. A null value in the list means a row with null for that dimension. */ + namedAttribute?: InputMaybe>>; + /** Selects rows whose namedType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + namedType?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type CoordinateUsageMetrics = { + __typename?: 'CoordinateUsageMetrics'; + estimatedExecutionCount: Scalars['Long']['output']; + executionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; + requestCountNull: Scalars['Long']['output']; + requestCountUndefined: Scalars['Long']['output']; +}; + +export type CoordinateUsageOrderBySpec = { + column: CoordinateUsageColumn; + direction: Ordering; +}; + +export type CoordinateUsageRecord = { + __typename?: 'CoordinateUsageRecord'; + /** Dimensions of CoordinateUsage that can be grouped by. */ + groupBy: CoordinateUsageDimensions; + /** Metrics of CoordinateUsage that can be aggregated over. */ + metrics: CoordinateUsageMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Contains the supergraph and API schemas generated by composition. */ +export type CoreSchema = { + __typename?: 'CoreSchema'; + /** The composed API schema document. */ + apiDocument: Scalars['GraphQLDocument']['output']; + /** The API schema document's SHA256 hash, represented as a hexadecimal string. */ + apiHash: Scalars['String']['output']; + /** The composed supergraph schema document. */ + coreDocument: Scalars['GraphQLDocument']['output']; + /** The supergraph schema document's SHA256 hash, represented as a hexadecimal string. */ + coreHash: Scalars['String']['output']; + fieldCount: Scalars['Int']['output']; + tags: Array; + typeCount: Scalars['Int']['output']; +}; + +/** Input to create a new AWS shard */ +export type CreateAwsShardInput = { + accountId: Scalars['String']['input']; + coldStartTargetGroupArns?: InputMaybe>; + ecsClusterArn: Scalars['String']['input']; + iamRoleArn: Scalars['String']['input']; + loadbalancerSecurityGroupId: Scalars['String']['input']; + loadbalancers: Array; + permissionsBoundaryArn: Scalars['String']['input']; + region: Scalars['String']['input']; + subnetIds: Array; + vpcId: Scalars['String']['input']; +}; + +/** Result from the createCloudOnboarding mutation */ +export type CreateOnboardingResult = CreateOnboardingSuccess | InternalServerError | InvalidInputErrors; + +/** Success creating a CloudOnboarding */ +export type CreateOnboardingSuccess = { + __typename?: 'CreateOnboardingSuccess'; + onboarding: CloudOnboarding; +}; + +export type CreateOperationCollectionResult = NotFoundError | OperationCollection | PermissionError | ValidationError; + +/** The result of a successful call to GraphMutation.createPersistedQueryList. */ +export type CreatePersistedQueryListResult = { + __typename?: 'CreatePersistedQueryListResult'; + persistedQueryList: PersistedQueryList; +}; + +/** The result/error union returned by GraphMutation.createPersistedQueryList. */ +export type CreatePersistedQueryListResultOrError = CreatePersistedQueryListResult | PermissionError; + +/** An error that occurs when creating a proposal fails. */ +export type CreateProposalError = Error & { + __typename?: 'CreateProposalError'; + /** The error's details. */ + message: Scalars['String']['output']; +}; + +export type CreateProposalInput = { + description?: InputMaybe; + displayName: Scalars['String']['input']; + sourceVariantName: Scalars['String']['input']; +}; + +export type CreateProposalLifecycleSubscriptionInput = { + events: Array; + webhookChannelID: Scalars['ID']['input']; +}; + +export type CreateProposalLifecycleSubscriptionResult = PermissionError | ProposalLifecycleSubscription | ValidationError; + +export type CreateProposalResult = CreateProposalError | GraphVariant | PermissionError | ValidationError; + +/** Input to create a new Cloud Router */ +export type CreateRouterInput = { + /** + * Number of GCUs allocated for the Cloud Router + * + * This is ignored for serverless Cloud Routers + */ + gcus?: InputMaybe; + /** Graph composition ID, also known as launch ID */ + graphCompositionId?: InputMaybe; + /** Unique identifier for ordering orders */ + orderingId: Scalars['String']['input']; + /** Configuration for the Cloud Router */ + routerConfig?: InputMaybe; + /** Router version for the Cloud Router */ + routerVersion?: InputMaybe; +}; + +/** Represents the possible outcomes of a createRouter mutation */ +export type CreateRouterResult = CreateRouterSuccess | InternalServerError | InvalidInputErrors; + +/** + * Success branch of a createRouter mutation + * + * id of the order can be polled + * via Query.cloud().order(id: ID!) to check-in on the progress + * of the underlying operation + */ +export type CreateRouterSuccess = { + __typename?: 'CreateRouterSuccess'; + order: Order; +}; + +/** Result of a createVersion mutation */ +export type CreateRouterVersionResult = InternalServerError | InvalidInputErrors | RouterVersion; + +export type CreateRuleEnforcementInput = { + graphVariant?: InputMaybe; + params?: InputMaybe>; + policy: EnforcementPolicy; +}; + +/** Input to create a new Shard */ +export type CreateShardInput = { + aws?: InputMaybe; + gcuCapacity?: InputMaybe; + gcuUsage?: InputMaybe; + provider: CloudProvider; + reason?: InputMaybe; + routerCapacity?: InputMaybe; + routerUsage?: InputMaybe; + shardId: Scalars['String']['input']; + status?: InputMaybe; + tier: CloudTier; +}; + +export type CronExecution = { + __typename?: 'CronExecution'; + completedAt?: Maybe; + failure?: Maybe; + id: Scalars['ID']['output']; + job: CronJob; + resolvedAt?: Maybe; + resolvedBy?: Maybe; + schedule: Scalars['String']['output']; + startedAt: Scalars['Timestamp']['output']; +}; + +export type CronJob = { + __typename?: 'CronJob'; + group: Scalars['String']['output']; + name: Scalars['String']['output']; + recentExecutions: Array; +}; + + +export type CronJobRecentExecutionsArgs = { + n?: InputMaybe; +}; + +export type CustomCheckCallbackInput = { + /** Sets the status of your check task. Setting this status to FAILURE will cause the entire check workflow to fail. */ + status: CheckStepStatus; + /** The ID of the custom check task, provided in the webhook payload. */ + taskId: Scalars['ID']['input']; + /** The violations found by your check task. Max length is 1000 */ + violations?: InputMaybe>; + /** The ID of the workflow that the custom check task is a member of, provided in the webhook payload. */ + workflowId: Scalars['ID']['input']; +}; + +/** Result of a custom check task callback mutation. */ +export type CustomCheckCallbackResult = CustomCheckResult | PermissionError | TaskError | ValidationError; + +/** Custom check configuration detailing webhook integration. */ +export type CustomCheckConfiguration = { + __typename?: 'CustomCheckConfiguration'; + channel: CustomCheckWebhookChannel; + id: Scalars['ID']['output']; +}; + +/** Result of a custom check configuration update mutation. */ +export type CustomCheckConfigurationResult = CustomCheckConfiguration | PermissionError | ValidationError; + +export type CustomCheckResult = { + __typename?: 'CustomCheckResult'; + violations: Array; +}; + +export type CustomCheckTask = CheckWorkflowTask & { + __typename?: 'CustomCheckTask'; + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + graphID: Scalars['ID']['output']; + id: Scalars['ID']['output']; + result?: Maybe; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +/** Configuration of a webhook integration for a custom check. */ +export type CustomCheckWebhookChannel = { + __typename?: 'CustomCheckWebhookChannel'; + /** The time when this CustomCheckWebhookChannel was created. */ + createdAt: Scalars['Timestamp']['output']; + /** The Identity that created this CustomCheckWebhookChannel. null if the Identity has been deleted. */ + createdBy?: Maybe; + /** The ID for this webhook channel */ + id: Scalars['ID']['output']; + /** The last time this subscription was updated, if never updated will be the createdAt time. */ + lastUpdatedAt: Scalars['Timestamp']['output']; + /** The Identity that last updated this CustomCheckWebhookChannel, or the creator if no one has updated. null if the Identity has been deleted. */ + lastUpdatedBy?: Maybe; + /** Whether or not a secret token has been set on this channel. */ + secretTokenIsSet: Scalars['Boolean']['output']; + /** The URL to send the webhook to. */ + url: Scalars['String']['output']; + /** The variant name if this channel is only configured for a specific variant. If null, this configuration applies to all variants. */ + variant?: Maybe; +}; + +export enum DatadogApiRegion { + EU = 'EU', + EU1 = 'EU1', + US = 'US', + US1 = 'US1', + US1FED = 'US1FED', + US3 = 'US3', + US5 = 'US5' +} + +export type DatadogMetricsConfig = { + __typename?: 'DatadogMetricsConfig'; + apiKey: Scalars['String']['output']; + apiRegion: DatadogApiRegion; + enabled: Scalars['Boolean']['output']; + legacyMetricNames: Scalars['Boolean']['output']; +}; + +export type DeleteCommentInput = { + id: Scalars['String']['input']; +}; + +export type DeleteCommentResult = DeleteCommentSuccess | NotFoundError | PermissionError | ValidationError; + +export type DeleteCommentSuccess = { + __typename?: 'DeleteCommentSuccess'; + comment?: Maybe; +}; + +export type DeleteCommentSuccessResult = ParentChangeProposalComment | ParentGeneralProposalComment; + +export type DeleteOperationCollectionResult = DeleteOperationCollectionSuccess | PermissionError; + +export type DeleteOperationCollectionSuccess = { + __typename?: 'DeleteOperationCollectionSuccess'; + sandboxOwner?: Maybe; + variants: Array; +}; + +/** The result of a successful call to PersistedQueryListMutation.deleteOperationsByFilter. */ +export type DeleteOperationsByFilterResult = { + __typename?: 'DeleteOperationsByFilterResult'; + /** The build created by this delete operation. */ + build?: Maybe; + /** Returns `true` if no changes were made by this operation (and no new revision was created). Otherwise, returns `false`. */ + unchanged: Scalars['Boolean']['output']; +}; + +/** The result/error union returned by PersistedQueryListMutation.deleteOperationsByFilter. */ +export type DeleteOperationsByFilterResultOrError = DeleteOperationsByFilterResult | PermissionError; + +/** The result of a successful call to PersistedQueryListMutation.delete. */ +export type DeletePersistedQueryListResult = { + __typename?: 'DeletePersistedQueryListResult'; + graph: Service; +}; + +/** The result/error union returned by PersistedQueryListMutation.delete. */ +export type DeletePersistedQueryListResultOrError = CannotDeleteLinkedPersistedQueryListError | DeletePersistedQueryListResult | PermissionError; + +export type DeleteProposalLifecycleSubscriptionInput = { + id: Scalars['String']['input']; +}; + +export type DeleteProposalLifecycleSubscriptionResult = DeleteProposalLifecycleSubscriptionSuccess | NotFoundError | PermissionError; + +export type DeleteProposalLifecycleSubscriptionSuccess = { + __typename?: 'DeleteProposalLifecycleSubscriptionSuccess'; + /** The id of the ProposalLifecycleSubscription that was deleted */ + id: Scalars['ID']['output']; +}; + +export type DeleteProposalSubgraphInput = { + previousLaunchId?: InputMaybe; + subgraphName: Scalars['String']['input']; + summary: Scalars['String']['input']; +}; + +export type DeleteProposalSubgraphResult = PermissionError | Proposal | ValidationError; + +/** The result of attempting to delete a graph variant. */ +export type DeleteSchemaTagResult = { + __typename?: 'DeleteSchemaTagResult'; + /** Whether the variant was deleted or not. */ + deleted: Scalars['Boolean']['output']; +}; + +export type DeleteTestRouterResult = CloudRouterTestingInvalidInputErrors | DeleteTestRouterSuccess; + +export type DeleteTestRouterSuccess = { + __typename?: 'DeleteTestRouterSuccess'; + jobId: Scalars['String']['output']; +}; + +export enum DeletionTargetType { + ACCOUNT = 'ACCOUNT', + USER = 'USER' +} + +/** Represents the possible outcomes of a destroyRouter mutation */ +export type DestroyRouterResult = DestroyRouterSuccess | InternalServerError | InvalidInputErrors; + +/** Success branch of a destroyRouter mutation */ +export type DestroyRouterSuccess = { + __typename?: 'DestroyRouterSuccess'; + /** + * Order for the destroyRouter mutation + * + * This could be empty if the router is already destroyed or doesn't exist, but should still + * be treated as a success. + */ + order?: Maybe; +}; + +/** Support for a single directive on a graph variant */ +export type DirectiveSupportStatus = { + __typename?: 'DirectiveSupportStatus'; + /** whether the directive is supported on the current graph variant */ + enabled: Scalars['Boolean']['output']; + /** name of the directive */ + name: Scalars['String']['output']; +}; + +/** The result of a schema checks workflow that was run on a downstream variant as part of checks for the corresponding source variant. Most commonly, these downstream checks are [contract checks](https://www.apollographql.com/docs/studio/contracts#contract-checks). */ +export type DownstreamCheckResult = { + __typename?: 'DownstreamCheckResult'; + /** Whether the downstream check workflow blocks the upstream check workflow from completing. */ + blocking: Scalars['Boolean']['output']; + /** The ID of the graph that the downstream variant belongs to. */ + downstreamGraphID: Scalars['String']['output']; + /** The name of the downstream variant. */ + downstreamVariantName: Scalars['String']['output']; + /** + * The downstream checks workflow that this result corresponds to. This value is null + * if the workflow hasn't been initialized yet, or if the downstream variant was deleted. + */ + downstreamWorkflow?: Maybe; + /** + * Whether the downstream check workflow is causing the upstream check workflow to fail. This occurs + * when the downstream check workflow is both blocking and failing. This may be null while the + * downstream check workflow is pending. + */ + failsUpstreamWorkflow?: Maybe; + /** The downstream checks task that this result corresponds to. */ + workflowTask: DownstreamCheckTask; +}; + +export type DownstreamCheckTask = CheckWorkflowTask & { + __typename?: 'DownstreamCheckTask'; + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** + * A list of results for all downstream checks triggered as part of the source variant's checks workflow. + * This value is null if the task hasn't been initialized yet, or if the build task fails (the build task is a + * prerequisite to this task). This value is _not_ null _while_ the task is running. The returned list is empty + * if the source variant has no downstream variants. + */ + results?: Maybe>; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +export enum DownstreamLaunchInitiation { + /** + * Initiate the creation of downstream launches associated with this subgraph publication asynchronously. + * The resulting API response may not provide specific details about triggered downstream launches. + */ + ASYNC = 'ASYNC', + /** + * Initiate the creation of downstream Launches associated with this subgraph publication synchronously. + * Use this option to ensure that any downstream launches will be started before the publish mutation returns. + * Note that this does not require launches to complete, but it does ensure that the downstream launch IDs are + * available to be queried from a `CompositionAndUpsertResult`. + */ + SYNC = 'SYNC' +} + +export type DraftInvoice = { + __typename?: 'DraftInvoice'; + /** @deprecated This data came from Metronome and we no longer use Metronome */ + billingPeriodEndsAt: Scalars['Timestamp']['output']; + /** @deprecated This data came from Metronome and we no longer use Metronome */ + billingPeriodStartsAt: Scalars['Timestamp']['output']; + /** + * The approximate date in the future we expect the customer to be billed if they fully complete the billing cycle + * @deprecated This data came from Metronome and we no longer use Metronome + */ + expectedInvoiceAt: Scalars['Timestamp']['output']; + /** + * When this invoice was sent to the customer, if it's been sent + * @deprecated This data came from Metronome and we no longer use Metronome + */ + invoicedAt?: Maybe; + /** + * Breakdown of this invoice's charges. May be empty if we don't have a breakdown + * @deprecated This data came from Metronome and we no longer use Metronome + */ + lineItems?: Maybe>; + /** @deprecated This data came from Metronome and we no longer use Metronome */ + subtotalInCents: Scalars['Int']['output']; + /** @deprecated This data came from Metronome and we no longer use Metronome */ + totalInCents: Scalars['Int']['output']; +}; + +export type DuplicateOperationCollectionResult = OperationCollection | PermissionError | ValidationError; + +export type DurationHistogram = { + __typename?: 'DurationHistogram'; + averageDurationMs?: Maybe; + buckets: Array; + durationMs?: Maybe; + /** Counts per durationBucket, where sequences of zeroes are replaced with the negative of their size */ + sparseBuckets: Array; + totalCount: Scalars['Long']['output']; + totalDurationMs: Scalars['Float']['output']; +}; + + +export type DurationHistogramDurationMsArgs = { + percentile: Scalars['Float']['input']; +}; + +export type DurationHistogramBucket = { + __typename?: 'DurationHistogramBucket'; + count: Scalars['Long']['output']; + index: Scalars['Int']['output']; + rangeBeginMs: Scalars['Float']['output']; + rangeEndMs: Scalars['Float']['output']; +}; + +export type EdgeServerInfo = { + /** A randomly generated UUID, immutable for the lifetime of the edge server runtime. */ + bootId: Scalars['String']['input']; + /** A unique identifier for the executable GraphQL served by the edge server. length must be <= 64 characters. */ + executableSchemaId: Scalars['String']['input']; + /** The graph variant, defaults to 'current' */ + graphVariant?: Scalars['String']['input']; + /** The version of the edge server reporting agent, e.g. apollo-server-2.8, graphql-java-3.1, etc. length must be <= 256 characters. */ + libraryVersion?: InputMaybe; + /** The infra environment in which this edge server is running, e.g. localhost, Kubernetes, AWS Lambda, Google CloudRun, AWS ECS, etc. length must be <= 256 characters. */ + platform?: InputMaybe; + /** The runtime in which the edge server is running, e.g. node 12.03, zulu8.46.0.19-ca-jdk8.0.252-macosx_x64, etc. length must be <= 256 characters. */ + runtimeVersion?: InputMaybe; + /** If available, an identifier for the edge server instance, such that when restarting this instance it will have the same serverId, with a different bootId. For example, in Kubernetes this might be the pod name. Length must be <= 256 characters. */ + serverId?: InputMaybe; + /** An identifier used to distinguish the version (from the user's perspective) of the edge server's code itself. For instance, the git sha of the server's repository or the docker sha of the associated image this server runs with. Length must be <= 256 characters. */ + userVersion?: InputMaybe; +}; + +/** Columns of EdgeServerInfos. */ +export enum EdgeServerInfosColumn { + BOOT_ID = 'BOOT_ID', + EXECUTABLE_SCHEMA_ID = 'EXECUTABLE_SCHEMA_ID', + LIBRARY_VERSION = 'LIBRARY_VERSION', + PLATFORM = 'PLATFORM', + RUNTIME_VERSION = 'RUNTIME_VERSION', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVER_ID = 'SERVER_ID', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + USER_VERSION = 'USER_VERSION' +} + +export type EdgeServerInfosDimensions = { + __typename?: 'EdgeServerInfosDimensions'; + bootId?: Maybe; + executableSchemaId?: Maybe; + libraryVersion?: Maybe; + platform?: Maybe; + runtimeVersion?: Maybe; + schemaTag?: Maybe; + serverId?: Maybe; + serviceId?: Maybe; + userVersion?: Maybe; +}; + +/** Filter for data in EdgeServerInfos. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type EdgeServerInfosFilter = { + and?: InputMaybe>; + /** Selects rows whose bootId dimension equals the given value if not null. To query for the null value, use {in: {bootId: [null]}} instead. */ + bootId?: InputMaybe; + /** Selects rows whose executableSchemaId dimension equals the given value if not null. To query for the null value, use {in: {executableSchemaId: [null]}} instead. */ + executableSchemaId?: InputMaybe; + in?: InputMaybe; + /** Selects rows whose libraryVersion dimension equals the given value if not null. To query for the null value, use {in: {libraryVersion: [null]}} instead. */ + libraryVersion?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose platform dimension equals the given value if not null. To query for the null value, use {in: {platform: [null]}} instead. */ + platform?: InputMaybe; + /** Selects rows whose runtimeVersion dimension equals the given value if not null. To query for the null value, use {in: {runtimeVersion: [null]}} instead. */ + runtimeVersion?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serverId dimension equals the given value if not null. To query for the null value, use {in: {serverId: [null]}} instead. */ + serverId?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose userVersion dimension equals the given value if not null. To query for the null value, use {in: {userVersion: [null]}} instead. */ + userVersion?: InputMaybe; +}; + +/** Filter for data in EdgeServerInfos. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type EdgeServerInfosFilterIn = { + /** Selects rows whose bootId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + bootId?: InputMaybe>>; + /** Selects rows whose executableSchemaId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + executableSchemaId?: InputMaybe>>; + /** Selects rows whose libraryVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + libraryVersion?: InputMaybe>>; + /** Selects rows whose platform dimension is in the given list. A null value in the list means a row with null for that dimension. */ + platform?: InputMaybe>>; + /** Selects rows whose runtimeVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + runtimeVersion?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serverId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serverId?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose userVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + userVersion?: InputMaybe>>; +}; + +export type EdgeServerInfosOrderBySpec = { + column: EdgeServerInfosColumn; + direction: Ordering; +}; + +export type EdgeServerInfosRecord = { + __typename?: 'EdgeServerInfosRecord'; + /** Dimensions of EdgeServerInfos that can be grouped by. */ + groupBy: EdgeServerInfosDimensions; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type EditCommentInput = { + id: Scalars['String']['input']; + message: Scalars['String']['input']; + usersToNotify?: InputMaybe>; +}; + +export type EditCommentResult = NotFoundError | ParentChangeProposalComment | ParentGeneralProposalComment | PermissionError | ReplyChangeProposalComment | ReplyGeneralProposalComment | ValidationError; + +export type Education = { + __typename?: 'Education'; + recentPages: Array; +}; + + +export type EducationRecentPagesArgs = { + limit?: InputMaybe; +}; + +export enum EmailCategory { + EDUCATIONAL = 'EDUCATIONAL' +} + +export type EmailPreferences = { + __typename?: 'EmailPreferences'; + email: Scalars['String']['output']; + subscriptions: Array; + unsubscribedFromAll: Scalars['Boolean']['output']; +}; + +export type EndUsageBasedPlanResult = Account | NotFoundError | PermissionError | ValidationError; + +export enum EnforcementPolicy { + CLIENT_NAME_CARDINALITY = 'CLIENT_NAME_CARDINALITY', + CLIENT_VERSION_CARDINALITY = 'CLIENT_VERSION_CARDINALITY', + OPERATION_ID_CARDINALITY = 'OPERATION_ID_CARDINALITY' +} + +export type EntitiesError = { + __typename?: 'EntitiesError'; + message: Scalars['String']['output']; +}; + +export type EntitiesErrorResponse = { + __typename?: 'EntitiesErrorResponse'; + errors: Array; +}; + +export type EntitiesResponse = { + __typename?: 'EntitiesResponse'; + entities: Array; +}; + +export type EntitiesResponseOrError = EntitiesErrorResponse | EntitiesResponse; + +export type Entity = { + __typename?: 'Entity'; + subgraphKeys?: Maybe>; + typename: Scalars['String']['output']; +}; + +/** GraphQL Error */ +export type Error = { + message: Scalars['String']['output']; +}; + +export type ErrorInsightsListFilterInInput = { + agent?: InputMaybe>>; + clientName?: InputMaybe>>; + clientVersion?: InputMaybe>>; + code?: InputMaybe>>; + service?: InputMaybe>>; + serviceOrAgent?: InputMaybe>>; +}; + +export type ErrorInsightsListFilterInput = { + agent?: InputMaybe; + clientName?: InputMaybe; + clientVersion?: InputMaybe; + code?: InputMaybe; + in?: InputMaybe; + operationId?: InputMaybe; + or?: InputMaybe>; + path?: InputMaybe; + service?: InputMaybe; + serviceOrAgent?: InputMaybe; +}; + +export enum ErrorInsightsListGroupByColumn { + AGENT = 'AGENT', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + CODE = 'CODE', + OPERATION_ID = 'OPERATION_ID', + OPERATION_NAME = 'OPERATION_NAME', + PATH = 'PATH', + SERVICE = 'SERVICE', + SERVICE_OR_AGENT = 'SERVICE_OR_AGENT', + SEVERITY = 'SEVERITY' +} + +export type ErrorInsightsListItem = { + __typename?: 'ErrorInsightsListItem'; + agent?: Maybe; + clientName?: Maybe; + clientVersion?: Maybe; + code?: Maybe; + /** @deprecated Use errorCount instead */ + count: Scalars['Long']['output']; + errorCount: Scalars['Long']['output']; + operationCount?: Maybe; + operationId?: Maybe; + operationName?: Maybe; + path?: Maybe; + service?: Maybe; + serviceOrAgent?: Maybe; + severity?: Maybe; + traceRefs?: Maybe; +}; + + +export type ErrorInsightsListItemTraceRefsArgs = { + limit?: Scalars['Int']['input']; +}; + +export enum ErrorInsightsListOrderByColumn { + AGENT = 'AGENT', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + CODE = 'CODE', + COUNT = 'COUNT', + OPERATION_ID = 'OPERATION_ID', + OPERATION_NAME = 'OPERATION_NAME', + PATH = 'PATH', + SERVICE_OR_AGENT = 'SERVICE_OR_AGENT', + SEVERITY = 'SEVERITY', + TIMESTAMP = 'TIMESTAMP' +} + +export type ErrorInsightsListOrderByInput = { + column: ErrorInsightsListOrderByColumn; + direction: Ordering; +}; + +/** Information about pagination in a connection. */ +export type ErrorInsightsListPageInfo = { + __typename?: 'ErrorInsightsListPageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +export enum ErrorInsightsSeverity { + ERROR = 'ERROR', + UNKNOWN = 'UNKNOWN', + WARN = 'WARN' +} + +export enum ErrorInsightsStrategy { + ERROR_STATS = 'ERROR_STATS', + FEDERATED_ERROR_STATS = 'FEDERATED_ERROR_STATS', + MIXED = 'MIXED' +} + +export type ErrorInsightsTimeseriesRecord = { + __typename?: 'ErrorInsightsTimeseriesRecord'; + data: ErrorInsightsListItem; + strategy: ErrorInsightsStrategy; + timestamp: Scalars['Timestamp']['output']; +}; + +export type ErrorInsightsTimeseriesResult = { + __typename?: 'ErrorInsightsTimeseriesResult'; + records: Array; + roundedDownFrom: Scalars['Timestamp']['output']; + roundedUpTo: Scalars['Timestamp']['output']; + totalErrors: Scalars['Int']['output']; +}; + +/** Columns of ErrorStats. */ +export enum ErrorStatsColumn { + ACCOUNT_ID = 'ACCOUNT_ID', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ERRORS_COUNT = 'ERRORS_COUNT', + PATH = 'PATH', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type ErrorStatsDimensions = { + __typename?: 'ErrorStatsDimensions'; + accountId?: Maybe; + clientName?: Maybe; + clientVersion?: Maybe; + path?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in ErrorStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ErrorStatsFilter = { + /** Selects rows whose accountId dimension equals the given value if not null. To query for the null value, use {in: {accountId: [null]}} instead. */ + accountId?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose path dimension equals the given value if not null. To query for the null value, use {in: {path: [null]}} instead. */ + path?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in ErrorStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ErrorStatsFilterIn = { + /** Selects rows whose accountId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + accountId?: InputMaybe>>; + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose path dimension is in the given list. A null value in the list means a row with null for that dimension. */ + path?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type ErrorStatsMetrics = { + __typename?: 'ErrorStatsMetrics'; + errorsCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; +}; + +export type ErrorStatsOrderBySpec = { + column: ErrorStatsColumn; + direction: Ordering; +}; + +export type ErrorStatsRecord = { + __typename?: 'ErrorStatsRecord'; + /** Dimensions of ErrorStats that can be grouped by. */ + groupBy: ErrorStatsDimensions; + /** Metrics of ErrorStats that can be aggregated over. */ + metrics: ErrorStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type ErrorTraceRef = { + __typename?: 'ErrorTraceRef'; + errorMessage?: Maybe; + operationId: Scalars['String']['output']; + timestamp: Scalars['Timestamp']['output']; + traceId: Scalars['String']['output']; +}; + +export type ErrorTraceRefsResult = { + __typename?: 'ErrorTraceRefsResult'; + items: Array; + totalCount: Scalars['Int']['output']; +}; + +/** Input parameters for run explorer operation event. */ +export enum EventEnum { + CLICK_CHECK_LIST = 'CLICK_CHECK_LIST', + CLICK_GO_TO_GRAPH_SETTINGS = 'CLICK_GO_TO_GRAPH_SETTINGS', + RUN_EXPLORER_OPERATION = 'RUN_EXPLORER_OPERATION' +} + +/** Excluded operation for a graph. */ +export type ExcludedOperation = { + __typename?: 'ExcludedOperation'; + /** Operation ID to exclude from schema check. */ + ID: Scalars['ID']['output']; +}; + +/** Option to filter by operation ID. */ +export type ExcludedOperationInput = { + /** Operation ID to exclude from schema check. */ + ID: Scalars['ID']['input']; +}; + +export type ExtendedRefsUsage = { + __typename?: 'ExtendedRefsUsage'; + /** The first time usage of this feature was reported for this variant to Apollo by the Router, or null if such usage has never been reported. */ + firstSeenAt?: Maybe; + /** The last time usage of this feature was reported for this variant to Apollo by the Router, or null if such usage has never been reported. */ + lastSeenAt?: Maybe; +}; + +export type FeatureIntros = { + __typename?: 'FeatureIntros'; + /** @deprecated No longer supported */ + devGraph: Scalars['Boolean']['output']; + federatedGraph: Scalars['Boolean']['output']; + freeConsumerSeats: Scalars['Boolean']['output']; +}; + +/** Feature Intros Input Type */ +export type FeatureIntrosInput = { + federatedGraph?: InputMaybe; + freeConsumerSeats?: InputMaybe; +}; + +/** Columns of FederatedErrorStats. */ +export enum FederatedErrorStatsColumn { + AGENT_VERSION = 'AGENT_VERSION', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ERROR_CODE = 'ERROR_CODE', + ERROR_COUNT = 'ERROR_COUNT', + ERROR_PATH = 'ERROR_PATH', + ERROR_SERVICE = 'ERROR_SERVICE', + OPERATION_ID = 'OPERATION_ID', + OPERATION_NAME = 'OPERATION_NAME', + OPERATION_TYPE = 'OPERATION_TYPE', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + SEVERITY = 'SEVERITY', + TIMESTAMP = 'TIMESTAMP' +} + +export type FederatedErrorStatsDimensions = { + __typename?: 'FederatedErrorStatsDimensions'; + agentVersion?: Maybe; + clientName?: Maybe; + clientVersion?: Maybe; + errorCode?: Maybe; + errorPath?: Maybe; + errorService?: Maybe; + operationId?: Maybe; + operationName?: Maybe; + operationType?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + severity?: Maybe; +}; + +/** Filter for data in FederatedErrorStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type FederatedErrorStatsFilter = { + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose errorCode dimension equals the given value if not null. To query for the null value, use {in: {errorCode: [null]}} instead. */ + errorCode?: InputMaybe; + /** Selects rows whose errorPath dimension equals the given value if not null. To query for the null value, use {in: {errorPath: [null]}} instead. */ + errorPath?: InputMaybe; + /** Selects rows whose errorService dimension equals the given value if not null. To query for the null value, use {in: {errorService: [null]}} instead. */ + errorService?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationId dimension equals the given value if not null. To query for the null value, use {in: {operationId: [null]}} instead. */ + operationId?: InputMaybe; + /** Selects rows whose operationName dimension equals the given value if not null. To query for the null value, use {in: {operationName: [null]}} instead. */ + operationName?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose severity dimension equals the given value if not null. To query for the null value, use {in: {severity: [null]}} instead. */ + severity?: InputMaybe; +}; + +/** Filter for data in FederatedErrorStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type FederatedErrorStatsFilterIn = { + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose errorCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorCode?: InputMaybe>>; + /** Selects rows whose errorPath dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorPath?: InputMaybe>>; + /** Selects rows whose errorService dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorService?: InputMaybe>>; + /** Selects rows whose operationId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationId?: InputMaybe>>; + /** Selects rows whose operationName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationName?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose severity dimension is in the given list. A null value in the list means a row with null for that dimension. */ + severity?: InputMaybe>>; +}; + +export type FederatedErrorStatsMetrics = { + __typename?: 'FederatedErrorStatsMetrics'; + errorCount: Scalars['Long']['output']; +}; + +export type FederatedErrorStatsOrderBySpec = { + column: FederatedErrorStatsColumn; + direction: Ordering; +}; + +export type FederatedErrorStatsRecord = { + __typename?: 'FederatedErrorStatsRecord'; + /** Dimensions of FederatedErrorStats that can be grouped by. */ + groupBy: FederatedErrorStatsDimensions; + /** Metrics of FederatedErrorStats that can be aggregated over. */ + metrics: FederatedErrorStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** A single subgraph in a supergraph. Every supergraph managed by Apollo Studio includes at least one subgraph. See https://www.apollographql.com/docs/federation/managed-federation/overview/ for more information. */ +export type FederatedImplementingService = { + __typename?: 'FederatedImplementingService'; + /** The subgraph's current active schema, used in supergraph composition for the the associated variant. */ + activePartialSchema: PartialSchema; + /** The timestamp when the subgraph was created. */ + createdAt: Scalars['Timestamp']['output']; + /** The timestamp when the subgraph was deleted. Null if it wasn't deleted. */ + deletedAt?: Maybe; + /** The ID of the graph this subgraph belongs to. */ + graphID: Scalars['String']['output']; + /** The name of the graph variant this subgraph belongs to. */ + graphVariant: Scalars['String']['output']; + /** The subgraph's name. */ + name: Scalars['String']['output']; + /** The current user-provided version/edition of the subgraph. Typically a Git SHA or docker image ID. */ + revision: Scalars['String']['output']; + /** The timestamp when the subgraph was most recently updated. */ + updatedAt: Scalars['Timestamp']['output']; + /** The URL of the subgraph's GraphQL endpoint. */ + url?: Maybe; +}; + +/** A minimal representation of a federated implementing service, using only a name and partial schema SDL */ +export type FederatedImplementingServicePartialSchema = { + __typename?: 'FederatedImplementingServicePartialSchema'; + /** The name of the implementing service */ + name: Scalars['String']['output']; + /** The partial schema of the implementing service */ + sdl: Scalars['String']['output']; +}; + +/** Container for a list of subgraphs composing a supergraph. */ +export type FederatedImplementingServices = { + __typename?: 'FederatedImplementingServices'; + /** The list of underlying subgraphs. */ + services: Array; +}; + +/** Counts of changes at the field level, including objects, interfaces, and input fields. */ +export type FieldChangeSummaryCounts = { + __typename?: 'FieldChangeSummaryCounts'; + /** Number of changes that are additions of fields to object, interface, and input types. */ + additions: Scalars['Int']['output']; + /** + * Number of changes that are field edits. This includes fields changing type and any field + * deprecation and description changes, but also includes any argument changes and any input object + * field changes. + */ + edits: Scalars['Int']['output']; + /** Number of changes that are removals of fields from object, interface, and input types. */ + removals: Scalars['Int']['output']; +}; + +/** Columns of FieldExecutions. */ +export enum FieldExecutionsColumn { + ERRORS_COUNT = 'ERRORS_COUNT', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + FIELD_NAME = 'FIELD_NAME', + OBSERVED_EXECUTION_COUNT = 'OBSERVED_EXECUTION_COUNT', + PARENT_TYPE = 'PARENT_TYPE', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type FieldExecutionsDimensions = { + __typename?: 'FieldExecutionsDimensions'; + fieldName?: Maybe; + parentType?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in FieldExecutions. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type FieldExecutionsFilter = { + and?: InputMaybe>; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in FieldExecutions. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type FieldExecutionsFilterIn = { + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type FieldExecutionsMetrics = { + __typename?: 'FieldExecutionsMetrics'; + errorsCount: Scalars['Long']['output']; + estimatedExecutionCount: Scalars['Long']['output']; + observedExecutionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; +}; + +export type FieldExecutionsOrderBySpec = { + column: FieldExecutionsColumn; + direction: Ordering; +}; + +export type FieldExecutionsRecord = { + __typename?: 'FieldExecutionsRecord'; + /** Dimensions of FieldExecutions that can be grouped by. */ + groupBy: FieldExecutionsDimensions; + /** Metrics of FieldExecutions that can be aggregated over. */ + metrics: FieldExecutionsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type FieldInsights = { + __typename?: 'FieldInsights'; + /** If the first or last seen timestamps are earlier than this timestamp, we can't tell the exact date that we saw this field since our data is bound by the retention period. */ + earliestRetentionTime?: Maybe; + /** The earliest time we saw references or executions for this field. Null if the field has never been seen or it is not in the schema. */ + firstSeen?: Maybe; + /** The most recent time we saw references or executions for this field. Null if the field has never been seen or it is not in the schema. */ + lastSeen?: Maybe; +}; + +export type FieldInsightsListFilterInInput = { + clientName?: InputMaybe>>; + clientVersion?: InputMaybe>>; +}; + +export type FieldInsightsListFilterInput = { + clientName?: InputMaybe; + clientVersion?: InputMaybe; + in?: InputMaybe; + isDeprecated?: InputMaybe; + isUnused?: InputMaybe; + or?: InputMaybe>; + /** Filters on partial string matches of Parent Type and Field Name */ + search?: InputMaybe; +}; + +export type FieldInsightsListItem = { + __typename?: 'FieldInsightsListItem'; + /** The count of errors seen for this field. This can be null depending on the sort order. */ + errorCount?: Maybe; + /** The count of errors seen for this field per minute. This can be null depending on the sort order. */ + errorCountPerMin?: Maybe; + /** The percentage of errors vs successful resolutions for this field. This can be null depending on the sort order. */ + errorPercentage?: Maybe; + /** The estimated number of field executions for this field, based on the field execution sample rate. This can be null depending on the sort order. */ + estimatedExecutionCount?: Maybe; + /** The number of field executions recorded for this field. This can be null depending on the sort order. */ + executionCount?: Maybe; + fieldName: Scalars['String']['output']; + isDeprecated: Scalars['Boolean']['output']; + isUnused: Scalars['Boolean']['output']; + /** The p50 of the latency of the resolution of this field. This can be null depending on the filter and sort order. */ + p50LatencyMs?: Maybe; + /** The p90 of the latency of the resolution of this field. This can be null depending on the filter and sort order. */ + p90LatencyMs?: Maybe; + /** The p95 of the latency of the resolution of this field. This can be null depending on the filter and sort order. */ + p95LatencyMs?: Maybe; + /** The p99 of the latency of the resolution of this field. This can be null depending on the filter and sort order. */ + p99LatencyMs?: Maybe; + parentType: Scalars['String']['output']; + /** The count of operations that reference the field. This can be null depending on the sort order. */ + referencingOperationCount?: Maybe; + /** The count of operations that reference the field per minute. This can be null depending on the sort order. */ + referencingOperationCountPerMin?: Maybe; +}; + +export enum FieldInsightsListOrderByColumn { + ERROR_COUNT = 'ERROR_COUNT', + ERROR_COUNT_PER_MIN = 'ERROR_COUNT_PER_MIN', + ERROR_PERCENTAGE = 'ERROR_PERCENTAGE', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + PARENT_TYPE_AND_FIELD_NAME = 'PARENT_TYPE_AND_FIELD_NAME', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REFERENCING_OPERATION_COUNT_PER_MIN = 'REFERENCING_OPERATION_COUNT_PER_MIN', + SERVICE_TIME_P50 = 'SERVICE_TIME_P50', + SERVICE_TIME_P90 = 'SERVICE_TIME_P90', + SERVICE_TIME_P95 = 'SERVICE_TIME_P95', + SERVICE_TIME_P99 = 'SERVICE_TIME_P99' +} + +export type FieldInsightsListOrderByInput = { + column: FieldInsightsListOrderByColumn; + direction: Ordering; +}; + +/** Information about pagination in a connection. */ +export type FieldInsightsListPageInfo = { + __typename?: 'FieldInsightsListPageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +/** Columns of FieldLatencies. */ +export enum FieldLatenciesColumn { + FIELD_HISTOGRAM = 'FIELD_HISTOGRAM', + FIELD_NAME = 'FIELD_NAME', + PARENT_TYPE = 'PARENT_TYPE', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type FieldLatenciesDimensions = { + __typename?: 'FieldLatenciesDimensions'; + field?: Maybe; + fieldName?: Maybe; + parentType?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in FieldLatencies. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type FieldLatenciesFilter = { + and?: InputMaybe>; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in FieldLatencies. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type FieldLatenciesFilterIn = { + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type FieldLatenciesMetrics = { + __typename?: 'FieldLatenciesMetrics'; + fieldHistogram: DurationHistogram; +}; + +export type FieldLatenciesOrderBySpec = { + column: FieldLatenciesColumn; + direction: Ordering; +}; + +export type FieldLatenciesRecord = { + __typename?: 'FieldLatenciesRecord'; + /** Dimensions of FieldLatencies that can be grouped by. */ + groupBy: FieldLatenciesDimensions; + /** Metrics of FieldLatencies that can be aggregated over. */ + metrics: FieldLatenciesMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of FieldUsage. */ +export enum FieldUsageColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + FIELD_NAME = 'FIELD_NAME', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + PARENT_TYPE = 'PARENT_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP' +} + +export type FieldUsageDimensions = { + __typename?: 'FieldUsageDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + fieldName?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + parentType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in FieldUsage. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type FieldUsageFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in FieldUsage. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type FieldUsageFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type FieldUsageMetrics = { + __typename?: 'FieldUsageMetrics'; + estimatedExecutionCount: Scalars['Long']['output']; + executionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; +}; + +export type FieldUsageOrderBySpec = { + column: FieldUsageColumn; + direction: Ordering; +}; + +export type FieldUsageRecord = { + __typename?: 'FieldUsageRecord'; + /** Dimensions of FieldUsage that can be grouped by. */ + groupBy: FieldUsageDimensions; + /** Metrics of FieldUsage that can be aggregated over. */ + metrics: FieldUsageMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type FileCoordinate = { + __typename?: 'FileCoordinate'; + byteOffset: Scalars['Int']['output']; + column: Scalars['Int']['output']; + line: Scalars['Int']['output']; +}; + +export type FileCoordinateInput = { + byteOffset: Scalars['Int']['input']; + column: Scalars['Int']['input']; + line: Scalars['Int']['input']; +}; + +export type FileLocation = { + __typename?: 'FileLocation'; + end: FileCoordinate; + start: FileCoordinate; + subgraphName?: Maybe; +}; + +export type FileLocationInput = { + end: FileCoordinateInput; + start: FileCoordinateInput; + subgraphName?: InputMaybe; +}; + +export type FilterBuildCheckFailed = BuildCheckFailed & BuildCheckResult & FilterBuildCheckResult & { + __typename?: 'FilterBuildCheckFailed'; + buildInputs: FilterBuildInputs; + buildPipelineTrack: BuildPipelineTrack; + errors: Array; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + workflowTask: FilterCheckTask; +}; + +export type FilterBuildCheckPassed = BuildCheckPassed & BuildCheckResult & FilterBuildCheckResult & { + __typename?: 'FilterBuildCheckPassed'; + buildInputs: FilterBuildInputs; + buildPipelineTrack: BuildPipelineTrack; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + supergraphSchemaHash: Scalars['SHA256']['output']; + workflowTask: FilterCheckTask; +}; + +export type FilterBuildCheckResult = { + buildInputs: FilterBuildInputs; + buildPipelineTrack: BuildPipelineTrack; + id: Scalars['ID']['output']; + passed: Scalars['Boolean']['output']; + workflowTask: FilterCheckTask; +}; + +/** Inputs provided to the build for a contract variant, which filters types and fields from a source variant's schema. */ +export type FilterBuildInput = { + __typename?: 'FilterBuildInput'; + /** Schema filtering rules for the build, such as tags to include or exclude from the source variant schema. */ + filterConfig: FilterConfig; + /** The source variant schema document's SHA256 hash, represented as a hexadecimal string. */ + schemaHash: Scalars['String']['output']; +}; + +export type FilterBuildInputs = { + __typename?: 'FilterBuildInputs'; + /** + * The build pipeline track used for filtering. Note this is taken from upstream check workflow + * or launch. + */ + buildPipelineTrack: BuildPipelineTrack; + /** The exclude filters used for filtering. */ + exclude: Array; + /** + * Whether to hide unreachable objects, interfaces, unions, inputs, enums and scalars from + * the resulting contract schema. + */ + hideUnreachableTypes: Scalars['Boolean']['output']; + /** The include filters used for filtering. */ + include: Array; + /** The SHA-256 of the supergraph schema document used for filtering. */ + supergraphSchemaHash: Scalars['SHA256']['output']; +}; + +export type FilterCheckAsyncInput = { + config: HistoricQueryParametersInput; + filterChanges: FilterCheckFilterChanges; + gitContext: GitContextInput; +}; + +export type FilterCheckFilterChanges = { + excludeAdditions?: InputMaybe>; + excludeRemovals?: InputMaybe>; + hideUnreachableTypesChange?: InputMaybe; + includeAdditions?: InputMaybe>; + includeRemovals?: InputMaybe>; +}; + +export type FilterCheckTask = BuildCheckTask & CheckWorkflowTask & { + __typename?: 'FilterCheckTask'; + /** The result of the filter build check. This will be null when the task is initializing or running. */ + buildResult?: Maybe; + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + proposedBuildInputChanges: ProposedFilterBuildInputChanges; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +/** The filter configuration used to build a contract schema. The configuration consists of lists of tags for schema elements to include or exclude in the resulting schema. */ +export type FilterConfig = { + __typename?: 'FilterConfig'; + /** Tags of schema elements to exclude from the contract schema. */ + exclude: Array; + /** Whether to hide unreachable objects, interfaces, unions, inputs, enums and scalars from the resulting contract schema. */ + hideUnreachableTypes: Scalars['Boolean']['output']; + /** Tags of schema elements to include in the contract schema. */ + include: Array; +}; + +export type FilterConfigInput = { + /** A list of tags for schema elements to exclude from the resulting contract schema. */ + exclude: Array; + /** + * Whether to hide unreachable objects, interfaces, unions, inputs, enums and scalars from + * the resulting contract schema. Defaults to `false`. + */ + hideUnreachableTypes?: Scalars['Boolean']['input']; + /** A list of tags for schema elements to include in the resulting contract schema. */ + include: Array; +}; + +/** Represents a diff between two versions of a schema as a flat list of changes */ +export type FlatDiff = { + __typename?: 'FlatDiff'; + diff: Array; + id: Scalars['ID']['output']; + summary: FlatDiffSummary; +}; + +export type FlatDiffAddArgument = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffAddArgument'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffAddDirective = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddDirective'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddDirectiveUsage = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffAddDirectiveUsage'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffAddEnum = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddEnum'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddEnumValue = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddEnumValue'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddField = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffAddField'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffAddImplementation = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffAddImplementation'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffAddInput = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddInput'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddInterface = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddInterface'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddObject = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddObject'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddScalar = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddScalar'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddSchemaDefinition = FlatDiffItem & { + __typename?: 'FlatDiffAddSchemaDefinition'; + type: FlatDiffType; +}; + +export type FlatDiffAddSchemaDirectiveUsage = FlatDiffItem & FlatDiffItemValue & { + __typename?: 'FlatDiffAddSchemaDirectiveUsage'; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffAddSchemaRootOperation = FlatDiffItem & FlatDiffItemRootType & FlatDiffItemValue & { + __typename?: 'FlatDiffAddSchemaRootOperation'; + rootType: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffAddUnion = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffAddUnion'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffAddUnionMember = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffAddUnionMember'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffAddValidLocation = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffAddValidLocation'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffChangeArgumentDefault = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemNullableValue & { + __typename?: 'FlatDiffChangeArgumentDefault'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value?: Maybe; +}; + +export type FlatDiffChangeDescription = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemNullableValue & { + __typename?: 'FlatDiffChangeDescription'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value?: Maybe; +}; + +export type FlatDiffChangeDirectiveRepeatable = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffChangeDirectiveRepeatable'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['Boolean']['output']; +}; + +export type FlatDiffChangeInputFieldDefault = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemNullableValue & { + __typename?: 'FlatDiffChangeInputFieldDefault'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value?: Maybe; +}; + +export type FlatDiffChangeSchemaDescription = FlatDiffItem & FlatDiffItemNullableValue & { + __typename?: 'FlatDiffChangeSchemaDescription'; + type: FlatDiffType; + value?: Maybe; +}; + +export type FlatDiffItem = { + type: FlatDiffType; +}; + +export type FlatDiffItemCoordinate = { + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffItemNullableValue = { + type: FlatDiffType; + value?: Maybe; +}; + +export type FlatDiffItemRootType = { + rootType: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffItemValue = { + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffRemoveArgument = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffRemoveArgument'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffRemoveDirective = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveDirective'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveDirectiveUsage = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffRemoveDirectiveUsage'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffRemoveEnum = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveEnum'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveEnumValue = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveEnumValue'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveField = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffRemoveField'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffRemoveImplementation = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffRemoveImplementation'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffRemoveInput = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveInput'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveInterface = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveInterface'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveObject = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveObject'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveScalar = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveScalar'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveSchemaDefinition = FlatDiffItem & { + __typename?: 'FlatDiffRemoveSchemaDefinition'; + type: FlatDiffType; +}; + +export type FlatDiffRemoveSchemaDirectiveUsage = FlatDiffItem & FlatDiffItemValue & { + __typename?: 'FlatDiffRemoveSchemaDirectiveUsage'; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffRemoveSchemaRootOperation = FlatDiffItem & FlatDiffItemRootType & { + __typename?: 'FlatDiffRemoveSchemaRootOperation'; + rootType: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveUnion = FlatDiffItem & FlatDiffItemCoordinate & { + __typename?: 'FlatDiffRemoveUnion'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; +}; + +export type FlatDiffRemoveUnionMember = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffRemoveUnionMember'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffRemoveValidLocation = FlatDiffItem & FlatDiffItemCoordinate & FlatDiffItemValue & { + __typename?: 'FlatDiffRemoveValidLocation'; + coordinate: Scalars['String']['output']; + type: FlatDiffType; + value: Scalars['String']['output']; +}; + +export type FlatDiffResult = FlatDiff | NotFoundError | SchemaValidationError; + +/** Represents a summary of a diff between two versions of a schema. */ +export type FlatDiffSummary = { + __typename?: 'FlatDiffSummary'; + directive: FlatDiffTypeSummary; + enum: FlatDiffTypeSummary; + input: FlatDiffTypeSummary; + interface: FlatDiffTypeSummary; + object: FlatDiffTypeSummary; + scalar: FlatDiffTypeSummary; + schema: FlatDiffTypeSummary; + union: FlatDiffTypeSummary; +}; + +export enum FlatDiffType { + ADD_ARGUMENT = 'ADD_ARGUMENT', + ADD_DIRECTIVE = 'ADD_DIRECTIVE', + ADD_DIRECTIVE_USAGE = 'ADD_DIRECTIVE_USAGE', + ADD_ENUM = 'ADD_ENUM', + ADD_ENUM_VALUE = 'ADD_ENUM_VALUE', + ADD_FIELD = 'ADD_FIELD', + ADD_IMPLEMENTATION = 'ADD_IMPLEMENTATION', + ADD_INPUT = 'ADD_INPUT', + ADD_INTERFACE = 'ADD_INTERFACE', + ADD_OBJECT = 'ADD_OBJECT', + ADD_SCALAR = 'ADD_SCALAR', + ADD_SCHEMA_DEFINITION = 'ADD_SCHEMA_DEFINITION', + ADD_SCHEMA_DIRECTIVE_USAGE = 'ADD_SCHEMA_DIRECTIVE_USAGE', + ADD_SCHEMA_ROOT_OPERATION = 'ADD_SCHEMA_ROOT_OPERATION', + ADD_UNION = 'ADD_UNION', + ADD_UNION_MEMBER = 'ADD_UNION_MEMBER', + ADD_VALID_LOCATION = 'ADD_VALID_LOCATION', + CHANGE_ARGUMENT_DEFAULT = 'CHANGE_ARGUMENT_DEFAULT', + CHANGE_DESCRIPTION = 'CHANGE_DESCRIPTION', + CHANGE_INPUT_FIELD_DEFAULT = 'CHANGE_INPUT_FIELD_DEFAULT', + CHANGE_REPEATABLE = 'CHANGE_REPEATABLE', + CHANGE_SCHEMA_DESCRIPTION = 'CHANGE_SCHEMA_DESCRIPTION', + REMOVE_ARGUMENT = 'REMOVE_ARGUMENT', + REMOVE_DIRECTIVE = 'REMOVE_DIRECTIVE', + REMOVE_DIRECTIVE_USAGE = 'REMOVE_DIRECTIVE_USAGE', + REMOVE_ENUM = 'REMOVE_ENUM', + REMOVE_ENUM_VALUE = 'REMOVE_ENUM_VALUE', + REMOVE_FIELD = 'REMOVE_FIELD', + REMOVE_IMPLEMENTATION = 'REMOVE_IMPLEMENTATION', + REMOVE_INPUT = 'REMOVE_INPUT', + REMOVE_INTERFACE = 'REMOVE_INTERFACE', + REMOVE_OBJECT = 'REMOVE_OBJECT', + REMOVE_SCALAR = 'REMOVE_SCALAR', + REMOVE_SCHEMA_DEFINITION = 'REMOVE_SCHEMA_DEFINITION', + REMOVE_SCHEMA_DIRECTIVE_USAGE = 'REMOVE_SCHEMA_DIRECTIVE_USAGE', + REMOVE_SCHEMA_ROOT_OPERATION = 'REMOVE_SCHEMA_ROOT_OPERATION', + REMOVE_UNION = 'REMOVE_UNION', + REMOVE_UNION_MEMBER = 'REMOVE_UNION_MEMBER', + REMOVE_VALID_LOCATION = 'REMOVE_VALID_LOCATION' +} + +export type FlatDiffTypeSummary = { + __typename?: 'FlatDiffTypeSummary'; + add: Scalars['Int']['output']; + change: Scalars['Int']['output']; + remove: Scalars['Int']['output']; + typeCount: Scalars['Int']['output']; +}; + +/** Fly-specific information for a Shard */ +export type FlyShard = { + __typename?: 'FlyShard'; + /** DNS endpoint for the orchestrator */ + endpoint: Scalars['String']['output']; + /** Endpoints of the Etcd cluster */ + etcdEndpoints: Array; + /** Fly organization ID */ + organizationId: Scalars['String']['output']; +}; + +export type GqlBillingPlanFromGrpc = { + __typename?: 'GQLBillingPlanFromGrpc'; + dbPlan?: Maybe; + matchesDbPlan?: Maybe; + rawProtoJson?: Maybe; +}; + +export type GeneralProposalComment = { + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export type GitContext = { + __typename?: 'GitContext'; + branch?: Maybe; + commit?: Maybe; + commitUrl?: Maybe; + committer?: Maybe; + message?: Maybe; + remoteHost?: Maybe; + remoteUrl?: Maybe; +}; + +/** This is stored with a schema when it is uploaded */ +export type GitContextInput = { + /** The Git repository branch used in the check. */ + branch?: InputMaybe; + /** The ID of the Git commit used in the check. */ + commit?: InputMaybe; + /** The username of the user who created the Git commit used in the check. */ + committer?: InputMaybe; + /** The commit message of the Git commit used in the check. */ + message?: InputMaybe; + /** The Git repository's remote URL. */ + remoteUrl?: InputMaybe; +}; + +export enum GitRemoteHost { + BITBUCKET = 'BITBUCKET', + GITHUB = 'GITHUB', + GITLAB = 'GITLAB' +} + +/** + * Represents a graph API key, which has permissions scoped to a + * user role for a single Apollo graph. + */ +export type GraphApiKey = ApiKey & { + __typename?: 'GraphApiKey'; + /** The timestamp when the API key was created. */ + createdAt: Scalars['Timestamp']['output']; + /** Details of the user or graph that created the API key. */ + createdBy?: Maybe; + /** The API key's ID. */ + id: Scalars['ID']['output']; + /** The API key's name, for distinguishing it from other keys. */ + keyName?: Maybe; + /** The permission level assigned to the API key upon creation. */ + role: UserPermission; + /** The value of the API key. **This is a secret credential!** */ + token: Scalars['String']['output']; +}; + +export type GraphCapabilities = { + __typename?: 'GraphCapabilities'; + /** False if this graph is a cloud supergraph. */ + canPublishMonograph: Scalars['Boolean']['output']; + /** Currently, graph URL is not updatable for cloud supergraphs. */ + canUpdateURL: Scalars['Boolean']['output']; + /** Minimum Federation Version track required for all variants of this graph. */ + minimumBuildPipelineTrack: BuildPipelineTrack; +}; + +/** The timing details for the build step of a launch. */ +export type GraphCreationError = { + __typename?: 'GraphCreationError'; + message: Scalars['String']['output']; +}; + +export type GraphCreationResult = GraphCreationError | Service; + +/** Filtering options for graph connections. */ +export type GraphFilter = { + /** Only include graphs in a certain state. */ + state?: InputMaybe; + /** Only include graphs of certain types. */ + type?: InputMaybe>; +}; + +/** A union of all containers that can comprise the components of a Studio graph */ +export type GraphImplementors = FederatedImplementingServices | NonFederatedImplementingService; + +/** The linter configuration for this graph. */ +export type GraphLinterConfiguration = { + __typename?: 'GraphLinterConfiguration'; + /** The set of @tag names allowed in the schema. */ + allowedTagNames: Array; + /** Whether to ignore @deprecated elements from linting violations. */ + ignoreDeprecated: Scalars['Boolean']['output']; + /** Whether to ignore @inaccessible elements from linting violations. */ + ignoreInaccessible: Scalars['Boolean']['output']; + /** The set of lint rules configured for this graph. */ + rules: Array; +}; + +/** The changes to the linter configuration for this graph. */ +export type GraphLinterConfigurationChangesInput = { + /** A set of allowed @tag names to be added to the linting configuration for this graph or null if no changes should be made. */ + allowedTagNameAdditions?: InputMaybe>; + /** A set of @tag names to be removed from the allowed @tag list for this graphs linting configuration or null if no changes should be made. */ + allowedTagNameRemovals?: InputMaybe>; + /** Change whether @deprecated elements should be linted or null if no changes should be made. */ + ignoreDeprecated?: InputMaybe; + /** Change whether @inaccessible elements should be linted or null if no changes should be made. */ + ignoreInaccessible?: InputMaybe; + /** A set of rule changes or null if no changes should be made. */ + rules?: InputMaybe>; +}; + +export type GraphQlDoc = { + __typename?: 'GraphQLDoc'; + graph: Service; + hash: Scalars['ID']['output']; + source: Scalars['GraphQLDocument']['output']; +}; + +/** Various states a graph can be in. */ +export enum GraphState { + /** The graph has not been configured with any variants. */ + CONFIGURED = 'CONFIGURED', + /** The graph has not been configured with any variants. */ + NOT_CONFIGURED = 'NOT_CONFIGURED' +} + +export enum GraphType { + CLASSIC = 'CLASSIC', + CLOUD_SUPERGRAPH = 'CLOUD_SUPERGRAPH', + SELF_HOSTED_SUPERGRAPH = 'SELF_HOSTED_SUPERGRAPH' +} + +/** A graph variant */ +export type GraphVariant = { + __typename?: 'GraphVariant'; + /** As new schema tags keep getting published, activeSchemaPublish refers to the latest. */ + activeSchemaPublish?: Maybe; + /** The list of BuildPipelineTracks and their associated details that this variant is allowed to set in their build configuration. */ + allowedTracks: Array>; + /** + * If this variant doesn't conduct a build (monograph) then this field will be null + * For contract variants the build config is set based on the upstream composition variant. + */ + buildConfig?: Maybe; + /** The time the variant's federation version and/or the supported directives was last updated */ + buildConfigUpdatedAt?: Maybe; + checkConfiguration: VariantCheckConfiguration; + /** Compose and filter preview contract schema built from this source variant. */ + composeAndFilterPreview?: Maybe; + /** + * Federation version this variant uses + * @deprecated Use federationVersion instead. + */ + compositionVersion?: Maybe; + /** The filter configuration used to build a contract schema. The configuration consists of lists of tags for schema elements to include or exclude in the resulting schema. */ + contractFilterConfig?: Maybe; + /** + * A human-readable description of the filter configuration of this contract variant, or null if this isn't a contract + * variant. + */ + contractFilterConfigDescription?: Maybe; + /** Preview a Contract schema built from this source variant. */ + contractPreview: ContractPreview; + /** + * Returns details about a coordinate in the schema. Unless an error occurs, we will currently always return a non-null + * response here, with the timestamps set to null if there is no usage of the coordinate or if coordinate doesn't exist in the + * schema. However, we are keeping the return type as nullable in case we want to update this later in a + * backwards-compatible way (e.g. a null response meaning that the coordinate doesn't exist in the schema at all). + */ + coordinateInsights?: Maybe; + /** Returns a paginated list of coordinate insights list items, including all coordinates from the active schema for this variant. */ + coordinateInsightsList: GraphVariantCoordinateInsightsListItemConnection; + /** Time the variant was created */ + createdAt: Scalars['Timestamp']['output']; + /** Custom check configuration for this graph. */ + customCheckConfiguration?: Maybe; + derivedVariantCount: Scalars['Int']['output']; + /** Returns the list of variants derived from this variant. This currently includes contracts only. */ + derivedVariants?: Maybe>; + /** A list of the entities across all subgraphs, exposed to consumers & up. This value is null for non-federated variants. */ + entities?: Maybe; + /** Returns a paginated list of error insights list items, including service and code for which the error originated from. */ + errorInsightsList: GraphVariantErrorInsightsListItemConnection; + /** Returns a time series list of error counts over time for this variant within a given time range. */ + errorInsightsTimeseries: ErrorInsightsTimeseriesResult; + /** Details about 'enhanced reference' reporting for traces sent to Apollo by Router for this variant. */ + extendedRefsUsage: ExtendedRefsUsage; + /** Federation version this variant uses */ + federationVersion?: Maybe; + /** The last instant that field execution information (resolver execution via field-level instrumentation) was reported for this variant */ + fieldExecutionsLastReportedAt?: Maybe; + /** + * Returns details about a field in the schema. Unless an error occurs, we will currently always return a non-null + * response here, with the timestamps set to null if there is no usage of the field or if field doesn't exist in the + * schema. However, we are keeping the return type as nullable in case we want to update this later in a + * backwards-compatible way (e.g. a null response meaning that the field doesn't exist in the schema at all). + */ + fieldInsights?: Maybe; + /** Returns a paginated list of field insights list items, including all fields from the active schema for this variant. */ + fieldInsightsList: GraphVariantFieldInsightsListItemConnection; + /** The last instant that field usage information (usage of fields via referencing operations) was reported for this variant */ + fieldUsageLastReportedAt?: Maybe; + /** The graph that this variant belongs to. */ + graph: Service; + /** Graph ID of the variant. Prefer using graph { id } when feasible. */ + graphId: Scalars['String']['output']; + /** If the variant has managed subgraphs. */ + hasManagedSubgraphs?: Maybe; + /** + * Represents whether this variant has a supergraph schema. Note that this can only be true for variants with build steps + * (running e.g. federation composition or contracts filtering). This will be false for a variant with a build step if it + * has never successfully published. + */ + hasSupergraphSchema: Scalars['Boolean']['output']; + /** The variant's global identifier in the form `graphID@variant`. */ + id: Scalars['ID']['output']; + internalVariantUUID: Scalars['String']['output']; + /** Represents whether this variant is a Contract. */ + isContract?: Maybe; + /** Is this variant one of the current user's favorite variants? */ + isFavoriteOfCurrentUser: Scalars['Boolean']['output']; + /** + * If the variant has managed subgraphs. + * @deprecated Replaced by hasManagedSubgraphs + */ + isFederated?: Maybe; + /** Represents whether this variant is a Proposal. */ + isProposal?: Maybe; + /** If the variant is protected */ + isProtected: Scalars['Boolean']['output']; + isPublic: Scalars['Boolean']['output']; + /** Represents whether this variant should be listed in the public variants directory. This can only be true if the variant is also public. */ + isPubliclyListed: Scalars['Boolean']['output']; + /** Represents whether Apollo has verified the authenticity of this public variant. This can only be true if the variant is also public. */ + isVerified: Scalars['Boolean']['output']; + /** Latest approved launch for the variant, and what is served through Uplink. */ + latestApprovedLaunch?: Maybe; + /** Latest launch for the variant, whether successful or not. */ + latestLaunch?: Maybe; + /** The details of the variant's most recent publication. */ + latestPublication?: Maybe; + /** Retrieve a launch for this variant by ID. */ + launch?: Maybe; + /** A list of launches ordered by date, asc or desc depending on orderBy. The maximum limit is 100. */ + launchHistory?: Maybe>; + /** Count of total launch history */ + launchHistoryLength?: Maybe; + /** A list of launches metadata ordered by date, asc or desc depending on orderBy. The maximum limit is 100. */ + launchSummaries?: Maybe>; + links?: Maybe>; + /** The variant's name (e.g., `staging`). */ + name: Scalars['String']['output']; + /** A list of the saved [operation collections](https://www.apollographql.com/docs/studio/explorer/operation-collections/) associated with this variant. */ + operationCollections: Array; + /** A list of the saved [operation collections](https://www.apollographql.com/docs/studio/explorer/operation-collections/) associated with this variant, paged. */ + operationCollectionsConnection?: Maybe; + /** Returns a paginated list of operation insights list items. */ + operationInsightsList: GraphVariantOperationInsightsListItemConnection; + /** The merged/computed/effective check configuration for the operations check task. */ + operationsCheckConfiguration?: Maybe; + /** Which permissions the current user has for interacting with this variant */ + permissions: GraphVariantPermissions; + /** The Persisted Query List linked to this variant, if any. */ + persistedQueryList?: Maybe; + /** Generate a federated operation plan for a given operation */ + plan?: Maybe; + /** Explorer setting for postflight script to run before the actual GraphQL operations is run. */ + postflightScript?: Maybe; + /** Explorer setting for preflight script to run before the actual GraphQL operations is run. */ + preflightScript?: Maybe; + /** Returns the proposal-related fields for this graph variant if the variant is a proposal; otherwise, returns null. */ + proposal?: Maybe; + readme: Readme; + /** Registry stats for this particular graph variant */ + registryStatsWindow?: Maybe; + /** The total number of requests for this variant in the last 24 hours */ + requestsInLastDay?: Maybe; + /** Router associated with this graph variant */ + router?: Maybe; + routerConfig?: Maybe; + /** The first time the Router reported usage of this variant to Apollo. */ + routerFirstSeenAt?: Maybe; + /** The last time the Router reported usage of this variant to Apollo. */ + routerLastSeenAt?: Maybe; + /** The list of rule enforcements for this variant, if any. */ + ruleEnforcements: Array; + /** If the graphql endpoint is set up to accept cookies. */ + sendCookies?: Maybe; + /** Explorer setting for shared headers for a graph */ + sharedHeaders?: Maybe; + /** The variant this variant is derived from. This property currently only exists on contract variants. */ + sourceVariant?: Maybe; + /** Returns the details of the subgraph with the provided `name`, or null if this variant doesn't include a subgraph with that name. */ + subgraph?: Maybe; + /** A list of the subgraphs included in this variant. This value is null for non-federated variants. Set `includeDeleted` to `true` to include deleted subgraphs. */ + subgraphs?: Maybe>; + /** The URL of the variant's GraphQL endpoint for subscription operations. */ + subscriptionUrl?: Maybe; + /** A list of supported directives */ + supportedDirectives?: Maybe>; + /** Returns the top N operations by a few different metrics */ + topNOperations: TopNOperationsResult; + /** + * Returns a list of the top operations reported for this variant within a given time range. This API is rate limited, + * and will return an error if too many requests are made for a graph. + */ + topOperationsReport: Array; + /** + * A list of the subgraphs that have been published to since the variant was created. + * Does not include subgraphs that were created & deleted since the variant was created. + * + * TODO: @deprecated(reason: "use GraphVariant.updatedSubgraphsSinceCreation instead") + */ + updatedSubgraphs?: Maybe>; + /** A list of the subgraphs that have been published to since the variant was created. Does not include subgraphs that were created & deleted since the variant was created since that is not a change compared to initial; however includes subgraphs that were only deleted because that is a change compared to the initial. */ + updatedSubgraphsSinceCreation?: Maybe>; + /** The URL of the variant's GraphQL endpoint for query and mutation operations. For subscription operations, use `subscriptionUrl`. */ + url?: Maybe; + /** The last instant that usage information (e.g. operation stat, client stats) was reported for this variant */ + usageLastReportedAt?: Maybe; + /** Validate router configuration for this graph variant */ + validateRouter: CloudValidationResult; +}; + + +/** A graph variant */ +export type GraphVariantComposeAndFilterPreviewArgs = { + filterConfig?: InputMaybe; + subgraphChanges?: InputMaybe>; +}; + + +/** A graph variant */ +export type GraphVariantContractPreviewArgs = { + filters: FilterConfigInput; +}; + + +/** A graph variant */ +export type GraphVariantCoordinateInsightsArgs = { + coordinateKind: CoordinateKind; + namedAttribute: Scalars['String']['input']; + namedType: Scalars['String']['input']; +}; + + +/** A graph variant */ +export type GraphVariantCoordinateInsightsListArgs = { + after?: InputMaybe; + before?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + from: Scalars['Timestamp']['input']; + last?: InputMaybe; + orderBy?: InputMaybe; + to: Scalars['Timestamp']['input']; +}; + + +/** A graph variant */ +export type GraphVariantErrorInsightsListArgs = { + after?: InputMaybe; + before?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + from: Scalars['Timestamp']['input']; + groupBy?: InputMaybe>; + last?: InputMaybe; + orderBy?: InputMaybe; + to: Scalars['Timestamp']['input']; +}; + + +/** A graph variant */ +export type GraphVariantErrorInsightsTimeseriesArgs = { + filter?: InputMaybe; + from: Scalars['Timestamp']['input']; + groupBy: ErrorInsightsListGroupByColumn; + resolution: Resolution; + to: Scalars['Timestamp']['input']; +}; + + +/** A graph variant */ +export type GraphVariantFieldInsightsArgs = { + fieldName: Scalars['String']['input']; + parentType: Scalars['String']['input']; +}; + + +/** A graph variant */ +export type GraphVariantFieldInsightsListArgs = { + after?: InputMaybe; + before?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + from: Scalars['Timestamp']['input']; + last?: InputMaybe; + orderBy?: InputMaybe; + to: Scalars['Timestamp']['input']; +}; + + +/** A graph variant */ +export type GraphVariantLaunchArgs = { + id: Scalars['ID']['input']; +}; + + +/** A graph variant */ +export type GraphVariantLaunchHistoryArgs = { + limit?: Scalars['Int']['input']; + offset?: Scalars['Int']['input']; + orderBy?: LaunchHistoryOrder; +}; + + +/** A graph variant */ +export type GraphVariantLaunchSummariesArgs = { + limit?: Scalars['Int']['input']; + offset?: Scalars['Int']['input']; + orderBy?: LaunchHistoryOrder; +}; + + +/** A graph variant */ +export type GraphVariantOperationCollectionsConnectionArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A graph variant */ +export type GraphVariantOperationInsightsListArgs = { + after?: InputMaybe; + before?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + from: Scalars['Timestamp']['input']; + last?: InputMaybe; + orderBy?: InputMaybe; + to: Scalars['Timestamp']['input']; +}; + + +/** A graph variant */ +export type GraphVariantOperationsCheckConfigurationArgs = { + overrides?: InputMaybe; +}; + + +/** A graph variant */ +export type GraphVariantPlanArgs = { + document: Scalars['GraphQLDocument']['input']; + operationName?: InputMaybe; +}; + + +/** A graph variant */ +export type GraphVariantRegistryStatsWindowArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** A graph variant */ +export type GraphVariantSubgraphArgs = { + name: Scalars['ID']['input']; +}; + + +/** A graph variant */ +export type GraphVariantSubgraphsArgs = { + includeDeleted?: Scalars['Boolean']['input']; +}; + + +/** A graph variant */ +export type GraphVariantTopNOperationsArgs = { + filter?: InputMaybe; + from: Scalars['Timestamp']['input']; + to: Scalars['Timestamp']['input']; + topN?: InputMaybe; +}; + + +/** A graph variant */ +export type GraphVariantTopOperationsReportArgs = { + filter?: InputMaybe; + from: Scalars['Timestamp']['input']; + limit?: Scalars['Int']['input']; + orderBy?: InputMaybe; + to: Scalars['Timestamp']['input']; +}; + + +/** A graph variant */ +export type GraphVariantValidateRouterArgs = { + config: RouterConfigInput; +}; + +export type GraphVariantCoordinateInsightsListItemConnection = { + __typename?: 'GraphVariantCoordinateInsightsListItemConnection'; + /** A list of edges from the graph variant to its coordinate insights list items. */ + edges?: Maybe>; + /** A list of coordinate insights list items that belong to a graph variant. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: CoordinateInsightsListPageInfo; + /** The total number of coordinate insights list items connected to the graph variant */ + totalCount: Scalars['Int']['output']; +}; + +/** An edge between a graph variant and a coordinate insights list item. */ +export type GraphVariantCoordinateInsightsListItemEdge = { + __typename?: 'GraphVariantCoordinateInsightsListItemEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** A coordinate insights list item attached to the graph variant. */ + node?: Maybe; +}; + +export type GraphVariantErrorInsightsListItemConnection = { + __typename?: 'GraphVariantErrorInsightsListItemConnection'; + /** A list of edges from the graph variant to its error insights list items. */ + edges?: Maybe>; + /** A list of error insights list items that belong to a graph variant. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: ErrorInsightsListPageInfo; + /** The total number of error insights list items connected to the graph variant. */ + totalCount: Scalars['Int']['output']; +}; + +export type GraphVariantErrorInsightsListItemEdge = { + __typename?: 'GraphVariantErrorInsightsListItemEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** A error insights list items attached to the graph variant. */ + node?: Maybe; +}; + +export type GraphVariantFieldInsightsListItemConnection = { + __typename?: 'GraphVariantFieldInsightsListItemConnection'; + /** A list of edges from the graph variant to its field insights list items. */ + edges?: Maybe>; + /** A list of field insights list items that belong to a graph variant. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: FieldInsightsListPageInfo; + /** The total number of field insights list items connected to the graph variant */ + totalCount: Scalars['Int']['output']; +}; + +/** An edge between a graph variant and a field insights list item. */ +export type GraphVariantFieldInsightsListItemEdge = { + __typename?: 'GraphVariantFieldInsightsListItemEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** A field insights list item attached to the graph variant. */ + node?: Maybe; +}; + +/** Ways to filter graph variants. */ +export enum GraphVariantFilter { + /** All Variants */ + ALL = 'ALL', + /** Variants favorited by the current user */ + FAVORITES = 'FAVORITES' +} + +/** Result of looking up a variant by ref */ +export type GraphVariantLookup = GraphVariant | InvalidRefFormat; + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutation = { + __typename?: 'GraphVariantMutation'; + addLinkToVariant: GraphVariant; + buildConfig?: Maybe; + createRouter: CreateRouterResult; + /** + * Callback mutation for submitting custom check results once your validation has run. + * Results are returned with the SUCCESS or FAILURE of your validations, the task and workflow ids + * to associate results, with and an optional list of violations to provide more details to users. + * The Schema Check will wait for this response for 10 minutes and not complete until the results are returned. + * After 10 minutes have passed without a callback request being received, the task will be marked as timed out. + */ + customCheckCallback: CustomCheckCallbackResult; + /** Delete the variant. */ + delete: DeleteSchemaTagResult; + destroyRouter: DestroyRouterResult; + /** Graph ID of the variant */ + graphId: Scalars['String']['output']; + /** Global identifier for the graph variant, in the form `graph@variant`. */ + id: Scalars['ID']['output']; + internalVariantUUID: Scalars['String']['output']; + /** Links a specified PersistedQueryList to the variant of the parent GraphVariantMutation. */ + linkPersistedQueryList: LinkPersistedQueryListResultOrError; + /** Name of the variant, like `variant`. */ + name: Scalars['String']['output']; + /** Provides access to mutation fields for modifying a GraphOS Schema Proposal, if this GraphVariant is a proposal variant; else returns NotFoundError. Learn more at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ + proposal: ProposalMutationResult; + /** Send a custom check request with a fake task id to your configured endpoint. */ + queueTestCustomChecksRequest: QueueTestCustomChecksRequestResult; + relaunch: RelaunchResult; + removeLinkFromVariant: GraphVariant; + /** Gets the router attached to a graph variant */ + router?: Maybe; + runLintCheck: CheckStepResult; + /** Mutation called by CheckCoordinator to find associated proposals to the schema diffs in a check workflow */ + runProposalsCheck: CheckStepResult; + service: Service; + setCustomCheckConfiguration: CustomCheckConfigurationResult; + setIsFavoriteOfCurrentUser: GraphVariant; + /** + * _Asynchronously_ kicks off operation checks for a proposed non-federated + * schema change against its associated graph. + * + * Returns a `CheckRequestSuccess` object with a workflow ID that you can use + * to check status, or an error object if the checks workflow failed to start. + * + * Rate limited to 3000 per min. Schema checks cannot be performed on contract variants. + */ + submitCheckSchemaAsync: CheckRequestResult; + /** Submit a request for a Filter Schema Check and receive a result with a workflow ID that can be used to check status, or an error message that explains what went wrong. */ + submitFilterCheckAsync: CheckRequestResult; + /** + * _Asynchronously_ kicks off composition and operation checks for all proposed subgraphs schema changes against its associated supergraph. + * + * Returns a `CheckRequestSuccess` object with a workflow ID that you can use + * to check status, or an error object if the checks workflow failed to start. + * + * Rate limited to 3000 per min. Subgraph checks cannot be performed on contract variants. + */ + submitMultiSubgraphCheckAsync: CheckRequestResult; + /** + * _Asynchronously_ kicks off composition and operation checks for a proposed subgraph schema change against its associated supergraph. + * + * Returns a `CheckRequestSuccess` object with a workflow ID that you can use + * to check status, or an error object if the checks workflow failed to start. + * + * Rate limited to 3000 per min. Subgraph checks cannot be performed on contract variants. + */ + submitSubgraphCheckAsync: CheckRequestResult; + /** Triggers the Proposals implementation check for active proposals that are sourced from this variant for a given graph composition id */ + triggerProposalsImplementationHandler?: Maybe; + /** Unlinks a specified PersistedQueryList from the variant of the parent GraphVariantMutation. */ + unlinkPersistedQueryList: UnlinkPersistedQueryListResultOrError; + updateCheckConfigurationCustomChecks: VariantCheckConfiguration; + updateCheckConfigurationDowngradeChecks: VariantCheckConfiguration; + updateCheckConfigurationDownstreamVariants: VariantCheckConfiguration; + updateCheckConfigurationEnableOperationsCheck?: Maybe; + updateCheckConfigurationExcludedClients: VariantCheckConfiguration; + updateCheckConfigurationExcludedOperations: VariantCheckConfiguration; + updateCheckConfigurationIncludedVariants: VariantCheckConfiguration; + updateCheckConfigurationProposalChangeMismatchSeverity: VariantCheckConfiguration; + updateCheckConfigurationTimeRange: VariantCheckConfiguration; + updateIsProtected?: Maybe; + updatePostflightScript?: Maybe; + updatePreflightScript?: Maybe; + updateRouter: UpdateRouterResult; + updateSendCookies?: Maybe; + updateSharedHeaders?: Maybe; + updateSubscriptionURL?: Maybe; + updateURL?: Maybe; + /** Updates the [federation version](https://www.apollographql.com/docs/graphos/reference/router/federation-version-support) of this variant */ + updateVariantFederationVersion?: Maybe; + updateVariantIsPublic?: Maybe; + updateVariantIsPubliclyListed?: Maybe; + updateVariantIsVerified?: Maybe; + /** Updates the [README](https://www.apollographql.com/docs/studio/org/graphs/#the-readme-page) of this variant. */ + updateVariantReadme?: Maybe; + upsertRouterConfig?: Maybe; + variant: GraphVariant; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationAddLinkToVariantArgs = { + title?: InputMaybe; + type: LinkInfoType; + url: Scalars['String']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationBuildConfigArgs = { + skipLaunch?: InputMaybe; + tagInApiSchema?: Scalars['Boolean']['input']; + version: BuildPipelineTrack; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationCreateRouterArgs = { + input: CreateRouterInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationCustomCheckCallbackArgs = { + input: CustomCheckCallbackInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationLinkPersistedQueryListArgs = { + persistedQueryListId: Scalars['ID']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationRemoveLinkFromVariantArgs = { + linkInfoId: Scalars['ID']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationRunLintCheckArgs = { + input: RunLintCheckInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationRunProposalsCheckArgs = { + input: RunProposalsCheckInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationSetCustomCheckConfigurationArgs = { + input: SetCustomCheckConfigurationInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationSetIsFavoriteOfCurrentUserArgs = { + favorite: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationSubmitCheckSchemaAsyncArgs = { + input: CheckSchemaAsyncInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationSubmitFilterCheckAsyncArgs = { + input: FilterCheckAsyncInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationSubmitMultiSubgraphCheckAsyncArgs = { + input: MultiSubgraphCheckAsyncInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationSubmitSubgraphCheckAsyncArgs = { + input: SubgraphCheckAsyncInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationTriggerProposalsImplementationHandlerArgs = { + graphCompositionId: Scalars['ID']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationCustomChecksArgs = { + enableCustomChecks?: InputMaybe; + useGraphSettings: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationDowngradeChecksArgs = { + downgradeDefaultValueChange?: InputMaybe; + downgradeStaticChecks?: InputMaybe; + useGraphSettings: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationDownstreamVariantsArgs = { + blockingDownstreamVariants?: InputMaybe>; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationEnableOperationsCheckArgs = { + enabled: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationExcludedClientsArgs = { + appendGraphSettings: Scalars['Boolean']['input']; + excludedClients?: InputMaybe>; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationExcludedOperationsArgs = { + appendGraphSettings: Scalars['Boolean']['input']; + excludedOperationNames?: InputMaybe>; + excludedOperations?: InputMaybe>; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationIncludedVariantsArgs = { + includedVariants?: InputMaybe>; + useGraphSettings: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationProposalChangeMismatchSeverityArgs = { + proposalChangeMismatchSeverity?: InputMaybe; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateCheckConfigurationTimeRangeArgs = { + operationCountThreshold?: InputMaybe; + operationCountThresholdPercentage?: InputMaybe; + timeRangeSeconds?: InputMaybe; + useGraphSettings: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateIsProtectedArgs = { + isProtected: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdatePostflightScriptArgs = { + postflightScript?: InputMaybe; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdatePreflightScriptArgs = { + preflightScript?: InputMaybe; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateRouterArgs = { + input: UpdateRouterInput; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateSendCookiesArgs = { + sendCookies: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateSharedHeadersArgs = { + sharedHeaders?: InputMaybe; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateSubscriptionUrlArgs = { + subscriptionUrl?: InputMaybe; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateUrlArgs = { + url?: InputMaybe; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateVariantFederationVersionArgs = { + version: BuildPipelineTrack; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateVariantIsPublicArgs = { + isPublic: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateVariantIsPubliclyListedArgs = { + isPubliclyListed: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateVariantIsVerifiedArgs = { + isVerified: Scalars['Boolean']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpdateVariantReadmeArgs = { + readme: Scalars['String']['input']; +}; + + +/** Modifies a variant of a graph, also called a schema tag in parts of our product. */ +export type GraphVariantMutationUpsertRouterConfigArgs = { + configuration: Scalars['String']['input']; +}; + +export type GraphVariantOperationCollectionConnection = { + __typename?: 'GraphVariantOperationCollectionConnection'; + /** A list of edges from the graph variant to its operation collections. */ + edges?: Maybe>; + /** A list of operation collections attached to a graph variant. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + totalCount: Scalars['Int']['output']; +}; + +/** An edge between a graph variant and an operation collection. */ +export type GraphVariantOperationCollectionEdge = { + __typename?: 'GraphVariantOperationCollectionEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** An operation collection attached to a graph variant. */ + node?: Maybe; +}; + +export type GraphVariantOperationInsightsListItemConnection = { + __typename?: 'GraphVariantOperationInsightsListItemConnection'; + /** A list of edges from the graph variant to its operation insights list items. */ + edges?: Maybe>; + /** A list of operation insights list items that belong to a graph variant. */ + nodes?: Maybe>; + /** Information to aid in pagination. */ + pageInfo: OperationInsightsListPageInfo; + /** The total number of operation insights list items connected to the graph variant. */ + totalCount: Scalars['Int']['output']; +}; + +export type GraphVariantOperationInsightsListItemEdge = { + __typename?: 'GraphVariantOperationInsightsListItemEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** A operation insights list items attached to the graph variant. */ + node?: Maybe; +}; + +/** Individual permissions for the current user when interacting with a particular Studio graph variant. */ +export type GraphVariantPermissions = { + __typename?: 'GraphVariantPermissions'; + canCreateCollectionInVariant: Scalars['Boolean']['output']; + /** If this variant is a Proposal, will match the Proposal.canEditProposal field (can the current user can edit this Proposal either by authorship or role level). False if this GraphVariant is not a Proposal. */ + canEditProposal: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage/update this variant's build configuration (e.g., build pipeline version). */ + canManageBuildConfig: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage/update cloud routers */ + canManageCloudRouter: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to update variant-level settings for the Apollo Studio Explorer. */ + canManageExplorerSettings: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to publish schemas to this variant. */ + canPushSchemas: Scalars['Boolean']['output']; + /** Whether the currently authenticated user can read any information about this variant. */ + canQuery: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to view this variant's build configuration details (e.g., build pipeline version). */ + canQueryBuildConfig: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to view details regarding cloud routers */ + canQueryCloudRouter: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to view cloud router logs */ + canQueryCloudRouterLogs: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to view launch history */ + canQueryLaunches: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to download schemas associated to this variant. */ + canQuerySchemas: Scalars['Boolean']['output']; + canShareCollectionInVariant: Scalars['Boolean']['output']; + canUpdateVariantLinkInfo: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to update the README for this variant. */ + canUpdateVariantReadme: Scalars['Boolean']['output']; + variantId: Scalars['ID']['output']; +}; + +/** Columns of GraphosCloudMetrics. */ +export enum GraphosCloudMetricsColumn { + ACCOUNT_ID = 'ACCOUNT_ID', + AGENT_VERSION = 'AGENT_VERSION', + CLOUD_PROVIDER = 'CLOUD_PROVIDER', + RESPONSE_SIZE = 'RESPONSE_SIZE', + RESPONSE_SIZE_THROTTLED = 'RESPONSE_SIZE_THROTTLED', + ROUTER_ID = 'ROUTER_ID', + ROUTER_OPERATIONS = 'ROUTER_OPERATIONS', + ROUTER_OPERATIONS_THROTTLED = 'ROUTER_OPERATIONS_THROTTLED', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + SUBGRAPH_FETCHES = 'SUBGRAPH_FETCHES', + SUBGRAPH_FETCHES_THROTTLED = 'SUBGRAPH_FETCHES_THROTTLED', + TIER = 'TIER', + TIMESTAMP = 'TIMESTAMP' +} + +export type GraphosCloudMetricsDimensions = { + __typename?: 'GraphosCloudMetricsDimensions'; + accountId?: Maybe; + agentVersion?: Maybe; + cloudProvider?: Maybe; + routerId?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + tier?: Maybe; +}; + +/** Filter for data in GraphosCloudMetrics. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type GraphosCloudMetricsFilter = { + /** Selects rows whose accountId dimension equals the given value if not null. To query for the null value, use {in: {accountId: [null]}} instead. */ + accountId?: InputMaybe; + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose cloudProvider dimension equals the given value if not null. To query for the null value, use {in: {cloudProvider: [null]}} instead. */ + cloudProvider?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose routerId dimension equals the given value if not null. To query for the null value, use {in: {routerId: [null]}} instead. */ + routerId?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose tier dimension equals the given value if not null. To query for the null value, use {in: {tier: [null]}} instead. */ + tier?: InputMaybe; +}; + +/** Filter for data in GraphosCloudMetrics. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type GraphosCloudMetricsFilterIn = { + /** Selects rows whose accountId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + accountId?: InputMaybe>>; + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose cloudProvider dimension is in the given list. A null value in the list means a row with null for that dimension. */ + cloudProvider?: InputMaybe>>; + /** Selects rows whose routerId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + routerId?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose tier dimension is in the given list. A null value in the list means a row with null for that dimension. */ + tier?: InputMaybe>>; +}; + +export type GraphosCloudMetricsMetrics = { + __typename?: 'GraphosCloudMetricsMetrics'; + responseSize: Scalars['Long']['output']; + responseSizeThrottled: Scalars['Long']['output']; + routerOperations: Scalars['Long']['output']; + routerOperationsThrottled: Scalars['Long']['output']; + subgraphFetches: Scalars['Long']['output']; + subgraphFetchesThrottled: Scalars['Long']['output']; +}; + +export type GraphosCloudMetricsOrderBySpec = { + column: GraphosCloudMetricsColumn; + direction: Ordering; +}; + +export type GraphosCloudMetricsRecord = { + __typename?: 'GraphosCloudMetricsRecord'; + /** Dimensions of GraphosCloudMetrics that can be grouped by. */ + groupBy: GraphosCloudMetricsDimensions; + /** Metrics of GraphosCloudMetrics that can be aggregated over. */ + metrics: GraphosCloudMetricsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export enum HttpMethod { + CONNECT = 'CONNECT', + DELETE = 'DELETE', + GET = 'GET', + HEAD = 'HEAD', + OPTIONS = 'OPTIONS', + PATCH = 'PATCH', + POST = 'POST', + PUT = 'PUT', + TRACE = 'TRACE', + UNKNOWN = 'UNKNOWN', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export type HistoricQueryParameters = { + /** A list of clients to filter out during validation. */ + excludedClients?: InputMaybe>; + /** A list of operation names to filter out during validation. */ + excludedOperationNames?: InputMaybe>; + from?: InputMaybe; + /** A list of operation IDs to filter out during validation. */ + ignoredOperations?: InputMaybe>; + /** + * A list of variants to include in the validation. If no variants are provided + * then this defaults to the "current" variant along with the base variant. The + * base variant indicates the schema that generates diff and marks the metrics that + * are checked for broken queries. We union this base variant with the untagged values('', + * same as null inside of `in`, and 'current') in this metrics fetch. This strategy + * supports users who have not tagged their metrics or schema. + */ + includedVariants?: InputMaybe>; + /** Minimum number of requests within the window for a query to be considered. */ + queryCountThreshold?: InputMaybe; + /** + * Number of requests within the window for a query to be considered, relative to + * total request count. Expected values are between 0 and 0.05 (minimum 5% of total + * request volume) + */ + queryCountThresholdPercentage?: InputMaybe; + to?: InputMaybe; +}; + +/** Input type to provide when specifying configuration details for schema checks. */ +export type HistoricQueryParametersInput = { + /** Clients to be excluded from check. */ + excludedClients?: InputMaybe>; + /** Operations to be ignored in this schema check, specified by operation name. */ + excludedOperationNames?: InputMaybe>; + /** Start time for operations to be checked against. Specified as either a) an ISO formatted date/time string or b) a negative number of seconds relative to the time the check request was submitted. */ + from?: InputMaybe; + /** Operations to be ignored in this schema check, specified by ID. */ + ignoredOperations?: InputMaybe>; + /** Graph variants to be included in check. */ + includedVariants?: InputMaybe>; + /** Maximum number of queries to be checked against the change. */ + queryCountThreshold?: InputMaybe; + /** Only fail check if this percentage of operations would be negatively impacted. */ + queryCountThresholdPercentage?: InputMaybe; + /** End time for operations to be checked against. Specified as either a) an ISO formatted date/time string or b) a negative number of seconds relative to the time the check request was submitted. */ + to?: InputMaybe; +}; + +/** An identity (such as a `User` or `Graph`) in Apollo Studio. See implementing types for details. */ +export type Identity = { + /** Returns a representation of the identity as an `Actor` type. */ + asActor: Actor; + /** The identity's identifier, which is unique among objects of its type. */ + id: Scalars['ID']['output']; + /** The identity's human-readable name. */ + name: Scalars['String']['output']; +}; + +/** An actor's identity and info about the client they used to perform the action */ +export type IdentityAndClientInfo = { + __typename?: 'IdentityAndClientInfo'; + /** Client name provided when the actor performed the action */ + clientName?: Maybe; + /** Client version provided when the actor performed the action */ + clientVersion?: Maybe; + /** Identity info about the actor */ + identity?: Maybe; +}; + +export type IdentityMutation = ServiceMutation | UserMutation; + +export type IgnoreOperationsInChecksResult = { + __typename?: 'IgnoreOperationsInChecksResult'; + graph: Service; +}; + +export type IgnoredRule = { + __typename?: 'IgnoredRule'; + ignoredRule: LintRule; + schemaCoordinate: Scalars['String']['output']; + subgraphName?: Maybe; +}; + +export type IgnoredRuleInput = { + ignoredRule: LintRule; + schemaCoordinate: Scalars['String']['input']; + subgraphName?: InputMaybe; +}; + +/** The location of the implementing service config file in storage */ +export type ImplementingServiceLocation = { + __typename?: 'ImplementingServiceLocation'; + /** The name of the implementing service */ + name: Scalars['String']['output']; + /** The path in storage to access the implementing service config file */ + path: Scalars['String']['output']; +}; + +export type InternalAdminUser = { + __typename?: 'InternalAdminUser'; + role: InternalMdgAdminRole; + userID: Scalars['String']['output']; +}; + +export type InternalIdentity = Identity & { + __typename?: 'InternalIdentity'; + accounts: Array; + asActor: Actor; + email?: Maybe; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; +}; + +export enum InternalMdgAdminRole { + INTERNAL_MDG_ADMIN = 'INTERNAL_MDG_ADMIN', + INTERNAL_MDG_READ_ONLY = 'INTERNAL_MDG_READ_ONLY', + INTERNAL_MDG_SALES = 'INTERNAL_MDG_SALES', + INTERNAL_MDG_SUPER_ADMIN = 'INTERNAL_MDG_SUPER_ADMIN', + INTERNAL_MDG_SUPPORT = 'INTERNAL_MDG_SUPPORT' +} + +/** Generic server error. This should only ever return 'internal server error' as a message */ +export type InternalServerError = Error & { + __typename?: 'InternalServerError'; + /** Message related to the internal error */ + message: Scalars['String']['output']; +}; + +export type IntrospectionDirective = { + __typename?: 'IntrospectionDirective'; + args: Array; + description?: Maybe; + locations: Array; + name: Scalars['String']['output']; +}; + +export type IntrospectionDirectiveInput = { + args: Array; + description?: InputMaybe; + isRepeatable?: InputMaybe; + locations: Array; + name: Scalars['String']['input']; +}; + +/** __DirectiveLocation introspection type */ +export enum IntrospectionDirectiveLocation { + /** Location adjacent to an argument definition. */ + ARGUMENT_DEFINITION = 'ARGUMENT_DEFINITION', + /** Location adjacent to an enum definition. */ + ENUM = 'ENUM', + /** Location adjacent to an enum value definition. */ + ENUM_VALUE = 'ENUM_VALUE', + /** Location adjacent to a field. */ + FIELD = 'FIELD', + /** Location adjacent to a field definition. */ + FIELD_DEFINITION = 'FIELD_DEFINITION', + /** Location adjacent to a fragment definition. */ + FRAGMENT_DEFINITION = 'FRAGMENT_DEFINITION', + /** Location adjacent to a fragment spread. */ + FRAGMENT_SPREAD = 'FRAGMENT_SPREAD', + /** Location adjacent to an inline fragment. */ + INLINE_FRAGMENT = 'INLINE_FRAGMENT', + /** Location adjacent to an input object field definition. */ + INPUT_FIELD_DEFINITION = 'INPUT_FIELD_DEFINITION', + /** Location adjacent to an input object type definition. */ + INPUT_OBJECT = 'INPUT_OBJECT', + /** Location adjacent to an interface definition. */ + INTERFACE = 'INTERFACE', + /** Location adjacent to a mutation operation. */ + MUTATION = 'MUTATION', + /** Location adjacent to an object type definition. */ + OBJECT = 'OBJECT', + /** Location adjacent to a query operation. */ + QUERY = 'QUERY', + /** Location adjacent to a scalar definition. */ + SCALAR = 'SCALAR', + /** Location adjacent to a schema definition. */ + SCHEMA = 'SCHEMA', + /** Location adjacent to a subscription operation. */ + SUBSCRIPTION = 'SUBSCRIPTION', + /** Location adjacent to a union definition. */ + UNION = 'UNION', + /** Location adjacent to a variable definition. */ + VARIABLE_DEFINITION = 'VARIABLE_DEFINITION' +} + +/** Values associated with introspection result for an enum value */ +export type IntrospectionEnumValue = { + __typename?: 'IntrospectionEnumValue'; + /** @deprecated Use deprecationReason instead */ + depreactionReason?: Maybe; + deprecationReason?: Maybe; + description?: Maybe; + isDeprecated: Scalars['Boolean']['output']; + name: Scalars['String']['output']; +}; + +/** __EnumValue introspection type */ +export type IntrospectionEnumValueInput = { + deprecationReason?: InputMaybe; + description?: InputMaybe; + isDeprecated: Scalars['Boolean']['input']; + name: Scalars['String']['input']; +}; + +/** Values associated with introspection result for field */ +export type IntrospectionField = { + __typename?: 'IntrospectionField'; + args: Array; + deprecationReason?: Maybe; + description?: Maybe; + isDeprecated: Scalars['Boolean']['output']; + name: Scalars['String']['output']; + type: IntrospectionType; +}; + +/** __Field introspection type */ +export type IntrospectionFieldInput = { + args: Array; + deprecationReason?: InputMaybe; + description?: InputMaybe; + isDeprecated: Scalars['Boolean']['input']; + name: Scalars['String']['input']; + type: IntrospectionTypeInput; +}; + +/** Values associated with introspection result for an input field */ +export type IntrospectionInputValue = { + __typename?: 'IntrospectionInputValue'; + defaultValue?: Maybe; + description?: Maybe; + name: Scalars['String']['output']; + type: IntrospectionType; +}; + +/** __Value introspection type */ +export type IntrospectionInputValueInput = { + defaultValue?: InputMaybe; + deprecationReason?: InputMaybe; + description?: InputMaybe; + isDeprecated?: InputMaybe; + name: Scalars['String']['input']; + type: IntrospectionTypeInput; +}; + +export type IntrospectionSchema = { + __typename?: 'IntrospectionSchema'; + directives: Array; + mutationType?: Maybe; + queryType: IntrospectionType; + subscriptionType?: Maybe; + types: Array; +}; + + +export type IntrospectionSchemaTypesArgs = { + filter?: InputMaybe; +}; + +/** __Schema introspection type */ +export type IntrospectionSchemaInput = { + description?: InputMaybe; + directives: Array; + mutationType?: InputMaybe; + queryType: IntrospectionTypeRefInput; + subscriptionType?: InputMaybe; + types?: InputMaybe>; +}; + +/** Object containing all possible values for an introspectionType */ +export type IntrospectionType = { + __typename?: 'IntrospectionType'; + /** the base kind of the type this references, ignoring lists and nullability */ + baseKind?: Maybe; + description?: Maybe; + enumValues?: Maybe>; + fields?: Maybe>; + inputFields?: Maybe>; + interfaces?: Maybe>; + kind?: Maybe; + name?: Maybe; + ofType?: Maybe; + possibleTypes?: Maybe>; + /** printed representation of type, including nested nullability and list ofTypes */ + printed: Scalars['String']['output']; +}; + + +/** Object containing all possible values for an introspectionType */ +export type IntrospectionTypeEnumValuesArgs = { + includeDeprecated?: InputMaybe; +}; + +/** __Type introspection type */ +export type IntrospectionTypeInput = { + description?: InputMaybe; + enumValues?: InputMaybe>; + fields?: InputMaybe>; + inputFields?: InputMaybe>; + interfaces?: InputMaybe>; + kind: IntrospectionTypeKind; + name?: InputMaybe; + ofType?: InputMaybe; + possibleTypes?: InputMaybe>; + specifiedByUrl?: InputMaybe; +}; + +export enum IntrospectionTypeKind { + /** Indicates this type is an enum. 'enumValues' is a valid field. */ + ENUM = 'ENUM', + /** Indicates this type is an input object. 'inputFields' is a valid field. */ + INPUT_OBJECT = 'INPUT_OBJECT', + /** + * Indicates this type is an interface. 'fields' and 'possibleTypes' are valid + * fields + */ + INTERFACE = 'INTERFACE', + /** Indicates this type is a list. 'ofType' is a valid field. */ + LIST = 'LIST', + /** Indicates this type is a non-null. 'ofType' is a valid field. */ + NON_NULL = 'NON_NULL', + /** Indicates this type is an object. 'fields' and 'interfaces' are valid fields. */ + OBJECT = 'OBJECT', + /** Indicates this type is a scalar. */ + SCALAR = 'SCALAR', + /** Indicates this type is a union. 'possibleTypes' is a valid field. */ + UNION = 'UNION' +} + +/** Shallow __Type introspection type */ +export type IntrospectionTypeRefInput = { + kind?: InputMaybe; + name: Scalars['String']['input']; +}; + +/** An error caused by providing invalid input for a task, such as schema checks. */ +export type InvalidInputError = { + __typename?: 'InvalidInputError'; + /** The error message. */ + message: Scalars['String']['output']; +}; + +/** Generic input error */ +export type InvalidInputErrors = Error & { + __typename?: 'InvalidInputErrors'; + errors: Array; + message: Scalars['String']['output']; +}; + +export type InvalidOperation = { + __typename?: 'InvalidOperation'; + errors?: Maybe>; + signature: Scalars['ID']['output']; +}; + +/** This object is returned when a request to fetch a Studio graph variant provides an invalid graph ref. */ +export type InvalidRefFormat = Error & { + __typename?: 'InvalidRefFormat'; + message: Scalars['String']['output']; +}; + +export type InvalidTarget = Error & { + __typename?: 'InvalidTarget'; + message: Scalars['String']['output']; +}; + +export type Invoice = { + __typename?: 'Invoice'; + closedAt?: Maybe; + collectionMethod?: Maybe; + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + invoiceNumber: Scalars['Int']['output']; + invoiceNumberV2: Scalars['String']['output']; + state: InvoiceState; + totalInCents: Scalars['Int']['output']; + updatedAt: Scalars['Timestamp']['output']; + uuid: Scalars['ID']['output']; +}; + +export type InvoiceLineItem = { + __typename?: 'InvoiceLineItem'; + /** + * Line items may be grouped to help the customer better understand their charges + * @deprecated This data came from Metronome and we no longer use Metronome + */ + groupKey?: Maybe; + /** + * Line items may be grouped to help the customer better understand their charges + * @deprecated This data came from Metronome and we no longer use Metronome + */ + groupValue?: Maybe; + /** @deprecated This data came from Metronome and we no longer use Metronome */ + name: Scalars['String']['output']; + /** + * The quantity of 'things' in this line item. (e.g. number of operations, seats, etc). + * May be null for flat charges. + * @deprecated This data came from Metronome and we no longer use Metronome + */ + quantity?: Maybe; + /** + * The amount this line item costs. + * @deprecated This data came from Metronome and we no longer use Metronome + */ + totalInCents: Scalars['Int']['output']; +}; + +export enum InvoiceState { + COLLECTED = 'COLLECTED', + FAILED = 'FAILED', + OPEN = 'OPEN', + PAST_DUE = 'PAST_DUE', + UNKNOWN = 'UNKNOWN', + VOID = 'VOID' +} + +/** Represents the complete process of making a set of updates to a deployed graph variant. */ +export type Launch = { + __typename?: 'Launch'; + /** The timestamp when the launch was approved. */ + approvedAt?: Maybe; + /** The associated build for this launch (a build includes schema composition and contract filtering). This value is null until the build is initiated. */ + build?: Maybe; + /** The inputs provided to this launch's associated build, including subgraph schemas and contract filters. */ + buildInput: BuildInput; + /** The timestamp when the launch completed. This value is null until the launch completes. */ + completedAt?: Maybe; + /** The timestamp when the launch was initiated. */ + createdAt: Scalars['Timestamp']['output']; + /** Contract launches that were triggered by this launch. */ + downstreamLaunches: Array; + /** The ID of the launch's associated graph. */ + graphId: Scalars['String']['output']; + /** The name of the launch's associated variant. */ + graphVariant: Scalars['String']['output']; + /** The unique identifier for this launch. */ + id: Scalars['ID']['output']; + /** Whether the launch completed. */ + isCompleted?: Maybe; + /** Whether the result of the launch has been published to the associated graph and variant. This is always false for a failed launch. */ + isPublished?: Maybe; + /** The most recent launch sequence step that has started but not necessarily completed. */ + latestSequenceStep?: Maybe; + /** Cloud Router order for this launch ID */ + order: OrderOrError; + orders: Array; + /** The launch immediately prior to this one. If successOnly is true, returns the most recent successful launch; if false, returns the most recent launch, regardless of success. If no such previous launch exists, returns null. */ + previousLaunch?: Maybe; + proposalRevision?: Maybe; + /** A specific publication of a graph variant pertaining to this launch. */ + publication?: Maybe; + /** A list of results from the completed launch. The items included in this list vary depending on whether the launch succeeded, failed, or was superseded. */ + results: Array; + /** Cloud router configuration associated with this build event. It will be non-null for any cloud-router variant, and null for any not cloudy variant/graph. */ + routerConfig?: Maybe; + schemaTag?: Maybe; + /** A list of all serial steps in the launch sequence. This list can change as the launch progresses. For example, a `LaunchCompletedStep` is appended after a launch completes. */ + sequence: Array; + /** A shortened version of `Launch.id` that includes only the first 8 characters. */ + shortenedID: Scalars['String']['output']; + /** The launch's status. If a launch is superseded, its status remains `LAUNCH_INITIATED`. To check for a superseded launch, use `supersededAt`. */ + status: LaunchStatus; + /** A list of subgraph changes that are included in this launch. */ + subgraphChanges?: Maybe>; + /** The timestamp when this launch was superseded by another launch. If an active launch is superseded, it terminates. */ + supersededAt?: Maybe; + /** The launch that superseded this launch, if any. If an active launch is superseded, it terminates. */ + supersededBy?: Maybe; + /** The source variant launch that caused this launch to be initiated. This value is present only for contract variant launches. Otherwise, it's null. */ + upstreamLaunch?: Maybe; +}; + + +/** Represents the complete process of making a set of updates to a deployed graph variant. */ +export type LaunchPreviousLaunchArgs = { + successOnly?: InputMaybe; +}; + +export enum LaunchHistoryOrder { + CREATED_ASC = 'CREATED_ASC', + CREATED_DESC = 'CREATED_DESC' +} + +/** Types of results that can be associated with a `Launch` */ +export type LaunchResult = ChangelogLaunchResult; + +/** The timing details for the build step of a launch. */ +export type LaunchSequenceBuildStep = { + __typename?: 'LaunchSequenceBuildStep'; + /** The timestamp when the step completed. */ + completedAt?: Maybe; + /** The timestamp when the step started. */ + startedAt?: Maybe; +}; + +/** The timing details for the completion step of a launch. */ +export type LaunchSequenceCompletedStep = { + __typename?: 'LaunchSequenceCompletedStep'; + /** The timestamp when the step (and therefore the launch) completed. */ + completedAt?: Maybe; +}; + +/** The timing details for the initiation step of a launch. */ +export type LaunchSequenceInitiatedStep = { + __typename?: 'LaunchSequenceInitiatedStep'; + /** The timestamp when the step (and therefore the launch) started. */ + startedAt?: Maybe; +}; + +/** The timing details for the publish step of a launch. */ +export type LaunchSequencePublishStep = { + __typename?: 'LaunchSequencePublishStep'; + /** The timestamp when the step completed. */ + completedAt?: Maybe; + /** The timestamp when the step started. */ + startedAt?: Maybe; +}; + +/** Represents the various steps that occur in sequence during a single launch. */ +export type LaunchSequenceStep = LaunchSequenceBuildStep | LaunchSequenceCompletedStep | LaunchSequenceInitiatedStep | LaunchSequencePublishStep | LaunchSequenceSupersededStep; + +/** The timing details for the superseded step of a launch. This step occurs only if the launch is superseded by another launch. */ +export type LaunchSequenceSupersededStep = { + __typename?: 'LaunchSequenceSupersededStep'; + /** The timestamp when the step completed, thereby ending the execution of this launch in favor of the superseding launch. */ + completedAt?: Maybe; +}; + +export enum LaunchStatus { + LAUNCH_COMPLETED = 'LAUNCH_COMPLETED', + LAUNCH_FAILED = 'LAUNCH_FAILED', + LAUNCH_INITIATED = 'LAUNCH_INITIATED' +} + +/** Key information representing the complete process of making a set of updates to a deployed graph variant. */ +export type LaunchSummary = { + __typename?: 'LaunchSummary'; + /** The timestamp when the launch was approved. */ + approvedAt?: Maybe; + /** Identifier of the associated build for this launch. This value is null until the build is initiated. */ + buildID?: Maybe; + /** The inputs provided to this launch's associated build, including subgraph schemas and contract filters. */ + buildInput: BuildInput; + /** The timestamp when the launch completed. This value is null until the launch completes. */ + completedAt?: Maybe; + /** The timestamp when the launch was initiated. */ + createdAt: Scalars['Timestamp']['output']; + /** The ID of the launch's associated graph. */ + graphId: Scalars['String']['output']; + /** The name of the launch's associated variant. */ + graphVariant: Scalars['String']['output']; + /** The unique identifier for this launch. */ + id: Scalars['ID']['output']; + /** A list of results from the completed launch. The items included in this list vary depending on whether the launch succeeded, failed, or was superseded. */ + results: Array; + /** The launch's status. If a launch is superseded, its status remains `LAUNCH_INITIATED`. To check for a superseded launch, use `supersededAt`. */ + status: LaunchStatus; +}; + +export type LaunchTestRouterInput = { + config?: InputMaybe; + provider?: InputMaybe; + routerVersion: Scalars['String']['input']; + tier?: InputMaybe; +}; + +export type LaunchTestRouterResult = CloudRouterTestingInvalidInputErrors | LaunchTestRouterSuccess; + +export type LaunchTestRouterSuccess = { + __typename?: 'LaunchTestRouterSuccess'; + graphRef: Scalars['String']['output']; + jobId: Scalars['ID']['output']; +}; + +export type LinkInfo = { + __typename?: 'LinkInfo'; + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + title?: Maybe; + type: LinkInfoType; + url: Scalars['String']['output']; +}; + +export enum LinkInfoType { + DEVELOPER_PORTAL = 'DEVELOPER_PORTAL', + OTHER = 'OTHER', + REPOSITORY = 'REPOSITORY' +} + +export type LinkPersistedQueryListResult = { + __typename?: 'LinkPersistedQueryListResult'; + graphVariant: GraphVariant; + persistedQueryList: PersistedQueryList; +}; + +/** The result/error union returned by GraphVariantMutation.linkPersistedQueryList. */ +export type LinkPersistedQueryListResultOrError = LinkPersistedQueryListResult | ListNotFoundError | PermissionError | VariantAlreadyLinkedError; + +export type LintCheckTask = CheckWorkflowTask & { + __typename?: 'LintCheckTask'; + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + graphID: Scalars['ID']['output']; + id: Scalars['ID']['output']; + result?: Maybe; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +/** A single rule violation. */ +export type LintDiagnostic = { + __typename?: 'LintDiagnostic'; + /** The category used for grouping similar rules. */ + category: LinterRuleCategory; + /** The schema coordinate of this diagnostic. */ + coordinate: Scalars['String']['output']; + /** The graph's configured level for the rule. */ + level: LintDiagnosticLevel; + /** The message describing the rule violation. */ + message: Scalars['String']['output']; + /** The lint rule being violated. */ + rule: LintRule; + /** The human readable position in the file of the rule violation. */ + sourceLocations: Array; +}; + +/** The severity level of an lint result. */ +export enum LintDiagnosticLevel { + ERROR = 'ERROR', + IGNORED = 'IGNORED', + WARNING = 'WARNING' +} + +/** The result of linting a schema. */ +export type LintResult = { + __typename?: 'LintResult'; + /** The set of lint rule violations found in the schema. */ + diagnostics: Array; + /** Stats generated from the resulting diagnostics. */ + stats: LintStats; +}; + +export enum LintRule { + ALL_ELEMENTS_REQUIRE_DESCRIPTION = 'ALL_ELEMENTS_REQUIRE_DESCRIPTION', + CONTACT_DIRECTIVE_MISSING = 'CONTACT_DIRECTIVE_MISSING', + DEFINED_TYPES_ARE_UNUSED = 'DEFINED_TYPES_ARE_UNUSED', + DEPRECATED_DIRECTIVE_MISSING_REASON = 'DEPRECATED_DIRECTIVE_MISSING_REASON', + DIRECTIVE_COMPOSITION = 'DIRECTIVE_COMPOSITION', + DIRECTIVE_NAMES_SHOULD_BE_CAMEL_CASE = 'DIRECTIVE_NAMES_SHOULD_BE_CAMEL_CASE', + DOES_NOT_PARSE = 'DOES_NOT_PARSE', + ENUM_PREFIX = 'ENUM_PREFIX', + ENUM_SUFFIX = 'ENUM_SUFFIX', + ENUM_USED_AS_INPUT_WITHOUT_SUFFIX = 'ENUM_USED_AS_INPUT_WITHOUT_SUFFIX', + ENUM_USED_AS_OUTPUT_DESPITE_SUFFIX = 'ENUM_USED_AS_OUTPUT_DESPITE_SUFFIX', + ENUM_VALUES_SHOULD_BE_SCREAMING_SNAKE_CASE = 'ENUM_VALUES_SHOULD_BE_SCREAMING_SNAKE_CASE', + FIELD_NAMES_SHOULD_BE_CAMEL_CASE = 'FIELD_NAMES_SHOULD_BE_CAMEL_CASE', + FROM_SUBGRAPH_DOES_NOT_EXIST = 'FROM_SUBGRAPH_DOES_NOT_EXIST', + INCONSISTENT_ARGUMENT_PRESENCE = 'INCONSISTENT_ARGUMENT_PRESENCE', + INCONSISTENT_BUT_COMPATIBLE_ARGUMENT_TYPE = 'INCONSISTENT_BUT_COMPATIBLE_ARGUMENT_TYPE', + INCONSISTENT_BUT_COMPATIBLE_FIELD_TYPE = 'INCONSISTENT_BUT_COMPATIBLE_FIELD_TYPE', + INCONSISTENT_DEFAULT_VALUE_PRESENCE = 'INCONSISTENT_DEFAULT_VALUE_PRESENCE', + INCONSISTENT_DESCRIPTION = 'INCONSISTENT_DESCRIPTION', + INCONSISTENT_ENTITY = 'INCONSISTENT_ENTITY', + INCONSISTENT_ENUM_VALUE_FOR_INPUT_ENUM = 'INCONSISTENT_ENUM_VALUE_FOR_INPUT_ENUM', + INCONSISTENT_ENUM_VALUE_FOR_OUTPUT_ENUM = 'INCONSISTENT_ENUM_VALUE_FOR_OUTPUT_ENUM', + INCONSISTENT_EXECUTABLE_DIRECTIVE_LOCATIONS = 'INCONSISTENT_EXECUTABLE_DIRECTIVE_LOCATIONS', + INCONSISTENT_EXECUTABLE_DIRECTIVE_PRESENCE = 'INCONSISTENT_EXECUTABLE_DIRECTIVE_PRESENCE', + INCONSISTENT_EXECUTABLE_DIRECTIVE_REPEATABLE = 'INCONSISTENT_EXECUTABLE_DIRECTIVE_REPEATABLE', + INCONSISTENT_INPUT_OBJECT_FIELD = 'INCONSISTENT_INPUT_OBJECT_FIELD', + INCONSISTENT_INTERFACE_VALUE_TYPE_FIELD = 'INCONSISTENT_INTERFACE_VALUE_TYPE_FIELD', + INCONSISTENT_NON_REPEATABLE_DIRECTIVE_ARGUMENTS = 'INCONSISTENT_NON_REPEATABLE_DIRECTIVE_ARGUMENTS', + INCONSISTENT_OBJECT_VALUE_TYPE_FIELD = 'INCONSISTENT_OBJECT_VALUE_TYPE_FIELD', + INCONSISTENT_RUNTIME_TYPES_FOR_SHAREABLE_RETURN = 'INCONSISTENT_RUNTIME_TYPES_FOR_SHAREABLE_RETURN', + INCONSISTENT_TYPE_SYSTEM_DIRECTIVE_LOCATIONS = 'INCONSISTENT_TYPE_SYSTEM_DIRECTIVE_LOCATIONS', + INCONSISTENT_TYPE_SYSTEM_DIRECTIVE_REPEATABLE = 'INCONSISTENT_TYPE_SYSTEM_DIRECTIVE_REPEATABLE', + INCONSISTENT_UNION_MEMBER = 'INCONSISTENT_UNION_MEMBER', + INPUT_ARGUMENT_NAMES_SHOULD_BE_CAMEL_CASE = 'INPUT_ARGUMENT_NAMES_SHOULD_BE_CAMEL_CASE', + INPUT_TYPE_SUFFIX = 'INPUT_TYPE_SUFFIX', + INTERFACE_PREFIX = 'INTERFACE_PREFIX', + INTERFACE_SUFFIX = 'INTERFACE_SUFFIX', + MERGED_NON_REPEATABLE_DIRECTIVE_ARGUMENTS = 'MERGED_NON_REPEATABLE_DIRECTIVE_ARGUMENTS', + NO_EXECUTABLE_DIRECTIVE_INTERSECTION = 'NO_EXECUTABLE_DIRECTIVE_INTERSECTION', + NULLABLE_PATH_VARIABLE = 'NULLABLE_PATH_VARIABLE', + OBJECT_PREFIX = 'OBJECT_PREFIX', + OBJECT_SUFFIX = 'OBJECT_SUFFIX', + OVERRIDDEN_FIELD_CAN_BE_REMOVED = 'OVERRIDDEN_FIELD_CAN_BE_REMOVED', + OVERRIDE_DIRECTIVE_CAN_BE_REMOVED = 'OVERRIDE_DIRECTIVE_CAN_BE_REMOVED', + OVERRIDE_MIGRATION_IN_PROGRESS = 'OVERRIDE_MIGRATION_IN_PROGRESS', + QUERY_DOCUMENT_DECLARATION = 'QUERY_DOCUMENT_DECLARATION', + RESTY_FIELD_NAMES = 'RESTY_FIELD_NAMES', + TAG_DIRECTIVE_USES_UNKNOWN_NAME = 'TAG_DIRECTIVE_USES_UNKNOWN_NAME', + TYPE_NAMES_SHOULD_BE_PASCAL_CASE = 'TYPE_NAMES_SHOULD_BE_PASCAL_CASE', + TYPE_PREFIX = 'TYPE_PREFIX', + TYPE_SUFFIX = 'TYPE_SUFFIX', + UNUSED_ENUM_TYPE = 'UNUSED_ENUM_TYPE' +} + +/** Stats generated from linting a schema against the graph's linter configuration. */ +export type LintStats = { + __typename?: 'LintStats'; + /** Total number of lint errors. */ + errorsCount: Scalars['Int']['output']; + /** Total number of lint rules ignored. */ + ignoredCount: Scalars['Int']['output']; + /** Total number of lint rules violated. */ + totalCount: Scalars['Int']['output']; + /** Total number of lint warnings. */ + warningsCount: Scalars['Int']['output']; +}; + +export type LinterIgnoredRuleChangesInput = { + ruleViolationsToEnable: Array; + ruleViolationsToIgnore: Array; +}; + +/** The category used for grouping similar rules. */ +export enum LinterRuleCategory { + /** These rules are generated during composition. */ + COMPOSITION = 'COMPOSITION', + /** These rules enforce naming conventions. */ + NAMING = 'NAMING', + /** These rules define conventions for the entire schema and directive usage outside of composition. */ + OTHER = 'OTHER' +} + +export type LinterRuleLevelConfiguration = { + __typename?: 'LinterRuleLevelConfiguration'; + /** Illustrative code showcasing the potential violation of this rule. */ + badExampleCode?: Maybe; + /** The category used for grouping similar rules. */ + category: LinterRuleCategory; + /** A human readable description of the rule. */ + description: Scalars['String']['output']; + /** Illustrative code showcasing the fix for the potential violation of this rule. */ + goodExampleCode?: Maybe; + /** The configured level for the rule. */ + level: LintDiagnosticLevel; + /** The name for this lint rule. */ + rule: LintRule; +}; + +export type LinterRuleLevelConfigurationChangesInput = { + level: LintDiagnosticLevel; + rule: LintRule; +}; + +/** The result of a failed call to GraphVariantMutation.linkPersistedQueryList when the specified list can't be found. */ +export type ListNotFoundError = Error & { + __typename?: 'ListNotFoundError'; + listId: Scalars['ID']['output']; + message: Scalars['String']['output']; +}; + +export type Location = { + __typename?: 'Location'; + end?: Maybe; + start?: Maybe; + subgraphName?: Maybe; +}; + +/** Level of the log entry */ +export enum LogLevel { + /** Debug log entry */ + DEBUG = 'DEBUG', + /** Error log entry */ + ERROR = 'ERROR', + /** Informational log entry */ + INFO = 'INFO', + /** Warning log entry */ + WARN = 'WARN' +} + +/** Order log message */ +export type LogMessage = { + __typename?: 'LogMessage'; + /** Log level */ + level: LogLevel; + /** Log message contents */ + message: Scalars['String']['output']; + /** Timestamp in UTC */ + timestamp: Scalars['DateTime']['output']; +}; + +export enum LoginFlowSource { + INTERNAL_SSO = 'INTERNAL_SSO' +} + +export type MarkChangesForOperationAsSafeResult = { + __typename?: 'MarkChangesForOperationAsSafeResult'; + /** + * Nice to have for the frontend since the Apollo cache is already watching for AffectedQuery to update. + * This might return null if no behavior changes were found for the affected operation ID. + * This is a weird situation that should never happen. + */ + affectedOperation?: Maybe; + message: Scalars['String']['output']; + success: Scalars['Boolean']['output']; +}; + +export type MediaUploadInfo = { + __typename?: 'MediaUploadInfo'; + csrfToken: Scalars['String']['output']; + maxContentLength: Scalars['Int']['output']; + url: Scalars['String']['output']; +}; + +/** This type represents a conflict between two versions of a schema i.e. the current proposal and the updated source variant schema */ +export type MergeConflict = { + __typename?: 'MergeConflict'; + /** The diffs that caused the conflict */ + diffItems: Array; + /** location of conflicts in the partialMergeSdl */ + locationCoordinate?: Maybe; + /** message explaining the conflict */ + message?: Maybe; +}; + +export type MergedSdlWithConflictsData = { + __typename?: 'MergedSdlWithConflictsData'; + subgraphsWithConflicts: Array; +}; + +export type MergedSdlWithConflictsResult = MergedSdlWithConflictsData | NotFoundError; + +export type MetricStatWindow = { + __typename?: 'MetricStatWindow'; + timestamp: Scalars['Timestamp']['output']; + value: Scalars['Long']['output']; + windowSize: BillingUsageStatsWindowSize; +}; + +export type MoveOperationCollectionEntryResult = InvalidTarget | MoveOperationCollectionEntrySuccess | PermissionError; + +export type MoveOperationCollectionEntrySuccess = { + __typename?: 'MoveOperationCollectionEntrySuccess'; + operation: OperationCollectionEntry; + originCollection: OperationCollection; + targetCollection: OperationCollection; +}; + +/** Input type to provide when running schema checks against multiple subgraph changes asynchronously for a federated supergraph. */ +export type MultiSubgraphCheckAsyncInput = { + /** Configuration options for the check execution. */ + config: HistoricQueryParametersInput; + /** The GitHub context to associate with the check. */ + gitContext: GitContextInput; + /** The graph ref of the Studio graph and variant to run checks against (such as `my-graph@current`). */ + graphRef?: InputMaybe; + /** The URL of the GraphQL endpoint that Apollo Sandbox introspected to obtain the proposed schema. Required if `isSandbox` is `true`. */ + introspectionEndpoint?: InputMaybe; + /** If `true`, the check was initiated automatically by a Proposal update. */ + isProposal?: InputMaybe; + /** If `true`, the check was initiated by Apollo Sandbox. */ + isSandbox: Scalars['Boolean']['input']; + /** The source variant that this check should use the operations check configuration from */ + sourceVariant?: InputMaybe; + /** The changed subgraph schemas to check. */ + subgraphsToCheck: Array>; + /** The user that triggered this check. If null, defaults to authContext to determine user. */ + triggeredBy?: InputMaybe; +}; + +/** GraphQL mutations */ +export type Mutation = { + __typename?: 'Mutation'; + /** @deprecated Use Mutation.organization instead. */ + account?: Maybe; + addOidcConfigurationToBaseConnection?: Maybe; + billing?: Maybe; + /** + * Allows the frontend to check if a SSO configuration key is valid. + * This helps restrict access to the public SSO configuration page. + */ + checkSsoConfigurationKey: Scalars['Boolean']['output']; + /** Cloud mutations */ + cloud: CloudMutation; + cloudTesting: CloudTestingMutation; + /** Creates an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/) for a given variant, or creates a [sandbox collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/#sandbox-collections) without an associated variant. */ + createOperationCollection: CreateOperationCollectionResult; + /** + * Finalize a password reset with a token included in the E-mail link, + * returns the corresponding login email when successful + */ + finalizePasswordReset?: Maybe; + /** Provides access to mutation fields for modifying a Studio graph with the provided ID. */ + graph?: Maybe; + /** Join an account with a token */ + joinAccount?: Maybe; + me?: Maybe; + newAccount?: Maybe; + /** Define a new billing plan */ + newBillingPlan?: Maybe; + /** Define a new boolean capability to be applied to billing plans and subscriptions */ + newCapability?: Maybe; + /** Define a new numeric limit to be applied to billing plans and subscriptions */ + newLimit?: Maybe; + newService?: Maybe; + operationCollection?: Maybe; + /** Provides access to mutation fields for modifying a an organization with the provided ID. */ + organization?: Maybe; + plan?: Maybe; + /** + * Provides access to mutation fields for modifying a GraphOS Schema Proposals with the provided ID. Learn more at https://www.apollographql.com/docs/graphos/delivery/schema-proposals + * @deprecated Use GraphVariantMutation.proposal instead + */ + proposal: ProposalMutationResult; + /** @deprecated Use GraphVariantMutation.proposal instead */ + proposalByVariantRef: ProposalMutationResult; + publishEDUEvent: Scalars['Boolean']['output']; + /** Push a lead to Marketo by program ID */ + pushMarketoLead: Scalars['Boolean']['output']; + /** Report a running GraphQL server's schema. */ + reportSchema?: Maybe; + /** Ask for a user's password to be reset by E-mail */ + resetPassword?: Maybe; + resolveAllInternalCronExecutions?: Maybe; + resolveInternalCronExecution?: Maybe; + service?: Maybe; + /** Set the subscriptions for a given email */ + setSubscriptions?: Maybe; + /** Set the studio settings for the current user */ + setUserSettings?: Maybe; + signUp?: Maybe; + ssoV2: SsoMutation; + /** This is called by the form shown to users after they delete their user or organization account. */ + submitPostDeletionFeedback?: Maybe; + /** Mutation for basic engagement tracking in studio */ + track?: Maybe; + /** Apollo Kotlin usage tracking. */ + trackApolloKotlinUsage?: Maybe; + /** Router usage tracking. Reserved to https://router.apollo.dev/telemetry (https://github.com/apollographql/orbiter). */ + trackRouterUsage?: Maybe; + /** Rover session tracking. Reserved to https://rover.apollo.dev/telemetry (https://github.com/apollographql/orbiter). */ + trackRoverSession?: Maybe; + transferOdysseyProgress: Scalars['Boolean']['output']; + /** Unsubscribe a given email from all emails */ + unsubscribeFromAll?: Maybe; + updateSurvey: Survey; + /** + * Provides access to mutation fields for modifying an Apollo user with the + * provided ID. + */ + user?: Maybe; +}; + + +/** GraphQL mutations */ +export type MutationAccountArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationAddOidcConfigurationToBaseConnectionArgs = { + config: OidcConfigurationInput; + configurationKey: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationCheckSsoConfigurationKeyArgs = { + key: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationCreateOperationCollectionArgs = { + description?: InputMaybe; + isSandbox: Scalars['Boolean']['input']; + isShared: Scalars['Boolean']['input']; + minEditRole?: InputMaybe; + name: Scalars['String']['input']; + variantRefs?: InputMaybe>; +}; + + +/** GraphQL mutations */ +export type MutationFinalizePasswordResetArgs = { + newPassword: Scalars['String']['input']; + resetToken: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationGraphArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationJoinAccountArgs = { + accountId: Scalars['ID']['input']; + joinToken: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationNewAccountArgs = { + companyUrl?: InputMaybe; + id: Scalars['ID']['input']; + organizationName?: InputMaybe; + planId?: InputMaybe; +}; + + +/** GraphQL mutations */ +export type MutationNewBillingPlanArgs = { + plan: BillingPlanInput; +}; + + +/** GraphQL mutations */ +export type MutationNewCapabilityArgs = { + capability: BillingCapabilityInput; +}; + + +/** GraphQL mutations */ +export type MutationNewLimitArgs = { + limit: BillingLimitInput; +}; + + +/** GraphQL mutations */ +export type MutationNewServiceArgs = { + accountId: Scalars['ID']['input']; + description?: InputMaybe; + hiddenFromUninvitedNonAdminAccountMembers?: Scalars['Boolean']['input']; + id: Scalars['ID']['input']; + name?: InputMaybe; + onboardingArchitecture?: InputMaybe; + title?: InputMaybe; +}; + + +/** GraphQL mutations */ +export type MutationOperationCollectionArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationOrganizationArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationPlanArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationProposalArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationProposalByVariantRefArgs = { + variantRef: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationPublishEduEventArgs = { + data: Scalars['String']['input']; + type: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationPushMarketoLeadArgs = { + input: PushMarketoLeadInput; + programId: Scalars['ID']['input']; + programStatus?: InputMaybe; + source?: InputMaybe; +}; + + +/** GraphQL mutations */ +export type MutationReportSchemaArgs = { + coreSchema?: InputMaybe; + report: SchemaReport; +}; + + +/** GraphQL mutations */ +export type MutationResetPasswordArgs = { + email: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationResolveAllInternalCronExecutionsArgs = { + group?: InputMaybe; + name?: InputMaybe; +}; + + +/** GraphQL mutations */ +export type MutationResolveInternalCronExecutionArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationServiceArgs = { + id: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationSetSubscriptionsArgs = { + email: Scalars['String']['input']; + subscriptions: Array; + token: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationSetUserSettingsArgs = { + newSettings?: InputMaybe; +}; + + +/** GraphQL mutations */ +export type MutationSignUpArgs = { + email: Scalars['String']['input']; + fullName: Scalars['String']['input']; + password: Scalars['String']['input']; + referrer?: InputMaybe; + trackingGoogleClientId?: InputMaybe; + trackingMarketoClientId?: InputMaybe; + trackingValues?: InputMaybe; + userSegment?: InputMaybe; + utmCampaign?: InputMaybe; + utmMedium?: InputMaybe; + utmSource?: InputMaybe; +}; + + +/** GraphQL mutations */ +export type MutationSubmitPostDeletionFeedbackArgs = { + feedback: Scalars['String']['input']; + targetIdentifier: Scalars['ID']['input']; + targetType: DeletionTargetType; +}; + + +/** GraphQL mutations */ +export type MutationTrackArgs = { + event: EventEnum; + graphID: Scalars['String']['input']; + graphVariant?: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationTrackApolloKotlinUsageArgs = { + events: Array; + instanceId: Scalars['ID']['input']; + properties: Array; +}; + + +/** GraphQL mutations */ +export type MutationTrackRouterUsageArgs = { + ci?: InputMaybe; + os: Scalars['String']['input']; + sessionId: Scalars['ID']['input']; + usage: Array; + version: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationTrackRoverSessionArgs = { + anonymousId: Scalars['ID']['input']; + arguments: Array; + ci?: InputMaybe; + command: Scalars['String']['input']; + cwdHash: Scalars['SHA256']['input']; + os: Scalars['String']['input']; + remoteUrlHash?: InputMaybe; + sessionId: Scalars['ID']['input']; + version: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationTransferOdysseyProgressArgs = { + from: Scalars['ID']['input']; + to: Scalars['ID']['input']; +}; + + +/** GraphQL mutations */ +export type MutationUnsubscribeFromAllArgs = { + email: Scalars['String']['input']; + token: Scalars['String']['input']; +}; + + +/** GraphQL mutations */ +export type MutationUpdateSurveyArgs = { + internalAccountId: Scalars['String']['input']; + surveyId: Scalars['String']['input']; + surveyIdVersion: Scalars['Int']['input']; + surveyState: Array; +}; + + +/** GraphQL mutations */ +export type MutationUserArgs = { + id: Scalars['ID']['input']; +}; + +export type NamedIntrospectionArg = { + __typename?: 'NamedIntrospectionArg'; + description?: Maybe; + name?: Maybe; +}; + +export type NamedIntrospectionArgNoDescription = { + __typename?: 'NamedIntrospectionArgNoDescription'; + name?: Maybe; +}; + +/** + * The shared fields for a named introspection type. Currently this is returned for the + * top level value affected by a change. In the future, we may update this + * type to be an interface, which is extended by the more specific types: + * scalar, object, input object, union, interface, and enum + * + * For an in-depth look at where these types come from, see: + * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/659eb50d3/types/graphql/utilities/introspectionQuery.d.ts#L31-L37 + */ +export type NamedIntrospectionType = { + __typename?: 'NamedIntrospectionType'; + description?: Maybe; + kind?: Maybe; + name?: Maybe; +}; + +export type NamedIntrospectionTypeNoDescription = { + __typename?: 'NamedIntrospectionTypeNoDescription'; + name?: Maybe; +}; + +/** + * Introspection values that can be children of other types for changes, such + * as input fields, objects in interfaces, enum values. In the future, this + * value could become an interface to allow fields specific to the types + * returned. + */ +export type NamedIntrospectionValue = { + __typename?: 'NamedIntrospectionValue'; + description?: Maybe; + name?: Maybe; + printedType?: Maybe; +}; + +export type NamedIntrospectionValueNoDescription = { + __typename?: 'NamedIntrospectionValueNoDescription'; + name?: Maybe; + printedType?: Maybe; +}; + +/** A non-federated service for a monolithic graph. */ +export type NonFederatedImplementingService = { + __typename?: 'NonFederatedImplementingService'; + /** Timestamp of when this implementing service was created. */ + createdAt: Scalars['Timestamp']['output']; + /** + * Identifies which graph this non-implementing service belongs to. + * Formerly known as "service_id". + */ + graphID: Scalars['String']['output']; + /** + * Specifies which variant of a graph this implementing service belongs to". + * Formerly known as "tag". + */ + graphVariant: Scalars['String']['output']; +}; + +/** An error that occurs when a requested object is not found. */ +export type NotFoundError = Error & { + __typename?: 'NotFoundError'; + /** The error message. */ + message: Scalars['String']['output']; +}; + +export enum NotificationStatus { + ALL = 'ALL', + NONE = 'NONE' +} + +export type OdysseyAttempt = { + __typename?: 'OdysseyAttempt'; + completedAt?: Maybe; + id: Scalars['ID']['output']; + pass?: Maybe; + responses: Array; + startedAt: Scalars['Timestamp']['output']; + testId: Scalars['String']['output']; +}; + +export type OdysseyCertification = { + __typename?: 'OdysseyCertification'; + certificationId: Scalars['String']['output']; + earnedAt: Scalars['Timestamp']['output']; + icon?: Maybe; + id: Scalars['ID']['output']; + owner?: Maybe; + source?: Maybe; +}; + +export type OdysseyCertificationOwner = { + __typename?: 'OdysseyCertificationOwner'; + fullName: Scalars['String']['output']; + id: Scalars['ID']['output']; +}; + +export type OdysseyCourse = { + __typename?: 'OdysseyCourse'; + completedAt?: Maybe; + enrolledAt?: Maybe; + id: Scalars['ID']['output']; + language?: Maybe; +}; + +export type OdysseyCourseInput = { + completedAt?: InputMaybe; + courseId: Scalars['String']['input']; + isBeta?: InputMaybe; + language?: InputMaybe; +}; + +export type OdysseyResponse = { + __typename?: 'OdysseyResponse'; + correct?: Maybe; + id: Scalars['ID']['output']; + questionId: Scalars['String']['output']; + values: Array; +}; + +export type OdysseyResponseCorrectnessInput = { + correct: Scalars['Boolean']['input']; + id: Scalars['ID']['input']; +}; + +export type OdysseyResponseInput = { + attemptId: Scalars['ID']['input']; + correct?: InputMaybe; + questionId: Scalars['String']['input']; + values: Array; +}; + +export type OdysseyTask = { + __typename?: 'OdysseyTask'; + completedAt?: Maybe; + id: Scalars['ID']['output']; + value?: Maybe; +}; + +export type OdysseyTaskInput = { + completedAt?: InputMaybe; + taskId: Scalars['String']['input']; + value?: InputMaybe; +}; + +export type OdysseyValue = { + __typename?: 'OdysseyValue'; + id: Scalars['ID']['output']; + value: Scalars['String']['output']; +}; + +export type OidcConfigurationInput = { + clientId: Scalars['String']['input']; + clientSecret: Scalars['String']['input']; + discoveryURI?: InputMaybe; + issuer: Scalars['String']['input']; +}; + +export type OidcConfigurationUpdateInput = { + clientId: Scalars['String']['input']; + clientSecret?: InputMaybe; + discoveryURI?: InputMaybe; + issuer: Scalars['String']['input']; +}; + +export type OidcConnection = SsoConnection & { + __typename?: 'OidcConnection'; + clientId: Scalars['ID']['output']; + discoveryUri?: Maybe; + domains: Array; + id: Scalars['ID']['output']; + idpId: Scalars['ID']['output']; + issuer: Scalars['String']['output']; + scim?: Maybe; + /** @deprecated Use stateV2 instead */ + state: SsoConnectionState; + stateV2: SsoConnectionStateV2; +}; + +export enum OnboardingArchitecture { + MONOLITH = 'MONOLITH', + SUPERGRAPH = 'SUPERGRAPH' +} + +export type Operation = { + __typename?: 'Operation'; + id: Scalars['ID']['output']; + name?: Maybe; + signature?: Maybe; + truncated: Scalars['Boolean']['output']; +}; + +export type OperationAcceptedChange = { + __typename?: 'OperationAcceptedChange'; + acceptedAt: Scalars['Timestamp']['output']; + acceptedBy?: Maybe; + change: StoredApprovedChange; + checkID: Scalars['ID']['output']; + graphID: Scalars['ID']['output']; + id: Scalars['ID']['output']; + operationID: Scalars['String']['output']; +}; + +/** Columns of OperationCheckStats. */ +export enum OperationCheckStatsColumn { + CACHED_REQUESTS_COUNT = 'CACHED_REQUESTS_COUNT', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + UNCACHED_REQUESTS_COUNT = 'UNCACHED_REQUESTS_COUNT' +} + +export type OperationCheckStatsDimensions = { + __typename?: 'OperationCheckStatsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in OperationCheckStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type OperationCheckStatsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in OperationCheckStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type OperationCheckStatsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type OperationCheckStatsMetrics = { + __typename?: 'OperationCheckStatsMetrics'; + cachedRequestsCount: Scalars['Long']['output']; + uncachedRequestsCount: Scalars['Long']['output']; +}; + +export type OperationCheckStatsOrderBySpec = { + column: OperationCheckStatsColumn; + direction: Ordering; +}; + +export type OperationCheckStatsRecord = { + __typename?: 'OperationCheckStatsRecord'; + /** Dimensions of OperationCheckStats that can be grouped by. */ + groupBy: OperationCheckStatsDimensions; + /** Metrics of OperationCheckStats that can be aggregated over. */ + metrics: OperationCheckStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** A list of saved GraphQL operations. */ +export type OperationCollection = { + __typename?: 'OperationCollection'; + /** The timestamp when the collection was created. */ + createdAt: Scalars['Timestamp']['output']; + /** The user or other entity that created the collection. */ + createdBy?: Maybe; + /** The collection's description. A `null` description was never set, and empty string description was set to be empty string by a user, or other entity. */ + description?: Maybe; + /** + * If a user has any of these roles, they will be able to edit this + * collection. + * @deprecated deprecated in favour of minEditRole + */ + editRoles?: Maybe>; + id: Scalars['ID']['output']; + /** Whether the current user has marked the collection as a favorite. */ + isFavorite: Scalars['Boolean']['output']; + /** Whether the collection is a [sandbox collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/#sandbox-collections). */ + isSandbox: Scalars['Boolean']['output']; + /** Whether the collection is shared across its associated organization. */ + isShared: Scalars['Boolean']['output']; + /** The timestamp when the collection was most recently updated. */ + lastUpdatedAt: Scalars['Timestamp']['output']; + /** The user or other entity that most recently updated the collection. */ + lastUpdatedBy?: Maybe; + /** The minimum role a user needs to edit this collection. Valid values: null, CONSUMER, OBSERVER, DOCUMENTER, CONTRIBUTOR, GRAPH_ADMIN. This value is always `null` if `isShared` is `false`. If `null` when `isShared` is `true`, the minimum role is `GRAPH_ADMIN`. */ + minEditRole?: Maybe; + /** The collection's name. */ + name: Scalars['String']['output']; + /** Returns the operation in the collection with the specified ID, if any. */ + operation?: Maybe; + /** A list of the GraphQL operations that belong to the collection. */ + operations: Array; + /** The permissions that the current user has for the collection. */ + permissions: OperationCollectionPermissions; + variants: Array; +}; + + +/** A list of saved GraphQL operations. */ +export type OperationCollectionOperationArgs = { + id: Scalars['ID']['input']; +}; + +/** A saved operation entry within an Operation Collection. */ +export type OperationCollectionEntry = { + __typename?: 'OperationCollectionEntry'; + collection: OperationCollection; + /** The timestamp when the entry was created. */ + createdAt: Scalars['Timestamp']['output']; + /** The user or other entity that created the entry. */ + createdBy?: Maybe; + /** Details of the entry's associated operation, such as its `body` and `variables`. */ + currentOperationRevision: OperationCollectionEntryState; + id: Scalars['ID']['output']; + /** The timestamp when the entry was most recently updated. */ + lastUpdatedAt: Scalars['Timestamp']['output']; + /** The user or other entity that most recently updated the entry. */ + lastUpdatedBy?: Maybe; + /** The entry's name. */ + name: Scalars['String']['output']; + /** The entry's lexicographical ordering index within its containing collection. */ + orderingIndex: Scalars['String']['output']; +}; + +/** Provides fields for modifying an operation in a collection. */ +export type OperationCollectionEntryMutation = { + __typename?: 'OperationCollectionEntryMutation'; + moveToCollection: MoveOperationCollectionEntryResult; + reorderEntry?: Maybe; + /** Updates the name of an operation. */ + updateName?: Maybe; + /** Updates the body, headers, and/or variables of an operation. */ + updateValues?: Maybe; +}; + + +/** Provides fields for modifying an operation in a collection. */ +export type OperationCollectionEntryMutationMoveToCollectionArgs = { + collectionId: Scalars['ID']['input']; + lowerOrderingBound?: InputMaybe; + upperOrderingBound?: InputMaybe; +}; + + +/** Provides fields for modifying an operation in a collection. */ +export type OperationCollectionEntryMutationReorderEntryArgs = { + lowerOrderingBound?: InputMaybe; + upperOrderingBound?: InputMaybe; +}; + + +/** Provides fields for modifying an operation in a collection. */ +export type OperationCollectionEntryMutationUpdateNameArgs = { + name: Scalars['String']['input']; +}; + + +/** Provides fields for modifying an operation in a collection. */ +export type OperationCollectionEntryMutationUpdateValuesArgs = { + operationInput: OperationCollectionEntryStateInput; +}; + +export type OperationCollectionEntryMutationResult = NotFoundError | OperationCollectionEntryMutation | PermissionError; + +/** Possible return values when querying for an entry in an operation collection (either the entry object or an `Error` object). */ +export type OperationCollectionEntryResult = NotFoundError | OperationCollectionEntry; + +/** The most recent body, variable and header values of a saved operation entry. */ +export type OperationCollectionEntryState = { + __typename?: 'OperationCollectionEntryState'; + /** The raw body of the entry's GraphQL operation. */ + body: Scalars['String']['output']; + /** The timestamp when the entry state was created. */ + createdAt: Scalars['Timestamp']['output']; + /** The user or other entity that created this entry state. */ + createdBy?: Maybe; + /** Headers for the entry's GraphQL operation. */ + headers?: Maybe>; + /** The post operation workflow automation script for this entry's GraphQL operation */ + postflightOperationScript?: Maybe; + /** The pre operation workflow automation script for this entry's GraphQL operation */ + script?: Maybe; + /** Variables for the entry's GraphQL operation, as a JSON string. */ + variables?: Maybe; +}; + +/** Fields for creating or modifying an operation collection entry. */ +export type OperationCollectionEntryStateInput = { + /** The operation's query body. */ + body: Scalars['String']['input']; + /** The operation's headers. */ + headers?: InputMaybe>; + /** The operation's postflight workflow script */ + postflightOperationScript?: InputMaybe; + /** The operation's preflight workflow script */ + script?: InputMaybe; + /** The operation's variables. */ + variables?: InputMaybe; +}; + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutation = { + __typename?: 'OperationCollectionMutation'; + /** Adds an operation to this collection. */ + addOperation?: Maybe; + /** Adds operations to this collection. */ + addOperations?: Maybe; + /** @deprecated Will throw NotImplemented */ + addToVariant: AddOperationCollectionToVariantResult; + /** Deletes this operation collection. This also deletes all of the collection's associated operations. */ + delete?: Maybe; + /** Deletes an operation from this collection. */ + deleteOperation?: Maybe; + duplicateCollection: DuplicateOperationCollectionResult; + operation?: Maybe; + /** @deprecated Will throw NotImplemented */ + removeFromVariant: RemoveOperationCollectionFromVariantResult; + /** Updates the minimum role a user needs to be able to modify this collection. */ + setMinEditRole?: Maybe; + /** Updates this collection's description. */ + updateDescription?: Maybe; + /** Updates whether the current user has marked this collection as a favorite. */ + updateIsFavorite?: Maybe; + /** Updates whether this collection is shared across its associated organization. */ + updateIsShared?: Maybe; + /** Updates this operation collection's name. */ + updateName?: Maybe; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationAddOperationArgs = { + name: Scalars['String']['input']; + operationInput: OperationCollectionEntryStateInput; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationAddOperationsArgs = { + operations: Array; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationAddToVariantArgs = { + variantRef: Scalars['ID']['input']; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationDeleteOperationArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationDuplicateCollectionArgs = { + description?: InputMaybe; + isSandbox: Scalars['Boolean']['input']; + isShared: Scalars['Boolean']['input']; + name: Scalars['String']['input']; + variantRef?: InputMaybe; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationOperationArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationRemoveFromVariantArgs = { + variantRef: Scalars['ID']['input']; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationSetMinEditRoleArgs = { + editRole?: InputMaybe; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationUpdateDescriptionArgs = { + description?: InputMaybe; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationUpdateIsFavoriteArgs = { + isFavorite: Scalars['Boolean']['input']; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationUpdateIsSharedArgs = { + isShared: Scalars['Boolean']['input']; +}; + + +/** Provides fields for modifying an [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/). */ +export type OperationCollectionMutationUpdateNameArgs = { + name: Scalars['String']['input']; +}; + +/** Whether the current user can perform various actions on the associated collection. */ +export type OperationCollectionPermissions = { + __typename?: 'OperationCollectionPermissions'; + /** Whether the current user can edit operations in the associated collection. */ + canEditOperations: Scalars['Boolean']['output']; + /** Whether the current user can delete or update the associated collection's metadata, such as its name and description. */ + canManage: Scalars['Boolean']['output']; + /** Whether the current user can read operations in the associated collection. */ + canReadOperations: Scalars['Boolean']['output']; +}; + +export type OperationCollectionResult = NotFoundError | OperationCollection | PermissionError | ValidationError; + +export type OperationDetails = { + __typename?: 'OperationDetails'; + /** A hashed representation of the signature, commonly used as the operation ID. */ + id: Scalars['String']['output']; + /** The operation name or null if the operation is unnamed. */ + name?: Maybe; + /** First 128 characters of query signature for display. */ + signature?: Maybe; +}; + +export type OperationDocument = { + __typename?: 'OperationDocument'; + /** Operation document body */ + body: Scalars['String']['output']; + /** Operation name */ + name?: Maybe; +}; + +export type OperationDocumentInput = { + /** Operation document body */ + body: Scalars['String']['input']; + /** Operation name */ + name?: InputMaybe; +}; + +/** Saved headers on a saved operation. */ +export type OperationHeader = { + __typename?: 'OperationHeader'; + /** The header's name. */ + name: Scalars['String']['output']; + /** The header's value. */ + value: Scalars['String']['output']; +}; + +export type OperationHeaderInput = { + /** The header's name. */ + name: Scalars['String']['input']; + /** The header's value. */ + value: Scalars['String']['input']; +}; + +export type OperationInfoFilter = { + __typename?: 'OperationInfoFilter'; + id: Scalars['String']['output']; +}; + +export type OperationInfoFilterInput = { + id: Scalars['String']['input']; +}; + +export type OperationInsightsListFilterInInput = { + clientName?: InputMaybe>>; + clientVersion?: InputMaybe>>; +}; + +export type OperationInsightsListFilterInput = { + clientName?: InputMaybe; + clientVersion?: InputMaybe; + in?: InputMaybe; + isUnnamed?: InputMaybe; + isUnregistered?: InputMaybe; + operationTypes?: InputMaybe>; + or?: InputMaybe>; + search?: InputMaybe; +}; + +export type OperationInsightsListItem = { + __typename?: 'OperationInsightsListItem'; + cacheHitRate: Scalars['Float']['output']; + /** The p50 of the latency across cached requests. This can be null depending on the filter and sort order. */ + cacheTtlP50Ms?: Maybe; + /** A substring of the query signature for unnamed operations, otherwise the operation name. */ + displayName: Scalars['String']['output']; + errorCount: Scalars['Long']['output']; + errorCountPerMin: Scalars['Float']['output']; + errorPercentage: Scalars['Float']['output']; + /** The unique id for this operation. */ + id: Scalars['ID']['output']; + /** The operation name or null if the operation is unnamed. */ + name?: Maybe; + requestCount: Scalars['Long']['output']; + requestCountPerMin: Scalars['Float']['output']; + /** The p50 of the latency across all requests. This can be null depending on the filter and sort order. */ + serviceTimeP50Ms?: Maybe; + /** The p90 of the latency across all requests. This can be null depending on the filter and sort order. */ + serviceTimeP90Ms?: Maybe; + /** The p95 of the latency across all requests. This can be null depending on the filter and sort order. */ + serviceTimeP95Ms?: Maybe; + /** The p99 of the latency across all requests. This can be null depending on the filter and sort order. */ + serviceTimeP99Ms?: Maybe; + /** The query signature size as a number of UTF8 bytes. This can be null if the sort order is not SIGNATURE_BYTES. */ + signatureBytes?: Maybe; + /** The total duration across all requests. This can be null depending on the filter and sort order. */ + totalDurationMs?: Maybe; + type?: Maybe; +}; + +export enum OperationInsightsListOrderByColumn { + CACHE_HIT_RATE = 'CACHE_HIT_RATE', + CACHE_TTL_P50 = 'CACHE_TTL_P50', + ERROR_COUNT = 'ERROR_COUNT', + ERROR_COUNT_PER_MIN = 'ERROR_COUNT_PER_MIN', + ERROR_PERCENTAGE = 'ERROR_PERCENTAGE', + OPERATION_NAME = 'OPERATION_NAME', + REQUEST_COUNT = 'REQUEST_COUNT', + REQUEST_COUNT_PER_MIN = 'REQUEST_COUNT_PER_MIN', + SERVICE_TIME_P50 = 'SERVICE_TIME_P50', + SERVICE_TIME_P90 = 'SERVICE_TIME_P90', + SERVICE_TIME_P95 = 'SERVICE_TIME_P95', + SERVICE_TIME_P99 = 'SERVICE_TIME_P99', + SIGNATURE_BYTES = 'SIGNATURE_BYTES', + TOTAL_DURATION_MS = 'TOTAL_DURATION_MS' +} + +export type OperationInsightsListOrderByInput = { + /** The order column used for the operation results. Defaults to ordering by operation names. */ + column: OperationInsightsListOrderByColumn; + /** The direction used to order operation results. Defaults to ascending order. */ + direction: Ordering; +}; + +/** Information about pagination in a connection. */ +export type OperationInsightsListPageInfo = { + __typename?: 'OperationInsightsListPageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +/** Operation name filter configuration for a graph. */ +export type OperationNameFilter = { + __typename?: 'OperationNameFilter'; + /** name of the operation by the user and reported alongside metrics */ + name: Scalars['String']['output']; + version?: Maybe; +}; + +/** Options to filter by operation name. */ +export type OperationNameFilterInput = { + /** name of the operation set by the user and reported alongside metrics */ + name: Scalars['String']['input']; + version?: InputMaybe; +}; + +export enum OperationType { + MUTATION = 'MUTATION', + QUERY = 'QUERY', + SUBSCRIPTION = 'SUBSCRIPTION' +} + +export type OperationValidationError = { + __typename?: 'OperationValidationError'; + message: Scalars['String']['output']; +}; + +export type OperationsCheckConfiguration = { + __typename?: 'OperationsCheckConfiguration'; + /** + * During operation checks, if this option is enabled, the check will not fail or + * mark any operations as broken/changed if the default value has changed, only + * if the default value is removed completely. + */ + downgradeDefaultValueChange: Scalars['Boolean']['output']; + /** + * During operation checks, if this option is enabled, it evaluates a check + * run against zero operations as a pass instead of a failure. + */ + downgradeStaticChecks: Scalars['Boolean']['output']; + /** During the operations check, ignore clients matching any of the filters. */ + excludedClients: Array; + /** During the operations check, ignore operations matching any of the filters. */ + excludedOperationNames: Array; + /** During the operations check, ignore operations matching any of the filters. */ + excludedOperations: Array; + /** + * The start of the time range for the operations check, expressed as an offset from the time the + * check request was received (in seconds) or an ISO-8601 timestamp. This was either provided by the + * user or computed from variant- or graph-level settings. + * @deprecated Use fromNormalized instead + */ + from: Scalars['String']['output']; + /** The start of the time range for the operations check. */ + fromNormalized: Scalars['Timestamp']['output']; + /** + * During the operations check, fetch operations from the metrics data for + * variants. + */ + includedVariants: Array; + /** + * During the operations check, ignore operations that executed less than + * times in the time range. + */ + operationCountThreshold: Scalars['Int']['output']; + /** + * Duration the operations check, ignore operations that constituted less than + * % of the operations in the time range. + */ + operationCountThresholdPercentage: Scalars['Float']['output']; + /** + * The end of the time range for the operations check, expressed as an offset from the time the + * check request was received (in seconds) or an ISO-8601 timestamp. This was either provided by the + * user or computed from variant- or graph-level settings. + * @deprecated Use toNormalized instead + */ + to: Scalars['String']['output']; + /** The end of the time range for the operations check. */ + toNormalized: Scalars['Timestamp']['output']; +}; + +export type OperationsCheckConfigurationOverridesInput = { + /** + * During the operations check, ignore clients matching any of the filters. + * Providing null will use variant- or graph-level settings instead. + */ + excludedClients?: InputMaybe>; + /** + * During the operations check, ignore operations matching any of the + * filters. Providing null will use variant- or graph-level settings instead. + */ + excludedOperationNames?: InputMaybe>; + /** + * During the operations check, ignore operations matching any of the filters. + * Providing null will use variant- or graph-level settings instead. + */ + excludedOperations?: InputMaybe>; + /** + * The start of the time range for the operations check, expressed as an offset from the time the + * check request is received (in seconds) or an ISO-8601 timestamp. Providing null here and + * useMaxRetention as false will use variant- or graph-level settings instead. It is an error to + * provide a non-null value here and useMaxRetention as true. + */ + from?: InputMaybe; + /** + * During the operations check, fetch operations from the metrics data for + * variants. Providing null will use variant- or graph-level settings instead. + */ + includedVariants?: InputMaybe>; + /** + * During the operations check, ignore operations that executed less than + * times in the time range. Providing null will use variant- or graph-level settings instead. + */ + operationCountThreshold?: InputMaybe; + /** + * During the operations check, ignore operations that executed less than + * times in the time range. Expected values are between 0% and 5%. Providing null will use variant- + * or graph-level settings instead. + */ + operationCountThresholdPercentage?: InputMaybe; + /** + * The end of the time range for the operations check, expressed as an offset from the time the + * check request is received (in seconds) or an ISO-8601 timestamp. Providing null here and + * useMaxRetention as false will use variant- or graph-level settings instead. It is an error to + * provide a non-null value here and useMaxRetention as true. + */ + to?: InputMaybe; + /** + * During the operations check, use the maximum time range allowed by the graph's plan's retention. + * Providing false here and from/to as null will use variant- or graph-level settings instead. It is + * an error to provide true here and from/to as non-null. + */ + useMaxRetention?: Scalars['Boolean']['input']; +}; + +export type OperationsCheckResult = { + __typename?: 'OperationsCheckResult'; + /** Operations affected by all changes in diff */ + affectedQueries?: Maybe>; + /** Indicates whether the changes for this operation check were truncated due to their large quantity. */ + areChangesTruncated: Scalars['Boolean']['output']; + /** Summary/counts for all changes in diff */ + changeSummary: ChangeSummary; + /** List of schema changes with associated affected clients and operations */ + changes: Array; + /** Indication of the success of the change, either failure, warning, or notice. */ + checkSeverity: ChangeSeverity; + /** The variant that was used as a base to check against */ + checkedVariant: GraphVariant; + createdAt: Scalars['Timestamp']['output']; + /** The threshold that was crossed; null if the threshold was not exceeded */ + crossedOperationThreshold?: Maybe; + /** Graph ID of the variant */ + graphID: Scalars['String']['output']; + id: Scalars['ID']['output']; + /** Number of affected query operations that are neither marked as SAFE or IGNORED */ + numberOfAffectedOperations: Scalars['Int']['output']; + /** Number of operations that were validated during schema diff */ + numberOfCheckedOperations: Scalars['Int']['output']; + /** Total number of schema changes, excluding any truncation. */ + totalNumberOfChanges: Scalars['Int']['output']; + /** Operations checked against but not affecting the diff. */ + unaffectedOperations?: Maybe>; + workflowTask: OperationsCheckTask; +}; + +export type OperationsCheckTask = CheckWorkflowTask & { + __typename?: 'OperationsCheckTask'; + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + graphID: Scalars['ID']['output']; + id: Scalars['ID']['output']; + /** + * The result of the operations check. This will be null when the task is initializing or running, + * or when the build task fails (which is a prerequisite task to this one). + */ + result?: Maybe; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +/** Cloud Router order */ +export type Order = { + __typename?: 'Order'; + /** + * Completion percentage of the order (between 0 and 100) + * + * This will only return data for IN_PROGRESS, COMPLETED, or SUPERSEDED states + */ + completionPercentage?: Maybe; + /** When this Order was created */ + createdAt: Scalars['NaiveDateTime']['output']; + /** Order identifier */ + id: Scalars['ID']['output']; + /** Introspect why call to `ready` failed */ + introspectReady: Scalars['String']['output']; + logs: Array; + /** Order type */ + orderType: OrderType; + /** Checks if we can serve requests through the external endpoint */ + readyExternal: Scalars['Boolean']['output']; + /** Reason for ERRORED or ROLLING_BACK orders */ + reason?: Maybe; + /** Router associated with this Order */ + router: Router; + /** Checks if the service is updated */ + serviceReady: Scalars['Boolean']['output']; + /** Shard associated with this Order */ + shard: Shard; + /** Order status */ + status: OrderStatus; + /** Last time this Order was updated */ + updatedAt?: Maybe; +}; + +/** The order does not exist */ +export type OrderDoesNotExistError = { + __typename?: 'OrderDoesNotExistError'; + tryAgainSeconds: Scalars['Int']['output']; +}; + +/** Catch-all failure result of a failed order mutation. */ +export type OrderError = { + __typename?: 'OrderError'; + /** Error message */ + message: Scalars['String']['output']; +}; + +export type OrderMutation = { + __typename?: 'OrderMutation'; + /** Create an ALB rule */ + createAlbRule: OrderResult; + /** Create CNAME record */ + createCname: OrderResult; + /** Create an IAM Role */ + createIamRole: OrderResult; + /** Create a security group */ + createSecurityGroup: OrderResult; + /** Create an ECS service */ + createService: OrderResult; + /** Create a target group */ + createTargetGroup: OrderResult; + /** Create a task definition */ + createTaskDefinition: OrderResult; + /** Delete an ALB rule */ + deleteAlbRule: OrderResult; + /** Delete API key */ + deleteApiKey: OrderResult; + /** Delete CNAME */ + deleteCname: OrderResult; + /** Delete an IAM Role */ + deleteIamRole: OrderResult; + /** Delete a security group */ + deleteSecurityGroup: OrderResult; + /** Delete an ECS service */ + deleteService: OrderResult; + /** Delete a target group */ + deleteTargetGroup: OrderResult; + /** Delete a task definition */ + deleteTaskDefinition: OrderResult; + /** Force rollback of the order */ + forceRollback: OrderResult; + /** Rollback an ALB rule */ + rollbackAlbRule: OrderResult; + /** Rollback CNAME record */ + rollbackCname: OrderResult; + /** Rollback an IAM Role */ + rollbackIamRole: OrderResult; + /** Rollback router information */ + rollbackInfo: OrderResult; + /** Rollback router information */ + rollbackSecrets: OrderResult; + /** Rollback a security group */ + rollbackSecurityGroup: OrderResult; + /** Rollback an ECS service */ + rollbackService: OrderResult; + /** Rollback a target group */ + rollbackTargetGroup: OrderResult; + /** Rollback a task definition */ + rollbackTaskDefinition: OrderResult; + /** Set default environment variables */ + setDefaultVars: OrderResult; + /** Update an ALB rule */ + updateAlbRule: OrderResult; + /** Update an IAM Role */ + updateIamRole: OrderResult; + /** Update router information */ + updateInfo: OrderResult; + /** Update secrets */ + updateSecrets: OrderResult; + /** Update a Service */ + updateService: OrderResult; + /** Update order status */ + updateStatus: OrderResult; + /** Update order status with a reason and cause */ + updateStatusWithReason: OrderResult; + /** Update a task definition */ + updateTaskDefinition: OrderResult; +}; + + +export type OrderMutationUpdateStatusArgs = { + status: OrderStatus; + updateRouter?: InputMaybe; +}; + + +export type OrderMutationUpdateStatusWithReasonArgs = { + cause: ReasonCause; + reason: Scalars['String']['input']; + status: OrderStatus; + updateRouter?: InputMaybe; +}; + +/** Return an Order or an error */ +export type OrderOrError = Order | OrderDoesNotExistError; + +/** Represents the possible outcomes of an order mutation */ +export type OrderResult = InvalidInputErrors | Order | OrderError; + +/** Represents the different status for an order */ +export enum OrderStatus { + /** Order was successfully completed */ + COMPLETED = 'COMPLETED', + /** Order was unsuccessful */ + ERRORED = 'ERRORED', + /** New Order in progress */ + PENDING = 'PENDING', + /** + * Order is currently rolling back + * + * All resources created as part of this Order are being deleted + */ + ROLLING_BACK = 'ROLLING_BACK', + /** + * Order has been superseded by another, more recent order + * + * This can happen if two update orders arrive in close succession and we already + * started to process the newer order first. + */ + SUPERSEDED = 'SUPERSEDED' +} + +/** Represents the different types of order */ +export enum OrderType { + /** Create a new Cloud Router */ + CREATE_ROUTER = 'CREATE_ROUTER', + /** Destroy an existing Cloud Router */ + DESTROY_ROUTER = 'DESTROY_ROUTER', + /** Update an existing Cloud Router */ + UPDATE_ROUTER = 'UPDATE_ROUTER' +} + +export enum Ordering { + ASCENDING = 'ASCENDING', + DESCENDING = 'DESCENDING' +} + +export enum OrderingDirection { + ASC = 'ASC', + DESC = 'DESC' +} + +/** A reusable invite link for an organization. */ +export type OrganizationInviteLink = { + __typename?: 'OrganizationInviteLink'; + createdAt: Scalars['Timestamp']['output']; + /** A joinToken that can be passed to Mutation.joinAccount to join the organization. */ + joinToken: Scalars['String']['output']; + /** The role that the user will receive if they join the organization with this link. */ + role: UserPermission; +}; + +export type OrganizationSso = { + __typename?: 'OrganizationSSO'; + defaultRole: UserPermission; + idpid: Scalars['ID']['output']; + provider: OrganizationSsoProvider; +}; + +export enum OrganizationSsoProvider { + APOLLO = 'APOLLO' +} + +/** Information about pagination in a connection. */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']['output']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']['output']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; +}; + +/** PagerDuty notification channel */ +export type PagerDutyChannel = Channel & { + __typename?: 'PagerDutyChannel'; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + routingKey: Scalars['String']['output']; + subscriptions: Array; +}; + +/** PagerDuty notification channel parameters */ +export type PagerDutyChannelInput = { + name?: InputMaybe; + routingKey: Scalars['String']['input']; +}; + +export type ParentChangeProposalComment = ChangeProposalComment & ProposalComment & { + __typename?: 'ParentChangeProposalComment'; + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + /** true if the schemaCoordinate this comment is on doesn't exist in the diff between the most recent revision & the base sdl */ + outdated: Scalars['Boolean']['output']; + replies: Array; + replyCount: Scalars['Int']['output']; + schemaCoordinate: Scalars['String']['output']; + /** '#@!api!@#' for api schema, '#@!supergraph!@#' for supergraph schema, subgraph otherwise */ + schemaScope: Scalars['String']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export type ParentGeneralProposalComment = GeneralProposalComment & ProposalComment & { + __typename?: 'ParentGeneralProposalComment'; + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + replies: Array; + replyCount: Scalars['Int']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export type ParentProposalComment = ParentChangeProposalComment | ParentGeneralProposalComment; + +/** SAML certificate information parsed from an IdP's metadata XML */ +export type ParsedSamlCertInfo = { + __typename?: 'ParsedSamlCertInfo'; + notAfter: Scalars['Timestamp']['output']; + notBefore: Scalars['Timestamp']['output']; + pem: Scalars['String']['output']; + subjectDN: Scalars['String']['output']; +}; + +/** SAML metadata parsed from an IdP's metadata XML */ +export type ParsedSamlIdpMetadata = { + __typename?: 'ParsedSamlIdpMetadata'; + encryptionCerts: Array; + entityId: Scalars['String']['output']; + ssoUrl: Scalars['String']['output']; + verificationCerts: Array; + wantsSignedRequests: Scalars['Boolean']['output']; +}; + +export type ParsedSchemaCoordinate = { + __typename?: 'ParsedSchemaCoordinate'; + argName?: Maybe; + fieldName?: Maybe; + isDirective?: Maybe; + typeName: Scalars['String']['output']; +}; + +/** The schema for a single published subgraph in Studio. */ +export type PartialSchema = { + __typename?: 'PartialSchema'; + /** Timestamp for when the partial schema was created */ + createdAt: Scalars['Timestamp']['output']; + /** If this sdl is currently actively composed in the gateway, this is true */ + isLive: Scalars['Boolean']['output']; + /** The subgraph schema document as SDL. */ + sdl: Scalars['String']['output']; +}; + +/** + * Input for registering a partial schema to an implementing service. + * One of the fields must be specified (validated server-side). + * + * If a new partialSchemaSDL is passed in, this operation will store it before + * creating the association. + * + * If both the sdl and hash are specified, an error will be thrown if the provided + * hash doesn't match our hash of the sdl contents. If the sdl field is specified, + * the hash does not need to be and will be computed server-side. + */ +export type PartialSchemaInput = { + /** + * Hash of the partial schema to associate; error is thrown if only the hash is + * specified and the hash has not been seen before + */ + hash?: InputMaybe; + /** + * Contents of the partial schema in SDL syntax, but may reference types + * that aren't defined in this document + */ + sdl?: InputMaybe; +}; + +/** An error that's returned when the current user doesn't have sufficient permissions to perform an action. */ +export type PermissionError = Error & { + __typename?: 'PermissionError'; + /** The error message. */ + message: Scalars['String']['output']; +}; + +/** Information about the act of publishing operations to the list */ +export type PersistedQueriesPublish = { + __typename?: 'PersistedQueriesPublish'; + operationCounts: PersistedQueriesPublishOperationCounts; + publishedAt: Scalars['Timestamp']['output']; +}; + +export type PersistedQueriesPublishOperationCounts = { + __typename?: 'PersistedQueriesPublishOperationCounts'; + /** The number of new operations added to the list by this publish. */ + added: Scalars['Int']['output']; + /** The number of operations included in this publish whose metadata and body were unchanged from the previous list revision. */ + identical: Scalars['Int']['output']; + /** The number of operations removed from the list by this publish. */ + removed: Scalars['Int']['output']; + /** The number of operations in this list that were not mentioned by this publish. */ + unaffected: Scalars['Int']['output']; + /** The number of operations whose metadata or body were changed by this publish. */ + updated: Scalars['Int']['output']; +}; + +export type PersistedQuery = { + __typename?: 'PersistedQuery'; + body: Scalars['GraphQLDocument']['output']; + /** An optional client name associated with the operation. Two operations with the same ID but different client names are treated as distinct operations. An operation with the same ID and a null client name is treated as a distinct operation as well. */ + clientName?: Maybe; + firstPublishedAt: Scalars['Timestamp']['output']; + /** An opaque identifier for this operation. For a given client name, this should map uniquely to an operation body; editing the body should generally result in a new ID. Apollo's tools generally use the lowercase hex SHA256 of the operation body. Note that for (eg) Apollo Client keyFields, you should use both `id` and `clientName`. */ + id: Scalars['ID']['output']; + lastPublishedAt: Scalars['Timestamp']['output']; + /** The GraphQL operation name for this operation. */ + name: Scalars['String']['output']; + type: OperationType; +}; + +export type PersistedQueryConnection = { + __typename?: 'PersistedQueryConnection'; + edges: Array; + pageInfo: PageInfo; + totalCount: Scalars['Int']['output']; +}; + +export type PersistedQueryEdge = { + __typename?: 'PersistedQueryEdge'; + cursor: Scalars['String']['output']; + node: PersistedQuery; +}; + +/** Filter options for persisted query operations */ +export type PersistedQueryFilterInput = { + /** Only include operations whose client name is included in this list */ + clients?: InputMaybe>>; + /** Only include operations whose last published date is before or after the given date */ + lastPublishedAt?: InputMaybe; + /** Only include operations whose names contain this case-insensitive substring */ + name?: InputMaybe; +}; + +/** Full identifier for an operation in a Persisted Query List. */ +export type PersistedQueryIdInput = { + /** An optional client name to associate with the operation. Two operations with the same ID but different client names are treated as distinct operations. An operation with the same ID and a null client name is treated as a distinct operation as well. */ + clientName?: InputMaybe; + /** An opaque identifier for this operation. For a given client name, this should map uniquely to an operation body; editing the body should generally result in a new ID. Apollo's tools generally use the lowercase hex SHA256 of the operation body. */ + id: Scalars['ID']['input']; +}; + +/** Operations to be published to the Persisted Query List. */ +export type PersistedQueryInput = { + /** The GraphQL document for this operation, including all necessary fragment definitions. */ + body: Scalars['GraphQLDocument']['input']; + /** An optional client name to associate with the operation. Two operations with the same ID but different client names are treated as distinct operations. */ + clientName?: InputMaybe; + /** An opaque identifier for this operation. This should map uniquely to an operation body; editing the body should generally result in a new ID. Apollo's tools generally use the lowercase hex SHA256 of the operation body. */ + id: Scalars['ID']['input']; + /** A name for the operation. Typically this is the name of the actual GraphQL operation in the body. This does not need to be unique within a Persisted Query List; as a client project evolves and its operations change, multiple operations with the same name (but different body and id) can be published. */ + name: Scalars['String']['input']; + /** The operation's type. */ + type: OperationType; +}; + +/** A Persisted Query List for a graph. */ +export type PersistedQueryList = { + __typename?: 'PersistedQueryList'; + builds: PersistedQueryListBuildConnection; + /** Distinct client names associated with all operations in this Persisted Query List, if any. */ + clientNames: StringConnection; + createdAt: Scalars['Timestamp']['output']; + createdBy?: Maybe; + /** The current build of this PQL. */ + currentBuild: PersistedQueryListBuild; + description: Scalars['String']['output']; + graph: Service; + /** The immutable ID for this Persisted Query List. */ + id: Scalars['ID']['output']; + lastUpdatedAt: Scalars['Timestamp']['output']; + /** All variants linked to this Persisted Query List, if any. */ + linkedVariants: Array; + /** The list's name; can be changed and does not need to be unique. */ + name: Scalars['String']['output']; + operation?: Maybe; + /** All operations in this Persisted Query List, if any. */ + operations: PersistedQueryConnection; +}; + + +/** A Persisted Query List for a graph. */ +export type PersistedQueryListBuildsArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A Persisted Query List for a graph. */ +export type PersistedQueryListClientNamesArgs = { + first?: InputMaybe; +}; + + +/** A Persisted Query List for a graph. */ +export type PersistedQueryListOperationArgs = { + clientName?: InputMaybe; + id: Scalars['ID']['input']; +}; + + +/** A Persisted Query List for a graph. */ +export type PersistedQueryListOperationsArgs = { + after?: InputMaybe; + before?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + sort?: InputMaybe; +}; + +/** Information about a particular revision of the list, as produced by a particular publish. */ +export type PersistedQueryListBuild = { + __typename?: 'PersistedQueryListBuild'; + /** A unique ID for this build revision; primarily useful as a client cache ID. */ + id: Scalars['String']['output']; + /** The persisted query list that this build built. */ + list: PersistedQueryList; + /** The chunks that made up this build. We do not commit to keeping the full contents of older revisions indefinitely, so this may be null for suitably old revisions. */ + manifestChunks?: Maybe>; + /** Information about the publish operation that created this build. */ + publish: PersistedQueriesPublish; + /** The revision of this Persisted Query List. Revision 0 is the initial empty list; each publish increments the revision by 1. */ + revision: Scalars['Int']['output']; + /** The total number of operations in the list after this build. Compare to PersistedQueriesPublish.operationCounts. */ + totalOperationsInList: Scalars['Int']['output']; +}; + +export type PersistedQueryListBuildConnection = { + __typename?: 'PersistedQueryListBuildConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type PersistedQueryListBuildEdge = { + __typename?: 'PersistedQueryListBuildEdge'; + cursor: Scalars['String']['output']; + node: PersistedQueryListBuild; +}; + +export type PersistedQueryListManifestChunk = { + __typename?: 'PersistedQueryListManifestChunk'; + /** An immutable identifier for this particular chunk of a PQL. The contents referenced by this ID will never change. */ + id: Scalars['ID']['output']; + json: Scalars['String']['output']; + list: PersistedQueryList; + /** The chunk can be downloaded from any of these URLs, which might be transient. */ + urls: Array; +}; + +export type PersistedQueryListMutation = { + __typename?: 'PersistedQueryListMutation'; + /** Deletes this Persisted Query List. */ + delete: DeletePersistedQueryListResultOrError; + /** Deletes operations from this Persisted Query List based on filter criteria, with the ability to exclude specific operations. */ + deleteOperationsByFilter: DeleteOperationsByFilterResultOrError; + id: Scalars['ID']['output']; + /** Updates this Persisted Query List by publishing a set of operations and removing other operations. Operations not mentioned remain in the list unchanged. */ + publishOperations: PublishOperationsResultOrError; + /** Updates the name and/or description of the specified Persisted Query List. */ + updateMetadata: UpdatePersistedQueryListMetadataResultOrError; +}; + + +export type PersistedQueryListMutationDeleteOperationsByFilterArgs = { + exclude?: InputMaybe>; + filter: PersistedQueryFilterInput; +}; + + +export type PersistedQueryListMutationPublishOperationsArgs = { + allowOverwrittenOperations?: InputMaybe; + operations?: InputMaybe>; + remove?: InputMaybe>; + removeOperations?: InputMaybe>; +}; + + +export type PersistedQueryListMutationUpdateMetadataArgs = { + description?: InputMaybe; + name?: InputMaybe; +}; + +/** Columns available for sorting persisted query operations */ +export enum PersistedQuerySortColumn { + /** Sort by the first published date */ + FIRST_PUBLISHED_AT = 'FIRST_PUBLISHED_AT', + /** Sort by the last published date */ + LAST_PUBLISHED_AT = 'LAST_PUBLISHED_AT', + /** Sort by name */ + NAME = 'NAME' +} + +/** Sort options for persisted query operations */ +export type PersistedQuerySortInput = { + /** The column to sort by */ + column: PersistedQuerySortColumn; + /** The direction of sorting */ + direction: Ordering; +}; + +/** An error related to an organization's Apollo Studio plan. */ +export type PlanError = { + __typename?: 'PlanError'; + /** The error message. */ + message: Scalars['String']['output']; +}; + +/** GraphQL representation of an AWS private subgraph */ +export type PrivateSubgraph = { + __typename?: 'PrivateSubgraph'; + /** The cloud provider where the subgraph is hosted */ + cloudProvider: CloudProvider; + /** The domain URL of the private subgraph */ + domainUrl?: Maybe; + /** The name of the subgraph, if set */ + name?: Maybe; + /** The private subgraph's region */ + region: RegionDescription; + /** The status of the resource share */ + status: PrivateSubgraphShareStatus; +}; + +export type PrivateSubgraphMutation = { + __typename?: 'PrivateSubgraphMutation'; + /** Synchronize private subgraphs to your Apollo account */ + sync: Array; +}; + + +export type PrivateSubgraphMutationSyncArgs = { + input: SyncPrivateSubgraphsInput; +}; + +/** The status of an association between a private subgraph and your Apollo account */ +export enum PrivateSubgraphShareStatus { + /** The private subgraph is connected to the Apollo service network */ + CONNECTED = 'CONNECTED', + /** The private subgraph is disconnected to the Apollo service network */ + DISCONNECTED = 'DISCONNECTED', + /** The private subgraph's connection to the Apollo service network has errored */ + ERRORED = 'ERRORED', + /** The private subgraph's connection is pending */ + PENDING = 'PENDING', + /** The private subgraph's disconnection is pending */ + PENDING_DISCONNECTION = 'PENDING_DISCONNECTION', + /** The current state of the association is unknown */ + UNKNOWN = 'UNKNOWN' +} + +export type PromoteSchemaError = { + __typename?: 'PromoteSchemaError'; + code: PromoteSchemaErrorCode; + message: Scalars['String']['output']; +}; + +export enum PromoteSchemaErrorCode { + CANNOT_PROMOTE_SCHEMA_FOR_FEDERATED_GRAPH = 'CANNOT_PROMOTE_SCHEMA_FOR_FEDERATED_GRAPH' +} + +export type PromoteSchemaResponse = { + __typename?: 'PromoteSchemaResponse'; + code: PromoteSchemaResponseCode; + tag: SchemaTag; +}; + +export enum PromoteSchemaResponseCode { + NO_CHANGES_DETECTED = 'NO_CHANGES_DETECTED', + PROMOTION_SUCCESS = 'PROMOTION_SUCCESS' +} + +export type PromoteSchemaResponseOrError = PromoteSchemaError | PromoteSchemaResponse; + +export type Proposal = { + __typename?: 'Proposal'; + /** + * A list of the activities for this proposal. + * If first and last are not specified, defaults to 25. If one is specified there is a max allowed value of 50. + */ + activities: ProposalActivityConnection; + /** The variant this Proposal is under the hood. */ + backingVariant: GraphVariant; + /** Can the current user can edit THIS proposal, either by authorship or role level */ + canEditProposal: Scalars['Boolean']['output']; + changes: Array; + comment?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** + * null if user is deleted, or if user removed from org + * and others in the org no longer have access to this user's info + */ + createdBy?: Maybe; + /** The description of this Proposal. */ + description: Scalars['String']['output']; + descriptionUpdatedAt?: Maybe; + descriptionUpdatedBy?: Maybe; + displayName: Scalars['String']['output']; + /** A flag indicating if changes have been detected on the source variant. Will be false if proposal was created prior to the pull upstream feature release on Nov 15, 2024. */ + hasUpstreamChanges: Scalars['Boolean']['output']; + id: Scalars['ID']['output']; + implementedChanges: Array; + /** True if only some of the changes in this proposal are currently published to the implementation variant */ + isPartiallyImplemented: Scalars['Boolean']['output']; + latestRevision: ProposalRevision; + mergeBaseCompositionId?: Maybe; + /** + * Use mergedSdlWithConflicts instead. + * @deprecated Use mergedSdlWithConflicts instead + */ + mergedSdl: Array; + /** Returns a partially merged sdl string and list of conflicts in the sdl by merging the proposals's current sdl and the source variant's current sdl against the source variant's sdl at the time of the last merge or proposal creation. */ + mergedSdlWithConflicts?: Maybe; + parentComments: Array; + rebaseConflicts?: Maybe; + /** null if user deleted or removed from org */ + requestedReviewers: Array>; + reviews: Array; + revision?: Maybe; + revisionHistory: ProposalRevisionHistoryResult; + /** The variant this Proposal was cloned/sourced from. */ + sourceVariant: GraphVariant; + status: ProposalStatus; + updatedAt: Scalars['Timestamp']['output']; + updatedBy?: Maybe; +}; + + +export type ProposalActivitiesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +export type ProposalCommentArgs = { + id: Scalars['ID']['input']; +}; + + +export type ProposalParentCommentsArgs = { + filter?: InputMaybe; +}; + + +export type ProposalRevisionArgs = { + id: Scalars['ID']['input']; +}; + + +export type ProposalRevisionHistoryArgs = { + limit?: Scalars['Int']['input']; + offset?: Scalars['Int']['input']; + orderBy?: InputMaybe; +}; + +export type ProposalActivity = { + __typename?: 'ProposalActivity'; + activity?: Maybe; + createdAt: Scalars['Timestamp']['output']; + createdBy?: Maybe; + id: Scalars['ID']['output']; + target?: Maybe; +}; + +export enum ProposalActivityAction { + /** When the system changes a Proposal's status back to OPEN from APPROVED when approvals drop below min approvals. */ + APPROVAL_WITHDRAWN = 'APPROVAL_WITHDRAWN', + /** When the system changes a Proposal's status back to OPEN from APPROVED when a change is made after a proposal or review is approved. */ + APPROVAL_WITHDRAWN_ON_PUBLISH = 'APPROVAL_WITHDRAWN_ON_PUBLISH', + /** When a user manually sets a Proposal to Close */ + CLOSE_PROPOSAL = 'CLOSE_PROPOSAL', + /** When a Comment is added to a Proposal. */ + COMMENT_ADDED = 'COMMENT_ADDED', + /** When a subgraph in a Proposal is deleted. */ + DELETE_SUBGRAPH = 'DELETE_SUBGRAPH', + /** When a diff in a Proposal publish is found to already be in the Implementation target variant that fully implements the Proposal. Status of the Proposal will change to IMPLEMENTED. */ + FULLY_IMPLEMENTED_PROPOSAL_ORIGIN = 'FULLY_IMPLEMENTED_PROPOSAL_ORIGIN', + /** When a diff in an Implementation variant publish is found in a Proposal that fully implements the Proposal. Status of the Proposal will change to IMPLEMENTED. */ + FULLY_IMPLEMENTED_VARIANT_ORIGIN = 'FULLY_IMPLEMENTED_VARIANT_ORIGIN', + /** When the system changes a Proposal's status to APPROVED when the min approvals have been met. */ + MET_MIN_APPROVALS_PROPOSAL = 'MET_MIN_APPROVALS_PROPOSAL', + /** When a user manually sets a Proposal to Open */ + OPEN_PROPOSAL = 'OPEN_PROPOSAL', + /** When a diff in a Proposal publish is found to already be in the Implementation target variant that partially implements the Proposal. Does not change the status of the Proposal, but isPartiallyImplemented will return true. */ + PARTIALLY_IMPLEMENTED_PROPOSAL_ORIGIN = 'PARTIALLY_IMPLEMENTED_PROPOSAL_ORIGIN', + /** When a diff in an Implementation variant publish is found in a Proposal that partially implements the Proposal. Does not change the status of the Proposal, but isPartiallyImplemented will return true. */ + PARTIALLY_IMPLEMENTED_VARIANT_ORIGIN = 'PARTIALLY_IMPLEMENTED_VARIANT_ORIGIN', + /** When a new revision is published to subgraphs in a Proposal. */ + PUBLISH_SUBGRAPHS = 'PUBLISH_SUBGRAPHS', + /** When a Proposal is moved to DRAFT from another status not on creation. */ + RETURN_TO_DRAFT_PROPOSAL = 'RETURN_TO_DRAFT_PROPOSAL', + /** When a Review is added to a Proposal. */ + REVIEW_ADDED = 'REVIEW_ADDED' +} + +export type ProposalActivityConnection = { + __typename?: 'ProposalActivityConnection'; + edges?: Maybe>; + nodes: Array; + pageInfo: PageInfo; + totalCount: Scalars['Int']['output']; +}; + +export type ProposalActivityEdge = { + __typename?: 'ProposalActivityEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + node?: Maybe; +}; + +export type ProposalActivityTarget = ParentChangeProposalComment | ParentGeneralProposalComment | Proposal | ProposalFullImplementationProposalOrigin | ProposalFullImplementationVariantOrigin | ProposalPartialImplementationProposalOrigin | ProposalPartialImplementationVariantOrigin | ProposalReview | ProposalRevision; + +export type ProposalChange = { + __typename?: 'ProposalChange'; + diffItem: FlatDiffItem; + implemented: Scalars['Boolean']['output']; +}; + +export enum ProposalChangeMismatchSeverity { + ERROR = 'ERROR', + OFF = 'OFF', + WARN = 'WARN' +} + +export type ProposalComment = { + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export type ProposalCommentResult = NotFoundError | ParentChangeProposalComment | ParentGeneralProposalComment | ReplyChangeProposalComment | ReplyGeneralProposalComment | ReviewProposalComment; + +export enum ProposalCoverage { + FULL = 'FULL', + NONE = 'NONE', + OVERRIDDEN = 'OVERRIDDEN', + PARTIAL = 'PARTIAL', + PENDING = 'PENDING' +} + +export type ProposalFullImplementationProposalOrigin = ProposalImplementation & { + __typename?: 'ProposalFullImplementationProposalOrigin'; + /** the time this Proposal became implemented in the implementation target variant. */ + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** the diff that was matched between the Proposal and the implementation target variant. TODO to deserialize this back into a DiffItem NEBULA-2726 */ + jsonDiff: Array; + /** Revision containing a diff that fully implements this Proposal in the implementation target variant. */ + revision: ProposalRevision; + /** the target variant this Proposal became implemented in. */ + variant: GraphVariant; +}; + +export type ProposalFullImplementationVariantOrigin = ProposalImplementation & { + __typename?: 'ProposalFullImplementationVariantOrigin'; + /** the time this Proposal became implemented in the implementation target variant. */ + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** the diff that was matched between the Proposal and the implementation target variant. TODO to deserialize this back into a DiffItem NEBULA-2726 */ + jsonDiff: Array; + /** launch containing a diff that fully implements this Proposal in the implementation target variant. null if user does not have access to launches */ + launch?: Maybe; + /** the target variant this Proposal became implemented in. */ + variant: GraphVariant; +}; + +export type ProposalImplementation = { + /** the time this Proposal became implemented in the implementation target variant. */ + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** the diff that was matched between the Proposal and the implementation target variant */ + jsonDiff: Array; + /** the target variant this Proposal became implemented in. */ + variant: GraphVariant; +}; + +export type ProposalImplementedChange = { + __typename?: 'ProposalImplementedChange'; + diffItem: FlatDiffItem; + launchId: Scalars['ID']['output']; + subgraph: Scalars['String']['output']; +}; + +export enum ProposalLifecycleEvent { + PROPOSAL_CREATED = 'PROPOSAL_CREATED', + REVISION_SAVED = 'REVISION_SAVED', + STATUS_CHANGE = 'STATUS_CHANGE' +} + +export type ProposalLifecycleSubscription = ChannelSubscription & { + __typename?: 'ProposalLifecycleSubscription'; + /** The channels that will be notified on this subscription. */ + channels: Array; + /** The time when this ProposalLifecycleSubscription was created. */ + createdAt: Scalars['Timestamp']['output']; + /** The Identity that created this ProposalLifecycleSubscription. null if the Identity has been deleted. */ + createdBy?: Maybe; + /** True if this ProposalLifecycleSubscription is actively sending notifications. */ + enabled: Scalars['Boolean']['output']; + /** The ProposalLifecycleEvents that will trigger notifications on this subscription. */ + events: Array; + id: Scalars['ID']['output']; + /** The last time this subscription was updated, if never updated will be the createdAt time. */ + lastUpdatedAt: Scalars['Timestamp']['output']; + /** The Identity that last updated this ProposalLifecycleSubscription, or the creator if no one has updated. null if the Identity has been deleted. */ + lastUpdatedBy?: Maybe; + /** Always null for ProposalLifecycleSubscription. */ + variant?: Maybe; +}; + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutation = { + __typename?: 'ProposalMutation'; + addComment: AddCommentResult; + deleteComment: DeleteCommentResult; + /** Delete a subgraph from this proposal. This will write the summary to proposals, record the most up to date diff, and call registry's removeImplementingServiceAndTriggerComposition. If composition is successful, this will update running routers. */ + deleteSubgraph: DeleteProposalSubgraphResult; + editComment: EditCommentResult; + /** The GraphOS Schema Proposal being modified by this mutation. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ + proposal?: Maybe; + /** This mutation creates a new revision of a proposal by publishing multiple subgraphs, saving the summary and recording a diff. If composition is successful, this will update running routers. See the documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals/creation/#save-revisions */ + publishSubgraphs: PublishProposalSubgraphResult; + /** If a check workflow is not found for a revision, it attempts to create one. If there is a check workflow present, it re-runs the check and associates the new check to the provided revision. */ + reRunCheckForRevision: ReRunCheckForRevisionResult; + /** Removes all requested reviewers and their reviews that are not part of the new set of default reviewers. Adds any new default reviewers to the list of requested reviewers for this proposal. */ + replaceReviewersWithDefaultReviewers: ReplaceReviewersWithDefaultReviewersResult; + /** Set the mergeBaseCompositionId of this Proposal, if it is null. Must be internal MDG user with sudo. */ + setMergeBaseCompositionId: SetMergeBaseCompositionIdResult; + /** Updates the description of this Proposal variant. Returns ValidationError if description exceeds max length of 10k characters. */ + updateDescription: UpdateProposalResult; + /** Update the title of this proposal. */ + updateDisplayName: UpdateProposalResult; + /** Update the list of requested reviewers for this proposal. */ + updateRequestedReviewers: UpdateRequestedReviewersResult; + updateStatus: UpdateProposalResult; + updateUpdatedByInfo: UpdateProposalResult; + upsertReview: UpsertReviewResult; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationAddCommentArgs = { + input: AddCommentInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationDeleteCommentArgs = { + input: DeleteCommentInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationDeleteSubgraphArgs = { + input: DeleteProposalSubgraphInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationEditCommentArgs = { + input: EditCommentInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationPublishSubgraphsArgs = { + input: PublishProposalSubgraphsInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationReRunCheckForRevisionArgs = { + input: ReRunCheckForRevisionInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationSetMergeBaseCompositionIdArgs = { + input: SetMergeBaseCompositionIdInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationUpdateDescriptionArgs = { + input: UpdateDescriptionInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationUpdateDisplayNameArgs = { + displayName: Scalars['String']['input']; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationUpdateRequestedReviewersArgs = { + input: UpdateRequestedReviewersInput; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationUpdateStatusArgs = { + status: ProposalStatus; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationUpdateUpdatedByInfoArgs = { + timestamp: Scalars['Timestamp']['input']; +}; + + +/** Mutations for editing GraphOS Schema Proposals. See documentation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals */ +export type ProposalMutationUpsertReviewArgs = { + input: UpsertReviewInput; +}; + +export type ProposalMutationResult = NotFoundError | PermissionError | ProposalMutation | ValidationError; + +export type ProposalPartialImplementationProposalOrigin = ProposalImplementation & { + __typename?: 'ProposalPartialImplementationProposalOrigin'; + /** the time this Proposal became partially implemented in the implementation target variant. */ + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** the diff that was matched between the Proposal and the implementation target variant. TODO to deserialize this back into a DiffItem NEBULA-2726 */ + jsonDiff: Array; + /** Revision containing a diff that partially implements this Proposal in the implementation target variant. */ + revision: ProposalRevision; + /** the target variant this Proposal became partially implemented in. */ + variant: GraphVariant; +}; + +export type ProposalPartialImplementationVariantOrigin = ProposalImplementation & { + __typename?: 'ProposalPartialImplementationVariantOrigin'; + /** the time this Proposal became partially implemented in the implementation target variant. */ + createdAt: Scalars['Timestamp']['output']; + id: Scalars['ID']['output']; + /** the diff that was matched between the Proposal and the implementation target variant. TODO to deserialize this back into a DiffItem NEBULA-2726 */ + jsonDiff: Array; + /** launch containing a diff that partially implements this Proposal in the implementation target variant. null if user does not have access to launches */ + launch?: Maybe; + /** the target variant this Proposal became partially implemented in. */ + variant: GraphVariant; +}; + +export type ProposalRequestedReviewer = { + __typename?: 'ProposalRequestedReviewer'; + currentReview?: Maybe; + user?: Maybe; +}; + +export type ProposalReview = { + __typename?: 'ProposalReview'; + comment?: Maybe; + createdAt: Scalars['Timestamp']['output']; + createdBy?: Maybe; + decision: ReviewDecision; + id: Scalars['ID']['output']; + isDismissed: Scalars['Boolean']['output']; + updatedAt?: Maybe; + updatedBy?: Maybe; +}; + +export type ProposalRevision = { + __typename?: 'ProposalRevision'; + /** On publish, checks are triggered on a proposal automatically. However, if an error occurred triggering a check on publish, we skip attempting the check to avoid blocking the publish from succeeding. This is the only case this field would be null. */ + checkWorkflow?: Maybe; + createdAt: Scalars['Timestamp']['output']; + createdBy?: Maybe; + id: Scalars['ID']['output']; + isMerge: Scalars['Boolean']['output']; + launch?: Maybe; + /** ID of the launch that this revision is associated with. For internal use only, correct schema usage would be to access through the Launch, but CONSUMER role has no access to launch, yet they need access to the schema publish. */ + launchId: Scalars['ID']['output']; + /** Latest composition ID of the proposal's source variant at the time this revision was created. */ + mergeBaseCompositionId?: Maybe; + /** Latest launch of the proposal's source variant at the time this revision was created. */ + mergeBaseLaunch?: Maybe; + /** The schema publish of the proposal's source variant at the time this revision was created. Null if the launch is PENDING. */ + mergeBaseSchemaPublish?: Maybe; + /** null if this is the first revision */ + previousRevision?: Maybe; + /** The schema publish for this revision. Null while the launch is PENDING. */ + schemaPublish?: Maybe; + summary: Scalars['String']['output']; +}; + +export enum ProposalRevisionHistoryOrder { + /** List revisions from oldest to newest. */ + CREATED_ASC = 'CREATED_ASC', + /** List revisions from newest to oldest, default. */ + CREATED_DESC = 'CREATED_DESC' +} + +export type ProposalRevisionHistoryResult = { + __typename?: 'ProposalRevisionHistoryResult'; + revisions: Array; + /** This is the total number of revisions for the proposal, regardless of the size of the returned list. */ + totalCount: Scalars['Int']['output']; +}; + +export type ProposalRevisionResult = NotFoundError | ProposalRevision; + +export type ProposalRoles = { + __typename?: 'ProposalRoles'; + create: UserPermission; + edit: UserPermission; +}; + +export enum ProposalStatus { + APPROVED = 'APPROVED', + CLOSED = 'CLOSED', + DRAFT = 'DRAFT', + IMPLEMENTED = 'IMPLEMENTED', + OPEN = 'OPEN' +} + +export type ProposalVariantCreationErrors = { + __typename?: 'ProposalVariantCreationErrors'; + /** A list of all errors that occurred when attempting to create a proposal variant. */ + errorMessages: Array; +}; + +export type ProposalVariantCreationResult = GraphVariant | ProposalVariantCreationErrors; + +/** Filtering options for graph connections. */ +export type ProposalVariantsFilter = { + /** Only include proposals that were created with these variants as a base. */ + sourceVariants?: InputMaybe>; + /** Only include proposals of a certain status. */ + status?: InputMaybe>; + /** Only include proposals that have updated these subgraph names */ + subgraphs?: InputMaybe>; +}; + +/** Proposal variants, limited & offset based on Service.proposalVariants & the total count */ +export type ProposalVariantsResult = { + __typename?: 'ProposalVariantsResult'; + /** The total number of proposal variants on this graph */ + totalCount: Scalars['Int']['output']; + variants: Array; +}; + +export type ProposalsCheckTask = CheckWorkflowTask & { + __typename?: 'ProposalsCheckTask'; + completedAt?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** The results of this proposal check were overridden */ + didOverrideProposalsCheckTask: Scalars['Boolean']['output']; + /** Diff items in this Check task. Will be empty list if hasExceededMaxDiffs is true. */ + diffs: Array; + graphID: Scalars['ID']['output']; + /** Indicates if the number of diffs in this check has exceeded the maximum allowed. null if this check was run before this field was added. */ + hasExceededMaxDiffs?: Maybe; + id: Scalars['ID']['output']; + /** Indicates the level of coverage a check's changeset is in approved Proposals. PENDING while Check is still running. */ + proposalCoverage: ProposalCoverage; + /** Proposals with their state at the time the check was run associated to this check task. */ + relatedProposalResults: Array; + /** @deprecated use relatedProposalResults instead */ + relatedProposals: Array; + /** The configured severity at the time the check was run. If the check failed, this is the severity that should be shown. While this Check is PENDING defaults to Service's severityLevel. */ + severityLevel: ProposalChangeMismatchSeverity; + status: CheckWorkflowTaskStatus; + targetURL?: Maybe; + workflow: CheckWorkflow; +}; + +/** A diff item in this Check Task and their related Proposals. */ +export type ProposalsCheckTaskDiff = { + __typename?: 'ProposalsCheckTaskDiff'; + /** A diff item in this Check Task. */ + diffItem: FlatDiffItem; + /** If this diff item is associated with an approved Proposal. */ + hasApprovedProposal: Scalars['Boolean']['output']; + /** Proposals associated with this diff. */ + relatedProposalResults: Array; + /** The subgraph this diff belongs to. */ + subgraph: Scalars['String']['output']; +}; + +/** Filtering options for list of proposals. */ +export type ProposalsFilterInput = { + /** Only include proposals that were created with these variants as a base. */ + sourceVariants?: InputMaybe>; + /** Only include proposals of a certain status. */ + status?: InputMaybe>; + /** Only include proposals that have updated these subgraph names */ + subgraphs?: InputMaybe>; +}; + +export type ProposalsMustBeApprovedByADefaultReviewerResult = PermissionError | Service | ValidationError; + +/** Proposals, limited & offset based on Service.proposals & the total count */ +export type ProposalsResult = { + __typename?: 'ProposalsResult'; + /** The proposals on this graph. */ + proposals: Array; + /** The total number of proposals on this graph */ + totalCount: Scalars['Int']['output']; +}; + +export type ProposedBuildInputChanges = ProposedCompositionBuildInputChanges | ProposedFilterBuildInputChanges; + +export type ProposedCompositionBuildInputChanges = { + __typename?: 'ProposedCompositionBuildInputChanges'; + /** The proposed new build pipeline track, or null if no such change was proposed. */ + buildPipelineTrackChange?: Maybe; + /** Any proposed upserts to subgraphs, or the empty list if no such changes were proposed. */ + subgraphUpserts: Array; +}; + +export type ProposedCompositionBuildInputSubgraphUpsert = { + __typename?: 'ProposedCompositionBuildInputSubgraphUpsert'; + /** The name of the subgraph changed in this subgraph upsert. */ + name: Scalars['String']['output']; + /** The SHA-256 of the schema document in this subgraph upsert. */ + schemaHash?: Maybe; +}; + +export type ProposedFilterBuildInputChanges = { + __typename?: 'ProposedFilterBuildInputChanges'; + /** The proposed new build pipeline track, or null if no such change was proposed. */ + buildPipelineTrackChange?: Maybe; + /** Any proposed additions to exclude filters, or the empty list if no such changes were proposed. */ + excludeAdditions: Array; + /** Any proposed removals to exclude filters, or the empty list if no such changes were proposed. */ + excludeRemovals: Array; + /** The proposed value for whether to hide unreachable schema elements, or null if no such change was proposed. */ + hideUnreachableTypesChange?: Maybe; + /** Any proposed additions to include filters, or the empty list if no such changes were proposed. */ + includeAdditions: Array; + /** Any proposed removals to include filters, or the empty list if no such changes were proposed. */ + includeRemovals: Array; + /** The proposed new build pipeline track, or null if no such change was proposed. */ + supergraphSchemaHashChange?: Maybe; +}; + +export type Protobuf = { + __typename?: 'Protobuf'; + json: Scalars['String']['output']; + object: Scalars['Object']['output']; + raw: Scalars['Blob']['output']; + text: Scalars['String']['output']; +}; + +/** The result of a successful call to PersistedQueryListMutation.publishOperations. */ +export type PublishOperationsResult = { + __typename?: 'PublishOperationsResult'; + /** The build created by this publish operation. */ + build: PersistedQueryListBuild; + /** Returns `true` if no changes were made by this publish (and no new revision was created). Otherwise, returns `false`. */ + unchanged: Scalars['Boolean']['output']; +}; + +/** The result/error union returned by PersistedQueryListMutation.publishOperations. */ +export type PublishOperationsResultOrError = CannotModifyOperationBodyError | PermissionError | PublishOperationsResult; + +export type PublishProposalSubgraphResult = NotFoundError | PermissionError | Proposal | SchemaValidationError | ValidationError; + +export type PublishProposalSubgraphsInput = { + gitContext?: InputMaybe; + /** Non null if this publish is a merge revision. The composition id of the source variant updated to. This is necessary to keep track of the last composition id this proposal is updated with. */ + mergeUpdateCompositionId?: InputMaybe; + previousLaunchId: Scalars['ID']['input']; + revision: Scalars['String']['input']; + subgraphInputs: Array; + summary: Scalars['String']['input']; +}; + +/** The result attempting to publish subgraphs with async build. */ +export type PublishSubgraphsAsyncBuildResult = { + __typename?: 'PublishSubgraphsAsyncBuildResult'; + /** The Launch result part of this subgraph publish. */ + launch?: Maybe; + /** Human-readable text describing the launch result of the subgraph publish. */ + launchCliCopy?: Maybe; + /** The URL of the Studio page for this update's associated launch, if available. */ + launchUrl?: Maybe; +}; + +export type PublishSubgraphsSubgraphInput = { + activePartialSchema: PartialSchemaInput; + name: Scalars['String']['input']; + url?: InputMaybe; +}; + +export type PushMarketoLeadInput = { + /** Clearbit enriched LinkedIn URL */ + Clearbit_LinkedIn_URL__c?: InputMaybe; + /** Company domain */ + Company_Domain__c?: InputMaybe; + /** GDPR Explicit Opt in */ + Explicit_Opt_in__c?: InputMaybe; + /** Google Click ID */ + Google_Click_ID__c?: InputMaybe; + /** GA Client ID */ + Google_User_ID__c?: InputMaybe; + /** GraphQL Production Stage */ + GraphQL_Production_Stage__c?: InputMaybe; + /** Job Function */ + Job_Function__c?: InputMaybe; + /** Lead Message */ + Lead_Message__c?: InputMaybe; + /** Lead Source Detail */ + Lead_Source_Detail__c?: InputMaybe; + /** Lead Source Most Recent Detail */ + Lead_Source_Most_Recent_Detail__c?: InputMaybe; + /** Lead Source Most Recent */ + Lead_Source_Most_Recent__c?: InputMaybe; + /** Referrer */ + Referrer__c?: InputMaybe; + /** Studio Organization ID */ + Studio_Organization_ID__c?: InputMaybe; + /** Studio User Id */ + Studio_User_Id__c?: InputMaybe; + /** UTM Campaign First Touch */ + UTM_Campaign_First_Touch__c?: InputMaybe; + /** UTM Campaign */ + UTM_Campaign__c?: InputMaybe; + /** UTM ICID */ + UTM_ICID__c?: InputMaybe; + /** UTM Medium First Touch */ + UTM_Medium_First_Touch__c?: InputMaybe; + /** UTM Medium */ + UTM_Medium__c?: InputMaybe; + /** UTM Source First Touch */ + UTM_Source_First_Touch__c?: InputMaybe; + /** UTM Source */ + UTM_Source__c?: InputMaybe; + /** UTM Term */ + UTM_Term__c?: InputMaybe; + /** Company name */ + company?: InputMaybe; + /** Country */ + country?: InputMaybe; + /** Email address */ + email?: InputMaybe; + /** First name */ + firstName?: InputMaybe; + /** Is Graph Champion */ + isGraphChampion?: InputMaybe; + /** Last name */ + lastName?: InputMaybe; + /** Notes Import */ + notesImport?: InputMaybe; + /** Phone number */ + phone?: InputMaybe; + /** UTM Campaign Capture Mkto Only */ + uTMCampaignCaptureMktoOnly?: InputMaybe; + /** UTM ICID Capture Mkto Only */ + uTMICIDCaptureMktoOnly?: InputMaybe; + /** UTM Medium Capture Mkto Only */ + uTMMediumCaptureMktoOnly?: InputMaybe; + /** UTM Source Capture Mkto Only */ + uTMSourceCaptureMktoOnly?: InputMaybe; + /** UTM Term Capture Mkto Only */ + uTMTermCaptureMktoOnly?: InputMaybe; +}; + +/** Queries defined by this subgraph */ +export type Query = { + __typename?: 'Query'; + /** Account by ID */ + account?: Maybe; + /** Retrieve account by billing provider identifier */ + accountByBillingCode?: Maybe; + /** Retrieve account by internal id */ + accountByInternalID?: Maybe; + /** Whether an account ID is available for mutation{newAccount(id:)} */ + accountIDAvailable: Scalars['Boolean']['output']; + /** All accounts */ + allAccounts?: Maybe>; + /** All accounts on team billable plans with active subscriptions */ + allActiveTeamBillingAccounts?: Maybe>; + /** All available billing plan capabilities */ + allBillingCapabilities: Array; + /** All available billing plan limits */ + allBillingLimits: Array; + /** All available plans */ + allBillingPlans: Array; + allPublicVariants?: Maybe>; + /** All auto-renewing team accounts on active annual plans */ + allRenewingNonEnterpriseAnnualAccounts?: Maybe>; + allSelfHostedCommercialRuntimeEntitlements: Array>; + /** All services */ + allServices?: Maybe>; + /** All timezones with their offsets from UTC */ + allTimezoneOffsets: Array; + /** All users */ + allUsers?: Maybe>; + billingAdmin?: Maybe; + /** Retrieves all past and current subscriptions for an account, even if the account has been deleted */ + billingSubscriptionHistory: Array>; + billingTier?: Maybe; + /** If this is true, the user is an Apollo administrator who can ignore restrictions based purely on billing plan. */ + canBypassPlanRestrictions: Scalars['Boolean']['output']; + /** Cloud queries */ + cloud: Cloud; + cloudTesting: CloudTesting; + /** Escaped JSON string of the public key used for verifying entitlement JWTs */ + commercialRuntimePublicKey: Scalars['String']['output']; + diffSchemas: Array; + /** Get the unsubscribe settings for a given email. */ + emailPreferences?: Maybe; + /** Past and current enterprise trial accounts */ + enterpriseTrialAccounts?: Maybe>; + /** Returns the root URL of the Apollo Studio frontend. */ + frontendUrlRoot: Scalars['String']['output']; + /** Returns details of the graph with the provided ID. */ + graph?: Maybe; + internalActiveCronJobs: Array; + internalAdminUsers?: Maybe>; + internalUnresolvedCronExecutionFailures: Array; + /** Returns details of the authenticated `User` or `Graph` executing this query. If this is an unauthenticated query (i.e., no API key is provided), this field returns null. */ + me?: Maybe; + odysseyCertification?: Maybe; + /** Returns the [operation collection](https://www.apollographql.com/docs/studio/explorer/operation-collections/) for the provided ID. */ + operationCollection: OperationCollectionResult; + operationCollectionEntries: Array; + /** Returns details of the Studio organization with the provided ID. */ + organization?: Maybe; + /** Look up a plan by ID */ + plan?: Maybe; + proposal?: Maybe; + /** A list of public variants that have been selected to be shown on our Graph Directory. */ + publiclyListedVariants?: Maybe>; + /** Accounts with enterprise subscriptions that have expired in the past 45 days */ + recentlyExpiredEnterpriseAccounts?: Maybe>; + /** Search all accounts */ + searchAccounts: Array; + /** Service by ID */ + service?: Maybe; + /** Accounts with enterprise subscriptions that will expire within the next 30 days */ + soonToExpireEnterpriseAccounts?: Maybe>; + sso: SsoQuery; + /** Query statistics across all services. For admins only; normal users must go through AccountsStatsWindow or ServiceStatsWindow. */ + stats: StatsWindow; + /** Get the studio settings for the current user */ + studioSettings?: Maybe; + /** Schema transformation for the Apollo platform API. Renames types. Internal to Apollo. */ + transformSchemaForPlatformApi?: Maybe; + /** Returns details of the Apollo user with the provided ID. */ + user?: Maybe; + /** Returns details of the Apollo users with the provided IDs. */ + users?: Maybe>; + /** Returns details of a Studio graph variant with the provided graph ref. A graph ref has the format `graphID@variantName` (or just `graphID` for the default variant `current`). Returns null if the graph or variant doesn't exist, or if the graph isn't accessible by the current actor. */ + variant?: Maybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryAccountArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryAccountByBillingCodeArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryAccountByInternalIdArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryAccountIdAvailableArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryAllAccountsArgs = { + search?: InputMaybe; + tier?: InputMaybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryAllServicesArgs = { + search?: InputMaybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryAllUsersArgs = { + search?: InputMaybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryBillingSubscriptionHistoryArgs = { + id?: InputMaybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryBillingTierArgs = { + tier: BillingPlanTier; +}; + + +/** Queries defined by this subgraph */ +export type QueryDiffSchemasArgs = { + baseSchema: Scalars['String']['input']; + nextSchema: Scalars['String']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryEmailPreferencesArgs = { + email: Scalars['String']['input']; + token: Scalars['String']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryGraphArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryOdysseyCertificationArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryOperationCollectionArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryOperationCollectionEntriesArgs = { + collectionEntryIds: Array; +}; + + +/** Queries defined by this subgraph */ +export type QueryOrganizationArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryPlanArgs = { + id?: InputMaybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryProposalArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QuerySearchAccountsArgs = { + search?: InputMaybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryServiceArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryStatsArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** Queries defined by this subgraph */ +export type QueryTransformSchemaForPlatformApiArgs = { + baseSchema: Scalars['GraphQLDocument']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryUserArgs = { + id: Scalars['ID']['input']; +}; + + +/** Queries defined by this subgraph */ +export type QueryUsersArgs = { + ids: Array; +}; + + +/** Queries defined by this subgraph */ +export type QueryVariantArgs = { + ref: Scalars['ID']['input']; +}; + +/** query documents to validate against */ +export type QueryDocumentInput = { + document?: InputMaybe; +}; + +export type QueryPlan = { + __typename?: 'QueryPlan'; + json: Scalars['String']['output']; + object: Scalars['Object']['output']; + text: Scalars['String']['output']; +}; + +/** Columns of QueryStats. */ +export enum QueryStatsColumn { + ACCOUNT_ID = 'ACCOUNT_ID', + CACHED_HISTOGRAM = 'CACHED_HISTOGRAM', + CACHED_REQUESTS_COUNT = 'CACHED_REQUESTS_COUNT', + CACHE_TTL_HISTOGRAM = 'CACHE_TTL_HISTOGRAM', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + FORBIDDEN_OPERATION_COUNT = 'FORBIDDEN_OPERATION_COUNT', + FROM_ENGINEPROXY = 'FROM_ENGINEPROXY', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + PERSISTED_QUERY_ID = 'PERSISTED_QUERY_ID', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REGISTERED_OPERATION_COUNT = 'REGISTERED_OPERATION_COUNT', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + UNCACHED_HISTOGRAM = 'UNCACHED_HISTOGRAM', + UNCACHED_REQUESTS_COUNT = 'UNCACHED_REQUESTS_COUNT' +} + +export type QueryStatsDimensions = { + __typename?: 'QueryStatsDimensions'; + accountId?: Maybe; + clientName?: Maybe; + clientVersion?: Maybe; + fromEngineproxy?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + persistedQueryId?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + querySignature?: Maybe; + querySignatureLength?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; +}; + +/** Filter for data in QueryStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type QueryStatsFilter = { + /** Selects rows whose accountId dimension equals the given value if not null. To query for the null value, use {in: {accountId: [null]}} instead. */ + accountId?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose fromEngineproxy dimension equals the given value if not null. To query for the null value, use {in: {fromEngineproxy: [null]}} instead. */ + fromEngineproxy?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose persistedQueryId dimension equals the given value if not null. To query for the null value, use {in: {persistedQueryId: [null]}} instead. */ + persistedQueryId?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; +}; + +/** Filter for data in QueryStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type QueryStatsFilterIn = { + /** Selects rows whose accountId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + accountId?: InputMaybe>>; + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose fromEngineproxy dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fromEngineproxy?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose persistedQueryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + persistedQueryId?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; +}; + +export type QueryStatsMetrics = { + __typename?: 'QueryStatsMetrics'; + cacheTtlHistogram: DurationHistogram; + cachedHistogram: DurationHistogram; + cachedRequestsCount: Scalars['Long']['output']; + forbiddenOperationCount: Scalars['Long']['output']; + registeredOperationCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; + totalLatencyHistogram: DurationHistogram; + totalRequestCount: Scalars['Long']['output']; + uncachedHistogram: DurationHistogram; + uncachedRequestsCount: Scalars['Long']['output']; +}; + +export type QueryStatsOrderBySpec = { + column: QueryStatsColumn; + direction: Ordering; +}; + +export type QueryStatsRecord = { + __typename?: 'QueryStatsRecord'; + /** Dimensions of QueryStats that can be grouped by. */ + groupBy: QueryStatsDimensions; + /** Metrics of QueryStats that can be aggregated over. */ + metrics: QueryStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Query Trigger */ +export type QueryTrigger = ChannelSubscription & { + __typename?: 'QueryTrigger'; + channels: Array; + comparisonOperator: ComparisonOperator; + enabled: Scalars['Boolean']['output']; + excludedOperationNames: Array; + id: Scalars['ID']['output']; + metric: QueryTriggerMetric; + operationNames: Array; + percentile?: Maybe; + scope: QueryTriggerScope; + serviceId: Scalars['String']['output']; + state: QueryTriggerState; + threshold: Scalars['Float']['output']; + variant?: Maybe; + window: QueryTriggerWindow; +}; + +/** Query trigger */ +export type QueryTriggerInput = { + channelIds?: InputMaybe>; + comparisonOperator: ComparisonOperator; + enabled?: InputMaybe; + excludedOperationNames?: InputMaybe>; + metric: QueryTriggerMetric; + operationNames?: InputMaybe>; + percentile?: InputMaybe; + scope?: InputMaybe; + threshold: Scalars['Float']['input']; + variant?: InputMaybe; + window: QueryTriggerWindow; +}; + +export enum QueryTriggerMetric { + /** Number of requests within the window that resulted in an error. Ignores `percentile`. */ + ERROR_COUNT = 'ERROR_COUNT', + /** Number of error requests divided by total number of requests. Ignores `percentile`. */ + ERROR_PERCENTAGE = 'ERROR_PERCENTAGE', + /** Number of requests within the window. Ignores `percentile`. */ + REQUEST_COUNT = 'REQUEST_COUNT', + /** Request latency in ms. Requires `percentile`. */ + REQUEST_SERVICE_TIME = 'REQUEST_SERVICE_TIME' +} + +export enum QueryTriggerScope { + ALL = 'ALL', + ANY = 'ANY', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +/** Query trigger state */ +export type QueryTriggerState = { + __typename?: 'QueryTriggerState'; + evaluatedAt: Scalars['Timestamp']['output']; + lastTriggeredAt?: Maybe; + operations: Array; + triggered: Scalars['Boolean']['output']; +}; + +export type QueryTriggerStateOperation = { + __typename?: 'QueryTriggerStateOperation'; + count: Scalars['Long']['output']; + operation: Scalars['String']['output']; + triggered: Scalars['Boolean']['output']; + value: Scalars['Float']['output']; +}; + +export enum QueryTriggerWindow { + FIFTEEN_MINUTES = 'FIFTEEN_MINUTES', + FIVE_MINUTES = 'FIVE_MINUTES', + ONE_MINUTE = 'ONE_MINUTE', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +/** Result of calling a test request to a custom check endpoint. */ +export type QueueTestCustomChecksRequestResult = GraphVariant | PermissionError | ValidationError; + +export type QueueTestProposalLifecycleNotificationError = { + __typename?: 'QueueTestProposalLifecycleNotificationError'; + message: Scalars['String']['output']; +}; + +export type QueueTestProposalLifecycleNotificationInput = { + channelId: Scalars['ID']['input']; + subscriptionId: Scalars['ID']['input']; +}; + +export type QueueTestProposalLifecycleNotificationResult = NotFoundError | PermissionError | QueueTestProposalLifecycleNotificationError | QueueTestProposalLifecycleNotificationSuccess | ValidationError; + +export type QueueTestProposalLifecycleNotificationSuccess = { + __typename?: 'QueueTestProposalLifecycleNotificationSuccess'; + queued?: Maybe; +}; + +export type RateLimit = { + __typename?: 'RateLimit'; + count: Scalars['Long']['output']; + durationMs: Scalars['Long']['output']; +}; + +/** An error that occurs when the rate limit on this operation has been exceeded. */ +export type RateLimitExceededError = { + __typename?: 'RateLimitExceededError'; + /** The error message. */ + message: Scalars['String']['output']; +}; + +export type ReRunCheckForRevisionInput = { + revisionId: Scalars['ID']['input']; +}; + +export type ReRunCheckForRevisionResult = NotFoundError | PermissionError | Proposal | ValidationError; + +/** The README documentation for a graph variant, which is displayed in Studio. */ +export type Readme = { + __typename?: 'Readme'; + /** The contents of the README in plaintext. */ + content: Scalars['String']['output']; + /** The README's unique ID. `a15177c0-b003-4837-952a-dbfe76062eb1` for the default README */ + id: Scalars['ID']['output']; + /** + * The timestamp when the README was most recently updated. `1970-01-01T00:00:00Z` for the default README + * @deprecated Deprecated in favour of lastUpdatedTime + */ + lastUpdatedAt: Scalars['Timestamp']['output']; + /** The actor that most recently updated the README (usually a `User`). `null` for the default README, or if the `User` was deleted. */ + lastUpdatedBy?: Maybe; + /** The timestamp when the README was most recently updated. `null` for the default README */ + lastUpdatedTime?: Maybe; +}; + +/** Responsibility for an errored order */ +export enum ReasonCause { + /** + * Could not complete an order due to internal reason + * + * This could be due to intermittent issues, bug in our code, etc. + */ + INTERNAL = 'INTERNAL', + /** + * Could not complete an order due to invalid User input + * + * For example, the user provided an invalid router configuration or supergraph schema. + */ + USER = 'USER' +} + +export type RebaseConflict = { + __typename?: 'RebaseConflict'; + location?: Maybe; + message?: Maybe; +}; + +export type RebaseConflictData = { + __typename?: 'RebaseConflictData'; + conflicts: Array; + count: Scalars['Int']['output']; +}; + +export type RebaseConflictResult = NotFoundError | RebaseConflictData | SchemaValidationError; + +export type RecentPage = { + __typename?: 'RecentPage'; + timestamp: Scalars['Timestamp']['output']; + url: Scalars['String']['output']; +}; + +/** Details of account data stored in Recurly */ +export type RecurlyAccountDetails = { + __typename?: 'RecurlyAccountDetails'; + accountCode: Scalars['String']['output']; + createdAt: Scalars['Timestamp']['output']; +}; + +/** Description for a Cloud Router region */ +export type RegionDescription = { + __typename?: 'RegionDescription'; + /** Region identifier */ + code: Scalars['String']['output']; + /** Country of the region, in ISO 3166-1 alpha-2 code */ + country: Scalars['String']['output']; + /** Full name of the region */ + name: Scalars['String']['output']; + /** Cloud Provider related to this region */ + provider: CloudProvider; + /** State of the Region */ + state: RegionState; +}; + +/** Possible state of a region */ +export enum RegionState { + /** + * Active region + * + * Can be used for Cloud Routers + */ + ACTIVE = 'ACTIVE', + /** Does not appear in the API */ + HIDDEN = 'HIDDEN', + /** + * Inactive region + * + * Cannot yet be used for Cloud Routers + */ + INACTIVE = 'INACTIVE' +} + +export type RegisterOperationsMutationResponse = { + __typename?: 'RegisterOperationsMutationResponse'; + invalidOperations?: Maybe>; + newOperations?: Maybe>; + registrationSuccess: Scalars['Boolean']['output']; +}; + +export type RegisteredClientIdentityInput = { + identifier: Scalars['String']['input']; + name: Scalars['String']['input']; + version?: InputMaybe; +}; + +export type RegisteredOperation = { + __typename?: 'RegisteredOperation'; + signature: Scalars['ID']['output']; +}; + +export type RegisteredOperationInput = { + document?: InputMaybe; + metadata?: InputMaybe; + signature: Scalars['ID']['input']; +}; + +export type RegisteredOperationMetadataInput = { + /** This will be used to link existing records in Engine to a new ID. */ + engineSignature?: InputMaybe; +}; + +export type RegistryStatsWindow = { + __typename?: 'RegistryStatsWindow'; + schemaCheckStats: Array; + schemaPublishStats: Array; +}; + +export type RegistrySubscription = ChannelSubscription & { + __typename?: 'RegistrySubscription'; + channel?: Maybe; + /** @deprecated Use channels list instead */ + channels: Array; + createdAt: Scalars['Timestamp']['output']; + enabled: Scalars['Boolean']['output']; + id: Scalars['ID']['output']; + lastUpdatedAt: Scalars['Timestamp']['output']; + options: SubscriptionOptions; + variant?: Maybe; +}; + +/** A Proposal related to a Proposal Check Task. */ +export type RelatedProposalResult = { + __typename?: 'RelatedProposalResult'; + /** The latest revision at the time the check was run, defaults to current revision if nothing found for time of the check. */ + latestRevisionAtCheck: ProposalRevision; + /** The Proposal related to the check. State may have changed since the Check was run. */ + proposal: Proposal; + /** The status of the Proposal at the time the check was run, defaults to current state if nothing found for time of the check. */ + statusAtCheck: ProposalStatus; +}; + +export type RelaunchComplete = { + __typename?: 'RelaunchComplete'; + latestLaunch: Launch; + updated: Scalars['Boolean']['output']; +}; + +export type RelaunchError = { + __typename?: 'RelaunchError'; + message: Scalars['String']['output']; +}; + +export type RelaunchResult = RelaunchComplete | RelaunchError; + +export type RemoveOperationCollectionEntryResult = OperationCollection | PermissionError; + +export type RemoveOperationCollectionFromVariantResult = GraphVariant | NotFoundError | PermissionError | ValidationError; + +export type ReorderOperationCollectionResult = OperationCollection | PermissionError; + +export type ReplaceReviewersWithDefaultReviewersResult = PermissionError | Proposal | ValidationError; + +export type ReplyChangeProposalComment = ChangeProposalComment & ProposalComment & { + __typename?: 'ReplyChangeProposalComment'; + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + /** true if the schemaCoordinate this comment is on doesn't exist in the diff between the most recent revision & the base sdl */ + outdated: Scalars['Boolean']['output']; + schemaCoordinate: Scalars['String']['output']; + /** '#@!api!@#' for api schema, '#@!supergraph!@#' for supergraph schema, subgraph otherwise */ + schemaScope: Scalars['String']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export type ReplyGeneralProposalComment = GeneralProposalComment & ProposalComment & { + __typename?: 'ReplyGeneralProposalComment'; + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export type ReportSchemaError = ReportSchemaResult & { + __typename?: 'ReportSchemaError'; + code: ReportSchemaErrorCode; + inSeconds: Scalars['Int']['output']; + message: Scalars['String']['output']; + withCoreSchema: Scalars['Boolean']['output']; +}; + +export enum ReportSchemaErrorCode { + BOOT_ID_IS_NOT_VALID_UUID = 'BOOT_ID_IS_NOT_VALID_UUID', + BOOT_ID_IS_REQUIRED = 'BOOT_ID_IS_REQUIRED', + CORE_SCHEMA_HASH_IS_NOT_SCHEMA_SHA256 = 'CORE_SCHEMA_HASH_IS_NOT_SCHEMA_SHA256', + CORE_SCHEMA_HASH_IS_REQUIRED = 'CORE_SCHEMA_HASH_IS_REQUIRED', + CORE_SCHEMA_HASH_IS_TOO_LONG = 'CORE_SCHEMA_HASH_IS_TOO_LONG', + EXECUTABLE_SCHEMA_ID_IS_NOT_SCHEMA_SHA256 = 'EXECUTABLE_SCHEMA_ID_IS_NOT_SCHEMA_SHA256', + EXECUTABLE_SCHEMA_ID_IS_REQUIRED = 'EXECUTABLE_SCHEMA_ID_IS_REQUIRED', + EXECUTABLE_SCHEMA_ID_IS_TOO_LONG = 'EXECUTABLE_SCHEMA_ID_IS_TOO_LONG', + GRAPH_REF_INVALID_FORMAT = 'GRAPH_REF_INVALID_FORMAT', + GRAPH_REF_IS_REQUIRED = 'GRAPH_REF_IS_REQUIRED', + GRAPH_VARIANT_DOES_NOT_MATCH_REGEX = 'GRAPH_VARIANT_DOES_NOT_MATCH_REGEX', + GRAPH_VARIANT_IS_REQUIRED = 'GRAPH_VARIANT_IS_REQUIRED', + LIBRARY_VERSION_IS_TOO_LONG = 'LIBRARY_VERSION_IS_TOO_LONG', + PLATFORM_IS_TOO_LONG = 'PLATFORM_IS_TOO_LONG', + RUNTIME_VERSION_IS_TOO_LONG = 'RUNTIME_VERSION_IS_TOO_LONG', + SCHEMA_IS_NOT_PARSABLE = 'SCHEMA_IS_NOT_PARSABLE', + SCHEMA_IS_NOT_VALID = 'SCHEMA_IS_NOT_VALID', + SERVER_ID_IS_TOO_LONG = 'SERVER_ID_IS_TOO_LONG', + USER_VERSION_IS_TOO_LONG = 'USER_VERSION_IS_TOO_LONG' +} + +export type ReportSchemaResponse = ReportSchemaResult & { + __typename?: 'ReportSchemaResponse'; + inSeconds: Scalars['Int']['output']; + withCoreSchema: Scalars['Boolean']['output']; +}; + +export type ReportSchemaResult = { + inSeconds: Scalars['Int']['output']; + withCoreSchema: Scalars['Boolean']['output']; +}; + +export type ReportServerInfoError = ReportServerInfoResult & { + __typename?: 'ReportServerInfoError'; + code: ReportSchemaErrorCode; + inSeconds: Scalars['Int']['output']; + message: Scalars['String']['output']; + withExecutableSchema: Scalars['Boolean']['output']; +}; + +export type ReportServerInfoResponse = ReportServerInfoResult & { + __typename?: 'ReportServerInfoResponse'; + inSeconds: Scalars['Int']['output']; + withExecutableSchema: Scalars['Boolean']['output']; +}; + +export type ReportServerInfoResult = { + inSeconds: Scalars['Int']['output']; + withExecutableSchema: Scalars['Boolean']['output']; +}; + +export type RequestCountsPerGraphVariant = { + __typename?: 'RequestCountsPerGraphVariant'; + cachedRequestsCount: Scalars['Long']['output']; + graphID: Scalars['String']['output']; + uncachedRequestsCount: Scalars['Long']['output']; + variant?: Maybe; +}; + +export type RerunAsyncInput = { + sourceVariant?: InputMaybe; +}; + +export enum Resolution { + R1D = 'R1D', + R1H = 'R1H', + R1M = 'R1M', + R5M = 'R5M', + R6H = 'R6H', + R15M = 'R15M' +} + +export enum ResponseHints { + NONE = 'NONE', + SAMPLE_RESPONSES = 'SAMPLE_RESPONSES', + SUBGRAPHS = 'SUBGRAPHS', + TIMINGS = 'TIMINGS', + TRACE_TIMINGS = 'TRACE_TIMINGS' +} + +export enum ReviewDecision { + APPROVED = 'APPROVED', + NOT_APPROVED = 'NOT_APPROVED' +} + +export type ReviewProposalComment = ProposalComment & { + __typename?: 'ReviewProposalComment'; + createdAt: Scalars['Timestamp']['output']; + /** null if the user is deleted */ + createdBy?: Maybe; + id: Scalars['ID']['output']; + message: Scalars['String']['output']; + status: CommentStatus; + /** null if never updated */ + updatedAt?: Maybe; +}; + +export type RoleOverride = { + __typename?: 'RoleOverride'; + /** @deprecated RoleOverride can only be queried via a Graph, so any fields here should instead be selected via the parent object. */ + graph: Service; + lastUpdatedAt: Scalars['Timestamp']['output']; + role: UserPermission; + user: User; +}; + +export type Router = { + __typename?: 'Router'; + /** Capabilities for this Cloud Router */ + capabilities?: Maybe; + /** Constants for Cloud Routers */ + constants: CloudConstants; + /** Date when the Cloud Router was created */ + createdAt: Scalars['NaiveDateTime']['output']; + /** Order currently modifying this Cloud Router */ + currentOrder?: Maybe; + /** + * Custom URLs that can be used to reach the Cloud Router + * + * This will be null if the Cloud Router is in a deleted status or does not support custom + * domains. + * @deprecated use Router.endpoints instead + */ + customDomains?: Maybe>; + /** Set of endpoints that can be used to reach a Cloud Router */ + endpoints: RouterEndpoints; + /** + * Number of Graph Compute Units (GCUs) associated with this Cloud Router + * + * This value is not present for Cloud Routers on the `SERVERLESS` tier. + */ + gcus?: Maybe; + /** Return the GraphVariant associated with this Router */ + graphVariant?: Maybe; + /** graphRef representing the Cloud Router */ + id: Scalars['ID']['output']; + /** Internal identifier for a Cloud Router */ + internalId?: Maybe; + /** + * Cloud Router version applied for the next launch + * + * If this value is not null, any subsequent launch will use this version instead of the + * current one. This can happen when a new STABLE version is available, but we could not + * automatically update this Cloud Router, for example due to configuration issues. + */ + nextRouterVersion?: Maybe; + /** + * The next scheduled router status, useful for telling when a router will be transitioning in + * the near future to another staus. If no change in status is scheduled, this field will be + * null + */ + nextStatus?: Maybe; + /** Retrieves a specific Order related to this Cloud Router */ + order?: Maybe; + /** Retrieves all Orders related to this Cloud Router */ + orders: Array; + /** + * URL where the Cloud Router can be found + * + * This will be null if the Cloud Router is in a deleted status + * @deprecated use Router.endpoints instead + */ + routerUrl?: Maybe; + /** + * Current version of the Cloud Router + * + * This will be null if the Cloud Router is in a deleted status. + */ + routerVersion?: Maybe; + /** Return the list of secrets for this Cloud Router with their hash values */ + secrets: Array; + /** Shard associated with this Cloud Router */ + shard?: Maybe; + /** Current status of the Cloud Router */ + status: RouterStatus; + /** + * Last time when the Cloud Router was updated + * + * If the Cloud Router was never updated, this value will be null + */ + updatedAt?: Maybe; +}; + + +export type RouterOrderArgs = { + orderId: Scalars['ID']['input']; +}; + + +export type RouterOrdersArgs = { + first?: InputMaybe; + offset?: InputMaybe; +}; + +export type RouterAdminMutation = { + __typename?: 'RouterAdminMutation'; + /** Pre-create a custom domain for this Cloud Router, but don't enable routing yet */ + preCreateCustomDomain: RouterPreCreateDomainResult; + /** Override the lastTraffic for Serverless Cloud Routers */ + setLastTraffic: RouterSetLastTrafficResult; + /** Update the Cloud Router state so it will display a `nextStatus` value */ + setNextStatus: RouterSetNextStatusResult; + /** Sleep this Cloud Router */ + sleep: RouterSleepResult; + /** Wake up this Cloud Router */ + wakeUp: RouterWakeUpResult; +}; + + +export type RouterAdminMutationPreCreateCustomDomainArgs = { + customDomain: Scalars['String']['input']; +}; + + +export type RouterAdminMutationSetLastTrafficArgs = { + lastTraffic: Scalars['NaiveDateTime']['input']; +}; + + +export type RouterAdminMutationSetNextStatusArgs = { + nextStatus: RouterStatus; +}; + +/** Capabilities for this Cloud Router */ +export type RouterCapabilities = { + __typename?: 'RouterCapabilities'; + /** This Cloud Router can router traffic from custom domains */ + customDomains: Scalars['Boolean']['output']; + /** This Cloud Router supports using a custom path */ + customPath: Scalars['Boolean']['output']; + /** This Cloud Router supports getting and settings GCUs */ + gcus: Scalars['Boolean']['output']; + /** This Cloud Router can use private subgraphs */ + privateSubgraphs: Scalars['Boolean']['output']; +}; + +/** Router configuration input */ +export type RouterConfigInput = { + /** + * Number of GCUs allocated for the Cloud Router + * + * This is ignored for serverless Cloud Routers + */ + gcus?: InputMaybe; + /** Graph composition ID, also known as launch ID */ + graphCompositionId?: InputMaybe; + /** Configuration for the Cloud Router */ + routerConfig?: InputMaybe; + /** Router version for the Cloud Router */ + routerVersion?: InputMaybe; +}; + +export type RouterConfigVersion = { + __typename?: 'RouterConfigVersion'; + /** JSON schema for validating the router configuration */ + configSchema?: Maybe; + /** Name of the RouterConfigVersion */ + name: Scalars['String']['output']; +}; + +/** Input to create a RouterConfigVersion */ +export type RouterConfigVersionInput = { + /** Configuration schema mapping for the RouterConfigVersion */ + configSchema: Scalars['String']['input']; + /** Name of the RouterConfigVersion */ + configVersion: Scalars['String']['input']; +}; + +/** + * List of endpoints for Cloud Router + * + * ## Endpoint states + * + * If a Router is in the `DELETED` state, all the fields on this object will return `null`. + * + * For all other states, this table list all the possible valid states, and the mutations that can + * be performed on them. + * + * | Default Enabled? | Primary Endpoint | Custom Endpoints | Allowed endpoint mutations | + * | Yes | Default | null | N/A (this Router does not support custom endpoints) | + * | Yes | Default | [] | addCustomDomain, enableDefaultEndpoint, resetPrimaryEndpoint | + * | Yes | Default | ["1", "2", "3"] | addCustomDomain, enableDefaultEndpoint, removeCustomDomain("1", "2", or "3"), resetPrimaryEndpoint, setPrimaryEndpoint ("1", "2", or "3") | + * | Yes | Custom 1 | ["1", "2", "3"] | addCustomDomain, disableDefaultEndpoint, enableDefaultEndpoint, removeCustomDomain("2" or "3"), resetPrimaryEndpoint, setPrimaryEndpoint ("1", "2", or "3") | + * | No | Custom 1 | ["1", "2", "3"] | addCustomDomain, disableDefaultEndpoint, enableDefaultEndpoint, removeCustomDomain("2" or "3"), setPrimaryEndpoint ("1", "2", or "3") | + */ +export type RouterEndpoints = { + __typename?: 'RouterEndpoints'; + /** + * Set of custom Cloud Router endpoints + * + * This is null if the cloud router is in a deleted state, or if it does not support + * custom endpoints. + */ + custom?: Maybe>; + /** + * Default Cloud Router endpoint + * + * This is null if the cloud router is in a deleted state. + */ + default?: Maybe; + /** + * Whether the default Cloud Router endpoint is enabled + * + * If the default endpoint is not enabled (`false`), this Cloud Router cannot receive traffic + * on the default endpoint. + * + * This is null if the cloud router is in a deleted state. + */ + defaultEnabled?: Maybe; + /** + * Primary Cloud Router endpoint + * + * This is null if the cloud router is in a deleted state. + */ + primary?: Maybe; +}; + +/** Represents the possible outcomes of an endpoint mutation */ +export type RouterEndpointsResult = InternalServerError | InvalidInputErrors | RouterEndpointsSuccess; + +/** Successe branch of an addEndpoint or removeEndpoint mutation */ +export type RouterEndpointsSuccess = { + __typename?: 'RouterEndpointsSuccess'; + endpoints: RouterEndpoints; +}; + +export type RouterEntitlement = { + __typename?: 'RouterEntitlement'; + /** The id of the account this license was generated for. */ + accountId: Scalars['String']['output']; + /** Which audiences this license applies to. */ + audience: Array; + /** Router will stop serving requests after this time if commercial features are in use. */ + haltAt?: Maybe; + /** RFC 8037 Ed25519 JWT signed representation of sibling fields. Restricted to internal services only. */ + jwt: Scalars['String']['output']; + /** Organization this license applies to. */ + subject: Scalars['String']['output']; + throughputLimit?: Maybe; + /** Router will warn users after this time if commercial features are in use. */ + warnAt?: Maybe; +}; + +export enum RouterEntitlementAudience { + /** Routers in Apollo hosted cloud. */ + CLOUD = 'CLOUD', + /** Routers in offline environments with license files supplied from a URL or locally. */ + OFFLINE = 'OFFLINE', + /** Routers in self-hosted environments fetching their license from uplink. */ + SELF_HOSTED = 'SELF_HOSTED' +} + +/** Represents the possible outcomes of a setGcus mutation */ +export type RouterGcusResult = InternalServerError | InvalidInputErrors | RouterGcusSuccess; + +/** Success branch of a setGcus mutation */ +export type RouterGcusSuccess = { + __typename?: 'RouterGcusSuccess'; + order: Order; +}; + +export type RouterMutation = { + __typename?: 'RouterMutation'; + /** Add a custom domain for this Cloud Router */ + addCustomDomain: RouterEndpointsResult; + /** Admin mutations for this Router */ + admin: RouterAdminMutation; + /** + * Disable the default endpoint + * + * This mutation will only work if the Router is not in a DELETED state and the default + * endpoint is not the primary endpoint. + */ + disableDefaultEndpoint: RouterEndpointsResult; + /** + * Enable the default endpoint + * + * This mutation will only work if the Router is not in a DELETED state + */ + enableDefaultEndpoint: RouterEndpointsResult; + /** Remove a custom domain for this Cloud Router */ + removeCustomDomain: RouterEndpointsResult; + /** + * Reset the primary endpoint to the default endpoint + * + * This mutation will only work if the Router is not in a DELETED state, and the default + * endpoint is enabled. + */ + resetPrimaryEndpoint: RouterEndpointsResult; + /** Set a custom path for this Router */ + setCustomPath: RouterPathResult; + /** Set the number of GCUs associated with this Router */ + setGcus: RouterGcusResult; + /** Set the version used for the next update for this Cloud Router */ + setNextVersion: SetNextVersionResult; + /** + * Set the primary endpoint to a custom endpoint + * + * This mutation will only work if the Router is not in a DELETED state, and the primary + * endpoint correspond to the full endpoint name (e.g. `https://api.mycompany.com/graphql`) of + * an existing custom endpoint. + */ + setPrimaryEndpoint: RouterEndpointsResult; + /** Set secrets for this Cloud Router */ + setSecrets: RouterSecretsResult; + /** + * Sleep this Cloud Router + * @deprecated use Router.admin.sleep instead + */ + sleep: RouterSleepResult; +}; + + +export type RouterMutationAddCustomDomainArgs = { + customDomain: Scalars['String']['input']; +}; + + +export type RouterMutationRemoveCustomDomainArgs = { + customDomain: Scalars['String']['input']; +}; + + +export type RouterMutationSetCustomPathArgs = { + path: Scalars['String']['input']; +}; + + +export type RouterMutationSetGcusArgs = { + gcus: Scalars['Int']['input']; +}; + + +export type RouterMutationSetNextVersionArgs = { + version: Scalars['String']['input']; +}; + + +export type RouterMutationSetPrimaryEndpointArgs = { + endpoint: Scalars['String']['input']; +}; + + +export type RouterMutationSetSecretsArgs = { + input: RouterSecretsInput; +}; + +/** Represents the possible outcomes of a setCustomPath mutation */ +export type RouterPathResult = InternalServerError | InvalidInputErrors | RouterPathSuccess; + +/** Success branch of a setCustomPath mutation */ +export type RouterPathSuccess = { + __typename?: 'RouterPathSuccess'; + endpoints: RouterEndpoints; + order: Order; +}; + +/** "Represents the possible outcomes of a ", RouterPreCreateDomain, " mutation" */ +export type RouterPreCreateDomainResult = InternalServerError | InvalidInputErrors | RouterPreCreateDomainSuccess; + +/** Success branch of a preCreateCustomDomain mutation */ +export type RouterPreCreateDomainSuccess = { + __typename?: 'RouterPreCreateDomainSuccess'; + success: Scalars['Boolean']['output']; +}; + +/** User input for a RouterSecrets mutation */ +export type RouterSecretsInput = { + /** Secrets to create or update */ + secrets?: InputMaybe>; + /** Secrets to remove */ + unsetSecrets?: InputMaybe>; +}; + +/** Represents the possible outcomes of a RouterSecrets mutation */ +export type RouterSecretsResult = InternalServerError | InvalidInputErrors | RouterSecretsSuccess; + +/** Success branch of a RouterSecrets mutation. */ +export type RouterSecretsSuccess = { + __typename?: 'RouterSecretsSuccess'; + order: Order; + secrets: Array; +}; + +/** "Represents the possible outcomes of a ", RouterSetLastTraffic, " mutation" */ +export type RouterSetLastTrafficResult = InternalServerError | InvalidInputErrors | RouterSetLastTrafficSuccess; + +/** Success branch of a setLastTraffic mutation */ +export type RouterSetLastTrafficSuccess = { + __typename?: 'RouterSetLastTrafficSuccess'; + success: Scalars['Boolean']['output']; +}; + +/** "Represents the possible outcomes of a ", RouterSetNextStatus, " mutation" */ +export type RouterSetNextStatusResult = InternalServerError | InvalidInputErrors | RouterSetNextStatusSuccess; + +/** Success branch of a setNextStatus mutation */ +export type RouterSetNextStatusSuccess = { + __typename?: 'RouterSetNextStatusSuccess'; + success: Scalars['Boolean']['output']; +}; + +/** "Represents the possible outcomes of a ", RouterSleep, " mutation" */ +export type RouterSleepResult = InternalServerError | InvalidInputErrors | RouterSleepSuccess; + +/** Success branch of a sleep mutation */ +export type RouterSleepSuccess = { + __typename?: 'RouterSleepSuccess'; + success: Scalars['Boolean']['output']; +}; + +/** Current status of Cloud Routers */ +export enum RouterStatus { + /** Cloud Router is not yet provisioned */ + CREATING = 'CREATING', + /** Router has been deleted */ + DELETED = 'DELETED', + /** + * Cloud Router is running, but currently being deleted + * + * This is the only mutation state that doesn't support rollback. If we fail to + * delete a Router, the workflows are configured to stop and keep the router into + * the Deleting status. + */ + DELETING = 'DELETING', + /** + * Current order is rolling back to the last known good state + * + * After a RollingBack state, a Router can move either into Running state (from a + * Update order) or Deleted (from a Create order). + * + * If we fail to roll back, the workflows are configured to stop and keep the router + * into the RollingBack status. + */ + ROLLING_BACK = 'ROLLING_BACK', + /** Current router is running and able to server requests */ + RUNNING = 'RUNNING', + /** Router has been put to sleep. This state should only be possible for Serverless routers */ + SLEEPING = 'SLEEPING', + /** Cloud Router is running, but currently being updated */ + UPDATING = 'UPDATING' +} + +export type RouterUpsertFailure = { + __typename?: 'RouterUpsertFailure'; + message: Scalars['String']['output']; +}; + +/** A generic key→count type so that router usage metrics can be added to without modifying the `trackRouterUsage` mutation */ +export type RouterUsageInput = { + count: Scalars['Int']['input']; + key: Scalars['String']['input']; +}; + +/** Router Version */ +export type RouterVersion = { + __typename?: 'RouterVersion'; + /** Build number */ + build: Scalars['String']['output']; + /** JSON schema for validating the router configuration for this router version */ + configSchema: Scalars['String']['output']; + /** Config version for this router version */ + configVersion: Scalars['String']['output']; + /** Core version identifier */ + core: Scalars['String']['output']; + /** Latest supported BuildPipelineTrack for this version */ + latestSupportedPipelineTrack?: Maybe; + /** Status of a router version */ + status: Status; + /** Version identifier */ + version: Scalars['String']['output']; +}; + +export type RouterVersionBuild = { + __typename?: 'RouterVersionBuild'; + jobId: Scalars['String']['output']; + routerVersion?: Maybe; + status: RouterVersionBuildStatus; +}; + +export type RouterVersionBuildError = { + __typename?: 'RouterVersionBuildError'; + jobId: Scalars['String']['output']; + routerVersion?: Maybe; +}; + +export type RouterVersionBuildPageResults = { + __typename?: 'RouterVersionBuildPageResults'; + count: Scalars['Int']['output']; + cursor?: Maybe; + results: Array; +}; + +export type RouterVersionBuildResult = RouterVersionBuild | RouterVersionBuildError; + +export enum RouterVersionBuildStatus { + BUILDING = 'BUILDING', + CANCELLED = 'CANCELLED', + COMPLETE = 'COMPLETE', + PENDING = 'PENDING' +} + +export enum RouterVersionBuildsField { + CREATED_AT = 'CREATED_AT' +} + +export type RouterVersionBuildsInput = { + orderBy?: InputMaybe; + pagination?: InputMaybe; +}; + +export type RouterVersionBuildsOrderByInput = { + direction: OrderingDirection; + field: RouterVersionBuildsField; +}; + +/** Result of a RouterConfigVersion mutation */ +export type RouterVersionConfigResult = CloudInvalidInputError | InternalServerError | RouterConfigVersion; + +/** Input to create a new router version */ +export type RouterVersionCreateInput = { + /** Version of the configuration */ + configVersion: Scalars['String']['input']; + /** Latest supported BuildPipelineTrack for this version */ + latestSupportedPipelineTrack: Scalars['String']['input']; + /** Version status */ + status: Status; + /** Version identifier */ + version: Scalars['String']['input']; +}; + +/** Result of a router version query */ +export type RouterVersionResult = InternalServerError | InvalidInputErrors | RouterVersion; + +/** Input for updating a router version */ +export type RouterVersionUpdateInput = { + /** Version of the configuration */ + configVersion?: InputMaybe; + /** Latest supported BuildPipelineTrack for this version */ + latestSupportedPipelineTrack?: InputMaybe; + /** Version status */ + status?: InputMaybe; + /** Version identifier */ + version: Scalars['String']['input']; +}; + +/** List of router versions */ +export type RouterVersions = { + __typename?: 'RouterVersions'; + versions: Array; +}; + +/** Input for filtering router versions */ +export type RouterVersionsInput = { + /** Name of the branch */ + branch?: InputMaybe; + /** Maximum number of versions to return */ + limit?: InputMaybe; + /** Status of the version */ + status?: InputMaybe; +}; + +/** Result of a router versions query */ +export type RouterVersionsResult = InternalServerError | InvalidInputErrors | RouterVersions; + +/** "Represents the possible outcomes of a ", RouterWakeUp, " mutation" */ +export type RouterWakeUpResult = InternalServerError | InvalidInputErrors | RouterWakeUpSuccess; + +/** Success branch of a wakeUp mutation */ +export type RouterWakeUpSuccess = { + __typename?: 'RouterWakeUpSuccess'; + success: Scalars['Boolean']['output']; +}; + +export type RoverArgumentInput = { + key: Scalars['String']['input']; + value?: InputMaybe; +}; + +export type RuleEnforcement = { + __typename?: 'RuleEnforcement'; + /** The instant this enforcement was created. */ + createdAt: Scalars['Timestamp']['output']; + /** Identifying info for the creator of this enforcement. */ + createdBy: Scalars['String']['output']; + /** The instant this enforcement was deleted. */ + deletedAt?: Maybe; + /** The identifier for the graph this this enforcement applies to. */ + graphId: Scalars['String']['output']; + /** The name of the variant that this enforcement applies to. */ + graphVariant?: Maybe; + /** The ID of this enforcement. */ + id: Scalars['ID']['output']; + /** A list of key/value pairs representing any parameters necessary for the policy's enforcement. */ + params?: Maybe>; + /** The policy that this enforcement belongs to. */ + policy: EnforcementPolicy; + /** The instant this enforcement was last updated. */ + updatedAt: Scalars['Timestamp']['output']; +}; + +export type RuleEnforcementError = { + __typename?: 'RuleEnforcementError'; + message: Scalars['String']['output']; +}; + +export type RuleEnforcementResult = RuleEnforcement | RuleEnforcementError; + +export type RunLintCheckInput = { + baseSchema: SchemaHashInput; + checkStep: CheckStepInput; + proposedSchema: SchemaHashInput; +}; + +/** Inputs needed to find all relevant proposals to a check workflow */ +export type RunProposalsCheckInput = { + /** List of subgraph names and hashes from the state of this variant when the check was run. */ + baseSubgraphs: Array; + /** Supergraph hash that was most recently published when the check was run */ + baseSupergraphHash: Scalars['String']['input']; + /** List of subgraph names and hashes that are being proposed in the check task */ + proposedSubgraphs: Array; + /** Supergraph hash that is the output of the check's composition task */ + proposedSupergraphHash: Scalars['String']['input']; + /** If this check was created by rerunning, the original check workflow task that was rerun */ + rerunOfTaskId?: InputMaybe; + /** The severity to assign the check results if matching proposals are not found */ + severityLevel: ProposalChangeMismatchSeverity; + /** The check workflow task id. Used by Task entities to resolve the results */ + workflowTaskId: Scalars['String']['input']; +}; + +export type SafAssessment = { + __typename?: 'SafAssessment'; + /** The date and time the assessment was completed. */ + completedAt?: Maybe; + /** The time that the assessment was deleted. */ + deletedAt?: Maybe; + /** The graph that this assessment belongs to. */ + graph: Service; + id: Scalars['ID']['output']; + /** The plan items for this assessment. */ + planItems: Array; + /** The responses for this assessment. */ + responses: Array; + /** The date and time the assessment was started. */ + startedAt: Scalars['Date']['output']; +}; + +export type SafAssessmentMutation = { + __typename?: 'SafAssessmentMutation'; + /** Delete the assessment. */ + delete: SafAssessment; + id: Scalars['String']['output']; + /** Mutations for a specific plan item. */ + planItem?: Maybe; + /** Reorder the plan items for a given assessment. */ + reorderPlanItems: Array; + /** Save a response for a question. */ + saveResponse: SafResponse; + /** Submit the assessment. */ + submit: SafAssessment; +}; + + +export type SafAssessmentMutationPlanItemArgs = { + id: Scalars['ID']['input']; +}; + + +export type SafAssessmentMutationReorderPlanItemsArgs = { + ids: Array; +}; + + +export type SafAssessmentMutationSaveResponseArgs = { + input: SafResponseInput; +}; + + +export type SafAssessmentMutationSubmitArgs = { + organizationId?: InputMaybe; + planItemIds: Array; +}; + +export type SafPlanItem = { + __typename?: 'SafPlanItem'; + bestPracticeId: Scalars['String']['output']; + id: Scalars['ID']['output']; + isDeprioritized: Scalars['Boolean']['output']; + notes: Scalars['String']['output']; + order: Scalars['Int']['output']; +}; + +export type SafPlanItemInput = { + isDeprioritized: Scalars['Boolean']['input']; + notes: Scalars['String']['input']; + order: Scalars['Int']['input']; +}; + +export type SafPlanItemMutation = { + __typename?: 'SafPlanItemMutation'; + /** Update a plan item. */ + update: SafPlanItem; +}; + + +export type SafPlanItemMutationUpdateArgs = { + input: SafPlanItemInput; +}; + +export type SafResponse = { + __typename?: 'SafResponse'; + /** The assessment that this response belongs to. */ + assessment?: Maybe; + /** Additional context or feedback about the question. */ + comment: Scalars['String']['output']; + id: Scalars['ID']['output']; + /** The ID of the question that this response is for. */ + questionId: Scalars['String']['output']; + /** A list of responses for this question. */ + response: Array; +}; + +export type SafResponseInput = { + comment: Scalars['String']['input']; + questionId: Scalars['String']['input']; + response: Array; +}; + +export type SamlCertInfo = { + __typename?: 'SamlCertInfo'; + id: Scalars['ID']['output']; + notAfter: Scalars['Timestamp']['output']; + notBefore: Scalars['Timestamp']['output']; + pem: Scalars['String']['output']; + subjectDN: Scalars['String']['output']; +}; + +export type SamlConfigurationInput = { + encryptionCerts?: InputMaybe>; + entityId: Scalars['String']['input']; + ssoUrl: Scalars['String']['input']; + verificationCerts: Array; + wantsSignedRequests?: InputMaybe; +}; + +export type SamlConnection = SsoConnection & { + __typename?: 'SamlConnection'; + domains: Array; + id: Scalars['ID']['output']; + idpId: Scalars['ID']['output']; + metadata: SamlIdpMetadata; + scim?: Maybe; + /** @deprecated Use stateV2 instead */ + state: SsoConnectionState; + stateV2: SsoConnectionStateV2; +}; + +export type SamlConnectionMutation = { + __typename?: 'SamlConnectionMutation'; + addEncryptionCert?: Maybe; + addVerificationCert?: Maybe; + updateIdpId?: Maybe; +}; + + +export type SamlConnectionMutationAddEncryptionCertArgs = { + pem: Scalars['String']['input']; +}; + + +export type SamlConnectionMutationAddVerificationCertArgs = { + pem: Scalars['String']['input']; +}; + + +export type SamlConnectionMutationUpdateIdpIdArgs = { + idpId: Scalars['String']['input']; +}; + +export type SamlIdpMetadata = { + __typename?: 'SamlIdpMetadata'; + encryptionCerts: Array; + entityId: Scalars['String']['output']; + ssoUrl: Scalars['String']['output']; + verificationCerts: Array; + wantsSignedRequests: Scalars['Boolean']['output']; +}; + +export type ScheduledSummary = ChannelSubscription & { + __typename?: 'ScheduledSummary'; + /** @deprecated Use channels list instead */ + channel?: Maybe; + channels: Array; + enabled: Scalars['Boolean']['output']; + id: Scalars['ID']['output']; + timezone: Scalars['String']['output']; + variant: Scalars['String']['output']; +}; + +/** A GraphQL schema document and associated metadata. */ +export type Schema = { + __typename?: 'Schema'; + createTemporaryURL?: Maybe; + /** The timestamp of initial ingestion of a schema to a graph. */ + createdAt: Scalars['Timestamp']['output']; + /** The GraphQL schema document. */ + document: Scalars['GraphQLDocument']['output']; + /** The number of fields; this includes user defined fields only, excluding built-in types and fields */ + fieldCount: Scalars['Int']['output']; + gitContext?: Maybe; + /** The GraphQL schema document's SHA256 hash, represented as a hexadecimal string. */ + hash: Scalars['ID']['output']; + introspection: IntrospectionSchema; + /** + * The list of schema coordinates ('TypeName.fieldName') in the schema + * that can be measured by usage reporting. + * Currently only supports object types and interface types. + */ + observableCoordinates?: Maybe>; + /** The number of types; this includes user defined types only, excluding built-in types */ + typeCount: Scalars['Int']['output']; +}; + + +/** A GraphQL schema document and associated metadata. */ +export type SchemaCreateTemporaryUrlArgs = { + expiresInSeconds?: Scalars['Int']['input']; +}; + +/** An error that occurred while running schema composition on a set of subgraph schemas. */ +export type SchemaCompositionError = { + __typename?: 'SchemaCompositionError'; + /** A machine-readable error code. */ + code?: Maybe; + /** Source locations related to the error. */ + locations: Array>; + /** A human-readable message describing the error. */ + message: Scalars['String']['output']; +}; + +export type SchemaCoordinate = { + __typename?: 'SchemaCoordinate'; + /** The printed coordinate value, e.g. 'ParentType.fieldName' */ + coordinate: Scalars['String']['output']; + id: Scalars['ID']['output']; + /** Whether the coordinate being referred to is marked as deprecated */ + isDeprecated: Scalars['Boolean']['output']; +}; + +export type SchemaCoordinateFilterInput = { + /** + * If true, only include deprecated coordinates. + * If false, filter out deprecated coordinates. + */ + deprecated?: InputMaybe; +}; + +/** The result of computing the difference between two schemas, usually as part of schema checks. */ +export type SchemaDiff = { + __typename?: 'SchemaDiff'; + /** + * Clients affected by all changes in the diff. + * @deprecated Unsupported. + */ + affectedClients?: Maybe>; + /** Operations affected by all changes in the diff. */ + affectedQueries?: Maybe>; + /** Numeric summaries for each type of change in the diff. */ + changeSummary: ChangeSummary; + /** A list of all schema changes in the diff, including their severity. */ + changes: Array; + /** The number of GraphQL operations affected by the diff's changes that are neither marked as safe nor ignored. */ + numberOfAffectedOperations: Scalars['Int']['output']; + /** The number of GraphQL operations that were validated during the check. */ + numberOfCheckedOperations?: Maybe; + /** Indicates the overall safety of the changes included in the diff, based on operation history (e.g., `FAILURE` or `NOTICE`). */ + severity: ChangeSeverity; + /** The tag against which this diff was created */ + tag?: Maybe; + /** @deprecated use severity instead */ + type: ChangeType; + /** Configuration of validation */ + validationConfig?: Maybe; +}; + +export type SchemaDiffValidationConfig = { + __typename?: 'SchemaDiffValidationConfig'; + /** Clients to ignore during validation. */ + excludedClients?: Maybe>; + /** Operation names to ignore during validation. */ + excludedOperationNames?: Maybe>>; + /** + * delta in seconds from current time that determines the start of the window + * for reported metrics included in a schema diff. A day window from the present + * day would have a `from` value of -86400. In rare cases, this could be an ISO + * timestamp if the user passed one in on diff creation + */ + from?: Maybe; + /** Operation IDs to ignore during validation. */ + ignoredOperations?: Maybe>; + /** Variants to include during validation. */ + includedVariants?: Maybe>; + /** Minimum number of requests within the window for a query to be considered. */ + queryCountThreshold?: Maybe; + /** + * Number of requests within the window for a query to be considered, relative to + * total request count. Expected values are between 0 and 0.05 (minimum 5% of + * total request volume) + */ + queryCountThresholdPercentage?: Maybe; + /** + * delta in seconds from current time that determines the end of the + * window for reported metrics included in a schema diff. A day window + * from the present day would have a `to` value of -0. In rare + * cases, this could be an ISO timestamp if the user passed one in on diff + * creation + */ + to?: Maybe; +}; + +export type SchemaHashInput = { + /** If provided fetches build messages that are added to linter results. */ + buildID?: InputMaybe; + /** SHA256 of the schema sdl. */ + hash: Scalars['String']['input']; + subgraphs?: InputMaybe>; +}; + +export type SchemaPublishSubscription = ChannelSubscription & { + __typename?: 'SchemaPublishSubscription'; + channels: Array; + createdAt: Scalars['Timestamp']['output']; + enabled: Scalars['Boolean']['output']; + id: Scalars['ID']['output']; + lastUpdatedAt: Scalars['Timestamp']['output']; + variant?: Maybe; +}; + +export type SchemaReport = { + /** A randomly generated UUID, immutable for the lifetime of the edge server runtime. */ + bootId: Scalars['String']['input']; + /** The hex SHA256 hash of the schema being reported. Note that for a GraphQL server with a core schema, this should be the core schema, not the API schema. */ + coreSchemaHash: Scalars['String']['input']; + /** The graph ref (eg, 'id@variant') */ + graphRef: Scalars['String']['input']; + /** The version of the edge server reporting agent, e.g. apollo-server-2.8, graphql-java-3.1, etc. length must be <= 256 characters. */ + libraryVersion?: InputMaybe; + /** The infra environment in which this edge server is running, e.g. localhost, Kubernetes, AWS Lambda, Google CloudRun, AWS ECS, etc. length must be <= 256 characters. */ + platform?: InputMaybe; + /** The runtime in which the edge server is running, e.g. node 12.03, zulu8.46.0.19-ca-jdk8.0.252-macosx_x64, etc. length must be <= 256 characters. */ + runtimeVersion?: InputMaybe; + /** If available, an identifier for the edge server instance, such that when restarting this instance it will have the same serverId, with a different bootId. For example, in Kubernetes this might be the pod name. Length must be <= 256 characters. */ + serverId?: InputMaybe; + /** An identifier used to distinguish the version (from the user's perspective) of the edge server's code itself. For instance, the git sha of the server's repository or the docker sha of the associated image this server runs with. Length must be <= 256 characters. */ + userVersion?: InputMaybe; +}; + +/** Contains details for an individual publication of an individual graph variant. */ +export type SchemaTag = { + __typename?: 'SchemaTag'; + /** The result of federated composition executed for this publication. This result includes either a supergraph schema or error details, depending on whether composition succeeded. This value is null when the publication is for a non-federated graph. */ + compositionResult?: Maybe; + createdAt: Scalars['Timestamp']['output']; + /** A schema diff comparing against the schema from the most recent previous successful publication. */ + diffToPrevious?: Maybe; + gitContext?: Maybe; + /** + * List of previously uploaded SchemaTags under the same tag name, starting with + * the selected published schema record. Sorted in reverse chronological order + * by creation date (newest publish first). + * + * Note: This does not include the history of checked schemas + */ + history: Array; + /** + * Number of tagged schemas created under the same tag name. + * Also represents the maximum size of the history's limit argument. + */ + historyLength: Scalars['Int']['output']; + /** + * Number of schemas tagged prior to this one under the same tag name, its position + * in the tag history. + */ + historyOrder: Scalars['Int']['output']; + /** The identifier for this specific publication. */ + id: Scalars['ID']['output']; + /** + * The launch for this publication. This value is non-null for contract variants, and sometimes null + * for composition variants (specifically for older publications). This value is null for other + * variants. + */ + launch?: Maybe; + /** The timestamp when the variant was published to. */ + publishedAt: Scalars['Timestamp']['output']; + /** + * The Identity that published this schema and their client info, or null if this isn't + * a publish. Sub-fields may be null if they weren't recorded. + */ + publishedBy?: Maybe; + /** The schema that was published to the variant. */ + schema: Schema; + slackNotificationBody?: Maybe; + /** @deprecated Please use variant { name } instead */ + tag: Scalars['String']['output']; + /** The variant that was published to." */ + variant: GraphVariant; + webhookNotificationBody: Scalars['String']['output']; +}; + + +/** Contains details for an individual publication of an individual graph variant. */ +export type SchemaTagHistoryArgs = { + includeUnchanged?: Scalars['Boolean']['input']; + limit?: Scalars['Int']['input']; + offset?: InputMaybe; + orderBy?: InputMaybe; +}; + + +/** Contains details for an individual publication of an individual graph variant. */ +export type SchemaTagHistoryLengthArgs = { + includeUnchanged?: Scalars['Boolean']['input']; +}; + + +/** Contains details for an individual publication of an individual graph variant. */ +export type SchemaTagSlackNotificationBodyArgs = { + graphDisplayName: Scalars['String']['input']; +}; + +export enum SchemaTagHistoryOrder { + CREATED_ASC = 'CREATED_ASC', + CREATED_DESC = 'CREATED_DESC' +} + +/** An error that occurs when an invalid schema is passed in as user input */ +export type SchemaValidationError = Error & { + __typename?: 'SchemaValidationError'; + issues: Array; + /** The error's details. */ + message: Scalars['String']['output']; +}; + +/** An error that occurs when an invalid schema is passed in as user input */ +export type SchemaValidationIssue = { + __typename?: 'SchemaValidationIssue'; + message: Scalars['String']['output']; +}; + +/** How many seats of the given types does an organization have (regardless of plan type)? */ +export type Seats = { + __typename?: 'Seats'; + /** How many members that are free in this organization. */ + free: Scalars['Int']['output']; + /** How many members that are not free in this organization. */ + fullPrice: Scalars['Int']['output']; +}; + +/** Cloud Router secret */ +export type Secret = { + __typename?: 'Secret'; + /** When the secret was created */ + createdAt: Scalars['DateTime']['output']; + /** Hash of the secret */ + hash: Scalars['String']['output']; + /** Name of the secret */ + name: Scalars['String']['output']; +}; + +/** Input for creating or updating secrets */ +export type SecretInput = { + /** Name of the secret */ + name: Scalars['String']['input']; + /** + * Value for that secret + * + * This can only be used for input, as it is not possible to retrieve the value of secrets. + */ + value: Scalars['String']['input']; +}; + +export type SemanticChange = { + __typename?: 'SemanticChange'; + /** Target arg of change made. */ + argNode?: Maybe; + /** + * Node related to the top level node that was changed, such as a field in an object, + * a value in an enum or the object of an interface + */ + childNode?: Maybe; + /** Semantic metadata about the type of change */ + definition: ChangeDefinition; + /** Top level node affected by the change */ + parentNode?: Maybe; + /** Short description of the change */ + shortDescription?: Maybe; +}; + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type Service = Identity & { + __typename?: 'Service'; + /** The organization that this graph belongs to. */ + account?: Maybe; + accountId?: Maybe; + /** The `GraphVariant` types of all proposal variants. This is a potentially expensive field to query. */ + allProposalVariants: Array; + /** A list of the graph API keys that are active for this graph. */ + apiKeys?: Maybe>; + /** Provides a view of the graph as an `Actor` type. */ + asActor: Actor; + /** + * Get an URL to which an avatar image can be uploaded. Client uploads by sending a PUT request + * with the image data to MediaUploadInfo.url. Client SHOULD set the "Content-Type" header to the + * browser-inferred MIME type, and SHOULD set the "x-apollo-content-filename" header to the + * filename, if such information is available. Client MUST set the "x-apollo-csrf-token" header to + * MediaUploadInfo.csrfToken. + */ + avatarUpload?: Maybe; + /** + * Get an image URL for the service's avatar. Note that CORS is not enabled for these URLs. The size + * argument is used for bandwidth reduction, and should be the size of the image as displayed in the + * application. Apollo's media server will downscale larger images to at least the requested size, + * but this will not happen for third-party media servers. + */ + avatarUrl?: Maybe; + /** Get available notification endpoints */ + channels?: Maybe>; + /** Get check configuration for this graph. */ + checkConfiguration?: Maybe; + /** Get a check workflow for this graph by its ID */ + checkWorkflow?: Maybe; + /** Get a check workflow task for this graph by its ID */ + checkWorkflowTask?: Maybe; + /** Get check workflows for this graph ordered by creation time, most recent first. */ + checkWorkflows: Array; + /** + * List of options available for filtering checks for this graph by git committer. + * If a filter is passed, constrains results to match the filter. + * For cli triggered checks, this is the author. + * @deprecated Use checksCommitterOptions instead + */ + checksAuthorOptions: Array; + /** + * List of options available for filtering checks for this graph by branch. + * If a filter is passed, constrains results to match the filter. + */ + checksBranchOptions: Array; + /** + * List of options available for filtering checks for this graph by git committer. + * If a filter is passed, constrains results to match the filter. + * For cli triggered checks, this is the author. + */ + checksCommitterOptions: Array; + /** + * List of options available for filtering checks for this graph by created by field. + * If a filter is passed, constrains results to match the filter. + * For non cli triggered checks, this is the Studio User / author. + */ + checksCreatedByOptions: Array; + /** + * List of options available for filtering checks for this graph by subgraph name. + * If a filter is passed, constrains results to match the filter. + */ + checksSubgraphOptions: Array; + /** Get a composition build check result for this graph by its ID */ + compositionBuildCheckResult?: Maybe; + /** Given a graphCompositionID, return the results of composition. This can represent either a validation or a publish. */ + compositionResultById?: Maybe; + createdAt: Scalars['Timestamp']['output']; + createdBy?: Maybe; + /** Custom check configuration for this graph. */ + customCheckConfiguration?: Maybe; + datadogMetricsConfig?: Maybe; + defaultBuildPipelineTrack?: Maybe; + /** The time the default build pipeline track version was updated. */ + defaultBuildPipelineTrackUpdatedAt?: Maybe; + defaultProposalReviewers: Array>; + deletedAt?: Maybe; + description?: Maybe; + /** @deprecated No longer supported */ + devGraphOwner?: Maybe; + /** Get a GraphQL document by hash */ + doc?: Maybe; + /** Get GraphQL documents by hash, max up to 100 can be requested per query */ + docs?: Maybe>>; + /** + * Get a GraphQL document by hash + * @deprecated Use doc instead + */ + document?: Maybe; + flatDiff: FlatDiffResult; + /** The capabilities that are supported for this graph */ + graphCapabilities: GraphCapabilities; + graphType: GraphType; + /** + * When this is true, this graph will be hidden from non-admin members of the org who haven't been explicitly assigned a + * role on this graph. + */ + hiddenFromUninvitedNonAdminAccountMembers: Scalars['Boolean']['output']; + /** The graph's globally unique identifier. */ + id: Scalars['ID']['output']; + /** List of ignored rule violations for the linter */ + ignoredLinterViolations: Array; + /** + * List of subgraphs that comprise a graph. A non-federated graph should have a single implementing service. + * Set includeDeleted to see deleted subgraphs. + */ + implementingServices?: Maybe; + lastReportedAt?: Maybe; + /** Linter configuration for this graph. */ + linterConfiguration: GraphLinterConfiguration; + /** Current identity, null if not authenticated. */ + me?: Maybe; + minProposalApprovers: Scalars['Int']['output']; + minProposalRoles: ProposalRoles; + /** The composition result that was most recently published to a graph variant. */ + mostRecentCompositionPublish?: Maybe; + /** Permissions of the current user in this graph. */ + myRole?: Maybe; + name: Scalars['String']['output']; + onboardingArchitecture?: Maybe; + operation?: Maybe; + /** Get request counts by variant for operation checks */ + operationCheckRequestsByVariant: Array; + /** Gets the operations and their approved changes for this graph, checkID, and operationID. */ + operationsAcceptedChanges: Array; + /** Get an operations check result for a specific check ID */ + operationsCheck?: Maybe; + /** The Persisted Query List associated with this graph with the given ID. */ + persistedQueryList?: Maybe; + persistedQueryLists?: Maybe>; + /** A template that is the base description for new schema proposals */ + proposalDescriptionTemplate?: Maybe; + /** The current active user's Proposal notification status on this graph. */ + proposalNotificationStatus: NotificationStatus; + /** + * A list of the proposals for this graph sorted by created at date. + * limit defaults to 25 and has an allowed max of 50, offset defaults to 0 + */ + proposals: ProposalsResult; + /** If the graph setting for the proposals implementation variant has been set, this will be non null. */ + proposalsImplementationVariant?: Maybe; + /** Must one of the default reviewers approve proposals */ + proposalsMustBeApprovedByADefaultReviewer: Scalars['Boolean']['output']; + /** True if each approving reviewer's review will get dismissed & the proposal status will change from approved to open on new revisions. */ + proposalsMustBeReApprovedOnChange: Scalars['Boolean']['output']; + /** Get query triggers for a given variant. If variant is null all the triggers for this service will be gotten. */ + queryTriggers?: Maybe>; + readme?: Maybe; + /** Registry specific stats for this graph. */ + registryStatsWindow?: Maybe; + /** + * Whether registry subscriptions (with any options) are enabled. If variant is not passed, returns true if configuration is present for any variant + * @deprecated This field will be removed + */ + registrySubscriptionsEnabled: Scalars['Boolean']['output']; + reportingEnabled: Scalars['Boolean']['output']; + /** The list of members that can access this graph, accounting for graph role overrides */ + roleOverrides?: Maybe>; + /** Describes the permissions that the active user has for this graph. */ + roles?: Maybe; + ruleEnforcement?: Maybe; + /** Get a specific assessment for this graph by its ID. */ + safAssessment?: Maybe; + /** All assessments for this graph. */ + safAssessments: Array; + scheduledSummaries: Array; + /** Get a schema by hash or current tag */ + schema?: Maybe; + /** The current publish associated to a given variant (with 'tag' as the variant name). */ + schemaTag?: Maybe; + schemaTagById?: Maybe; + /** + * Get schema tags, with optional filtering to a set of tags. Always sorted by creation + * date in reverse chronological order. + */ + schemaTags?: Maybe>; + /** @deprecated use Service.statsWindow instead */ + stats: ServiceStatsWindow; + statsWindow?: Maybe; + /** Generate a test schema publish notification body */ + testSchemaPublishBody: Scalars['String']['output']; + /** The graph's name. */ + title: Scalars['String']['output']; + /** Count checkWorkflows for the given filter. Used for paginating with checkWorkflows. */ + totalCheckWorkflowCount: Scalars['Int']['output']; + trace?: Maybe; + traceStorageEnabled: Scalars['Boolean']['output']; + /** + * Provides details of the graph variant with the provided `name`, if a variant + * with that name exists for this graph. Otherwise, returns null. + * + * For a list of _all_ variants associated with a graph, use `Graph.variants` instead. + */ + variant?: Maybe; + /** A list of the variants for this graph. */ + variants: Array; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceAvatarUrlArgs = { + size?: Scalars['Int']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceChannelsArgs = { + channelIds?: InputMaybe>; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceCheckWorkflowArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceCheckWorkflowTaskArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceCheckWorkflowsArgs = { + filter?: InputMaybe; + limit?: Scalars['Int']['input']; + offset?: Scalars['Int']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceChecksAuthorOptionsArgs = { + filter?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceChecksBranchOptionsArgs = { + filter?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceChecksCommitterOptionsArgs = { + filter?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceChecksCreatedByOptionsArgs = { + filter?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceChecksSubgraphOptionsArgs = { + filter?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceCompositionBuildCheckResultArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceCompositionResultByIdArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceDocArgs = { + hash?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceDocsArgs = { + hashes: Array; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceDocumentArgs = { + hash?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceFlatDiffArgs = { + newSdlHash?: InputMaybe; + oldSdlHash?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceImplementingServicesArgs = { + graphVariant: Scalars['String']['input']; + includeDeleted?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceLastReportedAtArgs = { + graphVariant?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceMostRecentCompositionPublishArgs = { + graphVariant: Scalars['String']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceOperationArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceOperationCheckRequestsByVariantArgs = { + from: Scalars['Timestamp']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceOperationsAcceptedChangesArgs = { + checkID: Scalars['ID']['input']; + operationID: Scalars['String']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceOperationsCheckArgs = { + checkID: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServicePersistedQueryListArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceProposalsArgs = { + filterBy?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceQueryTriggersArgs = { + graphVariant?: InputMaybe; + operationNames?: InputMaybe>; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceRegistryStatsWindowArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceRegistrySubscriptionsEnabledArgs = { + graphVariant?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceRuleEnforcementArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceSafAssessmentArgs = { + id: Scalars['ID']['input']; + includeDeleted?: Scalars['Boolean']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceSafAssessmentsArgs = { + includeDeleted?: Scalars['Boolean']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceSchemaArgs = { + hash?: InputMaybe; + tag?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceSchemaTagArgs = { + tag: Scalars['String']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceSchemaTagByIdArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceSchemaTagsArgs = { + tags?: InputMaybe>; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceStatsArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceStatsWindowArgs = { + from: Scalars['Timestamp']['input']; + resolution?: InputMaybe; + to?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceTestSchemaPublishBodyArgs = { + variant: Scalars['String']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceTotalCheckWorkflowCountArgs = { + filter?: InputMaybe; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceTraceArgs = { + id: Scalars['ID']['input']; +}; + + +/** + * A graph in Apollo Studio represents a graph in your organization. + * Each graph has one or more variants, which correspond to the different environments where that graph runs (such as staging and production). + * Each variant has its own GraphQL schema, which means schemas can differ between environments. + */ +export type ServiceVariantArgs = { + name: Scalars['String']['input']; +}; + +/** Columns of ServiceBillingUsageStats. */ +export enum ServiceBillingUsageStatsColumn { + AGENT_ID = 'AGENT_ID', + AGENT_VERSION = 'AGENT_VERSION', + GRAPH_DEPLOYMENT_TYPE = 'GRAPH_DEPLOYMENT_TYPE', + OPERATION_COUNT = 'OPERATION_COUNT', + OPERATION_COUNT_PROVIDED_EXPLICITLY = 'OPERATION_COUNT_PROVIDED_EXPLICITLY', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + ROUTER_FEATURES_ENABLED = 'ROUTER_FEATURES_ENABLED', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceBillingUsageStatsDimensions = { + __typename?: 'ServiceBillingUsageStatsDimensions'; + agentId?: Maybe; + agentVersion?: Maybe; + graphDeploymentType?: Maybe; + operationCountProvidedExplicitly?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + routerFeaturesEnabled?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceBillingUsageStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceBillingUsageStatsFilter = { + /** Selects rows whose agentId dimension equals the given value if not null. To query for the null value, use {in: {agentId: [null]}} instead. */ + agentId?: InputMaybe; + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose graphDeploymentType dimension equals the given value if not null. To query for the null value, use {in: {graphDeploymentType: [null]}} instead. */ + graphDeploymentType?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationCountProvidedExplicitly dimension equals the given value if not null. To query for the null value, use {in: {operationCountProvidedExplicitly: [null]}} instead. */ + operationCountProvidedExplicitly?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose routerFeaturesEnabled dimension equals the given value if not null. To query for the null value, use {in: {routerFeaturesEnabled: [null]}} instead. */ + routerFeaturesEnabled?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceBillingUsageStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceBillingUsageStatsFilterIn = { + /** Selects rows whose agentId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentId?: InputMaybe>>; + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose graphDeploymentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + graphDeploymentType?: InputMaybe>>; + /** Selects rows whose operationCountProvidedExplicitly dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationCountProvidedExplicitly?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose routerFeaturesEnabled dimension is in the given list. A null value in the list means a row with null for that dimension. */ + routerFeaturesEnabled?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceBillingUsageStatsMetrics = { + __typename?: 'ServiceBillingUsageStatsMetrics'; + operationCount: Scalars['Long']['output']; +}; + +export type ServiceBillingUsageStatsOrderBySpec = { + column: ServiceBillingUsageStatsColumn; + direction: Ordering; +}; + +export type ServiceBillingUsageStatsRecord = { + __typename?: 'ServiceBillingUsageStatsRecord'; + /** Dimensions of ServiceBillingUsageStats that can be grouped by. */ + groupBy: ServiceBillingUsageStatsDimensions; + /** Metrics of ServiceBillingUsageStats that can be aggregated over. */ + metrics: ServiceBillingUsageStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceCardinalityStats. */ +export enum ServiceCardinalityStatsColumn { + CLIENT_NAME_CARDINALITY = 'CLIENT_NAME_CARDINALITY', + CLIENT_VERSION_CARDINALITY = 'CLIENT_VERSION_CARDINALITY', + OPERATION_SHAPE_CARDINALITY = 'OPERATION_SHAPE_CARDINALITY', + SCHEMA_COORDINATE_CARDINALITY = 'SCHEMA_COORDINATE_CARDINALITY', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceCardinalityStatsDimensions = { + __typename?: 'ServiceCardinalityStatsDimensions'; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceCardinalityStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceCardinalityStatsFilter = { + and?: InputMaybe>; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceCardinalityStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceCardinalityStatsFilterIn = { + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceCardinalityStatsMetrics = { + __typename?: 'ServiceCardinalityStatsMetrics'; + clientNameCardinality: Scalars['Float']['output']; + clientVersionCardinality: Scalars['Float']['output']; + operationShapeCardinality: Scalars['Float']['output']; + schemaCoordinateCardinality: Scalars['Float']['output']; +}; + +export type ServiceCardinalityStatsOrderBySpec = { + column: ServiceCardinalityStatsColumn; + direction: Ordering; +}; + +export type ServiceCardinalityStatsRecord = { + __typename?: 'ServiceCardinalityStatsRecord'; + /** Dimensions of ServiceCardinalityStats that can be grouped by. */ + groupBy: ServiceCardinalityStatsDimensions; + /** Metrics of ServiceCardinalityStats that can be aggregated over. */ + metrics: ServiceCardinalityStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceCoordinateUsage. */ +export enum ServiceCoordinateUsageColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + KIND = 'KIND', + NAMED_ATTRIBUTE = 'NAMED_ATTRIBUTE', + NAMED_TYPE = 'NAMED_TYPE', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REQUEST_COUNT_NULL = 'REQUEST_COUNT_NULL', + REQUEST_COUNT_UNDEFINED = 'REQUEST_COUNT_UNDEFINED', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceCoordinateUsageDimensions = { + __typename?: 'ServiceCoordinateUsageDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + kind?: Maybe; + namedAttribute?: Maybe; + namedType?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceCoordinateUsage. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceCoordinateUsageFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + /** Selects rows whose kind dimension equals the given value if not null. To query for the null value, use {in: {kind: [null]}} instead. */ + kind?: InputMaybe; + /** Selects rows whose namedAttribute dimension equals the given value if not null. To query for the null value, use {in: {namedAttribute: [null]}} instead. */ + namedAttribute?: InputMaybe; + /** Selects rows whose namedType dimension equals the given value if not null. To query for the null value, use {in: {namedType: [null]}} instead. */ + namedType?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceCoordinateUsage. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceCoordinateUsageFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose kind dimension is in the given list. A null value in the list means a row with null for that dimension. */ + kind?: InputMaybe>>; + /** Selects rows whose namedAttribute dimension is in the given list. A null value in the list means a row with null for that dimension. */ + namedAttribute?: InputMaybe>>; + /** Selects rows whose namedType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + namedType?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceCoordinateUsageMetrics = { + __typename?: 'ServiceCoordinateUsageMetrics'; + estimatedExecutionCount: Scalars['Long']['output']; + executionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; + requestCountNull: Scalars['Long']['output']; + requestCountUndefined: Scalars['Long']['output']; +}; + +export type ServiceCoordinateUsageOrderBySpec = { + column: ServiceCoordinateUsageColumn; + direction: Ordering; +}; + +export type ServiceCoordinateUsageRecord = { + __typename?: 'ServiceCoordinateUsageRecord'; + /** Dimensions of ServiceCoordinateUsage that can be grouped by. */ + groupBy: ServiceCoordinateUsageDimensions; + /** Metrics of ServiceCoordinateUsage that can be aggregated over. */ + metrics: ServiceCoordinateUsageMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceEdgeServerInfos. */ +export enum ServiceEdgeServerInfosColumn { + BOOT_ID = 'BOOT_ID', + EXECUTABLE_SCHEMA_ID = 'EXECUTABLE_SCHEMA_ID', + LIBRARY_VERSION = 'LIBRARY_VERSION', + PLATFORM = 'PLATFORM', + RUNTIME_VERSION = 'RUNTIME_VERSION', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVER_ID = 'SERVER_ID', + TIMESTAMP = 'TIMESTAMP', + USER_VERSION = 'USER_VERSION' +} + +export type ServiceEdgeServerInfosDimensions = { + __typename?: 'ServiceEdgeServerInfosDimensions'; + bootId?: Maybe; + executableSchemaId?: Maybe; + libraryVersion?: Maybe; + platform?: Maybe; + runtimeVersion?: Maybe; + schemaTag?: Maybe; + serverId?: Maybe; + userVersion?: Maybe; +}; + +/** Filter for data in ServiceEdgeServerInfos. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceEdgeServerInfosFilter = { + and?: InputMaybe>; + /** Selects rows whose bootId dimension equals the given value if not null. To query for the null value, use {in: {bootId: [null]}} instead. */ + bootId?: InputMaybe; + /** Selects rows whose executableSchemaId dimension equals the given value if not null. To query for the null value, use {in: {executableSchemaId: [null]}} instead. */ + executableSchemaId?: InputMaybe; + in?: InputMaybe; + /** Selects rows whose libraryVersion dimension equals the given value if not null. To query for the null value, use {in: {libraryVersion: [null]}} instead. */ + libraryVersion?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose platform dimension equals the given value if not null. To query for the null value, use {in: {platform: [null]}} instead. */ + platform?: InputMaybe; + /** Selects rows whose runtimeVersion dimension equals the given value if not null. To query for the null value, use {in: {runtimeVersion: [null]}} instead. */ + runtimeVersion?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serverId dimension equals the given value if not null. To query for the null value, use {in: {serverId: [null]}} instead. */ + serverId?: InputMaybe; + /** Selects rows whose userVersion dimension equals the given value if not null. To query for the null value, use {in: {userVersion: [null]}} instead. */ + userVersion?: InputMaybe; +}; + +/** Filter for data in ServiceEdgeServerInfos. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceEdgeServerInfosFilterIn = { + /** Selects rows whose bootId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + bootId?: InputMaybe>>; + /** Selects rows whose executableSchemaId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + executableSchemaId?: InputMaybe>>; + /** Selects rows whose libraryVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + libraryVersion?: InputMaybe>>; + /** Selects rows whose platform dimension is in the given list. A null value in the list means a row with null for that dimension. */ + platform?: InputMaybe>>; + /** Selects rows whose runtimeVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + runtimeVersion?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serverId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serverId?: InputMaybe>>; + /** Selects rows whose userVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + userVersion?: InputMaybe>>; +}; + +export type ServiceEdgeServerInfosOrderBySpec = { + column: ServiceEdgeServerInfosColumn; + direction: Ordering; +}; + +export type ServiceEdgeServerInfosRecord = { + __typename?: 'ServiceEdgeServerInfosRecord'; + /** Dimensions of ServiceEdgeServerInfos that can be grouped by. */ + groupBy: ServiceEdgeServerInfosDimensions; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceErrorStats. */ +export enum ServiceErrorStatsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ERRORS_COUNT = 'ERRORS_COUNT', + PATH = 'PATH', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceErrorStatsDimensions = { + __typename?: 'ServiceErrorStatsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + path?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceErrorStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceErrorStatsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose path dimension equals the given value if not null. To query for the null value, use {in: {path: [null]}} instead. */ + path?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceErrorStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceErrorStatsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose path dimension is in the given list. A null value in the list means a row with null for that dimension. */ + path?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceErrorStatsMetrics = { + __typename?: 'ServiceErrorStatsMetrics'; + errorsCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; +}; + +export type ServiceErrorStatsOrderBySpec = { + column: ServiceErrorStatsColumn; + direction: Ordering; +}; + +export type ServiceErrorStatsRecord = { + __typename?: 'ServiceErrorStatsRecord'; + /** Dimensions of ServiceErrorStats that can be grouped by. */ + groupBy: ServiceErrorStatsDimensions; + /** Metrics of ServiceErrorStats that can be aggregated over. */ + metrics: ServiceErrorStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceFederatedErrorStats. */ +export enum ServiceFederatedErrorStatsColumn { + AGENT_VERSION = 'AGENT_VERSION', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ERROR_CODE = 'ERROR_CODE', + ERROR_COUNT = 'ERROR_COUNT', + ERROR_PATH = 'ERROR_PATH', + ERROR_SERVICE = 'ERROR_SERVICE', + OPERATION_ID = 'OPERATION_ID', + OPERATION_NAME = 'OPERATION_NAME', + OPERATION_TYPE = 'OPERATION_TYPE', + SCHEMA_TAG = 'SCHEMA_TAG', + SEVERITY = 'SEVERITY', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceFederatedErrorStatsDimensions = { + __typename?: 'ServiceFederatedErrorStatsDimensions'; + agentVersion?: Maybe; + clientName?: Maybe; + clientVersion?: Maybe; + errorCode?: Maybe; + errorPath?: Maybe; + errorService?: Maybe; + operationId?: Maybe; + operationName?: Maybe; + operationType?: Maybe; + schemaTag?: Maybe; + severity?: Maybe; +}; + +/** Filter for data in ServiceFederatedErrorStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceFederatedErrorStatsFilter = { + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose errorCode dimension equals the given value if not null. To query for the null value, use {in: {errorCode: [null]}} instead. */ + errorCode?: InputMaybe; + /** Selects rows whose errorPath dimension equals the given value if not null. To query for the null value, use {in: {errorPath: [null]}} instead. */ + errorPath?: InputMaybe; + /** Selects rows whose errorService dimension equals the given value if not null. To query for the null value, use {in: {errorService: [null]}} instead. */ + errorService?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationId dimension equals the given value if not null. To query for the null value, use {in: {operationId: [null]}} instead. */ + operationId?: InputMaybe; + /** Selects rows whose operationName dimension equals the given value if not null. To query for the null value, use {in: {operationName: [null]}} instead. */ + operationName?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose severity dimension equals the given value if not null. To query for the null value, use {in: {severity: [null]}} instead. */ + severity?: InputMaybe; +}; + +/** Filter for data in ServiceFederatedErrorStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceFederatedErrorStatsFilterIn = { + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose errorCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorCode?: InputMaybe>>; + /** Selects rows whose errorPath dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorPath?: InputMaybe>>; + /** Selects rows whose errorService dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorService?: InputMaybe>>; + /** Selects rows whose operationId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationId?: InputMaybe>>; + /** Selects rows whose operationName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationName?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose severity dimension is in the given list. A null value in the list means a row with null for that dimension. */ + severity?: InputMaybe>>; +}; + +export type ServiceFederatedErrorStatsMetrics = { + __typename?: 'ServiceFederatedErrorStatsMetrics'; + errorCount: Scalars['Long']['output']; +}; + +export type ServiceFederatedErrorStatsOrderBySpec = { + column: ServiceFederatedErrorStatsColumn; + direction: Ordering; +}; + +export type ServiceFederatedErrorStatsRecord = { + __typename?: 'ServiceFederatedErrorStatsRecord'; + /** Dimensions of ServiceFederatedErrorStats that can be grouped by. */ + groupBy: ServiceFederatedErrorStatsDimensions; + /** Metrics of ServiceFederatedErrorStats that can be aggregated over. */ + metrics: ServiceFederatedErrorStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceFieldExecutions. */ +export enum ServiceFieldExecutionsColumn { + ERRORS_COUNT = 'ERRORS_COUNT', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + FIELD_NAME = 'FIELD_NAME', + OBSERVED_EXECUTION_COUNT = 'OBSERVED_EXECUTION_COUNT', + PARENT_TYPE = 'PARENT_TYPE', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceFieldExecutionsDimensions = { + __typename?: 'ServiceFieldExecutionsDimensions'; + fieldName?: Maybe; + parentType?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceFieldExecutions. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceFieldExecutionsFilter = { + and?: InputMaybe>; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceFieldExecutions. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceFieldExecutionsFilterIn = { + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceFieldExecutionsMetrics = { + __typename?: 'ServiceFieldExecutionsMetrics'; + errorsCount: Scalars['Long']['output']; + estimatedExecutionCount: Scalars['Long']['output']; + observedExecutionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; +}; + +export type ServiceFieldExecutionsOrderBySpec = { + column: ServiceFieldExecutionsColumn; + direction: Ordering; +}; + +export type ServiceFieldExecutionsRecord = { + __typename?: 'ServiceFieldExecutionsRecord'; + /** Dimensions of ServiceFieldExecutions that can be grouped by. */ + groupBy: ServiceFieldExecutionsDimensions; + /** Metrics of ServiceFieldExecutions that can be aggregated over. */ + metrics: ServiceFieldExecutionsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceFieldLatencies. */ +export enum ServiceFieldLatenciesColumn { + FIELD_HISTOGRAM = 'FIELD_HISTOGRAM', + FIELD_NAME = 'FIELD_NAME', + PARENT_TYPE = 'PARENT_TYPE', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceFieldLatenciesDimensions = { + __typename?: 'ServiceFieldLatenciesDimensions'; + field?: Maybe; + fieldName?: Maybe; + parentType?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceFieldLatencies. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceFieldLatenciesFilter = { + and?: InputMaybe>; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceFieldLatencies. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceFieldLatenciesFilterIn = { + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceFieldLatenciesMetrics = { + __typename?: 'ServiceFieldLatenciesMetrics'; + fieldHistogram: DurationHistogram; +}; + +export type ServiceFieldLatenciesOrderBySpec = { + column: ServiceFieldLatenciesColumn; + direction: Ordering; +}; + +export type ServiceFieldLatenciesRecord = { + __typename?: 'ServiceFieldLatenciesRecord'; + /** Dimensions of ServiceFieldLatencies that can be grouped by. */ + groupBy: ServiceFieldLatenciesDimensions; + /** Metrics of ServiceFieldLatencies that can be aggregated over. */ + metrics: ServiceFieldLatenciesMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceFieldUsage. */ +export enum ServiceFieldUsageColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + ESTIMATED_EXECUTION_COUNT = 'ESTIMATED_EXECUTION_COUNT', + EXECUTION_COUNT = 'EXECUTION_COUNT', + FIELD_NAME = 'FIELD_NAME', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + PARENT_TYPE = 'PARENT_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REFERENCING_OPERATION_COUNT = 'REFERENCING_OPERATION_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceFieldUsageDimensions = { + __typename?: 'ServiceFieldUsageDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + fieldName?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + parentType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceFieldUsage. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceFieldUsageFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose fieldName dimension equals the given value if not null. To query for the null value, use {in: {fieldName: [null]}} instead. */ + fieldName?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose parentType dimension equals the given value if not null. To query for the null value, use {in: {parentType: [null]}} instead. */ + parentType?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceFieldUsage. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceFieldUsageFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose fieldName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fieldName?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose parentType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + parentType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceFieldUsageMetrics = { + __typename?: 'ServiceFieldUsageMetrics'; + estimatedExecutionCount: Scalars['Long']['output']; + executionCount: Scalars['Long']['output']; + referencingOperationCount: Scalars['Long']['output']; +}; + +export type ServiceFieldUsageOrderBySpec = { + column: ServiceFieldUsageColumn; + direction: Ordering; +}; + +export type ServiceFieldUsageRecord = { + __typename?: 'ServiceFieldUsageRecord'; + /** Dimensions of ServiceFieldUsage that can be grouped by. */ + groupBy: ServiceFieldUsageDimensions; + /** Metrics of ServiceFieldUsage that can be aggregated over. */ + metrics: ServiceFieldUsageMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceGraphosCloudMetrics. */ +export enum ServiceGraphosCloudMetricsColumn { + AGENT_VERSION = 'AGENT_VERSION', + CLOUD_PROVIDER = 'CLOUD_PROVIDER', + RESPONSE_SIZE = 'RESPONSE_SIZE', + RESPONSE_SIZE_THROTTLED = 'RESPONSE_SIZE_THROTTLED', + ROUTER_ID = 'ROUTER_ID', + ROUTER_OPERATIONS = 'ROUTER_OPERATIONS', + ROUTER_OPERATIONS_THROTTLED = 'ROUTER_OPERATIONS_THROTTLED', + SCHEMA_TAG = 'SCHEMA_TAG', + SUBGRAPH_FETCHES = 'SUBGRAPH_FETCHES', + SUBGRAPH_FETCHES_THROTTLED = 'SUBGRAPH_FETCHES_THROTTLED', + TIER = 'TIER', + TIMESTAMP = 'TIMESTAMP' +} + +export type ServiceGraphosCloudMetricsDimensions = { + __typename?: 'ServiceGraphosCloudMetricsDimensions'; + agentVersion?: Maybe; + cloudProvider?: Maybe; + routerId?: Maybe; + schemaTag?: Maybe; + tier?: Maybe; +}; + +/** Filter for data in ServiceGraphosCloudMetrics. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceGraphosCloudMetricsFilter = { + /** Selects rows whose agentVersion dimension equals the given value if not null. To query for the null value, use {in: {agentVersion: [null]}} instead. */ + agentVersion?: InputMaybe; + and?: InputMaybe>; + /** Selects rows whose cloudProvider dimension equals the given value if not null. To query for the null value, use {in: {cloudProvider: [null]}} instead. */ + cloudProvider?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose routerId dimension equals the given value if not null. To query for the null value, use {in: {routerId: [null]}} instead. */ + routerId?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose tier dimension equals the given value if not null. To query for the null value, use {in: {tier: [null]}} instead. */ + tier?: InputMaybe; +}; + +/** Filter for data in ServiceGraphosCloudMetrics. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceGraphosCloudMetricsFilterIn = { + /** Selects rows whose agentVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + agentVersion?: InputMaybe>>; + /** Selects rows whose cloudProvider dimension is in the given list. A null value in the list means a row with null for that dimension. */ + cloudProvider?: InputMaybe>>; + /** Selects rows whose routerId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + routerId?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose tier dimension is in the given list. A null value in the list means a row with null for that dimension. */ + tier?: InputMaybe>>; +}; + +export type ServiceGraphosCloudMetricsMetrics = { + __typename?: 'ServiceGraphosCloudMetricsMetrics'; + responseSize: Scalars['Long']['output']; + responseSizeThrottled: Scalars['Long']['output']; + routerOperations: Scalars['Long']['output']; + routerOperationsThrottled: Scalars['Long']['output']; + subgraphFetches: Scalars['Long']['output']; + subgraphFetchesThrottled: Scalars['Long']['output']; +}; + +export type ServiceGraphosCloudMetricsOrderBySpec = { + column: ServiceGraphosCloudMetricsColumn; + direction: Ordering; +}; + +export type ServiceGraphosCloudMetricsRecord = { + __typename?: 'ServiceGraphosCloudMetricsRecord'; + /** Dimensions of ServiceGraphosCloudMetrics that can be grouped by. */ + groupBy: ServiceGraphosCloudMetricsDimensions; + /** Metrics of ServiceGraphosCloudMetrics that can be aggregated over. */ + metrics: ServiceGraphosCloudMetricsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutation = { + __typename?: 'ServiceMutation'; + /** + * Checks a proposed subgraph schema change against a published subgraph. + * If the proposal composes successfully, perform a usage check for the resulting supergraph schema. + * @deprecated Use GraphVariant.submitSubgraphCheckAsync instead. + * This mutation polls to wait for the check to finish, + * while subgraphSubgraphCheckAsync triggers returns + * without waiting for the check to finish. + */ + checkPartialSchema: CheckPartialSchemaResult; + /** + * Checks a proposed schema against the schema that has been published to + * a particular variant, using metrics corresponding to `historicParameters`. + * Callers can set `historicParameters` directly or rely on defaults set in the + * graph's check configuration (7 days by default). + * If they do not set `historicParameters` but set `useMaximumRetention`, + * validation will use the maximum retention the graph has access to. + */ + checkSchema: CheckSchemaResult; + /** Make changes to a check workflow. */ + checkWorkflow?: Maybe; + createCompositionStatusSubscription: SchemaPublishSubscription; + /** Create a new Persisted Query List. */ + createPersistedQueryList: CreatePersistedQueryListResultOrError; + /** Creates a proposal variant from a source variant and a name, description. See the documentation for proposal creation at https://www.apollographql.com/docs/graphos/delivery/schema-proposals/creation */ + createProposal: CreateProposalResult; + /** Subscribes a webhook channel to Proposal lifecycle events on this graph. */ + createProposalLifecycleSubscription: CreateProposalLifecycleSubscriptionResult; + /** Creates a proposal variant from a source variant and a name, description. Do not call this from any clients, this resolver is exclusively for inter-service proposal -> kotlin registry communication. */ + createProposalVariant: ProposalVariantCreationResult; + createRuleEnforcement: RuleEnforcementResult; + /** Create a new assessment for this graph. */ + createSafAssessment: SafAssessment; + createSchemaPublishSubscription: SchemaPublishSubscription; + /** Update the default build pipeline track for this graph. */ + defaultBuildPipelineTrack?: Maybe; + /** Soft delete a graph. Data associated with the graph is not permanently deleted; Apollo support can undo. */ + delete?: Maybe; + /** Delete the service's avatar. Requires Service.roles.canUpdateAvatar to be true. */ + deleteAvatar?: Maybe; + /** Delete an existing channel */ + deleteChannel: Scalars['Boolean']['output']; + /** Deletes this service's current subscriptions specific by ID. */ + deleteProposalLifecycleSubscription: DeleteProposalLifecycleSubscriptionResult; + /** Delete an existing query trigger */ + deleteQueryTrigger: Scalars['Boolean']['output']; + /** Deletes this service's current subscriptions specific to the ID, returns true if it existed */ + deleteRegistrySubscription: Scalars['Boolean']['output']; + /** + * Deletes this service's current registry subscription(s) specific to its graph variant, + * returns a list of subscription IDs that were deleted. + */ + deleteRegistrySubscriptions: Array; + deleteRuleEnforcement: Scalars['Boolean']['output']; + deleteScheduledSummary: Scalars['Boolean']['output']; + /** Delete a variant by name. */ + deleteSchemaTag: DeleteSchemaTagResult; + /** Given a UTC timestamp, delete all traces associated with this Service, on that corresponding day. If a timestamp to is provided, deletes all days inclusive. */ + deleteTraces?: Maybe; + disableDatadogForwardingLegacyMetricNames?: Maybe; + /** Hard delete a graph and all data associated with it. Its ID cannot be reused. */ + hardDelete?: Maybe; + /** @deprecated Use service.id */ + id: Scalars['ID']['output']; + /** + * Ignore an operation in future checks; + * changes affecting it will be tracked, + * but won't affect the outcome of the check. + * Returns true if the operation is newly ignored, + * false if it already was. + */ + ignoreOperationsInChecks?: Maybe; + /** Lint a single schema using the graph's linter configuration. */ + lintSchema: LintResult; + /** + * Mark the changeset that affects an operation in a given check instance as safe. + * Note that only operations marked as behavior changes are allowed to be marked as safe. + */ + markChangesForOperationAsSafe: MarkChangesForOperationAsSafeResult; + /** Generates a new graph API key for this graph with the specified permission level. */ + newKey: GraphApiKey; + /** Mutation to set whether a proposals check task's results should be overridden or not */ + overrideProposalsCheckTask?: Maybe; + /** Adds an override to the given users permission for this graph */ + overrideUserPermission?: Maybe; + /** Provides access to mutation fields for modifying a Persisted Query List with the provided ID. */ + persistedQueryList: PersistedQueryListMutation; + /** Promote the schema with the given SHA-256 hash to active for the given variant/tag. */ + promoteSchema: PromoteSchemaResponseOrError; + proposalsMustBeApprovedByADefaultReviewer?: Maybe; + /** Publish to a subgraph. If composition is successful, this will update running routers. */ + publishSubgraph?: Maybe; + /** Publishes multiple subgraphs. If composition is successful, this will update running routers. */ + publishSubgraphs?: Maybe; + /** Publishes multiple subgraphs, running the build async. */ + publishSubgraphsAsyncBuild?: Maybe; + /** Test a subscription by queueing a test notification for the one subscribed event. */ + queueTestProposalLifecycleNotification: QueueTestProposalLifecycleNotificationResult; + registerOperationsWithResponse?: Maybe; + /** Removes a subgraph. If composition is successful, this will update running routers. */ + removeImplementingServiceAndTriggerComposition: CompositionAndRemoveResult; + /** Deletes the existing graph API key with the provided ID, if any. */ + removeKey?: Maybe; + /** Sets a new name for the graph API key with the provided ID, if any. This does not invalidate the key or change its value. */ + renameKey?: Maybe; + /** @deprecated use Mutation.reportSchema instead */ + reportServerInfo?: Maybe; + /** Mutations for a specific assessment. */ + safAssessment?: Maybe; + service: Service; + setCustomCheckConfiguration: CustomCheckConfigurationResult; + setDefaultBuildPipelineTrack?: Maybe; + setMinProposalApprovers: SetMinApproversResult; + /** The minimum role for create & edit is graph admin */ + setMinProposalRoles: SetProposalRolesResult; + setProposalDefaultReviewers: SetProposalDefaultReviewersResult; + /** Updates the template for schema proposal descriptions. Deletes the template if the input string is null or empty */ + setProposalDescriptionTemplate?: Maybe; + /** Set the variant for this graph that all proposals depend on for 'IMPLEMENTED' status. TODO maya switch this to canManageProposalSettings. If variantName is passed as null, implementation variant is deleted. */ + setProposalImplementationVariant: SetProposalImplementationVariantResult; + /** Sets the current active user's Proposals notification status on this graph. */ + setProposalNotificationStatus: SetProposalNotificationStatusResult; + setProposalsMustBeReApprovedOnChange?: Maybe; + /** + * Store a given schema document. This schema will be attached to the graph but + * not be associated with any variant. On success, returns the schema hash. + */ + storeSchemaDocument: StoreSchemaResponseOrError; + /** Test Slack notification channel */ + testSlackChannel?: Maybe; + testSubscriptionForChannel: Scalars['String']['output']; + transfer?: Maybe; + /** Undelete a soft deleted graph. */ + undelete?: Maybe; + /** + * Revert the effects of ignoreOperation. + * Returns true if the operation is no longer ignored, + * false if it wasn't. + */ + unignoreOperationsInChecks?: Maybe; + /** Unmark changes for an operation as safe. */ + unmarkChangesForOperationAsSafe: MarkChangesForOperationAsSafeResult; + /** Update schema check configuration for a graph. */ + updateCheckConfiguration: CheckConfiguration; + updateDatadogMetricsConfig?: Maybe; + updateDescription?: Maybe; + /** Update hiddenFromUninvitedNonAdminAccountMembers */ + updateHiddenFromUninvitedNonAdminAccountMembers?: Maybe; + /** Update rule violations to ignore for this graph. */ + updateIgnoredRuleViolations: Array; + /** Update the linter configuration for this graph. */ + updateLinterConfiguration: GraphLinterConfiguration; + /** Updates the specified proposal lifecycle subscription's subscribed events. */ + updateProposalLifecycleSubscription: UpdateProposalLifecycleSubscriptionResult; + updateReadme?: Maybe; + updateRuleEnforcement: RuleEnforcementResult; + updateTitle?: Maybe; + /** Publish a schema to this variant, either via a document or an introspection query result. */ + uploadSchema?: Maybe; + upsertChannel?: Maybe; + /** Creates a contract schema from a source variant and a set of filter configurations */ + upsertContractVariant: ContractVariantUpsertResult; + /** Publish to a subgraph. If composition is successful, this will update running routers. */ + upsertImplementingServiceAndTriggerComposition?: Maybe; + /** Create/update PagerDuty notification channel */ + upsertPagerDutyChannel?: Maybe; + upsertQueryTrigger?: Maybe; + /** Create or update a subscription for a service. */ + upsertRegistrySubscription: RegistrySubscription; + upsertScheduledSummary?: Maybe; + /** Create/update Slack notification channel */ + upsertSlackChannel?: Maybe; + upsertWebhookChannel?: Maybe; + validateOperations: ValidateOperationsResult; + /** + * This mutation will not result in any changes to the implementing service + * Run composition with the Implementing Service's partial schema replaced with the one provided + * in the mutation's input. Store the composed schema, return the hash of the composed schema, + * and any warnings and errors pertaining to composition. + * This mutation will not run validation against operations. + * @deprecated Use GraphVariant.submitSubgraphCheckAsync instead + */ + validatePartialSchemaOfImplementingServiceAgainstGraph: CompositionValidationResult; + /** Make changes to a graph variant. */ + variant?: Maybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCheckPartialSchemaArgs = { + frontend?: InputMaybe; + gitContext?: InputMaybe; + graphVariant: Scalars['String']['input']; + historicParameters?: InputMaybe; + implementingServiceName: Scalars['String']['input']; + introspectionEndpoint?: InputMaybe; + isProposalCheck?: Scalars['Boolean']['input']; + isSandboxCheck?: Scalars['Boolean']['input']; + partialSchema: PartialSchemaInput; + triggeredBy?: InputMaybe; + useMaximumRetention?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCheckSchemaArgs = { + baseSchemaTag?: InputMaybe; + frontend?: InputMaybe; + gitContext?: InputMaybe; + historicParameters?: InputMaybe; + introspectionEndpoint?: InputMaybe; + isProposalCheck?: Scalars['Boolean']['input']; + isSandboxCheck?: Scalars['Boolean']['input']; + proposedSchema?: InputMaybe; + proposedSchemaDocument?: InputMaybe; + proposedSchemaHash?: InputMaybe; + useMaximumRetention?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCheckWorkflowArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCreateCompositionStatusSubscriptionArgs = { + channelID: Scalars['ID']['input']; + variant: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCreatePersistedQueryListArgs = { + description?: InputMaybe; + name: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCreateProposalArgs = { + input: CreateProposalInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCreateProposalLifecycleSubscriptionArgs = { + input: CreateProposalLifecycleSubscriptionInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCreateProposalVariantArgs = { + sourceVariantName: Scalars['ID']['input']; + triggeredBy?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCreateRuleEnforcementArgs = { + input: CreateRuleEnforcementInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationCreateSchemaPublishSubscriptionArgs = { + channelID: Scalars['ID']['input']; + variant: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDefaultBuildPipelineTrackArgs = { + buildPipelineTrack: BuildPipelineTrack; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteChannelArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteProposalLifecycleSubscriptionArgs = { + input: DeleteProposalLifecycleSubscriptionInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteQueryTriggerArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteRegistrySubscriptionArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteRegistrySubscriptionsArgs = { + variant: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteRuleEnforcementArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteScheduledSummaryArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteSchemaTagArgs = { + tag: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationDeleteTracesArgs = { + from: Scalars['Timestamp']['input']; + to?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationIgnoreOperationsInChecksArgs = { + ids: Array; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationLintSchemaArgs = { + baseSdl?: InputMaybe; + sdl: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationMarkChangesForOperationAsSafeArgs = { + checkID: Scalars['ID']['input']; + operationID: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationNewKeyArgs = { + keyName?: InputMaybe; + role?: UserPermission; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationOverrideProposalsCheckTaskArgs = { + shouldOverride: Scalars['Boolean']['input']; + taskId: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationOverrideUserPermissionArgs = { + permission?: InputMaybe; + userID: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationPersistedQueryListArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationPromoteSchemaArgs = { + graphVariant: Scalars['String']['input']; + historicParameters?: InputMaybe; + overrideComposedSchema?: Scalars['Boolean']['input']; + sha256: Scalars['SHA256']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationProposalsMustBeApprovedByADefaultReviewerArgs = { + mustBeApproved: Scalars['Boolean']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationPublishSubgraphArgs = { + activePartialSchema: PartialSchemaInput; + downstreamLaunchInitiation?: InputMaybe; + gitContext?: InputMaybe; + graphVariant: Scalars['String']['input']; + name: Scalars['String']['input']; + revision: Scalars['String']['input']; + url?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationPublishSubgraphsArgs = { + downstreamLaunchInitiation?: InputMaybe; + gitContext?: InputMaybe; + graphVariant: Scalars['String']['input']; + revision: Scalars['String']['input']; + subgraphInputs: Array; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationPublishSubgraphsAsyncBuildArgs = { + gitContext?: InputMaybe; + graphVariant: Scalars['String']['input']; + revision: Scalars['String']['input']; + subgraphInputs: Array; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationQueueTestProposalLifecycleNotificationArgs = { + input: QueueTestProposalLifecycleNotificationInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationRegisterOperationsWithResponseArgs = { + clientIdentity?: InputMaybe; + gitContext?: InputMaybe; + graphVariant?: Scalars['String']['input']; + manifestVersion?: InputMaybe; + operations: Array; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationRemoveImplementingServiceAndTriggerCompositionArgs = { + dryRun?: Scalars['Boolean']['input']; + graphVariant: Scalars['String']['input']; + name: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationRemoveKeyArgs = { + id: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationRenameKeyArgs = { + id: Scalars['ID']['input']; + newKeyName?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationReportServerInfoArgs = { + executableSchema?: InputMaybe; + info: EdgeServerInfo; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSafAssessmentArgs = { + id: Scalars['ID']['input']; + includeDeleted?: Scalars['Boolean']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetCustomCheckConfigurationArgs = { + input: SetCustomCheckConfigurationInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetDefaultBuildPipelineTrackArgs = { + version: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetMinProposalApproversArgs = { + input: SetMinProposalApproversInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetMinProposalRolesArgs = { + input: SetProposalRolesInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetProposalDefaultReviewersArgs = { + input: SetProposalDefaultReviewersInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetProposalDescriptionTemplateArgs = { + input: SetProposalDescriptionTemplateInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetProposalImplementationVariantArgs = { + variantName?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetProposalNotificationStatusArgs = { + input: SetProposalNotificationStatusInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationSetProposalsMustBeReApprovedOnChangeArgs = { + approvalRequiredOnChange: Scalars['Boolean']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationStoreSchemaDocumentArgs = { + schemaDocument: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationTestSlackChannelArgs = { + id: Scalars['ID']['input']; + notification: SlackNotificationInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationTestSubscriptionForChannelArgs = { + channelID: Scalars['ID']['input']; + subscriptionID: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationTransferArgs = { + to: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUnignoreOperationsInChecksArgs = { + ids: Array; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUnmarkChangesForOperationAsSafeArgs = { + checkID: Scalars['ID']['input']; + operationID: Scalars['ID']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateCheckConfigurationArgs = { + downgradeDefaultValueChange?: InputMaybe; + downgradeStaticChecks?: InputMaybe; + enableCustomChecks?: InputMaybe; + enableLintChecks?: InputMaybe; + excludedClients?: InputMaybe>; + excludedOperationNames?: InputMaybe>; + excludedOperations?: InputMaybe>; + includeBaseVariant?: InputMaybe; + includedVariants?: InputMaybe>; + operationCountThreshold?: InputMaybe; + operationCountThresholdPercentage?: InputMaybe; + timeRangeSeconds?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateDatadogMetricsConfigArgs = { + apiKey?: InputMaybe; + apiRegion?: InputMaybe; + enabled?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateDescriptionArgs = { + description: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateHiddenFromUninvitedNonAdminAccountMembersArgs = { + hiddenFromUninvitedNonAdminAccountMembers: Scalars['Boolean']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateIgnoredRuleViolationsArgs = { + changes: LinterIgnoredRuleChangesInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateLinterConfigurationArgs = { + changes: GraphLinterConfigurationChangesInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateProposalLifecycleSubscriptionArgs = { + input: UpdateProposalLifecycleSubscriptionInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateReadmeArgs = { + readme: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateRuleEnforcementArgs = { + id: Scalars['ID']['input']; + input: UpdateRuleEnforcementInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpdateTitleArgs = { + title: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUploadSchemaArgs = { + errorOnBadRequest?: Scalars['Boolean']['input']; + gitContext?: InputMaybe; + historicParameters?: InputMaybe; + overrideComposedSchema?: Scalars['Boolean']['input']; + schema?: InputMaybe; + schemaDocument?: InputMaybe; + tag: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertChannelArgs = { + id?: InputMaybe; + pagerDutyChannel?: InputMaybe; + slackChannel?: InputMaybe; + webhookChannel?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertContractVariantArgs = { + contractVariantName: Scalars['String']['input']; + filterConfig: FilterConfigInput; + initiateLaunch?: Scalars['Boolean']['input']; + sourceVariant?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertImplementingServiceAndTriggerCompositionArgs = { + activePartialSchema: PartialSchemaInput; + gitContext?: InputMaybe; + graphVariant: Scalars['String']['input']; + name: Scalars['String']['input']; + revision: Scalars['String']['input']; + url?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertPagerDutyChannelArgs = { + channel: PagerDutyChannelInput; + id?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertQueryTriggerArgs = { + id?: InputMaybe; + trigger: QueryTriggerInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertRegistrySubscriptionArgs = { + channelID?: InputMaybe; + id?: InputMaybe; + options?: InputMaybe; + variant?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertScheduledSummaryArgs = { + channelID?: InputMaybe; + enabled?: InputMaybe; + id?: InputMaybe; + tag?: InputMaybe; + timezone?: InputMaybe; + variant?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertSlackChannelArgs = { + channel: SlackChannelInput; + id?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationUpsertWebhookChannelArgs = { + id?: InputMaybe; + name?: InputMaybe; + secretToken?: InputMaybe; + url: Scalars['String']['input']; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationValidateOperationsArgs = { + gitContext?: InputMaybe; + operations: Array; + tag?: InputMaybe; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationValidatePartialSchemaOfImplementingServiceAgainstGraphArgs = { + graphVariant: Scalars['String']['input']; + implementingServiceName: Scalars['String']['input']; + partialSchema: PartialSchemaInput; +}; + + +/** Provides access to mutation fields for managing Studio graphs and subgraphs. */ +export type ServiceMutationVariantArgs = { + name: Scalars['String']['input']; +}; + +/** Columns of ServiceOperationCheckStats. */ +export enum ServiceOperationCheckStatsColumn { + CACHED_REQUESTS_COUNT = 'CACHED_REQUESTS_COUNT', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP', + UNCACHED_REQUESTS_COUNT = 'UNCACHED_REQUESTS_COUNT' +} + +export type ServiceOperationCheckStatsDimensions = { + __typename?: 'ServiceOperationCheckStatsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceOperationCheckStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceOperationCheckStatsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceOperationCheckStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceOperationCheckStatsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceOperationCheckStatsMetrics = { + __typename?: 'ServiceOperationCheckStatsMetrics'; + cachedRequestsCount: Scalars['Long']['output']; + uncachedRequestsCount: Scalars['Long']['output']; +}; + +export type ServiceOperationCheckStatsOrderBySpec = { + column: ServiceOperationCheckStatsColumn; + direction: Ordering; +}; + +export type ServiceOperationCheckStatsRecord = { + __typename?: 'ServiceOperationCheckStatsRecord'; + /** Dimensions of ServiceOperationCheckStats that can be grouped by. */ + groupBy: ServiceOperationCheckStatsDimensions; + /** Metrics of ServiceOperationCheckStats that can be aggregated over. */ + metrics: ServiceOperationCheckStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceQueryStats. */ +export enum ServiceQueryStatsColumn { + CACHED_HISTOGRAM = 'CACHED_HISTOGRAM', + CACHED_REQUESTS_COUNT = 'CACHED_REQUESTS_COUNT', + CACHE_TTL_HISTOGRAM = 'CACHE_TTL_HISTOGRAM', + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + FORBIDDEN_OPERATION_COUNT = 'FORBIDDEN_OPERATION_COUNT', + FROM_ENGINEPROXY = 'FROM_ENGINEPROXY', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + PERSISTED_QUERY_ID = 'PERSISTED_QUERY_ID', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + REGISTERED_OPERATION_COUNT = 'REGISTERED_OPERATION_COUNT', + REQUESTS_WITH_ERRORS_COUNT = 'REQUESTS_WITH_ERRORS_COUNT', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP', + UNCACHED_HISTOGRAM = 'UNCACHED_HISTOGRAM', + UNCACHED_REQUESTS_COUNT = 'UNCACHED_REQUESTS_COUNT' +} + +export type ServiceQueryStatsDimensions = { + __typename?: 'ServiceQueryStatsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + fromEngineproxy?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + persistedQueryId?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + querySignature?: Maybe; + querySignatureLength?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; +}; + +/** Filter for data in ServiceQueryStats. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceQueryStatsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose fromEngineproxy dimension equals the given value if not null. To query for the null value, use {in: {fromEngineproxy: [null]}} instead. */ + fromEngineproxy?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose persistedQueryId dimension equals the given value if not null. To query for the null value, use {in: {persistedQueryId: [null]}} instead. */ + persistedQueryId?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; +}; + +/** Filter for data in ServiceQueryStats. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceQueryStatsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose fromEngineproxy dimension is in the given list. A null value in the list means a row with null for that dimension. */ + fromEngineproxy?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose persistedQueryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + persistedQueryId?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; +}; + +export type ServiceQueryStatsMetrics = { + __typename?: 'ServiceQueryStatsMetrics'; + cacheTtlHistogram: DurationHistogram; + cachedHistogram: DurationHistogram; + cachedRequestsCount: Scalars['Long']['output']; + forbiddenOperationCount: Scalars['Long']['output']; + registeredOperationCount: Scalars['Long']['output']; + requestsWithErrorsCount: Scalars['Long']['output']; + totalLatencyHistogram: DurationHistogram; + totalRequestCount: Scalars['Long']['output']; + uncachedHistogram: DurationHistogram; + uncachedRequestsCount: Scalars['Long']['output']; +}; + +export type ServiceQueryStatsOrderBySpec = { + column: ServiceQueryStatsColumn; + direction: Ordering; +}; + +export type ServiceQueryStatsRecord = { + __typename?: 'ServiceQueryStatsRecord'; + /** Dimensions of ServiceQueryStats that can be grouped by. */ + groupBy: ServiceQueryStatsDimensions; + /** Metrics of ServiceQueryStats that can be aggregated over. */ + metrics: ServiceQueryStatsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Individual permissions for the current user when interacting with a particular Studio graph. */ +export type ServiceRoles = { + __typename?: 'ServiceRoles'; + /** Whether the currently authenticated user is permitted to perform schema checks (i.e., run `rover (sub)graph check`). */ + canCheckSchemas: Scalars['Boolean']['output']; + canCreateProposal: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to create new graph variants. */ + canCreateVariants: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to delete the graph in question */ + canDelete: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to delete proposal variants. */ + canDeleteProposalVariants: Scalars['Boolean']['output']; + /** Given the graph's setting regarding proposal permission levels, can the current user edit Proposals authored by other users */ + canEditProposal: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage user access to the graph in question. */ + canManageAccess: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage the build configuration (e.g., build pipeline version). */ + canManageBuildConfig: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage third-party integrations (e.g., Datadog forwarding). */ + canManageIntegrations: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage graph-level API keys. */ + canManageKeys: Scalars['Boolean']['output']; + canManagePersistedQueryLists: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage proposal permission settings for this graph. */ + canManageProposalPermissions: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to manage proposal settings, like setting the implementation variant, on this graph. */ + canManageProposalSettings: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to perform basic administration of variants (e.g., make a variant public). */ + canManageVariants: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to view details about the build configuration (e.g. build pipeline version). */ + canQueryBuildConfig: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to view details of the check configuration for this graph. */ + canQueryCheckConfiguration: Scalars['Boolean']['output']; + canQueryDeletedImplementingServices: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to view which subgraphs the graph is composed of. */ + canQueryImplementingServices: Scalars['Boolean']['output']; + canQueryIntegrations: Scalars['Boolean']['output']; + canQueryPersistedQueryLists: Scalars['Boolean']['output']; + canQueryPrivateInfo: Scalars['Boolean']['output']; + canQueryProposals: Scalars['Boolean']['output']; + canQueryPublicInfo: Scalars['Boolean']['output']; + canQueryReadmeAuthor: Scalars['Boolean']['output']; + canQueryRoleOverrides: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to download schemas owned by this graph. */ + canQuerySchemas: Scalars['Boolean']['output']; + canQueryStats: Scalars['Boolean']['output']; + canQueryTokens: Scalars['Boolean']['output']; + canQueryTraces: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to register operations (i.e. `apollo client:push`) for this graph. */ + canRegisterOperations: Scalars['Boolean']['output']; + canStoreSchemasWithoutVariant: Scalars['Boolean']['output']; + canUndelete: Scalars['Boolean']['output']; + canUpdateAvatar: Scalars['Boolean']['output']; + canUpdateDescription: Scalars['Boolean']['output']; + canUpdateTitle: Scalars['Boolean']['output']; + /** Whether the currently authenticated user is permitted to make updates to the check configuration for this graph. */ + canWriteCheckConfiguration: Scalars['Boolean']['output']; + service: Service; +}; + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindow = { + __typename?: 'ServiceStatsWindow'; + billingUsageStats: Array; + cardinalityStats: Array; + coordinateUsage: Array; + edgeServerInfos: Array; + errorStats: Array; + federatedErrorStats: Array; + fieldExecutions: Array; + fieldLatencies: Array; + fieldStats: Array; + fieldUsage: Array; + graphosCloudMetrics: Array; + operationCheckStats: Array; + queryStats: Array; + /** From field rounded down to the nearest resolution. */ + roundedDownFrom: Scalars['Timestamp']['output']; + /** To field rounded up to the nearest resolution. */ + roundedUpTo: Scalars['Timestamp']['output']; + tracePathErrorsRefs: Array; + traceRefs: Array; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowBillingUsageStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowCardinalityStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowCoordinateUsageArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowEdgeServerInfosArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowErrorStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowFederatedErrorStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowFieldExecutionsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowFieldLatenciesArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowFieldStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowFieldUsageArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowGraphosCloudMetricsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowOperationCheckStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowQueryStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowTracePathErrorsRefsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity over a given service. */ +export type ServiceStatsWindowTraceRefsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + +/** Columns of ServiceTracePathErrorsRefs. */ +export enum ServiceTracePathErrorsRefsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + DURATION_BUCKET = 'DURATION_BUCKET', + ERRORS_COUNT_IN_PATH = 'ERRORS_COUNT_IN_PATH', + ERRORS_COUNT_IN_TRACE = 'ERRORS_COUNT_IN_TRACE', + ERROR_CODE = 'ERROR_CODE', + ERROR_MESSAGE = 'ERROR_MESSAGE', + ERROR_SERVICE = 'ERROR_SERVICE', + PATH = 'PATH', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP', + TRACE_HTTP_STATUS_CODE = 'TRACE_HTTP_STATUS_CODE', + TRACE_ID = 'TRACE_ID', + TRACE_SIZE_BYTES = 'TRACE_SIZE_BYTES', + TRACE_STARTS_AT = 'TRACE_STARTS_AT' +} + +export type ServiceTracePathErrorsRefsDimensions = { + __typename?: 'ServiceTracePathErrorsRefsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + durationBucket?: Maybe; + errorCode?: Maybe; + errorMessage?: Maybe; + errorService?: Maybe; + path?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + traceHttpStatusCode?: Maybe; + traceId?: Maybe; + traceStartsAt?: Maybe; +}; + +/** Filter for data in ServiceTracePathErrorsRefs. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceTracePathErrorsRefsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose durationBucket dimension equals the given value if not null. To query for the null value, use {in: {durationBucket: [null]}} instead. */ + durationBucket?: InputMaybe; + /** Selects rows whose errorCode dimension equals the given value if not null. To query for the null value, use {in: {errorCode: [null]}} instead. */ + errorCode?: InputMaybe; + /** Selects rows whose errorMessage dimension equals the given value if not null. To query for the null value, use {in: {errorMessage: [null]}} instead. */ + errorMessage?: InputMaybe; + /** Selects rows whose errorService dimension equals the given value if not null. To query for the null value, use {in: {errorService: [null]}} instead. */ + errorService?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose path dimension equals the given value if not null. To query for the null value, use {in: {path: [null]}} instead. */ + path?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose traceHttpStatusCode dimension equals the given value if not null. To query for the null value, use {in: {traceHttpStatusCode: [null]}} instead. */ + traceHttpStatusCode?: InputMaybe; + /** Selects rows whose traceId dimension equals the given value if not null. To query for the null value, use {in: {traceId: [null]}} instead. */ + traceId?: InputMaybe; +}; + +/** Filter for data in ServiceTracePathErrorsRefs. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceTracePathErrorsRefsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose durationBucket dimension is in the given list. A null value in the list means a row with null for that dimension. */ + durationBucket?: InputMaybe>>; + /** Selects rows whose errorCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorCode?: InputMaybe>>; + /** Selects rows whose errorMessage dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorMessage?: InputMaybe>>; + /** Selects rows whose errorService dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorService?: InputMaybe>>; + /** Selects rows whose path dimension is in the given list. A null value in the list means a row with null for that dimension. */ + path?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose traceHttpStatusCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceHttpStatusCode?: InputMaybe>>; + /** Selects rows whose traceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceId?: InputMaybe>>; +}; + +export type ServiceTracePathErrorsRefsMetrics = { + __typename?: 'ServiceTracePathErrorsRefsMetrics'; + errorsCountInPath: Scalars['Long']['output']; + errorsCountInTrace: Scalars['Long']['output']; + traceSizeBytes: Scalars['Long']['output']; +}; + +export type ServiceTracePathErrorsRefsOrderBySpec = { + column: ServiceTracePathErrorsRefsColumn; + direction: Ordering; +}; + +export type ServiceTracePathErrorsRefsRecord = { + __typename?: 'ServiceTracePathErrorsRefsRecord'; + /** Dimensions of ServiceTracePathErrorsRefs that can be grouped by. */ + groupBy: ServiceTracePathErrorsRefsDimensions; + /** Metrics of ServiceTracePathErrorsRefs that can be aggregated over. */ + metrics: ServiceTracePathErrorsRefsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of ServiceTraceRefs. */ +export enum ServiceTraceRefsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + DURATION_BUCKET = 'DURATION_BUCKET', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + TIMESTAMP = 'TIMESTAMP', + TRACE_COUNT = 'TRACE_COUNT', + TRACE_ID = 'TRACE_ID' +} + +export type ServiceTraceRefsDimensions = { + __typename?: 'ServiceTraceRefsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + durationBucket?: Maybe; + generatedTraceId?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + querySignature?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + traceId?: Maybe; +}; + +/** Filter for data in ServiceTraceRefs. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type ServiceTraceRefsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose durationBucket dimension equals the given value if not null. To query for the null value, use {in: {durationBucket: [null]}} instead. */ + durationBucket?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose traceId dimension equals the given value if not null. To query for the null value, use {in: {traceId: [null]}} instead. */ + traceId?: InputMaybe; +}; + +/** Filter for data in ServiceTraceRefs. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type ServiceTraceRefsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose durationBucket dimension is in the given list. A null value in the list means a row with null for that dimension. */ + durationBucket?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose traceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceId?: InputMaybe>>; +}; + +export type ServiceTraceRefsMetrics = { + __typename?: 'ServiceTraceRefsMetrics'; + traceCount: Scalars['Long']['output']; +}; + +export type ServiceTraceRefsOrderBySpec = { + column: ServiceTraceRefsColumn; + direction: Ordering; +}; + +export type ServiceTraceRefsRecord = { + __typename?: 'ServiceTraceRefsRecord'; + /** Dimensions of ServiceTraceRefs that can be grouped by. */ + groupBy: ServiceTraceRefsDimensions; + /** Metrics of ServiceTraceRefs that can be aggregated over. */ + metrics: ServiceTraceRefsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type SetCustomCheckConfigurationInput = { + secretToken?: InputMaybe; + url: Scalars['String']['input']; +}; + +/** Input to update a proposal description */ +export type SetMergeBaseCompositionIdInput = { + /** The composition id of the source variant this proposal is based on. */ + mergeBaseCompositionId: Scalars['ID']['input']; +}; + +export type SetMergeBaseCompositionIdResult = PermissionError | Proposal | ValidationError; + +export type SetMinApproversResult = PermissionError | Service | ValidationError; + +export type SetMinProposalApproversInput = { + minApprovers?: InputMaybe; +}; + +/** Represents the possible outcomes of a setNextVersion mutation */ +export type SetNextVersionResult = InternalServerError | InvalidInputErrors | RouterVersion; + +export type SetProposalDefaultReviewersInput = { + reviewerUserIds: Array; +}; + +export type SetProposalDefaultReviewersResult = PermissionError | Service | ValidationError; + +export type SetProposalDescriptionTemplateInput = { + descriptionTemplate?: InputMaybe; +}; + +export type SetProposalDescriptionTemplateResult = PermissionError | Service | ValidationError; + +export type SetProposalImplementationVariantResult = PermissionError | Service | ValidationError; + +export type SetProposalNotificationStatusInput = { + /** NotificationStatus to set for the current active user. */ + status: NotificationStatus; +}; + +export type SetProposalNotificationStatusResult = PermissionError | Service | ValidationError; + +export type SetProposalRolesInput = { + create?: InputMaybe; + edit?: InputMaybe; +}; + +export type SetProposalRolesResult = PermissionError | Service | ValidationError; + +export type SetProposalsMustBeReApprovedOnChangeResult = PermissionError | Service | ValidationError; + +export type SetupIntentResult = NotFoundError | PermissionError | SetupIntentSuccess; + +export type SetupIntentSuccess = { + __typename?: 'SetupIntentSuccess'; + clientSecret: Scalars['String']['output']; +}; + +/** + * Shard for Cloud Routers + * + * This represents a specific shard where a Cloud Router can run + */ +export type Shard = { + __typename?: 'Shard'; + gcuCapacity?: Maybe; + gcuUsage: Scalars['Int']['output']; + id: Scalars['ID']['output']; + provider: CloudProvider; + /** Details of this shard for a specific provider */ + providerDetails: ShardProvider; + reason?: Maybe; + region: RegionDescription; + routerCapacity?: Maybe; + routerUsage: Scalars['Int']['output']; + routers: Array; + status: ShardStatus; + tier: CloudTier; +}; + + +/** + * Shard for Cloud Routers + * + * This represents a specific shard where a Cloud Router can run + */ +export type ShardRoutersArgs = { + first?: InputMaybe; + offset?: InputMaybe; +}; + +/** Provider-specific information for a Shard */ +export type ShardProvider = AwsShard | FlyShard; + +/** Represents the possible outcomes of a shard mutation */ +export type ShardResult = InternalServerError | InvalidInputErrors | ShardSuccess; + +/** Current status of Cloud Shards */ +export enum ShardStatus { + /** The Shard is active and ready to accept new Cloud Routers */ + ACTIVE = 'ACTIVE', + /** The Shard no long exists */ + DELETED = 'DELETED', + /** The Shard is working as expected, but should not be used to provision new Cloud Routers */ + DEPRECATED = 'DEPRECATED', + /** + * The Shard is suffering from a temporary degradation that might impact provisioning new + * Cloud Routers + */ + IMPAIRED = 'IMPAIRED', + /** + * The Shard is currently being updated and should temporarily not be used to provision new + * Cloud Routers + */ + UPDATING = 'UPDATING' +} + +/** Success branch of an shard mutation */ +export type ShardSuccess = { + __typename?: 'ShardSuccess'; + shard: Shard; +}; + +/** Slack notification channel */ +export type SlackChannel = Channel & { + __typename?: 'SlackChannel'; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + subscriptions: Array; + url: Scalars['String']['output']; +}; + +/** Slack notification channel parameters */ +export type SlackChannelInput = { + name?: InputMaybe; + url: Scalars['String']['input']; +}; + +export type SlackNotificationField = { + key: Scalars['String']['input']; + value: Scalars['String']['input']; +}; + +/** Slack notification message */ +export type SlackNotificationInput = { + color?: InputMaybe; + fallback: Scalars['String']['input']; + fields?: InputMaybe>; + iconUrl?: InputMaybe; + text?: InputMaybe; + timestamp?: InputMaybe; + title?: InputMaybe; + titleLink?: InputMaybe; + username?: InputMaybe; +}; + +/** A location in a source code file. */ +export type SourceLocation = { + __typename?: 'SourceLocation'; + /** Column number. */ + column: Scalars['Int']['output']; + /** Line number. */ + line: Scalars['Int']['output']; +}; + +export type SsoConfig = { + __typename?: 'SsoConfig'; + /** Returns all SSO connections for the account, including those disabled or incomplete */ + allConnections: Array; + /** Returns the current enabled SSO connection for the account */ + currentConnection?: Maybe; + defaultRole: UserPermission; +}; + +export type SsoConnection = { + domains: Array; + id: Scalars['ID']['output']; + idpId: Scalars['ID']['output']; + scim?: Maybe; + /** @deprecated Use stateV2 instead */ + state: SsoConnectionState; + stateV2: SsoConnectionStateV2; +}; + +export enum SsoConnectionState { + DISABLED = 'DISABLED', + ENABLED = 'ENABLED' +} + +export enum SsoConnectionStateV2 { + /** The connection has been archived and is no longer in use */ + ARCHIVED = 'ARCHIVED', + /** The connection has been disabled by an admin */ + DISABLED = 'DISABLED', + /** The connection has been finalized. a connection can only go from VALIDATED->ENABLED */ + ENABLED = 'ENABLED', + /** The initial state for base connections - setup still in progress */ + INITIALIZED = 'INITIALIZED', + /** The connection has been configured as either SAML/OIDC and can be used to login */ + STAGED = 'STAGED', + /** The connection has had at least one successful login - connections automatically transition from STAGED->VALIDATED on first login */ + VALIDATED = 'VALIDATED' +} + +export type SsoMutation = { + __typename?: 'SsoMutation'; + deleteSsoConnection?: Maybe; + disableSsoConnection?: Maybe; + enableScimProvisioning?: Maybe; + enableSsoConnection?: Maybe; +}; + + +export type SsoMutationDeleteSsoConnectionArgs = { + id: Scalars['ID']['input']; +}; + + +export type SsoMutationDisableSsoConnectionArgs = { + id: Scalars['ID']['input']; +}; + + +export type SsoMutationEnableScimProvisioningArgs = { + connectionId: Scalars['ID']['input']; +}; + + +export type SsoMutationEnableSsoConnectionArgs = { + id: Scalars['ID']['input']; +}; + +export type SsoQuery = { + __typename?: 'SsoQuery'; + /** Parses a SAML IDP metadata XML string and returns the parsed metadata */ + parseSamlIdpMetadata?: Maybe; +}; + + +export type SsoQueryParseSamlIdpMetadataArgs = { + metadata: Scalars['String']['input']; +}; + +export type SsoScimProvisioningDetails = { + __typename?: 'SsoScimProvisioningDetails'; + scimEnabled: Scalars['Boolean']['output']; + scimEndpoint?: Maybe; +}; + +export type StartUsageBasedPlanResult = Account | NotFoundError | PermissionError | StartUsageBasedPlanSuccess | ValidationError; + +export type StartUsageBasedPlanSuccess = { + __typename?: 'StartUsageBasedPlanSuccess'; + customerPlanId: Scalars['String']['output']; +}; + +/** A time window with a specified granularity. */ +export type StatsWindow = { + __typename?: 'StatsWindow'; + billingUsageStats: Array; + cardinalityStats: Array; + coordinateUsage: Array; + edgeServerInfos: Array; + errorStats: Array; + federatedErrorStats: Array; + fieldExecutions: Array; + fieldLatencies: Array; + fieldUsage: Array; + graphosCloudMetrics: Array; + operationCheckStats: Array; + queryStats: Array; + /** From field rounded down to the nearest resolution. */ + roundedDownFrom: Scalars['Timestamp']['output']; + /** To field rounded up to the nearest resolution. */ + roundedUpTo: Scalars['Timestamp']['output']; + tracePathErrorsRefs: Array; + traceRefs: Array; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowBillingUsageStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowCardinalityStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowCoordinateUsageArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowEdgeServerInfosArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowErrorStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowFederatedErrorStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowFieldExecutionsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowFieldLatenciesArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowFieldUsageArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowGraphosCloudMetricsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowOperationCheckStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowQueryStatsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowTracePathErrorsRefsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + + +/** A time window with a specified granularity. */ +export type StatsWindowTraceRefsArgs = { + filter?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe>; +}; + +/** Possible status of a Cloud Router version */ +export enum Status { + /** + * Deprecated version of a Cloud Router + * + * New Cloud Routers should not use this version, and this will not be + * supported at some point in the future. + */ + DEPRECATED = 'DEPRECATED', + /** + * Upcoming or experimental version of a Cloud Router + * + * This should only be used internally, or to preview new features to + * customers. + */ + NEXT = 'NEXT', + /** Cloud Router Version is ready to be used by end users */ + STABLE = 'STABLE' +} + +export type StoreSchemaError = { + __typename?: 'StoreSchemaError'; + code: StoreSchemaErrorCode; + message: Scalars['String']['output']; +}; + +export enum StoreSchemaErrorCode { + SCHEMA_IS_NOT_PARSABLE = 'SCHEMA_IS_NOT_PARSABLE', + SCHEMA_IS_NOT_VALID = 'SCHEMA_IS_NOT_VALID' +} + +export type StoreSchemaResponse = { + __typename?: 'StoreSchemaResponse'; + sha256: Scalars['SHA256']['output']; +}; + +export type StoreSchemaResponseOrError = StoreSchemaError | StoreSchemaResponse; + +export type StoredApprovedChange = { + __typename?: 'StoredApprovedChange'; + argNode?: Maybe; + childNode?: Maybe; + code: ChangeCode; + parentNode?: Maybe; +}; + +/** A paginated connection of strings. */ +export type StringConnection = { + __typename?: 'StringConnection'; + /** A list of edges containing a cursor and a string node for pagination. */ + edges: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection, containing a string node and its cursor. */ +export type StringEdge = { + __typename?: 'StringEdge'; + /** A cursor for use in pagination, unique identifier for this edge's position. */ + cursor: Scalars['String']['output']; + /** The string value at this position in the connection. */ + node: Scalars['String']['output']; +}; + +export type StringToString = { + __typename?: 'StringToString'; + key: Scalars['String']['output']; + value: Scalars['String']['output']; +}; + +export type StringToStringInput = { + key: Scalars['String']['input']; + value: Scalars['String']['input']; +}; + +/** A subgraph in a federated Studio supergraph. */ +export type Subgraph = { + __typename?: 'Subgraph'; + /** The subgraph schema document's SHA256 hash, represented as a hexadecimal string. */ + hash: Scalars['String']['output']; + /** The subgraph's registered name. */ + name: Scalars['String']['output']; + /** The number of fields in this subgraph */ + numberOfFields?: Maybe; + /** The number of types in this subgraph */ + numberOfTypes?: Maybe; + /** The revision string of this publish if provided */ + revision?: Maybe; + /** The subgraph's routing URL, provided to gateways that use managed federation. */ + routingURL: Scalars['String']['output']; + /** The subgraph schema document. */ + sdl: Scalars['String']['output']; + /** Timestamp of when the subgraph was published. */ + updatedAt?: Maybe; +}; + + +/** A subgraph in a federated Studio supergraph. */ +export type SubgraphSdlArgs = { + graphId: Scalars['ID']['input']; +}; + +/** A change made to a subgraph as part of a launch. */ +export type SubgraphChange = { + __typename?: 'SubgraphChange'; + /** The subgraph's name. */ + name: Scalars['ID']['output']; + /** The type of change that was made. */ + type: SubgraphChangeType; +}; + +export enum SubgraphChangeType { + ADDITION = 'ADDITION', + DELETION = 'DELETION', + MODIFICATION = 'MODIFICATION' +} + +/** Input type to provide when running schema checks asynchronously for a federated supergraph. */ +export type SubgraphCheckAsyncInput = { + /** Configuration options for the check execution. */ + config: HistoricQueryParametersInput; + /** The GitHub context to associate with the check. */ + gitContext: GitContextInput; + /** The graph ref of the Studio graph and variant to run checks against (such as `my-graph@current`). */ + graphRef?: InputMaybe; + /** The URL of the GraphQL endpoint that Apollo Sandbox introspected to obtain the proposed schema. Required if `isSandbox` is `true`. */ + introspectionEndpoint?: InputMaybe; + /** If `true`, the check was initiated automatically by a Proposal update. */ + isProposal?: InputMaybe; + /** If `true`, the check was initiated by Apollo Sandbox. */ + isSandbox: Scalars['Boolean']['input']; + /** The proposed subgraph schema to perform checks with. */ + proposedSchema: Scalars['GraphQLDocument']['input']; + /** The source variant that this check should use the operations check configuration from */ + sourceVariant?: InputMaybe; + /** The name of the subgraph to check schema changes for. */ + subgraphName: Scalars['String']['input']; + /** The user that triggered this check. If null, defaults to authContext to determine user. */ + triggeredBy?: InputMaybe; +}; + +/** A subgraph in a federated Studio supergraph. */ +export type SubgraphCheckInput = { + /** The subgraph schema document's SHA256 hash, represented as a hexadecimal string. */ + hash: Scalars['String']['input']; + /** The subgraph's registered name. */ + name: Scalars['String']['input']; +}; + +export type SubgraphConfig = { + __typename?: 'SubgraphConfig'; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + schemaHash: Scalars['String']['output']; + sdl: Scalars['String']['output']; + url: Scalars['String']['output']; +}; + +export type SubgraphHashInput = { + /** SHA256 of the subgraph schema sdl. */ + hash: Scalars['String']['input']; + name: Scalars['String']['input']; +}; + +export type SubgraphInput = { + /** We are either going to pass in a document or a schema reference */ + document?: InputMaybe; + name: Scalars['String']['input']; + routingURL: Scalars['String']['input']; + /** + * Reference to a schema in studio. + * If this is a mutable ref i.e. graphRef then it will link (tbd) + * If it is a stable ref i.e. hash then it + */ + schemaRef?: InputMaybe; +}; + +export type SubgraphKeyMap = { + __typename?: 'SubgraphKeyMap'; + keys: Array; + subgraphName: Scalars['String']['output']; +}; + +export type SubgraphSdlCheckInput = { + name: Scalars['String']['input']; + sdl: Scalars['GraphQLDocument']['input']; +}; + +export type SubgraphWithConflicts = { + __typename?: 'SubgraphWithConflicts'; + conflicts: Array; + partialMergeSdl: Scalars['String']['output']; + subgraphName: Scalars['String']['output']; +}; + +export type SubscriptionCapability = { + __typename?: 'SubscriptionCapability'; + label: Scalars['String']['output']; + subscription: BillingSubscription; + value: Scalars['Boolean']['output']; +}; + +export type SubscriptionLimit = { + __typename?: 'SubscriptionLimit'; + label: Scalars['String']['output']; + subscription: BillingSubscription; + value?: Maybe; +}; + +export type SubscriptionOptions = { + __typename?: 'SubscriptionOptions'; + /** Enables notifications for schema updates */ + schemaUpdates: Scalars['Boolean']['output']; +}; + +export type SubscriptionOptionsInput = { + /** Enables notifications for schema updates */ + schemaUpdates: Scalars['Boolean']['input']; +}; + +export enum SubscriptionState { + ACTIVE = 'ACTIVE', + CANCELED = 'CANCELED', + EXPIRED = 'EXPIRED', + FUTURE = 'FUTURE', + PAST_DUE = 'PAST_DUE', + PAUSED = 'PAUSED', + PENDING = 'PENDING', + SOFT_CANCELED = 'SOFT_CANCELED', + UNKNOWN = 'UNKNOWN' +} + +export type SupportTicket = { + __typename?: 'SupportTicket'; + /** The org id this issue belongs to */ + apolloOrgId?: Maybe; + /** The date the issue was created */ + created: Scalars['Timestamp']['output']; + /** The description of the issue */ + description: Scalars['String']['output']; + /** The graph this issue is related to */ + graph?: Maybe; + /** The id of the issue */ + id: Scalars['Int']['output']; + /** The key of the issue, ie TH-### */ + key: Scalars['String']['output']; + /** The priority of the issue. Returns P3 if null in Jira */ + priority: TicketPriority; + /** The status of the issue */ + status: TicketStatus; + /** The summary of the issue */ + summary: Scalars['String']['output']; + /** The apollo user who created this issue */ + user?: Maybe; +}; + +export type SupportTicketInput = { + apolloOrgId?: InputMaybe; + description: Scalars['String']['input']; + displayName: Scalars['String']['input']; + email: Scalars['String']['input']; + emailUsers?: InputMaybe>; + graphId?: InputMaybe; + graphType?: InputMaybe; + priority: TicketPriority; + summary: Scalars['String']['input']; +}; + +export type Survey = { + __typename?: 'Survey'; + id: Scalars['String']['output']; + isComplete: Scalars['Boolean']['output']; + questionAnswers: Array; + shouldShow: Scalars['Boolean']['output']; +}; + +export type SurveyQuestionAnswer = { + __typename?: 'SurveyQuestionAnswer'; + answerDetails?: Maybe; + answerValue?: Maybe; + questionKey: Scalars['String']['output']; +}; + +export type SurveyQuestionInput = { + answerDetails?: InputMaybe; + answerKey: Scalars['String']['input']; + answerKeyVersion?: InputMaybe; + answerValue?: InputMaybe; + questionKey: Scalars['String']['input']; + questionKeyVersion?: InputMaybe; + wasSkipped: Scalars['Boolean']['input']; +}; + +export type SyncBillingAccountResult = PermissionError | SyncBillingAccountSuccess; + +export type SyncBillingAccountSuccess = { + __typename?: 'SyncBillingAccountSuccess'; + message: Scalars['String']['output']; +}; + +/** User input for a resource share mutation */ +export type SyncPrivateSubgraphsInput = { + /** A unique identifier for the private subgraph */ + identifier: Scalars['String']['input']; + /** The cloud provider where the private subgraph is hosted */ + provider: CloudProvider; +}; + +export type TaskError = { + __typename?: 'TaskError'; + message: Scalars['String']['output']; +}; + +export type TemporaryUrl = { + __typename?: 'TemporaryURL'; + url: Scalars['String']['output']; +}; + +export type TestRouter = { + __typename?: 'TestRouter'; + id: Scalars['ID']['output']; + router?: Maybe; + status: TestRouterStatus; +}; + +/** The current state of a [`TestRouter`] */ +export enum TestRouterStatus { + /** The router has been destroyed */ + DELETED = 'DELETED', + /** The router is spinning down */ + DELETING = 'DELETING', + /** The router has entered an errored state as a result of the above */ + ERRORED = 'ERRORED', + /** The router is spinning up */ + LAUNCHING = 'LAUNCHING', + /** The router is running */ + RUNNING = 'RUNNING' +} + +export enum ThemeName { + DARK = 'DARK', + LIGHT = 'LIGHT' +} + +/** Throttle error */ +export type ThrottleError = Error & { + __typename?: 'ThrottleError'; + message: Scalars['String']['output']; + retryAfter?: Maybe; +}; + +export enum TicketPriority { + /** Note that JSM does not have P0 */ + P0 = 'P0', + P1 = 'P1', + P2 = 'P2', + P3 = 'P3', + /** Note that Zendesk does not have P4 */ + P4 = 'P4' +} + +export enum TicketStatus { + /** Canceled */ + CANCELLED = 'CANCELLED', + /** Closed */ + CLOSED = 'CLOSED', + /** Escalated */ + ESCALATED = 'ESCALATED', + /** Zendesk status hold */ + HOLD = 'HOLD', + /** In Progress */ + IN_PROGRESS = 'IN_PROGRESS', + /** Zendesk status new */ + NEW = 'NEW', + /** Zendesk status open */ + OPEN = 'OPEN', + /** Zendesk status pending */ + PENDING = 'PENDING', + /** Reopened */ + REOPENED = 'REOPENED', + /** Resolved */ + RESOLVED = 'RESOLVED', + /** Zendesk status solved */ + SOLVED = 'SOLVED', + /** Waiting for customer */ + WAITING_FOR_CUSTOMER = 'WAITING_FOR_CUSTOMER', + /** Waiting for support */ + WAITING_FOR_SUPPORT = 'WAITING_FOR_SUPPORT' +} + +/** Filter options to represent a timestamp range */ +export type TimestampFilterInput = { + /** The start of the range */ + from?: InputMaybe; + /** The end of the range */ + to?: InputMaybe; +}; + +export type TimezoneOffset = { + __typename?: 'TimezoneOffset'; + minutesOffsetFromUTC: Scalars['Int']['output']; + zoneID: Scalars['String']['output']; +}; + +export type TopNOperationsByErrorPercentageRecord = TopNOperationsRecord & { + __typename?: 'TopNOperationsByErrorPercentageRecord'; + /** A substring of the query signature for unnamed operations, otherwise the operation name. */ + displayName: Scalars['String']['output']; + errorPercentage: Scalars['Float']['output']; + /** The operation name or null if the operation is unnamed. */ + name?: Maybe; + /** The unique id for this operation. */ + queryID: Scalars['String']['output']; + type?: Maybe; +}; + +export type TopNOperationsByP95Record = TopNOperationsRecord & { + __typename?: 'TopNOperationsByP95Record'; + /** A substring of the query signature for unnamed operations, otherwise the operation name. */ + displayName: Scalars['String']['output']; + /** The operation name or null if the operation is unnamed. */ + name?: Maybe; + /** The unique id for this operation. */ + queryID: Scalars['String']['output']; + serviceTimeP95Ms: Scalars['Float']['output']; + type?: Maybe; +}; + +export type TopNOperationsByRequestRateRecord = TopNOperationsRecord & { + __typename?: 'TopNOperationsByRequestRateRecord'; + /** A substring of the query signature for unnamed operations, otherwise the operation name. */ + displayName: Scalars['String']['output']; + /** The operation name or null if the operation is unnamed. */ + name?: Maybe; + /** The unique id for this operation. */ + queryID: Scalars['String']['output']; + requestCountPerMin: Scalars['Float']['output']; + type?: Maybe; +}; + +export type TopNOperationsFilterInput = { + clientName?: InputMaybe; + clientVersion?: InputMaybe; + in?: InputMaybe; + or?: InputMaybe>; +}; + +export type TopNOperationsRecord = { + /** A substring of the query signature for unnamed operations, otherwise the operation name. */ + displayName: Scalars['String']['output']; + /** The operation name or null if the operation is unnamed. */ + name?: Maybe; + /** The unique id for this operation. */ + queryID: Scalars['String']['output']; + type?: Maybe; +}; + +export type TopNOperationsResult = { + __typename?: 'TopNOperationsResult'; + /** Top N operations by error percentage (descending). */ + byErrorPercentage: Array; + /** Top N operations by p95 latency (descending). */ + byP95: Array; + /** Top N operations by request rate (descending). */ + byRequestRate: Array; +}; + +export type TopOperationRecord = { + __typename?: 'TopOperationRecord'; + /** The graph this operation was reported from. */ + graphId: Scalars['String']['output']; + /** The graph variant this operation was reported from. */ + graphVariant: Scalars['String']['output']; + /** The operation name or null if the operation is unnamed. */ + name?: Maybe; + /** The unique id for this operation. */ + operationId: Scalars['String']['output']; + /** The total number of requests for this operation for the specified time range. */ + requestCount: Scalars['Long']['output']; + /** The operation's signature body or null if the signature is unavailable due to parse errors. */ + signature?: Maybe; + /** The operation type or null if the operation type could not be determined from the signature. */ + type?: Maybe; +}; + +export enum TopOperationsReportOrderByColumn { + REQUEST_COUNT = 'REQUEST_COUNT' +} + +export type TopOperationsReportOrderByInput = { + /** The order column used for the operation results. Defaults to ordering by total request count. */ + column: TopOperationsReportOrderByColumn; + /** The direction used to order operation results. Defaults to descending order. */ + direction: Ordering; +}; + +export type TopOperationsReportVariantFilterInInput = { + clientName?: InputMaybe>>; + clientVersion?: InputMaybe>>; +}; + +export type TopOperationsReportVariantFilterInput = { + in: TopOperationsReportVariantFilterInInput; +}; + +/** Counts of changes. */ +export type TotalChangeSummaryCounts = { + __typename?: 'TotalChangeSummaryCounts'; + /** + * Number of changes that are additions. This includes adding types, adding fields to object, input + * object, and interface types, adding values to enums, adding members to interfaces and unions, and + * adding arguments. + */ + additions: Scalars['Int']['output']; + /** Number of changes that are new usages of the @deprecated directive. */ + deprecations: Scalars['Int']['output']; + /** + * Number of changes that are edits. This includes types changing kind, fields and arguments + * changing type, arguments changing default value, and any description changes. This also includes + * edits to @deprecated reason strings. + */ + edits: Scalars['Int']['output']; + /** + * Number of changes that are removals. This includes removing types, removing fields from object, + * input object, and interface types, removing values from enums, removing members from interfaces + * and unions, and removing arguments. This also includes removing @deprecated usages. + */ + removals: Scalars['Int']['output']; +}; + +export type Trace = { + __typename?: 'Trace'; + agentVersion?: Maybe; + cacheMaxAgeMs?: Maybe; + cacheScope?: Maybe; + clientName?: Maybe; + clientVersion?: Maybe; + durationMs: Scalars['Float']['output']; + endTime: Scalars['Timestamp']['output']; + http?: Maybe; + id: Scalars['ID']['output']; + /** + * True if the report containing the trace was submitted as potentially incomplete, which can happen if the Router's + * trace buffer fills up while constructing the trace. If this is true, the trace might be missing some nodes. + */ + isIncomplete: Scalars['Boolean']['output']; + operationName?: Maybe; + protobuf: Protobuf; + root: TraceNode; + signature: Scalars['String']['output']; + startTime: Scalars['Timestamp']['output']; + unexecutedOperationBody?: Maybe; + unexecutedOperationName?: Maybe; + variablesJSON: Array; +}; + +export type TraceError = { + __typename?: 'TraceError'; + errorCode?: Maybe; + errorService?: Maybe; + json: Scalars['String']['output']; + locations: Array; + message: Scalars['String']['output']; + timestamp?: Maybe; +}; + +export type TraceHttp = { + __typename?: 'TraceHTTP'; + method: HttpMethod; + requestHeaders: Array; + responseHeaders: Array; + statusCode: Scalars['Int']['output']; +}; + +export type TraceNode = { + __typename?: 'TraceNode'; + /** Additional metadata for the node, presented in key-value pairs. */ + attributes: Array; + cacheMaxAgeMs?: Maybe; + cacheScope?: Maybe; + /** The total number of children, including the ones that were truncated. */ + childCount: Scalars['Int']['output']; + /** Whether the children of this node have been truncated because the number of children is over the max. */ + childrenAreTruncated: Scalars['Boolean']['output']; + /** + * All children, and the children of those children, and so on. Children that have been truncated + * are not included. + */ + descendants: Array; + /** + * The end time of the node. If this is a fetch node (meaning isFetch is true), this will be the + * time that the gateway/router received the response from the subgraph server in the + * gateway/routers clock time. + */ + endTime: Scalars['Timestamp']['output']; + errors: Array; + id: Scalars['ID']['output']; + /** + * Whether the fetch node in question is a descendent of a Deferred node in the trace's query plan. The nodes + * in query plans can be complicated and nested, so this is a fairly simple representation of the structure. + */ + isDeferredFetch: Scalars['Boolean']['output']; + /** + * Whether the node in question represents a fetch node within a query plan. If so, this will contain + * children with timestamps that are calculated by the router/gateway rather than subgraph and the + * fields subgraphStartTime and subgraphEndTime will be non-null. + */ + isFetch: Scalars['Boolean']['output']; + key?: Maybe; + /** A classification which helps to differentiate between types of nodes (intended for display / filtering purposes). */ + kind: TraceNodeKind; + originalFieldName?: Maybe; + parentId?: Maybe; + /** + * If the node is a field resolver, the field's parent type; e.g. "User" for User.email + * otherwise null. + */ + parentType?: Maybe; + /** + * The start time of the node. If this is a fetch node (meaning isFetch is true), this will be the + * time that the gateway/router sent the request to the subgraph server in the gateway/router's clock + * time. + */ + startTime: Scalars['Timestamp']['output']; + /** + * Only present when the node in question is a fetch node, this will indicate the timestamp at which + * the subgraph server returned a response to the gateway/router. This timestamp is based on the + * subgraph server's clock, so if there is a clock skew between the subgraph and the gateway/router, + * this and endTime will not be in sync. If this is a fetch node but we don't receive subgraph traces + * (e.g. if the subgraph doesn't support federated traces), this value will be null. + */ + subgraphEndTime?: Maybe; + /** If present, indicates the subgraph context a node is associated with. */ + subgraphName?: Maybe; + /** + * Only present when the node in question is a fetch node, this will indicate the timestamp at which + * the fetch was received by the subgraph server. This timestamp is based on the subgraph server's + * clock, so if there is a clock skew between the subgraph and the gateway/router, this and startTime + * will not be in sync. If this is a fetch node but we don't receive subgraph traces (e.g. if the + * subgraph doesn't support federated traces), this value will be null. + */ + subgraphStartTime?: Maybe; + /** + * If the node is a field resolver, the field's return type; e.g. "String!" for User.email:String! + * otherwise an empty string. + */ + type?: Maybe; +}; + +export enum TraceNodeKind { + ARRAY_INDEX_RESOLVER = 'ARRAY_INDEX_RESOLVER', + FIELD_RESOLVER = 'FIELD_RESOLVER', + REQUEST = 'REQUEST', + ROUTER_INTERNAL = 'ROUTER_INTERNAL', + SUBGRAPH_REQUEST = 'SUBGRAPH_REQUEST', + USER_PLUGIN = 'USER_PLUGIN' +} + +/** Columns of TracePathErrorsRefs. */ +export enum TracePathErrorsRefsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + DURATION_BUCKET = 'DURATION_BUCKET', + ERRORS_COUNT_IN_PATH = 'ERRORS_COUNT_IN_PATH', + ERRORS_COUNT_IN_TRACE = 'ERRORS_COUNT_IN_TRACE', + ERROR_CODE = 'ERROR_CODE', + ERROR_MESSAGE = 'ERROR_MESSAGE', + ERROR_SERVICE = 'ERROR_SERVICE', + PATH = 'PATH', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + TRACE_HTTP_STATUS_CODE = 'TRACE_HTTP_STATUS_CODE', + TRACE_ID = 'TRACE_ID', + TRACE_SIZE_BYTES = 'TRACE_SIZE_BYTES', + TRACE_STARTS_AT = 'TRACE_STARTS_AT' +} + +export type TracePathErrorsRefsDimensions = { + __typename?: 'TracePathErrorsRefsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + durationBucket?: Maybe; + errorCode?: Maybe; + errorMessage?: Maybe; + errorService?: Maybe; + /** If metrics were collected from a federated service, this field will be prefixed with `service:.` */ + path?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + traceHttpStatusCode?: Maybe; + traceId?: Maybe; + traceStartsAt?: Maybe; +}; + +/** Filter for data in TracePathErrorsRefs. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type TracePathErrorsRefsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose durationBucket dimension equals the given value if not null. To query for the null value, use {in: {durationBucket: [null]}} instead. */ + durationBucket?: InputMaybe; + /** Selects rows whose errorCode dimension equals the given value if not null. To query for the null value, use {in: {errorCode: [null]}} instead. */ + errorCode?: InputMaybe; + /** Selects rows whose errorMessage dimension equals the given value if not null. To query for the null value, use {in: {errorMessage: [null]}} instead. */ + errorMessage?: InputMaybe; + /** Selects rows whose errorService dimension equals the given value if not null. To query for the null value, use {in: {errorService: [null]}} instead. */ + errorService?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose path dimension equals the given value if not null. To query for the null value, use {in: {path: [null]}} instead. */ + path?: InputMaybe; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose traceHttpStatusCode dimension equals the given value if not null. To query for the null value, use {in: {traceHttpStatusCode: [null]}} instead. */ + traceHttpStatusCode?: InputMaybe; + /** Selects rows whose traceId dimension equals the given value if not null. To query for the null value, use {in: {traceId: [null]}} instead. */ + traceId?: InputMaybe; +}; + +/** Filter for data in TracePathErrorsRefs. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type TracePathErrorsRefsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose durationBucket dimension is in the given list. A null value in the list means a row with null for that dimension. */ + durationBucket?: InputMaybe>>; + /** Selects rows whose errorCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorCode?: InputMaybe>>; + /** Selects rows whose errorMessage dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorMessage?: InputMaybe>>; + /** Selects rows whose errorService dimension is in the given list. A null value in the list means a row with null for that dimension. */ + errorService?: InputMaybe>>; + /** Selects rows whose path dimension is in the given list. A null value in the list means a row with null for that dimension. */ + path?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose traceHttpStatusCode dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceHttpStatusCode?: InputMaybe>>; + /** Selects rows whose traceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceId?: InputMaybe>>; +}; + +export type TracePathErrorsRefsMetrics = { + __typename?: 'TracePathErrorsRefsMetrics'; + errorsCountInPath: Scalars['Long']['output']; + errorsCountInTrace: Scalars['Long']['output']; + traceSizeBytes: Scalars['Long']['output']; +}; + +export type TracePathErrorsRefsOrderBySpec = { + column: TracePathErrorsRefsColumn; + direction: Ordering; +}; + +export type TracePathErrorsRefsRecord = { + __typename?: 'TracePathErrorsRefsRecord'; + /** Dimensions of TracePathErrorsRefs that can be grouped by. */ + groupBy: TracePathErrorsRefsDimensions; + /** Metrics of TracePathErrorsRefs that can be aggregated over. */ + metrics: TracePathErrorsRefsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +/** Columns of TraceRefs. */ +export enum TraceRefsColumn { + CLIENT_NAME = 'CLIENT_NAME', + CLIENT_VERSION = 'CLIENT_VERSION', + DURATION_BUCKET = 'DURATION_BUCKET', + OPERATION_SUBTYPE = 'OPERATION_SUBTYPE', + OPERATION_TYPE = 'OPERATION_TYPE', + QUERY_ID = 'QUERY_ID', + QUERY_NAME = 'QUERY_NAME', + SCHEMA_HASH = 'SCHEMA_HASH', + SCHEMA_TAG = 'SCHEMA_TAG', + SERVICE_ID = 'SERVICE_ID', + TIMESTAMP = 'TIMESTAMP', + TRACE_COUNT = 'TRACE_COUNT', + TRACE_ID = 'TRACE_ID' +} + +export type TraceRefsDimensions = { + __typename?: 'TraceRefsDimensions'; + clientName?: Maybe; + clientVersion?: Maybe; + durationBucket?: Maybe; + generatedTraceId?: Maybe; + operationSubtype?: Maybe; + operationType?: Maybe; + queryId?: Maybe; + queryName?: Maybe; + querySignature?: Maybe; + schemaHash?: Maybe; + schemaTag?: Maybe; + serviceId?: Maybe; + traceId?: Maybe; +}; + +/** Filter for data in TraceRefs. Fields with dimension names represent equality checks. All fields are implicitly ANDed together. */ +export type TraceRefsFilter = { + and?: InputMaybe>; + /** Selects rows whose clientName dimension equals the given value if not null. To query for the null value, use {in: {clientName: [null]}} instead. */ + clientName?: InputMaybe; + /** Selects rows whose clientVersion dimension equals the given value if not null. To query for the null value, use {in: {clientVersion: [null]}} instead. */ + clientVersion?: InputMaybe; + /** Selects rows whose durationBucket dimension equals the given value if not null. To query for the null value, use {in: {durationBucket: [null]}} instead. */ + durationBucket?: InputMaybe; + in?: InputMaybe; + not?: InputMaybe; + /** Selects rows whose operationSubtype dimension equals the given value if not null. To query for the null value, use {in: {operationSubtype: [null]}} instead. */ + operationSubtype?: InputMaybe; + /** Selects rows whose operationType dimension equals the given value if not null. To query for the null value, use {in: {operationType: [null]}} instead. */ + operationType?: InputMaybe; + or?: InputMaybe>; + /** Selects rows whose queryId dimension equals the given value if not null. To query for the null value, use {in: {queryId: [null]}} instead. */ + queryId?: InputMaybe; + /** Selects rows whose queryName dimension equals the given value if not null. To query for the null value, use {in: {queryName: [null]}} instead. */ + queryName?: InputMaybe; + /** Selects rows whose schemaHash dimension equals the given value if not null. To query for the null value, use {in: {schemaHash: [null]}} instead. */ + schemaHash?: InputMaybe; + /** Selects rows whose schemaTag dimension equals the given value if not null. To query for the null value, use {in: {schemaTag: [null]}} instead. */ + schemaTag?: InputMaybe; + /** Selects rows whose serviceId dimension equals the given value if not null. To query for the null value, use {in: {serviceId: [null]}} instead. */ + serviceId?: InputMaybe; + /** Selects rows whose traceId dimension equals the given value if not null. To query for the null value, use {in: {traceId: [null]}} instead. */ + traceId?: InputMaybe; +}; + +/** Filter for data in TraceRefs. Fields match if the corresponding dimension's value is in the given list. All fields are implicitly ANDed together. */ +export type TraceRefsFilterIn = { + /** Selects rows whose clientName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientName?: InputMaybe>>; + /** Selects rows whose clientVersion dimension is in the given list. A null value in the list means a row with null for that dimension. */ + clientVersion?: InputMaybe>>; + /** Selects rows whose durationBucket dimension is in the given list. A null value in the list means a row with null for that dimension. */ + durationBucket?: InputMaybe>>; + /** Selects rows whose operationSubtype dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationSubtype?: InputMaybe>>; + /** Selects rows whose operationType dimension is in the given list. A null value in the list means a row with null for that dimension. */ + operationType?: InputMaybe>>; + /** Selects rows whose queryId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryId?: InputMaybe>>; + /** Selects rows whose queryName dimension is in the given list. A null value in the list means a row with null for that dimension. */ + queryName?: InputMaybe>>; + /** Selects rows whose schemaHash dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaHash?: InputMaybe>>; + /** Selects rows whose schemaTag dimension is in the given list. A null value in the list means a row with null for that dimension. */ + schemaTag?: InputMaybe>>; + /** Selects rows whose serviceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + serviceId?: InputMaybe>>; + /** Selects rows whose traceId dimension is in the given list. A null value in the list means a row with null for that dimension. */ + traceId?: InputMaybe>>; +}; + +export type TraceRefsMetrics = { + __typename?: 'TraceRefsMetrics'; + traceCount: Scalars['Long']['output']; +}; + +export type TraceRefsOrderBySpec = { + column: TraceRefsColumn; + direction: Ordering; +}; + +export type TraceRefsRecord = { + __typename?: 'TraceRefsRecord'; + /** Dimensions of TraceRefs that can be grouped by. */ + groupBy: TraceRefsDimensions; + /** Metrics of TraceRefs that can be aggregated over. */ + metrics: TraceRefsMetrics; + /** Starting segment timestamp. */ + timestamp: Scalars['Timestamp']['output']; +}; + +export type TraceSourceLocation = { + __typename?: 'TraceSourceLocation'; + column: Scalars['Int']['output']; + line: Scalars['Int']['output']; +}; + +/** Counts of changes at the type level, including interfaces, unions, enums, scalars, input objects, etc. */ +export type TypeChangeSummaryCounts = { + __typename?: 'TypeChangeSummaryCounts'; + /** Number of changes that are additions of types. */ + additions: Scalars['Int']['output']; + /** + * Number of changes that are edits. This includes types changing kind and any type description + * changes, but also includes adding/removing values from enums, adding/removing members from + * interfaces and unions, and any enum value deprecation and description changes. + */ + edits: Scalars['Int']['output']; + /** Number of changes that are removals of types. */ + removals: Scalars['Int']['output']; +}; + +/** + * the TypeFilterConfig is used to isolate + * types, and subsequent fields, through + * various configuration settings. + * + * It defaults to filter towards user defined + * types only + */ +export type TypeFilterConfig = { + /** include abstract types (interfaces and unions) */ + includeAbstractTypes?: InputMaybe; + /** include built in scalars (i.e. Boolean, Int, etc) */ + includeBuiltInTypes?: InputMaybe; + /** include reserved introspection types (i.e. __Type) */ + includeIntrospectionTypes?: InputMaybe; +}; + +export type Uri = { + __typename?: 'URI'; + /** A GCS URI */ + gcs: Scalars['String']['output']; +}; + +export type UnignoreOperationsInChecksResult = { + __typename?: 'UnignoreOperationsInChecksResult'; + graph: Service; +}; + +export type UnlinkPersistedQueryListResult = { + __typename?: 'UnlinkPersistedQueryListResult'; + graphVariant: GraphVariant; + unlinkedPersistedQueryList: PersistedQueryList; +}; + +/** The result/error union returned by GraphVariantMutation.unlinkPersistedQueryList. */ +export type UnlinkPersistedQueryListResultOrError = PermissionError | UnlinkPersistedQueryListResult | VariantAlreadyUnlinkedError; + +/** Input to update an AWS shard */ +export type UpdateAwsShardInput = { + accountId?: InputMaybe; + coldStartTargetGroupArns?: InputMaybe>; + ecsClusterArn?: InputMaybe; + iamRoleArn?: InputMaybe; + loadbalancerSecurityGroupId?: InputMaybe; + loadbalancers?: InputMaybe>; + permissionsBoundaryArn?: InputMaybe; + region?: InputMaybe; + subnetIds?: InputMaybe>; + vpcId?: InputMaybe; +}; + +export type UpdateBillingPlanDescriptorsInput = { + description?: InputMaybe; + name?: InputMaybe; + readableId?: InputMaybe; +}; + +export type UpdateBillingPlanInput = { + billingModel: BillingModel; + clientVersions?: InputMaybe; + clients?: InputMaybe; + contracts?: InputMaybe; + datadog?: InputMaybe; + errors: Scalars['Boolean']['input']; + federation?: InputMaybe; + intervalLength: Scalars['Int']['input']; + intervalUnit: Scalars['String']['input']; + kind: BillingPlanKind; + launches?: InputMaybe; + maxAuditInDays?: InputMaybe; + maxRangeInDays?: InputMaybe; + maxSelfHostedRequestsPerMonth?: InputMaybe; + metrics?: InputMaybe; + notifications?: InputMaybe; + operationRegistry?: InputMaybe; + persistedQueries?: InputMaybe; + proposals?: InputMaybe; + public: Scalars['Boolean']['input']; + schemaValidation?: InputMaybe; + sso?: InputMaybe; + traces?: InputMaybe; + userRoles?: InputMaybe; + webhooks?: InputMaybe; +}; + +/** Input to update a proposal description */ +export type UpdateDescriptionInput = { + /** A proposal description */ + description: Scalars['String']['input']; +}; + +export type UpdateOperationCollectionEntryResult = OperationCollectionEntry | PermissionError | ValidationError; + +export type UpdateOperationCollectionResult = OperationCollection | PermissionError | ValidationError; + +export type UpdatePaymentMethodResult = Account | NotFoundError | PermissionError | UpdatePaymentMethodSuccess; + +export type UpdatePaymentMethodSuccess = { + __typename?: 'UpdatePaymentMethodSuccess'; + paymentMethodId: Scalars['String']['output']; +}; + +/** The result of a successful call to PersistedQueryListMutation.updateMetadata. */ +export type UpdatePersistedQueryListMetadataResult = { + __typename?: 'UpdatePersistedQueryListMetadataResult'; + persistedQueryList: PersistedQueryList; +}; + +/** The result/error union returned by PersistedQueryListMutation.updateMetadata. */ +export type UpdatePersistedQueryListMetadataResultOrError = PermissionError | UpdatePersistedQueryListMetadataResult; + +export type UpdateProposalLifecycleSubscriptionInput = { + events: Array; + id: Scalars['ID']['input']; +}; + +export type UpdateProposalLifecycleSubscriptionResult = NotFoundError | PermissionError | ProposalLifecycleSubscription | ValidationError; + +export type UpdateProposalResult = PermissionError | Proposal | ValidationError; + +export type UpdateRequestedReviewersInput = { + reviewerUserIdsToAdd?: InputMaybe>; + reviewerUserIdsToRemove?: InputMaybe>; +}; + +export type UpdateRequestedReviewersResult = PermissionError | Proposal | ValidationError; + +/** Input for updating a Cloud Router */ +export type UpdateRouterInput = { + /** + * Number of GCUs allocated for the Cloud Router + * + * This is ignored for serverless Cloud Routers + */ + gcus?: InputMaybe; + /** Graph composition ID, also known as launch ID */ + graphCompositionId?: InputMaybe; + /** Unique identifier for ordering orders */ + orderingId: Scalars['String']['input']; + /** Configuration for the Cloud Router */ + routerConfig?: InputMaybe; + /** Router version for the Cloud Router */ + routerVersion?: InputMaybe; +}; + +/** Represents the possible outcomes of an updateRouter mutation */ +export type UpdateRouterResult = InternalServerError | InvalidInputErrors | UpdateRouterSuccess; + +/** + * Success branch of an updateRouter mutation. + * id of the order can be polled via Query.cloud().order(id: ID!) to check-in + * on the progress of the underlying operation + */ +export type UpdateRouterSuccess = { + __typename?: 'UpdateRouterSuccess'; + order: Order; +}; + +/** Result of an updateVersion mutation */ +export type UpdateRouterVersionResult = InternalServerError | InvalidInputErrors | RouterVersion; + +export type UpdateRuleEnforcementInput = { + /** A json string representing any parameters necessary for the policy's enforcement. Explicit null setting is allowed. */ + params?: InputMaybe>; +}; + +/** Input to update an existing Shard */ +export type UpdateShardInput = { + aws?: InputMaybe; + gcuCapacity?: InputMaybe; + gcuUsage?: InputMaybe; + reason?: InputMaybe; + routerCapacity?: InputMaybe; + routerUsage?: InputMaybe; + shardId: Scalars['String']['input']; + status?: InputMaybe; +}; + +/** Describes the result of publishing a schema to a graph variant. */ +export type UploadSchemaMutationResponse = { + __typename?: 'UploadSchemaMutationResponse'; + /** A machine-readable response code that indicates the type of result (e.g., `UPLOAD_SUCCESS` or `NO_CHANGES`) */ + code: Scalars['String']['output']; + /** A Human-readable message describing the type of result. */ + message: Scalars['String']['output']; + /** If the publish operation succeeded, this contains its details. Otherwise, this is null. */ + publication?: Maybe; + /** Whether the schema publish operation succeeded (`true`) or encountered errors (`false`). */ + success: Scalars['Boolean']['output']; + /** If successful, the corresponding publication. */ + tag?: Maybe; +}; + +export type UpsertReviewInput = { + comment?: InputMaybe; + decision: ReviewDecision; + revisionId: Scalars['ID']['input']; +}; + +export type UpsertReviewResult = PermissionError | Proposal | ValidationError; + +export type UpsertRouterResult = GraphVariant | RouterUpsertFailure; + +/** A registered Apollo Studio user. */ +export type User = Identity & { + __typename?: 'User'; + acceptedPrivacyPolicyAt?: Maybe; + /** Returns a list of all active user API keys for the user. */ + apiKeys: Array; + /** Returns a representation of this user as an `Actor` type. Useful when determining which actor (usually a `User` or `Graph`) performed a particular action in Studio. */ + asActor: Actor; + /** + * Get an URL to which an avatar image can be uploaded. Client uploads by sending a PUT request + * with the image data to MediaUploadInfo.url. Client SHOULD set the "Content-Type" header to the + * browser-inferred MIME type, and SHOULD set the "x-apollo-content-filename" header to the + * filename, if such information is available. Client MUST set the "x-apollo-csrf-token" header to + * MediaUploadInfo.csrfToken. + */ + avatarUpload?: Maybe; + /** + * Get an image URL for the user's avatar. Note that CORS is not enabled for these URLs. The size + * argument is used for bandwidth reduction, and should be the size of the image as displayed in the + * application. Apollo's media server will downscale larger images to at least the requested size, + * but this will not happen for third-party media servers. + */ + avatarUrl?: Maybe; + betaFeaturesOn: Scalars['Boolean']['output']; + canUpdateAvatar: Scalars['Boolean']['output']; + canUpdateEmail: Scalars['Boolean']['output']; + canUpdateFullName: Scalars['Boolean']['output']; + createdAt: Scalars['Timestamp']['output']; + education?: Maybe; + email?: Maybe; + emailModifiedAt?: Maybe; + emailVerified: Scalars['Boolean']['output']; + featureIntros?: Maybe; + fullName: Scalars['String']['output']; + /** The user's GitHub username, if they log in via GitHub. May be null even for GitHub users in some edge cases. */ + githubUsername?: Maybe; + /** The user's unique ID. */ + id: Scalars['ID']['output']; + /** + * This role is reserved exclusively for internal Apollo employees, and it controls what access they may have to other + * organizations. Only admins are allowed to see this field. + */ + internalAdminRole?: Maybe; + /** Whether or not this user is and internal Apollo employee */ + isInternalUser: Scalars['Boolean']['output']; + isSsoV2: Scalars['Boolean']['output']; + /** Last time any API token from this user was used against AGM services */ + lastAuthenticatedAt?: Maybe; + loginFlowSource?: Maybe; + logoutAfterIdleMs?: Maybe; + /** A list of the user's memberships in Apollo Studio organizations. */ + memberships: Array; + /** The user's first and last name. */ + name: Scalars['String']['output']; + odysseyAttempt?: Maybe; + odysseyAttempts?: Maybe>; + odysseyCertification?: Maybe; + odysseyCertifications: Array; + odysseyCourse?: Maybe; + odysseyCourses?: Maybe>; + /** @deprecated Unused. Remove from application usage */ + odysseyHasEarlyAccess: Scalars['Boolean']['output']; + /** @deprecated Unused. Remove from application usage */ + odysseyHasRequestedEarlyAccess: Scalars['Boolean']['output']; + odysseyTasks?: Maybe>; + sandboxOperationCollections: Array; + /** List of support tickets this user has submitted */ + supportTickets?: Maybe>; + synchronized: Scalars['Boolean']['output']; + type: UserType; +}; + + +/** A registered Apollo Studio user. */ +export type UserApiKeysArgs = { + includeCookies?: InputMaybe; +}; + + +/** A registered Apollo Studio user. */ +export type UserAvatarUrlArgs = { + size?: Scalars['Int']['input']; +}; + + +/** A registered Apollo Studio user. */ +export type UserOdysseyAttemptArgs = { + id: Scalars['ID']['input']; +}; + + +/** A registered Apollo Studio user. */ +export type UserOdysseyCertificationArgs = { + certificationId: Scalars['ID']['input']; +}; + + +/** A registered Apollo Studio user. */ +export type UserOdysseyCourseArgs = { + courseId: Scalars['ID']['input']; +}; + + +/** A registered Apollo Studio user. */ +export type UserOdysseyTasksArgs = { + in?: InputMaybe>; +}; + +/** + * Represents a user API key, which has permissions identical to + * its associated Apollo user. + */ +export type UserApiKey = ApiKey & { + __typename?: 'UserApiKey'; + /** The API key's ID. */ + id: Scalars['ID']['output']; + /** The API key's name, for distinguishing it from other keys. */ + keyName?: Maybe; + /** The value of the API key. **This is a secret credential!** */ + token: Scalars['String']['output']; +}; + +/** A single user's membership in a single Apollo Studio organization. */ +export type UserMembership = { + __typename?: 'UserMembership'; + /** The organization that the user belongs to. */ + account: Account; + /** The timestamp when the user was added to the organization. */ + createdAt: Scalars['Timestamp']['output']; + /** + * The user's permission level within the organization. + * @deprecated Use role instead. + */ + permission: UserPermission; + /** The user's role within the organization'. */ + role: UserPermission; + /** The user that belongs to the organization. */ + user: User; +}; + +export type UserMutation = { + __typename?: 'UserMutation'; + acceptPrivacyPolicy?: Maybe; + /** Change the user's password */ + changePassword?: Maybe; + completeOdysseyAttempt?: Maybe; + createOdysseyAttempt?: Maybe; + createOdysseyCertification?: Maybe; + createOdysseyCourses?: Maybe>; + createOdysseyTasks?: Maybe>; + /** Delete the user's avatar. Requires User.canUpdateAvatar to be true. */ + deleteAvatar?: Maybe; + deleteOdysseyAttempt?: Maybe; + deleteOdysseyCertification?: Maybe; + deleteOdysseyCourse?: Maybe; + deleteOdysseyTasks: Array>; + /** Hard deletes the associated user. Throws an error otherwise with reason included. */ + hardDelete?: Maybe; + /** Creates a new user API key for this user. */ + newKey: UserApiKey; + /** + * If this user has no active user API keys, this creates one for the user. + * If this user has at least one active user API key, this returns one of those keys at random and does _not_ create a new key. + */ + provisionKey?: Maybe; + /** Refresh information about the user from its upstream service (e.g. list of organizations from GitHub) */ + refresh?: Maybe; + /** Deletes the user API key with the provided ID, if any. */ + removeKey?: Maybe; + /** Sets a new name for the user API key with the provided ID, if any. This does not invalidate the key or change its value. */ + renameKey?: Maybe; + resendVerificationEmail?: Maybe; + setOdysseyCourse?: Maybe; + setOdysseyCourseLanguage: OdysseyCourse; + setOdysseyResponse?: Maybe; + setOdysseyTask?: Maybe; + /** Submit a support ticket for this user */ + submitSupportTicket?: Maybe; + /** Update information about a user; all arguments are optional */ + update?: Maybe; + /** Updates this users' preference concerning opting into beta features. */ + updateBetaFeaturesOn?: Maybe; + /** Update the status of a feature for this. For example, if you want to hide an introductory popup. */ + updateFeatureIntros?: Maybe; + updateOdysseyAttempt?: Maybe; + /** + * Update user to have the given internal mdg admin role. + * It is necessary to be an MDG_INTERNAL_SUPER_ADMIN to perform update. + * Additionally, upserting a null value explicitly revokes this user's + * admin status. + */ + updateRole?: Maybe; + user: User; + verifyEmail?: Maybe; +}; + + +export type UserMutationChangePasswordArgs = { + newPassword: Scalars['String']['input']; + previousPassword: Scalars['String']['input']; +}; + + +export type UserMutationCompleteOdysseyAttemptArgs = { + id: Scalars['ID']['input']; + pass: Scalars['Boolean']['input']; + responses: Array; +}; + + +export type UserMutationCreateOdysseyAttemptArgs = { + testId: Scalars['String']['input']; +}; + + +export type UserMutationCreateOdysseyCertificationArgs = { + certificationId: Scalars['String']['input']; + source?: InputMaybe; +}; + + +export type UserMutationCreateOdysseyCoursesArgs = { + courses: Array; +}; + + +export type UserMutationCreateOdysseyTasksArgs = { + tasks: Array; +}; + + +export type UserMutationDeleteOdysseyAttemptArgs = { + id: Scalars['ID']['input']; +}; + + +export type UserMutationDeleteOdysseyCertificationArgs = { + id: Scalars['ID']['input']; +}; + + +export type UserMutationDeleteOdysseyCourseArgs = { + courseId: Scalars['String']['input']; +}; + + +export type UserMutationDeleteOdysseyTasksArgs = { + taskIds: Array; +}; + + +export type UserMutationNewKeyArgs = { + keyName: Scalars['String']['input']; +}; + + +export type UserMutationProvisionKeyArgs = { + keyName?: Scalars['String']['input']; +}; + + +export type UserMutationRemoveKeyArgs = { + id: Scalars['ID']['input']; +}; + + +export type UserMutationRenameKeyArgs = { + id: Scalars['ID']['input']; + newKeyName?: InputMaybe; +}; + + +export type UserMutationSetOdysseyCourseArgs = { + course: OdysseyCourseInput; +}; + + +export type UserMutationSetOdysseyCourseLanguageArgs = { + courseId: Scalars['ID']['input']; + language: Scalars['String']['input']; +}; + + +export type UserMutationSetOdysseyResponseArgs = { + response: OdysseyResponseInput; +}; + + +export type UserMutationSetOdysseyTaskArgs = { + courseId?: InputMaybe; + courseLanguage?: InputMaybe; + task: OdysseyTaskInput; +}; + + +export type UserMutationSubmitSupportTicketArgs = { + ticket: SupportTicketInput; +}; + + +export type UserMutationUpdateArgs = { + email?: InputMaybe; + fullName?: InputMaybe; + referrer?: InputMaybe; + trackingGoogleClientId?: InputMaybe; + trackingMarketoClientId?: InputMaybe; + userSegment?: InputMaybe; + utmCampaign?: InputMaybe; + utmMedium?: InputMaybe; + utmSource?: InputMaybe; +}; + + +export type UserMutationUpdateBetaFeaturesOnArgs = { + betaFeaturesOn: Scalars['Boolean']['input']; +}; + + +export type UserMutationUpdateFeatureIntrosArgs = { + newFeatureIntros?: InputMaybe; +}; + + +export type UserMutationUpdateOdysseyAttemptArgs = { + completedAt?: InputMaybe; + id: Scalars['ID']['input']; + pass?: InputMaybe; +}; + + +export type UserMutationUpdateRoleArgs = { + newRole?: InputMaybe; +}; + + +export type UserMutationVerifyEmailArgs = { + token: Scalars['String']['input']; +}; + +export enum UserPermission { + BILLING_MANAGER = 'BILLING_MANAGER', + CONSUMER = 'CONSUMER', + CONTRIBUTOR = 'CONTRIBUTOR', + DOCUMENTER = 'DOCUMENTER', + GRAPH_ADMIN = 'GRAPH_ADMIN', + LEGACY_GRAPH_KEY = 'LEGACY_GRAPH_KEY', + OBSERVER = 'OBSERVER', + ORG_ADMIN = 'ORG_ADMIN', + PERSISTED_QUERY_PUBLISHER = 'PERSISTED_QUERY_PUBLISHER' +} + +export enum UserSegment { + JOIN_MY_TEAM = 'JOIN_MY_TEAM', + LOCAL_DEVELOPMENT = 'LOCAL_DEVELOPMENT', + NOT_SPECIFIED = 'NOT_SPECIFIED', + ODYSSEY = 'ODYSSEY', + PRODUCTION_GRAPHS = 'PRODUCTION_GRAPHS', + SANDBOX = 'SANDBOX', + SANDBOX_OPERATION_COLLECTIONS = 'SANDBOX_OPERATION_COLLECTIONS', + SANDBOX_PREFLIGHT_SCRIPTS = 'SANDBOX_PREFLIGHT_SCRIPTS', + TRY_TEAM = 'TRY_TEAM' +} + +export type UserSettings = { + __typename?: 'UserSettings'; + appNavCollapsed: Scalars['Boolean']['output']; + autoManageVariables: Scalars['Boolean']['output']; + id: Scalars['String']['output']; + mockingResponses: Scalars['Boolean']['output']; + preflightScriptEnabled: Scalars['Boolean']['output']; + responseHints: ResponseHints; + tableMode: Scalars['Boolean']['output']; + themeName: ThemeName; +}; + +/** Explorer user settings input */ +export type UserSettingsInput = { + appNavCollapsed?: InputMaybe; + autoManageVariables?: InputMaybe; + mockingResponses?: InputMaybe; + preflightScriptEnabled?: InputMaybe; + responseHints?: InputMaybe; + tableMode?: InputMaybe; + themeName?: InputMaybe; +}; + +export type UserTrackingInput = { + referrer?: InputMaybe; + referrerDetails?: InputMaybe; + sessionReferrer?: InputMaybe; + sessionReferrerCreatedAt?: InputMaybe; + sessionReferrerDetail?: InputMaybe; + trackingGoogleClientId?: InputMaybe; + trackingMarketoClientId?: InputMaybe; + userSegment?: InputMaybe; + utmCampaign?: InputMaybe; + utmMedium?: InputMaybe; + utmSource?: InputMaybe; +}; + +export enum UserType { + APOLLO = 'APOLLO', + GITHUB = 'GITHUB', + SSO = 'SSO' +} + +export type ValidateOperationsResult = { + __typename?: 'ValidateOperationsResult'; + validationResults: Array; +}; + +/** An error that occurs when an operation contains invalid user input. */ +export type ValidationError = Error & { + __typename?: 'ValidationError'; + /** The error's details. */ + message: Scalars['String']['output']; +}; + +export enum ValidationErrorCode { + DEPRECATED_FIELD = 'DEPRECATED_FIELD', + INVALID_OPERATION = 'INVALID_OPERATION', + NON_PARSEABLE_DOCUMENT = 'NON_PARSEABLE_DOCUMENT' +} + +export enum ValidationErrorType { + FAILURE = 'FAILURE', + INVALID = 'INVALID', + WARNING = 'WARNING' +} + +/** + * Represents a single validation error, with information relating to the error + * and its respective operation + */ +export type ValidationResult = { + __typename?: 'ValidationResult'; + /** The validation result's error code */ + code: ValidationErrorCode; + /** Description of the validation error */ + description: Scalars['String']['output']; + /** The operation related to this validation result */ + operation: OperationDocument; + /** The type of validation error thrown - warning, failure, or invalid. */ + type: ValidationErrorType; +}; + +/** The result of a failed call to GraphVariantMutation.linkPersistedQueryList when the specified list is already linked. */ +export type VariantAlreadyLinkedError = Error & { + __typename?: 'VariantAlreadyLinkedError'; + message: Scalars['String']['output']; +}; + +/** The result of a failed call to GraphVariantMutation.unlinkPersistedQueryList when the specified list isn't linked. */ +export type VariantAlreadyUnlinkedError = Error & { + __typename?: 'VariantAlreadyUnlinkedError'; + message: Scalars['String']['output']; +}; + +/** Variant-level configuration of checks. */ +export type VariantCheckConfiguration = { + __typename?: 'VariantCheckConfiguration'; + /** Time when the check configuration was created. */ + createdAt: Scalars['Timestamp']['output']; + customChecksConfig: VariantCheckConfigurationCustomChecks; + /** Operation checks configuration that allows associated checks to be downgraded from failure to passing. */ + downgradeChecksConfig: VariantCheckConfigurationDowngradeChecks; + /** + * Downstream checks configuration for which downstream variants should affect this variant's check + * status. + */ + downstreamVariantsConfig: VariantCheckConfigurationDownstreamVariants; + /** Operation checks configuration for which clients to ignore. */ + excludedClientsConfig: VariantCheckConfigurationExcludedClients; + /** Operation checks configuration for which operation to ignore. */ + excludedOperationsConfig: VariantCheckConfigurationExcludedOperations; + /** Graph that this check configuration belongs to */ + graphID: Scalars['String']['output']; + /** Graph variant that this check configuration belongs to */ + graphVariant: Scalars['String']['output']; + /** ID of the check configuration */ + id: Scalars['ID']['output']; + /** Operation checks configuration for which variants' metrics data to include. */ + includedVariantsConfig: VariantCheckConfigurationIncludedVariants; + /** Whether operations checks are enabled. */ + operationsChecksEnabled: Scalars['Boolean']['output']; + /** How submitted build input diffs are handled when they match (or don't) a Proposal at the variant level */ + proposalChangeMismatchSeverityConfig: VariantCheckConfigurationProposalChangeMismatchSeverity; + /** Operation checks configuration for time range and associated thresholds. */ + timeRangeConfig: VariantCheckConfigurationTimeRange; + /** Time when the check configuration was updated. */ + updatedAt: Scalars['Timestamp']['output']; + /** Identity of the last actor to update the check configuration, if available. */ + updatedBy?: Maybe; +}; + +export type VariantCheckConfigurationCustomChecks = { + __typename?: 'VariantCheckConfigurationCustomChecks'; + /** ID of the check configuration */ + checkConfigurationId: Scalars['ID']['output']; + /** Whether custom checks is enabled for this variant. Non-null if useGraphSettings is false, otherwise null. */ + enableCustomChecks?: Maybe; + /** When true, indicates that graph-level configuration is used for this variant setting. The default at variant creation is true. */ + useGraphSettings: Scalars['Boolean']['output']; +}; + +export type VariantCheckConfigurationDowngradeChecks = { + __typename?: 'VariantCheckConfigurationDowngradeChecks'; + /** + * During operation checks, if this option is enabled, the check will not fail or mark any operations as + * broken/changed if the default value has changed, only if the default value is removed completely. + */ + downgradeDefaultValueChange?: Maybe; + /** + * During operation checks, if this option is enabled, it evaluates a check run against zero operations + * as a pass instead of a failure. + */ + downgradeStaticChecks?: Maybe; + /** + * When true, indicates that graph-level configuration is used for this variant setting. The default + * at variant creation is true. + */ + useGraphSettings: Scalars['Boolean']['output']; +}; + +export type VariantCheckConfigurationDownstreamVariants = { + __typename?: 'VariantCheckConfigurationDownstreamVariants'; + /** + * During downstream checks, this variant's check workflow will wait for all downstream check + * workflows for variants to complete, and if any of them fail, then + * this variant's check workflow will fail. + */ + blockingDownstreamVariants: Array; +}; + +export type VariantCheckConfigurationExcludedClients = { + __typename?: 'VariantCheckConfigurationExcludedClients'; + /** + * When true, indicates that graph-level configuration is appended to the variant-level + * configuration. The default at variant creation is true. + */ + appendGraphSettings: Scalars['Boolean']['output']; + /** + * During operation checks, ignore clients matching any of the filters. The + * default at variant creation is the empty list. + */ + excludedClients: Array; +}; + +export type VariantCheckConfigurationExcludedOperations = { + __typename?: 'VariantCheckConfigurationExcludedOperations'; + /** + * When true, indicates that graph-level configuration is appended to the variant-level + * configuration. The default at variant creation is true. + */ + appendGraphSettings: Scalars['Boolean']['output']; + /** + * During operation checks, ignore operations matching any of the filters. + * The default at variant creation is the empty list. + */ + excludedOperationNames: Array; + /** + * During operation checks, ignore operations matching any of the filters. The + * default at variant creation is the empty list. + */ + excludedOperations: Array; +}; + +export type VariantCheckConfigurationIncludedVariants = { + __typename?: 'VariantCheckConfigurationIncludedVariants'; + /** + * During operation checks, fetch operations from the metrics data for variants. + * Non-null if useGraphSettings is false and is otherwise null. + */ + includedVariants?: Maybe>; + /** + * When true, indicates that graph-level configuration is used for this variant setting. The default + * at variant creation is true. + */ + useGraphSettings: Scalars['Boolean']['output']; +}; + +export type VariantCheckConfigurationProposalChangeMismatchSeverity = { + __typename?: 'VariantCheckConfigurationProposalChangeMismatchSeverity'; + /** How submitted build input diffs are handled when they match (or don't) a Proposal. Non-null if useGraphSettings is false and is otherwise null. */ + proposalChangeMismatchSeverity?: Maybe; + /** When true, indicates that graph-level configuration is used for this variant setting. The default at variant creation is true. */ + useGraphSettings: Scalars['Boolean']['output']; +}; + +export type VariantCheckConfigurationTimeRange = { + __typename?: 'VariantCheckConfigurationTimeRange'; + /** + * During operation checks, ignore operations that executed less than + * times in the time range. Non-null if useGraphSettings is false and is otherwise null. + */ + operationCountThreshold?: Maybe; + /** + * Duration operation checks, ignore operations that constituted less than + * % of the operations in the time range. Expected values are + * between 0% and 5%. Non-null if useGraphSettings is false and is otherwise null. + */ + operationCountThresholdPercentage?: Maybe; + /** + * During operation checks, fetch operations from the last seconds. Non-null if + * useGraphSettings is false and is otherwise null. + */ + timeRangeSeconds?: Maybe; + /** + * When true, indicates that graph-level configuration is used for this variant setting. The default + * at variant creation is true. + */ + useGraphSettings: Scalars['Boolean']['output']; +}; + +export type VariantCreationConfig = { + buildConfigInput: BuildConfigInput; + endpointSlug?: InputMaybe; + variantName: Scalars['String']['input']; +}; + +export enum ViolationLevel { + ERROR = 'ERROR', + INFO = 'INFO', + WARNING = 'WARNING' +} + +/** Webhook notification channel */ +export type WebhookChannel = Channel & { + __typename?: 'WebhookChannel'; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + /** List of the Schema Proposal Lifecycle Subscriptions this Channel is subscribed to. */ + proposalLifecycleSubscriptions: Array; + secretToken?: Maybe; + /** List of the subscriptions this channel is subscribed to, except for ProposalLifecycleSubscriptions. */ + subscriptions: Array; + url: Scalars['String']['output']; +}; + +/** PagerDuty notification channel parameters */ +export type WebhookChannelInput = { + name?: InputMaybe; + secretToken?: InputMaybe; + url: Scalars['String']['input']; +}; + +export type SchemaReportMutationVariables = Exact<{ + report: SchemaReport; + coreSchema?: InputMaybe; +}>; + + +export type SchemaReportMutation = { __typename?: 'Mutation', reportSchema?: { __typename: 'ReportSchemaError', message: string, code: ReportSchemaErrorCode } | { __typename: 'ReportSchemaResponse', inSeconds: number, withCoreSchema: boolean } | null }; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/index.ts new file mode 100644 index 00000000..92a68e88 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/index.ts @@ -0,0 +1,197 @@ +import os from 'os'; +import { internalPlugin } from '../../internalPlugin.js'; +import { printSchema, validateSchema, buildSchema } from 'graphql'; +import { SchemaReporter } from './schemaReporter.js'; +import { schemaIsSubgraph } from '../schemaIsSubgraph.js'; +import type { SchemaReport } from './generated/operations.js'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import type { Fetcher } from '@apollo/utils.fetcher'; +import { packageVersion } from '../../generated/packageVersion.js'; +import { computeCoreSchemaHash } from '../../utils/computeCoreSchemaHash.js'; + +export interface ApolloServerPluginSchemaReportingOptions { + /** + * The schema reporter waits before starting reporting. + * By default, the report waits some random amount of time between 0 and 10 seconds. + * A longer interval leads to more staggered starts which means it is less likely + * multiple servers will get asked to upload the same schema. + * + * If this server runs in lambda or in other constrained environments it would be useful + * to decrease the schema reporting max wait time to be less than default. + * + * This number will be the max for the range in ms that the schema reporter will + * wait before starting to report. + */ + initialDelayMaxMs?: number; + /** + * Override the reported schema that is reported to the Apollo registry. This + * schema does not go through any normalizations and the string is directly + * sent to the Apollo registry. This can be useful for comments or other + * ordering and whitespace changes that get stripped when generating a + * `GraphQLSchema`. + * + * **If you pass this option to this plugin, you should explicitly configure + * `ApolloServerPluginUsageReporting` and pass the same value to its + * `overrideReportedSchema` option.** This ensures that the schema ID + * associated with requests reported by the usage reporting plugin matches the + * schema ID that this plugin reports. For example: + * + * ```js + * new ApolloServer({ + * plugins: [ + * ApolloServerPluginSchemaReporting({overrideReportedSchema: schema}), + * ApolloServerPluginUsageReporting({overrideReportedSchema: schema}), + * ], + * }) + * ``` + */ + overrideReportedSchema?: string; + /** + * The URL to use for reporting schemas. Primarily for testing and internal + * Apollo use. + */ + endpointUrl?: string; + /** + * Specifies which Fetch API implementation to use when reporting schemas. + */ + fetcher?: Fetcher; +} + +export function ApolloServerPluginSchemaReporting( + { + initialDelayMaxMs, + overrideReportedSchema, + endpointUrl, + fetcher, + }: ApolloServerPluginSchemaReportingOptions = Object.create(null), +): ApolloServerPlugin { + const bootId = crypto.randomUUID(); + + return internalPlugin({ + __internal_plugin_id__: 'SchemaReporting', + __is_disabled_plugin__: false, + async serverWillStart({ apollo, schema, logger }) { + const { key, graphRef } = apollo; + if (!key) { + throw Error( + 'To use ApolloServerPluginSchemaReporting, you must provide an Apollo API ' + + 'key, via the APOLLO_KEY environment variable or via `new ApolloServer({apollo: {key})`', + ); + } + if (!graphRef) { + // This error is a bit imprecise as you can also specify ID and variant separately, + // or rely on API-key parsing (before AS3), but this is "best practices". + throw Error( + 'To use ApolloServerPluginSchemaReporting, you must provide your graph ref (eg, ' + + "'my-graph-id@my-graph-variant'). Try setting the APOLLO_GRAPH_REF environment " + + 'variable or passing `new ApolloServer({apollo: {graphRef}})`.', + ); + } + + // Ensure a provided override schema can be parsed and validated + if (overrideReportedSchema) { + try { + const validationErrors = validateSchema( + buildSchema(overrideReportedSchema, { noLocation: true }), + ); + if (validationErrors.length) { + throw new Error( + validationErrors.map((error) => error.message).join('\n'), + ); + } + } catch (err) { + throw new Error( + 'The schema provided to overrideReportedSchema failed to parse or ' + + `validate: ${(err as Error).message}`, + ); + } + } + + if (schemaIsSubgraph(schema)) { + throw Error( + [ + 'Schema reporting is not yet compatible with Apollo Federation subgraphs.', + "If you're interested in using schema reporting with subgraphs,", + 'please contact Apollo support. To set up managed federation, see', + 'https://go.apollo.dev/s/managed-federation', + ].join(' '), + ); + } + + if (endpointUrl !== undefined) { + logger.info( + `Apollo schema reporting: schema reporting URL override: ${endpointUrl}`, + ); + } + + const baseSchemaReport: Omit = { + bootId, + graphRef, + // The infra environment in which this edge server is running, e.g. localhost, Kubernetes + // Length must be <= 256 characters. + platform: process.env.APOLLO_SERVER_PLATFORM || 'local', + runtimeVersion: `node ${process.version}`, + // An identifier used to distinguish the version of the server code such as git or docker sha. + // Length must be <= 256 characters + userVersion: process.env.APOLLO_SERVER_USER_VERSION, + // "An identifier for the server instance. Length must be <= 256 characters. + serverId: + process.env.APOLLO_SERVER_ID || process.env.HOSTNAME || os.hostname(), + libraryVersion: `@apollo/server@${packageVersion}`, + }; + let currentSchemaReporter: SchemaReporter | undefined; + + return { + schemaDidLoadOrUpdate({ apiSchema, coreSupergraphSdl }): void { + if (overrideReportedSchema !== undefined) { + if (currentSchemaReporter) { + // When the schema to report has been overridden, there is no need + // to create a new schema reporter. + return; + } else { + logger.info( + 'Apollo schema reporting: schema to report has been overridden', + ); + } + } + + const coreSchema = + overrideReportedSchema ?? + coreSupergraphSdl ?? + printSchema(apiSchema); + const coreSchemaHash = computeCoreSchemaHash(coreSchema); + const schemaReport: SchemaReport = { + ...baseSchemaReport, + coreSchemaHash, + }; + + currentSchemaReporter?.stop(); + currentSchemaReporter = new SchemaReporter({ + schemaReport, + coreSchema, + apiKey: key, + endpointUrl, + logger, + // Jitter the startup between 0 and 10 seconds + initialReportingDelayInMs: Math.floor( + Math.random() * (initialDelayMaxMs ?? 10_000), + ), + fallbackReportingDelayInMs: 20_000, + fetcher, + }); + currentSchemaReporter.start(); + + logger.info( + 'Apollo schema reporting: reporting a new schema to Studio! See your graph at ' + + `https://studio.apollographql.com/graph/${encodeURI( + graphRef, + )}/ with server info ${JSON.stringify(schemaReport)}`, + ); + }, + async serverWillStop() { + currentSchemaReporter?.stop(); + }, + }; + }, + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/schemaReporter.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/schemaReporter.ts new file mode 100644 index 00000000..56ab52b7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/schemaReporting/schemaReporter.ts @@ -0,0 +1,207 @@ +import type { GraphQLRequest } from '../../externalTypes/index.js'; +import type { Logger } from '@apollo/utils.logger'; +import type { + SchemaReport, + SchemaReportMutationVariables, + SchemaReportMutation, + ReportSchemaResponse, +} from './generated/operations'; +import type { Fetcher } from '@apollo/utils.fetcher'; +import { packageVersion } from '../../generated/packageVersion.js'; + +// Magic GraphQL comment allows codegen to find the query +// prettier-ignore +export const schemaReportGql = /* GraphQL */ `#graphql + mutation SchemaReport($report: SchemaReport!, $coreSchema: String) { + reportSchema(report: $report, coreSchema: $coreSchema) { + __typename + ... on ReportSchemaError { + message + code + } + ... on ReportSchemaResponse { + inSeconds + withCoreSchema + } + } + } +`; + +// This class is meant to be a thin shim around the gql mutations. +export class SchemaReporter { + // These mirror the gql variables + private readonly schemaReport: SchemaReport; + private readonly coreSchema: string; + private readonly endpointUrl: string; + private readonly logger: Logger; + private readonly initialReportingDelayInMs: number; + private readonly fallbackReportingDelayInMs: number; + private readonly fetcher: Fetcher; + + private isStopped: boolean; + private pollTimer?: NodeJS.Timeout; + private readonly headers: Record; + + constructor(options: { + schemaReport: SchemaReport; + coreSchema: string; + apiKey: string; + endpointUrl: string | undefined; + logger: Logger; + initialReportingDelayInMs: number; + fallbackReportingDelayInMs: number; + fetcher?: Fetcher; + }) { + this.headers = { + 'Content-Type': 'application/json', + 'x-api-key': options.apiKey, + 'apollographql-client-name': 'ApolloServerPluginSchemaReporting', + 'apollographql-client-version': packageVersion, + }; + + this.endpointUrl = + options.endpointUrl || + 'https://schema-reporting.api.apollographql.com/api/graphql'; + + this.schemaReport = options.schemaReport; + this.coreSchema = options.coreSchema; + this.isStopped = false; + this.logger = options.logger; + this.initialReportingDelayInMs = options.initialReportingDelayInMs; + this.fallbackReportingDelayInMs = options.fallbackReportingDelayInMs; + this.fetcher = options.fetcher ?? fetch; + } + + public stopped(): boolean { + return this.isStopped; + } + + public start() { + this.pollTimer = setTimeout( + () => this.sendOneReportAndScheduleNext(false), + this.initialReportingDelayInMs, + ); + } + + public stop() { + this.isStopped = true; + if (this.pollTimer) { + clearTimeout(this.pollTimer); + this.pollTimer = undefined; + } + } + + private async sendOneReportAndScheduleNext(sendNextWithCoreSchema: boolean) { + this.pollTimer = undefined; + + // Bail out permanently + if (this.stopped()) return; + try { + const result = await this.reportSchema(sendNextWithCoreSchema); + if (!result) { + return; + } + if (!this.stopped()) { + this.pollTimer = setTimeout( + () => this.sendOneReportAndScheduleNext(result.withCoreSchema), + result.inSeconds * 1000, + ); + } + return; + } catch (error) { + // In the case of an error we want to continue looping + // We can add hardcoded backoff in the future, + // or on repeated failures stop responding reporting. + this.logger.error( + `Error reporting server info to Apollo during schema reporting: ${error}`, + ); + if (!this.stopped()) { + this.pollTimer = setTimeout( + () => this.sendOneReportAndScheduleNext(false), + this.fallbackReportingDelayInMs, + ); + } + } + } + + public async reportSchema( + withCoreSchema: boolean, + ): Promise { + const { data, errors } = await this.apolloQuery({ + report: this.schemaReport, + coreSchema: withCoreSchema ? this.coreSchema : null, + }); + + if (errors) { + throw new Error(errors.map((x: any) => x.message).join('\n')); + } + + function msgForUnexpectedResponse(data: any): string { + return [ + 'Unexpected response shape from Apollo when', + 'reporting schema. If this continues, please reach', + 'out to support@apollographql.com.', + 'Received response:', + JSON.stringify(data), + ].join(' '); + } + + if (!data || !data.reportSchema) { + throw new Error(msgForUnexpectedResponse(data)); + } + + if (data.reportSchema.__typename === 'ReportSchemaResponse') { + return data.reportSchema; + } else if (data.reportSchema.__typename === 'ReportSchemaError') { + this.logger.error( + [ + 'Received input validation error from Apollo:', + data.reportSchema.message, + 'Stopping reporting. Please fix the input errors.', + ].join(' '), + ); + this.stop(); + return null; + } + throw new Error(msgForUnexpectedResponse(data)); + } + + private async apolloQuery( + variables: SchemaReportMutationVariables, + ): Promise<{ data?: SchemaReportMutation; errors?: any[] }> { + const request: GraphQLRequest = { + query: schemaReportGql, + variables, + }; + + const httpResponse = await this.fetcher(this.endpointUrl, { + method: 'POST', + headers: this.headers, + body: JSON.stringify(request), + }); + + if (!httpResponse.ok) { + throw new Error( + [ + `An unexpected HTTP status code (${httpResponse.status}) was`, + 'encountered during schema reporting.', + ].join(' '), + ); + } + + try { + // JSON parsing failure due to malformed data is the likely failure case + // here. Any non-JSON response (e.g. HTML) is usually the suspect. + return await httpResponse.json(); + } catch (error) { + throw new Error( + [ + "Couldn't report schema to Apollo.", + 'Parsing response as JSON failed.', + 'If this continues please reach out to support@apollographql.com', + error, + ].join(' '), + ); + } + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/subscriptionCallback/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/subscriptionCallback/index.ts new file mode 100644 index 00000000..a2cadf00 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/subscriptionCallback/index.ts @@ -0,0 +1,724 @@ +import { type FetcherResponse, type Fetcher } from '@apollo/utils.fetcher'; +import type { Logger } from '@apollo/utils.logger'; +import retry from 'async-retry'; +import { subscribe, type ExecutionResult, type GraphQLError } from 'graphql'; +import { setImmediate } from 'node:timers/promises'; +import { ensureError, ensureGraphQLError } from '../../errorNormalize.js'; +import type { ApolloServerPlugin } from '../../externalTypes/index.js'; +import { HeaderMap } from '../../utils/HeaderMap.js'; + +export interface ApolloServerPluginSubscriptionCallbackOptions { + maxConsecutiveHeartbeatFailures?: number; + logger?: Logger; + retry?: retry.Options; + /** + * Specifies which Fetch API implementation to use for the callback URL. + */ + fetcher?: Fetcher; +} + +export function ApolloServerPluginSubscriptionCallback( + options: ApolloServerPluginSubscriptionCallbackOptions = Object.create(null), +): ApolloServerPlugin { + const subscriptionManager = new SubscriptionManager(options); + const logger = options.logger + ? prefixedLogger(options.logger, 'SubscriptionCallback') + : undefined; + + return { + async requestDidStart({ request }) { + const subscriptionExtension = request?.extensions?.subscription; + // If it's not a callback subscription, ignore the request. + if (!subscriptionExtension) return; + let { + callbackUrl, + subscriptionId: id, + verifier, + heartbeatIntervalMs, + } = subscriptionExtension; + // The GA version of callback protocol use camelCase, this is to keep backward compatibility + callbackUrl = callbackUrl || subscriptionExtension.callback_url; + id = id || subscriptionExtension.subscription_id; + heartbeatIntervalMs = + heartbeatIntervalMs ?? + subscriptionExtension.heartbeat_interval_ms ?? + 5000; + + return { + // Implementing `responseForOperation` is the only hook that allows us + // to bypass normal execution by returning our own response. We don't + // want Apollo Server to actually handle this subscription request, we + // want to handle everything ourselves. The actual subscription handling + // will be done in `willSendResponse`. + async responseForOperation() { + logger?.debug('Received new subscription request', id); + + return { + http: { + status: 200, + headers: new HeaderMap([['content-type', 'application/json']]), + }, + body: { + kind: 'single', + singleResult: { + data: null, + }, + }, + }; + }, + // The majority of the subscription work is implemented in this hook. + // This can _almost_ all be implemented in `responseForOperation`, + // however in the case of GraphQL validation errors, + // `responseForOperation` won't actually be called, but + // `willSendResponse` will. + async willSendResponse({ + request, + schema, + document, + contextValue, + operationName, + response, + }) { + try { + // Before responding to the original request, we need to complete a + // roundtrip `check` request to the router, so we `await` this + // request. + await subscriptionManager.checkRequest({ + callbackUrl, + id, + verifier, + }); + } catch (e) { + const graphqlError = ensureGraphQLError(e); + logger?.error( + `\`check\` request failed: ${graphqlError.message}`, + id, + ); + // In the event of a check failure, we respond to the original + // request with a >=400 status code. + if (response.body.kind === 'single') { + response.body.singleResult.errors = [graphqlError]; + response.http.status = 500; + } + return; + } + + // We're about to `await` the subscription, which could have some + // nontrivial asynchronous work to do before returning the generator. + // We set up the heartbeat first so the router knows we're alive + // during that wait period. + subscriptionManager.initHeartbeat({ + callbackUrl, + id, + verifier, + heartbeatIntervalMs, + }); + + // The `check` request was successful, so we can initialize the actual + // `graphql-js` subscription. We don't expect `subscribe` to throw, + // but rather return an object with `errors` on it (if there are any). + logger?.debug(`Starting graphql-js subscription`, id); + let subscription: Awaited>; + try { + subscription = await subscribe({ + schema, + document: document!, + variableValues: request.variables, + contextValue: contextValue, + operationName: operationName, + }); + } catch (e) { + // While we don't expect this scenario, we should still handle it + // gracefully (in the same way that we do below, when the + // subscription object has `errors` on it). + const graphqlError = ensureGraphQLError(e); + logger?.error( + `Programming error: graphql-js subscribe() threw unexpectedly! Please report this bug to Apollo. The error was: ${e}`, + id, + ); + subscriptionManager.completeRequest({ + errors: [graphqlError], + callbackUrl, + id, + verifier, + }); + return; + } + + // In the case of errors, send a `complete` request to the router with + // the errors. + if ('errors' in subscription) { + logger?.error( + `graphql-js subscription unsuccessful: [\n\t${subscription.errors + ?.map((e) => e.message) + .join(',\n\t')}\n]`, + id, + ); + + try { + subscriptionManager.completeRequest({ + errors: subscription.errors, + callbackUrl, + id, + verifier, + }); + } catch (e) { + // TODO: not sure how to best handle a failed "completion with + // errors" request outside of retrying. + logger?.error(`\`complete\` request failed: ${e}`, id); + } + } else if (isAsyncIterable(subscription)) { + // We have a real subscription - now we can consume the + // AsyncIterable on the `subscription` object. + logger?.debug('graphql-js subscription successful', id); + + subscriptionManager.startConsumingSubscription({ + subscription, + callbackUrl, + id, + verifier, + }); + } + + logger?.debug(`Responding to original subscription request`, id); + }, + }; + }, + async serverWillStart() { + return { + async drainServer() { + logger?.debug( + 'Server is shutting down. Cleaning up outstanding subscriptions and heartbeat intervals', + ); + await subscriptionManager.cleanup(); + // This setImmediate makes the precise timing of the log line below + // consistent between when we run our test suite with GraphQL.js v16 + // and v17.0.0-alpha.9. + await setImmediate(); + logger?.debug( + 'Successfully cleaned up outstanding subscriptions and heartbeat intervals.', + ); + }, + }; + }, + }; +} + +function isAsyncIterable(value: any): value is AsyncIterable { + return value && typeof value[Symbol.asyncIterator] === 'function'; +} + +interface SubscriptionObject { + cancelled: boolean; + asyncIter: AsyncGenerator; + startConsumingSubscription: () => Promise; + completeSubscription: () => Promise; +} +// This class manages the state of subscriptions, heartbeat intervals, and +// router requests. It keeps track of in flight requests so we can await them +// during server cleanup. +class SubscriptionManager { + private maxConsecutiveHeartbeatFailures: number; + private logger?: ReturnType; + private retryConfig?: retry.Options; + private requestsInFlight: Set> = new Set(); + // A map of information about subscription for a given callback url including the subscription id. + private subscriptionInfoByCallbackUrl: Map< + string, + { + heartbeat?: { + id: string; + verifier: string; + interval: NodeJS.Timeout; + queue: Promise[]; + }; + subscription?: SubscriptionObject; + } + > = new Map(); + private fetcher: Fetcher; + + constructor(options: ApolloServerPluginSubscriptionCallbackOptions) { + this.maxConsecutiveHeartbeatFailures = + options.maxConsecutiveHeartbeatFailures ?? 5; + this.retryConfig = { + retries: 5, + minTimeout: 100, + maxTimeout: 1000, + ...options.retry, + }; + this.logger = options.logger + ? prefixedLogger(options.logger, 'SubscriptionManager') + : undefined; + this.fetcher = options.fetcher ?? fetch; + } + + async retryFetch({ + url, + action, + id, + verifier, + payload, + errors, + headers, + }: { + url: string; + action: 'check' | 'next' | 'complete'; + id: string; + verifier: string; + payload?: ExecutionResult; + errors?: readonly GraphQLError[]; + headers?: Record; + }) { + let response: Promise | undefined; + try { + const maybeWithErrors = errors?.length ? ` with errors` : ''; + this.logger?.debug( + `Sending \`${action}\` request to router` + maybeWithErrors, + id, + ); + return retry( + async (bail) => { + response = this.fetcher(url, { + method: 'POST', + headers: { + 'content-type': 'application/json', + ...headers, + }, + body: JSON.stringify({ + kind: 'subscription', + action, + id, + verifier, + ...(payload && { payload }), + ...(errors?.length && { errors }), + }), + }); + this.requestsInFlight.add(response); + const result = await response; + + if (!result.ok) { + if (result.status >= 500) { + // Throwing here triggers a retry, which seems reasonable for 5xx + // (i.e. an internal server error). + throw new Error( + `\`${action}\` request failed with unexpected status code: ${result.status}`, + ); + } else { + // For 4xx, we don't want to retry. These errors carry a semantic + // meaning (terminate), so we bail. This will reject the promise and + // should be handled by the caller. Specifically, 404 from the + // router means terminate, but the protocol says that in other error + // cases the subscription should be terminated due to an unexpected + // error. + if (result.status === 404) { + this.logger?.debug( + `\`${action}\` request received 404, terminating subscription`, + id, + ); + } else { + const errMsg = `\`${action}\` request failed with unexpected status code: ${result.status}, terminating subscription`; + this.logger?.debug(errMsg, id); + bail(new Error(errMsg)); + } + this.terminateSubscription(id, url); + return result; + } + } + this.logger?.debug(`\`${action}\` request successful`, id); + return result; + }, + { + ...this.retryConfig, + onRetry: (e, attempt) => { + this.requestsInFlight.delete(response!); + this.logger?.warn( + `Retrying \`${action}\` request (attempt ${attempt}) due to error: ${e.message}`, + id, + ); + this.retryConfig?.onRetry?.(e, attempt); + }, + }, + ); + } finally { + this.requestsInFlight.delete(response!); + } + } + + // Implements sending the `check` request to the router. Fetch errors are + // thrown and expected to be handled by the caller. + async checkRequest({ + callbackUrl, + id, + verifier, + }: { + callbackUrl: string; + id: string; + verifier: string; + }) { + return this.retryFetch({ + url: callbackUrl, + action: 'check', + id, + verifier, + headers: { 'subscription-protocol': 'callback/1.0' }, + }); + } + + // Kicks off an interval that sends `heartbeat` requests to the router. If an + // interval already exists for the callback url, we just add the new ID to its + // list of IDs that it's sending a heartbeat for. This allows us to send one + // batched heartbeat per interval per callback url. + initHeartbeat({ + callbackUrl, + id, + verifier, + heartbeatIntervalMs, + }: { + callbackUrl: string; + id: string; + verifier: string; + heartbeatIntervalMs: number; + }) { + if (!this.subscriptionInfoByCallbackUrl.has(callbackUrl)) { + this.subscriptionInfoByCallbackUrl.set(callbackUrl, {}); + } + + if (heartbeatIntervalMs === 0) { + // Heartbeat has been disabled on the router + this.logger?.debug(`Heartbeat disabled for ${callbackUrl}`, id); + return; + } + + // Kickoff heartbeat interval since there isn't one already + this.logger?.debug( + `Starting new heartbeat interval for ${callbackUrl}`, + id, + ); + + let consecutiveHeartbeatFailureCount = 0; + const heartbeatInterval = setInterval(async () => { + let heartbeatRequest: Promise | undefined; + + // XXX since we're on an interval, it's possible a heartbeat goes out + // before the previous heartbeat has finished. It seems reasonable to + // queue them and await the previous heartbeat if there is one. It might + // also be reasonable to just bail / skip this heartbeat if there's + // already one in flight. I'm not sure which is better. This Promise and + // all of the queue stuff try to address this. Maybe this would be better + // off chaining timeouts instead of using an interval? + let resolveHeartbeatPromise: () => void; + const heartbeatPromise = new Promise((r) => { + resolveHeartbeatPromise = r; + }); + const existingSubscriptionInfo = + this.subscriptionInfoByCallbackUrl.get(callbackUrl); + + if (!existingSubscriptionInfo?.heartbeat) { + // This is unexpected - if the interval is still running we should have + // an entry in the map for it. But if we do end up here, there's no + // reason to let the interval continue to run. + clearInterval(heartbeatInterval); + this.logger?.error( + `Programming error: Heartbeat interval unexpectedly missing for ${callbackUrl}. This is probably a bug in Apollo Server.`, + ); + return; + } + const existingHeartbeat = existingSubscriptionInfo.heartbeat; + const { queue } = existingHeartbeat; + queue.push(heartbeatPromise); + if (queue.length > 1) { + const requestBeforeMe = queue[existingHeartbeat?.queue.length - 2]; + await requestBeforeMe; + } + + // Send the heartbeat request + try { + this.logger?.debug( + `Sending \`check\` request to ${callbackUrl} for ID: ${id}`, + ); + + heartbeatRequest = this.fetcher(callbackUrl, { + method: 'POST', + body: JSON.stringify({ + kind: 'subscription', + action: 'check', + id, + verifier, + }), + headers: { + 'content-type': 'application/json', + 'subscription-protocol': 'callback/1.0', + }, + }); + this.requestsInFlight.add(heartbeatRequest); + + // heartbeat response might be a 4xx, in which case we'd need to + // terminate the subscription, so we need to await it + const result = await heartbeatRequest; + + this.logger?.debug(`Heartbeat received response for ID: ${id}`); + if (result.ok) { + this.logger?.debug(`Heartbeat request successful, ID: ${id}`); + } else if (result.status === 400) { + this.logger?.debug(`Heartbeat request received invalid ID: ${id}`); + + this.terminateSubscription(id, callbackUrl); + } else if (result.status === 404) { + // the id we sent is invalid + this.logger?.debug(`Heartbeat request received invalid ID: ${id}`); + // This will also handle cleaning up the heartbeat interval + this.terminateSubscription(id, callbackUrl); + } else { + // We'll catch this below and log it with the expectation that we'll + // retry this request some number of times before giving up + throw new Error(`Unexpected status code: ${result.status}`); + } + + // If we make it here, there wasn't some transient error with the + // request and it had an expected status code (2xx, 400, 404). + consecutiveHeartbeatFailureCount = 0; + } catch (e) { + const err = ensureError(e); + // The heartbeat request failed. + this.logger?.error( + `Heartbeat request failed (${++consecutiveHeartbeatFailureCount} consecutive): ${ + err.message + }`, + existingHeartbeat.id, + ); + + if ( + consecutiveHeartbeatFailureCount >= + this.maxConsecutiveHeartbeatFailures + ) { + this.logger?.error( + `Heartbeat request failed ${consecutiveHeartbeatFailureCount} times, terminating subscriptions and heartbeat interval: ${err.message}`, + existingHeartbeat.id, + ); + // If we've failed 5 times in a row, we should terminate all + // subscriptions for this callback url. This will also handle + // cleaning up the heartbeat interval. + this.terminateSubscription(id, callbackUrl); + } + return; + } finally { + if (heartbeatRequest) { + this.requestsInFlight.delete(heartbeatRequest); + } + // remove itself from the queue and resolve the promise + existingHeartbeat?.queue.shift(); + resolveHeartbeatPromise!(); + } + }, heartbeatIntervalMs); + + // Add the heartbeat interval to the map of intervals + const subscriptionInfo = + this.subscriptionInfoByCallbackUrl.get(callbackUrl)!; + subscriptionInfo.heartbeat = { + interval: heartbeatInterval, + id, + verifier, + queue: [], + }; + } + + // Cancels and cleans up the subscriptions for given IDs and callback url. If + // there are no active subscriptions after this, we also clean up the + // heartbeat interval. This does not handle sending the `complete` request to + // the router. + private terminateSubscription(id: string, callbackUrl: string) { + this.logger?.debug(`Terminating subscriptions for ID: ${id}`); + const subscriptionInfo = + this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!subscriptionInfo) { + this.logger?.error( + `No subscriptions found for ${callbackUrl}, skipping termination`, + ); + return; + } + const { subscription, heartbeat } = subscriptionInfo; + if (subscription) { + subscription.cancelled = true; + subscription.asyncIter?.return(); + } + // cleanup heartbeat for subscription + if (heartbeat) { + this.logger?.debug(`Terminating heartbeat interval for ${callbackUrl}`); + clearInterval(heartbeat.interval); + } + this.subscriptionInfoByCallbackUrl.delete(callbackUrl); + } + + // Consumes the AsyncIterable returned by `graphql-js`'s `subscribe` function. + // This handles sending the `next` requests to the router as well as the + // `complete` request when the subscription is finished. + startConsumingSubscription({ + subscription, + callbackUrl, + id, + verifier, + }: { + subscription: AsyncGenerator; + callbackUrl: string; + id: string; + verifier: string; + }) { + // For each subscription we need to manage a bit of state. We need to be + // able to cancel the subscription externally. Setting `cancelled` to true + // allows us to break out of the `for await` and ignore future payloads. + const self = this; + const subscriptionObject = { + asyncIter: subscription, + cancelled: false, + async startConsumingSubscription() { + self.logger?.debug(`Listening to graphql-js subscription`, id); + try { + for await (const payload of subscription) { + if (this.cancelled) { + self.logger?.debug( + `Subscription already cancelled, ignoring current and future payloads`, + id, + ); + // It's already been cancelled - something else has already handled + // sending the `complete` request so we don't want to `break` here + // and send it again after the loop. + return; + } + + try { + await self.retryFetch({ + url: callbackUrl, + action: 'next', + id, + verifier, + payload, + }); + } catch (e) { + const originalError = ensureError(e); + self.logger?.error( + `\`next\` request failed, terminating subscription: ${originalError.message}`, + id, + ); + self.terminateSubscription(id, callbackUrl); + } + } + // The subscription ended without errors, send the `complete` request to + // the router + self.logger?.debug(`Subscription completed without errors`, id); + await this.completeSubscription(); + } catch (e) { + const error = ensureGraphQLError(e); + self.logger?.error( + `Generator threw an error, terminating subscription: ${error.message}`, + id, + ); + this.completeSubscription([error]); + } + }, + async completeSubscription(errors?: readonly GraphQLError[]) { + if (this.cancelled) return; + this.cancelled = true; + + try { + await self.completeRequest({ + callbackUrl, + id, + verifier, + ...(errors && { errors }), + }); + } catch (e) { + const error = ensureError(e); + // This is just the `complete` request. If we fail to get this message + // to the router, it should just invalidate the subscription after the + // next heartbeat fails. + self.logger?.error( + `\`complete\` request failed: ${error.message}`, + id, + ); + } finally { + self.terminateSubscription(id, callbackUrl); + } + }, + }; + + subscriptionObject.startConsumingSubscription(); + const subscriptionInfo = + this.subscriptionInfoByCallbackUrl.get(callbackUrl); + if (!subscriptionInfo) { + this.logger?.error( + `No existing heartbeat found for ${callbackUrl}, skipping subscription`, + ); + } else { + subscriptionInfo.subscription = subscriptionObject; + } + } + + // Sends the `complete` request to the router. + async completeRequest({ + errors, + callbackUrl, + id, + verifier, + }: { + errors?: readonly GraphQLError[]; + callbackUrl: string; + id: string; + verifier: string; + }) { + return this.retryFetch({ + url: callbackUrl, + action: 'complete', + id, + verifier, + errors, + }); + } + + collectAllSubscriptions() { + return Array.from(this.subscriptionInfoByCallbackUrl.values()).reduce( + (subscriptions, { subscription }) => { + if (subscription) { + subscriptions.push(subscription); + } + return subscriptions; + }, + [] as SubscriptionObject[], + ); + } + + async cleanup() { + // Wait for our inflight heartbeats to finish - they might handle cancelling + // some subscriptions + await Promise.allSettled( + Array.from(this.subscriptionInfoByCallbackUrl.values()).map( + async ({ heartbeat }) => { + clearInterval(heartbeat?.interval); + await heartbeat?.queue[heartbeat.queue.length - 1]; + }, + ), + ); + // Cancel / complete any still-active subscriptions + await Promise.allSettled( + this.collectAllSubscriptions() + .filter((s) => !s.cancelled) + .map((s) => s.completeSubscription()), + ); + // Wait for any remaining requests to finish + await Promise.allSettled(this.requestsInFlight.values()); + } +} + +// Simple prefixing logger to curry class name and request IDs into log messages +function prefixedLogger(logger: Logger, prefix: string) { + function log(level: keyof Logger) { + return function (message: string, id?: string) { + logger[level](`${prefix}${id ? `[${id}]` : ''}: ${message}`); + }; + } + return { + debug: log('debug'), + error: log('error'), + info: log('info'), + warn: log('warn'), + }; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/traceTreeBuilder.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/traceTreeBuilder.ts new file mode 100644 index 00000000..7d323d46 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/traceTreeBuilder.ts @@ -0,0 +1,356 @@ +// This class is a helper for ApolloServerPluginUsageReporting and +// ApolloServerPluginInlineTrace. +import { + GraphQLError, + type GraphQLResolveInfo, + type ResponsePath, +} from 'graphql'; +import { Trace, google } from '@apollo/usage-reporting-protobuf'; +import type { SendErrorsOptions } from './usageReporting'; +import { UnreachableCaseError } from '../utils/UnreachableCaseError.js'; + +function internalError(message: string) { + return new Error(`[internal apollo-server error] ${message}`); +} + +export class TraceTreeBuilder { + private rootNode = new Trace.Node(); + public trace = new Trace({ + root: this.rootNode, + // By default, each trace counts as one operation for the sake of field + // execution counts. If we end up calling the fieldLevelInstrumentation + // callback (once we've successfully resolved the operation) then we + // may set this to a higher number; but we'll start it at 1 so that traces + // that don't successfully resolve the operation (eg parse failures) or + // where we don't call the callback because a plugin set captureTraces to + // true have a reasonable default. + fieldExecutionWeight: 1, + }); + public startHrTime?: [number, number]; + private stopped = false; + private nodes = new Map([ + [responsePathAsString(), this.rootNode], + ]); + private readonly transformError: + | ((err: GraphQLError) => GraphQLError | null) + | null; + + public constructor(options: { + maskedBy: string; + sendErrors?: SendErrorsOptions; + }) { + const { sendErrors, maskedBy } = options; + if (!sendErrors || 'masked' in sendErrors) { + this.transformError = () => + new GraphQLError('', { + extensions: { maskedBy }, + }); + } else if ('transform' in sendErrors) { + this.transformError = sendErrors.transform; + } else if ('unmodified' in sendErrors) { + this.transformError = null; + } else { + throw new UnreachableCaseError(sendErrors); + } + } + + public startTiming() { + if (this.startHrTime) { + throw internalError('startTiming called twice!'); + } + if (this.stopped) { + throw internalError('startTiming called after stopTiming!'); + } + this.trace.startTime = dateToProtoTimestamp(new Date()); + this.startHrTime = process.hrtime(); + } + + public stopTiming() { + if (!this.startHrTime) { + throw internalError('stopTiming called before startTiming!'); + } + if (this.stopped) { + throw internalError('stopTiming called twice!'); + } + + this.trace.durationNs = durationHrTimeToNanos( + process.hrtime(this.startHrTime), + ); + this.trace.endTime = dateToProtoTimestamp(new Date()); + this.stopped = true; + } + + public willResolveField(info: GraphQLResolveInfo): () => void { + if (!this.startHrTime) { + throw internalError('willResolveField called before startTiming!'); + } + if (this.stopped) { + // We've been stopped, which means execution is done... and yet we're + // still resolving more fields? How can that be? Shouldn't we throw an + // error or something? + // + // Well... we used to do exactly that. But this "shouldn't happen" error + // showed up in practice! Turns out that graphql-js can actually continue + // to execute more fields indefinitely long after `execute()` resolves! + // That's because parallelism on a selection set is implemented using + // `Promise.all`, and as soon as one of its arguments (ie, one field) + // throws an error, the combined Promise resolves, but there's no + // "cancellation" of the Promises that are the other arguments to + // `Promise.all`. So the code contributing to those Promises keeps on + // chugging away indefinitely. + // + // Concrete example: let’s say you have + // + // { x y { ARBITRARY_SELECTION_SET } } + // + // where x has a non-null return type, and x and y both have resolvers + // that return Promises. And let’s say that x returns a Promise that + // rejects (or resolves to null). What this means is that we’re going to + // eventually end up with `data: null` (nothing under y will actually + // matter), but graphql-js execution will continue running whatever is + // under ARBITRARY_SELECTION_SET without any sort of short circuiting. In + // fact, the Promise returned from execute itself can happily resolve + // while execution is still chugging away on an arbitrary amount of fields + // under that ARBITRARY_SELECTION_SET. There’s no way to detect from the + // outside "all the execution related to this operation is done", nor to + // "short-circuit" execution so that it stops going. + // + // So, um. We will record any field whose execution we manage to observe + // before we "stop" the TraceTreeBuilder (whether it is one that actually + // ends up in the response or whether it gets thrown away due to null + // bubbling), but if we get any more fields afterwards, we just ignore + // them rather than throwing a confusing error. + // + // (That said, the error we used to throw here generally was hidden + // anyway, for the same reason: it comes from a branch of execution that + // ends up not being included in the response. But + // https://github.com/graphql/graphql-js/pull/3529 means that this + // sometimes crashed execution anyway. Our error never caught any actual + // problematic cases, so keeping it around doesn't really help.) + return () => {}; + } + + const path = info.path; + const node = this.newNode(path); + node.type = info.returnType.toString(); + node.parentType = info.parentType.toString(); + node.startTime = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + if (typeof path.key === 'string' && path.key !== info.fieldName) { + // This field was aliased; send the original field name too (for FieldStats). + node.originalFieldName = info.fieldName; + } + + return () => { + node.endTime = durationHrTimeToNanos(process.hrtime(this.startHrTime)); + }; + } + + public didEncounterErrors(errors: readonly GraphQLError[]) { + errors.forEach((err) => { + // This is an error from a federated service. We will already be reporting + // it in the nested Trace in the query plan. + // + // XXX This probably shouldn't skip query or validation errors, which are + // not in nested Traces because format() isn't called in this case! Or + // maybe format() should be called in that case? + if (err.extensions?.serviceName) { + return; + } + + // In terms of reporting, errors can be re-written by the user by + // utilizing the `transformError` parameter. This allows changing + // the message or stack to remove potentially sensitive information. + // Returning `null` will result in the error not being reported at all. + const errorForReporting = this.transformAndNormalizeError(err); + + if (errorForReporting === null) { + return; + } + + this.addProtobufError( + errorForReporting.path, + errorToProtobufError(errorForReporting), + ); + }); + } + + private addProtobufError( + path: ReadonlyArray | undefined, + error: Trace.Error, + ) { + if (!this.startHrTime) { + throw internalError('addProtobufError called before startTiming!'); + } + if (this.stopped) { + throw internalError('addProtobufError called after stopTiming!'); + } + + // By default, put errors on the root node. + let node = this.rootNode; + // If a non-GraphQLError Error sneaks in here somehow with a non-array + // path, don't crash. + if (Array.isArray(path)) { + const specificNode = this.nodes.get(path.join('.')); + if (specificNode) { + node = specificNode; + } else { + const responsePath = responsePathFromArray(path, this.rootNode); + if (!responsePath) { + throw internalError('addProtobufError called with invalid path!'); + } + node = this.newNode(responsePath); + } + } + + node.error.push(error); + } + + private newNode(path: ResponsePath): Trace.Node { + const node = new Trace.Node(); + const id = path.key; + if (typeof id === 'number') { + node.index = id; + } else { + node.responseName = id; + } + this.nodes.set(responsePathAsString(path), node); + const parentNode = this.ensureParentNode(path); + parentNode.child.push(node); + return node; + } + + private ensureParentNode(path: ResponsePath): Trace.Node { + const parentPath = responsePathAsString(path.prev); + const parentNode = this.nodes.get(parentPath); + if (parentNode) { + return parentNode; + } + // Because we set up the root path when creating this.nodes, we now know + // that path.prev isn't undefined. + return this.newNode(path.prev!); + } + + private transformAndNormalizeError(err: GraphQLError): GraphQLError | null { + if (this.transformError) { + // Before passing the error to the user-provided `transformError` function, + // we'll make a shadow copy of the error so the user is free to change + // the object as they see fit. + + // At this stage, this error is only for the purposes of reporting, but + // this is even more important since this is still a reference to the + // original error object and changing it would also change the error which + // is returned in the response to the client. + + // For the clone, we'll create a new object which utilizes the exact same + // prototype of the error being reported. + const clonedError = Object.assign( + Object.create(Object.getPrototypeOf(err)), + err, + ); + + const rewrittenError = this.transformError(clonedError); + + // Returning an explicit `null` means the user is requesting that the error + // not be reported to Apollo. + if (rewrittenError === null) { + return null; + } + + // We don't want users to be inadvertently not reporting errors, so if + // they haven't returned an explicit `GraphQLError` (or `null`, handled + // above), then we'll report the error as usual. + if (!(rewrittenError instanceof GraphQLError)) { + return err; + } + + // We only allow transformError to change the message and extensions of the + // error; we keep everything else the same. That way people don't have to + // do extra work to keep the error on the same trace node. We also keep + // extensions the same if it isn't explicitly changed (to, eg, {}). (Note + // that many of the fields of GraphQLError are not enumerable and won't + // show up in the trace (even in the json field) anyway.) + return new GraphQLError(rewrittenError.message, { + nodes: err.nodes, + source: err.source, + positions: err.positions, + path: err.path, + originalError: err.originalError, + extensions: rewrittenError.extensions || err.extensions, + }); + } + return err; + } +} + +// Converts an hrtime array (as returned from process.hrtime) to nanoseconds. +// +// ONLY CALL THIS ON VALUES REPRESENTING DELTAS, NOT ON THE RAW RETURN VALUE +// FROM process.hrtime() WITH NO ARGUMENTS. +// +// The entire point of the hrtime data structure is that the JavaScript Number +// type can't represent all int64 values without loss of precision: +// Number.MAX_SAFE_INTEGER nanoseconds is about 104 days. Calling this function +// on a duration that represents a value less than 104 days is fine. Calling +// this function on an absolute time (which is generally roughly time since +// system boot) is not a good idea. +// +// XXX We should probably use google.protobuf.Duration on the wire instead of +// ever trying to store durations in a single number. +function durationHrTimeToNanos(hrtime: [number, number]) { + return hrtime[0] * 1e9 + hrtime[1]; +} + +// Convert from the linked-list ResponsePath format to a dot-joined +// string. Includes the full path (field names and array indices). +function responsePathAsString(p?: ResponsePath): string { + if (p === undefined) { + return ''; + } + + // A previous implementation used `responsePathAsArray` from `graphql-js/execution`, + // however, that employed an approach that created new arrays unnecessarily. + let res = String(p.key); + + while ((p = p.prev) !== undefined) { + res = `${p.key}.${res}`; + } + + return res; +} + +function responsePathFromArray( + path: ReadonlyArray, + node: Trace.Node, +): ResponsePath | undefined { + let responsePath: ResponsePath | undefined; + let nodePtr: Trace.INode | undefined = node; + for (const key of path) { + nodePtr = nodePtr?.child?.find((child) => child.responseName === key); + responsePath = { + key, + prev: responsePath, + typename: nodePtr?.type ?? undefined, + }; + } + return responsePath; +} + +function errorToProtobufError(error: GraphQLError): Trace.Error { + return new Trace.Error({ + message: error.message, + location: (error.locations || []).map( + ({ line, column }) => new Trace.Location({ line, column }), + ), + json: JSON.stringify(error), + }); +} + +// Converts a JS Date into a Timestamp. +export function dateToProtoTimestamp(date: Date): google.protobuf.Timestamp { + const totalMillis = +date; + const millis = totalMillis % 1000; + return new google.protobuf.Timestamp({ + seconds: (totalMillis - millis) / 1000, + nanos: millis * 1e6, + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts new file mode 100644 index 00000000..e68b80a2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts @@ -0,0 +1,74 @@ +import { LRUCache } from 'lru-cache'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import { iterateOverTrace } from './iterateOverTrace.js'; +import { DurationHistogram } from './durationHistogram.js'; + +export function defaultSendOperationsAsTrace() { + // We keep an LRU cache mapping from a trace key (which consists of the + // operation as defined by statsReportKey, the rough duration of the + // operation, what minute the operation ended at, etc) to `true` if we've seen + // it recently. We actually split this into one cache per minute so we can + // throw away a full minute's worth of cache at once; we keep only the last + // three minutes. + // Note that if a trace is over a certain size, we will always send it as + // stats. We check this within the addTrace function of the OurReport class so + // that we don't have to encode these large traces twice. + const cache = new LRUCache({ + // 3MiB limit, very much approximately since we can't be sure how V8 might + // be storing these strings internally. Though this should be enough to + // store a fair amount of trace keys. + + // A future version of this might expose some + // configuration option to grow the cache, but ideally, we could do that + // dynamically based on the resources available to the server, and not add + // more configuration surface area. Hopefully the warning message will allow + // us to evaluate the need with more validated input from those that receive + // it. + maxSize: Math.pow(2, 20), + sizeCalculation: (_val, key) => { + return (key && Buffer.byteLength(key)) || 0; + }, + }); + + return (trace: Trace, statsReportKey: string): boolean => { + const endTimeSeconds = trace.endTime?.seconds; + if (endTimeSeconds == null) { + throw Error('programming error: endTime not set on trace'); + } + + const hasErrors = traceHasErrors(trace); + const cacheKey = JSON.stringify([ + statsReportKey, + DurationHistogram.durationToBucket(trace.durationNs), + // What minute it started at + Math.floor(endTimeSeconds / 60), + // If the trace has an error, send one errored trace per 5 second interval + // instead of the normal minutely bucket a non-errored trace takes. + hasErrors ? Math.floor(endTimeSeconds / 5) : '', + ]); + + // If we've already seen something roughly like this, don't send as a trace. + if (cache.get(cacheKey)) { + return false; + } + + cache.set(cacheKey, true); + return true; + }; +} + +// Returns true if any node on the trace has errors. (If this ends up being a +// hot spot, we can precalculate it in TraceTreeBuilder.) +function traceHasErrors(trace: Trace): boolean { + let hasErrors = false; + + function traceNodeStats(node: Trace.INode): boolean { + if ((node.error?.length ?? 0) > 0) { + hasErrors = true; + } + return hasErrors; + } + + iterateOverTrace(trace, traceNodeStats, false); + return hasErrors; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/durationHistogram.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/durationHistogram.ts new file mode 100644 index 00000000..7d023119 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/durationHistogram.ts @@ -0,0 +1,87 @@ +export interface DurationHistogramOptions { + initSize?: number; + buckets?: number[]; +} +export class DurationHistogram { + // Note that it's legal for the values in "buckets" to be non-integers; they + // will be floored by toArray (which is called by the protobuf encoder). + // (We take advantage of this for field latencies specifically, because + // the ability to return a non-1 weight from fieldLevelInstrumentation + // means we want to build up our histograms as floating-point rather than + // rounding after every operation.) + private readonly buckets: number[]; + static readonly BUCKET_COUNT = 384; + static readonly EXPONENT_LOG = Math.log(1.1); + + toArray(): number[] { + let bufferedZeroes = 0; + const outputArray: number[] = []; + + for (const value of this.buckets) { + if (value === 0) { + bufferedZeroes++; + } else { + if (bufferedZeroes === 1) { + outputArray.push(0); + } else if (bufferedZeroes !== 0) { + outputArray.push(-bufferedZeroes); + } + outputArray.push(Math.floor(value)); + bufferedZeroes = 0; + } + } + return outputArray; + } + + static durationToBucket(durationNs: number): number { + const log = Math.log(durationNs / 1000.0); + const unboundedBucket = Math.ceil(log / DurationHistogram.EXPONENT_LOG); + + // Compare <= 0 to catch -0 and -infinity + return unboundedBucket <= 0 || Number.isNaN(unboundedBucket) + ? 0 + : unboundedBucket >= DurationHistogram.BUCKET_COUNT + ? DurationHistogram.BUCKET_COUNT - 1 + : unboundedBucket; + } + + incrementDuration(durationNs: number, value = 1): DurationHistogram { + this.incrementBucket(DurationHistogram.durationToBucket(durationNs), value); + return this; + } + + incrementBucket(bucket: number, value = 1) { + if (bucket >= DurationHistogram.BUCKET_COUNT) { + // Since we don't have fixed size arrays I'd rather throw the error manually + throw Error('Bucket is out of bounds of the buckets array'); + } + + // Extend the array if we haven't gotten it long enough to handle the new bucket + if (bucket >= this.buckets.length) { + const oldLength = this.buckets.length; + this.buckets.length = bucket + 1; + this.buckets.fill(0, oldLength); + } + + this.buckets[bucket] += value; + } + + combine(otherHistogram: DurationHistogram) { + for (let i = 0; i < otherHistogram.buckets.length; i++) { + this.incrementBucket(i, otherHistogram.buckets[i]); + } + } + + constructor(options?: DurationHistogramOptions) { + const initSize = options?.initSize || 74; + const buckets = options?.buckets; + + const arrayInitSize = Math.max(buckets?.length || 0, initSize); + + this.buckets = Array(arrayInitSize).fill(0); + + if (buckets) { + buckets.forEach((val, index) => (this.buckets[index] = val)); + } + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/index.ts new file mode 100644 index 00000000..cb853763 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/index.ts @@ -0,0 +1,9 @@ +export { ApolloServerPluginUsageReporting } from './plugin.js'; +export type { + ApolloServerPluginUsageReportingOptions, + SendValuesBaseOptions, + VariableValueOptions, + SendErrorsOptions, + ClientInfo, + GenerateClientInfo, +} from './options.js'; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/iterateOverTrace.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/iterateOverTrace.ts new file mode 100644 index 00000000..5fad77cd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/iterateOverTrace.ts @@ -0,0 +1,140 @@ +import type { Trace } from '@apollo/usage-reporting-protobuf'; + +/** + * Iterates over the entire trace, calling `f` on each Trace.Node found. It + * looks under the "root" node as well as any inside the query plan. If any `f` + * returns true, it stops walking the tree. + * + * Each call to `f` will receive an object that implements ResponseNamePath. If + * `includePath` is true, `f` can call `toArray()` on it to convert the + * linked-list representation to an array of the response name (field name) + * nodes that you navigate to get to the node (including a "service:subgraph" + * top-level node if this is a federated trace). Note that we don't add anything + * to the path for index (list element) nodes. This is because the only use case + * we have (error path statistics) does not care about list indexes (it's not + * that interesting to know that sometimes an error was at foo.3.bar and + * sometimes foo.5.bar, vs just generally foo.bar). + * + * If `includePath` is false, we don't bother to build up the linked lists, and + * calling `toArray()` will throw. + */ +export function iterateOverTrace( + trace: Trace, + f: (node: Trace.INode, path: ResponseNamePath) => boolean, + includePath: boolean, +) { + const rootPath = includePath + ? new RootCollectingPathsResponseNamePath() + : notCollectingPathsResponseNamePath; + if (trace.root) { + if (iterateOverTraceNode(trace.root, rootPath, f)) return; + } + + if (trace.queryPlan) { + if (iterateOverQueryPlan(trace.queryPlan, rootPath, f)) return; + } +} + +// Helper for iterateOverTrace; returns true to stop the overall walk. +function iterateOverQueryPlan( + node: Trace.IQueryPlanNode, + rootPath: ResponseNamePath, + f: (node: Trace.INode, path: ResponseNamePath) => boolean, +): boolean { + if (!node) return false; + + if (node.fetch?.trace?.root && node.fetch.serviceName) { + return iterateOverTraceNode( + node.fetch.trace.root, + rootPath.child(`service:${node.fetch.serviceName}`), + f, + ); + } + if (node.flatten?.node) { + return iterateOverQueryPlan(node.flatten.node, rootPath, f); + } + if (node.parallel?.nodes) { + // We want to stop as soon as some call returns true, which happens to be + // exactly what 'some' does. + return node.parallel.nodes.some((node) => + iterateOverQueryPlan(node, rootPath, f), + ); + } + if (node.sequence?.nodes) { + // We want to stop as soon as some call returns true, which happens to be + // exactly what 'some' does. + return node.sequence.nodes.some((node) => + iterateOverQueryPlan(node, rootPath, f), + ); + } + + return false; +} + +// Helper for iterateOverTrace; returns true to stop the overall walk. +function iterateOverTraceNode( + node: Trace.INode, + path: ResponseNamePath, + f: (node: Trace.INode, path: ResponseNamePath) => boolean, +): boolean { + // Invoke the function; if it returns true, don't descend and tell callers to + // stop walking. + if (f(node, path)) { + return true; + } + + return ( + // We want to stop as soon as some call returns true, which happens to be + // exactly what 'some' does. + node.child?.some((child) => { + const childPath = child.responseName + ? path.child(child.responseName) + : path; + return iterateOverTraceNode(child, childPath, f); + }) ?? false + ); +} + +export interface ResponseNamePath { + toArray(): string[]; + child(responseName: string): ResponseNamePath; +} + +const notCollectingPathsResponseNamePath: ResponseNamePath = { + toArray() { + throw Error('not collecting paths!'); + }, + child() { + return this; + }, +}; + +type CollectingPathsResponseNamePath = + | RootCollectingPathsResponseNamePath + | ChildCollectingPathsResponseNamePath; +class RootCollectingPathsResponseNamePath implements ResponseNamePath { + toArray() { + return []; + } + child(responseName: string) { + return new ChildCollectingPathsResponseNamePath(responseName, this); + } +} +class ChildCollectingPathsResponseNamePath implements ResponseNamePath { + constructor( + readonly responseName: string, + readonly prev: CollectingPathsResponseNamePath, + ) {} + toArray() { + const out = []; + let curr: CollectingPathsResponseNamePath = this; + while (curr instanceof ChildCollectingPathsResponseNamePath) { + out.push(curr.responseName); + curr = curr.prev; + } + return out.reverse(); + } + child(responseName: string) { + return new ChildCollectingPathsResponseNamePath(responseName, this); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/operationDerivedDataCache.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/operationDerivedDataCache.ts new file mode 100644 index 00000000..ee737c15 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/operationDerivedDataCache.ts @@ -0,0 +1,61 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { ReferencedFieldsByType } from '@apollo/utils.usagereporting'; +import { LRUCache } from 'lru-cache'; + +export interface OperationDerivedData { + signature: string; + referencedFieldsByType: ReferencedFieldsByType; +} + +export function createOperationDerivedDataCache({ + logger, +}: { + logger: Logger; +}): LRUCache { + let lastWarn: Date; + let lastDisposals = 0; + return new LRUCache({ + // Calculate the length of cache objects by the JSON.stringify byteLength. + sizeCalculation(obj) { + return Buffer.byteLength(JSON.stringify(obj), 'utf8'); + }, + // 10MiB limit, very much approximately since we can't be sure how V8 might + // be storing this data internally. Though this should be enough to store a + // fair amount of operation data, depending on their overall complexity. A + // future version of this might expose some configuration option to grow the + // cache, but ideally, we could do that dynamically based on the resources + // available to the server, and not add more configuration surface area. + // Hopefully the warning message will allow us to evaluate the need with + // more validated input from those that receive it. + maxSize: Math.pow(2, 20) * 10, + dispose() { + // Count the number of disposals between warning messages. + lastDisposals++; + + // Only show a message warning about the high turnover every 60 seconds. + if (!lastWarn || new Date().getTime() - lastWarn.getTime() > 60000) { + // Log the time that we last displayed the message. + lastWarn = new Date(); + logger.warn( + [ + 'This server is processing a high number of unique operations. ', + `A total of ${lastDisposals} records have been `, + 'ejected from the ApolloServerPluginUsageReporting signature cache in the past ', + 'interval. If you see this warning frequently, please open an ', + 'issue on the Apollo Server repository.', + ].join(''), + ); + + // Reset the disposal counter for the next message interval. + lastDisposals = 0; + } + }, + }); +} + +export function operationDerivedDataCacheKey( + queryHash: string, + operationName: string, +) { + return `${queryHash}${operationName && ':' + operationName}`; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/options.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/options.ts new file mode 100644 index 00000000..62b7ff7d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/options.ts @@ -0,0 +1,414 @@ +import type { GraphQLError, DocumentNode } from 'graphql'; +import type { + GraphQLRequestContextDidResolveOperation, + GraphQLRequestContext, + GraphQLRequestContextWillSendResponse, + BaseContext, +} from '../../externalTypes/index.js'; +import type { Logger } from '@apollo/utils.logger'; +import type { Trace } from '@apollo/usage-reporting-protobuf'; +import type { Fetcher } from '@apollo/utils.fetcher'; + +export interface ApolloServerPluginUsageReportingOptions< + TContext extends BaseContext, +> { + //#region Configure exactly which data should be sent to Apollo. + /** + * Apollo Server's usage reports describe each individual request in one of + * two ways: as a "trace" (a detailed description of the specific request, + * including a query plan and resolver tree with timings and errors, as well + * as optional details like variable values and HTTP headers), or as part of + * aggregated "stats" (where invocations of the same operation from the same + * client program are aggregated together rather than described individually). + * Apollo Server uses an heuristic to decide which operations to describe as + * traces and which to aggregate as stats. + * + * By setting the `sendTraces` option to `false`, Apollo Server will describe + * *all* operations as stats; individual requests will never be broken out + * into separate traces. If you set `sendTraces: false`, then Apollo Studio's + * Traces view won't show any traces (other Studio functionality will be + * unaffected). + * + * Note that the values of `sendVariableValues`, `sendHeaders`, and + * `sendUnexecutableOperationDocuments` are irrelevant if you set + * `sendTraces: false`, because those options control data that is contained + * only in traces (not in stats). + * + * Setting `sendTraces: false` does *NOT* imply `fieldLevelInstrumentation: + * 0`. Apollo Server can still take advantage of field-level instrumentation + * (either directly for monolith servers, or via federated tracing for + * Gateways) in order to accurately report field execution usage in "stats". + * This option only controls whether data is sent to Apollo's servers as + * traces, not whether traces are internally used to learn about usage. + */ + sendTraces?: boolean; + + /** + * By default, Apollo Server does not send the values of any GraphQL variables + * to Apollo's servers, because variable values often contain the private data + * of your app's users. If you'd like variable values to be included in + * traces, set this option. This option can take several forms: + * - { none: true }: don't send any variable values (DEFAULT) + * - { all: true}: send all variable values + * - { transform: ... }: a custom function for modifying variable values. The + * function receives `variables` and `operationString` and should return a + * record of `variables` with the same keys as the `variables` it receives + * (added variables will be ignored and removed variables will be reported + * with an empty value). For security reasons, if an error occurs within + * this function, all variable values will be replaced with + * `[PREDICATE_FUNCTION_ERROR]`. + * - { exceptNames: ... }: a case-sensitive list of names of variables whose + * values should not be sent to Apollo servers + * - { onlyNames: ... }: A case-sensitive list of names of variables whose + * values will be sent to Apollo servers + * + * Defaults to not sending any variable values if both this parameter and the + * deprecated `privateVariables` are not set. The report will indicate each + * private variable key whose value was redacted by { none: true } or { + * exceptNames: [...] }. + * + * The value of this option is not relevant if you set `sendTraces: false`, + * because variable values only appear in traces. + */ + sendVariableValues?: VariableValueOptions; + /** + * By default, Apollo Server does not send the HTTP request headers and values + * to Apollo's servers, as these headers may contain your users' private data. + * If you'd like this information included in traces, set this option. This + * option can take several forms: + * + * - { none: true } to drop all HTTP request headers (DEFAULT) + * - { all: true } to send the values of all HTTP request headers + * - { exceptNames: Array } A case-insensitive list of names of HTTP + * headers whose values should not be sent to Apollo servers + * - { onlyNames: Array }: A case-insensitive list of names of HTTP + * headers whose values will be sent to Apollo servers + * + * Unlike with sendVariableValues, names of dropped headers are not reported. + * The headers 'authorization', 'cookie', and 'set-cookie' are never reported. + * + * The value of this option is not relevant if you set `sendTraces: false`, + * because request headers only appear in traces. + */ + sendHeaders?: SendValuesBaseOptions; + /** + * By default, if a trace contains errors, the errors are reported to Apollo + * servers with the message ``. The errors are associated with + * specific paths in the operation, but do not include the original error + * message or any extensions such as the error `code`, as those details may + * contain your users' private data. The extension `maskedBy: + * 'ApolloServerPluginUsageReporting'` is added. + * + * If you'd like details about the error included in traces, set this option. + * This option can take several forms: + * + * - { masked: true }: mask error messages and omit extensions (DEFAULT) + * - { unmodified: true }: send all error messages and extensions to Apollo + * servers + * - { transform: ... }: a custom function for transforming errors. This + * function receives a `GraphQLError` and may return a `GraphQLError` + * (either a new error, or its potentially-modified argument) or `null`. + * This error is used in the report to Apollo servers; if `null`, the error + * is not included in traces or error statistics. + * + * If you set `sendTraces: false`, then the only relevant aspect of this + * option is whether you return `null` from a `transform` function or not + * (which affects aggregated error statistics). + */ + sendErrors?: SendErrorsOptions; + + /** + * This option allows you to choose if Apollo Server should calculate detailed + * per-field statistics for a particular request. It is only called for + * executable operations: operations which parse and validate properly and + * which do not have an unknown operation name. It is not called if an + * `includeRequest` hook is provided and returns false. + * + * You can either pass an async function or a number. The function receives a + * `GraphQLRequestContext`. (The effect of passing a number is described + * later.) Your function can return a boolean or a number; returning false is + * equivalent to returning 0 and returning true is equivalent to returning 1. + * + * Returning false (or 0) means that Apollo Server will only pay attention to + * overall properties of the operation, like what GraphQL operation is + * executing and how long the entire operation takes to execute, and not + * anything about field-by-field execution. + * + * If you return false (or 0), this operation *will* still contribute to most + * features of Studio, such as schema checks, the Operations page, and the + * "referencing operations" statistic on the Fields page, etc. + * + * If you return false (or 0), this operation will *not* contribute to the + * "field executions" statistic on the Fields page or to the execution timing + * hints optionally displayed in Studio Explorer or in vscode-graphql. + * Additionally, this operation will not produce a trace that can be viewed on + * the Traces section of the Operations page. + * + * Returning false (or 0) for some or all operations can improve your server's + * performance, as the overhead of calculating complete traces is not always + * negligible. This is especially the case if this server is an Apollo + * Gateway, as captured traces are transmitted from the subgraph to the + * Gateway in-band inside the actual GraphQL response. + * + * Returning a positive number means that Apollo Server will track each field + * execution and send Apollo Studio statistics on how many times each field + * was executed and what the per-field performance was. Apollo Server sends + * both a precise observed execution count and an estimated execution count. + * The former is calculated by counting each field execution as 1, and the + * latter is calculated by counting each field execution as the number + * returned from this hook, which can be thought of as a weight. + * + * Passing a number `x` (which should be between 0 and 1 inclusive) for + * `fieldLevelInstrumentation` is equivalent to passing the function `async () + * => Math.random() < x ? 1/x : 0`. For example, if you pass 0.01, then 99% + * of the time this function will return 0, and 1% of the time this function + * will return 100. So 99% of the time Apollo Server will not track field + * executions, and 1% of the time Apollo Server will track field executions + * and send them to Apollo Studio both as an exact observed count and as an + * "estimated" count which is 100 times higher. Generally, the weights you + * return should be roughly the reciprocal of the probability that the + * function returns non-zero; however, you're welcome to craft a more + * sophisticated function, such as one that uses a higher probability for + * rarer operations and a lower probability for more common operations. + * + * (Note that returning true here does *not* mean that the data derived from + * field-level instrumentation must be transmitted to Apollo Studio's servers + * in the form of a trace; it may still be aggregated locally to statistics. + * Similarly, setting `sendTraces: false` does not affect + * `fieldLevelInstrumentation`. But either way this operation will contribute + * to the "field executions" statistic and timing hints.) + * + * The default `fieldLevelInstrumentation` is a function that always returns + * true. + */ + fieldLevelInstrumentation?: + | number + | (( + request: GraphQLRequestContextDidResolveOperation, + ) => Promise); + + /** + * This option allows you to choose if a particular request should be + * represented in the usage reporting sent to Apollo servers. By default, all + * requests are included. If this async predicate function is specified, its + * return value will determine whether a given request is included. + * + * Note that returning false here means that the operation will be completely + * ignored by all Apollo Studio features. If you merely want to improve + * performance by skipping the field-level execution trace, set the + * `fieldLevelInstrumentation` option instead of this one. + * + * The predicate function receives the request context. If validation and + * parsing of the request succeeds, the function will receive the request + * context in the + * [`GraphQLRequestContextDidResolveOperation`](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#didresolveoperation) + * phase, which permits tracing based on dynamic properties, e.g., HTTP + * headers or the `operationName` (when available). Otherwise it will receive + * the request context in the + * [`GraphQLRequestContextWillSendResponse`](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#willsendresponse) + * phase: + * + * (If you don't want any usage reporting at all, don't use this option: + * instead, either avoid specifying an Apollo API key, or use + * ApolloServerPluginUsageReportingDisabled to prevent this plugin from being + * created by default.) + * + * **Example:** + * + * ```js + * includeRequest(requestContext) { + * // Always include `query HomeQuery { ... }`. + * if (requestContext.operationName === "HomeQuery") return true; + * + * // Omit if the "report-to-apollo" header is set to "false". + * if (requestContext.request.http?.headers?.get("report-to-apollo") === "false") { + * return false; + * } + * + * // Otherwise include. + * return true; + * }, + * ``` + * + */ + includeRequest?: ( + request: + | GraphQLRequestContextDidResolveOperation + | GraphQLRequestContextWillSendResponse, + ) => Promise; + /** + * By default, this plugin associates client information such as name + * and version with user requests based on HTTP headers starting with + * `apollographql-client-`. If you have another way of communicating + * client information to your server, tell the plugin how it works + * with this option. + */ + generateClientInfo?: GenerateClientInfo; + /** + * If you are using the `overrideReportedSchema` option to the schema + * reporting plugin (`ApolloServerPluginSchemaReporting`), you should + * pass the same value here as well, so that the schema ID associated + * with requests in this plugin's usage reports matches the schema + * ID that the other plugin reports. + */ + overrideReportedSchema?: string; + /** + * Whether to include the entire document in the trace if the operation + * was a GraphQL parse or validation error (i.e. failed the GraphQL parse or + * validation phases). This will be included as a separate field on the trace + * and the operation name and signature will always be reported with a constant + * identifier. Whether the operation was a parse failure or a validation + * failure will be embedded within the stats report key itself. + * + * The value of this option is not relevant if you set `sendTraces: false`, + * because unexecutable operation documents only appear in traces. + */ + sendUnexecutableOperationDocuments?: boolean; + + /** + * This plugin sends information about operations to Apollo's servers in two + * forms: as detailed operation traces of single operations and as summarized + * statistics of many operations. Each individual operation is described in + * exactly one of those ways. This hook lets you select which operations are + * sent as traces and which are sent as statistics. The default is a heuristic + * that tries to send one trace for each rough duration bucket for each + * operation each minute, plus more if the operations have errors. (Note that + * Apollo's servers perform their own sampling on received traces; not all + * traces sent to Apollo's servers can be later retrieved via the trace UI.) + * + * If you just want to send all operations as stats, set `sendTraces: false` + * instead of using this experimental hook. + * + * This option is highly experimental and may change or be removed in future + * versions. + */ + experimental_sendOperationAsTrace?: ( + trace: Trace, + statsReportKey: string, + ) => boolean; + //#endregion + + //#region Configure the mechanics of communicating with Apollo's servers. + /** + * Sends a usage report after every request. This options is useful for + * stateless environments like Amazon Lambda where processes handle only a + * small number of requests before terminating. It defaults to true when the + * ApolloServer was started in the background with + * `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests` + * (generally used with serverless frameworks), or false otherwise. (Note that + * "immediately" does not mean synchronously with completing the response, but + * "very soon", such as after a setImmediate call.) + */ + sendReportsImmediately?: boolean; + /** + * Specifies which Fetch API implementation to use when sending usage reports. + */ + fetcher?: Fetcher; + /** + * How often to send reports to Apollo. We'll also send reports when the + * report gets big; see maxUncompressedReportSize. + */ + reportIntervalMs?: number; + /** + * We send a report when the report size will become bigger than this size in + * bytes (default: 4MB). (This is a rough limit --- we ignore the size of the + * report header and some other top level bytes. We just add up the lengths of + * the serialized traces and signatures.) + */ + maxUncompressedReportSize?: number; + /** + * Reporting is retried with exponential backoff up to this many times + * (including the original request). Defaults to 5. + */ + maxAttempts?: number; + /** + * Minimum back-off for retries. Defaults to 100ms. + */ + minimumRetryDelayMs?: number; + /** + * Timeout for each individual attempt to send a report to Apollo. (This is + * for each HTTP POST, not for all potential retries.) Defaults to 30 seconds + * (30000ms). + */ + requestTimeoutMs?: number; + /** + * A logger interface to be used for output and errors. When not provided + * it will default to the server's own `logger` implementation and use + * `console` when that is not available. + */ + logger?: Logger; + /** + * By default, if an error occurs when sending trace reports to Apollo + * servers, its message will be sent to the `error` method on the logger + * specified with the `logger` option to this plugin or to ApolloServer (or to + * `console.error` by default). Specify this function to process errors in a + * different way. (The difference between using this option and using a logger + * is that this option receives the actual Error object whereas `logger.error` + * only receives its message.) + */ + reportErrorFunction?: (err: Error) => void; + //#endregion + + //#region Internal and non-recommended options + /** + * The URL base that we send reports to (not including the path). This option + * only needs to be set for testing and Apollo-internal uses. + */ + endpointUrl?: string; + /** + * If set, prints all reports as JSON when they are sent. (Note that for + * technical reasons, traces embedded in a report are printed separately when + * they are added to a report.) Reports are sent through `logger.info`. + */ + debugPrintReports?: boolean; + /** + * Specify the function for creating a signature for a query. See signature.ts + * for details. This option is not recommended, as Apollo's servers make assumptions + * about how the signature relates to the operation you executed. + */ + calculateSignature?: (ast: DocumentNode, operationName: string) => string; + /** + * This option is for internal use by `@apollo/server` only. + * + * By default we want to enable this plugin for non-subgraph schemas only, but + * we need to come up with our list of plugins before we have necessarily + * loaded the schema. So (unless the user installs this plugin or + * ApolloServerPluginUsageReportingDisabled themselves), `@apollo/server` + * always installs this plugin (if API key and graph ref are provided) and + * uses this option to disable usage reporting if the schema is a subgraph. + */ + __onlyIfSchemaIsNotSubgraph?: boolean; + //#endregion +} + +export type SendValuesBaseOptions = + | { onlyNames: Array } + | { exceptNames: Array } + | { all: true } + | { none: true }; + +type VariableValueTransformOptions = { + variables: Record; + operationString?: string; +}; + +export type VariableValueOptions = + | { + transform: ( + options: VariableValueTransformOptions, + ) => Record; + } + | SendValuesBaseOptions; + +export type SendErrorsOptions = + | { unmodified: true } + | { masked: true } + | { transform: (err: GraphQLError) => GraphQLError | null }; + +export interface ClientInfo { + clientName?: string; + clientVersion?: string; +} +export type GenerateClientInfo = ( + requestContext: GraphQLRequestContext, +) => ClientInfo; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/plugin.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/plugin.ts new file mode 100644 index 00000000..49a9b9ef --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/plugin.ts @@ -0,0 +1,871 @@ +import { Report, ReportHeader, Trace } from '@apollo/usage-reporting-protobuf'; +import type { Fetcher, FetcherResponse } from '@apollo/utils.fetcher'; +import { + usageReportingSignature, + calculateReferencedFieldsByType, + type ReferencedFieldsByType, +} from '@apollo/utils.usagereporting'; +import retry from 'async-retry'; +import { type GraphQLSchema, printSchema } from 'graphql'; +import { type LRUCache } from 'lru-cache'; +import os from 'os'; +import { gzip } from 'zlib'; +import type { + ApolloServerPlugin, + BaseContext, + GraphQLRequestContext, + GraphQLRequestContextDidResolveOperation, + GraphQLRequestContextWillSendResponse, + GraphQLRequestListener, + GraphQLServerListener, +} from '../../externalTypes/index.js'; +import { internalPlugin } from '../../internalPlugin.js'; +import { dateToProtoTimestamp, TraceTreeBuilder } from '../traceTreeBuilder.js'; +import { defaultSendOperationsAsTrace } from './defaultSendOperationsAsTrace.js'; +import { + createOperationDerivedDataCache, + type OperationDerivedData, + operationDerivedDataCacheKey, +} from './operationDerivedDataCache.js'; +import type { + ApolloServerPluginUsageReportingOptions, + SendValuesBaseOptions, +} from './options.js'; +import { OurReport } from './stats.js'; +import { makeTraceDetails } from './traceDetails.js'; +import { packageVersion } from '../../generated/packageVersion.js'; +import { computeCoreSchemaHash } from '../../utils/computeCoreSchemaHash.js'; +import type { HeaderMap } from '../../utils/HeaderMap.js'; +import { schemaIsSubgraph } from '../schemaIsSubgraph.js'; + +const reportHeaderDefaults = { + hostname: os.hostname(), + agentVersion: `@apollo/server@${packageVersion}`, + runtimeVersion: `node ${process.version}`, + // XXX not actually uname, but what node has easily. + uname: `${os.platform()}, ${os.type()}, ${os.release()}, ${os.arch()})`, +}; + +export function ApolloServerPluginUsageReporting( + options: ApolloServerPluginUsageReportingOptions = Object.create( + null, + ), +): ApolloServerPlugin { + const fieldLevelInstrumentationOption = options.fieldLevelInstrumentation; + const fieldLevelInstrumentation = + typeof fieldLevelInstrumentationOption === 'number' + ? async () => + Math.random() < fieldLevelInstrumentationOption + ? 1 / fieldLevelInstrumentationOption + : 0 + : fieldLevelInstrumentationOption + ? fieldLevelInstrumentationOption + : async () => true; + + let requestDidStartHandler: + | (( + requestContext: GraphQLRequestContext, + ) => GraphQLRequestListener) + | null = null; + return internalPlugin({ + __internal_plugin_id__: 'UsageReporting', + __is_disabled_plugin__: false, + + // We want to be able to access locals from `serverWillStart` in our `requestDidStart`, thus + // this little hack. (Perhaps we should also allow GraphQLServerListener to contain + // a requestDidStart?) + async requestDidStart(requestContext: GraphQLRequestContext) { + if (requestDidStartHandler) { + return requestDidStartHandler(requestContext); + } + // This happens if usage reporting is disabled (eg because this is a + // subgraph). + return {}; + }, + + async serverWillStart({ + logger: serverLogger, + apollo, + startedInBackground, + schema, + }): Promise { + // Use the plugin-specific logger if one is provided; otherwise the general server one. + const logger = options.logger ?? serverLogger; + const { key, graphRef } = apollo; + if (!(key && graphRef)) { + throw new Error( + "You've enabled usage reporting via ApolloServerPluginUsageReporting, " + + 'but you also need to provide your Apollo API key and graph ref, via ' + + 'the APOLLO_KEY/APOLLO_GRAPH_REF environment ' + + 'variables or via `new ApolloServer({apollo: {key, graphRef})`.', + ); + } + + if (schemaIsSubgraph(schema)) { + if (options.__onlyIfSchemaIsNotSubgraph) { + logger.warn( + 'You have specified an Apollo API key and graph ref but this server appears ' + + 'to be a subgraph. Typically usage reports are sent to Apollo by your Router ' + + 'or Gateway, not directly from your subgraph; usage reporting is disabled. To ' + + 'enable usage reporting anyway, explicitly install `ApolloServerPluginUsageReporting`. ' + + 'To disable this warning, install `ApolloServerPluginUsageReportingDisabled`.', + ); + // This early return means we don't start background timers, don't + // register serverDidStart, don't assign requestDidStartHandler, etc. + return {}; + } else { + // This is just a warning; usage reporting is still enabled. If it + // turns out there are lots of people who really need to have this odd + // setup and they don't like the warning, we can provide a new option + // to disable the warning (or they can filter in their `logger`). + logger.warn( + 'You have installed `ApolloServerPluginUsageReporting` but this server appears to ' + + 'be a subgraph. Typically usage reports are sent to Apollo by your Router ' + + 'or Gateway, not directly from your subgraph. If this was unintentional, remove ' + + "`ApolloServerPluginUsageReporting` from your server's `plugins` array.", + ); + } + } + + logger.info( + 'Apollo usage reporting starting! See your graph at ' + + `https://studio.apollographql.com/graph/${encodeURI(graphRef)}/`, + ); + + // If sendReportsImmediately is not specified, we default to true if we're running + // with the ApolloServer designed for Lambda or similar. That's because these + // environments aren't designed around letting us run a background task to + // send reports later or hook into container destruction to flush buffered reports. + const sendReportsImmediately = + options.sendReportsImmediately ?? startedInBackground; + + // Since calculating the signature and referenced fields for usage + // reporting is potentially an expensive operation, we'll cache the data + // we generate and re-use them for repeated operations for the same + // `queryHash`. However, because referenced fields depend on the current + // schema, we want to throw it out entirely any time the schema changes. + let operationDerivedDataCache: { + forSchema: GraphQLSchema; + cache: LRUCache; + } | null = null; + + // This map maps from executable schema ID (schema hash, basically) to the + // report we'll send about it. That's because when we're using a gateway, + // the schema can change over time, but each report needs to be about a + // single schema. We avoid having this function be a memory leak by + // removing values from it when we're in the process of sending reports. + // That means we have to be very careful never to pull a Report out of it + // and hang on to it for a while before writing to it, because the report + // might have gotten sent and discarded in the meantime. So you should + // only access the values of this Map via + // getReportWhichMustBeUsedImmediately and getAndDeleteReport, and never + // hang on to the value returned by getReportWhichMustBeUsedImmediately. + const reportByExecutableSchemaId = new Map(); + const getReportWhichMustBeUsedImmediately = ( + executableSchemaId: string, + ): OurReport => { + const existing = reportByExecutableSchemaId.get(executableSchemaId); + if (existing) { + return existing; + } + const report = new OurReport( + new ReportHeader({ + ...reportHeaderDefaults, + executableSchemaId, + graphRef, + }), + ); + reportByExecutableSchemaId.set(executableSchemaId, report); + return report; + }; + const getAndDeleteReport = ( + executableSchemaId: string, + ): OurReport | null => { + const report = reportByExecutableSchemaId.get(executableSchemaId); + if (report) { + reportByExecutableSchemaId.delete(executableSchemaId); + return report; + } + return null; + }; + + const overriddenExecutableSchemaId = options.overrideReportedSchema + ? computeCoreSchemaHash(options.overrideReportedSchema) + : undefined; + + let lastSeenExecutableSchemaToId: + | { + executableSchema: GraphQLSchema; + executableSchemaId: string; + } + | undefined; + + let reportTimer: NodeJS.Timeout | undefined; + if (!sendReportsImmediately) { + reportTimer = setInterval( + () => sendAllReportsAndReportErrors(), + options.reportIntervalMs || 10 * 1000, + ); + } + + // We don't send traces if the user set `sendTraces: false`. We also may + // set this to false later if the usage-reporting ingress informs us that + // this graph does not support viewing traces. + let sendTraces = options.sendTraces ?? true; + const sendOperationAsTrace = + options.experimental_sendOperationAsTrace ?? + defaultSendOperationsAsTrace(); + + let stopped = false; + + function executableSchemaIdForSchema(schema: GraphQLSchema) { + if (lastSeenExecutableSchemaToId?.executableSchema === schema) { + return lastSeenExecutableSchemaToId.executableSchemaId; + } + const id = computeCoreSchemaHash(printSchema(schema)); + + // We override this variable every time we get a new schema so we cache + // the last seen value. It is a single-entry cache. + lastSeenExecutableSchemaToId = { + executableSchema: schema, + executableSchemaId: id, + }; + + return id; + } + + async function sendAllReportsAndReportErrors(): Promise { + await Promise.all( + [...reportByExecutableSchemaId.keys()].map((executableSchemaId) => + sendReportAndReportErrors(executableSchemaId), + ), + ); + } + + async function sendReportAndReportErrors( + executableSchemaId: string, + ): Promise { + return sendReport(executableSchemaId).catch((err) => { + // This catch block is primarily intended to catch network errors from + // the retried request itself, which include network errors and non-2xx + // HTTP errors. + if (options.reportErrorFunction) { + options.reportErrorFunction(err); + } else { + logger.error(err.message); + } + }); + } + + // Needs to be an arrow function to be confident that key is defined. + const sendReport = async (executableSchemaId: string): Promise => { + let report = getAndDeleteReport(executableSchemaId); + if ( + !report || + (Object.keys(report.tracesPerQuery).length === 0 && + report.operationCount === 0) + ) { + return; + } + + // Set the report's overall end time. This is the timestamp that will be + // associated with the summarized statistics. + report.endTime = dateToProtoTimestamp(new Date()); + + report.ensureCountsAreIntegers(); + + const protobufError = Report.verify(report); + if (protobufError) { + throw new Error(`Error verifying report: ${protobufError}`); + } + let message: Uint8Array | null = Report.encode(report).finish(); + // Let the original protobuf object be garbage collected (helpful if the + // HTTP request hangs). + report = null; + + // Potential follow-up: we can compare message.length to + // report.sizeEstimator.bytes and use it to "learn" if our estimation is + // off and adjust it based on what we learn. + + if (options.debugPrintReports) { + // We decode the report rather than printing the original `report` + // so that it includes all of the pre-encoded traces. + const decodedReport = Report.decode(message); + logger.info( + `Apollo usage report: ${JSON.stringify(decodedReport.toJSON())}`, + ); + } + + const compressed = await new Promise((resolve, reject) => { + gzip(message!, (error, result) => { + error ? reject(error) : resolve(result); + }); + }); + // Let the uncompressed message be garbage collected (helpful if the + // HTTP request is slow). + message = null; + + // Wrap fetcher with async-retry for automatic retrying + const fetcher: Fetcher = options.fetcher ?? fetch; + const response: FetcherResponse = await retry( + // Retry on network errors and 5xx HTTP + // responses. + async () => { + const curResponse = await fetcher( + (options.endpointUrl || + 'https://usage-reporting.api.apollographql.com') + + '/api/ingress/traces', + { + method: 'POST', + headers: { + 'user-agent': 'ApolloServerPluginUsageReporting', + 'x-api-key': key, + 'content-encoding': 'gzip', + accept: 'application/json', + }, + body: compressed, + signal: AbortSignal.timeout(options.requestTimeoutMs ?? 30_000), + }, + ); + + if (curResponse.status >= 500 && curResponse.status < 600) { + throw new Error( + `HTTP status ${curResponse.status}, ${ + (await curResponse.text()) || '(no body)' + }`, + ); + } else { + return curResponse; + } + }, + { + retries: (options.maxAttempts || 5) - 1, + minTimeout: options.minimumRetryDelayMs || 100, + factor: 2, + }, + ).catch((err: Error) => { + throw new Error( + `Error sending report to Apollo servers: ${err.message}`, + ); + }); + + if (response.status < 200 || response.status >= 300) { + // Note that we don't expect to see a 3xx here because request follows + // redirects. + throw new Error( + `Error sending report to Apollo servers: HTTP status ${ + response.status + }, ${(await response.text()) || '(no body)'}`, + ); + } + + if ( + sendTraces && + response.status === 200 && + response.headers + .get('content-type') + ?.match(/^\s*application\/json\s*(?:;|$)/i) + ) { + const body = await response.text(); + let parsedBody; + try { + parsedBody = JSON.parse(body); + } catch (e) { + throw new Error(`Error parsing response from Apollo servers: ${e}`); + } + if (parsedBody.tracesIgnored === true) { + logger.debug( + "This graph's organization does not have access to traces; sending all " + + 'subsequent operations as stats.', + ); + sendTraces = false; + } + } + if (options.debugPrintReports) { + logger.info(`Apollo usage report: status ${response.status}`); + } + }; + + requestDidStartHandler = ({ + metrics, + schema, + request: { http, variables }, + }): GraphQLRequestListener => { + const treeBuilder: TraceTreeBuilder = new TraceTreeBuilder({ + maskedBy: 'ApolloServerPluginUsageReporting', + sendErrors: options.sendErrors, + }); + treeBuilder.startTiming(); + metrics.startHrTime = treeBuilder.startHrTime; + let graphqlValidationFailure = false; + let graphqlUnknownOperationName = false; + let includeOperationInUsageReporting: boolean | null = null; + + if (http) { + treeBuilder.trace.http = new Trace.HTTP({ + method: + Trace.HTTP.Method[ + http.method as keyof typeof Trace.HTTP.Method + ] || Trace.HTTP.Method.UNKNOWN, + }); + + if (options.sendHeaders) { + makeHTTPRequestHeaders( + treeBuilder.trace.http, + http.headers, + options.sendHeaders, + ); + } + } + + // After this function completes, includeOperationInUsageReporting is + // defined. + async function maybeCallIncludeRequestHook( + requestContext: + | GraphQLRequestContextDidResolveOperation + | GraphQLRequestContextWillSendResponse, + ): Promise { + // If this is the second call in `willSendResponse` after + // `didResolveOperation`, we're done. + if (includeOperationInUsageReporting !== null) return; + + if (typeof options.includeRequest !== 'function') { + // Default case we always report + includeOperationInUsageReporting = true; + return; + } + includeOperationInUsageReporting = + await options.includeRequest(requestContext); + + // Help the user understand they've returned an unexpected value, + // which might be a subtle mistake. + if (typeof includeOperationInUsageReporting !== 'boolean') { + logger.warn( + "The 'includeRequest' async predicate function must return a boolean value.", + ); + includeOperationInUsageReporting = true; + } + } + + // Our usage reporting groups everything by operation, so we don't + // actually report about any issues that prevent us from getting an + // operation string (eg, a missing operation, or APQ problems). + // This is effectively bypassing the reporting of: + // - PersistedQueryNotFoundError + // - PersistedQueryNotSupportedError + // - Missing `query` error + // We may want to report them some other way later! + let didResolveSource = false; + + return { + async didResolveSource(requestContext) { + didResolveSource = true; + + if (metrics.persistedQueryHit) { + treeBuilder.trace.persistedQueryHit = true; + } + if (metrics.persistedQueryRegister) { + treeBuilder.trace.persistedQueryRegister = true; + } + + if (variables) { + treeBuilder.trace.details = makeTraceDetails( + variables, + options.sendVariableValues, + requestContext.source, + ); + } + + const clientInfo = ( + options.generateClientInfo || defaultGenerateClientInfo + )(requestContext); + if (clientInfo) { + // While there is a clientAddress protobuf field, the backend + // doesn't pay attention to it yet, so we'll ignore it for now. + const { clientName, clientVersion } = clientInfo; + treeBuilder.trace.clientVersion = clientVersion || ''; + treeBuilder.trace.clientName = clientName || ''; + } + }, + async validationDidStart() { + return async (validationErrors?: ReadonlyArray) => { + graphqlValidationFailure = validationErrors + ? validationErrors.length !== 0 + : false; + }; + }, + async didResolveOperation(requestContext) { + // If operation is undefined then `getOperationAST` returned null + // and an unknown operation was specified. + graphqlUnknownOperationName = + requestContext.operation === undefined; + await maybeCallIncludeRequestHook(requestContext); + + if ( + includeOperationInUsageReporting && + // No need to capture traces if the operation is going to + // immediately fail due to unknown operation name. + !graphqlUnknownOperationName + ) { + if (metrics.captureTraces === undefined) { + // We're not completely ignoring the operation. But should we + // calculate a detailed trace of every field while we do so (either + // directly in this plugin, or in a subgraph by sending the + // apollo-federation-include-trace header)? That will allow this + // operation to contribute to the "field executions" column in the + // Studio Fields page, to the timing hints in Explorer and + // vscode-graphql, and to the traces visible under Operations. (Note + // that `true` here does not imply that this operation will + // necessarily be *sent* to the usage-reporting endpoint in the form + // of a trace --- it still might be aggregated into stats first. But + // capturing a trace will mean we can understand exactly what fields + // were executed and what their performance was, at the tradeoff of + // some overhead for tracking the trace (and transmitting it between + // subgraph and gateway). + const rawWeight = + await fieldLevelInstrumentation(requestContext); + treeBuilder.trace.fieldExecutionWeight = + typeof rawWeight === 'number' ? rawWeight : rawWeight ? 1 : 0; + + metrics.captureTraces = + !!treeBuilder.trace.fieldExecutionWeight; + } + } + }, + async executionDidStart() { + // If we're not capturing traces, don't return a willResolveField so + // that we don't build up a detailed trace inside treeBuilder. (We still + // will use treeBuilder as a convenient place to put top-level facts + // about the operation which can end up aggregated as stats, and we do + // eventually put *errors* onto the trace tree.) + if (!metrics.captureTraces) return; + + return { + willResolveField({ info }) { + return treeBuilder.willResolveField(info); + // We could save the error into the trace during the end handler, but + // it won't have all the information that graphql-js adds to it later, + // like 'locations'. + }, + }; + }, + + async didEncounterSubsequentErrors(_requestContext, errors) { + treeBuilder.didEncounterErrors(errors); + }, + + async willSendSubsequentPayload(requestContext, payload) { + if (!payload.hasNext) { + await operationFinished(requestContext); + } + }, + + async willSendResponse(requestContext) { + // Search above for a comment about "didResolveSource" to see which + // of the pre-source-resolution errors we are intentionally avoiding. + if (!didResolveSource) return; + if (requestContext.errors) { + treeBuilder.didEncounterErrors(requestContext.errors); + } + + // If there isn't any defer/stream coming later, we're done. + // Otherwise willSendSubsequentPayload will trigger + // operationFinished. + if (requestContext.response.body.kind === 'single') { + await operationFinished(requestContext); + } + }, + }; + + async function operationFinished( + requestContext: GraphQLRequestContextWillSendResponse, + ) { + const resolvedOperation = !!requestContext.operation; + + // If we got an error before we called didResolveOperation (eg parse or + // validation error), check to see if we should include the request. + await maybeCallIncludeRequestHook(requestContext); + + treeBuilder.stopTiming(); + const executableSchemaId = + overriddenExecutableSchemaId ?? executableSchemaIdForSchema(schema); + + if (includeOperationInUsageReporting === false) { + if (resolvedOperation) { + getReportWhichMustBeUsedImmediately(executableSchemaId) + .operationCount++; + } + return; + } + + treeBuilder.trace.fullQueryCacheHit = !!metrics.responseCacheHit; + treeBuilder.trace.forbiddenOperation = !!metrics.forbiddenOperation; + treeBuilder.trace.registeredOperation = !!metrics.registeredOperation; + + const policyIfCacheable = + requestContext.overallCachePolicy.policyIfCacheable(); + if (policyIfCacheable) { + treeBuilder.trace.cachePolicy = new Trace.CachePolicy({ + scope: + policyIfCacheable.scope === 'PRIVATE' + ? Trace.CachePolicy.Scope.PRIVATE + : policyIfCacheable.scope === 'PUBLIC' + ? Trace.CachePolicy.Scope.PUBLIC + : Trace.CachePolicy.Scope.UNKNOWN, + // Convert from seconds to ns. + maxAgeNs: policyIfCacheable.maxAge * 1e9, + }); + } + + // If this was a federated operation and we're the gateway, add the query plan + // to the trace. + if (metrics.queryPlanTrace) { + treeBuilder.trace.queryPlan = metrics.queryPlanTrace; + } + + // Intentionally un-awaited so as not to block the response. Any + // errors will be logged, but will not manifest a user-facing error. + // The logger in this case is a request specific logger OR the logger + // defined by the plugin if that's unavailable. The request-specific + // logger is preferred since this is very much coupled directly to a + // client-triggered action which might be more granularly tagged by + // logging implementations. + addTrace().catch(logger.error.bind(logger)); + + async function addTrace(): Promise { + // Ignore traces that come in after stop(). + if (stopped) { + return; + } + + // Ensure that the caller of addTrace (which does not await it) is + // not blocked. We use setImmediate rather than process.nextTick or + // just relying on the Promise microtask queue because setImmediate + // comes after IO, which is what we want. + await new Promise((res) => setImmediate(res)); + + const executableSchemaId = + overriddenExecutableSchemaId ?? + executableSchemaIdForSchema(schema); + + const { trace } = treeBuilder; + + let statsReportKey: string | undefined = undefined; + let referencedFieldsByType: ReferencedFieldsByType; + if (!requestContext.document) { + statsReportKey = `## GraphQLParseFailure\n`; + } else if (graphqlValidationFailure) { + statsReportKey = `## GraphQLValidationFailure\n`; + } else if (graphqlUnknownOperationName) { + statsReportKey = `## GraphQLUnknownOperationName\n`; + } + + const isExecutable = statsReportKey === undefined; + + if (statsReportKey) { + if (options.sendUnexecutableOperationDocuments) { + trace.unexecutedOperationBody = requestContext.source; + // Get the operation name from the request (which might not + // correspond to an actual operation). + trace.unexecutedOperationName = + requestContext.request.operationName || ''; + } + referencedFieldsByType = Object.create(null); + } else { + const operationDerivedData = getOperationDerivedData(); + statsReportKey = `# ${requestContext.operationName || '-'}\n${ + operationDerivedData.signature + }`; + referencedFieldsByType = + operationDerivedData.referencedFieldsByType; + } + + const protobufError = Trace.verify(trace); + if (protobufError) { + throw new Error(`Error encoding trace: ${protobufError}`); + } + + if (resolvedOperation) { + getReportWhichMustBeUsedImmediately(executableSchemaId) + .operationCount++; + } + + getReportWhichMustBeUsedImmediately(executableSchemaId).addTrace({ + statsReportKey, + trace, + // We include the operation as a trace (rather than aggregated into stats) only if: + // * the user didn't set `sendTraces: false` AND + // * it's possible that the organization's plan allows for viewing traces AND + // * we captured this as a full trace AND + // * gateway reported no errors missing ftv1 data AND + // * sendOperationAsTrace says so + // + // (As an edge case, if the reason metrics.captureTraces is + // falsey is that this is an unexecutable operation and thus we + // never ran the code in didResolveOperation that sets + // metrics.captureTrace, we allow it to be sent as a trace. This + // means we'll still send some parse and validation failures as + // traces, for the sake of the Errors page.) + asTrace: + sendTraces && + (!isExecutable || !!metrics.captureTraces) && + !metrics.nonFtv1ErrorPaths?.length && + sendOperationAsTrace(trace, statsReportKey), + referencedFieldsByType, + nonFtv1ErrorPaths: metrics.nonFtv1ErrorPaths ?? [], + }); + + // If the buffer gets big (according to our estimate), send. + if ( + sendReportsImmediately || + getReportWhichMustBeUsedImmediately(executableSchemaId) + .sizeEstimator.bytes >= + (options.maxUncompressedReportSize || 4 * 1024 * 1024) + ) { + await sendReportAndReportErrors(executableSchemaId); + } + } + + // Calculates signature and referenced fields for the current document. + // Only call this when the document properly parses and validates and + // the given operation name (if any) is known! + function getOperationDerivedData(): OperationDerivedData { + if (!requestContext.document) { + // This shouldn't happen: no document means parse failure, which + // uses its own special statsReportKey. + throw new Error('No document?'); + } + + const cacheKey = operationDerivedDataCacheKey( + requestContext.queryHash, + requestContext.operationName || '', + ); + + // Ensure that the cache we have is for the right schema. + if ( + !operationDerivedDataCache || + operationDerivedDataCache.forSchema !== schema + ) { + operationDerivedDataCache = { + forSchema: schema, + cache: createOperationDerivedDataCache({ logger }), + }; + } + + // If we didn't have the signature in the cache, we'll resort to + // calculating it. + const cachedOperationDerivedData = + operationDerivedDataCache.cache.get(cacheKey); + if (cachedOperationDerivedData) { + return cachedOperationDerivedData; + } + + const generatedSignature = ( + options.calculateSignature || usageReportingSignature + )(requestContext.document, requestContext.operationName || ''); + + const generatedOperationDerivedData: OperationDerivedData = { + signature: generatedSignature, + referencedFieldsByType: calculateReferencedFieldsByType({ + document: requestContext.document, + schema, + resolvedOperationName: requestContext.operationName ?? null, + }), + }; + + // Note that this cache is always an in-memory cache. + // If we replace it with a more generic async cache, we should + // not await the write operation. + operationDerivedDataCache.cache.set( + cacheKey, + generatedOperationDerivedData, + ); + return generatedOperationDerivedData; + } + } + }; + + return { + async serverWillStop() { + if (reportTimer) { + clearInterval(reportTimer); + reportTimer = undefined; + } + + stopped = true; + await sendAllReportsAndReportErrors(); + }, + }; + }, + }); +} + +export function makeHTTPRequestHeaders( + http: Trace.IHTTP, + headers: HeaderMap, + sendHeaders?: SendValuesBaseOptions, +): void { + if ( + !sendHeaders || + ('none' in sendHeaders && sendHeaders.none) || + ('all' in sendHeaders && !sendHeaders.all) + ) { + return; + } + for (const [key, value] of headers) { + // Note that HeaderMap keys are already lower-case. + if ( + ('exceptNames' in sendHeaders && + // We assume that most users only have a few headers to hide, or will + // just set {none: true} ; we can change this linear-time + // operation if it causes real performance issues. + sendHeaders.exceptNames.some((exceptHeader) => { + // Headers are case-insensitive, and should be compared as such. + return exceptHeader.toLowerCase() === key; + })) || + ('onlyNames' in sendHeaders && + !sendHeaders.onlyNames.some((header) => { + return header.toLowerCase() === key; + })) + ) { + continue; + } + + switch (key) { + case 'authorization': + case 'cookie': + case 'set-cookie': + break; + default: + http!.requestHeaders![key] = new Trace.HTTP.Values({ + value: [value], + }); + } + } +} + +function defaultGenerateClientInfo({ + request, +}: GraphQLRequestContext) { + const clientNameHeaderKey = 'apollographql-client-name'; + const clientVersionHeaderKey = 'apollographql-client-version'; + + // Default to using the `apollo-client-x` header fields if present. + // If none are present, fallback on the `clientInfo` query extension + // for backwards compatibility. + // The default value if neither header values nor query extension is + // set is the empty String for all fields (as per protobuf defaults) + if ( + request.http?.headers?.get(clientNameHeaderKey) || + request.http?.headers?.get(clientVersionHeaderKey) + ) { + return { + clientName: request.http?.headers?.get(clientNameHeaderKey), + clientVersion: request.http?.headers?.get(clientVersionHeaderKey), + }; + } else if (request.extensions?.clientInfo) { + return request.extensions.clientInfo; + } else { + return {}; + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/stats.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/stats.ts new file mode 100644 index 00000000..fb7edba5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/stats.ts @@ -0,0 +1,492 @@ +import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface'; +import { + type google, + type IContextualizedStats, + type IFieldStat, + type IPathErrorStats, + type IQueryLatencyStats, + type IReport, + type IStatsContext, + type ITracesAndStats, + type ITypeStat, + type ReportHeader, + Trace, +} from '@apollo/usage-reporting-protobuf'; +import type { ReferencedFieldsByType } from '@apollo/utils.usagereporting'; +import { DurationHistogram } from './durationHistogram.js'; +import { iterateOverTrace, type ResponseNamePath } from './iterateOverTrace.js'; + +// protobuf.js exports both a class and an interface (starting with I) for each +// message type. The class is what it produces when it decodes the message; the +// interface is what is accepted as input. We build up our messages using custom +// types implementing the interfaces, so that we can take advantage of the +// js_use_toArray option we added to our protobuf.js fork which allows us to use +// classes like DurationHistogram to generate repeated fields. We end up +// re-creating most of the report structure as custom classes (starting with +// "Our"). TypeScript validates that we've properly listed all of the message +// fields with the appropriate types (we use `Required` to ensure we implement +// all message fields). Using our own classes has other advantages, like being +// able to specify that nested messages are instances of the same class rather +// than the interface type and thus that they have non-null fields (because the +// interface type allows all fields to be optional, even though the protobuf +// format doesn't differentiate between missing and falsey). + +export class SizeEstimator { + bytes = 0; +} +export class OurReport implements Required { + // Apollo Server includes each operation either as aggregated stats or as a + // trace, but not both. Other reporting agents such as Apollo Router include + // all operations in stats (even those that are sent as traces), and they set + // this flag to true. + tracesPreAggregated = false; + + constructor(readonly header: ReportHeader) {} + readonly tracesPerQuery: Record = + Object.create(null); + endTime: google.protobuf.ITimestamp | null = null; + operationCount = 0; + // A rough estimate of the number of bytes currently in the report. We start + // at zero and don't count `header` and `endTime`, which have the same size + // for every report. This really is a rough estimate, so we don't stress too + // much about counting bytes for the tags and string/message lengths, etc: + // we mostly just count the lengths of strings plus some estimates for the + // messages with a bunch of numbers in them. + // + // We store this in a class so we can pass it down as a reference to other + // methods which increment it. + readonly sizeEstimator = new SizeEstimator(); + + ensureCountsAreIntegers() { + for (const tracesAndStats of Object.values(this.tracesPerQuery)) { + tracesAndStats.ensureCountsAreIntegers(); + } + } + + addTrace({ + statsReportKey, + trace, + asTrace, + referencedFieldsByType, + // The max size a trace can be before it is sent as stats. Note that the + // Apollo reporting ingress server will never store any traces over 10mb + // anyway. They will still be converted to stats as we would do here. + maxTraceBytes = 10 * 1024 * 1024, + nonFtv1ErrorPaths, + }: { + statsReportKey: string; + trace: Trace; + asTrace: boolean; + referencedFieldsByType: ReferencedFieldsByType; + maxTraceBytes?: number; + nonFtv1ErrorPaths: NonFtv1ErrorPath[]; + }) { + const tracesAndStats = this.getTracesAndStats({ + statsReportKey, + referencedFieldsByType, + }); + if (asTrace) { + const encodedTrace = Trace.encode(trace).finish(); + + if (!isNaN(maxTraceBytes) && encodedTrace.length > maxTraceBytes) { + tracesAndStats.statsWithContext.addTrace( + trace, + this.sizeEstimator, + nonFtv1ErrorPaths, + ); + } else { + tracesAndStats.trace.push(encodedTrace); + this.sizeEstimator.bytes += 2 + encodedTrace.length; + } + } else { + tracesAndStats.statsWithContext.addTrace( + trace, + this.sizeEstimator, + nonFtv1ErrorPaths, + ); + } + } + + private getTracesAndStats({ + statsReportKey, + referencedFieldsByType, + }: { + statsReportKey: string; + referencedFieldsByType: ReferencedFieldsByType; + }) { + const existing = this.tracesPerQuery[statsReportKey]; + if (existing) { + return existing; + } + this.sizeEstimator.bytes += estimatedBytesForString(statsReportKey); + + // Update the size estimator for the referenced field structure. + for (const [typeName, referencedFieldsForType] of Object.entries( + referencedFieldsByType, + )) { + // Two bytes each for the map entry and for the ReferencedFieldsForType, + // and for the isInterface bool if it's set. + this.sizeEstimator.bytes += 2 + 2; + if (referencedFieldsForType.isInterface) { + this.sizeEstimator.bytes += 2; + } + this.sizeEstimator.bytes += estimatedBytesForString(typeName); + for (const fieldName of referencedFieldsForType.fieldNames) { + this.sizeEstimator.bytes += estimatedBytesForString(fieldName); + } + } + + // Include the referenced fields map in the report. (In an ideal world we + // could have a slightly more sophisticated protocol and ingestion pipeline + // that allowed us to only have to send this data once for each + // schema/operation pair.) + return (this.tracesPerQuery[statsReportKey] = new OurTracesAndStats( + referencedFieldsByType, + )); + } +} + +class OurTracesAndStats implements Required { + constructor(readonly referencedFieldsByType: ReferencedFieldsByType) {} + readonly trace: Uint8Array[] = []; + readonly statsWithContext = new StatsByContext(); + readonly internalTracesContributingToStats: Uint8Array[] = []; + + ensureCountsAreIntegers() { + this.statsWithContext.ensureCountsAreIntegers(); + } +} + +class StatsByContext { + readonly map: { [k: string]: OurContextualizedStats } = Object.create(null); + + /** + * This function is used by the protobuf generator to convert this map into + * an array of contextualized stats to serialize + */ + toArray(): IContextualizedStats[] { + return Object.values(this.map); + } + + ensureCountsAreIntegers() { + for (const contextualizedStats of Object.values(this.map)) { + contextualizedStats.ensureCountsAreIntegers(); + } + } + + addTrace( + trace: Trace, + sizeEstimator: SizeEstimator, + nonFtv1ErrorPaths: NonFtv1ErrorPath[], + ) { + this.getContextualizedStats(trace, sizeEstimator).addTrace( + trace, + sizeEstimator, + nonFtv1ErrorPaths, + ); + } + + private getContextualizedStats( + trace: Trace, + sizeEstimator: SizeEstimator, + ): OurContextualizedStats { + const statsContext: IStatsContext = { + clientName: trace.clientName, + clientVersion: trace.clientVersion, + }; + const statsContextKey = JSON.stringify(statsContext); + + const existing = this.map[statsContextKey]; + if (existing) { + return existing; + } + // Adding a ContextualizedStats means adding a StatsContext plus a + // QueryLatencyStats. Let's guess about 20 bytes for a QueryLatencyStats; + // it'll be more if more features are used (like cache, APQ, etc). + sizeEstimator.bytes += + 20 + + estimatedBytesForString(trace.clientName) + + estimatedBytesForString(trace.clientVersion); + const contextualizedStats = new OurContextualizedStats(statsContext); + this.map[statsContextKey] = contextualizedStats; + return contextualizedStats; + } +} + +export class OurContextualizedStats implements Required { + queryLatencyStats = new OurQueryLatencyStats(); + perTypeStat: { [k: string]: OurTypeStat } = Object.create(null); + + constructor(readonly context: IStatsContext) {} + + ensureCountsAreIntegers() { + for (const typeStat of Object.values(this.perTypeStat)) { + typeStat.ensureCountsAreIntegers(); + } + } + + // Extract statistics from the trace, and increment the estimated report size. + // We only add to the estimate when adding whole sub-messages. If it really + // mattered, we could do a lot more careful things like incrementing it + // whenever a numeric field on queryLatencyStats gets incremented over 0. + addTrace( + trace: Trace, + sizeEstimator: SizeEstimator, + nonFtv1ErrorPaths: NonFtv1ErrorPath[] = [], + ) { + const { fieldExecutionWeight } = trace; + if (!fieldExecutionWeight) { + this.queryLatencyStats.requestsWithoutFieldInstrumentation++; + } + + this.queryLatencyStats.requestCount++; + if (trace.fullQueryCacheHit) { + this.queryLatencyStats.cacheLatencyCount.incrementDuration( + trace.durationNs, + ); + this.queryLatencyStats.cacheHits++; + } else { + this.queryLatencyStats.latencyCount.incrementDuration(trace.durationNs); + } + + // We only provide stats about cache TTLs on cache misses (ie, TTLs directly + // calculated by the backend), not for cache hits. This matches the + // behavior we've had for a while when converting traces into statistics + // in Studio's servers. + if (!trace.fullQueryCacheHit && trace.cachePolicy?.maxAgeNs != null) { + switch (trace.cachePolicy.scope) { + case Trace.CachePolicy.Scope.PRIVATE: + this.queryLatencyStats.privateCacheTtlCount.incrementDuration( + trace.cachePolicy.maxAgeNs, + ); + break; + case Trace.CachePolicy.Scope.PUBLIC: + this.queryLatencyStats.publicCacheTtlCount.incrementDuration( + trace.cachePolicy.maxAgeNs, + ); + break; + } + } + + if (trace.persistedQueryHit) { + this.queryLatencyStats.persistedQueryHits++; + } + if (trace.persistedQueryRegister) { + this.queryLatencyStats.persistedQueryMisses++; + } + + if (trace.forbiddenOperation) { + this.queryLatencyStats.forbiddenOperationCount++; + } + if (trace.registeredOperation) { + this.queryLatencyStats.registeredOperationCount++; + } + + let hasError = false; + + const errorPathStats = new Set(); + + const traceNodeStats = (node: Trace.INode, path: ResponseNamePath) => { + // Generate error stats and error path information + if (node.error?.length) { + hasError = true; + + let currPathErrorStats = this.queryLatencyStats.rootErrorStats; + path.toArray().forEach((subPath) => { + currPathErrorStats = currPathErrorStats.getChild( + subPath, + sizeEstimator, + ); + }); + + errorPathStats.add(currPathErrorStats); + currPathErrorStats.errorsCount += node.error.length; + } + + if (fieldExecutionWeight) { + // The actual field name behind the node; originalFieldName is set + // if an alias was used, otherwise responseName. (This is falsey for + // nodes that are not fields (root, array index, etc).) + const fieldName = node.originalFieldName || node.responseName; + + // Protobuf doesn't really differentiate between "unset" and "falsey" so + // we're mostly actually checking that these things are non-empty string / + // non-zero numbers. The time fields represent the number of nanoseconds + // since the beginning of the entire trace, so let's pretend for the + // moment that it's plausible for a node to start or even end exactly when + // the trace started (ie, for the time values to be 0). This is unlikely + // in practice (everything should take at least 1ns). In practice we only + // write `type` and `parentType` on a Node when we write `startTime`, so + // the main thing we're looking out for by checking the time values is + // whether we somehow failed to write `endTime` at the end of the field; + // in this case, the `endTime >= startTime` check won't match. + if ( + node.parentType && + fieldName && + node.type && + node.endTime != null && + node.startTime != null && + node.endTime >= node.startTime + ) { + const typeStat = this.getTypeStat(node.parentType, sizeEstimator); + + const fieldStat = typeStat.getFieldStat( + fieldName, + node.type, + sizeEstimator, + ); + + fieldStat.errorsCount += node.error?.length ?? 0; + fieldStat.observedExecutionCount++; + fieldStat.estimatedExecutionCount += fieldExecutionWeight; + // Note: this is actually counting the number of resolver calls for this + // field that had at least one error, not the number of overall GraphQL + // queries that had at least one error for this field. That doesn't seem + // to match the name, but it does match the other implementations of this + // logic. + fieldStat.requestsWithErrorsCount += + (node.error?.length ?? 0) > 0 ? 1 : 0; + fieldStat.latencyCount.incrementDuration( + node.endTime - node.startTime, + // The latency histogram is always "estimated"; we don't track + // "observed" and "estimated" separately. + fieldExecutionWeight, + ); + } + } + + return false; + }; + + iterateOverTrace(trace, traceNodeStats, true); + + // iterate over nonFtv1ErrorPaths, using some bits from traceNodeStats function + for (const { subgraph, path } of nonFtv1ErrorPaths) { + hasError = true; + if (path) { + let currPathErrorStats = this.queryLatencyStats.rootErrorStats.getChild( + `service:${subgraph}`, + sizeEstimator, + ); + path.forEach((subPath) => { + if (typeof subPath === 'string') { + currPathErrorStats = currPathErrorStats.getChild( + subPath, + sizeEstimator, + ); + } + }); + + errorPathStats.add(currPathErrorStats); + currPathErrorStats.errorsCount += 1; + } + } + + for (const errorPath of errorPathStats) { + errorPath.requestsWithErrorsCount += 1; + } + + if (hasError) { + this.queryLatencyStats.requestsWithErrorsCount++; + } + } + + getTypeStat(parentType: string, sizeEstimator: SizeEstimator): OurTypeStat { + const existing = this.perTypeStat[parentType]; + if (existing) { + return existing; + } + sizeEstimator.bytes += estimatedBytesForString(parentType); + const typeStat = new OurTypeStat(); + this.perTypeStat[parentType] = typeStat; + return typeStat; + } +} + +class OurQueryLatencyStats implements Required { + latencyCount: DurationHistogram = new DurationHistogram(); + requestCount = 0; + requestsWithoutFieldInstrumentation = 0; + cacheHits = 0; + persistedQueryHits = 0; + persistedQueryMisses = 0; + cacheLatencyCount: DurationHistogram = new DurationHistogram(); + rootErrorStats: OurPathErrorStats = new OurPathErrorStats(); + requestsWithErrorsCount = 0; + publicCacheTtlCount: DurationHistogram = new DurationHistogram(); + privateCacheTtlCount: DurationHistogram = new DurationHistogram(); + registeredOperationCount = 0; + forbiddenOperationCount = 0; +} + +class OurPathErrorStats implements Required { + children: { [k: string]: OurPathErrorStats } = Object.create(null); + errorsCount = 0; + requestsWithErrorsCount = 0; + + getChild(subPath: string, sizeEstimator: SizeEstimator): OurPathErrorStats { + const existing = this.children[subPath]; + if (existing) { + return existing; + } + const child = new OurPathErrorStats(); + this.children[subPath] = child; + // Include a few bytes in the estimate for the numbers etc. + sizeEstimator.bytes += estimatedBytesForString(subPath) + 4; + return child; + } +} + +class OurTypeStat implements Required { + perFieldStat: { [k: string]: OurFieldStat } = Object.create(null); + + getFieldStat( + fieldName: string, + returnType: string, + sizeEstimator: SizeEstimator, + ): OurFieldStat { + const existing = this.perFieldStat[fieldName]; + if (existing) { + return existing; + } + // Rough estimate of 10 bytes for the numbers in the FieldStat. + sizeEstimator.bytes += + estimatedBytesForString(fieldName) + + estimatedBytesForString(returnType) + + 10; + const fieldStat = new OurFieldStat(returnType); + this.perFieldStat[fieldName] = fieldStat; + return fieldStat; + } + + ensureCountsAreIntegers() { + for (const fieldStat of Object.values(this.perFieldStat)) { + fieldStat.ensureCountsAreIntegers(); + } + } +} + +class OurFieldStat implements Required { + errorsCount = 0; + observedExecutionCount = 0; + // Note that this number isn't necessarily an integer while it is being + // aggregated. Before encoding as a protobuf we call ensureCountsAreIntegers + // which floors it. + estimatedExecutionCount = 0; + requestsWithErrorsCount = 0; + latencyCount: DurationHistogram = new DurationHistogram(); + + constructor(readonly returnType: string) {} + + ensureCountsAreIntegers() { + // This is the only one that ever can receive non-integers. + this.estimatedExecutionCount = Math.floor(this.estimatedExecutionCount); + } +} + +function estimatedBytesForString(s: string) { + // 2 is for the tag (field ID + wire type) plus the encoded length. (The + // encoded length takes up more than 1 byte for strings that are longer than + // 127 bytes, but this is an estimate.) + return 2 + Buffer.byteLength(s); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/traceDetails.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/traceDetails.ts new file mode 100644 index 00000000..a61c1ed7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/plugin/usageReporting/traceDetails.ts @@ -0,0 +1,96 @@ +import { Trace } from '@apollo/usage-reporting-protobuf'; +import type { VariableValueOptions } from './options.js'; + +// Creates trace details from request variables, given a specification for modifying +// values of private or sensitive variables. +// The details will include all variable names and their (possibly hidden or modified) values. +// If sendVariableValues is {all: bool}, {none: bool} or {exceptNames: Array}, the option will act similarly to +// to the to-be-deprecated options.privateVariables, except that the redacted variable +// names will still be visible in the UI even if the values are hidden. +// If sendVariableValues is null or undefined, we default to the {none: true} case. +export function makeTraceDetails( + variables: Record, + sendVariableValues?: VariableValueOptions, + operationString?: string, +): Trace.Details { + const details = new Trace.Details(); + const variablesToRecord = (() => { + if (sendVariableValues && 'transform' in sendVariableValues) { + const originalKeys = Object.keys(variables); + try { + // Custom function to allow user to specify what variablesJson will look like + const modifiedVariables = sendVariableValues.transform({ + variables: variables, + operationString: operationString, + }); + return cleanModifiedVariables(originalKeys, modifiedVariables); + } catch (e) { + // If the custom function provided by the user throws an exception, + // change all the variable values to an appropriate error message. + return handleVariableValueTransformError(originalKeys); + } + } else { + return variables; + } + })(); + + // Note: we explicitly do *not* include the details.rawQuery field. The + // Studio web app currently does nothing with this other than store it in + // the database and offer it up via its GraphQL API, and sending it means + // that using calculateSignature to hide sensitive data in the query + // string is ineffective. + Object.keys(variablesToRecord).forEach((name) => { + if ( + !sendVariableValues || + ('none' in sendVariableValues && sendVariableValues.none) || + ('all' in sendVariableValues && !sendVariableValues.all) || + ('exceptNames' in sendVariableValues && + // We assume that most users will have only a few variables values to hide, + // or will just set {none: true}; we can change this + // linear-time operation if it causes real performance issues. + sendVariableValues.exceptNames.includes(name)) || + ('onlyNames' in sendVariableValues && + !sendVariableValues.onlyNames.includes(name)) + ) { + // Special case for private variables. Note that this is a different + // representation from a variable containing the empty string, as that + // will be sent as '""'. + details.variablesJson![name] = ''; + } else { + try { + details.variablesJson![name] = + typeof variablesToRecord[name] === 'undefined' + ? '' + : JSON.stringify(variablesToRecord[name]); + } catch (e) { + details.variablesJson![name] = JSON.stringify( + '[Unable to convert value to JSON]', + ); + } + } + }); + return details; +} + +function handleVariableValueTransformError( + variableNames: string[], +): Record { + const modifiedVariables = Object.create(null); + variableNames.forEach((name) => { + modifiedVariables[name] = '[PREDICATE_FUNCTION_ERROR]'; + }); + return modifiedVariables; +} + +// Helper for makeTraceDetails() to enforce that the keys of a modified 'variables' +// matches that of the original 'variables' +function cleanModifiedVariables( + originalKeys: Array, + modifiedVariables: Record, +): Record { + const cleanedVariables: Record = Object.create(null); + originalKeys.forEach((name) => { + cleanedVariables[name] = modifiedVariables[name]; + }); + return cleanedVariables; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/preventCsrf.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/preventCsrf.ts new file mode 100644 index 00000000..a2ad5fe8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/preventCsrf.ts @@ -0,0 +1,99 @@ +import MIMEType from 'whatwg-mimetype'; +import { BadRequestError } from './internalErrorClasses.js'; +import type { HeaderMap } from './utils/HeaderMap.js'; + +// Our recommended set of CSRF prevention headers. Operations that do not +// provide a content-type such as `application/json` (in practice, this +// means GET operations) must include at least one of these headers. +// Apollo Client Web's default behavior is to always sends a +// `content-type` even for `GET`, and Apollo iOS and Apollo Kotlin always +// send `x-apollo-operation-name`. So if you set +// `csrfPreventionRequestHeaders: true` then any `GET` operation from these +// three client projects and any `POST` operation at all should work +// successfully; if you need `GET`s from another kind of client to work, +// just add `apollo-require-preflight: true` to their requests. +export const recommendedCsrfPreventionRequestHeaders = [ + 'x-apollo-operation-name', + 'apollo-require-preflight', +]; + +// See https://fetch.spec.whatwg.org/#cors-safelisted-request-header +const NON_PREFLIGHTED_CONTENT_TYPES = [ + 'application/x-www-form-urlencoded', + 'multipart/form-data', + 'text/plain', +]; + +// We don't want random websites to be able to execute actual GraphQL operations +// from a user's browser unless our CORS policy supports it. It's not good +// enough just to ensure that the browser can't read the response from the +// operation; we also want to prevent CSRF, where the attacker can cause side +// effects with an operation or can measure the timing of a read operation. Our +// goal is to ensure that we don't run the context function or execute the +// GraphQL operation until the browser has evaluated the CORS policy, which +// means we want all operations to be pre-flighted. We can do that by only +// processing operations that have at least one header set that appears to be +// manually set by the JS code rather than by the browser automatically. +// +// POST requests generally have a content-type `application/json`, which is +// sufficient to trigger preflighting. So we take extra care with requests that +// specify no content-type or that specify one of the three non-preflighted +// content types. For those operations, we require (if this feature is enabled) +// one of a set of specific headers to be set. By ensuring that every operation +// either has a custom content-type or sets one of these headers, we know we +// won't execute operations at the request of origins who our CORS policy will +// block. +export function preventCsrf( + headers: HeaderMap, + csrfPreventionRequestHeaders: string[], +) { + const contentType = headers.get('content-type'); + + // We have to worry about CSRF if it looks like this may have been a + // non-preflighted request. If we see a content-type header that is not one of + // the three CORS-safelisted MIME types (see + // https://fetch.spec.whatwg.org/#cors-safelisted-request-header) then we know + // it was preflighted and we don't have to worry. + if (contentType !== undefined) { + const contentTypeParsed = MIMEType.parse(contentType); + if (contentTypeParsed === null) { + // If we got null, then parsing the content-type failed... which is + // actually *ok* because that would lead to a preflight. (For example, the + // header is empty, or doesn't have a slash, or has bad characters.) The + // scary CSRF case is only if there's *not* an error. So it is actually + // fine for us to just `return` here. (That said, it would also be + // reasonable to reject such requests with provided yet unparsable + // Content-Type here.) + return; + } + if (!NON_PREFLIGHTED_CONTENT_TYPES.includes(contentTypeParsed.essence)) { + // We managed to parse a MIME type that was not one of the + // CORS-safelisted ones. (Probably application/json!) That means that if + // the client is a browser, the browser must have applied CORS + // preflighting and we don't have to worry about CSRF. + return; + } + } + + // Either there was no content-type, or the content-type parsed properly as + // one of the three CORS-safelisted values. Let's look for another header that + // (if this was a browser) must have been set by the user's code and would + // have caused a preflight. + if ( + csrfPreventionRequestHeaders.some((header) => { + const value = headers.get(header); + return value !== undefined && value.length > 0; + }) + ) { + return; + } + + throw new BadRequestError( + `This operation has been blocked as a potential Cross-Site Request Forgery ` + + `(CSRF). Please either specify a 'content-type' header (with a type that ` + + `is not one of ${NON_PREFLIGHTED_CONTENT_TYPES.join(', ')}) or provide ` + + `a non-empty value for one of the following headers: ${csrfPreventionRequestHeaders.join( + ', ', + )}\n`, + ); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/requestPipeline.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/requestPipeline.ts new file mode 100644 index 00000000..93ec922d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/requestPipeline.ts @@ -0,0 +1,821 @@ +import { createHash } from '@apollo/utils.createhash'; +import { + specifiedRules, + getOperationAST, + GraphQLError, + validate, + parse, + Kind, + type ExecutionResult, +} from 'graphql'; +import { + symbolExecutionDispatcherWillResolveField, + enablePluginsForSchemaResolvers, + symbolUserFieldResolver, +} from './utils/schemaInstrumentation.js'; +import { + PersistedQueryNotSupportedError, + PersistedQueryNotFoundError, + UserInputError, + BadRequestError, + ValidationError, + SyntaxError, + OperationResolutionError, +} from './internalErrorClasses.js'; +import { + ensureError, + normalizeAndFormatErrors, + ensureGraphQLError, +} from './errorNormalize.js'; +import type { + GraphQLRequestContext, + GraphQLRequestContextDidResolveSource, + GraphQLRequestContextExecutionDidStart, + GraphQLRequestContextResponseForOperation, + GraphQLRequestContextDidResolveOperation, + GraphQLRequestContextParsingDidStart, + GraphQLRequestContextValidationDidStart, + GraphQLRequestContextWillSendResponse, + GraphQLRequestContextDidEncounterErrors, + GraphQLRequestExecutionListener, + BaseContext, + GraphQLResponse, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, +} from './externalTypes/index.js'; + +import { + invokeDidStartHook, + invokeHooksUntilDefinedAndNonNull, + invokeSyncDidStartHook, +} from './utils/invokeHooks.js'; + +import { makeGatewayGraphQLRequestContext } from './utils/makeGatewayGraphQLRequestContext.js'; + +import { mergeHTTPGraphQLHead, newHTTPGraphQLHead } from './runHttpQuery.js'; +import { + MEDIA_TYPES, + type ApolloServer, + type ApolloServerInternals, + type SchemaDerivedData, +} from './ApolloServer.js'; +import { isDefined } from './utils/isDefined.js'; +import type { + GraphQLRequestContextDidEncounterSubsequentErrors, + GraphQLRequestContextWillSendSubsequentPayload, +} from './externalTypes/requestPipeline.js'; +import { + executeIncrementally, + type GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha9, + type GraphQLExperimentalInitialIncrementalExecutionResultAlpha2, + type GraphQLExperimentalInitialIncrementalExecutionResultAlpha9, + type GraphQLExperimentalSubsequentIncrementalExecutionResultAlpha2, +} from './incrementalDeliveryPolyfill.js'; +import { HeaderMap } from './utils/HeaderMap.js'; +import Negotiator from 'negotiator'; + +export const APQ_CACHE_PREFIX = 'apq:'; + +function computeQueryHash(query: string) { + return createHash('sha256').update(query).digest('hex'); +} + +type Mutable = { -readonly [P in keyof T]: T[P] }; + +// Once GraphQL-JS v17 is released and we make a version of Apollo Server that +// requires it, we can drop this hack, because it lets us break the `execute` +// API into two steps and validate user input explicitly first. +function isBadUserInputGraphQLError(error: GraphQLError): boolean { + return ( + error.nodes?.length === 1 && + error.nodes[0].kind === Kind.VARIABLE_DEFINITION && + // GraphQL-JS v17 alpha wording + (error.message.startsWith( + `Variable "$${error.nodes[0].variable.name.value}" has invalid value`, + ) || + // GraphQL-JS v16 wording + error.message.startsWith( + `Variable "$${error.nodes[0].variable.name.value}" got invalid value `, + ) || + error.message.startsWith( + `Variable "$${error.nodes[0].variable.name.value}" of required type `, + ) || + error.message.startsWith( + `Variable "$${error.nodes[0].variable.name.value}" of non-null type `, + )) + ); +} + +// This is "semi-formatted" because the initial result has not yet been +// formatted but the subsequent results "have been" --- in the sense that they +// are an async iterable that will format them as they come in. +type SemiFormattedExecuteIncrementallyResults = + | { + singleResult: ExecutionResult; + } + | { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha2; + subsequentResults: AsyncIterable; + } + | { + initialResult: GraphQLExperimentalInitialIncrementalExecutionResultAlpha9; + subsequentResults: AsyncIterable; + }; + +export async function processGraphQLRequest( + schemaDerivedData: SchemaDerivedData, + server: ApolloServer, + internals: ApolloServerInternals, + requestContext: Mutable>, +): Promise { + const requestListeners = ( + await Promise.all( + internals.plugins.map((p) => p.requestDidStart?.(requestContext)), + ) + ).filter(isDefined); + + const request = requestContext.request; + + let { query, extensions } = request; + + let queryHash: string; + + requestContext.metrics.persistedQueryHit = false; + requestContext.metrics.persistedQueryRegister = false; + + if (extensions?.persistedQuery) { + // It looks like we've received a persisted query. Check if we + // support them. + if (!internals.persistedQueries) { + return await sendErrorResponse([new PersistedQueryNotSupportedError()]); + } else if (extensions.persistedQuery.version !== 1) { + return await sendErrorResponse([ + new GraphQLError('Unsupported persisted query version', { + extensions: { http: newHTTPGraphQLHead(400) }, + }), + ]); + } + + queryHash = extensions.persistedQuery.sha256Hash; + + if (query === undefined) { + query = await internals.persistedQueries.cache.get(queryHash); + if (query) { + requestContext.metrics.persistedQueryHit = true; + } else { + return await sendErrorResponse([new PersistedQueryNotFoundError()]); + } + } else { + const computedQueryHash = computeQueryHash(query); + + // The provided hash must exactly match the SHA-256 hash of + // the query string. This prevents hash hijacking, where a + // new and potentially malicious query is associated with + // an existing hash. + if (queryHash !== computedQueryHash) { + return await sendErrorResponse([ + new GraphQLError('provided sha does not match query', { + extensions: { http: newHTTPGraphQLHead(400) }, + }), + ]); + } + + // We won't write to the persisted query cache until later. + // Deferring the writing gives plugins the ability to "win" from use of + // the cache, but also have their say in whether or not the cache is + // written to (by interrupting the request with an error). + requestContext.metrics.persistedQueryRegister = true; + } + } else if (query) { + queryHash = computeQueryHash(query); + } else { + return await sendErrorResponse([ + new BadRequestError( + 'GraphQL operations must contain a non-empty `query` or a `persistedQuery` extension.', + ), + ]); + } + + requestContext.queryHash = queryHash; + requestContext.source = query; + + // Let the plugins know that we now have a STRING of what we hope will + // parse and validate into a document we can execute on. Unless we have + // retrieved this from our APQ cache, there's no guarantee that it is + // syntactically correct, so this string should not be trusted as a valid + // document until after it's parsed and validated. + await Promise.all( + requestListeners.map((l) => + l.didResolveSource?.( + requestContext as GraphQLRequestContextDidResolveSource, + ), + ), + ); + + // If we're configured with a document store (by default, we are), we'll + // utilize the operation's hash to lookup the AST from the previously + // parsed-and-validated operation. Failure to retrieve anything from the + // cache just means we're committed to doing the parsing and validation. + if (schemaDerivedData.documentStore) { + try { + requestContext.document = await schemaDerivedData.documentStore.get( + schemaDerivedData.documentStoreKeyPrefix + queryHash, + ); + } catch (err: unknown) { + server.logger.warn( + 'An error occurred while attempting to read from the documentStore. ' + + ensureError(err).message, + ); + } + } + + // If we still don't have a document, we'll need to parse and validate it. + // With success, we'll attempt to save it into the store for future use. + if (!requestContext.document) { + const parsingDidEnd = await invokeDidStartHook( + requestListeners, + async (l) => + l.parsingDidStart?.( + requestContext as GraphQLRequestContextParsingDidStart, + ), + ); + + try { + requestContext.document = parse(query, internals.parseOptions); + } catch (syntaxMaybeError: unknown) { + const error = ensureError(syntaxMaybeError); + await parsingDidEnd(error); + return await sendErrorResponse([ + new SyntaxError(ensureGraphQLError(error)), + ]); + } + await parsingDidEnd(); + + if (internals.dangerouslyDisableValidation !== true) { + const validationDidEnd = await invokeDidStartHook( + requestListeners, + async (l) => + l.validationDidStart?.( + requestContext as GraphQLRequestContextValidationDidStart, + ), + ); + + let validationErrors = validate( + schemaDerivedData.schema, + requestContext.document, + [...specifiedRules, ...internals.validationRules], + internals.validationOptions, + ); + if (validationErrors.length === 0 && internals.laterValidationRules) { + validationErrors = validate( + schemaDerivedData.schema, + requestContext.document, + internals.laterValidationRules, + ); + } + + if (validationErrors.length === 0) { + await validationDidEnd(); + } else { + await validationDidEnd(validationErrors); + return await sendErrorResponse( + validationErrors.map((error) => new ValidationError(error)), + ); + } + } + + if (schemaDerivedData.documentStore) { + // The underlying cache store behind the `documentStore` returns a + // `Promise` which is resolved (or rejected), eventually, based on the + // success or failure (respectively) of the cache save attempt. While + // it's certainly possible to `await` this `Promise`, we don't care about + // whether or not it's successful at this point. We'll instead proceed + // to serve the rest of the request and just hope that this works out. + // If it doesn't work, the next request will have another opportunity to + // try again. Errors will surface as warnings, as appropriate. + // + // While it shouldn't normally be necessary to wrap this `Promise` in a + // `Promise.resolve` invocation, it seems that the underlying cache store + // is returning a non-native `Promise` (e.g. Bluebird, etc.). + Promise.resolve( + schemaDerivedData.documentStore.set( + schemaDerivedData.documentStoreKeyPrefix + queryHash, + requestContext.document, + ), + ).catch((err) => + server.logger.warn( + 'Could not store validated document. ' + err?.message || err, + ), + ); + } + } + + // TODO: If we want to guarantee an operation has been set when invoking + // `willExecuteOperation` and executionDidStart`, we need to throw an + // error here and not leave this to `buildExecutionContext` in + // `graphql-js`. + const operation = getOperationAST( + requestContext.document, + request.operationName, + ); + + requestContext.operation = operation || undefined; + // We'll set `operationName` to `null` for anonymous operations. + requestContext.operationName = operation?.name?.value || null; + + // Special case: GET operations should only be queries (not mutations). We + // want to throw a particular HTTP error in that case. (This matters because + // it's generally how HTTP requests should work, and additionally it makes us + // less vulnerable to mutations running over CSRF, if you turn off our CSRF + // prevention feature.) + if ( + request.http?.method === 'GET' && + operation?.operation && + operation.operation !== 'query' + ) { + return await sendErrorResponse([ + new BadRequestError( + `GET requests only support query operations, not ${operation.operation} operations`, + { + extensions: { + http: { status: 405, headers: new HeaderMap([['allow', 'POST']]) }, + }, + }, + ), + ]); + } + + try { + await Promise.all( + requestListeners.map((l) => + l.didResolveOperation?.( + requestContext as GraphQLRequestContextDidResolveOperation, + ), + ), + ); + } catch (err: unknown) { + // Note that we explicitly document throwing `GraphQLError`s from + // `didResolveOperation` as a good way to do validation that depends on the + // validated operation and the request context. (It will have status 500 by + // default.) + return await sendErrorResponse([ensureGraphQLError(err)]); + } + + // Now that we've gone through the pre-execution phases of the request + // pipeline, and given plugins appropriate ability to object (by throwing + // an error) and not actually write, we'll write to the cache if it was + // determined earlier in the request pipeline that we should do so. + if ( + requestContext.metrics.persistedQueryRegister && + internals.persistedQueries + ) { + // While it shouldn't normally be necessary to wrap this `Promise` in a + // `Promise.resolve` invocation, it seems that the underlying cache store + // is returning a non-native `Promise` (e.g. Bluebird, etc.). + const ttl = internals.persistedQueries?.ttl; + Promise.resolve( + internals.persistedQueries.cache.set( + queryHash, + query, + // Explicitly checking for `undefined` which means "not set" vs 0 or + // null which means "no TTL". + ttl !== undefined + ? { ttl: internals.persistedQueries?.ttl } + : undefined, + ), + ).catch(server.logger.warn.bind(server.logger)); + } + + const responseFromPlugin = await invokeHooksUntilDefinedAndNonNull( + requestListeners, + async (l) => + await l.responseForOperation?.( + requestContext as GraphQLRequestContextResponseForOperation, + ), + ); + if (responseFromPlugin !== null) { + requestContext.response.body = responseFromPlugin.body; + mergeHTTPGraphQLHead(requestContext.response.http, responseFromPlugin.http); + } else { + const executionListeners = ( + await Promise.all( + requestListeners.map((l) => + l.executionDidStart?.( + requestContext as GraphQLRequestContextExecutionDidStart, + ), + ), + ) + ).filter(isDefined); + executionListeners.reverse(); + + if (executionListeners.some((l) => l.willResolveField)) { + // Create a callback that will trigger the execution dispatcher's + // `willResolveField` hook. We will attach this to the context on a + // symbol so it can be invoked by our `wrapField` method during execution. + const invokeWillResolveField: GraphQLRequestExecutionListener['willResolveField'] = + (...args) => + invokeSyncDidStartHook(executionListeners, (l) => + l.willResolveField?.(...args), + ); + + Object.defineProperty( + requestContext.contextValue, + symbolExecutionDispatcherWillResolveField, + { value: invokeWillResolveField }, + ); + + // If the user has provided a custom field resolver, we will attach + // it to the context so we can still invoke it after we've wrapped the + // fields with `wrapField` within `enablePluginsForSchemaResolvers` of + // the `schemaInstrumentation` module. + if (internals.fieldResolver) { + Object.defineProperty( + requestContext.contextValue, + symbolUserFieldResolver, + { + value: internals.fieldResolver, + }, + ); + } + + // If the schema is already enabled, this is a no-op. Otherwise, the + // schema will be augmented so it is able to invoke willResolveField. Note + // that if we never see a plugin with willResolveField then we will never + // need to instrument the schema, which might be a small performance gain. + // (For example, this can happen if you pass `fieldLevelInstrumentation: + // () => false` to the usage reporting plugin and disable the cache + // control plugin. We can consider changing the cache control plugin to + // have a "static cache control only" mode that doesn't use + // willResolveField too if this proves to be helpful in practice.) + enablePluginsForSchemaResolvers(schemaDerivedData.schema); + } + + try { + const fullResult = await execute({ + ...requestContext, + useLegacyIncremental: + new Negotiator({ + headers: { accept: request.http?.headers.get('accept') }, + }).mediaType([ + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + ]) === MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + } as GraphQLRequestContextExecutionDidStart); + const result = + 'singleResult' in fullResult + ? fullResult.singleResult + : fullResult.initialResult; + + // If we don't have an operation, there's no reason to go further. We know + // `result` will consist of one error (returned by `graphql-js`'s + // `buildExecutionContext`). + if (!requestContext.operation) { + if (!result.errors?.length) { + throw new Error( + 'Unexpected error: Apollo Server did not resolve an operation but execute did not return errors', + ); + } + throw new OperationResolutionError(result.errors[0]); + } + + // The first thing that execution does is coerce the request's variables + // to the types declared in the operation, which can lead to errors if + // they are of the wrong type. It also makes sure that all non-null + // variables are required and get non-null values. If any of these things + // lead to errors, we change them into UserInputError so that their code + // doesn't end up being INTERNAL_SERVER_ERROR, since these are client + // errors. (But if the error already has a code, perhaps because the + // original error was thrown from a custom scalar parseValue, we leave it + // alone. We check that here instead of as part of + // isBadUserInputGraphQLError since perhaps that function will one day be + // changed to something we can get directly from graphql-js, but the + // `code` check is AS-specific.) + // + // This is hacky! Hopefully graphql-js will give us a way to separate + // variable resolution from execution later; see + // https://github.com/graphql/graphql-js/issues/3169 + const resultErrors = result.errors?.map((e) => { + if (isBadUserInputGraphQLError(e) && e.extensions?.code == null) { + return new UserInputError(e); + } + return e; + }); + + if (resultErrors) { + await didEncounterErrors(resultErrors); + } + + const { formattedErrors, httpFromErrors } = resultErrors + ? formatErrors(resultErrors) + : { formattedErrors: undefined, httpFromErrors: newHTTPGraphQLHead() }; + + // TODO(AS6): remove `status400ForVariableCoercionErrors` + if ( + internals.status400ForVariableCoercionErrors && + resultErrors?.length && + result.data === undefined && + !httpFromErrors.status + ) { + httpFromErrors.status = 400; + } + + mergeHTTPGraphQLHead(requestContext.response.http, httpFromErrors); + + if ('singleResult' in fullResult) { + requestContext.response.body = { + kind: 'single', + singleResult: { + ...result, + errors: formattedErrors, + }, + }; + } else { + requestContext.response.body = { + kind: 'incremental', + initialResult: { + ...fullResult.initialResult, + errors: formattedErrors, + }, + subsequentResults: fullResult.subsequentResults, + }; + } + } catch (executionMaybeError: unknown) { + const executionError = ensureError(executionMaybeError); + await Promise.all( + executionListeners.map((l) => l.executionDidEnd?.(executionError)), + ); + + return await sendErrorResponse([ensureGraphQLError(executionError)]); + } + + await Promise.all(executionListeners.map((l) => l.executionDidEnd?.())); + } + + await invokeWillSendResponse(); + if (!requestContext.response.body) { + throw Error('got to end of processGraphQLRequest without setting body?'); + } + return requestContext.response as GraphQLResponse; // cast checked on previous line + + async function execute({ + useLegacyIncremental, + ...requestContext + }: GraphQLRequestContextExecutionDidStart & { + useLegacyIncremental?: boolean; + }): Promise { + const { request, document } = requestContext; + + if (internals.__testing_incrementalExecutionResults) { + return internals.__testing_incrementalExecutionResults; + } else if (internals.gatewayExecutor) { + const result = await internals.gatewayExecutor( + makeGatewayGraphQLRequestContext(requestContext, server, internals), + ); + return { singleResult: result }; + } else { + const resultOrResults = await executeIncrementally({ + schema: schemaDerivedData.schema, + document, + rootValue: + typeof internals.rootValue === 'function' + ? internals.rootValue(document) + : internals.rootValue, + contextValue: requestContext.contextValue, + variableValues: request.variables, + operationName: request.operationName, + fieldResolver: internals.fieldResolver, + useLegacyIncremental, + options: internals.executionOptions, + legacyExperimentalExecuteIncrementally: + internals.legacyExperimentalExecuteIncrementally, + }); + if ('initialResult' in resultOrResults) { + return { + initialResult: resultOrResults.initialResult, + subsequentResults: + 'pending' in resultOrResults.initialResult + ? formatErrorsInSubsequentResultsAlpha9( + resultOrResults.subsequentResults as AsyncIterable, + ) + : formatErrorsInSubsequentResultsAlpha2( + resultOrResults.subsequentResults, + ), + }; + } else { + return { singleResult: resultOrResults }; + } + } + } + + async function* formatErrorsInSubsequentResultsAlpha2( + results: AsyncIterable, + ): AsyncIterable { + for await (const result of results) { + const payload: GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 = + result.incremental + ? { + ...result, + incremental: await seriesAsyncMap( + result.incremental, + async (incrementalResult) => { + const { errors } = incrementalResult; + if (errors) { + await Promise.all( + requestListeners.map((l) => + l.didEncounterSubsequentErrors?.( + requestContext as GraphQLRequestContextDidEncounterSubsequentErrors, + errors, + ), + ), + ); + + return { + ...incrementalResult, + // Note that any `http` extensions in errors have no + // effect, because we've already sent the status code + // and response headers. + errors: formatErrors(errors).formattedErrors, + }; + } + return incrementalResult; + }, + ), + } + : result; + + // Invoke hook, which is allowed to mutate payload if it really wants to. + await Promise.all( + requestListeners.map((l) => + l.willSendSubsequentPayload?.( + requestContext as GraphQLRequestContextWillSendSubsequentPayload, + payload, + ), + ), + ); + + yield payload; + } + } + + async function* formatErrorsInSubsequentResultsAlpha9( + results: AsyncIterable, + ): AsyncIterable { + for await (const result of results) { + const payload: GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9 = + result.incremental + ? { + ...result, + incremental: await seriesAsyncMap( + result.incremental, + async (incrementalResult) => { + const { errors } = incrementalResult; + if (errors) { + await Promise.all( + requestListeners.map((l) => + l.didEncounterSubsequentErrors?.( + requestContext as GraphQLRequestContextDidEncounterSubsequentErrors, + errors, + ), + ), + ); + + return { + ...incrementalResult, + // Note that any `http` extensions in errors have no + // effect, because we've already sent the status code + // and response headers. + errors: formatErrors(errors).formattedErrors, + }; + } + return incrementalResult; + }, + ), + } + : result; + + if (result.completed) { + payload.completed = await seriesAsyncMap( + result.completed, + async (completedResult) => { + const { errors } = completedResult; + + if (errors) { + await Promise.all( + requestListeners.map((l) => + l.didEncounterSubsequentErrors?.( + requestContext as GraphQLRequestContextDidEncounterSubsequentErrors, + errors, + ), + ), + ); + + return { + ...completedResult, + // Note that any `http` extensions in errors have no + // effect, because we've already sent the status code + // and response headers. + errors: formatErrors(errors).formattedErrors, + }; + } + + return completedResult; + }, + ); + } + + // Invoke hook, which is allowed to mutate payload if it really wants to. + await Promise.all( + requestListeners.map((l) => + l.willSendSubsequentPayload?.( + requestContext as GraphQLRequestContextWillSendSubsequentPayload, + payload, + ), + ), + ); + + yield payload; + } + } + + async function invokeWillSendResponse() { + await Promise.all( + requestListeners.map((l) => + l.willSendResponse?.( + requestContext as GraphQLRequestContextWillSendResponse, + ), + ), + ); + } + + // Note that we ensure that all calls to didEncounterErrors are followed by + // calls to willSendResponse. (The usage reporting plugin depends on this.) + async function didEncounterErrors(errors: ReadonlyArray) { + requestContext.errors = errors; + + return await Promise.all( + requestListeners.map((l) => + l.didEncounterErrors?.( + requestContext as GraphQLRequestContextDidEncounterErrors, + ), + ), + ); + } + + // This function "sends" a response that contains errors and no data (not even + // `data: null`) because the pipeline does not make it to a successful + // `execute` call. (It is *not* called for execution that happens to return + // some errors.) In this case "send" means "update requestContext.response and + // invoke willSendResponse hooks". + // + // If any errors have `extensions.http` set, it sets the response's status code + // and errors from them. + // + // Then, if the HTTP status code is not yet set, it sets it to 500. + async function sendErrorResponse( + errors: ReadonlyArray, + ): Promise { + await didEncounterErrors(errors); + + const { formattedErrors, httpFromErrors } = formatErrors(errors); + + requestContext.response.body = { + kind: 'single', + singleResult: { + errors: formattedErrors, + }, + }; + + mergeHTTPGraphQLHead(requestContext.response.http, httpFromErrors); + + if (!requestContext.response.http.status) { + requestContext.response.http.status = 500; + } + + await invokeWillSendResponse(); + + // cast safe because we assigned to `body` above + return requestContext.response as GraphQLResponse; + } + + function formatErrors( + errors: ReadonlyArray, + ): ReturnType { + return normalizeAndFormatErrors(errors, { + formatError: internals.formatError, + includeStacktraceInErrorResponses: + internals.includeStacktraceInErrorResponses, + }); + } +} + +async function seriesAsyncMap( + ts: readonly T[], + fn: (value: T) => Promise, +): Promise { + const us: U[] = []; + for (const t of ts) { + const u = await fn(t); + us.push(u); + } + return us; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/runHttpQuery.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/runHttpQuery.ts new file mode 100644 index 00000000..929d7020 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/runHttpQuery.ts @@ -0,0 +1,408 @@ +import type { + BaseContext, + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, + GraphQLRequest, + HTTPGraphQLHead, + HTTPGraphQLRequest, + HTTPGraphQLResponse, +} from './externalTypes/index.js'; +import { + type ApolloServer, + type ApolloServerInternals, + chooseContentTypeForSingleResultResponse, + internalExecuteOperation, + MEDIA_TYPES, + type SchemaDerivedData, +} from './ApolloServer.js'; +import { type FormattedExecutionResult, Kind } from 'graphql'; +import { BadRequestError } from './internalErrorClasses.js'; +import Negotiator from 'negotiator'; +import { HeaderMap } from './utils/HeaderMap.js'; +import MIMEType from 'whatwg-mimetype'; + +function fieldIfString( + o: Record, + fieldName: string, +): string | undefined { + const value = o[fieldName]; + if (typeof value === 'string') { + return value; + } + return undefined; +} + +function searchParamIfSpecifiedOnce( + searchParams: URLSearchParams, + paramName: string, +) { + const values = searchParams.getAll(paramName); + switch (values.length) { + case 0: + return undefined; + case 1: + return values[0]; + default: + throw new BadRequestError( + `The '${paramName}' search parameter may only be specified once.`, + ); + } +} + +function jsonParsedSearchParamIfSpecifiedOnce( + searchParams: URLSearchParams, + fieldName: string, +): Record | undefined { + const value = searchParamIfSpecifiedOnce(searchParams, fieldName); + if (value === undefined) { + return undefined; + } + let hopefullyRecord; + try { + hopefullyRecord = JSON.parse(value); + } catch { + throw new BadRequestError( + `The ${fieldName} search parameter contains invalid JSON.`, + ); + } + if (!isStringRecord(hopefullyRecord)) { + throw new BadRequestError( + `The ${fieldName} search parameter should contain a JSON-encoded object.`, + ); + } + return hopefullyRecord; +} + +function fieldIfRecord( + o: Record, + fieldName: string, +): Record | undefined { + const value = o[fieldName]; + if (isStringRecord(value)) { + return value; + } + return undefined; +} + +function isStringRecord(o: unknown): o is Record { + return ( + !!o && typeof o === 'object' && !Buffer.isBuffer(o) && !Array.isArray(o) + ); +} + +function isNonEmptyStringRecord(o: unknown): o is Record { + return isStringRecord(o) && Object.keys(o).length > 0; +} + +function ensureQueryIsStringOrMissing(query: unknown) { + if (!query || typeof query === 'string') { + return; + } + // Check for a common error first. + if ((query as any).kind === Kind.DOCUMENT) { + throw new BadRequestError( + "GraphQL queries must be strings. It looks like you're sending the " + + 'internal graphql-js representation of a parsed query in your ' + + 'request instead of a request in the GraphQL query language. You ' + + 'can convert an AST to a string using the `print` function from ' + + '`graphql`, or use a client like `apollo-client` which converts ' + + 'the internal representation to a string for you.', + ); + } else { + throw new BadRequestError('GraphQL queries must be strings.'); + } +} + +export async function runHttpQuery({ + server, + httpRequest, + contextValue, + schemaDerivedData, + internals, + sharedResponseHTTPGraphQLHead, +}: { + server: ApolloServer; + httpRequest: HTTPGraphQLRequest; + contextValue: TContext; + schemaDerivedData: SchemaDerivedData; + internals: ApolloServerInternals; + sharedResponseHTTPGraphQLHead: HTTPGraphQLHead | null; +}): Promise { + let graphQLRequest: GraphQLRequest; + + switch (httpRequest.method) { + case 'POST': { + if (!isNonEmptyStringRecord(httpRequest.body)) { + throw new BadRequestError( + 'POST body missing, invalid Content-Type, or JSON object has no keys.', + ); + } + + ensureQueryIsStringOrMissing(httpRequest.body.query); + + if (typeof httpRequest.body.variables === 'string') { + throw new BadRequestError( + '`variables` in a POST body should be provided as an object, not a recursively JSON-encoded string.', + ); + } + + if (typeof httpRequest.body.extensions === 'string') { + throw new BadRequestError( + '`extensions` in a POST body should be provided as an object, not a recursively JSON-encoded string.', + ); + } + + if ( + 'extensions' in httpRequest.body && + httpRequest.body.extensions !== null && + !isStringRecord(httpRequest.body.extensions) + ) { + throw new BadRequestError( + '`extensions` in a POST body must be an object if provided.', + ); + } + + if ( + 'variables' in httpRequest.body && + httpRequest.body.variables !== null && + !isStringRecord(httpRequest.body.variables) + ) { + throw new BadRequestError( + '`variables` in a POST body must be an object if provided.', + ); + } + + if ( + 'operationName' in httpRequest.body && + httpRequest.body.operationName !== null && + typeof httpRequest.body.operationName !== 'string' + ) { + throw new BadRequestError( + '`operationName` in a POST body must be a string if provided.', + ); + } + + graphQLRequest = { + query: fieldIfString(httpRequest.body, 'query'), + operationName: fieldIfString(httpRequest.body, 'operationName'), + variables: fieldIfRecord(httpRequest.body, 'variables'), + extensions: fieldIfRecord(httpRequest.body, 'extensions'), + http: httpRequest, + }; + + break; + } + + case 'GET': { + const contentType = httpRequest.headers.get('content-type'); + if (contentType !== undefined) { + const contentTypeParsed = MIMEType.parse(contentType); + if ( + contentTypeParsed === null || + contentTypeParsed.essence !== 'application/json' + ) { + throw new BadRequestError( + 'GET requests may not have a content-type header other than application/json.', + { extensions: { http: newHTTPGraphQLHead(415) } }, + ); + } + } + + const searchParams = new URLSearchParams(httpRequest.search); + + graphQLRequest = { + query: searchParamIfSpecifiedOnce(searchParams, 'query'), + operationName: searchParamIfSpecifiedOnce( + searchParams, + 'operationName', + ), + variables: jsonParsedSearchParamIfSpecifiedOnce( + searchParams, + 'variables', + ), + extensions: jsonParsedSearchParamIfSpecifiedOnce( + searchParams, + 'extensions', + ), + http: httpRequest, + }; + + break; + } + default: + throw new BadRequestError( + 'Apollo Server supports only GET/POST requests.', + { + extensions: { + http: { + status: 405, + headers: new HeaderMap([['allow', 'GET, POST']]), + }, + }, + }, + ); + } + + const graphQLResponse = await internalExecuteOperation( + { + server, + graphQLRequest, + internals, + schemaDerivedData, + sharedResponseHTTPGraphQLHead, + }, + { contextValue }, + ); + + if (graphQLResponse.body.kind === 'single') { + if (!graphQLResponse.http.headers.get('content-type')) { + // If we haven't already set the content-type (via a plugin or something), + // decide which content-type to use based on the accept header. + const contentType = chooseContentTypeForSingleResultResponse(httpRequest); + if (contentType === null) { + throw new BadRequestError( + `An 'accept' header was provided for this request which does not accept ` + + `${MEDIA_TYPES.APPLICATION_JSON} or ${MEDIA_TYPES.APPLICATION_GRAPHQL_RESPONSE_JSON}`, + // Use 406 Not Accepted + { extensions: { http: { status: 406 } } }, + ); + } + graphQLResponse.http.headers.set('content-type', contentType); + } + + return { + ...graphQLResponse.http, + body: { + kind: 'complete', + string: await internals.stringifyResult( + orderExecutionResultFields(graphQLResponse.body.singleResult), + ), + }, + }; + } + + // Note that incremental delivery is not yet part of the official GraphQL + // spec. We are implementing a proposed version of the spec, and require + // clients to explicitly state `deferSpec=20220824`. Once incremental delivery + // has been added to the GraphQL spec, we will support `accept` headers + // without `deferSpec` as well (perhaps with slightly different behavior if + // anything has changed). + const acceptHeader = httpRequest.headers.get('accept'); + const negotiator = new Negotiator({ headers: { accept: acceptHeader } }); + const preferredMediaType = negotiator.mediaType([ + // mediaType() will return the first one that matches, so if the client + // doesn't include the deferSpec parameter it will match this one here, + // which isn't good enough. + MEDIA_TYPES.MULTIPART_MIXED_NO_DEFER_SPEC, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9, + MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2, + ]); + + if ( + !acceptHeader || + (preferredMediaType !== MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2 && + preferredMediaType !== MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9) + ) { + // The client ran an operation that would yield multiple parts, but didn't + // specify `accept: multipart/mixed`. We return an error. + throw new BadRequestError( + 'Apollo server received an operation that uses incremental delivery ' + + '(@defer or @stream), but the client does not accept multipart/mixed ' + + 'HTTP responses. To enable incremental delivery support, add the HTTP ' + + `header 'Accept: ${MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' ` + + 'if your client supports the current incremental format or ' + + `'Accept: ${MEDIA_TYPES.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2}' if your ` + + 'client supports the legacy incremental format', + // Use 406 Not Accepted + { extensions: { http: { status: 406 } } }, + ); + } + + graphQLResponse.http.headers.set( + 'content-type', + `multipart/mixed; boundary="-"; ${preferredMediaType.replace('multipart/mixed; ', '')}`, + ); + return { + ...graphQLResponse.http, + body: { + kind: 'chunked', + asyncIterator: writeMultipartBody( + graphQLResponse.body.initialResult, + graphQLResponse.body.subsequentResults, + ), + }, + }; +} + +async function* writeMultipartBody( + initialResult: + | GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2 + | GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, + subsequentResults: AsyncIterable< + | GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2 + | GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9 + >, +): AsyncGenerator { + // Note: we assume in this function that every result other than the last has + // hasNext=true and the last has hasNext=false. That is, we choose which kind + // of delimiter to place at the end of each block based on the contents of the + // message, not the structure of the async iterator. This makes sense because + // we want to write the delimiter as soon as each block is done (so the client + // can parse it immediately) but we may not know whether a general async + // iterator is finished until we do async work. + + yield `\r\n---\r\ncontent-type: application/json; charset=utf-8\r\n\r\n${JSON.stringify( + initialResult, + )}\r\n---${initialResult.hasNext ? '' : '--'}\r\n`; + + for await (const result of subsequentResults) { + yield `content-type: application/json; charset=utf-8\r\n\r\n${JSON.stringify( + result, + )}\r\n---${result.hasNext ? '' : '--'}\r\n`; + } +} + +// See https://github.com/facebook/graphql/pull/384 for why +// errors comes first. +function orderExecutionResultFields( + result: FormattedExecutionResult, +): FormattedExecutionResult { + return { + errors: result.errors, + data: result.data, + extensions: result.extensions, + }; +} + +// The result of a curl does not appear well in the terminal, so we add an extra new line +export function prettyJSONStringify(value: FormattedExecutionResult) { + return JSON.stringify(value) + '\n'; +} + +export function newHTTPGraphQLHead(status?: number): HTTPGraphQLHead { + return { + status, + headers: new HeaderMap(), + }; +} + +// Updates `target` with status code and headers from `source`. For now let's +// consider it undefined what happens if both have a status code set or both set +// the same header. +export function mergeHTTPGraphQLHead( + target: HTTPGraphQLHead, + source: HTTPGraphQLHead, +) { + if (source.status) { + target.status = source.status; + } + if (source.headers) { + for (const [name, value] of source.headers) { + // If source.headers contains non-lowercase header names, this will + // catch that case as long as target.headers is a HeaderMap. + target.headers.set(name, value); + } + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/standalone/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/standalone/index.ts new file mode 100644 index 00000000..b85f191d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/standalone/index.ts @@ -0,0 +1,155 @@ +import type { WithRequired } from '@apollo/utils.withrequired'; +import cors from 'cors'; +import bodyParser from 'body-parser'; +import { parse as parseContentType } from 'content-type'; +import http, { type IncomingMessage, type ServerResponse } from 'http'; +import type { ListenOptions } from 'net'; +import { parse as urlParse } from 'url'; +import type { ApolloServer } from '../ApolloServer.js'; +import type { + BaseContext, + ContextFunction, + HTTPGraphQLRequest, +} from '../externalTypes/index.js'; +import { ApolloServerPluginDrainHttpServer } from '../plugin/drainHttpServer/index.js'; +import { urlForHttpServer } from '../utils/urlForHttpServer.js'; +import { HeaderMap } from '../utils/HeaderMap.js'; +import finalhandler from 'finalhandler'; + +export interface StandaloneServerContextFunctionArgument { + req: IncomingMessage; + res: ServerResponse; +} + +export interface StartStandaloneServerOptions { + context?: ContextFunction< + [StandaloneServerContextFunctionArgument], + TContext + >; +} + +// according to RFC8259, only UTF-8 is allowed in JSON text +// (see https://datatracker.ietf.org/doc/html/rfc8259#section-8.1) +// RFC 7159 also specifies that JSON could be UTF-16 or UTF-32, +// so we allow for that, too +const validCharset = /^utf-(8|((16|32)(le|be)?))$/i; + +export async function startStandaloneServer( + server: ApolloServer, + options?: StartStandaloneServerOptions & { + listen?: ListenOptions; + }, +): Promise<{ url: string }>; +export async function startStandaloneServer( + server: ApolloServer, + options: WithRequired, 'context'> & { + listen?: ListenOptions; + }, +): Promise<{ url: string }>; +export async function startStandaloneServer( + server: ApolloServer, + options?: StartStandaloneServerOptions & { listen?: ListenOptions }, +): Promise<{ url: string }> { + const context = options?.context ?? (async () => ({}) as TContext); + const corsHandler = cors(); + const jsonHandler = bodyParser.json({ + verify(req) { + const charset = parseContentType(req).parameters.charset || 'utf-8'; + if (!charset.match(validCharset)) { + throw Object.assign( + new Error(`unsupported charset "${charset.toUpperCase()}"`), + { + status: 415, + name: 'UnsupportedMediaTypeError', + charset, + type: 'charset.unsupported', + }, + ); + } + }, + limit: '50mb', + }); + const httpServer = http.createServer((req, res) => { + const errorHandler = finalhandler(req, res, { + // Use the same onerror as Express. + onerror(err) { + if (process.env.NODE_ENV !== 'test') { + console.error(err.stack || err.toString()); + } + }, + }); + + corsHandler(req, res, (err) => { + if (err) { + errorHandler(err); + return; + } + jsonHandler(req, res, (err) => { + if (err) { + errorHandler(err); + return; + } + + const headers = new HeaderMap(); + for (const [key, value] of Object.entries(req.headers)) { + if (value !== undefined) { + // Node headers can be an array or a single value. We join + // multi-valued headers with `, ` just like the Fetch API's `Headers` + // does. We assume that keys are already lower-cased (as per the Node + // docs on IncomingMessage.headers) and so we don't bother to lower-case + // them or combine across multiple keys that would lower-case to the + // same value. + headers.set(key, Array.isArray(value) ? value.join(', ') : value); + } + } + + const httpGraphQLRequest: HTTPGraphQLRequest = { + // Note that method and url are guaranteed to exist for IncomingMessages coming from Servers. + method: req.method!.toUpperCase(), + headers, + search: urlParse(req.url!).search ?? '', + body: 'body' in req ? req.body : undefined, + }; + + server + .executeHTTPGraphQLRequest({ + httpGraphQLRequest, + context: () => context({ req, res }), + }) + .then(async (httpGraphQLResponse) => { + for (const [key, value] of httpGraphQLResponse.headers) { + res.setHeader(key, value); + } + res.statusCode = httpGraphQLResponse.status || 200; + + if (httpGraphQLResponse.body.kind === 'complete') { + res.end(httpGraphQLResponse.body.string); + return; + } + + for await (const chunk of httpGraphQLResponse.body.asyncIterator) { + res.write(chunk); + } + res.end(); + }) + .catch((err) => { + errorHandler(err); + }); + }); + }); + }); + + server.addPlugin( + ApolloServerPluginDrainHttpServer({ httpServer: httpServer }), + ); + + await server.start(); + + const listenOptions = options?.listen ?? { port: 4000 }; + // Wait for server to start listening + await new Promise((resolve) => { + httpServer.listen(listenOptions, resolve); + }); + + return { url: urlForHttpServer(httpServer) }; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/HeaderMap.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/HeaderMap.ts new file mode 100644 index 00000000..7ee1e535 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/HeaderMap.ts @@ -0,0 +1,22 @@ +export class HeaderMap extends Map { + // In order for TypeScript to prevent a standard `Map` from being compatible + // with a `HeaderMap`, we need some additional property on the class. + // @ts-ignore (this is just unused) + private __identity = Symbol('HeaderMap'); + + override set(key: string, value: string): this { + return super.set(key.toLowerCase(), value); + } + + override get(key: string) { + return super.get(key.toLowerCase()); + } + + override delete(key: string) { + return super.delete(key.toLowerCase()); + } + + override has(key: string) { + return super.has(key.toLowerCase()); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/UnreachableCaseError.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/UnreachableCaseError.ts new file mode 100644 index 00000000..6579bce7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/UnreachableCaseError.ts @@ -0,0 +1,10 @@ +/** + * Throw this in places that should be unreachable (because all other cases have + * been handled, reducing the type of the argument to `never`). TypeScript will + * complain if in fact there is a valid type for the argument. + */ +export class UnreachableCaseError extends Error { + constructor(val: never) { + super(`Unreachable case: ${val}`); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/computeCoreSchemaHash.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/computeCoreSchemaHash.ts new file mode 100644 index 00000000..e4494ec5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/computeCoreSchemaHash.ts @@ -0,0 +1,9 @@ +import { createHash } from '@apollo/utils.createhash'; + +// This hash function is used in both the schema reporting and usage reporting +// plugins. Making sure we use the same hash function hypothetically allows the +// two reporting features to work well together, though in practice nothing on +// the Studio side currently correlates this ID across both features. +export function computeCoreSchemaHash(schema: string): string { + return createHash('sha256').update(schema).digest('hex'); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/invokeHooks.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/invokeHooks.ts new file mode 100644 index 00000000..ae20e682 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/invokeHooks.ts @@ -0,0 +1,53 @@ +import { isDefined } from './isDefined.js'; + +type AsyncDidEndHook = (...args: TArgs) => Promise; +type SyncDidEndHook = (...args: TArgs) => void; + +export async function invokeDidStartHook( + targets: T[], + hook: (t: T) => Promise | undefined | void>, +): Promise> { + const didEndHooks = ( + await Promise.all(targets.map((target) => hook(target))) + ).filter(isDefined); + + didEndHooks.reverse(); + + return async (...args: TEndHookArgs) => { + for (const didEndHook of didEndHooks) { + didEndHook(...args); + } + }; +} + +// Almost all hooks are async, but as a special case, willResolveField is sync +// due to performance concerns. +export function invokeSyncDidStartHook( + targets: T[], + hook: (t: T) => SyncDidEndHook | undefined | void, +): SyncDidEndHook { + const didEndHooks: SyncDidEndHook[] = targets + .map((target) => hook(target)) + .filter(isDefined); + + didEndHooks.reverse(); + + return (...args: TEndHookArgs) => { + for (const didEndHook of didEndHooks) { + didEndHook(...args); + } + }; +} + +export async function invokeHooksUntilDefinedAndNonNull( + targets: T[], + hook: (t: T) => Promise, +): Promise { + for (const target of targets) { + const value = await hook(target); + if (value != null) { + return value; + } + } + return null; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/isDefined.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/isDefined.ts new file mode 100644 index 00000000..606bf6e4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/isDefined.ts @@ -0,0 +1,3 @@ +export function isDefined(t: T | undefined | null | void): t is T { + return t != null; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/makeGatewayGraphQLRequestContext.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/makeGatewayGraphQLRequestContext.ts new file mode 100644 index 00000000..e9b41a23 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/makeGatewayGraphQLRequestContext.ts @@ -0,0 +1,197 @@ +import type { + GatewayGraphQLRequest, + GatewayGraphQLRequestContext, + GatewayGraphQLResponse, + GatewaySchemaHash, +} from '@apollo/server-gateway-interface'; +import type { FetcherHeaders } from '@apollo/utils.fetcher'; +import type { ApolloServer, ApolloServerInternals } from '../ApolloServer'; +import type { + BaseContext, + GraphQLRequestContextExecutionDidStart, +} from '../externalTypes'; +import type { HeaderMap } from './HeaderMap'; + +// Apollo Gateway's API included `GraphQLRequestContext` from AS2/AS3. +// Specifically, a request context is passed to the main executor method, which +// it then exposes to user-configurable `GraphQLDataSource`s. +// `GraphQLRequestContext` has changed in incompatible ways since AS4; for example, +// we represent HTTP messages using our own data structures rather than Fetches, +// and some fields have been removed because they relate to features that don't +// exist any more. +// +// In general, the future of Apollo's development is in Apollo Router, not +// Gateway. So rather than have a big transition where a new version of Gateway +// supports AS5's GraphQLRequestContext instead of AS3's, we simply teach AS5 +// how to produce AS3-style GraphQLRequestContext objects specifically for use +// by Gateway. We have changed Gateway to get its TS type definitions from a new +// package rather than from AS3 itself, so that Gateway no longer needs to +// depend on Apollo Server. +// +// This function turns an AS5 GraphQLRequestContext into a +// GatewayGraphQLRequestContext (which is basically an AS3 +// GraphQLRequestContext). +// +// You might think that *after* invoking the executor, we would then need to +// propagate any changes made by the gateway back onto the "real" +// GraphQLRequestContext. It turns out that for each bit of data on the request +// context, this is either unnecessary or impossible. (We don't need to support +// use cases where people break type safe, eg by changing the values of readonly +// fields.) Here's why: +// +// Many fields on GatewayGraphQLRequestContext are declared readonly and their +// values are taken directly from the real GraphQLRequestContext. This means +// that gateways should not change the field's value, and any mutations of the +// object stored in the field (say, calling +// `requestContext.overallCachePolicy.restrict`, as RemoteGraphQLDataSource +// does) already take effect. +// +// The only two fields not declared as readonly are `logger` and `debug`. +// +// Technically, a gateway implementation could set `requestContext.logger` to a +// different Logger without breaking the TypeScript declarations. In AS5 we +// don't actually have a requestContext.logger; we have `readonly +// requestContext.server` and `readonly server.logger`. So there's not an easy +// way for us to carry out this change: AS5 just doesn't let gateway or plugins +// override the server's logger (and generally doesn't allow the logger to +// change after the server is created), which seems like a simpler model. If it +// turns out there is a real use case for the gateway to be able to change the +// overall logger for the request as seen by plugins, we can fix that later. +// +// Similarly, it's not clear what the intended use case of mutating `debug` in +// gateway would be. `debug` has now mostly changed into +// `includeStacktraceInErrorResponses`. So perhaps this could be used to let you +// decide whether or not to include the stacktrace on a per-operation basis... +// but you can also use `formatError` or `didEncounterErrors` for this perhaps? +// In any case, AS5 doesn't track `includeStacktraceInErrorResponses` on a +// per-operation basis; if we find a use case for this we can add it later. +// +// So we'll just ignore changes to `logger` and `debug`. +// +// Next, there's `request`. We don't know of a use case for mutating the +// *request* at execution time. If there was a real use case, we could add a +// function that copies pieces back from the gateway `request` to the AS5 +// request, but we're not bothering to yet. +// +// Finally, there's `response`. Sure, the executor *could* mutate `response`. +// But the main thing the executor is doing is *returning* a response, which +// then semi-overwrites `requestContext.response` anyway. So it doesn't seem +// like we need to support `executor` *also* overwriting response. Yet again, we +// can fix this if it turns out it's necessary. (That said, the executor could +// in theory write HTTP response headers or status, so we make sure to hook them +// up directly to the appropriate data in the real GraphQLRequestContext.) +// +// So all in all, it looks like it's OK for this to be a "one-way" conversion. +export function makeGatewayGraphQLRequestContext( + newRequestContext: GraphQLRequestContextExecutionDidStart, + server: ApolloServer, + internals: ApolloServerInternals, +): GatewayGraphQLRequestContext { + const request: GatewayGraphQLRequest = {}; + if ('query' in newRequestContext.request) { + request.query = newRequestContext.request.query; + } + if ('operationName' in newRequestContext.request) { + request.operationName = newRequestContext.request.operationName; + } + if ('variables' in newRequestContext.request) { + request.variables = newRequestContext.request.variables; + } + if ('extensions' in newRequestContext.request) { + request.extensions = newRequestContext.request.extensions; + } + if (newRequestContext.request.http) { + const newHttp = newRequestContext.request.http; + const needQuestion = + newHttp.search !== '' && !newHttp.search.startsWith('?'); + request.http = { + method: newHttp.method, + // As of AS4, we no longer attempt to track complete URLs (just the search + // parameters used in GET requests). So we have to fake them for Gateway. + url: `https://unknown-url.invalid/${needQuestion ? '?' : ''}${ + newHttp.search + }`, + headers: new FetcherHeadersForHeaderMap(newHttp.headers), + }; + } + + const response: GatewayGraphQLResponse = { + http: { + headers: new FetcherHeadersForHeaderMap( + newRequestContext.response.http.headers, + ), + get status() { + return newRequestContext.response.http.status; + }, + set status(newStatus) { + newRequestContext.response.http.status = newStatus; + }, + }, + // We leave off `body` because it hasn't been set yet. + }; + + return { + request, + response, + logger: server.logger, + schema: newRequestContext.schema, + // For the sake of typechecking, we still provide this field, but we don't + // calculate it. If somebody really needs it in their gateway + // implementation, they're welcome to copy + // https://github.com/apollographql/apollo-server/blob/3f218e78/packages/apollo-server-core/src/utils/schemaHash.ts + // into their code. + schemaHash: + 'schemaHash no longer exists since Apollo Server 4' as GatewaySchemaHash, + context: newRequestContext.contextValue, + cache: server.cache, + queryHash: newRequestContext.queryHash, + document: newRequestContext.document, + source: newRequestContext.source, + operationName: newRequestContext.operationName, + operation: newRequestContext.operation, + errors: newRequestContext.errors, + metrics: newRequestContext.metrics, + debug: internals.includeStacktraceInErrorResponses, + overallCachePolicy: newRequestContext.overallCachePolicy, + requestIsBatched: newRequestContext.requestIsBatched, + }; +} + +// An implementation of the W3C-style headers class used by Gateway (and AS3), +// backed by AS5's HeaderMap. Changes are written directly to the HeaderMap, so +// any concurrent writes to the underlying HeaderMap (eg from a plugin) can be +// seen immediately by the gateway and vice versa. +class FetcherHeadersForHeaderMap implements FetcherHeaders { + constructor(private map: HeaderMap) {} + append(name: string, value: string) { + if (this.map.has(name)) { + this.map.set(name, this.map.get(name) + ', ' + value); + } else { + this.map.set(name, value); + } + } + delete(name: string) { + this.map.delete(name); + } + get(name: string): string | null { + return this.map.get(name) ?? null; + } + has(name: string): boolean { + return this.map.has(name); + } + set(name: string, value: string) { + this.map.set(name, value); + } + entries(): Iterator<[string, string]> { + return this.map.entries(); + } + keys(): Iterator { + return this.map.keys(); + } + values(): Iterator { + return this.map.values(); + } + [Symbol.iterator](): Iterator<[string, string]> { + return this.map.entries(); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/resolvable.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/resolvable.ts new file mode 100644 index 00000000..f279ed44 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/resolvable.ts @@ -0,0 +1,30 @@ +// Copyright 2019 Joseph Gentle + +// Permission to use, copy, modify, and / or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. + +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +export type Resolvable = Promise & { + resolve: (t: T) => void; + reject: (e: any) => void; +}; + +export default (): Resolvable => { + let resolve: (val: T) => void; + let reject: (err: any) => void; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }) as Resolvable; + promise.resolve = resolve!; + promise.reject = reject!; + return promise; +}; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaInstrumentation.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaInstrumentation.ts new file mode 100644 index 00000000..d6295e7f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaInstrumentation.ts @@ -0,0 +1,132 @@ +import { + type GraphQLSchema, + type GraphQLField, + getNamedType, + GraphQLObjectType, + type GraphQLFieldResolver, + defaultFieldResolver, +} from 'graphql'; +import type { + BaseContext, + GraphQLRequestExecutionListener, +} from '../externalTypes/index.js'; + +export const symbolExecutionDispatcherWillResolveField = Symbol( + 'apolloServerExecutionDispatcherWillResolveField', +); +export const symbolUserFieldResolver = Symbol('apolloServerUserFieldResolver'); +const symbolPluginsEnabled = Symbol('apolloServerPluginsEnabled'); + +export function enablePluginsForSchemaResolvers( + schema: GraphQLSchema & { [symbolPluginsEnabled]?: boolean }, +) { + if (pluginsEnabledForSchemaResolvers(schema)) { + return schema; + } + Object.defineProperty(schema, symbolPluginsEnabled, { + value: true, + }); + + const typeMap = schema.getTypeMap(); + Object.values(typeMap).forEach((type) => { + if ( + !getNamedType(type).name.startsWith('__') && + type instanceof GraphQLObjectType + ) { + const fields = type.getFields(); + Object.values(fields).forEach((field) => { + wrapField(field); + }); + } + }); + + return schema; +} + +export function pluginsEnabledForSchemaResolvers( + schema: GraphQLSchema & { [symbolPluginsEnabled]?: boolean }, +): boolean { + return !!schema[symbolPluginsEnabled]; +} + +function wrapField( + field: GraphQLField, +): void { + const originalFieldResolve = field.resolve; + + field.resolve = (source, args, contextValue, info) => { + const willResolveField = contextValue?.[ + symbolExecutionDispatcherWillResolveField + ] as + | GraphQLRequestExecutionListener['willResolveField'] + | undefined; + + const userFieldResolver = contextValue?.[symbolUserFieldResolver] as + | GraphQLFieldResolver + | undefined; + + // The technique for implementing a "did resolve field" is accomplished by + // returning a function from the `willResolveField` handler. While there + // may be several callbacks, depending on the number of plugins which have + // implemented a `willResolveField` hook, this hook will call them all + // as dictated by the dispatcher. We will call this when object + // resolution is complete. + const didResolveField = + typeof willResolveField === 'function' && + willResolveField({ source, args, contextValue, info }); + + const fieldResolver = + originalFieldResolve || userFieldResolver || defaultFieldResolver; + + try { + const result = fieldResolver(source, args, contextValue, info); + + // Call the stack's handlers either immediately (if result is not a + // Promise) or once the Promise is done. Then return that same + // maybe-Promise value. + if (typeof didResolveField === 'function') { + whenResultIsFinished(result, didResolveField); + } + return result; + } catch (error) { + // Normally it's a bad sign to see an error both handled and + // re-thrown. But it is useful to allow extensions to track errors while + // still handling them in the normal GraphQL way. + if (typeof didResolveField === 'function') { + didResolveField(error as Error); + } + throw error; + } + }; +} + +function isPromise(x: any): boolean { + return x && typeof x.then === 'function'; +} + +// Given result (which may be a Promise or an array some of whose elements are +// promises) Promises, set up 'callback' to be invoked when result is fully +// resolved. (Unfortunately, this does not perfectly handle every possible +// return value shape, such as arrays of arrays of Promises.) +export function whenResultIsFinished( + result: any, + callback: (err: Error | null, result?: any) => void, +) { + if (isPromise(result)) { + result.then( + (r: any) => whenResultIsFinished(r, callback), + (err: Error) => callback(err), + ); + } else if (Array.isArray(result)) { + if (result.some(isPromise)) { + Promise.all(result).then( + (r: any) => callback(null, r), + (err: Error) => callback(err), + ); + } else { + callback(null, result); + } + } else { + callback(null, result); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaManager.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaManager.ts new file mode 100644 index 00000000..298eb3a2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/schemaManager.ts @@ -0,0 +1,212 @@ +import type { Logger } from '@apollo/utils.logger'; +import type { GraphQLSchema } from 'graphql'; +import type { + GatewayExecutor, + GatewayInterface, + GatewayUnsubscriber, +} from '@apollo/server-gateway-interface'; +import type { SchemaDerivedData } from '../ApolloServer.js'; +import type { + ApolloConfig, + GraphQLSchemaContext, +} from '../externalTypes/index.js'; + +type SchemaDerivedDataProvider = ( + apiSchema: GraphQLSchema, +) => SchemaDerivedData; + +/** + * An async-safe class for tracking changes in schemas and schema-derived data. + * + * Specifically, as long as start() is called (and completes) before stop() is + * called, any set of executions of public methods is linearizable. + * + * Note that linearizability in Javascript is trivial if all public methods are + * non-async, but increasingly difficult to guarantee if public methods become + * async. Accordingly, if you believe a public method should be async, think + * carefully on whether it's worth the mental overhead. (E.g. if you wished that + * a callback was async, consider instead resolving a Promise in a non-async + * callback and having your async code wait on the Promise in setTimeout().) + */ +export class SchemaManager { + private readonly logger: Logger; + private readonly schemaDerivedDataProvider: SchemaDerivedDataProvider; + private readonly onSchemaLoadOrUpdateListeners = new Set< + (schemaContext: GraphQLSchemaContext) => void + >(); + private isStopped = false; + private schemaDerivedData?: SchemaDerivedData; + private schemaContext?: GraphQLSchemaContext; + + // For state that's specific to the mode of operation. + private readonly modeSpecificState: + | { + readonly mode: 'gateway'; + readonly gateway: GatewayInterface; + readonly apolloConfig: ApolloConfig; + unsubscribeFromGateway?: GatewayUnsubscriber; + } + | { + readonly mode: 'schema'; + readonly apiSchema: GraphQLSchema; + readonly schemaDerivedData: SchemaDerivedData; + }; + + constructor( + options: ( + | { gateway: GatewayInterface; apolloConfig: ApolloConfig } + | { apiSchema: GraphQLSchema } + ) & { + logger: Logger; + schemaDerivedDataProvider: SchemaDerivedDataProvider; + }, + ) { + this.logger = options.logger; + this.schemaDerivedDataProvider = options.schemaDerivedDataProvider; + if ('gateway' in options) { + this.modeSpecificState = { + mode: 'gateway', + gateway: options.gateway, + apolloConfig: options.apolloConfig, + }; + } else { + this.modeSpecificState = { + mode: 'schema', + apiSchema: options.apiSchema, + // The caller of the constructor expects us to fail early if the schema + // given is invalid/has errors, so we call the provider here. We also + // pass the result to start(), as the provider can be expensive to call. + schemaDerivedData: options.schemaDerivedDataProvider(options.apiSchema), + }; + } + } + + /** + * Calling start() will: + * - Start gateway schema fetching (if a gateway was provided). + * - Initialize schema-derived data. + * - Synchronously notify onSchemaLoadOrUpdate() listeners of schema load, and + * asynchronously notify them of schema updates. + * - If we started a gateway, returns the gateway's executor; otherwise null. + */ + public async start(): Promise { + if (this.modeSpecificState.mode === 'gateway') { + const gateway = this.modeSpecificState.gateway; + if (gateway.onSchemaLoadOrUpdate) { + // Use onSchemaLoadOrUpdate, as it reports the core supergraph SDL and + // always reports the initial schema load. + this.modeSpecificState.unsubscribeFromGateway = + gateway.onSchemaLoadOrUpdate((schemaContext) => { + this.processSchemaLoadOrUpdateEvent(schemaContext); + }); + } else { + throw new Error( + "Unexpectedly couldn't find onSchemaLoadOrUpdate on gateway", + ); + } + + const config = await this.modeSpecificState.gateway.load({ + apollo: this.modeSpecificState.apolloConfig, + }); + + return config.executor; + } else { + this.processSchemaLoadOrUpdateEvent( + { + apiSchema: this.modeSpecificState.apiSchema, + }, + this.modeSpecificState.schemaDerivedData, + ); + return null; + } + } + + /** + * Registers a listener for schema load/update events. Note that the latest + * event is buffered, i.e. + * - If registered before start(), this method will throw. (We have no need + * for registration before start(), but this is easy enough to change.) + * - If registered after start() but before stop(), the callback will be first + * called in this method (for whatever the current schema is), and then + * later for updates. + * - If registered after stop(), the callback will never be called. + * + * For gateways, a core supergraph SDL will be provided to the callback. + * + * @param callback The listener to execute on schema load/updates. + */ + public onSchemaLoadOrUpdate( + callback: (schemaContext: GraphQLSchemaContext) => void, + ): GatewayUnsubscriber { + if (!this.schemaContext) { + throw new Error('You must call start() before onSchemaLoadOrUpdate()'); + } + if (!this.isStopped) { + try { + callback(this.schemaContext); + } catch (e) { + // Note that onSchemaLoadOrUpdate() is currently only called from + // ApolloServer._start(), so we throw here to alert the user early + // that their callback is failing. + throw new Error( + `An error was thrown from an 'onSchemaLoadOrUpdate' listener: ${ + (e as Error).message + }`, + ); + } + } + this.onSchemaLoadOrUpdateListeners.add(callback); + + return () => { + this.onSchemaLoadOrUpdateListeners.delete(callback); + }; + } + + /** + * Get the schema-derived state for the current schema. This throws if called + * before start() is called. + */ + public getSchemaDerivedData(): SchemaDerivedData { + if (!this.schemaDerivedData) { + throw new Error('You must call start() before getSchemaDerivedData()'); + } + return this.schemaDerivedData; + } + + /** + * Calling stop() will: + * - Stop gateway schema fetching (if a gateway was provided). + * - Note that this specific step may not succeed if gateway is old. + * - Stop updating schema-derived data. + * - Stop notifying onSchemaLoadOrUpdate() listeners. + */ + public async stop(): Promise { + this.isStopped = true; + if (this.modeSpecificState.mode === 'gateway') { + this.modeSpecificState.unsubscribeFromGateway?.(); + await this.modeSpecificState.gateway.stop?.(); + } + } + + private processSchemaLoadOrUpdateEvent( + schemaContext: GraphQLSchemaContext, + schemaDerivedData?: SchemaDerivedData, + ): void { + if (!this.isStopped) { + this.schemaDerivedData = + schemaDerivedData ?? + this.schemaDerivedDataProvider(schemaContext.apiSchema); + this.schemaContext = schemaContext; + this.onSchemaLoadOrUpdateListeners.forEach((listener) => { + try { + listener(schemaContext); + } catch (e) { + this.logger.error( + "An error was thrown from an 'onSchemaLoadOrUpdate' listener", + ); + this.logger.error(e); + } + }); + } + } +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/urlForHttpServer.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/urlForHttpServer.ts new file mode 100644 index 00000000..24a5f10c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/utils/urlForHttpServer.ts @@ -0,0 +1,21 @@ +import type { Server } from 'http'; +import type { AddressInfo } from 'net'; +import { format } from 'url'; + +export function urlForHttpServer(httpServer: Server): string { + const { address, port } = httpServer.address() as AddressInfo; + + // Convert IPs which mean "any address" (IPv4 or IPv6) into localhost + // corresponding loopback ip. Note that the url field we're setting is + // primarily for consumption by our test suite. If this heuristic is wrong for + // your use case, explicitly specify a frontend host (in the `host` option + // when listening). + const hostname = address === '' || address === '::' ? 'localhost' : address; + + return format({ + protocol: 'http', + hostname, + port, + pathname: '/', + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/NoIntrospection.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/NoIntrospection.ts new file mode 100644 index 00000000..0f905787 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/NoIntrospection.ts @@ -0,0 +1,27 @@ +import { + GraphQLError, + type ValidationRule, + type ValidationContext, +} from 'graphql'; +import { ApolloServerValidationErrorCode } from '../errors/index.js'; + +export const NoIntrospection: ValidationRule = ( + context: ValidationContext, +) => ({ + Field(node) { + if (node.name.value === '__schema' || node.name.value === '__type') { + context.reportError( + new GraphQLError( + 'GraphQL introspection is not allowed by Apollo Server, but the query contained __schema or __type. To enable introspection, pass introspection: true to ApolloServer in production', + { + nodes: [node], + extensions: { + validationErrorCode: + ApolloServerValidationErrorCode.INTROSPECTION_DISABLED, + }, + }, + ), + ); + } + }, +}); diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/RecursiveSelectionsLimit.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/RecursiveSelectionsLimit.ts new file mode 100644 index 00000000..632c2986 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/RecursiveSelectionsLimit.ts @@ -0,0 +1,198 @@ +import { + GraphQLError, + type ValidationRule, + type ValidationContext, + type ASTVisitor, +} from 'graphql'; +import { ApolloServerValidationErrorCode } from '../errors/index.js'; + +export const DEFAULT_MAX_RECURSIVE_SELECTIONS = 10_000_000; + +interface ExecutableDefinitionInfo { + selectionCount: number; + fragmentSpreads: Map; +} + +class RecursiveSelectionValidationContext { + private readonly fragmentInfo: Map = + new Map(); + private readonly operationInfo: Map = + new Map(); + private currentFragment?: string; + private currentOperation?: string | null; + private readonly fragmentRecursiveSelectionCount: Map = + new Map(); + + constructor( + private readonly selectionCountLimit: number, + private readonly context: ValidationContext, + ) {} + + private getExecutionDefinitionInfo(): ExecutableDefinitionInfo | undefined { + if (this.currentFragment !== undefined) { + let entry = this.fragmentInfo.get(this.currentFragment); + if (!entry) { + entry = { + selectionCount: 0, + fragmentSpreads: new Map(), + }; + this.fragmentInfo.set(this.currentFragment, entry); + } + return entry; + } + if (this.currentOperation !== undefined) { + let entry = this.operationInfo.get(this.currentOperation); + if (!entry) { + entry = { + selectionCount: 0, + fragmentSpreads: new Map(), + }; + this.operationInfo.set(this.currentOperation, entry); + } + return entry; + } + return undefined; + } + + processSelection(fragmentSpreadName?: string) { + const definitionInfo = this.getExecutionDefinitionInfo(); + if (!definitionInfo) { + return; + } + definitionInfo.selectionCount++; + if (fragmentSpreadName !== undefined) { + let spreadCount = + (definitionInfo.fragmentSpreads.get(fragmentSpreadName) ?? 0) + 1; + definitionInfo.fragmentSpreads.set(fragmentSpreadName, spreadCount); + } + } + + enterFragment(fragment: string) { + this.currentFragment = fragment; + } + + leaveFragment() { + this.currentFragment = undefined; + } + + enterOperation(operation: string | null) { + this.currentOperation = operation; + } + + leaveOperation() { + this.currentOperation = undefined; + } + + computeFragmentRecursiveSelectionsCount(fragment: string): number { + const cachedCount = this.fragmentRecursiveSelectionCount.get(fragment); + if (cachedCount === null) { + // We set "fragmentRecursiveSelectionCount" to "null" for a fragment when + // we're in the middle of recursing it, so if we encounter it when getting + // a fragment spread, that means we've reached a circular reference. We + // don't want to error here, as a separate GraphQL validation checks for + // this, so we instead pretend the fragment has zero selections. + return 0; + } + if (cachedCount !== undefined) { + return cachedCount; + } + this.fragmentRecursiveSelectionCount.set(fragment, null); + // If "definitionInfo" is "undefined", it means that the fragment spread + // refers to a named fragment that has zero selections or doesn't exist. We + // don't want to error here, as a separate GraphQL validation checks for + // this, so we instead pretend the fragment always has zero selections. + const definitionInfo = this.fragmentInfo.get(fragment); + let count = 0; + if (definitionInfo) { + count = definitionInfo.selectionCount; + for (const [fragment, spreadCount] of definitionInfo.fragmentSpreads) { + count += + spreadCount * this.computeFragmentRecursiveSelectionsCount(fragment); + } + } + this.fragmentRecursiveSelectionCount.set(fragment, count); + return count; + } + + private reportError(operation: string | null) { + const operationName = operation + ? `Operation "${operation}"` + : 'Anonymous operation'; + this.context.reportError( + new GraphQLError( + `${operationName} recursively requests too many selections.`, + { + nodes: [], + extensions: { + validationErrorCode: + ApolloServerValidationErrorCode.MAX_RECURSIVE_SELECTIONS_EXCEEDED, + }, + }, + ), + ); + } + + checkLimitExceeded() { + for (const [operation, definitionInfo] of this.operationInfo) { + let count = definitionInfo.selectionCount; + for (const [fragment, spreadCount] of definitionInfo.fragmentSpreads) { + count += + spreadCount * this.computeFragmentRecursiveSelectionsCount(fragment); + } + if (count > this.selectionCountLimit) { + this.reportError(operation); + } + } + } +} + +/** + * Creates a GraphQL validation rule that imposes a limit on the number of + * recursive selections in an operation. This is the number of selections you + * would encounter if named fragments were inserted inline whenever a fragment + * spread referencing them were encountered. + * + * @param limit The maximum number of recursive selections in any operation. + */ +export function createMaxRecursiveSelectionsRule( + limit: number, +): ValidationRule { + return (context: ValidationContext): ASTVisitor => { + const selectionContext = new RecursiveSelectionValidationContext( + limit, + context, + ); + return { + Field() { + selectionContext.processSelection(); + }, + InlineFragment() { + selectionContext.processSelection(); + }, + FragmentSpread(node) { + selectionContext.processSelection(node.name.value); + }, + FragmentDefinition: { + enter(node) { + selectionContext.enterFragment(node.name.value); + }, + leave() { + selectionContext.leaveFragment(); + }, + }, + OperationDefinition: { + enter(node) { + selectionContext.enterOperation(node.name?.value ?? null); + }, + leave() { + selectionContext.leaveOperation(); + }, + }, + Document: { + leave() { + selectionContext.checkLimitExceeded(); + }, + }, + }; + }; +} diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/index.ts b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/index.ts new file mode 100644 index 00000000..80139777 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/src/validationRules/index.ts @@ -0,0 +1,5 @@ +export { NoIntrospection } from './NoIntrospection.js'; +export { + DEFAULT_MAX_RECURSIVE_SELECTIONS, + createMaxRecursiveSelectionsRule, +} from './RecursiveSelectionsLimit.js'; diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/standalone/package.json b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/standalone/package.json new file mode 100644 index 00000000..258e4369 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server/standalone/package.json @@ -0,0 +1,8 @@ +{ + "name": "@apollo/server/standalone", + "type": "module", + "main": "../dist/cjs/standalone/index.js", + "module": "../dist/esm/standalone/index.js", + "types": "../dist/esm/standalone/index.d.ts", + "sideEffects": false +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf new file mode 120000 index 00000000..c9defaba --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf @@ -0,0 +1 @@ +../../../@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.createhash b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.createhash new file mode 120000 index 00000000..a30f29b8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.createhash @@ -0,0 +1 @@ +../../../@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.fetcher b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.fetcher new file mode 120000 index 00000000..48218c4d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.fetcher @@ -0,0 +1 @@ +../../../@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.isnodelike b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.isnodelike new file mode 120000 index 00000000..4ee84c75 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.isnodelike @@ -0,0 +1 @@ +../../../@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache new file mode 120000 index 00000000..2efb8bc0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.keyvaluecache @@ -0,0 +1 @@ +../../../@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.logger b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.logger new file mode 120000 index 00000000..64f1e450 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.logger @@ -0,0 +1 @@ +../../../@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.usagereporting b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.usagereporting new file mode 120000 index 00000000..40ad843a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.usagereporting @@ -0,0 +1 @@ +../../../@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.withrequired b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.withrequired new file mode 120000 index 00000000..4f3dfdfe --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/utils.withrequired @@ -0,0 +1 @@ +../../../@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@graphql-tools/schema b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@graphql-tools/schema new file mode 120000 index 00000000..e07c5fcc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@graphql-tools/schema @@ -0,0 +1 @@ +../../../@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/async-retry b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/async-retry new file mode 120000 index 00000000..36cc0984 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/async-retry @@ -0,0 +1 @@ +../../async-retry@1.3.3/node_modules/async-retry \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/body-parser b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/body-parser new file mode 120000 index 00000000..c80efa06 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/body-parser @@ -0,0 +1 @@ +../../body-parser@2.3.0/node_modules/body-parser \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/content-type b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/content-type new file mode 120000 index 00000000..6efa1580 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/content-type @@ -0,0 +1 @@ +../../content-type@1.0.5/node_modules/content-type \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/cors b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/cors new file mode 120000 index 00000000..242b652d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/cors @@ -0,0 +1 @@ +../../cors@2.8.6/node_modules/cors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/finalhandler b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/finalhandler new file mode 120000 index 00000000..6ec192a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/finalhandler @@ -0,0 +1 @@ +../../finalhandler@2.1.1/node_modules/finalhandler \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/loglevel b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/loglevel new file mode 120000 index 00000000..e84a884e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/loglevel @@ -0,0 +1 @@ +../../loglevel@1.9.2/node_modules/loglevel \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/lru-cache b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/lru-cache new file mode 120000 index 00000000..a34ff6f6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/lru-cache @@ -0,0 +1 @@ +../../lru-cache@11.5.3/node_modules/lru-cache \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/negotiator b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/negotiator new file mode 120000 index 00000000..c3542bd2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/negotiator @@ -0,0 +1 @@ +../../negotiator@1.1.0/node_modules/negotiator \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/whatwg-mimetype b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/whatwg-mimetype new file mode 120000 index 00000000..2349c120 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/whatwg-mimetype @@ -0,0 +1 @@ +../../whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/protobufjs b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/protobufjs new file mode 120000 index 00000000..6b523908 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/protobufjs @@ -0,0 +1 @@ +../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/README.md b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/README.md new file mode 100644 index 00000000..3b6aa14b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/README.md @@ -0,0 +1,40 @@ +# `apollo-reporting-protobuf` + +> **Note:** The Apollo usage reporting API is subject to change. We strongly +> encourage developers to contact Apollo support at `support@apollographql.com` +> to discuss their use case prior to building their own reporting agent using +> this module. + +This module provides JavaScript/TypeScript +[Protocol buffer](https://developers.google.com/protocol-buffers/) definitions +for the Apollo usage reporting API. These definitions are generated for +consumption from the `reports.proto` file which is defined internally within +Apollo. + +## Development + +> **Note:** Due to a dependency on Unix tools (e.g. `bash`, `grep`, etc.), the +> development of this module requires a Unix system. There is no reason why +> this can't be avoided, the time just hasn't been taken to make those changes. +> We'd happily accept a PR which makes the appropriate changes! + +Currently, this package generates a majority of its code with +`@apollo/protobufjs` (a fork of +[`protobufjs`](https://www.npmjs.com/package/protobufjs) that we maintain +specifically for this package) based on the `reports.proto` file. The output is +generated with the `generate` npm script. + +The root of the repository provides some `devDependencies` necessary to build +these definitions; these will be installed by running `npm install` at the root +of this workspace. When making changes to this module, run scripts via `npm run +SCRIPTNAME -w @apollo/usage-reporting-protobuf` in the **root** of this monorepo in +order to update the definitions in _this_ module. The `-w` flag is shorthand for +`--workspace`; this monorepo leverages NPM workspaces to manage its packages. + +To update `reports.proto` to the current version recognized by the Studio usage +reporting ingress, run `npm run update-proto -w +@apollo/usage-reporting-protobuf`. To then regenerate the JS and TS files, run +`npm run generate -w @apollo/usage-reporting-protobuf`. We check in the +generated code and only regenerate it manually, partially to make builds faster +(no need to run pbjs on every `npm install`) and partially so that we don't have +to make sure that `pbjs` runs on every Node version that we support. diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/package.json b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.d.ts b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.d.ts new file mode 100644 index 00000000..1329e390 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.d.ts @@ -0,0 +1,3276 @@ +import * as $protobuf from "@apollo/protobufjs"; +/** Properties of a Trace. */ +export interface ITrace { + + /** Trace startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Trace endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Trace durationNs */ + durationNs?: (number|null); + + /** Trace root */ + root?: (Trace.INode|null); + + /** Trace isIncomplete */ + isIncomplete?: (boolean|null); + + /** Trace signature */ + signature?: (string|null); + + /** Trace unexecutedOperationBody */ + unexecutedOperationBody?: (string|null); + + /** Trace unexecutedOperationName */ + unexecutedOperationName?: (string|null); + + /** Trace details */ + details?: (Trace.IDetails|null); + + /** Trace clientName */ + clientName?: (string|null); + + /** Trace clientVersion */ + clientVersion?: (string|null); + + /** Trace http */ + http?: (Trace.IHTTP|null); + + /** Trace cachePolicy */ + cachePolicy?: (Trace.ICachePolicy|null); + + /** Trace queryPlan */ + queryPlan?: (Trace.IQueryPlanNode|null); + + /** Trace fullQueryCacheHit */ + fullQueryCacheHit?: (boolean|null); + + /** Trace persistedQueryHit */ + persistedQueryHit?: (boolean|null); + + /** Trace persistedQueryRegister */ + persistedQueryRegister?: (boolean|null); + + /** Trace registeredOperation */ + registeredOperation?: (boolean|null); + + /** Trace forbiddenOperation */ + forbiddenOperation?: (boolean|null); + + /** Trace fieldExecutionWeight */ + fieldExecutionWeight?: (number|null); +} + +/** Represents a Trace. */ +export class Trace implements ITrace { + + /** + * Constructs a new Trace. + * @param [properties] Properties to set + */ + constructor(properties?: ITrace); + + /** Trace startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Trace endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Trace durationNs. */ + public durationNs: number; + + /** Trace root. */ + public root?: (Trace.INode|null); + + /** Trace isIncomplete. */ + public isIncomplete: boolean; + + /** Trace signature. */ + public signature: string; + + /** Trace unexecutedOperationBody. */ + public unexecutedOperationBody: string; + + /** Trace unexecutedOperationName. */ + public unexecutedOperationName: string; + + /** Trace details. */ + public details?: (Trace.IDetails|null); + + /** Trace clientName. */ + public clientName: string; + + /** Trace clientVersion. */ + public clientVersion: string; + + /** Trace http. */ + public http?: (Trace.IHTTP|null); + + /** Trace cachePolicy. */ + public cachePolicy?: (Trace.ICachePolicy|null); + + /** Trace queryPlan. */ + public queryPlan?: (Trace.IQueryPlanNode|null); + + /** Trace fullQueryCacheHit. */ + public fullQueryCacheHit: boolean; + + /** Trace persistedQueryHit. */ + public persistedQueryHit: boolean; + + /** Trace persistedQueryRegister. */ + public persistedQueryRegister: boolean; + + /** Trace registeredOperation. */ + public registeredOperation: boolean; + + /** Trace forbiddenOperation. */ + public forbiddenOperation: boolean; + + /** Trace fieldExecutionWeight. */ + public fieldExecutionWeight: number; + + /** + * Creates a new Trace instance using the specified properties. + * @param [properties] Properties to set + * @returns Trace instance + */ + public static create(properties?: ITrace): Trace; + + /** + * Encodes the specified Trace message. Does not implicitly {@link Trace.verify|verify} messages. + * @param message Trace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ITrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Trace message, length delimited. Does not implicitly {@link Trace.verify|verify} messages. + * @param message Trace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ITrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Trace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace; + + /** + * Decodes a Trace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace; + + /** + * Verifies a Trace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Trace message. Also converts values to other types if specified. + * @param message Trace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Trace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +export namespace Trace { + + /** Properties of a CachePolicy. */ + interface ICachePolicy { + + /** CachePolicy scope */ + scope?: (Trace.CachePolicy.Scope|null); + + /** CachePolicy maxAgeNs */ + maxAgeNs?: (number|null); + } + + /** Represents a CachePolicy. */ + class CachePolicy implements ICachePolicy { + + /** + * Constructs a new CachePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.ICachePolicy); + + /** CachePolicy scope. */ + public scope: Trace.CachePolicy.Scope; + + /** CachePolicy maxAgeNs. */ + public maxAgeNs: number; + + /** + * Creates a new CachePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns CachePolicy instance + */ + public static create(properties?: Trace.ICachePolicy): Trace.CachePolicy; + + /** + * Encodes the specified CachePolicy message. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @param message CachePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.ICachePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CachePolicy message, length delimited. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @param message CachePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.ICachePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CachePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.CachePolicy; + + /** + * Decodes a CachePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.CachePolicy; + + /** + * Verifies a CachePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a CachePolicy message. Also converts values to other types if specified. + * @param message CachePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.CachePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CachePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CachePolicy { + + /** Scope enum. */ + enum Scope { + UNKNOWN = 0, + PUBLIC = 1, + PRIVATE = 2 + } + } + + /** Properties of a Details. */ + interface IDetails { + + /** Details variablesJson */ + variablesJson?: ({ [k: string]: string }|null); + + /** Details operationName */ + operationName?: (string|null); + } + + /** Represents a Details. */ + class Details implements IDetails { + + /** + * Constructs a new Details. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IDetails); + + /** Details variablesJson. */ + public variablesJson: { [k: string]: string }; + + /** Details operationName. */ + public operationName: string; + + /** + * Creates a new Details instance using the specified properties. + * @param [properties] Properties to set + * @returns Details instance + */ + public static create(properties?: Trace.IDetails): Trace.Details; + + /** + * Encodes the specified Details message. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Details message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Details; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Details; + + /** + * Verifies a Details message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @param message Details + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Details, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Details to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Error. */ + interface IError { + + /** Error message */ + message?: (string|null); + + /** Error location */ + location?: (Trace.ILocation[]|null); + + /** Error timeNs */ + timeNs?: (number|null); + + /** Error json */ + json?: (string|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IError); + + /** Error message. */ + public message: string; + + /** Error location. */ + public location: Trace.ILocation[]; + + /** Error timeNs. */ + public timeNs: number; + + /** Error json. */ + public json: string; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: Trace.IError): Trace.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Error; + + /** + * Verifies an Error message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HTTP. */ + interface IHTTP { + + /** HTTP method */ + method?: (Trace.HTTP.Method|null); + + /** HTTP requestHeaders */ + requestHeaders?: ({ [k: string]: Trace.HTTP.IValues }|null); + + /** HTTP responseHeaders */ + responseHeaders?: ({ [k: string]: Trace.HTTP.IValues }|null); + + /** HTTP statusCode */ + statusCode?: (number|null); + } + + /** Represents a HTTP. */ + class HTTP implements IHTTP { + + /** + * Constructs a new HTTP. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IHTTP); + + /** HTTP method. */ + public method: Trace.HTTP.Method; + + /** HTTP requestHeaders. */ + public requestHeaders: { [k: string]: Trace.HTTP.IValues }; + + /** HTTP responseHeaders. */ + public responseHeaders: { [k: string]: Trace.HTTP.IValues }; + + /** HTTP statusCode. */ + public statusCode: number; + + /** + * Creates a new HTTP instance using the specified properties. + * @param [properties] Properties to set + * @returns HTTP instance + */ + public static create(properties?: Trace.IHTTP): Trace.HTTP; + + /** + * Encodes the specified HTTP message. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @param message HTTP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IHTTP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HTTP message, length delimited. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @param message HTTP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IHTTP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HTTP message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.HTTP; + + /** + * Decodes a HTTP message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.HTTP; + + /** + * Verifies a HTTP message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a HTTP message. Also converts values to other types if specified. + * @param message HTTP + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.HTTP, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HTTP to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HTTP { + + /** Properties of a Values. */ + interface IValues { + + /** Values value */ + value?: (string[]|null); + } + + /** Represents a Values. */ + class Values implements IValues { + + /** + * Constructs a new Values. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.HTTP.IValues); + + /** Values value. */ + public value: string[]; + + /** + * Creates a new Values instance using the specified properties. + * @param [properties] Properties to set + * @returns Values instance + */ + public static create(properties?: Trace.HTTP.IValues): Trace.HTTP.Values; + + /** + * Encodes the specified Values message. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @param message Values message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.HTTP.IValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Values message, length delimited. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @param message Values message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.HTTP.IValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Values message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.HTTP.Values; + + /** + * Decodes a Values message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.HTTP.Values; + + /** + * Verifies a Values message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Values message. Also converts values to other types if specified. + * @param message Values + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.HTTP.Values, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Values to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Method enum. */ + enum Method { + UNKNOWN = 0, + OPTIONS = 1, + GET = 2, + HEAD = 3, + POST = 4, + PUT = 5, + DELETE = 6, + TRACE = 7, + CONNECT = 8, + PATCH = 9 + } + } + + /** Properties of a Location. */ + interface ILocation { + + /** Location line */ + line?: (number|null); + + /** Location column */ + column?: (number|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.ILocation); + + /** Location line. */ + public line: number; + + /** Location column. */ + public column: number; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: Trace.ILocation): Trace.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Node. */ + interface INode { + + /** Node responseName */ + responseName?: (string|null); + + /** Node index */ + index?: (number|null); + + /** Node originalFieldName */ + originalFieldName?: (string|null); + + /** Node type */ + type?: (string|null); + + /** Node parentType */ + parentType?: (string|null); + + /** Node cachePolicy */ + cachePolicy?: (Trace.ICachePolicy|null); + + /** Node startTime */ + startTime?: (number|null); + + /** Node endTime */ + endTime?: (number|null); + + /** Node error */ + error?: (Trace.IError[]|null); + + /** Node child */ + child?: (Trace.INode[]|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.INode); + + /** Node responseName. */ + public responseName: string; + + /** Node index. */ + public index: number; + + /** Node originalFieldName. */ + public originalFieldName: string; + + /** Node type. */ + public type: string; + + /** Node parentType. */ + public parentType: string; + + /** Node cachePolicy. */ + public cachePolicy?: (Trace.ICachePolicy|null); + + /** Node startTime. */ + public startTime: number; + + /** Node endTime. */ + public endTime: number; + + /** Node error. */ + public error: Trace.IError[]; + + /** Node child. */ + public child: Trace.INode[]; + + /** Node id. */ + public id?: ("responseName"|"index"); + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: Trace.INode): Trace.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QueryPlanNode. */ + interface IQueryPlanNode { + + /** QueryPlanNode sequence */ + sequence?: (Trace.QueryPlanNode.ISequenceNode|null); + + /** QueryPlanNode parallel */ + parallel?: (Trace.QueryPlanNode.IParallelNode|null); + + /** QueryPlanNode fetch */ + fetch?: (Trace.QueryPlanNode.IFetchNode|null); + + /** QueryPlanNode flatten */ + flatten?: (Trace.QueryPlanNode.IFlattenNode|null); + + /** QueryPlanNode defer */ + defer?: (Trace.QueryPlanNode.IDeferNode|null); + + /** QueryPlanNode condition */ + condition?: (Trace.QueryPlanNode.IConditionNode|null); + } + + /** Represents a QueryPlanNode. */ + class QueryPlanNode implements IQueryPlanNode { + + /** + * Constructs a new QueryPlanNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IQueryPlanNode); + + /** QueryPlanNode sequence. */ + public sequence?: (Trace.QueryPlanNode.ISequenceNode|null); + + /** QueryPlanNode parallel. */ + public parallel?: (Trace.QueryPlanNode.IParallelNode|null); + + /** QueryPlanNode fetch. */ + public fetch?: (Trace.QueryPlanNode.IFetchNode|null); + + /** QueryPlanNode flatten. */ + public flatten?: (Trace.QueryPlanNode.IFlattenNode|null); + + /** QueryPlanNode defer. */ + public defer?: (Trace.QueryPlanNode.IDeferNode|null); + + /** QueryPlanNode condition. */ + public condition?: (Trace.QueryPlanNode.IConditionNode|null); + + /** QueryPlanNode node. */ + public node?: ("sequence"|"parallel"|"fetch"|"flatten"|"defer"|"condition"); + + /** + * Creates a new QueryPlanNode instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryPlanNode instance + */ + public static create(properties?: Trace.IQueryPlanNode): Trace.QueryPlanNode; + + /** + * Encodes the specified QueryPlanNode message. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @param message QueryPlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IQueryPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryPlanNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @param message QueryPlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IQueryPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode; + + /** + * Verifies a QueryPlanNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a QueryPlanNode message. Also converts values to other types if specified. + * @param message QueryPlanNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryPlanNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace QueryPlanNode { + + /** Properties of a SequenceNode. */ + interface ISequenceNode { + + /** SequenceNode nodes */ + nodes?: (Trace.IQueryPlanNode[]|null); + } + + /** Represents a SequenceNode. */ + class SequenceNode implements ISequenceNode { + + /** + * Constructs a new SequenceNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.ISequenceNode); + + /** SequenceNode nodes. */ + public nodes: Trace.IQueryPlanNode[]; + + /** + * Creates a new SequenceNode instance using the specified properties. + * @param [properties] Properties to set + * @returns SequenceNode instance + */ + public static create(properties?: Trace.QueryPlanNode.ISequenceNode): Trace.QueryPlanNode.SequenceNode; + + /** + * Encodes the specified SequenceNode message. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @param message SequenceNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.ISequenceNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SequenceNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @param message SequenceNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.ISequenceNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SequenceNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.SequenceNode; + + /** + * Decodes a SequenceNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.SequenceNode; + + /** + * Verifies a SequenceNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a SequenceNode message. Also converts values to other types if specified. + * @param message SequenceNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.SequenceNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SequenceNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ParallelNode. */ + interface IParallelNode { + + /** ParallelNode nodes */ + nodes?: (Trace.IQueryPlanNode[]|null); + } + + /** Represents a ParallelNode. */ + class ParallelNode implements IParallelNode { + + /** + * Constructs a new ParallelNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IParallelNode); + + /** ParallelNode nodes. */ + public nodes: Trace.IQueryPlanNode[]; + + /** + * Creates a new ParallelNode instance using the specified properties. + * @param [properties] Properties to set + * @returns ParallelNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IParallelNode): Trace.QueryPlanNode.ParallelNode; + + /** + * Encodes the specified ParallelNode message. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @param message ParallelNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IParallelNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParallelNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @param message ParallelNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IParallelNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParallelNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.ParallelNode; + + /** + * Decodes a ParallelNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.ParallelNode; + + /** + * Verifies a ParallelNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ParallelNode message. Also converts values to other types if specified. + * @param message ParallelNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.ParallelNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParallelNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FetchNode. */ + interface IFetchNode { + + /** FetchNode serviceName */ + serviceName?: (string|null); + + /** FetchNode traceParsingFailed */ + traceParsingFailed?: (boolean|null); + + /** FetchNode trace */ + trace?: (ITrace|null); + + /** FetchNode sentTimeOffset */ + sentTimeOffset?: (number|null); + + /** FetchNode sentTime */ + sentTime?: (google.protobuf.ITimestamp|null); + + /** FetchNode receivedTime */ + receivedTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a FetchNode. */ + class FetchNode implements IFetchNode { + + /** + * Constructs a new FetchNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IFetchNode); + + /** FetchNode serviceName. */ + public serviceName: string; + + /** FetchNode traceParsingFailed. */ + public traceParsingFailed: boolean; + + /** FetchNode trace. */ + public trace?: (ITrace|null); + + /** FetchNode sentTimeOffset. */ + public sentTimeOffset: number; + + /** FetchNode sentTime. */ + public sentTime?: (google.protobuf.ITimestamp|null); + + /** FetchNode receivedTime. */ + public receivedTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new FetchNode instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IFetchNode): Trace.QueryPlanNode.FetchNode; + + /** + * Encodes the specified FetchNode message. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @param message FetchNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IFetchNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @param message FetchNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IFetchNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.FetchNode; + + /** + * Decodes a FetchNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.FetchNode; + + /** + * Verifies a FetchNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a FetchNode message. Also converts values to other types if specified. + * @param message FetchNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.FetchNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FlattenNode. */ + interface IFlattenNode { + + /** FlattenNode responsePath */ + responsePath?: (Trace.QueryPlanNode.IResponsePathElement[]|null); + + /** FlattenNode node */ + node?: (Trace.IQueryPlanNode|null); + } + + /** Represents a FlattenNode. */ + class FlattenNode implements IFlattenNode { + + /** + * Constructs a new FlattenNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IFlattenNode); + + /** FlattenNode responsePath. */ + public responsePath: Trace.QueryPlanNode.IResponsePathElement[]; + + /** FlattenNode node. */ + public node?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new FlattenNode instance using the specified properties. + * @param [properties] Properties to set + * @returns FlattenNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IFlattenNode): Trace.QueryPlanNode.FlattenNode; + + /** + * Encodes the specified FlattenNode message. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @param message FlattenNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IFlattenNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlattenNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @param message FlattenNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IFlattenNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlattenNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.FlattenNode; + + /** + * Decodes a FlattenNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.FlattenNode; + + /** + * Verifies a FlattenNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a FlattenNode message. Also converts values to other types if specified. + * @param message FlattenNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.FlattenNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlattenNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferNode. */ + interface IDeferNode { + + /** DeferNode primary */ + primary?: (Trace.QueryPlanNode.IDeferNodePrimary|null); + + /** DeferNode deferred */ + deferred?: (Trace.QueryPlanNode.IDeferredNode[]|null); + } + + /** Represents a DeferNode. */ + class DeferNode implements IDeferNode { + + /** + * Constructs a new DeferNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferNode); + + /** DeferNode primary. */ + public primary?: (Trace.QueryPlanNode.IDeferNodePrimary|null); + + /** DeferNode deferred. */ + public deferred: Trace.QueryPlanNode.IDeferredNode[]; + + /** + * Creates a new DeferNode instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferNode): Trace.QueryPlanNode.DeferNode; + + /** + * Encodes the specified DeferNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @param message DeferNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @param message DeferNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferNode; + + /** + * Decodes a DeferNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferNode; + + /** + * Verifies a DeferNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferNode message. Also converts values to other types if specified. + * @param message DeferNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConditionNode. */ + interface IConditionNode { + + /** ConditionNode condition */ + condition?: (string|null); + + /** ConditionNode ifClause */ + ifClause?: (Trace.IQueryPlanNode|null); + + /** ConditionNode elseClause */ + elseClause?: (Trace.IQueryPlanNode|null); + } + + /** Represents a ConditionNode. */ + class ConditionNode implements IConditionNode { + + /** + * Constructs a new ConditionNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IConditionNode); + + /** ConditionNode condition. */ + public condition: string; + + /** ConditionNode ifClause. */ + public ifClause?: (Trace.IQueryPlanNode|null); + + /** ConditionNode elseClause. */ + public elseClause?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new ConditionNode instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IConditionNode): Trace.QueryPlanNode.ConditionNode; + + /** + * Encodes the specified ConditionNode message. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @param message ConditionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IConditionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @param message ConditionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IConditionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.ConditionNode; + + /** + * Decodes a ConditionNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.ConditionNode; + + /** + * Verifies a ConditionNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ConditionNode message. Also converts values to other types if specified. + * @param message ConditionNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.ConditionNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferNodePrimary. */ + interface IDeferNodePrimary { + + /** DeferNodePrimary node */ + node?: (Trace.IQueryPlanNode|null); + } + + /** Represents a DeferNodePrimary. */ + class DeferNodePrimary implements IDeferNodePrimary { + + /** + * Constructs a new DeferNodePrimary. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferNodePrimary); + + /** DeferNodePrimary node. */ + public node?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new DeferNodePrimary instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferNodePrimary instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferNodePrimary): Trace.QueryPlanNode.DeferNodePrimary; + + /** + * Encodes the specified DeferNodePrimary message. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @param message DeferNodePrimary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferNodePrimary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferNodePrimary message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @param message DeferNodePrimary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferNodePrimary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferNodePrimary; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferNodePrimary; + + /** + * Verifies a DeferNodePrimary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferNodePrimary message. Also converts values to other types if specified. + * @param message DeferNodePrimary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferNodePrimary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferNodePrimary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferredNode. */ + interface IDeferredNode { + + /** DeferredNode depends */ + depends?: (Trace.QueryPlanNode.IDeferredNodeDepends[]|null); + + /** DeferredNode label */ + label?: (string|null); + + /** DeferredNode path */ + path?: (Trace.QueryPlanNode.IResponsePathElement[]|null); + + /** DeferredNode node */ + node?: (Trace.IQueryPlanNode|null); + } + + /** Represents a DeferredNode. */ + class DeferredNode implements IDeferredNode { + + /** + * Constructs a new DeferredNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferredNode); + + /** DeferredNode depends. */ + public depends: Trace.QueryPlanNode.IDeferredNodeDepends[]; + + /** DeferredNode label. */ + public label: string; + + /** DeferredNode path. */ + public path: Trace.QueryPlanNode.IResponsePathElement[]; + + /** DeferredNode node. */ + public node?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new DeferredNode instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferredNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferredNode): Trace.QueryPlanNode.DeferredNode; + + /** + * Encodes the specified DeferredNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @param message DeferredNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferredNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferredNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @param message DeferredNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferredNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferredNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferredNode; + + /** + * Decodes a DeferredNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferredNode; + + /** + * Verifies a DeferredNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferredNode message. Also converts values to other types if specified. + * @param message DeferredNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferredNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferredNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferredNodeDepends. */ + interface IDeferredNodeDepends { + + /** DeferredNodeDepends id */ + id?: (string|null); + + /** DeferredNodeDepends deferLabel */ + deferLabel?: (string|null); + } + + /** Represents a DeferredNodeDepends. */ + class DeferredNodeDepends implements IDeferredNodeDepends { + + /** + * Constructs a new DeferredNodeDepends. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferredNodeDepends); + + /** DeferredNodeDepends id. */ + public id: string; + + /** DeferredNodeDepends deferLabel. */ + public deferLabel: string; + + /** + * Creates a new DeferredNodeDepends instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferredNodeDepends instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferredNodeDepends): Trace.QueryPlanNode.DeferredNodeDepends; + + /** + * Encodes the specified DeferredNodeDepends message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @param message DeferredNodeDepends message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferredNodeDepends, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferredNodeDepends message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @param message DeferredNodeDepends message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferredNodeDepends, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferredNodeDepends; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferredNodeDepends; + + /** + * Verifies a DeferredNodeDepends message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferredNodeDepends message. Also converts values to other types if specified. + * @param message DeferredNodeDepends + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferredNodeDepends, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferredNodeDepends to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResponsePathElement. */ + interface IResponsePathElement { + + /** ResponsePathElement fieldName */ + fieldName?: (string|null); + + /** ResponsePathElement index */ + index?: (number|null); + } + + /** Represents a ResponsePathElement. */ + class ResponsePathElement implements IResponsePathElement { + + /** + * Constructs a new ResponsePathElement. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IResponsePathElement); + + /** ResponsePathElement fieldName. */ + public fieldName: string; + + /** ResponsePathElement index. */ + public index: number; + + /** ResponsePathElement id. */ + public id?: ("fieldName"|"index"); + + /** + * Creates a new ResponsePathElement instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponsePathElement instance + */ + public static create(properties?: Trace.QueryPlanNode.IResponsePathElement): Trace.QueryPlanNode.ResponsePathElement; + + /** + * Encodes the specified ResponsePathElement message. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @param message ResponsePathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IResponsePathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponsePathElement message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @param message ResponsePathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IResponsePathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.ResponsePathElement; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.ResponsePathElement; + + /** + * Verifies a ResponsePathElement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ResponsePathElement message. Also converts values to other types if specified. + * @param message ResponsePathElement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.ResponsePathElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponsePathElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} + +/** Properties of a ReportHeader. */ +export interface IReportHeader { + + /** ReportHeader graphRef */ + graphRef?: (string|null); + + /** ReportHeader hostname */ + hostname?: (string|null); + + /** ReportHeader agentVersion */ + agentVersion?: (string|null); + + /** ReportHeader serviceVersion */ + serviceVersion?: (string|null); + + /** ReportHeader runtimeVersion */ + runtimeVersion?: (string|null); + + /** ReportHeader uname */ + uname?: (string|null); + + /** ReportHeader executableSchemaId */ + executableSchemaId?: (string|null); +} + +/** Represents a ReportHeader. */ +export class ReportHeader implements IReportHeader { + + /** + * Constructs a new ReportHeader. + * @param [properties] Properties to set + */ + constructor(properties?: IReportHeader); + + /** ReportHeader graphRef. */ + public graphRef: string; + + /** ReportHeader hostname. */ + public hostname: string; + + /** ReportHeader agentVersion. */ + public agentVersion: string; + + /** ReportHeader serviceVersion. */ + public serviceVersion: string; + + /** ReportHeader runtimeVersion. */ + public runtimeVersion: string; + + /** ReportHeader uname. */ + public uname: string; + + /** ReportHeader executableSchemaId. */ + public executableSchemaId: string; + + /** + * Creates a new ReportHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportHeader instance + */ + public static create(properties?: IReportHeader): ReportHeader; + + /** + * Encodes the specified ReportHeader message. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @param message ReportHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IReportHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportHeader message, length delimited. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @param message ReportHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IReportHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ReportHeader; + + /** + * Decodes a ReportHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ReportHeader; + + /** + * Verifies a ReportHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ReportHeader message. Also converts values to other types if specified. + * @param message ReportHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ReportHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a PathErrorStats. */ +export interface IPathErrorStats { + + /** PathErrorStats children */ + children?: ({ [k: string]: IPathErrorStats }|null); + + /** PathErrorStats errorsCount */ + errorsCount?: (number|null); + + /** PathErrorStats requestsWithErrorsCount */ + requestsWithErrorsCount?: (number|null); +} + +/** Represents a PathErrorStats. */ +export class PathErrorStats implements IPathErrorStats { + + /** + * Constructs a new PathErrorStats. + * @param [properties] Properties to set + */ + constructor(properties?: IPathErrorStats); + + /** PathErrorStats children. */ + public children: { [k: string]: IPathErrorStats }; + + /** PathErrorStats errorsCount. */ + public errorsCount: number; + + /** PathErrorStats requestsWithErrorsCount. */ + public requestsWithErrorsCount: number; + + /** + * Creates a new PathErrorStats instance using the specified properties. + * @param [properties] Properties to set + * @returns PathErrorStats instance + */ + public static create(properties?: IPathErrorStats): PathErrorStats; + + /** + * Encodes the specified PathErrorStats message. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @param message PathErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IPathErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathErrorStats message, length delimited. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @param message PathErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IPathErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): PathErrorStats; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): PathErrorStats; + + /** + * Verifies a PathErrorStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a PathErrorStats message. Also converts values to other types if specified. + * @param message PathErrorStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: PathErrorStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathErrorStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a QueryLatencyStats. */ +export interface IQueryLatencyStats { + + /** QueryLatencyStats latencyCount */ + latencyCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats requestCount */ + requestCount?: (number|null); + + /** QueryLatencyStats cacheHits */ + cacheHits?: (number|null); + + /** QueryLatencyStats persistedQueryHits */ + persistedQueryHits?: (number|null); + + /** QueryLatencyStats persistedQueryMisses */ + persistedQueryMisses?: (number|null); + + /** QueryLatencyStats cacheLatencyCount */ + cacheLatencyCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats rootErrorStats */ + rootErrorStats?: (IPathErrorStats|null); + + /** QueryLatencyStats requestsWithErrorsCount */ + requestsWithErrorsCount?: (number|null); + + /** QueryLatencyStats publicCacheTtlCount */ + publicCacheTtlCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats privateCacheTtlCount */ + privateCacheTtlCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats registeredOperationCount */ + registeredOperationCount?: (number|null); + + /** QueryLatencyStats forbiddenOperationCount */ + forbiddenOperationCount?: (number|null); + + /** QueryLatencyStats requestsWithoutFieldInstrumentation */ + requestsWithoutFieldInstrumentation?: (number|null); +} + +/** Represents a QueryLatencyStats. */ +export class QueryLatencyStats implements IQueryLatencyStats { + + /** + * Constructs a new QueryLatencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: IQueryLatencyStats); + + /** QueryLatencyStats latencyCount. */ + public latencyCount: number[]; + + /** QueryLatencyStats requestCount. */ + public requestCount: number; + + /** QueryLatencyStats cacheHits. */ + public cacheHits: number; + + /** QueryLatencyStats persistedQueryHits. */ + public persistedQueryHits: number; + + /** QueryLatencyStats persistedQueryMisses. */ + public persistedQueryMisses: number; + + /** QueryLatencyStats cacheLatencyCount. */ + public cacheLatencyCount: number[]; + + /** QueryLatencyStats rootErrorStats. */ + public rootErrorStats?: (IPathErrorStats|null); + + /** QueryLatencyStats requestsWithErrorsCount. */ + public requestsWithErrorsCount: number; + + /** QueryLatencyStats publicCacheTtlCount. */ + public publicCacheTtlCount: number[]; + + /** QueryLatencyStats privateCacheTtlCount. */ + public privateCacheTtlCount: number[]; + + /** QueryLatencyStats registeredOperationCount. */ + public registeredOperationCount: number; + + /** QueryLatencyStats forbiddenOperationCount. */ + public forbiddenOperationCount: number; + + /** QueryLatencyStats requestsWithoutFieldInstrumentation. */ + public requestsWithoutFieldInstrumentation: number; + + /** + * Creates a new QueryLatencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryLatencyStats instance + */ + public static create(properties?: IQueryLatencyStats): QueryLatencyStats; + + /** + * Encodes the specified QueryLatencyStats message. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @param message QueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryLatencyStats message, length delimited. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @param message QueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): QueryLatencyStats; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): QueryLatencyStats; + + /** + * Verifies a QueryLatencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a QueryLatencyStats message. Also converts values to other types if specified. + * @param message QueryLatencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: QueryLatencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryLatencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a StatsContext. */ +export interface IStatsContext { + + /** StatsContext clientName */ + clientName?: (string|null); + + /** StatsContext clientVersion */ + clientVersion?: (string|null); +} + +/** Represents a StatsContext. */ +export class StatsContext implements IStatsContext { + + /** + * Constructs a new StatsContext. + * @param [properties] Properties to set + */ + constructor(properties?: IStatsContext); + + /** StatsContext clientName. */ + public clientName: string; + + /** StatsContext clientVersion. */ + public clientVersion: string; + + /** + * Creates a new StatsContext instance using the specified properties. + * @param [properties] Properties to set + * @returns StatsContext instance + */ + public static create(properties?: IStatsContext): StatsContext; + + /** + * Encodes the specified StatsContext message. Does not implicitly {@link StatsContext.verify|verify} messages. + * @param message StatsContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IStatsContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatsContext message, length delimited. Does not implicitly {@link StatsContext.verify|verify} messages. + * @param message StatsContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IStatsContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatsContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): StatsContext; + + /** + * Decodes a StatsContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): StatsContext; + + /** + * Verifies a StatsContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a StatsContext message. Also converts values to other types if specified. + * @param message StatsContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: StatsContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatsContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ContextualizedQueryLatencyStats. */ +export interface IContextualizedQueryLatencyStats { + + /** ContextualizedQueryLatencyStats queryLatencyStats */ + queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedQueryLatencyStats context */ + context?: (IStatsContext|null); +} + +/** Represents a ContextualizedQueryLatencyStats. */ +export class ContextualizedQueryLatencyStats implements IContextualizedQueryLatencyStats { + + /** + * Constructs a new ContextualizedQueryLatencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: IContextualizedQueryLatencyStats); + + /** ContextualizedQueryLatencyStats queryLatencyStats. */ + public queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedQueryLatencyStats context. */ + public context?: (IStatsContext|null); + + /** + * Creates a new ContextualizedQueryLatencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualizedQueryLatencyStats instance + */ + public static create(properties?: IContextualizedQueryLatencyStats): ContextualizedQueryLatencyStats; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @param message ContextualizedQueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IContextualizedQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message, length delimited. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @param message ContextualizedQueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IContextualizedQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ContextualizedQueryLatencyStats; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ContextualizedQueryLatencyStats; + + /** + * Verifies a ContextualizedQueryLatencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ContextualizedQueryLatencyStats message. Also converts values to other types if specified. + * @param message ContextualizedQueryLatencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ContextualizedQueryLatencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextualizedQueryLatencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ContextualizedTypeStats. */ +export interface IContextualizedTypeStats { + + /** ContextualizedTypeStats context */ + context?: (IStatsContext|null); + + /** ContextualizedTypeStats perTypeStat */ + perTypeStat?: ({ [k: string]: ITypeStat }|null); +} + +/** Represents a ContextualizedTypeStats. */ +export class ContextualizedTypeStats implements IContextualizedTypeStats { + + /** + * Constructs a new ContextualizedTypeStats. + * @param [properties] Properties to set + */ + constructor(properties?: IContextualizedTypeStats); + + /** ContextualizedTypeStats context. */ + public context?: (IStatsContext|null); + + /** ContextualizedTypeStats perTypeStat. */ + public perTypeStat: { [k: string]: ITypeStat }; + + /** + * Creates a new ContextualizedTypeStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualizedTypeStats instance + */ + public static create(properties?: IContextualizedTypeStats): ContextualizedTypeStats; + + /** + * Encodes the specified ContextualizedTypeStats message. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @param message ContextualizedTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IContextualizedTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextualizedTypeStats message, length delimited. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @param message ContextualizedTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IContextualizedTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ContextualizedTypeStats; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ContextualizedTypeStats; + + /** + * Verifies a ContextualizedTypeStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ContextualizedTypeStats message. Also converts values to other types if specified. + * @param message ContextualizedTypeStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ContextualizedTypeStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextualizedTypeStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a FieldStat. */ +export interface IFieldStat { + + /** FieldStat returnType */ + returnType?: (string|null); + + /** FieldStat errorsCount */ + errorsCount?: (number|null); + + /** FieldStat observedExecutionCount */ + observedExecutionCount?: (number|null); + + /** FieldStat estimatedExecutionCount */ + estimatedExecutionCount?: (number|null); + + /** FieldStat requestsWithErrorsCount */ + requestsWithErrorsCount?: (number|null); + + /** FieldStat latencyCount */ + latencyCount?: ($protobuf.ToArray|number[]|null); +} + +/** Represents a FieldStat. */ +export class FieldStat implements IFieldStat { + + /** + * Constructs a new FieldStat. + * @param [properties] Properties to set + */ + constructor(properties?: IFieldStat); + + /** FieldStat returnType. */ + public returnType: string; + + /** FieldStat errorsCount. */ + public errorsCount: number; + + /** FieldStat observedExecutionCount. */ + public observedExecutionCount: number; + + /** FieldStat estimatedExecutionCount. */ + public estimatedExecutionCount: number; + + /** FieldStat requestsWithErrorsCount. */ + public requestsWithErrorsCount: number; + + /** FieldStat latencyCount. */ + public latencyCount: number[]; + + /** + * Creates a new FieldStat instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldStat instance + */ + public static create(properties?: IFieldStat): FieldStat; + + /** + * Encodes the specified FieldStat message. Does not implicitly {@link FieldStat.verify|verify} messages. + * @param message FieldStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IFieldStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldStat message, length delimited. Does not implicitly {@link FieldStat.verify|verify} messages. + * @param message FieldStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IFieldStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldStat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): FieldStat; + + /** + * Decodes a FieldStat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): FieldStat; + + /** + * Verifies a FieldStat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a FieldStat message. Also converts values to other types if specified. + * @param message FieldStat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: FieldStat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldStat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a TypeStat. */ +export interface ITypeStat { + + /** TypeStat perFieldStat */ + perFieldStat?: ({ [k: string]: IFieldStat }|null); +} + +/** Represents a TypeStat. */ +export class TypeStat implements ITypeStat { + + /** + * Constructs a new TypeStat. + * @param [properties] Properties to set + */ + constructor(properties?: ITypeStat); + + /** TypeStat perFieldStat. */ + public perFieldStat: { [k: string]: IFieldStat }; + + /** + * Creates a new TypeStat instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeStat instance + */ + public static create(properties?: ITypeStat): TypeStat; + + /** + * Encodes the specified TypeStat message. Does not implicitly {@link TypeStat.verify|verify} messages. + * @param message TypeStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ITypeStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeStat message, length delimited. Does not implicitly {@link TypeStat.verify|verify} messages. + * @param message TypeStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ITypeStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeStat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TypeStat; + + /** + * Decodes a TypeStat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): TypeStat; + + /** + * Verifies a TypeStat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a TypeStat message. Also converts values to other types if specified. + * @param message TypeStat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: TypeStat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeStat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ReferencedFieldsForType. */ +export interface IReferencedFieldsForType { + + /** ReferencedFieldsForType fieldNames */ + fieldNames?: (string[]|null); + + /** ReferencedFieldsForType isInterface */ + isInterface?: (boolean|null); +} + +/** Represents a ReferencedFieldsForType. */ +export class ReferencedFieldsForType implements IReferencedFieldsForType { + + /** + * Constructs a new ReferencedFieldsForType. + * @param [properties] Properties to set + */ + constructor(properties?: IReferencedFieldsForType); + + /** ReferencedFieldsForType fieldNames. */ + public fieldNames: string[]; + + /** ReferencedFieldsForType isInterface. */ + public isInterface: boolean; + + /** + * Creates a new ReferencedFieldsForType instance using the specified properties. + * @param [properties] Properties to set + * @returns ReferencedFieldsForType instance + */ + public static create(properties?: IReferencedFieldsForType): ReferencedFieldsForType; + + /** + * Encodes the specified ReferencedFieldsForType message. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @param message ReferencedFieldsForType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IReferencedFieldsForType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReferencedFieldsForType message, length delimited. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @param message ReferencedFieldsForType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IReferencedFieldsForType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ReferencedFieldsForType; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ReferencedFieldsForType; + + /** + * Verifies a ReferencedFieldsForType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ReferencedFieldsForType message. Also converts values to other types if specified. + * @param message ReferencedFieldsForType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ReferencedFieldsForType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReferencedFieldsForType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a Report. */ +export interface IReport { + + /** Report header */ + header?: (IReportHeader|null); + + /** Report tracesPerQuery */ + tracesPerQuery?: ({ [k: string]: ITracesAndStats }|null); + + /** Report endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Report operationCount */ + operationCount?: (number|null); + + /** Report tracesPreAggregated */ + tracesPreAggregated?: (boolean|null); +} + +/** Represents a Report. */ +export class Report implements IReport { + + /** + * Constructs a new Report. + * @param [properties] Properties to set + */ + constructor(properties?: IReport); + + /** Report header. */ + public header?: (IReportHeader|null); + + /** Report tracesPerQuery. */ + public tracesPerQuery: { [k: string]: ITracesAndStats }; + + /** Report endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Report operationCount. */ + public operationCount: number; + + /** Report tracesPreAggregated. */ + public tracesPreAggregated: boolean; + + /** + * Creates a new Report instance using the specified properties. + * @param [properties] Properties to set + * @returns Report instance + */ + public static create(properties?: IReport): Report; + + /** + * Encodes the specified Report message. Does not implicitly {@link Report.verify|verify} messages. + * @param message Report message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Report message, length delimited. Does not implicitly {@link Report.verify|verify} messages. + * @param message Report message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Report message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Report; + + /** + * Decodes a Report message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Report; + + /** + * Verifies a Report message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Report message. Also converts values to other types if specified. + * @param message Report + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Report, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Report to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ContextualizedStats. */ +export interface IContextualizedStats { + + /** ContextualizedStats context */ + context?: (IStatsContext|null); + + /** ContextualizedStats queryLatencyStats */ + queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedStats perTypeStat */ + perTypeStat?: ({ [k: string]: ITypeStat }|null); +} + +/** Represents a ContextualizedStats. */ +export class ContextualizedStats implements IContextualizedStats { + + /** + * Constructs a new ContextualizedStats. + * @param [properties] Properties to set + */ + constructor(properties?: IContextualizedStats); + + /** ContextualizedStats context. */ + public context?: (IStatsContext|null); + + /** ContextualizedStats queryLatencyStats. */ + public queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedStats perTypeStat. */ + public perTypeStat: { [k: string]: ITypeStat }; + + /** + * Creates a new ContextualizedStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualizedStats instance + */ + public static create(properties?: IContextualizedStats): ContextualizedStats; + + /** + * Encodes the specified ContextualizedStats message. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @param message ContextualizedStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IContextualizedStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextualizedStats message, length delimited. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @param message ContextualizedStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IContextualizedStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ContextualizedStats; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ContextualizedStats; + + /** + * Verifies a ContextualizedStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ContextualizedStats message. Also converts values to other types if specified. + * @param message ContextualizedStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ContextualizedStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextualizedStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a TracesAndStats. */ +export interface ITracesAndStats { + + /** TracesAndStats trace */ + trace?: ((ITrace|Uint8Array)[]|null); + + /** TracesAndStats statsWithContext */ + statsWithContext?: ($protobuf.ToArray|IContextualizedStats[]|null); + + /** TracesAndStats referencedFieldsByType */ + referencedFieldsByType?: ({ [k: string]: IReferencedFieldsForType }|null); + + /** TracesAndStats internalTracesContributingToStats */ + internalTracesContributingToStats?: ((ITrace|Uint8Array)[]|null); +} + +/** Represents a TracesAndStats. */ +export class TracesAndStats implements ITracesAndStats { + + /** + * Constructs a new TracesAndStats. + * @param [properties] Properties to set + */ + constructor(properties?: ITracesAndStats); + + /** TracesAndStats trace. */ + public trace: (ITrace|Uint8Array)[]; + + /** TracesAndStats statsWithContext. */ + public statsWithContext: IContextualizedStats[]; + + /** TracesAndStats referencedFieldsByType. */ + public referencedFieldsByType: { [k: string]: IReferencedFieldsForType }; + + /** TracesAndStats internalTracesContributingToStats. */ + public internalTracesContributingToStats: (ITrace|Uint8Array)[]; + + /** + * Creates a new TracesAndStats instance using the specified properties. + * @param [properties] Properties to set + * @returns TracesAndStats instance + */ + public static create(properties?: ITracesAndStats): TracesAndStats; + + /** + * Encodes the specified TracesAndStats message. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @param message TracesAndStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ITracesAndStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TracesAndStats message, length delimited. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @param message TracesAndStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ITracesAndStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TracesAndStats; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): TracesAndStats; + + /** + * Verifies a TracesAndStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a TracesAndStats message. Also converts values to other types if specified. + * @param message TracesAndStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: TracesAndStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TracesAndStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: number; + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.js b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.js new file mode 100644 index 00000000..0603721c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/cjs/protobuf.js @@ -0,0 +1,8244 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +"use strict"; + +var $protobuf = require("@apollo/protobufjs/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +$root.Trace = (function() { + + /** + * Properties of a Trace. + * @exports ITrace + * @interface ITrace + * @property {google.protobuf.ITimestamp|null} [startTime] Trace startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Trace endTime + * @property {number|null} [durationNs] Trace durationNs + * @property {Trace.INode|null} [root] Trace root + * @property {boolean|null} [isIncomplete] Trace isIncomplete + * @property {string|null} [signature] Trace signature + * @property {string|null} [unexecutedOperationBody] Trace unexecutedOperationBody + * @property {string|null} [unexecutedOperationName] Trace unexecutedOperationName + * @property {Trace.IDetails|null} [details] Trace details + * @property {string|null} [clientName] Trace clientName + * @property {string|null} [clientVersion] Trace clientVersion + * @property {Trace.IHTTP|null} [http] Trace http + * @property {Trace.ICachePolicy|null} [cachePolicy] Trace cachePolicy + * @property {Trace.IQueryPlanNode|null} [queryPlan] Trace queryPlan + * @property {boolean|null} [fullQueryCacheHit] Trace fullQueryCacheHit + * @property {boolean|null} [persistedQueryHit] Trace persistedQueryHit + * @property {boolean|null} [persistedQueryRegister] Trace persistedQueryRegister + * @property {boolean|null} [registeredOperation] Trace registeredOperation + * @property {boolean|null} [forbiddenOperation] Trace forbiddenOperation + * @property {number|null} [fieldExecutionWeight] Trace fieldExecutionWeight + */ + + /** + * Constructs a new Trace. + * @exports Trace + * @classdesc Represents a Trace. + * @implements ITrace + * @constructor + * @param {ITrace=} [properties] Properties to set + */ + function Trace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Trace startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof Trace + * @instance + */ + Trace.prototype.startTime = null; + + /** + * Trace endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof Trace + * @instance + */ + Trace.prototype.endTime = null; + + /** + * Trace durationNs. + * @member {number} durationNs + * @memberof Trace + * @instance + */ + Trace.prototype.durationNs = 0; + + /** + * Trace root. + * @member {Trace.INode|null|undefined} root + * @memberof Trace + * @instance + */ + Trace.prototype.root = null; + + /** + * Trace isIncomplete. + * @member {boolean} isIncomplete + * @memberof Trace + * @instance + */ + Trace.prototype.isIncomplete = false; + + /** + * Trace signature. + * @member {string} signature + * @memberof Trace + * @instance + */ + Trace.prototype.signature = ""; + + /** + * Trace unexecutedOperationBody. + * @member {string} unexecutedOperationBody + * @memberof Trace + * @instance + */ + Trace.prototype.unexecutedOperationBody = ""; + + /** + * Trace unexecutedOperationName. + * @member {string} unexecutedOperationName + * @memberof Trace + * @instance + */ + Trace.prototype.unexecutedOperationName = ""; + + /** + * Trace details. + * @member {Trace.IDetails|null|undefined} details + * @memberof Trace + * @instance + */ + Trace.prototype.details = null; + + /** + * Trace clientName. + * @member {string} clientName + * @memberof Trace + * @instance + */ + Trace.prototype.clientName = ""; + + /** + * Trace clientVersion. + * @member {string} clientVersion + * @memberof Trace + * @instance + */ + Trace.prototype.clientVersion = ""; + + /** + * Trace http. + * @member {Trace.IHTTP|null|undefined} http + * @memberof Trace + * @instance + */ + Trace.prototype.http = null; + + /** + * Trace cachePolicy. + * @member {Trace.ICachePolicy|null|undefined} cachePolicy + * @memberof Trace + * @instance + */ + Trace.prototype.cachePolicy = null; + + /** + * Trace queryPlan. + * @member {Trace.IQueryPlanNode|null|undefined} queryPlan + * @memberof Trace + * @instance + */ + Trace.prototype.queryPlan = null; + + /** + * Trace fullQueryCacheHit. + * @member {boolean} fullQueryCacheHit + * @memberof Trace + * @instance + */ + Trace.prototype.fullQueryCacheHit = false; + + /** + * Trace persistedQueryHit. + * @member {boolean} persistedQueryHit + * @memberof Trace + * @instance + */ + Trace.prototype.persistedQueryHit = false; + + /** + * Trace persistedQueryRegister. + * @member {boolean} persistedQueryRegister + * @memberof Trace + * @instance + */ + Trace.prototype.persistedQueryRegister = false; + + /** + * Trace registeredOperation. + * @member {boolean} registeredOperation + * @memberof Trace + * @instance + */ + Trace.prototype.registeredOperation = false; + + /** + * Trace forbiddenOperation. + * @member {boolean} forbiddenOperation + * @memberof Trace + * @instance + */ + Trace.prototype.forbiddenOperation = false; + + /** + * Trace fieldExecutionWeight. + * @member {number} fieldExecutionWeight + * @memberof Trace + * @instance + */ + Trace.prototype.fieldExecutionWeight = 0; + + /** + * Creates a new Trace instance using the specified properties. + * @function create + * @memberof Trace + * @static + * @param {ITrace=} [properties] Properties to set + * @returns {Trace} Trace instance + */ + Trace.create = function create(properties) { + return new Trace(properties); + }; + + /** + * Encodes the specified Trace message. Does not implicitly {@link Trace.verify|verify} messages. + * @function encode + * @memberof Trace + * @static + * @param {ITrace} message Trace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trace.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.Trace.Details.encode(message.details, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.clientName != null && Object.hasOwnProperty.call(message, "clientName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.clientName); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.clientVersion); + if (message.http != null && Object.hasOwnProperty.call(message, "http")) + $root.Trace.HTTP.encode(message.http, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.durationNs != null && Object.hasOwnProperty.call(message, "durationNs")) + writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.durationNs); + if (message.root != null && Object.hasOwnProperty.call(message, "root")) + $root.Trace.Node.encode(message.root, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.cachePolicy != null && Object.hasOwnProperty.call(message, "cachePolicy")) + $root.Trace.CachePolicy.encode(message.cachePolicy, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.signature); + if (message.fullQueryCacheHit != null && Object.hasOwnProperty.call(message, "fullQueryCacheHit")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.fullQueryCacheHit); + if (message.persistedQueryHit != null && Object.hasOwnProperty.call(message, "persistedQueryHit")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.persistedQueryHit); + if (message.persistedQueryRegister != null && Object.hasOwnProperty.call(message, "persistedQueryRegister")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.persistedQueryRegister); + if (message.registeredOperation != null && Object.hasOwnProperty.call(message, "registeredOperation")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.registeredOperation); + if (message.forbiddenOperation != null && Object.hasOwnProperty.call(message, "forbiddenOperation")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.forbiddenOperation); + if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) + $root.Trace.QueryPlanNode.encode(message.queryPlan, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.unexecutedOperationBody != null && Object.hasOwnProperty.call(message, "unexecutedOperationBody")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.unexecutedOperationBody); + if (message.unexecutedOperationName != null && Object.hasOwnProperty.call(message, "unexecutedOperationName")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.unexecutedOperationName); + if (message.fieldExecutionWeight != null && Object.hasOwnProperty.call(message, "fieldExecutionWeight")) + writer.uint32(/* id 31, wireType 1 =*/249).double(message.fieldExecutionWeight); + if (message.isIncomplete != null && Object.hasOwnProperty.call(message, "isIncomplete")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.isIncomplete); + return writer; + }; + + /** + * Encodes the specified Trace message, length delimited. Does not implicitly {@link Trace.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace + * @static + * @param {ITrace} message Trace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Trace message from the specified reader or buffer. + * @function decode + * @memberof Trace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace} Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.durationNs = reader.uint64(); + break; + case 14: + message.root = $root.Trace.Node.decode(reader, reader.uint32()); + break; + case 33: + message.isIncomplete = reader.bool(); + break; + case 19: + message.signature = reader.string(); + break; + case 27: + message.unexecutedOperationBody = reader.string(); + break; + case 28: + message.unexecutedOperationName = reader.string(); + break; + case 6: + message.details = $root.Trace.Details.decode(reader, reader.uint32()); + break; + case 7: + message.clientName = reader.string(); + break; + case 8: + message.clientVersion = reader.string(); + break; + case 10: + message.http = $root.Trace.HTTP.decode(reader, reader.uint32()); + break; + case 18: + message.cachePolicy = $root.Trace.CachePolicy.decode(reader, reader.uint32()); + break; + case 26: + message.queryPlan = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + case 20: + message.fullQueryCacheHit = reader.bool(); + break; + case 21: + message.persistedQueryHit = reader.bool(); + break; + case 22: + message.persistedQueryRegister = reader.bool(); + break; + case 24: + message.registeredOperation = reader.bool(); + break; + case 25: + message.forbiddenOperation = reader.bool(); + break; + case 31: + message.fieldExecutionWeight = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Trace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace} Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Trace message. + * @function verify + * @memberof Trace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Trace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.durationNs != null && message.hasOwnProperty("durationNs")) + if (!$util.isInteger(message.durationNs) && !(message.durationNs && $util.isInteger(message.durationNs.low) && $util.isInteger(message.durationNs.high))) + return "durationNs: integer|Long expected"; + if (message.root != null && message.hasOwnProperty("root")) { + var error = $root.Trace.Node.verify(message.root); + if (error) + return "root." + error; + } + if (message.isIncomplete != null && message.hasOwnProperty("isIncomplete")) + if (typeof message.isIncomplete !== "boolean") + return "isIncomplete: boolean expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!$util.isString(message.signature)) + return "signature: string expected"; + if (message.unexecutedOperationBody != null && message.hasOwnProperty("unexecutedOperationBody")) + if (!$util.isString(message.unexecutedOperationBody)) + return "unexecutedOperationBody: string expected"; + if (message.unexecutedOperationName != null && message.hasOwnProperty("unexecutedOperationName")) + if (!$util.isString(message.unexecutedOperationName)) + return "unexecutedOperationName: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.Trace.Details.verify(message.details); + if (error) + return "details." + error; + } + if (message.clientName != null && message.hasOwnProperty("clientName")) + if (!$util.isString(message.clientName)) + return "clientName: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: string expected"; + if (message.http != null && message.hasOwnProperty("http")) { + var error = $root.Trace.HTTP.verify(message.http); + if (error) + return "http." + error; + } + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) { + var error = $root.Trace.CachePolicy.verify(message.cachePolicy); + if (error) + return "cachePolicy." + error; + } + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) { + var error = $root.Trace.QueryPlanNode.verify(message.queryPlan); + if (error) + return "queryPlan." + error; + } + if (message.fullQueryCacheHit != null && message.hasOwnProperty("fullQueryCacheHit")) + if (typeof message.fullQueryCacheHit !== "boolean") + return "fullQueryCacheHit: boolean expected"; + if (message.persistedQueryHit != null && message.hasOwnProperty("persistedQueryHit")) + if (typeof message.persistedQueryHit !== "boolean") + return "persistedQueryHit: boolean expected"; + if (message.persistedQueryRegister != null && message.hasOwnProperty("persistedQueryRegister")) + if (typeof message.persistedQueryRegister !== "boolean") + return "persistedQueryRegister: boolean expected"; + if (message.registeredOperation != null && message.hasOwnProperty("registeredOperation")) + if (typeof message.registeredOperation !== "boolean") + return "registeredOperation: boolean expected"; + if (message.forbiddenOperation != null && message.hasOwnProperty("forbiddenOperation")) + if (typeof message.forbiddenOperation !== "boolean") + return "forbiddenOperation: boolean expected"; + if (message.fieldExecutionWeight != null && message.hasOwnProperty("fieldExecutionWeight")) + if (typeof message.fieldExecutionWeight !== "number") + return "fieldExecutionWeight: number expected"; + return null; + }; + + /** + * Creates a plain object from a Trace message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace + * @static + * @param {Trace} message Trace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Trace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endTime = null; + object.startTime = null; + object.details = null; + object.clientName = ""; + object.clientVersion = ""; + object.http = null; + object.durationNs = 0; + object.root = null; + object.cachePolicy = null; + object.signature = ""; + object.fullQueryCacheHit = false; + object.persistedQueryHit = false; + object.persistedQueryRegister = false; + object.registeredOperation = false; + object.forbiddenOperation = false; + object.queryPlan = null; + object.unexecutedOperationBody = ""; + object.unexecutedOperationName = ""; + object.fieldExecutionWeight = 0; + object.isIncomplete = false; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.Trace.Details.toObject(message.details, options); + if (message.clientName != null && message.hasOwnProperty("clientName")) + object.clientName = message.clientName; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + if (message.http != null && message.hasOwnProperty("http")) + object.http = $root.Trace.HTTP.toObject(message.http, options); + if (message.durationNs != null && message.hasOwnProperty("durationNs")) + if (typeof message.durationNs === "number") + object.durationNs = options.longs === String ? String(message.durationNs) : message.durationNs; + else + object.durationNs = options.longs === String ? $util.Long.prototype.toString.call(message.durationNs) : options.longs === Number ? new $util.LongBits(message.durationNs.low >>> 0, message.durationNs.high >>> 0).toNumber(true) : message.durationNs; + if (message.root != null && message.hasOwnProperty("root")) + object.root = $root.Trace.Node.toObject(message.root, options); + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) + object.cachePolicy = $root.Trace.CachePolicy.toObject(message.cachePolicy, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = message.signature; + if (message.fullQueryCacheHit != null && message.hasOwnProperty("fullQueryCacheHit")) + object.fullQueryCacheHit = message.fullQueryCacheHit; + if (message.persistedQueryHit != null && message.hasOwnProperty("persistedQueryHit")) + object.persistedQueryHit = message.persistedQueryHit; + if (message.persistedQueryRegister != null && message.hasOwnProperty("persistedQueryRegister")) + object.persistedQueryRegister = message.persistedQueryRegister; + if (message.registeredOperation != null && message.hasOwnProperty("registeredOperation")) + object.registeredOperation = message.registeredOperation; + if (message.forbiddenOperation != null && message.hasOwnProperty("forbiddenOperation")) + object.forbiddenOperation = message.forbiddenOperation; + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) + object.queryPlan = $root.Trace.QueryPlanNode.toObject(message.queryPlan, options); + if (message.unexecutedOperationBody != null && message.hasOwnProperty("unexecutedOperationBody")) + object.unexecutedOperationBody = message.unexecutedOperationBody; + if (message.unexecutedOperationName != null && message.hasOwnProperty("unexecutedOperationName")) + object.unexecutedOperationName = message.unexecutedOperationName; + if (message.fieldExecutionWeight != null && message.hasOwnProperty("fieldExecutionWeight")) + object.fieldExecutionWeight = options.json && !isFinite(message.fieldExecutionWeight) ? String(message.fieldExecutionWeight) : message.fieldExecutionWeight; + if (message.isIncomplete != null && message.hasOwnProperty("isIncomplete")) + object.isIncomplete = message.isIncomplete; + return object; + }; + + /** + * Converts this Trace to JSON. + * @function toJSON + * @memberof Trace + * @instance + * @returns {Object.} JSON object + */ + Trace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Trace.CachePolicy = (function() { + + /** + * Properties of a CachePolicy. + * @memberof Trace + * @interface ICachePolicy + * @property {Trace.CachePolicy.Scope|null} [scope] CachePolicy scope + * @property {number|null} [maxAgeNs] CachePolicy maxAgeNs + */ + + /** + * Constructs a new CachePolicy. + * @memberof Trace + * @classdesc Represents a CachePolicy. + * @implements ICachePolicy + * @constructor + * @param {Trace.ICachePolicy=} [properties] Properties to set + */ + function CachePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CachePolicy scope. + * @member {Trace.CachePolicy.Scope} scope + * @memberof Trace.CachePolicy + * @instance + */ + CachePolicy.prototype.scope = 0; + + /** + * CachePolicy maxAgeNs. + * @member {number} maxAgeNs + * @memberof Trace.CachePolicy + * @instance + */ + CachePolicy.prototype.maxAgeNs = 0; + + /** + * Creates a new CachePolicy instance using the specified properties. + * @function create + * @memberof Trace.CachePolicy + * @static + * @param {Trace.ICachePolicy=} [properties] Properties to set + * @returns {Trace.CachePolicy} CachePolicy instance + */ + CachePolicy.create = function create(properties) { + return new CachePolicy(properties); + }; + + /** + * Encodes the specified CachePolicy message. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @function encode + * @memberof Trace.CachePolicy + * @static + * @param {Trace.ICachePolicy} message CachePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CachePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.scope); + if (message.maxAgeNs != null && Object.hasOwnProperty.call(message, "maxAgeNs")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxAgeNs); + return writer; + }; + + /** + * Encodes the specified CachePolicy message, length delimited. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.CachePolicy + * @static + * @param {Trace.ICachePolicy} message CachePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CachePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CachePolicy message from the specified reader or buffer. + * @function decode + * @memberof Trace.CachePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.CachePolicy} CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CachePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.CachePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scope = reader.int32(); + break; + case 2: + message.maxAgeNs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CachePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.CachePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.CachePolicy} CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CachePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CachePolicy message. + * @function verify + * @memberof Trace.CachePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CachePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.maxAgeNs != null && message.hasOwnProperty("maxAgeNs")) + if (!$util.isInteger(message.maxAgeNs) && !(message.maxAgeNs && $util.isInteger(message.maxAgeNs.low) && $util.isInteger(message.maxAgeNs.high))) + return "maxAgeNs: integer|Long expected"; + return null; + }; + + /** + * Creates a plain object from a CachePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.CachePolicy + * @static + * @param {Trace.CachePolicy} message CachePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CachePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scope = options.enums === String ? "UNKNOWN" : 0; + object.maxAgeNs = 0; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.Trace.CachePolicy.Scope[message.scope] : message.scope; + if (message.maxAgeNs != null && message.hasOwnProperty("maxAgeNs")) + if (typeof message.maxAgeNs === "number") + object.maxAgeNs = options.longs === String ? String(message.maxAgeNs) : message.maxAgeNs; + else + object.maxAgeNs = options.longs === String ? $util.Long.prototype.toString.call(message.maxAgeNs) : options.longs === Number ? new $util.LongBits(message.maxAgeNs.low >>> 0, message.maxAgeNs.high >>> 0).toNumber() : message.maxAgeNs; + return object; + }; + + /** + * Converts this CachePolicy to JSON. + * @function toJSON + * @memberof Trace.CachePolicy + * @instance + * @returns {Object.} JSON object + */ + CachePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Scope enum. + * @name Trace.CachePolicy.Scope + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PUBLIC=1 PUBLIC value + * @property {number} PRIVATE=2 PRIVATE value + */ + CachePolicy.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PUBLIC"] = 1; + values[valuesById[2] = "PRIVATE"] = 2; + return values; + })(); + + return CachePolicy; + })(); + + Trace.Details = (function() { + + /** + * Properties of a Details. + * @memberof Trace + * @interface IDetails + * @property {Object.|null} [variablesJson] Details variablesJson + * @property {string|null} [operationName] Details operationName + */ + + /** + * Constructs a new Details. + * @memberof Trace + * @classdesc Represents a Details. + * @implements IDetails + * @constructor + * @param {Trace.IDetails=} [properties] Properties to set + */ + function Details(properties) { + this.variablesJson = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Details variablesJson. + * @member {Object.} variablesJson + * @memberof Trace.Details + * @instance + */ + Details.prototype.variablesJson = $util.emptyObject; + + /** + * Details operationName. + * @member {string} operationName + * @memberof Trace.Details + * @instance + */ + Details.prototype.operationName = ""; + + /** + * Creates a new Details instance using the specified properties. + * @function create + * @memberof Trace.Details + * @static + * @param {Trace.IDetails=} [properties] Properties to set + * @returns {Trace.Details} Details instance + */ + Details.create = function create(properties) { + return new Details(properties); + }; + + /** + * Encodes the specified Details message. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @function encode + * @memberof Trace.Details + * @static + * @param {Trace.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationName != null && Object.hasOwnProperty.call(message, "operationName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationName); + if (message.variablesJson != null && Object.hasOwnProperty.call(message, "variablesJson")) + for (var keys = Object.keys(message.variablesJson), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variablesJson[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Details + * @static + * @param {Trace.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Details message from the specified reader or buffer. + * @function decode + * @memberof Trace.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Details(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + reader.skip().pos++; + if (message.variablesJson === $util.emptyObject) + message.variablesJson = {}; + key = reader.string(); + reader.pos++; + message.variablesJson[key] = reader.string(); + break; + case 3: + message.operationName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Details message. + * @function verify + * @memberof Trace.Details + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Details.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.variablesJson != null && message.hasOwnProperty("variablesJson")) { + if (!$util.isObject(message.variablesJson)) + return "variablesJson: object expected"; + var key = Object.keys(message.variablesJson); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.variablesJson[key[i]])) + return "variablesJson: string{k:string} expected"; + } + if (message.operationName != null && message.hasOwnProperty("operationName")) + if (!$util.isString(message.operationName)) + return "operationName: string expected"; + return null; + }; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Details + * @static + * @param {Trace.Details} message Details + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Details.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.variablesJson = {}; + if (options.defaults) + object.operationName = ""; + if (message.operationName != null && message.hasOwnProperty("operationName")) + object.operationName = message.operationName; + var keys2; + if (message.variablesJson && (keys2 = Object.keys(message.variablesJson)).length) { + object.variablesJson = {}; + for (var j = 0; j < keys2.length; ++j) + object.variablesJson[keys2[j]] = message.variablesJson[keys2[j]]; + } + return object; + }; + + /** + * Converts this Details to JSON. + * @function toJSON + * @memberof Trace.Details + * @instance + * @returns {Object.} JSON object + */ + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Details; + })(); + + Trace.Error = (function() { + + /** + * Properties of an Error. + * @memberof Trace + * @interface IError + * @property {string|null} [message] Error message + * @property {Array.|null} [location] Error location + * @property {number|null} [timeNs] Error timeNs + * @property {string|null} [json] Error json + */ + + /** + * Constructs a new Error. + * @memberof Trace + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {Trace.IError=} [properties] Properties to set + */ + function Error(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error message. + * @member {string} message + * @memberof Trace.Error + * @instance + */ + Error.prototype.message = ""; + + /** + * Error location. + * @member {Array.} location + * @memberof Trace.Error + * @instance + */ + Error.prototype.location = $util.emptyArray; + + /** + * Error timeNs. + * @member {number} timeNs + * @memberof Trace.Error + * @instance + */ + Error.prototype.timeNs = 0; + + /** + * Error json. + * @member {string} json + * @memberof Trace.Error + * @instance + */ + Error.prototype.json = ""; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof Trace.Error + * @static + * @param {Trace.IError=} [properties] Properties to set + * @returns {Trace.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @function encode + * @memberof Trace.Error + * @static + * @param {Trace.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.Trace.Location.encode(message.location[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timeNs != null && Object.hasOwnProperty.call(message, "timeNs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeNs); + if (message.json != null && Object.hasOwnProperty.call(message, "json")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.json); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Error + * @static + * @param {Trace.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof Trace.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + case 2: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.Trace.Location.decode(reader, reader.uint32())); + break; + case 3: + message.timeNs = reader.uint64(); + break; + case 4: + message.json = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof Trace.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.Trace.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + if (message.timeNs != null && message.hasOwnProperty("timeNs")) + if (!$util.isInteger(message.timeNs) && !(message.timeNs && $util.isInteger(message.timeNs.low) && $util.isInteger(message.timeNs.high))) + return "timeNs: integer|Long expected"; + if (message.json != null && message.hasOwnProperty("json")) + if (!$util.isString(message.json)) + return "json: string expected"; + return null; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Error + * @static + * @param {Trace.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (options.defaults) { + object.message = ""; + object.timeNs = 0; + object.json = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.Trace.Location.toObject(message.location[j], options); + } + if (message.timeNs != null && message.hasOwnProperty("timeNs")) + if (typeof message.timeNs === "number") + object.timeNs = options.longs === String ? String(message.timeNs) : message.timeNs; + else + object.timeNs = options.longs === String ? $util.Long.prototype.toString.call(message.timeNs) : options.longs === Number ? new $util.LongBits(message.timeNs.low >>> 0, message.timeNs.high >>> 0).toNumber(true) : message.timeNs; + if (message.json != null && message.hasOwnProperty("json")) + object.json = message.json; + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof Trace.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Error; + })(); + + Trace.HTTP = (function() { + + /** + * Properties of a HTTP. + * @memberof Trace + * @interface IHTTP + * @property {Trace.HTTP.Method|null} [method] HTTP method + * @property {Object.|null} [requestHeaders] HTTP requestHeaders + * @property {Object.|null} [responseHeaders] HTTP responseHeaders + * @property {number|null} [statusCode] HTTP statusCode + */ + + /** + * Constructs a new HTTP. + * @memberof Trace + * @classdesc Represents a HTTP. + * @implements IHTTP + * @constructor + * @param {Trace.IHTTP=} [properties] Properties to set + */ + function HTTP(properties) { + this.requestHeaders = {}; + this.responseHeaders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HTTP method. + * @member {Trace.HTTP.Method} method + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.method = 0; + + /** + * HTTP requestHeaders. + * @member {Object.} requestHeaders + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.requestHeaders = $util.emptyObject; + + /** + * HTTP responseHeaders. + * @member {Object.} responseHeaders + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.responseHeaders = $util.emptyObject; + + /** + * HTTP statusCode. + * @member {number} statusCode + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.statusCode = 0; + + /** + * Creates a new HTTP instance using the specified properties. + * @function create + * @memberof Trace.HTTP + * @static + * @param {Trace.IHTTP=} [properties] Properties to set + * @returns {Trace.HTTP} HTTP instance + */ + HTTP.create = function create(properties) { + return new HTTP(properties); + }; + + /** + * Encodes the specified HTTP message. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @function encode + * @memberof Trace.HTTP + * @static + * @param {Trace.IHTTP} message HTTP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTP.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.method); + if (message.requestHeaders != null && Object.hasOwnProperty.call(message, "requestHeaders")) + for (var keys = Object.keys(message.requestHeaders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.Trace.HTTP.Values.encode(message.requestHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.responseHeaders != null && Object.hasOwnProperty.call(message, "responseHeaders")) + for (var keys = Object.keys(message.responseHeaders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.Trace.HTTP.Values.encode(message.responseHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.statusCode != null && Object.hasOwnProperty.call(message, "statusCode")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.statusCode); + return writer; + }; + + /** + * Encodes the specified HTTP message, length delimited. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.HTTP + * @static + * @param {Trace.IHTTP} message HTTP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTP.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HTTP message from the specified reader or buffer. + * @function decode + * @memberof Trace.HTTP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.HTTP} HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTP.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.HTTP(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.method = reader.int32(); + break; + case 4: + reader.skip().pos++; + if (message.requestHeaders === $util.emptyObject) + message.requestHeaders = {}; + key = reader.string(); + reader.pos++; + message.requestHeaders[key] = $root.Trace.HTTP.Values.decode(reader, reader.uint32()); + break; + case 5: + reader.skip().pos++; + if (message.responseHeaders === $util.emptyObject) + message.responseHeaders = {}; + key = reader.string(); + reader.pos++; + message.responseHeaders[key] = $root.Trace.HTTP.Values.decode(reader, reader.uint32()); + break; + case 6: + message.statusCode = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HTTP message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.HTTP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.HTTP} HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTP.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HTTP message. + * @function verify + * @memberof Trace.HTTP + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HTTP.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.method != null && message.hasOwnProperty("method")) + switch (message.method) { + default: + return "method: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.requestHeaders != null && message.hasOwnProperty("requestHeaders")) { + if (!$util.isObject(message.requestHeaders)) + return "requestHeaders: object expected"; + var key = Object.keys(message.requestHeaders); + for (var i = 0; i < key.length; ++i) { + var error = $root.Trace.HTTP.Values.verify(message.requestHeaders[key[i]]); + if (error) + return "requestHeaders." + error; + } + } + if (message.responseHeaders != null && message.hasOwnProperty("responseHeaders")) { + if (!$util.isObject(message.responseHeaders)) + return "responseHeaders: object expected"; + var key = Object.keys(message.responseHeaders); + for (var i = 0; i < key.length; ++i) { + var error = $root.Trace.HTTP.Values.verify(message.responseHeaders[key[i]]); + if (error) + return "responseHeaders." + error; + } + } + if (message.statusCode != null && message.hasOwnProperty("statusCode")) + if (!$util.isInteger(message.statusCode)) + return "statusCode: integer expected"; + return null; + }; + + /** + * Creates a plain object from a HTTP message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.HTTP + * @static + * @param {Trace.HTTP} message HTTP + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HTTP.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.requestHeaders = {}; + object.responseHeaders = {}; + } + if (options.defaults) { + object.method = options.enums === String ? "UNKNOWN" : 0; + object.statusCode = 0; + } + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.Trace.HTTP.Method[message.method] : message.method; + var keys2; + if (message.requestHeaders && (keys2 = Object.keys(message.requestHeaders)).length) { + object.requestHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.requestHeaders[keys2[j]] = $root.Trace.HTTP.Values.toObject(message.requestHeaders[keys2[j]], options); + } + if (message.responseHeaders && (keys2 = Object.keys(message.responseHeaders)).length) { + object.responseHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.responseHeaders[keys2[j]] = $root.Trace.HTTP.Values.toObject(message.responseHeaders[keys2[j]], options); + } + if (message.statusCode != null && message.hasOwnProperty("statusCode")) + object.statusCode = message.statusCode; + return object; + }; + + /** + * Converts this HTTP to JSON. + * @function toJSON + * @memberof Trace.HTTP + * @instance + * @returns {Object.} JSON object + */ + HTTP.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + HTTP.Values = (function() { + + /** + * Properties of a Values. + * @memberof Trace.HTTP + * @interface IValues + * @property {Array.|null} [value] Values value + */ + + /** + * Constructs a new Values. + * @memberof Trace.HTTP + * @classdesc Represents a Values. + * @implements IValues + * @constructor + * @param {Trace.HTTP.IValues=} [properties] Properties to set + */ + function Values(properties) { + this.value = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Values value. + * @member {Array.} value + * @memberof Trace.HTTP.Values + * @instance + */ + Values.prototype.value = $util.emptyArray; + + /** + * Creates a new Values instance using the specified properties. + * @function create + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.IValues=} [properties] Properties to set + * @returns {Trace.HTTP.Values} Values instance + */ + Values.create = function create(properties) { + return new Values(properties); + }; + + /** + * Encodes the specified Values message. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @function encode + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.IValues} message Values message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Values.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value[i]); + return writer; + }; + + /** + * Encodes the specified Values message, length delimited. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.IValues} message Values message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Values.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Values message from the specified reader or buffer. + * @function decode + * @memberof Trace.HTTP.Values + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.HTTP.Values} Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Values.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.HTTP.Values(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Values message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.HTTP.Values + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.HTTP.Values} Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Values.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Values message. + * @function verify + * @memberof Trace.HTTP.Values + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Values.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) + if (!$util.isString(message.value[i])) + return "value: string[] expected"; + } + return null; + }; + + /** + * Creates a plain object from a Values message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.Values} message Values + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Values.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.value = []; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = message.value[j]; + } + return object; + }; + + /** + * Converts this Values to JSON. + * @function toJSON + * @memberof Trace.HTTP.Values + * @instance + * @returns {Object.} JSON object + */ + Values.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Values; + })(); + + /** + * Method enum. + * @name Trace.HTTP.Method + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} OPTIONS=1 OPTIONS value + * @property {number} GET=2 GET value + * @property {number} HEAD=3 HEAD value + * @property {number} POST=4 POST value + * @property {number} PUT=5 PUT value + * @property {number} DELETE=6 DELETE value + * @property {number} TRACE=7 TRACE value + * @property {number} CONNECT=8 CONNECT value + * @property {number} PATCH=9 PATCH value + */ + HTTP.Method = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "OPTIONS"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "HEAD"] = 3; + values[valuesById[4] = "POST"] = 4; + values[valuesById[5] = "PUT"] = 5; + values[valuesById[6] = "DELETE"] = 6; + values[valuesById[7] = "TRACE"] = 7; + values[valuesById[8] = "CONNECT"] = 8; + values[valuesById[9] = "PATCH"] = 9; + return values; + })(); + + return HTTP; + })(); + + Trace.Location = (function() { + + /** + * Properties of a Location. + * @memberof Trace + * @interface ILocation + * @property {number|null} [line] Location line + * @property {number|null} [column] Location column + */ + + /** + * Constructs a new Location. + * @memberof Trace + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {Trace.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location line. + * @member {number} line + * @memberof Trace.Location + * @instance + */ + Location.prototype.line = 0; + + /** + * Location column. + * @member {number} column + * @memberof Trace.Location + * @instance + */ + Location.prototype.column = 0; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof Trace.Location + * @static + * @param {Trace.ILocation=} [properties] Properties to set + * @returns {Trace.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @function encode + * @memberof Trace.Location + * @static + * @param {Trace.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.line != null && Object.hasOwnProperty.call(message, "line")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.line); + if (message.column != null && Object.hasOwnProperty.call(message, "column")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.column); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Location + * @static + * @param {Trace.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof Trace.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.line = reader.uint32(); + break; + case 2: + message.column = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof Trace.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.line != null && message.hasOwnProperty("line")) + if (!$util.isInteger(message.line)) + return "line: integer expected"; + if (message.column != null && message.hasOwnProperty("column")) + if (!$util.isInteger(message.column)) + return "column: integer expected"; + return null; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Location + * @static + * @param {Trace.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.line = 0; + object.column = 0; + } + if (message.line != null && message.hasOwnProperty("line")) + object.line = message.line; + if (message.column != null && message.hasOwnProperty("column")) + object.column = message.column; + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof Trace.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + Trace.Node = (function() { + + /** + * Properties of a Node. + * @memberof Trace + * @interface INode + * @property {string|null} [responseName] Node responseName + * @property {number|null} [index] Node index + * @property {string|null} [originalFieldName] Node originalFieldName + * @property {string|null} [type] Node type + * @property {string|null} [parentType] Node parentType + * @property {Trace.ICachePolicy|null} [cachePolicy] Node cachePolicy + * @property {number|null} [startTime] Node startTime + * @property {number|null} [endTime] Node endTime + * @property {Array.|null} [error] Node error + * @property {Array.|null} [child] Node child + */ + + /** + * Constructs a new Node. + * @memberof Trace + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {Trace.INode=} [properties] Properties to set + */ + function Node(properties) { + this.error = []; + this.child = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node responseName. + * @member {string} responseName + * @memberof Trace.Node + * @instance + */ + Node.prototype.responseName = ""; + + /** + * Node index. + * @member {number} index + * @memberof Trace.Node + * @instance + */ + Node.prototype.index = 0; + + /** + * Node originalFieldName. + * @member {string} originalFieldName + * @memberof Trace.Node + * @instance + */ + Node.prototype.originalFieldName = ""; + + /** + * Node type. + * @member {string} type + * @memberof Trace.Node + * @instance + */ + Node.prototype.type = ""; + + /** + * Node parentType. + * @member {string} parentType + * @memberof Trace.Node + * @instance + */ + Node.prototype.parentType = ""; + + /** + * Node cachePolicy. + * @member {Trace.ICachePolicy|null|undefined} cachePolicy + * @memberof Trace.Node + * @instance + */ + Node.prototype.cachePolicy = null; + + /** + * Node startTime. + * @member {number} startTime + * @memberof Trace.Node + * @instance + */ + Node.prototype.startTime = 0; + + /** + * Node endTime. + * @member {number} endTime + * @memberof Trace.Node + * @instance + */ + Node.prototype.endTime = 0; + + /** + * Node error. + * @member {Array.} error + * @memberof Trace.Node + * @instance + */ + Node.prototype.error = $util.emptyArray; + + /** + * Node child. + * @member {Array.} child + * @memberof Trace.Node + * @instance + */ + Node.prototype.child = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Node id. + * @member {"responseName"|"index"|undefined} id + * @memberof Trace.Node + * @instance + */ + Object.defineProperty(Node.prototype, "id", { + get: $util.oneOfGetter($oneOfFields = ["responseName", "index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof Trace.Node + * @static + * @param {Trace.INode=} [properties] Properties to set + * @returns {Trace.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @function encode + * @memberof Trace.Node + * @static + * @param {Trace.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseName != null && Object.hasOwnProperty.call(message, "responseName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseName); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.cachePolicy != null && Object.hasOwnProperty.call(message, "cachePolicy")) + $root.Trace.CachePolicy.encode(message.cachePolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.startTime); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.endTime); + if (message.error != null && message.error.length) + for (var i = 0; i < message.error.length; ++i) + $root.Trace.Error.encode(message.error[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.child != null && message.child.length) + for (var i = 0; i < message.child.length; ++i) + $root.Trace.Node.encode(message.child[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.parentType); + if (message.originalFieldName != null && Object.hasOwnProperty.call(message, "originalFieldName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.originalFieldName); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Node + * @static + * @param {Trace.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof Trace.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseName = reader.string(); + break; + case 2: + message.index = reader.uint32(); + break; + case 14: + message.originalFieldName = reader.string(); + break; + case 3: + message.type = reader.string(); + break; + case 13: + message.parentType = reader.string(); + break; + case 5: + message.cachePolicy = $root.Trace.CachePolicy.decode(reader, reader.uint32()); + break; + case 8: + message.startTime = reader.uint64(); + break; + case 9: + message.endTime = reader.uint64(); + break; + case 11: + if (!(message.error && message.error.length)) + message.error = []; + message.error.push($root.Trace.Error.decode(reader, reader.uint32())); + break; + case 12: + if (!(message.child && message.child.length)) + message.child = []; + message.child.push($root.Trace.Node.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof Trace.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.responseName != null && message.hasOwnProperty("responseName")) { + properties.id = 1; + if (!$util.isString(message.responseName)) + return "responseName: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + if (properties.id === 1) + return "id: multiple values"; + properties.id = 1; + if (!$util.isInteger(message.index)) + return "index: integer expected"; + } + if (message.originalFieldName != null && message.hasOwnProperty("originalFieldName")) + if (!$util.isString(message.originalFieldName)) + return "originalFieldName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.parentType != null && message.hasOwnProperty("parentType")) + if (!$util.isString(message.parentType)) + return "parentType: string expected"; + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) { + var error = $root.Trace.CachePolicy.verify(message.cachePolicy); + if (error) + return "cachePolicy." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + if (message.error != null && message.hasOwnProperty("error")) { + if (!Array.isArray(message.error)) + return "error: array expected"; + for (var i = 0; i < message.error.length; ++i) { + var error = $root.Trace.Error.verify(message.error[i]); + if (error) + return "error." + error; + } + } + if (message.child != null && message.hasOwnProperty("child")) { + if (!Array.isArray(message.child)) + return "child: array expected"; + for (var i = 0; i < message.child.length; ++i) { + var error = $root.Trace.Node.verify(message.child[i]); + if (error) + return "child." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Node + * @static + * @param {Trace.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.error = []; + object.child = []; + } + if (options.defaults) { + object.type = ""; + object.cachePolicy = null; + object.startTime = 0; + object.endTime = 0; + object.parentType = ""; + object.originalFieldName = ""; + } + if (message.responseName != null && message.hasOwnProperty("responseName")) { + object.responseName = message.responseName; + if (options.oneofs) + object.id = "responseName"; + } + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object.id = "index"; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) + object.cachePolicy = $root.Trace.CachePolicy.toObject(message.cachePolicy, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime; + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber(true) : message.endTime; + if (message.error && message.error.length) { + object.error = []; + for (var j = 0; j < message.error.length; ++j) + object.error[j] = $root.Trace.Error.toObject(message.error[j], options); + } + if (message.child && message.child.length) { + object.child = []; + for (var j = 0; j < message.child.length; ++j) + object.child[j] = $root.Trace.Node.toObject(message.child[j], options); + } + if (message.parentType != null && message.hasOwnProperty("parentType")) + object.parentType = message.parentType; + if (message.originalFieldName != null && message.hasOwnProperty("originalFieldName")) + object.originalFieldName = message.originalFieldName; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof Trace.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Node; + })(); + + Trace.QueryPlanNode = (function() { + + /** + * Properties of a QueryPlanNode. + * @memberof Trace + * @interface IQueryPlanNode + * @property {Trace.QueryPlanNode.ISequenceNode|null} [sequence] QueryPlanNode sequence + * @property {Trace.QueryPlanNode.IParallelNode|null} [parallel] QueryPlanNode parallel + * @property {Trace.QueryPlanNode.IFetchNode|null} [fetch] QueryPlanNode fetch + * @property {Trace.QueryPlanNode.IFlattenNode|null} [flatten] QueryPlanNode flatten + * @property {Trace.QueryPlanNode.IDeferNode|null} [defer] QueryPlanNode defer + * @property {Trace.QueryPlanNode.IConditionNode|null} [condition] QueryPlanNode condition + */ + + /** + * Constructs a new QueryPlanNode. + * @memberof Trace + * @classdesc Represents a QueryPlanNode. + * @implements IQueryPlanNode + * @constructor + * @param {Trace.IQueryPlanNode=} [properties] Properties to set + */ + function QueryPlanNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPlanNode sequence. + * @member {Trace.QueryPlanNode.ISequenceNode|null|undefined} sequence + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.sequence = null; + + /** + * QueryPlanNode parallel. + * @member {Trace.QueryPlanNode.IParallelNode|null|undefined} parallel + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.parallel = null; + + /** + * QueryPlanNode fetch. + * @member {Trace.QueryPlanNode.IFetchNode|null|undefined} fetch + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.fetch = null; + + /** + * QueryPlanNode flatten. + * @member {Trace.QueryPlanNode.IFlattenNode|null|undefined} flatten + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.flatten = null; + + /** + * QueryPlanNode defer. + * @member {Trace.QueryPlanNode.IDeferNode|null|undefined} defer + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.defer = null; + + /** + * QueryPlanNode condition. + * @member {Trace.QueryPlanNode.IConditionNode|null|undefined} condition + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.condition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryPlanNode node. + * @member {"sequence"|"parallel"|"fetch"|"flatten"|"defer"|"condition"|undefined} node + * @memberof Trace.QueryPlanNode + * @instance + */ + Object.defineProperty(QueryPlanNode.prototype, "node", { + get: $util.oneOfGetter($oneOfFields = ["sequence", "parallel", "fetch", "flatten", "defer", "condition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryPlanNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.IQueryPlanNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode} QueryPlanNode instance + */ + QueryPlanNode.create = function create(properties) { + return new QueryPlanNode(properties); + }; + + /** + * Encodes the specified QueryPlanNode message. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.IQueryPlanNode} message QueryPlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlanNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + $root.Trace.QueryPlanNode.SequenceNode.encode(message.sequence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) + $root.Trace.QueryPlanNode.ParallelNode.encode(message.parallel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fetch != null && Object.hasOwnProperty.call(message, "fetch")) + $root.Trace.QueryPlanNode.FetchNode.encode(message.fetch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.flatten != null && Object.hasOwnProperty.call(message, "flatten")) + $root.Trace.QueryPlanNode.FlattenNode.encode(message.flatten, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.defer != null && Object.hasOwnProperty.call(message, "defer")) + $root.Trace.QueryPlanNode.DeferNode.encode(message.defer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.Trace.QueryPlanNode.ConditionNode.encode(message.condition, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPlanNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.IQueryPlanNode} message QueryPlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlanNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode} QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlanNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = $root.Trace.QueryPlanNode.SequenceNode.decode(reader, reader.uint32()); + break; + case 2: + message.parallel = $root.Trace.QueryPlanNode.ParallelNode.decode(reader, reader.uint32()); + break; + case 3: + message.fetch = $root.Trace.QueryPlanNode.FetchNode.decode(reader, reader.uint32()); + break; + case 4: + message.flatten = $root.Trace.QueryPlanNode.FlattenNode.decode(reader, reader.uint32()); + break; + case 5: + message.defer = $root.Trace.QueryPlanNode.DeferNode.decode(reader, reader.uint32()); + break; + case 6: + message.condition = $root.Trace.QueryPlanNode.ConditionNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode} QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlanNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPlanNode message. + * @function verify + * @memberof Trace.QueryPlanNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPlanNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sequence != null && message.hasOwnProperty("sequence")) { + properties.node = 1; + { + var error = $root.Trace.QueryPlanNode.SequenceNode.verify(message.sequence); + if (error) + return "sequence." + error; + } + } + if (message.parallel != null && message.hasOwnProperty("parallel")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.Trace.QueryPlanNode.ParallelNode.verify(message.parallel); + if (error) + return "parallel." + error; + } + } + if (message.fetch != null && message.hasOwnProperty("fetch")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.Trace.QueryPlanNode.FetchNode.verify(message.fetch); + if (error) + return "fetch." + error; + } + } + if (message.flatten != null && message.hasOwnProperty("flatten")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.Trace.QueryPlanNode.FlattenNode.verify(message.flatten); + if (error) + return "flatten." + error; + } + } + if (message.defer != null && message.hasOwnProperty("defer")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.Trace.QueryPlanNode.DeferNode.verify(message.defer); + if (error) + return "defer." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.Trace.QueryPlanNode.ConditionNode.verify(message.condition); + if (error) + return "condition." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a QueryPlanNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.QueryPlanNode} message QueryPlanNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPlanNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sequence != null && message.hasOwnProperty("sequence")) { + object.sequence = $root.Trace.QueryPlanNode.SequenceNode.toObject(message.sequence, options); + if (options.oneofs) + object.node = "sequence"; + } + if (message.parallel != null && message.hasOwnProperty("parallel")) { + object.parallel = $root.Trace.QueryPlanNode.ParallelNode.toObject(message.parallel, options); + if (options.oneofs) + object.node = "parallel"; + } + if (message.fetch != null && message.hasOwnProperty("fetch")) { + object.fetch = $root.Trace.QueryPlanNode.FetchNode.toObject(message.fetch, options); + if (options.oneofs) + object.node = "fetch"; + } + if (message.flatten != null && message.hasOwnProperty("flatten")) { + object.flatten = $root.Trace.QueryPlanNode.FlattenNode.toObject(message.flatten, options); + if (options.oneofs) + object.node = "flatten"; + } + if (message.defer != null && message.hasOwnProperty("defer")) { + object.defer = $root.Trace.QueryPlanNode.DeferNode.toObject(message.defer, options); + if (options.oneofs) + object.node = "defer"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + object.condition = $root.Trace.QueryPlanNode.ConditionNode.toObject(message.condition, options); + if (options.oneofs) + object.node = "condition"; + } + return object; + }; + + /** + * Converts this QueryPlanNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode + * @instance + * @returns {Object.} JSON object + */ + QueryPlanNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + QueryPlanNode.SequenceNode = (function() { + + /** + * Properties of a SequenceNode. + * @memberof Trace.QueryPlanNode + * @interface ISequenceNode + * @property {Array.|null} [nodes] SequenceNode nodes + */ + + /** + * Constructs a new SequenceNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a SequenceNode. + * @implements ISequenceNode + * @constructor + * @param {Trace.QueryPlanNode.ISequenceNode=} [properties] Properties to set + */ + function SequenceNode(properties) { + this.nodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SequenceNode nodes. + * @member {Array.} nodes + * @memberof Trace.QueryPlanNode.SequenceNode + * @instance + */ + SequenceNode.prototype.nodes = $util.emptyArray; + + /** + * Creates a new SequenceNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.ISequenceNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode instance + */ + SequenceNode.create = function create(properties) { + return new SequenceNode(properties); + }; + + /** + * Encodes the specified SequenceNode message. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.ISequenceNode} message SequenceNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequenceNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.Trace.QueryPlanNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SequenceNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.ISequenceNode} message SequenceNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequenceNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SequenceNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequenceNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.SequenceNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.Trace.QueryPlanNode.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SequenceNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequenceNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SequenceNode message. + * @function verify + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SequenceNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.Trace.QueryPlanNode.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a SequenceNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.SequenceNode} message SequenceNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SequenceNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.Trace.QueryPlanNode.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this SequenceNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.SequenceNode + * @instance + * @returns {Object.} JSON object + */ + SequenceNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SequenceNode; + })(); + + QueryPlanNode.ParallelNode = (function() { + + /** + * Properties of a ParallelNode. + * @memberof Trace.QueryPlanNode + * @interface IParallelNode + * @property {Array.|null} [nodes] ParallelNode nodes + */ + + /** + * Constructs a new ParallelNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a ParallelNode. + * @implements IParallelNode + * @constructor + * @param {Trace.QueryPlanNode.IParallelNode=} [properties] Properties to set + */ + function ParallelNode(properties) { + this.nodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParallelNode nodes. + * @member {Array.} nodes + * @memberof Trace.QueryPlanNode.ParallelNode + * @instance + */ + ParallelNode.prototype.nodes = $util.emptyArray; + + /** + * Creates a new ParallelNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.IParallelNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode instance + */ + ParallelNode.create = function create(properties) { + return new ParallelNode(properties); + }; + + /** + * Encodes the specified ParallelNode message. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.IParallelNode} message ParallelNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParallelNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.Trace.QueryPlanNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParallelNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.IParallelNode} message ParallelNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParallelNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParallelNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParallelNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ParallelNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.Trace.QueryPlanNode.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParallelNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParallelNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParallelNode message. + * @function verify + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParallelNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.Trace.QueryPlanNode.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a ParallelNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.ParallelNode} message ParallelNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParallelNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.Trace.QueryPlanNode.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this ParallelNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.ParallelNode + * @instance + * @returns {Object.} JSON object + */ + ParallelNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ParallelNode; + })(); + + QueryPlanNode.FetchNode = (function() { + + /** + * Properties of a FetchNode. + * @memberof Trace.QueryPlanNode + * @interface IFetchNode + * @property {string|null} [serviceName] FetchNode serviceName + * @property {boolean|null} [traceParsingFailed] FetchNode traceParsingFailed + * @property {ITrace|null} [trace] FetchNode trace + * @property {number|null} [sentTimeOffset] FetchNode sentTimeOffset + * @property {google.protobuf.ITimestamp|null} [sentTime] FetchNode sentTime + * @property {google.protobuf.ITimestamp|null} [receivedTime] FetchNode receivedTime + */ + + /** + * Constructs a new FetchNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a FetchNode. + * @implements IFetchNode + * @constructor + * @param {Trace.QueryPlanNode.IFetchNode=} [properties] Properties to set + */ + function FetchNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchNode serviceName. + * @member {string} serviceName + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.serviceName = ""; + + /** + * FetchNode traceParsingFailed. + * @member {boolean} traceParsingFailed + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.traceParsingFailed = false; + + /** + * FetchNode trace. + * @member {ITrace|null|undefined} trace + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.trace = null; + + /** + * FetchNode sentTimeOffset. + * @member {number} sentTimeOffset + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.sentTimeOffset = 0; + + /** + * FetchNode sentTime. + * @member {google.protobuf.ITimestamp|null|undefined} sentTime + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.sentTime = null; + + /** + * FetchNode receivedTime. + * @member {google.protobuf.ITimestamp|null|undefined} receivedTime + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.receivedTime = null; + + /** + * Creates a new FetchNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.IFetchNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.FetchNode} FetchNode instance + */ + FetchNode.create = function create(properties) { + return new FetchNode(properties); + }; + + /** + * Encodes the specified FetchNode message. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.IFetchNode} message FetchNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.traceParsingFailed != null && Object.hasOwnProperty.call(message, "traceParsingFailed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.traceParsingFailed); + if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) + $root.Trace.encode(message.trace, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sentTimeOffset != null && Object.hasOwnProperty.call(message, "sentTimeOffset")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sentTimeOffset); + if (message.sentTime != null && Object.hasOwnProperty.call(message, "sentTime")) + $root.google.protobuf.Timestamp.encode(message.sentTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.receivedTime != null && Object.hasOwnProperty.call(message, "receivedTime")) + $root.google.protobuf.Timestamp.encode(message.receivedTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.IFetchNode} message FetchNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.FetchNode} FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.FetchNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceName = reader.string(); + break; + case 2: + message.traceParsingFailed = reader.bool(); + break; + case 3: + message.trace = $root.Trace.decode(reader, reader.uint32()); + break; + case 4: + message.sentTimeOffset = reader.uint64(); + break; + case 5: + message.sentTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.receivedTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.FetchNode} FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchNode message. + * @function verify + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.traceParsingFailed != null && message.hasOwnProperty("traceParsingFailed")) + if (typeof message.traceParsingFailed !== "boolean") + return "traceParsingFailed: boolean expected"; + if (message.trace != null && message.hasOwnProperty("trace")) { + var error = $root.Trace.verify(message.trace); + if (error) + return "trace." + error; + } + if (message.sentTimeOffset != null && message.hasOwnProperty("sentTimeOffset")) + if (!$util.isInteger(message.sentTimeOffset) && !(message.sentTimeOffset && $util.isInteger(message.sentTimeOffset.low) && $util.isInteger(message.sentTimeOffset.high))) + return "sentTimeOffset: integer|Long expected"; + if (message.sentTime != null && message.hasOwnProperty("sentTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.sentTime); + if (error) + return "sentTime." + error; + } + if (message.receivedTime != null && message.hasOwnProperty("receivedTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.receivedTime); + if (error) + return "receivedTime." + error; + } + return null; + }; + + /** + * Creates a plain object from a FetchNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.FetchNode} message FetchNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.traceParsingFailed = false; + object.trace = null; + object.sentTimeOffset = 0; + object.sentTime = null; + object.receivedTime = null; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.traceParsingFailed != null && message.hasOwnProperty("traceParsingFailed")) + object.traceParsingFailed = message.traceParsingFailed; + if (message.trace != null && message.hasOwnProperty("trace")) + object.trace = $root.Trace.toObject(message.trace, options); + if (message.sentTimeOffset != null && message.hasOwnProperty("sentTimeOffset")) + if (typeof message.sentTimeOffset === "number") + object.sentTimeOffset = options.longs === String ? String(message.sentTimeOffset) : message.sentTimeOffset; + else + object.sentTimeOffset = options.longs === String ? $util.Long.prototype.toString.call(message.sentTimeOffset) : options.longs === Number ? new $util.LongBits(message.sentTimeOffset.low >>> 0, message.sentTimeOffset.high >>> 0).toNumber(true) : message.sentTimeOffset; + if (message.sentTime != null && message.hasOwnProperty("sentTime")) + object.sentTime = $root.google.protobuf.Timestamp.toObject(message.sentTime, options); + if (message.receivedTime != null && message.hasOwnProperty("receivedTime")) + object.receivedTime = $root.google.protobuf.Timestamp.toObject(message.receivedTime, options); + return object; + }; + + /** + * Converts this FetchNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + * @returns {Object.} JSON object + */ + FetchNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FetchNode; + })(); + + QueryPlanNode.FlattenNode = (function() { + + /** + * Properties of a FlattenNode. + * @memberof Trace.QueryPlanNode + * @interface IFlattenNode + * @property {Array.|null} [responsePath] FlattenNode responsePath + * @property {Trace.IQueryPlanNode|null} [node] FlattenNode node + */ + + /** + * Constructs a new FlattenNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a FlattenNode. + * @implements IFlattenNode + * @constructor + * @param {Trace.QueryPlanNode.IFlattenNode=} [properties] Properties to set + */ + function FlattenNode(properties) { + this.responsePath = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlattenNode responsePath. + * @member {Array.} responsePath + * @memberof Trace.QueryPlanNode.FlattenNode + * @instance + */ + FlattenNode.prototype.responsePath = $util.emptyArray; + + /** + * FlattenNode node. + * @member {Trace.IQueryPlanNode|null|undefined} node + * @memberof Trace.QueryPlanNode.FlattenNode + * @instance + */ + FlattenNode.prototype.node = null; + + /** + * Creates a new FlattenNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.IFlattenNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode instance + */ + FlattenNode.create = function create(properties) { + return new FlattenNode(properties); + }; + + /** + * Encodes the specified FlattenNode message. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.IFlattenNode} message FlattenNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlattenNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responsePath != null && message.responsePath.length) + for (var i = 0; i < message.responsePath.length; ++i) + $root.Trace.QueryPlanNode.ResponsePathElement.encode(message.responsePath[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.Trace.QueryPlanNode.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FlattenNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.IFlattenNode} message FlattenNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlattenNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlattenNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlattenNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.FlattenNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responsePath && message.responsePath.length)) + message.responsePath = []; + message.responsePath.push($root.Trace.QueryPlanNode.ResponsePathElement.decode(reader, reader.uint32())); + break; + case 2: + message.node = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FlattenNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlattenNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlattenNode message. + * @function verify + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlattenNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responsePath != null && message.hasOwnProperty("responsePath")) { + if (!Array.isArray(message.responsePath)) + return "responsePath: array expected"; + for (var i = 0; i < message.responsePath.length; ++i) { + var error = $root.Trace.QueryPlanNode.ResponsePathElement.verify(message.responsePath[i]); + if (error) + return "responsePath." + error; + } + } + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.Trace.QueryPlanNode.verify(message.node); + if (error) + return "node." + error; + } + return null; + }; + + /** + * Creates a plain object from a FlattenNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.FlattenNode} message FlattenNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlattenNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responsePath = []; + if (options.defaults) + object.node = null; + if (message.responsePath && message.responsePath.length) { + object.responsePath = []; + for (var j = 0; j < message.responsePath.length; ++j) + object.responsePath[j] = $root.Trace.QueryPlanNode.ResponsePathElement.toObject(message.responsePath[j], options); + } + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.Trace.QueryPlanNode.toObject(message.node, options); + return object; + }; + + /** + * Converts this FlattenNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.FlattenNode + * @instance + * @returns {Object.} JSON object + */ + FlattenNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FlattenNode; + })(); + + QueryPlanNode.DeferNode = (function() { + + /** + * Properties of a DeferNode. + * @memberof Trace.QueryPlanNode + * @interface IDeferNode + * @property {Trace.QueryPlanNode.IDeferNodePrimary|null} [primary] DeferNode primary + * @property {Array.|null} [deferred] DeferNode deferred + */ + + /** + * Constructs a new DeferNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferNode. + * @implements IDeferNode + * @constructor + * @param {Trace.QueryPlanNode.IDeferNode=} [properties] Properties to set + */ + function DeferNode(properties) { + this.deferred = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferNode primary. + * @member {Trace.QueryPlanNode.IDeferNodePrimary|null|undefined} primary + * @memberof Trace.QueryPlanNode.DeferNode + * @instance + */ + DeferNode.prototype.primary = null; + + /** + * DeferNode deferred. + * @member {Array.} deferred + * @memberof Trace.QueryPlanNode.DeferNode + * @instance + */ + DeferNode.prototype.deferred = $util.emptyArray; + + /** + * Creates a new DeferNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.IDeferNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferNode} DeferNode instance + */ + DeferNode.create = function create(properties) { + return new DeferNode(properties); + }; + + /** + * Encodes the specified DeferNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.IDeferNode} message DeferNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primary != null && Object.hasOwnProperty.call(message, "primary")) + $root.Trace.QueryPlanNode.DeferNodePrimary.encode(message.primary, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deferred != null && message.deferred.length) + for (var i = 0; i < message.deferred.length; ++i) + $root.Trace.QueryPlanNode.DeferredNode.encode(message.deferred[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeferNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.IDeferNode} message DeferNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferNode} DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primary = $root.Trace.QueryPlanNode.DeferNodePrimary.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.deferred && message.deferred.length)) + message.deferred = []; + message.deferred.push($root.Trace.QueryPlanNode.DeferredNode.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferNode} DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferNode message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primary != null && message.hasOwnProperty("primary")) { + var error = $root.Trace.QueryPlanNode.DeferNodePrimary.verify(message.primary); + if (error) + return "primary." + error; + } + if (message.deferred != null && message.hasOwnProperty("deferred")) { + if (!Array.isArray(message.deferred)) + return "deferred: array expected"; + for (var i = 0; i < message.deferred.length; ++i) { + var error = $root.Trace.QueryPlanNode.DeferredNode.verify(message.deferred[i]); + if (error) + return "deferred." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a DeferNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.DeferNode} message DeferNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deferred = []; + if (options.defaults) + object.primary = null; + if (message.primary != null && message.hasOwnProperty("primary")) + object.primary = $root.Trace.QueryPlanNode.DeferNodePrimary.toObject(message.primary, options); + if (message.deferred && message.deferred.length) { + object.deferred = []; + for (var j = 0; j < message.deferred.length; ++j) + object.deferred[j] = $root.Trace.QueryPlanNode.DeferredNode.toObject(message.deferred[j], options); + } + return object; + }; + + /** + * Converts this DeferNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferNode + * @instance + * @returns {Object.} JSON object + */ + DeferNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferNode; + })(); + + QueryPlanNode.ConditionNode = (function() { + + /** + * Properties of a ConditionNode. + * @memberof Trace.QueryPlanNode + * @interface IConditionNode + * @property {string|null} [condition] ConditionNode condition + * @property {Trace.IQueryPlanNode|null} [ifClause] ConditionNode ifClause + * @property {Trace.IQueryPlanNode|null} [elseClause] ConditionNode elseClause + */ + + /** + * Constructs a new ConditionNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a ConditionNode. + * @implements IConditionNode + * @constructor + * @param {Trace.QueryPlanNode.IConditionNode=} [properties] Properties to set + */ + function ConditionNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionNode condition. + * @member {string} condition + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + */ + ConditionNode.prototype.condition = ""; + + /** + * ConditionNode ifClause. + * @member {Trace.IQueryPlanNode|null|undefined} ifClause + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + */ + ConditionNode.prototype.ifClause = null; + + /** + * ConditionNode elseClause. + * @member {Trace.IQueryPlanNode|null|undefined} elseClause + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + */ + ConditionNode.prototype.elseClause = null; + + /** + * Creates a new ConditionNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.IConditionNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.ConditionNode} ConditionNode instance + */ + ConditionNode.create = function create(properties) { + return new ConditionNode(properties); + }; + + /** + * Encodes the specified ConditionNode message. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.IConditionNode} message ConditionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.ifClause != null && Object.hasOwnProperty.call(message, "ifClause")) + $root.Trace.QueryPlanNode.encode(message.ifClause, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.elseClause != null && Object.hasOwnProperty.call(message, "elseClause")) + $root.Trace.QueryPlanNode.encode(message.elseClause, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.IConditionNode} message ConditionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.ConditionNode} ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ConditionNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = reader.string(); + break; + case 2: + message.ifClause = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + case 3: + message.elseClause = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.ConditionNode} ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionNode message. + * @function verify + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.ifClause != null && message.hasOwnProperty("ifClause")) { + var error = $root.Trace.QueryPlanNode.verify(message.ifClause); + if (error) + return "ifClause." + error; + } + if (message.elseClause != null && message.hasOwnProperty("elseClause")) { + var error = $root.Trace.QueryPlanNode.verify(message.elseClause); + if (error) + return "elseClause." + error; + } + return null; + }; + + /** + * Creates a plain object from a ConditionNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.ConditionNode} message ConditionNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.ifClause = null; + object.elseClause = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.ifClause != null && message.hasOwnProperty("ifClause")) + object.ifClause = $root.Trace.QueryPlanNode.toObject(message.ifClause, options); + if (message.elseClause != null && message.hasOwnProperty("elseClause")) + object.elseClause = $root.Trace.QueryPlanNode.toObject(message.elseClause, options); + return object; + }; + + /** + * Converts this ConditionNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + * @returns {Object.} JSON object + */ + ConditionNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConditionNode; + })(); + + QueryPlanNode.DeferNodePrimary = (function() { + + /** + * Properties of a DeferNodePrimary. + * @memberof Trace.QueryPlanNode + * @interface IDeferNodePrimary + * @property {Trace.IQueryPlanNode|null} [node] DeferNodePrimary node + */ + + /** + * Constructs a new DeferNodePrimary. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferNodePrimary. + * @implements IDeferNodePrimary + * @constructor + * @param {Trace.QueryPlanNode.IDeferNodePrimary=} [properties] Properties to set + */ + function DeferNodePrimary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferNodePrimary node. + * @member {Trace.IQueryPlanNode|null|undefined} node + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @instance + */ + DeferNodePrimary.prototype.node = null; + + /** + * Creates a new DeferNodePrimary instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.IDeferNodePrimary=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferNodePrimary} DeferNodePrimary instance + */ + DeferNodePrimary.create = function create(properties) { + return new DeferNodePrimary(properties); + }; + + /** + * Encodes the specified DeferNodePrimary message. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.IDeferNodePrimary} message DeferNodePrimary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNodePrimary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.Trace.QueryPlanNode.encode(message.node, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeferNodePrimary message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.IDeferNodePrimary} message DeferNodePrimary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNodePrimary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferNodePrimary} DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNodePrimary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferNodePrimary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.node = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferNodePrimary} DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNodePrimary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferNodePrimary message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferNodePrimary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.Trace.QueryPlanNode.verify(message.node); + if (error) + return "node." + error; + } + return null; + }; + + /** + * Creates a plain object from a DeferNodePrimary message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.DeferNodePrimary} message DeferNodePrimary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferNodePrimary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.node = null; + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.Trace.QueryPlanNode.toObject(message.node, options); + return object; + }; + + /** + * Converts this DeferNodePrimary to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @instance + * @returns {Object.} JSON object + */ + DeferNodePrimary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferNodePrimary; + })(); + + QueryPlanNode.DeferredNode = (function() { + + /** + * Properties of a DeferredNode. + * @memberof Trace.QueryPlanNode + * @interface IDeferredNode + * @property {Array.|null} [depends] DeferredNode depends + * @property {string|null} [label] DeferredNode label + * @property {Array.|null} [path] DeferredNode path + * @property {Trace.IQueryPlanNode|null} [node] DeferredNode node + */ + + /** + * Constructs a new DeferredNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferredNode. + * @implements IDeferredNode + * @constructor + * @param {Trace.QueryPlanNode.IDeferredNode=} [properties] Properties to set + */ + function DeferredNode(properties) { + this.depends = []; + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferredNode depends. + * @member {Array.} depends + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.depends = $util.emptyArray; + + /** + * DeferredNode label. + * @member {string} label + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.label = ""; + + /** + * DeferredNode path. + * @member {Array.} path + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.path = $util.emptyArray; + + /** + * DeferredNode node. + * @member {Trace.IQueryPlanNode|null|undefined} node + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.node = null; + + /** + * Creates a new DeferredNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.IDeferredNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferredNode} DeferredNode instance + */ + DeferredNode.create = function create(properties) { + return new DeferredNode(properties); + }; + + /** + * Encodes the specified DeferredNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.IDeferredNode} message DeferredNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.depends != null && message.depends.length) + for (var i = 0; i < message.depends.length; ++i) + $root.Trace.QueryPlanNode.DeferredNodeDepends.encode(message.depends[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + $root.Trace.QueryPlanNode.ResponsePathElement.encode(message.path[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.Trace.QueryPlanNode.encode(message.node, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeferredNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.IDeferredNode} message DeferredNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferredNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferredNode} DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferredNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.depends && message.depends.length)) + message.depends = []; + message.depends.push($root.Trace.QueryPlanNode.DeferredNodeDepends.decode(reader, reader.uint32())); + break; + case 2: + message.label = reader.string(); + break; + case 3: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push($root.Trace.QueryPlanNode.ResponsePathElement.decode(reader, reader.uint32())); + break; + case 4: + message.node = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferredNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferredNode} DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferredNode message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferredNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.depends != null && message.hasOwnProperty("depends")) { + if (!Array.isArray(message.depends)) + return "depends: array expected"; + for (var i = 0; i < message.depends.length; ++i) { + var error = $root.Trace.QueryPlanNode.DeferredNodeDepends.verify(message.depends[i]); + if (error) + return "depends." + error; + } + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) { + var error = $root.Trace.QueryPlanNode.ResponsePathElement.verify(message.path[i]); + if (error) + return "path." + error; + } + } + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.Trace.QueryPlanNode.verify(message.node); + if (error) + return "node." + error; + } + return null; + }; + + /** + * Creates a plain object from a DeferredNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.DeferredNode} message DeferredNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferredNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.depends = []; + object.path = []; + } + if (options.defaults) { + object.label = ""; + object.node = null; + } + if (message.depends && message.depends.length) { + object.depends = []; + for (var j = 0; j < message.depends.length; ++j) + object.depends[j] = $root.Trace.QueryPlanNode.DeferredNodeDepends.toObject(message.depends[j], options); + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = $root.Trace.QueryPlanNode.ResponsePathElement.toObject(message.path[j], options); + } + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.Trace.QueryPlanNode.toObject(message.node, options); + return object; + }; + + /** + * Converts this DeferredNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + * @returns {Object.} JSON object + */ + DeferredNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferredNode; + })(); + + QueryPlanNode.DeferredNodeDepends = (function() { + + /** + * Properties of a DeferredNodeDepends. + * @memberof Trace.QueryPlanNode + * @interface IDeferredNodeDepends + * @property {string|null} [id] DeferredNodeDepends id + * @property {string|null} [deferLabel] DeferredNodeDepends deferLabel + */ + + /** + * Constructs a new DeferredNodeDepends. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferredNodeDepends. + * @implements IDeferredNodeDepends + * @constructor + * @param {Trace.QueryPlanNode.IDeferredNodeDepends=} [properties] Properties to set + */ + function DeferredNodeDepends(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferredNodeDepends id. + * @member {string} id + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @instance + */ + DeferredNodeDepends.prototype.id = ""; + + /** + * DeferredNodeDepends deferLabel. + * @member {string} deferLabel + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @instance + */ + DeferredNodeDepends.prototype.deferLabel = ""; + + /** + * Creates a new DeferredNodeDepends instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.IDeferredNodeDepends=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferredNodeDepends} DeferredNodeDepends instance + */ + DeferredNodeDepends.create = function create(properties) { + return new DeferredNodeDepends(properties); + }; + + /** + * Encodes the specified DeferredNodeDepends message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.IDeferredNodeDepends} message DeferredNodeDepends message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNodeDepends.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.deferLabel != null && Object.hasOwnProperty.call(message, "deferLabel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deferLabel); + return writer; + }; + + /** + * Encodes the specified DeferredNodeDepends message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.IDeferredNodeDepends} message DeferredNodeDepends message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNodeDepends.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferredNodeDepends} DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNodeDepends.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferredNodeDepends(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.deferLabel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferredNodeDepends} DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNodeDepends.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferredNodeDepends message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferredNodeDepends.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.deferLabel != null && message.hasOwnProperty("deferLabel")) + if (!$util.isString(message.deferLabel)) + return "deferLabel: string expected"; + return null; + }; + + /** + * Creates a plain object from a DeferredNodeDepends message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.DeferredNodeDepends} message DeferredNodeDepends + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferredNodeDepends.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.deferLabel = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.deferLabel != null && message.hasOwnProperty("deferLabel")) + object.deferLabel = message.deferLabel; + return object; + }; + + /** + * Converts this DeferredNodeDepends to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @instance + * @returns {Object.} JSON object + */ + DeferredNodeDepends.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferredNodeDepends; + })(); + + QueryPlanNode.ResponsePathElement = (function() { + + /** + * Properties of a ResponsePathElement. + * @memberof Trace.QueryPlanNode + * @interface IResponsePathElement + * @property {string|null} [fieldName] ResponsePathElement fieldName + * @property {number|null} [index] ResponsePathElement index + */ + + /** + * Constructs a new ResponsePathElement. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a ResponsePathElement. + * @implements IResponsePathElement + * @constructor + * @param {Trace.QueryPlanNode.IResponsePathElement=} [properties] Properties to set + */ + function ResponsePathElement(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponsePathElement fieldName. + * @member {string} fieldName + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + */ + ResponsePathElement.prototype.fieldName = ""; + + /** + * ResponsePathElement index. + * @member {number} index + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + */ + ResponsePathElement.prototype.index = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResponsePathElement id. + * @member {"fieldName"|"index"|undefined} id + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + */ + Object.defineProperty(ResponsePathElement.prototype, "id", { + get: $util.oneOfGetter($oneOfFields = ["fieldName", "index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponsePathElement instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.IResponsePathElement=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement instance + */ + ResponsePathElement.create = function create(properties) { + return new ResponsePathElement(properties); + }; + + /** + * Encodes the specified ResponsePathElement message. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.IResponsePathElement} message ResponsePathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponsePathElement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); + return writer; + }; + + /** + * Encodes the specified ResponsePathElement message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.IResponsePathElement} message ResponsePathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponsePathElement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponsePathElement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ResponsePathElement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fieldName = reader.string(); + break; + case 2: + message.index = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponsePathElement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponsePathElement message. + * @function verify + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponsePathElement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) { + properties.id = 1; + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + if (properties.id === 1) + return "id: multiple values"; + properties.id = 1; + if (!$util.isInteger(message.index)) + return "index: integer expected"; + } + return null; + }; + + /** + * Creates a plain object from a ResponsePathElement message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.ResponsePathElement} message ResponsePathElement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponsePathElement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) { + object.fieldName = message.fieldName; + if (options.oneofs) + object.id = "fieldName"; + } + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object.id = "index"; + } + return object; + }; + + /** + * Converts this ResponsePathElement to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + * @returns {Object.} JSON object + */ + ResponsePathElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponsePathElement; + })(); + + return QueryPlanNode; + })(); + + return Trace; +})(); + +$root.ReportHeader = (function() { + + /** + * Properties of a ReportHeader. + * @exports IReportHeader + * @interface IReportHeader + * @property {string|null} [graphRef] ReportHeader graphRef + * @property {string|null} [hostname] ReportHeader hostname + * @property {string|null} [agentVersion] ReportHeader agentVersion + * @property {string|null} [serviceVersion] ReportHeader serviceVersion + * @property {string|null} [runtimeVersion] ReportHeader runtimeVersion + * @property {string|null} [uname] ReportHeader uname + * @property {string|null} [executableSchemaId] ReportHeader executableSchemaId + */ + + /** + * Constructs a new ReportHeader. + * @exports ReportHeader + * @classdesc Represents a ReportHeader. + * @implements IReportHeader + * @constructor + * @param {IReportHeader=} [properties] Properties to set + */ + function ReportHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportHeader graphRef. + * @member {string} graphRef + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.graphRef = ""; + + /** + * ReportHeader hostname. + * @member {string} hostname + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.hostname = ""; + + /** + * ReportHeader agentVersion. + * @member {string} agentVersion + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.agentVersion = ""; + + /** + * ReportHeader serviceVersion. + * @member {string} serviceVersion + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.serviceVersion = ""; + + /** + * ReportHeader runtimeVersion. + * @member {string} runtimeVersion + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.runtimeVersion = ""; + + /** + * ReportHeader uname. + * @member {string} uname + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.uname = ""; + + /** + * ReportHeader executableSchemaId. + * @member {string} executableSchemaId + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.executableSchemaId = ""; + + /** + * Creates a new ReportHeader instance using the specified properties. + * @function create + * @memberof ReportHeader + * @static + * @param {IReportHeader=} [properties] Properties to set + * @returns {ReportHeader} ReportHeader instance + */ + ReportHeader.create = function create(properties) { + return new ReportHeader(properties); + }; + + /** + * Encodes the specified ReportHeader message. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @function encode + * @memberof ReportHeader + * @static + * @param {IReportHeader} message ReportHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostname); + if (message.agentVersion != null && Object.hasOwnProperty.call(message, "agentVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.agentVersion); + if (message.serviceVersion != null && Object.hasOwnProperty.call(message, "serviceVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceVersion); + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.runtimeVersion); + if (message.uname != null && Object.hasOwnProperty.call(message, "uname")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.uname); + if (message.executableSchemaId != null && Object.hasOwnProperty.call(message, "executableSchemaId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.executableSchemaId); + if (message.graphRef != null && Object.hasOwnProperty.call(message, "graphRef")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.graphRef); + return writer; + }; + + /** + * Encodes the specified ReportHeader message, length delimited. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof ReportHeader + * @static + * @param {IReportHeader} message ReportHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportHeader message from the specified reader or buffer. + * @function decode + * @memberof ReportHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ReportHeader} ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ReportHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 12: + message.graphRef = reader.string(); + break; + case 5: + message.hostname = reader.string(); + break; + case 6: + message.agentVersion = reader.string(); + break; + case 7: + message.serviceVersion = reader.string(); + break; + case 8: + message.runtimeVersion = reader.string(); + break; + case 9: + message.uname = reader.string(); + break; + case 11: + message.executableSchemaId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ReportHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ReportHeader} ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportHeader message. + * @function verify + * @memberof ReportHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.graphRef != null && message.hasOwnProperty("graphRef")) + if (!$util.isString(message.graphRef)) + return "graphRef: string expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + if (!$util.isString(message.agentVersion)) + return "agentVersion: string expected"; + if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion")) + if (!$util.isString(message.serviceVersion)) + return "serviceVersion: string expected"; + if (message.runtimeVersion != null && message.hasOwnProperty("runtimeVersion")) + if (!$util.isString(message.runtimeVersion)) + return "runtimeVersion: string expected"; + if (message.uname != null && message.hasOwnProperty("uname")) + if (!$util.isString(message.uname)) + return "uname: string expected"; + if (message.executableSchemaId != null && message.hasOwnProperty("executableSchemaId")) + if (!$util.isString(message.executableSchemaId)) + return "executableSchemaId: string expected"; + return null; + }; + + /** + * Creates a plain object from a ReportHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof ReportHeader + * @static + * @param {ReportHeader} message ReportHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hostname = ""; + object.agentVersion = ""; + object.serviceVersion = ""; + object.runtimeVersion = ""; + object.uname = ""; + object.executableSchemaId = ""; + object.graphRef = ""; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + object.agentVersion = message.agentVersion; + if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion")) + object.serviceVersion = message.serviceVersion; + if (message.runtimeVersion != null && message.hasOwnProperty("runtimeVersion")) + object.runtimeVersion = message.runtimeVersion; + if (message.uname != null && message.hasOwnProperty("uname")) + object.uname = message.uname; + if (message.executableSchemaId != null && message.hasOwnProperty("executableSchemaId")) + object.executableSchemaId = message.executableSchemaId; + if (message.graphRef != null && message.hasOwnProperty("graphRef")) + object.graphRef = message.graphRef; + return object; + }; + + /** + * Converts this ReportHeader to JSON. + * @function toJSON + * @memberof ReportHeader + * @instance + * @returns {Object.} JSON object + */ + ReportHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReportHeader; +})(); + +$root.PathErrorStats = (function() { + + /** + * Properties of a PathErrorStats. + * @exports IPathErrorStats + * @interface IPathErrorStats + * @property {Object.|null} [children] PathErrorStats children + * @property {number|null} [errorsCount] PathErrorStats errorsCount + * @property {number|null} [requestsWithErrorsCount] PathErrorStats requestsWithErrorsCount + */ + + /** + * Constructs a new PathErrorStats. + * @exports PathErrorStats + * @classdesc Represents a PathErrorStats. + * @implements IPathErrorStats + * @constructor + * @param {IPathErrorStats=} [properties] Properties to set + */ + function PathErrorStats(properties) { + this.children = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PathErrorStats children. + * @member {Object.} children + * @memberof PathErrorStats + * @instance + */ + PathErrorStats.prototype.children = $util.emptyObject; + + /** + * PathErrorStats errorsCount. + * @member {number} errorsCount + * @memberof PathErrorStats + * @instance + */ + PathErrorStats.prototype.errorsCount = 0; + + /** + * PathErrorStats requestsWithErrorsCount. + * @member {number} requestsWithErrorsCount + * @memberof PathErrorStats + * @instance + */ + PathErrorStats.prototype.requestsWithErrorsCount = 0; + + /** + * Creates a new PathErrorStats instance using the specified properties. + * @function create + * @memberof PathErrorStats + * @static + * @param {IPathErrorStats=} [properties] Properties to set + * @returns {PathErrorStats} PathErrorStats instance + */ + PathErrorStats.create = function create(properties) { + return new PathErrorStats(properties); + }; + + /** + * Encodes the specified PathErrorStats message. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @function encode + * @memberof PathErrorStats + * @static + * @param {IPathErrorStats} message PathErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathErrorStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.children != null && Object.hasOwnProperty.call(message, "children")) + for (var keys = Object.keys(message.children), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.PathErrorStats.encode(message.children[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.errorsCount != null && Object.hasOwnProperty.call(message, "errorsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.errorsCount); + if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.requestsWithErrorsCount); + return writer; + }; + + /** + * Encodes the specified PathErrorStats message, length delimited. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @function encodeDelimited + * @memberof PathErrorStats + * @static + * @param {IPathErrorStats} message PathErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathErrorStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer. + * @function decode + * @memberof PathErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {PathErrorStats} PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathErrorStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PathErrorStats(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.children === $util.emptyObject) + message.children = {}; + key = reader.string(); + reader.pos++; + message.children[key] = $root.PathErrorStats.decode(reader, reader.uint32()); + break; + case 4: + message.errorsCount = reader.uint64(); + break; + case 5: + message.requestsWithErrorsCount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof PathErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {PathErrorStats} PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathErrorStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PathErrorStats message. + * @function verify + * @memberof PathErrorStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathErrorStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.children != null && message.hasOwnProperty("children")) { + if (!$util.isObject(message.children)) + return "children: object expected"; + var key = Object.keys(message.children); + for (var i = 0; i < key.length; ++i) { + var error = $root.PathErrorStats.verify(message.children[key[i]]); + if (error) + return "children." + error; + } + } + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (!$util.isInteger(message.errorsCount) && !(message.errorsCount && $util.isInteger(message.errorsCount.low) && $util.isInteger(message.errorsCount.high))) + return "errorsCount: integer|Long expected"; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high))) + return "requestsWithErrorsCount: integer|Long expected"; + return null; + }; + + /** + * Creates a plain object from a PathErrorStats message. Also converts values to other types if specified. + * @function toObject + * @memberof PathErrorStats + * @static + * @param {PathErrorStats} message PathErrorStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathErrorStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.children = {}; + if (options.defaults) { + object.errorsCount = 0; + object.requestsWithErrorsCount = 0; + } + var keys2; + if (message.children && (keys2 = Object.keys(message.children)).length) { + object.children = {}; + for (var j = 0; j < keys2.length; ++j) + object.children[keys2[j]] = $root.PathErrorStats.toObject(message.children[keys2[j]], options); + } + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (typeof message.errorsCount === "number") + object.errorsCount = options.longs === String ? String(message.errorsCount) : message.errorsCount; + else + object.errorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorsCount) : options.longs === Number ? new $util.LongBits(message.errorsCount.low >>> 0, message.errorsCount.high >>> 0).toNumber(true) : message.errorsCount; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (typeof message.requestsWithErrorsCount === "number") + object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount; + else + object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount; + return object; + }; + + /** + * Converts this PathErrorStats to JSON. + * @function toJSON + * @memberof PathErrorStats + * @instance + * @returns {Object.} JSON object + */ + PathErrorStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PathErrorStats; +})(); + +$root.QueryLatencyStats = (function() { + + /** + * Properties of a QueryLatencyStats. + * @exports IQueryLatencyStats + * @interface IQueryLatencyStats + * @property {$protobuf.ToArray.|Array.|null} [latencyCount] QueryLatencyStats latencyCount + * @property {number|null} [requestCount] QueryLatencyStats requestCount + * @property {number|null} [cacheHits] QueryLatencyStats cacheHits + * @property {number|null} [persistedQueryHits] QueryLatencyStats persistedQueryHits + * @property {number|null} [persistedQueryMisses] QueryLatencyStats persistedQueryMisses + * @property {$protobuf.ToArray.|Array.|null} [cacheLatencyCount] QueryLatencyStats cacheLatencyCount + * @property {IPathErrorStats|null} [rootErrorStats] QueryLatencyStats rootErrorStats + * @property {number|null} [requestsWithErrorsCount] QueryLatencyStats requestsWithErrorsCount + * @property {$protobuf.ToArray.|Array.|null} [publicCacheTtlCount] QueryLatencyStats publicCacheTtlCount + * @property {$protobuf.ToArray.|Array.|null} [privateCacheTtlCount] QueryLatencyStats privateCacheTtlCount + * @property {number|null} [registeredOperationCount] QueryLatencyStats registeredOperationCount + * @property {number|null} [forbiddenOperationCount] QueryLatencyStats forbiddenOperationCount + * @property {number|null} [requestsWithoutFieldInstrumentation] QueryLatencyStats requestsWithoutFieldInstrumentation + */ + + /** + * Constructs a new QueryLatencyStats. + * @exports QueryLatencyStats + * @classdesc Represents a QueryLatencyStats. + * @implements IQueryLatencyStats + * @constructor + * @param {IQueryLatencyStats=} [properties] Properties to set + */ + function QueryLatencyStats(properties) { + this.latencyCount = []; + this.cacheLatencyCount = []; + this.publicCacheTtlCount = []; + this.privateCacheTtlCount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryLatencyStats latencyCount. + * @member {Array.} latencyCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.latencyCount = $util.emptyArray; + + /** + * QueryLatencyStats requestCount. + * @member {number} requestCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.requestCount = 0; + + /** + * QueryLatencyStats cacheHits. + * @member {number} cacheHits + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.cacheHits = 0; + + /** + * QueryLatencyStats persistedQueryHits. + * @member {number} persistedQueryHits + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.persistedQueryHits = 0; + + /** + * QueryLatencyStats persistedQueryMisses. + * @member {number} persistedQueryMisses + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.persistedQueryMisses = 0; + + /** + * QueryLatencyStats cacheLatencyCount. + * @member {Array.} cacheLatencyCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.cacheLatencyCount = $util.emptyArray; + + /** + * QueryLatencyStats rootErrorStats. + * @member {IPathErrorStats|null|undefined} rootErrorStats + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.rootErrorStats = null; + + /** + * QueryLatencyStats requestsWithErrorsCount. + * @member {number} requestsWithErrorsCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.requestsWithErrorsCount = 0; + + /** + * QueryLatencyStats publicCacheTtlCount. + * @member {Array.} publicCacheTtlCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.publicCacheTtlCount = $util.emptyArray; + + /** + * QueryLatencyStats privateCacheTtlCount. + * @member {Array.} privateCacheTtlCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.privateCacheTtlCount = $util.emptyArray; + + /** + * QueryLatencyStats registeredOperationCount. + * @member {number} registeredOperationCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.registeredOperationCount = 0; + + /** + * QueryLatencyStats forbiddenOperationCount. + * @member {number} forbiddenOperationCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.forbiddenOperationCount = 0; + + /** + * QueryLatencyStats requestsWithoutFieldInstrumentation. + * @member {number} requestsWithoutFieldInstrumentation + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.requestsWithoutFieldInstrumentation = 0; + + /** + * Creates a new QueryLatencyStats instance using the specified properties. + * @function create + * @memberof QueryLatencyStats + * @static + * @param {IQueryLatencyStats=} [properties] Properties to set + * @returns {QueryLatencyStats} QueryLatencyStats instance + */ + QueryLatencyStats.create = function create(properties) { + return new QueryLatencyStats(properties); + }; + + /** + * Encodes the specified QueryLatencyStats message. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @function encode + * @memberof QueryLatencyStats + * @static + * @param {IQueryLatencyStats} message QueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryLatencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestCount != null && Object.hasOwnProperty.call(message, "requestCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.requestCount); + if (message.cacheHits != null && Object.hasOwnProperty.call(message, "cacheHits")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.cacheHits); + if (message.persistedQueryHits != null && Object.hasOwnProperty.call(message, "persistedQueryHits")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.persistedQueryHits); + if (message.persistedQueryMisses != null && Object.hasOwnProperty.call(message, "persistedQueryMisses")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.persistedQueryMisses); + if (message.rootErrorStats != null && Object.hasOwnProperty.call(message, "rootErrorStats")) + $root.PathErrorStats.encode(message.rootErrorStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.requestsWithErrorsCount); + if (message.registeredOperationCount != null && Object.hasOwnProperty.call(message, "registeredOperationCount")) + writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.registeredOperationCount); + if (message.forbiddenOperationCount != null && Object.hasOwnProperty.call(message, "forbiddenOperationCount")) + writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.forbiddenOperationCount); + var array13; + if (message.latencyCount != null && message.latencyCount.toArray) + array13 = message.latencyCount.toArray(); + else + array13 = message.latencyCount; + if (array13 != null && array13.length) { + writer.uint32(/* id 13, wireType 2 =*/106).fork(); + for (var i = 0; i < array13.length; ++i) + writer.sint64(array13[i]); + writer.ldelim(); + } + var array14; + if (message.cacheLatencyCount != null && message.cacheLatencyCount.toArray) + array14 = message.cacheLatencyCount.toArray(); + else + array14 = message.cacheLatencyCount; + if (array14 != null && array14.length) { + writer.uint32(/* id 14, wireType 2 =*/114).fork(); + for (var i = 0; i < array14.length; ++i) + writer.sint64(array14[i]); + writer.ldelim(); + } + var array15; + if (message.publicCacheTtlCount != null && message.publicCacheTtlCount.toArray) + array15 = message.publicCacheTtlCount.toArray(); + else + array15 = message.publicCacheTtlCount; + if (array15 != null && array15.length) { + writer.uint32(/* id 15, wireType 2 =*/122).fork(); + for (var i = 0; i < array15.length; ++i) + writer.sint64(array15[i]); + writer.ldelim(); + } + var array16; + if (message.privateCacheTtlCount != null && message.privateCacheTtlCount.toArray) + array16 = message.privateCacheTtlCount.toArray(); + else + array16 = message.privateCacheTtlCount; + if (array16 != null && array16.length) { + writer.uint32(/* id 16, wireType 2 =*/130).fork(); + for (var i = 0; i < array16.length; ++i) + writer.sint64(array16[i]); + writer.ldelim(); + } + if (message.requestsWithoutFieldInstrumentation != null && Object.hasOwnProperty.call(message, "requestsWithoutFieldInstrumentation")) + writer.uint32(/* id 17, wireType 0 =*/136).uint64(message.requestsWithoutFieldInstrumentation); + return writer; + }; + + /** + * Encodes the specified QueryLatencyStats message, length delimited. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof QueryLatencyStats + * @static + * @param {IQueryLatencyStats} message QueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryLatencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer. + * @function decode + * @memberof QueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {QueryLatencyStats} QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryLatencyStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.QueryLatencyStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 13: + if (!(message.latencyCount && message.latencyCount.length)) + message.latencyCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.latencyCount.push(reader.sint64()); + } else + message.latencyCount.push(reader.sint64()); + break; + case 2: + message.requestCount = reader.uint64(); + break; + case 3: + message.cacheHits = reader.uint64(); + break; + case 4: + message.persistedQueryHits = reader.uint64(); + break; + case 5: + message.persistedQueryMisses = reader.uint64(); + break; + case 14: + if (!(message.cacheLatencyCount && message.cacheLatencyCount.length)) + message.cacheLatencyCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.cacheLatencyCount.push(reader.sint64()); + } else + message.cacheLatencyCount.push(reader.sint64()); + break; + case 7: + message.rootErrorStats = $root.PathErrorStats.decode(reader, reader.uint32()); + break; + case 8: + message.requestsWithErrorsCount = reader.uint64(); + break; + case 15: + if (!(message.publicCacheTtlCount && message.publicCacheTtlCount.length)) + message.publicCacheTtlCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicCacheTtlCount.push(reader.sint64()); + } else + message.publicCacheTtlCount.push(reader.sint64()); + break; + case 16: + if (!(message.privateCacheTtlCount && message.privateCacheTtlCount.length)) + message.privateCacheTtlCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.privateCacheTtlCount.push(reader.sint64()); + } else + message.privateCacheTtlCount.push(reader.sint64()); + break; + case 11: + message.registeredOperationCount = reader.uint64(); + break; + case 12: + message.forbiddenOperationCount = reader.uint64(); + break; + case 17: + message.requestsWithoutFieldInstrumentation = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof QueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {QueryLatencyStats} QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryLatencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryLatencyStats message. + * @function verify + * @memberof QueryLatencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryLatencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latencyCount != null && message.hasOwnProperty("latencyCount")) { + var array13; + if (message.latencyCount != null && message.latencyCount.toArray) + array13 = message.latencyCount.toArray(); + else + array13 = message.latencyCount; + if (!Array.isArray(array13)) + return "latencyCount: array expected"; + for (var i = 0; i < array13.length; ++i) + if (!$util.isInteger(array13[i]) && !(array13[i] && $util.isInteger(array13[i].low) && $util.isInteger(array13[i].high))) + return "latencyCount: integer|Long[] expected"; + } + if (message.requestCount != null && message.hasOwnProperty("requestCount")) + if (!$util.isInteger(message.requestCount) && !(message.requestCount && $util.isInteger(message.requestCount.low) && $util.isInteger(message.requestCount.high))) + return "requestCount: integer|Long expected"; + if (message.cacheHits != null && message.hasOwnProperty("cacheHits")) + if (!$util.isInteger(message.cacheHits) && !(message.cacheHits && $util.isInteger(message.cacheHits.low) && $util.isInteger(message.cacheHits.high))) + return "cacheHits: integer|Long expected"; + if (message.persistedQueryHits != null && message.hasOwnProperty("persistedQueryHits")) + if (!$util.isInteger(message.persistedQueryHits) && !(message.persistedQueryHits && $util.isInteger(message.persistedQueryHits.low) && $util.isInteger(message.persistedQueryHits.high))) + return "persistedQueryHits: integer|Long expected"; + if (message.persistedQueryMisses != null && message.hasOwnProperty("persistedQueryMisses")) + if (!$util.isInteger(message.persistedQueryMisses) && !(message.persistedQueryMisses && $util.isInteger(message.persistedQueryMisses.low) && $util.isInteger(message.persistedQueryMisses.high))) + return "persistedQueryMisses: integer|Long expected"; + if (message.cacheLatencyCount != null && message.hasOwnProperty("cacheLatencyCount")) { + var array14; + if (message.cacheLatencyCount != null && message.cacheLatencyCount.toArray) + array14 = message.cacheLatencyCount.toArray(); + else + array14 = message.cacheLatencyCount; + if (!Array.isArray(array14)) + return "cacheLatencyCount: array expected"; + for (var i = 0; i < array14.length; ++i) + if (!$util.isInteger(array14[i]) && !(array14[i] && $util.isInteger(array14[i].low) && $util.isInteger(array14[i].high))) + return "cacheLatencyCount: integer|Long[] expected"; + } + if (message.rootErrorStats != null && message.hasOwnProperty("rootErrorStats")) { + var error = $root.PathErrorStats.verify(message.rootErrorStats); + if (error) + return "rootErrorStats." + error; + } + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high))) + return "requestsWithErrorsCount: integer|Long expected"; + if (message.publicCacheTtlCount != null && message.hasOwnProperty("publicCacheTtlCount")) { + var array15; + if (message.publicCacheTtlCount != null && message.publicCacheTtlCount.toArray) + array15 = message.publicCacheTtlCount.toArray(); + else + array15 = message.publicCacheTtlCount; + if (!Array.isArray(array15)) + return "publicCacheTtlCount: array expected"; + for (var i = 0; i < array15.length; ++i) + if (!$util.isInteger(array15[i]) && !(array15[i] && $util.isInteger(array15[i].low) && $util.isInteger(array15[i].high))) + return "publicCacheTtlCount: integer|Long[] expected"; + } + if (message.privateCacheTtlCount != null && message.hasOwnProperty("privateCacheTtlCount")) { + var array16; + if (message.privateCacheTtlCount != null && message.privateCacheTtlCount.toArray) + array16 = message.privateCacheTtlCount.toArray(); + else + array16 = message.privateCacheTtlCount; + if (!Array.isArray(array16)) + return "privateCacheTtlCount: array expected"; + for (var i = 0; i < array16.length; ++i) + if (!$util.isInteger(array16[i]) && !(array16[i] && $util.isInteger(array16[i].low) && $util.isInteger(array16[i].high))) + return "privateCacheTtlCount: integer|Long[] expected"; + } + if (message.registeredOperationCount != null && message.hasOwnProperty("registeredOperationCount")) + if (!$util.isInteger(message.registeredOperationCount) && !(message.registeredOperationCount && $util.isInteger(message.registeredOperationCount.low) && $util.isInteger(message.registeredOperationCount.high))) + return "registeredOperationCount: integer|Long expected"; + if (message.forbiddenOperationCount != null && message.hasOwnProperty("forbiddenOperationCount")) + if (!$util.isInteger(message.forbiddenOperationCount) && !(message.forbiddenOperationCount && $util.isInteger(message.forbiddenOperationCount.low) && $util.isInteger(message.forbiddenOperationCount.high))) + return "forbiddenOperationCount: integer|Long expected"; + if (message.requestsWithoutFieldInstrumentation != null && message.hasOwnProperty("requestsWithoutFieldInstrumentation")) + if (!$util.isInteger(message.requestsWithoutFieldInstrumentation) && !(message.requestsWithoutFieldInstrumentation && $util.isInteger(message.requestsWithoutFieldInstrumentation.low) && $util.isInteger(message.requestsWithoutFieldInstrumentation.high))) + return "requestsWithoutFieldInstrumentation: integer|Long expected"; + return null; + }; + + /** + * Creates a plain object from a QueryLatencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof QueryLatencyStats + * @static + * @param {QueryLatencyStats} message QueryLatencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryLatencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.latencyCount = []; + object.cacheLatencyCount = []; + object.publicCacheTtlCount = []; + object.privateCacheTtlCount = []; + } + if (options.defaults) { + object.requestCount = 0; + object.cacheHits = 0; + object.persistedQueryHits = 0; + object.persistedQueryMisses = 0; + object.rootErrorStats = null; + object.requestsWithErrorsCount = 0; + object.registeredOperationCount = 0; + object.forbiddenOperationCount = 0; + object.requestsWithoutFieldInstrumentation = 0; + } + if (message.requestCount != null && message.hasOwnProperty("requestCount")) + if (typeof message.requestCount === "number") + object.requestCount = options.longs === String ? String(message.requestCount) : message.requestCount; + else + object.requestCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestCount) : options.longs === Number ? new $util.LongBits(message.requestCount.low >>> 0, message.requestCount.high >>> 0).toNumber(true) : message.requestCount; + if (message.cacheHits != null && message.hasOwnProperty("cacheHits")) + if (typeof message.cacheHits === "number") + object.cacheHits = options.longs === String ? String(message.cacheHits) : message.cacheHits; + else + object.cacheHits = options.longs === String ? $util.Long.prototype.toString.call(message.cacheHits) : options.longs === Number ? new $util.LongBits(message.cacheHits.low >>> 0, message.cacheHits.high >>> 0).toNumber(true) : message.cacheHits; + if (message.persistedQueryHits != null && message.hasOwnProperty("persistedQueryHits")) + if (typeof message.persistedQueryHits === "number") + object.persistedQueryHits = options.longs === String ? String(message.persistedQueryHits) : message.persistedQueryHits; + else + object.persistedQueryHits = options.longs === String ? $util.Long.prototype.toString.call(message.persistedQueryHits) : options.longs === Number ? new $util.LongBits(message.persistedQueryHits.low >>> 0, message.persistedQueryHits.high >>> 0).toNumber(true) : message.persistedQueryHits; + if (message.persistedQueryMisses != null && message.hasOwnProperty("persistedQueryMisses")) + if (typeof message.persistedQueryMisses === "number") + object.persistedQueryMisses = options.longs === String ? String(message.persistedQueryMisses) : message.persistedQueryMisses; + else + object.persistedQueryMisses = options.longs === String ? $util.Long.prototype.toString.call(message.persistedQueryMisses) : options.longs === Number ? new $util.LongBits(message.persistedQueryMisses.low >>> 0, message.persistedQueryMisses.high >>> 0).toNumber(true) : message.persistedQueryMisses; + if (message.rootErrorStats != null && message.hasOwnProperty("rootErrorStats")) + object.rootErrorStats = $root.PathErrorStats.toObject(message.rootErrorStats, options); + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (typeof message.requestsWithErrorsCount === "number") + object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount; + else + object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount; + if (message.registeredOperationCount != null && message.hasOwnProperty("registeredOperationCount")) + if (typeof message.registeredOperationCount === "number") + object.registeredOperationCount = options.longs === String ? String(message.registeredOperationCount) : message.registeredOperationCount; + else + object.registeredOperationCount = options.longs === String ? $util.Long.prototype.toString.call(message.registeredOperationCount) : options.longs === Number ? new $util.LongBits(message.registeredOperationCount.low >>> 0, message.registeredOperationCount.high >>> 0).toNumber(true) : message.registeredOperationCount; + if (message.forbiddenOperationCount != null && message.hasOwnProperty("forbiddenOperationCount")) + if (typeof message.forbiddenOperationCount === "number") + object.forbiddenOperationCount = options.longs === String ? String(message.forbiddenOperationCount) : message.forbiddenOperationCount; + else + object.forbiddenOperationCount = options.longs === String ? $util.Long.prototype.toString.call(message.forbiddenOperationCount) : options.longs === Number ? new $util.LongBits(message.forbiddenOperationCount.low >>> 0, message.forbiddenOperationCount.high >>> 0).toNumber(true) : message.forbiddenOperationCount; + if (message.latencyCount && message.latencyCount.length) { + object.latencyCount = []; + for (var j = 0; j < message.latencyCount.length; ++j) + if (typeof message.latencyCount[j] === "number") + object.latencyCount[j] = options.longs === String ? String(message.latencyCount[j]) : message.latencyCount[j]; + else + object.latencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.latencyCount[j]) : options.longs === Number ? new $util.LongBits(message.latencyCount[j].low >>> 0, message.latencyCount[j].high >>> 0).toNumber() : message.latencyCount[j]; + } + if (message.cacheLatencyCount && message.cacheLatencyCount.length) { + object.cacheLatencyCount = []; + for (var j = 0; j < message.cacheLatencyCount.length; ++j) + if (typeof message.cacheLatencyCount[j] === "number") + object.cacheLatencyCount[j] = options.longs === String ? String(message.cacheLatencyCount[j]) : message.cacheLatencyCount[j]; + else + object.cacheLatencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.cacheLatencyCount[j]) : options.longs === Number ? new $util.LongBits(message.cacheLatencyCount[j].low >>> 0, message.cacheLatencyCount[j].high >>> 0).toNumber() : message.cacheLatencyCount[j]; + } + if (message.publicCacheTtlCount && message.publicCacheTtlCount.length) { + object.publicCacheTtlCount = []; + for (var j = 0; j < message.publicCacheTtlCount.length; ++j) + if (typeof message.publicCacheTtlCount[j] === "number") + object.publicCacheTtlCount[j] = options.longs === String ? String(message.publicCacheTtlCount[j]) : message.publicCacheTtlCount[j]; + else + object.publicCacheTtlCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.publicCacheTtlCount[j]) : options.longs === Number ? new $util.LongBits(message.publicCacheTtlCount[j].low >>> 0, message.publicCacheTtlCount[j].high >>> 0).toNumber() : message.publicCacheTtlCount[j]; + } + if (message.privateCacheTtlCount && message.privateCacheTtlCount.length) { + object.privateCacheTtlCount = []; + for (var j = 0; j < message.privateCacheTtlCount.length; ++j) + if (typeof message.privateCacheTtlCount[j] === "number") + object.privateCacheTtlCount[j] = options.longs === String ? String(message.privateCacheTtlCount[j]) : message.privateCacheTtlCount[j]; + else + object.privateCacheTtlCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.privateCacheTtlCount[j]) : options.longs === Number ? new $util.LongBits(message.privateCacheTtlCount[j].low >>> 0, message.privateCacheTtlCount[j].high >>> 0).toNumber() : message.privateCacheTtlCount[j]; + } + if (message.requestsWithoutFieldInstrumentation != null && message.hasOwnProperty("requestsWithoutFieldInstrumentation")) + if (typeof message.requestsWithoutFieldInstrumentation === "number") + object.requestsWithoutFieldInstrumentation = options.longs === String ? String(message.requestsWithoutFieldInstrumentation) : message.requestsWithoutFieldInstrumentation; + else + object.requestsWithoutFieldInstrumentation = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithoutFieldInstrumentation) : options.longs === Number ? new $util.LongBits(message.requestsWithoutFieldInstrumentation.low >>> 0, message.requestsWithoutFieldInstrumentation.high >>> 0).toNumber(true) : message.requestsWithoutFieldInstrumentation; + return object; + }; + + /** + * Converts this QueryLatencyStats to JSON. + * @function toJSON + * @memberof QueryLatencyStats + * @instance + * @returns {Object.} JSON object + */ + QueryLatencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryLatencyStats; +})(); + +$root.StatsContext = (function() { + + /** + * Properties of a StatsContext. + * @exports IStatsContext + * @interface IStatsContext + * @property {string|null} [clientName] StatsContext clientName + * @property {string|null} [clientVersion] StatsContext clientVersion + */ + + /** + * Constructs a new StatsContext. + * @exports StatsContext + * @classdesc Represents a StatsContext. + * @implements IStatsContext + * @constructor + * @param {IStatsContext=} [properties] Properties to set + */ + function StatsContext(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatsContext clientName. + * @member {string} clientName + * @memberof StatsContext + * @instance + */ + StatsContext.prototype.clientName = ""; + + /** + * StatsContext clientVersion. + * @member {string} clientVersion + * @memberof StatsContext + * @instance + */ + StatsContext.prototype.clientVersion = ""; + + /** + * Creates a new StatsContext instance using the specified properties. + * @function create + * @memberof StatsContext + * @static + * @param {IStatsContext=} [properties] Properties to set + * @returns {StatsContext} StatsContext instance + */ + StatsContext.create = function create(properties) { + return new StatsContext(properties); + }; + + /** + * Encodes the specified StatsContext message. Does not implicitly {@link StatsContext.verify|verify} messages. + * @function encode + * @memberof StatsContext + * @static + * @param {IStatsContext} message StatsContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatsContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientName != null && Object.hasOwnProperty.call(message, "clientName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientName); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientVersion); + return writer; + }; + + /** + * Encodes the specified StatsContext message, length delimited. Does not implicitly {@link StatsContext.verify|verify} messages. + * @function encodeDelimited + * @memberof StatsContext + * @static + * @param {IStatsContext} message StatsContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatsContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatsContext message from the specified reader or buffer. + * @function decode + * @memberof StatsContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StatsContext} StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatsContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StatsContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.clientName = reader.string(); + break; + case 3: + message.clientVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatsContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StatsContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StatsContext} StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatsContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatsContext message. + * @function verify + * @memberof StatsContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatsContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientName != null && message.hasOwnProperty("clientName")) + if (!$util.isString(message.clientName)) + return "clientName: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: string expected"; + return null; + }; + + /** + * Creates a plain object from a StatsContext message. Also converts values to other types if specified. + * @function toObject + * @memberof StatsContext + * @static + * @param {StatsContext} message StatsContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatsContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientName = ""; + object.clientVersion = ""; + } + if (message.clientName != null && message.hasOwnProperty("clientName")) + object.clientName = message.clientName; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + return object; + }; + + /** + * Converts this StatsContext to JSON. + * @function toJSON + * @memberof StatsContext + * @instance + * @returns {Object.} JSON object + */ + StatsContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StatsContext; +})(); + +$root.ContextualizedQueryLatencyStats = (function() { + + /** + * Properties of a ContextualizedQueryLatencyStats. + * @exports IContextualizedQueryLatencyStats + * @interface IContextualizedQueryLatencyStats + * @property {IQueryLatencyStats|null} [queryLatencyStats] ContextualizedQueryLatencyStats queryLatencyStats + * @property {IStatsContext|null} [context] ContextualizedQueryLatencyStats context + */ + + /** + * Constructs a new ContextualizedQueryLatencyStats. + * @exports ContextualizedQueryLatencyStats + * @classdesc Represents a ContextualizedQueryLatencyStats. + * @implements IContextualizedQueryLatencyStats + * @constructor + * @param {IContextualizedQueryLatencyStats=} [properties] Properties to set + */ + function ContextualizedQueryLatencyStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextualizedQueryLatencyStats queryLatencyStats. + * @member {IQueryLatencyStats|null|undefined} queryLatencyStats + * @memberof ContextualizedQueryLatencyStats + * @instance + */ + ContextualizedQueryLatencyStats.prototype.queryLatencyStats = null; + + /** + * ContextualizedQueryLatencyStats context. + * @member {IStatsContext|null|undefined} context + * @memberof ContextualizedQueryLatencyStats + * @instance + */ + ContextualizedQueryLatencyStats.prototype.context = null; + + /** + * Creates a new ContextualizedQueryLatencyStats instance using the specified properties. + * @function create + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {IContextualizedQueryLatencyStats=} [properties] Properties to set + * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats instance + */ + ContextualizedQueryLatencyStats.create = function create(properties) { + return new ContextualizedQueryLatencyStats(properties); + }; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @function encode + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {IContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedQueryLatencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryLatencyStats != null && Object.hasOwnProperty.call(message, "queryLatencyStats")) + $root.QueryLatencyStats.encode(message.queryLatencyStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.StatsContext.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message, length delimited. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {IContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedQueryLatencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer. + * @function decode + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedQueryLatencyStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedQueryLatencyStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queryLatencyStats = $root.QueryLatencyStats.decode(reader, reader.uint32()); + break; + case 2: + message.context = $root.StatsContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedQueryLatencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualizedQueryLatencyStats message. + * @function verify + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualizedQueryLatencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) { + var error = $root.QueryLatencyStats.verify(message.queryLatencyStats); + if (error) + return "queryLatencyStats." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.StatsContext.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates a plain object from a ContextualizedQueryLatencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {ContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualizedQueryLatencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queryLatencyStats = null; + object.context = null; + } + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) + object.queryLatencyStats = $root.QueryLatencyStats.toObject(message.queryLatencyStats, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.StatsContext.toObject(message.context, options); + return object; + }; + + /** + * Converts this ContextualizedQueryLatencyStats to JSON. + * @function toJSON + * @memberof ContextualizedQueryLatencyStats + * @instance + * @returns {Object.} JSON object + */ + ContextualizedQueryLatencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContextualizedQueryLatencyStats; +})(); + +$root.ContextualizedTypeStats = (function() { + + /** + * Properties of a ContextualizedTypeStats. + * @exports IContextualizedTypeStats + * @interface IContextualizedTypeStats + * @property {IStatsContext|null} [context] ContextualizedTypeStats context + * @property {Object.|null} [perTypeStat] ContextualizedTypeStats perTypeStat + */ + + /** + * Constructs a new ContextualizedTypeStats. + * @exports ContextualizedTypeStats + * @classdesc Represents a ContextualizedTypeStats. + * @implements IContextualizedTypeStats + * @constructor + * @param {IContextualizedTypeStats=} [properties] Properties to set + */ + function ContextualizedTypeStats(properties) { + this.perTypeStat = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextualizedTypeStats context. + * @member {IStatsContext|null|undefined} context + * @memberof ContextualizedTypeStats + * @instance + */ + ContextualizedTypeStats.prototype.context = null; + + /** + * ContextualizedTypeStats perTypeStat. + * @member {Object.} perTypeStat + * @memberof ContextualizedTypeStats + * @instance + */ + ContextualizedTypeStats.prototype.perTypeStat = $util.emptyObject; + + /** + * Creates a new ContextualizedTypeStats instance using the specified properties. + * @function create + * @memberof ContextualizedTypeStats + * @static + * @param {IContextualizedTypeStats=} [properties] Properties to set + * @returns {ContextualizedTypeStats} ContextualizedTypeStats instance + */ + ContextualizedTypeStats.create = function create(properties) { + return new ContextualizedTypeStats(properties); + }; + + /** + * Encodes the specified ContextualizedTypeStats message. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @function encode + * @memberof ContextualizedTypeStats + * @static + * @param {IContextualizedTypeStats} message ContextualizedTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedTypeStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.StatsContext.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.perTypeStat != null && Object.hasOwnProperty.call(message, "perTypeStat")) + for (var keys = Object.keys(message.perTypeStat), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.TypeStat.encode(message.perTypeStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ContextualizedTypeStats message, length delimited. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @function encodeDelimited + * @memberof ContextualizedTypeStats + * @static + * @param {IContextualizedTypeStats} message ContextualizedTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedTypeStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer. + * @function decode + * @memberof ContextualizedTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ContextualizedTypeStats} ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedTypeStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedTypeStats(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.context = $root.StatsContext.decode(reader, reader.uint32()); + break; + case 2: + reader.skip().pos++; + if (message.perTypeStat === $util.emptyObject) + message.perTypeStat = {}; + key = reader.string(); + reader.pos++; + message.perTypeStat[key] = $root.TypeStat.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ContextualizedTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ContextualizedTypeStats} ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedTypeStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualizedTypeStats message. + * @function verify + * @memberof ContextualizedTypeStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualizedTypeStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.StatsContext.verify(message.context); + if (error) + return "context." + error; + } + if (message.perTypeStat != null && message.hasOwnProperty("perTypeStat")) { + if (!$util.isObject(message.perTypeStat)) + return "perTypeStat: object expected"; + var key = Object.keys(message.perTypeStat); + for (var i = 0; i < key.length; ++i) { + var error = $root.TypeStat.verify(message.perTypeStat[key[i]]); + if (error) + return "perTypeStat." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a ContextualizedTypeStats message. Also converts values to other types if specified. + * @function toObject + * @memberof ContextualizedTypeStats + * @static + * @param {ContextualizedTypeStats} message ContextualizedTypeStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualizedTypeStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.perTypeStat = {}; + if (options.defaults) + object.context = null; + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.StatsContext.toObject(message.context, options); + var keys2; + if (message.perTypeStat && (keys2 = Object.keys(message.perTypeStat)).length) { + object.perTypeStat = {}; + for (var j = 0; j < keys2.length; ++j) + object.perTypeStat[keys2[j]] = $root.TypeStat.toObject(message.perTypeStat[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ContextualizedTypeStats to JSON. + * @function toJSON + * @memberof ContextualizedTypeStats + * @instance + * @returns {Object.} JSON object + */ + ContextualizedTypeStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContextualizedTypeStats; +})(); + +$root.FieldStat = (function() { + + /** + * Properties of a FieldStat. + * @exports IFieldStat + * @interface IFieldStat + * @property {string|null} [returnType] FieldStat returnType + * @property {number|null} [errorsCount] FieldStat errorsCount + * @property {number|null} [observedExecutionCount] FieldStat observedExecutionCount + * @property {number|null} [estimatedExecutionCount] FieldStat estimatedExecutionCount + * @property {number|null} [requestsWithErrorsCount] FieldStat requestsWithErrorsCount + * @property {$protobuf.ToArray.|Array.|null} [latencyCount] FieldStat latencyCount + */ + + /** + * Constructs a new FieldStat. + * @exports FieldStat + * @classdesc Represents a FieldStat. + * @implements IFieldStat + * @constructor + * @param {IFieldStat=} [properties] Properties to set + */ + function FieldStat(properties) { + this.latencyCount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldStat returnType. + * @member {string} returnType + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.returnType = ""; + + /** + * FieldStat errorsCount. + * @member {number} errorsCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.errorsCount = 0; + + /** + * FieldStat observedExecutionCount. + * @member {number} observedExecutionCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.observedExecutionCount = 0; + + /** + * FieldStat estimatedExecutionCount. + * @member {number} estimatedExecutionCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.estimatedExecutionCount = 0; + + /** + * FieldStat requestsWithErrorsCount. + * @member {number} requestsWithErrorsCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.requestsWithErrorsCount = 0; + + /** + * FieldStat latencyCount. + * @member {Array.} latencyCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.latencyCount = $util.emptyArray; + + /** + * Creates a new FieldStat instance using the specified properties. + * @function create + * @memberof FieldStat + * @static + * @param {IFieldStat=} [properties] Properties to set + * @returns {FieldStat} FieldStat instance + */ + FieldStat.create = function create(properties) { + return new FieldStat(properties); + }; + + /** + * Encodes the specified FieldStat message. Does not implicitly {@link FieldStat.verify|verify} messages. + * @function encode + * @memberof FieldStat + * @static + * @param {IFieldStat} message FieldStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldStat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.returnType); + if (message.errorsCount != null && Object.hasOwnProperty.call(message, "errorsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.errorsCount); + if (message.observedExecutionCount != null && Object.hasOwnProperty.call(message, "observedExecutionCount")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.observedExecutionCount); + if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.requestsWithErrorsCount); + var array9; + if (message.latencyCount != null && message.latencyCount.toArray) + array9 = message.latencyCount.toArray(); + else + array9 = message.latencyCount; + if (array9 != null && array9.length) { + writer.uint32(/* id 9, wireType 2 =*/74).fork(); + for (var i = 0; i < array9.length; ++i) + writer.sint64(array9[i]); + writer.ldelim(); + } + if (message.estimatedExecutionCount != null && Object.hasOwnProperty.call(message, "estimatedExecutionCount")) + writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.estimatedExecutionCount); + return writer; + }; + + /** + * Encodes the specified FieldStat message, length delimited. Does not implicitly {@link FieldStat.verify|verify} messages. + * @function encodeDelimited + * @memberof FieldStat + * @static + * @param {IFieldStat} message FieldStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldStat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldStat message from the specified reader or buffer. + * @function decode + * @memberof FieldStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {FieldStat} FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldStat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.FieldStat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.returnType = reader.string(); + break; + case 4: + message.errorsCount = reader.uint64(); + break; + case 5: + message.observedExecutionCount = reader.uint64(); + break; + case 10: + message.estimatedExecutionCount = reader.uint64(); + break; + case 6: + message.requestsWithErrorsCount = reader.uint64(); + break; + case 9: + if (!(message.latencyCount && message.latencyCount.length)) + message.latencyCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.latencyCount.push(reader.sint64()); + } else + message.latencyCount.push(reader.sint64()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldStat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof FieldStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {FieldStat} FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldStat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldStat message. + * @function verify + * @memberof FieldStat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldStat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.returnType != null && message.hasOwnProperty("returnType")) + if (!$util.isString(message.returnType)) + return "returnType: string expected"; + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (!$util.isInteger(message.errorsCount) && !(message.errorsCount && $util.isInteger(message.errorsCount.low) && $util.isInteger(message.errorsCount.high))) + return "errorsCount: integer|Long expected"; + if (message.observedExecutionCount != null && message.hasOwnProperty("observedExecutionCount")) + if (!$util.isInteger(message.observedExecutionCount) && !(message.observedExecutionCount && $util.isInteger(message.observedExecutionCount.low) && $util.isInteger(message.observedExecutionCount.high))) + return "observedExecutionCount: integer|Long expected"; + if (message.estimatedExecutionCount != null && message.hasOwnProperty("estimatedExecutionCount")) + if (!$util.isInteger(message.estimatedExecutionCount) && !(message.estimatedExecutionCount && $util.isInteger(message.estimatedExecutionCount.low) && $util.isInteger(message.estimatedExecutionCount.high))) + return "estimatedExecutionCount: integer|Long expected"; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high))) + return "requestsWithErrorsCount: integer|Long expected"; + if (message.latencyCount != null && message.hasOwnProperty("latencyCount")) { + var array9; + if (message.latencyCount != null && message.latencyCount.toArray) + array9 = message.latencyCount.toArray(); + else + array9 = message.latencyCount; + if (!Array.isArray(array9)) + return "latencyCount: array expected"; + for (var i = 0; i < array9.length; ++i) + if (!$util.isInteger(array9[i]) && !(array9[i] && $util.isInteger(array9[i].low) && $util.isInteger(array9[i].high))) + return "latencyCount: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a plain object from a FieldStat message. Also converts values to other types if specified. + * @function toObject + * @memberof FieldStat + * @static + * @param {FieldStat} message FieldStat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldStat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.latencyCount = []; + if (options.defaults) { + object.returnType = ""; + object.errorsCount = 0; + object.observedExecutionCount = 0; + object.requestsWithErrorsCount = 0; + object.estimatedExecutionCount = 0; + } + if (message.returnType != null && message.hasOwnProperty("returnType")) + object.returnType = message.returnType; + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (typeof message.errorsCount === "number") + object.errorsCount = options.longs === String ? String(message.errorsCount) : message.errorsCount; + else + object.errorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorsCount) : options.longs === Number ? new $util.LongBits(message.errorsCount.low >>> 0, message.errorsCount.high >>> 0).toNumber(true) : message.errorsCount; + if (message.observedExecutionCount != null && message.hasOwnProperty("observedExecutionCount")) + if (typeof message.observedExecutionCount === "number") + object.observedExecutionCount = options.longs === String ? String(message.observedExecutionCount) : message.observedExecutionCount; + else + object.observedExecutionCount = options.longs === String ? $util.Long.prototype.toString.call(message.observedExecutionCount) : options.longs === Number ? new $util.LongBits(message.observedExecutionCount.low >>> 0, message.observedExecutionCount.high >>> 0).toNumber(true) : message.observedExecutionCount; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (typeof message.requestsWithErrorsCount === "number") + object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount; + else + object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount; + if (message.latencyCount && message.latencyCount.length) { + object.latencyCount = []; + for (var j = 0; j < message.latencyCount.length; ++j) + if (typeof message.latencyCount[j] === "number") + object.latencyCount[j] = options.longs === String ? String(message.latencyCount[j]) : message.latencyCount[j]; + else + object.latencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.latencyCount[j]) : options.longs === Number ? new $util.LongBits(message.latencyCount[j].low >>> 0, message.latencyCount[j].high >>> 0).toNumber() : message.latencyCount[j]; + } + if (message.estimatedExecutionCount != null && message.hasOwnProperty("estimatedExecutionCount")) + if (typeof message.estimatedExecutionCount === "number") + object.estimatedExecutionCount = options.longs === String ? String(message.estimatedExecutionCount) : message.estimatedExecutionCount; + else + object.estimatedExecutionCount = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedExecutionCount) : options.longs === Number ? new $util.LongBits(message.estimatedExecutionCount.low >>> 0, message.estimatedExecutionCount.high >>> 0).toNumber(true) : message.estimatedExecutionCount; + return object; + }; + + /** + * Converts this FieldStat to JSON. + * @function toJSON + * @memberof FieldStat + * @instance + * @returns {Object.} JSON object + */ + FieldStat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldStat; +})(); + +$root.TypeStat = (function() { + + /** + * Properties of a TypeStat. + * @exports ITypeStat + * @interface ITypeStat + * @property {Object.|null} [perFieldStat] TypeStat perFieldStat + */ + + /** + * Constructs a new TypeStat. + * @exports TypeStat + * @classdesc Represents a TypeStat. + * @implements ITypeStat + * @constructor + * @param {ITypeStat=} [properties] Properties to set + */ + function TypeStat(properties) { + this.perFieldStat = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypeStat perFieldStat. + * @member {Object.} perFieldStat + * @memberof TypeStat + * @instance + */ + TypeStat.prototype.perFieldStat = $util.emptyObject; + + /** + * Creates a new TypeStat instance using the specified properties. + * @function create + * @memberof TypeStat + * @static + * @param {ITypeStat=} [properties] Properties to set + * @returns {TypeStat} TypeStat instance + */ + TypeStat.create = function create(properties) { + return new TypeStat(properties); + }; + + /** + * Encodes the specified TypeStat message. Does not implicitly {@link TypeStat.verify|verify} messages. + * @function encode + * @memberof TypeStat + * @static + * @param {ITypeStat} message TypeStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeStat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.perFieldStat != null && Object.hasOwnProperty.call(message, "perFieldStat")) + for (var keys = Object.keys(message.perFieldStat), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.FieldStat.encode(message.perFieldStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TypeStat message, length delimited. Does not implicitly {@link TypeStat.verify|verify} messages. + * @function encodeDelimited + * @memberof TypeStat + * @static + * @param {ITypeStat} message TypeStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeStat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeStat message from the specified reader or buffer. + * @function decode + * @memberof TypeStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {TypeStat} TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeStat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TypeStat(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + reader.skip().pos++; + if (message.perFieldStat === $util.emptyObject) + message.perFieldStat = {}; + key = reader.string(); + reader.pos++; + message.perFieldStat[key] = $root.FieldStat.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TypeStat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof TypeStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {TypeStat} TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeStat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeStat message. + * @function verify + * @memberof TypeStat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeStat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.perFieldStat != null && message.hasOwnProperty("perFieldStat")) { + if (!$util.isObject(message.perFieldStat)) + return "perFieldStat: object expected"; + var key = Object.keys(message.perFieldStat); + for (var i = 0; i < key.length; ++i) { + var error = $root.FieldStat.verify(message.perFieldStat[key[i]]); + if (error) + return "perFieldStat." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a TypeStat message. Also converts values to other types if specified. + * @function toObject + * @memberof TypeStat + * @static + * @param {TypeStat} message TypeStat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeStat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.perFieldStat = {}; + var keys2; + if (message.perFieldStat && (keys2 = Object.keys(message.perFieldStat)).length) { + object.perFieldStat = {}; + for (var j = 0; j < keys2.length; ++j) + object.perFieldStat[keys2[j]] = $root.FieldStat.toObject(message.perFieldStat[keys2[j]], options); + } + return object; + }; + + /** + * Converts this TypeStat to JSON. + * @function toJSON + * @memberof TypeStat + * @instance + * @returns {Object.} JSON object + */ + TypeStat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TypeStat; +})(); + +$root.ReferencedFieldsForType = (function() { + + /** + * Properties of a ReferencedFieldsForType. + * @exports IReferencedFieldsForType + * @interface IReferencedFieldsForType + * @property {Array.|null} [fieldNames] ReferencedFieldsForType fieldNames + * @property {boolean|null} [isInterface] ReferencedFieldsForType isInterface + */ + + /** + * Constructs a new ReferencedFieldsForType. + * @exports ReferencedFieldsForType + * @classdesc Represents a ReferencedFieldsForType. + * @implements IReferencedFieldsForType + * @constructor + * @param {IReferencedFieldsForType=} [properties] Properties to set + */ + function ReferencedFieldsForType(properties) { + this.fieldNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReferencedFieldsForType fieldNames. + * @member {Array.} fieldNames + * @memberof ReferencedFieldsForType + * @instance + */ + ReferencedFieldsForType.prototype.fieldNames = $util.emptyArray; + + /** + * ReferencedFieldsForType isInterface. + * @member {boolean} isInterface + * @memberof ReferencedFieldsForType + * @instance + */ + ReferencedFieldsForType.prototype.isInterface = false; + + /** + * Creates a new ReferencedFieldsForType instance using the specified properties. + * @function create + * @memberof ReferencedFieldsForType + * @static + * @param {IReferencedFieldsForType=} [properties] Properties to set + * @returns {ReferencedFieldsForType} ReferencedFieldsForType instance + */ + ReferencedFieldsForType.create = function create(properties) { + return new ReferencedFieldsForType(properties); + }; + + /** + * Encodes the specified ReferencedFieldsForType message. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @function encode + * @memberof ReferencedFieldsForType + * @static + * @param {IReferencedFieldsForType} message ReferencedFieldsForType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferencedFieldsForType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldNames != null && message.fieldNames.length) + for (var i = 0; i < message.fieldNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldNames[i]); + if (message.isInterface != null && Object.hasOwnProperty.call(message, "isInterface")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isInterface); + return writer; + }; + + /** + * Encodes the specified ReferencedFieldsForType message, length delimited. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @function encodeDelimited + * @memberof ReferencedFieldsForType + * @static + * @param {IReferencedFieldsForType} message ReferencedFieldsForType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferencedFieldsForType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer. + * @function decode + * @memberof ReferencedFieldsForType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ReferencedFieldsForType} ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferencedFieldsForType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ReferencedFieldsForType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.fieldNames && message.fieldNames.length)) + message.fieldNames = []; + message.fieldNames.push(reader.string()); + break; + case 2: + message.isInterface = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ReferencedFieldsForType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ReferencedFieldsForType} ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferencedFieldsForType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReferencedFieldsForType message. + * @function verify + * @memberof ReferencedFieldsForType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReferencedFieldsForType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldNames != null && message.hasOwnProperty("fieldNames")) { + if (!Array.isArray(message.fieldNames)) + return "fieldNames: array expected"; + for (var i = 0; i < message.fieldNames.length; ++i) + if (!$util.isString(message.fieldNames[i])) + return "fieldNames: string[] expected"; + } + if (message.isInterface != null && message.hasOwnProperty("isInterface")) + if (typeof message.isInterface !== "boolean") + return "isInterface: boolean expected"; + return null; + }; + + /** + * Creates a plain object from a ReferencedFieldsForType message. Also converts values to other types if specified. + * @function toObject + * @memberof ReferencedFieldsForType + * @static + * @param {ReferencedFieldsForType} message ReferencedFieldsForType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReferencedFieldsForType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fieldNames = []; + if (options.defaults) + object.isInterface = false; + if (message.fieldNames && message.fieldNames.length) { + object.fieldNames = []; + for (var j = 0; j < message.fieldNames.length; ++j) + object.fieldNames[j] = message.fieldNames[j]; + } + if (message.isInterface != null && message.hasOwnProperty("isInterface")) + object.isInterface = message.isInterface; + return object; + }; + + /** + * Converts this ReferencedFieldsForType to JSON. + * @function toJSON + * @memberof ReferencedFieldsForType + * @instance + * @returns {Object.} JSON object + */ + ReferencedFieldsForType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReferencedFieldsForType; +})(); + +$root.Report = (function() { + + /** + * Properties of a Report. + * @exports IReport + * @interface IReport + * @property {IReportHeader|null} [header] Report header + * @property {Object.|null} [tracesPerQuery] Report tracesPerQuery + * @property {google.protobuf.ITimestamp|null} [endTime] Report endTime + * @property {number|null} [operationCount] Report operationCount + * @property {boolean|null} [tracesPreAggregated] Report tracesPreAggregated + */ + + /** + * Constructs a new Report. + * @exports Report + * @classdesc Represents a Report. + * @implements IReport + * @constructor + * @param {IReport=} [properties] Properties to set + */ + function Report(properties) { + this.tracesPerQuery = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Report header. + * @member {IReportHeader|null|undefined} header + * @memberof Report + * @instance + */ + Report.prototype.header = null; + + /** + * Report tracesPerQuery. + * @member {Object.} tracesPerQuery + * @memberof Report + * @instance + */ + Report.prototype.tracesPerQuery = $util.emptyObject; + + /** + * Report endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof Report + * @instance + */ + Report.prototype.endTime = null; + + /** + * Report operationCount. + * @member {number} operationCount + * @memberof Report + * @instance + */ + Report.prototype.operationCount = 0; + + /** + * Report tracesPreAggregated. + * @member {boolean} tracesPreAggregated + * @memberof Report + * @instance + */ + Report.prototype.tracesPreAggregated = false; + + /** + * Creates a new Report instance using the specified properties. + * @function create + * @memberof Report + * @static + * @param {IReport=} [properties] Properties to set + * @returns {Report} Report instance + */ + Report.create = function create(properties) { + return new Report(properties); + }; + + /** + * Encodes the specified Report message. Does not implicitly {@link Report.verify|verify} messages. + * @function encode + * @memberof Report + * @static + * @param {IReport} message Report message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Report.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.ReportHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tracesPerQuery != null && Object.hasOwnProperty.call(message, "tracesPerQuery")) + for (var keys = Object.keys(message.tracesPerQuery), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.TracesAndStats.encode(message.tracesPerQuery[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.operationCount != null && Object.hasOwnProperty.call(message, "operationCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.operationCount); + if (message.tracesPreAggregated != null && Object.hasOwnProperty.call(message, "tracesPreAggregated")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.tracesPreAggregated); + return writer; + }; + + /** + * Encodes the specified Report message, length delimited. Does not implicitly {@link Report.verify|verify} messages. + * @function encodeDelimited + * @memberof Report + * @static + * @param {IReport} message Report message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Report.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Report message from the specified reader or buffer. + * @function decode + * @memberof Report + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Report} Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Report.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Report(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.ReportHeader.decode(reader, reader.uint32()); + break; + case 5: + reader.skip().pos++; + if (message.tracesPerQuery === $util.emptyObject) + message.tracesPerQuery = {}; + key = reader.string(); + reader.pos++; + message.tracesPerQuery[key] = $root.TracesAndStats.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.operationCount = reader.uint64(); + break; + case 7: + message.tracesPreAggregated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Report message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Report + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Report} Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Report.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Report message. + * @function verify + * @memberof Report + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Report.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.ReportHeader.verify(message.header); + if (error) + return "header." + error; + } + if (message.tracesPerQuery != null && message.hasOwnProperty("tracesPerQuery")) { + if (!$util.isObject(message.tracesPerQuery)) + return "tracesPerQuery: object expected"; + var key = Object.keys(message.tracesPerQuery); + for (var i = 0; i < key.length; ++i) { + var error = $root.TracesAndStats.verify(message.tracesPerQuery[key[i]]); + if (error) + return "tracesPerQuery." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.operationCount != null && message.hasOwnProperty("operationCount")) + if (!$util.isInteger(message.operationCount) && !(message.operationCount && $util.isInteger(message.operationCount.low) && $util.isInteger(message.operationCount.high))) + return "operationCount: integer|Long expected"; + if (message.tracesPreAggregated != null && message.hasOwnProperty("tracesPreAggregated")) + if (typeof message.tracesPreAggregated !== "boolean") + return "tracesPreAggregated: boolean expected"; + return null; + }; + + /** + * Creates a plain object from a Report message. Also converts values to other types if specified. + * @function toObject + * @memberof Report + * @static + * @param {Report} message Report + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Report.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.tracesPerQuery = {}; + if (options.defaults) { + object.header = null; + object.endTime = null; + object.operationCount = 0; + object.tracesPreAggregated = false; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.ReportHeader.toObject(message.header, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + var keys2; + if (message.tracesPerQuery && (keys2 = Object.keys(message.tracesPerQuery)).length) { + object.tracesPerQuery = {}; + for (var j = 0; j < keys2.length; ++j) + object.tracesPerQuery[keys2[j]] = $root.TracesAndStats.toObject(message.tracesPerQuery[keys2[j]], options); + } + if (message.operationCount != null && message.hasOwnProperty("operationCount")) + if (typeof message.operationCount === "number") + object.operationCount = options.longs === String ? String(message.operationCount) : message.operationCount; + else + object.operationCount = options.longs === String ? $util.Long.prototype.toString.call(message.operationCount) : options.longs === Number ? new $util.LongBits(message.operationCount.low >>> 0, message.operationCount.high >>> 0).toNumber(true) : message.operationCount; + if (message.tracesPreAggregated != null && message.hasOwnProperty("tracesPreAggregated")) + object.tracesPreAggregated = message.tracesPreAggregated; + return object; + }; + + /** + * Converts this Report to JSON. + * @function toJSON + * @memberof Report + * @instance + * @returns {Object.} JSON object + */ + Report.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Report; +})(); + +$root.ContextualizedStats = (function() { + + /** + * Properties of a ContextualizedStats. + * @exports IContextualizedStats + * @interface IContextualizedStats + * @property {IStatsContext|null} [context] ContextualizedStats context + * @property {IQueryLatencyStats|null} [queryLatencyStats] ContextualizedStats queryLatencyStats + * @property {Object.|null} [perTypeStat] ContextualizedStats perTypeStat + */ + + /** + * Constructs a new ContextualizedStats. + * @exports ContextualizedStats + * @classdesc Represents a ContextualizedStats. + * @implements IContextualizedStats + * @constructor + * @param {IContextualizedStats=} [properties] Properties to set + */ + function ContextualizedStats(properties) { + this.perTypeStat = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextualizedStats context. + * @member {IStatsContext|null|undefined} context + * @memberof ContextualizedStats + * @instance + */ + ContextualizedStats.prototype.context = null; + + /** + * ContextualizedStats queryLatencyStats. + * @member {IQueryLatencyStats|null|undefined} queryLatencyStats + * @memberof ContextualizedStats + * @instance + */ + ContextualizedStats.prototype.queryLatencyStats = null; + + /** + * ContextualizedStats perTypeStat. + * @member {Object.} perTypeStat + * @memberof ContextualizedStats + * @instance + */ + ContextualizedStats.prototype.perTypeStat = $util.emptyObject; + + /** + * Creates a new ContextualizedStats instance using the specified properties. + * @function create + * @memberof ContextualizedStats + * @static + * @param {IContextualizedStats=} [properties] Properties to set + * @returns {ContextualizedStats} ContextualizedStats instance + */ + ContextualizedStats.create = function create(properties) { + return new ContextualizedStats(properties); + }; + + /** + * Encodes the specified ContextualizedStats message. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @function encode + * @memberof ContextualizedStats + * @static + * @param {IContextualizedStats} message ContextualizedStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.StatsContext.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryLatencyStats != null && Object.hasOwnProperty.call(message, "queryLatencyStats")) + $root.QueryLatencyStats.encode(message.queryLatencyStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.perTypeStat != null && Object.hasOwnProperty.call(message, "perTypeStat")) + for (var keys = Object.keys(message.perTypeStat), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.TypeStat.encode(message.perTypeStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ContextualizedStats message, length delimited. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @function encodeDelimited + * @memberof ContextualizedStats + * @static + * @param {IContextualizedStats} message ContextualizedStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer. + * @function decode + * @memberof ContextualizedStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ContextualizedStats} ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedStats(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.context = $root.StatsContext.decode(reader, reader.uint32()); + break; + case 2: + message.queryLatencyStats = $root.QueryLatencyStats.decode(reader, reader.uint32()); + break; + case 3: + reader.skip().pos++; + if (message.perTypeStat === $util.emptyObject) + message.perTypeStat = {}; + key = reader.string(); + reader.pos++; + message.perTypeStat[key] = $root.TypeStat.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ContextualizedStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ContextualizedStats} ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualizedStats message. + * @function verify + * @memberof ContextualizedStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualizedStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.StatsContext.verify(message.context); + if (error) + return "context." + error; + } + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) { + var error = $root.QueryLatencyStats.verify(message.queryLatencyStats); + if (error) + return "queryLatencyStats." + error; + } + if (message.perTypeStat != null && message.hasOwnProperty("perTypeStat")) { + if (!$util.isObject(message.perTypeStat)) + return "perTypeStat: object expected"; + var key = Object.keys(message.perTypeStat); + for (var i = 0; i < key.length; ++i) { + var error = $root.TypeStat.verify(message.perTypeStat[key[i]]); + if (error) + return "perTypeStat." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a ContextualizedStats message. Also converts values to other types if specified. + * @function toObject + * @memberof ContextualizedStats + * @static + * @param {ContextualizedStats} message ContextualizedStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualizedStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.perTypeStat = {}; + if (options.defaults) { + object.context = null; + object.queryLatencyStats = null; + } + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.StatsContext.toObject(message.context, options); + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) + object.queryLatencyStats = $root.QueryLatencyStats.toObject(message.queryLatencyStats, options); + var keys2; + if (message.perTypeStat && (keys2 = Object.keys(message.perTypeStat)).length) { + object.perTypeStat = {}; + for (var j = 0; j < keys2.length; ++j) + object.perTypeStat[keys2[j]] = $root.TypeStat.toObject(message.perTypeStat[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ContextualizedStats to JSON. + * @function toJSON + * @memberof ContextualizedStats + * @instance + * @returns {Object.} JSON object + */ + ContextualizedStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContextualizedStats; +})(); + +$root.TracesAndStats = (function() { + + /** + * Properties of a TracesAndStats. + * @exports ITracesAndStats + * @interface ITracesAndStats + * @property {Array.|null} [trace] TracesAndStats trace + * @property {$protobuf.ToArray.|Array.|null} [statsWithContext] TracesAndStats statsWithContext + * @property {Object.|null} [referencedFieldsByType] TracesAndStats referencedFieldsByType + * @property {Array.|null} [internalTracesContributingToStats] TracesAndStats internalTracesContributingToStats + */ + + /** + * Constructs a new TracesAndStats. + * @exports TracesAndStats + * @classdesc Represents a TracesAndStats. + * @implements ITracesAndStats + * @constructor + * @param {ITracesAndStats=} [properties] Properties to set + */ + function TracesAndStats(properties) { + this.trace = []; + this.statsWithContext = []; + this.referencedFieldsByType = {}; + this.internalTracesContributingToStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TracesAndStats trace. + * @member {Array.} trace + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.trace = $util.emptyArray; + + /** + * TracesAndStats statsWithContext. + * @member {Array.} statsWithContext + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.statsWithContext = $util.emptyArray; + + /** + * TracesAndStats referencedFieldsByType. + * @member {Object.} referencedFieldsByType + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.referencedFieldsByType = $util.emptyObject; + + /** + * TracesAndStats internalTracesContributingToStats. + * @member {Array.} internalTracesContributingToStats + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.internalTracesContributingToStats = $util.emptyArray; + + /** + * Creates a new TracesAndStats instance using the specified properties. + * @function create + * @memberof TracesAndStats + * @static + * @param {ITracesAndStats=} [properties] Properties to set + * @returns {TracesAndStats} TracesAndStats instance + */ + TracesAndStats.create = function create(properties) { + return new TracesAndStats(properties); + }; + + /** + * Encodes the specified TracesAndStats message. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @function encode + * @memberof TracesAndStats + * @static + * @param {ITracesAndStats} message TracesAndStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TracesAndStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trace != null && message.trace.length) + for (var i = 0; i < message.trace.length; ++i) + if (message.trace[i] instanceof Uint8Array) { + writer.uint32(/* id 1, wireType 2 =*/10); + writer.bytes(message.trace[i]); + } else + $root.Trace.encode(message.trace[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + var array2; + if (message.statsWithContext != null && message.statsWithContext.toArray) + array2 = message.statsWithContext.toArray(); + else + array2 = message.statsWithContext; + if (array2 != null && array2.length) + for (var i = 0; i < array2.length; ++i) + $root.ContextualizedStats.encode(array2[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.internalTracesContributingToStats != null && message.internalTracesContributingToStats.length) + for (var i = 0; i < message.internalTracesContributingToStats.length; ++i) + if (message.internalTracesContributingToStats[i] instanceof Uint8Array) { + writer.uint32(/* id 3, wireType 2 =*/26); + writer.bytes(message.internalTracesContributingToStats[i]); + } else + $root.Trace.encode(message.internalTracesContributingToStats[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.referencedFieldsByType != null && Object.hasOwnProperty.call(message, "referencedFieldsByType")) + for (var keys = Object.keys(message.referencedFieldsByType), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.ReferencedFieldsForType.encode(message.referencedFieldsByType[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TracesAndStats message, length delimited. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @function encodeDelimited + * @memberof TracesAndStats + * @static + * @param {ITracesAndStats} message TracesAndStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TracesAndStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer. + * @function decode + * @memberof TracesAndStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {TracesAndStats} TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TracesAndStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TracesAndStats(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.trace && message.trace.length)) + message.trace = []; + message.trace.push($root.Trace.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.statsWithContext && message.statsWithContext.length)) + message.statsWithContext = []; + message.statsWithContext.push($root.ContextualizedStats.decode(reader, reader.uint32())); + break; + case 4: + reader.skip().pos++; + if (message.referencedFieldsByType === $util.emptyObject) + message.referencedFieldsByType = {}; + key = reader.string(); + reader.pos++; + message.referencedFieldsByType[key] = $root.ReferencedFieldsForType.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.internalTracesContributingToStats && message.internalTracesContributingToStats.length)) + message.internalTracesContributingToStats = []; + message.internalTracesContributingToStats.push($root.Trace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof TracesAndStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {TracesAndStats} TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TracesAndStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TracesAndStats message. + * @function verify + * @memberof TracesAndStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TracesAndStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trace != null && message.hasOwnProperty("trace")) { + if (!Array.isArray(message.trace)) + return "trace: array expected"; + for (var i = 0; i < message.trace.length; ++i) + if (!(message.trace[i] instanceof Uint8Array)) { + var error = $root.Trace.verify(message.trace[i]); + if (error) + return "trace." + error; + } + } + if (message.statsWithContext != null && message.hasOwnProperty("statsWithContext")) { + var array2; + if (message.statsWithContext != null && message.statsWithContext.toArray) + array2 = message.statsWithContext.toArray(); + else + array2 = message.statsWithContext; + if (!Array.isArray(array2)) + return "statsWithContext: array expected"; + for (var i = 0; i < array2.length; ++i) { + var error = $root.ContextualizedStats.verify(array2[i]); + if (error) + return "statsWithContext." + error; + } + } + if (message.referencedFieldsByType != null && message.hasOwnProperty("referencedFieldsByType")) { + if (!$util.isObject(message.referencedFieldsByType)) + return "referencedFieldsByType: object expected"; + var key = Object.keys(message.referencedFieldsByType); + for (var i = 0; i < key.length; ++i) { + var error = $root.ReferencedFieldsForType.verify(message.referencedFieldsByType[key[i]]); + if (error) + return "referencedFieldsByType." + error; + } + } + if (message.internalTracesContributingToStats != null && message.hasOwnProperty("internalTracesContributingToStats")) { + if (!Array.isArray(message.internalTracesContributingToStats)) + return "internalTracesContributingToStats: array expected"; + for (var i = 0; i < message.internalTracesContributingToStats.length; ++i) + if (!(message.internalTracesContributingToStats[i] instanceof Uint8Array)) { + var error = $root.Trace.verify(message.internalTracesContributingToStats[i]); + if (error) + return "internalTracesContributingToStats." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a TracesAndStats message. Also converts values to other types if specified. + * @function toObject + * @memberof TracesAndStats + * @static + * @param {TracesAndStats} message TracesAndStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TracesAndStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.trace = []; + object.statsWithContext = []; + object.internalTracesContributingToStats = []; + } + if (options.objects || options.defaults) + object.referencedFieldsByType = {}; + if (message.trace && message.trace.length) { + object.trace = []; + for (var j = 0; j < message.trace.length; ++j) + object.trace[j] = $root.Trace.toObject(message.trace[j], options); + } + if (message.statsWithContext && message.statsWithContext.length) { + object.statsWithContext = []; + for (var j = 0; j < message.statsWithContext.length; ++j) + object.statsWithContext[j] = $root.ContextualizedStats.toObject(message.statsWithContext[j], options); + } + if (message.internalTracesContributingToStats && message.internalTracesContributingToStats.length) { + object.internalTracesContributingToStats = []; + for (var j = 0; j < message.internalTracesContributingToStats.length; ++j) + object.internalTracesContributingToStats[j] = $root.Trace.toObject(message.internalTracesContributingToStats[j], options); + } + var keys2; + if (message.referencedFieldsByType && (keys2 = Object.keys(message.referencedFieldsByType)).length) { + object.referencedFieldsByType = {}; + for (var j = 0; j < keys2.length; ++j) + object.referencedFieldsByType[keys2[j]] = $root.ReferencedFieldsForType.toObject(message.referencedFieldsByType[keys2[j]], options); + } + return object; + }; + + /** + * Converts this TracesAndStats to JSON. + * @function toJSON + * @memberof TracesAndStats + * @instance + * @returns {Object.} JSON object + */ + TracesAndStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TracesAndStats; +})(); + +$root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.seconds = 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + return google; +})(); + +module.exports = $root; diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/package.json b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/package.json new file mode 100644 index 00000000..7c34deb5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.d.ts b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.d.ts new file mode 100644 index 00000000..1329e390 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.d.ts @@ -0,0 +1,3276 @@ +import * as $protobuf from "@apollo/protobufjs"; +/** Properties of a Trace. */ +export interface ITrace { + + /** Trace startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Trace endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Trace durationNs */ + durationNs?: (number|null); + + /** Trace root */ + root?: (Trace.INode|null); + + /** Trace isIncomplete */ + isIncomplete?: (boolean|null); + + /** Trace signature */ + signature?: (string|null); + + /** Trace unexecutedOperationBody */ + unexecutedOperationBody?: (string|null); + + /** Trace unexecutedOperationName */ + unexecutedOperationName?: (string|null); + + /** Trace details */ + details?: (Trace.IDetails|null); + + /** Trace clientName */ + clientName?: (string|null); + + /** Trace clientVersion */ + clientVersion?: (string|null); + + /** Trace http */ + http?: (Trace.IHTTP|null); + + /** Trace cachePolicy */ + cachePolicy?: (Trace.ICachePolicy|null); + + /** Trace queryPlan */ + queryPlan?: (Trace.IQueryPlanNode|null); + + /** Trace fullQueryCacheHit */ + fullQueryCacheHit?: (boolean|null); + + /** Trace persistedQueryHit */ + persistedQueryHit?: (boolean|null); + + /** Trace persistedQueryRegister */ + persistedQueryRegister?: (boolean|null); + + /** Trace registeredOperation */ + registeredOperation?: (boolean|null); + + /** Trace forbiddenOperation */ + forbiddenOperation?: (boolean|null); + + /** Trace fieldExecutionWeight */ + fieldExecutionWeight?: (number|null); +} + +/** Represents a Trace. */ +export class Trace implements ITrace { + + /** + * Constructs a new Trace. + * @param [properties] Properties to set + */ + constructor(properties?: ITrace); + + /** Trace startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Trace endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Trace durationNs. */ + public durationNs: number; + + /** Trace root. */ + public root?: (Trace.INode|null); + + /** Trace isIncomplete. */ + public isIncomplete: boolean; + + /** Trace signature. */ + public signature: string; + + /** Trace unexecutedOperationBody. */ + public unexecutedOperationBody: string; + + /** Trace unexecutedOperationName. */ + public unexecutedOperationName: string; + + /** Trace details. */ + public details?: (Trace.IDetails|null); + + /** Trace clientName. */ + public clientName: string; + + /** Trace clientVersion. */ + public clientVersion: string; + + /** Trace http. */ + public http?: (Trace.IHTTP|null); + + /** Trace cachePolicy. */ + public cachePolicy?: (Trace.ICachePolicy|null); + + /** Trace queryPlan. */ + public queryPlan?: (Trace.IQueryPlanNode|null); + + /** Trace fullQueryCacheHit. */ + public fullQueryCacheHit: boolean; + + /** Trace persistedQueryHit. */ + public persistedQueryHit: boolean; + + /** Trace persistedQueryRegister. */ + public persistedQueryRegister: boolean; + + /** Trace registeredOperation. */ + public registeredOperation: boolean; + + /** Trace forbiddenOperation. */ + public forbiddenOperation: boolean; + + /** Trace fieldExecutionWeight. */ + public fieldExecutionWeight: number; + + /** + * Creates a new Trace instance using the specified properties. + * @param [properties] Properties to set + * @returns Trace instance + */ + public static create(properties?: ITrace): Trace; + + /** + * Encodes the specified Trace message. Does not implicitly {@link Trace.verify|verify} messages. + * @param message Trace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ITrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Trace message, length delimited. Does not implicitly {@link Trace.verify|verify} messages. + * @param message Trace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ITrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Trace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace; + + /** + * Decodes a Trace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace; + + /** + * Verifies a Trace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Trace message. Also converts values to other types if specified. + * @param message Trace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Trace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +export namespace Trace { + + /** Properties of a CachePolicy. */ + interface ICachePolicy { + + /** CachePolicy scope */ + scope?: (Trace.CachePolicy.Scope|null); + + /** CachePolicy maxAgeNs */ + maxAgeNs?: (number|null); + } + + /** Represents a CachePolicy. */ + class CachePolicy implements ICachePolicy { + + /** + * Constructs a new CachePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.ICachePolicy); + + /** CachePolicy scope. */ + public scope: Trace.CachePolicy.Scope; + + /** CachePolicy maxAgeNs. */ + public maxAgeNs: number; + + /** + * Creates a new CachePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns CachePolicy instance + */ + public static create(properties?: Trace.ICachePolicy): Trace.CachePolicy; + + /** + * Encodes the specified CachePolicy message. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @param message CachePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.ICachePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CachePolicy message, length delimited. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @param message CachePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.ICachePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CachePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.CachePolicy; + + /** + * Decodes a CachePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.CachePolicy; + + /** + * Verifies a CachePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a CachePolicy message. Also converts values to other types if specified. + * @param message CachePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.CachePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CachePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CachePolicy { + + /** Scope enum. */ + enum Scope { + UNKNOWN = 0, + PUBLIC = 1, + PRIVATE = 2 + } + } + + /** Properties of a Details. */ + interface IDetails { + + /** Details variablesJson */ + variablesJson?: ({ [k: string]: string }|null); + + /** Details operationName */ + operationName?: (string|null); + } + + /** Represents a Details. */ + class Details implements IDetails { + + /** + * Constructs a new Details. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IDetails); + + /** Details variablesJson. */ + public variablesJson: { [k: string]: string }; + + /** Details operationName. */ + public operationName: string; + + /** + * Creates a new Details instance using the specified properties. + * @param [properties] Properties to set + * @returns Details instance + */ + public static create(properties?: Trace.IDetails): Trace.Details; + + /** + * Encodes the specified Details message. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Details message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Details; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Details; + + /** + * Verifies a Details message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @param message Details + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Details, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Details to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Error. */ + interface IError { + + /** Error message */ + message?: (string|null); + + /** Error location */ + location?: (Trace.ILocation[]|null); + + /** Error timeNs */ + timeNs?: (number|null); + + /** Error json */ + json?: (string|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IError); + + /** Error message. */ + public message: string; + + /** Error location. */ + public location: Trace.ILocation[]; + + /** Error timeNs. */ + public timeNs: number; + + /** Error json. */ + public json: string; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: Trace.IError): Trace.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Error; + + /** + * Verifies an Error message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HTTP. */ + interface IHTTP { + + /** HTTP method */ + method?: (Trace.HTTP.Method|null); + + /** HTTP requestHeaders */ + requestHeaders?: ({ [k: string]: Trace.HTTP.IValues }|null); + + /** HTTP responseHeaders */ + responseHeaders?: ({ [k: string]: Trace.HTTP.IValues }|null); + + /** HTTP statusCode */ + statusCode?: (number|null); + } + + /** Represents a HTTP. */ + class HTTP implements IHTTP { + + /** + * Constructs a new HTTP. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IHTTP); + + /** HTTP method. */ + public method: Trace.HTTP.Method; + + /** HTTP requestHeaders. */ + public requestHeaders: { [k: string]: Trace.HTTP.IValues }; + + /** HTTP responseHeaders. */ + public responseHeaders: { [k: string]: Trace.HTTP.IValues }; + + /** HTTP statusCode. */ + public statusCode: number; + + /** + * Creates a new HTTP instance using the specified properties. + * @param [properties] Properties to set + * @returns HTTP instance + */ + public static create(properties?: Trace.IHTTP): Trace.HTTP; + + /** + * Encodes the specified HTTP message. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @param message HTTP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IHTTP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HTTP message, length delimited. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @param message HTTP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IHTTP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HTTP message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.HTTP; + + /** + * Decodes a HTTP message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.HTTP; + + /** + * Verifies a HTTP message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a HTTP message. Also converts values to other types if specified. + * @param message HTTP + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.HTTP, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HTTP to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HTTP { + + /** Properties of a Values. */ + interface IValues { + + /** Values value */ + value?: (string[]|null); + } + + /** Represents a Values. */ + class Values implements IValues { + + /** + * Constructs a new Values. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.HTTP.IValues); + + /** Values value. */ + public value: string[]; + + /** + * Creates a new Values instance using the specified properties. + * @param [properties] Properties to set + * @returns Values instance + */ + public static create(properties?: Trace.HTTP.IValues): Trace.HTTP.Values; + + /** + * Encodes the specified Values message. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @param message Values message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.HTTP.IValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Values message, length delimited. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @param message Values message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.HTTP.IValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Values message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.HTTP.Values; + + /** + * Decodes a Values message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.HTTP.Values; + + /** + * Verifies a Values message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Values message. Also converts values to other types if specified. + * @param message Values + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.HTTP.Values, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Values to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Method enum. */ + enum Method { + UNKNOWN = 0, + OPTIONS = 1, + GET = 2, + HEAD = 3, + POST = 4, + PUT = 5, + DELETE = 6, + TRACE = 7, + CONNECT = 8, + PATCH = 9 + } + } + + /** Properties of a Location. */ + interface ILocation { + + /** Location line */ + line?: (number|null); + + /** Location column */ + column?: (number|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.ILocation); + + /** Location line. */ + public line: number; + + /** Location column. */ + public column: number; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: Trace.ILocation): Trace.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Node. */ + interface INode { + + /** Node responseName */ + responseName?: (string|null); + + /** Node index */ + index?: (number|null); + + /** Node originalFieldName */ + originalFieldName?: (string|null); + + /** Node type */ + type?: (string|null); + + /** Node parentType */ + parentType?: (string|null); + + /** Node cachePolicy */ + cachePolicy?: (Trace.ICachePolicy|null); + + /** Node startTime */ + startTime?: (number|null); + + /** Node endTime */ + endTime?: (number|null); + + /** Node error */ + error?: (Trace.IError[]|null); + + /** Node child */ + child?: (Trace.INode[]|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.INode); + + /** Node responseName. */ + public responseName: string; + + /** Node index. */ + public index: number; + + /** Node originalFieldName. */ + public originalFieldName: string; + + /** Node type. */ + public type: string; + + /** Node parentType. */ + public parentType: string; + + /** Node cachePolicy. */ + public cachePolicy?: (Trace.ICachePolicy|null); + + /** Node startTime. */ + public startTime: number; + + /** Node endTime. */ + public endTime: number; + + /** Node error. */ + public error: Trace.IError[]; + + /** Node child. */ + public child: Trace.INode[]; + + /** Node id. */ + public id?: ("responseName"|"index"); + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: Trace.INode): Trace.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QueryPlanNode. */ + interface IQueryPlanNode { + + /** QueryPlanNode sequence */ + sequence?: (Trace.QueryPlanNode.ISequenceNode|null); + + /** QueryPlanNode parallel */ + parallel?: (Trace.QueryPlanNode.IParallelNode|null); + + /** QueryPlanNode fetch */ + fetch?: (Trace.QueryPlanNode.IFetchNode|null); + + /** QueryPlanNode flatten */ + flatten?: (Trace.QueryPlanNode.IFlattenNode|null); + + /** QueryPlanNode defer */ + defer?: (Trace.QueryPlanNode.IDeferNode|null); + + /** QueryPlanNode condition */ + condition?: (Trace.QueryPlanNode.IConditionNode|null); + } + + /** Represents a QueryPlanNode. */ + class QueryPlanNode implements IQueryPlanNode { + + /** + * Constructs a new QueryPlanNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.IQueryPlanNode); + + /** QueryPlanNode sequence. */ + public sequence?: (Trace.QueryPlanNode.ISequenceNode|null); + + /** QueryPlanNode parallel. */ + public parallel?: (Trace.QueryPlanNode.IParallelNode|null); + + /** QueryPlanNode fetch. */ + public fetch?: (Trace.QueryPlanNode.IFetchNode|null); + + /** QueryPlanNode flatten. */ + public flatten?: (Trace.QueryPlanNode.IFlattenNode|null); + + /** QueryPlanNode defer. */ + public defer?: (Trace.QueryPlanNode.IDeferNode|null); + + /** QueryPlanNode condition. */ + public condition?: (Trace.QueryPlanNode.IConditionNode|null); + + /** QueryPlanNode node. */ + public node?: ("sequence"|"parallel"|"fetch"|"flatten"|"defer"|"condition"); + + /** + * Creates a new QueryPlanNode instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryPlanNode instance + */ + public static create(properties?: Trace.IQueryPlanNode): Trace.QueryPlanNode; + + /** + * Encodes the specified QueryPlanNode message. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @param message QueryPlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.IQueryPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryPlanNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @param message QueryPlanNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.IQueryPlanNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode; + + /** + * Verifies a QueryPlanNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a QueryPlanNode message. Also converts values to other types if specified. + * @param message QueryPlanNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryPlanNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace QueryPlanNode { + + /** Properties of a SequenceNode. */ + interface ISequenceNode { + + /** SequenceNode nodes */ + nodes?: (Trace.IQueryPlanNode[]|null); + } + + /** Represents a SequenceNode. */ + class SequenceNode implements ISequenceNode { + + /** + * Constructs a new SequenceNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.ISequenceNode); + + /** SequenceNode nodes. */ + public nodes: Trace.IQueryPlanNode[]; + + /** + * Creates a new SequenceNode instance using the specified properties. + * @param [properties] Properties to set + * @returns SequenceNode instance + */ + public static create(properties?: Trace.QueryPlanNode.ISequenceNode): Trace.QueryPlanNode.SequenceNode; + + /** + * Encodes the specified SequenceNode message. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @param message SequenceNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.ISequenceNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SequenceNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @param message SequenceNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.ISequenceNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SequenceNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.SequenceNode; + + /** + * Decodes a SequenceNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.SequenceNode; + + /** + * Verifies a SequenceNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a SequenceNode message. Also converts values to other types if specified. + * @param message SequenceNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.SequenceNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SequenceNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ParallelNode. */ + interface IParallelNode { + + /** ParallelNode nodes */ + nodes?: (Trace.IQueryPlanNode[]|null); + } + + /** Represents a ParallelNode. */ + class ParallelNode implements IParallelNode { + + /** + * Constructs a new ParallelNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IParallelNode); + + /** ParallelNode nodes. */ + public nodes: Trace.IQueryPlanNode[]; + + /** + * Creates a new ParallelNode instance using the specified properties. + * @param [properties] Properties to set + * @returns ParallelNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IParallelNode): Trace.QueryPlanNode.ParallelNode; + + /** + * Encodes the specified ParallelNode message. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @param message ParallelNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IParallelNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParallelNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @param message ParallelNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IParallelNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParallelNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.ParallelNode; + + /** + * Decodes a ParallelNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.ParallelNode; + + /** + * Verifies a ParallelNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ParallelNode message. Also converts values to other types if specified. + * @param message ParallelNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.ParallelNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParallelNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FetchNode. */ + interface IFetchNode { + + /** FetchNode serviceName */ + serviceName?: (string|null); + + /** FetchNode traceParsingFailed */ + traceParsingFailed?: (boolean|null); + + /** FetchNode trace */ + trace?: (ITrace|null); + + /** FetchNode sentTimeOffset */ + sentTimeOffset?: (number|null); + + /** FetchNode sentTime */ + sentTime?: (google.protobuf.ITimestamp|null); + + /** FetchNode receivedTime */ + receivedTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a FetchNode. */ + class FetchNode implements IFetchNode { + + /** + * Constructs a new FetchNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IFetchNode); + + /** FetchNode serviceName. */ + public serviceName: string; + + /** FetchNode traceParsingFailed. */ + public traceParsingFailed: boolean; + + /** FetchNode trace. */ + public trace?: (ITrace|null); + + /** FetchNode sentTimeOffset. */ + public sentTimeOffset: number; + + /** FetchNode sentTime. */ + public sentTime?: (google.protobuf.ITimestamp|null); + + /** FetchNode receivedTime. */ + public receivedTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new FetchNode instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IFetchNode): Trace.QueryPlanNode.FetchNode; + + /** + * Encodes the specified FetchNode message. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @param message FetchNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IFetchNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @param message FetchNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IFetchNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.FetchNode; + + /** + * Decodes a FetchNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.FetchNode; + + /** + * Verifies a FetchNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a FetchNode message. Also converts values to other types if specified. + * @param message FetchNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.FetchNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FlattenNode. */ + interface IFlattenNode { + + /** FlattenNode responsePath */ + responsePath?: (Trace.QueryPlanNode.IResponsePathElement[]|null); + + /** FlattenNode node */ + node?: (Trace.IQueryPlanNode|null); + } + + /** Represents a FlattenNode. */ + class FlattenNode implements IFlattenNode { + + /** + * Constructs a new FlattenNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IFlattenNode); + + /** FlattenNode responsePath. */ + public responsePath: Trace.QueryPlanNode.IResponsePathElement[]; + + /** FlattenNode node. */ + public node?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new FlattenNode instance using the specified properties. + * @param [properties] Properties to set + * @returns FlattenNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IFlattenNode): Trace.QueryPlanNode.FlattenNode; + + /** + * Encodes the specified FlattenNode message. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @param message FlattenNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IFlattenNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlattenNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @param message FlattenNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IFlattenNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlattenNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.FlattenNode; + + /** + * Decodes a FlattenNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.FlattenNode; + + /** + * Verifies a FlattenNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a FlattenNode message. Also converts values to other types if specified. + * @param message FlattenNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.FlattenNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlattenNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferNode. */ + interface IDeferNode { + + /** DeferNode primary */ + primary?: (Trace.QueryPlanNode.IDeferNodePrimary|null); + + /** DeferNode deferred */ + deferred?: (Trace.QueryPlanNode.IDeferredNode[]|null); + } + + /** Represents a DeferNode. */ + class DeferNode implements IDeferNode { + + /** + * Constructs a new DeferNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferNode); + + /** DeferNode primary. */ + public primary?: (Trace.QueryPlanNode.IDeferNodePrimary|null); + + /** DeferNode deferred. */ + public deferred: Trace.QueryPlanNode.IDeferredNode[]; + + /** + * Creates a new DeferNode instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferNode): Trace.QueryPlanNode.DeferNode; + + /** + * Encodes the specified DeferNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @param message DeferNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @param message DeferNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferNode; + + /** + * Decodes a DeferNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferNode; + + /** + * Verifies a DeferNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferNode message. Also converts values to other types if specified. + * @param message DeferNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConditionNode. */ + interface IConditionNode { + + /** ConditionNode condition */ + condition?: (string|null); + + /** ConditionNode ifClause */ + ifClause?: (Trace.IQueryPlanNode|null); + + /** ConditionNode elseClause */ + elseClause?: (Trace.IQueryPlanNode|null); + } + + /** Represents a ConditionNode. */ + class ConditionNode implements IConditionNode { + + /** + * Constructs a new ConditionNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IConditionNode); + + /** ConditionNode condition. */ + public condition: string; + + /** ConditionNode ifClause. */ + public ifClause?: (Trace.IQueryPlanNode|null); + + /** ConditionNode elseClause. */ + public elseClause?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new ConditionNode instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IConditionNode): Trace.QueryPlanNode.ConditionNode; + + /** + * Encodes the specified ConditionNode message. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @param message ConditionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IConditionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @param message ConditionNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IConditionNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.ConditionNode; + + /** + * Decodes a ConditionNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.ConditionNode; + + /** + * Verifies a ConditionNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ConditionNode message. Also converts values to other types if specified. + * @param message ConditionNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.ConditionNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferNodePrimary. */ + interface IDeferNodePrimary { + + /** DeferNodePrimary node */ + node?: (Trace.IQueryPlanNode|null); + } + + /** Represents a DeferNodePrimary. */ + class DeferNodePrimary implements IDeferNodePrimary { + + /** + * Constructs a new DeferNodePrimary. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferNodePrimary); + + /** DeferNodePrimary node. */ + public node?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new DeferNodePrimary instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferNodePrimary instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferNodePrimary): Trace.QueryPlanNode.DeferNodePrimary; + + /** + * Encodes the specified DeferNodePrimary message. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @param message DeferNodePrimary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferNodePrimary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferNodePrimary message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @param message DeferNodePrimary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferNodePrimary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferNodePrimary; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferNodePrimary; + + /** + * Verifies a DeferNodePrimary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferNodePrimary message. Also converts values to other types if specified. + * @param message DeferNodePrimary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferNodePrimary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferNodePrimary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferredNode. */ + interface IDeferredNode { + + /** DeferredNode depends */ + depends?: (Trace.QueryPlanNode.IDeferredNodeDepends[]|null); + + /** DeferredNode label */ + label?: (string|null); + + /** DeferredNode path */ + path?: (Trace.QueryPlanNode.IResponsePathElement[]|null); + + /** DeferredNode node */ + node?: (Trace.IQueryPlanNode|null); + } + + /** Represents a DeferredNode. */ + class DeferredNode implements IDeferredNode { + + /** + * Constructs a new DeferredNode. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferredNode); + + /** DeferredNode depends. */ + public depends: Trace.QueryPlanNode.IDeferredNodeDepends[]; + + /** DeferredNode label. */ + public label: string; + + /** DeferredNode path. */ + public path: Trace.QueryPlanNode.IResponsePathElement[]; + + /** DeferredNode node. */ + public node?: (Trace.IQueryPlanNode|null); + + /** + * Creates a new DeferredNode instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferredNode instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferredNode): Trace.QueryPlanNode.DeferredNode; + + /** + * Encodes the specified DeferredNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @param message DeferredNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferredNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferredNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @param message DeferredNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferredNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferredNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferredNode; + + /** + * Decodes a DeferredNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferredNode; + + /** + * Verifies a DeferredNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferredNode message. Also converts values to other types if specified. + * @param message DeferredNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferredNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferredNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeferredNodeDepends. */ + interface IDeferredNodeDepends { + + /** DeferredNodeDepends id */ + id?: (string|null); + + /** DeferredNodeDepends deferLabel */ + deferLabel?: (string|null); + } + + /** Represents a DeferredNodeDepends. */ + class DeferredNodeDepends implements IDeferredNodeDepends { + + /** + * Constructs a new DeferredNodeDepends. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IDeferredNodeDepends); + + /** DeferredNodeDepends id. */ + public id: string; + + /** DeferredNodeDepends deferLabel. */ + public deferLabel: string; + + /** + * Creates a new DeferredNodeDepends instance using the specified properties. + * @param [properties] Properties to set + * @returns DeferredNodeDepends instance + */ + public static create(properties?: Trace.QueryPlanNode.IDeferredNodeDepends): Trace.QueryPlanNode.DeferredNodeDepends; + + /** + * Encodes the specified DeferredNodeDepends message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @param message DeferredNodeDepends message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IDeferredNodeDepends, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeferredNodeDepends message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @param message DeferredNodeDepends message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IDeferredNodeDepends, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.DeferredNodeDepends; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.DeferredNodeDepends; + + /** + * Verifies a DeferredNodeDepends message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a DeferredNodeDepends message. Also converts values to other types if specified. + * @param message DeferredNodeDepends + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.DeferredNodeDepends, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeferredNodeDepends to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResponsePathElement. */ + interface IResponsePathElement { + + /** ResponsePathElement fieldName */ + fieldName?: (string|null); + + /** ResponsePathElement index */ + index?: (number|null); + } + + /** Represents a ResponsePathElement. */ + class ResponsePathElement implements IResponsePathElement { + + /** + * Constructs a new ResponsePathElement. + * @param [properties] Properties to set + */ + constructor(properties?: Trace.QueryPlanNode.IResponsePathElement); + + /** ResponsePathElement fieldName. */ + public fieldName: string; + + /** ResponsePathElement index. */ + public index: number; + + /** ResponsePathElement id. */ + public id?: ("fieldName"|"index"); + + /** + * Creates a new ResponsePathElement instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponsePathElement instance + */ + public static create(properties?: Trace.QueryPlanNode.IResponsePathElement): Trace.QueryPlanNode.ResponsePathElement; + + /** + * Encodes the specified ResponsePathElement message. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @param message ResponsePathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Trace.QueryPlanNode.IResponsePathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponsePathElement message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @param message ResponsePathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Trace.QueryPlanNode.IResponsePathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Trace.QueryPlanNode.ResponsePathElement; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Trace.QueryPlanNode.ResponsePathElement; + + /** + * Verifies a ResponsePathElement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ResponsePathElement message. Also converts values to other types if specified. + * @param message ResponsePathElement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Trace.QueryPlanNode.ResponsePathElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponsePathElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} + +/** Properties of a ReportHeader. */ +export interface IReportHeader { + + /** ReportHeader graphRef */ + graphRef?: (string|null); + + /** ReportHeader hostname */ + hostname?: (string|null); + + /** ReportHeader agentVersion */ + agentVersion?: (string|null); + + /** ReportHeader serviceVersion */ + serviceVersion?: (string|null); + + /** ReportHeader runtimeVersion */ + runtimeVersion?: (string|null); + + /** ReportHeader uname */ + uname?: (string|null); + + /** ReportHeader executableSchemaId */ + executableSchemaId?: (string|null); +} + +/** Represents a ReportHeader. */ +export class ReportHeader implements IReportHeader { + + /** + * Constructs a new ReportHeader. + * @param [properties] Properties to set + */ + constructor(properties?: IReportHeader); + + /** ReportHeader graphRef. */ + public graphRef: string; + + /** ReportHeader hostname. */ + public hostname: string; + + /** ReportHeader agentVersion. */ + public agentVersion: string; + + /** ReportHeader serviceVersion. */ + public serviceVersion: string; + + /** ReportHeader runtimeVersion. */ + public runtimeVersion: string; + + /** ReportHeader uname. */ + public uname: string; + + /** ReportHeader executableSchemaId. */ + public executableSchemaId: string; + + /** + * Creates a new ReportHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportHeader instance + */ + public static create(properties?: IReportHeader): ReportHeader; + + /** + * Encodes the specified ReportHeader message. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @param message ReportHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IReportHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportHeader message, length delimited. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @param message ReportHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IReportHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ReportHeader; + + /** + * Decodes a ReportHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ReportHeader; + + /** + * Verifies a ReportHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ReportHeader message. Also converts values to other types if specified. + * @param message ReportHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ReportHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a PathErrorStats. */ +export interface IPathErrorStats { + + /** PathErrorStats children */ + children?: ({ [k: string]: IPathErrorStats }|null); + + /** PathErrorStats errorsCount */ + errorsCount?: (number|null); + + /** PathErrorStats requestsWithErrorsCount */ + requestsWithErrorsCount?: (number|null); +} + +/** Represents a PathErrorStats. */ +export class PathErrorStats implements IPathErrorStats { + + /** + * Constructs a new PathErrorStats. + * @param [properties] Properties to set + */ + constructor(properties?: IPathErrorStats); + + /** PathErrorStats children. */ + public children: { [k: string]: IPathErrorStats }; + + /** PathErrorStats errorsCount. */ + public errorsCount: number; + + /** PathErrorStats requestsWithErrorsCount. */ + public requestsWithErrorsCount: number; + + /** + * Creates a new PathErrorStats instance using the specified properties. + * @param [properties] Properties to set + * @returns PathErrorStats instance + */ + public static create(properties?: IPathErrorStats): PathErrorStats; + + /** + * Encodes the specified PathErrorStats message. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @param message PathErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IPathErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathErrorStats message, length delimited. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @param message PathErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IPathErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): PathErrorStats; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): PathErrorStats; + + /** + * Verifies a PathErrorStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a PathErrorStats message. Also converts values to other types if specified. + * @param message PathErrorStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: PathErrorStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathErrorStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a QueryLatencyStats. */ +export interface IQueryLatencyStats { + + /** QueryLatencyStats latencyCount */ + latencyCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats requestCount */ + requestCount?: (number|null); + + /** QueryLatencyStats cacheHits */ + cacheHits?: (number|null); + + /** QueryLatencyStats persistedQueryHits */ + persistedQueryHits?: (number|null); + + /** QueryLatencyStats persistedQueryMisses */ + persistedQueryMisses?: (number|null); + + /** QueryLatencyStats cacheLatencyCount */ + cacheLatencyCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats rootErrorStats */ + rootErrorStats?: (IPathErrorStats|null); + + /** QueryLatencyStats requestsWithErrorsCount */ + requestsWithErrorsCount?: (number|null); + + /** QueryLatencyStats publicCacheTtlCount */ + publicCacheTtlCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats privateCacheTtlCount */ + privateCacheTtlCount?: ($protobuf.ToArray|number[]|null); + + /** QueryLatencyStats registeredOperationCount */ + registeredOperationCount?: (number|null); + + /** QueryLatencyStats forbiddenOperationCount */ + forbiddenOperationCount?: (number|null); + + /** QueryLatencyStats requestsWithoutFieldInstrumentation */ + requestsWithoutFieldInstrumentation?: (number|null); +} + +/** Represents a QueryLatencyStats. */ +export class QueryLatencyStats implements IQueryLatencyStats { + + /** + * Constructs a new QueryLatencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: IQueryLatencyStats); + + /** QueryLatencyStats latencyCount. */ + public latencyCount: number[]; + + /** QueryLatencyStats requestCount. */ + public requestCount: number; + + /** QueryLatencyStats cacheHits. */ + public cacheHits: number; + + /** QueryLatencyStats persistedQueryHits. */ + public persistedQueryHits: number; + + /** QueryLatencyStats persistedQueryMisses. */ + public persistedQueryMisses: number; + + /** QueryLatencyStats cacheLatencyCount. */ + public cacheLatencyCount: number[]; + + /** QueryLatencyStats rootErrorStats. */ + public rootErrorStats?: (IPathErrorStats|null); + + /** QueryLatencyStats requestsWithErrorsCount. */ + public requestsWithErrorsCount: number; + + /** QueryLatencyStats publicCacheTtlCount. */ + public publicCacheTtlCount: number[]; + + /** QueryLatencyStats privateCacheTtlCount. */ + public privateCacheTtlCount: number[]; + + /** QueryLatencyStats registeredOperationCount. */ + public registeredOperationCount: number; + + /** QueryLatencyStats forbiddenOperationCount. */ + public forbiddenOperationCount: number; + + /** QueryLatencyStats requestsWithoutFieldInstrumentation. */ + public requestsWithoutFieldInstrumentation: number; + + /** + * Creates a new QueryLatencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryLatencyStats instance + */ + public static create(properties?: IQueryLatencyStats): QueryLatencyStats; + + /** + * Encodes the specified QueryLatencyStats message. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @param message QueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryLatencyStats message, length delimited. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @param message QueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): QueryLatencyStats; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): QueryLatencyStats; + + /** + * Verifies a QueryLatencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a QueryLatencyStats message. Also converts values to other types if specified. + * @param message QueryLatencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: QueryLatencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryLatencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a StatsContext. */ +export interface IStatsContext { + + /** StatsContext clientName */ + clientName?: (string|null); + + /** StatsContext clientVersion */ + clientVersion?: (string|null); +} + +/** Represents a StatsContext. */ +export class StatsContext implements IStatsContext { + + /** + * Constructs a new StatsContext. + * @param [properties] Properties to set + */ + constructor(properties?: IStatsContext); + + /** StatsContext clientName. */ + public clientName: string; + + /** StatsContext clientVersion. */ + public clientVersion: string; + + /** + * Creates a new StatsContext instance using the specified properties. + * @param [properties] Properties to set + * @returns StatsContext instance + */ + public static create(properties?: IStatsContext): StatsContext; + + /** + * Encodes the specified StatsContext message. Does not implicitly {@link StatsContext.verify|verify} messages. + * @param message StatsContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IStatsContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatsContext message, length delimited. Does not implicitly {@link StatsContext.verify|verify} messages. + * @param message StatsContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IStatsContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatsContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): StatsContext; + + /** + * Decodes a StatsContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): StatsContext; + + /** + * Verifies a StatsContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a StatsContext message. Also converts values to other types if specified. + * @param message StatsContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: StatsContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatsContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ContextualizedQueryLatencyStats. */ +export interface IContextualizedQueryLatencyStats { + + /** ContextualizedQueryLatencyStats queryLatencyStats */ + queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedQueryLatencyStats context */ + context?: (IStatsContext|null); +} + +/** Represents a ContextualizedQueryLatencyStats. */ +export class ContextualizedQueryLatencyStats implements IContextualizedQueryLatencyStats { + + /** + * Constructs a new ContextualizedQueryLatencyStats. + * @param [properties] Properties to set + */ + constructor(properties?: IContextualizedQueryLatencyStats); + + /** ContextualizedQueryLatencyStats queryLatencyStats. */ + public queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedQueryLatencyStats context. */ + public context?: (IStatsContext|null); + + /** + * Creates a new ContextualizedQueryLatencyStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualizedQueryLatencyStats instance + */ + public static create(properties?: IContextualizedQueryLatencyStats): ContextualizedQueryLatencyStats; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @param message ContextualizedQueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IContextualizedQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message, length delimited. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @param message ContextualizedQueryLatencyStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IContextualizedQueryLatencyStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ContextualizedQueryLatencyStats; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ContextualizedQueryLatencyStats; + + /** + * Verifies a ContextualizedQueryLatencyStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ContextualizedQueryLatencyStats message. Also converts values to other types if specified. + * @param message ContextualizedQueryLatencyStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ContextualizedQueryLatencyStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextualizedQueryLatencyStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ContextualizedTypeStats. */ +export interface IContextualizedTypeStats { + + /** ContextualizedTypeStats context */ + context?: (IStatsContext|null); + + /** ContextualizedTypeStats perTypeStat */ + perTypeStat?: ({ [k: string]: ITypeStat }|null); +} + +/** Represents a ContextualizedTypeStats. */ +export class ContextualizedTypeStats implements IContextualizedTypeStats { + + /** + * Constructs a new ContextualizedTypeStats. + * @param [properties] Properties to set + */ + constructor(properties?: IContextualizedTypeStats); + + /** ContextualizedTypeStats context. */ + public context?: (IStatsContext|null); + + /** ContextualizedTypeStats perTypeStat. */ + public perTypeStat: { [k: string]: ITypeStat }; + + /** + * Creates a new ContextualizedTypeStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualizedTypeStats instance + */ + public static create(properties?: IContextualizedTypeStats): ContextualizedTypeStats; + + /** + * Encodes the specified ContextualizedTypeStats message. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @param message ContextualizedTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IContextualizedTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextualizedTypeStats message, length delimited. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @param message ContextualizedTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IContextualizedTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ContextualizedTypeStats; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ContextualizedTypeStats; + + /** + * Verifies a ContextualizedTypeStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ContextualizedTypeStats message. Also converts values to other types if specified. + * @param message ContextualizedTypeStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ContextualizedTypeStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextualizedTypeStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a FieldStat. */ +export interface IFieldStat { + + /** FieldStat returnType */ + returnType?: (string|null); + + /** FieldStat errorsCount */ + errorsCount?: (number|null); + + /** FieldStat observedExecutionCount */ + observedExecutionCount?: (number|null); + + /** FieldStat estimatedExecutionCount */ + estimatedExecutionCount?: (number|null); + + /** FieldStat requestsWithErrorsCount */ + requestsWithErrorsCount?: (number|null); + + /** FieldStat latencyCount */ + latencyCount?: ($protobuf.ToArray|number[]|null); +} + +/** Represents a FieldStat. */ +export class FieldStat implements IFieldStat { + + /** + * Constructs a new FieldStat. + * @param [properties] Properties to set + */ + constructor(properties?: IFieldStat); + + /** FieldStat returnType. */ + public returnType: string; + + /** FieldStat errorsCount. */ + public errorsCount: number; + + /** FieldStat observedExecutionCount. */ + public observedExecutionCount: number; + + /** FieldStat estimatedExecutionCount. */ + public estimatedExecutionCount: number; + + /** FieldStat requestsWithErrorsCount. */ + public requestsWithErrorsCount: number; + + /** FieldStat latencyCount. */ + public latencyCount: number[]; + + /** + * Creates a new FieldStat instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldStat instance + */ + public static create(properties?: IFieldStat): FieldStat; + + /** + * Encodes the specified FieldStat message. Does not implicitly {@link FieldStat.verify|verify} messages. + * @param message FieldStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IFieldStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldStat message, length delimited. Does not implicitly {@link FieldStat.verify|verify} messages. + * @param message FieldStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IFieldStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldStat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): FieldStat; + + /** + * Decodes a FieldStat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): FieldStat; + + /** + * Verifies a FieldStat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a FieldStat message. Also converts values to other types if specified. + * @param message FieldStat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: FieldStat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldStat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a TypeStat. */ +export interface ITypeStat { + + /** TypeStat perFieldStat */ + perFieldStat?: ({ [k: string]: IFieldStat }|null); +} + +/** Represents a TypeStat. */ +export class TypeStat implements ITypeStat { + + /** + * Constructs a new TypeStat. + * @param [properties] Properties to set + */ + constructor(properties?: ITypeStat); + + /** TypeStat perFieldStat. */ + public perFieldStat: { [k: string]: IFieldStat }; + + /** + * Creates a new TypeStat instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeStat instance + */ + public static create(properties?: ITypeStat): TypeStat; + + /** + * Encodes the specified TypeStat message. Does not implicitly {@link TypeStat.verify|verify} messages. + * @param message TypeStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ITypeStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeStat message, length delimited. Does not implicitly {@link TypeStat.verify|verify} messages. + * @param message TypeStat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ITypeStat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeStat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TypeStat; + + /** + * Decodes a TypeStat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): TypeStat; + + /** + * Verifies a TypeStat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a TypeStat message. Also converts values to other types if specified. + * @param message TypeStat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: TypeStat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeStat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ReferencedFieldsForType. */ +export interface IReferencedFieldsForType { + + /** ReferencedFieldsForType fieldNames */ + fieldNames?: (string[]|null); + + /** ReferencedFieldsForType isInterface */ + isInterface?: (boolean|null); +} + +/** Represents a ReferencedFieldsForType. */ +export class ReferencedFieldsForType implements IReferencedFieldsForType { + + /** + * Constructs a new ReferencedFieldsForType. + * @param [properties] Properties to set + */ + constructor(properties?: IReferencedFieldsForType); + + /** ReferencedFieldsForType fieldNames. */ + public fieldNames: string[]; + + /** ReferencedFieldsForType isInterface. */ + public isInterface: boolean; + + /** + * Creates a new ReferencedFieldsForType instance using the specified properties. + * @param [properties] Properties to set + * @returns ReferencedFieldsForType instance + */ + public static create(properties?: IReferencedFieldsForType): ReferencedFieldsForType; + + /** + * Encodes the specified ReferencedFieldsForType message. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @param message ReferencedFieldsForType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IReferencedFieldsForType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReferencedFieldsForType message, length delimited. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @param message ReferencedFieldsForType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IReferencedFieldsForType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ReferencedFieldsForType; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ReferencedFieldsForType; + + /** + * Verifies a ReferencedFieldsForType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ReferencedFieldsForType message. Also converts values to other types if specified. + * @param message ReferencedFieldsForType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ReferencedFieldsForType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReferencedFieldsForType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a Report. */ +export interface IReport { + + /** Report header */ + header?: (IReportHeader|null); + + /** Report tracesPerQuery */ + tracesPerQuery?: ({ [k: string]: ITracesAndStats }|null); + + /** Report endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Report operationCount */ + operationCount?: (number|null); + + /** Report tracesPreAggregated */ + tracesPreAggregated?: (boolean|null); +} + +/** Represents a Report. */ +export class Report implements IReport { + + /** + * Constructs a new Report. + * @param [properties] Properties to set + */ + constructor(properties?: IReport); + + /** Report header. */ + public header?: (IReportHeader|null); + + /** Report tracesPerQuery. */ + public tracesPerQuery: { [k: string]: ITracesAndStats }; + + /** Report endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Report operationCount. */ + public operationCount: number; + + /** Report tracesPreAggregated. */ + public tracesPreAggregated: boolean; + + /** + * Creates a new Report instance using the specified properties. + * @param [properties] Properties to set + * @returns Report instance + */ + public static create(properties?: IReport): Report; + + /** + * Encodes the specified Report message. Does not implicitly {@link Report.verify|verify} messages. + * @param message Report message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Report message, length delimited. Does not implicitly {@link Report.verify|verify} messages. + * @param message Report message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Report message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Report; + + /** + * Decodes a Report message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Report; + + /** + * Verifies a Report message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Report message. Also converts values to other types if specified. + * @param message Report + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Report, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Report to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a ContextualizedStats. */ +export interface IContextualizedStats { + + /** ContextualizedStats context */ + context?: (IStatsContext|null); + + /** ContextualizedStats queryLatencyStats */ + queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedStats perTypeStat */ + perTypeStat?: ({ [k: string]: ITypeStat }|null); +} + +/** Represents a ContextualizedStats. */ +export class ContextualizedStats implements IContextualizedStats { + + /** + * Constructs a new ContextualizedStats. + * @param [properties] Properties to set + */ + constructor(properties?: IContextualizedStats); + + /** ContextualizedStats context. */ + public context?: (IStatsContext|null); + + /** ContextualizedStats queryLatencyStats. */ + public queryLatencyStats?: (IQueryLatencyStats|null); + + /** ContextualizedStats perTypeStat. */ + public perTypeStat: { [k: string]: ITypeStat }; + + /** + * Creates a new ContextualizedStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualizedStats instance + */ + public static create(properties?: IContextualizedStats): ContextualizedStats; + + /** + * Encodes the specified ContextualizedStats message. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @param message ContextualizedStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IContextualizedStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextualizedStats message, length delimited. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @param message ContextualizedStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IContextualizedStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ContextualizedStats; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ContextualizedStats; + + /** + * Verifies a ContextualizedStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a ContextualizedStats message. Also converts values to other types if specified. + * @param message ContextualizedStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: ContextualizedStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextualizedStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Properties of a TracesAndStats. */ +export interface ITracesAndStats { + + /** TracesAndStats trace */ + trace?: ((ITrace|Uint8Array)[]|null); + + /** TracesAndStats statsWithContext */ + statsWithContext?: ($protobuf.ToArray|IContextualizedStats[]|null); + + /** TracesAndStats referencedFieldsByType */ + referencedFieldsByType?: ({ [k: string]: IReferencedFieldsForType }|null); + + /** TracesAndStats internalTracesContributingToStats */ + internalTracesContributingToStats?: ((ITrace|Uint8Array)[]|null); +} + +/** Represents a TracesAndStats. */ +export class TracesAndStats implements ITracesAndStats { + + /** + * Constructs a new TracesAndStats. + * @param [properties] Properties to set + */ + constructor(properties?: ITracesAndStats); + + /** TracesAndStats trace. */ + public trace: (ITrace|Uint8Array)[]; + + /** TracesAndStats statsWithContext. */ + public statsWithContext: IContextualizedStats[]; + + /** TracesAndStats referencedFieldsByType. */ + public referencedFieldsByType: { [k: string]: IReferencedFieldsForType }; + + /** TracesAndStats internalTracesContributingToStats. */ + public internalTracesContributingToStats: (ITrace|Uint8Array)[]; + + /** + * Creates a new TracesAndStats instance using the specified properties. + * @param [properties] Properties to set + * @returns TracesAndStats instance + */ + public static create(properties?: ITracesAndStats): TracesAndStats; + + /** + * Encodes the specified TracesAndStats message. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @param message TracesAndStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: ITracesAndStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TracesAndStats message, length delimited. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @param message TracesAndStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: ITracesAndStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TracesAndStats; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): TracesAndStats; + + /** + * Verifies a TracesAndStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a TracesAndStats message. Also converts values to other types if specified. + * @param message TracesAndStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: TracesAndStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TracesAndStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} + +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: number; + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.js b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.js new file mode 100644 index 00000000..0a6bbd1b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/generated/esm/protobuf.js @@ -0,0 +1,8242 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import $protobuf from "@apollo/protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +export const Trace = $root.Trace = (() => { + + /** + * Properties of a Trace. + * @exports ITrace + * @interface ITrace + * @property {google.protobuf.ITimestamp|null} [startTime] Trace startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Trace endTime + * @property {number|null} [durationNs] Trace durationNs + * @property {Trace.INode|null} [root] Trace root + * @property {boolean|null} [isIncomplete] Trace isIncomplete + * @property {string|null} [signature] Trace signature + * @property {string|null} [unexecutedOperationBody] Trace unexecutedOperationBody + * @property {string|null} [unexecutedOperationName] Trace unexecutedOperationName + * @property {Trace.IDetails|null} [details] Trace details + * @property {string|null} [clientName] Trace clientName + * @property {string|null} [clientVersion] Trace clientVersion + * @property {Trace.IHTTP|null} [http] Trace http + * @property {Trace.ICachePolicy|null} [cachePolicy] Trace cachePolicy + * @property {Trace.IQueryPlanNode|null} [queryPlan] Trace queryPlan + * @property {boolean|null} [fullQueryCacheHit] Trace fullQueryCacheHit + * @property {boolean|null} [persistedQueryHit] Trace persistedQueryHit + * @property {boolean|null} [persistedQueryRegister] Trace persistedQueryRegister + * @property {boolean|null} [registeredOperation] Trace registeredOperation + * @property {boolean|null} [forbiddenOperation] Trace forbiddenOperation + * @property {number|null} [fieldExecutionWeight] Trace fieldExecutionWeight + */ + + /** + * Constructs a new Trace. + * @exports Trace + * @classdesc Represents a Trace. + * @implements ITrace + * @constructor + * @param {ITrace=} [properties] Properties to set + */ + function Trace(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Trace startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof Trace + * @instance + */ + Trace.prototype.startTime = null; + + /** + * Trace endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof Trace + * @instance + */ + Trace.prototype.endTime = null; + + /** + * Trace durationNs. + * @member {number} durationNs + * @memberof Trace + * @instance + */ + Trace.prototype.durationNs = 0; + + /** + * Trace root. + * @member {Trace.INode|null|undefined} root + * @memberof Trace + * @instance + */ + Trace.prototype.root = null; + + /** + * Trace isIncomplete. + * @member {boolean} isIncomplete + * @memberof Trace + * @instance + */ + Trace.prototype.isIncomplete = false; + + /** + * Trace signature. + * @member {string} signature + * @memberof Trace + * @instance + */ + Trace.prototype.signature = ""; + + /** + * Trace unexecutedOperationBody. + * @member {string} unexecutedOperationBody + * @memberof Trace + * @instance + */ + Trace.prototype.unexecutedOperationBody = ""; + + /** + * Trace unexecutedOperationName. + * @member {string} unexecutedOperationName + * @memberof Trace + * @instance + */ + Trace.prototype.unexecutedOperationName = ""; + + /** + * Trace details. + * @member {Trace.IDetails|null|undefined} details + * @memberof Trace + * @instance + */ + Trace.prototype.details = null; + + /** + * Trace clientName. + * @member {string} clientName + * @memberof Trace + * @instance + */ + Trace.prototype.clientName = ""; + + /** + * Trace clientVersion. + * @member {string} clientVersion + * @memberof Trace + * @instance + */ + Trace.prototype.clientVersion = ""; + + /** + * Trace http. + * @member {Trace.IHTTP|null|undefined} http + * @memberof Trace + * @instance + */ + Trace.prototype.http = null; + + /** + * Trace cachePolicy. + * @member {Trace.ICachePolicy|null|undefined} cachePolicy + * @memberof Trace + * @instance + */ + Trace.prototype.cachePolicy = null; + + /** + * Trace queryPlan. + * @member {Trace.IQueryPlanNode|null|undefined} queryPlan + * @memberof Trace + * @instance + */ + Trace.prototype.queryPlan = null; + + /** + * Trace fullQueryCacheHit. + * @member {boolean} fullQueryCacheHit + * @memberof Trace + * @instance + */ + Trace.prototype.fullQueryCacheHit = false; + + /** + * Trace persistedQueryHit. + * @member {boolean} persistedQueryHit + * @memberof Trace + * @instance + */ + Trace.prototype.persistedQueryHit = false; + + /** + * Trace persistedQueryRegister. + * @member {boolean} persistedQueryRegister + * @memberof Trace + * @instance + */ + Trace.prototype.persistedQueryRegister = false; + + /** + * Trace registeredOperation. + * @member {boolean} registeredOperation + * @memberof Trace + * @instance + */ + Trace.prototype.registeredOperation = false; + + /** + * Trace forbiddenOperation. + * @member {boolean} forbiddenOperation + * @memberof Trace + * @instance + */ + Trace.prototype.forbiddenOperation = false; + + /** + * Trace fieldExecutionWeight. + * @member {number} fieldExecutionWeight + * @memberof Trace + * @instance + */ + Trace.prototype.fieldExecutionWeight = 0; + + /** + * Creates a new Trace instance using the specified properties. + * @function create + * @memberof Trace + * @static + * @param {ITrace=} [properties] Properties to set + * @returns {Trace} Trace instance + */ + Trace.create = function create(properties) { + return new Trace(properties); + }; + + /** + * Encodes the specified Trace message. Does not implicitly {@link Trace.verify|verify} messages. + * @function encode + * @memberof Trace + * @static + * @param {ITrace} message Trace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trace.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.Trace.Details.encode(message.details, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.clientName != null && Object.hasOwnProperty.call(message, "clientName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.clientName); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.clientVersion); + if (message.http != null && Object.hasOwnProperty.call(message, "http")) + $root.Trace.HTTP.encode(message.http, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.durationNs != null && Object.hasOwnProperty.call(message, "durationNs")) + writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.durationNs); + if (message.root != null && Object.hasOwnProperty.call(message, "root")) + $root.Trace.Node.encode(message.root, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.cachePolicy != null && Object.hasOwnProperty.call(message, "cachePolicy")) + $root.Trace.CachePolicy.encode(message.cachePolicy, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.signature); + if (message.fullQueryCacheHit != null && Object.hasOwnProperty.call(message, "fullQueryCacheHit")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.fullQueryCacheHit); + if (message.persistedQueryHit != null && Object.hasOwnProperty.call(message, "persistedQueryHit")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.persistedQueryHit); + if (message.persistedQueryRegister != null && Object.hasOwnProperty.call(message, "persistedQueryRegister")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.persistedQueryRegister); + if (message.registeredOperation != null && Object.hasOwnProperty.call(message, "registeredOperation")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.registeredOperation); + if (message.forbiddenOperation != null && Object.hasOwnProperty.call(message, "forbiddenOperation")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.forbiddenOperation); + if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) + $root.Trace.QueryPlanNode.encode(message.queryPlan, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.unexecutedOperationBody != null && Object.hasOwnProperty.call(message, "unexecutedOperationBody")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.unexecutedOperationBody); + if (message.unexecutedOperationName != null && Object.hasOwnProperty.call(message, "unexecutedOperationName")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.unexecutedOperationName); + if (message.fieldExecutionWeight != null && Object.hasOwnProperty.call(message, "fieldExecutionWeight")) + writer.uint32(/* id 31, wireType 1 =*/249).double(message.fieldExecutionWeight); + if (message.isIncomplete != null && Object.hasOwnProperty.call(message, "isIncomplete")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.isIncomplete); + return writer; + }; + + /** + * Encodes the specified Trace message, length delimited. Does not implicitly {@link Trace.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace + * @static + * @param {ITrace} message Trace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Trace message from the specified reader or buffer. + * @function decode + * @memberof Trace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace} Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.durationNs = reader.uint64(); + break; + case 14: + message.root = $root.Trace.Node.decode(reader, reader.uint32()); + break; + case 33: + message.isIncomplete = reader.bool(); + break; + case 19: + message.signature = reader.string(); + break; + case 27: + message.unexecutedOperationBody = reader.string(); + break; + case 28: + message.unexecutedOperationName = reader.string(); + break; + case 6: + message.details = $root.Trace.Details.decode(reader, reader.uint32()); + break; + case 7: + message.clientName = reader.string(); + break; + case 8: + message.clientVersion = reader.string(); + break; + case 10: + message.http = $root.Trace.HTTP.decode(reader, reader.uint32()); + break; + case 18: + message.cachePolicy = $root.Trace.CachePolicy.decode(reader, reader.uint32()); + break; + case 26: + message.queryPlan = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + case 20: + message.fullQueryCacheHit = reader.bool(); + break; + case 21: + message.persistedQueryHit = reader.bool(); + break; + case 22: + message.persistedQueryRegister = reader.bool(); + break; + case 24: + message.registeredOperation = reader.bool(); + break; + case 25: + message.forbiddenOperation = reader.bool(); + break; + case 31: + message.fieldExecutionWeight = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Trace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace} Trace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Trace message. + * @function verify + * @memberof Trace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Trace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.durationNs != null && message.hasOwnProperty("durationNs")) + if (!$util.isInteger(message.durationNs) && !(message.durationNs && $util.isInteger(message.durationNs.low) && $util.isInteger(message.durationNs.high))) + return "durationNs: integer|Long expected"; + if (message.root != null && message.hasOwnProperty("root")) { + let error = $root.Trace.Node.verify(message.root); + if (error) + return "root." + error; + } + if (message.isIncomplete != null && message.hasOwnProperty("isIncomplete")) + if (typeof message.isIncomplete !== "boolean") + return "isIncomplete: boolean expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!$util.isString(message.signature)) + return "signature: string expected"; + if (message.unexecutedOperationBody != null && message.hasOwnProperty("unexecutedOperationBody")) + if (!$util.isString(message.unexecutedOperationBody)) + return "unexecutedOperationBody: string expected"; + if (message.unexecutedOperationName != null && message.hasOwnProperty("unexecutedOperationName")) + if (!$util.isString(message.unexecutedOperationName)) + return "unexecutedOperationName: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + let error = $root.Trace.Details.verify(message.details); + if (error) + return "details." + error; + } + if (message.clientName != null && message.hasOwnProperty("clientName")) + if (!$util.isString(message.clientName)) + return "clientName: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: string expected"; + if (message.http != null && message.hasOwnProperty("http")) { + let error = $root.Trace.HTTP.verify(message.http); + if (error) + return "http." + error; + } + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) { + let error = $root.Trace.CachePolicy.verify(message.cachePolicy); + if (error) + return "cachePolicy." + error; + } + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) { + let error = $root.Trace.QueryPlanNode.verify(message.queryPlan); + if (error) + return "queryPlan." + error; + } + if (message.fullQueryCacheHit != null && message.hasOwnProperty("fullQueryCacheHit")) + if (typeof message.fullQueryCacheHit !== "boolean") + return "fullQueryCacheHit: boolean expected"; + if (message.persistedQueryHit != null && message.hasOwnProperty("persistedQueryHit")) + if (typeof message.persistedQueryHit !== "boolean") + return "persistedQueryHit: boolean expected"; + if (message.persistedQueryRegister != null && message.hasOwnProperty("persistedQueryRegister")) + if (typeof message.persistedQueryRegister !== "boolean") + return "persistedQueryRegister: boolean expected"; + if (message.registeredOperation != null && message.hasOwnProperty("registeredOperation")) + if (typeof message.registeredOperation !== "boolean") + return "registeredOperation: boolean expected"; + if (message.forbiddenOperation != null && message.hasOwnProperty("forbiddenOperation")) + if (typeof message.forbiddenOperation !== "boolean") + return "forbiddenOperation: boolean expected"; + if (message.fieldExecutionWeight != null && message.hasOwnProperty("fieldExecutionWeight")) + if (typeof message.fieldExecutionWeight !== "number") + return "fieldExecutionWeight: number expected"; + return null; + }; + + /** + * Creates a plain object from a Trace message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace + * @static + * @param {Trace} message Trace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Trace.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.endTime = null; + object.startTime = null; + object.details = null; + object.clientName = ""; + object.clientVersion = ""; + object.http = null; + object.durationNs = 0; + object.root = null; + object.cachePolicy = null; + object.signature = ""; + object.fullQueryCacheHit = false; + object.persistedQueryHit = false; + object.persistedQueryRegister = false; + object.registeredOperation = false; + object.forbiddenOperation = false; + object.queryPlan = null; + object.unexecutedOperationBody = ""; + object.unexecutedOperationName = ""; + object.fieldExecutionWeight = 0; + object.isIncomplete = false; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.Trace.Details.toObject(message.details, options); + if (message.clientName != null && message.hasOwnProperty("clientName")) + object.clientName = message.clientName; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + if (message.http != null && message.hasOwnProperty("http")) + object.http = $root.Trace.HTTP.toObject(message.http, options); + if (message.durationNs != null && message.hasOwnProperty("durationNs")) + if (typeof message.durationNs === "number") + object.durationNs = options.longs === String ? String(message.durationNs) : message.durationNs; + else + object.durationNs = options.longs === String ? $util.Long.prototype.toString.call(message.durationNs) : options.longs === Number ? new $util.LongBits(message.durationNs.low >>> 0, message.durationNs.high >>> 0).toNumber(true) : message.durationNs; + if (message.root != null && message.hasOwnProperty("root")) + object.root = $root.Trace.Node.toObject(message.root, options); + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) + object.cachePolicy = $root.Trace.CachePolicy.toObject(message.cachePolicy, options); + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = message.signature; + if (message.fullQueryCacheHit != null && message.hasOwnProperty("fullQueryCacheHit")) + object.fullQueryCacheHit = message.fullQueryCacheHit; + if (message.persistedQueryHit != null && message.hasOwnProperty("persistedQueryHit")) + object.persistedQueryHit = message.persistedQueryHit; + if (message.persistedQueryRegister != null && message.hasOwnProperty("persistedQueryRegister")) + object.persistedQueryRegister = message.persistedQueryRegister; + if (message.registeredOperation != null && message.hasOwnProperty("registeredOperation")) + object.registeredOperation = message.registeredOperation; + if (message.forbiddenOperation != null && message.hasOwnProperty("forbiddenOperation")) + object.forbiddenOperation = message.forbiddenOperation; + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) + object.queryPlan = $root.Trace.QueryPlanNode.toObject(message.queryPlan, options); + if (message.unexecutedOperationBody != null && message.hasOwnProperty("unexecutedOperationBody")) + object.unexecutedOperationBody = message.unexecutedOperationBody; + if (message.unexecutedOperationName != null && message.hasOwnProperty("unexecutedOperationName")) + object.unexecutedOperationName = message.unexecutedOperationName; + if (message.fieldExecutionWeight != null && message.hasOwnProperty("fieldExecutionWeight")) + object.fieldExecutionWeight = options.json && !isFinite(message.fieldExecutionWeight) ? String(message.fieldExecutionWeight) : message.fieldExecutionWeight; + if (message.isIncomplete != null && message.hasOwnProperty("isIncomplete")) + object.isIncomplete = message.isIncomplete; + return object; + }; + + /** + * Converts this Trace to JSON. + * @function toJSON + * @memberof Trace + * @instance + * @returns {Object.} JSON object + */ + Trace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Trace.CachePolicy = (function() { + + /** + * Properties of a CachePolicy. + * @memberof Trace + * @interface ICachePolicy + * @property {Trace.CachePolicy.Scope|null} [scope] CachePolicy scope + * @property {number|null} [maxAgeNs] CachePolicy maxAgeNs + */ + + /** + * Constructs a new CachePolicy. + * @memberof Trace + * @classdesc Represents a CachePolicy. + * @implements ICachePolicy + * @constructor + * @param {Trace.ICachePolicy=} [properties] Properties to set + */ + function CachePolicy(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CachePolicy scope. + * @member {Trace.CachePolicy.Scope} scope + * @memberof Trace.CachePolicy + * @instance + */ + CachePolicy.prototype.scope = 0; + + /** + * CachePolicy maxAgeNs. + * @member {number} maxAgeNs + * @memberof Trace.CachePolicy + * @instance + */ + CachePolicy.prototype.maxAgeNs = 0; + + /** + * Creates a new CachePolicy instance using the specified properties. + * @function create + * @memberof Trace.CachePolicy + * @static + * @param {Trace.ICachePolicy=} [properties] Properties to set + * @returns {Trace.CachePolicy} CachePolicy instance + */ + CachePolicy.create = function create(properties) { + return new CachePolicy(properties); + }; + + /** + * Encodes the specified CachePolicy message. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @function encode + * @memberof Trace.CachePolicy + * @static + * @param {Trace.ICachePolicy} message CachePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CachePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.scope); + if (message.maxAgeNs != null && Object.hasOwnProperty.call(message, "maxAgeNs")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxAgeNs); + return writer; + }; + + /** + * Encodes the specified CachePolicy message, length delimited. Does not implicitly {@link Trace.CachePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.CachePolicy + * @static + * @param {Trace.ICachePolicy} message CachePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CachePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CachePolicy message from the specified reader or buffer. + * @function decode + * @memberof Trace.CachePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.CachePolicy} CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CachePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.CachePolicy(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scope = reader.int32(); + break; + case 2: + message.maxAgeNs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CachePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.CachePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.CachePolicy} CachePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CachePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CachePolicy message. + * @function verify + * @memberof Trace.CachePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CachePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.maxAgeNs != null && message.hasOwnProperty("maxAgeNs")) + if (!$util.isInteger(message.maxAgeNs) && !(message.maxAgeNs && $util.isInteger(message.maxAgeNs.low) && $util.isInteger(message.maxAgeNs.high))) + return "maxAgeNs: integer|Long expected"; + return null; + }; + + /** + * Creates a plain object from a CachePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.CachePolicy + * @static + * @param {Trace.CachePolicy} message CachePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CachePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.scope = options.enums === String ? "UNKNOWN" : 0; + object.maxAgeNs = 0; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.Trace.CachePolicy.Scope[message.scope] : message.scope; + if (message.maxAgeNs != null && message.hasOwnProperty("maxAgeNs")) + if (typeof message.maxAgeNs === "number") + object.maxAgeNs = options.longs === String ? String(message.maxAgeNs) : message.maxAgeNs; + else + object.maxAgeNs = options.longs === String ? $util.Long.prototype.toString.call(message.maxAgeNs) : options.longs === Number ? new $util.LongBits(message.maxAgeNs.low >>> 0, message.maxAgeNs.high >>> 0).toNumber() : message.maxAgeNs; + return object; + }; + + /** + * Converts this CachePolicy to JSON. + * @function toJSON + * @memberof Trace.CachePolicy + * @instance + * @returns {Object.} JSON object + */ + CachePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Scope enum. + * @name Trace.CachePolicy.Scope + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PUBLIC=1 PUBLIC value + * @property {number} PRIVATE=2 PRIVATE value + */ + CachePolicy.Scope = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PUBLIC"] = 1; + values[valuesById[2] = "PRIVATE"] = 2; + return values; + })(); + + return CachePolicy; + })(); + + Trace.Details = (function() { + + /** + * Properties of a Details. + * @memberof Trace + * @interface IDetails + * @property {Object.|null} [variablesJson] Details variablesJson + * @property {string|null} [operationName] Details operationName + */ + + /** + * Constructs a new Details. + * @memberof Trace + * @classdesc Represents a Details. + * @implements IDetails + * @constructor + * @param {Trace.IDetails=} [properties] Properties to set + */ + function Details(properties) { + this.variablesJson = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Details variablesJson. + * @member {Object.} variablesJson + * @memberof Trace.Details + * @instance + */ + Details.prototype.variablesJson = $util.emptyObject; + + /** + * Details operationName. + * @member {string} operationName + * @memberof Trace.Details + * @instance + */ + Details.prototype.operationName = ""; + + /** + * Creates a new Details instance using the specified properties. + * @function create + * @memberof Trace.Details + * @static + * @param {Trace.IDetails=} [properties] Properties to set + * @returns {Trace.Details} Details instance + */ + Details.create = function create(properties) { + return new Details(properties); + }; + + /** + * Encodes the specified Details message. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @function encode + * @memberof Trace.Details + * @static + * @param {Trace.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationName != null && Object.hasOwnProperty.call(message, "operationName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationName); + if (message.variablesJson != null && Object.hasOwnProperty.call(message, "variablesJson")) + for (let keys = Object.keys(message.variablesJson), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variablesJson[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link Trace.Details.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Details + * @static + * @param {Trace.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Details message from the specified reader or buffer. + * @function decode + * @memberof Trace.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Details(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + reader.skip().pos++; + if (message.variablesJson === $util.emptyObject) + message.variablesJson = {}; + key = reader.string(); + reader.pos++; + message.variablesJson[key] = reader.string(); + break; + case 3: + message.operationName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Details message. + * @function verify + * @memberof Trace.Details + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Details.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.variablesJson != null && message.hasOwnProperty("variablesJson")) { + if (!$util.isObject(message.variablesJson)) + return "variablesJson: object expected"; + let key = Object.keys(message.variablesJson); + for (let i = 0; i < key.length; ++i) + if (!$util.isString(message.variablesJson[key[i]])) + return "variablesJson: string{k:string} expected"; + } + if (message.operationName != null && message.hasOwnProperty("operationName")) + if (!$util.isString(message.operationName)) + return "operationName: string expected"; + return null; + }; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Details + * @static + * @param {Trace.Details} message Details + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Details.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.variablesJson = {}; + if (options.defaults) + object.operationName = ""; + if (message.operationName != null && message.hasOwnProperty("operationName")) + object.operationName = message.operationName; + let keys2; + if (message.variablesJson && (keys2 = Object.keys(message.variablesJson)).length) { + object.variablesJson = {}; + for (let j = 0; j < keys2.length; ++j) + object.variablesJson[keys2[j]] = message.variablesJson[keys2[j]]; + } + return object; + }; + + /** + * Converts this Details to JSON. + * @function toJSON + * @memberof Trace.Details + * @instance + * @returns {Object.} JSON object + */ + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Details; + })(); + + Trace.Error = (function() { + + /** + * Properties of an Error. + * @memberof Trace + * @interface IError + * @property {string|null} [message] Error message + * @property {Array.|null} [location] Error location + * @property {number|null} [timeNs] Error timeNs + * @property {string|null} [json] Error json + */ + + /** + * Constructs a new Error. + * @memberof Trace + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {Trace.IError=} [properties] Properties to set + */ + function Error(properties) { + this.location = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error message. + * @member {string} message + * @memberof Trace.Error + * @instance + */ + Error.prototype.message = ""; + + /** + * Error location. + * @member {Array.} location + * @memberof Trace.Error + * @instance + */ + Error.prototype.location = $util.emptyArray; + + /** + * Error timeNs. + * @member {number} timeNs + * @memberof Trace.Error + * @instance + */ + Error.prototype.timeNs = 0; + + /** + * Error json. + * @member {string} json + * @memberof Trace.Error + * @instance + */ + Error.prototype.json = ""; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof Trace.Error + * @static + * @param {Trace.IError=} [properties] Properties to set + * @returns {Trace.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @function encode + * @memberof Trace.Error + * @static + * @param {Trace.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.location != null && message.location.length) + for (let i = 0; i < message.location.length; ++i) + $root.Trace.Location.encode(message.location[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timeNs != null && Object.hasOwnProperty.call(message, "timeNs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeNs); + if (message.json != null && Object.hasOwnProperty.call(message, "json")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.json); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link Trace.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Error + * @static + * @param {Trace.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof Trace.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Error(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + case 2: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.Trace.Location.decode(reader, reader.uint32())); + break; + case 3: + message.timeNs = reader.uint64(); + break; + case 4: + message.json = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof Trace.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (let i = 0; i < message.location.length; ++i) { + let error = $root.Trace.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + if (message.timeNs != null && message.hasOwnProperty("timeNs")) + if (!$util.isInteger(message.timeNs) && !(message.timeNs && $util.isInteger(message.timeNs.low) && $util.isInteger(message.timeNs.high))) + return "timeNs: integer|Long expected"; + if (message.json != null && message.hasOwnProperty("json")) + if (!$util.isString(message.json)) + return "json: string expected"; + return null; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Error + * @static + * @param {Trace.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (options.defaults) { + object.message = ""; + object.timeNs = 0; + object.json = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.location && message.location.length) { + object.location = []; + for (let j = 0; j < message.location.length; ++j) + object.location[j] = $root.Trace.Location.toObject(message.location[j], options); + } + if (message.timeNs != null && message.hasOwnProperty("timeNs")) + if (typeof message.timeNs === "number") + object.timeNs = options.longs === String ? String(message.timeNs) : message.timeNs; + else + object.timeNs = options.longs === String ? $util.Long.prototype.toString.call(message.timeNs) : options.longs === Number ? new $util.LongBits(message.timeNs.low >>> 0, message.timeNs.high >>> 0).toNumber(true) : message.timeNs; + if (message.json != null && message.hasOwnProperty("json")) + object.json = message.json; + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof Trace.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Error; + })(); + + Trace.HTTP = (function() { + + /** + * Properties of a HTTP. + * @memberof Trace + * @interface IHTTP + * @property {Trace.HTTP.Method|null} [method] HTTP method + * @property {Object.|null} [requestHeaders] HTTP requestHeaders + * @property {Object.|null} [responseHeaders] HTTP responseHeaders + * @property {number|null} [statusCode] HTTP statusCode + */ + + /** + * Constructs a new HTTP. + * @memberof Trace + * @classdesc Represents a HTTP. + * @implements IHTTP + * @constructor + * @param {Trace.IHTTP=} [properties] Properties to set + */ + function HTTP(properties) { + this.requestHeaders = {}; + this.responseHeaders = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HTTP method. + * @member {Trace.HTTP.Method} method + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.method = 0; + + /** + * HTTP requestHeaders. + * @member {Object.} requestHeaders + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.requestHeaders = $util.emptyObject; + + /** + * HTTP responseHeaders. + * @member {Object.} responseHeaders + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.responseHeaders = $util.emptyObject; + + /** + * HTTP statusCode. + * @member {number} statusCode + * @memberof Trace.HTTP + * @instance + */ + HTTP.prototype.statusCode = 0; + + /** + * Creates a new HTTP instance using the specified properties. + * @function create + * @memberof Trace.HTTP + * @static + * @param {Trace.IHTTP=} [properties] Properties to set + * @returns {Trace.HTTP} HTTP instance + */ + HTTP.create = function create(properties) { + return new HTTP(properties); + }; + + /** + * Encodes the specified HTTP message. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @function encode + * @memberof Trace.HTTP + * @static + * @param {Trace.IHTTP} message HTTP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTP.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.method); + if (message.requestHeaders != null && Object.hasOwnProperty.call(message, "requestHeaders")) + for (let keys = Object.keys(message.requestHeaders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.Trace.HTTP.Values.encode(message.requestHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.responseHeaders != null && Object.hasOwnProperty.call(message, "responseHeaders")) + for (let keys = Object.keys(message.responseHeaders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.Trace.HTTP.Values.encode(message.responseHeaders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.statusCode != null && Object.hasOwnProperty.call(message, "statusCode")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.statusCode); + return writer; + }; + + /** + * Encodes the specified HTTP message, length delimited. Does not implicitly {@link Trace.HTTP.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.HTTP + * @static + * @param {Trace.IHTTP} message HTTP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTP.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HTTP message from the specified reader or buffer. + * @function decode + * @memberof Trace.HTTP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.HTTP} HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTP.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.HTTP(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.method = reader.int32(); + break; + case 4: + reader.skip().pos++; + if (message.requestHeaders === $util.emptyObject) + message.requestHeaders = {}; + key = reader.string(); + reader.pos++; + message.requestHeaders[key] = $root.Trace.HTTP.Values.decode(reader, reader.uint32()); + break; + case 5: + reader.skip().pos++; + if (message.responseHeaders === $util.emptyObject) + message.responseHeaders = {}; + key = reader.string(); + reader.pos++; + message.responseHeaders[key] = $root.Trace.HTTP.Values.decode(reader, reader.uint32()); + break; + case 6: + message.statusCode = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HTTP message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.HTTP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.HTTP} HTTP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTP.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HTTP message. + * @function verify + * @memberof Trace.HTTP + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HTTP.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.method != null && message.hasOwnProperty("method")) + switch (message.method) { + default: + return "method: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.requestHeaders != null && message.hasOwnProperty("requestHeaders")) { + if (!$util.isObject(message.requestHeaders)) + return "requestHeaders: object expected"; + let key = Object.keys(message.requestHeaders); + for (let i = 0; i < key.length; ++i) { + let error = $root.Trace.HTTP.Values.verify(message.requestHeaders[key[i]]); + if (error) + return "requestHeaders." + error; + } + } + if (message.responseHeaders != null && message.hasOwnProperty("responseHeaders")) { + if (!$util.isObject(message.responseHeaders)) + return "responseHeaders: object expected"; + let key = Object.keys(message.responseHeaders); + for (let i = 0; i < key.length; ++i) { + let error = $root.Trace.HTTP.Values.verify(message.responseHeaders[key[i]]); + if (error) + return "responseHeaders." + error; + } + } + if (message.statusCode != null && message.hasOwnProperty("statusCode")) + if (!$util.isInteger(message.statusCode)) + return "statusCode: integer expected"; + return null; + }; + + /** + * Creates a plain object from a HTTP message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.HTTP + * @static + * @param {Trace.HTTP} message HTTP + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HTTP.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) { + object.requestHeaders = {}; + object.responseHeaders = {}; + } + if (options.defaults) { + object.method = options.enums === String ? "UNKNOWN" : 0; + object.statusCode = 0; + } + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.Trace.HTTP.Method[message.method] : message.method; + let keys2; + if (message.requestHeaders && (keys2 = Object.keys(message.requestHeaders)).length) { + object.requestHeaders = {}; + for (let j = 0; j < keys2.length; ++j) + object.requestHeaders[keys2[j]] = $root.Trace.HTTP.Values.toObject(message.requestHeaders[keys2[j]], options); + } + if (message.responseHeaders && (keys2 = Object.keys(message.responseHeaders)).length) { + object.responseHeaders = {}; + for (let j = 0; j < keys2.length; ++j) + object.responseHeaders[keys2[j]] = $root.Trace.HTTP.Values.toObject(message.responseHeaders[keys2[j]], options); + } + if (message.statusCode != null && message.hasOwnProperty("statusCode")) + object.statusCode = message.statusCode; + return object; + }; + + /** + * Converts this HTTP to JSON. + * @function toJSON + * @memberof Trace.HTTP + * @instance + * @returns {Object.} JSON object + */ + HTTP.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + HTTP.Values = (function() { + + /** + * Properties of a Values. + * @memberof Trace.HTTP + * @interface IValues + * @property {Array.|null} [value] Values value + */ + + /** + * Constructs a new Values. + * @memberof Trace.HTTP + * @classdesc Represents a Values. + * @implements IValues + * @constructor + * @param {Trace.HTTP.IValues=} [properties] Properties to set + */ + function Values(properties) { + this.value = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Values value. + * @member {Array.} value + * @memberof Trace.HTTP.Values + * @instance + */ + Values.prototype.value = $util.emptyArray; + + /** + * Creates a new Values instance using the specified properties. + * @function create + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.IValues=} [properties] Properties to set + * @returns {Trace.HTTP.Values} Values instance + */ + Values.create = function create(properties) { + return new Values(properties); + }; + + /** + * Encodes the specified Values message. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @function encode + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.IValues} message Values message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Values.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.value.length) + for (let i = 0; i < message.value.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value[i]); + return writer; + }; + + /** + * Encodes the specified Values message, length delimited. Does not implicitly {@link Trace.HTTP.Values.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.IValues} message Values message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Values.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Values message from the specified reader or buffer. + * @function decode + * @memberof Trace.HTTP.Values + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.HTTP.Values} Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Values.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.HTTP.Values(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Values message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.HTTP.Values + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.HTTP.Values} Values + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Values.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Values message. + * @function verify + * @memberof Trace.HTTP.Values + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Values.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (let i = 0; i < message.value.length; ++i) + if (!$util.isString(message.value[i])) + return "value: string[] expected"; + } + return null; + }; + + /** + * Creates a plain object from a Values message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.HTTP.Values + * @static + * @param {Trace.HTTP.Values} message Values + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Values.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.value = []; + if (message.value && message.value.length) { + object.value = []; + for (let j = 0; j < message.value.length; ++j) + object.value[j] = message.value[j]; + } + return object; + }; + + /** + * Converts this Values to JSON. + * @function toJSON + * @memberof Trace.HTTP.Values + * @instance + * @returns {Object.} JSON object + */ + Values.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Values; + })(); + + /** + * Method enum. + * @name Trace.HTTP.Method + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} OPTIONS=1 OPTIONS value + * @property {number} GET=2 GET value + * @property {number} HEAD=3 HEAD value + * @property {number} POST=4 POST value + * @property {number} PUT=5 PUT value + * @property {number} DELETE=6 DELETE value + * @property {number} TRACE=7 TRACE value + * @property {number} CONNECT=8 CONNECT value + * @property {number} PATCH=9 PATCH value + */ + HTTP.Method = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "OPTIONS"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "HEAD"] = 3; + values[valuesById[4] = "POST"] = 4; + values[valuesById[5] = "PUT"] = 5; + values[valuesById[6] = "DELETE"] = 6; + values[valuesById[7] = "TRACE"] = 7; + values[valuesById[8] = "CONNECT"] = 8; + values[valuesById[9] = "PATCH"] = 9; + return values; + })(); + + return HTTP; + })(); + + Trace.Location = (function() { + + /** + * Properties of a Location. + * @memberof Trace + * @interface ILocation + * @property {number|null} [line] Location line + * @property {number|null} [column] Location column + */ + + /** + * Constructs a new Location. + * @memberof Trace + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {Trace.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location line. + * @member {number} line + * @memberof Trace.Location + * @instance + */ + Location.prototype.line = 0; + + /** + * Location column. + * @member {number} column + * @memberof Trace.Location + * @instance + */ + Location.prototype.column = 0; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof Trace.Location + * @static + * @param {Trace.ILocation=} [properties] Properties to set + * @returns {Trace.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @function encode + * @memberof Trace.Location + * @static + * @param {Trace.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.line != null && Object.hasOwnProperty.call(message, "line")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.line); + if (message.column != null && Object.hasOwnProperty.call(message, "column")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.column); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link Trace.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Location + * @static + * @param {Trace.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof Trace.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Location(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.line = reader.uint32(); + break; + case 2: + message.column = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof Trace.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.line != null && message.hasOwnProperty("line")) + if (!$util.isInteger(message.line)) + return "line: integer expected"; + if (message.column != null && message.hasOwnProperty("column")) + if (!$util.isInteger(message.column)) + return "column: integer expected"; + return null; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Location + * @static + * @param {Trace.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.line = 0; + object.column = 0; + } + if (message.line != null && message.hasOwnProperty("line")) + object.line = message.line; + if (message.column != null && message.hasOwnProperty("column")) + object.column = message.column; + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof Trace.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + Trace.Node = (function() { + + /** + * Properties of a Node. + * @memberof Trace + * @interface INode + * @property {string|null} [responseName] Node responseName + * @property {number|null} [index] Node index + * @property {string|null} [originalFieldName] Node originalFieldName + * @property {string|null} [type] Node type + * @property {string|null} [parentType] Node parentType + * @property {Trace.ICachePolicy|null} [cachePolicy] Node cachePolicy + * @property {number|null} [startTime] Node startTime + * @property {number|null} [endTime] Node endTime + * @property {Array.|null} [error] Node error + * @property {Array.|null} [child] Node child + */ + + /** + * Constructs a new Node. + * @memberof Trace + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {Trace.INode=} [properties] Properties to set + */ + function Node(properties) { + this.error = []; + this.child = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node responseName. + * @member {string} responseName + * @memberof Trace.Node + * @instance + */ + Node.prototype.responseName = ""; + + /** + * Node index. + * @member {number} index + * @memberof Trace.Node + * @instance + */ + Node.prototype.index = 0; + + /** + * Node originalFieldName. + * @member {string} originalFieldName + * @memberof Trace.Node + * @instance + */ + Node.prototype.originalFieldName = ""; + + /** + * Node type. + * @member {string} type + * @memberof Trace.Node + * @instance + */ + Node.prototype.type = ""; + + /** + * Node parentType. + * @member {string} parentType + * @memberof Trace.Node + * @instance + */ + Node.prototype.parentType = ""; + + /** + * Node cachePolicy. + * @member {Trace.ICachePolicy|null|undefined} cachePolicy + * @memberof Trace.Node + * @instance + */ + Node.prototype.cachePolicy = null; + + /** + * Node startTime. + * @member {number} startTime + * @memberof Trace.Node + * @instance + */ + Node.prototype.startTime = 0; + + /** + * Node endTime. + * @member {number} endTime + * @memberof Trace.Node + * @instance + */ + Node.prototype.endTime = 0; + + /** + * Node error. + * @member {Array.} error + * @memberof Trace.Node + * @instance + */ + Node.prototype.error = $util.emptyArray; + + /** + * Node child. + * @member {Array.} child + * @memberof Trace.Node + * @instance + */ + Node.prototype.child = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Node id. + * @member {"responseName"|"index"|undefined} id + * @memberof Trace.Node + * @instance + */ + Object.defineProperty(Node.prototype, "id", { + get: $util.oneOfGetter($oneOfFields = ["responseName", "index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof Trace.Node + * @static + * @param {Trace.INode=} [properties] Properties to set + * @returns {Trace.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @function encode + * @memberof Trace.Node + * @static + * @param {Trace.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseName != null && Object.hasOwnProperty.call(message, "responseName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseName); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.cachePolicy != null && Object.hasOwnProperty.call(message, "cachePolicy")) + $root.Trace.CachePolicy.encode(message.cachePolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.startTime); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.endTime); + if (message.error != null && message.error.length) + for (let i = 0; i < message.error.length; ++i) + $root.Trace.Error.encode(message.error[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.child != null && message.child.length) + for (let i = 0; i < message.child.length; ++i) + $root.Trace.Node.encode(message.child[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.parentType); + if (message.originalFieldName != null && Object.hasOwnProperty.call(message, "originalFieldName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.originalFieldName); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link Trace.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.Node + * @static + * @param {Trace.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof Trace.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.Node(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseName = reader.string(); + break; + case 2: + message.index = reader.uint32(); + break; + case 14: + message.originalFieldName = reader.string(); + break; + case 3: + message.type = reader.string(); + break; + case 13: + message.parentType = reader.string(); + break; + case 5: + message.cachePolicy = $root.Trace.CachePolicy.decode(reader, reader.uint32()); + break; + case 8: + message.startTime = reader.uint64(); + break; + case 9: + message.endTime = reader.uint64(); + break; + case 11: + if (!(message.error && message.error.length)) + message.error = []; + message.error.push($root.Trace.Error.decode(reader, reader.uint32())); + break; + case 12: + if (!(message.child && message.child.length)) + message.child = []; + message.child.push($root.Trace.Node.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof Trace.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.responseName != null && message.hasOwnProperty("responseName")) { + properties.id = 1; + if (!$util.isString(message.responseName)) + return "responseName: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + if (properties.id === 1) + return "id: multiple values"; + properties.id = 1; + if (!$util.isInteger(message.index)) + return "index: integer expected"; + } + if (message.originalFieldName != null && message.hasOwnProperty("originalFieldName")) + if (!$util.isString(message.originalFieldName)) + return "originalFieldName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.parentType != null && message.hasOwnProperty("parentType")) + if (!$util.isString(message.parentType)) + return "parentType: string expected"; + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) { + let error = $root.Trace.CachePolicy.verify(message.cachePolicy); + if (error) + return "cachePolicy." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + if (message.error != null && message.hasOwnProperty("error")) { + if (!Array.isArray(message.error)) + return "error: array expected"; + for (let i = 0; i < message.error.length; ++i) { + let error = $root.Trace.Error.verify(message.error[i]); + if (error) + return "error." + error; + } + } + if (message.child != null && message.hasOwnProperty("child")) { + if (!Array.isArray(message.child)) + return "child: array expected"; + for (let i = 0; i < message.child.length; ++i) { + let error = $root.Trace.Node.verify(message.child[i]); + if (error) + return "child." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.Node + * @static + * @param {Trace.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.error = []; + object.child = []; + } + if (options.defaults) { + object.type = ""; + object.cachePolicy = null; + object.startTime = 0; + object.endTime = 0; + object.parentType = ""; + object.originalFieldName = ""; + } + if (message.responseName != null && message.hasOwnProperty("responseName")) { + object.responseName = message.responseName; + if (options.oneofs) + object.id = "responseName"; + } + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object.id = "index"; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.cachePolicy != null && message.hasOwnProperty("cachePolicy")) + object.cachePolicy = $root.Trace.CachePolicy.toObject(message.cachePolicy, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime; + if (message.endTime != null && message.hasOwnProperty("endTime")) + if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber(true) : message.endTime; + if (message.error && message.error.length) { + object.error = []; + for (let j = 0; j < message.error.length; ++j) + object.error[j] = $root.Trace.Error.toObject(message.error[j], options); + } + if (message.child && message.child.length) { + object.child = []; + for (let j = 0; j < message.child.length; ++j) + object.child[j] = $root.Trace.Node.toObject(message.child[j], options); + } + if (message.parentType != null && message.hasOwnProperty("parentType")) + object.parentType = message.parentType; + if (message.originalFieldName != null && message.hasOwnProperty("originalFieldName")) + object.originalFieldName = message.originalFieldName; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof Trace.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Node; + })(); + + Trace.QueryPlanNode = (function() { + + /** + * Properties of a QueryPlanNode. + * @memberof Trace + * @interface IQueryPlanNode + * @property {Trace.QueryPlanNode.ISequenceNode|null} [sequence] QueryPlanNode sequence + * @property {Trace.QueryPlanNode.IParallelNode|null} [parallel] QueryPlanNode parallel + * @property {Trace.QueryPlanNode.IFetchNode|null} [fetch] QueryPlanNode fetch + * @property {Trace.QueryPlanNode.IFlattenNode|null} [flatten] QueryPlanNode flatten + * @property {Trace.QueryPlanNode.IDeferNode|null} [defer] QueryPlanNode defer + * @property {Trace.QueryPlanNode.IConditionNode|null} [condition] QueryPlanNode condition + */ + + /** + * Constructs a new QueryPlanNode. + * @memberof Trace + * @classdesc Represents a QueryPlanNode. + * @implements IQueryPlanNode + * @constructor + * @param {Trace.IQueryPlanNode=} [properties] Properties to set + */ + function QueryPlanNode(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryPlanNode sequence. + * @member {Trace.QueryPlanNode.ISequenceNode|null|undefined} sequence + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.sequence = null; + + /** + * QueryPlanNode parallel. + * @member {Trace.QueryPlanNode.IParallelNode|null|undefined} parallel + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.parallel = null; + + /** + * QueryPlanNode fetch. + * @member {Trace.QueryPlanNode.IFetchNode|null|undefined} fetch + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.fetch = null; + + /** + * QueryPlanNode flatten. + * @member {Trace.QueryPlanNode.IFlattenNode|null|undefined} flatten + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.flatten = null; + + /** + * QueryPlanNode defer. + * @member {Trace.QueryPlanNode.IDeferNode|null|undefined} defer + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.defer = null; + + /** + * QueryPlanNode condition. + * @member {Trace.QueryPlanNode.IConditionNode|null|undefined} condition + * @memberof Trace.QueryPlanNode + * @instance + */ + QueryPlanNode.prototype.condition = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * QueryPlanNode node. + * @member {"sequence"|"parallel"|"fetch"|"flatten"|"defer"|"condition"|undefined} node + * @memberof Trace.QueryPlanNode + * @instance + */ + Object.defineProperty(QueryPlanNode.prototype, "node", { + get: $util.oneOfGetter($oneOfFields = ["sequence", "parallel", "fetch", "flatten", "defer", "condition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryPlanNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.IQueryPlanNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode} QueryPlanNode instance + */ + QueryPlanNode.create = function create(properties) { + return new QueryPlanNode(properties); + }; + + /** + * Encodes the specified QueryPlanNode message. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.IQueryPlanNode} message QueryPlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlanNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + $root.Trace.QueryPlanNode.SequenceNode.encode(message.sequence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) + $root.Trace.QueryPlanNode.ParallelNode.encode(message.parallel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fetch != null && Object.hasOwnProperty.call(message, "fetch")) + $root.Trace.QueryPlanNode.FetchNode.encode(message.fetch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.flatten != null && Object.hasOwnProperty.call(message, "flatten")) + $root.Trace.QueryPlanNode.FlattenNode.encode(message.flatten, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.defer != null && Object.hasOwnProperty.call(message, "defer")) + $root.Trace.QueryPlanNode.DeferNode.encode(message.defer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.Trace.QueryPlanNode.ConditionNode.encode(message.condition, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryPlanNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.IQueryPlanNode} message QueryPlanNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryPlanNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode} QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlanNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = $root.Trace.QueryPlanNode.SequenceNode.decode(reader, reader.uint32()); + break; + case 2: + message.parallel = $root.Trace.QueryPlanNode.ParallelNode.decode(reader, reader.uint32()); + break; + case 3: + message.fetch = $root.Trace.QueryPlanNode.FetchNode.decode(reader, reader.uint32()); + break; + case 4: + message.flatten = $root.Trace.QueryPlanNode.FlattenNode.decode(reader, reader.uint32()); + break; + case 5: + message.defer = $root.Trace.QueryPlanNode.DeferNode.decode(reader, reader.uint32()); + break; + case 6: + message.condition = $root.Trace.QueryPlanNode.ConditionNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryPlanNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode} QueryPlanNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryPlanNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryPlanNode message. + * @function verify + * @memberof Trace.QueryPlanNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryPlanNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.sequence != null && message.hasOwnProperty("sequence")) { + properties.node = 1; + { + let error = $root.Trace.QueryPlanNode.SequenceNode.verify(message.sequence); + if (error) + return "sequence." + error; + } + } + if (message.parallel != null && message.hasOwnProperty("parallel")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + let error = $root.Trace.QueryPlanNode.ParallelNode.verify(message.parallel); + if (error) + return "parallel." + error; + } + } + if (message.fetch != null && message.hasOwnProperty("fetch")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + let error = $root.Trace.QueryPlanNode.FetchNode.verify(message.fetch); + if (error) + return "fetch." + error; + } + } + if (message.flatten != null && message.hasOwnProperty("flatten")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + let error = $root.Trace.QueryPlanNode.FlattenNode.verify(message.flatten); + if (error) + return "flatten." + error; + } + } + if (message.defer != null && message.hasOwnProperty("defer")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + let error = $root.Trace.QueryPlanNode.DeferNode.verify(message.defer); + if (error) + return "defer." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + let error = $root.Trace.QueryPlanNode.ConditionNode.verify(message.condition); + if (error) + return "condition." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a QueryPlanNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode + * @static + * @param {Trace.QueryPlanNode} message QueryPlanNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPlanNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.sequence != null && message.hasOwnProperty("sequence")) { + object.sequence = $root.Trace.QueryPlanNode.SequenceNode.toObject(message.sequence, options); + if (options.oneofs) + object.node = "sequence"; + } + if (message.parallel != null && message.hasOwnProperty("parallel")) { + object.parallel = $root.Trace.QueryPlanNode.ParallelNode.toObject(message.parallel, options); + if (options.oneofs) + object.node = "parallel"; + } + if (message.fetch != null && message.hasOwnProperty("fetch")) { + object.fetch = $root.Trace.QueryPlanNode.FetchNode.toObject(message.fetch, options); + if (options.oneofs) + object.node = "fetch"; + } + if (message.flatten != null && message.hasOwnProperty("flatten")) { + object.flatten = $root.Trace.QueryPlanNode.FlattenNode.toObject(message.flatten, options); + if (options.oneofs) + object.node = "flatten"; + } + if (message.defer != null && message.hasOwnProperty("defer")) { + object.defer = $root.Trace.QueryPlanNode.DeferNode.toObject(message.defer, options); + if (options.oneofs) + object.node = "defer"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + object.condition = $root.Trace.QueryPlanNode.ConditionNode.toObject(message.condition, options); + if (options.oneofs) + object.node = "condition"; + } + return object; + }; + + /** + * Converts this QueryPlanNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode + * @instance + * @returns {Object.} JSON object + */ + QueryPlanNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + QueryPlanNode.SequenceNode = (function() { + + /** + * Properties of a SequenceNode. + * @memberof Trace.QueryPlanNode + * @interface ISequenceNode + * @property {Array.|null} [nodes] SequenceNode nodes + */ + + /** + * Constructs a new SequenceNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a SequenceNode. + * @implements ISequenceNode + * @constructor + * @param {Trace.QueryPlanNode.ISequenceNode=} [properties] Properties to set + */ + function SequenceNode(properties) { + this.nodes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SequenceNode nodes. + * @member {Array.} nodes + * @memberof Trace.QueryPlanNode.SequenceNode + * @instance + */ + SequenceNode.prototype.nodes = $util.emptyArray; + + /** + * Creates a new SequenceNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.ISequenceNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode instance + */ + SequenceNode.create = function create(properties) { + return new SequenceNode(properties); + }; + + /** + * Encodes the specified SequenceNode message. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.ISequenceNode} message SequenceNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequenceNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (let i = 0; i < message.nodes.length; ++i) + $root.Trace.QueryPlanNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SequenceNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.SequenceNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.ISequenceNode} message SequenceNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequenceNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SequenceNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequenceNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.SequenceNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.Trace.QueryPlanNode.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SequenceNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.SequenceNode} SequenceNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequenceNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SequenceNode message. + * @function verify + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SequenceNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (let i = 0; i < message.nodes.length; ++i) { + let error = $root.Trace.QueryPlanNode.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a SequenceNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.SequenceNode + * @static + * @param {Trace.QueryPlanNode.SequenceNode} message SequenceNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SequenceNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (let j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.Trace.QueryPlanNode.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this SequenceNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.SequenceNode + * @instance + * @returns {Object.} JSON object + */ + SequenceNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SequenceNode; + })(); + + QueryPlanNode.ParallelNode = (function() { + + /** + * Properties of a ParallelNode. + * @memberof Trace.QueryPlanNode + * @interface IParallelNode + * @property {Array.|null} [nodes] ParallelNode nodes + */ + + /** + * Constructs a new ParallelNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a ParallelNode. + * @implements IParallelNode + * @constructor + * @param {Trace.QueryPlanNode.IParallelNode=} [properties] Properties to set + */ + function ParallelNode(properties) { + this.nodes = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParallelNode nodes. + * @member {Array.} nodes + * @memberof Trace.QueryPlanNode.ParallelNode + * @instance + */ + ParallelNode.prototype.nodes = $util.emptyArray; + + /** + * Creates a new ParallelNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.IParallelNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode instance + */ + ParallelNode.create = function create(properties) { + return new ParallelNode(properties); + }; + + /** + * Encodes the specified ParallelNode message. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.IParallelNode} message ParallelNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParallelNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (let i = 0; i < message.nodes.length; ++i) + $root.Trace.QueryPlanNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParallelNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ParallelNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.IParallelNode} message ParallelNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParallelNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParallelNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParallelNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ParallelNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.Trace.QueryPlanNode.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParallelNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.ParallelNode} ParallelNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParallelNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParallelNode message. + * @function verify + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParallelNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (let i = 0; i < message.nodes.length; ++i) { + let error = $root.Trace.QueryPlanNode.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a ParallelNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.ParallelNode + * @static + * @param {Trace.QueryPlanNode.ParallelNode} message ParallelNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParallelNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (let j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.Trace.QueryPlanNode.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this ParallelNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.ParallelNode + * @instance + * @returns {Object.} JSON object + */ + ParallelNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ParallelNode; + })(); + + QueryPlanNode.FetchNode = (function() { + + /** + * Properties of a FetchNode. + * @memberof Trace.QueryPlanNode + * @interface IFetchNode + * @property {string|null} [serviceName] FetchNode serviceName + * @property {boolean|null} [traceParsingFailed] FetchNode traceParsingFailed + * @property {ITrace|null} [trace] FetchNode trace + * @property {number|null} [sentTimeOffset] FetchNode sentTimeOffset + * @property {google.protobuf.ITimestamp|null} [sentTime] FetchNode sentTime + * @property {google.protobuf.ITimestamp|null} [receivedTime] FetchNode receivedTime + */ + + /** + * Constructs a new FetchNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a FetchNode. + * @implements IFetchNode + * @constructor + * @param {Trace.QueryPlanNode.IFetchNode=} [properties] Properties to set + */ + function FetchNode(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchNode serviceName. + * @member {string} serviceName + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.serviceName = ""; + + /** + * FetchNode traceParsingFailed. + * @member {boolean} traceParsingFailed + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.traceParsingFailed = false; + + /** + * FetchNode trace. + * @member {ITrace|null|undefined} trace + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.trace = null; + + /** + * FetchNode sentTimeOffset. + * @member {number} sentTimeOffset + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.sentTimeOffset = 0; + + /** + * FetchNode sentTime. + * @member {google.protobuf.ITimestamp|null|undefined} sentTime + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.sentTime = null; + + /** + * FetchNode receivedTime. + * @member {google.protobuf.ITimestamp|null|undefined} receivedTime + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + */ + FetchNode.prototype.receivedTime = null; + + /** + * Creates a new FetchNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.IFetchNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.FetchNode} FetchNode instance + */ + FetchNode.create = function create(properties) { + return new FetchNode(properties); + }; + + /** + * Encodes the specified FetchNode message. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.IFetchNode} message FetchNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.traceParsingFailed != null && Object.hasOwnProperty.call(message, "traceParsingFailed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.traceParsingFailed); + if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) + $root.Trace.encode(message.trace, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sentTimeOffset != null && Object.hasOwnProperty.call(message, "sentTimeOffset")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sentTimeOffset); + if (message.sentTime != null && Object.hasOwnProperty.call(message, "sentTime")) + $root.google.protobuf.Timestamp.encode(message.sentTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.receivedTime != null && Object.hasOwnProperty.call(message, "receivedTime")) + $root.google.protobuf.Timestamp.encode(message.receivedTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FetchNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.IFetchNode} message FetchNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.FetchNode} FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.FetchNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceName = reader.string(); + break; + case 2: + message.traceParsingFailed = reader.bool(); + break; + case 3: + message.trace = $root.Trace.decode(reader, reader.uint32()); + break; + case 4: + message.sentTimeOffset = reader.uint64(); + break; + case 5: + message.sentTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.receivedTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.FetchNode} FetchNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchNode message. + * @function verify + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.traceParsingFailed != null && message.hasOwnProperty("traceParsingFailed")) + if (typeof message.traceParsingFailed !== "boolean") + return "traceParsingFailed: boolean expected"; + if (message.trace != null && message.hasOwnProperty("trace")) { + let error = $root.Trace.verify(message.trace); + if (error) + return "trace." + error; + } + if (message.sentTimeOffset != null && message.hasOwnProperty("sentTimeOffset")) + if (!$util.isInteger(message.sentTimeOffset) && !(message.sentTimeOffset && $util.isInteger(message.sentTimeOffset.low) && $util.isInteger(message.sentTimeOffset.high))) + return "sentTimeOffset: integer|Long expected"; + if (message.sentTime != null && message.hasOwnProperty("sentTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.sentTime); + if (error) + return "sentTime." + error; + } + if (message.receivedTime != null && message.hasOwnProperty("receivedTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.receivedTime); + if (error) + return "receivedTime." + error; + } + return null; + }; + + /** + * Creates a plain object from a FetchNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.FetchNode + * @static + * @param {Trace.QueryPlanNode.FetchNode} message FetchNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.serviceName = ""; + object.traceParsingFailed = false; + object.trace = null; + object.sentTimeOffset = 0; + object.sentTime = null; + object.receivedTime = null; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.traceParsingFailed != null && message.hasOwnProperty("traceParsingFailed")) + object.traceParsingFailed = message.traceParsingFailed; + if (message.trace != null && message.hasOwnProperty("trace")) + object.trace = $root.Trace.toObject(message.trace, options); + if (message.sentTimeOffset != null && message.hasOwnProperty("sentTimeOffset")) + if (typeof message.sentTimeOffset === "number") + object.sentTimeOffset = options.longs === String ? String(message.sentTimeOffset) : message.sentTimeOffset; + else + object.sentTimeOffset = options.longs === String ? $util.Long.prototype.toString.call(message.sentTimeOffset) : options.longs === Number ? new $util.LongBits(message.sentTimeOffset.low >>> 0, message.sentTimeOffset.high >>> 0).toNumber(true) : message.sentTimeOffset; + if (message.sentTime != null && message.hasOwnProperty("sentTime")) + object.sentTime = $root.google.protobuf.Timestamp.toObject(message.sentTime, options); + if (message.receivedTime != null && message.hasOwnProperty("receivedTime")) + object.receivedTime = $root.google.protobuf.Timestamp.toObject(message.receivedTime, options); + return object; + }; + + /** + * Converts this FetchNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.FetchNode + * @instance + * @returns {Object.} JSON object + */ + FetchNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FetchNode; + })(); + + QueryPlanNode.FlattenNode = (function() { + + /** + * Properties of a FlattenNode. + * @memberof Trace.QueryPlanNode + * @interface IFlattenNode + * @property {Array.|null} [responsePath] FlattenNode responsePath + * @property {Trace.IQueryPlanNode|null} [node] FlattenNode node + */ + + /** + * Constructs a new FlattenNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a FlattenNode. + * @implements IFlattenNode + * @constructor + * @param {Trace.QueryPlanNode.IFlattenNode=} [properties] Properties to set + */ + function FlattenNode(properties) { + this.responsePath = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlattenNode responsePath. + * @member {Array.} responsePath + * @memberof Trace.QueryPlanNode.FlattenNode + * @instance + */ + FlattenNode.prototype.responsePath = $util.emptyArray; + + /** + * FlattenNode node. + * @member {Trace.IQueryPlanNode|null|undefined} node + * @memberof Trace.QueryPlanNode.FlattenNode + * @instance + */ + FlattenNode.prototype.node = null; + + /** + * Creates a new FlattenNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.IFlattenNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode instance + */ + FlattenNode.create = function create(properties) { + return new FlattenNode(properties); + }; + + /** + * Encodes the specified FlattenNode message. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.IFlattenNode} message FlattenNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlattenNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responsePath != null && message.responsePath.length) + for (let i = 0; i < message.responsePath.length; ++i) + $root.Trace.QueryPlanNode.ResponsePathElement.encode(message.responsePath[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.Trace.QueryPlanNode.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FlattenNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.FlattenNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.IFlattenNode} message FlattenNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlattenNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlattenNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlattenNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.FlattenNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responsePath && message.responsePath.length)) + message.responsePath = []; + message.responsePath.push($root.Trace.QueryPlanNode.ResponsePathElement.decode(reader, reader.uint32())); + break; + case 2: + message.node = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FlattenNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.FlattenNode} FlattenNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlattenNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlattenNode message. + * @function verify + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlattenNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responsePath != null && message.hasOwnProperty("responsePath")) { + if (!Array.isArray(message.responsePath)) + return "responsePath: array expected"; + for (let i = 0; i < message.responsePath.length; ++i) { + let error = $root.Trace.QueryPlanNode.ResponsePathElement.verify(message.responsePath[i]); + if (error) + return "responsePath." + error; + } + } + if (message.node != null && message.hasOwnProperty("node")) { + let error = $root.Trace.QueryPlanNode.verify(message.node); + if (error) + return "node." + error; + } + return null; + }; + + /** + * Creates a plain object from a FlattenNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.FlattenNode + * @static + * @param {Trace.QueryPlanNode.FlattenNode} message FlattenNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlattenNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.responsePath = []; + if (options.defaults) + object.node = null; + if (message.responsePath && message.responsePath.length) { + object.responsePath = []; + for (let j = 0; j < message.responsePath.length; ++j) + object.responsePath[j] = $root.Trace.QueryPlanNode.ResponsePathElement.toObject(message.responsePath[j], options); + } + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.Trace.QueryPlanNode.toObject(message.node, options); + return object; + }; + + /** + * Converts this FlattenNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.FlattenNode + * @instance + * @returns {Object.} JSON object + */ + FlattenNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FlattenNode; + })(); + + QueryPlanNode.DeferNode = (function() { + + /** + * Properties of a DeferNode. + * @memberof Trace.QueryPlanNode + * @interface IDeferNode + * @property {Trace.QueryPlanNode.IDeferNodePrimary|null} [primary] DeferNode primary + * @property {Array.|null} [deferred] DeferNode deferred + */ + + /** + * Constructs a new DeferNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferNode. + * @implements IDeferNode + * @constructor + * @param {Trace.QueryPlanNode.IDeferNode=} [properties] Properties to set + */ + function DeferNode(properties) { + this.deferred = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferNode primary. + * @member {Trace.QueryPlanNode.IDeferNodePrimary|null|undefined} primary + * @memberof Trace.QueryPlanNode.DeferNode + * @instance + */ + DeferNode.prototype.primary = null; + + /** + * DeferNode deferred. + * @member {Array.} deferred + * @memberof Trace.QueryPlanNode.DeferNode + * @instance + */ + DeferNode.prototype.deferred = $util.emptyArray; + + /** + * Creates a new DeferNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.IDeferNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferNode} DeferNode instance + */ + DeferNode.create = function create(properties) { + return new DeferNode(properties); + }; + + /** + * Encodes the specified DeferNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.IDeferNode} message DeferNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primary != null && Object.hasOwnProperty.call(message, "primary")) + $root.Trace.QueryPlanNode.DeferNodePrimary.encode(message.primary, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deferred != null && message.deferred.length) + for (let i = 0; i < message.deferred.length; ++i) + $root.Trace.QueryPlanNode.DeferredNode.encode(message.deferred[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeferNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.IDeferNode} message DeferNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferNode} DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primary = $root.Trace.QueryPlanNode.DeferNodePrimary.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.deferred && message.deferred.length)) + message.deferred = []; + message.deferred.push($root.Trace.QueryPlanNode.DeferredNode.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferNode} DeferNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferNode message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primary != null && message.hasOwnProperty("primary")) { + let error = $root.Trace.QueryPlanNode.DeferNodePrimary.verify(message.primary); + if (error) + return "primary." + error; + } + if (message.deferred != null && message.hasOwnProperty("deferred")) { + if (!Array.isArray(message.deferred)) + return "deferred: array expected"; + for (let i = 0; i < message.deferred.length; ++i) { + let error = $root.Trace.QueryPlanNode.DeferredNode.verify(message.deferred[i]); + if (error) + return "deferred." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a DeferNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferNode + * @static + * @param {Trace.QueryPlanNode.DeferNode} message DeferNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.deferred = []; + if (options.defaults) + object.primary = null; + if (message.primary != null && message.hasOwnProperty("primary")) + object.primary = $root.Trace.QueryPlanNode.DeferNodePrimary.toObject(message.primary, options); + if (message.deferred && message.deferred.length) { + object.deferred = []; + for (let j = 0; j < message.deferred.length; ++j) + object.deferred[j] = $root.Trace.QueryPlanNode.DeferredNode.toObject(message.deferred[j], options); + } + return object; + }; + + /** + * Converts this DeferNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferNode + * @instance + * @returns {Object.} JSON object + */ + DeferNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferNode; + })(); + + QueryPlanNode.ConditionNode = (function() { + + /** + * Properties of a ConditionNode. + * @memberof Trace.QueryPlanNode + * @interface IConditionNode + * @property {string|null} [condition] ConditionNode condition + * @property {Trace.IQueryPlanNode|null} [ifClause] ConditionNode ifClause + * @property {Trace.IQueryPlanNode|null} [elseClause] ConditionNode elseClause + */ + + /** + * Constructs a new ConditionNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a ConditionNode. + * @implements IConditionNode + * @constructor + * @param {Trace.QueryPlanNode.IConditionNode=} [properties] Properties to set + */ + function ConditionNode(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionNode condition. + * @member {string} condition + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + */ + ConditionNode.prototype.condition = ""; + + /** + * ConditionNode ifClause. + * @member {Trace.IQueryPlanNode|null|undefined} ifClause + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + */ + ConditionNode.prototype.ifClause = null; + + /** + * ConditionNode elseClause. + * @member {Trace.IQueryPlanNode|null|undefined} elseClause + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + */ + ConditionNode.prototype.elseClause = null; + + /** + * Creates a new ConditionNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.IConditionNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.ConditionNode} ConditionNode instance + */ + ConditionNode.create = function create(properties) { + return new ConditionNode(properties); + }; + + /** + * Encodes the specified ConditionNode message. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.IConditionNode} message ConditionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.ifClause != null && Object.hasOwnProperty.call(message, "ifClause")) + $root.Trace.QueryPlanNode.encode(message.ifClause, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.elseClause != null && Object.hasOwnProperty.call(message, "elseClause")) + $root.Trace.QueryPlanNode.encode(message.elseClause, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ConditionNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.IConditionNode} message ConditionNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.ConditionNode} ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ConditionNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condition = reader.string(); + break; + case 2: + message.ifClause = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + case 3: + message.elseClause = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.ConditionNode} ConditionNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionNode message. + * @function verify + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.ifClause != null && message.hasOwnProperty("ifClause")) { + let error = $root.Trace.QueryPlanNode.verify(message.ifClause); + if (error) + return "ifClause." + error; + } + if (message.elseClause != null && message.hasOwnProperty("elseClause")) { + let error = $root.Trace.QueryPlanNode.verify(message.elseClause); + if (error) + return "elseClause." + error; + } + return null; + }; + + /** + * Creates a plain object from a ConditionNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.ConditionNode + * @static + * @param {Trace.QueryPlanNode.ConditionNode} message ConditionNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.condition = ""; + object.ifClause = null; + object.elseClause = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.ifClause != null && message.hasOwnProperty("ifClause")) + object.ifClause = $root.Trace.QueryPlanNode.toObject(message.ifClause, options); + if (message.elseClause != null && message.hasOwnProperty("elseClause")) + object.elseClause = $root.Trace.QueryPlanNode.toObject(message.elseClause, options); + return object; + }; + + /** + * Converts this ConditionNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.ConditionNode + * @instance + * @returns {Object.} JSON object + */ + ConditionNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConditionNode; + })(); + + QueryPlanNode.DeferNodePrimary = (function() { + + /** + * Properties of a DeferNodePrimary. + * @memberof Trace.QueryPlanNode + * @interface IDeferNodePrimary + * @property {Trace.IQueryPlanNode|null} [node] DeferNodePrimary node + */ + + /** + * Constructs a new DeferNodePrimary. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferNodePrimary. + * @implements IDeferNodePrimary + * @constructor + * @param {Trace.QueryPlanNode.IDeferNodePrimary=} [properties] Properties to set + */ + function DeferNodePrimary(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferNodePrimary node. + * @member {Trace.IQueryPlanNode|null|undefined} node + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @instance + */ + DeferNodePrimary.prototype.node = null; + + /** + * Creates a new DeferNodePrimary instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.IDeferNodePrimary=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferNodePrimary} DeferNodePrimary instance + */ + DeferNodePrimary.create = function create(properties) { + return new DeferNodePrimary(properties); + }; + + /** + * Encodes the specified DeferNodePrimary message. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.IDeferNodePrimary} message DeferNodePrimary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNodePrimary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.Trace.QueryPlanNode.encode(message.node, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeferNodePrimary message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferNodePrimary.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.IDeferNodePrimary} message DeferNodePrimary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferNodePrimary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferNodePrimary} DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNodePrimary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferNodePrimary(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.node = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferNodePrimary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferNodePrimary} DeferNodePrimary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferNodePrimary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferNodePrimary message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferNodePrimary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.node != null && message.hasOwnProperty("node")) { + let error = $root.Trace.QueryPlanNode.verify(message.node); + if (error) + return "node." + error; + } + return null; + }; + + /** + * Creates a plain object from a DeferNodePrimary message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @static + * @param {Trace.QueryPlanNode.DeferNodePrimary} message DeferNodePrimary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferNodePrimary.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.node = null; + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.Trace.QueryPlanNode.toObject(message.node, options); + return object; + }; + + /** + * Converts this DeferNodePrimary to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferNodePrimary + * @instance + * @returns {Object.} JSON object + */ + DeferNodePrimary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferNodePrimary; + })(); + + QueryPlanNode.DeferredNode = (function() { + + /** + * Properties of a DeferredNode. + * @memberof Trace.QueryPlanNode + * @interface IDeferredNode + * @property {Array.|null} [depends] DeferredNode depends + * @property {string|null} [label] DeferredNode label + * @property {Array.|null} [path] DeferredNode path + * @property {Trace.IQueryPlanNode|null} [node] DeferredNode node + */ + + /** + * Constructs a new DeferredNode. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferredNode. + * @implements IDeferredNode + * @constructor + * @param {Trace.QueryPlanNode.IDeferredNode=} [properties] Properties to set + */ + function DeferredNode(properties) { + this.depends = []; + this.path = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferredNode depends. + * @member {Array.} depends + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.depends = $util.emptyArray; + + /** + * DeferredNode label. + * @member {string} label + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.label = ""; + + /** + * DeferredNode path. + * @member {Array.} path + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.path = $util.emptyArray; + + /** + * DeferredNode node. + * @member {Trace.IQueryPlanNode|null|undefined} node + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + */ + DeferredNode.prototype.node = null; + + /** + * Creates a new DeferredNode instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.IDeferredNode=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferredNode} DeferredNode instance + */ + DeferredNode.create = function create(properties) { + return new DeferredNode(properties); + }; + + /** + * Encodes the specified DeferredNode message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.IDeferredNode} message DeferredNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.depends != null && message.depends.length) + for (let i = 0; i < message.depends.length; ++i) + $root.Trace.QueryPlanNode.DeferredNodeDepends.encode(message.depends[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.path != null && message.path.length) + for (let i = 0; i < message.path.length; ++i) + $root.Trace.QueryPlanNode.ResponsePathElement.encode(message.path[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.Trace.QueryPlanNode.encode(message.node, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeferredNode message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNode.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.IDeferredNode} message DeferredNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferredNode message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferredNode} DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferredNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.depends && message.depends.length)) + message.depends = []; + message.depends.push($root.Trace.QueryPlanNode.DeferredNodeDepends.decode(reader, reader.uint32())); + break; + case 2: + message.label = reader.string(); + break; + case 3: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push($root.Trace.QueryPlanNode.ResponsePathElement.decode(reader, reader.uint32())); + break; + case 4: + message.node = $root.Trace.QueryPlanNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferredNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferredNode} DeferredNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferredNode message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferredNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.depends != null && message.hasOwnProperty("depends")) { + if (!Array.isArray(message.depends)) + return "depends: array expected"; + for (let i = 0; i < message.depends.length; ++i) { + let error = $root.Trace.QueryPlanNode.DeferredNodeDepends.verify(message.depends[i]); + if (error) + return "depends." + error; + } + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (let i = 0; i < message.path.length; ++i) { + let error = $root.Trace.QueryPlanNode.ResponsePathElement.verify(message.path[i]); + if (error) + return "path." + error; + } + } + if (message.node != null && message.hasOwnProperty("node")) { + let error = $root.Trace.QueryPlanNode.verify(message.node); + if (error) + return "node." + error; + } + return null; + }; + + /** + * Creates a plain object from a DeferredNode message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferredNode + * @static + * @param {Trace.QueryPlanNode.DeferredNode} message DeferredNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferredNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.depends = []; + object.path = []; + } + if (options.defaults) { + object.label = ""; + object.node = null; + } + if (message.depends && message.depends.length) { + object.depends = []; + for (let j = 0; j < message.depends.length; ++j) + object.depends[j] = $root.Trace.QueryPlanNode.DeferredNodeDepends.toObject(message.depends[j], options); + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.path && message.path.length) { + object.path = []; + for (let j = 0; j < message.path.length; ++j) + object.path[j] = $root.Trace.QueryPlanNode.ResponsePathElement.toObject(message.path[j], options); + } + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.Trace.QueryPlanNode.toObject(message.node, options); + return object; + }; + + /** + * Converts this DeferredNode to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferredNode + * @instance + * @returns {Object.} JSON object + */ + DeferredNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferredNode; + })(); + + QueryPlanNode.DeferredNodeDepends = (function() { + + /** + * Properties of a DeferredNodeDepends. + * @memberof Trace.QueryPlanNode + * @interface IDeferredNodeDepends + * @property {string|null} [id] DeferredNodeDepends id + * @property {string|null} [deferLabel] DeferredNodeDepends deferLabel + */ + + /** + * Constructs a new DeferredNodeDepends. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a DeferredNodeDepends. + * @implements IDeferredNodeDepends + * @constructor + * @param {Trace.QueryPlanNode.IDeferredNodeDepends=} [properties] Properties to set + */ + function DeferredNodeDepends(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeferredNodeDepends id. + * @member {string} id + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @instance + */ + DeferredNodeDepends.prototype.id = ""; + + /** + * DeferredNodeDepends deferLabel. + * @member {string} deferLabel + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @instance + */ + DeferredNodeDepends.prototype.deferLabel = ""; + + /** + * Creates a new DeferredNodeDepends instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.IDeferredNodeDepends=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.DeferredNodeDepends} DeferredNodeDepends instance + */ + DeferredNodeDepends.create = function create(properties) { + return new DeferredNodeDepends(properties); + }; + + /** + * Encodes the specified DeferredNodeDepends message. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.IDeferredNodeDepends} message DeferredNodeDepends message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNodeDepends.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.deferLabel != null && Object.hasOwnProperty.call(message, "deferLabel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deferLabel); + return writer; + }; + + /** + * Encodes the specified DeferredNodeDepends message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.DeferredNodeDepends.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.IDeferredNodeDepends} message DeferredNodeDepends message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeferredNodeDepends.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.DeferredNodeDepends} DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNodeDepends.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.DeferredNodeDepends(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.deferLabel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeferredNodeDepends message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.DeferredNodeDepends} DeferredNodeDepends + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeferredNodeDepends.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeferredNodeDepends message. + * @function verify + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeferredNodeDepends.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.deferLabel != null && message.hasOwnProperty("deferLabel")) + if (!$util.isString(message.deferLabel)) + return "deferLabel: string expected"; + return null; + }; + + /** + * Creates a plain object from a DeferredNodeDepends message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @static + * @param {Trace.QueryPlanNode.DeferredNodeDepends} message DeferredNodeDepends + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeferredNodeDepends.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.id = ""; + object.deferLabel = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.deferLabel != null && message.hasOwnProperty("deferLabel")) + object.deferLabel = message.deferLabel; + return object; + }; + + /** + * Converts this DeferredNodeDepends to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.DeferredNodeDepends + * @instance + * @returns {Object.} JSON object + */ + DeferredNodeDepends.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeferredNodeDepends; + })(); + + QueryPlanNode.ResponsePathElement = (function() { + + /** + * Properties of a ResponsePathElement. + * @memberof Trace.QueryPlanNode + * @interface IResponsePathElement + * @property {string|null} [fieldName] ResponsePathElement fieldName + * @property {number|null} [index] ResponsePathElement index + */ + + /** + * Constructs a new ResponsePathElement. + * @memberof Trace.QueryPlanNode + * @classdesc Represents a ResponsePathElement. + * @implements IResponsePathElement + * @constructor + * @param {Trace.QueryPlanNode.IResponsePathElement=} [properties] Properties to set + */ + function ResponsePathElement(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponsePathElement fieldName. + * @member {string} fieldName + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + */ + ResponsePathElement.prototype.fieldName = ""; + + /** + * ResponsePathElement index. + * @member {number} index + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + */ + ResponsePathElement.prototype.index = 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ResponsePathElement id. + * @member {"fieldName"|"index"|undefined} id + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + */ + Object.defineProperty(ResponsePathElement.prototype, "id", { + get: $util.oneOfGetter($oneOfFields = ["fieldName", "index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponsePathElement instance using the specified properties. + * @function create + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.IResponsePathElement=} [properties] Properties to set + * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement instance + */ + ResponsePathElement.create = function create(properties) { + return new ResponsePathElement(properties); + }; + + /** + * Encodes the specified ResponsePathElement message. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @function encode + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.IResponsePathElement} message ResponsePathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponsePathElement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); + return writer; + }; + + /** + * Encodes the specified ResponsePathElement message, length delimited. Does not implicitly {@link Trace.QueryPlanNode.ResponsePathElement.verify|verify} messages. + * @function encodeDelimited + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.IResponsePathElement} message ResponsePathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponsePathElement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer. + * @function decode + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponsePathElement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Trace.QueryPlanNode.ResponsePathElement(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fieldName = reader.string(); + break; + case 2: + message.index = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponsePathElement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Trace.QueryPlanNode.ResponsePathElement} ResponsePathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponsePathElement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponsePathElement message. + * @function verify + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponsePathElement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + let properties = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) { + properties.id = 1; + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + if (properties.id === 1) + return "id: multiple values"; + properties.id = 1; + if (!$util.isInteger(message.index)) + return "index: integer expected"; + } + return null; + }; + + /** + * Creates a plain object from a ResponsePathElement message. Also converts values to other types if specified. + * @function toObject + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @static + * @param {Trace.QueryPlanNode.ResponsePathElement} message ResponsePathElement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponsePathElement.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) { + object.fieldName = message.fieldName; + if (options.oneofs) + object.id = "fieldName"; + } + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object.id = "index"; + } + return object; + }; + + /** + * Converts this ResponsePathElement to JSON. + * @function toJSON + * @memberof Trace.QueryPlanNode.ResponsePathElement + * @instance + * @returns {Object.} JSON object + */ + ResponsePathElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponsePathElement; + })(); + + return QueryPlanNode; + })(); + + return Trace; +})(); + +export const ReportHeader = $root.ReportHeader = (() => { + + /** + * Properties of a ReportHeader. + * @exports IReportHeader + * @interface IReportHeader + * @property {string|null} [graphRef] ReportHeader graphRef + * @property {string|null} [hostname] ReportHeader hostname + * @property {string|null} [agentVersion] ReportHeader agentVersion + * @property {string|null} [serviceVersion] ReportHeader serviceVersion + * @property {string|null} [runtimeVersion] ReportHeader runtimeVersion + * @property {string|null} [uname] ReportHeader uname + * @property {string|null} [executableSchemaId] ReportHeader executableSchemaId + */ + + /** + * Constructs a new ReportHeader. + * @exports ReportHeader + * @classdesc Represents a ReportHeader. + * @implements IReportHeader + * @constructor + * @param {IReportHeader=} [properties] Properties to set + */ + function ReportHeader(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportHeader graphRef. + * @member {string} graphRef + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.graphRef = ""; + + /** + * ReportHeader hostname. + * @member {string} hostname + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.hostname = ""; + + /** + * ReportHeader agentVersion. + * @member {string} agentVersion + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.agentVersion = ""; + + /** + * ReportHeader serviceVersion. + * @member {string} serviceVersion + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.serviceVersion = ""; + + /** + * ReportHeader runtimeVersion. + * @member {string} runtimeVersion + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.runtimeVersion = ""; + + /** + * ReportHeader uname. + * @member {string} uname + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.uname = ""; + + /** + * ReportHeader executableSchemaId. + * @member {string} executableSchemaId + * @memberof ReportHeader + * @instance + */ + ReportHeader.prototype.executableSchemaId = ""; + + /** + * Creates a new ReportHeader instance using the specified properties. + * @function create + * @memberof ReportHeader + * @static + * @param {IReportHeader=} [properties] Properties to set + * @returns {ReportHeader} ReportHeader instance + */ + ReportHeader.create = function create(properties) { + return new ReportHeader(properties); + }; + + /** + * Encodes the specified ReportHeader message. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @function encode + * @memberof ReportHeader + * @static + * @param {IReportHeader} message ReportHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostname); + if (message.agentVersion != null && Object.hasOwnProperty.call(message, "agentVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.agentVersion); + if (message.serviceVersion != null && Object.hasOwnProperty.call(message, "serviceVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceVersion); + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.runtimeVersion); + if (message.uname != null && Object.hasOwnProperty.call(message, "uname")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.uname); + if (message.executableSchemaId != null && Object.hasOwnProperty.call(message, "executableSchemaId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.executableSchemaId); + if (message.graphRef != null && Object.hasOwnProperty.call(message, "graphRef")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.graphRef); + return writer; + }; + + /** + * Encodes the specified ReportHeader message, length delimited. Does not implicitly {@link ReportHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof ReportHeader + * @static + * @param {IReportHeader} message ReportHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportHeader message from the specified reader or buffer. + * @function decode + * @memberof ReportHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ReportHeader} ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ReportHeader(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 12: + message.graphRef = reader.string(); + break; + case 5: + message.hostname = reader.string(); + break; + case 6: + message.agentVersion = reader.string(); + break; + case 7: + message.serviceVersion = reader.string(); + break; + case 8: + message.runtimeVersion = reader.string(); + break; + case 9: + message.uname = reader.string(); + break; + case 11: + message.executableSchemaId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ReportHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ReportHeader} ReportHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportHeader message. + * @function verify + * @memberof ReportHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.graphRef != null && message.hasOwnProperty("graphRef")) + if (!$util.isString(message.graphRef)) + return "graphRef: string expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + if (!$util.isString(message.agentVersion)) + return "agentVersion: string expected"; + if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion")) + if (!$util.isString(message.serviceVersion)) + return "serviceVersion: string expected"; + if (message.runtimeVersion != null && message.hasOwnProperty("runtimeVersion")) + if (!$util.isString(message.runtimeVersion)) + return "runtimeVersion: string expected"; + if (message.uname != null && message.hasOwnProperty("uname")) + if (!$util.isString(message.uname)) + return "uname: string expected"; + if (message.executableSchemaId != null && message.hasOwnProperty("executableSchemaId")) + if (!$util.isString(message.executableSchemaId)) + return "executableSchemaId: string expected"; + return null; + }; + + /** + * Creates a plain object from a ReportHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof ReportHeader + * @static + * @param {ReportHeader} message ReportHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.hostname = ""; + object.agentVersion = ""; + object.serviceVersion = ""; + object.runtimeVersion = ""; + object.uname = ""; + object.executableSchemaId = ""; + object.graphRef = ""; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + object.agentVersion = message.agentVersion; + if (message.serviceVersion != null && message.hasOwnProperty("serviceVersion")) + object.serviceVersion = message.serviceVersion; + if (message.runtimeVersion != null && message.hasOwnProperty("runtimeVersion")) + object.runtimeVersion = message.runtimeVersion; + if (message.uname != null && message.hasOwnProperty("uname")) + object.uname = message.uname; + if (message.executableSchemaId != null && message.hasOwnProperty("executableSchemaId")) + object.executableSchemaId = message.executableSchemaId; + if (message.graphRef != null && message.hasOwnProperty("graphRef")) + object.graphRef = message.graphRef; + return object; + }; + + /** + * Converts this ReportHeader to JSON. + * @function toJSON + * @memberof ReportHeader + * @instance + * @returns {Object.} JSON object + */ + ReportHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReportHeader; +})(); + +export const PathErrorStats = $root.PathErrorStats = (() => { + + /** + * Properties of a PathErrorStats. + * @exports IPathErrorStats + * @interface IPathErrorStats + * @property {Object.|null} [children] PathErrorStats children + * @property {number|null} [errorsCount] PathErrorStats errorsCount + * @property {number|null} [requestsWithErrorsCount] PathErrorStats requestsWithErrorsCount + */ + + /** + * Constructs a new PathErrorStats. + * @exports PathErrorStats + * @classdesc Represents a PathErrorStats. + * @implements IPathErrorStats + * @constructor + * @param {IPathErrorStats=} [properties] Properties to set + */ + function PathErrorStats(properties) { + this.children = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PathErrorStats children. + * @member {Object.} children + * @memberof PathErrorStats + * @instance + */ + PathErrorStats.prototype.children = $util.emptyObject; + + /** + * PathErrorStats errorsCount. + * @member {number} errorsCount + * @memberof PathErrorStats + * @instance + */ + PathErrorStats.prototype.errorsCount = 0; + + /** + * PathErrorStats requestsWithErrorsCount. + * @member {number} requestsWithErrorsCount + * @memberof PathErrorStats + * @instance + */ + PathErrorStats.prototype.requestsWithErrorsCount = 0; + + /** + * Creates a new PathErrorStats instance using the specified properties. + * @function create + * @memberof PathErrorStats + * @static + * @param {IPathErrorStats=} [properties] Properties to set + * @returns {PathErrorStats} PathErrorStats instance + */ + PathErrorStats.create = function create(properties) { + return new PathErrorStats(properties); + }; + + /** + * Encodes the specified PathErrorStats message. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @function encode + * @memberof PathErrorStats + * @static + * @param {IPathErrorStats} message PathErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathErrorStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.children != null && Object.hasOwnProperty.call(message, "children")) + for (let keys = Object.keys(message.children), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.PathErrorStats.encode(message.children[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.errorsCount != null && Object.hasOwnProperty.call(message, "errorsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.errorsCount); + if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.requestsWithErrorsCount); + return writer; + }; + + /** + * Encodes the specified PathErrorStats message, length delimited. Does not implicitly {@link PathErrorStats.verify|verify} messages. + * @function encodeDelimited + * @memberof PathErrorStats + * @static + * @param {IPathErrorStats} message PathErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathErrorStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer. + * @function decode + * @memberof PathErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {PathErrorStats} PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathErrorStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.PathErrorStats(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.children === $util.emptyObject) + message.children = {}; + key = reader.string(); + reader.pos++; + message.children[key] = $root.PathErrorStats.decode(reader, reader.uint32()); + break; + case 4: + message.errorsCount = reader.uint64(); + break; + case 5: + message.requestsWithErrorsCount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PathErrorStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof PathErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {PathErrorStats} PathErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathErrorStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PathErrorStats message. + * @function verify + * @memberof PathErrorStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathErrorStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.children != null && message.hasOwnProperty("children")) { + if (!$util.isObject(message.children)) + return "children: object expected"; + let key = Object.keys(message.children); + for (let i = 0; i < key.length; ++i) { + let error = $root.PathErrorStats.verify(message.children[key[i]]); + if (error) + return "children." + error; + } + } + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (!$util.isInteger(message.errorsCount) && !(message.errorsCount && $util.isInteger(message.errorsCount.low) && $util.isInteger(message.errorsCount.high))) + return "errorsCount: integer|Long expected"; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high))) + return "requestsWithErrorsCount: integer|Long expected"; + return null; + }; + + /** + * Creates a plain object from a PathErrorStats message. Also converts values to other types if specified. + * @function toObject + * @memberof PathErrorStats + * @static + * @param {PathErrorStats} message PathErrorStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathErrorStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.children = {}; + if (options.defaults) { + object.errorsCount = 0; + object.requestsWithErrorsCount = 0; + } + let keys2; + if (message.children && (keys2 = Object.keys(message.children)).length) { + object.children = {}; + for (let j = 0; j < keys2.length; ++j) + object.children[keys2[j]] = $root.PathErrorStats.toObject(message.children[keys2[j]], options); + } + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (typeof message.errorsCount === "number") + object.errorsCount = options.longs === String ? String(message.errorsCount) : message.errorsCount; + else + object.errorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorsCount) : options.longs === Number ? new $util.LongBits(message.errorsCount.low >>> 0, message.errorsCount.high >>> 0).toNumber(true) : message.errorsCount; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (typeof message.requestsWithErrorsCount === "number") + object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount; + else + object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount; + return object; + }; + + /** + * Converts this PathErrorStats to JSON. + * @function toJSON + * @memberof PathErrorStats + * @instance + * @returns {Object.} JSON object + */ + PathErrorStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PathErrorStats; +})(); + +export const QueryLatencyStats = $root.QueryLatencyStats = (() => { + + /** + * Properties of a QueryLatencyStats. + * @exports IQueryLatencyStats + * @interface IQueryLatencyStats + * @property {$protobuf.ToArray.|Array.|null} [latencyCount] QueryLatencyStats latencyCount + * @property {number|null} [requestCount] QueryLatencyStats requestCount + * @property {number|null} [cacheHits] QueryLatencyStats cacheHits + * @property {number|null} [persistedQueryHits] QueryLatencyStats persistedQueryHits + * @property {number|null} [persistedQueryMisses] QueryLatencyStats persistedQueryMisses + * @property {$protobuf.ToArray.|Array.|null} [cacheLatencyCount] QueryLatencyStats cacheLatencyCount + * @property {IPathErrorStats|null} [rootErrorStats] QueryLatencyStats rootErrorStats + * @property {number|null} [requestsWithErrorsCount] QueryLatencyStats requestsWithErrorsCount + * @property {$protobuf.ToArray.|Array.|null} [publicCacheTtlCount] QueryLatencyStats publicCacheTtlCount + * @property {$protobuf.ToArray.|Array.|null} [privateCacheTtlCount] QueryLatencyStats privateCacheTtlCount + * @property {number|null} [registeredOperationCount] QueryLatencyStats registeredOperationCount + * @property {number|null} [forbiddenOperationCount] QueryLatencyStats forbiddenOperationCount + * @property {number|null} [requestsWithoutFieldInstrumentation] QueryLatencyStats requestsWithoutFieldInstrumentation + */ + + /** + * Constructs a new QueryLatencyStats. + * @exports QueryLatencyStats + * @classdesc Represents a QueryLatencyStats. + * @implements IQueryLatencyStats + * @constructor + * @param {IQueryLatencyStats=} [properties] Properties to set + */ + function QueryLatencyStats(properties) { + this.latencyCount = []; + this.cacheLatencyCount = []; + this.publicCacheTtlCount = []; + this.privateCacheTtlCount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryLatencyStats latencyCount. + * @member {Array.} latencyCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.latencyCount = $util.emptyArray; + + /** + * QueryLatencyStats requestCount. + * @member {number} requestCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.requestCount = 0; + + /** + * QueryLatencyStats cacheHits. + * @member {number} cacheHits + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.cacheHits = 0; + + /** + * QueryLatencyStats persistedQueryHits. + * @member {number} persistedQueryHits + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.persistedQueryHits = 0; + + /** + * QueryLatencyStats persistedQueryMisses. + * @member {number} persistedQueryMisses + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.persistedQueryMisses = 0; + + /** + * QueryLatencyStats cacheLatencyCount. + * @member {Array.} cacheLatencyCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.cacheLatencyCount = $util.emptyArray; + + /** + * QueryLatencyStats rootErrorStats. + * @member {IPathErrorStats|null|undefined} rootErrorStats + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.rootErrorStats = null; + + /** + * QueryLatencyStats requestsWithErrorsCount. + * @member {number} requestsWithErrorsCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.requestsWithErrorsCount = 0; + + /** + * QueryLatencyStats publicCacheTtlCount. + * @member {Array.} publicCacheTtlCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.publicCacheTtlCount = $util.emptyArray; + + /** + * QueryLatencyStats privateCacheTtlCount. + * @member {Array.} privateCacheTtlCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.privateCacheTtlCount = $util.emptyArray; + + /** + * QueryLatencyStats registeredOperationCount. + * @member {number} registeredOperationCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.registeredOperationCount = 0; + + /** + * QueryLatencyStats forbiddenOperationCount. + * @member {number} forbiddenOperationCount + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.forbiddenOperationCount = 0; + + /** + * QueryLatencyStats requestsWithoutFieldInstrumentation. + * @member {number} requestsWithoutFieldInstrumentation + * @memberof QueryLatencyStats + * @instance + */ + QueryLatencyStats.prototype.requestsWithoutFieldInstrumentation = 0; + + /** + * Creates a new QueryLatencyStats instance using the specified properties. + * @function create + * @memberof QueryLatencyStats + * @static + * @param {IQueryLatencyStats=} [properties] Properties to set + * @returns {QueryLatencyStats} QueryLatencyStats instance + */ + QueryLatencyStats.create = function create(properties) { + return new QueryLatencyStats(properties); + }; + + /** + * Encodes the specified QueryLatencyStats message. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @function encode + * @memberof QueryLatencyStats + * @static + * @param {IQueryLatencyStats} message QueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryLatencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestCount != null && Object.hasOwnProperty.call(message, "requestCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.requestCount); + if (message.cacheHits != null && Object.hasOwnProperty.call(message, "cacheHits")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.cacheHits); + if (message.persistedQueryHits != null && Object.hasOwnProperty.call(message, "persistedQueryHits")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.persistedQueryHits); + if (message.persistedQueryMisses != null && Object.hasOwnProperty.call(message, "persistedQueryMisses")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.persistedQueryMisses); + if (message.rootErrorStats != null && Object.hasOwnProperty.call(message, "rootErrorStats")) + $root.PathErrorStats.encode(message.rootErrorStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.requestsWithErrorsCount); + if (message.registeredOperationCount != null && Object.hasOwnProperty.call(message, "registeredOperationCount")) + writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.registeredOperationCount); + if (message.forbiddenOperationCount != null && Object.hasOwnProperty.call(message, "forbiddenOperationCount")) + writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.forbiddenOperationCount); + let array13; + if (message.latencyCount != null && message.latencyCount.toArray) + array13 = message.latencyCount.toArray(); + else + array13 = message.latencyCount; + if (array13 != null && array13.length) { + writer.uint32(/* id 13, wireType 2 =*/106).fork(); + for (let i = 0; i < array13.length; ++i) + writer.sint64(array13[i]); + writer.ldelim(); + } + let array14; + if (message.cacheLatencyCount != null && message.cacheLatencyCount.toArray) + array14 = message.cacheLatencyCount.toArray(); + else + array14 = message.cacheLatencyCount; + if (array14 != null && array14.length) { + writer.uint32(/* id 14, wireType 2 =*/114).fork(); + for (let i = 0; i < array14.length; ++i) + writer.sint64(array14[i]); + writer.ldelim(); + } + let array15; + if (message.publicCacheTtlCount != null && message.publicCacheTtlCount.toArray) + array15 = message.publicCacheTtlCount.toArray(); + else + array15 = message.publicCacheTtlCount; + if (array15 != null && array15.length) { + writer.uint32(/* id 15, wireType 2 =*/122).fork(); + for (let i = 0; i < array15.length; ++i) + writer.sint64(array15[i]); + writer.ldelim(); + } + let array16; + if (message.privateCacheTtlCount != null && message.privateCacheTtlCount.toArray) + array16 = message.privateCacheTtlCount.toArray(); + else + array16 = message.privateCacheTtlCount; + if (array16 != null && array16.length) { + writer.uint32(/* id 16, wireType 2 =*/130).fork(); + for (let i = 0; i < array16.length; ++i) + writer.sint64(array16[i]); + writer.ldelim(); + } + if (message.requestsWithoutFieldInstrumentation != null && Object.hasOwnProperty.call(message, "requestsWithoutFieldInstrumentation")) + writer.uint32(/* id 17, wireType 0 =*/136).uint64(message.requestsWithoutFieldInstrumentation); + return writer; + }; + + /** + * Encodes the specified QueryLatencyStats message, length delimited. Does not implicitly {@link QueryLatencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof QueryLatencyStats + * @static + * @param {IQueryLatencyStats} message QueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryLatencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer. + * @function decode + * @memberof QueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {QueryLatencyStats} QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryLatencyStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.QueryLatencyStats(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 13: + if (!(message.latencyCount && message.latencyCount.length)) + message.latencyCount = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.latencyCount.push(reader.sint64()); + } else + message.latencyCount.push(reader.sint64()); + break; + case 2: + message.requestCount = reader.uint64(); + break; + case 3: + message.cacheHits = reader.uint64(); + break; + case 4: + message.persistedQueryHits = reader.uint64(); + break; + case 5: + message.persistedQueryMisses = reader.uint64(); + break; + case 14: + if (!(message.cacheLatencyCount && message.cacheLatencyCount.length)) + message.cacheLatencyCount = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.cacheLatencyCount.push(reader.sint64()); + } else + message.cacheLatencyCount.push(reader.sint64()); + break; + case 7: + message.rootErrorStats = $root.PathErrorStats.decode(reader, reader.uint32()); + break; + case 8: + message.requestsWithErrorsCount = reader.uint64(); + break; + case 15: + if (!(message.publicCacheTtlCount && message.publicCacheTtlCount.length)) + message.publicCacheTtlCount = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicCacheTtlCount.push(reader.sint64()); + } else + message.publicCacheTtlCount.push(reader.sint64()); + break; + case 16: + if (!(message.privateCacheTtlCount && message.privateCacheTtlCount.length)) + message.privateCacheTtlCount = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.privateCacheTtlCount.push(reader.sint64()); + } else + message.privateCacheTtlCount.push(reader.sint64()); + break; + case 11: + message.registeredOperationCount = reader.uint64(); + break; + case 12: + message.forbiddenOperationCount = reader.uint64(); + break; + case 17: + message.requestsWithoutFieldInstrumentation = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryLatencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof QueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {QueryLatencyStats} QueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryLatencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryLatencyStats message. + * @function verify + * @memberof QueryLatencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryLatencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latencyCount != null && message.hasOwnProperty("latencyCount")) { + let array13; + if (message.latencyCount != null && message.latencyCount.toArray) + array13 = message.latencyCount.toArray(); + else + array13 = message.latencyCount; + if (!Array.isArray(array13)) + return "latencyCount: array expected"; + for (let i = 0; i < array13.length; ++i) + if (!$util.isInteger(array13[i]) && !(array13[i] && $util.isInteger(array13[i].low) && $util.isInteger(array13[i].high))) + return "latencyCount: integer|Long[] expected"; + } + if (message.requestCount != null && message.hasOwnProperty("requestCount")) + if (!$util.isInteger(message.requestCount) && !(message.requestCount && $util.isInteger(message.requestCount.low) && $util.isInteger(message.requestCount.high))) + return "requestCount: integer|Long expected"; + if (message.cacheHits != null && message.hasOwnProperty("cacheHits")) + if (!$util.isInteger(message.cacheHits) && !(message.cacheHits && $util.isInteger(message.cacheHits.low) && $util.isInteger(message.cacheHits.high))) + return "cacheHits: integer|Long expected"; + if (message.persistedQueryHits != null && message.hasOwnProperty("persistedQueryHits")) + if (!$util.isInteger(message.persistedQueryHits) && !(message.persistedQueryHits && $util.isInteger(message.persistedQueryHits.low) && $util.isInteger(message.persistedQueryHits.high))) + return "persistedQueryHits: integer|Long expected"; + if (message.persistedQueryMisses != null && message.hasOwnProperty("persistedQueryMisses")) + if (!$util.isInteger(message.persistedQueryMisses) && !(message.persistedQueryMisses && $util.isInteger(message.persistedQueryMisses.low) && $util.isInteger(message.persistedQueryMisses.high))) + return "persistedQueryMisses: integer|Long expected"; + if (message.cacheLatencyCount != null && message.hasOwnProperty("cacheLatencyCount")) { + let array14; + if (message.cacheLatencyCount != null && message.cacheLatencyCount.toArray) + array14 = message.cacheLatencyCount.toArray(); + else + array14 = message.cacheLatencyCount; + if (!Array.isArray(array14)) + return "cacheLatencyCount: array expected"; + for (let i = 0; i < array14.length; ++i) + if (!$util.isInteger(array14[i]) && !(array14[i] && $util.isInteger(array14[i].low) && $util.isInteger(array14[i].high))) + return "cacheLatencyCount: integer|Long[] expected"; + } + if (message.rootErrorStats != null && message.hasOwnProperty("rootErrorStats")) { + let error = $root.PathErrorStats.verify(message.rootErrorStats); + if (error) + return "rootErrorStats." + error; + } + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high))) + return "requestsWithErrorsCount: integer|Long expected"; + if (message.publicCacheTtlCount != null && message.hasOwnProperty("publicCacheTtlCount")) { + let array15; + if (message.publicCacheTtlCount != null && message.publicCacheTtlCount.toArray) + array15 = message.publicCacheTtlCount.toArray(); + else + array15 = message.publicCacheTtlCount; + if (!Array.isArray(array15)) + return "publicCacheTtlCount: array expected"; + for (let i = 0; i < array15.length; ++i) + if (!$util.isInteger(array15[i]) && !(array15[i] && $util.isInteger(array15[i].low) && $util.isInteger(array15[i].high))) + return "publicCacheTtlCount: integer|Long[] expected"; + } + if (message.privateCacheTtlCount != null && message.hasOwnProperty("privateCacheTtlCount")) { + let array16; + if (message.privateCacheTtlCount != null && message.privateCacheTtlCount.toArray) + array16 = message.privateCacheTtlCount.toArray(); + else + array16 = message.privateCacheTtlCount; + if (!Array.isArray(array16)) + return "privateCacheTtlCount: array expected"; + for (let i = 0; i < array16.length; ++i) + if (!$util.isInteger(array16[i]) && !(array16[i] && $util.isInteger(array16[i].low) && $util.isInteger(array16[i].high))) + return "privateCacheTtlCount: integer|Long[] expected"; + } + if (message.registeredOperationCount != null && message.hasOwnProperty("registeredOperationCount")) + if (!$util.isInteger(message.registeredOperationCount) && !(message.registeredOperationCount && $util.isInteger(message.registeredOperationCount.low) && $util.isInteger(message.registeredOperationCount.high))) + return "registeredOperationCount: integer|Long expected"; + if (message.forbiddenOperationCount != null && message.hasOwnProperty("forbiddenOperationCount")) + if (!$util.isInteger(message.forbiddenOperationCount) && !(message.forbiddenOperationCount && $util.isInteger(message.forbiddenOperationCount.low) && $util.isInteger(message.forbiddenOperationCount.high))) + return "forbiddenOperationCount: integer|Long expected"; + if (message.requestsWithoutFieldInstrumentation != null && message.hasOwnProperty("requestsWithoutFieldInstrumentation")) + if (!$util.isInteger(message.requestsWithoutFieldInstrumentation) && !(message.requestsWithoutFieldInstrumentation && $util.isInteger(message.requestsWithoutFieldInstrumentation.low) && $util.isInteger(message.requestsWithoutFieldInstrumentation.high))) + return "requestsWithoutFieldInstrumentation: integer|Long expected"; + return null; + }; + + /** + * Creates a plain object from a QueryLatencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof QueryLatencyStats + * @static + * @param {QueryLatencyStats} message QueryLatencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryLatencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.latencyCount = []; + object.cacheLatencyCount = []; + object.publicCacheTtlCount = []; + object.privateCacheTtlCount = []; + } + if (options.defaults) { + object.requestCount = 0; + object.cacheHits = 0; + object.persistedQueryHits = 0; + object.persistedQueryMisses = 0; + object.rootErrorStats = null; + object.requestsWithErrorsCount = 0; + object.registeredOperationCount = 0; + object.forbiddenOperationCount = 0; + object.requestsWithoutFieldInstrumentation = 0; + } + if (message.requestCount != null && message.hasOwnProperty("requestCount")) + if (typeof message.requestCount === "number") + object.requestCount = options.longs === String ? String(message.requestCount) : message.requestCount; + else + object.requestCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestCount) : options.longs === Number ? new $util.LongBits(message.requestCount.low >>> 0, message.requestCount.high >>> 0).toNumber(true) : message.requestCount; + if (message.cacheHits != null && message.hasOwnProperty("cacheHits")) + if (typeof message.cacheHits === "number") + object.cacheHits = options.longs === String ? String(message.cacheHits) : message.cacheHits; + else + object.cacheHits = options.longs === String ? $util.Long.prototype.toString.call(message.cacheHits) : options.longs === Number ? new $util.LongBits(message.cacheHits.low >>> 0, message.cacheHits.high >>> 0).toNumber(true) : message.cacheHits; + if (message.persistedQueryHits != null && message.hasOwnProperty("persistedQueryHits")) + if (typeof message.persistedQueryHits === "number") + object.persistedQueryHits = options.longs === String ? String(message.persistedQueryHits) : message.persistedQueryHits; + else + object.persistedQueryHits = options.longs === String ? $util.Long.prototype.toString.call(message.persistedQueryHits) : options.longs === Number ? new $util.LongBits(message.persistedQueryHits.low >>> 0, message.persistedQueryHits.high >>> 0).toNumber(true) : message.persistedQueryHits; + if (message.persistedQueryMisses != null && message.hasOwnProperty("persistedQueryMisses")) + if (typeof message.persistedQueryMisses === "number") + object.persistedQueryMisses = options.longs === String ? String(message.persistedQueryMisses) : message.persistedQueryMisses; + else + object.persistedQueryMisses = options.longs === String ? $util.Long.prototype.toString.call(message.persistedQueryMisses) : options.longs === Number ? new $util.LongBits(message.persistedQueryMisses.low >>> 0, message.persistedQueryMisses.high >>> 0).toNumber(true) : message.persistedQueryMisses; + if (message.rootErrorStats != null && message.hasOwnProperty("rootErrorStats")) + object.rootErrorStats = $root.PathErrorStats.toObject(message.rootErrorStats, options); + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (typeof message.requestsWithErrorsCount === "number") + object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount; + else + object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount; + if (message.registeredOperationCount != null && message.hasOwnProperty("registeredOperationCount")) + if (typeof message.registeredOperationCount === "number") + object.registeredOperationCount = options.longs === String ? String(message.registeredOperationCount) : message.registeredOperationCount; + else + object.registeredOperationCount = options.longs === String ? $util.Long.prototype.toString.call(message.registeredOperationCount) : options.longs === Number ? new $util.LongBits(message.registeredOperationCount.low >>> 0, message.registeredOperationCount.high >>> 0).toNumber(true) : message.registeredOperationCount; + if (message.forbiddenOperationCount != null && message.hasOwnProperty("forbiddenOperationCount")) + if (typeof message.forbiddenOperationCount === "number") + object.forbiddenOperationCount = options.longs === String ? String(message.forbiddenOperationCount) : message.forbiddenOperationCount; + else + object.forbiddenOperationCount = options.longs === String ? $util.Long.prototype.toString.call(message.forbiddenOperationCount) : options.longs === Number ? new $util.LongBits(message.forbiddenOperationCount.low >>> 0, message.forbiddenOperationCount.high >>> 0).toNumber(true) : message.forbiddenOperationCount; + if (message.latencyCount && message.latencyCount.length) { + object.latencyCount = []; + for (let j = 0; j < message.latencyCount.length; ++j) + if (typeof message.latencyCount[j] === "number") + object.latencyCount[j] = options.longs === String ? String(message.latencyCount[j]) : message.latencyCount[j]; + else + object.latencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.latencyCount[j]) : options.longs === Number ? new $util.LongBits(message.latencyCount[j].low >>> 0, message.latencyCount[j].high >>> 0).toNumber() : message.latencyCount[j]; + } + if (message.cacheLatencyCount && message.cacheLatencyCount.length) { + object.cacheLatencyCount = []; + for (let j = 0; j < message.cacheLatencyCount.length; ++j) + if (typeof message.cacheLatencyCount[j] === "number") + object.cacheLatencyCount[j] = options.longs === String ? String(message.cacheLatencyCount[j]) : message.cacheLatencyCount[j]; + else + object.cacheLatencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.cacheLatencyCount[j]) : options.longs === Number ? new $util.LongBits(message.cacheLatencyCount[j].low >>> 0, message.cacheLatencyCount[j].high >>> 0).toNumber() : message.cacheLatencyCount[j]; + } + if (message.publicCacheTtlCount && message.publicCacheTtlCount.length) { + object.publicCacheTtlCount = []; + for (let j = 0; j < message.publicCacheTtlCount.length; ++j) + if (typeof message.publicCacheTtlCount[j] === "number") + object.publicCacheTtlCount[j] = options.longs === String ? String(message.publicCacheTtlCount[j]) : message.publicCacheTtlCount[j]; + else + object.publicCacheTtlCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.publicCacheTtlCount[j]) : options.longs === Number ? new $util.LongBits(message.publicCacheTtlCount[j].low >>> 0, message.publicCacheTtlCount[j].high >>> 0).toNumber() : message.publicCacheTtlCount[j]; + } + if (message.privateCacheTtlCount && message.privateCacheTtlCount.length) { + object.privateCacheTtlCount = []; + for (let j = 0; j < message.privateCacheTtlCount.length; ++j) + if (typeof message.privateCacheTtlCount[j] === "number") + object.privateCacheTtlCount[j] = options.longs === String ? String(message.privateCacheTtlCount[j]) : message.privateCacheTtlCount[j]; + else + object.privateCacheTtlCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.privateCacheTtlCount[j]) : options.longs === Number ? new $util.LongBits(message.privateCacheTtlCount[j].low >>> 0, message.privateCacheTtlCount[j].high >>> 0).toNumber() : message.privateCacheTtlCount[j]; + } + if (message.requestsWithoutFieldInstrumentation != null && message.hasOwnProperty("requestsWithoutFieldInstrumentation")) + if (typeof message.requestsWithoutFieldInstrumentation === "number") + object.requestsWithoutFieldInstrumentation = options.longs === String ? String(message.requestsWithoutFieldInstrumentation) : message.requestsWithoutFieldInstrumentation; + else + object.requestsWithoutFieldInstrumentation = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithoutFieldInstrumentation) : options.longs === Number ? new $util.LongBits(message.requestsWithoutFieldInstrumentation.low >>> 0, message.requestsWithoutFieldInstrumentation.high >>> 0).toNumber(true) : message.requestsWithoutFieldInstrumentation; + return object; + }; + + /** + * Converts this QueryLatencyStats to JSON. + * @function toJSON + * @memberof QueryLatencyStats + * @instance + * @returns {Object.} JSON object + */ + QueryLatencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryLatencyStats; +})(); + +export const StatsContext = $root.StatsContext = (() => { + + /** + * Properties of a StatsContext. + * @exports IStatsContext + * @interface IStatsContext + * @property {string|null} [clientName] StatsContext clientName + * @property {string|null} [clientVersion] StatsContext clientVersion + */ + + /** + * Constructs a new StatsContext. + * @exports StatsContext + * @classdesc Represents a StatsContext. + * @implements IStatsContext + * @constructor + * @param {IStatsContext=} [properties] Properties to set + */ + function StatsContext(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatsContext clientName. + * @member {string} clientName + * @memberof StatsContext + * @instance + */ + StatsContext.prototype.clientName = ""; + + /** + * StatsContext clientVersion. + * @member {string} clientVersion + * @memberof StatsContext + * @instance + */ + StatsContext.prototype.clientVersion = ""; + + /** + * Creates a new StatsContext instance using the specified properties. + * @function create + * @memberof StatsContext + * @static + * @param {IStatsContext=} [properties] Properties to set + * @returns {StatsContext} StatsContext instance + */ + StatsContext.create = function create(properties) { + return new StatsContext(properties); + }; + + /** + * Encodes the specified StatsContext message. Does not implicitly {@link StatsContext.verify|verify} messages. + * @function encode + * @memberof StatsContext + * @static + * @param {IStatsContext} message StatsContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatsContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientName != null && Object.hasOwnProperty.call(message, "clientName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientName); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientVersion); + return writer; + }; + + /** + * Encodes the specified StatsContext message, length delimited. Does not implicitly {@link StatsContext.verify|verify} messages. + * @function encodeDelimited + * @memberof StatsContext + * @static + * @param {IStatsContext} message StatsContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatsContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatsContext message from the specified reader or buffer. + * @function decode + * @memberof StatsContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StatsContext} StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatsContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.StatsContext(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.clientName = reader.string(); + break; + case 3: + message.clientVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatsContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StatsContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StatsContext} StatsContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatsContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatsContext message. + * @function verify + * @memberof StatsContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatsContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientName != null && message.hasOwnProperty("clientName")) + if (!$util.isString(message.clientName)) + return "clientName: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: string expected"; + return null; + }; + + /** + * Creates a plain object from a StatsContext message. Also converts values to other types if specified. + * @function toObject + * @memberof StatsContext + * @static + * @param {StatsContext} message StatsContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatsContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.clientName = ""; + object.clientVersion = ""; + } + if (message.clientName != null && message.hasOwnProperty("clientName")) + object.clientName = message.clientName; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + return object; + }; + + /** + * Converts this StatsContext to JSON. + * @function toJSON + * @memberof StatsContext + * @instance + * @returns {Object.} JSON object + */ + StatsContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StatsContext; +})(); + +export const ContextualizedQueryLatencyStats = $root.ContextualizedQueryLatencyStats = (() => { + + /** + * Properties of a ContextualizedQueryLatencyStats. + * @exports IContextualizedQueryLatencyStats + * @interface IContextualizedQueryLatencyStats + * @property {IQueryLatencyStats|null} [queryLatencyStats] ContextualizedQueryLatencyStats queryLatencyStats + * @property {IStatsContext|null} [context] ContextualizedQueryLatencyStats context + */ + + /** + * Constructs a new ContextualizedQueryLatencyStats. + * @exports ContextualizedQueryLatencyStats + * @classdesc Represents a ContextualizedQueryLatencyStats. + * @implements IContextualizedQueryLatencyStats + * @constructor + * @param {IContextualizedQueryLatencyStats=} [properties] Properties to set + */ + function ContextualizedQueryLatencyStats(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextualizedQueryLatencyStats queryLatencyStats. + * @member {IQueryLatencyStats|null|undefined} queryLatencyStats + * @memberof ContextualizedQueryLatencyStats + * @instance + */ + ContextualizedQueryLatencyStats.prototype.queryLatencyStats = null; + + /** + * ContextualizedQueryLatencyStats context. + * @member {IStatsContext|null|undefined} context + * @memberof ContextualizedQueryLatencyStats + * @instance + */ + ContextualizedQueryLatencyStats.prototype.context = null; + + /** + * Creates a new ContextualizedQueryLatencyStats instance using the specified properties. + * @function create + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {IContextualizedQueryLatencyStats=} [properties] Properties to set + * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats instance + */ + ContextualizedQueryLatencyStats.create = function create(properties) { + return new ContextualizedQueryLatencyStats(properties); + }; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @function encode + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {IContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedQueryLatencyStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryLatencyStats != null && Object.hasOwnProperty.call(message, "queryLatencyStats")) + $root.QueryLatencyStats.encode(message.queryLatencyStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.StatsContext.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContextualizedQueryLatencyStats message, length delimited. Does not implicitly {@link ContextualizedQueryLatencyStats.verify|verify} messages. + * @function encodeDelimited + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {IContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedQueryLatencyStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer. + * @function decode + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedQueryLatencyStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedQueryLatencyStats(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queryLatencyStats = $root.QueryLatencyStats.decode(reader, reader.uint32()); + break; + case 2: + message.context = $root.StatsContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualizedQueryLatencyStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ContextualizedQueryLatencyStats} ContextualizedQueryLatencyStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedQueryLatencyStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualizedQueryLatencyStats message. + * @function verify + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualizedQueryLatencyStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) { + let error = $root.QueryLatencyStats.verify(message.queryLatencyStats); + if (error) + return "queryLatencyStats." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + let error = $root.StatsContext.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates a plain object from a ContextualizedQueryLatencyStats message. Also converts values to other types if specified. + * @function toObject + * @memberof ContextualizedQueryLatencyStats + * @static + * @param {ContextualizedQueryLatencyStats} message ContextualizedQueryLatencyStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualizedQueryLatencyStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.queryLatencyStats = null; + object.context = null; + } + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) + object.queryLatencyStats = $root.QueryLatencyStats.toObject(message.queryLatencyStats, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.StatsContext.toObject(message.context, options); + return object; + }; + + /** + * Converts this ContextualizedQueryLatencyStats to JSON. + * @function toJSON + * @memberof ContextualizedQueryLatencyStats + * @instance + * @returns {Object.} JSON object + */ + ContextualizedQueryLatencyStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContextualizedQueryLatencyStats; +})(); + +export const ContextualizedTypeStats = $root.ContextualizedTypeStats = (() => { + + /** + * Properties of a ContextualizedTypeStats. + * @exports IContextualizedTypeStats + * @interface IContextualizedTypeStats + * @property {IStatsContext|null} [context] ContextualizedTypeStats context + * @property {Object.|null} [perTypeStat] ContextualizedTypeStats perTypeStat + */ + + /** + * Constructs a new ContextualizedTypeStats. + * @exports ContextualizedTypeStats + * @classdesc Represents a ContextualizedTypeStats. + * @implements IContextualizedTypeStats + * @constructor + * @param {IContextualizedTypeStats=} [properties] Properties to set + */ + function ContextualizedTypeStats(properties) { + this.perTypeStat = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextualizedTypeStats context. + * @member {IStatsContext|null|undefined} context + * @memberof ContextualizedTypeStats + * @instance + */ + ContextualizedTypeStats.prototype.context = null; + + /** + * ContextualizedTypeStats perTypeStat. + * @member {Object.} perTypeStat + * @memberof ContextualizedTypeStats + * @instance + */ + ContextualizedTypeStats.prototype.perTypeStat = $util.emptyObject; + + /** + * Creates a new ContextualizedTypeStats instance using the specified properties. + * @function create + * @memberof ContextualizedTypeStats + * @static + * @param {IContextualizedTypeStats=} [properties] Properties to set + * @returns {ContextualizedTypeStats} ContextualizedTypeStats instance + */ + ContextualizedTypeStats.create = function create(properties) { + return new ContextualizedTypeStats(properties); + }; + + /** + * Encodes the specified ContextualizedTypeStats message. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @function encode + * @memberof ContextualizedTypeStats + * @static + * @param {IContextualizedTypeStats} message ContextualizedTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedTypeStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.StatsContext.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.perTypeStat != null && Object.hasOwnProperty.call(message, "perTypeStat")) + for (let keys = Object.keys(message.perTypeStat), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.TypeStat.encode(message.perTypeStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ContextualizedTypeStats message, length delimited. Does not implicitly {@link ContextualizedTypeStats.verify|verify} messages. + * @function encodeDelimited + * @memberof ContextualizedTypeStats + * @static + * @param {IContextualizedTypeStats} message ContextualizedTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedTypeStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer. + * @function decode + * @memberof ContextualizedTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ContextualizedTypeStats} ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedTypeStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedTypeStats(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.context = $root.StatsContext.decode(reader, reader.uint32()); + break; + case 2: + reader.skip().pos++; + if (message.perTypeStat === $util.emptyObject) + message.perTypeStat = {}; + key = reader.string(); + reader.pos++; + message.perTypeStat[key] = $root.TypeStat.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualizedTypeStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ContextualizedTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ContextualizedTypeStats} ContextualizedTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedTypeStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualizedTypeStats message. + * @function verify + * @memberof ContextualizedTypeStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualizedTypeStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) { + let error = $root.StatsContext.verify(message.context); + if (error) + return "context." + error; + } + if (message.perTypeStat != null && message.hasOwnProperty("perTypeStat")) { + if (!$util.isObject(message.perTypeStat)) + return "perTypeStat: object expected"; + let key = Object.keys(message.perTypeStat); + for (let i = 0; i < key.length; ++i) { + let error = $root.TypeStat.verify(message.perTypeStat[key[i]]); + if (error) + return "perTypeStat." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a ContextualizedTypeStats message. Also converts values to other types if specified. + * @function toObject + * @memberof ContextualizedTypeStats + * @static + * @param {ContextualizedTypeStats} message ContextualizedTypeStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualizedTypeStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.perTypeStat = {}; + if (options.defaults) + object.context = null; + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.StatsContext.toObject(message.context, options); + let keys2; + if (message.perTypeStat && (keys2 = Object.keys(message.perTypeStat)).length) { + object.perTypeStat = {}; + for (let j = 0; j < keys2.length; ++j) + object.perTypeStat[keys2[j]] = $root.TypeStat.toObject(message.perTypeStat[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ContextualizedTypeStats to JSON. + * @function toJSON + * @memberof ContextualizedTypeStats + * @instance + * @returns {Object.} JSON object + */ + ContextualizedTypeStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContextualizedTypeStats; +})(); + +export const FieldStat = $root.FieldStat = (() => { + + /** + * Properties of a FieldStat. + * @exports IFieldStat + * @interface IFieldStat + * @property {string|null} [returnType] FieldStat returnType + * @property {number|null} [errorsCount] FieldStat errorsCount + * @property {number|null} [observedExecutionCount] FieldStat observedExecutionCount + * @property {number|null} [estimatedExecutionCount] FieldStat estimatedExecutionCount + * @property {number|null} [requestsWithErrorsCount] FieldStat requestsWithErrorsCount + * @property {$protobuf.ToArray.|Array.|null} [latencyCount] FieldStat latencyCount + */ + + /** + * Constructs a new FieldStat. + * @exports FieldStat + * @classdesc Represents a FieldStat. + * @implements IFieldStat + * @constructor + * @param {IFieldStat=} [properties] Properties to set + */ + function FieldStat(properties) { + this.latencyCount = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldStat returnType. + * @member {string} returnType + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.returnType = ""; + + /** + * FieldStat errorsCount. + * @member {number} errorsCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.errorsCount = 0; + + /** + * FieldStat observedExecutionCount. + * @member {number} observedExecutionCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.observedExecutionCount = 0; + + /** + * FieldStat estimatedExecutionCount. + * @member {number} estimatedExecutionCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.estimatedExecutionCount = 0; + + /** + * FieldStat requestsWithErrorsCount. + * @member {number} requestsWithErrorsCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.requestsWithErrorsCount = 0; + + /** + * FieldStat latencyCount. + * @member {Array.} latencyCount + * @memberof FieldStat + * @instance + */ + FieldStat.prototype.latencyCount = $util.emptyArray; + + /** + * Creates a new FieldStat instance using the specified properties. + * @function create + * @memberof FieldStat + * @static + * @param {IFieldStat=} [properties] Properties to set + * @returns {FieldStat} FieldStat instance + */ + FieldStat.create = function create(properties) { + return new FieldStat(properties); + }; + + /** + * Encodes the specified FieldStat message. Does not implicitly {@link FieldStat.verify|verify} messages. + * @function encode + * @memberof FieldStat + * @static + * @param {IFieldStat} message FieldStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldStat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.returnType); + if (message.errorsCount != null && Object.hasOwnProperty.call(message, "errorsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.errorsCount); + if (message.observedExecutionCount != null && Object.hasOwnProperty.call(message, "observedExecutionCount")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.observedExecutionCount); + if (message.requestsWithErrorsCount != null && Object.hasOwnProperty.call(message, "requestsWithErrorsCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.requestsWithErrorsCount); + let array9; + if (message.latencyCount != null && message.latencyCount.toArray) + array9 = message.latencyCount.toArray(); + else + array9 = message.latencyCount; + if (array9 != null && array9.length) { + writer.uint32(/* id 9, wireType 2 =*/74).fork(); + for (let i = 0; i < array9.length; ++i) + writer.sint64(array9[i]); + writer.ldelim(); + } + if (message.estimatedExecutionCount != null && Object.hasOwnProperty.call(message, "estimatedExecutionCount")) + writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.estimatedExecutionCount); + return writer; + }; + + /** + * Encodes the specified FieldStat message, length delimited. Does not implicitly {@link FieldStat.verify|verify} messages. + * @function encodeDelimited + * @memberof FieldStat + * @static + * @param {IFieldStat} message FieldStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldStat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldStat message from the specified reader or buffer. + * @function decode + * @memberof FieldStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {FieldStat} FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldStat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.FieldStat(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.returnType = reader.string(); + break; + case 4: + message.errorsCount = reader.uint64(); + break; + case 5: + message.observedExecutionCount = reader.uint64(); + break; + case 10: + message.estimatedExecutionCount = reader.uint64(); + break; + case 6: + message.requestsWithErrorsCount = reader.uint64(); + break; + case 9: + if (!(message.latencyCount && message.latencyCount.length)) + message.latencyCount = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.latencyCount.push(reader.sint64()); + } else + message.latencyCount.push(reader.sint64()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldStat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof FieldStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {FieldStat} FieldStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldStat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldStat message. + * @function verify + * @memberof FieldStat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldStat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.returnType != null && message.hasOwnProperty("returnType")) + if (!$util.isString(message.returnType)) + return "returnType: string expected"; + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (!$util.isInteger(message.errorsCount) && !(message.errorsCount && $util.isInteger(message.errorsCount.low) && $util.isInteger(message.errorsCount.high))) + return "errorsCount: integer|Long expected"; + if (message.observedExecutionCount != null && message.hasOwnProperty("observedExecutionCount")) + if (!$util.isInteger(message.observedExecutionCount) && !(message.observedExecutionCount && $util.isInteger(message.observedExecutionCount.low) && $util.isInteger(message.observedExecutionCount.high))) + return "observedExecutionCount: integer|Long expected"; + if (message.estimatedExecutionCount != null && message.hasOwnProperty("estimatedExecutionCount")) + if (!$util.isInteger(message.estimatedExecutionCount) && !(message.estimatedExecutionCount && $util.isInteger(message.estimatedExecutionCount.low) && $util.isInteger(message.estimatedExecutionCount.high))) + return "estimatedExecutionCount: integer|Long expected"; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (!$util.isInteger(message.requestsWithErrorsCount) && !(message.requestsWithErrorsCount && $util.isInteger(message.requestsWithErrorsCount.low) && $util.isInteger(message.requestsWithErrorsCount.high))) + return "requestsWithErrorsCount: integer|Long expected"; + if (message.latencyCount != null && message.hasOwnProperty("latencyCount")) { + let array9; + if (message.latencyCount != null && message.latencyCount.toArray) + array9 = message.latencyCount.toArray(); + else + array9 = message.latencyCount; + if (!Array.isArray(array9)) + return "latencyCount: array expected"; + for (let i = 0; i < array9.length; ++i) + if (!$util.isInteger(array9[i]) && !(array9[i] && $util.isInteger(array9[i].low) && $util.isInteger(array9[i].high))) + return "latencyCount: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a plain object from a FieldStat message. Also converts values to other types if specified. + * @function toObject + * @memberof FieldStat + * @static + * @param {FieldStat} message FieldStat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldStat.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.latencyCount = []; + if (options.defaults) { + object.returnType = ""; + object.errorsCount = 0; + object.observedExecutionCount = 0; + object.requestsWithErrorsCount = 0; + object.estimatedExecutionCount = 0; + } + if (message.returnType != null && message.hasOwnProperty("returnType")) + object.returnType = message.returnType; + if (message.errorsCount != null && message.hasOwnProperty("errorsCount")) + if (typeof message.errorsCount === "number") + object.errorsCount = options.longs === String ? String(message.errorsCount) : message.errorsCount; + else + object.errorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorsCount) : options.longs === Number ? new $util.LongBits(message.errorsCount.low >>> 0, message.errorsCount.high >>> 0).toNumber(true) : message.errorsCount; + if (message.observedExecutionCount != null && message.hasOwnProperty("observedExecutionCount")) + if (typeof message.observedExecutionCount === "number") + object.observedExecutionCount = options.longs === String ? String(message.observedExecutionCount) : message.observedExecutionCount; + else + object.observedExecutionCount = options.longs === String ? $util.Long.prototype.toString.call(message.observedExecutionCount) : options.longs === Number ? new $util.LongBits(message.observedExecutionCount.low >>> 0, message.observedExecutionCount.high >>> 0).toNumber(true) : message.observedExecutionCount; + if (message.requestsWithErrorsCount != null && message.hasOwnProperty("requestsWithErrorsCount")) + if (typeof message.requestsWithErrorsCount === "number") + object.requestsWithErrorsCount = options.longs === String ? String(message.requestsWithErrorsCount) : message.requestsWithErrorsCount; + else + object.requestsWithErrorsCount = options.longs === String ? $util.Long.prototype.toString.call(message.requestsWithErrorsCount) : options.longs === Number ? new $util.LongBits(message.requestsWithErrorsCount.low >>> 0, message.requestsWithErrorsCount.high >>> 0).toNumber(true) : message.requestsWithErrorsCount; + if (message.latencyCount && message.latencyCount.length) { + object.latencyCount = []; + for (let j = 0; j < message.latencyCount.length; ++j) + if (typeof message.latencyCount[j] === "number") + object.latencyCount[j] = options.longs === String ? String(message.latencyCount[j]) : message.latencyCount[j]; + else + object.latencyCount[j] = options.longs === String ? $util.Long.prototype.toString.call(message.latencyCount[j]) : options.longs === Number ? new $util.LongBits(message.latencyCount[j].low >>> 0, message.latencyCount[j].high >>> 0).toNumber() : message.latencyCount[j]; + } + if (message.estimatedExecutionCount != null && message.hasOwnProperty("estimatedExecutionCount")) + if (typeof message.estimatedExecutionCount === "number") + object.estimatedExecutionCount = options.longs === String ? String(message.estimatedExecutionCount) : message.estimatedExecutionCount; + else + object.estimatedExecutionCount = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedExecutionCount) : options.longs === Number ? new $util.LongBits(message.estimatedExecutionCount.low >>> 0, message.estimatedExecutionCount.high >>> 0).toNumber(true) : message.estimatedExecutionCount; + return object; + }; + + /** + * Converts this FieldStat to JSON. + * @function toJSON + * @memberof FieldStat + * @instance + * @returns {Object.} JSON object + */ + FieldStat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldStat; +})(); + +export const TypeStat = $root.TypeStat = (() => { + + /** + * Properties of a TypeStat. + * @exports ITypeStat + * @interface ITypeStat + * @property {Object.|null} [perFieldStat] TypeStat perFieldStat + */ + + /** + * Constructs a new TypeStat. + * @exports TypeStat + * @classdesc Represents a TypeStat. + * @implements ITypeStat + * @constructor + * @param {ITypeStat=} [properties] Properties to set + */ + function TypeStat(properties) { + this.perFieldStat = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypeStat perFieldStat. + * @member {Object.} perFieldStat + * @memberof TypeStat + * @instance + */ + TypeStat.prototype.perFieldStat = $util.emptyObject; + + /** + * Creates a new TypeStat instance using the specified properties. + * @function create + * @memberof TypeStat + * @static + * @param {ITypeStat=} [properties] Properties to set + * @returns {TypeStat} TypeStat instance + */ + TypeStat.create = function create(properties) { + return new TypeStat(properties); + }; + + /** + * Encodes the specified TypeStat message. Does not implicitly {@link TypeStat.verify|verify} messages. + * @function encode + * @memberof TypeStat + * @static + * @param {ITypeStat} message TypeStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeStat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.perFieldStat != null && Object.hasOwnProperty.call(message, "perFieldStat")) + for (let keys = Object.keys(message.perFieldStat), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.FieldStat.encode(message.perFieldStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TypeStat message, length delimited. Does not implicitly {@link TypeStat.verify|verify} messages. + * @function encodeDelimited + * @memberof TypeStat + * @static + * @param {ITypeStat} message TypeStat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeStat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeStat message from the specified reader or buffer. + * @function decode + * @memberof TypeStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {TypeStat} TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeStat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.TypeStat(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + reader.skip().pos++; + if (message.perFieldStat === $util.emptyObject) + message.perFieldStat = {}; + key = reader.string(); + reader.pos++; + message.perFieldStat[key] = $root.FieldStat.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TypeStat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof TypeStat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {TypeStat} TypeStat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeStat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeStat message. + * @function verify + * @memberof TypeStat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeStat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.perFieldStat != null && message.hasOwnProperty("perFieldStat")) { + if (!$util.isObject(message.perFieldStat)) + return "perFieldStat: object expected"; + let key = Object.keys(message.perFieldStat); + for (let i = 0; i < key.length; ++i) { + let error = $root.FieldStat.verify(message.perFieldStat[key[i]]); + if (error) + return "perFieldStat." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a TypeStat message. Also converts values to other types if specified. + * @function toObject + * @memberof TypeStat + * @static + * @param {TypeStat} message TypeStat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeStat.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.perFieldStat = {}; + let keys2; + if (message.perFieldStat && (keys2 = Object.keys(message.perFieldStat)).length) { + object.perFieldStat = {}; + for (let j = 0; j < keys2.length; ++j) + object.perFieldStat[keys2[j]] = $root.FieldStat.toObject(message.perFieldStat[keys2[j]], options); + } + return object; + }; + + /** + * Converts this TypeStat to JSON. + * @function toJSON + * @memberof TypeStat + * @instance + * @returns {Object.} JSON object + */ + TypeStat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TypeStat; +})(); + +export const ReferencedFieldsForType = $root.ReferencedFieldsForType = (() => { + + /** + * Properties of a ReferencedFieldsForType. + * @exports IReferencedFieldsForType + * @interface IReferencedFieldsForType + * @property {Array.|null} [fieldNames] ReferencedFieldsForType fieldNames + * @property {boolean|null} [isInterface] ReferencedFieldsForType isInterface + */ + + /** + * Constructs a new ReferencedFieldsForType. + * @exports ReferencedFieldsForType + * @classdesc Represents a ReferencedFieldsForType. + * @implements IReferencedFieldsForType + * @constructor + * @param {IReferencedFieldsForType=} [properties] Properties to set + */ + function ReferencedFieldsForType(properties) { + this.fieldNames = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReferencedFieldsForType fieldNames. + * @member {Array.} fieldNames + * @memberof ReferencedFieldsForType + * @instance + */ + ReferencedFieldsForType.prototype.fieldNames = $util.emptyArray; + + /** + * ReferencedFieldsForType isInterface. + * @member {boolean} isInterface + * @memberof ReferencedFieldsForType + * @instance + */ + ReferencedFieldsForType.prototype.isInterface = false; + + /** + * Creates a new ReferencedFieldsForType instance using the specified properties. + * @function create + * @memberof ReferencedFieldsForType + * @static + * @param {IReferencedFieldsForType=} [properties] Properties to set + * @returns {ReferencedFieldsForType} ReferencedFieldsForType instance + */ + ReferencedFieldsForType.create = function create(properties) { + return new ReferencedFieldsForType(properties); + }; + + /** + * Encodes the specified ReferencedFieldsForType message. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @function encode + * @memberof ReferencedFieldsForType + * @static + * @param {IReferencedFieldsForType} message ReferencedFieldsForType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferencedFieldsForType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldNames != null && message.fieldNames.length) + for (let i = 0; i < message.fieldNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldNames[i]); + if (message.isInterface != null && Object.hasOwnProperty.call(message, "isInterface")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isInterface); + return writer; + }; + + /** + * Encodes the specified ReferencedFieldsForType message, length delimited. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages. + * @function encodeDelimited + * @memberof ReferencedFieldsForType + * @static + * @param {IReferencedFieldsForType} message ReferencedFieldsForType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferencedFieldsForType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer. + * @function decode + * @memberof ReferencedFieldsForType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ReferencedFieldsForType} ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferencedFieldsForType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ReferencedFieldsForType(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.fieldNames && message.fieldNames.length)) + message.fieldNames = []; + message.fieldNames.push(reader.string()); + break; + case 2: + message.isInterface = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReferencedFieldsForType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ReferencedFieldsForType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ReferencedFieldsForType} ReferencedFieldsForType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferencedFieldsForType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReferencedFieldsForType message. + * @function verify + * @memberof ReferencedFieldsForType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReferencedFieldsForType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldNames != null && message.hasOwnProperty("fieldNames")) { + if (!Array.isArray(message.fieldNames)) + return "fieldNames: array expected"; + for (let i = 0; i < message.fieldNames.length; ++i) + if (!$util.isString(message.fieldNames[i])) + return "fieldNames: string[] expected"; + } + if (message.isInterface != null && message.hasOwnProperty("isInterface")) + if (typeof message.isInterface !== "boolean") + return "isInterface: boolean expected"; + return null; + }; + + /** + * Creates a plain object from a ReferencedFieldsForType message. Also converts values to other types if specified. + * @function toObject + * @memberof ReferencedFieldsForType + * @static + * @param {ReferencedFieldsForType} message ReferencedFieldsForType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReferencedFieldsForType.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.fieldNames = []; + if (options.defaults) + object.isInterface = false; + if (message.fieldNames && message.fieldNames.length) { + object.fieldNames = []; + for (let j = 0; j < message.fieldNames.length; ++j) + object.fieldNames[j] = message.fieldNames[j]; + } + if (message.isInterface != null && message.hasOwnProperty("isInterface")) + object.isInterface = message.isInterface; + return object; + }; + + /** + * Converts this ReferencedFieldsForType to JSON. + * @function toJSON + * @memberof ReferencedFieldsForType + * @instance + * @returns {Object.} JSON object + */ + ReferencedFieldsForType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReferencedFieldsForType; +})(); + +export const Report = $root.Report = (() => { + + /** + * Properties of a Report. + * @exports IReport + * @interface IReport + * @property {IReportHeader|null} [header] Report header + * @property {Object.|null} [tracesPerQuery] Report tracesPerQuery + * @property {google.protobuf.ITimestamp|null} [endTime] Report endTime + * @property {number|null} [operationCount] Report operationCount + * @property {boolean|null} [tracesPreAggregated] Report tracesPreAggregated + */ + + /** + * Constructs a new Report. + * @exports Report + * @classdesc Represents a Report. + * @implements IReport + * @constructor + * @param {IReport=} [properties] Properties to set + */ + function Report(properties) { + this.tracesPerQuery = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Report header. + * @member {IReportHeader|null|undefined} header + * @memberof Report + * @instance + */ + Report.prototype.header = null; + + /** + * Report tracesPerQuery. + * @member {Object.} tracesPerQuery + * @memberof Report + * @instance + */ + Report.prototype.tracesPerQuery = $util.emptyObject; + + /** + * Report endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof Report + * @instance + */ + Report.prototype.endTime = null; + + /** + * Report operationCount. + * @member {number} operationCount + * @memberof Report + * @instance + */ + Report.prototype.operationCount = 0; + + /** + * Report tracesPreAggregated. + * @member {boolean} tracesPreAggregated + * @memberof Report + * @instance + */ + Report.prototype.tracesPreAggregated = false; + + /** + * Creates a new Report instance using the specified properties. + * @function create + * @memberof Report + * @static + * @param {IReport=} [properties] Properties to set + * @returns {Report} Report instance + */ + Report.create = function create(properties) { + return new Report(properties); + }; + + /** + * Encodes the specified Report message. Does not implicitly {@link Report.verify|verify} messages. + * @function encode + * @memberof Report + * @static + * @param {IReport} message Report message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Report.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.ReportHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tracesPerQuery != null && Object.hasOwnProperty.call(message, "tracesPerQuery")) + for (let keys = Object.keys(message.tracesPerQuery), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.TracesAndStats.encode(message.tracesPerQuery[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.operationCount != null && Object.hasOwnProperty.call(message, "operationCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.operationCount); + if (message.tracesPreAggregated != null && Object.hasOwnProperty.call(message, "tracesPreAggregated")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.tracesPreAggregated); + return writer; + }; + + /** + * Encodes the specified Report message, length delimited. Does not implicitly {@link Report.verify|verify} messages. + * @function encodeDelimited + * @memberof Report + * @static + * @param {IReport} message Report message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Report.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Report message from the specified reader or buffer. + * @function decode + * @memberof Report + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Report} Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Report.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Report(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = $root.ReportHeader.decode(reader, reader.uint32()); + break; + case 5: + reader.skip().pos++; + if (message.tracesPerQuery === $util.emptyObject) + message.tracesPerQuery = {}; + key = reader.string(); + reader.pos++; + message.tracesPerQuery[key] = $root.TracesAndStats.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.operationCount = reader.uint64(); + break; + case 7: + message.tracesPreAggregated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Report message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Report + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Report} Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Report.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Report message. + * @function verify + * @memberof Report + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Report.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + let error = $root.ReportHeader.verify(message.header); + if (error) + return "header." + error; + } + if (message.tracesPerQuery != null && message.hasOwnProperty("tracesPerQuery")) { + if (!$util.isObject(message.tracesPerQuery)) + return "tracesPerQuery: object expected"; + let key = Object.keys(message.tracesPerQuery); + for (let i = 0; i < key.length; ++i) { + let error = $root.TracesAndStats.verify(message.tracesPerQuery[key[i]]); + if (error) + return "tracesPerQuery." + error; + } + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + let error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.operationCount != null && message.hasOwnProperty("operationCount")) + if (!$util.isInteger(message.operationCount) && !(message.operationCount && $util.isInteger(message.operationCount.low) && $util.isInteger(message.operationCount.high))) + return "operationCount: integer|Long expected"; + if (message.tracesPreAggregated != null && message.hasOwnProperty("tracesPreAggregated")) + if (typeof message.tracesPreAggregated !== "boolean") + return "tracesPreAggregated: boolean expected"; + return null; + }; + + /** + * Creates a plain object from a Report message. Also converts values to other types if specified. + * @function toObject + * @memberof Report + * @static + * @param {Report} message Report + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Report.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.tracesPerQuery = {}; + if (options.defaults) { + object.header = null; + object.endTime = null; + object.operationCount = 0; + object.tracesPreAggregated = false; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.ReportHeader.toObject(message.header, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + let keys2; + if (message.tracesPerQuery && (keys2 = Object.keys(message.tracesPerQuery)).length) { + object.tracesPerQuery = {}; + for (let j = 0; j < keys2.length; ++j) + object.tracesPerQuery[keys2[j]] = $root.TracesAndStats.toObject(message.tracesPerQuery[keys2[j]], options); + } + if (message.operationCount != null && message.hasOwnProperty("operationCount")) + if (typeof message.operationCount === "number") + object.operationCount = options.longs === String ? String(message.operationCount) : message.operationCount; + else + object.operationCount = options.longs === String ? $util.Long.prototype.toString.call(message.operationCount) : options.longs === Number ? new $util.LongBits(message.operationCount.low >>> 0, message.operationCount.high >>> 0).toNumber(true) : message.operationCount; + if (message.tracesPreAggregated != null && message.hasOwnProperty("tracesPreAggregated")) + object.tracesPreAggregated = message.tracesPreAggregated; + return object; + }; + + /** + * Converts this Report to JSON. + * @function toJSON + * @memberof Report + * @instance + * @returns {Object.} JSON object + */ + Report.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Report; +})(); + +export const ContextualizedStats = $root.ContextualizedStats = (() => { + + /** + * Properties of a ContextualizedStats. + * @exports IContextualizedStats + * @interface IContextualizedStats + * @property {IStatsContext|null} [context] ContextualizedStats context + * @property {IQueryLatencyStats|null} [queryLatencyStats] ContextualizedStats queryLatencyStats + * @property {Object.|null} [perTypeStat] ContextualizedStats perTypeStat + */ + + /** + * Constructs a new ContextualizedStats. + * @exports ContextualizedStats + * @classdesc Represents a ContextualizedStats. + * @implements IContextualizedStats + * @constructor + * @param {IContextualizedStats=} [properties] Properties to set + */ + function ContextualizedStats(properties) { + this.perTypeStat = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContextualizedStats context. + * @member {IStatsContext|null|undefined} context + * @memberof ContextualizedStats + * @instance + */ + ContextualizedStats.prototype.context = null; + + /** + * ContextualizedStats queryLatencyStats. + * @member {IQueryLatencyStats|null|undefined} queryLatencyStats + * @memberof ContextualizedStats + * @instance + */ + ContextualizedStats.prototype.queryLatencyStats = null; + + /** + * ContextualizedStats perTypeStat. + * @member {Object.} perTypeStat + * @memberof ContextualizedStats + * @instance + */ + ContextualizedStats.prototype.perTypeStat = $util.emptyObject; + + /** + * Creates a new ContextualizedStats instance using the specified properties. + * @function create + * @memberof ContextualizedStats + * @static + * @param {IContextualizedStats=} [properties] Properties to set + * @returns {ContextualizedStats} ContextualizedStats instance + */ + ContextualizedStats.create = function create(properties) { + return new ContextualizedStats(properties); + }; + + /** + * Encodes the specified ContextualizedStats message. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @function encode + * @memberof ContextualizedStats + * @static + * @param {IContextualizedStats} message ContextualizedStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.StatsContext.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryLatencyStats != null && Object.hasOwnProperty.call(message, "queryLatencyStats")) + $root.QueryLatencyStats.encode(message.queryLatencyStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.perTypeStat != null && Object.hasOwnProperty.call(message, "perTypeStat")) + for (let keys = Object.keys(message.perTypeStat), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.TypeStat.encode(message.perTypeStat[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ContextualizedStats message, length delimited. Does not implicitly {@link ContextualizedStats.verify|verify} messages. + * @function encodeDelimited + * @memberof ContextualizedStats + * @static + * @param {IContextualizedStats} message ContextualizedStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualizedStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer. + * @function decode + * @memberof ContextualizedStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ContextualizedStats} ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ContextualizedStats(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.context = $root.StatsContext.decode(reader, reader.uint32()); + break; + case 2: + message.queryLatencyStats = $root.QueryLatencyStats.decode(reader, reader.uint32()); + break; + case 3: + reader.skip().pos++; + if (message.perTypeStat === $util.emptyObject) + message.perTypeStat = {}; + key = reader.string(); + reader.pos++; + message.perTypeStat[key] = $root.TypeStat.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualizedStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ContextualizedStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ContextualizedStats} ContextualizedStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualizedStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualizedStats message. + * @function verify + * @memberof ContextualizedStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualizedStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) { + let error = $root.StatsContext.verify(message.context); + if (error) + return "context." + error; + } + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) { + let error = $root.QueryLatencyStats.verify(message.queryLatencyStats); + if (error) + return "queryLatencyStats." + error; + } + if (message.perTypeStat != null && message.hasOwnProperty("perTypeStat")) { + if (!$util.isObject(message.perTypeStat)) + return "perTypeStat: object expected"; + let key = Object.keys(message.perTypeStat); + for (let i = 0; i < key.length; ++i) { + let error = $root.TypeStat.verify(message.perTypeStat[key[i]]); + if (error) + return "perTypeStat." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a ContextualizedStats message. Also converts values to other types if specified. + * @function toObject + * @memberof ContextualizedStats + * @static + * @param {ContextualizedStats} message ContextualizedStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualizedStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.perTypeStat = {}; + if (options.defaults) { + object.context = null; + object.queryLatencyStats = null; + } + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.StatsContext.toObject(message.context, options); + if (message.queryLatencyStats != null && message.hasOwnProperty("queryLatencyStats")) + object.queryLatencyStats = $root.QueryLatencyStats.toObject(message.queryLatencyStats, options); + let keys2; + if (message.perTypeStat && (keys2 = Object.keys(message.perTypeStat)).length) { + object.perTypeStat = {}; + for (let j = 0; j < keys2.length; ++j) + object.perTypeStat[keys2[j]] = $root.TypeStat.toObject(message.perTypeStat[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ContextualizedStats to JSON. + * @function toJSON + * @memberof ContextualizedStats + * @instance + * @returns {Object.} JSON object + */ + ContextualizedStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContextualizedStats; +})(); + +export const TracesAndStats = $root.TracesAndStats = (() => { + + /** + * Properties of a TracesAndStats. + * @exports ITracesAndStats + * @interface ITracesAndStats + * @property {Array.|null} [trace] TracesAndStats trace + * @property {$protobuf.ToArray.|Array.|null} [statsWithContext] TracesAndStats statsWithContext + * @property {Object.|null} [referencedFieldsByType] TracesAndStats referencedFieldsByType + * @property {Array.|null} [internalTracesContributingToStats] TracesAndStats internalTracesContributingToStats + */ + + /** + * Constructs a new TracesAndStats. + * @exports TracesAndStats + * @classdesc Represents a TracesAndStats. + * @implements ITracesAndStats + * @constructor + * @param {ITracesAndStats=} [properties] Properties to set + */ + function TracesAndStats(properties) { + this.trace = []; + this.statsWithContext = []; + this.referencedFieldsByType = {}; + this.internalTracesContributingToStats = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TracesAndStats trace. + * @member {Array.} trace + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.trace = $util.emptyArray; + + /** + * TracesAndStats statsWithContext. + * @member {Array.} statsWithContext + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.statsWithContext = $util.emptyArray; + + /** + * TracesAndStats referencedFieldsByType. + * @member {Object.} referencedFieldsByType + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.referencedFieldsByType = $util.emptyObject; + + /** + * TracesAndStats internalTracesContributingToStats. + * @member {Array.} internalTracesContributingToStats + * @memberof TracesAndStats + * @instance + */ + TracesAndStats.prototype.internalTracesContributingToStats = $util.emptyArray; + + /** + * Creates a new TracesAndStats instance using the specified properties. + * @function create + * @memberof TracesAndStats + * @static + * @param {ITracesAndStats=} [properties] Properties to set + * @returns {TracesAndStats} TracesAndStats instance + */ + TracesAndStats.create = function create(properties) { + return new TracesAndStats(properties); + }; + + /** + * Encodes the specified TracesAndStats message. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @function encode + * @memberof TracesAndStats + * @static + * @param {ITracesAndStats} message TracesAndStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TracesAndStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trace != null && message.trace.length) + for (let i = 0; i < message.trace.length; ++i) + if (message.trace[i] instanceof Uint8Array) { + writer.uint32(/* id 1, wireType 2 =*/10); + writer.bytes(message.trace[i]); + } else + $root.Trace.encode(message.trace[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + let array2; + if (message.statsWithContext != null && message.statsWithContext.toArray) + array2 = message.statsWithContext.toArray(); + else + array2 = message.statsWithContext; + if (array2 != null && array2.length) + for (let i = 0; i < array2.length; ++i) + $root.ContextualizedStats.encode(array2[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.internalTracesContributingToStats != null && message.internalTracesContributingToStats.length) + for (let i = 0; i < message.internalTracesContributingToStats.length; ++i) + if (message.internalTracesContributingToStats[i] instanceof Uint8Array) { + writer.uint32(/* id 3, wireType 2 =*/26); + writer.bytes(message.internalTracesContributingToStats[i]); + } else + $root.Trace.encode(message.internalTracesContributingToStats[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.referencedFieldsByType != null && Object.hasOwnProperty.call(message, "referencedFieldsByType")) + for (let keys = Object.keys(message.referencedFieldsByType), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.ReferencedFieldsForType.encode(message.referencedFieldsByType[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TracesAndStats message, length delimited. Does not implicitly {@link TracesAndStats.verify|verify} messages. + * @function encodeDelimited + * @memberof TracesAndStats + * @static + * @param {ITracesAndStats} message TracesAndStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TracesAndStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer. + * @function decode + * @memberof TracesAndStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {TracesAndStats} TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TracesAndStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.TracesAndStats(), key; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.trace && message.trace.length)) + message.trace = []; + message.trace.push($root.Trace.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.statsWithContext && message.statsWithContext.length)) + message.statsWithContext = []; + message.statsWithContext.push($root.ContextualizedStats.decode(reader, reader.uint32())); + break; + case 4: + reader.skip().pos++; + if (message.referencedFieldsByType === $util.emptyObject) + message.referencedFieldsByType = {}; + key = reader.string(); + reader.pos++; + message.referencedFieldsByType[key] = $root.ReferencedFieldsForType.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.internalTracesContributingToStats && message.internalTracesContributingToStats.length)) + message.internalTracesContributingToStats = []; + message.internalTracesContributingToStats.push($root.Trace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TracesAndStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof TracesAndStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {TracesAndStats} TracesAndStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TracesAndStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TracesAndStats message. + * @function verify + * @memberof TracesAndStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TracesAndStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trace != null && message.hasOwnProperty("trace")) { + if (!Array.isArray(message.trace)) + return "trace: array expected"; + for (let i = 0; i < message.trace.length; ++i) + if (!(message.trace[i] instanceof Uint8Array)) { + let error = $root.Trace.verify(message.trace[i]); + if (error) + return "trace." + error; + } + } + if (message.statsWithContext != null && message.hasOwnProperty("statsWithContext")) { + let array2; + if (message.statsWithContext != null && message.statsWithContext.toArray) + array2 = message.statsWithContext.toArray(); + else + array2 = message.statsWithContext; + if (!Array.isArray(array2)) + return "statsWithContext: array expected"; + for (let i = 0; i < array2.length; ++i) { + let error = $root.ContextualizedStats.verify(array2[i]); + if (error) + return "statsWithContext." + error; + } + } + if (message.referencedFieldsByType != null && message.hasOwnProperty("referencedFieldsByType")) { + if (!$util.isObject(message.referencedFieldsByType)) + return "referencedFieldsByType: object expected"; + let key = Object.keys(message.referencedFieldsByType); + for (let i = 0; i < key.length; ++i) { + let error = $root.ReferencedFieldsForType.verify(message.referencedFieldsByType[key[i]]); + if (error) + return "referencedFieldsByType." + error; + } + } + if (message.internalTracesContributingToStats != null && message.hasOwnProperty("internalTracesContributingToStats")) { + if (!Array.isArray(message.internalTracesContributingToStats)) + return "internalTracesContributingToStats: array expected"; + for (let i = 0; i < message.internalTracesContributingToStats.length; ++i) + if (!(message.internalTracesContributingToStats[i] instanceof Uint8Array)) { + let error = $root.Trace.verify(message.internalTracesContributingToStats[i]); + if (error) + return "internalTracesContributingToStats." + error; + } + } + return null; + }; + + /** + * Creates a plain object from a TracesAndStats message. Also converts values to other types if specified. + * @function toObject + * @memberof TracesAndStats + * @static + * @param {TracesAndStats} message TracesAndStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TracesAndStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.trace = []; + object.statsWithContext = []; + object.internalTracesContributingToStats = []; + } + if (options.objects || options.defaults) + object.referencedFieldsByType = {}; + if (message.trace && message.trace.length) { + object.trace = []; + for (let j = 0; j < message.trace.length; ++j) + object.trace[j] = $root.Trace.toObject(message.trace[j], options); + } + if (message.statsWithContext && message.statsWithContext.length) { + object.statsWithContext = []; + for (let j = 0; j < message.statsWithContext.length; ++j) + object.statsWithContext[j] = $root.ContextualizedStats.toObject(message.statsWithContext[j], options); + } + if (message.internalTracesContributingToStats && message.internalTracesContributingToStats.length) { + object.internalTracesContributingToStats = []; + for (let j = 0; j < message.internalTracesContributingToStats.length; ++j) + object.internalTracesContributingToStats[j] = $root.Trace.toObject(message.internalTracesContributingToStats[j], options); + } + let keys2; + if (message.referencedFieldsByType && (keys2 = Object.keys(message.referencedFieldsByType)).length) { + object.referencedFieldsByType = {}; + for (let j = 0; j < keys2.length; ++j) + object.referencedFieldsByType[keys2[j]] = $root.ReferencedFieldsForType.toObject(message.referencedFieldsByType[keys2[j]], options); + } + return object; + }; + + /** + * Converts this TracesAndStats to JSON. + * @function toJSON + * @memberof TracesAndStats + * @instance + * @returns {Object.} JSON object + */ + TracesAndStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TracesAndStats; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.seconds = 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbjs b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbjs new file mode 100755 index 00000000..b235c559 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbjs @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/../../../../../../node_modules" +else + export NODE_PATH="$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/../../../../../../node_modules:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +else + exec node "$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +fi +# cmd-shim-target=../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbts b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbts new file mode 100755 index 00000000..df70cfcd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/node_modules/.bin/apollo-pbts @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/../../../../../../node_modules" +else + export NODE_PATH="$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/../../../../../../node_modules:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +else + exec node "$basedir_abs/../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +fi +# cmd-shim-target=../../../../../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/package.json b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/package.json new file mode 100644 index 00000000..91cec0eb --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/package.json @@ -0,0 +1,49 @@ +{ + "name": "@apollo/usage-reporting-protobuf", + "version": "4.1.2", + "description": "Protobuf format for Apollo usage reporting", + "type": "module", + "exports": { + ".": { + "types": { + "require": "./generated/cjs/protobuf.d.ts", + "default": "./generated/esm/protobuf.d.ts" + }, + "import": "./generated/esm/protobuf.js", + "require": "./generated/cjs/protobuf.js" + } + }, + "main": "generated/cjs/protobuf.js", + "module": "generated/esm/protobuf.js", + "types": "generated/esm/protobuf.d.ts", + "scripts": { + "generate": "rm -rf generated && mkdir -p generated/{esm,cjs} && npm run pbjs-cjs && npm run pbjs-esm && npm run pbts", + "pbjs-cjs": "apollo-pbjs --target static-module --out generated/cjs/protobuf.cjs --wrap commonjs --force-number --no-from-object src/reports.proto", + "pbjs-esm": "apollo-pbjs --target static-module --out generated/esm/protobuf.mjs --es6 --force-number --no-from-object src/reports.proto", + "pbts-cjs": "mv generated/cjs/protobuf.{c,}js && apollo-pbts -o generated/cjs/protobuf.d.ts generated/cjs/protobuf.js", + "pbts-esm": "mv generated/esm/protobuf.{m,}js && apollo-pbts -o generated/esm/protobuf.d.ts generated/esm/protobuf.js", + "pbts": "npm run pbts-cjs && npm run pbts-esm", + "update-proto": "curl -sSfo src/reports.proto https://usage-reporting.api.apollographql.com/proto/reports.proto" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-server.git", + "directory": "packages/usage-reporting-protobuf" + }, + "keywords": [ + "GraphQL", + "Apollo", + "Server", + "Javascript" + ], + "author": "Apollo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/apollographql/apollo-server/issues" + }, + "homepage": "https://github.com/apollographql/apollo-server#readme", + "//": "Don't caret this, we want to be explicit about the version of our fork of protobufjs and update it intentionally if we need to.", + "dependencies": { + "@apollo/protobufjs": "1.2.8" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/.editorconfig b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/.editorconfig new file mode 100644 index 00000000..bd27d8d5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/.editorconfig @@ -0,0 +1,12 @@ +# reports.proto is copied from an internal Apollo repository which applies these +# editorconfig standards. + +root = true + +[reports.proto] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/reports.proto b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/reports.proto new file mode 100644 index 00000000..bb32e48f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf/src/reports.proto @@ -0,0 +1,476 @@ +syntax = "proto3"; + + +import "google/protobuf/timestamp.proto"; + +message Trace { + message CachePolicy { + enum Scope { + UNKNOWN = 0; + PUBLIC = 1; + PRIVATE = 2; + } + + Scope scope = 1; + int64 max_age_ns = 2; // use 0 for absent, -1 for 0 + } + + message Details { + // The variables associated with this query (unless the reporting agent is + // configured to keep them all private). Values are JSON: ie, strings are + // enclosed in double quotes, etc. The value of a private variable is + // the empty string. + map variables_json = 4; + + + // This is deprecated and only used for legacy applications + // don't include this in traces inside a FullTracesReport; the operation + // name for these traces comes from the key of the traces_per_query map. + string operation_name = 3; + } + + message Error { + string message = 1; // required + repeated Location location = 2; + uint64 time_ns = 3; + string json = 4; + } + + message HTTP { + message Values { + repeated string value = 1; + } + + enum Method { + UNKNOWN = 0; + OPTIONS = 1; + GET = 2; + HEAD = 3; + POST = 4; + PUT = 5; + DELETE = 6; + TRACE = 7; + CONNECT = 8; + PATCH = 9; + } + Method method = 1; + + // Should exclude manual blacklist ("Auth" by default) + map request_headers = 4; + map response_headers = 5; + + uint32 status_code = 6; + + reserved 2, 3, 8, 9; + } + + message Location { + uint32 line = 1; + uint32 column = 2; + } + + // We store information on each resolver execution as a Node on a tree. + // The structure of the tree corresponds to the structure of the GraphQL + // response; it does not indicate the order in which resolvers were + // invoked. Note that nodes representing indexes (and the root node) + // don't contain all Node fields (eg types and times). + message Node { + // The name of the field (for Nodes representing a resolver call) or the + // index in a list (for intermediate Nodes representing elements of a list). + // field_name is the name of the field as it appears in the GraphQL + // response: ie, it may be an alias. (In that case, the original_field_name + // field holds the actual field name from the schema.) In any context where + // we're building up a path, we use the response_name rather than the + // original_field_name. + oneof id { + string response_name = 1; + uint32 index = 2; + } + + string original_field_name = 14; + + // The field's return type; e.g. "String!" for User.email:String! + string type = 3; + + // The field's parent type; e.g. "User" for User.email:String! + string parent_type = 13; + + CachePolicy cache_policy = 5; + + // relative to the trace's start_time, in ns + uint64 start_time = 8; + // relative to the trace's start_time, in ns + uint64 end_time = 9; + + repeated Error error = 11; + repeated Node child = 12; + + reserved 4; + } + + // represents a node in the query plan, under which there is a trace tree for that service fetch. + // In particular, each fetch node represents a call to an implementing service, and calls to implementing + // services may not be unique. See https://github.com/apollographql/federation/blob/main/query-planner-js/src/QueryPlan.ts + // for more information and details. + message QueryPlanNode { + // This represents a set of nodes to be executed sequentially by the Router/Gateway executor + message SequenceNode { + repeated QueryPlanNode nodes = 1; + } + // This represents a set of nodes to be executed in parallel by the Router/Gateway executor + message ParallelNode { + repeated QueryPlanNode nodes = 1; + } + // This represents a node to send an operation to an implementing service + message FetchNode { + // XXX When we want to include more details about the sub-operation that was + // executed against this service, we should include that here in each fetch node. + // This might include an operation signature, requires directive, reference resolutions, etc. + string service_name = 1; + + bool trace_parsing_failed = 2; + + // This Trace only contains start_time, end_time, duration_ns, and root; + // all timings were calculated **on the subgraph**, and clock skew + // will be handled by the ingress server. + Trace trace = 3; + + // relative to the outer trace's start_time, in ns, measured in the Router/Gateway. + uint64 sent_time_offset = 4; + + // Wallclock times measured in the Router/Gateway for when this operation was + // sent and received. + google.protobuf.Timestamp sent_time = 5; + google.protobuf.Timestamp received_time = 6; + } + + // This node represents a way to reach into the response path and attach related entities. + // XXX Flatten is really not the right name and this node may be renamed in the query planner. + message FlattenNode { + repeated ResponsePathElement response_path = 1; + QueryPlanNode node = 2; + } + + // A `DeferNode` corresponds to one or more @defer at the same level of "nestedness" in the planned query. + message DeferNode { + DeferNodePrimary primary = 1; + repeated DeferredNode deferred = 2; + } + + message ConditionNode { + string condition = 1; + QueryPlanNode if_clause = 2; + QueryPlanNode else_clause = 3; + } + + message DeferNodePrimary { + QueryPlanNode node = 1; + } + message DeferredNode { + repeated DeferredNodeDepends depends = 1; + string label = 2; + repeated ResponsePathElement path = 3; + QueryPlanNode node = 4; + } + message DeferredNodeDepends { + string id = 1; + string defer_label = 2; + } + + message ResponsePathElement { + oneof id { + string field_name = 1; + uint32 index = 2; + } + } + oneof node { + SequenceNode sequence = 1; + ParallelNode parallel = 2; + FetchNode fetch = 3; + FlattenNode flatten = 4; + DeferNode defer = 5; + ConditionNode condition = 6; + } + } + + // Wallclock time when the trace began. + google.protobuf.Timestamp start_time = 4; // required + // Wallclock time when the trace ended. + google.protobuf.Timestamp end_time = 3; // required + // High precision duration of the trace; may not equal end_time-start_time + // (eg, if your machine's clock changed during the trace). + uint64 duration_ns = 11; // required + // A tree containing information about all resolvers run directly by this + // service, including errors. + Node root = 14; + + // If this is true, the trace is potentially missing some nodes that were + // present on the query plan. This can happen if the trace span buffer used + // in the Router fills up and some spans have to be dropped. In these cases + // the overall trace timing will still be correct, but the trace data could + // be missing some referenced or executed fields, and some nodes may be + // missing. If this is true we should display a warning to the user when they + // view the trace in Explorer. + bool is_incomplete = 33; + + // ------------------------------------------------------------------------- + // Fields below this line are *not* included in inline traces (the traces + // sent from subgraphs to the Router/Gateway). + + // In addition to details.raw_query, we include a "signature" of the query, + // which can be normalized: for example, you may want to discard aliases, drop + // unused operations and fragments, sort fields, etc. The most important thing + // here is that the signature match the signature in StatsReports. In + // StatsReports signatures show up as the key in the per_query map (with the + // operation name prepended). The signature should be a valid GraphQL query. + // All traces must have a signature; if this Trace is in a FullTracesReport + // that signature is in the key of traces_per_query rather than in this field. + // Engineproxy provides the signature in legacy_signature_needs_resigning + // instead. + string signature = 19; + + // Optional: when GraphQL parsing or validation against the GraphQL schema fails, these fields + // can include reference to the operation being sent for users to dig into the set of operations + // that are failing validation. + string unexecutedOperationBody = 27; + string unexecutedOperationName = 28; + + Details details = 6; + + string client_name = 7; + string client_version = 8; + + HTTP http = 10; + + CachePolicy cache_policy = 18; + + // If this Trace was created by a Router/Gateway, this is the query plan, including + // sub-Traces for subgraphs. Note that the 'root' tree on the + // top-level Trace won't contain any resolvers (though it could contain errors + // that occurred in the Router/Gateway itself). + QueryPlanNode query_plan = 26; + + // Was this response served from a full query response cache? (In that case + // the node tree will have no resolvers.) + bool full_query_cache_hit = 20; + + // Was this query specified successfully as a persisted query hash? + bool persisted_query_hit = 21; + // Did this query contain both a full query string and a persisted query hash? + // (This typically means that a previous request was rejected as an unknown + // persisted query.) + bool persisted_query_register = 22; + + // Was this operation registered and a part of the safelist? + bool registered_operation = 24; + + // Was this operation forbidden due to lack of safelisting? + bool forbidden_operation = 25; + + // Some servers don't do field-level instrumentation for every request and assign + // each request a "weight" for each request that they do instrument. When this + // trace is aggregated into field usage stats, it should count as this value + // towards the estimated_execution_count rather than just 1. This value should + // typically be at least 1. + // + // 0 is treated as 1 for backwards compatibility. + double field_execution_weight = 31; + + + + // removed: Node parse = 12; Node validate = 13; + // Id128 server_id = 1; Id128 client_id = 2; + // String client_reference_id = 23; String client_address = 9; + reserved 1, 2, 9, 12, 13, 23; +} + +// The `service` value embedded within the header key is not guaranteed to contain an actual service, +// and, in most cases, the service information is trusted to come from upstream processing. If the +// service _is_ specified in this header, then it is checked to match the context that is reporting it. +// Otherwise, the service information is deduced from the token context of the reporter and then sent +// along via other mechanisms (in Kafka, the `ReportKafkaKey). The other information (hostname, +// agent_version, etc.) is sent by the Apollo Engine Reporting agent, but we do not currently save that +// information to any of our persistent storage. +message ReportHeader { + // eg "mygraph@myvariant" + string graph_ref = 12; + + // eg "host-01.example.com" + string hostname = 5; + + // eg "engineproxy 0.1.0" + string agent_version = 6; // required + // eg "prod-4279-20160804T065423Z-5-g3cf0aa8" (taken from `git describe --tags`) + string service_version = 7; + // eg "node v4.6.0" + string runtime_version = 8; + // eg "Linux box 4.6.5-1-ec2 #1 SMP Mon Aug 1 02:31:38 PDT 2016 x86_64 GNU/Linux" + string uname = 9; + // An id that is used to represent the schema to Apollo Graph Manager + // Using this in place of what used to be schema_hash, since that is no longer + // attached to a schema in the backend. + string executable_schema_id = 11; + + reserved 3; // removed string service = 3; +} + +message PathErrorStats { + map children = 1; + uint64 errors_count = 4; + uint64 requests_with_errors_count = 5; +} + +message QueryLatencyStats { + repeated sint64 latency_count = 13 [(js_use_toArray)=true]; + uint64 request_count = 2; + uint64 cache_hits = 3; + uint64 persisted_query_hits = 4; + uint64 persisted_query_misses = 5; + repeated sint64 cache_latency_count = 14 [(js_use_toArray)=true]; + PathErrorStats root_error_stats = 7; + uint64 requests_with_errors_count = 8; + repeated sint64 public_cache_ttl_count = 15 [(js_use_toArray)=true]; + repeated sint64 private_cache_ttl_count = 16 [(js_use_toArray)=true]; + uint64 registered_operation_count = 11; + uint64 forbidden_operation_count = 12; + // The number of requests that were executed without field-level + // instrumentation (and thus do not contribute to `observed_execution_count` + // fields on this message's cousin-twice-removed FieldStats). + uint64 requests_without_field_instrumentation = 17; + // 1, 6, 9, and 10 were old int64 histograms + reserved 1, 6, 9, 10; +} + +message StatsContext { + // string client_reference_id = 1; + reserved 1; + string client_name = 2; + string client_version = 3; +} + +message ContextualizedQueryLatencyStats { + QueryLatencyStats query_latency_stats = 1; + StatsContext context = 2; +} + +message ContextualizedTypeStats { + StatsContext context = 1; + map per_type_stat = 2; +} + +message FieldStat { + string return_type = 3; // required; eg "String!" for User.email:String! + // Number of errors whose path is this field. Note that we assume that error + // tracking does *not* require field-level instrumentation so this *will* + // include errors from requests that don't contribute to the + // `observed_execution_count` field (and does not need to be scaled by + // field_execution_weight). + uint64 errors_count = 4; + // Number of times that the resolver for this field is directly observed being + // executed. + uint64 observed_execution_count = 5; + // Same as `count` but potentially scaled upwards if the server was only + // performing field-level instrumentation on a sampling of operations. For + // example, if the server randomly instruments 1% of requests for this + // operation, this number will be 100 times greater than + // `observed_execution_count`. (When aggregating a Trace into FieldStats, + // this number goes up by the trace's `field_execution_weight` for each + // observed field execution, while `observed_execution_count` above goes + // up by 1.) + uint64 estimated_execution_count = 10; + // Number of times the resolver for this field is executed that resulted in + // at least one error. "Request" is a misnomer here as this corresponds to + // resolver calls, not overall operations. Like `errors_count` above, this + // includes all requests rather than just requests with field-level + // instrumentation. + uint64 requests_with_errors_count = 6; + // Duration histogram for the latency of this field. Note that it is scaled in + // the same way as estimated_execution_count so its "total count" might be + // greater than `observed_execution_count` and may not exactly equal + // `estimated_execution_count` due to rounding. + repeated sint64 latency_count = 9 [(js_use_toArray)=true]; + reserved 1, 2, 7, 8; +} + +message TypeStat { + // Key is (eg) "email" for User.email:String! + map per_field_stat = 3; + reserved 1, 2; +} + +message ReferencedFieldsForType { + // Contains (eg) "email" for User.email:String! + repeated string field_names = 1; + // True if this type is an interface. + bool is_interface = 2; +} + + + +// This is the top-level message used by the new traces ingress. This +// is designed for the apollo-engine-reporting TypeScript agent and will +// eventually be documented as a public ingress API. This message consists +// solely of traces; the equivalent of the StatsReport is automatically +// generated server-side from this message. Agent should either send a trace or include it in the stats +// for every request in this report. Generally, buffering up until a large +// size has been reached (say, 4MB) or 5-10 seconds has passed is appropriate. +// This message used to be know as FullTracesReport, but got renamed since it isn't just for traces anymore +message Report { + ReportHeader header = 1; + + // key is statsReportKey (# operationName\nsignature) Note that the nested + // traces will *not* have a signature or details.operationName (because the + // key is adequate). + // + // We also assume that traces don't have + // legacy_per_query_implicit_operation_name, and we don't require them to have + // details.raw_query (which would consume a lot of space and has privacy/data + // access issues, and isn't currently exposed by our app anyway). + map traces_per_query = 5; + + // This is the time that the requests in this trace are considered to have taken place + // If this field is not present the max of the end_time of each trace will be used instead. + // If there are no traces and no end_time present the report will not be able to be processed. + // Note: This will override the end_time from traces. + google.protobuf.Timestamp end_time = 2; // required if no traces in this message + + // Total number of operations processed during this period. + uint64 operation_count = 6; + + // If this is set to true, the stats in TracesWithStats.stats_with_context + // represent all of the operations described from this report, and the + // traces in TracesWithStats.trace are a sampling of some of the same + // operations. If this is false, each operation is described in precisely + // one of those two fields. + bool traces_pre_aggregated = 7; +} + +message ContextualizedStats { + StatsContext context = 1; + QueryLatencyStats query_latency_stats = 2; + // Key is type name. This structure provides data for the count and latency of individual + // field executions and thus only reflects operations for which field-level tracing occurred. + map per_type_stat = 3; + +} + +// A sequence of traces and stats. If Report.traces_pre_aggregated (at the top +// level of the report) is false, an individual operation should either be +// described as a trace or as part of stats, but not both. If that flag +// is true, then all operations are described as stats and some are also +// described as traces. +message TracesAndStats { + repeated Trace trace = 1 [(js_preEncoded)=true]; + repeated ContextualizedStats stats_with_context = 2 [(js_use_toArray)=true]; + // This describes the fields referenced in the operation. Note that this may + // include fields that don't show up in FieldStats (due to being interface fields, + // being nested under null fields or empty lists or non-matching fragments or + // `@include` or `@skip`, etc). It also may be missing fields that show up in FieldStats + // (as FieldStats will include the concrete object type for fields referenced + // via an interface type). + map referenced_fields_by_type = 4; + // This field is used to validate that the algorithm used to construct `stats_with_context` + // matches similar algorithms in Apollo's servers. It is otherwise ignored and should not + // be included in reports. + repeated Trace internal_traces_contributing_to_stats = 3 [(js_preEncoded)=true]; +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/README.md b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/README.md new file mode 100644 index 00000000..e759cbac --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/README.md @@ -0,0 +1,12 @@ +# createHash + +Equivalent to Node.js's `crypto.createHash`. Uses the Node.js builtin if +present, otherwise it falls back the the `sha.js` package's implementation. + +## Usage + +```ts +import { createHash } from "@apollo/utils.createhash"; + +createHash("sha256").update("foo").digest("hex"); +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts new file mode 100644 index 00000000..4dfa47cd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +export declare function createHash(kind: string): import("crypto").Hash; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts.map new file mode 100644 index 00000000..ba32bc75 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,QAAQ,EAAE,IAAI,CAa9D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js new file mode 100644 index 00000000..27ce7a27 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createHash = void 0; +const utils_isnodelike_1 = require("@apollo/utils.isnodelike"); +function createHash(kind) { + if (utils_isnodelike_1.isNodeLike && module.require) { + return module.require("crypto").createHash(kind); + } + return require("sha.js")(kind); +} +exports.createHash = createHash; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js.map new file mode 100644 index 00000000..e94ab1be --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAsD;AAEtD,SAAgB,UAAU,CAAC,IAAY;IAOrC,IAAI,6BAAU,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QAGjC,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAbD,gCAaC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/node_modules/.bin/sha.js b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/node_modules/.bin/sha.js new file mode 100755 index 00000000..502e313d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/node_modules/.bin/sha.js @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/../../../../../../sha.js@2.4.12/node_modules/sha.js/node_modules:$basedir_abs/../../../../../../sha.js@2.4.12/node_modules:$basedir_abs/../../../../../../node_modules" +else + export NODE_PATH="$basedir_abs/../../../../../../sha.js@2.4.12/node_modules/sha.js/node_modules:$basedir_abs/../../../../../../sha.js@2.4.12/node_modules:$basedir_abs/../../../../../../node_modules:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../../../../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../../../../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../../../../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../../../../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +else + exec node "$basedir_abs/../../../../../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +fi +# cmd-shim-target=../../../../../../sha.js@2.4.12/node_modules/sha.js/bin.js diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/package.json b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/package.json new file mode 100644 index 00000000..68e45bc3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/package.json @@ -0,0 +1,27 @@ +{ + "name": "@apollo/utils.createhash", + "version": "3.0.1", + "description": "Node-agnostic hashing utility", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/createHash/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "dependencies": { + "@apollo/utils.isnodelike": "^3.0.0", + "sha.js": "^2.4.11" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/createHash.test.ts b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/createHash.test.ts new file mode 100644 index 00000000..1561d0b5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/createHash.test.ts @@ -0,0 +1,9 @@ +import { createHash } from ".."; + +describe("createHash", () => { + it("creates a hash", () => { + expect(createHash("sha256").update("foo").digest("hex")).toEqual( + "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae", + ); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/exports.test.ts b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/exports.test.ts new file mode 100644 index 00000000..c14661ee --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/exports.test.ts @@ -0,0 +1,6 @@ +import * as allExports from ".."; + +it("exports hashing functions", () => { + expect(Object.keys(allExports).length).toBe(1); + expect(typeof allExports.createHash).toBe("function"); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/tsconfig.json new file mode 100644 index 00000000..40c0056f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/__tests__/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [{ "path": "../../" }] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/index.ts new file mode 100644 index 00000000..4b127082 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash/src/index.ts @@ -0,0 +1,16 @@ +import { isNodeLike } from "@apollo/utils.isnodelike"; + +export function createHash(kind: string): import("crypto").Hash { + // Some Node-like environments (like next.js Turbopack) apparently + // don't have module.require, so double-check before we call it. + // (But don't change the value of isNodeLike because other logic depends on it, + // like Apollo Server signal handling defaults.) This does mean that + // Turbopack will call sha.js instead of the native crypto module, but + // it sure beats throwing because module.require does not exist. + if (isNodeLike && module.require) { + // Use module.require instead of just require to avoid bundling whatever + // crypto polyfills a non-Node bundler might fall back to. + return module.require("crypto").createHash(kind); + } + return require("sha.js")(kind); +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.isnodelike b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.isnodelike new file mode 120000 index 00000000..4ee84c75 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.isnodelike @@ -0,0 +1 @@ +../../../@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/sha.js b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/sha.js new file mode 120000 index 00000000..a73dddc0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.createhash@3.0.1/node_modules/sha.js @@ -0,0 +1 @@ +../../sha.js@2.4.12/node_modules/sha.js \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/README.md b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/README.md new file mode 100644 index 00000000..4af56680 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/README.md @@ -0,0 +1,30 @@ +# dropUnusedDefinitions + +Given an operation document and an operation name, this function will return a +new document with only the definitions required for the operation name provided. + +If the provided operation name doesn't match any operation in the document, +`dropUnusedDefinitions` will return the original document. + +## Usage + +```ts +import { dropUnusedDefinitions } from "@apollo/utils.dropunuseddefinitions"; + +const operation = parse(`#graphql + query Drop { ...DroppedFragment } + fragment DroppedFragment on Query { abc } + query Keep { ...KeptFragment } + fragment KeptFragment on Query { def } +`); +const keepOperation = dropUnusedDefinitions(operation, "Keep"); +/** +query Keep { + ...KeptFragment +} + +fragment KeptFragment on Query { + def +} +*/ +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts new file mode 100644 index 00000000..f4a1f234 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts @@ -0,0 +1,3 @@ +import { type DocumentNode } from "graphql"; +export declare function dropUnusedDefinitions(ast: DocumentNode, operationName: string): DocumentNode; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts.map new file mode 100644 index 00000000..23b18413 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,SAAS,CAAC;AAOhE,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,EACjB,aAAa,EAAE,MAAM,GACpB,YAAY,CAQd"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js new file mode 100644 index 00000000..de61ebc9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dropUnusedDefinitions = void 0; +const graphql_1 = require("graphql"); +function dropUnusedDefinitions(ast, operationName) { + const separated = (0, graphql_1.separateOperations)(ast)[operationName]; + if (!separated) { + return ast; + } + return separated; +} +exports.dropUnusedDefinitions = dropUnusedDefinitions; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js.map new file mode 100644 index 00000000..1f921f0e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgE;AAOhE,SAAgB,qBAAqB,CACnC,GAAiB,EACjB,aAAqB;IAErB,MAAM,SAAS,GAAG,IAAA,4BAAkB,EAAC,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC;IACzD,IAAI,CAAC,SAAS,EAAE;QAGd,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAXD,sDAWC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/package.json b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/package.json new file mode 100644 index 00000000..566c34fd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/package.json @@ -0,0 +1,26 @@ +{ + "name": "@apollo/utils.dropunuseddefinitions", + "version": "2.0.1", + "description": "Drop unused definitions from a GraphQL document", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/dropUnusedDefinitions/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/dropUnusedDefinitions.test.ts b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/dropUnusedDefinitions.test.ts new file mode 100644 index 00000000..836689e2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/dropUnusedDefinitions.test.ts @@ -0,0 +1,86 @@ +import { print, parse } from "graphql"; +import { dropUnusedDefinitions } from ".."; + +describe("dropUnusedDefinitions", () => { + it("anonymous operation", () => { + const operation = parse(`#graphql + {abc} + `); + expect(print(dropUnusedDefinitions(operation, ""))).toMatchInlineSnapshot(` + "{ + abc + }" + `); + }); + + it("named operation", () => { + const operation = parse(`#graphql + query MyQuery {abc} + `); + expect(print(dropUnusedDefinitions(operation, "MyQuery"))) + .toMatchInlineSnapshot(` + "query MyQuery { + abc + }" + `); + }); + + it("multiple operations", () => { + const operation = parse(`#graphql + query Keep { abc } + query Drop { def } + `); + expect(print(dropUnusedDefinitions(operation, "Keep"))) + .toMatchInlineSnapshot(` + "query Keep { + abc + }" + `); + }); + + it("includes only used fragments", () => { + const operation = parse(`#graphql + query Drop { ...DroppedFragment } + fragment DroppedFragment on Query { abc } + query Keep { ...KeptFragment } + fragment KeptFragment on Query { def } + `); + expect(print(dropUnusedDefinitions(operation, "Keep"))) + .toMatchInlineSnapshot(` + "query Keep { + ...KeptFragment + } + + fragment KeptFragment on Query { + def + }" + `); + }); + + it("preserves entire document when operation isn't found", () => { + const operation = parse(`#graphql + query Keep { ...KeptFragment } + fragment KeptFragment on Query { abc } + query AlsoKeep { ...AlsoKeptFragment } + fragment AlsoKeptFragment on Query { def } + `); + expect(print(dropUnusedDefinitions(operation, "Unknown"))) + .toMatchInlineSnapshot(` + "query Keep { + ...KeptFragment + } + + fragment KeptFragment on Query { + abc + } + + query AlsoKeep { + ...AlsoKeptFragment + } + + fragment AlsoKeptFragment on Query { + def + }" + `); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/tsconfig.json new file mode 100644 index 00000000..40c0056f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/__tests__/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [{ "path": "../../" }] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/index.ts new file mode 100644 index 00000000..9ee4df6c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions/src/index.ts @@ -0,0 +1,19 @@ +import { type DocumentNode, separateOperations } from "graphql"; + +// A GraphQL query may contain multiple named operations, with the operation to +// use specified separately by the client. This transformation drops unused +// operations from the query, as well as any fragment definitions that are not +// referenced. (In general we recommend that unused definitions are dropped on +// the client before sending to the server to save bandwidth and parsing time.) +export function dropUnusedDefinitions( + ast: DocumentNode, + operationName: string, +): DocumentNode { + const separated = separateOperations(ast)[operationName]; + if (!separated) { + // If the given operationName isn't found, just make this whole transform a + // no-op instead of crashing. + return ast; + } + return separated; +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/README.md b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/README.md new file mode 100644 index 00000000..5bd0f3f7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/README.md @@ -0,0 +1,13 @@ +# Fetcher interface + +This package defines TypeScript typings for a subset of the [web `fetch` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). + +The goal is for software that wants to be able to make HTTP requests in a configurable fashion to be able to declare an option of this type; users can pass in any valid `fetch` implementation such as `node-fetch`, `make-fetch-happen`, or `undici`. + +The actual `fetch` API is very flexible. You can specify requests either as JSON-style objects or as objects of the `Request` and `Headers` classes. However, some `fetch` implementations distinguish between these cases by using (for example) `instanceof Headers`, where `Headers` is the particular class defined by that implementation. So if you want to write portable code that should work with any `fetch` implementation, you need to use JSON-style objects rather than a particular implementation's classes. (For example, a `Headers` object created with `node-fetch` v2 will not be properly recognized by `make-fetch-happen` v10.) + +Additionally, some `fetch` implementations accept various types for their request `body`; for example, `node-fetch` supports the use of `FormData` objects specifically from the `form-data` package. You may choose to use different types for your request `body`, so long as those types are supported by the `fetch` implementation of your choice. You will likely need to use a type assertion to convince TypeScript that your `body` is valid. Unfortunately, because different `fetch` implementations access different `FormData` classes, we weren't excited about the outcome of this [relevant PR](https://github.com/apollographql/apollo-utils/pull/225) and decided to undo it, but might be open to a simpler approach that solves the problem without the need for type assertions. + +Specifically, the `Fetcher` interface only declares options that are currently required by the software that uses it, such as Apollo Server and Apollo Gateway. If more options are required (and they are implemented with the same types in all `fetch` implementations), we can add them as needed. + +This package is validated to be compatible with the typings of `node-fetch` v2, `make-fetch-happen` v10, and `undici` v5. diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts new file mode 100644 index 00000000..22fc8f94 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts @@ -0,0 +1,34 @@ +/// +export interface FetcherRequestInit { + method?: string; + headers?: Record; + body?: string | Buffer; + redirect?: "follow" | "error" | "manual"; + signal?: any; +} +export interface FetcherResponse { + readonly bodyUsed: boolean; + readonly url: string; + readonly redirected: boolean; + readonly status: number; + readonly ok: boolean; + readonly statusText: string; + readonly headers: FetcherHeaders; + arrayBuffer(): Promise; + text(): Promise; + json(): Promise; + clone(): FetcherResponse; +} +export interface FetcherHeaders extends Iterable<[string, string]> { + append(name: string, value: string): void; + delete(name: string): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; + entries(): Iterator<[string, string]>; + keys(): Iterator; + values(): Iterator; + [Symbol.iterator](): Iterator<[string, string]>; +} +export type Fetcher = (url: string, init?: FetcherRequestInit) => Promise; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts.map new file mode 100644 index 00000000..974afc5b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.d.ts.map @@ -0,0 +1 @@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M,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvC,OAAO,IAAI,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtC,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,OAAO,GAAG,CACpB,GAAG,EAAE,MAAM,EAGX,IAAI,CAAC,EAAE,kBAAkB,KACtB,OAAO,CAAC,eAAe,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js new file mode 100644 index 00000000..aa219d8f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js.map new file mode 100644 index 00000000..1ed2df62 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/package.json b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/package.json new file mode 100644 index 00000000..975bd227 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/package.json @@ -0,0 +1,23 @@ +{ + "name": "@apollo/utils.fetcher", + "version": "3.1.0", + "description": "Minimal web-style fetch TypeScript typings", + "main": "", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/fetcher/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=16" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/index.test.ts b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/index.test.ts new file mode 100644 index 00000000..98aa11d7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/index.test.ts @@ -0,0 +1,19 @@ +import type { Fetcher } from ".."; +import nodeFetch from "node-fetch"; +import makeFetchHappen from "make-fetch-happen"; +import { fetch as undiciFetch } from "undici"; + +// This "test suite" actually does all its work at compile time. +function isAFetcher(_fetcher: Fetcher) {} + +it("node-fetch is a Fetcher", () => { + isAFetcher(nodeFetch); +}); + +it("make-fetch-happen is a Fetcher", () => { + isAFetcher(makeFetchHappen); +}); + +it("undici is a Fetcher", () => { + isAFetcher(undiciFetch); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/tsconfig.json new file mode 100644 index 00000000..40c0056f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/__tests__/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [{ "path": "../../" }] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/index.ts new file mode 100644 index 00000000..c373a559 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher/src/index.ts @@ -0,0 +1,82 @@ +export interface FetcherRequestInit { + method?: string; + // We explicitly do not allow you to pass in a Headers (or FetcherHeaders) + // object here, because not all implementations recognize "foreign" Headers + // objects. + headers?: Record; + body?: string | Buffer; + redirect?: "follow" | "error" | "manual"; + + // A provided `signal` should be an object created by a class named + // `AbortSignal` (the constructor name is checked by some implementations like + // node-fetch and make-fetch-happen!) which follows the DOM AbortSignal API. + // Notably, it should have `aborted: boolean` and methods `addEventListener` + // and `removeEventListener`. We do not provide a precise interface for it + // because we have found that runtime implementations are more consistent than + // TypeScript definitions; for example, the methods such as addEventListener + // end up being defined in terms of complex DOM types which vary by + // implementation. + // + // Note that a relatively recent addition to the spec + // (https://github.com/whatwg/dom/pull/1027) is the concept of an abort + // reason. None of the polyfill Node AbortController/AbortSignal + // implementations seems to support this yet (though Node's built-in + // implementation does as of v18). It is possible that some Fetch + // implementations might rely on the existence of this new functionality, say + // by calling signal.throwIfAborted(). If so, you would need to use an + // AbortSignal that supports this (such as the Node v18 implementation). As of + // now, it does not appear that node-fetch, make-fetch-happen, or undici rely + // on throwIfAborted, although undici does look at signal.reason if it is + // provided. + // + // The main motivation for providing this as `any` (rather than, say, an + // interface where the functions take `any` arguments to avoid linking in DOM) + // is because if we leave out the newer `reason`/`throwIfAborted` fields, then + // implementations like undici that use the Node v18 definitions won't + // typecheck, but if we include those fields, then `AbortSignal`s from + // `AbortController` polyfill libraries such as `node-abort-controller` won't + // typecheck because they don't provide those fields. While in a sense that's + // correct, we don't want to provide an interface for which there are no + // existing implementations for Node v16 or older! (We may later choose to + // publish our own polyfill and make this type more exact.) + signal?: any; + + // We explicitly do not support non-portable options like `node-fetch`'s + // `agent`. +} + +export interface FetcherResponse { + readonly bodyUsed: boolean; + readonly url: string; + readonly redirected: boolean; + readonly status: number; + readonly ok: boolean; + readonly statusText: string; + readonly headers: FetcherHeaders; + + arrayBuffer(): Promise; + text(): Promise; + json(): Promise; + + clone(): FetcherResponse; +} + +export interface FetcherHeaders extends Iterable<[string, string]> { + append(name: string, value: string): void; + delete(name: string): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; + + entries(): Iterator<[string, string]>; + keys(): Iterator; + values(): Iterator; + [Symbol.iterator](): Iterator<[string, string]>; +} + +export type Fetcher = ( + url: string, + // We explicitly do not allow you to pass in a Request object here, because + // not all implementations recognize "foreign" Request objects. + init?: FetcherRequestInit, +) => Promise; diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/README.md b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/README.md new file mode 100644 index 00000000..86d0f9d4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/README.md @@ -0,0 +1,14 @@ +# isNodeLike + +A simple constant to determine if the current environment is Node-like by +inspecting the `process` global for Node-specific properties. + +## Usage + +```ts +import { isNodeLike } from "@apollo/utils.isnodelike"; + +if (isNodeLike) { + require("fs").readFileSync("foo"); +} +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts new file mode 100644 index 00000000..80239404 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts @@ -0,0 +1,2 @@ +export declare const isNodeLike: boolean; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts.map new file mode 100644 index 00000000..9fdb78cc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,SAWoB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js new file mode 100644 index 00000000..5620739f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isNodeLike = void 0; +exports.isNodeLike = typeof process === "object" && + process && + process.release && + process.versions && + typeof process.versions.node === "string"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js.map new file mode 100644 index 00000000..71ea6fca --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GACrB,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IAKP,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ;IAGhB,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/package.json b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/package.json new file mode 100644 index 00000000..c3f1a65c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/package.json @@ -0,0 +1,23 @@ +{ + "name": "@apollo/utils.isnodelike", + "version": "3.0.0", + "description": "Node environment detection utility", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/isNodeLike/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=16" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/src/index.ts new file mode 100644 index 00000000..036eced2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike/src/index.ts @@ -0,0 +1,12 @@ +export const isNodeLike = + typeof process === "object" && + process && + // We used to check `process.release.name === "node"`, however that doesn't + // account for certain forks of Node.js which are otherwise identical to + // Node.js. For example, NodeSource's N|Solid reports itself as "nsolid", + // though it's mostly the same build of Node.js with an extra addon. + process.release && + process.versions && + // The one thing which is present on both Node.js and N|Solid (a fork of + // Node.js), is `process.versions.node` being defined. + typeof process.versions.node === "string"; diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/README.md b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/README.md new file mode 100644 index 00000000..5cc4b8e5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/README.md @@ -0,0 +1,70 @@ +# KeyValueCache interface + +```ts +export interface KeyValueCache< + V = string, + SO extends KeyValueCacheSetOptions = KeyValueCacheSetOptions, +> { + get(key: string): Promise; + set(key: string, value: V, options?: SO): Promise; + delete(key: string): Promise; +} +``` + +This interface defines a minimally-compatible cache intended for (but not limited to) use by Apollo Server. It is notably implemented by `KeyvAdapter` from the `@apollo/utils.keyvadapter` package. (`KeyvAdapter` in conjunction with a `Keyv` is probably more interesting to you unless you're actually building a cache!) + +# InMemoryLRUCache + +This class wraps `lru-cache` and implements the `KeyValueCache` interface. It accepts `LRUCache.Options` as the constructor argument and passes them to the `LRUCache` which is created. A default `maxSize` and `sizeCalculator` are provided in order to prevent an unbounded cache; these can both be tweaked via the constructor argument. + +```ts +const cache = new InMemoryLRUCache({ + // create a larger-than-default `LRUCache` + maxSize: Math.pow(2, 20) * 50, +}); +``` + +# PrefixingKeyValueCache + +This class wraps a `KeyValueCache` in order to provide a specified prefix for keys entering the cache via this wrapper. + +```ts +const cache = new InMemoryLRUCache(); +const prefixedCache = new PrefixingKeyValueCache(cache, "apollo:"); +``` + +One reason to use this is if a single piece of software wants to use a cache for multiple features. For example, you can pass a `KeyValueCache` as the `cache` option to `@apollo/server`'s `ApolloServer` class; it provides this cache to plugins and other features as a default cache to use (if the user does not provide the specific plugin its own cache). Each feature uses `PrefixingKeyValueCache` with a different prefix to prevent different features from stomping on each others' data. + +However, if you are configuring one of those features explicitly, you may _not_ want this prefix to be added. In that case, you can wrap your cache in a cache returned by `PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation`. The only difference between this cache and the cache that it wraps is that when it is passed directly to a `PrefixingKeyValueCache`, no prefix is applied. + +That is, let's say you are using a class that is implemented like this: + +```ts +class SomePlugin { + private cache: KeyValueCache; + constructor(cache: KeyValueCache) { + this.cache = new PrefixingKeyValueCache(cache, "some:"); + } +} +``` + +If you set up your plugin as `new SomePlugin({ cache: myRedisCache })` then the plugin will add `some:` to all keys when interacting with your cache, but if you set it up as `new SomePlugin({ cache: PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation(myRedisCache) })`, then the plugin will not apply its prefix. You should only do this if you feel confident that this feature's use of this cache will not overlap with another feature: perhaps this is the only feature you have configured to use this cache, or perhaps the feature provides suitable control over cache keys that you can ensure isolation without needing the plugin's prefix. + +Software like `ApolloServer` that passes a single `KeyValueCache` to several features should throw if a `PrefixesAreUnnecessaryForIsolationCache` is provided to it; it can check this condition with the static `PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation` method (which is safer than an `instanceof` check in case there are multiple copies of `@apollo/utils.keyvaluecache` installed). + +# ErrorsAreMissesCache + +This class wraps a `KeyValueCache` in order to provide error tolerance for caches which connect via a client like Redis. In the event that there's an _error_, this wrapper will treat it as a cache miss (and log the error instead, if a `logger` is provided). + +An example usage (which makes use of the `keyv` Redis client and our `KeyvAdapter`) would look something like this: + +```ts +import Keyv from "keyv"; +import { KeyvAdapter } from "@apollo/utils.keyvadapter"; +import { ErrorsAreMissesCache } from "@apollo/utils.keyvaluecache"; + +const redisCache = new Keyv("redis://user:pass@localhost:6379"); +const faultTolerantCache = new ErrorsAreMissesCache( + new KeyvAdapter(redisCache), +); +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts new file mode 100644 index 00000000..7f1b1a07 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts @@ -0,0 +1,11 @@ +import type { KeyValueCache, KeyValueCacheSetOptions } from "./KeyValueCache"; +import type { Logger } from "@apollo/utils.logger"; +export declare class ErrorsAreMissesCache implements KeyValueCache { + private cache; + private logger?; + constructor(cache: KeyValueCache, logger?: Logger | undefined); + get(key: string): Promise; + set(key: string, value: V, opts?: SO): Promise; + delete(key: string): Promise; +} +//# sourceMappingURL=ErrorsAreMissesCache.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts.map new file mode 100644 index 00000000..21366316 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ErrorsAreMissesCache.d.ts","sourceRoot":"","sources":["../src/ErrorsAreMissesCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAOnD,qBAAa,oBAAoB,CAC/B,CAAC,GAAG,MAAM,EACV,EAAE,SAAS,uBAAuB,GAAG,uBAAuB,CAC5D,YAAW,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;IAG7B,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,MAAM,CAAC;gBADP,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,EAC3B,MAAM,CAAC,EAAE,MAAM,YAAA;IAGnB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAexC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAGnD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js new file mode 100644 index 00000000..dad68164 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorsAreMissesCache = void 0; +class ErrorsAreMissesCache { + constructor(cache, logger) { + this.cache = cache; + this.logger = logger; + } + async get(key) { + try { + return await this.cache.get(key); + } + catch (e) { + if (this.logger) { + if (e instanceof Error) { + this.logger.error(e.message); + } + else { + this.logger.error(e); + } + } + return undefined; + } + } + async set(key, value, opts) { + return this.cache.set(key, value, opts); + } + async delete(key) { + return this.cache.delete(key); + } +} +exports.ErrorsAreMissesCache = ErrorsAreMissesCache; +//# sourceMappingURL=ErrorsAreMissesCache.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js.map new file mode 100644 index 00000000..b120b2ee --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/ErrorsAreMissesCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ErrorsAreMissesCache.js","sourceRoot":"","sources":["../src/ErrorsAreMissesCache.ts"],"names":[],"mappings":";;;AAQA,MAAa,oBAAoB;IAK/B,YACU,KAA2B,EAC3B,MAAe;QADf,UAAK,GAAL,KAAK,CAAsB;QAC3B,WAAM,GAAN,MAAM,CAAS;IACtB,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;oBACvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC/B,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAQ,EAAE,IAAS;QACxC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;CACF;AAhCD,oDAgCC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts new file mode 100644 index 00000000..802ec690 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts @@ -0,0 +1,14 @@ +import { LRUCache } from "lru-cache"; +import type { KeyValueCache, KeyValueCacheSetOptions } from "./KeyValueCache"; +export type InMemoryLRUCacheSetOptions = Omit, "ttl"> & KeyValueCacheSetOptions; +export declare class InMemoryLRUCache = InMemoryLRUCacheSetOptions> implements KeyValueCache { + private cache; + constructor(lruCacheOpts?: LRUCache.Options); + static sizeCalculation(item: V): number; + set(key: string, value: V, options?: SO): Promise; + get(key: string): Promise; + delete(key: string): Promise; + clear(): void; + keys(): string[]; +} +//# sourceMappingURL=InMemoryLRUCache.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts.map new file mode 100644 index 00000000..75a25d1e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"InMemoryLRUCache.d.ts","sourceRoot":"","sources":["../src/InMemoryLRUCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,MAAM,0BAA0B,CACpC,CAAC,SAAS,EAAE,GAAG,MAAM,EACrB,EAAE,GAAG,OAAO,IACV,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,uBAAuB,CAAC;AAG9E,qBAAa,gBAAgB,CAC3B,CAAC,SAAS,EAAE,GAAG,MAAM,EACrB,EAAE,SAAS,0BAA0B,CAAC,CAAC,CAAC,GAAG,0BAA0B,CAAC,CAAC,CAAC,CACxE,YAAW,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;IAE/B,OAAO,CAAC,KAAK,CAAsB;gBAEvB,YAAY,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC;IAc3D,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC;IAWtC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE;IASvC,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,MAAM,CAAC,GAAG,EAAE,MAAM;IAIxB,KAAK;IAIL,IAAI;CAIL"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js new file mode 100644 index 00000000..d9f82b5d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InMemoryLRUCache = void 0; +const lru_cache_1 = require("lru-cache"); +class InMemoryLRUCache { + constructor(lruCacheOpts) { + this.cache = new lru_cache_1.LRUCache({ + sizeCalculation: InMemoryLRUCache.sizeCalculation, + maxSize: Math.pow(2, 20) * 30, + ...lruCacheOpts, + }); + } + static sizeCalculation(item) { + if (typeof item === "string") { + return item.length; + } + if (typeof item === "object") { + return Buffer.byteLength(JSON.stringify(item), "utf8"); + } + return 1; + } + async set(key, value, options) { + const lruOptions = options + ? { ...options, ttl: options.ttl ? options.ttl * 1000 : 0 } + : undefined; + this.cache.set(key, value, lruOptions); + } + async get(key) { + return this.cache.get(key); + } + async delete(key) { + return this.cache.delete(key); + } + clear() { + this.cache.clear(); + } + keys() { + return [...this.cache.keys()]; + } +} +exports.InMemoryLRUCache = InMemoryLRUCache; +//# sourceMappingURL=InMemoryLRUCache.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js.map new file mode 100644 index 00000000..94029aed --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/InMemoryLRUCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"InMemoryLRUCache.js","sourceRoot":"","sources":["../src/InMemoryLRUCache.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AASrC,MAAa,gBAAgB;IAO3B,YAAY,YAA+C;QACzD,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAQ,CAAC;YACxB,eAAe,EAAE,gBAAgB,CAAC,eAAe;YAGjD,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE;YAC7B,GAAG,YAAY;SAChB,CAAC,CAAC;IACL,CAAC;IAMD,MAAM,CAAC,eAAe,CAAe,IAAO;QAC1C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAE7B,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAQ,EAAE,OAAY;QAG3C,MAAM,UAAU,GAAG,OAAO;YACxB,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YAC3D,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,IAAI;QAEF,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAChC,CAAC;CACF;AAzDD,4CAyDC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts new file mode 100644 index 00000000..290fb522 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts @@ -0,0 +1,9 @@ +export interface KeyValueCache { + get(key: string): Promise; + set(key: string, value: V, options?: SO): Promise; + delete(key: string): Promise; +} +export interface KeyValueCacheSetOptions { + ttl?: number | null; +} +//# sourceMappingURL=KeyValueCache.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts.map new file mode 100644 index 00000000..5b703524 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"KeyValueCache.d.ts","sourceRoot":"","sources":["../src/KeyValueCache.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAC5B,CAAC,GAAG,MAAM,EACV,EAAE,SAAS,uBAAuB,GAAG,uBAAuB;IAE5D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,uBAAuB;IAKtC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js new file mode 100644 index 00000000..dec474e9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=KeyValueCache.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js.map new file mode 100644 index 00000000..fdb5201c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/KeyValueCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KeyValueCache.js","sourceRoot":"","sources":["../src/KeyValueCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts new file mode 100644 index 00000000..4da6fe81 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts @@ -0,0 +1,15 @@ +import type { KeyValueCache, KeyValueCacheSetOptions } from "."; +declare const prefixesAreUnnecessaryForIsolationSymbol: unique symbol; +export declare class PrefixingKeyValueCache implements KeyValueCache { + private wrapped; + private prefix; + [prefixesAreUnnecessaryForIsolationSymbol]?: true; + constructor(wrapped: KeyValueCache, prefix: string); + get(key: string): Promise; + set(key: string, value: V, options?: SO): Promise; + delete(key: string): Promise; + static prefixesAreUnnecessaryForIsolation(c: KeyValueCache): boolean; + static cacheDangerouslyDoesNotNeedPrefixesForIsolation(c: KeyValueCache): KeyValueCache; +} +export {}; +//# sourceMappingURL=PrefixingKeyValueCache.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts.map new file mode 100644 index 00000000..b618ee5f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PrefixingKeyValueCache.d.ts","sourceRoot":"","sources":["../src/PrefixingKeyValueCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,GAAG,CAAC;AAEhE,QAAA,MAAM,wCAAwC,eAE7C,CAAC;AAYF,qBAAa,sBAAsB,CACjC,CAAC,GAAG,MAAM,EACV,EAAE,SAAS,uBAAuB,GAAG,uBAAuB,CAC5D,YAAW,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;IAM7B,OAAO,CAAC,OAAO;IAJjB,OAAO,CAAC,MAAM,CAAS;IACvB,CAAC,wCAAwC,CAAC,CAAC,EAAE,IAAI,CAAC;gBAGxC,OAAO,EAAE,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,EACrC,MAAM,EAAE,MAAM;IAchB,GAAG,CAAC,GAAG,EAAE,MAAM;IAGf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE;IAGvC,MAAM,CAAC,GAAG,EAAE,MAAM;IAOlB,MAAM,CAAC,kCAAkC,CACvC,CAAC,GAAG,MAAM,EACV,EAAE,SAAS,uBAAuB,GAAG,uBAAuB,EAC5D,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO;IAInC,MAAM,CAAC,+CAA+C,CACpD,CAAC,GAAG,MAAM,EACV,EAAE,SAAS,uBAAuB,GAAG,uBAAuB,EAC5D,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;CAGjD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js new file mode 100644 index 00000000..45fe000c --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js @@ -0,0 +1,50 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PrefixingKeyValueCache = void 0; +const prefixesAreUnnecessaryForIsolationSymbol = Symbol("prefixesAreUnnecessaryForIsolation"); +class PrefixingKeyValueCache { + constructor(wrapped, prefix) { + this.wrapped = wrapped; + if (PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(wrapped)) { + this.prefix = ""; + this[prefixesAreUnnecessaryForIsolationSymbol] = true; + } + else { + this.prefix = prefix; + } + } + get(key) { + return this.wrapped.get(this.prefix + key); + } + set(key, value, options) { + return this.wrapped.set(this.prefix + key, value, options); + } + delete(key) { + return this.wrapped.delete(this.prefix + key); + } + static prefixesAreUnnecessaryForIsolation(c) { + return prefixesAreUnnecessaryForIsolationSymbol in c; + } + static cacheDangerouslyDoesNotNeedPrefixesForIsolation(c) { + return new PrefixesAreUnnecessaryForIsolationCache(c); + } +} +exports.PrefixingKeyValueCache = PrefixingKeyValueCache; +class PrefixesAreUnnecessaryForIsolationCache { + constructor(wrapped) { + this.wrapped = wrapped; + this[_a] = true; + } + get(key) { + return this.wrapped.get(key); + } + set(key, value, options) { + return this.wrapped.set(key, value, options); + } + delete(key) { + return this.wrapped.delete(key); + } +} +_a = prefixesAreUnnecessaryForIsolationSymbol; +//# sourceMappingURL=PrefixingKeyValueCache.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js.map new file mode 100644 index 00000000..3390fc3b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/PrefixingKeyValueCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PrefixingKeyValueCache.js","sourceRoot":"","sources":["../src/PrefixingKeyValueCache.ts"],"names":[],"mappings":";;;;AAEA,MAAM,wCAAwC,GAAG,MAAM,CACrD,oCAAoC,CACrC,CAAC;AAYF,MAAa,sBAAsB;IAQjC,YACU,OAA6B,EACrC,MAAc;QADN,YAAO,GAAP,OAAO,CAAsB;QAGrC,IAAI,sBAAsB,CAAC,kCAAkC,CAAC,OAAO,CAAC,EAAE,CAAC;YACvE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YAKjB,IAAI,CAAC,wCAAwC,CAAC,GAAG,IAAI,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,CAAC;IACH,CAAC;IAED,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD,GAAG,CAAC,GAAW,EAAE,KAAQ,EAAE,OAAY;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IACD,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;IAChD,CAAC;IAKD,MAAM,CAAC,kCAAkC,CAGvC,CAAuB;QACvB,OAAO,wCAAwC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,+CAA+C,CAGpD,CAAuB;QACvB,OAAO,IAAI,uCAAuC,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;CACF;AAlDD,wDAkDC;AAID,MAAM,uCAAuC;IAO3C,YAAoB,OAA6B;QAA7B,YAAO,GAAP,OAAO,CAAsB;QAFjD,QAA0C,GAAG,IAAI,CAAC;IAEE,CAAC;IAErD,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IACD,GAAG,CAAC,GAAW,EAAE,KAAQ,EAAE,OAAY;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;CACF;KAbE,wCAAwC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts new file mode 100644 index 00000000..53545100 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts @@ -0,0 +1,5 @@ +export type { KeyValueCache, KeyValueCacheSetOptions } from "./KeyValueCache"; +export { PrefixingKeyValueCache } from "./PrefixingKeyValueCache"; +export { InMemoryLRUCache, type InMemoryLRUCacheSetOptions, } from "./InMemoryLRUCache"; +export { ErrorsAreMissesCache } from "./ErrorsAreMissesCache"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts.map new file mode 100644 index 00000000..b7dc0c65 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,gBAAgB,EAChB,KAAK,0BAA0B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js new file mode 100644 index 00000000..fefd8256 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorsAreMissesCache = exports.InMemoryLRUCache = exports.PrefixingKeyValueCache = void 0; +var PrefixingKeyValueCache_1 = require("./PrefixingKeyValueCache"); +Object.defineProperty(exports, "PrefixingKeyValueCache", { enumerable: true, get: function () { return PrefixingKeyValueCache_1.PrefixingKeyValueCache; } }); +var InMemoryLRUCache_1 = require("./InMemoryLRUCache"); +Object.defineProperty(exports, "InMemoryLRUCache", { enumerable: true, get: function () { return InMemoryLRUCache_1.InMemoryLRUCache; } }); +var ErrorsAreMissesCache_1 = require("./ErrorsAreMissesCache"); +Object.defineProperty(exports, "ErrorsAreMissesCache", { enumerable: true, get: function () { return ErrorsAreMissesCache_1.ErrorsAreMissesCache; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js.map new file mode 100644 index 00000000..1afd8d43 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,uDAG4B;AAF1B,oHAAA,gBAAgB,OAAA;AAGlB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/package.json b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/package.json new file mode 100644 index 00000000..50a9a9e5 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/package.json @@ -0,0 +1,27 @@ +{ + "name": "@apollo/utils.keyvaluecache", + "version": "4.0.0", + "description": "Minimal key-value cache interface", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/keyValueCache/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "dependencies": { + "@apollo/utils.logger": "^3.0.0", + "lru-cache": "^11.0.0" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/ErrorsAreMissesCache.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/ErrorsAreMissesCache.ts new file mode 100644 index 00000000..68d87cb1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/ErrorsAreMissesCache.ts @@ -0,0 +1,41 @@ +import type { KeyValueCache, KeyValueCacheSetOptions } from "./KeyValueCache"; +import type { Logger } from "@apollo/utils.logger"; + +/** + * This cache wraps a KeyValueCache and returns undefined (a cache miss) for any + * errors thrown by the underlying cache. You can also provide a logger to + * capture these errors rather than just swallow them. + */ +export class ErrorsAreMissesCache< + V = string, + SO extends KeyValueCacheSetOptions = KeyValueCacheSetOptions, +> implements KeyValueCache +{ + constructor( + private cache: KeyValueCache, + private logger?: Logger, + ) {} + + async get(key: string): Promise { + try { + return await this.cache.get(key); + } catch (e) { + if (this.logger) { + if (e instanceof Error) { + this.logger.error(e.message); + } else { + this.logger.error(e); + } + } + return undefined; + } + } + + async set(key: string, value: V, opts?: SO): Promise { + return this.cache.set(key, value, opts); + } + + async delete(key: string): Promise { + return this.cache.delete(key); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/InMemoryLRUCache.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/InMemoryLRUCache.ts new file mode 100644 index 00000000..29d74df7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/InMemoryLRUCache.ts @@ -0,0 +1,67 @@ +import { LRUCache } from "lru-cache"; +import type { KeyValueCache, KeyValueCacheSetOptions } from "./KeyValueCache"; + +export type InMemoryLRUCacheSetOptions< + V extends {} = string, + FC = unknown, +> = Omit, "ttl"> & KeyValueCacheSetOptions; + +// LRUCache wrapper to implement the KeyValueCache interface. +export class InMemoryLRUCache< + V extends {} = string, + SO extends InMemoryLRUCacheSetOptions = InMemoryLRUCacheSetOptions, +> implements KeyValueCache +{ + private cache: LRUCache; + + constructor(lruCacheOpts?: LRUCache.Options) { + this.cache = new LRUCache({ + sizeCalculation: InMemoryLRUCache.sizeCalculation, + // Create ~about~ a 30MiB cache by default. Configurable by providing + // `lruCacheOpts`. + maxSize: Math.pow(2, 20) * 30, + ...lruCacheOpts, + }); + } + + /** + * default size calculator for strings and serializable objects, else naively + * return 1 + */ + static sizeCalculation(item: V) { + if (typeof item === "string") { + return item.length; + } + if (typeof item === "object") { + // will throw if the object has circular references + return Buffer.byteLength(JSON.stringify(item), "utf8"); + } + return 1; + } + + async set(key: string, value: V, options?: SO) { + // If a TTL in seconds is provided, convert it to milliseconds. + // Otherwise, default it to 0 to indicate "no TTL". + const lruOptions = options + ? { ...options, ttl: options.ttl ? options.ttl * 1000 : 0 } + : undefined; + this.cache.set(key, value, lruOptions); + } + + async get(key: string) { + return this.cache.get(key); + } + + async delete(key: string) { + return this.cache.delete(key); + } + + clear() { + this.cache.clear(); + } + + keys() { + // LRUCache.keys() returns a generator (we just want an array) + return [...this.cache.keys()]; + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/KeyValueCache.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/KeyValueCache.ts new file mode 100644 index 00000000..335c58f0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/KeyValueCache.ts @@ -0,0 +1,16 @@ +export interface KeyValueCache< + V = string, + SO extends KeyValueCacheSetOptions = KeyValueCacheSetOptions, +> { + get(key: string): Promise; + set(key: string, value: V, options?: SO): Promise; + delete(key: string): Promise; +} + +export interface KeyValueCacheSetOptions { + /** + * Specified in **seconds**, the time-to-live (TTL) value limits the lifespan + * of the data being stored in the cache. + */ + ttl?: number | null; +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/PrefixingKeyValueCache.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/PrefixingKeyValueCache.ts new file mode 100644 index 00000000..21d564db --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/PrefixingKeyValueCache.ts @@ -0,0 +1,89 @@ +import type { KeyValueCache, KeyValueCacheSetOptions } from "."; + +const prefixesAreUnnecessaryForIsolationSymbol = Symbol( + "prefixesAreUnnecessaryForIsolation", +); + +// PrefixingKeyValueCache wraps another cache and adds a prefix to all keys used +// by all operations. This allows multiple features to share the same underlying +// cache without conflicts. +// +// Note that PrefixingKeyValueCache explicitly does not implement methods like +// flush() that aren't part of KeyValueCache, even though most KeyValueCache +// implementations also have a flush() method. Most implementations of flush() +// send a simple command that wipes the entire backend cache system, which +// wouldn't support "only wipe the part of the cache with this prefix", so +// trying to provide a flush() method here could be confusingly dangerous. +export class PrefixingKeyValueCache< + V = string, + SO extends KeyValueCacheSetOptions = KeyValueCacheSetOptions, +> implements KeyValueCache +{ + private prefix: string; + [prefixesAreUnnecessaryForIsolationSymbol]?: true; + + constructor( + private wrapped: KeyValueCache, + prefix: string, + ) { + if (PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(wrapped)) { + this.prefix = ""; + // If we try to again prefix this cache, we should still skip the + // prefixing. (This would be cleaner if we made PrefixingKeyValueCaches + // via a static method rather than the constructor and could just return + // `wrapped`...) + this[prefixesAreUnnecessaryForIsolationSymbol] = true; + } else { + this.prefix = prefix; + } + } + + get(key: string) { + return this.wrapped.get(this.prefix + key); + } + set(key: string, value: V, options?: SO) { + return this.wrapped.set(this.prefix + key, value, options); + } + delete(key: string) { + return this.wrapped.delete(this.prefix + key); + } + + // Checks to see if a cache is a PrefixesAreUnnecessaryForIsolationCache, + // without using instanceof (so that installing multiple copies of this + // package doesn't break things). + static prefixesAreUnnecessaryForIsolation< + V = string, + SO extends KeyValueCacheSetOptions = KeyValueCacheSetOptions, + >(c: KeyValueCache): boolean { + return prefixesAreUnnecessaryForIsolationSymbol in c; + } + + static cacheDangerouslyDoesNotNeedPrefixesForIsolation< + V = string, + SO extends KeyValueCacheSetOptions = KeyValueCacheSetOptions, + >(c: KeyValueCache): KeyValueCache { + return new PrefixesAreUnnecessaryForIsolationCache(c); + } +} + +// This class lets you opt a cache out of the prefixing provided by +// PrefixingKeyValueCache. See the README for details. +class PrefixesAreUnnecessaryForIsolationCache< + V = string, + SO extends KeyValueCacheSetOptions = KeyValueCacheSetOptions, +> implements KeyValueCache +{ + [prefixesAreUnnecessaryForIsolationSymbol] = true; + + constructor(private wrapped: KeyValueCache) {} + + get(key: string) { + return this.wrapped.get(key); + } + set(key: string, value: V, options?: SO) { + return this.wrapped.set(key, value, options); + } + delete(key: string) { + return this.wrapped.delete(key); + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/ErrorsAreMissesCache.test.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/ErrorsAreMissesCache.test.ts new file mode 100644 index 00000000..58ce2087 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/ErrorsAreMissesCache.test.ts @@ -0,0 +1,69 @@ +import type { Logger } from "@apollo/utils.logger"; +import { ErrorsAreMissesCache } from "../ErrorsAreMissesCache"; +import type { KeyValueCache, KeyValueCacheSetOptions } from "../KeyValueCache"; + +interface CustomKeyValueCacheSetOptions extends KeyValueCacheSetOptions { + noDisposeOnSet?: boolean; + noUpdateTTL?: boolean; +} + +describe("ErrorsAreMissesCache", () => { + const knownErrorMessage = "Service is down"; + const errorProneCache: KeyValueCache = { + async get() { + throw new Error(knownErrorMessage); + }, + async set() {}, + async delete() {}, + }; + + it("returns undefined when the underlying cache throws an error", async () => { + const errorsAreMisses = new ErrorsAreMissesCache(errorProneCache); + await expect(errorProneCache.get("foo")).rejects.toBeInstanceOf(Error); + await expect(errorsAreMisses.get("foo")).resolves.toBe(undefined); + }); + + it("logs to provided logger when underlying cache throws", async () => { + let loggedMessage = ""; + const logger: Logger = { + debug() {}, + info() {}, + warn() {}, + error: (message) => { + loggedMessage = message; + }, + }; + + const errorsAreMisses = new ErrorsAreMissesCache(errorProneCache, logger); + await expect(errorsAreMisses.get("foo")).resolves.toBe(undefined); + expect(loggedMessage).toBe(knownErrorMessage); + }); + + it("passes through calls to the underlying cache", async () => { + const mockCache: KeyValueCache = { + get: jest.fn(async () => "foo"), + set: jest.fn(), + delete: jest.fn(), + }; + + const errorsAreMisses = new ErrorsAreMissesCache(mockCache); + await expect(errorsAreMisses.get("key")).resolves.toBe("foo"); + expect(mockCache.get).toHaveBeenCalledWith("key"); + + await errorsAreMisses.set("key", "foo"); + expect(mockCache.set).toHaveBeenCalledWith("key", "foo", undefined); + await errorsAreMisses.set("keyWithOptions", "foo", { + ttl: 1000, + noDisposeOnSet: true, + noUpdateTTL: true, + }); + expect(mockCache.set).toHaveBeenLastCalledWith("keyWithOptions", "foo", { + ttl: 1000, + noDisposeOnSet: true, + noUpdateTTL: true, + }); + + await errorsAreMisses.delete("key"); + expect(mockCache.delete).toHaveBeenCalledWith("key"); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/InMemoryLRUCache.test.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/InMemoryLRUCache.test.ts new file mode 100644 index 00000000..796ba15a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/InMemoryLRUCache.test.ts @@ -0,0 +1,81 @@ +import type { LRUCache } from "lru-cache"; +import { InMemoryLRUCache } from ".."; + +interface CustomKeyValueCacheSetOptions + extends LRUCache.SetOptions> { + tags?: string[]; +} + +describe("InMemoryLRUCache", () => { + const cache = new InMemoryLRUCache(); + + it("can set and get", async () => { + await cache.set("hello", "world"); + + expect(await cache.get("hello")).toEqual("world"); + expect(await cache.get("missing")).toEqual(undefined); + }); + + it("can set and delete", async () => { + await cache.set("hello2", "world"); + expect(await cache.get("hello2")).toEqual("world"); + + await cache.delete("hello2"); + expect(await cache.get("hello2")).toEqual(undefined); + }); + + it("can expire keys based on ttl", async () => { + await cache.set("short", "s", { ttl: 0.01 }); + await cache.set("long", "l", { ttl: 0.05 }); + expect(await cache.get("short")).toEqual("s"); + expect(await cache.get("long")).toEqual("l"); + + await sleep(15); + expect(await cache.get("short")).toEqual(undefined); + expect(await cache.get("long")).toEqual("l"); + + await sleep(40); + expect(await cache.get("short")).toEqual(undefined); + expect(await cache.get("long")).toEqual(undefined); + }); + + it("does not expire when ttl is null", async () => { + await cache.set("forever", "yours", { ttl: null }); + expect(await cache.get("forever")).toEqual("yours"); + + await sleep(1000); + expect(await cache.get("forever")).toEqual("yours"); + }); + + it("with custom extended options", async () => { + const customCache = new InMemoryLRUCache< + string, + CustomKeyValueCacheSetOptions + >(); + const spyOnCacheSet = jest.spyOn((customCache as any).cache, "set"); + + await customCache.set("key", "foo"); + expect(spyOnCacheSet).toBeCalledWith("key", "foo", undefined); + + expect(await customCache.get("key")).toBe("foo"); + await customCache.delete("key"); + expect(await customCache.get("key")).toBe(undefined); + + await customCache.set("keyWithOptions", "bar", { + ttl: 1000, + tags: ["tag1", "tag2"], + }); + expect(spyOnCacheSet).toBeCalledWith("keyWithOptions", "bar", { + ttl: 1000000, + tags: ["tag1", "tag2"], + }); + + expect(await customCache.get("keyWithOptions")).toBe("bar"); + await customCache.delete("keyWithOptions"); + expect(await customCache.get("keyWithOptions")).toBe(undefined); + }); +}); + +async function sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/PrefixingKeyValueCache.test.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/PrefixingKeyValueCache.test.ts new file mode 100644 index 00000000..6856fc47 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/PrefixingKeyValueCache.test.ts @@ -0,0 +1,81 @@ +import { InMemoryLRUCache, type InMemoryLRUCacheSetOptions } from ".."; +import { PrefixingKeyValueCache } from "../PrefixingKeyValueCache"; + +interface CustomKeyValueCacheSetOptions extends InMemoryLRUCacheSetOptions { + tags?: string[]; +} + +describe("PrefixingKeyValueCache", () => { + it("prefixes", async () => { + const inner = new InMemoryLRUCache(); + const prefixing = new PrefixingKeyValueCache(inner, "prefix:"); + await prefixing.set("foo", "bar"); + expect(await prefixing.get("foo")).toBe("bar"); + expect(await inner.get("prefix:foo")).toBe("bar"); + await prefixing.delete("foo"); + expect(await prefixing.get("foo")).toBe(undefined); + }); + + it("PrefixesAreUnnecessaryForIsolationCache", async () => { + const inner = new InMemoryLRUCache(); + const prefixesAreUnnecessaryForIsolationCache = + PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation( + inner, + ); + const prefixing = new PrefixingKeyValueCache( + prefixesAreUnnecessaryForIsolationCache, + "prefix:", + ); + + for (const cache of [prefixesAreUnnecessaryForIsolationCache, prefixing]) { + await cache.set("x", "a"); + expect(await cache.get("x")).toBe("a"); + expect(inner.keys().length).toBe(1); + // The prefix is not applied! + expect(await inner.get("x")).toBe("a"); + await cache.delete("x"); + expect(await cache.get("x")).toBe(undefined); + expect(inner.keys().length).toBe(0); + } + + expect( + PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(inner), + ).toBe(false); + expect( + PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation( + prefixesAreUnnecessaryForIsolationCache, + ), + ).toBe(true); + expect( + PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(prefixing), + ).toBe(true); + }); + + it("prefixes with custom extended options", async () => { + const inner = new InMemoryLRUCache(); + const spyOnCacheSet = jest.spyOn(inner, "set"); + const prefixing = new PrefixingKeyValueCache(inner, "prefix:"); + + await prefixing.set("key", "foo"); + expect(spyOnCacheSet).toBeCalledWith("prefix:key", "foo", undefined); + + expect(await prefixing.get("key")).toBe("foo"); + expect(await inner.get("prefix:key")).toBe("foo"); + await prefixing.delete("key"); + expect(await prefixing.get("key")).toBe(undefined); + + await prefixing.set("keyWithOptions", "bar", { + ttl: 1000, + tags: ["tag1", "tag2"], + }); + expect(spyOnCacheSet).toBeCalledWith("prefix:keyWithOptions", "bar", { + ttl: 1000, + tags: ["tag1", "tag2"], + }); + + expect(await prefixing.get("keyWithOptions")).toBe("bar"); + expect(await inner.get("prefix:keyWithOptions")).toBe("bar"); + await prefixing.delete("keyWithOptions"); + expect(await prefixing.get("keyWithOptions")).toBe(undefined); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/keyValueCache.test.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/keyValueCache.test.ts new file mode 100644 index 00000000..932f8f59 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/keyValueCache.test.ts @@ -0,0 +1,101 @@ +import { expectType } from "ts-expect"; +import type { KeyValueCache } from ".."; + +describe("KeyValueCache", () => { + const minimalCompatibleCache = { + get: async (_key: string) => undefined, + set: async (_key: string, _value: string, _options?: { ttl?: number }) => + undefined, + delete: async (_key: string) => undefined, + }; + + it("minimum implementation type-checks", () => { + expectType>(minimalCompatibleCache); + }); + + describe("type-check failures", () => { + it("get", () => { + const { get, ...cacheNoGet } = minimalCompatibleCache; + + // @ts-expect-error + expectType>(cacheNoGet); + + { + const cacheBadGet = { + ...minimalCompatibleCache, + // no async + get: (_key: string) => undefined, + }; + + // @ts-expect-error + expectType>(cacheBadGet); + } + { + const cacheBadGet = { + ...minimalCompatibleCache, + // incompatible type + get: async (_key: number) => undefined, + }; + + // @ts-expect-error + expectType>(cacheBadGet); + } + }); + + it("set", () => { + const { set, ...cacheNoSet } = minimalCompatibleCache; + + // @ts-expect-error + expectType>(cacheNoSet); + + { + const cacheBadSet = { + ...minimalCompatibleCache, + // no async + set: (_key: string) => undefined, + }; + + // @ts-expect-error + expectType>(cacheBadSet); + } + { + const cacheBadSet = { + ...minimalCompatibleCache, + // incompatible type + set: async (_key: number) => undefined, + }; + + // @ts-expect-error + expectType>(cacheBadSet); + } + }); + + it("delete", () => { + const { delete: _delete, ...cacheNoDelete } = minimalCompatibleCache; + + // @ts-expect-error + expectType>(cacheNoDelete); + + { + const cacheBadDelete = { + ...minimalCompatibleCache, + // no async + delete: (_key: string) => undefined, + }; + + // @ts-expect-error + expectType>(cacheBadDelete); + } + { + const cacheBadDelete = { + ...minimalCompatibleCache, + // incompatible type + delete: async (_key: number) => undefined, + }; + + // @ts-expect-error + expectType>(cacheBadDelete); + } + }); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/tsconfig.json new file mode 100644 index 00000000..37795c69 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [ + { + "path": "../../" + }, + { + "path": "../../../logger" + } + ] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/index.ts new file mode 100644 index 00000000..5e48e4bf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache/src/index.ts @@ -0,0 +1,7 @@ +export type { KeyValueCache, KeyValueCacheSetOptions } from "./KeyValueCache"; +export { PrefixingKeyValueCache } from "./PrefixingKeyValueCache"; +export { + InMemoryLRUCache, + type InMemoryLRUCacheSetOptions, +} from "./InMemoryLRUCache"; +export { ErrorsAreMissesCache } from "./ErrorsAreMissesCache"; diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.logger b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.logger new file mode 120000 index 00000000..64f1e450 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.logger @@ -0,0 +1 @@ +../../../@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/lru-cache b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/lru-cache new file mode 120000 index 00000000..a34ff6f6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.keyvaluecache@4.0.0/node_modules/lru-cache @@ -0,0 +1 @@ +../../lru-cache@11.5.3/node_modules/lru-cache \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/README.md b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/README.md new file mode 100644 index 00000000..e7bdfc97 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/README.md @@ -0,0 +1,36 @@ +# Logger interface + +> ``` +> interface Logger { +> debug(message?: any): void; +> info(message?: any): void; +> warn(message?: any): void; +> error(message?: any): void; +> } +> ``` + +This generic interface for loggers supports logging a string at one of four different levels (`debug`, `info`, `warn`, `error`). It's designed to be compatible with Node's `console` as well as commonly used logging packages and is tested against a few of them. Below are the logging libraries we test for compatibility against. + +## bunyan + +``` +const logger = bunyan.createLogger(); +``` + +## log4js + +``` +const logger = log4js.getLogger(); +``` + +## loglevel + +``` +const logger = loglevel.getLogger(); +``` + +## winston + +``` +const logger = winston.createLogger(); +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts new file mode 100644 index 00000000..74b142d6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts @@ -0,0 +1,7 @@ +export interface Logger { + debug(message?: any): void; + info(message?: any): void; + warn(message?: any): void; + error(message?: any): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts.map new file mode 100644 index 00000000..339dd277 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;CAC5B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js new file mode 100644 index 00000000..aa219d8f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js.map new file mode 100644 index 00000000..1ed2df62 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/package.json b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/package.json new file mode 100644 index 00000000..5079aff3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/package.json @@ -0,0 +1,23 @@ +{ + "name": "@apollo/utils.logger", + "version": "3.0.0", + "description": "Generic logger interface", + "main": "", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/logger/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=16" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/index.test.ts b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/index.test.ts new file mode 100644 index 00000000..6361168a --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/index.test.ts @@ -0,0 +1,179 @@ +import { PassThrough } from "stream"; +import * as winston from "winston"; +import WinstonTransport from "winston-transport"; +import * as bunyan from "bunyan"; +import * as loglevel from "loglevel"; +import * as log4js from "log4js"; +import type { Logger } from ".."; + +const LOWEST_LOG_LEVEL = "debug"; +const KNOWN_DEBUG_MESSAGE = "This is a debug message"; + +describe("Logger interface compatibility", () => { + it("with console", () => { + const sink = jest.spyOn(console, "debug"); + + // type checks Logger interface compatibility + const logger: Logger = console; + + logger.debug(KNOWN_DEBUG_MESSAGE); + + expect(sink).toHaveBeenCalledWith(KNOWN_DEBUG_MESSAGE); + }); + + it("with loglevel", () => { + const sink = jest.fn(); + const logLevelLogger = loglevel.getLogger("test-logger-loglevel"); + + logLevelLogger.methodFactory = + (_methodName, level): loglevel.LoggingMethod => + (message) => + sink({ level, message }); + + // The `setLevel` method must be called after overwriting `methodFactory`. + // This is an intentional API design pattern of the loglevel package: + // https://www.npmjs.com/package/loglevel#writing-plugins + logLevelLogger.setLevel(loglevel.levels.DEBUG); + + // type checks Logger interface compatibility + const logger: Logger = logLevelLogger; + + logger.debug(KNOWN_DEBUG_MESSAGE); + + expect(sink).toHaveBeenCalledWith({ + level: loglevel.levels.DEBUG, + message: KNOWN_DEBUG_MESSAGE, + }); + }); + + it("with log4js", () => { + const sink = jest.fn(); + + log4js.configure({ + appenders: { + custom: { + type: { + configure: () => (loggingEvent: log4js.LoggingEvent) => + sink(loggingEvent), + }, + }, + }, + categories: { + default: { + appenders: ["custom"], + level: LOWEST_LOG_LEVEL, + }, + }, + }); + + const log4jsLogger = log4js.getLogger(); + log4jsLogger.level = LOWEST_LOG_LEVEL; + + // type checks Logger interface compatibility + const logger: Logger = log4jsLogger; + + logger.debug(KNOWN_DEBUG_MESSAGE); + + expect(sink).toHaveBeenCalledWith( + expect.objectContaining({ + level: log4js.levels.DEBUG, + data: [KNOWN_DEBUG_MESSAGE], + }), + ); + }); + + it("with bunyan", () => { + const sink = jest.fn(); + + // Bunyan uses streams for its logging implementations. + const writable = new PassThrough(); + writable.on("data", (data) => sink(JSON.parse(data.toString()))); + + const bunyanLogger = bunyan.createLogger({ + name: "test-logger-bunyan", + streams: [ + { + level: LOWEST_LOG_LEVEL, + stream: writable, + }, + ], + }); + + // type checks Logger interface compatibility + const logger: Logger = bunyanLogger; + + logger.debug(KNOWN_DEBUG_MESSAGE); + + expect(sink).toHaveBeenCalledWith( + expect.objectContaining({ + level: bunyan.DEBUG, + msg: KNOWN_DEBUG_MESSAGE, + }), + ); + }); + + it("with winston", () => { + const sink = jest.fn(); + const transport = new (class extends WinstonTransport { + constructor() { + super({ + format: winston.format.json(), + }); + } + + override log(info: any) { + sink(info); + } + })(); + + const winstonLogger = winston + .createLogger({ level: "debug" }) + .add(transport); + + // type checks Logger interface compatibility + const logger: Logger = winstonLogger; + + logger.debug(KNOWN_DEBUG_MESSAGE); + + expect(sink).toHaveBeenCalledWith( + expect.objectContaining({ + level: LOWEST_LOG_LEVEL, + message: KNOWN_DEBUG_MESSAGE, + }), + ); + }); +}); + +describe("Logger interface incompatibility", () => { + it("missing methods", () => { + // @ts-ignore - logger unused + let logger: Logger; + // @ts-expect-error + logger = { + info: jest.fn(), + warn: jest.fn(), + error: jest.fn(), + }; + + // @ts-expect-error + logger = { + debug: jest.fn(), + warn: jest.fn(), + error: jest.fn(), + }; + + // @ts-expect-error + logger = { + debug: jest.fn(), + info: jest.fn(), + error: jest.fn(), + }; + + // @ts-expect-error + logger = { + debug: jest.fn(), + info: jest.fn(), + warn: jest.fn(), + }; + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/tsconfig.json new file mode 100644 index 00000000..40c0056f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/__tests__/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [{ "path": "../../" }] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/index.ts new file mode 100644 index 00000000..e7d7ab15 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger/src/index.ts @@ -0,0 +1,6 @@ +export interface Logger { + debug(message?: any): void; + info(message?: any): void; + warn(message?: any): void; + error(message?: any): void; +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/README.md b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/README.md new file mode 100644 index 00000000..d84ba175 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/README.md @@ -0,0 +1,20 @@ +# printWithReducedWhitespace + +Prints a GraphQL AST with a minimal amount of whitespace. Consider using the +[`stripIgnoredCharacters`](https://github.com/graphql/graphql-js/blob/e9a81f2ba9020ec5fd0f67f5553ccabe392e95e8/src/utilities/stripIgnoredCharacters.ts) function from `graphql` instead of this function. + +## Usage + +```ts +import { printWithReducedWhitespace } from "@apollo/utils.operationregistrysignature"; + +const signature = operationRegistrySignature( + parse(`#graphql + query Foo { + bar + } + `), + "Foo", + { preserveStringAndNumericLiterals: true }, +); +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts new file mode 100644 index 00000000..4a0a72c2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts @@ -0,0 +1,3 @@ +import { type DocumentNode } from "graphql"; +export declare function printWithReducedWhitespace(ast: DocumentNode): string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts.map new file mode 100644 index 00000000..15b51080 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAwB,MAAM,SAAS,CAAC;AAKhF,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CA2BpE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js new file mode 100644 index 00000000..5f4ae2b1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.printWithReducedWhitespace = void 0; +const graphql_1 = require("graphql"); +function printWithReducedWhitespace(ast) { + const sanitizedAST = (0, graphql_1.visit)(ast, { + StringValue(node) { + return { + ...node, + value: Buffer.from(node.value, "utf8").toString("hex"), + block: false, + }; + }, + }); + const withWhitespace = (0, graphql_1.print)(sanitizedAST); + const minimizedButStillHex = withWhitespace + .replace(/\s+/g, " ") + .replace(/([^_a-zA-Z0-9]) /g, (_, c) => c) + .replace(/ ([^_a-zA-Z0-9])/g, (_, c) => c); + return minimizedButStillHex.replace(/"([a-f0-9]+)"/g, (_, hex) => JSON.stringify(Buffer.from(hex, "hex").toString("utf8"))); +} +exports.printWithReducedWhitespace = printWithReducedWhitespace; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js.map new file mode 100644 index 00000000..b1cf5cfc --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAgF;AAKhF,SAAgB,0BAA0B,CAAC,GAAiB;IAU1D,MAAM,YAAY,GAAG,IAAA,eAAK,EAAC,GAAG,EAAE;QAC9B,WAAW,CAAC,IAAqB;YAC/B,OAAO;gBACL,GAAG,IAAI;gBACP,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;gBACtD,KAAK,EAAE,KAAK;aACb,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,IAAA,eAAK,EAAC,YAAY,CAAC,CAAC;IAC3C,MAAM,oBAAoB,GAAG,cAAc;SACxC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SACzC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,oBAAoB,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAC/D,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CACzD,CAAC;AACJ,CAAC;AA3BD,gEA2BC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/package.json b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/package.json new file mode 100644 index 00000000..6405e54e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/package.json @@ -0,0 +1,26 @@ +{ + "name": "@apollo/utils.printwithreducedwhitespace", + "version": "2.0.1", + "description": "Print an AST with as little whitespace as possible", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/printWithReducedWhitespace/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/printWithReducedWhitespace.test.ts b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/printWithReducedWhitespace.test.ts new file mode 100644 index 00000000..8dbafde3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/printWithReducedWhitespace.test.ts @@ -0,0 +1,28 @@ +import gql from "graphql-tag"; +import { printWithReducedWhitespace } from ".."; + +describe("printWithReducedWhitespace", () => { + it("removes whitespace", () => { + // Note: there's a tab after "tab->", which prettier wants to keep as a + // literal tab rather than \t. In the output, there should be a literal + // backslash-t. + const document = gql` + query Foo($a: Int) { + user( + name: " tab-> yay" + other: """ + apple + bag + cat + """ + ) { + name + } + } + `; + + expect(printWithReducedWhitespace(document)).toBe( + `query Foo($a:Int){user(name:" tab->\\tyay"other:"apple\\n bag\\ncat"){name}}`, + ); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/tsconfig.json new file mode 100644 index 00000000..40c0056f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/__tests__/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [{ "path": "../../" }] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/index.ts new file mode 100644 index 00000000..afbcd7e3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace/src/index.ts @@ -0,0 +1,33 @@ +import { visit, print, type DocumentNode, type StringValueNode } from "graphql"; +// Like the graphql-js print function, but deleting whitespace wherever +// feasible. Specifically, all whitespace (outside of string literals) is +// reduced to at most one space, and even that space is removed anywhere except +// for between two alphanumerics. +export function printWithReducedWhitespace(ast: DocumentNode): string { + // In a GraphQL AST (which notably does not contain comments), the only place + // where meaningful whitespace (or double quotes) can exist is in + // StringNodes. So to print with reduced whitespace, we: + // - temporarily sanitize strings by replacing their contents with hex + // - use the default GraphQL printer + // - minimize the whitespace with a simple regexp replacement + // - convert strings back to their actual value + // We normalize all strings to non-block strings for simplicity. + + const sanitizedAST = visit(ast, { + StringValue(node: StringValueNode): StringValueNode { + return { + ...node, + value: Buffer.from(node.value, "utf8").toString("hex"), + block: false, + }; + }, + }); + const withWhitespace = print(sanitizedAST); + const minimizedButStillHex = withWhitespace + .replace(/\s+/g, " ") + .replace(/([^_a-zA-Z0-9]) /g, (_, c) => c) + .replace(/ ([^_a-zA-Z0-9])/g, (_, c) => c); + return minimizedButStillHex.replace(/"([a-f0-9]+)"/g, (_, hex) => + JSON.stringify(Buffer.from(hex, "hex").toString("utf8")), + ); +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/README.md b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/README.md new file mode 100644 index 00000000..67e5fbde --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/README.md @@ -0,0 +1,12 @@ +# removeAliases + +The `removeAliases` function is a `graphql-js` visitor which removes aliases from all `Field` nodes. Note that this function makes no guarantees about the output being a valid GraphQL operation. + +For example, the following operation is no longer valid once the alias is removed since the fields can't be merged: + +```graphql +query { + x(a: 1) + alias: x(a: 2) +} +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts new file mode 100644 index 00000000..51aa91c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts @@ -0,0 +1,3 @@ +import { type DocumentNode } from "graphql"; +export declare function removeAliases(ast: DocumentNode): DocumentNode; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts.map new file mode 100644 index 00000000..0b30d9c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAyB,MAAM,SAAS,CAAC;AAEnE,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAO7D"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js new file mode 100644 index 00000000..5d9b6f5b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.removeAliases = void 0; +const graphql_1 = require("graphql"); +function removeAliases(ast) { + return (0, graphql_1.visit)(ast, { + Field(node) { + const { alias, ...rest } = node; + return rest; + }, + }); +} +exports.removeAliases = removeAliases; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js.map new file mode 100644 index 00000000..85789b93 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAOA,qCAAmE;AAEnE,SAAgB,aAAa,CAAC,GAAiB;IAC7C,OAAO,IAAA,eAAK,EAAC,GAAG,EAAE;QAChB,KAAK,CAAC,IAAe;YACnB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAPD,sCAOC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/package.json b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/package.json new file mode 100644 index 00000000..d8e017b8 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/package.json @@ -0,0 +1,26 @@ +{ + "name": "@apollo/utils.removealiases", + "version": "2.0.1", + "description": "Remove aliases from a GraphQL document", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/removeAliases/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/removeAliases.test.ts b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/removeAliases.test.ts new file mode 100644 index 00000000..cdf4a684 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/removeAliases.test.ts @@ -0,0 +1,39 @@ +import gql from "graphql-tag"; +import { removeAliases } from ".."; + +import graphQLASTSerializer from "@apollo/utils.jest-graphql-ast-serializer"; +expect.addSnapshotSerializer(graphQLASTSerializer); + +describe("removeAliases", () => { + it("removes aliases from Field nodes", () => { + expect( + removeAliases(gql` + query MyQuery { + alias: field + field + fieldWithSelections { + selection1 + selection2 + } + aliasedSelections: fieldWithSelections { + selection1 + selection2 + } + } + `), + ).toMatchInlineSnapshot(` + query MyQuery { + field + field + fieldWithSelections { + selection1 + selection2 + } + fieldWithSelections { + selection1 + selection2 + } + } + `); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/tsconfig.json new file mode 100644 index 00000000..c559516d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [ + { + "path": "../../" + }, + { + "path": "../../../jestGraphQLASTSerializer" + } + ] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/index.ts new file mode 100644 index 00000000..a230c267 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases/src/index.ts @@ -0,0 +1,17 @@ +// removeAliases gets rid of GraphQL aliases, a feature by which you can tell a +// server to return a field's data under a different name from the field name. +// Maybe this is useful if somebody somewhere inserts random aliases into their +// queries. Note that this function makes no guarantees about the output and its +// validity as a GraphQL operation, for example: +// { x(a: 1) alias: x(a:2) } (valid) will yield +// { x(a:1) x(a:2) } (invalid) +import { type DocumentNode, type FieldNode, visit } from "graphql"; + +export function removeAliases(ast: DocumentNode): DocumentNode { + return visit(ast, { + Field(node: FieldNode): FieldNode { + const { alias, ...rest } = node; + return rest; + }, + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/README.md b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/README.md new file mode 100644 index 00000000..ffbfb6d7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/README.md @@ -0,0 +1,18 @@ +# sortAST + +The `sortAST` function is used to alphabetically sort all of the nodes in a graphql `DocumentNode`. + +## Usage + +```ts +import { sortAST } from "@apollo/utils.sortast"; + +const sortedAST = sortAST( + parse(`#graphql + query Foo { c b a } +`), +); + +print(sortedAST); +// query Foo { a b c } +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts new file mode 100644 index 00000000..444649a2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts @@ -0,0 +1,3 @@ +import { type DocumentNode } from "graphql"; +export declare function sortAST(ast: DocumentNode): DocumentNode; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts.map new file mode 100644 index 00000000..340f6b9d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,YAAY,EAUlB,MAAM,SAAS,CAAC;AAQjB,wBAAgB,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAwCvD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js new file mode 100644 index 00000000..d81598b6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js @@ -0,0 +1,62 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sortAST = void 0; +const graphql_1 = require("graphql"); +const lodash_sortby_1 = __importDefault(require("lodash.sortby")); +function sortAST(ast) { + return (0, graphql_1.visit)(ast, { + Document(node) { + return { + ...node, + definitions: (0, lodash_sortby_1.default)(node.definitions, "kind", "name.value"), + }; + }, + OperationDefinition(node) { + return sortVariableDefinitions(node); + }, + SelectionSet(node) { + return { + ...node, + selections: (0, lodash_sortby_1.default)(node.selections, "kind", "name.value"), + }; + }, + Field(node) { + return sortArguments(node); + }, + FragmentSpread(node) { + return sortDirectives(node); + }, + InlineFragment(node) { + return sortDirectives(node); + }, + FragmentDefinition(node) { + return sortDirectives(sortVariableDefinitions(node)); + }, + Directive(node) { + return sortArguments(node); + }, + }); +} +exports.sortAST = sortAST; +function sortDirectives(node) { + return "directives" in node + ? { ...node, directives: (0, lodash_sortby_1.default)(node.directives, "name.value") } + : node; +} +function sortArguments(node) { + return "arguments" in node + ? { ...node, arguments: (0, lodash_sortby_1.default)(node.arguments, "name.value") } + : node; +} +function sortVariableDefinitions(node) { + return "variableDefinitions" in node + ? { + ...node, + variableDefinitions: (0, lodash_sortby_1.default)(node.variableDefinitions, "variable.name.value"), + } + : node; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js.map new file mode 100644 index 00000000..be90ef9b --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAGA,qCAYiB;AACjB,kEAAmC;AAOnC,SAAgB,OAAO,CAAC,GAAiB;IACvC,OAAO,IAAA,eAAK,EAAC,GAAG,EAAE;QAChB,QAAQ,CAAC,IAAkB;YACzB,OAAO;gBACL,GAAG,IAAI;gBAEP,WAAW,EAAE,IAAA,uBAAM,EAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC;aAC5D,CAAC;QACJ,CAAC;QACD,mBAAmB,CACjB,IAA6B;YAE7B,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QACD,YAAY,CAAC,IAAI;YACf,OAAO;gBACL,GAAG,IAAI;gBAKP,UAAU,EAAE,IAAA,uBAAM,EAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC;aAC1D,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI;YACR,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QACD,kBAAkB,CAAC,IAAI;YACrB,OAAO,cAAc,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,SAAS,CAAC,IAAI;YACZ,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAxCD,0BAwCC;AAED,SAAS,cAAc,CACrB,IAAO;IAEP,OAAO,YAAY,IAAI,IAAI;QACzB,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,IAAA,uBAAM,EAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE;QAChE,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CACpB,IAAO;IAEP,OAAO,WAAW,IAAI,IAAI;QACxB,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,IAAA,uBAAM,EAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE;QAC9D,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,uBAAuB,CAE9B,IAAO;IACP,OAAO,qBAAqB,IAAI,IAAI;QAClC,CAAC,CAAC;YACE,GAAG,IAAI;YACP,mBAAmB,EAAE,IAAA,uBAAM,EACzB,IAAI,CAAC,mBAAmB,EACxB,qBAAqB,CACtB;SACF;QACH,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/package.json b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/package.json new file mode 100644 index 00000000..fcb5e7f0 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/package.json @@ -0,0 +1,29 @@ +{ + "name": "@apollo/utils.sortast", + "version": "2.0.1", + "description": "Sort AST nodes in a document alphabetically", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/sortAst/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "dependencies": { + "lodash.sortby": "^4.7.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/src/index.ts new file mode 100644 index 00000000..debb3f7e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast/src/index.ts @@ -0,0 +1,94 @@ +// We'll only fetch the `ListIteratee` type from the `@types/lodash`, but get +// `sortBy` from the modularized version of the package to avoid bringing in +// all of `lodash`. +import { + visit, + type DocumentNode, + type OperationDefinitionNode, + type DirectiveNode, + type FragmentDefinitionNode, + type InlineFragmentNode, + type FragmentSpreadNode, + type FieldNode, + type SelectionSetNode, + type ArgumentNode, + type VariableDefinitionNode, +} from "graphql"; +import sortBy from "lodash.sortby"; + +// sortAST sorts most multi-child nodes alphabetically. Using this as part of +// your signature calculation function may make it easier to tell the difference +// between queries that are similar to each other, and if for some reason your +// GraphQL client generates query strings with elements in nondeterministic +// order, it can make sure the queries are treated as identical. +export function sortAST(ast: DocumentNode): DocumentNode { + return visit(ast, { + Document(node: DocumentNode) { + return { + ...node, + // The sort on "kind" places fragments before operations within the document + definitions: sortBy(node.definitions, "kind", "name.value"), + }; + }, + OperationDefinition( + node: OperationDefinitionNode, + ): OperationDefinitionNode { + return sortVariableDefinitions(node); + }, + SelectionSet(node): SelectionSetNode { + return { + ...node, + // Define an ordering for field names in a SelectionSet. Field first, + // then FragmentSpread, then InlineFragment. By a lovely coincidence, + // the order we want them to appear in is alphabetical by node.kind. + // Use sortBy instead of sorted because 'selections' is not optional. + selections: sortBy(node.selections, "kind", "name.value"), + }; + }, + Field(node): FieldNode { + return sortArguments(node); + }, + FragmentSpread(node): FragmentSpreadNode { + return sortDirectives(node); + }, + InlineFragment(node): InlineFragmentNode { + return sortDirectives(node); + }, + FragmentDefinition(node): FragmentDefinitionNode { + return sortDirectives(sortVariableDefinitions(node)); + }, + Directive(node): DirectiveNode { + return sortArguments(node); + }, + }); +} + +function sortDirectives( + node: T, +): T { + return "directives" in node + ? { ...node, directives: sortBy(node.directives, "name.value") } + : node; +} + +function sortArguments( + node: T, +): T { + return "arguments" in node + ? { ...node, arguments: sortBy(node.arguments, "name.value") } + : node; +} + +function sortVariableDefinitions< + T extends { variableDefinitions?: readonly VariableDefinitionNode[] }, +>(node: T): T { + return "variableDefinitions" in node + ? { + ...node, + variableDefinitions: sortBy( + node.variableDefinitions, + "variable.name.value", + ), + } + : node; +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/lodash.sortby b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/lodash.sortby new file mode 120000 index 00000000..a5a954b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/lodash.sortby @@ -0,0 +1 @@ +../../lodash.sortby@4.7.0/node_modules/lodash.sortby \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/README.md b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/README.md new file mode 100644 index 00000000..1e9135d2 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/README.md @@ -0,0 +1,24 @@ +# stripSensitiveLiterals + +The `stripSensitiveLiterals` function is used to remove string and numeric +literals from a graphql `DocumentNode` which could be sensitive. Consider using +variables instead! + +## Usage + +```ts +import { stripSensitiveLiterals } from "@apollo/utils.stripsensitiveliterals"; + +stripSensitiveLiterals( + parse(`#graphql + query User { + user(name: "Ada Lovelace", age: 31, ids: ["1", "2", "3"]) + } +`), +); +/** + query User { + user(name: "", age: 0, ids: ["", "", ""]) + } +*/ +``` diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts new file mode 100644 index 00000000..cb33fcb7 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts @@ -0,0 +1,5 @@ +import type { DocumentNode } from "graphql"; +export declare function stripSensitiveLiterals(ast: DocumentNode, options?: { + hideListAndObjectLiterals?: boolean; +}): DocumentNode; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts.map new file mode 100644 index 00000000..2480e0d1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EAMb,MAAM,SAAS,CAAC;AAIjB,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,YAAY,EACjB,OAAO,GAAE;IAAE,yBAAyB,CAAC,EAAE,OAAO,CAAA;CAE7C,GACA,YAAY,CAyBd"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js new file mode 100644 index 00000000..9eab39b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stripSensitiveLiterals = void 0; +const graphql_1 = require("graphql"); +function stripSensitiveLiterals(ast, options = { + hideListAndObjectLiterals: false, +}) { + const listAndObjectVisitorIfEnabled = options.hideListAndObjectLiterals + ? { + ListValue(node) { + return { ...node, values: [] }; + }, + ObjectValue(node) { + return { ...node, fields: [] }; + }, + } + : {}; + return (0, graphql_1.visit)(ast, { + IntValue(node) { + return { ...node, value: "0" }; + }, + FloatValue(node) { + return { ...node, value: "0" }; + }, + StringValue(node) { + return { ...node, value: "", block: false }; + }, + ...listAndObjectVisitorIfEnabled, + }); +} +exports.stripSensitiveLiterals = stripSensitiveLiterals; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js.map new file mode 100644 index 00000000..841b0386 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AASA,qCAAgC;AAGhC,SAAgB,sBAAsB,CACpC,GAAiB,EACjB,UAAmD;IACjD,yBAAyB,EAAE,KAAK;CACjC;IAED,MAAM,6BAA6B,GACjC,OAAO,CAAC,yBAAyB;QAC/B,CAAC,CAAC;YACE,SAAS,CAAC,IAAmB;gBAC3B,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;YACjC,CAAC;YACD,WAAW,CAAC,IAAqB;gBAC/B,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;YACjC,CAAC;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IAET,OAAO,IAAA,eAAK,EAAC,GAAG,EAAE;QAChB,QAAQ,CAAC,IAAI;YACX,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACjC,CAAC;QACD,UAAU,CAAC,IAAI;YACb,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACjC,CAAC;QACD,WAAW,CAAC,IAAI;YACd,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC9C,CAAC;QACD,GAAG,6BAA6B;KACjC,CAAC,CAAC;AACL,CAAC;AA9BD,wDA8BC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/package.json b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/package.json new file mode 100644 index 00000000..dc729c38 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/package.json @@ -0,0 +1,26 @@ +{ + "name": "@apollo/utils.stripsensitiveliterals", + "version": "2.0.1", + "description": "Remove literals from an AST which might contain PII (strings and numbers, and optionally lists and objects)", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/stripSensitiveLiterals/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/stripSensitiveLiterals.test.ts b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/stripSensitiveLiterals.test.ts new file mode 100644 index 00000000..bce5e418 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/stripSensitiveLiterals.test.ts @@ -0,0 +1,152 @@ +import gql from "graphql-tag"; +import { stripSensitiveLiterals } from ".."; + +import graphQLASTSerializer from "@apollo/utils.jest-graphql-ast-serializer"; + +expect.addSnapshotSerializer(graphQLASTSerializer); + +const document = gql` + query Foo($b: Int, $a: Boolean) { + user( + name: "hello" + age: 5 + pct: 0.4 + lst: ["a", "b", "c"] + obj: { a: "a", b: 1 } + ) { + ...Bar + ... on User { + hello + bee + } + tz + aliased: name + withInputs( + str: "hi" + int: 2 + flt: 0.3 + lst: ["", "", ""] + obj: { q: "", s: 0 } + ) + } + } + + fragment Bar on User { + age @skip(if: $a) + ...Nested + } + + fragment Nested on User { + blah + } +`; + +describe("stripSensitiveLiterals", () => { + it("strips only numeric and string literals with default configuration", () => { + expect(stripSensitiveLiterals(document)).toMatchInlineSnapshot(` + query Foo($b: Int, $a: Boolean) { + user(name: "", age: 0, pct: 0, lst: ["", "", ""], obj: {a: "", b: 0}) { + ...Bar + ... on User { + hello + bee + } + tz + aliased: name + withInputs(str: "", int: 0, flt: 0, lst: ["", "", ""], obj: {q: "", s: 0}) + } + } + + fragment Bar on User { + age @skip(if: $a) + ...Nested + } + + fragment Nested on User { + blah + } + `); + }); + + it("strips only numeric and string literals with empty (but defined) configuration", () => { + expect(stripSensitiveLiterals(document, {})).toMatchInlineSnapshot(` + query Foo($b: Int, $a: Boolean) { + user(name: "", age: 0, pct: 0, lst: ["", "", ""], obj: {a: "", b: 0}) { + ...Bar + ... on User { + hello + bee + } + tz + aliased: name + withInputs(str: "", int: 0, flt: 0, lst: ["", "", ""], obj: {q: "", s: 0}) + } + } + + fragment Bar on User { + age @skip(if: $a) + ...Nested + } + + fragment Nested on User { + blah + } + `); + }); + + it("strips only numeric and string literals with hideListAndObjectLiterals: false", () => { + expect( + stripSensitiveLiterals(document, { hideListAndObjectLiterals: false }), + ).toMatchInlineSnapshot(` + query Foo($b: Int, $a: Boolean) { + user(name: "", age: 0, pct: 0, lst: ["", "", ""], obj: {a: "", b: 0}) { + ...Bar + ... on User { + hello + bee + } + tz + aliased: name + withInputs(str: "", int: 0, flt: 0, lst: ["", "", ""], obj: {q: "", s: 0}) + } + } + + fragment Bar on User { + age @skip(if: $a) + ...Nested + } + + fragment Nested on User { + blah + } + `); + }); + + it("strips all literals with hideListAndObjectLiterals: true", () => { + expect( + stripSensitiveLiterals(document, { hideListAndObjectLiterals: true }), + ).toMatchInlineSnapshot(` + query Foo($b: Int, $a: Boolean) { + user(name: "", age: 0, pct: 0, lst: [], obj: {}) { + ...Bar + ... on User { + hello + bee + } + tz + aliased: name + withInputs(str: "", int: 0, flt: 0, lst: [], obj: {}) + } + } + + fragment Bar on User { + age @skip(if: $a) + ...Nested + } + + fragment Nested on User { + blah + } + `); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/tsconfig.json new file mode 100644 index 00000000..c559516d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/__tests__/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [ + { + "path": "../../" + }, + { + "path": "../../../jestGraphQLASTSerializer" + } + ] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/index.ts new file mode 100644 index 00000000..cf05b606 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals/src/index.ts @@ -0,0 +1,43 @@ +import type { + ASTVisitor, + DocumentNode, + FloatValueNode, + IntValueNode, + ListValueNode, + ObjectValueNode, + StringValueNode, +} from "graphql"; +import { visit } from "graphql"; + +// Hide sensitive string and numeric literals. Optionally hide list and object literals with the option `hideListAndObjectLiterals: true`. +export function stripSensitiveLiterals( + ast: DocumentNode, + options: { hideListAndObjectLiterals?: boolean } = { + hideListAndObjectLiterals: false, + }, +): DocumentNode { + const listAndObjectVisitorIfEnabled: ASTVisitor = + options.hideListAndObjectLiterals + ? { + ListValue(node: ListValueNode): ListValueNode { + return { ...node, values: [] }; + }, + ObjectValue(node: ObjectValueNode): ObjectValueNode { + return { ...node, fields: [] }; + }, + } + : {}; + + return visit(ast, { + IntValue(node): IntValueNode { + return { ...node, value: "0" }; + }, + FloatValue(node): FloatValueNode { + return { ...node, value: "0" }; + }, + StringValue(node): StringValueNode { + return { ...node, value: "", block: false }; + }, + ...listAndObjectVisitorIfEnabled, + }); +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf new file mode 120000 index 00000000..c9defaba --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/usage-reporting-protobuf @@ -0,0 +1 @@ +../../../@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions new file mode 120000 index 00000000..53e32399 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions @@ -0,0 +1 @@ +../../../@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace new file mode 120000 index 00000000..272891a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace @@ -0,0 +1 @@ +../../../@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.removealiases b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.removealiases new file mode 120000 index 00000000..b4998fe6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.removealiases @@ -0,0 +1 @@ +../../../@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.sortast b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.sortast new file mode 120000 index 00000000..05e5b335 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.sortast @@ -0,0 +1 @@ +../../../@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals new file mode 120000 index 00000000..4c68e37e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals @@ -0,0 +1 @@ +../../../@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/README.md b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/README.md new file mode 100644 index 00000000..bdbe6f89 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/README.md @@ -0,0 +1,21 @@ +# usageReporting + +This package exports the useful bits of usage reporting related to signature computation and referenced field calculation. + +## `usageReportingSignature` + +In Apollo Studio, we want to group requests making the same query together, and treat different queries distinctly. But what does it mean for two queries to be "the same"? And what if you don't want to send the full text of the query to Apollo's servers, either because it contains sensitive data orw because it contains extraneous operations or fragments? + +To solve these problems, Apollo Studio and related components have the concept of "signatures". We don't (by default) send the full query string of queries to Apollo's servers. Instead, each trace has its query string's "signature". + +The `usageReportingSignature` function is a combination of the following transforms: + +- `dropUnusedDefinitions`: removes operations and fragments that aren't going to be used in execution +- `stripSensitiveLiterals`: replaces all numeric and string literals as well as list and object input values with "empty" values +- `removeAliases`: removes field aliasing from the operation +- `sortAST`: sorts the children of most multi-child nodes consistently +- `printWithReducedWhitespace`, a variant on graphql-js's `print` which gets rid of unneeded whitespace + +## `calculateReferencedFieldsByType` + +Given a `DocumentNode` (operation) and a `GraphQLSchema`, `calculateReferencedFieldsByType` constructs a record of `typeName -> { fieldNames: string[], isInterface: boolean }`. This record _is_ the field usage data sent to Apollo Studio keyed by operation signature (`usageReportingSignature`). diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts new file mode 100644 index 00000000..5a15f5bd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts @@ -0,0 +1,13 @@ +import { type DocumentNode, type GraphQLSchema } from "graphql"; +import { ReferencedFieldsForType } from "@apollo/usage-reporting-protobuf"; +export interface OperationDerivedData { + signature: string; + referencedFieldsByType: ReferencedFieldsByType; +} +export type ReferencedFieldsByType = Record; +export declare function calculateReferencedFieldsByType({ document, schema, resolvedOperationName, }: { + document: DocumentNode; + resolvedOperationName: string | null; + schema: GraphQLSchema; +}): ReferencedFieldsByType; +//# sourceMappingURL=calculateReferencedFieldsByType.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts.map new file mode 100644 index 00000000..3e1e32e6 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"calculateReferencedFieldsByType.d.ts","sourceRoot":"","sources":["../src/calculateReferencedFieldsByType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAMnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,sBAAsB,CAAC;CAChD;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAE7E,wBAAgB,+BAA+B,CAAC,EAC9C,QAAQ,EACR,MAAM,EACN,qBAAqB,GACtB,EAAE;IACD,QAAQ,EAAE,YAAY,CAAC;IACvB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,aAAa,CAAC;CACvB,GAAG,sBAAsB,CA8DzB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js new file mode 100644 index 00000000..9a13670d --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateReferencedFieldsByType = void 0; +const graphql_1 = require("graphql"); +const usage_reporting_protobuf_1 = require("@apollo/usage-reporting-protobuf"); +function calculateReferencedFieldsByType({ document, schema, resolvedOperationName, }) { + const documentSeparatedByOperation = (0, graphql_1.separateOperations)(document); + const filteredDocument = documentSeparatedByOperation[resolvedOperationName !== null && resolvedOperationName !== void 0 ? resolvedOperationName : ""]; + if (!filteredDocument) { + throw Error(`shouldn't happen: operation '${resolvedOperationName !== null && resolvedOperationName !== void 0 ? resolvedOperationName : ""}' not found`); + } + const typeInfo = new graphql_1.TypeInfo(schema); + const interfaces = new Set(); + const referencedFieldSetByType = Object.create(null); + (0, graphql_1.visit)(filteredDocument, (0, graphql_1.visitWithTypeInfo)(typeInfo, { + Field(field) { + const fieldName = field.name.value; + const parentType = typeInfo.getParentType(); + if (!parentType) { + throw Error(`shouldn't happen: missing parent type for field ${fieldName}`); + } + const parentTypeName = parentType.name; + if (!referencedFieldSetByType[parentTypeName]) { + referencedFieldSetByType[parentTypeName] = new Set(); + if ((0, graphql_1.isInterfaceType)(parentType)) { + interfaces.add(parentTypeName); + } + } + referencedFieldSetByType[parentTypeName].add(fieldName); + }, + })); + const referencedFieldsByType = Object.create(null); + for (const [typeName, fieldNames] of Object.entries(referencedFieldSetByType)) { + referencedFieldsByType[typeName] = new usage_reporting_protobuf_1.ReferencedFieldsForType({ + fieldNames: [...fieldNames], + isInterface: interfaces.has(typeName), + }); + } + return referencedFieldsByType; +} +exports.calculateReferencedFieldsByType = calculateReferencedFieldsByType; +//# sourceMappingURL=calculateReferencedFieldsByType.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js.map b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js.map new file mode 100644 index 00000000..5880c8f4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/calculateReferencedFieldsByType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calculateReferencedFieldsByType.js","sourceRoot":"","sources":["../src/calculateReferencedFieldsByType.ts"],"names":[],"mappings":";;;AAAA,qCAQiB;AACjB,+EAA2E;AAS3E,SAAgB,+BAA+B,CAAC,EAC9C,QAAQ,EACR,MAAM,EACN,qBAAqB,GAKtB;IASC,MAAM,4BAA4B,GAAG,IAAA,4BAAkB,EAAC,QAAQ,CAAC,CAAC;IAClE,MAAM,gBAAgB,GACpB,4BAA4B,CAAC,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,EAAE,CAAC,CAAC;IAC5D,IAAI,CAAC,gBAAgB,EAAE;QAGrB,MAAM,KAAK,CACT,gCAAgC,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,EAAE,aAAa,CACzE,CAAC;KACH;IACD,MAAM,QAAQ,GAAG,IAAI,kBAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,MAAM,wBAAwB,GAAgC,MAAM,CAAC,MAAM,CACzE,IAAI,CACL,CAAC;IACF,IAAA,eAAK,EACH,gBAAgB,EAChB,IAAA,2BAAiB,EAAC,QAAQ,EAAE;QAC1B,KAAK,CAAC,KAAK;YACT,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;YACnC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC5C,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,KAAK,CACT,mDAAmD,SAAS,EAAE,CAC/D,CAAC;aACH;YACD,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;YACvC,IAAI,CAAC,wBAAwB,CAAC,cAAc,CAAC,EAAE;gBAC7C,wBAAwB,CAAC,cAAc,CAAC,GAAG,IAAI,GAAG,EAAU,CAAC;gBAC7D,IAAI,IAAA,yBAAe,EAAC,UAAU,CAAC,EAAE;oBAC/B,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;iBAChC;aACF;YAGD,wBAAwB,CAAC,cAAc,CAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC,CACH,CAAC;IAKF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnD,KAAK,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CACjD,wBAAwB,CACzB,EAAE;QACD,sBAAsB,CAAC,QAAQ,CAAC,GAAG,IAAI,kDAAuB,CAAC;YAC7D,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC;YAC3B,WAAW,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;SACtC,CAAC,CAAC;KACJ;IACD,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAtED,0EAsEC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts new file mode 100644 index 00000000..8392d022 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts @@ -0,0 +1,4 @@ +export { calculateReferencedFieldsByType } from "./calculateReferencedFieldsByType"; +export type { OperationDerivedData, ReferencedFieldsByType, } from "./calculateReferencedFieldsByType"; +export { usageReportingSignature } from "./signature"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts.map new file mode 100644 index 00000000..c8203fa9 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js new file mode 100644 index 00000000..29ae4eae --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.usageReportingSignature = exports.calculateReferencedFieldsByType = void 0; +var calculateReferencedFieldsByType_1 = require("./calculateReferencedFieldsByType"); +Object.defineProperty(exports, "calculateReferencedFieldsByType", { enumerable: true, get: function () { return calculateReferencedFieldsByType_1.calculateReferencedFieldsByType; } }); +var signature_1 = require("./signature"); +Object.defineProperty(exports, "usageReportingSignature", { enumerable: true, get: function () { return signature_1.usageReportingSignature; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js.map new file mode 100644 index 00000000..1ae83118 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qFAAoF;AAA3E,kJAAA,+BAA+B,OAAA;AAKxC,yCAAsD;AAA7C,oHAAA,uBAAuB,OAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts new file mode 100644 index 00000000..5410e118 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts @@ -0,0 +1,3 @@ +import type { DocumentNode } from "graphql"; +export declare function usageReportingSignature(ast: DocumentNode, operationName: string): string; +//# sourceMappingURL=signature.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts.map new file mode 100644 index 00000000..2264e9e1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,YAAY,EACjB,aAAa,EAAE,MAAM,GACpB,MAAM,CAUR"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js new file mode 100644 index 00000000..edb6aade --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.usageReportingSignature = void 0; +const utils_dropunuseddefinitions_1 = require("@apollo/utils.dropunuseddefinitions"); +const utils_stripsensitiveliterals_1 = require("@apollo/utils.stripsensitiveliterals"); +const utils_printwithreducedwhitespace_1 = require("@apollo/utils.printwithreducedwhitespace"); +const utils_removealiases_1 = require("@apollo/utils.removealiases"); +const utils_sortast_1 = require("@apollo/utils.sortast"); +function usageReportingSignature(ast, operationName) { + return (0, utils_printwithreducedwhitespace_1.printWithReducedWhitespace)((0, utils_sortast_1.sortAST)((0, utils_removealiases_1.removeAliases)((0, utils_stripsensitiveliterals_1.stripSensitiveLiterals)((0, utils_dropunuseddefinitions_1.dropUnusedDefinitions)(ast, operationName), { + hideListAndObjectLiterals: true, + })))); +} +exports.usageReportingSignature = usageReportingSignature; +//# sourceMappingURL=signature.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js.map b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js.map new file mode 100644 index 00000000..22720b32 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/dist/signature.js.map @@ -0,0 +1 @@ +{"version":3,"file":"signature.js","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":";;;AAqBA,qFAA4E;AAC5E,uFAA8E;AAC9E,+FAAsF;AACtF,qEAA4D;AAC5D,yDAAgD;AAGhD,SAAgB,uBAAuB,CACrC,GAAiB,EACjB,aAAqB;IAErB,OAAO,IAAA,6DAA0B,EAC/B,IAAA,uBAAO,EACL,IAAA,mCAAa,EACX,IAAA,qDAAsB,EAAC,IAAA,mDAAqB,EAAC,GAAG,EAAE,aAAa,CAAC,EAAE;QAChE,yBAAyB,EAAE,IAAI;KAChC,CAAC,CACH,CACF,CACF,CAAC;AACJ,CAAC;AAbD,0DAaC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/package.json b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/package.json new file mode 100644 index 00000000..9bfbcca4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/package.json @@ -0,0 +1,34 @@ +{ + "name": "@apollo/utils.usagereporting", + "version": "2.1.0", + "description": "Generate a signature for Apollo usage reporting", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/usageReporting/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "dependencies": { + "@apollo/usage-reporting-protobuf": "^4.1.0", + "@apollo/utils.dropunuseddefinitions": "^2.0.1", + "@apollo/utils.stripsensitiveliterals": "^2.0.1", + "@apollo/utils.printwithreducedwhitespace": "^2.0.1", + "@apollo/utils.removealiases": "2.0.1", + "@apollo/utils.sortast": "^2.0.1" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/__snapshots__/signature.test.ts.snap b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/__snapshots__/signature.test.ts.snap new file mode 100644 index 00000000..e46f4bf3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/__snapshots__/signature.test.ts.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`usageReportingSignature basic test 1`] = `"{user{name}}"`; + +exports[`usageReportingSignature basic test with query 1`] = `"{user{name}}"`; + +exports[`usageReportingSignature basic with operation name 1`] = `"query OpName{user{name}}"`; + +exports[`usageReportingSignature fragment 1`] = `"fragment Bar on User{asd}{user{name...Bar}}"`; + +exports[`usageReportingSignature fragments in various order 1`] = `"fragment Bar on User{asd}{user{name...Bar}}"`; + +exports[`usageReportingSignature full test 1`] = `"fragment Bar on User{age@skip(if:$a)...Nested}fragment Nested on User{blah}query Foo($a:Boolean,$b:Int){user(age:0,name:""){name tz...Bar...on User{bee hello}}}"`; + +exports[`usageReportingSignature with various argument types 1`] = `"query OpName($a:[[Boolean!]!],$b:EnumType,$c:Int!){user{name(apple:$a,bag:$b,cat:$c)}}"`; + +exports[`usageReportingSignature with various inline types 1`] = `"query OpName{user{name(apple:[],bag:{},cat:ENUM_VALUE)}}"`; diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/calculateReferencedFieldsByType.test.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/calculateReferencedFieldsByType.test.ts new file mode 100644 index 00000000..28794166 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/calculateReferencedFieldsByType.test.ts @@ -0,0 +1,299 @@ +import { buildASTSchema, type DocumentNode, validate } from "graphql"; +import gql from "graphql-tag"; +import { calculateReferencedFieldsByType } from ".."; + +const schema = buildASTSchema(gql` + type Query { + f1: Int + f2: Int + a: A + aa: A + myInterface: MyInterface + } + + type A implements MyInterface { + x: ID + y: String! + } + + interface MyInterface { + x: ID + } +`); + +function validateAndCalculate({ + document, + resolvedOperationName = null, +}: { + document: DocumentNode; + resolvedOperationName?: string | null; +}) { + // First validate the document, since calculateReferencedFieldsByType expects + // that. + expect(validate(schema, document)).toStrictEqual([]); + return calculateReferencedFieldsByType({ + schema, + document, + resolvedOperationName, + }); +} + +describe("calculateReferencedFieldsByType", () => { + it("basic", () => { + expect( + validateAndCalculate({ + document: gql` + { + f1 + } + `, + }), + ).toMatchInlineSnapshot(` + { + "Query": { + "fieldNames": [ + "f1", + ], + "isInterface": false, + }, + } + `); + }); + + it("aliases use actual field name", () => { + expect( + validateAndCalculate({ + document: gql` + { + aliased: f1 + } + `, + }), + ).toMatchInlineSnapshot(` + { + "Query": { + "fieldNames": [ + "f1", + ], + "isInterface": false, + }, + } + `); + }); + + it("multiple operations and fragments", () => { + expect( + validateAndCalculate({ + document: gql` + query Q1 { + f1 + a { + ...AStuff + } + } + query Q2 { + f2 + aa { + ...OtherAStuff + } + } + fragment AStuff on A { + x + } + fragment OtherAStuff on A { + y + } + `, + resolvedOperationName: "Q1", + }), + ).toMatchInlineSnapshot(` + { + "A": { + "fieldNames": [ + "x", + ], + "isInterface": false, + }, + "Query": { + "fieldNames": [ + "f1", + "a", + ], + "isInterface": false, + }, + } + `); + }); + + it("interfaces", () => { + expect( + validateAndCalculate({ + document: gql` + query { + myInterface { + x + } + } + `, + }), + ).toMatchInlineSnapshot(` + { + "MyInterface": { + "fieldNames": [ + "x", + ], + "isInterface": true, + }, + "Query": { + "fieldNames": [ + "myInterface", + ], + "isInterface": false, + }, + } + `); + }); + + it("interface with fragment", () => { + expect( + validateAndCalculate({ + document: gql` + query { + myInterface { + x + ... on A { + y + } + } + } + `, + }), + ).toMatchInlineSnapshot(` + { + "A": { + "fieldNames": [ + "y", + ], + "isInterface": false, + }, + "MyInterface": { + "fieldNames": [ + "x", + ], + "isInterface": true, + }, + "Query": { + "fieldNames": [ + "myInterface", + ], + "isInterface": false, + }, + } + `); + }); +}); + +it("interface with fragment that uses interface field", () => { + expect( + validateAndCalculate({ + document: gql` + query { + myInterface { + ... on A { + # Even though x exists on the interface, we only want this to + # count towards A.x below, because this operation would work just + # as well if x were removed from the interface as long as it was + # left on A. + x + } + } + } + `, + }), + ).toMatchInlineSnapshot(` + { + "A": { + "fieldNames": [ + "x", + ], + "isInterface": false, + }, + "Query": { + "fieldNames": [ + "myInterface", + ], + "isInterface": false, + }, + } + `); +}); + +it("using field both with interface and object should work", () => { + expect( + validateAndCalculate({ + document: gql` + query { + myInterface { + x + ... on A { + x + } + } + } + `, + }), + ).toMatchInlineSnapshot(` + { + "A": { + "fieldNames": [ + "x", + ], + "isInterface": false, + }, + "MyInterface": { + "fieldNames": [ + "x", + ], + "isInterface": true, + }, + "Query": { + "fieldNames": [ + "myInterface", + ], + "isInterface": false, + }, + } + `); +}); + +it("using field multiple times (same level or otherwise) de-dupes", () => { + expect( + validateAndCalculate({ + document: gql` + query { + a1: a { + y + } + a2: a { + y + } + } + `, + }), + ).toMatchInlineSnapshot(` + { + "A": { + "fieldNames": [ + "y", + ], + "isInterface": false, + }, + "Query": { + "fieldNames": [ + "a", + ], + "isInterface": false, + }, + } + `); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/signature.test.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/signature.test.ts new file mode 100644 index 00000000..3dc58504 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/signature.test.ts @@ -0,0 +1,141 @@ +import gql, { disableFragmentWarnings } from "graphql-tag"; +import { usageReportingSignature } from ".."; + +// The gql duplicate fragment warning feature really is just warnings; nothing +// breaks if you turn it off in tests. +disableFragmentWarnings(); + +describe("usageReportingSignature", () => { + const cases = [ + { + name: "basic test", + operationName: "", + input: gql` + { + user { + name + } + } + `, + }, + { + name: "basic test with query", + operationName: "", + input: gql` + query { + user { + name + } + } + `, + }, + { + name: "basic with operation name", + operationName: "OpName", + input: gql` + query OpName { + user { + name + } + } + `, + }, + { + name: "with various inline types", + operationName: "OpName", + input: gql` + query OpName { + user { + name(apple: [[10]], cat: ENUM_VALUE, bag: { input: "value" }) + } + } + `, + }, + { + name: "with various argument types", + operationName: "OpName", + input: gql` + query OpName($c: Int!, $a: [[Boolean!]!], $b: EnumType) { + user { + name(apple: $a, cat: $c, bag: $b) + } + } + `, + }, + { + name: "fragment", + operationName: "", + input: gql` + { + user { + name + ...Bar + } + } + + fragment Bar on User { + asd + } + + fragment Baz on User { + jkl + } + `, + }, + { + name: "fragments in various order", + operationName: "", + input: gql` + fragment Bar on User { + asd + } + + { + user { + name + ...Bar + } + } + + fragment Baz on User { + jkl + } + `, + }, + { + name: "full test", + operationName: "Foo", + input: gql` + query Foo($b: Int, $a: Boolean) { + user(name: "hello", age: 5) { + ...Bar + ... on User { + hello + bee + } + tz + aliased: name + } + } + + fragment Baz on User { + asd + } + + fragment Bar on User { + age @skip(if: $a) + ...Nested + } + + fragment Nested on User { + blah + } + `, + }, + ]; + cases.forEach(({ name, operationName, input }) => { + test(name, () => { + expect(usageReportingSignature(input, operationName)).toMatchSnapshot(); + }); + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/tsconfig.json new file mode 100644 index 00000000..c2380d42 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/__tests__/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [ + { "path": "../../" }, + { "path": "../../../dropUnusedDefinitions" }, + { "path": "../../../printWithReducedWhitespace" }, + { "path": "../../../sortAST" } + ] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/calculateReferencedFieldsByType.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/calculateReferencedFieldsByType.ts new file mode 100644 index 00000000..3659a39e --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/calculateReferencedFieldsByType.ts @@ -0,0 +1,89 @@ +import { + type DocumentNode, + type GraphQLSchema, + isInterfaceType, + separateOperations, + TypeInfo, + visit, + visitWithTypeInfo, +} from "graphql"; +import { ReferencedFieldsForType } from "@apollo/usage-reporting-protobuf"; + +export interface OperationDerivedData { + signature: string; + referencedFieldsByType: ReferencedFieldsByType; +} + +export type ReferencedFieldsByType = Record; + +export function calculateReferencedFieldsByType({ + document, + schema, + resolvedOperationName, +}: { + document: DocumentNode; + resolvedOperationName: string | null; + schema: GraphQLSchema; +}): ReferencedFieldsByType { + // If the document contains multiple operations, we only care about fields + // referenced in the operation we're using and in fragments that are + // (transitively) spread by that operation. (This is because Studio's field + // usage accounting is all by operation, not by document.) This does mean that + // a field can be textually present in a GraphQL document (and need to exist + // for validation) without being represented in the reported referenced fields + // structure, but we'd need to change the data model of Studio to be based on + // documents rather than fields if we wanted to improve that. + const documentSeparatedByOperation = separateOperations(document); + const filteredDocument = + documentSeparatedByOperation[resolvedOperationName ?? ""]; + if (!filteredDocument) { + // This shouldn't happen because we only should call this function on + // properly executable documents. + throw Error( + `shouldn't happen: operation '${resolvedOperationName ?? ""}' not found`, + ); + } + const typeInfo = new TypeInfo(schema); + const interfaces = new Set(); + const referencedFieldSetByType: Record> = Object.create( + null, + ); + visit( + filteredDocument, + visitWithTypeInfo(typeInfo, { + Field(field) { + const fieldName = field.name.value; + const parentType = typeInfo.getParentType(); + if (!parentType) { + throw Error( + `shouldn't happen: missing parent type for field ${fieldName}`, + ); + } + const parentTypeName = parentType.name; + if (!referencedFieldSetByType[parentTypeName]) { + referencedFieldSetByType[parentTypeName] = new Set(); + if (isInterfaceType(parentType)) { + interfaces.add(parentTypeName); + } + } + + // We know this is set to an empty Set if it didn't exist immediately above + referencedFieldSetByType[parentTypeName]!.add(fieldName); + }, + }), + ); + + // Convert from initial representation (which uses Sets to avoid quadratic + // behavior) to the protobufjs objects. (We could also use js_use_toArray here + // but that seems a little overkill.) + const referencedFieldsByType = Object.create(null); + for (const [typeName, fieldNames] of Object.entries( + referencedFieldSetByType, + )) { + referencedFieldsByType[typeName] = new ReferencedFieldsForType({ + fieldNames: [...fieldNames], + isInterface: interfaces.has(typeName), + }); + } + return referencedFieldsByType; +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/index.ts new file mode 100644 index 00000000..c58eb9f4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/index.ts @@ -0,0 +1,6 @@ +export { calculateReferencedFieldsByType } from "./calculateReferencedFieldsByType"; +export type { + OperationDerivedData, + ReferencedFieldsByType, +} from "./calculateReferencedFieldsByType"; +export { usageReportingSignature } from "./signature"; diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/signature.ts b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/signature.ts new file mode 100644 index 00000000..fc142dec --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting/src/signature.ts @@ -0,0 +1,42 @@ +// In Apollo Studio, we want to group requests making the same query together, +// and treat different queries distinctly. But what does it mean for two queries +// to be "the same"? And what if you don't want to send the full text of the +// query to Apollo's servers, either because it contains sensitive data or +// because it contains extraneous operations or fragments? +// +// To solve these problems, Apollo Studio and related components have the +// concept of "signatures". We don't (by default) send the full query string of +// queries to Apollo's servers. Instead, each trace has its query string's +// "signature". +// +// This module combines several AST transformations to create its signature: +// +// - dropUnusedDefinitions, which removes operations and fragments that aren't +// going to be used in execution +// - stripSensitiveLiterals, which replaces all numeric and string literals as +// well as list and object input values with "empty" values +// - removeAliases, which removes field aliasing from the query +// - sortAST, which sorts the children of most multi-child nodes consistently +// - printWithReducedWhitespace, a variant on graphql-js's 'print' which gets +// rid of unneeded whitespace +import { dropUnusedDefinitions } from "@apollo/utils.dropunuseddefinitions"; +import { stripSensitiveLiterals } from "@apollo/utils.stripsensitiveliterals"; +import { printWithReducedWhitespace } from "@apollo/utils.printwithreducedwhitespace"; +import { removeAliases } from "@apollo/utils.removealiases"; +import { sortAST } from "@apollo/utils.sortast"; +import type { DocumentNode } from "graphql"; + +export function usageReportingSignature( + ast: DocumentNode, + operationName: string, +): string { + return printWithReducedWhitespace( + sortAST( + removeAliases( + stripSensitiveLiterals(dropUnusedDefinitions(ast, operationName), { + hideListAndObjectLiterals: true, + }), + ), + ), + ); +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/LICENSE b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/LICENSE new file mode 100644 index 00000000..28f0e384 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/README.md b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/README.md new file mode 100644 index 00000000..88791e89 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/README.md @@ -0,0 +1,20 @@ +# WithRequired type + +This package defines the TypeScript utility type `WithRequired`. It transforms a type that has one or more optional fields into a type where those fields are required. + +For example: + +``` +import { WithRequired } from '@apollo/utils.withrequired'; + +interface HasSomeOptionals { + foo: number; + bar?: string; + baz?: boolean; + quux?: string; +} + +type MoreRequired = WithRequired; +``` + +The `MoreRequired` type is like `HasSomeOptionals`, but `bar` and `baz` are now required rather than optional. `quux` remains optional. diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts new file mode 100644 index 00000000..5fb00ebd --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts @@ -0,0 +1,2 @@ +export type WithRequired = T & Required>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts.map b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts.map new file mode 100644 index 00000000..b61262af --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js new file mode 100644 index 00000000..aa219d8f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js.map b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js.map new file mode 100644 index 00000000..1ed2df62 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/package.json b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/package.json new file mode 100644 index 00000000..31b63ebf --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/package.json @@ -0,0 +1,23 @@ +{ + "name": "@apollo/utils.withrequired", + "version": "3.0.0", + "description": "TypeScript utility type WithRequired", + "main": "", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-utils.git", + "directory": "packages/withRequired/" + }, + "keywords": [ + "apollo", + "graphql", + "typescript", + "node" + ], + "author": "Apollo ", + "license": "MIT", + "engines": { + "node": ">=16" + } +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/index.test.ts b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/index.test.ts new file mode 100644 index 00000000..a5a41bb4 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/index.test.ts @@ -0,0 +1,29 @@ +import type { WithRequired } from ".."; + +// This "test suite" actually does all its work at compile time. +function isWRFoo(_: WRFoo) {} + +interface Foo { + alwaysOptional?: number; + startsOutOptional?: number; + alsoStartsOutOptional?: string; + alwaysRequired: string; +} + +type WRFoo = WithRequired; + +it("can plug in all now-required fields", () => { + isWRFoo({ + startsOutOptional: 5, + alsoStartsOutOptional: "asdf", + alwaysRequired: "bla", + }); +}); + +it("now-required fields are required", () => { + // @ts-expect-error + isWRFoo({ + startsOutOptional: 5, + alwaysRequired: "bla", + }); +}); diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/tsconfig.json b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/tsconfig.json new file mode 100644 index 00000000..40c0056f --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/__tests__/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../../tsconfig.test.base", + "include": ["**/*"], + "references": [{ "path": "../../" }] +} diff --git a/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/index.ts b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/index.ts new file mode 100644 index 00000000..13515aa1 --- /dev/null +++ b/backend/node_modules/.pnpm/@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired/src/index.ts @@ -0,0 +1 @@ +export type WithRequired = T & Required>; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/README.md b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/README.md new file mode 100644 index 00000000..55f8e60e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/README.md @@ -0,0 +1,5 @@ +Check API Reference for more information about this package; +https://www.graphql-tools.com/docs/api/modules/merge_src + +You can also learn more about Schema Merging in this chapter; +https://www.graphql-tools.com/docs/schema-merging diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/extensions.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/extensions.js new file mode 100644 index 00000000..2721bc6d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/extensions.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extractExtensionsFromSchema = void 0; +exports.mergeExtensions = mergeExtensions; +exports.applyExtensions = applyExtensions; +const utils_1 = require("@graphql-tools/utils"); +var utils_2 = require("@graphql-tools/utils"); +Object.defineProperty(exports, "extractExtensionsFromSchema", { enumerable: true, get: function () { return utils_2.extractExtensionsFromSchema; } }); +function mergeExtensions(extensions) { + return (0, utils_1.mergeDeep)(extensions, false, true); +} +function applyExtensionObject(obj, extensions) { + if (!obj || !extensions || extensions === obj.extensions) { + return; + } + if (!obj.extensions) { + obj.extensions = extensions; + return; + } + obj.extensions = (0, utils_1.mergeDeep)([obj.extensions, extensions], false, true); +} +function applyExtensions(schema, extensions) { + applyExtensionObject(schema, extensions.schemaExtensions); + for (const [typeName, data] of Object.entries(extensions.types || {})) { + const type = schema.getType(typeName); + if (type) { + applyExtensionObject(type, data.extensions); + if (data.type === 'object' || data.type === 'interface') { + for (const [fieldName, fieldData] of Object.entries(data.fields)) { + const field = type.getFields()[fieldName]; + if (field) { + applyExtensionObject(field, fieldData.extensions); + for (const [arg, argData] of Object.entries(fieldData.arguments)) { + applyExtensionObject(field.args.find(a => a.name === arg), argData); + } + } + } + } + else if (data.type === 'input') { + for (const [fieldName, fieldData] of Object.entries(data.fields)) { + const field = type.getFields()[fieldName]; + applyExtensionObject(field, fieldData.extensions); + } + } + else if (data.type === 'enum') { + for (const [valueName, valueData] of Object.entries(data.values)) { + const value = type.getValue(valueName); + applyExtensionObject(value, valueData); + } + } + } + } + return schema; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/index.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/index.js new file mode 100644 index 00000000..ee86e2cd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./merge-resolvers.js"), exports); +tslib_1.__exportStar(require("./typedefs-mergers/index.js"), exports); +tslib_1.__exportStar(require("./extensions.js"), exports); diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/links.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/links.js new file mode 100644 index 00000000..c23d58af --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/links.js @@ -0,0 +1,162 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveImportName = resolveImportName; +exports.extractLinks = extractLinks; +/** + * A simplified, GraphQL v15 compatible version of + * https://github.com/graphql-hive/federation-composition/blob/main/src/utils/link/index.ts + * that does not provide the same safeguards or functionality, but still can determine the + * correct name of an linked resource. + */ +const graphql_1 = require("graphql"); +function namespace(link) { + return link.as ?? link.url.name; +} +function defaultImport(link) { + const name = namespace(link); + return name && `@${name}`; +} +function resolveImportName(link, elementName) { + if (link.url.name && elementName === `@${link.url.name}`) { + // @note: default is a directive... So remove the `@` + return defaultImport(link).substring(1); + } + const imported = link.imports.find(i => i.name === elementName); + const resolvedName = imported?.as ?? imported?.name ?? namespaced(namespace(link), elementName); + // Strip the `@` prefix for directives because in all implementations of mapping or visiting a schema, + // directive names are not prefixed with `@`. The `@` is only for SDL. + return resolvedName.startsWith('@') ? resolvedName.substring(1) : resolvedName; +} +function namespaced(namespace, name) { + if (namespace?.length) { + if (name.startsWith('@')) { + return `@${namespace}__${name.substring(1)}`; + } + return `${namespace}__${name}`; + } + return name; +} +function extractLinks(typeDefs) { + let links = []; + for (const definition of typeDefs.definitions) { + if (definition.kind === graphql_1.Kind.SCHEMA_EXTENSION || definition.kind === graphql_1.Kind.SCHEMA_DEFINITION) { + const defLinks = definition.directives?.filter(directive => directive.name.value === 'link'); + const parsedLinks = defLinks?.map(l => linkFromArgs(l.arguments ?? [])).filter(l => l !== undefined) ?? []; + links = links.concat(parsedLinks); + // Federation 1 support... Federation 1 uses "@core" instead of "@link", but behavior is similar enough that + // it can be translated. + const defCores = definition.directives?.filter(({ name }) => name.value === 'core'); + const coreLinks = defCores + ?.map(c => linkFromCoreArgs(c.arguments ?? [])) + .filter(l => l !== undefined); + if (coreLinks) { + links = links.concat(...coreLinks); + } + } + } + return links; +} +function linkFromArgs(args) { + let url; + let imports = []; + let as; + for (const arg of args) { + switch (arg.name.value) { + case 'url': { + if (arg.value.kind === graphql_1.Kind.STRING) { + url = parseFederationLinkUrl(arg.value.value); + } + break; + } + case 'import': { + imports = parseImportNode(arg.value); + break; + } + case 'as': { + if (arg.value.kind === graphql_1.Kind.STRING) { + as = arg.value.value ?? undefined; + } + break; + } + default: { + // ignore. It's not the job of this package to validate. Federation should validate links. + } + } + } + if (url !== undefined) { + return { + url, + as, + imports, + }; + } +} +/** + * Supports federation 1 + */ +function linkFromCoreArgs(args) { + const feature = args.find(({ name, value }) => name.value === 'feature' && value.kind === graphql_1.Kind.STRING); + if (feature) { + const url = parseFederationLinkUrl(feature.value.value); + return { + url, + imports: [], + }; + } +} +function parseImportNode(node) { + if (node.kind === graphql_1.Kind.LIST) { + const imports = node.values.map((v) => { + let namedImport; + if (v.kind === graphql_1.Kind.STRING) { + namedImport = { name: v.value }; + } + else if (v.kind === graphql_1.Kind.OBJECT) { + let name = ''; + let as; + for (const f of v.fields) { + if (f.name.value === 'name') { + if (f.value.kind === graphql_1.Kind.STRING) { + name = f.value.value; + } + } + else if (f.name.value === 'as') { + if (f.value.kind === graphql_1.Kind.STRING) { + as = f.value.value; + } + } + } + namedImport = { name, as }; + } + return namedImport; + }); + return imports.filter(i => i !== undefined); + } + return []; +} +const VERSION_MATCH = /v(\d{1,3})\.(\d{1,4})/i; +function parseFederationLinkUrl(urlSource) { + const url = new URL(urlSource); + const parts = url.pathname.split('/').filter(Boolean); + const versionOrName = parts[parts.length - 1]; + if (versionOrName) { + if (VERSION_MATCH.test(versionOrName)) { + const maybeName = parts[parts.length - 2]; + return { + identity: url.origin + (maybeName ? `/${parts.slice(0, parts.length - 1).join('/')}` : ''), + name: maybeName ?? null, + version: versionOrName, + }; + } + return { + identity: `${url.origin}/${parts.join('/')}`, + name: versionOrName, + version: null, + }; + } + return { + identity: url.origin, + name: null, + version: null, + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/merge-resolvers.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/merge-resolvers.js new file mode 100644 index 00000000..8ad633ac --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/merge-resolvers.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeResolvers = mergeResolvers; +const utils_1 = require("@graphql-tools/utils"); +/** + * Deep merges multiple resolver definition objects into a single definition. + * @param resolversDefinitions Resolver definitions to be merged + * @param options Additional options + * + * ```js + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const clientResolver = require('./clientResolver'); + * const productResolver = require('./productResolver'); + * + * const resolvers = mergeResolvers([ + * clientResolver, + * productResolver, + * ]); + * ``` + * + * If you don't want to manually create the array of resolver objects, you can + * also use this function along with loadFiles: + * + * ```js + * const path = require('path'); + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const { loadFilesSync } = require('@graphql-tools/load-files'); + * + * const resolversArray = loadFilesSync(path.join(__dirname, './resolvers')); + * + * const resolvers = mergeResolvers(resolversArray) + * ``` + */ +function mergeResolvers(resolversDefinitions, options) { + if (!resolversDefinitions || + (Array.isArray(resolversDefinitions) && resolversDefinitions.length === 0)) { + return {}; + } + if (!Array.isArray(resolversDefinitions)) { + return resolversDefinitions; + } + if (resolversDefinitions.length === 1) { + return resolversDefinitions[0] || {}; + } + const resolvers = new Array(); + for (let resolversDefinition of resolversDefinitions) { + if (Array.isArray(resolversDefinition)) { + resolversDefinition = mergeResolvers(resolversDefinition); + } + if (typeof resolversDefinition === 'object' && resolversDefinition) { + resolvers.push(resolversDefinition); + } + } + const result = (0, utils_1.mergeDeep)(resolvers, true); + if (options?.exclusions) { + for (const exclusion of options.exclusions) { + const [typeName, fieldName] = exclusion.split('.'); + if (['__proto__', 'constructor', 'prototype'].includes(typeName) || + ['__proto__', 'constructor', 'prototype'].includes(fieldName)) { + continue; + } + if (!fieldName || fieldName === '*') { + delete result[typeName]; + } + else if (result[typeName]) { + delete result[typeName][fieldName]; + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/package.json b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/arguments.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/arguments.js new file mode 100644 index 00000000..977fec69 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/arguments.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeArguments = mergeArguments; +const utils_1 = require("@graphql-tools/utils"); +function mergeArguments(args1, args2, config) { + const result = deduplicateArguments([...args2, ...args1].filter(utils_1.isSome), config); + if (config && config.sort) { + result.sort(utils_1.compareNodes); + } + return result; +} +function deduplicateArguments(args, config) { + return args.reduce((acc, current) => { + const dupIndex = acc.findIndex(arg => arg.name.value === current.name.value); + if (dupIndex === -1) { + return acc.concat([current]); + } + else if (!config?.reverseArguments) { + acc[dupIndex] = current; + } + return acc; + }, []); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/directives.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/directives.js new file mode 100644 index 00000000..bf7446db --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/directives.js @@ -0,0 +1,172 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeDirectives = mergeDirectives; +exports.mergeDirective = mergeDirective; +const graphql_1 = require("graphql"); +function collectMultiInstanceDirectiveNames(directiveNodes) { + const seen = new Set(); + const multi = new Set(); + for (const directive of directiveNodes) { + const name = directive.name.value; + if (seen.has(name)) { + multi.add(name); + } + else { + seen.add(name); + } + } + return multi; +} +function isRepeatableDirective(directive, directives, repeatableLinkImports, inferredRepeatable) { + const directiveDef = directives?.[directive.name.value]; + if (directiveDef) { + return !!directiveDef.repeatable; + } + return !!(repeatableLinkImports?.has(directive.name.value) || + inferredRepeatable?.has(directive.name.value)); +} +function nameAlreadyExists(name, namesArr) { + return namesArr.some(({ value }) => value === name.value); +} +function mergeArguments(a1, a2) { + const result = []; + for (const argument of [...a2, ...a1]) { + const existingIndex = result.findIndex(a => a.name.value === argument.name.value); + if (existingIndex === -1) { + result.push(argument); + } + else { + const existingArg = result[existingIndex]; + if (existingArg.value.kind === 'ListValue') { + const source = existingArg.value.values; + const target = argument.value.values; + // merge values of two lists + existingArg.value = { + ...existingArg.value, + values: deduplicateLists(source, target, (targetVal, source) => { + const value = targetVal.value; + return !value || !source.some((sourceVal) => sourceVal.value === value); + }), + }; + } + else { + existingArg.value = argument.value; + } + } + } + return result; +} +const matchValues = (a, b) => { + if (a.kind === b.kind) { + switch (a.kind) { + case graphql_1.Kind.LIST: + return (a.values.length === b.values.length && + a.values.every(aVal => b.values.find(bVal => matchValues(aVal, bVal)))); + case graphql_1.Kind.VARIABLE: + case graphql_1.Kind.NULL: + return true; + case graphql_1.Kind.OBJECT: + return (a.fields.length === b.fields.length && + a.fields.every(aField => b.fields.find(bField => aField.name.value === bField.name.value && matchValues(aField.value, bField.value)))); + default: + return a.value === b.value; + } + } + return false; +}; +const isLinkDirective = (directive) => directive.name.value === 'link'; +const getLinkDirectiveURL = (directive) => { + const stringValue = isLinkDirective(directive) + ? directive.arguments?.find(arg => arg.name.value === 'url')?.value + : undefined; + return stringValue?.kind === 'StringValue' ? stringValue.value : undefined; +}; +const matchArguments = (a, b) => a.name.value === b.name.value && a.value.kind === b.value.kind && matchValues(a.value, b.value); +/** + * Check if a directive is an exact match of another directive based on their + * arguments. + */ +const matchDirectives = (a, b) => { + const matched = a.name.value === b.name.value && + (a.arguments === b.arguments || + (a.arguments?.length === b.arguments?.length && + a.arguments?.every(argA => b.arguments?.find(argB => matchArguments(argA, argB))))); + return !!matched; +}; +function mergeDirectives(d1 = [], d2 = [], config, directives) { + const reverseOrder = config && config.reverseDirectives; + const asNext = reverseOrder ? d1 : d2; + const asFirst = reverseOrder ? d2 : d1; + // When a type already has multiple applications of the same directive name and the + // other merge input has none (typical when extending a type), treat that name as + // repeatable if no directive definition is available — otherwise those applications + // are collapsed while re-merging the type's own directives (#6505). + // Only infer when the other side has zero applications so legitimate merges of the + // same directive from two documents (e.g. @link import lists) still combine. + const d1Names = new Set(d1.map(directive => directive.name.value)); + const d2Names = new Set(d2.map(directive => directive.name.value)); + const inferredRepeatable = new Set(); + for (const name of collectMultiInstanceDirectiveNames(d1)) { + if (!d2Names.has(name)) { + inferredRepeatable.add(name); + } + } + for (const name of collectMultiInstanceDirectiveNames(d2)) { + if (!d1Names.has(name)) { + inferredRepeatable.add(name); + } + } + const result = []; + for (const directive of [...asNext, ...asFirst]) { + if (isRepeatableDirective(directive, directives, config?.repeatableLinkImports, inferredRepeatable)) { + // look for repeated, identical directives that come before this instance + // if those exist, return null so that this directive gets removed. + const exactDuplicate = result.find(d => matchDirectives(directive, d)); + if (!exactDuplicate) { + result.push(directive); + } + } + else { + const firstAt = result.findIndex(d => d.name.value === directive.name.value); + if (firstAt === -1) { + // if did not find a directive with this name on the result set already + result.push(directive); + } + else { + if (isLinkDirective(directive) && isLinkDirective(result[firstAt])) { + const url1 = getLinkDirectiveURL(directive); + const url2 = getLinkDirectiveURL(result[firstAt]); + // if both are link directives but with different urls, do not merge them + if (url1 && url2 && url1 !== url2) { + result.push(directive); + continue; + } + } + // if not repeatable and found directive with the same name already in the result set, + // then merge the arguments of the existing directive and the new directive + const mergedArguments = mergeArguments(directive.arguments ?? [], result[firstAt].arguments ?? []); + result[firstAt] = { + ...result[firstAt], + arguments: mergedArguments.length === 0 ? undefined : mergedArguments, + }; + } + } + } + return result; +} +function mergeDirective(node, existingNode) { + if (existingNode) { + return { + ...node, + arguments: deduplicateLists(existingNode.arguments || [], node.arguments || [], (arg, existingArgs) => !nameAlreadyExists(arg.name, existingArgs.map(a => a.name))), + locations: [ + ...existingNode.locations, + ...node.locations.filter(name => !nameAlreadyExists(name, existingNode.locations)), + ], + }; + } + return node; +} +function deduplicateLists(source, target, filterFn) { + return source.concat(target.filter(val => filterFn(val, source))); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum-values.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum-values.js new file mode 100644 index 00000000..a2daed12 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum-values.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeEnumValues = mergeEnumValues; +const utils_1 = require("@graphql-tools/utils"); +const directives_js_1 = require("./directives.js"); +function mergeEnumValues(first, second, config, directives) { + if (config?.consistentEnumMerge) { + const reversed = []; + if (first) { + reversed.push(...first); + } + first = second; + second = reversed; + } + const enumValueMap = new Map(); + if (first) { + for (const firstValue of first) { + enumValueMap.set(firstValue.name.value, firstValue); + } + } + if (second) { + for (const secondValue of second) { + const enumValue = secondValue.name.value; + if (enumValueMap.has(enumValue)) { + const firstValue = enumValueMap.get(enumValue); + firstValue.description = secondValue.description || firstValue.description; + firstValue.directives = (0, directives_js_1.mergeDirectives)(secondValue.directives, firstValue.directives, directives); + } + else { + enumValueMap.set(enumValue, secondValue); + } + } + } + const result = [...enumValueMap.values()]; + if (config && config.sort) { + result.sort(utils_1.compareNodes); + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum.js new file mode 100644 index 00000000..486fd24d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/enum.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeEnum = mergeEnum; +const graphql_1 = require("graphql"); +const directives_js_1 = require("./directives.js"); +const enum_values_js_1 = require("./enum-values.js"); +function mergeEnum(e1, e2, config, directives) { + if (e2) { + return { + name: e1.name, + description: e1['description'] || e2['description'], + kind: config?.convertExtensions || + e1.kind === 'EnumTypeDefinition' || + e2.kind === 'EnumTypeDefinition' + ? 'EnumTypeDefinition' + : 'EnumTypeExtension', + loc: e1.loc, + directives: (0, directives_js_1.mergeDirectives)(e1.directives, e2.directives, config, directives), + values: (0, enum_values_js_1.mergeEnumValues)(e1.values, e2.values, config), + }; + } + return config?.convertExtensions + ? { + ...e1, + kind: graphql_1.Kind.ENUM_TYPE_DEFINITION, + } + : e1; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/fields.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/fields.js new file mode 100644 index 00000000..a0f0123d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/fields.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeFields = mergeFields; +const utils_1 = require("@graphql-tools/utils"); +const arguments_js_1 = require("./arguments.js"); +const directives_js_1 = require("./directives.js"); +const utils_js_1 = require("./utils.js"); +function fieldAlreadyExists(fieldsArr, otherField) { + const resultIndex = fieldsArr.findIndex(field => field.name.value === otherField.name.value); + return [resultIndex > -1 ? fieldsArr[resultIndex] : null, resultIndex]; +} +function mergeFields(type, f1, f2, config, directives) { + const result = []; + if (f2 != null) { + result.push(...f2); + } + if (f1 != null) { + for (const field of f1) { + const [existing, existingIndex] = fieldAlreadyExists(result, field); + if (existing && !config?.ignoreFieldConflicts) { + const newField = (config?.onFieldTypeConflict && + config.onFieldTypeConflict(existing, field, type, config?.throwOnConflict)) || + preventConflicts(type, existing, field, config?.throwOnConflict); + newField.arguments = (0, arguments_js_1.mergeArguments)(field['arguments'] || [], existing['arguments'] || [], config); + newField.directives = (0, directives_js_1.mergeDirectives)(field.directives, existing.directives, config, directives); + newField.description = field.description || existing.description; + result[existingIndex] = newField; + } + else { + result.push(field); + } + } + } + if (config && config.sort) { + result.sort(utils_1.compareNodes); + } + if (config && config.exclusions) { + const exclusions = config.exclusions; + return result.filter(field => !exclusions.includes(`${type.name.value}.${field.name.value}`)); + } + return result; +} +function preventConflicts(type, a, b, ignoreNullability = false) { + const aType = (0, utils_js_1.printTypeNode)(a.type); + const bType = (0, utils_js_1.printTypeNode)(b.type); + if (aType !== bType) { + const t1 = (0, utils_js_1.extractType)(a.type); + const t2 = (0, utils_js_1.extractType)(b.type); + if (t1.name.value !== t2.name.value) { + throw new Error(`Field "${b.name.value}" already defined with a different type. Declared as "${t1.name.value}", but you tried to override with "${t2.name.value}"`); + } + if (!safeChangeForFieldType(a.type, b.type, !ignoreNullability)) { + throw new Error(`Field '${type.name.value}.${a.name.value}' changed type from '${aType}' to '${bType}'`); + } + } + if ((0, utils_js_1.isNonNullTypeNode)(b.type) && !(0, utils_js_1.isNonNullTypeNode)(a.type)) { + a.type = b.type; + } + return a; +} +function safeChangeForFieldType(oldType, newType, ignoreNullability = false) { + // both are named + if (!(0, utils_js_1.isWrappingTypeNode)(oldType) && !(0, utils_js_1.isWrappingTypeNode)(newType)) { + return oldType.toString() === newType.toString(); + } + // new is non-null + if ((0, utils_js_1.isNonNullTypeNode)(newType)) { + const ofType = (0, utils_js_1.isNonNullTypeNode)(oldType) ? oldType.type : oldType; + return safeChangeForFieldType(ofType, newType.type); + } + // old is non-null + if ((0, utils_js_1.isNonNullTypeNode)(oldType)) { + return safeChangeForFieldType(newType, oldType, ignoreNullability); + } + // old is list + if ((0, utils_js_1.isListTypeNode)(oldType)) { + return (((0, utils_js_1.isListTypeNode)(newType) && safeChangeForFieldType(oldType.type, newType.type)) || + ((0, utils_js_1.isNonNullTypeNode)(newType) && safeChangeForFieldType(oldType, newType['type']))); + } + return false; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/index.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/index.js new file mode 100644 index 00000000..5dcc7e64 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./arguments.js"), exports); +tslib_1.__exportStar(require("./directives.js"), exports); +tslib_1.__exportStar(require("./enum-values.js"), exports); +tslib_1.__exportStar(require("./enum.js"), exports); +tslib_1.__exportStar(require("./fields.js"), exports); +tslib_1.__exportStar(require("./input-type.js"), exports); +tslib_1.__exportStar(require("./interface.js"), exports); +tslib_1.__exportStar(require("./merge-named-type-array.js"), exports); +tslib_1.__exportStar(require("./merge-nodes.js"), exports); +tslib_1.__exportStar(require("./merge-typedefs.js"), exports); +tslib_1.__exportStar(require("./scalar.js"), exports); +tslib_1.__exportStar(require("./type.js"), exports); +tslib_1.__exportStar(require("./union.js"), exports); +tslib_1.__exportStar(require("./utils.js"), exports); diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/input-type.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/input-type.js new file mode 100644 index 00000000..aa16a71b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/input-type.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeInputType = mergeInputType; +const graphql_1 = require("graphql"); +const directives_js_1 = require("./directives.js"); +const fields_js_1 = require("./fields.js"); +function mergeInputType(node, existingNode, config, directives) { + if (existingNode) { + try { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'InputObjectTypeDefinition' || + existingNode.kind === 'InputObjectTypeDefinition' + ? 'InputObjectTypeDefinition' + : 'InputObjectTypeExtension', + loc: node.loc, + fields: (0, fields_js_1.mergeFields)(node, node.fields, existingNode.fields, config), + directives: (0, directives_js_1.mergeDirectives)(node.directives, existingNode.directives, config, directives), + }; + } + catch (e) { + throw new Error(`Unable to merge GraphQL input type "${node.name.value}": ${e.message}`); + } + } + return config?.convertExtensions + ? { + ...node, + kind: graphql_1.Kind.INPUT_OBJECT_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/interface.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/interface.js new file mode 100644 index 00000000..3878c3e4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/interface.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeInterface = mergeInterface; +const graphql_1 = require("graphql"); +const directives_js_1 = require("./directives.js"); +const fields_js_1 = require("./fields.js"); +const merge_named_type_array_js_1 = require("./merge-named-type-array.js"); +function mergeInterface(node, existingNode, config, directives) { + if (existingNode) { + try { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'InterfaceTypeDefinition' || + existingNode.kind === 'InterfaceTypeDefinition' + ? 'InterfaceTypeDefinition' + : 'InterfaceTypeExtension', + loc: node.loc, + fields: (0, fields_js_1.mergeFields)(node, node.fields, existingNode.fields, config, directives), + directives: (0, directives_js_1.mergeDirectives)(node.directives, existingNode.directives, config, directives), + interfaces: node['interfaces'] + ? (0, merge_named_type_array_js_1.mergeNamedTypeArray)(node['interfaces'], existingNode['interfaces'], config) + : undefined, + }; + } + catch (e) { + throw new Error(`Unable to merge GraphQL interface "${node.name.value}": ${e.message}`); + } + } + return config?.convertExtensions + ? { + ...node, + kind: graphql_1.Kind.INTERFACE_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-named-type-array.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-named-type-array.js new file mode 100644 index 00000000..ca97aee2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-named-type-array.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeNamedTypeArray = mergeNamedTypeArray; +const utils_1 = require("@graphql-tools/utils"); +function alreadyExists(arr, other) { + return !!arr.find(i => i.name.value === other.name.value); +} +function mergeNamedTypeArray(first = [], second = [], config = {}) { + const result = [...second, ...first.filter(d => !alreadyExists(second, d))]; + if (config && config.sort) { + result.sort(utils_1.compareNodes); + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-nodes.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-nodes.js new file mode 100644 index 00000000..5b1e4a8e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-nodes.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.schemaDefSymbol = void 0; +exports.isNamedDefinitionNode = isNamedDefinitionNode; +exports.mergeGraphQLNodes = mergeGraphQLNodes; +const graphql_1 = require("graphql"); +const utils_1 = require("@graphql-tools/utils"); +const directives_js_1 = require("./directives.js"); +const enum_js_1 = require("./enum.js"); +const input_type_js_1 = require("./input-type.js"); +const interface_js_1 = require("./interface.js"); +const scalar_js_1 = require("./scalar.js"); +const schema_def_js_1 = require("./schema-def.js"); +const type_js_1 = require("./type.js"); +const union_js_1 = require("./union.js"); +exports.schemaDefSymbol = 'SCHEMA_DEF_SYMBOL'; +function isNamedDefinitionNode(definitionNode) { + return 'name' in definitionNode; +} +function mergeGraphQLNodes(nodes, config, directives = {}) { + const mergedResultMap = directives; + for (const nodeDefinition of nodes) { + if (isNamedDefinitionNode(nodeDefinition)) { + const name = nodeDefinition.name?.value; + if (config?.commentDescriptions) { + (0, utils_1.collectComment)(nodeDefinition); + } + if (name == null) { + continue; + } + if (config?.exclusions?.includes(name + '.*') || config?.exclusions?.includes(name)) { + delete mergedResultMap[name]; + } + else { + switch (nodeDefinition.kind) { + case graphql_1.Kind.OBJECT_TYPE_DEFINITION: + case graphql_1.Kind.OBJECT_TYPE_EXTENSION: + mergedResultMap[name] = (0, type_js_1.mergeType)(nodeDefinition, mergedResultMap[name], config, directives); + break; + case graphql_1.Kind.ENUM_TYPE_DEFINITION: + case graphql_1.Kind.ENUM_TYPE_EXTENSION: + mergedResultMap[name] = (0, enum_js_1.mergeEnum)(nodeDefinition, mergedResultMap[name], config, directives); + break; + case graphql_1.Kind.UNION_TYPE_DEFINITION: + case graphql_1.Kind.UNION_TYPE_EXTENSION: + mergedResultMap[name] = (0, union_js_1.mergeUnion)(nodeDefinition, mergedResultMap[name], config, directives); + break; + case graphql_1.Kind.SCALAR_TYPE_DEFINITION: + case graphql_1.Kind.SCALAR_TYPE_EXTENSION: + mergedResultMap[name] = (0, scalar_js_1.mergeScalar)(nodeDefinition, mergedResultMap[name], config, directives); + break; + case graphql_1.Kind.INPUT_OBJECT_TYPE_DEFINITION: + case graphql_1.Kind.INPUT_OBJECT_TYPE_EXTENSION: + mergedResultMap[name] = (0, input_type_js_1.mergeInputType)(nodeDefinition, mergedResultMap[name], config, directives); + break; + case graphql_1.Kind.INTERFACE_TYPE_DEFINITION: + case graphql_1.Kind.INTERFACE_TYPE_EXTENSION: + mergedResultMap[name] = (0, interface_js_1.mergeInterface)(nodeDefinition, mergedResultMap[name], config, directives); + break; + case graphql_1.Kind.DIRECTIVE_DEFINITION: + if (mergedResultMap[name]) { + const isInheritedFromPrototype = name in {}; // i.e. toString + if (isInheritedFromPrototype) { + if (!isASTNode(mergedResultMap[name])) { + mergedResultMap[name] = undefined; + } + } + } + mergedResultMap[name] = (0, directives_js_1.mergeDirective)(nodeDefinition, mergedResultMap[name]); + break; + } + } + } + else if (nodeDefinition.kind === graphql_1.Kind.SCHEMA_DEFINITION || + nodeDefinition.kind === graphql_1.Kind.SCHEMA_EXTENSION) { + mergedResultMap[exports.schemaDefSymbol] = (0, schema_def_js_1.mergeSchemaDefs)(nodeDefinition, mergedResultMap[exports.schemaDefSymbol], config, directives); + } + } + return mergedResultMap; +} +function isASTNode(node) { + return (node != null && typeof node === 'object' && 'kind' in node && typeof node.kind === 'string'); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-typedefs.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-typedefs.js new file mode 100644 index 00000000..afc92487 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/merge-typedefs.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeTypeDefs = mergeTypeDefs; +exports.mergeGraphQLTypes = mergeGraphQLTypes; +const graphql_1 = require("graphql"); +const utils_1 = require("@graphql-tools/utils"); +const links_js_1 = require("../links.js"); +const merge_nodes_js_1 = require("./merge-nodes.js"); +const schema_def_js_1 = require("./schema-def.js"); +const utils_js_1 = require("./utils.js"); +function mergeTypeDefs(typeSource, config) { + (0, utils_1.resetComments)(); + const doc = { + kind: graphql_1.Kind.DOCUMENT, + definitions: mergeGraphQLTypes(typeSource, { + useSchemaDefinition: true, + forceSchemaDefinition: false, + throwOnConflict: false, + commentDescriptions: false, + ...config, + }), + }; + let result; + if (config?.commentDescriptions) { + result = (0, utils_1.printWithComments)(doc); + } + else { + result = doc; + } + (0, utils_1.resetComments)(); + return result; +} +function visitTypeSources(typeSource, options, allDirectives = [], allNodes = [], visitedTypeSources = new Set(), repeatableLinkImports = new Set()) { + const addRepeatable = (name) => { + repeatableLinkImports.add(name); + }; + if (typeSource && !visitedTypeSources.has(typeSource)) { + visitedTypeSources.add(typeSource); + if (typeof typeSource === 'function') { + visitTypeSources(typeSource(), options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else if (Array.isArray(typeSource)) { + for (const type of typeSource) { + visitTypeSources(type, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + } + else if ((0, graphql_1.isSchema)(typeSource)) { + const documentNode = (0, utils_1.getDocumentNodeFromSchema)(typeSource, options); + visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else if ((0, utils_js_1.isStringTypes)(typeSource) || (0, utils_js_1.isSourceTypes)(typeSource)) { + const documentNode = (0, graphql_1.parse)(typeSource, options); + visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else if (typeof typeSource === 'object' && (0, graphql_1.isDefinitionNode)(typeSource)) { + const links = (0, links_js_1.extractLinks)({ + definitions: [typeSource], + kind: graphql_1.Kind.DOCUMENT, + }); + const federationUrl = 'https://specs.apollo.dev/federation'; + const linkUrl = 'https://specs.apollo.dev/link'; + /** + * Official Federated imports are special because they can be referenced without specifyin the import. + * To handle this case, we must prepare a list of all the possible valid usages to check against. + * Note that this versioning is not technically correct, since some definitions are after v2.0. + * But this is enough information to be comfortable not blocking the imports at this phase. It's + * the job of the composer to validate the versions. + * */ + const federationLink = links.find(l => l.url.identity === federationUrl); + if (federationLink) { + addRepeatable((0, links_js_1.resolveImportName)(federationLink, '@composeDirective')); + addRepeatable((0, links_js_1.resolveImportName)(federationLink, '@key')); + } + const linkLink = links.find(l => l.url.identity === linkUrl); + if (linkLink) { + addRepeatable((0, links_js_1.resolveImportName)(linkLink, '@link')); + } + if (typeSource.kind === graphql_1.Kind.DIRECTIVE_DEFINITION) { + allDirectives.push(typeSource); + } + else { + allNodes.push(typeSource); + } + } + else if ((0, utils_1.isDocumentNode)(typeSource)) { + visitTypeSources(typeSource.definitions, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else { + throw new Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof typeSource}`); + } + } + return { allDirectives, allNodes, repeatableLinkImports }; +} +function mergeGraphQLTypes(typeSource, config) { + (0, utils_1.resetComments)(); + const { allDirectives, allNodes, repeatableLinkImports } = visitTypeSources(typeSource, config); + const mergedDirectives = (0, merge_nodes_js_1.mergeGraphQLNodes)(allDirectives, config); + config.repeatableLinkImports = repeatableLinkImports; + const mergedNodes = (0, merge_nodes_js_1.mergeGraphQLNodes)(allNodes, config, mergedDirectives); + if (config?.useSchemaDefinition) { + // XXX: right now we don't handle multiple schema definitions + const schemaDef = mergedNodes[merge_nodes_js_1.schemaDefSymbol] || { + kind: graphql_1.Kind.SCHEMA_DEFINITION, + operationTypes: [], + }; + // graphql@17 leaves `operationTypes` undefined on schema extensions, so the default operation + // types have to be written back onto the node instead of into a detached array. + const mutableSchemaDef = schemaDef; + const operationTypes = (mutableSchemaDef.operationTypes ??= []); + for (const opTypeDefNodeType in schema_def_js_1.DEFAULT_OPERATION_TYPE_NAME_MAP) { + const opTypeDefNode = operationTypes.find(operationType => operationType.operation === opTypeDefNodeType); + if (!opTypeDefNode) { + const possibleRootTypeName = schema_def_js_1.DEFAULT_OPERATION_TYPE_NAME_MAP[opTypeDefNodeType]; + const existingPossibleRootType = mergedNodes[possibleRootTypeName]; + if (existingPossibleRootType != null && existingPossibleRootType.name != null) { + operationTypes.push({ + kind: graphql_1.Kind.OPERATION_TYPE_DEFINITION, + type: { + kind: graphql_1.Kind.NAMED_TYPE, + name: existingPossibleRootType.name, + }, + operation: opTypeDefNodeType, + }); + } + } + } + if (schemaDef?.operationTypes?.length != null && schemaDef.operationTypes.length > 0) { + mergedNodes[merge_nodes_js_1.schemaDefSymbol] = schemaDef; + } + } + if (config?.forceSchemaDefinition && !mergedNodes[merge_nodes_js_1.schemaDefSymbol]?.operationTypes?.length) { + mergedNodes[merge_nodes_js_1.schemaDefSymbol] = { + kind: graphql_1.Kind.SCHEMA_DEFINITION, + operationTypes: [ + { + kind: graphql_1.Kind.OPERATION_TYPE_DEFINITION, + operation: 'query', + type: { + kind: graphql_1.Kind.NAMED_TYPE, + name: { + kind: graphql_1.Kind.NAME, + value: 'Query', + }, + }, + }, + ], + }; + } + const mergedNodeDefinitions = Object.values(mergedNodes); + if (config?.sort) { + const sortFn = typeof config.sort === 'function' ? config.sort : utils_js_1.defaultStringComparator; + mergedNodeDefinitions.sort((a, b) => sortFn(a.name?.value, b.name?.value)); + } + return mergedNodeDefinitions; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/scalar.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/scalar.js new file mode 100644 index 00000000..d7b7b923 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/scalar.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeScalar = mergeScalar; +const graphql_1 = require("graphql"); +const directives_js_1 = require("./directives.js"); +function mergeScalar(node, existingNode, config, directives) { + if (existingNode) { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'ScalarTypeDefinition' || + existingNode.kind === 'ScalarTypeDefinition' + ? 'ScalarTypeDefinition' + : 'ScalarTypeExtension', + loc: node.loc, + directives: (0, directives_js_1.mergeDirectives)(node.directives, existingNode.directives, config, directives), + }; + } + return config?.convertExtensions + ? { + ...node, + kind: graphql_1.Kind.SCALAR_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/schema-def.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/schema-def.js new file mode 100644 index 00000000..f36adfcf --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/schema-def.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_OPERATION_TYPE_NAME_MAP = void 0; +exports.mergeSchemaDefs = mergeSchemaDefs; +const graphql_1 = require("graphql"); +const directives_js_1 = require("./directives.js"); +exports.DEFAULT_OPERATION_TYPE_NAME_MAP = { + query: 'Query', + mutation: 'Mutation', + subscription: 'Subscription', +}; +function mergeOperationTypes(opNodeList = [], existingOpNodeList = []) { + const finalOpNodeList = []; + for (const opNodeType in exports.DEFAULT_OPERATION_TYPE_NAME_MAP) { + const opNode = opNodeList.find(n => n.operation === opNodeType) || + existingOpNodeList.find(n => n.operation === opNodeType); + if (opNode) { + finalOpNodeList.push(opNode); + } + } + return finalOpNodeList; +} +function mergeSchemaDefs(node, existingNode, config, directives) { + if (existingNode) { + return { + kind: node.kind === graphql_1.Kind.SCHEMA_DEFINITION || existingNode.kind === graphql_1.Kind.SCHEMA_DEFINITION + ? graphql_1.Kind.SCHEMA_DEFINITION + : graphql_1.Kind.SCHEMA_EXTENSION, + description: node['description'] || existingNode['description'], + directives: (0, directives_js_1.mergeDirectives)(node.directives, existingNode.directives, config, directives), + operationTypes: mergeOperationTypes(node.operationTypes, existingNode.operationTypes), + }; + } + return (config?.convertExtensions + ? { + ...node, + kind: graphql_1.Kind.SCHEMA_DEFINITION, + } + : node); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/type.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/type.js new file mode 100644 index 00000000..c5821b41 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/type.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeType = mergeType; +const graphql_1 = require("graphql"); +const directives_js_1 = require("./directives.js"); +const fields_js_1 = require("./fields.js"); +const merge_named_type_array_js_1 = require("./merge-named-type-array.js"); +function mergeType(node, existingNode, config, directives) { + if (existingNode) { + try { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'ObjectTypeDefinition' || + existingNode.kind === 'ObjectTypeDefinition' + ? 'ObjectTypeDefinition' + : 'ObjectTypeExtension', + loc: node.loc, + fields: (0, fields_js_1.mergeFields)(node, node.fields, existingNode.fields, config, directives), + directives: (0, directives_js_1.mergeDirectives)(node.directives, existingNode.directives, config, directives), + interfaces: (0, merge_named_type_array_js_1.mergeNamedTypeArray)(node.interfaces, existingNode.interfaces, config), + }; + } + catch (e) { + throw new Error(`Unable to merge GraphQL type "${node.name.value}": ${e.message}`); + } + } + return config?.convertExtensions + ? { + ...node, + kind: graphql_1.Kind.OBJECT_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/union.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/union.js new file mode 100644 index 00000000..8704a161 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/union.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeUnion = mergeUnion; +const graphql_1 = require("graphql"); +const directives_js_1 = require("./directives.js"); +const merge_named_type_array_js_1 = require("./merge-named-type-array.js"); +function mergeUnion(first, second, config, directives) { + if (second) { + return { + name: first.name, + description: first['description'] || second['description'], + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: (0, directives_js_1.mergeDirectives)(first.directives, second.directives, config, directives), + kind: config?.convertExtensions || + first.kind === 'UnionTypeDefinition' || + second.kind === 'UnionTypeDefinition' + ? graphql_1.Kind.UNION_TYPE_DEFINITION + : graphql_1.Kind.UNION_TYPE_EXTENSION, + loc: first.loc, + types: (0, merge_named_type_array_js_1.mergeNamedTypeArray)(first.types, second.types, config), + }; + } + return config?.convertExtensions + ? { + ...first, + kind: graphql_1.Kind.UNION_TYPE_DEFINITION, + } + : first; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/utils.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/utils.js new file mode 100644 index 00000000..05e11624 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/cjs/typedefs-mergers/utils.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CompareVal = void 0; +exports.isStringTypes = isStringTypes; +exports.isSourceTypes = isSourceTypes; +exports.extractType = extractType; +exports.isWrappingTypeNode = isWrappingTypeNode; +exports.isListTypeNode = isListTypeNode; +exports.isNonNullTypeNode = isNonNullTypeNode; +exports.printTypeNode = printTypeNode; +exports.defaultStringComparator = defaultStringComparator; +const graphql_1 = require("graphql"); +function isStringTypes(types) { + return typeof types === 'string'; +} +function isSourceTypes(types) { + return types instanceof graphql_1.Source; +} +function extractType(type) { + let visitedType = type; + while (visitedType.kind === graphql_1.Kind.LIST_TYPE || visitedType.kind === 'NonNullType') { + visitedType = visitedType.type; + } + return visitedType; +} +function isWrappingTypeNode(type) { + return type.kind !== graphql_1.Kind.NAMED_TYPE; +} +function isListTypeNode(type) { + return type.kind === graphql_1.Kind.LIST_TYPE; +} +function isNonNullTypeNode(type) { + return type.kind === graphql_1.Kind.NON_NULL_TYPE; +} +function printTypeNode(type) { + if (isListTypeNode(type)) { + return `[${printTypeNode(type.type)}]`; + } + if (isNonNullTypeNode(type)) { + return `${printTypeNode(type.type)}!`; + } + return type.name.value; +} +var CompareVal; +(function (CompareVal) { + CompareVal[CompareVal["A_SMALLER_THAN_B"] = -1] = "A_SMALLER_THAN_B"; + CompareVal[CompareVal["A_EQUALS_B"] = 0] = "A_EQUALS_B"; + CompareVal[CompareVal["A_GREATER_THAN_B"] = 1] = "A_GREATER_THAN_B"; +})(CompareVal || (exports.CompareVal = CompareVal = {})); +function defaultStringComparator(a, b) { + if (a == null && b == null) { + return CompareVal.A_EQUALS_B; + } + if (a == null) { + return CompareVal.A_SMALLER_THAN_B; + } + if (b == null) { + return CompareVal.A_GREATER_THAN_B; + } + if (a < b) + return CompareVal.A_SMALLER_THAN_B; + if (a > b) + return CompareVal.A_GREATER_THAN_B; + return CompareVal.A_EQUALS_B; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/extensions.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/extensions.js new file mode 100644 index 00000000..14b1b9d8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/extensions.js @@ -0,0 +1,48 @@ +import { mergeDeep } from '@graphql-tools/utils'; +export { extractExtensionsFromSchema } from '@graphql-tools/utils'; +export function mergeExtensions(extensions) { + return mergeDeep(extensions, false, true); +} +function applyExtensionObject(obj, extensions) { + if (!obj || !extensions || extensions === obj.extensions) { + return; + } + if (!obj.extensions) { + obj.extensions = extensions; + return; + } + obj.extensions = mergeDeep([obj.extensions, extensions], false, true); +} +export function applyExtensions(schema, extensions) { + applyExtensionObject(schema, extensions.schemaExtensions); + for (const [typeName, data] of Object.entries(extensions.types || {})) { + const type = schema.getType(typeName); + if (type) { + applyExtensionObject(type, data.extensions); + if (data.type === 'object' || data.type === 'interface') { + for (const [fieldName, fieldData] of Object.entries(data.fields)) { + const field = type.getFields()[fieldName]; + if (field) { + applyExtensionObject(field, fieldData.extensions); + for (const [arg, argData] of Object.entries(fieldData.arguments)) { + applyExtensionObject(field.args.find(a => a.name === arg), argData); + } + } + } + } + else if (data.type === 'input') { + for (const [fieldName, fieldData] of Object.entries(data.fields)) { + const field = type.getFields()[fieldName]; + applyExtensionObject(field, fieldData.extensions); + } + } + else if (data.type === 'enum') { + for (const [valueName, valueData] of Object.entries(data.values)) { + const value = type.getValue(valueName); + applyExtensionObject(value, valueData); + } + } + } + } + return schema; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/index.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/index.js new file mode 100644 index 00000000..0cf56486 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/index.js @@ -0,0 +1,3 @@ +export * from './merge-resolvers.js'; +export * from './typedefs-mergers/index.js'; +export * from './extensions.js'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/links.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/links.js new file mode 100644 index 00000000..19cd3275 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/links.js @@ -0,0 +1,158 @@ +/** + * A simplified, GraphQL v15 compatible version of + * https://github.com/graphql-hive/federation-composition/blob/main/src/utils/link/index.ts + * that does not provide the same safeguards or functionality, but still can determine the + * correct name of an linked resource. + */ +import { Kind, } from 'graphql'; +function namespace(link) { + return link.as ?? link.url.name; +} +function defaultImport(link) { + const name = namespace(link); + return name && `@${name}`; +} +export function resolveImportName(link, elementName) { + if (link.url.name && elementName === `@${link.url.name}`) { + // @note: default is a directive... So remove the `@` + return defaultImport(link).substring(1); + } + const imported = link.imports.find(i => i.name === elementName); + const resolvedName = imported?.as ?? imported?.name ?? namespaced(namespace(link), elementName); + // Strip the `@` prefix for directives because in all implementations of mapping or visiting a schema, + // directive names are not prefixed with `@`. The `@` is only for SDL. + return resolvedName.startsWith('@') ? resolvedName.substring(1) : resolvedName; +} +function namespaced(namespace, name) { + if (namespace?.length) { + if (name.startsWith('@')) { + return `@${namespace}__${name.substring(1)}`; + } + return `${namespace}__${name}`; + } + return name; +} +export function extractLinks(typeDefs) { + let links = []; + for (const definition of typeDefs.definitions) { + if (definition.kind === Kind.SCHEMA_EXTENSION || definition.kind === Kind.SCHEMA_DEFINITION) { + const defLinks = definition.directives?.filter(directive => directive.name.value === 'link'); + const parsedLinks = defLinks?.map(l => linkFromArgs(l.arguments ?? [])).filter(l => l !== undefined) ?? []; + links = links.concat(parsedLinks); + // Federation 1 support... Federation 1 uses "@core" instead of "@link", but behavior is similar enough that + // it can be translated. + const defCores = definition.directives?.filter(({ name }) => name.value === 'core'); + const coreLinks = defCores + ?.map(c => linkFromCoreArgs(c.arguments ?? [])) + .filter(l => l !== undefined); + if (coreLinks) { + links = links.concat(...coreLinks); + } + } + } + return links; +} +function linkFromArgs(args) { + let url; + let imports = []; + let as; + for (const arg of args) { + switch (arg.name.value) { + case 'url': { + if (arg.value.kind === Kind.STRING) { + url = parseFederationLinkUrl(arg.value.value); + } + break; + } + case 'import': { + imports = parseImportNode(arg.value); + break; + } + case 'as': { + if (arg.value.kind === Kind.STRING) { + as = arg.value.value ?? undefined; + } + break; + } + default: { + // ignore. It's not the job of this package to validate. Federation should validate links. + } + } + } + if (url !== undefined) { + return { + url, + as, + imports, + }; + } +} +/** + * Supports federation 1 + */ +function linkFromCoreArgs(args) { + const feature = args.find(({ name, value }) => name.value === 'feature' && value.kind === Kind.STRING); + if (feature) { + const url = parseFederationLinkUrl(feature.value.value); + return { + url, + imports: [], + }; + } +} +function parseImportNode(node) { + if (node.kind === Kind.LIST) { + const imports = node.values.map((v) => { + let namedImport; + if (v.kind === Kind.STRING) { + namedImport = { name: v.value }; + } + else if (v.kind === Kind.OBJECT) { + let name = ''; + let as; + for (const f of v.fields) { + if (f.name.value === 'name') { + if (f.value.kind === Kind.STRING) { + name = f.value.value; + } + } + else if (f.name.value === 'as') { + if (f.value.kind === Kind.STRING) { + as = f.value.value; + } + } + } + namedImport = { name, as }; + } + return namedImport; + }); + return imports.filter(i => i !== undefined); + } + return []; +} +const VERSION_MATCH = /v(\d{1,3})\.(\d{1,4})/i; +function parseFederationLinkUrl(urlSource) { + const url = new URL(urlSource); + const parts = url.pathname.split('/').filter(Boolean); + const versionOrName = parts[parts.length - 1]; + if (versionOrName) { + if (VERSION_MATCH.test(versionOrName)) { + const maybeName = parts[parts.length - 2]; + return { + identity: url.origin + (maybeName ? `/${parts.slice(0, parts.length - 1).join('/')}` : ''), + name: maybeName ?? null, + version: versionOrName, + }; + } + return { + identity: `${url.origin}/${parts.join('/')}`, + name: versionOrName, + version: null, + }; + } + return { + identity: url.origin, + name: null, + version: null, + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/merge-resolvers.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/merge-resolvers.js new file mode 100644 index 00000000..aa042062 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/merge-resolvers.js @@ -0,0 +1,68 @@ +import { mergeDeep } from '@graphql-tools/utils'; +/** + * Deep merges multiple resolver definition objects into a single definition. + * @param resolversDefinitions Resolver definitions to be merged + * @param options Additional options + * + * ```js + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const clientResolver = require('./clientResolver'); + * const productResolver = require('./productResolver'); + * + * const resolvers = mergeResolvers([ + * clientResolver, + * productResolver, + * ]); + * ``` + * + * If you don't want to manually create the array of resolver objects, you can + * also use this function along with loadFiles: + * + * ```js + * const path = require('path'); + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const { loadFilesSync } = require('@graphql-tools/load-files'); + * + * const resolversArray = loadFilesSync(path.join(__dirname, './resolvers')); + * + * const resolvers = mergeResolvers(resolversArray) + * ``` + */ +export function mergeResolvers(resolversDefinitions, options) { + if (!resolversDefinitions || + (Array.isArray(resolversDefinitions) && resolversDefinitions.length === 0)) { + return {}; + } + if (!Array.isArray(resolversDefinitions)) { + return resolversDefinitions; + } + if (resolversDefinitions.length === 1) { + return resolversDefinitions[0] || {}; + } + const resolvers = new Array(); + for (let resolversDefinition of resolversDefinitions) { + if (Array.isArray(resolversDefinition)) { + resolversDefinition = mergeResolvers(resolversDefinition); + } + if (typeof resolversDefinition === 'object' && resolversDefinition) { + resolvers.push(resolversDefinition); + } + } + const result = mergeDeep(resolvers, true); + if (options?.exclusions) { + for (const exclusion of options.exclusions) { + const [typeName, fieldName] = exclusion.split('.'); + if (['__proto__', 'constructor', 'prototype'].includes(typeName) || + ['__proto__', 'constructor', 'prototype'].includes(fieldName)) { + continue; + } + if (!fieldName || fieldName === '*') { + delete result[typeName]; + } + else if (result[typeName]) { + delete result[typeName][fieldName]; + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js new file mode 100644 index 00000000..0c8931a8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js @@ -0,0 +1,20 @@ +import { compareNodes, isSome } from '@graphql-tools/utils'; +export function mergeArguments(args1, args2, config) { + const result = deduplicateArguments([...args2, ...args1].filter(isSome), config); + if (config && config.sort) { + result.sort(compareNodes); + } + return result; +} +function deduplicateArguments(args, config) { + return args.reduce((acc, current) => { + const dupIndex = acc.findIndex(arg => arg.name.value === current.name.value); + if (dupIndex === -1) { + return acc.concat([current]); + } + else if (!config?.reverseArguments) { + acc[dupIndex] = current; + } + return acc; + }, []); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js new file mode 100644 index 00000000..7f995f19 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js @@ -0,0 +1,168 @@ +import { Kind, } from 'graphql'; +function collectMultiInstanceDirectiveNames(directiveNodes) { + const seen = new Set(); + const multi = new Set(); + for (const directive of directiveNodes) { + const name = directive.name.value; + if (seen.has(name)) { + multi.add(name); + } + else { + seen.add(name); + } + } + return multi; +} +function isRepeatableDirective(directive, directives, repeatableLinkImports, inferredRepeatable) { + const directiveDef = directives?.[directive.name.value]; + if (directiveDef) { + return !!directiveDef.repeatable; + } + return !!(repeatableLinkImports?.has(directive.name.value) || + inferredRepeatable?.has(directive.name.value)); +} +function nameAlreadyExists(name, namesArr) { + return namesArr.some(({ value }) => value === name.value); +} +function mergeArguments(a1, a2) { + const result = []; + for (const argument of [...a2, ...a1]) { + const existingIndex = result.findIndex(a => a.name.value === argument.name.value); + if (existingIndex === -1) { + result.push(argument); + } + else { + const existingArg = result[existingIndex]; + if (existingArg.value.kind === 'ListValue') { + const source = existingArg.value.values; + const target = argument.value.values; + // merge values of two lists + existingArg.value = { + ...existingArg.value, + values: deduplicateLists(source, target, (targetVal, source) => { + const value = targetVal.value; + return !value || !source.some((sourceVal) => sourceVal.value === value); + }), + }; + } + else { + existingArg.value = argument.value; + } + } + } + return result; +} +const matchValues = (a, b) => { + if (a.kind === b.kind) { + switch (a.kind) { + case Kind.LIST: + return (a.values.length === b.values.length && + a.values.every(aVal => b.values.find(bVal => matchValues(aVal, bVal)))); + case Kind.VARIABLE: + case Kind.NULL: + return true; + case Kind.OBJECT: + return (a.fields.length === b.fields.length && + a.fields.every(aField => b.fields.find(bField => aField.name.value === bField.name.value && matchValues(aField.value, bField.value)))); + default: + return a.value === b.value; + } + } + return false; +}; +const isLinkDirective = (directive) => directive.name.value === 'link'; +const getLinkDirectiveURL = (directive) => { + const stringValue = isLinkDirective(directive) + ? directive.arguments?.find(arg => arg.name.value === 'url')?.value + : undefined; + return stringValue?.kind === 'StringValue' ? stringValue.value : undefined; +}; +const matchArguments = (a, b) => a.name.value === b.name.value && a.value.kind === b.value.kind && matchValues(a.value, b.value); +/** + * Check if a directive is an exact match of another directive based on their + * arguments. + */ +const matchDirectives = (a, b) => { + const matched = a.name.value === b.name.value && + (a.arguments === b.arguments || + (a.arguments?.length === b.arguments?.length && + a.arguments?.every(argA => b.arguments?.find(argB => matchArguments(argA, argB))))); + return !!matched; +}; +export function mergeDirectives(d1 = [], d2 = [], config, directives) { + const reverseOrder = config && config.reverseDirectives; + const asNext = reverseOrder ? d1 : d2; + const asFirst = reverseOrder ? d2 : d1; + // When a type already has multiple applications of the same directive name and the + // other merge input has none (typical when extending a type), treat that name as + // repeatable if no directive definition is available — otherwise those applications + // are collapsed while re-merging the type's own directives (#6505). + // Only infer when the other side has zero applications so legitimate merges of the + // same directive from two documents (e.g. @link import lists) still combine. + const d1Names = new Set(d1.map(directive => directive.name.value)); + const d2Names = new Set(d2.map(directive => directive.name.value)); + const inferredRepeatable = new Set(); + for (const name of collectMultiInstanceDirectiveNames(d1)) { + if (!d2Names.has(name)) { + inferredRepeatable.add(name); + } + } + for (const name of collectMultiInstanceDirectiveNames(d2)) { + if (!d1Names.has(name)) { + inferredRepeatable.add(name); + } + } + const result = []; + for (const directive of [...asNext, ...asFirst]) { + if (isRepeatableDirective(directive, directives, config?.repeatableLinkImports, inferredRepeatable)) { + // look for repeated, identical directives that come before this instance + // if those exist, return null so that this directive gets removed. + const exactDuplicate = result.find(d => matchDirectives(directive, d)); + if (!exactDuplicate) { + result.push(directive); + } + } + else { + const firstAt = result.findIndex(d => d.name.value === directive.name.value); + if (firstAt === -1) { + // if did not find a directive with this name on the result set already + result.push(directive); + } + else { + if (isLinkDirective(directive) && isLinkDirective(result[firstAt])) { + const url1 = getLinkDirectiveURL(directive); + const url2 = getLinkDirectiveURL(result[firstAt]); + // if both are link directives but with different urls, do not merge them + if (url1 && url2 && url1 !== url2) { + result.push(directive); + continue; + } + } + // if not repeatable and found directive with the same name already in the result set, + // then merge the arguments of the existing directive and the new directive + const mergedArguments = mergeArguments(directive.arguments ?? [], result[firstAt].arguments ?? []); + result[firstAt] = { + ...result[firstAt], + arguments: mergedArguments.length === 0 ? undefined : mergedArguments, + }; + } + } + } + return result; +} +export function mergeDirective(node, existingNode) { + if (existingNode) { + return { + ...node, + arguments: deduplicateLists(existingNode.arguments || [], node.arguments || [], (arg, existingArgs) => !nameAlreadyExists(arg.name, existingArgs.map(a => a.name))), + locations: [ + ...existingNode.locations, + ...node.locations.filter(name => !nameAlreadyExists(name, existingNode.locations)), + ], + }; + } + return node; +} +function deduplicateLists(source, target, filterFn) { + return source.concat(target.filter(val => filterFn(val, source))); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum-values.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum-values.js new file mode 100644 index 00000000..ec563070 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum-values.js @@ -0,0 +1,36 @@ +import { compareNodes } from '@graphql-tools/utils'; +import { mergeDirectives } from './directives.js'; +export function mergeEnumValues(first, second, config, directives) { + if (config?.consistentEnumMerge) { + const reversed = []; + if (first) { + reversed.push(...first); + } + first = second; + second = reversed; + } + const enumValueMap = new Map(); + if (first) { + for (const firstValue of first) { + enumValueMap.set(firstValue.name.value, firstValue); + } + } + if (second) { + for (const secondValue of second) { + const enumValue = secondValue.name.value; + if (enumValueMap.has(enumValue)) { + const firstValue = enumValueMap.get(enumValue); + firstValue.description = secondValue.description || firstValue.description; + firstValue.directives = mergeDirectives(secondValue.directives, firstValue.directives, directives); + } + else { + enumValueMap.set(enumValue, secondValue); + } + } + } + const result = [...enumValueMap.values()]; + if (config && config.sort) { + result.sort(compareNodes); + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js new file mode 100644 index 00000000..b983bd89 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js @@ -0,0 +1,25 @@ +import { Kind, } from 'graphql'; +import { mergeDirectives } from './directives.js'; +import { mergeEnumValues } from './enum-values.js'; +export function mergeEnum(e1, e2, config, directives) { + if (e2) { + return { + name: e1.name, + description: e1['description'] || e2['description'], + kind: config?.convertExtensions || + e1.kind === 'EnumTypeDefinition' || + e2.kind === 'EnumTypeDefinition' + ? 'EnumTypeDefinition' + : 'EnumTypeExtension', + loc: e1.loc, + directives: mergeDirectives(e1.directives, e2.directives, config, directives), + values: mergeEnumValues(e1.values, e2.values, config), + }; + } + return config?.convertExtensions + ? { + ...e1, + kind: Kind.ENUM_TYPE_DEFINITION, + } + : e1; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/fields.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/fields.js new file mode 100644 index 00000000..08e00fb6 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/fields.js @@ -0,0 +1,78 @@ +import { compareNodes } from '@graphql-tools/utils'; +import { mergeArguments } from './arguments.js'; +import { mergeDirectives } from './directives.js'; +import { extractType, isListTypeNode, isNonNullTypeNode, isWrappingTypeNode, printTypeNode, } from './utils.js'; +function fieldAlreadyExists(fieldsArr, otherField) { + const resultIndex = fieldsArr.findIndex(field => field.name.value === otherField.name.value); + return [resultIndex > -1 ? fieldsArr[resultIndex] : null, resultIndex]; +} +export function mergeFields(type, f1, f2, config, directives) { + const result = []; + if (f2 != null) { + result.push(...f2); + } + if (f1 != null) { + for (const field of f1) { + const [existing, existingIndex] = fieldAlreadyExists(result, field); + if (existing && !config?.ignoreFieldConflicts) { + const newField = (config?.onFieldTypeConflict && + config.onFieldTypeConflict(existing, field, type, config?.throwOnConflict)) || + preventConflicts(type, existing, field, config?.throwOnConflict); + newField.arguments = mergeArguments(field['arguments'] || [], existing['arguments'] || [], config); + newField.directives = mergeDirectives(field.directives, existing.directives, config, directives); + newField.description = field.description || existing.description; + result[existingIndex] = newField; + } + else { + result.push(field); + } + } + } + if (config && config.sort) { + result.sort(compareNodes); + } + if (config && config.exclusions) { + const exclusions = config.exclusions; + return result.filter(field => !exclusions.includes(`${type.name.value}.${field.name.value}`)); + } + return result; +} +function preventConflicts(type, a, b, ignoreNullability = false) { + const aType = printTypeNode(a.type); + const bType = printTypeNode(b.type); + if (aType !== bType) { + const t1 = extractType(a.type); + const t2 = extractType(b.type); + if (t1.name.value !== t2.name.value) { + throw new Error(`Field "${b.name.value}" already defined with a different type. Declared as "${t1.name.value}", but you tried to override with "${t2.name.value}"`); + } + if (!safeChangeForFieldType(a.type, b.type, !ignoreNullability)) { + throw new Error(`Field '${type.name.value}.${a.name.value}' changed type from '${aType}' to '${bType}'`); + } + } + if (isNonNullTypeNode(b.type) && !isNonNullTypeNode(a.type)) { + a.type = b.type; + } + return a; +} +function safeChangeForFieldType(oldType, newType, ignoreNullability = false) { + // both are named + if (!isWrappingTypeNode(oldType) && !isWrappingTypeNode(newType)) { + return oldType.toString() === newType.toString(); + } + // new is non-null + if (isNonNullTypeNode(newType)) { + const ofType = isNonNullTypeNode(oldType) ? oldType.type : oldType; + return safeChangeForFieldType(ofType, newType.type); + } + // old is non-null + if (isNonNullTypeNode(oldType)) { + return safeChangeForFieldType(newType, oldType, ignoreNullability); + } + // old is list + if (isListTypeNode(oldType)) { + return ((isListTypeNode(newType) && safeChangeForFieldType(oldType.type, newType.type)) || + (isNonNullTypeNode(newType) && safeChangeForFieldType(oldType, newType['type']))); + } + return false; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/index.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/index.js new file mode 100644 index 00000000..a2f93622 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/index.js @@ -0,0 +1,14 @@ +export * from './arguments.js'; +export * from './directives.js'; +export * from './enum-values.js'; +export * from './enum.js'; +export * from './fields.js'; +export * from './input-type.js'; +export * from './interface.js'; +export * from './merge-named-type-array.js'; +export * from './merge-nodes.js'; +export * from './merge-typedefs.js'; +export * from './scalar.js'; +export * from './type.js'; +export * from './union.js'; +export * from './utils.js'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js new file mode 100644 index 00000000..37d575dc --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js @@ -0,0 +1,30 @@ +import { Kind, } from 'graphql'; +import { mergeDirectives } from './directives.js'; +import { mergeFields } from './fields.js'; +export function mergeInputType(node, existingNode, config, directives) { + if (existingNode) { + try { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'InputObjectTypeDefinition' || + existingNode.kind === 'InputObjectTypeDefinition' + ? 'InputObjectTypeDefinition' + : 'InputObjectTypeExtension', + loc: node.loc, + fields: mergeFields(node, node.fields, existingNode.fields, config), + directives: mergeDirectives(node.directives, existingNode.directives, config, directives), + }; + } + catch (e) { + throw new Error(`Unable to merge GraphQL input type "${node.name.value}": ${e.message}`); + } + } + return config?.convertExtensions + ? { + ...node, + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js new file mode 100644 index 00000000..39e85bf5 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js @@ -0,0 +1,34 @@ +import { Kind, } from 'graphql'; +import { mergeDirectives } from './directives.js'; +import { mergeFields } from './fields.js'; +import { mergeNamedTypeArray } from './merge-named-type-array.js'; +export function mergeInterface(node, existingNode, config, directives) { + if (existingNode) { + try { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'InterfaceTypeDefinition' || + existingNode.kind === 'InterfaceTypeDefinition' + ? 'InterfaceTypeDefinition' + : 'InterfaceTypeExtension', + loc: node.loc, + fields: mergeFields(node, node.fields, existingNode.fields, config, directives), + directives: mergeDirectives(node.directives, existingNode.directives, config, directives), + interfaces: node['interfaces'] + ? mergeNamedTypeArray(node['interfaces'], existingNode['interfaces'], config) + : undefined, + }; + } + catch (e) { + throw new Error(`Unable to merge GraphQL interface "${node.name.value}": ${e.message}`); + } + } + return config?.convertExtensions + ? { + ...node, + kind: Kind.INTERFACE_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js new file mode 100644 index 00000000..ac1584e2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js @@ -0,0 +1,11 @@ +import { compareNodes } from '@graphql-tools/utils'; +function alreadyExists(arr, other) { + return !!arr.find(i => i.name.value === other.name.value); +} +export function mergeNamedTypeArray(first = [], second = [], config = {}) { + const result = [...second, ...first.filter(d => !alreadyExists(second, d))]; + if (config && config.sort) { + result.sort(compareNodes); + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js new file mode 100644 index 00000000..479d29cc --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js @@ -0,0 +1,78 @@ +import { Kind, } from 'graphql'; +import { collectComment } from '@graphql-tools/utils'; +import { mergeDirective } from './directives.js'; +import { mergeEnum } from './enum.js'; +import { mergeInputType } from './input-type.js'; +import { mergeInterface } from './interface.js'; +import { mergeScalar } from './scalar.js'; +import { mergeSchemaDefs } from './schema-def.js'; +import { mergeType } from './type.js'; +import { mergeUnion } from './union.js'; +export const schemaDefSymbol = 'SCHEMA_DEF_SYMBOL'; +export function isNamedDefinitionNode(definitionNode) { + return 'name' in definitionNode; +} +export function mergeGraphQLNodes(nodes, config, directives = {}) { + const mergedResultMap = directives; + for (const nodeDefinition of nodes) { + if (isNamedDefinitionNode(nodeDefinition)) { + const name = nodeDefinition.name?.value; + if (config?.commentDescriptions) { + collectComment(nodeDefinition); + } + if (name == null) { + continue; + } + if (config?.exclusions?.includes(name + '.*') || config?.exclusions?.includes(name)) { + delete mergedResultMap[name]; + } + else { + switch (nodeDefinition.kind) { + case Kind.OBJECT_TYPE_DEFINITION: + case Kind.OBJECT_TYPE_EXTENSION: + mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name], config, directives); + break; + case Kind.ENUM_TYPE_DEFINITION: + case Kind.ENUM_TYPE_EXTENSION: + mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name], config, directives); + break; + case Kind.UNION_TYPE_DEFINITION: + case Kind.UNION_TYPE_EXTENSION: + mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name], config, directives); + break; + case Kind.SCALAR_TYPE_DEFINITION: + case Kind.SCALAR_TYPE_EXTENSION: + mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name], config, directives); + break; + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name], config, directives); + break; + case Kind.INTERFACE_TYPE_DEFINITION: + case Kind.INTERFACE_TYPE_EXTENSION: + mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name], config, directives); + break; + case Kind.DIRECTIVE_DEFINITION: + if (mergedResultMap[name]) { + const isInheritedFromPrototype = name in {}; // i.e. toString + if (isInheritedFromPrototype) { + if (!isASTNode(mergedResultMap[name])) { + mergedResultMap[name] = undefined; + } + } + } + mergedResultMap[name] = mergeDirective(nodeDefinition, mergedResultMap[name]); + break; + } + } + } + else if (nodeDefinition.kind === Kind.SCHEMA_DEFINITION || + nodeDefinition.kind === Kind.SCHEMA_EXTENSION) { + mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol], config, directives); + } + } + return mergedResultMap; +} +function isASTNode(node) { + return (node != null && typeof node === 'object' && 'kind' in node && typeof node.kind === 'string'); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js new file mode 100644 index 00000000..6cba044a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js @@ -0,0 +1,151 @@ +import { isDefinitionNode, isSchema, Kind, parse, } from 'graphql'; +import { getDocumentNodeFromSchema, isDocumentNode, printWithComments, resetComments, } from '@graphql-tools/utils'; +import { extractLinks, resolveImportName } from '../links.js'; +import { mergeGraphQLNodes, schemaDefSymbol } from './merge-nodes.js'; +import { DEFAULT_OPERATION_TYPE_NAME_MAP } from './schema-def.js'; +import { defaultStringComparator, isSourceTypes, isStringTypes } from './utils.js'; +export function mergeTypeDefs(typeSource, config) { + resetComments(); + const doc = { + kind: Kind.DOCUMENT, + definitions: mergeGraphQLTypes(typeSource, { + useSchemaDefinition: true, + forceSchemaDefinition: false, + throwOnConflict: false, + commentDescriptions: false, + ...config, + }), + }; + let result; + if (config?.commentDescriptions) { + result = printWithComments(doc); + } + else { + result = doc; + } + resetComments(); + return result; +} +function visitTypeSources(typeSource, options, allDirectives = [], allNodes = [], visitedTypeSources = new Set(), repeatableLinkImports = new Set()) { + const addRepeatable = (name) => { + repeatableLinkImports.add(name); + }; + if (typeSource && !visitedTypeSources.has(typeSource)) { + visitedTypeSources.add(typeSource); + if (typeof typeSource === 'function') { + visitTypeSources(typeSource(), options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else if (Array.isArray(typeSource)) { + for (const type of typeSource) { + visitTypeSources(type, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + } + else if (isSchema(typeSource)) { + const documentNode = getDocumentNodeFromSchema(typeSource, options); + visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else if (isStringTypes(typeSource) || isSourceTypes(typeSource)) { + const documentNode = parse(typeSource, options); + visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else if (typeof typeSource === 'object' && isDefinitionNode(typeSource)) { + const links = extractLinks({ + definitions: [typeSource], + kind: Kind.DOCUMENT, + }); + const federationUrl = 'https://specs.apollo.dev/federation'; + const linkUrl = 'https://specs.apollo.dev/link'; + /** + * Official Federated imports are special because they can be referenced without specifyin the import. + * To handle this case, we must prepare a list of all the possible valid usages to check against. + * Note that this versioning is not technically correct, since some definitions are after v2.0. + * But this is enough information to be comfortable not blocking the imports at this phase. It's + * the job of the composer to validate the versions. + * */ + const federationLink = links.find(l => l.url.identity === federationUrl); + if (federationLink) { + addRepeatable(resolveImportName(federationLink, '@composeDirective')); + addRepeatable(resolveImportName(federationLink, '@key')); + } + const linkLink = links.find(l => l.url.identity === linkUrl); + if (linkLink) { + addRepeatable(resolveImportName(linkLink, '@link')); + } + if (typeSource.kind === Kind.DIRECTIVE_DEFINITION) { + allDirectives.push(typeSource); + } + else { + allNodes.push(typeSource); + } + } + else if (isDocumentNode(typeSource)) { + visitTypeSources(typeSource.definitions, options, allDirectives, allNodes, visitedTypeSources, repeatableLinkImports); + } + else { + throw new Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof typeSource}`); + } + } + return { allDirectives, allNodes, repeatableLinkImports }; +} +export function mergeGraphQLTypes(typeSource, config) { + resetComments(); + const { allDirectives, allNodes, repeatableLinkImports } = visitTypeSources(typeSource, config); + const mergedDirectives = mergeGraphQLNodes(allDirectives, config); + config.repeatableLinkImports = repeatableLinkImports; + const mergedNodes = mergeGraphQLNodes(allNodes, config, mergedDirectives); + if (config?.useSchemaDefinition) { + // XXX: right now we don't handle multiple schema definitions + const schemaDef = mergedNodes[schemaDefSymbol] || { + kind: Kind.SCHEMA_DEFINITION, + operationTypes: [], + }; + // graphql@17 leaves `operationTypes` undefined on schema extensions, so the default operation + // types have to be written back onto the node instead of into a detached array. + const mutableSchemaDef = schemaDef; + const operationTypes = (mutableSchemaDef.operationTypes ??= []); + for (const opTypeDefNodeType in DEFAULT_OPERATION_TYPE_NAME_MAP) { + const opTypeDefNode = operationTypes.find(operationType => operationType.operation === opTypeDefNodeType); + if (!opTypeDefNode) { + const possibleRootTypeName = DEFAULT_OPERATION_TYPE_NAME_MAP[opTypeDefNodeType]; + const existingPossibleRootType = mergedNodes[possibleRootTypeName]; + if (existingPossibleRootType != null && existingPossibleRootType.name != null) { + operationTypes.push({ + kind: Kind.OPERATION_TYPE_DEFINITION, + type: { + kind: Kind.NAMED_TYPE, + name: existingPossibleRootType.name, + }, + operation: opTypeDefNodeType, + }); + } + } + } + if (schemaDef?.operationTypes?.length != null && schemaDef.operationTypes.length > 0) { + mergedNodes[schemaDefSymbol] = schemaDef; + } + } + if (config?.forceSchemaDefinition && !mergedNodes[schemaDefSymbol]?.operationTypes?.length) { + mergedNodes[schemaDefSymbol] = { + kind: Kind.SCHEMA_DEFINITION, + operationTypes: [ + { + kind: Kind.OPERATION_TYPE_DEFINITION, + operation: 'query', + type: { + kind: Kind.NAMED_TYPE, + name: { + kind: Kind.NAME, + value: 'Query', + }, + }, + }, + ], + }; + } + const mergedNodeDefinitions = Object.values(mergedNodes); + if (config?.sort) { + const sortFn = typeof config.sort === 'function' ? config.sort : defaultStringComparator; + mergedNodeDefinitions.sort((a, b) => sortFn(a.name?.value, b.name?.value)); + } + return mergedNodeDefinitions; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js new file mode 100644 index 00000000..cc755567 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js @@ -0,0 +1,23 @@ +import { Kind, } from 'graphql'; +import { mergeDirectives } from './directives.js'; +export function mergeScalar(node, existingNode, config, directives) { + if (existingNode) { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'ScalarTypeDefinition' || + existingNode.kind === 'ScalarTypeDefinition' + ? 'ScalarTypeDefinition' + : 'ScalarTypeExtension', + loc: node.loc, + directives: mergeDirectives(node.directives, existingNode.directives, config, directives), + }; + } + return config?.convertExtensions + ? { + ...node, + kind: Kind.SCALAR_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js new file mode 100644 index 00000000..b5d1b41b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js @@ -0,0 +1,36 @@ +import { Kind, } from 'graphql'; +import { mergeDirectives } from './directives.js'; +export const DEFAULT_OPERATION_TYPE_NAME_MAP = { + query: 'Query', + mutation: 'Mutation', + subscription: 'Subscription', +}; +function mergeOperationTypes(opNodeList = [], existingOpNodeList = []) { + const finalOpNodeList = []; + for (const opNodeType in DEFAULT_OPERATION_TYPE_NAME_MAP) { + const opNode = opNodeList.find(n => n.operation === opNodeType) || + existingOpNodeList.find(n => n.operation === opNodeType); + if (opNode) { + finalOpNodeList.push(opNode); + } + } + return finalOpNodeList; +} +export function mergeSchemaDefs(node, existingNode, config, directives) { + if (existingNode) { + return { + kind: node.kind === Kind.SCHEMA_DEFINITION || existingNode.kind === Kind.SCHEMA_DEFINITION + ? Kind.SCHEMA_DEFINITION + : Kind.SCHEMA_EXTENSION, + description: node['description'] || existingNode['description'], + directives: mergeDirectives(node.directives, existingNode.directives, config, directives), + operationTypes: mergeOperationTypes(node.operationTypes, existingNode.operationTypes), + }; + } + return (config?.convertExtensions + ? { + ...node, + kind: Kind.SCHEMA_DEFINITION, + } + : node); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js new file mode 100644 index 00000000..12583f8a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js @@ -0,0 +1,32 @@ +import { Kind, } from 'graphql'; +import { mergeDirectives } from './directives.js'; +import { mergeFields } from './fields.js'; +import { mergeNamedTypeArray } from './merge-named-type-array.js'; +export function mergeType(node, existingNode, config, directives) { + if (existingNode) { + try { + return { + name: node.name, + description: node['description'] || existingNode['description'], + kind: config?.convertExtensions || + node.kind === 'ObjectTypeDefinition' || + existingNode.kind === 'ObjectTypeDefinition' + ? 'ObjectTypeDefinition' + : 'ObjectTypeExtension', + loc: node.loc, + fields: mergeFields(node, node.fields, existingNode.fields, config, directives), + directives: mergeDirectives(node.directives, existingNode.directives, config, directives), + interfaces: mergeNamedTypeArray(node.interfaces, existingNode.interfaces, config), + }; + } + catch (e) { + throw new Error(`Unable to merge GraphQL type "${node.name.value}": ${e.message}`); + } + } + return config?.convertExtensions + ? { + ...node, + kind: Kind.OBJECT_TYPE_DEFINITION, + } + : node; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js new file mode 100644 index 00000000..4cf6c1c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js @@ -0,0 +1,26 @@ +import { Kind, } from 'graphql'; +import { mergeDirectives } from './directives.js'; +import { mergeNamedTypeArray } from './merge-named-type-array.js'; +export function mergeUnion(first, second, config, directives) { + if (second) { + return { + name: first.name, + description: first['description'] || second['description'], + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: mergeDirectives(first.directives, second.directives, config, directives), + kind: config?.convertExtensions || + first.kind === 'UnionTypeDefinition' || + second.kind === 'UnionTypeDefinition' + ? Kind.UNION_TYPE_DEFINITION + : Kind.UNION_TYPE_EXTENSION, + loc: first.loc, + types: mergeNamedTypeArray(first.types, second.types, config), + }; + } + return config?.convertExtensions + ? { + ...first, + kind: Kind.UNION_TYPE_DEFINITION, + } + : first; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js new file mode 100644 index 00000000..5d7d2dd1 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js @@ -0,0 +1,54 @@ +import { Kind, Source } from 'graphql'; +export function isStringTypes(types) { + return typeof types === 'string'; +} +export function isSourceTypes(types) { + return types instanceof Source; +} +export function extractType(type) { + let visitedType = type; + while (visitedType.kind === Kind.LIST_TYPE || visitedType.kind === 'NonNullType') { + visitedType = visitedType.type; + } + return visitedType; +} +export function isWrappingTypeNode(type) { + return type.kind !== Kind.NAMED_TYPE; +} +export function isListTypeNode(type) { + return type.kind === Kind.LIST_TYPE; +} +export function isNonNullTypeNode(type) { + return type.kind === Kind.NON_NULL_TYPE; +} +export function printTypeNode(type) { + if (isListTypeNode(type)) { + return `[${printTypeNode(type.type)}]`; + } + if (isNonNullTypeNode(type)) { + return `${printTypeNode(type.type)}!`; + } + return type.name.value; +} +export var CompareVal; +(function (CompareVal) { + CompareVal[CompareVal["A_SMALLER_THAN_B"] = -1] = "A_SMALLER_THAN_B"; + CompareVal[CompareVal["A_EQUALS_B"] = 0] = "A_EQUALS_B"; + CompareVal[CompareVal["A_GREATER_THAN_B"] = 1] = "A_GREATER_THAN_B"; +})(CompareVal || (CompareVal = {})); +export function defaultStringComparator(a, b) { + if (a == null && b == null) { + return CompareVal.A_EQUALS_B; + } + if (a == null) { + return CompareVal.A_SMALLER_THAN_B; + } + if (b == null) { + return CompareVal.A_GREATER_THAN_B; + } + if (a < b) + return CompareVal.A_SMALLER_THAN_B; + if (a > b) + return CompareVal.A_GREATER_THAN_B; + return CompareVal.A_EQUALS_B; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/package.json b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/package.json new file mode 100644 index 00000000..e0a17312 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/package.json @@ -0,0 +1,61 @@ +{ + "name": "@graphql-tools/merge", + "version": "9.2.4", + "description": "A set of utils for faster development of GraphQL tools", + "sideEffects": false, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + }, + "dependencies": { + "@graphql-tools/utils": "^12.0.1", + "tslib": "^2.4.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ardatan/graphql-tools.git", + "directory": "packages/merge" + }, + "author": "Dotan Simha ", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + }, + "main": "cjs/index.js", + "module": "esm/index.js", + "typings": "typings/index.d.ts", + "typescript": { + "definition": "typings/index.d.ts" + }, + "type": "module", + "exports": { + ".": { + "require": { + "types": "./typings/index.d.cts", + "default": "./cjs/index.js" + }, + "import": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + }, + "default": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + } + }, + "./*": { + "require": { + "types": "./typings/*.d.cts", + "default": "./cjs/*.js" + }, + "import": { + "types": "./typings/*.d.ts", + "default": "./esm/*.js" + }, + "default": { + "types": "./typings/*.d.ts", + "default": "./esm/*.js" + } + }, + "./package.json": "./package.json" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.cts new file mode 100644 index 00000000..be5f203f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.cts @@ -0,0 +1,5 @@ +import { GraphQLSchema } from 'graphql'; +import { SchemaExtensions } from '@graphql-tools/utils'; +export { extractExtensionsFromSchema } from '@graphql-tools/utils'; +export declare function mergeExtensions(extensions: SchemaExtensions[]): SchemaExtensions; +export declare function applyExtensions(schema: GraphQLSchema, extensions: SchemaExtensions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.ts new file mode 100644 index 00000000..be5f203f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/extensions.d.ts @@ -0,0 +1,5 @@ +import { GraphQLSchema } from 'graphql'; +import { SchemaExtensions } from '@graphql-tools/utils'; +export { extractExtensionsFromSchema } from '@graphql-tools/utils'; +export declare function mergeExtensions(extensions: SchemaExtensions[]): SchemaExtensions; +export declare function applyExtensions(schema: GraphQLSchema, extensions: SchemaExtensions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.cts new file mode 100644 index 00000000..c4d18899 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.cts @@ -0,0 +1,3 @@ +export * from './merge-resolvers.cjs'; +export * from './typedefs-mergers/index.cjs'; +export * from './extensions.cjs'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.ts new file mode 100644 index 00000000..0cf56486 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/index.d.ts @@ -0,0 +1,3 @@ +export * from './merge-resolvers.js'; +export * from './typedefs-mergers/index.js'; +export * from './extensions.js'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.cts new file mode 100644 index 00000000..34f6c26b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.cts @@ -0,0 +1,24 @@ +/** + * A simplified, GraphQL v15 compatible version of + * https://github.com/graphql-hive/federation-composition/blob/main/src/utils/link/index.ts + * that does not provide the same safeguards or functionality, but still can determine the + * correct name of an linked resource. + */ +import { type DocumentNode } from 'graphql'; +type FederationNamedImport = { + name: string; + as?: string; +}; +type FederationLinkUrl = { + identity: string; + name: string | null; + version: string | null; +}; +type FederatedLink = { + url: FederationLinkUrl; + as?: string; + imports: FederationNamedImport[]; +}; +export declare function resolveImportName(link: FederatedLink, elementName: string): string; +export declare function extractLinks(typeDefs: DocumentNode): FederatedLink[]; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.ts new file mode 100644 index 00000000..34f6c26b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/links.d.ts @@ -0,0 +1,24 @@ +/** + * A simplified, GraphQL v15 compatible version of + * https://github.com/graphql-hive/federation-composition/blob/main/src/utils/link/index.ts + * that does not provide the same safeguards or functionality, but still can determine the + * correct name of an linked resource. + */ +import { type DocumentNode } from 'graphql'; +type FederationNamedImport = { + name: string; + as?: string; +}; +type FederationLinkUrl = { + identity: string; + name: string | null; + version: string | null; +}; +type FederatedLink = { + url: FederationLinkUrl; + as?: string; + imports: FederationNamedImport[]; +}; +export declare function resolveImportName(link: FederatedLink, elementName: string): string; +export declare function extractLinks(typeDefs: DocumentNode): FederatedLink[]; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.cts new file mode 100644 index 00000000..bfcbd762 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.cts @@ -0,0 +1,37 @@ +import { IResolvers, Maybe } from '@graphql-tools/utils'; +/** + * Additional options for merging resolvers + */ +export interface MergeResolversOptions { + exclusions?: string[]; +} +/** + * Deep merges multiple resolver definition objects into a single definition. + * @param resolversDefinitions Resolver definitions to be merged + * @param options Additional options + * + * ```js + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const clientResolver = require('./clientResolver'); + * const productResolver = require('./productResolver'); + * + * const resolvers = mergeResolvers([ + * clientResolver, + * productResolver, + * ]); + * ``` + * + * If you don't want to manually create the array of resolver objects, you can + * also use this function along with loadFiles: + * + * ```js + * const path = require('path'); + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const { loadFilesSync } = require('@graphql-tools/load-files'); + * + * const resolversArray = loadFilesSync(path.join(__dirname, './resolvers')); + * + * const resolvers = mergeResolvers(resolversArray) + * ``` + */ +export declare function mergeResolvers(resolversDefinitions: Maybe> | Maybe>[]>, options?: MergeResolversOptions): IResolvers; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.ts new file mode 100644 index 00000000..bfcbd762 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/merge-resolvers.d.ts @@ -0,0 +1,37 @@ +import { IResolvers, Maybe } from '@graphql-tools/utils'; +/** + * Additional options for merging resolvers + */ +export interface MergeResolversOptions { + exclusions?: string[]; +} +/** + * Deep merges multiple resolver definition objects into a single definition. + * @param resolversDefinitions Resolver definitions to be merged + * @param options Additional options + * + * ```js + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const clientResolver = require('./clientResolver'); + * const productResolver = require('./productResolver'); + * + * const resolvers = mergeResolvers([ + * clientResolver, + * productResolver, + * ]); + * ``` + * + * If you don't want to manually create the array of resolver objects, you can + * also use this function along with loadFiles: + * + * ```js + * const path = require('path'); + * const { mergeResolvers } = require('@graphql-tools/merge'); + * const { loadFilesSync } = require('@graphql-tools/load-files'); + * + * const resolversArray = loadFilesSync(path.join(__dirname, './resolvers')); + * + * const resolvers = mergeResolvers(resolversArray) + * ``` + */ +export declare function mergeResolvers(resolversDefinitions: Maybe> | Maybe>[]>, options?: MergeResolversOptions): IResolvers; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.cts new file mode 100644 index 00000000..da1e3e49 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.cts @@ -0,0 +1,3 @@ +import { InputValueDefinitionNode } from 'graphql'; +import { Config } from './index.cjs'; +export declare function mergeArguments(args1: InputValueDefinitionNode[], args2: InputValueDefinitionNode[], config?: Config): InputValueDefinitionNode[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.ts new file mode 100644 index 00000000..122a263c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/arguments.d.ts @@ -0,0 +1,3 @@ +import { InputValueDefinitionNode } from 'graphql'; +import { Config } from './index.js'; +export declare function mergeArguments(args1: InputValueDefinitionNode[], args2: InputValueDefinitionNode[], config?: Config): InputValueDefinitionNode[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.cts new file mode 100644 index 00000000..94e9f1f0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.cts @@ -0,0 +1,4 @@ +import { DirectiveDefinitionNode, DirectiveNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeDirectives(d1?: ReadonlyArray, d2?: ReadonlyArray, config?: Config, directives?: Record): DirectiveNode[]; +export declare function mergeDirective(node: DirectiveDefinitionNode, existingNode?: DirectiveDefinitionNode): DirectiveDefinitionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.ts new file mode 100644 index 00000000..965d4575 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/directives.d.ts @@ -0,0 +1,4 @@ +import { DirectiveDefinitionNode, DirectiveNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeDirectives(d1?: ReadonlyArray, d2?: ReadonlyArray, config?: Config, directives?: Record): DirectiveNode[]; +export declare function mergeDirective(node: DirectiveDefinitionNode, existingNode?: DirectiveDefinitionNode): DirectiveDefinitionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.cts new file mode 100644 index 00000000..f8a8e1f6 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.cts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, EnumValueDefinitionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeEnumValues(first: ReadonlyArray | undefined, second: ReadonlyArray | undefined, config?: Config, directives?: Record): EnumValueDefinitionNode[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.ts new file mode 100644 index 00000000..3ca2b609 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum-values.d.ts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, EnumValueDefinitionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeEnumValues(first: ReadonlyArray | undefined, second: ReadonlyArray | undefined, config?: Config, directives?: Record): EnumValueDefinitionNode[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.cts new file mode 100644 index 00000000..dccc0052 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.cts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, EnumTypeDefinitionNode, EnumTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeEnum(e1: EnumTypeDefinitionNode | EnumTypeExtensionNode, e2: EnumTypeDefinitionNode | EnumTypeExtensionNode, config?: Config, directives?: Record): EnumTypeDefinitionNode | EnumTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.ts new file mode 100644 index 00000000..dc3492ea --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/enum.d.ts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, EnumTypeDefinitionNode, EnumTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeEnum(e1: EnumTypeDefinitionNode | EnumTypeExtensionNode, e2: EnumTypeDefinitionNode | EnumTypeExtensionNode, config?: Config, directives?: Record): EnumTypeDefinitionNode | EnumTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.cts new file mode 100644 index 00000000..1db83761 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.cts @@ -0,0 +1,11 @@ +import { DirectiveDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, NameNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +type FieldDefNode = FieldDefinitionNode | InputValueDefinitionNode; +type NamedDefNode = { + name: NameNode; +}; +export type OnFieldTypeConflict = (existingField: FieldDefNode, otherField: FieldDefNode, type: NamedDefNode, ignoreNullability: boolean | undefined) => FieldDefNode; +export declare function mergeFields(type: { + name: NameNode; +}, f1: ReadonlyArray | undefined, f2: ReadonlyArray | undefined, config?: Config, directives?: Record): T[]; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.ts new file mode 100644 index 00000000..10d1cf84 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/fields.d.ts @@ -0,0 +1,11 @@ +import { DirectiveDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, NameNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +type FieldDefNode = FieldDefinitionNode | InputValueDefinitionNode; +type NamedDefNode = { + name: NameNode; +}; +export type OnFieldTypeConflict = (existingField: FieldDefNode, otherField: FieldDefNode, type: NamedDefNode, ignoreNullability: boolean | undefined) => FieldDefNode; +export declare function mergeFields(type: { + name: NameNode; +}, f1: ReadonlyArray | undefined, f2: ReadonlyArray | undefined, config?: Config, directives?: Record): T[]; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.cts new file mode 100644 index 00000000..43b47645 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.cts @@ -0,0 +1,14 @@ +export * from './arguments.cjs'; +export * from './directives.cjs'; +export * from './enum-values.cjs'; +export * from './enum.cjs'; +export * from './fields.cjs'; +export * from './input-type.cjs'; +export * from './interface.cjs'; +export * from './merge-named-type-array.cjs'; +export * from './merge-nodes.cjs'; +export * from './merge-typedefs.cjs'; +export * from './scalar.cjs'; +export * from './type.cjs'; +export * from './union.cjs'; +export * from './utils.cjs'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.ts new file mode 100644 index 00000000..a2f93622 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/index.d.ts @@ -0,0 +1,14 @@ +export * from './arguments.js'; +export * from './directives.js'; +export * from './enum-values.js'; +export * from './enum.js'; +export * from './fields.js'; +export * from './input-type.js'; +export * from './interface.js'; +export * from './merge-named-type-array.js'; +export * from './merge-nodes.js'; +export * from './merge-typedefs.js'; +export * from './scalar.js'; +export * from './type.js'; +export * from './union.js'; +export * from './utils.js'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.cts new file mode 100644 index 00000000..a0540156 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.cts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeInputType(node: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode, existingNode: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode, config?: Config, directives?: Record): InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.ts new file mode 100644 index 00000000..b82526b8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/input-type.d.ts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeInputType(node: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode, existingNode: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode, config?: Config, directives?: Record): InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.cts new file mode 100644 index 00000000..1c98d27b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.cts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeInterface(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, existingNode: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, config?: Config, directives?: Record): InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.ts new file mode 100644 index 00000000..53d457ab --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/interface.d.ts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeInterface(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, existingNode: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, config?: Config, directives?: Record): InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.cts new file mode 100644 index 00000000..f701cb79 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.cts @@ -0,0 +1,3 @@ +import { NamedTypeNode } from 'graphql'; +import { Config } from '../index.cjs'; +export declare function mergeNamedTypeArray(first?: ReadonlyArray, second?: ReadonlyArray, config?: Config): NamedTypeNode[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.ts new file mode 100644 index 00000000..b066b3c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-named-type-array.d.ts @@ -0,0 +1,3 @@ +import { NamedTypeNode } from 'graphql'; +import { Config } from '../index.js'; +export declare function mergeNamedTypeArray(first?: ReadonlyArray, second?: ReadonlyArray, config?: Config): NamedTypeNode[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.cts new file mode 100644 index 00000000..a0cc5e2f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.cts @@ -0,0 +1,9 @@ +import { DefinitionNode, DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode } from 'graphql'; +import { NamedDefinitionNode } from '@graphql-tools/utils'; +import { Config } from './merge-typedefs.cjs'; +export declare const schemaDefSymbol = "SCHEMA_DEF_SYMBOL"; +export type MergedResultMap = Record & { + [schemaDefSymbol]: SchemaDefinitionNode | SchemaExtensionNode; +}; +export declare function isNamedDefinitionNode(definitionNode: DefinitionNode): definitionNode is NamedDefinitionNode; +export declare function mergeGraphQLNodes(nodes: ReadonlyArray, config?: Config, directives?: Record): MergedResultMap; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.ts new file mode 100644 index 00000000..7bf8fbab --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-nodes.d.ts @@ -0,0 +1,9 @@ +import { DefinitionNode, DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode } from 'graphql'; +import { NamedDefinitionNode } from '@graphql-tools/utils'; +import { Config } from './merge-typedefs.js'; +export declare const schemaDefSymbol = "SCHEMA_DEF_SYMBOL"; +export type MergedResultMap = Record & { + [schemaDefSymbol]: SchemaDefinitionNode | SchemaExtensionNode; +}; +export declare function isNamedDefinitionNode(definitionNode: DefinitionNode): definitionNode is NamedDefinitionNode; +export declare function mergeGraphQLNodes(nodes: ReadonlyArray, config?: Config, directives?: Record): MergedResultMap; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.cts new file mode 100644 index 00000000..287c8a49 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.cts @@ -0,0 +1,91 @@ +import { DefinitionNode, DocumentNode, ParseOptions } from 'graphql'; +import { GetDocumentNodeFromSchemaOptions, TypeSource } from '@graphql-tools/utils'; +import { OnFieldTypeConflict } from './fields.cjs'; +import { CompareFn } from './utils.cjs'; +type Omit = Pick>; +export interface Config extends ParseOptions, GetDocumentNodeFromSchemaOptions { + /** + * Produces `schema { query: ..., mutation: ..., subscription: ... }` + * + * Default: true + */ + useSchemaDefinition?: boolean; + /** + * Creates schema definition, even when no types are available + * Produces: `schema { query: Query }` + * + * Default: false + */ + forceSchemaDefinition?: boolean; + /** + * Throws an error on a merge conflict + * + * Default: false + */ + throwOnConflict?: boolean; + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * This option is provided to ease adoption and will be removed in v16. + * + * Default: false + */ + commentDescriptions?: boolean; + /** + * Puts the next directive first. + * + * Default: false + * + * @example: + * Given: + * ```graphql + * type User { a: String @foo } + * type User { a: String @bar } + * ``` + * + * Results: + * ``` + * type User { a: @bar @foo } + * ``` + */ + reverseDirectives?: boolean; + exclusions?: string[]; + sort?: boolean | CompareFn; + convertExtensions?: boolean; + consistentEnumMerge?: boolean; + ignoreFieldConflicts?: boolean; + /** + * Allow directives that are not defined in the schema, but are imported + * through federated @links, to be repeated. + */ + repeatableLinkImports?: Set; + /** + * Called if types of the same fields are different + * + * Default: false + * + * @example: + * Given: + * ```graphql + * type User { a: String } + * type User { a: Int } + * ``` + * + * Instead of throwing `already defined with a different type` error, + * `onFieldTypeConflict` function is called. + */ + onFieldTypeConflict?: OnFieldTypeConflict; + reverseArguments?: boolean; +} +/** + * Merges multiple type definitions into a single `DocumentNode` + * @param types The type definitions to be merged + */ +export declare function mergeTypeDefs(typeSource: TypeSource): DocumentNode; +export declare function mergeTypeDefs(typeSource: TypeSource, config?: Partial & { + commentDescriptions: true; +}): string; +export declare function mergeTypeDefs(typeSource: TypeSource, config?: Omit, 'commentDescriptions'>): DocumentNode; +export declare function mergeGraphQLTypes(typeSource: TypeSource, config: Config): DefinitionNode[]; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.ts new file mode 100644 index 00000000..eed3f081 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/merge-typedefs.d.ts @@ -0,0 +1,91 @@ +import { DefinitionNode, DocumentNode, ParseOptions } from 'graphql'; +import { GetDocumentNodeFromSchemaOptions, TypeSource } from '@graphql-tools/utils'; +import { OnFieldTypeConflict } from './fields.js'; +import { CompareFn } from './utils.js'; +type Omit = Pick>; +export interface Config extends ParseOptions, GetDocumentNodeFromSchemaOptions { + /** + * Produces `schema { query: ..., mutation: ..., subscription: ... }` + * + * Default: true + */ + useSchemaDefinition?: boolean; + /** + * Creates schema definition, even when no types are available + * Produces: `schema { query: Query }` + * + * Default: false + */ + forceSchemaDefinition?: boolean; + /** + * Throws an error on a merge conflict + * + * Default: false + */ + throwOnConflict?: boolean; + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * This option is provided to ease adoption and will be removed in v16. + * + * Default: false + */ + commentDescriptions?: boolean; + /** + * Puts the next directive first. + * + * Default: false + * + * @example: + * Given: + * ```graphql + * type User { a: String @foo } + * type User { a: String @bar } + * ``` + * + * Results: + * ``` + * type User { a: @bar @foo } + * ``` + */ + reverseDirectives?: boolean; + exclusions?: string[]; + sort?: boolean | CompareFn; + convertExtensions?: boolean; + consistentEnumMerge?: boolean; + ignoreFieldConflicts?: boolean; + /** + * Allow directives that are not defined in the schema, but are imported + * through federated @links, to be repeated. + */ + repeatableLinkImports?: Set; + /** + * Called if types of the same fields are different + * + * Default: false + * + * @example: + * Given: + * ```graphql + * type User { a: String } + * type User { a: Int } + * ``` + * + * Instead of throwing `already defined with a different type` error, + * `onFieldTypeConflict` function is called. + */ + onFieldTypeConflict?: OnFieldTypeConflict; + reverseArguments?: boolean; +} +/** + * Merges multiple type definitions into a single `DocumentNode` + * @param types The type definitions to be merged + */ +export declare function mergeTypeDefs(typeSource: TypeSource): DocumentNode; +export declare function mergeTypeDefs(typeSource: TypeSource, config?: Partial & { + commentDescriptions: true; +}): string; +export declare function mergeTypeDefs(typeSource: TypeSource, config?: Omit, 'commentDescriptions'>): DocumentNode; +export declare function mergeGraphQLTypes(typeSource: TypeSource, config: Config): DefinitionNode[]; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.cts new file mode 100644 index 00000000..1f652acc --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.cts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeScalar(node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, existingNode: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, config?: Config, directives?: Record): ScalarTypeDefinitionNode | ScalarTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.ts new file mode 100644 index 00000000..c4e496a0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/scalar.d.ts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeScalar(node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, existingNode: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, config?: Config, directives?: Record): ScalarTypeDefinitionNode | ScalarTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.cts new file mode 100644 index 00000000..4447031e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.cts @@ -0,0 +1,8 @@ +import { DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare const DEFAULT_OPERATION_TYPE_NAME_MAP: { + readonly query: 'Query'; + readonly mutation: 'Mutation'; + readonly subscription: 'Subscription'; +}; +export declare function mergeSchemaDefs(node: SchemaDefinitionNode | SchemaExtensionNode, existingNode: SchemaDefinitionNode | SchemaExtensionNode | undefined, config?: Config, directives?: Record): SchemaDefinitionNode | SchemaExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.ts new file mode 100644 index 00000000..b18d3b38 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/schema-def.d.ts @@ -0,0 +1,8 @@ +import { DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare const DEFAULT_OPERATION_TYPE_NAME_MAP: { + readonly query: 'Query'; + readonly mutation: 'Mutation'; + readonly subscription: 'Subscription'; +}; +export declare function mergeSchemaDefs(node: SchemaDefinitionNode | SchemaExtensionNode, existingNode: SchemaDefinitionNode | SchemaExtensionNode | undefined, config?: Config, directives?: Record): SchemaDefinitionNode | SchemaExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.cts new file mode 100644 index 00000000..49905ac2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.cts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeType(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, existingNode: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, config?: Config, directives?: Record): ObjectTypeDefinitionNode | ObjectTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.ts new file mode 100644 index 00000000..8ab2c320 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/type.d.ts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeType(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, existingNode: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, config?: Config, directives?: Record): ObjectTypeDefinitionNode | ObjectTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.cts new file mode 100644 index 00000000..fab662a8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.cts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.cjs'; +export declare function mergeUnion(first: UnionTypeDefinitionNode | UnionTypeExtensionNode, second: UnionTypeDefinitionNode | UnionTypeExtensionNode, config?: Config, directives?: Record): UnionTypeDefinitionNode | UnionTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.ts new file mode 100644 index 00000000..e52c4b01 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/union.d.ts @@ -0,0 +1,3 @@ +import { DirectiveDefinitionNode, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql'; +import { Config } from './merge-typedefs.js'; +export declare function mergeUnion(first: UnionTypeDefinitionNode | UnionTypeExtensionNode, second: UnionTypeDefinitionNode | UnionTypeExtensionNode, config?: Config, directives?: Record): UnionTypeDefinitionNode | UnionTypeExtensionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.cts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.cts new file mode 100644 index 00000000..ce72377b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.cts @@ -0,0 +1,15 @@ +import { ListTypeNode, NamedTypeNode, NonNullTypeNode, Source, TypeNode } from 'graphql'; +export declare function isStringTypes(types: any): types is string; +export declare function isSourceTypes(types: any): types is Source; +export declare function extractType(type: TypeNode): NamedTypeNode; +export declare function isWrappingTypeNode(type: TypeNode): type is ListTypeNode | NonNullTypeNode; +export declare function isListTypeNode(type: TypeNode): type is ListTypeNode; +export declare function isNonNullTypeNode(type: TypeNode): type is NonNullTypeNode; +export declare function printTypeNode(type: TypeNode): string; +export declare enum CompareVal { + A_SMALLER_THAN_B = -1, + A_EQUALS_B = 0, + A_GREATER_THAN_B = 1 +} +export type CompareFn = (a: T | undefined, b: T | undefined) => -1 | 0 | 1; +export declare function defaultStringComparator(a: string | undefined, b: string | undefined): CompareVal; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.ts b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.ts new file mode 100644 index 00000000..ce72377b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge/typings/typedefs-mergers/utils.d.ts @@ -0,0 +1,15 @@ +import { ListTypeNode, NamedTypeNode, NonNullTypeNode, Source, TypeNode } from 'graphql'; +export declare function isStringTypes(types: any): types is string; +export declare function isSourceTypes(types: any): types is Source; +export declare function extractType(type: TypeNode): NamedTypeNode; +export declare function isWrappingTypeNode(type: TypeNode): type is ListTypeNode | NonNullTypeNode; +export declare function isListTypeNode(type: TypeNode): type is ListTypeNode; +export declare function isNonNullTypeNode(type: TypeNode): type is NonNullTypeNode; +export declare function printTypeNode(type: TypeNode): string; +export declare enum CompareVal { + A_SMALLER_THAN_B = -1, + A_EQUALS_B = 0, + A_GREATER_THAN_B = 1 +} +export type CompareFn = (a: T | undefined, b: T | undefined) => -1 | 0 | 1; +export declare function defaultStringComparator(a: string | undefined, b: string | undefined): CompareVal; diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/utils b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/utils new file mode 120000 index 00000000..95e3dc23 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/utils @@ -0,0 +1 @@ +../../../@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/tslib b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/tslib new file mode 120000 index 00000000..4edba0e2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/tslib @@ -0,0 +1 @@ +../../tslib@2.8.1/node_modules/tslib \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/merge b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/merge new file mode 120000 index 00000000..80153745 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/merge @@ -0,0 +1 @@ +../../../@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/README.md b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/README.md new file mode 100644 index 00000000..885885b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/README.md @@ -0,0 +1,5 @@ +Check API Reference for more information about this package; +https://www.graphql-tools.com/docs/api/modules/schema_src + +You can also learn more about Generating Executable Schemas in this chapter; +https://www.graphql-tools.com/docs/generate-schema diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/addResolversToSchema.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/addResolversToSchema.js new file mode 100644 index 00000000..ddf78124 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/addResolversToSchema.js @@ -0,0 +1,363 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addResolversToSchema = addResolversToSchema; +const graphql_1 = require("graphql"); +const utils_1 = require("@graphql-tools/utils"); +const checkForResolveTypeResolver_js_1 = require("./checkForResolveTypeResolver.js"); +const extendResolversFromInterfaces_js_1 = require("./extendResolversFromInterfaces.js"); +function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions = {}, inheritResolversFromInterfaces = false, updateResolversInPlace = false, }) { + const { requireResolversToMatchSchema = 'error', requireResolversForResolveType } = resolverValidationOptions; + const resolvers = inheritResolversFromInterfaces + ? (0, extendResolversFromInterfaces_js_1.extendResolversFromInterfaces)(schema, inputResolvers) + : inputResolvers; + for (const typeName in resolvers) { + const resolverValue = resolvers[typeName]; + const resolverType = typeof resolverValue; + if (resolverType !== 'object') { + throw new Error(`"${typeName}" defined in resolvers, but has invalid value "${resolverValue}". The resolver's value must be of type object.`); + } + const type = schema.getType(typeName); + if (type == null) { + const msg = `"${typeName}" defined in resolvers, but not in schema`; + if (requireResolversToMatchSchema && requireResolversToMatchSchema !== 'error') { + if (requireResolversToMatchSchema === 'warn') { + console.warn(msg); + } + continue; + } + throw new Error(msg); + } + else if ((0, graphql_1.isSpecifiedScalarType)(type)) { + // allow -- without recommending -- overriding of specified scalar types + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + setScalarConfigProperty(type, fieldName.substring(2), resolverValue[fieldName]); + } + else { + setScalarConfigProperty(type, fieldName, resolverValue[fieldName]); + } + } + } + else if ((0, graphql_1.isEnumType)(type)) { + const values = type.getValues(); + for (const fieldName in resolverValue) { + if (!fieldName.startsWith('__') && + !values.some(value => value.name === fieldName) && + requireResolversToMatchSchema && + requireResolversToMatchSchema !== 'ignore') { + const msg = `${type.name}.${fieldName} was defined in resolvers, but not present within ${type.name}`; + if (requireResolversToMatchSchema === 'error') { + throw new Error(msg); + } + else { + console.warn(msg); + } + } + } + } + else if ((0, graphql_1.isUnionType)(type)) { + for (const fieldName in resolverValue) { + if (!fieldName.startsWith('__') && + requireResolversToMatchSchema && + requireResolversToMatchSchema !== 'ignore') { + const msg = `${type.name}.${fieldName} was defined in resolvers, but ${type.name} is not an object or interface type`; + if (requireResolversToMatchSchema === 'error') { + throw new Error(msg); + } + else { + console.warn(msg); + } + } + } + } + else if ((0, graphql_1.isObjectType)(type) || (0, graphql_1.isInterfaceType)(type)) { + for (const fieldName in resolverValue) { + if (!fieldName.startsWith('__')) { + const fields = type.getFields(); + const field = fields[fieldName]; + if (field == null) { + // Field present in resolver but not in schema + if (requireResolversToMatchSchema && requireResolversToMatchSchema !== 'ignore') { + const msg = `${typeName}.${fieldName} defined in resolvers, but not in schema`; + if (requireResolversToMatchSchema === 'error') { + throw new Error(msg); + } + else { + console.error(msg); + } + } + } + else { + // Field present in both the resolver and schema + const fieldResolve = resolverValue[fieldName]; + if (typeof fieldResolve !== 'function' && typeof fieldResolve !== 'object') { + throw new Error(`Resolver ${typeName}.${fieldName} must be object or function`); + } + } + } + } + } + } + schema = updateResolversInPlace + ? addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) + : createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver); + if (requireResolversForResolveType && requireResolversForResolveType !== 'ignore') { + (0, checkForResolveTypeResolver_js_1.checkForResolveTypeResolver)(schema, requireResolversForResolveType); + } + return schema; +} +// graphql-js@17 introduced `coerceOutputValue`/`coerceInputValue` as the methods +// actually invoked during execution, defaulting them from `serialize`/`parseValue` +// only at `GraphQLScalarType` construction time (see graphql-js's own +// `GraphQLScalarType` constructor). Setting `serialize`/`parseValue` on an +// already-built type (or in a config copied via `toConfig()`, which also carries +// forward the old `coerceOutputValue`/`coerceInputValue`) no longer updates what +// execution actually calls, so mirror the assignment onto the new method name too. +const LEGACY_TO_V17_SCALAR_METHOD = { + serialize: 'coerceOutputValue', + parseValue: 'coerceInputValue', +}; +function setScalarConfigProperty(target, propName, value) { + target[propName] = value; + const v17MethodName = LEGACY_TO_V17_SCALAR_METHOD[propName]; + if (v17MethodName) { + target[v17MethodName] = value; + } +} +function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) { + const typeMap = schema.getTypeMap(); + for (const typeName in resolvers) { + const type = schema.getType(typeName); + const resolverValue = resolvers[typeName]; + if ((0, graphql_1.isScalarType)(type)) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + setScalarConfigProperty(type, fieldName.substring(2), resolverValue[fieldName]); + } + else if (fieldName === 'astNode' && type.astNode != null) { + type.astNode = { + ...type.astNode, + description: resolverValue?.astNode?.description ?? + type.astNode.description, + directives: (type.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && type.extensionASTNodes != null) { + type.extensionASTNodes = type.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + type.extensions != null && + resolverValue.extensions != null) { + type.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else { + setScalarConfigProperty(type, fieldName, resolverValue[fieldName]); + } + } + } + else if ((0, graphql_1.isEnumType)(type)) { + const config = type.toConfig(); + const enumValueConfigMap = config.values; + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + config[fieldName.substring(2)] = resolverValue[fieldName]; + } + else if (fieldName === 'astNode' && config.astNode != null) { + config.astNode = { + ...config.astNode, + description: resolverValue?.astNode?.description ?? + config.astNode.description, + directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + type.extensions != null && + resolverValue.extensions != null) { + type.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else if (enumValueConfigMap[fieldName]) { + enumValueConfigMap[fieldName].value = resolverValue[fieldName]; + } + } + typeMap[typeName] = new graphql_1.GraphQLEnumType(config); + } + else if ((0, graphql_1.isUnionType)(type)) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + type[fieldName.substring(2)] = resolverValue[fieldName]; + } + } + } + else if ((0, graphql_1.isObjectType)(type) || (0, graphql_1.isInterfaceType)(type)) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + // this is for isTypeOf and resolveType and all the other stuff. + type[fieldName.substring(2)] = resolverValue[fieldName]; + continue; + } + const fields = type.getFields(); + const field = fields[fieldName]; + if (field != null) { + const fieldResolve = resolverValue[fieldName]; + if (typeof fieldResolve === 'function') { + // for convenience. Allows shorter syntax in resolver definition file + field.resolve = fieldResolve.bind(resolverValue); + } + else { + setFieldProperties(field, fieldResolve); + } + } + } + } + } + // serialize all default values prior to healing fields with new scalar/enum types. + (0, utils_1.forEachDefaultValue)(schema, utils_1.serializeInputValue); + // schema may have new scalar/enum types that require healing + (0, utils_1.healSchema)(schema); + // reparse all default values with new parsing functions. + (0, utils_1.forEachDefaultValue)(schema, utils_1.parseInputValue); + if (defaultFieldResolver != null) { + (0, utils_1.forEachField)(schema, field => { + if (!field.resolve) { + field.resolve = defaultFieldResolver; + } + }); + } + return schema; +} +function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) { + schema = (0, utils_1.mapSchema)(schema, { + [utils_1.MapperKind.SCALAR_TYPE]: type => { + const config = type.toConfig(); + const resolverValue = resolvers[type.name]; + if (!(0, graphql_1.isSpecifiedScalarType)(type) && resolverValue != null) { + const coerceInputValueOverridden = ['parseValue', 'coerceInputValue'].some(name => name in resolverValue || `__${name}` in resolverValue); + const parseLiteralOverridden = ['parseLiteral', 'coerceInputLiteral'].some(name => name in resolverValue || `__${name}` in resolverValue); + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + setScalarConfigProperty(config, fieldName.substring(2), resolverValue[fieldName]); + } + else if (fieldName === 'astNode' && config.astNode != null) { + config.astNode = { + ...config.astNode, + description: resolverValue?.astNode?.description ?? + config.astNode.description, + directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + config.extensions != null && + resolverValue.extensions != null) { + config.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else { + setScalarConfigProperty(config, fieldName, resolverValue[fieldName]); + } + } + if (coerceInputValueOverridden && !parseLiteralOverridden) { + delete config.parseLiteral; + } + return new graphql_1.GraphQLScalarType(config); + } + }, + [utils_1.MapperKind.ENUM_TYPE]: type => { + const resolverValue = resolvers[type.name]; + const config = type.toConfig(); + const enumValueConfigMap = config.values; + if (resolverValue != null) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + config[fieldName.substring(2)] = resolverValue[fieldName]; + } + else if (fieldName === 'astNode' && config.astNode != null) { + config.astNode = { + ...config.astNode, + description: resolverValue?.astNode?.description ?? + config.astNode.description, + directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + config.extensions != null && + resolverValue.extensions != null) { + config.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else if (enumValueConfigMap[fieldName]) { + enumValueConfigMap[fieldName].value = resolverValue[fieldName]; + } + } + return new graphql_1.GraphQLEnumType(config); + } + }, + [utils_1.MapperKind.UNION_TYPE]: type => { + const resolverValue = resolvers[type.name]; + if (resolverValue != null) { + const config = type.toConfig(); + if (resolverValue['__resolveType']) { + config.resolveType = resolverValue['__resolveType']; + } + return new graphql_1.GraphQLUnionType(config); + } + }, + [utils_1.MapperKind.OBJECT_TYPE]: type => { + const resolverValue = resolvers[type.name]; + if (resolverValue != null) { + const config = type.toConfig(); + if (resolverValue['__isTypeOf']) { + config.isTypeOf = resolverValue['__isTypeOf']; + } + return new graphql_1.GraphQLObjectType(config); + } + }, + [utils_1.MapperKind.INTERFACE_TYPE]: type => { + const resolverValue = resolvers[type.name]; + if (resolverValue != null) { + const config = type.toConfig(); + if (resolverValue['__resolveType']) { + config.resolveType = resolverValue['__resolveType']; + } + return new graphql_1.GraphQLInterfaceType(config); + } + }, + [utils_1.MapperKind.COMPOSITE_FIELD]: (fieldConfig, fieldName, typeName) => { + const resolverValue = resolvers[typeName]; + if (resolverValue != null) { + const fieldResolve = resolverValue[fieldName]; + if (fieldResolve != null) { + const newFieldConfig = { ...fieldConfig }; + if (typeof fieldResolve === 'function') { + // for convenience. Allows shorter syntax in resolver definition file + newFieldConfig.resolve = fieldResolve.bind(resolverValue); + } + else { + setFieldProperties(newFieldConfig, fieldResolve); + } + return newFieldConfig; + } + } + }, + }); + if (defaultFieldResolver != null) { + schema = (0, utils_1.mapSchema)(schema, { + [utils_1.MapperKind.OBJECT_FIELD]: fieldConfig => ({ + ...fieldConfig, + resolve: fieldConfig.resolve != null ? fieldConfig.resolve : defaultFieldResolver, + }), + }); + } + return schema; +} +function setFieldProperties(field, propertiesObj) { + for (const propertyName in propertiesObj) { + field[propertyName] = propertiesObj[propertyName]; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/assertResolversPresent.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/assertResolversPresent.js new file mode 100644 index 00000000..370dd9a8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/assertResolversPresent.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertResolversPresent = assertResolversPresent; +const graphql_1 = require("graphql"); +const utils_1 = require("@graphql-tools/utils"); +function assertResolversPresent(schema, resolverValidationOptions = {}) { + const { requireResolversForArgs, requireResolversForNonScalar, requireResolversForAllFields } = resolverValidationOptions; + if (requireResolversForAllFields && (requireResolversForArgs || requireResolversForNonScalar)) { + throw new TypeError('requireResolversForAllFields takes precedence over the more specific assertions. ' + + 'Please configure either requireResolversForAllFields or requireResolversForArgs / ' + + 'requireResolversForNonScalar, but not a combination of them.'); + } + (0, utils_1.forEachField)(schema, (field, typeName, fieldName) => { + // requires a resolver for *every* field. + if (requireResolversForAllFields) { + expectResolver('requireResolversForAllFields', requireResolversForAllFields, field, typeName, fieldName); + } + // requires a resolver on every field that has arguments + if (requireResolversForArgs && field.args.length > 0) { + expectResolver('requireResolversForArgs', requireResolversForArgs, field, typeName, fieldName); + } + // requires a resolver on every field that returns a non-scalar type + if (requireResolversForNonScalar !== 'ignore' && !(0, graphql_1.isScalarType)((0, graphql_1.getNamedType)(field.type))) { + expectResolver('requireResolversForNonScalar', requireResolversForNonScalar, field, typeName, fieldName); + } + }); +} +function expectResolver(validator, behavior, field, typeName, fieldName) { + if (!field.resolve) { + const message = `Resolver missing for "${typeName}.${fieldName}". +To disable this validator, use: + resolverValidationOptions: { + ${validator}: 'ignore' + }`; + if (behavior === 'error') { + throw new Error(message); + } + if (behavior === 'warn') { + console.warn(message); + } + return; + } + if (typeof field.resolve !== 'function') { + throw new Error(`Resolver "${typeName}.${fieldName}" must be a function`); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/chainResolvers.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/chainResolvers.js new file mode 100644 index 00000000..b4aedc9e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/chainResolvers.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.chainResolvers = chainResolvers; +const graphql_1 = require("graphql"); +function chainResolvers(resolvers) { + return (root, args, ctx, info) => resolvers.reduce((prev, curResolver) => { + if (curResolver != null) { + return curResolver(prev, args, ctx, info); + } + return (0, graphql_1.defaultFieldResolver)(prev, args, ctx, info); + }, root); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/checkForResolveTypeResolver.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/checkForResolveTypeResolver.js new file mode 100644 index 00000000..4baf4b61 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/checkForResolveTypeResolver.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkForResolveTypeResolver = checkForResolveTypeResolver; +const utils_1 = require("@graphql-tools/utils"); +// If we have any union or interface types throw if no there is no resolveType resolver +function checkForResolveTypeResolver(schema, requireResolversForResolveType) { + (0, utils_1.mapSchema)(schema, { + [utils_1.MapperKind.ABSTRACT_TYPE]: type => { + if (!type.resolveType) { + const message = `Type "${type.name}" is missing a "__resolveType" resolver. Pass 'ignore' into ` + + '"resolverValidationOptions.requireResolversForResolveType" to disable this error.'; + if (requireResolversForResolveType === 'error') { + throw new Error(message); + } + if (requireResolversForResolveType === 'warn') { + console.warn(message); + } + } + return undefined; + }, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/extendResolversFromInterfaces.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/extendResolversFromInterfaces.js new file mode 100644 index 00000000..9d97beea --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/extendResolversFromInterfaces.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendResolversFromInterfaces = extendResolversFromInterfaces; +function extendResolversFromInterfaces(schema, resolvers) { + const extendedResolvers = {}; + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + const type = typeMap[typeName]; + if ('getInterfaces' in type) { + extendedResolvers[typeName] = {}; + for (const iFace of type.getInterfaces()) { + if (resolvers[iFace.name]) { + for (const fieldName in resolvers[iFace.name]) { + if (fieldName === '__isTypeOf' || !fieldName.startsWith('__')) { + extendedResolvers[typeName][fieldName] = resolvers[iFace.name][fieldName]; + } + } + } + } + const typeResolvers = resolvers[typeName]; + extendedResolvers[typeName] = { + ...extendedResolvers[typeName], + ...typeResolvers, + }; + } + else { + const typeResolvers = resolvers[typeName]; + if (typeResolvers != null) { + extendedResolvers[typeName] = typeResolvers; + } + } + } + return extendedResolvers; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/index.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/index.js new file mode 100644 index 00000000..db4dfbf4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/index.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extractExtensionsFromSchema = exports.extendResolversFromInterfaces = exports.checkForResolveTypeResolver = exports.addResolversToSchema = exports.chainResolvers = exports.assertResolversPresent = void 0; +const tslib_1 = require("tslib"); +var assertResolversPresent_js_1 = require("./assertResolversPresent.js"); +Object.defineProperty(exports, "assertResolversPresent", { enumerable: true, get: function () { return assertResolversPresent_js_1.assertResolversPresent; } }); +var chainResolvers_js_1 = require("./chainResolvers.js"); +Object.defineProperty(exports, "chainResolvers", { enumerable: true, get: function () { return chainResolvers_js_1.chainResolvers; } }); +var addResolversToSchema_js_1 = require("./addResolversToSchema.js"); +Object.defineProperty(exports, "addResolversToSchema", { enumerable: true, get: function () { return addResolversToSchema_js_1.addResolversToSchema; } }); +var checkForResolveTypeResolver_js_1 = require("./checkForResolveTypeResolver.js"); +Object.defineProperty(exports, "checkForResolveTypeResolver", { enumerable: true, get: function () { return checkForResolveTypeResolver_js_1.checkForResolveTypeResolver; } }); +var extendResolversFromInterfaces_js_1 = require("./extendResolversFromInterfaces.js"); +Object.defineProperty(exports, "extendResolversFromInterfaces", { enumerable: true, get: function () { return extendResolversFromInterfaces_js_1.extendResolversFromInterfaces; } }); +tslib_1.__exportStar(require("./makeExecutableSchema.js"), exports); +tslib_1.__exportStar(require("./types.js"), exports); +tslib_1.__exportStar(require("./merge-schemas.js"), exports); +var utils_1 = require("@graphql-tools/utils"); +Object.defineProperty(exports, "extractExtensionsFromSchema", { enumerable: true, get: function () { return utils_1.extractExtensionsFromSchema; } }); diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js new file mode 100644 index 00000000..d487e060 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeExecutableSchema = makeExecutableSchema; +const graphql_1 = require("graphql"); +const merge_1 = require("@graphql-tools/merge"); +const utils_1 = require("@graphql-tools/utils"); +const addResolversToSchema_js_1 = require("./addResolversToSchema.js"); +const assertResolversPresent_js_1 = require("./assertResolversPresent.js"); +/** + * Builds a schema from the provided type definitions and resolvers. + * + * The type definitions are written using Schema Definition Language (SDL). They + * can be provided as a string, a `DocumentNode`, a function, or an array of any + * of these. If a function is provided, it will be passed no arguments and + * should return an array of strings or `DocumentNode`s. + * + * Note: You can use GraphQL magic comment provide additional syntax + * highlighting in your editor (with the appropriate editor plugin). + * + * ```js + * const typeDefs = /* GraphQL *\/ ` + * type Query { + * posts: [Post] + * author(id: Int!): Author + * } + * `; + * ``` + * + * The `resolvers` object should be a map of type names to nested object, which + * themselves map the type's fields to their appropriate resolvers. + * See the [Resolvers](/docs/resolvers) section of the documentation for more details. + * + * ```js + * const resolvers = { + * Query: { + * posts: (obj, args, ctx, info) => getAllPosts(), + * author: (obj, args, ctx, info) => getAuthorById(args.id) + * } + * }; + * ``` + * + * Once you've defined both the `typeDefs` and `resolvers`, you can create your + * schema: + * + * ```js + * const schema = makeExecutableSchema({ + * typeDefs, + * resolvers, + * }) + * ``` + */ +function makeExecutableSchema({ typeDefs, resolvers = {}, resolverValidationOptions = {}, inheritResolversFromInterfaces = false, updateResolversInPlace = false, schemaExtensions, defaultFieldResolver, ...otherOptions }) { + // Validate and clean up arguments + if (typeof resolverValidationOptions !== 'object') { + throw new Error('Expected `resolverValidationOptions` to be an object'); + } + if (!typeDefs) { + throw new Error('Must provide typeDefs'); + } + let schema; + if ((0, graphql_1.isSchema)(typeDefs)) { + schema = typeDefs; + } + else if (otherOptions?.commentDescriptions) { + const mergedTypeDefs = (0, merge_1.mergeTypeDefs)(typeDefs, { + ...otherOptions, + commentDescriptions: true, + }); + schema = (0, graphql_1.buildSchema)(mergedTypeDefs, otherOptions); + } + else { + const mergedTypeDefs = (0, merge_1.mergeTypeDefs)(typeDefs, otherOptions); + schema = (0, graphql_1.buildASTSchema)(mergedTypeDefs, otherOptions); + } + // We allow passing in an array of resolver maps, in which case we merge them + schema = (0, addResolversToSchema_js_1.addResolversToSchema)({ + schema, + resolvers: (0, merge_1.mergeResolvers)(resolvers), + resolverValidationOptions, + inheritResolversFromInterfaces, + updateResolversInPlace, + defaultFieldResolver, + }); + if (Object.keys(resolverValidationOptions).length > 0) { + (0, assertResolversPresent_js_1.assertResolversPresent)(schema, resolverValidationOptions); + } + if (schemaExtensions) { + for (const schemaExtension of (0, utils_1.asArray)(schemaExtensions)) { + (0, merge_1.applyExtensions)(schema, schemaExtension); + } + } + return schema; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/merge-schemas.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/merge-schemas.js new file mode 100644 index 00000000..da4ffbf5 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/merge-schemas.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeSchemas = mergeSchemas; +const utils_1 = require("@graphql-tools/utils"); +const makeExecutableSchema_js_1 = require("./makeExecutableSchema.js"); +/** + * Synchronously merges multiple schemas, typeDefinitions and/or resolvers into a single schema. + * @param config Configuration object + */ +function mergeSchemas(config) { + const extractedTypeDefs = []; + const extractedResolvers = []; + const extractedSchemaExtensions = []; + if (config.schemas != null) { + for (const schema of config.schemas) { + extractedTypeDefs.push((0, utils_1.getDocumentNodeFromSchema)(schema)); + extractedResolvers.push((0, utils_1.getResolversFromSchema)(schema)); + extractedSchemaExtensions.push((0, utils_1.extractExtensionsFromSchema)(schema)); + } + } + if (config.typeDefs != null) { + extractedTypeDefs.push(config.typeDefs); + } + if (config.resolvers != null) { + const additionalResolvers = (0, utils_1.asArray)(config.resolvers); + extractedResolvers.push(...additionalResolvers); + } + if (config.schemaExtensions != null) { + const additionalSchemaExtensions = (0, utils_1.asArray)(config.schemaExtensions); + extractedSchemaExtensions.push(...additionalSchemaExtensions); + } + return (0, makeExecutableSchema_js_1.makeExecutableSchema)({ + ...config, + typeDefs: extractedTypeDefs, + resolvers: extractedResolvers, + schemaExtensions: extractedSchemaExtensions, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/package.json b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/types.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/cjs/types.js new file mode 100644 index 00000000..e69de29b diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/addResolversToSchema.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/addResolversToSchema.js new file mode 100644 index 00000000..04cfb5cd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/addResolversToSchema.js @@ -0,0 +1,360 @@ +import { GraphQLEnumType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isEnumType, isInterfaceType, isObjectType, isScalarType, isSpecifiedScalarType, isUnionType, } from 'graphql'; +import { forEachDefaultValue, forEachField, healSchema, MapperKind, mapSchema, parseInputValue, serializeInputValue, } from '@graphql-tools/utils'; +import { checkForResolveTypeResolver } from './checkForResolveTypeResolver.js'; +import { extendResolversFromInterfaces } from './extendResolversFromInterfaces.js'; +export function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions = {}, inheritResolversFromInterfaces = false, updateResolversInPlace = false, }) { + const { requireResolversToMatchSchema = 'error', requireResolversForResolveType } = resolverValidationOptions; + const resolvers = inheritResolversFromInterfaces + ? extendResolversFromInterfaces(schema, inputResolvers) + : inputResolvers; + for (const typeName in resolvers) { + const resolverValue = resolvers[typeName]; + const resolverType = typeof resolverValue; + if (resolverType !== 'object') { + throw new Error(`"${typeName}" defined in resolvers, but has invalid value "${resolverValue}". The resolver's value must be of type object.`); + } + const type = schema.getType(typeName); + if (type == null) { + const msg = `"${typeName}" defined in resolvers, but not in schema`; + if (requireResolversToMatchSchema && requireResolversToMatchSchema !== 'error') { + if (requireResolversToMatchSchema === 'warn') { + console.warn(msg); + } + continue; + } + throw new Error(msg); + } + else if (isSpecifiedScalarType(type)) { + // allow -- without recommending -- overriding of specified scalar types + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + setScalarConfigProperty(type, fieldName.substring(2), resolverValue[fieldName]); + } + else { + setScalarConfigProperty(type, fieldName, resolverValue[fieldName]); + } + } + } + else if (isEnumType(type)) { + const values = type.getValues(); + for (const fieldName in resolverValue) { + if (!fieldName.startsWith('__') && + !values.some(value => value.name === fieldName) && + requireResolversToMatchSchema && + requireResolversToMatchSchema !== 'ignore') { + const msg = `${type.name}.${fieldName} was defined in resolvers, but not present within ${type.name}`; + if (requireResolversToMatchSchema === 'error') { + throw new Error(msg); + } + else { + console.warn(msg); + } + } + } + } + else if (isUnionType(type)) { + for (const fieldName in resolverValue) { + if (!fieldName.startsWith('__') && + requireResolversToMatchSchema && + requireResolversToMatchSchema !== 'ignore') { + const msg = `${type.name}.${fieldName} was defined in resolvers, but ${type.name} is not an object or interface type`; + if (requireResolversToMatchSchema === 'error') { + throw new Error(msg); + } + else { + console.warn(msg); + } + } + } + } + else if (isObjectType(type) || isInterfaceType(type)) { + for (const fieldName in resolverValue) { + if (!fieldName.startsWith('__')) { + const fields = type.getFields(); + const field = fields[fieldName]; + if (field == null) { + // Field present in resolver but not in schema + if (requireResolversToMatchSchema && requireResolversToMatchSchema !== 'ignore') { + const msg = `${typeName}.${fieldName} defined in resolvers, but not in schema`; + if (requireResolversToMatchSchema === 'error') { + throw new Error(msg); + } + else { + console.error(msg); + } + } + } + else { + // Field present in both the resolver and schema + const fieldResolve = resolverValue[fieldName]; + if (typeof fieldResolve !== 'function' && typeof fieldResolve !== 'object') { + throw new Error(`Resolver ${typeName}.${fieldName} must be object or function`); + } + } + } + } + } + } + schema = updateResolversInPlace + ? addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) + : createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver); + if (requireResolversForResolveType && requireResolversForResolveType !== 'ignore') { + checkForResolveTypeResolver(schema, requireResolversForResolveType); + } + return schema; +} +// graphql-js@17 introduced `coerceOutputValue`/`coerceInputValue` as the methods +// actually invoked during execution, defaulting them from `serialize`/`parseValue` +// only at `GraphQLScalarType` construction time (see graphql-js's own +// `GraphQLScalarType` constructor). Setting `serialize`/`parseValue` on an +// already-built type (or in a config copied via `toConfig()`, which also carries +// forward the old `coerceOutputValue`/`coerceInputValue`) no longer updates what +// execution actually calls, so mirror the assignment onto the new method name too. +const LEGACY_TO_V17_SCALAR_METHOD = { + serialize: 'coerceOutputValue', + parseValue: 'coerceInputValue', +}; +function setScalarConfigProperty(target, propName, value) { + target[propName] = value; + const v17MethodName = LEGACY_TO_V17_SCALAR_METHOD[propName]; + if (v17MethodName) { + target[v17MethodName] = value; + } +} +function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) { + const typeMap = schema.getTypeMap(); + for (const typeName in resolvers) { + const type = schema.getType(typeName); + const resolverValue = resolvers[typeName]; + if (isScalarType(type)) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + setScalarConfigProperty(type, fieldName.substring(2), resolverValue[fieldName]); + } + else if (fieldName === 'astNode' && type.astNode != null) { + type.astNode = { + ...type.astNode, + description: resolverValue?.astNode?.description ?? + type.astNode.description, + directives: (type.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && type.extensionASTNodes != null) { + type.extensionASTNodes = type.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + type.extensions != null && + resolverValue.extensions != null) { + type.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else { + setScalarConfigProperty(type, fieldName, resolverValue[fieldName]); + } + } + } + else if (isEnumType(type)) { + const config = type.toConfig(); + const enumValueConfigMap = config.values; + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + config[fieldName.substring(2)] = resolverValue[fieldName]; + } + else if (fieldName === 'astNode' && config.astNode != null) { + config.astNode = { + ...config.astNode, + description: resolverValue?.astNode?.description ?? + config.astNode.description, + directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + type.extensions != null && + resolverValue.extensions != null) { + type.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else if (enumValueConfigMap[fieldName]) { + enumValueConfigMap[fieldName].value = resolverValue[fieldName]; + } + } + typeMap[typeName] = new GraphQLEnumType(config); + } + else if (isUnionType(type)) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + type[fieldName.substring(2)] = resolverValue[fieldName]; + } + } + } + else if (isObjectType(type) || isInterfaceType(type)) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + // this is for isTypeOf and resolveType and all the other stuff. + type[fieldName.substring(2)] = resolverValue[fieldName]; + continue; + } + const fields = type.getFields(); + const field = fields[fieldName]; + if (field != null) { + const fieldResolve = resolverValue[fieldName]; + if (typeof fieldResolve === 'function') { + // for convenience. Allows shorter syntax in resolver definition file + field.resolve = fieldResolve.bind(resolverValue); + } + else { + setFieldProperties(field, fieldResolve); + } + } + } + } + } + // serialize all default values prior to healing fields with new scalar/enum types. + forEachDefaultValue(schema, serializeInputValue); + // schema may have new scalar/enum types that require healing + healSchema(schema); + // reparse all default values with new parsing functions. + forEachDefaultValue(schema, parseInputValue); + if (defaultFieldResolver != null) { + forEachField(schema, field => { + if (!field.resolve) { + field.resolve = defaultFieldResolver; + } + }); + } + return schema; +} +function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) { + schema = mapSchema(schema, { + [MapperKind.SCALAR_TYPE]: type => { + const config = type.toConfig(); + const resolverValue = resolvers[type.name]; + if (!isSpecifiedScalarType(type) && resolverValue != null) { + const coerceInputValueOverridden = ['parseValue', 'coerceInputValue'].some(name => name in resolverValue || `__${name}` in resolverValue); + const parseLiteralOverridden = ['parseLiteral', 'coerceInputLiteral'].some(name => name in resolverValue || `__${name}` in resolverValue); + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + setScalarConfigProperty(config, fieldName.substring(2), resolverValue[fieldName]); + } + else if (fieldName === 'astNode' && config.astNode != null) { + config.astNode = { + ...config.astNode, + description: resolverValue?.astNode?.description ?? + config.astNode.description, + directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + config.extensions != null && + resolverValue.extensions != null) { + config.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else { + setScalarConfigProperty(config, fieldName, resolverValue[fieldName]); + } + } + if (coerceInputValueOverridden && !parseLiteralOverridden) { + delete config.parseLiteral; + } + return new GraphQLScalarType(config); + } + }, + [MapperKind.ENUM_TYPE]: type => { + const resolverValue = resolvers[type.name]; + const config = type.toConfig(); + const enumValueConfigMap = config.values; + if (resolverValue != null) { + for (const fieldName in resolverValue) { + if (fieldName.startsWith('__')) { + config[fieldName.substring(2)] = resolverValue[fieldName]; + } + else if (fieldName === 'astNode' && config.astNode != null) { + config.astNode = { + ...config.astNode, + description: resolverValue?.astNode?.description ?? + config.astNode.description, + directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []), + }; + } + else if (fieldName === 'extensionASTNodes' && config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.concat(resolverValue?.extensionASTNodes ?? []); + } + else if (fieldName === 'extensions' && + config.extensions != null && + resolverValue.extensions != null) { + config.extensions = Object.assign(Object.create(null), type.extensions, resolverValue.extensions); + } + else if (enumValueConfigMap[fieldName]) { + enumValueConfigMap[fieldName].value = resolverValue[fieldName]; + } + } + return new GraphQLEnumType(config); + } + }, + [MapperKind.UNION_TYPE]: type => { + const resolverValue = resolvers[type.name]; + if (resolverValue != null) { + const config = type.toConfig(); + if (resolverValue['__resolveType']) { + config.resolveType = resolverValue['__resolveType']; + } + return new GraphQLUnionType(config); + } + }, + [MapperKind.OBJECT_TYPE]: type => { + const resolverValue = resolvers[type.name]; + if (resolverValue != null) { + const config = type.toConfig(); + if (resolverValue['__isTypeOf']) { + config.isTypeOf = resolverValue['__isTypeOf']; + } + return new GraphQLObjectType(config); + } + }, + [MapperKind.INTERFACE_TYPE]: type => { + const resolverValue = resolvers[type.name]; + if (resolverValue != null) { + const config = type.toConfig(); + if (resolverValue['__resolveType']) { + config.resolveType = resolverValue['__resolveType']; + } + return new GraphQLInterfaceType(config); + } + }, + [MapperKind.COMPOSITE_FIELD]: (fieldConfig, fieldName, typeName) => { + const resolverValue = resolvers[typeName]; + if (resolverValue != null) { + const fieldResolve = resolverValue[fieldName]; + if (fieldResolve != null) { + const newFieldConfig = { ...fieldConfig }; + if (typeof fieldResolve === 'function') { + // for convenience. Allows shorter syntax in resolver definition file + newFieldConfig.resolve = fieldResolve.bind(resolverValue); + } + else { + setFieldProperties(newFieldConfig, fieldResolve); + } + return newFieldConfig; + } + } + }, + }); + if (defaultFieldResolver != null) { + schema = mapSchema(schema, { + [MapperKind.OBJECT_FIELD]: fieldConfig => ({ + ...fieldConfig, + resolve: fieldConfig.resolve != null ? fieldConfig.resolve : defaultFieldResolver, + }), + }); + } + return schema; +} +function setFieldProperties(field, propertiesObj) { + for (const propertyName in propertiesObj) { + field[propertyName] = propertiesObj[propertyName]; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/assertResolversPresent.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/assertResolversPresent.js new file mode 100644 index 00000000..9a728976 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/assertResolversPresent.js @@ -0,0 +1,43 @@ +import { getNamedType, isScalarType } from 'graphql'; +import { forEachField } from '@graphql-tools/utils'; +export function assertResolversPresent(schema, resolverValidationOptions = {}) { + const { requireResolversForArgs, requireResolversForNonScalar, requireResolversForAllFields } = resolverValidationOptions; + if (requireResolversForAllFields && (requireResolversForArgs || requireResolversForNonScalar)) { + throw new TypeError('requireResolversForAllFields takes precedence over the more specific assertions. ' + + 'Please configure either requireResolversForAllFields or requireResolversForArgs / ' + + 'requireResolversForNonScalar, but not a combination of them.'); + } + forEachField(schema, (field, typeName, fieldName) => { + // requires a resolver for *every* field. + if (requireResolversForAllFields) { + expectResolver('requireResolversForAllFields', requireResolversForAllFields, field, typeName, fieldName); + } + // requires a resolver on every field that has arguments + if (requireResolversForArgs && field.args.length > 0) { + expectResolver('requireResolversForArgs', requireResolversForArgs, field, typeName, fieldName); + } + // requires a resolver on every field that returns a non-scalar type + if (requireResolversForNonScalar !== 'ignore' && !isScalarType(getNamedType(field.type))) { + expectResolver('requireResolversForNonScalar', requireResolversForNonScalar, field, typeName, fieldName); + } + }); +} +function expectResolver(validator, behavior, field, typeName, fieldName) { + if (!field.resolve) { + const message = `Resolver missing for "${typeName}.${fieldName}". +To disable this validator, use: + resolverValidationOptions: { + ${validator}: 'ignore' + }`; + if (behavior === 'error') { + throw new Error(message); + } + if (behavior === 'warn') { + console.warn(message); + } + return; + } + if (typeof field.resolve !== 'function') { + throw new Error(`Resolver "${typeName}.${fieldName}" must be a function`); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/chainResolvers.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/chainResolvers.js new file mode 100644 index 00000000..6e5b9484 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/chainResolvers.js @@ -0,0 +1,9 @@ +import { defaultFieldResolver } from 'graphql'; +export function chainResolvers(resolvers) { + return (root, args, ctx, info) => resolvers.reduce((prev, curResolver) => { + if (curResolver != null) { + return curResolver(prev, args, ctx, info); + } + return defaultFieldResolver(prev, args, ctx, info); + }, root); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/checkForResolveTypeResolver.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/checkForResolveTypeResolver.js new file mode 100644 index 00000000..752a70e4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/checkForResolveTypeResolver.js @@ -0,0 +1,19 @@ +import { MapperKind, mapSchema } from '@graphql-tools/utils'; +// If we have any union or interface types throw if no there is no resolveType resolver +export function checkForResolveTypeResolver(schema, requireResolversForResolveType) { + mapSchema(schema, { + [MapperKind.ABSTRACT_TYPE]: type => { + if (!type.resolveType) { + const message = `Type "${type.name}" is missing a "__resolveType" resolver. Pass 'ignore' into ` + + '"resolverValidationOptions.requireResolversForResolveType" to disable this error.'; + if (requireResolversForResolveType === 'error') { + throw new Error(message); + } + if (requireResolversForResolveType === 'warn') { + console.warn(message); + } + } + return undefined; + }, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/extendResolversFromInterfaces.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/extendResolversFromInterfaces.js new file mode 100644 index 00000000..1d7e8c62 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/extendResolversFromInterfaces.js @@ -0,0 +1,31 @@ +export function extendResolversFromInterfaces(schema, resolvers) { + const extendedResolvers = {}; + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + const type = typeMap[typeName]; + if ('getInterfaces' in type) { + extendedResolvers[typeName] = {}; + for (const iFace of type.getInterfaces()) { + if (resolvers[iFace.name]) { + for (const fieldName in resolvers[iFace.name]) { + if (fieldName === '__isTypeOf' || !fieldName.startsWith('__')) { + extendedResolvers[typeName][fieldName] = resolvers[iFace.name][fieldName]; + } + } + } + } + const typeResolvers = resolvers[typeName]; + extendedResolvers[typeName] = { + ...extendedResolvers[typeName], + ...typeResolvers, + }; + } + else { + const typeResolvers = resolvers[typeName]; + if (typeResolvers != null) { + extendedResolvers[typeName] = typeResolvers; + } + } + } + return extendedResolvers; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/index.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/index.js new file mode 100644 index 00000000..f18afcde --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/index.js @@ -0,0 +1,9 @@ +export { assertResolversPresent } from './assertResolversPresent.js'; +export { chainResolvers } from './chainResolvers.js'; +export { addResolversToSchema } from './addResolversToSchema.js'; +export { checkForResolveTypeResolver } from './checkForResolveTypeResolver.js'; +export { extendResolversFromInterfaces } from './extendResolversFromInterfaces.js'; +export * from './makeExecutableSchema.js'; +export * from './types.js'; +export * from './merge-schemas.js'; +export { extractExtensionsFromSchema } from '@graphql-tools/utils'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/makeExecutableSchema.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/makeExecutableSchema.js new file mode 100644 index 00000000..2ea04aed --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/makeExecutableSchema.js @@ -0,0 +1,90 @@ +import { buildASTSchema, buildSchema, isSchema } from 'graphql'; +import { applyExtensions, mergeResolvers, mergeTypeDefs } from '@graphql-tools/merge'; +import { asArray } from '@graphql-tools/utils'; +import { addResolversToSchema } from './addResolversToSchema.js'; +import { assertResolversPresent } from './assertResolversPresent.js'; +/** + * Builds a schema from the provided type definitions and resolvers. + * + * The type definitions are written using Schema Definition Language (SDL). They + * can be provided as a string, a `DocumentNode`, a function, or an array of any + * of these. If a function is provided, it will be passed no arguments and + * should return an array of strings or `DocumentNode`s. + * + * Note: You can use GraphQL magic comment provide additional syntax + * highlighting in your editor (with the appropriate editor plugin). + * + * ```js + * const typeDefs = /* GraphQL *\/ ` + * type Query { + * posts: [Post] + * author(id: Int!): Author + * } + * `; + * ``` + * + * The `resolvers` object should be a map of type names to nested object, which + * themselves map the type's fields to their appropriate resolvers. + * See the [Resolvers](/docs/resolvers) section of the documentation for more details. + * + * ```js + * const resolvers = { + * Query: { + * posts: (obj, args, ctx, info) => getAllPosts(), + * author: (obj, args, ctx, info) => getAuthorById(args.id) + * } + * }; + * ``` + * + * Once you've defined both the `typeDefs` and `resolvers`, you can create your + * schema: + * + * ```js + * const schema = makeExecutableSchema({ + * typeDefs, + * resolvers, + * }) + * ``` + */ +export function makeExecutableSchema({ typeDefs, resolvers = {}, resolverValidationOptions = {}, inheritResolversFromInterfaces = false, updateResolversInPlace = false, schemaExtensions, defaultFieldResolver, ...otherOptions }) { + // Validate and clean up arguments + if (typeof resolverValidationOptions !== 'object') { + throw new Error('Expected `resolverValidationOptions` to be an object'); + } + if (!typeDefs) { + throw new Error('Must provide typeDefs'); + } + let schema; + if (isSchema(typeDefs)) { + schema = typeDefs; + } + else if (otherOptions?.commentDescriptions) { + const mergedTypeDefs = mergeTypeDefs(typeDefs, { + ...otherOptions, + commentDescriptions: true, + }); + schema = buildSchema(mergedTypeDefs, otherOptions); + } + else { + const mergedTypeDefs = mergeTypeDefs(typeDefs, otherOptions); + schema = buildASTSchema(mergedTypeDefs, otherOptions); + } + // We allow passing in an array of resolver maps, in which case we merge them + schema = addResolversToSchema({ + schema, + resolvers: mergeResolvers(resolvers), + resolverValidationOptions, + inheritResolversFromInterfaces, + updateResolversInPlace, + defaultFieldResolver, + }); + if (Object.keys(resolverValidationOptions).length > 0) { + assertResolversPresent(schema, resolverValidationOptions); + } + if (schemaExtensions) { + for (const schemaExtension of asArray(schemaExtensions)) { + applyExtensions(schema, schemaExtension); + } + } + return schema; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/merge-schemas.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/merge-schemas.js new file mode 100644 index 00000000..2f1eabb0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/merge-schemas.js @@ -0,0 +1,35 @@ +import { asArray, extractExtensionsFromSchema, getDocumentNodeFromSchema, getResolversFromSchema, } from '@graphql-tools/utils'; +import { makeExecutableSchema } from './makeExecutableSchema.js'; +/** + * Synchronously merges multiple schemas, typeDefinitions and/or resolvers into a single schema. + * @param config Configuration object + */ +export function mergeSchemas(config) { + const extractedTypeDefs = []; + const extractedResolvers = []; + const extractedSchemaExtensions = []; + if (config.schemas != null) { + for (const schema of config.schemas) { + extractedTypeDefs.push(getDocumentNodeFromSchema(schema)); + extractedResolvers.push(getResolversFromSchema(schema)); + extractedSchemaExtensions.push(extractExtensionsFromSchema(schema)); + } + } + if (config.typeDefs != null) { + extractedTypeDefs.push(config.typeDefs); + } + if (config.resolvers != null) { + const additionalResolvers = asArray(config.resolvers); + extractedResolvers.push(...additionalResolvers); + } + if (config.schemaExtensions != null) { + const additionalSchemaExtensions = asArray(config.schemaExtensions); + extractedSchemaExtensions.push(...additionalSchemaExtensions); + } + return makeExecutableSchema({ + ...config, + typeDefs: extractedTypeDefs, + resolvers: extractedResolvers, + schemaExtensions: extractedSchemaExtensions, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/types.js b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/esm/types.js new file mode 100644 index 00000000..e69de29b diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/package.json b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/package.json new file mode 100644 index 00000000..66278962 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/package.json @@ -0,0 +1,61 @@ +{ + "name": "@graphql-tools/schema", + "version": "10.1.1", + "description": "A set of utils for faster development of GraphQL tools", + "sideEffects": false, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + }, + "dependencies": { + "@graphql-tools/merge": "^9.2.4", + "@graphql-tools/utils": "^12.0.1", + "tslib": "^2.4.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ardatan/graphql-tools.git", + "directory": "packages/schema" + }, + "license": "MIT", + "engines": { + "node": ">=16.0.0" + }, + "main": "cjs/index.js", + "module": "esm/index.js", + "typings": "typings/index.d.ts", + "typescript": { + "definition": "typings/index.d.ts" + }, + "type": "module", + "exports": { + ".": { + "require": { + "types": "./typings/index.d.cts", + "default": "./cjs/index.js" + }, + "import": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + }, + "default": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + } + }, + "./*": { + "require": { + "types": "./typings/*.d.cts", + "default": "./cjs/*.js" + }, + "import": { + "types": "./typings/*.d.ts", + "default": "./esm/*.js" + }, + "default": { + "types": "./typings/*.d.ts", + "default": "./esm/*.js" + } + }, + "./package.json": "./package.json" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.cts new file mode 100644 index 00000000..dc33abfb --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IAddResolversToSchemaOptions } from '@graphql-tools/utils'; +export declare function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, }: IAddResolversToSchemaOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.ts new file mode 100644 index 00000000..dc33abfb --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/addResolversToSchema.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IAddResolversToSchemaOptions } from '@graphql-tools/utils'; +export declare function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, }: IAddResolversToSchemaOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.cts new file mode 100644 index 00000000..c3dc18b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IResolverValidationOptions } from '@graphql-tools/utils'; +export declare function assertResolversPresent(schema: GraphQLSchema, resolverValidationOptions?: IResolverValidationOptions): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.ts new file mode 100644 index 00000000..c3dc18b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/assertResolversPresent.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IResolverValidationOptions } from '@graphql-tools/utils'; +export declare function assertResolversPresent(schema: GraphQLSchema, resolverValidationOptions?: IResolverValidationOptions): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.cts new file mode 100644 index 00000000..0f7cc0ef --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.cts @@ -0,0 +1,5 @@ +import { GraphQLFieldResolver } from 'graphql'; +import { GraphQLResolveInfo, Maybe } from '@graphql-tools/utils'; +export declare function chainResolvers(resolvers: Array>>): (root: any, args: TArgs, ctx: any, info: GraphQLResolveInfo) => any; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.ts new file mode 100644 index 00000000..0f7cc0ef --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/chainResolvers.d.ts @@ -0,0 +1,5 @@ +import { GraphQLFieldResolver } from 'graphql'; +import { GraphQLResolveInfo, Maybe } from '@graphql-tools/utils'; +export declare function chainResolvers(resolvers: Array>>): (root: any, args: TArgs, ctx: any, info: GraphQLResolveInfo) => any; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.cts new file mode 100644 index 00000000..86452581 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { ValidatorBehavior } from '@graphql-tools/utils'; +export declare function checkForResolveTypeResolver(schema: GraphQLSchema, requireResolversForResolveType?: ValidatorBehavior): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.ts new file mode 100644 index 00000000..86452581 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/checkForResolveTypeResolver.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { ValidatorBehavior } from '@graphql-tools/utils'; +export declare function checkForResolveTypeResolver(schema: GraphQLSchema, requireResolversForResolveType?: ValidatorBehavior): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.cts new file mode 100644 index 00000000..4b46bb3b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IResolvers } from '@graphql-tools/utils'; +export declare function extendResolversFromInterfaces(schema: GraphQLSchema, resolvers: IResolvers): IResolvers; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.ts new file mode 100644 index 00000000..4b46bb3b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/extendResolversFromInterfaces.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IResolvers } from '@graphql-tools/utils'; +export declare function extendResolversFromInterfaces(schema: GraphQLSchema, resolvers: IResolvers): IResolvers; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.cts new file mode 100644 index 00000000..8a1095c4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.cts @@ -0,0 +1,9 @@ +export { assertResolversPresent } from './assertResolversPresent.cjs'; +export { chainResolvers } from './chainResolvers.cjs'; +export { addResolversToSchema } from './addResolversToSchema.cjs'; +export { checkForResolveTypeResolver } from './checkForResolveTypeResolver.cjs'; +export { extendResolversFromInterfaces } from './extendResolversFromInterfaces.cjs'; +export * from './makeExecutableSchema.cjs'; +export * from './types.cjs'; +export * from './merge-schemas.cjs'; +export { extractExtensionsFromSchema } from '@graphql-tools/utils'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.ts new file mode 100644 index 00000000..f18afcde --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/index.d.ts @@ -0,0 +1,9 @@ +export { assertResolversPresent } from './assertResolversPresent.js'; +export { chainResolvers } from './chainResolvers.js'; +export { addResolversToSchema } from './addResolversToSchema.js'; +export { checkForResolveTypeResolver } from './checkForResolveTypeResolver.js'; +export { extendResolversFromInterfaces } from './extendResolversFromInterfaces.js'; +export * from './makeExecutableSchema.js'; +export * from './types.js'; +export * from './merge-schemas.js'; +export { extractExtensionsFromSchema } from '@graphql-tools/utils'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.cts new file mode 100644 index 00000000..a5a73763 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.cts @@ -0,0 +1,46 @@ +import { GraphQLSchema } from 'graphql'; +import { IExecutableSchemaDefinition } from './types.cjs'; +/** + * Builds a schema from the provided type definitions and resolvers. + * + * The type definitions are written using Schema Definition Language (SDL). They + * can be provided as a string, a `DocumentNode`, a function, or an array of any + * of these. If a function is provided, it will be passed no arguments and + * should return an array of strings or `DocumentNode`s. + * + * Note: You can use GraphQL magic comment provide additional syntax + * highlighting in your editor (with the appropriate editor plugin). + * + * ```js + * const typeDefs = /* GraphQL *\/ ` + * type Query { + * posts: [Post] + * author(id: Int!): Author + * } + * `; + * ``` + * + * The `resolvers` object should be a map of type names to nested object, which + * themselves map the type's fields to their appropriate resolvers. + * See the [Resolvers](/docs/resolvers) section of the documentation for more details. + * + * ```js + * const resolvers = { + * Query: { + * posts: (obj, args, ctx, info) => getAllPosts(), + * author: (obj, args, ctx, info) => getAuthorById(args.id) + * } + * }; + * ``` + * + * Once you've defined both the `typeDefs` and `resolvers`, you can create your + * schema: + * + * ```js + * const schema = makeExecutableSchema({ + * typeDefs, + * resolvers, + * }) + * ``` + */ +export declare function makeExecutableSchema({ typeDefs, resolvers, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, schemaExtensions, defaultFieldResolver, ...otherOptions }: IExecutableSchemaDefinition): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.ts new file mode 100644 index 00000000..abf52d75 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/makeExecutableSchema.d.ts @@ -0,0 +1,46 @@ +import { GraphQLSchema } from 'graphql'; +import { IExecutableSchemaDefinition } from './types.js'; +/** + * Builds a schema from the provided type definitions and resolvers. + * + * The type definitions are written using Schema Definition Language (SDL). They + * can be provided as a string, a `DocumentNode`, a function, or an array of any + * of these. If a function is provided, it will be passed no arguments and + * should return an array of strings or `DocumentNode`s. + * + * Note: You can use GraphQL magic comment provide additional syntax + * highlighting in your editor (with the appropriate editor plugin). + * + * ```js + * const typeDefs = /* GraphQL *\/ ` + * type Query { + * posts: [Post] + * author(id: Int!): Author + * } + * `; + * ``` + * + * The `resolvers` object should be a map of type names to nested object, which + * themselves map the type's fields to their appropriate resolvers. + * See the [Resolvers](/docs/resolvers) section of the documentation for more details. + * + * ```js + * const resolvers = { + * Query: { + * posts: (obj, args, ctx, info) => getAllPosts(), + * author: (obj, args, ctx, info) => getAuthorById(args.id) + * } + * }; + * ``` + * + * Once you've defined both the `typeDefs` and `resolvers`, you can create your + * schema: + * + * ```js + * const schema = makeExecutableSchema({ + * typeDefs, + * resolvers, + * }) + * ``` + */ +export declare function makeExecutableSchema({ typeDefs, resolvers, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, schemaExtensions, defaultFieldResolver, ...otherOptions }: IExecutableSchemaDefinition): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.cts new file mode 100644 index 00000000..2385f0c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.cts @@ -0,0 +1,16 @@ +import { GraphQLSchema } from 'graphql'; +import { IExecutableSchemaDefinition } from './types.cjs'; +/** + * Configuration object for schema merging + */ +export type MergeSchemasConfig = Partial> & { + /** + * The schemas to be merged + */ + schemas?: GraphQLSchema[]; +}; +/** + * Synchronously merges multiple schemas, typeDefinitions and/or resolvers into a single schema. + * @param config Configuration object + */ +export declare function mergeSchemas(config: MergeSchemasConfig): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.ts new file mode 100644 index 00000000..86e9772f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/merge-schemas.d.ts @@ -0,0 +1,16 @@ +import { GraphQLSchema } from 'graphql'; +import { IExecutableSchemaDefinition } from './types.js'; +/** + * Configuration object for schema merging + */ +export type MergeSchemasConfig = Partial> & { + /** + * The schemas to be merged + */ + schemas?: GraphQLSchema[]; +}; +/** + * Synchronously merges multiple schemas, typeDefinitions and/or resolvers into a single schema. + * @param config Configuration object + */ +export declare function mergeSchemas(config: MergeSchemasConfig): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.cts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.cts new file mode 100644 index 00000000..b1c93fc6 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.cts @@ -0,0 +1,39 @@ +import { BuildSchemaOptions, GraphQLFieldResolver, GraphQLSchema } from 'graphql'; +import { GraphQLParseOptions, IResolvers, IResolverValidationOptions, SchemaExtensions, TypeSource } from '@graphql-tools/utils'; +export interface GraphQLSchemaWithContext extends GraphQLSchema { + __context?: TContext; +} +/** + * Configuration object for creating an executable schema + */ +export interface IExecutableSchemaDefinition extends BuildSchemaOptions, GraphQLParseOptions { + /** + * The type definitions used to create the schema + */ + typeDefs: TypeSource; + /** + * Object describing the field resolvers for the provided type definitions + */ + resolvers?: IResolvers | Array>; + /** + * Additional options for validating the provided resolvers + */ + resolverValidationOptions?: IResolverValidationOptions; + /** + * GraphQL object types that implement interfaces will inherit any missing + * resolvers from their interface types defined in the `resolvers` object + */ + inheritResolversFromInterfaces?: boolean; + /** + * Do not create a schema again and use the one from `buildASTSchema` + */ + updateResolversInPlace?: boolean; + /** + * Schema extensions + */ + schemaExtensions?: SchemaExtensions | Array; + /** + * Default field resolver + */ + defaultFieldResolver?: GraphQLFieldResolver; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.ts b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.ts new file mode 100644 index 00000000..b1c93fc6 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema/typings/types.d.ts @@ -0,0 +1,39 @@ +import { BuildSchemaOptions, GraphQLFieldResolver, GraphQLSchema } from 'graphql'; +import { GraphQLParseOptions, IResolvers, IResolverValidationOptions, SchemaExtensions, TypeSource } from '@graphql-tools/utils'; +export interface GraphQLSchemaWithContext extends GraphQLSchema { + __context?: TContext; +} +/** + * Configuration object for creating an executable schema + */ +export interface IExecutableSchemaDefinition extends BuildSchemaOptions, GraphQLParseOptions { + /** + * The type definitions used to create the schema + */ + typeDefs: TypeSource; + /** + * Object describing the field resolvers for the provided type definitions + */ + resolvers?: IResolvers | Array>; + /** + * Additional options for validating the provided resolvers + */ + resolverValidationOptions?: IResolverValidationOptions; + /** + * GraphQL object types that implement interfaces will inherit any missing + * resolvers from their interface types defined in the `resolvers` object + */ + inheritResolversFromInterfaces?: boolean; + /** + * Do not create a schema again and use the one from `buildASTSchema` + */ + updateResolversInPlace?: boolean; + /** + * Schema extensions + */ + schemaExtensions?: SchemaExtensions | Array; + /** + * Default field resolver + */ + defaultFieldResolver?: GraphQLFieldResolver; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/utils b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/utils new file mode 120000 index 00000000..95e3dc23 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/utils @@ -0,0 +1 @@ +../../../@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/tslib b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/tslib new file mode 120000 index 00000000..4edba0e2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/tslib @@ -0,0 +1 @@ +../../tslib@2.8.1/node_modules/tslib \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/AccumulatorMap.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/AccumulatorMap.js new file mode 100644 index 00000000..ad7293f5 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/AccumulatorMap.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccumulatorMap = void 0; +/** + * ES6 Map with additional `add` method to accumulate items. + */ +class AccumulatorMap extends Map { + get [Symbol.toStringTag]() { + return 'AccumulatorMap'; + } + add(key, item) { + const group = this.get(key); + if (group === undefined) { + this.set(key, [item]); + } + else { + group.push(item); + } + } +} +exports.AccumulatorMap = AccumulatorMap; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Interfaces.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Interfaces.js new file mode 100644 index 00000000..00ca4115 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Interfaces.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MapperKind = void 0; +var MapperKind; +(function (MapperKind) { + MapperKind["TYPE"] = "MapperKind.TYPE"; + MapperKind["SCALAR_TYPE"] = "MapperKind.SCALAR_TYPE"; + MapperKind["ENUM_TYPE"] = "MapperKind.ENUM_TYPE"; + MapperKind["COMPOSITE_TYPE"] = "MapperKind.COMPOSITE_TYPE"; + MapperKind["OBJECT_TYPE"] = "MapperKind.OBJECT_TYPE"; + MapperKind["INPUT_OBJECT_TYPE"] = "MapperKind.INPUT_OBJECT_TYPE"; + MapperKind["ABSTRACT_TYPE"] = "MapperKind.ABSTRACT_TYPE"; + MapperKind["UNION_TYPE"] = "MapperKind.UNION_TYPE"; + MapperKind["INTERFACE_TYPE"] = "MapperKind.INTERFACE_TYPE"; + MapperKind["ROOT_OBJECT"] = "MapperKind.ROOT_OBJECT"; + MapperKind["QUERY"] = "MapperKind.QUERY"; + MapperKind["MUTATION"] = "MapperKind.MUTATION"; + MapperKind["SUBSCRIPTION"] = "MapperKind.SUBSCRIPTION"; + MapperKind["DIRECTIVE"] = "MapperKind.DIRECTIVE"; + MapperKind["FIELD"] = "MapperKind.FIELD"; + MapperKind["COMPOSITE_FIELD"] = "MapperKind.COMPOSITE_FIELD"; + MapperKind["OBJECT_FIELD"] = "MapperKind.OBJECT_FIELD"; + MapperKind["ROOT_FIELD"] = "MapperKind.ROOT_FIELD"; + MapperKind["QUERY_ROOT_FIELD"] = "MapperKind.QUERY_ROOT_FIELD"; + MapperKind["MUTATION_ROOT_FIELD"] = "MapperKind.MUTATION_ROOT_FIELD"; + MapperKind["SUBSCRIPTION_ROOT_FIELD"] = "MapperKind.SUBSCRIPTION_ROOT_FIELD"; + MapperKind["INTERFACE_FIELD"] = "MapperKind.INTERFACE_FIELD"; + MapperKind["INPUT_OBJECT_FIELD"] = "MapperKind.INPUT_OBJECT_FIELD"; + MapperKind["ARGUMENT"] = "MapperKind.ARGUMENT"; + MapperKind["ENUM_VALUE"] = "MapperKind.ENUM_VALUE"; +})(MapperKind || (exports.MapperKind = MapperKind = {})); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Path.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Path.js new file mode 100644 index 00000000..08438ccd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/Path.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addPath = addPath; +exports.pathToArray = pathToArray; +exports.printPathArray = printPathArray; +/** + * Given a Path and a key, return a new Path containing the new key. + */ +function addPath(prev, key, typename) { + return { prev, key, typename }; +} +/** + * Given a Path, return an Array of the path keys. + */ +function pathToArray(path) { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + return flattened.reverse(); +} +/** + * Build a string describing the path. + */ +function printPathArray(path) { + return path + .map(key => (typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key)) + .join(''); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/addTypes.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/addTypes.js new file mode 100644 index 00000000..771c0176 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/addTypes.js @@ -0,0 +1,61 @@ +"use strict"; +// addTypes uses toConfig to create a new schema with a new or replaced +// type or directive. Rewiring is employed so that the replaced type can be +// reconnected with the existing types. +// +// Rewiring is employed even for new types or directives as a convenience, so +// that type references within the new type or directive do not have to be to +// the identical objects within the original schema. +// +// In fact, the type references could even be stub types with entirely different +// fields, as long as the type references share the same name as the desired +// type within the original schema's type map. +// +// This makes it easy to perform simple schema operations (e.g. adding a new +// type with a fiew fields removed from an existing type) that could normally be +// performed by using toConfig directly, but is blocked if any intervening +// more advanced schema operations have caused the types to be recreated via +// rewiring. +// +// Type recreation happens, for example, with every use of mapSchema, as the +// types are always rewired. If fields are selected and removed using +// mapSchema, adding those fields to a new type can no longer be simply done +// by toConfig, as the types are not the identical JavaScript objects, and +// schema creation will fail with errors referencing multiple types with the +// same names. +// +// enhanceSchema can fill this gap by adding an additional round of rewiring. +// +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addTypes = addTypes; +const graphql_1 = require("graphql"); +const getObjectTypeFromTypeMap_js_1 = require("./getObjectTypeFromTypeMap.js"); +const rewire_js_1 = require("./rewire.js"); +function addTypes(schema, newTypesOrDirectives) { + const config = schema.toConfig(); + const originalTypeMap = {}; + for (const type of config.types) { + originalTypeMap[type.name] = type; + } + const originalDirectiveMap = {}; + for (const directive of config.directives) { + originalDirectiveMap[directive.name] = directive; + } + for (const newTypeOrDirective of newTypesOrDirectives) { + if ((0, graphql_1.isNamedType)(newTypeOrDirective)) { + originalTypeMap[newTypeOrDirective.name] = newTypeOrDirective; + } + else if ((0, graphql_1.isDirective)(newTypeOrDirective)) { + originalDirectiveMap[newTypeOrDirective.name] = newTypeOrDirective; + } + } + const { typeMap, directives } = (0, rewire_js_1.rewireTypes)(originalTypeMap, Object.values(originalDirectiveMap)); + return new graphql_1.GraphQLSchema({ + ...config, + query: (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(typeMap, schema.getQueryType()), + mutation: (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(typeMap, schema.getMutationType()), + subscription: (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(typeMap, schema.getSubscriptionType()), + types: Object.values(typeMap), + directives, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromType.js new file mode 100644 index 00000000..e2f6d654 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromType.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astFromType = astFromType; +const cross_inspect_1 = require("cross-inspect"); +const graphql_1 = require("graphql"); +function astFromType(type) { + if ((0, graphql_1.isNonNullType)(type)) { + const innerType = astFromType(type.ofType); + if (innerType.kind === graphql_1.Kind.NON_NULL_TYPE) { + throw new Error(`Invalid type node ${(0, cross_inspect_1.inspect)(type)}. Inner type of non-null type cannot be a non-null type.`); + } + return { + kind: graphql_1.Kind.NON_NULL_TYPE, + type: innerType, + }; + } + else if ((0, graphql_1.isListType)(type)) { + return { + kind: graphql_1.Kind.LIST_TYPE, + type: astFromType(type.ofType), + }; + } + return { + kind: graphql_1.Kind.NAMED_TYPE, + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValue.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValue.js new file mode 100644 index 00000000..27c05022 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValue.js @@ -0,0 +1,115 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astFromValue = astFromValue; +const graphql_1 = require("graphql"); +const astFromValueUntyped_js_1 = require("./astFromValueUntyped.js"); +const jsutils_js_1 = require("./jsutils.js"); +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. For example: + * + * astFromValue("value", GraphQLString) + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | BigInt | Int | + * | Unknown | Enum Value | + * | null | NullValue | + * + */ +function astFromValue(value, type) { + if ((0, graphql_1.isNonNullType)(type)) { + const astValue = astFromValue(value, type.ofType); + if (astValue?.kind === graphql_1.Kind.NULL) { + return null; + } + return astValue; + } + // only explicit null, not undefined, NaN + if (value === null) { + return { kind: graphql_1.Kind.NULL }; + } + // undefined + if (value === undefined) { + return null; + } + // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + if ((0, graphql_1.isListType)(type)) { + const itemType = type.ofType; + if ((0, jsutils_js_1.isIterableObject)(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValue(item, itemType); + if (itemNode != null) { + valuesNodes.push(itemNode); + } + } + return { kind: graphql_1.Kind.LIST, values: valuesNodes }; + } + return astFromValue(value, itemType); + } + // Populate the fields of the input object by creating ASTs from each value + // in the JavaScript object according to the fields in the input type. + if ((0, graphql_1.isInputObjectType)(type)) { + if (!(0, jsutils_js_1.isObjectLike)(value)) { + return null; + } + const fieldNodes = []; + for (const field of Object.values(type.getFields())) { + const fieldValue = astFromValue(value[field.name], field.type); + if (fieldValue) { + fieldNodes.push({ + kind: graphql_1.Kind.OBJECT_FIELD, + name: { kind: graphql_1.Kind.NAME, value: field.name }, + value: fieldValue, + }); + } + } + return { kind: graphql_1.Kind.OBJECT, fields: fieldNodes }; + } + if ((0, graphql_1.isLeafType)(type)) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + if ((0, graphql_1.isEnumType)(type)) { + const values = type.getValues(); + for (const enumValue of values) { + if (enumValue.value === value) { + value = enumValue.name; + break; + } + if (enumValue.name === value) { + value = enumValue.name; + break; + } + } + return { kind: graphql_1.Kind.ENUM, value: value }; + } + else { + value = type.serialize(value); + } + if (value == null) { + return null; + } + // ID types can use Int literals. + if (type.name === 'ID' && typeof value === 'string' && integerStringRegExp.test(value)) { + return { kind: graphql_1.Kind.INT, value }; + } + } + return (0, astFromValueUntyped_js_1.astFromValueUntyped)(value); +} +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValueUntyped.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValueUntyped.js new file mode 100644 index 00000000..76a9ad59 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/astFromValueUntyped.js @@ -0,0 +1,84 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astFromValueUntyped = astFromValueUntyped; +const graphql_1 = require("graphql"); +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using the following mapping. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String | + * | Number | Int / Float | + * | BigInt | Int | + * | null | NullValue | + * + */ +function astFromValueUntyped(value) { + // only explicit null, not undefined, NaN + if (value === null) { + return { kind: graphql_1.Kind.NULL }; + } + // undefined + if (value === undefined) { + return null; + } + // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + if (Array.isArray(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValueUntyped(item); + if (itemNode != null) { + valuesNodes.push(itemNode); + } + } + return { kind: graphql_1.Kind.LIST, values: valuesNodes }; + } + if (typeof value === 'object') { + if (value?.toJSON) { + return astFromValueUntyped(value.toJSON()); + } + const fieldNodes = []; + for (const fieldName in value) { + const fieldValue = value[fieldName]; + const ast = astFromValueUntyped(fieldValue); + if (ast) { + fieldNodes.push({ + kind: graphql_1.Kind.OBJECT_FIELD, + name: { kind: graphql_1.Kind.NAME, value: fieldName }, + value: ast, + }); + } + } + return { kind: graphql_1.Kind.OBJECT, fields: fieldNodes }; + } + // Others serialize based on their corresponding JavaScript scalar types. + if (typeof value === 'boolean') { + return { kind: graphql_1.Kind.BOOLEAN, value }; + } + if (typeof value === 'bigint') { + return { kind: graphql_1.Kind.INT, value: String(value) }; + } + // JavaScript numbers can be Int or Float values. + if (typeof value === 'number' && isFinite(value)) { + const stringNum = String(value); + return integerStringRegExp.test(stringNum) + ? { kind: graphql_1.Kind.INT, value: stringNum } + : { kind: graphql_1.Kind.FLOAT, value: stringNum }; + } + if (typeof value === 'string') { + return { kind: graphql_1.Kind.STRING, value }; + } + throw new TypeError(`Cannot convert value to AST: ${value}.`); +} +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/build-operation-for-field.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/build-operation-for-field.js new file mode 100644 index 00000000..56345c0a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/build-operation-for-field.js @@ -0,0 +1,363 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildOperationNodeForField = buildOperationNodeForField; +const graphql_1 = require("graphql"); +const astFromValueUntyped_js_1 = require("./astFromValueUntyped.js"); +const defaultValueAstFromType_js_1 = require("./defaultValueAstFromType.js"); +const rootTypes_js_1 = require("./rootTypes.js"); +let operationVariables = []; +let fieldTypeMap = new Map(); +function addOperationVariable(variable) { + operationVariables.push(variable); +} +function resetOperationVariables() { + operationVariables = []; +} +function resetFieldMap() { + fieldTypeMap = new Map(); +} +function buildOperationNodeForField({ schema, kind, field, models, ignore = [], depthLimit, circularReferenceDepth, argNames, selectedFields = true, }) { + resetOperationVariables(); + resetFieldMap(); + const rootTypeNames = (0, rootTypes_js_1.getRootTypeNames)(schema); + const operationNode = buildOperationAndCollectVariables({ + schema, + fieldName: field, + kind, + models: models || [], + ignore, + depthLimit: depthLimit || Infinity, + circularReferenceDepth: circularReferenceDepth || 1, + argNames, + selectedFields, + rootTypeNames, + }); + // attach variables + operationNode.variableDefinitions = [...operationVariables]; + resetOperationVariables(); + resetFieldMap(); + return operationNode; +} +function buildOperationAndCollectVariables({ schema, fieldName, kind, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, rootTypeNames, }) { + const type = (0, rootTypes_js_1.getDefinedRootType)(schema, kind); + const field = type.getFields()[fieldName]; + const operationName = `${fieldName}_${kind}`; + if (field.args) { + for (const arg of field.args) { + const argName = arg.name; + if (!argNames || argNames.includes(argName)) { + addOperationVariable(resolveVariable(arg, argName)); + } + } + } + return { + kind: graphql_1.Kind.OPERATION_DEFINITION, + operation: kind, + name: { + kind: graphql_1.Kind.NAME, + value: operationName, + }, + variableDefinitions: [], + selectionSet: { + kind: graphql_1.Kind.SELECTION_SET, + selections: [ + resolveField({ + type, + field, + models, + firstCall: true, + path: [], + ancestors: [], + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth: 0, + argNames, + selectedFields, + rootTypeNames, + }), + ], + }, + }; +} +function resolveSelectionSet({ parent, type, models, firstCall, path, ancestors, ignore, depthLimit, circularReferenceDepth, schema, depth, argNames, selectedFields, rootTypeNames, }) { + if (typeof selectedFields === 'boolean' && depth > depthLimit) { + return; + } + if ((0, graphql_1.isUnionType)(type)) { + const types = type.getTypes(); + return { + kind: graphql_1.Kind.SELECTION_SET, + selections: types + .filter(t => !hasCircularRef([...ancestors, t], { + depth: circularReferenceDepth, + })) + .map(t => { + return { + kind: graphql_1.Kind.INLINE_FRAGMENT, + typeCondition: { + kind: graphql_1.Kind.NAMED_TYPE, + name: { + kind: graphql_1.Kind.NAME, + value: t.name, + }, + }, + selectionSet: resolveSelectionSet({ + parent: type, + type: t, + models, + path, + ancestors, + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth, + argNames, + selectedFields, + rootTypeNames, + }), + }; + }) + .filter(fragmentNode => fragmentNode?.selectionSet?.selections?.length > 0), + }; + } + if ((0, graphql_1.isInterfaceType)(type)) { + const types = Object.values(schema.getTypeMap()).filter((t) => (0, graphql_1.isObjectType)(t) && t.getInterfaces().includes(type)); + return { + kind: graphql_1.Kind.SELECTION_SET, + selections: types + .filter(t => !hasCircularRef([...ancestors, t], { + depth: circularReferenceDepth, + })) + .map(t => { + return { + kind: graphql_1.Kind.INLINE_FRAGMENT, + typeCondition: { + kind: graphql_1.Kind.NAMED_TYPE, + name: { + kind: graphql_1.Kind.NAME, + value: t.name, + }, + }, + selectionSet: resolveSelectionSet({ + parent: type, + type: t, + models, + path, + ancestors, + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth, + argNames, + selectedFields, + rootTypeNames, + }), + }; + }) + .filter(fragmentNode => fragmentNode?.selectionSet?.selections?.length > 0), + }; + } + if ((0, graphql_1.isObjectType)(type) && !rootTypeNames.has(type.name)) { + const isIgnored = ignore.includes(type.name) || ignore.includes(`${parent.name}.${path[path.length - 1]}`); + const isModel = models.includes(type.name); + if (!firstCall && isModel && !isIgnored) { + return { + kind: graphql_1.Kind.SELECTION_SET, + selections: [ + { + kind: graphql_1.Kind.FIELD, + name: { + kind: graphql_1.Kind.NAME, + value: 'id', + }, + }, + ], + }; + } + const fields = type.getFields(); + return { + kind: graphql_1.Kind.SELECTION_SET, + selections: Object.keys(fields) + .filter(fieldName => { + return !hasCircularRef([...ancestors, (0, graphql_1.getNamedType)(fields[fieldName].type)], { + depth: circularReferenceDepth, + }); + }) + .map(fieldName => { + const selectedSubFields = typeof selectedFields === 'object' ? selectedFields[fieldName] : true; + if (selectedSubFields) { + return resolveField({ + type, + field: fields[fieldName], + models, + path: [...path, fieldName], + ancestors, + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth, + argNames, + selectedFields: selectedSubFields, + rootTypeNames, + }); + } + return null; + }) + .filter((f) => { + if (f == null) { + return false; + } + else if ('selectionSet' in f) { + return !!f.selectionSet?.selections?.length; + } + return true; + }), + }; + } +} +function resolveVariable(arg, name) { + function resolveVariableType(type) { + if ((0, graphql_1.isListType)(type)) { + return { + kind: graphql_1.Kind.LIST_TYPE, + type: resolveVariableType(type.ofType), + }; + } + if ((0, graphql_1.isNonNullType)(type)) { + return { + kind: graphql_1.Kind.NON_NULL_TYPE, + // for v16 compatibility + type: resolveVariableType(type.ofType), + }; + } + return { + kind: graphql_1.Kind.NAMED_TYPE, + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + }; + } + let defaultValue; + try { + defaultValue = (0, defaultValueAstFromType_js_1.defaultValueAstFromType)(arg); + } + catch (e) { + defaultValue = (0, astFromValueUntyped_js_1.astFromValueUntyped)(arg.defaultValue) ?? undefined; + } + return { + kind: graphql_1.Kind.VARIABLE_DEFINITION, + variable: { + kind: graphql_1.Kind.VARIABLE, + name: { + kind: graphql_1.Kind.NAME, + value: name || arg.name, + }, + }, + type: resolveVariableType(arg.type), + defaultValue, + }; +} +function getArgumentName(name, path) { + return [...path, name].join('_'); +} +function resolveField({ type, field, models, firstCall, path, ancestors, ignore, depthLimit, circularReferenceDepth, schema, depth, argNames, selectedFields, rootTypeNames, }) { + const namedType = (0, graphql_1.getNamedType)(field.type); + let args = []; + let removeField = false; + if (field.args && field.args.length) { + args = field.args + .map(arg => { + const argumentName = getArgumentName(arg.name, path); + if (argNames && !argNames.includes(argumentName)) { + if ((0, graphql_1.isNonNullType)(arg.type)) { + removeField = true; + } + return null; + } + if (!firstCall) { + addOperationVariable(resolveVariable(arg, argumentName)); + } + return { + kind: graphql_1.Kind.ARGUMENT, + name: { + kind: graphql_1.Kind.NAME, + value: arg.name, + }, + value: { + kind: graphql_1.Kind.VARIABLE, + name: { + kind: graphql_1.Kind.NAME, + value: getArgumentName(arg.name, path), + }, + }, + }; + }) + .filter(Boolean); + } + if (removeField) { + return null; + } + const fieldPath = [...path, field.name]; + const fieldPathStr = fieldPath.join('.'); + let fieldName = field.name; + if (fieldTypeMap.has(fieldPathStr) && fieldTypeMap.get(fieldPathStr) !== field.type.toString()) { + fieldName += field.type + .toString() + .replace(/!/g, 'NonNull') + .replace(/\[/g, 'List') + .replace(/\]/g, ''); + } + fieldTypeMap.set(fieldPathStr, field.type.toString()); + if (!(0, graphql_1.isScalarType)(namedType) && !(0, graphql_1.isEnumType)(namedType)) { + return { + kind: graphql_1.Kind.FIELD, + name: { + kind: graphql_1.Kind.NAME, + value: field.name, + }, + ...(fieldName !== field.name && { alias: { kind: graphql_1.Kind.NAME, value: fieldName } }), + selectionSet: resolveSelectionSet({ + parent: type, + type: namedType, + models, + firstCall, + path: fieldPath, + ancestors: [...ancestors, type], + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth: depth + 1, + argNames, + selectedFields, + rootTypeNames, + }) || undefined, + arguments: args, + }; + } + return { + kind: graphql_1.Kind.FIELD, + name: { + kind: graphql_1.Kind.NAME, + value: field.name, + }, + ...(fieldName !== field.name && { alias: { kind: graphql_1.Kind.NAME, value: fieldName } }), + arguments: args, + }; +} +function hasCircularRef(types, config = { + depth: 1, +}) { + const type = types[types.length - 1]; + if ((0, graphql_1.isScalarType)(type)) { + return false; + } + const size = types.filter(t => t.name === type.name).length; + return size > config.depth; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/collectFields.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/collectFields.js new file mode 100644 index 00000000..3fbdc80a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/collectFields.js @@ -0,0 +1,168 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.collectSubFields = void 0; +exports.collectFields = collectFields; +exports.shouldIncludeNode = shouldIncludeNode; +exports.doesFragmentConditionMatch = doesFragmentConditionMatch; +exports.getFieldEntryKey = getFieldEntryKey; +exports.getDeferValues = getDeferValues; +const graphql_1 = require("graphql"); +const AccumulatorMap_js_1 = require("./AccumulatorMap.js"); +const directives_js_1 = require("./directives.js"); +const getDirectiveValues_js_1 = require("./getDirectiveValues.js"); +const memoize_js_1 = require("./memoize.js"); +function collectFieldsImpl(schema, fragments, variableValues, runtimeType, selectionSet, fields, patches, visitedFragmentNames) { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case graphql_1.Kind.FIELD: { + if (!shouldIncludeNode(variableValues, selection)) { + continue; + } + fields.add(getFieldEntryKey(selection), selection); + break; + } + case graphql_1.Kind.INLINE_FRAGMENT: { + if (!shouldIncludeNode(variableValues, selection) || + !doesFragmentConditionMatch(schema, selection, runtimeType)) { + continue; + } + const defer = getDeferValues(variableValues, selection); + if (defer) { + const patchFields = new AccumulatorMap_js_1.AccumulatorMap(); + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selection.selectionSet, patchFields, patches, visitedFragmentNames); + patches.push({ + label: defer.label, + fields: patchFields, + }); + } + else { + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selection.selectionSet, fields, patches, visitedFragmentNames); + } + break; + } + case graphql_1.Kind.FRAGMENT_SPREAD: { + const fragName = selection.name.value; + if (!shouldIncludeNode(variableValues, selection)) { + continue; + } + const defer = getDeferValues(variableValues, selection); + if (visitedFragmentNames.has(fragName) && !defer) { + continue; + } + const fragment = fragments[fragName]; + if (!fragment || !doesFragmentConditionMatch(schema, fragment, runtimeType)) { + continue; + } + if (!defer) { + visitedFragmentNames.add(fragName); + } + if (defer) { + const patchFields = new AccumulatorMap_js_1.AccumulatorMap(); + collectFieldsImpl(schema, fragments, variableValues, runtimeType, fragment.selectionSet, patchFields, patches, visitedFragmentNames); + patches.push({ + label: defer.label, + fields: patchFields, + }); + } + else { + collectFieldsImpl(schema, fragments, variableValues, runtimeType, fragment.selectionSet, fields, patches, visitedFragmentNames); + } + break; + } + } + } +} +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + */ +function collectFields(schema, fragments, variableValues, runtimeType, selectionSet) { + const fields = new AccumulatorMap_js_1.AccumulatorMap(); + const patches = []; + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selectionSet, fields, patches, new Set()); + return { fields, patches }; +} +/** + * Determines if a field should be included based on the `@include` and `@skip` + * directives, where `@skip` has higher precedence than `@include`. + */ +function shouldIncludeNode(variableValues, node) { + const skip = (0, getDirectiveValues_js_1.getDirectiveValues)(graphql_1.GraphQLSkipDirective, node, variableValues); + if (skip?.['if'] === true) { + return false; + } + const include = (0, getDirectiveValues_js_1.getDirectiveValues)(graphql_1.GraphQLIncludeDirective, node, variableValues); + if (include?.['if'] === false) { + return false; + } + return true; +} +/** + * Determines if a fragment is applicable to the given type. + */ +function doesFragmentConditionMatch(schema, fragment, type) { + const typeConditionNode = fragment.typeCondition; + if (!typeConditionNode) { + return true; + } + const conditionalType = (0, graphql_1.typeFromAST)(schema, typeConditionNode); + if (conditionalType === type) { + return true; + } + if ((0, graphql_1.isAbstractType)(conditionalType)) { + const possibleTypes = schema.getPossibleTypes(conditionalType); + return possibleTypes.includes(type); + } + return false; +} +/** + * Implements the logic to compute the key of a given field's entry + */ +function getFieldEntryKey(node) { + return node.alias ? node.alias.value : node.name.value; +} +/** + * Returns an object containing the `@defer` arguments if a field should be + * deferred based on the experimental flag, defer directive present and + * not disabled by the "if" argument. + */ +function getDeferValues(variableValues, node) { + const defer = (0, getDirectiveValues_js_1.getDirectiveValues)(directives_js_1.GraphQLDeferDirective, node, variableValues); + if (!defer) { + return; + } + if (defer['if'] === false) { + return; + } + return { + label: typeof defer['label'] === 'string' ? defer['label'] : undefined, + }; +} +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + */ +exports.collectSubFields = (0, memoize_js_1.memoize5)(function collectSubfields(schema, fragments, variableValues, returnType, fieldNodes) { + const subFieldNodes = new AccumulatorMap_js_1.AccumulatorMap(); + const visitedFragmentNames = new Set(); + const subPatches = []; + const subFieldsAndPatches = { + fields: subFieldNodes, + patches: subPatches, + }; + for (const node of fieldNodes) { + if (node.selectionSet) { + collectFieldsImpl(schema, fragments, variableValues, returnType, node.selectionSet, subFieldNodes, subPatches, visitedFragmentNames); + } + } + return subFieldsAndPatches; +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/comments.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/comments.js new file mode 100644 index 00000000..e2ed37d1 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/comments.js @@ -0,0 +1,400 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resetComments = resetComments; +exports.collectComment = collectComment; +exports.pushComment = pushComment; +exports.printComment = printComment; +exports.printWithComments = printWithComments; +exports.getDescription = getDescription; +exports.getComment = getComment; +exports.getLeadingCommentBlock = getLeadingCommentBlock; +exports.dedentBlockStringValue = dedentBlockStringValue; +exports.getBlockStringIndentation = getBlockStringIndentation; +const graphql_1 = require("graphql"); +const MAX_LINE_LENGTH = 80; +let commentsRegistry = {}; +function resetComments() { + commentsRegistry = {}; +} +function collectComment(node) { + const entityName = node.name?.value; + if (entityName == null) { + return; + } + pushComment(node, entityName); + switch (node.kind) { + case 'EnumTypeDefinition': + if (node.values) { + for (const value of node.values) { + pushComment(value, entityName, value.name.value); + } + } + break; + case 'ObjectTypeDefinition': + case 'InputObjectTypeDefinition': + case 'InterfaceTypeDefinition': + if (node.fields) { + for (const field of node.fields) { + pushComment(field, entityName, field.name.value); + if (isFieldDefinitionNode(field) && field.arguments) { + for (const arg of field.arguments) { + pushComment(arg, entityName, field.name.value, arg.name.value); + } + } + } + } + break; + } +} +function pushComment(node, entity, field, argument) { + const comment = getComment(node); + if (typeof comment !== 'string' || comment.length === 0) { + return; + } + const keys = [entity]; + if (field) { + keys.push(field); + if (argument) { + keys.push(argument); + } + } + const path = keys.join('.'); + if (!commentsRegistry[path]) { + commentsRegistry[path] = []; + } + commentsRegistry[path].push(comment); +} +function printComment(comment) { + return '\n# ' + comment.replace(/\n/g, '\n# '); +} +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * NOTE: ==> This file has been modified just to add comments to the printed AST + * This is a temp measure, we will move to using the original non modified printer.js ASAP. + */ +/** + * Given maybeArray, print an empty string if it is null or empty, otherwise + * print all items together separated by separator if provided + */ +function join(maybeArray, separator) { + return maybeArray ? maybeArray.filter(x => x).join(separator || '') : ''; +} +function hasMultilineItems(maybeArray) { + return maybeArray?.some(str => str.includes('\n')) ?? false; +} +function addDescription(cb) { + return (node, _key, _parent, path, ancestors) => { + const keys = []; + const parent = path.reduce((prev, key) => { + if (['fields', 'arguments', 'values'].includes(key) && prev.name) { + keys.push(prev.name.value); + } + return prev[key]; + }, ancestors[0]); + const key = [...keys, parent?.name?.value].filter(Boolean).join('.'); + const items = []; + if (node.kind.includes('Definition') && commentsRegistry[key]) { + items.push(...commentsRegistry[key]); + } + return join([...items.map(printComment), node.description, cb(node, _key, _parent, path, ancestors)], '\n'); + }; +} +function indent(maybeString) { + return maybeString && ` ${maybeString.replace(/\n/g, '\n ')}`; +} +/** + * Given array, print each item on its own line, wrapped in an + * indented "{ }" block. + */ +function block(array) { + return array && array.length !== 0 ? `{\n${indent(join(array, '\n'))}\n}` : ''; +} +/** + * If maybeString is not null or empty, then wrap with start and end, otherwise + * print an empty string. + */ +function wrap(start, maybeString, end) { + return maybeString ? start + maybeString + (end || '') : ''; +} +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + */ +function printBlockString(value, isDescription = false) { + const escaped = value.replace(/\\/g, '\\\\').replace(/"""/g, '\\"""'); + return (value[0] === ' ' || value[0] === '\t') && value.indexOf('\n') === -1 + ? `"""${escaped.replace(/"$/, '"\n')}"""` + : `"""\n${isDescription ? escaped : indent(escaped)}\n"""`; +} +const printDocASTReducer = { + Name: { leave: node => node.value }, + Variable: { leave: node => '$' + node.name }, + // Document + Document: { + leave: node => join(node.definitions, '\n\n'), + }, + OperationDefinition: { + leave: node => { + const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); + const prefix = join([node.operation, join([node.name, varDefs]), join(node.directives, ' ')], ' '); + // the query short form. + return prefix + ' ' + node.selectionSet; + }, + }, + VariableDefinition: { + leave: ({ variable, type, defaultValue, directives }) => variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')), + }, + SelectionSet: { leave: ({ selections }) => block(selections) }, + Field: { + leave({ alias, name, arguments: args, directives, selectionSet }) { + const prefix = wrap('', alias, ': ') + name; + let argsLine = prefix + wrap('(', join(args, ', '), ')'); + if (argsLine.length > MAX_LINE_LENGTH) { + argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); + } + return join([argsLine, join(directives, ' '), selectionSet], ' '); + }, + }, + Argument: { leave: ({ name, value }) => name + ': ' + value }, + // Fragments + FragmentSpread: { + leave: ({ name, directives }) => '...' + name + wrap(' ', join(directives, ' ')), + }, + InlineFragment: { + leave: ({ typeCondition, directives, selectionSet }) => join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' '), + }, + FragmentDefinition: { + leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + + selectionSet, + }, + // Value + IntValue: { leave: ({ value }) => value }, + FloatValue: { leave: ({ value }) => value }, + StringValue: { + leave: ({ value, block: isBlockString }) => { + if (isBlockString) { + return printBlockString(value); + } + return JSON.stringify(value); + }, + }, + BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') }, + NullValue: { leave: () => 'null' }, + EnumValue: { leave: ({ value }) => value }, + ListValue: { leave: ({ values }) => '[' + join(values, ', ') + ']' }, + ObjectValue: { leave: ({ fields }) => '{' + join(fields, ', ') + '}' }, + ObjectField: { leave: ({ name, value }) => name + ': ' + value }, + // Directive + Directive: { + leave: ({ name, arguments: args }) => '@' + name + wrap('(', join(args, ', '), ')'), + }, + // Type + NamedType: { leave: ({ name }) => name }, + ListType: { leave: ({ type }) => '[' + type + ']' }, + NonNullType: { leave: ({ type }) => type + '!' }, + // Type System Definitions + SchemaDefinition: { + leave: ({ directives, operationTypes }) => join(['schema', join(directives, ' '), block(operationTypes)], ' '), + }, + OperationTypeDefinition: { + leave: ({ operation, type }) => operation + ': ' + type, + }, + ScalarTypeDefinition: { + leave: ({ name, directives }) => join(['scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeDefinition: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + FieldDefinition: { + leave: ({ name, arguments: args, type, directives }) => name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + ': ' + + type + + wrap(' ', join(directives, ' ')), + }, + InputValueDefinition: { + leave: ({ name, type, defaultValue, directives }) => join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '), + }, + InterfaceTypeDefinition: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeDefinition: { + leave: ({ name, directives, types }) => join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '), + }, + EnumTypeDefinition: { + leave: ({ name, directives, values }) => join(['enum', name, join(directives, ' '), block(values)], ' '), + }, + EnumValueDefinition: { + leave: ({ name, directives }) => join([name, join(directives, ' ')], ' '), + }, + InputObjectTypeDefinition: { + leave: ({ name, directives, fields }) => join(['input', name, join(directives, ' '), block(fields)], ' '), + }, + DirectiveDefinition: { + leave: ({ name, arguments: args, repeatable, locations }) => 'directive @' + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + (repeatable ? ' repeatable' : '') + + ' on ' + + join(locations, ' | '), + }, + SchemaExtension: { + leave: ({ directives, operationTypes }) => join(['extend schema', join(directives, ' '), block(operationTypes)], ' '), + }, + ScalarTypeExtension: { + leave: ({ name, directives }) => join(['extend scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + InterfaceTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeExtension: { + leave: ({ name, directives, types }) => join(['extend union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '), + }, + EnumTypeExtension: { + leave: ({ name, directives, values }) => join(['extend enum', name, join(directives, ' '), block(values)], ' '), + }, + InputObjectTypeExtension: { + leave: ({ name, directives, fields }) => join(['extend input', name, join(directives, ' '), block(fields)], ' '), + }, +}; +const printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((prev, key) => ({ + ...prev, + [key]: { + leave: addDescription(printDocASTReducer[key].leave), + }, +}), {}); +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ +function printWithComments(ast) { + return (0, graphql_1.visit)(ast, printDocASTReducerWithComments); +} +function isFieldDefinitionNode(node) { + return node.kind === 'FieldDefinition'; +} +// graphql < v13 and > v15 does not export getDescription +function getDescription(node, options) { + if (node.description != null) { + return node.description.value; + } + if (options?.commentDescriptions) { + return getComment(node); + } +} +function getComment(node) { + const rawValue = getLeadingCommentBlock(node); + if (rawValue !== undefined) { + return dedentBlockStringValue(`\n${rawValue}`); + } +} +function getLeadingCommentBlock(node) { + const loc = node.loc; + if (!loc) { + return; + } + const comments = []; + let token = loc.startToken.prev; + while (token != null && + token.kind === graphql_1.TokenKind.COMMENT && + token.next != null && + token.prev != null && + token.line + 1 === token.next.line && + token.line !== token.prev.line) { + const value = String(token.value); + comments.push(value); + token = token.prev; + } + return comments.length > 0 ? comments.reverse().join('\n') : undefined; +} +function dedentBlockStringValue(rawString) { + // Expand a block string's raw value into independent lines. + const lines = rawString.split(/\r\n|[\n\r]/g); + // Remove common indentation from all lines but first. + const commonIndent = getBlockStringIndentation(lines); + if (commonIndent !== 0) { + for (let i = 1; i < lines.length; i++) { + lines[i] = lines[i].slice(commonIndent); + } + } + // Remove leading and trailing blank lines. + while (lines.length > 0 && isBlank(lines[0])) { + lines.shift(); + } + while (lines.length > 0 && isBlank(lines[lines.length - 1])) { + lines.pop(); + } + // Return a string of the lines joined with U+000A. + return lines.join('\n'); +} +/** + * @internal + */ +function getBlockStringIndentation(lines) { + let commonIndent = null; + for (let i = 1; i < lines.length; i++) { + const line = lines[i]; + const indent = leadingWhitespace(line); + if (indent === line.length) { + continue; // skip empty lines + } + if (commonIndent === null || indent < commonIndent) { + commonIndent = indent; + if (commonIndent === 0) { + break; + } + } + } + return commonIndent === null ? 0 : commonIndent; +} +function leadingWhitespace(str) { + let i = 0; + while (i < str.length && (str[i] === ' ' || str[i] === '\t')) { + i++; + } + return i; +} +function isBlank(str) { + return leadingWhitespace(str) === str.length; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/debugTimer.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/debugTimer.js new file mode 100644 index 00000000..5201b7bc --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/debugTimer.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.debugTimerStart = debugTimerStart; +exports.debugTimerEnd = debugTimerEnd; +const debugNamesOngoing = new Set(); +function debugTimerStart(name) { + const debugEnvVar = globalThis.process?.env?.['DEBUG'] || globalThis.DEBUG; + if (debugEnvVar === '1' || debugEnvVar?.includes(name)) { + debugNamesOngoing.add(name); + console.time(name); + } +} +function debugTimerEnd(name) { + if (debugNamesOngoing.has(name)) { + console.timeEnd(name); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/defaultValueAstFromType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/defaultValueAstFromType.js new file mode 100644 index 00000000..097df187 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/defaultValueAstFromType.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultValueAstFromType = void 0; +const graphql_1 = require("graphql"); +const astFromValue_js_1 = require("./astFromValue.js"); +const astFromValueUntyped_js_1 = require("./astFromValueUntyped.js"); +/** + * `defaultValueAstFromType` extracts default value from `GraphQLArgument` or `GraphQLInputField`, if available + * This is compatible with all `graphql` versions + * + * The return type is `ConstValueNode` in graphql@16+, + * but it is not available in graphql@15 so `ValueNode` is used as return type here and `as any` is often required at callsites for backwards compatibility, + */ +const defaultValueAstFromType = (arg) => { + // graphql >= v17 has `default` instead of `defaultValue` + // So for backward compatibility with v16, we are using `arg.default as any`, otherwise, TypeScript report type error + if ('default' in arg) { + if (!arg.default) { + return undefined; + } + if ('value' in arg.default) { + return (0, astFromValueUntyped_js_1.astFromValueUntyped)(arg.default.value) ?? undefined; + } + const value = (0, graphql_1.valueFromASTUntyped)(arg.default.literal); + return (0, astFromValue_js_1.astFromValue)(value, arg.type) ?? undefined; + } + // graphql < v17 has `defaultValue` instead of `default` + return arg.defaultValue !== undefined + ? ((0, astFromValue_js_1.astFromValue)(arg.defaultValue, arg.type) ?? undefined) + : undefined; +}; +exports.defaultValueAstFromType = defaultValueAstFromType; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/descriptionFromObject.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/descriptionFromObject.js new file mode 100644 index 00000000..4b61d394 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/descriptionFromObject.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDescriptionNode = getDescriptionNode; +const graphql_1 = require("graphql"); +function getDescriptionNode(obj) { + // Prefer the runtime `description` over a stale `astNode` description. + // Schema transforms (e.g. mapSchema) update config descriptions without rewriting astNode (#5508). + if (typeof obj.description === 'string') { + return { + kind: graphql_1.Kind.STRING, + value: obj.description, + block: true, + }; + } + if (obj.astNode?.description) { + return { + ...obj.astNode.description, + block: true, + }; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/directives.js new file mode 100644 index 00000000..50559047 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/directives.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GraphQLStreamDirective = exports.GraphQLDeferDirective = void 0; +const graphql_1 = require("graphql"); +/** + * Used to conditionally defer fragments. + */ +exports.GraphQLDeferDirective = new graphql_1.GraphQLDirective({ + name: 'defer', + description: 'Directs the executor to defer this fragment when the `if` argument is true or undefined.', + locations: [graphql_1.DirectiveLocation.FRAGMENT_SPREAD, graphql_1.DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLBoolean), + description: 'Deferred when true or undefined.', + defaultValue: true, + }, + label: { + type: graphql_1.GraphQLString, + description: 'Unique name', + }, + }, +}); +/** + * Used to conditionally stream list fields. + */ +exports.GraphQLStreamDirective = new graphql_1.GraphQLDirective({ + name: 'stream', + description: 'Directs the executor to stream plural fields when the `if` argument is true or undefined.', + locations: [graphql_1.DirectiveLocation.FIELD], + args: { + if: { + type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLBoolean), + description: 'Stream when true or undefined.', + defaultValue: true, + }, + label: { + type: graphql_1.GraphQLString, + description: 'Unique name', + }, + initialCount: { + defaultValue: 0, + type: graphql_1.GraphQLInt, + description: 'Number of items to return immediately', + }, + }, +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/errors.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/errors.js new file mode 100644 index 00000000..f93f2ce0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/errors.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isGraphQLErrorLike = isGraphQLErrorLike; +exports.createGraphQLError = createGraphQLError; +exports.getSchemaCoordinate = getSchemaCoordinate; +exports.locatedError = locatedError; +exports.relocatedError = relocatedError; +const graphql_1 = require("graphql"); +const possibleGraphQLErrorProperties = [ + 'message', + 'locations', + 'path', + 'nodes', + 'source', + 'positions', + 'originalError', + 'name', + 'stack', + 'extensions', + 'coordinate', +]; +function isGraphQLErrorLike(error) { + return (error != null && + typeof error === 'object' && + Object.keys(error).every(key => possibleGraphQLErrorProperties.includes(key))); +} +function createGraphQLError(message, options) { + if (options?.originalError && + !(options.originalError instanceof Error) && + isGraphQLErrorLike(options.originalError)) { + options.originalError = createGraphQLError(options.originalError.message, options.originalError); + } + // To avoid type error on graphql <16, we have to use an any type here + const Constructor = graphql_1.GraphQLError; + const error = graphql_1.versionInfo.major >= 16 + ? new Constructor(message, options) + : new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions); + if (options?.coordinate && error.coordinate == null) { + Object.defineProperties(error, { + coordinate: { value: options.coordinate, enumerable: true, configurable: true }, + }); + } + return error; +} +function getSchemaCoordinate(error) { + return error.coordinate; +} +function locatedError(rawError, nodes, path, info) { + const error = (0, graphql_1.locatedError)(rawError, nodes, path); + // `graphql` locatedError is only changing path and nodes if it is not already defined + if (!error.coordinate && info && error.coordinate == null) { + const coordinate = `${info.parentType.name}.${info.fieldName}`; + Object.defineProperties(error, { + coordinate: { value: coordinate, enumerable: true, configurable: true }, + }); + } + return error; +} +function relocatedError(originalError, path, info) { + return createGraphQLError(originalError.message, { + nodes: originalError.nodes, + source: originalError.source, + positions: originalError.positions, + path: path == null ? originalError.path : path, + originalError, + extensions: originalError.extensions, + coordinate: info ? `${info.parentType.name}.${info.fieldName}` : undefined, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/executor.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/executor.js new file mode 100644 index 00000000..e69de29b diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/extractExtensionsFromSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/extractExtensionsFromSchema.js new file mode 100644 index 00000000..ac3df35f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/extractExtensionsFromSchema.js @@ -0,0 +1,102 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extractExtensionsFromSchema = extractExtensionsFromSchema; +const helpers_js_1 = require("./helpers.js"); +const Interfaces_js_1 = require("./Interfaces.js"); +const mapSchema_js_1 = require("./mapSchema.js"); +function handleDirectiveExtensions(extensions, removeDirectives) { + extensions = extensions || {}; + const { directives: existingDirectives, ...rest } = extensions; + const finalExtensions = { + ...rest, + }; + if (!removeDirectives) { + if (existingDirectives != null) { + const directives = {}; + for (const directiveName in existingDirectives) { + directives[directiveName] = [...(0, helpers_js_1.asArray)(existingDirectives[directiveName])]; + } + finalExtensions.directives = directives; + } + } + return finalExtensions; +} +function extractExtensionsFromSchema(schema, removeDirectives = false) { + const result = { + schemaExtensions: handleDirectiveExtensions(schema.extensions, removeDirectives), + types: {}, + }; + (0, mapSchema_js_1.mapSchema)(schema, { + [Interfaces_js_1.MapperKind.OBJECT_TYPE]: type => { + result.types[type.name] = { + fields: {}, + type: 'object', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [Interfaces_js_1.MapperKind.INTERFACE_TYPE]: type => { + result.types[type.name] = { + fields: {}, + type: 'interface', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [Interfaces_js_1.MapperKind.FIELD]: (field, fieldName, typeName) => { + result.types[typeName].fields[fieldName] = { + arguments: {}, + extensions: handleDirectiveExtensions(field.extensions, removeDirectives), + }; + const args = field.args; + if (args != null) { + for (const argName in args) { + result.types[typeName].fields[fieldName].arguments[argName] = + handleDirectiveExtensions(args[argName].extensions, removeDirectives); + } + } + return field; + }, + [Interfaces_js_1.MapperKind.ENUM_TYPE]: type => { + result.types[type.name] = { + values: {}, + type: 'enum', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [Interfaces_js_1.MapperKind.ENUM_VALUE]: (value, typeName, _schema, valueName) => { + result.types[typeName].values[valueName] = handleDirectiveExtensions(value.extensions, removeDirectives); + return value; + }, + [Interfaces_js_1.MapperKind.SCALAR_TYPE]: type => { + result.types[type.name] = { + type: 'scalar', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [Interfaces_js_1.MapperKind.UNION_TYPE]: type => { + result.types[type.name] = { + type: 'union', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [Interfaces_js_1.MapperKind.INPUT_OBJECT_TYPE]: type => { + result.types[type.name] = { + fields: {}, + type: 'input', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [Interfaces_js_1.MapperKind.INPUT_OBJECT_FIELD]: (field, fieldName, typeName) => { + result.types[typeName].fields[fieldName] = { + extensions: handleDirectiveExtensions(field.extensions, removeDirectives), + }; + return field; + }, + }); + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fields.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fields.js new file mode 100644 index 00000000..b3cb422d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fields.js @@ -0,0 +1,114 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.appendObjectFields = appendObjectFields; +exports.removeObjectFields = removeObjectFields; +exports.selectObjectFields = selectObjectFields; +exports.modifyObjectFields = modifyObjectFields; +const graphql_1 = require("graphql"); +const addTypes_js_1 = require("./addTypes.js"); +const Interfaces_js_1 = require("./Interfaces.js"); +const mapSchema_js_1 = require("./mapSchema.js"); +function appendObjectFields(schema, typeName, additionalFields) { + if (schema.getType(typeName) == null) { + return (0, addTypes_js_1.addTypes)(schema, [ + new graphql_1.GraphQLObjectType({ + name: typeName, + fields: additionalFields, + }), + ]); + } + return (0, mapSchema_js_1.mapSchema)(schema, { + [Interfaces_js_1.MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + newFieldConfigMap[fieldName] = originalFieldConfigMap[fieldName]; + } + for (const fieldName in additionalFields) { + newFieldConfigMap[fieldName] = additionalFields[fieldName]; + } + return (0, mapSchema_js_1.correctASTNodes)(new graphql_1.GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + }, + }); +} +function removeObjectFields(schema, typeName, testFn) { + const removedFields = {}; + const newSchema = (0, mapSchema_js_1.mapSchema)(schema, { + [Interfaces_js_1.MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + if (testFn(fieldName, originalFieldConfig)) { + removedFields[fieldName] = originalFieldConfig; + } + else { + newFieldConfigMap[fieldName] = originalFieldConfig; + } + } + return (0, mapSchema_js_1.correctASTNodes)(new graphql_1.GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + }, + }); + return [newSchema, removedFields]; +} +function selectObjectFields(schema, typeName, testFn) { + const selectedFields = {}; + (0, mapSchema_js_1.mapSchema)(schema, { + [Interfaces_js_1.MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + if (testFn(fieldName, originalFieldConfig)) { + selectedFields[fieldName] = originalFieldConfig; + } + } + } + return undefined; + }, + }); + return selectedFields; +} +function modifyObjectFields(schema, typeName, testFn, newFields) { + const removedFields = {}; + const newSchema = (0, mapSchema_js_1.mapSchema)(schema, { + [Interfaces_js_1.MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + if (testFn(fieldName, originalFieldConfig)) { + removedFields[fieldName] = originalFieldConfig; + } + else { + newFieldConfigMap[fieldName] = originalFieldConfig; + } + } + for (const fieldName in newFields) { + const fieldConfig = newFields[fieldName]; + newFieldConfigMap[fieldName] = fieldConfig; + } + return (0, mapSchema_js_1.correctASTNodes)(new graphql_1.GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + }, + }); + return [newSchema, removedFields]; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/filterSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/filterSchema.js new file mode 100644 index 00000000..245d98ba --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/filterSchema.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.filterSchema = filterSchema; +const graphql_1 = require("graphql"); +const Interfaces_js_1 = require("./Interfaces.js"); +const mapSchema_js_1 = require("./mapSchema.js"); +function filterSchema({ schema, typeFilter = () => true, fieldFilter = undefined, rootFieldFilter = undefined, objectFieldFilter = undefined, interfaceFieldFilter = undefined, inputObjectFieldFilter = undefined, argumentFilter = undefined, directiveFilter = undefined, enumValueFilter = undefined, }) { + const filteredSchema = (0, mapSchema_js_1.mapSchema)(schema, { + [Interfaces_js_1.MapperKind.QUERY]: (type) => filterRootFields(type, 'Query', rootFieldFilter, argumentFilter), + [Interfaces_js_1.MapperKind.MUTATION]: (type) => filterRootFields(type, 'Mutation', rootFieldFilter, argumentFilter), + [Interfaces_js_1.MapperKind.SUBSCRIPTION]: (type) => filterRootFields(type, 'Subscription', rootFieldFilter, argumentFilter), + [Interfaces_js_1.MapperKind.OBJECT_TYPE]: (type) => typeFilter(type.name, type) + ? filterElementFields(graphql_1.GraphQLObjectType, type, objectFieldFilter || fieldFilter, argumentFilter) + : null, + [Interfaces_js_1.MapperKind.INTERFACE_TYPE]: (type) => typeFilter(type.name, type) + ? filterElementFields(graphql_1.GraphQLInterfaceType, type, interfaceFieldFilter || fieldFilter, argumentFilter) + : null, + [Interfaces_js_1.MapperKind.INPUT_OBJECT_TYPE]: (type) => typeFilter(type.name, type) + ? filterElementFields(graphql_1.GraphQLInputObjectType, type, inputObjectFieldFilter || fieldFilter) + : null, + [Interfaces_js_1.MapperKind.UNION_TYPE]: (type) => typeFilter(type.name, type) ? undefined : null, + [Interfaces_js_1.MapperKind.ENUM_TYPE]: (type) => typeFilter(type.name, type) ? undefined : null, + [Interfaces_js_1.MapperKind.SCALAR_TYPE]: (type) => typeFilter(type.name, type) ? undefined : null, + [Interfaces_js_1.MapperKind.DIRECTIVE]: directive => directiveFilter && !directiveFilter(directive.name, directive) ? null : undefined, + [Interfaces_js_1.MapperKind.ENUM_VALUE]: (valueConfig, typeName, _schema, externalValue) => enumValueFilter && !enumValueFilter(typeName, externalValue, valueConfig) ? null : undefined, + }); + return filteredSchema; +} +function filterRootFields(type, operation, rootFieldFilter, argumentFilter) { + if (rootFieldFilter || argumentFilter) { + const config = type.toConfig(); + for (const fieldName in config.fields) { + const field = config.fields[fieldName]; + if (rootFieldFilter && !rootFieldFilter(operation, fieldName, config.fields[fieldName])) { + delete config.fields[fieldName]; + } + else if (argumentFilter && field.args) { + for (const argName in field.args) { + if (!argumentFilter(type.name, fieldName, argName, field.args[argName])) { + delete field.args[argName]; + } + } + } + } + return new graphql_1.GraphQLObjectType(config); + } + return type; +} +function filterElementFields(ElementConstructor, type, fieldFilter, argumentFilter) { + if (fieldFilter || argumentFilter) { + const config = type.toConfig(); + for (const fieldName in config.fields) { + const field = config.fields[fieldName]; + if (fieldFilter && !fieldFilter(type.name, fieldName, config.fields[fieldName])) { + delete config.fields[fieldName]; + } + else if (argumentFilter && 'args' in field) { + for (const argName in field.args) { + if (!argumentFilter(type.name, fieldName, argName, field.args[argName])) { + delete field.args[argName]; + } + } + } + } + return new ElementConstructor(config); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fixSchemaAst.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fixSchemaAst.js new file mode 100644 index 00000000..0b829a0b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/fixSchemaAst.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fixSchemaAst = fixSchemaAst; +const graphql_1 = require("graphql"); +const print_schema_with_directives_js_1 = require("./print-schema-with-directives.js"); +function buildFixedSchema(schema, options) { + const document = (0, print_schema_with_directives_js_1.getDocumentNodeFromSchema)(schema); + return (0, graphql_1.buildASTSchema)(document, { + ...(options || {}), + }); +} +function fixSchemaAst(schema, options) { + // eslint-disable-next-line no-undef-init + let schemaWithValidAst = undefined; + if (!schema.astNode || !schema.extensionASTNodes) { + schemaWithValidAst = buildFixedSchema(schema, options); + } + if (!schema.astNode && schemaWithValidAst?.astNode) { + schema.astNode = schemaWithValidAst.astNode; + } + if (!schema.extensionASTNodes && schemaWithValidAst?.astNode) { + schema.extensionASTNodes = schemaWithValidAst.extensionASTNodes; + } + return schema; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachDefaultValue.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachDefaultValue.js new file mode 100644 index 00000000..e92c7da0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachDefaultValue.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.forEachDefaultValue = forEachDefaultValue; +const graphql_1 = require("graphql"); +function forEachDefaultValue(schema, fn) { + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + const type = typeMap[typeName]; + if (!(0, graphql_1.getNamedType)(type).name.startsWith('__')) { + if ((0, graphql_1.isObjectType)(type)) { + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + for (const arg of field.args) { + arg.defaultValue = fn(arg.type, arg.defaultValue); + } + } + } + else if ((0, graphql_1.isInputObjectType)(type)) { + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + field.defaultValue = fn(field.type, field.defaultValue); + } + } + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachField.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachField.js new file mode 100644 index 00000000..a0ac2c41 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/forEachField.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.forEachField = forEachField; +const graphql_1 = require("graphql"); +function forEachField(schema, fn) { + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + const type = typeMap[typeName]; + // TODO: maybe have an option to include these? + if (!(0, graphql_1.getNamedType)(type).name.startsWith('__') && (0, graphql_1.isObjectType)(type)) { + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + fn(field, typeName, fieldName); + } + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-arguments-with-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-arguments-with-directives.js new file mode 100644 index 00000000..5424f266 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-arguments-with-directives.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getArgumentsWithDirectives = getArgumentsWithDirectives; +const graphql_1 = require("graphql"); +function isTypeWithFields(t) { + return t.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION || t.kind === graphql_1.Kind.OBJECT_TYPE_EXTENSION; +} +function getArgumentsWithDirectives(documentNode) { + const result = {}; + const allTypes = documentNode.definitions.filter(isTypeWithFields); + for (const type of allTypes) { + if (type.fields == null) { + continue; + } + for (const field of type.fields) { + const argsWithDirectives = field.arguments?.filter(arg => arg.directives?.length); + if (!argsWithDirectives?.length) { + continue; + } + const typeFieldResult = (result[`${type.name.value}.${field.name.value}`] = {}); + for (const arg of argsWithDirectives) { + const directives = arg.directives.map(d => ({ + name: d.name.value, + args: (d.arguments || []).reduce((prev, dArg) => ({ ...prev, [dArg.name.value]: (0, graphql_1.valueFromASTUntyped)(dArg.value) }), {}), + })); + typeFieldResult[arg.name.value] = directives; + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-directives.js new file mode 100644 index 00000000..e15dc87c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-directives.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDirectivesInExtensions = getDirectivesInExtensions; +exports.getDirectiveInExtensions = getDirectiveInExtensions; +exports.getDirectives = getDirectives; +exports.getDirective = getDirective; +const getDirectiveExtensions_js_1 = require("./getDirectiveExtensions.js"); +function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, undefined, pathToDirectivesInExtensions); + return Object.entries(directiveExtensions) + .map(([directiveName, directiveArgsArr]) => directiveArgsArr?.map(directiveArgs => ({ + name: directiveName, + args: directiveArgs, + }))) + .flat(Infinity) + .filter(Boolean); +} +function getDirectiveInExtensions(node, directiveName, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, undefined, pathToDirectivesInExtensions); + return directiveExtensions[directiveName]; +} +function getDirectives(schema, node, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, schema, pathToDirectivesInExtensions); + return Object.entries(directiveExtensions) + .map(([directiveName, directiveArgsArr]) => directiveArgsArr?.map(directiveArgs => ({ + name: directiveName, + args: directiveArgs, + }))) + .flat(Infinity) + .filter(Boolean); +} +function getDirective(schema, node, directiveName, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, schema, pathToDirectivesInExtensions); + return directiveExtensions[directiveName]; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-fields-with-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-fields-with-directives.js new file mode 100644 index 00000000..e0170376 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-fields-with-directives.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFieldsWithDirectives = getFieldsWithDirectives; +const graphql_1 = require("graphql"); +function getFieldsWithDirectives(documentNode, options = {}) { + const result = {}; + let selected = ['ObjectTypeDefinition', 'ObjectTypeExtension']; + if (options.includeInputTypes) { + selected = [...selected, 'InputObjectTypeDefinition', 'InputObjectTypeExtension']; + } + const allTypes = documentNode.definitions.filter(obj => selected.includes(obj.kind)); + for (const type of allTypes) { + const typeName = type.name.value; + if (type.fields == null) { + continue; + } + for (const field of type.fields) { + if (field.directives && field.directives.length > 0) { + const fieldName = field.name.value; + const key = `${typeName}.${fieldName}`; + const directives = field.directives.map(d => ({ + name: d.name.value, + args: (d.arguments || []).reduce((prev, arg) => ({ ...prev, [arg.name.value]: (0, graphql_1.valueFromASTUntyped)(arg.value) }), {}), + })); + result[key] = directives; + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-implementing-types.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-implementing-types.js new file mode 100644 index 00000000..8d39a736 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/get-implementing-types.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getImplementingTypes = getImplementingTypes; +function getImplementingTypes(interfaceName, schema) { + const allTypesMap = schema.getTypeMap(); + const result = []; + for (const graphqlTypeName in allTypesMap) { + const graphqlType = allTypesMap[graphqlTypeName]; + if ('getInterfaces' in graphqlType) { + const allInterfaces = graphqlType.getInterfaces(); + if (allInterfaces.find(int => int.name === interfaceName)) { + result.push(graphqlType.name); + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getArgumentValues.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getArgumentValues.js new file mode 100644 index 00000000..3fff733f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getArgumentValues.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getArgumentValues = getArgumentValues; +const cross_inspect_1 = require("cross-inspect"); +const graphql_1 = require("graphql"); +const errors_js_1 = require("./errors.js"); +const jsutils_js_1 = require("./jsutils.js"); +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +function getArgumentValues(def, node, variableValues = {}) { + const coercedValues = {}; + const argumentNodes = node.arguments ?? []; + const argNodeMap = argumentNodes.reduce((prev, arg) => ({ + ...prev, + [arg.name.value]: arg, + }), {}); + for (const arg of def.args) { + const argumentNode = argNodeMap[arg.name]; + if (!argumentNode) { + if ('default' in arg && arg.default) { + // graphql v17 + coercedValues[arg.name] = + 'value' in arg.default + ? arg.default.value + : (0, graphql_1.valueFromASTUntyped)(arg.default.literal); + } + else if (arg.defaultValue !== undefined) { + // graphql < v17 + coercedValues[arg.name] = arg.defaultValue; + } + else if ((0, graphql_1.isNonNullType)(arg.type)) { + throw (0, errors_js_1.createGraphQLError)(`Argument "${arg.name}" of required type "${(0, cross_inspect_1.inspect)(arg.type)}" ` + 'was not provided.', { + nodes: [node], + }); + } + continue; + } + const valueNode = argumentNode.value; + let isNull = valueNode.kind === graphql_1.Kind.NULL; + if (valueNode.kind === graphql_1.Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (variableValues == null || !(0, jsutils_js_1.hasOwnProperty)(variableValues, variableName)) { + if (arg.defaultValue !== undefined) { + coercedValues[arg.name] = arg.defaultValue; + } + else if ((0, graphql_1.isNonNullType)(arg.type)) { + throw (0, errors_js_1.createGraphQLError)(`Argument "${arg.name}" of required type "${(0, cross_inspect_1.inspect)(arg.type)}" ` + + `was provided the variable "$${variableName}" which was not provided a runtime value.`, { + nodes: [valueNode], + }); + } + continue; + } + isNull = variableValues[variableName] == null; + } + if (isNull && (0, graphql_1.isNonNullType)(arg.type)) { + throw (0, errors_js_1.createGraphQLError)(`Argument "${arg.name}" of non-null type "${(0, cross_inspect_1.inspect)(arg.type)}" ` + 'must not be null.', { + nodes: [valueNode], + }); + } + const coercedValue = (0, graphql_1.valueFromAST)(valueNode, arg.type, variableValues); + if (coercedValue === undefined) { + // Note: ValuesOfCorrectTypeRule validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw (0, errors_js_1.createGraphQLError)(`Argument "${arg.name}" has invalid value ${(0, graphql_1.print)(valueNode)}.`, { + nodes: [valueNode], + }); + } + coercedValues[arg.name] = coercedValue; + } + return coercedValues; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveExtensions.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveExtensions.js new file mode 100644 index 00000000..200213a3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveExtensions.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDirectiveExtensions = getDirectiveExtensions; +const graphql_1 = require("graphql"); +const getArgumentValues_js_1 = require("./getArgumentValues.js"); +const memoize_js_1 = require("./memoize.js"); +function getDirectiveExtensions(directableObj, schema, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = {}; + if (directableObj.extensions) { + let directivesInExtensions = directableObj.extensions; + for (const pathSegment of pathToDirectivesInExtensions) { + directivesInExtensions = directivesInExtensions?.[pathSegment]; + } + if (directivesInExtensions != null) { + for (const directiveNameProp in directivesInExtensions) { + const directiveObjs = directivesInExtensions[directiveNameProp]; + const directiveName = directiveNameProp; + if (Array.isArray(directiveObjs)) { + for (const directiveObj of directiveObjs) { + let existingDirectiveExtensions = directiveExtensions[directiveName]; + if (!existingDirectiveExtensions) { + existingDirectiveExtensions = []; + directiveExtensions[directiveName] = existingDirectiveExtensions; + } + existingDirectiveExtensions.push(directiveObj); + } + } + else { + let existingDirectiveExtensions = directiveExtensions[directiveName]; + if (!existingDirectiveExtensions) { + existingDirectiveExtensions = []; + directiveExtensions[directiveName] = existingDirectiveExtensions; + } + existingDirectiveExtensions.push(directiveObjs); + } + } + } + } + const memoizedStringify = (0, memoize_js_1.memoize1)(obj => JSON.stringify(obj)); + const astNodes = []; + if (directableObj.astNode) { + astNodes.push(directableObj.astNode); + } + if (directableObj.extensionASTNodes) { + astNodes.push(...directableObj.extensionASTNodes); + } + for (const astNode of astNodes) { + if (astNode.directives?.length) { + for (const directive of astNode.directives) { + const directiveName = directive.name.value; + let existingDirectiveExtensions = directiveExtensions[directiveName]; + if (!existingDirectiveExtensions) { + existingDirectiveExtensions = []; + directiveExtensions[directiveName] = existingDirectiveExtensions; + } + const directiveInSchema = schema?.getDirective(directiveName); + let value = {}; + if (directiveInSchema) { + value = (0, getArgumentValues_js_1.getArgumentValues)(directiveInSchema, directive); + } + if (directive.arguments) { + for (const argNode of directive.arguments) { + const argName = argNode.name.value; + if (value[argName] == null) { + const argInDirective = directiveInSchema?.args.find(arg => arg.name === argName); + if (argInDirective) { + value[argName] = (0, graphql_1.valueFromAST)(argNode.value, argInDirective.type); + } + } + if (value[argName] == null) { + value[argName] = (0, graphql_1.valueFromASTUntyped)(argNode.value); + } + } + } + if (astNodes.length > 0 && existingDirectiveExtensions.length > 0) { + const valStr = memoizedStringify(value); + if (existingDirectiveExtensions.some(val => memoizedStringify(val) === valStr)) { + continue; + } + } + existingDirectiveExtensions.push(value); + } + } + } + return directiveExtensions; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveValues.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveValues.js new file mode 100644 index 00000000..206cb54c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getDirectiveValues.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDirectiveValues = getDirectiveValues; +const graphql_1 = require("graphql"); +/** + * GraphQL v17's getDirectiveValues function accepts `VariableValues` + * while older versions accept `Record`. This function wraps the original + * getDirectiveValues function to provide compatibility across versions. + */ +function getDirectiveValues(directiveDef, node, variableValues) { + if (graphql_1.versionInfo.major >= 17) { + return (0, graphql_1.getDirectiveValues)(directiveDef, node, variableValues); + } + return (0, graphql_1.getDirectiveValues)(directiveDef, node, variableValues?.coerced); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getObjectTypeFromTypeMap.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getObjectTypeFromTypeMap.js new file mode 100644 index 00000000..e72945ff --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getObjectTypeFromTypeMap.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getObjectTypeFromTypeMap = getObjectTypeFromTypeMap; +const graphql_1 = require("graphql"); +function getObjectTypeFromTypeMap(typeMap, type) { + if (type) { + const maybeObjectType = typeMap[type.name]; + if ((0, graphql_1.isObjectType)(maybeObjectType)) { + return maybeObjectType; + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getOperationASTFromRequest.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getOperationASTFromRequest.js new file mode 100644 index 00000000..42d1a3eb --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getOperationASTFromRequest.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getOperationASTFromRequest = void 0; +exports.getOperationASTFromDocument = getOperationASTFromDocument; +const graphql_1 = require("graphql"); +const memoize_js_1 = require("./memoize.js"); +function getOperationASTFromDocument(documentNode, operationName) { + const doc = (0, graphql_1.getOperationAST)(documentNode, operationName); + if (!doc) { + throw new Error(`Cannot infer operation ${operationName || ''}`); + } + return doc; +} +exports.getOperationASTFromRequest = (0, memoize_js_1.memoize1)(function getOperationASTFromRequest(request) { + return getOperationASTFromDocument(request.document, request.operationName); +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResolversFromSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResolversFromSchema.js new file mode 100644 index 00000000..5753f93b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResolversFromSchema.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getResolversFromSchema = getResolversFromSchema; +const graphql_1 = require("graphql"); +function getResolversFromSchema(schema, +// Include default merged resolvers +includeDefaultMergedResolver) { + const resolvers = Object.create(null); + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + if (!typeName.startsWith('__')) { + const type = typeMap[typeName]; + if ((0, graphql_1.isScalarType)(type)) { + if (!(0, graphql_1.isSpecifiedScalarType)(type)) { + const config = type.toConfig(); + delete config.astNode; // avoid AST duplication elsewhere + resolvers[typeName] = new graphql_1.GraphQLScalarType(config); + } + } + else if ((0, graphql_1.isEnumType)(type)) { + resolvers[typeName] = {}; + const values = type.getValues(); + for (const value of values) { + resolvers[typeName][value.name] = value.value; + } + } + else if ((0, graphql_1.isInterfaceType)(type)) { + if (type.resolveType != null) { + resolvers[typeName] = { + __resolveType: type.resolveType, + }; + } + } + else if ((0, graphql_1.isUnionType)(type)) { + if (type.resolveType != null) { + resolvers[typeName] = { + __resolveType: type.resolveType, + }; + } + } + else if ((0, graphql_1.isObjectType)(type)) { + resolvers[typeName] = {}; + if (type.isTypeOf != null) { + resolvers[typeName].__isTypeOf = type.isTypeOf; + } + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + if (field.subscribe != null) { + resolvers[typeName][fieldName] = resolvers[typeName][fieldName] || {}; + resolvers[typeName][fieldName].subscribe = field.subscribe; + } + if (field.resolve != null && field.resolve?.name !== 'defaultFieldResolver') { + switch (field.resolve?.name) { + case 'defaultMergedResolver': + if (!includeDefaultMergedResolver) { + continue; + } + break; + case 'defaultFieldResolver': + continue; + } + resolvers[typeName][fieldName] = resolvers[typeName][fieldName] || {}; + resolvers[typeName][fieldName].resolve = field.resolve; + } + } + } + } + } + return resolvers; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResponseKeyFromInfo.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResponseKeyFromInfo.js new file mode 100644 index 00000000..30679186 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/getResponseKeyFromInfo.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getResponseKeyFromInfo = getResponseKeyFromInfo; +/** + * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just + * resolves aliases. + * @param info The info argument to the resolver. + */ +function getResponseKeyFromInfo(info) { + return info.fieldNodes[0].alias != null ? info.fieldNodes[0].alias.value : info.fieldName; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/heal.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/heal.js new file mode 100644 index 00000000..9985e222 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/heal.js @@ -0,0 +1,180 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.healSchema = healSchema; +exports.healTypes = healTypes; +const graphql_1 = require("graphql"); +// Update any references to named schema types that disagree with the named +// types found in schema.getTypeMap(). +// +// healSchema and its callers (visitSchema/visitSchemaDirectives) all modify the schema in place. +// Therefore, private variables (such as the stored implementation map and the proper root types) +// are not updated. +// +// If this causes issues, the schema could be more aggressively healed as follows: +// +// healSchema(schema); +// const config = schema.toConfig() +// const healedSchema = new GraphQLSchema({ +// ...config, +// query: schema.getType(''), +// mutation: schema.getType(''), +// subscription: schema.getType(''), +// }); +// +// One can then also -- if necessary -- assign the correct private variables to the initial schema +// as follows: +// Object.assign(schema, healedSchema); +// +// These steps are not taken automatically to preserve backwards compatibility with graphql-tools v4. +// See https://github.com/ardatan/graphql-tools/issues/1462 +// +// They were briefly taken in v5, but can now be phased out as they were only required when other +// areas of the codebase were using healSchema and visitSchema more extensively. +// +function healSchema(schema) { + healTypes(schema.getTypeMap(), schema.getDirectives()); + return schema; +} +function healTypes(originalTypeMap, directives) { + const actualNamedTypeMap = Object.create(null); + // If any of the .name properties of the GraphQLNamedType objects in + // schema.getTypeMap() have changed, the keys of the type map need to + // be updated accordingly. + for (const typeName in originalTypeMap) { + const namedType = originalTypeMap[typeName]; + if (namedType == null || typeName.startsWith('__')) { + continue; + } + const actualName = namedType.name; + if (actualName.startsWith('__')) { + continue; + } + if (actualNamedTypeMap[actualName] != null) { + console.warn(`Duplicate schema type name ${actualName} found; keeping the existing one found in the schema`); + continue; + } + actualNamedTypeMap[actualName] = namedType; + // Note: we are deliberately leaving namedType in the schema by its + // original name (which might be different from actualName), so that + // references by that name can be healed. + } + // Now add back every named type by its actual name. + for (const typeName in actualNamedTypeMap) { + const namedType = actualNamedTypeMap[typeName]; + originalTypeMap[typeName] = namedType; + } + // Directive declaration argument types can refer to named types. + for (const decl of directives) { + decl.args = decl.args.filter(arg => { + arg.type = healType(arg.type); + return arg.type !== null; + }); + } + for (const typeName in originalTypeMap) { + const namedType = originalTypeMap[typeName]; + // Heal all named types, except for dangling references, kept only to redirect. + if (!typeName.startsWith('__') && typeName in actualNamedTypeMap) { + if (namedType != null) { + healNamedType(namedType); + } + } + } + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__') && !(typeName in actualNamedTypeMap)) { + delete originalTypeMap[typeName]; + } + } + function healNamedType(type) { + if ((0, graphql_1.isObjectType)(type)) { + healFields(type); + healInterfaces(type); + return; + } + else if ((0, graphql_1.isInterfaceType)(type)) { + healFields(type); + if ('getInterfaces' in type) { + healInterfaces(type); + } + return; + } + else if ((0, graphql_1.isUnionType)(type)) { + healUnderlyingTypes(type); + return; + } + else if ((0, graphql_1.isInputObjectType)(type)) { + healInputFields(type); + return; + } + else if ((0, graphql_1.isLeafType)(type)) { + return; + } + throw new Error(`Unexpected schema type: ${type}`); + } + function healFields(type) { + const fieldMap = type.getFields(); + for (const [key, field] of Object.entries(fieldMap)) { + field.args + .map(arg => { + arg.type = healType(arg.type); + return arg.type === null ? null : arg; + }) + .filter(Boolean); + field.type = healType(field.type); + if (field.type === null) { + delete fieldMap[key]; + } + } + } + function healInterfaces(type) { + if ('getInterfaces' in type) { + const interfaces = type.getInterfaces(); + interfaces.push(...interfaces + .splice(0) + .map(iface => healType(iface)) + .filter(Boolean)); + } + } + function healInputFields(type) { + const fieldMap = type.getFields(); + for (const [key, field] of Object.entries(fieldMap)) { + field.type = healType(field.type); + if (field.type === null) { + delete fieldMap[key]; + } + } + } + function healUnderlyingTypes(type) { + const types = type.getTypes(); + types.push(...types + .splice(0) + .map(t => healType(t)) + .filter(Boolean)); + } + function healType(type) { + // Unwrap the two known wrapper types + if ((0, graphql_1.isListType)(type)) { + const healedType = healType(type.ofType); + return healedType != null ? new graphql_1.GraphQLList(healedType) : null; + } + else if ((0, graphql_1.isNonNullType)(type)) { + const healedType = healType(type.ofType); + return healedType != null + ? // FIXME: `healedType` needs `as any` as graphql@17 changes the type for `GraphQLType` + new graphql_1.GraphQLNonNull(healedType) + : null; + } + else if ((0, graphql_1.isNamedType)(type)) { + // If a type annotation on a field or an argument or a union member is + // any `GraphQLNamedType` with a `name`, then it must end up identical + // to `schema.getType(name)`, since `schema.getTypeMap()` is the source + // of truth for all named schema types. + // Note that new types can still be simply added by adding a field, as + // the official type will be undefined, not null. + const officialType = originalTypeMap[type.name]; + if (officialType && type !== officialType) { + return officialType; + } + } + return type; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/helpers.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/helpers.js new file mode 100644 index 00000000..8e506c0a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/helpers.js @@ -0,0 +1,134 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.asArray = void 0; +exports.isUrl = isUrl; +exports.isDocumentString = isDocumentString; +exports.isValidPath = isValidPath; +exports.compareStrings = compareStrings; +exports.nodeToString = nodeToString; +exports.compareNodes = compareNodes; +exports.isSome = isSome; +exports.assertSome = assertSome; +const graphql_1 = require("graphql"); +const URL_REGEXP = /^(https?|wss?|file):\/\//; +/** + * Checks if the given string is a valid URL. + * + * @param str - The string to validate as a URL + * @returns A boolean indicating whether the string is a valid URL + * + * @remarks + * This function first attempts to use the `URL.canParse` method if available. + * If not, it falls back to creating a new `URL` object to validate the string. + */ +function isUrl(str) { + if (typeof str !== 'string') { + return false; + } + if (!URL_REGEXP.test(str)) { + return false; + } + if (URL.canParse) { + return URL.canParse(str); + } + try { + const url = new URL(str); + return !!url; + } + catch (e) { + return false; + } +} +const asArray = (fns) => (Array.isArray(fns) ? fns : fns ? [fns] : []); +exports.asArray = asArray; +const invalidDocRegex = /\.[a-z0-9]+$/i; +/** + * Determines if a given input is a valid GraphQL document string. + * + * @param str - The input to validate as a GraphQL document + * @returns A boolean indicating whether the input is a valid GraphQL document string + * + * @remarks + * This function performs several validation checks: + * - Ensures the input is a string + * - Filters out strings with invalid document extensions + * - Excludes URLs + * - Attempts to parse the string as a GraphQL document + * + * @throws {Error} If the document fails to parse and is empty except GraphQL comments + */ +function isDocumentString(str) { + if (typeof str !== 'string') { + return false; + } + // XXX: is-valid-path or is-glob treat SDL as a valid path + // (`scalar Date` for example) + // this why checking the extension is fast enough + // and prevent from parsing the string in order to find out + // if the string is a SDL + if (invalidDocRegex.test(str) || isUrl(str)) { + return false; + } + try { + (0, graphql_1.parse)(str); + return true; + } + catch (e) { + if (!e.message.includes('EOF') && + str.replace(/(\#[^*]*)/g, '').trim() !== '' && + str.includes(' ')) { + throw new Error(`Failed to parse the GraphQL document. ${e.message}\n${str}`); + } + } + return false; +} +const invalidPathRegex = /[‘“!^<>`\n]/; +/** + * Checks whether the `str` contains any path illegal characters. + * + * A string may sometimes look like a path but is not (like an SDL of a simple + * GraphQL schema). To make sure we don't yield false-positives in such cases, + * we disallow new lines in paths (even though most Unix systems support new + * lines in file names). + */ +function isValidPath(str) { + return typeof str === 'string' && !invalidPathRegex.test(str); +} +function compareStrings(a, b) { + if (String(a) < String(b)) { + return -1; + } + if (String(a) > String(b)) { + return 1; + } + return 0; +} +function nodeToString(a) { + let name; + if ('alias' in a) { + name = a.alias?.value; + } + if (name == null && 'name' in a) { + name = a.name?.value; + } + if (name == null) { + name = a.kind; + } + return name; +} +function compareNodes(a, b, customFn) { + const aStr = nodeToString(a); + const bStr = nodeToString(b); + if (typeof customFn === 'function') { + return customFn(aStr, bStr); + } + return compareStrings(aStr, bStr); +} +function isSome(input) { + return input != null; +} +function assertSome(input, message = 'Value should be something') { + if (input == null) { + throw new Error(message); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/implementsAbstractType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/implementsAbstractType.js new file mode 100644 index 00000000..f7222f0e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/implementsAbstractType.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.implementsAbstractType = implementsAbstractType; +const graphql_1 = require("graphql"); +function implementsAbstractType(schema, typeA, typeB) { + if (typeB == null || typeA == null) { + return false; + } + else if (typeA === typeB) { + return true; + } + else if ((0, graphql_1.isCompositeType)(typeA) && (0, graphql_1.isCompositeType)(typeB)) { + return (0, graphql_1.doTypesOverlap)(schema, typeA, typeB); + } + return false; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/index.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/index.js new file mode 100644 index 00000000..67303fca --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/index.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDeferred = exports.fakePromise = exports.mapMaybePromise = exports.mapAsyncIterator = exports.inspect = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./loaders.js"), exports); +tslib_1.__exportStar(require("./helpers.js"), exports); +tslib_1.__exportStar(require("./get-directives.js"), exports); +tslib_1.__exportStar(require("./get-fields-with-directives.js"), exports); +tslib_1.__exportStar(require("./get-arguments-with-directives.js"), exports); +tslib_1.__exportStar(require("./get-implementing-types.js"), exports); +tslib_1.__exportStar(require("./print-schema-with-directives.js"), exports); +tslib_1.__exportStar(require("./get-fields-with-directives.js"), exports); +tslib_1.__exportStar(require("./validate-documents.js"), exports); +tslib_1.__exportStar(require("./parse-graphql-json.js"), exports); +tslib_1.__exportStar(require("./parse-graphql-sdl.js"), exports); +tslib_1.__exportStar(require("./build-operation-for-field.js"), exports); +tslib_1.__exportStar(require("./types.js"), exports); +tslib_1.__exportStar(require("./filterSchema.js"), exports); +tslib_1.__exportStar(require("./heal.js"), exports); +tslib_1.__exportStar(require("./getResolversFromSchema.js"), exports); +tslib_1.__exportStar(require("./forEachField.js"), exports); +tslib_1.__exportStar(require("./forEachDefaultValue.js"), exports); +tslib_1.__exportStar(require("./mapSchema.js"), exports); +tslib_1.__exportStar(require("./addTypes.js"), exports); +tslib_1.__exportStar(require("./rewire.js"), exports); +tslib_1.__exportStar(require("./prune.js"), exports); +tslib_1.__exportStar(require("./mergeDeep.js"), exports); +tslib_1.__exportStar(require("./Interfaces.js"), exports); +tslib_1.__exportStar(require("./stub.js"), exports); +tslib_1.__exportStar(require("./selectionSets.js"), exports); +tslib_1.__exportStar(require("./getResponseKeyFromInfo.js"), exports); +tslib_1.__exportStar(require("./fields.js"), exports); +tslib_1.__exportStar(require("./renameType.js"), exports); +tslib_1.__exportStar(require("./transformInputValue.js"), exports); +tslib_1.__exportStar(require("./updateArgument.js"), exports); +tslib_1.__exportStar(require("./astFromType.js"), exports); +tslib_1.__exportStar(require("./implementsAbstractType.js"), exports); +tslib_1.__exportStar(require("./errors.js"), exports); +tslib_1.__exportStar(require("./observableToAsyncIterable.js"), exports); +tslib_1.__exportStar(require("./visitResult.js"), exports); +tslib_1.__exportStar(require("./getArgumentValues.js"), exports); +tslib_1.__exportStar(require("./valueMatchesCriteria.js"), exports); +tslib_1.__exportStar(require("./isAsyncIterable.js"), exports); +tslib_1.__exportStar(require("./isDocumentNode.js"), exports); +tslib_1.__exportStar(require("./astFromValueUntyped.js"), exports); +tslib_1.__exportStar(require("./executor.js"), exports); +tslib_1.__exportStar(require("./withCancel.js"), exports); +tslib_1.__exportStar(require("./rootTypes.js"), exports); +tslib_1.__exportStar(require("./comments.js"), exports); +tslib_1.__exportStar(require("./collectFields.js"), exports); +var cross_inspect_1 = require("cross-inspect"); +Object.defineProperty(exports, "inspect", { enumerable: true, get: function () { return cross_inspect_1.inspect; } }); +tslib_1.__exportStar(require("./memoize.js"), exports); +tslib_1.__exportStar(require("./fixSchemaAst.js"), exports); +tslib_1.__exportStar(require("./getOperationASTFromRequest.js"), exports); +tslib_1.__exportStar(require("./extractExtensionsFromSchema.js"), exports); +tslib_1.__exportStar(require("./Path.js"), exports); +tslib_1.__exportStar(require("./jsutils.js"), exports); +tslib_1.__exportStar(require("./directives.js"), exports); +tslib_1.__exportStar(require("./mergeIncrementalResult.js"), exports); +tslib_1.__exportStar(require("./debugTimer.js"), exports); +tslib_1.__exportStar(require("./getDirectiveExtensions.js"), exports); +var promise_helpers_1 = require("@whatwg-node/promise-helpers"); +Object.defineProperty(exports, "mapAsyncIterator", { enumerable: true, get: function () { return promise_helpers_1.mapAsyncIterator; } }); +Object.defineProperty(exports, "mapMaybePromise", { enumerable: true, get: function () { return promise_helpers_1.mapMaybePromise; } }); +Object.defineProperty(exports, "fakePromise", { enumerable: true, get: function () { return promise_helpers_1.fakePromise; } }); +Object.defineProperty(exports, "createDeferred", { enumerable: true, get: function () { return promise_helpers_1.createDeferredPromise; } }); +tslib_1.__exportStar(require("./registerAbortSignalListener.js"), exports); +tslib_1.__exportStar(require("./getDirectiveValues.js"), exports); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isAsyncIterable.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isAsyncIterable.js new file mode 100644 index 00000000..c6e6f59d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isAsyncIterable.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isAsyncIterable = isAsyncIterable; +function isAsyncIterable(value) { + return value?.[Symbol.asyncIterator] != null; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isDocumentNode.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isDocumentNode.js new file mode 100644 index 00000000..01051203 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/isDocumentNode.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isDocumentNode = isDocumentNode; +const graphql_1 = require("graphql"); +function isDocumentNode(object) { + return object && typeof object === 'object' && 'kind' in object && object.kind === graphql_1.Kind.DOCUMENT; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/jsutils.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/jsutils.js new file mode 100644 index 00000000..be2675f7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/jsutils.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPromise = void 0; +exports.isIterableObject = isIterableObject; +exports.isObjectLike = isObjectLike; +exports.promiseReduce = promiseReduce; +exports.hasOwnProperty = hasOwnProperty; +const promise_helpers_1 = require("@whatwg-node/promise-helpers"); +Object.defineProperty(exports, "isPromise", { enumerable: true, get: function () { return promise_helpers_1.isPromise; } }); +function isIterableObject(value) { + return value != null && typeof value === 'object' && Symbol.iterator in value; +} +function isObjectLike(value) { + return typeof value === 'object' && value !== null; +} +function promiseReduce(values, callbackFn, initialValue) { + let accumulator = initialValue; + for (const value of values) { + accumulator = (0, promise_helpers_1.handleMaybePromise)(() => accumulator, resolved => callbackFn(resolved, value)); + } + return accumulator; +} +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/loaders.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/loaders.js new file mode 100644 index 00000000..e69de29b diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mapSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mapSchema.js new file mode 100644 index 00000000..35ff91fb --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mapSchema.js @@ -0,0 +1,471 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mapSchema = mapSchema; +exports.correctASTNodes = correctASTNodes; +const graphql_1 = require("graphql"); +const getObjectTypeFromTypeMap_js_1 = require("./getObjectTypeFromTypeMap.js"); +const Interfaces_js_1 = require("./Interfaces.js"); +const rewire_js_1 = require("./rewire.js"); +const transformInputValue_js_1 = require("./transformInputValue.js"); +function mapSchema(schema, schemaMapper = {}) { + const newTypeMap = mapArguments(mapFields(mapTypes(mapDefaultValues(mapEnumValues(mapTypes(mapDefaultValues(schema.getTypeMap(), schema, transformInputValue_js_1.serializeInputValue), schema, schemaMapper, type => (0, graphql_1.isLeafType)(type)), schema, schemaMapper), schema, transformInputValue_js_1.parseInputValue), schema, schemaMapper, type => !(0, graphql_1.isLeafType)(type)), schema, schemaMapper), schema, schemaMapper); + const originalDirectives = schema.getDirectives(); + const newDirectives = mapDirectives(originalDirectives, schema, schemaMapper); + const { typeMap, directives } = (0, rewire_js_1.rewireTypes)(newTypeMap, newDirectives); + return new graphql_1.GraphQLSchema({ + ...schema.toConfig(), + query: (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(typeMap, (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(newTypeMap, schema.getQueryType())), + mutation: (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(typeMap, (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(newTypeMap, schema.getMutationType())), + subscription: (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(typeMap, (0, getObjectTypeFromTypeMap_js_1.getObjectTypeFromTypeMap)(newTypeMap, schema.getSubscriptionType())), + types: Object.values(typeMap), + directives, + }); +} +const builtinTypes = ['String', 'ID', 'Int', 'Float', 'Boolean']; +function mapTypes(originalTypeMap, schema, schemaMapper, testFn = () => true) { + const newTypeMap = {}; + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__') && !builtinTypes.includes(typeName)) { + const originalType = originalTypeMap[typeName]; + if (originalType == null || !testFn(originalType)) { + newTypeMap[typeName] = originalType; + continue; + } + const typeMapper = getTypeMapper(schema, schemaMapper, typeName); + if (typeMapper == null) { + newTypeMap[typeName] = originalType; + continue; + } + const maybeNewType = typeMapper(originalType, schema); + if (maybeNewType === undefined) { + newTypeMap[typeName] = originalType; + continue; + } + newTypeMap[typeName] = maybeNewType; + } + } + return newTypeMap; +} +function mapEnumValues(originalTypeMap, schema, schemaMapper) { + const enumValueMapper = getEnumValueMapper(schemaMapper); + if (!enumValueMapper) { + return originalTypeMap; + } + return mapTypes(originalTypeMap, schema, { + [Interfaces_js_1.MapperKind.ENUM_TYPE]: type => { + const config = type.toConfig(); + const originalEnumValueConfigMap = config.values; + const newEnumValueConfigMap = {}; + for (const externalValue in originalEnumValueConfigMap) { + const originalEnumValueConfig = originalEnumValueConfigMap[externalValue]; + const mappedEnumValue = enumValueMapper(originalEnumValueConfig, type.name, schema, externalValue); + if (mappedEnumValue === undefined) { + newEnumValueConfigMap[externalValue] = originalEnumValueConfig; + } + else if (Array.isArray(mappedEnumValue)) { + const [newExternalValue, newEnumValueConfig] = mappedEnumValue; + newEnumValueConfigMap[newExternalValue] = + newEnumValueConfig === undefined ? originalEnumValueConfig : newEnumValueConfig; + } + else if (mappedEnumValue !== null) { + newEnumValueConfigMap[externalValue] = mappedEnumValue; + } + } + return correctASTNodes(new graphql_1.GraphQLEnumType({ + ...config, + values: newEnumValueConfigMap, + })); + }, + }, type => (0, graphql_1.isEnumType)(type)); +} +function mapDefaultValues(originalTypeMap, schema, fn) { + const newTypeMap = mapArguments(originalTypeMap, schema, { + [Interfaces_js_1.MapperKind.ARGUMENT]: argumentConfig => { + if (argumentConfig.defaultValue === undefined) { + return argumentConfig; + } + const maybeNewType = getNewType(originalTypeMap, argumentConfig.type); + if (maybeNewType != null) { + return { + ...argumentConfig, + defaultValue: fn(maybeNewType, argumentConfig.defaultValue), + }; + } + }, + }); + return mapFields(newTypeMap, schema, { + [Interfaces_js_1.MapperKind.INPUT_OBJECT_FIELD]: inputFieldConfig => { + if (inputFieldConfig.defaultValue === undefined) { + return inputFieldConfig; + } + const maybeNewType = getNewType(newTypeMap, inputFieldConfig.type); + if (maybeNewType != null) { + return { + ...inputFieldConfig, + defaultValue: fn(maybeNewType, inputFieldConfig.defaultValue), + }; + } + }, + }); +} +function getNewType(newTypeMap, type) { + if ((0, graphql_1.isListType)(type)) { + const newType = getNewType(newTypeMap, type.ofType); + return newType != null ? new graphql_1.GraphQLList(newType) : null; + } + else if ((0, graphql_1.isNonNullType)(type)) { + const newType = getNewType(newTypeMap, type.ofType); + return newType != null ? new graphql_1.GraphQLNonNull(newType) : null; + } + else if ((0, graphql_1.isNamedType)(type)) { + const newType = newTypeMap[type.name]; + return newType != null ? newType : null; + } + return null; +} +function mapFields(originalTypeMap, schema, schemaMapper) { + const newTypeMap = {}; + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__')) { + const originalType = originalTypeMap[typeName]; + if (!(0, graphql_1.isObjectType)(originalType) && + !(0, graphql_1.isInterfaceType)(originalType) && + !(0, graphql_1.isInputObjectType)(originalType)) { + newTypeMap[typeName] = originalType; + continue; + } + const fieldMapper = getFieldMapper(schema, schemaMapper, typeName); + if (fieldMapper == null) { + newTypeMap[typeName] = originalType; + continue; + } + const config = originalType.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + const mappedField = fieldMapper(originalFieldConfig, fieldName, typeName, schema); + if (mappedField === undefined) { + newFieldConfigMap[fieldName] = originalFieldConfig; + } + else if (Array.isArray(mappedField)) { + const [newFieldName, newFieldConfig] = mappedField; + if (newFieldConfig.astNode != null) { + newFieldConfig.astNode = { + ...newFieldConfig.astNode, + name: { + ...newFieldConfig.astNode.name, + value: newFieldName, + }, + }; + } + newFieldConfigMap[newFieldName] = + newFieldConfig === undefined ? originalFieldConfig : newFieldConfig; + } + else if (mappedField !== null) { + newFieldConfigMap[fieldName] = mappedField; + } + } + if ((0, graphql_1.isObjectType)(originalType)) { + newTypeMap[typeName] = correctASTNodes(new graphql_1.GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + else if ((0, graphql_1.isInterfaceType)(originalType)) { + newTypeMap[typeName] = correctASTNodes(new graphql_1.GraphQLInterfaceType({ + ...config, + fields: newFieldConfigMap, + })); + } + else { + newTypeMap[typeName] = correctASTNodes(new graphql_1.GraphQLInputObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + } + } + return newTypeMap; +} +function mapArguments(originalTypeMap, schema, schemaMapper) { + const newTypeMap = {}; + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__')) { + const originalType = originalTypeMap[typeName]; + if (!(0, graphql_1.isObjectType)(originalType) && !(0, graphql_1.isInterfaceType)(originalType)) { + newTypeMap[typeName] = originalType; + continue; + } + const argumentMapper = getArgumentMapper(schemaMapper); + if (argumentMapper == null) { + newTypeMap[typeName] = originalType; + continue; + } + const config = originalType.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + const originalArgumentConfigMap = originalFieldConfig.args; + if (originalArgumentConfigMap == null) { + newFieldConfigMap[fieldName] = originalFieldConfig; + continue; + } + const argumentNames = Object.keys(originalArgumentConfigMap); + if (!argumentNames.length) { + newFieldConfigMap[fieldName] = originalFieldConfig; + continue; + } + const newArgumentConfigMap = {}; + for (const argumentName of argumentNames) { + const originalArgumentConfig = originalArgumentConfigMap[argumentName]; + const mappedArgument = argumentMapper(originalArgumentConfig, fieldName, typeName, schema); + if (mappedArgument === undefined) { + newArgumentConfigMap[argumentName] = originalArgumentConfig; + } + else if (Array.isArray(mappedArgument)) { + const [newArgumentName, newArgumentConfig] = mappedArgument; + newArgumentConfigMap[newArgumentName] = newArgumentConfig; + } + else if (mappedArgument !== null) { + newArgumentConfigMap[argumentName] = mappedArgument; + } + } + newFieldConfigMap[fieldName] = { + ...originalFieldConfig, + args: newArgumentConfigMap, + }; + } + if ((0, graphql_1.isObjectType)(originalType)) { + newTypeMap[typeName] = new graphql_1.GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + }); + } + else if ((0, graphql_1.isInterfaceType)(originalType)) { + newTypeMap[typeName] = new graphql_1.GraphQLInterfaceType({ + ...config, + fields: newFieldConfigMap, + }); + } + else { + newTypeMap[typeName] = new graphql_1.GraphQLInputObjectType({ + ...config, + fields: newFieldConfigMap, + }); + } + } + } + return newTypeMap; +} +function mapDirectives(originalDirectives, schema, schemaMapper) { + const directiveMapper = getDirectiveMapper(schemaMapper); + if (directiveMapper == null) { + return originalDirectives.slice(); + } + const newDirectives = []; + for (const directive of originalDirectives) { + const mappedDirective = directiveMapper(directive, schema); + if (mappedDirective === undefined) { + newDirectives.push(directive); + } + else if (mappedDirective !== null) { + newDirectives.push(mappedDirective); + } + } + return newDirectives; +} +function getTypeSpecifiers(schema, typeName) { + const type = schema.getType(typeName); + const specifiers = [Interfaces_js_1.MapperKind.TYPE]; + if ((0, graphql_1.isObjectType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.COMPOSITE_TYPE, Interfaces_js_1.MapperKind.OBJECT_TYPE); + if (typeName === schema.getQueryType()?.name) { + specifiers.push(Interfaces_js_1.MapperKind.ROOT_OBJECT, Interfaces_js_1.MapperKind.QUERY); + } + else if (typeName === schema.getMutationType()?.name) { + specifiers.push(Interfaces_js_1.MapperKind.ROOT_OBJECT, Interfaces_js_1.MapperKind.MUTATION); + } + else if (typeName === schema.getSubscriptionType()?.name) { + specifiers.push(Interfaces_js_1.MapperKind.ROOT_OBJECT, Interfaces_js_1.MapperKind.SUBSCRIPTION); + } + } + else if ((0, graphql_1.isInputObjectType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.INPUT_OBJECT_TYPE); + } + else if ((0, graphql_1.isInterfaceType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.COMPOSITE_TYPE, Interfaces_js_1.MapperKind.ABSTRACT_TYPE, Interfaces_js_1.MapperKind.INTERFACE_TYPE); + } + else if ((0, graphql_1.isUnionType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.COMPOSITE_TYPE, Interfaces_js_1.MapperKind.ABSTRACT_TYPE, Interfaces_js_1.MapperKind.UNION_TYPE); + } + else if ((0, graphql_1.isEnumType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.ENUM_TYPE); + } + else if ((0, graphql_1.isScalarType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.SCALAR_TYPE); + } + return specifiers; +} +function getTypeMapper(schema, schemaMapper, typeName) { + const specifiers = getTypeSpecifiers(schema, typeName); + let typeMapper; + const stack = [...specifiers]; + while (!typeMapper && stack.length > 0) { + // It is safe to use the ! operator here as we check the length. + const next = stack.pop(); + typeMapper = schemaMapper[next]; + } + return typeMapper != null ? typeMapper : null; +} +function getFieldSpecifiers(schema, typeName) { + const type = schema.getType(typeName); + const specifiers = [Interfaces_js_1.MapperKind.FIELD]; + if ((0, graphql_1.isObjectType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.COMPOSITE_FIELD, Interfaces_js_1.MapperKind.OBJECT_FIELD); + if (typeName === schema.getQueryType()?.name) { + specifiers.push(Interfaces_js_1.MapperKind.ROOT_FIELD, Interfaces_js_1.MapperKind.QUERY_ROOT_FIELD); + } + else if (typeName === schema.getMutationType()?.name) { + specifiers.push(Interfaces_js_1.MapperKind.ROOT_FIELD, Interfaces_js_1.MapperKind.MUTATION_ROOT_FIELD); + } + else if (typeName === schema.getSubscriptionType()?.name) { + specifiers.push(Interfaces_js_1.MapperKind.ROOT_FIELD, Interfaces_js_1.MapperKind.SUBSCRIPTION_ROOT_FIELD); + } + } + else if ((0, graphql_1.isInterfaceType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.COMPOSITE_FIELD, Interfaces_js_1.MapperKind.INTERFACE_FIELD); + } + else if ((0, graphql_1.isInputObjectType)(type)) { + specifiers.push(Interfaces_js_1.MapperKind.INPUT_OBJECT_FIELD); + } + return specifiers; +} +function getFieldMapper(schema, schemaMapper, typeName) { + const specifiers = getFieldSpecifiers(schema, typeName); + let fieldMapper; + const stack = [...specifiers]; + while (!fieldMapper && stack.length > 0) { + // It is safe to use the ! operator here as we check the length. + const next = stack.pop(); + // TODO: fix this as unknown cast + fieldMapper = schemaMapper[next]; + } + return fieldMapper ?? null; +} +function getArgumentMapper(schemaMapper) { + const argumentMapper = schemaMapper[Interfaces_js_1.MapperKind.ARGUMENT]; + return argumentMapper != null ? argumentMapper : null; +} +function getDirectiveMapper(schemaMapper) { + const directiveMapper = schemaMapper[Interfaces_js_1.MapperKind.DIRECTIVE]; + return directiveMapper != null ? directiveMapper : null; +} +function getEnumValueMapper(schemaMapper) { + const enumValueMapper = schemaMapper[Interfaces_js_1.MapperKind.ENUM_VALUE]; + return enumValueMapper != null ? enumValueMapper : null; +} +function correctASTNodes(type) { + if ((0, graphql_1.isObjectType)(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const fields = []; + for (const fieldName in config.fields) { + const fieldConfig = config.fields[fieldName]; + if (fieldConfig.astNode != null) { + fields.push(fieldConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + kind: graphql_1.Kind.OBJECT_TYPE_DEFINITION, + fields, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + kind: graphql_1.Kind.OBJECT_TYPE_EXTENSION, + fields: undefined, + })); + } + return new graphql_1.GraphQLObjectType(config); + } + else if ((0, graphql_1.isInterfaceType)(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const fields = []; + for (const fieldName in config.fields) { + const fieldConfig = config.fields[fieldName]; + if (fieldConfig.astNode != null) { + fields.push(fieldConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + kind: graphql_1.Kind.INTERFACE_TYPE_DEFINITION, + fields, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + kind: graphql_1.Kind.INTERFACE_TYPE_EXTENSION, + fields: undefined, + })); + } + return new graphql_1.GraphQLInterfaceType(config); + } + else if ((0, graphql_1.isInputObjectType)(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const fields = []; + for (const fieldName in config.fields) { + const fieldConfig = config.fields[fieldName]; + if (fieldConfig.astNode != null) { + fields.push(fieldConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + kind: graphql_1.Kind.INPUT_OBJECT_TYPE_DEFINITION, + fields, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + kind: graphql_1.Kind.INPUT_OBJECT_TYPE_EXTENSION, + fields: undefined, + })); + } + return new graphql_1.GraphQLInputObjectType(config); + } + else if ((0, graphql_1.isEnumType)(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const values = []; + for (const enumKey in config.values) { + const enumValueConfig = config.values[enumKey]; + if (enumValueConfig.astNode != null) { + values.push(enumValueConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + values, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + values: undefined, + })); + } + return new graphql_1.GraphQLEnumType(config); + } + else { + return type; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/memoize.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/memoize.js new file mode 100644 index 00000000..f278e05c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/memoize.js @@ -0,0 +1,209 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.memoize1 = memoize1; +exports.memoize2 = memoize2; +exports.memoize3 = memoize3; +exports.memoize4 = memoize4; +exports.memoize5 = memoize5; +exports.memoize2of4 = memoize2of4; +exports.memoize2of5 = memoize2of5; +function memoize1(fn) { + const memoize1cache = new WeakMap(); + return function memoized(a1) { + const cachedValue = memoize1cache.get(a1); + if (cachedValue === undefined) { + const newValue = fn(a1); + memoize1cache.set(a1, newValue); + return newValue; + } + return cachedValue; + }; +} +function memoize2(fn) { + const memoize2cache = new WeakMap(); + return function memoized(a1, a2) { + let cache2 = memoize2cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize2cache.set(a1, cache2); + const newValue = fn(a1, a2); + cache2.set(a2, newValue); + return newValue; + } + const cachedValue = cache2.get(a2); + if (cachedValue === undefined) { + const newValue = fn(a1, a2); + cache2.set(a2, newValue); + return newValue; + } + return cachedValue; + }; +} +function memoize3(fn) { + const memoize3Cache = new WeakMap(); + return function memoized(a1, a2, a3) { + let cache2 = memoize3Cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize3Cache.set(a1, cache2); + const cache3 = new WeakMap(); + cache2.set(a2, cache3); + const newValue = fn(a1, a2, a3); + cache3.set(a3, newValue); + return newValue; + } + let cache3 = cache2.get(a2); + if (!cache3) { + cache3 = new WeakMap(); + cache2.set(a2, cache3); + const newValue = fn(a1, a2, a3); + cache3.set(a3, newValue); + return newValue; + } + const cachedValue = cache3.get(a3); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3); + cache3.set(a3, newValue); + return newValue; + } + return cachedValue; + }; +} +function memoize4(fn) { + const memoize4Cache = new WeakMap(); + return function memoized(a1, a2, a3, a4) { + let cache2 = memoize4Cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize4Cache.set(a1, cache2); + const cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + let cache3 = cache2.get(a2); + if (!cache3) { + cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + const cache4 = cache3.get(a3); + if (!cache4) { + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + const cachedValue = cache4.get(a4); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + return cachedValue; + }; +} +function memoize5(fn) { + const memoize5Cache = new WeakMap(); + return function memoized(a1, a2, a3, a4, a5) { + let cache2 = memoize5Cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize5Cache.set(a1, cache2); + const cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + let cache3 = cache2.get(a2); + if (!cache3) { + cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + let cache4 = cache3.get(a3); + if (!cache4) { + cache4 = new WeakMap(); + cache3.set(a3, cache4); + const cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + let cache5 = cache4.get(a4); + if (!cache5) { + cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + const cachedValue = cache5.get(a5); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + return cachedValue; + }; +} +function memoize2of4(fn) { + const memoize2of4cache = new WeakMap(); + return function memoized(a1, a2, a3, a4) { + let cache2 = memoize2of4cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize2of4cache.set(a1, cache2); + const newValue = fn(a1, a2, a3, a4); + cache2.set(a2, newValue); + return newValue; + } + const cachedValue = cache2.get(a2); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4); + cache2.set(a2, newValue); + return newValue; + } + return cachedValue; + }; +} +function memoize2of5(fn) { + const memoize2of4cache = new WeakMap(); + return function memoized(a1, a2, a3, a4, a5) { + let cache2 = memoize2of4cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize2of4cache.set(a1, cache2); + const newValue = fn(a1, a2, a3, a4, a5); + cache2.set(a2, newValue); + return newValue; + } + const cachedValue = cache2.get(a2); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4, a5); + cache2.set(a2, newValue); + return newValue; + } + return cachedValue; + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeDeep.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeDeep.js new file mode 100644 index 00000000..b588ac48 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeDeep.js @@ -0,0 +1,108 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeDeep = mergeDeep; +const helpers_js_1 = require("./helpers.js"); +function mergeDeep(sources, respectPrototype = false, respectArrays = false, respectArrayLength = false, respectNonEnumerableSymbols = false) { + if (sources.length === 0) { + return; + } + if (sources.length === 1) { + return sources[0]; + } + let expectedLength; + let allArrays = true; + const areArraysInTheSameLength = sources.every(source => { + if (Array.isArray(source)) { + if (expectedLength === undefined) { + expectedLength = source.length; + return true; + } + else if (expectedLength === source.length) { + return true; + } + } + else { + allArrays = false; + } + return false; + }); + if (respectArrayLength && areArraysInTheSameLength) { + return new Array(expectedLength).fill(null).map((_, index) => mergeDeep(sources.map(source => source[index]), respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols)); + } + if (allArrays) { + return sources.flat(1); + } + let output; + let firstObjectSource; + if (respectPrototype) { + firstObjectSource = sources.find(source => isObject(source)); + if (firstObjectSource) { + if (output == null) { + output = {}; + } + Object.setPrototypeOf(output, Object.create(Object.getPrototypeOf(firstObjectSource))); + } + } + for (const source of sources) { + if (source === undefined) { + continue; + } + if (isObject(source)) { + if (output == null) { + output = {}; + } + if (firstObjectSource) { + const outputPrototype = Object.getPrototypeOf(output); + const sourcePrototype = Object.getPrototypeOf(source); + if (sourcePrototype) { + for (const key of Object.getOwnPropertyNames(sourcePrototype)) { + const descriptor = Object.getOwnPropertyDescriptor(sourcePrototype, key); + if ((0, helpers_js_1.isSome)(descriptor)) { + Object.defineProperty(outputPrototype, key, descriptor); + } + } + } + } + for (const key in source) { + // never let a source key reach the prototype chain + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + continue; + } + // An own key present with value `undefined` is an explicit override and must win, + // distinct from the key being altogether absent from `source`. Assigning directly + // (rather than recursing through mergeDeep) avoids the top-level `source === undefined` + // skip above, which would otherwise silently discard this override and keep the prior + // value. + if (Object.prototype.hasOwnProperty.call(output, key) && source[key] !== undefined) { + output[key] = mergeDeep([output[key], source[key]], respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols); + } + else { + output[key] = source[key]; + } + } + if (respectNonEnumerableSymbols && output != null) { + for (const sym of Object.getOwnPropertySymbols(source)) { + const descriptor = Object.getOwnPropertyDescriptor(source, sym); + if (!descriptor.enumerable) { + Object.defineProperty(output, sym, descriptor); + } + } + } + } + else if (Array.isArray(source)) { + if (!Array.isArray(output)) { + output = source; + } + else { + output = mergeDeep([output, source], respectPrototype, respectArrays, respectArrayLength); + } + } + else { + output = source; + } + } + return output; +} +function isObject(item) { + return item && typeof item === 'object' && !Array.isArray(item); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeIncrementalResult.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeIncrementalResult.js new file mode 100644 index 00000000..c19d3f73 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/mergeIncrementalResult.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeIncrementalResult = mergeIncrementalResult; +const mergeDeep_js_1 = require("./mergeDeep.js"); +function mergeIncrementalResult({ incrementalResult, executionResult, }) { + const path = ['data', ...(incrementalResult.path ?? [])]; + if (incrementalResult.items) { + for (const item of incrementalResult.items) { + setObjectKeyPath(executionResult, path, item); + // Increment the last path segment (the array index) to merge the next item at the next index + path[path.length - 1]++; + } + } + if (incrementalResult.data) { + setObjectKeyPath(executionResult, path, incrementalResult.data); + } + if (incrementalResult.errors) { + executionResult.errors = executionResult.errors || []; + executionResult.errors.push(...incrementalResult.errors); + } + if (incrementalResult.extensions) { + setObjectKeyPath(executionResult, ['extensions'], incrementalResult.extensions); + } + if (incrementalResult.incremental) { + incrementalResult.incremental.forEach(incrementalSubResult => { + mergeIncrementalResult({ + incrementalResult: incrementalSubResult, + executionResult, + }); + }); + } +} +function setObjectKeyPath(obj, keyPath, value) { + let current = obj; + let i; + for (i = 0; i < keyPath.length - 1; i++) { + const key = keyPath[i]; + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return; + } + if (current[key] == null) { + // Determine if the next key is a number to create an array, otherwise create an object + current[key] = typeof keyPath[i + 1] === 'number' ? [] : {}; + } + current = current[key]; + } + const finalKey = keyPath[i]; + if (finalKey === '__proto__' || finalKey === 'constructor' || finalKey === 'prototype') { + return; + } + const existingValue = current[finalKey]; + current[finalKey] = existingValue != null ? (0, mergeDeep_js_1.mergeDeep)([existingValue, value]) : value; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/observableToAsyncIterable.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/observableToAsyncIterable.js new file mode 100644 index 00000000..09fd1edd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/observableToAsyncIterable.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.observableToAsyncIterable = observableToAsyncIterable; +const promise_helpers_1 = require("@whatwg-node/promise-helpers"); +function observableToAsyncIterable(observable) { + const pullQueue = []; + const pushQueue = []; + let listening = true; + const subscriptionRef = {}; + const emptyQueue = () => { + if (listening) { + listening = false; + subscriptionRef.current?.unsubscribe(); + for (const resolve of pullQueue) { + resolve({ value: undefined, done: true }); + } + pullQueue.length = 0; + pushQueue.length = 0; + } + }; + const pushValue = (value) => { + if (pullQueue.length !== 0) { + // It is safe to use the ! operator here as we check the length. + pullQueue.shift()({ value, done: false }); + } + else { + pushQueue.push({ value, done: false }); + } + }; + const pushError = (error) => { + if (pullQueue.length !== 0) { + // It is safe to use the ! operator here as we check the length. + pullQueue.shift()({ value: { errors: [error] }, done: false }); + } + else { + pushQueue.push({ value: { errors: [error] }, done: false }); + } + }; + const pushDone = () => { + if (pullQueue.length !== 0) { + // It is safe to use the ! operator here as we check the length. + pullQueue.shift()({ value: undefined, done: true }); + // Release queues/subscription after signaling done to the pending consumer. + emptyQueue(); + } + else { + pushQueue.push({ value: undefined, done: true }); + } + }; + const pullValue = () => new Promise(resolve => { + if (pushQueue.length !== 0) { + const element = pushQueue.shift(); + // either {value: {errors: [...]}} or {value: ...} + if (element.done) { + // Release references before delivering the done signal. + emptyQueue(); + } + resolve(element); + } + else { + pullQueue.push(resolve); + } + }); + subscriptionRef.current = observable.subscribe({ + next(value) { + return pushValue(value); + }, + error(err) { + return pushError(err); + }, + complete() { + return pushDone(); + }, + }); + // complete() may run synchronously inside subscribe() before it returns; + // unsubscribe the returned subscription in that case. + if (!listening) { + subscriptionRef.current.unsubscribe(); + } + return { + next() { + // return is a defined method, so it is safe to call it. + return listening ? pullValue() : this.return(); + }, + return() { + emptyQueue(); + return (0, promise_helpers_1.fakePromise)({ value: undefined, done: true }); + }, + throw(error) { + emptyQueue(); + return (0, promise_helpers_1.fakeRejectPromise)(error); + }, + [Symbol.asyncIterator]() { + return this; + }, + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/package.json b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-json.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-json.js new file mode 100644 index 00000000..592660a7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-json.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseGraphQLJSON = parseGraphQLJSON; +const graphql_1 = require("graphql"); +function stripBOM(content) { + content = content.toString(); + // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + // because the buffer-to-string conversion in `fs.readFileSync()` + // translates it to FEFF, the UTF-16 BOM. + if (content.charCodeAt(0) === 0xfeff) { + content = content.slice(1); + } + return content; +} +function parseBOM(content) { + return JSON.parse(stripBOM(content)); +} +function parseGraphQLJSON(location, jsonContent, options) { + let parsedJson = parseBOM(jsonContent); + if (parsedJson.data) { + parsedJson = parsedJson.data; + } + if (parsedJson.kind === 'Document') { + return { + location, + document: parsedJson, + }; + } + else if (parsedJson.__schema) { + const schema = (0, graphql_1.buildClientSchema)(parsedJson, options); + return { + location, + schema, + }; + } + else if (typeof parsedJson === 'string') { + return { + location, + rawSDL: parsedJson, + }; + } + throw new Error(`Not valid JSON content`); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-sdl.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-sdl.js new file mode 100644 index 00000000..0b0be4ab --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/parse-graphql-sdl.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseGraphQLSDL = parseGraphQLSDL; +exports.transformCommentsToDescriptions = transformCommentsToDescriptions; +exports.isDescribable = isDescribable; +const graphql_1 = require("graphql"); +const comments_js_1 = require("./comments.js"); +function parseGraphQLSDL(location, rawSDL, options = {}) { + let document; + try { + if (options.commentDescriptions && rawSDL.includes('#')) { + document = transformCommentsToDescriptions(rawSDL, options); + // If noLocation=true, we need to make sure to print and parse it again, to remove locations, + // since `transformCommentsToDescriptions` must have locations set in order to transform the comments + // into descriptions. + if (options.noLocation) { + document = (0, graphql_1.parse)((0, graphql_1.print)(document), options); + } + } + else { + document = (0, graphql_1.parse)(new graphql_1.Source(rawSDL, location), options); + } + } + catch (e) { + if (e.message.includes('EOF') && rawSDL.replace(/(\#[^*]*)/g, '').trim() === '') { + document = { + kind: graphql_1.Kind.DOCUMENT, + definitions: [], + }; + } + else { + throw e; + } + } + return { + location, + document, + }; +} +function transformCommentsToDescriptions(sourceSdl, options = {}) { + const parsedDoc = (0, graphql_1.parse)(sourceSdl, { + ...options, + noLocation: false, + }); + const modifiedDoc = (0, graphql_1.visit)(parsedDoc, { + leave: (node) => { + if (isDescribable(node)) { + const rawValue = (0, comments_js_1.getLeadingCommentBlock)(node); + if (rawValue !== undefined) { + const commentsBlock = (0, comments_js_1.dedentBlockStringValue)('\n' + rawValue); + const isBlock = commentsBlock.includes('\n'); + if (!node.description) { + return { + ...node, + description: { + kind: graphql_1.Kind.STRING, + value: commentsBlock, + block: isBlock, + }, + }; + } + else { + return { + ...node, + description: { + ...node.description, + value: node.description.value + '\n' + commentsBlock, + block: true, + }, + }; + } + } + } + }, + }); + return modifiedDoc; +} +function isDescribable(node) { + return ((0, graphql_1.isTypeSystemDefinitionNode)(node) || + node.kind === graphql_1.Kind.FIELD_DEFINITION || + node.kind === graphql_1.Kind.INPUT_VALUE_DEFINITION || + node.kind === graphql_1.Kind.ENUM_VALUE_DEFINITION); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/print-schema-with-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/print-schema-with-directives.js new file mode 100644 index 00000000..dde9f98d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/print-schema-with-directives.js @@ -0,0 +1,386 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDocumentNodeFromSchema = getDocumentNodeFromSchema; +exports.printSchemaWithDirectives = printSchemaWithDirectives; +exports.astFromSchema = astFromSchema; +exports.astFromDirective = astFromDirective; +exports.getDirectiveNodes = getDirectiveNodes; +exports.astFromArg = astFromArg; +exports.astFromObjectType = astFromObjectType; +exports.astFromInterfaceType = astFromInterfaceType; +exports.astFromUnionType = astFromUnionType; +exports.astFromInputObjectType = astFromInputObjectType; +exports.astFromEnumType = astFromEnumType; +exports.astFromScalarType = astFromScalarType; +exports.astFromField = astFromField; +exports.astFromInputField = astFromInputField; +exports.astFromEnumValue = astFromEnumValue; +exports.makeDeprecatedDirective = makeDeprecatedDirective; +exports.makeDirectiveNode = makeDirectiveNode; +exports.makeDirectiveNodes = makeDirectiveNodes; +const graphql_1 = require("graphql"); +const astFromType_js_1 = require("./astFromType.js"); +const astFromValue_js_1 = require("./astFromValue.js"); +const astFromValueUntyped_js_1 = require("./astFromValueUntyped.js"); +const defaultValueAstFromType_js_1 = require("./defaultValueAstFromType.js"); +const descriptionFromObject_js_1 = require("./descriptionFromObject.js"); +const get_directives_js_1 = require("./get-directives.js"); +const helpers_js_1 = require("./helpers.js"); +const rootTypes_js_1 = require("./rootTypes.js"); +function getDocumentNodeFromSchema(schema, options = {}) { + const pathToDirectivesInExtensions = options.pathToDirectivesInExtensions; + const typesMap = schema.getTypeMap(); + const schemaNode = astFromSchema(schema, pathToDirectivesInExtensions); + const definitions = schemaNode != null ? [schemaNode] : []; + const directives = schema.getDirectives(); + for (const directive of directives) { + if ((0, graphql_1.isSpecifiedDirective)(directive)) { + continue; + } + definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions)); + } + for (const typeName in typesMap) { + const type = typesMap[typeName]; + const isPredefinedScalar = (0, graphql_1.isSpecifiedScalarType)(type); + const isIntrospection = (0, graphql_1.isIntrospectionType)(type); + if (isPredefinedScalar || isIntrospection) { + continue; + } + if ((0, graphql_1.isObjectType)(type)) { + definitions.push(astFromObjectType(type, schema, pathToDirectivesInExtensions)); + } + else if ((0, graphql_1.isInterfaceType)(type)) { + definitions.push(astFromInterfaceType(type, schema, pathToDirectivesInExtensions)); + } + else if ((0, graphql_1.isUnionType)(type)) { + definitions.push(astFromUnionType(type, schema, pathToDirectivesInExtensions)); + } + else if ((0, graphql_1.isInputObjectType)(type)) { + definitions.push(astFromInputObjectType(type, schema, pathToDirectivesInExtensions)); + } + else if ((0, graphql_1.isEnumType)(type)) { + definitions.push(astFromEnumType(type, schema, pathToDirectivesInExtensions)); + } + else if ((0, graphql_1.isScalarType)(type)) { + definitions.push(astFromScalarType(type, schema, pathToDirectivesInExtensions)); + } + else { + throw new Error(`Unknown type ${type}.`); + } + } + return { + kind: graphql_1.Kind.DOCUMENT, + definitions, + }; +} +// this approach uses the default schema printer rather than a custom solution, so may be more backwards compatible +// currently does not allow customization of printSchema options having to do with comments. +function printSchemaWithDirectives(schema, options = {}) { + const documentNode = getDocumentNodeFromSchema(schema, options); + return (0, graphql_1.print)(documentNode); +} +function astFromSchema(schema, pathToDirectivesInExtensions) { + const operationTypeMap = new Map([ + ['query', undefined], + ['mutation', undefined], + ['subscription', undefined], + ]); + const nodes = []; + if (schema.astNode != null) { + nodes.push(schema.astNode); + } + if (schema.extensionASTNodes != null) { + for (const extensionASTNode of schema.extensionASTNodes) { + nodes.push(extensionASTNode); + } + } + for (const node of nodes) { + if (node.operationTypes) { + for (const operationTypeDefinitionNode of node.operationTypes) { + operationTypeMap.set(operationTypeDefinitionNode.operation, operationTypeDefinitionNode); + } + } + } + const rootTypeMap = (0, rootTypes_js_1.getRootTypeMap)(schema); + for (const [operationTypeNode, operationTypeDefinitionNode] of operationTypeMap) { + const rootType = rootTypeMap.get(operationTypeNode); + if (rootType != null) { + const rootTypeAST = (0, astFromType_js_1.astFromType)(rootType); + if (operationTypeDefinitionNode != null) { + operationTypeDefinitionNode.type = rootTypeAST; + } + else { + operationTypeMap.set(operationTypeNode, { + kind: graphql_1.Kind.OPERATION_TYPE_DEFINITION, + operation: operationTypeNode, + type: rootTypeAST, + }); + } + } + else { + // Drop operation types that no longer exist on the schema (e.g. after pruneSchema). + operationTypeMap.set(operationTypeNode, undefined); + } + } + const operationTypes = [...operationTypeMap.values()].filter(helpers_js_1.isSome); + const directives = getDirectiveNodes(schema, schema, pathToDirectivesInExtensions); + if (!operationTypes.length && !directives.length) { + return null; + } + const schemaNode = { + kind: operationTypes.length ? graphql_1.Kind.SCHEMA_DEFINITION : graphql_1.Kind.SCHEMA_EXTENSION, + operationTypes, + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: directives, + }; + const descriptionNode = (0, descriptionFromObject_js_1.getDescriptionNode)(schema); + if (descriptionNode) { + schemaNode.description = descriptionNode; + } + return schemaNode; +} +function astFromDirective(directive, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.DIRECTIVE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(directive), + name: { + kind: graphql_1.Kind.NAME, + value: directive.name, + }, + arguments: directive.args?.map(arg => astFromArg(arg, schema, pathToDirectivesInExtensions)), + repeatable: directive.isRepeatable, + locations: directive.locations?.map(location => ({ + kind: graphql_1.Kind.NAME, + value: location, + })) || [], + }; +} +function getDirectiveNodes(entity, schema, pathToDirectivesInExtensions) { + let directiveNodesBesidesNativeDirectives = []; + const directivesInExtensions = (0, get_directives_js_1.getDirectivesInExtensions)(entity, pathToDirectivesInExtensions); + let directives; + if (directivesInExtensions != null) { + directives = makeDirectiveNodes(schema, directivesInExtensions); + } + let deprecatedDirectiveNode = null; + let specifiedByDirectiveNode = null; + let oneOfDirectiveNode = null; + if (directives != null) { + directiveNodesBesidesNativeDirectives = directives.filter(directive => graphql_1.specifiedDirectives.every(specifiedDirective => specifiedDirective.name !== directive.name.value)); + deprecatedDirectiveNode = directives.find(directive => directive.name.value === 'deprecated'); + specifiedByDirectiveNode = directives.find(directive => directive.name.value === 'specifiedBy'); + oneOfDirectiveNode = directives.find(directive => directive.name.value === 'oneOf'); + } + if (entity.deprecationReason != null && deprecatedDirectiveNode == null) { + deprecatedDirectiveNode = makeDeprecatedDirective(entity.deprecationReason); + } + if (entity.specifiedByUrl != null || + (entity.specifiedByURL != null && specifiedByDirectiveNode == null)) { + const specifiedByValue = entity.specifiedByUrl || entity.specifiedByURL; + const specifiedByArgs = { + url: specifiedByValue, + }; + specifiedByDirectiveNode = makeDirectiveNode('specifiedBy', specifiedByArgs); + } + if (entity.isOneOf && oneOfDirectiveNode == null) { + oneOfDirectiveNode = makeDirectiveNode('oneOf'); + } + if (deprecatedDirectiveNode != null) { + directiveNodesBesidesNativeDirectives.push(deprecatedDirectiveNode); + } + if (specifiedByDirectiveNode != null) { + directiveNodesBesidesNativeDirectives.push(specifiedByDirectiveNode); + } + if (oneOfDirectiveNode != null) { + directiveNodesBesidesNativeDirectives.push(oneOfDirectiveNode); + } + return directiveNodesBesidesNativeDirectives; +} +function astFromArg(arg, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.INPUT_VALUE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(arg), + name: { + kind: graphql_1.Kind.NAME, + value: arg.name, + }, + type: (0, astFromType_js_1.astFromType)(arg.type), + defaultValue: (0, defaultValueAstFromType_js_1.defaultValueAstFromType)(arg), + directives: getDirectiveNodes(arg, schema, pathToDirectivesInExtensions), + }; +} +function astFromObjectType(type, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.OBJECT_TYPE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(type), + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + fields: Object.values(type.getFields()).map(field => astFromField(field, schema, pathToDirectivesInExtensions)), + interfaces: Object.values(type.getInterfaces()).map(iFace => (0, astFromType_js_1.astFromType)(iFace)), + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; +} +function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) { + const node = { + kind: graphql_1.Kind.INTERFACE_TYPE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(type), + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + fields: Object.values(type.getFields()).map(field => astFromField(field, schema, pathToDirectivesInExtensions)), + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; + if ('getInterfaces' in type) { + node.interfaces = Object.values(type.getInterfaces()).map(iFace => (0, astFromType_js_1.astFromType)(iFace)); + } + return node; +} +function astFromUnionType(type, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.UNION_TYPE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(type), + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + types: type.getTypes().map(type => (0, astFromType_js_1.astFromType)(type)), + }; +} +function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.INPUT_OBJECT_TYPE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(type), + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + fields: Object.values(type.getFields()).map(field => astFromInputField(field, schema, pathToDirectivesInExtensions)), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; +} +function astFromEnumType(type, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.ENUM_TYPE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(type), + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + values: Object.values(type.getValues()).map(value => astFromEnumValue(value, schema, pathToDirectivesInExtensions)), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; +} +function astFromScalarType(type, schema, pathToDirectivesInExtensions) { + const directivesInExtensions = (0, get_directives_js_1.getDirectivesInExtensions)(type, pathToDirectivesInExtensions); + const directives = makeDirectiveNodes(schema, directivesInExtensions); + const specifiedByValue = (type['specifiedByUrl'] || + type['specifiedByURL']); + if (specifiedByValue && + !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) { + const specifiedByArgs = { + url: specifiedByValue, + }; + directives.push(makeDirectiveNode('specifiedBy', specifiedByArgs)); + } + return { + kind: graphql_1.Kind.SCALAR_TYPE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(type), + name: { + kind: graphql_1.Kind.NAME, + value: type.name, + }, + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: directives, + }; +} +function astFromField(field, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.FIELD_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(field), + name: { + kind: graphql_1.Kind.NAME, + value: field.name, + }, + arguments: field.args.map(arg => astFromArg(arg, schema, pathToDirectivesInExtensions)), + type: (0, astFromType_js_1.astFromType)(field.type), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(field, schema, pathToDirectivesInExtensions), + }; +} +function astFromInputField(field, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.INPUT_VALUE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(field), + name: { + kind: graphql_1.Kind.NAME, + value: field.name, + }, + type: (0, astFromType_js_1.astFromType)(field.type), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(field, schema, pathToDirectivesInExtensions), + defaultValue: (0, defaultValueAstFromType_js_1.defaultValueAstFromType)(field), + }; +} +function astFromEnumValue(value, schema, pathToDirectivesInExtensions) { + return { + kind: graphql_1.Kind.ENUM_VALUE_DEFINITION, + description: (0, descriptionFromObject_js_1.getDescriptionNode)(value), + name: { + kind: graphql_1.Kind.NAME, + value: value.name, + }, + directives: getDirectiveNodes(value, schema, pathToDirectivesInExtensions), + }; +} +function makeDeprecatedDirective(deprecationReason) { + return makeDirectiveNode('deprecated', { reason: deprecationReason }, graphql_1.GraphQLDeprecatedDirective); +} +function makeDirectiveNode(name, args, directive) { + const directiveArguments = []; + for (const argName in args) { + const argValue = args[argName]; + let value; + if (directive != null) { + const arg = directive.args.find(arg => arg.name === argName); + if (arg) { + value = (0, astFromValue_js_1.astFromValue)(argValue, arg.type); + } + } + if (value == null) { + value = (0, astFromValueUntyped_js_1.astFromValueUntyped)(argValue); + } + if (value != null) { + directiveArguments.push({ + kind: graphql_1.Kind.ARGUMENT, + name: { + kind: graphql_1.Kind.NAME, + value: argName, + }, + value, + }); + } + } + return { + kind: graphql_1.Kind.DIRECTIVE, + name: { + kind: graphql_1.Kind.NAME, + value: name, + }, + arguments: directiveArguments, + }; +} +function makeDirectiveNodes(schema, directiveValues) { + const directiveNodes = []; + for (const { name, args } of directiveValues) { + const directive = schema?.getDirective(name); + directiveNodes.push(makeDirectiveNode(name, args, directive)); + } + return directiveNodes; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/prune.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/prune.js new file mode 100644 index 00000000..c8eeadb6 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/prune.js @@ -0,0 +1,170 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pruneSchema = pruneSchema; +const graphql_1 = require("graphql"); +const get_implementing_types_js_1 = require("./get-implementing-types.js"); +const Interfaces_js_1 = require("./Interfaces.js"); +const mapSchema_js_1 = require("./mapSchema.js"); +const rootTypes_js_1 = require("./rootTypes.js"); +/** + * Prunes the provided schema, removing unused and empty types + * @param schema The schema to prune + * @param options Additional options for removing unused types from the schema + */ +function pruneSchema(schema, options = {}) { + const { skipEmptyCompositeTypePruning, skipEmptyUnionPruning, skipPruning, skipUnimplementedInterfacesPruning, skipUnusedTypesPruning, } = options; + let prunedTypes = []; // Pruned types during mapping + let prunedSchema = schema; + do { + let visited = visitSchema(prunedSchema); + // Custom pruning was defined, so we need to pre-emptively revisit the schema accounting for this + if (skipPruning) { + const revisit = []; + for (const typeName in prunedSchema.getTypeMap()) { + if (typeName.startsWith('__')) { + continue; + } + const type = prunedSchema.getType(typeName); + // if we want to skip pruning for this type, add it to the list of types to revisit + if (type && skipPruning(type)) { + revisit.push(typeName); + } + } + visited = visitQueue(revisit, prunedSchema, visited); // visit again + } + prunedTypes = []; + prunedSchema = (0, mapSchema_js_1.mapSchema)(prunedSchema, { + [Interfaces_js_1.MapperKind.TYPE]: type => { + if (!visited.has(type.name) && !(0, graphql_1.isSpecifiedScalarType)(type)) { + if ((0, graphql_1.isUnionType)(type) || + (0, graphql_1.isInputObjectType)(type) || + (0, graphql_1.isInterfaceType)(type) || + (0, graphql_1.isObjectType)(type) || + (0, graphql_1.isScalarType)(type)) { + // skipUnusedTypesPruning: skip pruning unused types + if (skipUnusedTypesPruning) { + return type; + } + // skipEmptyUnionPruning: skip pruning empty unions + if ((0, graphql_1.isUnionType)(type) && + skipEmptyUnionPruning && + !Object.keys(type.getTypes()).length) { + return type; + } + if ((0, graphql_1.isInputObjectType)(type) || (0, graphql_1.isInterfaceType)(type) || (0, graphql_1.isObjectType)(type)) { + // skipEmptyCompositeTypePruning: skip pruning object types or interfaces with no fields + if (skipEmptyCompositeTypePruning && !Object.keys(type.getFields()).length) { + return type; + } + } + // skipUnimplementedInterfacesPruning: skip pruning interfaces that are not implemented by any other types + if ((0, graphql_1.isInterfaceType)(type) && skipUnimplementedInterfacesPruning) { + return type; + } + } + prunedTypes.push(type.name); + visited.delete(type.name); + return null; + } + return type; + }, + }); + } while (prunedTypes.length); // Might have empty types and need to prune again + return prunedSchema; +} +function visitSchema(schema) { + const queue = []; // queue of nodes to visit + // Grab the root types and start there + for (const type of (0, rootTypes_js_1.getRootTypes)(schema)) { + queue.push(type.name); + } + return visitQueue(queue, schema); +} +function visitQueue(queue, schema, visited = new Set()) { + // Interfaces encountered that are field return types need to be revisited to add their implementations + const revisit = new Map(); + // Navigate all types starting with pre-queued types (root types) + while (queue.length) { + const typeName = queue.pop(); + // Skip types we already visited unless it is an interface type that needs revisiting + if (visited.has(typeName) && revisit[typeName] !== true) { + continue; + } + const type = schema.getType(typeName); + if (type) { + // Get types for union + if ((0, graphql_1.isUnionType)(type)) { + queue.push(...type.getTypes().map(type => type.name)); + } + // If it is an interface and it is a returned type, grab all implementations so we can use proper __typename in fragments + if ((0, graphql_1.isInterfaceType)(type) && revisit[typeName] === true) { + queue.push(...(0, get_implementing_types_js_1.getImplementingTypes)(type.name, schema)); + // No need to revisit this interface again + revisit[typeName] = false; + } + if ((0, graphql_1.isEnumType)(type)) { + // Visit enum values directives argument types + queue.push(...type.getValues().flatMap(value => getDirectivesArgumentsTypeNames(schema, value))); + } + // Visit interfaces this type is implementing if they haven't been visited yet + if ('getInterfaces' in type) { + // Only pushes to queue to visit but not return types + queue.push(...type.getInterfaces().map(iface => iface.name)); + } + // If the type has fields visit those field types + if ('getFields' in type) { + const fields = type.getFields(); + const entries = Object.entries(fields); + if (!entries.length) { + continue; + } + for (const [, field] of entries) { + if ((0, graphql_1.isObjectType)(type)) { + // Visit arg types and arg directives arguments types + queue.push(...field.args.flatMap(arg => { + const typeNames = [(0, graphql_1.getNamedType)(arg.type).name]; + typeNames.push(...getDirectivesArgumentsTypeNames(schema, arg)); + return typeNames; + })); + } + const namedType = (0, graphql_1.getNamedType)(field.type); + queue.push(namedType.name); + queue.push(...getDirectivesArgumentsTypeNames(schema, field)); + // Interfaces returned on fields need to be revisited to add their implementations + if ((0, graphql_1.isInterfaceType)(namedType) && !(namedType.name in revisit)) { + revisit[namedType.name] = true; + } + } + } + queue.push(...getDirectivesArgumentsTypeNames(schema, type)); + visited.add(typeName); // Mark as visited (and therefore it is used and should be kept) + } + } + return visited; +} +function getDirectivesArgumentsTypeNames(schema, directableObj) { + const argTypeNames = new Set(); + if (directableObj.astNode?.directives) { + for (const directiveNode of directableObj.astNode.directives) { + const directive = schema.getDirective(directiveNode.name.value); + if (directive?.args) { + for (const arg of directive.args) { + const argType = (0, graphql_1.getNamedType)(arg.type); + argTypeNames.add(argType.name); + } + } + } + } + if (directableObj.extensions?.['directives']) { + for (const directiveName in directableObj.extensions['directives']) { + const directive = schema.getDirective(directiveName); + if (directive?.args) { + for (const arg of directive.args) { + const argType = (0, graphql_1.getNamedType)(arg.type); + argTypeNames.add(argType.name); + } + } + } + } + return [...argTypeNames]; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/registerAbortSignalListener.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/registerAbortSignalListener.js new file mode 100644 index 00000000..879563d3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/registerAbortSignalListener.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getAbortPromise = void 0; +exports.registerAbortSignalListener = registerAbortSignalListener; +const promise_helpers_1 = require("@whatwg-node/promise-helpers"); +const memoize_js_1 = require("./memoize.js"); +// AbortSignal handler cache to avoid the "possible EventEmitter memory leak detected" +// on Node.js +const getListenersOfAbortSignal = (0, memoize_js_1.memoize1)(function getListenersOfAbortSignal(signal) { + const listeners = new Set(); + signal.addEventListener('abort', e => { + for (const listener of listeners) { + listener(e); + } + }, { once: true }); + return listeners; +}); +/** + * Register an AbortSignal handler for a signal. + * This helper function mainly exists to work around the + * "possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit." + * warning occuring on Node.js + */ +function registerAbortSignalListener(signal, listener) { + // If the signal is already aborted, call the listener immediately + if (signal.aborted) { + listener(); + return; + } + getListenersOfAbortSignal(signal).add(listener); +} +exports.getAbortPromise = (0, memoize_js_1.memoize1)(function getAbortPromise(signal) { + // If the signal is already aborted, return a rejected promise + if (signal.aborted) { + return (0, promise_helpers_1.fakeRejectPromise)(signal.reason); + } + return new Promise((_resolve, reject) => { + if (signal.aborted) { + reject(signal.reason); + return; + } + registerAbortSignalListener(signal, () => { + reject(signal.reason); + }); + }); +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/renameType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/renameType.js new file mode 100644 index 00000000..3377f40a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/renameType.js @@ -0,0 +1,151 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.renameType = renameType; +const graphql_1 = require("graphql"); +function renameType(type, newTypeName) { + if ((0, graphql_1.isObjectType)(type)) { + return new graphql_1.GraphQLObjectType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if ((0, graphql_1.isInterfaceType)(type)) { + return new graphql_1.GraphQLInterfaceType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if ((0, graphql_1.isUnionType)(type)) { + return new graphql_1.GraphQLUnionType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if ((0, graphql_1.isInputObjectType)(type)) { + return new graphql_1.GraphQLInputObjectType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if ((0, graphql_1.isEnumType)(type)) { + return new graphql_1.GraphQLEnumType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if ((0, graphql_1.isScalarType)(type)) { + return new graphql_1.GraphQLScalarType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + throw new Error(`Unknown type ${type}.`); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rewire.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rewire.js new file mode 100644 index 00000000..dbf5a8f4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rewire.js @@ -0,0 +1,159 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.rewireTypes = rewireTypes; +const graphql_1 = require("graphql"); +const stub_js_1 = require("./stub.js"); +function rewireTypes(originalTypeMap, directives) { + const referenceTypeMap = Object.create(null); + for (const typeName in originalTypeMap) { + referenceTypeMap[typeName] = originalTypeMap[typeName]; + } + const newTypeMap = Object.create(null); + for (const typeName in referenceTypeMap) { + const namedType = referenceTypeMap[typeName]; + if (namedType == null || typeName.startsWith('__')) { + continue; + } + const newName = namedType.name; + if (newName.startsWith('__')) { + continue; + } + if (newTypeMap[newName] != null) { + console.warn(`Duplicate schema type name ${newName} found; keeping the existing one found in the schema`); + continue; + } + newTypeMap[newName] = namedType; + } + for (const typeName in newTypeMap) { + newTypeMap[typeName] = rewireNamedType(newTypeMap[typeName]); + } + const newDirectives = directives.map(directive => rewireDirective(directive)); + return { + typeMap: newTypeMap, + directives: newDirectives, + }; + function rewireDirective(directive) { + if ((0, graphql_1.isSpecifiedDirective)(directive)) { + return directive; + } + const directiveConfig = directive.toConfig(); + directiveConfig.args = rewireArgs(directiveConfig.args); + return new graphql_1.GraphQLDirective(directiveConfig); + } + function rewireArgs(args) { + const rewiredArgs = {}; + for (const argName in args) { + const arg = args[argName]; + const rewiredArgType = rewireType(arg.type); + if (rewiredArgType != null) { + arg.type = rewiredArgType; + rewiredArgs[argName] = arg; + } + } + return rewiredArgs; + } + function rewireNamedType(type) { + if ((0, graphql_1.isObjectType)(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + fields: () => rewireFields(config.fields), + interfaces: () => rewireNamedTypes(config.interfaces), + }; + return new graphql_1.GraphQLObjectType(newConfig); + } + else if ((0, graphql_1.isInterfaceType)(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + fields: () => rewireFields(config.fields), + }; + if ('interfaces' in newConfig) { + newConfig.interfaces = () => rewireNamedTypes(config.interfaces); + } + return new graphql_1.GraphQLInterfaceType(newConfig); + } + else if ((0, graphql_1.isUnionType)(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + types: () => rewireNamedTypes(config.types), + }; + return new graphql_1.GraphQLUnionType(newConfig); + } + else if ((0, graphql_1.isInputObjectType)(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + fields: () => rewireInputFields(config.fields), + }; + return new graphql_1.GraphQLInputObjectType(newConfig); + } + else if ((0, graphql_1.isEnumType)(type)) { + const enumConfig = type.toConfig(); + return new graphql_1.GraphQLEnumType(enumConfig); + } + else if ((0, graphql_1.isScalarType)(type)) { + if ((0, graphql_1.isSpecifiedScalarType)(type)) { + return type; + } + const scalarConfig = type.toConfig(); + return new graphql_1.GraphQLScalarType(scalarConfig); + } + throw new Error(`Unexpected schema type: ${type}`); + } + function rewireFields(fields) { + const rewiredFields = {}; + for (const fieldName in fields) { + const field = fields[fieldName]; + const rewiredFieldType = rewireType(field.type); + if (rewiredFieldType != null && field.args) { + field.type = rewiredFieldType; + field.args = rewireArgs(field.args); + rewiredFields[fieldName] = field; + } + } + return rewiredFields; + } + function rewireInputFields(fields) { + const rewiredFields = {}; + for (const fieldName in fields) { + const field = fields[fieldName]; + const rewiredFieldType = rewireType(field.type); + if (rewiredFieldType != null) { + field.type = rewiredFieldType; + rewiredFields[fieldName] = field; + } + } + return rewiredFields; + } + function rewireNamedTypes(namedTypes) { + const rewiredTypes = []; + for (const namedType of namedTypes) { + const rewiredType = rewireType(namedType); + if (rewiredType != null) { + rewiredTypes.push(rewiredType); + } + } + return rewiredTypes; + } + function rewireType(type) { + if ((0, graphql_1.isListType)(type)) { + const rewiredType = rewireType(type.ofType); + return rewiredType != null ? new graphql_1.GraphQLList(rewiredType) : null; + } + else if ((0, graphql_1.isNonNullType)(type)) { + const rewiredType = rewireType(type.ofType); + return rewiredType != null ? new graphql_1.GraphQLNonNull(rewiredType) : null; + } + else if ((0, graphql_1.isNamedType)(type)) { + let rewiredType = referenceTypeMap[type.name]; + if (rewiredType === undefined) { + rewiredType = (0, stub_js_1.isNamedStub)(type) ? (0, stub_js_1.getBuiltInForStub)(type) : rewireNamedType(type); + newTypeMap[rewiredType.name] = referenceTypeMap[type.name] = rewiredType; + } + return rewiredType != null ? newTypeMap[rewiredType.name] : null; + } + return null; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rootTypes.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rootTypes.js new file mode 100644 index 00000000..1b99e33f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/rootTypes.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRootTypeMap = exports.getRootTypes = exports.getRootTypeNames = void 0; +exports.getDefinedRootType = getDefinedRootType; +const errors_js_1 = require("./errors.js"); +const memoize_js_1 = require("./memoize.js"); +function getDefinedRootType(schema, operation, nodes) { + const rootTypeMap = (0, exports.getRootTypeMap)(schema); + const rootType = rootTypeMap.get(operation); + if (rootType == null) { + throw (0, errors_js_1.createGraphQLError)(`Schema is not configured to execute ${operation} operation.`, { + nodes, + }); + } + return rootType; +} +exports.getRootTypeNames = (0, memoize_js_1.memoize1)(function getRootTypeNames(schema) { + const rootTypes = (0, exports.getRootTypes)(schema); + return new Set([...rootTypes].map(type => type.name)); +}); +exports.getRootTypes = (0, memoize_js_1.memoize1)(function getRootTypes(schema) { + const rootTypeMap = (0, exports.getRootTypeMap)(schema); + return new Set(rootTypeMap.values()); +}); +exports.getRootTypeMap = (0, memoize_js_1.memoize1)(function getRootTypeMap(schema) { + const rootTypeMap = new Map(); + const queryType = schema.getQueryType(); + if (queryType) { + rootTypeMap.set('query', queryType); + } + const mutationType = schema.getMutationType(); + if (mutationType) { + rootTypeMap.set('mutation', mutationType); + } + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + rootTypeMap.set('subscription', subscriptionType); + } + return rootTypeMap; +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/selectionSets.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/selectionSets.js new file mode 100644 index 00000000..9270d5b9 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/selectionSets.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseSelectionSet = parseSelectionSet; +const graphql_1 = require("graphql"); +function parseSelectionSet(selectionSet, options) { + const query = (0, graphql_1.parse)(selectionSet, options).definitions[0]; + return query.selectionSet; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/stub.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/stub.js new file mode 100644 index 00000000..67b99e0b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/stub.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createNamedStub = createNamedStub; +exports.createStub = createStub; +exports.isNamedStub = isNamedStub; +exports.getBuiltInForStub = getBuiltInForStub; +const graphql_1 = require("graphql"); +function createNamedStub(name, type) { + let constructor; + if (type === 'object') { + constructor = graphql_1.GraphQLObjectType; + } + else if (type === 'interface') { + constructor = graphql_1.GraphQLInterfaceType; + } + else { + constructor = graphql_1.GraphQLInputObjectType; + } + return new constructor({ + name, + fields: { + _fake: { + type: graphql_1.GraphQLString, + }, + }, + }); +} +function createStub(node, type) { + switch (node.kind) { + case graphql_1.Kind.LIST_TYPE: + return new graphql_1.GraphQLList(createStub(node.type, type)); + case graphql_1.Kind.NON_NULL_TYPE: + // FIXME: graphql@17 type issue + return new graphql_1.GraphQLNonNull(createStub(node.type, type)); + default: + if (type === 'output') { + return createNamedStub(node.name.value, 'object'); + } + return createNamedStub(node.name.value, 'input'); + } +} +function isNamedStub(type) { + if ('getFields' in type) { + const fields = type.getFields(); + // eslint-disable-next-line no-unreachable-loop + for (const fieldName in fields) { + const field = fields[fieldName]; + return field.name === '_fake'; + } + } + return false; +} +function getBuiltInForStub(type) { + switch (type.name) { + case graphql_1.GraphQLInt.name: + return graphql_1.GraphQLInt; + case graphql_1.GraphQLFloat.name: + return graphql_1.GraphQLFloat; + case graphql_1.GraphQLString.name: + return graphql_1.GraphQLString; + case graphql_1.GraphQLBoolean.name: + return graphql_1.GraphQLBoolean; + case graphql_1.GraphQLID.name: + return graphql_1.GraphQLID; + default: + return type; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/transformInputValue.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/transformInputValue.js new file mode 100644 index 00000000..b7c412dc --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/transformInputValue.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.transformInputValue = transformInputValue; +exports.serializeInputValue = serializeInputValue; +exports.parseInputValue = parseInputValue; +exports.parseInputValueLiteral = parseInputValueLiteral; +const graphql_1 = require("graphql"); +const helpers_js_1 = require("./helpers.js"); +function transformInputValue(type, value, inputLeafValueTransformer = null, inputObjectValueTransformer = null) { + if (value == null) { + return value; + } + const nullableType = (0, graphql_1.getNullableType)(type); + if ((0, graphql_1.isLeafType)(nullableType)) { + return inputLeafValueTransformer != null + ? inputLeafValueTransformer(nullableType, value) + : value; + } + else if ((0, graphql_1.isListType)(nullableType)) { + return (0, helpers_js_1.asArray)(value).map((listMember) => transformInputValue(nullableType.ofType, listMember, inputLeafValueTransformer, inputObjectValueTransformer)); + } + else if ((0, graphql_1.isInputObjectType)(nullableType)) { + const fields = nullableType.getFields(); + const newValue = {}; + for (const key in value) { + const field = fields[key]; + if (field != null) { + newValue[key] = transformInputValue(field.type, value[key], inputLeafValueTransformer, inputObjectValueTransformer); + } + } + return inputObjectValueTransformer != null + ? inputObjectValueTransformer(nullableType, newValue) + : newValue; + } + // unreachable, no other possible return value +} +function serializeInputValue(type, value) { + return transformInputValue(type, value, (t, v) => { + try { + return t.serialize(v); + } + catch { + return v; + } + }); +} +function parseInputValue(type, value) { + return transformInputValue(type, value, (t, v) => { + try { + return t.parseValue(v); + } + catch { + return v; + } + }); +} +function parseInputValueLiteral(type, value) { + return transformInputValue(type, value, (t, v) => t.parseLiteral(v, {})); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/types.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/types.js new file mode 100644 index 00000000..efdc449f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/types.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DirectiveLocation = void 0; +var DirectiveLocation; +(function (DirectiveLocation) { + /** Request Definitions */ + DirectiveLocation["QUERY"] = "QUERY"; + DirectiveLocation["MUTATION"] = "MUTATION"; + DirectiveLocation["SUBSCRIPTION"] = "SUBSCRIPTION"; + DirectiveLocation["FIELD"] = "FIELD"; + DirectiveLocation["FRAGMENT_DEFINITION"] = "FRAGMENT_DEFINITION"; + DirectiveLocation["FRAGMENT_SPREAD"] = "FRAGMENT_SPREAD"; + DirectiveLocation["INLINE_FRAGMENT"] = "INLINE_FRAGMENT"; + DirectiveLocation["VARIABLE_DEFINITION"] = "VARIABLE_DEFINITION"; + /** Type System Definitions */ + DirectiveLocation["SCHEMA"] = "SCHEMA"; + DirectiveLocation["SCALAR"] = "SCALAR"; + DirectiveLocation["OBJECT"] = "OBJECT"; + DirectiveLocation["FIELD_DEFINITION"] = "FIELD_DEFINITION"; + DirectiveLocation["ARGUMENT_DEFINITION"] = "ARGUMENT_DEFINITION"; + DirectiveLocation["INTERFACE"] = "INTERFACE"; + DirectiveLocation["UNION"] = "UNION"; + DirectiveLocation["ENUM"] = "ENUM"; + DirectiveLocation["ENUM_VALUE"] = "ENUM_VALUE"; + DirectiveLocation["INPUT_OBJECT"] = "INPUT_OBJECT"; + DirectiveLocation["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION"; +})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {})); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/updateArgument.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/updateArgument.js new file mode 100644 index 00000000..f3561a29 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/updateArgument.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateArgument = updateArgument; +exports.createVariableNameGenerator = createVariableNameGenerator; +const graphql_1 = require("graphql"); +const astFromType_js_1 = require("./astFromType.js"); +function updateArgument(argumentNodes, variableDefinitionsMap, variableValues, argName, varName, type, value) { + argumentNodes[argName] = { + kind: graphql_1.Kind.ARGUMENT, + name: { + kind: graphql_1.Kind.NAME, + value: argName, + }, + value: { + kind: graphql_1.Kind.VARIABLE, + name: { + kind: graphql_1.Kind.NAME, + value: varName, + }, + }, + }; + variableDefinitionsMap[varName] = { + kind: graphql_1.Kind.VARIABLE_DEFINITION, + variable: { + kind: graphql_1.Kind.VARIABLE, + name: { + kind: graphql_1.Kind.NAME, + value: varName, + }, + }, + type: (0, astFromType_js_1.astFromType)(type), + }; + if (value !== undefined) { + variableValues[varName] = value; + return; + } + // including the variable in the map with value of `undefined` + // will actually be translated by graphql-js into `null` + // see https://github.com/graphql/graphql-js/issues/2533 + if (varName in variableValues) { + delete variableValues[varName]; + } +} +function createVariableNameGenerator(variableDefinitionMap) { + let varCounter = 0; + return (argName) => { + let varName; + do { + varName = varCounter === 0 ? argName : `_v${varCounter.toString()}_${argName}`; + varCounter++; + } while (varName in variableDefinitionMap); + return varName; + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/validate-documents.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/validate-documents.js new file mode 100644 index 00000000..6004e651 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/validate-documents.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateGraphQlDocuments = validateGraphQlDocuments; +exports.createDefaultRules = createDefaultRules; +const graphql_1 = require("graphql"); +function validateGraphQlDocuments(schema, documents, rules = createDefaultRules()) { + const definitions = new Set(); + const fragmentsDefinitionsMap = new Map(); + for (const document of documents) { + for (const docDefinition of document.definitions) { + if (docDefinition.kind === graphql_1.Kind.FRAGMENT_DEFINITION) { + fragmentsDefinitionsMap.set(docDefinition.name.value, docDefinition); + } + else { + definitions.add(docDefinition); + } + } + } + const fullAST = { + kind: graphql_1.Kind.DOCUMENT, + definitions: Array.from([...definitions, ...fragmentsDefinitionsMap.values()]), + }; + const errors = (0, graphql_1.validate)(schema, fullAST, rules); + for (const error of errors) { + error.stack = error.message; + if (error.locations) { + for (const location of error.locations) { + error.stack += `\n at ${error.source?.name}:${location.line}:${location.column}`; + } + } + } + return errors; +} +function createDefaultRules() { + let ignored = ['NoUnusedFragmentsRule', 'NoUnusedVariablesRule', 'KnownDirectivesRule']; + if (graphql_1.versionInfo.major < 15) { + ignored = ignored.map(rule => rule.replace(/Rule$/, '')); + } + return graphql_1.specifiedRules.filter((f) => !ignored.includes(f.name)); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/valueMatchesCriteria.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/valueMatchesCriteria.js new file mode 100644 index 00000000..64dcf95d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/valueMatchesCriteria.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.valueMatchesCriteria = valueMatchesCriteria; +function valueMatchesCriteria(value, criteria) { + if (value == null) { + return value === criteria; + } + else if (Array.isArray(value)) { + return (Array.isArray(criteria) && + value.every((val, index) => valueMatchesCriteria(val, criteria[index]))); + } + else if (typeof value === 'object') { + return (typeof criteria === 'object' && + criteria && + Object.keys(criteria).every(propertyName => valueMatchesCriteria(value[propertyName], criteria[propertyName]))); + } + else if (criteria instanceof RegExp) { + return criteria.test(value); + } + return value === criteria; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/visitResult.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/visitResult.js new file mode 100644 index 00000000..9ae52d96 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/visitResult.js @@ -0,0 +1,263 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.visitData = visitData; +exports.visitErrors = visitErrors; +exports.visitResult = visitResult; +const graphql_1 = require("graphql"); +const collectFields_js_1 = require("./collectFields.js"); +const getOperationASTFromRequest_js_1 = require("./getOperationASTFromRequest.js"); +function visitData(data, enter, leave) { + if (Array.isArray(data)) { + return data.map(value => visitData(value, enter, leave)); + } + else if (typeof data === 'object') { + const newData = enter != null ? enter(data) : data; + if (newData != null) { + for (const key in newData) { + const value = newData[key]; + Object.defineProperty(newData, key, { + value: visitData(value, enter, leave), + }); + } + } + return leave != null ? leave(newData) : newData; + } + return data; +} +function visitErrors(errors, visitor) { + return errors.map(error => visitor(error)); +} +function visitResult(result, request, schema, resultVisitorMap, errorVisitorMap) { + const fragments = request.document.definitions.reduce((acc, def) => { + if (def.kind === graphql_1.Kind.FRAGMENT_DEFINITION) { + acc[def.name.value] = def; + } + return acc; + }, {}); + const variableValues = normalizeVariableValues(request.variables); + const errorInfo = { + segmentInfoMap: new Map(), + unpathedErrors: new Set(), + }; + const data = result.data; + const errors = result.errors; + const visitingErrors = errors != null && errorVisitorMap != null; + const operationDocumentNode = (0, getOperationASTFromRequest_js_1.getOperationASTFromRequest)(request); + if (data != null && operationDocumentNode != null) { + result.data = visitRoot(data, operationDocumentNode, schema, fragments, variableValues, resultVisitorMap, visitingErrors ? errors : undefined, errorInfo); + } + if (errors != null && errorVisitorMap) { + result.errors = visitErrorsByType(errors, errorVisitorMap, errorInfo); + } + return result; +} +function normalizeVariableValues(variables) { + return { + coerced: variables ?? {}, + sources: {}, + }; +} +function visitErrorsByType(errors, errorVisitorMap, errorInfo) { + const segmentInfoMap = errorInfo.segmentInfoMap; + const unpathedErrors = errorInfo.unpathedErrors; + const unpathedErrorVisitor = errorVisitorMap['__unpathed']; + return errors.map(originalError => { + const pathSegmentsInfo = segmentInfoMap.get(originalError); + const newError = pathSegmentsInfo == null + ? originalError + : pathSegmentsInfo.reduceRight((acc, segmentInfo) => { + const typeName = segmentInfo.type.name; + const typeVisitorMap = errorVisitorMap[typeName]; + if (typeVisitorMap == null) { + return acc; + } + const errorVisitor = typeVisitorMap[segmentInfo.fieldName]; + return errorVisitor == null ? acc : errorVisitor(acc, segmentInfo.pathIndex); + }, originalError); + if (unpathedErrorVisitor && unpathedErrors.has(originalError)) { + return unpathedErrorVisitor(newError); + } + return newError; + }); +} +function getOperationRootType(schema, operationDef) { + switch (operationDef.operation) { + case 'query': + return schema.getQueryType(); + case 'mutation': + return schema.getMutationType(); + case 'subscription': + return schema.getSubscriptionType(); + } +} +function visitRoot(root, operation, schema, fragments, variableValues, resultVisitorMap, errors, errorInfo) { + const operationRootType = getOperationRootType(schema, operation); + const { fields: collectedFields } = (0, collectFields_js_1.collectFields)(schema, fragments, variableValues, operationRootType, operation.selectionSet); + return visitObjectValue(root, operationRootType, collectedFields, schema, fragments, variableValues, resultVisitorMap, 0, errors, errorInfo); +} +function visitObjectValue(object, type, fieldNodeMap, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo) { + const fieldMap = type.getFields(); + const typeVisitorMap = resultVisitorMap?.[type.name]; + const enterObject = typeVisitorMap?.__enter; + const newObject = enterObject != null ? enterObject(object) : object; + let sortedErrors; + let errorMap = null; + if (errors != null) { + sortedErrors = sortErrorsByPathSegment(errors, pathIndex); + errorMap = sortedErrors.errorMap; + for (const error of sortedErrors.unpathedErrors) { + errorInfo.unpathedErrors.add(error); + } + } + for (const [responseKey, subFieldNodes] of fieldNodeMap) { + const fieldName = subFieldNodes[0].name.value; + let fieldType = fieldMap[fieldName]?.type; + if (fieldType == null) { + switch (fieldName) { + case '__typename': + fieldType = graphql_1.TypeNameMetaFieldDef.type; + break; + case '__schema': + fieldType = graphql_1.SchemaMetaFieldDef.type; + break; + case '__type': + fieldType = graphql_1.TypeMetaFieldDef.type; + break; + } + } + const newPathIndex = pathIndex + 1; + let fieldErrors; + if (errorMap) { + fieldErrors = errorMap[responseKey]; + if (fieldErrors != null) { + delete errorMap[responseKey]; + } + addPathSegmentInfo(type, fieldName, newPathIndex, fieldErrors, errorInfo); + } + const newValue = visitFieldValue(object[responseKey], fieldType, subFieldNodes, schema, fragments, variableValues, resultVisitorMap, newPathIndex, fieldErrors, errorInfo); + updateObject(newObject, responseKey, newValue, typeVisitorMap, fieldName); + } + const oldTypename = newObject.__typename; + if (oldTypename != null) { + updateObject(newObject, '__typename', oldTypename, typeVisitorMap, '__typename'); + } + if (errorMap) { + for (const errorsKey in errorMap) { + const errors = errorMap[errorsKey]; + for (const error of errors) { + errorInfo.unpathedErrors.add(error); + } + } + } + const leaveObject = typeVisitorMap?.__leave; + return leaveObject != null ? leaveObject(newObject) : newObject; +} +function updateObject(object, responseKey, newValue, typeVisitorMap, fieldName) { + if (typeVisitorMap == null) { + object[responseKey] = newValue; + return; + } + const fieldVisitor = typeVisitorMap[fieldName]; + if (fieldVisitor == null) { + object[responseKey] = newValue; + return; + } + const visitedValue = fieldVisitor(newValue); + if (visitedValue === undefined) { + delete object[responseKey]; + return; + } + object[responseKey] = visitedValue; +} +function visitListValue(list, returnType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo) { + return list.map(listMember => visitFieldValue(listMember, returnType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex + 1, errors, errorInfo)); +} +function visitFieldValue(value, returnType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors = [], errorInfo) { + if (value == null) { + return value; + } + const nullableType = (0, graphql_1.getNullableType)(returnType); + if ((0, graphql_1.isListType)(nullableType)) { + return visitListValue(value, nullableType.ofType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo); + } + else if ((0, graphql_1.isAbstractType)(nullableType)) { + const finalType = schema.getType(value.__typename); + let { fields: collectedFields, patches } = (0, collectFields_js_1.collectSubFields)(schema, fragments, variableValues, finalType, fieldNodes); + if (patches.length) { + collectedFields = new Map(collectedFields); + for (const patch of patches) { + for (const [responseKey, fields] of patch.fields) { + const existingFields = collectedFields.get(responseKey); + if (existingFields) { + existingFields.push(...fields); + } + else { + collectedFields.set(responseKey, fields); + } + } + } + } + return visitObjectValue(value, finalType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo); + } + else if ((0, graphql_1.isObjectType)(nullableType)) { + let { fields: collectedFields, patches } = (0, collectFields_js_1.collectSubFields)(schema, fragments, variableValues, nullableType, fieldNodes); + if (patches.length) { + collectedFields = new Map(collectedFields); + for (const patch of patches) { + for (const [responseKey, fields] of patch.fields) { + const existingFields = collectedFields.get(responseKey); + if (existingFields) { + existingFields.push(...fields); + } + else { + collectedFields.set(responseKey, fields); + } + } + } + } + return visitObjectValue(value, nullableType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo); + } + const typeVisitorMap = resultVisitorMap?.[nullableType.name]; + if (typeVisitorMap == null) { + return value; + } + const visitedValue = typeVisitorMap(value); + return visitedValue === undefined ? value : visitedValue; +} +function sortErrorsByPathSegment(errors, pathIndex) { + const errorMap = Object.create(null); + const unpathedErrors = new Set(); + for (const error of errors) { + const pathSegment = error.path?.[pathIndex]; + if (pathSegment == null) { + unpathedErrors.add(error); + continue; + } + if (pathSegment in errorMap) { + errorMap[pathSegment].push(error); + } + else { + errorMap[pathSegment] = [error]; + } + } + return { + errorMap, + unpathedErrors, + }; +} +function addPathSegmentInfo(type, fieldName, pathIndex, errors = [], errorInfo) { + for (const error of errors) { + const segmentInfo = { + type, + fieldName, + pathIndex, + }; + const pathSegmentsInfo = errorInfo.segmentInfoMap.get(error); + if (pathSegmentsInfo == null) { + errorInfo.segmentInfoMap.set(error, [segmentInfo]); + } + else { + pathSegmentsInfo.push(segmentInfo); + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/withCancel.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/withCancel.js new file mode 100644 index 00000000..a41b986c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/cjs/withCancel.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getAsyncIteratorWithCancel = getAsyncIteratorWithCancel; +exports.getAsyncIterableWithCancel = getAsyncIterableWithCancel; +exports.withCancel = getAsyncIterableWithCancel; +const memoize_js_1 = require("./memoize.js"); +async function defaultAsyncIteratorReturn(value) { + return { value, done: true }; +} +const proxyMethodFactory = (0, memoize_js_1.memoize2)(function proxyMethodFactory(target, targetMethod) { + return function proxyMethod(...args) { + return Reflect.apply(targetMethod, target, args); + }; +}); +function getAsyncIteratorWithCancel(asyncIterator, onCancel) { + return new Proxy(asyncIterator, { + has(asyncIterator, prop) { + if (prop === 'return') { + return true; + } + return Reflect.has(asyncIterator, prop); + }, + get(asyncIterator, prop, receiver) { + const existingPropValue = Reflect.get(asyncIterator, prop, receiver); + if (prop === 'return') { + const existingReturn = existingPropValue || defaultAsyncIteratorReturn; + return async function returnWithCancel(value) { + const returnValue = await onCancel(value); + return Reflect.apply(existingReturn, asyncIterator, [returnValue]); + }; + } + else if (typeof existingPropValue === 'function') { + return proxyMethodFactory(asyncIterator, existingPropValue); + } + return existingPropValue; + }, + }); +} +function getAsyncIterableWithCancel(asyncIterable, onCancel) { + return new Proxy(asyncIterable, { + get(asyncIterable, prop, receiver) { + const existingPropValue = Reflect.get(asyncIterable, prop, receiver); + if (Symbol.asyncIterator === prop) { + return function asyncIteratorFactory() { + const asyncIterator = Reflect.apply(existingPropValue, asyncIterable, []); + return getAsyncIteratorWithCancel(asyncIterator, onCancel); + }; + } + else if (typeof existingPropValue === 'function') { + return proxyMethodFactory(asyncIterable, existingPropValue); + } + return existingPropValue; + }, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/AccumulatorMap.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/AccumulatorMap.js new file mode 100644 index 00000000..36ac0ae1 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/AccumulatorMap.js @@ -0,0 +1,17 @@ +/** + * ES6 Map with additional `add` method to accumulate items. + */ +export class AccumulatorMap extends Map { + get [Symbol.toStringTag]() { + return 'AccumulatorMap'; + } + add(key, item) { + const group = this.get(key); + if (group === undefined) { + this.set(key, [item]); + } + else { + group.push(item); + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Interfaces.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Interfaces.js new file mode 100644 index 00000000..2d2cd7ba --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Interfaces.js @@ -0,0 +1,28 @@ +export var MapperKind; +(function (MapperKind) { + MapperKind["TYPE"] = "MapperKind.TYPE"; + MapperKind["SCALAR_TYPE"] = "MapperKind.SCALAR_TYPE"; + MapperKind["ENUM_TYPE"] = "MapperKind.ENUM_TYPE"; + MapperKind["COMPOSITE_TYPE"] = "MapperKind.COMPOSITE_TYPE"; + MapperKind["OBJECT_TYPE"] = "MapperKind.OBJECT_TYPE"; + MapperKind["INPUT_OBJECT_TYPE"] = "MapperKind.INPUT_OBJECT_TYPE"; + MapperKind["ABSTRACT_TYPE"] = "MapperKind.ABSTRACT_TYPE"; + MapperKind["UNION_TYPE"] = "MapperKind.UNION_TYPE"; + MapperKind["INTERFACE_TYPE"] = "MapperKind.INTERFACE_TYPE"; + MapperKind["ROOT_OBJECT"] = "MapperKind.ROOT_OBJECT"; + MapperKind["QUERY"] = "MapperKind.QUERY"; + MapperKind["MUTATION"] = "MapperKind.MUTATION"; + MapperKind["SUBSCRIPTION"] = "MapperKind.SUBSCRIPTION"; + MapperKind["DIRECTIVE"] = "MapperKind.DIRECTIVE"; + MapperKind["FIELD"] = "MapperKind.FIELD"; + MapperKind["COMPOSITE_FIELD"] = "MapperKind.COMPOSITE_FIELD"; + MapperKind["OBJECT_FIELD"] = "MapperKind.OBJECT_FIELD"; + MapperKind["ROOT_FIELD"] = "MapperKind.ROOT_FIELD"; + MapperKind["QUERY_ROOT_FIELD"] = "MapperKind.QUERY_ROOT_FIELD"; + MapperKind["MUTATION_ROOT_FIELD"] = "MapperKind.MUTATION_ROOT_FIELD"; + MapperKind["SUBSCRIPTION_ROOT_FIELD"] = "MapperKind.SUBSCRIPTION_ROOT_FIELD"; + MapperKind["INTERFACE_FIELD"] = "MapperKind.INTERFACE_FIELD"; + MapperKind["INPUT_OBJECT_FIELD"] = "MapperKind.INPUT_OBJECT_FIELD"; + MapperKind["ARGUMENT"] = "MapperKind.ARGUMENT"; + MapperKind["ENUM_VALUE"] = "MapperKind.ENUM_VALUE"; +})(MapperKind || (MapperKind = {})); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Path.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Path.js new file mode 100644 index 00000000..5fcda084 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/Path.js @@ -0,0 +1,26 @@ +/** + * Given a Path and a key, return a new Path containing the new key. + */ +export function addPath(prev, key, typename) { + return { prev, key, typename }; +} +/** + * Given a Path, return an Array of the path keys. + */ +export function pathToArray(path) { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + return flattened.reverse(); +} +/** + * Build a string describing the path. + */ +export function printPathArray(path) { + return path + .map(key => (typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key)) + .join(''); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/addTypes.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/addTypes.js new file mode 100644 index 00000000..1d7c7087 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/addTypes.js @@ -0,0 +1,58 @@ +// addTypes uses toConfig to create a new schema with a new or replaced +// type or directive. Rewiring is employed so that the replaced type can be +// reconnected with the existing types. +// +// Rewiring is employed even for new types or directives as a convenience, so +// that type references within the new type or directive do not have to be to +// the identical objects within the original schema. +// +// In fact, the type references could even be stub types with entirely different +// fields, as long as the type references share the same name as the desired +// type within the original schema's type map. +// +// This makes it easy to perform simple schema operations (e.g. adding a new +// type with a fiew fields removed from an existing type) that could normally be +// performed by using toConfig directly, but is blocked if any intervening +// more advanced schema operations have caused the types to be recreated via +// rewiring. +// +// Type recreation happens, for example, with every use of mapSchema, as the +// types are always rewired. If fields are selected and removed using +// mapSchema, adding those fields to a new type can no longer be simply done +// by toConfig, as the types are not the identical JavaScript objects, and +// schema creation will fail with errors referencing multiple types with the +// same names. +// +// enhanceSchema can fill this gap by adding an additional round of rewiring. +// +import { GraphQLSchema, isDirective, isNamedType, } from 'graphql'; +import { getObjectTypeFromTypeMap } from './getObjectTypeFromTypeMap.js'; +import { rewireTypes } from './rewire.js'; +export function addTypes(schema, newTypesOrDirectives) { + const config = schema.toConfig(); + const originalTypeMap = {}; + for (const type of config.types) { + originalTypeMap[type.name] = type; + } + const originalDirectiveMap = {}; + for (const directive of config.directives) { + originalDirectiveMap[directive.name] = directive; + } + for (const newTypeOrDirective of newTypesOrDirectives) { + if (isNamedType(newTypeOrDirective)) { + originalTypeMap[newTypeOrDirective.name] = newTypeOrDirective; + } + else if (isDirective(newTypeOrDirective)) { + originalDirectiveMap[newTypeOrDirective.name] = newTypeOrDirective; + } + } + const { typeMap, directives } = rewireTypes(originalTypeMap, Object.values(originalDirectiveMap)); + return new GraphQLSchema({ + ...config, + query: getObjectTypeFromTypeMap(typeMap, schema.getQueryType()), + mutation: getObjectTypeFromTypeMap(typeMap, schema.getMutationType()), + subscription: getObjectTypeFromTypeMap(typeMap, schema.getSubscriptionType()), + types: Object.values(typeMap), + directives, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromType.js new file mode 100644 index 00000000..10abac91 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromType.js @@ -0,0 +1,27 @@ +import { inspect } from 'cross-inspect'; +import { isListType, isNonNullType, Kind } from 'graphql'; +export function astFromType(type) { + if (isNonNullType(type)) { + const innerType = astFromType(type.ofType); + if (innerType.kind === Kind.NON_NULL_TYPE) { + throw new Error(`Invalid type node ${inspect(type)}. Inner type of non-null type cannot be a non-null type.`); + } + return { + kind: Kind.NON_NULL_TYPE, + type: innerType, + }; + } + else if (isListType(type)) { + return { + kind: Kind.LIST_TYPE, + type: astFromType(type.ofType), + }; + } + return { + kind: Kind.NAMED_TYPE, + name: { + kind: Kind.NAME, + value: type.name, + }, + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValue.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValue.js new file mode 100644 index 00000000..f33bf82b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValue.js @@ -0,0 +1,112 @@ +import { isEnumType, isInputObjectType, isLeafType, isListType, isNonNullType, Kind, } from 'graphql'; +import { astFromValueUntyped } from './astFromValueUntyped.js'; +import { isIterableObject, isObjectLike } from './jsutils.js'; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. For example: + * + * astFromValue("value", GraphQLString) + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | BigInt | Int | + * | Unknown | Enum Value | + * | null | NullValue | + * + */ +export function astFromValue(value, type) { + if (isNonNullType(type)) { + const astValue = astFromValue(value, type.ofType); + if (astValue?.kind === Kind.NULL) { + return null; + } + return astValue; + } + // only explicit null, not undefined, NaN + if (value === null) { + return { kind: Kind.NULL }; + } + // undefined + if (value === undefined) { + return null; + } + // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + if (isListType(type)) { + const itemType = type.ofType; + if (isIterableObject(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValue(item, itemType); + if (itemNode != null) { + valuesNodes.push(itemNode); + } + } + return { kind: Kind.LIST, values: valuesNodes }; + } + return astFromValue(value, itemType); + } + // Populate the fields of the input object by creating ASTs from each value + // in the JavaScript object according to the fields in the input type. + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return null; + } + const fieldNodes = []; + for (const field of Object.values(type.getFields())) { + const fieldValue = astFromValue(value[field.name], field.type); + if (fieldValue) { + fieldNodes.push({ + kind: Kind.OBJECT_FIELD, + name: { kind: Kind.NAME, value: field.name }, + value: fieldValue, + }); + } + } + return { kind: Kind.OBJECT, fields: fieldNodes }; + } + if (isLeafType(type)) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + if (isEnumType(type)) { + const values = type.getValues(); + for (const enumValue of values) { + if (enumValue.value === value) { + value = enumValue.name; + break; + } + if (enumValue.name === value) { + value = enumValue.name; + break; + } + } + return { kind: Kind.ENUM, value: value }; + } + else { + value = type.serialize(value); + } + if (value == null) { + return null; + } + // ID types can use Int literals. + if (type.name === 'ID' && typeof value === 'string' && integerStringRegExp.test(value)) { + return { kind: Kind.INT, value }; + } + } + return astFromValueUntyped(value); +} +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js new file mode 100644 index 00000000..4e183afd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js @@ -0,0 +1,81 @@ +import { Kind } from 'graphql'; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using the following mapping. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String | + * | Number | Int / Float | + * | BigInt | Int | + * | null | NullValue | + * + */ +export function astFromValueUntyped(value) { + // only explicit null, not undefined, NaN + if (value === null) { + return { kind: Kind.NULL }; + } + // undefined + if (value === undefined) { + return null; + } + // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + if (Array.isArray(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValueUntyped(item); + if (itemNode != null) { + valuesNodes.push(itemNode); + } + } + return { kind: Kind.LIST, values: valuesNodes }; + } + if (typeof value === 'object') { + if (value?.toJSON) { + return astFromValueUntyped(value.toJSON()); + } + const fieldNodes = []; + for (const fieldName in value) { + const fieldValue = value[fieldName]; + const ast = astFromValueUntyped(fieldValue); + if (ast) { + fieldNodes.push({ + kind: Kind.OBJECT_FIELD, + name: { kind: Kind.NAME, value: fieldName }, + value: ast, + }); + } + } + return { kind: Kind.OBJECT, fields: fieldNodes }; + } + // Others serialize based on their corresponding JavaScript scalar types. + if (typeof value === 'boolean') { + return { kind: Kind.BOOLEAN, value }; + } + if (typeof value === 'bigint') { + return { kind: Kind.INT, value: String(value) }; + } + // JavaScript numbers can be Int or Float values. + if (typeof value === 'number' && isFinite(value)) { + const stringNum = String(value); + return integerStringRegExp.test(stringNum) + ? { kind: Kind.INT, value: stringNum } + : { kind: Kind.FLOAT, value: stringNum }; + } + if (typeof value === 'string') { + return { kind: Kind.STRING, value }; + } + throw new TypeError(`Cannot convert value to AST: ${value}.`); +} +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/build-operation-for-field.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/build-operation-for-field.js new file mode 100644 index 00000000..b811485f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/build-operation-for-field.js @@ -0,0 +1,360 @@ +import { getNamedType, isEnumType, isInterfaceType, isListType, isNonNullType, isObjectType, isScalarType, isUnionType, Kind, } from 'graphql'; +import { astFromValueUntyped } from './astFromValueUntyped.js'; +import { defaultValueAstFromType } from './defaultValueAstFromType.js'; +import { getDefinedRootType, getRootTypeNames } from './rootTypes.js'; +let operationVariables = []; +let fieldTypeMap = new Map(); +function addOperationVariable(variable) { + operationVariables.push(variable); +} +function resetOperationVariables() { + operationVariables = []; +} +function resetFieldMap() { + fieldTypeMap = new Map(); +} +export function buildOperationNodeForField({ schema, kind, field, models, ignore = [], depthLimit, circularReferenceDepth, argNames, selectedFields = true, }) { + resetOperationVariables(); + resetFieldMap(); + const rootTypeNames = getRootTypeNames(schema); + const operationNode = buildOperationAndCollectVariables({ + schema, + fieldName: field, + kind, + models: models || [], + ignore, + depthLimit: depthLimit || Infinity, + circularReferenceDepth: circularReferenceDepth || 1, + argNames, + selectedFields, + rootTypeNames, + }); + // attach variables + operationNode.variableDefinitions = [...operationVariables]; + resetOperationVariables(); + resetFieldMap(); + return operationNode; +} +function buildOperationAndCollectVariables({ schema, fieldName, kind, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, rootTypeNames, }) { + const type = getDefinedRootType(schema, kind); + const field = type.getFields()[fieldName]; + const operationName = `${fieldName}_${kind}`; + if (field.args) { + for (const arg of field.args) { + const argName = arg.name; + if (!argNames || argNames.includes(argName)) { + addOperationVariable(resolveVariable(arg, argName)); + } + } + } + return { + kind: Kind.OPERATION_DEFINITION, + operation: kind, + name: { + kind: Kind.NAME, + value: operationName, + }, + variableDefinitions: [], + selectionSet: { + kind: Kind.SELECTION_SET, + selections: [ + resolveField({ + type, + field, + models, + firstCall: true, + path: [], + ancestors: [], + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth: 0, + argNames, + selectedFields, + rootTypeNames, + }), + ], + }, + }; +} +function resolveSelectionSet({ parent, type, models, firstCall, path, ancestors, ignore, depthLimit, circularReferenceDepth, schema, depth, argNames, selectedFields, rootTypeNames, }) { + if (typeof selectedFields === 'boolean' && depth > depthLimit) { + return; + } + if (isUnionType(type)) { + const types = type.getTypes(); + return { + kind: Kind.SELECTION_SET, + selections: types + .filter(t => !hasCircularRef([...ancestors, t], { + depth: circularReferenceDepth, + })) + .map(t => { + return { + kind: Kind.INLINE_FRAGMENT, + typeCondition: { + kind: Kind.NAMED_TYPE, + name: { + kind: Kind.NAME, + value: t.name, + }, + }, + selectionSet: resolveSelectionSet({ + parent: type, + type: t, + models, + path, + ancestors, + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth, + argNames, + selectedFields, + rootTypeNames, + }), + }; + }) + .filter(fragmentNode => fragmentNode?.selectionSet?.selections?.length > 0), + }; + } + if (isInterfaceType(type)) { + const types = Object.values(schema.getTypeMap()).filter((t) => isObjectType(t) && t.getInterfaces().includes(type)); + return { + kind: Kind.SELECTION_SET, + selections: types + .filter(t => !hasCircularRef([...ancestors, t], { + depth: circularReferenceDepth, + })) + .map(t => { + return { + kind: Kind.INLINE_FRAGMENT, + typeCondition: { + kind: Kind.NAMED_TYPE, + name: { + kind: Kind.NAME, + value: t.name, + }, + }, + selectionSet: resolveSelectionSet({ + parent: type, + type: t, + models, + path, + ancestors, + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth, + argNames, + selectedFields, + rootTypeNames, + }), + }; + }) + .filter(fragmentNode => fragmentNode?.selectionSet?.selections?.length > 0), + }; + } + if (isObjectType(type) && !rootTypeNames.has(type.name)) { + const isIgnored = ignore.includes(type.name) || ignore.includes(`${parent.name}.${path[path.length - 1]}`); + const isModel = models.includes(type.name); + if (!firstCall && isModel && !isIgnored) { + return { + kind: Kind.SELECTION_SET, + selections: [ + { + kind: Kind.FIELD, + name: { + kind: Kind.NAME, + value: 'id', + }, + }, + ], + }; + } + const fields = type.getFields(); + return { + kind: Kind.SELECTION_SET, + selections: Object.keys(fields) + .filter(fieldName => { + return !hasCircularRef([...ancestors, getNamedType(fields[fieldName].type)], { + depth: circularReferenceDepth, + }); + }) + .map(fieldName => { + const selectedSubFields = typeof selectedFields === 'object' ? selectedFields[fieldName] : true; + if (selectedSubFields) { + return resolveField({ + type, + field: fields[fieldName], + models, + path: [...path, fieldName], + ancestors, + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth, + argNames, + selectedFields: selectedSubFields, + rootTypeNames, + }); + } + return null; + }) + .filter((f) => { + if (f == null) { + return false; + } + else if ('selectionSet' in f) { + return !!f.selectionSet?.selections?.length; + } + return true; + }), + }; + } +} +function resolveVariable(arg, name) { + function resolveVariableType(type) { + if (isListType(type)) { + return { + kind: Kind.LIST_TYPE, + type: resolveVariableType(type.ofType), + }; + } + if (isNonNullType(type)) { + return { + kind: Kind.NON_NULL_TYPE, + // for v16 compatibility + type: resolveVariableType(type.ofType), + }; + } + return { + kind: Kind.NAMED_TYPE, + name: { + kind: Kind.NAME, + value: type.name, + }, + }; + } + let defaultValue; + try { + defaultValue = defaultValueAstFromType(arg); + } + catch (e) { + defaultValue = astFromValueUntyped(arg.defaultValue) ?? undefined; + } + return { + kind: Kind.VARIABLE_DEFINITION, + variable: { + kind: Kind.VARIABLE, + name: { + kind: Kind.NAME, + value: name || arg.name, + }, + }, + type: resolveVariableType(arg.type), + defaultValue, + }; +} +function getArgumentName(name, path) { + return [...path, name].join('_'); +} +function resolveField({ type, field, models, firstCall, path, ancestors, ignore, depthLimit, circularReferenceDepth, schema, depth, argNames, selectedFields, rootTypeNames, }) { + const namedType = getNamedType(field.type); + let args = []; + let removeField = false; + if (field.args && field.args.length) { + args = field.args + .map(arg => { + const argumentName = getArgumentName(arg.name, path); + if (argNames && !argNames.includes(argumentName)) { + if (isNonNullType(arg.type)) { + removeField = true; + } + return null; + } + if (!firstCall) { + addOperationVariable(resolveVariable(arg, argumentName)); + } + return { + kind: Kind.ARGUMENT, + name: { + kind: Kind.NAME, + value: arg.name, + }, + value: { + kind: Kind.VARIABLE, + name: { + kind: Kind.NAME, + value: getArgumentName(arg.name, path), + }, + }, + }; + }) + .filter(Boolean); + } + if (removeField) { + return null; + } + const fieldPath = [...path, field.name]; + const fieldPathStr = fieldPath.join('.'); + let fieldName = field.name; + if (fieldTypeMap.has(fieldPathStr) && fieldTypeMap.get(fieldPathStr) !== field.type.toString()) { + fieldName += field.type + .toString() + .replace(/!/g, 'NonNull') + .replace(/\[/g, 'List') + .replace(/\]/g, ''); + } + fieldTypeMap.set(fieldPathStr, field.type.toString()); + if (!isScalarType(namedType) && !isEnumType(namedType)) { + return { + kind: Kind.FIELD, + name: { + kind: Kind.NAME, + value: field.name, + }, + ...(fieldName !== field.name && { alias: { kind: Kind.NAME, value: fieldName } }), + selectionSet: resolveSelectionSet({ + parent: type, + type: namedType, + models, + firstCall, + path: fieldPath, + ancestors: [...ancestors, type], + ignore, + depthLimit, + circularReferenceDepth, + schema, + depth: depth + 1, + argNames, + selectedFields, + rootTypeNames, + }) || undefined, + arguments: args, + }; + } + return { + kind: Kind.FIELD, + name: { + kind: Kind.NAME, + value: field.name, + }, + ...(fieldName !== field.name && { alias: { kind: Kind.NAME, value: fieldName } }), + arguments: args, + }; +} +function hasCircularRef(types, config = { + depth: 1, +}) { + const type = types[types.length - 1]; + if (isScalarType(type)) { + return false; + } + const size = types.filter(t => t.name === type.name).length; + return size > config.depth; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/collectFields.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/collectFields.js new file mode 100644 index 00000000..0debe01a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/collectFields.js @@ -0,0 +1,160 @@ +import { GraphQLIncludeDirective, GraphQLSkipDirective, isAbstractType, Kind, typeFromAST, } from 'graphql'; +import { AccumulatorMap } from './AccumulatorMap.js'; +import { GraphQLDeferDirective } from './directives.js'; +import { getDirectiveValues } from './getDirectiveValues.js'; +import { memoize5 } from './memoize.js'; +function collectFieldsImpl(schema, fragments, variableValues, runtimeType, selectionSet, fields, patches, visitedFragmentNames) { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case Kind.FIELD: { + if (!shouldIncludeNode(variableValues, selection)) { + continue; + } + fields.add(getFieldEntryKey(selection), selection); + break; + } + case Kind.INLINE_FRAGMENT: { + if (!shouldIncludeNode(variableValues, selection) || + !doesFragmentConditionMatch(schema, selection, runtimeType)) { + continue; + } + const defer = getDeferValues(variableValues, selection); + if (defer) { + const patchFields = new AccumulatorMap(); + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selection.selectionSet, patchFields, patches, visitedFragmentNames); + patches.push({ + label: defer.label, + fields: patchFields, + }); + } + else { + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selection.selectionSet, fields, patches, visitedFragmentNames); + } + break; + } + case Kind.FRAGMENT_SPREAD: { + const fragName = selection.name.value; + if (!shouldIncludeNode(variableValues, selection)) { + continue; + } + const defer = getDeferValues(variableValues, selection); + if (visitedFragmentNames.has(fragName) && !defer) { + continue; + } + const fragment = fragments[fragName]; + if (!fragment || !doesFragmentConditionMatch(schema, fragment, runtimeType)) { + continue; + } + if (!defer) { + visitedFragmentNames.add(fragName); + } + if (defer) { + const patchFields = new AccumulatorMap(); + collectFieldsImpl(schema, fragments, variableValues, runtimeType, fragment.selectionSet, patchFields, patches, visitedFragmentNames); + patches.push({ + label: defer.label, + fields: patchFields, + }); + } + else { + collectFieldsImpl(schema, fragments, variableValues, runtimeType, fragment.selectionSet, fields, patches, visitedFragmentNames); + } + break; + } + } + } +} +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + */ +export function collectFields(schema, fragments, variableValues, runtimeType, selectionSet) { + const fields = new AccumulatorMap(); + const patches = []; + collectFieldsImpl(schema, fragments, variableValues, runtimeType, selectionSet, fields, patches, new Set()); + return { fields, patches }; +} +/** + * Determines if a field should be included based on the `@include` and `@skip` + * directives, where `@skip` has higher precedence than `@include`. + */ +export function shouldIncludeNode(variableValues, node) { + const skip = getDirectiveValues(GraphQLSkipDirective, node, variableValues); + if (skip?.['if'] === true) { + return false; + } + const include = getDirectiveValues(GraphQLIncludeDirective, node, variableValues); + if (include?.['if'] === false) { + return false; + } + return true; +} +/** + * Determines if a fragment is applicable to the given type. + */ +export function doesFragmentConditionMatch(schema, fragment, type) { + const typeConditionNode = fragment.typeCondition; + if (!typeConditionNode) { + return true; + } + const conditionalType = typeFromAST(schema, typeConditionNode); + if (conditionalType === type) { + return true; + } + if (isAbstractType(conditionalType)) { + const possibleTypes = schema.getPossibleTypes(conditionalType); + return possibleTypes.includes(type); + } + return false; +} +/** + * Implements the logic to compute the key of a given field's entry + */ +export function getFieldEntryKey(node) { + return node.alias ? node.alias.value : node.name.value; +} +/** + * Returns an object containing the `@defer` arguments if a field should be + * deferred based on the experimental flag, defer directive present and + * not disabled by the "if" argument. + */ +export function getDeferValues(variableValues, node) { + const defer = getDirectiveValues(GraphQLDeferDirective, node, variableValues); + if (!defer) { + return; + } + if (defer['if'] === false) { + return; + } + return { + label: typeof defer['label'] === 'string' ? defer['label'] : undefined, + }; +} +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + */ +export const collectSubFields = memoize5(function collectSubfields(schema, fragments, variableValues, returnType, fieldNodes) { + const subFieldNodes = new AccumulatorMap(); + const visitedFragmentNames = new Set(); + const subPatches = []; + const subFieldsAndPatches = { + fields: subFieldNodes, + patches: subPatches, + }; + for (const node of fieldNodes) { + if (node.selectionSet) { + collectFieldsImpl(schema, fragments, variableValues, returnType, node.selectionSet, subFieldNodes, subPatches, visitedFragmentNames); + } + } + return subFieldsAndPatches; +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/comments.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/comments.js new file mode 100644 index 00000000..cd89cfca --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/comments.js @@ -0,0 +1,388 @@ +import { TokenKind, visit, } from 'graphql'; +const MAX_LINE_LENGTH = 80; +let commentsRegistry = {}; +export function resetComments() { + commentsRegistry = {}; +} +export function collectComment(node) { + const entityName = node.name?.value; + if (entityName == null) { + return; + } + pushComment(node, entityName); + switch (node.kind) { + case 'EnumTypeDefinition': + if (node.values) { + for (const value of node.values) { + pushComment(value, entityName, value.name.value); + } + } + break; + case 'ObjectTypeDefinition': + case 'InputObjectTypeDefinition': + case 'InterfaceTypeDefinition': + if (node.fields) { + for (const field of node.fields) { + pushComment(field, entityName, field.name.value); + if (isFieldDefinitionNode(field) && field.arguments) { + for (const arg of field.arguments) { + pushComment(arg, entityName, field.name.value, arg.name.value); + } + } + } + } + break; + } +} +export function pushComment(node, entity, field, argument) { + const comment = getComment(node); + if (typeof comment !== 'string' || comment.length === 0) { + return; + } + const keys = [entity]; + if (field) { + keys.push(field); + if (argument) { + keys.push(argument); + } + } + const path = keys.join('.'); + if (!commentsRegistry[path]) { + commentsRegistry[path] = []; + } + commentsRegistry[path].push(comment); +} +export function printComment(comment) { + return '\n# ' + comment.replace(/\n/g, '\n# '); +} +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * NOTE: ==> This file has been modified just to add comments to the printed AST + * This is a temp measure, we will move to using the original non modified printer.js ASAP. + */ +/** + * Given maybeArray, print an empty string if it is null or empty, otherwise + * print all items together separated by separator if provided + */ +function join(maybeArray, separator) { + return maybeArray ? maybeArray.filter(x => x).join(separator || '') : ''; +} +function hasMultilineItems(maybeArray) { + return maybeArray?.some(str => str.includes('\n')) ?? false; +} +function addDescription(cb) { + return (node, _key, _parent, path, ancestors) => { + const keys = []; + const parent = path.reduce((prev, key) => { + if (['fields', 'arguments', 'values'].includes(key) && prev.name) { + keys.push(prev.name.value); + } + return prev[key]; + }, ancestors[0]); + const key = [...keys, parent?.name?.value].filter(Boolean).join('.'); + const items = []; + if (node.kind.includes('Definition') && commentsRegistry[key]) { + items.push(...commentsRegistry[key]); + } + return join([...items.map(printComment), node.description, cb(node, _key, _parent, path, ancestors)], '\n'); + }; +} +function indent(maybeString) { + return maybeString && ` ${maybeString.replace(/\n/g, '\n ')}`; +} +/** + * Given array, print each item on its own line, wrapped in an + * indented "{ }" block. + */ +function block(array) { + return array && array.length !== 0 ? `{\n${indent(join(array, '\n'))}\n}` : ''; +} +/** + * If maybeString is not null or empty, then wrap with start and end, otherwise + * print an empty string. + */ +function wrap(start, maybeString, end) { + return maybeString ? start + maybeString + (end || '') : ''; +} +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + */ +function printBlockString(value, isDescription = false) { + const escaped = value.replace(/\\/g, '\\\\').replace(/"""/g, '\\"""'); + return (value[0] === ' ' || value[0] === '\t') && value.indexOf('\n') === -1 + ? `"""${escaped.replace(/"$/, '"\n')}"""` + : `"""\n${isDescription ? escaped : indent(escaped)}\n"""`; +} +const printDocASTReducer = { + Name: { leave: node => node.value }, + Variable: { leave: node => '$' + node.name }, + // Document + Document: { + leave: node => join(node.definitions, '\n\n'), + }, + OperationDefinition: { + leave: node => { + const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); + const prefix = join([node.operation, join([node.name, varDefs]), join(node.directives, ' ')], ' '); + // the query short form. + return prefix + ' ' + node.selectionSet; + }, + }, + VariableDefinition: { + leave: ({ variable, type, defaultValue, directives }) => variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')), + }, + SelectionSet: { leave: ({ selections }) => block(selections) }, + Field: { + leave({ alias, name, arguments: args, directives, selectionSet }) { + const prefix = wrap('', alias, ': ') + name; + let argsLine = prefix + wrap('(', join(args, ', '), ')'); + if (argsLine.length > MAX_LINE_LENGTH) { + argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); + } + return join([argsLine, join(directives, ' '), selectionSet], ' '); + }, + }, + Argument: { leave: ({ name, value }) => name + ': ' + value }, + // Fragments + FragmentSpread: { + leave: ({ name, directives }) => '...' + name + wrap(' ', join(directives, ' ')), + }, + InlineFragment: { + leave: ({ typeCondition, directives, selectionSet }) => join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' '), + }, + FragmentDefinition: { + leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + + selectionSet, + }, + // Value + IntValue: { leave: ({ value }) => value }, + FloatValue: { leave: ({ value }) => value }, + StringValue: { + leave: ({ value, block: isBlockString }) => { + if (isBlockString) { + return printBlockString(value); + } + return JSON.stringify(value); + }, + }, + BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') }, + NullValue: { leave: () => 'null' }, + EnumValue: { leave: ({ value }) => value }, + ListValue: { leave: ({ values }) => '[' + join(values, ', ') + ']' }, + ObjectValue: { leave: ({ fields }) => '{' + join(fields, ', ') + '}' }, + ObjectField: { leave: ({ name, value }) => name + ': ' + value }, + // Directive + Directive: { + leave: ({ name, arguments: args }) => '@' + name + wrap('(', join(args, ', '), ')'), + }, + // Type + NamedType: { leave: ({ name }) => name }, + ListType: { leave: ({ type }) => '[' + type + ']' }, + NonNullType: { leave: ({ type }) => type + '!' }, + // Type System Definitions + SchemaDefinition: { + leave: ({ directives, operationTypes }) => join(['schema', join(directives, ' '), block(operationTypes)], ' '), + }, + OperationTypeDefinition: { + leave: ({ operation, type }) => operation + ': ' + type, + }, + ScalarTypeDefinition: { + leave: ({ name, directives }) => join(['scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeDefinition: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + FieldDefinition: { + leave: ({ name, arguments: args, type, directives }) => name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + ': ' + + type + + wrap(' ', join(directives, ' ')), + }, + InputValueDefinition: { + leave: ({ name, type, defaultValue, directives }) => join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '), + }, + InterfaceTypeDefinition: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeDefinition: { + leave: ({ name, directives, types }) => join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '), + }, + EnumTypeDefinition: { + leave: ({ name, directives, values }) => join(['enum', name, join(directives, ' '), block(values)], ' '), + }, + EnumValueDefinition: { + leave: ({ name, directives }) => join([name, join(directives, ' ')], ' '), + }, + InputObjectTypeDefinition: { + leave: ({ name, directives, fields }) => join(['input', name, join(directives, ' '), block(fields)], ' '), + }, + DirectiveDefinition: { + leave: ({ name, arguments: args, repeatable, locations }) => 'directive @' + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + (repeatable ? ' repeatable' : '') + + ' on ' + + join(locations, ' | '), + }, + SchemaExtension: { + leave: ({ directives, operationTypes }) => join(['extend schema', join(directives, ' '), block(operationTypes)], ' '), + }, + ScalarTypeExtension: { + leave: ({ name, directives }) => join(['extend scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + InterfaceTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeExtension: { + leave: ({ name, directives, types }) => join(['extend union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '), + }, + EnumTypeExtension: { + leave: ({ name, directives, values }) => join(['extend enum', name, join(directives, ' '), block(values)], ' '), + }, + InputObjectTypeExtension: { + leave: ({ name, directives, fields }) => join(['extend input', name, join(directives, ' '), block(fields)], ' '), + }, +}; +const printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((prev, key) => ({ + ...prev, + [key]: { + leave: addDescription(printDocASTReducer[key].leave), + }, +}), {}); +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ +export function printWithComments(ast) { + return visit(ast, printDocASTReducerWithComments); +} +function isFieldDefinitionNode(node) { + return node.kind === 'FieldDefinition'; +} +// graphql < v13 and > v15 does not export getDescription +export function getDescription(node, options) { + if (node.description != null) { + return node.description.value; + } + if (options?.commentDescriptions) { + return getComment(node); + } +} +export function getComment(node) { + const rawValue = getLeadingCommentBlock(node); + if (rawValue !== undefined) { + return dedentBlockStringValue(`\n${rawValue}`); + } +} +export function getLeadingCommentBlock(node) { + const loc = node.loc; + if (!loc) { + return; + } + const comments = []; + let token = loc.startToken.prev; + while (token != null && + token.kind === TokenKind.COMMENT && + token.next != null && + token.prev != null && + token.line + 1 === token.next.line && + token.line !== token.prev.line) { + const value = String(token.value); + comments.push(value); + token = token.prev; + } + return comments.length > 0 ? comments.reverse().join('\n') : undefined; +} +export function dedentBlockStringValue(rawString) { + // Expand a block string's raw value into independent lines. + const lines = rawString.split(/\r\n|[\n\r]/g); + // Remove common indentation from all lines but first. + const commonIndent = getBlockStringIndentation(lines); + if (commonIndent !== 0) { + for (let i = 1; i < lines.length; i++) { + lines[i] = lines[i].slice(commonIndent); + } + } + // Remove leading and trailing blank lines. + while (lines.length > 0 && isBlank(lines[0])) { + lines.shift(); + } + while (lines.length > 0 && isBlank(lines[lines.length - 1])) { + lines.pop(); + } + // Return a string of the lines joined with U+000A. + return lines.join('\n'); +} +/** + * @internal + */ +export function getBlockStringIndentation(lines) { + let commonIndent = null; + for (let i = 1; i < lines.length; i++) { + const line = lines[i]; + const indent = leadingWhitespace(line); + if (indent === line.length) { + continue; // skip empty lines + } + if (commonIndent === null || indent < commonIndent) { + commonIndent = indent; + if (commonIndent === 0) { + break; + } + } + } + return commonIndent === null ? 0 : commonIndent; +} +function leadingWhitespace(str) { + let i = 0; + while (i < str.length && (str[i] === ' ' || str[i] === '\t')) { + i++; + } + return i; +} +function isBlank(str) { + return leadingWhitespace(str) === str.length; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/debugTimer.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/debugTimer.js new file mode 100644 index 00000000..f0186f2f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/debugTimer.js @@ -0,0 +1,13 @@ +const debugNamesOngoing = new Set(); +export function debugTimerStart(name) { + const debugEnvVar = globalThis.process?.env?.['DEBUG'] || globalThis.DEBUG; + if (debugEnvVar === '1' || debugEnvVar?.includes(name)) { + debugNamesOngoing.add(name); + console.time(name); + } +} +export function debugTimerEnd(name) { + if (debugNamesOngoing.has(name)) { + console.timeEnd(name); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/defaultValueAstFromType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/defaultValueAstFromType.js new file mode 100644 index 00000000..858442c9 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/defaultValueAstFromType.js @@ -0,0 +1,28 @@ +import { valueFromASTUntyped, } from 'graphql'; +import { astFromValue } from './astFromValue.js'; +import { astFromValueUntyped } from './astFromValueUntyped.js'; +/** + * `defaultValueAstFromType` extracts default value from `GraphQLArgument` or `GraphQLInputField`, if available + * This is compatible with all `graphql` versions + * + * The return type is `ConstValueNode` in graphql@16+, + * but it is not available in graphql@15 so `ValueNode` is used as return type here and `as any` is often required at callsites for backwards compatibility, + */ +export const defaultValueAstFromType = (arg) => { + // graphql >= v17 has `default` instead of `defaultValue` + // So for backward compatibility with v16, we are using `arg.default as any`, otherwise, TypeScript report type error + if ('default' in arg) { + if (!arg.default) { + return undefined; + } + if ('value' in arg.default) { + return astFromValueUntyped(arg.default.value) ?? undefined; + } + const value = valueFromASTUntyped(arg.default.literal); + return astFromValue(value, arg.type) ?? undefined; + } + // graphql < v17 has `defaultValue` instead of `default` + return arg.defaultValue !== undefined + ? (astFromValue(arg.defaultValue, arg.type) ?? undefined) + : undefined; +}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/descriptionFromObject.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/descriptionFromObject.js new file mode 100644 index 00000000..492c8c01 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/descriptionFromObject.js @@ -0,0 +1,18 @@ +import { Kind } from 'graphql'; +export function getDescriptionNode(obj) { + // Prefer the runtime `description` over a stale `astNode` description. + // Schema transforms (e.g. mapSchema) update config descriptions without rewriting astNode (#5508). + if (typeof obj.description === 'string') { + return { + kind: Kind.STRING, + value: obj.description, + block: true, + }; + } + if (obj.astNode?.description) { + return { + ...obj.astNode.description, + block: true, + }; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/directives.js new file mode 100644 index 00000000..9b4bb9f5 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/directives.js @@ -0,0 +1,44 @@ +import { DirectiveLocation, GraphQLBoolean, GraphQLDirective, GraphQLInt, GraphQLNonNull, GraphQLString, } from 'graphql'; +/** + * Used to conditionally defer fragments. + */ +export const GraphQLDeferDirective = new GraphQLDirective({ + name: 'defer', + description: 'Directs the executor to defer this fragment when the `if` argument is true or undefined.', + locations: [DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Deferred when true or undefined.', + defaultValue: true, + }, + label: { + type: GraphQLString, + description: 'Unique name', + }, + }, +}); +/** + * Used to conditionally stream list fields. + */ +export const GraphQLStreamDirective = new GraphQLDirective({ + name: 'stream', + description: 'Directs the executor to stream plural fields when the `if` argument is true or undefined.', + locations: [DirectiveLocation.FIELD], + args: { + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Stream when true or undefined.', + defaultValue: true, + }, + label: { + type: GraphQLString, + description: 'Unique name', + }, + initialCount: { + defaultValue: 0, + type: GraphQLInt, + description: 'Number of items to return immediately', + }, + }, +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/errors.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/errors.js new file mode 100644 index 00000000..24c4456a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/errors.js @@ -0,0 +1,62 @@ +import { locatedError as _locatedError, GraphQLError, versionInfo } from 'graphql'; +const possibleGraphQLErrorProperties = [ + 'message', + 'locations', + 'path', + 'nodes', + 'source', + 'positions', + 'originalError', + 'name', + 'stack', + 'extensions', + 'coordinate', +]; +export function isGraphQLErrorLike(error) { + return (error != null && + typeof error === 'object' && + Object.keys(error).every(key => possibleGraphQLErrorProperties.includes(key))); +} +export function createGraphQLError(message, options) { + if (options?.originalError && + !(options.originalError instanceof Error) && + isGraphQLErrorLike(options.originalError)) { + options.originalError = createGraphQLError(options.originalError.message, options.originalError); + } + // To avoid type error on graphql <16, we have to use an any type here + const Constructor = GraphQLError; + const error = versionInfo.major >= 16 + ? new Constructor(message, options) + : new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions); + if (options?.coordinate && error.coordinate == null) { + Object.defineProperties(error, { + coordinate: { value: options.coordinate, enumerable: true, configurable: true }, + }); + } + return error; +} +export function getSchemaCoordinate(error) { + return error.coordinate; +} +export function locatedError(rawError, nodes, path, info) { + const error = _locatedError(rawError, nodes, path); + // `graphql` locatedError is only changing path and nodes if it is not already defined + if (!error.coordinate && info && error.coordinate == null) { + const coordinate = `${info.parentType.name}.${info.fieldName}`; + Object.defineProperties(error, { + coordinate: { value: coordinate, enumerable: true, configurable: true }, + }); + } + return error; +} +export function relocatedError(originalError, path, info) { + return createGraphQLError(originalError.message, { + nodes: originalError.nodes, + source: originalError.source, + positions: originalError.positions, + path: path == null ? originalError.path : path, + originalError, + extensions: originalError.extensions, + coordinate: info ? `${info.parentType.name}.${info.fieldName}` : undefined, + }); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/executor.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/executor.js new file mode 100644 index 00000000..e69de29b diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/extractExtensionsFromSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/extractExtensionsFromSchema.js new file mode 100644 index 00000000..823eda9b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/extractExtensionsFromSchema.js @@ -0,0 +1,99 @@ +import { asArray } from './helpers.js'; +import { MapperKind } from './Interfaces.js'; +import { mapSchema } from './mapSchema.js'; +function handleDirectiveExtensions(extensions, removeDirectives) { + extensions = extensions || {}; + const { directives: existingDirectives, ...rest } = extensions; + const finalExtensions = { + ...rest, + }; + if (!removeDirectives) { + if (existingDirectives != null) { + const directives = {}; + for (const directiveName in existingDirectives) { + directives[directiveName] = [...asArray(existingDirectives[directiveName])]; + } + finalExtensions.directives = directives; + } + } + return finalExtensions; +} +export function extractExtensionsFromSchema(schema, removeDirectives = false) { + const result = { + schemaExtensions: handleDirectiveExtensions(schema.extensions, removeDirectives), + types: {}, + }; + mapSchema(schema, { + [MapperKind.OBJECT_TYPE]: type => { + result.types[type.name] = { + fields: {}, + type: 'object', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [MapperKind.INTERFACE_TYPE]: type => { + result.types[type.name] = { + fields: {}, + type: 'interface', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [MapperKind.FIELD]: (field, fieldName, typeName) => { + result.types[typeName].fields[fieldName] = { + arguments: {}, + extensions: handleDirectiveExtensions(field.extensions, removeDirectives), + }; + const args = field.args; + if (args != null) { + for (const argName in args) { + result.types[typeName].fields[fieldName].arguments[argName] = + handleDirectiveExtensions(args[argName].extensions, removeDirectives); + } + } + return field; + }, + [MapperKind.ENUM_TYPE]: type => { + result.types[type.name] = { + values: {}, + type: 'enum', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [MapperKind.ENUM_VALUE]: (value, typeName, _schema, valueName) => { + result.types[typeName].values[valueName] = handleDirectiveExtensions(value.extensions, removeDirectives); + return value; + }, + [MapperKind.SCALAR_TYPE]: type => { + result.types[type.name] = { + type: 'scalar', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [MapperKind.UNION_TYPE]: type => { + result.types[type.name] = { + type: 'union', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [MapperKind.INPUT_OBJECT_TYPE]: type => { + result.types[type.name] = { + fields: {}, + type: 'input', + extensions: handleDirectiveExtensions(type.extensions, removeDirectives), + }; + return type; + }, + [MapperKind.INPUT_OBJECT_FIELD]: (field, fieldName, typeName) => { + result.types[typeName].fields[fieldName] = { + extensions: handleDirectiveExtensions(field.extensions, removeDirectives), + }; + return field; + }, + }); + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fields.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fields.js new file mode 100644 index 00000000..5f76444a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fields.js @@ -0,0 +1,108 @@ +import { GraphQLObjectType, } from 'graphql'; +import { addTypes } from './addTypes.js'; +import { MapperKind } from './Interfaces.js'; +import { correctASTNodes, mapSchema } from './mapSchema.js'; +export function appendObjectFields(schema, typeName, additionalFields) { + if (schema.getType(typeName) == null) { + return addTypes(schema, [ + new GraphQLObjectType({ + name: typeName, + fields: additionalFields, + }), + ]); + } + return mapSchema(schema, { + [MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + newFieldConfigMap[fieldName] = originalFieldConfigMap[fieldName]; + } + for (const fieldName in additionalFields) { + newFieldConfigMap[fieldName] = additionalFields[fieldName]; + } + return correctASTNodes(new GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + }, + }); +} +export function removeObjectFields(schema, typeName, testFn) { + const removedFields = {}; + const newSchema = mapSchema(schema, { + [MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + if (testFn(fieldName, originalFieldConfig)) { + removedFields[fieldName] = originalFieldConfig; + } + else { + newFieldConfigMap[fieldName] = originalFieldConfig; + } + } + return correctASTNodes(new GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + }, + }); + return [newSchema, removedFields]; +} +export function selectObjectFields(schema, typeName, testFn) { + const selectedFields = {}; + mapSchema(schema, { + [MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + if (testFn(fieldName, originalFieldConfig)) { + selectedFields[fieldName] = originalFieldConfig; + } + } + } + return undefined; + }, + }); + return selectedFields; +} +export function modifyObjectFields(schema, typeName, testFn, newFields) { + const removedFields = {}; + const newSchema = mapSchema(schema, { + [MapperKind.OBJECT_TYPE]: type => { + if (type.name === typeName) { + const config = type.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + if (testFn(fieldName, originalFieldConfig)) { + removedFields[fieldName] = originalFieldConfig; + } + else { + newFieldConfigMap[fieldName] = originalFieldConfig; + } + } + for (const fieldName in newFields) { + const fieldConfig = newFields[fieldName]; + newFieldConfigMap[fieldName] = fieldConfig; + } + return correctASTNodes(new GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + }, + }); + return [newSchema, removedFields]; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/filterSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/filterSchema.js new file mode 100644 index 00000000..8d2e3cad --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/filterSchema.js @@ -0,0 +1,64 @@ +import { GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, } from 'graphql'; +import { MapperKind, } from './Interfaces.js'; +import { mapSchema } from './mapSchema.js'; +export function filterSchema({ schema, typeFilter = () => true, fieldFilter = undefined, rootFieldFilter = undefined, objectFieldFilter = undefined, interfaceFieldFilter = undefined, inputObjectFieldFilter = undefined, argumentFilter = undefined, directiveFilter = undefined, enumValueFilter = undefined, }) { + const filteredSchema = mapSchema(schema, { + [MapperKind.QUERY]: (type) => filterRootFields(type, 'Query', rootFieldFilter, argumentFilter), + [MapperKind.MUTATION]: (type) => filterRootFields(type, 'Mutation', rootFieldFilter, argumentFilter), + [MapperKind.SUBSCRIPTION]: (type) => filterRootFields(type, 'Subscription', rootFieldFilter, argumentFilter), + [MapperKind.OBJECT_TYPE]: (type) => typeFilter(type.name, type) + ? filterElementFields(GraphQLObjectType, type, objectFieldFilter || fieldFilter, argumentFilter) + : null, + [MapperKind.INTERFACE_TYPE]: (type) => typeFilter(type.name, type) + ? filterElementFields(GraphQLInterfaceType, type, interfaceFieldFilter || fieldFilter, argumentFilter) + : null, + [MapperKind.INPUT_OBJECT_TYPE]: (type) => typeFilter(type.name, type) + ? filterElementFields(GraphQLInputObjectType, type, inputObjectFieldFilter || fieldFilter) + : null, + [MapperKind.UNION_TYPE]: (type) => typeFilter(type.name, type) ? undefined : null, + [MapperKind.ENUM_TYPE]: (type) => typeFilter(type.name, type) ? undefined : null, + [MapperKind.SCALAR_TYPE]: (type) => typeFilter(type.name, type) ? undefined : null, + [MapperKind.DIRECTIVE]: directive => directiveFilter && !directiveFilter(directive.name, directive) ? null : undefined, + [MapperKind.ENUM_VALUE]: (valueConfig, typeName, _schema, externalValue) => enumValueFilter && !enumValueFilter(typeName, externalValue, valueConfig) ? null : undefined, + }); + return filteredSchema; +} +function filterRootFields(type, operation, rootFieldFilter, argumentFilter) { + if (rootFieldFilter || argumentFilter) { + const config = type.toConfig(); + for (const fieldName in config.fields) { + const field = config.fields[fieldName]; + if (rootFieldFilter && !rootFieldFilter(operation, fieldName, config.fields[fieldName])) { + delete config.fields[fieldName]; + } + else if (argumentFilter && field.args) { + for (const argName in field.args) { + if (!argumentFilter(type.name, fieldName, argName, field.args[argName])) { + delete field.args[argName]; + } + } + } + } + return new GraphQLObjectType(config); + } + return type; +} +function filterElementFields(ElementConstructor, type, fieldFilter, argumentFilter) { + if (fieldFilter || argumentFilter) { + const config = type.toConfig(); + for (const fieldName in config.fields) { + const field = config.fields[fieldName]; + if (fieldFilter && !fieldFilter(type.name, fieldName, config.fields[fieldName])) { + delete config.fields[fieldName]; + } + else if (argumentFilter && 'args' in field) { + for (const argName in field.args) { + if (!argumentFilter(type.name, fieldName, argName, field.args[argName])) { + delete field.args[argName]; + } + } + } + } + return new ElementConstructor(config); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fixSchemaAst.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fixSchemaAst.js new file mode 100644 index 00000000..4d698be0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/fixSchemaAst.js @@ -0,0 +1,22 @@ +import { buildASTSchema } from 'graphql'; +import { getDocumentNodeFromSchema } from './print-schema-with-directives.js'; +function buildFixedSchema(schema, options) { + const document = getDocumentNodeFromSchema(schema); + return buildASTSchema(document, { + ...(options || {}), + }); +} +export function fixSchemaAst(schema, options) { + // eslint-disable-next-line no-undef-init + let schemaWithValidAst = undefined; + if (!schema.astNode || !schema.extensionASTNodes) { + schemaWithValidAst = buildFixedSchema(schema, options); + } + if (!schema.astNode && schemaWithValidAst?.astNode) { + schema.astNode = schemaWithValidAst.astNode; + } + if (!schema.extensionASTNodes && schemaWithValidAst?.astNode) { + schema.extensionASTNodes = schemaWithValidAst.extensionASTNodes; + } + return schema; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachDefaultValue.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachDefaultValue.js new file mode 100644 index 00000000..7a42c192 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachDefaultValue.js @@ -0,0 +1,25 @@ +import { getNamedType, isInputObjectType, isObjectType } from 'graphql'; +export function forEachDefaultValue(schema, fn) { + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + const type = typeMap[typeName]; + if (!getNamedType(type).name.startsWith('__')) { + if (isObjectType(type)) { + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + for (const arg of field.args) { + arg.defaultValue = fn(arg.type, arg.defaultValue); + } + } + } + else if (isInputObjectType(type)) { + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + field.defaultValue = fn(field.type, field.defaultValue); + } + } + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachField.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachField.js new file mode 100644 index 00000000..81325819 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/forEachField.js @@ -0,0 +1,15 @@ +import { getNamedType, isObjectType } from 'graphql'; +export function forEachField(schema, fn) { + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + const type = typeMap[typeName]; + // TODO: maybe have an option to include these? + if (!getNamedType(type).name.startsWith('__') && isObjectType(type)) { + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + fn(field, typeName, fieldName); + } + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-arguments-with-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-arguments-with-directives.js new file mode 100644 index 00000000..94a8bc6c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-arguments-with-directives.js @@ -0,0 +1,28 @@ +import { Kind, valueFromASTUntyped, } from 'graphql'; +function isTypeWithFields(t) { + return t.kind === Kind.OBJECT_TYPE_DEFINITION || t.kind === Kind.OBJECT_TYPE_EXTENSION; +} +export function getArgumentsWithDirectives(documentNode) { + const result = {}; + const allTypes = documentNode.definitions.filter(isTypeWithFields); + for (const type of allTypes) { + if (type.fields == null) { + continue; + } + for (const field of type.fields) { + const argsWithDirectives = field.arguments?.filter(arg => arg.directives?.length); + if (!argsWithDirectives?.length) { + continue; + } + const typeFieldResult = (result[`${type.name.value}.${field.name.value}`] = {}); + for (const arg of argsWithDirectives) { + const directives = arg.directives.map(d => ({ + name: d.name.value, + args: (d.arguments || []).reduce((prev, dArg) => ({ ...prev, [dArg.name.value]: valueFromASTUntyped(dArg.value) }), {}), + })); + typeFieldResult[arg.name.value] = directives; + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-directives.js new file mode 100644 index 00000000..3117e49f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-directives.js @@ -0,0 +1,29 @@ +import { getDirectiveExtensions } from './getDirectiveExtensions.js'; +export function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = getDirectiveExtensions(node, undefined, pathToDirectivesInExtensions); + return Object.entries(directiveExtensions) + .map(([directiveName, directiveArgsArr]) => directiveArgsArr?.map(directiveArgs => ({ + name: directiveName, + args: directiveArgs, + }))) + .flat(Infinity) + .filter(Boolean); +} +export function getDirectiveInExtensions(node, directiveName, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = getDirectiveExtensions(node, undefined, pathToDirectivesInExtensions); + return directiveExtensions[directiveName]; +} +export function getDirectives(schema, node, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = getDirectiveExtensions(node, schema, pathToDirectivesInExtensions); + return Object.entries(directiveExtensions) + .map(([directiveName, directiveArgsArr]) => directiveArgsArr?.map(directiveArgs => ({ + name: directiveName, + args: directiveArgs, + }))) + .flat(Infinity) + .filter(Boolean); +} +export function getDirective(schema, node, directiveName, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = getDirectiveExtensions(node, schema, pathToDirectivesInExtensions); + return directiveExtensions[directiveName]; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-fields-with-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-fields-with-directives.js new file mode 100644 index 00000000..c8c9b623 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-fields-with-directives.js @@ -0,0 +1,27 @@ +import { valueFromASTUntyped, } from 'graphql'; +export function getFieldsWithDirectives(documentNode, options = {}) { + const result = {}; + let selected = ['ObjectTypeDefinition', 'ObjectTypeExtension']; + if (options.includeInputTypes) { + selected = [...selected, 'InputObjectTypeDefinition', 'InputObjectTypeExtension']; + } + const allTypes = documentNode.definitions.filter(obj => selected.includes(obj.kind)); + for (const type of allTypes) { + const typeName = type.name.value; + if (type.fields == null) { + continue; + } + for (const field of type.fields) { + if (field.directives && field.directives.length > 0) { + const fieldName = field.name.value; + const key = `${typeName}.${fieldName}`; + const directives = field.directives.map(d => ({ + name: d.name.value, + args: (d.arguments || []).reduce((prev, arg) => ({ ...prev, [arg.name.value]: valueFromASTUntyped(arg.value) }), {}), + })); + result[key] = directives; + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-implementing-types.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-implementing-types.js new file mode 100644 index 00000000..03d77a5c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/get-implementing-types.js @@ -0,0 +1,14 @@ +export function getImplementingTypes(interfaceName, schema) { + const allTypesMap = schema.getTypeMap(); + const result = []; + for (const graphqlTypeName in allTypesMap) { + const graphqlType = allTypesMap[graphqlTypeName]; + if ('getInterfaces' in graphqlType) { + const allInterfaces = graphqlType.getInterfaces(); + if (allInterfaces.find(int => int.name === interfaceName)) { + result.push(graphqlType.name); + } + } + } + return result; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getArgumentValues.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getArgumentValues.js new file mode 100644 index 00000000..5695bd6b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getArgumentValues.js @@ -0,0 +1,76 @@ +import { inspect } from 'cross-inspect'; +import { isNonNullType, Kind, print, valueFromAST, valueFromASTUntyped, } from 'graphql'; +import { createGraphQLError } from './errors.js'; +import { hasOwnProperty } from './jsutils.js'; +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export function getArgumentValues(def, node, variableValues = {}) { + const coercedValues = {}; + const argumentNodes = node.arguments ?? []; + const argNodeMap = argumentNodes.reduce((prev, arg) => ({ + ...prev, + [arg.name.value]: arg, + }), {}); + for (const arg of def.args) { + const argumentNode = argNodeMap[arg.name]; + if (!argumentNode) { + if ('default' in arg && arg.default) { + // graphql v17 + coercedValues[arg.name] = + 'value' in arg.default + ? arg.default.value + : valueFromASTUntyped(arg.default.literal); + } + else if (arg.defaultValue !== undefined) { + // graphql < v17 + coercedValues[arg.name] = arg.defaultValue; + } + else if (isNonNullType(arg.type)) { + throw createGraphQLError(`Argument "${arg.name}" of required type "${inspect(arg.type)}" ` + 'was not provided.', { + nodes: [node], + }); + } + continue; + } + const valueNode = argumentNode.value; + let isNull = valueNode.kind === Kind.NULL; + if (valueNode.kind === Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (variableValues == null || !hasOwnProperty(variableValues, variableName)) { + if (arg.defaultValue !== undefined) { + coercedValues[arg.name] = arg.defaultValue; + } + else if (isNonNullType(arg.type)) { + throw createGraphQLError(`Argument "${arg.name}" of required type "${inspect(arg.type)}" ` + + `was provided the variable "$${variableName}" which was not provided a runtime value.`, { + nodes: [valueNode], + }); + } + continue; + } + isNull = variableValues[variableName] == null; + } + if (isNull && isNonNullType(arg.type)) { + throw createGraphQLError(`Argument "${arg.name}" of non-null type "${inspect(arg.type)}" ` + 'must not be null.', { + nodes: [valueNode], + }); + } + const coercedValue = valueFromAST(valueNode, arg.type, variableValues); + if (coercedValue === undefined) { + // Note: ValuesOfCorrectTypeRule validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw createGraphQLError(`Argument "${arg.name}" has invalid value ${print(valueNode)}.`, { + nodes: [valueNode], + }); + } + coercedValues[arg.name] = coercedValue; + } + return coercedValues; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveExtensions.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveExtensions.js new file mode 100644 index 00000000..5d845634 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveExtensions.js @@ -0,0 +1,83 @@ +import { valueFromAST, valueFromASTUntyped } from 'graphql'; +import { getArgumentValues } from './getArgumentValues.js'; +import { memoize1 } from './memoize.js'; +export function getDirectiveExtensions(directableObj, schema, pathToDirectivesInExtensions = ['directives']) { + const directiveExtensions = {}; + if (directableObj.extensions) { + let directivesInExtensions = directableObj.extensions; + for (const pathSegment of pathToDirectivesInExtensions) { + directivesInExtensions = directivesInExtensions?.[pathSegment]; + } + if (directivesInExtensions != null) { + for (const directiveNameProp in directivesInExtensions) { + const directiveObjs = directivesInExtensions[directiveNameProp]; + const directiveName = directiveNameProp; + if (Array.isArray(directiveObjs)) { + for (const directiveObj of directiveObjs) { + let existingDirectiveExtensions = directiveExtensions[directiveName]; + if (!existingDirectiveExtensions) { + existingDirectiveExtensions = []; + directiveExtensions[directiveName] = existingDirectiveExtensions; + } + existingDirectiveExtensions.push(directiveObj); + } + } + else { + let existingDirectiveExtensions = directiveExtensions[directiveName]; + if (!existingDirectiveExtensions) { + existingDirectiveExtensions = []; + directiveExtensions[directiveName] = existingDirectiveExtensions; + } + existingDirectiveExtensions.push(directiveObjs); + } + } + } + } + const memoizedStringify = memoize1(obj => JSON.stringify(obj)); + const astNodes = []; + if (directableObj.astNode) { + astNodes.push(directableObj.astNode); + } + if (directableObj.extensionASTNodes) { + astNodes.push(...directableObj.extensionASTNodes); + } + for (const astNode of astNodes) { + if (astNode.directives?.length) { + for (const directive of astNode.directives) { + const directiveName = directive.name.value; + let existingDirectiveExtensions = directiveExtensions[directiveName]; + if (!existingDirectiveExtensions) { + existingDirectiveExtensions = []; + directiveExtensions[directiveName] = existingDirectiveExtensions; + } + const directiveInSchema = schema?.getDirective(directiveName); + let value = {}; + if (directiveInSchema) { + value = getArgumentValues(directiveInSchema, directive); + } + if (directive.arguments) { + for (const argNode of directive.arguments) { + const argName = argNode.name.value; + if (value[argName] == null) { + const argInDirective = directiveInSchema?.args.find(arg => arg.name === argName); + if (argInDirective) { + value[argName] = valueFromAST(argNode.value, argInDirective.type); + } + } + if (value[argName] == null) { + value[argName] = valueFromASTUntyped(argNode.value); + } + } + } + if (astNodes.length > 0 && existingDirectiveExtensions.length > 0) { + const valStr = memoizedStringify(value); + if (existingDirectiveExtensions.some(val => memoizedStringify(val) === valStr)) { + continue; + } + } + existingDirectiveExtensions.push(value); + } + } + } + return directiveExtensions; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveValues.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveValues.js new file mode 100644 index 00000000..a6bc301a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getDirectiveValues.js @@ -0,0 +1,12 @@ +import { getDirectiveValues as getDirectiveValuesOrig, versionInfo, } from 'graphql'; +/** + * GraphQL v17's getDirectiveValues function accepts `VariableValues` + * while older versions accept `Record`. This function wraps the original + * getDirectiveValues function to provide compatibility across versions. + */ +export function getDirectiveValues(directiveDef, node, variableValues) { + if (versionInfo.major >= 17) { + return getDirectiveValuesOrig(directiveDef, node, variableValues); + } + return getDirectiveValuesOrig(directiveDef, node, variableValues?.coerced); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getObjectTypeFromTypeMap.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getObjectTypeFromTypeMap.js new file mode 100644 index 00000000..ed471fcf --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getObjectTypeFromTypeMap.js @@ -0,0 +1,9 @@ +import { isObjectType } from 'graphql'; +export function getObjectTypeFromTypeMap(typeMap, type) { + if (type) { + const maybeObjectType = typeMap[type.name]; + if (isObjectType(maybeObjectType)) { + return maybeObjectType; + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getOperationASTFromRequest.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getOperationASTFromRequest.js new file mode 100644 index 00000000..bcb79bb1 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getOperationASTFromRequest.js @@ -0,0 +1,12 @@ +import { getOperationAST } from 'graphql'; +import { memoize1 } from './memoize.js'; +export function getOperationASTFromDocument(documentNode, operationName) { + const doc = getOperationAST(documentNode, operationName); + if (!doc) { + throw new Error(`Cannot infer operation ${operationName || ''}`); + } + return doc; +} +export const getOperationASTFromRequest = memoize1(function getOperationASTFromRequest(request) { + return getOperationASTFromDocument(request.document, request.operationName); +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResolversFromSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResolversFromSchema.js new file mode 100644 index 00000000..7310a126 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResolversFromSchema.js @@ -0,0 +1,68 @@ +import { GraphQLScalarType, isEnumType, isInterfaceType, isObjectType, isScalarType, isSpecifiedScalarType, isUnionType, } from 'graphql'; +export function getResolversFromSchema(schema, +// Include default merged resolvers +includeDefaultMergedResolver) { + const resolvers = Object.create(null); + const typeMap = schema.getTypeMap(); + for (const typeName in typeMap) { + if (!typeName.startsWith('__')) { + const type = typeMap[typeName]; + if (isScalarType(type)) { + if (!isSpecifiedScalarType(type)) { + const config = type.toConfig(); + delete config.astNode; // avoid AST duplication elsewhere + resolvers[typeName] = new GraphQLScalarType(config); + } + } + else if (isEnumType(type)) { + resolvers[typeName] = {}; + const values = type.getValues(); + for (const value of values) { + resolvers[typeName][value.name] = value.value; + } + } + else if (isInterfaceType(type)) { + if (type.resolveType != null) { + resolvers[typeName] = { + __resolveType: type.resolveType, + }; + } + } + else if (isUnionType(type)) { + if (type.resolveType != null) { + resolvers[typeName] = { + __resolveType: type.resolveType, + }; + } + } + else if (isObjectType(type)) { + resolvers[typeName] = {}; + if (type.isTypeOf != null) { + resolvers[typeName].__isTypeOf = type.isTypeOf; + } + const fields = type.getFields(); + for (const fieldName in fields) { + const field = fields[fieldName]; + if (field.subscribe != null) { + resolvers[typeName][fieldName] = resolvers[typeName][fieldName] || {}; + resolvers[typeName][fieldName].subscribe = field.subscribe; + } + if (field.resolve != null && field.resolve?.name !== 'defaultFieldResolver') { + switch (field.resolve?.name) { + case 'defaultMergedResolver': + if (!includeDefaultMergedResolver) { + continue; + } + break; + case 'defaultFieldResolver': + continue; + } + resolvers[typeName][fieldName] = resolvers[typeName][fieldName] || {}; + resolvers[typeName][fieldName].resolve = field.resolve; + } + } + } + } + } + return resolvers; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResponseKeyFromInfo.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResponseKeyFromInfo.js new file mode 100644 index 00000000..f2a3df29 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/getResponseKeyFromInfo.js @@ -0,0 +1,8 @@ +/** + * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just + * resolves aliases. + * @param info The info argument to the resolver. + */ +export function getResponseKeyFromInfo(info) { + return info.fieldNodes[0].alias != null ? info.fieldNodes[0].alias.value : info.fieldName; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/heal.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/heal.js new file mode 100644 index 00000000..f1784946 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/heal.js @@ -0,0 +1,176 @@ +import { GraphQLList, GraphQLNonNull, isInputObjectType, isInterfaceType, isLeafType, isListType, isNamedType, isNonNullType, isObjectType, isUnionType, } from 'graphql'; +// Update any references to named schema types that disagree with the named +// types found in schema.getTypeMap(). +// +// healSchema and its callers (visitSchema/visitSchemaDirectives) all modify the schema in place. +// Therefore, private variables (such as the stored implementation map and the proper root types) +// are not updated. +// +// If this causes issues, the schema could be more aggressively healed as follows: +// +// healSchema(schema); +// const config = schema.toConfig() +// const healedSchema = new GraphQLSchema({ +// ...config, +// query: schema.getType(''), +// mutation: schema.getType(''), +// subscription: schema.getType(''), +// }); +// +// One can then also -- if necessary -- assign the correct private variables to the initial schema +// as follows: +// Object.assign(schema, healedSchema); +// +// These steps are not taken automatically to preserve backwards compatibility with graphql-tools v4. +// See https://github.com/ardatan/graphql-tools/issues/1462 +// +// They were briefly taken in v5, but can now be phased out as they were only required when other +// areas of the codebase were using healSchema and visitSchema more extensively. +// +export function healSchema(schema) { + healTypes(schema.getTypeMap(), schema.getDirectives()); + return schema; +} +export function healTypes(originalTypeMap, directives) { + const actualNamedTypeMap = Object.create(null); + // If any of the .name properties of the GraphQLNamedType objects in + // schema.getTypeMap() have changed, the keys of the type map need to + // be updated accordingly. + for (const typeName in originalTypeMap) { + const namedType = originalTypeMap[typeName]; + if (namedType == null || typeName.startsWith('__')) { + continue; + } + const actualName = namedType.name; + if (actualName.startsWith('__')) { + continue; + } + if (actualNamedTypeMap[actualName] != null) { + console.warn(`Duplicate schema type name ${actualName} found; keeping the existing one found in the schema`); + continue; + } + actualNamedTypeMap[actualName] = namedType; + // Note: we are deliberately leaving namedType in the schema by its + // original name (which might be different from actualName), so that + // references by that name can be healed. + } + // Now add back every named type by its actual name. + for (const typeName in actualNamedTypeMap) { + const namedType = actualNamedTypeMap[typeName]; + originalTypeMap[typeName] = namedType; + } + // Directive declaration argument types can refer to named types. + for (const decl of directives) { + decl.args = decl.args.filter(arg => { + arg.type = healType(arg.type); + return arg.type !== null; + }); + } + for (const typeName in originalTypeMap) { + const namedType = originalTypeMap[typeName]; + // Heal all named types, except for dangling references, kept only to redirect. + if (!typeName.startsWith('__') && typeName in actualNamedTypeMap) { + if (namedType != null) { + healNamedType(namedType); + } + } + } + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__') && !(typeName in actualNamedTypeMap)) { + delete originalTypeMap[typeName]; + } + } + function healNamedType(type) { + if (isObjectType(type)) { + healFields(type); + healInterfaces(type); + return; + } + else if (isInterfaceType(type)) { + healFields(type); + if ('getInterfaces' in type) { + healInterfaces(type); + } + return; + } + else if (isUnionType(type)) { + healUnderlyingTypes(type); + return; + } + else if (isInputObjectType(type)) { + healInputFields(type); + return; + } + else if (isLeafType(type)) { + return; + } + throw new Error(`Unexpected schema type: ${type}`); + } + function healFields(type) { + const fieldMap = type.getFields(); + for (const [key, field] of Object.entries(fieldMap)) { + field.args + .map(arg => { + arg.type = healType(arg.type); + return arg.type === null ? null : arg; + }) + .filter(Boolean); + field.type = healType(field.type); + if (field.type === null) { + delete fieldMap[key]; + } + } + } + function healInterfaces(type) { + if ('getInterfaces' in type) { + const interfaces = type.getInterfaces(); + interfaces.push(...interfaces + .splice(0) + .map(iface => healType(iface)) + .filter(Boolean)); + } + } + function healInputFields(type) { + const fieldMap = type.getFields(); + for (const [key, field] of Object.entries(fieldMap)) { + field.type = healType(field.type); + if (field.type === null) { + delete fieldMap[key]; + } + } + } + function healUnderlyingTypes(type) { + const types = type.getTypes(); + types.push(...types + .splice(0) + .map(t => healType(t)) + .filter(Boolean)); + } + function healType(type) { + // Unwrap the two known wrapper types + if (isListType(type)) { + const healedType = healType(type.ofType); + return healedType != null ? new GraphQLList(healedType) : null; + } + else if (isNonNullType(type)) { + const healedType = healType(type.ofType); + return healedType != null + ? // FIXME: `healedType` needs `as any` as graphql@17 changes the type for `GraphQLType` + new GraphQLNonNull(healedType) + : null; + } + else if (isNamedType(type)) { + // If a type annotation on a field or an argument or a union member is + // any `GraphQLNamedType` with a `name`, then it must end up identical + // to `schema.getType(name)`, since `schema.getTypeMap()` is the source + // of truth for all named schema types. + // Note that new types can still be simply added by adding a field, as + // the official type will be undefined, not null. + const officialType = originalTypeMap[type.name]; + if (officialType && type !== officialType) { + return officialType; + } + } + return type; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/helpers.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/helpers.js new file mode 100644 index 00000000..3cadf707 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/helpers.js @@ -0,0 +1,122 @@ +import { parse } from 'graphql'; +const URL_REGEXP = /^(https?|wss?|file):\/\//; +/** + * Checks if the given string is a valid URL. + * + * @param str - The string to validate as a URL + * @returns A boolean indicating whether the string is a valid URL + * + * @remarks + * This function first attempts to use the `URL.canParse` method if available. + * If not, it falls back to creating a new `URL` object to validate the string. + */ +export function isUrl(str) { + if (typeof str !== 'string') { + return false; + } + if (!URL_REGEXP.test(str)) { + return false; + } + if (URL.canParse) { + return URL.canParse(str); + } + try { + const url = new URL(str); + return !!url; + } + catch (e) { + return false; + } +} +export const asArray = (fns) => (Array.isArray(fns) ? fns : fns ? [fns] : []); +const invalidDocRegex = /\.[a-z0-9]+$/i; +/** + * Determines if a given input is a valid GraphQL document string. + * + * @param str - The input to validate as a GraphQL document + * @returns A boolean indicating whether the input is a valid GraphQL document string + * + * @remarks + * This function performs several validation checks: + * - Ensures the input is a string + * - Filters out strings with invalid document extensions + * - Excludes URLs + * - Attempts to parse the string as a GraphQL document + * + * @throws {Error} If the document fails to parse and is empty except GraphQL comments + */ +export function isDocumentString(str) { + if (typeof str !== 'string') { + return false; + } + // XXX: is-valid-path or is-glob treat SDL as a valid path + // (`scalar Date` for example) + // this why checking the extension is fast enough + // and prevent from parsing the string in order to find out + // if the string is a SDL + if (invalidDocRegex.test(str) || isUrl(str)) { + return false; + } + try { + parse(str); + return true; + } + catch (e) { + if (!e.message.includes('EOF') && + str.replace(/(\#[^*]*)/g, '').trim() !== '' && + str.includes(' ')) { + throw new Error(`Failed to parse the GraphQL document. ${e.message}\n${str}`); + } + } + return false; +} +const invalidPathRegex = /[‘“!^<>`\n]/; +/** + * Checks whether the `str` contains any path illegal characters. + * + * A string may sometimes look like a path but is not (like an SDL of a simple + * GraphQL schema). To make sure we don't yield false-positives in such cases, + * we disallow new lines in paths (even though most Unix systems support new + * lines in file names). + */ +export function isValidPath(str) { + return typeof str === 'string' && !invalidPathRegex.test(str); +} +export function compareStrings(a, b) { + if (String(a) < String(b)) { + return -1; + } + if (String(a) > String(b)) { + return 1; + } + return 0; +} +export function nodeToString(a) { + let name; + if ('alias' in a) { + name = a.alias?.value; + } + if (name == null && 'name' in a) { + name = a.name?.value; + } + if (name == null) { + name = a.kind; + } + return name; +} +export function compareNodes(a, b, customFn) { + const aStr = nodeToString(a); + const bStr = nodeToString(b); + if (typeof customFn === 'function') { + return customFn(aStr, bStr); + } + return compareStrings(aStr, bStr); +} +export function isSome(input) { + return input != null; +} +export function assertSome(input, message = 'Value should be something') { + if (input == null) { + throw new Error(message); + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/implementsAbstractType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/implementsAbstractType.js new file mode 100644 index 00000000..044253a8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/implementsAbstractType.js @@ -0,0 +1,13 @@ +import { doTypesOverlap, isCompositeType } from 'graphql'; +export function implementsAbstractType(schema, typeA, typeB) { + if (typeB == null || typeA == null) { + return false; + } + else if (typeA === typeB) { + return true; + } + else if (isCompositeType(typeA) && isCompositeType(typeB)) { + return doTypesOverlap(schema, typeA, typeB); + } + return false; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/index.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/index.js new file mode 100644 index 00000000..01e89d85 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/index.js @@ -0,0 +1,60 @@ +export * from './loaders.js'; +export * from './helpers.js'; +export * from './get-directives.js'; +export * from './get-fields-with-directives.js'; +export * from './get-arguments-with-directives.js'; +export * from './get-implementing-types.js'; +export * from './print-schema-with-directives.js'; +export * from './get-fields-with-directives.js'; +export * from './validate-documents.js'; +export * from './parse-graphql-json.js'; +export * from './parse-graphql-sdl.js'; +export * from './build-operation-for-field.js'; +export * from './types.js'; +export * from './filterSchema.js'; +export * from './heal.js'; +export * from './getResolversFromSchema.js'; +export * from './forEachField.js'; +export * from './forEachDefaultValue.js'; +export * from './mapSchema.js'; +export * from './addTypes.js'; +export * from './rewire.js'; +export * from './prune.js'; +export * from './mergeDeep.js'; +export * from './Interfaces.js'; +export * from './stub.js'; +export * from './selectionSets.js'; +export * from './getResponseKeyFromInfo.js'; +export * from './fields.js'; +export * from './renameType.js'; +export * from './transformInputValue.js'; +export * from './updateArgument.js'; +export * from './astFromType.js'; +export * from './implementsAbstractType.js'; +export * from './errors.js'; +export * from './observableToAsyncIterable.js'; +export * from './visitResult.js'; +export * from './getArgumentValues.js'; +export * from './valueMatchesCriteria.js'; +export * from './isAsyncIterable.js'; +export * from './isDocumentNode.js'; +export * from './astFromValueUntyped.js'; +export * from './executor.js'; +export * from './withCancel.js'; +export * from './rootTypes.js'; +export * from './comments.js'; +export * from './collectFields.js'; +export { inspect } from 'cross-inspect'; +export * from './memoize.js'; +export * from './fixSchemaAst.js'; +export * from './getOperationASTFromRequest.js'; +export * from './extractExtensionsFromSchema.js'; +export * from './Path.js'; +export * from './jsutils.js'; +export * from './directives.js'; +export * from './mergeIncrementalResult.js'; +export * from './debugTimer.js'; +export * from './getDirectiveExtensions.js'; +export { mapAsyncIterator, mapMaybePromise, fakePromise, createDeferredPromise as createDeferred, } from '@whatwg-node/promise-helpers'; +export * from './registerAbortSignalListener.js'; +export * from './getDirectiveValues.js'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isAsyncIterable.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isAsyncIterable.js new file mode 100644 index 00000000..45a83789 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isAsyncIterable.js @@ -0,0 +1,3 @@ +export function isAsyncIterable(value) { + return value?.[Symbol.asyncIterator] != null; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isDocumentNode.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isDocumentNode.js new file mode 100644 index 00000000..5b8e83ad --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/isDocumentNode.js @@ -0,0 +1,4 @@ +import { Kind } from 'graphql'; +export function isDocumentNode(object) { + return object && typeof object === 'object' && 'kind' in object && object.kind === Kind.DOCUMENT; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/jsutils.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/jsutils.js new file mode 100644 index 00000000..98cf214d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/jsutils.js @@ -0,0 +1,18 @@ +import { handleMaybePromise, isPromise } from '@whatwg-node/promise-helpers'; +export function isIterableObject(value) { + return value != null && typeof value === 'object' && Symbol.iterator in value; +} +export function isObjectLike(value) { + return typeof value === 'object' && value !== null; +} +export { isPromise }; +export function promiseReduce(values, callbackFn, initialValue) { + let accumulator = initialValue; + for (const value of values) { + accumulator = handleMaybePromise(() => accumulator, resolved => callbackFn(resolved, value)); + } + return accumulator; +} +export function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/loaders.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/loaders.js new file mode 100644 index 00000000..e69de29b diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mapSchema.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mapSchema.js new file mode 100644 index 00000000..1172930a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mapSchema.js @@ -0,0 +1,467 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLSchema, isEnumType, isInputObjectType, isInterfaceType, isLeafType, isListType, isNamedType, isNonNullType, isObjectType, isScalarType, isUnionType, Kind, } from 'graphql'; +import { getObjectTypeFromTypeMap } from './getObjectTypeFromTypeMap.js'; +import { MapperKind, } from './Interfaces.js'; +import { rewireTypes } from './rewire.js'; +import { parseInputValue, serializeInputValue } from './transformInputValue.js'; +export function mapSchema(schema, schemaMapper = {}) { + const newTypeMap = mapArguments(mapFields(mapTypes(mapDefaultValues(mapEnumValues(mapTypes(mapDefaultValues(schema.getTypeMap(), schema, serializeInputValue), schema, schemaMapper, type => isLeafType(type)), schema, schemaMapper), schema, parseInputValue), schema, schemaMapper, type => !isLeafType(type)), schema, schemaMapper), schema, schemaMapper); + const originalDirectives = schema.getDirectives(); + const newDirectives = mapDirectives(originalDirectives, schema, schemaMapper); + const { typeMap, directives } = rewireTypes(newTypeMap, newDirectives); + return new GraphQLSchema({ + ...schema.toConfig(), + query: getObjectTypeFromTypeMap(typeMap, getObjectTypeFromTypeMap(newTypeMap, schema.getQueryType())), + mutation: getObjectTypeFromTypeMap(typeMap, getObjectTypeFromTypeMap(newTypeMap, schema.getMutationType())), + subscription: getObjectTypeFromTypeMap(typeMap, getObjectTypeFromTypeMap(newTypeMap, schema.getSubscriptionType())), + types: Object.values(typeMap), + directives, + }); +} +const builtinTypes = ['String', 'ID', 'Int', 'Float', 'Boolean']; +function mapTypes(originalTypeMap, schema, schemaMapper, testFn = () => true) { + const newTypeMap = {}; + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__') && !builtinTypes.includes(typeName)) { + const originalType = originalTypeMap[typeName]; + if (originalType == null || !testFn(originalType)) { + newTypeMap[typeName] = originalType; + continue; + } + const typeMapper = getTypeMapper(schema, schemaMapper, typeName); + if (typeMapper == null) { + newTypeMap[typeName] = originalType; + continue; + } + const maybeNewType = typeMapper(originalType, schema); + if (maybeNewType === undefined) { + newTypeMap[typeName] = originalType; + continue; + } + newTypeMap[typeName] = maybeNewType; + } + } + return newTypeMap; +} +function mapEnumValues(originalTypeMap, schema, schemaMapper) { + const enumValueMapper = getEnumValueMapper(schemaMapper); + if (!enumValueMapper) { + return originalTypeMap; + } + return mapTypes(originalTypeMap, schema, { + [MapperKind.ENUM_TYPE]: type => { + const config = type.toConfig(); + const originalEnumValueConfigMap = config.values; + const newEnumValueConfigMap = {}; + for (const externalValue in originalEnumValueConfigMap) { + const originalEnumValueConfig = originalEnumValueConfigMap[externalValue]; + const mappedEnumValue = enumValueMapper(originalEnumValueConfig, type.name, schema, externalValue); + if (mappedEnumValue === undefined) { + newEnumValueConfigMap[externalValue] = originalEnumValueConfig; + } + else if (Array.isArray(mappedEnumValue)) { + const [newExternalValue, newEnumValueConfig] = mappedEnumValue; + newEnumValueConfigMap[newExternalValue] = + newEnumValueConfig === undefined ? originalEnumValueConfig : newEnumValueConfig; + } + else if (mappedEnumValue !== null) { + newEnumValueConfigMap[externalValue] = mappedEnumValue; + } + } + return correctASTNodes(new GraphQLEnumType({ + ...config, + values: newEnumValueConfigMap, + })); + }, + }, type => isEnumType(type)); +} +function mapDefaultValues(originalTypeMap, schema, fn) { + const newTypeMap = mapArguments(originalTypeMap, schema, { + [MapperKind.ARGUMENT]: argumentConfig => { + if (argumentConfig.defaultValue === undefined) { + return argumentConfig; + } + const maybeNewType = getNewType(originalTypeMap, argumentConfig.type); + if (maybeNewType != null) { + return { + ...argumentConfig, + defaultValue: fn(maybeNewType, argumentConfig.defaultValue), + }; + } + }, + }); + return mapFields(newTypeMap, schema, { + [MapperKind.INPUT_OBJECT_FIELD]: inputFieldConfig => { + if (inputFieldConfig.defaultValue === undefined) { + return inputFieldConfig; + } + const maybeNewType = getNewType(newTypeMap, inputFieldConfig.type); + if (maybeNewType != null) { + return { + ...inputFieldConfig, + defaultValue: fn(maybeNewType, inputFieldConfig.defaultValue), + }; + } + }, + }); +} +function getNewType(newTypeMap, type) { + if (isListType(type)) { + const newType = getNewType(newTypeMap, type.ofType); + return newType != null ? new GraphQLList(newType) : null; + } + else if (isNonNullType(type)) { + const newType = getNewType(newTypeMap, type.ofType); + return newType != null ? new GraphQLNonNull(newType) : null; + } + else if (isNamedType(type)) { + const newType = newTypeMap[type.name]; + return newType != null ? newType : null; + } + return null; +} +function mapFields(originalTypeMap, schema, schemaMapper) { + const newTypeMap = {}; + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__')) { + const originalType = originalTypeMap[typeName]; + if (!isObjectType(originalType) && + !isInterfaceType(originalType) && + !isInputObjectType(originalType)) { + newTypeMap[typeName] = originalType; + continue; + } + const fieldMapper = getFieldMapper(schema, schemaMapper, typeName); + if (fieldMapper == null) { + newTypeMap[typeName] = originalType; + continue; + } + const config = originalType.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + const mappedField = fieldMapper(originalFieldConfig, fieldName, typeName, schema); + if (mappedField === undefined) { + newFieldConfigMap[fieldName] = originalFieldConfig; + } + else if (Array.isArray(mappedField)) { + const [newFieldName, newFieldConfig] = mappedField; + if (newFieldConfig.astNode != null) { + newFieldConfig.astNode = { + ...newFieldConfig.astNode, + name: { + ...newFieldConfig.astNode.name, + value: newFieldName, + }, + }; + } + newFieldConfigMap[newFieldName] = + newFieldConfig === undefined ? originalFieldConfig : newFieldConfig; + } + else if (mappedField !== null) { + newFieldConfigMap[fieldName] = mappedField; + } + } + if (isObjectType(originalType)) { + newTypeMap[typeName] = correctASTNodes(new GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + else if (isInterfaceType(originalType)) { + newTypeMap[typeName] = correctASTNodes(new GraphQLInterfaceType({ + ...config, + fields: newFieldConfigMap, + })); + } + else { + newTypeMap[typeName] = correctASTNodes(new GraphQLInputObjectType({ + ...config, + fields: newFieldConfigMap, + })); + } + } + } + return newTypeMap; +} +function mapArguments(originalTypeMap, schema, schemaMapper) { + const newTypeMap = {}; + for (const typeName in originalTypeMap) { + if (!typeName.startsWith('__')) { + const originalType = originalTypeMap[typeName]; + if (!isObjectType(originalType) && !isInterfaceType(originalType)) { + newTypeMap[typeName] = originalType; + continue; + } + const argumentMapper = getArgumentMapper(schemaMapper); + if (argumentMapper == null) { + newTypeMap[typeName] = originalType; + continue; + } + const config = originalType.toConfig(); + const originalFieldConfigMap = config.fields; + const newFieldConfigMap = {}; + for (const fieldName in originalFieldConfigMap) { + const originalFieldConfig = originalFieldConfigMap[fieldName]; + const originalArgumentConfigMap = originalFieldConfig.args; + if (originalArgumentConfigMap == null) { + newFieldConfigMap[fieldName] = originalFieldConfig; + continue; + } + const argumentNames = Object.keys(originalArgumentConfigMap); + if (!argumentNames.length) { + newFieldConfigMap[fieldName] = originalFieldConfig; + continue; + } + const newArgumentConfigMap = {}; + for (const argumentName of argumentNames) { + const originalArgumentConfig = originalArgumentConfigMap[argumentName]; + const mappedArgument = argumentMapper(originalArgumentConfig, fieldName, typeName, schema); + if (mappedArgument === undefined) { + newArgumentConfigMap[argumentName] = originalArgumentConfig; + } + else if (Array.isArray(mappedArgument)) { + const [newArgumentName, newArgumentConfig] = mappedArgument; + newArgumentConfigMap[newArgumentName] = newArgumentConfig; + } + else if (mappedArgument !== null) { + newArgumentConfigMap[argumentName] = mappedArgument; + } + } + newFieldConfigMap[fieldName] = { + ...originalFieldConfig, + args: newArgumentConfigMap, + }; + } + if (isObjectType(originalType)) { + newTypeMap[typeName] = new GraphQLObjectType({ + ...config, + fields: newFieldConfigMap, + }); + } + else if (isInterfaceType(originalType)) { + newTypeMap[typeName] = new GraphQLInterfaceType({ + ...config, + fields: newFieldConfigMap, + }); + } + else { + newTypeMap[typeName] = new GraphQLInputObjectType({ + ...config, + fields: newFieldConfigMap, + }); + } + } + } + return newTypeMap; +} +function mapDirectives(originalDirectives, schema, schemaMapper) { + const directiveMapper = getDirectiveMapper(schemaMapper); + if (directiveMapper == null) { + return originalDirectives.slice(); + } + const newDirectives = []; + for (const directive of originalDirectives) { + const mappedDirective = directiveMapper(directive, schema); + if (mappedDirective === undefined) { + newDirectives.push(directive); + } + else if (mappedDirective !== null) { + newDirectives.push(mappedDirective); + } + } + return newDirectives; +} +function getTypeSpecifiers(schema, typeName) { + const type = schema.getType(typeName); + const specifiers = [MapperKind.TYPE]; + if (isObjectType(type)) { + specifiers.push(MapperKind.COMPOSITE_TYPE, MapperKind.OBJECT_TYPE); + if (typeName === schema.getQueryType()?.name) { + specifiers.push(MapperKind.ROOT_OBJECT, MapperKind.QUERY); + } + else if (typeName === schema.getMutationType()?.name) { + specifiers.push(MapperKind.ROOT_OBJECT, MapperKind.MUTATION); + } + else if (typeName === schema.getSubscriptionType()?.name) { + specifiers.push(MapperKind.ROOT_OBJECT, MapperKind.SUBSCRIPTION); + } + } + else if (isInputObjectType(type)) { + specifiers.push(MapperKind.INPUT_OBJECT_TYPE); + } + else if (isInterfaceType(type)) { + specifiers.push(MapperKind.COMPOSITE_TYPE, MapperKind.ABSTRACT_TYPE, MapperKind.INTERFACE_TYPE); + } + else if (isUnionType(type)) { + specifiers.push(MapperKind.COMPOSITE_TYPE, MapperKind.ABSTRACT_TYPE, MapperKind.UNION_TYPE); + } + else if (isEnumType(type)) { + specifiers.push(MapperKind.ENUM_TYPE); + } + else if (isScalarType(type)) { + specifiers.push(MapperKind.SCALAR_TYPE); + } + return specifiers; +} +function getTypeMapper(schema, schemaMapper, typeName) { + const specifiers = getTypeSpecifiers(schema, typeName); + let typeMapper; + const stack = [...specifiers]; + while (!typeMapper && stack.length > 0) { + // It is safe to use the ! operator here as we check the length. + const next = stack.pop(); + typeMapper = schemaMapper[next]; + } + return typeMapper != null ? typeMapper : null; +} +function getFieldSpecifiers(schema, typeName) { + const type = schema.getType(typeName); + const specifiers = [MapperKind.FIELD]; + if (isObjectType(type)) { + specifiers.push(MapperKind.COMPOSITE_FIELD, MapperKind.OBJECT_FIELD); + if (typeName === schema.getQueryType()?.name) { + specifiers.push(MapperKind.ROOT_FIELD, MapperKind.QUERY_ROOT_FIELD); + } + else if (typeName === schema.getMutationType()?.name) { + specifiers.push(MapperKind.ROOT_FIELD, MapperKind.MUTATION_ROOT_FIELD); + } + else if (typeName === schema.getSubscriptionType()?.name) { + specifiers.push(MapperKind.ROOT_FIELD, MapperKind.SUBSCRIPTION_ROOT_FIELD); + } + } + else if (isInterfaceType(type)) { + specifiers.push(MapperKind.COMPOSITE_FIELD, MapperKind.INTERFACE_FIELD); + } + else if (isInputObjectType(type)) { + specifiers.push(MapperKind.INPUT_OBJECT_FIELD); + } + return specifiers; +} +function getFieldMapper(schema, schemaMapper, typeName) { + const specifiers = getFieldSpecifiers(schema, typeName); + let fieldMapper; + const stack = [...specifiers]; + while (!fieldMapper && stack.length > 0) { + // It is safe to use the ! operator here as we check the length. + const next = stack.pop(); + // TODO: fix this as unknown cast + fieldMapper = schemaMapper[next]; + } + return fieldMapper ?? null; +} +function getArgumentMapper(schemaMapper) { + const argumentMapper = schemaMapper[MapperKind.ARGUMENT]; + return argumentMapper != null ? argumentMapper : null; +} +function getDirectiveMapper(schemaMapper) { + const directiveMapper = schemaMapper[MapperKind.DIRECTIVE]; + return directiveMapper != null ? directiveMapper : null; +} +function getEnumValueMapper(schemaMapper) { + const enumValueMapper = schemaMapper[MapperKind.ENUM_VALUE]; + return enumValueMapper != null ? enumValueMapper : null; +} +export function correctASTNodes(type) { + if (isObjectType(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const fields = []; + for (const fieldName in config.fields) { + const fieldConfig = config.fields[fieldName]; + if (fieldConfig.astNode != null) { + fields.push(fieldConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + kind: Kind.OBJECT_TYPE_DEFINITION, + fields, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + kind: Kind.OBJECT_TYPE_EXTENSION, + fields: undefined, + })); + } + return new GraphQLObjectType(config); + } + else if (isInterfaceType(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const fields = []; + for (const fieldName in config.fields) { + const fieldConfig = config.fields[fieldName]; + if (fieldConfig.astNode != null) { + fields.push(fieldConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + kind: Kind.INTERFACE_TYPE_DEFINITION, + fields, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + kind: Kind.INTERFACE_TYPE_EXTENSION, + fields: undefined, + })); + } + return new GraphQLInterfaceType(config); + } + else if (isInputObjectType(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const fields = []; + for (const fieldName in config.fields) { + const fieldConfig = config.fields[fieldName]; + if (fieldConfig.astNode != null) { + fields.push(fieldConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, + fields, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + kind: Kind.INPUT_OBJECT_TYPE_EXTENSION, + fields: undefined, + })); + } + return new GraphQLInputObjectType(config); + } + else if (isEnumType(type)) { + const config = type.toConfig(); + if (config.astNode != null) { + const values = []; + for (const enumKey in config.values) { + const enumValueConfig = config.values[enumKey]; + if (enumValueConfig.astNode != null) { + values.push(enumValueConfig.astNode); + } + } + config.astNode = { + ...config.astNode, + values, + }; + } + if (config.extensionASTNodes != null) { + config.extensionASTNodes = config.extensionASTNodes.map(node => ({ + ...node, + values: undefined, + })); + } + return new GraphQLEnumType(config); + } + else { + return type; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/memoize.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/memoize.js new file mode 100644 index 00000000..71ebd6cc --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/memoize.js @@ -0,0 +1,200 @@ +export function memoize1(fn) { + const memoize1cache = new WeakMap(); + return function memoized(a1) { + const cachedValue = memoize1cache.get(a1); + if (cachedValue === undefined) { + const newValue = fn(a1); + memoize1cache.set(a1, newValue); + return newValue; + } + return cachedValue; + }; +} +export function memoize2(fn) { + const memoize2cache = new WeakMap(); + return function memoized(a1, a2) { + let cache2 = memoize2cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize2cache.set(a1, cache2); + const newValue = fn(a1, a2); + cache2.set(a2, newValue); + return newValue; + } + const cachedValue = cache2.get(a2); + if (cachedValue === undefined) { + const newValue = fn(a1, a2); + cache2.set(a2, newValue); + return newValue; + } + return cachedValue; + }; +} +export function memoize3(fn) { + const memoize3Cache = new WeakMap(); + return function memoized(a1, a2, a3) { + let cache2 = memoize3Cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize3Cache.set(a1, cache2); + const cache3 = new WeakMap(); + cache2.set(a2, cache3); + const newValue = fn(a1, a2, a3); + cache3.set(a3, newValue); + return newValue; + } + let cache3 = cache2.get(a2); + if (!cache3) { + cache3 = new WeakMap(); + cache2.set(a2, cache3); + const newValue = fn(a1, a2, a3); + cache3.set(a3, newValue); + return newValue; + } + const cachedValue = cache3.get(a3); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3); + cache3.set(a3, newValue); + return newValue; + } + return cachedValue; + }; +} +export function memoize4(fn) { + const memoize4Cache = new WeakMap(); + return function memoized(a1, a2, a3, a4) { + let cache2 = memoize4Cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize4Cache.set(a1, cache2); + const cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + let cache3 = cache2.get(a2); + if (!cache3) { + cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + const cache4 = cache3.get(a3); + if (!cache4) { + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + const cachedValue = cache4.get(a4); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4); + cache4.set(a4, newValue); + return newValue; + } + return cachedValue; + }; +} +export function memoize5(fn) { + const memoize5Cache = new WeakMap(); + return function memoized(a1, a2, a3, a4, a5) { + let cache2 = memoize5Cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize5Cache.set(a1, cache2); + const cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + let cache3 = cache2.get(a2); + if (!cache3) { + cache3 = new WeakMap(); + cache2.set(a2, cache3); + const cache4 = new WeakMap(); + cache3.set(a3, cache4); + const cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + let cache4 = cache3.get(a3); + if (!cache4) { + cache4 = new WeakMap(); + cache3.set(a3, cache4); + const cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + let cache5 = cache4.get(a4); + if (!cache5) { + cache5 = new WeakMap(); + cache4.set(a4, cache5); + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + const cachedValue = cache5.get(a5); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4, a5); + cache5.set(a5, newValue); + return newValue; + } + return cachedValue; + }; +} +export function memoize2of4(fn) { + const memoize2of4cache = new WeakMap(); + return function memoized(a1, a2, a3, a4) { + let cache2 = memoize2of4cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize2of4cache.set(a1, cache2); + const newValue = fn(a1, a2, a3, a4); + cache2.set(a2, newValue); + return newValue; + } + const cachedValue = cache2.get(a2); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4); + cache2.set(a2, newValue); + return newValue; + } + return cachedValue; + }; +} +export function memoize2of5(fn) { + const memoize2of4cache = new WeakMap(); + return function memoized(a1, a2, a3, a4, a5) { + let cache2 = memoize2of4cache.get(a1); + if (!cache2) { + cache2 = new WeakMap(); + memoize2of4cache.set(a1, cache2); + const newValue = fn(a1, a2, a3, a4, a5); + cache2.set(a2, newValue); + return newValue; + } + const cachedValue = cache2.get(a2); + if (cachedValue === undefined) { + const newValue = fn(a1, a2, a3, a4, a5); + cache2.set(a2, newValue); + return newValue; + } + return cachedValue; + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeDeep.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeDeep.js new file mode 100644 index 00000000..82b989e8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeDeep.js @@ -0,0 +1,105 @@ +import { isSome } from './helpers.js'; +export function mergeDeep(sources, respectPrototype = false, respectArrays = false, respectArrayLength = false, respectNonEnumerableSymbols = false) { + if (sources.length === 0) { + return; + } + if (sources.length === 1) { + return sources[0]; + } + let expectedLength; + let allArrays = true; + const areArraysInTheSameLength = sources.every(source => { + if (Array.isArray(source)) { + if (expectedLength === undefined) { + expectedLength = source.length; + return true; + } + else if (expectedLength === source.length) { + return true; + } + } + else { + allArrays = false; + } + return false; + }); + if (respectArrayLength && areArraysInTheSameLength) { + return new Array(expectedLength).fill(null).map((_, index) => mergeDeep(sources.map(source => source[index]), respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols)); + } + if (allArrays) { + return sources.flat(1); + } + let output; + let firstObjectSource; + if (respectPrototype) { + firstObjectSource = sources.find(source => isObject(source)); + if (firstObjectSource) { + if (output == null) { + output = {}; + } + Object.setPrototypeOf(output, Object.create(Object.getPrototypeOf(firstObjectSource))); + } + } + for (const source of sources) { + if (source === undefined) { + continue; + } + if (isObject(source)) { + if (output == null) { + output = {}; + } + if (firstObjectSource) { + const outputPrototype = Object.getPrototypeOf(output); + const sourcePrototype = Object.getPrototypeOf(source); + if (sourcePrototype) { + for (const key of Object.getOwnPropertyNames(sourcePrototype)) { + const descriptor = Object.getOwnPropertyDescriptor(sourcePrototype, key); + if (isSome(descriptor)) { + Object.defineProperty(outputPrototype, key, descriptor); + } + } + } + } + for (const key in source) { + // never let a source key reach the prototype chain + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + continue; + } + // An own key present with value `undefined` is an explicit override and must win, + // distinct from the key being altogether absent from `source`. Assigning directly + // (rather than recursing through mergeDeep) avoids the top-level `source === undefined` + // skip above, which would otherwise silently discard this override and keep the prior + // value. + if (Object.prototype.hasOwnProperty.call(output, key) && source[key] !== undefined) { + output[key] = mergeDeep([output[key], source[key]], respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols); + } + else { + output[key] = source[key]; + } + } + if (respectNonEnumerableSymbols && output != null) { + for (const sym of Object.getOwnPropertySymbols(source)) { + const descriptor = Object.getOwnPropertyDescriptor(source, sym); + if (!descriptor.enumerable) { + Object.defineProperty(output, sym, descriptor); + } + } + } + } + else if (Array.isArray(source)) { + if (!Array.isArray(output)) { + output = source; + } + else { + output = mergeDeep([output, source], respectPrototype, respectArrays, respectArrayLength); + } + } + else { + output = source; + } + } + return output; +} +function isObject(item) { + return item && typeof item === 'object' && !Array.isArray(item); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeIncrementalResult.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeIncrementalResult.js new file mode 100644 index 00000000..7ba3fda9 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/mergeIncrementalResult.js @@ -0,0 +1,50 @@ +import { mergeDeep } from './mergeDeep.js'; +export function mergeIncrementalResult({ incrementalResult, executionResult, }) { + const path = ['data', ...(incrementalResult.path ?? [])]; + if (incrementalResult.items) { + for (const item of incrementalResult.items) { + setObjectKeyPath(executionResult, path, item); + // Increment the last path segment (the array index) to merge the next item at the next index + path[path.length - 1]++; + } + } + if (incrementalResult.data) { + setObjectKeyPath(executionResult, path, incrementalResult.data); + } + if (incrementalResult.errors) { + executionResult.errors = executionResult.errors || []; + executionResult.errors.push(...incrementalResult.errors); + } + if (incrementalResult.extensions) { + setObjectKeyPath(executionResult, ['extensions'], incrementalResult.extensions); + } + if (incrementalResult.incremental) { + incrementalResult.incremental.forEach(incrementalSubResult => { + mergeIncrementalResult({ + incrementalResult: incrementalSubResult, + executionResult, + }); + }); + } +} +function setObjectKeyPath(obj, keyPath, value) { + let current = obj; + let i; + for (i = 0; i < keyPath.length - 1; i++) { + const key = keyPath[i]; + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return; + } + if (current[key] == null) { + // Determine if the next key is a number to create an array, otherwise create an object + current[key] = typeof keyPath[i + 1] === 'number' ? [] : {}; + } + current = current[key]; + } + const finalKey = keyPath[i]; + if (finalKey === '__proto__' || finalKey === 'constructor' || finalKey === 'prototype') { + return; + } + const existingValue = current[finalKey]; + current[finalKey] = existingValue != null ? mergeDeep([existingValue, value]) : value; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/observableToAsyncIterable.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/observableToAsyncIterable.js new file mode 100644 index 00000000..f416d68b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/observableToAsyncIterable.js @@ -0,0 +1,94 @@ +import { fakePromise, fakeRejectPromise } from '@whatwg-node/promise-helpers'; +export function observableToAsyncIterable(observable) { + const pullQueue = []; + const pushQueue = []; + let listening = true; + const subscriptionRef = {}; + const emptyQueue = () => { + if (listening) { + listening = false; + subscriptionRef.current?.unsubscribe(); + for (const resolve of pullQueue) { + resolve({ value: undefined, done: true }); + } + pullQueue.length = 0; + pushQueue.length = 0; + } + }; + const pushValue = (value) => { + if (pullQueue.length !== 0) { + // It is safe to use the ! operator here as we check the length. + pullQueue.shift()({ value, done: false }); + } + else { + pushQueue.push({ value, done: false }); + } + }; + const pushError = (error) => { + if (pullQueue.length !== 0) { + // It is safe to use the ! operator here as we check the length. + pullQueue.shift()({ value: { errors: [error] }, done: false }); + } + else { + pushQueue.push({ value: { errors: [error] }, done: false }); + } + }; + const pushDone = () => { + if (pullQueue.length !== 0) { + // It is safe to use the ! operator here as we check the length. + pullQueue.shift()({ value: undefined, done: true }); + // Release queues/subscription after signaling done to the pending consumer. + emptyQueue(); + } + else { + pushQueue.push({ value: undefined, done: true }); + } + }; + const pullValue = () => new Promise(resolve => { + if (pushQueue.length !== 0) { + const element = pushQueue.shift(); + // either {value: {errors: [...]}} or {value: ...} + if (element.done) { + // Release references before delivering the done signal. + emptyQueue(); + } + resolve(element); + } + else { + pullQueue.push(resolve); + } + }); + subscriptionRef.current = observable.subscribe({ + next(value) { + return pushValue(value); + }, + error(err) { + return pushError(err); + }, + complete() { + return pushDone(); + }, + }); + // complete() may run synchronously inside subscribe() before it returns; + // unsubscribe the returned subscription in that case. + if (!listening) { + subscriptionRef.current.unsubscribe(); + } + return { + next() { + // return is a defined method, so it is safe to call it. + return listening ? pullValue() : this.return(); + }, + return() { + emptyQueue(); + return fakePromise({ value: undefined, done: true }); + }, + throw(error) { + emptyQueue(); + return fakeRejectPromise(error); + }, + [Symbol.asyncIterator]() { + return this; + }, + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-json.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-json.js new file mode 100644 index 00000000..6c53157e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-json.js @@ -0,0 +1,40 @@ +import { buildClientSchema } from 'graphql'; +function stripBOM(content) { + content = content.toString(); + // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + // because the buffer-to-string conversion in `fs.readFileSync()` + // translates it to FEFF, the UTF-16 BOM. + if (content.charCodeAt(0) === 0xfeff) { + content = content.slice(1); + } + return content; +} +function parseBOM(content) { + return JSON.parse(stripBOM(content)); +} +export function parseGraphQLJSON(location, jsonContent, options) { + let parsedJson = parseBOM(jsonContent); + if (parsedJson.data) { + parsedJson = parsedJson.data; + } + if (parsedJson.kind === 'Document') { + return { + location, + document: parsedJson, + }; + } + else if (parsedJson.__schema) { + const schema = buildClientSchema(parsedJson, options); + return { + location, + schema, + }; + } + else if (typeof parsedJson === 'string') { + return { + location, + rawSDL: parsedJson, + }; + } + throw new Error(`Not valid JSON content`); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-sdl.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-sdl.js new file mode 100644 index 00000000..ad3d412a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/parse-graphql-sdl.js @@ -0,0 +1,78 @@ +import { Source as GraphQLSource, isTypeSystemDefinitionNode, Kind, parse, print, visit, } from 'graphql'; +import { dedentBlockStringValue, getLeadingCommentBlock } from './comments.js'; +export function parseGraphQLSDL(location, rawSDL, options = {}) { + let document; + try { + if (options.commentDescriptions && rawSDL.includes('#')) { + document = transformCommentsToDescriptions(rawSDL, options); + // If noLocation=true, we need to make sure to print and parse it again, to remove locations, + // since `transformCommentsToDescriptions` must have locations set in order to transform the comments + // into descriptions. + if (options.noLocation) { + document = parse(print(document), options); + } + } + else { + document = parse(new GraphQLSource(rawSDL, location), options); + } + } + catch (e) { + if (e.message.includes('EOF') && rawSDL.replace(/(\#[^*]*)/g, '').trim() === '') { + document = { + kind: Kind.DOCUMENT, + definitions: [], + }; + } + else { + throw e; + } + } + return { + location, + document, + }; +} +export function transformCommentsToDescriptions(sourceSdl, options = {}) { + const parsedDoc = parse(sourceSdl, { + ...options, + noLocation: false, + }); + const modifiedDoc = visit(parsedDoc, { + leave: (node) => { + if (isDescribable(node)) { + const rawValue = getLeadingCommentBlock(node); + if (rawValue !== undefined) { + const commentsBlock = dedentBlockStringValue('\n' + rawValue); + const isBlock = commentsBlock.includes('\n'); + if (!node.description) { + return { + ...node, + description: { + kind: Kind.STRING, + value: commentsBlock, + block: isBlock, + }, + }; + } + else { + return { + ...node, + description: { + ...node.description, + value: node.description.value + '\n' + commentsBlock, + block: true, + }, + }; + } + } + } + }, + }); + return modifiedDoc; +} +export function isDescribable(node) { + return (isTypeSystemDefinitionNode(node) || + node.kind === Kind.FIELD_DEFINITION || + node.kind === Kind.INPUT_VALUE_DEFINITION || + node.kind === Kind.ENUM_VALUE_DEFINITION); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js new file mode 100644 index 00000000..c5d7195d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js @@ -0,0 +1,366 @@ +import { GraphQLDeprecatedDirective, isEnumType, isInputObjectType, isInterfaceType, isIntrospectionType, isObjectType, isScalarType, isSpecifiedDirective, isSpecifiedScalarType, isUnionType, Kind, print, specifiedDirectives, } from 'graphql'; +import { astFromType } from './astFromType.js'; +import { astFromValue } from './astFromValue.js'; +import { astFromValueUntyped } from './astFromValueUntyped.js'; +import { defaultValueAstFromType } from './defaultValueAstFromType.js'; +import { getDescriptionNode } from './descriptionFromObject.js'; +import { getDirectivesInExtensions, } from './get-directives.js'; +import { isSome } from './helpers.js'; +import { getRootTypeMap } from './rootTypes.js'; +export function getDocumentNodeFromSchema(schema, options = {}) { + const pathToDirectivesInExtensions = options.pathToDirectivesInExtensions; + const typesMap = schema.getTypeMap(); + const schemaNode = astFromSchema(schema, pathToDirectivesInExtensions); + const definitions = schemaNode != null ? [schemaNode] : []; + const directives = schema.getDirectives(); + for (const directive of directives) { + if (isSpecifiedDirective(directive)) { + continue; + } + definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions)); + } + for (const typeName in typesMap) { + const type = typesMap[typeName]; + const isPredefinedScalar = isSpecifiedScalarType(type); + const isIntrospection = isIntrospectionType(type); + if (isPredefinedScalar || isIntrospection) { + continue; + } + if (isObjectType(type)) { + definitions.push(astFromObjectType(type, schema, pathToDirectivesInExtensions)); + } + else if (isInterfaceType(type)) { + definitions.push(astFromInterfaceType(type, schema, pathToDirectivesInExtensions)); + } + else if (isUnionType(type)) { + definitions.push(astFromUnionType(type, schema, pathToDirectivesInExtensions)); + } + else if (isInputObjectType(type)) { + definitions.push(astFromInputObjectType(type, schema, pathToDirectivesInExtensions)); + } + else if (isEnumType(type)) { + definitions.push(astFromEnumType(type, schema, pathToDirectivesInExtensions)); + } + else if (isScalarType(type)) { + definitions.push(astFromScalarType(type, schema, pathToDirectivesInExtensions)); + } + else { + throw new Error(`Unknown type ${type}.`); + } + } + return { + kind: Kind.DOCUMENT, + definitions, + }; +} +// this approach uses the default schema printer rather than a custom solution, so may be more backwards compatible +// currently does not allow customization of printSchema options having to do with comments. +export function printSchemaWithDirectives(schema, options = {}) { + const documentNode = getDocumentNodeFromSchema(schema, options); + return print(documentNode); +} +export function astFromSchema(schema, pathToDirectivesInExtensions) { + const operationTypeMap = new Map([ + ['query', undefined], + ['mutation', undefined], + ['subscription', undefined], + ]); + const nodes = []; + if (schema.astNode != null) { + nodes.push(schema.astNode); + } + if (schema.extensionASTNodes != null) { + for (const extensionASTNode of schema.extensionASTNodes) { + nodes.push(extensionASTNode); + } + } + for (const node of nodes) { + if (node.operationTypes) { + for (const operationTypeDefinitionNode of node.operationTypes) { + operationTypeMap.set(operationTypeDefinitionNode.operation, operationTypeDefinitionNode); + } + } + } + const rootTypeMap = getRootTypeMap(schema); + for (const [operationTypeNode, operationTypeDefinitionNode] of operationTypeMap) { + const rootType = rootTypeMap.get(operationTypeNode); + if (rootType != null) { + const rootTypeAST = astFromType(rootType); + if (operationTypeDefinitionNode != null) { + operationTypeDefinitionNode.type = rootTypeAST; + } + else { + operationTypeMap.set(operationTypeNode, { + kind: Kind.OPERATION_TYPE_DEFINITION, + operation: operationTypeNode, + type: rootTypeAST, + }); + } + } + else { + // Drop operation types that no longer exist on the schema (e.g. after pruneSchema). + operationTypeMap.set(operationTypeNode, undefined); + } + } + const operationTypes = [...operationTypeMap.values()].filter(isSome); + const directives = getDirectiveNodes(schema, schema, pathToDirectivesInExtensions); + if (!operationTypes.length && !directives.length) { + return null; + } + const schemaNode = { + kind: operationTypes.length ? Kind.SCHEMA_DEFINITION : Kind.SCHEMA_EXTENSION, + operationTypes, + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: directives, + }; + const descriptionNode = getDescriptionNode(schema); + if (descriptionNode) { + schemaNode.description = descriptionNode; + } + return schemaNode; +} +export function astFromDirective(directive, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.DIRECTIVE_DEFINITION, + description: getDescriptionNode(directive), + name: { + kind: Kind.NAME, + value: directive.name, + }, + arguments: directive.args?.map(arg => astFromArg(arg, schema, pathToDirectivesInExtensions)), + repeatable: directive.isRepeatable, + locations: directive.locations?.map(location => ({ + kind: Kind.NAME, + value: location, + })) || [], + }; +} +export function getDirectiveNodes(entity, schema, pathToDirectivesInExtensions) { + let directiveNodesBesidesNativeDirectives = []; + const directivesInExtensions = getDirectivesInExtensions(entity, pathToDirectivesInExtensions); + let directives; + if (directivesInExtensions != null) { + directives = makeDirectiveNodes(schema, directivesInExtensions); + } + let deprecatedDirectiveNode = null; + let specifiedByDirectiveNode = null; + let oneOfDirectiveNode = null; + if (directives != null) { + directiveNodesBesidesNativeDirectives = directives.filter(directive => specifiedDirectives.every(specifiedDirective => specifiedDirective.name !== directive.name.value)); + deprecatedDirectiveNode = directives.find(directive => directive.name.value === 'deprecated'); + specifiedByDirectiveNode = directives.find(directive => directive.name.value === 'specifiedBy'); + oneOfDirectiveNode = directives.find(directive => directive.name.value === 'oneOf'); + } + if (entity.deprecationReason != null && deprecatedDirectiveNode == null) { + deprecatedDirectiveNode = makeDeprecatedDirective(entity.deprecationReason); + } + if (entity.specifiedByUrl != null || + (entity.specifiedByURL != null && specifiedByDirectiveNode == null)) { + const specifiedByValue = entity.specifiedByUrl || entity.specifiedByURL; + const specifiedByArgs = { + url: specifiedByValue, + }; + specifiedByDirectiveNode = makeDirectiveNode('specifiedBy', specifiedByArgs); + } + if (entity.isOneOf && oneOfDirectiveNode == null) { + oneOfDirectiveNode = makeDirectiveNode('oneOf'); + } + if (deprecatedDirectiveNode != null) { + directiveNodesBesidesNativeDirectives.push(deprecatedDirectiveNode); + } + if (specifiedByDirectiveNode != null) { + directiveNodesBesidesNativeDirectives.push(specifiedByDirectiveNode); + } + if (oneOfDirectiveNode != null) { + directiveNodesBesidesNativeDirectives.push(oneOfDirectiveNode); + } + return directiveNodesBesidesNativeDirectives; +} +export function astFromArg(arg, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.INPUT_VALUE_DEFINITION, + description: getDescriptionNode(arg), + name: { + kind: Kind.NAME, + value: arg.name, + }, + type: astFromType(arg.type), + defaultValue: defaultValueAstFromType(arg), + directives: getDirectiveNodes(arg, schema, pathToDirectivesInExtensions), + }; +} +export function astFromObjectType(type, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.OBJECT_TYPE_DEFINITION, + description: getDescriptionNode(type), + name: { + kind: Kind.NAME, + value: type.name, + }, + fields: Object.values(type.getFields()).map(field => astFromField(field, schema, pathToDirectivesInExtensions)), + interfaces: Object.values(type.getInterfaces()).map(iFace => astFromType(iFace)), + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; +} +export function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) { + const node = { + kind: Kind.INTERFACE_TYPE_DEFINITION, + description: getDescriptionNode(type), + name: { + kind: Kind.NAME, + value: type.name, + }, + fields: Object.values(type.getFields()).map(field => astFromField(field, schema, pathToDirectivesInExtensions)), + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; + if ('getInterfaces' in type) { + node.interfaces = Object.values(type.getInterfaces()).map(iFace => astFromType(iFace)); + } + return node; +} +export function astFromUnionType(type, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.UNION_TYPE_DEFINITION, + description: getDescriptionNode(type), + name: { + kind: Kind.NAME, + value: type.name, + }, + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + types: type.getTypes().map(type => astFromType(type)), + }; +} +export function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, + description: getDescriptionNode(type), + name: { + kind: Kind.NAME, + value: type.name, + }, + fields: Object.values(type.getFields()).map(field => astFromInputField(field, schema, pathToDirectivesInExtensions)), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; +} +export function astFromEnumType(type, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.ENUM_TYPE_DEFINITION, + description: getDescriptionNode(type), + name: { + kind: Kind.NAME, + value: type.name, + }, + values: Object.values(type.getValues()).map(value => astFromEnumValue(value, schema, pathToDirectivesInExtensions)), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions), + }; +} +export function astFromScalarType(type, schema, pathToDirectivesInExtensions) { + const directivesInExtensions = getDirectivesInExtensions(type, pathToDirectivesInExtensions); + const directives = makeDirectiveNodes(schema, directivesInExtensions); + const specifiedByValue = (type['specifiedByUrl'] || + type['specifiedByURL']); + if (specifiedByValue && + !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) { + const specifiedByArgs = { + url: specifiedByValue, + }; + directives.push(makeDirectiveNode('specifiedBy', specifiedByArgs)); + } + return { + kind: Kind.SCALAR_TYPE_DEFINITION, + description: getDescriptionNode(type), + name: { + kind: Kind.NAME, + value: type.name, + }, + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: directives, + }; +} +export function astFromField(field, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.FIELD_DEFINITION, + description: getDescriptionNode(field), + name: { + kind: Kind.NAME, + value: field.name, + }, + arguments: field.args.map(arg => astFromArg(arg, schema, pathToDirectivesInExtensions)), + type: astFromType(field.type), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(field, schema, pathToDirectivesInExtensions), + }; +} +export function astFromInputField(field, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.INPUT_VALUE_DEFINITION, + description: getDescriptionNode(field), + name: { + kind: Kind.NAME, + value: field.name, + }, + type: astFromType(field.type), + // ConstXNode has been introduced in v16 but it is not compatible with XNode so we do `as any` for backwards compatibility + directives: getDirectiveNodes(field, schema, pathToDirectivesInExtensions), + defaultValue: defaultValueAstFromType(field), + }; +} +export function astFromEnumValue(value, schema, pathToDirectivesInExtensions) { + return { + kind: Kind.ENUM_VALUE_DEFINITION, + description: getDescriptionNode(value), + name: { + kind: Kind.NAME, + value: value.name, + }, + directives: getDirectiveNodes(value, schema, pathToDirectivesInExtensions), + }; +} +export function makeDeprecatedDirective(deprecationReason) { + return makeDirectiveNode('deprecated', { reason: deprecationReason }, GraphQLDeprecatedDirective); +} +export function makeDirectiveNode(name, args, directive) { + const directiveArguments = []; + for (const argName in args) { + const argValue = args[argName]; + let value; + if (directive != null) { + const arg = directive.args.find(arg => arg.name === argName); + if (arg) { + value = astFromValue(argValue, arg.type); + } + } + if (value == null) { + value = astFromValueUntyped(argValue); + } + if (value != null) { + directiveArguments.push({ + kind: Kind.ARGUMENT, + name: { + kind: Kind.NAME, + value: argName, + }, + value, + }); + } + } + return { + kind: Kind.DIRECTIVE, + name: { + kind: Kind.NAME, + value: name, + }, + arguments: directiveArguments, + }; +} +export function makeDirectiveNodes(schema, directiveValues) { + const directiveNodes = []; + for (const { name, args } of directiveValues) { + const directive = schema?.getDirective(name); + directiveNodes.push(makeDirectiveNode(name, args, directive)); + } + return directiveNodes; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/prune.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/prune.js new file mode 100644 index 00000000..45b1e7f7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/prune.js @@ -0,0 +1,167 @@ +import { getNamedType, isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isSpecifiedScalarType, isUnionType, } from 'graphql'; +import { getImplementingTypes } from './get-implementing-types.js'; +import { MapperKind } from './Interfaces.js'; +import { mapSchema } from './mapSchema.js'; +import { getRootTypes } from './rootTypes.js'; +/** + * Prunes the provided schema, removing unused and empty types + * @param schema The schema to prune + * @param options Additional options for removing unused types from the schema + */ +export function pruneSchema(schema, options = {}) { + const { skipEmptyCompositeTypePruning, skipEmptyUnionPruning, skipPruning, skipUnimplementedInterfacesPruning, skipUnusedTypesPruning, } = options; + let prunedTypes = []; // Pruned types during mapping + let prunedSchema = schema; + do { + let visited = visitSchema(prunedSchema); + // Custom pruning was defined, so we need to pre-emptively revisit the schema accounting for this + if (skipPruning) { + const revisit = []; + for (const typeName in prunedSchema.getTypeMap()) { + if (typeName.startsWith('__')) { + continue; + } + const type = prunedSchema.getType(typeName); + // if we want to skip pruning for this type, add it to the list of types to revisit + if (type && skipPruning(type)) { + revisit.push(typeName); + } + } + visited = visitQueue(revisit, prunedSchema, visited); // visit again + } + prunedTypes = []; + prunedSchema = mapSchema(prunedSchema, { + [MapperKind.TYPE]: type => { + if (!visited.has(type.name) && !isSpecifiedScalarType(type)) { + if (isUnionType(type) || + isInputObjectType(type) || + isInterfaceType(type) || + isObjectType(type) || + isScalarType(type)) { + // skipUnusedTypesPruning: skip pruning unused types + if (skipUnusedTypesPruning) { + return type; + } + // skipEmptyUnionPruning: skip pruning empty unions + if (isUnionType(type) && + skipEmptyUnionPruning && + !Object.keys(type.getTypes()).length) { + return type; + } + if (isInputObjectType(type) || isInterfaceType(type) || isObjectType(type)) { + // skipEmptyCompositeTypePruning: skip pruning object types or interfaces with no fields + if (skipEmptyCompositeTypePruning && !Object.keys(type.getFields()).length) { + return type; + } + } + // skipUnimplementedInterfacesPruning: skip pruning interfaces that are not implemented by any other types + if (isInterfaceType(type) && skipUnimplementedInterfacesPruning) { + return type; + } + } + prunedTypes.push(type.name); + visited.delete(type.name); + return null; + } + return type; + }, + }); + } while (prunedTypes.length); // Might have empty types and need to prune again + return prunedSchema; +} +function visitSchema(schema) { + const queue = []; // queue of nodes to visit + // Grab the root types and start there + for (const type of getRootTypes(schema)) { + queue.push(type.name); + } + return visitQueue(queue, schema); +} +function visitQueue(queue, schema, visited = new Set()) { + // Interfaces encountered that are field return types need to be revisited to add their implementations + const revisit = new Map(); + // Navigate all types starting with pre-queued types (root types) + while (queue.length) { + const typeName = queue.pop(); + // Skip types we already visited unless it is an interface type that needs revisiting + if (visited.has(typeName) && revisit[typeName] !== true) { + continue; + } + const type = schema.getType(typeName); + if (type) { + // Get types for union + if (isUnionType(type)) { + queue.push(...type.getTypes().map(type => type.name)); + } + // If it is an interface and it is a returned type, grab all implementations so we can use proper __typename in fragments + if (isInterfaceType(type) && revisit[typeName] === true) { + queue.push(...getImplementingTypes(type.name, schema)); + // No need to revisit this interface again + revisit[typeName] = false; + } + if (isEnumType(type)) { + // Visit enum values directives argument types + queue.push(...type.getValues().flatMap(value => getDirectivesArgumentsTypeNames(schema, value))); + } + // Visit interfaces this type is implementing if they haven't been visited yet + if ('getInterfaces' in type) { + // Only pushes to queue to visit but not return types + queue.push(...type.getInterfaces().map(iface => iface.name)); + } + // If the type has fields visit those field types + if ('getFields' in type) { + const fields = type.getFields(); + const entries = Object.entries(fields); + if (!entries.length) { + continue; + } + for (const [, field] of entries) { + if (isObjectType(type)) { + // Visit arg types and arg directives arguments types + queue.push(...field.args.flatMap(arg => { + const typeNames = [getNamedType(arg.type).name]; + typeNames.push(...getDirectivesArgumentsTypeNames(schema, arg)); + return typeNames; + })); + } + const namedType = getNamedType(field.type); + queue.push(namedType.name); + queue.push(...getDirectivesArgumentsTypeNames(schema, field)); + // Interfaces returned on fields need to be revisited to add their implementations + if (isInterfaceType(namedType) && !(namedType.name in revisit)) { + revisit[namedType.name] = true; + } + } + } + queue.push(...getDirectivesArgumentsTypeNames(schema, type)); + visited.add(typeName); // Mark as visited (and therefore it is used and should be kept) + } + } + return visited; +} +function getDirectivesArgumentsTypeNames(schema, directableObj) { + const argTypeNames = new Set(); + if (directableObj.astNode?.directives) { + for (const directiveNode of directableObj.astNode.directives) { + const directive = schema.getDirective(directiveNode.name.value); + if (directive?.args) { + for (const arg of directive.args) { + const argType = getNamedType(arg.type); + argTypeNames.add(argType.name); + } + } + } + } + if (directableObj.extensions?.['directives']) { + for (const directiveName in directableObj.extensions['directives']) { + const directive = schema.getDirective(directiveName); + if (directive?.args) { + for (const arg of directive.args) { + const argType = getNamedType(arg.type); + argTypeNames.add(argType.name); + } + } + } + } + return [...argTypeNames]; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/registerAbortSignalListener.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/registerAbortSignalListener.js new file mode 100644 index 00000000..00f62e43 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/registerAbortSignalListener.js @@ -0,0 +1,42 @@ +import { fakeRejectPromise } from '@whatwg-node/promise-helpers'; +import { memoize1 } from './memoize.js'; +// AbortSignal handler cache to avoid the "possible EventEmitter memory leak detected" +// on Node.js +const getListenersOfAbortSignal = memoize1(function getListenersOfAbortSignal(signal) { + const listeners = new Set(); + signal.addEventListener('abort', e => { + for (const listener of listeners) { + listener(e); + } + }, { once: true }); + return listeners; +}); +/** + * Register an AbortSignal handler for a signal. + * This helper function mainly exists to work around the + * "possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit." + * warning occuring on Node.js + */ +export function registerAbortSignalListener(signal, listener) { + // If the signal is already aborted, call the listener immediately + if (signal.aborted) { + listener(); + return; + } + getListenersOfAbortSignal(signal).add(listener); +} +export const getAbortPromise = memoize1(function getAbortPromise(signal) { + // If the signal is already aborted, return a rejected promise + if (signal.aborted) { + return fakeRejectPromise(signal.reason); + } + return new Promise((_resolve, reject) => { + if (signal.aborted) { + reject(signal.reason); + return; + } + registerAbortSignalListener(signal, () => { + reject(signal.reason); + }); + }); +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/renameType.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/renameType.js new file mode 100644 index 00000000..a9cc3cdb --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/renameType.js @@ -0,0 +1,148 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isUnionType, } from 'graphql'; +export function renameType(type, newTypeName) { + if (isObjectType(type)) { + return new GraphQLObjectType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if (isInterfaceType(type)) { + return new GraphQLInterfaceType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if (isUnionType(type)) { + return new GraphQLUnionType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if (isInputObjectType(type)) { + return new GraphQLInputObjectType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if (isEnumType(type)) { + return new GraphQLEnumType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + else if (isScalarType(type)) { + return new GraphQLScalarType({ + ...type.toConfig(), + name: newTypeName, + astNode: type.astNode == null + ? type.astNode + : { + ...type.astNode, + name: { + ...type.astNode.name, + value: newTypeName, + }, + }, + extensionASTNodes: type.extensionASTNodes == null + ? type.extensionASTNodes + : type.extensionASTNodes.map(node => ({ + ...node, + name: { + ...node.name, + value: newTypeName, + }, + })), + }); + } + throw new Error(`Unknown type ${type}.`); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rewire.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rewire.js new file mode 100644 index 00000000..55891ab7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rewire.js @@ -0,0 +1,156 @@ +import { GraphQLDirective, GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isEnumType, isInputObjectType, isInterfaceType, isListType, isNamedType, isNonNullType, isObjectType, isScalarType, isSpecifiedDirective, isSpecifiedScalarType, isUnionType, } from 'graphql'; +import { getBuiltInForStub, isNamedStub } from './stub.js'; +export function rewireTypes(originalTypeMap, directives) { + const referenceTypeMap = Object.create(null); + for (const typeName in originalTypeMap) { + referenceTypeMap[typeName] = originalTypeMap[typeName]; + } + const newTypeMap = Object.create(null); + for (const typeName in referenceTypeMap) { + const namedType = referenceTypeMap[typeName]; + if (namedType == null || typeName.startsWith('__')) { + continue; + } + const newName = namedType.name; + if (newName.startsWith('__')) { + continue; + } + if (newTypeMap[newName] != null) { + console.warn(`Duplicate schema type name ${newName} found; keeping the existing one found in the schema`); + continue; + } + newTypeMap[newName] = namedType; + } + for (const typeName in newTypeMap) { + newTypeMap[typeName] = rewireNamedType(newTypeMap[typeName]); + } + const newDirectives = directives.map(directive => rewireDirective(directive)); + return { + typeMap: newTypeMap, + directives: newDirectives, + }; + function rewireDirective(directive) { + if (isSpecifiedDirective(directive)) { + return directive; + } + const directiveConfig = directive.toConfig(); + directiveConfig.args = rewireArgs(directiveConfig.args); + return new GraphQLDirective(directiveConfig); + } + function rewireArgs(args) { + const rewiredArgs = {}; + for (const argName in args) { + const arg = args[argName]; + const rewiredArgType = rewireType(arg.type); + if (rewiredArgType != null) { + arg.type = rewiredArgType; + rewiredArgs[argName] = arg; + } + } + return rewiredArgs; + } + function rewireNamedType(type) { + if (isObjectType(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + fields: () => rewireFields(config.fields), + interfaces: () => rewireNamedTypes(config.interfaces), + }; + return new GraphQLObjectType(newConfig); + } + else if (isInterfaceType(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + fields: () => rewireFields(config.fields), + }; + if ('interfaces' in newConfig) { + newConfig.interfaces = () => rewireNamedTypes(config.interfaces); + } + return new GraphQLInterfaceType(newConfig); + } + else if (isUnionType(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + types: () => rewireNamedTypes(config.types), + }; + return new GraphQLUnionType(newConfig); + } + else if (isInputObjectType(type)) { + const config = type.toConfig(); + const newConfig = { + ...config, + fields: () => rewireInputFields(config.fields), + }; + return new GraphQLInputObjectType(newConfig); + } + else if (isEnumType(type)) { + const enumConfig = type.toConfig(); + return new GraphQLEnumType(enumConfig); + } + else if (isScalarType(type)) { + if (isSpecifiedScalarType(type)) { + return type; + } + const scalarConfig = type.toConfig(); + return new GraphQLScalarType(scalarConfig); + } + throw new Error(`Unexpected schema type: ${type}`); + } + function rewireFields(fields) { + const rewiredFields = {}; + for (const fieldName in fields) { + const field = fields[fieldName]; + const rewiredFieldType = rewireType(field.type); + if (rewiredFieldType != null && field.args) { + field.type = rewiredFieldType; + field.args = rewireArgs(field.args); + rewiredFields[fieldName] = field; + } + } + return rewiredFields; + } + function rewireInputFields(fields) { + const rewiredFields = {}; + for (const fieldName in fields) { + const field = fields[fieldName]; + const rewiredFieldType = rewireType(field.type); + if (rewiredFieldType != null) { + field.type = rewiredFieldType; + rewiredFields[fieldName] = field; + } + } + return rewiredFields; + } + function rewireNamedTypes(namedTypes) { + const rewiredTypes = []; + for (const namedType of namedTypes) { + const rewiredType = rewireType(namedType); + if (rewiredType != null) { + rewiredTypes.push(rewiredType); + } + } + return rewiredTypes; + } + function rewireType(type) { + if (isListType(type)) { + const rewiredType = rewireType(type.ofType); + return rewiredType != null ? new GraphQLList(rewiredType) : null; + } + else if (isNonNullType(type)) { + const rewiredType = rewireType(type.ofType); + return rewiredType != null ? new GraphQLNonNull(rewiredType) : null; + } + else if (isNamedType(type)) { + let rewiredType = referenceTypeMap[type.name]; + if (rewiredType === undefined) { + rewiredType = isNamedStub(type) ? getBuiltInForStub(type) : rewireNamedType(type); + newTypeMap[rewiredType.name] = referenceTypeMap[type.name] = rewiredType; + } + return rewiredType != null ? newTypeMap[rewiredType.name] : null; + } + return null; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rootTypes.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rootTypes.js new file mode 100644 index 00000000..05cd339b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/rootTypes.js @@ -0,0 +1,36 @@ +import { createGraphQLError } from './errors.js'; +import { memoize1 } from './memoize.js'; +export function getDefinedRootType(schema, operation, nodes) { + const rootTypeMap = getRootTypeMap(schema); + const rootType = rootTypeMap.get(operation); + if (rootType == null) { + throw createGraphQLError(`Schema is not configured to execute ${operation} operation.`, { + nodes, + }); + } + return rootType; +} +export const getRootTypeNames = memoize1(function getRootTypeNames(schema) { + const rootTypes = getRootTypes(schema); + return new Set([...rootTypes].map(type => type.name)); +}); +export const getRootTypes = memoize1(function getRootTypes(schema) { + const rootTypeMap = getRootTypeMap(schema); + return new Set(rootTypeMap.values()); +}); +export const getRootTypeMap = memoize1(function getRootTypeMap(schema) { + const rootTypeMap = new Map(); + const queryType = schema.getQueryType(); + if (queryType) { + rootTypeMap.set('query', queryType); + } + const mutationType = schema.getMutationType(); + if (mutationType) { + rootTypeMap.set('mutation', mutationType); + } + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + rootTypeMap.set('subscription', subscriptionType); + } + return rootTypeMap; +}); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/selectionSets.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/selectionSets.js new file mode 100644 index 00000000..9b3f836f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/selectionSets.js @@ -0,0 +1,5 @@ +import { parse } from 'graphql'; +export function parseSelectionSet(selectionSet, options) { + const query = parse(selectionSet, options).definitions[0]; + return query.selectionSet; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/stub.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/stub.js new file mode 100644 index 00000000..52a953b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/stub.js @@ -0,0 +1,62 @@ +import { GraphQLBoolean, GraphQLFloat, GraphQLID, GraphQLInputObjectType, GraphQLInt, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLString, Kind, } from 'graphql'; +export function createNamedStub(name, type) { + let constructor; + if (type === 'object') { + constructor = GraphQLObjectType; + } + else if (type === 'interface') { + constructor = GraphQLInterfaceType; + } + else { + constructor = GraphQLInputObjectType; + } + return new constructor({ + name, + fields: { + _fake: { + type: GraphQLString, + }, + }, + }); +} +export function createStub(node, type) { + switch (node.kind) { + case Kind.LIST_TYPE: + return new GraphQLList(createStub(node.type, type)); + case Kind.NON_NULL_TYPE: + // FIXME: graphql@17 type issue + return new GraphQLNonNull(createStub(node.type, type)); + default: + if (type === 'output') { + return createNamedStub(node.name.value, 'object'); + } + return createNamedStub(node.name.value, 'input'); + } +} +export function isNamedStub(type) { + if ('getFields' in type) { + const fields = type.getFields(); + // eslint-disable-next-line no-unreachable-loop + for (const fieldName in fields) { + const field = fields[fieldName]; + return field.name === '_fake'; + } + } + return false; +} +export function getBuiltInForStub(type) { + switch (type.name) { + case GraphQLInt.name: + return GraphQLInt; + case GraphQLFloat.name: + return GraphQLFloat; + case GraphQLString.name: + return GraphQLString; + case GraphQLBoolean.name: + return GraphQLBoolean; + case GraphQLID.name: + return GraphQLID; + default: + return type; + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/transformInputValue.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/transformInputValue.js new file mode 100644 index 00000000..23d57d7a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/transformInputValue.js @@ -0,0 +1,53 @@ +import { getNullableType, isInputObjectType, isLeafType, isListType, } from 'graphql'; +import { asArray } from './helpers.js'; +export function transformInputValue(type, value, inputLeafValueTransformer = null, inputObjectValueTransformer = null) { + if (value == null) { + return value; + } + const nullableType = getNullableType(type); + if (isLeafType(nullableType)) { + return inputLeafValueTransformer != null + ? inputLeafValueTransformer(nullableType, value) + : value; + } + else if (isListType(nullableType)) { + return asArray(value).map((listMember) => transformInputValue(nullableType.ofType, listMember, inputLeafValueTransformer, inputObjectValueTransformer)); + } + else if (isInputObjectType(nullableType)) { + const fields = nullableType.getFields(); + const newValue = {}; + for (const key in value) { + const field = fields[key]; + if (field != null) { + newValue[key] = transformInputValue(field.type, value[key], inputLeafValueTransformer, inputObjectValueTransformer); + } + } + return inputObjectValueTransformer != null + ? inputObjectValueTransformer(nullableType, newValue) + : newValue; + } + // unreachable, no other possible return value +} +export function serializeInputValue(type, value) { + return transformInputValue(type, value, (t, v) => { + try { + return t.serialize(v); + } + catch { + return v; + } + }); +} +export function parseInputValue(type, value) { + return transformInputValue(type, value, (t, v) => { + try { + return t.parseValue(v); + } + catch { + return v; + } + }); +} +export function parseInputValueLiteral(type, value) { + return transformInputValue(type, value, (t, v) => t.parseLiteral(v, {})); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/types.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/types.js new file mode 100644 index 00000000..c92760ba --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/types.js @@ -0,0 +1,24 @@ +export var DirectiveLocation; +(function (DirectiveLocation) { + /** Request Definitions */ + DirectiveLocation["QUERY"] = "QUERY"; + DirectiveLocation["MUTATION"] = "MUTATION"; + DirectiveLocation["SUBSCRIPTION"] = "SUBSCRIPTION"; + DirectiveLocation["FIELD"] = "FIELD"; + DirectiveLocation["FRAGMENT_DEFINITION"] = "FRAGMENT_DEFINITION"; + DirectiveLocation["FRAGMENT_SPREAD"] = "FRAGMENT_SPREAD"; + DirectiveLocation["INLINE_FRAGMENT"] = "INLINE_FRAGMENT"; + DirectiveLocation["VARIABLE_DEFINITION"] = "VARIABLE_DEFINITION"; + /** Type System Definitions */ + DirectiveLocation["SCHEMA"] = "SCHEMA"; + DirectiveLocation["SCALAR"] = "SCALAR"; + DirectiveLocation["OBJECT"] = "OBJECT"; + DirectiveLocation["FIELD_DEFINITION"] = "FIELD_DEFINITION"; + DirectiveLocation["ARGUMENT_DEFINITION"] = "ARGUMENT_DEFINITION"; + DirectiveLocation["INTERFACE"] = "INTERFACE"; + DirectiveLocation["UNION"] = "UNION"; + DirectiveLocation["ENUM"] = "ENUM"; + DirectiveLocation["ENUM_VALUE"] = "ENUM_VALUE"; + DirectiveLocation["INPUT_OBJECT"] = "INPUT_OBJECT"; + DirectiveLocation["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION"; +})(DirectiveLocation || (DirectiveLocation = {})); diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/updateArgument.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/updateArgument.js new file mode 100644 index 00000000..c3261067 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/updateArgument.js @@ -0,0 +1,50 @@ +import { Kind } from 'graphql'; +import { astFromType } from './astFromType.js'; +export function updateArgument(argumentNodes, variableDefinitionsMap, variableValues, argName, varName, type, value) { + argumentNodes[argName] = { + kind: Kind.ARGUMENT, + name: { + kind: Kind.NAME, + value: argName, + }, + value: { + kind: Kind.VARIABLE, + name: { + kind: Kind.NAME, + value: varName, + }, + }, + }; + variableDefinitionsMap[varName] = { + kind: Kind.VARIABLE_DEFINITION, + variable: { + kind: Kind.VARIABLE, + name: { + kind: Kind.NAME, + value: varName, + }, + }, + type: astFromType(type), + }; + if (value !== undefined) { + variableValues[varName] = value; + return; + } + // including the variable in the map with value of `undefined` + // will actually be translated by graphql-js into `null` + // see https://github.com/graphql/graphql-js/issues/2533 + if (varName in variableValues) { + delete variableValues[varName]; + } +} +export function createVariableNameGenerator(variableDefinitionMap) { + let varCounter = 0; + return (argName) => { + let varName; + do { + varName = varCounter === 0 ? argName : `_v${varCounter.toString()}_${argName}`; + varCounter++; + } while (varName in variableDefinitionMap); + return varName; + }; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/validate-documents.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/validate-documents.js new file mode 100644 index 00000000..3712bed9 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/validate-documents.js @@ -0,0 +1,36 @@ +import { Kind, specifiedRules, validate, versionInfo, } from 'graphql'; +export function validateGraphQlDocuments(schema, documents, rules = createDefaultRules()) { + const definitions = new Set(); + const fragmentsDefinitionsMap = new Map(); + for (const document of documents) { + for (const docDefinition of document.definitions) { + if (docDefinition.kind === Kind.FRAGMENT_DEFINITION) { + fragmentsDefinitionsMap.set(docDefinition.name.value, docDefinition); + } + else { + definitions.add(docDefinition); + } + } + } + const fullAST = { + kind: Kind.DOCUMENT, + definitions: Array.from([...definitions, ...fragmentsDefinitionsMap.values()]), + }; + const errors = validate(schema, fullAST, rules); + for (const error of errors) { + error.stack = error.message; + if (error.locations) { + for (const location of error.locations) { + error.stack += `\n at ${error.source?.name}:${location.line}:${location.column}`; + } + } + } + return errors; +} +export function createDefaultRules() { + let ignored = ['NoUnusedFragmentsRule', 'NoUnusedVariablesRule', 'KnownDirectivesRule']; + if (versionInfo.major < 15) { + ignored = ignored.map(rule => rule.replace(/Rule$/, '')); + } + return specifiedRules.filter((f) => !ignored.includes(f.name)); +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/valueMatchesCriteria.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/valueMatchesCriteria.js new file mode 100644 index 00000000..9ce59148 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/valueMatchesCriteria.js @@ -0,0 +1,18 @@ +export function valueMatchesCriteria(value, criteria) { + if (value == null) { + return value === criteria; + } + else if (Array.isArray(value)) { + return (Array.isArray(criteria) && + value.every((val, index) => valueMatchesCriteria(val, criteria[index]))); + } + else if (typeof value === 'object') { + return (typeof criteria === 'object' && + criteria && + Object.keys(criteria).every(propertyName => valueMatchesCriteria(value[propertyName], criteria[propertyName]))); + } + else if (criteria instanceof RegExp) { + return criteria.test(value); + } + return value === criteria; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/visitResult.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/visitResult.js new file mode 100644 index 00000000..8bbcca8c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/visitResult.js @@ -0,0 +1,258 @@ +import { getNullableType, isAbstractType, isListType, isObjectType, Kind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from 'graphql'; +import { collectFields, collectSubFields } from './collectFields.js'; +import { getOperationASTFromRequest } from './getOperationASTFromRequest.js'; +export function visitData(data, enter, leave) { + if (Array.isArray(data)) { + return data.map(value => visitData(value, enter, leave)); + } + else if (typeof data === 'object') { + const newData = enter != null ? enter(data) : data; + if (newData != null) { + for (const key in newData) { + const value = newData[key]; + Object.defineProperty(newData, key, { + value: visitData(value, enter, leave), + }); + } + } + return leave != null ? leave(newData) : newData; + } + return data; +} +export function visitErrors(errors, visitor) { + return errors.map(error => visitor(error)); +} +export function visitResult(result, request, schema, resultVisitorMap, errorVisitorMap) { + const fragments = request.document.definitions.reduce((acc, def) => { + if (def.kind === Kind.FRAGMENT_DEFINITION) { + acc[def.name.value] = def; + } + return acc; + }, {}); + const variableValues = normalizeVariableValues(request.variables); + const errorInfo = { + segmentInfoMap: new Map(), + unpathedErrors: new Set(), + }; + const data = result.data; + const errors = result.errors; + const visitingErrors = errors != null && errorVisitorMap != null; + const operationDocumentNode = getOperationASTFromRequest(request); + if (data != null && operationDocumentNode != null) { + result.data = visitRoot(data, operationDocumentNode, schema, fragments, variableValues, resultVisitorMap, visitingErrors ? errors : undefined, errorInfo); + } + if (errors != null && errorVisitorMap) { + result.errors = visitErrorsByType(errors, errorVisitorMap, errorInfo); + } + return result; +} +function normalizeVariableValues(variables) { + return { + coerced: variables ?? {}, + sources: {}, + }; +} +function visitErrorsByType(errors, errorVisitorMap, errorInfo) { + const segmentInfoMap = errorInfo.segmentInfoMap; + const unpathedErrors = errorInfo.unpathedErrors; + const unpathedErrorVisitor = errorVisitorMap['__unpathed']; + return errors.map(originalError => { + const pathSegmentsInfo = segmentInfoMap.get(originalError); + const newError = pathSegmentsInfo == null + ? originalError + : pathSegmentsInfo.reduceRight((acc, segmentInfo) => { + const typeName = segmentInfo.type.name; + const typeVisitorMap = errorVisitorMap[typeName]; + if (typeVisitorMap == null) { + return acc; + } + const errorVisitor = typeVisitorMap[segmentInfo.fieldName]; + return errorVisitor == null ? acc : errorVisitor(acc, segmentInfo.pathIndex); + }, originalError); + if (unpathedErrorVisitor && unpathedErrors.has(originalError)) { + return unpathedErrorVisitor(newError); + } + return newError; + }); +} +function getOperationRootType(schema, operationDef) { + switch (operationDef.operation) { + case 'query': + return schema.getQueryType(); + case 'mutation': + return schema.getMutationType(); + case 'subscription': + return schema.getSubscriptionType(); + } +} +function visitRoot(root, operation, schema, fragments, variableValues, resultVisitorMap, errors, errorInfo) { + const operationRootType = getOperationRootType(schema, operation); + const { fields: collectedFields } = collectFields(schema, fragments, variableValues, operationRootType, operation.selectionSet); + return visitObjectValue(root, operationRootType, collectedFields, schema, fragments, variableValues, resultVisitorMap, 0, errors, errorInfo); +} +function visitObjectValue(object, type, fieldNodeMap, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo) { + const fieldMap = type.getFields(); + const typeVisitorMap = resultVisitorMap?.[type.name]; + const enterObject = typeVisitorMap?.__enter; + const newObject = enterObject != null ? enterObject(object) : object; + let sortedErrors; + let errorMap = null; + if (errors != null) { + sortedErrors = sortErrorsByPathSegment(errors, pathIndex); + errorMap = sortedErrors.errorMap; + for (const error of sortedErrors.unpathedErrors) { + errorInfo.unpathedErrors.add(error); + } + } + for (const [responseKey, subFieldNodes] of fieldNodeMap) { + const fieldName = subFieldNodes[0].name.value; + let fieldType = fieldMap[fieldName]?.type; + if (fieldType == null) { + switch (fieldName) { + case '__typename': + fieldType = TypeNameMetaFieldDef.type; + break; + case '__schema': + fieldType = SchemaMetaFieldDef.type; + break; + case '__type': + fieldType = TypeMetaFieldDef.type; + break; + } + } + const newPathIndex = pathIndex + 1; + let fieldErrors; + if (errorMap) { + fieldErrors = errorMap[responseKey]; + if (fieldErrors != null) { + delete errorMap[responseKey]; + } + addPathSegmentInfo(type, fieldName, newPathIndex, fieldErrors, errorInfo); + } + const newValue = visitFieldValue(object[responseKey], fieldType, subFieldNodes, schema, fragments, variableValues, resultVisitorMap, newPathIndex, fieldErrors, errorInfo); + updateObject(newObject, responseKey, newValue, typeVisitorMap, fieldName); + } + const oldTypename = newObject.__typename; + if (oldTypename != null) { + updateObject(newObject, '__typename', oldTypename, typeVisitorMap, '__typename'); + } + if (errorMap) { + for (const errorsKey in errorMap) { + const errors = errorMap[errorsKey]; + for (const error of errors) { + errorInfo.unpathedErrors.add(error); + } + } + } + const leaveObject = typeVisitorMap?.__leave; + return leaveObject != null ? leaveObject(newObject) : newObject; +} +function updateObject(object, responseKey, newValue, typeVisitorMap, fieldName) { + if (typeVisitorMap == null) { + object[responseKey] = newValue; + return; + } + const fieldVisitor = typeVisitorMap[fieldName]; + if (fieldVisitor == null) { + object[responseKey] = newValue; + return; + } + const visitedValue = fieldVisitor(newValue); + if (visitedValue === undefined) { + delete object[responseKey]; + return; + } + object[responseKey] = visitedValue; +} +function visitListValue(list, returnType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo) { + return list.map(listMember => visitFieldValue(listMember, returnType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex + 1, errors, errorInfo)); +} +function visitFieldValue(value, returnType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors = [], errorInfo) { + if (value == null) { + return value; + } + const nullableType = getNullableType(returnType); + if (isListType(nullableType)) { + return visitListValue(value, nullableType.ofType, fieldNodes, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo); + } + else if (isAbstractType(nullableType)) { + const finalType = schema.getType(value.__typename); + let { fields: collectedFields, patches } = collectSubFields(schema, fragments, variableValues, finalType, fieldNodes); + if (patches.length) { + collectedFields = new Map(collectedFields); + for (const patch of patches) { + for (const [responseKey, fields] of patch.fields) { + const existingFields = collectedFields.get(responseKey); + if (existingFields) { + existingFields.push(...fields); + } + else { + collectedFields.set(responseKey, fields); + } + } + } + } + return visitObjectValue(value, finalType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo); + } + else if (isObjectType(nullableType)) { + let { fields: collectedFields, patches } = collectSubFields(schema, fragments, variableValues, nullableType, fieldNodes); + if (patches.length) { + collectedFields = new Map(collectedFields); + for (const patch of patches) { + for (const [responseKey, fields] of patch.fields) { + const existingFields = collectedFields.get(responseKey); + if (existingFields) { + existingFields.push(...fields); + } + else { + collectedFields.set(responseKey, fields); + } + } + } + } + return visitObjectValue(value, nullableType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo); + } + const typeVisitorMap = resultVisitorMap?.[nullableType.name]; + if (typeVisitorMap == null) { + return value; + } + const visitedValue = typeVisitorMap(value); + return visitedValue === undefined ? value : visitedValue; +} +function sortErrorsByPathSegment(errors, pathIndex) { + const errorMap = Object.create(null); + const unpathedErrors = new Set(); + for (const error of errors) { + const pathSegment = error.path?.[pathIndex]; + if (pathSegment == null) { + unpathedErrors.add(error); + continue; + } + if (pathSegment in errorMap) { + errorMap[pathSegment].push(error); + } + else { + errorMap[pathSegment] = [error]; + } + } + return { + errorMap, + unpathedErrors, + }; +} +function addPathSegmentInfo(type, fieldName, pathIndex, errors = [], errorInfo) { + for (const error of errors) { + const segmentInfo = { + type, + fieldName, + pathIndex, + }; + const pathSegmentsInfo = errorInfo.segmentInfoMap.get(error); + if (pathSegmentsInfo == null) { + errorInfo.segmentInfoMap.set(error, [segmentInfo]); + } + else { + pathSegmentsInfo.push(segmentInfo); + } + } +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/withCancel.js b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/withCancel.js new file mode 100644 index 00000000..84ff0d4f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/esm/withCancel.js @@ -0,0 +1,51 @@ +import { memoize2 } from './memoize.js'; +async function defaultAsyncIteratorReturn(value) { + return { value, done: true }; +} +const proxyMethodFactory = memoize2(function proxyMethodFactory(target, targetMethod) { + return function proxyMethod(...args) { + return Reflect.apply(targetMethod, target, args); + }; +}); +export function getAsyncIteratorWithCancel(asyncIterator, onCancel) { + return new Proxy(asyncIterator, { + has(asyncIterator, prop) { + if (prop === 'return') { + return true; + } + return Reflect.has(asyncIterator, prop); + }, + get(asyncIterator, prop, receiver) { + const existingPropValue = Reflect.get(asyncIterator, prop, receiver); + if (prop === 'return') { + const existingReturn = existingPropValue || defaultAsyncIteratorReturn; + return async function returnWithCancel(value) { + const returnValue = await onCancel(value); + return Reflect.apply(existingReturn, asyncIterator, [returnValue]); + }; + } + else if (typeof existingPropValue === 'function') { + return proxyMethodFactory(asyncIterator, existingPropValue); + } + return existingPropValue; + }, + }); +} +export function getAsyncIterableWithCancel(asyncIterable, onCancel) { + return new Proxy(asyncIterable, { + get(asyncIterable, prop, receiver) { + const existingPropValue = Reflect.get(asyncIterable, prop, receiver); + if (Symbol.asyncIterator === prop) { + return function asyncIteratorFactory() { + const asyncIterator = Reflect.apply(existingPropValue, asyncIterable, []); + return getAsyncIteratorWithCancel(asyncIterator, onCancel); + }; + } + else if (typeof existingPropValue === 'function') { + return proxyMethodFactory(asyncIterable, existingPropValue); + } + return existingPropValue; + }, + }); +} +export { getAsyncIterableWithCancel as withCancel }; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/package.json b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/package.json new file mode 100644 index 00000000..db55f6dd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/package.json @@ -0,0 +1,49 @@ +{ + "name": "@graphql-tools/utils", + "version": "12.0.1", + "description": "Common package containing utils and types for GraphQL tools", + "sideEffects": false, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + }, + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "@whatwg-node/promise-helpers": "^1.0.0", + "cross-inspect": "1.0.1", + "tslib": "^2.4.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ardatan/graphql-tools.git", + "directory": "packages/utils" + }, + "author": "Dotan Simha ", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + }, + "main": "cjs/index.js", + "module": "esm/index.js", + "typings": "typings/index.d.ts", + "typescript": { + "definition": "typings/index.d.ts" + }, + "type": "module", + "exports": { + ".": { + "require": { + "types": "./typings/index.d.cts", + "default": "./cjs/index.js" + }, + "import": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + }, + "default": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + } + }, + "./package.json": "./package.json" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.cts new file mode 100644 index 00000000..1e2aac20 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.cts @@ -0,0 +1,7 @@ +/** + * ES6 Map with additional `add` method to accumulate items. + */ +export declare class AccumulatorMap extends Map> { + get [Symbol.toStringTag](): string; + add(key: K, item: T): void; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.ts new file mode 100644 index 00000000..1e2aac20 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/AccumulatorMap.d.ts @@ -0,0 +1,7 @@ +/** + * ES6 Map with additional `add` method to accumulate items. + */ +export declare class AccumulatorMap extends Map> { + get [Symbol.toStringTag](): string; + add(key: K, item: T): void; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.cts new file mode 100644 index 00000000..9fa06440 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.cts @@ -0,0 +1,302 @@ +import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLScalarLiteralParser, GraphQLScalarSerializer, GraphQLScalarType, GraphQLScalarValueParser, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, GraphQLResolveInfo as OrigGraphQLResolveInfo, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SelectionNode, Source, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql'; +import { TypedDocumentNode } from '@graphql-typed-document-node/core'; +/** + * The result of GraphQL execution. + * + * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. + * - `hasNext` is true if a future payload is expected. + * - `extensions` is reserved for adding non-standard properties. + */ +export interface ExecutionResult { + incremental?: ReadonlyArray>; + data?: TData | null; + errors?: ReadonlyArray; + hasNext?: boolean; + extensions?: TExtensions; + label?: string; + path?: ReadonlyArray; + items?: TData | null; +} +export interface GraphQLResolveInfo extends OrigGraphQLResolveInfo { + signal?: AbortSignal; + /** Returns the AbortSignal supplied for this execution, if any. */ + readonly getAbortSignal: () => AbortSignal | undefined; + /** Returns helper functions for tracking asynchronous resolver work. */ + readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers; +} +export interface GraphQLResolveInfoHelpers { + /** + * Promise.all wrapper that allows rejected branches to be tracked + * as execution async work. + * + * Intended use: return or await this promise from resolver work. + * Un-awaited async side effects are an anti-pattern: + * + * const { promiseAll } = info.getAsyncHelpers(); + * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined); + * + * In that anti-pattern, tracking starts only after rejection (on a + * later microtask), so this work is not guaranteed to delay + * `hooks.asyncWorkFinished`. + * + * Use `track(...)` for un-awaited async side effects: + * + * const { track } = info.getAsyncHelpers(); + * track([ + * someAsyncWork().catch(() => undefined), + * someOtherAsyncWork().catch(() => undefined) + * ]); + */ + readonly promiseAll: (values: ReadonlyArray | T>) => Promise>; + /** Tracks asynchronous work that should delay execution completion hooks. */ + readonly track: (maybePromises: ReadonlyArray) => void; +} +export interface ExecutionRequest = any, TContext = any, TRootValue = any, TExtensions = Record, TReturn = any> { + document: TypedDocumentNode; + variables?: TVariables; + operationType?: OperationTypeNode; + operationName?: string; + extensions?: TExtensions; + rootValue?: TRootValue; + context?: TContext; + subgraphName?: string; + info?: GraphQLResolveInfo; + signal?: AbortSignal; + /** + * Enable/Disable the addition of field schema coordinate in GraphQL Errors extension + * + * Note: Schema Coordinate are exposed using Symbol.for('schemaCoordinate') so that it's not + * serialized. Exposing schema coordinate can ease the discovery of private schemas. + */ + schemaCoordinateInErrors?: boolean; +} +export interface GraphQLParseOptions { + noLocation?: boolean; + allowLegacySDLEmptyFields?: boolean; + allowLegacySDLImplementsInterfaces?: boolean; + experimentalFragmentVariables?: boolean; + /** + * Set to `true` in order to convert all GraphQL comments (marked with # sign) to descriptions (""") + * GraphQL has built-in support for transforming descriptions to comments (with `print`), but not while + * parsing. Turning the flag on will support the other way as well (`parse`) + */ + commentDescriptions?: boolean; +} +export type ValidatorBehavior = 'error' | 'warn' | 'ignore'; +/** + * Options for validating resolvers + */ +export interface IResolverValidationOptions { + /** + * Enable to require a resolver to be defined for any field that has + * arguments. Defaults to `ignore`. + */ + requireResolversForArgs?: ValidatorBehavior; + /** + * Enable to require a resolver to be defined for any field which has + * a return type that isn't a scalar. Defaults to `ignore`. + */ + requireResolversForNonScalar?: ValidatorBehavior; + /** + * Enable to require a resolver for be defined for all fields defined + * in the schema. Defaults to `ignore`. + */ + requireResolversForAllFields?: ValidatorBehavior; + /** + * Enable to require a `resolveType()` for Interface and Union types. + * Defaults to `ignore`. + */ + requireResolversForResolveType?: ValidatorBehavior; + /** + * Enable to require all defined resolvers to match fields that + * actually exist in the schema. Defaults to `error` to catch common errors. + */ + requireResolversToMatchSchema?: ValidatorBehavior; +} +/** + * Configuration object for adding resolvers to a schema + */ +export interface IAddResolversToSchemaOptions { + /** + * The schema to which to add resolvers + */ + schema: GraphQLSchema; + /** + * Object describing the field resolvers to add to the provided schema + */ + resolvers: IResolvers; + /** + * Override the default field resolver provided by `graphql-js` + */ + defaultFieldResolver?: IFieldResolver; + /** + * Additional options for validating the provided resolvers + */ + resolverValidationOptions?: IResolverValidationOptions; + /** + * GraphQL object types that implement interfaces will inherit any missing + * resolvers from their interface types defined in the `resolvers` object + */ + inheritResolversFromInterfaces?: boolean; + /** + * Set to `true` to modify the existing schema instead of creating a new one + */ + updateResolversInPlace?: boolean; +} +export type IScalarTypeResolver = GraphQLScalarType & { + __name?: string; + __description?: string; + __serialize?: GraphQLScalarSerializer; + __parseValue?: GraphQLScalarValueParser; + __parseLiteral?: GraphQLScalarLiteralParser; + __extensions?: Record; + __astNode?: ScalarTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type IEnumTypeResolver = Record & { + __name?: string; + __description?: string; + __extensions?: Record; + __astNode?: EnumTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export interface IFieldResolverOptions { + name?: string; + description?: string; + type?: GraphQLOutputType; + args?: Array; + resolve?: IFieldResolver; + subscribe?: IFieldResolver; + isDeprecated?: boolean; + deprecationReason?: string; + extensions?: Record; + astNode?: FieldDefinitionNode; +} +export type FieldNodeMapper = (fieldNode: FieldNode, fragments: Record, transformationContext: Record) => SelectionNode | Array; +export type FieldNodeMappers = Record>; +export type InputFieldFilter = (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean; +export type FieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig | GraphQLInputFieldConfig) => boolean; +export type ObjectFieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig) => boolean; +export type RootFieldFilter = (operation: 'Query' | 'Mutation' | 'Subscription', rootFieldName: string, fieldConfig: GraphQLFieldConfig) => boolean; +export type TypeFilter = (typeName: string, type: GraphQLType) => boolean; +export type ArgumentFilter = (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean; +export type DirectiveFilter = (directiveName: string, directive: GraphQLDirective) => boolean; +export type EnumValueFilter = (typeName: string, valueName: string, valueConfig: GraphQLEnumValueConfig) => boolean; +export type RenameTypesOptions = { + renameBuiltins: boolean; + renameScalars: boolean; +}; +export type IFieldResolver, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn; +export type TypeSource = string | Source | DocumentNode | GraphQLSchema | DefinitionNode | Array | (() => TypeSource); +export type IObjectTypeResolver = { + [key: string]: IFieldResolver | IFieldResolverOptions; +} & { + __name?: string; + __description?: string; + __isTypeOf?: GraphQLIsTypeOfFn; + __extensions?: Record; + __astNode?: ObjectTypeDefinitionNode; + __extensionASTNodes?: ObjectTypeExtensionNode; +}; +export type IInterfaceTypeResolver = { + [key: string]: IFieldResolver | IFieldResolverOptions; +} & { + __name?: string; + __description?: string; + __resolveType?: GraphQLTypeResolver; + __extensions?: Record; + __astNode?: InterfaceTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type IUnionTypeResolver = { + __name?: string; + __description?: string; + __resolveType?: GraphQLTypeResolver; + __extensions?: Record; + __astNode?: UnionTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type IInputObjectTypeResolver = { + __name?: string; + __description?: string; + __extensions?: Record; + __astNode?: InputObjectTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type ISchemaLevelResolver, TReturn = any> = IFieldResolver; +export type IResolvers, TReturn = any> = Record | IObjectTypeResolver | IInterfaceTypeResolver | IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver>; +export type IFieldIteratorFn = (fieldDef: GraphQLField, typeName: string, fieldName: string) => void; +export type IDefaultValueIteratorFn = (type: GraphQLInputType, value: any) => void; +export type NextResolverFn = () => Promise; +export type VisitableSchemaType = GraphQLSchema | GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType | GraphQLNamedType | GraphQLScalarType | GraphQLField | GraphQLInputField | GraphQLArgument | GraphQLUnionType | GraphQLEnumType | GraphQLEnumValue; +export declare enum MapperKind { + TYPE = "MapperKind.TYPE", + SCALAR_TYPE = "MapperKind.SCALAR_TYPE", + ENUM_TYPE = "MapperKind.ENUM_TYPE", + COMPOSITE_TYPE = "MapperKind.COMPOSITE_TYPE", + OBJECT_TYPE = "MapperKind.OBJECT_TYPE", + INPUT_OBJECT_TYPE = "MapperKind.INPUT_OBJECT_TYPE", + ABSTRACT_TYPE = "MapperKind.ABSTRACT_TYPE", + UNION_TYPE = "MapperKind.UNION_TYPE", + INTERFACE_TYPE = "MapperKind.INTERFACE_TYPE", + ROOT_OBJECT = "MapperKind.ROOT_OBJECT", + QUERY = "MapperKind.QUERY", + MUTATION = "MapperKind.MUTATION", + SUBSCRIPTION = "MapperKind.SUBSCRIPTION", + DIRECTIVE = "MapperKind.DIRECTIVE", + FIELD = "MapperKind.FIELD", + COMPOSITE_FIELD = "MapperKind.COMPOSITE_FIELD", + OBJECT_FIELD = "MapperKind.OBJECT_FIELD", + ROOT_FIELD = "MapperKind.ROOT_FIELD", + QUERY_ROOT_FIELD = "MapperKind.QUERY_ROOT_FIELD", + MUTATION_ROOT_FIELD = "MapperKind.MUTATION_ROOT_FIELD", + SUBSCRIPTION_ROOT_FIELD = "MapperKind.SUBSCRIPTION_ROOT_FIELD", + INTERFACE_FIELD = "MapperKind.INTERFACE_FIELD", + INPUT_OBJECT_FIELD = "MapperKind.INPUT_OBJECT_FIELD", + ARGUMENT = "MapperKind.ARGUMENT", + ENUM_VALUE = "MapperKind.ENUM_VALUE" +} +export interface SchemaMapper { + [MapperKind.TYPE]?: NamedTypeMapper; + [MapperKind.SCALAR_TYPE]?: ScalarTypeMapper; + [MapperKind.ENUM_TYPE]?: EnumTypeMapper; + [MapperKind.COMPOSITE_TYPE]?: CompositeTypeMapper; + [MapperKind.OBJECT_TYPE]?: ObjectTypeMapper; + [MapperKind.INPUT_OBJECT_TYPE]?: InputObjectTypeMapper; + [MapperKind.ABSTRACT_TYPE]?: AbstractTypeMapper; + [MapperKind.UNION_TYPE]?: UnionTypeMapper; + [MapperKind.INTERFACE_TYPE]?: InterfaceTypeMapper; + [MapperKind.ROOT_OBJECT]?: ObjectTypeMapper; + [MapperKind.QUERY]?: ObjectTypeMapper; + [MapperKind.MUTATION]?: ObjectTypeMapper; + [MapperKind.SUBSCRIPTION]?: ObjectTypeMapper; + [MapperKind.ENUM_VALUE]?: EnumValueMapper; + [MapperKind.FIELD]?: GenericFieldMapper | GraphQLInputFieldConfig>; + [MapperKind.OBJECT_FIELD]?: FieldMapper; + [MapperKind.ROOT_FIELD]?: FieldMapper; + [MapperKind.QUERY_ROOT_FIELD]?: FieldMapper; + [MapperKind.MUTATION_ROOT_FIELD]?: FieldMapper; + [MapperKind.SUBSCRIPTION_ROOT_FIELD]?: FieldMapper; + [MapperKind.INTERFACE_FIELD]?: FieldMapper; + [MapperKind.COMPOSITE_FIELD]?: FieldMapper; + [MapperKind.ARGUMENT]?: ArgumentMapper; + [MapperKind.INPUT_OBJECT_FIELD]?: InputFieldMapper; + [MapperKind.DIRECTIVE]?: DirectiveMapper; +} +export type SchemaFieldMapperTypes = Array; +export type NamedTypeMapper = (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined; +export type ScalarTypeMapper = (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined; +export type EnumTypeMapper = (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined; +export type EnumValueMapper = (valueConfig: GraphQLEnumValueConfig, typeName: string, schema: GraphQLSchema, externalValue: string) => GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined; +export type CompositeTypeMapper = (type: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined; +export type ObjectTypeMapper = (type: GraphQLObjectType, schema: GraphQLSchema) => GraphQLObjectType | null | undefined; +export type InputObjectTypeMapper = (type: GraphQLInputObjectType, schema: GraphQLSchema) => GraphQLInputObjectType | null | undefined; +export type AbstractTypeMapper = (type: GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLInterfaceType | GraphQLUnionType | null | undefined; +export type UnionTypeMapper = (type: GraphQLUnionType, schema: GraphQLSchema) => GraphQLUnionType | null | undefined; +export type InterfaceTypeMapper = (type: GraphQLInterfaceType, schema: GraphQLSchema) => GraphQLInterfaceType | null | undefined; +export type DirectiveMapper = (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined; +export type GenericFieldMapper | GraphQLInputFieldConfig> = (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined; +export type FieldMapper = GenericFieldMapper>; +export type ArgumentMapper = (argumentConfig: GraphQLArgumentConfig, fieldName: string, typeName: string, schema: GraphQLSchema) => GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined; +export type InputFieldMapper = GenericFieldMapper; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.ts new file mode 100644 index 00000000..9fa06440 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Interfaces.d.ts @@ -0,0 +1,302 @@ +import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLScalarLiteralParser, GraphQLScalarSerializer, GraphQLScalarType, GraphQLScalarValueParser, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, GraphQLResolveInfo as OrigGraphQLResolveInfo, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SelectionNode, Source, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql'; +import { TypedDocumentNode } from '@graphql-typed-document-node/core'; +/** + * The result of GraphQL execution. + * + * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. + * - `hasNext` is true if a future payload is expected. + * - `extensions` is reserved for adding non-standard properties. + */ +export interface ExecutionResult { + incremental?: ReadonlyArray>; + data?: TData | null; + errors?: ReadonlyArray; + hasNext?: boolean; + extensions?: TExtensions; + label?: string; + path?: ReadonlyArray; + items?: TData | null; +} +export interface GraphQLResolveInfo extends OrigGraphQLResolveInfo { + signal?: AbortSignal; + /** Returns the AbortSignal supplied for this execution, if any. */ + readonly getAbortSignal: () => AbortSignal | undefined; + /** Returns helper functions for tracking asynchronous resolver work. */ + readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers; +} +export interface GraphQLResolveInfoHelpers { + /** + * Promise.all wrapper that allows rejected branches to be tracked + * as execution async work. + * + * Intended use: return or await this promise from resolver work. + * Un-awaited async side effects are an anti-pattern: + * + * const { promiseAll } = info.getAsyncHelpers(); + * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined); + * + * In that anti-pattern, tracking starts only after rejection (on a + * later microtask), so this work is not guaranteed to delay + * `hooks.asyncWorkFinished`. + * + * Use `track(...)` for un-awaited async side effects: + * + * const { track } = info.getAsyncHelpers(); + * track([ + * someAsyncWork().catch(() => undefined), + * someOtherAsyncWork().catch(() => undefined) + * ]); + */ + readonly promiseAll: (values: ReadonlyArray | T>) => Promise>; + /** Tracks asynchronous work that should delay execution completion hooks. */ + readonly track: (maybePromises: ReadonlyArray) => void; +} +export interface ExecutionRequest = any, TContext = any, TRootValue = any, TExtensions = Record, TReturn = any> { + document: TypedDocumentNode; + variables?: TVariables; + operationType?: OperationTypeNode; + operationName?: string; + extensions?: TExtensions; + rootValue?: TRootValue; + context?: TContext; + subgraphName?: string; + info?: GraphQLResolveInfo; + signal?: AbortSignal; + /** + * Enable/Disable the addition of field schema coordinate in GraphQL Errors extension + * + * Note: Schema Coordinate are exposed using Symbol.for('schemaCoordinate') so that it's not + * serialized. Exposing schema coordinate can ease the discovery of private schemas. + */ + schemaCoordinateInErrors?: boolean; +} +export interface GraphQLParseOptions { + noLocation?: boolean; + allowLegacySDLEmptyFields?: boolean; + allowLegacySDLImplementsInterfaces?: boolean; + experimentalFragmentVariables?: boolean; + /** + * Set to `true` in order to convert all GraphQL comments (marked with # sign) to descriptions (""") + * GraphQL has built-in support for transforming descriptions to comments (with `print`), but not while + * parsing. Turning the flag on will support the other way as well (`parse`) + */ + commentDescriptions?: boolean; +} +export type ValidatorBehavior = 'error' | 'warn' | 'ignore'; +/** + * Options for validating resolvers + */ +export interface IResolverValidationOptions { + /** + * Enable to require a resolver to be defined for any field that has + * arguments. Defaults to `ignore`. + */ + requireResolversForArgs?: ValidatorBehavior; + /** + * Enable to require a resolver to be defined for any field which has + * a return type that isn't a scalar. Defaults to `ignore`. + */ + requireResolversForNonScalar?: ValidatorBehavior; + /** + * Enable to require a resolver for be defined for all fields defined + * in the schema. Defaults to `ignore`. + */ + requireResolversForAllFields?: ValidatorBehavior; + /** + * Enable to require a `resolveType()` for Interface and Union types. + * Defaults to `ignore`. + */ + requireResolversForResolveType?: ValidatorBehavior; + /** + * Enable to require all defined resolvers to match fields that + * actually exist in the schema. Defaults to `error` to catch common errors. + */ + requireResolversToMatchSchema?: ValidatorBehavior; +} +/** + * Configuration object for adding resolvers to a schema + */ +export interface IAddResolversToSchemaOptions { + /** + * The schema to which to add resolvers + */ + schema: GraphQLSchema; + /** + * Object describing the field resolvers to add to the provided schema + */ + resolvers: IResolvers; + /** + * Override the default field resolver provided by `graphql-js` + */ + defaultFieldResolver?: IFieldResolver; + /** + * Additional options for validating the provided resolvers + */ + resolverValidationOptions?: IResolverValidationOptions; + /** + * GraphQL object types that implement interfaces will inherit any missing + * resolvers from their interface types defined in the `resolvers` object + */ + inheritResolversFromInterfaces?: boolean; + /** + * Set to `true` to modify the existing schema instead of creating a new one + */ + updateResolversInPlace?: boolean; +} +export type IScalarTypeResolver = GraphQLScalarType & { + __name?: string; + __description?: string; + __serialize?: GraphQLScalarSerializer; + __parseValue?: GraphQLScalarValueParser; + __parseLiteral?: GraphQLScalarLiteralParser; + __extensions?: Record; + __astNode?: ScalarTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type IEnumTypeResolver = Record & { + __name?: string; + __description?: string; + __extensions?: Record; + __astNode?: EnumTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export interface IFieldResolverOptions { + name?: string; + description?: string; + type?: GraphQLOutputType; + args?: Array; + resolve?: IFieldResolver; + subscribe?: IFieldResolver; + isDeprecated?: boolean; + deprecationReason?: string; + extensions?: Record; + astNode?: FieldDefinitionNode; +} +export type FieldNodeMapper = (fieldNode: FieldNode, fragments: Record, transformationContext: Record) => SelectionNode | Array; +export type FieldNodeMappers = Record>; +export type InputFieldFilter = (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean; +export type FieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig | GraphQLInputFieldConfig) => boolean; +export type ObjectFieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig) => boolean; +export type RootFieldFilter = (operation: 'Query' | 'Mutation' | 'Subscription', rootFieldName: string, fieldConfig: GraphQLFieldConfig) => boolean; +export type TypeFilter = (typeName: string, type: GraphQLType) => boolean; +export type ArgumentFilter = (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean; +export type DirectiveFilter = (directiveName: string, directive: GraphQLDirective) => boolean; +export type EnumValueFilter = (typeName: string, valueName: string, valueConfig: GraphQLEnumValueConfig) => boolean; +export type RenameTypesOptions = { + renameBuiltins: boolean; + renameScalars: boolean; +}; +export type IFieldResolver, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn; +export type TypeSource = string | Source | DocumentNode | GraphQLSchema | DefinitionNode | Array | (() => TypeSource); +export type IObjectTypeResolver = { + [key: string]: IFieldResolver | IFieldResolverOptions; +} & { + __name?: string; + __description?: string; + __isTypeOf?: GraphQLIsTypeOfFn; + __extensions?: Record; + __astNode?: ObjectTypeDefinitionNode; + __extensionASTNodes?: ObjectTypeExtensionNode; +}; +export type IInterfaceTypeResolver = { + [key: string]: IFieldResolver | IFieldResolverOptions; +} & { + __name?: string; + __description?: string; + __resolveType?: GraphQLTypeResolver; + __extensions?: Record; + __astNode?: InterfaceTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type IUnionTypeResolver = { + __name?: string; + __description?: string; + __resolveType?: GraphQLTypeResolver; + __extensions?: Record; + __astNode?: UnionTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type IInputObjectTypeResolver = { + __name?: string; + __description?: string; + __extensions?: Record; + __astNode?: InputObjectTypeDefinitionNode; + __extensionASTNodes?: Array; +}; +export type ISchemaLevelResolver, TReturn = any> = IFieldResolver; +export type IResolvers, TReturn = any> = Record | IObjectTypeResolver | IInterfaceTypeResolver | IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver>; +export type IFieldIteratorFn = (fieldDef: GraphQLField, typeName: string, fieldName: string) => void; +export type IDefaultValueIteratorFn = (type: GraphQLInputType, value: any) => void; +export type NextResolverFn = () => Promise; +export type VisitableSchemaType = GraphQLSchema | GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType | GraphQLNamedType | GraphQLScalarType | GraphQLField | GraphQLInputField | GraphQLArgument | GraphQLUnionType | GraphQLEnumType | GraphQLEnumValue; +export declare enum MapperKind { + TYPE = "MapperKind.TYPE", + SCALAR_TYPE = "MapperKind.SCALAR_TYPE", + ENUM_TYPE = "MapperKind.ENUM_TYPE", + COMPOSITE_TYPE = "MapperKind.COMPOSITE_TYPE", + OBJECT_TYPE = "MapperKind.OBJECT_TYPE", + INPUT_OBJECT_TYPE = "MapperKind.INPUT_OBJECT_TYPE", + ABSTRACT_TYPE = "MapperKind.ABSTRACT_TYPE", + UNION_TYPE = "MapperKind.UNION_TYPE", + INTERFACE_TYPE = "MapperKind.INTERFACE_TYPE", + ROOT_OBJECT = "MapperKind.ROOT_OBJECT", + QUERY = "MapperKind.QUERY", + MUTATION = "MapperKind.MUTATION", + SUBSCRIPTION = "MapperKind.SUBSCRIPTION", + DIRECTIVE = "MapperKind.DIRECTIVE", + FIELD = "MapperKind.FIELD", + COMPOSITE_FIELD = "MapperKind.COMPOSITE_FIELD", + OBJECT_FIELD = "MapperKind.OBJECT_FIELD", + ROOT_FIELD = "MapperKind.ROOT_FIELD", + QUERY_ROOT_FIELD = "MapperKind.QUERY_ROOT_FIELD", + MUTATION_ROOT_FIELD = "MapperKind.MUTATION_ROOT_FIELD", + SUBSCRIPTION_ROOT_FIELD = "MapperKind.SUBSCRIPTION_ROOT_FIELD", + INTERFACE_FIELD = "MapperKind.INTERFACE_FIELD", + INPUT_OBJECT_FIELD = "MapperKind.INPUT_OBJECT_FIELD", + ARGUMENT = "MapperKind.ARGUMENT", + ENUM_VALUE = "MapperKind.ENUM_VALUE" +} +export interface SchemaMapper { + [MapperKind.TYPE]?: NamedTypeMapper; + [MapperKind.SCALAR_TYPE]?: ScalarTypeMapper; + [MapperKind.ENUM_TYPE]?: EnumTypeMapper; + [MapperKind.COMPOSITE_TYPE]?: CompositeTypeMapper; + [MapperKind.OBJECT_TYPE]?: ObjectTypeMapper; + [MapperKind.INPUT_OBJECT_TYPE]?: InputObjectTypeMapper; + [MapperKind.ABSTRACT_TYPE]?: AbstractTypeMapper; + [MapperKind.UNION_TYPE]?: UnionTypeMapper; + [MapperKind.INTERFACE_TYPE]?: InterfaceTypeMapper; + [MapperKind.ROOT_OBJECT]?: ObjectTypeMapper; + [MapperKind.QUERY]?: ObjectTypeMapper; + [MapperKind.MUTATION]?: ObjectTypeMapper; + [MapperKind.SUBSCRIPTION]?: ObjectTypeMapper; + [MapperKind.ENUM_VALUE]?: EnumValueMapper; + [MapperKind.FIELD]?: GenericFieldMapper | GraphQLInputFieldConfig>; + [MapperKind.OBJECT_FIELD]?: FieldMapper; + [MapperKind.ROOT_FIELD]?: FieldMapper; + [MapperKind.QUERY_ROOT_FIELD]?: FieldMapper; + [MapperKind.MUTATION_ROOT_FIELD]?: FieldMapper; + [MapperKind.SUBSCRIPTION_ROOT_FIELD]?: FieldMapper; + [MapperKind.INTERFACE_FIELD]?: FieldMapper; + [MapperKind.COMPOSITE_FIELD]?: FieldMapper; + [MapperKind.ARGUMENT]?: ArgumentMapper; + [MapperKind.INPUT_OBJECT_FIELD]?: InputFieldMapper; + [MapperKind.DIRECTIVE]?: DirectiveMapper; +} +export type SchemaFieldMapperTypes = Array; +export type NamedTypeMapper = (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined; +export type ScalarTypeMapper = (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined; +export type EnumTypeMapper = (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined; +export type EnumValueMapper = (valueConfig: GraphQLEnumValueConfig, typeName: string, schema: GraphQLSchema, externalValue: string) => GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined; +export type CompositeTypeMapper = (type: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined; +export type ObjectTypeMapper = (type: GraphQLObjectType, schema: GraphQLSchema) => GraphQLObjectType | null | undefined; +export type InputObjectTypeMapper = (type: GraphQLInputObjectType, schema: GraphQLSchema) => GraphQLInputObjectType | null | undefined; +export type AbstractTypeMapper = (type: GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLInterfaceType | GraphQLUnionType | null | undefined; +export type UnionTypeMapper = (type: GraphQLUnionType, schema: GraphQLSchema) => GraphQLUnionType | null | undefined; +export type InterfaceTypeMapper = (type: GraphQLInterfaceType, schema: GraphQLSchema) => GraphQLInterfaceType | null | undefined; +export type DirectiveMapper = (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined; +export type GenericFieldMapper | GraphQLInputFieldConfig> = (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined; +export type FieldMapper = GenericFieldMapper>; +export type ArgumentMapper = (argumentConfig: GraphQLArgumentConfig, fieldName: string, typeName: string, schema: GraphQLSchema) => GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined; +export type InputFieldMapper = GenericFieldMapper; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.cts new file mode 100644 index 00000000..760c7d51 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.cts @@ -0,0 +1,18 @@ +import { Maybe } from './types.cjs'; +export interface Path { + readonly prev: Path | undefined; + readonly key: string | number; + readonly typename: string | undefined; +} +/** + * Given a Path and a key, return a new Path containing the new key. + */ +export declare function addPath(prev: Readonly | undefined, key: string | number, typename: string | undefined): Path; +/** + * Given a Path, return an Array of the path keys. + */ +export declare function pathToArray(path: Maybe>): Array; +/** + * Build a string describing the path. + */ +export declare function printPathArray(path: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.ts new file mode 100644 index 00000000..f44f5a74 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/Path.d.ts @@ -0,0 +1,18 @@ +import { Maybe } from './types.js'; +export interface Path { + readonly prev: Path | undefined; + readonly key: string | number; + readonly typename: string | undefined; +} +/** + * Given a Path and a key, return a new Path containing the new key. + */ +export declare function addPath(prev: Readonly | undefined, key: string | number, typename: string | undefined): Path; +/** + * Given a Path, return an Array of the path keys. + */ +export declare function pathToArray(path: Maybe>): Array; +/** + * Build a string describing the path. + */ +export declare function printPathArray(path: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.cts new file mode 100644 index 00000000..a35a2576 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.cts @@ -0,0 +1,2 @@ +import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql'; +export declare function addTypes(schema: GraphQLSchema, newTypesOrDirectives: Array): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.ts new file mode 100644 index 00000000..a35a2576 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/addTypes.d.ts @@ -0,0 +1,2 @@ +import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql'; +export declare function addTypes(schema: GraphQLSchema, newTypesOrDirectives: Array): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.cts new file mode 100644 index 00000000..7db4494e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.cts @@ -0,0 +1,2 @@ +import { GraphQLType, TypeNode } from 'graphql'; +export declare function astFromType(type: GraphQLType): TypeNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.ts new file mode 100644 index 00000000..7db4494e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromType.d.ts @@ -0,0 +1,2 @@ +import { GraphQLType, TypeNode } from 'graphql'; +export declare function astFromType(type: GraphQLType): TypeNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.cts new file mode 100644 index 00000000..5888a7c1 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.cts @@ -0,0 +1,25 @@ +import { GraphQLInputType, ValueNode } from 'graphql'; +import { Maybe } from './types.cjs'; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. For example: + * + * astFromValue("value", GraphQLString) + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | BigInt | Int | + * | Unknown | Enum Value | + * | null | NullValue | + * + */ +export declare function astFromValue(value: unknown, type: GraphQLInputType): Maybe; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.ts new file mode 100644 index 00000000..b3069b40 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValue.d.ts @@ -0,0 +1,25 @@ +import { GraphQLInputType, ValueNode } from 'graphql'; +import { Maybe } from './types.js'; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. For example: + * + * astFromValue("value", GraphQLString) + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | BigInt | Int | + * | Unknown | Enum Value | + * | null | NullValue | + * + */ +export declare function astFromValue(value: unknown, type: GraphQLInputType): Maybe; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.cts new file mode 100644 index 00000000..d6921e94 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.cts @@ -0,0 +1,18 @@ +import { ValueNode } from 'graphql'; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using the following mapping. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String | + * | Number | Int / Float | + * | BigInt | Int | + * | null | NullValue | + * + */ +export declare function astFromValueUntyped(value: any): ValueNode | null; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.ts new file mode 100644 index 00000000..d6921e94 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/astFromValueUntyped.d.ts @@ -0,0 +1,18 @@ +import { ValueNode } from 'graphql'; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using the following mapping. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String | + * | Number | Int / Float | + * | BigInt | Int | + * | null | NullValue | + * + */ +export declare function astFromValueUntyped(value: any): ValueNode | null; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.cts new file mode 100644 index 00000000..c513d931 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.cts @@ -0,0 +1,18 @@ +import { GraphQLSchema, OperationDefinitionNode, OperationTypeNode } from 'graphql'; +export type Skip = string[]; +export type Force = string[]; +export type Ignore = string[]; +export type SelectedFields = { + [key: string]: SelectedFields; +} | boolean; +export declare function buildOperationNodeForField({ schema, kind, field, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, }: { + schema: GraphQLSchema; + kind: OperationTypeNode; + field: string; + models?: string[]; + ignore?: Ignore; + depthLimit?: number; + circularReferenceDepth?: number; + argNames?: string[]; + selectedFields?: SelectedFields; +}): OperationDefinitionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.ts new file mode 100644 index 00000000..c513d931 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/build-operation-for-field.d.ts @@ -0,0 +1,18 @@ +import { GraphQLSchema, OperationDefinitionNode, OperationTypeNode } from 'graphql'; +export type Skip = string[]; +export type Force = string[]; +export type Ignore = string[]; +export type SelectedFields = { + [key: string]: SelectedFields; +} | boolean; +export declare function buildOperationNodeForField({ schema, kind, field, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, }: { + schema: GraphQLSchema; + kind: OperationTypeNode; + field: string; + models?: string[]; + ignore?: Ignore; + depthLimit?: number; + circularReferenceDepth?: number; + argNames?: string[]; + selectedFields?: SelectedFields; +}): OperationDefinitionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.cts new file mode 100644 index 00000000..13057cbe --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.cts @@ -0,0 +1,50 @@ +import { FieldNode, FragmentDefinitionNode, FragmentSpreadNode, GraphQLObjectType, GraphQLSchema, InlineFragmentNode, SelectionSetNode } from 'graphql'; +import { VariableValues } from './types.cjs'; +export interface PatchFields { + label: string | undefined; + fields: Map>; +} +export interface FieldsAndPatches { + fields: Map>; + patches: Array; +} +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + */ +export declare function collectFields(schema: GraphQLSchema, fragments: Record, variableValues: VariableValues, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode): FieldsAndPatches; +/** + * Determines if a field should be included based on the `@include` and `@skip` + * directives, where `@skip` has higher precedence than `@include`. + */ +export declare function shouldIncludeNode(variableValues: VariableValues, node: FragmentSpreadNode | FieldNode | InlineFragmentNode): boolean; +/** + * Determines if a fragment is applicable to the given type. + */ +export declare function doesFragmentConditionMatch(schema: GraphQLSchema, fragment: FragmentDefinitionNode | InlineFragmentNode, type: GraphQLObjectType): boolean; +/** + * Implements the logic to compute the key of a given field's entry + */ +export declare function getFieldEntryKey(node: FieldNode): string; +/** + * Returns an object containing the `@defer` arguments if a field should be + * deferred based on the experimental flag, defer directive present and + * not disabled by the "if" argument. + */ +export declare function getDeferValues(variableValues: VariableValues, node: FragmentSpreadNode | InlineFragmentNode): undefined | { + label: string | undefined; +}; +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + */ +export declare const collectSubFields: (schema: GraphQLSchema, fragments: Record, variableValues: VariableValues, returnType: GraphQLObjectType, fieldNodes: Array) => FieldsAndPatches; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.ts new file mode 100644 index 00000000..0d3c339a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/collectFields.d.ts @@ -0,0 +1,50 @@ +import { FieldNode, FragmentDefinitionNode, FragmentSpreadNode, GraphQLObjectType, GraphQLSchema, InlineFragmentNode, SelectionSetNode } from 'graphql'; +import { VariableValues } from './types.js'; +export interface PatchFields { + label: string | undefined; + fields: Map>; +} +export interface FieldsAndPatches { + fields: Map>; + patches: Array; +} +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + */ +export declare function collectFields(schema: GraphQLSchema, fragments: Record, variableValues: VariableValues, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode): FieldsAndPatches; +/** + * Determines if a field should be included based on the `@include` and `@skip` + * directives, where `@skip` has higher precedence than `@include`. + */ +export declare function shouldIncludeNode(variableValues: VariableValues, node: FragmentSpreadNode | FieldNode | InlineFragmentNode): boolean; +/** + * Determines if a fragment is applicable to the given type. + */ +export declare function doesFragmentConditionMatch(schema: GraphQLSchema, fragment: FragmentDefinitionNode | InlineFragmentNode, type: GraphQLObjectType): boolean; +/** + * Implements the logic to compute the key of a given field's entry + */ +export declare function getFieldEntryKey(node: FieldNode): string; +/** + * Returns an object containing the `@defer` arguments if a field should be + * deferred based on the experimental flag, defer directive present and + * not disabled by the "if" argument. + */ +export declare function getDeferValues(variableValues: VariableValues, node: FragmentSpreadNode | InlineFragmentNode): undefined | { + label: string | undefined; +}; +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + */ +export declare const collectSubFields: (schema: GraphQLSchema, fragments: Record, variableValues: VariableValues, returnType: GraphQLObjectType, fieldNodes: Array) => FieldsAndPatches; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.cts new file mode 100644 index 00000000..33672b40 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.cts @@ -0,0 +1,30 @@ +import { ASTNode, DefinitionNode, Location, NameNode, StringValueNode } from 'graphql'; +export type NamedDefinitionNode = DefinitionNode & { + name?: NameNode; +}; +export declare function resetComments(): void; +export declare function collectComment(node: NamedDefinitionNode): void; +export declare function pushComment(node: any, entity: string, field?: string, argument?: string): void; +export declare function printComment(comment: string): string; +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ +export declare function printWithComments(ast: ASTNode): string; +export declare function getDescription(node: { + description?: StringValueNode; + loc?: Location; +}, options?: { + commentDescriptions?: boolean; +}): string | undefined; +export declare function getComment(node: { + loc?: Location; +}): undefined | string; +export declare function getLeadingCommentBlock(node: { + loc?: Location; +}): void | string; +export declare function dedentBlockStringValue(rawString: string): string; +/** + * @internal + */ +export declare function getBlockStringIndentation(lines: ReadonlyArray): number; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.ts new file mode 100644 index 00000000..33672b40 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/comments.d.ts @@ -0,0 +1,30 @@ +import { ASTNode, DefinitionNode, Location, NameNode, StringValueNode } from 'graphql'; +export type NamedDefinitionNode = DefinitionNode & { + name?: NameNode; +}; +export declare function resetComments(): void; +export declare function collectComment(node: NamedDefinitionNode): void; +export declare function pushComment(node: any, entity: string, field?: string, argument?: string): void; +export declare function printComment(comment: string): string; +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ +export declare function printWithComments(ast: ASTNode): string; +export declare function getDescription(node: { + description?: StringValueNode; + loc?: Location; +}, options?: { + commentDescriptions?: boolean; +}): string | undefined; +export declare function getComment(node: { + loc?: Location; +}): undefined | string; +export declare function getLeadingCommentBlock(node: { + loc?: Location; +}): void | string; +export declare function dedentBlockStringValue(rawString: string): string; +/** + * @internal + */ +export declare function getBlockStringIndentation(lines: ReadonlyArray): number; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.cts new file mode 100644 index 00000000..ba57b905 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.cts @@ -0,0 +1,2 @@ +export declare function debugTimerStart(name: string): void; +export declare function debugTimerEnd(name: string): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.ts new file mode 100644 index 00000000..ba57b905 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/debugTimer.d.ts @@ -0,0 +1,2 @@ +export declare function debugTimerStart(name: string): void; +export declare function debugTimerEnd(name: string): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.cts new file mode 100644 index 00000000..7b9d72a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.cts @@ -0,0 +1,9 @@ +import { type GraphQLArgument, type GraphQLInputField, type ValueNode } from 'graphql'; +/** + * `defaultValueAstFromType` extracts default value from `GraphQLArgument` or `GraphQLInputField`, if available + * This is compatible with all `graphql` versions + * + * The return type is `ConstValueNode` in graphql@16+, + * but it is not available in graphql@15 so `ValueNode` is used as return type here and `as any` is often required at callsites for backwards compatibility, + */ +export declare const defaultValueAstFromType: (arg: GraphQLArgument | GraphQLInputField) => ValueNode | undefined; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.ts new file mode 100644 index 00000000..7b9d72a9 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/defaultValueAstFromType.d.ts @@ -0,0 +1,9 @@ +import { type GraphQLArgument, type GraphQLInputField, type ValueNode } from 'graphql'; +/** + * `defaultValueAstFromType` extracts default value from `GraphQLArgument` or `GraphQLInputField`, if available + * This is compatible with all `graphql` versions + * + * The return type is `ConstValueNode` in graphql@16+, + * but it is not available in graphql@15 so `ValueNode` is used as return type here and `as any` is often required at callsites for backwards compatibility, + */ +export declare const defaultValueAstFromType: (arg: GraphQLArgument | GraphQLInputField) => ValueNode | undefined; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.cts new file mode 100644 index 00000000..87563fde --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.cts @@ -0,0 +1,9 @@ +import { type StringValueNode } from 'graphql'; +interface ObjectWithDescription { + astNode?: { + description?: StringValueNode | null; + } | null; + description?: string | null; +} +export declare function getDescriptionNode(obj: ObjectWithDescription): StringValueNode | undefined; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.ts new file mode 100644 index 00000000..87563fde --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/descriptionFromObject.d.ts @@ -0,0 +1,9 @@ +import { type StringValueNode } from 'graphql'; +interface ObjectWithDescription { + astNode?: { + description?: StringValueNode | null; + } | null; + description?: string | null; +} +export declare function getDescriptionNode(obj: ObjectWithDescription): StringValueNode | undefined; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.cts new file mode 100644 index 00000000..8851f8c8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.cts @@ -0,0 +1,9 @@ +import { GraphQLDirective } from 'graphql'; +/** + * Used to conditionally defer fragments. + */ +export declare const GraphQLDeferDirective: GraphQLDirective; +/** + * Used to conditionally stream list fields. + */ +export declare const GraphQLStreamDirective: GraphQLDirective; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.ts new file mode 100644 index 00000000..8851f8c8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/directives.d.ts @@ -0,0 +1,9 @@ +import { GraphQLDirective } from 'graphql'; +/** + * Used to conditionally defer fragments. + */ +export declare const GraphQLDeferDirective: GraphQLDirective; +/** + * Used to conditionally stream list fields. + */ +export declare const GraphQLStreamDirective: GraphQLDirective; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.cts new file mode 100644 index 00000000..6f4bd30c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.cts @@ -0,0 +1,33 @@ +import { ASTNode, GraphQLError, Source } from 'graphql'; +import { Maybe } from './types.cjs'; +interface GraphQLErrorOptions { + nodes?: ReadonlyArray | ASTNode | null; + source?: Maybe; + positions?: Maybe>; + path?: Maybe>; + originalError?: Maybe; + extensions?: any; + coordinate?: string; +} +declare module 'graphql' { + interface GraphQLError { + /** + * An optional schema coordinate (e.g. "MyType.myField") associated with this error. + */ + readonly coordinate?: string; + } +} +export declare function isGraphQLErrorLike(error: any): boolean; +export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError; +type SchemaCoordinateInfo = { + fieldName: string; + parentType: { + name: string; + }; +}; +export declare function getSchemaCoordinate(error: GraphQLError): string | undefined; +export declare function locatedError(rawError: unknown, nodes: ASTNode | ReadonlyArray | undefined, path: Maybe>, info?: SchemaCoordinateInfo | false | null | undefined): GraphQLError; +export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray, info?: SchemaCoordinateInfo | false | null | undefined): GraphQLError; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.ts new file mode 100644 index 00000000..621333d2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/errors.d.ts @@ -0,0 +1,33 @@ +import { ASTNode, GraphQLError, Source } from 'graphql'; +import { Maybe } from './types.js'; +interface GraphQLErrorOptions { + nodes?: ReadonlyArray | ASTNode | null; + source?: Maybe; + positions?: Maybe>; + path?: Maybe>; + originalError?: Maybe; + extensions?: any; + coordinate?: string; +} +declare module 'graphql' { + interface GraphQLError { + /** + * An optional schema coordinate (e.g. "MyType.myField") associated with this error. + */ + readonly coordinate?: string; + } +} +export declare function isGraphQLErrorLike(error: any): boolean; +export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError; +type SchemaCoordinateInfo = { + fieldName: string; + parentType: { + name: string; + }; +}; +export declare function getSchemaCoordinate(error: GraphQLError): string | undefined; +export declare function locatedError(rawError: unknown, nodes: ASTNode | ReadonlyArray | undefined, path: Maybe>, info?: SchemaCoordinateInfo | false | null | undefined): GraphQLError; +export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray, info?: SchemaCoordinateInfo | false | null | undefined): GraphQLError; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.cts new file mode 100644 index 00000000..c8dca117 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.cts @@ -0,0 +1,10 @@ +import type { MaybePromise } from '@whatwg-node/promise-helpers'; +import { ExecutionRequest, ExecutionResult } from './Interfaces.cjs'; +export type { MaybePromise } from '@whatwg-node/promise-helpers'; +export type MaybeAsyncIterable = AsyncIterable | T; +export type AsyncExecutor, TBaseExtensions = Record> = = Record, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest) => Promise>>; +export type SyncExecutor, TBaseExtensions = Record> = = Record, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest) => ExecutionResult; +export type Executor, TBaseExtensions = Record> = = Record, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest) => MaybePromise>>; +export type DisposableSyncExecutor, TBaseExtensions = Record> = SyncExecutor & Disposable; +export type DisposableAsyncExecutor, TBaseExtensions = Record> = AsyncExecutor & AsyncDisposable; +export type DisposableExecutor, TBaseExtensions = Record> = DisposableSyncExecutor | DisposableAsyncExecutor; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.ts new file mode 100644 index 00000000..d6ba7fc0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/executor.d.ts @@ -0,0 +1,10 @@ +import type { MaybePromise } from '@whatwg-node/promise-helpers'; +import { ExecutionRequest, ExecutionResult } from './Interfaces.js'; +export type { MaybePromise } from '@whatwg-node/promise-helpers'; +export type MaybeAsyncIterable = AsyncIterable | T; +export type AsyncExecutor, TBaseExtensions = Record> = = Record, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest) => Promise>>; +export type SyncExecutor, TBaseExtensions = Record> = = Record, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest) => ExecutionResult; +export type Executor, TBaseExtensions = Record> = = Record, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest) => MaybePromise>>; +export type DisposableSyncExecutor, TBaseExtensions = Record> = SyncExecutor & Disposable; +export type DisposableAsyncExecutor, TBaseExtensions = Record> = AsyncExecutor & AsyncDisposable; +export type DisposableExecutor, TBaseExtensions = Record> = DisposableSyncExecutor | DisposableAsyncExecutor; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.cts new file mode 100644 index 00000000..a7554f11 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { SchemaExtensions } from './types.cjs'; +export declare function extractExtensionsFromSchema(schema: GraphQLSchema, removeDirectives?: boolean): SchemaExtensions; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.ts new file mode 100644 index 00000000..08b11e14 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/extractExtensionsFromSchema.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { SchemaExtensions } from './types.js'; +export declare function extractExtensionsFromSchema(schema: GraphQLSchema, removeDirectives?: boolean): SchemaExtensions; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.cts new file mode 100644 index 00000000..9ff7efae --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.cts @@ -0,0 +1,5 @@ +import { GraphQLFieldConfig, GraphQLFieldConfigMap, GraphQLSchema } from 'graphql'; +export declare function appendObjectFields(schema: GraphQLSchema, typeName: string, additionalFields: GraphQLFieldConfigMap): GraphQLSchema; +export declare function removeObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig) => boolean): [GraphQLSchema, GraphQLFieldConfigMap]; +export declare function selectObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig) => boolean): GraphQLFieldConfigMap; +export declare function modifyObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig) => boolean, newFields: GraphQLFieldConfigMap): [GraphQLSchema, GraphQLFieldConfigMap]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.ts new file mode 100644 index 00000000..9ff7efae --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fields.d.ts @@ -0,0 +1,5 @@ +import { GraphQLFieldConfig, GraphQLFieldConfigMap, GraphQLSchema } from 'graphql'; +export declare function appendObjectFields(schema: GraphQLSchema, typeName: string, additionalFields: GraphQLFieldConfigMap): GraphQLSchema; +export declare function removeObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig) => boolean): [GraphQLSchema, GraphQLFieldConfigMap]; +export declare function selectObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig) => boolean): GraphQLFieldConfigMap; +export declare function modifyObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig) => boolean, newFields: GraphQLFieldConfigMap): [GraphQLSchema, GraphQLFieldConfigMap]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.cts new file mode 100644 index 00000000..c71a8783 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.cts @@ -0,0 +1,14 @@ +import { GraphQLSchema } from 'graphql'; +import { ArgumentFilter, DirectiveFilter, EnumValueFilter, FieldFilter, RootFieldFilter, TypeFilter } from './Interfaces.cjs'; +export declare function filterSchema({ schema, typeFilter, fieldFilter, rootFieldFilter, objectFieldFilter, interfaceFieldFilter, inputObjectFieldFilter, argumentFilter, directiveFilter, enumValueFilter, }: { + schema: GraphQLSchema; + rootFieldFilter?: RootFieldFilter; + typeFilter?: TypeFilter; + fieldFilter?: FieldFilter; + objectFieldFilter?: FieldFilter; + interfaceFieldFilter?: FieldFilter; + inputObjectFieldFilter?: FieldFilter; + argumentFilter?: ArgumentFilter; + directiveFilter?: DirectiveFilter; + enumValueFilter?: EnumValueFilter; +}): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.ts new file mode 100644 index 00000000..989236f2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/filterSchema.d.ts @@ -0,0 +1,14 @@ +import { GraphQLSchema } from 'graphql'; +import { ArgumentFilter, DirectiveFilter, EnumValueFilter, FieldFilter, RootFieldFilter, TypeFilter } from './Interfaces.js'; +export declare function filterSchema({ schema, typeFilter, fieldFilter, rootFieldFilter, objectFieldFilter, interfaceFieldFilter, inputObjectFieldFilter, argumentFilter, directiveFilter, enumValueFilter, }: { + schema: GraphQLSchema; + rootFieldFilter?: RootFieldFilter; + typeFilter?: TypeFilter; + fieldFilter?: FieldFilter; + objectFieldFilter?: FieldFilter; + interfaceFieldFilter?: FieldFilter; + inputObjectFieldFilter?: FieldFilter; + argumentFilter?: ArgumentFilter; + directiveFilter?: DirectiveFilter; + enumValueFilter?: EnumValueFilter; +}): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.cts new file mode 100644 index 00000000..20bbb05a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.cts @@ -0,0 +1,3 @@ +import { BuildSchemaOptions, GraphQLSchema } from 'graphql'; +import { SchemaPrintOptions } from './types.cjs'; +export declare function fixSchemaAst(schema: GraphQLSchema, options: BuildSchemaOptions & SchemaPrintOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.ts new file mode 100644 index 00000000..90d99fa1 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/fixSchemaAst.d.ts @@ -0,0 +1,3 @@ +import { BuildSchemaOptions, GraphQLSchema } from 'graphql'; +import { SchemaPrintOptions } from './types.js'; +export declare function fixSchemaAst(schema: GraphQLSchema, options: BuildSchemaOptions & SchemaPrintOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.cts new file mode 100644 index 00000000..36c7fc6b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IDefaultValueIteratorFn } from './Interfaces.cjs'; +export declare function forEachDefaultValue(schema: GraphQLSchema, fn: IDefaultValueIteratorFn): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.ts new file mode 100644 index 00000000..d3dad4c8 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachDefaultValue.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IDefaultValueIteratorFn } from './Interfaces.js'; +export declare function forEachDefaultValue(schema: GraphQLSchema, fn: IDefaultValueIteratorFn): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.cts new file mode 100644 index 00000000..010833dd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IFieldIteratorFn } from './Interfaces.cjs'; +export declare function forEachField(schema: GraphQLSchema, fn: IFieldIteratorFn): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.ts new file mode 100644 index 00000000..21cdd420 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/forEachField.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IFieldIteratorFn } from './Interfaces.js'; +export declare function forEachField(schema: GraphQLSchema, fn: IFieldIteratorFn): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.cts new file mode 100644 index 00000000..92dcb7f6 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.cts @@ -0,0 +1,9 @@ +import { DocumentNode } from 'graphql'; +import { DirectiveUsage } from './types.cjs'; +export type ArgumentToDirectives = { + [argumentName: string]: DirectiveUsage[]; +}; +export type TypeAndFieldToArgumentDirectives = { + [typeAndField: string]: ArgumentToDirectives; +}; +export declare function getArgumentsWithDirectives(documentNode: DocumentNode): TypeAndFieldToArgumentDirectives; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.ts new file mode 100644 index 00000000..22c02eee --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-arguments-with-directives.d.ts @@ -0,0 +1,9 @@ +import { DocumentNode } from 'graphql'; +import { DirectiveUsage } from './types.js'; +export type ArgumentToDirectives = { + [argumentName: string]: DirectiveUsage[]; +}; +export type TypeAndFieldToArgumentDirectives = { + [typeAndField: string]: ArgumentToDirectives; +}; +export declare function getArgumentsWithDirectives(documentNode: DocumentNode): TypeAndFieldToArgumentDirectives; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.cts new file mode 100644 index 00000000..72fd8e64 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.cts @@ -0,0 +1,11 @@ +import { GraphQLSchema } from 'graphql'; +import { DirectableObject } from './getDirectiveExtensions.cjs'; +export interface DirectiveAnnotation { + name: string; + args?: Record; +} +export type DirectableGraphQLObject = DirectableObject; +export declare function getDirectivesInExtensions(node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array; +export declare function getDirectiveInExtensions(node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array> | undefined; +export declare function getDirectives(schema: GraphQLSchema, node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array; +export declare function getDirective(schema: GraphQLSchema, node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array> | undefined; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.ts new file mode 100644 index 00000000..70a8731d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-directives.d.ts @@ -0,0 +1,11 @@ +import { GraphQLSchema } from 'graphql'; +import { DirectableObject } from './getDirectiveExtensions.js'; +export interface DirectiveAnnotation { + name: string; + args?: Record; +} +export type DirectableGraphQLObject = DirectableObject; +export declare function getDirectivesInExtensions(node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array; +export declare function getDirectiveInExtensions(node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array> | undefined; +export declare function getDirectives(schema: GraphQLSchema, node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array; +export declare function getDirective(schema: GraphQLSchema, node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array> | undefined; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.cts new file mode 100644 index 00000000..d080dadc --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.cts @@ -0,0 +1,10 @@ +import { DocumentNode } from 'graphql'; +import { DirectiveUsage } from './types.cjs'; +export type TypeAndFieldToDirectives = { + [typeAndField: string]: DirectiveUsage[]; +}; +interface Options { + includeInputTypes?: boolean; +} +export declare function getFieldsWithDirectives(documentNode: DocumentNode, options?: Options): TypeAndFieldToDirectives; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.ts new file mode 100644 index 00000000..dd55434c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-fields-with-directives.d.ts @@ -0,0 +1,10 @@ +import { DocumentNode } from 'graphql'; +import { DirectiveUsage } from './types.js'; +export type TypeAndFieldToDirectives = { + [typeAndField: string]: DirectiveUsage[]; +}; +interface Options { + includeInputTypes?: boolean; +} +export declare function getFieldsWithDirectives(documentNode: DocumentNode, options?: Options): TypeAndFieldToDirectives; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.cts new file mode 100644 index 00000000..03baf91e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.cts @@ -0,0 +1,2 @@ +import { GraphQLSchema } from 'graphql'; +export declare function getImplementingTypes(interfaceName: string, schema: GraphQLSchema): string[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.ts new file mode 100644 index 00000000..03baf91e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/get-implementing-types.d.ts @@ -0,0 +1,2 @@ +import { GraphQLSchema } from 'graphql'; +export declare function getImplementingTypes(interfaceName: string, schema: GraphQLSchema): string[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.cts new file mode 100644 index 00000000..5dafd394 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.cts @@ -0,0 +1,10 @@ +import { DirectiveNode, FieldNode, GraphQLDirective, GraphQLField } from 'graphql'; +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export declare function getArgumentValues(def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Record): Record; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.ts new file mode 100644 index 00000000..5dafd394 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getArgumentValues.d.ts @@ -0,0 +1,10 @@ +import { DirectiveNode, FieldNode, GraphQLDirective, GraphQLField } from 'graphql'; +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export declare function getArgumentValues(def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Record): Record; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.cts new file mode 100644 index 00000000..1f55a107 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.cts @@ -0,0 +1,14 @@ +import type { ASTNode, DirectiveNode, GraphQLSchema } from 'graphql'; +export type DirectableASTNode = ASTNode & { + directives?: readonly DirectiveNode[] | undefined; +}; +export type DirectableObject = { + astNode?: DirectableASTNode | null | undefined; + extensionASTNodes?: readonly DirectableASTNode[] | null | undefined; + extensions?: any; +}; +export declare function getDirectiveExtensions(directableObj: DirectableObject, schema?: GraphQLSchema, pathToDirectivesInExtensions?: string[]): { [directiveName in keyof TDirectiveAnnotationsMap]?: TDirectiveAnnotationsMap[directiveName][] | undefined; }; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.ts new file mode 100644 index 00000000..1f55a107 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveExtensions.d.ts @@ -0,0 +1,14 @@ +import type { ASTNode, DirectiveNode, GraphQLSchema } from 'graphql'; +export type DirectableASTNode = ASTNode & { + directives?: readonly DirectiveNode[] | undefined; +}; +export type DirectableObject = { + astNode?: DirectableASTNode | null | undefined; + extensionASTNodes?: readonly DirectableASTNode[] | null | undefined; + extensions?: any; +}; +export declare function getDirectiveExtensions(directableObj: DirectableObject, schema?: GraphQLSchema, pathToDirectivesInExtensions?: string[]): { [directiveName in keyof TDirectiveAnnotationsMap]?: TDirectiveAnnotationsMap[directiveName][] | undefined; }; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.cts new file mode 100644 index 00000000..c445e9d2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.cts @@ -0,0 +1,10 @@ +import { DirectiveNode, GraphQLDirective } from 'graphql'; +import { VariableValues } from './types.cjs'; +/** + * GraphQL v17's getDirectiveValues function accepts `VariableValues` + * while older versions accept `Record`. This function wraps the original + * getDirectiveValues function to provide compatibility across versions. + */ +export declare function getDirectiveValues>(directiveDef: GraphQLDirective, node: { + readonly directives?: ReadonlyArray | undefined; +}, variableValues?: VariableValues): undefined | Record; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.ts new file mode 100644 index 00000000..c06c098a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getDirectiveValues.d.ts @@ -0,0 +1,10 @@ +import { DirectiveNode, GraphQLDirective } from 'graphql'; +import { VariableValues } from './types.js'; +/** + * GraphQL v17's getDirectiveValues function accepts `VariableValues` + * while older versions accept `Record`. This function wraps the original + * getDirectiveValues function to provide compatibility across versions. + */ +export declare function getDirectiveValues>(directiveDef: GraphQLDirective, node: { + readonly directives?: ReadonlyArray | undefined; +}, variableValues?: VariableValues): undefined | Record; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.cts new file mode 100644 index 00000000..2e6230c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.cts @@ -0,0 +1,3 @@ +import { GraphQLNamedType, GraphQLObjectType } from 'graphql'; +import { Maybe } from './types.cjs'; +export declare function getObjectTypeFromTypeMap(typeMap: Record, type: Maybe): GraphQLObjectType | undefined; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.ts new file mode 100644 index 00000000..544b56ff --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getObjectTypeFromTypeMap.d.ts @@ -0,0 +1,3 @@ +import { GraphQLNamedType, GraphQLObjectType } from 'graphql'; +import { Maybe } from './types.js'; +export declare function getObjectTypeFromTypeMap(typeMap: Record, type: Maybe): GraphQLObjectType | undefined; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.cts new file mode 100644 index 00000000..10567bbd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.cts @@ -0,0 +1,4 @@ +import { DocumentNode, OperationDefinitionNode } from 'graphql'; +import { ExecutionRequest } from './Interfaces.cjs'; +export declare function getOperationASTFromDocument(documentNode: DocumentNode, operationName?: string): OperationDefinitionNode; +export declare const getOperationASTFromRequest: (request: ExecutionRequest) => OperationDefinitionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.ts new file mode 100644 index 00000000..b0e0ccf7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getOperationASTFromRequest.d.ts @@ -0,0 +1,4 @@ +import { DocumentNode, OperationDefinitionNode } from 'graphql'; +import { ExecutionRequest } from './Interfaces.js'; +export declare function getOperationASTFromDocument(documentNode: DocumentNode, operationName?: string): OperationDefinitionNode; +export declare const getOperationASTFromRequest: (request: ExecutionRequest) => OperationDefinitionNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.cts new file mode 100644 index 00000000..8a97b3a2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IResolvers } from './Interfaces.cjs'; +export declare function getResolversFromSchema(schema: GraphQLSchema, includeDefaultMergedResolver?: boolean): IResolvers; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.ts new file mode 100644 index 00000000..4371046f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResolversFromSchema.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema } from 'graphql'; +import { IResolvers } from './Interfaces.js'; +export declare function getResolversFromSchema(schema: GraphQLSchema, includeDefaultMergedResolver?: boolean): IResolvers; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.cts new file mode 100644 index 00000000..8284485b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.cts @@ -0,0 +1,7 @@ +import { GraphQLResolveInfo } from './Interfaces.cjs'; +/** + * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just + * resolves aliases. + * @param info The info argument to the resolver. + */ +export declare function getResponseKeyFromInfo(info: GraphQLResolveInfo): string; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.ts new file mode 100644 index 00000000..f2b4a2a7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/getResponseKeyFromInfo.d.ts @@ -0,0 +1,7 @@ +import { GraphQLResolveInfo } from './Interfaces.js'; +/** + * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just + * resolves aliases. + * @param info The info argument to the resolver. + */ +export declare function getResponseKeyFromInfo(info: GraphQLResolveInfo): string; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.cts new file mode 100644 index 00000000..2077dcf2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.cts @@ -0,0 +1,3 @@ +import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql'; +export declare function healSchema(schema: GraphQLSchema): GraphQLSchema; +export declare function healTypes(originalTypeMap: Record, directives: ReadonlyArray): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.ts new file mode 100644 index 00000000..2077dcf2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/heal.d.ts @@ -0,0 +1,3 @@ +import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql'; +export declare function healSchema(schema: GraphQLSchema): GraphQLSchema; +export declare function healTypes(originalTypeMap: Record, directives: ReadonlyArray): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.cts new file mode 100644 index 00000000..6ab7111a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.cts @@ -0,0 +1,43 @@ +import { ASTNode } from 'graphql'; +/** + * Checks if the given string is a valid URL. + * + * @param str - The string to validate as a URL + * @returns A boolean indicating whether the string is a valid URL + * + * @remarks + * This function first attempts to use the `URL.canParse` method if available. + * If not, it falls back to creating a new `URL` object to validate the string. + */ +export declare function isUrl(str: string): boolean; +export declare const asArray: (fns: T | T[]) => T[]; +/** + * Determines if a given input is a valid GraphQL document string. + * + * @param str - The input to validate as a GraphQL document + * @returns A boolean indicating whether the input is a valid GraphQL document string + * + * @remarks + * This function performs several validation checks: + * - Ensures the input is a string + * - Filters out strings with invalid document extensions + * - Excludes URLs + * - Attempts to parse the string as a GraphQL document + * + * @throws {Error} If the document fails to parse and is empty except GraphQL comments + */ +export declare function isDocumentString(str: any): boolean; +/** + * Checks whether the `str` contains any path illegal characters. + * + * A string may sometimes look like a path but is not (like an SDL of a simple + * GraphQL schema). To make sure we don't yield false-positives in such cases, + * we disallow new lines in paths (even though most Unix systems support new + * lines in file names). + */ +export declare function isValidPath(str: any): boolean; +export declare function compareStrings(a: A, b: B): -1 | 0 | 1; +export declare function nodeToString(a: ASTNode): string; +export declare function compareNodes(a: ASTNode, b: ASTNode, customFn?: (a: any, b: any) => number): number; +export declare function isSome(input: T): input is Exclude; +export declare function assertSome(input: T, message?: string): asserts input is Exclude; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.ts new file mode 100644 index 00000000..6ab7111a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/helpers.d.ts @@ -0,0 +1,43 @@ +import { ASTNode } from 'graphql'; +/** + * Checks if the given string is a valid URL. + * + * @param str - The string to validate as a URL + * @returns A boolean indicating whether the string is a valid URL + * + * @remarks + * This function first attempts to use the `URL.canParse` method if available. + * If not, it falls back to creating a new `URL` object to validate the string. + */ +export declare function isUrl(str: string): boolean; +export declare const asArray: (fns: T | T[]) => T[]; +/** + * Determines if a given input is a valid GraphQL document string. + * + * @param str - The input to validate as a GraphQL document + * @returns A boolean indicating whether the input is a valid GraphQL document string + * + * @remarks + * This function performs several validation checks: + * - Ensures the input is a string + * - Filters out strings with invalid document extensions + * - Excludes URLs + * - Attempts to parse the string as a GraphQL document + * + * @throws {Error} If the document fails to parse and is empty except GraphQL comments + */ +export declare function isDocumentString(str: any): boolean; +/** + * Checks whether the `str` contains any path illegal characters. + * + * A string may sometimes look like a path but is not (like an SDL of a simple + * GraphQL schema). To make sure we don't yield false-positives in such cases, + * we disallow new lines in paths (even though most Unix systems support new + * lines in file names). + */ +export declare function isValidPath(str: any): boolean; +export declare function compareStrings(a: A, b: B): -1 | 0 | 1; +export declare function nodeToString(a: ASTNode): string; +export declare function compareNodes(a: ASTNode, b: ASTNode, customFn?: (a: any, b: any) => number): number; +export declare function isSome(input: T): input is Exclude; +export declare function assertSome(input: T, message?: string): asserts input is Exclude; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.cts new file mode 100644 index 00000000..fca4eb0f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.cts @@ -0,0 +1,3 @@ +import { GraphQLSchema, GraphQLType } from 'graphql'; +import { Maybe } from './types.cjs'; +export declare function implementsAbstractType(schema: GraphQLSchema, typeA: Maybe, typeB: Maybe): boolean; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.ts new file mode 100644 index 00000000..78807092 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/implementsAbstractType.d.ts @@ -0,0 +1,3 @@ +import { GraphQLSchema, GraphQLType } from 'graphql'; +import { Maybe } from './types.js'; +export declare function implementsAbstractType(schema: GraphQLSchema, typeA: Maybe, typeB: Maybe): boolean; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.cts new file mode 100644 index 00000000..7633b8fd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.cts @@ -0,0 +1,60 @@ +export * from './loaders.cjs'; +export * from './helpers.cjs'; +export * from './get-directives.cjs'; +export * from './get-fields-with-directives.cjs'; +export * from './get-arguments-with-directives.cjs'; +export * from './get-implementing-types.cjs'; +export * from './print-schema-with-directives.cjs'; +export * from './get-fields-with-directives.cjs'; +export * from './validate-documents.cjs'; +export * from './parse-graphql-json.cjs'; +export * from './parse-graphql-sdl.cjs'; +export * from './build-operation-for-field.cjs'; +export * from './types.cjs'; +export * from './filterSchema.cjs'; +export * from './heal.cjs'; +export * from './getResolversFromSchema.cjs'; +export * from './forEachField.cjs'; +export * from './forEachDefaultValue.cjs'; +export * from './mapSchema.cjs'; +export * from './addTypes.cjs'; +export * from './rewire.cjs'; +export * from './prune.cjs'; +export * from './mergeDeep.cjs'; +export * from './Interfaces.cjs'; +export * from './stub.cjs'; +export * from './selectionSets.cjs'; +export * from './getResponseKeyFromInfo.cjs'; +export * from './fields.cjs'; +export * from './renameType.cjs'; +export * from './transformInputValue.cjs'; +export * from './updateArgument.cjs'; +export * from './astFromType.cjs'; +export * from './implementsAbstractType.cjs'; +export * from './errors.cjs'; +export * from './observableToAsyncIterable.cjs'; +export * from './visitResult.cjs'; +export * from './getArgumentValues.cjs'; +export * from './valueMatchesCriteria.cjs'; +export * from './isAsyncIterable.cjs'; +export * from './isDocumentNode.cjs'; +export * from './astFromValueUntyped.cjs'; +export * from './executor.cjs'; +export * from './withCancel.cjs'; +export * from './rootTypes.cjs'; +export * from './comments.cjs'; +export * from './collectFields.cjs'; +export { inspect } from 'cross-inspect'; +export * from './memoize.cjs'; +export * from './fixSchemaAst.cjs'; +export * from './getOperationASTFromRequest.cjs'; +export * from './extractExtensionsFromSchema.cjs'; +export * from './Path.cjs'; +export * from './jsutils.cjs'; +export * from './directives.cjs'; +export * from './mergeIncrementalResult.cjs'; +export * from './debugTimer.cjs'; +export * from './getDirectiveExtensions.cjs'; +export { mapAsyncIterator, mapMaybePromise, fakePromise, createDeferredPromise as createDeferred, } from '@whatwg-node/promise-helpers'; +export * from './registerAbortSignalListener.cjs'; +export * from './getDirectiveValues.cjs'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.ts new file mode 100644 index 00000000..01e89d85 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/index.d.ts @@ -0,0 +1,60 @@ +export * from './loaders.js'; +export * from './helpers.js'; +export * from './get-directives.js'; +export * from './get-fields-with-directives.js'; +export * from './get-arguments-with-directives.js'; +export * from './get-implementing-types.js'; +export * from './print-schema-with-directives.js'; +export * from './get-fields-with-directives.js'; +export * from './validate-documents.js'; +export * from './parse-graphql-json.js'; +export * from './parse-graphql-sdl.js'; +export * from './build-operation-for-field.js'; +export * from './types.js'; +export * from './filterSchema.js'; +export * from './heal.js'; +export * from './getResolversFromSchema.js'; +export * from './forEachField.js'; +export * from './forEachDefaultValue.js'; +export * from './mapSchema.js'; +export * from './addTypes.js'; +export * from './rewire.js'; +export * from './prune.js'; +export * from './mergeDeep.js'; +export * from './Interfaces.js'; +export * from './stub.js'; +export * from './selectionSets.js'; +export * from './getResponseKeyFromInfo.js'; +export * from './fields.js'; +export * from './renameType.js'; +export * from './transformInputValue.js'; +export * from './updateArgument.js'; +export * from './astFromType.js'; +export * from './implementsAbstractType.js'; +export * from './errors.js'; +export * from './observableToAsyncIterable.js'; +export * from './visitResult.js'; +export * from './getArgumentValues.js'; +export * from './valueMatchesCriteria.js'; +export * from './isAsyncIterable.js'; +export * from './isDocumentNode.js'; +export * from './astFromValueUntyped.js'; +export * from './executor.js'; +export * from './withCancel.js'; +export * from './rootTypes.js'; +export * from './comments.js'; +export * from './collectFields.js'; +export { inspect } from 'cross-inspect'; +export * from './memoize.js'; +export * from './fixSchemaAst.js'; +export * from './getOperationASTFromRequest.js'; +export * from './extractExtensionsFromSchema.js'; +export * from './Path.js'; +export * from './jsutils.js'; +export * from './directives.js'; +export * from './mergeIncrementalResult.js'; +export * from './debugTimer.js'; +export * from './getDirectiveExtensions.js'; +export { mapAsyncIterator, mapMaybePromise, fakePromise, createDeferredPromise as createDeferred, } from '@whatwg-node/promise-helpers'; +export * from './registerAbortSignalListener.js'; +export * from './getDirectiveValues.js'; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.cts new file mode 100644 index 00000000..239c56bf --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.cts @@ -0,0 +1 @@ +export declare function isAsyncIterable(value: any): value is AsyncIterable; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.ts new file mode 100644 index 00000000..239c56bf --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isAsyncIterable.d.ts @@ -0,0 +1 @@ +export declare function isAsyncIterable(value: any): value is AsyncIterable; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.cts new file mode 100644 index 00000000..d33bf28d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.cts @@ -0,0 +1,2 @@ +import { DocumentNode } from 'graphql'; +export declare function isDocumentNode(object: any): object is DocumentNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.ts new file mode 100644 index 00000000..d33bf28d --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/isDocumentNode.d.ts @@ -0,0 +1,2 @@ +import { DocumentNode } from 'graphql'; +export declare function isDocumentNode(object: any): object is DocumentNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.cts new file mode 100644 index 00000000..14477f3b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.cts @@ -0,0 +1,8 @@ +import { isPromise, type MaybePromise } from '@whatwg-node/promise-helpers'; +export declare function isIterableObject(value: unknown): value is Iterable; +export declare function isObjectLike(value: unknown): value is { + [key: string]: unknown; +}; +export { isPromise }; +export declare function promiseReduce(values: Iterable, callbackFn: (accumulator: U, currentValue: T) => MaybePromise, initialValue: MaybePromise): MaybePromise; +export declare function hasOwnProperty(obj: unknown, prop: string): boolean; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.ts new file mode 100644 index 00000000..14477f3b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/jsutils.d.ts @@ -0,0 +1,8 @@ +import { isPromise, type MaybePromise } from '@whatwg-node/promise-helpers'; +export declare function isIterableObject(value: unknown): value is Iterable; +export declare function isObjectLike(value: unknown): value is { + [key: string]: unknown; +}; +export { isPromise }; +export declare function promiseReduce(values: Iterable, callbackFn: (accumulator: U, currentValue: T) => MaybePromise, initialValue: MaybePromise): MaybePromise; +export declare function hasOwnProperty(obj: unknown, prop: string): boolean; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.cts new file mode 100644 index 00000000..9239e54a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.cts @@ -0,0 +1,19 @@ +import { BuildSchemaOptions, DocumentNode, GraphQLSchema } from 'graphql'; +import { GraphQLParseOptions } from './Interfaces.cjs'; +export interface Source { + document?: DocumentNode; + schema?: GraphQLSchema; + rawSDL?: string; + location?: string; +} +export type BaseLoaderOptions = GraphQLParseOptions & BuildSchemaOptions & { + cwd?: string; + ignore?: string | string[]; + includeSources?: boolean; +}; +export type WithList = T | T[]; +export type ElementOf = TList extends Array ? TElement : never; +export interface Loader { + load(pointer: string, options?: TOptions): Promise; + loadSync?(pointer: string, options?: TOptions): Source[] | null | never; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.ts new file mode 100644 index 00000000..4e8c7a8f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/loaders.d.ts @@ -0,0 +1,19 @@ +import { BuildSchemaOptions, DocumentNode, GraphQLSchema } from 'graphql'; +import { GraphQLParseOptions } from './Interfaces.js'; +export interface Source { + document?: DocumentNode; + schema?: GraphQLSchema; + rawSDL?: string; + location?: string; +} +export type BaseLoaderOptions = GraphQLParseOptions & BuildSchemaOptions & { + cwd?: string; + ignore?: string | string[]; + includeSources?: boolean; +}; +export type WithList = T | T[]; +export type ElementOf = TList extends Array ? TElement : never; +export interface Loader { + load(pointer: string, options?: TOptions): Promise; + loadSync?(pointer: string, options?: TOptions): Source[] | null | never; +} diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.cts new file mode 100644 index 00000000..8bd54bb1 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.cts @@ -0,0 +1,7 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLSchema } from 'graphql'; +import { SchemaMapper } from './Interfaces.cjs'; +export declare function mapSchema(schema: GraphQLSchema, schemaMapper?: SchemaMapper): GraphQLSchema; +export declare function correctASTNodes(type: GraphQLObjectType): GraphQLObjectType; +export declare function correctASTNodes(type: GraphQLInterfaceType): GraphQLInterfaceType; +export declare function correctASTNodes(type: GraphQLInputObjectType): GraphQLInputObjectType; +export declare function correctASTNodes(type: GraphQLEnumType): GraphQLEnumType; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.ts new file mode 100644 index 00000000..fe04dac3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mapSchema.d.ts @@ -0,0 +1,7 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLSchema } from 'graphql'; +import { SchemaMapper } from './Interfaces.js'; +export declare function mapSchema(schema: GraphQLSchema, schemaMapper?: SchemaMapper): GraphQLSchema; +export declare function correctASTNodes(type: GraphQLObjectType): GraphQLObjectType; +export declare function correctASTNodes(type: GraphQLInterfaceType): GraphQLInterfaceType; +export declare function correctASTNodes(type: GraphQLInputObjectType): GraphQLInputObjectType; +export declare function correctASTNodes(type: GraphQLEnumType): GraphQLEnumType; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.cts new file mode 100644 index 00000000..6e84e008 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.cts @@ -0,0 +1,7 @@ +export declare function memoize1 any>(fn: F): F; +export declare function memoize2 any>(fn: F): F; +export declare function memoize3 any>(fn: F): F; +export declare function memoize4 any>(fn: F): F; +export declare function memoize5 any>(fn: F): F; +export declare function memoize2of4 any>(fn: F): F; +export declare function memoize2of5 any>(fn: F): F; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.ts new file mode 100644 index 00000000..6e84e008 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/memoize.d.ts @@ -0,0 +1,7 @@ +export declare function memoize1 any>(fn: F): F; +export declare function memoize2 any>(fn: F): F; +export declare function memoize3 any>(fn: F): F; +export declare function memoize4 any>(fn: F): F; +export declare function memoize5 any>(fn: F): F; +export declare function memoize2of4 any>(fn: F): F; +export declare function memoize2of5 any>(fn: F): F; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.cts new file mode 100644 index 00000000..c9b5a39e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.cts @@ -0,0 +1,9 @@ +type BoxedTupleTypes = { + [P in keyof T]: [T[P]]; +}[Exclude]; +type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +type UnboxIntersection = T extends { + 0: infer U; +} ? U : never; +export declare function mergeDeep(sources: S, respectPrototype?: boolean, respectArrays?: boolean, respectArrayLength?: boolean, respectNonEnumerableSymbols?: boolean): UnboxIntersection>> & any; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.ts new file mode 100644 index 00000000..c9b5a39e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeDeep.d.ts @@ -0,0 +1,9 @@ +type BoxedTupleTypes = { + [P in keyof T]: [T[P]]; +}[Exclude]; +type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +type UnboxIntersection = T extends { + 0: infer U; +} ? U : never; +export declare function mergeDeep(sources: S, respectPrototype?: boolean, respectArrays?: boolean, respectArrayLength?: boolean, respectNonEnumerableSymbols?: boolean): UnboxIntersection>> & any; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.cts new file mode 100644 index 00000000..d53ad1ac --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.cts @@ -0,0 +1,5 @@ +import { ExecutionResult } from './Interfaces.cjs'; +export declare function mergeIncrementalResult({ incrementalResult, executionResult, }: { + incrementalResult: ExecutionResult; + executionResult: ExecutionResult; +}): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.ts new file mode 100644 index 00000000..c2688864 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/mergeIncrementalResult.d.ts @@ -0,0 +1,5 @@ +import { ExecutionResult } from './Interfaces.js'; +export declare function mergeIncrementalResult({ incrementalResult, executionResult, }: { + incrementalResult: ExecutionResult; + executionResult: ExecutionResult; +}): void; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.cts new file mode 100644 index 00000000..2e7a5bdd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.cts @@ -0,0 +1,12 @@ +export interface Observer { + next: (value: T) => void; + error: (error: Error) => void; + complete: () => void; +} +export interface Observable { + subscribe(observer: Observer): { + unsubscribe: () => void; + }; +} +export type Callback = (value?: any) => any; +export declare function observableToAsyncIterable(observable: Observable): AsyncIterableIterator; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.ts new file mode 100644 index 00000000..2e7a5bdd --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/observableToAsyncIterable.d.ts @@ -0,0 +1,12 @@ +export interface Observer { + next: (value: T) => void; + error: (error: Error) => void; + complete: () => void; +} +export interface Observable { + subscribe(observer: Observer): { + unsubscribe: () => void; + }; +} +export type Callback = (value?: any) => any; +export declare function observableToAsyncIterable(observable: Observable): AsyncIterableIterator; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.cts new file mode 100644 index 00000000..9b89abef --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.cts @@ -0,0 +1,4 @@ +import { ParseOptions } from 'graphql'; +import { Source } from './loaders.cjs'; +import { SchemaPrintOptions } from './types.cjs'; +export declare function parseGraphQLJSON(location: string, jsonContent: string, options: SchemaPrintOptions & ParseOptions): Source; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.ts new file mode 100644 index 00000000..61576409 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-json.d.ts @@ -0,0 +1,4 @@ +import { ParseOptions } from 'graphql'; +import { Source } from './loaders.js'; +import { SchemaPrintOptions } from './types.js'; +export declare function parseGraphQLJSON(location: string, jsonContent: string, options: SchemaPrintOptions & ParseOptions): Source; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.cts new file mode 100644 index 00000000..10381184 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.cts @@ -0,0 +1,13 @@ +import { ASTNode, DocumentNode, StringValueNode } from 'graphql'; +import { GraphQLParseOptions } from './Interfaces.cjs'; +export declare function parseGraphQLSDL(location: string | undefined, rawSDL: string, options?: GraphQLParseOptions): { + location: string | undefined; + document: DocumentNode; +}; +export declare function transformCommentsToDescriptions(sourceSdl: string, options?: GraphQLParseOptions): DocumentNode; +type DiscriminateUnion = T extends U ? T : never; +type DescribableASTNodes = DiscriminateUnion; +export declare function isDescribable(node: ASTNode): node is DescribableASTNodes; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.ts new file mode 100644 index 00000000..27b5e0f5 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/parse-graphql-sdl.d.ts @@ -0,0 +1,13 @@ +import { ASTNode, DocumentNode, StringValueNode } from 'graphql'; +import { GraphQLParseOptions } from './Interfaces.js'; +export declare function parseGraphQLSDL(location: string | undefined, rawSDL: string, options?: GraphQLParseOptions): { + location: string | undefined; + document: DocumentNode; +}; +export declare function transformCommentsToDescriptions(sourceSdl: string, options?: GraphQLParseOptions): DocumentNode; +type DiscriminateUnion = T extends U ? T : never; +type DescribableASTNodes = DiscriminateUnion; +export declare function isDescribable(node: ASTNode): node is DescribableASTNodes; +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.cts new file mode 100644 index 00000000..ddddc6ce --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.cts @@ -0,0 +1,26 @@ +import { DirectiveDefinitionNode, DirectiveNode, DocumentNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, FieldDefinitionNode, GraphQLArgument, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLField, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLSchema, GraphQLUnionType, InputObjectTypeDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode, ScalarTypeDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, UnionTypeDefinitionNode } from 'graphql'; +import { DirectableGraphQLObject, DirectiveAnnotation } from './get-directives.cjs'; +import { GetDocumentNodeFromSchemaOptions, Maybe, PrintSchemaWithDirectivesOptions } from './types.cjs'; +export declare function getDocumentNodeFromSchema(schema: GraphQLSchema, options?: GetDocumentNodeFromSchemaOptions): DocumentNode; +export declare function printSchemaWithDirectives(schema: GraphQLSchema, options?: PrintSchemaWithDirectivesOptions): string; +export declare function astFromSchema(schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): SchemaDefinitionNode | SchemaExtensionNode | null; +export declare function astFromDirective(directive: GraphQLDirective, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array): DirectiveDefinitionNode; +export declare function getDirectiveNodes(entity: DirectableGraphQLObject & { + deprecationReason?: string | null; + specifiedByUrl?: string | null; + specifiedByURL?: string | null; + isOneOf?: boolean; +}, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array): Array; +export declare function astFromArg(arg: GraphQLArgument, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array): InputValueDefinitionNode; +export declare function astFromObjectType(type: GraphQLObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): ObjectTypeDefinitionNode; +export declare function astFromInterfaceType(type: GraphQLInterfaceType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): InterfaceTypeDefinitionNode; +export declare function astFromUnionType(type: GraphQLUnionType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): UnionTypeDefinitionNode; +export declare function astFromInputObjectType(type: GraphQLInputObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): InputObjectTypeDefinitionNode; +export declare function astFromEnumType(type: GraphQLEnumType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): EnumTypeDefinitionNode; +export declare function astFromScalarType(type: GraphQLScalarType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): ScalarTypeDefinitionNode; +export declare function astFromField(field: GraphQLField, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): FieldDefinitionNode; +export declare function astFromInputField(field: GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): InputValueDefinitionNode; +export declare function astFromEnumValue(value: GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): EnumValueDefinitionNode; +export declare function makeDeprecatedDirective(deprecationReason: string): TDirectiveNode; +export declare function makeDirectiveNode(name: string, args?: Record, directive?: Maybe): TDirectiveNode; +export declare function makeDirectiveNodes(schema: Maybe, directiveValues: DirectiveAnnotation[]): Array; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.ts new file mode 100644 index 00000000..1ad364ac --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/print-schema-with-directives.d.ts @@ -0,0 +1,26 @@ +import { DirectiveDefinitionNode, DirectiveNode, DocumentNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, FieldDefinitionNode, GraphQLArgument, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLField, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLSchema, GraphQLUnionType, InputObjectTypeDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode, ScalarTypeDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, UnionTypeDefinitionNode } from 'graphql'; +import { DirectableGraphQLObject, DirectiveAnnotation } from './get-directives.js'; +import { GetDocumentNodeFromSchemaOptions, Maybe, PrintSchemaWithDirectivesOptions } from './types.js'; +export declare function getDocumentNodeFromSchema(schema: GraphQLSchema, options?: GetDocumentNodeFromSchemaOptions): DocumentNode; +export declare function printSchemaWithDirectives(schema: GraphQLSchema, options?: PrintSchemaWithDirectivesOptions): string; +export declare function astFromSchema(schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): SchemaDefinitionNode | SchemaExtensionNode | null; +export declare function astFromDirective(directive: GraphQLDirective, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array): DirectiveDefinitionNode; +export declare function getDirectiveNodes(entity: DirectableGraphQLObject & { + deprecationReason?: string | null; + specifiedByUrl?: string | null; + specifiedByURL?: string | null; + isOneOf?: boolean; +}, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array): Array; +export declare function astFromArg(arg: GraphQLArgument, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array): InputValueDefinitionNode; +export declare function astFromObjectType(type: GraphQLObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): ObjectTypeDefinitionNode; +export declare function astFromInterfaceType(type: GraphQLInterfaceType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): InterfaceTypeDefinitionNode; +export declare function astFromUnionType(type: GraphQLUnionType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): UnionTypeDefinitionNode; +export declare function astFromInputObjectType(type: GraphQLInputObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): InputObjectTypeDefinitionNode; +export declare function astFromEnumType(type: GraphQLEnumType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): EnumTypeDefinitionNode; +export declare function astFromScalarType(type: GraphQLScalarType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): ScalarTypeDefinitionNode; +export declare function astFromField(field: GraphQLField, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): FieldDefinitionNode; +export declare function astFromInputField(field: GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): InputValueDefinitionNode; +export declare function astFromEnumValue(value: GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array): EnumValueDefinitionNode; +export declare function makeDeprecatedDirective(deprecationReason: string): TDirectiveNode; +export declare function makeDirectiveNode(name: string, args?: Record, directive?: Maybe): TDirectiveNode; +export declare function makeDirectiveNodes(schema: Maybe, directiveValues: DirectiveAnnotation[]): Array; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.cts new file mode 100644 index 00000000..ce9a3ae7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.cts @@ -0,0 +1,8 @@ +import { GraphQLSchema } from 'graphql'; +import { PruneSchemaOptions } from './types.cjs'; +/** + * Prunes the provided schema, removing unused and empty types + * @param schema The schema to prune + * @param options Additional options for removing unused types from the schema + */ +export declare function pruneSchema(schema: GraphQLSchema, options?: PruneSchemaOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.ts new file mode 100644 index 00000000..a57a658e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/prune.d.ts @@ -0,0 +1,8 @@ +import { GraphQLSchema } from 'graphql'; +import { PruneSchemaOptions } from './types.js'; +/** + * Prunes the provided schema, removing unused and empty types + * @param schema The schema to prune + * @param options Additional options for removing unused types from the schema + */ +export declare function pruneSchema(schema: GraphQLSchema, options?: PruneSchemaOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.cts new file mode 100644 index 00000000..f63ed576 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.cts @@ -0,0 +1,8 @@ +/** + * Register an AbortSignal handler for a signal. + * This helper function mainly exists to work around the + * "possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit." + * warning occuring on Node.js + */ +export declare function registerAbortSignalListener(signal: AbortSignal, listener: () => void): void; +export declare const getAbortPromise: (signal: AbortSignal) => Promise; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.ts new file mode 100644 index 00000000..f63ed576 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/registerAbortSignalListener.d.ts @@ -0,0 +1,8 @@ +/** + * Register an AbortSignal handler for a signal. + * This helper function mainly exists to work around the + * "possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit." + * warning occuring on Node.js + */ +export declare function registerAbortSignalListener(signal: AbortSignal, listener: () => void): void; +export declare const getAbortPromise: (signal: AbortSignal) => Promise; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.cts new file mode 100644 index 00000000..0b38ade7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.cts @@ -0,0 +1,8 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType } from 'graphql'; +export declare function renameType(type: GraphQLObjectType, newTypeName: string): GraphQLObjectType; +export declare function renameType(type: GraphQLInterfaceType, newTypeName: string): GraphQLInterfaceType; +export declare function renameType(type: GraphQLUnionType, newTypeName: string): GraphQLUnionType; +export declare function renameType(type: GraphQLEnumType, newTypeName: string): GraphQLEnumType; +export declare function renameType(type: GraphQLScalarType, newTypeName: string): GraphQLScalarType; +export declare function renameType(type: GraphQLInputObjectType, newTypeName: string): GraphQLInputObjectType; +export declare function renameType(type: GraphQLNamedType, newTypeName: string): GraphQLNamedType; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.ts new file mode 100644 index 00000000..0b38ade7 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/renameType.d.ts @@ -0,0 +1,8 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType } from 'graphql'; +export declare function renameType(type: GraphQLObjectType, newTypeName: string): GraphQLObjectType; +export declare function renameType(type: GraphQLInterfaceType, newTypeName: string): GraphQLInterfaceType; +export declare function renameType(type: GraphQLUnionType, newTypeName: string): GraphQLUnionType; +export declare function renameType(type: GraphQLEnumType, newTypeName: string): GraphQLEnumType; +export declare function renameType(type: GraphQLScalarType, newTypeName: string): GraphQLScalarType; +export declare function renameType(type: GraphQLInputObjectType, newTypeName: string): GraphQLInputObjectType; +export declare function renameType(type: GraphQLNamedType, newTypeName: string): GraphQLNamedType; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.cts new file mode 100644 index 00000000..fbda809f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.cts @@ -0,0 +1,5 @@ +import { GraphQLDirective, GraphQLNamedType } from 'graphql'; +export declare function rewireTypes(originalTypeMap: Record, directives: ReadonlyArray): { + typeMap: Record; + directives: Array; +}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.ts new file mode 100644 index 00000000..fbda809f --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rewire.d.ts @@ -0,0 +1,5 @@ +import { GraphQLDirective, GraphQLNamedType } from 'graphql'; +export declare function rewireTypes(originalTypeMap: Record, directives: ReadonlyArray): { + typeMap: Record; + directives: Array; +}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.cts new file mode 100644 index 00000000..4b03ac7e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.cts @@ -0,0 +1,5 @@ +import { ASTNode, GraphQLObjectType, GraphQLSchema, OperationTypeNode } from 'graphql'; +export declare function getDefinedRootType(schema: GraphQLSchema, operation: OperationTypeNode, nodes?: ASTNode[]): GraphQLObjectType; +export declare const getRootTypeNames: (schema: GraphQLSchema) => Set; +export declare const getRootTypes: (schema: GraphQLSchema) => Set; +export declare const getRootTypeMap: (schema: GraphQLSchema) => Map; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.ts new file mode 100644 index 00000000..4b03ac7e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/rootTypes.d.ts @@ -0,0 +1,5 @@ +import { ASTNode, GraphQLObjectType, GraphQLSchema, OperationTypeNode } from 'graphql'; +export declare function getDefinedRootType(schema: GraphQLSchema, operation: OperationTypeNode, nodes?: ASTNode[]): GraphQLObjectType; +export declare const getRootTypeNames: (schema: GraphQLSchema) => Set; +export declare const getRootTypes: (schema: GraphQLSchema) => Set; +export declare const getRootTypeMap: (schema: GraphQLSchema) => Map; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.cts new file mode 100644 index 00000000..47c9acc3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.cts @@ -0,0 +1,3 @@ +import { SelectionSetNode } from 'graphql'; +import { GraphQLParseOptions } from './Interfaces.cjs'; +export declare function parseSelectionSet(selectionSet: string, options?: GraphQLParseOptions): SelectionSetNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.ts new file mode 100644 index 00000000..0d5ac424 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/selectionSets.d.ts @@ -0,0 +1,3 @@ +import { SelectionSetNode } from 'graphql'; +import { GraphQLParseOptions } from './Interfaces.js'; +export declare function parseSelectionSet(selectionSet: string, options?: GraphQLParseOptions): SelectionSetNode; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.cts new file mode 100644 index 00000000..85333a75 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.cts @@ -0,0 +1,9 @@ +import { GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLType, TypeNode } from 'graphql'; +export declare function createNamedStub(name: string, type: 'object'): GraphQLObjectType; +export declare function createNamedStub(name: string, type: 'interface'): GraphQLInterfaceType; +export declare function createNamedStub(name: string, type: 'input'): GraphQLInputObjectType; +export declare function createStub(node: TypeNode, type: 'output'): GraphQLOutputType; +export declare function createStub(node: TypeNode, type: 'input'): GraphQLInputType; +export declare function createStub(node: TypeNode, type: 'output' | 'input'): GraphQLType; +export declare function isNamedStub(type: GraphQLNamedType): boolean; +export declare function getBuiltInForStub(type: GraphQLNamedType): GraphQLNamedType; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.ts new file mode 100644 index 00000000..85333a75 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/stub.d.ts @@ -0,0 +1,9 @@ +import { GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLType, TypeNode } from 'graphql'; +export declare function createNamedStub(name: string, type: 'object'): GraphQLObjectType; +export declare function createNamedStub(name: string, type: 'interface'): GraphQLInterfaceType; +export declare function createNamedStub(name: string, type: 'input'): GraphQLInputObjectType; +export declare function createStub(node: TypeNode, type: 'output'): GraphQLOutputType; +export declare function createStub(node: TypeNode, type: 'input'): GraphQLInputType; +export declare function createStub(node: TypeNode, type: 'output' | 'input'): GraphQLType; +export declare function isNamedStub(type: GraphQLNamedType): boolean; +export declare function getBuiltInForStub(type: GraphQLNamedType): GraphQLNamedType; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.cts new file mode 100644 index 00000000..24021d80 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.cts @@ -0,0 +1,6 @@ +import { GraphQLInputType } from 'graphql'; +import { InputLeafValueTransformer, InputObjectValueTransformer, Maybe } from './types.cjs'; +export declare function transformInputValue(type: GraphQLInputType, value: any, inputLeafValueTransformer?: Maybe, inputObjectValueTransformer?: Maybe): any; +export declare function serializeInputValue(type: GraphQLInputType, value: any): any; +export declare function parseInputValue(type: GraphQLInputType, value: any): any; +export declare function parseInputValueLiteral(type: GraphQLInputType, value: any): any; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.ts new file mode 100644 index 00000000..95f29f0b --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/transformInputValue.d.ts @@ -0,0 +1,6 @@ +import { GraphQLInputType } from 'graphql'; +import { InputLeafValueTransformer, InputObjectValueTransformer, Maybe } from './types.js'; +export declare function transformInputValue(type: GraphQLInputType, value: any, inputLeafValueTransformer?: Maybe, inputObjectValueTransformer?: Maybe): any; +export declare function serializeInputValue(type: GraphQLInputType, value: any): any; +export declare function parseInputValue(type: GraphQLInputType, value: any): any; +export declare function parseInputValueLiteral(type: GraphQLInputType, value: any): any; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.cts new file mode 100644 index 00000000..5c2dbbf0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.cts @@ -0,0 +1,143 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInputType, GraphQLNamedType, GraphQLScalarType, visit } from 'graphql'; +export interface SchemaPrintOptions { + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * This option is provided to ease adoption and will be removed in v16. + * + * Default: false + */ + commentDescriptions?: boolean; + assumeValid?: boolean; +} +export interface GetDocumentNodeFromSchemaOptions { + pathToDirectivesInExtensions?: Array; +} +export type PrintSchemaWithDirectivesOptions = SchemaPrintOptions & GetDocumentNodeFromSchemaOptions; +export type Maybe = null | undefined | T; +export type Constructor = new (...args: any[]) => T; +export type PruneSchemaFilter = (type: GraphQLNamedType) => boolean; +/** + * Options for removing unused types from the schema + */ +export interface PruneSchemaOptions { + /** + * Return true to skip pruning this type. This check will run first before any other options. + * This can be helpful for schemas that support type extensions like Apollo Federation. + */ + skipPruning?: PruneSchemaFilter; + /** + * Set to `true` to skip pruning object types or interfaces with no no fields + */ + skipEmptyCompositeTypePruning?: boolean; + /** + * Set to `true` to skip pruning interfaces that are not implemented by any + * other types + */ + skipUnimplementedInterfacesPruning?: boolean; + /** + * Set to `true` to skip pruning empty unions + */ + skipEmptyUnionPruning?: boolean; + /** + * Set to `true` to skip pruning unused types + */ + skipUnusedTypesPruning?: boolean; +} +export type InputLeafValueTransformer = (type: GraphQLEnumType | GraphQLScalarType, originalValue: any) => any; +export type InputObjectValueTransformer = (type: GraphQLInputObjectType, originalValue: Record) => Record; +export type ASTVisitorKeyMap = Partial[2]>; +export type DirectiveLocationEnum = typeof DirectiveLocation; +export declare enum DirectiveLocation { + /** Request Definitions */ + QUERY = "QUERY", + MUTATION = "MUTATION", + SUBSCRIPTION = "SUBSCRIPTION", + FIELD = "FIELD", + FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", + FRAGMENT_SPREAD = "FRAGMENT_SPREAD", + INLINE_FRAGMENT = "INLINE_FRAGMENT", + VARIABLE_DEFINITION = "VARIABLE_DEFINITION", + /** Type System Definitions */ + SCHEMA = "SCHEMA", + SCALAR = "SCALAR", + OBJECT = "OBJECT", + FIELD_DEFINITION = "FIELD_DEFINITION", + ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", + INTERFACE = "INTERFACE", + UNION = "UNION", + ENUM = "ENUM", + ENUM_VALUE = "ENUM_VALUE", + INPUT_OBJECT = "INPUT_OBJECT", + INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION" +} +export type ExtensionsObject = Record; +export type ObjectTypeExtensions = { + type: 'object'; + fields: Record; + }>; +}; +export type InputTypeExtensions = { + type: 'input'; + fields: Record; +}; +export type InterfaceTypeExtensions = { + type: 'interface'; + fields: Record; + }>; +}; +export type UnionTypeExtensions = { + type: 'union'; +}; +export type ScalarTypeExtensions = { + type: 'scalar'; +}; +export type EnumTypeExtensions = { + type: 'enum'; + values: Record; +}; +export type PossibleTypeExtensions = InputTypeExtensions | InterfaceTypeExtensions | ObjectTypeExtensions | UnionTypeExtensions | ScalarTypeExtensions | EnumTypeExtensions; +export type SchemaExtensions = { + schemaExtensions: ExtensionsObject; + types: Record; +}; +export type DirectiveArgs = { + [name: string]: any; +}; +export type DirectiveUsage = { + name: string; + args: DirectiveArgs; +}; +export interface PromiseWithResolvers { + promise: Promise; + resolve: (value: T | PromiseLike) => void; + reject: (reason?: any) => void; +} +export interface VariableValues> { + /** Coerced runtime variable values keyed by variable name. */ + readonly coerced: TVariables; + /** Source metadata for each variable value keyed by variable name. */ + readonly sources: Record; +} +export interface VariableValueSource { + readonly signature: GraphQLVariableSignature; + readonly value?: unknown; +} +interface GraphQLVariableSignature { + name: string; + type: GraphQLInputType; + defaultValue?: never; + default: { + literal: any; + } | undefined; +} +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.ts new file mode 100644 index 00000000..5c2dbbf0 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/types.d.ts @@ -0,0 +1,143 @@ +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInputType, GraphQLNamedType, GraphQLScalarType, visit } from 'graphql'; +export interface SchemaPrintOptions { + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * This option is provided to ease adoption and will be removed in v16. + * + * Default: false + */ + commentDescriptions?: boolean; + assumeValid?: boolean; +} +export interface GetDocumentNodeFromSchemaOptions { + pathToDirectivesInExtensions?: Array; +} +export type PrintSchemaWithDirectivesOptions = SchemaPrintOptions & GetDocumentNodeFromSchemaOptions; +export type Maybe = null | undefined | T; +export type Constructor = new (...args: any[]) => T; +export type PruneSchemaFilter = (type: GraphQLNamedType) => boolean; +/** + * Options for removing unused types from the schema + */ +export interface PruneSchemaOptions { + /** + * Return true to skip pruning this type. This check will run first before any other options. + * This can be helpful for schemas that support type extensions like Apollo Federation. + */ + skipPruning?: PruneSchemaFilter; + /** + * Set to `true` to skip pruning object types or interfaces with no no fields + */ + skipEmptyCompositeTypePruning?: boolean; + /** + * Set to `true` to skip pruning interfaces that are not implemented by any + * other types + */ + skipUnimplementedInterfacesPruning?: boolean; + /** + * Set to `true` to skip pruning empty unions + */ + skipEmptyUnionPruning?: boolean; + /** + * Set to `true` to skip pruning unused types + */ + skipUnusedTypesPruning?: boolean; +} +export type InputLeafValueTransformer = (type: GraphQLEnumType | GraphQLScalarType, originalValue: any) => any; +export type InputObjectValueTransformer = (type: GraphQLInputObjectType, originalValue: Record) => Record; +export type ASTVisitorKeyMap = Partial[2]>; +export type DirectiveLocationEnum = typeof DirectiveLocation; +export declare enum DirectiveLocation { + /** Request Definitions */ + QUERY = "QUERY", + MUTATION = "MUTATION", + SUBSCRIPTION = "SUBSCRIPTION", + FIELD = "FIELD", + FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", + FRAGMENT_SPREAD = "FRAGMENT_SPREAD", + INLINE_FRAGMENT = "INLINE_FRAGMENT", + VARIABLE_DEFINITION = "VARIABLE_DEFINITION", + /** Type System Definitions */ + SCHEMA = "SCHEMA", + SCALAR = "SCALAR", + OBJECT = "OBJECT", + FIELD_DEFINITION = "FIELD_DEFINITION", + ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", + INTERFACE = "INTERFACE", + UNION = "UNION", + ENUM = "ENUM", + ENUM_VALUE = "ENUM_VALUE", + INPUT_OBJECT = "INPUT_OBJECT", + INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION" +} +export type ExtensionsObject = Record; +export type ObjectTypeExtensions = { + type: 'object'; + fields: Record; + }>; +}; +export type InputTypeExtensions = { + type: 'input'; + fields: Record; +}; +export type InterfaceTypeExtensions = { + type: 'interface'; + fields: Record; + }>; +}; +export type UnionTypeExtensions = { + type: 'union'; +}; +export type ScalarTypeExtensions = { + type: 'scalar'; +}; +export type EnumTypeExtensions = { + type: 'enum'; + values: Record; +}; +export type PossibleTypeExtensions = InputTypeExtensions | InterfaceTypeExtensions | ObjectTypeExtensions | UnionTypeExtensions | ScalarTypeExtensions | EnumTypeExtensions; +export type SchemaExtensions = { + schemaExtensions: ExtensionsObject; + types: Record; +}; +export type DirectiveArgs = { + [name: string]: any; +}; +export type DirectiveUsage = { + name: string; + args: DirectiveArgs; +}; +export interface PromiseWithResolvers { + promise: Promise; + resolve: (value: T | PromiseLike) => void; + reject: (reason?: any) => void; +} +export interface VariableValues> { + /** Coerced runtime variable values keyed by variable name. */ + readonly coerced: TVariables; + /** Source metadata for each variable value keyed by variable name. */ + readonly sources: Record; +} +export interface VariableValueSource { + readonly signature: GraphQLVariableSignature; + readonly value?: unknown; +} +interface GraphQLVariableSignature { + name: string; + type: GraphQLInputType; + defaultValue?: never; + default: { + literal: any; + } | undefined; +} +export {}; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.cts new file mode 100644 index 00000000..2a41904c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.cts @@ -0,0 +1,3 @@ +import { ArgumentNode, GraphQLInputType, VariableDefinitionNode } from 'graphql'; +export declare function updateArgument(argumentNodes: Record, variableDefinitionsMap: Record, variableValues: Record, argName: string, varName: string, type: GraphQLInputType, value: any): void; +export declare function createVariableNameGenerator(variableDefinitionMap: Record): (argName: string) => string; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.ts new file mode 100644 index 00000000..2a41904c --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/updateArgument.d.ts @@ -0,0 +1,3 @@ +import { ArgumentNode, GraphQLInputType, VariableDefinitionNode } from 'graphql'; +export declare function updateArgument(argumentNodes: Record, variableDefinitionsMap: Record, variableValues: Record, argName: string, varName: string, type: GraphQLInputType, value: any): void; +export declare function createVariableNameGenerator(variableDefinitionMap: Record): (argName: string) => string; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.cts new file mode 100644 index 00000000..99b0940a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.cts @@ -0,0 +1,4 @@ +import { ASTVisitor, DocumentNode, GraphQLSchema, ValidationContext } from 'graphql'; +export type ValidationRule = (context: ValidationContext) => ASTVisitor; +export declare function validateGraphQlDocuments(schema: GraphQLSchema, documents: DocumentNode[], rules?: ValidationRule[]): readonly import("graphql").GraphQLError[]; +export declare function createDefaultRules(): import("graphql").ValidationRule[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.ts new file mode 100644 index 00000000..99b0940a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/validate-documents.d.ts @@ -0,0 +1,4 @@ +import { ASTVisitor, DocumentNode, GraphQLSchema, ValidationContext } from 'graphql'; +export type ValidationRule = (context: ValidationContext) => ASTVisitor; +export declare function validateGraphQlDocuments(schema: GraphQLSchema, documents: DocumentNode[], rules?: ValidationRule[]): readonly import("graphql").GraphQLError[]; +export declare function createDefaultRules(): import("graphql").ValidationRule[]; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.cts new file mode 100644 index 00000000..eceaa3b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.cts @@ -0,0 +1 @@ +export declare function valueMatchesCriteria(value: any, criteria: any): boolean; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.ts new file mode 100644 index 00000000..eceaa3b4 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/valueMatchesCriteria.d.ts @@ -0,0 +1 @@ +export declare function valueMatchesCriteria(value: any, criteria: any): boolean; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.cts new file mode 100644 index 00000000..0a7debb3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.cts @@ -0,0 +1,15 @@ +import { GraphQLError, GraphQLSchema } from 'graphql'; +import { ExecutionRequest, ExecutionResult } from './Interfaces.cjs'; +export type ValueVisitor = (value: any) => any; +export type ObjectValueVisitor = { + __enter?: ValueVisitor; + __leave?: ValueVisitor; +} & Record; +export type ResultVisitorMap = Record; +export type ErrorVisitor = (error: GraphQLError, pathIndex: number) => GraphQLError; +export type ErrorVisitorMap = { + __unpathed?: (error: GraphQLError) => GraphQLError; +} & Record>; +export declare function visitData(data: any, enter?: ValueVisitor, leave?: ValueVisitor): any; +export declare function visitErrors(errors: ReadonlyArray, visitor: (error: GraphQLError) => GraphQLError): Array; +export declare function visitResult(result: ExecutionResult, request: ExecutionRequest, schema: GraphQLSchema, resultVisitorMap?: ResultVisitorMap, errorVisitorMap?: ErrorVisitorMap): any; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.ts new file mode 100644 index 00000000..403a78d3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/visitResult.d.ts @@ -0,0 +1,15 @@ +import { GraphQLError, GraphQLSchema } from 'graphql'; +import { ExecutionRequest, ExecutionResult } from './Interfaces.js'; +export type ValueVisitor = (value: any) => any; +export type ObjectValueVisitor = { + __enter?: ValueVisitor; + __leave?: ValueVisitor; +} & Record; +export type ResultVisitorMap = Record; +export type ErrorVisitor = (error: GraphQLError, pathIndex: number) => GraphQLError; +export type ErrorVisitorMap = { + __unpathed?: (error: GraphQLError) => GraphQLError; +} & Record>; +export declare function visitData(data: any, enter?: ValueVisitor, leave?: ValueVisitor): any; +export declare function visitErrors(errors: ReadonlyArray, visitor: (error: GraphQLError) => GraphQLError): Array; +export declare function visitResult(result: ExecutionResult, request: ExecutionRequest, schema: GraphQLSchema, resultVisitorMap?: ResultVisitorMap, errorVisitorMap?: ErrorVisitorMap): any; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.cts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.cts new file mode 100644 index 00000000..55ed7078 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.cts @@ -0,0 +1,3 @@ +export declare function getAsyncIteratorWithCancel(asyncIterator: AsyncIterator, onCancel: (value?: TReturn) => void | Promise): AsyncIterator; +export declare function getAsyncIterableWithCancel, TReturn = any>(asyncIterable: TAsyncIterable, onCancel: (value?: TReturn) => void | Promise): TAsyncIterable; +export { getAsyncIterableWithCancel as withCancel }; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.ts b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.ts new file mode 100644 index 00000000..55ed7078 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils/typings/withCancel.d.ts @@ -0,0 +1,3 @@ +export declare function getAsyncIteratorWithCancel(asyncIterator: AsyncIterator, onCancel: (value?: TReturn) => void | Promise): AsyncIterator; +export declare function getAsyncIterableWithCancel, TReturn = any>(asyncIterable: TAsyncIterable, onCancel: (value?: TReturn) => void | Promise): TAsyncIterable; +export { getAsyncIterableWithCancel as withCancel }; diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-typed-document-node/core b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-typed-document-node/core new file mode 120000 index 00000000..a00bfa2e --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-typed-document-node/core @@ -0,0 +1 @@ +../../../@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@whatwg-node/promise-helpers b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@whatwg-node/promise-helpers new file mode 120000 index 00000000..2e2caf49 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@whatwg-node/promise-helpers @@ -0,0 +1 @@ +../../../@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/cross-inspect b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/cross-inspect new file mode 120000 index 00000000..1ec8ccbf --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/cross-inspect @@ -0,0 +1 @@ +../../cross-inspect@1.0.1/node_modules/cross-inspect \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/tslib b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/tslib new file mode 120000 index 00000000..4edba0e2 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/tslib @@ -0,0 +1 @@ +../../tslib@2.8.1/node_modules/tslib \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/LICENSE b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/LICENSE new file mode 100644 index 00000000..1e90edd3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2020-2023 Dotan Simha + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/package.json b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/package.json new file mode 100644 index 00000000..c8d2e688 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/package.json @@ -0,0 +1,15 @@ +{ + "name": "@graphql-typed-document-node/core", + "version": "3.2.0", + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + }, + "repository": "git@github.com:dotansimha/graphql-typed-document-node.git", + "author": "Dotan Simha ", + "license": "MIT", + "main": "", + "typings": "typings/index.d.ts", + "typescript": { + "definition": "typings/index.d.ts" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/typings/index.d.ts b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/typings/index.d.ts new file mode 100644 index 00000000..ac98637a --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core/typings/index.d.ts @@ -0,0 +1,29 @@ +import type { DocumentNode } from "graphql"; +export interface DocumentTypeDecoration { + /** + * This type is used to ensure that the variables you pass in to the query are assignable to Variables + * and that the Result is assignable to whatever you pass your result to. The method is never actually + * implemented, but the type is valid because we list it as optional + */ + __apiType?: (variables: TVariables) => TResult; +} +export interface TypedDocumentNode extends DocumentNode, DocumentTypeDecoration { +} +/** + * Helper for extracting a TypeScript type for operation result from a TypedDocumentNode and TypedDocumentString. + * @example + * const myQuery = { ... }; // TypedDocumentNode + * type ResultType = ResultOf; // Now it's R + */ +export type ResultOf = T extends DocumentTypeDecoration ? ResultType : never; +/** + * Helper for extracting a TypeScript type for operation variables from a TypedDocumentNode and TypedDocumentString. + * @example + * const myQuery = { ... }; // TypedDocumentNode + * type VariablesType = VariablesOf; // Now it's V + */ +export type VariablesOf = T extends DocumentTypeDecoration ? VariablesType : never; diff --git a/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/LICENSE b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/LICENSE new file mode 100644 index 00000000..481c7a50 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2014 Dmitry Tsvettsikh + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/.esm-wrapper.mjs b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/.esm-wrapper.mjs new file mode 100644 index 00000000..0b46bfa6 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/.esm-wrapper.mjs @@ -0,0 +1,4 @@ +import mod from "./node.js"; + +export default mod; +export const saslprep = mod.saslprep; diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts new file mode 100644 index 00000000..1c70d492 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts @@ -0,0 +1,5 @@ +declare const saslprep: (input: string, opts?: { + allowUnassigned?: boolean; +} | undefined) => string; +export = saslprep; +//# sourceMappingURL=browser.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts.map new file mode 100644 index 00000000..669fc643 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,QAAQ;;wBAAmC,CAAC;AAIlD,SAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js new file mode 100644 index 00000000..1bedd860 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js @@ -0,0 +1,12 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const index_1 = __importDefault(require("./index")); +const memory_code_points_1 = require("./memory-code-points"); +const code_points_data_browser_1 = __importDefault(require("./code-points-data-browser")); +const codePoints = (0, memory_code_points_1.createMemoryCodePoints)(code_points_data_browser_1.default); +const saslprep = index_1.default.bind(null, codePoints); +Object.assign(saslprep, { saslprep, default: saslprep }); +module.exports = saslprep; +//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js.map new file mode 100644 index 00000000..40edf44b --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";;;;AAAA,oDAAgC;AAChC,6DAA8D;AAC9D,0FAA8C;AAE9C,MAAM,UAAU,GAAG,IAAA,2CAAsB,EAAC,kCAAI,CAAC,CAAC;AAEhD,MAAM,QAAQ,GAAG,eAAS,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;AAEzD,iBAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts new file mode 100644 index 00000000..85013da3 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts @@ -0,0 +1,3 @@ +declare const data: Buffer; +export default data; +//# sourceMappingURL=code-points-data-browser.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts.map new file mode 100644 index 00000000..b8369475 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"code-points-data-browser.d.ts","sourceRoot":"","sources":["../src/code-points-data-browser.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,qBAGT,CAAC;AACF,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js new file mode 100644 index 00000000..5ea96355 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const data = Buffer.from('AAHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAP////AAAAAAAAAAAAAAADAAAAAAAAAAH//wAAAAAAAAAAAAD//wAA893wFAAAIAAAAAABAAAAAAH/AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAz8AAP////+AAAAAAYCAAAAAAJ+AACAAACAH/wAAAB8H///3/+6AAAAfAAAD/wAAAAAAAAAAAAAAAAAAAAAAAwABAAIAAAAHAAAAH////////wAAAAAAAD///////////////////////////////////////////////////////4gAAAAAAAAwAAMHAAAAf/+IBmAAAEBcNAZj/vIMAAAf2B5gAABASTQeY/+F/AAH/4gKIAAAQEgwAiN//3wA//+IBmAAAEBMMA5j/PI8AH//yBxDlOccAjwcQ/7//gAf/4gEQAAAQAg8BEP5/zwA///IBEAAAEAIPARD+f08AP//yARAAABAADwMQ/7/PAD//8gAAcAAACALAd4FAP//x/+AAAAAAAAAHgAAAA//////llvwgIrIACMFAwAz/////wAAAAAAAAAAAIAAAAAfgAAADwCAAAAABAAG////////AAAAACCQHD8AAAA///////////8AAAAAA/8AAAAAAG8AAAAAAAAAAAAAAD4AAAAAAAAAAB8AAAAAAAAAAAAAPwEAAAAAAAAAAUMBQwAAAAABQwAAAAFDAUMBAQAAAQAAAAFDAQAAAAABAAAfgAAAB/////8AAAAAAAAAAAAAB/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/wAAAAcAAAAAAAAAAAAAf/8ABAf/AAAB/wAAD/8ABE//AAAAAAAAAAAAAAAHAD///wABAD8AAAAAAAAAAAAAAP8AAAAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAA/AAADAwAAAAADAwCqAAAAAwAAAAAAAAQABAAMCAAAxAEAAAAAAAAAAAAAHv4PwDAAAAH//wAAP////wAAAB///wAAAAAAAAAYAA/gAAAAAAAP/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////wAAAAAB////AB///wAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAAAAAAAAAAAAAAAADAD///////////////////4QwAAAAgAAAAAodAYAAAAAAAAcAAACAAf//AAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wAAACAAAAAAAAAAAAAAD/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///8ADwAAAAAAAAAAgAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAA+AAAAAAHgAAAAAAAAAAAAAABAAAAAAD/////////AAAAAAAHAAAAAA//gAAAAAAOAAAAAAAAAAAADwAAAAAAAQAAAAAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAB////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAB////////////////////////8B/+D4AAABBSQAAAAAAAAAAAAAAAAAP////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAwAAAAAAAAP8AAAAAAAcAAP//D/8AAAGAEAABDwQAAAAAAAAAAAAAAAAAAAAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcDAwMcBAf+A////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAQ//AAAAH/////////////////////////////8AAAAAAwAAAAAD//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/wAAAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////////////////////////////////////////////////////wAAAAAAAAAAAAAEAAAAAAAAAAAE2YQAKEgAAAAAAAAAAhgEBAAAACEFwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////z//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////z//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////z//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////y/////AAAAAAAAAAAAAAAA/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKQAP///+D4AAAAABF////g/+AAAAAHf////////////////AQGAAA+//y////4AAAAAAAAAAAAAP/////8AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF/7/++tv/////////////////wAAAAB////////////////////////////////////////////////////////////wAAP//////////P////////wAAAAAA//gAAAAAAAAAAAAAAAAAAPv/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAAAAAAAAAAAAf///4H///+AAAAAAACAEIP///v////7/////////////////////////////////////////////////v//wAAAA///////////////8/5/AAMAA+AIAAAAAAAAAAAAAAAAAAAAAACAC6///3//////+//////wA/////////////////////+A///////////7//////MD//wAAAAB//////n9//////0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABf////////HgHiA/8//gAA3+Z///7+jw4GYAQ3D/8/gB+Gf//+/tsOAAAB6A/84ABf13///v7fHgFiAAIP/AAA3+Z///7+zxoGYAQ3D/4AAF+O8axjj/cNjuAEAAf/gAHf7v///v/fAeAAAAMP/AAA3+7///7/3wvmwBgLD/wAAN/u///+//8ODuAEAw/8AADf//j///9/0/gHA/wAAOAB///////+wAP4B//AAAAAAaaQPf3U3sAT6AP/MAAAAAP///z////qD/3/////gAAEE8AAAAAAAA/35AAAAAAAA/////99oQID///8AAAAAAAAAAAD//////AD//////5D//////////////8H//////////+D/////////////wP7//////////rz+vP/////+vP////68/rz+/v///v////68/v/////+///gf///+AAAAAD/////////////+AB////////////////////////////////////////////////////////////////////////////////////////////////////////+AH///+D/////////////gAD/+8AA///GAP//wAD/+4AA/////////gP9gA/o/8AAAAAA/8D//////////////wD//////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////w///////////////A///8/P/////8/P9V/////P////////v6O/jz8P/4O/gAAgAAAAAAAAAAAAAAAEABAAAAAAAAAAAAAAAAAAAAACE/9HwKvd/HB8AAAP/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////gAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAB/wHz4f/////////////4Hf//////////////vB//////4f//////////////+//////8AAAAAAAAA///////4//////AAAAD////x////////gAD/8P///////v///////////////////h////////////////z////+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8/////////+AAAAAAAAAAAAAAAAAAAAAAAAD+AB8AAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////////8AP/////+P/////////4/4AAYD////8P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////7///////////7Jnv/17f//////////ef7+////976P7////////////////////////////////////////////////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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w=', 'base64'); +exports.default = data; +//# sourceMappingURL=code-points-data-browser.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js.map new file mode 100644 index 00000000..feba4779 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code-points-data-browser.js","sourceRoot":"","sources":["../src/code-points-data-browser.ts"],"names":[],"mappings":";;AAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CACtB,8sliBAA8sliB,EAC9sliB,QAAQ,CACT,CAAC;AACF,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts new file mode 100644 index 00000000..e835ef7a --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts @@ -0,0 +1,3 @@ +declare const _default: NonSharedBuffer; +export default _default; +//# sourceMappingURL=code-points-data.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts.map new file mode 100644 index 00000000..62c29e29 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"code-points-data.d.ts","sourceRoot":"","sources":["../src/code-points-data.ts"],"names":[],"mappings":";AAEA,wBAKE"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js new file mode 100644 index 00000000..6af9a89b --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const zlib_1 = require("zlib"); +exports.default = (0, zlib_1.gunzipSync)(Buffer.from('H4sIAAAAAAACA+3dTYgcaRkA4LemO9Mhxm0FITnE9Cwr4jHgwgZ22B6YywqCJ0HQg5CL4sGTuOjCtGSF4CkHEW856MlTQHD3EJnWkU0Owh5VxE3LHlYQdNxd2U6mU59UV/d09fw4M2EySSXPAzNdP1/9fX/99bzVNZEN4jisRDulVFnQmLxm1aXF9Id/2/xMxNJ4XZlg576yuYlGt9gupV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AAAB7aQXeKlcGiadBoEOeLb2dtpGOL2MyOtf391a3P/zD96c3JzIP3t4oV797vrh8+vn+YRL5bBuj/AQAAAABqJvfHXQAAHkX82zfXAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACeAgkAAAAAAAAAqLuRLAAAAAAAAACA2hv9D1iu/VAYaAYA', 'base64')); +//# sourceMappingURL=code-points-data.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js.map new file mode 100644 index 00000000..1da1c550 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code-points-data.js","sourceRoot":"","sources":["../src/code-points-data.ts"],"names":[],"mappings":";;AAAA,+BAAkC;AAElC,kBAAe,IAAA,iBAAU,EACvB,MAAM,CAAC,IAAI,CACT,knFAAknF,EAClnF,QAAQ,CACT,CACF,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts new file mode 100644 index 00000000..36b6c565 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts @@ -0,0 +1,7 @@ +export declare const unassigned_code_points: Set; +export declare const commonly_mapped_to_nothing: Set; +export declare const non_ASCII_space_characters: Set; +export declare const prohibited_characters: Set; +export declare const bidirectional_r_al: Set; +export declare const bidirectional_l: Set; +//# sourceMappingURL=code-points-src.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts.map new file mode 100644 index 00000000..ef0e6947 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"code-points-src.d.ts","sourceRoot":"","sources":["../src/code-points-src.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB,aA6YjC,CAAC;AAMH,eAAO,MAAM,0BAA0B,aAIrC,CAAC;AAMH,eAAO,MAAM,0BAA0B,aASrC,CAAC;AAMH,eAAO,MAAM,qBAAqB,aA6GhC,CAAC;AAMH,eAAO,MAAM,kBAAkB,aAmC7B,CAAC;AAMH,eAAO,MAAM,eAAe,aAyW1B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js new file mode 100644 index 00000000..2caa6297 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js @@ -0,0 +1,881 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bidirectional_l = exports.bidirectional_r_al = exports.prohibited_characters = exports.non_ASCII_space_characters = exports.commonly_mapped_to_nothing = exports.unassigned_code_points = void 0; +const util_1 = require("./util"); +exports.unassigned_code_points = new Set([ + 0x0221, + ...(0, util_1.range)(0x0234, 0x024f), + ...(0, util_1.range)(0x02ae, 0x02af), + ...(0, util_1.range)(0x02ef, 0x02ff), + ...(0, util_1.range)(0x0350, 0x035f), + ...(0, util_1.range)(0x0370, 0x0373), + ...(0, util_1.range)(0x0376, 0x0379), + ...(0, util_1.range)(0x037b, 0x037d), + ...(0, util_1.range)(0x037f, 0x0383), + 0x038b, + 0x038d, + 0x03a2, + 0x03cf, + ...(0, util_1.range)(0x03f7, 0x03ff), + 0x0487, + 0x04cf, + ...(0, util_1.range)(0x04f6, 0x04f7), + ...(0, util_1.range)(0x04fa, 0x04ff), + ...(0, util_1.range)(0x0510, 0x0530), + ...(0, util_1.range)(0x0557, 0x0558), + 0x0560, + 0x0588, + ...(0, util_1.range)(0x058b, 0x0590), + 0x05a2, + 0x05ba, + ...(0, util_1.range)(0x05c5, 0x05cf), + ...(0, util_1.range)(0x05eb, 0x05ef), + ...(0, util_1.range)(0x05f5, 0x060b), + ...(0, util_1.range)(0x060d, 0x061a), + ...(0, util_1.range)(0x061c, 0x061e), + 0x0620, + ...(0, util_1.range)(0x063b, 0x063f), + ...(0, util_1.range)(0x0656, 0x065f), + ...(0, util_1.range)(0x06ee, 0x06ef), + 0x06ff, + 0x070e, + ...(0, util_1.range)(0x072d, 0x072f), + ...(0, util_1.range)(0x074b, 0x077f), + ...(0, util_1.range)(0x07b2, 0x0900), + 0x0904, + ...(0, util_1.range)(0x093a, 0x093b), + ...(0, util_1.range)(0x094e, 0x094f), + ...(0, util_1.range)(0x0955, 0x0957), + ...(0, util_1.range)(0x0971, 0x0980), + 0x0984, + ...(0, util_1.range)(0x098d, 0x098e), + ...(0, util_1.range)(0x0991, 0x0992), + 0x09a9, + 0x09b1, + ...(0, util_1.range)(0x09b3, 0x09b5), + ...(0, util_1.range)(0x09ba, 0x09bb), + 0x09bd, + ...(0, util_1.range)(0x09c5, 0x09c6), + ...(0, util_1.range)(0x09c9, 0x09ca), + ...(0, util_1.range)(0x09ce, 0x09d6), + ...(0, util_1.range)(0x09d8, 0x09db), + 0x09de, + ...(0, util_1.range)(0x09e4, 0x09e5), + ...(0, util_1.range)(0x09fb, 0x0a01), + ...(0, util_1.range)(0x0a03, 0x0a04), + ...(0, util_1.range)(0x0a0b, 0x0a0e), + ...(0, util_1.range)(0x0a11, 0x0a12), + 0x0a29, + 0x0a31, + 0x0a34, + 0x0a37, + ...(0, util_1.range)(0x0a3a, 0x0a3b), + 0x0a3d, + ...(0, util_1.range)(0x0a43, 0x0a46), + ...(0, util_1.range)(0x0a49, 0x0a4a), + ...(0, util_1.range)(0x0a4e, 0x0a58), + 0x0a5d, + ...(0, util_1.range)(0x0a5f, 0x0a65), + ...(0, util_1.range)(0x0a75, 0x0a80), + 0x0a84, + 0x0a8c, + 0x0a8e, + 0x0a92, + 0x0aa9, + 0x0ab1, + 0x0ab4, + ...(0, util_1.range)(0x0aba, 0x0abb), + 0x0ac6, + 0x0aca, + ...(0, util_1.range)(0x0ace, 0x0acf), + ...(0, util_1.range)(0x0ad1, 0x0adf), + ...(0, util_1.range)(0x0ae1, 0x0ae5), + ...(0, util_1.range)(0x0af0, 0x0b00), + 0x0b04, + ...(0, util_1.range)(0x0b0d, 0x0b0e), + ...(0, util_1.range)(0x0b11, 0x0b12), + 0x0b29, + 0x0b31, + ...(0, util_1.range)(0x0b34, 0x0b35), + ...(0, util_1.range)(0x0b3a, 0x0b3b), + ...(0, util_1.range)(0x0b44, 0x0b46), + ...(0, util_1.range)(0x0b49, 0x0b4a), + ...(0, util_1.range)(0x0b4e, 0x0b55), + ...(0, util_1.range)(0x0b58, 0x0b5b), + 0x0b5e, + ...(0, util_1.range)(0x0b62, 0x0b65), + ...(0, util_1.range)(0x0b71, 0x0b81), + 0x0b84, + ...(0, util_1.range)(0x0b8b, 0x0b8d), + 0x0b91, + ...(0, util_1.range)(0x0b96, 0x0b98), + 0x0b9b, + 0x0b9d, + ...(0, util_1.range)(0x0ba0, 0x0ba2), + ...(0, util_1.range)(0x0ba5, 0x0ba7), + ...(0, util_1.range)(0x0bab, 0x0bad), + 0x0bb6, + ...(0, util_1.range)(0x0bba, 0x0bbd), + ...(0, util_1.range)(0x0bc3, 0x0bc5), + 0x0bc9, + ...(0, util_1.range)(0x0bce, 0x0bd6), + ...(0, util_1.range)(0x0bd8, 0x0be6), + ...(0, util_1.range)(0x0bf3, 0x0c00), + 0x0c04, + 0x0c0d, + 0x0c11, + 0x0c29, + 0x0c34, + ...(0, util_1.range)(0x0c3a, 0x0c3d), + 0x0c45, + 0x0c49, + ...(0, util_1.range)(0x0c4e, 0x0c54), + ...(0, util_1.range)(0x0c57, 0x0c5f), + ...(0, util_1.range)(0x0c62, 0x0c65), + ...(0, util_1.range)(0x0c70, 0x0c81), + 0x0c84, + 0x0c8d, + 0x0c91, + 0x0ca9, + 0x0cb4, + ...(0, util_1.range)(0x0cba, 0x0cbd), + 0x0cc5, + 0x0cc9, + ...(0, util_1.range)(0x0cce, 0x0cd4), + ...(0, util_1.range)(0x0cd7, 0x0cdd), + 0x0cdf, + ...(0, util_1.range)(0x0ce2, 0x0ce5), + ...(0, util_1.range)(0x0cf0, 0x0d01), + 0x0d04, + 0x0d0d, + 0x0d11, + 0x0d29, + ...(0, util_1.range)(0x0d3a, 0x0d3d), + ...(0, util_1.range)(0x0d44, 0x0d45), + 0x0d49, + ...(0, util_1.range)(0x0d4e, 0x0d56), + ...(0, util_1.range)(0x0d58, 0x0d5f), + ...(0, util_1.range)(0x0d62, 0x0d65), + ...(0, util_1.range)(0x0d70, 0x0d81), + 0x0d84, + ...(0, util_1.range)(0x0d97, 0x0d99), + 0x0db2, + 0x0dbc, + ...(0, util_1.range)(0x0dbe, 0x0dbf), + ...(0, util_1.range)(0x0dc7, 0x0dc9), + ...(0, util_1.range)(0x0dcb, 0x0dce), + 0x0dd5, + 0x0dd7, + ...(0, util_1.range)(0x0de0, 0x0df1), + ...(0, util_1.range)(0x0df5, 0x0e00), + ...(0, util_1.range)(0x0e3b, 0x0e3e), + ...(0, util_1.range)(0x0e5c, 0x0e80), + 0x0e83, + ...(0, util_1.range)(0x0e85, 0x0e86), + 0x0e89, + ...(0, util_1.range)(0x0e8b, 0x0e8c), + ...(0, util_1.range)(0x0e8e, 0x0e93), + 0x0e98, + 0x0ea0, + 0x0ea4, + 0x0ea6, + ...(0, util_1.range)(0x0ea8, 0x0ea9), + 0x0eac, + 0x0eba, + ...(0, util_1.range)(0x0ebe, 0x0ebf), + 0x0ec5, + 0x0ec7, + ...(0, util_1.range)(0x0ece, 0x0ecf), + ...(0, util_1.range)(0x0eda, 0x0edb), + ...(0, util_1.range)(0x0ede, 0x0eff), + 0x0f48, + ...(0, util_1.range)(0x0f6b, 0x0f70), + ...(0, util_1.range)(0x0f8c, 0x0f8f), + 0x0f98, + 0x0fbd, + ...(0, util_1.range)(0x0fcd, 0x0fce), + ...(0, util_1.range)(0x0fd0, 0x0fff), + 0x1022, + 0x1028, + 0x102b, + ...(0, util_1.range)(0x1033, 0x1035), + ...(0, util_1.range)(0x103a, 0x103f), + ...(0, util_1.range)(0x105a, 0x109f), + ...(0, util_1.range)(0x10c6, 0x10cf), + ...(0, util_1.range)(0x10f9, 0x10fa), + ...(0, util_1.range)(0x10fc, 0x10ff), + ...(0, util_1.range)(0x115a, 0x115e), + ...(0, util_1.range)(0x11a3, 0x11a7), + ...(0, util_1.range)(0x11fa, 0x11ff), + 0x1207, + 0x1247, + 0x1249, + ...(0, util_1.range)(0x124e, 0x124f), + 0x1257, + 0x1259, + ...(0, util_1.range)(0x125e, 0x125f), + 0x1287, + 0x1289, + ...(0, util_1.range)(0x128e, 0x128f), + 0x12af, + 0x12b1, + ...(0, util_1.range)(0x12b6, 0x12b7), + 0x12bf, + 0x12c1, + ...(0, util_1.range)(0x12c6, 0x12c7), + 0x12cf, + 0x12d7, + 0x12ef, + 0x130f, + 0x1311, + ...(0, util_1.range)(0x1316, 0x1317), + 0x131f, + 0x1347, + ...(0, util_1.range)(0x135b, 0x1360), + ...(0, util_1.range)(0x137d, 0x139f), + ...(0, util_1.range)(0x13f5, 0x1400), + ...(0, util_1.range)(0x1677, 0x167f), + ...(0, util_1.range)(0x169d, 0x169f), + ...(0, util_1.range)(0x16f1, 0x16ff), + 0x170d, + ...(0, util_1.range)(0x1715, 0x171f), + ...(0, util_1.range)(0x1737, 0x173f), + ...(0, util_1.range)(0x1754, 0x175f), + 0x176d, + 0x1771, + ...(0, util_1.range)(0x1774, 0x177f), + ...(0, util_1.range)(0x17dd, 0x17df), + ...(0, util_1.range)(0x17ea, 0x17ff), + 0x180f, + ...(0, util_1.range)(0x181a, 0x181f), + ...(0, util_1.range)(0x1878, 0x187f), + ...(0, util_1.range)(0x18aa, 0x1dff), + ...(0, util_1.range)(0x1e9c, 0x1e9f), + ...(0, util_1.range)(0x1efa, 0x1eff), + ...(0, util_1.range)(0x1f16, 0x1f17), + ...(0, util_1.range)(0x1f1e, 0x1f1f), + ...(0, util_1.range)(0x1f46, 0x1f47), + ...(0, util_1.range)(0x1f4e, 0x1f4f), + 0x1f58, + 0x1f5a, + 0x1f5c, + 0x1f5e, + ...(0, util_1.range)(0x1f7e, 0x1f7f), + 0x1fb5, + 0x1fc5, + ...(0, util_1.range)(0x1fd4, 0x1fd5), + 0x1fdc, + ...(0, util_1.range)(0x1ff0, 0x1ff1), + 0x1ff5, + 0x1fff, + ...(0, util_1.range)(0x2053, 0x2056), + ...(0, util_1.range)(0x2058, 0x205e), + ...(0, util_1.range)(0x2064, 0x2069), + ...(0, util_1.range)(0x2072, 0x2073), + ...(0, util_1.range)(0x208f, 0x209f), + ...(0, util_1.range)(0x20b2, 0x20cf), + ...(0, util_1.range)(0x20eb, 0x20ff), + ...(0, util_1.range)(0x213b, 0x213c), + ...(0, util_1.range)(0x214c, 0x2152), + ...(0, util_1.range)(0x2184, 0x218f), + ...(0, util_1.range)(0x23cf, 0x23ff), + ...(0, util_1.range)(0x2427, 0x243f), + ...(0, util_1.range)(0x244b, 0x245f), + 0x24ff, + ...(0, util_1.range)(0x2614, 0x2615), + 0x2618, + ...(0, util_1.range)(0x267e, 0x267f), + ...(0, util_1.range)(0x268a, 0x2700), + 0x2705, + ...(0, util_1.range)(0x270a, 0x270b), + 0x2728, + 0x274c, + 0x274e, + ...(0, util_1.range)(0x2753, 0x2755), + 0x2757, + ...(0, util_1.range)(0x275f, 0x2760), + ...(0, util_1.range)(0x2795, 0x2797), + 0x27b0, + ...(0, util_1.range)(0x27bf, 0x27cf), + ...(0, util_1.range)(0x27ec, 0x27ef), + ...(0, util_1.range)(0x2b00, 0x2e7f), + 0x2e9a, + ...(0, util_1.range)(0x2ef4, 0x2eff), + ...(0, util_1.range)(0x2fd6, 0x2fef), + ...(0, util_1.range)(0x2ffc, 0x2fff), + 0x3040, + ...(0, util_1.range)(0x3097, 0x3098), + ...(0, util_1.range)(0x3100, 0x3104), + ...(0, util_1.range)(0x312d, 0x3130), + 0x318f, + ...(0, util_1.range)(0x31b8, 0x31ef), + ...(0, util_1.range)(0x321d, 0x321f), + ...(0, util_1.range)(0x3244, 0x3250), + ...(0, util_1.range)(0x327c, 0x327e), + ...(0, util_1.range)(0x32cc, 0x32cf), + 0x32ff, + ...(0, util_1.range)(0x3377, 0x337a), + ...(0, util_1.range)(0x33de, 0x33df), + 0x33ff, + ...(0, util_1.range)(0x4db6, 0x4dff), + ...(0, util_1.range)(0x9fa6, 0x9fff), + ...(0, util_1.range)(0xa48d, 0xa48f), + ...(0, util_1.range)(0xa4c7, 0xabff), + ...(0, util_1.range)(0xd7a4, 0xd7ff), + ...(0, util_1.range)(0xfa2e, 0xfa2f), + ...(0, util_1.range)(0xfa6b, 0xfaff), + ...(0, util_1.range)(0xfb07, 0xfb12), + ...(0, util_1.range)(0xfb18, 0xfb1c), + 0xfb37, + 0xfb3d, + 0xfb3f, + 0xfb42, + 0xfb45, + ...(0, util_1.range)(0xfbb2, 0xfbd2), + ...(0, util_1.range)(0xfd40, 0xfd4f), + ...(0, util_1.range)(0xfd90, 0xfd91), + ...(0, util_1.range)(0xfdc8, 0xfdcf), + ...(0, util_1.range)(0xfdfd, 0xfdff), + ...(0, util_1.range)(0xfe10, 0xfe1f), + ...(0, util_1.range)(0xfe24, 0xfe2f), + ...(0, util_1.range)(0xfe47, 0xfe48), + 0xfe53, + 0xfe67, + ...(0, util_1.range)(0xfe6c, 0xfe6f), + 0xfe75, + ...(0, util_1.range)(0xfefd, 0xfefe), + 0xff00, + ...(0, util_1.range)(0xffbf, 0xffc1), + ...(0, util_1.range)(0xffc8, 0xffc9), + ...(0, util_1.range)(0xffd0, 0xffd1), + ...(0, util_1.range)(0xffd8, 0xffd9), + ...(0, util_1.range)(0xffdd, 0xffdf), + 0xffe7, + ...(0, util_1.range)(0xffef, 0xfff8), + ...(0, util_1.range)(0x10000, 0x102ff), + 0x1031f, + ...(0, util_1.range)(0x10324, 0x1032f), + ...(0, util_1.range)(0x1034b, 0x103ff), + ...(0, util_1.range)(0x10426, 0x10427), + ...(0, util_1.range)(0x1044e, 0x1cfff), + ...(0, util_1.range)(0x1d0f6, 0x1d0ff), + ...(0, util_1.range)(0x1d127, 0x1d129), + ...(0, util_1.range)(0x1d1de, 0x1d3ff), + 0x1d455, + 0x1d49d, + ...(0, util_1.range)(0x1d4a0, 0x1d4a1), + ...(0, util_1.range)(0x1d4a3, 0x1d4a4), + ...(0, util_1.range)(0x1d4a7, 0x1d4a8), + 0x1d4ad, + 0x1d4ba, + 0x1d4bc, + 0x1d4c1, + 0x1d4c4, + 0x1d506, + ...(0, util_1.range)(0x1d50b, 0x1d50c), + 0x1d515, + 0x1d51d, + 0x1d53a, + 0x1d53f, + 0x1d545, + ...(0, util_1.range)(0x1d547, 0x1d549), + 0x1d551, + ...(0, util_1.range)(0x1d6a4, 0x1d6a7), + ...(0, util_1.range)(0x1d7ca, 0x1d7cd), + ...(0, util_1.range)(0x1d800, 0x1fffd), + ...(0, util_1.range)(0x2a6d7, 0x2f7ff), + ...(0, util_1.range)(0x2fa1e, 0x2fffd), + ...(0, util_1.range)(0x30000, 0x3fffd), + ...(0, util_1.range)(0x40000, 0x4fffd), + ...(0, util_1.range)(0x50000, 0x5fffd), + ...(0, util_1.range)(0x60000, 0x6fffd), + ...(0, util_1.range)(0x70000, 0x7fffd), + ...(0, util_1.range)(0x80000, 0x8fffd), + ...(0, util_1.range)(0x90000, 0x9fffd), + ...(0, util_1.range)(0xa0000, 0xafffd), + ...(0, util_1.range)(0xb0000, 0xbfffd), + ...(0, util_1.range)(0xc0000, 0xcfffd), + ...(0, util_1.range)(0xd0000, 0xdfffd), + 0xe0000, + ...(0, util_1.range)(0xe0002, 0xe001f), + ...(0, util_1.range)(0xe0080, 0xefffd), +]); +exports.commonly_mapped_to_nothing = new Set([ + 0x00ad, 0x034f, 0x1806, 0x180b, 0x180c, 0x180d, 0x200b, 0x200c, 0x200d, + 0x2060, 0xfe00, 0xfe01, 0xfe02, 0xfe03, 0xfe04, 0xfe05, 0xfe06, 0xfe07, + 0xfe08, 0xfe09, 0xfe0a, 0xfe0b, 0xfe0c, 0xfe0d, 0xfe0e, 0xfe0f, 0xfeff, +]); +exports.non_ASCII_space_characters = new Set([ + 0x00a0, 0x1680, + 0x2000, 0x2001, 0x2002, + 0x2003, 0x2004, + 0x2005, 0x2006, + 0x2007, 0x2008, + 0x2009, 0x200a, + 0x200b, 0x202f, + 0x205f, 0x3000, +]); +exports.prohibited_characters = new Set([ + ...exports.non_ASCII_space_characters, + ...(0, util_1.range)(0, 0x001f), + 0x007f, + ...(0, util_1.range)(0x0080, 0x009f), + 0x06dd, + 0x070f, + 0x180e, + 0x200c, + 0x200d, + 0x2028, + 0x2029, + 0x2060, + 0x2061, + 0x2062, + 0x2063, + ...(0, util_1.range)(0x206a, 0x206f), + 0xfeff, + ...(0, util_1.range)(0xfff9, 0xfffc), + ...(0, util_1.range)(0x1d173, 0x1d17a), + ...(0, util_1.range)(0xe000, 0xf8ff), + ...(0, util_1.range)(0xf0000, 0xffffd), + ...(0, util_1.range)(0x100000, 0x10fffd), + ...(0, util_1.range)(0xfdd0, 0xfdef), + ...(0, util_1.range)(0xfffe, 0xffff), + ...(0, util_1.range)(0x1fffe, 0x1ffff), + ...(0, util_1.range)(0x2fffe, 0x2ffff), + ...(0, util_1.range)(0x3fffe, 0x3ffff), + ...(0, util_1.range)(0x4fffe, 0x4ffff), + ...(0, util_1.range)(0x5fffe, 0x5ffff), + ...(0, util_1.range)(0x6fffe, 0x6ffff), + ...(0, util_1.range)(0x7fffe, 0x7ffff), + ...(0, util_1.range)(0x8fffe, 0x8ffff), + ...(0, util_1.range)(0x9fffe, 0x9ffff), + ...(0, util_1.range)(0xafffe, 0xaffff), + ...(0, util_1.range)(0xbfffe, 0xbffff), + ...(0, util_1.range)(0xcfffe, 0xcffff), + ...(0, util_1.range)(0xdfffe, 0xdffff), + ...(0, util_1.range)(0xefffe, 0xeffff), + ...(0, util_1.range)(0x10fffe, 0x10ffff), + ...(0, util_1.range)(0xd800, 0xdfff), + 0xfff9, + 0xfffa, + 0xfffb, + 0xfffc, + 0xfffd, + ...(0, util_1.range)(0x2ff0, 0x2ffb), + 0x0340, + 0x0341, + 0x200e, + 0x200f, + 0x202a, + 0x202b, + 0x202c, + 0x202d, + 0x202e, + 0x206a, + 0x206b, + 0x206c, + 0x206d, + 0x206e, + 0x206f, + 0xe0001, + ...(0, util_1.range)(0xe0020, 0xe007f), +]); +exports.bidirectional_r_al = new Set([ + 0x05be, + 0x05c0, + 0x05c3, + ...(0, util_1.range)(0x05d0, 0x05ea), + ...(0, util_1.range)(0x05f0, 0x05f4), + 0x061b, + 0x061f, + ...(0, util_1.range)(0x0621, 0x063a), + ...(0, util_1.range)(0x0640, 0x064a), + ...(0, util_1.range)(0x066d, 0x066f), + ...(0, util_1.range)(0x0671, 0x06d5), + 0x06dd, + ...(0, util_1.range)(0x06e5, 0x06e6), + ...(0, util_1.range)(0x06fa, 0x06fe), + ...(0, util_1.range)(0x0700, 0x070d), + 0x0710, + ...(0, util_1.range)(0x0712, 0x072c), + ...(0, util_1.range)(0x0780, 0x07a5), + 0x07b1, + 0x200f, + 0xfb1d, + ...(0, util_1.range)(0xfb1f, 0xfb28), + ...(0, util_1.range)(0xfb2a, 0xfb36), + ...(0, util_1.range)(0xfb38, 0xfb3c), + 0xfb3e, + ...(0, util_1.range)(0xfb40, 0xfb41), + ...(0, util_1.range)(0xfb43, 0xfb44), + ...(0, util_1.range)(0xfb46, 0xfbb1), + ...(0, util_1.range)(0xfbd3, 0xfd3d), + ...(0, util_1.range)(0xfd50, 0xfd8f), + ...(0, util_1.range)(0xfd92, 0xfdc7), + ...(0, util_1.range)(0xfdf0, 0xfdfc), + ...(0, util_1.range)(0xfe70, 0xfe74), + ...(0, util_1.range)(0xfe76, 0xfefc), +]); +exports.bidirectional_l = new Set([ + ...(0, util_1.range)(0x0041, 0x005a), + ...(0, util_1.range)(0x0061, 0x007a), + 0x00aa, + 0x00b5, + 0x00ba, + ...(0, util_1.range)(0x00c0, 0x00d6), + ...(0, util_1.range)(0x00d8, 0x00f6), + ...(0, util_1.range)(0x00f8, 0x0220), + ...(0, util_1.range)(0x0222, 0x0233), + ...(0, util_1.range)(0x0250, 0x02ad), + ...(0, util_1.range)(0x02b0, 0x02b8), + ...(0, util_1.range)(0x02bb, 0x02c1), + ...(0, util_1.range)(0x02d0, 0x02d1), + ...(0, util_1.range)(0x02e0, 0x02e4), + 0x02ee, + 0x037a, + 0x0386, + ...(0, util_1.range)(0x0388, 0x038a), + 0x038c, + ...(0, util_1.range)(0x038e, 0x03a1), + ...(0, util_1.range)(0x03a3, 0x03ce), + ...(0, util_1.range)(0x03d0, 0x03f5), + ...(0, util_1.range)(0x0400, 0x0482), + ...(0, util_1.range)(0x048a, 0x04ce), + ...(0, util_1.range)(0x04d0, 0x04f5), + ...(0, util_1.range)(0x04f8, 0x04f9), + ...(0, util_1.range)(0x0500, 0x050f), + ...(0, util_1.range)(0x0531, 0x0556), + ...(0, util_1.range)(0x0559, 0x055f), + ...(0, util_1.range)(0x0561, 0x0587), + 0x0589, + 0x0903, + ...(0, util_1.range)(0x0905, 0x0939), + ...(0, util_1.range)(0x093d, 0x0940), + ...(0, util_1.range)(0x0949, 0x094c), + 0x0950, + ...(0, util_1.range)(0x0958, 0x0961), + ...(0, util_1.range)(0x0964, 0x0970), + ...(0, util_1.range)(0x0982, 0x0983), + ...(0, util_1.range)(0x0985, 0x098c), + ...(0, util_1.range)(0x098f, 0x0990), + ...(0, util_1.range)(0x0993, 0x09a8), + ...(0, util_1.range)(0x09aa, 0x09b0), + 0x09b2, + ...(0, util_1.range)(0x09b6, 0x09b9), + ...(0, util_1.range)(0x09be, 0x09c0), + ...(0, util_1.range)(0x09c7, 0x09c8), + ...(0, util_1.range)(0x09cb, 0x09cc), + 0x09d7, + ...(0, util_1.range)(0x09dc, 0x09dd), + ...(0, util_1.range)(0x09df, 0x09e1), + ...(0, util_1.range)(0x09e6, 0x09f1), + ...(0, util_1.range)(0x09f4, 0x09fa), + ...(0, util_1.range)(0x0a05, 0x0a0a), + ...(0, util_1.range)(0x0a0f, 0x0a10), + ...(0, util_1.range)(0x0a13, 0x0a28), + ...(0, util_1.range)(0x0a2a, 0x0a30), + ...(0, util_1.range)(0x0a32, 0x0a33), + ...(0, util_1.range)(0x0a35, 0x0a36), + ...(0, util_1.range)(0x0a38, 0x0a39), + ...(0, util_1.range)(0x0a3e, 0x0a40), + ...(0, util_1.range)(0x0a59, 0x0a5c), + 0x0a5e, + ...(0, util_1.range)(0x0a66, 0x0a6f), + ...(0, util_1.range)(0x0a72, 0x0a74), + 0x0a83, + ...(0, util_1.range)(0x0a85, 0x0a8b), + 0x0a8d, + ...(0, util_1.range)(0x0a8f, 0x0a91), + ...(0, util_1.range)(0x0a93, 0x0aa8), + ...(0, util_1.range)(0x0aaa, 0x0ab0), + ...(0, util_1.range)(0x0ab2, 0x0ab3), + ...(0, util_1.range)(0x0ab5, 0x0ab9), + ...(0, util_1.range)(0x0abd, 0x0ac0), + 0x0ac9, + ...(0, util_1.range)(0x0acb, 0x0acc), + 0x0ad0, + 0x0ae0, + ...(0, util_1.range)(0x0ae6, 0x0aef), + ...(0, util_1.range)(0x0b02, 0x0b03), + ...(0, util_1.range)(0x0b05, 0x0b0c), + ...(0, util_1.range)(0x0b0f, 0x0b10), + ...(0, util_1.range)(0x0b13, 0x0b28), + ...(0, util_1.range)(0x0b2a, 0x0b30), + ...(0, util_1.range)(0x0b32, 0x0b33), + ...(0, util_1.range)(0x0b36, 0x0b39), + ...(0, util_1.range)(0x0b3d, 0x0b3e), + 0x0b40, + ...(0, util_1.range)(0x0b47, 0x0b48), + ...(0, util_1.range)(0x0b4b, 0x0b4c), + 0x0b57, + ...(0, util_1.range)(0x0b5c, 0x0b5d), + ...(0, util_1.range)(0x0b5f, 0x0b61), + ...(0, util_1.range)(0x0b66, 0x0b70), + 0x0b83, + ...(0, util_1.range)(0x0b85, 0x0b8a), + ...(0, util_1.range)(0x0b8e, 0x0b90), + ...(0, util_1.range)(0x0b92, 0x0b95), + ...(0, util_1.range)(0x0b99, 0x0b9a), + 0x0b9c, + ...(0, util_1.range)(0x0b9e, 0x0b9f), + ...(0, util_1.range)(0x0ba3, 0x0ba4), + ...(0, util_1.range)(0x0ba8, 0x0baa), + ...(0, util_1.range)(0x0bae, 0x0bb5), + ...(0, util_1.range)(0x0bb7, 0x0bb9), + ...(0, util_1.range)(0x0bbe, 0x0bbf), + ...(0, util_1.range)(0x0bc1, 0x0bc2), + ...(0, util_1.range)(0x0bc6, 0x0bc8), + ...(0, util_1.range)(0x0bca, 0x0bcc), + 0x0bd7, + ...(0, util_1.range)(0x0be7, 0x0bf2), + ...(0, util_1.range)(0x0c01, 0x0c03), + ...(0, util_1.range)(0x0c05, 0x0c0c), + ...(0, util_1.range)(0x0c0e, 0x0c10), + ...(0, util_1.range)(0x0c12, 0x0c28), + ...(0, util_1.range)(0x0c2a, 0x0c33), + ...(0, util_1.range)(0x0c35, 0x0c39), + ...(0, util_1.range)(0x0c41, 0x0c44), + ...(0, util_1.range)(0x0c60, 0x0c61), + ...(0, util_1.range)(0x0c66, 0x0c6f), + ...(0, util_1.range)(0x0c82, 0x0c83), + ...(0, util_1.range)(0x0c85, 0x0c8c), + ...(0, util_1.range)(0x0c8e, 0x0c90), + ...(0, util_1.range)(0x0c92, 0x0ca8), + ...(0, util_1.range)(0x0caa, 0x0cb3), + ...(0, util_1.range)(0x0cb5, 0x0cb9), + 0x0cbe, + ...(0, util_1.range)(0x0cc0, 0x0cc4), + ...(0, util_1.range)(0x0cc7, 0x0cc8), + ...(0, util_1.range)(0x0cca, 0x0ccb), + ...(0, util_1.range)(0x0cd5, 0x0cd6), + 0x0cde, + ...(0, util_1.range)(0x0ce0, 0x0ce1), + ...(0, util_1.range)(0x0ce6, 0x0cef), + ...(0, util_1.range)(0x0d02, 0x0d03), + ...(0, util_1.range)(0x0d05, 0x0d0c), + ...(0, util_1.range)(0x0d0e, 0x0d10), + ...(0, util_1.range)(0x0d12, 0x0d28), + ...(0, util_1.range)(0x0d2a, 0x0d39), + ...(0, util_1.range)(0x0d3e, 0x0d40), + ...(0, util_1.range)(0x0d46, 0x0d48), + ...(0, util_1.range)(0x0d4a, 0x0d4c), + 0x0d57, + ...(0, util_1.range)(0x0d60, 0x0d61), + ...(0, util_1.range)(0x0d66, 0x0d6f), + ...(0, util_1.range)(0x0d82, 0x0d83), + ...(0, util_1.range)(0x0d85, 0x0d96), + ...(0, util_1.range)(0x0d9a, 0x0db1), + ...(0, util_1.range)(0x0db3, 0x0dbb), + 0x0dbd, + ...(0, util_1.range)(0x0dc0, 0x0dc6), + ...(0, util_1.range)(0x0dcf, 0x0dd1), + ...(0, util_1.range)(0x0dd8, 0x0ddf), + ...(0, util_1.range)(0x0df2, 0x0df4), + ...(0, util_1.range)(0x0e01, 0x0e30), + ...(0, util_1.range)(0x0e32, 0x0e33), + ...(0, util_1.range)(0x0e40, 0x0e46), + ...(0, util_1.range)(0x0e4f, 0x0e5b), + ...(0, util_1.range)(0x0e81, 0x0e82), + 0x0e84, + ...(0, util_1.range)(0x0e87, 0x0e88), + 0x0e8a, + 0x0e8d, + ...(0, util_1.range)(0x0e94, 0x0e97), + ...(0, util_1.range)(0x0e99, 0x0e9f), + ...(0, util_1.range)(0x0ea1, 0x0ea3), + 0x0ea5, + 0x0ea7, + ...(0, util_1.range)(0x0eaa, 0x0eab), + ...(0, util_1.range)(0x0ead, 0x0eb0), + ...(0, util_1.range)(0x0eb2, 0x0eb3), + 0x0ebd, + ...(0, util_1.range)(0x0ec0, 0x0ec4), + 0x0ec6, + ...(0, util_1.range)(0x0ed0, 0x0ed9), + ...(0, util_1.range)(0x0edc, 0x0edd), + ...(0, util_1.range)(0x0f00, 0x0f17), + ...(0, util_1.range)(0x0f1a, 0x0f34), + 0x0f36, + 0x0f38, + ...(0, util_1.range)(0x0f3e, 0x0f47), + ...(0, util_1.range)(0x0f49, 0x0f6a), + 0x0f7f, + 0x0f85, + ...(0, util_1.range)(0x0f88, 0x0f8b), + ...(0, util_1.range)(0x0fbe, 0x0fc5), + ...(0, util_1.range)(0x0fc7, 0x0fcc), + 0x0fcf, + ...(0, util_1.range)(0x1000, 0x1021), + ...(0, util_1.range)(0x1023, 0x1027), + ...(0, util_1.range)(0x1029, 0x102a), + 0x102c, + 0x1031, + 0x1038, + ...(0, util_1.range)(0x1040, 0x1057), + ...(0, util_1.range)(0x10a0, 0x10c5), + ...(0, util_1.range)(0x10d0, 0x10f8), + 0x10fb, + ...(0, util_1.range)(0x1100, 0x1159), + ...(0, util_1.range)(0x115f, 0x11a2), + ...(0, util_1.range)(0x11a8, 0x11f9), + ...(0, util_1.range)(0x1200, 0x1206), + ...(0, util_1.range)(0x1208, 0x1246), + 0x1248, + ...(0, util_1.range)(0x124a, 0x124d), + ...(0, util_1.range)(0x1250, 0x1256), + 0x1258, + ...(0, util_1.range)(0x125a, 0x125d), + ...(0, util_1.range)(0x1260, 0x1286), + 0x1288, + ...(0, util_1.range)(0x128a, 0x128d), + ...(0, util_1.range)(0x1290, 0x12ae), + 0x12b0, + ...(0, util_1.range)(0x12b2, 0x12b5), + ...(0, util_1.range)(0x12b8, 0x12be), + 0x12c0, + ...(0, util_1.range)(0x12c2, 0x12c5), + ...(0, util_1.range)(0x12c8, 0x12ce), + ...(0, util_1.range)(0x12d0, 0x12d6), + ...(0, util_1.range)(0x12d8, 0x12ee), + ...(0, util_1.range)(0x12f0, 0x130e), + 0x1310, + ...(0, util_1.range)(0x1312, 0x1315), + ...(0, util_1.range)(0x1318, 0x131e), + ...(0, util_1.range)(0x1320, 0x1346), + ...(0, util_1.range)(0x1348, 0x135a), + ...(0, util_1.range)(0x1361, 0x137c), + ...(0, util_1.range)(0x13a0, 0x13f4), + ...(0, util_1.range)(0x1401, 0x1676), + ...(0, util_1.range)(0x1681, 0x169a), + ...(0, util_1.range)(0x16a0, 0x16f0), + ...(0, util_1.range)(0x1700, 0x170c), + ...(0, util_1.range)(0x170e, 0x1711), + ...(0, util_1.range)(0x1720, 0x1731), + ...(0, util_1.range)(0x1735, 0x1736), + ...(0, util_1.range)(0x1740, 0x1751), + ...(0, util_1.range)(0x1760, 0x176c), + ...(0, util_1.range)(0x176e, 0x1770), + ...(0, util_1.range)(0x1780, 0x17b6), + ...(0, util_1.range)(0x17be, 0x17c5), + ...(0, util_1.range)(0x17c7, 0x17c8), + ...(0, util_1.range)(0x17d4, 0x17da), + 0x17dc, + ...(0, util_1.range)(0x17e0, 0x17e9), + ...(0, util_1.range)(0x1810, 0x1819), + ...(0, util_1.range)(0x1820, 0x1877), + ...(0, util_1.range)(0x1880, 0x18a8), + ...(0, util_1.range)(0x1e00, 0x1e9b), + ...(0, util_1.range)(0x1ea0, 0x1ef9), + ...(0, util_1.range)(0x1f00, 0x1f15), + ...(0, util_1.range)(0x1f18, 0x1f1d), + ...(0, util_1.range)(0x1f20, 0x1f45), + ...(0, util_1.range)(0x1f48, 0x1f4d), + ...(0, util_1.range)(0x1f50, 0x1f57), + 0x1f59, + 0x1f5b, + 0x1f5d, + ...(0, util_1.range)(0x1f5f, 0x1f7d), + ...(0, util_1.range)(0x1f80, 0x1fb4), + ...(0, util_1.range)(0x1fb6, 0x1fbc), + 0x1fbe, + ...(0, util_1.range)(0x1fc2, 0x1fc4), + ...(0, util_1.range)(0x1fc6, 0x1fcc), + ...(0, util_1.range)(0x1fd0, 0x1fd3), + ...(0, util_1.range)(0x1fd6, 0x1fdb), + ...(0, util_1.range)(0x1fe0, 0x1fec), + ...(0, util_1.range)(0x1ff2, 0x1ff4), + ...(0, util_1.range)(0x1ff6, 0x1ffc), + 0x200e, + 0x2071, + 0x207f, + 0x2102, + 0x2107, + ...(0, util_1.range)(0x210a, 0x2113), + 0x2115, + ...(0, util_1.range)(0x2119, 0x211d), + 0x2124, + 0x2126, + 0x2128, + ...(0, util_1.range)(0x212a, 0x212d), + ...(0, util_1.range)(0x212f, 0x2131), + ...(0, util_1.range)(0x2133, 0x2139), + ...(0, util_1.range)(0x213d, 0x213f), + ...(0, util_1.range)(0x2145, 0x2149), + ...(0, util_1.range)(0x2160, 0x2183), + ...(0, util_1.range)(0x2336, 0x237a), + 0x2395, + ...(0, util_1.range)(0x249c, 0x24e9), + ...(0, util_1.range)(0x3005, 0x3007), + ...(0, util_1.range)(0x3021, 0x3029), + ...(0, util_1.range)(0x3031, 0x3035), + ...(0, util_1.range)(0x3038, 0x303c), + ...(0, util_1.range)(0x3041, 0x3096), + ...(0, util_1.range)(0x309d, 0x309f), + ...(0, util_1.range)(0x30a1, 0x30fa), + ...(0, util_1.range)(0x30fc, 0x30ff), + ...(0, util_1.range)(0x3105, 0x312c), + ...(0, util_1.range)(0x3131, 0x318e), + ...(0, util_1.range)(0x3190, 0x31b7), + ...(0, util_1.range)(0x31f0, 0x321c), + ...(0, util_1.range)(0x3220, 0x3243), + ...(0, util_1.range)(0x3260, 0x327b), + ...(0, util_1.range)(0x327f, 0x32b0), + ...(0, util_1.range)(0x32c0, 0x32cb), + ...(0, util_1.range)(0x32d0, 0x32fe), + ...(0, util_1.range)(0x3300, 0x3376), + ...(0, util_1.range)(0x337b, 0x33dd), + ...(0, util_1.range)(0x33e0, 0x33fe), + ...(0, util_1.range)(0x3400, 0x4db5), + ...(0, util_1.range)(0x4e00, 0x9fa5), + ...(0, util_1.range)(0xa000, 0xa48c), + ...(0, util_1.range)(0xac00, 0xd7a3), + ...(0, util_1.range)(0xd800, 0xfa2d), + ...(0, util_1.range)(0xfa30, 0xfa6a), + ...(0, util_1.range)(0xfb00, 0xfb06), + ...(0, util_1.range)(0xfb13, 0xfb17), + ...(0, util_1.range)(0xff21, 0xff3a), + ...(0, util_1.range)(0xff41, 0xff5a), + ...(0, util_1.range)(0xff66, 0xffbe), + ...(0, util_1.range)(0xffc2, 0xffc7), + ...(0, util_1.range)(0xffca, 0xffcf), + ...(0, util_1.range)(0xffd2, 0xffd7), + ...(0, util_1.range)(0xffda, 0xffdc), + ...(0, util_1.range)(0x10300, 0x1031e), + ...(0, util_1.range)(0x10320, 0x10323), + ...(0, util_1.range)(0x10330, 0x1034a), + ...(0, util_1.range)(0x10400, 0x10425), + ...(0, util_1.range)(0x10428, 0x1044d), + ...(0, util_1.range)(0x1d000, 0x1d0f5), + ...(0, util_1.range)(0x1d100, 0x1d126), + ...(0, util_1.range)(0x1d12a, 0x1d166), + ...(0, util_1.range)(0x1d16a, 0x1d172), + ...(0, util_1.range)(0x1d183, 0x1d184), + ...(0, util_1.range)(0x1d18c, 0x1d1a9), + ...(0, util_1.range)(0x1d1ae, 0x1d1dd), + ...(0, util_1.range)(0x1d400, 0x1d454), + ...(0, util_1.range)(0x1d456, 0x1d49c), + ...(0, util_1.range)(0x1d49e, 0x1d49f), + 0x1d4a2, + ...(0, util_1.range)(0x1d4a5, 0x1d4a6), + ...(0, util_1.range)(0x1d4a9, 0x1d4ac), + ...(0, util_1.range)(0x1d4ae, 0x1d4b9), + 0x1d4bb, + ...(0, util_1.range)(0x1d4bd, 0x1d4c0), + ...(0, util_1.range)(0x1d4c2, 0x1d4c3), + ...(0, util_1.range)(0x1d4c5, 0x1d505), + ...(0, util_1.range)(0x1d507, 0x1d50a), + ...(0, util_1.range)(0x1d50d, 0x1d514), + ...(0, util_1.range)(0x1d516, 0x1d51c), + ...(0, util_1.range)(0x1d51e, 0x1d539), + ...(0, util_1.range)(0x1d53b, 0x1d53e), + ...(0, util_1.range)(0x1d540, 0x1d544), + 0x1d546, + ...(0, util_1.range)(0x1d54a, 0x1d550), + ...(0, util_1.range)(0x1d552, 0x1d6a3), + ...(0, util_1.range)(0x1d6a8, 0x1d7c9), + ...(0, util_1.range)(0x20000, 0x2a6d6), + ...(0, util_1.range)(0x2f800, 0x2fa1d), + ...(0, util_1.range)(0xf0000, 0xffffd), + ...(0, util_1.range)(0x100000, 0x10fffd), +]); +//# sourceMappingURL=code-points-src.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js.map new file mode 100644 index 00000000..dfb14ea8 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/code-points-src.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code-points-src.js","sourceRoot":"","sources":["../src/code-points-src.ts"],"names":[],"mappings":";;;AAAA,iCAA+B;AAMlB,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAC;IAC5C,MAAM;IACN,GAAG,IAAA,YAAK,EAAC,MAAM,EAAE,MAAM,CAAC;IACxB,GAAG,IAAA,YAAK,EAAC,MAAM,EAAE,MAAM,CAAC;IACxB,GAAG,IAAA,YAAK,EAAC,MAAM,EAAE,MAAM,CAAC;IACxB,GAAG,IAAA,YAAK,EAAC,MAAM,EAAE,MAAM,CAAC;IACxB,GAAG,IAAA,YAAK,EAAC,MAAM,EAAE,MAAM,CAAC;IACxB,GAAG,IAAA,YAAK,EAAC,MAAM,EAAE,MAAM,CAAC;IACxB,GAAG,IAAA,YAAK,EAAC,MAAM,EAAE,MAAM,CA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CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,OAAO;IACP,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,GAAG,IAAA,YAAK,EAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts new file mode 100644 index 00000000..5a83ab24 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=generate-code-points.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts.map new file mode 100644 index 00000000..b102903e --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"generate-code-points.d.ts","sourceRoot":"","sources":["../src/generate-code-points.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js new file mode 100644 index 00000000..38e94392 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js @@ -0,0 +1,83 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const zlib_1 = require("zlib"); +const sparse_bitfield_1 = __importDefault(require("sparse-bitfield")); +const codePoints = __importStar(require("./code-points-src")); +const fs_1 = require("fs"); +const prettier = __importStar(require("prettier")); +const unassigned_code_points = (0, sparse_bitfield_1.default)(); +const commonly_mapped_to_nothing = (0, sparse_bitfield_1.default)(); +const non_ascii_space_characters = (0, sparse_bitfield_1.default)(); +const prohibited_characters = (0, sparse_bitfield_1.default)(); +const bidirectional_r_al = (0, sparse_bitfield_1.default)(); +const bidirectional_l = (0, sparse_bitfield_1.default)(); +function traverse(bits, src) { + for (const code of src.keys()) { + bits.set(code, true); + } + const buffer = bits.toBuffer(); + return Buffer.concat([createSize(buffer), buffer]); +} +function createSize(buffer) { + const buf = Buffer.alloc(4); + buf.writeUInt32BE(buffer.length); + return buf; +} +const memory = []; +memory.push(traverse(unassigned_code_points, codePoints.unassigned_code_points), traverse(commonly_mapped_to_nothing, codePoints.commonly_mapped_to_nothing), traverse(non_ascii_space_characters, codePoints.non_ASCII_space_characters), traverse(prohibited_characters, codePoints.prohibited_characters), traverse(bidirectional_r_al, codePoints.bidirectional_r_al), traverse(bidirectional_l, codePoints.bidirectional_l)); +async function writeCodepoints() { + const config = await prettier.resolveConfig(__dirname); + const formatOptions = { ...config, parser: 'typescript' }; + function write(stream, chunk) { + return new Promise((resolve) => stream.write(chunk, () => resolve())); + } + await write((0, fs_1.createWriteStream)(process.argv[2]), await prettier.format(`import { gunzipSync } from 'zlib'; + + export default gunzipSync( + Buffer.from( + '${(0, zlib_1.gzipSync)(Buffer.concat(memory), { level: 9 }).toString('base64')}', + 'base64' + ) + ); + `, formatOptions)); + const fsStreamUncompressedData = (0, fs_1.createWriteStream)(process.argv[3]); + await write(fsStreamUncompressedData, await prettier.format(`const data = Buffer.from('${Buffer.concat(memory).toString('base64')}', 'base64');\nexport default data;\n`, formatOptions)); +} +writeCodepoints().catch((error) => console.error('error occurred generating saslprep codepoint data', { error })); +//# sourceMappingURL=generate-code-points.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js.map new file mode 100644 index 00000000..96b6095d --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js.map @@ -0,0 +1 @@ +{"version":3,"file":"generate-code-points.js","sourceRoot":"","sources":["../src/generate-code-points.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAgC;AAChC,sEAAuC;AACvC,8DAAgD;AAChD,2BAAuC;AACvC,mDAAqC;AAGrC,MAAM,sBAAsB,GAAG,IAAA,yBAAQ,GAAE,CAAC;AAC1C,MAAM,0BAA0B,GAAG,IAAA,yBAAQ,GAAE,CAAC;AAC9C,MAAM,0BAA0B,GAAG,IAAA,yBAAQ,GAAE,CAAC;AAC9C,MAAM,qBAAqB,GAAG,IAAA,yBAAQ,GAAE,CAAC;AACzC,MAAM,kBAAkB,GAAG,IAAA,yBAAQ,GAAE,CAAC;AACtC,MAAM,eAAe,GAAG,IAAA,yBAAQ,GAAE,CAAC;AAMnC,SAAS,QAAQ,CAAC,IAA+B,EAAE,GAAgB;IACjE,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,UAAU,CAAC,MAAc;IAChC,MAAM,GAAG,GAAG,MAAM,CAAC,KA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IAEF,MAAM,wBAAwB,GAAG,IAAA,sBAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpE,MAAM,KAAK,CACT,wBAAwB,EACxB,MAAM,QAAQ,CAAC,MAAM,CACnB,6BAA6B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CACzD,QAAQ,CACT,uCAAuC,EACxC,aAAa,CACd,CACF,CAAC;AACJ,CAAC;AAED,eAAe,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAEhC,OAAO,CAAC,KAAK,CAAC,mDAAmD,EAAE,EAAE,KAAK,EAAE,CAAC,CAC9E,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts new file mode 100644 index 00000000..24d575c5 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts @@ -0,0 +1,11 @@ +import type { createMemoryCodePoints } from './memory-code-points'; +declare function saslprep({ unassigned_code_points, commonly_mapped_to_nothing, non_ASCII_space_characters, prohibited_characters, bidirectional_r_al, bidirectional_l, }: ReturnType, input: string, opts?: { + allowUnassigned?: boolean; +}): string; +declare namespace saslprep { + export var saslprep: typeof import("."); + var _a: typeof import("."); + export { _a as default }; +} +export = saslprep; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts.map new file mode 100644 index 00000000..e53e3946 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAsCnE,iBAAS,QAAQ,CACf,EACE,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,EAC5C,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAO,GACvC,MAAM,CAqGR;kBAhHQ,QAAQ;;;;;AAoHjB,SAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js new file mode 100644 index 00000000..07d87bc5 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js @@ -0,0 +1,65 @@ +"use strict"; +const getCodePoint = (character) => character.codePointAt(0); +const first = (x) => x[0]; +const last = (x) => x[x.length - 1]; +function toCodePoints(input) { + const codepoints = []; + const size = input.length; + for (let i = 0; i < size; i += 1) { + const before = input.charCodeAt(i); + if (before >= 0xd800 && before <= 0xdbff && size > i + 1) { + const next = input.charCodeAt(i + 1); + if (next >= 0xdc00 && next <= 0xdfff) { + codepoints.push((before - 0xd800) * 0x400 + next - 0xdc00 + 0x10000); + i += 1; + continue; + } + } + codepoints.push(before); + } + return codepoints; +} +function saslprep({ unassigned_code_points, commonly_mapped_to_nothing, non_ASCII_space_characters, prohibited_characters, bidirectional_r_al, bidirectional_l, }, input, opts = {}) { + const mapping2space = non_ASCII_space_characters; + const mapping2nothing = commonly_mapped_to_nothing; + if (typeof input !== 'string') { + throw new TypeError('Expected string.'); + } + if (input.length === 0) { + return ''; + } + const mapped_input = toCodePoints(input) + .map((character) => (mapping2space.get(character) ? 0x20 : character)) + .filter((character) => !mapping2nothing.get(character)); + const normalized_input = String.fromCodePoint + .apply(null, mapped_input) + .normalize('NFKC'); + const normalized_map = toCodePoints(normalized_input); + const hasProhibited = normalized_map.some((character) => prohibited_characters.get(character)); + if (hasProhibited) { + throw new Error('Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3'); + } + if (opts.allowUnassigned !== true) { + const hasUnassigned = normalized_map.some((character) => unassigned_code_points.get(character)); + if (hasUnassigned) { + throw new Error('Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5'); + } + } + const hasBidiRAL = normalized_map.some((character) => bidirectional_r_al.get(character)); + const hasBidiL = normalized_map.some((character) => bidirectional_l.get(character)); + if (hasBidiRAL && hasBidiL) { + throw new Error('String must not contain RandALCat and LCat at the same time,' + + ' see https://tools.ietf.org/html/rfc3454#section-6'); + } + const isFirstBidiRAL = bidirectional_r_al.get(getCodePoint(first(normalized_input))); + const isLastBidiRAL = bidirectional_r_al.get(getCodePoint(last(normalized_input))); + if (hasBidiRAL && !(isFirstBidiRAL && isLastBidiRAL)) { + throw new Error('Bidirectional RandALCat character must be the first and the last' + + ' character of the string, see https://tools.ietf.org/html/rfc3454#section-6'); + } + return normalized_input; +} +saslprep.saslprep = saslprep; +saslprep.default = saslprep; +module.exports = saslprep; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js.map new file mode 100644 index 00000000..e1867eff --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/index.js.map @@ -0,0 +1 @@ +{"version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tC,CAAC;QAEF,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;QACJ,CAAC;IACH,CAAC;IAID,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CACnD,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAClC,CAAC;IAEF,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CACjD,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAC/B,CAAC;IAIF,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,8DAA8D;YAC5D,oDAAoD,CACvD,CAAC;IACJ,CAAC;IAQD,MAAM,cAAc,GAAG,kBAAkB,CAAC,GAAG,CAC3C,YAAY,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAE,CACvC,CAAC;IACF,MAAM,aAAa,GAAG,kBAAkB,CAAC,GAAG,CAC1C,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAE,CACtC,CAAC;IAEF,IAAI,UAAU,IAAI,CAAC,CAAC,cAAc,IAAI,aAAa,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACb,kEAAkE;YAChE,6EAA6E,CAChF,CAAC;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC;AAC5B,iBAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts new file mode 100644 index 00000000..ef457228 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts @@ -0,0 +1,10 @@ +import bitfield from 'sparse-bitfield'; +export declare function createMemoryCodePoints(data: Buffer): { + unassigned_code_points: bitfield.BitFieldInstance; + commonly_mapped_to_nothing: bitfield.BitFieldInstance; + non_ASCII_space_characters: bitfield.BitFieldInstance; + prohibited_characters: bitfield.BitFieldInstance; + bidirectional_r_al: bitfield.BitFieldInstance; + bidirectional_l: bitfield.BitFieldInstance; +}; +//# sourceMappingURL=memory-code-points.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts.map new file mode 100644 index 00000000..18ce0f41 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"memory-code-points.d.ts","sourceRoot":"","sources":["../src/memory-code-points.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM;;;;;;;EA+BlD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js new file mode 100644 index 00000000..2c6ca0fa --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js @@ -0,0 +1,32 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createMemoryCodePoints = createMemoryCodePoints; +const sparse_bitfield_1 = __importDefault(require("sparse-bitfield")); +function createMemoryCodePoints(data) { + let offset = 0; + function read() { + const size = data.readUInt32BE(offset); + offset += 4; + const codepoints = data.slice(offset, offset + size); + offset += size; + return (0, sparse_bitfield_1.default)({ buffer: codepoints }); + } + const unassigned_code_points = read(); + const commonly_mapped_to_nothing = read(); + const non_ASCII_space_characters = read(); + const prohibited_characters = read(); + const bidirectional_r_al = read(); + const bidirectional_l = read(); + return { + unassigned_code_points, + commonly_mapped_to_nothing, + non_ASCII_space_characters, + prohibited_characters, + bidirectional_r_al, + bidirectional_l, + }; +} +//# sourceMappingURL=memory-code-points.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js.map new file mode 100644 index 00000000..208fd5c7 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js.map @@ -0,0 +1 @@ +{"version":3,"file":"memory-code-points.js","sourceRoot":"","sources":["../src/memory-code-points.ts"],"names":[],"mappings":";;;;;AAEA,wDA+BC;AAjCD,sEAAuC;AAEvC,SAAgB,sBAAsB,CAAC,IAAY;IACjD,IAAI,MAAM,GAAG,CAAC,CAAC;IAKf,SAAS,IAAI;QACX,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,CAAC;QAEZ,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;QACrD,MAAM,IAAI,IAAI,CAAC;QAEf,OAAO,IAAA,yBAAQ,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,sBAAsB,GAAG,IAAI,EAAE,CAAC;IACtC,MAAM,0BAA0B,GAAG,IAAI,EAAE,CAAC;IAC1C,MAAM,0BAA0B,GAAG,IAAI,EAAE,CAAC;IAC1C,MAAM,qBAAqB,GAAG,IAAI,EAAE,CAAC;IACrC,MAAM,kBAAkB,GAAG,IAAI,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAI,EAAE,CAAC;IAE/B,OAAO;QACL,sBAAsB;QACtB,0BAA0B;QAC1B,0BAA0B;QAC1B,qBAAqB;QACrB,kBAAkB;QAClB,eAAe;KAChB,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts new file mode 100644 index 00000000..0208c8ed --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts @@ -0,0 +1,10 @@ +declare function saslprep(input: string, opts?: { + allowUnassigned?: boolean; +}): string; +declare namespace saslprep { + export var saslprep: typeof import("./node"); + var _a: typeof import("./node"); + export { _a as default }; +} +export = saslprep; +//# sourceMappingURL=node.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts.map new file mode 100644 index 00000000..3032ff99 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAMA,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAE7E;kBAFQ,QAAQ;;;;;AAOjB,SAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js new file mode 100644 index 00000000..1007f86b --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const index_1 = __importDefault(require("./index")); +const memory_code_points_1 = require("./memory-code-points"); +const code_points_data_1 = __importDefault(require("./code-points-data")); +const codePoints = (0, memory_code_points_1.createMemoryCodePoints)(code_points_data_1.default); +function saslprep(input, opts) { + return (0, index_1.default)(codePoints, input, opts); +} +saslprep.saslprep = saslprep; +saslprep.default = saslprep; +module.exports = saslprep; +//# sourceMappingURL=node.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js.map new file mode 100644 index 00000000..107ee648 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":";;;;AAAA,oDAAgC;AAChC,6DAA8D;AAC9D,0EAAsC;AAEtC,MAAM,UAAU,GAAG,IAAA,2CAAsB,EAAC,0BAAI,CAAC,CAAC;AAEhD,SAAS,QAAQ,CAAC,KAAa,EAAE,IAAoC;IACnE,OAAO,IAAA,eAAS,EAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC;AAE5B,iBAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts new file mode 100644 index 00000000..3a0466ec --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts @@ -0,0 +1,2 @@ +export declare function range(from: number, to: number): number[]; +//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts.map new file mode 100644 index 00000000..50c71678 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAGA,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAQxD"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js new file mode 100644 index 00000000..6db330a0 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.range = range; +function range(from, to) { + const list = new Array(to - from + 1); + for (let i = 0; i < list.length; i += 1) { + list[i] = from + i; + } + return list; +} +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js.map b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js.map new file mode 100644 index 00000000..f08e43ad --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/dist/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;AAGA,sBAQC;AARD,SAAgB,KAAK,CAAC,IAAY,EAAE,EAAU;IAE5C,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;IAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/package.json b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/package.json new file mode 100644 index 00000000..f2d7c832 --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/package.json @@ -0,0 +1,86 @@ +{ + "name": "@mongodb-js/saslprep", + "description": "SASLprep: Stringprep Profile for User Names and Passwords, rfc4013", + "keywords": [ + "sasl", + "saslprep", + "stringprep", + "rfc4013", + "4013" + ], + "author": "Dmitry Tsvettsikh ", + "publishConfig": { + "access": "public" + }, + "main": "dist/node.js", + "bugs": { + "url": "https://jira.mongodb.org/projects/COMPASS/issues", + "email": "compass@mongodb.com" + }, + "homepage": "https://github.com/mongodb-js/devtools-shared/tree/main/packages/saslprep", + "version": "1.5.4", + "repository": { + "type": "git", + "url": "git+https://github.com/mongodb-js/devtools-shared.git" + }, + "files": [ + "dist" + ], + "license": "MIT", + "exports": { + "browser": { + "types": "./dist/browser.d.ts", + "default": "./dist/browser.js" + }, + "import": { + "types": "./dist/node.d.ts", + "default": "./dist/.esm-wrapper.mjs" + }, + "require": { + "types": "./dist/node.d.ts", + "default": "./dist/node.js" + } + }, + "types": "./dist/node.d.ts", + "scripts": { + "gen-code-points": "ts-node src/generate-code-points.ts src/code-points-data.ts src/code-points-data-browser.ts", + "bootstrap": "npm run compile", + "prepublishOnly": "npm run compile", + "compile": "npm run gen-code-points && 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 ." + }, + "dependencies": { + "sparse-bitfield": "^3.0.3" + }, + "devDependencies": { + "@mongodb-js/eslint-config-devtools": "^0.11.12", + "@mongodb-js/mocha-config-devtools": "^2.0.1", + "@mongodb-js/prettier-config-devtools": "^1.0.6", + "@mongodb-js/tsconfig-devtools": "^1.1.5", + "@types/chai": "^4.2.21", + "@types/mocha": "^9.1.1", + "@types/node": "^25.5.2", + "@types/sparse-bitfield": "^3.0.4", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0 || ^8.0.0", + "gen-esm-wrapper": "^1.1.3", + "mocha": "^8.4.0", + "nyc": "^15.1.0", + "prettier": "^3.8.1", + "sinon": "^9.2.3", + "typescript": "^5.9.3" + }, + "gitHead": "5a61a7fd560606c09c4a79292bc757d466a79857" +} diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/readme.md b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/readme.md new file mode 100644 index 00000000..28539eda --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep/readme.md @@ -0,0 +1,29 @@ +# saslprep + +_Note: This is a fork of the original [`saslprep`](https://www.npmjs.com/package/saslprep) npm package +and provides equivalent functionality._ + +Stringprep Profile for User Names and Passwords, [rfc4013](https://tools.ietf.org/html/rfc4013) + +### Usage + +```js +const saslprep = require('@mongodb-js/saslprep'); + +saslprep('password\u00AD'); // password +saslprep('password\u0007'); // Error: prohibited character +``` + +### API + +##### `saslprep(input: String, opts: Options): String` + +Normalize user name or password. + +##### `Options.allowUnassigned: bool` + +A special behavior for unassigned code points, see https://tools.ietf.org/html/rfc4013#section-2.5. Disabled by default. + +## License + +MIT, 2017-2019 (c) Dmitriy Tsvettsikh diff --git a/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/sparse-bitfield b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/sparse-bitfield new file mode 120000 index 00000000..31803add --- /dev/null +++ b/backend/node_modules/.pnpm/@mongodb-js+saslprep@1.5.4/node_modules/sparse-bitfield @@ -0,0 +1 @@ +../../sparse-bitfield@3.0.3/node_modules/sparse-bitfield \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/LICENSE b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/README.md b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/README.md new file mode 100644 index 00000000..72270960 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/README.md @@ -0,0 +1,13 @@ +@protobufjs/aspromise +===================== +[![npm](https://img.shields.io/npm/v/@protobufjs/aspromise.svg)](https://www.npmjs.com/package/@protobufjs/aspromise) + +Returns a promise from a node-style callback function. + +API +--- + +* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**
+ Returns a promise from a node-style callback function. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.d.ts new file mode 100644 index 00000000..afbd89ac --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.d.ts @@ -0,0 +1,13 @@ +export = asPromise; + +type asPromiseCallback = (error: Error | null, ...params: any[]) => {}; + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +declare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise; diff --git a/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js new file mode 100644 index 00000000..b10f8267 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js @@ -0,0 +1,52 @@ +"use strict"; +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} diff --git a/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/package.json b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/package.json new file mode 100644 index 00000000..2d7e503f --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/package.json @@ -0,0 +1,21 @@ +{ + "name": "@protobufjs/aspromise", + "description": "Returns a promise from a node-style callback function.", + "version": "1.1.2", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/tests/index.js new file mode 100644 index 00000000..6d8d24c1 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/tests/index.js @@ -0,0 +1,130 @@ +var tape = require("tape"); + +var asPromise = require(".."); + +tape.test("aspromise", function(test) { + + test.test(this.name + " - resolve", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(null, arg2); + } + + var ctx = {}; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function(arg2) { + test.equal(arg2, 2, "promise should be resolved with arg2 = 2"); + test.end(); + }).catch(function(err) { + test.fail("promise should not be rejected (" + err + ")"); + }); + }); + + test.test(this.name + " - reject", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(arg1); + } + + var ctx = {}; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 1, "promise should be rejected with err = 1"); + test.end(); + }); + }); + + test.test(this.name + " - resolve twice", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(null, arg2); + callback(null, arg1); + } + + var ctx = {}; + var count = 0; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function(arg2) { + test.equal(arg2, 2, "promise should be resolved with arg2 = 2"); + if (++count > 1) + test.fail("promise should not be resolved twice"); + test.end(); + }).catch(function(err) { + test.fail("promise should not be rejected (" + err + ")"); + }); + }); + + test.test(this.name + " - reject twice", function(test) { + + function fn(arg1, arg2, callback) { + test.equal(this, ctx, "function should be called with this = ctx"); + test.equal(arg1, 1, "function should be called with arg1 = 1"); + test.equal(arg2, 2, "function should be called with arg2 = 2"); + callback(arg1); + callback(arg2); + } + + var ctx = {}; + var count = 0; + + var promise = asPromise(fn, ctx, 1, 2); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 1, "promise should be rejected with err = 1"); + if (++count > 1) + test.fail("promise should not be rejected twice"); + test.end(); + }); + }); + + test.test(this.name + " - reject error", function(test) { + + function fn(callback) { + test.ok(arguments.length === 1 && typeof callback === "function", "function should be called with just a callback"); + throw 3; + } + + var promise = asPromise(fn, null); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 3, "promise should be rejected with err = 3"); + test.end(); + }); + }); + + test.test(this.name + " - reject and error", function(test) { + + function fn(callback) { + callback(3); + throw 4; + } + + var count = 0; + + var promise = asPromise(fn, null); + promise.then(function() { + test.fail("promise should not be resolved"); + }).catch(function(err) { + test.equal(err, 3, "promise should be rejected with err = 3"); + if (++count > 1) + test.fail("promise should not be rejected twice"); + test.end(); + }); + }); +}); diff --git a/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/LICENSE b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/README.md b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/README.md new file mode 100644 index 00000000..0e2eb33f --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/README.md @@ -0,0 +1,19 @@ +@protobufjs/base64 +================== +[![npm](https://img.shields.io/npm/v/@protobufjs/base64.svg)](https://www.npmjs.com/package/@protobufjs/base64) + +A minimal base64 implementation for number arrays. + +API +--- + +* **base64.length(string: `string`): `number`**
+ Calculates the byte length of a base64 encoded string. + +* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**
+ Encodes a buffer to a base64 encoded string. + +* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**
+ Decodes a base64 encoded string to a buffer. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.d.ts new file mode 100644 index 00000000..16fd7db7 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.d.ts @@ -0,0 +1,32 @@ +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +export function length(string: string): number; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +export function encode(buffer: Uint8Array, start: number, end: number): string; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +export function decode(string: string, buffer: Uint8Array, offset: number): number; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if it appears to be base64 encoded, otherwise false + */ +export function test(string: string): boolean; diff --git a/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js new file mode 100644 index 00000000..26d54433 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js @@ -0,0 +1,139 @@ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; diff --git a/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/package.json b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/package.json new file mode 100644 index 00000000..46e71d41 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/package.json @@ -0,0 +1,21 @@ +{ + "name": "@protobufjs/base64", + "description": "A minimal base64 implementation for number arrays.", + "version": "1.1.2", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/tests/index.js new file mode 100644 index 00000000..89828f2b --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/tests/index.js @@ -0,0 +1,46 @@ +var tape = require("tape"); + +var base64 = require(".."); + +var strings = { + "": "", + "a": "YQ==", + "ab": "YWI=", + "abcdefg": "YWJjZGVmZw==", + "abcdefgh": "YWJjZGVmZ2g=", + "abcdefghi": "YWJjZGVmZ2hp" +}; + +tape.test("base64", function(test) { + + Object.keys(strings).forEach(function(str) { + var enc = strings[str]; + + test.equal(base64.test(enc), true, "should detect '" + enc + "' to be base64 encoded"); + + var len = base64.length(enc); + test.equal(len, str.length, "should calculate '" + enc + "' as " + str.length + " bytes"); + + var buf = new Array(len); + var len2 = base64.decode(enc, buf, 0); + test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes"); + + test.equal(String.fromCharCode.apply(String, buf), str, "should decode '" + enc + "' to '" + str + "'"); + + var enc2 = base64.encode(buf, 0, buf.length); + test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'"); + + }); + + test.throws(function() { + var buf = new Array(10); + base64.decode("YQ!", buf, 0); + }, Error, "should throw if encoding is invalid"); + + test.throws(function() { + var buf = new Array(10); + base64.decode("Y", buf, 0); + }, Error, "should throw if string is truncated"); + + test.end(); +}); diff --git a/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/LICENSE b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/README.md b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/README.md new file mode 100644 index 00000000..01693386 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/README.md @@ -0,0 +1,49 @@ +@protobufjs/codegen +=================== +[![npm](https://img.shields.io/npm/v/@protobufjs/codegen.svg)](https://www.npmjs.com/package/@protobufjs/codegen) + +A minimalistic code generation utility. + +API +--- + +* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**
+ Begins generating a function. + +* **codegen.verbose = `false`**
+ When set to true, codegen will log generated code to console. Useful for debugging. + +Invoking **codegen** returns an appender function that appends code to the function's body and returns itself: + +* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**
+ Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters: + + * `%d`: Number (integer or floating point value) + * `%f`: Floating point value + * `%i`: Integer value + * `%j`: JSON.stringify'ed value + * `%s`: String value + * `%%`: Percent sign
+ +* **Codegen([scope: `Object.`]): `Function`**
+ Finishes the function and returns it. + +* **Codegen.toString([functionNameOverride: `string`]): `string`**
+ Returns the function as a string. + +Example +------- + +```js +var codegen = require("@protobufjs/codegen"); + +var add = codegen(["a", "b"], "add") // A function with parameters "a" and "b" named "add" + ("// awesome comment") // adds the line to the function's body + ("return a + b - c + %d", 1) // replaces %d with 1 and adds the line to the body + ({ c: 1 }); // adds "c" with a value of 1 to the function's scope + +console.log(add.toString()); // function add(a, b) { return a + b - c + 1 } +console.log(add(1, 2)); // calculates 1 + 2 - 1 + 1 = 3 +``` + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.d.ts new file mode 100644 index 00000000..f7fb921d --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.d.ts @@ -0,0 +1,31 @@ +export = codegen; + +/** + * Appends code to the function's body. + * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param [formatParams] Format parameters + * @returns Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ +type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function); + +/** + * Begins generating a function. + * @param functionParams Function parameter names + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ +declare function codegen(functionParams: string[], functionName?: string): Codegen; + +/** + * Begins generating a function. + * @param [functionName] Function name if not anonymous + * @returns Appender that appends code to the function's body + */ +declare function codegen(functionName?: string): Codegen; + +declare namespace codegen { + + /** When set to `true`, codegen will log generated code to console. Useful for debugging. */ + let verbose: boolean; +} diff --git a/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.js b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.js new file mode 100644 index 00000000..1ad15677 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/index.js @@ -0,0 +1,112 @@ +"use strict"; +module.exports = codegen; + +var reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + safeFunctionName(functionNameOverride || functionName) + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + +function safeFunctionName(name) { + if (!name) + return ""; + name = String(name).replace(/[^\w$]/g, ""); + if (!name) + return ""; + if (/^\d/.test(name)) + name = "_" + name; + return reservedRe.test(name) ? name + "_" : name; +} diff --git a/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/package.json b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/package.json new file mode 100644 index 00000000..8eed9ddc --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/package.json @@ -0,0 +1,13 @@ +{ + "name": "@protobufjs/codegen", + "description": "A minimalistic code generation utility.", + "version": "2.0.5", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts" +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/tests/index.js new file mode 100644 index 00000000..f3a3db11 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen/tests/index.js @@ -0,0 +1,13 @@ +var codegen = require(".."); + +// new require("benchmark").Suite().add("add", function() { + +var add = codegen(["a", "b"], "add") + ("// awesome comment") + ("return a + b - c + %d", 1) + ({ c: 1 }); + +if (add(1, 2) !== 3) + throw Error("failed"); + +// }).on("cycle", function(event) { process.stdout.write(String(event.target) + "\n"); }).run(); diff --git a/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/CHANGELOG.md b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/CHANGELOG.md new file mode 100644 index 00000000..fd2801fb --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## [1.1.1](https://github.com/protobufjs/protobuf.js/compare/eventemitter-v1.1.0...eventemitter-v1.1.1) (2026-05-22) + + +### Bug Fixes + +* Backport misc utility hardening ([#2280](https://github.com/protobufjs/protobuf.js/issues/2280)) ([8a45c13](https://github.com/protobufjs/protobuf.js/commit/8a45c13d22ec2d05ab1b7935fcb5331ea59a9cd0)) diff --git a/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/LICENSE b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/README.md b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/README.md new file mode 100644 index 00000000..998d3151 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/README.md @@ -0,0 +1,22 @@ +@protobufjs/eventemitter +======================== +[![npm](https://img.shields.io/npm/v/@protobufjs/eventemitter.svg)](https://www.npmjs.com/package/@protobufjs/eventemitter) + +A minimal event emitter. + +API +--- + +* **new EventEmitter()**
+ Constructs a new event emitter instance. + +* **EventEmitter#on(evt: `string`, fn: `function`, [ctx: `Object`]): `EventEmitter`**
+ Registers an event listener. + +* **EventEmitter#off([evt: `string`], [fn: `function`]): `EventEmitter`**
+ Removes an event listener or any matching listeners if arguments are omitted. + +* **EventEmitter#emit(evt: `string`, ...args: `*`): `EventEmitter`**
+ Emits an event by calling its listeners with the specified arguments. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.d.ts new file mode 100644 index 00000000..ba47e078 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.d.ts @@ -0,0 +1,45 @@ +export = EventEmitter; + +type EventEmitterListener = (...args: any[]) => {}; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +declare class EventEmitter { + + /** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ + constructor(); + + /** + * Registers an event listener. + * @param {string} evt Event name + * @param {EventEmitterListener} fn Listener + * @param {*} [ctx] Listener context + * @returns {this} `this` + */ + public on(evt: string, fn: EventEmitterListener, ctx?: any): EventEmitter; + + /** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {this} `this` + */ + public off(evt?: string, fn?: EventEmitterListener): EventEmitter; + + /** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {this} `this` + */ + public emit(evt: string, ...args: any[]): EventEmitter; +} diff --git a/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.js b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.js new file mode 100644 index 00000000..68368319 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.js @@ -0,0 +1,86 @@ +"use strict"; +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = Object.create(null); +} + +/** + * Event listener as used by {@link util.EventEmitter}. + * @typedef EventEmitterListener + * @type {function} + * @param {...*} args Arguments + * @returns {undefined} + */ + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {EventEmitterListener} fn Listener + * @param {*} [ctx] Listener context + * @returns {this} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {this} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = Object.create(null); + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + if (!listeners) + return this; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {this} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; diff --git a/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/package.json b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/package.json new file mode 100644 index 00000000..84bfaceb --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/package.json @@ -0,0 +1,21 @@ +{ + "name": "@protobufjs/eventemitter", + "description": "A minimal event emitter.", + "version": "1.1.1", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^5.0.0" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/tests/index.js new file mode 100644 index 00000000..4ed11391 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/tests/index.js @@ -0,0 +1,83 @@ +var tape = require("tape"); + +var EventEmitter = require(".."); + +tape.test("eventemitter", function(test) { + + var ee = new EventEmitter(); + var fn; + var ctx = {}; + + test.equal(Object.getPrototypeOf(ee._listeners), null, "should not inherit listener lookup keys"); + + test.doesNotThrow(function() { + ee.emit("a", 1); + ee.off(); + ee.off("a"); + ee.off("a", function() {}); + }, "should not throw if no listeners are registered"); + + test.equal(ee.on("a", function(arg1) { + test.equal(this, ctx, "should be called with this = ctx"); + test.equal(arg1, 1, "should be called with arg1 = 1"); + }, ctx), ee, "should return itself when registering events"); + ee.emit("a", 1); + + ee.off("a"); + test.same(Object.keys(ee._listeners), [ "a" ], "should keep the event key when calling off(evt)"); + test.same(ee._listeners.a, [], "should remove all listeners of the respective event when calling off(evt)"); + + ee.off(); + test.equal(Object.getPrototypeOf(ee._listeners), null, "should keep the listener table isolated when just calling off()"); + test.same(Object.keys(ee._listeners), [], "should remove all listeners when just calling off()"); + + ee.on("a", fn = function(arg1) { + test.equal(this, ctx, "should be called with this = ctx"); + test.equal(arg1, 1, "should be called with arg1 = 1"); + }, ctx).emit("a", 1); + + ee.off("a", fn); + test.same(Object.keys(ee._listeners), [ "a" ], "should keep the event key when calling off(evt, fn)"); + test.same(ee._listeners.a, [], "should remove the exact listener when calling off(evt, fn)"); + + ee.on("a", function() { + test.equal(this, ee, "should be called with this = ee"); + }).emit("a"); + + test.doesNotThrow(function() { + ee.off("a", fn); + }, "should not throw if no such listener is found"); + + test.test(test.name + " - special event names", function(test) { + var ee = new EventEmitter(); + var calls = 0; + + test.doesNotThrow(function() { + ee.off("__proto__", function() {}); + }, "should not throw when removing an absent special event listener"); + + ee.on("__proto__", function(arg) { + ++calls; + test.equal(arg, 1, "should pass arguments for __proto__ events"); + }); + ee.on("constructor", function(arg) { + ++calls; + test.equal(arg, 2, "should pass arguments for constructor events"); + }); + ee.emit("__proto__", 1); + ee.emit("constructor", 2); + + test.equal(calls, 2, "should dispatch special event names"); + test.equal(Object.getPrototypeOf(ee._listeners), null, "should keep the listener table isolated"); + test.ok(Object.prototype.hasOwnProperty.call(ee._listeners, "__proto__"), "should store __proto__ as an own event key"); + test.ok(Object.prototype.hasOwnProperty.call(ee._listeners, "constructor"), "should store constructor as an own event key"); + + ee.off("__proto__"); + ee.off("constructor"); + test.same(ee._listeners.__proto__, [], "should clear __proto__ listeners"); + test.same(ee._listeners.constructor, [], "should clear constructor listeners"); + test.end(); + }); + + test.end(); +}); diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/aspromise b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/aspromise new file mode 120000 index 00000000..b4e9aab1 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/aspromise @@ -0,0 +1 @@ +../../../@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/CHANGELOG.md b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/CHANGELOG.md new file mode 100644 index 00000000..63ff0228 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## [1.1.1](https://github.com/protobufjs/protobuf.js/compare/fetch-v1.1.0...fetch-v1.1.1) (2026-05-17) + + +### Bug Fixes + +* Backport bundler-safe optional module lookups ([#2254](https://github.com/protobufjs/protobuf.js/issues/2254)) ([0853a62](https://github.com/protobufjs/protobuf.js/commit/0853a625680f9247596b84ef48082b8f4e554797)) diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/LICENSE b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/README.md b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/README.md new file mode 100644 index 00000000..11088a0b --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/README.md @@ -0,0 +1,13 @@ +@protobufjs/fetch +================= +[![npm](https://img.shields.io/npm/v/@protobufjs/fetch.svg)](https://www.npmjs.com/package/@protobufjs/fetch) + +Fetches the contents of a file accross node and browsers. + +API +--- + +* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise|undefined`** + Fetches the contents of a file. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.d.ts new file mode 100644 index 00000000..950b8027 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.d.ts @@ -0,0 +1,56 @@ +export = fetch; + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ +type FetchCallback = (error: Error, contents?: string) => void; + +/** + * Options as used by {@link util.fetch}. + * @typedef IFetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +interface IFetchOptions { + binary?: boolean; + xhr?: boolean; +} + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {IFetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +declare function fetch(filename: string, options: IFetchOptions, callback: FetchCallback): void; + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ +declare function fetch(path: string, callback: FetchCallback): void; + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {IFetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ +declare function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>; diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.js b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.js new file mode 100644 index 00000000..448f354a --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/index.js @@ -0,0 +1,112 @@ +"use strict"; +module.exports = fetch; + +var asPromise = require("@protobufjs/aspromise"), + fs = require("./util/fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @interface IFetchOptions + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {IFetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {IFetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/package.json b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/package.json new file mode 100644 index 00000000..e9b677e0 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/package.json @@ -0,0 +1,27 @@ +{ + "name": "@protobufjs/fetch", + "description": "Fetches the contents of a file accross node and browsers.", + "version": "1.1.1", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "browser": { + "fs": false + }, + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^5.0.0" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/data/file.txt b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/data/file.txt new file mode 100644 index 00000000..4c330738 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/data/file.txt @@ -0,0 +1 @@ +file.txt \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/index.js new file mode 100644 index 00000000..49c6e897 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/tests/index.js @@ -0,0 +1,158 @@ +var tape = require("tape"); + +var fetch = require(".."); + +tape.test("fetch", function(test) { + + if (typeof Promise !== "undefined") + test.test(test.name + " - promise", function(test) { + var promise = fetch("NOTFOUND"); + test.plan(2); + test.ok(promise instanceof Promise, "should return a promise if callback has been omitted"); + promise + .then(function() { + test.fail("should not resolve"); + }) + .catch(function(err) { + test.ok(err, "should reject with an error"); + }); + }); + + test.test(test.name + " - node fs", function(test) { + + test.test(test.name + " - string", function(test) { + test.plan(2); + fetch(require.resolve("./data/file.txt"), function(err, contents) { + test.notOk(err, "should not return an error"); + test.equal(contents, "file.txt", "should return contents as a string"); + }); + }); + + test.test(test.name + " - binary", function(test) { + test.plan(2); + fetch(require.resolve("./data/file.txt"), { binary: true }, function(err, contents) { + test.notOk(err, "should not return an error"); + test.same(contents, new Buffer("file.txt", "utf8"), "should return contents as a Buffer"); + }); + }); + + test.test(test.name + " - fallback", function(test) { + test.plan(2); + global.XMLHttpRequest = fakeXHR(0); + fetch("file.txt", function(err, contents) { + delete global.XMLHttpRequest; + test.notOk(err, "should not return an error"); + test.same(contents, "file.txt", "should return contents as a string"); + }); + }); + + test.end(); + }); + + test.test(test.name + " - XMLHttpRequest", function(test) { + + test.test(test.name + " - 404", function(test) { + global.XMLHttpRequest = fakeXHR(404); + fetch("file.txt", { xhr: true }, function(err) { + delete global.XMLHttpRequest; + test.ok(err, "should return an error"); + test.end(); + }); + }); + + test.test(test.name + " - string", function(test) { + global.XMLHttpRequest = fakeXHR(0); + test.plan(2); + fetch("file.txt", { xhr: true }, function(err, contents) { + delete global.XMLHttpRequest; + test.notOk(err, "should not return an error"); + test.equal(contents, "file.txt", "should return contents as a string"); + }); + }); + + test.test(test.name + " - binary", function(test) { + global.XMLHttpRequest = fakeXHR(200); + test.plan(2); + fetch("file.txt", { xhr: true, binary: true }, function(err, contents) { + delete global.XMLHttpRequest; + test.notOk(err, "should not return an error"); + test.same(contents, new Uint8Array([0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74]), "should return contents as an Uint8Array"); + }); + }); + + }); + + test.test(test.name + " - XMLHttpRequest (ancient)", function(test) { + + test.test(test.name + " - string", function(test) { + global.XMLHttpRequest = fakeXHR(0, true); + test.plan(2); + fetch("file.txt", { xhr: true }, function(err, contents) { + delete global.XMLHttpRequest; + test.notOk(err, "should not return an error"); + test.equal(contents, "file.txt", "should return contents as a string"); + }); + }); + + test.test(test.name + " - binary", function(test) { + global.XMLHttpRequest = fakeXHR(200, true); + var U8 = global.Uint8Array; + delete global.Uint8Array; + test.plan(2); + fetch("file.txt", { xhr: true, binary: true }, function(err, contents) { + delete global.XMLHttpRequest; + global.Uint8Array = U8; + test.notOk(err, "should not return an error"); + test.same(contents, [0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74], "should return contents as an Array"); + }); + }); + + }); + +}); + +function fakeXHR(status, ancient) { + + var UNSENT = 0, + OPENED = 1, + HEADERS_RECEIVED = 2, + LOADING = 3, + DONE = 4; + + function XMLHttpRequest() { + this.status = 0; + this.readyState = UNSENT; + } + if (!ancient) + XMLHttpRequest.prototype.overrideMimeType = function(mimeType) { + this._mimeType = mimeType; + }; + XMLHttpRequest.prototype.open = function open(method, path) { + this._method = method; + this._path = path; + this.readyState = OPENED; + }; + XMLHttpRequest.prototype.send = function send() { + var self = this; + setTimeout(function() { + self.onreadystatechange(); // opened + self.readyState = HEADERS_RECEIVED; + self.onreadystatechange(); + self.readyState = LOADING; + self.onreadystatechange(); + self.readyState = DONE; + self.status = status; + if (self.responseType === "arraybuffer" && !ancient) { + var buf = new Buffer(self._path, "utf8"); + var abuf = new ArrayBuffer(buf.length); + var view = new Uint8Array(abuf); + for (var i = 0; i < buf.length; ++i) + view[i] = buf[i]; + self.response = abuf; + } else + self.responseText = self._path; + self.onreadystatechange(); + }); + }; + return XMLHttpRequest; +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/util/fs.js b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/util/fs.js new file mode 100644 index 00000000..f54344fe --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch/util/fs.js @@ -0,0 +1,11 @@ +"use strict"; + +var fs = null; +try { + fs = require(/* webpackIgnore: true */ "fs"); + if (!fs || !fs.readFile || !fs.readFileSync) + fs = null; +} catch (e) { + // `fs` is unavailable in browsers and browser-like bundles. +} +module.exports = fs; diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/LICENSE b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/README.md b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/README.md new file mode 100644 index 00000000..8947baea --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/README.md @@ -0,0 +1,102 @@ +@protobufjs/float +================= +[![npm](https://img.shields.io/npm/v/@protobufjs/float.svg)](https://www.npmjs.com/package/@protobufjs/float) + +Reads / writes floats / doubles from / to buffers in both modern and ancient browsers. Fast. + +API +--- + +* **writeFloatLE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 32 bit float to a buffer using little endian byte order. + +* **writeFloatBE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 32 bit float to a buffer using big endian byte order. + +* **readFloatLE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 32 bit float from a buffer using little endian byte order. + +* **readFloatBE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 32 bit float from a buffer using big endian byte order. + +* **writeDoubleLE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 64 bit double to a buffer using little endian byte order. + +* **writeDoubleBE(val: `number`, buf: `Uint8Array`, pos: `number`)**
+ Writes a 64 bit double to a buffer using big endian byte order. + +* **readDoubleLE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 64 bit double from a buffer using little endian byte order. + +* **readDoubleBE(buf: `Uint8Array`, pos: `number`): `number`**
+ Reads a 64 bit double from a buffer using big endian byte order. + +Performance +----------- +There is a simple benchmark included comparing raw read/write performance of this library (float), float's fallback for old browsers, the [ieee754](https://www.npmjs.com/package/ieee754) module and node's [buffer](https://nodejs.org/api/buffer.html). On an i7-2600k running node 6.9.1 it yields: + +``` +benchmarking writeFloat performance ... + +float x 42,741,625 ops/sec ±1.75% (81 runs sampled) +float (fallback) x 11,272,532 ops/sec ±1.12% (85 runs sampled) +ieee754 x 8,653,337 ops/sec ±1.18% (84 runs sampled) +buffer x 12,412,414 ops/sec ±1.41% (83 runs sampled) +buffer (noAssert) x 13,471,149 ops/sec ±1.09% (84 runs sampled) + + float was fastest + float (fallback) was 73.5% slower + ieee754 was 79.6% slower + buffer was 70.9% slower + buffer (noAssert) was 68.3% slower + +benchmarking readFloat performance ... + +float x 44,382,729 ops/sec ±1.70% (84 runs sampled) +float (fallback) x 20,925,938 ops/sec ±0.86% (87 runs sampled) +ieee754 x 17,189,009 ops/sec ±1.01% (87 runs sampled) +buffer x 10,518,437 ops/sec ±1.04% (83 runs sampled) +buffer (noAssert) x 11,031,636 ops/sec ±1.15% (87 runs sampled) + + float was fastest + float (fallback) was 52.5% slower + ieee754 was 61.0% slower + buffer was 76.1% slower + buffer (noAssert) was 75.0% slower + +benchmarking writeDouble performance ... + +float x 38,624,906 ops/sec ±0.93% (83 runs sampled) +float (fallback) x 10,457,811 ops/sec ±1.54% (85 runs sampled) +ieee754 x 7,681,130 ops/sec ±1.11% (83 runs sampled) +buffer x 12,657,876 ops/sec ±1.03% (83 runs sampled) +buffer (noAssert) x 13,372,795 ops/sec ±0.84% (85 runs sampled) + + float was fastest + float (fallback) was 73.1% slower + ieee754 was 80.1% slower + buffer was 67.3% slower + buffer (noAssert) was 65.3% slower + +benchmarking readDouble performance ... + +float x 40,527,888 ops/sec ±1.05% (84 runs sampled) +float (fallback) x 18,696,480 ops/sec ±0.84% (86 runs sampled) +ieee754 x 14,074,028 ops/sec ±1.04% (87 runs sampled) +buffer x 10,092,367 ops/sec ±1.15% (84 runs sampled) +buffer (noAssert) x 10,623,793 ops/sec ±0.96% (84 runs sampled) + + float was fastest + float (fallback) was 53.8% slower + ieee754 was 65.3% slower + buffer was 75.1% slower + buffer (noAssert) was 73.8% slower +``` + +To run it yourself: + +``` +$> npm run bench +``` + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/index.js b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/index.js new file mode 100644 index 00000000..1b3c4b8a --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/index.js @@ -0,0 +1,87 @@ +"use strict"; + +var float = require(".."), + ieee754 = require("ieee754"), + newSuite = require("./suite"); + +var F32 = Float32Array; +var F64 = Float64Array; +delete global.Float32Array; +delete global.Float64Array; +var floatFallback = float({}); +global.Float32Array = F32; +global.Float64Array = F64; + +var buf = new Buffer(8); + +newSuite("writeFloat") +.add("float", function() { + float.writeFloatLE(0.1, buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.writeFloatLE(0.1, buf, 0); +}) +.add("ieee754", function() { + ieee754.write(buf, 0.1, 0, true, 23, 4); +}) +.add("buffer", function() { + buf.writeFloatLE(0.1, 0); +}) +.add("buffer (noAssert)", function() { + buf.writeFloatLE(0.1, 0, true); +}) +.run(); + +newSuite("readFloat") +.add("float", function() { + float.readFloatLE(buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.readFloatLE(buf, 0); +}) +.add("ieee754", function() { + ieee754.read(buf, 0, true, 23, 4); +}) +.add("buffer", function() { + buf.readFloatLE(0); +}) +.add("buffer (noAssert)", function() { + buf.readFloatLE(0, true); +}) +.run(); + +newSuite("writeDouble") +.add("float", function() { + float.writeDoubleLE(0.1, buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.writeDoubleLE(0.1, buf, 0); +}) +.add("ieee754", function() { + ieee754.write(buf, 0.1, 0, true, 52, 8); +}) +.add("buffer", function() { + buf.writeDoubleLE(0.1, 0); +}) +.add("buffer (noAssert)", function() { + buf.writeDoubleLE(0.1, 0, true); +}) +.run(); + +newSuite("readDouble") +.add("float", function() { + float.readDoubleLE(buf, 0); +}) +.add("float (fallback)", function() { + floatFallback.readDoubleLE(buf, 0); +}) +.add("ieee754", function() { + ieee754.read(buf, 0, true, 52, 8); +}) +.add("buffer", function() { + buf.readDoubleLE(0); +}) +.add("buffer (noAssert)", function() { + buf.readDoubleLE(0, true); +}) +.run(); diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/suite.js b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/suite.js new file mode 100644 index 00000000..38205795 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/bench/suite.js @@ -0,0 +1,46 @@ +"use strict"; +module.exports = newSuite; + +var benchmark = require("benchmark"), + chalk = require("chalk"); + +var padSize = 27; + +function newSuite(name) { + var benches = []; + return new benchmark.Suite(name) + .on("add", function(event) { + benches.push(event.target); + }) + .on("start", function() { + process.stdout.write("benchmarking " + name + " performance ...\n\n"); + }) + .on("cycle", function(event) { + process.stdout.write(String(event.target) + "\n"); + }) + .on("complete", function() { + if (benches.length > 1) { + var fastest = this.filter("fastest"), // eslint-disable-line no-invalid-this + fastestHz = getHz(fastest[0]); + process.stdout.write("\n" + chalk.white(pad(fastest[0].name, padSize)) + " was " + chalk.green("fastest") + "\n"); + benches.forEach(function(bench) { + if (fastest.indexOf(bench) === 0) + return; + var hz = hz = getHz(bench); + var percent = (1 - hz / fastestHz) * 100; + process.stdout.write(chalk.white(pad(bench.name, padSize)) + " was " + chalk.red(percent.toFixed(1) + "% slower") + "\n"); + }); + } + process.stdout.write("\n"); + }); +} + +function getHz(bench) { + return 1 / (bench.stats.mean + bench.stats.moe); +} + +function pad(str, len, l) { + while (str.length < len) + str = l ? str + " " : " " + str; + return str; +} diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.d.ts new file mode 100644 index 00000000..ab05de36 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.d.ts @@ -0,0 +1,83 @@ +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeFloatLE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeFloatBE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readFloatLE(buf: Uint8Array, pos: number): number; + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readFloatBE(buf: Uint8Array, pos: number): number; + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ +export function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void; + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readDoubleLE(buf: Uint8Array, pos: number): number; + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +export function readDoubleBE(buf: Uint8Array, pos: number): number; diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js new file mode 100644 index 00000000..706d0963 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js @@ -0,0 +1,335 @@ +"use strict"; + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/package.json b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/package.json new file mode 100644 index 00000000..b3072f19 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/package.json @@ -0,0 +1,26 @@ +{ + "name": "@protobufjs/float", + "description": "Reads / writes floats / doubles from / to buffers in both modern and ancient browsers.", + "version": "1.0.2", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "dependencies": {}, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "benchmark": "^2.1.4", + "chalk": "^1.1.3", + "ieee754": "^1.1.8", + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js", + "bench": "node bench" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/tests/index.js new file mode 100644 index 00000000..324e85c0 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/tests/index.js @@ -0,0 +1,100 @@ +var tape = require("tape"); + +var float = require(".."); + +tape.test("float", function(test) { + + // default + test.test(test.name + " - typed array", function(test) { + runTest(float, test); + }); + + // ieee754 + test.test(test.name + " - fallback", function(test) { + var F32 = global.Float32Array, + F64 = global.Float64Array; + delete global.Float32Array; + delete global.Float64Array; + runTest(float({}), test); + global.Float32Array = F32; + global.Float64Array = F64; + }); +}); + +function runTest(float, test) { + + var common = [ + 0, + -0, + Infinity, + -Infinity, + 0.125, + 1024.5, + -4096.5, + NaN + ]; + + test.test(test.name + " - using 32 bits", function(test) { + common.concat([ + 3.4028234663852886e+38, + 1.1754943508222875e-38, + 1.1754946310819804e-39 + ]) + .forEach(function(value) { + var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); + test.ok( + checkValue(value, 4, float.readFloatLE, float.writeFloatLE, Buffer.prototype.writeFloatLE), + "should write and read back " + strval + " (32 bit LE)" + ); + test.ok( + checkValue(value, 4, float.readFloatBE, float.writeFloatBE, Buffer.prototype.writeFloatBE), + "should write and read back " + strval + " (32 bit BE)" + ); + }); + test.end(); + }); + + test.test(test.name + " - using 64 bits", function(test) { + common.concat([ + 1.7976931348623157e+308, + 2.2250738585072014e-308, + 2.2250738585072014e-309 + ]) + .forEach(function(value) { + var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); + test.ok( + checkValue(value, 8, float.readDoubleLE, float.writeDoubleLE, Buffer.prototype.writeDoubleLE), + "should write and read back " + strval + " (64 bit LE)" + ); + test.ok( + checkValue(value, 8, float.readDoubleBE, float.writeDoubleBE, Buffer.prototype.writeDoubleBE), + "should write and read back " + strval + " (64 bit BE)" + ); + }); + test.end(); + }); + + test.end(); +} + +function checkValue(value, size, read, write, write_comp) { + var buffer = new Buffer(size); + write(value, buffer, 0); + var value_comp = read(buffer, 0); + var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString(); + if (value !== value) { + if (value_comp === value_comp) + return false; + } else if (value_comp !== value) + return false; + + var buffer_comp = new Buffer(size); + write_comp.call(buffer_comp, value, 0); + for (var i = 0; i < size; ++i) + if (buffer[i] !== buffer_comp[i]) { + console.error(">", buffer, buffer_comp); + return false; + } + + return true; +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/CHANGELOG.md b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/CHANGELOG.md new file mode 100644 index 00000000..5dccf84b --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## [1.1.2](https://github.com/protobufjs/protobuf.js/compare/inquire-v1.1.1...inquire-v1.1.2) (2026-05-17) + + +### Bug Fixes + +* Backport bundler-safe optional module lookups ([#2254](https://github.com/protobufjs/protobuf.js/issues/2254)) ([0853a62](https://github.com/protobufjs/protobuf.js/commit/0853a625680f9247596b84ef48082b8f4e554797)) diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/LICENSE b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/README.md b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/README.md new file mode 100644 index 00000000..22f99684 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/README.md @@ -0,0 +1,13 @@ +@protobufjs/inquire +=================== +[![npm](https://img.shields.io/npm/v/@protobufjs/inquire.svg)](https://www.npmjs.com/package/@protobufjs/inquire) + +Requires a module only if available and hides the require call from bundlers. + +API +--- + +* **inquire(moduleName: `string`): `?Object`**
+ Requires a module only if available. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.d.ts new file mode 100644 index 00000000..aaf8ab6f --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.d.ts @@ -0,0 +1,10 @@ +export = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + * @deprecated Legacy optional require helper. Will be removed in a future release. + */ +declare function inquire(moduleName: string): object; diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.js b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.js new file mode 100644 index 00000000..956afd0b --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.js @@ -0,0 +1,38 @@ +"use strict"; +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + * @deprecated Legacy optional require helper. Will be removed in a future release. + */ +function inquire(moduleName) { + try { + if (typeof require !== "function") { + return null; + } + var mod = require(moduleName); + if (mod && (mod.length || Object.keys(mod).length)) return mod; + return null; + } catch (err) { + // ignore + return null; + } +} + +/* +// maybe worth a shot to prevent renaming issues: +// see: https://github.com/webpack/webpack/blob/master/lib/dependencies/CommonJsRequireDependencyParserPlugin.js +// triggers on: +// - expression require.cache +// - expression require (???) +// - call require +// - call require:commonjs:item +// - call require:commonjs:context + +Object.defineProperty(Function.prototype, "__self", { get: function() { return this; } }); +var r = require.__self; +delete Function.prototype.__self; +*/ diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/package.json b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/package.json new file mode 100644 index 00000000..015411c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/package.json @@ -0,0 +1,21 @@ +{ + "name": "@protobufjs/inquire", + "description": "Requires a module only if available and hides the require call from bundlers.", + "version": "1.1.2", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^5.0.0" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/array.js b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/array.js new file mode 100644 index 00000000..96627c36 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/array.js @@ -0,0 +1 @@ +module.exports = [1]; diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyArray.js b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyArray.js new file mode 100644 index 00000000..0630c8f5 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyArray.js @@ -0,0 +1 @@ +module.exports = []; diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyObject.js b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyObject.js new file mode 100644 index 00000000..0369aa45 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/emptyObject.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/object.js b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/object.js new file mode 100644 index 00000000..3226d44e --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/data/object.js @@ -0,0 +1 @@ +module.exports = { a: 1 }; diff --git a/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/index.js new file mode 100644 index 00000000..7d6496f0 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/tests/index.js @@ -0,0 +1,20 @@ +var tape = require("tape"); + +var inquire = require(".."); + +tape.test("inquire", function(test) { + + test.equal(inquire("buffer").Buffer, Buffer, "should be able to require \"buffer\""); + + test.equal(inquire("%invalid"), null, "should not be able to require \"%invalid\""); + + test.equal(inquire("./tests/data/emptyObject"), null, "should return null when requiring a module exporting an empty object"); + + test.equal(inquire("./tests/data/emptyArray"), null, "should return null when requiring a module exporting an empty array"); + + test.same(inquire("./tests/data/object"), { a: 1 }, "should return the object if a non-empty object"); + + test.same(inquire("./tests/data/array"), [ 1 ], "should return the module if a non-empty array"); + + test.end(); +}); diff --git a/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/LICENSE b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/README.md b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/README.md new file mode 100644 index 00000000..0e8e6bc3 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/README.md @@ -0,0 +1,19 @@ +@protobufjs/path +================ +[![npm](https://img.shields.io/npm/v/@protobufjs/path.svg)](https://www.npmjs.com/package/@protobufjs/path) + +A minimal path module to resolve Unix, Windows and URL paths alike. + +API +--- + +* **path.isAbsolute(path: `string`): `boolean`**
+ Tests if the specified path is absolute. + +* **path.normalize(path: `string`): `string`**
+ Normalizes the specified path. + +* **path.resolve(originPath: `string`, includePath: `string`, [alreadyNormalized=false: `boolean`]): `string`**
+ Resolves the specified include path against the specified origin path. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.d.ts new file mode 100644 index 00000000..567c3dcf --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.d.ts @@ -0,0 +1,22 @@ +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +export function isAbsolute(path: string): boolean; + +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +export function normalize(path: string): string; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +export function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string; diff --git a/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.js b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.js new file mode 100644 index 00000000..1ea7b174 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/index.js @@ -0,0 +1,65 @@ +"use strict"; + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; diff --git a/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/package.json b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/package.json new file mode 100644 index 00000000..ae0808aa --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/package.json @@ -0,0 +1,21 @@ +{ + "name": "@protobufjs/path", + "description": "A minimal path module to resolve Unix, Windows and URL paths alike.", + "version": "1.1.2", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/tests/index.js new file mode 100644 index 00000000..927736e4 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+path@1.1.2/node_modules/@protobufjs/path/tests/index.js @@ -0,0 +1,60 @@ +var tape = require("tape"); + +var path = require(".."); + +tape.test("path", function(test) { + + test.ok(path.isAbsolute("X:\\some\\path\\file.js"), "should identify absolute windows paths"); + test.ok(path.isAbsolute("/some/path/file.js"), "should identify absolute unix paths"); + + test.notOk(path.isAbsolute("some\\path\\file.js"), "should identify relative windows paths"); + test.notOk(path.isAbsolute("some/path/file.js"), "should identify relative unix paths"); + + var paths = [ + { + actual: "X:\\some\\..\\.\\path\\\\file.js", + normal: "X:/path/file.js", + resolve: { + origin: "X:/path/origin.js", + expected: "X:/path/file.js" + } + }, { + actual: "some\\..\\.\\path\\\\file.js", + normal: "path/file.js", + resolve: { + origin: "X:/path/origin.js", + expected: "X:/path/path/file.js" + } + }, { + actual: "/some/.././path//file.js", + normal: "/path/file.js", + resolve: { + origin: "/path/origin.js", + expected: "/path/file.js" + } + }, { + actual: "some/.././path//file.js", + normal: "path/file.js", + resolve: { + origin: "", + expected: "path/file.js" + } + }, { + actual: ".././path//file.js", + normal: "../path/file.js" + }, { + actual: "/.././path//file.js", + normal: "/path/file.js" + } + ]; + + paths.forEach(function(p) { + test.equal(path.normalize(p.actual), p.normal, "should normalize " + p.actual); + if (p.resolve) { + test.equal(path.resolve(p.resolve.origin, p.actual), p.resolve.expected, "should resolve " + p.actual); + test.equal(path.resolve(p.resolve.origin, p.normal, true), p.resolve.expected, "should resolve " + p.normal + " (already normalized)"); + } + }); + + test.end(); +}); diff --git a/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/.npmignore b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/.npmignore new file mode 100644 index 00000000..ce75de45 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/.npmignore @@ -0,0 +1,3 @@ +npm-debug.* +node_modules/ +coverage/ diff --git a/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/LICENSE b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/README.md b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/README.md new file mode 100644 index 00000000..3955ae03 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/README.md @@ -0,0 +1,13 @@ +@protobufjs/pool +================ +[![npm](https://img.shields.io/npm/v/@protobufjs/pool.svg)](https://www.npmjs.com/package/@protobufjs/pool) + +A general purpose buffer pool. + +API +--- + +* **pool(alloc: `function(size: number): Uint8Array`, slice: `function(this: Uint8Array, start: number, end: number): Uint8Array`, [size=8192: `number`]): `function(size: number): Uint8Array`**
+ Creates a pooled allocator. + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.d.ts new file mode 100644 index 00000000..465559c7 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.d.ts @@ -0,0 +1,32 @@ +export = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +type PoolAllocator = (size: number) => Uint8Array; + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ +type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array; + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; diff --git a/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js new file mode 100644 index 00000000..9556f5a4 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js @@ -0,0 +1,48 @@ +"use strict"; +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} diff --git a/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/package.json b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/package.json new file mode 100644 index 00000000..f025e033 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/package.json @@ -0,0 +1,21 @@ +{ + "name": "@protobufjs/pool", + "description": "A general purpose buffer pool.", + "version": "1.1.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^4.6.3" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} diff --git a/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/tests/index.js new file mode 100644 index 00000000..dc488b80 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/tests/index.js @@ -0,0 +1,33 @@ +var tape = require("tape"); + +var pool = require(".."); + +if (typeof Uint8Array !== "undefined") +tape.test("pool", function(test) { + + var alloc = pool(function(size) { return new Uint8Array(size); }, Uint8Array.prototype.subarray); + + var buf1 = alloc(0); + test.equal(buf1.length, 0, "should allocate a buffer of size 0"); + + var buf2 = alloc(1); + test.equal(buf2.length, 1, "should allocate a buffer of size 1 (initializes slab)"); + + test.notEqual(buf2.buffer, buf1.buffer, "should not reference the same backing buffer if previous buffer had size 0"); + test.equal(buf2.byteOffset, 0, "should allocate at byteOffset 0 when using a new slab"); + + buf1 = alloc(1); + test.equal(buf1.buffer, buf2.buffer, "should reference the same backing buffer when allocating a chunk fitting into the slab"); + test.equal(buf1.byteOffset, 8, "should align slices to 32 bit and this allocate at byteOffset 8"); + + var buf3 = alloc(4097); + test.notEqual(buf3.buffer, buf2.buffer, "should not reference the same backing buffer when allocating a buffer larger than half the backing buffer's size"); + + buf2 = alloc(4096); + test.equal(buf2.buffer, buf1.buffer, "should reference the same backing buffer when allocating a buffer smaller or equal than half the backing buffer's size"); + + buf1 = alloc(4096); + test.notEqual(buf1.buffer, buf2.buffer, "should not reference the same backing buffer when the slab is exhausted (initializes new slab)"); + + test.end(); +}); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/CHANGELOG.md b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/CHANGELOG.md new file mode 100644 index 00000000..6759ff8a --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## [1.1.2](https://github.com/protobufjs/protobuf.js/compare/utf8-v1.1.1...utf8-v1.1.2) (2026-07-05) + + +### Performance Improvements + +* Batch String.fromCharCode in @protobufjs/utf8 read ([#2355](https://github.com/protobufjs/protobuf.js/issues/2355)) ([d1ae3ce](https://github.com/protobufjs/protobuf.js/commit/d1ae3ce46370254ada0f3db689506a9139c8d1ee)) diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/LICENSE b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/LICENSE new file mode 100644 index 00000000..2a2d5601 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/README.md b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/README.md new file mode 100644 index 00000000..36962893 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/README.md @@ -0,0 +1,20 @@ +@protobufjs/utf8 +================ +[![npm](https://img.shields.io/npm/v/@protobufjs/utf8.svg)](https://www.npmjs.com/package/@protobufjs/utf8) + +A minimal UTF8 implementation for number arrays. + +API +--- + +* **utf8.length(string: `string`): `number`**
+ Calculates the UTF8 byte length of a string. + +* **utf8.read(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**
+ Reads UTF8 bytes as a string. + +* **utf8.write(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**
+ Writes a string as UTF8 bytes. + + +**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.d.ts b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.d.ts new file mode 100644 index 00000000..010888c3 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.d.ts @@ -0,0 +1,24 @@ +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function length(string: string): number; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function read(buffer: Uint8Array, start: number, end: number): string; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function write(string: string, buffer: Uint8Array, offset: number): number; diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.js b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.js new file mode 100644 index 00000000..a94b876b --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/index.js @@ -0,0 +1,115 @@ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports, + replacementCharCode = 0xFFFD; // U+FFFD REPLACEMENT CHARACTER + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + if (end - start < 1) + return ""; + // Batch code units and flush via String.fromCharCode.apply in 8192-unit + // chunks to avoid the per-character ConsString buildup of `str += ...`. + var parts = null, + chunk = [], + i = 0, // chunk write index + t, t2, c2, c3; + while (start < end) { + t = buffer[start++]; + if (t <= 0x7F) { + chunk[i++] = t; + } else if (t >= 0xC0 && t < 0xE0) { + c2 = (t & 0x1F) << 6 | buffer[start++] & 0x3F; + chunk[i++] = c2 >= 0x80 ? c2 : replacementCharCode; + } else if (t >= 0xE0 && t < 0xF0) { + c3 = (t & 0xF) << 12 | (buffer[start++] & 0x3F) << 6 | buffer[start++] & 0x3F; + chunk[i++] = c3 >= 0x800 ? c3 : replacementCharCode; + } else if (t >= 0xF0) { + t2 = (t & 7) << 18 | (buffer[start++] & 0x3F) << 12 | (buffer[start++] & 0x3F) << 6 | buffer[start++] & 0x3F; + if (t2 < 0x10000 || t2 > 0x10FFFF) + chunk[i++] = replacementCharCode; + else { + t2 -= 0x10000; + chunk[i++] = 0xD800 + (t2 >> 10); + chunk[i++] = 0xDC00 + (t2 & 0x3FF); + } + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk.slice(0, i))); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/package.json b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/package.json new file mode 100644 index 00000000..d860da08 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/package.json @@ -0,0 +1,21 @@ +{ + "name": "@protobufjs/utf8", + "description": "A minimal UTF8 implementation for number arrays.", + "version": "1.1.2", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/protobufjs/protobuf.js.git" + }, + "license": "BSD-3-Clause", + "main": "index.js", + "types": "index.d.ts", + "devDependencies": { + "istanbul": "^0.4.5", + "tape": "^5.0.0" + }, + "scripts": { + "test": "tape tests/*.js", + "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js" + } +} diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt new file mode 100644 index 00000000..01cfa724 --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt @@ -0,0 +1,207 @@ +this file demonstrates a bug in the utf8_read function. xxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/utf8.txt b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/utf8.txt new file mode 100644 index 00000000..744ece8e --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/data/utf8.txt @@ -0,0 +1,216 @@ +UTF-8 encoded sample plain-text file +‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +Markus Kuhn [ˈmaʳkʊs kuːn] — 2002-07-25 CC BY + + +The ASCII compatible UTF-8 encoding used in this plain-text file +is defined in Unicode, ISO 10646-1, and RFC 2279. + + +Using Unicode/UTF-8, you can write in emails and source code things such as + +Mathematics and sciences: + + ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ⎧⎡⎛┌─────┐⎞⎤⎫ + ⎪⎢⎜│a²+b³ ⎟⎥⎪ + ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ⎪⎢⎜│───── ⎟⎥⎪ + ⎪⎢⎜⎷ c₈ ⎟⎥⎪ + ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⎨⎢⎜ ⎟⎥⎬ + ⎪⎢⎜ ∞ ⎟⎥⎪ + ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫), ⎪⎢⎜ ⎲ ⎟⎥⎪ + ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪ + 2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm ⎩⎣⎝i=1 ⎠⎦⎭ + +Linguistics and dictionaries: + + ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn + Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ] + +APL: + + ((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈ + +Nicer typography in plain text files: + + ╔══════════════════════════════════════════╗ + ║ ║ + ║ • ‘single’ and “double” quotes ║ + ║ ║ + ║ • Curly apostrophes: “We’ve been here” ║ + ║ ║ + ║ • Latin-1 apostrophe and accents: '´` ║ + ║ ║ + ║ • ‚deutsche‘ „Anführungszeichen“ ║ + ║ ║ + ║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║ + ║ ║ + ║ • ASCII safety test: 1lI|, 0OD, 8B ║ + ║ ╭─────────╮ ║ + ║ • the euro symbol: │ 14.95 € │ ║ + ║ ╰─────────╯ ║ + ╚══════════════════════════════════════════╝ + +Combining characters: + + STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑ + +Greek (in Polytonic): + + The Greek anthem: + + Σὲ γνωρίζω ἀπὸ τὴν κόψη + τοῦ σπαθιοῦ τὴν τρομερή, + σὲ γνωρίζω ἀπὸ τὴν ὄψη + ποὺ μὲ βία μετράει τὴ γῆ. + + ᾿Απ᾿ τὰ κόκκαλα βγαλμένη + τῶν ῾Ελλήνων τὰ ἱερά + καὶ σὰν πρῶτα ἀνδρειωμένη + χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά! + + From a speech of Demosthenes in the 4th century BC: + + Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι, + ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς + λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ + τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿ + εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ + πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν + οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι, + οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν + ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον + τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι + γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν + προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους + σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ + τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ + τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς + τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον. + + Δημοσθένους, Γ´ ᾿Ολυνθιακὸς + +Georgian: + + From a Unicode conference invitation: + + გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო + კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს, + ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს + ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი, + ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება + ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში, + ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში. + +Russian: + + From a Unicode conference invitation: + + Зарегистрируйтесь сейчас на Десятую Международную Конференцию по + Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии. + Конференция соберет широкий круг экспертов по вопросам глобального + Интернета и Unicode, локализации и интернационализации, воплощению и + применению Unicode в различных операционных системах и программных + приложениях, шрифтах, верстке и многоязычных компьютерных системах. + +Thai (UCS Level 2): + + Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese + classic 'San Gua'): + + [----------------------------|------------------------] + ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่ + สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา + ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา + โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ + เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ + ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ + พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้ + ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ + + (The above is a two-column text. If combining characters are handled + correctly, the lines of the second column should be aligned with the + | character above.) + +Ethiopian: + + Proverbs in the Amharic language: + + ሰማይ አይታረስ ንጉሥ አይከሰስ። + ብላ ካለኝ እንደአባቴ በቆመጠኝ። + ጌጥ ያለቤቱ ቁምጥና ነው። + ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው። + የአፍ ወለምታ በቅቤ አይታሽም። + አይጥ በበላ ዳዋ ተመታ። + ሲተረጉሙ ይደረግሙ። + ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል። + ድር ቢያብር አንበሳ ያስር። + ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም። + እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም። + የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ። + ሥራ ከመፍታት ልጄን ላፋታት። + ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል። + የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ። + ተንጋሎ ቢተፉ ተመልሶ ባፉ። + ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው። + እግርህን በፍራሽህ ልክ ዘርጋ። + +Runes: + + ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ + + (Old English, which transcribed into Latin reads 'He cwaeth that he + bude thaem lande northweardum with tha Westsae.' and means 'He said + that he lived in the northern land near the Western Sea.') + +Braille: + + ⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌ + + ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞ + ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎ + ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂ + ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙ + ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑ + ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲ + + ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ + + ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹ + ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞ + ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕ + ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹ + ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎ + ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎ + ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳ + ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞ + ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ + + (The first couple of paragraphs of "A Christmas Carol" by Dickens) + +Compact font selection example text: + + ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789 + abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ + –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд + ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა + +Greetings in various languages: + + Hello world, Καλημέρα κόσμε, コンニチハ + +Box drawing alignment tests: █ + ▉ + ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳ + ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳ + ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳ + ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳ + ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎ + ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏ + ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█ + ▝▀▘▙▄▟ + +Surrogates: + +𠜎 𠜱 𠝹 𠱓 𠱸 𠲖 𠳏 𠳕 𠴕 𠵼 𠵿 𠸎 𠸏 𠹷 𠺝 𠺢 𠻗 𠻹 𠻺 𠼭 𠼮 𠽌 𠾴 𠾼 𠿪 𡁜 𡁯 𡁵 𡁶 𡁻 𡃁 +𡃉 𡇙 𢃇 𢞵 𢫕 𢭃 𢯊 𢱑 𢱕 𢳂 𢴈 𢵌 𢵧 𢺳 𣲷 𤓓 𤶸 𤷪 𥄫 𦉘 𦟌 𦧲 𦧺 𧨾 𨅝 𨈇 𨋢 𨳊 𨳍 𨳒 𩶘 diff --git a/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/index.js b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/index.js new file mode 100644 index 00000000..5f86cdad --- /dev/null +++ b/backend/node_modules/.pnpm/@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8/tests/index.js @@ -0,0 +1,79 @@ +var tape = require("tape"); + +var utf8 = require(".."); + +var data = require("fs").readFileSync(require.resolve("./data/utf8.txt")), + dataStr = data.toString("utf8"); + +var surrogatePairErr = require("fs").readFileSync(require.resolve("./data/surrogate_pair_bug.txt")), + surrogatePairErrStr = data.toString("utf8"); + +tape.test("utf8", function(test) { + + test.test(test.name + " - length", function(test) { + test.equal(utf8.length(""), 0, "should return a byte length of zero for an empty string"); + + test.equal(utf8.length(dataStr), Buffer.byteLength(dataStr), "should return the same byte length as node buffers"); + + test.end(); + }); + + test.test(test.name + " - read", function(test) { + var comp = utf8.read([], 0, 0); + test.equal(comp, "", "should decode an empty buffer to an empty string"); + + comp = utf8.read(data, 0, data.length); + test.equal(comp, data.toString("utf8"), "should decode to the same byte data as node buffers"); + + var longData = Buffer.concat([data, data, data, data]); + comp = utf8.read(longData, 0, longData.length); + test.equal(comp, longData.toString("utf8"), "should decode to the same byte data as node buffers (long)"); + + var chunkData = new Buffer(data.toString("utf8").substring(0, 8192)); + comp = utf8.read(chunkData, 0, chunkData.length); + test.equal(comp, chunkData.toString("utf8"), "should decode to the same byte data as node buffers (chunk size)"); + + comp = utf8.read(surrogatePairErr, 0, surrogatePairErr.length); + test.equal(comp, surrogatePairErr.toString("utf8"), "should decode to the same byte data as node buffers (surrogate pair over chunk)"); + + [ + [0xC0, 0x80], // U+0000 encoded as two bytes + [0xE0, 0x81, 0xBF], // U+007F encoded as three bytes + [0xF0, 0x80, 0x9F, 0xBF], // U+07FF encoded as four bytes + [0xF4, 0x90, 0x80, 0x80] // >U+10FFFF encoded as four bytes + ].forEach(function(bytes) { + var overlong = new Buffer(bytes); + comp = utf8.read(overlong, 0, overlong.length); + test.equal(comp, "\ufffd", "should decode overlong UTF-8 sequences as replacement characters"); + }); + + var longMultibyteStr = "\u20ac\u00df\u7a7a\u03bb\ud835\udd4f".repeat(20000); // 3-byte, 2-byte and surrogate-pair code points + var longMultibyte = Buffer.from(longMultibyteStr, "utf8"); + comp = utf8.read(longMultibyte, 0, longMultibyte.length); + test.equal(comp, longMultibyteStr, "should decode a large multibyte string spanning many flush boundaries"); + + test.end(); + }); + + test.test(test.name + " - write", function(test) { + var buf = new Buffer(0); + test.equal(utf8.write("", buf, 0), 0, "should encode an empty string to an empty buffer"); + + var len = utf8.length(dataStr); + buf = new Buffer(len); + test.equal(utf8.write(dataStr, buf, 0), len, "should encode to exactly " + len + " bytes"); + + test.equal(buf.length, data.length, "should encode to a buffer length equal to that of node buffers"); + + for (var i = 0; i < buf.length; ++i) { + if (buf[i] !== data[i]) { + test.fail("should encode to the same buffer data as node buffers (offset " + i + ")"); + return; + } + } + test.pass("should encode to the same buffer data as node buffers"); + + test.end(); + }); + +}); diff --git a/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/LICENSE b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/LICENSE new file mode 100644 index 00000000..ea54e0dd --- /dev/null +++ b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Colin McDonnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/README.md b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/README.md new file mode 100644 index 00000000..f9813ffa --- /dev/null +++ b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/README.md @@ -0,0 +1,198 @@ +

+ Standard Schema fire logo +
+ Standard Schema

+

+ A family of specs for interoperable TypeScript +
+ standardschema.dev +

+
+ + + +The Standard Schema project is a set of interfaces that standardize the provision and consumption of shared functionality in the TypeScript ecosystem. + +Its goal is to allow tools to accept a single input that includes all the types and capabilities they need— no library-specific adapters, no extra dependencies. The result is an ecosystem that's fair for implementers, friendly for consumers, and open for end users. + +## The specifications + +The specifications can be found below in their entirety. Libraries wishing to implement a spec can copy/paste the code block below into their codebase. They're also available at `@standard-schema/spec` on [npm](https://www.npmjs.com/package/@standard-schema/spec) and [JSR](https://jsr.io/@standard-schema/spec). + +```ts +// ######################### +// ### Standard Typed ### +// ######################### + +/** The Standard Typed interface. This is a base type extended by other specs. */ +export interface StandardTypedV1 { + /** The Standard properties. */ + readonly "~standard": StandardTypedV1.Props; +} + +export declare namespace StandardTypedV1 { + /** The Standard Typed properties interface. */ + export interface Props { + /** The version number of the standard. */ + readonly version: 1; + /** The vendor name of the schema library. */ + readonly vendor: string; + /** Inferred types associated with the schema. */ + readonly types?: Types | undefined; + } + + /** The Standard Typed types interface. */ + export interface Types { + /** The input type of the schema. */ + readonly input: Input; + /** The output type of the schema. */ + readonly output: Output; + } + + /** Infers the input type of a Standard Typed. */ + export type InferInput = NonNullable< + Schema["~standard"]["types"] + >["input"]; + + /** Infers the output type of a Standard Typed. */ + export type InferOutput = NonNullable< + Schema["~standard"]["types"] + >["output"]; +} + +// ########################## +// ### Standard Schema ### +// ########################## + +/** The Standard Schema interface. */ +export interface StandardSchemaV1 { + /** The Standard Schema properties. */ + readonly "~standard": StandardSchemaV1.Props; +} + +export declare namespace StandardSchemaV1 { + /** The Standard Schema properties interface. */ + export interface Props + extends StandardTypedV1.Props { + /** Validates unknown input values. */ + readonly validate: ( + value: unknown, + options?: StandardSchemaV1.Options | undefined + ) => Result | Promise>; + } + + /** The result interface of the validate function. */ + export type Result = SuccessResult | FailureResult; + + /** The result interface if validation succeeds. */ + export interface SuccessResult { + /** The typed output value. */ + readonly value: Output; + /** A falsy value for `issues` indicates success. */ + readonly issues?: undefined; + } + + export interface Options { + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + + /** The result interface if validation fails. */ + export interface FailureResult { + /** The issues of failed validation. */ + readonly issues: ReadonlyArray; + } + + /** The issue interface of the failure output. */ + export interface Issue { + /** The error message of the issue. */ + readonly message: string; + /** The path of the issue, if any. */ + readonly path?: ReadonlyArray | undefined; + } + + /** The path segment interface of the issue. */ + export interface PathSegment { + /** The key representing a path segment. */ + readonly key: PropertyKey; + } + + /** The Standard types interface. */ + export interface Types + extends StandardTypedV1.Types {} + + /** Infers the input type of a Standard. */ + export type InferInput = + StandardTypedV1.InferInput; + + /** Infers the output type of a Standard. */ + export type InferOutput = + StandardTypedV1.InferOutput; +} + +// ############################### +// ### Standard JSON Schema ### +// ############################### + +/** The Standard JSON Schema interface. */ +export interface StandardJSONSchemaV1 { + /** The Standard JSON Schema properties. */ + readonly "~standard": StandardJSONSchemaV1.Props; +} + +export declare namespace StandardJSONSchemaV1 { + /** The Standard JSON Schema properties interface. */ + export interface Props + extends StandardTypedV1.Props { + /** Methods for generating the input/output JSON Schema. */ + readonly jsonSchema: StandardJSONSchemaV1.Converter; + } + + /** The Standard JSON Schema converter interface. */ + export interface Converter { + /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ + readonly input: ( + options: StandardJSONSchemaV1.Options + ) => Record; + /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ + readonly output: ( + options: StandardJSONSchemaV1.Options + ) => Record; + } + + /** + * The target version of the generated JSON Schema. + * + * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. + * + * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. + */ + export type Target = + | "draft-2020-12" + | "draft-07" + | "openapi-3.0" + // Accepts any string for future targets while preserving autocomplete + | ({} & string); + + /** The options for the input/output methods. */ + export interface Options { + /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ + readonly target: Target; + + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + + /** The Standard types interface. */ + export interface Types + extends StandardTypedV1.Types {} + + /** Infers the input type of a Standard. */ + export type InferInput = + StandardTypedV1.InferInput; + + /** Infers the output type of a Standard. */ + export type InferOutput = + StandardTypedV1.InferOutput; +} +``` diff --git a/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.cjs b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.cjs new file mode 100644 index 00000000..321666eb --- /dev/null +++ b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.cjs @@ -0,0 +1,18 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +module.exports = __toCommonJS(src_exports); diff --git a/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.cts b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.cts new file mode 100644 index 00000000..5e4acaad --- /dev/null +++ b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.cts @@ -0,0 +1,119 @@ +/** The Standard Typed interface. This is a base type extended by other specs. */ +interface StandardTypedV1 { + /** The Standard properties. */ + readonly "~standard": StandardTypedV1.Props; +} +declare namespace StandardTypedV1 { + /** The Standard Typed properties interface. */ + interface Props { + /** The version number of the standard. */ + readonly version: 1; + /** The vendor name of the schema library. */ + readonly vendor: string; + /** Inferred types associated with the schema. */ + readonly types?: Types | undefined; + } + /** The Standard Typed types interface. */ + interface Types { + /** The input type of the schema. */ + readonly input: Input; + /** The output type of the schema. */ + readonly output: Output; + } + /** Infers the input type of a Standard Typed. */ + type InferInput = NonNullable["input"]; + /** Infers the output type of a Standard Typed. */ + type InferOutput = NonNullable["output"]; +} +/** The Standard Schema interface. */ +interface StandardSchemaV1 { + /** The Standard Schema properties. */ + readonly "~standard": StandardSchemaV1.Props; +} +declare namespace StandardSchemaV1 { + /** The Standard Schema properties interface. */ + interface Props extends StandardTypedV1.Props { + /** Validates unknown input values. */ + readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result | Promise>; + } + /** The result interface of the validate function. */ + type Result = SuccessResult | FailureResult; + /** The result interface if validation succeeds. */ + interface SuccessResult { + /** The typed output value. */ + readonly value: Output; + /** A falsy value for `issues` indicates success. */ + readonly issues?: undefined; + } + interface Options { + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + /** The result interface if validation fails. */ + interface FailureResult { + /** The issues of failed validation. */ + readonly issues: ReadonlyArray; + } + /** The issue interface of the failure output. */ + interface Issue { + /** The error message of the issue. */ + readonly message: string; + /** The path of the issue, if any. */ + readonly path?: ReadonlyArray | undefined; + } + /** The path segment interface of the issue. */ + interface PathSegment { + /** The key representing a path segment. */ + readonly key: PropertyKey; + } + /** The Standard types interface. */ + interface Types extends StandardTypedV1.Types { + } + /** Infers the input type of a Standard. */ + type InferInput = StandardTypedV1.InferInput; + /** Infers the output type of a Standard. */ + type InferOutput = StandardTypedV1.InferOutput; +} +/** The Standard JSON Schema interface. */ +interface StandardJSONSchemaV1 { + /** The Standard JSON Schema properties. */ + readonly "~standard": StandardJSONSchemaV1.Props; +} +declare namespace StandardJSONSchemaV1 { + /** The Standard JSON Schema properties interface. */ + interface Props extends StandardTypedV1.Props { + /** Methods for generating the input/output JSON Schema. */ + readonly jsonSchema: StandardJSONSchemaV1.Converter; + } + /** The Standard JSON Schema converter interface. */ + interface Converter { + /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ + readonly input: (options: StandardJSONSchemaV1.Options) => Record; + /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ + readonly output: (options: StandardJSONSchemaV1.Options) => Record; + } + /** + * The target version of the generated JSON Schema. + * + * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. + * + * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. + */ + type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string); + /** The options for the input/output methods. */ + interface Options { + /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ + readonly target: Target; + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + /** The Standard types interface. */ + interface Types extends StandardTypedV1.Types { + } + /** Infers the input type of a Standard. */ + type InferInput = StandardTypedV1.InferInput; + /** Infers the output type of a Standard. */ + type InferOutput = StandardTypedV1.InferOutput; +} + +export { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 }; diff --git a/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts new file mode 100644 index 00000000..5e4acaad --- /dev/null +++ b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts @@ -0,0 +1,119 @@ +/** The Standard Typed interface. This is a base type extended by other specs. */ +interface StandardTypedV1 { + /** The Standard properties. */ + readonly "~standard": StandardTypedV1.Props; +} +declare namespace StandardTypedV1 { + /** The Standard Typed properties interface. */ + interface Props { + /** The version number of the standard. */ + readonly version: 1; + /** The vendor name of the schema library. */ + readonly vendor: string; + /** Inferred types associated with the schema. */ + readonly types?: Types | undefined; + } + /** The Standard Typed types interface. */ + interface Types { + /** The input type of the schema. */ + readonly input: Input; + /** The output type of the schema. */ + readonly output: Output; + } + /** Infers the input type of a Standard Typed. */ + type InferInput = NonNullable["input"]; + /** Infers the output type of a Standard Typed. */ + type InferOutput = NonNullable["output"]; +} +/** The Standard Schema interface. */ +interface StandardSchemaV1 { + /** The Standard Schema properties. */ + readonly "~standard": StandardSchemaV1.Props; +} +declare namespace StandardSchemaV1 { + /** The Standard Schema properties interface. */ + interface Props extends StandardTypedV1.Props { + /** Validates unknown input values. */ + readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result | Promise>; + } + /** The result interface of the validate function. */ + type Result = SuccessResult | FailureResult; + /** The result interface if validation succeeds. */ + interface SuccessResult { + /** The typed output value. */ + readonly value: Output; + /** A falsy value for `issues` indicates success. */ + readonly issues?: undefined; + } + interface Options { + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + /** The result interface if validation fails. */ + interface FailureResult { + /** The issues of failed validation. */ + readonly issues: ReadonlyArray; + } + /** The issue interface of the failure output. */ + interface Issue { + /** The error message of the issue. */ + readonly message: string; + /** The path of the issue, if any. */ + readonly path?: ReadonlyArray | undefined; + } + /** The path segment interface of the issue. */ + interface PathSegment { + /** The key representing a path segment. */ + readonly key: PropertyKey; + } + /** The Standard types interface. */ + interface Types extends StandardTypedV1.Types { + } + /** Infers the input type of a Standard. */ + type InferInput = StandardTypedV1.InferInput; + /** Infers the output type of a Standard. */ + type InferOutput = StandardTypedV1.InferOutput; +} +/** The Standard JSON Schema interface. */ +interface StandardJSONSchemaV1 { + /** The Standard JSON Schema properties. */ + readonly "~standard": StandardJSONSchemaV1.Props; +} +declare namespace StandardJSONSchemaV1 { + /** The Standard JSON Schema properties interface. */ + interface Props extends StandardTypedV1.Props { + /** Methods for generating the input/output JSON Schema. */ + readonly jsonSchema: StandardJSONSchemaV1.Converter; + } + /** The Standard JSON Schema converter interface. */ + interface Converter { + /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ + readonly input: (options: StandardJSONSchemaV1.Options) => Record; + /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ + readonly output: (options: StandardJSONSchemaV1.Options) => Record; + } + /** + * The target version of the generated JSON Schema. + * + * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. + * + * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. + */ + type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string); + /** The options for the input/output methods. */ + interface Options { + /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ + readonly target: Target; + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + /** The Standard types interface. */ + interface Types extends StandardTypedV1.Types { + } + /** Infers the input type of a Standard. */ + type InferInput = StandardTypedV1.InferInput; + /** Infers the output type of a Standard. */ + type InferOutput = StandardTypedV1.InferOutput; +} + +export { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 }; diff --git a/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.js b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.js new file mode 100644 index 00000000..e69de29b diff --git a/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/package.json b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/package.json new file mode 100644 index 00000000..62bb5518 --- /dev/null +++ b/backend/node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/package.json @@ -0,0 +1,52 @@ +{ + "name": "@standard-schema/spec", + "description": "A family of specs for interoperable TypeScript", + "version": "1.1.0", + "license": "MIT", + "author": "Colin McDonnell", + "homepage": "https://standardschema.dev", + "repository": { + "type": "git", + "url": "https://github.com/standard-schema/standard-schema" + }, + "keywords": [ + "typescript", + "schema", + "validation", + "standard", + "interface" + ], + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "standard-schema-spec": "./src/index.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "sideEffects": false, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "tsup": "^8.3.0", + "typescript": "^5.6.2" + }, + "scripts": { + "lint": "pnpm biome lint ./src", + "format": "pnpm biome format --write ./src", + "check": "pnpm biome check ./src", + "build": "tsup" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/LICENSE b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/LICENSE new file mode 100755 index 00000000..9e841e7a --- /dev/null +++ b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/README.md b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/README.md new file mode 100755 index 00000000..7e8ba38b --- /dev/null +++ b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/long` + +# Summary +This package contains type definitions for long.js (https://github.com/dcodeIO/long.js). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/long. + +### Additional Details + * Last updated: Tue, 26 Apr 2022 19:31:52 GMT + * Dependencies: none + * Global values: `Long` + +# Credits +These definitions were written by [Peter Kooijmans](https://github.com/peterkooijmans). diff --git a/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/index.d.ts b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/index.d.ts new file mode 100755 index 00000000..3a95005d --- /dev/null +++ b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/index.d.ts @@ -0,0 +1,389 @@ +// Type definitions for long.js 4.0.0 +// Project: https://github.com/dcodeIO/long.js +// Definitions by: Peter Kooijmans +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions by: Denis Cappellin + +export = Long; +export as namespace Long; + +declare const Long: Long.LongConstructor; +type Long = Long.Long; +declare namespace Long { + interface LongConstructor { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. + */ + new( low: number, high?: number, unsigned?: boolean ): Long; + prototype: Long; + /** + * Maximum unsigned value. + */ + MAX_UNSIGNED_VALUE: Long; + + /** + * Maximum signed value. + */ + MAX_VALUE: Long; + + /** + * Minimum signed value. + */ + MIN_VALUE: Long; + + /** + * Signed negative one. + */ + NEG_ONE: Long; + + /** + * Signed one. + */ + ONE: Long; + + /** + * Unsigned one. + */ + UONE: Long; + + /** + * Unsigned zero. + */ + UZERO: Long; + + /** + * Signed zero + */ + ZERO: Long; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + */ + fromBits( lowBits:number, highBits:number, unsigned?:boolean ): Long; + + /** + * Returns a Long representing the given 32 bit integer value. + */ + fromInt( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + */ + fromNumber( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix. + */ + fromString( str: string, unsigned?: boolean | number, radix?: number ): Long; + + /** + * Creates a Long from its byte representation. + */ + fromBytes( bytes: number[], unsigned?: boolean, le?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + fromBytesLE( bytes: number[], unsigned?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + fromBytesBE( bytes: number[], unsigned?: boolean ): Long; + + /** + * Tests if the specified object is a Long. + */ + isLong( obj: any ): obj is Long; + + /** + * Converts the specified value to a Long. + */ + fromValue( val: Long | number | string | {low: number, high: number, unsigned: boolean}, unsigned?: boolean ): Long; + } + interface Long + { + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Returns the sum of this and the specified Long. + */ + add( addend: number | Long | string ): Long; + + /** + * Returns the bitwise AND of this Long and the specified. + */ + and( other: Long | number | string ): Long; + + /** + * Compares this Long's value with the specified's. + */ + compare( other: Long | number | string ): number; + + /** + * Compares this Long's value with the specified's. + */ + comp( other: Long | number | string ): number; + + /** + * Returns this Long divided by the specified. + */ + divide( divisor: Long | number | string ): Long; + + /** + * Returns this Long divided by the specified. + */ + div( divisor: Long | number | string ): Long; + + /** + * Tests if this Long's value equals the specified's. + */ + equals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value equals the specified's. + */ + eq( other: Long | number | string ): boolean; + + /** + * Gets the high 32 bits as a signed integer. + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer. + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer. + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer. + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value is greater than the specified's. + */ + greaterThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than the specified's. + */ + gt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + greaterThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + gte( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is even. + */ + isEven(): boolean; + + /** + * Tests if this Long's value is negative. + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is odd. + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is positive. + */ + isPositive(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + isZero(): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lessThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lessThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lte( other: Long | number | string ): boolean; + + /** + * Returns this Long modulo the specified. + */ + modulo( other: Long | number | string ): Long; + + /** + * Returns this Long modulo the specified. + */ + mod( other: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + multiply( multiplier: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + mul( multiplier: Long | number | string ): Long; + + /** + * Negates this Long's value. + */ + negate(): Long; + + /** + * Negates this Long's value. + */ + neg(): Long; + + /** + * Returns the bitwise NOT of this Long. + */ + not(): Long; + + /** + * Tests if this Long's value differs from the specified's. + */ + notEquals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + neq( other: Long | number | string ): boolean; + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or( other: Long | number | string ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shiftLeft( numBits: number | Long ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shl( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shiftRight( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shr( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shiftRightUnsigned( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shru( numBits: number | Long ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + subtract( subtrahend: number | Long | string ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + sub( subtrahend: number | Long |string ): Long; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + */ + toNumber(): number; + + /** + * Converts this Long to its byte representation. + */ + + toBytes( le?: boolean ): number[]; + + /** + * Converts this Long to its little endian byte representation. + */ + + toBytesLE(): number[]; + + /** + * Converts this Long to its big endian byte representation. + */ + + toBytesBE(): number[]; + + /** + * Converts this Long to signed. + */ + toSigned(): Long; + + /** + * Converts the Long to a string written in the specified radix. + */ + toString( radix?: number ): string; + + /** + * Converts this Long to unsigned. + */ + toUnsigned(): Long; + + /** + * Returns the bitwise XOR of this Long and the given one. + */ + xor( other: Long | number | string ): Long; + } +} diff --git a/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/package.json b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/package.json new file mode 100755 index 00000000..35b1e759 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+long@4.0.2/node_modules/@types/long/package.json @@ -0,0 +1,25 @@ +{ + "name": "@types/long", + "version": "4.0.2", + "description": "TypeScript definitions for long.js", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/long", + "license": "MIT", + "contributors": [ + { + "name": "Peter Kooijmans", + "url": "https://github.com/peterkooijmans", + "githubUsername": "peterkooijmans" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/long" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "ce51a9fcaeb3f15cee5396e1c4f4b5ca2986a066f9bbe885a51dcdc6dbb22fd5", + "typeScriptVersion": "3.9" +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/LICENSE b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/LICENSE new file mode 100644 index 00000000..9e841e7a --- /dev/null +++ b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/README.md b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/README.md new file mode 100644 index 00000000..7cd5c9d6 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/webidl-conversions` + +# Summary +This package contains type definitions for webidl-conversions (https://github.com/jsdom/webidl-conversions#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl-conversions. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: none + +# Credits +These definitions were written by [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). diff --git a/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/index.d.ts b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/index.d.ts new file mode 100644 index 00000000..bcf395ab --- /dev/null +++ b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/index.d.ts @@ -0,0 +1,91 @@ +declare namespace WebIDLConversions { + interface Globals { + [key: string]: unknown; + + Number: (value?: unknown) => number; + String: (value?: unknown) => string; + TypeError: new(message?: string) => TypeError; + } + + interface Options { + context?: string | undefined; + globals?: Globals | undefined; + } + + interface IntegerOptions extends Options { + enforceRange?: boolean | undefined; + clamp?: boolean | undefined; + } + + interface StringOptions extends Options { + treatNullAsEmptyString?: boolean | undefined; + } + + interface BufferSourceOptions extends Options { + allowShared?: boolean | undefined; + } + + type IntegerConversion = (V: unknown, opts?: IntegerOptions) => number; + type StringConversion = (V: unknown, opts?: StringOptions) => string; + type NumberConversion = (V: unknown, opts?: Options) => number; +} + +declare const WebIDLConversions: { + any(V: V, opts?: WebIDLConversions.Options): V; + undefined(V?: unknown, opts?: WebIDLConversions.Options): void; + boolean(V: unknown, opts?: WebIDLConversions.Options): boolean; + + byte(V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + octet(V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + + short(V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + ["unsigned short"](V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + + long(V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + ["unsigned long"](V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + + ["long long"](V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + ["unsigned long long"](V: unknown, opts?: WebIDLConversions.IntegerOptions): number; + + double(V: unknown, opts?: WebIDLConversions.Options): number; + ["unrestricted double"](V: unknown, opts?: WebIDLConversions.Options): number; + + float(V: unknown, opts?: WebIDLConversions.Options): number; + ["unrestricted float"](V: unknown, opts?: WebIDLConversions.Options): number; + + DOMString(V: unknown, opts?: WebIDLConversions.StringOptions): string; + ByteString(V: unknown, opts?: WebIDLConversions.StringOptions): string; + USVString(V: unknown, opts?: WebIDLConversions.StringOptions): string; + + object(V: V, opts?: WebIDLConversions.Options): V extends object ? V : V & object; + ArrayBuffer( + V: unknown, + opts?: WebIDLConversions.BufferSourceOptions & { allowShared?: false | undefined }, + ): ArrayBuffer; + ArrayBuffer(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): ArrayBufferLike; + DataView(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): DataView; + + Int8Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Int8Array; + Int16Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Int16Array; + Int32Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Int32Array; + + Uint8Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Uint8Array; + Uint16Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Uint16Array; + Uint32Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Uint32Array; + Uint8ClampedArray(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Uint8ClampedArray; + + Float32Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Float32Array; + Float64Array(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): Float64Array; + + ArrayBufferView(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): ArrayBufferView; + BufferSource( + V: unknown, + opts?: WebIDLConversions.BufferSourceOptions & { allowShared?: false | undefined }, + ): ArrayBuffer | ArrayBufferView; + BufferSource(V: unknown, opts?: WebIDLConversions.BufferSourceOptions): ArrayBufferLike | ArrayBufferView; + + DOMTimeStamp(V: unknown, opts?: WebIDLConversions.Options): number; +}; + +// This can't use ES6 style exports, as those can't have spaces in export names. +export = WebIDLConversions; diff --git a/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/package.json b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/package.json new file mode 100644 index 00000000..21fdb958 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions/package.json @@ -0,0 +1,30 @@ +{ + "name": "@types/webidl-conversions", + "version": "7.0.3", + "description": "TypeScript definitions for webidl-conversions", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl-conversions", + "license": "MIT", + "contributors": [ + { + "name": "ExE Boss", + "githubUsername": "ExE-Boss", + "url": "https://github.com/ExE-Boss" + }, + { + "name": "BendingBender", + "githubUsername": "BendingBender", + "url": "https://github.com/BendingBender" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/webidl-conversions" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "ff1514e10869784e8b7cca9c4099a4213d3f14b48c198b1bf116300df94bf608", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/webidl-conversions b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/webidl-conversions new file mode 120000 index 00000000..ab1c474c --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/webidl-conversions @@ -0,0 +1 @@ +../../../@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/LICENSE b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/LICENSE new file mode 100644 index 00000000..9e841e7a --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/README.md b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/README.md new file mode 100644 index 00000000..e78395bf --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/whatwg-url` + +# Summary +This package contains type definitions for whatwg-url (https://github.com/jsdom/whatwg-url#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url. + +### Additional Details + * Last updated: Tue, 12 Nov 2024 00:46:36 GMT + * Dependencies: [@types/webidl-conversions](https://npmjs.com/package/@types/webidl-conversions) + +# Credits +These definitions were written by [Alexander Marks](https://github.com/aomarks), [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/index.d.ts b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/index.d.ts new file mode 100644 index 00000000..e8921f84 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/index.d.ts @@ -0,0 +1,172 @@ +/// +/** https://url.spec.whatwg.org/#url-representation */ +export interface URLRecord { + scheme: string; + username: string; + password: string; + host: string | number | IPv6Address | null; + port: number | null; + path: string | string[]; + query: string | null; + fragment: string | null; +} + +/** https://url.spec.whatwg.org/#concept-ipv6 */ +export type IPv6Address = [number, number, number, number, number, number, number, number]; + +/** https://url.spec.whatwg.org/#url-class */ +export class URL { + constructor(url: string, base?: string | URL); + + static canParse(url: string, base?: string): boolean; + + get href(): string; + set href(V: string); + + get origin(): string; + + get protocol(): string; + set protocol(V: string); + + get username(): string; + set username(V: string); + + get password(): string; + set password(V: string); + + get host(): string; + set host(V: string); + + get hostname(): string; + set hostname(V: string); + + get port(): string; + set port(V: string); + + get pathname(): string; + set pathname(V: string); + + get search(): string; + set search(V: string); + + get searchParams(): URLSearchParams; + + get hash(): string; + set hash(V: string); + + toJSON(): string; + + readonly [Symbol.toStringTag]: "URL"; +} + +/** https://url.spec.whatwg.org/#interface-urlsearchparams */ +export class URLSearchParams { + constructor( + init?: + | ReadonlyArray + | Iterable + | { readonly [name: string]: string } + | string, + ); + + get size(): number; + append(name: string, value: string): void; + delete(name: string, value?: string): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string, value?: string): boolean; + set(name: string, value: string): void; + sort(): void; + + keys(): IterableIterator; + values(): IterableIterator; + entries(): IterableIterator<[name: string, value: string]>; + forEach( + callback: (this: THIS_ARG, value: string, name: string, searchParams: this) => void, + thisArg?: THIS_ARG, + ): void; + + readonly [Symbol.toStringTag]: "URLSearchParams"; + [Symbol.iterator](): IterableIterator<[name: string, value: string]>; +} + +/** https://url.spec.whatwg.org/#concept-url-parser */ +export function parseURL(input: string, options?: { readonly baseURL?: URLRecord | undefined }): URLRecord | null; + +/** https://url.spec.whatwg.org/#concept-basic-url-parser */ +export function basicURLParse( + input: string, + options?: { + baseURL?: URLRecord | undefined; + url?: URLRecord | undefined; + stateOverride?: StateOverride | undefined; + }, +): URLRecord | null; + +/** https://url.spec.whatwg.org/#scheme-start-state */ +export type StateOverride = + | "scheme start" + | "scheme" + | "no scheme" + | "special relative or authority" + | "path or authority" + | "relative" + | "relative slash" + | "special authority slashes" + | "special authority ignore slashes" + | "authority" + | "host" + | "hostname" + | "port" + | "file" + | "file slash" + | "file host" + | "path start" + | "path" + | "opaque path" + | "query" + | "fragment"; + +/** https://url.spec.whatwg.org/#concept-url-serializer */ +export function serializeURL(urlRecord: URLRecord, excludeFragment?: boolean): string; + +/** https://url.spec.whatwg.org/#concept-host-serializer */ +export function serializeHost(host: string | number | IPv6Address): string; + +/** https://url.spec.whatwg.org/#url-path-serializer */ +export function serializePath(urlRecord: URLRecord): string; + +/** https://url.spec.whatwg.org/#serialize-an-integer */ +export function serializeInteger(number: number): string; + +/** https://html.spec.whatwg.org#ascii-serialisation-of-an-origin */ +export function serializeURLOrigin(urlRecord: URLRecord): string; + +/** https://url.spec.whatwg.org/#set-the-username */ +export function setTheUsername(urlRecord: URLRecord, username: string): void; + +/** https://url.spec.whatwg.org/#set-the-password */ +export function setThePassword(urlRecord: URLRecord, password: string): void; + +/** https://url.spec.whatwg.org/#url-opaque-path */ +export function hasAnOpaquePath(urlRecord: URLRecord): boolean; + +/** https://url.spec.whatwg.org/#cannot-have-a-username-password-port */ +export function cannotHaveAUsernamePasswordPort(urlRecord: URLRecord): boolean; + +/** https://url.spec.whatwg.org/#percent-decode */ +export function percentDecodeBytes(buffer: TypedArray): Uint8Array; + +/** https://url.spec.whatwg.org/#string-percent-decode */ +export function percentDecodeString(string: string): Uint8Array; + +export type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | Float32Array + | Float64Array; diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL-impl.d.ts b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL-impl.d.ts new file mode 100644 index 00000000..c0bb5984 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL-impl.d.ts @@ -0,0 +1,22 @@ +import { Globals } from "webidl-conversions"; +import { implementation as URLSearchParamsImpl } from "./URLSearchParams-impl"; + +declare class URLImpl { + constructor(globalObject: Globals, constructorArgs: readonly [url: string, base?: string]); + + href: string; + readonly origin: string; + protocol: string; + username: string; + password: string; + host: string; + hostname: string; + port: string; + pathname: string; + search: string; + readonly searchParams: URLSearchParamsImpl; + hash: string; + + toJSON(): string; +} +export { URLImpl as implementation }; diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL.d.ts b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL.d.ts new file mode 100644 index 00000000..85474a70 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URL.d.ts @@ -0,0 +1,66 @@ +import { URL } from "../index"; +import { implementation as URLImpl } from "./URL-impl"; + +/** + * Checks whether `obj` is a `URL` object with an implementation + * provided by this package. + */ +export function is(obj: unknown): obj is URL; + +/** + * Checks whether `obj` is a `URLImpl` WebIDL2JS implementation object + * provided by this package. + */ +export function isImpl(obj: unknown): obj is URLImpl; + +/** + * Converts the `URL` wrapper into a `URLImpl` object. + * + * @throws {TypeError} If `obj` is not a `URL` wrapper instance provided by this package. + */ +export function convert(globalObject: object, obj: unknown, { context }?: { context: string }): URLImpl; + +/** + * Creates a new `URL` instance. + * + * @throws {Error} If the `globalObject` doesn't have a WebIDL2JS constructor + * registry or a `URL` constructor provided by this package + * in the WebIDL2JS constructor registry. + */ +export function create(globalObject: object, constructorArgs: readonly [url: string, base?: string]): URL; + +/** + * Calls `create()` and returns the internal `URLImpl`. + * + * @throws {Error} If the `globalObject` doesn't have a WebIDL2JS constructor + * registry or a `URL` constructor provided by this package + * in the WebIDL2JS constructor registry. + */ +export function createImpl(globalObject: object, constructorArgs: readonly [url: string, base?: string]): URLImpl; + +/** + * Initializes the `URL` instance, called by `create()`. + * + * Useful when manually sub-classing a non-constructable wrapper object. + */ +export function setup( + obj: T, + globalObject: object, + constructorArgs: readonly [url: string, base?: string], +): T; + +/** + * Creates a new `URL` object without runing the constructor steps. + * + * Useful when implementing specifications that initialize objects + * in different ways than their constructors do. + */ +declare function _new(globalObject: object, newTarget?: new(url: string, base?: string) => URL): URLImpl; +export { _new as new }; + +/** + * Installs the `URL` constructor onto the `globalObject`. + * + * @throws {Error} If the target `globalObject` doesn't have an `Error` constructor. + */ +export function install(globalObject: object, globalNames: readonly string[]): void; diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams-impl.d.ts b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams-impl.d.ts new file mode 100644 index 00000000..cf507011 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams-impl.d.ts @@ -0,0 +1,20 @@ +declare class URLSearchParamsImpl { + constructor( + globalObject: object, + constructorArgs: readonly [ + init?: ReadonlyArray | { readonly [name: string]: string } | string, + ], + privateData: { readonly doNotStripQMark?: boolean | undefined }, + ); + + append(name: string, value: string): void; + delete(name: string): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + set(name: string, value: string): void; + sort(): void; + + [Symbol.iterator](): IterableIterator<[name: string, value: string]>; +} +export { URLSearchParamsImpl as implementation }; diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams.d.ts b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams.d.ts new file mode 100644 index 00000000..8b35d1d1 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/lib/URLSearchParams.d.ts @@ -0,0 +1,92 @@ +import { URLSearchParams } from "../index"; +import { implementation as URLSearchParamsImpl } from "./URLSearchParams-impl"; + +/** + * Checks whether `obj` is a `URLSearchParams` object with an implementation + * provided by this package. + */ +export function is(obj: unknown): obj is URLSearchParams; + +/** + * Checks whether `obj` is a `URLSearchParamsImpl` WebIDL2JS implementation object + * provided by this package. + */ +export function isImpl(obj: unknown): obj is URLSearchParamsImpl; + +/** + * Converts the `URLSearchParams` wrapper into a `URLSearchParamsImpl` object. + * + * @throws {TypeError} If `obj` is not a `URLSearchParams` wrapper instance provided by this package. + */ +export function convert(globalObject: object, obj: unknown, { context }?: { context: string }): URLSearchParamsImpl; + +export function createDefaultIterator( + globalObject: object, + target: URLSearchParamsImpl, + kind: TIteratorKind, +): IterableIterator; + +/** + * Creates a new `URLSearchParams` instance. + * + * @throws {Error} If the `globalObject` doesn't have a WebIDL2JS constructor + * registry or a `URLSearchParams` constructor provided by this package + * in the WebIDL2JS constructor registry. + */ +export function create( + globalObject: object, + constructorArgs?: readonly [ + init: ReadonlyArray<[name: string, value: string]> | { readonly [name: string]: string } | string, + ], + privateData?: { doNotStripQMark?: boolean | undefined }, +): URLSearchParams; + +/** + * Calls `create()` and returns the internal `URLSearchParamsImpl`. + * + * @throws {Error} If the `globalObject` doesn't have a WebIDL2JS constructor + * registry or a `URLSearchParams` constructor provided by this package + * in the WebIDL2JS constructor registry. + */ +export function createImpl( + globalObject: object, + constructorArgs?: readonly [ + init: ReadonlyArray<[name: string, value: string]> | { readonly [name: string]: string } | string, + ], + privateData?: { doNotStripQMark?: boolean | undefined }, +): URLSearchParamsImpl; + +/** + * Initializes the `URLSearchParams` instance, called by `create()`. + * + * Useful when manually sub-classing a non-constructable wrapper object. + */ +export function setup( + obj: T, + globalObject: object, + constructorArgs?: readonly [ + init: ReadonlyArray<[name: string, value: string]> | { readonly [name: string]: string } | string, + ], + privateData?: { doNotStripQMark?: boolean | undefined }, +): T; + +/** + * Creates a new `URLSearchParams` object without runing the constructor steps. + * + * Useful when implementing specifications that initialize objects + * in different ways than their constructors do. + */ +declare function _new( + globalObject: object, + newTarget?: new( + init: ReadonlyArray<[name: string, value: string]> | { readonly [name: string]: string } | string, + ) => URLSearchParams, +): URLSearchParamsImpl; +export { _new as new }; + +/** + * Installs the `URLSearchParams` constructor onto the `globalObject`. + * + * @throws {Error} If the target `globalObject` doesn't have an `Error` constructor. + */ +export function install(globalObject: object, globalNames: readonly string[]): void; diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/package.json b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/package.json new file mode 100644 index 00000000..0f1f317d --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/package.json @@ -0,0 +1,38 @@ +{ + "name": "@types/whatwg-url", + "version": "13.0.0", + "description": "TypeScript definitions for whatwg-url", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url", + "license": "MIT", + "contributors": [ + { + "name": "Alexander Marks", + "githubUsername": "aomarks", + "url": "https://github.com/aomarks" + }, + { + "name": "ExE Boss", + "githubUsername": "ExE-Boss", + "url": "https://github.com/ExE-Boss" + }, + { + "name": "BendingBender", + "githubUsername": "BendingBender", + "url": "https://github.com/BendingBender" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/whatwg-url" + }, + "scripts": {}, + "dependencies": { + "@types/webidl-conversions": "*" + }, + "peerDependencies": {}, + "typesPublisherContentHash": "fd4818c1b74d8ef43c58e984d60d82658280822821b6ea5d4978f4007f29c39c", + "typeScriptVersion": "4.9" +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/webidl2js-wrapper.d.ts b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/webidl2js-wrapper.d.ts new file mode 100644 index 00000000..96029b76 --- /dev/null +++ b/backend/node_modules/.pnpm/@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url/webidl2js-wrapper.d.ts @@ -0,0 +1,4 @@ +import * as URL from "./lib/URL"; +import * as URLSearchParams from "./lib/URLSearchParams"; + +export { URL, URLSearchParams }; diff --git a/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/index.js b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/index.js new file mode 100644 index 00000000..3c42ef93 --- /dev/null +++ b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/index.js @@ -0,0 +1,270 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPromise = isPromise; +exports.isActualPromise = isActualPromise; +exports.handleMaybePromise = handleMaybePromise; +exports.fakePromise = fakePromise; +exports.createDeferredPromise = createDeferredPromise; +exports.iterateAsync = iterateAsync; +exports.iterateAsyncVoid = iterateAsync; +exports.fakeRejectPromise = fakeRejectPromise; +exports.mapMaybePromise = mapMaybePromise; +exports.mapAsyncIterator = mapAsyncIterator; +exports.promiseLikeFinally = promiseLikeFinally; +exports.unfakePromise = unfakePromise; +const kFakePromise = Symbol.for('@whatwg-node/promise-helpers/FakePromise'); +function isPromise(value) { + return value?.then != null; +} +function isActualPromise(value) { + const maybePromise = value; + return maybePromise && maybePromise.then && maybePromise.catch && maybePromise.finally; +} +function handleMaybePromise(inputFactory, outputSuccessFactory, outputErrorFactory, finallyFactory) { + let result$ = fakePromise().then(inputFactory).then(outputSuccessFactory, outputErrorFactory); + if (finallyFactory) { + result$ = result$.finally(finallyFactory); + } + return unfakePromise(result$); +} +function fakePromise(value) { + if (value && isActualPromise(value)) { + return value; + } + if (isPromise(value)) { + return { + then: (resolve, reject) => fakePromise(value.then(resolve, reject)), + catch: reject => fakePromise(value.then(res => res, reject)), + finally: cb => fakePromise(cb ? promiseLikeFinally(value, cb) : value), + [Symbol.toStringTag]: 'Promise', + }; + } + // Write a fake promise to avoid the promise constructor + // being called with `new Promise` in the browser. + return { + then(resolve) { + if (resolve) { + try { + return fakePromise(resolve(value)); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + catch() { + return this; + }, + finally(cb) { + if (cb) { + try { + return fakePromise(cb()).then(() => value, () => value); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + [Symbol.toStringTag]: 'Promise', + __fakePromiseValue: value, + [kFakePromise]: 'resolved', + }; +} +function createDeferredPromise() { + if (Promise.withResolvers) { + return Promise.withResolvers(); + } + let resolveFn; + let rejectFn; + const promise = new Promise(function deferredPromiseExecutor(resolve, reject) { + resolveFn = resolve; + rejectFn = reject; + }); + return { + promise, + get resolve() { + return resolveFn; + }, + get reject() { + return rejectFn; + }, + }; +} +function iterateAsync(iterable, callback, results) { + if (iterable?.length === 0) { + return; + } + const iterator = iterable[Symbol.iterator](); + let index = 0; + function iterate() { + const { done: endOfIterator, value } = iterator.next(); + if (endOfIterator) { + return; + } + let endedEarly = false; + function endEarly() { + endedEarly = true; + } + return handleMaybePromise(function handleCallback() { + return callback(value, endEarly, index++); + }, function handleCallbackResult(result) { + if (result) { + results?.push(result); + } + if (endedEarly) { + return; + } + return iterate(); + }); + } + return iterate(); +} +function fakeRejectPromise(error) { + return { + then(_resolve, reject) { + if (reject) { + try { + return fakePromise(reject(error)); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + catch(reject) { + if (reject) { + try { + return fakePromise(reject(error)); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + finally(cb) { + if (cb) { + try { + cb(); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + __fakeRejectError: error, + [Symbol.toStringTag]: 'Promise', + [kFakePromise]: 'rejected', + }; +} +function mapMaybePromise(input, onSuccess, onError) { + return handleMaybePromise(() => input, onSuccess, onError); +} +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +function mapAsyncIterator(iterator, onNext, onError, onEnd) { + if (Symbol.asyncIterator in iterator) { + iterator = iterator[Symbol.asyncIterator](); + } + let $return; + let abruptClose; + let onEndWithValue; + if (onEnd) { + let onEndWithValueResult /** R in onEndWithValue */; + onEndWithValue = value => { + onEndWithValueResult ||= handleMaybePromise(onEnd, () => value, () => value); + return onEndWithValueResult; + }; + } + if (typeof iterator.return === 'function') { + $return = iterator.return; + abruptClose = (error) => { + const rethrow = () => { + throw error; + }; + return $return.call(iterator).then(rethrow, rethrow); + }; + } + function mapResult(result) { + if (result.done) { + return onEndWithValue ? onEndWithValue(result) : result; + } + return handleMaybePromise(() => result.value, value => handleMaybePromise(() => onNext(value), iteratorResult, abruptClose)); + } + let mapReject; + if (onError) { + let onErrorResult; + // Capture rejectCallback to ensure it cannot be null. + const reject = onError; + mapReject = (error) => { + onErrorResult ||= handleMaybePromise(() => error, error => handleMaybePromise(() => reject(error), iteratorResult, abruptClose)); + return onErrorResult; + }; + } + return { + next() { + return iterator.next().then(mapResult, mapReject); + }, + return() { + const res$ = $return + ? $return.call(iterator).then(mapResult, mapReject) + : fakePromise({ value: undefined, done: true }); + return onEndWithValue ? res$.then(onEndWithValue) : res$; + }, + throw(error) { + if (typeof iterator.throw === 'function') { + return iterator.throw(error).then(mapResult, mapReject); + } + if (abruptClose) { + return abruptClose(error); + } + return fakeRejectPromise(error); + }, + [Symbol.asyncIterator]() { + return this; + }, + }; +} +function iteratorResult(value) { + return { value, done: false }; +} +function isFakePromise(value) { + return value?.[kFakePromise] === 'resolved'; +} +function isFakeRejectPromise(value) { + return value?.[kFakePromise] === 'rejected'; +} +function promiseLikeFinally(value, onFinally) { + if ('finally' in value) { + return value.finally(onFinally); + } + return value.then(res => { + const finallyRes = onFinally(); + return isPromise(finallyRes) ? finallyRes.then(() => res) : res; + }, err => { + const finallyRes = onFinally(); + if (isPromise(finallyRes)) { + return finallyRes.then(() => { + throw err; + }); + } + else { + throw err; + } + }); +} +function unfakePromise(promise) { + if (isFakePromise(promise)) { + return promise.__fakePromiseValue; + } + if (isFakeRejectPromise(promise)) { + throw promise.__fakeRejectError; + } + return promise; +} diff --git a/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/package.json b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/esm/index.js b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/esm/index.js new file mode 100644 index 00000000..2eb47bd1 --- /dev/null +++ b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/esm/index.js @@ -0,0 +1,257 @@ +const kFakePromise = Symbol.for('@whatwg-node/promise-helpers/FakePromise'); +export function isPromise(value) { + return value?.then != null; +} +export function isActualPromise(value) { + const maybePromise = value; + return maybePromise && maybePromise.then && maybePromise.catch && maybePromise.finally; +} +export function handleMaybePromise(inputFactory, outputSuccessFactory, outputErrorFactory, finallyFactory) { + let result$ = fakePromise().then(inputFactory).then(outputSuccessFactory, outputErrorFactory); + if (finallyFactory) { + result$ = result$.finally(finallyFactory); + } + return unfakePromise(result$); +} +export function fakePromise(value) { + if (value && isActualPromise(value)) { + return value; + } + if (isPromise(value)) { + return { + then: (resolve, reject) => fakePromise(value.then(resolve, reject)), + catch: reject => fakePromise(value.then(res => res, reject)), + finally: cb => fakePromise(cb ? promiseLikeFinally(value, cb) : value), + [Symbol.toStringTag]: 'Promise', + }; + } + // Write a fake promise to avoid the promise constructor + // being called with `new Promise` in the browser. + return { + then(resolve) { + if (resolve) { + try { + return fakePromise(resolve(value)); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + catch() { + return this; + }, + finally(cb) { + if (cb) { + try { + return fakePromise(cb()).then(() => value, () => value); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + [Symbol.toStringTag]: 'Promise', + __fakePromiseValue: value, + [kFakePromise]: 'resolved', + }; +} +export function createDeferredPromise() { + if (Promise.withResolvers) { + return Promise.withResolvers(); + } + let resolveFn; + let rejectFn; + const promise = new Promise(function deferredPromiseExecutor(resolve, reject) { + resolveFn = resolve; + rejectFn = reject; + }); + return { + promise, + get resolve() { + return resolveFn; + }, + get reject() { + return rejectFn; + }, + }; +} +export { iterateAsync as iterateAsyncVoid }; +export function iterateAsync(iterable, callback, results) { + if (iterable?.length === 0) { + return; + } + const iterator = iterable[Symbol.iterator](); + let index = 0; + function iterate() { + const { done: endOfIterator, value } = iterator.next(); + if (endOfIterator) { + return; + } + let endedEarly = false; + function endEarly() { + endedEarly = true; + } + return handleMaybePromise(function handleCallback() { + return callback(value, endEarly, index++); + }, function handleCallbackResult(result) { + if (result) { + results?.push(result); + } + if (endedEarly) { + return; + } + return iterate(); + }); + } + return iterate(); +} +export function fakeRejectPromise(error) { + return { + then(_resolve, reject) { + if (reject) { + try { + return fakePromise(reject(error)); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + catch(reject) { + if (reject) { + try { + return fakePromise(reject(error)); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + finally(cb) { + if (cb) { + try { + cb(); + } + catch (err) { + return fakeRejectPromise(err); + } + } + return this; + }, + __fakeRejectError: error, + [Symbol.toStringTag]: 'Promise', + [kFakePromise]: 'rejected', + }; +} +export function mapMaybePromise(input, onSuccess, onError) { + return handleMaybePromise(() => input, onSuccess, onError); +} +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +export function mapAsyncIterator(iterator, onNext, onError, onEnd) { + if (Symbol.asyncIterator in iterator) { + iterator = iterator[Symbol.asyncIterator](); + } + let $return; + let abruptClose; + let onEndWithValue; + if (onEnd) { + let onEndWithValueResult /** R in onEndWithValue */; + onEndWithValue = value => { + onEndWithValueResult ||= handleMaybePromise(onEnd, () => value, () => value); + return onEndWithValueResult; + }; + } + if (typeof iterator.return === 'function') { + $return = iterator.return; + abruptClose = (error) => { + const rethrow = () => { + throw error; + }; + return $return.call(iterator).then(rethrow, rethrow); + }; + } + function mapResult(result) { + if (result.done) { + return onEndWithValue ? onEndWithValue(result) : result; + } + return handleMaybePromise(() => result.value, value => handleMaybePromise(() => onNext(value), iteratorResult, abruptClose)); + } + let mapReject; + if (onError) { + let onErrorResult; + // Capture rejectCallback to ensure it cannot be null. + const reject = onError; + mapReject = (error) => { + onErrorResult ||= handleMaybePromise(() => error, error => handleMaybePromise(() => reject(error), iteratorResult, abruptClose)); + return onErrorResult; + }; + } + return { + next() { + return iterator.next().then(mapResult, mapReject); + }, + return() { + const res$ = $return + ? $return.call(iterator).then(mapResult, mapReject) + : fakePromise({ value: undefined, done: true }); + return onEndWithValue ? res$.then(onEndWithValue) : res$; + }, + throw(error) { + if (typeof iterator.throw === 'function') { + return iterator.throw(error).then(mapResult, mapReject); + } + if (abruptClose) { + return abruptClose(error); + } + return fakeRejectPromise(error); + }, + [Symbol.asyncIterator]() { + return this; + }, + }; +} +function iteratorResult(value) { + return { value, done: false }; +} +function isFakePromise(value) { + return value?.[kFakePromise] === 'resolved'; +} +function isFakeRejectPromise(value) { + return value?.[kFakePromise] === 'rejected'; +} +export function promiseLikeFinally(value, onFinally) { + if ('finally' in value) { + return value.finally(onFinally); + } + return value.then(res => { + const finallyRes = onFinally(); + return isPromise(finallyRes) ? finallyRes.then(() => res) : res; + }, err => { + const finallyRes = onFinally(); + if (isPromise(finallyRes)) { + return finallyRes.then(() => { + throw err; + }); + } + else { + throw err; + } + }); +} +export function unfakePromise(promise) { + if (isFakePromise(promise)) { + return promise.__fakePromiseValue; + } + if (isFakeRejectPromise(promise)) { + throw promise.__fakeRejectError; + } + return promise; +} diff --git a/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/package.json b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/package.json new file mode 100644 index 00000000..ee54efde --- /dev/null +++ b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/package.json @@ -0,0 +1,43 @@ +{ + "name": "@whatwg-node/promise-helpers", + "version": "1.3.2", + "description": "Promise helpers", + "sideEffects": false, + "dependencies": { + "tslib": "^2.6.3" + }, + "repository": { + "type": "git", + "url": "ardatan/whatwg-node", + "directory": "packages/promise-helpers" + }, + "author": "Arda TANRIKULU ", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + }, + "main": "cjs/index.js", + "module": "esm/index.js", + "typings": "typings/index.d.ts", + "typescript": { + "definition": "typings/index.d.ts" + }, + "type": "module", + "exports": { + ".": { + "require": { + "types": "./typings/index.d.cts", + "default": "./cjs/index.js" + }, + "import": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + }, + "default": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + } + }, + "./package.json": "./package.json" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.cts b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.cts new file mode 100644 index 00000000..12bae0d6 --- /dev/null +++ b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.cts @@ -0,0 +1,31 @@ +export type MaybePromise = Promise | T; +export type MaybePromiseLike = PromiseLike | T; +export declare function isPromise(value: MaybePromise): value is Promise; +export declare function isPromise(value: MaybePromiseLike): value is PromiseLike; +export declare function isActualPromise(value: MaybePromiseLike): value is Promise; +export declare function handleMaybePromise(inputFactory: () => MaybePromise, outputSuccessFactory: (value: TInput) => MaybePromise, outputErrorFactory?: (err: any) => MaybePromise, finallyFactory?: () => MaybePromise): MaybePromise; +export declare function handleMaybePromise(inputFactory: () => MaybePromiseLike, outputSuccessFactory: (value: TInput) => MaybePromiseLike, outputErrorFactory?: (err: any) => MaybePromiseLike, finallyFactory?: () => MaybePromiseLike): MaybePromiseLike; +export declare function fakePromise(value: MaybePromise): Promise; +export declare function fakePromise(value: MaybePromiseLike): Promise; +export declare function fakePromise(value: void): Promise; +export interface DeferredPromise { + promise: Promise; + resolve: (value: T) => void; + reject: (reason: any) => void; +} +export declare function createDeferredPromise(): DeferredPromise; +export { iterateAsync as iterateAsyncVoid }; +export declare function iterateAsync(iterable: Iterable, callback: (input: TInput, endEarly: () => void, index: number) => MaybePromise, results?: TOutput[]): MaybePromise; +export declare function fakeRejectPromise(error: unknown): Promise; +/** + * @deprecated Use `handleMaybePromise` instead. + */ +export declare function mapMaybePromise(input: MaybePromise, onSuccess: (value: TInput) => MaybePromise, onError?: (err: any) => MaybePromise): MaybePromise; +export declare function mapMaybePromise(input: MaybePromiseLike, onSuccess: (value: TInput) => MaybePromiseLike, onError?: (err: any) => MaybePromiseLike): MaybePromiseLike; +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +export declare function mapAsyncIterator(iterator: AsyncIterable | AsyncIterator, onNext: (value: T) => MaybePromise, onError?: any, onEnd?: () => MaybePromise): AsyncIterableIterator; +export declare function promiseLikeFinally(value: PromiseLike | Promise, onFinally: () => MaybePromiseLike): PromiseLike; +export declare function unfakePromise(promise: Promise): MaybePromise; diff --git a/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.ts b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.ts new file mode 100644 index 00000000..12bae0d6 --- /dev/null +++ b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers/typings/index.d.ts @@ -0,0 +1,31 @@ +export type MaybePromise = Promise | T; +export type MaybePromiseLike = PromiseLike | T; +export declare function isPromise(value: MaybePromise): value is Promise; +export declare function isPromise(value: MaybePromiseLike): value is PromiseLike; +export declare function isActualPromise(value: MaybePromiseLike): value is Promise; +export declare function handleMaybePromise(inputFactory: () => MaybePromise, outputSuccessFactory: (value: TInput) => MaybePromise, outputErrorFactory?: (err: any) => MaybePromise, finallyFactory?: () => MaybePromise): MaybePromise; +export declare function handleMaybePromise(inputFactory: () => MaybePromiseLike, outputSuccessFactory: (value: TInput) => MaybePromiseLike, outputErrorFactory?: (err: any) => MaybePromiseLike, finallyFactory?: () => MaybePromiseLike): MaybePromiseLike; +export declare function fakePromise(value: MaybePromise): Promise; +export declare function fakePromise(value: MaybePromiseLike): Promise; +export declare function fakePromise(value: void): Promise; +export interface DeferredPromise { + promise: Promise; + resolve: (value: T) => void; + reject: (reason: any) => void; +} +export declare function createDeferredPromise(): DeferredPromise; +export { iterateAsync as iterateAsyncVoid }; +export declare function iterateAsync(iterable: Iterable, callback: (input: TInput, endEarly: () => void, index: number) => MaybePromise, results?: TOutput[]): MaybePromise; +export declare function fakeRejectPromise(error: unknown): Promise; +/** + * @deprecated Use `handleMaybePromise` instead. + */ +export declare function mapMaybePromise(input: MaybePromise, onSuccess: (value: TInput) => MaybePromise, onError?: (err: any) => MaybePromise): MaybePromise; +export declare function mapMaybePromise(input: MaybePromiseLike, onSuccess: (value: TInput) => MaybePromiseLike, onError?: (err: any) => MaybePromiseLike): MaybePromiseLike; +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +export declare function mapAsyncIterator(iterator: AsyncIterable | AsyncIterator, onNext: (value: T) => MaybePromise, onError?: any, onEnd?: () => MaybePromise): AsyncIterableIterator; +export declare function promiseLikeFinally(value: PromiseLike | Promise, onFinally: () => MaybePromiseLike): PromiseLike; +export declare function unfakePromise(promise: Promise): MaybePromise; diff --git a/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/tslib b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/tslib new file mode 120000 index 00000000..4edba0e2 --- /dev/null +++ b/backend/node_modules/.pnpm/@whatwg-node+promise-helpers@1.3.2/node_modules/tslib @@ -0,0 +1 @@ +../../tslib@2.8.1/node_modules/tslib \ No newline at end of file diff --git a/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/LICENSE.md b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/LICENSE.md new file mode 100644 index 00000000..b708f872 --- /dev/null +++ b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/README.md b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/README.md new file mode 100644 index 00000000..d738d303 --- /dev/null +++ b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/README.md @@ -0,0 +1,53 @@ +# async-retry + +Retrying made simple, easy, and async. + +## Usage + +```js +// Packages +const retry = require('async-retry'); +const fetch = require('node-fetch'); + +await retry( + async (bail) => { + // if anything throws, we retry + const res = await fetch('https://google.com'); + + if (403 === res.status) { + // don't retry upon 403 + bail(new Error('Unauthorized')); + return; + } + + const data = await res.text(); + return data.substr(0, 500); + }, + { + retries: 5, + } +); +``` + +### API + +```js +retry(retrier : Function, opts : Object) => Promise +``` + +- The supplied function can be `async` or not. In other words, it can be a function that returns a `Promise` or a value. +- The supplied function receives two parameters + 1. A `Function` you can invoke to abort the retrying (bail) + 2. A `Number` identifying the attempt. The absolute first attempt (before any retries) is `1`. +- The `opts` are passed to `node-retry`. Read [its docs](https://github.com/tim-kos/node-retry) + - `retries`: The maximum amount of times to retry the operation. Default is `10`. + - `factor`: The exponential factor to use. Default is `2`. + - `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. + - `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. + - `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `true`. + - `onRetry`: an optional `Function` that is invoked after a new retry is performed. It's passed the `Error` that triggered it as a parameter. + +## Authors + +- Guillermo Rauch ([@rauchg](https://twitter.com/rauchg)) - [Vercel](https://vercel.com) +- Leo Lamprecht ([@notquiteleo](https://twitter.com/notquiteleo)) - [Vercel](https://vercel.com) diff --git a/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/lib/index.js b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/lib/index.js new file mode 100644 index 00000000..d8f0c8a5 --- /dev/null +++ b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/lib/index.js @@ -0,0 +1,61 @@ +// Packages +var retrier = require('retry'); + +function retry(fn, opts) { + function run(resolve, reject) { + var options = opts || {}; + var op; + + // Default `randomize` to true + if (!('randomize' in options)) { + options.randomize = true; + } + + op = retrier.operation(options); + + // We allow the user to abort retrying + // this makes sense in the cases where + // knowledge is obtained that retrying + // would be futile (e.g.: auth errors) + + function bail(err) { + reject(err || new Error('Aborted')); + } + + function onError(err, num) { + if (err.bail) { + bail(err); + return; + } + + if (!op.retry(err)) { + reject(op.mainError()); + } else if (options.onRetry) { + options.onRetry(err, num); + } + } + + function runAttempt(num) { + var val; + + try { + val = fn(bail, num); + } catch (err) { + onError(err, num); + return; + } + + Promise.resolve(val) + .then(resolve) + .catch(function catchIt(err) { + onError(err, num); + }); + } + + op.attempt(runAttempt); + } + + return new Promise(run); +} + +module.exports = retry; diff --git a/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/package.json b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/package.json new file mode 100644 index 00000000..ad63096c --- /dev/null +++ b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/async-retry/package.json @@ -0,0 +1,55 @@ +{ + "name": "async-retry", + "version": "1.3.3", + "description": "Retrying made simple, easy and async", + "main": "./lib/index.js", + "scripts": { + "test": "yarn run test-lint && yarn run test-unit", + "test-lint": "eslint .", + "test-unit": "ava", + "lint:staged": "lint-staged" + }, + "files": [ + "lib" + ], + "license": "MIT", + "repository": "vercel/async-retry", + "ava": { + "failFast": true + }, + "dependencies": { + "retry": "0.13.1" + }, + "pre-commit": "lint:staged", + "lint-staged": { + "*.js": [ + "eslint", + "prettier --write --single-quote", + "git add" + ] + }, + "eslintConfig": { + "extends": [ + "airbnb", + "prettier" + ], + "rules": { + "no-var": 0, + "prefer-arrow-callback": 0 + } + }, + "devDependencies": { + "ava": "3.15.0", + "eslint": "7.32.0", + "eslint-config-airbnb": "18.2.1", + "eslint-config-prettier": "8.3.0", + "eslint-plugin-import": "2.24.0", + "eslint-plugin-jsx-a11y": "6.4.1", + "eslint-plugin-react": "7.24.0", + "lint-staged": "11.1.2", + "node-fetch": "2.6.1", + "pre-commit": "1.2.2", + "prettier": "2.3.2", + "then-sleep": "1.0.1" + } +} diff --git a/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/retry b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/retry new file mode 120000 index 00000000..ce959fdb --- /dev/null +++ b/backend/node_modules/.pnpm/async-retry@1.3.3/node_modules/retry @@ -0,0 +1 @@ +../../retry@0.13.1/node_modules/retry \ No newline at end of file diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.eslintrc b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.eslintrc new file mode 100644 index 00000000..3b5d9e90 --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.github/FUNDING.yml b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.github/FUNDING.yml new file mode 100644 index 00000000..14abc725 --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/available-typed-arrays +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.nycrc b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/CHANGELOG.md b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/CHANGELOG.md new file mode 100644 index 00000000..f5ade9a2 --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/CHANGELOG.md @@ -0,0 +1,100 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.7](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.6...v1.0.7) - 2024-02-19 + +### Commits + +- [Refactor] use `possible-typed-array-names` [`ac86abf`](https://github.com/inspect-js/available-typed-arrays/commit/ac86abfd64c4b633fd6523cc4193f1913fd22666) + +## [v1.0.6](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.5...v1.0.6) - 2024-01-31 + +### Commits + +- [actions] reuse common workflows [`1850353`](https://github.com/inspect-js/available-typed-arrays/commit/1850353ded0ceb4d02d9d05649da5b7f3a28c89f) +- [meta] use `npmignore` to autogenerate an npmignore file [`5c7de12`](https://github.com/inspect-js/available-typed-arrays/commit/5c7de120d22a5c35f703ba3f0b5287e5c5f38af6) +- [patch] add types [`fcfb0ea`](https://github.com/inspect-js/available-typed-arrays/commit/fcfb0ea21c9dc8459d68f8bb26679abb0bec71ca) +- [actions] update codecov uploader [`d844945`](https://github.com/inspect-js/available-typed-arrays/commit/d84494596881a298aabde9bd87e538ce10c6cd01) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.every`, `safe-publish-latest`, `tape` [`a2be6f4`](https://github.com/inspect-js/available-typed-arrays/commit/a2be6f482010e920692d8f65fe1f193dbb73004d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b283a3e`](https://github.com/inspect-js/available-typed-arrays/commit/b283a3e2176fbe8e431a27e20df21c831f216d5a) +- [actions] update rebase action to use reusable workflow [`0ad1f2d`](https://github.com/inspect-js/available-typed-arrays/commit/0ad1f2d82b11713ee48d9b37cb73fcc891bd9f4a) +- [Dev Deps] update `@ljharb/eslint-config`, `array.prototype.every`, `aud`, `tape` [`cd36e81`](https://github.com/inspect-js/available-typed-arrays/commit/cd36e8131076dd4e67a88b259f829067fa56c139) +- [meta] simplify "exports" [`f696e5f`](https://github.com/inspect-js/available-typed-arrays/commit/f696e5ff9ded838e192ade4e8550a890c4f35eb0) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`bf20080`](https://github.com/inspect-js/available-typed-arrays/commit/bf200809aea3107b31fc8817122c693e099be30e) + +## [v1.0.5](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.4...v1.0.5) - 2021-08-30 + +### Fixed + +- [Refactor] use `globalThis` if available [`#12`](https://github.com/inspect-js/available-typed-arrays/issues/12) + +### Commits + +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1199790`](https://github.com/inspect-js/available-typed-arrays/commit/1199790ab5841517ad04827fab3f135d2dc5cfb7) + +## [v1.0.4](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.3...v1.0.4) - 2021-05-25 + +### Commits + +- [Refactor] Remove `array.prototype.filter` dependency [`f39c90e`](https://github.com/inspect-js/available-typed-arrays/commit/f39c90ecb1907de28ee2d3577b7da37ae12aac56) +- [Dev Deps] update `eslint`, `auto-changelog` [`b2e3a03`](https://github.com/inspect-js/available-typed-arrays/commit/b2e3a035e8cd3ddfd7b565249e1651c6419a34d0) +- [meta] create `FUNDING.yml` [`8c0e758`](https://github.com/inspect-js/available-typed-arrays/commit/8c0e758c6ec80adbb3770554653cdc3aa16beb55) +- [Tests] fix harmony test matrix [`ef96549`](https://github.com/inspect-js/available-typed-arrays/commit/ef96549df171776267529413240a2219cb59d5ce) +- [meta] add `sideEffects` flag [`288cca0`](https://github.com/inspect-js/available-typed-arrays/commit/288cca0fbd214bec706447851bb8bccc4b899a48) + +## [v1.0.3](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.2...v1.0.3) - 2021-05-19 + +### Commits + +- [Tests] migrate tests to Github Actions [`3ef082c`](https://github.com/inspect-js/available-typed-arrays/commit/3ef082caaa153b49f4c37c85bbd5c4b13fe4f638) +- [meta] do not publish github action workflow files [`fd95ffd`](https://github.com/inspect-js/available-typed-arrays/commit/fd95ffdaca759eca81cb4c5d5772ee863dfea501) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`eb6bd65`](https://github.com/inspect-js/available-typed-arrays/commit/eb6bd659a31c92a6a178c71a89fe0d5261413e6c) +- [Tests] run `nyc` on all tests [`636c946`](https://github.com/inspect-js/available-typed-arrays/commit/636c94657b532599ef90a214aaa12639d11b0161) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`70a3b61`](https://github.com/inspect-js/available-typed-arrays/commit/70a3b61367b318fb883c2f35b8f2d539849a23b6) +- [actions] add "Allow Edits" workflow [`bd09c45`](https://github.com/inspect-js/available-typed-arrays/commit/bd09c45299e396fa5bbd5be4c58b1aedcb372a82) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.every`, `aud`, `tape` [`8f97523`](https://github.com/inspect-js/available-typed-arrays/commit/8f9752308390a79068cd431436bbfd77bca15647) +- [readme] fix URLs [`75418e2`](https://github.com/inspect-js/available-typed-arrays/commit/75418e20b57f4ad5e65d8c2e1864efd14eaa2e65) +- [readme] add actions and codecov badges [`4a8bc30`](https://github.com/inspect-js/available-typed-arrays/commit/4a8bc30af2ce1f48e2b28ab3db5be9589bd6f2d0) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`65198ac`](https://github.com/inspect-js/available-typed-arrays/commit/65198ace335a013ef49b6bd722bc80bbbc6be784) +- [actions] update workflows [`7f816eb`](https://github.com/inspect-js/available-typed-arrays/commit/7f816eb231131e53ced2572ba6c6c6a00f975789) +- [Refactor] use `array.prototype.filter` instead of `array-filter` [`2dd1038`](https://github.com/inspect-js/available-typed-arrays/commit/2dd1038d71ce48b5650687691cf8fe09795a6d30) +- [actions] switch Automatic Rease workflow to `pull_request_target` event [`9b45e91`](https://github.com/inspect-js/available-typed-arrays/commit/9b45e914fcb08bdaaaa0166b41716e51f400d1c6) +- [Dev Deps] update `auto-changelog`, `tape` [`0003a5b`](https://github.com/inspect-js/available-typed-arrays/commit/0003a5b122a0724db5499c114104eeeb396b2f67) +- [meta] use `prepublishOnly` script for npm 7+ [`d884dd1`](https://github.com/inspect-js/available-typed-arrays/commit/d884dd1c1117411f35d9fbc07f513a1a85ccdead) +- [readme] remove travis badge [`9da2b3c`](https://github.com/inspect-js/available-typed-arrays/commit/9da2b3c29706340fada995137aba12cfae4d6f37) +- [Dev Deps] update `auto-changelog`; add `aud` [`41b1336`](https://github.com/inspect-js/available-typed-arrays/commit/41b13369c71b0e3e57b9de0f4fb1e4d67950d74a) +- [Tests] only audit prod deps [`2571826`](https://github.com/inspect-js/available-typed-arrays/commit/2571826a5d121eeeeccf4c711e3f9e4616685d50) + +## [v1.0.2](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.1...v1.0.2) - 2020-01-26 + +### Commits + +- [actions] add automatic rebasing / merge commit blocking [`3229a74`](https://github.com/inspect-js/available-typed-arrays/commit/3229a74bda60f24e2257efc40ddff9a3ce98de76) +- [Dev Deps] update `@ljharb/eslint-config` [`9579abe`](https://github.com/inspect-js/available-typed-arrays/commit/9579abecc196088561d3aedf27cad45b56f8e18b) +- [Fix] remove `require` condition to avoid experimental warning [`2cade6b`](https://github.com/inspect-js/available-typed-arrays/commit/2cade6b56d6a508a950c7da27d038bee496e716b) + +## [v1.0.1](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.0...v1.0.1) - 2020-01-24 + +### Commits + +- [meta] add "exports" [`5942917`](https://github.com/inspect-js/available-typed-arrays/commit/5942917aafb56c6bce80f01b7ae6a9b46bc72c69) + +## v1.0.0 - 2020-01-24 + +### Commits + +- Initial commit [`2bc5144`](https://github.com/inspect-js/available-typed-arrays/commit/2bc514459c9f65756adfbd9964abf433183d78f6) +- readme [`31e4796`](https://github.com/inspect-js/available-typed-arrays/commit/31e4796379eba4a16d3c6a8e9baf6eb3f39e33d1) +- npm init [`9194266`](https://github.com/inspect-js/available-typed-arrays/commit/9194266b471a2a2dd5e6969bc40358ceb346e21e) +- Tests [`b539830`](https://github.com/inspect-js/available-typed-arrays/commit/b539830c3213f90de42b4d6e62803f52daf61a6d) +- Implementation [`6577df2`](https://github.com/inspect-js/available-typed-arrays/commit/6577df244ea146ef5ec16858044c8955e0fc445c) +- [meta] add `auto-changelog` [`7b43310`](https://github.com/inspect-js/available-typed-arrays/commit/7b43310be76f00fe60b74a2fd6d0e46ac1d01f3e) +- [Tests] add `npm run lint` [`dedfbc1`](https://github.com/inspect-js/available-typed-arrays/commit/dedfbc1592f86ac1636267d3965f2345df43815b) +- [Tests] use shared travis-ci configs [`c459d78`](https://github.com/inspect-js/available-typed-arrays/commit/c459d78bf2efa9d777f88599ae71a796dbfcb70f) +- Only apps should have lockfiles [`d294668`](https://github.com/inspect-js/available-typed-arrays/commit/d294668422cf35f5e7716a85bfd204e62b01c056) +- [meta] add `funding` field [`6e70bc1`](https://github.com/inspect-js/available-typed-arrays/commit/6e70bc1fb199c7898165aaf05c25bb49f4062e53) +- [meta] add `safe-publish-latest` [`dd89ca2`](https://github.com/inspect-js/available-typed-arrays/commit/dd89ca2c6842f0f3e82958df2b2bd0fc0c929c51) diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/LICENSE b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/LICENSE new file mode 100644 index 00000000..707437b5 --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Inspect JS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/README.md b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/README.md new file mode 100644 index 00000000..df6f5864 --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/README.md @@ -0,0 +1,55 @@ +# available-typed-arrays [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Returns an array of Typed Array names that are available in the current environment. + +## Example + +```js +var availableTypedArrays = require('available-typed-arrays'); +var assert = require('assert'); + +assert.deepStrictEqual( + availableTypedArrays().sort(), + [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' + ].sort() +); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/available-typed-arrays +[2]: https://versionbadg.es/inspect-js/available-typed-arrays.svg +[5]: https://david-dm.org/inspect-js/available-typed-arrays.svg +[6]: https://david-dm.org/inspect-js/available-typed-arrays +[7]: https://david-dm.org/inspect-js/available-typed-arrays/dev-status.svg +[8]: https://david-dm.org/inspect-js/available-typed-arrays#info=devDependencies +[11]: https://nodei.co/npm/available-typed-arrays.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/available-typed-arrays.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/available-typed-arrays.svg +[downloads-url]: https://npm-stat.com/charts.html?package=available-typed-arrays +[codecov-image]: https://codecov.io/gh/inspect-js/available-typed-arrays/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/available-typed-arrays/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/available-typed-arrays +[actions-url]: https://github.com/inspect-js/available-typed-arrays/actions diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.d.ts b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.d.ts new file mode 100644 index 00000000..c21e1c49 --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.d.ts @@ -0,0 +1,8 @@ +type AllPossibleTypedArrays = typeof import('possible-typed-array-names'); + +declare function availableTypedArrays(): + | [] + | AllPossibleTypedArrays + | Omit; + +export = availableTypedArrays; diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js new file mode 100644 index 00000000..125f000c --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var possibleNames = require('possible-typed-array-names'); + +var g = typeof globalThis === 'undefined' ? global : globalThis; + +/** @type {import('.')} */ +module.exports = function availableTypedArrays() { + var /** @type {ReturnType} */ out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === 'function') { + // @ts-expect-error + out[out.length] = possibleNames[i]; + } + } + return out; +}; diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/package.json b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/package.json new file mode 100644 index 00000000..9b4e245e --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/package.json @@ -0,0 +1,93 @@ +{ + "name": "available-typed-arrays", + "version": "1.0.7", + "description": "Returns an array of Typed Array names that are available in the current environment", + "main": "index.js", + "type": "commonjs", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test:harmony": "nyc node --harmony --es-staging test", + "test": "npm run tests-only && npm run test:harmony", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/available-typed-arrays.git" + }, + "keywords": [ + "typed", + "arrays", + "Float32Array", + "Float64Array", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "BigInt64Array", + "BigUint64Array" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/available-typed-arrays/issues" + }, + "homepage": "https://github.com/inspect-js/available-typed-arrays#readme", + "engines": { + "node": ">= 0.4" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/array.prototype.every": "^1.1.1", + "@types/isarray": "^2.0.2", + "@types/tape": "^5.6.4", + "array.prototype.every": "^1.1.5", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "isarray": "^2.0.5", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "^5.4.0-dev.20240131" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + } +} diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/test/index.js b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/test/index.js new file mode 100644 index 00000000..21c986dc --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/test/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); +var isArray = require('isarray'); +var every = require('array.prototype.every'); + +var availableTypedArrays = require('../'); + +test('available typed arrays', function (t) { + t.equal(typeof availableTypedArrays, 'function', 'is a function'); + + var arrays = availableTypedArrays(); + t.equal(isArray(arrays), true, 'returns an array'); + + t.equal(every(arrays, function (array) { return typeof array === 'string'; }), true, 'contains only strings'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/tsconfig.json b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/tsconfig.json new file mode 100644 index 00000000..fdab34fe --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/tsconfig.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + + /* Completeness */ + //"skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage" + ] +} diff --git a/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/possible-typed-array-names b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/possible-typed-array-names new file mode 120000 index 00000000..4f3551d9 --- /dev/null +++ b/backend/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/possible-typed-array-names @@ -0,0 +1 @@ +../../possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/LICENSE b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/LICENSE new file mode 100644 index 00000000..386b7b69 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/README.md b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/README.md new file mode 100644 index 00000000..335743d2 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/README.md @@ -0,0 +1,509 @@ +# body-parser + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +Node.js body parsing middleware. + +Parse incoming request bodies in a middleware before your handlers, available +under the `req.body` property. + +**Note** As `req.body`'s shape is based on user-controlled input, all +properties and values in this object are untrusted and should be validated +before trusting. For example, `req.body.foo.toString()` may fail in multiple +ways, for example the `foo` property may not be there or may not be a string, +and `toString` may not be a function and instead a string or other user input. + +[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/learn/http/anatomy-of-an-http-transaction). + +_This does not handle multipart bodies_, due to their complex and typically +large nature. For multipart bodies, you may be interested in the following +modules: + + * [busboy](https://www.npmjs.com/package/busboy#readme) and + [connect-busboy](https://www.npmjs.com/package/connect-busboy#readme) + * [multiparty](https://www.npmjs.com/package/multiparty#readme) and + [connect-multiparty](https://www.npmjs.com/package/connect-multiparty#readme) + * [formidable](https://www.npmjs.com/package/formidable#readme) + * [multer](https://www.npmjs.com/package/multer#readme) + +This module provides the following parsers: + + * [JSON body parser](#bodyparserjsonoptions) + * [Raw body parser](#bodyparserrawoptions) + * [Text body parser](#bodyparsertextoptions) + * [URL-encoded form body parser](#bodyparserurlencodedoptions) + +Other body parsers you might be interested in: + +- [body](https://www.npmjs.com/package/body#readme) +- [co-body](https://www.npmjs.com/package/co-body#readme) + +## Installation + +```sh +$ npm install body-parser +``` + +## API + +```js +// Import all parsers +const bodyParser = require('body-parser') + +// Or import individual parsers directly +const json = require('body-parser/json') +const urlencoded = require('body-parser/urlencoded') +const raw = require('body-parser/raw') +const text = require('body-parser/text') +``` + +The `bodyParser` object exposes various factories to create middlewares. All +middlewares will populate the `req.body` property with the parsed body when +the `Content-Type` request header matches the `type` option. + +The various errors returned by this module are described in the +[errors section](#errors). + +### bodyParser.json([options]) + +Returns middleware that only parses `json` and only looks at requests where +the `Content-Type` header matches the `type` option. This parser accepts any +Unicode encoding of the body and supports automatic inflation of `gzip`, +`br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). + +#### Options + +The `json` function takes an optional `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the json content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### reviver + +The `reviver` option is passed directly to `JSON.parse` as the second +argument. You can find more information on this argument +[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#the_reviver_parameter). + +##### strict + +When set to `true`, will only accept arrays and objects; when `false` will +accept anything `JSON.parse` accepts. Defaults to `true`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not a +function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +be an extension name (like `json`), a mime type (like `application/json`), or +a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a truthy +value. Defaults to `application/json`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.raw([options]) + +Returns middleware that parses all bodies as a `Buffer` and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a `Buffer` object +of the body. + +#### Options + +The `raw` function takes an optional `options` object that may contain any of +the following keys: + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. +If not a function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this +can be an extension name (like `bin`), a mime type (like +`application/octet-stream`), or a mime type with a wildcard (like `*/*` or +`application/*`). If a function, the `type` option is called as `fn(req)` +and the request is parsed if it returns a truthy value. Defaults to +`application/octet-stream`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.text([options]) + +Returns middleware that parses all bodies as a string and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` string containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a string of the +body. + +#### Options + +The `text` function takes an optional `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the text content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +be an extension name (like `txt`), a mime type (like `text/plain`), or a mime +type with a wildcard (like `*/*` or `text/*`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a +truthy value. Defaults to `text/plain`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.urlencoded([options]) + +Returns middleware that only parses `urlencoded` bodies and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser accepts only UTF-8 and ISO-8859-1 encodings of the body and supports +automatic inflation of `gzip`, `br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This object will contain +key-value pairs, where the value can be a string or array (when `extended` is +`false`), or any type (when `extended` is `true`). + +#### Options + +The `urlencoded` function takes an optional `options` object that may contain +any of the following keys: + +##### extended + +The "extended" syntax allows for rich objects and arrays to be encoded into the +URL-encoded format, allowing for a JSON-like experience with URL-encoded. For +more information, please [see the qs +library](https://www.npmjs.com/package/qs#readme). + +Defaults to `false`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### parameterLimit + +The `parameterLimit` option controls the maximum number of parameters that +are allowed in the URL-encoded data. If a request contains more parameters +than this value, a 413 will be returned to the client. Defaults to `1000`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +be an extension name (like `urlencoded`), a mime type (like +`application/x-www-form-urlencoded`), or a mime type with a wildcard (like +`*/x-www-form-urlencoded`). If a function, the `type` option is called as +`fn(req)` and the request is parsed if it returns a truthy value. Defaults +to `application/x-www-form-urlencoded`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +##### defaultCharset + +The default charset to parse as, if not specified in content-type. Must be +either `utf-8` or `iso-8859-1`. Defaults to `utf-8`. + +##### charsetSentinel + +Whether to let the value of the `utf8` parameter take precedence as the charset +selector. It requires the form to contain a parameter named `utf8` with a value +of `✓`. Defaults to `false`. + +##### interpretNumericEntities + +Whether to decode numeric entities such as `☺` when parsing an iso-8859-1 +form. Defaults to `false`. + + +##### depth + +The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible. + +## Errors + +The middlewares provided by this module create errors using the +[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors +will typically have a `status`/`statusCode` property that contains the suggested +HTTP response code, an `expose` property to determine if the `message` property +should be displayed to the client, a `type` property to determine the type of +error without matching against the `message`, and a `body` property containing +the read body, if available. + +The following are the common errors created, though any error can come through +for various reasons. + +### content encoding unsupported + +This error will occur when the request had a `Content-Encoding` header that +contained an encoding but the "inflation" option was set to `false`. The +`status` property is set to `415`, the `type` property is set to +`'encoding.unsupported'`, and the `charset` property will be set to the +encoding that is unsupported. + +### entity parse failed + +This error will occur when the request contained an entity that could not be +parsed by the middleware. The `status` property is set to `400`, the `type` +property is set to `'entity.parse.failed'`, and the `body` property is set to +the entity value that failed parsing. + +### entity verify failed + +This error will occur when the request contained an entity that could not be +failed verification by the defined `verify` option. The `status` property is +set to `403`, the `type` property is set to `'entity.verify.failed'`, and the +`body` property is set to the entity value that failed verification. + +### request aborted + +This error will occur when the request is aborted by the client before reading +the body has finished. The `received` property will be set to the number of +bytes received before the request was aborted and the `expected` property is +set to the number of expected bytes. The `status` property is set to `400` +and `type` property is set to `'request.aborted'`. + +### request entity too large + +This error will occur when the request body's size is larger than the "limit" +option. The `limit` property will be set to the byte limit and the `length` +property will be set to the request body's length. The `status` property is +set to `413` and the `type` property is set to `'entity.too.large'`. + +### request size did not match content length + +This error will occur when the request's length did not match the length from +the `Content-Length` header. This typically occurs when the request is malformed, +typically when the `Content-Length` header was calculated based on characters +instead of bytes. The `status` property is set to `400` and the `type` property +is set to `'request.size.invalid'`. + +### stream encoding should not be set + +This error will occur when something called the `req.setEncoding` method prior +to this middleware. This module operates directly on bytes only and you cannot +call `req.setEncoding` when using this module. The `status` property is set to +`500` and the `type` property is set to `'stream.encoding.set'`. + +### stream is not readable + +This error will occur when the request is no longer readable when this middleware +attempts to read it. This typically means something other than a middleware from +this module read the request body already and the middleware was also configured to +read the same request. The `status` property is set to `500` and the `type` +property is set to `'stream.not.readable'`. + +### too many parameters + +This error will occur when the content of the request exceeds the configured +`parameterLimit` for the `urlencoded` parser. The `status` property is set to +`413` and the `type` property is set to `'parameters.too.many'`. + +### unsupported charset "BOGUS" + +This error will occur when the request had a charset parameter in the +`Content-Type` header, but the `iconv-lite` module does not support it OR the +parser does not support it. The charset is contained in the message as well +as in the `charset` property. The `status` property is set to `415`, the +`type` property is set to `'charset.unsupported'`, and the `charset` property +is set to the charset that is unsupported. + +### unsupported content encoding "bogus" + +This error will occur when the request had a `Content-Encoding` header that +contained an unsupported encoding. The encoding is contained in the message +as well as in the `encoding` property. The `status` property is set to `415`, +the `type` property is set to `'encoding.unsupported'`, and the `encoding` +property is set to the encoding that is unsupported. + +### The input exceeded the depth + +This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown. + +## Examples + +### Express/Connect top-level generic + +This example demonstrates adding a generic JSON and URL-encoded parser as a +top-level middleware, which will parse the bodies of all incoming requests. +This is the simplest setup. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse application/x-www-form-urlencoded +app.use(bodyParser.urlencoded()) + +// parse application/json +app.use(bodyParser.json()) + +app.use(function (req, res) { + res.setHeader('Content-Type', 'text/plain') + res.write('you posted:\n') + res.end(String(JSON.stringify(req.body, null, 2))) +}) +``` + +### Express route-specific + +This example demonstrates adding body parsers specifically to the routes that +need them. In general, this is the most recommended way to use body-parser with +Express. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// create application/json parser +const jsonParser = bodyParser.json() + +// create application/x-www-form-urlencoded parser +const urlencodedParser = bodyParser.urlencoded() + +// POST /login gets urlencoded bodies +app.post('/login', urlencodedParser, function (req, res) { + if (!req.body || !req.body.username) res.sendStatus(400) + res.send('welcome, ' + req.body.username) +}) + +// POST /api/users gets JSON bodies +app.post('/api/users', jsonParser, function (req, res) { + if (!req.body) res.sendStatus(400) + // create user in req.body +}) +``` + +### Change accepted type for parsers + +All the parsers accept a `type` option which allows you to change the +`Content-Type` that the middleware will parse. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse various different custom JSON types as JSON +app.use(bodyParser.json({ type: 'application/*+json' })) + +// parse some custom thing into a Buffer +app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) + +// parse an HTML body into a string +app.use(bodyParser.text({ type: 'text/html' })) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/body-parser/ci.yml?branch=master&label=ci +[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml +[coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/body-parser?branch=master +[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master +[npm-downloads-image]: https://img.shields.io/npm/dm/body-parser +[npm-url]: https://npmjs.com/package/body-parser +[npm-version-image]: https://img.shields.io/npm/v/body-parser +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/index.js b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/index.js new file mode 100644 index 00000000..c0526e16 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/index.js @@ -0,0 +1,55 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * @typedef {Object} Parsers + * @property {Function} json JSON parser + * @property {Function} raw Raw parser + * @property {Function} text Text parser + * @property {Function} urlencoded URL-encoded parser + */ + +/** + * Module exports. + * @type {Function & Parsers} + */ +exports = module.exports = bodyParser + +/** + * JSON parser. + * @public + */ +exports.json = require('./lib/types/json') + +/** + * Raw parser. + * @public + */ +exports.raw = require('./lib/types/raw') + +/** + * Text parser. + * @public + */ +exports.text = require('./lib/types/text') + +/** + * URL-encoded parser. + * @public + */ +exports.urlencoded = require('./lib/types/urlencoded') + +/** + * Create a middleware to parse json and urlencoded bodies. + * + * @deprecated + * @public + */ +function bodyParser () { + throw new Error('The bodyParser() generic has been split into individual middleware to use instead.') +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/read.js b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/read.js new file mode 100644 index 00000000..bf1a1df4 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/read.js @@ -0,0 +1,247 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const createError = require('http-errors') +const getBody = require('raw-body') +const iconv = require('iconv-lite') +const onFinished = require('on-finished') +const zlib = require('node:zlib') +const hasBody = require('type-is').hasBody +const { getCharset } = require('./utils') + +/** + * Module exports. + */ + +module.exports = read + +/** + * Read a request into a buffer and parse. + * + * @param {Object} req + * @param {Object} res + * @param {Function} next + * @param {Function} parse + * @param {Function} debug + * @param {Object} options + * @private + */ +function read (req, res, next, parse, debug, options) { + if (onFinished.isFinished(req)) { + debug('body already parsed') + next() + return + } + + if (!('body' in req)) { + req.body = undefined + } + + // skip requests without bodies + if (!hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!options.shouldParse(req)) { + debug('skip parsing') + next() + return + } + + let encoding = null + if (options?.skipCharset !== true) { + encoding = getCharset(req) || options.defaultCharset + + // validate charset + if (!!options?.isValidCharset && !options.isValidCharset(encoding)) { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding, + type: 'charset.unsupported' + })) + return + } + } + + let length + const opts = options + let stream + + // read options + const verify = opts.verify + + try { + // get the content stream + stream = contentstream(req, debug, opts.inflate) + length = stream.length + stream.length = undefined + } catch (err) { + return next(err) + } + + // set raw-body options + opts.length = length + opts.encoding = verify + ? null + : encoding + + // assert charset is supported + if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { + return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + })) + } + + // read body + debug('read body') + getBody(stream, opts, function (error, body) { + if (error) { + let _error + + if (error.type === 'encoding.unsupported') { + // echo back charset + _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + }) + } else { + // set status code on error + _error = createError(400, error) + } + + // unpipe from stream and destroy + if (stream !== req) { + req.unpipe() + stream.destroy() + } + + // read off entire request + dump(req, function onfinished () { + next(createError(400, _error)) + }) + return + } + + // verify + if (verify) { + try { + debug('verify body') + verify(req, res, body, encoding) + } catch (err) { + next(createError(403, err, { + body: body, + type: err.type || 'entity.verify.failed' + })) + return + } + } + + // parse + let str = body + try { + debug('parse body') + str = typeof body !== 'string' && encoding !== null + ? iconv.decode(body, encoding) + : body + req.body = parse(str, encoding) + } catch (err) { + next(createError(400, err, { + body: str, + type: err.type || 'entity.parse.failed' + })) + return + } + + next() + }) +} + +/** + * Get the content stream of the request. + * + * @param {Object} req + * @param {Function} debug + * @param {boolean} inflate + * @returns {Object} + * @private + */ +function contentstream (req, debug, inflate) { + const encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() + const length = req.headers['content-length'] + + debug('content-encoding "%s"', encoding) + + if (inflate === false && encoding !== 'identity') { + throw createError(415, 'content encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } + + if (encoding === 'identity') { + req.length = length + return req + } + + const stream = createDecompressionStream(encoding, debug) + req.pipe(stream) + return stream +} + +/** + * Create a decompression stream for the given encoding. + * @param {string} encoding + * @param {Function} debug + * @returns {Object} + * @private + */ +function createDecompressionStream (encoding, debug) { + switch (encoding) { + case 'deflate': + debug('inflate body') + return zlib.createInflate() + case 'gzip': + debug('gunzip body') + return zlib.createGunzip() + case 'br': + debug('brotli decompress body') + return zlib.createBrotliDecompress() + default: + throw createError(415, 'unsupported content encoding "' + encoding + '"', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } +} + +/** + * Dump the contents of a request. + * + * @param {Object} req + * @param {Function} callback + * @private + */ +function dump (req, callback) { + if (onFinished.isFinished(req)) { + callback(null) + } else { + onFinished(req, callback) + req.resume() + } +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/json.js b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/json.js new file mode 100644 index 00000000..14ca3e49 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/json.js @@ -0,0 +1,186 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const debug = require('debug')('body-parser:json') +const read = require('../read') +const { normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = json + +/** + * RegExp to match the first non-space in a string. + * + * Allowed whitespace is defined in RFC 7159: + * + * ws = *( + * %x20 / ; Space + * %x09 / ; Horizontal tab + * %x0A / ; Line feed or New line + * %x0D ) ; Carriage return + */ +const FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex + +const JSON_SYNTAX_CHAR = '#' +const JSON_SYNTAX_REGEXP = /#+/g + +/** + * Create a middleware to parse JSON bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function json (options) { + const normalizedOptions = normalizeOptions(options, 'application/json') + + const parse = createJsonParser(options) + + const readOptions = { + ...normalizedOptions, + // assert charset per RFC 7159 sec 8.1 + isValidCharset: (charset) => charset.slice(0, 4) === 'utf-' + } + + return function jsonParser (req, res, next) { + read(req, res, next, parse, debug, readOptions) + } +} + +/** + * Create a JSON parse function + * + * @param {object} [options] + * @return {function} + * @private + */ +function createJsonParser (options) { + const reviver = options?.reviver + const strict = options?.strict !== false + + if (strict) { + return function parse (body) { + if (body.length === 0) { + // special-case empty json body, as it's a common client-side mistake + // TODO: maybe make this configurable or part of "strict" option + return {} + } + + const first = firstchar(body) + if (first !== '{' && first !== '[') { + debug('strict violation') + throw createStrictSyntaxError(body, first) + } + + try { + debug('parse json') + return JSON.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, + stack: e.stack + }) + } + } + } + + return function parse (body) { + if (body.length === 0) { + // special-case empty json body, as it's a common client-side mistake + // TODO: maybe make this configurable or part of "strict" option + return {} + } + + try { + debug('parse json') + return JSON.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, + stack: e.stack + }) + } + } +} + +/** + * Create strict violation syntax error matching native error. + * + * @param {string} str + * @param {string} char + * @returns {Error} + * @private + */ +function createStrictSyntaxError (str, char) { + const index = str.indexOf(char) + let partial = '' + + if (index !== -1) { + partial = str.substring(0, index) + JSON_SYNTAX_CHAR.repeat(str.length - index) + } + + try { + JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') + } catch (e) { + return normalizeJsonSyntaxError(e, { + message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) { + return str.substring(index, index + placeholder.length) + }), + stack: e.stack + }) + } +} + +/** + * Get the first non-whitespace character in a string. + * + * @param {string} str + * @returns {string|undefined} + * @private + */ +function firstchar (str) { + const match = FIRST_CHAR_REGEXP.exec(str) + + return match + ? match[1] + : undefined +} + +/** + * Normalize a SyntaxError for JSON.parse. + * + * @param {SyntaxError} error + * @param {Object} obj + * @returns {SyntaxError} + * @private + */ +function normalizeJsonSyntaxError (error, obj) { + const keys = Object.getOwnPropertyNames(error) + + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + if (key !== 'stack' && key !== 'message') { + delete error[key] + } + } + + // replace stack before message for Node.js 0.10 and below + error.stack = obj.stack.replace(error.message, obj.message) + error.message = obj.message + + return error +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/raw.js b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/raw.js new file mode 100644 index 00000000..c84083b0 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/raw.js @@ -0,0 +1,42 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + */ + +const debug = require('debug')('body-parser:raw') +const read = require('../read') +const { normalizeOptions, passthrough } = require('../utils') + +/** + * Module exports. + */ + +module.exports = raw + +/** + * Create a middleware to parse raw bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function raw (options) { + const normalizedOptions = normalizeOptions(options, 'application/octet-stream') + + const readOptions = { + ...normalizedOptions, + // Skip charset validation and parse the body as is + skipCharset: true + } + + return function rawParser (req, res, next) { + read(req, res, next, passthrough, debug, readOptions) + } +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/text.js b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/text.js new file mode 100644 index 00000000..893c8012 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/text.js @@ -0,0 +1,36 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + */ + +const debug = require('debug')('body-parser:text') +const read = require('../read') +const { normalizeOptions, passthrough } = require('../utils') + +/** + * Module exports. + */ + +module.exports = text + +/** + * Create a middleware to parse text bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function text (options) { + const normalizedOptions = normalizeOptions(options, 'text/plain') + + return function textParser (req, res, next) { + read(req, res, next, passthrough, debug, normalizedOptions) + } +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/urlencoded.js b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/urlencoded.js new file mode 100644 index 00000000..1db964cb --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/types/urlencoded.js @@ -0,0 +1,138 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const createError = require('http-errors') +const debug = require('debug')('body-parser:urlencoded') +const read = require('../read') +const qs = require('qs') +const { normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = urlencoded + +/** + * Create a middleware to parse urlencoded bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function urlencoded (options) { + const normalizedOptions = normalizeOptions(options, 'application/x-www-form-urlencoded') + + if (normalizedOptions.defaultCharset !== 'utf-8' && normalizedOptions.defaultCharset !== 'iso-8859-1') { + throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1') + } + + // create the appropriate query parser + const parse = createQueryParser(options) + + const readOptions = { + ...normalizedOptions, + // assert charset + isValidCharset: (charset) => charset === 'utf-8' || charset === 'iso-8859-1' + } + + return function urlencodedParser (req, res, next) { + read(req, res, next, parse, debug, readOptions) + } +} + +/** + * Get the extended query parser. + * + * @param {Object} options + * @returns {Function} + * @private + */ +function createQueryParser (options) { + const extended = Boolean(options?.extended) + let parameterLimit = options?.parameterLimit !== undefined + ? options?.parameterLimit + : 1000 + const charsetSentinel = options?.charsetSentinel + const interpretNumericEntities = options?.interpretNumericEntities + const depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0 + + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError('option parameterLimit must be a positive number') + } + + if (isNaN(depth) || depth < 0) { + throw new TypeError('option depth must be a zero or a positive number') + } + + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0 + } + + return function parse (body, encoding) { + if (!body.length) return {} + + const paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { + debug('too many parameters') + throw createError(413, 'too many parameters', { + type: 'parameters.too.many' + }) + } + + const arrayLimit = extended ? Math.max(100, paramCount) : paramCount + + debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding') + try { + return qs.parse(body, { + allowPrototypes: true, + arrayLimit: arrayLimit, + depth: depth, + charsetSentinel: charsetSentinel, + interpretNumericEntities: interpretNumericEntities, + charset: encoding, + parameterLimit: parameterLimit, + strictDepth: true + }) + } catch (err) { + if (err instanceof RangeError) { + throw createError(400, 'The input exceeded the depth', { + type: 'querystring.parse.rangeError' + }) + } else { + throw err + } + } + } +} + +/** + * Count the number of parameters, stopping once limit reached + * + * @param {string} body + * @param {number} limit + * @returns {number|undefined} Returns undefined if limit exceeded + * @private + */ +function parameterCount (body, limit) { + let count = 0 + let index = -1 + do { + count++ + if (count > limit) return undefined // Early exit if limit exceeded + index = body.indexOf('&', index + 1) + } while (index !== -1) + return count +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/utils.js b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/utils.js new file mode 100644 index 00000000..7a0dda43 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/lib/utils.js @@ -0,0 +1,100 @@ +'use strict' + +/** + * Module dependencies. + */ + +const bytes = require('bytes') +const contentType = require('content-type') +const typeis = require('type-is') + +/** + * Module exports. + */ +module.exports = { + getCharset, + normalizeOptions, + passthrough +} + +/** + * Get the charset of a request. + * + * @param {Object} req + * @returns {string | undefined} + * @private + */ +function getCharset (req) { + const header = req.headers['content-type'] + if (!header) return undefined + return contentType.parse(header).parameters.charset?.toLowerCase() +} + +/** + * Get the simple type checker. + * + * @param {string | string[]} type + * @returns {Function} + * @private + */ +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} + +/** + * Normalizes the common options for all parsers. + * + * @param {Object} options options to normalize + * @param {string | string[] | Function} defaultType default content type(s) or a function to determine it + * @returns {Object} + * @private + */ +function normalizeOptions (options, defaultType) { + if (!defaultType) { + // Parsers must define a default content type + throw new TypeError('defaultType must be provided') + } + + const inflate = options?.inflate !== false + const limit = typeof options?.limit === 'undefined' || options?.limit === null + ? 102400 // 100kb default + : bytes.parse(options.limit) + const type = options?.type || defaultType + const verify = options?.verify || false + const defaultCharset = options?.defaultCharset || 'utf-8' + + if (limit === null) { + throw new TypeError(`option limit "${String(options.limit)}" is invalid`) + } + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + const shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + return { + inflate, + limit, + verify, + defaultCharset, + shouldParse + } +} + +/** + * Passthrough function that returns input unchanged. + * Used by parsers that don't need to transform the data. + * + * @param {*} value + * @returns {*} + * @private + */ +function passthrough (value) { + return value +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/package.json b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/package.json new file mode 100644 index 00000000..842cfbdb --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/body-parser/package.json @@ -0,0 +1,65 @@ +{ + "name": "body-parser", + "description": "Node.js body parsing middleware", + "version": "2.3.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "expressjs/body-parser", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "type": "commonjs", + "exports": { + ".": "./index.js", + "./package.json": "./package.json", + "./json": "./lib/types/json.js", + "./raw": "./lib/types/raw.js", + "./text": "./lib/types/text.js", + "./urlencoded": "./lib/types/urlencoded.js", + "./lib/*": "./lib/*.js", + "./lib/*.js": "./lib/*.js", + "./lib/types/*": "./lib/types/*.js", + "./lib/types/*.js": "./lib/types/*.js" + }, + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^2.0.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", + "on-finished": "^2.4.1", + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "devDependencies": { + "eslint": "^8.57.1", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-markdown": "^3.0.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.6.0", + "eslint-plugin-standard": "^4.1.0", + "mocha": "^11.7.6", + "nyc": "^17.1.0", + "supertest": "^7.2.2" + }, + "files": [ + "lib/", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/bytes b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/bytes new file mode 120000 index 00000000..e5d8785b --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/bytes @@ -0,0 +1 @@ +../../bytes@3.1.2/node_modules/bytes \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/content-type b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/content-type new file mode 120000 index 00000000..5850a329 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/content-type @@ -0,0 +1 @@ +../../content-type@2.1.0/node_modules/content-type \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/debug b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/debug new file mode 120000 index 00000000..6b438e1c --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/debug @@ -0,0 +1 @@ +../../debug@4.4.3/node_modules/debug \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/http-errors b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/http-errors new file mode 120000 index 00000000..f0620318 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/http-errors @@ -0,0 +1 @@ +../../http-errors@2.0.1/node_modules/http-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/iconv-lite b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/iconv-lite new file mode 120000 index 00000000..b029e037 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/iconv-lite @@ -0,0 +1 @@ +../../iconv-lite@0.7.3/node_modules/iconv-lite \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/on-finished b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/on-finished new file mode 120000 index 00000000..b66b17c9 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/on-finished @@ -0,0 +1 @@ +../../on-finished@2.4.1/node_modules/on-finished \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/qs b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/qs new file mode 120000 index 00000000..5aa61272 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/qs @@ -0,0 +1 @@ +../../qs@6.16.0/node_modules/qs \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/raw-body b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/raw-body new file mode 120000 index 00000000..c7282b0d --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/raw-body @@ -0,0 +1 @@ +../../raw-body@3.0.2/node_modules/raw-body \ No newline at end of file diff --git a/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/type-is b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/type-is new file mode 120000 index 00000000..c3da7d38 --- /dev/null +++ b/backend/node_modules/.pnpm/body-parser@2.3.0/node_modules/type-is @@ -0,0 +1 @@ +../../type-is@2.1.0/node_modules/type-is \ No newline at end of file diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/LICENSE.md b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/LICENSE.md new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/LICENSE.md @@ -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/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/README.md b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/README.md new file mode 100644 index 00000000..ff3bb287 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/README.md @@ -0,0 +1,321 @@ +# BSON parser + +BSON is short for "Binary JSON," and is the binary-encoded serialization of JSON-like documents. +You can learn more about it in [the specification](http://bsonspec.org). + +### Table of Contents + +- [Usage](#usage) +- [Bugs/Feature Requests](#bugs--feature-requests) +- [Installation](#installation) +- [Documentation](#documentation) +- [FAQ](#faq) + + +### Release Integrity + +Releases are created automatically and signed using the [Node team's GPG key](https://pgp.mongodb.com/node-driver.asc). All release packages provided as part of a GitHub release are signed. To verify the provided packages, download the key and import it using gpg: + +```shell +gpg --import node-driver.asc +``` + +The GitHub release contains a detached signature file for the NPM package (named +`bson-X.Y.Z.tgz.sig`). + +The following command returns the link npm package. +```shell +npm view bson@vX.Y.Z dist.tarball +``` + +Using the result of the above command, a `curl` command can return the official npm package for the release. + +To verify the integrity of the downloaded package, run the following command: +```shell +gpg --verify bson-X.Y.Z.tgz.sig bson-X.Y.Z.tgz +``` + +>[!Note] +No GPG verification is done when using npm to install the package. The contents of the GitHub tarball and npm's tarball are identical. + +Releases published to the npm registry also include a [provenance attestation](https://docs.npmjs.com/generating-provenance-statements), which cryptographically links the package to its source repository and build workflow. To verify provenance: + +```shell +npm audit signatures +``` + +## Bugs / Feature Requests + +Think you've found a bug? Want to see a new feature in `bson`? Please open a case in our issue management tool, JIRA: + +1. Create an account and login: [jira.mongodb.org](https://jira.mongodb.org) +2. Navigate to the NODE project: [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE) +3. Click **Create Issue** - Please provide as much information as possible about the issue and how to reproduce it. + +Bug reports in JIRA for the NODE driver project are **public**. + +## Usage + +To build a new version perform the following operations: + +``` +npm install +npm run build +``` + +### Node.js or Bundling Usage + +When using a bundler or Node.js you can import bson using the package name: + +```js +import { BSON, EJSON, ObjectId } from 'bson'; +// or: +// const { BSON, EJSON, ObjectId } = require('bson'); + +const bytes = BSON.serialize({ _id: new ObjectId() }); +console.log(bytes); +const doc = BSON.deserialize(bytes); +console.log(EJSON.stringify(doc)); +// {"_id":{"$oid":"..."}} +``` + +### Browser Usage + +If you are working directly in the browser without a bundler please use the `.mjs` bundle like so: + +```html + +``` + +## AI Agent Configuration + +This repository uses [agentskills.io](https://agentskills.io) conventions for AI coding agent +instructions. `AGENTS.md` is the canonical source of truth — tool-specific files like `CLAUDE.md` +are generated references. + +### Adding a nested AGENTS.md + +1. Create an `AGENTS.md` in the target directory. +2. `git add` the file. +3. Run `scripts/symlink-claude-md.sh` to generate the companion `CLAUDE.md`. + - Note: `scripts/symlink-claude-md.sh` is vendored from an [internal repo](https://github.com/10gen/mongohouse/blob/master/scripts/symlink-claude-md.sh) and should not be edited directly. +4. Stage and commit the files. + +## Installation + +```sh +npm install bson +``` + +### MongoDB Node.js Driver Version Compatibility + +Only the following version combinations with the [MongoDB Node.js Driver](https://github.com/mongodb/node-mongodb-native) are considered stable. + +| | `bson@1.x` | `bson@4.x` | `bson@5.x` | `bson@6.x` | `bson@7.x` | +| ------------- | ---------- | ---------- | ---------- | ---------- | ---------- | +| `mongodb@7.x` | N/A | N/A | N/A | N/A | ✓ | +| `mongodb@6.x` | N/A | N/A | N/A | ✓ | N/A | +| `mongodb@5.x` | N/A | N/A | ✓ | N/A | N/A | +| `mongodb@4.x` | N/A | ✓ | N/A | N/A | N/A | +| `mongodb@3.x` | ✓ | N/A | N/A | N/A | N/A | + +## Documentation + +### BSON + +[API documentation](https://mongodb.github.io/node-mongodb-native/Next/modules/BSON.html) + + + +### EJSON + +- [EJSON](#EJSON) + + - [.parse(text, [options])](#EJSON.parse) + + - [.stringify(value, [replacer], [space], [options])](#EJSON.stringify) + + - [.serialize(bson, [options])](#EJSON.serialize) + + - [.deserialize(ejson, [options])](#EJSON.deserialize) + + + +#### _EJSON_.parse(text, [options]) + +| Param | Type | Default | Description | +| ----------------- | -------------------- | ----------------- | ---------------------------------------------------------------------------------- | +| text | string | | | +| [options] | object | | Optional settings | +| [options.relaxed] | boolean | true | Attempt to return native JS types where possible, rather than BSON types (if true) | + +Parse an Extended JSON string, constructing the JavaScript value or object described by that +string. + +> [!WARNING] +> If you use the result of `EJSON.parse()` in a query, update, or command, an attacker +> can inject operators or unexpected field values that change the meaning of the +> operation. This risk is greatest when the input text originates from a source that +> your application does not control. Validate untrusted input before parsing it. +> To learn more about validating input before conversion and other security best +> practices for client libraries, see the [Client Libraries Best +> Practices](https://www.mongodb.com/docs/drivers/client-libraries-best-practices/) +> page in the MongoDB documentation. + +**Example** + +```js +const { EJSON } = require('bson'); +const text = '{ "int32": { "$numberInt": "10" } }'; + +// prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } +console.log(EJSON.parse(text, { relaxed: false })); + +// prints { int32: 10 } +console.log(EJSON.parse(text)); +``` + + + +#### _EJSON_.stringify(value, [replacer], [space], [options]) + +| Param | Type | Default | Description | +| ----------------- | ------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | object | | The value to convert to extended JSON | +| [replacer] | function \| array | | A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string | +| [space] | string \| number | | A String or Number object that's used to insert white space into the output JSON string for readability purposes. | +| [options] | object | | Optional settings | +| [options.relaxed] | boolean | true | Enabled Extended JSON's `relaxed` mode | +| [options.legacy] | boolean | true | Output in Extended JSON v1 | + +Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer +function is specified or optionally including only the specified properties if a replacer array +is specified. + +**Example** + +```js +const { EJSON } = require('bson'); +const Int32 = require('mongodb').Int32; +const doc = { int32: new Int32(10) }; + +// prints '{"int32":{"$numberInt":"10"}}' +console.log(EJSON.stringify(doc, { relaxed: false })); + +// prints '{"int32":10}' +console.log(EJSON.stringify(doc)); +``` + + + +#### _EJSON_.serialize(bson, [options]) + +| Param | Type | Description | +| --------- | ------------------- | ---------------------------------------------------- | +| bson | object | The object to serialize | +| [options] | object | Optional settings passed to the `stringify` function | + +Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + + + +#### _EJSON_.deserialize(ejson, [options]) + +| Param | Type | Description | +| --------- | ------------------- | -------------------------------------------- | +| ejson | object | The Extended JSON object to deserialize | +| [options] | object | Optional settings passed to the parse method | + +Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + +## Error Handling + +It is our recommendation to use `BSONError.isBSONError()` checks on errors and to avoid relying on parsing `error.message` and `error.name` strings in your code. We guarantee `BSONError.isBSONError()` checks will pass according to semver guidelines, but errors may be sub-classed or their messages may change at any time, even patch releases, as we see fit to increase the helpfulness of the errors. + +Any new errors we add to the driver will directly extend an existing error class and no existing error will be moved to a different parent class outside of a major release. +This means `BSONError.isBSONError()` will always be able to accurately capture the errors that our BSON library throws. + +Hypothetical example: A collection in our Db has an issue with UTF-8 data: + +```ts +let documentCount = 0; +const cursor = collection.find({}, { utf8Validation: true }); +try { + for await (const doc of cursor) documentCount += 1; +} catch (error) { + if (BSONError.isBSONError(error)) { + console.log(`Found the troublemaker UTF-8!: ${documentCount} ${error.message}`); + return documentCount; + } + throw error; +} +``` + +## React Native + +js-bson requires the `atob`, `btoa` and `TextEncoder` globals. Older versions of React Native did not support these global objects, and so +[js-bson v5.4.0](https://github.com/mongodb/js-bson/releases/tag/v5.4.0) added support for bundled polyfills for these globals. Newer versions +of Hermes includes these globals, and so the polyfills for are no longer needed in the js-bson package. + +If you find yourself on a version of React Native that does not have these globals, either: + +1. polyfill them yourself +2. upgrade to a later version of hermes +3. use a version of js-bson `>=5.4.0` and `<7.0.0` + +One additional polyfill, `crypto.getRandomValues` is recommended and can be installed with the following command: + +```sh +npm install --save react-native-get-random-values +``` + +The following snippet should be placed at the top of the entrypoint (by default this is the root `index.js` file) for React Native projects using the BSON library. These lines must be placed for any code that imports `BSON`. + +```typescript +// Required Polyfills For ReactNative +import 'react-native-get-random-values'; +``` + +Finally, import the `BSON` library like so: + +```typescript +import { BSON, EJSON } from 'bson'; +``` + +This will cause React Native to import the `node_modules/bson/lib/bson.rn.cjs` bundle (see the `"react-native"` setting we have in the `"exports"` section of our [package.json](./package.json).) + +### Technical Note about React Native module import + +The `"exports"` definition in our `package.json` will result in BSON's CommonJS bundle being imported in a React Native project instead of the ES module bundle. Importing the CommonJS bundle is necessary because BSON's ES module bundle of BSON uses top-level await, which is not supported syntax in [React Native's runtime hermes](https://hermesengine.dev/). + +## FAQ + +#### Why does `undefined` get converted to `null`? + +The `undefined` BSON type has been [deprecated for many years](http://bsonspec.org/spec.html), so this library has dropped support for it. Use the `ignoreUndefined` option (for example, from the [driver](http://mongodb.github.io/node-mongodb-native/2.2/api/MongoClient.html#connect) ) to instead remove `undefined` keys. + +#### How do I add custom serialization logic? + +This library looks for `toBSON()` functions on every path, and calls the `toBSON()` function to get the value to serialize. + +```javascript +const BSON = require('bson'); + +class CustomSerialize { + toBSON() { + return 42; + } +} + +const obj = { answer: new CustomSerialize() }; +// "{ answer: 42 }" +console.log(BSON.deserialize(BSON.serialize(obj))); +``` diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/bson.d.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/bson.d.ts new file mode 100644 index 00000000..2f57468a --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/bson.d.ts @@ -0,0 +1,1901 @@ +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +export declare class Binary extends BSONValue { + get _bsontype(): 'Binary'; + /* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */ + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ + static readonly SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + static readonly SUBTYPE_FUNCTION = 1; + /** + * Legacy default BSON Binary type + * @deprecated BSON Binary subtype 2 is deprecated in the BSON specification + */ + static readonly SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + static readonly SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + static readonly SUBTYPE_UUID = 4; + /** MD5 BSON type */ + static readonly SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + static readonly SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + static readonly SUBTYPE_COLUMN = 7; + /** Sensitive BSON type */ + static readonly SUBTYPE_SENSITIVE = 8; + /** Vector BSON type */ + static readonly SUBTYPE_VECTOR = 9; + /** User BSON type */ + static readonly SUBTYPE_USER_DEFINED = 128; + /** datatype of a Binary Vector (subtype: 9) */ + static readonly VECTOR_TYPE: Readonly<{ + readonly Int8: 3; + readonly Float32: 39; + readonly PackedBit: 16; + }>; + /** + * The bytes of the Binary value. + * + * The format of a Binary value in BSON is defined as: + * ```txt + * binary ::= int32 subtype (byte*) + * ``` + * + * This `buffer` is the "(byte*)" segment. + * + * Unless the value is subtype 2, then deserialize will read the first 4 bytes as an int32 and set this to the remaining bytes. + * + * ```txt + * binary ::= int32 unsigned_byte(2) int32 (byte*) + * ``` + * + * @see https://bsonspec.org/spec.html + */ + buffer: Uint8Array; + /** + * The binary subtype. + * + * Current defined values are: + * + * - `unsigned_byte(0)` Generic binary subtype + * - `unsigned_byte(1)` Function + * - `unsigned_byte(2)` Binary (Deprecated) + * - `unsigned_byte(3)` UUID (Deprecated) + * - `unsigned_byte(4)` UUID + * - `unsigned_byte(5)` MD5 + * - `unsigned_byte(6)` Encrypted BSON value + * - `unsigned_byte(7)` Compressed BSON column + * - `unsigned_byte(8)` Sensitive + * - `unsigned_byte(9)` Vector + * - `unsigned_byte(128)` - `unsigned_byte(255)` User defined + */ + sub_type: number; + /** + * The Binary's `buffer` can be larger than the Binary's content. + * This property is used to determine where the content ends in the buffer. + */ + position: number; + /** + * Create a new Binary instance. + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + constructor(buffer?: BinarySequence, subType?: number); + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + put(byteValue: string | number | Uint8Array | number[]): void; + /** + * Writes a buffer to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + write(sequence: BinarySequence, offset: number): void; + /** + * Returns a view of **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + read(position: number, length: number): Uint8Array; + /** returns a view of the binary value as a Uint8Array */ + value(): Uint8Array; + /** the length of the binary sequence */ + length(): number; + toJSON(): string; + toString(encoding?: 'hex' | 'base64' | 'utf8' | 'utf-8'): string; + /* Excluded from this release type: toExtendedJSON */ + toUUID(): UUID; + /** Creates an Binary instance from a hex digit string */ + static createFromHexString(hex: string, subType?: number): Binary; + /** Creates an Binary instance from a base64 string */ + static createFromBase64(base64: string, subType?: number): Binary; + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; + /** + * If this Binary represents a Int8 Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.Int8`), + * returns a copy of the bytes in a new Int8Array. + * + * If the Binary is not a Vector, or the datatype is not Int8, an error is thrown. + */ + toInt8Array(): Int8Array; + /** + * If this Binary represents a Float32 Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.Float32`), + * returns a copy of the bytes in a new Float32Array. + * + * If the Binary is not a Vector, or the datatype is not Float32, an error is thrown. + */ + toFloat32Array(): Float32Array; + /** + * If this Binary represents packed bit Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.PackedBit`), + * returns a copy of the bytes that are packed bits. + * + * Use `toBits` to get the unpacked bits. + * + * If the Binary is not a Vector, or the datatype is not PackedBit, an error is thrown. + */ + toPackedBits(): Uint8Array; + /** + * If this Binary represents a Packed bit Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.PackedBit`), + * returns a copy of the bit unpacked into a new Int8Array. + * + * Use `toPackedBits` to get the bits still in packed form. + * + * If the Binary is not a Vector, or the datatype is not PackedBit, an error is thrown. + */ + toBits(): Int8Array; + /** + * Constructs a Binary representing an Int8 Vector. + * @param array - The array to store as a view on the Binary class + */ + static fromInt8Array(array: Int8Array): Binary; + /** Constructs a Binary representing an Float32 Vector. */ + static fromFloat32Array(array: Float32Array): Binary; + /** + * Constructs a Binary representing a packed bit Vector. + * + * Use `fromBits` to pack an array of 1s and 0s. + */ + static fromPackedBits(array: Uint8Array, padding?: number): Binary; + /** + * Constructs a Binary representing an Packed Bit Vector. + * @param array - The array of 1s and 0s to pack into the Binary instance + */ + static fromBits(bits: ArrayLike): Binary; +} + +/** @public */ +export declare interface BinaryExtended { + $binary: { + subType: string; + base64: string; + }; +} + +/** @public */ +export declare interface BinaryExtendedLegacy { + $type: string; + $binary: string; +} + +/** @public */ +export declare type BinarySequence = Uint8Array | number[]; + +declare namespace BSON { + export { + setInternalBufferSize, + serialize, + serializeWithBufferAndIndex, + deserialize, + calculateObjectSize, + deserializeStream, + UUIDExtended, + BinaryExtended, + BinaryExtendedLegacy, + BinarySequence, + CodeExtended, + DBRefLike, + Decimal128Extended, + DoubleExtended, + EJSONOptions, + EJSONOptionsBase, + EJSONSerializeOptions, + EJSONParseOptions, + Int32Extended, + LongExtended, + MaxKeyExtended, + MinKeyExtended, + ObjectIdExtended, + ObjectIdLike, + BSONRegExpExtended, + BSONRegExpExtendedLegacy, + BSONSymbolExtended, + LongWithoutOverrides, + TimestampExtended, + TimestampOverrides, + LongWithoutOverridesClass, + SerializeOptions, + DeserializeOptions, + Code, + BSONSymbol, + DBRef, + Binary, + ObjectId, + UUID, + Long, + Timestamp, + Double, + Int32, + MinKey, + MaxKey, + BSONRegExp, + Decimal128, + NumberUtils, + ByteUtils, + BSONValue, + bsonType, + BSONTypeTag, + BSONError, + BSONVersionError, + BSONRuntimeError, + BSONOffsetError, + BSONType, + EJSON, + onDemand, + OnDemand, + Document, + CalculateObjectSizeOptions + } +} +export { BSON } + +/* Excluded from this release type: BSON_MAJOR_VERSION */ + +/* Excluded from this release type: BSON_VERSION_SYMBOL */ + +/** + * @public + * @experimental + */ +declare type BSONElement = [ +type: number, +nameOffset: number, +nameLength: number, +offset: number, +length: number +]; + +/** + * @public + * @category Error + * + * `BSONError` objects are thrown when BSON encounters an error. + * + * This is the parent class for all the other errors thrown by this library. + */ +export declare class BSONError extends Error { + /* Excluded from this release type: bsonError */ + get name(): string; + constructor(message: string, options?: { + cause?: unknown; + }); + /** + * @public + * + * All errors thrown from the BSON library inherit from `BSONError`. + * This method can assist with determining if an error originates from the BSON library + * even if it does not pass an `instanceof` check against this class' constructor. + * + * @param value - any javascript value that needs type checking + */ + static isBSONError(value: unknown): value is BSONError; +} + +/** + * @public + * @category Error + * + * @experimental + * + * An error generated when BSON bytes are invalid. + * Reports the offset the parser was able to reach before encountering the error. + */ +export declare class BSONOffsetError extends BSONError { + get name(): 'BSONOffsetError'; + offset: number; + constructor(message: string, offset: number, options?: { + cause?: unknown; + }); +} + +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +export declare class BSONRegExp extends BSONValue { + get _bsontype(): 'BSONRegExp'; + pattern: string; + options: string; + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + constructor(pattern: string, options?: string); + static parseOptions(options?: string): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface BSONRegExpExtended { + $regularExpression: { + pattern: string; + options: string; + }; +} + +/** @public */ +export declare interface BSONRegExpExtendedLegacy { + $regex: string | BSONRegExp; + $options: string; +} + +/** + * @public + * @category Error + * + * An error generated when BSON functions encounter an unexpected input + * or reaches an unexpected/invalid internal state + * + */ +export declare class BSONRuntimeError extends BSONError { + get name(): 'BSONRuntimeError'; + constructor(message: string); +} + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +export declare class BSONSymbol extends BSONValue { + get _bsontype(): 'BSONSymbol'; + value: string; + /** + * @param value - the string representing the symbol. + */ + constructor(value: string); + /** Access the wrapped string value. */ + valueOf(): string; + toString(): string; + toJSON(): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface BSONSymbolExtended { + $symbol: string; +} + +/** @public */ +export declare const BSONType: Readonly<{ + readonly double: 1; + readonly string: 2; + readonly object: 3; + readonly array: 4; + readonly binData: 5; + readonly undefined: 6; + readonly objectId: 7; + readonly bool: 8; + readonly date: 9; + readonly null: 10; + readonly regex: 11; + readonly dbPointer: 12; + readonly javascript: 13; + readonly symbol: 14; + readonly javascriptWithScope: 15; + readonly int: 16; + readonly timestamp: 17; + readonly long: 18; + readonly decimal: 19; + readonly minKey: -1; + readonly maxKey: 127; +}>; + +/** @public */ +export declare type BSONType = (typeof BSONType)[keyof typeof BSONType]; + +/** @public */ +export declare const bsonType: unique symbol; + +/** @public */ +export declare type BSONTypeTag = 'BSONRegExp' | 'BSONSymbol' | 'ObjectId' | 'Binary' | 'Decimal128' | 'Double' | 'Int32' | 'Long' | 'MaxKey' | 'MinKey' | 'Timestamp' | 'Code' | 'DBRef'; + +/** @public */ +export declare abstract class BSONValue { + /** @public */ + abstract get _bsontype(): BSONTypeTag; + get [bsonType](): this['_bsontype']; + /* Excluded from this release type: [BSON_VERSION_SYMBOL] */ + /** + * @public + * Prints a human-readable string of BSON value information + * If invoked manually without node.js.inspect function, this will default to a modified JSON.stringify + */ + abstract inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; + /* Excluded from this release type: toExtendedJSON */ +} + +/** + * @public + * @category Error + */ +export declare class BSONVersionError extends BSONError { + get name(): 'BSONVersionError'; + constructor(); +} + +/** + * @public + * @experimental + * + * A collection of functions that help work with data in a Uint8Array. + * ByteUtils is configured at load time to use Node.js or Web based APIs for the internal implementations. + */ +export declare type ByteUtils = { + /** Checks if the given value is a Uint8Array. */ + isUint8Array: (value: unknown) => value is Uint8Array; + /** Transforms the input to an instance of Buffer if running on node, otherwise Uint8Array */ + toLocalBufferType: (buffer: Uint8Array | ArrayBufferView | ArrayBuffer) => Uint8Array; + /** Create empty space of size */ + allocate: (size: number) => Uint8Array; + /** Create empty space of size, use pooled memory when available */ + allocateUnsafe: (size: number) => Uint8Array; + /** Compare 2 Uint8Arrays lexicographically */ + compare: (buffer1: Uint8Array, buffer2: Uint8Array) => -1 | 0 | 1; + /** Concatenating all the Uint8Arrays in new Uint8Array. */ + concat: (list: Uint8Array[]) => Uint8Array; + /** Copy bytes from source Uint8Array to target Uint8Array */ + copy: (source: Uint8Array, target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number) => number; + /** Check if two Uint8Arrays are deep equal */ + equals: (a: Uint8Array, b: Uint8Array) => boolean; + /** Create a Uint8Array from an array of numbers */ + fromNumberArray: (array: number[]) => Uint8Array; + /** Create a Uint8Array from a base64 string */ + fromBase64: (base64: string) => Uint8Array; + /** Create a Uint8Array from a UTF8 string */ + fromUTF8: (utf8: string) => Uint8Array; + /** Create a base64 string from bytes */ + toBase64: (buffer: Uint8Array) => string; + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + fromISO88591: (codePoints: string) => Uint8Array; + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + toISO88591: (buffer: Uint8Array) => string; + /** Create a Uint8Array from a hex string */ + fromHex: (hex: string) => Uint8Array; + /** Create a lowercase hex string from bytes */ + toHex: (buffer: Uint8Array) => string; + /** Create a string from utf8 code units, fatal=true will throw an error if UTF-8 bytes are invalid, fatal=false will insert replacement characters */ + toUTF8: (buffer: Uint8Array, start: number, end: number, fatal: boolean) => string; + /** Get the utf8 code unit count from a string if it were to be transformed to utf8 */ + utf8ByteLength: (input: string) => number; + /** Encode UTF8 bytes generated from `source` string into `destination` at byteOffset. Returns the number of bytes encoded. */ + encodeUTF8Into: (destination: Uint8Array, source: string, byteOffset: number) => number; + /** Generate a Uint8Array filled with random bytes with byteLength */ + randomBytes: (byteLength: number) => Uint8Array; + /** Interprets `buffer` as an array of 32-bit values and swaps the byte order in-place. */ + swap32: (buffer: Uint8Array) => Uint8Array; +}; + +/** + * This is the only ByteUtils that should be used across the rest of the BSON library. + * + * The type annotation is important here, it asserts that each of the platform specific + * utils implementations are compatible with the common one. + * + * @public + * @experimental + */ +export declare const ByteUtils: ByteUtils; + +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +export declare function calculateObjectSize(object: Document, options?: CalculateObjectSizeOptions): number; + +/** @public */ +export declare type CalculateObjectSizeOptions = Pick; + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +export declare class Code extends BSONValue { + get _bsontype(): 'Code'; + code: string; + scope: Document | null; + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + constructor(code: string | Function, scope?: Document | null); + toJSON(): { + code: string; + scope?: Document; + }; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface CodeExtended { + $code: string; + $scope?: Document; +} + +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +export declare class DBRef extends BSONValue { + get _bsontype(): 'DBRef'; + collection: string; + oid: ObjectId; + db?: string; + fields: Document; + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document); + /* Excluded from this release type: namespace */ + /* Excluded from this release type: namespace */ + toJSON(): DBRefLike & Document; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface DBRefLike { + $ref: string; + $id: ObjectId; + $db?: string; +} + +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +export declare class Decimal128 extends BSONValue { + get _bsontype(): 'Decimal128'; + readonly bytes: Uint8Array; + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + constructor(bytes: Uint8Array | string); + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128; + /** + * Create a Decimal128 instance from a string representation, allowing for rounding to 34 + * significant digits + * + * @example Example of a number that will be rounded + * ```ts + * > let d = Decimal128.fromString('37.499999999999999196428571428571375') + * Uncaught: + * BSONError: "37.499999999999999196428571428571375" is not a valid Decimal128 string - inexact rounding + * at invalidErr (/home/wajames/js-bson/lib/bson.cjs:1402:11) + * at Decimal128.fromStringInternal (/home/wajames/js-bson/lib/bson.cjs:1633:25) + * at Decimal128.fromString (/home/wajames/js-bson/lib/bson.cjs:1424:27) + * + * > d = Decimal128.fromStringWithRounding('37.499999999999999196428571428571375') + * new Decimal128("37.49999999999999919642857142857138") + * ``` + * @param representation - a numeric string representation. + */ + static fromStringWithRounding(representation: string): Decimal128; + private static _fromString; + /** Create a string representation of the raw Decimal128 value */ + toString(): string; + toJSON(): Decimal128Extended; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface Decimal128Extended { + $numberDecimal: string; +} + +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +export declare function deserialize(buffer: Uint8Array, options?: DeserializeOptions): Document; + +/** @public */ +export declare interface DeserializeOptions { + /** + * when deserializing a Long return as a BigInt. + * @defaultValue `false` + */ + useBigInt64?: boolean; + /** + * when deserializing a Long will fit it into a Number if it's smaller than 53 bits. + * @defaultValue `true` + */ + promoteLongs?: boolean; + /** + * when deserializing a Binary will return it as a node.js Buffer instance. + * @defaultValue `false` + */ + promoteBuffers?: boolean; + /** + * when deserializing will promote BSON values to their Node.js closest equivalent types. + * @defaultValue `true` + */ + promoteValues?: boolean; + /** + * allow to specify if there what fields we wish to return as unserialized raw buffer. + * @defaultValue `null` + */ + fieldsAsRaw?: Document; + /** + * return BSON regular expressions as BSONRegExp instances. + * @defaultValue `false` + */ + bsonRegExp?: boolean; + /** + * allows the buffer to be larger than the parsed BSON object. + * @defaultValue `false` + */ + allowObjectSmallerThanBufferSize?: boolean; + /** + * Offset into buffer to begin reading document from + * @defaultValue `0` + */ + index?: number; + raw?: boolean; + /** Allows for opt-out utf-8 validation for all keys or + * specified keys. Must be all true or all false. + * + * @example + * ```js + * // disables validation on all keys + * validation: { utf8: false } + * + * // enables validation only on specified keys a, b, and c + * validation: { utf8: { a: true, b: true, c: true } } + * + * // disables validation only on specified keys a, b + * validation: { utf8: { a: false, b: false } } + * ``` + */ + validation?: { + utf8: boolean | Record | Record; + }; +} + +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +export declare function deserializeStream(data: Uint8Array | ArrayBuffer, startIndex: number, numberOfDocuments: number, documents: Document[], docStartIndex: number, options: DeserializeOptions): number; + +/** @public */ +export declare interface Document { + [key: string]: any; +} + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +export declare class Double extends BSONValue { + get _bsontype(): 'Double'; + value: number; + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + constructor(value: number); + /** + * Attempt to create an double type from string. + * + * This method will throw a BSONError on any string input that is not representable as a IEEE-754 64-bit double. + * Notably, this method will also throw on the following string formats: + * - Strings in non-decimal and non-exponential formats (binary, hex, or octal digits) + * - Strings with characters other than numeric, floating point, or leading sign characters (Note: 'Infinity', '-Infinity', and 'NaN' input strings are still allowed) + * - Strings with leading and/or trailing whitespace + * + * Strings with leading zeros, however, are also allowed + * + * @param value - the string we want to represent as a double. + */ + static fromString(value: string): Double; + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + valueOf(): number; + toJSON(): number; + toString(radix?: number): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface DoubleExtended { + $numberDouble: string; +} + +/** @public */ +export declare const EJSON: { + parse: typeof parse; + stringify: typeof stringify; + serialize: typeof EJSONserialize; + deserialize: typeof EJSONdeserialize; +}; + +/** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ +declare function EJSONdeserialize(ejson: Document, options?: EJSONParseOptions): any; + +/** @public */ +export declare type EJSONOptions = EJSONSerializeOptions & EJSONParseOptions; + +/** @public */ +export declare type EJSONOptionsBase = { + /** + * Output using the Extended JSON v1 spec + * @defaultValue `false` + */ + legacy?: boolean; + /** + * Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types + * @defaultValue `false` + */ + relaxed?: boolean; +}; + +/** @public */ +export declare type EJSONParseOptions = EJSONOptionsBase & { + /** + * Enable native bigint support + * @defaultValue `false` + */ + useBigInt64?: boolean; +}; + +/** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ +declare function EJSONserialize(value: any, options?: EJSONSerializeOptions): Document; + +/** @public */ +export declare type EJSONSerializeOptions = EJSONOptionsBase & { + /** + * Omits undefined values from the output instead of converting them to null + * @defaultValue `false` + */ + ignoreUndefined?: boolean; +}; + +declare type InspectFn = (x: unknown, options?: unknown) => string; + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +export declare class Int32 extends BSONValue { + get _bsontype(): 'Int32'; + value: number; + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + constructor(value: number | string); + /** + * Attempt to create an Int32 type from string. + * + * This method will throw a BSONError on any string input that is not representable as an Int32. + * Notably, this method will also throw on the following string formats: + * - Strings in non-decimal formats (exponent notation, binary, hex, or octal digits) + * - Strings non-numeric and non-leading sign characters (ex: '2.0', '24,000') + * - Strings with leading and/or trailing whitespace + * + * Strings with leading zeros, however, are allowed. + * + * @param value - the string we want to represent as an int32. + */ + static fromString(value: string): Int32; + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + valueOf(): number; + toString(radix?: number): string; + toJSON(): number; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface Int32Extended { + $numberInt: string; +} + +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +export declare class Long extends BSONValue { + get _bsontype(): 'Long'; + /** An indicator used to reliably determine if an object is a Long or not. */ + get __isLong__(): boolean; + /** + * The high 32 bits as a signed value. + */ + high: number; + /** + * The low 32 bits as a signed value. + */ + low: number; + /** + * Whether unsigned or not. + */ + unsigned: boolean; + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(low: number, high?: number, unsigned?: boolean); + /** + * Constructs a 64 bit two's-complement integer, given a bigint representation. + * + * @param value - BigInt representation of the long value + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(value: bigint, unsigned?: boolean); + /** + * Constructs a 64 bit two's-complement integer, given a string representation. + * + * @param value - String representation of the long value + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(value: string, unsigned?: boolean); + static TWO_PWR_24: Long; + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE: Long; + /** Signed zero */ + static ZERO: Long; + /** Unsigned zero. */ + static UZERO: Long; + /** Signed one. */ + static ONE: Long; + /** Unsigned one. */ + static UONE: Long; + /** Signed negative one. */ + static NEG_ONE: Long; + /** Maximum signed value. */ + static MAX_VALUE: Long; + /** Minimum signed value. */ + static MIN_VALUE: Long; + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long; + /* Excluded from this release type: _fromString */ + /** + * Returns a signed Long representation of the given string, written using radix 10. + * Will throw an error if the given text is not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the radix 10 + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @returns The corresponding Long value + */ + static fromStringStrict(str: string): Long; + /** + * Returns a Long representation of the given string, written using the radix 10. + * Will throw an error if the given parameters are not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the given radix + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromStringStrict(str: string, unsigned?: boolean): Long; + /** + * Returns a signed Long representation of the given string, written using the specified radix. + * Will throw an error if the given parameters are not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the given radix + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromStringStrict(str: string, radix?: boolean): Long; + /** + * Returns a Long representation of the given string, written using the specified radix. + * Will throw an error if the given parameters are not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the given radix + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromStringStrict(str: string, unsigned?: boolean, radix?: number): Long; + /** + * Returns a signed Long representation of the given string, written using radix 10. + * + * If the input string is empty, this function will throw a BSONError. + * + * If input string does not have valid signed 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit signed long will be coerced to Long.MAX_VALUE and Long.MIN_VALUE respectively + * - 'NaN' or '+/-Infinity' are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * + * @param str - The textual representation of the Long + * @returns The corresponding Long value + */ + static fromString(str: string): Long; + /** + * Returns a signed Long representation of the given string, written using the provided radix. + * + * If the input string is empty or a provided radix is not within (2-36), this function will throw a BSONError. + * + * If input parameters do not have valid signed 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit signed long will be coerced to Long.MAX_VALUE and Long.MIN_VALUE respectively + * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO + * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * @param str - The textual representation of the Long + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, radix?: number): Long; + /** + * Returns a Long representation of the given string, written using radix 10. + * + * If the input string is empty, this function will throw a BSONError. + * + * If input parameters do not have a valid 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit long will be coerced to max or min (if signed) values + * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO + * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean): Long; + /** + * Returns a Long representation of the given string, written using the specified radix. + * + * If the input string is empty or a provided radix is not within (2-36), this function will throw a BSONError. + * + * If input parameters do not have a valid 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit long will be coerced to max or min (if signed) values + * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO + * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long; + /** + * Tests if the specified object is a Long. + */ + static isLong(value: unknown): value is Long; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue(val: number | string | { + low: number; + high: number; + unsigned?: boolean; + }, unsigned?: boolean): Long; + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long | Timestamp): Long; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + and(other: string | number | Long | Timestamp): Long; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** This is an alias of {@link Long.compare} */ + comp(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long | Timestamp): Long; + /**This is an alias of {@link Long.divide} */ + div(divisor: string | number | Long | Timestamp): Long; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + equals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.equals} */ + eq(other: string | number | Long | Timestamp): boolean; + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number; + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number; + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number; + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number; + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThan} */ + gt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is greater than or equal the specified's. */ + greaterThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is even. */ + isEven(): boolean; + /** Tests if this Long's value is negative. */ + isNegative(): boolean; + /** Tests if this Long's value is odd. */ + isOdd(): boolean; + /** Tests if this Long's value is positive. */ + isPositive(): boolean; + /** Tests if this Long's value equals zero. */ + isZero(): boolean; + /** Tests if this Long's value is less than the specified's. */ + lessThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long#lessThan}. */ + lt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is less than or equal the specified's. */ + lessThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte(other: string | number | Long | Timestamp): boolean; + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + mod(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + rem(divisor: string | number | Long | Timestamp): Long; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + multiply(multiplier: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.multiply} */ + mul(multiplier: string | number | Long | Timestamp): Long; + /** Returns the Negation of this Long's value. */ + negate(): Long; + /** This is an alias of {@link Long.negate} */ + neg(): Long; + /** Returns the bitwise NOT of this Long. */ + not(): Long; + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + neq(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + ne(other: string | number | Long | Timestamp): boolean; + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: number | string | Long): Long; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftLeft} */ + shl(numBits: number | Long): Long; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRight} */ + shr(numBits: number | Long): Long; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRightUnsigned(numBits: Long | number): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru(numBits: number | Long): Long; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + subtract(subtrahend: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.subtract} */ + sub(subtrahend: string | number | Long | Timestamp): Long; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number; + /** Converts the Long to a BigInt (arbitrary precision). */ + toBigInt(): bigint; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + toBytes(le?: boolean): number[]; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + toBytesLE(): number[]; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + toBytesBE(): number[]; + /** + * Converts this Long to signed. + */ + toSigned(): Long; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + toString(radix?: number): string; + /** Converts this Long to unsigned. */ + toUnsigned(): Long; + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long; + /** This is an alias of {@link Long.isZero} */ + eqz(): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + le(other: string | number | Long | Timestamp): boolean; + toExtendedJSON(options?: EJSONOptions): number | LongExtended; + static fromExtendedJSON(doc: { + $numberLong: string; + }, options?: EJSONOptions): number | Long | bigint; + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface LongExtended { + $numberLong: string; +} + +/** @public */ +export declare type LongWithoutOverrides = new (low: unknown, high?: number | boolean, unsigned?: boolean) => { + [P in TimestampKept]: Long[P]; +}; + +/** @public */ +export declare const LongWithoutOverridesClass: LongWithoutOverrides; + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +export declare class MaxKey extends BSONValue { + get _bsontype(): 'MaxKey'; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface MaxKeyExtended { + $maxKey: 1; +} + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +export declare class MinKey extends BSONValue { + get _bsontype(): 'MinKey'; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface MinKeyExtended { + $minKey: 1; +} + +/** + * @experimental + * @public + * + * A collection of functions that get or set various numeric types and bit widths from a Uint8Array. + */ +export declare type NumberUtils = { + /** Is true if the current system is big endian. */ + isBigEndian: boolean; + /** + * Parses a signed int32 at offset. Throws a `RangeError` if value is negative. + */ + getNonnegativeInt32LE: (source: Uint8Array, offset: number) => number; + getInt32LE: (source: Uint8Array, offset: number) => number; + getUint32LE: (source: Uint8Array, offset: number) => number; + getUint32BE: (source: Uint8Array, offset: number) => number; + getBigInt64LE: (source: Uint8Array, offset: number) => bigint; + getFloat64LE: (source: Uint8Array, offset: number) => number; + setInt32BE: (destination: Uint8Array, offset: number, value: number) => 4; + setInt32LE: (destination: Uint8Array, offset: number, value: number) => 4; + setBigInt64LE: (destination: Uint8Array, offset: number, value: bigint) => 8; + setFloat64LE: (destination: Uint8Array, offset: number, value: number) => 8; +}; + +/** + * Number parsing and serializing utilities. + * + * @experimental + * @public + */ +export declare const NumberUtils: NumberUtils; + +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +export declare class ObjectId extends BSONValue { + get _bsontype(): 'ObjectId'; + /* Excluded from this release type: index */ + /* Excluded from this release type: PROCESS_UNIQUE */ + /* Excluded from this release type: resetState */ + static cacheHexString: boolean; + /* Excluded from this release type: i0 */ + /* Excluded from this release type: i1 */ + /* Excluded from this release type: i2 */ + /* Excluded from this release type: i3 */ + /* Excluded from this release type: setFromBytes */ + /* Excluded from this release type: setFromHex */ + /** To generate a new ObjectId, use ObjectId() with no argument. */ + constructor(); + /** + * Create ObjectId from a 24 character hex string. + * + * @param inputId - A 24 character hex string. + */ + constructor(inputId: string); + /** + * Create ObjectId from the BSON ObjectId type. + * + * @param inputId - The BSON ObjectId type. + */ + constructor(inputId: ObjectId); + /** + * Create ObjectId from the object type that has the toHexString method. + * + * @param inputId - The ObjectIdLike type. + */ + constructor(inputId: ObjectIdLike); + /** + * Create ObjectId from a 12 byte binary Buffer. + * + * @param inputId - A 12 byte binary Buffer. + */ + constructor(inputId: Uint8Array); + /** + * Implementation overload. + * + * @param inputId - All input types that are used in the constructor implementation. + */ + constructor(inputId?: string | ObjectId | ObjectIdLike | Uint8Array); + /* Excluded from this release type: __constructor */ + /** + * The ObjectId bytes, rebuilt from the packed integer fields on each access. Every read + * returns a freshly allocated 12-byte buffer. + * @readonly + */ + get id(): Uint8Array; + set id(value: Uint8Array); + /* Excluded from this release type: validateHexString */ + /** Returns the ObjectId id as a 24 lowercase character hex string representation */ + toHexString(): string; + /* Excluded from this release type: getInc */ + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + static generate(time?: number): Uint8Array; + /** + * Converts the id into a 24 character hex string for printing, unless encoding is provided. + * @param encoding - hex or base64 + */ + toString(encoding?: 'hex' | 'base64'): string; + /** Converts to its JSON the 24 character hex string representation. */ + toJSON(): string; + /* Excluded from this release type: is */ + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + equals(otherId: string | ObjectId | ObjectIdLike | undefined | null): boolean; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date; + /* Excluded from this release type: createPk */ + /* Excluded from this release type: serializeInto */ + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + static createFromTime(time: number): ObjectId; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + static createFromHexString(hexString: string): ObjectId; + /** Creates an ObjectId instance from a base64 string */ + static createFromBase64(base64: string): ObjectId; + /** + * Checks if a value can be used to create a valid bson ObjectId + * @param id - any JS value + */ + static isValid(id: string | ObjectId | ObjectIdLike | Uint8Array): boolean; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + /* Excluded from this release type: isCached */ + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare interface ObjectIdExtended { + $oid: string; +} + +/** @public */ +export declare interface ObjectIdLike { + id: string | Uint8Array; + __id?: string; + toHexString(): string; +} + +/** + * @experimental + * @public + * + * A new set of BSON APIs that are currently experimental and not intended for production use. + */ +export declare type OnDemand = { + parseToElements: (this: void, bytes: Uint8Array, startOffset?: number) => Iterable; + BSONElement: BSONElement; + ByteUtils: ByteUtils; + NumberUtils: NumberUtils; +}; + +/** + * @experimental + * @public + */ +export declare const onDemand: OnDemand; + +/** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ +declare function parse(text: string, options?: EJSONParseOptions): any; + +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +export declare function serialize(object: Document, options?: SerializeOptions): Uint8Array; + +/** @public */ +export declare interface SerializeOptions { + /** + * the serializer will check if keys are valid. + * @defaultValue `false` + */ + checkKeys?: boolean; + /** + * serialize the javascript functions + * @defaultValue `false` + */ + serializeFunctions?: boolean; + /** + * serialize will not emit undefined fields + * note that the driver sets this to `false` + * @defaultValue `true` + */ + ignoreUndefined?: boolean; + /* Excluded from this release type: minInternalBufferSize */ + /** + * the index in the buffer where we wish to start serializing into + * @defaultValue `0` + */ + index?: number; +} + +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +export declare function serializeWithBufferAndIndex(object: Document, finalBuffer: Uint8Array, options?: SerializeOptions): number; + +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer in bytes + * @public + */ +export declare function setInternalBufferSize(size: number): void; + +/** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * + * // prints '{"int32":{"$numberInt":"10"}}' with 2 space indentation + * console.log(EJSON.stringify(doc, { relaxed: false }, 2)); + * ``` + */ +declare function stringify(value: any, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | null, space?: string | number, options?: EJSONSerializeOptions): string; + +declare function stringify(value: any, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | null, options?: EJSONSerializeOptions): string; + +declare function stringify(value: any, options?: EJSONSerializeOptions, space?: string | number): string; + +/** + * @public + * @category BSONType + * + * A special type for _internal_ MongoDB use and is **not** associated with the regular Date type. + */ +export declare class Timestamp extends LongWithoutOverridesClass { + get _bsontype(): 'Timestamp'; + get [bsonType](): 'Timestamp'; + /** + * @deprecated Use `Long.MAX_UNSIGNED_VALUE` instead. + */ + static readonly MAX_VALUE: Long; + /** + * An incrementing ordinal for operations within a given second. + */ + get i(): number; + /** + * A `time_t` value measuring seconds since the Unix epoch + */ + get t(): number; + /** + * @param int - A 64-bit bigint representing the Timestamp. + */ + constructor(int: bigint); + /** + * @param long - A 64-bit Long representing the Timestamp. + */ + constructor(long: Long); + /** + * @param value - A pair of two values indicating timestamp and increment. + */ + constructor(value: { + t: number; + i: number; + }); + toJSON(): { + $timestamp: string; + }; + /** + * Returns a Timestamp represented by the given (32-bit) integer value. + * @deprecated Stores `value` in the low 32 bits (increment), leaving t = 0. Use `new Timestamp({ t, i })` or `Timestamp.fromBits(lowBits, highBits)` for explicit construction. + */ + static fromInt(value: number): Timestamp; + /** + * Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. + * @deprecated Splits `value` across (t, i) as a uint64; the result rarely matches user intent. Use `new Timestamp({ t, i })` or `Timestamp.fromBits(lowBits, highBits)` for explicit construction. + */ + static fromNumber(value: number): Timestamp; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + static fromString(str: string, optRadix: number): Timestamp; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + add: Long['add']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + subtract: Long['subtract']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + sub: Long['sub']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + multiply: Long['multiply']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + mul: Long['mul']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + divide: Long['divide']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + div: Long['div']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + modulo: Long['modulo']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + mod: Long['mod']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + rem: Long['rem']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned. */ + negate: Long['negate']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned. */ + neg: Long['neg']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + and: Long['and']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + or: Long['or']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + xor: Long['xor']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + not: Long['not']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + shiftLeft: Long['shiftLeft']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + shl: Long['shl']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + shiftRight: Long['shiftRight']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + shr: Long['shr']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + shiftRightUnsigned: Long['shiftRightUnsigned']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + shr_u: Long['shr_u']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + shru: Long['shru']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned. */ + toSigned: Long['toSigned']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (this is a no-op). */ + toUnsigned: Long['toUnsigned']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (is always false). */ + isNegative: Long['isNegative']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (is always true). */ + isPositive: Long['isPositive']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (is always true). */ + unsigned: Long['unsigned']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + toInt: Long['toInt']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + toNumber: Long['toNumber']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + toBytes: Long['toBytes']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + toBytesLE: Long['toBytesLE']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + toBytesBE: Long['toBytesBE']; + /** @deprecated Incompatible with Timestamp: returns a signed integer, but Timestamp is always unsigned. Use `.t` for seconds since the Unix epoch. */ + getHighBits: Long['getHighBits']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch. */ + getHighBitsUnsigned: Long['getHighBitsUnsigned']; + /** @deprecated Incompatible with Timestamp: returns a signed integer, but Timestamp is always unsigned. Use `.i` for the increment ordinal. */ + getLowBits: Long['getLowBits']; + /** @deprecated Not applicable to Timestamp; use `.i` for the increment ordinal. */ + getLowBitsUnsigned: Long['getLowBitsUnsigned']; + /** @deprecated Not applicable to Timestamp; use `.i` instead. */ + low: Long['low']; + /** @deprecated Not applicable to Timestamp; use `.t` instead. */ + high: Long['high']; + /** @deprecated Use .compare() for general comparison, or .equals(), .lessThan(), .greaterThan() for specific cases. */ + comp: Long['comp']; + /** @deprecated Compare `.t` and `.i` against `0` explicitly. */ + isZero: Long['isZero']; + /** @deprecated Compare `.t` and `.i` against `0` explicitly. */ + eqz: Long['eqz']; + /** @deprecated Not applicable to Timestamp. Use the bsonType symbol or _bsontype === 'Timestamp' to identify a Timestamp. */ + __isLong__: Long['__isLong__']; + /** @deprecated Not applicable to Timestamp. */ + getNumBitsAbs: Long['getNumBitsAbs']; + /** @deprecated Not applicable to Timestamp; tests parity of the increment only. */ + isEven: Long['isEven']; + /** @deprecated Not applicable to Timestamp; tests parity of the increment only. */ + isOdd: Long['isOdd']; +} + +/** @public */ +export declare interface TimestampExtended { + $timestamp: { + t: number; + i: number; + }; +} + +/** + * @public + * + * Inherited `Long` members surfaced on `Timestamp`. + * When `Long` gains a new member: add it here if it should pass through, or + * add a `@deprecated declare` line on the `Timestamp` class if it should be + * surfaced as deprecated. Anything left unclassified is silently dropped from + * the public type — preventing accidental behavioral bleed-through. + */ +declare type TimestampKept = 'toBigInt' | 'toString' | 'compare' | 'equals' | 'eq' | 'notEquals' | 'neq' | 'ne' | 'lessThan' | 'lt' | 'lessThanOrEqual' | 'lte' | 'le' | 'greaterThan' | 'gt' | 'greaterThanOrEqual' | 'gte' | 'ge'; + +/** + * @public + * @deprecated This type is no longer used internally and will be removed in a future version. + */ +export declare type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect' | typeof bsonType; + +/** + * A class representation of the BSON UUID type. + * @public + */ +export declare class UUID extends Binary { + /** + * Create a UUID type + * + * When the argument to the constructor is omitted a random v4 UUID will be generated. + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + constructor(input?: string | Uint8Array | UUID); + /** + * The UUID bytes + * @readonly + */ + get id(): Uint8Array; + set id(value: Uint8Array); + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + */ + toHexString(includeDashes?: boolean): string; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + toString(encoding?: 'hex' | 'base64'): string; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + toJSON(): string; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + equals(otherId: string | Uint8Array | UUID): boolean; + /** + * Creates a Binary instance from the current UUID. + */ + toBinary(): Binary; + /** + * Generates a populated buffer containing a v4 uuid + */ + static generate(): Uint8Array; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + static isValid(input: string | Uint8Array | UUID | Binary): boolean; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + static createFromHexString(hexString: string): UUID; + /** Creates an UUID from a base64 string representation of an UUID. */ + static createFromBase64(base64: string): UUID; + /* Excluded from this release type: bytesFromString */ + /* Excluded from this release type: isValidUUIDString */ + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * + */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; +} + +/** @public */ +export declare type UUIDExtended = { + $uuid: string; +}; + +export { } diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/etc/prepare.js b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/etc/prepare.js new file mode 100755 index 00000000..ffc05167 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/etc/prepare.js @@ -0,0 +1,24 @@ +#! /usr/bin/env node +var cp = require('child_process'); +var fs = require('fs'); + +var nodeMajorVersion = +process.version.match(/^v(\d+)\.\d+/)[1]; + +// Point git at the checked in hooks (see .githooks/pre-commit). +if (fs.existsSync('.githooks')) { + cp.spawnSync('git', ['config', 'core.hooksPath', '.githooks'], { stdio: 'inherit' }); +} + +if (fs.existsSync('src') && nodeMajorVersion >= 10) { + cp.spawnSync('npm', ['run', 'build'], { stdio: 'inherit', shell: true }); +} else { + if (!fs.existsSync('lib')) { + console.warn('BSON: No compiled javascript present, the library is not installed correctly.'); + if (nodeMajorVersion < 10) { + console.warn( + 'This library can only be compiled in nodejs version 10 or later, currently running: ' + + nodeMajorVersion + ); + } + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js new file mode 100644 index 00000000..f79f5777 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js @@ -0,0 +1,4878 @@ +var BSON = (function (exports) { +'use strict'; + +const TypedArrayPrototypeGetSymbolToStringTag = (() => { + const g = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get; + return (value) => g.call(value); +})(); +function isUint8Array(value) { + return TypedArrayPrototypeGetSymbolToStringTag(value) === 'Uint8Array'; +} +function isAnyArrayBuffer(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + (value[Symbol.toStringTag] === 'ArrayBuffer' || + value[Symbol.toStringTag] === 'SharedArrayBuffer')); +} +function isRegExp(regexp) { + return regexp instanceof RegExp || Object.prototype.toString.call(regexp) === '[object RegExp]'; +} +function isMap(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Map'); +} +function isDate(date) { + return date instanceof Date || Object.prototype.toString.call(date) === '[object Date]'; +} +function defaultInspect(x, _options) { + return JSON.stringify(x, (k, v) => { + if (typeof v === 'bigint') { + return { $numberLong: `${v}` }; + } + else if (isMap(v)) { + return Object.fromEntries(v); + } + return v; + }); +} +function getStylizeFunction(options) { + const stylizeExists = options != null && + typeof options === 'object' && + 'stylize' in options && + typeof options.stylize === 'function'; + if (stylizeExists) { + return options.stylize; + } +} + +const BSON_MAJOR_VERSION = 7; +const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version'); +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -2147483648; +const BSON_INT64_MAX = Math.pow(2, 63) - 1; +const BSON_INT64_MIN = -Math.pow(2, 63); +const JS_INT_MAX = Math.pow(2, 53); +const JS_INT_MIN = -Math.pow(2, 53); +const BSON_DATA_NUMBER = 1; +const BSON_DATA_STRING = 2; +const BSON_DATA_OBJECT = 3; +const BSON_DATA_ARRAY = 4; +const BSON_DATA_BINARY = 5; +const BSON_DATA_UNDEFINED = 6; +const BSON_DATA_OID = 7; +const BSON_DATA_BOOLEAN = 8; +const BSON_DATA_DATE = 9; +const BSON_DATA_NULL = 10; +const BSON_DATA_REGEXP = 11; +const BSON_DATA_DBPOINTER = 12; +const BSON_DATA_CODE = 13; +const BSON_DATA_SYMBOL = 14; +const BSON_DATA_CODE_W_SCOPE = 15; +const BSON_DATA_INT = 16; +const BSON_DATA_TIMESTAMP = 17; +const BSON_DATA_LONG = 18; +const BSON_DATA_DECIMAL128 = 19; +const BSON_DATA_MIN_KEY = 0xff; +const BSON_DATA_MAX_KEY = 0x7f; +const BSON_BINARY_SUBTYPE_DEFAULT = 0; +const BSON_BINARY_SUBTYPE_UUID_NEW = 4; +const BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +}); + +class BSONError extends Error { + get bsonError() { + return true; + } + get name() { + return 'BSONError'; + } + constructor(message, options) { + super(message, options); + } + static isBSONError(value) { + return (value != null && + typeof value === 'object' && + 'bsonError' in value && + value.bsonError === true && + 'name' in value && + 'message' in value && + 'stack' in value); + } +} +class BSONVersionError extends BSONError { + get name() { + return 'BSONVersionError'; + } + constructor() { + super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); + } +} +class BSONRuntimeError extends BSONError { + get name() { + return 'BSONRuntimeError'; + } + constructor(message) { + super(message); + } +} +class BSONOffsetError extends BSONError { + get name() { + return 'BSONOffsetError'; + } + offset; + constructor(message, offset, options) { + super(`${message}. offset: ${offset}`, options); + this.offset = offset; + } +} + +let TextDecoderFatal; +let TextDecoderNonFatal; +function parseUtf8(buffer, start, end, fatal) { + if (fatal) { + TextDecoderFatal ??= new TextDecoder('utf8', { fatal: true }); + try { + return TextDecoderFatal.decode(buffer.subarray(start, end)); + } + catch (cause) { + throw new BSONError('Invalid UTF-8 string in BSON document', { cause }); + } + } + TextDecoderNonFatal ??= new TextDecoder('utf8', { fatal: false }); + return TextDecoderNonFatal.decode(buffer.subarray(start, end)); +} + +function tryReadBasicLatin(uint8array, start, end) { + if (uint8array.length === 0) { + return ''; + } + const stringByteLength = end - start; + if (stringByteLength === 0) { + return ''; + } + if (stringByteLength > 20) { + return null; + } + if (stringByteLength === 1 && uint8array[start] < 128) { + return String.fromCharCode(uint8array[start]); + } + if (stringByteLength === 2 && uint8array[start] < 128 && uint8array[start + 1] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]); + } + if (stringByteLength === 3 && + uint8array[start] < 128 && + uint8array[start + 1] < 128 && + uint8array[start + 2] < 128) { + return (String.fromCharCode(uint8array[start]) + + String.fromCharCode(uint8array[start + 1]) + + String.fromCharCode(uint8array[start + 2])); + } + const latinBytes = []; + for (let i = start; i < end; i++) { + const byte = uint8array[i]; + if (byte > 127) { + return null; + } + latinBytes.push(byte); + } + return String.fromCharCode(...latinBytes); +} +function tryWriteBasicLatin(destination, source, offset) { + if (source.length === 0) + return 0; + if (source.length > 25) + return null; + if (destination.length - offset < source.length) + return null; + for (let charOffset = 0, destinationOffset = offset; charOffset < source.length; charOffset++, destinationOffset++) { + const char = source.charCodeAt(charOffset); + if (char > 127) + return null; + destination[destinationOffset] = char; + } + return source.length; +} + +function nodejsMathRandomBytes(byteLength) { + return nodeJsByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +function nodejsSecureRandomBytes(byteLength) { + return crypto.getRandomValues(nodeJsByteUtils.allocate(byteLength)); +} +const nodejsRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return nodejsSecureRandomBytes; + } + else { + return nodejsMathRandomBytes; + } +})(); +const nodeJsByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialBuffer) { + if (Buffer.isBuffer(potentialBuffer)) { + return potentialBuffer; + } + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + const stringTag = potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer); + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return Buffer.from(potentialBuffer); + } + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); + }, + allocate(size) { + return Buffer.alloc(size); + }, + allocateUnsafe(size) { + return Buffer.allocUnsafe(size); + }, + compare(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).compare(b); + }, + concat(list) { + return Buffer.concat(list); + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + return nodeJsByteUtils + .toLocalBufferType(source) + .copy(target, targetStart ?? 0, sourceStart ?? 0, sourceEnd ?? source.length); + }, + equals(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).equals(b); + }, + fromNumberArray(array) { + return Buffer.from(array); + }, + fromBase64(base64) { + return Buffer.from(base64, 'base64'); + }, + fromUTF8(utf8) { + return Buffer.from(utf8, 'utf8'); + }, + toBase64(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('base64'); + }, + fromISO88591(codePoints) { + return Buffer.from(codePoints, 'binary'); + }, + toISO88591(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('binary'); + }, + fromHex(hex) { + return Buffer.from(hex, 'hex'); + }, + toHex(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('hex'); + }, + toUTF8(buffer, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(buffer, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + const string = nodeJsByteUtils.toLocalBufferType(buffer).toString('utf8', start, end); + if (fatal) { + for (let i = 0; i < string.length; i++) { + if (string.charCodeAt(i) === 0xfffd) { + parseUtf8(buffer, start, end, true); + break; + } + } + } + return string; + }, + utf8ByteLength(input) { + return Buffer.byteLength(input, 'utf8'); + }, + encodeUTF8Into(buffer, source, byteOffset) { + const latinBytesWritten = tryWriteBasicLatin(buffer, source, byteOffset); + if (latinBytesWritten != null) { + return latinBytesWritten; + } + return nodeJsByteUtils.toLocalBufferType(buffer).write(source, byteOffset, undefined, 'utf8'); + }, + randomBytes: nodejsRandomBytes, + swap32(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).swap32(); + } +}; + +function isReactNative() { + const { navigator } = globalThis; + return typeof navigator === 'object' && navigator.product === 'ReactNative'; +} +function webMathRandomBytes(byteLength) { + if (byteLength < 0) { + throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`); + } + return webByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +const webRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return (byteLength) => { + return crypto.getRandomValues(webByteUtils.allocate(byteLength)); + }; + } + else { + if (isReactNative()) { + const { console } = globalThis; + console?.warn?.('BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.'); + } + return webMathRandomBytes; + } +})(); +const HEX_DIGIT = /(\d|[a-f])/i; +const webByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialUint8array) { + const stringTag = potentialUint8array?.[Symbol.toStringTag] ?? + Object.prototype.toString.call(potentialUint8array); + if (stringTag === 'Uint8Array') { + return potentialUint8array; + } + if (ArrayBuffer.isView(potentialUint8array)) { + return new Uint8Array(potentialUint8array.buffer.slice(potentialUint8array.byteOffset, potentialUint8array.byteOffset + potentialUint8array.byteLength)); + } + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return new Uint8Array(potentialUint8array); + } + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); + }, + allocate(size) { + if (typeof size !== 'number') { + throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`); + } + return new Uint8Array(size); + }, + allocateUnsafe(size) { + return webByteUtils.allocate(size); + }, + compare(uint8Array, otherUint8Array) { + if (uint8Array === otherUint8Array) + return 0; + const len = Math.min(uint8Array.length, otherUint8Array.length); + for (let i = 0; i < len; i++) { + if (uint8Array[i] < otherUint8Array[i]) + return -1; + if (uint8Array[i] > otherUint8Array[i]) + return 1; + } + if (uint8Array.length < otherUint8Array.length) + return -1; + if (uint8Array.length > otherUint8Array.length) + return 1; + return 0; + }, + concat(uint8Arrays) { + if (uint8Arrays.length === 0) + return webByteUtils.allocate(0); + let totalLength = 0; + for (const uint8Array of uint8Arrays) { + totalLength += uint8Array.length; + } + const result = webByteUtils.allocate(totalLength); + let offset = 0; + for (const uint8Array of uint8Arrays) { + result.set(uint8Array, offset); + offset += uint8Array.length; + } + return result; + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + if (sourceEnd !== undefined && sourceEnd < 0) { + throw new RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${sourceEnd}`); + } + sourceEnd = sourceEnd ?? source.length; + if (sourceStart !== undefined && (sourceStart < 0 || sourceStart > sourceEnd)) { + throw new RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${sourceEnd}. Received ${sourceStart}`); + } + sourceStart = sourceStart ?? 0; + if (targetStart !== undefined && targetStart < 0) { + throw new RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${targetStart}`); + } + targetStart = targetStart ?? 0; + const srcSlice = source.subarray(sourceStart, sourceEnd); + const maxLen = Math.min(srcSlice.length, target.length - targetStart); + if (maxLen <= 0) { + return 0; + } + target.set(srcSlice.subarray(0, maxLen), targetStart); + return maxLen; + }, + equals(uint8Array, otherUint8Array) { + if (uint8Array.byteLength !== otherUint8Array.byteLength) { + return false; + } + for (let i = 0; i < uint8Array.byteLength; i++) { + if (uint8Array[i] !== otherUint8Array[i]) { + return false; + } + } + return true; + }, + fromNumberArray(array) { + return Uint8Array.from(array); + }, + fromBase64(base64) { + return Uint8Array.from(atob(base64), c => c.charCodeAt(0)); + }, + fromUTF8(utf8) { + return new TextEncoder().encode(utf8); + }, + toBase64(uint8array) { + return btoa(webByteUtils.toISO88591(uint8array)); + }, + fromISO88591(codePoints) { + return Uint8Array.from(codePoints, c => c.charCodeAt(0) & 0xff); + }, + toISO88591(uint8array) { + return Array.from(Uint16Array.from(uint8array), b => String.fromCharCode(b)).join(''); + }, + fromHex(hex) { + const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1); + const buffer = []; + for (let i = 0; i < evenLengthHex.length; i += 2) { + const firstDigit = evenLengthHex[i]; + const secondDigit = evenLengthHex[i + 1]; + if (!HEX_DIGIT.test(firstDigit)) { + break; + } + if (!HEX_DIGIT.test(secondDigit)) { + break; + } + const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16); + buffer.push(hexDigit); + } + return Uint8Array.from(buffer); + }, + toHex(uint8array) { + return Array.from(uint8array, byte => byte.toString(16).padStart(2, '0')).join(''); + }, + toUTF8(uint8array, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(uint8array, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + return parseUtf8(uint8array, start, end, fatal); + }, + utf8ByteLength(input) { + return new TextEncoder().encode(input).byteLength; + }, + encodeUTF8Into(uint8array, source, byteOffset) { + const bytes = new TextEncoder().encode(source); + uint8array.set(bytes, byteOffset); + return bytes.byteLength; + }, + randomBytes: webRandomBytes, + swap32(buffer) { + if (buffer.length % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + for (let i = 0; i < buffer.length; i += 4) { + const byte0 = buffer[i]; + const byte1 = buffer[i + 1]; + const byte2 = buffer[i + 2]; + const byte3 = buffer[i + 3]; + buffer[i] = byte3; + buffer[i + 1] = byte2; + buffer[i + 2] = byte1; + buffer[i + 3] = byte0; + } + return buffer; + } +}; + +const hasGlobalBuffer = typeof Buffer === 'function' && Buffer.prototype?._isBuffer !== true; +const ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils; + +const bsonType = Symbol.for('@@mdb.bson.type'); +class BSONValue { + get [bsonType]() { + return this._bsontype; + } + get [BSON_VERSION_SYMBOL]() { + return BSON_MAJOR_VERSION; + } + [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) { + return this.inspect(depth, options, inspect); + } +} + +const FLOAT = new Float64Array(1); +const FLOAT_BYTES = new Uint8Array(FLOAT.buffer, 0, 8); +FLOAT[0] = -1; +const isBigEndian = FLOAT_BYTES[7] === 0; +const NumberUtils = { + isBigEndian, + getNonnegativeInt32LE(source, offset) { + if (source[offset + 3] > 127) { + throw new RangeError(`Size cannot be negative at offset: ${offset}`); + } + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getInt32LE(source, offset) { + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getUint32LE(source, offset) { + return (source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + }, + getUint32BE(source, offset) { + return (source[offset + 3] + + source[offset + 2] * 256 + + source[offset + 1] * 65536 + + source[offset] * 16777216); + }, + getBigInt64LE(source, offset) { + const hi = BigInt(source[offset + 4] + + source[offset + 5] * 256 + + source[offset + 6] * 65536 + + (source[offset + 7] << 24)); + const lo = BigInt(source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + return (hi << 32n) + lo; + }, + getFloat64LE: isBigEndian + ? (source, offset) => { + FLOAT_BYTES[7] = source[offset]; + FLOAT_BYTES[6] = source[offset + 1]; + FLOAT_BYTES[5] = source[offset + 2]; + FLOAT_BYTES[4] = source[offset + 3]; + FLOAT_BYTES[3] = source[offset + 4]; + FLOAT_BYTES[2] = source[offset + 5]; + FLOAT_BYTES[1] = source[offset + 6]; + FLOAT_BYTES[0] = source[offset + 7]; + return FLOAT[0]; + } + : (source, offset) => { + FLOAT_BYTES[0] = source[offset]; + FLOAT_BYTES[1] = source[offset + 1]; + FLOAT_BYTES[2] = source[offset + 2]; + FLOAT_BYTES[3] = source[offset + 3]; + FLOAT_BYTES[4] = source[offset + 4]; + FLOAT_BYTES[5] = source[offset + 5]; + FLOAT_BYTES[6] = source[offset + 6]; + FLOAT_BYTES[7] = source[offset + 7]; + return FLOAT[0]; + }, + setInt32BE(destination, offset, value) { + destination[offset + 3] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset] = value; + return 4; + }, + setInt32LE(destination, offset, value) { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; + }, + setBigInt64LE(destination, offset, value) { + const mask32bits = 0xffffffffn; + let lo = Number(value & mask32bits); + destination[offset] = lo; + lo >>= 8; + destination[offset + 1] = lo; + lo >>= 8; + destination[offset + 2] = lo; + lo >>= 8; + destination[offset + 3] = lo; + let hi = Number((value >> 32n) & mask32bits); + destination[offset + 4] = hi; + hi >>= 8; + destination[offset + 5] = hi; + hi >>= 8; + destination[offset + 6] = hi; + hi >>= 8; + destination[offset + 7] = hi; + return 8; + }, + setFloat64LE: isBigEndian + ? (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[7]; + destination[offset + 1] = FLOAT_BYTES[6]; + destination[offset + 2] = FLOAT_BYTES[5]; + destination[offset + 3] = FLOAT_BYTES[4]; + destination[offset + 4] = FLOAT_BYTES[3]; + destination[offset + 5] = FLOAT_BYTES[2]; + destination[offset + 6] = FLOAT_BYTES[1]; + destination[offset + 7] = FLOAT_BYTES[0]; + return 8; + } + : (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[0]; + destination[offset + 1] = FLOAT_BYTES[1]; + destination[offset + 2] = FLOAT_BYTES[2]; + destination[offset + 3] = FLOAT_BYTES[3]; + destination[offset + 4] = FLOAT_BYTES[4]; + destination[offset + 5] = FLOAT_BYTES[5]; + destination[offset + 6] = FLOAT_BYTES[6]; + destination[offset + 7] = FLOAT_BYTES[7]; + return 8; + } +}; + +class Binary extends BSONValue { + get _bsontype() { + return 'Binary'; + } + static BSON_BINARY_SUBTYPE_DEFAULT = 0; + static BUFFER_SIZE = 256; + static SUBTYPE_DEFAULT = 0; + static SUBTYPE_FUNCTION = 1; + static SUBTYPE_BYTE_ARRAY = 2; + static SUBTYPE_UUID_OLD = 3; + static SUBTYPE_UUID = 4; + static SUBTYPE_MD5 = 5; + static SUBTYPE_ENCRYPTED = 6; + static SUBTYPE_COLUMN = 7; + static SUBTYPE_SENSITIVE = 8; + static SUBTYPE_VECTOR = 9; + static SUBTYPE_USER_DEFINED = 128; + static VECTOR_TYPE = Object.freeze({ + Int8: 0x03, + Float32: 0x27, + PackedBit: 0x10 + }); + buffer; + sub_type; + position; + constructor(buffer, subType) { + super(); + if (!(buffer == null) && + typeof buffer === 'string' && + !ArrayBuffer.isView(buffer) && + !isAnyArrayBuffer(buffer) && + !Array.isArray(buffer)) { + throw new BSONError('Binary can only be constructed from Uint8Array or number[]'); + } + this.sub_type = (subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT) & 0xff; + if (buffer == null) { + this.buffer = ByteUtils.allocate(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + this.buffer = Array.isArray(buffer) + ? ByteUtils.fromNumberArray(buffer) + : ByteUtils.toLocalBufferType(buffer); + this.position = this.buffer.byteLength; + } + } + put(byteValue) { + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONError('only accepts single character Uint8Array or Array'); + let decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.byteLength > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + const newSpace = ByteUtils.allocate(Binary.BUFFER_SIZE + this.buffer.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + this.buffer[this.position++] = decodedByte; + } + } + write(sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + if (this.buffer.byteLength < offset + sequence.length) { + const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + throw new BSONError('input cannot be string'); + } + } + read(position, length) { + length = length && length > 0 ? length : this.position; + const end = position + length; + return this.buffer.subarray(position, end > this.position ? this.position : end); + } + value() { + return this.buffer.length === this.position + ? this.buffer + : this.buffer.subarray(0, this.position); + } + length() { + return this.position; + } + toJSON() { + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.buffer.subarray(0, this.position)); + if (encoding === 'base64') + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + if (encoding === 'utf8' || encoding === 'utf-8') + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + } + toExtendedJSON(options) { + options = options || {}; + if (this.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(this); + } + const base64String = ByteUtils.toBase64(this.buffer); + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + toUUID() { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.subarray(0, this.position)); + } + throw new BSONError(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${Binary.SUBTYPE_UUID.toString(16).padStart(2, '0')} is currently supported.`); + } + static createFromHexString(hex, subType) { + return new Binary(ByteUtils.fromHex(hex), subType); + } + static createFromBase64(base64, subType) { + return new Binary(ByteUtils.fromBase64(base64), subType); + } + static fromExtendedJSON(doc, options) { + options = options || {}; + let data; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary.base64); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = UUID.bytesFromString(doc.$uuid); + } + if (!data) { + throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + const base64Arg = inspect(base64, options); + const subTypeArg = inspect(this.sub_type, options); + return `Binary.createFromBase64(${base64Arg}, ${subTypeArg})`; + } + toInt8Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Int8) { + throw new BSONError('Binary datatype field is not Int8'); + } + validateBinaryVector(this); + return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toFloat32Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Float32) { + throw new BSONError('Binary datatype field is not Float32'); + } + validateBinaryVector(this); + const floatBytes = new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(floatBytes); + return new Float32Array(floatBytes.buffer); + } + toPackedBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + const byteCount = this.length() - 2; + const bitCount = byteCount * 8 - this.buffer[1]; + const bits = new Int8Array(bitCount); + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = (bitOffset / 8) | 0; + const byte = this.buffer[byteOffset + 2]; + const shift = 7 - (bitOffset % 8); + const bit = (byte >> shift) & 1; + bits[bitOffset] = bit; + } + return bits; + } + static fromInt8Array(array) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.Int8; + buffer[1] = 0; + const intBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + buffer.set(intBytes, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromFloat32Array(array) { + const binaryBytes = ByteUtils.allocate(array.byteLength + 2); + binaryBytes[0] = Binary.VECTOR_TYPE.Float32; + binaryBytes[1] = 0; + const floatBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + binaryBytes.set(floatBytes, 2); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(new Uint8Array(binaryBytes.buffer, 2)); + const bin = new this(binaryBytes, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromPackedBits(array, padding = 0) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.PackedBit; + buffer[1] = padding; + buffer.set(array, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromBits(bits) { + const byteLength = (bits.length + 7) >>> 3; + const bytes = new Uint8Array(byteLength + 2); + bytes[0] = Binary.VECTOR_TYPE.PackedBit; + const remainder = bits.length % 8; + bytes[1] = remainder === 0 ? 0 : 8 - remainder; + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset >>> 3; + const bit = bits[bitOffset]; + if (bit !== 0 && bit !== 1) { + throw new BSONError(`Invalid bit value at ${bitOffset}: must be 0 or 1, found ${bits[bitOffset]}`); + } + if (bit === 0) + continue; + const shift = 7 - (bitOffset % 8); + bytes[byteOffset + 2] |= bit << shift; + } + return new this(bytes, Binary.SUBTYPE_VECTOR); + } +} +function validateBinaryVector(vector) { + if (vector.sub_type !== Binary.SUBTYPE_VECTOR) + return; + const size = vector.position; + const datatype = vector.buffer[0]; + const padding = vector.buffer[1]; + if ((datatype === Binary.VECTOR_TYPE.Float32 || datatype === Binary.VECTOR_TYPE.Int8) && + padding !== 0) { + throw new BSONError('Invalid Vector: padding must be zero for int8 and float32 vectors'); + } + if (datatype === Binary.VECTOR_TYPE.Float32) { + if (size !== 0 && size - 2 !== 0 && (size - 2) % 4 !== 0) { + throw new BSONError('Invalid Vector: Float32 vector must contain a multiple of 4 bytes'); + } + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding !== 0 && size === 2) { + throw new BSONError('Invalid Vector: padding must be zero for packed bit vectors that are empty'); + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding > 7) { + throw new BSONError(`Invalid Vector: padding must be a value between 0 and 7. found: ${padding}`); + } +} +const UUID_BYTE_LENGTH = 16; +const UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i; +const UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i; +class UUID extends Binary { + constructor(input) { + let bytes; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer)); + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ByteUtils.toLocalBufferType(input); + } + else if (typeof input === 'string') { + bytes = UUID.bytesFromString(input); + } + else { + throw new BSONError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + } + get id() { + return this.buffer; + } + set id(value) { + this.buffer = value; + } + toHexString(includeDashes = true) { + if (includeDashes) { + return [ + ByteUtils.toHex(this.buffer.subarray(0, 4)), + ByteUtils.toHex(this.buffer.subarray(4, 6)), + ByteUtils.toHex(this.buffer.subarray(6, 8)), + ByteUtils.toHex(this.buffer.subarray(8, 10)), + ByteUtils.toHex(this.buffer.subarray(10, 16)) + ].join('-'); + } + return ByteUtils.toHex(this.buffer); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.id); + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + equals(otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return ByteUtils.equals(otherId.id, this.id); + } + try { + return ByteUtils.equals(new UUID(otherId).id, this.id); + } + catch { + return false; + } + } + toBinary() { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + static generate() { + const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH); + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return bytes; + } + static isValid(input) { + if (!input) { + return false; + } + if (typeof input === 'string') { + return UUID.isValidUUIDString(input); + } + if (isUint8Array(input)) { + return input.byteLength === UUID_BYTE_LENGTH; + } + return (input._bsontype === 'Binary' && + input.sub_type === this.SUBTYPE_UUID && + input.buffer.byteLength === 16); + } + static createFromHexString(hexString) { + const buffer = UUID.bytesFromString(hexString); + return new UUID(buffer); + } + static createFromBase64(base64) { + return new UUID(ByteUtils.fromBase64(base64)); + } + static bytesFromString(representation) { + if (!UUID.isValidUUIDString(representation)) { + throw new BSONError('UUID string representation must be 32 hex digits or canonical hyphenated representation'); + } + return ByteUtils.fromHex(representation.replace(/-/g, '')); + } + static isValidUUIDString(representation) { + return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new UUID(${inspect(this.toHexString(), options)})`; + } +} + +class Code extends BSONValue { + get _bsontype() { + return 'Code'; + } + code; + scope; + constructor(code, scope) { + super(); + this.code = code.toString(); + this.scope = scope ?? null; + } + toJSON() { + if (this.scope != null) { + return { code: this.code, scope: this.scope }; + } + return { code: this.code }; + } + toExtendedJSON() { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + } + static fromExtendedJSON(doc) { + return new Code(doc.$code, doc.$scope); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + let parametersString = inspect(this.code, options); + const multiLineFn = parametersString.includes('\n'); + if (this.scope != null) { + parametersString += `,${multiLineFn ? '\n' : ' '}${inspect(this.scope, options)}`; + } + const endingNewline = multiLineFn && this.scope === null; + return `new Code(${multiLineFn ? '\n' : ''}${parametersString}${endingNewline ? '\n' : ''})`; + } +} + +function isDBRefLike(value) { + return (value != null && + typeof value === 'object' && + '$id' in value && + value.$id != null && + '$ref' in value && + typeof value.$ref === 'string' && + (!('$db' in value) || ('$db' in value && typeof value.$db === 'string'))); +} +class DBRef extends BSONValue { + get _bsontype() { + return 'DBRef'; + } + collection; + oid; + db; + fields; + constructor(collection, oid, db, fields) { + super(); + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + get namespace() { + return this.collection; + } + set namespace(value) { + this.collection = value; + } + toJSON() { + const o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + } + toExtendedJSON(options) { + options = options || {}; + let o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + static fromExtendedJSON(doc) { + const copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const args = [ + inspect(this.namespace, options), + inspect(this.oid, options), + ...(this.db ? [inspect(this.db, options)] : []), + ...(Object.keys(this.fields).length > 0 ? [inspect(this.fields, options)] : []) + ]; + args[1] = inspect === defaultInspect ? `new ObjectId(${args[1]})` : args[1]; + return `new DBRef(${args.join(', ')})`; + } +} + +function removeLeadingZerosAndExplicitPlus(str) { + if (str === '') { + return str; + } + let startIndex = 0; + const isNegative = str[startIndex] === '-'; + const isExplicitlyPositive = str[startIndex] === '+'; + if (isExplicitlyPositive || isNegative) { + startIndex += 1; + } + let foundInsignificantZero = false; + for (; startIndex < str.length && str[startIndex] === '0'; ++startIndex) { + foundInsignificantZero = true; + } + if (!foundInsignificantZero) { + return isExplicitlyPositive ? str.slice(1) : str; + } + return `${isNegative ? '-' : ''}${str.length === startIndex ? '0' : str.slice(startIndex)}`; +} +function validateStringCharacters(str, radix) { + radix = radix ?? 10; + const validCharacters = '0123456789abcdefghijklmnopqrstuvwxyz'.slice(0, radix); + const regex = new RegExp(`[^-+${validCharacters}]`, 'i'); + return regex.test(str) ? false : str; +} + +let wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch { +} +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +const INT_CACHE = {}; +const UINT_CACHE = {}; +const MAX_INT64_STRING_LENGTH = 20; +const DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/; +class Long extends BSONValue { + get _bsontype() { + return 'Long'; + } + get __isLong__() { + return true; + } + high; + low; + unsigned; + constructor(lowOrValue = 0, highOrUnsigned, unsigned) { + super(); + const unsignedBool = typeof highOrUnsigned === 'boolean' ? highOrUnsigned : Boolean(unsigned); + const high = typeof highOrUnsigned === 'number' ? highOrUnsigned : 0; + const res = typeof lowOrValue === 'string' + ? Long.fromString(lowOrValue, unsignedBool) + : typeof lowOrValue === 'bigint' + ? Long.fromBigInt(lowOrValue, unsignedBool) + : { low: lowOrValue | 0, high: high | 0, unsigned: unsignedBool }; + this.low = res.low; + this.high = res.high; + this.unsigned = res.unsigned; + } + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + static ZERO = Long.fromInt(0); + static UZERO = Long.fromInt(0, true); + static ONE = Long.fromInt(1); + static UONE = Long.fromInt(1, true); + static NEG_ONE = Long.fromInt(-1); + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + static fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + static fromInt(value, unsigned) { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + static fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + static fromBigInt(value, unsigned) { + const FROM_BIGINT_BIT_MASK = 0xffffffffn; + const FROM_BIGINT_BIT_SHIFT = 32n; + return new Long(Number(value & FROM_BIGINT_BIT_MASK), Number((value >> FROM_BIGINT_BIT_SHIFT) & FROM_BIGINT_BIT_MASK), unsigned); + } + static _fromString(str, unsigned, radix) { + if (str.length === 0) + throw new BSONError('empty string'); + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + let p; + if ((p = str.indexOf('-')) > 0) + throw new BSONError('interior hyphen'); + else if (p === 0) { + return Long._fromString(str.substring(1), unsigned, radix).neg(); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + static fromStringStrict(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str.trim() !== str) { + throw new BSONError(`Input: '${str}' contains leading and/or trailing whitespace`); + } + if (!validateStringCharacters(str, radix)) { + throw new BSONError(`Input: '${str}' contains invalid characters for radix: ${radix}`); + } + const cleanedStr = removeLeadingZerosAndExplicitPlus(str); + const result = Long._fromString(cleanedStr, unsigned, radix); + if (result.toString(radix).toLowerCase() !== cleanedStr.toLowerCase()) { + throw new BSONError(`Input: ${str} is not representable as ${result.unsigned ? 'an unsigned' : 'a signed'} 64-bit Long ${radix != null ? `with radix: ${radix}` : ''}`); + } + return result; + } + static fromString(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str === 'NaN' && radix < 24) { + return Long.ZERO; + } + else if ((str === 'Infinity' || str === '+Infinity' || str === '-Infinity') && radix < 35) { + return Long.ZERO; + } + return Long._fromString(str, unsigned, radix); + } + static fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + static fromBytesLE(bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + } + static fromBytesBE(bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + } + static isLong(value) { + return (value != null && + typeof value === 'object' && + '__isLong__' in value && + value.__isLong__ === true); + } + static fromValue(val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + } + add(addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + and(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + compare(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + const thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + comp(other) { + return this.compare(other); + } + divide(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw new BSONError('division by zero'); + if (wasm) { + if (!this.unsigned && + this.high === -2147483648 && + divisor.low === -1 && + divisor.high === -1) { + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + return Long.UONE; + res = Long.UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + div(divisor) { + return this.divide(divisor); + } + equals(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + eq(other) { + return this.equals(other); + } + getHighBits() { + return this.high; + } + getHighBitsUnsigned() { + return this.high >>> 0; + } + getLowBits() { + return this.low; + } + getLowBitsUnsigned() { + return this.low >>> 0; + } + getNumBitsAbs() { + if (this.isNegative()) { + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + greaterThan(other) { + return this.comp(other) > 0; + } + gt(other) { + return this.greaterThan(other); + } + greaterThanOrEqual(other) { + return this.comp(other) >= 0; + } + gte(other) { + return this.greaterThanOrEqual(other); + } + ge(other) { + return this.greaterThanOrEqual(other); + } + isEven() { + return (this.low & 1) === 0; + } + isNegative() { + return !this.unsigned && this.high < 0; + } + isOdd() { + return (this.low & 1) === 1; + } + isPositive() { + return this.unsigned || this.high >= 0; + } + isZero() { + return this.high === 0 && this.low === 0; + } + lessThan(other) { + return this.comp(other) < 0; + } + lt(other) { + return this.lessThan(other); + } + lessThanOrEqual(other) { + return this.comp(other) <= 0; + } + lte(other) { + return this.lessThanOrEqual(other); + } + modulo(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + } + mod(divisor) { + return this.modulo(divisor); + } + rem(divisor) { + return this.modulo(divisor); + } + multiply(multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + mul(multiplier) { + return this.multiply(multiplier); + } + negate() { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + neg() { + return this.negate(); + } + not() { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + notEquals(other) { + return !this.equals(other); + } + neq(other) { + return this.notEquals(other); + } + ne(other) { + return this.notEquals(other); + } + or(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + shiftLeft(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + shl(numBits) { + return this.shiftLeft(numBits); + } + shiftRight(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + shr(numBits) { + return this.shiftRight(numBits); + } + shiftRightUnsigned(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + shr_u(numBits) { + return this.shiftRightUnsigned(numBits); + } + shru(numBits) { + return this.shiftRightUnsigned(numBits); + } + subtract(subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + sub(subtrahend) { + return this.subtract(subtrahend); + } + toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + } + toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + toBigInt() { + return BigInt(this.toString()); + } + toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + } + toBytesLE() { + const hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + toBytesBE() { + const hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + toSigned() { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + } + toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + if (this.eq(Long.MIN_VALUE)) { + const radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + let rem = this; + let result = ''; + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + } + toUnsigned() { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + } + xor(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + eqz() { + return this.isZero(); + } + le(other) { + return this.lessThanOrEqual(other); + } + toExtendedJSON(options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc, options) { + const { useBigInt64 = false, relaxed = true } = { ...options }; + if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) { + throw new BSONError('$numberLong string is too long'); + } + if (!DECIMAL_REG_EX.test(doc.$numberLong)) { + throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`); + } + if (useBigInt64) { + const bigIntResult = BigInt(doc.$numberLong); + return BigInt.asIntN(64, bigIntResult); + } + const longResult = Long.fromString(doc.$numberLong); + if (relaxed) { + return longResult.toNumber(); + } + return longResult; + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const longVal = inspect(this.toString(), options); + const unsignedVal = this.unsigned ? `, ${inspect(this.unsigned, options)}` : ''; + return `new Long(${longVal}${unsignedVal})`; + } +} + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; +const NAN_BUFFER = ByteUtils.fromNumberArray([ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray([ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray([ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; +const COMBINATION_MASK = 0x1f; +const EXPONENT_MASK = 0x3fff; +const COMBINATION_INFINITY = 30; +const COMBINATION_NAN = 31; +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +function divideu128(value) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (let i = 0; i <= 3; i++) { + _rem = _rem.shiftLeft(32); + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message}`); +} +class Decimal128 extends BSONValue { + get _bsontype() { + return 'Decimal128'; + } + bytes; + constructor(bytes) { + super(); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (bytes instanceof Uint8Array || isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONError('Decimal128 must take a Buffer or string'); + } + } + static fromString(representation) { + return Decimal128._fromString(representation, { allowRounding: false }); + } + static fromStringWithRounding(representation) { + return Decimal128._fromString(representation, { allowRounding: true }); + } + static _fromString(representation, options) { + let isNegative = false; + let sawSign = false; + let sawRadix = false; + let foundNonZero = false; + let significantDigits = 0; + let nDigitsRead = 0; + let nDigits = 0; + let radixPosition = 0; + let firstNonZero = 0; + const digits = [0]; + let nDigitsStored = 0; + let digitsInsert = 0; + let lastDigit = 0; + let exponent = 0; + let significandHigh = new Long(0, 0); + let significandLow = new Long(0, 0); + let biasedExponent = 0; + let index = 0; + if (representation.length >= 7000) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + const unsignedNumber = stringMatch[2]; + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + if (representation[index] === '+' || representation[index] === '-') { + sawSign = true; + isNegative = representation[index++] === '-'; + } + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + else if (representation[index] === 'N') { + return new Decimal128(NAN_BUFFER); + } + } + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < MAX_DIGITS) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + if (representation[index] === 'e' || representation[index] === 'E') { + const match = representation.substr(++index).match(EXPONENT_REGEX); + if (!match || !match[2]) + return new Decimal128(NAN_BUFFER); + exponent = parseInt(match[0], 10); + index = index + match[0].length; + } + if (representation[index]) + return new Decimal128(NAN_BUFFER); + if (!nDigitsStored) { + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (representation[firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix)] === '0') { + significantDigits = significantDigits - 1; + } + } + } + if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + while (exponent > EXPONENT_MAX) { + lastDigit = lastDigit + 1; + if (lastDigit >= MAX_DIGITS) { + if (significantDigits === 0) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + if (options.allowRounding) { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + nDigits = nDigits - 1; + } + else { + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (let i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + let dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + } + } + else { + break; + } + } + } + } + } + else { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0) { + if (significantDigits === 0) { + exponent = EXPONENT_MIN; + break; + } + invalidErr(representation, 'exponent underflow'); + } + if (nDigitsStored < nDigits) { + if (representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== '0' && + significantDigits !== 0) { + invalidErr(representation, 'inexact rounding'); + } + nDigits = nDigits - 1; + } + else { + if (digits[lastDigit] !== 0) { + invalidErr(representation, 'inexact rounding'); + } + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + if (sawRadix) { + firstNonZero = firstNonZero + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + if (roundDigit !== 0) { + invalidErr(representation, 'inexact rounding'); + } + } + } + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit < 17) { + let dIdx = 0; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + let dIdx = 0; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + const buffer = ByteUtils.allocateUnsafe(16); + index = 0; + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + return new Decimal128(buffer); + } + toString() { + let biased_exponent; + let significand_digits = 0; + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) + significand[i] = 0; + let index = 0; + let is_zero = false; + let significand_msb; + let significand128 = { parts: [0, 0, 0, 0] }; + let j, k; + const string = []; + index = 0; + const buffer = this.bytes; + const low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + index = 0; + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + const combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + const exponent = biased_exponent - EXPONENT_BIAS; + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + significand[k * 9 + j] = least_digits % 10; + least_digits = Math.floor(least_digits / 10); + } + } + } + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + const scientific_exponent = significand_digits - 1 + exponent; + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) + string.push(`E+${exponent}`); + else if (exponent < 0) + string.push(`E${exponent}`); + return string.join(''); + } + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + string.push('E'); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } + else { + string.push(`${scientific_exponent}`); + } + } + else { + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } + else { + let radix_position = significand_digits + exponent; + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } + else { + string.push('0'); + } + string.push('.'); + while (radix_position++ < 0) { + string.push('0'); + } + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + return string.join(''); + } + toJSON() { + return { $numberDecimal: this.toString() }; + } + toExtendedJSON() { + return { $numberDecimal: this.toString() }; + } + static fromExtendedJSON(doc) { + return Decimal128.fromString(doc.$numberDecimal); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const d128string = inspect(this.toString(), options); + return `new Decimal128(${d128string})`; + } +} + +class Double extends BSONValue { + get _bsontype() { + return 'Double'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + static fromString(value) { + const coercedValue = Number(value); + if (value === 'NaN') + return new Double(NaN); + if (value === 'Infinity') + return new Double(Infinity); + if (value === '-Infinity') + return new Double(-Infinity); + if (!Number.isFinite(coercedValue)) { + throw new BSONError(`Input: ${value} is not representable as a Double`); + } + if (value.trim() !== value) { + throw new BSONError(`Input: '${value}' contains whitespace`); + } + if (value === '') { + throw new BSONError(`Input is an empty string`); + } + if (/[^-0-9.+eE]/.test(value)) { + throw new BSONError(`Input: '${value}' is not in decimal or exponential notation`); + } + return new Double(coercedValue); + } + valueOf() { + return this.value; + } + toJSON() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toExtendedJSON(options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: '-0.0' }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + static fromExtendedJSON(doc, options) { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Double(${inspect(this.value, options)})`; + } +} + +class Int32 extends BSONValue { + get _bsontype() { + return 'Int32'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + static fromString(value) { + const cleanedValue = removeLeadingZerosAndExplicitPlus(value); + const coercedValue = Number(value); + if (BSON_INT32_MAX < coercedValue) { + throw new BSONError(`Input: '${value}' is larger than the maximum value for Int32`); + } + else if (BSON_INT32_MIN > coercedValue) { + throw new BSONError(`Input: '${value}' is smaller than the minimum value for Int32`); + } + else if (!Number.isSafeInteger(coercedValue)) { + throw new BSONError(`Input: '${value}' is not a safe integer`); + } + else if (coercedValue.toString() !== cleanedValue) { + throw new BSONError(`Input: '${value}' is not a valid Int32 string`); + } + return new Int32(coercedValue); + } + valueOf() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toJSON() { + return this.value; + } + toExtendedJSON(options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + } + static fromExtendedJSON(doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Int32(${inspect(this.value, options)})`; + } +} + +class MaxKey extends BSONValue { + get _bsontype() { + return 'MaxKey'; + } + toExtendedJSON() { + return { $maxKey: 1 }; + } + static fromExtendedJSON() { + return new MaxKey(); + } + inspect() { + return 'new MaxKey()'; + } +} + +class MinKey extends BSONValue { + get _bsontype() { + return 'MinKey'; + } + toExtendedJSON() { + return { $minKey: 1 }; + } + static fromExtendedJSON() { + return new MinKey(); + } + inspect() { + return 'new MinKey()'; + } +} + +const __idCache = new WeakMap(); +const byteToHex = []; +for (let n = 0; n < 256; n++) + byteToHex.push(n.toString(16).padStart(2, '0')); +const hexCharCodeToNibble = new Int8Array(103); +for (let c = 48; c <= 57; c++) + hexCharCodeToNibble[c] = c - 48; +for (let c = 65; c <= 70; c++) + hexCharCodeToNibble[c] = c - 55; +for (let c = 97; c <= 102; c++) + hexCharCodeToNibble[c] = c - 87; +class ObjectId extends BSONValue { + get _bsontype() { + return 'ObjectId'; + } + static index = 0; + static PROCESS_UNIQUE = null; + static resetState = () => { + this.index = Math.floor(Math.random() * 0x1000000); + this.PROCESS_UNIQUE = null; + }; + static { + this.resetState(); + const { startupSnapshot } = globalThis?.process?.getBuiltinModule?.('v8') ?? {}; + if (startupSnapshot?.isBuildingSnapshot?.()) { + startupSnapshot?.addDeserializeCallback?.(this.resetState); + } + } + static cacheHexString; + i0; + i1; + i2; + i3; + setFromBytes(b, offset = 0) { + this.i0 = (b[offset] << 16) | (b[offset + 1] << 8) | b[offset + 2]; + this.i1 = (b[offset + 3] << 16) | (b[offset + 4] << 8) | b[offset + 5]; + this.i2 = (b[offset + 6] << 16) | (b[offset + 7] << 8) | b[offset + 8]; + this.i3 = (b[offset + 9] << 16) | (b[offset + 10] << 8) | b[offset + 11]; + } + setFromHex(s) { + const t = hexCharCodeToNibble; + this.i0 = + (t[s.charCodeAt(0)] << 20) | + (t[s.charCodeAt(1)] << 16) | + (t[s.charCodeAt(2)] << 12) | + (t[s.charCodeAt(3)] << 8) | + (t[s.charCodeAt(4)] << 4) | + t[s.charCodeAt(5)]; + this.i1 = + (t[s.charCodeAt(6)] << 20) | + (t[s.charCodeAt(7)] << 16) | + (t[s.charCodeAt(8)] << 12) | + (t[s.charCodeAt(9)] << 8) | + (t[s.charCodeAt(10)] << 4) | + t[s.charCodeAt(11)]; + this.i2 = + (t[s.charCodeAt(12)] << 20) | + (t[s.charCodeAt(13)] << 16) | + (t[s.charCodeAt(14)] << 12) | + (t[s.charCodeAt(15)] << 8) | + (t[s.charCodeAt(16)] << 4) | + t[s.charCodeAt(17)]; + this.i3 = + (t[s.charCodeAt(18)] << 20) | + (t[s.charCodeAt(19)] << 16) | + (t[s.charCodeAt(20)] << 12) | + (t[s.charCodeAt(21)] << 8) | + (t[s.charCodeAt(22)] << 4) | + t[s.charCodeAt(23)]; + } + constructor(inputId, offset) { + super(); + if (typeof offset === 'number') { + this.setFromBytes(inputId, offset); + return; + } + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (ObjectId.is(inputId) && + typeof inputId.i0 === 'number' && + typeof inputId.i1 === 'number' && + typeof inputId.i2 === 'number' && + typeof inputId.i3 === 'number') { + this.i0 = inputId.i0; + this.i1 = inputId.i1; + this.i2 = inputId.i2; + this.i3 = inputId.i3; + return; + } + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = ByteUtils.fromHex(inputId.toHexString()); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + if (workingId == null) { + const time = Math.floor(Date.now() / 1000); + const inc = ObjectId.getInc(); + const pu = (ObjectId.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + this.i0 = (time >>> 8) & 0xffffff; + this.i1 = ((time & 0xff) << 16) | (pu[0] << 8) | pu[1]; + this.i2 = (pu[2] << 16) | (pu[3] << 8) | pu[4]; + this.i3 = inc & 0xffffff; + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + this.setFromBytes(workingId instanceof Uint8Array ? workingId : ByteUtils.toLocalBufferType(workingId)); + } + else if (typeof workingId === 'string') { + if (ObjectId.validateHexString(workingId)) { + this.setFromHex(workingId); + if (ObjectId.cacheHexString) { + __idCache.set(this, workingId); + } + } + else { + throw new BSONError('input must be a 24 character hex string, 12 byte Uint8Array, or an integer'); + } + } + else { + throw new BSONError('Argument passed in does not match the accepted types'); + } + } + get id() { + const b = ByteUtils.allocateUnsafe(12); + b[0] = (this.i0 >>> 16) & 0xff; + b[1] = (this.i0 >>> 8) & 0xff; + b[2] = this.i0 & 0xff; + b[3] = (this.i1 >>> 16) & 0xff; + b[4] = (this.i1 >>> 8) & 0xff; + b[5] = this.i1 & 0xff; + b[6] = (this.i2 >>> 16) & 0xff; + b[7] = (this.i2 >>> 8) & 0xff; + b[8] = this.i2 & 0xff; + b[9] = (this.i3 >>> 16) & 0xff; + b[10] = (this.i3 >>> 8) & 0xff; + b[11] = this.i3 & 0xff; + return b; + } + set id(value) { + const bytes = value instanceof Uint8Array ? value : ByteUtils.toLocalBufferType(value); + this.setFromBytes(bytes); + if (ObjectId.cacheHexString) { + __idCache.set(this, ByteUtils.toHex(bytes)); + } + } + static validateHexString(string) { + if (string?.length !== 24) + return false; + for (let i = 0; i < 24; i++) { + const char = string.charCodeAt(i); + if ((char >= 48 && char <= 57) || + (char >= 97 && char <= 102) || + (char >= 65 && char <= 70)) { + continue; + } + return false; + } + return true; + } + toHexString() { + if (ObjectId.cacheHexString) { + const __id = __idCache.get(this); + if (__id) + return __id; + } + const i0 = this.i0; + const i1 = this.i1; + const i2 = this.i2; + const i3 = this.i3; + const hexString = byteToHex[(i0 >>> 16) & 0xff] + + byteToHex[(i0 >>> 8) & 0xff] + + byteToHex[i0 & 0xff] + + byteToHex[(i1 >>> 16) & 0xff] + + byteToHex[(i1 >>> 8) & 0xff] + + byteToHex[i1 & 0xff] + + byteToHex[(i2 >>> 16) & 0xff] + + byteToHex[(i2 >>> 8) & 0xff] + + byteToHex[i2 & 0xff] + + byteToHex[(i3 >>> 16) & 0xff] + + byteToHex[(i3 >>> 8) & 0xff] + + byteToHex[i3 & 0xff]; + if (ObjectId.cacheHexString) { + __idCache.set(this, hexString); + } + return hexString; + } + static getInc() { + return (ObjectId.index = (ObjectId.index + 1) % 0x1000000); + } + static generate(time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + const inc = ObjectId.getInc(); + const buffer = ByteUtils.allocateUnsafe(12); + NumberUtils.setInt32BE(buffer, 0, time); + const PROCESS_UNIQUE = (this.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + buffer[11] = inc & 0xff; + buffer[10] = (inc >>> 8) & 0xff; + buffer[9] = (inc >>> 16) & 0xff; + return buffer; + } + toString(encoding) { + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + if (encoding === 'hex') + return this.toHexString(); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + static is(variable) { + return (variable != null && + typeof variable === 'object' && + '_bsontype' in variable && + variable._bsontype === 'ObjectId'); + } + equals(otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (ObjectId.is(otherId) && + typeof otherId.i0 === 'number' && + typeof otherId.i1 === 'number' && + typeof otherId.i2 === 'number' && + typeof otherId.i3 === 'number') { + return (this.i3 === otherId.i3 && + this.i0 === otherId.i0 && + this.i1 === otherId.i1 && + this.i2 === otherId.i2); + } + if (typeof otherId === 'string') { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'object' && typeof otherId.toHexString === 'function') { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + } + getTimestamp() { + const timestamp = new Date(); + const time = this.i0 * 0x100 + (this.i1 >>> 16); + timestamp.setTime(time * 1000); + return timestamp; + } + static createPk() { + return new ObjectId(); + } + serializeInto(uint8array, index) { + uint8array[index] = (this.i0 >>> 16) & 0xff; + uint8array[index + 1] = (this.i0 >>> 8) & 0xff; + uint8array[index + 2] = this.i0 & 0xff; + uint8array[index + 3] = (this.i1 >>> 16) & 0xff; + uint8array[index + 4] = (this.i1 >>> 8) & 0xff; + uint8array[index + 5] = this.i1 & 0xff; + uint8array[index + 6] = (this.i2 >>> 16) & 0xff; + uint8array[index + 7] = (this.i2 >>> 8) & 0xff; + uint8array[index + 8] = this.i2 & 0xff; + uint8array[index + 9] = (this.i3 >>> 16) & 0xff; + uint8array[index + 10] = (this.i3 >>> 8) & 0xff; + uint8array[index + 11] = this.i3 & 0xff; + return 12; + } + static createFromTime(time) { + const buffer = ByteUtils.allocate(12); + for (let i = 11; i >= 4; i--) + buffer[i] = 0; + NumberUtils.setInt32BE(buffer, 0, time); + return new ObjectId(buffer); + } + static createFromHexString(hexString) { + if (hexString?.length !== 24) { + throw new BSONError('hex string must be 24 characters'); + } + return new ObjectId(ByteUtils.fromHex(hexString)); + } + static createFromBase64(base64) { + if (base64?.length !== 16) { + throw new BSONError('base64 string must be 16 characters'); + } + return new ObjectId(ByteUtils.fromBase64(base64)); + } + static isValid(id) { + if (id == null) + return false; + if (typeof id === 'string') + return ObjectId.validateHexString(id); + try { + new ObjectId(id); + return true; + } + catch { + return false; + } + } + toExtendedJSON() { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + static fromExtendedJSON(doc) { + return new ObjectId(doc.$oid); + } + isCached() { + return ObjectId.cacheHexString && __idCache.has(this); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new ObjectId(${inspect(this.toHexString(), options)})`; + } +} + +function internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined) { + const objectStack = [ + { object, ignoreUndefined: ignoreUndefined ?? false, exit: false } + ]; + const path = new Set(); + let total = 0; + while (objectStack.length > 0) { + const frame = objectStack.pop(); + if (frame.exit) { + path.delete(frame.object); + continue; + } + const { object: obj, ignoreUndefined: frameIgnoreUndefined } = frame; + path.add(obj); + frame.exit = true; + objectStack.push(frame); + total += 5; + const isObjArray = Array.isArray(obj); + const isObjMap = !isObjArray && (obj instanceof Map || isMap(obj)); + let target = obj; + if (!isObjArray && !isObjMap && typeof obj?.toBSON === 'function') { + target = obj.toBSON(); + } + if (isObjArray) { + const array = target; + for (let i = 0; i < array.length; i++) { + total += calculateElementSize(i.toString(), array[i], serializeFunctions, true, frameIgnoreUndefined, objectStack, path); + } + } + else if (isObjMap) { + for (const [key, value] of target) { + total += calculateElementSize(key, value, serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + else { + for (const key of Object.keys(target)) { + total += calculateElementSize(key, target[key], serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + } + return total; +} +function calculateElementSize(name, value, serializeFunctions = false, isArray = false, ignoreUndefined = false, objectStack, path) { + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return ByteUtils.utf8ByteLength(name) + 1 + 1; + return 0; + case 'boolean': + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 1); + case 'object': + if (value != null && + typeof value._bsontype === 'string' && + value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (value == null || value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') { + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value._bsontype === 'ObjectId') { + return ByteUtils.utf8ByteLength(name) + 1 + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 4 + 1) + value.byteLength; + } + else if (value._bsontype === 'Long' || + value._bsontype === 'Double' || + value._bsontype === 'Timestamp') { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (value._bsontype === 'Decimal128') { + return ByteUtils.utf8ByteLength(name) + 1 + (16 + 1); + } + else if (value._bsontype === 'Int32') { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else if (value._bsontype === 'Code') { + if (value.scope != null && Object.keys(value.scope).length > 0) { + if (path.has(value.scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value.scope, ignoreUndefined, exit: false }); + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + else { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + } + else if (value._bsontype === 'Binary') { + const binary = value; + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1 + 4); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1); + } + } + else if (value._bsontype === 'BSONSymbol') { + return (ByteUtils.utf8ByteLength(name) + 1 + ByteUtils.utf8ByteLength(value.value) + 4 + 1 + 1); + } + else if (value._bsontype === 'DBRef') { + const ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + if (value.db != null) { + ordered_values['$db'] = value.db; + } + objectStack.push({ object: ordered_values, ignoreUndefined: true, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value instanceof RegExp || isRegExp(value)) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.source) + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value._bsontype === 'BSONRegExp') { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.pattern) + + 1 + + ByteUtils.utf8ByteLength(value.options) + + 1); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value, ignoreUndefined, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + case 'function': + if (serializeFunctions) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.toString()) + + 1); + } + return 0; + case 'bigint': + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + case 'symbol': + return 0; + default: + throw new BSONError(`Unrecognized JS type: ${typeof value}`); + } +} + +function alphabetize(str) { + return str.split('').sort().join(''); +} +class BSONRegExp extends BSONValue { + get _bsontype() { + return 'BSONRegExp'; + } + pattern; + options; + constructor(pattern, options) { + super(); + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`); + } + for (let i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + static parseOptions(options) { + return options ? options.split('').sort().join('') : ''; + } + toExtendedJSON(options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + static fromExtendedJSON(doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } + inspect(depth, options, inspect) { + const stylize = getStylizeFunction(options) ?? (v => v); + inspect ??= defaultInspect; + const pattern = stylize(inspect(this.pattern), 'regexp'); + const flags = stylize(inspect(this.options), 'regexp'); + return `new BSONRegExp(${pattern}, ${flags})`; + } +} + +class BSONSymbol extends BSONValue { + get _bsontype() { + return 'BSONSymbol'; + } + value; + constructor(value) { + super(); + this.value = value; + } + valueOf() { + return this.value; + } + toString() { + return this.value; + } + toJSON() { + return this.value; + } + toExtendedJSON() { + return { $symbol: this.value }; + } + static fromExtendedJSON(doc) { + return new BSONSymbol(doc.$symbol); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new BSONSymbol(${inspect(this.value, options)})`; + } +} + +const LongWithoutOverridesClass = Long; +class Timestamp extends LongWithoutOverridesClass { + get _bsontype() { + return 'Timestamp'; + } + get [bsonType]() { + return 'Timestamp'; + } + static MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + get i() { + return this.low >>> 0; + } + get t() { + return this.high >>> 0; + } + constructor(low) { + if (low == null) { + super(0, 0, true); + } + else if (typeof low === 'bigint') { + super(low, true); + } + else if (Long.isLong(low)) { + super(low.low, low.high, true); + } + else if (typeof low === 'object' && 't' in low && 'i' in low) { + if (typeof low.t !== 'number' && (typeof low.t !== 'object' || low.t._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide t as a number'); + } + if (typeof low.i !== 'number' && (typeof low.i !== 'object' || low.i._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide i as a number'); + } + const t = Number(low.t); + const i = Number(low.i); + if (t < 0 || Number.isNaN(t)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive t'); + } + if (i < 0 || Number.isNaN(i)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive i'); + } + if (t > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide t equal or less than uint32 max'); + } + if (i > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide i equal or less than uint32 max'); + } + super(i, t, true); + } + else { + throw new BSONError('A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }'); + } + } + toJSON() { + return { + $timestamp: this.toString() + }; + } + static fromInt(value) { + return new Timestamp(Long.fromInt(value, true)); + } + static fromNumber(value) { + return new Timestamp(Long.fromNumber(value, true)); + } + static fromBits(lowBits, highBits) { + return new Timestamp({ i: lowBits, t: highBits }); + } + static fromString(str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + toExtendedJSON() { + return { $timestamp: { t: this.t, i: this.i } }; + } + static fromExtendedJSON(doc) { + const i = Long.isLong(doc.$timestamp.i) + ? doc.$timestamp.i.getLowBitsUnsigned() + : doc.$timestamp.i; + const t = Long.isLong(doc.$timestamp.t) + ? doc.$timestamp.t.getLowBitsUnsigned() + : doc.$timestamp.t; + return new Timestamp({ t, i }); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const t = inspect(this.t, options); + const i = inspect(this.i, options); + return `new Timestamp({ t: ${t}, i: ${i} })`; + } +} + +const JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +function internalDeserialize(buffer, options, isArray) { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + const size = NumberUtils.getInt32LE(buffer, index); + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + if (size + index > buffer.byteLength) { + throw new BSONError(`(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})`); + } + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + return deserializeObject(buffer, index, options, isArray); +} +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function assignValue(dest, name, value) { + if (name === '__proto__') { + Object.defineProperty(dest, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + dest[name] = value; + } +} +function toPotentialDbRef(doc) { + if (isDBRefLike(doc)) { + const { $ref, $id, $db, ...fields } = doc; + return new DBRef($ref, $id, $db, fields); + } + return doc; +} +function deserializeObject(buffer, index, options, isArray = false) { + options = { ...options }; + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + const raw = options['raw'] == null ? false : options['raw']; + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + const promoteBuffers = options.promoteBuffers ?? false; + const promoteLongs = options.promoteLongs ?? true; + const promoteValues = options.promoteValues ?? true; + const useBigInt64 = options.useBigInt64 ?? false; + if (useBigInt64 && !promoteValues) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + if (useBigInt64 && !promoteLongs) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + const validation = options.validation == null ? { utf8: true } : options.validation; + let globalUTFValidation = true; + let validationSetting; + let utf8KeysSet; + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + if (!globalUTFValidation) { + utf8KeysSet = new Set(); + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + const startIndex = index; + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + const size = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + const rootObject = isArray ? [] : {}; + let arrayIndex = 0; + let isPossibleDBRef = isArray ? false : null; + let currentFrame = null; + let currentDest = rootObject; + let currentIsArray = isArray; + while (true) { + const elementType = buffer[index++]; + if (elementType === 0) { + if (currentFrame) { + if (index === currentFrame.lastIndex) { + const completedFrame = currentFrame; + currentFrame = completedFrame.prev; + if (currentFrame === null) { + currentDest = rootObject; + currentIsArray = isArray; + } + else { + currentDest = currentFrame.holdingDocument; + currentIsArray = currentFrame.isArray; + } + let result = completedFrame.holdingDocument; + switch (completedFrame.elementType) { + case BSON_DATA_OBJECT: + if (completedFrame.isPossibleDBRef) { + result = toPotentialDbRef(result); + } + break; + case BSON_DATA_ARRAY: + break; + case BSON_DATA_CODE_W_SCOPE: + result = new Code(completedFrame.functionString, completedFrame.holdingDocument); + break; + default: + throw new BSONError('Unexpected element type in frame stack'); + } + assignValue(currentDest, completedFrame.propertyName, result); + continue; + } + else { + if (currentFrame.elementType === BSON_DATA_ARRAY) { + throw new BSONError('corrupted array bson'); + } + throw new BSONError('Bad BSON Document: object not properly terminated'); + } + } + else { + break; + } + } + let i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + const name = currentIsArray + ? currentFrame !== null + ? currentFrame.arrayIndex++ + : arrayIndex++ + : ByteUtils.toUTF8(buffer, index, i, false); + let shouldValidateKey; + if (currentFrame !== null) { + shouldValidateKey = currentFrame.validationSetting; + } + else if (globalUTFValidation || utf8KeysSet?.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (currentFrame !== null) { + if (currentFrame.isPossibleDBRef !== false && typeof name === 'string' && name[0] === '$') { + currentFrame.isPossibleDBRef = allowedDBRefKeys.test(name); + } + } + else if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + let value; + let isDeferredValue = false; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + value = new ObjectId(buffer, index); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(NumberUtils.getInt32LE(buffer, index)); + index += 4; + } + else if (elementType === BSON_DATA_INT) { + value = NumberUtils.getInt32LE(buffer, index); + index += 4; + } + else if (elementType === BSON_DATA_NUMBER) { + value = NumberUtils.getFloat64LE(buffer, index); + index += 8; + if (promoteValues === false) + value = new Double(value); + } + else if (elementType === BSON_DATA_DATE) { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + if (raw || (currentFrame?.raw ?? false)) { + value = buffer.subarray(index, index + objectSize); + index = index + objectSize; + } + else { + isDeferredValue = true; + const objectFrame = { + holdingDocument: {}, + elementType: BSON_DATA_OBJECT, + propertyName: name, + functionString: null, + lastIndex: index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = objectFrame; + currentDest = objectFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + } + else if (elementType === BSON_DATA_ARRAY) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded array length in bson'); + const stopIndex = index + objectSize; + const arrayRaw = !!(fieldsAsRaw && fieldsAsRaw[name]) || (currentFrame?.raw ?? false); + isDeferredValue = true; + const arrayFrame = { + holdingDocument: [], + elementType: BSON_DATA_ARRAY, + propertyName: name, + functionString: null, + lastIndex: stopIndex, + isArray: true, + arrayIndex: 0, + raw: arrayRaw, + isPossibleDBRef: false, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = arrayFrame; + currentDest = arrayFrame.holdingDocument; + currentIsArray = true; + index = index + 4; + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + if (useBigInt64) { + value = NumberUtils.getBigInt64LE(buffer, index); + index += 8; + } + else { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + const long = new Long(lowBits, highBits); + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + const bytes = ByteUtils.allocateUnsafe(16); + for (let i = 0; i < 16; i++) + bytes[i] = buffer[index + i]; + index = index + 16; + value = new Decimal128(bytes); + } + else if (elementType === BSON_DATA_BINARY) { + let binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + const totalBinarySize = binarySize; + const subType = buffer[index++]; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = ByteUtils.toLocalBufferType(buffer.subarray(index, index + binarySize)); + } + else { + value = new Binary(buffer.subarray(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) { + value = value.toUUID(); + } + } + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + const optionsArray = new Array(regExpOptions.length); + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const symbol = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + value = new Timestamp({ + i: NumberUtils.getUint32LE(buffer, index), + t: NumberUtils.getUint32LE(buffer, index + 4) + }); + index += 8; + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = new Code(functionString); + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + const totalSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad scope document size in code_w_scope'); + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + isDeferredValue = true; + const scopeFrame = { + holdingDocument: {}, + elementType: BSON_DATA_CODE_W_SCOPE, + propertyName: name, + functionString: functionString, + lastIndex: _index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = scopeFrame; + currentDest = scopeFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + else if (elementType === BSON_DATA_DBPOINTER) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + const namespace = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const oidBuffer = ByteUtils.allocateUnsafe(12); + for (let i = 0; i < 12; i++) + oidBuffer[i] = buffer[index + i]; + const oid = new ObjectId(oidBuffer); + index = index + 12; + value = new DBRef(namespace, oid); + } + else { + throw new BSONError(`Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"`); + } + if (!isDeferredValue) { + assignValue(currentDest, name, value); + } + } + if (currentFrame !== null) { + throw new BSONError('corrupted bson, more objects expected based on the current document size'); + } + const object = rootObject; + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + if (!isPossibleDBRef) + return object; + return toPotentialDbRef(object); +} + +const regexp = /\x00/; +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +function serializeString(buffer, key, value, index) { + buffer[index++] = BSON_DATA_STRING; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value, index + 4); + NumberUtils.setInt32LE(buffer, index, size + 1); + index = index + 4 + size; + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index) { + const isNegativeZero = Object.is(value, -0); + const type = !isNegativeZero && + Number.isSafeInteger(value) && + value <= BSON_INT32_MAX && + value >= BSON_INT32_MIN + ? BSON_DATA_INT + : BSON_DATA_NUMBER; + buffer[index++] = type; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0x00; + if (type === BSON_DATA_INT) { + index += NumberUtils.setInt32LE(buffer, index, value); + } + else { + index += NumberUtils.setFloat64LE(buffer, index, value); + } + return index; +} +function serializeBigInt(buffer, key, value, index) { + buffer[index++] = BSON_DATA_LONG; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index += numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setBigInt64LE(buffer, index, value); + return index; +} +function serializeNull(buffer, key, _, index) { + buffer[index++] = BSON_DATA_NULL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BOOLEAN; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DATE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw new BSONError('value ' + value.source + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.source, index); + buffer[index++] = 0x00; + if (value.ignoreCase) + buffer[index++] = 0x69; + if (value.global) + buffer[index++] = 0x73; + if (value.multiline) + buffer[index++] = 0x6d; + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.pattern.match(regexp) != null) { + throw new BSONError('pattern ' + value.pattern + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.pattern, index); + buffer[index++] = 0x00; + const sortedOptions = value.options.split('').sort().join(''); + index = index + ByteUtils.encodeUTF8Into(buffer, sortedOptions, index); + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index) { + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value[bsonType] === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index) { + buffer[index++] = BSON_DATA_OID; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += value.serializeInto(buffer, index); + return index; +} +function serializeBuffer(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = value.length; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = value[i]; + } + else { + buffer.set(value, index); + } + index = index + size; + return index; +} +function serializeDecimal128(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DECIMAL128; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + for (let i = 0; i < 16; i++) + buffer[index + i] = value.bytes[i]; + return index + 16; +} +function serializeLong(buffer, key, value, index) { + buffer[index++] = + value[bsonType] === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeInt32(buffer, key, value, index) { + value = value.valueOf(); + buffer[index++] = BSON_DATA_INT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setInt32LE(buffer, index, value); + return index; +} +function serializeDouble(buffer, key, value, index) { + buffer[index++] = BSON_DATA_NUMBER; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setFloat64LE(buffer, index, value.value); + return index; +} +function serializeFunction(buffer, key, value, index) { + buffer[index++] = BSON_DATA_CODE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const functionString = value.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function serializeBinary(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const data = value.buffer; + let size = value.position; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = value.sub_type; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + index += NumberUtils.setInt32LE(buffer, index, size); + } + if (value.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(value); + } + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = data[i]; + } + else { + buffer.set(data, index); + } + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index) { + buffer[index++] = BSON_DATA_SYMBOL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value.value, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function makeFrame(sourceObject, objectSizeIndex, codeSizeIndex, prev, checkKeys, ignoreUndefined) { + if (Array.isArray(sourceObject)) { + return { + sourceObject, + isArray: true, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; + } + if (sourceObject instanceof Map || isMap(sourceObject)) { + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: sourceObject.entries(), + prev, + checkKeys, + ignoreUndefined + }; + } + let target = sourceObject; + if (typeof target?.toBSON === 'function') { + target = target.toBSON(); + if (target != null && typeof target !== 'object') { + throw new BSONError('toBSON function did not return an object'); + } + } + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: target, + keys: Object.keys(target), + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; +} +function serializeInto(buffer, object, checkKeys, startingIndex, serializeFunctions, ignoreUndefined, path) { + if (path == null) { + if (object == null) { + buffer[0] = 0x05; + buffer[1] = 0x00; + buffer[2] = 0x00; + buffer[3] = 0x00; + buffer[4] = 0x00; + return 5; + } + if (Array.isArray(object)) { + throw new BSONError('serialize does not support an array as the root input'); + } + if (typeof object !== 'object') { + throw new BSONError('serialize does not support non-object as the root input'); + } + else if ('_bsontype' in object && typeof object._bsontype === 'string') { + throw new BSONError(`BSON types cannot be serialized as a document`); + } + else if (isDate(object) || + isRegExp(object) || + isUint8Array(object) || + isAnyArrayBuffer(object)) { + throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`); + } + path = new Set(); + } + path.add(object); + let currentFrame = makeFrame(object, startingIndex, null, null, checkKeys, ignoreUndefined); + let index = startingIndex + 4; + while (currentFrame !== null) { + const frame = currentFrame; + let key; + let value; + if (frame.mapIterator !== null) { + const next = frame.mapIterator.next(); + if (next.done) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = next.value[0]; + value = next.value[1]; + } + else if (frame.keys !== null) { + if (frame.keyIndex >= frame.keys.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = frame.keys[frame.keyIndex++]; + value = frame.iterTarget[key]; + } + else { + const arr = frame.iterTarget; + if (frame.keyIndex >= arr.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + const i = frame.keyIndex++; + key = String(i); + value = arr[i]; + } + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + if (!frame.isArray && typeof key === 'string' && !(key[0] === '$' && ignoreKeys.has(key))) { + if (regexp.test(key)) { + throw new BSONError('key ' + key + ' must not contain null bytes'); + } + if (frame.checkKeys) { + if ('$' === key[0]) { + throw new BSONError('key ' + key + " must not start with '$'"); + } + else if (key.includes('.')) { + throw new BSONError('key ' + key + " must not contain '.'"); + } + } + } + const type = typeof value; + if (value === undefined) { + if (frame.isArray || frame.ignoreUndefined === false) { + index = serializeNull(buffer, key, value, index); + } + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + index = serializeBigInt(buffer, key, value, index); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (type === 'object' && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + const nestedIsArray = Array.isArray(value); + buffer[index++] = nestedIsArray ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const nestedStartIndex = index; + path.add(value); + currentFrame = makeFrame(value, nestedStartIndex, null, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + } + else if (type === 'object') { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + const tag = value[bsonType]; + if (tag === 'ObjectId') { + index = serializeObjectId(buffer, key, value, index); + } + else if (tag === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (tag === 'Long' || tag === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (tag === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (tag === 'Code') { + const codeValue = value; + if (codeValue.scope && typeof codeValue.scope === 'object') { + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const codeTotalSizeIndex = index; + index += 4; + const functionString = codeValue.code; + const codeSize = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, codeSize); + buffer[index + 4 + codeSize - 1] = 0; + index = index + codeSize + 4; + const scope = codeValue.scope; + if (path.has(scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + path.add(scope); + currentFrame = makeFrame(scope, index, codeTotalSizeIndex, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + else { + buffer[index++] = BSON_DATA_CODE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const functionString = codeValue.code.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + } + } + else if (tag === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (tag === 'BSONSymbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (tag === 'DBRef') { + const dbref = value; + const orderedValues = Object.assign({ $ref: dbref.collection, $id: dbref.oid }, dbref.db != null ? { $db: dbref.db } : null, dbref.fields); + buffer[index++] = BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + path.add(orderedValues); + currentFrame = makeFrame(orderedValues, index, null, frame, false, true); + index += 4; + } + else if (tag === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (tag === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (tag === 'MinKey' || tag === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value._bsontype !== 'undefined') { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } + else if (type === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index); + } + } + return index; +} + +function isBSONType(value) { + return (value != null && + typeof value === 'object' && + '_bsontype' in value && + typeof value._bsontype === 'string'); +} +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +function deserializeValue(value, options = {}) { + if (typeof value === 'number') { + const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN; + const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN; + if (options.relaxed || options.legacy) { + return value; + } + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (in32BitRange) { + return new Int32(value); + } + if (in64BitRange) { + if (options.useBigInt64) { + return BigInt(value); + } + return Long.fromNumber(value); + } + } + return new Double(value); + } + if (value == null || typeof value !== 'object') + return value; + if (value.$undefined) + return null; + const keys = Object.keys(value).filter(k => k.startsWith('$') && value[k] != null); + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + return date; + } + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + if (v instanceof DBRef) + return v; + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid = false; + }); + if (valid) + return DBRef.fromExtendedJSON(v); + } + return value; +} +function serializeArray(array, options) { + return array.map((v, index) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + const isoStr = date.toISOString(); + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +function serializeValue(value, options) { + if (value instanceof Map || isMap(value)) { + const obj = Object.create(null); + for (const [k, v] of value) { + if (typeof k !== 'string') { + throw new BSONError('Can only serialize maps with string keys'); + } + obj[k] = v; + } + return serializeValue(obj, options); + } + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONError('Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/`); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return options.ignoreUndefined ? undefined : null; + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), inRange = dateNum > -1 && dateNum < 253402300800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return { $numberInt: value.toString() }; + } + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) { + return { $numberLong: value.toString() }; + } + } + return { $numberDouble: Object.is(value, -0) ? '-0.0' : value.toString() }; + } + if (typeof value === 'bigint') { + if (!options.relaxed) { + return { $numberLong: BigInt.asIntN(64, value).toString() }; + } + return Number(BigInt.asIntN(64, value)); + } + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +const BSON_TYPE_MAPPINGS = { + Binary: (o) => new Binary(o.value(), o.sub_type), + Code: (o) => new Code(o.code, o.scope), + DBRef: (o) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), + Decimal128: (o) => new Decimal128(o.bytes), + Double: (o) => new Double(o.value), + Int32: (o) => new Int32(o.value), + Long: (o) => Long.fromBits(o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectId: (o) => new ObjectId(o), + BSONRegExp: (o) => new BSONRegExp(o.pattern, o.options), + BSONSymbol: (o) => new BSONSymbol(o.value), + Timestamp: (o) => Timestamp.fromBits(o.low, o.high) +}; +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + const bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + const _doc = {}; + for (const name of Object.keys(doc)) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (doc != null && + typeof doc === 'object' && + typeof doc._bsontype === 'string' && + doc[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (isBSONType(doc)) { + let outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +function parse(text, options) { + const ejsonOptions = { + useBigInt64: options?.useBigInt64 ?? false, + relaxed: options?.relaxed ?? true, + legacy: options?.legacy ?? false + }; + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}`); + } + return deserializeValue(value, ejsonOptions); + }); +} +function stringify(value, replacerOrOptions, spaceOrOptions, options) { + if (spaceOrOptions != null && typeof spaceOrOptions === 'object') { + options = spaceOrOptions; + spaceOrOptions = undefined; + } + if (replacerOrOptions != null && + typeof replacerOrOptions === 'object' && + !Array.isArray(replacerOrOptions)) { + options = replacerOrOptions; + replacerOrOptions = undefined; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacerOrOptions, spaceOrOptions); +} +function EJSONserialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); +} +function EJSONdeserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); +} +const EJSON = Object.create(null); +EJSON.parse = parse; +EJSON.stringify = stringify; +EJSON.serialize = EJSONserialize; +EJSON.deserialize = EJSONdeserialize; +Object.freeze(EJSON); + +const BSONElementType = { + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: 255, + maxKey: 127 +}; +function getSize(source, offset) { + try { + return NumberUtils.getNonnegativeInt32LE(source, offset); + } + catch (cause) { + throw new BSONOffsetError('BSON size cannot be negative', offset, { cause }); + } +} +function findNull(bytes, offset) { + let nullTerminatorOffset = offset; + for (; bytes[nullTerminatorOffset] !== 0x00; nullTerminatorOffset++) + ; + if (nullTerminatorOffset === bytes.length - 1) { + throw new BSONOffsetError('Null terminator not found', offset); + } + return nullTerminatorOffset; +} +function parseToElements(bytes, startOffset = 0) { + startOffset ??= 0; + if (bytes.length < 5) { + throw new BSONOffsetError(`Input must be at least 5 bytes, got ${bytes.length} bytes`, startOffset); + } + const documentSize = getSize(bytes, startOffset); + if (documentSize > bytes.length - startOffset) { + throw new BSONOffsetError(`Parsed documentSize (${documentSize} bytes) does not match input length (${bytes.length} bytes)`, startOffset); + } + if (bytes[startOffset + documentSize - 1] !== 0x00) { + throw new BSONOffsetError('BSON documents must end in 0x00', startOffset + documentSize); + } + const elements = []; + let offset = startOffset + 4; + while (offset <= documentSize + startOffset) { + const type = bytes[offset]; + offset += 1; + if (type === 0) { + if (offset - startOffset !== documentSize) { + throw new BSONOffsetError(`Invalid 0x00 type byte`, offset); + } + break; + } + const nameOffset = offset; + const nameLength = findNull(bytes, offset) - nameOffset; + offset += nameLength + 1; + let length; + if (type === BSONElementType.double || + type === BSONElementType.long || + type === BSONElementType.date || + type === BSONElementType.timestamp) { + length = 8; + } + else if (type === BSONElementType.int) { + length = 4; + } + else if (type === BSONElementType.objectId) { + length = 12; + } + else if (type === BSONElementType.decimal) { + length = 16; + } + else if (type === BSONElementType.bool) { + length = 1; + } + else if (type === BSONElementType.null || + type === BSONElementType.undefined || + type === BSONElementType.maxKey || + type === BSONElementType.minKey) { + length = 0; + } + else if (type === BSONElementType.regex) { + length = findNull(bytes, findNull(bytes, offset) + 1) + 1 - offset; + } + else if (type === BSONElementType.object || + type === BSONElementType.array || + type === BSONElementType.javascriptWithScope) { + length = getSize(bytes, offset); + } + else if (type === BSONElementType.string || + type === BSONElementType.binData || + type === BSONElementType.dbPointer || + type === BSONElementType.javascript || + type === BSONElementType.symbol) { + length = getSize(bytes, offset) + 4; + if (type === BSONElementType.binData) { + length += 1; + } + if (type === BSONElementType.dbPointer) { + length += 12; + } + } + else { + throw new BSONOffsetError(`Invalid 0x${type.toString(16).padStart(2, '0')} type byte`, offset); + } + if (length > documentSize) { + throw new BSONOffsetError('value reports length larger than document', offset); + } + elements.push([type, nameOffset, nameLength, offset, length]); + offset += length; + } + return elements; +} + +const onDemand = Object.create(null); +onDemand.parseToElements = parseToElements; +onDemand.ByteUtils = ByteUtils; +onDemand.NumberUtils = NumberUtils; +Object.freeze(onDemand); + +const MAXSIZE = 1024 * 1024 * 17; +let buffer = ByteUtils.allocate(MAXSIZE); +function setInternalBufferSize(size) { + if (buffer.length < size) { + buffer = ByteUtils.allocate(size); + } +} +function serialize(object, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + if (buffer.length < minInternalBufferSize) { + buffer = ByteUtils.allocate(minInternalBufferSize); + } + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + const finishedBuffer = ByteUtils.allocateUnsafe(serializationIndex); + finishedBuffer.set(buffer.subarray(0, serializationIndex), 0); + return finishedBuffer; +} +function serializeWithBufferAndIndex(object, finalBuffer, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex); + return startIndex + serializationIndex - 1; +} +function deserialize(buffer, options = {}) { + return internalDeserialize(ByteUtils.toLocalBufferType(buffer), options); +} +function calculateObjectSize(object, options = {}) { + options = options || {}; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + const internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + const bufferData = ByteUtils.toLocalBufferType(data); + let index = startIndex; + for (let i = 0; i < numberOfDocuments; i++) { + const size = NumberUtils.getInt32LE(bufferData, index); + internalOptions.index = index; + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + index = index + size; + } + return index; +} + +var bson = /*#__PURE__*/Object.freeze({ +__proto__: null, +BSONError: BSONError, +BSONOffsetError: BSONOffsetError, +BSONRegExp: BSONRegExp, +BSONRuntimeError: BSONRuntimeError, +BSONSymbol: BSONSymbol, +BSONType: BSONType, +BSONValue: BSONValue, +BSONVersionError: BSONVersionError, +Binary: Binary, +ByteUtils: ByteUtils, +Code: Code, +DBRef: DBRef, +Decimal128: Decimal128, +Double: Double, +EJSON: EJSON, +Int32: Int32, +Long: Long, +MaxKey: MaxKey, +MinKey: MinKey, +NumberUtils: NumberUtils, +ObjectId: ObjectId, +Timestamp: Timestamp, +UUID: UUID, +bsonType: bsonType, +calculateObjectSize: calculateObjectSize, +deserialize: deserialize, +deserializeStream: deserializeStream, +onDemand: onDemand, +serialize: serialize, +serializeWithBufferAndIndex: serializeWithBufferAndIndex, +setInternalBufferSize: setInternalBufferSize +}); + +exports.BSON = bson; +exports.BSONError = BSONError; +exports.BSONOffsetError = BSONOffsetError; +exports.BSONRegExp = BSONRegExp; +exports.BSONRuntimeError = BSONRuntimeError; +exports.BSONSymbol = BSONSymbol; +exports.BSONType = BSONType; +exports.BSONValue = BSONValue; +exports.BSONVersionError = BSONVersionError; +exports.Binary = Binary; +exports.ByteUtils = ByteUtils; +exports.Code = Code; +exports.DBRef = DBRef; +exports.Decimal128 = Decimal128; +exports.Double = Double; +exports.EJSON = EJSON; +exports.Int32 = Int32; +exports.Long = Long; +exports.MaxKey = MaxKey; +exports.MinKey = MinKey; +exports.NumberUtils = NumberUtils; +exports.ObjectId = ObjectId; +exports.Timestamp = Timestamp; +exports.UUID = UUID; +exports.bsonType = bsonType; +exports.calculateObjectSize = calculateObjectSize; +exports.deserialize = deserialize; +exports.deserializeStream = deserializeStream; +exports.onDemand = onDemand; +exports.serialize = serialize; +exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; +exports.setInternalBufferSize = setInternalBufferSize; + +return exports; + +})({}); +//# sourceMappingURL=bson.bundle.js.map diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js.map b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js.map new file mode 100644 index 00000000..dde18232 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.bundle.js","sources":["../src/parser/utils.ts","../src/constants.ts","../src/error.ts","../src/parse_utf8.ts","../src/utils/latin.ts","../src/utils/node_byte_utils.ts","../src/utils/web_byte_utils.ts","../src/utils/byte_utils.ts","../src/bson_value.ts","../src/utils/number_utils.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/utils/string_utils.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/parser/calculate_size.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/extended_json.ts","../src/parser/on_demand/parse_to_elements.ts","../src/parser/on_demand/index.ts","../src/bson.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["StringUtils.validateStringCharacters","StringUtils.removeLeadingZerosAndExplicitPlus","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","constants.BSON_VERSION_SYMBOL","constants.BSON_MAJOR_VERSION","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT"],"mappings":";;;AAAA,MAAM,uCAAuC,GAAG,CAAC,MAAK;IAIpD,MAAM,CAAC,GAAG,MAAM,CAAC,wBAAwB,CACvC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAC3C,MAAM,CAAC,WAAW,CAClB,CAAC,GAAI;IAEP,OAAO,CAAC,KAAc,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1C,CAAC,GAAG;AAEE,SAAU,YAAY,CAAC,KAAc,EAAA;AACzC,IAAA,OAAO,uCAAuC,CAAC,KAAK,CAAC,KAAK,YAAY;AACxE;AAEM,SAAU,gBAAgB,CAAC,KAAc,EAAA;AAC7C,IAAA,QACE,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,KAAK,IAAI,IAAI;QACb,MAAM,CAAC,WAAW,IAAI,KAAK;AAC3B,SAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,aAAa;YAC1C,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,mBAAmB,CAAC;AAExD;AAEM,SAAU,QAAQ,CAAC,MAAe,EAAA;AACtC,IAAA,OAAO,MAAM,YAAY,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,iBAAiB;AACjG;AAE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;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC;AAEtD,QAAA,eAAe,CAAC,KAAK,GAAG,KAAK;AAE7B,QAAA,SAAS,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,mBAAmB,CAAC,UAAU,EAAE,eAAe,CAAC;AAE/E,QAAA,KAAK,GAAG,KAAK,GAAG,IAAI;IACtB;AAGA,IAAA,OAAO,KAAK;AACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs new file mode 100644 index 00000000..34c08883 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs @@ -0,0 +1,4873 @@ +'use strict'; + +const TypedArrayPrototypeGetSymbolToStringTag = (() => { + const g = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get; + return (value) => g.call(value); +})(); +function isUint8Array(value) { + return TypedArrayPrototypeGetSymbolToStringTag(value) === 'Uint8Array'; +} +function isAnyArrayBuffer(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + (value[Symbol.toStringTag] === 'ArrayBuffer' || + value[Symbol.toStringTag] === 'SharedArrayBuffer')); +} +function isRegExp(regexp) { + return regexp instanceof RegExp || Object.prototype.toString.call(regexp) === '[object RegExp]'; +} +function isMap(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Map'); +} +function isDate(date) { + return date instanceof Date || Object.prototype.toString.call(date) === '[object Date]'; +} +function defaultInspect(x, _options) { + return JSON.stringify(x, (k, v) => { + if (typeof v === 'bigint') { + return { $numberLong: `${v}` }; + } + else if (isMap(v)) { + return Object.fromEntries(v); + } + return v; + }); +} +function getStylizeFunction(options) { + const stylizeExists = options != null && + typeof options === 'object' && + 'stylize' in options && + typeof options.stylize === 'function'; + if (stylizeExists) { + return options.stylize; + } +} + +const BSON_MAJOR_VERSION = 7; +const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version'); +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -2147483648; +const BSON_INT64_MAX = Math.pow(2, 63) - 1; +const BSON_INT64_MIN = -Math.pow(2, 63); +const JS_INT_MAX = Math.pow(2, 53); +const JS_INT_MIN = -Math.pow(2, 53); +const BSON_DATA_NUMBER = 1; +const BSON_DATA_STRING = 2; +const BSON_DATA_OBJECT = 3; +const BSON_DATA_ARRAY = 4; +const BSON_DATA_BINARY = 5; +const BSON_DATA_UNDEFINED = 6; +const BSON_DATA_OID = 7; +const BSON_DATA_BOOLEAN = 8; +const BSON_DATA_DATE = 9; +const BSON_DATA_NULL = 10; +const BSON_DATA_REGEXP = 11; +const BSON_DATA_DBPOINTER = 12; +const BSON_DATA_CODE = 13; +const BSON_DATA_SYMBOL = 14; +const BSON_DATA_CODE_W_SCOPE = 15; +const BSON_DATA_INT = 16; +const BSON_DATA_TIMESTAMP = 17; +const BSON_DATA_LONG = 18; +const BSON_DATA_DECIMAL128 = 19; +const BSON_DATA_MIN_KEY = 0xff; +const BSON_DATA_MAX_KEY = 0x7f; +const BSON_BINARY_SUBTYPE_DEFAULT = 0; +const BSON_BINARY_SUBTYPE_UUID_NEW = 4; +const BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +}); + +class BSONError extends Error { + get bsonError() { + return true; + } + get name() { + return 'BSONError'; + } + constructor(message, options) { + super(message, options); + } + static isBSONError(value) { + return (value != null && + typeof value === 'object' && + 'bsonError' in value && + value.bsonError === true && + 'name' in value && + 'message' in value && + 'stack' in value); + } +} +class BSONVersionError extends BSONError { + get name() { + return 'BSONVersionError'; + } + constructor() { + super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); + } +} +class BSONRuntimeError extends BSONError { + get name() { + return 'BSONRuntimeError'; + } + constructor(message) { + super(message); + } +} +class BSONOffsetError extends BSONError { + get name() { + return 'BSONOffsetError'; + } + offset; + constructor(message, offset, options) { + super(`${message}. offset: ${offset}`, options); + this.offset = offset; + } +} + +let TextDecoderFatal; +let TextDecoderNonFatal; +function parseUtf8(buffer, start, end, fatal) { + if (fatal) { + TextDecoderFatal ??= new TextDecoder('utf8', { fatal: true }); + try { + return TextDecoderFatal.decode(buffer.subarray(start, end)); + } + catch (cause) { + throw new BSONError('Invalid UTF-8 string in BSON document', { cause }); + } + } + TextDecoderNonFatal ??= new TextDecoder('utf8', { fatal: false }); + return TextDecoderNonFatal.decode(buffer.subarray(start, end)); +} + +function tryReadBasicLatin(uint8array, start, end) { + if (uint8array.length === 0) { + return ''; + } + const stringByteLength = end - start; + if (stringByteLength === 0) { + return ''; + } + if (stringByteLength > 20) { + return null; + } + if (stringByteLength === 1 && uint8array[start] < 128) { + return String.fromCharCode(uint8array[start]); + } + if (stringByteLength === 2 && uint8array[start] < 128 && uint8array[start + 1] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]); + } + if (stringByteLength === 3 && + uint8array[start] < 128 && + uint8array[start + 1] < 128 && + uint8array[start + 2] < 128) { + return (String.fromCharCode(uint8array[start]) + + String.fromCharCode(uint8array[start + 1]) + + String.fromCharCode(uint8array[start + 2])); + } + const latinBytes = []; + for (let i = start; i < end; i++) { + const byte = uint8array[i]; + if (byte > 127) { + return null; + } + latinBytes.push(byte); + } + return String.fromCharCode(...latinBytes); +} +function tryWriteBasicLatin(destination, source, offset) { + if (source.length === 0) + return 0; + if (source.length > 25) + return null; + if (destination.length - offset < source.length) + return null; + for (let charOffset = 0, destinationOffset = offset; charOffset < source.length; charOffset++, destinationOffset++) { + const char = source.charCodeAt(charOffset); + if (char > 127) + return null; + destination[destinationOffset] = char; + } + return source.length; +} + +function nodejsMathRandomBytes(byteLength) { + return nodeJsByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +function nodejsSecureRandomBytes(byteLength) { + return crypto.getRandomValues(nodeJsByteUtils.allocate(byteLength)); +} +const nodejsRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return nodejsSecureRandomBytes; + } + else { + return nodejsMathRandomBytes; + } +})(); +const nodeJsByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialBuffer) { + if (Buffer.isBuffer(potentialBuffer)) { + return potentialBuffer; + } + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + const stringTag = potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer); + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return Buffer.from(potentialBuffer); + } + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); + }, + allocate(size) { + return Buffer.alloc(size); + }, + allocateUnsafe(size) { + return Buffer.allocUnsafe(size); + }, + compare(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).compare(b); + }, + concat(list) { + return Buffer.concat(list); + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + return nodeJsByteUtils + .toLocalBufferType(source) + .copy(target, targetStart ?? 0, sourceStart ?? 0, sourceEnd ?? source.length); + }, + equals(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).equals(b); + }, + fromNumberArray(array) { + return Buffer.from(array); + }, + fromBase64(base64) { + return Buffer.from(base64, 'base64'); + }, + fromUTF8(utf8) { + return Buffer.from(utf8, 'utf8'); + }, + toBase64(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('base64'); + }, + fromISO88591(codePoints) { + return Buffer.from(codePoints, 'binary'); + }, + toISO88591(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('binary'); + }, + fromHex(hex) { + return Buffer.from(hex, 'hex'); + }, + toHex(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('hex'); + }, + toUTF8(buffer, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(buffer, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + const string = nodeJsByteUtils.toLocalBufferType(buffer).toString('utf8', start, end); + if (fatal) { + for (let i = 0; i < string.length; i++) { + if (string.charCodeAt(i) === 0xfffd) { + parseUtf8(buffer, start, end, true); + break; + } + } + } + return string; + }, + utf8ByteLength(input) { + return Buffer.byteLength(input, 'utf8'); + }, + encodeUTF8Into(buffer, source, byteOffset) { + const latinBytesWritten = tryWriteBasicLatin(buffer, source, byteOffset); + if (latinBytesWritten != null) { + return latinBytesWritten; + } + return nodeJsByteUtils.toLocalBufferType(buffer).write(source, byteOffset, undefined, 'utf8'); + }, + randomBytes: nodejsRandomBytes, + swap32(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).swap32(); + } +}; + +function isReactNative() { + const { navigator } = globalThis; + return typeof navigator === 'object' && navigator.product === 'ReactNative'; +} +function webMathRandomBytes(byteLength) { + if (byteLength < 0) { + throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`); + } + return webByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +const webRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return (byteLength) => { + return crypto.getRandomValues(webByteUtils.allocate(byteLength)); + }; + } + else { + if (isReactNative()) { + const { console } = globalThis; + console?.warn?.('BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.'); + } + return webMathRandomBytes; + } +})(); +const HEX_DIGIT = /(\d|[a-f])/i; +const webByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialUint8array) { + const stringTag = potentialUint8array?.[Symbol.toStringTag] ?? + Object.prototype.toString.call(potentialUint8array); + if (stringTag === 'Uint8Array') { + return potentialUint8array; + } + if (ArrayBuffer.isView(potentialUint8array)) { + return new Uint8Array(potentialUint8array.buffer.slice(potentialUint8array.byteOffset, potentialUint8array.byteOffset + potentialUint8array.byteLength)); + } + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return new Uint8Array(potentialUint8array); + } + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); + }, + allocate(size) { + if (typeof size !== 'number') { + throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`); + } + return new Uint8Array(size); + }, + allocateUnsafe(size) { + return webByteUtils.allocate(size); + }, + compare(uint8Array, otherUint8Array) { + if (uint8Array === otherUint8Array) + return 0; + const len = Math.min(uint8Array.length, otherUint8Array.length); + for (let i = 0; i < len; i++) { + if (uint8Array[i] < otherUint8Array[i]) + return -1; + if (uint8Array[i] > otherUint8Array[i]) + return 1; + } + if (uint8Array.length < otherUint8Array.length) + return -1; + if (uint8Array.length > otherUint8Array.length) + return 1; + return 0; + }, + concat(uint8Arrays) { + if (uint8Arrays.length === 0) + return webByteUtils.allocate(0); + let totalLength = 0; + for (const uint8Array of uint8Arrays) { + totalLength += uint8Array.length; + } + const result = webByteUtils.allocate(totalLength); + let offset = 0; + for (const uint8Array of uint8Arrays) { + result.set(uint8Array, offset); + offset += uint8Array.length; + } + return result; + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + if (sourceEnd !== undefined && sourceEnd < 0) { + throw new RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${sourceEnd}`); + } + sourceEnd = sourceEnd ?? source.length; + if (sourceStart !== undefined && (sourceStart < 0 || sourceStart > sourceEnd)) { + throw new RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${sourceEnd}. Received ${sourceStart}`); + } + sourceStart = sourceStart ?? 0; + if (targetStart !== undefined && targetStart < 0) { + throw new RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${targetStart}`); + } + targetStart = targetStart ?? 0; + const srcSlice = source.subarray(sourceStart, sourceEnd); + const maxLen = Math.min(srcSlice.length, target.length - targetStart); + if (maxLen <= 0) { + return 0; + } + target.set(srcSlice.subarray(0, maxLen), targetStart); + return maxLen; + }, + equals(uint8Array, otherUint8Array) { + if (uint8Array.byteLength !== otherUint8Array.byteLength) { + return false; + } + for (let i = 0; i < uint8Array.byteLength; i++) { + if (uint8Array[i] !== otherUint8Array[i]) { + return false; + } + } + return true; + }, + fromNumberArray(array) { + return Uint8Array.from(array); + }, + fromBase64(base64) { + return Uint8Array.from(atob(base64), c => c.charCodeAt(0)); + }, + fromUTF8(utf8) { + return new TextEncoder().encode(utf8); + }, + toBase64(uint8array) { + return btoa(webByteUtils.toISO88591(uint8array)); + }, + fromISO88591(codePoints) { + return Uint8Array.from(codePoints, c => c.charCodeAt(0) & 0xff); + }, + toISO88591(uint8array) { + return Array.from(Uint16Array.from(uint8array), b => String.fromCharCode(b)).join(''); + }, + fromHex(hex) { + const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1); + const buffer = []; + for (let i = 0; i < evenLengthHex.length; i += 2) { + const firstDigit = evenLengthHex[i]; + const secondDigit = evenLengthHex[i + 1]; + if (!HEX_DIGIT.test(firstDigit)) { + break; + } + if (!HEX_DIGIT.test(secondDigit)) { + break; + } + const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16); + buffer.push(hexDigit); + } + return Uint8Array.from(buffer); + }, + toHex(uint8array) { + return Array.from(uint8array, byte => byte.toString(16).padStart(2, '0')).join(''); + }, + toUTF8(uint8array, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(uint8array, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + return parseUtf8(uint8array, start, end, fatal); + }, + utf8ByteLength(input) { + return new TextEncoder().encode(input).byteLength; + }, + encodeUTF8Into(uint8array, source, byteOffset) { + const bytes = new TextEncoder().encode(source); + uint8array.set(bytes, byteOffset); + return bytes.byteLength; + }, + randomBytes: webRandomBytes, + swap32(buffer) { + if (buffer.length % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + for (let i = 0; i < buffer.length; i += 4) { + const byte0 = buffer[i]; + const byte1 = buffer[i + 1]; + const byte2 = buffer[i + 2]; + const byte3 = buffer[i + 3]; + buffer[i] = byte3; + buffer[i + 1] = byte2; + buffer[i + 2] = byte1; + buffer[i + 3] = byte0; + } + return buffer; + } +}; + +const hasGlobalBuffer = typeof Buffer === 'function' && Buffer.prototype?._isBuffer !== true; +const ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils; + +const bsonType = Symbol.for('@@mdb.bson.type'); +class BSONValue { + get [bsonType]() { + return this._bsontype; + } + get [BSON_VERSION_SYMBOL]() { + return BSON_MAJOR_VERSION; + } + [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) { + return this.inspect(depth, options, inspect); + } +} + +const FLOAT = new Float64Array(1); +const FLOAT_BYTES = new Uint8Array(FLOAT.buffer, 0, 8); +FLOAT[0] = -1; +const isBigEndian = FLOAT_BYTES[7] === 0; +const NumberUtils = { + isBigEndian, + getNonnegativeInt32LE(source, offset) { + if (source[offset + 3] > 127) { + throw new RangeError(`Size cannot be negative at offset: ${offset}`); + } + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getInt32LE(source, offset) { + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getUint32LE(source, offset) { + return (source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + }, + getUint32BE(source, offset) { + return (source[offset + 3] + + source[offset + 2] * 256 + + source[offset + 1] * 65536 + + source[offset] * 16777216); + }, + getBigInt64LE(source, offset) { + const hi = BigInt(source[offset + 4] + + source[offset + 5] * 256 + + source[offset + 6] * 65536 + + (source[offset + 7] << 24)); + const lo = BigInt(source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + return (hi << 32n) + lo; + }, + getFloat64LE: isBigEndian + ? (source, offset) => { + FLOAT_BYTES[7] = source[offset]; + FLOAT_BYTES[6] = source[offset + 1]; + FLOAT_BYTES[5] = source[offset + 2]; + FLOAT_BYTES[4] = source[offset + 3]; + FLOAT_BYTES[3] = source[offset + 4]; + FLOAT_BYTES[2] = source[offset + 5]; + FLOAT_BYTES[1] = source[offset + 6]; + FLOAT_BYTES[0] = source[offset + 7]; + return FLOAT[0]; + } + : (source, offset) => { + FLOAT_BYTES[0] = source[offset]; + FLOAT_BYTES[1] = source[offset + 1]; + FLOAT_BYTES[2] = source[offset + 2]; + FLOAT_BYTES[3] = source[offset + 3]; + FLOAT_BYTES[4] = source[offset + 4]; + FLOAT_BYTES[5] = source[offset + 5]; + FLOAT_BYTES[6] = source[offset + 6]; + FLOAT_BYTES[7] = source[offset + 7]; + return FLOAT[0]; + }, + setInt32BE(destination, offset, value) { + destination[offset + 3] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset] = value; + return 4; + }, + setInt32LE(destination, offset, value) { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; + }, + setBigInt64LE(destination, offset, value) { + const mask32bits = 0xffffffffn; + let lo = Number(value & mask32bits); + destination[offset] = lo; + lo >>= 8; + destination[offset + 1] = lo; + lo >>= 8; + destination[offset + 2] = lo; + lo >>= 8; + destination[offset + 3] = lo; + let hi = Number((value >> 32n) & mask32bits); + destination[offset + 4] = hi; + hi >>= 8; + destination[offset + 5] = hi; + hi >>= 8; + destination[offset + 6] = hi; + hi >>= 8; + destination[offset + 7] = hi; + return 8; + }, + setFloat64LE: isBigEndian + ? (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[7]; + destination[offset + 1] = FLOAT_BYTES[6]; + destination[offset + 2] = FLOAT_BYTES[5]; + destination[offset + 3] = FLOAT_BYTES[4]; + destination[offset + 4] = FLOAT_BYTES[3]; + destination[offset + 5] = FLOAT_BYTES[2]; + destination[offset + 6] = FLOAT_BYTES[1]; + destination[offset + 7] = FLOAT_BYTES[0]; + return 8; + } + : (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[0]; + destination[offset + 1] = FLOAT_BYTES[1]; + destination[offset + 2] = FLOAT_BYTES[2]; + destination[offset + 3] = FLOAT_BYTES[3]; + destination[offset + 4] = FLOAT_BYTES[4]; + destination[offset + 5] = FLOAT_BYTES[5]; + destination[offset + 6] = FLOAT_BYTES[6]; + destination[offset + 7] = FLOAT_BYTES[7]; + return 8; + } +}; + +class Binary extends BSONValue { + get _bsontype() { + return 'Binary'; + } + static BSON_BINARY_SUBTYPE_DEFAULT = 0; + static BUFFER_SIZE = 256; + static SUBTYPE_DEFAULT = 0; + static SUBTYPE_FUNCTION = 1; + static SUBTYPE_BYTE_ARRAY = 2; + static SUBTYPE_UUID_OLD = 3; + static SUBTYPE_UUID = 4; + static SUBTYPE_MD5 = 5; + static SUBTYPE_ENCRYPTED = 6; + static SUBTYPE_COLUMN = 7; + static SUBTYPE_SENSITIVE = 8; + static SUBTYPE_VECTOR = 9; + static SUBTYPE_USER_DEFINED = 128; + static VECTOR_TYPE = Object.freeze({ + Int8: 0x03, + Float32: 0x27, + PackedBit: 0x10 + }); + buffer; + sub_type; + position; + constructor(buffer, subType) { + super(); + if (!(buffer == null) && + typeof buffer === 'string' && + !ArrayBuffer.isView(buffer) && + !isAnyArrayBuffer(buffer) && + !Array.isArray(buffer)) { + throw new BSONError('Binary can only be constructed from Uint8Array or number[]'); + } + this.sub_type = (subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT) & 0xff; + if (buffer == null) { + this.buffer = ByteUtils.allocate(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + this.buffer = Array.isArray(buffer) + ? ByteUtils.fromNumberArray(buffer) + : ByteUtils.toLocalBufferType(buffer); + this.position = this.buffer.byteLength; + } + } + put(byteValue) { + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONError('only accepts single character Uint8Array or Array'); + let decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.byteLength > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + const newSpace = ByteUtils.allocate(Binary.BUFFER_SIZE + this.buffer.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + this.buffer[this.position++] = decodedByte; + } + } + write(sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + if (this.buffer.byteLength < offset + sequence.length) { + const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + throw new BSONError('input cannot be string'); + } + } + read(position, length) { + length = length && length > 0 ? length : this.position; + const end = position + length; + return this.buffer.subarray(position, end > this.position ? this.position : end); + } + value() { + return this.buffer.length === this.position + ? this.buffer + : this.buffer.subarray(0, this.position); + } + length() { + return this.position; + } + toJSON() { + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.buffer.subarray(0, this.position)); + if (encoding === 'base64') + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + if (encoding === 'utf8' || encoding === 'utf-8') + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + } + toExtendedJSON(options) { + options = options || {}; + if (this.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(this); + } + const base64String = ByteUtils.toBase64(this.buffer); + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + toUUID() { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.subarray(0, this.position)); + } + throw new BSONError(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${Binary.SUBTYPE_UUID.toString(16).padStart(2, '0')} is currently supported.`); + } + static createFromHexString(hex, subType) { + return new Binary(ByteUtils.fromHex(hex), subType); + } + static createFromBase64(base64, subType) { + return new Binary(ByteUtils.fromBase64(base64), subType); + } + static fromExtendedJSON(doc, options) { + options = options || {}; + let data; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary.base64); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = UUID.bytesFromString(doc.$uuid); + } + if (!data) { + throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + const base64Arg = inspect(base64, options); + const subTypeArg = inspect(this.sub_type, options); + return `Binary.createFromBase64(${base64Arg}, ${subTypeArg})`; + } + toInt8Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Int8) { + throw new BSONError('Binary datatype field is not Int8'); + } + validateBinaryVector(this); + return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toFloat32Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Float32) { + throw new BSONError('Binary datatype field is not Float32'); + } + validateBinaryVector(this); + const floatBytes = new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(floatBytes); + return new Float32Array(floatBytes.buffer); + } + toPackedBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + const byteCount = this.length() - 2; + const bitCount = byteCount * 8 - this.buffer[1]; + const bits = new Int8Array(bitCount); + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = (bitOffset / 8) | 0; + const byte = this.buffer[byteOffset + 2]; + const shift = 7 - (bitOffset % 8); + const bit = (byte >> shift) & 1; + bits[bitOffset] = bit; + } + return bits; + } + static fromInt8Array(array) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.Int8; + buffer[1] = 0; + const intBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + buffer.set(intBytes, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromFloat32Array(array) { + const binaryBytes = ByteUtils.allocate(array.byteLength + 2); + binaryBytes[0] = Binary.VECTOR_TYPE.Float32; + binaryBytes[1] = 0; + const floatBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + binaryBytes.set(floatBytes, 2); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(new Uint8Array(binaryBytes.buffer, 2)); + const bin = new this(binaryBytes, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromPackedBits(array, padding = 0) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.PackedBit; + buffer[1] = padding; + buffer.set(array, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromBits(bits) { + const byteLength = (bits.length + 7) >>> 3; + const bytes = new Uint8Array(byteLength + 2); + bytes[0] = Binary.VECTOR_TYPE.PackedBit; + const remainder = bits.length % 8; + bytes[1] = remainder === 0 ? 0 : 8 - remainder; + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset >>> 3; + const bit = bits[bitOffset]; + if (bit !== 0 && bit !== 1) { + throw new BSONError(`Invalid bit value at ${bitOffset}: must be 0 or 1, found ${bits[bitOffset]}`); + } + if (bit === 0) + continue; + const shift = 7 - (bitOffset % 8); + bytes[byteOffset + 2] |= bit << shift; + } + return new this(bytes, Binary.SUBTYPE_VECTOR); + } +} +function validateBinaryVector(vector) { + if (vector.sub_type !== Binary.SUBTYPE_VECTOR) + return; + const size = vector.position; + const datatype = vector.buffer[0]; + const padding = vector.buffer[1]; + if ((datatype === Binary.VECTOR_TYPE.Float32 || datatype === Binary.VECTOR_TYPE.Int8) && + padding !== 0) { + throw new BSONError('Invalid Vector: padding must be zero for int8 and float32 vectors'); + } + if (datatype === Binary.VECTOR_TYPE.Float32) { + if (size !== 0 && size - 2 !== 0 && (size - 2) % 4 !== 0) { + throw new BSONError('Invalid Vector: Float32 vector must contain a multiple of 4 bytes'); + } + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding !== 0 && size === 2) { + throw new BSONError('Invalid Vector: padding must be zero for packed bit vectors that are empty'); + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding > 7) { + throw new BSONError(`Invalid Vector: padding must be a value between 0 and 7. found: ${padding}`); + } +} +const UUID_BYTE_LENGTH = 16; +const UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i; +const UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i; +class UUID extends Binary { + constructor(input) { + let bytes; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer)); + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ByteUtils.toLocalBufferType(input); + } + else if (typeof input === 'string') { + bytes = UUID.bytesFromString(input); + } + else { + throw new BSONError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + } + get id() { + return this.buffer; + } + set id(value) { + this.buffer = value; + } + toHexString(includeDashes = true) { + if (includeDashes) { + return [ + ByteUtils.toHex(this.buffer.subarray(0, 4)), + ByteUtils.toHex(this.buffer.subarray(4, 6)), + ByteUtils.toHex(this.buffer.subarray(6, 8)), + ByteUtils.toHex(this.buffer.subarray(8, 10)), + ByteUtils.toHex(this.buffer.subarray(10, 16)) + ].join('-'); + } + return ByteUtils.toHex(this.buffer); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.id); + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + equals(otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return ByteUtils.equals(otherId.id, this.id); + } + try { + return ByteUtils.equals(new UUID(otherId).id, this.id); + } + catch { + return false; + } + } + toBinary() { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + static generate() { + const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH); + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return bytes; + } + static isValid(input) { + if (!input) { + return false; + } + if (typeof input === 'string') { + return UUID.isValidUUIDString(input); + } + if (isUint8Array(input)) { + return input.byteLength === UUID_BYTE_LENGTH; + } + return (input._bsontype === 'Binary' && + input.sub_type === this.SUBTYPE_UUID && + input.buffer.byteLength === 16); + } + static createFromHexString(hexString) { + const buffer = UUID.bytesFromString(hexString); + return new UUID(buffer); + } + static createFromBase64(base64) { + return new UUID(ByteUtils.fromBase64(base64)); + } + static bytesFromString(representation) { + if (!UUID.isValidUUIDString(representation)) { + throw new BSONError('UUID string representation must be 32 hex digits or canonical hyphenated representation'); + } + return ByteUtils.fromHex(representation.replace(/-/g, '')); + } + static isValidUUIDString(representation) { + return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new UUID(${inspect(this.toHexString(), options)})`; + } +} + +class Code extends BSONValue { + get _bsontype() { + return 'Code'; + } + code; + scope; + constructor(code, scope) { + super(); + this.code = code.toString(); + this.scope = scope ?? null; + } + toJSON() { + if (this.scope != null) { + return { code: this.code, scope: this.scope }; + } + return { code: this.code }; + } + toExtendedJSON() { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + } + static fromExtendedJSON(doc) { + return new Code(doc.$code, doc.$scope); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + let parametersString = inspect(this.code, options); + const multiLineFn = parametersString.includes('\n'); + if (this.scope != null) { + parametersString += `,${multiLineFn ? '\n' : ' '}${inspect(this.scope, options)}`; + } + const endingNewline = multiLineFn && this.scope === null; + return `new Code(${multiLineFn ? '\n' : ''}${parametersString}${endingNewline ? '\n' : ''})`; + } +} + +function isDBRefLike(value) { + return (value != null && + typeof value === 'object' && + '$id' in value && + value.$id != null && + '$ref' in value && + typeof value.$ref === 'string' && + (!('$db' in value) || ('$db' in value && typeof value.$db === 'string'))); +} +class DBRef extends BSONValue { + get _bsontype() { + return 'DBRef'; + } + collection; + oid; + db; + fields; + constructor(collection, oid, db, fields) { + super(); + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + get namespace() { + return this.collection; + } + set namespace(value) { + this.collection = value; + } + toJSON() { + const o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + } + toExtendedJSON(options) { + options = options || {}; + let o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + static fromExtendedJSON(doc) { + const copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const args = [ + inspect(this.namespace, options), + inspect(this.oid, options), + ...(this.db ? [inspect(this.db, options)] : []), + ...(Object.keys(this.fields).length > 0 ? [inspect(this.fields, options)] : []) + ]; + args[1] = inspect === defaultInspect ? `new ObjectId(${args[1]})` : args[1]; + return `new DBRef(${args.join(', ')})`; + } +} + +function removeLeadingZerosAndExplicitPlus(str) { + if (str === '') { + return str; + } + let startIndex = 0; + const isNegative = str[startIndex] === '-'; + const isExplicitlyPositive = str[startIndex] === '+'; + if (isExplicitlyPositive || isNegative) { + startIndex += 1; + } + let foundInsignificantZero = false; + for (; startIndex < str.length && str[startIndex] === '0'; ++startIndex) { + foundInsignificantZero = true; + } + if (!foundInsignificantZero) { + return isExplicitlyPositive ? str.slice(1) : str; + } + return `${isNegative ? '-' : ''}${str.length === startIndex ? '0' : str.slice(startIndex)}`; +} +function validateStringCharacters(str, radix) { + radix = radix ?? 10; + const validCharacters = '0123456789abcdefghijklmnopqrstuvwxyz'.slice(0, radix); + const regex = new RegExp(`[^-+${validCharacters}]`, 'i'); + return regex.test(str) ? false : str; +} + +let wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch { +} +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +const INT_CACHE = {}; +const UINT_CACHE = {}; +const MAX_INT64_STRING_LENGTH = 20; +const DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/; +class Long extends BSONValue { + get _bsontype() { + return 'Long'; + } + get __isLong__() { + return true; + } + high; + low; + unsigned; + constructor(lowOrValue = 0, highOrUnsigned, unsigned) { + super(); + const unsignedBool = typeof highOrUnsigned === 'boolean' ? highOrUnsigned : Boolean(unsigned); + const high = typeof highOrUnsigned === 'number' ? highOrUnsigned : 0; + const res = typeof lowOrValue === 'string' + ? Long.fromString(lowOrValue, unsignedBool) + : typeof lowOrValue === 'bigint' + ? Long.fromBigInt(lowOrValue, unsignedBool) + : { low: lowOrValue | 0, high: high | 0, unsigned: unsignedBool }; + this.low = res.low; + this.high = res.high; + this.unsigned = res.unsigned; + } + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + static ZERO = Long.fromInt(0); + static UZERO = Long.fromInt(0, true); + static ONE = Long.fromInt(1); + static UONE = Long.fromInt(1, true); + static NEG_ONE = Long.fromInt(-1); + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + static fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + static fromInt(value, unsigned) { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + static fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + static fromBigInt(value, unsigned) { + const FROM_BIGINT_BIT_MASK = 0xffffffffn; + const FROM_BIGINT_BIT_SHIFT = 32n; + return new Long(Number(value & FROM_BIGINT_BIT_MASK), Number((value >> FROM_BIGINT_BIT_SHIFT) & FROM_BIGINT_BIT_MASK), unsigned); + } + static _fromString(str, unsigned, radix) { + if (str.length === 0) + throw new BSONError('empty string'); + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + let p; + if ((p = str.indexOf('-')) > 0) + throw new BSONError('interior hyphen'); + else if (p === 0) { + return Long._fromString(str.substring(1), unsigned, radix).neg(); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + static fromStringStrict(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str.trim() !== str) { + throw new BSONError(`Input: '${str}' contains leading and/or trailing whitespace`); + } + if (!validateStringCharacters(str, radix)) { + throw new BSONError(`Input: '${str}' contains invalid characters for radix: ${radix}`); + } + const cleanedStr = removeLeadingZerosAndExplicitPlus(str); + const result = Long._fromString(cleanedStr, unsigned, radix); + if (result.toString(radix).toLowerCase() !== cleanedStr.toLowerCase()) { + throw new BSONError(`Input: ${str} is not representable as ${result.unsigned ? 'an unsigned' : 'a signed'} 64-bit Long ${radix != null ? `with radix: ${radix}` : ''}`); + } + return result; + } + static fromString(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str === 'NaN' && radix < 24) { + return Long.ZERO; + } + else if ((str === 'Infinity' || str === '+Infinity' || str === '-Infinity') && radix < 35) { + return Long.ZERO; + } + return Long._fromString(str, unsigned, radix); + } + static fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + static fromBytesLE(bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + } + static fromBytesBE(bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + } + static isLong(value) { + return (value != null && + typeof value === 'object' && + '__isLong__' in value && + value.__isLong__ === true); + } + static fromValue(val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + } + add(addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + and(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + compare(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + const thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + comp(other) { + return this.compare(other); + } + divide(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw new BSONError('division by zero'); + if (wasm) { + if (!this.unsigned && + this.high === -2147483648 && + divisor.low === -1 && + divisor.high === -1) { + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + return Long.UONE; + res = Long.UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + div(divisor) { + return this.divide(divisor); + } + equals(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + eq(other) { + return this.equals(other); + } + getHighBits() { + return this.high; + } + getHighBitsUnsigned() { + return this.high >>> 0; + } + getLowBits() { + return this.low; + } + getLowBitsUnsigned() { + return this.low >>> 0; + } + getNumBitsAbs() { + if (this.isNegative()) { + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + greaterThan(other) { + return this.comp(other) > 0; + } + gt(other) { + return this.greaterThan(other); + } + greaterThanOrEqual(other) { + return this.comp(other) >= 0; + } + gte(other) { + return this.greaterThanOrEqual(other); + } + ge(other) { + return this.greaterThanOrEqual(other); + } + isEven() { + return (this.low & 1) === 0; + } + isNegative() { + return !this.unsigned && this.high < 0; + } + isOdd() { + return (this.low & 1) === 1; + } + isPositive() { + return this.unsigned || this.high >= 0; + } + isZero() { + return this.high === 0 && this.low === 0; + } + lessThan(other) { + return this.comp(other) < 0; + } + lt(other) { + return this.lessThan(other); + } + lessThanOrEqual(other) { + return this.comp(other) <= 0; + } + lte(other) { + return this.lessThanOrEqual(other); + } + modulo(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + } + mod(divisor) { + return this.modulo(divisor); + } + rem(divisor) { + return this.modulo(divisor); + } + multiply(multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + mul(multiplier) { + return this.multiply(multiplier); + } + negate() { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + neg() { + return this.negate(); + } + not() { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + notEquals(other) { + return !this.equals(other); + } + neq(other) { + return this.notEquals(other); + } + ne(other) { + return this.notEquals(other); + } + or(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + shiftLeft(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + shl(numBits) { + return this.shiftLeft(numBits); + } + shiftRight(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + shr(numBits) { + return this.shiftRight(numBits); + } + shiftRightUnsigned(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + shr_u(numBits) { + return this.shiftRightUnsigned(numBits); + } + shru(numBits) { + return this.shiftRightUnsigned(numBits); + } + subtract(subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + sub(subtrahend) { + return this.subtract(subtrahend); + } + toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + } + toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + toBigInt() { + return BigInt(this.toString()); + } + toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + } + toBytesLE() { + const hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + toBytesBE() { + const hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + toSigned() { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + } + toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + if (this.eq(Long.MIN_VALUE)) { + const radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + let rem = this; + let result = ''; + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + } + toUnsigned() { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + } + xor(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + eqz() { + return this.isZero(); + } + le(other) { + return this.lessThanOrEqual(other); + } + toExtendedJSON(options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc, options) { + const { useBigInt64 = false, relaxed = true } = { ...options }; + if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) { + throw new BSONError('$numberLong string is too long'); + } + if (!DECIMAL_REG_EX.test(doc.$numberLong)) { + throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`); + } + if (useBigInt64) { + const bigIntResult = BigInt(doc.$numberLong); + return BigInt.asIntN(64, bigIntResult); + } + const longResult = Long.fromString(doc.$numberLong); + if (relaxed) { + return longResult.toNumber(); + } + return longResult; + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const longVal = inspect(this.toString(), options); + const unsignedVal = this.unsigned ? `, ${inspect(this.unsigned, options)}` : ''; + return `new Long(${longVal}${unsignedVal})`; + } +} + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; +const NAN_BUFFER = ByteUtils.fromNumberArray([ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray([ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray([ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; +const COMBINATION_MASK = 0x1f; +const EXPONENT_MASK = 0x3fff; +const COMBINATION_INFINITY = 30; +const COMBINATION_NAN = 31; +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +function divideu128(value) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (let i = 0; i <= 3; i++) { + _rem = _rem.shiftLeft(32); + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message}`); +} +class Decimal128 extends BSONValue { + get _bsontype() { + return 'Decimal128'; + } + bytes; + constructor(bytes) { + super(); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (bytes instanceof Uint8Array || isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONError('Decimal128 must take a Buffer or string'); + } + } + static fromString(representation) { + return Decimal128._fromString(representation, { allowRounding: false }); + } + static fromStringWithRounding(representation) { + return Decimal128._fromString(representation, { allowRounding: true }); + } + static _fromString(representation, options) { + let isNegative = false; + let sawSign = false; + let sawRadix = false; + let foundNonZero = false; + let significantDigits = 0; + let nDigitsRead = 0; + let nDigits = 0; + let radixPosition = 0; + let firstNonZero = 0; + const digits = [0]; + let nDigitsStored = 0; + let digitsInsert = 0; + let lastDigit = 0; + let exponent = 0; + let significandHigh = new Long(0, 0); + let significandLow = new Long(0, 0); + let biasedExponent = 0; + let index = 0; + if (representation.length >= 7000) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + const unsignedNumber = stringMatch[2]; + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + if (representation[index] === '+' || representation[index] === '-') { + sawSign = true; + isNegative = representation[index++] === '-'; + } + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + else if (representation[index] === 'N') { + return new Decimal128(NAN_BUFFER); + } + } + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < MAX_DIGITS) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + if (representation[index] === 'e' || representation[index] === 'E') { + const match = representation.substr(++index).match(EXPONENT_REGEX); + if (!match || !match[2]) + return new Decimal128(NAN_BUFFER); + exponent = parseInt(match[0], 10); + index = index + match[0].length; + } + if (representation[index]) + return new Decimal128(NAN_BUFFER); + if (!nDigitsStored) { + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (representation[firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix)] === '0') { + significantDigits = significantDigits - 1; + } + } + } + if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + while (exponent > EXPONENT_MAX) { + lastDigit = lastDigit + 1; + if (lastDigit >= MAX_DIGITS) { + if (significantDigits === 0) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + if (options.allowRounding) { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + nDigits = nDigits - 1; + } + else { + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (let i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + let dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + } + } + else { + break; + } + } + } + } + } + else { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0) { + if (significantDigits === 0) { + exponent = EXPONENT_MIN; + break; + } + invalidErr(representation, 'exponent underflow'); + } + if (nDigitsStored < nDigits) { + if (representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== '0' && + significantDigits !== 0) { + invalidErr(representation, 'inexact rounding'); + } + nDigits = nDigits - 1; + } + else { + if (digits[lastDigit] !== 0) { + invalidErr(representation, 'inexact rounding'); + } + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + if (sawRadix) { + firstNonZero = firstNonZero + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + if (roundDigit !== 0) { + invalidErr(representation, 'inexact rounding'); + } + } + } + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit < 17) { + let dIdx = 0; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + let dIdx = 0; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + const buffer = ByteUtils.allocateUnsafe(16); + index = 0; + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + return new Decimal128(buffer); + } + toString() { + let biased_exponent; + let significand_digits = 0; + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) + significand[i] = 0; + let index = 0; + let is_zero = false; + let significand_msb; + let significand128 = { parts: [0, 0, 0, 0] }; + let j, k; + const string = []; + index = 0; + const buffer = this.bytes; + const low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + index = 0; + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + const combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + const exponent = biased_exponent - EXPONENT_BIAS; + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + significand[k * 9 + j] = least_digits % 10; + least_digits = Math.floor(least_digits / 10); + } + } + } + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + const scientific_exponent = significand_digits - 1 + exponent; + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) + string.push(`E+${exponent}`); + else if (exponent < 0) + string.push(`E${exponent}`); + return string.join(''); + } + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + string.push('E'); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } + else { + string.push(`${scientific_exponent}`); + } + } + else { + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } + else { + let radix_position = significand_digits + exponent; + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } + else { + string.push('0'); + } + string.push('.'); + while (radix_position++ < 0) { + string.push('0'); + } + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + return string.join(''); + } + toJSON() { + return { $numberDecimal: this.toString() }; + } + toExtendedJSON() { + return { $numberDecimal: this.toString() }; + } + static fromExtendedJSON(doc) { + return Decimal128.fromString(doc.$numberDecimal); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const d128string = inspect(this.toString(), options); + return `new Decimal128(${d128string})`; + } +} + +class Double extends BSONValue { + get _bsontype() { + return 'Double'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + static fromString(value) { + const coercedValue = Number(value); + if (value === 'NaN') + return new Double(NaN); + if (value === 'Infinity') + return new Double(Infinity); + if (value === '-Infinity') + return new Double(-Infinity); + if (!Number.isFinite(coercedValue)) { + throw new BSONError(`Input: ${value} is not representable as a Double`); + } + if (value.trim() !== value) { + throw new BSONError(`Input: '${value}' contains whitespace`); + } + if (value === '') { + throw new BSONError(`Input is an empty string`); + } + if (/[^-0-9.+eE]/.test(value)) { + throw new BSONError(`Input: '${value}' is not in decimal or exponential notation`); + } + return new Double(coercedValue); + } + valueOf() { + return this.value; + } + toJSON() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toExtendedJSON(options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: '-0.0' }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + static fromExtendedJSON(doc, options) { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Double(${inspect(this.value, options)})`; + } +} + +class Int32 extends BSONValue { + get _bsontype() { + return 'Int32'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + static fromString(value) { + const cleanedValue = removeLeadingZerosAndExplicitPlus(value); + const coercedValue = Number(value); + if (BSON_INT32_MAX < coercedValue) { + throw new BSONError(`Input: '${value}' is larger than the maximum value for Int32`); + } + else if (BSON_INT32_MIN > coercedValue) { + throw new BSONError(`Input: '${value}' is smaller than the minimum value for Int32`); + } + else if (!Number.isSafeInteger(coercedValue)) { + throw new BSONError(`Input: '${value}' is not a safe integer`); + } + else if (coercedValue.toString() !== cleanedValue) { + throw new BSONError(`Input: '${value}' is not a valid Int32 string`); + } + return new Int32(coercedValue); + } + valueOf() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toJSON() { + return this.value; + } + toExtendedJSON(options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + } + static fromExtendedJSON(doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Int32(${inspect(this.value, options)})`; + } +} + +class MaxKey extends BSONValue { + get _bsontype() { + return 'MaxKey'; + } + toExtendedJSON() { + return { $maxKey: 1 }; + } + static fromExtendedJSON() { + return new MaxKey(); + } + inspect() { + return 'new MaxKey()'; + } +} + +class MinKey extends BSONValue { + get _bsontype() { + return 'MinKey'; + } + toExtendedJSON() { + return { $minKey: 1 }; + } + static fromExtendedJSON() { + return new MinKey(); + } + inspect() { + return 'new MinKey()'; + } +} + +const __idCache = new WeakMap(); +const byteToHex = []; +for (let n = 0; n < 256; n++) + byteToHex.push(n.toString(16).padStart(2, '0')); +const hexCharCodeToNibble = new Int8Array(103); +for (let c = 48; c <= 57; c++) + hexCharCodeToNibble[c] = c - 48; +for (let c = 65; c <= 70; c++) + hexCharCodeToNibble[c] = c - 55; +for (let c = 97; c <= 102; c++) + hexCharCodeToNibble[c] = c - 87; +class ObjectId extends BSONValue { + get _bsontype() { + return 'ObjectId'; + } + static index = 0; + static PROCESS_UNIQUE = null; + static resetState = () => { + this.index = Math.floor(Math.random() * 0x1000000); + this.PROCESS_UNIQUE = null; + }; + static { + this.resetState(); + const { startupSnapshot } = globalThis?.process?.getBuiltinModule?.('v8') ?? {}; + if (startupSnapshot?.isBuildingSnapshot?.()) { + startupSnapshot?.addDeserializeCallback?.(this.resetState); + } + } + static cacheHexString; + i0; + i1; + i2; + i3; + setFromBytes(b, offset = 0) { + this.i0 = (b[offset] << 16) | (b[offset + 1] << 8) | b[offset + 2]; + this.i1 = (b[offset + 3] << 16) | (b[offset + 4] << 8) | b[offset + 5]; + this.i2 = (b[offset + 6] << 16) | (b[offset + 7] << 8) | b[offset + 8]; + this.i3 = (b[offset + 9] << 16) | (b[offset + 10] << 8) | b[offset + 11]; + } + setFromHex(s) { + const t = hexCharCodeToNibble; + this.i0 = + (t[s.charCodeAt(0)] << 20) | + (t[s.charCodeAt(1)] << 16) | + (t[s.charCodeAt(2)] << 12) | + (t[s.charCodeAt(3)] << 8) | + (t[s.charCodeAt(4)] << 4) | + t[s.charCodeAt(5)]; + this.i1 = + (t[s.charCodeAt(6)] << 20) | + (t[s.charCodeAt(7)] << 16) | + (t[s.charCodeAt(8)] << 12) | + (t[s.charCodeAt(9)] << 8) | + (t[s.charCodeAt(10)] << 4) | + t[s.charCodeAt(11)]; + this.i2 = + (t[s.charCodeAt(12)] << 20) | + (t[s.charCodeAt(13)] << 16) | + (t[s.charCodeAt(14)] << 12) | + (t[s.charCodeAt(15)] << 8) | + (t[s.charCodeAt(16)] << 4) | + t[s.charCodeAt(17)]; + this.i3 = + (t[s.charCodeAt(18)] << 20) | + (t[s.charCodeAt(19)] << 16) | + (t[s.charCodeAt(20)] << 12) | + (t[s.charCodeAt(21)] << 8) | + (t[s.charCodeAt(22)] << 4) | + t[s.charCodeAt(23)]; + } + constructor(inputId, offset) { + super(); + if (typeof offset === 'number') { + this.setFromBytes(inputId, offset); + return; + } + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (ObjectId.is(inputId) && + typeof inputId.i0 === 'number' && + typeof inputId.i1 === 'number' && + typeof inputId.i2 === 'number' && + typeof inputId.i3 === 'number') { + this.i0 = inputId.i0; + this.i1 = inputId.i1; + this.i2 = inputId.i2; + this.i3 = inputId.i3; + return; + } + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = ByteUtils.fromHex(inputId.toHexString()); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + if (workingId == null) { + const time = Math.floor(Date.now() / 1000); + const inc = ObjectId.getInc(); + const pu = (ObjectId.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + this.i0 = (time >>> 8) & 0xffffff; + this.i1 = ((time & 0xff) << 16) | (pu[0] << 8) | pu[1]; + this.i2 = (pu[2] << 16) | (pu[3] << 8) | pu[4]; + this.i3 = inc & 0xffffff; + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + this.setFromBytes(workingId instanceof Uint8Array ? workingId : ByteUtils.toLocalBufferType(workingId)); + } + else if (typeof workingId === 'string') { + if (ObjectId.validateHexString(workingId)) { + this.setFromHex(workingId); + if (ObjectId.cacheHexString) { + __idCache.set(this, workingId); + } + } + else { + throw new BSONError('input must be a 24 character hex string, 12 byte Uint8Array, or an integer'); + } + } + else { + throw new BSONError('Argument passed in does not match the accepted types'); + } + } + get id() { + const b = ByteUtils.allocateUnsafe(12); + b[0] = (this.i0 >>> 16) & 0xff; + b[1] = (this.i0 >>> 8) & 0xff; + b[2] = this.i0 & 0xff; + b[3] = (this.i1 >>> 16) & 0xff; + b[4] = (this.i1 >>> 8) & 0xff; + b[5] = this.i1 & 0xff; + b[6] = (this.i2 >>> 16) & 0xff; + b[7] = (this.i2 >>> 8) & 0xff; + b[8] = this.i2 & 0xff; + b[9] = (this.i3 >>> 16) & 0xff; + b[10] = (this.i3 >>> 8) & 0xff; + b[11] = this.i3 & 0xff; + return b; + } + set id(value) { + const bytes = value instanceof Uint8Array ? value : ByteUtils.toLocalBufferType(value); + this.setFromBytes(bytes); + if (ObjectId.cacheHexString) { + __idCache.set(this, ByteUtils.toHex(bytes)); + } + } + static validateHexString(string) { + if (string?.length !== 24) + return false; + for (let i = 0; i < 24; i++) { + const char = string.charCodeAt(i); + if ((char >= 48 && char <= 57) || + (char >= 97 && char <= 102) || + (char >= 65 && char <= 70)) { + continue; + } + return false; + } + return true; + } + toHexString() { + if (ObjectId.cacheHexString) { + const __id = __idCache.get(this); + if (__id) + return __id; + } + const i0 = this.i0; + const i1 = this.i1; + const i2 = this.i2; + const i3 = this.i3; + const hexString = byteToHex[(i0 >>> 16) & 0xff] + + byteToHex[(i0 >>> 8) & 0xff] + + byteToHex[i0 & 0xff] + + byteToHex[(i1 >>> 16) & 0xff] + + byteToHex[(i1 >>> 8) & 0xff] + + byteToHex[i1 & 0xff] + + byteToHex[(i2 >>> 16) & 0xff] + + byteToHex[(i2 >>> 8) & 0xff] + + byteToHex[i2 & 0xff] + + byteToHex[(i3 >>> 16) & 0xff] + + byteToHex[(i3 >>> 8) & 0xff] + + byteToHex[i3 & 0xff]; + if (ObjectId.cacheHexString) { + __idCache.set(this, hexString); + } + return hexString; + } + static getInc() { + return (ObjectId.index = (ObjectId.index + 1) % 0x1000000); + } + static generate(time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + const inc = ObjectId.getInc(); + const buffer = ByteUtils.allocateUnsafe(12); + NumberUtils.setInt32BE(buffer, 0, time); + const PROCESS_UNIQUE = (this.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + buffer[11] = inc & 0xff; + buffer[10] = (inc >>> 8) & 0xff; + buffer[9] = (inc >>> 16) & 0xff; + return buffer; + } + toString(encoding) { + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + if (encoding === 'hex') + return this.toHexString(); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + static is(variable) { + return (variable != null && + typeof variable === 'object' && + '_bsontype' in variable && + variable._bsontype === 'ObjectId'); + } + equals(otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (ObjectId.is(otherId) && + typeof otherId.i0 === 'number' && + typeof otherId.i1 === 'number' && + typeof otherId.i2 === 'number' && + typeof otherId.i3 === 'number') { + return (this.i3 === otherId.i3 && + this.i0 === otherId.i0 && + this.i1 === otherId.i1 && + this.i2 === otherId.i2); + } + if (typeof otherId === 'string') { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'object' && typeof otherId.toHexString === 'function') { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + } + getTimestamp() { + const timestamp = new Date(); + const time = this.i0 * 0x100 + (this.i1 >>> 16); + timestamp.setTime(time * 1000); + return timestamp; + } + static createPk() { + return new ObjectId(); + } + serializeInto(uint8array, index) { + uint8array[index] = (this.i0 >>> 16) & 0xff; + uint8array[index + 1] = (this.i0 >>> 8) & 0xff; + uint8array[index + 2] = this.i0 & 0xff; + uint8array[index + 3] = (this.i1 >>> 16) & 0xff; + uint8array[index + 4] = (this.i1 >>> 8) & 0xff; + uint8array[index + 5] = this.i1 & 0xff; + uint8array[index + 6] = (this.i2 >>> 16) & 0xff; + uint8array[index + 7] = (this.i2 >>> 8) & 0xff; + uint8array[index + 8] = this.i2 & 0xff; + uint8array[index + 9] = (this.i3 >>> 16) & 0xff; + uint8array[index + 10] = (this.i3 >>> 8) & 0xff; + uint8array[index + 11] = this.i3 & 0xff; + return 12; + } + static createFromTime(time) { + const buffer = ByteUtils.allocate(12); + for (let i = 11; i >= 4; i--) + buffer[i] = 0; + NumberUtils.setInt32BE(buffer, 0, time); + return new ObjectId(buffer); + } + static createFromHexString(hexString) { + if (hexString?.length !== 24) { + throw new BSONError('hex string must be 24 characters'); + } + return new ObjectId(ByteUtils.fromHex(hexString)); + } + static createFromBase64(base64) { + if (base64?.length !== 16) { + throw new BSONError('base64 string must be 16 characters'); + } + return new ObjectId(ByteUtils.fromBase64(base64)); + } + static isValid(id) { + if (id == null) + return false; + if (typeof id === 'string') + return ObjectId.validateHexString(id); + try { + new ObjectId(id); + return true; + } + catch { + return false; + } + } + toExtendedJSON() { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + static fromExtendedJSON(doc) { + return new ObjectId(doc.$oid); + } + isCached() { + return ObjectId.cacheHexString && __idCache.has(this); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new ObjectId(${inspect(this.toHexString(), options)})`; + } +} + +function internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined) { + const objectStack = [ + { object, ignoreUndefined: ignoreUndefined ?? false, exit: false } + ]; + const path = new Set(); + let total = 0; + while (objectStack.length > 0) { + const frame = objectStack.pop(); + if (frame.exit) { + path.delete(frame.object); + continue; + } + const { object: obj, ignoreUndefined: frameIgnoreUndefined } = frame; + path.add(obj); + frame.exit = true; + objectStack.push(frame); + total += 5; + const isObjArray = Array.isArray(obj); + const isObjMap = !isObjArray && (obj instanceof Map || isMap(obj)); + let target = obj; + if (!isObjArray && !isObjMap && typeof obj?.toBSON === 'function') { + target = obj.toBSON(); + } + if (isObjArray) { + const array = target; + for (let i = 0; i < array.length; i++) { + total += calculateElementSize(i.toString(), array[i], serializeFunctions, true, frameIgnoreUndefined, objectStack, path); + } + } + else if (isObjMap) { + for (const [key, value] of target) { + total += calculateElementSize(key, value, serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + else { + for (const key of Object.keys(target)) { + total += calculateElementSize(key, target[key], serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + } + return total; +} +function calculateElementSize(name, value, serializeFunctions = false, isArray = false, ignoreUndefined = false, objectStack, path) { + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return ByteUtils.utf8ByteLength(name) + 1 + 1; + return 0; + case 'boolean': + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 1); + case 'object': + if (value != null && + typeof value._bsontype === 'string' && + value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (value == null || value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') { + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value._bsontype === 'ObjectId') { + return ByteUtils.utf8ByteLength(name) + 1 + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 4 + 1) + value.byteLength; + } + else if (value._bsontype === 'Long' || + value._bsontype === 'Double' || + value._bsontype === 'Timestamp') { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (value._bsontype === 'Decimal128') { + return ByteUtils.utf8ByteLength(name) + 1 + (16 + 1); + } + else if (value._bsontype === 'Int32') { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else if (value._bsontype === 'Code') { + if (value.scope != null && Object.keys(value.scope).length > 0) { + if (path.has(value.scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value.scope, ignoreUndefined, exit: false }); + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + else { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + } + else if (value._bsontype === 'Binary') { + const binary = value; + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1 + 4); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1); + } + } + else if (value._bsontype === 'BSONSymbol') { + return (ByteUtils.utf8ByteLength(name) + 1 + ByteUtils.utf8ByteLength(value.value) + 4 + 1 + 1); + } + else if (value._bsontype === 'DBRef') { + const ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + if (value.db != null) { + ordered_values['$db'] = value.db; + } + objectStack.push({ object: ordered_values, ignoreUndefined: true, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value instanceof RegExp || isRegExp(value)) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.source) + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value._bsontype === 'BSONRegExp') { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.pattern) + + 1 + + ByteUtils.utf8ByteLength(value.options) + + 1); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value, ignoreUndefined, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + case 'function': + if (serializeFunctions) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.toString()) + + 1); + } + return 0; + case 'bigint': + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + case 'symbol': + return 0; + default: + throw new BSONError(`Unrecognized JS type: ${typeof value}`); + } +} + +function alphabetize(str) { + return str.split('').sort().join(''); +} +class BSONRegExp extends BSONValue { + get _bsontype() { + return 'BSONRegExp'; + } + pattern; + options; + constructor(pattern, options) { + super(); + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`); + } + for (let i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + static parseOptions(options) { + return options ? options.split('').sort().join('') : ''; + } + toExtendedJSON(options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + static fromExtendedJSON(doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } + inspect(depth, options, inspect) { + const stylize = getStylizeFunction(options) ?? (v => v); + inspect ??= defaultInspect; + const pattern = stylize(inspect(this.pattern), 'regexp'); + const flags = stylize(inspect(this.options), 'regexp'); + return `new BSONRegExp(${pattern}, ${flags})`; + } +} + +class BSONSymbol extends BSONValue { + get _bsontype() { + return 'BSONSymbol'; + } + value; + constructor(value) { + super(); + this.value = value; + } + valueOf() { + return this.value; + } + toString() { + return this.value; + } + toJSON() { + return this.value; + } + toExtendedJSON() { + return { $symbol: this.value }; + } + static fromExtendedJSON(doc) { + return new BSONSymbol(doc.$symbol); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new BSONSymbol(${inspect(this.value, options)})`; + } +} + +const LongWithoutOverridesClass = Long; +class Timestamp extends LongWithoutOverridesClass { + get _bsontype() { + return 'Timestamp'; + } + get [bsonType]() { + return 'Timestamp'; + } + static MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + get i() { + return this.low >>> 0; + } + get t() { + return this.high >>> 0; + } + constructor(low) { + if (low == null) { + super(0, 0, true); + } + else if (typeof low === 'bigint') { + super(low, true); + } + else if (Long.isLong(low)) { + super(low.low, low.high, true); + } + else if (typeof low === 'object' && 't' in low && 'i' in low) { + if (typeof low.t !== 'number' && (typeof low.t !== 'object' || low.t._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide t as a number'); + } + if (typeof low.i !== 'number' && (typeof low.i !== 'object' || low.i._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide i as a number'); + } + const t = Number(low.t); + const i = Number(low.i); + if (t < 0 || Number.isNaN(t)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive t'); + } + if (i < 0 || Number.isNaN(i)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive i'); + } + if (t > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide t equal or less than uint32 max'); + } + if (i > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide i equal or less than uint32 max'); + } + super(i, t, true); + } + else { + throw new BSONError('A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }'); + } + } + toJSON() { + return { + $timestamp: this.toString() + }; + } + static fromInt(value) { + return new Timestamp(Long.fromInt(value, true)); + } + static fromNumber(value) { + return new Timestamp(Long.fromNumber(value, true)); + } + static fromBits(lowBits, highBits) { + return new Timestamp({ i: lowBits, t: highBits }); + } + static fromString(str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + toExtendedJSON() { + return { $timestamp: { t: this.t, i: this.i } }; + } + static fromExtendedJSON(doc) { + const i = Long.isLong(doc.$timestamp.i) + ? doc.$timestamp.i.getLowBitsUnsigned() + : doc.$timestamp.i; + const t = Long.isLong(doc.$timestamp.t) + ? doc.$timestamp.t.getLowBitsUnsigned() + : doc.$timestamp.t; + return new Timestamp({ t, i }); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const t = inspect(this.t, options); + const i = inspect(this.i, options); + return `new Timestamp({ t: ${t}, i: ${i} })`; + } +} + +const JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +function internalDeserialize(buffer, options, isArray) { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + const size = NumberUtils.getInt32LE(buffer, index); + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + if (size + index > buffer.byteLength) { + throw new BSONError(`(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})`); + } + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + return deserializeObject(buffer, index, options, isArray); +} +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function assignValue(dest, name, value) { + if (name === '__proto__') { + Object.defineProperty(dest, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + dest[name] = value; + } +} +function toPotentialDbRef(doc) { + if (isDBRefLike(doc)) { + const { $ref, $id, $db, ...fields } = doc; + return new DBRef($ref, $id, $db, fields); + } + return doc; +} +function deserializeObject(buffer, index, options, isArray = false) { + options = { ...options }; + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + const raw = options['raw'] == null ? false : options['raw']; + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + const promoteBuffers = options.promoteBuffers ?? false; + const promoteLongs = options.promoteLongs ?? true; + const promoteValues = options.promoteValues ?? true; + const useBigInt64 = options.useBigInt64 ?? false; + if (useBigInt64 && !promoteValues) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + if (useBigInt64 && !promoteLongs) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + const validation = options.validation == null ? { utf8: true } : options.validation; + let globalUTFValidation = true; + let validationSetting; + let utf8KeysSet; + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + if (!globalUTFValidation) { + utf8KeysSet = new Set(); + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + const startIndex = index; + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + const size = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + const rootObject = isArray ? [] : {}; + let arrayIndex = 0; + let isPossibleDBRef = isArray ? false : null; + let currentFrame = null; + let currentDest = rootObject; + let currentIsArray = isArray; + while (true) { + const elementType = buffer[index++]; + if (elementType === 0) { + if (currentFrame) { + if (index === currentFrame.lastIndex) { + const completedFrame = currentFrame; + currentFrame = completedFrame.prev; + if (currentFrame === null) { + currentDest = rootObject; + currentIsArray = isArray; + } + else { + currentDest = currentFrame.holdingDocument; + currentIsArray = currentFrame.isArray; + } + let result = completedFrame.holdingDocument; + switch (completedFrame.elementType) { + case BSON_DATA_OBJECT: + if (completedFrame.isPossibleDBRef) { + result = toPotentialDbRef(result); + } + break; + case BSON_DATA_ARRAY: + break; + case BSON_DATA_CODE_W_SCOPE: + result = new Code(completedFrame.functionString, completedFrame.holdingDocument); + break; + default: + throw new BSONError('Unexpected element type in frame stack'); + } + assignValue(currentDest, completedFrame.propertyName, result); + continue; + } + else { + if (currentFrame.elementType === BSON_DATA_ARRAY) { + throw new BSONError('corrupted array bson'); + } + throw new BSONError('Bad BSON Document: object not properly terminated'); + } + } + else { + break; + } + } + let i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + const name = currentIsArray + ? currentFrame !== null + ? currentFrame.arrayIndex++ + : arrayIndex++ + : ByteUtils.toUTF8(buffer, index, i, false); + let shouldValidateKey; + if (currentFrame !== null) { + shouldValidateKey = currentFrame.validationSetting; + } + else if (globalUTFValidation || utf8KeysSet?.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (currentFrame !== null) { + if (currentFrame.isPossibleDBRef !== false && typeof name === 'string' && name[0] === '$') { + currentFrame.isPossibleDBRef = allowedDBRefKeys.test(name); + } + } + else if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + let value; + let isDeferredValue = false; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + value = new ObjectId(buffer, index); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(NumberUtils.getInt32LE(buffer, index)); + index += 4; + } + else if (elementType === BSON_DATA_INT) { + value = NumberUtils.getInt32LE(buffer, index); + index += 4; + } + else if (elementType === BSON_DATA_NUMBER) { + value = NumberUtils.getFloat64LE(buffer, index); + index += 8; + if (promoteValues === false) + value = new Double(value); + } + else if (elementType === BSON_DATA_DATE) { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + if (raw || (currentFrame?.raw ?? false)) { + value = buffer.subarray(index, index + objectSize); + index = index + objectSize; + } + else { + isDeferredValue = true; + const objectFrame = { + holdingDocument: {}, + elementType: BSON_DATA_OBJECT, + propertyName: name, + functionString: null, + lastIndex: index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = objectFrame; + currentDest = objectFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + } + else if (elementType === BSON_DATA_ARRAY) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded array length in bson'); + const stopIndex = index + objectSize; + const arrayRaw = !!(fieldsAsRaw && fieldsAsRaw[name]) || (currentFrame?.raw ?? false); + isDeferredValue = true; + const arrayFrame = { + holdingDocument: [], + elementType: BSON_DATA_ARRAY, + propertyName: name, + functionString: null, + lastIndex: stopIndex, + isArray: true, + arrayIndex: 0, + raw: arrayRaw, + isPossibleDBRef: false, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = arrayFrame; + currentDest = arrayFrame.holdingDocument; + currentIsArray = true; + index = index + 4; + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + if (useBigInt64) { + value = NumberUtils.getBigInt64LE(buffer, index); + index += 8; + } + else { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + const long = new Long(lowBits, highBits); + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + const bytes = ByteUtils.allocateUnsafe(16); + for (let i = 0; i < 16; i++) + bytes[i] = buffer[index + i]; + index = index + 16; + value = new Decimal128(bytes); + } + else if (elementType === BSON_DATA_BINARY) { + let binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + const totalBinarySize = binarySize; + const subType = buffer[index++]; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = ByteUtils.toLocalBufferType(buffer.subarray(index, index + binarySize)); + } + else { + value = new Binary(buffer.subarray(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) { + value = value.toUUID(); + } + } + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + const optionsArray = new Array(regExpOptions.length); + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const symbol = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + value = new Timestamp({ + i: NumberUtils.getUint32LE(buffer, index), + t: NumberUtils.getUint32LE(buffer, index + 4) + }); + index += 8; + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = new Code(functionString); + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + const totalSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad scope document size in code_w_scope'); + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + isDeferredValue = true; + const scopeFrame = { + holdingDocument: {}, + elementType: BSON_DATA_CODE_W_SCOPE, + propertyName: name, + functionString: functionString, + lastIndex: _index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = scopeFrame; + currentDest = scopeFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + else if (elementType === BSON_DATA_DBPOINTER) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + const namespace = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const oidBuffer = ByteUtils.allocateUnsafe(12); + for (let i = 0; i < 12; i++) + oidBuffer[i] = buffer[index + i]; + const oid = new ObjectId(oidBuffer); + index = index + 12; + value = new DBRef(namespace, oid); + } + else { + throw new BSONError(`Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"`); + } + if (!isDeferredValue) { + assignValue(currentDest, name, value); + } + } + if (currentFrame !== null) { + throw new BSONError('corrupted bson, more objects expected based on the current document size'); + } + const object = rootObject; + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + if (!isPossibleDBRef) + return object; + return toPotentialDbRef(object); +} + +const regexp = /\x00/; +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +function serializeString(buffer, key, value, index) { + buffer[index++] = BSON_DATA_STRING; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value, index + 4); + NumberUtils.setInt32LE(buffer, index, size + 1); + index = index + 4 + size; + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index) { + const isNegativeZero = Object.is(value, -0); + const type = !isNegativeZero && + Number.isSafeInteger(value) && + value <= BSON_INT32_MAX && + value >= BSON_INT32_MIN + ? BSON_DATA_INT + : BSON_DATA_NUMBER; + buffer[index++] = type; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0x00; + if (type === BSON_DATA_INT) { + index += NumberUtils.setInt32LE(buffer, index, value); + } + else { + index += NumberUtils.setFloat64LE(buffer, index, value); + } + return index; +} +function serializeBigInt(buffer, key, value, index) { + buffer[index++] = BSON_DATA_LONG; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index += numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setBigInt64LE(buffer, index, value); + return index; +} +function serializeNull(buffer, key, _, index) { + buffer[index++] = BSON_DATA_NULL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BOOLEAN; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DATE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw new BSONError('value ' + value.source + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.source, index); + buffer[index++] = 0x00; + if (value.ignoreCase) + buffer[index++] = 0x69; + if (value.global) + buffer[index++] = 0x73; + if (value.multiline) + buffer[index++] = 0x6d; + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.pattern.match(regexp) != null) { + throw new BSONError('pattern ' + value.pattern + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.pattern, index); + buffer[index++] = 0x00; + const sortedOptions = value.options.split('').sort().join(''); + index = index + ByteUtils.encodeUTF8Into(buffer, sortedOptions, index); + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index) { + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value[bsonType] === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index) { + buffer[index++] = BSON_DATA_OID; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += value.serializeInto(buffer, index); + return index; +} +function serializeBuffer(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = value.length; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = value[i]; + } + else { + buffer.set(value, index); + } + index = index + size; + return index; +} +function serializeDecimal128(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DECIMAL128; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + for (let i = 0; i < 16; i++) + buffer[index + i] = value.bytes[i]; + return index + 16; +} +function serializeLong(buffer, key, value, index) { + buffer[index++] = + value[bsonType] === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeInt32(buffer, key, value, index) { + value = value.valueOf(); + buffer[index++] = BSON_DATA_INT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setInt32LE(buffer, index, value); + return index; +} +function serializeDouble(buffer, key, value, index) { + buffer[index++] = BSON_DATA_NUMBER; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setFloat64LE(buffer, index, value.value); + return index; +} +function serializeFunction(buffer, key, value, index) { + buffer[index++] = BSON_DATA_CODE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const functionString = value.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function serializeBinary(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const data = value.buffer; + let size = value.position; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = value.sub_type; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + index += NumberUtils.setInt32LE(buffer, index, size); + } + if (value.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(value); + } + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = data[i]; + } + else { + buffer.set(data, index); + } + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index) { + buffer[index++] = BSON_DATA_SYMBOL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value.value, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function makeFrame(sourceObject, objectSizeIndex, codeSizeIndex, prev, checkKeys, ignoreUndefined) { + if (Array.isArray(sourceObject)) { + return { + sourceObject, + isArray: true, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; + } + if (sourceObject instanceof Map || isMap(sourceObject)) { + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: sourceObject.entries(), + prev, + checkKeys, + ignoreUndefined + }; + } + let target = sourceObject; + if (typeof target?.toBSON === 'function') { + target = target.toBSON(); + if (target != null && typeof target !== 'object') { + throw new BSONError('toBSON function did not return an object'); + } + } + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: target, + keys: Object.keys(target), + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; +} +function serializeInto(buffer, object, checkKeys, startingIndex, serializeFunctions, ignoreUndefined, path) { + if (path == null) { + if (object == null) { + buffer[0] = 0x05; + buffer[1] = 0x00; + buffer[2] = 0x00; + buffer[3] = 0x00; + buffer[4] = 0x00; + return 5; + } + if (Array.isArray(object)) { + throw new BSONError('serialize does not support an array as the root input'); + } + if (typeof object !== 'object') { + throw new BSONError('serialize does not support non-object as the root input'); + } + else if ('_bsontype' in object && typeof object._bsontype === 'string') { + throw new BSONError(`BSON types cannot be serialized as a document`); + } + else if (isDate(object) || + isRegExp(object) || + isUint8Array(object) || + isAnyArrayBuffer(object)) { + throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`); + } + path = new Set(); + } + path.add(object); + let currentFrame = makeFrame(object, startingIndex, null, null, checkKeys, ignoreUndefined); + let index = startingIndex + 4; + while (currentFrame !== null) { + const frame = currentFrame; + let key; + let value; + if (frame.mapIterator !== null) { + const next = frame.mapIterator.next(); + if (next.done) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = next.value[0]; + value = next.value[1]; + } + else if (frame.keys !== null) { + if (frame.keyIndex >= frame.keys.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = frame.keys[frame.keyIndex++]; + value = frame.iterTarget[key]; + } + else { + const arr = frame.iterTarget; + if (frame.keyIndex >= arr.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + const i = frame.keyIndex++; + key = String(i); + value = arr[i]; + } + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + if (!frame.isArray && typeof key === 'string' && !(key[0] === '$' && ignoreKeys.has(key))) { + if (regexp.test(key)) { + throw new BSONError('key ' + key + ' must not contain null bytes'); + } + if (frame.checkKeys) { + if ('$' === key[0]) { + throw new BSONError('key ' + key + " must not start with '$'"); + } + else if (key.includes('.')) { + throw new BSONError('key ' + key + " must not contain '.'"); + } + } + } + const type = typeof value; + if (value === undefined) { + if (frame.isArray || frame.ignoreUndefined === false) { + index = serializeNull(buffer, key, value, index); + } + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + index = serializeBigInt(buffer, key, value, index); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (type === 'object' && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + const nestedIsArray = Array.isArray(value); + buffer[index++] = nestedIsArray ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const nestedStartIndex = index; + path.add(value); + currentFrame = makeFrame(value, nestedStartIndex, null, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + } + else if (type === 'object') { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + const tag = value[bsonType]; + if (tag === 'ObjectId') { + index = serializeObjectId(buffer, key, value, index); + } + else if (tag === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (tag === 'Long' || tag === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (tag === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (tag === 'Code') { + const codeValue = value; + if (codeValue.scope && typeof codeValue.scope === 'object') { + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const codeTotalSizeIndex = index; + index += 4; + const functionString = codeValue.code; + const codeSize = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, codeSize); + buffer[index + 4 + codeSize - 1] = 0; + index = index + codeSize + 4; + const scope = codeValue.scope; + if (path.has(scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + path.add(scope); + currentFrame = makeFrame(scope, index, codeTotalSizeIndex, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + else { + buffer[index++] = BSON_DATA_CODE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const functionString = codeValue.code.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + } + } + else if (tag === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (tag === 'BSONSymbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (tag === 'DBRef') { + const dbref = value; + const orderedValues = Object.assign({ $ref: dbref.collection, $id: dbref.oid }, dbref.db != null ? { $db: dbref.db } : null, dbref.fields); + buffer[index++] = BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + path.add(orderedValues); + currentFrame = makeFrame(orderedValues, index, null, frame, false, true); + index += 4; + } + else if (tag === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (tag === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (tag === 'MinKey' || tag === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value._bsontype !== 'undefined') { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } + else if (type === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index); + } + } + return index; +} + +function isBSONType(value) { + return (value != null && + typeof value === 'object' && + '_bsontype' in value && + typeof value._bsontype === 'string'); +} +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +function deserializeValue(value, options = {}) { + if (typeof value === 'number') { + const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN; + const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN; + if (options.relaxed || options.legacy) { + return value; + } + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (in32BitRange) { + return new Int32(value); + } + if (in64BitRange) { + if (options.useBigInt64) { + return BigInt(value); + } + return Long.fromNumber(value); + } + } + return new Double(value); + } + if (value == null || typeof value !== 'object') + return value; + if (value.$undefined) + return null; + const keys = Object.keys(value).filter(k => k.startsWith('$') && value[k] != null); + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + return date; + } + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + if (v instanceof DBRef) + return v; + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid = false; + }); + if (valid) + return DBRef.fromExtendedJSON(v); + } + return value; +} +function serializeArray(array, options) { + return array.map((v, index) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + const isoStr = date.toISOString(); + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +function serializeValue(value, options) { + if (value instanceof Map || isMap(value)) { + const obj = Object.create(null); + for (const [k, v] of value) { + if (typeof k !== 'string') { + throw new BSONError('Can only serialize maps with string keys'); + } + obj[k] = v; + } + return serializeValue(obj, options); + } + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONError('Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/`); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return options.ignoreUndefined ? undefined : null; + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), inRange = dateNum > -1 && dateNum < 253402300800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return { $numberInt: value.toString() }; + } + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) { + return { $numberLong: value.toString() }; + } + } + return { $numberDouble: Object.is(value, -0) ? '-0.0' : value.toString() }; + } + if (typeof value === 'bigint') { + if (!options.relaxed) { + return { $numberLong: BigInt.asIntN(64, value).toString() }; + } + return Number(BigInt.asIntN(64, value)); + } + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +const BSON_TYPE_MAPPINGS = { + Binary: (o) => new Binary(o.value(), o.sub_type), + Code: (o) => new Code(o.code, o.scope), + DBRef: (o) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), + Decimal128: (o) => new Decimal128(o.bytes), + Double: (o) => new Double(o.value), + Int32: (o) => new Int32(o.value), + Long: (o) => Long.fromBits(o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectId: (o) => new ObjectId(o), + BSONRegExp: (o) => new BSONRegExp(o.pattern, o.options), + BSONSymbol: (o) => new BSONSymbol(o.value), + Timestamp: (o) => Timestamp.fromBits(o.low, o.high) +}; +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + const bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + const _doc = {}; + for (const name of Object.keys(doc)) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (doc != null && + typeof doc === 'object' && + typeof doc._bsontype === 'string' && + doc[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (isBSONType(doc)) { + let outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +function parse(text, options) { + const ejsonOptions = { + useBigInt64: options?.useBigInt64 ?? false, + relaxed: options?.relaxed ?? true, + legacy: options?.legacy ?? false + }; + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}`); + } + return deserializeValue(value, ejsonOptions); + }); +} +function stringify(value, replacerOrOptions, spaceOrOptions, options) { + if (spaceOrOptions != null && typeof spaceOrOptions === 'object') { + options = spaceOrOptions; + spaceOrOptions = undefined; + } + if (replacerOrOptions != null && + typeof replacerOrOptions === 'object' && + !Array.isArray(replacerOrOptions)) { + options = replacerOrOptions; + replacerOrOptions = undefined; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacerOrOptions, spaceOrOptions); +} +function EJSONserialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); +} +function EJSONdeserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); +} +const EJSON = Object.create(null); +EJSON.parse = parse; +EJSON.stringify = stringify; +EJSON.serialize = EJSONserialize; +EJSON.deserialize = EJSONdeserialize; +Object.freeze(EJSON); + +const BSONElementType = { + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: 255, + maxKey: 127 +}; +function getSize(source, offset) { + try { + return NumberUtils.getNonnegativeInt32LE(source, offset); + } + catch (cause) { + throw new BSONOffsetError('BSON size cannot be negative', offset, { cause }); + } +} +function findNull(bytes, offset) { + let nullTerminatorOffset = offset; + for (; bytes[nullTerminatorOffset] !== 0x00; nullTerminatorOffset++) + ; + if (nullTerminatorOffset === bytes.length - 1) { + throw new BSONOffsetError('Null terminator not found', offset); + } + return nullTerminatorOffset; +} +function parseToElements(bytes, startOffset = 0) { + startOffset ??= 0; + if (bytes.length < 5) { + throw new BSONOffsetError(`Input must be at least 5 bytes, got ${bytes.length} bytes`, startOffset); + } + const documentSize = getSize(bytes, startOffset); + if (documentSize > bytes.length - startOffset) { + throw new BSONOffsetError(`Parsed documentSize (${documentSize} bytes) does not match input length (${bytes.length} bytes)`, startOffset); + } + if (bytes[startOffset + documentSize - 1] !== 0x00) { + throw new BSONOffsetError('BSON documents must end in 0x00', startOffset + documentSize); + } + const elements = []; + let offset = startOffset + 4; + while (offset <= documentSize + startOffset) { + const type = bytes[offset]; + offset += 1; + if (type === 0) { + if (offset - startOffset !== documentSize) { + throw new BSONOffsetError(`Invalid 0x00 type byte`, offset); + } + break; + } + const nameOffset = offset; + const nameLength = findNull(bytes, offset) - nameOffset; + offset += nameLength + 1; + let length; + if (type === BSONElementType.double || + type === BSONElementType.long || + type === BSONElementType.date || + type === BSONElementType.timestamp) { + length = 8; + } + else if (type === BSONElementType.int) { + length = 4; + } + else if (type === BSONElementType.objectId) { + length = 12; + } + else if (type === BSONElementType.decimal) { + length = 16; + } + else if (type === BSONElementType.bool) { + length = 1; + } + else if (type === BSONElementType.null || + type === BSONElementType.undefined || + type === BSONElementType.maxKey || + type === BSONElementType.minKey) { + length = 0; + } + else if (type === BSONElementType.regex) { + length = findNull(bytes, findNull(bytes, offset) + 1) + 1 - offset; + } + else if (type === BSONElementType.object || + type === BSONElementType.array || + type === BSONElementType.javascriptWithScope) { + length = getSize(bytes, offset); + } + else if (type === BSONElementType.string || + type === BSONElementType.binData || + type === BSONElementType.dbPointer || + type === BSONElementType.javascript || + type === BSONElementType.symbol) { + length = getSize(bytes, offset) + 4; + if (type === BSONElementType.binData) { + length += 1; + } + if (type === BSONElementType.dbPointer) { + length += 12; + } + } + else { + throw new BSONOffsetError(`Invalid 0x${type.toString(16).padStart(2, '0')} type byte`, offset); + } + if (length > documentSize) { + throw new BSONOffsetError('value reports length larger than document', offset); + } + elements.push([type, nameOffset, nameLength, offset, length]); + offset += length; + } + return elements; +} + +const onDemand = Object.create(null); +onDemand.parseToElements = parseToElements; +onDemand.ByteUtils = ByteUtils; +onDemand.NumberUtils = NumberUtils; +Object.freeze(onDemand); + +const MAXSIZE = 1024 * 1024 * 17; +let buffer = ByteUtils.allocate(MAXSIZE); +function setInternalBufferSize(size) { + if (buffer.length < size) { + buffer = ByteUtils.allocate(size); + } +} +function serialize(object, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + if (buffer.length < minInternalBufferSize) { + buffer = ByteUtils.allocate(minInternalBufferSize); + } + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + const finishedBuffer = ByteUtils.allocateUnsafe(serializationIndex); + finishedBuffer.set(buffer.subarray(0, serializationIndex), 0); + return finishedBuffer; +} +function serializeWithBufferAndIndex(object, finalBuffer, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex); + return startIndex + serializationIndex - 1; +} +function deserialize(buffer, options = {}) { + return internalDeserialize(ByteUtils.toLocalBufferType(buffer), options); +} +function calculateObjectSize(object, options = {}) { + options = options || {}; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + const internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + const bufferData = ByteUtils.toLocalBufferType(data); + let index = startIndex; + for (let i = 0; i < numberOfDocuments; i++) { + const size = NumberUtils.getInt32LE(bufferData, index); + internalOptions.index = index; + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + index = index + size; + } + return index; +} + +var bson = /*#__PURE__*/Object.freeze({ + __proto__: null, + BSONError: BSONError, + BSONOffsetError: BSONOffsetError, + BSONRegExp: BSONRegExp, + BSONRuntimeError: BSONRuntimeError, + BSONSymbol: BSONSymbol, + BSONType: BSONType, + BSONValue: BSONValue, + BSONVersionError: BSONVersionError, + Binary: Binary, + ByteUtils: ByteUtils, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + EJSON: EJSON, + Int32: Int32, + Long: Long, + MaxKey: MaxKey, + MinKey: MinKey, + NumberUtils: NumberUtils, + ObjectId: ObjectId, + Timestamp: Timestamp, + UUID: UUID, + bsonType: bsonType, + calculateObjectSize: calculateObjectSize, + deserialize: deserialize, + deserializeStream: deserializeStream, + onDemand: onDemand, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + setInternalBufferSize: setInternalBufferSize +}); + +exports.BSON = bson; +exports.BSONError = BSONError; +exports.BSONOffsetError = BSONOffsetError; +exports.BSONRegExp = BSONRegExp; +exports.BSONRuntimeError = BSONRuntimeError; +exports.BSONSymbol = BSONSymbol; +exports.BSONType = BSONType; +exports.BSONValue = BSONValue; +exports.BSONVersionError = BSONVersionError; +exports.Binary = Binary; +exports.ByteUtils = ByteUtils; +exports.Code = Code; +exports.DBRef = DBRef; +exports.Decimal128 = Decimal128; +exports.Double = Double; +exports.EJSON = EJSON; +exports.Int32 = Int32; +exports.Long = Long; +exports.MaxKey = MaxKey; +exports.MinKey = MinKey; +exports.NumberUtils = NumberUtils; +exports.ObjectId = ObjectId; +exports.Timestamp = Timestamp; +exports.UUID = UUID; +exports.bsonType = bsonType; +exports.calculateObjectSize = calculateObjectSize; +exports.deserialize = deserialize; +exports.deserializeStream = deserializeStream; +exports.onDemand = onDemand; +exports.serialize = serialize; +exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; +exports.setInternalBufferSize = setInternalBufferSize; +//# sourceMappingURL=bson.cjs.map diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs.map b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs.map new file mode 100644 index 00000000..eef417f4 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.cjs","sources":["../src/parser/utils.ts","../src/constants.ts","../src/error.ts","../src/parse_utf8.ts","../src/utils/latin.ts","../src/utils/node_byte_utils.ts","../src/utils/web_byte_utils.ts","../src/utils/byte_utils.ts","../src/bson_value.ts","../src/utils/number_utils.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/utils/string_utils.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/parser/calculate_size.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/extended_json.ts","../src/parser/on_demand/parse_to_elements.ts","../src/parser/on_demand/index.ts","../src/bson.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["StringUtils.validateStringCharacters","StringUtils.removeLeadingZerosAndExplicitPlus","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","constants.BSON_VERSION_SYMBOL","constants.BSON_MAJOR_VERSION","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT"],"mappings":";;AAAA,MAAM,uCAAuC,GAAG,CAAC,MAAK;IAIpD,MAAM,CAAC,GAAG,MAAM,CAAC,wBAAwB,CACvC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAC3C,MAAM,CAAC,WAAW,CAClB,CAAC,GAAI;IAEP,OAAO,CAAC,KAAc,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1C,CAAC,G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e,KAAK,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI;IAE/E,OAAO,2BAA2B,CAAC,MAAM,EAAE,kBAAkB,EAAE,eAAe,CAAC;AACjF;AAcM,SAAU,iBAAiB,CAC/B,IAA8B,EAC9B,UAAkB,EAClB,iBAAyB,EACzB,SAAqB,EACrB,aAAqB,EACrB,OAA2B,EAAA;AAE3B,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,EAAE,gCAAgC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,EACpD,OAAO,CACR;IACD,MAAM,UAAU,GAAG,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC;IAEpD,IAAI,KAAK,GAAG,UAAU;AAEtB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC,EAAE,EAAE;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC;AAEtD,QAAA,eAAe,CAAC,KAAK,GAAG,KAAK;AAE7B,QAAA,SAAS,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,mBAAmB,CAAC,UAAU,EAAE,eAAe,CAAC;AAE/E,QAAA,KAAK,GAAG,KAAK,GAAG,IAAI;IACtB;AAGA,IAAA,OAAO,KAAK;AACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs new file mode 100644 index 00000000..3e666498 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs @@ -0,0 +1,4840 @@ +const TypedArrayPrototypeGetSymbolToStringTag = (() => { + const g = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get; + return (value) => g.call(value); +})(); +function isUint8Array(value) { + return TypedArrayPrototypeGetSymbolToStringTag(value) === 'Uint8Array'; +} +function isAnyArrayBuffer(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + (value[Symbol.toStringTag] === 'ArrayBuffer' || + value[Symbol.toStringTag] === 'SharedArrayBuffer')); +} +function isRegExp(regexp) { + return regexp instanceof RegExp || Object.prototype.toString.call(regexp) === '[object RegExp]'; +} +function isMap(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Map'); +} +function isDate(date) { + return date instanceof Date || Object.prototype.toString.call(date) === '[object Date]'; +} +function defaultInspect(x, _options) { + return JSON.stringify(x, (k, v) => { + if (typeof v === 'bigint') { + return { $numberLong: `${v}` }; + } + else if (isMap(v)) { + return Object.fromEntries(v); + } + return v; + }); +} +function getStylizeFunction(options) { + const stylizeExists = options != null && + typeof options === 'object' && + 'stylize' in options && + typeof options.stylize === 'function'; + if (stylizeExists) { + return options.stylize; + } +} + +const BSON_MAJOR_VERSION = 7; +const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version'); +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -2147483648; +const BSON_INT64_MAX = Math.pow(2, 63) - 1; +const BSON_INT64_MIN = -Math.pow(2, 63); +const JS_INT_MAX = Math.pow(2, 53); +const JS_INT_MIN = -Math.pow(2, 53); +const BSON_DATA_NUMBER = 1; +const BSON_DATA_STRING = 2; +const BSON_DATA_OBJECT = 3; +const BSON_DATA_ARRAY = 4; +const BSON_DATA_BINARY = 5; +const BSON_DATA_UNDEFINED = 6; +const BSON_DATA_OID = 7; +const BSON_DATA_BOOLEAN = 8; +const BSON_DATA_DATE = 9; +const BSON_DATA_NULL = 10; +const BSON_DATA_REGEXP = 11; +const BSON_DATA_DBPOINTER = 12; +const BSON_DATA_CODE = 13; +const BSON_DATA_SYMBOL = 14; +const BSON_DATA_CODE_W_SCOPE = 15; +const BSON_DATA_INT = 16; +const BSON_DATA_TIMESTAMP = 17; +const BSON_DATA_LONG = 18; +const BSON_DATA_DECIMAL128 = 19; +const BSON_DATA_MIN_KEY = 0xff; +const BSON_DATA_MAX_KEY = 0x7f; +const BSON_BINARY_SUBTYPE_DEFAULT = 0; +const BSON_BINARY_SUBTYPE_UUID_NEW = 4; +const BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +}); + +class BSONError extends Error { + get bsonError() { + return true; + } + get name() { + return 'BSONError'; + } + constructor(message, options) { + super(message, options); + } + static isBSONError(value) { + return (value != null && + typeof value === 'object' && + 'bsonError' in value && + value.bsonError === true && + 'name' in value && + 'message' in value && + 'stack' in value); + } +} +class BSONVersionError extends BSONError { + get name() { + return 'BSONVersionError'; + } + constructor() { + super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); + } +} +class BSONRuntimeError extends BSONError { + get name() { + return 'BSONRuntimeError'; + } + constructor(message) { + super(message); + } +} +class BSONOffsetError extends BSONError { + get name() { + return 'BSONOffsetError'; + } + offset; + constructor(message, offset, options) { + super(`${message}. offset: ${offset}`, options); + this.offset = offset; + } +} + +let TextDecoderFatal; +let TextDecoderNonFatal; +function parseUtf8(buffer, start, end, fatal) { + if (fatal) { + TextDecoderFatal ??= new TextDecoder('utf8', { fatal: true }); + try { + return TextDecoderFatal.decode(buffer.subarray(start, end)); + } + catch (cause) { + throw new BSONError('Invalid UTF-8 string in BSON document', { cause }); + } + } + TextDecoderNonFatal ??= new TextDecoder('utf8', { fatal: false }); + return TextDecoderNonFatal.decode(buffer.subarray(start, end)); +} + +function tryReadBasicLatin(uint8array, start, end) { + if (uint8array.length === 0) { + return ''; + } + const stringByteLength = end - start; + if (stringByteLength === 0) { + return ''; + } + if (stringByteLength > 20) { + return null; + } + if (stringByteLength === 1 && uint8array[start] < 128) { + return String.fromCharCode(uint8array[start]); + } + if (stringByteLength === 2 && uint8array[start] < 128 && uint8array[start + 1] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]); + } + if (stringByteLength === 3 && + uint8array[start] < 128 && + uint8array[start + 1] < 128 && + uint8array[start + 2] < 128) { + return (String.fromCharCode(uint8array[start]) + + String.fromCharCode(uint8array[start + 1]) + + String.fromCharCode(uint8array[start + 2])); + } + const latinBytes = []; + for (let i = start; i < end; i++) { + const byte = uint8array[i]; + if (byte > 127) { + return null; + } + latinBytes.push(byte); + } + return String.fromCharCode(...latinBytes); +} +function tryWriteBasicLatin(destination, source, offset) { + if (source.length === 0) + return 0; + if (source.length > 25) + return null; + if (destination.length - offset < source.length) + return null; + for (let charOffset = 0, destinationOffset = offset; charOffset < source.length; charOffset++, destinationOffset++) { + const char = source.charCodeAt(charOffset); + if (char > 127) + return null; + destination[destinationOffset] = char; + } + return source.length; +} + +function nodejsMathRandomBytes(byteLength) { + return nodeJsByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +function nodejsSecureRandomBytes(byteLength) { + return crypto.getRandomValues(nodeJsByteUtils.allocate(byteLength)); +} +const nodejsRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return nodejsSecureRandomBytes; + } + else { + return nodejsMathRandomBytes; + } +})(); +const nodeJsByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialBuffer) { + if (Buffer.isBuffer(potentialBuffer)) { + return potentialBuffer; + } + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + const stringTag = potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer); + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return Buffer.from(potentialBuffer); + } + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); + }, + allocate(size) { + return Buffer.alloc(size); + }, + allocateUnsafe(size) { + return Buffer.allocUnsafe(size); + }, + compare(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).compare(b); + }, + concat(list) { + return Buffer.concat(list); + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + return nodeJsByteUtils + .toLocalBufferType(source) + .copy(target, targetStart ?? 0, sourceStart ?? 0, sourceEnd ?? source.length); + }, + equals(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).equals(b); + }, + fromNumberArray(array) { + return Buffer.from(array); + }, + fromBase64(base64) { + return Buffer.from(base64, 'base64'); + }, + fromUTF8(utf8) { + return Buffer.from(utf8, 'utf8'); + }, + toBase64(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('base64'); + }, + fromISO88591(codePoints) { + return Buffer.from(codePoints, 'binary'); + }, + toISO88591(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('binary'); + }, + fromHex(hex) { + return Buffer.from(hex, 'hex'); + }, + toHex(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('hex'); + }, + toUTF8(buffer, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(buffer, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + const string = nodeJsByteUtils.toLocalBufferType(buffer).toString('utf8', start, end); + if (fatal) { + for (let i = 0; i < string.length; i++) { + if (string.charCodeAt(i) === 0xfffd) { + parseUtf8(buffer, start, end, true); + break; + } + } + } + return string; + }, + utf8ByteLength(input) { + return Buffer.byteLength(input, 'utf8'); + }, + encodeUTF8Into(buffer, source, byteOffset) { + const latinBytesWritten = tryWriteBasicLatin(buffer, source, byteOffset); + if (latinBytesWritten != null) { + return latinBytesWritten; + } + return nodeJsByteUtils.toLocalBufferType(buffer).write(source, byteOffset, undefined, 'utf8'); + }, + randomBytes: nodejsRandomBytes, + swap32(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).swap32(); + } +}; + +function isReactNative() { + const { navigator } = globalThis; + return typeof navigator === 'object' && navigator.product === 'ReactNative'; +} +function webMathRandomBytes(byteLength) { + if (byteLength < 0) { + throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`); + } + return webByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +const webRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return (byteLength) => { + return crypto.getRandomValues(webByteUtils.allocate(byteLength)); + }; + } + else { + if (isReactNative()) { + const { console } = globalThis; + console?.warn?.('BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.'); + } + return webMathRandomBytes; + } +})(); +const HEX_DIGIT = /(\d|[a-f])/i; +const webByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialUint8array) { + const stringTag = potentialUint8array?.[Symbol.toStringTag] ?? + Object.prototype.toString.call(potentialUint8array); + if (stringTag === 'Uint8Array') { + return potentialUint8array; + } + if (ArrayBuffer.isView(potentialUint8array)) { + return new Uint8Array(potentialUint8array.buffer.slice(potentialUint8array.byteOffset, potentialUint8array.byteOffset + potentialUint8array.byteLength)); + } + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return new Uint8Array(potentialUint8array); + } + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); + }, + allocate(size) { + if (typeof size !== 'number') { + throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`); + } + return new Uint8Array(size); + }, + allocateUnsafe(size) { + return webByteUtils.allocate(size); + }, + compare(uint8Array, otherUint8Array) { + if (uint8Array === otherUint8Array) + return 0; + const len = Math.min(uint8Array.length, otherUint8Array.length); + for (let i = 0; i < len; i++) { + if (uint8Array[i] < otherUint8Array[i]) + return -1; + if (uint8Array[i] > otherUint8Array[i]) + return 1; + } + if (uint8Array.length < otherUint8Array.length) + return -1; + if (uint8Array.length > otherUint8Array.length) + return 1; + return 0; + }, + concat(uint8Arrays) { + if (uint8Arrays.length === 0) + return webByteUtils.allocate(0); + let totalLength = 0; + for (const uint8Array of uint8Arrays) { + totalLength += uint8Array.length; + } + const result = webByteUtils.allocate(totalLength); + let offset = 0; + for (const uint8Array of uint8Arrays) { + result.set(uint8Array, offset); + offset += uint8Array.length; + } + return result; + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + if (sourceEnd !== undefined && sourceEnd < 0) { + throw new RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${sourceEnd}`); + } + sourceEnd = sourceEnd ?? source.length; + if (sourceStart !== undefined && (sourceStart < 0 || sourceStart > sourceEnd)) { + throw new RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${sourceEnd}. Received ${sourceStart}`); + } + sourceStart = sourceStart ?? 0; + if (targetStart !== undefined && targetStart < 0) { + throw new RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${targetStart}`); + } + targetStart = targetStart ?? 0; + const srcSlice = source.subarray(sourceStart, sourceEnd); + const maxLen = Math.min(srcSlice.length, target.length - targetStart); + if (maxLen <= 0) { + return 0; + } + target.set(srcSlice.subarray(0, maxLen), targetStart); + return maxLen; + }, + equals(uint8Array, otherUint8Array) { + if (uint8Array.byteLength !== otherUint8Array.byteLength) { + return false; + } + for (let i = 0; i < uint8Array.byteLength; i++) { + if (uint8Array[i] !== otherUint8Array[i]) { + return false; + } + } + return true; + }, + fromNumberArray(array) { + return Uint8Array.from(array); + }, + fromBase64(base64) { + return Uint8Array.from(atob(base64), c => c.charCodeAt(0)); + }, + fromUTF8(utf8) { + return new TextEncoder().encode(utf8); + }, + toBase64(uint8array) { + return btoa(webByteUtils.toISO88591(uint8array)); + }, + fromISO88591(codePoints) { + return Uint8Array.from(codePoints, c => c.charCodeAt(0) & 0xff); + }, + toISO88591(uint8array) { + return Array.from(Uint16Array.from(uint8array), b => String.fromCharCode(b)).join(''); + }, + fromHex(hex) { + const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1); + const buffer = []; + for (let i = 0; i < evenLengthHex.length; i += 2) { + const firstDigit = evenLengthHex[i]; + const secondDigit = evenLengthHex[i + 1]; + if (!HEX_DIGIT.test(firstDigit)) { + break; + } + if (!HEX_DIGIT.test(secondDigit)) { + break; + } + const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16); + buffer.push(hexDigit); + } + return Uint8Array.from(buffer); + }, + toHex(uint8array) { + return Array.from(uint8array, byte => byte.toString(16).padStart(2, '0')).join(''); + }, + toUTF8(uint8array, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(uint8array, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + return parseUtf8(uint8array, start, end, fatal); + }, + utf8ByteLength(input) { + return new TextEncoder().encode(input).byteLength; + }, + encodeUTF8Into(uint8array, source, byteOffset) { + const bytes = new TextEncoder().encode(source); + uint8array.set(bytes, byteOffset); + return bytes.byteLength; + }, + randomBytes: webRandomBytes, + swap32(buffer) { + if (buffer.length % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + for (let i = 0; i < buffer.length; i += 4) { + const byte0 = buffer[i]; + const byte1 = buffer[i + 1]; + const byte2 = buffer[i + 2]; + const byte3 = buffer[i + 3]; + buffer[i] = byte3; + buffer[i + 1] = byte2; + buffer[i + 2] = byte1; + buffer[i + 3] = byte0; + } + return buffer; + } +}; + +const hasGlobalBuffer = typeof Buffer === 'function' && Buffer.prototype?._isBuffer !== true; +const ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils; + +const bsonType = Symbol.for('@@mdb.bson.type'); +class BSONValue { + get [bsonType]() { + return this._bsontype; + } + get [BSON_VERSION_SYMBOL]() { + return BSON_MAJOR_VERSION; + } + [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) { + return this.inspect(depth, options, inspect); + } +} + +const FLOAT = new Float64Array(1); +const FLOAT_BYTES = new Uint8Array(FLOAT.buffer, 0, 8); +FLOAT[0] = -1; +const isBigEndian = FLOAT_BYTES[7] === 0; +const NumberUtils = { + isBigEndian, + getNonnegativeInt32LE(source, offset) { + if (source[offset + 3] > 127) { + throw new RangeError(`Size cannot be negative at offset: ${offset}`); + } + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getInt32LE(source, offset) { + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getUint32LE(source, offset) { + return (source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + }, + getUint32BE(source, offset) { + return (source[offset + 3] + + source[offset + 2] * 256 + + source[offset + 1] * 65536 + + source[offset] * 16777216); + }, + getBigInt64LE(source, offset) { + const hi = BigInt(source[offset + 4] + + source[offset + 5] * 256 + + source[offset + 6] * 65536 + + (source[offset + 7] << 24)); + const lo = BigInt(source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + return (hi << 32n) + lo; + }, + getFloat64LE: isBigEndian + ? (source, offset) => { + FLOAT_BYTES[7] = source[offset]; + FLOAT_BYTES[6] = source[offset + 1]; + FLOAT_BYTES[5] = source[offset + 2]; + FLOAT_BYTES[4] = source[offset + 3]; + FLOAT_BYTES[3] = source[offset + 4]; + FLOAT_BYTES[2] = source[offset + 5]; + FLOAT_BYTES[1] = source[offset + 6]; + FLOAT_BYTES[0] = source[offset + 7]; + return FLOAT[0]; + } + : (source, offset) => { + FLOAT_BYTES[0] = source[offset]; + FLOAT_BYTES[1] = source[offset + 1]; + FLOAT_BYTES[2] = source[offset + 2]; + FLOAT_BYTES[3] = source[offset + 3]; + FLOAT_BYTES[4] = source[offset + 4]; + FLOAT_BYTES[5] = source[offset + 5]; + FLOAT_BYTES[6] = source[offset + 6]; + FLOAT_BYTES[7] = source[offset + 7]; + return FLOAT[0]; + }, + setInt32BE(destination, offset, value) { + destination[offset + 3] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset] = value; + return 4; + }, + setInt32LE(destination, offset, value) { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; + }, + setBigInt64LE(destination, offset, value) { + const mask32bits = 0xffffffffn; + let lo = Number(value & mask32bits); + destination[offset] = lo; + lo >>= 8; + destination[offset + 1] = lo; + lo >>= 8; + destination[offset + 2] = lo; + lo >>= 8; + destination[offset + 3] = lo; + let hi = Number((value >> 32n) & mask32bits); + destination[offset + 4] = hi; + hi >>= 8; + destination[offset + 5] = hi; + hi >>= 8; + destination[offset + 6] = hi; + hi >>= 8; + destination[offset + 7] = hi; + return 8; + }, + setFloat64LE: isBigEndian + ? (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[7]; + destination[offset + 1] = FLOAT_BYTES[6]; + destination[offset + 2] = FLOAT_BYTES[5]; + destination[offset + 3] = FLOAT_BYTES[4]; + destination[offset + 4] = FLOAT_BYTES[3]; + destination[offset + 5] = FLOAT_BYTES[2]; + destination[offset + 6] = FLOAT_BYTES[1]; + destination[offset + 7] = FLOAT_BYTES[0]; + return 8; + } + : (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[0]; + destination[offset + 1] = FLOAT_BYTES[1]; + destination[offset + 2] = FLOAT_BYTES[2]; + destination[offset + 3] = FLOAT_BYTES[3]; + destination[offset + 4] = FLOAT_BYTES[4]; + destination[offset + 5] = FLOAT_BYTES[5]; + destination[offset + 6] = FLOAT_BYTES[6]; + destination[offset + 7] = FLOAT_BYTES[7]; + return 8; + } +}; + +class Binary extends BSONValue { + get _bsontype() { + return 'Binary'; + } + static BSON_BINARY_SUBTYPE_DEFAULT = 0; + static BUFFER_SIZE = 256; + static SUBTYPE_DEFAULT = 0; + static SUBTYPE_FUNCTION = 1; + static SUBTYPE_BYTE_ARRAY = 2; + static SUBTYPE_UUID_OLD = 3; + static SUBTYPE_UUID = 4; + static SUBTYPE_MD5 = 5; + static SUBTYPE_ENCRYPTED = 6; + static SUBTYPE_COLUMN = 7; + static SUBTYPE_SENSITIVE = 8; + static SUBTYPE_VECTOR = 9; + static SUBTYPE_USER_DEFINED = 128; + static VECTOR_TYPE = Object.freeze({ + Int8: 0x03, + Float32: 0x27, + PackedBit: 0x10 + }); + buffer; + sub_type; + position; + constructor(buffer, subType) { + super(); + if (!(buffer == null) && + typeof buffer === 'string' && + !ArrayBuffer.isView(buffer) && + !isAnyArrayBuffer(buffer) && + !Array.isArray(buffer)) { + throw new BSONError('Binary can only be constructed from Uint8Array or number[]'); + } + this.sub_type = (subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT) & 0xff; + if (buffer == null) { + this.buffer = ByteUtils.allocate(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + this.buffer = Array.isArray(buffer) + ? ByteUtils.fromNumberArray(buffer) + : ByteUtils.toLocalBufferType(buffer); + this.position = this.buffer.byteLength; + } + } + put(byteValue) { + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONError('only accepts single character Uint8Array or Array'); + let decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.byteLength > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + const newSpace = ByteUtils.allocate(Binary.BUFFER_SIZE + this.buffer.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + this.buffer[this.position++] = decodedByte; + } + } + write(sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + if (this.buffer.byteLength < offset + sequence.length) { + const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + throw new BSONError('input cannot be string'); + } + } + read(position, length) { + length = length && length > 0 ? length : this.position; + const end = position + length; + return this.buffer.subarray(position, end > this.position ? this.position : end); + } + value() { + return this.buffer.length === this.position + ? this.buffer + : this.buffer.subarray(0, this.position); + } + length() { + return this.position; + } + toJSON() { + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.buffer.subarray(0, this.position)); + if (encoding === 'base64') + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + if (encoding === 'utf8' || encoding === 'utf-8') + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + } + toExtendedJSON(options) { + options = options || {}; + if (this.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(this); + } + const base64String = ByteUtils.toBase64(this.buffer); + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + toUUID() { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.subarray(0, this.position)); + } + throw new BSONError(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${Binary.SUBTYPE_UUID.toString(16).padStart(2, '0')} is currently supported.`); + } + static createFromHexString(hex, subType) { + return new Binary(ByteUtils.fromHex(hex), subType); + } + static createFromBase64(base64, subType) { + return new Binary(ByteUtils.fromBase64(base64), subType); + } + static fromExtendedJSON(doc, options) { + options = options || {}; + let data; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary.base64); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = UUID.bytesFromString(doc.$uuid); + } + if (!data) { + throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + const base64Arg = inspect(base64, options); + const subTypeArg = inspect(this.sub_type, options); + return `Binary.createFromBase64(${base64Arg}, ${subTypeArg})`; + } + toInt8Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Int8) { + throw new BSONError('Binary datatype field is not Int8'); + } + validateBinaryVector(this); + return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toFloat32Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Float32) { + throw new BSONError('Binary datatype field is not Float32'); + } + validateBinaryVector(this); + const floatBytes = new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(floatBytes); + return new Float32Array(floatBytes.buffer); + } + toPackedBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + const byteCount = this.length() - 2; + const bitCount = byteCount * 8 - this.buffer[1]; + const bits = new Int8Array(bitCount); + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = (bitOffset / 8) | 0; + const byte = this.buffer[byteOffset + 2]; + const shift = 7 - (bitOffset % 8); + const bit = (byte >> shift) & 1; + bits[bitOffset] = bit; + } + return bits; + } + static fromInt8Array(array) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.Int8; + buffer[1] = 0; + const intBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + buffer.set(intBytes, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromFloat32Array(array) { + const binaryBytes = ByteUtils.allocate(array.byteLength + 2); + binaryBytes[0] = Binary.VECTOR_TYPE.Float32; + binaryBytes[1] = 0; + const floatBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + binaryBytes.set(floatBytes, 2); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(new Uint8Array(binaryBytes.buffer, 2)); + const bin = new this(binaryBytes, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromPackedBits(array, padding = 0) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.PackedBit; + buffer[1] = padding; + buffer.set(array, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromBits(bits) { + const byteLength = (bits.length + 7) >>> 3; + const bytes = new Uint8Array(byteLength + 2); + bytes[0] = Binary.VECTOR_TYPE.PackedBit; + const remainder = bits.length % 8; + bytes[1] = remainder === 0 ? 0 : 8 - remainder; + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset >>> 3; + const bit = bits[bitOffset]; + if (bit !== 0 && bit !== 1) { + throw new BSONError(`Invalid bit value at ${bitOffset}: must be 0 or 1, found ${bits[bitOffset]}`); + } + if (bit === 0) + continue; + const shift = 7 - (bitOffset % 8); + bytes[byteOffset + 2] |= bit << shift; + } + return new this(bytes, Binary.SUBTYPE_VECTOR); + } +} +function validateBinaryVector(vector) { + if (vector.sub_type !== Binary.SUBTYPE_VECTOR) + return; + const size = vector.position; + const datatype = vector.buffer[0]; + const padding = vector.buffer[1]; + if ((datatype === Binary.VECTOR_TYPE.Float32 || datatype === Binary.VECTOR_TYPE.Int8) && + padding !== 0) { + throw new BSONError('Invalid Vector: padding must be zero for int8 and float32 vectors'); + } + if (datatype === Binary.VECTOR_TYPE.Float32) { + if (size !== 0 && size - 2 !== 0 && (size - 2) % 4 !== 0) { + throw new BSONError('Invalid Vector: Float32 vector must contain a multiple of 4 bytes'); + } + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding !== 0 && size === 2) { + throw new BSONError('Invalid Vector: padding must be zero for packed bit vectors that are empty'); + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding > 7) { + throw new BSONError(`Invalid Vector: padding must be a value between 0 and 7. found: ${padding}`); + } +} +const UUID_BYTE_LENGTH = 16; +const UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i; +const UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i; +class UUID extends Binary { + constructor(input) { + let bytes; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer)); + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ByteUtils.toLocalBufferType(input); + } + else if (typeof input === 'string') { + bytes = UUID.bytesFromString(input); + } + else { + throw new BSONError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + } + get id() { + return this.buffer; + } + set id(value) { + this.buffer = value; + } + toHexString(includeDashes = true) { + if (includeDashes) { + return [ + ByteUtils.toHex(this.buffer.subarray(0, 4)), + ByteUtils.toHex(this.buffer.subarray(4, 6)), + ByteUtils.toHex(this.buffer.subarray(6, 8)), + ByteUtils.toHex(this.buffer.subarray(8, 10)), + ByteUtils.toHex(this.buffer.subarray(10, 16)) + ].join('-'); + } + return ByteUtils.toHex(this.buffer); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.id); + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + equals(otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return ByteUtils.equals(otherId.id, this.id); + } + try { + return ByteUtils.equals(new UUID(otherId).id, this.id); + } + catch { + return false; + } + } + toBinary() { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + static generate() { + const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH); + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return bytes; + } + static isValid(input) { + if (!input) { + return false; + } + if (typeof input === 'string') { + return UUID.isValidUUIDString(input); + } + if (isUint8Array(input)) { + return input.byteLength === UUID_BYTE_LENGTH; + } + return (input._bsontype === 'Binary' && + input.sub_type === this.SUBTYPE_UUID && + input.buffer.byteLength === 16); + } + static createFromHexString(hexString) { + const buffer = UUID.bytesFromString(hexString); + return new UUID(buffer); + } + static createFromBase64(base64) { + return new UUID(ByteUtils.fromBase64(base64)); + } + static bytesFromString(representation) { + if (!UUID.isValidUUIDString(representation)) { + throw new BSONError('UUID string representation must be 32 hex digits or canonical hyphenated representation'); + } + return ByteUtils.fromHex(representation.replace(/-/g, '')); + } + static isValidUUIDString(representation) { + return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new UUID(${inspect(this.toHexString(), options)})`; + } +} + +class Code extends BSONValue { + get _bsontype() { + return 'Code'; + } + code; + scope; + constructor(code, scope) { + super(); + this.code = code.toString(); + this.scope = scope ?? null; + } + toJSON() { + if (this.scope != null) { + return { code: this.code, scope: this.scope }; + } + return { code: this.code }; + } + toExtendedJSON() { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + } + static fromExtendedJSON(doc) { + return new Code(doc.$code, doc.$scope); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + let parametersString = inspect(this.code, options); + const multiLineFn = parametersString.includes('\n'); + if (this.scope != null) { + parametersString += `,${multiLineFn ? '\n' : ' '}${inspect(this.scope, options)}`; + } + const endingNewline = multiLineFn && this.scope === null; + return `new Code(${multiLineFn ? '\n' : ''}${parametersString}${endingNewline ? '\n' : ''})`; + } +} + +function isDBRefLike(value) { + return (value != null && + typeof value === 'object' && + '$id' in value && + value.$id != null && + '$ref' in value && + typeof value.$ref === 'string' && + (!('$db' in value) || ('$db' in value && typeof value.$db === 'string'))); +} +class DBRef extends BSONValue { + get _bsontype() { + return 'DBRef'; + } + collection; + oid; + db; + fields; + constructor(collection, oid, db, fields) { + super(); + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + get namespace() { + return this.collection; + } + set namespace(value) { + this.collection = value; + } + toJSON() { + const o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + } + toExtendedJSON(options) { + options = options || {}; + let o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + static fromExtendedJSON(doc) { + const copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const args = [ + inspect(this.namespace, options), + inspect(this.oid, options), + ...(this.db ? [inspect(this.db, options)] : []), + ...(Object.keys(this.fields).length > 0 ? [inspect(this.fields, options)] : []) + ]; + args[1] = inspect === defaultInspect ? `new ObjectId(${args[1]})` : args[1]; + return `new DBRef(${args.join(', ')})`; + } +} + +function removeLeadingZerosAndExplicitPlus(str) { + if (str === '') { + return str; + } + let startIndex = 0; + const isNegative = str[startIndex] === '-'; + const isExplicitlyPositive = str[startIndex] === '+'; + if (isExplicitlyPositive || isNegative) { + startIndex += 1; + } + let foundInsignificantZero = false; + for (; startIndex < str.length && str[startIndex] === '0'; ++startIndex) { + foundInsignificantZero = true; + } + if (!foundInsignificantZero) { + return isExplicitlyPositive ? str.slice(1) : str; + } + return `${isNegative ? '-' : ''}${str.length === startIndex ? '0' : str.slice(startIndex)}`; +} +function validateStringCharacters(str, radix) { + radix = radix ?? 10; + const validCharacters = '0123456789abcdefghijklmnopqrstuvwxyz'.slice(0, radix); + const regex = new RegExp(`[^-+${validCharacters}]`, 'i'); + return regex.test(str) ? false : str; +} + +let wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch { +} +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +const INT_CACHE = {}; +const UINT_CACHE = {}; +const MAX_INT64_STRING_LENGTH = 20; +const DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/; +class Long extends BSONValue { + get _bsontype() { + return 'Long'; + } + get __isLong__() { + return true; + } + high; + low; + unsigned; + constructor(lowOrValue = 0, highOrUnsigned, unsigned) { + super(); + const unsignedBool = typeof highOrUnsigned === 'boolean' ? highOrUnsigned : Boolean(unsigned); + const high = typeof highOrUnsigned === 'number' ? highOrUnsigned : 0; + const res = typeof lowOrValue === 'string' + ? Long.fromString(lowOrValue, unsignedBool) + : typeof lowOrValue === 'bigint' + ? Long.fromBigInt(lowOrValue, unsignedBool) + : { low: lowOrValue | 0, high: high | 0, unsigned: unsignedBool }; + this.low = res.low; + this.high = res.high; + this.unsigned = res.unsigned; + } + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + static ZERO = Long.fromInt(0); + static UZERO = Long.fromInt(0, true); + static ONE = Long.fromInt(1); + static UONE = Long.fromInt(1, true); + static NEG_ONE = Long.fromInt(-1); + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + static fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + static fromInt(value, unsigned) { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + static fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + static fromBigInt(value, unsigned) { + const FROM_BIGINT_BIT_MASK = 0xffffffffn; + const FROM_BIGINT_BIT_SHIFT = 32n; + return new Long(Number(value & FROM_BIGINT_BIT_MASK), Number((value >> FROM_BIGINT_BIT_SHIFT) & FROM_BIGINT_BIT_MASK), unsigned); + } + static _fromString(str, unsigned, radix) { + if (str.length === 0) + throw new BSONError('empty string'); + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + let p; + if ((p = str.indexOf('-')) > 0) + throw new BSONError('interior hyphen'); + else if (p === 0) { + return Long._fromString(str.substring(1), unsigned, radix).neg(); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + static fromStringStrict(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str.trim() !== str) { + throw new BSONError(`Input: '${str}' contains leading and/or trailing whitespace`); + } + if (!validateStringCharacters(str, radix)) { + throw new BSONError(`Input: '${str}' contains invalid characters for radix: ${radix}`); + } + const cleanedStr = removeLeadingZerosAndExplicitPlus(str); + const result = Long._fromString(cleanedStr, unsigned, radix); + if (result.toString(radix).toLowerCase() !== cleanedStr.toLowerCase()) { + throw new BSONError(`Input: ${str} is not representable as ${result.unsigned ? 'an unsigned' : 'a signed'} 64-bit Long ${radix != null ? `with radix: ${radix}` : ''}`); + } + return result; + } + static fromString(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str === 'NaN' && radix < 24) { + return Long.ZERO; + } + else if ((str === 'Infinity' || str === '+Infinity' || str === '-Infinity') && radix < 35) { + return Long.ZERO; + } + return Long._fromString(str, unsigned, radix); + } + static fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + static fromBytesLE(bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + } + static fromBytesBE(bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + } + static isLong(value) { + return (value != null && + typeof value === 'object' && + '__isLong__' in value && + value.__isLong__ === true); + } + static fromValue(val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + } + add(addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + and(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + compare(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + const thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + comp(other) { + return this.compare(other); + } + divide(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw new BSONError('division by zero'); + if (wasm) { + if (!this.unsigned && + this.high === -2147483648 && + divisor.low === -1 && + divisor.high === -1) { + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + return Long.UONE; + res = Long.UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + div(divisor) { + return this.divide(divisor); + } + equals(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + eq(other) { + return this.equals(other); + } + getHighBits() { + return this.high; + } + getHighBitsUnsigned() { + return this.high >>> 0; + } + getLowBits() { + return this.low; + } + getLowBitsUnsigned() { + return this.low >>> 0; + } + getNumBitsAbs() { + if (this.isNegative()) { + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + greaterThan(other) { + return this.comp(other) > 0; + } + gt(other) { + return this.greaterThan(other); + } + greaterThanOrEqual(other) { + return this.comp(other) >= 0; + } + gte(other) { + return this.greaterThanOrEqual(other); + } + ge(other) { + return this.greaterThanOrEqual(other); + } + isEven() { + return (this.low & 1) === 0; + } + isNegative() { + return !this.unsigned && this.high < 0; + } + isOdd() { + return (this.low & 1) === 1; + } + isPositive() { + return this.unsigned || this.high >= 0; + } + isZero() { + return this.high === 0 && this.low === 0; + } + lessThan(other) { + return this.comp(other) < 0; + } + lt(other) { + return this.lessThan(other); + } + lessThanOrEqual(other) { + return this.comp(other) <= 0; + } + lte(other) { + return this.lessThanOrEqual(other); + } + modulo(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + } + mod(divisor) { + return this.modulo(divisor); + } + rem(divisor) { + return this.modulo(divisor); + } + multiply(multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + mul(multiplier) { + return this.multiply(multiplier); + } + negate() { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + neg() { + return this.negate(); + } + not() { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + notEquals(other) { + return !this.equals(other); + } + neq(other) { + return this.notEquals(other); + } + ne(other) { + return this.notEquals(other); + } + or(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + shiftLeft(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + shl(numBits) { + return this.shiftLeft(numBits); + } + shiftRight(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + shr(numBits) { + return this.shiftRight(numBits); + } + shiftRightUnsigned(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + shr_u(numBits) { + return this.shiftRightUnsigned(numBits); + } + shru(numBits) { + return this.shiftRightUnsigned(numBits); + } + subtract(subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + sub(subtrahend) { + return this.subtract(subtrahend); + } + toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + } + toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + toBigInt() { + return BigInt(this.toString()); + } + toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + } + toBytesLE() { + const hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + toBytesBE() { + const hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + toSigned() { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + } + toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + if (this.eq(Long.MIN_VALUE)) { + const radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + let rem = this; + let result = ''; + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + } + toUnsigned() { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + } + xor(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + eqz() { + return this.isZero(); + } + le(other) { + return this.lessThanOrEqual(other); + } + toExtendedJSON(options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc, options) { + const { useBigInt64 = false, relaxed = true } = { ...options }; + if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) { + throw new BSONError('$numberLong string is too long'); + } + if (!DECIMAL_REG_EX.test(doc.$numberLong)) { + throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`); + } + if (useBigInt64) { + const bigIntResult = BigInt(doc.$numberLong); + return BigInt.asIntN(64, bigIntResult); + } + const longResult = Long.fromString(doc.$numberLong); + if (relaxed) { + return longResult.toNumber(); + } + return longResult; + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const longVal = inspect(this.toString(), options); + const unsignedVal = this.unsigned ? `, ${inspect(this.unsigned, options)}` : ''; + return `new Long(${longVal}${unsignedVal})`; + } +} + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; +const NAN_BUFFER = ByteUtils.fromNumberArray([ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray([ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray([ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; +const COMBINATION_MASK = 0x1f; +const EXPONENT_MASK = 0x3fff; +const COMBINATION_INFINITY = 30; +const COMBINATION_NAN = 31; +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +function divideu128(value) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (let i = 0; i <= 3; i++) { + _rem = _rem.shiftLeft(32); + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message}`); +} +class Decimal128 extends BSONValue { + get _bsontype() { + return 'Decimal128'; + } + bytes; + constructor(bytes) { + super(); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (bytes instanceof Uint8Array || isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONError('Decimal128 must take a Buffer or string'); + } + } + static fromString(representation) { + return Decimal128._fromString(representation, { allowRounding: false }); + } + static fromStringWithRounding(representation) { + return Decimal128._fromString(representation, { allowRounding: true }); + } + static _fromString(representation, options) { + let isNegative = false; + let sawSign = false; + let sawRadix = false; + let foundNonZero = false; + let significantDigits = 0; + let nDigitsRead = 0; + let nDigits = 0; + let radixPosition = 0; + let firstNonZero = 0; + const digits = [0]; + let nDigitsStored = 0; + let digitsInsert = 0; + let lastDigit = 0; + let exponent = 0; + let significandHigh = new Long(0, 0); + let significandLow = new Long(0, 0); + let biasedExponent = 0; + let index = 0; + if (representation.length >= 7000) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + const unsignedNumber = stringMatch[2]; + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + if (representation[index] === '+' || representation[index] === '-') { + sawSign = true; + isNegative = representation[index++] === '-'; + } + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + else if (representation[index] === 'N') { + return new Decimal128(NAN_BUFFER); + } + } + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < MAX_DIGITS) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + if (representation[index] === 'e' || representation[index] === 'E') { + const match = representation.substr(++index).match(EXPONENT_REGEX); + if (!match || !match[2]) + return new Decimal128(NAN_BUFFER); + exponent = parseInt(match[0], 10); + index = index + match[0].length; + } + if (representation[index]) + return new Decimal128(NAN_BUFFER); + if (!nDigitsStored) { + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (representation[firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix)] === '0') { + significantDigits = significantDigits - 1; + } + } + } + if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + while (exponent > EXPONENT_MAX) { + lastDigit = lastDigit + 1; + if (lastDigit >= MAX_DIGITS) { + if (significantDigits === 0) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + if (options.allowRounding) { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + nDigits = nDigits - 1; + } + else { + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (let i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + let dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + } + } + else { + break; + } + } + } + } + } + else { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0) { + if (significantDigits === 0) { + exponent = EXPONENT_MIN; + break; + } + invalidErr(representation, 'exponent underflow'); + } + if (nDigitsStored < nDigits) { + if (representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== '0' && + significantDigits !== 0) { + invalidErr(representation, 'inexact rounding'); + } + nDigits = nDigits - 1; + } + else { + if (digits[lastDigit] !== 0) { + invalidErr(representation, 'inexact rounding'); + } + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + if (sawRadix) { + firstNonZero = firstNonZero + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + if (roundDigit !== 0) { + invalidErr(representation, 'inexact rounding'); + } + } + } + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit < 17) { + let dIdx = 0; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + let dIdx = 0; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + const buffer = ByteUtils.allocateUnsafe(16); + index = 0; + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + return new Decimal128(buffer); + } + toString() { + let biased_exponent; + let significand_digits = 0; + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) + significand[i] = 0; + let index = 0; + let is_zero = false; + let significand_msb; + let significand128 = { parts: [0, 0, 0, 0] }; + let j, k; + const string = []; + index = 0; + const buffer = this.bytes; + const low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + index = 0; + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + const combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + const exponent = biased_exponent - EXPONENT_BIAS; + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + significand[k * 9 + j] = least_digits % 10; + least_digits = Math.floor(least_digits / 10); + } + } + } + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + const scientific_exponent = significand_digits - 1 + exponent; + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) + string.push(`E+${exponent}`); + else if (exponent < 0) + string.push(`E${exponent}`); + return string.join(''); + } + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + string.push('E'); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } + else { + string.push(`${scientific_exponent}`); + } + } + else { + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } + else { + let radix_position = significand_digits + exponent; + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } + else { + string.push('0'); + } + string.push('.'); + while (radix_position++ < 0) { + string.push('0'); + } + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + return string.join(''); + } + toJSON() { + return { $numberDecimal: this.toString() }; + } + toExtendedJSON() { + return { $numberDecimal: this.toString() }; + } + static fromExtendedJSON(doc) { + return Decimal128.fromString(doc.$numberDecimal); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const d128string = inspect(this.toString(), options); + return `new Decimal128(${d128string})`; + } +} + +class Double extends BSONValue { + get _bsontype() { + return 'Double'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + static fromString(value) { + const coercedValue = Number(value); + if (value === 'NaN') + return new Double(NaN); + if (value === 'Infinity') + return new Double(Infinity); + if (value === '-Infinity') + return new Double(-Infinity); + if (!Number.isFinite(coercedValue)) { + throw new BSONError(`Input: ${value} is not representable as a Double`); + } + if (value.trim() !== value) { + throw new BSONError(`Input: '${value}' contains whitespace`); + } + if (value === '') { + throw new BSONError(`Input is an empty string`); + } + if (/[^-0-9.+eE]/.test(value)) { + throw new BSONError(`Input: '${value}' is not in decimal or exponential notation`); + } + return new Double(coercedValue); + } + valueOf() { + return this.value; + } + toJSON() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toExtendedJSON(options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: '-0.0' }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + static fromExtendedJSON(doc, options) { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Double(${inspect(this.value, options)})`; + } +} + +class Int32 extends BSONValue { + get _bsontype() { + return 'Int32'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + static fromString(value) { + const cleanedValue = removeLeadingZerosAndExplicitPlus(value); + const coercedValue = Number(value); + if (BSON_INT32_MAX < coercedValue) { + throw new BSONError(`Input: '${value}' is larger than the maximum value for Int32`); + } + else if (BSON_INT32_MIN > coercedValue) { + throw new BSONError(`Input: '${value}' is smaller than the minimum value for Int32`); + } + else if (!Number.isSafeInteger(coercedValue)) { + throw new BSONError(`Input: '${value}' is not a safe integer`); + } + else if (coercedValue.toString() !== cleanedValue) { + throw new BSONError(`Input: '${value}' is not a valid Int32 string`); + } + return new Int32(coercedValue); + } + valueOf() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toJSON() { + return this.value; + } + toExtendedJSON(options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + } + static fromExtendedJSON(doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Int32(${inspect(this.value, options)})`; + } +} + +class MaxKey extends BSONValue { + get _bsontype() { + return 'MaxKey'; + } + toExtendedJSON() { + return { $maxKey: 1 }; + } + static fromExtendedJSON() { + return new MaxKey(); + } + inspect() { + return 'new MaxKey()'; + } +} + +class MinKey extends BSONValue { + get _bsontype() { + return 'MinKey'; + } + toExtendedJSON() { + return { $minKey: 1 }; + } + static fromExtendedJSON() { + return new MinKey(); + } + inspect() { + return 'new MinKey()'; + } +} + +const __idCache = new WeakMap(); +const byteToHex = []; +for (let n = 0; n < 256; n++) + byteToHex.push(n.toString(16).padStart(2, '0')); +const hexCharCodeToNibble = new Int8Array(103); +for (let c = 48; c <= 57; c++) + hexCharCodeToNibble[c] = c - 48; +for (let c = 65; c <= 70; c++) + hexCharCodeToNibble[c] = c - 55; +for (let c = 97; c <= 102; c++) + hexCharCodeToNibble[c] = c - 87; +class ObjectId extends BSONValue { + get _bsontype() { + return 'ObjectId'; + } + static index = 0; + static PROCESS_UNIQUE = null; + static resetState = () => { + this.index = Math.floor(Math.random() * 0x1000000); + this.PROCESS_UNIQUE = null; + }; + static { + this.resetState(); + const { startupSnapshot } = globalThis?.process?.getBuiltinModule?.('v8') ?? {}; + if (startupSnapshot?.isBuildingSnapshot?.()) { + startupSnapshot?.addDeserializeCallback?.(this.resetState); + } + } + static cacheHexString; + i0; + i1; + i2; + i3; + setFromBytes(b, offset = 0) { + this.i0 = (b[offset] << 16) | (b[offset + 1] << 8) | b[offset + 2]; + this.i1 = (b[offset + 3] << 16) | (b[offset + 4] << 8) | b[offset + 5]; + this.i2 = (b[offset + 6] << 16) | (b[offset + 7] << 8) | b[offset + 8]; + this.i3 = (b[offset + 9] << 16) | (b[offset + 10] << 8) | b[offset + 11]; + } + setFromHex(s) { + const t = hexCharCodeToNibble; + this.i0 = + (t[s.charCodeAt(0)] << 20) | + (t[s.charCodeAt(1)] << 16) | + (t[s.charCodeAt(2)] << 12) | + (t[s.charCodeAt(3)] << 8) | + (t[s.charCodeAt(4)] << 4) | + t[s.charCodeAt(5)]; + this.i1 = + (t[s.charCodeAt(6)] << 20) | + (t[s.charCodeAt(7)] << 16) | + (t[s.charCodeAt(8)] << 12) | + (t[s.charCodeAt(9)] << 8) | + (t[s.charCodeAt(10)] << 4) | + t[s.charCodeAt(11)]; + this.i2 = + (t[s.charCodeAt(12)] << 20) | + (t[s.charCodeAt(13)] << 16) | + (t[s.charCodeAt(14)] << 12) | + (t[s.charCodeAt(15)] << 8) | + (t[s.charCodeAt(16)] << 4) | + t[s.charCodeAt(17)]; + this.i3 = + (t[s.charCodeAt(18)] << 20) | + (t[s.charCodeAt(19)] << 16) | + (t[s.charCodeAt(20)] << 12) | + (t[s.charCodeAt(21)] << 8) | + (t[s.charCodeAt(22)] << 4) | + t[s.charCodeAt(23)]; + } + constructor(inputId, offset) { + super(); + if (typeof offset === 'number') { + this.setFromBytes(inputId, offset); + return; + } + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (ObjectId.is(inputId) && + typeof inputId.i0 === 'number' && + typeof inputId.i1 === 'number' && + typeof inputId.i2 === 'number' && + typeof inputId.i3 === 'number') { + this.i0 = inputId.i0; + this.i1 = inputId.i1; + this.i2 = inputId.i2; + this.i3 = inputId.i3; + return; + } + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = ByteUtils.fromHex(inputId.toHexString()); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + if (workingId == null) { + const time = Math.floor(Date.now() / 1000); + const inc = ObjectId.getInc(); + const pu = (ObjectId.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + this.i0 = (time >>> 8) & 0xffffff; + this.i1 = ((time & 0xff) << 16) | (pu[0] << 8) | pu[1]; + this.i2 = (pu[2] << 16) | (pu[3] << 8) | pu[4]; + this.i3 = inc & 0xffffff; + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + this.setFromBytes(workingId instanceof Uint8Array ? workingId : ByteUtils.toLocalBufferType(workingId)); + } + else if (typeof workingId === 'string') { + if (ObjectId.validateHexString(workingId)) { + this.setFromHex(workingId); + if (ObjectId.cacheHexString) { + __idCache.set(this, workingId); + } + } + else { + throw new BSONError('input must be a 24 character hex string, 12 byte Uint8Array, or an integer'); + } + } + else { + throw new BSONError('Argument passed in does not match the accepted types'); + } + } + get id() { + const b = ByteUtils.allocateUnsafe(12); + b[0] = (this.i0 >>> 16) & 0xff; + b[1] = (this.i0 >>> 8) & 0xff; + b[2] = this.i0 & 0xff; + b[3] = (this.i1 >>> 16) & 0xff; + b[4] = (this.i1 >>> 8) & 0xff; + b[5] = this.i1 & 0xff; + b[6] = (this.i2 >>> 16) & 0xff; + b[7] = (this.i2 >>> 8) & 0xff; + b[8] = this.i2 & 0xff; + b[9] = (this.i3 >>> 16) & 0xff; + b[10] = (this.i3 >>> 8) & 0xff; + b[11] = this.i3 & 0xff; + return b; + } + set id(value) { + const bytes = value instanceof Uint8Array ? value : ByteUtils.toLocalBufferType(value); + this.setFromBytes(bytes); + if (ObjectId.cacheHexString) { + __idCache.set(this, ByteUtils.toHex(bytes)); + } + } + static validateHexString(string) { + if (string?.length !== 24) + return false; + for (let i = 0; i < 24; i++) { + const char = string.charCodeAt(i); + if ((char >= 48 && char <= 57) || + (char >= 97 && char <= 102) || + (char >= 65 && char <= 70)) { + continue; + } + return false; + } + return true; + } + toHexString() { + if (ObjectId.cacheHexString) { + const __id = __idCache.get(this); + if (__id) + return __id; + } + const i0 = this.i0; + const i1 = this.i1; + const i2 = this.i2; + const i3 = this.i3; + const hexString = byteToHex[(i0 >>> 16) & 0xff] + + byteToHex[(i0 >>> 8) & 0xff] + + byteToHex[i0 & 0xff] + + byteToHex[(i1 >>> 16) & 0xff] + + byteToHex[(i1 >>> 8) & 0xff] + + byteToHex[i1 & 0xff] + + byteToHex[(i2 >>> 16) & 0xff] + + byteToHex[(i2 >>> 8) & 0xff] + + byteToHex[i2 & 0xff] + + byteToHex[(i3 >>> 16) & 0xff] + + byteToHex[(i3 >>> 8) & 0xff] + + byteToHex[i3 & 0xff]; + if (ObjectId.cacheHexString) { + __idCache.set(this, hexString); + } + return hexString; + } + static getInc() { + return (ObjectId.index = (ObjectId.index + 1) % 0x1000000); + } + static generate(time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + const inc = ObjectId.getInc(); + const buffer = ByteUtils.allocateUnsafe(12); + NumberUtils.setInt32BE(buffer, 0, time); + const PROCESS_UNIQUE = (this.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + buffer[11] = inc & 0xff; + buffer[10] = (inc >>> 8) & 0xff; + buffer[9] = (inc >>> 16) & 0xff; + return buffer; + } + toString(encoding) { + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + if (encoding === 'hex') + return this.toHexString(); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + static is(variable) { + return (variable != null && + typeof variable === 'object' && + '_bsontype' in variable && + variable._bsontype === 'ObjectId'); + } + equals(otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (ObjectId.is(otherId) && + typeof otherId.i0 === 'number' && + typeof otherId.i1 === 'number' && + typeof otherId.i2 === 'number' && + typeof otherId.i3 === 'number') { + return (this.i3 === otherId.i3 && + this.i0 === otherId.i0 && + this.i1 === otherId.i1 && + this.i2 === otherId.i2); + } + if (typeof otherId === 'string') { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'object' && typeof otherId.toHexString === 'function') { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + } + getTimestamp() { + const timestamp = new Date(); + const time = this.i0 * 0x100 + (this.i1 >>> 16); + timestamp.setTime(time * 1000); + return timestamp; + } + static createPk() { + return new ObjectId(); + } + serializeInto(uint8array, index) { + uint8array[index] = (this.i0 >>> 16) & 0xff; + uint8array[index + 1] = (this.i0 >>> 8) & 0xff; + uint8array[index + 2] = this.i0 & 0xff; + uint8array[index + 3] = (this.i1 >>> 16) & 0xff; + uint8array[index + 4] = (this.i1 >>> 8) & 0xff; + uint8array[index + 5] = this.i1 & 0xff; + uint8array[index + 6] = (this.i2 >>> 16) & 0xff; + uint8array[index + 7] = (this.i2 >>> 8) & 0xff; + uint8array[index + 8] = this.i2 & 0xff; + uint8array[index + 9] = (this.i3 >>> 16) & 0xff; + uint8array[index + 10] = (this.i3 >>> 8) & 0xff; + uint8array[index + 11] = this.i3 & 0xff; + return 12; + } + static createFromTime(time) { + const buffer = ByteUtils.allocate(12); + for (let i = 11; i >= 4; i--) + buffer[i] = 0; + NumberUtils.setInt32BE(buffer, 0, time); + return new ObjectId(buffer); + } + static createFromHexString(hexString) { + if (hexString?.length !== 24) { + throw new BSONError('hex string must be 24 characters'); + } + return new ObjectId(ByteUtils.fromHex(hexString)); + } + static createFromBase64(base64) { + if (base64?.length !== 16) { + throw new BSONError('base64 string must be 16 characters'); + } + return new ObjectId(ByteUtils.fromBase64(base64)); + } + static isValid(id) { + if (id == null) + return false; + if (typeof id === 'string') + return ObjectId.validateHexString(id); + try { + new ObjectId(id); + return true; + } + catch { + return false; + } + } + toExtendedJSON() { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + static fromExtendedJSON(doc) { + return new ObjectId(doc.$oid); + } + isCached() { + return ObjectId.cacheHexString && __idCache.has(this); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new ObjectId(${inspect(this.toHexString(), options)})`; + } +} + +function internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined) { + const objectStack = [ + { object, ignoreUndefined: ignoreUndefined ?? false, exit: false } + ]; + const path = new Set(); + let total = 0; + while (objectStack.length > 0) { + const frame = objectStack.pop(); + if (frame.exit) { + path.delete(frame.object); + continue; + } + const { object: obj, ignoreUndefined: frameIgnoreUndefined } = frame; + path.add(obj); + frame.exit = true; + objectStack.push(frame); + total += 5; + const isObjArray = Array.isArray(obj); + const isObjMap = !isObjArray && (obj instanceof Map || isMap(obj)); + let target = obj; + if (!isObjArray && !isObjMap && typeof obj?.toBSON === 'function') { + target = obj.toBSON(); + } + if (isObjArray) { + const array = target; + for (let i = 0; i < array.length; i++) { + total += calculateElementSize(i.toString(), array[i], serializeFunctions, true, frameIgnoreUndefined, objectStack, path); + } + } + else if (isObjMap) { + for (const [key, value] of target) { + total += calculateElementSize(key, value, serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + else { + for (const key of Object.keys(target)) { + total += calculateElementSize(key, target[key], serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + } + return total; +} +function calculateElementSize(name, value, serializeFunctions = false, isArray = false, ignoreUndefined = false, objectStack, path) { + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return ByteUtils.utf8ByteLength(name) + 1 + 1; + return 0; + case 'boolean': + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 1); + case 'object': + if (value != null && + typeof value._bsontype === 'string' && + value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (value == null || value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') { + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value._bsontype === 'ObjectId') { + return ByteUtils.utf8ByteLength(name) + 1 + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 4 + 1) + value.byteLength; + } + else if (value._bsontype === 'Long' || + value._bsontype === 'Double' || + value._bsontype === 'Timestamp') { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (value._bsontype === 'Decimal128') { + return ByteUtils.utf8ByteLength(name) + 1 + (16 + 1); + } + else if (value._bsontype === 'Int32') { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else if (value._bsontype === 'Code') { + if (value.scope != null && Object.keys(value.scope).length > 0) { + if (path.has(value.scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value.scope, ignoreUndefined, exit: false }); + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + else { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + } + else if (value._bsontype === 'Binary') { + const binary = value; + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1 + 4); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1); + } + } + else if (value._bsontype === 'BSONSymbol') { + return (ByteUtils.utf8ByteLength(name) + 1 + ByteUtils.utf8ByteLength(value.value) + 4 + 1 + 1); + } + else if (value._bsontype === 'DBRef') { + const ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + if (value.db != null) { + ordered_values['$db'] = value.db; + } + objectStack.push({ object: ordered_values, ignoreUndefined: true, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value instanceof RegExp || isRegExp(value)) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.source) + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value._bsontype === 'BSONRegExp') { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.pattern) + + 1 + + ByteUtils.utf8ByteLength(value.options) + + 1); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value, ignoreUndefined, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + case 'function': + if (serializeFunctions) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.toString()) + + 1); + } + return 0; + case 'bigint': + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + case 'symbol': + return 0; + default: + throw new BSONError(`Unrecognized JS type: ${typeof value}`); + } +} + +function alphabetize(str) { + return str.split('').sort().join(''); +} +class BSONRegExp extends BSONValue { + get _bsontype() { + return 'BSONRegExp'; + } + pattern; + options; + constructor(pattern, options) { + super(); + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`); + } + for (let i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + static parseOptions(options) { + return options ? options.split('').sort().join('') : ''; + } + toExtendedJSON(options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + static fromExtendedJSON(doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } + inspect(depth, options, inspect) { + const stylize = getStylizeFunction(options) ?? (v => v); + inspect ??= defaultInspect; + const pattern = stylize(inspect(this.pattern), 'regexp'); + const flags = stylize(inspect(this.options), 'regexp'); + return `new BSONRegExp(${pattern}, ${flags})`; + } +} + +class BSONSymbol extends BSONValue { + get _bsontype() { + return 'BSONSymbol'; + } + value; + constructor(value) { + super(); + this.value = value; + } + valueOf() { + return this.value; + } + toString() { + return this.value; + } + toJSON() { + return this.value; + } + toExtendedJSON() { + return { $symbol: this.value }; + } + static fromExtendedJSON(doc) { + return new BSONSymbol(doc.$symbol); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new BSONSymbol(${inspect(this.value, options)})`; + } +} + +const LongWithoutOverridesClass = Long; +class Timestamp extends LongWithoutOverridesClass { + get _bsontype() { + return 'Timestamp'; + } + get [bsonType]() { + return 'Timestamp'; + } + static MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + get i() { + return this.low >>> 0; + } + get t() { + return this.high >>> 0; + } + constructor(low) { + if (low == null) { + super(0, 0, true); + } + else if (typeof low === 'bigint') { + super(low, true); + } + else if (Long.isLong(low)) { + super(low.low, low.high, true); + } + else if (typeof low === 'object' && 't' in low && 'i' in low) { + if (typeof low.t !== 'number' && (typeof low.t !== 'object' || low.t._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide t as a number'); + } + if (typeof low.i !== 'number' && (typeof low.i !== 'object' || low.i._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide i as a number'); + } + const t = Number(low.t); + const i = Number(low.i); + if (t < 0 || Number.isNaN(t)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive t'); + } + if (i < 0 || Number.isNaN(i)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive i'); + } + if (t > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide t equal or less than uint32 max'); + } + if (i > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide i equal or less than uint32 max'); + } + super(i, t, true); + } + else { + throw new BSONError('A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }'); + } + } + toJSON() { + return { + $timestamp: this.toString() + }; + } + static fromInt(value) { + return new Timestamp(Long.fromInt(value, true)); + } + static fromNumber(value) { + return new Timestamp(Long.fromNumber(value, true)); + } + static fromBits(lowBits, highBits) { + return new Timestamp({ i: lowBits, t: highBits }); + } + static fromString(str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + toExtendedJSON() { + return { $timestamp: { t: this.t, i: this.i } }; + } + static fromExtendedJSON(doc) { + const i = Long.isLong(doc.$timestamp.i) + ? doc.$timestamp.i.getLowBitsUnsigned() + : doc.$timestamp.i; + const t = Long.isLong(doc.$timestamp.t) + ? doc.$timestamp.t.getLowBitsUnsigned() + : doc.$timestamp.t; + return new Timestamp({ t, i }); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const t = inspect(this.t, options); + const i = inspect(this.i, options); + return `new Timestamp({ t: ${t}, i: ${i} })`; + } +} + +const JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +function internalDeserialize(buffer, options, isArray) { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + const size = NumberUtils.getInt32LE(buffer, index); + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + if (size + index > buffer.byteLength) { + throw new BSONError(`(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})`); + } + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + return deserializeObject(buffer, index, options, isArray); +} +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function assignValue(dest, name, value) { + if (name === '__proto__') { + Object.defineProperty(dest, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + dest[name] = value; + } +} +function toPotentialDbRef(doc) { + if (isDBRefLike(doc)) { + const { $ref, $id, $db, ...fields } = doc; + return new DBRef($ref, $id, $db, fields); + } + return doc; +} +function deserializeObject(buffer, index, options, isArray = false) { + options = { ...options }; + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + const raw = options['raw'] == null ? false : options['raw']; + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + const promoteBuffers = options.promoteBuffers ?? false; + const promoteLongs = options.promoteLongs ?? true; + const promoteValues = options.promoteValues ?? true; + const useBigInt64 = options.useBigInt64 ?? false; + if (useBigInt64 && !promoteValues) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + if (useBigInt64 && !promoteLongs) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + const validation = options.validation == null ? { utf8: true } : options.validation; + let globalUTFValidation = true; + let validationSetting; + let utf8KeysSet; + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + if (!globalUTFValidation) { + utf8KeysSet = new Set(); + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + const startIndex = index; + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + const size = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + const rootObject = isArray ? [] : {}; + let arrayIndex = 0; + let isPossibleDBRef = isArray ? false : null; + let currentFrame = null; + let currentDest = rootObject; + let currentIsArray = isArray; + while (true) { + const elementType = buffer[index++]; + if (elementType === 0) { + if (currentFrame) { + if (index === currentFrame.lastIndex) { + const completedFrame = currentFrame; + currentFrame = completedFrame.prev; + if (currentFrame === null) { + currentDest = rootObject; + currentIsArray = isArray; + } + else { + currentDest = currentFrame.holdingDocument; + currentIsArray = currentFrame.isArray; + } + let result = completedFrame.holdingDocument; + switch (completedFrame.elementType) { + case BSON_DATA_OBJECT: + if (completedFrame.isPossibleDBRef) { + result = toPotentialDbRef(result); + } + break; + case BSON_DATA_ARRAY: + break; + case BSON_DATA_CODE_W_SCOPE: + result = new Code(completedFrame.functionString, completedFrame.holdingDocument); + break; + default: + throw new BSONError('Unexpected element type in frame stack'); + } + assignValue(currentDest, completedFrame.propertyName, result); + continue; + } + else { + if (currentFrame.elementType === BSON_DATA_ARRAY) { + throw new BSONError('corrupted array bson'); + } + throw new BSONError('Bad BSON Document: object not properly terminated'); + } + } + else { + break; + } + } + let i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + const name = currentIsArray + ? currentFrame !== null + ? currentFrame.arrayIndex++ + : arrayIndex++ + : ByteUtils.toUTF8(buffer, index, i, false); + let shouldValidateKey; + if (currentFrame !== null) { + shouldValidateKey = currentFrame.validationSetting; + } + else if (globalUTFValidation || utf8KeysSet?.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (currentFrame !== null) { + if (currentFrame.isPossibleDBRef !== false && typeof name === 'string' && name[0] === '$') { + currentFrame.isPossibleDBRef = allowedDBRefKeys.test(name); + } + } + else if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + let value; + let isDeferredValue = false; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + value = new ObjectId(buffer, index); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(NumberUtils.getInt32LE(buffer, index)); + index += 4; + } + else if (elementType === BSON_DATA_INT) { + value = NumberUtils.getInt32LE(buffer, index); + index += 4; + } + else if (elementType === BSON_DATA_NUMBER) { + value = NumberUtils.getFloat64LE(buffer, index); + index += 8; + if (promoteValues === false) + value = new Double(value); + } + else if (elementType === BSON_DATA_DATE) { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + if (raw || (currentFrame?.raw ?? false)) { + value = buffer.subarray(index, index + objectSize); + index = index + objectSize; + } + else { + isDeferredValue = true; + const objectFrame = { + holdingDocument: {}, + elementType: BSON_DATA_OBJECT, + propertyName: name, + functionString: null, + lastIndex: index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = objectFrame; + currentDest = objectFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + } + else if (elementType === BSON_DATA_ARRAY) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded array length in bson'); + const stopIndex = index + objectSize; + const arrayRaw = !!(fieldsAsRaw && fieldsAsRaw[name]) || (currentFrame?.raw ?? false); + isDeferredValue = true; + const arrayFrame = { + holdingDocument: [], + elementType: BSON_DATA_ARRAY, + propertyName: name, + functionString: null, + lastIndex: stopIndex, + isArray: true, + arrayIndex: 0, + raw: arrayRaw, + isPossibleDBRef: false, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = arrayFrame; + currentDest = arrayFrame.holdingDocument; + currentIsArray = true; + index = index + 4; + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + if (useBigInt64) { + value = NumberUtils.getBigInt64LE(buffer, index); + index += 8; + } + else { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + const long = new Long(lowBits, highBits); + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + const bytes = ByteUtils.allocateUnsafe(16); + for (let i = 0; i < 16; i++) + bytes[i] = buffer[index + i]; + index = index + 16; + value = new Decimal128(bytes); + } + else if (elementType === BSON_DATA_BINARY) { + let binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + const totalBinarySize = binarySize; + const subType = buffer[index++]; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = ByteUtils.toLocalBufferType(buffer.subarray(index, index + binarySize)); + } + else { + value = new Binary(buffer.subarray(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) { + value = value.toUUID(); + } + } + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + const optionsArray = new Array(regExpOptions.length); + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const symbol = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + value = new Timestamp({ + i: NumberUtils.getUint32LE(buffer, index), + t: NumberUtils.getUint32LE(buffer, index + 4) + }); + index += 8; + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = new Code(functionString); + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + const totalSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad scope document size in code_w_scope'); + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + isDeferredValue = true; + const scopeFrame = { + holdingDocument: {}, + elementType: BSON_DATA_CODE_W_SCOPE, + propertyName: name, + functionString: functionString, + lastIndex: _index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = scopeFrame; + currentDest = scopeFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + else if (elementType === BSON_DATA_DBPOINTER) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + const namespace = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const oidBuffer = ByteUtils.allocateUnsafe(12); + for (let i = 0; i < 12; i++) + oidBuffer[i] = buffer[index + i]; + const oid = new ObjectId(oidBuffer); + index = index + 12; + value = new DBRef(namespace, oid); + } + else { + throw new BSONError(`Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"`); + } + if (!isDeferredValue) { + assignValue(currentDest, name, value); + } + } + if (currentFrame !== null) { + throw new BSONError('corrupted bson, more objects expected based on the current document size'); + } + const object = rootObject; + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + if (!isPossibleDBRef) + return object; + return toPotentialDbRef(object); +} + +const regexp = /\x00/; +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +function serializeString(buffer, key, value, index) { + buffer[index++] = BSON_DATA_STRING; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value, index + 4); + NumberUtils.setInt32LE(buffer, index, size + 1); + index = index + 4 + size; + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index) { + const isNegativeZero = Object.is(value, -0); + const type = !isNegativeZero && + Number.isSafeInteger(value) && + value <= BSON_INT32_MAX && + value >= BSON_INT32_MIN + ? BSON_DATA_INT + : BSON_DATA_NUMBER; + buffer[index++] = type; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0x00; + if (type === BSON_DATA_INT) { + index += NumberUtils.setInt32LE(buffer, index, value); + } + else { + index += NumberUtils.setFloat64LE(buffer, index, value); + } + return index; +} +function serializeBigInt(buffer, key, value, index) { + buffer[index++] = BSON_DATA_LONG; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index += numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setBigInt64LE(buffer, index, value); + return index; +} +function serializeNull(buffer, key, _, index) { + buffer[index++] = BSON_DATA_NULL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BOOLEAN; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DATE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw new BSONError('value ' + value.source + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.source, index); + buffer[index++] = 0x00; + if (value.ignoreCase) + buffer[index++] = 0x69; + if (value.global) + buffer[index++] = 0x73; + if (value.multiline) + buffer[index++] = 0x6d; + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.pattern.match(regexp) != null) { + throw new BSONError('pattern ' + value.pattern + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.pattern, index); + buffer[index++] = 0x00; + const sortedOptions = value.options.split('').sort().join(''); + index = index + ByteUtils.encodeUTF8Into(buffer, sortedOptions, index); + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index) { + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value[bsonType] === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index) { + buffer[index++] = BSON_DATA_OID; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += value.serializeInto(buffer, index); + return index; +} +function serializeBuffer(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = value.length; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = value[i]; + } + else { + buffer.set(value, index); + } + index = index + size; + return index; +} +function serializeDecimal128(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DECIMAL128; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + for (let i = 0; i < 16; i++) + buffer[index + i] = value.bytes[i]; + return index + 16; +} +function serializeLong(buffer, key, value, index) { + buffer[index++] = + value[bsonType] === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeInt32(buffer, key, value, index) { + value = value.valueOf(); + buffer[index++] = BSON_DATA_INT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setInt32LE(buffer, index, value); + return index; +} +function serializeDouble(buffer, key, value, index) { + buffer[index++] = BSON_DATA_NUMBER; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setFloat64LE(buffer, index, value.value); + return index; +} +function serializeFunction(buffer, key, value, index) { + buffer[index++] = BSON_DATA_CODE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const functionString = value.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function serializeBinary(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const data = value.buffer; + let size = value.position; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = value.sub_type; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + index += NumberUtils.setInt32LE(buffer, index, size); + } + if (value.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(value); + } + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = data[i]; + } + else { + buffer.set(data, index); + } + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index) { + buffer[index++] = BSON_DATA_SYMBOL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value.value, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function makeFrame(sourceObject, objectSizeIndex, codeSizeIndex, prev, checkKeys, ignoreUndefined) { + if (Array.isArray(sourceObject)) { + return { + sourceObject, + isArray: true, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; + } + if (sourceObject instanceof Map || isMap(sourceObject)) { + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: sourceObject.entries(), + prev, + checkKeys, + ignoreUndefined + }; + } + let target = sourceObject; + if (typeof target?.toBSON === 'function') { + target = target.toBSON(); + if (target != null && typeof target !== 'object') { + throw new BSONError('toBSON function did not return an object'); + } + } + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: target, + keys: Object.keys(target), + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; +} +function serializeInto(buffer, object, checkKeys, startingIndex, serializeFunctions, ignoreUndefined, path) { + if (path == null) { + if (object == null) { + buffer[0] = 0x05; + buffer[1] = 0x00; + buffer[2] = 0x00; + buffer[3] = 0x00; + buffer[4] = 0x00; + return 5; + } + if (Array.isArray(object)) { + throw new BSONError('serialize does not support an array as the root input'); + } + if (typeof object !== 'object') { + throw new BSONError('serialize does not support non-object as the root input'); + } + else if ('_bsontype' in object && typeof object._bsontype === 'string') { + throw new BSONError(`BSON types cannot be serialized as a document`); + } + else if (isDate(object) || + isRegExp(object) || + isUint8Array(object) || + isAnyArrayBuffer(object)) { + throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`); + } + path = new Set(); + } + path.add(object); + let currentFrame = makeFrame(object, startingIndex, null, null, checkKeys, ignoreUndefined); + let index = startingIndex + 4; + while (currentFrame !== null) { + const frame = currentFrame; + let key; + let value; + if (frame.mapIterator !== null) { + const next = frame.mapIterator.next(); + if (next.done) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = next.value[0]; + value = next.value[1]; + } + else if (frame.keys !== null) { + if (frame.keyIndex >= frame.keys.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = frame.keys[frame.keyIndex++]; + value = frame.iterTarget[key]; + } + else { + const arr = frame.iterTarget; + if (frame.keyIndex >= arr.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + const i = frame.keyIndex++; + key = String(i); + value = arr[i]; + } + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + if (!frame.isArray && typeof key === 'string' && !(key[0] === '$' && ignoreKeys.has(key))) { + if (regexp.test(key)) { + throw new BSONError('key ' + key + ' must not contain null bytes'); + } + if (frame.checkKeys) { + if ('$' === key[0]) { + throw new BSONError('key ' + key + " must not start with '$'"); + } + else if (key.includes('.')) { + throw new BSONError('key ' + key + " must not contain '.'"); + } + } + } + const type = typeof value; + if (value === undefined) { + if (frame.isArray || frame.ignoreUndefined === false) { + index = serializeNull(buffer, key, value, index); + } + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + index = serializeBigInt(buffer, key, value, index); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (type === 'object' && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + const nestedIsArray = Array.isArray(value); + buffer[index++] = nestedIsArray ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const nestedStartIndex = index; + path.add(value); + currentFrame = makeFrame(value, nestedStartIndex, null, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + } + else if (type === 'object') { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + const tag = value[bsonType]; + if (tag === 'ObjectId') { + index = serializeObjectId(buffer, key, value, index); + } + else if (tag === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (tag === 'Long' || tag === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (tag === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (tag === 'Code') { + const codeValue = value; + if (codeValue.scope && typeof codeValue.scope === 'object') { + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const codeTotalSizeIndex = index; + index += 4; + const functionString = codeValue.code; + const codeSize = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, codeSize); + buffer[index + 4 + codeSize - 1] = 0; + index = index + codeSize + 4; + const scope = codeValue.scope; + if (path.has(scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + path.add(scope); + currentFrame = makeFrame(scope, index, codeTotalSizeIndex, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + else { + buffer[index++] = BSON_DATA_CODE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const functionString = codeValue.code.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + } + } + else if (tag === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (tag === 'BSONSymbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (tag === 'DBRef') { + const dbref = value; + const orderedValues = Object.assign({ $ref: dbref.collection, $id: dbref.oid }, dbref.db != null ? { $db: dbref.db } : null, dbref.fields); + buffer[index++] = BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + path.add(orderedValues); + currentFrame = makeFrame(orderedValues, index, null, frame, false, true); + index += 4; + } + else if (tag === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (tag === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (tag === 'MinKey' || tag === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value._bsontype !== 'undefined') { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } + else if (type === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index); + } + } + return index; +} + +function isBSONType(value) { + return (value != null && + typeof value === 'object' && + '_bsontype' in value && + typeof value._bsontype === 'string'); +} +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +function deserializeValue(value, options = {}) { + if (typeof value === 'number') { + const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN; + const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN; + if (options.relaxed || options.legacy) { + return value; + } + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (in32BitRange) { + return new Int32(value); + } + if (in64BitRange) { + if (options.useBigInt64) { + return BigInt(value); + } + return Long.fromNumber(value); + } + } + return new Double(value); + } + if (value == null || typeof value !== 'object') + return value; + if (value.$undefined) + return null; + const keys = Object.keys(value).filter(k => k.startsWith('$') && value[k] != null); + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + return date; + } + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + if (v instanceof DBRef) + return v; + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid = false; + }); + if (valid) + return DBRef.fromExtendedJSON(v); + } + return value; +} +function serializeArray(array, options) { + return array.map((v, index) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + const isoStr = date.toISOString(); + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +function serializeValue(value, options) { + if (value instanceof Map || isMap(value)) { + const obj = Object.create(null); + for (const [k, v] of value) { + if (typeof k !== 'string') { + throw new BSONError('Can only serialize maps with string keys'); + } + obj[k] = v; + } + return serializeValue(obj, options); + } + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONError('Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/`); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return options.ignoreUndefined ? undefined : null; + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), inRange = dateNum > -1 && dateNum < 253402300800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return { $numberInt: value.toString() }; + } + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) { + return { $numberLong: value.toString() }; + } + } + return { $numberDouble: Object.is(value, -0) ? '-0.0' : value.toString() }; + } + if (typeof value === 'bigint') { + if (!options.relaxed) { + return { $numberLong: BigInt.asIntN(64, value).toString() }; + } + return Number(BigInt.asIntN(64, value)); + } + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +const BSON_TYPE_MAPPINGS = { + Binary: (o) => new Binary(o.value(), o.sub_type), + Code: (o) => new Code(o.code, o.scope), + DBRef: (o) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), + Decimal128: (o) => new Decimal128(o.bytes), + Double: (o) => new Double(o.value), + Int32: (o) => new Int32(o.value), + Long: (o) => Long.fromBits(o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectId: (o) => new ObjectId(o), + BSONRegExp: (o) => new BSONRegExp(o.pattern, o.options), + BSONSymbol: (o) => new BSONSymbol(o.value), + Timestamp: (o) => Timestamp.fromBits(o.low, o.high) +}; +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + const bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + const _doc = {}; + for (const name of Object.keys(doc)) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (doc != null && + typeof doc === 'object' && + typeof doc._bsontype === 'string' && + doc[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (isBSONType(doc)) { + let outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +function parse(text, options) { + const ejsonOptions = { + useBigInt64: options?.useBigInt64 ?? false, + relaxed: options?.relaxed ?? true, + legacy: options?.legacy ?? false + }; + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}`); + } + return deserializeValue(value, ejsonOptions); + }); +} +function stringify(value, replacerOrOptions, spaceOrOptions, options) { + if (spaceOrOptions != null && typeof spaceOrOptions === 'object') { + options = spaceOrOptions; + spaceOrOptions = undefined; + } + if (replacerOrOptions != null && + typeof replacerOrOptions === 'object' && + !Array.isArray(replacerOrOptions)) { + options = replacerOrOptions; + replacerOrOptions = undefined; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacerOrOptions, spaceOrOptions); +} +function EJSONserialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); +} +function EJSONdeserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); +} +const EJSON = Object.create(null); +EJSON.parse = parse; +EJSON.stringify = stringify; +EJSON.serialize = EJSONserialize; +EJSON.deserialize = EJSONdeserialize; +Object.freeze(EJSON); + +const BSONElementType = { + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: 255, + maxKey: 127 +}; +function getSize(source, offset) { + try { + return NumberUtils.getNonnegativeInt32LE(source, offset); + } + catch (cause) { + throw new BSONOffsetError('BSON size cannot be negative', offset, { cause }); + } +} +function findNull(bytes, offset) { + let nullTerminatorOffset = offset; + for (; bytes[nullTerminatorOffset] !== 0x00; nullTerminatorOffset++) + ; + if (nullTerminatorOffset === bytes.length - 1) { + throw new BSONOffsetError('Null terminator not found', offset); + } + return nullTerminatorOffset; +} +function parseToElements(bytes, startOffset = 0) { + startOffset ??= 0; + if (bytes.length < 5) { + throw new BSONOffsetError(`Input must be at least 5 bytes, got ${bytes.length} bytes`, startOffset); + } + const documentSize = getSize(bytes, startOffset); + if (documentSize > bytes.length - startOffset) { + throw new BSONOffsetError(`Parsed documentSize (${documentSize} bytes) does not match input length (${bytes.length} bytes)`, startOffset); + } + if (bytes[startOffset + documentSize - 1] !== 0x00) { + throw new BSONOffsetError('BSON documents must end in 0x00', startOffset + documentSize); + } + const elements = []; + let offset = startOffset + 4; + while (offset <= documentSize + startOffset) { + const type = bytes[offset]; + offset += 1; + if (type === 0) { + if (offset - startOffset !== documentSize) { + throw new BSONOffsetError(`Invalid 0x00 type byte`, offset); + } + break; + } + const nameOffset = offset; + const nameLength = findNull(bytes, offset) - nameOffset; + offset += nameLength + 1; + let length; + if (type === BSONElementType.double || + type === BSONElementType.long || + type === BSONElementType.date || + type === BSONElementType.timestamp) { + length = 8; + } + else if (type === BSONElementType.int) { + length = 4; + } + else if (type === BSONElementType.objectId) { + length = 12; + } + else if (type === BSONElementType.decimal) { + length = 16; + } + else if (type === BSONElementType.bool) { + length = 1; + } + else if (type === BSONElementType.null || + type === BSONElementType.undefined || + type === BSONElementType.maxKey || + type === BSONElementType.minKey) { + length = 0; + } + else if (type === BSONElementType.regex) { + length = findNull(bytes, findNull(bytes, offset) + 1) + 1 - offset; + } + else if (type === BSONElementType.object || + type === BSONElementType.array || + type === BSONElementType.javascriptWithScope) { + length = getSize(bytes, offset); + } + else if (type === BSONElementType.string || + type === BSONElementType.binData || + type === BSONElementType.dbPointer || + type === BSONElementType.javascript || + type === BSONElementType.symbol) { + length = getSize(bytes, offset) + 4; + if (type === BSONElementType.binData) { + length += 1; + } + if (type === BSONElementType.dbPointer) { + length += 12; + } + } + else { + throw new BSONOffsetError(`Invalid 0x${type.toString(16).padStart(2, '0')} type byte`, offset); + } + if (length > documentSize) { + throw new BSONOffsetError('value reports length larger than document', offset); + } + elements.push([type, nameOffset, nameLength, offset, length]); + offset += length; + } + return elements; +} + +const onDemand = Object.create(null); +onDemand.parseToElements = parseToElements; +onDemand.ByteUtils = ByteUtils; +onDemand.NumberUtils = NumberUtils; +Object.freeze(onDemand); + +const MAXSIZE = 1024 * 1024 * 17; +let buffer = ByteUtils.allocate(MAXSIZE); +function setInternalBufferSize(size) { + if (buffer.length < size) { + buffer = ByteUtils.allocate(size); + } +} +function serialize(object, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + if (buffer.length < minInternalBufferSize) { + buffer = ByteUtils.allocate(minInternalBufferSize); + } + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + const finishedBuffer = ByteUtils.allocateUnsafe(serializationIndex); + finishedBuffer.set(buffer.subarray(0, serializationIndex), 0); + return finishedBuffer; +} +function serializeWithBufferAndIndex(object, finalBuffer, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex); + return startIndex + serializationIndex - 1; +} +function deserialize(buffer, options = {}) { + return internalDeserialize(ByteUtils.toLocalBufferType(buffer), options); +} +function calculateObjectSize(object, options = {}) { + options = options || {}; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + const internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + const bufferData = ByteUtils.toLocalBufferType(data); + let index = startIndex; + for (let i = 0; i < numberOfDocuments; i++) { + const size = NumberUtils.getInt32LE(bufferData, index); + internalOptions.index = index; + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + index = index + size; + } + return index; +} + +var bson = /*#__PURE__*/Object.freeze({ + __proto__: null, + BSONError: BSONError, + BSONOffsetError: BSONOffsetError, + BSONRegExp: BSONRegExp, + BSONRuntimeError: BSONRuntimeError, + BSONSymbol: BSONSymbol, + BSONType: BSONType, + BSONValue: BSONValue, + BSONVersionError: BSONVersionError, + Binary: Binary, + ByteUtils: ByteUtils, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + EJSON: EJSON, + Int32: Int32, + Long: Long, + MaxKey: MaxKey, + MinKey: MinKey, + NumberUtils: NumberUtils, + ObjectId: ObjectId, + Timestamp: Timestamp, + UUID: UUID, + bsonType: bsonType, + calculateObjectSize: calculateObjectSize, + deserialize: deserialize, + deserializeStream: deserializeStream, + onDemand: onDemand, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + setInternalBufferSize: setInternalBufferSize +}); + +export { bson as BSON, BSONError, BSONOffsetError, BSONRegExp, BSONRuntimeError, BSONSymbol, BSONType, BSONValue, BSONVersionError, Binary, ByteUtils, Code, DBRef, Decimal128, Double, EJSON, Int32, Long, MaxKey, MinKey, NumberUtils, ObjectId, Timestamp, UUID, bsonType, calculateObjectSize, deserialize, deserializeStream, onDemand, serialize, serializeWithBufferAndIndex, setInternalBufferSize }; +//# sourceMappingURL=bson.mjs.map diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs.map b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs.map new file mode 100644 index 00000000..99da7f6f --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.mjs","sources":["../src/parser/utils.ts","../src/constants.ts","../src/error.ts","../src/parse_utf8.ts","../src/utils/latin.ts","../src/utils/node_byte_utils.ts","../src/utils/web_byte_utils.ts","../src/utils/byte_utils.ts","../src/bson_value.ts","../src/utils/number_utils.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/utils/string_utils.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/parser/calculate_size.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/extended_json.ts","../src/parser/on_demand/parse_to_elements.ts","../src/parser/on_demand/index.ts","../src/bson.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["StringUtils.validateStringCharacters","StringUtils.removeLeadingZerosAndExplicitPlus","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","constants.BSON_VERSION_SYMBOL","constants.BSON_MAJOR_VERSION","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT"],"mappings":"AAAA,MAAM,uCAAuC,GAAG,CAAC,MAAK;IAIpD,MAAM,CAAC,GAAG,MAAM,CAAC,wBAAwB,CACvC,MAAM,CAAC,cAAc,CAAC,UA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M,kBAAkB,GACtB,OAAO,OAAO,CAAC,kBAAkB,KAAK,SAAS,GAAG,OAAO,CAAC,kBAAkB,GAAG,KAAK;AACtF,IAAA,MAAM,eAAe,GACnB,OAAO,OAAO,CAAC,eAAe,KAAK,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI;IAE/E,OAAO,2BAA2B,CAAC,MAAM,EAAE,kBAAkB,EAAE,eAAe,CAAC;AACjF;AAcM,SAAU,iBAAiB,CAC/B,IAA8B,EAC9B,UAAkB,EAClB,iBAAyB,EACzB,SAAqB,EACrB,aAAqB,EACrB,OAA2B,EAAA;AAE3B,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,EAAE,gCAAgC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,EACpD,OAAO,CACR;IACD,MAAM,UAAU,GAAG,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC;IAEpD,IAAI,KAAK,GAAG,UAAU;AAEtB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC,EAAE,EAAE;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC;AAEtD,QAAA,eAAe,CAAC,KAAK,GAAG,KAAK;AAE7B,QAAA,SAAS,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,mBAAmB,CAAC,UAAU,EAAE,eAAe,CAAC;AAE/E,QAAA,KAAK,GAAG,KAAK,GAAG,IAAI;IACtB;AAGA,IAAA,OAAO,KAAK;AACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs new file mode 100644 index 00000000..02893af9 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs @@ -0,0 +1,4840 @@ +const TypedArrayPrototypeGetSymbolToStringTag = (() => { + const g = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get; + return (value) => g.call(value); +})(); +function isUint8Array(value) { + return TypedArrayPrototypeGetSymbolToStringTag(value) === 'Uint8Array'; +} +function isAnyArrayBuffer(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + (value[Symbol.toStringTag] === 'ArrayBuffer' || + value[Symbol.toStringTag] === 'SharedArrayBuffer')); +} +function isRegExp(regexp) { + return regexp instanceof RegExp || Object.prototype.toString.call(regexp) === '[object RegExp]'; +} +function isMap(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Map'); +} +function isDate(date) { + return date instanceof Date || Object.prototype.toString.call(date) === '[object Date]'; +} +function defaultInspect(x, _options) { + return JSON.stringify(x, (k, v) => { + if (typeof v === 'bigint') { + return { $numberLong: `${v}` }; + } + else if (isMap(v)) { + return Object.fromEntries(v); + } + return v; + }); +} +function getStylizeFunction(options) { + const stylizeExists = options != null && + typeof options === 'object' && + 'stylize' in options && + typeof options.stylize === 'function'; + if (stylizeExists) { + return options.stylize; + } +} + +const BSON_MAJOR_VERSION = 7; +const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version'); +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -2147483648; +const BSON_INT64_MAX = Math.pow(2, 63) - 1; +const BSON_INT64_MIN = -Math.pow(2, 63); +const JS_INT_MAX = Math.pow(2, 53); +const JS_INT_MIN = -Math.pow(2, 53); +const BSON_DATA_NUMBER = 1; +const BSON_DATA_STRING = 2; +const BSON_DATA_OBJECT = 3; +const BSON_DATA_ARRAY = 4; +const BSON_DATA_BINARY = 5; +const BSON_DATA_UNDEFINED = 6; +const BSON_DATA_OID = 7; +const BSON_DATA_BOOLEAN = 8; +const BSON_DATA_DATE = 9; +const BSON_DATA_NULL = 10; +const BSON_DATA_REGEXP = 11; +const BSON_DATA_DBPOINTER = 12; +const BSON_DATA_CODE = 13; +const BSON_DATA_SYMBOL = 14; +const BSON_DATA_CODE_W_SCOPE = 15; +const BSON_DATA_INT = 16; +const BSON_DATA_TIMESTAMP = 17; +const BSON_DATA_LONG = 18; +const BSON_DATA_DECIMAL128 = 19; +const BSON_DATA_MIN_KEY = 0xff; +const BSON_DATA_MAX_KEY = 0x7f; +const BSON_BINARY_SUBTYPE_DEFAULT = 0; +const BSON_BINARY_SUBTYPE_UUID_NEW = 4; +const BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +}); + +class BSONError extends Error { + get bsonError() { + return true; + } + get name() { + return 'BSONError'; + } + constructor(message, options) { + super(message, options); + } + static isBSONError(value) { + return (value != null && + typeof value === 'object' && + 'bsonError' in value && + value.bsonError === true && + 'name' in value && + 'message' in value && + 'stack' in value); + } +} +class BSONVersionError extends BSONError { + get name() { + return 'BSONVersionError'; + } + constructor() { + super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); + } +} +class BSONRuntimeError extends BSONError { + get name() { + return 'BSONRuntimeError'; + } + constructor(message) { + super(message); + } +} +class BSONOffsetError extends BSONError { + get name() { + return 'BSONOffsetError'; + } + offset; + constructor(message, offset, options) { + super(`${message}. offset: ${offset}`, options); + this.offset = offset; + } +} + +let TextDecoderFatal; +let TextDecoderNonFatal; +function parseUtf8(buffer, start, end, fatal) { + if (fatal) { + TextDecoderFatal ??= new TextDecoder('utf8', { fatal: true }); + try { + return TextDecoderFatal.decode(buffer.subarray(start, end)); + } + catch (cause) { + throw new BSONError('Invalid UTF-8 string in BSON document', { cause }); + } + } + TextDecoderNonFatal ??= new TextDecoder('utf8', { fatal: false }); + return TextDecoderNonFatal.decode(buffer.subarray(start, end)); +} + +function tryReadBasicLatin(uint8array, start, end) { + if (uint8array.length === 0) { + return ''; + } + const stringByteLength = end - start; + if (stringByteLength === 0) { + return ''; + } + if (stringByteLength > 20) { + return null; + } + if (stringByteLength === 1 && uint8array[start] < 128) { + return String.fromCharCode(uint8array[start]); + } + if (stringByteLength === 2 && uint8array[start] < 128 && uint8array[start + 1] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]); + } + if (stringByteLength === 3 && + uint8array[start] < 128 && + uint8array[start + 1] < 128 && + uint8array[start + 2] < 128) { + return (String.fromCharCode(uint8array[start]) + + String.fromCharCode(uint8array[start + 1]) + + String.fromCharCode(uint8array[start + 2])); + } + const latinBytes = []; + for (let i = start; i < end; i++) { + const byte = uint8array[i]; + if (byte > 127) { + return null; + } + latinBytes.push(byte); + } + return String.fromCharCode(...latinBytes); +} +function tryWriteBasicLatin(destination, source, offset) { + if (source.length === 0) + return 0; + if (source.length > 25) + return null; + if (destination.length - offset < source.length) + return null; + for (let charOffset = 0, destinationOffset = offset; charOffset < source.length; charOffset++, destinationOffset++) { + const char = source.charCodeAt(charOffset); + if (char > 127) + return null; + destination[destinationOffset] = char; + } + return source.length; +} + +function nodejsMathRandomBytes(byteLength) { + return nodeJsByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +function nodejsSecureRandomBytes(byteLength) { + return crypto.getRandomValues(nodeJsByteUtils.allocate(byteLength)); +} +const nodejsRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return nodejsSecureRandomBytes; + } + else { + return nodejsMathRandomBytes; + } +})(); +const nodeJsByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialBuffer) { + if (Buffer.isBuffer(potentialBuffer)) { + return potentialBuffer; + } + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + const stringTag = potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer); + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return Buffer.from(potentialBuffer); + } + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); + }, + allocate(size) { + return Buffer.alloc(size); + }, + allocateUnsafe(size) { + return Buffer.allocUnsafe(size); + }, + compare(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).compare(b); + }, + concat(list) { + return Buffer.concat(list); + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + return nodeJsByteUtils + .toLocalBufferType(source) + .copy(target, targetStart ?? 0, sourceStart ?? 0, sourceEnd ?? source.length); + }, + equals(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).equals(b); + }, + fromNumberArray(array) { + return Buffer.from(array); + }, + fromBase64(base64) { + return Buffer.from(base64, 'base64'); + }, + fromUTF8(utf8) { + return Buffer.from(utf8, 'utf8'); + }, + toBase64(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('base64'); + }, + fromISO88591(codePoints) { + return Buffer.from(codePoints, 'binary'); + }, + toISO88591(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('binary'); + }, + fromHex(hex) { + return Buffer.from(hex, 'hex'); + }, + toHex(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('hex'); + }, + toUTF8(buffer, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(buffer, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + const string = nodeJsByteUtils.toLocalBufferType(buffer).toString('utf8', start, end); + if (fatal) { + for (let i = 0; i < string.length; i++) { + if (string.charCodeAt(i) === 0xfffd) { + parseUtf8(buffer, start, end, true); + break; + } + } + } + return string; + }, + utf8ByteLength(input) { + return Buffer.byteLength(input, 'utf8'); + }, + encodeUTF8Into(buffer, source, byteOffset) { + const latinBytesWritten = tryWriteBasicLatin(buffer, source, byteOffset); + if (latinBytesWritten != null) { + return latinBytesWritten; + } + return nodeJsByteUtils.toLocalBufferType(buffer).write(source, byteOffset, undefined, 'utf8'); + }, + randomBytes: nodejsRandomBytes, + swap32(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).swap32(); + } +}; + +function isReactNative() { + const { navigator } = globalThis; + return typeof navigator === 'object' && navigator.product === 'ReactNative'; +} +function webMathRandomBytes(byteLength) { + if (byteLength < 0) { + throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`); + } + return webByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +const webRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return (byteLength) => { + return crypto.getRandomValues(webByteUtils.allocate(byteLength)); + }; + } + else { + if (isReactNative()) { + const { console } = globalThis; + console?.warn?.('BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.'); + } + return webMathRandomBytes; + } +})(); +const HEX_DIGIT = /(\d|[a-f])/i; +const webByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialUint8array) { + const stringTag = potentialUint8array?.[Symbol.toStringTag] ?? + Object.prototype.toString.call(potentialUint8array); + if (stringTag === 'Uint8Array') { + return potentialUint8array; + } + if (ArrayBuffer.isView(potentialUint8array)) { + return new Uint8Array(potentialUint8array.buffer.slice(potentialUint8array.byteOffset, potentialUint8array.byteOffset + potentialUint8array.byteLength)); + } + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return new Uint8Array(potentialUint8array); + } + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); + }, + allocate(size) { + if (typeof size !== 'number') { + throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`); + } + return new Uint8Array(size); + }, + allocateUnsafe(size) { + return webByteUtils.allocate(size); + }, + compare(uint8Array, otherUint8Array) { + if (uint8Array === otherUint8Array) + return 0; + const len = Math.min(uint8Array.length, otherUint8Array.length); + for (let i = 0; i < len; i++) { + if (uint8Array[i] < otherUint8Array[i]) + return -1; + if (uint8Array[i] > otherUint8Array[i]) + return 1; + } + if (uint8Array.length < otherUint8Array.length) + return -1; + if (uint8Array.length > otherUint8Array.length) + return 1; + return 0; + }, + concat(uint8Arrays) { + if (uint8Arrays.length === 0) + return webByteUtils.allocate(0); + let totalLength = 0; + for (const uint8Array of uint8Arrays) { + totalLength += uint8Array.length; + } + const result = webByteUtils.allocate(totalLength); + let offset = 0; + for (const uint8Array of uint8Arrays) { + result.set(uint8Array, offset); + offset += uint8Array.length; + } + return result; + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + if (sourceEnd !== undefined && sourceEnd < 0) { + throw new RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${sourceEnd}`); + } + sourceEnd = sourceEnd ?? source.length; + if (sourceStart !== undefined && (sourceStart < 0 || sourceStart > sourceEnd)) { + throw new RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${sourceEnd}. Received ${sourceStart}`); + } + sourceStart = sourceStart ?? 0; + if (targetStart !== undefined && targetStart < 0) { + throw new RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${targetStart}`); + } + targetStart = targetStart ?? 0; + const srcSlice = source.subarray(sourceStart, sourceEnd); + const maxLen = Math.min(srcSlice.length, target.length - targetStart); + if (maxLen <= 0) { + return 0; + } + target.set(srcSlice.subarray(0, maxLen), targetStart); + return maxLen; + }, + equals(uint8Array, otherUint8Array) { + if (uint8Array.byteLength !== otherUint8Array.byteLength) { + return false; + } + for (let i = 0; i < uint8Array.byteLength; i++) { + if (uint8Array[i] !== otherUint8Array[i]) { + return false; + } + } + return true; + }, + fromNumberArray(array) { + return Uint8Array.from(array); + }, + fromBase64(base64) { + return Uint8Array.from(atob(base64), c => c.charCodeAt(0)); + }, + fromUTF8(utf8) { + return new TextEncoder().encode(utf8); + }, + toBase64(uint8array) { + return btoa(webByteUtils.toISO88591(uint8array)); + }, + fromISO88591(codePoints) { + return Uint8Array.from(codePoints, c => c.charCodeAt(0) & 0xff); + }, + toISO88591(uint8array) { + return Array.from(Uint16Array.from(uint8array), b => String.fromCharCode(b)).join(''); + }, + fromHex(hex) { + const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1); + const buffer = []; + for (let i = 0; i < evenLengthHex.length; i += 2) { + const firstDigit = evenLengthHex[i]; + const secondDigit = evenLengthHex[i + 1]; + if (!HEX_DIGIT.test(firstDigit)) { + break; + } + if (!HEX_DIGIT.test(secondDigit)) { + break; + } + const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16); + buffer.push(hexDigit); + } + return Uint8Array.from(buffer); + }, + toHex(uint8array) { + return Array.from(uint8array, byte => byte.toString(16).padStart(2, '0')).join(''); + }, + toUTF8(uint8array, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(uint8array, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + return parseUtf8(uint8array, start, end, fatal); + }, + utf8ByteLength(input) { + return new TextEncoder().encode(input).byteLength; + }, + encodeUTF8Into(uint8array, source, byteOffset) { + const bytes = new TextEncoder().encode(source); + uint8array.set(bytes, byteOffset); + return bytes.byteLength; + }, + randomBytes: webRandomBytes, + swap32(buffer) { + if (buffer.length % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + for (let i = 0; i < buffer.length; i += 4) { + const byte0 = buffer[i]; + const byte1 = buffer[i + 1]; + const byte2 = buffer[i + 2]; + const byte3 = buffer[i + 3]; + buffer[i] = byte3; + buffer[i + 1] = byte2; + buffer[i + 2] = byte1; + buffer[i + 3] = byte0; + } + return buffer; + } +}; + +const hasGlobalBuffer = typeof Buffer === 'function' && Buffer.prototype?._isBuffer !== true; +const ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils; + +const bsonType = Symbol.for('@@mdb.bson.type'); +class BSONValue { + get [bsonType]() { + return this._bsontype; + } + get [BSON_VERSION_SYMBOL]() { + return BSON_MAJOR_VERSION; + } + [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) { + return this.inspect(depth, options, inspect); + } +} + +const FLOAT = new Float64Array(1); +const FLOAT_BYTES = new Uint8Array(FLOAT.buffer, 0, 8); +FLOAT[0] = -1; +const isBigEndian = FLOAT_BYTES[7] === 0; +const NumberUtils = { + isBigEndian, + getNonnegativeInt32LE(source, offset) { + if (source[offset + 3] > 127) { + throw new RangeError(`Size cannot be negative at offset: ${offset}`); + } + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getInt32LE(source, offset) { + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getUint32LE(source, offset) { + return (source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + }, + getUint32BE(source, offset) { + return (source[offset + 3] + + source[offset + 2] * 256 + + source[offset + 1] * 65536 + + source[offset] * 16777216); + }, + getBigInt64LE(source, offset) { + const hi = BigInt(source[offset + 4] + + source[offset + 5] * 256 + + source[offset + 6] * 65536 + + (source[offset + 7] << 24)); + const lo = BigInt(source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + return (hi << 32n) + lo; + }, + getFloat64LE: isBigEndian + ? (source, offset) => { + FLOAT_BYTES[7] = source[offset]; + FLOAT_BYTES[6] = source[offset + 1]; + FLOAT_BYTES[5] = source[offset + 2]; + FLOAT_BYTES[4] = source[offset + 3]; + FLOAT_BYTES[3] = source[offset + 4]; + FLOAT_BYTES[2] = source[offset + 5]; + FLOAT_BYTES[1] = source[offset + 6]; + FLOAT_BYTES[0] = source[offset + 7]; + return FLOAT[0]; + } + : (source, offset) => { + FLOAT_BYTES[0] = source[offset]; + FLOAT_BYTES[1] = source[offset + 1]; + FLOAT_BYTES[2] = source[offset + 2]; + FLOAT_BYTES[3] = source[offset + 3]; + FLOAT_BYTES[4] = source[offset + 4]; + FLOAT_BYTES[5] = source[offset + 5]; + FLOAT_BYTES[6] = source[offset + 6]; + FLOAT_BYTES[7] = source[offset + 7]; + return FLOAT[0]; + }, + setInt32BE(destination, offset, value) { + destination[offset + 3] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset] = value; + return 4; + }, + setInt32LE(destination, offset, value) { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; + }, + setBigInt64LE(destination, offset, value) { + const mask32bits = 0xffffffffn; + let lo = Number(value & mask32bits); + destination[offset] = lo; + lo >>= 8; + destination[offset + 1] = lo; + lo >>= 8; + destination[offset + 2] = lo; + lo >>= 8; + destination[offset + 3] = lo; + let hi = Number((value >> 32n) & mask32bits); + destination[offset + 4] = hi; + hi >>= 8; + destination[offset + 5] = hi; + hi >>= 8; + destination[offset + 6] = hi; + hi >>= 8; + destination[offset + 7] = hi; + return 8; + }, + setFloat64LE: isBigEndian + ? (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[7]; + destination[offset + 1] = FLOAT_BYTES[6]; + destination[offset + 2] = FLOAT_BYTES[5]; + destination[offset + 3] = FLOAT_BYTES[4]; + destination[offset + 4] = FLOAT_BYTES[3]; + destination[offset + 5] = FLOAT_BYTES[2]; + destination[offset + 6] = FLOAT_BYTES[1]; + destination[offset + 7] = FLOAT_BYTES[0]; + return 8; + } + : (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[0]; + destination[offset + 1] = FLOAT_BYTES[1]; + destination[offset + 2] = FLOAT_BYTES[2]; + destination[offset + 3] = FLOAT_BYTES[3]; + destination[offset + 4] = FLOAT_BYTES[4]; + destination[offset + 5] = FLOAT_BYTES[5]; + destination[offset + 6] = FLOAT_BYTES[6]; + destination[offset + 7] = FLOAT_BYTES[7]; + return 8; + } +}; + +class Binary extends BSONValue { + get _bsontype() { + return 'Binary'; + } + static BSON_BINARY_SUBTYPE_DEFAULT = 0; + static BUFFER_SIZE = 256; + static SUBTYPE_DEFAULT = 0; + static SUBTYPE_FUNCTION = 1; + static SUBTYPE_BYTE_ARRAY = 2; + static SUBTYPE_UUID_OLD = 3; + static SUBTYPE_UUID = 4; + static SUBTYPE_MD5 = 5; + static SUBTYPE_ENCRYPTED = 6; + static SUBTYPE_COLUMN = 7; + static SUBTYPE_SENSITIVE = 8; + static SUBTYPE_VECTOR = 9; + static SUBTYPE_USER_DEFINED = 128; + static VECTOR_TYPE = Object.freeze({ + Int8: 0x03, + Float32: 0x27, + PackedBit: 0x10 + }); + buffer; + sub_type; + position; + constructor(buffer, subType) { + super(); + if (!(buffer == null) && + typeof buffer === 'string' && + !ArrayBuffer.isView(buffer) && + !isAnyArrayBuffer(buffer) && + !Array.isArray(buffer)) { + throw new BSONError('Binary can only be constructed from Uint8Array or number[]'); + } + this.sub_type = (subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT) & 0xff; + if (buffer == null) { + this.buffer = ByteUtils.allocate(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + this.buffer = Array.isArray(buffer) + ? ByteUtils.fromNumberArray(buffer) + : ByteUtils.toLocalBufferType(buffer); + this.position = this.buffer.byteLength; + } + } + put(byteValue) { + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONError('only accepts single character Uint8Array or Array'); + let decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.byteLength > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + const newSpace = ByteUtils.allocate(Binary.BUFFER_SIZE + this.buffer.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + this.buffer[this.position++] = decodedByte; + } + } + write(sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + if (this.buffer.byteLength < offset + sequence.length) { + const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + throw new BSONError('input cannot be string'); + } + } + read(position, length) { + length = length && length > 0 ? length : this.position; + const end = position + length; + return this.buffer.subarray(position, end > this.position ? this.position : end); + } + value() { + return this.buffer.length === this.position + ? this.buffer + : this.buffer.subarray(0, this.position); + } + length() { + return this.position; + } + toJSON() { + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.buffer.subarray(0, this.position)); + if (encoding === 'base64') + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + if (encoding === 'utf8' || encoding === 'utf-8') + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + } + toExtendedJSON(options) { + options = options || {}; + if (this.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(this); + } + const base64String = ByteUtils.toBase64(this.buffer); + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + toUUID() { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.subarray(0, this.position)); + } + throw new BSONError(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${Binary.SUBTYPE_UUID.toString(16).padStart(2, '0')} is currently supported.`); + } + static createFromHexString(hex, subType) { + return new Binary(ByteUtils.fromHex(hex), subType); + } + static createFromBase64(base64, subType) { + return new Binary(ByteUtils.fromBase64(base64), subType); + } + static fromExtendedJSON(doc, options) { + options = options || {}; + let data; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary.base64); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = UUID.bytesFromString(doc.$uuid); + } + if (!data) { + throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + const base64Arg = inspect(base64, options); + const subTypeArg = inspect(this.sub_type, options); + return `Binary.createFromBase64(${base64Arg}, ${subTypeArg})`; + } + toInt8Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Int8) { + throw new BSONError('Binary datatype field is not Int8'); + } + validateBinaryVector(this); + return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toFloat32Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Float32) { + throw new BSONError('Binary datatype field is not Float32'); + } + validateBinaryVector(this); + const floatBytes = new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(floatBytes); + return new Float32Array(floatBytes.buffer); + } + toPackedBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + const byteCount = this.length() - 2; + const bitCount = byteCount * 8 - this.buffer[1]; + const bits = new Int8Array(bitCount); + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = (bitOffset / 8) | 0; + const byte = this.buffer[byteOffset + 2]; + const shift = 7 - (bitOffset % 8); + const bit = (byte >> shift) & 1; + bits[bitOffset] = bit; + } + return bits; + } + static fromInt8Array(array) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.Int8; + buffer[1] = 0; + const intBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + buffer.set(intBytes, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromFloat32Array(array) { + const binaryBytes = ByteUtils.allocate(array.byteLength + 2); + binaryBytes[0] = Binary.VECTOR_TYPE.Float32; + binaryBytes[1] = 0; + const floatBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + binaryBytes.set(floatBytes, 2); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(new Uint8Array(binaryBytes.buffer, 2)); + const bin = new this(binaryBytes, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromPackedBits(array, padding = 0) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.PackedBit; + buffer[1] = padding; + buffer.set(array, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromBits(bits) { + const byteLength = (bits.length + 7) >>> 3; + const bytes = new Uint8Array(byteLength + 2); + bytes[0] = Binary.VECTOR_TYPE.PackedBit; + const remainder = bits.length % 8; + bytes[1] = remainder === 0 ? 0 : 8 - remainder; + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset >>> 3; + const bit = bits[bitOffset]; + if (bit !== 0 && bit !== 1) { + throw new BSONError(`Invalid bit value at ${bitOffset}: must be 0 or 1, found ${bits[bitOffset]}`); + } + if (bit === 0) + continue; + const shift = 7 - (bitOffset % 8); + bytes[byteOffset + 2] |= bit << shift; + } + return new this(bytes, Binary.SUBTYPE_VECTOR); + } +} +function validateBinaryVector(vector) { + if (vector.sub_type !== Binary.SUBTYPE_VECTOR) + return; + const size = vector.position; + const datatype = vector.buffer[0]; + const padding = vector.buffer[1]; + if ((datatype === Binary.VECTOR_TYPE.Float32 || datatype === Binary.VECTOR_TYPE.Int8) && + padding !== 0) { + throw new BSONError('Invalid Vector: padding must be zero for int8 and float32 vectors'); + } + if (datatype === Binary.VECTOR_TYPE.Float32) { + if (size !== 0 && size - 2 !== 0 && (size - 2) % 4 !== 0) { + throw new BSONError('Invalid Vector: Float32 vector must contain a multiple of 4 bytes'); + } + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding !== 0 && size === 2) { + throw new BSONError('Invalid Vector: padding must be zero for packed bit vectors that are empty'); + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding > 7) { + throw new BSONError(`Invalid Vector: padding must be a value between 0 and 7. found: ${padding}`); + } +} +const UUID_BYTE_LENGTH = 16; +const UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i; +const UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i; +class UUID extends Binary { + constructor(input) { + let bytes; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer)); + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ByteUtils.toLocalBufferType(input); + } + else if (typeof input === 'string') { + bytes = UUID.bytesFromString(input); + } + else { + throw new BSONError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + } + get id() { + return this.buffer; + } + set id(value) { + this.buffer = value; + } + toHexString(includeDashes = true) { + if (includeDashes) { + return [ + ByteUtils.toHex(this.buffer.subarray(0, 4)), + ByteUtils.toHex(this.buffer.subarray(4, 6)), + ByteUtils.toHex(this.buffer.subarray(6, 8)), + ByteUtils.toHex(this.buffer.subarray(8, 10)), + ByteUtils.toHex(this.buffer.subarray(10, 16)) + ].join('-'); + } + return ByteUtils.toHex(this.buffer); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.id); + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + equals(otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return ByteUtils.equals(otherId.id, this.id); + } + try { + return ByteUtils.equals(new UUID(otherId).id, this.id); + } + catch { + return false; + } + } + toBinary() { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + static generate() { + const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH); + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return bytes; + } + static isValid(input) { + if (!input) { + return false; + } + if (typeof input === 'string') { + return UUID.isValidUUIDString(input); + } + if (isUint8Array(input)) { + return input.byteLength === UUID_BYTE_LENGTH; + } + return (input._bsontype === 'Binary' && + input.sub_type === this.SUBTYPE_UUID && + input.buffer.byteLength === 16); + } + static createFromHexString(hexString) { + const buffer = UUID.bytesFromString(hexString); + return new UUID(buffer); + } + static createFromBase64(base64) { + return new UUID(ByteUtils.fromBase64(base64)); + } + static bytesFromString(representation) { + if (!UUID.isValidUUIDString(representation)) { + throw new BSONError('UUID string representation must be 32 hex digits or canonical hyphenated representation'); + } + return ByteUtils.fromHex(representation.replace(/-/g, '')); + } + static isValidUUIDString(representation) { + return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new UUID(${inspect(this.toHexString(), options)})`; + } +} + +class Code extends BSONValue { + get _bsontype() { + return 'Code'; + } + code; + scope; + constructor(code, scope) { + super(); + this.code = code.toString(); + this.scope = scope ?? null; + } + toJSON() { + if (this.scope != null) { + return { code: this.code, scope: this.scope }; + } + return { code: this.code }; + } + toExtendedJSON() { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + } + static fromExtendedJSON(doc) { + return new Code(doc.$code, doc.$scope); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + let parametersString = inspect(this.code, options); + const multiLineFn = parametersString.includes('\n'); + if (this.scope != null) { + parametersString += `,${multiLineFn ? '\n' : ' '}${inspect(this.scope, options)}`; + } + const endingNewline = multiLineFn && this.scope === null; + return `new Code(${multiLineFn ? '\n' : ''}${parametersString}${endingNewline ? '\n' : ''})`; + } +} + +function isDBRefLike(value) { + return (value != null && + typeof value === 'object' && + '$id' in value && + value.$id != null && + '$ref' in value && + typeof value.$ref === 'string' && + (!('$db' in value) || ('$db' in value && typeof value.$db === 'string'))); +} +class DBRef extends BSONValue { + get _bsontype() { + return 'DBRef'; + } + collection; + oid; + db; + fields; + constructor(collection, oid, db, fields) { + super(); + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + get namespace() { + return this.collection; + } + set namespace(value) { + this.collection = value; + } + toJSON() { + const o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + } + toExtendedJSON(options) { + options = options || {}; + let o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + static fromExtendedJSON(doc) { + const copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const args = [ + inspect(this.namespace, options), + inspect(this.oid, options), + ...(this.db ? [inspect(this.db, options)] : []), + ...(Object.keys(this.fields).length > 0 ? [inspect(this.fields, options)] : []) + ]; + args[1] = inspect === defaultInspect ? `new ObjectId(${args[1]})` : args[1]; + return `new DBRef(${args.join(', ')})`; + } +} + +function removeLeadingZerosAndExplicitPlus(str) { + if (str === '') { + return str; + } + let startIndex = 0; + const isNegative = str[startIndex] === '-'; + const isExplicitlyPositive = str[startIndex] === '+'; + if (isExplicitlyPositive || isNegative) { + startIndex += 1; + } + let foundInsignificantZero = false; + for (; startIndex < str.length && str[startIndex] === '0'; ++startIndex) { + foundInsignificantZero = true; + } + if (!foundInsignificantZero) { + return isExplicitlyPositive ? str.slice(1) : str; + } + return `${isNegative ? '-' : ''}${str.length === startIndex ? '0' : str.slice(startIndex)}`; +} +function validateStringCharacters(str, radix) { + radix = radix ?? 10; + const validCharacters = '0123456789abcdefghijklmnopqrstuvwxyz'.slice(0, radix); + const regex = new RegExp(`[^-+${validCharacters}]`, 'i'); + return regex.test(str) ? false : str; +} + +let wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch { +} +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +const INT_CACHE = {}; +const UINT_CACHE = {}; +const MAX_INT64_STRING_LENGTH = 20; +const DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/; +class Long extends BSONValue { + get _bsontype() { + return 'Long'; + } + get __isLong__() { + return true; + } + high; + low; + unsigned; + constructor(lowOrValue = 0, highOrUnsigned, unsigned) { + super(); + const unsignedBool = typeof highOrUnsigned === 'boolean' ? highOrUnsigned : Boolean(unsigned); + const high = typeof highOrUnsigned === 'number' ? highOrUnsigned : 0; + const res = typeof lowOrValue === 'string' + ? Long.fromString(lowOrValue, unsignedBool) + : typeof lowOrValue === 'bigint' + ? Long.fromBigInt(lowOrValue, unsignedBool) + : { low: lowOrValue | 0, high: high | 0, unsigned: unsignedBool }; + this.low = res.low; + this.high = res.high; + this.unsigned = res.unsigned; + } + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + static ZERO = Long.fromInt(0); + static UZERO = Long.fromInt(0, true); + static ONE = Long.fromInt(1); + static UONE = Long.fromInt(1, true); + static NEG_ONE = Long.fromInt(-1); + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + static fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + static fromInt(value, unsigned) { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + static fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + static fromBigInt(value, unsigned) { + const FROM_BIGINT_BIT_MASK = 0xffffffffn; + const FROM_BIGINT_BIT_SHIFT = 32n; + return new Long(Number(value & FROM_BIGINT_BIT_MASK), Number((value >> FROM_BIGINT_BIT_SHIFT) & FROM_BIGINT_BIT_MASK), unsigned); + } + static _fromString(str, unsigned, radix) { + if (str.length === 0) + throw new BSONError('empty string'); + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + let p; + if ((p = str.indexOf('-')) > 0) + throw new BSONError('interior hyphen'); + else if (p === 0) { + return Long._fromString(str.substring(1), unsigned, radix).neg(); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + static fromStringStrict(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str.trim() !== str) { + throw new BSONError(`Input: '${str}' contains leading and/or trailing whitespace`); + } + if (!validateStringCharacters(str, radix)) { + throw new BSONError(`Input: '${str}' contains invalid characters for radix: ${radix}`); + } + const cleanedStr = removeLeadingZerosAndExplicitPlus(str); + const result = Long._fromString(cleanedStr, unsigned, radix); + if (result.toString(radix).toLowerCase() !== cleanedStr.toLowerCase()) { + throw new BSONError(`Input: ${str} is not representable as ${result.unsigned ? 'an unsigned' : 'a signed'} 64-bit Long ${radix != null ? `with radix: ${radix}` : ''}`); + } + return result; + } + static fromString(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str === 'NaN' && radix < 24) { + return Long.ZERO; + } + else if ((str === 'Infinity' || str === '+Infinity' || str === '-Infinity') && radix < 35) { + return Long.ZERO; + } + return Long._fromString(str, unsigned, radix); + } + static fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + static fromBytesLE(bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + } + static fromBytesBE(bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + } + static isLong(value) { + return (value != null && + typeof value === 'object' && + '__isLong__' in value && + value.__isLong__ === true); + } + static fromValue(val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + } + add(addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + and(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + compare(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + const thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + comp(other) { + return this.compare(other); + } + divide(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw new BSONError('division by zero'); + if (wasm) { + if (!this.unsigned && + this.high === -2147483648 && + divisor.low === -1 && + divisor.high === -1) { + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + return Long.UONE; + res = Long.UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + div(divisor) { + return this.divide(divisor); + } + equals(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + eq(other) { + return this.equals(other); + } + getHighBits() { + return this.high; + } + getHighBitsUnsigned() { + return this.high >>> 0; + } + getLowBits() { + return this.low; + } + getLowBitsUnsigned() { + return this.low >>> 0; + } + getNumBitsAbs() { + if (this.isNegative()) { + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + greaterThan(other) { + return this.comp(other) > 0; + } + gt(other) { + return this.greaterThan(other); + } + greaterThanOrEqual(other) { + return this.comp(other) >= 0; + } + gte(other) { + return this.greaterThanOrEqual(other); + } + ge(other) { + return this.greaterThanOrEqual(other); + } + isEven() { + return (this.low & 1) === 0; + } + isNegative() { + return !this.unsigned && this.high < 0; + } + isOdd() { + return (this.low & 1) === 1; + } + isPositive() { + return this.unsigned || this.high >= 0; + } + isZero() { + return this.high === 0 && this.low === 0; + } + lessThan(other) { + return this.comp(other) < 0; + } + lt(other) { + return this.lessThan(other); + } + lessThanOrEqual(other) { + return this.comp(other) <= 0; + } + lte(other) { + return this.lessThanOrEqual(other); + } + modulo(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + } + mod(divisor) { + return this.modulo(divisor); + } + rem(divisor) { + return this.modulo(divisor); + } + multiply(multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + mul(multiplier) { + return this.multiply(multiplier); + } + negate() { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + neg() { + return this.negate(); + } + not() { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + notEquals(other) { + return !this.equals(other); + } + neq(other) { + return this.notEquals(other); + } + ne(other) { + return this.notEquals(other); + } + or(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + shiftLeft(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + shl(numBits) { + return this.shiftLeft(numBits); + } + shiftRight(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + shr(numBits) { + return this.shiftRight(numBits); + } + shiftRightUnsigned(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + shr_u(numBits) { + return this.shiftRightUnsigned(numBits); + } + shru(numBits) { + return this.shiftRightUnsigned(numBits); + } + subtract(subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + sub(subtrahend) { + return this.subtract(subtrahend); + } + toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + } + toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + toBigInt() { + return BigInt(this.toString()); + } + toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + } + toBytesLE() { + const hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + toBytesBE() { + const hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + toSigned() { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + } + toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + if (this.eq(Long.MIN_VALUE)) { + const radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + let rem = this; + let result = ''; + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + } + toUnsigned() { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + } + xor(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + eqz() { + return this.isZero(); + } + le(other) { + return this.lessThanOrEqual(other); + } + toExtendedJSON(options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc, options) { + const { useBigInt64 = false, relaxed = true } = { ...options }; + if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) { + throw new BSONError('$numberLong string is too long'); + } + if (!DECIMAL_REG_EX.test(doc.$numberLong)) { + throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`); + } + if (useBigInt64) { + const bigIntResult = BigInt(doc.$numberLong); + return BigInt.asIntN(64, bigIntResult); + } + const longResult = Long.fromString(doc.$numberLong); + if (relaxed) { + return longResult.toNumber(); + } + return longResult; + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const longVal = inspect(this.toString(), options); + const unsignedVal = this.unsigned ? `, ${inspect(this.unsigned, options)}` : ''; + return `new Long(${longVal}${unsignedVal})`; + } +} + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; +const NAN_BUFFER = ByteUtils.fromNumberArray([ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray([ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray([ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; +const COMBINATION_MASK = 0x1f; +const EXPONENT_MASK = 0x3fff; +const COMBINATION_INFINITY = 30; +const COMBINATION_NAN = 31; +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +function divideu128(value) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (let i = 0; i <= 3; i++) { + _rem = _rem.shiftLeft(32); + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message}`); +} +class Decimal128 extends BSONValue { + get _bsontype() { + return 'Decimal128'; + } + bytes; + constructor(bytes) { + super(); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (bytes instanceof Uint8Array || isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONError('Decimal128 must take a Buffer or string'); + } + } + static fromString(representation) { + return Decimal128._fromString(representation, { allowRounding: false }); + } + static fromStringWithRounding(representation) { + return Decimal128._fromString(representation, { allowRounding: true }); + } + static _fromString(representation, options) { + let isNegative = false; + let sawSign = false; + let sawRadix = false; + let foundNonZero = false; + let significantDigits = 0; + let nDigitsRead = 0; + let nDigits = 0; + let radixPosition = 0; + let firstNonZero = 0; + const digits = [0]; + let nDigitsStored = 0; + let digitsInsert = 0; + let lastDigit = 0; + let exponent = 0; + let significandHigh = new Long(0, 0); + let significandLow = new Long(0, 0); + let biasedExponent = 0; + let index = 0; + if (representation.length >= 7000) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + const unsignedNumber = stringMatch[2]; + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + if (representation[index] === '+' || representation[index] === '-') { + sawSign = true; + isNegative = representation[index++] === '-'; + } + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + else if (representation[index] === 'N') { + return new Decimal128(NAN_BUFFER); + } + } + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < MAX_DIGITS) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + if (representation[index] === 'e' || representation[index] === 'E') { + const match = representation.substr(++index).match(EXPONENT_REGEX); + if (!match || !match[2]) + return new Decimal128(NAN_BUFFER); + exponent = parseInt(match[0], 10); + index = index + match[0].length; + } + if (representation[index]) + return new Decimal128(NAN_BUFFER); + if (!nDigitsStored) { + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (representation[firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix)] === '0') { + significantDigits = significantDigits - 1; + } + } + } + if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + while (exponent > EXPONENT_MAX) { + lastDigit = lastDigit + 1; + if (lastDigit >= MAX_DIGITS) { + if (significantDigits === 0) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + if (options.allowRounding) { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + nDigits = nDigits - 1; + } + else { + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (let i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + let dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + } + } + else { + break; + } + } + } + } + } + else { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0) { + if (significantDigits === 0) { + exponent = EXPONENT_MIN; + break; + } + invalidErr(representation, 'exponent underflow'); + } + if (nDigitsStored < nDigits) { + if (representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== '0' && + significantDigits !== 0) { + invalidErr(representation, 'inexact rounding'); + } + nDigits = nDigits - 1; + } + else { + if (digits[lastDigit] !== 0) { + invalidErr(representation, 'inexact rounding'); + } + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + if (sawRadix) { + firstNonZero = firstNonZero + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + if (roundDigit !== 0) { + invalidErr(representation, 'inexact rounding'); + } + } + } + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit < 17) { + let dIdx = 0; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + let dIdx = 0; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + const buffer = ByteUtils.allocateUnsafe(16); + index = 0; + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + return new Decimal128(buffer); + } + toString() { + let biased_exponent; + let significand_digits = 0; + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) + significand[i] = 0; + let index = 0; + let is_zero = false; + let significand_msb; + let significand128 = { parts: [0, 0, 0, 0] }; + let j, k; + const string = []; + index = 0; + const buffer = this.bytes; + const low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + index = 0; + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + const combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + const exponent = biased_exponent - EXPONENT_BIAS; + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + significand[k * 9 + j] = least_digits % 10; + least_digits = Math.floor(least_digits / 10); + } + } + } + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + const scientific_exponent = significand_digits - 1 + exponent; + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) + string.push(`E+${exponent}`); + else if (exponent < 0) + string.push(`E${exponent}`); + return string.join(''); + } + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + string.push('E'); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } + else { + string.push(`${scientific_exponent}`); + } + } + else { + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } + else { + let radix_position = significand_digits + exponent; + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } + else { + string.push('0'); + } + string.push('.'); + while (radix_position++ < 0) { + string.push('0'); + } + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + return string.join(''); + } + toJSON() { + return { $numberDecimal: this.toString() }; + } + toExtendedJSON() { + return { $numberDecimal: this.toString() }; + } + static fromExtendedJSON(doc) { + return Decimal128.fromString(doc.$numberDecimal); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const d128string = inspect(this.toString(), options); + return `new Decimal128(${d128string})`; + } +} + +class Double extends BSONValue { + get _bsontype() { + return 'Double'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + static fromString(value) { + const coercedValue = Number(value); + if (value === 'NaN') + return new Double(NaN); + if (value === 'Infinity') + return new Double(Infinity); + if (value === '-Infinity') + return new Double(-Infinity); + if (!Number.isFinite(coercedValue)) { + throw new BSONError(`Input: ${value} is not representable as a Double`); + } + if (value.trim() !== value) { + throw new BSONError(`Input: '${value}' contains whitespace`); + } + if (value === '') { + throw new BSONError(`Input is an empty string`); + } + if (/[^-0-9.+eE]/.test(value)) { + throw new BSONError(`Input: '${value}' is not in decimal or exponential notation`); + } + return new Double(coercedValue); + } + valueOf() { + return this.value; + } + toJSON() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toExtendedJSON(options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: '-0.0' }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + static fromExtendedJSON(doc, options) { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Double(${inspect(this.value, options)})`; + } +} + +class Int32 extends BSONValue { + get _bsontype() { + return 'Int32'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + static fromString(value) { + const cleanedValue = removeLeadingZerosAndExplicitPlus(value); + const coercedValue = Number(value); + if (BSON_INT32_MAX < coercedValue) { + throw new BSONError(`Input: '${value}' is larger than the maximum value for Int32`); + } + else if (BSON_INT32_MIN > coercedValue) { + throw new BSONError(`Input: '${value}' is smaller than the minimum value for Int32`); + } + else if (!Number.isSafeInteger(coercedValue)) { + throw new BSONError(`Input: '${value}' is not a safe integer`); + } + else if (coercedValue.toString() !== cleanedValue) { + throw new BSONError(`Input: '${value}' is not a valid Int32 string`); + } + return new Int32(coercedValue); + } + valueOf() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toJSON() { + return this.value; + } + toExtendedJSON(options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + } + static fromExtendedJSON(doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Int32(${inspect(this.value, options)})`; + } +} + +class MaxKey extends BSONValue { + get _bsontype() { + return 'MaxKey'; + } + toExtendedJSON() { + return { $maxKey: 1 }; + } + static fromExtendedJSON() { + return new MaxKey(); + } + inspect() { + return 'new MaxKey()'; + } +} + +class MinKey extends BSONValue { + get _bsontype() { + return 'MinKey'; + } + toExtendedJSON() { + return { $minKey: 1 }; + } + static fromExtendedJSON() { + return new MinKey(); + } + inspect() { + return 'new MinKey()'; + } +} + +const __idCache = new WeakMap(); +const byteToHex = []; +for (let n = 0; n < 256; n++) + byteToHex.push(n.toString(16).padStart(2, '0')); +const hexCharCodeToNibble = new Int8Array(103); +for (let c = 48; c <= 57; c++) + hexCharCodeToNibble[c] = c - 48; +for (let c = 65; c <= 70; c++) + hexCharCodeToNibble[c] = c - 55; +for (let c = 97; c <= 102; c++) + hexCharCodeToNibble[c] = c - 87; +class ObjectId extends BSONValue { + get _bsontype() { + return 'ObjectId'; + } + static index = 0; + static PROCESS_UNIQUE = null; + static resetState = () => { + this.index = Math.floor(Math.random() * 0x1000000); + this.PROCESS_UNIQUE = null; + }; + static { + this.resetState(); + const { startupSnapshot } = globalThis?.process?.getBuiltinModule?.('v8') ?? {}; + if (startupSnapshot?.isBuildingSnapshot?.()) { + startupSnapshot?.addDeserializeCallback?.(this.resetState); + } + } + static cacheHexString; + i0; + i1; + i2; + i3; + setFromBytes(b, offset = 0) { + this.i0 = (b[offset] << 16) | (b[offset + 1] << 8) | b[offset + 2]; + this.i1 = (b[offset + 3] << 16) | (b[offset + 4] << 8) | b[offset + 5]; + this.i2 = (b[offset + 6] << 16) | (b[offset + 7] << 8) | b[offset + 8]; + this.i3 = (b[offset + 9] << 16) | (b[offset + 10] << 8) | b[offset + 11]; + } + setFromHex(s) { + const t = hexCharCodeToNibble; + this.i0 = + (t[s.charCodeAt(0)] << 20) | + (t[s.charCodeAt(1)] << 16) | + (t[s.charCodeAt(2)] << 12) | + (t[s.charCodeAt(3)] << 8) | + (t[s.charCodeAt(4)] << 4) | + t[s.charCodeAt(5)]; + this.i1 = + (t[s.charCodeAt(6)] << 20) | + (t[s.charCodeAt(7)] << 16) | + (t[s.charCodeAt(8)] << 12) | + (t[s.charCodeAt(9)] << 8) | + (t[s.charCodeAt(10)] << 4) | + t[s.charCodeAt(11)]; + this.i2 = + (t[s.charCodeAt(12)] << 20) | + (t[s.charCodeAt(13)] << 16) | + (t[s.charCodeAt(14)] << 12) | + (t[s.charCodeAt(15)] << 8) | + (t[s.charCodeAt(16)] << 4) | + t[s.charCodeAt(17)]; + this.i3 = + (t[s.charCodeAt(18)] << 20) | + (t[s.charCodeAt(19)] << 16) | + (t[s.charCodeAt(20)] << 12) | + (t[s.charCodeAt(21)] << 8) | + (t[s.charCodeAt(22)] << 4) | + t[s.charCodeAt(23)]; + } + constructor(inputId, offset) { + super(); + if (typeof offset === 'number') { + this.setFromBytes(inputId, offset); + return; + } + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (ObjectId.is(inputId) && + typeof inputId.i0 === 'number' && + typeof inputId.i1 === 'number' && + typeof inputId.i2 === 'number' && + typeof inputId.i3 === 'number') { + this.i0 = inputId.i0; + this.i1 = inputId.i1; + this.i2 = inputId.i2; + this.i3 = inputId.i3; + return; + } + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = ByteUtils.fromHex(inputId.toHexString()); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + if (workingId == null) { + const time = Math.floor(Date.now() / 1000); + const inc = ObjectId.getInc(); + const pu = (ObjectId.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + this.i0 = (time >>> 8) & 0xffffff; + this.i1 = ((time & 0xff) << 16) | (pu[0] << 8) | pu[1]; + this.i2 = (pu[2] << 16) | (pu[3] << 8) | pu[4]; + this.i3 = inc & 0xffffff; + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + this.setFromBytes(workingId instanceof Uint8Array ? workingId : ByteUtils.toLocalBufferType(workingId)); + } + else if (typeof workingId === 'string') { + if (ObjectId.validateHexString(workingId)) { + this.setFromHex(workingId); + if (ObjectId.cacheHexString) { + __idCache.set(this, workingId); + } + } + else { + throw new BSONError('input must be a 24 character hex string, 12 byte Uint8Array, or an integer'); + } + } + else { + throw new BSONError('Argument passed in does not match the accepted types'); + } + } + get id() { + const b = ByteUtils.allocateUnsafe(12); + b[0] = (this.i0 >>> 16) & 0xff; + b[1] = (this.i0 >>> 8) & 0xff; + b[2] = this.i0 & 0xff; + b[3] = (this.i1 >>> 16) & 0xff; + b[4] = (this.i1 >>> 8) & 0xff; + b[5] = this.i1 & 0xff; + b[6] = (this.i2 >>> 16) & 0xff; + b[7] = (this.i2 >>> 8) & 0xff; + b[8] = this.i2 & 0xff; + b[9] = (this.i3 >>> 16) & 0xff; + b[10] = (this.i3 >>> 8) & 0xff; + b[11] = this.i3 & 0xff; + return b; + } + set id(value) { + const bytes = value instanceof Uint8Array ? value : ByteUtils.toLocalBufferType(value); + this.setFromBytes(bytes); + if (ObjectId.cacheHexString) { + __idCache.set(this, ByteUtils.toHex(bytes)); + } + } + static validateHexString(string) { + if (string?.length !== 24) + return false; + for (let i = 0; i < 24; i++) { + const char = string.charCodeAt(i); + if ((char >= 48 && char <= 57) || + (char >= 97 && char <= 102) || + (char >= 65 && char <= 70)) { + continue; + } + return false; + } + return true; + } + toHexString() { + if (ObjectId.cacheHexString) { + const __id = __idCache.get(this); + if (__id) + return __id; + } + const i0 = this.i0; + const i1 = this.i1; + const i2 = this.i2; + const i3 = this.i3; + const hexString = byteToHex[(i0 >>> 16) & 0xff] + + byteToHex[(i0 >>> 8) & 0xff] + + byteToHex[i0 & 0xff] + + byteToHex[(i1 >>> 16) & 0xff] + + byteToHex[(i1 >>> 8) & 0xff] + + byteToHex[i1 & 0xff] + + byteToHex[(i2 >>> 16) & 0xff] + + byteToHex[(i2 >>> 8) & 0xff] + + byteToHex[i2 & 0xff] + + byteToHex[(i3 >>> 16) & 0xff] + + byteToHex[(i3 >>> 8) & 0xff] + + byteToHex[i3 & 0xff]; + if (ObjectId.cacheHexString) { + __idCache.set(this, hexString); + } + return hexString; + } + static getInc() { + return (ObjectId.index = (ObjectId.index + 1) % 0x1000000); + } + static generate(time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + const inc = ObjectId.getInc(); + const buffer = ByteUtils.allocateUnsafe(12); + NumberUtils.setInt32BE(buffer, 0, time); + const PROCESS_UNIQUE = (this.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + buffer[11] = inc & 0xff; + buffer[10] = (inc >>> 8) & 0xff; + buffer[9] = (inc >>> 16) & 0xff; + return buffer; + } + toString(encoding) { + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + if (encoding === 'hex') + return this.toHexString(); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + static is(variable) { + return (variable != null && + typeof variable === 'object' && + '_bsontype' in variable && + variable._bsontype === 'ObjectId'); + } + equals(otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (ObjectId.is(otherId) && + typeof otherId.i0 === 'number' && + typeof otherId.i1 === 'number' && + typeof otherId.i2 === 'number' && + typeof otherId.i3 === 'number') { + return (this.i3 === otherId.i3 && + this.i0 === otherId.i0 && + this.i1 === otherId.i1 && + this.i2 === otherId.i2); + } + if (typeof otherId === 'string') { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'object' && typeof otherId.toHexString === 'function') { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + } + getTimestamp() { + const timestamp = new Date(); + const time = this.i0 * 0x100 + (this.i1 >>> 16); + timestamp.setTime(time * 1000); + return timestamp; + } + static createPk() { + return new ObjectId(); + } + serializeInto(uint8array, index) { + uint8array[index] = (this.i0 >>> 16) & 0xff; + uint8array[index + 1] = (this.i0 >>> 8) & 0xff; + uint8array[index + 2] = this.i0 & 0xff; + uint8array[index + 3] = (this.i1 >>> 16) & 0xff; + uint8array[index + 4] = (this.i1 >>> 8) & 0xff; + uint8array[index + 5] = this.i1 & 0xff; + uint8array[index + 6] = (this.i2 >>> 16) & 0xff; + uint8array[index + 7] = (this.i2 >>> 8) & 0xff; + uint8array[index + 8] = this.i2 & 0xff; + uint8array[index + 9] = (this.i3 >>> 16) & 0xff; + uint8array[index + 10] = (this.i3 >>> 8) & 0xff; + uint8array[index + 11] = this.i3 & 0xff; + return 12; + } + static createFromTime(time) { + const buffer = ByteUtils.allocate(12); + for (let i = 11; i >= 4; i--) + buffer[i] = 0; + NumberUtils.setInt32BE(buffer, 0, time); + return new ObjectId(buffer); + } + static createFromHexString(hexString) { + if (hexString?.length !== 24) { + throw new BSONError('hex string must be 24 characters'); + } + return new ObjectId(ByteUtils.fromHex(hexString)); + } + static createFromBase64(base64) { + if (base64?.length !== 16) { + throw new BSONError('base64 string must be 16 characters'); + } + return new ObjectId(ByteUtils.fromBase64(base64)); + } + static isValid(id) { + if (id == null) + return false; + if (typeof id === 'string') + return ObjectId.validateHexString(id); + try { + new ObjectId(id); + return true; + } + catch { + return false; + } + } + toExtendedJSON() { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + static fromExtendedJSON(doc) { + return new ObjectId(doc.$oid); + } + isCached() { + return ObjectId.cacheHexString && __idCache.has(this); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new ObjectId(${inspect(this.toHexString(), options)})`; + } +} + +function internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined) { + const objectStack = [ + { object, ignoreUndefined: ignoreUndefined ?? false, exit: false } + ]; + const path = new Set(); + let total = 0; + while (objectStack.length > 0) { + const frame = objectStack.pop(); + if (frame.exit) { + path.delete(frame.object); + continue; + } + const { object: obj, ignoreUndefined: frameIgnoreUndefined } = frame; + path.add(obj); + frame.exit = true; + objectStack.push(frame); + total += 5; + const isObjArray = Array.isArray(obj); + const isObjMap = !isObjArray && (obj instanceof Map || isMap(obj)); + let target = obj; + if (!isObjArray && !isObjMap && typeof obj?.toBSON === 'function') { + target = obj.toBSON(); + } + if (isObjArray) { + const array = target; + for (let i = 0; i < array.length; i++) { + total += calculateElementSize(i.toString(), array[i], serializeFunctions, true, frameIgnoreUndefined, objectStack, path); + } + } + else if (isObjMap) { + for (const [key, value] of target) { + total += calculateElementSize(key, value, serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + else { + for (const key of Object.keys(target)) { + total += calculateElementSize(key, target[key], serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + } + return total; +} +function calculateElementSize(name, value, serializeFunctions = false, isArray = false, ignoreUndefined = false, objectStack, path) { + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return ByteUtils.utf8ByteLength(name) + 1 + 1; + return 0; + case 'boolean': + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 1); + case 'object': + if (value != null && + typeof value._bsontype === 'string' && + value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (value == null || value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') { + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value._bsontype === 'ObjectId') { + return ByteUtils.utf8ByteLength(name) + 1 + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 4 + 1) + value.byteLength; + } + else if (value._bsontype === 'Long' || + value._bsontype === 'Double' || + value._bsontype === 'Timestamp') { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (value._bsontype === 'Decimal128') { + return ByteUtils.utf8ByteLength(name) + 1 + (16 + 1); + } + else if (value._bsontype === 'Int32') { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else if (value._bsontype === 'Code') { + if (value.scope != null && Object.keys(value.scope).length > 0) { + if (path.has(value.scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value.scope, ignoreUndefined, exit: false }); + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + else { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + } + else if (value._bsontype === 'Binary') { + const binary = value; + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1 + 4); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1); + } + } + else if (value._bsontype === 'BSONSymbol') { + return (ByteUtils.utf8ByteLength(name) + 1 + ByteUtils.utf8ByteLength(value.value) + 4 + 1 + 1); + } + else if (value._bsontype === 'DBRef') { + const ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + if (value.db != null) { + ordered_values['$db'] = value.db; + } + objectStack.push({ object: ordered_values, ignoreUndefined: true, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value instanceof RegExp || isRegExp(value)) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.source) + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value._bsontype === 'BSONRegExp') { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.pattern) + + 1 + + ByteUtils.utf8ByteLength(value.options) + + 1); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value, ignoreUndefined, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + case 'function': + if (serializeFunctions) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.toString()) + + 1); + } + return 0; + case 'bigint': + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + case 'symbol': + return 0; + default: + throw new BSONError(`Unrecognized JS type: ${typeof value}`); + } +} + +function alphabetize(str) { + return str.split('').sort().join(''); +} +class BSONRegExp extends BSONValue { + get _bsontype() { + return 'BSONRegExp'; + } + pattern; + options; + constructor(pattern, options) { + super(); + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`); + } + for (let i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + static parseOptions(options) { + return options ? options.split('').sort().join('') : ''; + } + toExtendedJSON(options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + static fromExtendedJSON(doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } + inspect(depth, options, inspect) { + const stylize = getStylizeFunction(options) ?? (v => v); + inspect ??= defaultInspect; + const pattern = stylize(inspect(this.pattern), 'regexp'); + const flags = stylize(inspect(this.options), 'regexp'); + return `new BSONRegExp(${pattern}, ${flags})`; + } +} + +class BSONSymbol extends BSONValue { + get _bsontype() { + return 'BSONSymbol'; + } + value; + constructor(value) { + super(); + this.value = value; + } + valueOf() { + return this.value; + } + toString() { + return this.value; + } + toJSON() { + return this.value; + } + toExtendedJSON() { + return { $symbol: this.value }; + } + static fromExtendedJSON(doc) { + return new BSONSymbol(doc.$symbol); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new BSONSymbol(${inspect(this.value, options)})`; + } +} + +const LongWithoutOverridesClass = Long; +class Timestamp extends LongWithoutOverridesClass { + get _bsontype() { + return 'Timestamp'; + } + get [bsonType]() { + return 'Timestamp'; + } + static MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + get i() { + return this.low >>> 0; + } + get t() { + return this.high >>> 0; + } + constructor(low) { + if (low == null) { + super(0, 0, true); + } + else if (typeof low === 'bigint') { + super(low, true); + } + else if (Long.isLong(low)) { + super(low.low, low.high, true); + } + else if (typeof low === 'object' && 't' in low && 'i' in low) { + if (typeof low.t !== 'number' && (typeof low.t !== 'object' || low.t._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide t as a number'); + } + if (typeof low.i !== 'number' && (typeof low.i !== 'object' || low.i._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide i as a number'); + } + const t = Number(low.t); + const i = Number(low.i); + if (t < 0 || Number.isNaN(t)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive t'); + } + if (i < 0 || Number.isNaN(i)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive i'); + } + if (t > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide t equal or less than uint32 max'); + } + if (i > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide i equal or less than uint32 max'); + } + super(i, t, true); + } + else { + throw new BSONError('A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }'); + } + } + toJSON() { + return { + $timestamp: this.toString() + }; + } + static fromInt(value) { + return new Timestamp(Long.fromInt(value, true)); + } + static fromNumber(value) { + return new Timestamp(Long.fromNumber(value, true)); + } + static fromBits(lowBits, highBits) { + return new Timestamp({ i: lowBits, t: highBits }); + } + static fromString(str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + toExtendedJSON() { + return { $timestamp: { t: this.t, i: this.i } }; + } + static fromExtendedJSON(doc) { + const i = Long.isLong(doc.$timestamp.i) + ? doc.$timestamp.i.getLowBitsUnsigned() + : doc.$timestamp.i; + const t = Long.isLong(doc.$timestamp.t) + ? doc.$timestamp.t.getLowBitsUnsigned() + : doc.$timestamp.t; + return new Timestamp({ t, i }); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const t = inspect(this.t, options); + const i = inspect(this.i, options); + return `new Timestamp({ t: ${t}, i: ${i} })`; + } +} + +const JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +function internalDeserialize(buffer, options, isArray) { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + const size = NumberUtils.getInt32LE(buffer, index); + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + if (size + index > buffer.byteLength) { + throw new BSONError(`(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})`); + } + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + return deserializeObject(buffer, index, options, isArray); +} +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function assignValue(dest, name, value) { + if (name === '__proto__') { + Object.defineProperty(dest, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + dest[name] = value; + } +} +function toPotentialDbRef(doc) { + if (isDBRefLike(doc)) { + const { $ref, $id, $db, ...fields } = doc; + return new DBRef($ref, $id, $db, fields); + } + return doc; +} +function deserializeObject(buffer, index, options, isArray = false) { + options = { ...options }; + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + const raw = options['raw'] == null ? false : options['raw']; + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + const promoteBuffers = options.promoteBuffers ?? false; + const promoteLongs = options.promoteLongs ?? true; + const promoteValues = options.promoteValues ?? true; + const useBigInt64 = options.useBigInt64 ?? false; + if (useBigInt64 && !promoteValues) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + if (useBigInt64 && !promoteLongs) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + const validation = options.validation == null ? { utf8: true } : options.validation; + let globalUTFValidation = true; + let validationSetting; + let utf8KeysSet; + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + if (!globalUTFValidation) { + utf8KeysSet = new Set(); + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + const startIndex = index; + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + const size = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + const rootObject = isArray ? [] : {}; + let arrayIndex = 0; + let isPossibleDBRef = isArray ? false : null; + let currentFrame = null; + let currentDest = rootObject; + let currentIsArray = isArray; + while (true) { + const elementType = buffer[index++]; + if (elementType === 0) { + if (currentFrame) { + if (index === currentFrame.lastIndex) { + const completedFrame = currentFrame; + currentFrame = completedFrame.prev; + if (currentFrame === null) { + currentDest = rootObject; + currentIsArray = isArray; + } + else { + currentDest = currentFrame.holdingDocument; + currentIsArray = currentFrame.isArray; + } + let result = completedFrame.holdingDocument; + switch (completedFrame.elementType) { + case BSON_DATA_OBJECT: + if (completedFrame.isPossibleDBRef) { + result = toPotentialDbRef(result); + } + break; + case BSON_DATA_ARRAY: + break; + case BSON_DATA_CODE_W_SCOPE: + result = new Code(completedFrame.functionString, completedFrame.holdingDocument); + break; + default: + throw new BSONError('Unexpected element type in frame stack'); + } + assignValue(currentDest, completedFrame.propertyName, result); + continue; + } + else { + if (currentFrame.elementType === BSON_DATA_ARRAY) { + throw new BSONError('corrupted array bson'); + } + throw new BSONError('Bad BSON Document: object not properly terminated'); + } + } + else { + break; + } + } + let i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + const name = currentIsArray + ? currentFrame !== null + ? currentFrame.arrayIndex++ + : arrayIndex++ + : ByteUtils.toUTF8(buffer, index, i, false); + let shouldValidateKey; + if (currentFrame !== null) { + shouldValidateKey = currentFrame.validationSetting; + } + else if (globalUTFValidation || utf8KeysSet?.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (currentFrame !== null) { + if (currentFrame.isPossibleDBRef !== false && typeof name === 'string' && name[0] === '$') { + currentFrame.isPossibleDBRef = allowedDBRefKeys.test(name); + } + } + else if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + let value; + let isDeferredValue = false; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + value = new ObjectId(buffer, index); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(NumberUtils.getInt32LE(buffer, index)); + index += 4; + } + else if (elementType === BSON_DATA_INT) { + value = NumberUtils.getInt32LE(buffer, index); + index += 4; + } + else if (elementType === BSON_DATA_NUMBER) { + value = NumberUtils.getFloat64LE(buffer, index); + index += 8; + if (promoteValues === false) + value = new Double(value); + } + else if (elementType === BSON_DATA_DATE) { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + if (raw || (currentFrame?.raw ?? false)) { + value = buffer.subarray(index, index + objectSize); + index = index + objectSize; + } + else { + isDeferredValue = true; + const objectFrame = { + holdingDocument: {}, + elementType: BSON_DATA_OBJECT, + propertyName: name, + functionString: null, + lastIndex: index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = objectFrame; + currentDest = objectFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + } + else if (elementType === BSON_DATA_ARRAY) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded array length in bson'); + const stopIndex = index + objectSize; + const arrayRaw = !!(fieldsAsRaw && fieldsAsRaw[name]) || (currentFrame?.raw ?? false); + isDeferredValue = true; + const arrayFrame = { + holdingDocument: [], + elementType: BSON_DATA_ARRAY, + propertyName: name, + functionString: null, + lastIndex: stopIndex, + isArray: true, + arrayIndex: 0, + raw: arrayRaw, + isPossibleDBRef: false, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = arrayFrame; + currentDest = arrayFrame.holdingDocument; + currentIsArray = true; + index = index + 4; + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + if (useBigInt64) { + value = NumberUtils.getBigInt64LE(buffer, index); + index += 8; + } + else { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + const long = new Long(lowBits, highBits); + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + const bytes = ByteUtils.allocateUnsafe(16); + for (let i = 0; i < 16; i++) + bytes[i] = buffer[index + i]; + index = index + 16; + value = new Decimal128(bytes); + } + else if (elementType === BSON_DATA_BINARY) { + let binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + const totalBinarySize = binarySize; + const subType = buffer[index++]; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = ByteUtils.toLocalBufferType(buffer.subarray(index, index + binarySize)); + } + else { + value = new Binary(buffer.subarray(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) { + value = value.toUUID(); + } + } + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + const optionsArray = new Array(regExpOptions.length); + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const symbol = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + value = new Timestamp({ + i: NumberUtils.getUint32LE(buffer, index), + t: NumberUtils.getUint32LE(buffer, index + 4) + }); + index += 8; + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = new Code(functionString); + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + const totalSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad scope document size in code_w_scope'); + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + isDeferredValue = true; + const scopeFrame = { + holdingDocument: {}, + elementType: BSON_DATA_CODE_W_SCOPE, + propertyName: name, + functionString: functionString, + lastIndex: _index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = scopeFrame; + currentDest = scopeFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + else if (elementType === BSON_DATA_DBPOINTER) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + const namespace = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const oidBuffer = ByteUtils.allocateUnsafe(12); + for (let i = 0; i < 12; i++) + oidBuffer[i] = buffer[index + i]; + const oid = new ObjectId(oidBuffer); + index = index + 12; + value = new DBRef(namespace, oid); + } + else { + throw new BSONError(`Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"`); + } + if (!isDeferredValue) { + assignValue(currentDest, name, value); + } + } + if (currentFrame !== null) { + throw new BSONError('corrupted bson, more objects expected based on the current document size'); + } + const object = rootObject; + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + if (!isPossibleDBRef) + return object; + return toPotentialDbRef(object); +} + +const regexp = /\x00/; +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +function serializeString(buffer, key, value, index) { + buffer[index++] = BSON_DATA_STRING; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value, index + 4); + NumberUtils.setInt32LE(buffer, index, size + 1); + index = index + 4 + size; + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index) { + const isNegativeZero = Object.is(value, -0); + const type = !isNegativeZero && + Number.isSafeInteger(value) && + value <= BSON_INT32_MAX && + value >= BSON_INT32_MIN + ? BSON_DATA_INT + : BSON_DATA_NUMBER; + buffer[index++] = type; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0x00; + if (type === BSON_DATA_INT) { + index += NumberUtils.setInt32LE(buffer, index, value); + } + else { + index += NumberUtils.setFloat64LE(buffer, index, value); + } + return index; +} +function serializeBigInt(buffer, key, value, index) { + buffer[index++] = BSON_DATA_LONG; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index += numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setBigInt64LE(buffer, index, value); + return index; +} +function serializeNull(buffer, key, _, index) { + buffer[index++] = BSON_DATA_NULL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BOOLEAN; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DATE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw new BSONError('value ' + value.source + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.source, index); + buffer[index++] = 0x00; + if (value.ignoreCase) + buffer[index++] = 0x69; + if (value.global) + buffer[index++] = 0x73; + if (value.multiline) + buffer[index++] = 0x6d; + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.pattern.match(regexp) != null) { + throw new BSONError('pattern ' + value.pattern + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.pattern, index); + buffer[index++] = 0x00; + const sortedOptions = value.options.split('').sort().join(''); + index = index + ByteUtils.encodeUTF8Into(buffer, sortedOptions, index); + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index) { + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value[bsonType] === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index) { + buffer[index++] = BSON_DATA_OID; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += value.serializeInto(buffer, index); + return index; +} +function serializeBuffer(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = value.length; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = value[i]; + } + else { + buffer.set(value, index); + } + index = index + size; + return index; +} +function serializeDecimal128(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DECIMAL128; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + for (let i = 0; i < 16; i++) + buffer[index + i] = value.bytes[i]; + return index + 16; +} +function serializeLong(buffer, key, value, index) { + buffer[index++] = + value[bsonType] === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeInt32(buffer, key, value, index) { + value = value.valueOf(); + buffer[index++] = BSON_DATA_INT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setInt32LE(buffer, index, value); + return index; +} +function serializeDouble(buffer, key, value, index) { + buffer[index++] = BSON_DATA_NUMBER; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setFloat64LE(buffer, index, value.value); + return index; +} +function serializeFunction(buffer, key, value, index) { + buffer[index++] = BSON_DATA_CODE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const functionString = value.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function serializeBinary(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const data = value.buffer; + let size = value.position; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = value.sub_type; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + index += NumberUtils.setInt32LE(buffer, index, size); + } + if (value.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(value); + } + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = data[i]; + } + else { + buffer.set(data, index); + } + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index) { + buffer[index++] = BSON_DATA_SYMBOL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value.value, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function makeFrame(sourceObject, objectSizeIndex, codeSizeIndex, prev, checkKeys, ignoreUndefined) { + if (Array.isArray(sourceObject)) { + return { + sourceObject, + isArray: true, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; + } + if (sourceObject instanceof Map || isMap(sourceObject)) { + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: sourceObject.entries(), + prev, + checkKeys, + ignoreUndefined + }; + } + let target = sourceObject; + if (typeof target?.toBSON === 'function') { + target = target.toBSON(); + if (target != null && typeof target !== 'object') { + throw new BSONError('toBSON function did not return an object'); + } + } + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: target, + keys: Object.keys(target), + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; +} +function serializeInto(buffer, object, checkKeys, startingIndex, serializeFunctions, ignoreUndefined, path) { + if (path == null) { + if (object == null) { + buffer[0] = 0x05; + buffer[1] = 0x00; + buffer[2] = 0x00; + buffer[3] = 0x00; + buffer[4] = 0x00; + return 5; + } + if (Array.isArray(object)) { + throw new BSONError('serialize does not support an array as the root input'); + } + if (typeof object !== 'object') { + throw new BSONError('serialize does not support non-object as the root input'); + } + else if ('_bsontype' in object && typeof object._bsontype === 'string') { + throw new BSONError(`BSON types cannot be serialized as a document`); + } + else if (isDate(object) || + isRegExp(object) || + isUint8Array(object) || + isAnyArrayBuffer(object)) { + throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`); + } + path = new Set(); + } + path.add(object); + let currentFrame = makeFrame(object, startingIndex, null, null, checkKeys, ignoreUndefined); + let index = startingIndex + 4; + while (currentFrame !== null) { + const frame = currentFrame; + let key; + let value; + if (frame.mapIterator !== null) { + const next = frame.mapIterator.next(); + if (next.done) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = next.value[0]; + value = next.value[1]; + } + else if (frame.keys !== null) { + if (frame.keyIndex >= frame.keys.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = frame.keys[frame.keyIndex++]; + value = frame.iterTarget[key]; + } + else { + const arr = frame.iterTarget; + if (frame.keyIndex >= arr.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + const i = frame.keyIndex++; + key = String(i); + value = arr[i]; + } + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + if (!frame.isArray && typeof key === 'string' && !(key[0] === '$' && ignoreKeys.has(key))) { + if (regexp.test(key)) { + throw new BSONError('key ' + key + ' must not contain null bytes'); + } + if (frame.checkKeys) { + if ('$' === key[0]) { + throw new BSONError('key ' + key + " must not start with '$'"); + } + else if (key.includes('.')) { + throw new BSONError('key ' + key + " must not contain '.'"); + } + } + } + const type = typeof value; + if (value === undefined) { + if (frame.isArray || frame.ignoreUndefined === false) { + index = serializeNull(buffer, key, value, index); + } + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + index = serializeBigInt(buffer, key, value, index); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (type === 'object' && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + const nestedIsArray = Array.isArray(value); + buffer[index++] = nestedIsArray ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const nestedStartIndex = index; + path.add(value); + currentFrame = makeFrame(value, nestedStartIndex, null, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + } + else if (type === 'object') { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + const tag = value[bsonType]; + if (tag === 'ObjectId') { + index = serializeObjectId(buffer, key, value, index); + } + else if (tag === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (tag === 'Long' || tag === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (tag === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (tag === 'Code') { + const codeValue = value; + if (codeValue.scope && typeof codeValue.scope === 'object') { + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const codeTotalSizeIndex = index; + index += 4; + const functionString = codeValue.code; + const codeSize = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, codeSize); + buffer[index + 4 + codeSize - 1] = 0; + index = index + codeSize + 4; + const scope = codeValue.scope; + if (path.has(scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + path.add(scope); + currentFrame = makeFrame(scope, index, codeTotalSizeIndex, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + else { + buffer[index++] = BSON_DATA_CODE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const functionString = codeValue.code.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + } + } + else if (tag === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (tag === 'BSONSymbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (tag === 'DBRef') { + const dbref = value; + const orderedValues = Object.assign({ $ref: dbref.collection, $id: dbref.oid }, dbref.db != null ? { $db: dbref.db } : null, dbref.fields); + buffer[index++] = BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + path.add(orderedValues); + currentFrame = makeFrame(orderedValues, index, null, frame, false, true); + index += 4; + } + else if (tag === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (tag === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (tag === 'MinKey' || tag === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value._bsontype !== 'undefined') { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } + else if (type === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index); + } + } + return index; +} + +function isBSONType(value) { + return (value != null && + typeof value === 'object' && + '_bsontype' in value && + typeof value._bsontype === 'string'); +} +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +function deserializeValue(value, options = {}) { + if (typeof value === 'number') { + const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN; + const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN; + if (options.relaxed || options.legacy) { + return value; + } + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (in32BitRange) { + return new Int32(value); + } + if (in64BitRange) { + if (options.useBigInt64) { + return BigInt(value); + } + return Long.fromNumber(value); + } + } + return new Double(value); + } + if (value == null || typeof value !== 'object') + return value; + if (value.$undefined) + return null; + const keys = Object.keys(value).filter(k => k.startsWith('$') && value[k] != null); + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + return date; + } + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + if (v instanceof DBRef) + return v; + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid = false; + }); + if (valid) + return DBRef.fromExtendedJSON(v); + } + return value; +} +function serializeArray(array, options) { + return array.map((v, index) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + const isoStr = date.toISOString(); + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +function serializeValue(value, options) { + if (value instanceof Map || isMap(value)) { + const obj = Object.create(null); + for (const [k, v] of value) { + if (typeof k !== 'string') { + throw new BSONError('Can only serialize maps with string keys'); + } + obj[k] = v; + } + return serializeValue(obj, options); + } + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONError('Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/`); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return options.ignoreUndefined ? undefined : null; + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), inRange = dateNum > -1 && dateNum < 253402300800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return { $numberInt: value.toString() }; + } + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) { + return { $numberLong: value.toString() }; + } + } + return { $numberDouble: Object.is(value, -0) ? '-0.0' : value.toString() }; + } + if (typeof value === 'bigint') { + if (!options.relaxed) { + return { $numberLong: BigInt.asIntN(64, value).toString() }; + } + return Number(BigInt.asIntN(64, value)); + } + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +const BSON_TYPE_MAPPINGS = { + Binary: (o) => new Binary(o.value(), o.sub_type), + Code: (o) => new Code(o.code, o.scope), + DBRef: (o) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), + Decimal128: (o) => new Decimal128(o.bytes), + Double: (o) => new Double(o.value), + Int32: (o) => new Int32(o.value), + Long: (o) => Long.fromBits(o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectId: (o) => new ObjectId(o), + BSONRegExp: (o) => new BSONRegExp(o.pattern, o.options), + BSONSymbol: (o) => new BSONSymbol(o.value), + Timestamp: (o) => Timestamp.fromBits(o.low, o.high) +}; +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + const bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + const _doc = {}; + for (const name of Object.keys(doc)) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (doc != null && + typeof doc === 'object' && + typeof doc._bsontype === 'string' && + doc[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (isBSONType(doc)) { + let outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +function parse(text, options) { + const ejsonOptions = { + useBigInt64: options?.useBigInt64 ?? false, + relaxed: options?.relaxed ?? true, + legacy: options?.legacy ?? false + }; + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}`); + } + return deserializeValue(value, ejsonOptions); + }); +} +function stringify(value, replacerOrOptions, spaceOrOptions, options) { + if (spaceOrOptions != null && typeof spaceOrOptions === 'object') { + options = spaceOrOptions; + spaceOrOptions = undefined; + } + if (replacerOrOptions != null && + typeof replacerOrOptions === 'object' && + !Array.isArray(replacerOrOptions)) { + options = replacerOrOptions; + replacerOrOptions = undefined; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacerOrOptions, spaceOrOptions); +} +function EJSONserialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); +} +function EJSONdeserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); +} +const EJSON = Object.create(null); +EJSON.parse = parse; +EJSON.stringify = stringify; +EJSON.serialize = EJSONserialize; +EJSON.deserialize = EJSONdeserialize; +Object.freeze(EJSON); + +const BSONElementType = { + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: 255, + maxKey: 127 +}; +function getSize(source, offset) { + try { + return NumberUtils.getNonnegativeInt32LE(source, offset); + } + catch (cause) { + throw new BSONOffsetError('BSON size cannot be negative', offset, { cause }); + } +} +function findNull(bytes, offset) { + let nullTerminatorOffset = offset; + for (; bytes[nullTerminatorOffset] !== 0x00; nullTerminatorOffset++) + ; + if (nullTerminatorOffset === bytes.length - 1) { + throw new BSONOffsetError('Null terminator not found', offset); + } + return nullTerminatorOffset; +} +function parseToElements(bytes, startOffset = 0) { + startOffset ??= 0; + if (bytes.length < 5) { + throw new BSONOffsetError(`Input must be at least 5 bytes, got ${bytes.length} bytes`, startOffset); + } + const documentSize = getSize(bytes, startOffset); + if (documentSize > bytes.length - startOffset) { + throw new BSONOffsetError(`Parsed documentSize (${documentSize} bytes) does not match input length (${bytes.length} bytes)`, startOffset); + } + if (bytes[startOffset + documentSize - 1] !== 0x00) { + throw new BSONOffsetError('BSON documents must end in 0x00', startOffset + documentSize); + } + const elements = []; + let offset = startOffset + 4; + while (offset <= documentSize + startOffset) { + const type = bytes[offset]; + offset += 1; + if (type === 0) { + if (offset - startOffset !== documentSize) { + throw new BSONOffsetError(`Invalid 0x00 type byte`, offset); + } + break; + } + const nameOffset = offset; + const nameLength = findNull(bytes, offset) - nameOffset; + offset += nameLength + 1; + let length; + if (type === BSONElementType.double || + type === BSONElementType.long || + type === BSONElementType.date || + type === BSONElementType.timestamp) { + length = 8; + } + else if (type === BSONElementType.int) { + length = 4; + } + else if (type === BSONElementType.objectId) { + length = 12; + } + else if (type === BSONElementType.decimal) { + length = 16; + } + else if (type === BSONElementType.bool) { + length = 1; + } + else if (type === BSONElementType.null || + type === BSONElementType.undefined || + type === BSONElementType.maxKey || + type === BSONElementType.minKey) { + length = 0; + } + else if (type === BSONElementType.regex) { + length = findNull(bytes, findNull(bytes, offset) + 1) + 1 - offset; + } + else if (type === BSONElementType.object || + type === BSONElementType.array || + type === BSONElementType.javascriptWithScope) { + length = getSize(bytes, offset); + } + else if (type === BSONElementType.string || + type === BSONElementType.binData || + type === BSONElementType.dbPointer || + type === BSONElementType.javascript || + type === BSONElementType.symbol) { + length = getSize(bytes, offset) + 4; + if (type === BSONElementType.binData) { + length += 1; + } + if (type === BSONElementType.dbPointer) { + length += 12; + } + } + else { + throw new BSONOffsetError(`Invalid 0x${type.toString(16).padStart(2, '0')} type byte`, offset); + } + if (length > documentSize) { + throw new BSONOffsetError('value reports length larger than document', offset); + } + elements.push([type, nameOffset, nameLength, offset, length]); + offset += length; + } + return elements; +} + +const onDemand = Object.create(null); +onDemand.parseToElements = parseToElements; +onDemand.ByteUtils = ByteUtils; +onDemand.NumberUtils = NumberUtils; +Object.freeze(onDemand); + +const MAXSIZE = 1024 * 1024 * 17; +let buffer = ByteUtils.allocate(MAXSIZE); +function setInternalBufferSize(size) { + if (buffer.length < size) { + buffer = ByteUtils.allocate(size); + } +} +function serialize(object, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + if (buffer.length < minInternalBufferSize) { + buffer = ByteUtils.allocate(minInternalBufferSize); + } + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + const finishedBuffer = ByteUtils.allocateUnsafe(serializationIndex); + finishedBuffer.set(buffer.subarray(0, serializationIndex), 0); + return finishedBuffer; +} +function serializeWithBufferAndIndex(object, finalBuffer, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex); + return startIndex + serializationIndex - 1; +} +function deserialize(buffer, options = {}) { + return internalDeserialize(ByteUtils.toLocalBufferType(buffer), options); +} +function calculateObjectSize(object, options = {}) { + options = options || {}; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + const internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + const bufferData = ByteUtils.toLocalBufferType(data); + let index = startIndex; + for (let i = 0; i < numberOfDocuments; i++) { + const size = NumberUtils.getInt32LE(bufferData, index); + internalOptions.index = index; + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + index = index + size; + } + return index; +} + +var bson = /*#__PURE__*/Object.freeze({ + __proto__: null, + BSONError: BSONError, + BSONOffsetError: BSONOffsetError, + BSONRegExp: BSONRegExp, + BSONRuntimeError: BSONRuntimeError, + BSONSymbol: BSONSymbol, + BSONType: BSONType, + BSONValue: BSONValue, + BSONVersionError: BSONVersionError, + Binary: Binary, + ByteUtils: ByteUtils, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + EJSON: EJSON, + Int32: Int32, + Long: Long, + MaxKey: MaxKey, + MinKey: MinKey, + NumberUtils: NumberUtils, + ObjectId: ObjectId, + Timestamp: Timestamp, + UUID: UUID, + bsonType: bsonType, + calculateObjectSize: calculateObjectSize, + deserialize: deserialize, + deserializeStream: deserializeStream, + onDemand: onDemand, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + setInternalBufferSize: setInternalBufferSize +}); + +export { bson as BSON, BSONError, BSONOffsetError, BSONRegExp, BSONRuntimeError, BSONSymbol, BSONType, BSONValue, BSONVersionError, Binary, ByteUtils, Code, DBRef, Decimal128, Double, EJSON, Int32, Long, MaxKey, MinKey, NumberUtils, ObjectId, Timestamp, UUID, bsonType, calculateObjectSize, deserialize, deserializeStream, onDemand, serialize, serializeWithBufferAndIndex, setInternalBufferSize }; +//# sourceMappingURL=bson.node.mjs.map diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs.map b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs.map new file mode 100644 index 00000000..afc0b907 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.node.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.node.mjs","sources":["../src/parser/utils.ts","../src/constants.ts","../src/error.ts","../src/parse_utf8.ts","../src/utils/latin.ts","../src/utils/node_byte_utils.ts","../src/utils/web_byte_utils.ts","../src/utils/byte_utils.ts","../src/bson_value.ts","../src/utils/number_utils.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/utils/string_utils.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/parser/calculate_size.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/extended_json.ts","../src/parser/on_demand/parse_to_elements.ts","../src/parser/on_demand/index.ts","../src/bson.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["StringUtils.validateStringCharacters","StringUtils.removeLeadingZerosAndExplicitPlus","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","constants.BSON_VERSION_SYMBOL","constants.BSON_MAJOR_VERSION","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAUL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/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.rn.cjs new file mode 100644 index 00000000..8308a184 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.rn.cjs @@ -0,0 +1,4881 @@ +'use strict'; + +const TypedArrayPrototypeGetSymbolToStringTag = (() => { + const g = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get; + return (value) => g.call(value); +})(); +function isUint8Array(value) { + return TypedArrayPrototypeGetSymbolToStringTag(value) === 'Uint8Array'; +} +function isAnyArrayBuffer(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + (value[Symbol.toStringTag] === 'ArrayBuffer' || + value[Symbol.toStringTag] === 'SharedArrayBuffer')); +} +function isRegExp(regexp) { + return regexp instanceof RegExp || Object.prototype.toString.call(regexp) === '[object RegExp]'; +} +function isMap(value) { + return (typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Map'); +} +function isDate(date) { + return date instanceof Date || Object.prototype.toString.call(date) === '[object Date]'; +} +function defaultInspect(x, _options) { + return JSON.stringify(x, (k, v) => { + if (typeof v === 'bigint') { + return { $numberLong: `${v}` }; + } + else if (isMap(v)) { + return Object.fromEntries(v); + } + return v; + }); +} +function getStylizeFunction(options) { + const stylizeExists = options != null && + typeof options === 'object' && + 'stylize' in options && + typeof options.stylize === 'function'; + if (stylizeExists) { + return options.stylize; + } +} + +const BSON_MAJOR_VERSION = 7; +const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version'); +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -0x80000000; +const BSON_INT64_MAX = Math.pow(2, 63) - 1; +const BSON_INT64_MIN = -Math.pow(2, 63); +const JS_INT_MAX = Math.pow(2, 53); +const JS_INT_MIN = -Math.pow(2, 53); +const BSON_DATA_NUMBER = 1; +const BSON_DATA_STRING = 2; +const BSON_DATA_OBJECT = 3; +const BSON_DATA_ARRAY = 4; +const BSON_DATA_BINARY = 5; +const BSON_DATA_UNDEFINED = 6; +const BSON_DATA_OID = 7; +const BSON_DATA_BOOLEAN = 8; +const BSON_DATA_DATE = 9; +const BSON_DATA_NULL = 10; +const BSON_DATA_REGEXP = 11; +const BSON_DATA_DBPOINTER = 12; +const BSON_DATA_CODE = 13; +const BSON_DATA_SYMBOL = 14; +const BSON_DATA_CODE_W_SCOPE = 15; +const BSON_DATA_INT = 16; +const BSON_DATA_TIMESTAMP = 17; +const BSON_DATA_LONG = 18; +const BSON_DATA_DECIMAL128 = 19; +const BSON_DATA_MIN_KEY = 0xff; +const BSON_DATA_MAX_KEY = 0x7f; +const BSON_BINARY_SUBTYPE_DEFAULT = 0; +const BSON_BINARY_SUBTYPE_FUNCTION = 1; +const BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; +const BSON_BINARY_SUBTYPE_UUID = 3; +const BSON_BINARY_SUBTYPE_UUID_NEW = 4; +const BSON_BINARY_SUBTYPE_MD5 = 5; +const BSON_BINARY_SUBTYPE_ENCRYPTED = 6; +const BSON_BINARY_SUBTYPE_COLUMN = 7; +const BSON_BINARY_SUBTYPE_SENSITIVE = 8; +const BSON_BINARY_SUBTYPE_USER_DEFINED = 128; +const BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +}); + +class BSONError extends Error { + get bsonError() { + return true; + } + get name() { + return 'BSONError'; + } + constructor(message, options) { + super(message, options); + } + static isBSONError(value) { + return (value != null && + typeof value === 'object' && + 'bsonError' in value && + value.bsonError === true && + 'name' in value && + 'message' in value && + 'stack' in value); + } +} +class BSONVersionError extends BSONError { + get name() { + return 'BSONVersionError'; + } + constructor() { + super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); + } +} +class BSONRuntimeError extends BSONError { + get name() { + return 'BSONRuntimeError'; + } + constructor(message) { + super(message); + } +} +class BSONOffsetError extends BSONError { + get name() { + return 'BSONOffsetError'; + } + offset; + constructor(message, offset, options) { + super(`${message}. offset: ${offset}`, options); + this.offset = offset; + } +} + +let TextDecoderFatal; +let TextDecoderNonFatal; +function parseUtf8(buffer, start, end, fatal) { + if (fatal) { + TextDecoderFatal ??= new TextDecoder('utf8', { fatal: true }); + try { + return TextDecoderFatal.decode(buffer.subarray(start, end)); + } + catch (cause) { + throw new BSONError('Invalid UTF-8 string in BSON document', { cause }); + } + } + TextDecoderNonFatal ??= new TextDecoder('utf8', { fatal: false }); + return TextDecoderNonFatal.decode(buffer.subarray(start, end)); +} + +function tryReadBasicLatin(uint8array, start, end) { + if (uint8array.length === 0) { + return ''; + } + const stringByteLength = end - start; + if (stringByteLength === 0) { + return ''; + } + if (stringByteLength > 20) { + return null; + } + if (stringByteLength === 1 && uint8array[start] < 128) { + return String.fromCharCode(uint8array[start]); + } + if (stringByteLength === 2 && uint8array[start] < 128 && uint8array[start + 1] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]); + } + if (stringByteLength === 3 && + uint8array[start] < 128 && + uint8array[start + 1] < 128 && + uint8array[start + 2] < 128) { + return (String.fromCharCode(uint8array[start]) + + String.fromCharCode(uint8array[start + 1]) + + String.fromCharCode(uint8array[start + 2])); + } + const latinBytes = []; + for (let i = start; i < end; i++) { + const byte = uint8array[i]; + if (byte > 127) { + return null; + } + latinBytes.push(byte); + } + return String.fromCharCode(...latinBytes); +} +function tryWriteBasicLatin(destination, source, offset) { + if (source.length === 0) + return 0; + if (source.length > 25) + return null; + if (destination.length - offset < source.length) + return null; + for (let charOffset = 0, destinationOffset = offset; charOffset < source.length; charOffset++, destinationOffset++) { + const char = source.charCodeAt(charOffset); + if (char > 127) + return null; + destination[destinationOffset] = char; + } + return source.length; +} + +function nodejsMathRandomBytes(byteLength) { + return nodeJsByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +function nodejsSecureRandomBytes(byteLength) { + return crypto.getRandomValues(nodeJsByteUtils.allocate(byteLength)); +} +const nodejsRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return nodejsSecureRandomBytes; + } + else { + return nodejsMathRandomBytes; + } +})(); +const nodeJsByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialBuffer) { + if (Buffer.isBuffer(potentialBuffer)) { + return potentialBuffer; + } + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + const stringTag = potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer); + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return Buffer.from(potentialBuffer); + } + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); + }, + allocate(size) { + return Buffer.alloc(size); + }, + allocateUnsafe(size) { + return Buffer.allocUnsafe(size); + }, + compare(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).compare(b); + }, + concat(list) { + return Buffer.concat(list); + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + return nodeJsByteUtils + .toLocalBufferType(source) + .copy(target, targetStart ?? 0, sourceStart ?? 0, sourceEnd ?? source.length); + }, + equals(a, b) { + return nodeJsByteUtils.toLocalBufferType(a).equals(b); + }, + fromNumberArray(array) { + return Buffer.from(array); + }, + fromBase64(base64) { + return Buffer.from(base64, 'base64'); + }, + fromUTF8(utf8) { + return Buffer.from(utf8, 'utf8'); + }, + toBase64(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('base64'); + }, + fromISO88591(codePoints) { + return Buffer.from(codePoints, 'binary'); + }, + toISO88591(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('binary'); + }, + fromHex(hex) { + return Buffer.from(hex, 'hex'); + }, + toHex(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('hex'); + }, + toUTF8(buffer, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(buffer, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + const string = nodeJsByteUtils.toLocalBufferType(buffer).toString('utf8', start, end); + if (fatal) { + for (let i = 0; i < string.length; i++) { + if (string.charCodeAt(i) === 0xfffd) { + parseUtf8(buffer, start, end, true); + break; + } + } + } + return string; + }, + utf8ByteLength(input) { + return Buffer.byteLength(input, 'utf8'); + }, + encodeUTF8Into(buffer, source, byteOffset) { + const latinBytesWritten = tryWriteBasicLatin(buffer, source, byteOffset); + if (latinBytesWritten != null) { + return latinBytesWritten; + } + return nodeJsByteUtils.toLocalBufferType(buffer).write(source, byteOffset, undefined, 'utf8'); + }, + randomBytes: nodejsRandomBytes, + swap32(buffer) { + return nodeJsByteUtils.toLocalBufferType(buffer).swap32(); + } +}; + +function isReactNative() { + const { navigator } = globalThis; + return typeof navigator === 'object' && navigator.product === 'ReactNative'; +} +function webMathRandomBytes(byteLength) { + if (byteLength < 0) { + throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`); + } + return webByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); +} +const webRandomBytes = (() => { + const { crypto } = globalThis; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return (byteLength) => { + return crypto.getRandomValues(webByteUtils.allocate(byteLength)); + }; + } + else { + if (isReactNative()) { + const { console } = globalThis; + console?.warn?.('BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.'); + } + return webMathRandomBytes; + } +})(); +const HEX_DIGIT = /(\d|[a-f])/i; +const webByteUtils = { + isUint8Array: isUint8Array, + toLocalBufferType(potentialUint8array) { + const stringTag = potentialUint8array?.[Symbol.toStringTag] ?? + Object.prototype.toString.call(potentialUint8array); + if (stringTag === 'Uint8Array') { + return potentialUint8array; + } + if (ArrayBuffer.isView(potentialUint8array)) { + return new Uint8Array(potentialUint8array.buffer.slice(potentialUint8array.byteOffset, potentialUint8array.byteOffset + potentialUint8array.byteLength)); + } + if (stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]') { + return new Uint8Array(potentialUint8array); + } + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); + }, + allocate(size) { + if (typeof size !== 'number') { + throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`); + } + return new Uint8Array(size); + }, + allocateUnsafe(size) { + return webByteUtils.allocate(size); + }, + compare(uint8Array, otherUint8Array) { + if (uint8Array === otherUint8Array) + return 0; + const len = Math.min(uint8Array.length, otherUint8Array.length); + for (let i = 0; i < len; i++) { + if (uint8Array[i] < otherUint8Array[i]) + return -1; + if (uint8Array[i] > otherUint8Array[i]) + return 1; + } + if (uint8Array.length < otherUint8Array.length) + return -1; + if (uint8Array.length > otherUint8Array.length) + return 1; + return 0; + }, + concat(uint8Arrays) { + if (uint8Arrays.length === 0) + return webByteUtils.allocate(0); + let totalLength = 0; + for (const uint8Array of uint8Arrays) { + totalLength += uint8Array.length; + } + const result = webByteUtils.allocate(totalLength); + let offset = 0; + for (const uint8Array of uint8Arrays) { + result.set(uint8Array, offset); + offset += uint8Array.length; + } + return result; + }, + copy(source, target, targetStart, sourceStart, sourceEnd) { + if (sourceEnd !== undefined && sourceEnd < 0) { + throw new RangeError(`The value of "sourceEnd" is out of range. It must be >= 0. Received ${sourceEnd}`); + } + sourceEnd = sourceEnd ?? source.length; + if (sourceStart !== undefined && (sourceStart < 0 || sourceStart > sourceEnd)) { + throw new RangeError(`The value of "sourceStart" is out of range. It must be >= 0 and <= ${sourceEnd}. Received ${sourceStart}`); + } + sourceStart = sourceStart ?? 0; + if (targetStart !== undefined && targetStart < 0) { + throw new RangeError(`The value of "targetStart" is out of range. It must be >= 0. Received ${targetStart}`); + } + targetStart = targetStart ?? 0; + const srcSlice = source.subarray(sourceStart, sourceEnd); + const maxLen = Math.min(srcSlice.length, target.length - targetStart); + if (maxLen <= 0) { + return 0; + } + target.set(srcSlice.subarray(0, maxLen), targetStart); + return maxLen; + }, + equals(uint8Array, otherUint8Array) { + if (uint8Array.byteLength !== otherUint8Array.byteLength) { + return false; + } + for (let i = 0; i < uint8Array.byteLength; i++) { + if (uint8Array[i] !== otherUint8Array[i]) { + return false; + } + } + return true; + }, + fromNumberArray(array) { + return Uint8Array.from(array); + }, + fromBase64(base64) { + return Uint8Array.from(atob(base64), c => c.charCodeAt(0)); + }, + fromUTF8(utf8) { + return new TextEncoder().encode(utf8); + }, + toBase64(uint8array) { + return btoa(webByteUtils.toISO88591(uint8array)); + }, + fromISO88591(codePoints) { + return Uint8Array.from(codePoints, c => c.charCodeAt(0) & 0xff); + }, + toISO88591(uint8array) { + return Array.from(Uint16Array.from(uint8array), b => String.fromCharCode(b)).join(''); + }, + fromHex(hex) { + const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1); + const buffer = []; + for (let i = 0; i < evenLengthHex.length; i += 2) { + const firstDigit = evenLengthHex[i]; + const secondDigit = evenLengthHex[i + 1]; + if (!HEX_DIGIT.test(firstDigit)) { + break; + } + if (!HEX_DIGIT.test(secondDigit)) { + break; + } + const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16); + buffer.push(hexDigit); + } + return Uint8Array.from(buffer); + }, + toHex(uint8array) { + return Array.from(uint8array, byte => byte.toString(16).padStart(2, '0')).join(''); + }, + toUTF8(uint8array, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(uint8array, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + return parseUtf8(uint8array, start, end, fatal); + }, + utf8ByteLength(input) { + return new TextEncoder().encode(input).byteLength; + }, + encodeUTF8Into(uint8array, source, byteOffset) { + const bytes = new TextEncoder().encode(source); + uint8array.set(bytes, byteOffset); + return bytes.byteLength; + }, + randomBytes: webRandomBytes, + swap32(buffer) { + if (buffer.length % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + for (let i = 0; i < buffer.length; i += 4) { + const byte0 = buffer[i]; + const byte1 = buffer[i + 1]; + const byte2 = buffer[i + 2]; + const byte3 = buffer[i + 3]; + buffer[i] = byte3; + buffer[i + 1] = byte2; + buffer[i + 2] = byte1; + buffer[i + 3] = byte0; + } + return buffer; + } +}; + +const hasGlobalBuffer = typeof Buffer === 'function' && Buffer.prototype?._isBuffer !== true; +const ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils; + +const bsonType = Symbol.for('@@mdb.bson.type'); +class BSONValue { + get [bsonType]() { + return this._bsontype; + } + get [BSON_VERSION_SYMBOL]() { + return BSON_MAJOR_VERSION; + } + [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) { + return this.inspect(depth, options, inspect); + } +} + +const FLOAT = new Float64Array(1); +const FLOAT_BYTES = new Uint8Array(FLOAT.buffer, 0, 8); +FLOAT[0] = -1; +const isBigEndian = FLOAT_BYTES[7] === 0; +const NumberUtils = { + isBigEndian, + getNonnegativeInt32LE(source, offset) { + if (source[offset + 3] > 127) { + throw new RangeError(`Size cannot be negative at offset: ${offset}`); + } + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getInt32LE(source, offset) { + return (source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24)); + }, + getUint32LE(source, offset) { + return (source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + }, + getUint32BE(source, offset) { + return (source[offset + 3] + + source[offset + 2] * 256 + + source[offset + 1] * 65536 + + source[offset] * 16777216); + }, + getBigInt64LE(source, offset) { + const hi = BigInt(source[offset + 4] + + source[offset + 5] * 256 + + source[offset + 6] * 65536 + + (source[offset + 7] << 24)); + const lo = BigInt(source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216); + return (hi << 32n) + lo; + }, + getFloat64LE: isBigEndian + ? (source, offset) => { + FLOAT_BYTES[7] = source[offset]; + FLOAT_BYTES[6] = source[offset + 1]; + FLOAT_BYTES[5] = source[offset + 2]; + FLOAT_BYTES[4] = source[offset + 3]; + FLOAT_BYTES[3] = source[offset + 4]; + FLOAT_BYTES[2] = source[offset + 5]; + FLOAT_BYTES[1] = source[offset + 6]; + FLOAT_BYTES[0] = source[offset + 7]; + return FLOAT[0]; + } + : (source, offset) => { + FLOAT_BYTES[0] = source[offset]; + FLOAT_BYTES[1] = source[offset + 1]; + FLOAT_BYTES[2] = source[offset + 2]; + FLOAT_BYTES[3] = source[offset + 3]; + FLOAT_BYTES[4] = source[offset + 4]; + FLOAT_BYTES[5] = source[offset + 5]; + FLOAT_BYTES[6] = source[offset + 6]; + FLOAT_BYTES[7] = source[offset + 7]; + return FLOAT[0]; + }, + setInt32BE(destination, offset, value) { + destination[offset + 3] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset] = value; + return 4; + }, + setInt32LE(destination, offset, value) { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; + }, + setBigInt64LE(destination, offset, value) { + const mask32bits = 0xffffffffn; + let lo = Number(value & mask32bits); + destination[offset] = lo; + lo >>= 8; + destination[offset + 1] = lo; + lo >>= 8; + destination[offset + 2] = lo; + lo >>= 8; + destination[offset + 3] = lo; + let hi = Number((value >> 32n) & mask32bits); + destination[offset + 4] = hi; + hi >>= 8; + destination[offset + 5] = hi; + hi >>= 8; + destination[offset + 6] = hi; + hi >>= 8; + destination[offset + 7] = hi; + return 8; + }, + setFloat64LE: isBigEndian + ? (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[7]; + destination[offset + 1] = FLOAT_BYTES[6]; + destination[offset + 2] = FLOAT_BYTES[5]; + destination[offset + 3] = FLOAT_BYTES[4]; + destination[offset + 4] = FLOAT_BYTES[3]; + destination[offset + 5] = FLOAT_BYTES[2]; + destination[offset + 6] = FLOAT_BYTES[1]; + destination[offset + 7] = FLOAT_BYTES[0]; + return 8; + } + : (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[0]; + destination[offset + 1] = FLOAT_BYTES[1]; + destination[offset + 2] = FLOAT_BYTES[2]; + destination[offset + 3] = FLOAT_BYTES[3]; + destination[offset + 4] = FLOAT_BYTES[4]; + destination[offset + 5] = FLOAT_BYTES[5]; + destination[offset + 6] = FLOAT_BYTES[6]; + destination[offset + 7] = FLOAT_BYTES[7]; + return 8; + } +}; + +class Binary extends BSONValue { + get _bsontype() { + return 'Binary'; + } + static BSON_BINARY_SUBTYPE_DEFAULT = 0; + static BUFFER_SIZE = 256; + static SUBTYPE_DEFAULT = 0; + static SUBTYPE_FUNCTION = 1; + static SUBTYPE_BYTE_ARRAY = 2; + static SUBTYPE_UUID_OLD = 3; + static SUBTYPE_UUID = 4; + static SUBTYPE_MD5 = 5; + static SUBTYPE_ENCRYPTED = 6; + static SUBTYPE_COLUMN = 7; + static SUBTYPE_SENSITIVE = 8; + static SUBTYPE_VECTOR = 9; + static SUBTYPE_USER_DEFINED = 128; + static VECTOR_TYPE = Object.freeze({ + Int8: 0x03, + Float32: 0x27, + PackedBit: 0x10 + }); + buffer; + sub_type; + position; + constructor(buffer, subType) { + super(); + if (!(buffer == null) && + typeof buffer === 'string' && + !ArrayBuffer.isView(buffer) && + !isAnyArrayBuffer(buffer) && + !Array.isArray(buffer)) { + throw new BSONError('Binary can only be constructed from Uint8Array or number[]'); + } + this.sub_type = (subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT) & 0xff; + if (buffer == null) { + this.buffer = ByteUtils.allocate(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + this.buffer = Array.isArray(buffer) + ? ByteUtils.fromNumberArray(buffer) + : ByteUtils.toLocalBufferType(buffer); + this.position = this.buffer.byteLength; + } + } + put(byteValue) { + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONError('only accepts single character Uint8Array or Array'); + let decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.byteLength > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + const newSpace = ByteUtils.allocate(Binary.BUFFER_SIZE + this.buffer.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + this.buffer[this.position++] = decodedByte; + } + } + write(sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + if (this.buffer.byteLength < offset + sequence.length) { + const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + throw new BSONError('input cannot be string'); + } + } + read(position, length) { + length = length && length > 0 ? length : this.position; + const end = position + length; + return this.buffer.subarray(position, end > this.position ? this.position : end); + } + value() { + return this.buffer.length === this.position + ? this.buffer + : this.buffer.subarray(0, this.position); + } + length() { + return this.position; + } + toJSON() { + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.buffer.subarray(0, this.position)); + if (encoding === 'base64') + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + if (encoding === 'utf8' || encoding === 'utf-8') + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + } + toExtendedJSON(options) { + options = options || {}; + if (this.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(this); + } + const base64String = ByteUtils.toBase64(this.buffer); + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + toUUID() { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.subarray(0, this.position)); + } + throw new BSONError(`Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${Binary.SUBTYPE_UUID.toString(16).padStart(2, '0')} is currently supported.`); + } + static createFromHexString(hex, subType) { + return new Binary(ByteUtils.fromHex(hex), subType); + } + static createFromBase64(base64, subType) { + return new Binary(ByteUtils.fromBase64(base64), subType); + } + static fromExtendedJSON(doc, options) { + options = options || {}; + let data; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary.base64); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = UUID.bytesFromString(doc.$uuid); + } + if (!data) { + throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + const base64Arg = inspect(base64, options); + const subTypeArg = inspect(this.sub_type, options); + return `Binary.createFromBase64(${base64Arg}, ${subTypeArg})`; + } + toInt8Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Int8) { + throw new BSONError('Binary datatype field is not Int8'); + } + validateBinaryVector(this); + return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toFloat32Array() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.Float32) { + throw new BSONError('Binary datatype field is not Float32'); + } + validateBinaryVector(this); + const floatBytes = new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(floatBytes); + return new Float32Array(floatBytes.buffer); + } + toPackedBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toBits() { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + validateBinaryVector(this); + const byteCount = this.length() - 2; + const bitCount = byteCount * 8 - this.buffer[1]; + const bits = new Int8Array(bitCount); + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = (bitOffset / 8) | 0; + const byte = this.buffer[byteOffset + 2]; + const shift = 7 - (bitOffset % 8); + const bit = (byte >> shift) & 1; + bits[bitOffset] = bit; + } + return bits; + } + static fromInt8Array(array) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.Int8; + buffer[1] = 0; + const intBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + buffer.set(intBytes, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromFloat32Array(array) { + const binaryBytes = ByteUtils.allocate(array.byteLength + 2); + binaryBytes[0] = Binary.VECTOR_TYPE.Float32; + binaryBytes[1] = 0; + const floatBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + binaryBytes.set(floatBytes, 2); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(new Uint8Array(binaryBytes.buffer, 2)); + const bin = new this(binaryBytes, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromPackedBits(array, padding = 0) { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.PackedBit; + buffer[1] = padding; + buffer.set(array, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromBits(bits) { + const byteLength = (bits.length + 7) >>> 3; + const bytes = new Uint8Array(byteLength + 2); + bytes[0] = Binary.VECTOR_TYPE.PackedBit; + const remainder = bits.length % 8; + bytes[1] = remainder === 0 ? 0 : 8 - remainder; + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset >>> 3; + const bit = bits[bitOffset]; + if (bit !== 0 && bit !== 1) { + throw new BSONError(`Invalid bit value at ${bitOffset}: must be 0 or 1, found ${bits[bitOffset]}`); + } + if (bit === 0) + continue; + const shift = 7 - (bitOffset % 8); + bytes[byteOffset + 2] |= bit << shift; + } + return new this(bytes, Binary.SUBTYPE_VECTOR); + } +} +function validateBinaryVector(vector) { + if (vector.sub_type !== Binary.SUBTYPE_VECTOR) + return; + const size = vector.position; + const datatype = vector.buffer[0]; + const padding = vector.buffer[1]; + if ((datatype === Binary.VECTOR_TYPE.Float32 || datatype === Binary.VECTOR_TYPE.Int8) && + padding !== 0) { + throw new BSONError('Invalid Vector: padding must be zero for int8 and float32 vectors'); + } + if (datatype === Binary.VECTOR_TYPE.Float32) { + if (size !== 0 && size - 2 !== 0 && (size - 2) % 4 !== 0) { + throw new BSONError('Invalid Vector: Float32 vector must contain a multiple of 4 bytes'); + } + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding !== 0 && size === 2) { + throw new BSONError('Invalid Vector: padding must be zero for packed bit vectors that are empty'); + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding > 7) { + throw new BSONError(`Invalid Vector: padding must be a value between 0 and 7. found: ${padding}`); + } +} +const UUID_BYTE_LENGTH = 16; +const UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i; +const UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i; +class UUID extends Binary { + constructor(input) { + let bytes; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer)); + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ByteUtils.toLocalBufferType(input); + } + else if (typeof input === 'string') { + bytes = UUID.bytesFromString(input); + } + else { + throw new BSONError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + } + get id() { + return this.buffer; + } + set id(value) { + this.buffer = value; + } + toHexString(includeDashes = true) { + if (includeDashes) { + return [ + ByteUtils.toHex(this.buffer.subarray(0, 4)), + ByteUtils.toHex(this.buffer.subarray(4, 6)), + ByteUtils.toHex(this.buffer.subarray(6, 8)), + ByteUtils.toHex(this.buffer.subarray(8, 10)), + ByteUtils.toHex(this.buffer.subarray(10, 16)) + ].join('-'); + } + return ByteUtils.toHex(this.buffer); + } + toString(encoding) { + if (encoding === 'hex') + return ByteUtils.toHex(this.id); + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + equals(otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return ByteUtils.equals(otherId.id, this.id); + } + try { + return ByteUtils.equals(new UUID(otherId).id, this.id); + } + catch { + return false; + } + } + toBinary() { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + static generate() { + const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH); + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return bytes; + } + static isValid(input) { + if (!input) { + return false; + } + if (typeof input === 'string') { + return UUID.isValidUUIDString(input); + } + if (isUint8Array(input)) { + return input.byteLength === UUID_BYTE_LENGTH; + } + return (input._bsontype === 'Binary' && + input.sub_type === this.SUBTYPE_UUID && + input.buffer.byteLength === 16); + } + static createFromHexString(hexString) { + const buffer = UUID.bytesFromString(hexString); + return new UUID(buffer); + } + static createFromBase64(base64) { + return new UUID(ByteUtils.fromBase64(base64)); + } + static bytesFromString(representation) { + if (!UUID.isValidUUIDString(representation)) { + throw new BSONError('UUID string representation must be 32 hex digits or canonical hyphenated representation'); + } + return ByteUtils.fromHex(representation.replace(/-/g, '')); + } + static isValidUUIDString(representation) { + return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new UUID(${inspect(this.toHexString(), options)})`; + } +} + +class Code extends BSONValue { + get _bsontype() { + return 'Code'; + } + code; + scope; + constructor(code, scope) { + super(); + this.code = code.toString(); + this.scope = scope ?? null; + } + toJSON() { + if (this.scope != null) { + return { code: this.code, scope: this.scope }; + } + return { code: this.code }; + } + toExtendedJSON() { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + } + static fromExtendedJSON(doc) { + return new Code(doc.$code, doc.$scope); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + let parametersString = inspect(this.code, options); + const multiLineFn = parametersString.includes('\n'); + if (this.scope != null) { + parametersString += `,${multiLineFn ? '\n' : ' '}${inspect(this.scope, options)}`; + } + const endingNewline = multiLineFn && this.scope === null; + return `new Code(${multiLineFn ? '\n' : ''}${parametersString}${endingNewline ? '\n' : ''})`; + } +} + +function isDBRefLike(value) { + return (value != null && + typeof value === 'object' && + '$id' in value && + value.$id != null && + '$ref' in value && + typeof value.$ref === 'string' && + (!('$db' in value) || ('$db' in value && typeof value.$db === 'string'))); +} +class DBRef extends BSONValue { + get _bsontype() { + return 'DBRef'; + } + collection; + oid; + db; + fields; + constructor(collection, oid, db, fields) { + super(); + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + get namespace() { + return this.collection; + } + set namespace(value) { + this.collection = value; + } + toJSON() { + const o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + } + toExtendedJSON(options) { + options = options || {}; + let o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + static fromExtendedJSON(doc) { + const copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const args = [ + inspect(this.namespace, options), + inspect(this.oid, options), + ...(this.db ? [inspect(this.db, options)] : []), + ...(Object.keys(this.fields).length > 0 ? [inspect(this.fields, options)] : []) + ]; + args[1] = inspect === defaultInspect ? `new ObjectId(${args[1]})` : args[1]; + return `new DBRef(${args.join(', ')})`; + } +} + +function removeLeadingZerosAndExplicitPlus(str) { + if (str === '') { + return str; + } + let startIndex = 0; + const isNegative = str[startIndex] === '-'; + const isExplicitlyPositive = str[startIndex] === '+'; + if (isExplicitlyPositive || isNegative) { + startIndex += 1; + } + let foundInsignificantZero = false; + for (; startIndex < str.length && str[startIndex] === '0'; ++startIndex) { + foundInsignificantZero = true; + } + if (!foundInsignificantZero) { + return isExplicitlyPositive ? str.slice(1) : str; + } + return `${isNegative ? '-' : ''}${str.length === startIndex ? '0' : str.slice(startIndex)}`; +} +function validateStringCharacters(str, radix) { + radix = radix ?? 10; + const validCharacters = '0123456789abcdefghijklmnopqrstuvwxyz'.slice(0, radix); + const regex = new RegExp(`[^-+${validCharacters}]`, 'i'); + return regex.test(str) ? false : str; +} + +let wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch { +} +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +const INT_CACHE = {}; +const UINT_CACHE = {}; +const MAX_INT64_STRING_LENGTH = 20; +const DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/; +class Long extends BSONValue { + get _bsontype() { + return 'Long'; + } + get __isLong__() { + return true; + } + high; + low; + unsigned; + constructor(lowOrValue = 0, highOrUnsigned, unsigned) { + super(); + const unsignedBool = typeof highOrUnsigned === 'boolean' ? highOrUnsigned : Boolean(unsigned); + const high = typeof highOrUnsigned === 'number' ? highOrUnsigned : 0; + const res = typeof lowOrValue === 'string' + ? Long.fromString(lowOrValue, unsignedBool) + : typeof lowOrValue === 'bigint' + ? Long.fromBigInt(lowOrValue, unsignedBool) + : { low: lowOrValue | 0, high: high | 0, unsigned: unsignedBool }; + this.low = res.low; + this.high = res.high; + this.unsigned = res.unsigned; + } + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + static ZERO = Long.fromInt(0); + static UZERO = Long.fromInt(0, true); + static ONE = Long.fromInt(1); + static UONE = Long.fromInt(1, true); + static NEG_ONE = Long.fromInt(-1); + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + static fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + static fromInt(value, unsigned) { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + static fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + static fromBigInt(value, unsigned) { + const FROM_BIGINT_BIT_MASK = 0xffffffffn; + const FROM_BIGINT_BIT_SHIFT = 32n; + return new Long(Number(value & FROM_BIGINT_BIT_MASK), Number((value >> FROM_BIGINT_BIT_SHIFT) & FROM_BIGINT_BIT_MASK), unsigned); + } + static _fromString(str, unsigned, radix) { + if (str.length === 0) + throw new BSONError('empty string'); + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + let p; + if ((p = str.indexOf('-')) > 0) + throw new BSONError('interior hyphen'); + else if (p === 0) { + return Long._fromString(str.substring(1), unsigned, radix).neg(); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + static fromStringStrict(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str.trim() !== str) { + throw new BSONError(`Input: '${str}' contains leading and/or trailing whitespace`); + } + if (!validateStringCharacters(str, radix)) { + throw new BSONError(`Input: '${str}' contains invalid characters for radix: ${radix}`); + } + const cleanedStr = removeLeadingZerosAndExplicitPlus(str); + const result = Long._fromString(cleanedStr, unsigned, radix); + if (result.toString(radix).toLowerCase() !== cleanedStr.toLowerCase()) { + throw new BSONError(`Input: ${str} is not representable as ${result.unsigned ? 'an unsigned' : 'a signed'} 64-bit Long ${radix != null ? `with radix: ${radix}` : ''}`); + } + return result; + } + static fromString(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } + else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str === 'NaN' && radix < 24) { + return Long.ZERO; + } + else if ((str === 'Infinity' || str === '+Infinity' || str === '-Infinity') && radix < 35) { + return Long.ZERO; + } + return Long._fromString(str, unsigned, radix); + } + static fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + static fromBytesLE(bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + } + static fromBytesBE(bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + } + static isLong(value) { + return (value != null && + typeof value === 'object' && + '__isLong__' in value && + value.__isLong__ === true); + } + static fromValue(val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + } + add(addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + and(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + compare(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + const thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + comp(other) { + return this.compare(other); + } + divide(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw new BSONError('division by zero'); + if (wasm) { + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + return Long.UONE; + res = Long.UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + div(divisor) { + return this.divide(divisor); + } + equals(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + eq(other) { + return this.equals(other); + } + getHighBits() { + return this.high; + } + getHighBitsUnsigned() { + return this.high >>> 0; + } + getLowBits() { + return this.low; + } + getLowBitsUnsigned() { + return this.low >>> 0; + } + getNumBitsAbs() { + if (this.isNegative()) { + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + greaterThan(other) { + return this.comp(other) > 0; + } + gt(other) { + return this.greaterThan(other); + } + greaterThanOrEqual(other) { + return this.comp(other) >= 0; + } + gte(other) { + return this.greaterThanOrEqual(other); + } + ge(other) { + return this.greaterThanOrEqual(other); + } + isEven() { + return (this.low & 1) === 0; + } + isNegative() { + return !this.unsigned && this.high < 0; + } + isOdd() { + return (this.low & 1) === 1; + } + isPositive() { + return this.unsigned || this.high >= 0; + } + isZero() { + return this.high === 0 && this.low === 0; + } + lessThan(other) { + return this.comp(other) < 0; + } + lt(other) { + return this.lessThan(other); + } + lessThanOrEqual(other) { + return this.comp(other) <= 0; + } + lte(other) { + return this.lessThanOrEqual(other); + } + modulo(divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + } + mod(divisor) { + return this.modulo(divisor); + } + rem(divisor) { + return this.modulo(divisor); + } + multiply(multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + mul(multiplier) { + return this.multiply(multiplier); + } + negate() { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + neg() { + return this.negate(); + } + not() { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + notEquals(other) { + return !this.equals(other); + } + neq(other) { + return this.notEquals(other); + } + ne(other) { + return this.notEquals(other); + } + or(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + shiftLeft(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + shl(numBits) { + return this.shiftLeft(numBits); + } + shiftRight(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + shr(numBits) { + return this.shiftRight(numBits); + } + shiftRightUnsigned(numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + shr_u(numBits) { + return this.shiftRightUnsigned(numBits); + } + shru(numBits) { + return this.shiftRightUnsigned(numBits); + } + subtract(subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + sub(subtrahend) { + return this.subtract(subtrahend); + } + toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + } + toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + toBigInt() { + return BigInt(this.toString()); + } + toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + } + toBytesLE() { + const hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + toBytesBE() { + const hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + toSigned() { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + } + toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw new BSONError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + if (this.eq(Long.MIN_VALUE)) { + const radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + let rem = this; + let result = ''; + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + } + toUnsigned() { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + } + xor(other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + eqz() { + return this.isZero(); + } + le(other) { + return this.lessThanOrEqual(other); + } + toExtendedJSON(options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc, options) { + const { useBigInt64 = false, relaxed = true } = { ...options }; + if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) { + throw new BSONError('$numberLong string is too long'); + } + if (!DECIMAL_REG_EX.test(doc.$numberLong)) { + throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`); + } + if (useBigInt64) { + const bigIntResult = BigInt(doc.$numberLong); + return BigInt.asIntN(64, bigIntResult); + } + const longResult = Long.fromString(doc.$numberLong); + if (relaxed) { + return longResult.toNumber(); + } + return longResult; + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const longVal = inspect(this.toString(), options); + const unsignedVal = this.unsigned ? `, ${inspect(this.unsigned, options)}` : ''; + return `new Long(${longVal}${unsignedVal})`; + } +} + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; +const NAN_BUFFER = ByteUtils.fromNumberArray([ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray([ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray([ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse()); +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; +const COMBINATION_MASK = 0x1f; +const EXPONENT_MASK = 0x3fff; +const COMBINATION_INFINITY = 30; +const COMBINATION_NAN = 31; +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +function divideu128(value) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (let i = 0; i <= 3; i++) { + _rem = _rem.shiftLeft(32); + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message}`); +} +class Decimal128 extends BSONValue { + get _bsontype() { + return 'Decimal128'; + } + bytes; + constructor(bytes) { + super(); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (bytes instanceof Uint8Array || isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONError('Decimal128 must take a Buffer or string'); + } + } + static fromString(representation) { + return Decimal128._fromString(representation, { allowRounding: false }); + } + static fromStringWithRounding(representation) { + return Decimal128._fromString(representation, { allowRounding: true }); + } + static _fromString(representation, options) { + let isNegative = false; + let sawSign = false; + let sawRadix = false; + let foundNonZero = false; + let significantDigits = 0; + let nDigitsRead = 0; + let nDigits = 0; + let radixPosition = 0; + let firstNonZero = 0; + const digits = [0]; + let nDigitsStored = 0; + let digitsInsert = 0; + let lastDigit = 0; + let exponent = 0; + let significandHigh = new Long(0, 0); + let significandLow = new Long(0, 0); + let biasedExponent = 0; + let index = 0; + if (representation.length >= 7000) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + const unsignedNumber = stringMatch[2]; + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + if (representation[index] === '+' || representation[index] === '-') { + sawSign = true; + isNegative = representation[index++] === '-'; + } + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + else if (representation[index] === 'N') { + return new Decimal128(NAN_BUFFER); + } + } + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < MAX_DIGITS) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + if (representation[index] === 'e' || representation[index] === 'E') { + const match = representation.substr(++index).match(EXPONENT_REGEX); + if (!match || !match[2]) + return new Decimal128(NAN_BUFFER); + exponent = parseInt(match[0], 10); + index = index + match[0].length; + } + if (representation[index]) + return new Decimal128(NAN_BUFFER); + if (!nDigitsStored) { + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (representation[firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix)] === '0') { + significantDigits = significantDigits - 1; + } + } + } + if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + while (exponent > EXPONENT_MAX) { + lastDigit = lastDigit + 1; + if (lastDigit >= MAX_DIGITS) { + if (significantDigits === 0) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + if (options.allowRounding) { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + nDigits = nDigits - 1; + } + else { + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (let i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + let dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + } + } + else { + break; + } + } + } + } + } + else { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0) { + if (significantDigits === 0) { + exponent = EXPONENT_MIN; + break; + } + invalidErr(representation, 'exponent underflow'); + } + if (nDigitsStored < nDigits) { + if (representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== '0' && + significantDigits !== 0) { + invalidErr(representation, 'inexact rounding'); + } + nDigits = nDigits - 1; + } + else { + if (digits[lastDigit] !== 0) { + invalidErr(representation, 'inexact rounding'); + } + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + invalidErr(representation, 'overflow'); + } + } + if (lastDigit + 1 < significantDigits) { + if (sawRadix) { + firstNonZero = firstNonZero + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + if (roundDigit !== 0) { + invalidErr(representation, 'inexact rounding'); + } + } + } + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit < 17) { + let dIdx = 0; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + let dIdx = 0; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + const buffer = ByteUtils.allocateUnsafe(16); + index = 0; + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + return new Decimal128(buffer); + } + toString() { + let biased_exponent; + let significand_digits = 0; + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) + significand[i] = 0; + let index = 0; + let is_zero = false; + let significand_msb; + let significand128 = { parts: [0, 0, 0, 0] }; + let j, k; + const string = []; + index = 0; + const buffer = this.bytes; + const low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + const high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + index = 0; + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + const combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + const exponent = biased_exponent - EXPONENT_BIAS; + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + significand[k * 9 + j] = least_digits % 10; + least_digits = Math.floor(least_digits / 10); + } + } + } + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + const scientific_exponent = significand_digits - 1 + exponent; + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) + string.push(`E+${exponent}`); + else if (exponent < 0) + string.push(`E${exponent}`); + return string.join(''); + } + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + string.push('E'); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } + else { + string.push(`${scientific_exponent}`); + } + } + else { + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } + else { + let radix_position = significand_digits + exponent; + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } + else { + string.push('0'); + } + string.push('.'); + while (radix_position++ < 0) { + string.push('0'); + } + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + return string.join(''); + } + toJSON() { + return { $numberDecimal: this.toString() }; + } + toExtendedJSON() { + return { $numberDecimal: this.toString() }; + } + static fromExtendedJSON(doc) { + return Decimal128.fromString(doc.$numberDecimal); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const d128string = inspect(this.toString(), options); + return `new Decimal128(${d128string})`; + } +} + +class Double extends BSONValue { + get _bsontype() { + return 'Double'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + static fromString(value) { + const coercedValue = Number(value); + if (value === 'NaN') + return new Double(NaN); + if (value === 'Infinity') + return new Double(Infinity); + if (value === '-Infinity') + return new Double(-Infinity); + if (!Number.isFinite(coercedValue)) { + throw new BSONError(`Input: ${value} is not representable as a Double`); + } + if (value.trim() !== value) { + throw new BSONError(`Input: '${value}' contains whitespace`); + } + if (value === '') { + throw new BSONError(`Input is an empty string`); + } + if (/[^-0-9.+eE]/.test(value)) { + throw new BSONError(`Input: '${value}' is not in decimal or exponential notation`); + } + return new Double(coercedValue); + } + valueOf() { + return this.value; + } + toJSON() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toExtendedJSON(options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: '-0.0' }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + static fromExtendedJSON(doc, options) { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Double(${inspect(this.value, options)})`; + } +} + +class Int32 extends BSONValue { + get _bsontype() { + return 'Int32'; + } + value; + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + static fromString(value) { + const cleanedValue = removeLeadingZerosAndExplicitPlus(value); + const coercedValue = Number(value); + if (BSON_INT32_MAX < coercedValue) { + throw new BSONError(`Input: '${value}' is larger than the maximum value for Int32`); + } + else if (BSON_INT32_MIN > coercedValue) { + throw new BSONError(`Input: '${value}' is smaller than the minimum value for Int32`); + } + else if (!Number.isSafeInteger(coercedValue)) { + throw new BSONError(`Input: '${value}' is not a safe integer`); + } + else if (coercedValue.toString() !== cleanedValue) { + throw new BSONError(`Input: '${value}' is not a valid Int32 string`); + } + return new Int32(coercedValue); + } + valueOf() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toJSON() { + return this.value; + } + toExtendedJSON(options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + } + static fromExtendedJSON(doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Int32(${inspect(this.value, options)})`; + } +} + +class MaxKey extends BSONValue { + get _bsontype() { + return 'MaxKey'; + } + toExtendedJSON() { + return { $maxKey: 1 }; + } + static fromExtendedJSON() { + return new MaxKey(); + } + inspect() { + return 'new MaxKey()'; + } +} + +class MinKey extends BSONValue { + get _bsontype() { + return 'MinKey'; + } + toExtendedJSON() { + return { $minKey: 1 }; + } + static fromExtendedJSON() { + return new MinKey(); + } + inspect() { + return 'new MinKey()'; + } +} + +const __idCache = new WeakMap(); +const byteToHex = []; +for (let n = 0; n < 256; n++) + byteToHex.push(n.toString(16).padStart(2, '0')); +const hexCharCodeToNibble = new Int8Array(103); +for (let c = 48; c <= 57; c++) + hexCharCodeToNibble[c] = c - 48; +for (let c = 65; c <= 70; c++) + hexCharCodeToNibble[c] = c - 55; +for (let c = 97; c <= 102; c++) + hexCharCodeToNibble[c] = c - 87; +class ObjectId extends BSONValue { + get _bsontype() { + return 'ObjectId'; + } + static index = 0; + static PROCESS_UNIQUE = null; + static resetState = () => { + this.index = Math.floor(Math.random() * 0x1000000); + this.PROCESS_UNIQUE = null; + }; + static { + this.resetState(); + const { startupSnapshot } = globalThis?.process?.getBuiltinModule?.('v8') ?? {}; + if (startupSnapshot?.isBuildingSnapshot?.()) { + startupSnapshot?.addDeserializeCallback?.(this.resetState); + } + } + static cacheHexString; + i0; + i1; + i2; + i3; + setFromBytes(b, offset = 0) { + this.i0 = (b[offset] << 16) | (b[offset + 1] << 8) | b[offset + 2]; + this.i1 = (b[offset + 3] << 16) | (b[offset + 4] << 8) | b[offset + 5]; + this.i2 = (b[offset + 6] << 16) | (b[offset + 7] << 8) | b[offset + 8]; + this.i3 = (b[offset + 9] << 16) | (b[offset + 10] << 8) | b[offset + 11]; + } + setFromHex(s) { + const t = hexCharCodeToNibble; + this.i0 = + (t[s.charCodeAt(0)] << 20) | + (t[s.charCodeAt(1)] << 16) | + (t[s.charCodeAt(2)] << 12) | + (t[s.charCodeAt(3)] << 8) | + (t[s.charCodeAt(4)] << 4) | + t[s.charCodeAt(5)]; + this.i1 = + (t[s.charCodeAt(6)] << 20) | + (t[s.charCodeAt(7)] << 16) | + (t[s.charCodeAt(8)] << 12) | + (t[s.charCodeAt(9)] << 8) | + (t[s.charCodeAt(10)] << 4) | + t[s.charCodeAt(11)]; + this.i2 = + (t[s.charCodeAt(12)] << 20) | + (t[s.charCodeAt(13)] << 16) | + (t[s.charCodeAt(14)] << 12) | + (t[s.charCodeAt(15)] << 8) | + (t[s.charCodeAt(16)] << 4) | + t[s.charCodeAt(17)]; + this.i3 = + (t[s.charCodeAt(18)] << 20) | + (t[s.charCodeAt(19)] << 16) | + (t[s.charCodeAt(20)] << 12) | + (t[s.charCodeAt(21)] << 8) | + (t[s.charCodeAt(22)] << 4) | + t[s.charCodeAt(23)]; + } + constructor(inputId, offset) { + super(); + if (typeof offset === 'number') { + this.setFromBytes(inputId, offset); + return; + } + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (ObjectId.is(inputId) && + typeof inputId.i0 === 'number' && + typeof inputId.i1 === 'number' && + typeof inputId.i2 === 'number' && + typeof inputId.i3 === 'number') { + this.i0 = inputId.i0; + this.i1 = inputId.i1; + this.i2 = inputId.i2; + this.i3 = inputId.i3; + return; + } + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = ByteUtils.fromHex(inputId.toHexString()); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + if (workingId == null) { + const time = Math.floor(Date.now() / 1000); + const inc = ObjectId.getInc(); + const pu = (ObjectId.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + this.i0 = (time >>> 8) & 0xffffff; + this.i1 = ((time & 0xff) << 16) | (pu[0] << 8) | pu[1]; + this.i2 = (pu[2] << 16) | (pu[3] << 8) | pu[4]; + this.i3 = inc & 0xffffff; + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + this.setFromBytes(workingId instanceof Uint8Array ? workingId : ByteUtils.toLocalBufferType(workingId)); + } + else if (typeof workingId === 'string') { + if (ObjectId.validateHexString(workingId)) { + this.setFromHex(workingId); + if (ObjectId.cacheHexString) { + __idCache.set(this, workingId); + } + } + else { + throw new BSONError('input must be a 24 character hex string, 12 byte Uint8Array, or an integer'); + } + } + else { + throw new BSONError('Argument passed in does not match the accepted types'); + } + } + get id() { + const b = ByteUtils.allocateUnsafe(12); + b[0] = (this.i0 >>> 16) & 0xff; + b[1] = (this.i0 >>> 8) & 0xff; + b[2] = this.i0 & 0xff; + b[3] = (this.i1 >>> 16) & 0xff; + b[4] = (this.i1 >>> 8) & 0xff; + b[5] = this.i1 & 0xff; + b[6] = (this.i2 >>> 16) & 0xff; + b[7] = (this.i2 >>> 8) & 0xff; + b[8] = this.i2 & 0xff; + b[9] = (this.i3 >>> 16) & 0xff; + b[10] = (this.i3 >>> 8) & 0xff; + b[11] = this.i3 & 0xff; + return b; + } + set id(value) { + const bytes = value instanceof Uint8Array ? value : ByteUtils.toLocalBufferType(value); + this.setFromBytes(bytes); + if (ObjectId.cacheHexString) { + __idCache.set(this, ByteUtils.toHex(bytes)); + } + } + static validateHexString(string) { + if (string?.length !== 24) + return false; + for (let i = 0; i < 24; i++) { + const char = string.charCodeAt(i); + if ((char >= 48 && char <= 57) || + (char >= 97 && char <= 102) || + (char >= 65 && char <= 70)) { + continue; + } + return false; + } + return true; + } + toHexString() { + if (ObjectId.cacheHexString) { + const __id = __idCache.get(this); + if (__id) + return __id; + } + const i0 = this.i0; + const i1 = this.i1; + const i2 = this.i2; + const i3 = this.i3; + const hexString = byteToHex[(i0 >>> 16) & 0xff] + + byteToHex[(i0 >>> 8) & 0xff] + + byteToHex[i0 & 0xff] + + byteToHex[(i1 >>> 16) & 0xff] + + byteToHex[(i1 >>> 8) & 0xff] + + byteToHex[i1 & 0xff] + + byteToHex[(i2 >>> 16) & 0xff] + + byteToHex[(i2 >>> 8) & 0xff] + + byteToHex[i2 & 0xff] + + byteToHex[(i3 >>> 16) & 0xff] + + byteToHex[(i3 >>> 8) & 0xff] + + byteToHex[i3 & 0xff]; + if (ObjectId.cacheHexString) { + __idCache.set(this, hexString); + } + return hexString; + } + static getInc() { + return (ObjectId.index = (ObjectId.index + 1) % 0x1000000); + } + static generate(time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + const inc = ObjectId.getInc(); + const buffer = ByteUtils.allocateUnsafe(12); + NumberUtils.setInt32BE(buffer, 0, time); + const PROCESS_UNIQUE = (this.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + buffer[11] = inc & 0xff; + buffer[10] = (inc >>> 8) & 0xff; + buffer[9] = (inc >>> 16) & 0xff; + return buffer; + } + toString(encoding) { + if (encoding === 'base64') + return ByteUtils.toBase64(this.id); + if (encoding === 'hex') + return this.toHexString(); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + static is(variable) { + return (variable != null && + typeof variable === 'object' && + '_bsontype' in variable && + variable._bsontype === 'ObjectId'); + } + equals(otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (ObjectId.is(otherId) && + typeof otherId.i0 === 'number' && + typeof otherId.i1 === 'number' && + typeof otherId.i2 === 'number' && + typeof otherId.i3 === 'number') { + return (this.i3 === otherId.i3 && + this.i0 === otherId.i0 && + this.i1 === otherId.i1 && + this.i2 === otherId.i2); + } + if (typeof otherId === 'string') { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'object' && typeof otherId.toHexString === 'function') { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + } + getTimestamp() { + const timestamp = new Date(); + const time = this.i0 * 0x100 + (this.i1 >>> 16); + timestamp.setTime(time * 1000); + return timestamp; + } + static createPk() { + return new ObjectId(); + } + serializeInto(uint8array, index) { + uint8array[index] = (this.i0 >>> 16) & 0xff; + uint8array[index + 1] = (this.i0 >>> 8) & 0xff; + uint8array[index + 2] = this.i0 & 0xff; + uint8array[index + 3] = (this.i1 >>> 16) & 0xff; + uint8array[index + 4] = (this.i1 >>> 8) & 0xff; + uint8array[index + 5] = this.i1 & 0xff; + uint8array[index + 6] = (this.i2 >>> 16) & 0xff; + uint8array[index + 7] = (this.i2 >>> 8) & 0xff; + uint8array[index + 8] = this.i2 & 0xff; + uint8array[index + 9] = (this.i3 >>> 16) & 0xff; + uint8array[index + 10] = (this.i3 >>> 8) & 0xff; + uint8array[index + 11] = this.i3 & 0xff; + return 12; + } + static createFromTime(time) { + const buffer = ByteUtils.allocate(12); + for (let i = 11; i >= 4; i--) + buffer[i] = 0; + NumberUtils.setInt32BE(buffer, 0, time); + return new ObjectId(buffer); + } + static createFromHexString(hexString) { + if (hexString?.length !== 24) { + throw new BSONError('hex string must be 24 characters'); + } + return new ObjectId(ByteUtils.fromHex(hexString)); + } + static createFromBase64(base64) { + if (base64?.length !== 16) { + throw new BSONError('base64 string must be 16 characters'); + } + return new ObjectId(ByteUtils.fromBase64(base64)); + } + static isValid(id) { + if (id == null) + return false; + if (typeof id === 'string') + return ObjectId.validateHexString(id); + try { + new ObjectId(id); + return true; + } + catch { + return false; + } + } + toExtendedJSON() { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + static fromExtendedJSON(doc) { + return new ObjectId(doc.$oid); + } + isCached() { + return ObjectId.cacheHexString && __idCache.has(this); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new ObjectId(${inspect(this.toHexString(), options)})`; + } +} + +function internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined) { + const objectStack = [ + { object, ignoreUndefined: ignoreUndefined ?? false, exit: false } + ]; + const path = new Set(); + let total = 0; + while (objectStack.length > 0) { + const frame = objectStack.pop(); + if (frame.exit) { + path.delete(frame.object); + continue; + } + const { object: obj, ignoreUndefined: frameIgnoreUndefined } = frame; + path.add(obj); + frame.exit = true; + objectStack.push(frame); + total += 5; + const isObjArray = Array.isArray(obj); + const isObjMap = !isObjArray && (obj instanceof Map || isMap(obj)); + let target = obj; + if (!isObjArray && !isObjMap && typeof obj?.toBSON === 'function') { + target = obj.toBSON(); + } + if (isObjArray) { + const array = target; + for (let i = 0; i < array.length; i++) { + total += calculateElementSize(i.toString(), array[i], serializeFunctions, true, frameIgnoreUndefined, objectStack, path); + } + } + else if (isObjMap) { + for (const [key, value] of target) { + total += calculateElementSize(key, value, serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + else { + for (const key of Object.keys(target)) { + total += calculateElementSize(key, target[key], serializeFunctions, false, frameIgnoreUndefined, objectStack, path); + } + } + } + return total; +} +function calculateElementSize(name, value, serializeFunctions = false, isArray = false, ignoreUndefined = false, objectStack, path) { + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return ByteUtils.utf8ByteLength(name) + 1 + 1; + return 0; + case 'boolean': + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 1); + case 'object': + if (value != null && + typeof value._bsontype === 'string' && + value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (value == null || value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') { + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value._bsontype === 'ObjectId') { + return ByteUtils.utf8ByteLength(name) + 1 + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 4 + 1) + value.byteLength; + } + else if (value._bsontype === 'Long' || + value._bsontype === 'Double' || + value._bsontype === 'Timestamp') { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + else if (value._bsontype === 'Decimal128') { + return ByteUtils.utf8ByteLength(name) + 1 + (16 + 1); + } + else if (value._bsontype === 'Int32') { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } + else if (value._bsontype === 'Code') { + if (value.scope != null && Object.keys(value.scope).length > 0) { + if (path.has(value.scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value.scope, ignoreUndefined, exit: false }); + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + else { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1); + } + } + else if (value._bsontype === 'Binary') { + const binary = value; + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1 + 4); + } + else { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1); + } + } + else if (value._bsontype === 'BSONSymbol') { + return (ByteUtils.utf8ByteLength(name) + 1 + ByteUtils.utf8ByteLength(value.value) + 4 + 1 + 1); + } + else if (value._bsontype === 'DBRef') { + const ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + if (value.db != null) { + ordered_values['$db'] = value.db; + } + objectStack.push({ object: ordered_values, ignoreUndefined: true, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + else if (value instanceof RegExp || isRegExp(value)) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.source) + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value._bsontype === 'BSONRegExp') { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.pattern) + + 1 + + ByteUtils.utf8ByteLength(value.options) + + 1); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value, ignoreUndefined, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + case 'function': + if (serializeFunctions) { + return (ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.toString()) + + 1); + } + return 0; + case 'bigint': + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + case 'symbol': + return 0; + default: + throw new BSONError(`Unrecognized JS type: ${typeof value}`); + } +} + +function alphabetize(str) { + return str.split('').sort().join(''); +} +class BSONRegExp extends BSONValue { + get _bsontype() { + return 'BSONRegExp'; + } + pattern; + options; + constructor(pattern, options) { + super(); + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`); + } + for (let i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + static parseOptions(options) { + return options ? options.split('').sort().join('') : ''; + } + toExtendedJSON(options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + static fromExtendedJSON(doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } + inspect(depth, options, inspect) { + const stylize = getStylizeFunction(options) ?? (v => v); + inspect ??= defaultInspect; + const pattern = stylize(inspect(this.pattern), 'regexp'); + const flags = stylize(inspect(this.options), 'regexp'); + return `new BSONRegExp(${pattern}, ${flags})`; + } +} + +class BSONSymbol extends BSONValue { + get _bsontype() { + return 'BSONSymbol'; + } + value; + constructor(value) { + super(); + this.value = value; + } + valueOf() { + return this.value; + } + toString() { + return this.value; + } + toJSON() { + return this.value; + } + toExtendedJSON() { + return { $symbol: this.value }; + } + static fromExtendedJSON(doc) { + return new BSONSymbol(doc.$symbol); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new BSONSymbol(${inspect(this.value, options)})`; + } +} + +const LongWithoutOverridesClass = Long; +class Timestamp extends LongWithoutOverridesClass { + get _bsontype() { + return 'Timestamp'; + } + get [bsonType]() { + return 'Timestamp'; + } + static MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + get i() { + return this.low >>> 0; + } + get t() { + return this.high >>> 0; + } + constructor(low) { + if (low == null) { + super(0, 0, true); + } + else if (typeof low === 'bigint') { + super(low, true); + } + else if (Long.isLong(low)) { + super(low.low, low.high, true); + } + else if (typeof low === 'object' && 't' in low && 'i' in low) { + if (typeof low.t !== 'number' && (typeof low.t !== 'object' || low.t._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide t as a number'); + } + if (typeof low.i !== 'number' && (typeof low.i !== 'object' || low.i._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide i as a number'); + } + const t = Number(low.t); + const i = Number(low.i); + if (t < 0 || Number.isNaN(t)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive t'); + } + if (i < 0 || Number.isNaN(i)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive i'); + } + if (t > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide t equal or less than uint32 max'); + } + if (i > 0xffff_ffff) { + throw new BSONError('Timestamp constructed from { t, i } must provide i equal or less than uint32 max'); + } + super(i, t, true); + } + else { + throw new BSONError('A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }'); + } + } + toJSON() { + return { + $timestamp: this.toString() + }; + } + static fromInt(value) { + return new Timestamp(Long.fromInt(value, true)); + } + static fromNumber(value) { + return new Timestamp(Long.fromNumber(value, true)); + } + static fromBits(lowBits, highBits) { + return new Timestamp({ i: lowBits, t: highBits }); + } + static fromString(str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + toExtendedJSON() { + return { $timestamp: { t: this.t, i: this.i } }; + } + static fromExtendedJSON(doc) { + const i = Long.isLong(doc.$timestamp.i) + ? doc.$timestamp.i.getLowBitsUnsigned() + : doc.$timestamp.i; + const t = Long.isLong(doc.$timestamp.t) + ? doc.$timestamp.t.getLowBitsUnsigned() + : doc.$timestamp.t; + return new Timestamp({ t, i }); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const t = inspect(this.t, options); + const i = inspect(this.i, options); + return `new Timestamp({ t: ${t}, i: ${i} })`; + } +} + +const JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +function internalDeserialize(buffer, options, isArray) { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + const size = NumberUtils.getInt32LE(buffer, index); + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + if (size + index > buffer.byteLength) { + throw new BSONError(`(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})`); + } + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + return deserializeObject(buffer, index, options, isArray); +} +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function assignValue(dest, name, value) { + if (name === '__proto__') { + Object.defineProperty(dest, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + dest[name] = value; + } +} +function toPotentialDbRef(doc) { + if (isDBRefLike(doc)) { + const { $ref, $id, $db, ...fields } = doc; + return new DBRef($ref, $id, $db, fields); + } + return doc; +} +function deserializeObject(buffer, index, options, isArray = false) { + options = { ...options }; + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + const raw = options['raw'] == null ? false : options['raw']; + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + const promoteBuffers = options.promoteBuffers ?? false; + const promoteLongs = options.promoteLongs ?? true; + const promoteValues = options.promoteValues ?? true; + const useBigInt64 = options.useBigInt64 ?? false; + if (useBigInt64 && !promoteValues) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + if (useBigInt64 && !promoteLongs) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + const validation = options.validation == null ? { utf8: true } : options.validation; + let globalUTFValidation = true; + let validationSetting; + let utf8KeysSet; + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + if (!globalUTFValidation) { + utf8KeysSet = new Set(); + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + const startIndex = index; + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + const size = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + const rootObject = isArray ? [] : {}; + let arrayIndex = 0; + let isPossibleDBRef = isArray ? false : null; + let currentFrame = null; + let currentDest = rootObject; + let currentIsArray = isArray; + while (true) { + const elementType = buffer[index++]; + if (elementType === 0) { + if (currentFrame) { + if (index === currentFrame.lastIndex) { + const completedFrame = currentFrame; + currentFrame = completedFrame.prev; + if (currentFrame === null) { + currentDest = rootObject; + currentIsArray = isArray; + } + else { + currentDest = currentFrame.holdingDocument; + currentIsArray = currentFrame.isArray; + } + let result = completedFrame.holdingDocument; + switch (completedFrame.elementType) { + case BSON_DATA_OBJECT: + if (completedFrame.isPossibleDBRef) { + result = toPotentialDbRef(result); + } + break; + case BSON_DATA_ARRAY: + break; + case BSON_DATA_CODE_W_SCOPE: + result = new Code(completedFrame.functionString, completedFrame.holdingDocument); + break; + default: + throw new BSONError('Unexpected element type in frame stack'); + } + assignValue(currentDest, completedFrame.propertyName, result); + continue; + } + else { + if (currentFrame.elementType === BSON_DATA_ARRAY) { + throw new BSONError('corrupted array bson'); + } + throw new BSONError('Bad BSON Document: object not properly terminated'); + } + } + else { + break; + } + } + let i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + const name = currentIsArray + ? currentFrame !== null + ? currentFrame.arrayIndex++ + : arrayIndex++ + : ByteUtils.toUTF8(buffer, index, i, false); + let shouldValidateKey; + if (currentFrame !== null) { + shouldValidateKey = currentFrame.validationSetting; + } + else if (globalUTFValidation || utf8KeysSet?.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (currentFrame !== null) { + if (currentFrame.isPossibleDBRef !== false && typeof name === 'string' && name[0] === '$') { + currentFrame.isPossibleDBRef = allowedDBRefKeys.test(name); + } + } + else if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + let value; + let isDeferredValue = false; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + value = new ObjectId(buffer, index); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(NumberUtils.getInt32LE(buffer, index)); + index += 4; + } + else if (elementType === BSON_DATA_INT) { + value = NumberUtils.getInt32LE(buffer, index); + index += 4; + } + else if (elementType === BSON_DATA_NUMBER) { + value = NumberUtils.getFloat64LE(buffer, index); + index += 8; + if (promoteValues === false) + value = new Double(value); + } + else if (elementType === BSON_DATA_DATE) { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + if (raw || (currentFrame?.raw ?? false)) { + value = buffer.subarray(index, index + objectSize); + index = index + objectSize; + } + else { + isDeferredValue = true; + const objectFrame = { + holdingDocument: {}, + elementType: BSON_DATA_OBJECT, + propertyName: name, + functionString: null, + lastIndex: index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = objectFrame; + currentDest = objectFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + } + else if (elementType === BSON_DATA_ARRAY) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded array length in bson'); + const stopIndex = index + objectSize; + const arrayRaw = !!(fieldsAsRaw && fieldsAsRaw[name]) || (currentFrame?.raw ?? false); + isDeferredValue = true; + const arrayFrame = { + holdingDocument: [], + elementType: BSON_DATA_ARRAY, + propertyName: name, + functionString: null, + lastIndex: stopIndex, + isArray: true, + arrayIndex: 0, + raw: arrayRaw, + isPossibleDBRef: false, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = arrayFrame; + currentDest = arrayFrame.holdingDocument; + currentIsArray = true; + index = index + 4; + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + if (useBigInt64) { + value = NumberUtils.getBigInt64LE(buffer, index); + index += 8; + } + else { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + const long = new Long(lowBits, highBits); + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + const bytes = ByteUtils.allocateUnsafe(16); + for (let i = 0; i < 16; i++) + bytes[i] = buffer[index + i]; + index = index + 16; + value = new Decimal128(bytes); + } + else if (elementType === BSON_DATA_BINARY) { + let binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + const totalBinarySize = binarySize; + const subType = buffer[index++]; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = ByteUtils.toLocalBufferType(buffer.subarray(index, index + binarySize)); + } + else { + value = new Binary(buffer.subarray(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) { + value = value.toUUID(); + } + } + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + const optionsArray = new Array(regExpOptions.length); + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + i = index; + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const symbol = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + value = new Timestamp({ + i: NumberUtils.getUint32LE(buffer, index), + t: NumberUtils.getUint32LE(buffer, index + 4) + }); + index += 8; + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = new Code(functionString); + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + const totalSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer, index); + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad scope document size in code_w_scope'); + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + isDeferredValue = true; + const scopeFrame = { + holdingDocument: {}, + elementType: BSON_DATA_CODE_W_SCOPE, + propertyName: name, + functionString: functionString, + lastIndex: _index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = scopeFrame; + currentDest = scopeFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + else if (elementType === BSON_DATA_DBPOINTER) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + const namespace = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const oidBuffer = ByteUtils.allocateUnsafe(12); + for (let i = 0; i < 12; i++) + oidBuffer[i] = buffer[index + i]; + const oid = new ObjectId(oidBuffer); + index = index + 12; + value = new DBRef(namespace, oid); + } + else { + throw new BSONError(`Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"`); + } + if (!isDeferredValue) { + assignValue(currentDest, name, value); + } + } + if (currentFrame !== null) { + throw new BSONError('corrupted bson, more objects expected based on the current document size'); + } + const object = rootObject; + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + if (!isPossibleDBRef) + return object; + return toPotentialDbRef(object); +} + +const regexp = /\x00/; +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +function serializeString(buffer, key, value, index) { + buffer[index++] = BSON_DATA_STRING; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value, index + 4); + NumberUtils.setInt32LE(buffer, index, size + 1); + index = index + 4 + size; + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index) { + const isNegativeZero = Object.is(value, -0); + const type = !isNegativeZero && + Number.isSafeInteger(value) && + value <= BSON_INT32_MAX && + value >= BSON_INT32_MIN + ? BSON_DATA_INT + : BSON_DATA_NUMBER; + buffer[index++] = type; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0x00; + if (type === BSON_DATA_INT) { + index += NumberUtils.setInt32LE(buffer, index, value); + } + else { + index += NumberUtils.setFloat64LE(buffer, index, value); + } + return index; +} +function serializeBigInt(buffer, key, value, index) { + buffer[index++] = BSON_DATA_LONG; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index += numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setBigInt64LE(buffer, index, value); + return index; +} +function serializeNull(buffer, key, _, index) { + buffer[index++] = BSON_DATA_NULL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BOOLEAN; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DATE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw new BSONError('value ' + value.source + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.source, index); + buffer[index++] = 0x00; + if (value.ignoreCase) + buffer[index++] = 0x69; + if (value.global) + buffer[index++] = 0x73; + if (value.multiline) + buffer[index++] = 0x6d; + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index) { + buffer[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.pattern.match(regexp) != null) { + throw new BSONError('pattern ' + value.pattern + ' must not contain null bytes'); + } + index = index + ByteUtils.encodeUTF8Into(buffer, value.pattern, index); + buffer[index++] = 0x00; + const sortedOptions = value.options.split('').sort().join(''); + index = index + ByteUtils.encodeUTF8Into(buffer, sortedOptions, index); + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index) { + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value[bsonType] === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index) { + buffer[index++] = BSON_DATA_OID; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += value.serializeInto(buffer, index); + return index; +} +function serializeBuffer(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = value.length; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = value[i]; + } + else { + buffer.set(value, index); + } + index = index + size; + return index; +} +function serializeDecimal128(buffer, key, value, index) { + buffer[index++] = BSON_DATA_DECIMAL128; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + for (let i = 0; i < 16; i++) + buffer[index + i] = value.bytes[i]; + return index + 16; +} +function serializeLong(buffer, key, value, index) { + buffer[index++] = + value[bsonType] === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + index += NumberUtils.setInt32LE(buffer, index, lowBits); + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} +function serializeInt32(buffer, key, value, index) { + value = value.valueOf(); + buffer[index++] = BSON_DATA_INT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setInt32LE(buffer, index, value); + return index; +} +function serializeDouble(buffer, key, value, index) { + buffer[index++] = BSON_DATA_NUMBER; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + index += NumberUtils.setFloat64LE(buffer, index, value.value); + return index; +} +function serializeFunction(buffer, key, value, index) { + buffer[index++] = BSON_DATA_CODE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const functionString = value.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function serializeBinary(buffer, key, value, index) { + buffer[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const data = value.buffer; + let size = value.position; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + index += NumberUtils.setInt32LE(buffer, index, size); + buffer[index++] = value.sub_type; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + index += NumberUtils.setInt32LE(buffer, index, size); + } + if (value.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(value); + } + if (size <= 16) { + for (let i = 0; i < size; i++) + buffer[index + i] = data[i]; + } + else { + buffer.set(data, index); + } + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index) { + buffer[index++] = BSON_DATA_SYMBOL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const size = ByteUtils.encodeUTF8Into(buffer, value.value, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + return index; +} +function makeFrame(sourceObject, objectSizeIndex, codeSizeIndex, prev, checkKeys, ignoreUndefined) { + if (Array.isArray(sourceObject)) { + return { + sourceObject, + isArray: true, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; + } + if (sourceObject instanceof Map || isMap(sourceObject)) { + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: sourceObject.entries(), + prev, + checkKeys, + ignoreUndefined + }; + } + let target = sourceObject; + if (typeof target?.toBSON === 'function') { + target = target.toBSON(); + if (target != null && typeof target !== 'object') { + throw new BSONError('toBSON function did not return an object'); + } + } + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: target, + keys: Object.keys(target), + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; +} +function serializeInto(buffer, object, checkKeys, startingIndex, serializeFunctions, ignoreUndefined, path) { + if (path == null) { + if (object == null) { + buffer[0] = 0x05; + buffer[1] = 0x00; + buffer[2] = 0x00; + buffer[3] = 0x00; + buffer[4] = 0x00; + return 5; + } + if (Array.isArray(object)) { + throw new BSONError('serialize does not support an array as the root input'); + } + if (typeof object !== 'object') { + throw new BSONError('serialize does not support non-object as the root input'); + } + else if ('_bsontype' in object && typeof object._bsontype === 'string') { + throw new BSONError(`BSON types cannot be serialized as a document`); + } + else if (isDate(object) || + isRegExp(object) || + isUint8Array(object) || + isAnyArrayBuffer(object)) { + throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`); + } + path = new Set(); + } + path.add(object); + let currentFrame = makeFrame(object, startingIndex, null, null, checkKeys, ignoreUndefined); + let index = startingIndex + 4; + while (currentFrame !== null) { + const frame = currentFrame; + let key; + let value; + if (frame.mapIterator !== null) { + const next = frame.mapIterator.next(); + if (next.done) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = next.value[0]; + value = next.value[1]; + } + else if (frame.keys !== null) { + if (frame.keyIndex >= frame.keys.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = frame.keys[frame.keyIndex++]; + value = frame.iterTarget[key]; + } + else { + const arr = frame.iterTarget; + if (frame.keyIndex >= arr.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + const i = frame.keyIndex++; + key = String(i); + value = arr[i]; + } + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + if (!frame.isArray && typeof key === 'string' && !(key[0] === '$' && ignoreKeys.has(key))) { + if (regexp.test(key)) { + throw new BSONError('key ' + key + ' must not contain null bytes'); + } + if (frame.checkKeys) { + if ('$' === key[0]) { + throw new BSONError('key ' + key + " must not start with '$'"); + } + else if (key.includes('.')) { + throw new BSONError('key ' + key + " must not contain '.'"); + } + } + } + const type = typeof value; + if (value === undefined) { + if (frame.isArray || frame.ignoreUndefined === false) { + index = serializeNull(buffer, key, value, index); + } + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + index = serializeBigInt(buffer, key, value, index); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (type === 'object' && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + const nestedIsArray = Array.isArray(value); + buffer[index++] = nestedIsArray ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const nestedStartIndex = index; + path.add(value); + currentFrame = makeFrame(value, nestedStartIndex, null, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + } + else if (type === 'object') { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + const tag = value[bsonType]; + if (tag === 'ObjectId') { + index = serializeObjectId(buffer, key, value, index); + } + else if (tag === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (tag === 'Long' || tag === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (tag === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (tag === 'Code') { + const codeValue = value; + if (codeValue.scope && typeof codeValue.scope === 'object') { + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const codeTotalSizeIndex = index; + index += 4; + const functionString = codeValue.code; + const codeSize = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, codeSize); + buffer[index + 4 + codeSize - 1] = 0; + index = index + codeSize + 4; + const scope = codeValue.scope; + if (path.has(scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + path.add(scope); + currentFrame = makeFrame(scope, index, codeTotalSizeIndex, frame, frame.checkKeys, frame.ignoreUndefined); + index += 4; + } + else { + buffer[index++] = BSON_DATA_CODE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const functionString = codeValue.code.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + } + } + else if (tag === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (tag === 'BSONSymbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (tag === 'DBRef') { + const dbref = value; + const orderedValues = Object.assign({ $ref: dbref.collection, $id: dbref.oid }, dbref.db != null ? { $db: dbref.db } : null, dbref.fields); + buffer[index++] = BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + path.add(orderedValues); + currentFrame = makeFrame(orderedValues, index, null, frame, false, true); + index += 4; + } + else if (tag === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (tag === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (tag === 'MinKey' || tag === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value._bsontype !== 'undefined') { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } + else if (type === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index); + } + } + return index; +} + +function isBSONType(value) { + return (value != null && + typeof value === 'object' && + '_bsontype' in value && + typeof value._bsontype === 'string'); +} +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +function deserializeValue(value, options = {}) { + if (typeof value === 'number') { + const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN; + const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN; + if (options.relaxed || options.legacy) { + return value; + } + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (in32BitRange) { + return new Int32(value); + } + if (in64BitRange) { + if (options.useBigInt64) { + return BigInt(value); + } + return Long.fromNumber(value); + } + } + return new Double(value); + } + if (value == null || typeof value !== 'object') + return value; + if (value.$undefined) + return null; + const keys = Object.keys(value).filter(k => k.startsWith('$') && value[k] != null); + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + else if (typeof d === 'bigint') + date.setTime(Number(d)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + return date; + } + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + if (v instanceof DBRef) + return v; + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid = false; + }); + if (valid) + return DBRef.fromExtendedJSON(v); + } + return value; +} +function serializeArray(array, options) { + return array.map((v, index) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + const isoStr = date.toISOString(); + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +function serializeValue(value, options) { + if (value instanceof Map || isMap(value)) { + const obj = Object.create(null); + for (const [k, v] of value) { + if (typeof k !== 'string') { + throw new BSONError('Can only serialize maps with string keys'); + } + obj[k] = v; + } + return serializeValue(obj, options); + } + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONError('Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/`); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return options.ignoreUndefined ? undefined : null; + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), inRange = dateNum > -1 && dateNum < 253402300800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return { $numberInt: value.toString() }; + } + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) { + return { $numberLong: value.toString() }; + } + } + return { $numberDouble: Object.is(value, -0) ? '-0.0' : value.toString() }; + } + if (typeof value === 'bigint') { + if (!options.relaxed) { + return { $numberLong: BigInt.asIntN(64, value).toString() }; + } + return Number(BigInt.asIntN(64, value)); + } + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +const BSON_TYPE_MAPPINGS = { + Binary: (o) => new Binary(o.value(), o.sub_type), + Code: (o) => new Code(o.code, o.scope), + DBRef: (o) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), + Decimal128: (o) => new Decimal128(o.bytes), + Double: (o) => new Double(o.value), + Int32: (o) => new Int32(o.value), + Long: (o) => Long.fromBits(o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectId: (o) => new ObjectId(o), + BSONRegExp: (o) => new BSONRegExp(o.pattern, o.options), + BSONSymbol: (o) => new BSONSymbol(o.value), + Timestamp: (o) => Timestamp.fromBits(o.low, o.high) +}; +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + const bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + const _doc = {}; + for (const name of Object.keys(doc)) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (doc != null && + typeof doc === 'object' && + typeof doc._bsontype === 'string' && + doc[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + else if (isBSONType(doc)) { + let outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +function parse(text, options) { + const ejsonOptions = { + useBigInt64: options?.useBigInt64 ?? false, + relaxed: options?.relaxed ?? true, + legacy: options?.legacy ?? false + }; + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}`); + } + return deserializeValue(value, ejsonOptions); + }); +} +function stringify(value, replacerOrOptions, spaceOrOptions, options) { + if (spaceOrOptions != null && typeof spaceOrOptions === 'object') { + options = spaceOrOptions; + spaceOrOptions = undefined; + } + if (replacerOrOptions != null && + typeof replacerOrOptions === 'object' && + !Array.isArray(replacerOrOptions)) { + options = replacerOrOptions; + replacerOrOptions = undefined; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacerOrOptions, spaceOrOptions); +} +function EJSONserialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); +} +function EJSONdeserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); +} +const EJSON = Object.create(null); +EJSON.parse = parse; +EJSON.stringify = stringify; +EJSON.serialize = EJSONserialize; +EJSON.deserialize = EJSONdeserialize; +Object.freeze(EJSON); + +const BSONElementType = { + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: 255, + maxKey: 127 +}; +function getSize(source, offset) { + try { + return NumberUtils.getNonnegativeInt32LE(source, offset); + } + catch (cause) { + throw new BSONOffsetError('BSON size cannot be negative', offset, { cause }); + } +} +function findNull(bytes, offset) { + let nullTerminatorOffset = offset; + for (; bytes[nullTerminatorOffset] !== 0x00; nullTerminatorOffset++) + ; + if (nullTerminatorOffset === bytes.length - 1) { + throw new BSONOffsetError('Null terminator not found', offset); + } + return nullTerminatorOffset; +} +function parseToElements(bytes, startOffset = 0) { + startOffset ??= 0; + if (bytes.length < 5) { + throw new BSONOffsetError(`Input must be at least 5 bytes, got ${bytes.length} bytes`, startOffset); + } + const documentSize = getSize(bytes, startOffset); + if (documentSize > bytes.length - startOffset) { + throw new BSONOffsetError(`Parsed documentSize (${documentSize} bytes) does not match input length (${bytes.length} bytes)`, startOffset); + } + if (bytes[startOffset + documentSize - 1] !== 0x00) { + throw new BSONOffsetError('BSON documents must end in 0x00', startOffset + documentSize); + } + const elements = []; + let offset = startOffset + 4; + while (offset <= documentSize + startOffset) { + const type = bytes[offset]; + offset += 1; + if (type === 0) { + if (offset - startOffset !== documentSize) { + throw new BSONOffsetError(`Invalid 0x00 type byte`, offset); + } + break; + } + const nameOffset = offset; + const nameLength = findNull(bytes, offset) - nameOffset; + offset += nameLength + 1; + let length; + if (type === BSONElementType.double || + type === BSONElementType.long || + type === BSONElementType.date || + type === BSONElementType.timestamp) { + length = 8; + } + else if (type === BSONElementType.int) { + length = 4; + } + else if (type === BSONElementType.objectId) { + length = 12; + } + else if (type === BSONElementType.decimal) { + length = 16; + } + else if (type === BSONElementType.bool) { + length = 1; + } + else if (type === BSONElementType.null || + type === BSONElementType.undefined || + type === BSONElementType.maxKey || + type === BSONElementType.minKey) { + length = 0; + } + else if (type === BSONElementType.regex) { + length = findNull(bytes, findNull(bytes, offset) + 1) + 1 - offset; + } + else if (type === BSONElementType.object || + type === BSONElementType.array || + type === BSONElementType.javascriptWithScope) { + length = getSize(bytes, offset); + } + else if (type === BSONElementType.string || + type === BSONElementType.binData || + type === BSONElementType.dbPointer || + type === BSONElementType.javascript || + type === BSONElementType.symbol) { + length = getSize(bytes, offset) + 4; + if (type === BSONElementType.binData) { + length += 1; + } + if (type === BSONElementType.dbPointer) { + length += 12; + } + } + else { + throw new BSONOffsetError(`Invalid 0x${type.toString(16).padStart(2, '0')} type byte`, offset); + } + if (length > documentSize) { + throw new BSONOffsetError('value reports length larger than document', offset); + } + elements.push([type, nameOffset, nameLength, offset, length]); + offset += length; + } + return elements; +} + +const onDemand = Object.create(null); +onDemand.parseToElements = parseToElements; +onDemand.ByteUtils = ByteUtils; +onDemand.NumberUtils = NumberUtils; +Object.freeze(onDemand); + +const MAXSIZE = 1024 * 1024 * 17; +let buffer = ByteUtils.allocate(MAXSIZE); +function setInternalBufferSize(size) { + if (buffer.length < size) { + buffer = ByteUtils.allocate(size); + } +} +function serialize(object, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + if (buffer.length < minInternalBufferSize) { + buffer = ByteUtils.allocate(minInternalBufferSize); + } + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + const finishedBuffer = ByteUtils.allocateUnsafe(serializationIndex); + finishedBuffer.set(buffer.subarray(0, serializationIndex), 0); + return finishedBuffer; +} +function serializeWithBufferAndIndex(object, finalBuffer, options = {}) { + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, serializeFunctions, ignoreUndefined, null); + finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex); + return startIndex + serializationIndex - 1; +} +function deserialize(buffer, options = {}) { + return internalDeserialize(ByteUtils.toLocalBufferType(buffer), options); +} +function calculateObjectSize(object, options = {}) { + options = options || {}; + const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + const internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + const bufferData = ByteUtils.toLocalBufferType(data); + let index = startIndex; + for (let i = 0; i < numberOfDocuments; i++) { + const size = NumberUtils.getInt32LE(bufferData, index); + internalOptions.index = index; + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + index = index + size; + } + return index; +} + +var bson = /*#__PURE__*/Object.freeze({ + __proto__: null, + BSONError: BSONError, + BSONOffsetError: BSONOffsetError, + BSONRegExp: BSONRegExp, + BSONRuntimeError: BSONRuntimeError, + BSONSymbol: BSONSymbol, + BSONType: BSONType, + BSONValue: BSONValue, + BSONVersionError: BSONVersionError, + Binary: Binary, + ByteUtils: ByteUtils, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + EJSON: EJSON, + Int32: Int32, + Long: Long, + MaxKey: MaxKey, + MinKey: MinKey, + NumberUtils: NumberUtils, + ObjectId: ObjectId, + Timestamp: Timestamp, + UUID: UUID, + bsonType: bsonType, + calculateObjectSize: calculateObjectSize, + deserialize: deserialize, + deserializeStream: deserializeStream, + onDemand: onDemand, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + setInternalBufferSize: setInternalBufferSize +}); + +exports.BSON = bson; +exports.BSONError = BSONError; +exports.BSONOffsetError = BSONOffsetError; +exports.BSONRegExp = BSONRegExp; +exports.BSONRuntimeError = BSONRuntimeError; +exports.BSONSymbol = BSONSymbol; +exports.BSONType = BSONType; +exports.BSONValue = BSONValue; +exports.BSONVersionError = BSONVersionError; +exports.Binary = Binary; +exports.ByteUtils = ByteUtils; +exports.Code = Code; +exports.DBRef = DBRef; +exports.Decimal128 = Decimal128; +exports.Double = Double; +exports.EJSON = EJSON; +exports.Int32 = Int32; +exports.Long = Long; +exports.MaxKey = MaxKey; +exports.MinKey = MinKey; +exports.NumberUtils = NumberUtils; +exports.ObjectId = ObjectId; +exports.Timestamp = Timestamp; +exports.UUID = UUID; +exports.bsonType = bsonType; +exports.calculateObjectSize = calculateObjectSize; +exports.deserialize = deserialize; +exports.deserializeStream = deserializeStream; +exports.onDemand = onDemand; +exports.serialize = serialize; +exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; +exports.setInternalBufferSize = setInternalBufferSize; +//# sourceMappingURL=bson.rn.cjs.map diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.rn.cjs.map b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.rn.cjs.map new file mode 100644 index 00000000..1720c711 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/lib/bson.rn.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.rn.cjs","sources":["../src/parser/utils.ts","../src/constants.ts","../src/error.ts","../src/parse_utf8.ts","../src/utils/latin.ts","../src/utils/node_byte_utils.ts","../src/utils/web_byte_utils.ts","../src/utils/byte_utils.ts","../src/bson_value.ts","../src/utils/number_utils.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/utils/string_utils.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/parser/calculate_size.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/extended_json.ts","../src/parser/on_demand/parse_to_elements.ts","../src/parser/on_demand/index.ts","../src/bson.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["StringUtils.validateStringCharacters","StringUtils.removeLeadingZerosAndExplicitPlus","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","constants.BSON_VERSION_SYMBOL","constants.BSON_MAJOR_VERSION","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT"],"mappings":";;AAAA,MAAM,uCAAuC,GAAG,CAAC,MAAK;IAIpD,MAAM,CAAC,GAAG,MAAM,CAAC,wBAAwB,CACvC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAC3C,MAAM,CAAC,WAAW,CAClB,CAAC,GAAI;IAEP,OAAO,CAAC,KAAc,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1C,CAAC,GAAG;AAEE,SAAU,YAAY,CAAC,KAAc,EAAA;AACzC,IAAA,OAAO,uCAAuC,CAAC,KAAK,CAAC,KAAK,YAAY;AACxE;AAEM,SAAU,gBAAgB,CAAC,KAAc,EAAA;AA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at end of file diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/package.json b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/package.json new file mode 100644 index 00000000..016abbff --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/package.json @@ -0,0 +1,118 @@ +{ + "name": "bson", + "description": "A bson parser for node.js and the browser", + "keywords": [ + "mongodb", + "bson", + "parser" + ], + "files": [ + "lib", + "src", + "bson.d.ts", + "etc/prepare.js", + "vendor" + ], + "types": "bson.d.ts", + "version": "7.3.3", + "author": { + "name": "The MongoDB NodeJS Team", + "email": "dbx-node@mongodb.com" + }, + "license": "Apache-2.0", + "contributors": [], + "repository": "mongodb/js-bson", + "bugs": { + "url": "https://jira.mongodb.org/projects/NODE/issues/" + }, + "devDependencies": { + "@istanbuljs/nyc-config-typescript": "^1.0.2", + "@microsoft/api-extractor": "^7.52.5", + "@rollup/plugin-node-resolve": "^16.0.1", + "@rollup/plugin-typescript": "^12.1.2", + "@types/chai": "^4.3.17", + "@types/mocha": "^10.0.7", + "@types/node": "^24.2.1", + "@types/sinon": "^21.0.0", + "@types/sinon-chai": "^3.2.12", + "@typescript-eslint/eslint-plugin": "^8.31.1", + "@typescript-eslint/parser": "^8.31.1", + "benchmark": "^2.1.4", + "chai": "^4.4.1", + "chalk": "^5.3.0", + "dbx-js-tools": "github:mongodb-js/dbx-js-tools#main", + "eslint": "^9.33.0", + "eslint-config-prettier": "^10.1.2", + "eslint-plugin-prettier": "^5.2.6", + "eslint-plugin-tsdoc": "^0.5.2", + "magic-string": "^0.30.11", + "mocha": "^11.7.1", + "node-fetch": "^3.3.2", + "nyc": "^18.0.0", + "prettier": "^3.5.3", + "rollup": "^4.40.1", + "sinon": "^21.0.0", + "sinon-chai": "^3.7.0", + "source-map-support": "^0.5.21", + "tar": "^7.4.3", + "ts-node": "^10.9.2", + "tsd": "^0.33.0", + "typescript": "^5.8.3", + "typescript-cached-transpile": "0.0.6", + "uuid": "^14.0.2" + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "strict": true, + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node" + } + }, + "config": { + "native": false + }, + "main": "./lib/bson.cjs", + "module": "./lib/bson.node.mjs", + "exports": { + "browser": { + "types": "./bson.d.ts", + "default": "./lib/bson.mjs" + }, + "react-native": "./lib/bson.rn.cjs", + "default": { + "types": "./bson.d.ts", + "import": "./lib/bson.node.mjs", + "require": "./lib/bson.cjs" + } + }, + "compass:exports": { + "import": "./lib/bson.cjs", + "require": "./lib/bson.cjs" + }, + "engines": { + "node": ">=20.19.0" + }, + "scripts": { + "pretest": "npm run build", + "test": "npm run check:node && npm run check:web", + "check:node": "WEB=false mocha test/node", + "check:tsd": "npm run build:dts && tsd", + "check:web": "WEB=true mocha test/node", + "check:granular-bench": "npm run build:bench && npm run check:baseline-bench && node ./test/bench/etc/run_granular_benchmarks.js", + "check:spec-bench": "npm run build:bench && npm run check:baseline-bench && node ./test/bench/lib/spec/bsonBench.js", + "check:custom-bench": "npm run build && npm run check:baseline-bench && node ./test/bench/custom/main.mjs", + "check:baseline-bench": "node ./test/bench/etc/cpuBaseline.js", + "build:bench": "cd test/bench && npx tsc", + "build:ts": "node ./node_modules/typescript/bin/tsc", + "build:dts": "npm run build:ts && api-extractor run --typescript-compiler-folder node_modules/typescript --local && node etc/clean_definition_files.cjs", + "build:bundle": "rollup -c rollup.config.mjs", + "build": "npm run build:dts && npm run build:bundle", + "check:lint": "ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --ext '.js,.ts' --max-warnings=0 src test && npm run build:dts && npm run check:tsd", + "format": "ESLINT_USE_FLAT_CONFIG=false eslint --ext '.js,.ts' src test --fix", + "check:coverage": "nyc --check-coverage npm run check:node", + "prepare": "node etc/prepare.js", + "release": "standard-version -i HISTORY.md" + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/binary.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/binary.ts new file mode 100644 index 00000000..06470c40 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/binary.ts @@ -0,0 +1,751 @@ +import { type InspectFn, defaultInspect, isAnyArrayBuffer, isUint8Array } from './parser/utils'; +import type { EJSONOptions } from './extended_json'; +import { BSONError } from './error'; +import { BSON_BINARY_SUBTYPE_UUID_NEW } from './constants'; +import { ByteUtils } from './utils/byte_utils'; +import { BSONValue } from './bson_value'; +import { NumberUtils } from './utils/number_utils'; + +/** @public */ +export type BinarySequence = Uint8Array | number[]; + +/** @public */ +export interface BinaryExtendedLegacy { + $type: string; + $binary: string; +} + +/** @public */ +export interface BinaryExtended { + $binary: { + subType: string; + base64: string; + }; +} + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +export class Binary extends BSONValue { + get _bsontype(): 'Binary' { + return 'Binary'; + } + + /** + * Binary default subtype + * @internal + */ + private static readonly BSON_BINARY_SUBTYPE_DEFAULT = 0; + + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ + static readonly SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + static readonly SUBTYPE_FUNCTION = 1; + /** + * Legacy default BSON Binary type + * @deprecated BSON Binary subtype 2 is deprecated in the BSON specification + */ + static readonly SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + static readonly SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + static readonly SUBTYPE_UUID = 4; + /** MD5 BSON type */ + static readonly SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + static readonly SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + static readonly SUBTYPE_COLUMN = 7; + /** Sensitive BSON type */ + static readonly SUBTYPE_SENSITIVE = 8; + /** Vector BSON type */ + static readonly SUBTYPE_VECTOR = 9; + /** User BSON type */ + static readonly SUBTYPE_USER_DEFINED = 128; + + /** datatype of a Binary Vector (subtype: 9) */ + static readonly VECTOR_TYPE = Object.freeze({ + Int8: 0x03, + Float32: 0x27, + PackedBit: 0x10 + } as const); + + /** + * The bytes of the Binary value. + * + * The format of a Binary value in BSON is defined as: + * ```txt + * binary ::= int32 subtype (byte*) + * ``` + * + * This `buffer` is the "(byte*)" segment. + * + * Unless the value is subtype 2, then deserialize will read the first 4 bytes as an int32 and set this to the remaining bytes. + * + * ```txt + * binary ::= int32 unsigned_byte(2) int32 (byte*) + * ``` + * + * @see https://bsonspec.org/spec.html + */ + public buffer: Uint8Array; + /** + * The binary subtype. + * + * Current defined values are: + * + * - `unsigned_byte(0)` Generic binary subtype + * - `unsigned_byte(1)` Function + * - `unsigned_byte(2)` Binary (Deprecated) + * - `unsigned_byte(3)` UUID (Deprecated) + * - `unsigned_byte(4)` UUID + * - `unsigned_byte(5)` MD5 + * - `unsigned_byte(6)` Encrypted BSON value + * - `unsigned_byte(7)` Compressed BSON column + * - `unsigned_byte(8)` Sensitive + * - `unsigned_byte(9)` Vector + * - `unsigned_byte(128)` - `unsigned_byte(255)` User defined + */ + public sub_type: number; + /** + * The Binary's `buffer` can be larger than the Binary's content. + * This property is used to determine where the content ends in the buffer. + */ + public position: number; + + /** + * Create a new Binary instance. + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + constructor(buffer?: BinarySequence, subType?: number) { + super(); + if ( + !(buffer == null) && + typeof buffer === 'string' && + !ArrayBuffer.isView(buffer) && + !isAnyArrayBuffer(buffer) && + !Array.isArray(buffer) + ) { + throw new BSONError('Binary can only be constructed from Uint8Array or number[]'); + } + + this.sub_type = (subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT) & 0xff; + + if (buffer == null) { + // create an empty binary buffer + this.buffer = ByteUtils.allocate(Binary.BUFFER_SIZE); + this.position = 0; + } else { + this.buffer = Array.isArray(buffer) + ? ByteUtils.fromNumberArray(buffer) + : ByteUtils.toLocalBufferType(buffer); + this.position = this.buffer.byteLength; + } + } + + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + put(byteValue: string | number | Uint8Array | number[]): void { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONError('only accepts single character String'); + } else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONError('only accepts single character Uint8Array or Array'); + + // Decode the byte value once + let decodedByte: number; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } else { + decodedByte = byteValue[0]; + } + + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONError('only accepts number in a valid unsigned byte range 0-255'); + } + + if (this.buffer.byteLength > this.position) { + this.buffer[this.position++] = decodedByte; + } else { + const newSpace = ByteUtils.allocate(Binary.BUFFER_SIZE + this.buffer.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + this.buffer[this.position++] = decodedByte; + } + } + + /** + * Writes a buffer to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + write(sequence: BinarySequence, offset: number): void { + offset = typeof offset === 'number' ? offset : this.position; + + // If the buffer is to small let's extend the buffer + if (this.buffer.byteLength < offset + sequence.length) { + const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length); + newSpace.set(this.buffer, 0); + + // Assign the new buffer + this.buffer = newSpace; + } + + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } else if (typeof sequence === 'string') { + throw new BSONError('input cannot be string'); + } + } + + /** + * Returns a view of **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + read(position: number, length: number): Uint8Array { + length = length && length > 0 ? length : this.position; + const end = position + length; + return this.buffer.subarray(position, end > this.position ? this.position : end); + } + + /** returns a view of the binary value as a Uint8Array */ + value(): Uint8Array { + // Optimize to serialize for the situation where the data == size of buffer + return this.buffer.length === this.position + ? this.buffer + : this.buffer.subarray(0, this.position); + } + + /** the length of the binary sequence */ + length(): number { + return this.position; + } + + toJSON(): string { + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + } + + toString(encoding?: 'hex' | 'base64' | 'utf8' | 'utf-8'): string { + if (encoding === 'hex') return ByteUtils.toHex(this.buffer.subarray(0, this.position)); + if (encoding === 'base64') return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + if (encoding === 'utf8' || encoding === 'utf-8') + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BinaryExtendedLegacy | BinaryExtended { + options = options || {}; + + if (this.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(this); + } + + const base64String = ByteUtils.toBase64(this.buffer); + + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + + toUUID(): UUID { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.subarray(0, this.position)); + } + + throw new BSONError( + `Binary sub_type "${this.sub_type}" (${typeof this.sub_type}) is not supported for converting to UUID. Only 0x${Binary.SUBTYPE_UUID.toString(16).padStart(2, '0')} is currently supported.` + ); + } + + /** Creates an Binary instance from a hex digit string */ + static createFromHexString(hex: string, subType?: number): Binary { + return new Binary(ByteUtils.fromHex(hex), subType); + } + + /** Creates an Binary instance from a base64 string */ + static createFromBase64(base64: string, subType?: number): Binary { + return new Binary(ByteUtils.fromBase64(base64), subType); + } + + /** @internal */ + static fromExtendedJSON( + doc: BinaryExtendedLegacy | BinaryExtended | UUIDExtended, + options?: EJSONOptions + ): Binary { + options = options || {}; + let data: Uint8Array | undefined; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary); + } else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = ByteUtils.fromBase64(doc.$binary.base64); + } + } + } else if ('$uuid' in doc) { + type = 4; + data = UUID.bytesFromString(doc.$uuid); + } + if (!data) { + throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + const base64Arg = inspect(base64, options); + const subTypeArg = inspect(this.sub_type, options); + return `Binary.createFromBase64(${base64Arg}, ${subTypeArg})`; + } + + /** + * If this Binary represents a Int8 Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.Int8`), + * returns a copy of the bytes in a new Int8Array. + * + * If the Binary is not a Vector, or the datatype is not Int8, an error is thrown. + */ + public toInt8Array(): Int8Array { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + + if (this.buffer[0] !== Binary.VECTOR_TYPE.Int8) { + throw new BSONError('Binary datatype field is not Int8'); + } + + validateBinaryVector(this); + + return new Int8Array( + this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position) + ); + } + + /** + * If this Binary represents a Float32 Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.Float32`), + * returns a copy of the bytes in a new Float32Array. + * + * If the Binary is not a Vector, or the datatype is not Float32, an error is thrown. + */ + public toFloat32Array(): Float32Array { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + + if (this.buffer[0] !== Binary.VECTOR_TYPE.Float32) { + throw new BSONError('Binary datatype field is not Float32'); + } + + validateBinaryVector(this); + + const floatBytes = new Uint8Array( + this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position) + ); + + if (NumberUtils.isBigEndian) ByteUtils.swap32(floatBytes); + + return new Float32Array(floatBytes.buffer); + } + + /** + * If this Binary represents packed bit Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.PackedBit`), + * returns a copy of the bytes that are packed bits. + * + * Use `toBits` to get the unpacked bits. + * + * If the Binary is not a Vector, or the datatype is not PackedBit, an error is thrown. + */ + public toPackedBits(): Uint8Array { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + + validateBinaryVector(this); + + return new Uint8Array( + this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position) + ); + } + + /** + * If this Binary represents a Packed bit Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.PackedBit`), + * returns a copy of the bit unpacked into a new Int8Array. + * + * Use `toPackedBits` to get the bits still in packed form. + * + * If the Binary is not a Vector, or the datatype is not PackedBit, an error is thrown. + */ + public toBits(): Int8Array { + if (this.sub_type !== Binary.SUBTYPE_VECTOR) { + throw new BSONError('Binary sub_type is not Vector'); + } + + if (this.buffer[0] !== Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError('Binary datatype field is not packed bit'); + } + + validateBinaryVector(this); + + const byteCount = this.length() - 2; + const bitCount = byteCount * 8 - this.buffer[1]; + const bits = new Int8Array(bitCount); + + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = (bitOffset / 8) | 0; + const byte = this.buffer[byteOffset + 2]; + const shift = 7 - (bitOffset % 8); + const bit = (byte >> shift) & 1; + bits[bitOffset] = bit; + } + + return bits; + } + + /** + * Constructs a Binary representing an Int8 Vector. + * @param array - The array to store as a view on the Binary class + */ + public static fromInt8Array(array: Int8Array): Binary { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.Int8; + buffer[1] = 0; + const intBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + buffer.set(intBytes, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + + /** Constructs a Binary representing an Float32 Vector. */ + public static fromFloat32Array(array: Float32Array): Binary { + const binaryBytes = ByteUtils.allocate(array.byteLength + 2); + binaryBytes[0] = Binary.VECTOR_TYPE.Float32; + binaryBytes[1] = 0; + + const floatBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + binaryBytes.set(floatBytes, 2); + + if (NumberUtils.isBigEndian) ByteUtils.swap32(new Uint8Array(binaryBytes.buffer, 2)); + + const bin = new this(binaryBytes, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + + /** + * Constructs a Binary representing a packed bit Vector. + * + * Use `fromBits` to pack an array of 1s and 0s. + */ + public static fromPackedBits(array: Uint8Array, padding = 0): Binary { + const buffer = ByteUtils.allocate(array.byteLength + 2); + buffer[0] = Binary.VECTOR_TYPE.PackedBit; + buffer[1] = padding; + buffer.set(array, 2); + const bin = new this(buffer, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + + /** + * Constructs a Binary representing an Packed Bit Vector. + * @param array - The array of 1s and 0s to pack into the Binary instance + */ + public static fromBits(bits: ArrayLike): Binary { + const byteLength = (bits.length + 7) >>> 3; // ceil(bits.length / 8) + const bytes = new Uint8Array(byteLength + 2); + bytes[0] = Binary.VECTOR_TYPE.PackedBit; + + const remainder = bits.length % 8; + bytes[1] = remainder === 0 ? 0 : 8 - remainder; + + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset >>> 3; // floor(bitOffset / 8) + const bit = bits[bitOffset]; + + if (bit !== 0 && bit !== 1) { + throw new BSONError( + `Invalid bit value at ${bitOffset}: must be 0 or 1, found ${bits[bitOffset]}` + ); + } + + if (bit === 0) continue; + + const shift = 7 - (bitOffset % 8); + bytes[byteOffset + 2] |= bit << shift; + } + + return new this(bytes, Binary.SUBTYPE_VECTOR); + } +} + +export function validateBinaryVector(vector: Binary): void { + if (vector.sub_type !== Binary.SUBTYPE_VECTOR) return; + + const size = vector.position; + + // NOTE: Validation is only applied to **KNOWN** vector types + // If a new datatype is introduced, a future version of the library will need to add validation + const datatype = vector.buffer[0]; + + // NOTE: We do not enable noUncheckedIndexedAccess so TS believes this is always number + // a Binary vector may be empty, in which case the padding is undefined + // this possible value is tolerable for our validation checks + const padding: number | undefined = vector.buffer[1]; + + if ( + (datatype === Binary.VECTOR_TYPE.Float32 || datatype === Binary.VECTOR_TYPE.Int8) && + padding !== 0 + ) { + throw new BSONError('Invalid Vector: padding must be zero for int8 and float32 vectors'); + } + + if (datatype === Binary.VECTOR_TYPE.Float32) { + if (size !== 0 && size - 2 !== 0 && (size - 2) % 4 !== 0) { + throw new BSONError('Invalid Vector: Float32 vector must contain a multiple of 4 bytes'); + } + } + + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding !== 0 && size === 2) { + throw new BSONError( + 'Invalid Vector: padding must be zero for packed bit vectors that are empty' + ); + } + + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding > 7) { + throw new BSONError( + `Invalid Vector: padding must be a value between 0 and 7. found: ${padding}` + ); + } +} + +/** @public */ +export type UUIDExtended = { + $uuid: string; +}; + +const UUID_BYTE_LENGTH = 16; +const UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i; +const UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i; + +/** + * A class representation of the BSON UUID type. + * @public + */ +export class UUID extends Binary { + /** + * Create a UUID type + * + * When the argument to the constructor is omitted a random v4 UUID will be generated. + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + constructor(input?: string | Uint8Array | UUID) { + let bytes: Uint8Array; + if (input == null) { + bytes = UUID.generate(); + } else if (input instanceof UUID) { + bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer)); + } else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ByteUtils.toLocalBufferType(input); + } else if (typeof input === 'string') { + bytes = UUID.bytesFromString(input); + } else { + throw new BSONError( + 'Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).' + ); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + } + + /** + * The UUID bytes + * @readonly + */ + get id(): Uint8Array { + return this.buffer; + } + + set id(value: Uint8Array) { + this.buffer = value; + } + + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + */ + toHexString(includeDashes = true): string { + if (includeDashes) { + return [ + ByteUtils.toHex(this.buffer.subarray(0, 4)), + ByteUtils.toHex(this.buffer.subarray(4, 6)), + ByteUtils.toHex(this.buffer.subarray(6, 8)), + ByteUtils.toHex(this.buffer.subarray(8, 10)), + ByteUtils.toHex(this.buffer.subarray(10, 16)) + ].join('-'); + } + return ByteUtils.toHex(this.buffer); + } + + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + toString(encoding?: 'hex' | 'base64'): string { + if (encoding === 'hex') return ByteUtils.toHex(this.id); + if (encoding === 'base64') return ByteUtils.toBase64(this.id); + return this.toHexString(); + } + + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + toJSON(): string { + return this.toHexString(); + } + + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + equals(otherId: string | Uint8Array | UUID): boolean { + if (!otherId) { + return false; + } + + if (otherId instanceof UUID) { + return ByteUtils.equals(otherId.id, this.id); + } + + try { + return ByteUtils.equals(new UUID(otherId).id, this.id); + } catch { + return false; + } + } + + /** + * Creates a Binary instance from the current UUID. + */ + toBinary(): Binary { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + + /** + * Generates a populated buffer containing a v4 uuid + */ + static generate(): Uint8Array { + const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + + return bytes; + } + + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + static isValid(input: string | Uint8Array | UUID | Binary): boolean { + if (!input) { + return false; + } + + if (typeof input === 'string') { + return UUID.isValidUUIDString(input); + } + + if (isUint8Array(input)) { + return input.byteLength === UUID_BYTE_LENGTH; + } + + return ( + input._bsontype === 'Binary' && + input.sub_type === this.SUBTYPE_UUID && + input.buffer.byteLength === 16 + ); + } + + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + static override createFromHexString(hexString: string): UUID { + const buffer = UUID.bytesFromString(hexString); + return new UUID(buffer); + } + + /** Creates an UUID from a base64 string representation of an UUID. */ + static override createFromBase64(base64: string): UUID { + return new UUID(ByteUtils.fromBase64(base64)); + } + + /** @internal */ + static bytesFromString(representation: string) { + if (!UUID.isValidUUIDString(representation)) { + throw new BSONError( + 'UUID string representation must be 32 hex digits or canonical hyphenated representation' + ); + } + return ByteUtils.fromHex(representation.replace(/-/g, '')); + } + + /** + * @internal + * + * Validates a string to be a hex digit sequence with or without dashes. + * The canonical hyphenated representation of a uuid is hex in 8-4-4-4-12 groups. + */ + static isValidUUIDString(representation: string) { + return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation); + } + + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * + */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + return `new UUID(${inspect(this.toHexString(), options)})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson.ts new file mode 100644 index 00000000..20fd7940 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson.ts @@ -0,0 +1,253 @@ +import { Binary, UUID } from './binary'; +import { Code } from './code'; +import { DBRef } from './db_ref'; +import { Decimal128 } from './decimal128'; +import { Double } from './double'; +import { Int32 } from './int_32'; +import { Long } from './long'; +import { MaxKey } from './max_key'; +import { MinKey } from './min_key'; +import { ObjectId } from './objectid'; +import { internalCalculateObjectSize } from './parser/calculate_size'; +// Parts of the parser +import { internalDeserialize, type DeserializeOptions } from './parser/deserializer'; +import { serializeInto, type SerializeOptions } from './parser/serializer'; +import { BSONRegExp } from './regexp'; +import { BSONSymbol } from './symbol'; +import { Timestamp } from './timestamp'; +import { ByteUtils } from './utils/byte_utils'; +import { NumberUtils } from './utils/number_utils'; +export type { UUIDExtended, BinaryExtended, BinaryExtendedLegacy, BinarySequence } from './binary'; +export type { CodeExtended } from './code'; +export type { DBRefLike } from './db_ref'; +export type { Decimal128Extended } from './decimal128'; +export type { DoubleExtended } from './double'; +export type { + EJSONOptions, + EJSONOptionsBase, + EJSONSerializeOptions, + EJSONParseOptions +} from './extended_json'; +export type { Int32Extended } from './int_32'; +export type { LongExtended } from './long'; +export type { MaxKeyExtended } from './max_key'; +export type { MinKeyExtended } from './min_key'; +export type { ObjectIdExtended, ObjectIdLike } from './objectid'; +export type { BSONRegExpExtended, BSONRegExpExtendedLegacy } from './regexp'; +export type { BSONSymbolExtended } from './symbol'; +export type { LongWithoutOverrides, TimestampExtended, TimestampOverrides } from './timestamp'; +export type { LongWithoutOverridesClass } from './timestamp'; +export type { SerializeOptions, DeserializeOptions }; + +export { + Code, + BSONSymbol, + DBRef, + Binary, + ObjectId, + UUID, + Long, + Timestamp, + Double, + Int32, + MinKey, + MaxKey, + BSONRegExp, + Decimal128, + NumberUtils, + ByteUtils +}; +export { BSONValue, bsonType, type BSONTypeTag } from './bson_value'; +export { BSONError, BSONVersionError, BSONRuntimeError, BSONOffsetError } from './error'; +export { BSONType } from './constants'; +export { EJSON } from './extended_json'; +export { onDemand, type OnDemand } from './parser/on_demand/index'; + +/** @public */ +export interface Document { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; +} + +/** @internal */ +// Default Max Size +const MAXSIZE = 1024 * 1024 * 17; + +// Current Internal Temporary Serialization Buffer +let buffer = ByteUtils.allocate(MAXSIZE); + +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer in bytes + * @public + */ +export function setInternalBufferSize(size: number): void { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = ByteUtils.allocate(size); + } +} + +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +export function serialize(object: Document, options: SerializeOptions = {}): Uint8Array { + // Unpack the options + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = + typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = ByteUtils.allocate(minInternalBufferSize); + } + + // Attempt to serialize + const serializationIndex = serializeInto( + buffer, + object, + checkKeys, + 0, + serializeFunctions, + ignoreUndefined, + null + ); + + // Create the final buffer + const finishedBuffer = ByteUtils.allocateUnsafe(serializationIndex); + + // Copy into the finished buffer + finishedBuffer.set(buffer.subarray(0, serializationIndex), 0); + + // Return the buffer + return finishedBuffer; +} + +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +export function serializeWithBufferAndIndex( + object: Document, + finalBuffer: Uint8Array, + options: SerializeOptions = {} +): number { + // Unpack the options + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + + // Attempt to serialize + const serializationIndex = serializeInto( + buffer, + object, + checkKeys, + 0, + serializeFunctions, + ignoreUndefined, + null + ); + + finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex); + + // Return the index + return startIndex + serializationIndex - 1; +} + +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +export function deserialize(buffer: Uint8Array, options: DeserializeOptions = {}): Document { + return internalDeserialize(ByteUtils.toLocalBufferType(buffer), options); +} + +/** @public */ +export type CalculateObjectSizeOptions = Pick< + SerializeOptions, + 'serializeFunctions' | 'ignoreUndefined' +>; + +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +export function calculateObjectSize( + object: Document, + options: CalculateObjectSizeOptions = {} +): number { + options = options || {}; + + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} + +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +export function deserializeStream( + data: Uint8Array | ArrayBuffer, + startIndex: number, + numberOfDocuments: number, + documents: Document[], + docStartIndex: number, + options: DeserializeOptions +): number { + const internalOptions = Object.assign( + { allowObjectSmallerThanBufferSize: true, index: 0 }, + options + ); + const bufferData = ByteUtils.toLocalBufferType(data); + + let index = startIndex; + // Loop over all documents + for (let i = 0; i < numberOfDocuments; i++) { + // Find size of the document + const size = NumberUtils.getInt32LE(bufferData, index); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + + // Return object containing end index of parsing and list of documents + return index; +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson_value.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson_value.ts new file mode 100644 index 00000000..40432fca --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/bson_value.ts @@ -0,0 +1,55 @@ +import { BSON_MAJOR_VERSION } from './constants'; +import { type InspectFn } from './parser/utils'; +import { BSON_VERSION_SYMBOL } from './constants'; + +/** @public */ +export type BSONTypeTag = + | 'BSONRegExp' + | 'BSONSymbol' + | 'ObjectId' + | 'Binary' + | 'Decimal128' + | 'Double' + | 'Int32' + | 'Long' + | 'MaxKey' + | 'MinKey' + | 'Timestamp' + | 'Code' + | 'DBRef'; + +/** @public */ +export const bsonType = Symbol.for('@@mdb.bson.type'); + +/** @public */ +export abstract class BSONValue { + /** @public */ + public abstract get _bsontype(): BSONTypeTag; + + public get [bsonType](): this['_bsontype'] { + return this._bsontype; + } + + /** @internal */ + get [BSON_VERSION_SYMBOL](): typeof BSON_MAJOR_VERSION { + return BSON_MAJOR_VERSION; + } + + [Symbol.for('nodejs.util.inspect.custom')]( + depth?: number, + options?: unknown, + inspect?: InspectFn + ): string { + return this.inspect(depth, options, inspect); + } + + /** + * @public + * Prints a human-readable string of BSON value information + * If invoked manually without node.js.inspect function, this will default to a modified JSON.stringify + */ + public abstract inspect(depth?: number, options?: unknown, inspect?: InspectFn): string; + + /** @internal */ + abstract toExtendedJSON(): unknown; +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/code.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/code.ts new file mode 100644 index 00000000..98b1ede9 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/code.ts @@ -0,0 +1,69 @@ +import type { Document } from './bson'; +import { BSONValue } from './bson_value'; +import { type InspectFn, defaultInspect } from './parser/utils'; + +/** @public */ +export interface CodeExtended { + $code: string; + $scope?: Document; +} + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +export class Code extends BSONValue { + get _bsontype(): 'Code' { + return 'Code'; + } + + code: string; + + // a code instance having a null scope is what determines whether + // it is BSONType 0x0D (just code) / 0x0F (code with scope) + scope: Document | null; + + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + constructor(code: string | Function, scope?: Document | null) { + super(); + this.code = code.toString(); + this.scope = scope ?? null; + } + + toJSON(): { code: string; scope?: Document } { + if (this.scope != null) { + return { code: this.code, scope: this.scope }; + } + + return { code: this.code }; + } + + /** @internal */ + toExtendedJSON(): CodeExtended { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + + return { $code: this.code }; + } + + /** @internal */ + static fromExtendedJSON(doc: CodeExtended): Code { + return new Code(doc.$code, doc.$scope); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + let parametersString = inspect(this.code, options); + const multiLineFn = parametersString.includes('\n'); + if (this.scope != null) { + parametersString += `,${multiLineFn ? '\n' : ' '}${inspect(this.scope, options)}`; + } + const endingNewline = multiLineFn && this.scope === null; + return `new Code(${multiLineFn ? '\n' : ''}${parametersString}${endingNewline ? '\n' : ''})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/constants.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/constants.ts new file mode 100644 index 00000000..5751c0ef --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/constants.ts @@ -0,0 +1,147 @@ +/** @internal */ +export const BSON_MAJOR_VERSION = 7; + +/** @internal */ +export const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version'); + +/** @internal */ +export const BSON_INT32_MAX = 0x7fffffff; +/** @internal */ +export const BSON_INT32_MIN = -0x80000000; +/** @internal */ +export const BSON_INT64_MAX = Math.pow(2, 63) - 1; +/** @internal */ +export const BSON_INT64_MIN = -Math.pow(2, 63); + +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +export const JS_INT_MAX = Math.pow(2, 53); + +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +export const JS_INT_MIN = -Math.pow(2, 53); + +/** Number BSON Type @internal */ +export const BSON_DATA_NUMBER = 1; + +/** String BSON Type @internal */ +export const BSON_DATA_STRING = 2; + +/** Object BSON Type @internal */ +export const BSON_DATA_OBJECT = 3; + +/** Array BSON Type @internal */ +export const BSON_DATA_ARRAY = 4; + +/** Binary BSON Type @internal */ +export const BSON_DATA_BINARY = 5; + +/** Binary BSON Type @internal */ +export const BSON_DATA_UNDEFINED = 6; + +/** ObjectId BSON Type @internal */ +export const BSON_DATA_OID = 7; + +/** Boolean BSON Type @internal */ +export const BSON_DATA_BOOLEAN = 8; + +/** Date BSON Type @internal */ +export const BSON_DATA_DATE = 9; + +/** null BSON Type @internal */ +export const BSON_DATA_NULL = 10; + +/** RegExp BSON Type @internal */ +export const BSON_DATA_REGEXP = 11; + +/** Code BSON Type @internal */ +export const BSON_DATA_DBPOINTER = 12; + +/** Code BSON Type @internal */ +export const BSON_DATA_CODE = 13; + +/** Symbol BSON Type @internal */ +export const BSON_DATA_SYMBOL = 14; + +/** Code with Scope BSON Type @internal */ +export const BSON_DATA_CODE_W_SCOPE = 15; + +/** 32 bit Integer BSON Type @internal */ +export const BSON_DATA_INT = 16; + +/** Timestamp BSON Type @internal */ +export const BSON_DATA_TIMESTAMP = 17; + +/** Long BSON Type @internal */ +export const BSON_DATA_LONG = 18; + +/** Decimal128 BSON Type @internal */ +export const BSON_DATA_DECIMAL128 = 19; + +/** MinKey BSON Type @internal */ +export const BSON_DATA_MIN_KEY = 0xff; + +/** MaxKey BSON Type @internal */ +export const BSON_DATA_MAX_KEY = 0x7f; + +/** Binary Default Type @internal */ +export const BSON_BINARY_SUBTYPE_DEFAULT = 0; + +/** Binary Function Type @internal */ +export const BSON_BINARY_SUBTYPE_FUNCTION = 1; + +/** Binary Byte Array Type @internal */ +export const BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; + +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +export const BSON_BINARY_SUBTYPE_UUID = 3; + +/** Binary UUID Type @internal */ +export const BSON_BINARY_SUBTYPE_UUID_NEW = 4; + +/** Binary MD5 Type @internal */ +export const BSON_BINARY_SUBTYPE_MD5 = 5; + +/** Encrypted BSON type @internal */ +export const BSON_BINARY_SUBTYPE_ENCRYPTED = 6; + +/** Column BSON type @internal */ +export const BSON_BINARY_SUBTYPE_COLUMN = 7; + +/** Sensitive BSON type @internal */ +export const BSON_BINARY_SUBTYPE_SENSITIVE = 8; + +/** Binary User Defined Type @internal */ +export const BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + +/** @public */ +export const BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +} as const); + +/** @public */ +export type BSONType = (typeof BSONType)[keyof typeof BSONType]; diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/db_ref.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/db_ref.ts new file mode 100644 index 00000000..fbb751f8 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/db_ref.ts @@ -0,0 +1,128 @@ +import type { Document } from './bson'; +import { BSONValue } from './bson_value'; +import type { EJSONOptions } from './extended_json'; +import type { ObjectId } from './objectid'; +import { type InspectFn, defaultInspect } from './parser/utils'; + +/** @public */ +export interface DBRefLike { + $ref: string; + $id: ObjectId; + $db?: string; +} + +/** @internal */ +export function isDBRefLike(value: unknown): value is DBRefLike { + return ( + value != null && + typeof value === 'object' && + '$id' in value && + value.$id != null && + '$ref' in value && + typeof value.$ref === 'string' && + // If '$db' is defined it MUST be a string, otherwise it should be absent + (!('$db' in value) || ('$db' in value && typeof value.$db === 'string')) + ); +} + +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +export class DBRef extends BSONValue { + get _bsontype(): 'DBRef' { + return 'DBRef'; + } + + collection!: string; + oid!: ObjectId; + db?: string; + fields!: Document; + + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document) { + super(); + // check if namespace has been provided + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + collection = parts.shift()!; + } + + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + + /** @internal */ + get namespace(): string { + return this.collection; + } + + set namespace(value: string) { + this.collection = value; + } + + toJSON(): DBRefLike & Document { + const o = Object.assign( + { + $ref: this.collection, + $id: this.oid + }, + this.fields + ); + + if (this.db != null) o.$db = this.db; + return o; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): DBRefLike { + options = options || {}; + let o: DBRefLike = { + $ref: this.collection, + $id: this.oid + }; + + if (options.legacy) { + return o; + } + + if (this.db) o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + + /** @internal */ + static fromExtendedJSON(doc: DBRefLike): DBRef { + const copy = Object.assign({}, doc) as Partial; + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + + const args = [ + inspect(this.namespace, options), + inspect(this.oid, options), + ...(this.db ? [inspect(this.db, options)] : []), + ...(Object.keys(this.fields).length > 0 ? [inspect(this.fields, options)] : []) + ]; + + args[1] = inspect === defaultInspect ? `new ObjectId(${args[1]})` : args[1]; + + return `new DBRef(${args.join(', ')})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/decimal128.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/decimal128.ts new file mode 100644 index 00000000..8f491b3c --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/decimal128.ts @@ -0,0 +1,855 @@ +import { BSONValue } from './bson_value'; +import { BSONError } from './error'; +import { Long } from './long'; +import { type InspectFn, defaultInspect, isUint8Array } from './parser/utils'; +import { ByteUtils } from './utils/byte_utils'; + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; + +// Nan value bits as 32 bit values (due to lack of longs) +const NAN_BUFFER = ByteUtils.fromNumberArray( + [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse() +); +// Infinity value bits 32 bit values (due to lack of longs) +const INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray( + [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse() +); +const INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray( + [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse() +); + +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; + +// Extract least significant 5 bits +const COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +const EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +const COMBINATION_INFINITY = 30; +// Value of combination field for NaN +const COMBINATION_NAN = 31; + +// Detect if the value is a digit +function isDigit(value: string): boolean { + return !isNaN(parseInt(value, 10)); +} + +// Divide two uint128 values +function divideu128(value: { parts: [number, number, number, number] }) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + + for (let i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + + return { quotient: value, rem: _rem }; +} + +// Multiply two Long values and return the 128 bit value +function multiply64x2(left: Long, right: Long): { high: Long; low: Long } { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} + +function lessThan(left: Long, right: Long): boolean { + // Make values unsigned + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + + // Compare high bits first + if (uhleft < uhright) { + return true; + } else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) return true; + } + + return false; +} + +function invalidErr(string: string, message: string) { + throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message}`); +} + +/** @public */ +export interface Decimal128Extended { + $numberDecimal: string; +} + +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +export class Decimal128 extends BSONValue { + get _bsontype(): 'Decimal128' { + return 'Decimal128'; + } + + readonly bytes!: Uint8Array; + + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + constructor(bytes: Uint8Array | string) { + super(); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } else if (bytes instanceof Uint8Array || isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } else { + throw new BSONError('Decimal128 must take a Buffer or string'); + } + } + + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128 { + return Decimal128._fromString(representation, { allowRounding: false }); + } + + /** + * Create a Decimal128 instance from a string representation, allowing for rounding to 34 + * significant digits + * + * @example Example of a number that will be rounded + * ```ts + * > let d = Decimal128.fromString('37.499999999999999196428571428571375') + * Uncaught: + * BSONError: "37.499999999999999196428571428571375" is not a valid Decimal128 string - inexact rounding + * at invalidErr (/home/wajames/js-bson/lib/bson.cjs:1402:11) + * at Decimal128.fromStringInternal (/home/wajames/js-bson/lib/bson.cjs:1633:25) + * at Decimal128.fromString (/home/wajames/js-bson/lib/bson.cjs:1424:27) + * + * > d = Decimal128.fromStringWithRounding('37.499999999999999196428571428571375') + * new Decimal128("37.49999999999999919642857142857138") + * ``` + * @param representation - a numeric string representation. + */ + static fromStringWithRounding(representation: string): Decimal128 { + return Decimal128._fromString(representation, { allowRounding: true }); + } + + private static _fromString(representation: string, options: { allowRounding: boolean }) { + // Parse state tracking + let isNegative = false; + let sawSign = false; + let sawRadix = false; + let foundNonZero = false; + + // Total number of significant digits (no leading or trailing zero) + let significantDigits = 0; + // Total number of significand digits read + let nDigitsRead = 0; + // Total number of digits (no leading zeros) + let nDigits = 0; + // The number of the digits after radix + let radixPosition = 0; + // The index of the first non-zero in *str* + let firstNonZero = 0; + + // Digits Array + const digits = [0]; + // The number of digits in digits + let nDigitsStored = 0; + // Insertion pointer for digits + let digitsInsert = 0; + // The index of the last digit + let lastDigit = 0; + + // Exponent + let exponent = 0; + // The high 17 digits of the significand + let significandHigh = new Long(0, 0); + // The low 17 digits of the significand + let significandLow = new Long(0, 0); + // The biased exponent + let biasedExponent = 0; + + // Read index + let index = 0; + + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + + // Results + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + } + + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + + const unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) invalidErr(representation, 'missing exponent power'); + + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) invalidErr(representation, 'missing exponent base'); + + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + sawSign = true; + isNegative = representation[index++] === '-'; + } + + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } else if (representation[index] === 'N') { + return new Decimal128(NAN_BUFFER); + } + } + + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) invalidErr(representation, 'contains multiple periods'); + + sawRadix = true; + index = index + 1; + continue; + } + + if (nDigitsStored < MAX_DIGITS) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + + foundNonZero = true; + + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + + if (foundNonZero) nDigits = nDigits + 1; + if (sawRadix) radixPosition = radixPosition + 1; + + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + + if (sawRadix && !nDigitsRead) + throw new BSONError('' + representation + ' not a valid Decimal128 string'); + + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + const match = representation.substr(++index).match(EXPONENT_REGEX); + + // No digits read + if (!match || !match[2]) return new Decimal128(NAN_BUFFER); + + // Get exponent + exponent = parseInt(match[0], 10); + + // Adjust the index + index = index + match[0].length; + } + + // Return not a number + if (representation[index]) return new Decimal128(NAN_BUFFER); + + // Done reading input + // Find first non-zero digit in digits + if (!nDigitsStored) { + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while ( + representation[ + firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix) + ] === '0' + ) { + significantDigits = significantDigits - 1; + } + } + } + + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + + // Overflow prevention + if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) { + exponent = EXPONENT_MIN; + } else { + exponent = exponent - radixPosition; + } + + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit >= MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + if (significantDigits === 0) { + exponent = EXPONENT_MAX; + break; + } + + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + + if (options.allowRounding) { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } else { + // adjust to round + lastDigit = lastDigit - 1; + } + + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } else { + // Check if we have a zero then just hard clamp, otherwise fail + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (sawSign) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (let i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + + if (roundBit) { + let dIdx = lastDigit; + + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } else { + return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + } + } else { + break; + } + } + } + } + } else { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0) { + if (significantDigits === 0) { + exponent = EXPONENT_MIN; + break; + } + + invalidErr(representation, 'exponent underflow'); + } + + if (nDigitsStored < nDigits) { + if ( + representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== '0' && + significantDigits !== 0 + ) { + invalidErr(representation, 'inexact rounding'); + } + // adjust to match digits not stored + nDigits = nDigits - 1; + } else { + if (digits[lastDigit] !== 0) { + invalidErr(representation, 'inexact rounding'); + } + // adjust to round + lastDigit = lastDigit - 1; + } + + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } else { + invalidErr(representation, 'overflow'); + } + } + + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit + 1 < significantDigits) { + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + } + // if saw sign, we need to increment again to account for - or + sign at start. + if (sawSign) { + firstNonZero = firstNonZero + 1; + } + + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + + if (roundDigit !== 0) { + invalidErr(representation, 'inexact rounding'); + } + } + } + + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } else if (lastDigit < 17) { + let dIdx = 0; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } else { + let dIdx = 0; + significandHigh = Long.fromNumber(digits[dIdx++]); + + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + + significandLow = Long.fromNumber(digits[dIdx++]); + + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + + // Encode combination, exponent, and significand. + if ( + significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1)) + ) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or( + Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)) + ); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + + dec.low = significand.low; + + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + + // Encode into a buffer + const buffer = ByteUtils.allocateUnsafe(16); + index = 0; + + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + + // Return the new Decimal128 + return new Decimal128(buffer); + } + /** Create a string representation of the raw Decimal128 value */ + toString(): string { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + + // decoded biased exponent (14 bits) + let biased_exponent; + // the number of significand digits + let significand_digits = 0; + // the base-10 digits in the significand + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) significand[i] = 0; + // read pointer into significand + let index = 0; + + // true if the number is zero + let is_zero = false; + + // the most significant significand bits (50-46) + let significand_msb; + // temporary storage for significand decoding + let significand128: { parts: [number, number, number, number] } = { parts: [0, 0, 0, 0] }; + // indexing variables + let j, k; + + // Output string + const string: string[] = []; + + // Unpack index + index = 0; + + // Buffer reference + const buffer = this.bytes; + + // Unpack the low 64bits into a long + // bits 96 - 127 + const low = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + const midl = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack the high 64bits into a long + // bits 32 - 63 + const midh = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + const high = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack index + index = 0; + + // Create the state of the decimal + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + + // Decode combination field and exponent + // bits 1 - 5 + const combination = (high >> 26) & COMBINATION_MASK; + + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } else if (combination === COMBINATION_NAN) { + return 'NaN'; + } else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + + // unbiased exponent + const exponent = biased_exponent - EXPONENT_BIAS; + + // Create string of significand digits + + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + + if ( + significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0 + ) { + is_zero = true; + } else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + // Perform the divide + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) continue; + + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + + // the exponent if scientific notation is used + const scientific_exponent = significand_digits - 1 + exponent; + + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) string.push(`E+${exponent}`); + else if (exponent < 0) string.push(`E${exponent}`); + return string.join(''); + } + + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + + if (significand_digits) { + string.push('.'); + } + + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } else { + string.push(`${scientific_exponent}`); + } + } else { + // Regular format with no decimal place + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } else { + let radix_position = significand_digits + exponent; + + // non-zero digits before radix + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } else { + string.push('0'); + } + + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + + return string.join(''); + } + + toJSON(): Decimal128Extended { + return { $numberDecimal: this.toString() }; + } + + /** @internal */ + toExtendedJSON(): Decimal128Extended { + return { $numberDecimal: this.toString() }; + } + + /** @internal */ + static fromExtendedJSON(doc: Decimal128Extended): Decimal128 { + return Decimal128.fromString(doc.$numberDecimal); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + const d128string = inspect(this.toString(), options); + return `new Decimal128(${d128string})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/double.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/double.ts new file mode 100644 index 00000000..4a3d1298 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/double.ts @@ -0,0 +1,115 @@ +import { BSONValue } from './bson_value'; +import { BSONError } from './error'; +import type { EJSONOptions } from './extended_json'; +import { type InspectFn, defaultInspect } from './parser/utils'; + +/** @public */ +export interface DoubleExtended { + $numberDouble: string; +} + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +export class Double extends BSONValue { + get _bsontype(): 'Double' { + return 'Double'; + } + + value!: number; + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + constructor(value: number) { + super(); + if ((value as unknown) instanceof Number) { + value = value.valueOf(); + } + + this.value = +value; + } + + /** + * Attempt to create an double type from string. + * + * This method will throw a BSONError on any string input that is not representable as a IEEE-754 64-bit double. + * Notably, this method will also throw on the following string formats: + * - Strings in non-decimal and non-exponential formats (binary, hex, or octal digits) + * - Strings with characters other than numeric, floating point, or leading sign characters (Note: 'Infinity', '-Infinity', and 'NaN' input strings are still allowed) + * - Strings with leading and/or trailing whitespace + * + * Strings with leading zeros, however, are also allowed + * + * @param value - the string we want to represent as a double. + */ + static fromString(value: string): Double { + const coercedValue = Number(value); + + if (value === 'NaN') return new Double(NaN); + if (value === 'Infinity') return new Double(Infinity); + if (value === '-Infinity') return new Double(-Infinity); + + if (!Number.isFinite(coercedValue)) { + throw new BSONError(`Input: ${value} is not representable as a Double`); + } + if (value.trim() !== value) { + throw new BSONError(`Input: '${value}' contains whitespace`); + } + if (value === '') { + throw new BSONError(`Input is an empty string`); + } + if (/[^-0-9.+eE]/.test(value)) { + throw new BSONError(`Input: '${value}' is not in decimal or exponential notation`); + } + return new Double(coercedValue); + } + + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + valueOf(): number { + return this.value; + } + + toJSON(): number { + return this.value; + } + + toString(radix?: number): string { + return this.value.toString(radix); + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | DoubleExtended { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + + if (Object.is(Math.sign(this.value), -0)) { + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + return { $numberDouble: '-0.0' }; + } + + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + + /** @internal */ + static fromExtendedJSON(doc: DoubleExtended, options?: EJSONOptions): number | Double { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + return `new Double(${inspect(this.value, options)})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/error.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/error.ts new file mode 100644 index 00000000..ef5184a4 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/error.ts @@ -0,0 +1,105 @@ +import { BSON_MAJOR_VERSION } from './constants'; + +/** + * @public + * @category Error + * + * `BSONError` objects are thrown when BSON encounters an error. + * + * This is the parent class for all the other errors thrown by this library. + */ +export class BSONError extends Error { + /** + * @internal + * The underlying algorithm for isBSONError may change to improve how strict it is + * about determining if an input is a BSONError. But it must remain backwards compatible + * with previous minors & patches of the current major version. + */ + protected get bsonError(): true { + return true; + } + + override get name(): string { + return 'BSONError'; + } + + constructor(message: string, options?: { cause?: unknown }) { + super(message, options); + } + + /** + * @public + * + * All errors thrown from the BSON library inherit from `BSONError`. + * This method can assist with determining if an error originates from the BSON library + * even if it does not pass an `instanceof` check against this class' constructor. + * + * @param value - any javascript value that needs type checking + */ + public static isBSONError(value: unknown): value is BSONError { + return ( + value != null && + typeof value === 'object' && + 'bsonError' in value && + value.bsonError === true && + // Do not access the following properties, just check existence + 'name' in value && + 'message' in value && + 'stack' in value + ); + } +} + +/** + * @public + * @category Error + */ +export class BSONVersionError extends BSONError { + get name(): 'BSONVersionError' { + return 'BSONVersionError'; + } + + constructor() { + super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); + } +} + +/** + * @public + * @category Error + * + * An error generated when BSON functions encounter an unexpected input + * or reaches an unexpected/invalid internal state + * + */ +export class BSONRuntimeError extends BSONError { + get name(): 'BSONRuntimeError' { + return 'BSONRuntimeError'; + } + + constructor(message: string) { + super(message); + } +} + +/** + * @public + * @category Error + * + * @experimental + * + * An error generated when BSON bytes are invalid. + * Reports the offset the parser was able to reach before encountering the error. + */ +export class BSONOffsetError extends BSONError { + public get name(): 'BSONOffsetError' { + return 'BSONOffsetError'; + } + + public offset: number; + + constructor(message: string, offset: number, options?: { cause?: unknown }) { + super(`${message}. offset: ${offset}`, options); + this.offset = offset; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/extended_json.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/extended_json.ts new file mode 100644 index 00000000..8dce14f4 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/extended_json.ts @@ -0,0 +1,557 @@ +import { Binary } from './binary'; +import type { Document } from './bson'; +import { Code } from './code'; +import { + BSON_INT32_MAX, + BSON_INT32_MIN, + BSON_INT64_MAX, + BSON_INT64_MIN, + BSON_MAJOR_VERSION, + BSON_VERSION_SYMBOL +} from './constants'; +import { DBRef, isDBRefLike } from './db_ref'; +import { Decimal128 } from './decimal128'; +import { Double } from './double'; +import { BSONError, BSONRuntimeError, BSONVersionError } from './error'; +import { Int32 } from './int_32'; +import { Long } from './long'; +import { MaxKey } from './max_key'; +import { MinKey } from './min_key'; +import { ObjectId } from './objectid'; +import { isDate, isRegExp, isMap } from './parser/utils'; +import { BSONRegExp } from './regexp'; +import { BSONSymbol } from './symbol'; +import { Timestamp } from './timestamp'; + +/** @public */ +export type EJSONOptionsBase = { + /** + * Output using the Extended JSON v1 spec + * @defaultValue `false` + */ + legacy?: boolean; + /** + * Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types + * @defaultValue `false` + */ + relaxed?: boolean; +}; + +/** @public */ +export type EJSONSerializeOptions = EJSONOptionsBase & { + /** + * Omits undefined values from the output instead of converting them to null + * @defaultValue `false` + */ + ignoreUndefined?: boolean; +}; + +/** @public */ +export type EJSONParseOptions = EJSONOptionsBase & { + /** + * Enable native bigint support + * @defaultValue `false` + */ + useBigInt64?: boolean; +}; + +/** @public */ +export type EJSONOptions = EJSONSerializeOptions & EJSONParseOptions; + +/** @internal */ +type BSONType = + | Binary + | Code + | DBRef + | Decimal128 + | Double + | Int32 + | Long + | MaxKey + | MinKey + | ObjectId + | BSONRegExp + | BSONSymbol + | Timestamp; + +function isBSONType(value: unknown): value is BSONType { + return ( + value != null && + typeof value === 'object' && + '_bsontype' in value && + typeof value._bsontype === 'string' + ); +} + +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +} as const; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value: any, options: EJSONOptions = {}) { + if (typeof value === 'number') { + // TODO(NODE-4377): EJSON js number handling diverges from BSON + const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN; + const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN; + + if (options.relaxed || options.legacy) { + return value; + } + + if (Number.isInteger(value) && !Object.is(value, -0)) { + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (in32BitRange) { + return new Int32(value); + } + if (in64BitRange) { + if (options.useBigInt64) { + return BigInt(value); + } + return Long.fromNumber(value); + } + } + + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') return value; + + // upgrade deprecated undefined to null + if (value.$undefined) return null; + + const keys = Object.keys(value).filter( + k => k.startsWith('$') && value[k] != null + ) as (keyof typeof keysToCodecs)[]; + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) return c.fromExtendedJSON(value, options); + } + + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + + if (options.legacy) { + if (typeof d === 'number') date.setTime(d); + else if (typeof d === 'string') date.setTime(Date.parse(d)); + else if (typeof d === 'bigint') date.setTime(Number(d)); + else throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } else { + if (typeof d === 'string') date.setTime(Date.parse(d)); + else if (Long.isLong(d)) date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) date.setTime(d); + else if (typeof d === 'bigint') date.setTime(Number(d)); + else throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`); + } + return date; + } + + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + + return Code.fromExtendedJSON(value); + } + + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) return v; + + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) valid = false; + }); + + // only make DBRef if $ keys are all valid + if (valid) return DBRef.fromExtendedJSON(v); + } + + return value; +} + +type EJSONSerializeInternalOptions = EJSONSerializeOptions & { + seenObjects: { obj: unknown; propertyName: string }[]; +}; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array: any[], options: EJSONSerializeInternalOptions): any[] { + return array.map((v: unknown, index: number) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } finally { + options.seenObjects.pop(); + } + }); +} + +function getISOString(date: Date) { + const isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value: any, options: EJSONSerializeInternalOptions): any { + if (value instanceof Map || isMap(value)) { + const obj: Record = Object.create(null); + for (const [k, v] of value) { + if (typeof k !== 'string') { + throw new BSONError('Can only serialize maps with string keys'); + } + obj[k] = v; + } + + return serializeValue(obj, options); + } + + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = + ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat( + circularPart.length + (alreadySeen.length + current.length) / 2 - 1 + ); + + throw new BSONError( + 'Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/` + ); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + + if (Array.isArray(value)) return serializeArray(value, options); + + if (value === undefined) return options.ignoreUndefined ? undefined : null; + + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), + // is it in year range 1970-9999? + // 253402300800000 is the first instant of year 10000 (+010000-01-01T00:00:00Z). + // It is the exclusive upper bound: a relaxed date is emitted as an ISO 8601 string, + // which only has a 4-digit year, so year 10000 and later are kept as a numeric timestamp. + inRange = dateNum > -1 && dateNum < 253402300800000; + + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + if (Number.isInteger(value) && !Object.is(value, -0)) { + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return { $numberInt: value.toString() }; + } + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) { + // TODO(NODE-4377): EJSON js number handling diverges from BSON + return { $numberLong: value.toString() }; + } + } + return { $numberDouble: Object.is(value, -0) ? '-0.0' : value.toString() }; + } + + if (typeof value === 'bigint') { + if (!options.relaxed) { + return { $numberLong: BigInt.asIntN(64, value).toString() }; + } + return Number(BigInt.asIntN(64, value)); + } + + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + + if (value != null && typeof value === 'object') return serializeDocument(value, options); + return value; +} + +const BSON_TYPE_MAPPINGS = { + Binary: (o: Binary) => new Binary(o.value(), o.sub_type), + Code: (o: Code) => new Code(o.code, o.scope), + DBRef: (o: DBRef) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), // "namespace" for 1.x library backwards compat + Decimal128: (o: Decimal128) => new Decimal128(o.bytes), + Double: (o: Double) => new Double(o.value), + Int32: (o: Int32) => new Int32(o.value), + Long: ( + o: Long & { + low_: number; + high_: number; + unsigned_: boolean | undefined; + } + ) => + Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, + o.low != null ? o.high : o.high_, + o.low != null ? o.unsigned : o.unsigned_ + ), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectId: (o: ObjectId) => new ObjectId(o), + BSONRegExp: (o: BSONRegExp) => new BSONRegExp(o.pattern, o.options), + BSONSymbol: (o: BSONSymbol) => new BSONSymbol(o.value), + Timestamp: (o: Timestamp) => Timestamp.fromBits(o.low, o.high) +} as const; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc: any, options: EJSONSerializeInternalOptions) { + if (doc == null || typeof doc !== 'object') throw new BSONError('not an object instance'); + + const bsontype: BSONType['_bsontype'] = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + const _doc: Document = {}; + for (const name of Object.keys(doc)) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } else { + _doc[name] = value; + } + } finally { + options.seenObjects.pop(); + } + } + return _doc; + } else if ( + doc != null && + typeof doc === 'object' && + typeof doc._bsontype === 'string' && + doc[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION + ) { + throw new BSONVersionError(); + } else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let outDoc: any = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef( + serializeValue(outDoc.collection, options), + serializeValue(outDoc.oid, options), + serializeValue(outDoc.db, options), + serializeValue(outDoc.fields, options) + ); + } + + return outDoc.toExtendedJSON(options); + } else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} + +/** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function parse(text: string, options?: EJSONParseOptions): any { + const ejsonOptions = { + useBigInt64: options?.useBigInt64 ?? false, + relaxed: options?.relaxed ?? true, + legacy: options?.legacy ?? false + }; + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}` + ); + } + return deserializeValue(value, ejsonOptions); + }); +} + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * + * // prints '{"int32":{"$numberInt":"10"}}' with 2 space indentation + * console.log(EJSON.stringify(doc, { relaxed: false }, 2)); + * ``` + */ +function stringify( + value: any, + replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | null, + space?: string | number, + options?: EJSONSerializeOptions +): string; +function stringify( + value: any, + replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | null, + options?: EJSONSerializeOptions +): string; +function stringify(value: any, options?: EJSONSerializeOptions, space?: string | number): string; +function stringify( + value: any, + replacerOrOptions?: + | (number | string)[] + | ((this: any, key: string, value: any) => any) + | null + | EJSONSerializeOptions, + spaceOrOptions?: string | number | EJSONSerializeOptions, + options?: EJSONSerializeOptions +): string { + /* eslint-enable @typescript-eslint/no-explicit-any */ + + if (spaceOrOptions != null && typeof spaceOrOptions === 'object') { + options = spaceOrOptions; + spaceOrOptions = undefined; + } + if ( + replacerOrOptions != null && + typeof replacerOrOptions === 'object' && + !Array.isArray(replacerOrOptions) + ) { + options = replacerOrOptions; + replacerOrOptions = undefined; + } + + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacerOrOptions as Parameters[1], spaceOrOptions); +} + +/** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function EJSONserialize(value: any, options?: EJSONSerializeOptions): Document { + options = options || {}; + return JSON.parse(stringify(value, options)); +} + +/** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function EJSONdeserialize(ejson: Document, options?: EJSONParseOptions): any { + options = options || {}; + return parse(JSON.stringify(ejson), options); +} + +/** @public */ +const EJSON: { + parse: typeof parse; + stringify: typeof stringify; + serialize: typeof EJSONserialize; + deserialize: typeof EJSONdeserialize; +} = Object.create(null); +EJSON.parse = parse; +EJSON.stringify = stringify; +EJSON.serialize = EJSONserialize; +EJSON.deserialize = EJSONdeserialize; +Object.freeze(EJSON); +export { EJSON }; diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/index.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/index.ts new file mode 100644 index 00000000..5ef41575 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/index.ts @@ -0,0 +1,19 @@ +import * as BSON from './bson'; + +// Export all named properties from BSON to support +// import { ObjectId, serialize } from 'bson'; +// const { ObjectId, serialize } = require('bson'); +export * from './bson'; + +// Export BSON as a namespace to support: +// import { BSON } from 'bson'; +// const { BSON } = require('bson'); +export { BSON }; + +// BSON does **NOT** have a default export + +// The following will crash in es module environments +// import BSON from 'bson'; + +// The following will work as expected, BSON as a namespace of all the APIs (BSON.ObjectId, BSON.serialize) +// const BSON = require('bson'); diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/int_32.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/int_32.ts new file mode 100644 index 00000000..7c95027c --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/int_32.ts @@ -0,0 +1,101 @@ +import { BSONValue } from './bson_value'; +import { BSON_INT32_MAX, BSON_INT32_MIN } from './constants'; +import { BSONError } from './error'; +import type { EJSONOptions } from './extended_json'; +import { type InspectFn, defaultInspect } from './parser/utils'; +import { removeLeadingZerosAndExplicitPlus } from './utils/string_utils'; + +/** @public */ +export interface Int32Extended { + $numberInt: string; +} + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +export class Int32 extends BSONValue { + get _bsontype(): 'Int32' { + return 'Int32'; + } + + value!: number; + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + constructor(value: number | string) { + super(); + if ((value as unknown) instanceof Number) { + value = value.valueOf(); + } + + this.value = +value | 0; + } + + /** + * Attempt to create an Int32 type from string. + * + * This method will throw a BSONError on any string input that is not representable as an Int32. + * Notably, this method will also throw on the following string formats: + * - Strings in non-decimal formats (exponent notation, binary, hex, or octal digits) + * - Strings non-numeric and non-leading sign characters (ex: '2.0', '24,000') + * - Strings with leading and/or trailing whitespace + * + * Strings with leading zeros, however, are allowed. + * + * @param value - the string we want to represent as an int32. + */ + static fromString(value: string): Int32 { + const cleanedValue = removeLeadingZerosAndExplicitPlus(value); + + const coercedValue = Number(value); + + if (BSON_INT32_MAX < coercedValue) { + throw new BSONError(`Input: '${value}' is larger than the maximum value for Int32`); + } else if (BSON_INT32_MIN > coercedValue) { + throw new BSONError(`Input: '${value}' is smaller than the minimum value for Int32`); + } else if (!Number.isSafeInteger(coercedValue)) { + throw new BSONError(`Input: '${value}' is not a safe integer`); + } else if (coercedValue.toString() !== cleanedValue) { + // catch all case + throw new BSONError(`Input: '${value}' is not a valid Int32 string`); + } + return new Int32(coercedValue); + } + + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + valueOf(): number { + return this.value; + } + + toString(radix?: number): string { + return this.value.toString(radix); + } + + toJSON(): number { + return this.value; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | Int32Extended { + if (options && (options.relaxed || options.legacy)) return this.value; + return { $numberInt: this.value.toString() }; + } + + /** @internal */ + static fromExtendedJSON(doc: Int32Extended, options?: EJSONOptions): number | Int32 { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + return `new Int32(${inspect(this.value, options)})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/long.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/long.ts new file mode 100644 index 00000000..b705d41e --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/long.ts @@ -0,0 +1,1241 @@ +import { BSONValue } from './bson_value'; +import { BSONError } from './error'; +import type { EJSONOptions } from './extended_json'; +import { type InspectFn, defaultInspect } from './parser/utils'; +import type { Timestamp } from './timestamp'; +import * as StringUtils from './utils/string_utils'; + +interface LongWASMHelpers { + /** Gets the high bits of the last operation performed */ + get_high(this: void): number; + div_u( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + div_s( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + rem_u( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + rem_s( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + mul( + this: void, + lowBits: number, + highBits: number, + lowBitsMultiplier: number, + highBitsMultiplier: number + ): number; +} + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +let wasm: LongWASMHelpers | undefined = undefined; + +/* We do not want to have to include DOM types just for this check */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare const WebAssembly: any; + +try { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + wasm = new WebAssembly.Instance( + new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11]) + ), + {} + ).exports as unknown as LongWASMHelpers; +} catch { + // no wasm support +} + +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + +/** A cache of the Long representations of small integer values. */ +const INT_CACHE: { [key: number]: Long } = {}; + +/** A cache of the Long representations of small unsigned integer values. */ +const UINT_CACHE: { [key: number]: Long } = {}; + +const MAX_INT64_STRING_LENGTH = 20; + +const DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/; + +/** @public */ +export interface LongExtended { + $numberLong: string; +} + +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +export class Long extends BSONValue { + get _bsontype(): 'Long' { + return 'Long'; + } + + /** An indicator used to reliably determine if an object is a Long or not. */ + get __isLong__(): boolean { + return true; + } + + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(low: number, high?: number, unsigned?: boolean); + /** + * Constructs a 64 bit two's-complement integer, given a bigint representation. + * + * @param value - BigInt representation of the long value + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(value: bigint, unsigned?: boolean); + /** + * Constructs a 64 bit two's-complement integer, given a string representation. + * + * @param value - String representation of the long value + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(value: string, unsigned?: boolean); + constructor( + lowOrValue: number | bigint | string = 0, + highOrUnsigned?: number | boolean, + unsigned?: boolean + ) { + super(); + const unsignedBool = typeof highOrUnsigned === 'boolean' ? highOrUnsigned : Boolean(unsigned); + const high = typeof highOrUnsigned === 'number' ? highOrUnsigned : 0; + const res = + typeof lowOrValue === 'string' + ? Long.fromString(lowOrValue, unsignedBool) + : typeof lowOrValue === 'bigint' + ? Long.fromBigInt(lowOrValue, unsignedBool) + : { low: lowOrValue | 0, high: high | 0, unsigned: unsignedBool }; + this.low = res.low; + this.high = res.high; + this.unsigned = res.unsigned; + } + + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + static ZERO = Long.fromInt(0); + /** Unsigned zero. */ + static UZERO = Long.fromInt(0, true); + /** Signed one. */ + static ONE = Long.fromInt(1); + /** Unsigned one. */ + static UONE = Long.fromInt(1, true); + /** Signed negative one. */ + static NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long { + return new Long(lowBits, highBits, unsigned); + } + + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long { + if (isNaN(value)) return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) return Long.UZERO; + if (value >= TWO_PWR_64_DBL) return Long.MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return Long.MAX_VALUE; + } + if (value < 0) return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long { + const FROM_BIGINT_BIT_MASK = 0xffffffffn; + const FROM_BIGINT_BIT_SHIFT = 32n; + return new Long( + Number(value & FROM_BIGINT_BIT_MASK), + Number((value >> FROM_BIGINT_BIT_SHIFT) & FROM_BIGINT_BIT_MASK), + unsigned + ); + } + + /** + * @internal + * Returns a Long representation of the given string, written using the specified radix. + * Throws an error if `throwsError` is set to true and any of the following conditions are true: + * - the string contains invalid characters for the given radix + * - the string contains whitespace + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + private static _fromString(str: string, unsigned: boolean, radix: number): Long { + if (str.length === 0) throw new BSONError('empty string'); + if (radix < 2 || 36 < radix) throw new BSONError('radix'); + + let p; + if ((p = str.indexOf('-')) > 0) throw new BSONError('interior hyphen'); + else if (p === 0) { + return Long._fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + + /** + * Returns a signed Long representation of the given string, written using radix 10. + * Will throw an error if the given text is not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the radix 10 + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @returns The corresponding Long value + */ + static fromStringStrict(str: string): Long; + /** + * Returns a Long representation of the given string, written using the radix 10. + * Will throw an error if the given parameters are not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the given radix + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromStringStrict(str: string, unsigned?: boolean): Long; + /** + * Returns a signed Long representation of the given string, written using the specified radix. + * Will throw an error if the given parameters are not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the given radix + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromStringStrict(str: string, radix?: boolean): Long; + /** + * Returns a Long representation of the given string, written using the specified radix. + * Will throw an error if the given parameters are not exactly representable as a Long. + * Throws an error if any of the following conditions are true: + * - the string contains invalid characters for the given radix + * - the string contains whitespace + * - the value the string represents is too large or too small to be a Long + * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromStringStrict(str: string, unsigned?: boolean, radix?: number): Long; + static fromStringStrict(str: string, unsignedOrRadix?: boolean | number, radix?: number): Long { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + // For goog.math.long compatibility + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + + if (str.trim() !== str) { + throw new BSONError(`Input: '${str}' contains leading and/or trailing whitespace`); + } + if (!StringUtils.validateStringCharacters(str, radix)) { + throw new BSONError(`Input: '${str}' contains invalid characters for radix: ${radix}`); + } + + // remove leading zeros (for later string comparison and to make math faster) + const cleanedStr = StringUtils.removeLeadingZerosAndExplicitPlus(str); + + // check roundtrip result + const result = Long._fromString(cleanedStr, unsigned, radix); + if (result.toString(radix).toLowerCase() !== cleanedStr.toLowerCase()) { + throw new BSONError( + `Input: ${str} is not representable as ${result.unsigned ? 'an unsigned' : 'a signed'} 64-bit Long ${radix != null ? `with radix: ${radix}` : ''}` + ); + } + return result; + } + + /** + * Returns a signed Long representation of the given string, written using radix 10. + * + * If the input string is empty, this function will throw a BSONError. + * + * If input string does not have valid signed 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit signed long will be coerced to Long.MAX_VALUE and Long.MIN_VALUE respectively + * - 'NaN' or '+/-Infinity' are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * + * @param str - The textual representation of the Long + * @returns The corresponding Long value + */ + static fromString(str: string): Long; + /** + * Returns a signed Long representation of the given string, written using the provided radix. + * + * If the input string is empty or a provided radix is not within (2-36), this function will throw a BSONError. + * + * If input parameters do not have valid signed 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit signed long will be coerced to Long.MAX_VALUE and Long.MIN_VALUE respectively + * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO + * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * @param str - The textual representation of the Long + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, radix?: number): Long; + /** + * Returns a Long representation of the given string, written using radix 10. + * + * If the input string is empty, this function will throw a BSONError. + * + * If input parameters do not have a valid 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit long will be coerced to max or min (if signed) values + * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO + * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean): Long; + /** + * Returns a Long representation of the given string, written using the specified radix. + * + * If the input string is empty or a provided radix is not within (2-36), this function will throw a BSONError. + * + * If input parameters do not have a valid 64-bit Long representation, this method will return a coerced value: + * - inputs that overflow 64-bit long will be coerced to max or min (if signed) values + * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO + * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO + * - other invalid characters sequences have variable behavior + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long; + static fromString(str: string, unsignedOrRadix?: boolean | number, radix?: number): Long { + let unsigned = false; + if (typeof unsignedOrRadix === 'number') { + // For goog.math.long compatibility + ((radix = unsignedOrRadix), (unsignedOrRadix = false)); + } else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str === 'NaN' && radix < 24) { + // radix does not support n, so coerce to zero + return Long.ZERO; + } else if ((str === 'Infinity' || str === '+Infinity' || str === '-Infinity') && radix < 35) { + // radix does not support y, so coerce to zero + return Long.ZERO; + } + return Long._fromString(str, unsigned, radix); + } + + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long { + return new Long( + bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), + bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), + unsigned + ); + } + + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long { + return new Long( + (bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], + (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], + unsigned + ); + } + + /** + * Tests if the specified object is a Long. + */ + static isLong(value: unknown): value is Long { + return ( + value != null && + typeof value === 'object' && + '__isLong__' in value && + value.__isLong__ === true + ); + } + + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue( + val: number | string | { low: number; high: number; unsigned?: boolean }, + unsigned?: boolean + ): Long { + if (typeof val === 'number') return Long.fromNumber(val, unsigned); + if (typeof val === 'string') return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits( + val.low, + val.high, + typeof unsigned === 'boolean' ? unsigned : val.unsigned + ); + } + + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long | Timestamp): Long { + if (!Long.isLong(addend)) addend = Long.fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + + let c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + and(other: string | number | Long | Timestamp): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: string | number | Long | Timestamp): 0 | 1 | -1 { + if (!Long.isLong(other)) other = Long.fromValue(other); + if (this.eq(other)) return 0; + const thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) return -1; + if (!thisNeg && otherNeg) return 1; + // At this point the sign bits are the same + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + + /** This is an alias of {@link Long.compare} */ + comp(other: string | number | Long | Timestamp): 0 | 1 | -1 { + return this.compare(other); + } + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long | Timestamp): Long { + if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor); + if (divisor.isZero()) throw new BSONError('division by zero'); + + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if ( + !this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1 + ) { + // be consistent with non-wasm code path + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + if (this.isZero()) return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(Long.MIN_VALUE)) return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + // eslint-disable-next-line @typescript-eslint/no-this-alias + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) approxRes = Long.ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + + /**This is an alias of {@link Long.divide} */ + div(divisor: string | number | Long | Timestamp): Long { + return this.divide(divisor); + } + + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + equals(other: string | number | Long | Timestamp): boolean { + if (!Long.isLong(other)) other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + + /** This is an alias of {@link Long.equals} */ + eq(other: string | number | Long | Timestamp): boolean { + return this.equals(other); + } + + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number { + return this.high; + } + + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number { + return this.high >>> 0; + } + + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number { + return this.low; + } + + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number { + return this.low >>> 0; + } + + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit: number; + for (bit = 31; bit > 0; bit--) if ((val & (1 << bit)) !== 0) break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long | Timestamp): boolean { + return this.comp(other) > 0; + } + + /** This is an alias of {@link Long.greaterThan} */ + gt(other: string | number | Long | Timestamp): boolean { + return this.greaterThan(other); + } + + /** Tests if this Long's value is greater than or equal the specified's. */ + greaterThanOrEqual(other: string | number | Long | Timestamp): boolean { + return this.comp(other) >= 0; + } + + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte(other: string | number | Long | Timestamp): boolean { + return this.greaterThanOrEqual(other); + } + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge(other: string | number | Long | Timestamp): boolean { + return this.greaterThanOrEqual(other); + } + + /** Tests if this Long's value is even. */ + isEven(): boolean { + return (this.low & 1) === 0; + } + + /** Tests if this Long's value is negative. */ + isNegative(): boolean { + return !this.unsigned && this.high < 0; + } + + /** Tests if this Long's value is odd. */ + isOdd(): boolean { + return (this.low & 1) === 1; + } + + /** Tests if this Long's value is positive. */ + isPositive(): boolean { + return this.unsigned || this.high >= 0; + } + + /** Tests if this Long's value equals zero. */ + isZero(): boolean { + return this.high === 0 && this.low === 0; + } + + /** Tests if this Long's value is less than the specified's. */ + lessThan(other: string | number | Long | Timestamp): boolean { + return this.comp(other) < 0; + } + + /** This is an alias of {@link Long#lessThan}. */ + lt(other: string | number | Long | Timestamp): boolean { + return this.lessThan(other); + } + + /** Tests if this Long's value is less than or equal the specified's. */ + lessThanOrEqual(other: string | number | Long | Timestamp): boolean { + return this.comp(other) <= 0; + } + + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte(other: string | number | Long | Timestamp): boolean { + return this.lessThanOrEqual(other); + } + + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long | Timestamp): Long { + if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor); + + // use wasm support if present + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + return this.sub(this.div(divisor).mul(divisor)); + } + + /** This is an alias of {@link Long.modulo} */ + mod(divisor: string | number | Long | Timestamp): Long { + return this.modulo(divisor); + } + /** This is an alias of {@link Long.modulo} */ + rem(divisor: string | number | Long | Timestamp): Long { + return this.modulo(divisor); + } + + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + multiply(multiplier: string | number | Long | Timestamp): Long { + if (this.isZero()) return Long.ZERO; + if (!Long.isLong(multiplier)) multiplier = Long.fromValue(multiplier); + + // use wasm support if present + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + if (multiplier.isZero()) return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); + else return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + + let c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + + /** This is an alias of {@link Long.multiply} */ + mul(multiplier: string | number | Long | Timestamp): Long { + return this.multiply(multiplier); + } + + /** Returns the Negation of this Long's value. */ + negate(): Long { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + + /** This is an alias of {@link Long.negate} */ + neg(): Long { + return this.negate(); + } + + /** Returns the bitwise NOT of this Long. */ + not(): Long { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long | Timestamp): boolean { + return !this.equals(other); + } + + /** This is an alias of {@link Long.notEquals} */ + neq(other: string | number | Long | Timestamp): boolean { + return this.notEquals(other); + } + /** This is an alias of {@link Long.notEquals} */ + ne(other: string | number | Long | Timestamp): boolean { + return this.notEquals(other); + } + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: number | string | Long): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + this.low << numBits, + (this.high << numBits) | (this.low >>> (32 - numBits)), + this.unsigned + ); + else return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + + /** This is an alias of {@link Long.shiftLeft} */ + shl(numBits: number | Long): Long { + return this.shiftLeft(numBits); + } + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >> numBits, + this.unsigned + ); + else return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + + /** This is an alias of {@link Long.shiftRight} */ + shr(numBits: number | Long): Long { + return this.shiftRight(numBits); + } + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRightUnsigned(numBits: Long | number): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits( + (low >>> numBits) | (high << (32 - numBits)), + high >>> numBits, + this.unsigned + ); + } else if (numBits === 32) return Long.fromBits(high, 0, this.unsigned); + else return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u(numBits: number | Long): Long { + return this.shiftRightUnsigned(numBits); + } + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru(numBits: number | Long): Long { + return this.shiftRightUnsigned(numBits); + } + + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + subtract(subtrahend: string | number | Long | Timestamp): Long { + if (!Long.isLong(subtrahend)) subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + + /** This is an alias of {@link Long.subtract} */ + sub(subtrahend: string | number | Long | Timestamp): Long { + return this.subtract(subtrahend); + } + + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number { + return this.unsigned ? this.low >>> 0 : this.low; + } + + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number { + if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + + /** Converts the Long to a BigInt (arbitrary precision). */ + toBigInt(): bigint { + return BigInt(this.toString()); + } + + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + toBytes(le?: boolean): number[] { + return le ? this.toBytesLE() : this.toBytesBE(); + } + + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + toBytesLE(): number[] { + const hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + toBytesBE(): number[] { + const hi = this.high, + lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + + /** + * Converts this Long to signed. + */ + toSigned(): Long { + if (!this.unsigned) return this; + return Long.fromBits(this.low, this.high, false); + } + + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + toString(radix?: number): string { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw new BSONError('radix'); + if (this.isZero()) return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + const radixLong = Long.fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + let rem: Long = this; + let result = ''; + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } else { + while (digits.length < 6) digits = '0' + digits; + result = '' + digits + result; + } + } + } + + /** Converts this Long to unsigned. */ + toUnsigned(): Long { + if (this.unsigned) return this; + return Long.fromBits(this.low, this.high, true); + } + + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + + /** This is an alias of {@link Long.isZero} */ + eqz(): boolean { + return this.isZero(); + } + + /** This is an alias of {@link Long.lessThanOrEqual} */ + le(other: string | number | Long | Timestamp): boolean { + return this.lessThanOrEqual(other); + } + + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + toExtendedJSON(options?: EJSONOptions): number | LongExtended { + if (options && options.relaxed) return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON( + doc: { $numberLong: string }, + options?: EJSONOptions + ): number | Long | bigint { + const { useBigInt64 = false, relaxed = true } = { ...options }; + + if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) { + throw new BSONError('$numberLong string is too long'); + } + + if (!DECIMAL_REG_EX.test(doc.$numberLong)) { + throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`); + } + + if (useBigInt64) { + const bigIntResult = BigInt(doc.$numberLong); + return BigInt.asIntN(64, bigIntResult); + } + + const longResult = Long.fromString(doc.$numberLong); + if (relaxed) { + return longResult.toNumber(); + } + return longResult; + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + const longVal = inspect(this.toString(), options); + const unsignedVal = this.unsigned ? `, ${inspect(this.unsigned, options)}` : ''; + return `new Long(${longVal}${unsignedVal})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/max_key.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/max_key.ts new file mode 100644 index 00000000..903f1d16 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/max_key.ts @@ -0,0 +1,31 @@ +import { BSONValue } from './bson_value'; + +/** @public */ +export interface MaxKeyExtended { + $maxKey: 1; +} + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +export class MaxKey extends BSONValue { + get _bsontype(): 'MaxKey' { + return 'MaxKey'; + } + + /** @internal */ + toExtendedJSON(): MaxKeyExtended { + return { $maxKey: 1 }; + } + + /** @internal */ + static fromExtendedJSON(): MaxKey { + return new MaxKey(); + } + + inspect(): string { + return 'new MaxKey()'; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/min_key.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/min_key.ts new file mode 100644 index 00000000..244e645a --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/min_key.ts @@ -0,0 +1,31 @@ +import { BSONValue } from './bson_value'; + +/** @public */ +export interface MinKeyExtended { + $minKey: 1; +} + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +export class MinKey extends BSONValue { + get _bsontype(): 'MinKey' { + return 'MinKey'; + } + + /** @internal */ + toExtendedJSON(): MinKeyExtended { + return { $minKey: 1 }; + } + + /** @internal */ + static fromExtendedJSON(): MinKey { + return new MinKey(); + } + + inspect(): string { + return 'new MinKey()'; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/objectid.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/objectid.ts new file mode 100644 index 00000000..2a3cd140 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/objectid.ts @@ -0,0 +1,546 @@ +import { BSONValue } from './bson_value'; +import { BSONError } from './error'; +import { type InspectFn, defaultInspect } from './parser/utils'; +import { ByteUtils } from './utils/byte_utils'; +import { NumberUtils } from './utils/number_utils'; + +/** ObjectId hexString cache @internal */ +const __idCache = new WeakMap(); // TODO(NODE-6549): convert this to #__id private field when target updated to ES2022 + +/** byte (0-255): its 2-character lowercase hex pair @internal */ +const byteToHex: string[] = []; +for (let n = 0; n < 256; n++) byteToHex.push(n.toString(16).padStart(2, '0')); + +/** hex char code: nibble (0-15); indices are the codes of 0-9, a-f, A-F @internal */ +const hexCharCodeToNibble = new Int8Array(103); +for (let c = 48; c <= 57; c++) hexCharCodeToNibble[c] = c - 48; // '0'-'9' +for (let c = 65; c <= 70; c++) hexCharCodeToNibble[c] = c - 55; // 'A'-'F' +for (let c = 97; c <= 102; c++) hexCharCodeToNibble[c] = c - 87; // 'a'-'f' + +/** @public */ +export interface ObjectIdLike { + id: string | Uint8Array; + __id?: string; + toHexString(): string; +} + +/** @public */ +export interface ObjectIdExtended { + $oid: string; +} + +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +export class ObjectId extends BSONValue { + get _bsontype(): 'ObjectId' { + return 'ObjectId'; + } + + /** @internal */ + private static index = 0; + + /** Unique sequence for the current process (initialized on first use) + * @internal + */ + private static PROCESS_UNIQUE: Uint8Array | null = null; + + /** @internal */ + private static resetState = (): void => { + this.index = Math.floor(Math.random() * 0x1000000); + // PROCESS_UNIQUE is (re)generated lazily on first use rather than here, so that merely loading + // BSON never calls secure random at module-evaluation time. Runtimes such as Cloudflare Workers + // forbid generating random values in the global scope. + this.PROCESS_UNIQUE = null; + }; + + static { + this.resetState(); + // https://nodejs.org/api/v8.html#startup-snapshot-api + // @ts-expect-error Node.js types not present since this is an optional API + const { startupSnapshot } = globalThis?.process?.getBuiltinModule?.('v8') ?? {}; + if (startupSnapshot?.isBuildingSnapshot?.()) { + startupSnapshot?.addDeserializeCallback?.(this.resetState); + } + } + + static cacheHexString: boolean; + + /** + * The 12 ObjectId bytes packed as four 24-bit integers (bytes 0-2, 3-5, 6-8, 9-11). + * The 24-bit width keeps each value inside V8's small-integer (Smi) range so it stays stored + * inline, which keeps the object small. The fields are enumerable own properties, so two + * ObjectIds with the same bytes stay equal under structural comparison such as deepStrictEqual. + * @internal + */ + private i0!: number; + /** @internal */ + private i1!: number; + /** @internal */ + private i2!: number; + /** @internal */ + private i3!: number; + + /** Pack 12 bytes into the four integer fields. @internal */ + private setFromBytes(b: Uint8Array, offset = 0): void { + this.i0 = (b[offset] << 16) | (b[offset + 1] << 8) | b[offset + 2]; + this.i1 = (b[offset + 3] << 16) | (b[offset + 4] << 8) | b[offset + 5]; + this.i2 = (b[offset + 6] << 16) | (b[offset + 7] << 8) | b[offset + 8]; + this.i3 = (b[offset + 9] << 16) | (b[offset + 10] << 8) | b[offset + 11]; + } + + /** + * Pack a validated 24-character hex string into the four integer fields. The caller must have + * already validated the string; every character is assumed to be a hex digit. + * @internal + */ + private setFromHex(s: string): void { + const t = hexCharCodeToNibble; + this.i0 = + (t[s.charCodeAt(0)] << 20) | + (t[s.charCodeAt(1)] << 16) | + (t[s.charCodeAt(2)] << 12) | + (t[s.charCodeAt(3)] << 8) | + (t[s.charCodeAt(4)] << 4) | + t[s.charCodeAt(5)]; + this.i1 = + (t[s.charCodeAt(6)] << 20) | + (t[s.charCodeAt(7)] << 16) | + (t[s.charCodeAt(8)] << 12) | + (t[s.charCodeAt(9)] << 8) | + (t[s.charCodeAt(10)] << 4) | + t[s.charCodeAt(11)]; + this.i2 = + (t[s.charCodeAt(12)] << 20) | + (t[s.charCodeAt(13)] << 16) | + (t[s.charCodeAt(14)] << 12) | + (t[s.charCodeAt(15)] << 8) | + (t[s.charCodeAt(16)] << 4) | + t[s.charCodeAt(17)]; + this.i3 = + (t[s.charCodeAt(18)] << 20) | + (t[s.charCodeAt(19)] << 16) | + (t[s.charCodeAt(20)] << 12) | + (t[s.charCodeAt(21)] << 8) | + (t[s.charCodeAt(22)] << 4) | + t[s.charCodeAt(23)]; + } + + /** To generate a new ObjectId, use ObjectId() with no argument. */ + constructor(); + /** + * Create ObjectId from a 24 character hex string. + * + * @param inputId - A 24 character hex string. + */ + constructor(inputId: string); + /** + * Create ObjectId from the BSON ObjectId type. + * + * @param inputId - The BSON ObjectId type. + */ + constructor(inputId: ObjectId); + /** + * Create ObjectId from the object type that has the toHexString method. + * + * @param inputId - The ObjectIdLike type. + */ + constructor(inputId: ObjectIdLike); + /** + * Create ObjectId from a 12 byte binary Buffer. + * + * @param inputId - A 12 byte binary Buffer. + */ + constructor(inputId: Uint8Array); + /** + * Implementation overload. + * + * @param inputId - All input types that are used in the constructor implementation. + */ + constructor(inputId?: string | ObjectId | ObjectIdLike | Uint8Array); + /** + * Read 12 bytes from `source` starting at `offset` directly into the packed fields. + * Used by the deserializer on a hot path. + * @internal + */ + constructor(source: Uint8Array, offset: number); + /** + * Create a new ObjectId. + * + * @param inputId - An input value to create a new ObjectId from. + */ + constructor(inputId?: string | ObjectId | ObjectIdLike | Uint8Array, offset?: number) { + super(); + if (typeof offset === 'number') { + // Fast path used by the deserializer: read the 12 bytes directly from source at offset. + this.setFromBytes(inputId as Uint8Array, offset); + return; + } + // workingId is set based on type of input and whether valid id exists for the input + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if ( + ObjectId.is(inputId) && + typeof inputId.i0 === 'number' && + typeof inputId.i1 === 'number' && + typeof inputId.i2 === 'number' && + typeof inputId.i3 === 'number' + ) { + // Same-build ObjectId: copy the packed fields directly. The general path below would + // hit the id getter (which allocates) and then re-decode a hex round trip. + this.i0 = inputId.i0; + this.i1 = inputId.i1; + this.i2 = inputId.i2; + this.i3 = inputId.i3; + return; + } + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = ByteUtils.fromHex(inputId.toHexString()); + } else { + workingId = inputId.id; + } + } else { + workingId = inputId; + } + + // The following cases use workingId to construct an ObjectId + if (workingId == null) { + // The most common use case (blank id, new objectId instance): + // generate a new id directly into the packed fields. + const time = Math.floor(Date.now() / 1000); + const inc = ObjectId.getInc(); + const pu = (ObjectId.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + this.i0 = (time >>> 8) & 0xffffff; + this.i1 = ((time & 0xff) << 16) | (pu[0] << 8) | pu[1]; + this.i2 = (pu[2] << 16) | (pu[3] << 8) | pu[4]; + this.i3 = inc & 0xffffff; + } else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // Normalize a non-Uint8Array view (DataView, Int8Array, ...) to a byte buffer so its + // bytes are read correctly. + this.setFromBytes( + workingId instanceof Uint8Array ? workingId : ByteUtils.toLocalBufferType(workingId) + ); + } else if (typeof workingId === 'string') { + if (ObjectId.validateHexString(workingId)) { + this.setFromHex(workingId); + // If we are caching the hex string + if (ObjectId.cacheHexString) { + __idCache.set(this, workingId); + } + } else { + throw new BSONError( + 'input must be a 24 character hex string, 12 byte Uint8Array, or an integer' + ); + } + } else { + throw new BSONError('Argument passed in does not match the accepted types'); + } + } + + /** + * The ObjectId bytes, rebuilt from the packed integer fields on each access. Every read + * returns a freshly allocated 12-byte buffer. + * @readonly + */ + get id(): Uint8Array { + const b = ByteUtils.allocateUnsafe(12); + b[0] = (this.i0 >>> 16) & 0xff; + b[1] = (this.i0 >>> 8) & 0xff; + b[2] = this.i0 & 0xff; + b[3] = (this.i1 >>> 16) & 0xff; + b[4] = (this.i1 >>> 8) & 0xff; + b[5] = this.i1 & 0xff; + b[6] = (this.i2 >>> 16) & 0xff; + b[7] = (this.i2 >>> 8) & 0xff; + b[8] = this.i2 & 0xff; + b[9] = (this.i3 >>> 16) & 0xff; + b[10] = (this.i3 >>> 8) & 0xff; + b[11] = this.i3 & 0xff; + return b; + } + + set id(value: Uint8Array) { + const bytes = value instanceof Uint8Array ? value : ByteUtils.toLocalBufferType(value); + this.setFromBytes(bytes); + if (ObjectId.cacheHexString) { + __idCache.set(this, ByteUtils.toHex(bytes)); + } + } + + /** + * @internal + * Validates the input string is a valid hex representation of an ObjectId. + */ + private static validateHexString(string: string): boolean { + if (string?.length !== 24) return false; + for (let i = 0; i < 24; i++) { + const char = string.charCodeAt(i); + if ( + // Check for ASCII 0-9 + (char >= 48 && char <= 57) || + // Check for ASCII a-f + (char >= 97 && char <= 102) || + // Check for ASCII A-F + (char >= 65 && char <= 70) + ) { + continue; + } + return false; + } + return true; + } + + /** Returns the ObjectId id as a 24 lowercase character hex string representation */ + toHexString(): string { + if (ObjectId.cacheHexString) { + const __id = __idCache.get(this); + if (__id) return __id; + } + + // Encode the four packed integers to hex via a byte->pair lookup table. + const i0 = this.i0; + const i1 = this.i1; + const i2 = this.i2; + const i3 = this.i3; + const hexString = + byteToHex[(i0 >>> 16) & 0xff] + + byteToHex[(i0 >>> 8) & 0xff] + + byteToHex[i0 & 0xff] + + byteToHex[(i1 >>> 16) & 0xff] + + byteToHex[(i1 >>> 8) & 0xff] + + byteToHex[i1 & 0xff] + + byteToHex[(i2 >>> 16) & 0xff] + + byteToHex[(i2 >>> 8) & 0xff] + + byteToHex[i2 & 0xff] + + byteToHex[(i3 >>> 16) & 0xff] + + byteToHex[(i3 >>> 8) & 0xff] + + byteToHex[i3 & 0xff]; + + if (ObjectId.cacheHexString) { + __idCache.set(this, hexString); + } + + return hexString; + } + + /** + * Update the ObjectId index + * @internal + */ + private static getInc(): number { + return (ObjectId.index = (ObjectId.index + 1) % 0x1000000); + } + + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + static generate(time?: number): Uint8Array { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + + const inc = ObjectId.getInc(); + const buffer = ByteUtils.allocateUnsafe(12); + + // 4-byte timestamp + NumberUtils.setInt32BE(buffer, 0, time); + + // 5-byte process unique (generated lazily on first use, see NODE-7667) + const PROCESS_UNIQUE = (this.PROCESS_UNIQUE ??= ByteUtils.randomBytes(5)); + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >>> 8) & 0xff; + buffer[9] = (inc >>> 16) & 0xff; + + return buffer; + } + + /** + * Converts the id into a 24 character hex string for printing, unless encoding is provided. + * @param encoding - hex or base64 + */ + toString(encoding?: 'hex' | 'base64'): string { + if (encoding === 'base64') return ByteUtils.toBase64(this.id); + if (encoding === 'hex') return this.toHexString(); + return this.toHexString(); + } + + /** Converts to its JSON the 24 character hex string representation. */ + toJSON(): string { + return this.toHexString(); + } + + /** @internal */ + private static is(variable: unknown): variable is ObjectId { + return ( + variable != null && + typeof variable === 'object' && + '_bsontype' in variable && + variable._bsontype === 'ObjectId' + ); + } + + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + equals(otherId: string | ObjectId | ObjectIdLike | undefined | null): boolean { + if (otherId === undefined || otherId === null) { + return false; + } + + if ( + ObjectId.is(otherId) && + typeof otherId.i0 === 'number' && + typeof otherId.i1 === 'number' && + typeof otherId.i2 === 'number' && + typeof otherId.i3 === 'number' + ) { + // Same-build ObjectId (all four packed fields present): compare them directly. i3 (the + // counter / low bytes) differs most often between two ids, so checking it first fails fast. + return ( + this.i3 === otherId.i3 && + this.i0 === otherId.i0 && + this.i1 === otherId.i1 && + this.i2 === otherId.i2 + ); + } + + if (typeof otherId === 'string') { + return otherId.toLowerCase() === this.toHexString(); + } + + if (typeof otherId === 'object' && typeof otherId.toHexString === 'function') { + // ObjectId-like values, and ObjectIds from a different bson build, compare by their + // public hex representation. + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + + return false; + } + + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date { + const timestamp = new Date(); + // Bytes 0-3 (the big-endian timestamp) are i0's three bytes followed by i1's top byte. + const time = this.i0 * 0x100 + (this.i1 >>> 16); + timestamp.setTime(time * 1000); + return timestamp; + } + + /** @internal */ + static createPk(): ObjectId { + return new ObjectId(); + } + + /** @internal */ + serializeInto(uint8array: Uint8Array, index: number): 12 { + uint8array[index] = (this.i0 >>> 16) & 0xff; + uint8array[index + 1] = (this.i0 >>> 8) & 0xff; + uint8array[index + 2] = this.i0 & 0xff; + uint8array[index + 3] = (this.i1 >>> 16) & 0xff; + uint8array[index + 4] = (this.i1 >>> 8) & 0xff; + uint8array[index + 5] = this.i1 & 0xff; + uint8array[index + 6] = (this.i2 >>> 16) & 0xff; + uint8array[index + 7] = (this.i2 >>> 8) & 0xff; + uint8array[index + 8] = this.i2 & 0xff; + uint8array[index + 9] = (this.i3 >>> 16) & 0xff; + uint8array[index + 10] = (this.i3 >>> 8) & 0xff; + uint8array[index + 11] = this.i3 & 0xff; + return 12; + } + + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + static createFromTime(time: number): ObjectId { + const buffer = ByteUtils.allocate(12); + for (let i = 11; i >= 4; i--) buffer[i] = 0; + // Encode time into first 4 bytes + NumberUtils.setInt32BE(buffer, 0, time); + // Return the new objectId + return new ObjectId(buffer); + } + + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + static createFromHexString(hexString: string): ObjectId { + if (hexString?.length !== 24) { + throw new BSONError('hex string must be 24 characters'); + } + + return new ObjectId(ByteUtils.fromHex(hexString)); + } + + /** Creates an ObjectId instance from a base64 string */ + static createFromBase64(base64: string): ObjectId { + if (base64?.length !== 16) { + throw new BSONError('base64 string must be 16 characters'); + } + + return new ObjectId(ByteUtils.fromBase64(base64)); + } + + /** + * Checks if a value can be used to create a valid bson ObjectId + * @param id - any JS value + */ + static isValid(id: string | ObjectId | ObjectIdLike | Uint8Array): boolean { + if (id == null) return false; + if (typeof id === 'string') return ObjectId.validateHexString(id); + + try { + new ObjectId(id); + return true; + } catch { + return false; + } + } + + /** @internal */ + toExtendedJSON(): ObjectIdExtended { + if (this.toHexString) return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + + /** @internal */ + static fromExtendedJSON(doc: ObjectIdExtended): ObjectId { + return new ObjectId(doc.$oid); + } + + /** @internal */ + private isCached(): boolean { + return ObjectId.cacheHexString && __idCache.has(this); + } + + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + */ + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + return `new ObjectId(${inspect(this.toHexString(), options)})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parse_utf8.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parse_utf8.ts new file mode 100644 index 00000000..045a9080 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parse_utf8.ts @@ -0,0 +1,35 @@ +import { BSONError } from './error'; + +type TextDecoder = { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + decode(input?: Uint8Array): string; +}; +type TextDecoderConstructor = { + new (label: 'utf8', options: { fatal: boolean; ignoreBOM?: boolean }): TextDecoder; +}; + +// parse utf8 globals +declare const TextDecoder: TextDecoderConstructor; +let TextDecoderFatal: TextDecoder; +let TextDecoderNonFatal: TextDecoder; + +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +export function parseUtf8(buffer: Uint8Array, start: number, end: number, fatal: boolean): string { + if (fatal) { + TextDecoderFatal ??= new TextDecoder('utf8', { fatal: true }); + try { + return TextDecoderFatal.decode(buffer.subarray(start, end)); + } catch (cause) { + throw new BSONError('Invalid UTF-8 string in BSON document', { cause }); + } + } + TextDecoderNonFatal ??= new TextDecoder('utf8', { fatal: false }); + return TextDecoderNonFatal.decode(buffer.subarray(start, end)); +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/calculate_size.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/calculate_size.ts new file mode 100644 index 00000000..63a678c1 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/calculate_size.ts @@ -0,0 +1,277 @@ +import { Binary } from '../binary'; +import type { Document } from '../bson'; +import { BSONError, BSONVersionError } from '../error'; +import * as constants from '../constants'; +import { ByteUtils } from '../utils/byte_utils'; +import { isAnyArrayBuffer, isDate, isMap, isRegExp } from './utils'; + +/** @internal */ +interface SizeFrame { + object: Document; + /** Each frame carries its own ignoreUndefined so DBRef fields can force ignoreUndefined=true + * regardless of the caller's setting. */ + ignoreUndefined: boolean; + /** + * Exit frames carry no work. They mark the point at which obj's entire subtree has been + * drained, so obj can leave the ancestor path. + */ + exit: boolean; +} + +export function internalCalculateObjectSize( + object: Document, + serializeFunctions?: boolean, + ignoreUndefined?: boolean +): number { + const objectStack: SizeFrame[] = [ + { object, ignoreUndefined: ignoreUndefined ?? false, exit: false } + ]; + // The chain of objects from the root down to the one currently being walked. + const path = new Set(); + let total = 0; + + while (objectStack.length > 0) { + const frame = objectStack.pop()!; + + if (frame.exit) { + path.delete(frame.object); + continue; + } + + const { object: obj, ignoreUndefined: frameIgnoreUndefined } = frame; + path.add(obj); + // Re-push this frame as its own exit marker. + // The frame itself is popped when the subtree is exhausted. + frame.exit = true; + objectStack.push(frame); + + total += 5; // 4-byte size field + null terminator + + const isObjArray = Array.isArray(obj); + const isObjMap = !isObjArray && (obj instanceof Map || isMap(obj)); + let target = obj; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (!isObjArray && !isObjMap && typeof (obj as any)?.toBSON === 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + target = (obj as any).toBSON(); + } + + if (isObjArray) { + const array = target as unknown[]; + for (let i = 0; i < array.length; i++) { + total += calculateElementSize( + i.toString(), + array[i], + serializeFunctions, + true, + frameIgnoreUndefined, + objectStack, + path + ); + } + } else if (isObjMap) { + for (const [key, value] of target as Map) { + total += calculateElementSize( + key, + value, + serializeFunctions, + false, + frameIgnoreUndefined, + objectStack, + path + ); + } + } else { + for (const key of Object.keys(target)) { + total += calculateElementSize( + key, + target[key], + serializeFunctions, + false, + frameIgnoreUndefined, + objectStack, + path + ); + } + } + } + + return total; +} + +/** @internal */ +function calculateElementSize( + name: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + serializeFunctions = false, + isArray = false, + ignoreUndefined = false, + objectStack: SizeFrame[], + path: Set +): number { + // If we have toBSON defined, override the current object + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + switch (typeof value) { + case 'string': + return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1; + case 'number': + if ( + Math.floor(value) === value && + value >= constants.JS_INT_MIN && + value <= constants.JS_INT_MAX + ) { + if (value >= constants.BSON_INT32_MIN && value <= constants.BSON_INT32_MAX) { + // 32 bit + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } else { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + } else { + // 64 bit + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) return ByteUtils.utf8ByteLength(name) + 1 + 1; + return 0; + case 'boolean': + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 1); + case 'object': + if ( + value != null && + typeof value._bsontype === 'string' && + value[constants.BSON_VERSION_SYMBOL] !== constants.BSON_MAJOR_VERSION + ) { + throw new BSONVersionError(); + } else if (value == null || value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') { + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } else if (value._bsontype === 'ObjectId') { + return ByteUtils.utf8ByteLength(name) + 1 + (12 + 1); + } else if (value instanceof Date || isDate(value)) { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } else if ( + ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value) + ) { + return ByteUtils.utf8ByteLength(name) + 1 + (1 + 4 + 1) + value.byteLength; + } else if ( + value._bsontype === 'Long' || + value._bsontype === 'Double' || + value._bsontype === 'Timestamp' + ) { + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + } else if (value._bsontype === 'Decimal128') { + return ByteUtils.utf8ByteLength(name) + 1 + (16 + 1); + } else if (value._bsontype === 'Int32') { + return ByteUtils.utf8ByteLength(name) + 1 + (4 + 1); + } else if (value._bsontype === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + if (path.has(value.scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value.scope, ignoreUndefined, exit: false }); + return ( + ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1 + ); + } else { + return ( + ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.code.toString()) + + 1 + ); + } + } else if (value._bsontype === 'Binary') { + const binary: Binary = value; + // Check what kind of subtype we have + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1 + 4); + } else { + return ByteUtils.utf8ByteLength(name) + 1 + (binary.position + 1 + 4 + 1); + } + } else if (value._bsontype === 'BSONSymbol') { + return ( + ByteUtils.utf8ByteLength(name) + 1 + ByteUtils.utf8ByteLength(value.value) + 4 + 1 + 1 + ); + } else if (value._bsontype === 'DBRef') { + // Set up correct object for serialization + const ordered_values = Object.assign( + { + $ref: value.collection, + $id: value.oid + }, + value.fields + ); + + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + + // DBRef fields always use ignoreUndefined=true to match serializeInto behavior. + // No cycle check: ordered_values is freshly built here, so it can never already be an + // ancestor. A cycle through value.fields is caught when its contents are walked. + objectStack.push({ object: ordered_values, ignoreUndefined: true, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } else if (value instanceof RegExp || isRegExp(value)) { + return ( + ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.source) + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1 + ); + } else if (value._bsontype === 'BSONRegExp') { + return ( + ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + ByteUtils.utf8ByteLength(value.pattern) + + 1 + + ByteUtils.utf8ByteLength(value.options) + + 1 + ); + } else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + objectStack.push({ object: value, ignoreUndefined, exit: false }); + return ByteUtils.utf8ByteLength(name) + 1 + 1; + } + case 'function': + if (serializeFunctions) { + return ( + ByteUtils.utf8ByteLength(name) + + 1 + + 1 + + 4 + + ByteUtils.utf8ByteLength(value.toString()) + + 1 + ); + } + return 0; + case 'bigint': + return ByteUtils.utf8ByteLength(name) + 1 + (8 + 1); + case 'symbol': + return 0; + default: + throw new BSONError(`Unrecognized JS type: ${typeof value}`); + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/deserializer.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/deserializer.ts new file mode 100644 index 00000000..06eb6a39 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/deserializer.ts @@ -0,0 +1,793 @@ +import { Binary, UUID } from '../binary'; +import type { Document } from '../bson'; +import { Code } from '../code'; +import * as constants from '../constants'; +import { DBRef, isDBRefLike } from '../db_ref'; +import { Decimal128 } from '../decimal128'; +import { Double } from '../double'; +import { BSONError } from '../error'; +import { Int32 } from '../int_32'; +import { Long } from '../long'; +import { MaxKey } from '../max_key'; +import { MinKey } from '../min_key'; +import { ObjectId } from '../objectid'; +import { BSONRegExp } from '../regexp'; +import { BSONSymbol } from '../symbol'; +import { Timestamp } from '../timestamp'; +import { ByteUtils } from '../utils/byte_utils'; +import { NumberUtils } from '../utils/number_utils'; + +/** @public */ +export interface DeserializeOptions { + /** + * when deserializing a Long return as a BigInt. + * @defaultValue `false` + */ + useBigInt64?: boolean; + /** + * when deserializing a Long will fit it into a Number if it's smaller than 53 bits. + * @defaultValue `true` + */ + promoteLongs?: boolean; + /** + * when deserializing a Binary will return it as a node.js Buffer instance. + * @defaultValue `false` + */ + promoteBuffers?: boolean; + /** + * when deserializing will promote BSON values to their Node.js closest equivalent types. + * @defaultValue `true` + */ + promoteValues?: boolean; + /** + * allow to specify if there what fields we wish to return as unserialized raw buffer. + * @defaultValue `null` + */ + fieldsAsRaw?: Document; + /** + * return BSON regular expressions as BSONRegExp instances. + * @defaultValue `false` + */ + bsonRegExp?: boolean; + /** + * allows the buffer to be larger than the parsed BSON object. + * @defaultValue `false` + */ + allowObjectSmallerThanBufferSize?: boolean; + /** + * Offset into buffer to begin reading document from + * @defaultValue `0` + */ + index?: number; + + raw?: boolean; + /** Allows for opt-out utf-8 validation for all keys or + * specified keys. Must be all true or all false. + * + * @example + * ```js + * // disables validation on all keys + * validation: { utf8: false } + * + * // enables validation only on specified keys a, b, and c + * validation: { utf8: { a: true, b: true, c: true } } + * + * // disables validation only on specified keys a, b + * validation: { utf8: { a: false, b: false } } + * ``` + */ + validation?: { utf8: boolean | Record | Record }; +} + +// Internal long versions +const JS_INT_MAX_LONG = Long.fromNumber(constants.JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(constants.JS_INT_MIN); + +export function internalDeserialize( + buffer: Uint8Array, + options: DeserializeOptions, + isArray?: boolean +): Document { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + // Read the document size + const size = NumberUtils.getInt32LE(buffer, index); + + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + + if (size + index > buffer.byteLength) { + throw new BSONError( + `(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})` + ); + } + + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError( + "One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00" + ); + } + + // Start deserialization + return deserializeObject(buffer, index, options, isArray); +} + +interface NestedParsingFrame { + // One of 3 supported types: + // - constants.BSON_DATA_OBJECT + // - constants.BSON_DATA_ARRAY + // - constants.BSON_DATA_CODE_W_SCOPE + elementType: + | typeof constants.BSON_DATA_OBJECT + | typeof constants.BSON_DATA_ARRAY + | typeof constants.BSON_DATA_CODE_W_SCOPE; + // Document that we will fill out as we parse the nested object + holdingDocument: Document; + // The name of the key we will set the parsed object on once we finish parsing the nested object, this is used in the onComplete callback to know where to set the parsed nested object in the parent document + propertyName: string | number; + // The index in the buffer where the current object ends, used to know when we are done parsing the current object and can pop the stack + lastIndex: number; + // Whether the current frame is parsing an array, used to know whether to interpret keys as strings or array indices + isArray: boolean; + // The next array index to use if this frame is parsing an array, used to assign numeric keys to array elements without having to utf-8 decode the key from the buffer + arrayIndex: number; + // When true, all objects in this frame will be returned as raw bson buffers without parsing. + // This is used when the fieldsAsRaw option is used on a parent object, and is inherited by nested frames. + // It can also be set to true if the global raw option is set, but it cannot be set to true for a frame if the global raw option is false. + raw: boolean; + // When true, this frame may be a DBRef. This is set to false if we encounter a key that is not valid for a DBRef, and is left as null for arrays since they cannot be DBRefs. + isPossibleDBRef: boolean | null; + // The utf-8 validation setting for this frame, used to determine whether to utf-8 validate keys in this frame. This is determined based on the global utf-8 validation setting and the specific keys specified in the validation option. + validationSetting: boolean; + functionString: string | null; // only used for Code with Scope + // The enclosing frame, or null at the top level. The parsing stack is a linked list threaded + // through this field rather than a separate array, which avoids array push/pop churn per frame. + prev: NestedParsingFrame | null; +} + +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + +// Assigns a parsed value into the destination document, guarding the __proto__ key to avoid +// prototype pollution. +function assignValue(dest: Document, name: string | number, value: unknown): void { + if (name === '__proto__') { + Object.defineProperty(dest, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } else { + dest[name] = value; + } +} + +// Promotes a plain document to a DBRef instance when it has the DBRef shape ($ref/$id[/$db]). +function toPotentialDbRef(doc: Document): DBRef | Document { + if (isDBRefLike(doc)) { + const { $ref, $id, $db, ...fields } = doc; + return new DBRef($ref, $id, $db, fields); + } + return doc; +} + +function deserializeObject( + buffer: Uint8Array, + index: number, + options: DeserializeOptions, + isArray = false +) { + // Settings configured from options parameter + + // Strips prototype chain so inherited properties don't affect option reads. + options = { ...options }; + + // Used to track fields that should be returned as raw bson buffers without parsing, this is set based on the fieldsAsRaw option and is inherited by nested frames when parsing nested objects + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + + // Return raw bson buffer instead of parsing it + const raw = options['raw'] == null ? false : options['raw']; + + // Return BSONRegExp objects instead of native regular expressions + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + + // Controls the promotion of values vs wrapper classes + const promoteBuffers = options.promoteBuffers ?? false; + const promoteLongs = options.promoteLongs ?? true; + const promoteValues = options.promoteValues ?? true; + const useBigInt64 = options.useBigInt64 ?? false; + + // Validate bigint and long promotion settings + if (useBigInt64 && !promoteValues) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + if (useBigInt64 && !promoteLongs) { + throw new BSONError('Must either request bigint or Long for int64 deserialization'); + } + + // Ensures default validation option if none given + const validation = options.validation == null ? { utf8: true } : options.validation; + + // Shows if global utf-8 validation is enabled or disabled + let globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + let validationSetting: boolean; + // Set of keys either to enable or disable validation on + let utf8KeysSet; + + // Check for boolean uniformity and empty validation option + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + utf8KeysSet = new Set(); + + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + + // Begin parsing the document + + // Set the start index + const startIndex = index; + + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) throw new BSONError('corrupt bson message < 5 bytes long'); + + // Read the document size + const size = NumberUtils.getInt32LE(buffer, index); + // Skip past the size field + index += 4; + + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) throw new BSONError('corrupt bson message'); + + // Create holding object + const rootObject: Document = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + let arrayIndex = 0; + + let isPossibleDBRef = isArray ? false : null; + + // Top of the parsing stack (a linked list via each frame's `prev`), or null at the top level. + let currentFrame: NestedParsingFrame | null = null; + // Destination object for the current frame (the parent's holdingDocument, or rootObject at the + // top level). Maintained alongside currentFrame so per-field assignment never recomputes it. + let currentDest: Document = rootObject; + // Whether the current frame is an array. Maintained alongside currentFrame so the per-field key + // logic does not branch on currentFrame every iteration. + let currentIsArray = isArray; + + // While we have more left data left keep parsing + while (true) { + // Read the type + const elementType = buffer[index++]; + + // If we get a zero it's the last byte, exit + if (elementType === 0) { + // 0 byte marks end of document. + if (currentFrame) { + // If we're in a frame, that means the end of the current nested document + if (index === currentFrame.lastIndex) { + // Snapshot the completed frame before updating currentFrame to the parent. + const completedFrame: NestedParsingFrame = currentFrame; + currentFrame = completedFrame.prev; + if (currentFrame === null) { + currentDest = rootObject; + currentIsArray = isArray; + } else { + currentDest = currentFrame.holdingDocument; + currentIsArray = currentFrame.isArray; + } + // finish the frame + let result: Document = completedFrame.holdingDocument; + switch (completedFrame.elementType) { + case constants.BSON_DATA_OBJECT: + // if this is a DBRef, we need to construct a DBRef object instead of a plain object + if (completedFrame.isPossibleDBRef) { + result = toPotentialDbRef(result); + } + break; + case constants.BSON_DATA_ARRAY: + // nothing to do, the holding document is already an array and the keys were set as numeric indices + break; + case constants.BSON_DATA_CODE_W_SCOPE: + // the holding document is the scope, we need to construct a Code object with the function string and scope + result = new Code(completedFrame.functionString!, completedFrame.holdingDocument); + break; + default: + throw new BSONError('Unexpected element type in frame stack'); + } + // set the value in the parent document (currentDest now points to the parent's document) + assignValue(currentDest, completedFrame.propertyName, result); + continue; + } else { + // Current index does not match the last index of the frame, the document is malformed + if (currentFrame.elementType === constants.BSON_DATA_ARRAY) { + throw new BSONError('corrupted array bson'); + } + throw new BSONError('Bad BSON Document: object not properly terminated'); + } + } else { + // If we're not in a frame, that means the end of the root document, so we break out of the loop and return the object + break; + } + } + + // Get the start search index + let i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) throw new BSONError('Bad BSON Document: illegal CString'); + + // Represents the key + const name = currentIsArray + ? currentFrame !== null + ? currentFrame.arrayIndex++ + : arrayIndex++ + : ByteUtils.toUTF8(buffer, index, i, false); + + // shouldValidateKey is true if the key should be validated, false otherwise. + // Within a nested frame the original code passed a collapsed boolean validation option, + // so all keys in the frame are validated uniformly using the frame's setting. + let shouldValidateKey: boolean; + if (currentFrame !== null) { + shouldValidateKey = currentFrame.validationSetting; + } else if (globalUTFValidation || utf8KeysSet?.has(name)) { + shouldValidateKey = validationSetting; + } else { + shouldValidateKey = !validationSetting; + } + + // Route DBRef key tracking to the current frame; the root variable handles the root doc. + if (currentFrame !== null) { + if (currentFrame.isPossibleDBRef !== false && typeof name === 'string' && name[0] === '$') { + currentFrame.isPossibleDBRef = allowedDBRefKeys.test(name); + } + } else if (isPossibleDBRef !== false && (name as string)[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name as string); + } + let value; + let isDeferredValue = false; + + index = i + 1; + + if (elementType === constants.BSON_DATA_STRING) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + value = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_OID) { + // ObjectId reads these 12 bytes from the wire buffer at this offset into its own fields + // and keeps no reference to the source, so the buffer can be passed directly. + value = new ObjectId(buffer, index); + index = index + 12; + } else if (elementType === constants.BSON_DATA_INT && promoteValues === false) { + value = new Int32(NumberUtils.getInt32LE(buffer, index)); + index += 4; + } else if (elementType === constants.BSON_DATA_INT) { + value = NumberUtils.getInt32LE(buffer, index); + index += 4; + } else if (elementType === constants.BSON_DATA_NUMBER) { + value = NumberUtils.getFloat64LE(buffer, index); + index += 8; + if (promoteValues === false) value = new Double(value); + } else if (elementType === constants.BSON_DATA_DATE) { + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + + value = new Date(new Long(lowBits, highBits).toNumber()); + } else if (elementType === constants.BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } else if (elementType === constants.BSON_DATA_OBJECT) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + + // We have a raw value: either the global raw option, or the parent frame requested raw elements. + if (raw || (currentFrame?.raw ?? false)) { + value = buffer.subarray(index, index + objectSize); + index = index + objectSize; + } else { + isDeferredValue = true; + const objectFrame: NestedParsingFrame = { + holdingDocument: {}, + elementType: constants.BSON_DATA_OBJECT, + propertyName: name, + functionString: null, + lastIndex: index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, // we don't know if this is a DBRef until we parse the keys, so we start with null and set to false if we encounter a key that is not valid for a DBRef + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = objectFrame; + currentDest = objectFrame.holdingDocument; + currentIsArray = false; + index = index + 4; + } + } else if (elementType === constants.BSON_DATA_ARRAY) { + const objectSize = NumberUtils.getInt32LE(buffer, index); + + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad embedded array length in bson'); + + // Stop index + const stopIndex = index + objectSize; + + // fieldsAsRaw match: push with raw=true so embedded objects inside come back as raw bytes. + // Also propagate raw from the parent frame (nested arrays inside a raw array stay raw). + const arrayRaw = !!(fieldsAsRaw && fieldsAsRaw[name]) || (currentFrame?.raw ?? false); + isDeferredValue = true; + const arrayFrame: NestedParsingFrame = { + holdingDocument: [], + elementType: constants.BSON_DATA_ARRAY, + propertyName: name, + functionString: null, + lastIndex: stopIndex, + isArray: true, + arrayIndex: 0, + raw: arrayRaw, + isPossibleDBRef: false, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = arrayFrame; + currentDest = arrayFrame.holdingDocument; + currentIsArray = true; + index = index + 4; + } else if (elementType === constants.BSON_DATA_UNDEFINED) { + value = undefined; + } else if (elementType === constants.BSON_DATA_NULL) { + value = null; + } else if (elementType === constants.BSON_DATA_LONG) { + if (useBigInt64) { + value = NumberUtils.getBigInt64LE(buffer, index); + index += 8; + } else { + // Unpack the low and high bits + const lowBits = NumberUtils.getInt32LE(buffer, index); + const highBits = NumberUtils.getInt32LE(buffer, index + 4); + index += 8; + + const long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } else { + value = long; + } + } + } else if (elementType === constants.BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + const bytes = ByteUtils.allocateUnsafe(16); + // Copy the next 16 bytes into the bytes buffer + for (let i = 0; i < 16; i++) bytes[i] = buffer[index + i]; + // Update index + index = index + 16; + // Assign the new Decimal128 value + value = new Decimal128(bytes); + } else if (elementType === constants.BSON_DATA_BINARY) { + let binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + const totalBinarySize = binarySize; + const subType = buffer[index++]; + + // Did we have a negative binary size, throw + if (binarySize < 0) throw new BSONError('Negative binary type element size found'); + + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + + if (promoteBuffers && promoteValues) { + value = ByteUtils.toLocalBufferType(buffer.subarray(index, index + binarySize)); + } else { + value = new Binary(buffer.subarray(index, index + binarySize), subType); + if (subType === constants.BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) { + value = value.toUUID(); + } + } + + // Update the index + index = index + binarySize; + } else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const source = ByteUtils.toUTF8(buffer, index, i, false); + // Create the regexp + index = i + 1; + + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + + // For each option add the corresponding one for javascript + const optionsArray = new Array(regExpOptions.length); + + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + + value = new RegExp(source, optionsArray.join('')); + } else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const source = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const regExpOptions = ByteUtils.toUTF8(buffer, index, i, false); + index = i + 1; + + // Set the object + value = new BSONRegExp(source, regExpOptions); + } else if (elementType === constants.BSON_DATA_SYMBOL) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + const symbol = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_TIMESTAMP) { + value = new Timestamp({ + i: NumberUtils.getUint32LE(buffer, index), + t: NumberUtils.getUint32LE(buffer, index + 4) + }); + index += 8; + } else if (elementType === constants.BSON_DATA_MIN_KEY) { + value = new MinKey(); + } else if (elementType === constants.BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } else if (elementType === constants.BSON_DATA_CODE) { + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + const functionString = ByteUtils.toUTF8( + buffer, + index, + index + stringSize - 1, + shouldValidateKey + ); + + value = new Code(functionString); + + // Update parse index position + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_CODE_W_SCOPE) { + const totalSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + + // Get the code string size + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + // Check if we have a valid string + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + + // Javascript function + const functionString = ByteUtils.toUTF8( + buffer, + index, + index + stringSize - 1, + shouldValidateKey + ); + // Update parse index position + index = index + stringSize; + // Parse the element + const _index = index; + // Decode the size of the object document + const objectSize = NumberUtils.getInt32LE(buffer, index); + + if (objectSize < 5 || objectSize > buffer.length - index) + throw new BSONError('bad scope document size in code_w_scope'); + + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + + isDeferredValue = true; + const scopeFrame: NestedParsingFrame = { + holdingDocument: {}, + elementType: constants.BSON_DATA_CODE_W_SCOPE, + propertyName: name, + functionString: functionString, + lastIndex: _index + objectSize, + isArray: false, + arrayIndex: 0, + raw: false, + isPossibleDBRef: null, + validationSetting: shouldValidateKey, + prev: currentFrame + }; + currentFrame = scopeFrame; + currentDest = scopeFrame.holdingDocument; + currentIsArray = false; + index = index + 4; // move index past the size of the object, the rest of the object will be parsed in subsequent iterations of this loop + } else if (elementType === constants.BSON_DATA_DBPOINTER) { + // Get the code string size + const stringSize = NumberUtils.getInt32LE(buffer, index); + index += 4; + // Check if we have a valid string + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) + throw new BSONError('bad string length in bson'); + // Namespace + const namespace = ByteUtils.toUTF8(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + + // Read the oid + const oidBuffer = ByteUtils.allocateUnsafe(12); + for (let i = 0; i < 12; i++) oidBuffer[i] = buffer[index + i]; + const oid = new ObjectId(oidBuffer); + + // Update the index + index = index + 12; + + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } else { + throw new BSONError( + `Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"` + ); + } + + // If we have the value, set it on the target object + if (!isDeferredValue) { + assignValue(currentDest, name, value); + } + } + + // Check if we have any frames left on the stack, if we do then we had a malformed document + if (currentFrame !== null) { + throw new BSONError('corrupted bson, more objects expected based on the current document size'); + } + const object = rootObject; + + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) return object; + + // If the object is DBRef-like, create a new DBRef instance + return toPotentialDbRef(object); +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/index.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/index.ts new file mode 100644 index 00000000..f099c115 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/index.ts @@ -0,0 +1,32 @@ +import { ByteUtils } from '../../utils/byte_utils'; +import { NumberUtils } from '../../utils/number_utils'; +import { type BSONElement, parseToElements } from './parse_to_elements'; +/** + * @experimental + * @public + * + * A new set of BSON APIs that are currently experimental and not intended for production use. + */ +export type OnDemand = { + parseToElements: (this: void, bytes: Uint8Array, startOffset?: number) => Iterable; + // Types + BSONElement: BSONElement; + + // Utils + ByteUtils: ByteUtils; + NumberUtils: NumberUtils; +}; + +/** + * @experimental + * @public + */ +const onDemand: OnDemand = Object.create(null); + +onDemand.parseToElements = parseToElements; +onDemand.ByteUtils = ByteUtils; +onDemand.NumberUtils = NumberUtils; + +Object.freeze(onDemand); + +export { onDemand }; diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/parse_to_elements.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/parse_to_elements.ts new file mode 100644 index 00000000..cc5366aa --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/on_demand/parse_to_elements.ts @@ -0,0 +1,190 @@ +import { BSONOffsetError } from '../../error'; +import { NumberUtils } from '../../utils/number_utils'; + +/** + * @internal + * + * @remarks + * - This enum is const so the code we produce will inline the numbers + * - `minKey` is set to 255 so unsigned comparisons succeed + * - Modify with caution, double check the bundle contains literals + */ +const BSONElementType = { + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: 255, + maxKey: 127 +} as const; + +type BSONElementType = (typeof BSONElementType)[keyof typeof BSONElementType]; + +/** + * @public + * @experimental + */ +export type BSONElement = [ + type: number, + nameOffset: number, + nameLength: number, + offset: number, + length: number +]; + +function getSize(source: Uint8Array, offset: number) { + try { + return NumberUtils.getNonnegativeInt32LE(source, offset); + } catch (cause) { + throw new BSONOffsetError('BSON size cannot be negative', offset, { cause }); + } +} + +/** + * Searches for null terminator of a BSON element's value (Never the document null terminator) + * **Does not** bounds check since this should **ONLY** be used within parseToElements which has asserted that `bytes` ends with a `0x00`. + * So this will at most iterate to the document's terminator and error if that is the offset reached. + */ +function findNull(bytes: Uint8Array, offset: number): number { + let nullTerminatorOffset = offset; + + for (; bytes[nullTerminatorOffset] !== 0x00; nullTerminatorOffset++); + + if (nullTerminatorOffset === bytes.length - 1) { + // We reached the null terminator of the document, not a value's + throw new BSONOffsetError('Null terminator not found', offset); + } + + return nullTerminatorOffset; +} + +/** + * @public + * @experimental + */ +export function parseToElements( + bytes: Uint8Array, + startOffset: number | null = 0 +): Iterable { + startOffset ??= 0; + + if (bytes.length < 5) { + throw new BSONOffsetError( + `Input must be at least 5 bytes, got ${bytes.length} bytes`, + startOffset + ); + } + + const documentSize = getSize(bytes, startOffset); + + if (documentSize > bytes.length - startOffset) { + throw new BSONOffsetError( + `Parsed documentSize (${documentSize} bytes) does not match input length (${bytes.length} bytes)`, + startOffset + ); + } + + if (bytes[startOffset + documentSize - 1] !== 0x00) { + throw new BSONOffsetError('BSON documents must end in 0x00', startOffset + documentSize); + } + + const elements: BSONElement[] = []; + let offset = startOffset + 4; + + while (offset <= documentSize + startOffset) { + const type = bytes[offset]; + offset += 1; + + if (type === 0) { + if (offset - startOffset !== documentSize) { + throw new BSONOffsetError(`Invalid 0x00 type byte`, offset); + } + break; + } + + const nameOffset = offset; + const nameLength = findNull(bytes, offset) - nameOffset; + offset += nameLength + 1; + + let length: number; + + if ( + type === BSONElementType.double || + type === BSONElementType.long || + type === BSONElementType.date || + type === BSONElementType.timestamp + ) { + length = 8; + } else if (type === BSONElementType.int) { + length = 4; + } else if (type === BSONElementType.objectId) { + length = 12; + } else if (type === BSONElementType.decimal) { + length = 16; + } else if (type === BSONElementType.bool) { + length = 1; + } else if ( + type === BSONElementType.null || + type === BSONElementType.undefined || + type === BSONElementType.maxKey || + type === BSONElementType.minKey + ) { + length = 0; + } + // Needs a size calculation + else if (type === BSONElementType.regex) { + length = findNull(bytes, findNull(bytes, offset) + 1) + 1 - offset; + } else if ( + type === BSONElementType.object || + type === BSONElementType.array || + type === BSONElementType.javascriptWithScope + ) { + length = getSize(bytes, offset); + } else if ( + type === BSONElementType.string || + type === BSONElementType.binData || + type === BSONElementType.dbPointer || + type === BSONElementType.javascript || + type === BSONElementType.symbol + ) { + length = getSize(bytes, offset) + 4; + if (type === BSONElementType.binData) { + // binary subtype + length += 1; + } + if (type === BSONElementType.dbPointer) { + // dbPointer's objectId + length += 12; + } + } else { + throw new BSONOffsetError( + `Invalid 0x${type.toString(16).padStart(2, '0')} type byte`, + offset + ); + } + + if (length > documentSize) { + throw new BSONOffsetError('value reports length larger than document', offset); + } + + elements.push([type, nameOffset, nameLength, offset, length]); + offset += length; + } + + return elements; +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/serializer.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/serializer.ts new file mode 100644 index 00000000..08e81eca --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/serializer.ts @@ -0,0 +1,749 @@ +import { Binary, validateBinaryVector } from '../binary'; +import type { BSONSymbol, DBRef, Document, MaxKey } from '../bson'; +import { bsonType } from '../bson_value'; +import type { Code } from '../code'; +import * as constants from '../constants'; +import type { Decimal128 } from '../decimal128'; +import type { Double } from '../double'; +import { BSONError, BSONVersionError } from '../error'; +import type { Int32 } from '../int_32'; +import { Long } from '../long'; +import type { MinKey } from '../min_key'; +import type { ObjectId } from '../objectid'; +import type { BSONRegExp } from '../regexp'; +import { ByteUtils } from '../utils/byte_utils'; +import { NumberUtils } from '../utils/number_utils'; +import { isAnyArrayBuffer, isDate, isMap, isRegExp, isUint8Array } from './utils'; + +/** @public */ +export interface SerializeOptions { + /** + * the serializer will check if keys are valid. + * @defaultValue `false` + */ + checkKeys?: boolean; + /** + * serialize the javascript functions + * @defaultValue `false` + */ + serializeFunctions?: boolean; + /** + * serialize will not emit undefined fields + * note that the driver sets this to `false` + * @defaultValue `true` + */ + ignoreUndefined?: boolean; + /** @internal Resize internal buffer */ + minInternalBufferSize?: number; + /** + * the index in the buffer where we wish to start serializing into + * @defaultValue `0` + */ + index?: number; +} + +const regexp = /\x00/; // eslint-disable-line no-control-regex +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); + +function serializeString(buffer: Uint8Array, key: string, value: string, index: number) { + // Encode String type + buffer[index++] = constants.BSON_DATA_STRING; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + const size = ByteUtils.encodeUTF8Into(buffer, value, index + 4); + // Write the size of the string to buffer + NumberUtils.setInt32LE(buffer, index, size + 1); + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} + +function serializeNumber(buffer: Uint8Array, key: string, value: number, index: number) { + const isNegativeZero = Object.is(value, -0); + + const type = + !isNegativeZero && + Number.isSafeInteger(value) && + value <= constants.BSON_INT32_MAX && + value >= constants.BSON_INT32_MIN + ? constants.BSON_DATA_INT + : constants.BSON_DATA_NUMBER; + + buffer[index++] = type; + + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + index = index + numberOfWrittenBytes; + buffer[index++] = 0x00; + + if (type === constants.BSON_DATA_INT) { + index += NumberUtils.setInt32LE(buffer, index, value); + } else { + index += NumberUtils.setFloat64LE(buffer, index, value); + } + + return index; +} + +function serializeBigInt(buffer: Uint8Array, key: string, value: bigint, index: number) { + buffer[index++] = constants.BSON_DATA_LONG; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index += numberOfWrittenBytes; + buffer[index++] = 0; + + index += NumberUtils.setBigInt64LE(buffer, index, value); + + return index; +} + +function serializeNull(buffer: Uint8Array, key: string, _: unknown, index: number) { + // Set long type + buffer[index++] = constants.BSON_DATA_NULL; + + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} + +function serializeBoolean(buffer: Uint8Array, key: string, value: boolean, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_BOOLEAN; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} + +function serializeDate(buffer: Uint8Array, key: string, value: Date, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_DATE; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write the date + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + // Encode low bits + index += NumberUtils.setInt32LE(buffer, index, lowBits); + // Encode high bits + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} + +function serializeRegExp(buffer: Uint8Array, key: string, value: RegExp, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw new BSONError('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + ByteUtils.encodeUTF8Into(buffer, value.source, index); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) buffer[index++] = 0x69; // i + if (value.global) buffer[index++] = 0x73; // s + if (value.multiline) buffer[index++] = 0x6d; // m + + // Add ending zero + buffer[index++] = 0x00; + return index; +} + +function serializeBSONRegExp(buffer: Uint8Array, key: string, value: BSONRegExp, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw new BSONError('pattern ' + value.pattern + ' must not contain null bytes'); + } + + // Adjust the index + index = index + ByteUtils.encodeUTF8Into(buffer, value.pattern, index); + // Write zero + buffer[index++] = 0x00; + // Write the options + const sortedOptions = value.options.split('').sort().join(''); + index = index + ByteUtils.encodeUTF8Into(buffer, sortedOptions, index); + // Add ending zero + buffer[index++] = 0x00; + return index; +} + +function serializeMinMax(buffer: Uint8Array, key: string, value: MinKey | MaxKey, index: number) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = constants.BSON_DATA_NULL; + } else if (value[bsonType] === 'MinKey') { + buffer[index++] = constants.BSON_DATA_MIN_KEY; + } else { + buffer[index++] = constants.BSON_DATA_MAX_KEY; + } + + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} + +function serializeObjectId(buffer: Uint8Array, key: string, value: ObjectId, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_OID; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + index += value.serializeInto(buffer, index); + + // Adjust index + return index; +} + +function serializeBuffer(buffer: Uint8Array, key: string, value: Uint8Array, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + const size = value.length; + // Write the size of the string to buffer + index += NumberUtils.setInt32LE(buffer, index, size); + // Write the default subtype + buffer[index++] = constants.BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + if (size <= 16) { + for (let i = 0; i < size; i++) buffer[index + i] = value[i]; + } else { + buffer.set(value, index); + } + // Adjust the index + index = index + size; + return index; +} + +function serializeDecimal128(buffer: Uint8Array, key: string, value: Decimal128, index: number) { + buffer[index++] = constants.BSON_DATA_DECIMAL128; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + for (let i = 0; i < 16; i++) buffer[index + i] = value.bytes[i]; + return index + 16; +} + +function serializeLong(buffer: Uint8Array, key: string, value: Long, index: number) { + // Write the type + buffer[index++] = + value[bsonType] === 'Long' ? constants.BSON_DATA_LONG : constants.BSON_DATA_TIMESTAMP; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + // Encode low bits + index += NumberUtils.setInt32LE(buffer, index, lowBits); + // Encode high bits + index += NumberUtils.setInt32LE(buffer, index, highBits); + return index; +} + +function serializeInt32(buffer: Uint8Array, key: string, value: Int32 | number, index: number) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + index += NumberUtils.setInt32LE(buffer, index, value); + return index; +} + +function serializeDouble(buffer: Uint8Array, key: string, value: Double, index: number) { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write float + index += NumberUtils.setFloat64LE(buffer, index, value.value); + + return index; +} + +function serializeFunction(buffer: Uint8Array, key: string, value: Function, index: number) { + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + const functionString = value.toString(); + + // Write the string + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + // Write the size of the string to buffer + NumberUtils.setInt32LE(buffer, index, size); + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} + +function serializeBinary(buffer: Uint8Array, key: string, value: Binary, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + const data = value.buffer; + // Calculate size + let size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4; + // Write the size of the string to buffer + index += NumberUtils.setInt32LE(buffer, index, size); + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + index += NumberUtils.setInt32LE(buffer, index, size); + } + + if (value.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(value); + } + + if (size <= 16) { + for (let i = 0; i < size; i++) buffer[index + i] = data[i]; + } else { + buffer.set(data, index); + } + // Adjust the index + index = index + value.position; + return index; +} + +function serializeSymbol(buffer: Uint8Array, key: string, value: BSONSymbol, index: number) { + // Write the type + buffer[index++] = constants.BSON_DATA_SYMBOL; + // Number of written bytes + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + const size = ByteUtils.encodeUTF8Into(buffer, value.value, index + 4) + 1; + // Write the size of the string to buffer + NumberUtils.setInt32LE(buffer, index, size); + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} + +interface SerializationFrame { + /** Original object passed to this frame — used for cycle-detection (path.delete). */ + sourceObject: Document; + /** True when serializing a BSON array; affects key format and type byte. */ + isArray: boolean; + /** Buffer offset where this object's 4-byte size field will be written. */ + objectSizeIndex: number; + /** Buffer offset for code-with-scope wrapper size, or null if not applicable. */ + codeSizeIndex: number | null; + /** + * Object being iterated. For plain objects this may be the toBSON() result of + * sourceObject; for arrays and Maps it equals sourceObject. + */ + iterTarget: Document; + /** + * Pre-computed Object.keys() of iterTarget for plain objects. + * Null for arrays (use keyIndex as numeric index) and Maps (use mapIterator). + */ + keys: string[] | null; + /** Next index into keys[] for plain objects, or next array index for arrays. */ + keyIndex: number; + /** Active iterator for Map objects; null for arrays and plain objects. */ + mapIterator: IterableIterator<[unknown, unknown]> | null; + /** The enclosing frame, or null at the root. The stack is a linked list via this field. */ + prev: SerializationFrame | null; + /** Whether to validate keys for this frame's document (may differ from caller, e.g. DBRef uses false). */ + checkKeys: boolean; + /** Whether undefined values are skipped (may differ from caller, e.g. DBRef uses true). */ + ignoreUndefined: boolean; +} + +function makeFrame( + sourceObject: Document, + objectSizeIndex: number, + codeSizeIndex: number | null, + prev: SerializationFrame | null, + checkKeys: boolean, + ignoreUndefined: boolean +): SerializationFrame { + if (Array.isArray(sourceObject)) { + return { + sourceObject, + isArray: true, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; + } + if (sourceObject instanceof Map || isMap(sourceObject)) { + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: sourceObject, + keys: null, + keyIndex: 0, + mapIterator: (sourceObject as Map).entries(), + prev, + checkKeys, + ignoreUndefined + }; + } + // Plain object: call toBSON() if defined to obtain the object to iterate. + let target: Document = sourceObject; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (typeof (target as any)?.toBSON === 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + target = (target as any).toBSON() as Document; + if (target != null && typeof target !== 'object') { + throw new BSONError('toBSON function did not return an object'); + } + } + return { + sourceObject, + isArray: false, + objectSizeIndex, + codeSizeIndex, + iterTarget: target, + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + keys: Object.keys(target as object), + keyIndex: 0, + mapIterator: null, + prev, + checkKeys, + ignoreUndefined + }; +} + +export function serializeInto( + buffer: Uint8Array, + object: Document, + checkKeys: boolean, + startingIndex: number, + serializeFunctions: boolean, + ignoreUndefined: boolean, + path: Set | null +): number { + if (path == null) { + // We are at the root input + if (object == null) { + // ONLY the root should turn into an empty document + // BSON Empty document has a size of 5 (LE) + buffer[0] = 0x05; + buffer[1] = 0x00; + buffer[2] = 0x00; + buffer[3] = 0x00; + // All documents end with null terminator + buffer[4] = 0x00; + return 5; + } + + if (Array.isArray(object)) { + throw new BSONError('serialize does not support an array as the root input'); + } + if (typeof object !== 'object') { + throw new BSONError('serialize does not support non-object as the root input'); + } else if ('_bsontype' in object && typeof object._bsontype === 'string') { + throw new BSONError(`BSON types cannot be serialized as a document`); + } else if ( + isDate(object) || + isRegExp(object) || + isUint8Array(object) || + isAnyArrayBuffer(object) + ) { + throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`); + } + + path = new Set(); + } + + path.add(object); + + let currentFrame: SerializationFrame | null = makeFrame( + object, + startingIndex, + null, + null, + checkKeys, + ignoreUndefined + ); + let index = startingIndex + 4; + + while (currentFrame !== null) { + const frame: SerializationFrame = currentFrame; + + // Advance to the next key-value pair, or finalize the frame if exhausted. + let key: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let value: any; + if (frame.mapIterator !== null) { + const next = frame.mapIterator.next(); + if (next.done) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = next.value[0] as string; + value = next.value[1]; + } else if (frame.keys !== null) { + if (frame.keyIndex >= frame.keys.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + key = frame.keys[frame.keyIndex++]; + value = (frame.iterTarget as Record)[key]; + } else { + // Array: use keyIndex as the numeric index. + const arr = frame.iterTarget as unknown[]; + if (frame.keyIndex >= arr.length) { + buffer[index++] = 0x00; + NumberUtils.setInt32LE(buffer, frame.objectSizeIndex, index - frame.objectSizeIndex); + if (frame.codeSizeIndex !== null) { + NumberUtils.setInt32LE(buffer, frame.codeSizeIndex, index - frame.codeSizeIndex); + } + path.delete(frame.sourceObject); + currentFrame = frame.prev; + continue; + } + const i = frame.keyIndex++; + key = String(i); + value = arr[i]; + } + + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + if (!frame.isArray && typeof key === 'string' && !(key[0] === '$' && ignoreKeys.has(key))) { + if (regexp.test(key)) { + throw new BSONError('key ' + key + ' must not contain null bytes'); + } + if (frame.checkKeys) { + if ('$' === key[0]) { + throw new BSONError('key ' + key + " must not start with '$'"); + } else if (key.includes('.')) { + throw new BSONError('key ' + key + " must not contain '.'"); + } + } + } + + const type = typeof value; + + if (value === undefined) { + if (frame.isArray || frame.ignoreUndefined === false) { + index = serializeNull(buffer, key, value, index); + } + } else if (value === null) { + index = serializeNull(buffer, key, value, index); + } else if (type === 'string') { + index = serializeString(buffer, key, value, index); + } else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } else if (type === 'bigint') { + index = serializeBigInt(buffer, key, value, index); + } else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } else if (type === 'object' && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } else { + if (path.has(value)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + const nestedIsArray = Array.isArray(value); + buffer[index++] = nestedIsArray ? constants.BSON_DATA_ARRAY : constants.BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const nestedStartIndex = index; + path.add(value); + currentFrame = makeFrame( + value, + nestedStartIndex, + null, + frame, + frame.checkKeys, + frame.ignoreUndefined + ); + index += 4; + } + } else if (type === 'object') { + if (value[constants.BSON_VERSION_SYMBOL] !== constants.BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } + const tag = value[bsonType]; + if (tag === 'ObjectId') { + index = serializeObjectId(buffer, key, value, index); + } else if (tag === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } else if (tag === 'Long' || tag === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } else if (tag === 'Double') { + index = serializeDouble(buffer, key, value, index); + } else if (tag === 'Code') { + const codeValue = value as Code; + if (codeValue.scope && typeof codeValue.scope === 'object') { + buffer[index++] = constants.BSON_DATA_CODE_W_SCOPE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const codeTotalSizeIndex = index; + index += 4; + const functionString = codeValue.code; + const codeSize = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, codeSize); + buffer[index + 4 + codeSize - 1] = 0; + index = index + codeSize + 4; + const scope = codeValue.scope; + if (path.has(scope)) { + throw new BSONError('Cannot convert circular structure to BSON'); + } + path.add(scope); + currentFrame = makeFrame( + scope, + index, + codeTotalSizeIndex, + frame, + frame.checkKeys, + frame.ignoreUndefined + ); + index += 4; + } else { + buffer[index++] = constants.BSON_DATA_CODE; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + const functionString = codeValue.code.toString(); + const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer, index, size); + index = index + 4 + size - 1; + buffer[index++] = 0; + } + } else if (tag === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } else if (tag === 'BSONSymbol') { + index = serializeSymbol(buffer, key, value, index); + } else if (tag === 'DBRef') { + const dbref = value as DBRef; + const orderedValues: Document = Object.assign( + { $ref: dbref.collection, $id: dbref.oid }, + dbref.db != null ? { $db: dbref.db } : null, + dbref.fields + ); + buffer[index++] = constants.BSON_DATA_OBJECT; + index += ByteUtils.encodeUTF8Into(buffer, key, index); + buffer[index++] = 0x00; + path.add(orderedValues); + currentFrame = makeFrame(orderedValues, index, null, frame, false, true); + index += 4; + } else if (tag === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } else if (tag === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } else if (tag === 'MinKey' || tag === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } else if (typeof value._bsontype !== 'undefined') { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } else if (type === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index); + } + } + + return index; +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/utils.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/utils.ts new file mode 100644 index 00000000..2e383991 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/parser/utils.ts @@ -0,0 +1,69 @@ +const TypedArrayPrototypeGetSymbolToStringTag = (() => { + // Type check system lovingly referenced from: + // https://github.com/nodejs/node/blob/7450332339ed40481f470df2a3014e2ec355d8d8/lib/internal/util/types.js#L13-L15 + // eslint-disable-next-line @typescript-eslint/unbound-method -- the intention is to call this method with a bound value + const g = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf(Uint8Array.prototype), + Symbol.toStringTag + )!.get!; + + return (value: unknown) => g.call(value); +})(); + +export function isUint8Array(value: unknown): value is Uint8Array { + return TypedArrayPrototypeGetSymbolToStringTag(value) === 'Uint8Array'; +} + +export function isAnyArrayBuffer(value: unknown): value is ArrayBuffer { + return ( + typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + (value[Symbol.toStringTag] === 'ArrayBuffer' || + value[Symbol.toStringTag] === 'SharedArrayBuffer') + ); +} + +export function isRegExp(regexp: unknown): regexp is RegExp { + return regexp instanceof RegExp || Object.prototype.toString.call(regexp) === '[object RegExp]'; +} + +export function isMap(value: unknown): value is Map { + return ( + typeof value === 'object' && + value != null && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Map' + ); +} + +export function isDate(date: unknown): date is Date { + return date instanceof Date || Object.prototype.toString.call(date) === '[object Date]'; +} + +export type InspectFn = (x: unknown, options?: unknown) => string; +export function defaultInspect(x: unknown, _options?: unknown): string { + return JSON.stringify(x, (k: string, v: unknown) => { + if (typeof v === 'bigint') { + return { $numberLong: `${v}` }; + } else if (isMap(v)) { + return Object.fromEntries(v); + } + return v; + }); +} + +/** @internal */ +type StylizeFunction = (x: string, style: string) => string; +/** @internal */ +export function getStylizeFunction(options?: unknown): StylizeFunction | undefined { + const stylizeExists = + options != null && + typeof options === 'object' && + 'stylize' in options && + typeof options.stylize === 'function'; + + if (stylizeExists) { + return options.stylize as StylizeFunction; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/regexp.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/regexp.ts new file mode 100644 index 00000000..f1c9f499 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/regexp.ts @@ -0,0 +1,116 @@ +import { BSONValue } from './bson_value'; +import { BSONError } from './error'; +import type { EJSONOptions } from './extended_json'; +import { type InspectFn, defaultInspect, getStylizeFunction } from './parser/utils'; + +function alphabetize(str: string): string { + return str.split('').sort().join(''); +} + +/** @public */ +export interface BSONRegExpExtendedLegacy { + $regex: string | BSONRegExp; + $options: string; +} + +/** @public */ +export interface BSONRegExpExtended { + $regularExpression: { + pattern: string; + options: string; + }; +} + +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +export class BSONRegExp extends BSONValue { + get _bsontype(): 'BSONRegExp' { + return 'BSONRegExp'; + } + + pattern!: string; + options!: string; + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + constructor(pattern: string, options?: string) { + super(); + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}` + ); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}` + ); + } + + // Validate options + for (let i = 0; i < this.options.length; i++) { + if ( + /* eslint-disable prettier/prettier */ + !( + this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u' + ) + /* eslint-enable prettier/prettier */ + ) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + + static parseOptions(options?: string): string { + return options ? options.split('').sort().join('') : ''; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BSONRegExpExtendedLegacy | BSONRegExpExtended { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + + /** @internal */ + static fromExtendedJSON(doc: BSONRegExpExtendedLegacy | BSONRegExpExtended): BSONRegExp { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc as unknown as BSONRegExp; + } + } else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp( + doc.$regularExpression.pattern, + BSONRegExp.parseOptions(doc.$regularExpression.options) + ); + } + throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + const stylize = getStylizeFunction(options) ?? (v => v); + inspect ??= defaultInspect; + const pattern = stylize(inspect(this.pattern), 'regexp'); + const flags = stylize(inspect(this.options), 'regexp'); + return `new BSONRegExp(${pattern}, ${flags})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/symbol.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/symbol.ts new file mode 100644 index 00000000..6835ab95 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/symbol.ts @@ -0,0 +1,55 @@ +import { BSONValue } from './bson_value'; +import { type InspectFn, defaultInspect } from './parser/utils'; + +/** @public */ +export interface BSONSymbolExtended { + $symbol: string; +} + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +export class BSONSymbol extends BSONValue { + get _bsontype(): 'BSONSymbol' { + return 'BSONSymbol'; + } + + value!: string; + /** + * @param value - the string representing the symbol. + */ + constructor(value: string) { + super(); + this.value = value; + } + + /** Access the wrapped string value. */ + valueOf(): string { + return this.value; + } + + toString(): string { + return this.value; + } + + toJSON(): string { + return this.value; + } + + /** @internal */ + toExtendedJSON(): BSONSymbolExtended { + return { $symbol: this.value }; + } + + /** @internal */ + static fromExtendedJSON(doc: BSONSymbolExtended): BSONSymbol { + return new BSONSymbol(doc.$symbol); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + return `new BSONSymbol(${inspect(this.value, options)})`; + } +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/timestamp.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/timestamp.ts new file mode 100644 index 00000000..a468f246 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/timestamp.ts @@ -0,0 +1,331 @@ +import { bsonType } from './bson_value'; +import { BSONError } from './error'; +import type { Int32 } from './int_32'; +import { Long } from './long'; +import { type InspectFn, defaultInspect } from './parser/utils'; + +/** + * @public + * @deprecated This type is no longer used internally and will be removed in a future version. + */ +export type TimestampOverrides = + // eslint-disable-next-line prettier/prettier + | '_bsontype' + | 'toExtendedJSON' + | 'fromExtendedJSON' + | 'inspect' + | typeof bsonType; + +/** + * @public + * + * Inherited `Long` members surfaced on `Timestamp`. + * When `Long` gains a new member: add it here if it should pass through, or + * add a `@deprecated declare` line on the `Timestamp` class if it should be + * surfaced as deprecated. Anything left unclassified is silently dropped from + * the public type — preventing accidental behavioral bleed-through. + */ +type TimestampKept = + | 'toBigInt' + | 'toString' + | 'compare' + | 'equals' + | 'eq' + | 'notEquals' + | 'neq' + | 'ne' + | 'lessThan' + | 'lt' + | 'lessThanOrEqual' + | 'lte' + | 'le' + | 'greaterThan' + | 'gt' + | 'greaterThanOrEqual' + | 'gte' + | 'ge'; + +/** @public */ +export type LongWithoutOverrides = new ( + low: unknown, + high?: number | boolean, + unsigned?: boolean +) => { + [P in TimestampKept]: Long[P]; +}; +/** @public */ +export const LongWithoutOverridesClass: LongWithoutOverrides = + Long as unknown as LongWithoutOverrides; + +/** @public */ +export interface TimestampExtended { + $timestamp: { + t: number; + i: number; + }; +} + +/** + * @public + * @category BSONType + * + * A special type for _internal_ MongoDB use and is **not** associated with the regular Date type. + */ +export class Timestamp extends LongWithoutOverridesClass { + get _bsontype(): 'Timestamp' { + return 'Timestamp'; + } + get [bsonType](): 'Timestamp' { + return 'Timestamp'; + } + + /** + * @deprecated Use `Long.MAX_UNSIGNED_VALUE` instead. + */ + static readonly MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + + /** + * An incrementing ordinal for operations within a given second. + */ + get i(): number { + return this.low >>> 0; + } + + /** + * A `time_t` value measuring seconds since the Unix epoch + */ + get t(): number { + return this.high >>> 0; + } + + /** + * @param int - A 64-bit bigint representing the Timestamp. + */ + constructor(int: bigint); + /** + * @param long - A 64-bit Long representing the Timestamp. + */ + constructor(long: Long); + /** + * @param value - A pair of two values indicating timestamp and increment. + */ + constructor(value: { t: number; i: number }); + constructor(low?: bigint | Long | { t: number | Int32; i: number | Int32 }) { + if (low == null) { + super(0, 0, true); + } else if (typeof low === 'bigint') { + super(low, true); + } else if (Long.isLong(low)) { + super(low.low, low.high, true); + } else if (typeof low === 'object' && 't' in low && 'i' in low) { + if (typeof low.t !== 'number' && (typeof low.t !== 'object' || low.t._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide t as a number'); + } + if (typeof low.i !== 'number' && (typeof low.i !== 'object' || low.i._bsontype !== 'Int32')) { + throw new BSONError('Timestamp constructed from { t, i } must provide i as a number'); + } + const t = Number(low.t); + const i = Number(low.i); + if (t < 0 || Number.isNaN(t)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive t'); + } + if (i < 0 || Number.isNaN(i)) { + throw new BSONError('Timestamp constructed from { t, i } must provide a positive i'); + } + if (t > 0xffff_ffff) { + throw new BSONError( + 'Timestamp constructed from { t, i } must provide t equal or less than uint32 max' + ); + } + if (i > 0xffff_ffff) { + throw new BSONError( + 'Timestamp constructed from { t, i } must provide i equal or less than uint32 max' + ); + } + + super(i, t, true); + } else { + throw new BSONError( + 'A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }' + ); + } + } + + toJSON(): { $timestamp: string } { + return { + // eslint-disable-next-line @typescript-eslint/no-base-to-string + $timestamp: this.toString() + }; + } + + /** + * Returns a Timestamp represented by the given (32-bit) integer value. + * @deprecated Stores `value` in the low 32 bits (increment), leaving t = 0. Use `new Timestamp({ t, i })` or `Timestamp.fromBits(lowBits, highBits)` for explicit construction. + */ + static fromInt(value: number): Timestamp { + return new Timestamp(Long.fromInt(value, true)); + } + + /** + * Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. + * @deprecated Splits `value` across (t, i) as a uint64; the result rarely matches user intent. Use `new Timestamp({ t, i })` or `Timestamp.fromBits(lowBits, highBits)` for explicit construction. + */ + static fromNumber(value: number): Timestamp { + return new Timestamp(Long.fromNumber(value, true)); + } + + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp { + return new Timestamp({ i: lowBits, t: highBits }); + } + + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + static fromString(str: string, optRadix: number): Timestamp { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + + /** @internal */ + toExtendedJSON(): TimestampExtended { + return { $timestamp: { t: this.t, i: this.i } }; + } + + /** @internal */ + static fromExtendedJSON(doc: TimestampExtended): Timestamp { + // The Long check is necessary because extended JSON has different behavior given the size of the input number + const i = Long.isLong(doc.$timestamp.i) + ? doc.$timestamp.i.getLowBitsUnsigned() // Need to fetch the least significant 32 bits + : doc.$timestamp.i; + const t = Long.isLong(doc.$timestamp.t) + ? doc.$timestamp.t.getLowBitsUnsigned() // Need to fetch the least significant 32 bits + : doc.$timestamp.t; + return new Timestamp({ t, i }); + } + + inspect(depth?: number, options?: unknown, inspect?: InspectFn): string { + inspect ??= defaultInspect; + const t = inspect(this.t, options); + const i = inspect(this.i, options); + return `new Timestamp({ t: ${t}, i: ${i} })`; + } + + // ******************** + // **** DEPRECATED **** + // ******************** + // Declare used to avoid runtime effects for field declaration. + // See: https://www.typescriptlang.org/docs/handbook/2/classes.html#type-only-field-declarations + + // Arithmetic + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare add: Long['add']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare subtract: Long['subtract']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare sub: Long['sub']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare multiply: Long['multiply']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare mul: Long['mul']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare divide: Long['divide']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare div: Long['div']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare modulo: Long['modulo']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare mod: Long['mod']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare rem: Long['rem']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned. */ + declare negate: Long['negate']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned. */ + declare neg: Long['neg']; + + // Bitwise / shifts + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare and: Long['and']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare or: Long['or']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare xor: Long['xor']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare not: Long['not']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare shiftLeft: Long['shiftLeft']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare shl: Long['shl']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare shiftRight: Long['shiftRight']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare shr: Long['shr']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare shiftRightUnsigned: Long['shiftRightUnsigned']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare shr_u: Long['shr_u']; + /** @deprecated Not applicable to Timestamp; Timestamp is not intended to be used as a Long. */ + declare shru: Long['shru']; + + // Signing + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned. */ + declare toSigned: Long['toSigned']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (this is a no-op). */ + declare toUnsigned: Long['toUnsigned']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (is always false). */ + declare isNegative: Long['isNegative']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (is always true). */ + declare isPositive: Long['isPositive']; + /** @deprecated Not applicable to Timestamp as the underlying Long is always unsigned (is always true). */ + declare unsigned: Long['unsigned']; + + // Conversion + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + declare toInt: Long['toInt']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + declare toNumber: Long['toNumber']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + declare toBytes: Long['toBytes']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + declare toBytesLE: Long['toBytesLE']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch, or `.i` for the increment ordinal. */ + declare toBytesBE: Long['toBytesBE']; + + // Other + /** @deprecated Incompatible with Timestamp: returns a signed integer, but Timestamp is always unsigned. Use `.t` for seconds since the Unix epoch. */ + declare getHighBits: Long['getHighBits']; + /** @deprecated Not applicable to Timestamp; use `.t` for seconds since the Unix epoch. */ + declare getHighBitsUnsigned: Long['getHighBitsUnsigned']; + /** @deprecated Incompatible with Timestamp: returns a signed integer, but Timestamp is always unsigned. Use `.i` for the increment ordinal. */ + declare getLowBits: Long['getLowBits']; + /** @deprecated Not applicable to Timestamp; use `.i` for the increment ordinal. */ + declare getLowBitsUnsigned: Long['getLowBitsUnsigned']; + + /** @deprecated Not applicable to Timestamp; use `.i` instead. */ + declare low: Long['low']; + /** @deprecated Not applicable to Timestamp; use `.t` instead. */ + declare high: Long['high']; + + /** @deprecated Use .compare() for general comparison, or .equals(), .lessThan(), .greaterThan() for specific cases. */ + declare comp: Long['comp']; + /** @deprecated Compare `.t` and `.i` against `0` explicitly. */ + declare isZero: Long['isZero']; + /** @deprecated Compare `.t` and `.i` against `0` explicitly. */ + declare eqz: Long['eqz']; + + /** @deprecated Not applicable to Timestamp. Use the bsonType symbol or _bsontype === 'Timestamp' to identify a Timestamp. */ + declare __isLong__: Long['__isLong__']; + /** @deprecated Not applicable to Timestamp. */ + declare getNumBitsAbs: Long['getNumBitsAbs']; + /** @deprecated Not applicable to Timestamp; tests parity of the increment only. */ + declare isEven: Long['isEven']; + /** @deprecated Not applicable to Timestamp; tests parity of the increment only. */ + declare isOdd: Long['isOdd']; +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/byte_utils.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/byte_utils.ts new file mode 100644 index 00000000..376258bf --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/byte_utils.ts @@ -0,0 +1,80 @@ +import { nodeJsByteUtils } from './node_byte_utils'; +import { webByteUtils } from './web_byte_utils'; + +/** + * @public + * @experimental + * + * A collection of functions that help work with data in a Uint8Array. + * ByteUtils is configured at load time to use Node.js or Web based APIs for the internal implementations. + */ +export type ByteUtils = { + /** Checks if the given value is a Uint8Array. */ + isUint8Array: (value: unknown) => value is Uint8Array; + /** Transforms the input to an instance of Buffer if running on node, otherwise Uint8Array */ + toLocalBufferType: (buffer: Uint8Array | ArrayBufferView | ArrayBuffer) => Uint8Array; + /** Create empty space of size */ + allocate: (size: number) => Uint8Array; + /** Create empty space of size, use pooled memory when available */ + allocateUnsafe: (size: number) => Uint8Array; + /** Compare 2 Uint8Arrays lexicographically */ + compare: (buffer1: Uint8Array, buffer2: Uint8Array) => -1 | 0 | 1; + /** Concatenating all the Uint8Arrays in new Uint8Array. */ + concat: (list: Uint8Array[]) => Uint8Array; + /** Copy bytes from source Uint8Array to target Uint8Array */ + copy: ( + source: Uint8Array, + target: Uint8Array, + targetStart?: number, + sourceStart?: number, + sourceEnd?: number + ) => number; + /** Check if two Uint8Arrays are deep equal */ + equals: (a: Uint8Array, b: Uint8Array) => boolean; + /** Create a Uint8Array from an array of numbers */ + fromNumberArray: (array: number[]) => Uint8Array; + /** Create a Uint8Array from a base64 string */ + fromBase64: (base64: string) => Uint8Array; + /** Create a Uint8Array from a UTF8 string */ + fromUTF8: (utf8: string) => Uint8Array; + /** Create a base64 string from bytes */ + toBase64: (buffer: Uint8Array) => string; + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + fromISO88591: (codePoints: string) => Uint8Array; + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + toISO88591: (buffer: Uint8Array) => string; + /** Create a Uint8Array from a hex string */ + fromHex: (hex: string) => Uint8Array; + /** Create a lowercase hex string from bytes */ + toHex: (buffer: Uint8Array) => string; + /** Create a string from utf8 code units, fatal=true will throw an error if UTF-8 bytes are invalid, fatal=false will insert replacement characters */ + toUTF8: (buffer: Uint8Array, start: number, end: number, fatal: boolean) => string; + /** Get the utf8 code unit count from a string if it were to be transformed to utf8 */ + utf8ByteLength: (input: string) => number; + /** Encode UTF8 bytes generated from `source` string into `destination` at byteOffset. Returns the number of bytes encoded. */ + encodeUTF8Into: (destination: Uint8Array, source: string, byteOffset: number) => number; + /** Generate a Uint8Array filled with random bytes with byteLength */ + randomBytes: (byteLength: number) => Uint8Array; + /** Interprets `buffer` as an array of 32-bit values and swaps the byte order in-place. */ + swap32: (buffer: Uint8Array) => Uint8Array; +}; + +declare const Buffer: { new (): unknown; prototype?: { _isBuffer?: boolean } } | undefined; + +/** + * Check that a global Buffer exists that is a function and + * does not have a '_isBuffer' property defined on the prototype + * (this is to prevent using the npm buffer) + */ +const hasGlobalBuffer = typeof Buffer === 'function' && Buffer.prototype?._isBuffer !== true; + +/** + * This is the only ByteUtils that should be used across the rest of the BSON library. + * + * The type annotation is important here, it asserts that each of the platform specific + * utils implementations are compatible with the common one. + * + * @public + * @experimental + */ +export const ByteUtils: ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils; diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/latin.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/latin.ts new file mode 100644 index 00000000..5dd5c91f --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/latin.ts @@ -0,0 +1,104 @@ +/** + * This function is an optimization for small basic latin strings. + * @internal + * @remarks + * ### Important characteristics: + * - If the uint8array or distance between start and end is 0 this function returns an empty string + * - If the byteLength of the string is 1, 2, or 3 we invoke String.fromCharCode and manually offset into the buffer + * - If the byteLength of the string is less than or equal to 20 an array of bytes is built and `String.fromCharCode.apply` is called with the result + * - If any byte exceeds 128 this function returns null + * + * @param uint8array - A sequence of bytes that may contain basic latin characters + * @param start - The start index from which to search the uint8array + * @param end - The index to stop searching the uint8array + * @returns string if all bytes are within the basic latin range, otherwise null + */ +export function tryReadBasicLatin( + uint8array: Uint8Array, + start: number, + end: number +): string | null { + if (uint8array.length === 0) { + return ''; + } + + const stringByteLength = end - start; + if (stringByteLength === 0) { + return ''; + } + + if (stringByteLength > 20) { + return null; + } + + if (stringByteLength === 1 && uint8array[start] < 128) { + return String.fromCharCode(uint8array[start]); + } + + if (stringByteLength === 2 && uint8array[start] < 128 && uint8array[start + 1] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]); + } + + if ( + stringByteLength === 3 && + uint8array[start] < 128 && + uint8array[start + 1] < 128 && + uint8array[start + 2] < 128 + ) { + return ( + String.fromCharCode(uint8array[start]) + + String.fromCharCode(uint8array[start + 1]) + + String.fromCharCode(uint8array[start + 2]) + ); + } + + const latinBytes = []; + for (let i = start; i < end; i++) { + const byte = uint8array[i]; + if (byte > 127) { + return null; + } + latinBytes.push(byte); + } + + return String.fromCharCode(...latinBytes); +} + +/** + * This function is an optimization for writing small basic latin strings. + * @internal + * @remarks + * ### Important characteristics: + * - If the string length is 0 return 0, do not perform any work + * - If a string is longer than 25 code units return null + * - If any code unit exceeds 128 this function returns null + * + * @param destination - The uint8array to serialize the string to + * @param source - The string to turn into UTF-8 bytes if it fits in the basic latin range + * @param offset - The position in the destination to begin writing bytes to + * @returns the number of bytes written to destination if all code units are below 128, otherwise null + */ +export function tryWriteBasicLatin( + destination: Uint8Array, + source: string, + offset: number +): number | null { + if (source.length === 0) return 0; + + if (source.length > 25) return null; + + if (destination.length - offset < source.length) return null; + + for ( + let charOffset = 0, destinationOffset = offset; + charOffset < source.length; + charOffset++, destinationOffset++ + ) { + const char = source.charCodeAt(charOffset); + if (char > 127) return null; + + destination[destinationOffset] = char; + } + + return source.length; +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/node_byte_utils.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/node_byte_utils.ts new file mode 100644 index 00000000..eaad4080 --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/node_byte_utils.ts @@ -0,0 +1,193 @@ +import { BSONError } from '../error'; +import { parseUtf8 } from '../parse_utf8'; +import { tryReadBasicLatin, tryWriteBasicLatin } from './latin'; +import { isUint8Array } from '../parser/utils'; + +type NodeJsEncoding = 'base64' | 'hex' | 'utf8' | 'binary'; +type NodeJsBuffer = ArrayBufferView & + Uint8Array & { + write(string: string, offset: number, length: undefined, encoding: 'utf8'): number; + copy(target: Uint8Array, targetStart: number, sourceStart: number, sourceEnd: number): number; + toString: (this: Uint8Array, encoding: NodeJsEncoding, start?: number, end?: number) => string; + equals: (this: Uint8Array, other: Uint8Array) => boolean; + swap32: (this: NodeJsBuffer) => NodeJsBuffer; + compare: (this: Uint8Array, other: Uint8Array) => -1 | 0 | 1; + }; +type NodeJsBufferConstructor = Omit & { + alloc: (size: number) => NodeJsBuffer; + allocUnsafe: (size: number) => NodeJsBuffer; + from(array: number[]): NodeJsBuffer; + from(array: Uint8Array): NodeJsBuffer; + from(array: ArrayBuffer): NodeJsBuffer; + from(array: ArrayBufferLike, byteOffset: number, byteLength: number): NodeJsBuffer; + from(base64: string, encoding: NodeJsEncoding): NodeJsBuffer; + byteLength(input: string, encoding: 'utf8'): number; + isBuffer(value: unknown): value is NodeJsBuffer; + concat(list: Uint8Array[]): NodeJsBuffer; +}; + +// This can be nullish, but we gate the nodejs functions on being exported whether or not this exists +// Node.js global +declare const Buffer: NodeJsBufferConstructor; + +/** @internal */ +function nodejsMathRandomBytes(byteLength: number): NodeJsBuffer { + return nodeJsByteUtils.fromNumberArray( + Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256)) + ); +} + +/** @internal */ +function nodejsSecureRandomBytes(byteLength: number): NodeJsBuffer { + // @ts-expect-error: crypto.getRandomValues cannot actually be null here + return crypto.getRandomValues(nodeJsByteUtils.allocate(byteLength)); +} + +const nodejsRandomBytes = (() => { + const { crypto } = globalThis as { + crypto?: { getRandomValues?: (space: Uint8Array) => Uint8Array }; + }; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return nodejsSecureRandomBytes; + } else { + return nodejsMathRandomBytes; + } +})(); + +/** + * @public + * @experimental + */ +export const nodeJsByteUtils = { + isUint8Array: isUint8Array, + + toLocalBufferType(potentialBuffer: Uint8Array | NodeJsBuffer | ArrayBuffer): NodeJsBuffer { + if (Buffer.isBuffer(potentialBuffer)) { + return potentialBuffer; + } + + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from( + potentialBuffer.buffer, + potentialBuffer.byteOffset, + potentialBuffer.byteLength + ); + } + + const stringTag = + potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer); + if ( + stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]' + ) { + return Buffer.from(potentialBuffer); + } + + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); + }, + + allocate(size: number): NodeJsBuffer { + return Buffer.alloc(size); + }, + + allocateUnsafe(size: number): NodeJsBuffer { + return Buffer.allocUnsafe(size); + }, + + compare(a: Uint8Array, b: Uint8Array) { + return nodeJsByteUtils.toLocalBufferType(a).compare(b); + }, + + concat(list: Uint8Array[]): NodeJsBuffer { + return Buffer.concat(list); + }, + + copy( + source: Uint8Array, + target: Uint8Array, + targetStart?: number, + sourceStart?: number, + sourceEnd?: number + ): number { + return nodeJsByteUtils + .toLocalBufferType(source) + .copy(target, targetStart ?? 0, sourceStart ?? 0, sourceEnd ?? source.length); + }, + + equals(a: Uint8Array, b: Uint8Array): boolean { + return nodeJsByteUtils.toLocalBufferType(a).equals(b); + }, + + fromNumberArray(array: number[]): NodeJsBuffer { + return Buffer.from(array); + }, + + fromBase64(base64: string): NodeJsBuffer { + return Buffer.from(base64, 'base64'); + }, + + fromUTF8(utf8: string): NodeJsBuffer { + return Buffer.from(utf8, 'utf8'); + }, + + toBase64(buffer: Uint8Array): string { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('base64'); + }, + + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + fromISO88591(codePoints: string): NodeJsBuffer { + return Buffer.from(codePoints, 'binary'); + }, + + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + toISO88591(buffer: Uint8Array): string { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('binary'); + }, + + fromHex(hex: string): NodeJsBuffer { + return Buffer.from(hex, 'hex'); + }, + + toHex(buffer: Uint8Array): string { + return nodeJsByteUtils.toLocalBufferType(buffer).toString('hex'); + }, + + toUTF8(buffer: Uint8Array, start: number, end: number, fatal: boolean): string { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(buffer, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + + const string = nodeJsByteUtils.toLocalBufferType(buffer).toString('utf8', start, end); + if (fatal) { + for (let i = 0; i < string.length; i++) { + if (string.charCodeAt(i) === 0xfffd) { + parseUtf8(buffer, start, end, true); + break; + } + } + } + return string; + }, + + utf8ByteLength(input: string): number { + return Buffer.byteLength(input, 'utf8'); + }, + + encodeUTF8Into(buffer: Uint8Array, source: string, byteOffset: number): number { + const latinBytesWritten = tryWriteBasicLatin(buffer, source, byteOffset); + if (latinBytesWritten != null) { + return latinBytesWritten; + } + + return nodeJsByteUtils.toLocalBufferType(buffer).write(source, byteOffset, undefined, 'utf8'); + }, + + randomBytes: nodejsRandomBytes, + + swap32(buffer: Uint8Array): NodeJsBuffer { + return nodeJsByteUtils.toLocalBufferType(buffer).swap32(); + } +}; diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/number_utils.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/number_utils.ts new file mode 100644 index 00000000..6e96a97f --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/number_utils.ts @@ -0,0 +1,204 @@ +const FLOAT = new Float64Array(1); +const FLOAT_BYTES = new Uint8Array(FLOAT.buffer, 0, 8); + +FLOAT[0] = -1; +// Little endian [0, 0, 0, 0, 0, 0, 240, 191] +// Big endian [191, 240, 0, 0, 0, 0, 0, 0] +const isBigEndian = FLOAT_BYTES[7] === 0; + +/** + * @experimental + * @public + * + * A collection of functions that get or set various numeric types and bit widths from a Uint8Array. + */ +export type NumberUtils = { + /** Is true if the current system is big endian. */ + isBigEndian: boolean; + /** + * Parses a signed int32 at offset. Throws a `RangeError` if value is negative. + */ + getNonnegativeInt32LE: (source: Uint8Array, offset: number) => number; + getInt32LE: (source: Uint8Array, offset: number) => number; + getUint32LE: (source: Uint8Array, offset: number) => number; + getUint32BE: (source: Uint8Array, offset: number) => number; + getBigInt64LE: (source: Uint8Array, offset: number) => bigint; + getFloat64LE: (source: Uint8Array, offset: number) => number; + setInt32BE: (destination: Uint8Array, offset: number, value: number) => 4; + setInt32LE: (destination: Uint8Array, offset: number, value: number) => 4; + setBigInt64LE: (destination: Uint8Array, offset: number, value: bigint) => 8; + setFloat64LE: (destination: Uint8Array, offset: number, value: number) => 8; +}; + +/** + * Number parsing and serializing utilities. + * + * @experimental + * @public + */ +export const NumberUtils: NumberUtils = { + isBigEndian, + + getNonnegativeInt32LE(source: Uint8Array, offset: number): number { + if (source[offset + 3] > 127) { + throw new RangeError(`Size cannot be negative at offset: ${offset}`); + } + return ( + source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24) + ); + }, + + /** Reads a little-endian 32-bit integer from source */ + getInt32LE(source: Uint8Array, offset: number): number { + return ( + source[offset] | + (source[offset + 1] << 8) | + (source[offset + 2] << 16) | + (source[offset + 3] << 24) + ); + }, + + /** Reads a little-endian 32-bit unsigned integer from source */ + getUint32LE(source: Uint8Array, offset: number): number { + return ( + source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216 + ); + }, + + /** Reads a big-endian 32-bit integer from source */ + getUint32BE(source: Uint8Array, offset: number): number { + return ( + source[offset + 3] + + source[offset + 2] * 256 + + source[offset + 1] * 65536 + + source[offset] * 16777216 + ); + }, + + /** Reads a little-endian 64-bit integer from source */ + getBigInt64LE(source: Uint8Array, offset: number): bigint { + const hi = BigInt( + source[offset + 4] + + source[offset + 5] * 256 + + source[offset + 6] * 65536 + + (source[offset + 7] << 24) + ); // Overflow + + const lo = BigInt( + source[offset] + + source[offset + 1] * 256 + + source[offset + 2] * 65536 + + source[offset + 3] * 16777216 + ); + + return (hi << 32n) + lo; + }, + + /** Reads a little-endian 64-bit float from source */ + getFloat64LE: isBigEndian + ? (source: Uint8Array, offset: number) => { + FLOAT_BYTES[7] = source[offset]; + FLOAT_BYTES[6] = source[offset + 1]; + FLOAT_BYTES[5] = source[offset + 2]; + FLOAT_BYTES[4] = source[offset + 3]; + FLOAT_BYTES[3] = source[offset + 4]; + FLOAT_BYTES[2] = source[offset + 5]; + FLOAT_BYTES[1] = source[offset + 6]; + FLOAT_BYTES[0] = source[offset + 7]; + return FLOAT[0]; + } + : (source: Uint8Array, offset: number) => { + FLOAT_BYTES[0] = source[offset]; + FLOAT_BYTES[1] = source[offset + 1]; + FLOAT_BYTES[2] = source[offset + 2]; + FLOAT_BYTES[3] = source[offset + 3]; + FLOAT_BYTES[4] = source[offset + 4]; + FLOAT_BYTES[5] = source[offset + 5]; + FLOAT_BYTES[6] = source[offset + 6]; + FLOAT_BYTES[7] = source[offset + 7]; + return FLOAT[0]; + }, + + /** Writes a big-endian 32-bit integer to destination, can be signed or unsigned */ + setInt32BE(destination: Uint8Array, offset: number, value: number): 4 { + destination[offset + 3] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset] = value; + return 4; + }, + + /** Writes a little-endian 32-bit integer to destination, can be signed or unsigned */ + setInt32LE(destination: Uint8Array, offset: number, value: number): 4 { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; + }, + + /** Write a little-endian 64-bit integer to source */ + setBigInt64LE(destination: Uint8Array, offset: number, value: bigint): 8 { + const mask32bits = 0xffff_ffffn; + + /** lower 32 bits */ + let lo = Number(value & mask32bits); + destination[offset] = lo; + lo >>= 8; + destination[offset + 1] = lo; + lo >>= 8; + destination[offset + 2] = lo; + lo >>= 8; + destination[offset + 3] = lo; + + let hi = Number((value >> 32n) & mask32bits); + destination[offset + 4] = hi; + hi >>= 8; + destination[offset + 5] = hi; + hi >>= 8; + destination[offset + 6] = hi; + hi >>= 8; + destination[offset + 7] = hi; + + return 8; + }, + + /** Writes a little-endian 64-bit float to destination */ + setFloat64LE: isBigEndian + ? (destination: Uint8Array, offset: number, value: number) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[7]; + destination[offset + 1] = FLOAT_BYTES[6]; + destination[offset + 2] = FLOAT_BYTES[5]; + destination[offset + 3] = FLOAT_BYTES[4]; + destination[offset + 4] = FLOAT_BYTES[3]; + destination[offset + 5] = FLOAT_BYTES[2]; + destination[offset + 6] = FLOAT_BYTES[1]; + destination[offset + 7] = FLOAT_BYTES[0]; + return 8; + } + : (destination: Uint8Array, offset: number, value: number) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[0]; + destination[offset + 1] = FLOAT_BYTES[1]; + destination[offset + 2] = FLOAT_BYTES[2]; + destination[offset + 3] = FLOAT_BYTES[3]; + destination[offset + 4] = FLOAT_BYTES[4]; + destination[offset + 5] = FLOAT_BYTES[5]; + destination[offset + 6] = FLOAT_BYTES[6]; + destination[offset + 7] = FLOAT_BYTES[7]; + return 8; + } +}; diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/string_utils.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/string_utils.ts new file mode 100644 index 00000000..1ffb118e --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/string_utils.ts @@ -0,0 +1,44 @@ +/** + * @internal + * Removes leading zeros and explicit plus from textual representation of a number. + */ +export function removeLeadingZerosAndExplicitPlus(str: string): string { + if (str === '') { + return str; + } + + let startIndex = 0; + + const isNegative = str[startIndex] === '-'; + const isExplicitlyPositive = str[startIndex] === '+'; + + if (isExplicitlyPositive || isNegative) { + startIndex += 1; + } + + let foundInsignificantZero = false; + + for (; startIndex < str.length && str[startIndex] === '0'; ++startIndex) { + foundInsignificantZero = true; + } + + if (!foundInsignificantZero) { + return isExplicitlyPositive ? str.slice(1) : str; + } + + return `${isNegative ? '-' : ''}${str.length === startIndex ? '0' : str.slice(startIndex)}`; +} + +/** + * @internal + * Returns false for an string that contains invalid characters for its radix, else returns the original string. + * @param str - The textual representation of the Long + * @param radix - The radix in which the text is written (2-36), defaults to 10 + */ +export function validateStringCharacters(str: string, radix?: number): false | string { + radix = radix ?? 10; + const validCharacters = '0123456789abcdefghijklmnopqrstuvwxyz'.slice(0, radix); + // regex is case insensitive and checks that each character within the string is one of the validCharacters + const regex = new RegExp(`[^-+${validCharacters}]`, 'i'); + return regex.test(str) ? false : str; +} diff --git a/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/web_byte_utils.ts b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/web_byte_utils.ts new file mode 100644 index 00000000..608b88cf --- /dev/null +++ b/backend/node_modules/.pnpm/bson@7.3.3/node_modules/bson/src/utils/web_byte_utils.ts @@ -0,0 +1,304 @@ +import { BSONError } from '../error'; +import { tryReadBasicLatin } from './latin'; +import { parseUtf8 } from '../parse_utf8'; +import { isUint8Array } from '../parser/utils'; + +type TextDecoder = { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + decode(input?: Uint8Array): string; +}; +type TextDecoderConstructor = { + new (label: 'utf8', options: { fatal: boolean; ignoreBOM?: boolean }): TextDecoder; +}; + +type TextEncoder = { + readonly encoding: string; + encode(input?: string): Uint8Array; +}; +type TextEncoderConstructor = { + new (): TextEncoder; +}; + +// Web global +declare const TextDecoder: TextDecoderConstructor; +declare const TextEncoder: TextEncoderConstructor; +declare const atob: (base64: string) => string; +declare const btoa: (binary: string) => string; + +type ArrayBufferViewWithTag = ArrayBufferView & { + [Symbol.toStringTag]?: string; +}; + +function isReactNative() { + const { navigator } = globalThis as { navigator?: { product?: string } }; + return typeof navigator === 'object' && navigator.product === 'ReactNative'; +} + +/** @internal */ +export function webMathRandomBytes(byteLength: number) { + if (byteLength < 0) { + throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`); + } + return webByteUtils.fromNumberArray( + Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256)) + ); +} + +/** @internal */ +const webRandomBytes: (byteLength: number) => Uint8Array = (() => { + const { crypto } = globalThis as { + crypto?: { getRandomValues?: (space: Uint8Array) => Uint8Array }; + }; + if (crypto != null && typeof crypto.getRandomValues === 'function') { + return (byteLength: number) => { + // @ts-expect-error: crypto.getRandomValues cannot actually be null here + // You cannot separate getRandomValues from crypto (need to have this === crypto) + return crypto.getRandomValues(webByteUtils.allocate(byteLength)); + }; + } else { + if (isReactNative()) { + const { console } = globalThis as { console?: { warn?: (message: string) => void } }; + console?.warn?.( + 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + ); + } + return webMathRandomBytes; + } +})(); + +const HEX_DIGIT = /(\d|[a-f])/i; + +/** + * @public + * @experimental + */ +export const webByteUtils = { + isUint8Array: isUint8Array, + + toLocalBufferType( + potentialUint8array: Uint8Array | ArrayBufferViewWithTag | ArrayBuffer + ): Uint8Array { + const stringTag = + potentialUint8array?.[Symbol.toStringTag] ?? + Object.prototype.toString.call(potentialUint8array); + + if (stringTag === 'Uint8Array') { + return potentialUint8array as Uint8Array; + } + + if (ArrayBuffer.isView(potentialUint8array)) { + return new Uint8Array( + potentialUint8array.buffer.slice( + potentialUint8array.byteOffset, + potentialUint8array.byteOffset + potentialUint8array.byteLength + ) + ); + } + + if ( + stringTag === 'ArrayBuffer' || + stringTag === 'SharedArrayBuffer' || + stringTag === '[object ArrayBuffer]' || + stringTag === '[object SharedArrayBuffer]' + ) { + return new Uint8Array(potentialUint8array); + } + + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); + }, + + allocate(size: number): Uint8Array { + if (typeof size !== 'number') { + throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`); + } + return new Uint8Array(size); + }, + + allocateUnsafe(size: number): Uint8Array { + return webByteUtils.allocate(size); + }, + + compare(uint8Array: Uint8Array, otherUint8Array: Uint8Array): -1 | 0 | 1 { + if (uint8Array === otherUint8Array) return 0; + + const len = Math.min(uint8Array.length, otherUint8Array.length); + + for (let i = 0; i < len; i++) { + if (uint8Array[i] < otherUint8Array[i]) return -1; + if (uint8Array[i] > otherUint8Array[i]) return 1; + } + + if (uint8Array.length < otherUint8Array.length) return -1; + if (uint8Array.length > otherUint8Array.length) return 1; + + return 0; + }, + + concat(uint8Arrays: Uint8Array[]): Uint8Array { + if (uint8Arrays.length === 0) return webByteUtils.allocate(0); + + let totalLength = 0; + for (const uint8Array of uint8Arrays) { + totalLength += uint8Array.length; + } + + const result = webByteUtils.allocate(totalLength); + let offset = 0; + + for (const uint8Array of uint8Arrays) { + result.set(uint8Array, offset); + offset += uint8Array.length; + } + + return result; + }, + + copy( + source: Uint8Array, + target: Uint8Array, + targetStart?: number, + sourceStart?: number, + sourceEnd?: number + ): number { + // validate and standardize passed-in sourceEnd + if (sourceEnd !== undefined && sourceEnd < 0) { + throw new RangeError( + `The value of "sourceEnd" is out of range. It must be >= 0. Received ${sourceEnd}` + ); + } + sourceEnd = sourceEnd ?? source.length; + + // validate and standardize passed-in sourceStart + if (sourceStart !== undefined && (sourceStart < 0 || sourceStart > sourceEnd)) { + throw new RangeError( + `The value of "sourceStart" is out of range. It must be >= 0 and <= ${sourceEnd}. Received ${sourceStart}` + ); + } + sourceStart = sourceStart ?? 0; + + // validate and standardize passed-in targetStart + if (targetStart !== undefined && targetStart < 0) { + throw new RangeError( + `The value of "targetStart" is out of range. It must be >= 0. Received ${targetStart}` + ); + } + targetStart = targetStart ?? 0; + + // figure out how many bytes we can copy + const srcSlice = source.subarray(sourceStart, sourceEnd); + const maxLen = Math.min(srcSlice.length, target.length - targetStart); + if (maxLen <= 0) { + return 0; + } + + // perform the copy + target.set(srcSlice.subarray(0, maxLen), targetStart); + return maxLen; + }, + + equals(uint8Array: Uint8Array, otherUint8Array: Uint8Array): boolean { + if (uint8Array.byteLength !== otherUint8Array.byteLength) { + return false; + } + for (let i = 0; i < uint8Array.byteLength; i++) { + if (uint8Array[i] !== otherUint8Array[i]) { + return false; + } + } + return true; + }, + + fromNumberArray(array: number[]): Uint8Array { + return Uint8Array.from(array); + }, + + fromBase64(base64: string): Uint8Array { + return Uint8Array.from(atob(base64), c => c.charCodeAt(0)); + }, + + fromUTF8(utf8: string): Uint8Array { + return new TextEncoder().encode(utf8); + }, + + toBase64(uint8array: Uint8Array): string { + return btoa(webByteUtils.toISO88591(uint8array)); + }, + + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + fromISO88591(codePoints: string): Uint8Array { + return Uint8Array.from(codePoints, c => c.charCodeAt(0) & 0xff); + }, + + /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */ + toISO88591(uint8array: Uint8Array): string { + return Array.from(Uint16Array.from(uint8array), b => String.fromCharCode(b)).join(''); + }, + + fromHex(hex: string): Uint8Array { + const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1); + const buffer = []; + + for (let i = 0; i < evenLengthHex.length; i += 2) { + const firstDigit = evenLengthHex[i]; + const secondDigit = evenLengthHex[i + 1]; + + if (!HEX_DIGIT.test(firstDigit)) { + break; + } + if (!HEX_DIGIT.test(secondDigit)) { + break; + } + + const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16); + buffer.push(hexDigit); + } + + return Uint8Array.from(buffer); + }, + + toHex(uint8array: Uint8Array): string { + return Array.from(uint8array, byte => byte.toString(16).padStart(2, '0')).join(''); + }, + + toUTF8(uint8array: Uint8Array, start: number, end: number, fatal: boolean): string { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(uint8array, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + + return parseUtf8(uint8array, start, end, fatal); + }, + + utf8ByteLength(input: string): number { + return new TextEncoder().encode(input).byteLength; + }, + + encodeUTF8Into(uint8array: Uint8Array, source: string, byteOffset: number): number { + const bytes = new TextEncoder().encode(source); + uint8array.set(bytes, byteOffset); + return bytes.byteLength; + }, + + randomBytes: webRandomBytes, + + swap32(buffer: Uint8Array): Uint8Array { + if (buffer.length % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (let i = 0; i < buffer.length; i += 4) { + const byte0 = buffer[i]; + const byte1 = buffer[i + 1]; + const byte2 = buffer[i + 2]; + const byte3 = buffer[i + 3]; + buffer[i] = byte3; + buffer[i + 1] = byte2; + buffer[i + 2] = byte1; + buffer[i + 3] = byte0; + } + + return buffer; + } +}; diff --git a/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/History.md b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/History.md new file mode 100644 index 00000000..d60ce0e6 --- /dev/null +++ b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/History.md @@ -0,0 +1,97 @@ +3.1.2 / 2022-01-27 +================== + + * Fix return value for un-parsable strings + +3.1.1 / 2021-11-15 +================== + + * Fix "thousandsSeparator" incorrecting formatting fractional part + +3.1.0 / 2019-01-22 +================== + + * Add petabyte (`pb`) support + +3.0.0 / 2017-08-31 +================== + + * Change "kB" to "KB" in format output + * Remove support for Node.js 0.6 + * Remove support for ComponentJS + +2.5.0 / 2017-03-24 +================== + + * Add option "unit" + +2.4.0 / 2016-06-01 +================== + + * Add option "unitSeparator" + +2.3.0 / 2016-02-15 +================== + + * Drop partial bytes on all parsed units + * Fix non-finite numbers to `.format` to return `null` + * Fix parsing byte string that looks like hex + * perf: hoist regular expressions + +2.2.0 / 2015-11-13 +================== + + * add option "decimalPlaces" + * add option "fixedDecimals" + +2.1.0 / 2015-05-21 +================== + + * add `.format` export + * add `.parse` export + +2.0.2 / 2015-05-20 +================== + + * remove map recreation + * remove unnecessary object construction + +2.0.1 / 2015-05-07 +================== + + * fix browserify require + * remove node.extend dependency + +2.0.0 / 2015-04-12 +================== + + * add option "case" + * add option "thousandsSeparator" + * return "null" on invalid parse input + * support proper round-trip: bytes(bytes(num)) === num + * units no longer case sensitive when parsing + +1.0.0 / 2014-05-05 +================== + + * add negative support. fixes #6 + +0.3.0 / 2014-03-19 +================== + + * added terabyte support + +0.2.1 / 2013-04-01 +================== + + * add .component + +0.2.0 / 2012-10-28 +================== + + * bytes(200).should.eql('200b') + +0.1.0 / 2012-07-04 +================== + + * add bytes to string conversion [yields] diff --git a/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/LICENSE b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/LICENSE new file mode 100644 index 00000000..63e95a96 --- /dev/null +++ b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015 Jed Watson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/Readme.md b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/Readme.md new file mode 100644 index 00000000..5790e23e --- /dev/null +++ b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/Readme.md @@ -0,0 +1,152 @@ +# Bytes utility + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install bytes +``` + +## Usage + +```js +var bytes = require('bytes'); +``` + +#### bytes(number|string value, [options]): number|string|null + +Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`. + +**Arguments** + +| Name | Type | Description | +|---------|----------|--------------------| +| value | `number`|`string` | Number value to format or string value to parse | +| options | `Object` | Conversion options for `format` | + +**Returns** + +| Name | Type | Description | +|---------|------------------|-------------------------------------------------| +| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. | + +**Example** + +```js +bytes(1024); +// output: '1KB' + +bytes('1KB'); +// output: 1024 +``` + +#### bytes.format(number value, [options]): string|null + +Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is + rounded. + +**Arguments** + +| Name | Type | Description | +|---------|----------|--------------------| +| value | `number` | Value in bytes | +| options | `Object` | Conversion options | + +**Options** + +| Property | Type | Description | +|-------------------|--------|-----------------------------------------------------------------------------------------| +| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. | +| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` | +| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. | +| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). | +| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. | + +**Returns** + +| Name | Type | Description | +|---------|------------------|-------------------------------------------------| +| results | `string`|`null` | Return null upon error. String value otherwise. | + +**Example** + +```js +bytes.format(1024); +// output: '1KB' + +bytes.format(1000); +// output: '1000B' + +bytes.format(1000, {thousandsSeparator: ' '}); +// output: '1 000B' + +bytes.format(1024 * 1.7, {decimalPlaces: 0}); +// output: '2KB' + +bytes.format(1024, {unitSeparator: ' '}); +// output: '1 KB' +``` + +#### bytes.parse(string|number value): number|null + +Parse the string value into an integer in bytes. If no unit is given, or `value` +is a number, it is assumed the value is in bytes. + +Supported units and abbreviations are as follows and are case-insensitive: + + * `b` for bytes + * `kb` for kilobytes + * `mb` for megabytes + * `gb` for gigabytes + * `tb` for terabytes + * `pb` for petabytes + +The units are in powers of two, not ten. This means 1kb = 1024b according to this parser. + +**Arguments** + +| Name | Type | Description | +|---------------|--------|--------------------| +| value | `string`|`number` | String to parse, or number in bytes. | + +**Returns** + +| Name | Type | Description | +|---------|-------------|-------------------------| +| results | `number`|`null` | Return null upon error. Value in bytes otherwise. | + +**Example** + +```js +bytes.parse('1KB'); +// output: 1024 + +bytes.parse('1024'); +// output: 1024 + +bytes.parse(1024); +// output: 1024 +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci +[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master +[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master +[downloads-image]: https://badgen.net/npm/dm/bytes +[downloads-url]: https://npmjs.org/package/bytes +[npm-image]: https://badgen.net/npm/v/bytes +[npm-url]: https://npmjs.org/package/bytes diff --git a/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/index.js b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/index.js new file mode 100644 index 00000000..6f2d0f89 --- /dev/null +++ b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/index.js @@ -0,0 +1,170 @@ +/*! + * bytes + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015 Jed Watson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = bytes; +module.exports.format = format; +module.exports.parse = parse; + +/** + * Module variables. + * @private + */ + +var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; + +var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; + +var map = { + b: 1, + kb: 1 << 10, + mb: 1 << 20, + gb: 1 << 30, + tb: Math.pow(1024, 4), + pb: Math.pow(1024, 5), +}; + +var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; + +/** + * Convert the given value in bytes into a string or parse to string to an integer in bytes. + * + * @param {string|number} value + * @param {{ + * case: [string], + * decimalPlaces: [number] + * fixedDecimals: [boolean] + * thousandsSeparator: [string] + * unitSeparator: [string] + * }} [options] bytes options. + * + * @returns {string|number|null} + */ + +function bytes(value, options) { + if (typeof value === 'string') { + return parse(value); + } + + if (typeof value === 'number') { + return format(value, options); + } + + return null; +} + +/** + * Format the given value in bytes into a string. + * + * If the value is negative, it is kept as such. If it is a float, + * it is rounded. + * + * @param {number} value + * @param {object} [options] + * @param {number} [options.decimalPlaces=2] + * @param {number} [options.fixedDecimals=false] + * @param {string} [options.thousandsSeparator=] + * @param {string} [options.unit=] + * @param {string} [options.unitSeparator=] + * + * @returns {string|null} + * @public + */ + +function format(value, options) { + if (!Number.isFinite(value)) { + return null; + } + + var mag = Math.abs(value); + var thousandsSeparator = (options && options.thousandsSeparator) || ''; + var unitSeparator = (options && options.unitSeparator) || ''; + var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; + var fixedDecimals = Boolean(options && options.fixedDecimals); + var unit = (options && options.unit) || ''; + + if (!unit || !map[unit.toLowerCase()]) { + if (mag >= map.pb) { + unit = 'PB'; + } else if (mag >= map.tb) { + unit = 'TB'; + } else if (mag >= map.gb) { + unit = 'GB'; + } else if (mag >= map.mb) { + unit = 'MB'; + } else if (mag >= map.kb) { + unit = 'KB'; + } else { + unit = 'B'; + } + } + + var val = value / map[unit.toLowerCase()]; + var str = val.toFixed(decimalPlaces); + + if (!fixedDecimals) { + str = str.replace(formatDecimalsRegExp, '$1'); + } + + if (thousandsSeparator) { + str = str.split('.').map(function (s, i) { + return i === 0 + ? s.replace(formatThousandsRegExp, thousandsSeparator) + : s + }).join('.'); + } + + return str + unitSeparator + unit; +} + +/** + * Parse the string value into an integer in bytes. + * + * If no unit is given, it is assumed the value is in bytes. + * + * @param {number|string} val + * + * @returns {number|null} + * @public + */ + +function parse(val) { + if (typeof val === 'number' && !isNaN(val)) { + return val; + } + + if (typeof val !== 'string') { + return null; + } + + // Test if the string passed is valid + var results = parseRegExp.exec(val); + var floatValue; + var unit = 'b'; + + if (!results) { + // Nothing could be extracted from the given string + floatValue = parseInt(val, 10); + unit = 'b' + } else { + // Retrieve the value and the unit + floatValue = parseFloat(results[1]); + unit = results[4].toLowerCase(); + } + + if (isNaN(floatValue)) { + return null; + } + + return Math.floor(map[unit] * floatValue); +} diff --git a/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/package.json b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/package.json new file mode 100644 index 00000000..f2b6a8b0 --- /dev/null +++ b/backend/node_modules/.pnpm/bytes@3.1.2/node_modules/bytes/package.json @@ -0,0 +1,42 @@ +{ + "name": "bytes", + "description": "Utility to parse a string bytes to bytes and vice-versa", + "version": "3.1.2", + "author": "TJ Holowaychuk (http://tjholowaychuk.com)", + "contributors": [ + "Jed Watson ", + "Théo FIDRY " + ], + "license": "MIT", + "keywords": [ + "byte", + "bytes", + "utility", + "parse", + "parser", + "convert", + "converter" + ], + "repository": "visionmedia/bytes.js", + "devDependencies": { + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.2.0", + "nyc": "15.1.0" + }, + "files": [ + "History.md", + "LICENSE", + "Readme.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --check-leaks --reporter spec", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.eslintrc b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.eslintrc new file mode 100644 index 00000000..201e859b --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + "no-extra-parens": 0, + "no-magic-numbers": 0, + }, +} diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.github/FUNDING.yml b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.github/FUNDING.yml new file mode 100644 index 00000000..0011e9d6 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bind-apply-helpers +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.nycrc b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/CHANGELOG.md b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/CHANGELOG.md new file mode 100644 index 00000000..24849428 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.1...v1.0.2) - 2025-02-12 + +### Commits + +- [types] improve inferred types [`e6f9586`](https://github.com/ljharb/call-bind-apply-helpers/commit/e6f95860a3c72879cb861a858cdfb8138fbedec1) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`e43d540`](https://github.com/ljharb/call-bind-apply-helpers/commit/e43d5409f97543bfbb11f345d47d8ce4e066d8c1) + +## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08 + +### Commits + +- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8) +- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75) +- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940) + +## v1.0.0 - 2024-12-05 + +### Commits + +- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04) +- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f) +- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603) +- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930) diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/LICENSE b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/README.md b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/README.md new file mode 100644 index 00000000..8fc0dae1 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/README.md @@ -0,0 +1,62 @@ +# call-bind-apply-helpers [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Helper functions around Function call/apply/bind, for use in `call-bind`. + +The only packages that should likely ever use this package directly are `call-bind` and `get-intrinsic`. +Please use `call-bind` unless you have a very good reason not to. + +## Getting started + +```sh +npm install --save call-bind-apply-helpers +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBindBasic = require('call-bind-apply-helpers'); + +function f(a, b) { + assert.equal(this, 1); + assert.equal(a, 2); + assert.equal(b, 3); + assert.equal(arguments.length, 2); +} + +const fBound = callBindBasic([f, 1]); + +delete Function.prototype.call; +delete Function.prototype.bind; + +fBound(2, 3); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bind-apply-helpers +[npm-version-svg]: https://versionbadg.es/ljharb/call-bind-apply-helpers.svg +[deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers.svg +[deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers +[dev-deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bind-apply-helpers.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bind-apply-helpers.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bind-apply-helpers.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bind-apply-helpers +[codecov-image]: https://codecov.io/gh/ljharb/call-bind-apply-helpers/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind-apply-helpers/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind-apply-helpers +[actions-url]: https://github.com/ljharb/call-bind-apply-helpers/actions diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.d.ts b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.d.ts new file mode 100644 index 00000000..b87286a2 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.d.ts @@ -0,0 +1 @@ +export = Reflect.apply; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js new file mode 100644 index 00000000..ffa51355 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js @@ -0,0 +1,10 @@ +'use strict'; + +var bind = require('function-bind'); + +var $apply = require('./functionApply'); +var $call = require('./functionCall'); +var $reflectApply = require('./reflectApply'); + +/** @type {import('./actualApply')} */ +module.exports = $reflectApply || bind.call($call, $apply); diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.d.ts b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.d.ts new file mode 100644 index 00000000..d176c1ab --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.d.ts @@ -0,0 +1,19 @@ +import actualApply from './actualApply'; + +type TupleSplitHead = T['length'] extends N + ? T + : T extends [...infer R, any] + ? TupleSplitHead + : never + +type TupleSplitTail = O['length'] extends N + ? T + : T extends [infer F, ...infer R] + ? TupleSplitTail<[...R], N, [...O, F]> + : never + +type TupleSplit = [TupleSplitHead, TupleSplitTail] + +declare function applyBind(...args: TupleSplit, 2>[1]): ReturnType; + +export = applyBind; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js new file mode 100644 index 00000000..d2b77231 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js @@ -0,0 +1,10 @@ +'use strict'; + +var bind = require('function-bind'); +var $apply = require('./functionApply'); +var actualApply = require('./actualApply'); + +/** @type {import('./applyBind')} */ +module.exports = function applyBind() { + return actualApply(bind, $apply, arguments); +}; diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.d.ts b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.d.ts new file mode 100644 index 00000000..1f6e11b3 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.d.ts @@ -0,0 +1 @@ +export = Function.prototype.apply; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js new file mode 100644 index 00000000..c71df9c2 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./functionApply')} */ +module.exports = Function.prototype.apply; diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.d.ts b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.d.ts new file mode 100644 index 00000000..15e93df3 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.d.ts @@ -0,0 +1 @@ +export = Function.prototype.call; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js new file mode 100644 index 00000000..7a8d8735 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./functionCall')} */ +module.exports = Function.prototype.call; diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.d.ts b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.d.ts new file mode 100644 index 00000000..541516bd --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.d.ts @@ -0,0 +1,64 @@ +type RemoveFromTuple< + Tuple extends readonly unknown[], + RemoveCount extends number, + Index extends 1[] = [] +> = Index["length"] extends RemoveCount + ? Tuple + : Tuple extends [infer First, ...infer Rest] + ? RemoveFromTuple + : Tuple; + +type ConcatTuples< + Prefix extends readonly unknown[], + Suffix extends readonly unknown[] +> = [...Prefix, ...Suffix]; + +type ExtractFunctionParams = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R + ? { thisArg: TThis; params: P; returnType: R } + : never; + +type BindFunction< + T extends (this: any, ...args: any[]) => any, + TThis, + TBoundArgs extends readonly unknown[], + ReceiverBound extends boolean +> = ExtractFunctionParams extends { + thisArg: infer OrigThis; + params: infer P extends readonly unknown[]; + returnType: infer R; +} + ? ReceiverBound extends true + ? (...args: RemoveFromTuple>) => R extends [OrigThis, ...infer Rest] + ? [TThis, ...Rest] // Replace `this` with `thisArg` + : R + : >>( + thisArg: U, + ...args: RemainingArgs + ) => R extends [OrigThis, ...infer Rest] + ? [U, ...ConcatTuples] // Preserve bound args in return type + : R + : never; + +declare function callBind< + const T extends (this: any, ...args: any[]) => any, + Extracted extends ExtractFunctionParams, + const TBoundArgs extends Partial & readonly unknown[], + const TThis extends Extracted["thisArg"] +>( + args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs] +): BindFunction; + +declare function callBind< + const T extends (this: any, ...args: any[]) => any, + Extracted extends ExtractFunctionParams, + const TBoundArgs extends Partial & readonly unknown[] +>( + args: [fn: T, ...boundArgs: TBoundArgs] +): BindFunction; + +declare function callBind( + args: [fn: Exclude, ...rest: TArgs] +): never; + +// export as namespace callBind; +export = callBind; diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js new file mode 100644 index 00000000..2f6dab4c --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js @@ -0,0 +1,15 @@ +'use strict'; + +var bind = require('function-bind'); +var $TypeError = require('es-errors/type'); + +var $call = require('./functionCall'); +var $actualApply = require('./actualApply'); + +/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ +module.exports = function callBindBasic(args) { + if (args.length < 1 || typeof args[0] !== 'function') { + throw new $TypeError('a function is required'); + } + return $actualApply(bind, $call, args); +}; diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/package.json b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/package.json new file mode 100644 index 00000000..923b8be2 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/package.json @@ -0,0 +1,85 @@ +{ + "name": "call-bind-apply-helpers", + "version": "1.0.2", + "description": "Helper functions around Function call/apply/bind, for use in `call-bind`", + "main": "index.js", + "exports": { + ".": "./index.js", + "./actualApply": "./actualApply.js", + "./applyBind": "./applyBind.js", + "./functionApply": "./functionApply.js", + "./functionCall": "./functionCall.js", + "./reflectApply": "./reflectApply.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bind-apply-helpers.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bind-apply-helpers/issues" + }, + "homepage": "https://github.com/ljharb/call-bind-apply-helpers#readme", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.3", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/for-each": "^0.3.3", + "@types/function-bind": "^1.1.10", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "has-strict-mode": "^1.1.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.d.ts b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.d.ts new file mode 100644 index 00000000..6b2ae764 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.d.ts @@ -0,0 +1,3 @@ +declare const reflectApply: false | typeof Reflect.apply; + +export = reflectApply; diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js new file mode 100644 index 00000000..3d03caa6 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./reflectApply')} */ +module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/test/index.js b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/test/index.js new file mode 100644 index 00000000..1cdc89ed --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/test/index.js @@ -0,0 +1,63 @@ +'use strict'; + +var callBind = require('../'); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var v = require('es-value-fixtures'); + +var test = require('tape'); + +test('callBindBasic', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + // @ts-expect-error + function () { callBind([nonFunction]); }, + TypeError, + inspect(nonFunction) + ' is not a function' + ); + }); + + var sentinel = { sentinel: true }; + /** @type {(this: T, a: A, b: B) => [T | undefined, A, B]} */ + var func = function (a, b) { + // eslint-disable-next-line no-invalid-this + return [!hasStrictMode && this === global ? undefined : this, a, b]; + }; + t.equal(func.length, 2, 'original function length is 2'); + + /** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */ + var bound = callBind([func]); + /** type {((a: number, b: number) => [typeof sentinel, typeof a, typeof b])} */ + var boundR = callBind([func, sentinel]); + /** type {((b: number) => [typeof sentinel, number, typeof b])} */ + var boundArg = callBind([func, sentinel, /** @type {const} */ (1)]); + + // @ts-expect-error + t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args'); + + // @ts-expect-error + t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); + // @ts-expect-error + t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args'); + // @ts-expect-error + t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); + // @ts-expect-error + t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); + + t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); + t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args'); + t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); + t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); + + // @ts-expect-error + t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); + // @ts-expect-error + t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); + // @ts-expect-error + t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); + // @ts-expect-error + t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/tsconfig.json b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/tsconfig.json new file mode 100644 index 00000000..aef99930 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/es-errors b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/function-bind b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/function-bind new file mode 120000 index 00000000..62a99de1 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/function-bind @@ -0,0 +1 @@ +../../function-bind@1.1.2/node_modules/function-bind \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind-apply-helpers b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind-apply-helpers new file mode 120000 index 00000000..124bee97 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind-apply-helpers @@ -0,0 +1 @@ +../../call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintignore b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintignore new file mode 100644 index 00000000..404abb22 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintrc b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintrc new file mode 100644 index 00000000..dfa9a6cd --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + "no-magic-numbers": 0, + }, +} diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.github/FUNDING.yml b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.github/FUNDING.yml new file mode 100644 index 00000000..c70c2ecd --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bind +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.nycrc b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/CHANGELOG.md b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/CHANGELOG.md new file mode 100644 index 00000000..4eeae09e --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/CHANGELOG.md @@ -0,0 +1,115 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.9](https://github.com/ljharb/call-bind/compare/v1.0.8...v1.0.9) - 2026-04-09 + +### Commits + +- [Fix] correct `.length` computation when partial args exceed function arity [`95c406d`](https://github.com/ljharb/call-bind/commit/95c406dff9e763ff840585dc6c375b0129adb248) +- [Dev Deps] update `@ljharb/eslint-config`, `es-value-fixtures`, `eslint`, `for-each`, `has-strict-mode`, `npmignore`, `object-inspect` [`06a4e21`](https://github.com/ljharb/call-bind/commit/06a4e2107ebe5411c781c8a4aab7ef34f83bc8f5) +- [Deps] update `call-bind-apply-helpers`, `es-define-property`, `get-intrinsic` [`3fea81e`](https://github.com/ljharb/call-bind/commit/3fea81e9a57a2a4bc283c20883ae72fb310a3e0e) +- [readme] replace runkit CI badge with shields.io check-runs badge [`23437d4`](https://github.com/ljharb/call-bind/commit/23437d42c9ca880feba441a23a141313d558fc30) + +## [v1.0.8](https://github.com/ljharb/call-bind/compare/v1.0.7...v1.0.8) - 2024-12-05 + +### Commits + +- [Refactor] extract out some helpers and avoid get-intrinsic usage [`407fd5e`](https://github.com/ljharb/call-bind/commit/407fd5eec34ec58394522a6ce3badfa4788fd5ae) +- [Refactor] replace code with extracted `call-bind-apply-helpers` [`81018fb`](https://github.com/ljharb/call-bind/commit/81018fb78902ff5acbc6c09300780e97f0db6a34) +- [Tests] use `set-function-length/env` [`0fc311d`](https://github.com/ljharb/call-bind/commit/0fc311de0e115cfa6b02969b23a42ad45aadf224) +- [actions] split out node 10-20, and 20+ [`77a0cad`](https://github.com/ljharb/call-bind/commit/77a0cad75f83f5b8050dc13baef4fa2cff537fa3) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `es-value-fixtures`, `gopd`, `object-inspect`, `tape` [`a145d10`](https://github.com/ljharb/call-bind/commit/a145d10fe847f350e11094f8541848b028ee8c91) +- [Tests] replace `aud` with `npm audit` [`30ca3dd`](https://github.com/ljharb/call-bind/commit/30ca3dd7234648eb029947477d06b17879e10727) +- [Deps] update `set-function-length` [`57c79a3`](https://github.com/ljharb/call-bind/commit/57c79a3666022ea797cc2a4a3b43fe089bc97d1b) +- [Dev Deps] add missing peer dep [`601cfa5`](https://github.com/ljharb/call-bind/commit/601cfa5540066b6206039ceb9496cecbd134ff7b) + +## [v1.0.7](https://github.com/ljharb/call-bind/compare/v1.0.6...v1.0.7) - 2024-02-12 + +### Commits + +- [Refactor] use `es-define-property` [`09b76a0`](https://github.com/ljharb/call-bind/commit/09b76a01634440461d44a80c9924ec4b500f3b03) +- [Deps] update `get-intrinsic`, `set-function-length` [`ad5136d`](https://github.com/ljharb/call-bind/commit/ad5136ddda2a45c590959829ad3dce0c9f4e3590) + +## [v1.0.6](https://github.com/ljharb/call-bind/compare/v1.0.5...v1.0.6) - 2024-02-05 + +### Commits + +- [Dev Deps] update `aud`, `npmignore`, `tape` [`d564d5c`](https://github.com/ljharb/call-bind/commit/d564d5ce3e06a19df4d499c77f8d1a9da44e77aa) +- [Deps] update `get-intrinsic`, `set-function-length` [`cfc2bdc`](https://github.com/ljharb/call-bind/commit/cfc2bdca7b633df0e0e689e6b637f668f1c6792e) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`64cd289`](https://github.com/ljharb/call-bind/commit/64cd289ae5862c250a4ca80aa8d461047c166af5) +- [meta] add missing `engines.node` [`32a4038`](https://github.com/ljharb/call-bind/commit/32a4038857b62179f7f9b7b3df2c5260036be582) + +## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19 + +### Commits + +- [Fix] throw an error on non-functions as early as possible [`f262408`](https://github.com/ljharb/call-bind/commit/f262408f822c840fbc268080f3ad7c429611066d) +- [Deps] update `set-function-length` [`3fff271`](https://github.com/ljharb/call-bind/commit/3fff27145a1e3a76a5b74f1d7c3c43d0fa3b9871) + +## [v1.0.4](https://github.com/ljharb/call-bind/compare/v1.0.3...v1.0.4) - 2023-10-19 + +## [v1.0.3](https://github.com/ljharb/call-bind/compare/v1.0.2...v1.0.3) - 2023-10-19 + +### Commits + +- [actions] reuse common workflows [`a994df6`](https://github.com/ljharb/call-bind/commit/a994df69f401f4bf735a4ccd77029b85d1549453) +- [meta] use `npmignore` to autogenerate an npmignore file [`eef3ef2`](https://github.com/ljharb/call-bind/commit/eef3ef21e1f002790837fedb8af2679c761fbdf5) +- [readme] flesh out content [`1845ccf`](https://github.com/ljharb/call-bind/commit/1845ccfd9976a607884cfc7157c93192cc16cf22) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5b47d53`](https://github.com/ljharb/call-bind/commit/5b47d53d2fd74af5ea0a44f1d51e503cd42f7a90) +- [Refactor] use `set-function-length` [`a0e165c`](https://github.com/ljharb/call-bind/commit/a0e165c5dc61db781cbc919b586b1c2b8da0b150) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9c50103`](https://github.com/ljharb/call-bind/commit/9c50103f44137279a817317cf6cc421a658f85b4) +- [meta] simplify "exports" [`019c6d0`](https://github.com/ljharb/call-bind/commit/019c6d06b0e1246ceed8e579f57e44441cbbf6d9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`23bd718`](https://github.com/ljharb/call-bind/commit/23bd718a288d3b03042062b4ef5153b3cea83f11) +- [actions] update codecov uploader [`62552d7`](https://github.com/ljharb/call-bind/commit/62552d79cc79e05825e99aaba134ae5b37f33da5) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ec81665`](https://github.com/ljharb/call-bind/commit/ec81665b300f87eabff597afdc8b8092adfa7afd) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`35d67fc`](https://github.com/ljharb/call-bind/commit/35d67fcea883e686650f736f61da5ddca2592de8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`0266d8d`](https://github.com/ljharb/call-bind/commit/0266d8d2a45086a922db366d0c2932fa463662ff) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`43a5b28`](https://github.com/ljharb/call-bind/commit/43a5b28a444e710e1bbf92adb8afb5cf7523a223) +- [Deps] update `define-data-property`, `function-bind`, `get-intrinsic` [`780eb36`](https://github.com/ljharb/call-bind/commit/780eb36552514f8cc99c70821ce698697c2726a5) +- [Dev Deps] update `aud`, `tape` [`90d50ad`](https://github.com/ljharb/call-bind/commit/90d50ad03b061e0268b3380b0065fcaec183dc05) +- [meta] use `prepublishOnly` script for npm 7+ [`44c5433`](https://github.com/ljharb/call-bind/commit/44c5433b7980e02b4870007046407cf6fc543329) +- [Deps] update `get-intrinsic` [`86bfbfc`](https://github.com/ljharb/call-bind/commit/86bfbfcf34afdc6eabc93ce3d408548d0e27d958) +- [Deps] update `get-intrinsic` [`5c53354`](https://github.com/ljharb/call-bind/commit/5c5335489be0294c18cd7a8bb6e08226ee019ff5) +- [actions] update checkout action [`4c393a8`](https://github.com/ljharb/call-bind/commit/4c393a8173b3c8e5b30d5b3297b3b94d48bf87f3) +- [Deps] update `get-intrinsic` [`4e70bde`](https://github.com/ljharb/call-bind/commit/4e70bdec0626acb11616d66250fc14565e716e91) +- [Deps] update `get-intrinsic` [`55ae803`](https://github.com/ljharb/call-bind/commit/55ae803a920bd93c369cd798c20de31f91e9fc60) + +## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 + +### Commits + +- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) + +## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 + +### Commits + +- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) +- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) +- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) +- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) +- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) +- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) +- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) +- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) + +## v1.0.0 - 2020-10-30 + +### Commits + +- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) +- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) +- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) +- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) +- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) +- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) +- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) +- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) +- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/LICENSE b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/LICENSE new file mode 100644 index 00000000..48f05d01 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/README.md b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/README.md new file mode 100644 index 00000000..2d04aef6 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/README.md @@ -0,0 +1,64 @@ +# call-bind [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robustly `.call.bind()` a function. + +## Getting started + +```sh +npm install --save call-bind +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBind = require('call-bind'); +const callBound = require('call-bind/callBound'); + +function f(a, b) { + assert.equal(this, 1); + assert.equal(a, 2); + assert.equal(b, 3); + assert.equal(arguments.length, 2); +} + +const fBound = callBind(f); + +const slice = callBound('Array.prototype.slice'); + +delete Function.prototype.call; +delete Function.prototype.bind; + +fBound(1, 2, 3); + +assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bind +[npm-version-svg]: https://versionbadg.es/ljharb/call-bind.svg +[deps-svg]: https://david-dm.org/ljharb/call-bind.svg +[deps-url]: https://david-dm.org/ljharb/call-bind +[dev-deps-svg]: https://david-dm.org/ljharb/call-bind/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bind#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bind.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bind.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bind.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bind +[codecov-image]: https://codecov.io/gh/ljharb/call-bind/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind/ +[actions-image]: https://img.shields.io/github/check-runs/ljharb/call-bind/main +[actions-url]: https://github.com/ljharb/call-bind/actions diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/callBound.js b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/callBound.js new file mode 100644 index 00000000..8374adfd --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js new file mode 100644 index 00000000..c111fc01 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js @@ -0,0 +1,24 @@ +'use strict'; + +var setFunctionLength = require('set-function-length'); + +var $defineProperty = require('es-define-property'); + +var callBindBasic = require('call-bind-apply-helpers'); +var applyBind = require('call-bind-apply-helpers/applyBind'); + +module.exports = function callBind(originalFunction) { + var func = callBindBasic(arguments); + var adjustedLength = 1 + originalFunction.length - (arguments.length - 1); + return setFunctionLength( + func, + adjustedLength > 0 ? adjustedLength : 0, + true + ); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/package.json b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/package.json new file mode 100644 index 00000000..85f9d8e5 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/package.json @@ -0,0 +1,93 @@ +{ + "name": "call-bind", + "version": "1.0.9", + "description": "Robustly `.call.bind()` a function", + "main": "index.js", + "exports": { + ".": "./index.js", + "./callBound": "./callBound.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "evalmd README.md", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bind.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "callbind", + "callbound", + "call", + "bind", + "bound", + "call-bind", + "call-bound", + "function", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bind/issues" + }, + "homepage": "https://github.com/ljharb/call-bind#readme", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "get-intrinsic": "^1.3.0", + "set-function-length": "^1.2.2" + }, + "devDependencies": { + "@ljharb/eslint-config": "^22.2.2", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "^8.57.1", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "has-strict-mode": "^1.1.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/callBound.js b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/callBound.js new file mode 100644 index 00000000..c32319d7 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/callBound.js @@ -0,0 +1,54 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../callBound'); + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + // prototype function + t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/index.js b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/index.js new file mode 100644 index 00000000..8e817439 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/test/index.js @@ -0,0 +1,82 @@ +'use strict'; + +var callBind = require('../'); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var v = require('es-value-fixtures'); + +var test = require('tape'); + +/* + * older engines have length nonconfigurable + * in io.js v3, it is configurable except on bound functions, hence the .bind() + */ +var boundFnsHaveConfigurableLengths = require('set-function-length/env').boundFnsHaveConfigurableLengths; + +test('callBind', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { callBind(nonFunction); }, + TypeError, + inspect(nonFunction) + ' is not a function' + ); + }); + + var sentinel = { sentinel: true }; + var func = function (a, b) { + return [!hasStrictMode && this === global ? undefined : this, a, b]; + }; + t.equal(func.length, 2, 'original function length is 2'); + t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); + t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); + t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); + + var bound = callBind(func); + t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); + t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func with right args'); + t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); + + var boundR = callBind(func, sentinel); + t.equal(boundR.length, func.length, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); + t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); + t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); + + var zeroLen = function () { + return [!hasStrictMode && this === global ? undefined : this]; + }; + t.equal(zeroLen.length, 0, 'zero-length function has length 0'); + + var boundZero = callBind(zeroLen, sentinel); + t.equal(boundZero.length, 0, 'zero-length function with receiver has length 0', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(boundZero(), [sentinel], 'zero-length bound func with receiver works'); + + var boundArg = callBind(func, sentinel, 1); + t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths }); + t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); + t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); + t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); + + t.test('callBind.apply', function (st) { + var aBound = callBind.apply(func); + st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); + st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + + var aBoundArg = callBind.apply(func); + st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); + st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + + var aBoundR = callBind.apply(func, sentinel); + st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); + st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); + st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/es-define-property b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/es-define-property new file mode 120000 index 00000000..21a4f5d0 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/es-define-property @@ -0,0 +1 @@ +../../es-define-property@1.0.1/node_modules/es-define-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/get-intrinsic b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/get-intrinsic new file mode 120000 index 00000000..0042f6aa --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/get-intrinsic @@ -0,0 +1 @@ +../../get-intrinsic@1.3.0/node_modules/get-intrinsic \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/set-function-length b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/set-function-length new file mode 120000 index 00000000..91a1462b --- /dev/null +++ b/backend/node_modules/.pnpm/call-bind@1.0.9/node_modules/set-function-length @@ -0,0 +1 @@ +../../set-function-length@1.2.2/node_modules/set-function-length \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bind-apply-helpers b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bind-apply-helpers new file mode 120000 index 00000000..124bee97 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bind-apply-helpers @@ -0,0 +1 @@ +../../call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers \ No newline at end of file diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.eslintrc b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.eslintrc new file mode 100644 index 00000000..2612ed8f --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.github/FUNDING.yml b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.github/FUNDING.yml new file mode 100644 index 00000000..2a2a1357 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bound +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.nycrc b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/CHANGELOG.md b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/CHANGELOG.md new file mode 100644 index 00000000..8bde4e9a --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/CHANGELOG.md @@ -0,0 +1,42 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03 + +### Commits + +- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719) +- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8) + +## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15 + +### Commits + +- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be) +- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e) +- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49) +- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7) + +## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10 + +### Commits + +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5) +- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14) +- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871) + +## v1.0.1 - 2024-12-05 + +### Commits + +- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d) +- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9) +- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275) +- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb) +- [actions] skip `npm ls` in node < 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8) +- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97) diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/LICENSE b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/README.md b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/README.md new file mode 100644 index 00000000..a44e43e5 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/README.md @@ -0,0 +1,53 @@ +# call-bound [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`. + +## Getting started + +```sh +npm install --save call-bound +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBound = require('call-bound'); + +const slice = callBound('Array.prototype.slice'); + +delete Function.prototype.call; +delete Function.prototype.bind; +delete Array.prototype.slice; + +assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bound +[npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg +[deps-svg]: https://david-dm.org/ljharb/call-bound.svg +[deps-url]: https://david-dm.org/ljharb/call-bound +[dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bound.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bound.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bound +[codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound +[actions-url]: https://github.com/ljharb/call-bound/actions diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.d.ts b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.d.ts new file mode 100644 index 00000000..5562f00e --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.d.ts @@ -0,0 +1,94 @@ +type Intrinsic = typeof globalThis; + +type IntrinsicName = keyof Intrinsic | `%${keyof Intrinsic}%`; + +type IntrinsicPath = IntrinsicName | `${StripPercents}.${string}` | `%${StripPercents}.${string}%`; + +type AllowMissing = boolean; + +type StripPercents = T extends `%${infer U}%` ? U : T; + +type BindMethodPrecise = + F extends (this: infer This, ...args: infer Args) => infer R + ? (obj: This, ...args: Args) => R + : F extends { + (this: infer This1, ...args: infer Args1): infer R1; + (this: infer This2, ...args: infer Args2): infer R2 + } + ? { + (obj: This1, ...args: Args1): R1; + (obj: This2, ...args: Args2): R2 + } + : never + +// Extract method type from a prototype +type GetPrototypeMethod = + (typeof globalThis)[T] extends { prototype: any } + ? M extends keyof (typeof globalThis)[T]['prototype'] + ? (typeof globalThis)[T]['prototype'][M] + : never + : never + +// Get static property/method +type GetStaticMember = + P extends keyof (typeof globalThis)[T] ? (typeof globalThis)[T][P] : never + +// Type that maps string path to actual bound function or value with better precision +type BoundIntrinsic = + S extends `${infer Obj}.prototype.${infer Method}` + ? Obj extends keyof typeof globalThis + ? BindMethodPrecise> + : unknown + : S extends `${infer Obj}.${infer Prop}` + ? Obj extends keyof typeof globalThis + ? GetStaticMember + : unknown + : unknown + +declare function arraySlice(array: readonly T[], start?: number, end?: number): T[]; +declare function arraySlice(array: ArrayLike, start?: number, end?: number): T[]; +declare function arraySlice(array: IArguments, start?: number, end?: number): T[]; + +// Special cases for methods that need explicit typing +interface SpecialCases { + '%Object.prototype.isPrototypeOf%': (thisArg: {}, obj: unknown) => boolean; + '%String.prototype.replace%': { + (str: string, searchValue: string | RegExp, replaceValue: string): string; + (str: string, searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string + }; + '%Object.prototype.toString%': (obj: {}) => string; + '%Object.prototype.hasOwnProperty%': (obj: {}, v: PropertyKey) => boolean; + '%Array.prototype.slice%': typeof arraySlice; + '%Array.prototype.map%': (array: readonly T[], callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any) => U[]; + '%Array.prototype.filter%': (array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any) => T[]; + '%Array.prototype.indexOf%': (array: readonly T[], searchElement: T, fromIndex?: number) => number; + '%Function.prototype.apply%': (fn: (...args: A) => R, thisArg: any, args: A) => R; + '%Function.prototype.call%': (fn: (...args: A) => R, thisArg: any, ...args: A) => R; + '%Function.prototype.bind%': (fn: (...args: A) => R, thisArg: any, ...args: A) => (...remainingArgs: A) => R; + '%Promise.prototype.then%': { + (promise: Promise, onfulfilled: (value: T) => R | PromiseLike): Promise; + (promise: Promise, onfulfilled: ((value: T) => R | PromiseLike) | undefined | null, onrejected: (reason: any) => R | PromiseLike): Promise; + }; + '%RegExp.prototype.test%': (regexp: RegExp, str: string) => boolean; + '%RegExp.prototype.exec%': (regexp: RegExp, str: string) => RegExpExecArray | null; + '%Error.prototype.toString%': (error: Error) => string; + '%TypeError.prototype.toString%': (error: TypeError) => string; + '%String.prototype.split%': ( + obj: unknown, + splitter: string | RegExp | { + [Symbol.split](string: string, limit?: number): string[]; + }, + limit?: number | undefined + ) => string[]; +} + +/** + * Returns a bound function for a prototype method, or a value for a static property. + * + * @param name - The name of the intrinsic (e.g. 'Array.prototype.slice') + * @param {AllowMissing} [allowMissing] - Whether to allow missing intrinsics (default: false) + */ +declare function callBound, S extends IntrinsicPath>(name: K, allowMissing?: AllowMissing): SpecialCases[`%${StripPercents}%`]; +declare function callBound, S extends IntrinsicPath>(name: S, allowMissing?: AllowMissing): BoundIntrinsic; + +export = callBound; diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js new file mode 100644 index 00000000..e9ade749 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBindBasic = require('call-bind-apply-helpers'); + +/** @type {(thisArg: string, searchString: string, position?: number) => number} */ +var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); + +/** @type {import('.')} */ +module.exports = function callBoundIntrinsic(name, allowMissing) { + /* eslint no-extra-parens: 0 */ + + var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBindBasic(/** @type {const} */ ([intrinsic])); + } + return intrinsic; +}; diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/package.json b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/package.json new file mode 100644 index 00000000..d542db43 --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/package.json @@ -0,0 +1,99 @@ +{ + "name": "call-bound", + "version": "1.0.4", + "description": "Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bound.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "callbind", + "callbound", + "call", + "bind", + "bound", + "call-bind", + "call-bound", + "function", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bound/issues" + }, + "homepage": "https://github.com/ljharb/call-bound#readme", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.3.0", + "@types/call-bind": "^1.0.5", + "@types/get-intrinsic": "^1.2.3", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "gopd": "^1.2.0", + "has-strict-mode": "^1.1.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/test/index.js b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/test/index.js new file mode 100644 index 00000000..a2fc9f0f --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/test/index.js @@ -0,0 +1,61 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../'); + +/** @template {true} T @template U @typedef {T extends U ? T : never} AssertType */ + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + var x = callBound('Object.prototype.toString'); + var y = callBound('%Object.prototype.toString%'); + + // prototype function + t.notEqual(x, Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(y, Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(x(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(y(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + // @ts-expect-error + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + // @ts-expect-error + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/tsconfig.json b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/tsconfig.json new file mode 100644 index 00000000..8976d98b --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ESNext", + "lib": ["es2024"], + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/get-intrinsic b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/get-intrinsic new file mode 120000 index 00000000..0042f6aa --- /dev/null +++ b/backend/node_modules/.pnpm/call-bound@1.0.4/node_modules/get-intrinsic @@ -0,0 +1 @@ +../../get-intrinsic@1.3.0/node_modules/get-intrinsic \ No newline at end of file diff --git a/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/HISTORY.md b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/HISTORY.md new file mode 100644 index 00000000..45836713 --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/HISTORY.md @@ -0,0 +1,29 @@ +1.0.5 / 2023-01-29 +================== + + * perf: skip value escaping when unnecessary + +1.0.4 / 2017-09-11 +================== + + * perf: skip parameter parsing when no parameters + +1.0.3 / 2017-09-10 +================== + + * perf: remove argument reassignment + +1.0.2 / 2016-05-09 +================== + + * perf: enable strict mode + +1.0.1 / 2015-02-13 +================== + + * Improve missing `Content-Type` header error message + +1.0.0 / 2015-02-01 +================== + + * Initial implementation, derived from `media-typer@0.3.0` diff --git a/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/LICENSE b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/LICENSE new file mode 100644 index 00000000..34b1a2de --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/README.md b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/README.md new file mode 100644 index 00000000..c1a922a9 --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/README.md @@ -0,0 +1,94 @@ +# content-type + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Create and parse HTTP Content-Type header according to RFC 7231 + +## Installation + +```sh +$ npm install content-type +``` + +## API + +```js +var contentType = require('content-type') +``` + +### contentType.parse(string) + +```js +var obj = contentType.parse('image/svg+xml; charset=utf-8') +``` + +Parse a `Content-Type` header. This will return an object with the following +properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The media type (the type and subtype, always lower case). + Example: `'image/svg+xml'` + + - `parameters`: An object of the parameters in the media type (name of parameter + always lower case). Example: `{charset: 'utf-8'}` + +Throws a `TypeError` if the string is missing or invalid. + +### contentType.parse(req) + +```js +var obj = contentType.parse(req) +``` + +Parse the `Content-Type` header from the given `req`. Short-cut for +`contentType.parse(req.headers['content-type'])`. + +Throws a `TypeError` if the `Content-Type` header is missing or invalid. + +### contentType.parse(res) + +```js +var obj = contentType.parse(res) +``` + +Parse the `Content-Type` header set on the given `res`. Short-cut for +`contentType.parse(res.getHeader('content-type'))`. + +Throws a `TypeError` if the `Content-Type` header is missing or invalid. + +### contentType.format(obj) + +```js +var str = contentType.format({ + type: 'image/svg+xml', + parameters: { charset: 'utf-8' } +}) +``` + +Format an object into a `Content-Type` header. This will return a string of the +content type for the given object with the following properties (examples are +shown that produce the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'` + + - `parameters`: An object of the parameters in the media type (name of the + parameter will be lower-cased). Example: `{charset: 'utf-8'}` + +Throws a `TypeError` if the object contains an invalid type or parameter names. + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/content-type/master?label=ci +[ci-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/content-type/master +[coveralls-url]: https://coveralls.io/r/jshttp/content-type?branch=master +[node-image]: https://badgen.net/npm/node/content-type +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/content-type +[npm-url]: https://npmjs.org/package/content-type +[npm-version-image]: https://badgen.net/npm/v/content-type diff --git a/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js new file mode 100644 index 00000000..41840e7b --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js @@ -0,0 +1,225 @@ +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 + * + * parameter = token "=" ( token / quoted-string ) + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE + * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text + * obs-text = %x80-FF + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + */ +var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex +var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ // eslint-disable-line no-control-regex +var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ + +/** + * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 + * + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + * obs-text = %x80-FF + */ +var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g // eslint-disable-line no-control-regex + +/** + * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6 + */ +var QUOTE_REGEXP = /([\\"])/g + +/** + * RegExp to match type in RFC 7231 sec 3.1.1.1 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ +var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ + +/** + * Module exports. + * @public + */ + +exports.format = format +exports.parse = parse + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format (obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var parameters = obj.parameters + var type = obj.type + + if (!type || !TYPE_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + var string = type + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + if (!TOKEN_REGEXP.test(param)) { + throw new TypeError('invalid parameter name') + } + + string += '; ' + param + '=' + qstring(parameters[param]) + } + } + + return string +} + +/** + * Parse media type to object. + * + * @param {string|object} string + * @return {Object} + * @public + */ + +function parse (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + // support req/res-like objects as argument + var header = typeof string === 'object' + ? getcontenttype(string) + : string + + if (typeof header !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var index = header.indexOf(';') + var type = index !== -1 + ? header.slice(0, index).trim() + : header.trim() + + if (!TYPE_REGEXP.test(type)) { + throw new TypeError('invalid media type') + } + + var obj = new ContentType(type.toLowerCase()) + + // parse parameters + if (index !== -1) { + var key + var match + var value + + PARAM_REGEXP.lastIndex = index + + while ((match = PARAM_REGEXP.exec(header))) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (value.charCodeAt(0) === 0x22 /* " */) { + // remove quotes + value = value.slice(1, -1) + + // remove escapes + if (value.indexOf('\\') !== -1) { + value = value.replace(QESC_REGEXP, '$1') + } + } + + obj.parameters[key] = value + } + + if (index !== header.length) { + throw new TypeError('invalid parameter format') + } + } + + return obj +} + +/** + * Get content-type from req/res objects. + * + * @param {object} + * @return {Object} + * @private + */ + +function getcontenttype (obj) { + var header + + if (typeof obj.getHeader === 'function') { + // res-like + header = obj.getHeader('content-type') + } else if (typeof obj.headers === 'object') { + // req-like + header = obj.headers && obj.headers['content-type'] + } + + if (typeof header !== 'string') { + throw new TypeError('content-type header is missing from object') + } + + return header +} + +/** + * Quote a string if necessary. + * + * @param {string} val + * @return {string} + * @private + */ + +function qstring (val) { + var str = String(val) + + // no need to quote tokens + if (TOKEN_REGEXP.test(str)) { + return str + } + + if (str.length > 0 && !TEXT_REGEXP.test(str)) { + throw new TypeError('invalid parameter value') + } + + return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' +} + +/** + * Class to represent a content type. + * @private + */ +function ContentType (type) { + this.parameters = Object.create(null) + this.type = type +} diff --git a/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/package.json b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/package.json new file mode 100644 index 00000000..9db19f63 --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/package.json @@ -0,0 +1,42 @@ +{ + "name": "content-type", + "description": "Create and parse HTTP Content-Type header", + "version": "1.0.5", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "content-type", + "http", + "req", + "res", + "rfc7231" + ], + "repository": "jshttp/content-type", + "devDependencies": { + "deep-equal": "1.0.1", + "eslint": "8.32.0", + "eslint-config-standard": "15.0.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/LICENSE b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/LICENSE new file mode 100644 index 00000000..34b1a2de --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/README.md b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/README.md new file mode 100644 index 00000000..ae275e0f --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/README.md @@ -0,0 +1,71 @@ +# content-type + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][build-image]][build-url] +[![Build coverage][coverage-image]][coverage-url] +[![License][license-image]][license-url] + +Create and parse HTTP `Content-Type` header. + +## Installation + +```sh +npm install content-type +``` + +## API + +```js +const contentType = require("content-type"); +``` + +### contentType.parse(string, options?) + +```js +const obj = contentType.parse("image/svg+xml; charset=utf-8"); +``` + +Parse a `Content-Type` header. This will return an object with the following properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + +- `type`: The media type. Example: `'image/svg+xml'`. +- `parameters`: An object of the parameters in the media type (parameter name is always lower case). Example: `{charset: 'utf-8'}`. + +The parser is lenient and does not error. You should validate `type` and `parameters` before trusting them. + +#### Options + +- `parameters` (default: `true`): Set to `false` to skip parameters. +- `comma` (default: `false`): Set to `true` to stop on a comma. This can be used to parse the media range in an `Accept` header. +- `start` (default: `0`): Set index to start parsing from. + +### contentType.format(obj) + +```js +const str = contentType.format({ + type: "image/svg+xml", + parameters: { charset: "utf-8" }, +}); +``` + +Format an object into a `Content-Type` header. This will return a string of the content type for the given object with the following properties (examples are shown that produce the string `'image/svg+xml; charset=utf-8'`): + +- `type`: The media type. Example: `'image/svg+xml'`. +- `parameters`: An optional object of the parameters in the media type. Example: `{charset: 'utf-8'}`. + +Throws a `TypeError` if the object contains an invalid type or parameter names. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-type +[npm-url]: https://npmjs.org/package/content-type +[downloads-image]: https://img.shields.io/npm/dm/content-type +[downloads-url]: https://npmjs.org/package/content-type +[build-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-type/ci.yml?branch=master +[build-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml?query=branch%3Amaster +[coverage-image]: https://img.shields.io/codecov/c/gh/jshttp/content-type +[coverage-url]: https://codecov.io/gh/jshttp/content-type +[license-image]: http://img.shields.io/npm/l/content-type.svg?style=flat +[license-url]: LICENSE diff --git a/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.d.ts b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.d.ts new file mode 100644 index 00000000..c1534451 --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.d.ts @@ -0,0 +1,46 @@ +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ +/** + * The content type object contains a type string and optional parameters. + */ +export interface ContentType { + type: string; + index: number; + parameters: Record; +} +/** + * Format an object into a `Content-Type` header. + */ +export declare function format(obj: Partial): string; +/** + * Options for parsing a `Content-Type` header. + */ +export interface ParseOptions { + /** + * Exit early on the first semicolon, returning only the type. + * This is useful for parsing the MIME from `Content-Type` headers. + * + * @default false + */ + parameters?: boolean; + /** + * Exits early on a comma, returning the first value and parameters. + * This is useful for parsing `Accept` headers. + * + * @default false + */ + comma?: boolean; + /** + * The index to start parsing from. + * + * @default 0 + */ + start?: number; +} +/** + * Parse a `Content-Type` header. + */ +export declare function parse(header: string, options?: ParseOptions): ContentType; diff --git a/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js new file mode 100644 index 00000000..6f3a3e71 --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js @@ -0,0 +1,176 @@ +"use strict"; +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.format = format; +exports.parse = parse; +const TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/; +const TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; +/** + * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4 + */ +const QUOTE_REGEXP = /[\\"]/g; +/** + * RegExp to match type in RFC 9110 sec 8.3.1 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ +const TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; +/** + * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`. + */ +const NullObject = /* @__PURE__ */ (() => { + const C = function () { }; + C.prototype = Object.create(null); + return C; +})(); +/** + * Format an object into a `Content-Type` header. + */ +function format(obj) { + const { type, parameters } = obj; + if (!type || !TYPE_REGEXP.test(type)) { + throw new TypeError(`Invalid type: ${type}`); + } + let result = type; + if (parameters) { + for (const param of Object.keys(parameters)) { + if (!TOKEN_REGEXP.test(param)) { + throw new TypeError(`Invalid parameter name: ${param}`); + } + result += `; ${param}=${qstring(parameters[param])}`; + } + } + return result; +} +/** + * Parse a `Content-Type` header. + */ +function parse(header, options) { + const stopChar = options?.comma === true ? COMMA : 65536; // Sentinel for "no stop char". + const len = header.length; + let index = skipOWS(header, options?.start ?? 0, len); + const valueStart = index; + index = skipValue(header, index, len, stopChar); + const valueEnd = trailingOWS(header, valueStart, index); + const type = header.slice(valueStart, valueEnd).toLowerCase(); + if (options?.parameters === false) { + return { type, index, parameters: new NullObject() }; + } + return parseParameters(header, type, index, len, stopChar); +} +const SP = 32; // " " +const HTAB = 9; // "\t" +const SEMI = 59; // ";" +const EQ = 61; // "=" +const DQUOTE = 34; // '"' +const BSLASH = 92; // "\\" +const COMMA = 44; // "," +/** + * Parses the parameters of a `Content-Type` header starting at the given index. + */ +function parseParameters(header, type, index, len, stopChar) { + const parameters = new NullObject(); + parameter: while (index < len) { + if (header.charCodeAt(index) === stopChar) + break; + index = skipOWS(header, index + 1 /* Skip over ; */, len); + const keyStart = index; + while (index < len) { + const code = header.charCodeAt(index); + if (code === stopChar) + break parameter; + if (code === SEMI) + continue parameter; + if (code === EQ) { + const keyEnd = trailingOWS(header, keyStart, index); + const key = header.slice(keyStart, keyEnd).toLowerCase(); + index = skipOWS(header, index + 1, len); + if (index < len && header.charCodeAt(index) === DQUOTE) { + index++; + let value = ""; + while (index < len) { + const code = header.charCodeAt(index++); + if (code === DQUOTE) { + index = skipValue(header, index, len, stopChar); + if (parameters[key] === undefined) + parameters[key] = value; + break; + } + if (code === BSLASH && index < len) { + value += header[index++]; + continue; + } + value += String.fromCharCode(code); + } + continue parameter; + } + const valueStart = index; + index = skipValue(header, index, len, stopChar); + if (parameters[key] === undefined) { + const valueEnd = trailingOWS(header, valueStart, index); + parameters[key] = header.slice(valueStart, valueEnd); + } + continue parameter; + } + index++; + } + } + return { type, index, parameters }; +} +/** + * Skip over characters until a semicolon or other exit character. + */ +function skipValue(str, index, len, stopChar) { + while (index < len) { + const code = str.charCodeAt(index); + if (code === SEMI || code === stopChar) + break; + index++; + } + return index; +} +/** + * Skip optional whitespace (OWS) in an HTTP header value. + * + * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t"). + */ +function skipOWS(header, index, len) { + while (index < len) { + const char = header.charCodeAt(index); + if (char !== SP && char !== HTAB) + break; + index++; + } + return index; +} +/** + * Trim optional whitespace (OWS) from the end of a substring. + * + * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t"). + */ +function trailingOWS(header, start, end) { + while (end > start) { + const char = header.charCodeAt(end - 1); + if (char !== SP && char !== HTAB) + break; + end--; + } + return end; +} +/** + * Serialize a parameter value. + */ +function qstring(str) { + if (TOKEN_REGEXP.test(str)) + return str; + if (TEXT_REGEXP.test(str)) + return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`; + throw new TypeError(`Invalid parameter value: ${str}`); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js.map b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js.map new file mode 100644 index 00000000..2f89192c --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAyCH,wBAoBC;AA+BD,sBAeC;AAzGD,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAC5D,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAErD;;GAEG;AACH,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,GACf,4DAA4D,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE;IACvC,MAAM,CAAC,GAAG,cAAa,CA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,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;IAC7D,OAAO,GAAG,GAAG,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACxC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACxC,GAAG,EAAE,CAAC;IACR,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,GAAW;IAC1B,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC;IAE3E,MAAM,IAAI,SAAS,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * content-type\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nconst TEXT_REGEXP = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]*$/;\nconst TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4\n */\nconst QUOTE_REGEXP = /[\\\\\"]/g;\n\n/**\n * RegExp to match type in RFC 9110 sec 8.3.1\n *\n * media-type = type \"/\" subtype\n * type = token\n * subtype = token\n */\nconst TYPE_REGEXP =\n /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.\n */\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () {};\n C.prototype = Object.create(null);\n return C;\n})() as unknown as { new (): any };\n\n/**\n * The content type object contains a type string and optional parameters.\n */\nexport interface ContentType {\n type: string;\n index: number;\n parameters: Record;\n}\n\n/**\n * Format an object into a `Content-Type` header.\n */\nexport function format(obj: Partial): string {\n const { type, parameters } = obj;\n\n if (!type || !TYPE_REGEXP.test(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n\n let result = type;\n\n if (parameters) {\n for (const param of Object.keys(parameters)) {\n if (!TOKEN_REGEXP.test(param)) {\n throw new TypeError(`Invalid parameter name: ${param}`);\n }\n\n result += `; ${param}=${qstring(parameters[param])}`;\n }\n }\n\n return result;\n}\n\n/**\n * Options for parsing a `Content-Type` header.\n */\nexport interface ParseOptions {\n /**\n * Exit early on the first semicolon, returning only the type.\n * This is useful for parsing the MIME from `Content-Type` headers.\n *\n * @default false\n */\n parameters?: boolean;\n /**\n * Exits early on a comma, returning the first value and parameters.\n * This is useful for parsing `Accept` headers.\n *\n * @default false\n */\n comma?: boolean;\n /**\n * The index to start parsing from.\n *\n * @default 0\n */\n start?: number;\n}\n\n/**\n * Parse a `Content-Type` header.\n */\nexport function parse(header: string, options?: ParseOptions): ContentType {\n const stopChar = options?.comma === true ? COMMA : 65_536; // Sentinel for \"no stop char\".\n const len = header.length;\n let index = skipOWS(header, options?.start ?? 0, len);\n\n const valueStart = index;\n index = skipValue(header, index, len, stopChar);\n const valueEnd = trailingOWS(header, valueStart, index);\n const type = header.slice(valueStart, valueEnd).toLowerCase();\n\n if (options?.parameters === false) {\n return { type, index, parameters: new NullObject() };\n }\n\n return parseParameters(header, type, index, len, stopChar);\n}\n\nconst SP = 32; // \" \"\nconst HTAB = 9; // \"\\t\"\nconst SEMI = 59; // \";\"\nconst EQ = 61; // \"=\"\nconst DQUOTE = 34; // '\"'\nconst BSLASH = 92; // \"\\\\\"\nconst COMMA = 44; // \",\"\n\n/**\n * Parses the parameters of a `Content-Type` header starting at the given index.\n */\nfunction parseParameters(\n header: string,\n type: string,\n index: number,\n len: number,\n stopChar: number,\n): ContentType {\n const parameters: Record = new NullObject();\n\n parameter: while (index < len) {\n if (header.charCodeAt(index) === stopChar) break;\n\n index = skipOWS(header, index + 1 /* Skip over ; */, len);\n\n const keyStart = index;\n\n while (index < len) {\n const code = header.charCodeAt(index);\n if (code === stopChar) break parameter;\n\n if (code === SEMI) continue parameter;\n\n if (code === EQ) {\n const keyEnd = trailingOWS(header, keyStart, index);\n const key = header.slice(keyStart, keyEnd).toLowerCase();\n\n index = skipOWS(header, index + 1, len);\n\n if (index < len && header.charCodeAt(index) === DQUOTE) {\n index++;\n\n let value = \"\";\n while (index < len) {\n const code = header.charCodeAt(index++);\n if (code === DQUOTE) {\n index = skipValue(header, index, len, stopChar);\n if (parameters[key] === undefined) parameters[key] = value;\n break;\n }\n\n if (code === BSLASH && index < len) {\n value += header[index++];\n continue;\n }\n\n value += String.fromCharCode(code);\n }\n\n continue parameter;\n }\n\n const valueStart = index;\n index = skipValue(header, index, len, stopChar);\n\n if (parameters[key] === undefined) {\n const valueEnd = trailingOWS(header, valueStart, index);\n parameters[key] = header.slice(valueStart, valueEnd);\n }\n\n continue parameter;\n }\n\n index++;\n }\n }\n\n return { type, index, parameters };\n}\n\n/**\n * Skip over characters until a semicolon or other exit character.\n */\nfunction skipValue(\n str: string,\n index: number,\n len: number,\n stopChar: number,\n): number {\n while (index < len) {\n const code = str.charCodeAt(index);\n if (code === SEMI || code === stopChar) break;\n index++;\n }\n return index;\n}\n\n/**\n * Skip optional whitespace (OWS) in an HTTP header value.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction skipOWS(header: string, index: number, len: number): number {\n while (index < len) {\n const char = header.charCodeAt(index);\n if (char !== SP && char !== HTAB) break;\n index++;\n }\n return index;\n}\n\n/**\n * Trim optional whitespace (OWS) from the end of a substring.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction trailingOWS(header: string, start: number, end: number): number {\n while (end > start) {\n const char = header.charCodeAt(end - 1);\n if (char !== SP && char !== HTAB) break;\n end--;\n }\n return end;\n}\n\n/**\n * Serialize a parameter value.\n */\nfunction qstring(str: string): string {\n if (TOKEN_REGEXP.test(str)) return str;\n if (TEXT_REGEXP.test(str)) return `\"${str.replace(QUOTE_REGEXP, \"\\\\$&\")}\"`;\n\n throw new TypeError(`Invalid parameter value: ${str}`);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/package.json b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/package.json new file mode 100644 index 00000000..4a403eb9 --- /dev/null +++ b/backend/node_modules/.pnpm/content-type@2.1.0/node_modules/content-type/package.json @@ -0,0 +1,52 @@ +{ + "name": "content-type", + "version": "2.1.0", + "description": "Create and parse HTTP Content-Type header", + "keywords": [ + "content-type", + "http", + "req", + "res", + "rfc7231", + "rfc9110" + ], + "repository": "jshttp/content-type", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "license": "MIT", + "author": "Douglas Christopher Wilson ", + "type": "commonjs", + "exports": "./dist/index.js", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "bench": "vitest bench", + "build": "ts-scripts build", + "format": "ts-scripts format", + "prepare": "ts-scripts install && npm run build", + "specs": "ts-scripts specs", + "test": "ts-scripts test" + }, + "devDependencies": { + "@borderless/ts-scripts": "^0.15.0", + "@vitest/coverage-v8": "^3.0.5", + "typescript": "^5.7.3", + "vitest": "^3.2.4" + }, + "engines": { + "node": ">=18" + }, + "ts-scripts": { + "dist": [ + "dist" + ], + "project": [ + "tsconfig.build.json" + ] + } +} diff --git a/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/LICENSE b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/LICENSE new file mode 100644 index 00000000..fd10c843 --- /dev/null +++ b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Troy Goode + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/README.md b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/README.md new file mode 100644 index 00000000..3d206e5b --- /dev/null +++ b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/README.md @@ -0,0 +1,277 @@ +# cors + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +CORS is a [Node.js](https://nodejs.org/en/) middleware for [Express](https://expressjs.com/)/[Connect](https://github.com/senchalabs/connect) that sets [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) response headers. These headers tell browsers which origins can read responses from your server. + +> [!IMPORTANT] +> **How CORS Works:** This package sets response headers—it doesn't block requests. CORS is enforced by browsers: they check the headers and decide if JavaScript can read the response. Non-browser clients (curl, Postman, other servers) ignore CORS entirely. See the [MDN CORS guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) for details. + +* [Installation](#installation) +* [Usage](#usage) + * [Simple Usage](#simple-usage-enable-all-cors-requests) + * [Enable CORS for a Single Route](#enable-cors-for-a-single-route) + * [Configuring CORS](#configuring-cors) + * [Configuring CORS w/ Dynamic Origin](#configuring-cors-w-dynamic-origin) + * [Enabling CORS Pre-Flight](#enabling-cors-pre-flight) + * [Customizing CORS Settings Dynamically per Request](#customizing-cors-settings-dynamically-per-request) +* [Configuration Options](#configuration-options) +* [Common Misconceptions](#common-misconceptions) +* [License](#license) +* [Original Author](#original-author) + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/downloading-and-installing-packages-locally): + +```sh +$ npm install cors +``` + +## Usage + +### Simple Usage (Enable *All* CORS Requests) + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +// Adds headers: Access-Control-Allow-Origin: * +app.use(cors()) + +app.get('/products/:id', function (req, res, next) { + res.json({msg: 'Hello'}) +}) + +app.listen(80, function () { + console.log('web server listening on port 80') +}) +``` + +### Enable CORS for a Single Route + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +// Adds headers: Access-Control-Allow-Origin: * +app.get('/products/:id', cors(), function (req, res, next) { + res.json({msg: 'Hello'}) +}) + +app.listen(80, function () { + console.log('web server listening on port 80') +}) +``` + +### Configuring CORS + +See the [configuration options](#configuration-options) for details. + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var corsOptions = { + origin: 'http://example.com', + optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204 +} + +// Adds headers: Access-Control-Allow-Origin: http://example.com, Vary: Origin +app.get('/products/:id', cors(corsOptions), function (req, res, next) { + res.json({msg: 'Hello'}) +}) + +app.listen(80, function () { + console.log('web server listening on port 80') +}) +``` + +### Configuring CORS w/ Dynamic Origin + +This module supports validating the origin dynamically using a function provided +to the `origin` option. This function will be passed a string that is the origin +(or `undefined` if the request has no origin), and a `callback` with the signature +`callback(error, origin)`. + +The `origin` argument to the callback can be any value allowed for the `origin` +option of the middleware, except a function. See the +[configuration options](#configuration-options) section for more information on all +the possible value types. + +This function is designed to allow the dynamic loading of allowed origin(s) from +a backing datasource, like a database. + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +var corsOptions = { + origin: function (origin, callback) { + // db.loadOrigins is an example call to load + // a list of origins from a backing database + db.loadOrigins(function (error, origins) { + callback(error, origins) + }) + } +} + +// Adds headers: Access-Control-Allow-Origin: , Vary: Origin +app.get('/products/:id', cors(corsOptions), function (req, res, next) { + res.json({msg: 'Hello'}) +}) + +app.listen(80, function () { + console.log('web server listening on port 80') +}) +``` + +### Enabling CORS Pre-Flight + +Certain CORS requests are considered 'complex' and require an initial +`OPTIONS` request (called the "pre-flight request"). An example of a +'complex' CORS request is one that uses an HTTP verb other than +GET/HEAD/POST (such as DELETE) or that uses custom headers. To enable +pre-flighting, you must add a new OPTIONS handler for the route you want +to support: + +```javascript +var express = require('express') +var cors = require('cors') +var app = express() + +app.options('/products/:id', cors()) // preflight for DELETE +app.del('/products/:id', cors(), function (req, res, next) { + res.json({msg: 'Hello'}) +}) + +app.listen(80, function () { + console.log('web server listening on port 80') +}) +``` + +You can also enable pre-flight across-the-board like so: + +```javascript +app.options('*', cors()) // include before other routes +``` + +NOTE: When using this middleware as an application level middleware (for +example, `app.use(cors())`), pre-flight requests are already handled for all +routes. + +### Customizing CORS Settings Dynamically per Request + +For APIs that require different CORS configurations for specific routes or requests, you can dynamically generate CORS options based on the incoming request. The `cors` middleware allows you to achieve this by passing a function instead of static options. This function is called for each incoming request and must use the callback pattern to return the appropriate CORS options. + +The function accepts: +1. **`req`**: + - The incoming request object. + +2. **`callback(error, corsOptions)`**: + - A function used to return the computed CORS options. + - **Arguments**: + - **`error`**: Pass `null` if there’s no error, or an error object to indicate a failure. + - **`corsOptions`**: An object specifying the CORS policy for the current request. + +Here’s an example that handles both public routes and restricted, credential-sensitive routes: + +```javascript +var dynamicCorsOptions = function(req, callback) { + var corsOptions; + if (req.path.startsWith('/auth/connect/')) { + // Access-Control-Allow-Origin: http://mydomain.com, Access-Control-Allow-Credentials: true, Vary: Origin + corsOptions = { + origin: 'http://mydomain.com', + credentials: true + }; + } else { + // Access-Control-Allow-Origin: * + corsOptions = { origin: '*' }; + } + callback(null, corsOptions); +}; + +app.use(cors(dynamicCorsOptions)); + +app.get('/auth/connect/twitter', function (req, res) { + res.send('Hello'); +}); + +app.get('/public', function (req, res) { + res.send('Hello'); +}); + +app.listen(80, function () { + console.log('web server listening on port 80') +}) +``` + +## Configuration Options + +* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values: + - `Boolean` - set `origin` to `true` to reflect the [request origin](https://datatracker.ietf.org/doc/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS. + - `String` - set `origin` to a specific origin. For example, if you set it to + - `"http://example.com"` only requests from "http://example.com" will be allowed. + - `"*"` for all domains to be allowed. + - `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com". + - `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com". + - `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (called as `callback(err, origin)`, where `origin` is a non-function value of the `origin` option) as the second. +* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: `['GET', 'PUT', 'POST']`). +* `allowedHeaders`: Configures the **Access-Control-Allow-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Type,Authorization') or an array (ex: `['Content-Type', 'Authorization']`). If not specified, defaults to reflecting the headers specified in the request's **Access-Control-Request-Headers** header. +* `exposedHeaders`: Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') or an array (ex: `['Content-Range', 'X-Content-Range']`). If not specified, no custom headers are exposed. +* `credentials`: Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted. +* `maxAge`: Configures the **Access-Control-Max-Age** CORS header. Set to an integer to pass the header, otherwise it is omitted. +* `preflightContinue`: Pass the CORS preflight response to the next handler. +* `optionsSuccessStatus`: Provides a status code to use for successful `OPTIONS` requests, since some legacy browsers (IE11, various SmartTVs) choke on `204`. + +The default configuration is the equivalent of: + +```json +{ + "origin": "*", + "methods": "GET,HEAD,PUT,PATCH,POST,DELETE", + "preflightContinue": false, + "optionsSuccessStatus": 204 +} +``` + +## Common Misconceptions + +### "CORS blocks requests from disallowed origins" + +**No.** Your server receives and processes every request. CORS headers tell the browser whether JavaScript can read the response—not whether the request is allowed. + +### "CORS protects my API from unauthorized access" + +**No.** CORS is not access control. Any HTTP client (curl, Postman, another server) can call your API regardless of CORS settings. Use authentication and authorization to protect your API. + +### "Setting `origin: 'http://example.com'` means only that domain can access my server" + +**No.** It means browsers will only let JavaScript from that origin read responses. The server still responds to all requests. + +## License + +[MIT License](http://www.opensource.org/licenses/mit-license.php) + +## Original Author + +[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) + +[coveralls-image]: https://img.shields.io/coveralls/expressjs/cors/master.svg +[coveralls-url]: https://coveralls.io/r/expressjs/cors?branch=master +[downloads-image]: https://img.shields.io/npm/dm/cors.svg +[downloads-url]: https://npmjs.com/package/cors +[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/cors/ci.yml?branch=master&label=ci +[github-actions-ci-url]: https://github.com/expressjs/cors?query=workflow%3Aci +[npm-image]: https://img.shields.io/npm/v/cors.svg +[npm-url]: https://npmjs.com/package/cors diff --git a/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js new file mode 100644 index 00000000..ad899cae --- /dev/null +++ b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js @@ -0,0 +1,238 @@ +(function () { + + 'use strict'; + + var assign = require('object-assign'); + var vary = require('vary'); + + var defaults = { + origin: '*', + methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', + preflightContinue: false, + optionsSuccessStatus: 204 + }; + + function isString(s) { + return typeof s === 'string' || s instanceof String; + } + + function isOriginAllowed(origin, allowedOrigin) { + if (Array.isArray(allowedOrigin)) { + for (var i = 0; i < allowedOrigin.length; ++i) { + if (isOriginAllowed(origin, allowedOrigin[i])) { + return true; + } + } + return false; + } else if (isString(allowedOrigin)) { + return origin === allowedOrigin; + } else if (allowedOrigin instanceof RegExp) { + return allowedOrigin.test(origin); + } else { + return !!allowedOrigin; + } + } + + function configureOrigin(options, req) { + var requestOrigin = req.headers.origin, + headers = [], + isAllowed; + + if (!options.origin || options.origin === '*') { + // allow any origin + headers.push([{ + key: 'Access-Control-Allow-Origin', + value: '*' + }]); + } else if (isString(options.origin)) { + // fixed origin + headers.push([{ + key: 'Access-Control-Allow-Origin', + value: options.origin + }]); + headers.push([{ + key: 'Vary', + value: 'Origin' + }]); + } else { + isAllowed = isOriginAllowed(requestOrigin, options.origin); + // reflect origin + headers.push([{ + key: 'Access-Control-Allow-Origin', + value: isAllowed ? requestOrigin : false + }]); + headers.push([{ + key: 'Vary', + value: 'Origin' + }]); + } + + return headers; + } + + function configureMethods(options) { + var methods = options.methods; + if (methods.join) { + methods = options.methods.join(','); // .methods is an array, so turn it into a string + } + return { + key: 'Access-Control-Allow-Methods', + value: methods + }; + } + + function configureCredentials(options) { + if (options.credentials === true) { + return { + key: 'Access-Control-Allow-Credentials', + value: 'true' + }; + } + return null; + } + + function configureAllowedHeaders(options, req) { + var allowedHeaders = options.allowedHeaders || options.headers; + var headers = []; + + if (!allowedHeaders) { + allowedHeaders = req.headers['access-control-request-headers']; // .headers wasn't specified, so reflect the request headers + headers.push([{ + key: 'Vary', + value: 'Access-Control-Request-Headers' + }]); + } else if (allowedHeaders.join) { + allowedHeaders = allowedHeaders.join(','); // .headers is an array, so turn it into a string + } + if (allowedHeaders && allowedHeaders.length) { + headers.push([{ + key: 'Access-Control-Allow-Headers', + value: allowedHeaders + }]); + } + + return headers; + } + + function configureExposedHeaders(options) { + var headers = options.exposedHeaders; + if (!headers) { + return null; + } else if (headers.join) { + headers = headers.join(','); // .headers is an array, so turn it into a string + } + if (headers && headers.length) { + return { + key: 'Access-Control-Expose-Headers', + value: headers + }; + } + return null; + } + + function configureMaxAge(options) { + var maxAge = (typeof options.maxAge === 'number' || options.maxAge) && options.maxAge.toString() + if (maxAge && maxAge.length) { + return { + key: 'Access-Control-Max-Age', + value: maxAge + }; + } + return null; + } + + function applyHeaders(headers, res) { + for (var i = 0, n = headers.length; i < n; i++) { + var header = headers[i]; + if (header) { + if (Array.isArray(header)) { + applyHeaders(header, res); + } else if (header.key === 'Vary' && header.value) { + vary(res, header.value); + } else if (header.value) { + res.setHeader(header.key, header.value); + } + } + } + } + + function cors(options, req, res, next) { + var headers = [], + method = req.method && req.method.toUpperCase && req.method.toUpperCase(); + + if (method === 'OPTIONS') { + // preflight + headers.push(configureOrigin(options, req)); + headers.push(configureCredentials(options)) + headers.push(configureMethods(options)) + headers.push(configureAllowedHeaders(options, req)); + headers.push(configureMaxAge(options)) + headers.push(configureExposedHeaders(options)) + applyHeaders(headers, res); + + if (options.preflightContinue) { + next(); + } else { + // Safari (and potentially other browsers) need content-length 0, + // for 204 or they just hang waiting for a body + res.statusCode = options.optionsSuccessStatus; + res.setHeader('Content-Length', '0'); + res.end(); + } + } else { + // actual response + headers.push(configureOrigin(options, req)); + headers.push(configureCredentials(options)) + headers.push(configureExposedHeaders(options)) + applyHeaders(headers, res); + next(); + } + } + + function middlewareWrapper(o) { + // if options are static (either via defaults or custom options passed in), wrap in a function + var optionsCallback = null; + if (typeof o === 'function') { + optionsCallback = o; + } else { + optionsCallback = function (req, cb) { + cb(null, o); + }; + } + + return function corsMiddleware(req, res, next) { + optionsCallback(req, function (err, options) { + if (err) { + next(err); + } else { + var corsOptions = assign({}, defaults, options); + var originCallback = null; + if (corsOptions.origin && typeof corsOptions.origin === 'function') { + originCallback = corsOptions.origin; + } else if (corsOptions.origin) { + originCallback = function (origin, cb) { + cb(null, corsOptions.origin); + }; + } + + if (originCallback) { + originCallback(req.headers.origin, function (err2, origin) { + if (err2 || !origin) { + next(err2); + } else { + corsOptions.origin = origin; + cors(corsOptions, req, res, next); + } + }); + } else { + next(); + } + } + }); + }; + } + + // can pass either an options hash, an options delegate, or nothing + module.exports = middlewareWrapper; + +}()); diff --git a/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/package.json b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/package.json new file mode 100644 index 00000000..e90bac83 --- /dev/null +++ b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/cors/package.json @@ -0,0 +1,42 @@ +{ + "name": "cors", + "description": "Node.js CORS middleware", + "version": "2.8.6", + "author": "Troy Goode (https://github.com/troygoode/)", + "license": "MIT", + "keywords": [ + "cors", + "express", + "connect", + "middleware" + ], + "repository": "expressjs/cors", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "main": "./lib/index.js", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "devDependencies": { + "after": "0.8.2", + "eslint": "7.30.0", + "express": "4.21.2", + "mocha": "9.2.2", + "nyc": "15.1.0", + "supertest": "6.1.3" + }, + "files": [ + "lib/index.js" + ], + "engines": { + "node": ">= 0.10" + }, + "scripts": { + "test": "npm run lint && npm run test-ci", + "test-ci": "nyc --reporter=lcov --reporter=text mocha --require test/support/env", + "lint": "eslint lib test" + } +} diff --git a/backend/node_modules/.pnpm/cors@2.8.6/node_modules/object-assign b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/object-assign new file mode 120000 index 00000000..762bab92 --- /dev/null +++ b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/object-assign @@ -0,0 +1 @@ +../../object-assign@4.1.1/node_modules/object-assign \ No newline at end of file diff --git a/backend/node_modules/.pnpm/cors@2.8.6/node_modules/vary b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/vary new file mode 120000 index 00000000..1d9ff5c1 --- /dev/null +++ b/backend/node_modules/.pnpm/cors@2.8.6/node_modules/vary @@ -0,0 +1 @@ +../../vary@1.1.2/node_modules/vary \ No newline at end of file diff --git a/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/index.js b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/index.js new file mode 100644 index 00000000..5494e9b4 --- /dev/null +++ b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/index.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inspect = void 0; +// Taken from graphql-js +// https://github.com/graphql/graphql-js/blob/main/src/jsutils/inspect.ts +const MAX_RECURSIVE_DEPTH = 3; +/** + * Used to print values in error messages. + */ +function inspect(value) { + return formatValue(value, []); +} +exports.inspect = inspect; +function formatValue(value, seenValues) { + switch (typeof value) { + case 'string': + return JSON.stringify(value); + case 'function': + return value.name ? `[function ${value.name}]` : '[function]'; + case 'object': + return formatObjectValue(value, seenValues); + default: + return String(value); + } +} +function formatError(value) { + // eslint-disable-next-line no-constant-condition + if ((value.name = 'GraphQLError')) { + return value.toString(); + } + return `${value.name}: ${value.message};\n ${value.stack}`; +} +function formatObjectValue(value, previouslySeenValues) { + if (value === null) { + return 'null'; + } + if (value instanceof Error) { + if (value.name === 'AggregateError') { + return (formatError(value) + + '\n' + + formatArray(value.errors, previouslySeenValues)); + } + return formatError(value); + } + if (previouslySeenValues.includes(value)) { + return '[Circular]'; + } + const seenValues = [...previouslySeenValues, value]; + if (isJSONable(value)) { + const jsonValue = value.toJSON(); + // check for infinite recursion + if (jsonValue !== value) { + return typeof jsonValue === 'string' ? jsonValue : formatValue(jsonValue, seenValues); + } + } + else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + return formatObject(value, seenValues); +} +function isJSONable(value) { + return typeof value.toJSON === 'function'; +} +function formatObject(object, seenValues) { + const entries = Object.entries(object); + if (entries.length === 0) { + return '{}'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + const properties = entries.map(([key, value]) => key + ': ' + formatValue(value, seenValues)); + return '{ ' + properties.join(', ') + ' }'; +} +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + const len = array.length; + const items = []; + for (let i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + return '[' + items.join(', ') + ']'; +} +function getObjectTag(object) { + const tag = Object.prototype.toString + .call(object) + .replace(/^\[object /, '') + .replace(/]$/, ''); + if (tag === 'Object' && typeof object.constructor === 'function') { + const name = object.constructor.name; + if (typeof name === 'string' && name !== '') { + return name; + } + } + return tag; +} diff --git a/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/package.json b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/package.json new file mode 100644 index 00000000..0292b995 --- /dev/null +++ b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/esm/index.js b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/esm/index.js new file mode 100644 index 00000000..54d16c3e --- /dev/null +++ b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/esm/index.js @@ -0,0 +1,97 @@ +// Taken from graphql-js +// https://github.com/graphql/graphql-js/blob/main/src/jsutils/inspect.ts +const MAX_RECURSIVE_DEPTH = 3; +/** + * Used to print values in error messages. + */ +export function inspect(value) { + return formatValue(value, []); +} +function formatValue(value, seenValues) { + switch (typeof value) { + case 'string': + return JSON.stringify(value); + case 'function': + return value.name ? `[function ${value.name}]` : '[function]'; + case 'object': + return formatObjectValue(value, seenValues); + default: + return String(value); + } +} +function formatError(value) { + // eslint-disable-next-line no-constant-condition + if ((value.name = 'GraphQLError')) { + return value.toString(); + } + return `${value.name}: ${value.message};\n ${value.stack}`; +} +function formatObjectValue(value, previouslySeenValues) { + if (value === null) { + return 'null'; + } + if (value instanceof Error) { + if (value.name === 'AggregateError') { + return (formatError(value) + + '\n' + + formatArray(value.errors, previouslySeenValues)); + } + return formatError(value); + } + if (previouslySeenValues.includes(value)) { + return '[Circular]'; + } + const seenValues = [...previouslySeenValues, value]; + if (isJSONable(value)) { + const jsonValue = value.toJSON(); + // check for infinite recursion + if (jsonValue !== value) { + return typeof jsonValue === 'string' ? jsonValue : formatValue(jsonValue, seenValues); + } + } + else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + return formatObject(value, seenValues); +} +function isJSONable(value) { + return typeof value.toJSON === 'function'; +} +function formatObject(object, seenValues) { + const entries = Object.entries(object); + if (entries.length === 0) { + return '{}'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + const properties = entries.map(([key, value]) => key + ': ' + formatValue(value, seenValues)); + return '{ ' + properties.join(', ') + ' }'; +} +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + const len = array.length; + const items = []; + for (let i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + return '[' + items.join(', ') + ']'; +} +function getObjectTag(object) { + const tag = Object.prototype.toString + .call(object) + .replace(/^\[object /, '') + .replace(/]$/, ''); + if (tag === 'Object' && typeof object.constructor === 'function') { + const name = object.constructor.name; + if (typeof name === 'string' && name !== '') { + return name; + } + } + return tag; +} diff --git a/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/package.json b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/package.json new file mode 100644 index 00000000..f206584d --- /dev/null +++ b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/package.json @@ -0,0 +1,43 @@ +{ + "name": "cross-inspect", + "version": "1.0.1", + "description": "Cross platform implementation of Node's util.inspect", + "sideEffects": false, + "dependencies": { + "tslib": "^2.4.0" + }, + "repository": { + "type": "git", + "url": "ardatan/graphql-tools", + "directory": "packages/inspect" + }, + "author": "Arda TANRIKULU ", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + }, + "main": "cjs/index.js", + "module": "esm/index.js", + "typings": "typings/index.d.ts", + "typescript": { + "definition": "typings/index.d.ts" + }, + "type": "module", + "exports": { + ".": { + "require": { + "types": "./typings/index.d.cts", + "default": "./cjs/index.js" + }, + "import": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + }, + "default": { + "types": "./typings/index.d.ts", + "default": "./esm/index.js" + } + }, + "./package.json": "./package.json" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.cts b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.cts new file mode 100644 index 00000000..b6e0815a --- /dev/null +++ b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.cts @@ -0,0 +1,4 @@ +/** + * Used to print values in error messages. + */ +export declare function inspect(value: unknown): string; diff --git a/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.ts b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.ts new file mode 100644 index 00000000..b6e0815a --- /dev/null +++ b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/cross-inspect/typings/index.d.ts @@ -0,0 +1,4 @@ +/** + * Used to print values in error messages. + */ +export declare function inspect(value: unknown): string; diff --git a/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/tslib b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/tslib new file mode 120000 index 00000000..4edba0e2 --- /dev/null +++ b/backend/node_modules/.pnpm/cross-inspect@1.0.1/node_modules/tslib @@ -0,0 +1 @@ +../../tslib@2.8.1/node_modules/tslib \ No newline at end of file diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/LICENSE b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/LICENSE new file mode 100644 index 00000000..1a9820e2 --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/README.md b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/README.md new file mode 100644 index 00000000..9ebdfbf1 --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/README.md @@ -0,0 +1,481 @@ +# debug +[![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. + + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +`disable()` + +Will disable all namespaces. The functions returns the namespaces currently +enabled (and skipped). This can be useful if you want to disable debugging +temporarily without knowing what was enabled to begin with. + +For example: + +```js +let debug = require('debug'); +debug.enable('foo:*,-foo:bar'); +let namespaces = debug.disable(); +debug.enable(namespaces); +``` + +Note: There is no guarantee that the string will be identical to the initial +enable string, but semantically they will be identical. + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + +## Usage in child processes + +Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. +For example: + +```javascript +worker = fork(WORKER_WRAP_PATH, [workerPath], { + stdio: [ + /* stdin: */ 0, + /* stdout: */ 'pipe', + /* stderr: */ 'pipe', + 'ipc', + ], + env: Object.assign({}, process.env, { + DEBUG_COLORS: 1 // without this settings, colors won't be shown + }), +}); + +worker.stderr.pipe(process.stderr, { end: false }); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + - Josh Junon + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/package.json b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/package.json new file mode 100644 index 00000000..ee8abb52 --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/package.json @@ -0,0 +1,64 @@ +{ + "name": "debug", + "version": "4.4.3", + "repository": { + "type": "git", + "url": "git://github.com/debug-js/debug.git" + }, + "description": "Lightweight debugging utility for Node.js and the browser", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "Josh Junon (https://github.com/qix-)", + "contributors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "mocha test.js test.node.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "^2.1.3" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "sinon": "^14.0.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + }, + "xo": { + "rules": { + "import/extensions": "off" + } + } +} diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js new file mode 100644 index 00000000..5993451b --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js @@ -0,0 +1,272 @@ +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + let m; + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js new file mode 100644 index 00000000..141cb578 --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js @@ -0,0 +1,292 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(/\s+/g, ',') + .split(',') + .filter(Boolean); + + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; // No match + } + } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } + + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js new file mode 100644 index 00000000..bf4c57f2 --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js new file mode 100644 index 00000000..715560a4 --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js @@ -0,0 +1,263 @@ +/** + * Module dependencies. + */ + +const tty = require('tty'); +const util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + */ + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; + +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; diff --git a/backend/node_modules/.pnpm/debug@4.4.3/node_modules/ms b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/ms new file mode 120000 index 00000000..e1d50296 --- /dev/null +++ b/backend/node_modules/.pnpm/debug@4.4.3/node_modules/ms @@ -0,0 +1 @@ +../../ms@2.1.3/node_modules/ms \ No newline at end of file diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.eslintrc b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.eslintrc new file mode 100644 index 00000000..75443e81 --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.eslintrc @@ -0,0 +1,24 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": 0, + "id-length": 0, + "new-cap": ["error", { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "max-lines-per-function": "off", + }, + }, + ], +} diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.github/FUNDING.yml b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.github/FUNDING.yml new file mode 100644 index 00000000..3e17725d --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/define-data-property +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.nycrc b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/CHANGELOG.md b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/CHANGELOG.md new file mode 100644 index 00000000..4eed75ea --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/CHANGELOG.md @@ -0,0 +1,70 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.4](https://github.com/ljharb/define-data-property/compare/v1.1.3...v1.1.4) - 2024-02-13 + +### Commits + +- [Refactor] use `es-define-property` [`90f2f4c`](https://github.com/ljharb/define-data-property/commit/90f2f4cc20298401e71c28e1e08888db12021453) +- [Dev Deps] update `@types/object.getownpropertydescriptors` [`cd929d9`](https://github.com/ljharb/define-data-property/commit/cd929d9a04f5f2fdcfa9d5be140940b91a083153) + +## [v1.1.3](https://github.com/ljharb/define-data-property/compare/v1.1.2...v1.1.3) - 2024-02-12 + +### Commits + +- [types] hand-write d.ts instead of emitting it [`0cbc988`](https://github.com/ljharb/define-data-property/commit/0cbc988203c105f2d97948327c7167ebd33bd318) +- [meta] simplify `exports` [`690781e`](https://github.com/ljharb/define-data-property/commit/690781eed28bbf2d6766237efda0ba6dd591609e) +- [Dev Deps] update `hasown`; clean up DT packages [`6cdfd1c`](https://github.com/ljharb/define-data-property/commit/6cdfd1cb2d91d791bfd18cda5d5cab232fd5d8fc) +- [actions] cleanup [`3142bc6`](https://github.com/ljharb/define-data-property/commit/3142bc6a4bc406a51f5b04f31e98562a27f35ffd) +- [meta] add `funding` [`8474423`](https://github.com/ljharb/define-data-property/commit/847442391a79779af3e0f1bf0b5bb923552b7804) +- [Deps] update `get-intrinsic` [`3e9be00`](https://github.com/ljharb/define-data-property/commit/3e9be00e07784ba34e7c77d8bc0fdbc832ad61de) + +## [v1.1.2](https://github.com/ljharb/define-data-property/compare/v1.1.1...v1.1.2) - 2024-02-05 + +### Commits + +- [Dev Deps] update @types packages, `object-inspect`, `tape`, `typescript` [`df41bf8`](https://github.com/ljharb/define-data-property/commit/df41bf84ca3456be6226055caab44e38e3a7fd2f) +- [Dev Deps] update DT packages, `aud`, `npmignore`, `tape`, typescript` [`fab0e4e`](https://github.com/ljharb/define-data-property/commit/fab0e4ec709ee02b79f42d6db3ee5f26e0a34b8a) +- [Dev Deps] use `hasown` instead of `has` [`aa51ef9`](https://github.com/ljharb/define-data-property/commit/aa51ef93f6403d49d9bb72a807bcdb6e418978c0) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`d89be50`](https://github.com/ljharb/define-data-property/commit/d89be50571175888d391238605122679f7e65ffc) +- [Deps] update `has-property-descriptors` [`7af887c`](https://github.com/ljharb/define-data-property/commit/7af887c9083b59b195b0079e04815cfed9fcee2b) +- [Deps] update `get-intrinsic` [`bb8728e`](https://github.com/ljharb/define-data-property/commit/bb8728ec42cd998505a7157ae24853a560c20646) + +## [v1.1.1](https://github.com/ljharb/define-data-property/compare/v1.1.0...v1.1.1) - 2023-10-12 + +### Commits + +- [Tests] fix tests in ES3 engines [`5c6920e`](https://github.com/ljharb/define-data-property/commit/5c6920edd1f52f675b02f417e539c28135b43f94) +- [Dev Deps] update `@types/es-value-fixtures`, `@types/for-each`, `@types/gopd`, `@types/has-property-descriptors`, `tape`, `typescript` [`7d82dfc`](https://github.com/ljharb/define-data-property/commit/7d82dfc20f778b4465bba06335dd53f6f431aea3) +- [Fix] IE 8 has a broken `Object.defineProperty` [`0672e1a`](https://github.com/ljharb/define-data-property/commit/0672e1af2a9fcc787e7c23b96dea60d290df5548) +- [meta] emit types on prepack [`73acb1f`](https://github.com/ljharb/define-data-property/commit/73acb1f903c21b314ec7156bf10f73c7910530c0) +- [Dev Deps] update `tape`, `typescript` [`9489a77`](https://github.com/ljharb/define-data-property/commit/9489a7738bf2ecf0ac71d5b78ec4ca6ad7ba0142) + +## [v1.1.0](https://github.com/ljharb/define-data-property/compare/v1.0.1...v1.1.0) - 2023-09-13 + +### Commits + +- [New] add `loose` arg [`155235a`](https://github.com/ljharb/define-data-property/commit/155235a4c4d7741f6de01cd87c99599a56654b72) +- [New] allow `null` to be passed for the non* args [`7d2fa5f`](https://github.com/ljharb/define-data-property/commit/7d2fa5f06be0392736c13b126f7cd38979f34792) + +## [v1.0.1](https://github.com/ljharb/define-data-property/compare/v1.0.0...v1.0.1) - 2023-09-12 + +### Commits + +- [meta] add TS types [`43d763c`](https://github.com/ljharb/define-data-property/commit/43d763c6c883f652de1c9c02ef6216ee507ffa69) +- [Dev Deps] update `@types/tape`, `typescript` [`f444985`](https://github.com/ljharb/define-data-property/commit/f444985811c36f3e6448a03ad2f9b7898917f4c7) +- [meta] add `safe-publish-latest`, [`172bb10`](https://github.com/ljharb/define-data-property/commit/172bb10890896ebb160e64398f6ee55760107bee) + +## v1.0.0 - 2023-09-12 + +### Commits + +- Initial implementation, tests, readme [`5b43d6b`](https://github.com/ljharb/define-data-property/commit/5b43d6b44e675a904810467a7d4e0adb7efc3196) +- Initial commit [`35e577a`](https://github.com/ljharb/define-data-property/commit/35e577a6ba59a98befa97776d70d90f3bea9009d) +- npm init [`82a0a04`](https://github.com/ljharb/define-data-property/commit/82a0a04a321ca7de220af02d41e2745e8a9962ed) +- Only apps should have lockfiles [`96df244`](https://github.com/ljharb/define-data-property/commit/96df244a3c6f426f9a2437be825d1c6f5dd7158e) +- [meta] use `npmignore` to autogenerate an npmignore file [`a87ff18`](https://github.com/ljharb/define-data-property/commit/a87ff18cb79e14c2eb5720486c4759fd9a189375) diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/LICENSE b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/LICENSE new file mode 100644 index 00000000..b4213ac6 --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/README.md b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/README.md new file mode 100644 index 00000000..f2304dae --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/README.md @@ -0,0 +1,67 @@ +# define-data-property [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Define a data property on an object. Will fall back to assignment in an engine without descriptors. + +The three `non*` argument can also be passed `null`, which will use the existing state if available. + +The `loose` argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment. + +## Usage + +```javascript +var defineDataProperty = require('define-data-property'); +var assert = require('assert'); + +var obj = {}; +defineDataProperty(obj, 'key', 'value'); +defineDataProperty( + obj, + 'key2', + 'value', + true, // nonEnumerable, optional + false, // nonWritable, optional + true, // nonConfigurable, optional + false // loose, optional +); + +assert.deepEqual( + Object.getOwnPropertyDescriptors(obj), + { + key: { + configurable: true, + enumerable: true, + value: 'value', + writable: true, + }, + key2: { + configurable: false, + enumerable: false, + value: 'value', + writable: true, + }, + } +); +``` + +[package-url]: https://npmjs.org/package/define-data-property +[npm-version-svg]: https://versionbadg.es/ljharb/define-data-property.svg +[deps-svg]: https://david-dm.org/ljharb/define-data-property.svg +[deps-url]: https://david-dm.org/ljharb/define-data-property +[dev-deps-svg]: https://david-dm.org/ljharb/define-data-property/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/define-data-property#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/define-data-property.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/define-data-property.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/define-data-property.svg +[downloads-url]: https://npm-stat.com/charts.html?package=define-data-property +[codecov-image]: https://codecov.io/gh/ljharb/define-data-property/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/define-data-property/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-data-property +[actions-url]: https://github.com/ljharb/define-data-property/actions diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.d.ts b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.d.ts new file mode 100644 index 00000000..b56a77da --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.d.ts @@ -0,0 +1,12 @@ + +declare function defineDataProperty( + obj: Record, + property: keyof typeof obj, + value: typeof obj[typeof property], + nonEnumerable?: boolean | null, + nonWritable?: boolean | null, + nonConfigurable?: boolean | null, + loose?: boolean +): void; + +export = defineDataProperty; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js new file mode 100644 index 00000000..e1a38c07 --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js @@ -0,0 +1,56 @@ +'use strict'; + +var $defineProperty = require('es-define-property'); + +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); + +var gopd = require('gopd'); + +/** @type {import('.')} */ +module.exports = function defineDataProperty( + obj, + property, + value +) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new $TypeError('`obj` must be an object or a function`'); + } + if (typeof property !== 'string' && typeof property !== 'symbol') { + throw new $TypeError('`property` must be a string or a symbol`'); + } + if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { + throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); + } + if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { + throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); + } + if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { + throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); + } + if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { + throw new $TypeError('`loose`, if provided, must be a boolean'); + } + + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + + /* @type {false | TypedPropertyDescriptor} */ + var desc = !!gopd && gopd(obj, property); + + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value: value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { + // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable + obj[property] = value; // eslint-disable-line no-param-reassign + } else { + throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); + } +}; diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/package.json b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/package.json new file mode 100644 index 00000000..eec40971 --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/package.json @@ -0,0 +1,106 @@ +{ + "name": "define-data-property", + "version": "1.1.4", + "description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.", + "main": "index.js", + "types": "./index.d.ts", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "tsc": "tsc -p .", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "npm run tsc", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/define-data-property.git" + }, + "keywords": [ + "define", + "data", + "property", + "object", + "accessor", + "javascript", + "ecmascript", + "enumerable", + "configurable", + "writable" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/define-data-property/issues" + }, + "homepage": "https://github.com/ljharb/define-data-property#readme", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/call-bind": "^1.0.5", + "@types/define-properties": "^1.1.5", + "@types/es-value-fixtures": "^1.4.4", + "@types/for-each": "^0.3.3", + "@types/get-intrinsic": "^1.2.2", + "@types/gopd": "^1.0.3", + "@types/has-property-descriptors": "^1.0.3", + "@types/object-inspect": "^1.8.4", + "@types/object.getownpropertydescriptors": "^2.1.4", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "hasown": "^2.0.1", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "object.getownpropertydescriptors": "^2.1.7", + "reflect.ownkeys": "^1.1.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "types/reflect.ownkeys" + ] + } +} diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/test/index.js b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/test/index.js new file mode 100644 index 00000000..68204c66 --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/test/index.js @@ -0,0 +1,392 @@ +'use strict'; + +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var hasOwn = require('hasown'); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var getOwnPropertyDescriptors = require('object.getownpropertydescriptors'); +var ownKeys = require('reflect.ownkeys'); + +var defineDataProperty = require('../'); + +test('defineDataProperty', function (t) { + t.test('argument validation', function (st) { + forEach(v.primitives, function (nonObject) { + st['throws']( + // @ts-expect-error + function () { defineDataProperty(nonObject, 'key', 'value'); }, + TypeError, + 'throws on non-object input: ' + inspect(nonObject) + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, nonPropertyKey, 'value'); }, + TypeError, + 'throws on non-PropertyKey input: ' + inspect(nonPropertyKey) + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + if (nonBoolean !== null) { + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, 'key', 'value', nonBoolean); }, + TypeError, + 'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean) + ); + + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); }, + TypeError, + 'throws on non-boolean nonWritable: ' + inspect(nonBoolean) + ); + + st['throws']( + // @ts-expect-error + function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); }, + TypeError, + 'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean) + ); + } + }); + + st.end(); + }); + + t.test('normal data property', function (st) { + /** @type {Record} */ + var obj = { existing: 'existing property' }; + st.ok(hasOwn(obj, 'existing'), 'has initial own property'); + st.equal(obj.existing, 'existing property', 'has expected initial value'); + + var res = defineDataProperty(obj, 'added', 'added property'); + st.equal(res, void undefined, 'returns `undefined`'); + st.ok(hasOwn(obj, 'added'), 'has expected own property'); + st.equal(obj.added, 'added property', 'has expected value'); + + defineDataProperty(obj, 'existing', 'new value'); + st.ok(hasOwn(obj, 'existing'), 'still has expected own property'); + st.equal(obj.existing, 'new value', 'has new expected value'); + + defineDataProperty(obj, 'explicit1', 'new value', false); + st.ok(hasOwn(obj, 'explicit1'), 'has expected own property (explicit enumerable)'); + st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)'); + + defineDataProperty(obj, 'explicit2', 'new value', false, false); + st.ok(hasOwn(obj, 'explicit2'), 'has expected own property (explicit writable)'); + st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)'); + + defineDataProperty(obj, 'explicit3', 'new value', false, false, false); + st.ok(hasOwn(obj, 'explicit3'), 'has expected own property (explicit configurable)'); + st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)'); + + st.end(); + }); + + t.test('loose mode', { skip: !hasPropertyDescriptors }, function (st) { + var obj = { existing: 'existing property' }; + + defineDataProperty(obj, 'added', 'added value 1', true, null, null, true); + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + added: { + configurable: true, + enumerable: !hasPropertyDescriptors, + value: 'added value 1', + writable: true + } + }, + 'in loose mode, obj still adds property 1' + ); + + defineDataProperty(obj, 'added', 'added value 2', false, true, null, true); + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + added: { + configurable: true, + enumerable: true, + value: 'added value 2', + writable: !hasPropertyDescriptors + } + }, + 'in loose mode, obj still adds property 2' + ); + + defineDataProperty(obj, 'added', 'added value 3', false, false, true, true); + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + added: { + configurable: !hasPropertyDescriptors, + enumerable: true, + value: 'added value 3', + writable: true + } + }, + 'in loose mode, obj still adds property 3' + ); + + st.end(); + }); + + t.test('non-normal data property, ES3', { skip: hasPropertyDescriptors }, function (st) { + /** @type {Record} */ + var obj = { existing: 'existing property' }; + + st['throws']( + function () { defineDataProperty(obj, 'added', 'added value', true); }, + SyntaxError, + 'nonEnumerable throws a Syntax Error' + ); + + st['throws']( + function () { defineDataProperty(obj, 'added', 'added value', false, true); }, + SyntaxError, + 'nonWritable throws a Syntax Error' + ); + + st['throws']( + function () { defineDataProperty(obj, 'added', 'added value', false, false, true); }, + SyntaxError, + 'nonWritable throws a Syntax Error' + ); + + st.deepEqual( + ownKeys(obj), + ['existing'], + 'obj still has expected keys' + ); + st.equal(obj.existing, 'existing property', 'obj still has expected values'); + + st.end(); + }); + + t.test('new non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + /** @type {Record} */ + var obj = { existing: 'existing property' }; + + defineDataProperty(obj, 'nonEnum', null, true); + defineDataProperty(obj, 'nonWrit', null, false, true); + defineDataProperty(obj, 'nonConf', null, false, false, true); + + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + existing: { + configurable: true, + enumerable: true, + value: 'existing property', + writable: true + }, + nonEnum: { + configurable: true, + enumerable: false, + value: null, + writable: true + }, + nonWrit: { + configurable: true, + enumerable: true, + value: null, + writable: false + }, + nonConf: { + configurable: false, + enumerable: true, + value: null, + writable: true + } + }, + 'obj has expected property descriptors' + ); + + st.end(); + }); + + t.test('existing non-normal data property, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + // test case changing an existing non-normal property + + /** @type {Record} */ + var obj = {}; + Object.defineProperty(obj, 'nonEnum', { configurable: true, enumerable: false, value: null, writable: true }); + Object.defineProperty(obj, 'nonWrit', { configurable: true, enumerable: true, value: null, writable: false }); + Object.defineProperty(obj, 'nonConf', { configurable: false, enumerable: true, value: null, writable: true }); + + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + nonEnum: { + configurable: true, + enumerable: false, + value: null, + writable: true + }, + nonWrit: { + configurable: true, + enumerable: true, + value: null, + writable: false + }, + nonConf: { + configurable: false, + enumerable: true, + value: null, + writable: true + } + }, + 'obj initially has expected property descriptors' + ); + + defineDataProperty(obj, 'nonEnum', 'new value', false); + defineDataProperty(obj, 'nonWrit', 'new value', false, false); + st['throws']( + function () { defineDataProperty(obj, 'nonConf', 'new value', false, false, false); }, + TypeError, + 'can not alter a nonconfigurable property' + ); + + st.deepEqual( + getOwnPropertyDescriptors(obj), + { + nonEnum: { + configurable: true, + enumerable: true, + value: 'new value', + writable: true + }, + nonWrit: { + configurable: true, + enumerable: true, + value: 'new value', + writable: true + }, + nonConf: { + configurable: false, + enumerable: true, + value: null, + writable: true + } + }, + 'obj ends up with expected property descriptors' + ); + + st.end(); + }); + + t.test('frozen object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + var frozen = Object.freeze({ existing: true }); + + st['throws']( + function () { defineDataProperty(frozen, 'existing', 'new value'); }, + TypeError, + 'frozen object can not modify an existing property' + ); + + st['throws']( + function () { defineDataProperty(frozen, 'new', 'new property'); }, + TypeError, + 'frozen object can not add a new property' + ); + + st.end(); + }); + + t.test('sealed object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + var sealed = Object.seal({ existing: true }); + st.deepEqual( + Object.getOwnPropertyDescriptor(sealed, 'existing'), + { + configurable: false, + enumerable: true, + value: true, + writable: true + }, + 'existing value on sealed object has expected descriptor' + ); + + defineDataProperty(sealed, 'existing', 'new value'); + + st.deepEqual( + Object.getOwnPropertyDescriptor(sealed, 'existing'), + { + configurable: false, + enumerable: true, + value: 'new value', + writable: true + }, + 'existing value on sealed object has changed descriptor' + ); + + st['throws']( + function () { defineDataProperty(sealed, 'new', 'new property'); }, + TypeError, + 'sealed object can not add a new property' + ); + + st.end(); + }); + + t.test('nonextensible object, ES5+', { skip: !hasPropertyDescriptors }, function (st) { + var nonExt = Object.preventExtensions({ existing: true }); + + st.deepEqual( + Object.getOwnPropertyDescriptor(nonExt, 'existing'), + { + configurable: true, + enumerable: true, + value: true, + writable: true + }, + 'existing value on non-extensible object has expected descriptor' + ); + + defineDataProperty(nonExt, 'existing', 'new value', true); + + st.deepEqual( + Object.getOwnPropertyDescriptor(nonExt, 'existing'), + { + configurable: true, + enumerable: false, + value: 'new value', + writable: true + }, + 'existing value on non-extensible object has changed descriptor' + ); + + st['throws']( + function () { defineDataProperty(nonExt, 'new', 'new property'); }, + TypeError, + 'non-extensible object can not add a new property' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/tsconfig.json b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/tsconfig.json new file mode 100644 index 00000000..69f060dc --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/tsconfig.json @@ -0,0 +1,59 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + + /* Completeness */ + // "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage" + ] +} diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-define-property b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-define-property new file mode 120000 index 00000000..21a4f5d0 --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-define-property @@ -0,0 +1 @@ +../../es-define-property@1.0.1/node_modules/es-define-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-errors b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/gopd b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/gopd new file mode 120000 index 00000000..3e8fbc1b --- /dev/null +++ b/backend/node_modules/.pnpm/define-data-property@1.1.4/node_modules/gopd @@ -0,0 +1 @@ +../../gopd@1.2.0/node_modules/gopd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/History.md b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/History.md new file mode 100644 index 00000000..cd9ebaaa --- /dev/null +++ b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/History.md @@ -0,0 +1,103 @@ +2.0.0 / 2018-10-26 +================== + + * Drop support for Node.js 0.6 + * Replace internal `eval` usage with `Function` constructor + * Use instance methods on `process` to check for listeners + +1.1.2 / 2018-01-11 +================== + + * perf: remove argument reassignment + * Support Node.js 0.6 to 9.x + +1.1.1 / 2017-07-27 +================== + + * Remove unnecessary `Buffer` loading + * Support Node.js 0.6 to 8.x + +1.1.0 / 2015-09-14 +================== + + * Enable strict mode in more places + * Support io.js 3.x + * Support io.js 2.x + * Support web browser loading + - Requires bundler like Browserify or webpack + +1.0.1 / 2015-04-07 +================== + + * Fix `TypeError`s when under `'use strict'` code + * Fix useless type name on auto-generated messages + * Support io.js 1.x + * Support Node.js 0.12 + +1.0.0 / 2014-09-17 +================== + + * No changes + +0.4.5 / 2014-09-09 +================== + + * Improve call speed to functions using the function wrapper + * Support Node.js 0.6 + +0.4.4 / 2014-07-27 +================== + + * Work-around v8 generating empty stack traces + +0.4.3 / 2014-07-26 +================== + + * Fix exception when global `Error.stackTraceLimit` is too low + +0.4.2 / 2014-07-19 +================== + + * Correct call site for wrapped functions and properties + +0.4.1 / 2014-07-19 +================== + + * Improve automatic message generation for function properties + +0.4.0 / 2014-07-19 +================== + + * Add `TRACE_DEPRECATION` environment variable + * Remove non-standard grey color from color output + * Support `--no-deprecation` argument + * Support `--trace-deprecation` argument + * Support `deprecate.property(fn, prop, message)` + +0.3.0 / 2014-06-16 +================== + + * Add `NO_DEPRECATION` environment variable + +0.2.0 / 2014-06-15 +================== + + * Add `deprecate.property(obj, prop, message)` + * Remove `supports-color` dependency for node.js 0.8 + +0.1.0 / 2014-06-15 +================== + + * Add `deprecate.function(fn, message)` + * Add `process.on('deprecation', fn)` emitter + * Automatically generate message when omitted from `deprecate()` + +0.0.1 / 2014-06-15 +================== + + * Fix warning for dynamic calls at singe call site + +0.0.0 / 2014-06-15 +================== + + * Initial implementation diff --git a/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/LICENSE b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/LICENSE new file mode 100644 index 00000000..248de7af --- /dev/null +++ b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2018 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/Readme.md b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/Readme.md new file mode 100644 index 00000000..043d1ca2 --- /dev/null +++ b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/Readme.md @@ -0,0 +1,280 @@ +# depd + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Linux Build][travis-image]][travis-url] +[![Windows Build][appveyor-image]][appveyor-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Deprecate all the things + +> With great modules comes great responsibility; mark things deprecated! + +## Install + +This module is installed directly using `npm`: + +```sh +$ npm install depd +``` + +This module can also be bundled with systems like +[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), +though by default this module will alter it's API to no longer display or +track deprecations. + +## API + + + +```js +var deprecate = require('depd')('my-module') +``` + +This library allows you to display deprecation messages to your users. +This library goes above and beyond with deprecation warnings by +introspection of the call stack (but only the bits that it is interested +in). + +Instead of just warning on the first invocation of a deprecated +function and never again, this module will warn on the first invocation +of a deprecated function per unique call site, making it ideal to alert +users of all deprecated uses across the code base, rather than just +whatever happens to execute first. + +The deprecation warnings from this module also include the file and line +information for the call into the module that the deprecated function was +in. + +**NOTE** this library has a similar interface to the `debug` module, and +this module uses the calling file to get the boundary for the call stacks, +so you should always create a new `deprecate` object in each file and not +within some central file. + +### depd(namespace) + +Create a new deprecate function that uses the given namespace name in the +messages and will display the call site prior to the stack entering the +file this function was called from. It is highly suggested you use the +name of your module as the namespace. + +### deprecate(message) + +Call this function from deprecated code to display a deprecation message. +This message will appear once per unique caller site. Caller site is the +first call site in the stack in a different file from the caller of this +function. + +If the message is omitted, a message is generated for you based on the site +of the `deprecate()` call and will display the name of the function called, +similar to the name displayed in a stack trace. + +### deprecate.function(fn, message) + +Call this function to wrap a given function in a deprecation message on any +call to the function. An optional message can be supplied to provide a custom +message. + +### deprecate.property(obj, prop, message) + +Call this function to wrap a given property on object in a deprecation message +on any accessing or setting of the property. An optional message can be supplied +to provide a custom message. + +The method must be called on the object where the property belongs (not +inherited from the prototype). + +If the property is a data descriptor, it will be converted to an accessor +descriptor in order to display the deprecation message. + +### process.on('deprecation', fn) + +This module will allow easy capturing of deprecation errors by emitting the +errors as the type "deprecation" on the global `process`. If there are no +listeners for this type, the errors are written to STDERR as normal, but if +there are any listeners, nothing will be written to STDERR and instead only +emitted. From there, you can write the errors in a different format or to a +logging source. + +The error represents the deprecation and is emitted only once with the same +rules as writing to STDERR. The error has the following properties: + + - `message` - This is the message given by the library + - `name` - This is always `'DeprecationError'` + - `namespace` - This is the namespace the deprecation came from + - `stack` - This is the stack of the call to the deprecated thing + +Example `error.stack` output: + +``` +DeprecationError: my-cool-module deprecated oldfunction + at Object. ([eval]-wrapper:6:22) + at Module._compile (module.js:456:26) + at evalScript (node.js:532:25) + at startup (node.js:80:7) + at node.js:902:3 +``` + +### process.env.NO_DEPRECATION + +As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` +is provided as a quick solution to silencing deprecation warnings from being +output. The format of this is similar to that of `DEBUG`: + +```sh +$ NO_DEPRECATION=my-module,othermod node app.js +``` + +This will suppress deprecations from being output for "my-module" and "othermod". +The value is a list of comma-separated namespaces. To suppress every warning +across all namespaces, use the value `*` for a namespace. + +Providing the argument `--no-deprecation` to the `node` executable will suppress +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not suppress the deperecations given to any "deprecation" +event listeners, just the output to STDERR. + +### process.env.TRACE_DEPRECATION + +As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` +is provided as a solution to getting more detailed location information in deprecation +warnings by including the entire stack trace. The format of this is the same as +`NO_DEPRECATION`: + +```sh +$ TRACE_DEPRECATION=my-module,othermod node app.js +``` + +This will include stack traces for deprecations being output for "my-module" and +"othermod". The value is a list of comma-separated namespaces. To trace every +warning across all namespaces, use the value `*` for a namespace. + +Providing the argument `--trace-deprecation` to the `node` executable will trace +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. + +## Display + +![message](files/message.png) + +When a user calls a function in your library that you mark deprecated, they +will see the following written to STDERR (in the given colors, similar colors +and layout to the `debug` module): + +``` +bright cyan bright yellow +| | reset cyan +| | | | +▼ ▼ ▼ ▼ +my-cool-module deprecated oldfunction [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ +| | | | +namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +If the user redirects their STDERR to a file or somewhere that does not support +colors, they see (similar layout to the `debug` module): + +``` +Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ ▲ +| | | | | +timestamp of message namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +## Examples + +### Deprecating all calls to a function + +This will display a deprecated message about "oldfunction" being deprecated +from "my-module" on STDERR. + +```js +var deprecate = require('depd')('my-cool-module') + +// message automatically derived from function name +// Object.oldfunction +exports.oldfunction = deprecate.function(function oldfunction () { + // all calls to function are deprecated +}) + +// specific message +exports.oldfunction = deprecate.function(function () { + // all calls to function are deprecated +}, 'oldfunction') +``` + +### Conditionally deprecating a function call + +This will display a deprecated message about "weirdfunction" being deprecated +from "my-module" on STDERR when called with less than 2 arguments. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } +} +``` + +When calling `deprecate` as a function, the warning is counted per call site +within your own module, so you can display different deprecations depending +on different situations and the users will still get all the warnings: + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } else if (typeof arguments[0] !== 'string') { + // calls with non-string first argument are deprecated + deprecate('weirdfunction non-string first arg') + } +} +``` + +### Deprecating property access + +This will display a deprecated message about "oldprop" being deprecated +from "my-module" on STDERR when accessed. A deprecation will be displayed +when setting the value and when getting the value. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.oldprop = 'something' + +// message automatically derives from property name +deprecate.property(exports, 'oldprop') + +// explicit message +deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') +``` + +## License + +[MIT](LICENSE) + +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/nodejs-depd/master?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd +[coveralls-image]: https://badgen.net/coveralls/c/github/dougwilson/nodejs-depd/master +[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master +[node-image]: https://badgen.net/npm/node/depd +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/depd +[npm-url]: https://npmjs.org/package/depd +[npm-version-image]: https://badgen.net/npm/v/depd +[travis-image]: https://badgen.net/travis/dougwilson/nodejs-depd/master?label=linux +[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd diff --git a/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js new file mode 100644 index 00000000..1bf2fcfd --- /dev/null +++ b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js @@ -0,0 +1,538 @@ +/*! + * depd + * Copyright(c) 2014-2018 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var relative = require('path').relative + +/** + * Module exports. + */ + +module.exports = depd + +/** + * Get the path to base files on. + */ + +var basePath = process.cwd() + +/** + * Determine if namespace is contained in the string. + */ + +function containsNamespace (str, namespace) { + var vals = str.split(/[ ,]+/) + var ns = String(namespace).toLowerCase() + + for (var i = 0; i < vals.length; i++) { + var val = vals[i] + + // namespace contained + if (val && (val === '*' || val.toLowerCase() === ns)) { + return true + } + } + + return false +} + +/** + * Convert a data descriptor to accessor descriptor. + */ + +function convertDataDescriptorToAccessor (obj, prop, message) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + var value = descriptor.value + + descriptor.get = function getter () { return value } + + if (descriptor.writable) { + descriptor.set = function setter (val) { return (value = val) } + } + + delete descriptor.value + delete descriptor.writable + + Object.defineProperty(obj, prop, descriptor) + + return descriptor +} + +/** + * Create arguments string to keep arity. + */ + +function createArgumentsString (arity) { + var str = '' + + for (var i = 0; i < arity; i++) { + str += ', arg' + i + } + + return str.substr(2) +} + +/** + * Create stack string from stack. + */ + +function createStackString (stack) { + var str = this.name + ': ' + this.namespace + + if (this.message) { + str += ' deprecated ' + this.message + } + + for (var i = 0; i < stack.length; i++) { + str += '\n at ' + stack[i].toString() + } + + return str +} + +/** + * Create deprecate for namespace in caller. + */ + +function depd (namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + var stack = getStack() + var site = callSiteLocation(stack[1]) + var file = site[0] + + function deprecate (message) { + // call to self as log + log.call(deprecate, message) + } + + deprecate._file = file + deprecate._ignored = isignored(namespace) + deprecate._namespace = namespace + deprecate._traced = istraced(namespace) + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Determine if event emitter has listeners of a given type. + * + * The way to do this check is done three different ways in Node.js >= 0.8 + * so this consolidates them into a minimal set using instance methods. + * + * @param {EventEmitter} emitter + * @param {string} type + * @returns {boolean} + * @private + */ + +function eehaslisteners (emitter, type) { + var count = typeof emitter.listenerCount !== 'function' + ? emitter.listeners(type).length + : emitter.listenerCount(type) + + return count > 0 +} + +/** + * Determine if namespace is ignored. + */ + +function isignored (namespace) { + if (process.noDeprecation) { + // --no-deprecation support + return true + } + + var str = process.env.NO_DEPRECATION || '' + + // namespace ignored + return containsNamespace(str, namespace) +} + +/** + * Determine if namespace is traced. + */ + +function istraced (namespace) { + if (process.traceDeprecation) { + // --trace-deprecation support + return true + } + + var str = process.env.TRACE_DEPRECATION || '' + + // namespace traced + return containsNamespace(str, namespace) +} + +/** + * Display deprecation message. + */ + +function log (message, site) { + var haslisteners = eehaslisteners(process, 'deprecation') + + // abort early if no destination + if (!haslisteners && this._ignored) { + return + } + + var caller + var callFile + var callSite + var depSite + var i = 0 + var seen = false + var stack = getStack() + var file = this._file + + if (site) { + // provided site + depSite = site + callSite = callSiteLocation(stack[1]) + callSite.name = depSite.name + file = callSite[0] + } else { + // get call site + i = 2 + depSite = callSiteLocation(stack[i]) + callSite = depSite + } + + // get caller of deprecated thing in relation to file + for (; i < stack.length; i++) { + caller = callSiteLocation(stack[i]) + callFile = caller[0] + + if (callFile === file) { + seen = true + } else if (callFile === this._file) { + file = this._file + } else if (seen) { + break + } + } + + var key = caller + ? depSite.join(':') + '__' + caller.join(':') + : undefined + + if (key !== undefined && key in this._warned) { + // already warned + return + } + + this._warned[key] = true + + // generate automatic message from call site + var msg = message + if (!msg) { + msg = callSite === depSite || !callSite.name + ? defaultMessage(depSite) + : defaultMessage(callSite) + } + + // emit deprecation if listeners exist + if (haslisteners) { + var err = DeprecationError(this._namespace, msg, stack.slice(i)) + process.emit('deprecation', err) + return + } + + // format and write message + var format = process.stderr.isTTY + ? formatColor + : formatPlain + var output = format.call(this, msg, caller, stack.slice(i)) + process.stderr.write(output + '\n', 'utf8') +} + +/** + * Get call site location as array. + */ + +function callSiteLocation (callSite) { + var file = callSite.getFileName() || '' + var line = callSite.getLineNumber() + var colm = callSite.getColumnNumber() + + if (callSite.isEval()) { + file = callSite.getEvalOrigin() + ', ' + file + } + + var site = [file, line, colm] + + site.callSite = callSite + site.name = callSite.getFunctionName() + + return site +} + +/** + * Generate a default message from the site. + */ + +function defaultMessage (site) { + var callSite = site.callSite + var funcName = site.name + + // make useful anonymous name + if (!funcName) { + funcName = '' + } + + var context = callSite.getThis() + var typeName = context && callSite.getTypeName() + + // ignore useless type name + if (typeName === 'Object') { + typeName = undefined + } + + // make useful type name + if (typeName === 'Function') { + typeName = context.name || typeName + } + + return typeName && callSite.getMethodName() + ? typeName + '.' + funcName + : funcName +} + +/** + * Format deprecation message without color. + */ + +function formatPlain (msg, caller, stack) { + var timestamp = new Date().toUTCString() + + var formatted = timestamp + + ' ' + this._namespace + + ' deprecated ' + msg + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n at ' + stack[i].toString() + } + + return formatted + } + + if (caller) { + formatted += ' at ' + formatLocation(caller) + } + + return formatted +} + +/** + * Format deprecation message with color. + */ + +function formatColor (msg, caller, stack) { + var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan + ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow + ' \x1b[0m' + msg + '\x1b[39m' // reset + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan + } + + return formatted + } + + if (caller) { + formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan + } + + return formatted +} + +/** + * Format call site location. + */ + +function formatLocation (callSite) { + return relative(basePath, callSite[0]) + + ':' + callSite[1] + + ':' + callSite[2] +} + +/** + * Get the stack as array of call sites. + */ + +function getStack () { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = Math.max(10, limit) + + // capture the stack + Error.captureStackTrace(obj) + + // slice this function off the top + var stack = obj.stack.slice(1) + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack +} + +/** + * Capture call site stack from v8. + */ + +function prepareObjectStackTrace (obj, stack) { + return stack +} + +/** + * Return a wrapped function in a deprecation message. + */ + +function wrapfunction (fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + var args = createArgumentsString(fn.length) + var stack = getStack() + var site = callSiteLocation(stack[1]) + + site.name = fn.name + + // eslint-disable-next-line no-new-func + var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site', + '"use strict"\n' + + 'return function (' + args + ') {' + + 'log.call(deprecate, message, site)\n' + + 'return fn.apply(this, arguments)\n' + + '}')(fn, log, this, message, site) + + return deprecatedfn +} + +/** + * Wrap property in a deprecation message. + */ + +function wrapproperty (obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + var deprecate = this + var stack = getStack() + var site = callSiteLocation(stack[1]) + + // set site name + site.name = prop + + // convert data descriptor + if ('value' in descriptor) { + descriptor = convertDataDescriptorToAccessor(obj, prop, message) + } + + var get = descriptor.get + var set = descriptor.set + + // wrap getter + if (typeof get === 'function') { + descriptor.get = function getter () { + log.call(deprecate, message, site) + return get.apply(this, arguments) + } + } + + // wrap setter + if (typeof set === 'function') { + descriptor.set = function setter () { + log.call(deprecate, message, site) + return set.apply(this, arguments) + } + } + + Object.defineProperty(obj, prop, descriptor) +} + +/** + * Create DeprecationError for deprecation + */ + +function DeprecationError (namespace, message, stack) { + var error = new Error() + var stackString + + Object.defineProperty(error, 'constructor', { + value: DeprecationError + }) + + Object.defineProperty(error, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }) + + Object.defineProperty(error, 'name', { + enumerable: false, + configurable: true, + value: 'DeprecationError', + writable: true + }) + + Object.defineProperty(error, 'namespace', { + configurable: true, + enumerable: false, + value: namespace, + writable: true + }) + + Object.defineProperty(error, 'stack', { + configurable: true, + enumerable: false, + get: function () { + if (stackString !== undefined) { + return stackString + } + + // prepare stack trace + return (stackString = createStackString.call(this, stack)) + }, + set: function setter (val) { + stackString = val + } + }) + + return error +} diff --git a/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/lib/browser/index.js b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/lib/browser/index.js new file mode 100644 index 00000000..6be45cc2 --- /dev/null +++ b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/lib/browser/index.js @@ -0,0 +1,77 @@ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = depd + +/** + * Create deprecate for namespace in caller. + */ + +function depd (namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + function deprecate (message) { + // no-op in browser + } + + deprecate._file = undefined + deprecate._ignored = true + deprecate._namespace = namespace + deprecate._traced = false + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Return a wrapped function in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapfunction (fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + return fn +} + +/** + * Wrap property in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapproperty (obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } +} diff --git a/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/package.json b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/package.json new file mode 100644 index 00000000..3857e199 --- /dev/null +++ b/backend/node_modules/.pnpm/depd@2.0.0/node_modules/depd/package.json @@ -0,0 +1,45 @@ +{ + "name": "depd", + "description": "Deprecate all the things", + "version": "2.0.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "deprecate", + "deprecated" + ], + "repository": "dougwilson/nodejs-depd", + "browser": "lib/browser/index.js", + "devDependencies": { + "benchmark": "2.1.4", + "beautify-benchmark": "0.2.4", + "eslint": "5.7.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-markdown": "1.0.0-beta.7", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "istanbul": "0.4.5", + "mocha": "5.2.0", + "safe-buffer": "5.1.2", + "uid-safe": "2.1.5" + }, + "files": [ + "lib/", + "History.md", + "LICENSE", + "index.js", + "Readme.md" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail test/", + "test-ci": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter spec test/ && istanbul report lcovonly text-summary", + "test-cov": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter dot test/ && istanbul report lcov text-summary" + } +} diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/call-bind-apply-helpers b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/call-bind-apply-helpers new file mode 120000 index 00000000..124bee97 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/call-bind-apply-helpers @@ -0,0 +1 @@ +../../call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers \ No newline at end of file diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.eslintrc b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.eslintrc new file mode 100644 index 00000000..3b5d9e90 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.github/FUNDING.yml b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.github/FUNDING.yml new file mode 100644 index 00000000..8a1d7b0e --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/dunder-proto +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.nycrc b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/CHANGELOG.md b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/CHANGELOG.md new file mode 100644 index 00000000..9b8b2f82 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/es-shims/dunder-proto/compare/v1.0.0...v1.0.1) - 2024-12-16 + +### Commits + +- [Fix] do not crash when `--disable-proto=throw` [`6c367d9`](https://github.com/es-shims/dunder-proto/commit/6c367d919bc1604778689a297bbdbfea65752847) +- [Tests] ensure noproto tests only use the current version of dunder-proto [`b02365b`](https://github.com/es-shims/dunder-proto/commit/b02365b9cf889c4a2cac7be0c3cfc90a789af36c) +- [Dev Deps] update `@arethetypeswrong/cli`, `@types/tape` [`e3c5c3b`](https://github.com/es-shims/dunder-proto/commit/e3c5c3bd81cf8cef7dff2eca19e558f0e307f666) +- [Deps] update `call-bind-apply-helpers` [`19f1da0`](https://github.com/es-shims/dunder-proto/commit/19f1da028b8dd0d05c85bfd8f7eed2819b686450) + +## v1.0.0 - 2024-12-06 + +### Commits + +- Initial implementation, tests, readme, types [`a5b74b0`](https://github.com/es-shims/dunder-proto/commit/a5b74b0082f5270cb0905cd9a2e533cee7498373) +- Initial commit [`73fb5a3`](https://github.com/es-shims/dunder-proto/commit/73fb5a353b51ac2ab00c9fdeb0114daffd4c07a8) +- npm init [`80152dc`](https://github.com/es-shims/dunder-proto/commit/80152dc98155da4eb046d9f67a87ed96e8280a1d) +- Only apps should have lockfiles [`03e6660`](https://github.com/es-shims/dunder-proto/commit/03e6660a1d70dc401f3e217a031475ec537243dd) diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/LICENSE b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/LICENSE new file mode 100644 index 00000000..34995e79 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 ECMAScript Shims + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/README.md b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/README.md new file mode 100644 index 00000000..44b80a2d --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/README.md @@ -0,0 +1,54 @@ +# dunder-proto [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +If available, the `Object.prototype.__proto__` accessor and mutator, call-bound. + +## Getting started + +```sh +npm install --save dunder-proto +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getDunder = require('dunder-proto/get'); +const setDunder = require('dunder-proto/set'); + +const obj = {}; + +assert.equal('toString' in obj, true); +assert.equal(getDunder(obj), Object.prototype); + +setDunder(obj, null); + +assert.equal('toString' in obj, false); +assert.equal(getDunder(obj), null); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/dunder-proto +[npm-version-svg]: https://versionbadg.es/es-shims/dunder-proto.svg +[deps-svg]: https://david-dm.org/es-shims/dunder-proto.svg +[deps-url]: https://david-dm.org/es-shims/dunder-proto +[dev-deps-svg]: https://david-dm.org/es-shims/dunder-proto/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/dunder-proto#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/dunder-proto.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/dunder-proto.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/dunder-proto.svg +[downloads-url]: https://npm-stat.com/charts.html?package=dunder-proto +[codecov-image]: https://codecov.io/gh/es-shims/dunder-proto/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/es-shims/dunder-proto/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/dunder-proto +[actions-url]: https://github.com/es-shims/dunder-proto/actions diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.d.ts b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.d.ts new file mode 100644 index 00000000..c7e14d25 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.d.ts @@ -0,0 +1,5 @@ +declare function getDunderProto(target: {}): object | null; + +declare const x: false | typeof getDunderProto; + +export = x; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js new file mode 100644 index 00000000..45093df9 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js @@ -0,0 +1,30 @@ +'use strict'; + +var callBind = require('call-bind-apply-helpers'); +var gOPD = require('gopd'); + +var hasProtoAccessor; +try { + // eslint-disable-next-line no-extra-parens, no-proto + hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; +} catch (e) { + if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { + throw e; + } +} + +// eslint-disable-next-line no-extra-parens +var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); + +var $Object = Object; +var $getPrototypeOf = $Object.getPrototypeOf; + +/** @type {import('./get')} */ +module.exports = desc && typeof desc.get === 'function' + ? callBind([desc.get]) + : typeof $getPrototypeOf === 'function' + ? /** @type {import('./get')} */ function getDunder(value) { + // eslint-disable-next-line eqeqeq + return $getPrototypeOf(value == null ? value : $Object(value)); + } + : false; diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/package.json b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/package.json new file mode 100644 index 00000000..04a40367 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/package.json @@ -0,0 +1,76 @@ +{ + "name": "dunder-proto", + "version": "1.0.1", + "description": "If available, the `Object.prototype.__proto__` accessor and mutator, call-bound", + "main": false, + "exports": { + "./get": "./get.js", + "./set": "./set.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/dunder-proto.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/es-shims/dunder-proto/issues" + }, + "homepage": "https://github.com/es-shims/dunder-proto#readme", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/tape": "^5.7.0", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "testling": { + "files": "test/index.js" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.d.ts b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.d.ts new file mode 100644 index 00000000..16bfdfe2 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.d.ts @@ -0,0 +1,5 @@ +declare function setDunderProto

(target: {}, proto: P): P; + +declare const x: false | typeof setDunderProto; + +export = x; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.js b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.js new file mode 100644 index 00000000..6085b6e8 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/set.js @@ -0,0 +1,35 @@ +'use strict'; + +var callBind = require('call-bind-apply-helpers'); +var gOPD = require('gopd'); +var $TypeError = require('es-errors/type'); + +/** @type {{ __proto__?: object | null }} */ +var obj = {}; +try { + obj.__proto__ = null; // eslint-disable-line no-proto +} catch (e) { + if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { + throw e; + } +} + +var hasProtoMutator = !('toString' in obj); + +// eslint-disable-next-line no-extra-parens +var desc = gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); + +/** @type {import('./set')} */ +module.exports = hasProtoMutator && ( +// eslint-disable-next-line no-extra-parens + (!!desc && typeof desc.set === 'function' && /** @type {import('./set')} */ (callBind([desc.set]))) + || /** @type {import('./set')} */ function setDunder(object, proto) { + // this is node v0.10 or older, which doesn't have Object.setPrototypeOf and has undeniable __proto__ + if (object == null) { // eslint-disable-line eqeqeq + throw new $TypeError('set Object.prototype.__proto__ called on null or undefined'); + } + // eslint-disable-next-line no-proto, no-param-reassign, no-extra-parens + /** @type {{ __proto__?: object | null }} */ (object).__proto__ = proto; + return proto; + } +); diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/get.js b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/get.js new file mode 100644 index 00000000..253f1838 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/get.js @@ -0,0 +1,34 @@ +'use strict'; + +var test = require('tape'); + +var getDunderProto = require('../get'); + +test('getDunderProto', { skip: !getDunderProto }, function (t) { + if (!getDunderProto) { + throw 'should never happen; this is just for type narrowing'; // eslint-disable-line no-throw-literal + } + + // @ts-expect-error + t['throws'](function () { getDunderProto(); }, TypeError, 'throws if no argument'); + // @ts-expect-error + t['throws'](function () { getDunderProto(undefined); }, TypeError, 'throws with undefined'); + // @ts-expect-error + t['throws'](function () { getDunderProto(null); }, TypeError, 'throws with null'); + + t.equal(getDunderProto({}), Object.prototype); + t.equal(getDunderProto([]), Array.prototype); + t.equal(getDunderProto(function () {}), Function.prototype); + t.equal(getDunderProto(/./g), RegExp.prototype); + t.equal(getDunderProto(42), Number.prototype); + t.equal(getDunderProto(true), Boolean.prototype); + t.equal(getDunderProto('foo'), String.prototype); + + t.end(); +}); + +test('no dunder proto', { skip: !!getDunderProto }, function (t) { + t.notOk('__proto__' in Object.prototype, 'no __proto__ in Object.prototype'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/index.js b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/index.js new file mode 100644 index 00000000..08ff36f7 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/index.js @@ -0,0 +1,4 @@ +'use strict'; + +require('./get'); +require('./set'); diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/set.js b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/set.js new file mode 100644 index 00000000..c3bfe4d4 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/test/set.js @@ -0,0 +1,50 @@ +'use strict'; + +var test = require('tape'); + +var setDunderProto = require('../set'); + +test('setDunderProto', { skip: !setDunderProto }, function (t) { + if (!setDunderProto) { + throw 'should never happen; this is just for type narrowing'; // eslint-disable-line no-throw-literal + } + + // @ts-expect-error + t['throws'](function () { setDunderProto(); }, TypeError, 'throws if no arguments'); + // @ts-expect-error + t['throws'](function () { setDunderProto(undefined); }, TypeError, 'throws with undefined and nothing'); + // @ts-expect-error + t['throws'](function () { setDunderProto(undefined, undefined); }, TypeError, 'throws with undefined and undefined'); + // @ts-expect-error + t['throws'](function () { setDunderProto(null); }, TypeError, 'throws with null and undefined'); + // @ts-expect-error + t['throws'](function () { setDunderProto(null, undefined); }, TypeError, 'throws with null and undefined'); + + /** @type {{ inherited?: boolean }} */ + var obj = {}; + t.ok('toString' in obj, 'object initially has toString'); + + setDunderProto(obj, null); + t.notOk('toString' in obj, 'object no longer has toString'); + + t.notOk('inherited' in obj, 'object lacks inherited property'); + setDunderProto(obj, { inherited: true }); + t.equal(obj.inherited, true, 'object has inherited property'); + + t.end(); +}); + +test('no dunder proto', { skip: !!setDunderProto }, function (t) { + if ('__proto__' in Object.prototype) { + t['throws']( + // @ts-expect-error + function () { ({}).__proto__ = null; }, // eslint-disable-line no-proto + Error, + 'throws when setting Object.prototype.__proto__' + ); + } else { + t.notOk('__proto__' in Object.prototype, 'no __proto__ in Object.prototype'); + } + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/tsconfig.json b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/tsconfig.json new file mode 100644 index 00000000..dabbe230 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ES2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/es-errors b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/gopd b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/gopd new file mode 120000 index 00000000..3e8fbc1b --- /dev/null +++ b/backend/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/gopd @@ -0,0 +1 @@ +../../gopd@1.2.0/node_modules/gopd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/LICENSE b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/LICENSE new file mode 100644 index 00000000..a7ae8ee9 --- /dev/null +++ b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/README.md b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/README.md new file mode 100644 index 00000000..cbd2478b --- /dev/null +++ b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/README.md @@ -0,0 +1,80 @@ +# EE First + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Get the first event in a set of event emitters and event pairs, +then clean up after itself. + +## Install + +```sh +$ npm install ee-first +``` + +## API + +```js +var first = require('ee-first') +``` + +### first(arr, listener) + +Invoke `listener` on the first event from the list specified in `arr`. `arr` is +an array of arrays, with each array in the format `[ee, ...event]`. `listener` +will be called only once, the first time any of the given events are emitted. If +`error` is one of the listened events, then if that fires first, the `listener` +will be given the `err` argument. + +The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the +first argument emitted from an `error` event, if applicable; `ee` is the event +emitter that fired; `event` is the string event name that fired; and `args` is an +array of the arguments that were emitted on the event. + +```js +var ee1 = new EventEmitter() +var ee2 = new EventEmitter() + +first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) +``` + +#### .cancel() + +The group of listeners can be cancelled before being invoked and have all the event +listeners removed from the underlying event emitters. + +```js +var thunk = first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) + +// cancel and clean up +thunk.cancel() +``` + +[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square +[npm-url]: https://npmjs.org/package/ee-first +[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square +[github-url]: https://github.com/jonathanong/ee-first/tags +[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square +[travis-url]: https://travis-ci.org/jonathanong/ee-first +[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master +[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/ee-first +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js new file mode 100644 index 00000000..501287cd --- /dev/null +++ b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js @@ -0,0 +1,95 @@ +/*! + * ee-first + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = first + +/** + * Get the first event in a set of event emitters and event pairs. + * + * @param {array} stuff + * @param {function} done + * @public + */ + +function first(stuff, done) { + if (!Array.isArray(stuff)) + throw new TypeError('arg must be an array of [ee, events...] arrays') + + var cleanups = [] + + for (var i = 0; i < stuff.length; i++) { + var arr = stuff[i] + + if (!Array.isArray(arr) || arr.length < 2) + throw new TypeError('each array member must be [ee, events...]') + + var ee = arr[0] + + for (var j = 1; j < arr.length; j++) { + var event = arr[j] + var fn = listener(event, callback) + + // listen to the event + ee.on(event, fn) + // push this listener to the list of cleanups + cleanups.push({ + ee: ee, + event: event, + fn: fn, + }) + } + } + + function callback() { + cleanup() + done.apply(null, arguments) + } + + function cleanup() { + var x + for (var i = 0; i < cleanups.length; i++) { + x = cleanups[i] + x.ee.removeListener(x.event, x.fn) + } + } + + function thunk(fn) { + done = fn + } + + thunk.cancel = cleanup + + return thunk +} + +/** + * Create the event listener. + * @private + */ + +function listener(event, done) { + return function onevent(arg1) { + var args = new Array(arguments.length) + var ee = this + var err = event === 'error' + ? arg1 + : null + + // copy args to prevent arguments escaping scope + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + done(err, ee, event, args) + } +} diff --git a/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/package.json b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/package.json new file mode 100644 index 00000000..b6d0b7d6 --- /dev/null +++ b/backend/node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/package.json @@ -0,0 +1,29 @@ +{ + "name": "ee-first", + "description": "return the first event in a set of ee/event pairs", + "version": "1.1.1", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com", + "twitter": "https://twitter.com/jongleberry" + }, + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "repository": "jonathanong/ee-first", + "devDependencies": { + "istanbul": "0.3.9", + "mocha": "2.2.5" + }, + "files": [ + "index.js", + "LICENSE" + ], + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/LICENSE b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/LICENSE new file mode 100644 index 00000000..8812229b --- /dev/null +++ b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/README.md b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/README.md new file mode 100644 index 00000000..3842493e --- /dev/null +++ b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/README.md @@ -0,0 +1,109 @@ +# Encode URL + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +## Installation + +```sh +npm install encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function accepts a URL and encodes all the non-URL code points (as UTF-8 byte sequences). It will not encode the "%" character unless it is not part of a valid sequence (`%20` will be left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as hard as it can to properly encode the given URL, including replacing any raw, unpaired surrogate pairs with the Unicode replacement character prior to encoding. + +## Examples + +### Encode a URL containing user-controlled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Similarities + +This function is _similar_ to the intrinsic function `encodeURI`. However, it will not encode: + +* The `\`, `^`, or `|` characters +* The `%` character when it's part of a valid sequence +* `[` and `]` (for IPv6 hostnames) +* Replaces raw, unpaired surrogate pairs with the Unicode replacement character + +As a result, the encoding aligns closely with the behavior in the [WHATWG URL specification][whatwg-url]. However, this package only encodes strings and does not do any URL parsing or formatting. + +It is expected that any output from `new URL(url)` will not change when used with this package, as the output has already been encoded. Additionally, if we were to encode before `new URL(url)`, we do not expect the before and after encoded formats to be parsed any differently. + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) diff --git a/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js new file mode 100644 index 00000000..a49ee5a0 --- /dev/null +++ b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/package.json b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/package.json new file mode 100644 index 00000000..31338221 --- /dev/null +++ b/backend/node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "encodeurl", + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "version": "2.0.0", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "repository": "pillarjs/encodeurl", + "devDependencies": { + "eslint": "5.11.1", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.eslintrc b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.eslintrc new file mode 100644 index 00000000..46f3b120 --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": ["error", { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.github/FUNDING.yml b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.github/FUNDING.yml new file mode 100644 index 00000000..4445451f --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-define-property +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.nycrc b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/CHANGELOG.md b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/CHANGELOG.md new file mode 100644 index 00000000..5f60cc09 --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/es-define-property/compare/v1.0.0...v1.0.1) - 2024-12-06 + +### Commits + +- [types] use shared tsconfig [`954a663`](https://github.com/ljharb/es-define-property/commit/954a66360326e508a0e5daa4b07493d58f5e110e) +- [actions] split out node 10-20, and 20+ [`3a8e84b`](https://github.com/ljharb/es-define-property/commit/3a8e84b23883f26ff37b3e82ff283834228e18c6) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/tape`, `auto-changelog`, `gopd`, `tape` [`86ae27b`](https://github.com/ljharb/es-define-property/commit/86ae27bb8cc857b23885136fad9cbe965ae36612) +- [Refactor] avoid using `get-intrinsic` [`02480c0`](https://github.com/ljharb/es-define-property/commit/02480c0353ef6118965282977c3864aff53d98b1) +- [Tests] replace `aud` with `npm audit` [`f6093ff`](https://github.com/ljharb/es-define-property/commit/f6093ff74ab51c98015c2592cd393bd42478e773) +- [Tests] configure testling [`7139e66`](https://github.com/ljharb/es-define-property/commit/7139e66959247a56086d9977359caef27c6849e7) +- [Dev Deps] update `tape` [`b901b51`](https://github.com/ljharb/es-define-property/commit/b901b511a75e001a40ce1a59fef7d9ffcfc87482) +- [Tests] fix types in tests [`469d269`](https://github.com/ljharb/es-define-property/commit/469d269fd141b1e773ec053a9fa35843493583e0) +- [Dev Deps] add missing peer dep [`733acfb`](https://github.com/ljharb/es-define-property/commit/733acfb0c4c96edf337e470b89a25a5b3724c352) + +## v1.0.0 - 2024-02-12 + +### Commits + +- Initial implementation, tests, readme, types [`3e154e1`](https://github.com/ljharb/es-define-property/commit/3e154e11a2fee09127220f5e503bf2c0a31dd480) +- Initial commit [`07d98de`](https://github.com/ljharb/es-define-property/commit/07d98de34a4dc31ff5e83a37c0c3f49e0d85cd50) +- npm init [`c4eb634`](https://github.com/ljharb/es-define-property/commit/c4eb6348b0d3886aac36cef34ad2ee0665ea6f3e) +- Only apps should have lockfiles [`7af86ec`](https://github.com/ljharb/es-define-property/commit/7af86ec1d311ec0b17fdfe616a25f64276903856) diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/LICENSE b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/README.md b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/README.md new file mode 100644 index 00000000..9b291bdd --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/README.md @@ -0,0 +1,49 @@ +# es-define-property [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +`Object.defineProperty`, but not IE 8's broken one. + +## Example + +```js +const assert = require('assert'); + +const $defineProperty = require('es-define-property'); + +if ($defineProperty) { + assert.equal($defineProperty, Object.defineProperty); +} else if (Object.defineProperty) { + assert.equal($defineProperty, false, 'this is IE 8'); +} else { + assert.equal($defineProperty, false, 'this is an ES3 engine'); +} +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-define-property +[npm-version-svg]: https://versionbadg.es/ljharb/es-define-property.svg +[deps-svg]: https://david-dm.org/ljharb/es-define-property.svg +[deps-url]: https://david-dm.org/ljharb/es-define-property +[dev-deps-svg]: https://david-dm.org/ljharb/es-define-property/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-define-property#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-define-property.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-define-property.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-define-property.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-define-property +[codecov-image]: https://codecov.io/gh/ljharb/es-define-property/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-define-property/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-define-property +[actions-url]: https://github.com/ljharb/es-define-property/actions diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.d.ts b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.d.ts new file mode 100644 index 00000000..6012247c --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.d.ts @@ -0,0 +1,3 @@ +declare const defineProperty: false | typeof Object.defineProperty; + +export = defineProperty; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js new file mode 100644 index 00000000..e0a29251 --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js @@ -0,0 +1,14 @@ +'use strict'; + +/** @type {import('.')} */ +var $defineProperty = Object.defineProperty || false; +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } +} + +module.exports = $defineProperty; diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/package.json b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/package.json new file mode 100644 index 00000000..fbed1878 --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/package.json @@ -0,0 +1,81 @@ +{ + "name": "es-define-property", + "version": "1.0.1", + "description": "`Object.defineProperty`, but not IE 8's broken one.", + "main": "index.js", + "types": "./index.d.ts", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-define-property.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "object", + "define", + "property", + "defineProperty", + "Object.defineProperty" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-define-property/issues" + }, + "homepage": "https://github.com/ljharb/es-define-property#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/gopd": "^1.0.3", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "gopd": "^1.2.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/test/index.js b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/test/index.js new file mode 100644 index 00000000..b4b4688f --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/test/index.js @@ -0,0 +1,56 @@ +'use strict'; + +var $defineProperty = require('../'); + +var test = require('tape'); +var gOPD = require('gopd'); + +test('defineProperty: supported', { skip: !$defineProperty }, function (t) { + t.plan(4); + + t.equal(typeof $defineProperty, 'function', 'defineProperty is supported'); + if ($defineProperty && gOPD) { // this `if` check is just to shut TS up + /** @type {{ a: number, b?: number, c?: number }} */ + var o = { a: 1 }; + + $defineProperty(o, 'b', { enumerable: true, value: 2 }); + t.deepEqual( + gOPD(o, 'b'), + { + configurable: false, + enumerable: true, + value: 2, + writable: false + }, + 'property descriptor is as expected' + ); + + $defineProperty(o, 'c', { enumerable: false, value: 3, writable: true }); + t.deepEqual( + gOPD(o, 'c'), + { + configurable: false, + enumerable: false, + value: 3, + writable: true + }, + 'property descriptor is as expected' + ); + } + + t.equal($defineProperty, Object.defineProperty, 'defineProperty is Object.defineProperty'); + + t.end(); +}); + +test('defineProperty: not supported', { skip: !!$defineProperty }, function (t) { + t.notOk($defineProperty, 'defineProperty is not supported'); + + t.match( + typeof $defineProperty, + /^(?:undefined|boolean)$/, + '`typeof defineProperty` is `undefined` or `boolean`' + ); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/tsconfig.json b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/tsconfig.json new file mode 100644 index 00000000..5a49992e --- /dev/null +++ b/backend/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2022", + }, + "exclude": [ + "coverage", + "test/list-exports" + ], +} diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.eslintrc b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.eslintrc new file mode 100644 index 00000000..3b5d9e90 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.github/FUNDING.yml b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.github/FUNDING.yml new file mode 100644 index 00000000..f1b88055 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-errors +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/CHANGELOG.md b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/CHANGELOG.md new file mode 100644 index 00000000..204a9e90 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/CHANGELOG.md @@ -0,0 +1,40 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.3.0](https://github.com/ljharb/es-errors/compare/v1.2.1...v1.3.0) - 2024-02-05 + +### Commits + +- [New] add `EvalError` and `URIError` [`1927627`](https://github.com/ljharb/es-errors/commit/1927627ba68cb6c829d307231376c967db53acdf) + +## [v1.2.1](https://github.com/ljharb/es-errors/compare/v1.2.0...v1.2.1) - 2024-02-04 + +### Commits + +- [Fix] add missing `exports` entry [`5bb5f28`](https://github.com/ljharb/es-errors/commit/5bb5f280f98922701109d6ebb82eea2257cecc7e) + +## [v1.2.0](https://github.com/ljharb/es-errors/compare/v1.1.0...v1.2.0) - 2024-02-04 + +### Commits + +- [New] add `ReferenceError` [`6d8cf5b`](https://github.com/ljharb/es-errors/commit/6d8cf5bbb6f3f598d02cf6f30e468ba2caa8e143) + +## [v1.1.0](https://github.com/ljharb/es-errors/compare/v1.0.0...v1.1.0) - 2024-02-04 + +### Commits + +- [New] add base Error [`2983ab6`](https://github.com/ljharb/es-errors/commit/2983ab65f7bc5441276cb021dc3aa03c78881698) + +## v1.0.0 - 2024-02-03 + +### Commits + +- Initial implementation, tests, readme, type [`8f47631`](https://github.com/ljharb/es-errors/commit/8f476317e9ad76f40ad648081829b1a1a3a1288b) +- Initial commit [`ea5d099`](https://github.com/ljharb/es-errors/commit/ea5d099ef18e550509ab9e2be000526afd81c385) +- npm init [`6f5ebf9`](https://github.com/ljharb/es-errors/commit/6f5ebf9cead474dadd72b9e63dad315820a089ae) +- Only apps should have lockfiles [`e1a0aeb`](https://github.com/ljharb/es-errors/commit/e1a0aeb7b80f5cfc56be54d6b2100e915d47def8) +- [meta] add `sideEffects` flag [`a9c7d46`](https://github.com/ljharb/es-errors/commit/a9c7d460a492f1d8a241c836bc25a322a19cc043) diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/LICENSE b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/README.md b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/README.md new file mode 100644 index 00000000..8dbfacfe --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/README.md @@ -0,0 +1,55 @@ +# es-errors [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A simple cache for a few of the JS Error constructors. + +## Example + +```js +const assert = require('assert'); + +const Base = require('es-errors'); +const Eval = require('es-errors/eval'); +const Range = require('es-errors/range'); +const Ref = require('es-errors/ref'); +const Syntax = require('es-errors/syntax'); +const Type = require('es-errors/type'); +const URI = require('es-errors/uri'); + +assert.equal(Base, Error); +assert.equal(Eval, EvalError); +assert.equal(Range, RangeError); +assert.equal(Ref, ReferenceError); +assert.equal(Syntax, SyntaxError); +assert.equal(Type, TypeError); +assert.equal(URI, URIError); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-errors +[npm-version-svg]: https://versionbadg.es/ljharb/es-errors.svg +[deps-svg]: https://david-dm.org/ljharb/es-errors.svg +[deps-url]: https://david-dm.org/ljharb/es-errors +[dev-deps-svg]: https://david-dm.org/ljharb/es-errors/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-errors#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-errors.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-errors.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-errors.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-errors +[codecov-image]: https://codecov.io/gh/ljharb/es-errors/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-errors/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-errors +[actions-url]: https://github.com/ljharb/es-errors/actions diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.d.ts b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.d.ts new file mode 100644 index 00000000..e4210e01 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.d.ts @@ -0,0 +1,3 @@ +declare const EvalError: EvalErrorConstructor; + +export = EvalError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js new file mode 100644 index 00000000..725ccb61 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./eval')} */ +module.exports = EvalError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.d.ts b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.d.ts new file mode 100644 index 00000000..69bdbc92 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.d.ts @@ -0,0 +1,3 @@ +declare const Error: ErrorConstructor; + +export = Error; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js new file mode 100644 index 00000000..cc0c5212 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('.')} */ +module.exports = Error; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/package.json b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/package.json new file mode 100644 index 00000000..ff8c2a53 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/package.json @@ -0,0 +1,80 @@ +{ + "name": "es-errors", + "version": "1.3.0", + "description": "A simple cache for a few of the JS Error constructors.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./eval": "./eval.js", + "./range": "./range.js", + "./ref": "./ref.js", + "./syntax": "./syntax.js", + "./type": "./type.js", + "./uri": "./uri.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "aud --production", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-errors.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "error", + "typeerror", + "syntaxerror", + "rangeerror" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-errors/issues" + }, + "homepage": "https://github.com/ljharb/es-errors#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eclint": "^2.8.1", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.d.ts b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.d.ts new file mode 100644 index 00000000..3a12e864 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.d.ts @@ -0,0 +1,3 @@ +declare const RangeError: RangeErrorConstructor; + +export = RangeError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js new file mode 100644 index 00000000..2044fe03 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./range')} */ +module.exports = RangeError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.d.ts b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.d.ts new file mode 100644 index 00000000..a13107e2 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.d.ts @@ -0,0 +1,3 @@ +declare const ReferenceError: ReferenceErrorConstructor; + +export = ReferenceError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js new file mode 100644 index 00000000..d7c430fd --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./ref')} */ +module.exports = ReferenceError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.d.ts b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.d.ts new file mode 100644 index 00000000..6a0c53c5 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.d.ts @@ -0,0 +1,3 @@ +declare const SyntaxError: SyntaxErrorConstructor; + +export = SyntaxError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js new file mode 100644 index 00000000..5f5fddee --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./syntax')} */ +module.exports = SyntaxError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/test/index.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/test/index.js new file mode 100644 index 00000000..1ff02772 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/test/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var test = require('tape'); + +var E = require('../'); +var R = require('../range'); +var Ref = require('../ref'); +var S = require('../syntax'); +var T = require('../type'); + +test('errors', function (t) { + t.equal(E, Error); + t.equal(R, RangeError); + t.equal(Ref, ReferenceError); + t.equal(S, SyntaxError); + t.equal(T, TypeError); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/tsconfig.json b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/tsconfig.json new file mode 100644 index 00000000..99dfeb6c --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/tsconfig.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "es5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": ["types"], /* Specify multiple folders that act like `./node_modules/@types`. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow `import x from y` when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + + /* Completeness */ + // "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.d.ts b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.d.ts new file mode 100644 index 00000000..576fb516 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.d.ts @@ -0,0 +1,3 @@ +declare const TypeError: TypeErrorConstructor + +export = TypeError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js new file mode 100644 index 00000000..9769e44e --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./type')} */ +module.exports = TypeError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.d.ts b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.d.ts new file mode 100644 index 00000000..c3261c91 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.d.ts @@ -0,0 +1,3 @@ +declare const URIError: URIErrorConstructor; + +export = URIError; diff --git a/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js new file mode 100644 index 00000000..e9cd1c78 --- /dev/null +++ b/backend/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./uri')} */ +module.exports = URIError; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-errors b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.eslintrc b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.eslintrc new file mode 100644 index 00000000..d90a1bc6 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "eqeqeq": ["error", "allow-null"], + "id-length": "off", + "new-cap": ["error", { + "capIsNewExceptions": [ + "RequireObjectCoercible", + "ToObject", + ], + }], + }, +} diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.github/FUNDING.yml b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.github/FUNDING.yml new file mode 100644 index 00000000..352bfdab --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-object +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/CHANGELOG.md b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/CHANGELOG.md new file mode 100644 index 00000000..8efc7ba1 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.2](https://github.com/es-shims/es-object-atoms/compare/v1.1.1...v1.1.2) - 2026-05-22 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `auto-changelog`, `eslint`, `npmignore` [`41e3d94`](https://github.com/es-shims/es-object-atoms/commit/41e3d94f6b49237fa490ec598e068f170c8b161e) +- [types] improve `isObject` type [`758edc2`](https://github.com/es-shims/es-object-atoms/commit/758edc2280fa6993a294a55957a43cee5951bf51) + +## [v1.1.1](https://github.com/es-shims/es-object-atoms/compare/v1.1.0...v1.1.1) - 2025-01-14 + +### Commits + +- [types] `ToObject`: improve types [`cfe8c8a`](https://github.com/es-shims/es-object-atoms/commit/cfe8c8a105c44820cb22e26f62d12ef0ad9715c8) + +## [v1.1.0](https://github.com/es-shims/es-object-atoms/compare/v1.0.1...v1.1.0) - 2025-01-14 + +### Commits + +- [New] add `isObject` [`51e4042`](https://github.com/es-shims/es-object-atoms/commit/51e4042df722eb3165f40dc5f4bf33d0197ecb07) + +## [v1.0.1](https://github.com/es-shims/es-object-atoms/compare/v1.0.0...v1.0.1) - 2025-01-13 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `tape` [`38ab9eb`](https://github.com/es-shims/es-object-atoms/commit/38ab9eb00b62c2f4668644f5e513d9b414ebd595) +- [types] improve types [`7d1beb8`](https://github.com/es-shims/es-object-atoms/commit/7d1beb887958b78b6a728a210a1c8370ab7e2aa1) +- [Tests] replace `aud` with `npm audit` [`25863ba`](https://github.com/es-shims/es-object-atoms/commit/25863baf99178f1d1ad33d1120498db28631907e) +- [Dev Deps] add missing peer dep [`c012309`](https://github.com/es-shims/es-object-atoms/commit/c0123091287e6132d6f4240496340c427433df28) + +## v1.0.0 - 2024-03-16 + +### Commits + +- Initial implementation, tests, readme, types [`f1499db`](https://github.com/es-shims/es-object-atoms/commit/f1499db7d3e1741e64979c61d645ab3137705e82) +- Initial commit [`99eedc7`](https://github.com/es-shims/es-object-atoms/commit/99eedc7b5fde38a50a28d3c8b724706e3e4c5f6a) +- [meta] rename repo [`fc851fa`](https://github.com/es-shims/es-object-atoms/commit/fc851fa70616d2d182aaf0bd02c2ed7084dea8fa) +- npm init [`b909377`](https://github.com/es-shims/es-object-atoms/commit/b909377c50049bd0ec575562d20b0f9ebae8947f) +- Only apps should have lockfiles [`7249edd`](https://github.com/es-shims/es-object-atoms/commit/7249edd2178c1b9ddfc66ffcc6d07fdf0d28efc1) diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/LICENSE b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/README.md b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/README.md new file mode 100644 index 00000000..447695b2 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/README.md @@ -0,0 +1,63 @@ +# es-object-atoms [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ES Object-related atoms: Object, ToObject, RequireObjectCoercible. + +## Example + +```js +const assert = require('assert'); + +const $Object = require('es-object-atoms'); +const isObject = require('es-object-atoms/isObject'); +const ToObject = require('es-object-atoms/ToObject'); +const RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible'); + +assert.equal($Object, Object); +assert.throws(() => ToObject(null), TypeError); +assert.throws(() => ToObject(undefined), TypeError); +assert.throws(() => RequireObjectCoercible(null), TypeError); +assert.throws(() => RequireObjectCoercible(undefined), TypeError); + +assert.equal(isObject(undefined), false); +assert.equal(isObject(null), false); +assert.equal(isObject({}), true); +assert.equal(isObject([]), true); +assert.equal(isObject(function () {}), true); + +assert.deepEqual(RequireObjectCoercible(true), true); +assert.deepEqual(ToObject(true), Object(true)); + +const obj = {}; +assert.equal(RequireObjectCoercible(obj), obj); +assert.equal(ToObject(obj), obj); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-object-atoms +[npm-version-svg]: https://versionbadg.es/ljharb/es-object-atoms.svg +[deps-svg]: https://david-dm.org/ljharb/es-object-atoms.svg +[deps-url]: https://david-dm.org/ljharb/es-object-atoms +[dev-deps-svg]: https://david-dm.org/ljharb/es-object-atoms/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-object-atoms#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-object-atoms.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-object-atoms.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-object.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-object-atoms +[codecov-image]: https://codecov.io/gh/ljharb/es-object-atoms/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-object-atoms/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-object-atoms +[actions-url]: https://github.com/ljharb/es-object-atoms/actions diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.d.ts b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.d.ts new file mode 100644 index 00000000..7e26c457 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.d.ts @@ -0,0 +1,3 @@ +declare function RequireObjectCoercible(value: T, optMessage?: string): T; + +export = RequireObjectCoercible; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.js b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.js new file mode 100644 index 00000000..8e191c6e --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/RequireObjectCoercible.js @@ -0,0 +1,11 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +/** @type {import('./RequireObjectCoercible')} */ +module.exports = function RequireObjectCoercible(value) { + if (value == null) { + throw new $TypeError((arguments.length > 0 && arguments[1]) || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.d.ts b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.d.ts new file mode 100644 index 00000000..d6dd3029 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.d.ts @@ -0,0 +1,7 @@ +declare function ToObject(value: number): Number; +declare function ToObject(value: boolean): Boolean; +declare function ToObject(value: string): String; +declare function ToObject(value: bigint): BigInt; +declare function ToObject(value: T): T; + +export = ToObject; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.js b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.js new file mode 100644 index 00000000..2b99a7da --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/ToObject.js @@ -0,0 +1,10 @@ +'use strict'; + +var $Object = require('./'); +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +/** @type {import('./ToObject')} */ +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.d.ts b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.d.ts new file mode 100644 index 00000000..8bdbfc81 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.d.ts @@ -0,0 +1,3 @@ +declare const Object: ObjectConstructor; + +export = Object; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.js b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.js new file mode 100644 index 00000000..1d33cef4 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('.')} */ +module.exports = Object; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.d.ts b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.d.ts new file mode 100644 index 00000000..9490fbbd --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.d.ts @@ -0,0 +1,3 @@ +declare function isObject(x: T): x is T & object & Record; + +export = isObject; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.js b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.js new file mode 100644 index 00000000..ec49bf12 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/isObject.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isObject')} */ +module.exports = function isObject(x) { + return !!x && (typeof x === 'function' || typeof x === 'object'); +}; diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/package.json b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/package.json new file mode 100644 index 00000000..cb6bc7bd --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/package.json @@ -0,0 +1,79 @@ +{ + "name": "es-object-atoms", + "version": "1.1.2", + "description": "ES Object-related atoms: Object, ToObject, RequireObjectCoercible", + "main": "index.js", + "exports": { + ".": "./index.js", + "./RequireObjectCoercible": "./RequireObjectCoercible.js", + "./isObject": "./isObject.js", + "./ToObject": "./ToObject.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@\">= 10.2\" audit --production", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-object-atoms.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "object", + "toobject", + "coercible" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-object-atoms/issues" + }, + "homepage": "https://github.com/ljharb/es-object-atoms#readme", + "dependencies": { + "es-errors": "^1.3.0" + }, + "devDependencies": { + "@ljharb/eslint-config": "^22.2.3", + "@ljharb/tsconfig": "^0.3.2", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.1", + "eclint": "^2.8.1", + "eslint": "^8.57.1", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/test/index.js b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/test/index.js new file mode 100644 index 00000000..430b705a --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/test/index.js @@ -0,0 +1,38 @@ +'use strict'; + +var test = require('tape'); + +var $Object = require('../'); +var isObject = require('../isObject'); +var ToObject = require('../ToObject'); +var RequireObjectCoercible = require('..//RequireObjectCoercible'); + +test('errors', function (t) { + t.equal($Object, Object); + // @ts-expect-error + t['throws'](function () { ToObject(null); }, TypeError); + // @ts-expect-error + t['throws'](function () { ToObject(undefined); }, TypeError); + // @ts-expect-error + t['throws'](function () { RequireObjectCoercible(null); }, TypeError); + // @ts-expect-error + t['throws'](function () { RequireObjectCoercible(undefined); }, TypeError); + + t.deepEqual(RequireObjectCoercible(true), true); + t.deepEqual(ToObject(true), Object(true)); + t.deepEqual(ToObject(42), Object(42)); + var f = function () {}; + t.equal(ToObject(f), f); + + t.equal(isObject(undefined), false); + t.equal(isObject(null), false); + t.equal(isObject({}), true); + t.equal(isObject([]), true); + t.equal(isObject(function () {}), true); + + var obj = {}; + t.equal(RequireObjectCoercible(obj), obj); + t.equal(ToObject(obj), obj); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/tsconfig.json b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/tsconfig.json new file mode 100644 index 00000000..c1ef7906 --- /dev/null +++ b/backend/node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es5", + "ignoreDeprecations": "6.0", + }, +} diff --git a/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/LICENSE b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/LICENSE new file mode 100644 index 00000000..2e70de97 --- /dev/null +++ b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2013 TJ Holowaychuk +Copyright (c) 2015 Andreas Lubbe +Copyright (c) 2015 Tiancheng "Timothy" Gu + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/Readme.md b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/Readme.md new file mode 100644 index 00000000..653d9eaa --- /dev/null +++ b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/Readme.md @@ -0,0 +1,43 @@ + +# escape-html + + Escape string for use in HTML + +## Example + +```js +var escape = require('escape-html'); +var html = escape('foo & bar'); +// -> foo & bar +``` + +## Benchmark + +``` +$ npm run-script bench + +> escape-html@1.0.3 bench nodejs-escape-html +> node benchmark/index.js + + + http_parser@1.0 + node@0.10.33 + v8@3.14.5.9 + ares@1.9.0-DEV + uv@0.10.29 + zlib@1.2.3 + modules@11 + openssl@1.0.1j + + 1 test completed. + 2 tests completed. + 3 tests completed. + + no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) + single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) + many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) +``` + +## License + + MIT \ No newline at end of file diff --git a/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js new file mode 100644 index 00000000..bf9e226f --- /dev/null +++ b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js @@ -0,0 +1,78 @@ +/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */ + +'use strict'; + +/** + * Module variables. + * @private + */ + +var matchHtmlRegExp = /["'&<>]/; + +/** + * Module exports. + * @public + */ + +module.exports = escapeHtml; + +/** + * Escape special characters in the given string of html. + * + * @param {string} string The string to escape for inserting into HTML + * @return {string} + * @public + */ + +function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; + } + + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; + + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } + + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; + } + + return lastIndex !== index + ? html + str.substring(lastIndex, index) + : html; +} diff --git a/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/package.json b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/package.json new file mode 100644 index 00000000..57ec7bd0 --- /dev/null +++ b/backend/node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/package.json @@ -0,0 +1,24 @@ +{ + "name": "escape-html", + "description": "Escape string for use in HTML", + "version": "1.0.3", + "license": "MIT", + "keywords": [ + "escape", + "html", + "utility" + ], + "repository": "component/escape-html", + "devDependencies": { + "benchmark": "1.0.0", + "beautify-benchmark": "0.2.4" + }, + "files": [ + "LICENSE", + "Readme.md", + "index.js" + ], + "scripts": { + "bench": "node benchmark/index.js" + } +} diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/debug b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/debug new file mode 120000 index 00000000..6b438e1c --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/debug @@ -0,0 +1 @@ +../../debug@4.4.3/node_modules/debug \ No newline at end of file diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/encodeurl b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/encodeurl new file mode 120000 index 00000000..179f433f --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/encodeurl @@ -0,0 +1 @@ +../../encodeurl@2.0.0/node_modules/encodeurl \ No newline at end of file diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/escape-html b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/escape-html new file mode 120000 index 00000000..6f67fba4 --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/escape-html @@ -0,0 +1 @@ +../../escape-html@1.0.3/node_modules/escape-html \ No newline at end of file diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/HISTORY.md b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/HISTORY.md new file mode 100644 index 00000000..8b011be0 --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/HISTORY.md @@ -0,0 +1,239 @@ +v2.1.1. / 2025-12-01 +================== + +* update engines field in the package.json to reflect the current compatibility (Node <18). See: 2.0.0 +* Minor changes (package metadata) + +v2.1.0 / 2025-03-05 +================== + + * deps: + * use caret notation for dependency versions + * encodeurl@^2.0.0 + * debug@^4.4.0 + * remove `ServerResponse.headersSent` support check + * remove setImmediate support check + * update test dependencies + * remove unnecessary devDependency `safe-buffer` + * remove `unpipe` package and use native `unpipe()` method + * remove unnecessary devDependency `readable-stream` + * refactor: use object spread to copy error headers + * refactor: use replaceAll instead of replace with a regex + * refactor: replace setHeaders function with optimized inline header setting + +v2.0.0 / 2024-09-02 +================== + + * drop support for node <18 + * ignore status message for HTTP/2 (#53) + +v1.3.1 / 2024-09-11 +================== + + * deps: encodeurl@~2.0.0 + +v1.3.0 / 2024-09-03 +================== + + * ignore status message for HTTP/2 (#53) + +v1.2.1 / 2024-09-02 +================== + + * Gracefully handle when handling an error and socket is null + +1.2.0 / 2022-03-22 +================== + + * Remove set content headers that break response + * deps: on-finished@2.4.1 + * deps: statuses@2.0.1 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +1.1.2 / 2019-05-09 +================== + + * Set stricter `Content-Security-Policy` header + * deps: parseurl@~1.3.3 + * deps: statuses@~1.5.0 + +1.1.1 / 2018-03-06 +================== + + * Fix 404 output for bad / missing pathnames + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +1.1.0 / 2017-09-24 +================== + + * Use `res.headersSent` when available + +1.0.6 / 2017-09-22 +================== + + * deps: debug@2.6.9 + +1.0.5 / 2017-09-15 +================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + +1.0.4 / 2017-08-03 +================== + + * deps: debug@2.6.8 + +1.0.3 / 2017-05-16 +================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + +1.0.2 / 2017-04-22 +================== + + * deps: debug@2.6.4 + - deps: ms@0.7.3 + +1.0.1 / 2017-03-21 +================== + + * Fix missing `` in HTML document + * deps: debug@2.6.3 + - Fix: `DEBUG_MAX_ARRAY_LENGTH` + +1.0.0 / 2017-02-15 +================== + + * Fix exception when `err` cannot be converted to a string + * Fully URL-encode the pathname in the 404 message + * Only include the pathname in the 404 message + * Send complete HTML document + * Set `Content-Security-Policy: default-src 'self'` header + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +0.5.1 / 2016-11-12 +================== + + * Fix exception when `err.headers` is not an object + * deps: statuses@~1.3.1 + * perf: hoist regular expressions + * perf: remove duplicate validation path + +0.5.0 / 2016-06-15 +================== + + * Change invalid or non-numeric status code to 500 + * Overwrite status message to match set status code + * Prefer `err.statusCode` if `err.status` is invalid + * Set response headers from `err.headers` object + * Use `statuses` instead of `http` module for status messages + - Includes all defined status messages + +0.4.1 / 2015-12-02 +================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + +0.4.0 / 2015-06-14 +================== + + * Fix a false-positive when unpiping in Node.js 0.8 + * Support `statusCode` property on `Error` objects + * Use `unpipe` module for unpiping requests + * deps: escape-html@1.0.2 + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * perf: enable strict mode + * perf: remove argument reassignment + +0.3.6 / 2015-05-11 +================== + + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +0.3.5 / 2015-04-22 +================== + + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + +0.3.4 / 2015-03-15 +================== + + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +0.3.3 / 2015-01-01 +================== + + * deps: debug@~2.1.1 + * deps: on-finished@~2.2.0 + +0.3.2 / 2014-10-22 +================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + +0.3.1 / 2014-10-16 +================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + +0.3.0 / 2014-09-17 +================== + + * Terminate in progress response only on error + * Use `on-finished` to determine request status + +0.2.0 / 2014-09-03 +================== + + * Set `X-Content-Type-Options: nosniff` header + * deps: debug@~2.0.0 + +0.1.0 / 2014-07-16 +================== + + * Respond after request fully read + - prevents hung responses and socket hang ups + * deps: debug@1.0.4 + +0.0.3 / 2014-07-11 +================== + + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + +0.0.2 / 2014-06-19 +================== + + * Handle invalid status codes + +0.0.1 / 2014-06-05 +================== + + * deps: debug@1.0.2 + +0.0.0 / 2014-06-05 +================== + + * Extracted from connect/express diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/LICENSE b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/LICENSE new file mode 100644 index 00000000..60221067 --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/README.md b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/README.md new file mode 100644 index 00000000..e40f729a --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/README.md @@ -0,0 +1,150 @@ +# finalhandler + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +Node.js function to invoke as the final step to respond to HTTP request. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install finalhandler +``` + +## API + +```js +const finalhandler = require('finalhandler') +``` + +### finalhandler(req, res, [options]) + +Returns function to be invoked as the final step for the given `req` and `res`. +This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will +write out a 404 response to the `res`. If it is truthy, an error response will +be written out to the `res` or `res` will be terminated if a response has already +started. + +When an error is written, the following information is added to the response: + + * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If + this value is outside the 4xx or 5xx range, it will be set to 500. + * The `res.statusMessage` is set according to the status code. + * The body will be the HTML of the status code message if `env` is + `'production'`, otherwise will be `err.stack`. + * Any headers specified in an `err.headers` object. + +The final handler will also unpipe anything from `req` when it is invoked. + +#### options.env + +By default, the environment is determined by `NODE_ENV` variable, but it can be +overridden by this option. + +#### options.onerror + +Provide a function to be called with the `err` when it exists. Can be used for +writing errors to a central location without excessive function generation. Called +as `onerror(err, req, res)`. + +## Examples + +### always 404 + +```js +const finalhandler = require('finalhandler') +const http = require('http') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res) + done() +}) + +server.listen(3000) +``` + +### perform simple action + +```js +const finalhandler = require('finalhandler') +const fs = require('fs') +const http = require('http') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res) + + fs.readFile('index.html', (err, buf) => { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) +``` + +### use with middleware-style functions + +```js +const finalhandler = require('finalhandler') +const http = require('http') +const serveStatic = require('serve-static') + +const serve = serveStatic('public') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res) + serve(req, res, done) +}) + +server.listen(3000) +``` + +### keep log of all errors + +```js +const finalhandler = require('finalhandler') +const fs = require('fs') +const http = require('http') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res, { onerror: logerror }) + + fs.readFile('index.html', (err, buf) => { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) + +function logerror (err) { + console.error(err.stack || err.toString()) +} +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/finalhandler.svg +[npm-url]: https://npmjs.org/package/finalhandler +[node-image]: https://img.shields.io/node/v/finalhandler.svg +[node-url]: https://nodejs.org/en/download +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master +[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg +[downloads-url]: https://npmjs.org/package/finalhandler +[github-actions-ci-image]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml/badge.svg +[github-actions-ci-url]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/pillarjs/finalhandler/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/pillarjs/finalhandler \ No newline at end of file diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/index.js b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/index.js new file mode 100644 index 00000000..bf15e484 --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/index.js @@ -0,0 +1,293 @@ +/*! + * finalhandler + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('finalhandler') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var onFinished = require('on-finished') +var parseUrl = require('parseurl') +var statuses = require('statuses') + +/** + * Module variables. + * @private + */ + +var isFinished = onFinished.isFinished + +/** + * Create a minimal HTML document. + * + * @param {string} message + * @private + */ + +function createHtmlDocument (message) { + var body = escapeHtml(message) + .replaceAll('\n', '
') + .replaceAll(' ', '  ') + + return '\n' + + '\n' + + '\n' + + '\n' + + 'Error\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Module exports. + * @public + */ + +module.exports = finalhandler + +/** + * Create a function to handle the final response. + * + * @param {Request} req + * @param {Response} res + * @param {Object} [options] + * @return {Function} + * @public + */ + +function finalhandler (req, res, options) { + var opts = options || {} + + // get environment + var env = opts.env || process.env.NODE_ENV || 'development' + + // get error callback + var onerror = opts.onerror + + return function (err) { + var headers + var msg + var status + + // ignore 404 on in-flight response + if (!err && res.headersSent) { + debug('cannot 404 after headers sent') + return + } + + // unhandled error + if (err) { + // respect status code from error + status = getErrorStatusCode(err) + + if (status === undefined) { + // fallback to status code on response + status = getResponseStatusCode(res) + } else { + // respect headers from error + headers = getErrorHeaders(err) + } + + // get error message + msg = getErrorMessage(err, status, env) + } else { + // not found + status = 404 + msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req)) + } + + debug('default %s', status) + + // schedule onerror callback + if (err && onerror) { + setImmediate(onerror, err, req, res) + } + + // cannot actually respond + if (res.headersSent) { + debug('cannot %d after headers sent', status) + if (req.socket) { + req.socket.destroy() + } + return + } + + // send response + send(req, res, status, headers, msg) + } +} + +/** + * Get headers from Error object. + * + * @param {Error} err + * @return {object} + * @private + */ + +function getErrorHeaders (err) { + if (!err.headers || typeof err.headers !== 'object') { + return undefined + } + + return { ...err.headers } +} + +/** + * Get message from Error object, fallback to status message. + * + * @param {Error} err + * @param {number} status + * @param {string} env + * @return {string} + * @private + */ + +function getErrorMessage (err, status, env) { + var msg + + if (env !== 'production') { + // use err.stack, which typically includes err.message + msg = err.stack + + // fallback to err.toString() when possible + if (!msg && typeof err.toString === 'function') { + msg = err.toString() + } + } + + return msg || statuses.message[status] +} + +/** + * Get status code from Error object. + * + * @param {Error} err + * @return {number} + * @private + */ + +function getErrorStatusCode (err) { + // check err.status + if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { + return err.status + } + + // check err.statusCode + if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode + } + + return undefined +} + +/** + * Get resource name for the request. + * + * This is typically just the original pathname of the request + * but will fallback to "resource" is that cannot be determined. + * + * @param {IncomingMessage} req + * @return {string} + * @private + */ + +function getResourceName (req) { + try { + return parseUrl.original(req).pathname + } catch (e) { + return 'resource' + } +} + +/** + * Get status code from response. + * + * @param {OutgoingMessage} res + * @return {number} + * @private + */ + +function getResponseStatusCode (res) { + var status = res.statusCode + + // default status code to 500 if outside valid range + if (typeof status !== 'number' || status < 400 || status > 599) { + status = 500 + } + + return status +} + +/** + * Send response. + * + * @param {IncomingMessage} req + * @param {OutgoingMessage} res + * @param {number} status + * @param {object} headers + * @param {string} message + * @private + */ + +function send (req, res, status, headers, message) { + function write () { + // response body + var body = createHtmlDocument(message) + + // response status + res.statusCode = status + + if (req.httpVersionMajor < 2) { + res.statusMessage = statuses.message[status] + } + + // remove any content headers + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Range') + + // response headers + for (const [key, value] of Object.entries(headers ?? {})) { + res.setHeader(key, value) + } + + // security headers + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + + // standard headers + res.setHeader('Content-Type', 'text/html; charset=utf-8') + res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')) + + if (req.method === 'HEAD') { + res.end() + return + } + + res.end(body, 'utf8') + } + + if (isFinished(req)) { + write() + return + } + + // unpipe everything from the request + req.unpipe() + + // flush the request + onFinished(req, write) + req.resume() +} diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/package.json b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/package.json new file mode 100644 index 00000000..869ddc2b --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/finalhandler/package.json @@ -0,0 +1,47 @@ +{ + "name": "finalhandler", + "description": "Node.js final http responder", + "version": "2.1.1", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "pillarjs/finalhandler", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "devDependencies": { + "eslint": "^7.32.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-markdown": "^2.2.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.2.0", + "eslint-plugin-standard": "^4.1.0", + "mocha": "^11.0.1", + "nyc": "^17.1.0", + "supertest": "^7.0.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 18.0.0" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-inspect": "mocha --reporter spec --inspect --inspect-brk test/" + } +} diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/on-finished b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/on-finished new file mode 120000 index 00000000..b66b17c9 --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/on-finished @@ -0,0 +1 @@ +../../on-finished@2.4.1/node_modules/on-finished \ No newline at end of file diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/parseurl b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/parseurl new file mode 120000 index 00000000..a6ebb8d4 --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/parseurl @@ -0,0 +1 @@ +../../parseurl@1.3.3/node_modules/parseurl \ No newline at end of file diff --git a/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/statuses b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/statuses new file mode 120000 index 00000000..26defda8 --- /dev/null +++ b/backend/node_modules/.pnpm/finalhandler@2.1.1/node_modules/statuses @@ -0,0 +1 @@ +../../statuses@2.0.2/node_modules/statuses \ No newline at end of file diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.editorconfig b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.editorconfig new file mode 100644 index 00000000..ac29adef --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 120 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.eslintrc b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.eslintrc new file mode 100644 index 00000000..9b811fa4 --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.eslintrc @@ -0,0 +1,30 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "func-style": 0, + "indent": [2, 4], + "max-nested-callbacks": [2, 3], + "max-params": [2, 3], + "max-statements": [2, 14], + "no-extra-parens": 0, + "no-invalid-this": 1, + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "max-statements-per-line": 0, + "no-magic-numbers": 0, + }, + }, + ], +} diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/FUNDING.yml b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/FUNDING.yml new file mode 100644 index 00000000..5ce5b3a6 --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/for-each +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/SECURITY.md b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/SECURITY.md new file mode 100644 index 00000000..82e4285a --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.github/SECURITY.md @@ -0,0 +1,3 @@ +# Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.nycrc b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.nycrc new file mode 100644 index 00000000..b7b8240a --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/.nycrc @@ -0,0 +1,8 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage" + ] +} diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/CHANGELOG.md b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/CHANGELOG.md new file mode 100644 index 00000000..06b5bc07 --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/CHANGELOG.md @@ -0,0 +1,107 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v0.3.5](https://github.com/ljharb/for-each/compare/v0.3.4...v0.3.5) - 2025-02-10 + +### Commits + +- [New] add types [`6483c1e`](https://github.com/ljharb/for-each/commit/6483c1e9b6177e5ca9ba506188300c5a25de26c2) + +## [v0.3.4](https://github.com/ljharb/for-each/compare/v0.3.3...v0.3.4) - 2025-01-24 + +### Commits + +- [meta] use `auto-changelog` [`c16ee6a`](https://github.com/ljharb/for-each/commit/c16ee6a125eb3c6d30f626b4b02ec849a63fca28) +- [Tests] add github actions [`379b59c`](https://github.com/ljharb/for-each/commit/379b59c8f282c2281ba668e3e028ad6410afb99b) +- [meta] delete `.travis.yml` [`09e5c77`](https://github.com/ljharb/for-each/commit/09e5c779651215c41bd4727e266a5e7ebb3b0a4d) +- [Dev Deps] update eslint things [`9163b86`](https://github.com/ljharb/for-each/commit/9163b86435be325965f096ac17793a0e783b1c1e) +- [meta] consolidate eslintrc files [`f2ab52b`](https://github.com/ljharb/for-each/commit/f2ab52b6944fe8c1a189957889276950393eddb3) +- [meta] add `funding` field and `FUNDING.yml` [`05d21b3`](https://github.com/ljharb/for-each/commit/05d21b382ccd4627b283d1a31c49935c7d79fd57) +- [Tests] up to `node` `v10`; use `nvm install-latest-npm` [`7c06cbd`](https://github.com/ljharb/for-each/commit/7c06cbdabea81ba029cd466545dea5cb9f24f528) +- [Tests] add `nyc` [`0f4643e`](https://github.com/ljharb/for-each/commit/0f4643e6a572bdc6967a17be8e7b959600edbbd2) +- [meta] use `npmignore` [`39a975c`](https://github.com/ljharb/for-each/commit/39a975c8c6050586b93b5e0a98b20be44d1b38d4) +- [meta] remove unnecessary `licenses` key [`3d064f1`](https://github.com/ljharb/for-each/commit/3d064f12167c12d8e1d1ee1447ee58d8211c63e1) +- [Tests] use `npm audit` instead of long-dead `nsp` [`d4c722a`](https://github.com/ljharb/for-each/commit/d4c722a0f61f61d93965328f436f87421bce9973) +- [Dev Deps] update `tape` [`552c1ae`](https://github.com/ljharb/for-each/commit/552c1ae6a01728ff312d47605dbdb961ef0ccbcc) +- Update README.md [`d19acc2`](https://github.com/ljharb/for-each/commit/d19acc23624eed9d8f59b9fa64e6e3cba638aa52) +- [meta] add missing `engines.node` [`8889b49`](https://github.com/ljharb/for-each/commit/8889b49bd737d7a72c2a515eb2ee39a01c813bac) +- [meta] create SECURITY.md [`9069d42`](https://github.com/ljharb/for-each/commit/9069d42d245b02ae7c5f0c193fceb55427436e4e) +- [Deps] update `is-callable` [`bfa51d1`](https://github.com/ljharb/for-each/commit/bfa51d18018477843147bcdcc6cc63eb045151f5) + +## [v0.3.3](https://github.com/ljharb/for-each/compare/v0.3.2...v0.3.3) - 2018-06-01 + +### Commits + +- Add `npm run lint`, `npm run jscs`, and `npm run eslint` [`4a17d99`](https://github.com/ljharb/for-each/commit/4a17d99d7397dd2356530d238e0e6c37ef34a1d5) +- Style cleanup: [`1df6824`](https://github.com/ljharb/for-each/commit/1df6824d96bfc293c0c9e6b78143b602c8d94986) +- Update `eslint`, `tape`; use my personal shared `eslint` config. [`b8e7d85`](https://github.com/ljharb/for-each/commit/b8e7d850ec9010a7171d34297f7af74b90f28aac) +- [Tests] remove jscs [`37e3557`](https://github.com/ljharb/for-each/commit/37e355784b4261dcf5004158a72c4b8a6c6c524f) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `tape`; fix scripts [`566045d`](https://github.com/ljharb/for-each/commit/566045d84f2ee5dff7cc14805c4fdb1d13d2624d) +- [Tests] up to `node` `v8`; newer npm breaks on older node [`07177dc`](https://github.com/ljharb/for-each/commit/07177dc9c8419b2a887c727ec576189a7c8e7837) +- Run `npm run lint` as part of tests. [`a34ea05`](https://github.com/ljharb/for-each/commit/a34ea05f729e0987007670d5693e093c56865ef6) +- Update `travis.yml` to test on the latest `node` and `io.js` [`354c843`](https://github.com/ljharb/for-each/commit/354c8434a166c7095c613e818c8d542fd1e2d630) +- Update `eslint` [`3601c93`](https://github.com/ljharb/for-each/commit/3601c9348e2cfb29ed3cfee352c2c95d4a8de87f) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`1aaff65`](https://github.com/ljharb/for-each/commit/1aaff65a55d8a054561251c6a2501c4dc42e1f99) +- Only use `Function#call` to call the callback if the receiver is supplied, for performance. [`54b4775`](https://github.com/ljharb/for-each/commit/54b477571b4d7c11edccafd94f2e16380892ee5d) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `nsp` [`6ba1cb8`](https://github.com/ljharb/for-each/commit/6ba1cb8a708e84ba4bb4067d31549829ec579d92) +- [Dev Deps] update `tape`, `eslint`, `jscs` [`8f5e1d5`](https://github.com/ljharb/for-each/commit/8f5e1d5fcabaf3abaa6ce2d3e6dd095f0dedfc4e) +- Add "license" to `package.json`, matching the LICENSE file. [`defc2c3`](https://github.com/ljharb/for-each/commit/defc2c35ffa7c9d4fbcf846f28b436f0083a381c) +- Update `eslint` [`05d1850`](https://github.com/ljharb/for-each/commit/05d18503dd0ec709f93df5c905bd2d0ce51323c3) +- [Tests] on `io.js` `v3.3`, `node` `v4.0` [`e8395a4`](https://github.com/ljharb/for-each/commit/e8395a43feef399299839c8d466ddd9dca0c3268) +- Add `npm run security` [`0a45177`](https://github.com/ljharb/for-each/commit/0a45177290b1de71094ddd322ef4a504458e901d) +- Only apps should have lockfiles. [`6268d7b`](https://github.com/ljharb/for-each/commit/6268d7b39edd06ef5a283c7afdb6c823077db777) +- [Dev Deps] update `nsp`, `tape`, `eslint` [`b95939f`](https://github.com/ljharb/for-each/commit/b95939f66a3dad590b3bc42c53535e77c1bfc114) +- Use `is-callable` instead of `is-function`, to cover ES6 environments with `Symbol.toStringTag` [`4095d33`](https://github.com/ljharb/for-each/commit/4095d334581c1caee92f595c299ffc479806dc3f) +- Test on `io.js` `v2.2` [`7b44f98`](https://github.com/ljharb/for-each/commit/7b44f98c217291a92385ddd3903d4974e049d762) +- Some old browsers choke on variables named "toString". [`4f1b626`](https://github.com/ljharb/for-each/commit/4f1b626eb91fcdc0e9018472a702aea713799190) +- Update `is-function`, `tape` [`3ceaf32`](https://github.com/ljharb/for-each/commit/3ceaf3240ef7d1b261cf510eb932cf540291187b) +- Test up to `io.js` `v3.0` [`3c1377a`](https://github.com/ljharb/for-each/commit/3c1377a31adf003323f4846a97e8f7c8fd51b5d2) +- [Deps] update `is-callable` [`f5c62d0`](https://github.com/ljharb/for-each/commit/f5c62d034b582a15bcb1f1cadace4e9c84f1780a) +- Test on `io.js` `v2.4` [`db86c85`](https://github.com/ljharb/for-each/commit/db86c85641d053a1dc4e570e8c8afbea915f78c0) +- Test on `io.js` `v2.3` [`2f04ca8`](https://github.com/ljharb/for-each/commit/2f04ca885adb4a8ccca658739f771a7f78522d03) + +## [v0.3.2](https://github.com/ljharb/for-each/compare/v0.3.1...v0.3.2) - 2014-01-07 + +### Merged + +- works down to IE6 [`#5`](https://github.com/ljharb/for-each/pull/5) + +## [v0.3.1](https://github.com/ljharb/for-each/compare/v0.3.0...v0.3.1) - 2014-01-06 + +## [v0.3.0](https://github.com/ljharb/for-each/compare/v0.2.0...v0.3.0) - 2014-01-06 + +### Merged + +- remove use of Object.keys [`#4`](https://github.com/ljharb/for-each/pull/4) +- Update tape. [`#3`](https://github.com/ljharb/for-each/pull/3) +- regex is not a function [`#2`](https://github.com/ljharb/for-each/pull/2) +- Add testling [`#1`](https://github.com/ljharb/for-each/pull/1) + +### Commits + +- Add testling. [`a24b521`](https://github.com/ljharb/for-each/commit/a24b52111937d509a3b5f58106c8835283de7146) +- Add array example to README [`9bd70c2`](https://github.com/ljharb/for-each/commit/9bd70c2ceafddfc734a80e0fea2bbac00afa963a) +- Regexes are considered functions in older browsers. [`403f649`](https://github.com/ljharb/for-each/commit/403f6490f903984adea1771af29c41fd2b1e4b64) +- Adding android browser to testling. [`a4c5825`](https://github.com/ljharb/for-each/commit/a4c5825bf8abd13589b9a9662c9d3deaf89cbf66) + +## [v0.2.0](https://github.com/ljharb/for-each/compare/v0.1.0...v0.2.0) - 2013-05-10 + +### Commits + +- Adding tests. [`7e74213`](https://github.com/ljharb/for-each/commit/7e74213d1b5d01b19249c3e3037302bd7fc74f1c) +- Adding proper array indexing, as well as string support. [`d36f794`](https://github.com/ljharb/for-each/commit/d36f794d6c0c5696bf1e4f8e79ae667858dfc11b) +- Use tape instead of tap. [`016a3cf`](https://github.com/ljharb/for-each/commit/016a3cf706c78037384d4c378b2ebe6e702cbb02) +- Requiring that the iterator is a function. [`cfedced`](https://github.com/ljharb/for-each/commit/cfedceda15ea2f7eb4acf079fb90ce17ec7da664) +- Adding myself as a contributor :-) [`ff28fca`](https://github.com/ljharb/for-each/commit/ff28fca8ec30f6fdbb7af87c74ed35688e60d07a) +- Adding node 0.10 to travis [`75f2460`](https://github.com/ljharb/for-each/commit/75f2460343d3ea58f91dad45f2eda478e3a4e412) + +## v0.1.0 - 2012-09-28 + +### Commits + +- first [`2d3a6ed`](https://github.com/ljharb/for-each/commit/2d3a6ed63036455847937cf00bec56b59ab36a9d) +- docs & travis [`ea4caad`](https://github.com/ljharb/for-each/commit/ea4caad8a8768992dcce29998e226484beed841c) diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/LICENSE b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/LICENSE new file mode 100644 index 00000000..53f19aa7 --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2012 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/README.md b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/README.md new file mode 100644 index 00000000..b76561ef --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/README.md @@ -0,0 +1,39 @@ +# for-each [![build status][1]][2] + +[![browser support][3]][4] + +A better forEach. + +## Example + +Like `Array.prototype.forEach` but works on objects. + +```js +var forEach = require("for-each") + +forEach({ key: "value" }, function (value, key, object) { + /* code */ +}) +``` + +As a bonus, it's also a perfectly function shim/polyfill for arrays too! + +```js +var forEach = require("for-each") + +forEach([1, 2, 3], function (value, index, array) { + /* code */ +}) +``` + +## Installation + +`npm install for-each` + +## MIT Licenced + + [1]: https://secure.travis-ci.org/Raynos/for-each.png + [2]: http://travis-ci.org/Raynos/for-each + [3]: https://ci.testling.com/Raynos/for-each.png + [4]: https://ci.testling.com/Raynos/for-each + diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.d.ts b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.d.ts new file mode 100644 index 00000000..90f98de4 --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.d.ts @@ -0,0 +1,35 @@ +declare function forEach( + arr: O, + callback: (this: This | void, value: O[number], index: number, array: O) => void, + thisArg?: This, +): void; + +declare function forEach, This = undefined>( + arr: O, + callback: (this: This | void, value: O[number], index: number, array: O) => void, + thisArg?: This, +): void; + +declare function forEach( + obj: O, + callback: (this: This | void, value: O[keyof O], key: keyof O, obj: O) => void, + thisArg?: This, +): void; + +declare function forEach( + str: O, + callback: (this: This | void, value: O[number], index: number, str: O) => void, + thisArg: This, +): void; + +export = forEach; + +declare function forEachInternal void, This = undefined>( + value: O, + callback: C, + thisArg?: This, +): void; + +declare namespace forEach { + export type _internal = typeof forEachInternal; +} diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js new file mode 100644 index 00000000..0af3c44e --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js @@ -0,0 +1,69 @@ +'use strict'; + +var isCallable = require('is-callable'); + +var toStr = Object.prototype.toString; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** @type {(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */ +var forEachArray = function forEachArray(array, iterator, receiver) { + for (var i = 0, len = array.length; i < len; i++) { + if (hasOwnProperty.call(array, i)) { + if (receiver == null) { + iterator(array[i], i, array); + } else { + iterator.call(receiver, array[i], i, array); + } + } + } +}; + +/** @type {(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */ +var forEachString = function forEachString(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + // no such thing as a sparse string. + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); + } + } +}; + +/** @type {(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */ +var forEachObject = function forEachObject(object, iterator, receiver) { + for (var k in object) { + if (hasOwnProperty.call(object, k)) { + if (receiver == null) { + iterator(object[k], k, object); + } else { + iterator.call(receiver, object[k], k, object); + } + } + } +}; + +/** @type {(x: unknown) => x is readonly unknown[]} */ +function isArray(x) { + return toStr.call(x) === '[object Array]'; +} + +/** @type {import('.')._internal} */ +module.exports = function forEach(list, iterator, thisArg) { + if (!isCallable(iterator)) { + throw new TypeError('iterator must be a function'); + } + + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + + if (isArray(list)) { + forEachArray(list, iterator, receiver); + } else if (typeof list === 'string') { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } +}; diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/package.json b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/package.json new file mode 100644 index 00000000..bf0f5cde --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/package.json @@ -0,0 +1,76 @@ +{ + "name": "for-each", + "version": "0.3.5", + "description": "A better forEach", + "keywords": [], + "author": "Raynos ", + "repository": { + "type": "git", + "url": "https://github.com/Raynos/for-each.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "index", + "homepage": "https://github.com/Raynos/for-each", + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "bugs": { + "url": "https://github.com/Raynos/for-each/issues", + "email": "raynos2@gmail.com" + }, + "license": "MIT", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/*.js'", + "posttest": "npx npm@\">= 10.2\" audit --production", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "dependencies": { + "is-callable": "^1.2.7" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.3", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/is-callable": "^1.1.2", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "eslint": "=8.8.0", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/test.js" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/test/test.js b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/test/test.js new file mode 100644 index 00000000..455d247e --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/test/test.js @@ -0,0 +1,224 @@ +'use strict'; + +var test = require('tape'); +var forEach = require('../'); + +test('forEach calls each iterator', function (t) { + var count = 0; + t.plan(4); + + forEach({ a: 1, b: 2 }, function (value, key) { + if (count === 0) { + t.equal(value, 1); + t.equal(key, 'a'); + } else { + t.equal(value, 2); + t.equal(key, 'b'); + } + count += 1; + }); +}); + +test('forEach calls iterator with correct this value', function (t) { + var thisValue = {}; + + t.plan(1); + + forEach([0], function () { + t.equal(this, thisValue); + }, thisValue); +}); + +test('second argument: iterator', function (t) { + /** @type {unknown[]} */ + var arr = []; + + // @ts-expect-error + t['throws'](function () { forEach(arr); }, TypeError, 'undefined is not a function'); + // @ts-expect-error + t['throws'](function () { forEach(arr, null); }, TypeError, 'null is not a function'); + // @ts-expect-error + t['throws'](function () { forEach(arr, ''); }, TypeError, 'string is not a function'); + // @ts-expect-error + t['throws'](function () { forEach(arr, /a/); }, TypeError, 'regex is not a function'); + // @ts-expect-error + t['throws'](function () { forEach(arr, true); }, TypeError, 'true is not a function'); + // @ts-expect-error + t['throws'](function () { forEach(arr, false); }, TypeError, 'false is not a function'); + // @ts-expect-error + t['throws'](function () { forEach(arr, NaN); }, TypeError, 'NaN is not a function'); + // @ts-expect-error + t['throws'](function () { forEach(arr, 42); }, TypeError, '42 is not a function'); + + t.doesNotThrow(function () { forEach(arr, function () {}); }, 'function is a function'); + // @ts-expect-error TODO fixme + t.doesNotThrow(function () { forEach(arr, setTimeout); }, 'setTimeout is a function'); + + /* eslint-env browser */ + if (typeof window !== 'undefined') { + t.doesNotThrow(function () { forEach(arr, window.alert); }, 'alert is a function'); + } + + t.end(); +}); + +test('array', function (t) { + var arr = /** @type {const} */ ([1, 2, 3]); + + t.test('iterates over every item', function (st) { + var index = 0; + forEach(arr, function () { index += 1; }); + st.equal(index, arr.length, 'iterates ' + arr.length + ' times'); + st.end(); + }); + + t.test('first iterator argument', function (st) { + var index = 0; + st.plan(arr.length); + + forEach(arr, function (item) { + st.equal(arr[index], item, 'item ' + index + ' is passed as first argument'); + index += 1; + }); + + st.end(); + }); + + t.test('second iterator argument', function (st) { + var counter = 0; + st.plan(arr.length); + + forEach(arr, function (_item, index) { + st.equal(counter, index, 'index ' + index + ' is passed as second argument'); + counter += 1; + }); + + st.end(); + }); + + t.test('third iterator argument', function (st) { + st.plan(arr.length); + + forEach(arr, function (_item, _index, array) { + st.deepEqual(arr, array, 'array is passed as third argument'); + }); + + st.end(); + }); + + t.test('context argument', function (st) { + var context = {}; + + forEach([], function () { + st.equal(this, context, '"this" is the passed context'); + }, context); + + st.end(); + }); + + t.end(); +}); + +test('object', function (t) { + var obj = { + a: 1, + b: 2, + c: 3 + }; + var keys = /** @type {const} */ (['a', 'b', 'c']); + + /** @constructor */ + function F() { + this.a = 1; + this.b = 2; + } + F.prototype.c = 3; + var fKeys = /** @type {const} */ (['a', 'b']); + + t.test('iterates over every object literal key', function (st) { + var counter = 0; + + forEach(obj, function () { counter += 1; }); + + st.equal(counter, keys.length, 'iterated ' + counter + ' times'); + + st.end(); + }); + + t.test('iterates only over own keys', function (st) { + var counter = 0; + + forEach(new F(), function () { counter += 1; }); + + st.equal(counter, fKeys.length, 'iterated ' + fKeys.length + ' times'); + + st.end(); + }); + + t.test('first iterator argument', function (st) { + var index = 0; + st.plan(keys.length); + + forEach(obj, function (item) { + st.equal(obj[keys[index]], item, 'item at key ' + keys[index] + ' is passed as first argument'); + index += 1; + }); + + st.end(); + }); + + t.test('second iterator argument', function (st) { + var counter = 0; + st.plan(keys.length); + + forEach(obj, function (_item, key) { + st.equal(keys[counter], key, 'key ' + key + ' is passed as second argument'); + counter += 1; + }); + + st.end(); + }); + + t.test('third iterator argument', function (st) { + st.plan(keys.length); + + forEach(obj, function (_item, _key, object) { + st.deepEqual(obj, object, 'object is passed as third argument'); + }); + + st.end(); + }); + + t.test('context argument', function (st) { + var context = {}; + + forEach({}, function () { + st.equal(this, context, '"this" is the passed context'); + }, context); + + st.end(); + }); + + t.end(); +}); + +test('string', function (t) { + var str = /** @type {const} */ ('str'); + + t.test('second iterator argument', function (st) { + var counter = 0; + st.plan((str.length * 2) + 1); + + forEach(str, function (item, index) { + st.equal(counter, index, 'index ' + index + ' is passed as second argument'); + st.equal(str.charAt(index), item); + counter += 1; + }); + + st.equal(counter, str.length, 'iterates ' + str.length + ' times'); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/tsconfig.json b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/tsconfig.json new file mode 100644 index 00000000..a6aec2c8 --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/is-callable b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/is-callable new file mode 120000 index 00000000..4b5393bf --- /dev/null +++ b/backend/node_modules/.pnpm/for-each@0.3.5/node_modules/is-callable @@ -0,0 +1 @@ +../../is-callable@1.2.7/node_modules/is-callable \ No newline at end of file diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.eslintrc b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.eslintrc new file mode 100644 index 00000000..71a054fd --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.eslintrc @@ -0,0 +1,21 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "indent": [2, 4], + "no-new-func": [1], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "max-lines-per-function": 0, + "strict": [0] + }, + }, + ], +} diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/FUNDING.yml b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/FUNDING.yml new file mode 100644 index 00000000..74482195 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/function-bind +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/SECURITY.md b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/SECURITY.md new file mode 100644 index 00000000..82e4285a --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.github/SECURITY.md @@ -0,0 +1,3 @@ +# Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.nycrc b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/CHANGELOG.md b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/CHANGELOG.md new file mode 100644 index 00000000..f9e6cc07 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/CHANGELOG.md @@ -0,0 +1,136 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.2](https://github.com/ljharb/function-bind/compare/v1.1.1...v1.1.2) - 2023-10-12 + +### Merged + +- Point to the correct file [`#16`](https://github.com/ljharb/function-bind/pull/16) + +### Commits + +- [Tests] migrate tests to Github Actions [`4f8b57c`](https://github.com/ljharb/function-bind/commit/4f8b57c02f2011fe9ae353d5e74e8745f0988af8) +- [Tests] remove `jscs` [`90eb2ed`](https://github.com/ljharb/function-bind/commit/90eb2edbeefd5b76cd6c3a482ea3454db169b31f) +- [meta] update `.gitignore` [`53fcdc3`](https://github.com/ljharb/function-bind/commit/53fcdc371cd66634d6e9b71c836a50f437e89fed) +- [Tests] up to `node` `v11.10`, `v10.15`, `v9.11`, `v8.15`, `v6.16`, `v4.9`; use `nvm install-latest-npm`; run audit script in tests [`1fe8f6e`](https://github.com/ljharb/function-bind/commit/1fe8f6e9aed0dfa8d8b3cdbd00c7f5ea0cd2b36e) +- [meta] add `auto-changelog` [`1921fcb`](https://github.com/ljharb/function-bind/commit/1921fcb5b416b63ffc4acad051b6aad5722f777d) +- [Robustness] remove runtime dependency on all builtins except `.apply` [`f743e61`](https://github.com/ljharb/function-bind/commit/f743e61aa6bb2360358c04d4884c9db853d118b7) +- Docs: enable badges; update wording [`503cb12`](https://github.com/ljharb/function-bind/commit/503cb12d998b5f91822776c73332c7adcd6355dd) +- [readme] update badges [`290c5db`](https://github.com/ljharb/function-bind/commit/290c5dbbbda7264efaeb886552a374b869a4bb48) +- [Tests] switch to nyc for coverage [`ea360ba`](https://github.com/ljharb/function-bind/commit/ea360ba907fc2601ed18d01a3827fa2d3533cdf8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`cae5e9e`](https://github.com/ljharb/function-bind/commit/cae5e9e07a5578dc6df26c03ee22851ce05b943c) +- [meta] add `funding` field; create FUNDING.yml [`c9f4274`](https://github.com/ljharb/function-bind/commit/c9f4274aa80ea3aae9657a3938fdba41a3b04ca6) +- [Tests] fix eslint errors from #15 [`f69aaa2`](https://github.com/ljharb/function-bind/commit/f69aaa2beb2fdab4415bfb885760a699d0b9c964) +- [actions] fix permissions [`99a0cd9`](https://github.com/ljharb/function-bind/commit/99a0cd9f3b5bac223a0d572f081834cd73314be7) +- [meta] use `npmignore` to autogenerate an npmignore file [`f03b524`](https://github.com/ljharb/function-bind/commit/f03b524ca91f75a109a5d062f029122c86ecd1ae) +- [Dev Deps] update `@ljharb/eslint‑config`, `eslint`, `tape` [`7af9300`](https://github.com/ljharb/function-bind/commit/7af930023ae2ce7645489532821e4fbbcd7a2280) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`64a9127`](https://github.com/ljharb/function-bind/commit/64a9127ab0bd331b93d6572eaf6e9971967fc08c) +- [Tests] use `aud` instead of `npm audit` [`e75069c`](https://github.com/ljharb/function-bind/commit/e75069c50010a8fcce2a9ce2324934c35fdb4386) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`d03555c`](https://github.com/ljharb/function-bind/commit/d03555ca59dea3b71ce710045e4303b9e2619e28) +- [meta] add `safe-publish-latest` [`9c8f809`](https://github.com/ljharb/function-bind/commit/9c8f8092aed027d7e80c94f517aa892385b64f09) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`baf6893`](https://github.com/ljharb/function-bind/commit/baf6893e27f5b59abe88bc1995e6f6ed1e527397) +- [meta] create SECURITY.md [`4db1779`](https://github.com/ljharb/function-bind/commit/4db17799f1f28ae294cb95e0081ca2b591c3911b) +- [Tests] add `npm run audit` [`c8b38ec`](https://github.com/ljharb/function-bind/commit/c8b38ec40ed3f85dabdee40ed4148f1748375bc2) +- Revert "Point to the correct file" [`05cdf0f`](https://github.com/ljharb/function-bind/commit/05cdf0fa205c6a3c5ba40bbedd1dfa9874f915c9) + +## [v1.1.1](https://github.com/ljharb/function-bind/compare/v1.1.0...v1.1.1) - 2017-08-28 + +### Commits + +- [Tests] up to `node` `v8`; newer npm breaks on older node; fix scripts [`817f7d2`](https://github.com/ljharb/function-bind/commit/817f7d28470fdbff8ef608d4d565dd4d1430bc5e) +- [Dev Deps] update `eslint`, `jscs`, `tape`, `@ljharb/eslint-config` [`854288b`](https://github.com/ljharb/function-bind/commit/854288b1b6f5c555f89aceb9eff1152510262084) +- [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`83e639f`](https://github.com/ljharb/function-bind/commit/83e639ff74e6cd6921285bccec22c1bcf72311bd) +- Only apps should have lockfiles [`5ed97f5`](https://github.com/ljharb/function-bind/commit/5ed97f51235c17774e0832e122abda0f3229c908) +- Use a SPDX-compliant “license” field. [`5feefea`](https://github.com/ljharb/function-bind/commit/5feefea0dc0193993e83e5df01ded424403a5381) + +## [v1.1.0](https://github.com/ljharb/function-bind/compare/v1.0.2...v1.1.0) - 2016-02-14 + +### Commits + +- Update `eslint`, `tape`; use my personal shared `eslint` config [`9c9062a`](https://github.com/ljharb/function-bind/commit/9c9062abbe9dd70b59ea2c3a3c3a81f29b457097) +- Add `npm run eslint` [`dd96c56`](https://github.com/ljharb/function-bind/commit/dd96c56720034a3c1ffee10b8a59a6f7c53e24ad) +- [New] return the native `bind` when available. [`82186e0`](https://github.com/ljharb/function-bind/commit/82186e03d73e580f95ff167e03f3582bed90ed72) +- [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`a3dd767`](https://github.com/ljharb/function-bind/commit/a3dd76720c795cb7f4586b0544efabf8aa107b8b) +- Update `eslint` [`3dae2f7`](https://github.com/ljharb/function-bind/commit/3dae2f7423de30a2d20313ddb1edc19660142fe9) +- Update `tape`, `covert`, `jscs` [`a181eee`](https://github.com/ljharb/function-bind/commit/a181eee0cfa24eb229c6e843a971f36e060a2f6a) +- [Tests] up to `node` `v5.6`, `v4.3` [`964929a`](https://github.com/ljharb/function-bind/commit/964929a6a4ddb36fb128de2bcc20af5e4f22e1ed) +- Test up to `io.js` `v2.1` [`2be7310`](https://github.com/ljharb/function-bind/commit/2be7310f2f74886a7124ca925be411117d41d5ea) +- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`45f3d68`](https://github.com/ljharb/function-bind/commit/45f3d6865c6ca93726abcef54febe009087af101) +- [Dev Deps] update `tape`, `jscs` [`6e1340d`](https://github.com/ljharb/function-bind/commit/6e1340d94642deaecad3e717825db641af4f8b1f) +- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`d9bad2b`](https://github.com/ljharb/function-bind/commit/d9bad2b778b1b3a6dd2876087b88b3acf319f8cc) +- Update `eslint` [`935590c`](https://github.com/ljharb/function-bind/commit/935590caa024ab356102e4858e8fc315b2ccc446) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`8c9a1ef`](https://github.com/ljharb/function-bind/commit/8c9a1efd848e5167887aa8501857a0940a480c57) +- Test on `io.js` `v2.2` [`9a3a38c`](https://github.com/ljharb/function-bind/commit/9a3a38c92013aed6e108666e7bd40969b84ac86e) +- Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures. [`69afc26`](https://github.com/ljharb/function-bind/commit/69afc2617405b147dd2a8d8ae73ca9e9283f18b4) +- [Dev Deps] Update `tape`, `eslint` [`36c1be0`](https://github.com/ljharb/function-bind/commit/36c1be0ab12b45fe5df6b0fdb01a5d5137fd0115) +- Update `tape`, `jscs` [`98d8303`](https://github.com/ljharb/function-bind/commit/98d8303cd5ca1c6b8f985469f86b0d44d7d45f6e) +- Update `jscs` [`9633a4e`](https://github.com/ljharb/function-bind/commit/9633a4e9fbf82051c240855166e468ba8ba0846f) +- Update `tape`, `jscs` [`c80ef0f`](https://github.com/ljharb/function-bind/commit/c80ef0f46efc9791e76fa50de4414092ac147831) +- Test up to `io.js` `v3.0` [`7e2c853`](https://github.com/ljharb/function-bind/commit/7e2c8537d52ab9cf5a655755561d8917684c0df4) +- Test on `io.js` `v2.4` [`5a199a2`](https://github.com/ljharb/function-bind/commit/5a199a27ba46795ba5eaf0845d07d4b8232895c9) +- Test on `io.js` `v2.3` [`a511b88`](https://github.com/ljharb/function-bind/commit/a511b8896de0bddf3b56862daa416c701f4d0453) +- Fixing a typo from 822b4e1938db02dc9584aa434fd3a45cb20caf43 [`732d6b6`](https://github.com/ljharb/function-bind/commit/732d6b63a9b33b45230e630dbcac7a10855d3266) +- Update `jscs` [`da52a48`](https://github.com/ljharb/function-bind/commit/da52a4886c06d6490f46ae30b15e4163ba08905d) +- Lock covert to v1.0.0. [`d6150fd`](https://github.com/ljharb/function-bind/commit/d6150fda1e6f486718ebdeff823333d9e48e7430) + +## [v1.0.2](https://github.com/ljharb/function-bind/compare/v1.0.1...v1.0.2) - 2014-10-04 + +## [v1.0.1](https://github.com/ljharb/function-bind/compare/v1.0.0...v1.0.1) - 2014-10-03 + +### Merged + +- make CI build faster [`#3`](https://github.com/ljharb/function-bind/pull/3) + +### Commits + +- Using my standard jscs.json [`d8ee94c`](https://github.com/ljharb/function-bind/commit/d8ee94c993eff0a84cf5744fe6a29627f5cffa1a) +- Adding `npm run lint` [`7571ab7`](https://github.com/ljharb/function-bind/commit/7571ab7dfdbd99b25a1dbb2d232622bd6f4f9c10) +- Using consistent indentation [`e91a1b1`](https://github.com/ljharb/function-bind/commit/e91a1b13a61e99ec1e530e299b55508f74218a95) +- Updating jscs [`7e17892`](https://github.com/ljharb/function-bind/commit/7e1789284bc629bc9c1547a61c9b227bbd8c7a65) +- Using consistent quotes [`c50b57f`](https://github.com/ljharb/function-bind/commit/c50b57fcd1c5ec38320979c837006069ebe02b77) +- Adding keywords [`cb94631`](https://github.com/ljharb/function-bind/commit/cb946314eed35f21186a25fb42fc118772f9ee00) +- Directly export a function expression instead of using a declaration, and relying on hoisting. [`5a33c5f`](https://github.com/ljharb/function-bind/commit/5a33c5f45642de180e0d207110bf7d1843ceb87c) +- Naming npm URL and badge in README; use SVG [`2aef8fc`](https://github.com/ljharb/function-bind/commit/2aef8fcb79d54e63a58ae557c4e60949e05d5e16) +- Naming deps URLs in README [`04228d7`](https://github.com/ljharb/function-bind/commit/04228d766670ee45ca24e98345c1f6a7621065b5) +- Naming travis-ci URLs in README; using SVG [`62c810c`](https://github.com/ljharb/function-bind/commit/62c810c2f54ced956cd4d4ab7b793055addfe36e) +- Make sure functions are invoked correctly (also passing coverage tests) [`2b289b4`](https://github.com/ljharb/function-bind/commit/2b289b4dfbf037ffcfa4dc95eb540f6165e9e43a) +- Removing the strict mode pragmas; they make tests fail. [`1aa701d`](https://github.com/ljharb/function-bind/commit/1aa701d199ddc3782476e8f7eef82679be97b845) +- Adding myself as a contributor [`85fd57b`](https://github.com/ljharb/function-bind/commit/85fd57b0860e5a7af42de9a287f3f265fc6d72fc) +- Adding strict mode pragmas [`915b08e`](https://github.com/ljharb/function-bind/commit/915b08e084c86a722eafe7245e21db74aa21ca4c) +- Adding devDeps URLs to README [`4ccc731`](https://github.com/ljharb/function-bind/commit/4ccc73112c1769859e4ca3076caf4086b3cba2cd) +- Fixing the description. [`a7a472c`](https://github.com/ljharb/function-bind/commit/a7a472cf649af515c635cf560fc478fbe48999c8) +- Using a function expression instead of a function declaration. [`b5d3e4e`](https://github.com/ljharb/function-bind/commit/b5d3e4ea6aaffc63888953eeb1fbc7ff45f1fa14) +- Updating tape [`f086be6`](https://github.com/ljharb/function-bind/commit/f086be6029fb56dde61a258c1340600fa174d1e0) +- Updating jscs [`5f9bdb3`](https://github.com/ljharb/function-bind/commit/5f9bdb375ab13ba48f30852aab94029520c54d71) +- Updating jscs [`9b409ba`](https://github.com/ljharb/function-bind/commit/9b409ba6118e23395a4e5d83ef39152aab9d3bfc) +- Run coverage as part of tests. [`8e1b6d4`](https://github.com/ljharb/function-bind/commit/8e1b6d459f047d1bd4fee814e01247c984c80bd0) +- Run linter as part of tests [`c1ca83f`](https://github.com/ljharb/function-bind/commit/c1ca83f832df94587d09e621beba682fabfaa987) +- Updating covert [`701e837`](https://github.com/ljharb/function-bind/commit/701e83774b57b4d3ef631e1948143f43a72f4bb9) + +## [v1.0.0](https://github.com/ljharb/function-bind/compare/v0.2.0...v1.0.0) - 2014-08-09 + +### Commits + +- Make sure old and unstable nodes don't fail Travis [`27adca3`](https://github.com/ljharb/function-bind/commit/27adca34a4ab6ad67b6dfde43942a1b103ce4d75) +- Fixing an issue when the bound function is called as a constructor in ES3. [`e20122d`](https://github.com/ljharb/function-bind/commit/e20122d267d92ce553859b280cbbea5d27c07731) +- Adding `npm run coverage` [`a2e29c4`](https://github.com/ljharb/function-bind/commit/a2e29c4ecaef9e2f6cd1603e868c139073375502) +- Updating tape [`b741168`](https://github.com/ljharb/function-bind/commit/b741168b12b235b1717ff696087645526b69213c) +- Upgrading tape [`63631a0`](https://github.com/ljharb/function-bind/commit/63631a04c7fbe97cc2fa61829cc27246d6986f74) +- Updating tape [`363cb46`](https://github.com/ljharb/function-bind/commit/363cb46dafb23cb3e347729a22f9448051d78464) + +## v0.2.0 - 2014-03-23 + +### Commits + +- Updating test coverage to match es5-shim. [`aa94d44`](https://github.com/ljharb/function-bind/commit/aa94d44b8f9d7f69f10e060db7709aa7a694e5d4) +- initial [`942ee07`](https://github.com/ljharb/function-bind/commit/942ee07e94e542d91798137bc4b80b926137e066) +- Setting the bound function's length properly. [`079f46a`](https://github.com/ljharb/function-bind/commit/079f46a2d3515b7c0b308c2c13fceb641f97ca25) +- Ensuring that some older browsers will throw when given a regex. [`36ac55b`](https://github.com/ljharb/function-bind/commit/36ac55b87f460d4330253c92870aa26fbfe8227f) +- Removing npm scripts that don't have dependencies [`9d2be60`](https://github.com/ljharb/function-bind/commit/9d2be600002cb8bc8606f8f3585ad3e05868c750) +- Updating tape [`297a4ac`](https://github.com/ljharb/function-bind/commit/297a4acc5464db381940aafb194d1c88f4e678f3) +- Skipping length tests for now. [`d9891ea`](https://github.com/ljharb/function-bind/commit/d9891ea4d2aaffa69f408339cdd61ff740f70565) +- don't take my tea [`dccd930`](https://github.com/ljharb/function-bind/commit/dccd930bfd60ea10cb178d28c97550c3bc8c1e07) diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/LICENSE b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/LICENSE new file mode 100644 index 00000000..62d6d237 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/README.md b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/README.md new file mode 100644 index 00000000..814c20b5 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/README.md @@ -0,0 +1,46 @@ +# function-bind [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] + +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Implementation of function.prototype.bind + +Old versions of phantomjs, Internet Explorer < 9, and node < 0.6 don't support `Function.prototype.bind`. + +## Example + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + +[package-url]: https://npmjs.org/package/function-bind +[npm-version-svg]: https://versionbadg.es/Raynos/function-bind.svg +[deps-svg]: https://david-dm.org/Raynos/function-bind.svg +[deps-url]: https://david-dm.org/Raynos/function-bind +[dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg +[dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/function-bind.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/function-bind.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/function-bind.svg +[downloads-url]: https://npm-stat.com/charts.html?package=function-bind +[codecov-image]: https://codecov.io/gh/Raynos/function-bind/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/Raynos/function-bind/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/Raynos/function-bind +[actions-url]: https://github.com/Raynos/function-bind/actions diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js new file mode 100644 index 00000000..fd4384cc --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js @@ -0,0 +1,84 @@ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var toStr = Object.prototype.toString; +var max = Math.max; +var funcType = '[object Function]'; + +var concatty = function concatty(a, b) { + var arr = []; + + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; + +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; + +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); + + }; + + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs[i] = '$' + i; + } + + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js new file mode 100644 index 00000000..3bb6b960 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/package.json b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/package.json new file mode 100644 index 00000000..61859638 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/package.json @@ -0,0 +1,87 @@ +{ + "name": "function-bind", + "version": "1.1.2", + "description": "Implementation of Function.prototype.bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "author": "Raynos ", + "repository": { + "type": "git", + "url": "https://github.com/Raynos/function-bind.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "index", + "homepage": "https://github.com/Raynos/function-bind", + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.3", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.1" + }, + "license": "MIT", + "scripts": { + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepack": "npmignore --auto --commentLines=autogenerated", + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "aud --production", + "tests-only": "nyc tape 'test/**/*.js'", + "lint": "eslint --ext=js,mjs .", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/.eslintrc b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/.eslintrc new file mode 100644 index 00000000..8a56d5b7 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/.eslintrc @@ -0,0 +1,9 @@ +{ + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-invalid-this": 0, + "no-magic-numbers": 0, + } +} diff --git a/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/index.js b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/index.js new file mode 100644 index 00000000..2edecce2 --- /dev/null +++ b/backend/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/test/index.js @@ -0,0 +1,252 @@ +// jscs:disable requireUseStrict + +var test = require('tape'); + +var functionBind = require('../implementation'); +var getCurrentContext = function () { return this; }; + +test('functionBind is a function', function (t) { + t.equal(typeof functionBind, 'function'); + t.end(); +}); + +test('non-functions', function (t) { + var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; + t.plan(nonFunctions.length); + for (var i = 0; i < nonFunctions.length; ++i) { + try { functionBind.call(nonFunctions[i]); } catch (ex) { + t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); + } + } + t.end(); +}); + +test('without a context', function (t) { + t.test('binds properly', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }) + }; + namespace.func(1, 2, 3); + st.deepEqual(args, [1, 2, 3]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('binds properly, and still supplies bound arguments', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, undefined, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.deepEqual(args, [1, 2, 3, 4, 5, 6]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('returns properly', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('called as a constructor', function (st) { + var thunkify = function (value) { + return function () { return value; }; + }; + st.test('returns object value', function (sst) { + var expectedReturnValue = [1, 2, 3]; + var Constructor = functionBind.call(thunkify(expectedReturnValue), null); + var result = new Constructor(); + sst.equal(result, expectedReturnValue); + sst.end(); + }); + + st.test('does not return primitive value', function (sst) { + var Constructor = functionBind.call(thunkify(42), null); + var result = new Constructor(); + sst.notEqual(result, 42); + sst.end(); + }); + + st.test('object from bound constructor is instance of original and bound constructor', function (sst) { + var A = function (x) { + this.name = x || 'A'; + }; + var B = functionBind.call(A, null, 'B'); + + var result = new B(); + sst.ok(result instanceof B, 'result is instance of bound constructor'); + sst.ok(result instanceof A, 'result is instance of original constructor'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('with a context', function (t) { + t.test('with no bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext) + }; + namespace.func(1, 2, 3); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); + st.end(); + }); + + t.test('with bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); + st.end(); + }); + + t.test('returns properly', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('passes the correct arguments when called as a constructor', function (st) { + var expected = { name: 'Correct' }; + var namespace = { + Func: functionBind.call(function (arg) { + return arg; + }, { name: 'Incorrect' }) + }; + var returned = new namespace.Func(expected); + st.equal(returned, expected, 'returns the right arg when called as a constructor'); + st.end(); + }); + + t.test('has the new instance\'s context when called as a constructor', function (st) { + var actualContext; + var expectedContext = { foo: 'bar' }; + var namespace = { + Func: functionBind.call(function () { + actualContext = this; + }, expectedContext) + }; + var result = new namespace.Func(); + st.equal(result instanceof namespace.Func, true); + st.notEqual(actualContext, expectedContext); + st.end(); + }); + + t.end(); +}); + +test('bound function length', function (t) { + t.test('sets a correct length without thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); +}); diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/call-bind-apply-helpers b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/call-bind-apply-helpers new file mode 120000 index 00000000..124bee97 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/call-bind-apply-helpers @@ -0,0 +1 @@ +../../call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-define-property b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-define-property new file mode 120000 index 00000000..21a4f5d0 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-define-property @@ -0,0 +1 @@ +../../es-define-property@1.0.1/node_modules/es-define-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-errors b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-object-atoms b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-object-atoms new file mode 120000 index 00000000..b740d742 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/es-object-atoms @@ -0,0 +1 @@ +../../es-object-atoms@1.1.2/node_modules/es-object-atoms \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/function-bind b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/function-bind new file mode 120000 index 00000000..62a99de1 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/function-bind @@ -0,0 +1 @@ +../../function-bind@1.1.2/node_modules/function-bind \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.eslintrc b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.eslintrc new file mode 100644 index 00000000..235fb79a --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.eslintrc @@ -0,0 +1,42 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + "es2017": true, + "es2020": true, + "es2021": true, + "es2022": true, + }, + + "globals": { + "Float16Array": false, + }, + + "rules": { + "array-bracket-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": 0, + "max-lines": 0, + "max-lines-per-function": [2, 90], + "max-params": [2, 4], + "max-statements": 0, + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "new-cap": 0, + }, + }, + ], +} diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.github/FUNDING.yml b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.github/FUNDING.yml new file mode 100644 index 00000000..8e8da0dd --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/get-intrinsic +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.nycrc b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/CHANGELOG.md b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/CHANGELOG.md new file mode 100644 index 00000000..ce1dd987 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/CHANGELOG.md @@ -0,0 +1,186 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.3.0](https://github.com/ljharb/get-intrinsic/compare/v1.2.7...v1.3.0) - 2025-02-22 + +### Commits + +- [Dev Deps] update `es-abstract`, `es-value-fixtures`, `for-each`, `object-inspect` [`9b61553`](https://github.com/ljharb/get-intrinsic/commit/9b61553c587f1c1edbd435597e88c7d387da97dd) +- [Deps] update `call-bind-apply-helpers`, `es-object-atoms`, `get-proto` [`a341fee`](https://github.com/ljharb/get-intrinsic/commit/a341fee0f39a403b0f0069e82c97642d5eb11043) +- [New] add `Float16Array` [`de22116`](https://github.com/ljharb/get-intrinsic/commit/de22116b492fb989a0341bceb6e573abfaed73dc) + +## [v1.2.7](https://github.com/ljharb/get-intrinsic/compare/v1.2.6...v1.2.7) - 2025-01-02 + +### Commits + +- [Refactor] use `get-proto` directly [`00ab955`](https://github.com/ljharb/get-intrinsic/commit/00ab95546a0980c8ad42a84253daaa8d2adcedf9) +- [Deps] update `math-intrinsics` [`c716cdd`](https://github.com/ljharb/get-intrinsic/commit/c716cdd6bbe36b438057025561b8bb5a879ac8a0) +- [Dev Deps] update `call-bound`, `es-abstract` [`dc648a6`](https://github.com/ljharb/get-intrinsic/commit/dc648a67eb359037dff8d8619bfa71d86debccb1) + +## [v1.2.6](https://github.com/ljharb/get-intrinsic/compare/v1.2.5...v1.2.6) - 2024-12-11 + +### Commits + +- [Refactor] use `math-intrinsics` [`841be86`](https://github.com/ljharb/get-intrinsic/commit/841be8641a9254c4c75483b30c8871b5d5065926) +- [Refactor] use `es-object-atoms` [`42057df`](https://github.com/ljharb/get-intrinsic/commit/42057dfa16f66f64787e66482af381cc6f31d2c1) +- [Deps] update `call-bind-apply-helpers` [`45afa24`](https://github.com/ljharb/get-intrinsic/commit/45afa24a9ee4d6d3c172db1f555b16cb27843ef4) +- [Dev Deps] update `call-bound` [`9cba9c6`](https://github.com/ljharb/get-intrinsic/commit/9cba9c6e70212bc163b7a5529cb25df46071646f) + +## [v1.2.5](https://github.com/ljharb/get-intrinsic/compare/v1.2.4...v1.2.5) - 2024-12-06 + +### Commits + +- [actions] split out node 10-20, and 20+ [`6e2b9dd`](https://github.com/ljharb/get-intrinsic/commit/6e2b9dd23902665681ebe453256ccfe21d7966f0) +- [Refactor] use `dunder-proto` and `call-bind-apply-helpers` instead of `has-proto` [`c095d17`](https://github.com/ljharb/get-intrinsic/commit/c095d179ad0f4fbfff20c8a3e0cb4fe668018998) +- [Refactor] use `gopd` [`9841d5b`](https://github.com/ljharb/get-intrinsic/commit/9841d5b35f7ab4fd2d193f0c741a50a077920e90) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `es-abstract`, `es-value-fixtures`, `gopd`, `mock-property`, `object-inspect`, `tape` [`2d07e01`](https://github.com/ljharb/get-intrinsic/commit/2d07e01310cee2cbaedfead6903df128b1f5d425) +- [Deps] update `gopd`, `has-proto`, `has-symbols`, `hasown` [`974d8bf`](https://github.com/ljharb/get-intrinsic/commit/974d8bf5baad7939eef35c25cc1dd88c10a30fa6) +- [Dev Deps] update `call-bind`, `es-abstract`, `tape` [`df9dde1`](https://github.com/ljharb/get-intrinsic/commit/df9dde178186631ab8a3165ede056549918ce4bc) +- [Refactor] cache `es-define-property` as well [`43ef543`](https://github.com/ljharb/get-intrinsic/commit/43ef543cb02194401420e3a914a4ca9168691926) +- [Deps] update `has-proto`, `has-symbols`, `hasown` [`ad4949d`](https://github.com/ljharb/get-intrinsic/commit/ad4949d5467316505aad89bf75f9417ed782f7af) +- [Tests] use `call-bound` directly [`ad5c406`](https://github.com/ljharb/get-intrinsic/commit/ad5c4069774bfe90e520a35eead5fe5ca9d69e80) +- [Deps] update `has-proto`, `hasown` [`45414ca`](https://github.com/ljharb/get-intrinsic/commit/45414caa312333a2798953682c68f85c550627dd) +- [Tests] replace `aud` with `npm audit` [`18d3509`](https://github.com/ljharb/get-intrinsic/commit/18d3509f79460e7924da70409ee81e5053087523) +- [Deps] update `es-define-property` [`aadaa3b`](https://github.com/ljharb/get-intrinsic/commit/aadaa3b2188d77ad9bff394ce5d4249c49eb21f5) +- [Dev Deps] add missing peer dep [`c296a16`](https://github.com/ljharb/get-intrinsic/commit/c296a16246d0c9a5981944f4cc5cf61fbda0cf6a) + +## [v1.2.4](https://github.com/ljharb/get-intrinsic/compare/v1.2.3...v1.2.4) - 2024-02-05 + +### Commits + +- [Refactor] use all 7 <+ ES6 Errors from `es-errors` [`bcac811`](https://github.com/ljharb/get-intrinsic/commit/bcac811abdc1c982e12abf848a410d6aae148d14) + +## [v1.2.3](https://github.com/ljharb/get-intrinsic/compare/v1.2.2...v1.2.3) - 2024-02-03 + +### Commits + +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`f11db9c`](https://github.com/ljharb/get-intrinsic/commit/f11db9c4fb97d87bbd53d3c73ac6b3db3613ad3b) +- [Dev Deps] update `aud`, `es-abstract`, `mock-property`, `npmignore` [`b7ac7d1`](https://github.com/ljharb/get-intrinsic/commit/b7ac7d1616fefb03877b1aed0c8f8d61aad32b6c) +- [meta] simplify `exports` [`faa0cc6`](https://github.com/ljharb/get-intrinsic/commit/faa0cc618e2830ffb51a8202490b0c215d965cbc) +- [meta] add missing `engines.node` [`774dd0b`](https://github.com/ljharb/get-intrinsic/commit/774dd0b3e8f741c3f05a6322d124d6087f146af1) +- [Dev Deps] update `tape` [`5828e8e`](https://github.com/ljharb/get-intrinsic/commit/5828e8e4a04e69312e87a36c0ea39428a7a4c3d8) +- [Robustness] use null objects for lookups [`eb9a11f`](https://github.com/ljharb/get-intrinsic/commit/eb9a11fa9eb3e13b193fcc05a7fb814341b1a7b7) +- [meta] add `sideEffects` flag [`89bcc7a`](https://github.com/ljharb/get-intrinsic/commit/89bcc7a42e19bf07b7c21e3094d5ab177109e6d2) + +## [v1.2.2](https://github.com/ljharb/get-intrinsic/compare/v1.2.1...v1.2.2) - 2023-10-20 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `call-bind`, `es-abstract`, `mock-property`, `object-inspect`, `tape` [`f51bcf2`](https://github.com/ljharb/get-intrinsic/commit/f51bcf26412d58d17ce17c91c9afd0ad271f0762) +- [Refactor] use `hasown` instead of `has` [`18d14b7`](https://github.com/ljharb/get-intrinsic/commit/18d14b799bea6b5765e1cec91890830cbcdb0587) +- [Deps] update `function-bind` [`6e109c8`](https://github.com/ljharb/get-intrinsic/commit/6e109c81e03804cc5e7824fb64353cdc3d8ee2c7) + +## [v1.2.1](https://github.com/ljharb/get-intrinsic/compare/v1.2.0...v1.2.1) - 2023-05-13 + +### Commits + +- [Fix] avoid a crash in envs without `__proto__` [`7bad8d0`](https://github.com/ljharb/get-intrinsic/commit/7bad8d061bf8721733b58b73a2565af2b6756b64) +- [Dev Deps] update `es-abstract` [`c60e6b7`](https://github.com/ljharb/get-intrinsic/commit/c60e6b7b4cf9660c7f27ed970970fd55fac48dc5) + +## [v1.2.0](https://github.com/ljharb/get-intrinsic/compare/v1.1.3...v1.2.0) - 2023-01-19 + +### Commits + +- [actions] update checkout action [`ca6b12f`](https://github.com/ljharb/get-intrinsic/commit/ca6b12f31eaacea4ea3b055e744cd61623385ffb) +- [Dev Deps] update `@ljharb/eslint-config`, `es-abstract`, `object-inspect`, `tape` [`41a3727`](https://github.com/ljharb/get-intrinsic/commit/41a3727d0026fa04273ae216a5f8e12eefd72da8) +- [Fix] ensure `Error.prototype` is undeniable [`c511e97`](https://github.com/ljharb/get-intrinsic/commit/c511e97ae99c764c4524b540dee7a70757af8da3) +- [Dev Deps] update `aud`, `es-abstract`, `tape` [`1bef8a8`](https://github.com/ljharb/get-intrinsic/commit/1bef8a8fd439ebb80863199b6189199e0851ac67) +- [Dev Deps] update `aud`, `es-abstract` [`0d41f16`](https://github.com/ljharb/get-intrinsic/commit/0d41f16bcd500bc28b7bfc98043ebf61ea081c26) +- [New] add `BigInt64Array` and `BigUint64Array` [`a6cca25`](https://github.com/ljharb/get-intrinsic/commit/a6cca25f29635889b7e9bd669baf9e04be90e48c) +- [Tests] use `gopd` [`ecf7722`](https://github.com/ljharb/get-intrinsic/commit/ecf7722240d15cfd16edda06acf63359c10fb9bd) + +## [v1.1.3](https://github.com/ljharb/get-intrinsic/compare/v1.1.2...v1.1.3) - 2022-09-12 + +### Commits + +- [Dev Deps] update `es-abstract`, `es-value-fixtures`, `tape` [`07ff291`](https://github.com/ljharb/get-intrinsic/commit/07ff291816406ebe5a12d7f16965bde0942dd688) +- [Fix] properly check for % signs [`50ac176`](https://github.com/ljharb/get-intrinsic/commit/50ac1760fe99c227e64eabde76e9c0e44cd881b5) + +## [v1.1.2](https://github.com/ljharb/get-intrinsic/compare/v1.1.1...v1.1.2) - 2022-06-08 + +### Fixed + +- [Fix] properly validate against extra % signs [`#16`](https://github.com/ljharb/get-intrinsic/issues/16) + +### Commits + +- [actions] reuse common workflows [`0972547`](https://github.com/ljharb/get-intrinsic/commit/0972547efd0abc863fe4c445a6ca7eb4f8c6901d) +- [meta] use `npmignore` to autogenerate an npmignore file [`5ba0b51`](https://github.com/ljharb/get-intrinsic/commit/5ba0b51d8d8d4f1c31d426d74abc0770fd106bad) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`c364492`](https://github.com/ljharb/get-intrinsic/commit/c364492af4af51333e6f81c0bf21fd3d602c3661) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `es-abstract`, `object-inspect`, `tape` [`dc04dad`](https://github.com/ljharb/get-intrinsic/commit/dc04dad86f6e5608775a2640cb0db5927ae29ed9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `es-abstract`, `object-inspect`, `safe-publish-latest`, `tape` [`1c14059`](https://github.com/ljharb/get-intrinsic/commit/1c1405984e86dd2dc9366c15d8a0294a96a146a5) +- [Tests] use `mock-property` [`b396ef0`](https://github.com/ljharb/get-intrinsic/commit/b396ef05bb73b1d699811abd64b0d9b97997fdda) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`c2c758d`](https://github.com/ljharb/get-intrinsic/commit/c2c758d3b90af4fef0a76910d8d3c292ec8d1d3e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`29e3c09`](https://github.com/ljharb/get-intrinsic/commit/29e3c091c2bf3e17099969847e8729d0e46896de) +- [actions] update codecov uploader [`8cbc141`](https://github.com/ljharb/get-intrinsic/commit/8cbc1418940d7a8941f3a7985cbc4ac095c5e13d) +- [Dev Deps] update `@ljharb/eslint-config`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`10b6f5c`](https://github.com/ljharb/get-intrinsic/commit/10b6f5c02593fb3680c581d696ac124e30652932) +- [readme] add github actions/codecov badges [`4e25400`](https://github.com/ljharb/get-intrinsic/commit/4e25400d9f51ae9eb059cbe22d9144e70ea214e8) +- [Tests] use `for-each` instead of `foreach` [`c05b957`](https://github.com/ljharb/get-intrinsic/commit/c05b957ad9a7bc7721af7cc9e9be1edbfe057496) +- [Dev Deps] update `es-abstract` [`29b05ae`](https://github.com/ljharb/get-intrinsic/commit/29b05aec3e7330e9ad0b8e0f685a9112c20cdd97) +- [meta] use `prepublishOnly` script for npm 7+ [`95c285d`](https://github.com/ljharb/get-intrinsic/commit/95c285da810516057d3bbfa871176031af38f05d) +- [Deps] update `has-symbols` [`593cb4f`](https://github.com/ljharb/get-intrinsic/commit/593cb4fb38e7922e40e42c183f45274b636424cd) +- [readme] fix repo URLs [`1c8305b`](https://github.com/ljharb/get-intrinsic/commit/1c8305b5365827c9b6fc785434aac0e1328ff2f5) +- [Deps] update `has-symbols` [`c7138b6`](https://github.com/ljharb/get-intrinsic/commit/c7138b6c6d73132d859471fb8c13304e1e7c8b20) +- [Dev Deps] remove unused `has-bigints` [`bd63aff`](https://github.com/ljharb/get-intrinsic/commit/bd63aff6ad8f3a986c557fcda2914187bdaab359) + +## [v1.1.1](https://github.com/ljharb/get-intrinsic/compare/v1.1.0...v1.1.1) - 2021-02-03 + +### Fixed + +- [meta] export `./package.json` [`#9`](https://github.com/ljharb/get-intrinsic/issues/9) + +### Commits + +- [readme] flesh out the readme; use `evalmd` [`d12f12c`](https://github.com/ljharb/get-intrinsic/commit/d12f12c15345a0a0772cc65a7c64369529abd614) +- [eslint] set up proper globals config [`5a8c098`](https://github.com/ljharb/get-intrinsic/commit/5a8c0984e3319d1ac0e64b102f8ec18b64e79f36) +- [Dev Deps] update `eslint` [`7b9a5c0`](https://github.com/ljharb/get-intrinsic/commit/7b9a5c0d31a90ca1a1234181c74988fb046701cd) + +## [v1.1.0](https://github.com/ljharb/get-intrinsic/compare/v1.0.2...v1.1.0) - 2021-01-25 + +### Fixed + +- [Refactor] delay `Function` eval until syntax-derived values are requested [`#3`](https://github.com/ljharb/get-intrinsic/issues/3) + +### Commits + +- [Tests] migrate tests to Github Actions [`2ab762b`](https://github.com/ljharb/get-intrinsic/commit/2ab762b48164aea8af37a40ba105bbc8246ab8c4) +- [meta] do not publish github action workflow files [`5e7108e`](https://github.com/ljharb/get-intrinsic/commit/5e7108e4768b244d48d9567ba4f8a6cab9c65b8e) +- [Tests] add some coverage [`01ac7a8`](https://github.com/ljharb/get-intrinsic/commit/01ac7a87ac29738567e8524cd8c9e026b1fa8cb3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `call-bind`, `es-abstract`, `tape`; add `call-bind` [`911b672`](https://github.com/ljharb/get-intrinsic/commit/911b672fbffae433a96924c6ce013585e425f4b7) +- [Refactor] rearrange evalled constructors a bit [`7e7e4bf`](https://github.com/ljharb/get-intrinsic/commit/7e7e4bf583f3799c8ac1c6c5e10d2cb553957347) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`0199968`](https://github.com/ljharb/get-intrinsic/commit/01999687a263ffce0a3cb011dfbcb761754aedbc) + +## [v1.0.2](https://github.com/ljharb/get-intrinsic/compare/v1.0.1...v1.0.2) - 2020-12-17 + +### Commits + +- [Fix] Throw for non‑existent intrinsics [`68f873b`](https://github.com/ljharb/get-intrinsic/commit/68f873b013c732a05ad6f5fc54f697e55515461b) +- [Fix] Throw for non‑existent segments in the intrinsic path [`8325dee`](https://github.com/ljharb/get-intrinsic/commit/8325deee43128f3654d3399aa9591741ebe17b21) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-bigints`, `object-inspect` [`0c227a7`](https://github.com/ljharb/get-intrinsic/commit/0c227a7d8b629166f25715fd242553892e458525) +- [meta] do not lint coverage output [`70d2419`](https://github.com/ljharb/get-intrinsic/commit/70d24199b620043cd9110fc5f426d214ebe21dc9) + +## [v1.0.1](https://github.com/ljharb/get-intrinsic/compare/v1.0.0...v1.0.1) - 2020-10-30 + +### Commits + +- [Tests] gather coverage data on every job [`d1d280d`](https://github.com/ljharb/get-intrinsic/commit/d1d280dec714e3f0519cc877dbcb193057d9cac6) +- [Fix] add missing dependencies [`5031771`](https://github.com/ljharb/get-intrinsic/commit/5031771bb1095b38be88ce7c41d5de88718e432e) +- [Tests] use `es-value-fixtures` [`af48765`](https://github.com/ljharb/get-intrinsic/commit/af48765a23c5323fb0b6b38dbf00eb5099c7bebc) + +## v1.0.0 - 2020-10-29 + +### Commits + +- Implementation [`bbce57c`](https://github.com/ljharb/get-intrinsic/commit/bbce57c6f33d05b2d8d3efa273ceeb3ee01127bb) +- Tests [`17b4f0d`](https://github.com/ljharb/get-intrinsic/commit/17b4f0d56dea6b4059b56fc30ef3ee4d9500ebc2) +- Initial commit [`3153294`](https://github.com/ljharb/get-intrinsic/commit/31532948de363b0a27dd9fd4649e7b7028ec4b44) +- npm init [`fb326c4`](https://github.com/ljharb/get-intrinsic/commit/fb326c4d2817c8419ec31de1295f06bb268a7902) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`48862fb`](https://github.com/ljharb/get-intrinsic/commit/48862fb2508c8f6a57968e6d08b7c883afc9d550) +- [meta] add `auto-changelog` [`5f28ad0`](https://github.com/ljharb/get-intrinsic/commit/5f28ad019e060a353d8028f9f2591a9cc93074a1) +- [meta] add "funding"; create `FUNDING.yml` [`c2bbdde`](https://github.com/ljharb/get-intrinsic/commit/c2bbddeba73a875be61484ee4680b129a6d4e0a1) +- [Tests] add `npm run lint` [`0a84b98`](https://github.com/ljharb/get-intrinsic/commit/0a84b98b22b7cf7a748666f705b0003a493c35fd) +- Only apps should have lockfiles [`9586c75`](https://github.com/ljharb/get-intrinsic/commit/9586c75866c1ee678e4d5d4dbbdef6997e511b05) diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/LICENSE b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/LICENSE new file mode 100644 index 00000000..48f05d01 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/README.md b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/README.md new file mode 100644 index 00000000..3aa0bba4 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/README.md @@ -0,0 +1,71 @@ +# get-intrinsic [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Get and robustly cache all JS language-level intrinsics at first require time. + +See the syntax described [in the JS spec](https://tc39.es/ecma262/#sec-well-known-intrinsic-objects) for reference. + +## Example + +```js +var GetIntrinsic = require('get-intrinsic'); +var assert = require('assert'); + +// static methods +assert.equal(GetIntrinsic('%Math.pow%'), Math.pow); +assert.equal(Math.pow(2, 3), 8); +assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); +delete Math.pow; +assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); + +// instance methods +var arr = [1]; +assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push); +assert.deepEqual(arr, [1]); + +arr.push(2); +assert.deepEqual(arr, [1, 2]); + +GetIntrinsic('%Array.prototype.push%').call(arr, 3); +assert.deepEqual(arr, [1, 2, 3]); + +delete Array.prototype.push; +GetIntrinsic('%Array.prototype.push%').call(arr, 4); +assert.deepEqual(arr, [1, 2, 3, 4]); + +// missing features +delete JSON.parse; // to simulate a real intrinsic that is missing in the environment +assert.throws(() => GetIntrinsic('%JSON.parse%')); +assert.equal(undefined, GetIntrinsic('%JSON.parse%', true)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/get-intrinsic +[npm-version-svg]: https://versionbadg.es/ljharb/get-intrinsic.svg +[deps-svg]: https://david-dm.org/ljharb/get-intrinsic.svg +[deps-url]: https://david-dm.org/ljharb/get-intrinsic +[dev-deps-svg]: https://david-dm.org/ljharb/get-intrinsic/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/get-intrinsic#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/get-intrinsic.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/get-intrinsic.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/get-intrinsic.svg +[downloads-url]: https://npm-stat.com/charts.html?package=get-intrinsic +[codecov-image]: https://codecov.io/gh/ljharb/get-intrinsic/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/get-intrinsic/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-intrinsic +[actions-url]: https://github.com/ljharb/get-intrinsic/actions diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js new file mode 100644 index 00000000..bd1d94b7 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js @@ -0,0 +1,378 @@ +'use strict'; + +var undefined; + +var $Object = require('es-object-atoms'); + +var $Error = require('es-errors'); +var $EvalError = require('es-errors/eval'); +var $RangeError = require('es-errors/range'); +var $ReferenceError = require('es-errors/ref'); +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); +var $URIError = require('es-errors/uri'); + +var abs = require('math-intrinsics/abs'); +var floor = require('math-intrinsics/floor'); +var max = require('math-intrinsics/max'); +var min = require('math-intrinsics/min'); +var pow = require('math-intrinsics/pow'); +var round = require('math-intrinsics/round'); +var sign = require('math-intrinsics/sign'); + +var $Function = Function; + +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = require('gopd'); +var $defineProperty = require('es-define-property'); + +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = require('get-proto'); +var $ObjectGPO = require('get-proto/Object.getPrototypeOf'); +var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf'); + +var $apply = require('call-bind-apply-helpers/functionApply'); +var $call = require('call-bind-apply-helpers/functionCall'); + +var needsEval = {}; + +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + __proto__: null, + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, + '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': $Error, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': $EvalError, + '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': $Object, + '%Object.getOwnPropertyDescriptor%': $gOPD, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': $RangeError, + '%ReferenceError%': $ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': $URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + + '%Function.prototype.call%': $call, + '%Function.prototype.apply%': $apply, + '%Object.defineProperty%': $defineProperty, + '%Object.getPrototypeOf%': $ObjectGPO, + '%Math.abs%': abs, + '%Math.floor%': floor, + '%Math.max%': max, + '%Math.min%': min, + '%Math.pow%': pow, + '%Math.round%': round, + '%Math.sign%': sign, + '%Reflect.getPrototypeOf%': $ReflectGPO +}; + +if (getProto) { + try { + null.error; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } +} + +var doEval = function doEval(name) { + var value; + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + + INTRINSICS[name] = value; + + return value; +}; + +var LEGACY_ALIASES = { + __proto__: null, + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; + +var bind = require('function-bind'); +var hasOwn = require('hasown'); +var $concat = bind.call($call, Array.prototype.concat); +var $spliceApply = bind.call($apply, Array.prototype.splice); +var $replace = bind.call($call, String.prototype.replace); +var $strSlice = bind.call($call, String.prototype.slice); +var $exec = bind.call($call, RegExp.prototype.exec); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ( + ( + (first === '"' || first === "'" || first === '`') + || (last === '"' || last === "'" || last === '`') + ) + && first !== last + ) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + return void undefined; + } + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/package.json b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/package.json new file mode 100644 index 00000000..2828e736 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/package.json @@ -0,0 +1,97 @@ +{ + "name": "get-intrinsic", + "version": "1.3.0", + "description": "Get and robustly cache all JS language-level intrinsics at first require time", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=.js,.mjs .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/get-intrinsic.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "intrinsic", + "getintrinsic", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/get-intrinsic/issues" + }, + "homepage": "https://github.com/ljharb/get-intrinsic#readme", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "auto-changelog": "^2.5.0", + "call-bound": "^1.0.3", + "encoding": "^0.1.13", + "es-abstract": "^1.23.9", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.5", + "make-async-function": "^1.0.0", + "make-async-generator-function": "^1.0.0", + "make-generator-function": "^2.0.0", + "mock-property": "^1.1.0", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "testling": { + "files": "test/GetIntrinsic.js" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/test/GetIntrinsic.js b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/test/GetIntrinsic.js new file mode 100644 index 00000000..d9c0f30a --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/test/GetIntrinsic.js @@ -0,0 +1,274 @@ +'use strict'; + +var GetIntrinsic = require('../'); + +var test = require('tape'); +var forEach = require('for-each'); +var debug = require('object-inspect'); +var generatorFns = require('make-generator-function')(); +var asyncFns = require('make-async-function').list(); +var asyncGenFns = require('make-async-generator-function')(); +var mockProperty = require('mock-property'); + +var callBound = require('call-bound'); +var v = require('es-value-fixtures'); +var $gOPD = require('gopd'); +var DefinePropertyOrThrow = require('es-abstract/2023/DefinePropertyOrThrow'); + +var $isProto = callBound('%Object.prototype.isPrototypeOf%'); + +test('export', function (t) { + t.equal(typeof GetIntrinsic, 'function', 'it is a function'); + t.equal(GetIntrinsic.length, 2, 'function has length of 2'); + + t.end(); +}); + +test('throws', function (t) { + t['throws']( + function () { GetIntrinsic('not an intrinsic'); }, + SyntaxError, + 'nonexistent intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic(''); }, + TypeError, + 'empty string intrinsic throws a type error' + ); + + t['throws']( + function () { GetIntrinsic('.'); }, + SyntaxError, + '"just a dot" intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic('%String'); }, + SyntaxError, + 'Leading % without trailing % throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic('String%'); }, + SyntaxError, + 'Trailing % without leading % throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic("String['prototype]"); }, + SyntaxError, + 'Dynamic property access is disallowed for intrinsics (unterminated string)' + ); + + t['throws']( + function () { GetIntrinsic('%Proxy.prototype.undefined%'); }, + TypeError, + "Throws when middle part doesn't exist (%Proxy.prototype.undefined%)" + ); + + t['throws']( + function () { GetIntrinsic('%Array.prototype%garbage%'); }, + SyntaxError, + 'Throws with extra percent signs' + ); + + t['throws']( + function () { GetIntrinsic('%Array.prototype%push%'); }, + SyntaxError, + 'Throws with extra percent signs, even on an existing intrinsic' + ); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { GetIntrinsic(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { GetIntrinsic('%', nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach([ + 'toString', + 'propertyIsEnumerable', + 'hasOwnProperty' + ], function (objectProtoMember) { + t['throws']( + function () { GetIntrinsic(objectProtoMember); }, + SyntaxError, + debug(objectProtoMember) + ' is not an intrinsic' + ); + }); + + t.end(); +}); + +test('base intrinsics', function (t) { + t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); + t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); + t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); + t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); + + t.end(); +}); + +test('dotted paths', function (t) { + t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); + t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); + t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); + t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); + + test('underscore paths are aliases for dotted paths', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) { + var original = GetIntrinsic('%ObjProto_toString%'); + + forEach([ + '%Object.prototype.toString%', + 'Object.prototype.toString', + '%ObjectPrototype.toString%', + 'ObjectPrototype.toString', + '%ObjProto_toString%', + 'ObjProto_toString' + ], function (name) { + DefinePropertyOrThrow(Object.prototype, 'toString', { + '[[Value]]': function toString() { + return original.apply(this, arguments); + } + }); + st.equal(GetIntrinsic(name), original, name + ' yields original Object.prototype.toString'); + }); + + DefinePropertyOrThrow(Object.prototype, 'toString', { '[[Value]]': original }); + st.end(); + }); + + test('dotted paths cache', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) { + var original = GetIntrinsic('%Object.prototype.propertyIsEnumerable%'); + + forEach([ + '%Object.prototype.propertyIsEnumerable%', + 'Object.prototype.propertyIsEnumerable', + '%ObjectPrototype.propertyIsEnumerable%', + 'ObjectPrototype.propertyIsEnumerable' + ], function (name) { + var restore = mockProperty(Object.prototype, 'propertyIsEnumerable', { + value: function propertyIsEnumerable() { + return original.apply(this, arguments); + } + }); + st.equal(GetIntrinsic(name), original, name + ' yields cached Object.prototype.propertyIsEnumerable'); + + restore(); + }); + + st.end(); + }); + + test('dotted path reports correct error', function (st) { + st['throws'](function () { + GetIntrinsic('%NonExistentIntrinsic.prototype.property%'); + }, /%NonExistentIntrinsic%/, 'The base intrinsic of %NonExistentIntrinsic.prototype.property% is %NonExistentIntrinsic%'); + + st['throws'](function () { + GetIntrinsic('%NonExistentIntrinsicPrototype.property%'); + }, /%NonExistentIntrinsicPrototype%/, 'The base intrinsic of %NonExistentIntrinsicPrototype.property% is %NonExistentIntrinsicPrototype%'); + + st.end(); + }); + + t.end(); +}); + +test('accessors', { skip: !$gOPD || typeof Map !== 'function' }, function (t) { + var actual = $gOPD(Map.prototype, 'size'); + t.ok(actual, 'Map.prototype.size has a descriptor'); + t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); + t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); + t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); + + t.end(); +}); + +test('generator functions', { skip: !generatorFns.length }, function (t) { + var $GeneratorFunction = GetIntrinsic('%GeneratorFunction%'); + var $GeneratorFunctionPrototype = GetIntrinsic('%Generator%'); + var $GeneratorPrototype = GetIntrinsic('%GeneratorPrototype%'); + + forEach(generatorFns, function (genFn) { + var fnName = genFn.name; + fnName = fnName ? "'" + fnName + "'" : 'genFn'; + + t.ok(genFn instanceof $GeneratorFunction, fnName + ' instanceof %GeneratorFunction%'); + t.ok($isProto($GeneratorFunctionPrototype, genFn), '%Generator% is prototype of ' + fnName); + t.ok($isProto($GeneratorPrototype, genFn.prototype), '%GeneratorPrototype% is prototype of ' + fnName + '.prototype'); + }); + + t.end(); +}); + +test('async functions', { skip: !asyncFns.length }, function (t) { + var $AsyncFunction = GetIntrinsic('%AsyncFunction%'); + var $AsyncFunctionPrototype = GetIntrinsic('%AsyncFunctionPrototype%'); + + forEach(asyncFns, function (asyncFn) { + var fnName = asyncFn.name; + fnName = fnName ? "'" + fnName + "'" : 'asyncFn'; + + t.ok(asyncFn instanceof $AsyncFunction, fnName + ' instanceof %AsyncFunction%'); + t.ok($isProto($AsyncFunctionPrototype, asyncFn), '%AsyncFunctionPrototype% is prototype of ' + fnName); + }); + + t.end(); +}); + +test('async generator functions', { skip: asyncGenFns.length === 0 }, function (t) { + var $AsyncGeneratorFunction = GetIntrinsic('%AsyncGeneratorFunction%'); + var $AsyncGeneratorFunctionPrototype = GetIntrinsic('%AsyncGenerator%'); + var $AsyncGeneratorPrototype = GetIntrinsic('%AsyncGeneratorPrototype%'); + + forEach(asyncGenFns, function (asyncGenFn) { + var fnName = asyncGenFn.name; + fnName = fnName ? "'" + fnName + "'" : 'asyncGenFn'; + + t.ok(asyncGenFn instanceof $AsyncGeneratorFunction, fnName + ' instanceof %AsyncGeneratorFunction%'); + t.ok($isProto($AsyncGeneratorFunctionPrototype, asyncGenFn), '%AsyncGenerator% is prototype of ' + fnName); + t.ok($isProto($AsyncGeneratorPrototype, asyncGenFn.prototype), '%AsyncGeneratorPrototype% is prototype of ' + fnName + '.prototype'); + }); + + t.end(); +}); + +test('%ThrowTypeError%', function (t) { + var $ThrowTypeError = GetIntrinsic('%ThrowTypeError%'); + + t.equal(typeof $ThrowTypeError, 'function', 'is a function'); + t['throws']( + $ThrowTypeError, + TypeError, + '%ThrowTypeError% throws a TypeError' + ); + + t.end(); +}); + +test('allowMissing', { skip: asyncGenFns.length > 0 }, function (t) { + t['throws']( + function () { GetIntrinsic('%AsyncGeneratorPrototype%'); }, + TypeError, + 'throws when missing' + ); + + t.equal( + GetIntrinsic('%AsyncGeneratorPrototype%', true), + undefined, + 'does not throw when allowMissing' + ); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-proto b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-proto new file mode 120000 index 00000000..aef0e9ea --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-proto @@ -0,0 +1 @@ +../../get-proto@1.0.1/node_modules/get-proto \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/gopd b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/gopd new file mode 120000 index 00000000..3e8fbc1b --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/gopd @@ -0,0 +1 @@ +../../gopd@1.2.0/node_modules/gopd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/has-symbols b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/has-symbols new file mode 120000 index 00000000..8440b139 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/has-symbols @@ -0,0 +1 @@ +../../has-symbols@1.1.0/node_modules/has-symbols \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/hasown b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/hasown new file mode 120000 index 00000000..4bdce949 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/hasown @@ -0,0 +1 @@ +../../hasown@2.0.4/node_modules/hasown \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/math-intrinsics b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/math-intrinsics new file mode 120000 index 00000000..185fe798 --- /dev/null +++ b/backend/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/math-intrinsics @@ -0,0 +1 @@ +../../math-intrinsics@1.1.0/node_modules/math-intrinsics \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/dunder-proto b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/dunder-proto new file mode 120000 index 00000000..0e376884 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/dunder-proto @@ -0,0 +1 @@ +../../dunder-proto@1.0.1/node_modules/dunder-proto \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/es-object-atoms b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/es-object-atoms new file mode 120000 index 00000000..b740d742 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/es-object-atoms @@ -0,0 +1 @@ +../../es-object-atoms@1.1.2/node_modules/es-object-atoms \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.eslintrc b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.eslintrc new file mode 100644 index 00000000..1d21a8ae --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.eslintrc @@ -0,0 +1,10 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": "off", + "sort-keys": "off", + }, +} diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.github/FUNDING.yml b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.github/FUNDING.yml new file mode 100644 index 00000000..93183ef5 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/get-proto +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.nycrc b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/CHANGELOG.md b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/CHANGELOG.md new file mode 100644 index 00000000..58602293 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/get-proto/compare/v1.0.0...v1.0.1) - 2025-01-02 + +### Commits + +- [Fix] for the `Object.getPrototypeOf` window, throw for non-objects [`7fe6508`](https://github.com/ljharb/get-proto/commit/7fe6508b71419ebe1976bedb86001d1feaeaa49a) + +## v1.0.0 - 2025-01-01 + +### Commits + +- Initial implementation, tests, readme, types [`5c70775`](https://github.com/ljharb/get-proto/commit/5c707751e81c3deeb2cf980d185fc7fd43611415) +- Initial commit [`7c65c2a`](https://github.com/ljharb/get-proto/commit/7c65c2ad4e33d5dae2f219ebe1a046ae2256972c) +- npm init [`0b8cf82`](https://github.com/ljharb/get-proto/commit/0b8cf824c9634e4a34ef7dd2a2cdc5be6ac79518) +- Only apps should have lockfiles [`a6d1bff`](https://github.com/ljharb/get-proto/commit/a6d1bffc364f5828377cea7194558b2dbef7aea2) diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/LICENSE b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/LICENSE new file mode 100644 index 00000000..eeabd1c3 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.d.ts b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.d.ts new file mode 100644 index 00000000..028b3ff1 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.d.ts @@ -0,0 +1,5 @@ +declare function getProto(object: O): object | null; + +declare const x: typeof getProto | null; + +export = x; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js new file mode 100644 index 00000000..c2cbbdfc --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js @@ -0,0 +1,6 @@ +'use strict'; + +var $Object = require('es-object-atoms'); + +/** @type {import('./Object.getPrototypeOf')} */ +module.exports = $Object.getPrototypeOf || null; diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/README.md b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/README.md new file mode 100644 index 00000000..f8b4cce3 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/README.md @@ -0,0 +1,50 @@ +# get-proto [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robustly get the [[Prototype]] of an object. Uses the best available method. + +## Getting started + +```sh +npm install --save get-proto +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getProto = require('get-proto'); + +const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' }; +const b = { c: 3, __proto__: a }; + +assert.equal(getProto(b), a); +assert.equal(getProto(a), Object.prototype); +assert.equal(getProto({ __proto__: null }), null); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/get-proto +[npm-version-svg]: https://versionbadg.es/ljharb/get-proto.svg +[deps-svg]: https://david-dm.org/ljharb/get-proto.svg +[deps-url]: https://david-dm.org/ljharb/get-proto +[dev-deps-svg]: https://david-dm.org/ljharb/get-proto/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/get-proto#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/get-proto.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/get-proto.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/get-proto.svg +[downloads-url]: https://npm-stat.com/charts.html?package=get-proto +[codecov-image]: https://codecov.io/gh/ljharb/get-proto/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/get-proto/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-proto +[actions-url]: https://github.com/ljharb/get-proto/actions diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.d.ts b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.d.ts new file mode 100644 index 00000000..2388fe07 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.d.ts @@ -0,0 +1,3 @@ +declare const x: typeof Reflect.getPrototypeOf | null; + +export = x; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js new file mode 100644 index 00000000..e6c51bee --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./Reflect.getPrototypeOf')} */ +module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.d.ts b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.d.ts new file mode 100644 index 00000000..2c021f30 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.d.ts @@ -0,0 +1,5 @@ +declare function getProto(object: O): object | null; + +declare const x: typeof getProto | null; + +export = x; diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js new file mode 100644 index 00000000..7e5747be --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js @@ -0,0 +1,27 @@ +'use strict'; + +var reflectGetProto = require('./Reflect.getPrototypeOf'); +var originalGetProto = require('./Object.getPrototypeOf'); + +var getDunderProto = require('dunder-proto/get'); + +/** @type {import('.')} */ +module.exports = reflectGetProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return reflectGetProto(O); + } + : originalGetProto + ? function getProto(O) { + if (!O || (typeof O !== 'object' && typeof O !== 'function')) { + throw new TypeError('getProto: not an object'); + } + // @ts-expect-error TS can't narrow inside a closure, for some reason + return originalGetProto(O); + } + : getDunderProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return getDunderProto(O); + } + : null; diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/package.json b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/package.json new file mode 100644 index 00000000..9c35cec9 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/package.json @@ -0,0 +1,81 @@ +{ + "name": "get-proto", + "version": "1.0.1", + "description": "Robustly get the [[Prototype]] of an object", + "main": "index.js", + "exports": { + ".": "./index.js", + "./Reflect.getPrototypeOf": "./Reflect.getPrototypeOf.js", + "./Object.getPrototypeOf": "./Object.getPrototypeOf.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "pretest": "npm run --silent lint", + "test": "npm run tests-only", + "posttest": "npx npm@\">=10.2\" audit --production", + "tests-only": "nyc tape 'test/**/*.js'", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/get-proto.git" + }, + "keywords": [ + "get", + "proto", + "prototype", + "getPrototypeOf", + "[[Prototype]]" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/get-proto/issues" + }, + "homepage": "https://github.com/ljharb/get-proto#readme", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.2", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "testling": { + "files": "test/index.js" + } +} diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/test/index.js b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/test/index.js new file mode 100644 index 00000000..5a2ece25 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/test/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var test = require('tape'); + +var getProto = require('../'); + +test('getProto', function (t) { + t.equal(typeof getProto, 'function', 'is a function'); + + t.test('can get', { skip: !getProto }, function (st) { + if (getProto) { // TS doesn't understand tape's skip + var proto = { b: 2 }; + st.equal(getProto(proto), Object.prototype, 'proto: returns the [[Prototype]]'); + + st.test('nullish value', function (s2t) { + // @ts-expect-error + s2t['throws'](function () { return getProto(undefined); }, TypeError, 'undefined is not an object'); + // @ts-expect-error + s2t['throws'](function () { return getProto(null); }, TypeError, 'null is not an object'); + s2t.end(); + }); + + // @ts-expect-error + st['throws'](function () { getProto(true); }, 'throws for true'); + // @ts-expect-error + st['throws'](function () { getProto(false); }, 'throws for false'); + // @ts-expect-error + st['throws'](function () { getProto(42); }, 'throws for 42'); + // @ts-expect-error + st['throws'](function () { getProto(NaN); }, 'throws for NaN'); + // @ts-expect-error + st['throws'](function () { getProto(0); }, 'throws for +0'); + // @ts-expect-error + st['throws'](function () { getProto(-0); }, 'throws for -0'); + // @ts-expect-error + st['throws'](function () { getProto(Infinity); }, 'throws for ∞'); + // @ts-expect-error + st['throws'](function () { getProto(-Infinity); }, 'throws for -∞'); + // @ts-expect-error + st['throws'](function () { getProto(''); }, 'throws for empty string'); + // @ts-expect-error + st['throws'](function () { getProto('foo'); }, 'throws for non-empty string'); + st.equal(getProto(/a/g), RegExp.prototype); + st.equal(getProto(new Date()), Date.prototype); + st.equal(getProto(function () {}), Function.prototype); + st.equal(getProto([]), Array.prototype); + st.equal(getProto({}), Object.prototype); + + var nullObject = { __proto__: null }; + if ('toString' in nullObject) { + st.comment('no null objects in this engine'); + st.equal(getProto(nullObject), Object.prototype, '"null" object has Object.prototype as [[Prototype]]'); + } else { + st.equal(getProto(nullObject), null, 'null object has null [[Prototype]]'); + } + } + + st.end(); + }); + + t.test('can not get', { skip: !!getProto }, function (st) { + st.equal(getProto, null); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/tsconfig.json b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/tsconfig.json new file mode 100644 index 00000000..60fb90e4 --- /dev/null +++ b/backend/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + //"target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.eslintrc b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.eslintrc new file mode 100644 index 00000000..e2550c0f --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-style": [2, "declaration"], + "id-length": 0, + "multiline-comment-style": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.github/FUNDING.yml b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.github/FUNDING.yml new file mode 100644 index 00000000..94a44a8e --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/gopd +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/CHANGELOG.md b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/CHANGELOG.md new file mode 100644 index 00000000..87f5727f --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/CHANGELOG.md @@ -0,0 +1,45 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.2.0](https://github.com/ljharb/gopd/compare/v1.1.0...v1.2.0) - 2024-12-03 + +### Commits + +- [New] add `gOPD` entry point; remove `get-intrinsic` [`5b61232`](https://github.com/ljharb/gopd/commit/5b61232dedea4591a314bcf16101b1961cee024e) + +## [v1.1.0](https://github.com/ljharb/gopd/compare/v1.0.1...v1.1.0) - 2024-11-29 + +### Commits + +- [New] add types [`f585e39`](https://github.com/ljharb/gopd/commit/f585e397886d270e4ba84e53d226e4f9ca2eb0e6) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `tape` [`0b8e4fd`](https://github.com/ljharb/gopd/commit/0b8e4fded64397a7726a9daa144a6cc9a5e2edfa) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`48378b2`](https://github.com/ljharb/gopd/commit/48378b2443f09a4f7efbd0fb6c3ee845a6cabcf3) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`78099ee`](https://github.com/ljharb/gopd/commit/78099eeed41bfdc134c912280483689cc8861c31) +- [Tests] replace `aud` with `npm audit` [`4e0d0ac`](https://github.com/ljharb/gopd/commit/4e0d0ac47619d24a75318a8e1f543ee04b2a2632) +- [meta] add missing `engines.node` [`1443316`](https://github.com/ljharb/gopd/commit/14433165d07835c680155b3dfd62d9217d735eca) +- [Deps] update `get-intrinsic` [`eee5f51`](https://github.com/ljharb/gopd/commit/eee5f51769f3dbaf578b70e2a3199116b01aa670) +- [Deps] update `get-intrinsic` [`550c378`](https://github.com/ljharb/gopd/commit/550c3780e3a9c77b62565712a001b4ed64ea61f5) +- [Dev Deps] add missing peer dep [`8c2ecf8`](https://github.com/ljharb/gopd/commit/8c2ecf848122e4e30abfc5b5086fb48b390dce75) + +## [v1.0.1](https://github.com/ljharb/gopd/compare/v1.0.0...v1.0.1) - 2022-11-01 + +### Commits + +- [Fix] actually export gOPD instead of dP [`4b624bf`](https://github.com/ljharb/gopd/commit/4b624bfbeff788c5e3ff16d9443a83627847234f) + +## v1.0.0 - 2022-11-01 + +### Commits + +- Initial implementation, tests, readme [`0911e01`](https://github.com/ljharb/gopd/commit/0911e012cd642092bd88b732c161c58bf4f20bea) +- Initial commit [`b84e33f`](https://github.com/ljharb/gopd/commit/b84e33f5808a805ac57ff88d4247ad935569acbe) +- [actions] add reusable workflows [`12ae28a`](https://github.com/ljharb/gopd/commit/12ae28ae5f50f86e750215b6e2188901646d0119) +- npm init [`280118b`](https://github.com/ljharb/gopd/commit/280118badb45c80b4483836b5cb5315bddf6e582) +- [meta] add `auto-changelog` [`bb78de5`](https://github.com/ljharb/gopd/commit/bb78de5639a180747fb290c28912beaaf1615709) +- [meta] create FUNDING.yml; add `funding` in package.json [`11c22e6`](https://github.com/ljharb/gopd/commit/11c22e6355bb01f24e7fac4c9bb3055eb5b25002) +- [meta] use `npmignore` to autogenerate an npmignore file [`4f4537a`](https://github.com/ljharb/gopd/commit/4f4537a843b39f698c52f072845092e6fca345bb) +- Only apps should have lockfiles [`c567022`](https://github.com/ljharb/gopd/commit/c567022a18573aa7951cf5399445d9840e23e98b) diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/LICENSE b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/LICENSE new file mode 100644 index 00000000..6abfe143 --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/README.md b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/README.md new file mode 100644 index 00000000..784e56a0 --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/README.md @@ -0,0 +1,40 @@ +# gopd [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation. + +## Usage + +```javascript +var gOPD = require('gopd'); +var assert = require('assert'); + +if (gOPD) { + assert.equal(typeof gOPD, 'function', 'descriptors supported'); + // use gOPD like Object.getOwnPropertyDescriptor here +} else { + assert.ok(!gOPD, 'descriptors not supported'); +} +``` + +[package-url]: https://npmjs.org/package/gopd +[npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg +[deps-svg]: https://david-dm.org/ljharb/gopd.svg +[deps-url]: https://david-dm.org/ljharb/gopd +[dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/gopd.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/gopd.svg +[downloads-url]: https://npm-stat.com/charts.html?package=gopd +[codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/gopd/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd +[actions-url]: https://github.com/ljharb/gopd/actions diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.d.ts b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.d.ts new file mode 100644 index 00000000..def48a3c --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.d.ts @@ -0,0 +1 @@ +export = Object.getOwnPropertyDescriptor; diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js new file mode 100644 index 00000000..cf9616c4 --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./gOPD')} */ +module.exports = Object.getOwnPropertyDescriptor; diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.d.ts b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.d.ts new file mode 100644 index 00000000..e228065f --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.d.ts @@ -0,0 +1,5 @@ +declare function gOPD(obj: O, prop: K): PropertyDescriptor | undefined; + +declare const fn: typeof gOPD | undefined | null; + +export = fn; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js new file mode 100644 index 00000000..a4081b01 --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js @@ -0,0 +1,15 @@ +'use strict'; + +/** @type {import('.')} */ +var $gOPD = require('./gOPD'); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/package.json b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/package.json new file mode 100644 index 00000000..01c5ffa6 --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/package.json @@ -0,0 +1,77 @@ +{ + "name": "gopd", + "version": "1.2.0", + "description": "`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./gOPD": "./gOPD.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "tsc -p . && attw -P", + "lint": "eslint --ext=js,mjs .", + "postlint": "evalmd README.md", + "pretest": "npm run lint", + "tests-only": "tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/gopd.git" + }, + "keywords": [ + "ecmascript", + "javascript", + "getownpropertydescriptor", + "property", + "descriptor" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/gopd/issues" + }, + "homepage": "https://github.com/ljharb/gopd#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.0", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/test/index.js b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/test/index.js new file mode 100644 index 00000000..6f43453a --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/test/index.js @@ -0,0 +1,36 @@ +'use strict'; + +var test = require('tape'); +var gOPD = require('../'); + +test('gOPD', function (t) { + t.test('supported', { skip: !gOPD }, function (st) { + st.equal(typeof gOPD, 'function', 'is a function'); + + var obj = { x: 1 }; + st.ok('x' in obj, 'property exists'); + + // @ts-expect-error TS can't figure out narrowing from `skip` + var desc = gOPD(obj, 'x'); + st.deepEqual( + desc, + { + configurable: true, + enumerable: true, + value: 1, + writable: true + }, + 'descriptor is as expected' + ); + + st.end(); + }); + + t.test('not supported', { skip: !!gOPD }, function (st) { + st.notOk(gOPD, 'is falsy'); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/tsconfig.json b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/tsconfig.json new file mode 100644 index 00000000..d9a6668c --- /dev/null +++ b/backend/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql new file mode 120000 index 00000000..153725b3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql @@ -0,0 +1 @@ +../../graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/LICENSE b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/LICENSE new file mode 100644 index 00000000..35bf1481 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/README.md b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/README.md new file mode 100644 index 00000000..3802b5c6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/README.md @@ -0,0 +1,251 @@ +# graphql-tag +[![npm version](https://badge.fury.io/js/graphql-tag.svg)](https://badge.fury.io/js/graphql-tag) +[![Build Status](https://travis-ci.org/apollographql/graphql-tag.svg?branch=master)](https://travis-ci.org/apollographql/graphql-tag) +[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](http://www.apollodata.com/#slack) + +Helpful utilities for parsing GraphQL queries. Includes: + +- `gql` A JavaScript template literal tag that parses GraphQL query strings into the standard GraphQL AST. +- `/loader` A webpack loader to preprocess queries + +`graphql-tag` uses [the reference `graphql` library](https://github.com/graphql/graphql-js) under the hood as a peer dependency, so in addition to installing this module, you'll also have to install `graphql`. + +### gql + +The `gql` template literal tag can be used to concisely write a GraphQL query that is parsed into a standard GraphQL AST. It is the recommended method for passing queries to [Apollo Client](https://github.com/apollographql/apollo-client). While it is primarily built for Apollo Client, it generates a generic GraphQL AST which can be used by any GraphQL client. + +```js +import gql from 'graphql-tag'; + +const query = gql` + { + user(id: 5) { + firstName + lastName + } + } +` +``` + +The above query now contains the following syntax tree. + +```js +{ + "kind": "Document", + "definitions": [ + { + "kind": "OperationDefinition", + "operation": "query", + "name": null, + "variableDefinitions": null, + "directives": [], + "selectionSet": { + "kind": "SelectionSet", + "selections": [ + { + "kind": "Field", + "alias": null, + "name": { + "kind": "Name", + "value": "user", + ... + } + } + ] + } + } + ] +} +``` + +#### Fragments + +The `gql` tag can also be used to define reusable fragments, which can easily be added to queries or other fragments. + +```js +import gql from 'graphql-tag'; + +const userFragment = gql` + fragment User_user on User { + firstName + lastName + } +` +``` + +The above `userFragment` document can be embedded in another document using a template literal placeholder. + +```js +const query = gql` + { + user(id: 5) { + ...User_user + } + } + ${userFragment} +` +``` + +**Note:** _While it may seem redundant to have to both embed the `userFragment` variable in the template literal **AND** spread the `...User_user` fragment in the graphQL selection set, this requirement makes static analysis by tools such as `eslint-plugin-graphql` possible._ + +#### Why use this? + +GraphQL strings are the right way to write queries in your code, because they can be statically analyzed using tools like [eslint-plugin-graphql](https://github.com/apollographql/eslint-plugin-graphql). However, strings are inconvenient to manipulate, if you are trying to do things like add extra fields, merge multiple queries together, or other interesting stuff. + +That's where this package comes in - it lets you write your queries with [ES2015 template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) and compile them into an AST with the `gql` tag. + +#### Caching parse results + +This package only has one feature - it caches previous parse results in a simple dictionary. This means that if you call the tag on the same query multiple times, it doesn't waste time parsing it again. It also means you can use `===` to compare queries to check if they are identical. + + +### Importing graphQL files + +_To add support for importing `.graphql`/`.gql` files, see [Webpack loading and preprocessing](#webpack-loading-and-preprocessing) below._ + +Given a file `MyQuery.graphql` + +```graphql +query MyQuery { + ... +} +``` + +If you have configured [the webpack graphql-tag/loader](#webpack-loading-and-preprocessing), you can import modules containing graphQL queries. The imported value will be the pre-built AST. + +```js +import MyQuery from 'query.graphql' +``` + +#### Importing queries by name + +You can also import query and fragment documents by name. + +```graphql +query MyQuery1 { + ... +} + +query MyQuery2 { + ... +} +``` + +And in your JavaScript: + +```javascript +import { MyQuery1, MyQuery2 } from 'query.graphql' +``` + +### Preprocessing queries and fragments + +Preprocessing GraphQL queries and fragments into ASTs at build time can greatly improve load times. + +#### Babel preprocessing + +GraphQL queries can be compiled at build time using [babel-plugin-graphql-tag](https://github.com/gajus/babel-plugin-graphql-tag). Pre-compiling queries decreases script initialization time and reduces bundle sizes by potentially removing the need for `graphql-tag` at runtime. + +#### TypeScript preprocessing + +Try this custom transformer to pre-compile your GraphQL queries in TypeScript: [ts-transform-graphql-tag](https://github.com/firede/ts-transform-graphql-tag). + +#### React Native and Next.js preprocessing + +Preprocessing queries via the webpack loader is not always possible. [babel-plugin-import-graphql](https://www.npmjs.com/package/babel-plugin-import-graphql) supports importing graphql files directly into your JavaScript by preprocessing GraphQL queries into ASTs at compile-time. + +E.g.: + +```javascript +import myImportedQuery from './productsQuery.graphql' + +class ProductsPage extends React.Component { + ... +} +``` + +#### Webpack loading and preprocessing + +Using the included `graphql-tag/loader` it is possible to maintain query logic that is separate from the rest of your application logic. With the loader configured, imported graphQL files will be converted to AST during the webpack build process. + +_**Example webpack configuration**_ + +```js +{ + ... + loaders: [ + { + test: /\.(graphql|gql)$/, + exclude: /node_modules/, + loader: 'graphql-tag/loader' + } + ], + ... +} +``` + +#### Create React App + +Preprocessing GraphQL imports is supported in **create-react-app** >= v2 using [evenchange4/graphql.macro](https://github.com/evenchange4/graphql.macro). + +For **create-react-app** < v2, you'll either need to eject or use [react-app-rewire-inline-import-graphql-ast](https://www.npmjs.com/package/react-app-rewire-inline-import-graphql-ast). + +#### Testing + +Testing environments that don't support Webpack require additional configuration. For [Jest](https://facebook.github.io/jest/) use [jest-transform-graphql](https://github.com/remind101/jest-transform-graphql). + +#### Support for fragments + +With the webpack loader, you can import fragments by name: + +In a file called `query.gql`: + +```graphql +fragment MyFragment1 on MyType1 { + ... +} + +fragment MyFragment2 on MyType2 { + ... +} +``` + +And in your JavaScript: + +```javascript +import { MyFragment1, MyFragment2 } from 'query.gql' +``` + +Note: If your fragment references other fragments, the resulting document will +have multiple fragments in it. In this case you must still specify the fragment name when using the fragment. For example, with `@apollo/client` you would specify the `fragmentName` option when using the fragment for cache operations. + +### Warnings + +This package will emit a warning if you have multiple fragments of the same name. You can disable this with: + +```js +import { disableFragmentWarnings } from 'graphql-tag'; + +disableFragmentWarnings() +``` + +### Experimental Fragment Variables + +This package exports an `experimentalFragmentVariables` flag that allows you to use experimental support for [parameterized fragments](https://github.com/facebook/graphql/issues/204). + +You can enable / disable this with: + +```js +import { enableExperimentalFragmentVariables, disableExperimentalFragmentVariables } from 'graphql-tag'; +``` + +Enabling this feature allows you to declare documents of the form. + +```graphql +fragment SomeFragment ($arg: String!) on SomeType { + someField +} +``` + +### Resources + +You can easily generate and explore a GraphQL AST on [astexplorer.net](https://astexplorer.net/#/drYr8X1rnP/1). diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js new file mode 100644 index 00000000..ee6d8897 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js @@ -0,0 +1,137 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('graphql')) : + typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'graphql'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["graphql-tag"] = {}, global.tslib, global.graphql)); +})(this, (function (exports, tslib, graphql) { 'use strict'; + + var docCache = new Map(); + var fragmentSourceMap = new Map(); + var printFragmentWarnings = true; + var experimentalFragmentVariables = false; + function normalize(string) { + return string.replace(/[\s,]+/g, ' ').trim(); + } + function cacheKeyFromLoc(loc) { + return normalize(loc.source.body.substring(loc.start, loc.end)); + } + function processFragments(ast) { + var seenKeys = new Set(); + var definitions = []; + ast.definitions.forEach(function (fragmentDefinition) { + if (fragmentDefinition.kind === 'FragmentDefinition') { + var fragmentName = fragmentDefinition.name.value; + var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); + var sourceKeySet = fragmentSourceMap.get(fragmentName); + if (sourceKeySet && !sourceKeySet.has(sourceKey)) { + if (printFragmentWarnings) { + console.warn("Warning: fragment with name " + fragmentName + " already exists.\n" + + "graphql-tag enforces all fragment names across your application to be unique; read more about\n" + + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"); + } + } + else if (!sourceKeySet) { + fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); + } + sourceKeySet.add(sourceKey); + if (!seenKeys.has(sourceKey)) { + seenKeys.add(sourceKey); + definitions.push(fragmentDefinition); + } + } + else { + definitions.push(fragmentDefinition); + } + }); + return tslib.__assign(tslib.__assign({}, ast), { definitions: definitions }); + } + function stripLoc(doc) { + var workSet = new Set(doc.definitions); + workSet.forEach(function (node) { + if (node.loc) + delete node.loc; + Object.keys(node).forEach(function (key) { + var value = node[key]; + if (value && typeof value === 'object') { + workSet.add(value); + } + }); + }); + var loc = doc.loc; + if (loc) { + delete loc.startToken; + delete loc.endToken; + } + return doc; + } + function parseDocument(source) { + var cacheKey = normalize(source); + if (!docCache.has(cacheKey)) { + var parsed = graphql.parse(source, { + experimentalFragmentVariables: experimentalFragmentVariables, + allowLegacyFragmentVariables: experimentalFragmentVariables, + experimentalFragmentArguments: experimentalFragmentVariables + }); + if (!parsed || parsed.kind !== 'Document') { + throw new Error('Not a valid GraphQL document.'); + } + docCache.set(cacheKey, stripLoc(processFragments(parsed))); + } + return docCache.get(cacheKey); + } + function gql(literals) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + if (typeof literals === 'string') { + literals = [literals]; + } + var result = literals[0]; + args.forEach(function (arg, i) { + if (arg && arg.kind === 'Document') { + result += arg.loc.source.body; + } + else { + result += arg; + } + result += literals[i + 1]; + }); + return parseDocument(result); + } + function resetCaches() { + docCache.clear(); + fragmentSourceMap.clear(); + } + function disableFragmentWarnings() { + printFragmentWarnings = false; + } + function enableExperimentalFragmentVariables() { + experimentalFragmentVariables = true; + } + function disableExperimentalFragmentVariables() { + experimentalFragmentVariables = false; + } + var extras = { + gql: gql, + resetCaches: resetCaches, + disableFragmentWarnings: disableFragmentWarnings, + enableExperimentalFragmentVariables: enableExperimentalFragmentVariables, + disableExperimentalFragmentVariables: disableExperimentalFragmentVariables + }; + (function (gql_1) { + gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables; + })(gql || (gql = {})); + gql["default"] = gql; + var gql$1 = gql; + + exports["default"] = gql$1; + exports.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables; + exports.disableFragmentWarnings = disableFragmentWarnings; + exports.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables; + exports.gql = gql; + exports.resetCaches = resetCaches; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=graphql-tag.umd.js.map diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow new file mode 100644 index 00000000..7acb6237 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow @@ -0,0 +1,7 @@ +// @flow + +import type { DocumentNode } from 'graphql'; + +declare export default function gql(literals: any, ...placeholders: any[]): DocumentNode; +declare export function resetCaches(): void; +declare export function disableFragmentWarnings(): void; diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.map b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.map new file mode 100644 index 00000000..a5eeafe3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/graphql-tag.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql-tag.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { parse } from 'graphql';\n\nimport {\n DocumentNode,\n DefinitionNode,\n Location,\n} from 'graphql/language/ast';\n\n// A map docString -> graphql document\nconst docCache = new Map();\n\n// A map fragmentName -> [normalized source]\nconst fragmentSourceMap = new Map>();\n\nlet printFragmentWarnings = true;\nlet experimentalFragmentVariables = false;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string: string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\nfunction cacheKeyFromLoc(loc: Location) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nfunction processFragments(ast: DocumentNode) {\n const seenKeys = new Set();\n const definitions: DefinitionNode[] = [];\n\n ast.definitions.forEach(fragmentDefinition => {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc!);\n\n // We know something about this fragment\n let sourceKeySet = fragmentSourceMap.get(fragmentName)!;\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n } else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n\n sourceKeySet.add(sourceKey);\n\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n });\n\n return {\n ...ast,\n definitions,\n };\n}\n\nfunction stripLoc(doc: DocumentNode) {\n const workSet = new Set>(doc.definitions);\n\n workSet.forEach(node => {\n if (node.loc) delete node.loc;\n Object.keys(node).forEach(key => {\n const value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n\n const loc = doc.loc as Record;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n\n return doc;\n}\n\nfunction parseDocument(source: string) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n const parsed = parse(source, {\n // graphql 14,15,16\n experimentalFragmentVariables,\n // graphql 14\n allowLegacyFragmentVariables: experimentalFragmentVariables,\n // graphql 17\n experimentalFragmentArguments: experimentalFragmentVariables,\n } as any);\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(\n cacheKey,\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n stripLoc(processFragments(parsed)),\n );\n }\n return docCache.get(cacheKey)!;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nexport function gql(\n literals: string | readonly string[],\n ...args: any[]\n) {\n\n if (typeof literals === 'string') {\n literals = [literals];\n }\n\n let result = literals[0];\n\n args.forEach((arg, i) => {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n } else {\n result += arg;\n }\n result += literals[i + 1];\n });\n\n return parseDocument(result);\n}\n\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\n\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\nconst extras = {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n};\n\nexport namespace gql {\n export const {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n } = extras;\n}\n\ngql.default = gql;\n\nexport default gql;\n"],"names":["__assign","parse"],"m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GAAG,GAQnB,EAAA,CAAA,CAAA,CAAA;IAED,GAAG,CAAC,SAAO,CAAA,GAAG,GAAG,CAAC;AAElB,gBAAe,GAAG;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts new file mode 100644 index 00000000..5164fac9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts @@ -0,0 +1,15 @@ +import { DocumentNode } from 'graphql/language/ast'; +export declare function gql(literals: string | readonly string[], ...args: any[]): DocumentNode; +export declare namespace gql { + var _a: typeof import(".").gql; + export { _a as default }; +} +export declare function resetCaches(): void; +export declare function disableFragmentWarnings(): void; +export declare function enableExperimentalFragmentVariables(): void; +export declare function disableExperimentalFragmentVariables(): void; +export declare namespace gql { + const gql: typeof import(".").gql, resetCaches: typeof import(".").resetCaches, disableFragmentWarnings: typeof import(".").disableFragmentWarnings, enableExperimentalFragmentVariables: typeof import(".").enableExperimentalFragmentVariables, disableExperimentalFragmentVariables: typeof import(".").disableExperimentalFragmentVariables; +} +export default gql; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts.map b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts.map new file mode 100644 index 00000000..fc4bae93 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAGb,MAAM,sBAAsB,CAAC;AA+G9B,wBAAgB,GAAG,CACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACpC,GAAG,IAAI,EAAE,GAAG,EAAE,gBAmBf;yBArBe,GAAG;;;;AAuBnB,wBAAgB,WAAW,SAG1B;AAED,wBAAgB,uBAAuB,SAEtC;AAED,wBAAgB,mCAAmC,SAElD;AAED,wBAAgB,oCAAoC,SAEnD;AAUD,yBAAiB,GAAG,CAAC;IACZ,MACL,GAAG,0BACH,WAAW,kCACX,uBAAuB,8CACvB,mCAAmC,0DACnC,oCAAoC,yDAC5B,CAAC;CACZ;AAID,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js new file mode 100644 index 00000000..10d0a7cf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js @@ -0,0 +1,122 @@ +import { __assign } from "tslib"; +import { parse } from 'graphql'; +var docCache = new Map(); +var fragmentSourceMap = new Map(); +var printFragmentWarnings = true; +var experimentalFragmentVariables = false; +function normalize(string) { + return string.replace(/[\s,]+/g, ' ').trim(); +} +function cacheKeyFromLoc(loc) { + return normalize(loc.source.body.substring(loc.start, loc.end)); +} +function processFragments(ast) { + var seenKeys = new Set(); + var definitions = []; + ast.definitions.forEach(function (fragmentDefinition) { + if (fragmentDefinition.kind === 'FragmentDefinition') { + var fragmentName = fragmentDefinition.name.value; + var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); + var sourceKeySet = fragmentSourceMap.get(fragmentName); + if (sourceKeySet && !sourceKeySet.has(sourceKey)) { + if (printFragmentWarnings) { + console.warn("Warning: fragment with name " + fragmentName + " already exists.\n" + + "graphql-tag enforces all fragment names across your application to be unique; read more about\n" + + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"); + } + } + else if (!sourceKeySet) { + fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); + } + sourceKeySet.add(sourceKey); + if (!seenKeys.has(sourceKey)) { + seenKeys.add(sourceKey); + definitions.push(fragmentDefinition); + } + } + else { + definitions.push(fragmentDefinition); + } + }); + return __assign(__assign({}, ast), { definitions: definitions }); +} +function stripLoc(doc) { + var workSet = new Set(doc.definitions); + workSet.forEach(function (node) { + if (node.loc) + delete node.loc; + Object.keys(node).forEach(function (key) { + var value = node[key]; + if (value && typeof value === 'object') { + workSet.add(value); + } + }); + }); + var loc = doc.loc; + if (loc) { + delete loc.startToken; + delete loc.endToken; + } + return doc; +} +function parseDocument(source) { + var cacheKey = normalize(source); + if (!docCache.has(cacheKey)) { + var parsed = parse(source, { + experimentalFragmentVariables: experimentalFragmentVariables, + allowLegacyFragmentVariables: experimentalFragmentVariables, + experimentalFragmentArguments: experimentalFragmentVariables + }); + if (!parsed || parsed.kind !== 'Document') { + throw new Error('Not a valid GraphQL document.'); + } + docCache.set(cacheKey, stripLoc(processFragments(parsed))); + } + return docCache.get(cacheKey); +} +export function gql(literals) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + if (typeof literals === 'string') { + literals = [literals]; + } + var result = literals[0]; + args.forEach(function (arg, i) { + if (arg && arg.kind === 'Document') { + result += arg.loc.source.body; + } + else { + result += arg; + } + result += literals[i + 1]; + }); + return parseDocument(result); +} +export function resetCaches() { + docCache.clear(); + fragmentSourceMap.clear(); +} +export function disableFragmentWarnings() { + printFragmentWarnings = false; +} +export function enableExperimentalFragmentVariables() { + experimentalFragmentVariables = true; +} +export function disableExperimentalFragmentVariables() { + experimentalFragmentVariables = false; +} +var extras = { + gql: gql, + resetCaches: resetCaches, + disableFragmentWarnings: disableFragmentWarnings, + enableExperimentalFragmentVariables: enableExperimentalFragmentVariables, + disableExperimentalFragmentVariables: disableExperimentalFragmentVariables +}; +(function (gql_1) { + gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables; +})(gql || (gql = {})); +gql["default"] = gql; +export default gql; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js.map b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js.map new file mode 100644 index 00000000..d6434cad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAShC,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;AAGjD,IAAM,iBAAiB,GAAG,IAAI,GAAG,EAAuB,CAAC;AAEzD,IAAI,qBAAqB,GAAG,IAAI,CAAC;AACjC,IAAI,6BAA6B,GAAG,KAAK,CAAC;AAI1C,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,eAAe,CAAC,GAAa;IACpC,OAAO,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,CAAC;AAKD,SAAS,gBAAgB,CAAC,GAAiB;IACzC,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,IAAM,WAAW,GAAqB,EAAE,CAAC;IAEzC,GAAG,CAAC,WAAW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_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js new file mode 100644 index 00000000..dc792754 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js @@ -0,0 +1,425 @@ +'use strict'; + +var tslib = require('tslib'); +require('source-map-support/register'); +var chai = require('chai'); +var graphql = require('graphql'); + +var docCache = new Map(); +var fragmentSourceMap = new Map(); +var printFragmentWarnings = true; +var experimentalFragmentVariables = false; +function normalize(string) { + return string.replace(/[\s,]+/g, ' ').trim(); +} +function cacheKeyFromLoc(loc) { + return normalize(loc.source.body.substring(loc.start, loc.end)); +} +function processFragments(ast) { + var seenKeys = new Set(); + var definitions = []; + ast.definitions.forEach(function (fragmentDefinition) { + if (fragmentDefinition.kind === 'FragmentDefinition') { + var fragmentName = fragmentDefinition.name.value; + var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); + var sourceKeySet = fragmentSourceMap.get(fragmentName); + if (sourceKeySet && !sourceKeySet.has(sourceKey)) { + if (printFragmentWarnings) { + console.warn("Warning: fragment with name " + fragmentName + " already exists.\n" + + "graphql-tag enforces all fragment names across your application to be unique; read more about\n" + + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"); + } + } + else if (!sourceKeySet) { + fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); + } + sourceKeySet.add(sourceKey); + if (!seenKeys.has(sourceKey)) { + seenKeys.add(sourceKey); + definitions.push(fragmentDefinition); + } + } + else { + definitions.push(fragmentDefinition); + } + }); + return tslib.__assign(tslib.__assign({}, ast), { definitions: definitions }); +} +function stripLoc(doc) { + var workSet = new Set(doc.definitions); + workSet.forEach(function (node) { + if (node.loc) + delete node.loc; + Object.keys(node).forEach(function (key) { + var value = node[key]; + if (value && typeof value === 'object') { + workSet.add(value); + } + }); + }); + var loc = doc.loc; + if (loc) { + delete loc.startToken; + delete loc.endToken; + } + return doc; +} +function parseDocument(source) { + var cacheKey = normalize(source); + if (!docCache.has(cacheKey)) { + var parsed = graphql.parse(source, { + experimentalFragmentVariables: experimentalFragmentVariables, + allowLegacyFragmentVariables: experimentalFragmentVariables, + experimentalFragmentArguments: experimentalFragmentVariables + }); + if (!parsed || parsed.kind !== 'Document') { + throw new Error('Not a valid GraphQL document.'); + } + docCache.set(cacheKey, stripLoc(processFragments(parsed))); + } + return docCache.get(cacheKey); +} +function gql(literals) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + if (typeof literals === 'string') { + literals = [literals]; + } + var result = literals[0]; + args.forEach(function (arg, i) { + if (arg && arg.kind === 'Document') { + result += arg.loc.source.body; + } + else { + result += arg; + } + result += literals[i + 1]; + }); + return parseDocument(result); +} +function resetCaches() { + docCache.clear(); + fragmentSourceMap.clear(); +} +function disableFragmentWarnings() { + printFragmentWarnings = false; +} +function enableExperimentalFragmentVariables() { + experimentalFragmentVariables = true; +} +function disableExperimentalFragmentVariables() { + experimentalFragmentVariables = false; +} +var extras = { + gql: gql, + resetCaches: resetCaches, + disableFragmentWarnings: disableFragmentWarnings, + enableExperimentalFragmentVariables: enableExperimentalFragmentVariables, + disableExperimentalFragmentVariables: disableExperimentalFragmentVariables +}; +(function (gql_1) { + gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables; +})(gql || (gql = {})); +gql["default"] = gql; +var gql$1 = gql; + +var loader = require('../loader'); +describe('gql', function () { + it('parses queries', function () { + chai.assert.equal(gql$1(templateObject_1 || (templateObject_1 = tslib.__makeTemplateObject(["{ testQuery }"], ["{ testQuery }"]))).kind, 'Document'); + }); + it('parses queries when called as a function', function () { + chai.assert.equal(gql$1('{ testQuery }').kind, 'Document'); + }); + it('parses queries with weird substitutions', function () { + var obj = Object.create(null); + chai.assert.equal(gql$1(templateObject_2 || (templateObject_2 = tslib.__makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), obj.missing).kind, 'Document'); + chai.assert.equal(gql$1(templateObject_3 || (templateObject_3 = tslib.__makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), null).kind, 'Document'); + chai.assert.equal(gql$1(templateObject_4 || (templateObject_4 = tslib.__makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), 0).kind, 'Document'); + }); + it('allows interpolation of documents generated by the webpack loader', function () { + var sameFragment = "fragment SomeFragmentName on SomeType { someField }"; + var jsSource = loader.call({ cacheable: function () { } }, sameFragment); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + var document = gql$1(templateObject_5 || (templateObject_5 = tslib.__makeTemplateObject(["query { ...SomeFragmentName } ", ""], ["query { ...SomeFragmentName } ", ""])), module.exports); + chai.assert.equal(document.kind, 'Document'); + chai.assert.equal(document.definitions.length, 2); + chai.assert.equal(document.definitions[0].kind, 'OperationDefinition'); + chai.assert.equal(document.definitions[1].kind, 'FragmentDefinition'); + }); + it('parses queries through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, '{ testQuery }'); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.equal(module.exports.kind, 'Document'); + }); + it('parses single query through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.equal(module.exports.kind, 'Document'); + chai.assert.exists(module.exports.Q1); + chai.assert.equal(module.exports.Q1.kind, 'Document'); + chai.assert.equal(module.exports.Q1.definitions.length, 1); + }); + it('parses single query and exports as default', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions); + }); + it('parses multiple queries through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.exists(module.exports.Q1); + chai.assert.exists(module.exports.Q2); + chai.assert.equal(module.exports.Q1.kind, 'Document'); + chai.assert.equal(module.exports.Q2.kind, 'Document'); + chai.assert.equal(module.exports.Q1.definitions.length, 1); + chai.assert.equal(module.exports.Q2.definitions.length, 1); + }); + it('parses fragments with variable definitions', function () { + gql$1.enableExperimentalFragmentVariables(); + var parsed = gql$1(templateObject_6 || (templateObject_6 = tslib.__makeTemplateObject(["fragment A ($arg: String!) on Type { testQuery }"], ["fragment A ($arg: String!) on Type { testQuery }"]))); + chai.assert.equal(parsed.kind, 'Document'); + chai.assert.exists(parsed.definitions[0].variableDefinitions); + gql$1.disableExperimentalFragmentVariables(); + }); + it('does not nest queries needlessly in named exports', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n query Q3 { test Query3 }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.notExists(module.exports.Q2.Q1); + chai.assert.notExists(module.exports.Q3.Q1); + chai.assert.notExists(module.exports.Q3.Q2); + }); + it('tracks fragment dependencies from multiple queries through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F1 on F { testQuery }\n fragment F2 on F { testQuery2 }\n fragment F3 on F { testQuery3 }\n query Q1 { ...F1 }\n query Q2 { ...F2 }\n query Q3 {\n ...F1\n ...F2\n }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.exists(module.exports.Q1); + chai.assert.exists(module.exports.Q2); + chai.assert.exists(module.exports.Q3); + var Q1 = module.exports.Q1.definitions; + var Q2 = module.exports.Q2.definitions; + var Q3 = module.exports.Q3.definitions; + chai.assert.equal(Q1.length, 2); + chai.assert.equal(Q1[0].name.value, 'Q1'); + chai.assert.equal(Q1[1].name.value, 'F1'); + chai.assert.equal(Q2.length, 2); + chai.assert.equal(Q2[0].name.value, 'Q2'); + chai.assert.equal(Q2[1].name.value, 'F2'); + chai.assert.equal(Q3.length, 3); + chai.assert.equal(Q3[0].name.value, 'Q3'); + chai.assert.equal(Q3[1].name.value, 'F1'); + chai.assert.equal(Q3[2].name.value, 'F2'); + var F1 = module.exports.F1.definitions; + var F2 = module.exports.F2.definitions; + var F3 = module.exports.F3.definitions; + chai.assert.equal(F1.length, 1); + chai.assert.equal(F1[0].name.value, 'F1'); + chai.assert.equal(F2.length, 1); + chai.assert.equal(F2[0].name.value, 'F2'); + chai.assert.equal(F3.length, 1); + chai.assert.equal(F3[0].name.value, 'F3'); + }); + it('tracks fragment dependencies across nested fragments', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F11 on F { testQuery }\n fragment F22 on F {\n ...F11\n testQuery2\n }\n fragment F33 on F {\n ...F22\n testQuery3\n }\n\n query Q1 {\n ...F33\n }\n\n query Q2 {\n id\n }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.exists(module.exports.Q1); + chai.assert.exists(module.exports.Q2); + var Q1 = module.exports.Q1.definitions; + var Q2 = module.exports.Q2.definitions; + chai.assert.equal(Q1.length, 4); + chai.assert.equal(Q1[0].name.value, 'Q1'); + chai.assert.equal(Q1[1].name.value, 'F33'); + chai.assert.equal(Q1[2].name.value, 'F22'); + chai.assert.equal(Q1[3].name.value, 'F11'); + chai.assert.equal(Q2.length, 1); + var F11 = module.exports.F11.definitions; + var F22 = module.exports.F22.definitions; + var F33 = module.exports.F33.definitions; + chai.assert.equal(F11.length, 1); + chai.assert.equal(F11[0].name.value, 'F11'); + chai.assert.equal(F22.length, 2); + chai.assert.equal(F22[0].name.value, 'F22'); + chai.assert.equal(F22[1].name.value, 'F11'); + chai.assert.equal(F33.length, 3); + chai.assert.equal(F33[0].name.value, 'F33'); + chai.assert.equal(F33[1].name.value, 'F22'); + chai.assert.equal(F33[2].name.value, 'F11'); + }); + it('correctly imports other files through the webpack loader', function () { + var query = "#import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }"; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + var require = function (path) { + chai.assert.equal(path, './fragment_definition.graphql'); + return gql$1(templateObject_7 || (templateObject_7 = tslib.__makeTemplateObject(["\n fragment authorDetails on Author {\n firstName\n lastName\n }"], ["\n fragment authorDetails on Author {\n firstName\n lastName\n }"]))); + }; + Function("module,require", jsSource)(module, require); + chai.assert.equal(module.exports.kind, 'Document'); + var definitions = module.exports.definitions; + chai.assert.equal(definitions.length, 2); + chai.assert.equal(definitions[0].kind, 'OperationDefinition'); + chai.assert.equal(definitions[1].kind, 'FragmentDefinition'); + }); + it('importing files also works with a space between `#` and `import`', function () { + var query = "# import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }"; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + var require = function (path) { + chai.assert.equal(path, './fragment_definition.graphql'); + return gql$1(templateObject_8 || (templateObject_8 = tslib.__makeTemplateObject(["\n fragment authorDetails on Author {\n firstName\n lastName\n }"], ["\n fragment authorDetails on Author {\n firstName\n lastName\n }"]))); + }; + Function("module,require", jsSource)(module, require); + chai.assert.equal(module.exports.kind, 'Document'); + var definitions = module.exports.definitions; + chai.assert.equal(definitions.length, 2); + chai.assert.equal(definitions[0].kind, 'OperationDefinition'); + chai.assert.equal(definitions[1].kind, 'FragmentDefinition'); + }); + it('tracks fragment dependencies across fragments loaded via the webpack loader', function () { + var query = "#import \"./fragment_definition.graphql\"\n fragment F111 on F {\n ...F222\n }\n\n query Q1 {\n ...F111\n }\n\n query Q2 {\n a\n }\n "; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + var require = function (path) { + chai.assert.equal(path, './fragment_definition.graphql'); + return gql$1(templateObject_9 || (templateObject_9 = tslib.__makeTemplateObject(["\n fragment F222 on F {\n f1\n f2\n }"], ["\n fragment F222 on F {\n f1\n f2\n }"]))); + }; + Function("module,require", jsSource)(module, require); + chai.assert.exists(module.exports.Q1); + chai.assert.exists(module.exports.Q2); + var Q1 = module.exports.Q1.definitions; + var Q2 = module.exports.Q2.definitions; + chai.assert.equal(Q1.length, 3); + chai.assert.equal(Q1[0].name.value, 'Q1'); + chai.assert.equal(Q1[1].name.value, 'F111'); + chai.assert.equal(Q1[2].name.value, 'F222'); + chai.assert.equal(Q2.length, 1); + }); + it('does not complain when presented with normal comments', function (done) { + chai.assert.doesNotThrow(function () { + var query = "#normal comment\n query {\n author {\n ...authorDetails\n }\n }"; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + chai.assert.equal(module.exports.kind, 'Document'); + done(); + }); + }); + it('returns the same object for the same query', function () { + chai.assert.isTrue(gql$1(templateObject_10 || (templateObject_10 = tslib.__makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql$1(templateObject_11 || (templateObject_11 = tslib.__makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"])))); + }); + it('returns the same object for the same query, even with whitespace differences', function () { + chai.assert.isTrue(gql$1(templateObject_12 || (templateObject_12 = tslib.__makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql$1(templateObject_13 || (templateObject_13 = tslib.__makeTemplateObject([" { sameQuery, }"], [" { sameQuery, }"])))); + }); + var fragmentAst = gql$1(templateObject_14 || (templateObject_14 = tslib.__makeTemplateObject(["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"], ["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"]))); + it('returns the same object for the same fragment', function () { + chai.assert.isTrue(gql$1(templateObject_15 || (templateObject_15 = tslib.__makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"]))) === gql$1(templateObject_16 || (templateObject_16 = tslib.__makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"])))); + }); + it('returns the same object for the same document with substitution', function () { + chai.assert.isTrue(gql$1(templateObject_17 || (templateObject_17 = tslib.__makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst) === gql$1(templateObject_18 || (templateObject_18 = tslib.__makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst)); + }); + it('can reference a fragment that references as fragment', function () { + var secondFragmentAst = gql$1(templateObject_19 || (templateObject_19 = tslib.__makeTemplateObject(["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "], ["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "])), fragmentAst); + var ast = gql$1(templateObject_20 || (templateObject_20 = tslib.__makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "])), secondFragmentAst); + chai.assert.deepEqual(ast, gql$1(templateObject_21 || (templateObject_21 = tslib.__makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "])))); + }); + describe('fragment warnings', function () { + var warnings = []; + var oldConsoleWarn = console.warn; + beforeEach(function () { + gql$1.resetCaches(); + warnings = []; + console.warn = function (w) { return warnings.push(w); }; + }); + afterEach(function () { + console.warn = oldConsoleWarn; + }); + it('warns if you use the same fragment name for different fragments', function () { + var frag1 = gql$1(templateObject_22 || (templateObject_22 = tslib.__makeTemplateObject(["fragment TestSame on Bar { fieldOne }"], ["fragment TestSame on Bar { fieldOne }"]))); + var frag2 = gql$1(templateObject_23 || (templateObject_23 = tslib.__makeTemplateObject(["fragment TestSame on Bar { fieldTwo }"], ["fragment TestSame on Bar { fieldTwo }"]))); + chai.assert.isFalse(frag1 === frag2); + chai.assert.equal(warnings.length, 1); + }); + it('does not warn if you use the same fragment name for the same fragment', function () { + var frag1 = gql$1(templateObject_24 || (templateObject_24 = tslib.__makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"]))); + var frag2 = gql$1(templateObject_25 || (templateObject_25 = tslib.__makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"]))); + chai.assert.isTrue(frag1 === frag2); + chai.assert.equal(warnings.length, 0); + }); + it('does not warn if you use the same embedded fragment in two different queries', function () { + var frag1 = gql$1(templateObject_26 || (templateObject_26 = tslib.__makeTemplateObject(["fragment TestEmbedded on Bar { field }"], ["fragment TestEmbedded on Bar { field }"]))); + var query1 = gql$1(templateObject_27 || (templateObject_27 = tslib.__makeTemplateObject(["{ bar { fieldOne ...TestEmbedded } } ", ""], ["{ bar { fieldOne ...TestEmbedded } } ", ""])), frag1); + var query2 = gql$1(templateObject_28 || (templateObject_28 = tslib.__makeTemplateObject(["{ bar { fieldTwo ...TestEmbedded } } ", ""], ["{ bar { fieldTwo ...TestEmbedded } } ", ""])), frag1); + chai.assert.isFalse(query1 === query2); + chai.assert.equal(warnings.length, 0); + }); + it('does not warn if you use the same fragment name for embedded and non-embedded fragments', function () { + var frag1 = gql$1(templateObject_29 || (templateObject_29 = tslib.__makeTemplateObject(["fragment TestEmbeddedTwo on Bar { field }"], ["fragment TestEmbeddedTwo on Bar { field }"]))); + gql$1(templateObject_30 || (templateObject_30 = tslib.__makeTemplateObject(["{ bar { ...TestEmbedded } } ", ""], ["{ bar { ...TestEmbedded } } ", ""])), frag1); + gql$1(templateObject_31 || (templateObject_31 = tslib.__makeTemplateObject(["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"], ["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"]))); + chai.assert.equal(warnings.length, 0); + }); + }); + describe('unique fragments', function () { + beforeEach(function () { + gql$1.resetCaches(); + }); + it('strips duplicate fragments from the document', function () { + var frag1 = gql$1(templateObject_32 || (templateObject_32 = tslib.__makeTemplateObject(["fragment TestDuplicate on Bar { field }"], ["fragment TestDuplicate on Bar { field }"]))); + var query1 = gql$1(templateObject_33 || (templateObject_33 = tslib.__makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", " ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", " ", ""])), frag1, frag1); + var query2 = gql$1(templateObject_34 || (templateObject_34 = tslib.__makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", ""])), frag1); + chai.assert.equal(query1.definitions.length, 2); + chai.assert.equal(query1.definitions[1].kind, 'FragmentDefinition'); + chai.assert.deepEqual(query1.definitions, query2.definitions); + }); + it('ignores duplicate fragments from second-level imports when using the webpack loader', function () { + var load = function (require, query) { + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + Function("require,module", jsSource)(require, module); + return module.exports; + }; + var test_require = function (path) { + switch (path) { + case './friends.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment friends on Hero { friends { ...person } }', + ].join('\n')); + case './enemies.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment enemies on Hero { enemies { ...person } }', + ].join('\n')); + case './person.graphql': + return load(test_require, 'fragment person on Person { name }\n'); + default: + return null; + } + }; + var result = load(test_require, [ + '#import "./friends.graphql"', + '#import "./enemies.graphql"', + 'query { hero { ...friends ...enemies } }', + ].join('\n')); + chai.assert.equal(result.kind, 'Document'); + chai.assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain'); + chai.assert.equal(result.definitions[0].kind, 'OperationDefinition'); + var fragments = result.definitions.slice(1); + chai.assert(fragments.every(function (fragment) { return fragment.kind === 'FragmentDefinition'; })); + chai.assert(fragments.some(function (fragment) { return fragment.name.value === 'friends'; })); + chai.assert(fragments.some(function (fragment) { return fragment.name.value === 'enemies'; })); + chai.assert(fragments.some(function (fragment) { return fragment.name.value === 'person'; })); + }); + }); +}); +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34; +//# sourceMappingURL=tests.cjs.js.map diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js.map b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js.map new file mode 100644 index 00000000..a8406283 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tests.cjs.js","sources":["../src/index.ts","../src/tests.ts"],"sourcesContent":["import { parse } from 'graphql';\n\nimport {\n DocumentNode,\n DefinitionNode,\n Location,\n} from 'graphql/language/ast';\n\n// A map docString -> graphql document\nconst docCache = new Map();\n\n// A map fragmentName -> [normalized source]\nconst fragmentSourceMap = new Map>();\n\nlet printFragmentWarnings = true;\nlet experimentalFragmentVariables = false;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string: string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\nfunction cacheKeyFromLoc(loc: Location) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nfunction processFragments(ast: DocumentNode) {\n const seenKeys = new Set();\n const definitions: DefinitionNode[] = [];\n\n ast.definitions.forEach(fragmentDefinition => {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc!);\n\n // We know something about this fragment\n let sourceKeySet = fragmentSourceMap.get(fragmentName)!;\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n } else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n\n sourceKeySet.add(sourceKey);\n\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n });\n\n return {\n ...ast,\n definitions,\n };\n}\n\nfunction stripLoc(doc: DocumentNode) {\n const workSet = new Set>(doc.definitions);\n\n workSet.forEach(node => {\n if (node.loc) delete node.loc;\n Object.keys(node).forEach(key => {\n const value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n\n const loc = doc.loc as Record;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n\n return doc;\n}\n\nfunction parseDocument(source: string) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n const parsed = parse(source, {\n // graphql 14,15,16\n experimentalFragmentVariables,\n // graphql 14\n allowLegacyFragmentVariables: experimentalFragmentVariables,\n // graphql 17\n experimentalFragmentArguments: experimentalFragmentVariables,\n } as any);\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(\n cacheKey,\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n stripLoc(processFragments(parsed)),\n );\n }\n return docCache.get(cacheKey)!;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nexport function gql(\n literals: string | readonly string[],\n ...args: any[]\n) {\n\n if (typeof literals === 'string') {\n literals = [literals];\n }\n\n let result = literals[0];\n\n args.forEach((arg, i) => {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n } else {\n result += arg;\n }\n result += literals[i + 1];\n });\n\n return parseDocument(result);\n}\n\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\n\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\nconst extras = {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n};\n\nexport namespace gql {\n export const {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n } = extras;\n}\n\ngql.default = gql;\n\nexport default gql;\n","import 'source-map-support/register';\n\nimport { assert } from 'chai';\nimport { DocumentNode, FragmentDefinitionNode } from 'graphql';\n\nimport gql from './index';\nconst loader = require('../loader');\n\ndescribe('gql', () => {\n it('parses queries', () => {\n assert.equal(gql`{ testQuery }`.kind, 'Document');\n });\n\n it('parses queries when called as a function', () => {\n assert.equal(gql('{ testQuery }').kind, 'Document');\n });\n\n it('parses queries with weird substitutions', () => {\n const obj = Object.create(null);\n assert.equal(gql`{ field(input: \"${obj.missing}\") }`.kind, 'Document');\n assert.equal(gql`{ field(input: \"${null}\") }`.kind, 'Document');\n assert.equal(gql`{ field(input: \"${0}\") }`.kind, 'Document');\n });\n\n it('allows interpolation of documents generated by the webpack loader', () => {\n const sameFragment = \"fragment SomeFragmentName on SomeType { someField }\";\n\n const jsSource = loader.call(\n { cacheable() {} },\n sameFragment,\n );\n const module = { exports: Object.create(null) };\n\n Function(\"module\", jsSource)(module);\n\n const document = gql`query { ...SomeFragmentName } ${module.exports}`;\n assert.equal(document.kind, 'Document');\n assert.equal(document.definitions.length, 2);\n assert.equal(document.definitions[0].kind, 'OperationDefinition');\n assert.equal(document.definitions[1].kind, 'FragmentDefinition');\n });\n\n it('parses queries through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, '{ testQuery }');\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n assert.equal(module.exports.kind, 'Document');\n });\n\n it('parses single query through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.equal(module.exports.kind, 'Document');\n assert.exists(module.exports.Q1);\n assert.equal(module.exports.Q1.kind, 'Document');\n assert.equal(module.exports.Q1.definitions.length, 1);\n });\n\n it('parses single query and exports as default', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions);\n });\n\n it('parses multiple queries through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n assert.equal(module.exports.Q1.kind, 'Document');\n assert.equal(module.exports.Q2.kind, 'Document');\n assert.equal(module.exports.Q1.definitions.length, 1);\n assert.equal(module.exports.Q2.definitions.length, 1);\n });\n\n it('parses fragments with variable definitions', () => {\n gql.enableExperimentalFragmentVariables();\n\n const parsed: any = gql`fragment A ($arg: String!) on Type { testQuery }`;\n assert.equal(parsed.kind, 'Document');\n assert.exists(parsed.definitions[0].variableDefinitions);\n\n gql.disableExperimentalFragmentVariables()\n });\n\n // see https://github.com/apollographql/graphql-tag/issues/168\n it('does not nest queries needlessly in named exports', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n query Q3 { test Query3 }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.notExists(module.exports.Q2.Q1);\n assert.notExists(module.exports.Q3.Q1);\n assert.notExists(module.exports.Q3.Q2);\n });\n\n it('tracks fragment dependencies from multiple queries through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n fragment F1 on F { testQuery }\n fragment F2 on F { testQuery2 }\n fragment F3 on F { testQuery3 }\n query Q1 { ...F1 }\n query Q2 { ...F2 }\n query Q3 {\n ...F1\n ...F2\n }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n assert.exists(module.exports.Q3);\n const Q1 = module.exports.Q1.definitions;\n const Q2 = module.exports.Q2.definitions;\n const Q3 = module.exports.Q3.definitions;\n\n assert.equal(Q1.length, 2);\n assert.equal(Q1[0].name.value, 'Q1');\n assert.equal(Q1[1].name.value, 'F1');\n\n assert.equal(Q2.length, 2);\n assert.equal(Q2[0].name.value, 'Q2');\n assert.equal(Q2[1].name.value, 'F2');\n\n assert.equal(Q3.length, 3);\n assert.equal(Q3[0].name.value, 'Q3');\n assert.equal(Q3[1].name.value, 'F1');\n assert.equal(Q3[2].name.value, 'F2');\n\n const F1 = module.exports.F1.definitions;\n const F2 = module.exports.F2.definitions;\n const F3 = module.exports.F3.definitions;\n\n assert.equal(F1.length, 1);\n assert.equal(F1[0].name.value, 'F1');\n assert.equal(F2.length, 1);\n assert.equal(F2[0].name.value, 'F2');\n assert.equal(F3.length, 1);\n assert.equal(F3[0].name.value, 'F3');\n\n });\n\n it('tracks fragment dependencies across nested fragments', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n fragment F11 on F { testQuery }\n fragment F22 on F {\n ...F11\n testQuery2\n }\n fragment F33 on F {\n ...F22\n testQuery3\n }\n\n query Q1 {\n ...F33\n }\n\n query Q2 {\n id\n }\n `);\n\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n\n const Q1 = module.exports.Q1.definitions;\n const Q2 = module.exports.Q2.definitions;\n\n assert.equal(Q1.length, 4);\n assert.equal(Q1[0].name.value, 'Q1');\n assert.equal(Q1[1].name.value, 'F33');\n assert.equal(Q1[2].name.value, 'F22');\n assert.equal(Q1[3].name.value, 'F11');\n\n assert.equal(Q2.length, 1);\n\n const F11 = module.exports.F11.definitions;\n const F22 = module.exports.F22.definitions;\n const F33 = module.exports.F33.definitions;\n\n assert.equal(F11.length, 1);\n assert.equal(F11[0].name.value, 'F11');\n assert.equal(F22.length, 2);\n assert.equal(F22[0].name.value, 'F22');\n assert.equal(F22[1].name.value, 'F11');\n assert.equal(F33.length, 3);\n assert.equal(F33[0].name.value, 'F33');\n assert.equal(F33[1].name.value, 'F22');\n assert.equal(F33[2].name.value, 'F11');\n });\n\n it('correctly imports other files through the webpack loader', () => {\n const query = `#import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }`;\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n const require = (path: string) => {\n assert.equal(path, './fragment_definition.graphql');\n return gql`\n fragment authorDetails on Author {\n firstName\n lastName\n }`;\n };\n Function(\"module,require\", jsSource)(module, require);\n assert.equal(module.exports.kind, 'Document');\n const definitions = module.exports.definitions;\n assert.equal(definitions.length, 2);\n assert.equal(definitions[0].kind, 'OperationDefinition');\n assert.equal(definitions[1].kind, 'FragmentDefinition');\n });\n\n it('importing files also works with a space between `#` and `import`', () => {\n const query = `# import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }`;\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n const require = (path: string) => {\n assert.equal(path, './fragment_definition.graphql');\n return gql`\n fragment authorDetails on Author {\n firstName\n lastName\n }`;\n };\n Function(\"module,require\", jsSource)(module, require);\n assert.equal(module.exports.kind, 'Document');\n const definitions = module.exports.definitions;\n assert.equal(definitions.length, 2);\n assert.equal(definitions[0].kind, 'OperationDefinition');\n assert.equal(definitions[1].kind, 'FragmentDefinition');\n });\n\n it('tracks fragment dependencies across fragments loaded via the webpack loader', () => {\n const query = `#import \"./fragment_definition.graphql\"\n fragment F111 on F {\n ...F222\n }\n\n query Q1 {\n ...F111\n }\n\n query Q2 {\n a\n }\n `;\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n const require = (path: string) => {\n assert.equal(path, './fragment_definition.graphql');\n return gql`\n fragment F222 on F {\n f1\n f2\n }`;\n };\n Function(\"module,require\", jsSource)(module, require);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n\n const Q1 = module.exports.Q1.definitions;\n const Q2 = module.exports.Q2.definitions;\n\n assert.equal(Q1.length, 3);\n assert.equal(Q1[0].name.value, 'Q1');\n assert.equal(Q1[1].name.value, 'F111');\n assert.equal(Q1[2].name.value, 'F222');\n\n assert.equal(Q2.length, 1);\n });\n\n it('does not complain when presented with normal comments', (done) => {\n assert.doesNotThrow(() => {\n const query = `#normal comment\n query {\n author {\n ...authorDetails\n }\n }`;\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n assert.equal(module.exports.kind, 'Document');\n done();\n });\n });\n\n it('returns the same object for the same query', () => {\n assert.isTrue(gql`{ sameQuery }` === gql`{ sameQuery }`);\n });\n\n it('returns the same object for the same query, even with whitespace differences', () => {\n assert.isTrue(gql`{ sameQuery }` === gql` { sameQuery, }`);\n });\n\n const fragmentAst = gql`\n fragment UserFragment on User {\n firstName\n lastName\n }\n`;\n\n it('returns the same object for the same fragment', () => {\n assert.isTrue(gql`fragment same on Same { sameQuery }` ===\n gql`fragment same on Same { sameQuery }`);\n });\n\n it('returns the same object for the same document with substitution', () => {\n // We know that calling `gql` on a fragment string will always return\n // the same document, so we can reuse `fragmentAst`\n assert.isTrue(gql`{ ...UserFragment } ${fragmentAst}` ===\n gql`{ ...UserFragment } ${fragmentAst}`);\n });\n\n it('can reference a fragment that references as fragment', () => {\n const secondFragmentAst = gql`\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ${fragmentAst}\n `;\n\n const ast = gql`\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ${secondFragmentAst}\n `;\n\n assert.deepEqual(ast, gql`\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n `);\n });\n\n describe('fragment warnings', () => {\n let warnings = [];\n const oldConsoleWarn = console.warn;\n beforeEach(() => {\n gql.resetCaches();\n warnings = [];\n console.warn = (w: string) => warnings.push(w);\n });\n afterEach(() => {\n console.warn = oldConsoleWarn;\n });\n\n it('warns if you use the same fragment name for different fragments', () => {\n const frag1 = gql`fragment TestSame on Bar { fieldOne }`;\n const frag2 = gql`fragment TestSame on Bar { fieldTwo }`;\n\n assert.isFalse(frag1 === frag2);\n assert.equal(warnings.length, 1);\n });\n\n it('does not warn if you use the same fragment name for the same fragment', () => {\n const frag1 = gql`fragment TestDifferent on Bar { fieldOne }`;\n const frag2 = gql`fragment TestDifferent on Bar { fieldOne }`;\n\n assert.isTrue(frag1 === frag2);\n assert.equal(warnings.length, 0);\n });\n\n it('does not warn if you use the same embedded fragment in two different queries', () => {\n const frag1 = gql`fragment TestEmbedded on Bar { field }`;\n const query1 = gql`{ bar { fieldOne ...TestEmbedded } } ${frag1}`;\n const query2 = gql`{ bar { fieldTwo ...TestEmbedded } } ${frag1}`;\n\n assert.isFalse(query1 === query2);\n assert.equal(warnings.length, 0);\n });\n\n it('does not warn if you use the same fragment name for embedded and non-embedded fragments', () => {\n const frag1 = gql`fragment TestEmbeddedTwo on Bar { field }`;\n gql`{ bar { ...TestEmbedded } } ${frag1}`;\n gql`{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }`;\n\n assert.equal(warnings.length, 0);\n });\n });\n\n describe('unique fragments', () => {\n beforeEach(() => {\n gql.resetCaches();\n });\n\n it('strips duplicate fragments from the document', () => {\n const frag1 = gql`fragment TestDuplicate on Bar { field }`;\n const query1 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1} ${frag1}`;\n const query2 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1}`;\n\n assert.equal(query1.definitions.length, 2);\n assert.equal(query1.definitions[1].kind, 'FragmentDefinition');\n // We don't test strict equality between the two queries because the source.body parsed from the\n // document is not the same, but the set of definitions should be.\n assert.deepEqual(query1.definitions, query2.definitions);\n });\n\n it('ignores duplicate fragments from second-level imports when using the webpack loader', () => {\n // take a require function and a query string, use the webpack loader to process it\n const load = (\n require: (path: string) => DocumentNode | null,\n query: string,\n ): DocumentNode | null => {\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n Function(\"require,module\", jsSource)(require, module);\n return module.exports;\n }\n\n const test_require = (path: string) => {\n switch (path) {\n case './friends.graphql':\n return load(test_require, [\n '#import \"./person.graphql\"',\n 'fragment friends on Hero { friends { ...person } }',\n ].join('\\n'));\n case './enemies.graphql':\n return load(test_require, [\n '#import \"./person.graphql\"',\n 'fragment enemies on Hero { enemies { ...person } }',\n ].join('\\n'));\n case './person.graphql':\n return load(test_require, 'fragment person on Person { name }\\n');\n default:\n return null;\n };\n };\n\n const result = load(test_require, [\n '#import \"./friends.graphql\"',\n '#import \"./enemies.graphql\"',\n 'query { hero { ...friends ...enemies } }',\n ].join('\\n'))!;\n\n assert.equal(result.kind, 'Document');\n assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain');\n assert.equal(result.definitions[0].kind, 'OperationDefinition');\n\n // the rest of the definitions should be fragments and contain one of\n // each: \"friends\", \"enemies\", \"person\". Order does not matter\n const fragments = result.definitions.slice(1) as FragmentDefinitionNode[];\n assert(fragments.every(fragment => fragment.kind === 'FragmentDefinition'))\n assert(fragments.some(fragment => fragment.name.value === 'friends'))\n assert(fragments.some(fragment => fragment.name.value === 'enemies'))\n assert(fragments.some(fragment => fragment.name.value === 'person'))\n });\n });\n\n // How to make this work?\n // it.only('can reference a fragment passed as a document via shorthand', () => {\n // const ast = gql`\n // {\n // user(id: 5) {\n // ...${userFragmentDocument}\n // }\n // }\n // `;\n //\n // assert.deepEqual(ast, gql`\n // {\n // user(id: 5) {\n // ...UserFragment\n // }\n // }\n // fragment UserFragment on User {\n // firstName\n // lastName\n // }\n // `);\n // });\n});\n"],"names":["__assign","parse","assert","gql","__makeTemplateObject"],"mappings":";;;;;;;AASA,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;AAGjD,IAAM,iBAAiB,GAAG,IAAI,GAAG,EAAuB,CAAC;AAEzD,IAAI,qBAAqB,GAAG,IAAI,CAAC;AACjC,IAAI,6BAA6B,GAAG,KAAK,CAAC;AAI1C,SAAS,SAAS,CAAC,MAAc,EAAA;IAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,eAAe,CAAC,GAAa,EAAA;AACpC,IAAA,OAAO,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,CAAC;AAKD,SAAS,gBAAgB,CAAC,GAAiB,EAAA;AACzC,IAAA,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,IAAM,WAAW,GAAqB,EAAE,CAAC;AAEzC,IAAA,GAAG,CAAC,WAAW,CAAC,OAAO,CAA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end/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts new file mode 100644 index 00000000..c85b6c33 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts @@ -0,0 +1,2 @@ +import 'source-map-support/register'; +//# sourceMappingURL=tests.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts.map b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts.map new file mode 100644 index 00000000..fc324192 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../src/tests.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js new file mode 100644 index 00000000..06847574 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js @@ -0,0 +1,303 @@ +import { __makeTemplateObject } from "tslib"; +import 'source-map-support/register'; +import { assert } from 'chai'; +import gql from './index'; +var loader = require('../loader'); +describe('gql', function () { + it('parses queries', function () { + assert.equal(gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["{ testQuery }"], ["{ testQuery }"]))).kind, 'Document'); + }); + it('parses queries when called as a function', function () { + assert.equal(gql('{ testQuery }').kind, 'Document'); + }); + it('parses queries with weird substitutions', function () { + var obj = Object.create(null); + assert.equal(gql(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), obj.missing).kind, 'Document'); + assert.equal(gql(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), null).kind, 'Document'); + assert.equal(gql(templateObject_4 || (templateObject_4 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), 0).kind, 'Document'); + }); + it('allows interpolation of documents generated by the webpack loader', function () { + var sameFragment = "fragment SomeFragmentName on SomeType { someField }"; + var jsSource = loader.call({ cacheable: function () { } }, sameFragment); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + var document = gql(templateObject_5 || (templateObject_5 = __makeTemplateObject(["query { ...SomeFragmentName } ", ""], ["query { ...SomeFragmentName } ", ""])), module.exports); + assert.equal(document.kind, 'Document'); + assert.equal(document.definitions.length, 2); + assert.equal(document.definitions[0].kind, 'OperationDefinition'); + assert.equal(document.definitions[1].kind, 'FragmentDefinition'); + }); + it('parses queries through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, '{ testQuery }'); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.equal(module.exports.kind, 'Document'); + }); + it('parses single query through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.equal(module.exports.kind, 'Document'); + assert.exists(module.exports.Q1); + assert.equal(module.exports.Q1.kind, 'Document'); + assert.equal(module.exports.Q1.definitions.length, 1); + }); + it('parses single query and exports as default', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions); + }); + it('parses multiple queries through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + assert.equal(module.exports.Q1.kind, 'Document'); + assert.equal(module.exports.Q2.kind, 'Document'); + assert.equal(module.exports.Q1.definitions.length, 1); + assert.equal(module.exports.Q2.definitions.length, 1); + }); + it('parses fragments with variable definitions', function () { + gql.enableExperimentalFragmentVariables(); + var parsed = gql(templateObject_6 || (templateObject_6 = __makeTemplateObject(["fragment A ($arg: String!) on Type { testQuery }"], ["fragment A ($arg: String!) on Type { testQuery }"]))); + assert.equal(parsed.kind, 'Document'); + assert.exists(parsed.definitions[0].variableDefinitions); + gql.disableExperimentalFragmentVariables(); + }); + it('does not nest queries needlessly in named exports', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n query Q3 { test Query3 }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.notExists(module.exports.Q2.Q1); + assert.notExists(module.exports.Q3.Q1); + assert.notExists(module.exports.Q3.Q2); + }); + it('tracks fragment dependencies from multiple queries through webpack loader', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F1 on F { testQuery }\n fragment F2 on F { testQuery2 }\n fragment F3 on F { testQuery3 }\n query Q1 { ...F1 }\n query Q2 { ...F2 }\n query Q3 {\n ...F1\n ...F2\n }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + assert.exists(module.exports.Q3); + var Q1 = module.exports.Q1.definitions; + var Q2 = module.exports.Q2.definitions; + var Q3 = module.exports.Q3.definitions; + assert.equal(Q1.length, 2); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F1'); + assert.equal(Q2.length, 2); + assert.equal(Q2[0].name.value, 'Q2'); + assert.equal(Q2[1].name.value, 'F2'); + assert.equal(Q3.length, 3); + assert.equal(Q3[0].name.value, 'Q3'); + assert.equal(Q3[1].name.value, 'F1'); + assert.equal(Q3[2].name.value, 'F2'); + var F1 = module.exports.F1.definitions; + var F2 = module.exports.F2.definitions; + var F3 = module.exports.F3.definitions; + assert.equal(F1.length, 1); + assert.equal(F1[0].name.value, 'F1'); + assert.equal(F2.length, 1); + assert.equal(F2[0].name.value, 'F2'); + assert.equal(F3.length, 1); + assert.equal(F3[0].name.value, 'F3'); + }); + it('tracks fragment dependencies across nested fragments', function () { + var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F11 on F { testQuery }\n fragment F22 on F {\n ...F11\n testQuery2\n }\n fragment F33 on F {\n ...F22\n testQuery3\n }\n\n query Q1 {\n ...F33\n }\n\n query Q2 {\n id\n }\n "); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + var Q1 = module.exports.Q1.definitions; + var Q2 = module.exports.Q2.definitions; + assert.equal(Q1.length, 4); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F33'); + assert.equal(Q1[2].name.value, 'F22'); + assert.equal(Q1[3].name.value, 'F11'); + assert.equal(Q2.length, 1); + var F11 = module.exports.F11.definitions; + var F22 = module.exports.F22.definitions; + var F33 = module.exports.F33.definitions; + assert.equal(F11.length, 1); + assert.equal(F11[0].name.value, 'F11'); + assert.equal(F22.length, 2); + assert.equal(F22[0].name.value, 'F22'); + assert.equal(F22[1].name.value, 'F11'); + assert.equal(F33.length, 3); + assert.equal(F33[0].name.value, 'F33'); + assert.equal(F33[1].name.value, 'F22'); + assert.equal(F33[2].name.value, 'F11'); + }); + it('correctly imports other files through the webpack loader', function () { + var query = "#import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }"; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + var require = function (path) { + assert.equal(path, './fragment_definition.graphql'); + return gql(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n fragment authorDetails on Author {\n firstName\n lastName\n }"], ["\n fragment authorDetails on Author {\n firstName\n lastName\n }"]))); + }; + Function("module,require", jsSource)(module, require); + assert.equal(module.exports.kind, 'Document'); + var definitions = module.exports.definitions; + assert.equal(definitions.length, 2); + assert.equal(definitions[0].kind, 'OperationDefinition'); + assert.equal(definitions[1].kind, 'FragmentDefinition'); + }); + it('importing files also works with a space between `#` and `import`', function () { + var query = "# import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }"; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + var require = function (path) { + assert.equal(path, './fragment_definition.graphql'); + return gql(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n fragment authorDetails on Author {\n firstName\n lastName\n }"], ["\n fragment authorDetails on Author {\n firstName\n lastName\n }"]))); + }; + Function("module,require", jsSource)(module, require); + assert.equal(module.exports.kind, 'Document'); + var definitions = module.exports.definitions; + assert.equal(definitions.length, 2); + assert.equal(definitions[0].kind, 'OperationDefinition'); + assert.equal(definitions[1].kind, 'FragmentDefinition'); + }); + it('tracks fragment dependencies across fragments loaded via the webpack loader', function () { + var query = "#import \"./fragment_definition.graphql\"\n fragment F111 on F {\n ...F222\n }\n\n query Q1 {\n ...F111\n }\n\n query Q2 {\n a\n }\n "; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + var require = function (path) { + assert.equal(path, './fragment_definition.graphql'); + return gql(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n fragment F222 on F {\n f1\n f2\n }"], ["\n fragment F222 on F {\n f1\n f2\n }"]))); + }; + Function("module,require", jsSource)(module, require); + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + var Q1 = module.exports.Q1.definitions; + var Q2 = module.exports.Q2.definitions; + assert.equal(Q1.length, 3); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F111'); + assert.equal(Q1[2].name.value, 'F222'); + assert.equal(Q2.length, 1); + }); + it('does not complain when presented with normal comments', function (done) { + assert.doesNotThrow(function () { + var query = "#normal comment\n query {\n author {\n ...authorDetails\n }\n }"; + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.equal(module.exports.kind, 'Document'); + done(); + }); + }); + it('returns the same object for the same query', function () { + assert.isTrue(gql(templateObject_10 || (templateObject_10 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql(templateObject_11 || (templateObject_11 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"])))); + }); + it('returns the same object for the same query, even with whitespace differences', function () { + assert.isTrue(gql(templateObject_12 || (templateObject_12 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql(templateObject_13 || (templateObject_13 = __makeTemplateObject([" { sameQuery, }"], [" { sameQuery, }"])))); + }); + var fragmentAst = gql(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"], ["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"]))); + it('returns the same object for the same fragment', function () { + assert.isTrue(gql(templateObject_15 || (templateObject_15 = __makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"]))) === gql(templateObject_16 || (templateObject_16 = __makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"])))); + }); + it('returns the same object for the same document with substitution', function () { + assert.isTrue(gql(templateObject_17 || (templateObject_17 = __makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst) === gql(templateObject_18 || (templateObject_18 = __makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst)); + }); + it('can reference a fragment that references as fragment', function () { + var secondFragmentAst = gql(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "], ["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "])), fragmentAst); + var ast = gql(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "])), secondFragmentAst); + assert.deepEqual(ast, gql(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "])))); + }); + describe('fragment warnings', function () { + var warnings = []; + var oldConsoleWarn = console.warn; + beforeEach(function () { + gql.resetCaches(); + warnings = []; + console.warn = function (w) { return warnings.push(w); }; + }); + afterEach(function () { + console.warn = oldConsoleWarn; + }); + it('warns if you use the same fragment name for different fragments', function () { + var frag1 = gql(templateObject_22 || (templateObject_22 = __makeTemplateObject(["fragment TestSame on Bar { fieldOne }"], ["fragment TestSame on Bar { fieldOne }"]))); + var frag2 = gql(templateObject_23 || (templateObject_23 = __makeTemplateObject(["fragment TestSame on Bar { fieldTwo }"], ["fragment TestSame on Bar { fieldTwo }"]))); + assert.isFalse(frag1 === frag2); + assert.equal(warnings.length, 1); + }); + it('does not warn if you use the same fragment name for the same fragment', function () { + var frag1 = gql(templateObject_24 || (templateObject_24 = __makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"]))); + var frag2 = gql(templateObject_25 || (templateObject_25 = __makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"]))); + assert.isTrue(frag1 === frag2); + assert.equal(warnings.length, 0); + }); + it('does not warn if you use the same embedded fragment in two different queries', function () { + var frag1 = gql(templateObject_26 || (templateObject_26 = __makeTemplateObject(["fragment TestEmbedded on Bar { field }"], ["fragment TestEmbedded on Bar { field }"]))); + var query1 = gql(templateObject_27 || (templateObject_27 = __makeTemplateObject(["{ bar { fieldOne ...TestEmbedded } } ", ""], ["{ bar { fieldOne ...TestEmbedded } } ", ""])), frag1); + var query2 = gql(templateObject_28 || (templateObject_28 = __makeTemplateObject(["{ bar { fieldTwo ...TestEmbedded } } ", ""], ["{ bar { fieldTwo ...TestEmbedded } } ", ""])), frag1); + assert.isFalse(query1 === query2); + assert.equal(warnings.length, 0); + }); + it('does not warn if you use the same fragment name for embedded and non-embedded fragments', function () { + var frag1 = gql(templateObject_29 || (templateObject_29 = __makeTemplateObject(["fragment TestEmbeddedTwo on Bar { field }"], ["fragment TestEmbeddedTwo on Bar { field }"]))); + gql(templateObject_30 || (templateObject_30 = __makeTemplateObject(["{ bar { ...TestEmbedded } } ", ""], ["{ bar { ...TestEmbedded } } ", ""])), frag1); + gql(templateObject_31 || (templateObject_31 = __makeTemplateObject(["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"], ["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"]))); + assert.equal(warnings.length, 0); + }); + }); + describe('unique fragments', function () { + beforeEach(function () { + gql.resetCaches(); + }); + it('strips duplicate fragments from the document', function () { + var frag1 = gql(templateObject_32 || (templateObject_32 = __makeTemplateObject(["fragment TestDuplicate on Bar { field }"], ["fragment TestDuplicate on Bar { field }"]))); + var query1 = gql(templateObject_33 || (templateObject_33 = __makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", " ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", " ", ""])), frag1, frag1); + var query2 = gql(templateObject_34 || (templateObject_34 = __makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", ""])), frag1); + assert.equal(query1.definitions.length, 2); + assert.equal(query1.definitions[1].kind, 'FragmentDefinition'); + assert.deepEqual(query1.definitions, query2.definitions); + }); + it('ignores duplicate fragments from second-level imports when using the webpack loader', function () { + var load = function (require, query) { + var jsSource = loader.call({ cacheable: function () { } }, query); + var module = { exports: Object.create(null) }; + Function("require,module", jsSource)(require, module); + return module.exports; + }; + var test_require = function (path) { + switch (path) { + case './friends.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment friends on Hero { friends { ...person } }', + ].join('\n')); + case './enemies.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment enemies on Hero { enemies { ...person } }', + ].join('\n')); + case './person.graphql': + return load(test_require, 'fragment person on Person { name }\n'); + default: + return null; + } + ; + }; + var result = load(test_require, [ + '#import "./friends.graphql"', + '#import "./enemies.graphql"', + 'query { hero { ...friends ...enemies } }', + ].join('\n')); + assert.equal(result.kind, 'Document'); + assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain'); + assert.equal(result.definitions[0].kind, 'OperationDefinition'); + var fragments = result.definitions.slice(1); + assert(fragments.every(function (fragment) { return fragment.kind === 'FragmentDefinition'; })); + assert(fragments.some(function (fragment) { return fragment.name.value === 'friends'; })); + assert(fragments.some(function (fragment) { return fragment.name.value === 'enemies'; })); + assert(fragments.some(function (fragment) { return fragment.name.value === 'person'; })); + }); + }); +}); +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34; +//# sourceMappingURL=tests.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js.map b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js.map new file mode 100644 index 00000000..8b2d4948 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/lib/tests.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tests.js","sourceRoot":"","sources":["../src/tests.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,OAAO,GAAG,MAAM,SAAS,CAAC;AAC1B,IAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEpC,QAAQ,CAAC,KAAK,EAAE;IACd,EAAE,CAAC,gBAAgB,EAAE;QACnB,MAAM,CAAC,KAAK,CAAC,GAAG,kFAAA,eAAe,KAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC5C,IAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,GAAG,+FAAA,mBAAmB,EAAW,OAAM,KAAjB,GAAG,CAAC,OAAO,EAAO,IAAI,EAAE,UAAU,CAAC,CAAC;QACvE,MAAM,CAAC,KAAK,CAAC,GAAG,+FAAA,mBAAmB,EAAI,OAAM,KAAV,IAAI,EAAO,IAAI,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,KAAK,CAAC,GAAG,+FAAA,mBAAmB,EAAC,OAAM,KAAP,CAAC,EAAO,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE;QACtE,IAAM,YAAY,GAAG,qDAAqD,CAAC;Q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,IAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAA6B,CAAC;YAC1E,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,KAAK,oBAAoB,EAAtC,CAAsC,CAAC,CAAC,CAAA;YAC3E,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,EAAjC,CAAiC,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,EAAjC,CAAiC,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAhC,CAAgC,CAAC,CAAC,CAAA;QACtE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AAwBL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/loader.js b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/loader.js new file mode 100644 index 00000000..e40e5dad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/loader.js @@ -0,0 +1,191 @@ +"use strict"; + +const os = require('os'); +const gql = require('./main.js'); + +// Takes `source` (the source GraphQL query string) +// and `doc` (the parsed GraphQL document) and tacks on +// the imported definitions. +function expandImports(source, doc) { + const lines = source.split(/\r\n|\r|\n/); + let outputCode = ` + var names = {}; + function unique(defs) { + return defs.filter( + function(def) { + if (def.kind !== 'FragmentDefinition') return true; + var name = def.name.value + if (names[name]) { + return false; + } else { + names[name] = true; + return true; + } + } + ) + } + `; + + lines.some((line) => { + const result = line.match(/^#\s?import (.+)$/); + if (result) { + const importFile = result[1]; + const parseDocument = `require(${importFile})`; + const appendDef = `doc.definitions = doc.definitions.concat(unique(${parseDocument}.definitions));`; + outputCode += appendDef + os.EOL; + } + return (line.length !== 0 && line[0] !== '#'); + }); + + return outputCode; +} + +module.exports = function(source) { + this.cacheable(); + const doc = gql`${source}`; + let headerCode = ` + var doc = ${JSON.stringify(doc)}; + doc.loc.source = ${JSON.stringify(doc.loc.source)}; + `; + + let outputCode = ""; + + // Allow multiple query/mutation definitions in a file. This parses out dependencies + // at compile time, and then uses those at load time to create minimal query documents + // We cannot do the latter at compile time due to how the #import code works. + let operationCount = doc.definitions.reduce(function(accum, op) { + if (op.kind === "OperationDefinition" || op.kind === "FragmentDefinition") { + return accum + 1; + } + + return accum; + }, 0); + + if (operationCount < 1) { + outputCode += ` + module.exports = doc; + ` + } else { + outputCode += ` + // Collect any fragment/type references from a node, adding them to the refs Set + function collectFragmentReferences(node, refs) { + if (node.kind === "FragmentSpread") { + refs.add(node.name.value); + } else if (node.kind === "VariableDefinition") { + var type = node.type; + if (type.kind === "NamedType") { + refs.add(type.name.value); + } + } + + if (node.selectionSet) { + node.selectionSet.selections.forEach(function(selection) { + collectFragmentReferences(selection, refs); + }); + } + + if (node.variableDefinitions) { + node.variableDefinitions.forEach(function(def) { + collectFragmentReferences(def, refs); + }); + } + + if (node.definitions) { + node.definitions.forEach(function(def) { + collectFragmentReferences(def, refs); + }); + } + } + + var definitionRefs = {}; + (function extractReferences() { + doc.definitions.forEach(function(def) { + if (def.name) { + var refs = new Set(); + collectFragmentReferences(def, refs); + definitionRefs[def.name.value] = refs; + } + }); + })(); + + function findOperation(doc, name) { + for (var i = 0; i < doc.definitions.length; i++) { + var element = doc.definitions[i]; + if (element.name && element.name.value == name) { + return element; + } + } + } + + function oneQuery(doc, operationName) { + // Copy the DocumentNode, but clear out the definitions + var newDoc = { + kind: doc.kind, + definitions: [findOperation(doc, operationName)] + }; + if (doc.hasOwnProperty("loc")) { + newDoc.loc = doc.loc; + } + + // Now, for the operation we're running, find any fragments referenced by + // it or the fragments it references + var opRefs = definitionRefs[operationName] || new Set(); + var allRefs = new Set(); + var newRefs = new Set(); + + // IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one + opRefs.forEach(function(refName) { + newRefs.add(refName); + }); + + while (newRefs.size > 0) { + var prevRefs = newRefs; + newRefs = new Set(); + + prevRefs.forEach(function(refName) { + if (!allRefs.has(refName)) { + allRefs.add(refName); + var childRefs = definitionRefs[refName] || new Set(); + childRefs.forEach(function(childRef) { + newRefs.add(childRef); + }); + } + }); + } + + allRefs.forEach(function(refName) { + var op = findOperation(doc, refName); + if (op) { + newDoc.definitions.push(op); + } + }); + + return newDoc; + } + + module.exports = doc; + ` + + for (const op of doc.definitions) { + if (op.kind === "OperationDefinition" || op.kind === "FragmentDefinition") { + if (!op.name) { + if (operationCount > 1) { + throw new Error("Query/mutation names are required for a document with multiple definitions"); + } else { + continue; + } + } + + const opName = op.name.value; + outputCode += ` + module.exports["${opName}"] = oneQuery(doc, "${opName}"); + ` + } + } + } + + const importOutputCode = expandImports(source, doc); + const allCode = headerCode + os.EOL + importOutputCode + os.EOL + outputCode + os.EOL; + + return allCode; +}; diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/main.js b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/main.js new file mode 100644 index 00000000..2a4de05c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/main.js @@ -0,0 +1,3 @@ +// For backwards compatibility, make sure require("graphql-tag") returns +// the gql function, rather than an exports object. +module.exports = require('./lib/graphql-tag.umd.js').gql; diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/package.json b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/package.json new file mode 100644 index 00000000..71a1d282 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/package.json @@ -0,0 +1,65 @@ +{ + "name": "graphql-tag", + "version": "2.12.7", + "description": "A JavaScript template literal tag that parses GraphQL queries", + "main": "./main.js", + "module": "./lib/index.js", + "jsnext:main": "./lib/index.js", + "types": "./lib/index.d.ts", + "sideEffects": false, + "scripts": { + "prebuild": "rimraf lib", + "build": "./run_tsc.sh && rollup -c && npm run flow", + "flow": "cp src/index.js.flow lib/graphql-tag.umd.js.flow", + "test": "npm run test:ts3 && npm run test:ts4", + "test:ts3": "npm i --no-save typescript@3.7.x graphql@15.x.x && npm run test:mocha", + "test:ts4": "npm i --no-save typescript@4.x.x graphql@16.5.0 && npm run test:mocha", + "test:ts6": "npm i --no-save typescript@6.x.x graphql@17.x.x && npm run test:mocha", + "test:mocha": "npm run build && mocha lib/tests.cjs.js", + "prepublish": "npm run build", + "changeset": "changeset", + "changeset-version": "changeset version && npm install --package-lock-only", + "changeset-publish": "changeset publish" + }, + "files": [ + "lib/", + "src/", + "loader.js", + "main.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/graphql-tag.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/apollographql/graphql-tag/issues" + }, + "homepage": "https://github.com/apollographql/graphql-tag#readme", + "dependencies": { + "tslib": "^2.1.0" + }, + "devDependencies": { + "@changesets/changelog-github": "^0.7.0", + "@changesets/cli": "^2.31.0", + "@types/chai": "^4.2.14", + "@types/mocha": "^8.2.0", + "@types/node": "^18.0.6", + "chai": "^4.2.0", + "graphql": "^16.0.1", + "mocha": "^9.0.1", + "rimraf": "^3.0.2", + "rollup": "^2.33.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "source-map-support": "^0.5.19", + "test-all-versions": "^5.0.1", + "typescript": "^4.9.5" + }, + "peerDependencies": { + "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + }, + "engines": { + "node": ">=10" + } +} diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.js.flow b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.js.flow new file mode 100644 index 00000000..7acb6237 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.js.flow @@ -0,0 +1,7 @@ +// @flow + +import type { DocumentNode } from 'graphql'; + +declare export default function gql(literals: any, ...placeholders: any[]): DocumentNode; +declare export function resetCaches(): void; +declare export function disableFragmentWarnings(): void; diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.ts b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.ts new file mode 100644 index 00000000..b81f124e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/index.ts @@ -0,0 +1,178 @@ +import { parse } from 'graphql'; + +import { + DocumentNode, + DefinitionNode, + Location, +} from 'graphql/language/ast'; + +// A map docString -> graphql document +const docCache = new Map(); + +// A map fragmentName -> [normalized source] +const fragmentSourceMap = new Map>(); + +let printFragmentWarnings = true; +let experimentalFragmentVariables = false; + +// Strip insignificant whitespace +// Note that this could do a lot more, such as reorder fields etc. +function normalize(string: string) { + return string.replace(/[\s,]+/g, ' ').trim(); +} + +function cacheKeyFromLoc(loc: Location) { + return normalize(loc.source.body.substring(loc.start, loc.end)); +} + +// Take a unstripped parsed document (query/mutation or even fragment), and +// check all fragment definitions, checking for name->source uniqueness. +// We also want to make sure only unique fragments exist in the document. +function processFragments(ast: DocumentNode) { + const seenKeys = new Set(); + const definitions: DefinitionNode[] = []; + + ast.definitions.forEach(fragmentDefinition => { + if (fragmentDefinition.kind === 'FragmentDefinition') { + var fragmentName = fragmentDefinition.name.value; + var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc!); + + // We know something about this fragment + let sourceKeySet = fragmentSourceMap.get(fragmentName)!; + if (sourceKeySet && !sourceKeySet.has(sourceKey)) { + // this is a problem because the app developer is trying to register another fragment with + // the same name as one previously registered. So, we tell them about it. + if (printFragmentWarnings) { + console.warn("Warning: fragment with name " + fragmentName + " already exists.\n" + + "graphql-tag enforces all fragment names across your application to be unique; read more about\n" + + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"); + } + } else if (!sourceKeySet) { + fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); + } + + sourceKeySet.add(sourceKey); + + if (!seenKeys.has(sourceKey)) { + seenKeys.add(sourceKey); + definitions.push(fragmentDefinition); + } + } else { + definitions.push(fragmentDefinition); + } + }); + + return { + ...ast, + definitions, + }; +} + +function stripLoc(doc: DocumentNode) { + const workSet = new Set>(doc.definitions); + + workSet.forEach(node => { + if (node.loc) delete node.loc; + Object.keys(node).forEach(key => { + const value = node[key]; + if (value && typeof value === 'object') { + workSet.add(value); + } + }); + }); + + const loc = doc.loc as Record; + if (loc) { + delete loc.startToken; + delete loc.endToken; + } + + return doc; +} + +function parseDocument(source: string) { + var cacheKey = normalize(source); + if (!docCache.has(cacheKey)) { + const parsed = parse(source, { + // graphql 14,15,16 + experimentalFragmentVariables, + // graphql 14 + allowLegacyFragmentVariables: experimentalFragmentVariables, + // graphql 17 + experimentalFragmentArguments: experimentalFragmentVariables, + } as any); + if (!parsed || parsed.kind !== 'Document') { + throw new Error('Not a valid GraphQL document.'); + } + docCache.set( + cacheKey, + // check that all "new" fragments inside the documents are consistent with + // existing fragments of the same name + stripLoc(processFragments(parsed)), + ); + } + return docCache.get(cacheKey)!; +} + +// XXX This should eventually disallow arbitrary string interpolation, like Relay does +export function gql( + literals: string | readonly string[], + ...args: any[] +) { + + if (typeof literals === 'string') { + literals = [literals]; + } + + let result = literals[0]; + + args.forEach((arg, i) => { + if (arg && arg.kind === 'Document') { + result += arg.loc.source.body; + } else { + result += arg; + } + result += literals[i + 1]; + }); + + return parseDocument(result); +} + +export function resetCaches() { + docCache.clear(); + fragmentSourceMap.clear(); +} + +export function disableFragmentWarnings() { + printFragmentWarnings = false; +} + +export function enableExperimentalFragmentVariables() { + experimentalFragmentVariables = true; +} + +export function disableExperimentalFragmentVariables() { + experimentalFragmentVariables = false; +} + +const extras = { + gql, + resetCaches, + disableFragmentWarnings, + enableExperimentalFragmentVariables, + disableExperimentalFragmentVariables, +}; + +export namespace gql { + export const { + gql, + resetCaches, + disableFragmentWarnings, + enableExperimentalFragmentVariables, + disableExperimentalFragmentVariables, + } = extras; +} + +gql.default = gql; + +export default gql; diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/tests.ts b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/tests.ts new file mode 100644 index 00000000..453d5085 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag/src/tests.ts @@ -0,0 +1,516 @@ +import 'source-map-support/register'; + +import { assert } from 'chai'; +import { DocumentNode, FragmentDefinitionNode } from 'graphql'; + +import gql from './index'; +const loader = require('../loader'); + +describe('gql', () => { + it('parses queries', () => { + assert.equal(gql`{ testQuery }`.kind, 'Document'); + }); + + it('parses queries when called as a function', () => { + assert.equal(gql('{ testQuery }').kind, 'Document'); + }); + + it('parses queries with weird substitutions', () => { + const obj = Object.create(null); + assert.equal(gql`{ field(input: "${obj.missing}") }`.kind, 'Document'); + assert.equal(gql`{ field(input: "${null}") }`.kind, 'Document'); + assert.equal(gql`{ field(input: "${0}") }`.kind, 'Document'); + }); + + it('allows interpolation of documents generated by the webpack loader', () => { + const sameFragment = "fragment SomeFragmentName on SomeType { someField }"; + + const jsSource = loader.call( + { cacheable() {} }, + sameFragment, + ); + const module = { exports: Object.create(null) }; + + Function("module", jsSource)(module); + + const document = gql`query { ...SomeFragmentName } ${module.exports}`; + assert.equal(document.kind, 'Document'); + assert.equal(document.definitions.length, 2); + assert.equal(document.definitions[0].kind, 'OperationDefinition'); + assert.equal(document.definitions[1].kind, 'FragmentDefinition'); + }); + + it('parses queries through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, '{ testQuery }'); + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.equal(module.exports.kind, 'Document'); + }); + + it('parses single query through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + `); + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + + assert.equal(module.exports.kind, 'Document'); + assert.exists(module.exports.Q1); + assert.equal(module.exports.Q1.kind, 'Document'); + assert.equal(module.exports.Q1.definitions.length, 1); + }); + + it('parses single query and exports as default', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + `); + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions); + }); + + it('parses multiple queries through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + query Q2 { testQuery2 } + `); + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + assert.equal(module.exports.Q1.kind, 'Document'); + assert.equal(module.exports.Q2.kind, 'Document'); + assert.equal(module.exports.Q1.definitions.length, 1); + assert.equal(module.exports.Q2.definitions.length, 1); + }); + + it('parses fragments with variable definitions', () => { + gql.enableExperimentalFragmentVariables(); + + const parsed: any = gql`fragment A ($arg: String!) on Type { testQuery }`; + assert.equal(parsed.kind, 'Document'); + assert.exists(parsed.definitions[0].variableDefinitions); + + gql.disableExperimentalFragmentVariables() + }); + + // see https://github.com/apollographql/graphql-tag/issues/168 + it('does not nest queries needlessly in named exports', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + query Q2 { testQuery2 } + query Q3 { test Query3 } + `); + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + + assert.notExists(module.exports.Q2.Q1); + assert.notExists(module.exports.Q3.Q1); + assert.notExists(module.exports.Q3.Q2); + }); + + it('tracks fragment dependencies from multiple queries through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, ` + fragment F1 on F { testQuery } + fragment F2 on F { testQuery2 } + fragment F3 on F { testQuery3 } + query Q1 { ...F1 } + query Q2 { ...F2 } + query Q3 { + ...F1 + ...F2 + } + `); + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + assert.exists(module.exports.Q3); + const Q1 = module.exports.Q1.definitions; + const Q2 = module.exports.Q2.definitions; + const Q3 = module.exports.Q3.definitions; + + assert.equal(Q1.length, 2); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F1'); + + assert.equal(Q2.length, 2); + assert.equal(Q2[0].name.value, 'Q2'); + assert.equal(Q2[1].name.value, 'F2'); + + assert.equal(Q3.length, 3); + assert.equal(Q3[0].name.value, 'Q3'); + assert.equal(Q3[1].name.value, 'F1'); + assert.equal(Q3[2].name.value, 'F2'); + + const F1 = module.exports.F1.definitions; + const F2 = module.exports.F2.definitions; + const F3 = module.exports.F3.definitions; + + assert.equal(F1.length, 1); + assert.equal(F1[0].name.value, 'F1'); + assert.equal(F2.length, 1); + assert.equal(F2[0].name.value, 'F2'); + assert.equal(F3.length, 1); + assert.equal(F3[0].name.value, 'F3'); + + }); + + it('tracks fragment dependencies across nested fragments', () => { + const jsSource = loader.call({ cacheable() {} }, ` + fragment F11 on F { testQuery } + fragment F22 on F { + ...F11 + testQuery2 + } + fragment F33 on F { + ...F22 + testQuery3 + } + + query Q1 { + ...F33 + } + + query Q2 { + id + } + `); + + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + + const Q1 = module.exports.Q1.definitions; + const Q2 = module.exports.Q2.definitions; + + assert.equal(Q1.length, 4); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F33'); + assert.equal(Q1[2].name.value, 'F22'); + assert.equal(Q1[3].name.value, 'F11'); + + assert.equal(Q2.length, 1); + + const F11 = module.exports.F11.definitions; + const F22 = module.exports.F22.definitions; + const F33 = module.exports.F33.definitions; + + assert.equal(F11.length, 1); + assert.equal(F11[0].name.value, 'F11'); + assert.equal(F22.length, 2); + assert.equal(F22[0].name.value, 'F22'); + assert.equal(F22[1].name.value, 'F11'); + assert.equal(F33.length, 3); + assert.equal(F33[0].name.value, 'F33'); + assert.equal(F33[1].name.value, 'F22'); + assert.equal(F33[2].name.value, 'F11'); + }); + + it('correctly imports other files through the webpack loader', () => { + const query = `#import "./fragment_definition.graphql" + query { + author { + ...authorDetails + } + }`; + const jsSource = loader.call({ cacheable() {} }, query); + const module = { exports: Object.create(null) }; + const require = (path: string) => { + assert.equal(path, './fragment_definition.graphql'); + return gql` + fragment authorDetails on Author { + firstName + lastName + }`; + }; + Function("module,require", jsSource)(module, require); + assert.equal(module.exports.kind, 'Document'); + const definitions = module.exports.definitions; + assert.equal(definitions.length, 2); + assert.equal(definitions[0].kind, 'OperationDefinition'); + assert.equal(definitions[1].kind, 'FragmentDefinition'); + }); + + it('importing files also works with a space between `#` and `import`', () => { + const query = `# import "./fragment_definition.graphql" + query { + author { + ...authorDetails + } + }`; + const jsSource = loader.call({ cacheable() {} }, query); + const module = { exports: Object.create(null) }; + const require = (path: string) => { + assert.equal(path, './fragment_definition.graphql'); + return gql` + fragment authorDetails on Author { + firstName + lastName + }`; + }; + Function("module,require", jsSource)(module, require); + assert.equal(module.exports.kind, 'Document'); + const definitions = module.exports.definitions; + assert.equal(definitions.length, 2); + assert.equal(definitions[0].kind, 'OperationDefinition'); + assert.equal(definitions[1].kind, 'FragmentDefinition'); + }); + + it('tracks fragment dependencies across fragments loaded via the webpack loader', () => { + const query = `#import "./fragment_definition.graphql" + fragment F111 on F { + ...F222 + } + + query Q1 { + ...F111 + } + + query Q2 { + a + } + `; + const jsSource = loader.call({ cacheable() {} }, query); + const module = { exports: Object.create(null) }; + const require = (path: string) => { + assert.equal(path, './fragment_definition.graphql'); + return gql` + fragment F222 on F { + f1 + f2 + }`; + }; + Function("module,require", jsSource)(module, require); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + + const Q1 = module.exports.Q1.definitions; + const Q2 = module.exports.Q2.definitions; + + assert.equal(Q1.length, 3); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F111'); + assert.equal(Q1[2].name.value, 'F222'); + + assert.equal(Q2.length, 1); + }); + + it('does not complain when presented with normal comments', (done) => { + assert.doesNotThrow(() => { + const query = `#normal comment + query { + author { + ...authorDetails + } + }`; + const jsSource = loader.call({ cacheable() {} }, query); + const module = { exports: Object.create(null) }; + Function("module", jsSource)(module); + assert.equal(module.exports.kind, 'Document'); + done(); + }); + }); + + it('returns the same object for the same query', () => { + assert.isTrue(gql`{ sameQuery }` === gql`{ sameQuery }`); + }); + + it('returns the same object for the same query, even with whitespace differences', () => { + assert.isTrue(gql`{ sameQuery }` === gql` { sameQuery, }`); + }); + + const fragmentAst = gql` + fragment UserFragment on User { + firstName + lastName + } +`; + + it('returns the same object for the same fragment', () => { + assert.isTrue(gql`fragment same on Same { sameQuery }` === + gql`fragment same on Same { sameQuery }`); + }); + + it('returns the same object for the same document with substitution', () => { + // We know that calling `gql` on a fragment string will always return + // the same document, so we can reuse `fragmentAst` + assert.isTrue(gql`{ ...UserFragment } ${fragmentAst}` === + gql`{ ...UserFragment } ${fragmentAst}`); + }); + + it('can reference a fragment that references as fragment', () => { + const secondFragmentAst = gql` + fragment SecondUserFragment on User { + ...UserFragment + } + ${fragmentAst} + `; + + const ast = gql` + { + user(id: 5) { + ...SecondUserFragment + } + } + ${secondFragmentAst} + `; + + assert.deepEqual(ast, gql` + { + user(id: 5) { + ...SecondUserFragment + } + } + fragment SecondUserFragment on User { + ...UserFragment + } + fragment UserFragment on User { + firstName + lastName + } + `); + }); + + describe('fragment warnings', () => { + let warnings = []; + const oldConsoleWarn = console.warn; + beforeEach(() => { + gql.resetCaches(); + warnings = []; + console.warn = (w: string) => warnings.push(w); + }); + afterEach(() => { + console.warn = oldConsoleWarn; + }); + + it('warns if you use the same fragment name for different fragments', () => { + const frag1 = gql`fragment TestSame on Bar { fieldOne }`; + const frag2 = gql`fragment TestSame on Bar { fieldTwo }`; + + assert.isFalse(frag1 === frag2); + assert.equal(warnings.length, 1); + }); + + it('does not warn if you use the same fragment name for the same fragment', () => { + const frag1 = gql`fragment TestDifferent on Bar { fieldOne }`; + const frag2 = gql`fragment TestDifferent on Bar { fieldOne }`; + + assert.isTrue(frag1 === frag2); + assert.equal(warnings.length, 0); + }); + + it('does not warn if you use the same embedded fragment in two different queries', () => { + const frag1 = gql`fragment TestEmbedded on Bar { field }`; + const query1 = gql`{ bar { fieldOne ...TestEmbedded } } ${frag1}`; + const query2 = gql`{ bar { fieldTwo ...TestEmbedded } } ${frag1}`; + + assert.isFalse(query1 === query2); + assert.equal(warnings.length, 0); + }); + + it('does not warn if you use the same fragment name for embedded and non-embedded fragments', () => { + const frag1 = gql`fragment TestEmbeddedTwo on Bar { field }`; + gql`{ bar { ...TestEmbedded } } ${frag1}`; + gql`{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }`; + + assert.equal(warnings.length, 0); + }); + }); + + describe('unique fragments', () => { + beforeEach(() => { + gql.resetCaches(); + }); + + it('strips duplicate fragments from the document', () => { + const frag1 = gql`fragment TestDuplicate on Bar { field }`; + const query1 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1} ${frag1}`; + const query2 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1}`; + + assert.equal(query1.definitions.length, 2); + assert.equal(query1.definitions[1].kind, 'FragmentDefinition'); + // We don't test strict equality between the two queries because the source.body parsed from the + // document is not the same, but the set of definitions should be. + assert.deepEqual(query1.definitions, query2.definitions); + }); + + it('ignores duplicate fragments from second-level imports when using the webpack loader', () => { + // take a require function and a query string, use the webpack loader to process it + const load = ( + require: (path: string) => DocumentNode | null, + query: string, + ): DocumentNode | null => { + const jsSource = loader.call({ cacheable() {} }, query); + const module = { exports: Object.create(null) }; + Function("require,module", jsSource)(require, module); + return module.exports; + } + + const test_require = (path: string) => { + switch (path) { + case './friends.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment friends on Hero { friends { ...person } }', + ].join('\n')); + case './enemies.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment enemies on Hero { enemies { ...person } }', + ].join('\n')); + case './person.graphql': + return load(test_require, 'fragment person on Person { name }\n'); + default: + return null; + }; + }; + + const result = load(test_require, [ + '#import "./friends.graphql"', + '#import "./enemies.graphql"', + 'query { hero { ...friends ...enemies } }', + ].join('\n'))!; + + assert.equal(result.kind, 'Document'); + assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain'); + assert.equal(result.definitions[0].kind, 'OperationDefinition'); + + // the rest of the definitions should be fragments and contain one of + // each: "friends", "enemies", "person". Order does not matter + const fragments = result.definitions.slice(1) as FragmentDefinitionNode[]; + assert(fragments.every(fragment => fragment.kind === 'FragmentDefinition')) + assert(fragments.some(fragment => fragment.name.value === 'friends')) + assert(fragments.some(fragment => fragment.name.value === 'enemies')) + assert(fragments.some(fragment => fragment.name.value === 'person')) + }); + }); + + // How to make this work? + // it.only('can reference a fragment passed as a document via shorthand', () => { + // const ast = gql` + // { + // user(id: 5) { + // ...${userFragmentDocument} + // } + // } + // `; + // + // assert.deepEqual(ast, gql` + // { + // user(id: 5) { + // ...UserFragment + // } + // } + // fragment UserFragment on User { + // firstName + // lastName + // } + // `); + // }); +}); diff --git a/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/tslib b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/tslib new file mode 120000 index 00000000..4edba0e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/tslib @@ -0,0 +1 @@ +../../tslib@2.8.1/node_modules/tslib \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/LICENSE b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/LICENSE new file mode 100644 index 00000000..7bbf892a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) GraphQL Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/NotSupportedTSVersion.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/NotSupportedTSVersion.d.ts new file mode 100644 index 00000000..05d0ede0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/NotSupportedTSVersion.d.ts @@ -0,0 +1 @@ +"Package 'graphql' support only TS versions that are >=4.4.0". \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/README.md b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/README.md new file mode 100644 index 00000000..92407913 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/README.md @@ -0,0 +1,197 @@ +# GraphQL.js + +The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook. + +[![npm version](https://badge.fury.io/js/graphql.svg)](https://badge.fury.io/js/graphql) +[![Build Status](https://github.com/graphql/graphql-js/actions/workflows/push.yml/badge.svg?branch=17.x.x)](https://github.com/graphql/graphql-js/actions/workflows/push.yml?query=branch%3A17.x.x) + +See more complete documentation at https://graphql.org/ and +https://graphql.org/graphql-js/. + +Looking for help? Find resources [from the community](https://graphql.org/community/). + +## Getting Started + +A general overview of GraphQL is available in the +[README](https://github.com/graphql/graphql-spec/blob/main/README.md) for the +[Specification for GraphQL](https://github.com/graphql/graphql-spec). That overview +describes a simple set of GraphQL examples that exist as [tests](src/__tests__) +in this repository. A good way to get started with this repository is to walk +through that README and the corresponding tests in parallel. + +### Using GraphQL.js + +Install GraphQL.js from npm + +With `npm`: + +```sh +npm install --save graphql +``` + +With `yarn`: + +```sh +yarn add graphql +``` + +With `bun`: + +```sh +bun add graphql +``` + +GraphQL.js provides two important capabilities: building a type schema and +serving queries against that type schema. + +First, build a GraphQL type schema which maps to your codebase. + +```js +import { + graphql, + GraphQLSchema, + GraphQLObjectType, + GraphQLString, +} from 'graphql'; + +var schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'RootQueryType', + fields: { + hello: { + type: GraphQLString, + resolve() { + return 'world'; + }, + }, + }, + }), +}); +``` + +This defines a simple schema, with one type and one field, that resolves +to a fixed value. The `resolve` function can return a value, a promise, +or an array of promises. A more complex example is included in the top-level [tests](src/__tests__) directory. + +Then, serve the result of a query against that type schema. + +```js +var source = '{ hello }'; + +graphql({ schema, source }).then((result) => { + // Prints + // { + // data: { hello: "world" } + // } + console.log(result); +}); +``` + +This runs a query fetching the one field defined. The `graphql` function will +first ensure the query is syntactically and semantically valid before executing +it, reporting errors otherwise. + +```js +var source = '{ BoyHowdy }'; + +graphql({ schema, source }).then((result) => { + // Prints + // { + // errors: [ + // { message: 'Cannot query field BoyHowdy on RootQueryType', + // locations: [ { line: 1, column: 3 } ] } + // ] + // } + console.log(result); +}); +``` + +## Want to ride the bleeding edge? + +The `npm` branch in this repository is automatically maintained to be the last +commit to `17.x.x` to pass all tests, in the same form found on npm. It is +recommended to use builds deployed to npm for many reasons, but if you want to use +the latest not-yet-released version of graphql-js, you can do so by depending +directly on this branch: + +``` +npm install graphql@git://github.com/graphql/graphql-js.git#npm +``` + +## Using in a Browser + +GraphQL.js is a general-purpose library and can be used both in a Node server +and in the browser. As an example, the [GraphiQL](https://github.com/graphql/graphiql/) +tool is built with GraphQL.js! + +Building a project using GraphQL.js with [webpack](https://webpack.js.org) or +[rollup](https://github.com/rollup/rollup) should just work and only include +the portions of the library you use. This works because GraphQL.js is distributed +with both CommonJS (`require()`) and ESModule (`import`) files. The `exports` +map within the project `package.json` should direct runtimes and bundlers to +the appropriate files. Tools that do not support `exports` will find the CommonJS +and ESModule builds side by side, with the CommonJS code packaged +in files with the `.js` extension and the ESModule build within `.mjs` files. + +## Contributing + +We actively welcome pull requests. Learn how to [contribute](./.github/CONTRIBUTING.md). + +This repository is managed by EasyCLA. Project participants must sign the free [GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/). + +To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you. + +You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org). + +If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the [GraphQL Foundation](https://foundation.graphql.org/join). + +## Changelog + +Changes are tracked as [GitHub releases](https://github.com/graphql/graphql-js/releases). + +## License + +GraphQL.js is [MIT-licensed](./LICENSE). + +## Version Support + +GraphQL.JS follows Semantic Versioning (SemVer) for its releases. Our version support policy is as follows: + +- Latest Major Version: We provide full support, including bug fixes and security updates, for the latest major version of GraphQL.JS. +- Previous Major Version: We offer feature support for the previous major version for 12 months after the release of the newest major version. + This means that for 12 months we can backport features for specification changes _if_ they don't cause any breaking changes. We'll continue + supporting the previous major version with bug and security fixes. +- Older Versions: Versions older than the previous major release are considered unsupported. While the code remains available, + we do not actively maintain or provide updates for these versions. + One exception to this rule is when the older version has been released < 1 year ago, in that case we + will treat it like the "Previous Major Version". + +### Long-Term Support (LTS) + +We do not currently offer a Long-Term Support version of GraphQL.JS. Users are encouraged to upgrade to the latest stable version +to receive the most up-to-date features, performance improvements, and security updates. + +### End-of-Life (EOL) Schedule + +We will announce the EOL date for a major version at least 6 months in advance. +After a version reaches its EOL, it will no longer receive updates, even for critical security issues. + +### Upgrade Assistance + +To assist users in upgrading to newer versions: + +- We maintain detailed release notes for each version, highlighting new features, breaking changes, and deprecations. +- [Our documentation](https://www.graphql-js.org/) includes migration guides for moving between major versions. +- The [community forum (Discord channel #graphql-js)](https://discord.graphql.org) is available for users who need additional assistance with upgrades. + +### Security Updates + +We prioritize the security of GraphQL.JS: + +- Critical security updates will be applied to both the current and previous major version. +- For versions that have reached EOL, we strongly recommend upgrading to a supported version to receive security updates. + +### Community Contributions + +We welcome community contributions for all versions of GraphQL.JS. However, our maintainers will primarily focus on reviewing +and merging contributions for supported versions. diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.mts new file mode 100644 index 00000000..3c55b676 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.mts @@ -0,0 +1 @@ +export * from '../devMode.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.ts new file mode 100644 index 00000000..b8cafd9d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.d.ts @@ -0,0 +1 @@ +export * from '../devMode.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.js new file mode 100644 index 00000000..798ebef7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../devMode.js'); +enableDevMode(); +module.exports = require('../devMode.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.mjs new file mode 100644 index 00000000..0320ea71 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/devMode.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../devMode.mjs'; +enableDevMode(); +export * from '../devMode.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.mts new file mode 100644 index 00000000..5ea39bc2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.mts @@ -0,0 +1 @@ +export * from '../diagnostics.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.ts new file mode 100644 index 00000000..dcd4d84c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.d.ts @@ -0,0 +1 @@ +export * from '../diagnostics.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.js new file mode 100644 index 00000000..13d13678 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../devMode.js'); +enableDevMode(); +module.exports = require('../diagnostics.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.mjs new file mode 100644 index 00000000..af937919 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/diagnostics.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../devMode.mjs'; +enableDevMode(); +export * from '../diagnostics.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.mts new file mode 100644 index 00000000..d070c4d9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.mts @@ -0,0 +1 @@ +export * from '../../error/GraphQLError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.ts new file mode 100644 index 00000000..64ecc46a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.d.ts @@ -0,0 +1 @@ +export * from '../../error/GraphQLError.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.js new file mode 100644 index 00000000..0fb60c13 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../error/GraphQLError.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.mjs new file mode 100644 index 00000000..28026dc7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/GraphQLError.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../error/GraphQLError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.mts new file mode 100644 index 00000000..b015456d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.mts @@ -0,0 +1 @@ +export * from '../../error/ensureGraphQLError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.ts new file mode 100644 index 00000000..b42cb746 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.d.ts @@ -0,0 +1 @@ +export * from '../../error/ensureGraphQLError.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.js new file mode 100644 index 00000000..ad39e248 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../error/ensureGraphQLError.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.mjs new file mode 100644 index 00000000..87946c78 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/ensureGraphQLError.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../error/ensureGraphQLError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.mts new file mode 100644 index 00000000..2321b8c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.mts @@ -0,0 +1 @@ +export * from '../../error/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.ts new file mode 100644 index 00000000..494068c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.d.ts @@ -0,0 +1 @@ +export * from '../../error/index.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.js new file mode 100644 index 00000000..97207e2c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../error/index.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.mjs new file mode 100644 index 00000000..ce689718 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/index.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../error/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.mts new file mode 100644 index 00000000..ba0e1019 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.mts @@ -0,0 +1 @@ +export * from '../../error/locatedError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.ts new file mode 100644 index 00000000..e9e76adc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.d.ts @@ -0,0 +1 @@ +export * from '../../error/locatedError.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.js new file mode 100644 index 00000000..c3cc9f82 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../error/locatedError.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.mjs new file mode 100644 index 00000000..5352d0dc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/locatedError.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../error/locatedError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.mts new file mode 100644 index 00000000..eddadeaf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.mts @@ -0,0 +1 @@ +export * from '../../error/syntaxError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.ts new file mode 100644 index 00000000..c3c5996a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.d.ts @@ -0,0 +1 @@ +export * from '../../error/syntaxError.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.js new file mode 100644 index 00000000..94437454 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../error/syntaxError.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.mjs new file mode 100644 index 00000000..9cf029c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/error/syntaxError.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../error/syntaxError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.mts new file mode 100644 index 00000000..be665364 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.mts @@ -0,0 +1 @@ +export * from '../../execution/AbortedGraphQLExecutionError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.ts new file mode 100644 index 00000000..de82ae7c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.d.ts @@ -0,0 +1 @@ +export * from '../../execution/AbortedGraphQLExecutionError.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.js new file mode 100644 index 00000000..f433d54d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/AbortedGraphQLExecutionError.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.mjs new file mode 100644 index 00000000..8227be2c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AbortedGraphQLExecutionError.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/AbortedGraphQLExecutionError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.mts new file mode 100644 index 00000000..fabbd3f5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.mts @@ -0,0 +1 @@ +export * from '../../execution/AsyncWorkTracker.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.ts new file mode 100644 index 00000000..f464d784 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.d.ts @@ -0,0 +1 @@ +export * from '../../execution/AsyncWorkTracker.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.js new file mode 100644 index 00000000..0d5a9c4f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/AsyncWorkTracker.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.mjs new file mode 100644 index 00000000..44bbf5d9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/AsyncWorkTracker.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/AsyncWorkTracker.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.mts new file mode 100644 index 00000000..4972b876 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.mts @@ -0,0 +1 @@ +export * from '../../execution/ExecutionArgs.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.ts new file mode 100644 index 00000000..61255468 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.d.ts @@ -0,0 +1 @@ +export * from '../../execution/ExecutionArgs.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.js new file mode 100644 index 00000000..4ead2b21 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/ExecutionArgs.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.mjs new file mode 100644 index 00000000..5d267e3d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutionArgs.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/ExecutionArgs.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.mts new file mode 100644 index 00000000..0f3792d3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.mts @@ -0,0 +1 @@ +export * from '../../execution/Executor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.ts new file mode 100644 index 00000000..552db209 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.d.ts @@ -0,0 +1 @@ +export * from '../../execution/Executor.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.js new file mode 100644 index 00000000..a38b3274 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/Executor.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.mjs new file mode 100644 index 00000000..91c85835 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/Executor.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/Executor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.mts new file mode 100644 index 00000000..66b6fd4e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.mts @@ -0,0 +1 @@ +export * from '../../execution/ExecutorThrowingOnIncremental.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.ts new file mode 100644 index 00000000..97868e48 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.d.ts @@ -0,0 +1 @@ +export * from '../../execution/ExecutorThrowingOnIncremental.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.js new file mode 100644 index 00000000..15985796 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/ExecutorThrowingOnIncremental.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.mjs new file mode 100644 index 00000000..7ee1ee2f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/ExecutorThrowingOnIncremental.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/ExecutorThrowingOnIncremental.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.mts new file mode 100644 index 00000000..215c287a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.mts @@ -0,0 +1 @@ +export * from '../../execution/buildResolveInfo.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.ts new file mode 100644 index 00000000..50639766 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.d.ts @@ -0,0 +1 @@ +export * from '../../execution/buildResolveInfo.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.js new file mode 100644 index 00000000..a1b3398e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/buildResolveInfo.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.mjs new file mode 100644 index 00000000..3a1493e6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/buildResolveInfo.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/buildResolveInfo.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.mts new file mode 100644 index 00000000..852f47eb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.mts @@ -0,0 +1 @@ +export * from '../../execution/cancellablePromise.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.ts new file mode 100644 index 00000000..88a569b5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.d.ts @@ -0,0 +1 @@ +export * from '../../execution/cancellablePromise.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.js new file mode 100644 index 00000000..f10fd38f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/cancellablePromise.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.mjs new file mode 100644 index 00000000..9411dce3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/cancellablePromise.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/cancellablePromise.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.mts new file mode 100644 index 00000000..5d246065 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.mts @@ -0,0 +1 @@ +export * from '../../execution/collectFields.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.ts new file mode 100644 index 00000000..e0f2df4d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.d.ts @@ -0,0 +1 @@ +export * from '../../execution/collectFields.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.js new file mode 100644 index 00000000..5ac535fe --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/collectFields.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.mjs new file mode 100644 index 00000000..2aea816a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectFields.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/collectFields.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.mts new file mode 100644 index 00000000..4458f861 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.mts @@ -0,0 +1 @@ +export * from '../../execution/collectIteratorPromises.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.ts new file mode 100644 index 00000000..3e85b6c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.d.ts @@ -0,0 +1 @@ +export * from '../../execution/collectIteratorPromises.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.js new file mode 100644 index 00000000..d2e96e5f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/collectIteratorPromises.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.mjs new file mode 100644 index 00000000..e07d8951 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/collectIteratorPromises.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/collectIteratorPromises.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.mts new file mode 100644 index 00000000..4bc98933 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.mts @@ -0,0 +1 @@ +export * from '../../execution/createSharedExecutionContext.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.ts new file mode 100644 index 00000000..7c182362 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.d.ts @@ -0,0 +1 @@ +export * from '../../execution/createSharedExecutionContext.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.js new file mode 100644 index 00000000..e72b0b01 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/createSharedExecutionContext.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.mjs new file mode 100644 index 00000000..d077f494 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/createSharedExecutionContext.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/createSharedExecutionContext.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.mts new file mode 100644 index 00000000..870a74fb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.mts @@ -0,0 +1 @@ +export * from '../../execution/execute.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.ts new file mode 100644 index 00000000..9e4ac320 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.d.ts @@ -0,0 +1 @@ +export * from '../../execution/execute.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.js new file mode 100644 index 00000000..7c7c2280 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/execute.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.mjs new file mode 100644 index 00000000..8f248bd1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/execute.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/execute.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.mts new file mode 100644 index 00000000..1cd78656 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.mts @@ -0,0 +1 @@ +export * from '../../execution/getStreamUsage.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.ts new file mode 100644 index 00000000..a794a5e1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.d.ts @@ -0,0 +1 @@ +export * from '../../execution/getStreamUsage.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.js new file mode 100644 index 00000000..dc2a781e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/getStreamUsage.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.mjs new file mode 100644 index 00000000..42fb2159 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getStreamUsage.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/getStreamUsage.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.mts new file mode 100644 index 00000000..c2f6f2ff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.mts @@ -0,0 +1 @@ +export * from '../../execution/getVariableSignature.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.ts new file mode 100644 index 00000000..694a2091 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.d.ts @@ -0,0 +1 @@ +export * from '../../execution/getVariableSignature.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.js new file mode 100644 index 00000000..aa3061b2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/getVariableSignature.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.mjs new file mode 100644 index 00000000..7546d44b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/getVariableSignature.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/getVariableSignature.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.mts new file mode 100644 index 00000000..0ce38455 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.mts @@ -0,0 +1 @@ +export * from '../../execution/hooks.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.ts new file mode 100644 index 00000000..29c91103 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.d.ts @@ -0,0 +1 @@ +export * from '../../execution/hooks.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.js new file mode 100644 index 00000000..64a92d8c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/hooks.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.mjs new file mode 100644 index 00000000..4ac7c4b3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/hooks.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/hooks.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.mts new file mode 100644 index 00000000..9e2e755a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/Computation.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.ts new file mode 100644 index 00000000..99d841cb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/Computation.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.js new file mode 100644 index 00000000..698fd6dd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/incremental/Computation.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.mjs new file mode 100644 index 00000000..75d92ab0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Computation.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/incremental/Computation.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.mts new file mode 100644 index 00000000..b1aaf9e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/IncrementalExecutor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.ts new file mode 100644 index 00000000..55558ab0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/IncrementalExecutor.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.js new file mode 100644 index 00000000..632608c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/incremental/IncrementalExecutor.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.mjs new file mode 100644 index 00000000..c6da7066 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalExecutor.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/incremental/IncrementalExecutor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.mts new file mode 100644 index 00000000..ce69b39e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/IncrementalPublisher.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.ts new file mode 100644 index 00000000..d3dce5ec --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/IncrementalPublisher.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.js new file mode 100644 index 00000000..894e6b94 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/incremental/IncrementalPublisher.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.mjs new file mode 100644 index 00000000..590f3efc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/IncrementalPublisher.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/incremental/IncrementalPublisher.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.mts new file mode 100644 index 00000000..868dd5ca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/Queue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.ts new file mode 100644 index 00000000..f423651d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/Queue.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.js new file mode 100644 index 00000000..d8550082 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/incremental/Queue.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.mjs new file mode 100644 index 00000000..c2cceabe --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/Queue.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/incremental/Queue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.mts new file mode 100644 index 00000000..558f8bad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/WorkQueue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.ts new file mode 100644 index 00000000..4a5295b5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/WorkQueue.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.js new file mode 100644 index 00000000..4d6fd970 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/incremental/WorkQueue.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.mjs new file mode 100644 index 00000000..81eb19d0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/WorkQueue.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/incremental/WorkQueue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.mts new file mode 100644 index 00000000..8def512d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/buildExecutionPlan.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.ts new file mode 100644 index 00000000..ea0c2ca0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/incremental/buildExecutionPlan.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.js new file mode 100644 index 00000000..44b63c73 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/incremental/buildExecutionPlan.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.mjs new file mode 100644 index 00000000..d8b01b35 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/incremental/buildExecutionPlan.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/incremental/buildExecutionPlan.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.mts new file mode 100644 index 00000000..f5f9a67f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.mts @@ -0,0 +1 @@ +export * from '../../execution/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.ts new file mode 100644 index 00000000..a3da0298 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.d.ts @@ -0,0 +1 @@ +export * from '../../execution/index.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.js new file mode 100644 index 00000000..aa1abcfd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/index.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.mjs new file mode 100644 index 00000000..7bc9d8c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/index.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts new file mode 100644 index 00000000..7b4842be --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/legacyIncremental/BranchingIncrementalExecutor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts new file mode 100644 index 00000000..860196a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/legacyIncremental/BranchingIncrementalExecutor.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.js new file mode 100644 index 00000000..579d0957 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/legacyIncremental/BranchingIncrementalExecutor.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.mjs new file mode 100644 index 00000000..728c7825 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalExecutor.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/legacyIncremental/BranchingIncrementalExecutor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts new file mode 100644 index 00000000..e19db572 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/legacyIncremental/BranchingIncrementalPublisher.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts new file mode 100644 index 00000000..27f74867 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/legacyIncremental/BranchingIncrementalPublisher.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.js new file mode 100644 index 00000000..73f99dab --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/legacyIncremental/BranchingIncrementalPublisher.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.mjs new file mode 100644 index 00000000..f26bfdc0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/BranchingIncrementalPublisher.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/legacyIncremental/BranchingIncrementalPublisher.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.mts new file mode 100644 index 00000000..54fbd14d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.mts @@ -0,0 +1 @@ +export * from '../../../execution/legacyIncremental/legacyExecuteIncrementally.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.ts new file mode 100644 index 00000000..21263147 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.d.ts @@ -0,0 +1 @@ +export * from '../../../execution/legacyIncremental/legacyExecuteIncrementally.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.js new file mode 100644 index 00000000..8bd72568 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../execution/legacyIncremental/legacyExecuteIncrementally.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.mjs new file mode 100644 index 00000000..0aef4c49 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/legacyIncremental/legacyExecuteIncrementally.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../execution/legacyIncremental/legacyExecuteIncrementally.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.mts new file mode 100644 index 00000000..bf70e9c4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.mts @@ -0,0 +1 @@ +export * from '../../execution/mapAsyncIterable.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.ts new file mode 100644 index 00000000..648cedca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.d.ts @@ -0,0 +1 @@ +export * from '../../execution/mapAsyncIterable.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.js new file mode 100644 index 00000000..6830b51e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/mapAsyncIterable.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.mjs new file mode 100644 index 00000000..a95f3c02 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/mapAsyncIterable.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/mapAsyncIterable.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.mts new file mode 100644 index 00000000..7462bfa5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.mts @@ -0,0 +1 @@ +export * from '../../execution/returnIteratorCatchingErrors.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.ts new file mode 100644 index 00000000..19459561 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.d.ts @@ -0,0 +1 @@ +export * from '../../execution/returnIteratorCatchingErrors.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.js new file mode 100644 index 00000000..9c29b2f5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/returnIteratorCatchingErrors.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.mjs new file mode 100644 index 00000000..aa8e068c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/returnIteratorCatchingErrors.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/returnIteratorCatchingErrors.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.mts new file mode 100644 index 00000000..c3baa20c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.mts @@ -0,0 +1 @@ +export * from '../../execution/values.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.ts new file mode 100644 index 00000000..f60e521a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.d.ts @@ -0,0 +1 @@ +export * from '../../execution/values.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.js new file mode 100644 index 00000000..abb5d347 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/values.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.mjs new file mode 100644 index 00000000..2328938e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/values.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/values.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.mts new file mode 100644 index 00000000..ac54c078 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.mts @@ -0,0 +1 @@ +export * from '../../execution/withConcurrentAbruptClose.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.ts new file mode 100644 index 00000000..33d93aa1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.d.ts @@ -0,0 +1 @@ +export * from '../../execution/withConcurrentAbruptClose.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.js new file mode 100644 index 00000000..cfaee959 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../execution/withConcurrentAbruptClose.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.mjs new file mode 100644 index 00000000..3f914241 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/execution/withConcurrentAbruptClose.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../execution/withConcurrentAbruptClose.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.mts new file mode 100644 index 00000000..6b1240d6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.mts @@ -0,0 +1 @@ +export * from '../graphql.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.ts new file mode 100644 index 00000000..6f6473cb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.d.ts @@ -0,0 +1 @@ +export * from '../graphql.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.js new file mode 100644 index 00000000..3c5b941f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../devMode.js'); +enableDevMode(); +module.exports = require('../graphql.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.mjs new file mode 100644 index 00000000..98d7122d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/graphql.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../devMode.mjs'; +enableDevMode(); +export * from '../graphql.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.mts new file mode 100644 index 00000000..1d87690b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.mts @@ -0,0 +1 @@ +export * from '../harness.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.ts new file mode 100644 index 00000000..d5585c87 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.d.ts @@ -0,0 +1 @@ +export * from '../harness.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.js new file mode 100644 index 00000000..456e93d3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../devMode.js'); +enableDevMode(); +module.exports = require('../harness.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.mjs new file mode 100644 index 00000000..22c1f2d8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/harness.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../devMode.mjs'; +enableDevMode(); +export * from '../harness.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.mts new file mode 100644 index 00000000..3335be24 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.mts @@ -0,0 +1 @@ +export * from '../index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.ts new file mode 100644 index 00000000..f11630f6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.d.ts @@ -0,0 +1 @@ +export * from '../index.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.js new file mode 100644 index 00000000..02ad03bf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../devMode.js'); +enableDevMode(); +module.exports = require('../index.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.mjs new file mode 100644 index 00000000..6efc721b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/index.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../devMode.mjs'; +enableDevMode(); +export * from '../index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.mts new file mode 100644 index 00000000..32e6a9b2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/AccumulatorMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.ts new file mode 100644 index 00000000..4d69c0a4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/AccumulatorMap.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.js new file mode 100644 index 00000000..98a21b69 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/AccumulatorMap.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.mjs new file mode 100644 index 00000000..70befb6d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/AccumulatorMap.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/AccumulatorMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.mts new file mode 100644 index 00000000..3973ebc3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/Maybe.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.ts new file mode 100644 index 00000000..d783bc8d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/Maybe.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.js new file mode 100644 index 00000000..7aa8f317 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/Maybe.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.mjs new file mode 100644 index 00000000..8ab48f5d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Maybe.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/Maybe.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.mts new file mode 100644 index 00000000..20f2a8fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/ObjMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.ts new file mode 100644 index 00000000..93eb5309 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/ObjMap.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.js new file mode 100644 index 00000000..ae5e0c90 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/ObjMap.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.mjs new file mode 100644 index 00000000..f14a9e76 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/ObjMap.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/ObjMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.mts new file mode 100644 index 00000000..0882bf9e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/Path.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.ts new file mode 100644 index 00000000..c3fa5a16 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/Path.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.js new file mode 100644 index 00000000..954f0289 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/Path.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.mjs new file mode 100644 index 00000000..5d066742 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/Path.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/Path.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.mts new file mode 100644 index 00000000..383fae08 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/PromiseOrValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.ts new file mode 100644 index 00000000..c794d147 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/PromiseOrValue.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.js new file mode 100644 index 00000000..1ea79b09 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/PromiseOrValue.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.mjs new file mode 100644 index 00000000..6c2f81e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/PromiseOrValue.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/PromiseOrValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.mts new file mode 100644 index 00000000..e20a74ec --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/capitalize.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.ts new file mode 100644 index 00000000..9fb06aeb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/capitalize.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.js new file mode 100644 index 00000000..c9f32fd4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/capitalize.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.mjs new file mode 100644 index 00000000..89a3001b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/capitalize.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/capitalize.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.mts new file mode 100644 index 00000000..68eae7fe --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/devAssert.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.ts new file mode 100644 index 00000000..4099799d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/devAssert.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.js new file mode 100644 index 00000000..bf702917 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/devAssert.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.mjs new file mode 100644 index 00000000..72826f00 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/devAssert.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/devAssert.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.mts new file mode 100644 index 00000000..e8881c86 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/didYouMean.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.ts new file mode 100644 index 00000000..a5f660d3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/didYouMean.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.js new file mode 100644 index 00000000..fd34c048 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/didYouMean.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.mjs new file mode 100644 index 00000000..ee7f3aa7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/didYouMean.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/didYouMean.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.mts new file mode 100644 index 00000000..d2509ae9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/formatList.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.ts new file mode 100644 index 00000000..d5bfda82 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/formatList.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.js new file mode 100644 index 00000000..d9184c5f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/formatList.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.mjs new file mode 100644 index 00000000..56140c0f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/formatList.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/formatList.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.mts new file mode 100644 index 00000000..db98e41e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/getBySet.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.ts new file mode 100644 index 00000000..b20333f9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/getBySet.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.js new file mode 100644 index 00000000..c5bbfa57 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/getBySet.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.mjs new file mode 100644 index 00000000..844cc497 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/getBySet.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/getBySet.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.mts new file mode 100644 index 00000000..95c458ce --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/groupBy.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.ts new file mode 100644 index 00000000..8142cdb0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/groupBy.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.js new file mode 100644 index 00000000..849b9b78 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/groupBy.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.mjs new file mode 100644 index 00000000..1029f65a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/groupBy.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/groupBy.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.mts new file mode 100644 index 00000000..2102f3a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/identityFunc.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.ts new file mode 100644 index 00000000..19f85b48 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/identityFunc.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.js new file mode 100644 index 00000000..5facb2bb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/identityFunc.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.mjs new file mode 100644 index 00000000..b9ef615b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/identityFunc.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/identityFunc.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.mts new file mode 100644 index 00000000..06a61d01 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/inspect.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.ts new file mode 100644 index 00000000..0dcdefad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/inspect.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.js new file mode 100644 index 00000000..3dfdc1dc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/inspect.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.mjs new file mode 100644 index 00000000..55d83170 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/inspect.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/inspect.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.mts new file mode 100644 index 00000000..0c0c2f4e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/instanceOf.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.ts new file mode 100644 index 00000000..649de66d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/instanceOf.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.js new file mode 100644 index 00000000..93ce4d3d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/instanceOf.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.mjs new file mode 100644 index 00000000..8f9b2800 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/instanceOf.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/instanceOf.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.mts new file mode 100644 index 00000000..8fd718b1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/invariant.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.ts new file mode 100644 index 00000000..1ebb86de --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/invariant.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.js new file mode 100644 index 00000000..b5663400 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/invariant.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.mjs new file mode 100644 index 00000000..fcc1bb93 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/invariant.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/invariant.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.mts new file mode 100644 index 00000000..55ab7dd3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/isAsyncIterable.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.ts new file mode 100644 index 00000000..288a4439 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/isAsyncIterable.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.js new file mode 100644 index 00000000..d53178ff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/isAsyncIterable.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.mjs new file mode 100644 index 00000000..c95d3e80 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isAsyncIterable.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/isAsyncIterable.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.mts new file mode 100644 index 00000000..9e50f7f8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/isIterableObject.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.ts new file mode 100644 index 00000000..a85ebff7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/isIterableObject.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.js new file mode 100644 index 00000000..820b8e9c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/isIterableObject.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.mjs new file mode 100644 index 00000000..884c9168 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isIterableObject.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/isIterableObject.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.mts new file mode 100644 index 00000000..2e6fce7e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/isObjectLike.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.ts new file mode 100644 index 00000000..a31c54d6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/isObjectLike.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.js new file mode 100644 index 00000000..69c1df60 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/isObjectLike.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.mjs new file mode 100644 index 00000000..c7a8493d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isObjectLike.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/isObjectLike.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.mts new file mode 100644 index 00000000..17cfce71 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/isPromise.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.ts new file mode 100644 index 00000000..9b6d6f03 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/isPromise.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.js new file mode 100644 index 00000000..026a879b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/isPromise.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.mjs new file mode 100644 index 00000000..4dff6934 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isPromise.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/isPromise.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.mts new file mode 100644 index 00000000..fd59595a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/isSameSet.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.ts new file mode 100644 index 00000000..f3ad018a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/isSameSet.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.js new file mode 100644 index 00000000..acc93917 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/isSameSet.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.mjs new file mode 100644 index 00000000..0e3ad63a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/isSameSet.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/isSameSet.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.mts new file mode 100644 index 00000000..4b079f94 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/keyMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.ts new file mode 100644 index 00000000..d6c06290 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/keyMap.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.js new file mode 100644 index 00000000..02a2479a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/keyMap.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.mjs new file mode 100644 index 00000000..b61df22f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyMap.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/keyMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.mts new file mode 100644 index 00000000..08fc32ff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/keyValMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.ts new file mode 100644 index 00000000..b5a773f9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/keyValMap.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.js new file mode 100644 index 00000000..a908c9c4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/keyValMap.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.mjs new file mode 100644 index 00000000..be10dd37 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/keyValMap.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/keyValMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.mts new file mode 100644 index 00000000..a47bbe02 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/mapValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.ts new file mode 100644 index 00000000..8b75cffc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/mapValue.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.js new file mode 100644 index 00000000..3a7310de --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/mapValue.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.mjs new file mode 100644 index 00000000..844c1195 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/mapValue.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/mapValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.mts new file mode 100644 index 00000000..d4bfaf73 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/memoize1.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.ts new file mode 100644 index 00000000..e2e6634f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/memoize1.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.js new file mode 100644 index 00000000..2e452667 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/memoize1.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.mjs new file mode 100644 index 00000000..68a39929 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize1.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/memoize1.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.mts new file mode 100644 index 00000000..f8de9ba0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/memoize2.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.ts new file mode 100644 index 00000000..9ff4a79d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/memoize2.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.js new file mode 100644 index 00000000..2a627ca1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/memoize2.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.mjs new file mode 100644 index 00000000..9d4a6f16 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize2.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/memoize2.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.mts new file mode 100644 index 00000000..7f10d394 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/memoize3.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.ts new file mode 100644 index 00000000..c7dab6e7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/memoize3.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.js new file mode 100644 index 00000000..5fd4ca90 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/memoize3.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.mjs new file mode 100644 index 00000000..768fd3f3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/memoize3.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/memoize3.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.mts new file mode 100644 index 00000000..75e7d23a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/naturalCompare.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.ts new file mode 100644 index 00000000..b1ba3bb3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/naturalCompare.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.js new file mode 100644 index 00000000..f2f92d84 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/naturalCompare.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.mjs new file mode 100644 index 00000000..dbd96e58 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/naturalCompare.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/naturalCompare.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.mts new file mode 100644 index 00000000..3065605e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/printPathArray.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.ts new file mode 100644 index 00000000..11c0a9a8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/printPathArray.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.js new file mode 100644 index 00000000..be48d0f6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/printPathArray.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.mjs new file mode 100644 index 00000000..3596015b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/printPathArray.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/printPathArray.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.mts new file mode 100644 index 00000000..88e23aeb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/promiseForObject.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.ts new file mode 100644 index 00000000..92996c0e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/promiseForObject.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.js new file mode 100644 index 00000000..c7247a53 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/promiseForObject.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.mjs new file mode 100644 index 00000000..3ca91d4d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseForObject.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/promiseForObject.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.mts new file mode 100644 index 00000000..39c339cc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/promiseReduce.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.ts new file mode 100644 index 00000000..104076f8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/promiseReduce.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.js new file mode 100644 index 00000000..8a864cdc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/promiseReduce.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.mjs new file mode 100644 index 00000000..f0a64167 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseReduce.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/promiseReduce.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.mts new file mode 100644 index 00000000..a0ccc444 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/promiseWithResolvers.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.ts new file mode 100644 index 00000000..bb1c8aaf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/promiseWithResolvers.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.js new file mode 100644 index 00000000..7b4625d0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/promiseWithResolvers.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.mjs new file mode 100644 index 00000000..acb1e11f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/promiseWithResolvers.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/promiseWithResolvers.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.mts new file mode 100644 index 00000000..f23c50fd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/suggestionList.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.ts new file mode 100644 index 00000000..815de9a1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/suggestionList.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.js new file mode 100644 index 00000000..f3f3ca57 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/suggestionList.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.mjs new file mode 100644 index 00000000..73be297a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/suggestionList.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/suggestionList.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.mts new file mode 100644 index 00000000..5105da8c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/toError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.ts new file mode 100644 index 00000000..b54fc003 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/toError.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.js new file mode 100644 index 00000000..2dfd6325 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/toError.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.mjs new file mode 100644 index 00000000..48286891 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toError.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/toError.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.mts new file mode 100644 index 00000000..3fcab071 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.mts @@ -0,0 +1 @@ +export * from '../../jsutils/toObjMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.ts new file mode 100644 index 00000000..b5ad6194 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.d.ts @@ -0,0 +1 @@ +export * from '../../jsutils/toObjMap.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.js new file mode 100644 index 00000000..95cf13b4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../jsutils/toObjMap.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.mjs new file mode 100644 index 00000000..42f80255 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/jsutils/toObjMap.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../jsutils/toObjMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.mts new file mode 100644 index 00000000..6ea10b92 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.mts @@ -0,0 +1 @@ +export * from '../../language/KindTypeMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.ts new file mode 100644 index 00000000..4632f056 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.d.ts @@ -0,0 +1 @@ +export * from '../../language/KindTypeMap.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.js new file mode 100644 index 00000000..50c17740 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/KindTypeMap.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.mjs new file mode 100644 index 00000000..08fafa95 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/KindTypeMap.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/KindTypeMap.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.mts new file mode 100644 index 00000000..66ca4f16 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.mts @@ -0,0 +1 @@ +export * from '../../language/ast.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.ts new file mode 100644 index 00000000..c012bef4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.d.ts @@ -0,0 +1 @@ +export * from '../../language/ast.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.js new file mode 100644 index 00000000..5c8ca3ec --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/ast.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.mjs new file mode 100644 index 00000000..31376e4b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/ast.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/ast.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.mts new file mode 100644 index 00000000..d6f5f82f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.mts @@ -0,0 +1 @@ +export * from '../../language/blockString.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.ts new file mode 100644 index 00000000..ceedbeab --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.d.ts @@ -0,0 +1 @@ +export * from '../../language/blockString.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.js new file mode 100644 index 00000000..809f4377 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/blockString.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.mjs new file mode 100644 index 00000000..76db3cf0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/blockString.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/blockString.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.mts new file mode 100644 index 00000000..a418731e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.mts @@ -0,0 +1 @@ +export * from '../../language/characterClasses.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.ts new file mode 100644 index 00000000..82f2409b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.d.ts @@ -0,0 +1 @@ +export * from '../../language/characterClasses.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.js new file mode 100644 index 00000000..939464fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/characterClasses.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.mjs new file mode 100644 index 00000000..cb469cf3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/characterClasses.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/characterClasses.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.mts new file mode 100644 index 00000000..ad2090a3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.mts @@ -0,0 +1 @@ +export * from '../../language/directiveLocation.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.ts new file mode 100644 index 00000000..99c720c1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.d.ts @@ -0,0 +1 @@ +export * from '../../language/directiveLocation.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.js new file mode 100644 index 00000000..ffb84ad2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/directiveLocation.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.mjs new file mode 100644 index 00000000..22369934 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/directiveLocation.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/directiveLocation.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.mts new file mode 100644 index 00000000..69976ae7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.mts @@ -0,0 +1 @@ +export * from '../../language/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.ts new file mode 100644 index 00000000..ccacd282 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.d.ts @@ -0,0 +1 @@ +export * from '../../language/index.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.js new file mode 100644 index 00000000..1d267b19 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/index.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.mjs new file mode 100644 index 00000000..7d70576f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/index.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.mts new file mode 100644 index 00000000..b5e0bfee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.mts @@ -0,0 +1 @@ +export * from '../../language/kinds.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.ts new file mode 100644 index 00000000..6475f7a0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.d.ts @@ -0,0 +1 @@ +export * from '../../language/kinds.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.js new file mode 100644 index 00000000..a66467e0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/kinds.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.mjs new file mode 100644 index 00000000..f2a2ea5c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/kinds.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.mts new file mode 100644 index 00000000..e9fd0478 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.mts @@ -0,0 +1 @@ +export * from '../../language/kinds_.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.ts new file mode 100644 index 00000000..220075ae --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.d.ts @@ -0,0 +1 @@ +export * from '../../language/kinds_.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.js new file mode 100644 index 00000000..90c5a668 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/kinds_.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.mjs new file mode 100644 index 00000000..c85692e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/kinds_.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/kinds_.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.mts new file mode 100644 index 00000000..577c3881 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.mts @@ -0,0 +1 @@ +export * from '../../language/lexer.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.ts new file mode 100644 index 00000000..e5e882f5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.d.ts @@ -0,0 +1 @@ +export * from '../../language/lexer.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.js new file mode 100644 index 00000000..17cc31be --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/lexer.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.mjs new file mode 100644 index 00000000..01a62b06 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/lexer.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/lexer.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.mts new file mode 100644 index 00000000..9f039f65 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.mts @@ -0,0 +1 @@ +export * from '../../language/location.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.ts new file mode 100644 index 00000000..46556b3c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.d.ts @@ -0,0 +1 @@ +export * from '../../language/location.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.js new file mode 100644 index 00000000..7641824b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/location.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.mjs new file mode 100644 index 00000000..33288806 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/location.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/location.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.mts new file mode 100644 index 00000000..5567d987 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.mts @@ -0,0 +1 @@ +export * from '../../language/parser.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.ts new file mode 100644 index 00000000..12c25bc2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.d.ts @@ -0,0 +1 @@ +export * from '../../language/parser.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.js new file mode 100644 index 00000000..c09448e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/parser.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.mjs new file mode 100644 index 00000000..5fe8ae86 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/parser.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/parser.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.mts new file mode 100644 index 00000000..ace4ce95 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.mts @@ -0,0 +1 @@ +export * from '../../language/predicates.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.ts new file mode 100644 index 00000000..6da9e5b3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.d.ts @@ -0,0 +1 @@ +export * from '../../language/predicates.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.js new file mode 100644 index 00000000..862cd8d8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/predicates.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.mjs new file mode 100644 index 00000000..aa388665 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/predicates.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/predicates.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.mts new file mode 100644 index 00000000..d46be418 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.mts @@ -0,0 +1 @@ +export * from '../../language/printLocation.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.ts new file mode 100644 index 00000000..94ee1a60 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.d.ts @@ -0,0 +1 @@ +export * from '../../language/printLocation.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.js new file mode 100644 index 00000000..45228966 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/printLocation.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.mjs new file mode 100644 index 00000000..810603af --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printLocation.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/printLocation.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.mts new file mode 100644 index 00000000..d81513eb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.mts @@ -0,0 +1 @@ +export * from '../../language/printString.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.ts new file mode 100644 index 00000000..13434fba --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.d.ts @@ -0,0 +1 @@ +export * from '../../language/printString.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.js new file mode 100644 index 00000000..6a966141 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/printString.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.mjs new file mode 100644 index 00000000..57e8a4bf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printString.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/printString.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.mts new file mode 100644 index 00000000..db066204 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.mts @@ -0,0 +1 @@ +export * from '../../language/printer.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.ts new file mode 100644 index 00000000..de2d9272 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.d.ts @@ -0,0 +1 @@ +export * from '../../language/printer.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.js new file mode 100644 index 00000000..7deae301 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/printer.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.mjs new file mode 100644 index 00000000..f7a025a3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/printer.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/printer.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.mts new file mode 100644 index 00000000..0c56befa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.mts @@ -0,0 +1 @@ +export * from '../../language/schemaCoordinateLexer.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.ts new file mode 100644 index 00000000..2d6b4e70 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.d.ts @@ -0,0 +1 @@ +export * from '../../language/schemaCoordinateLexer.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.js new file mode 100644 index 00000000..2de8338a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/schemaCoordinateLexer.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.mjs new file mode 100644 index 00000000..c39de4c5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/schemaCoordinateLexer.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/schemaCoordinateLexer.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.mts new file mode 100644 index 00000000..12076ad0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.mts @@ -0,0 +1 @@ +export * from '../../language/source.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.ts new file mode 100644 index 00000000..56e35f32 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.d.ts @@ -0,0 +1 @@ +export * from '../../language/source.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.js new file mode 100644 index 00000000..432870d8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/source.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.mjs new file mode 100644 index 00000000..a7d12d63 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/source.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/source.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.mts new file mode 100644 index 00000000..5c38c28a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.mts @@ -0,0 +1 @@ +export * from '../../language/tokenKind.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.ts new file mode 100644 index 00000000..583896d9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.d.ts @@ -0,0 +1 @@ +export * from '../../language/tokenKind.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.js new file mode 100644 index 00000000..c3ba4838 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/tokenKind.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.mjs new file mode 100644 index 00000000..37ccc392 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/tokenKind.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/tokenKind.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.mts new file mode 100644 index 00000000..72249fd2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.mts @@ -0,0 +1 @@ +export * from '../../language/visitor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.ts new file mode 100644 index 00000000..70ae2932 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.d.ts @@ -0,0 +1 @@ +export * from '../../language/visitor.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.js new file mode 100644 index 00000000..b4da15b4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../language/visitor.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.mjs new file mode 100644 index 00000000..1ddafad4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/language/visitor.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../language/visitor.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.mts new file mode 100644 index 00000000..d02dc671 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.mts @@ -0,0 +1 @@ +export * from '../../type/assertName.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.ts new file mode 100644 index 00000000..78e7e938 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.d.ts @@ -0,0 +1 @@ +export * from '../../type/assertName.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.js new file mode 100644 index 00000000..d49eaade --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/assertName.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.mjs new file mode 100644 index 00000000..2d3ac52f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/assertName.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/assertName.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.mts new file mode 100644 index 00000000..09095515 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.mts @@ -0,0 +1 @@ +export * from '../../type/definition.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.ts new file mode 100644 index 00000000..5c8695b4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.d.ts @@ -0,0 +1 @@ +export * from '../../type/definition.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.js new file mode 100644 index 00000000..5257b89e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/definition.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.mjs new file mode 100644 index 00000000..6ac06156 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/definition.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/definition.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.mts new file mode 100644 index 00000000..e9a7b1b8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.mts @@ -0,0 +1 @@ +export * from '../../type/directives.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.ts new file mode 100644 index 00000000..671979ba --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.d.ts @@ -0,0 +1 @@ +export * from '../../type/directives.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.js new file mode 100644 index 00000000..af62e75b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/directives.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.mjs new file mode 100644 index 00000000..2dc6fe61 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/directives.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/directives.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.mts new file mode 100644 index 00000000..c8497260 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.mts @@ -0,0 +1 @@ +export * from '../../type/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.ts new file mode 100644 index 00000000..746f72f4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.d.ts @@ -0,0 +1 @@ +export * from '../../type/index.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.js new file mode 100644 index 00000000..e0bdd22d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/index.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.mjs new file mode 100644 index 00000000..46631305 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/index.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.mts new file mode 100644 index 00000000..fe7d3d8c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.mts @@ -0,0 +1 @@ +export * from '../../type/introspection.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.ts new file mode 100644 index 00000000..13266223 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.d.ts @@ -0,0 +1 @@ +export * from '../../type/introspection.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.js new file mode 100644 index 00000000..275281d8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/introspection.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.mjs new file mode 100644 index 00000000..76dc7f77 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/introspection.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/introspection.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.mts new file mode 100644 index 00000000..3eaca2d8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.mts @@ -0,0 +1 @@ +export * from '../../type/scalars.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.ts new file mode 100644 index 00000000..3b991e8f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.d.ts @@ -0,0 +1 @@ +export * from '../../type/scalars.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.js new file mode 100644 index 00000000..c4dbd84d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/scalars.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.mjs new file mode 100644 index 00000000..95b28854 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/scalars.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/scalars.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.mts new file mode 100644 index 00000000..c8521be1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.mts @@ -0,0 +1 @@ +export * from '../../type/schema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.ts new file mode 100644 index 00000000..66d7b6c4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.d.ts @@ -0,0 +1 @@ +export * from '../../type/schema.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.js new file mode 100644 index 00000000..55f44bf1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/schema.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.mjs new file mode 100644 index 00000000..82c17814 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/schema.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/schema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.mts new file mode 100644 index 00000000..e4200533 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.mts @@ -0,0 +1 @@ +export * from '../../type/validate.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.ts new file mode 100644 index 00000000..f956f99c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.d.ts @@ -0,0 +1 @@ +export * from '../../type/validate.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.js new file mode 100644 index 00000000..cbe38d58 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../type/validate.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.mjs new file mode 100644 index 00000000..4cd55857 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/type/validate.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../type/validate.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.mts new file mode 100644 index 00000000..222c660f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/TypeInfo.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.ts new file mode 100644 index 00000000..00ea0ed6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/TypeInfo.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.js new file mode 100644 index 00000000..5f4b1b5c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/TypeInfo.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.mjs new file mode 100644 index 00000000..43894f8d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/TypeInfo.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/TypeInfo.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.mts new file mode 100644 index 00000000..11ee6259 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/astFromValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.ts new file mode 100644 index 00000000..a71ecbad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/astFromValue.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.js new file mode 100644 index 00000000..57dee16e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/astFromValue.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.mjs new file mode 100644 index 00000000..8b87779e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/astFromValue.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/astFromValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.mts new file mode 100644 index 00000000..b5c4ff81 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/buildASTSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.ts new file mode 100644 index 00000000..9215ac51 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/buildASTSchema.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.js new file mode 100644 index 00000000..6e3e820a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/buildASTSchema.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.mjs new file mode 100644 index 00000000..b7577448 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildASTSchema.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/buildASTSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.mts new file mode 100644 index 00000000..b0a68a41 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/buildClientSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.ts new file mode 100644 index 00000000..b1a620ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/buildClientSchema.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.js new file mode 100644 index 00000000..3576f77d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/buildClientSchema.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.mjs new file mode 100644 index 00000000..b83b3ab4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/buildClientSchema.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/buildClientSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.mts new file mode 100644 index 00000000..fc6cb779 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/coerceInputValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.ts new file mode 100644 index 00000000..162d75b0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/coerceInputValue.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.js new file mode 100644 index 00000000..59ea2f3e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/coerceInputValue.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.mjs new file mode 100644 index 00000000..f2ba0a69 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/coerceInputValue.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/coerceInputValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.mts new file mode 100644 index 00000000..feecc3cf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/concatAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.ts new file mode 100644 index 00000000..857ef951 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/concatAST.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.js new file mode 100644 index 00000000..5a6739aa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/concatAST.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.mjs new file mode 100644 index 00000000..c4a835ac --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/concatAST.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/concatAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.mts new file mode 100644 index 00000000..4bcfff44 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/extendSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.ts new file mode 100644 index 00000000..b82dec78 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/extendSchema.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.js new file mode 100644 index 00000000..beb8ed12 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/extendSchema.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.mjs new file mode 100644 index 00000000..481d49c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/extendSchema.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/extendSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.mts new file mode 100644 index 00000000..97e58327 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/findSchemaChanges.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.ts new file mode 100644 index 00000000..2d319cab --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/findSchemaChanges.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.js new file mode 100644 index 00000000..312c889f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/findSchemaChanges.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.mjs new file mode 100644 index 00000000..b0118a3b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/findSchemaChanges.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/findSchemaChanges.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.mts new file mode 100644 index 00000000..573aa9eb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/getDefaultValueAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.ts new file mode 100644 index 00000000..e775abac --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/getDefaultValueAST.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.js new file mode 100644 index 00000000..88b125d9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/getDefaultValueAST.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.mjs new file mode 100644 index 00000000..7559f374 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getDefaultValueAST.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/getDefaultValueAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.mts new file mode 100644 index 00000000..0e8f4735 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/getIntrospectionQuery.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.ts new file mode 100644 index 00000000..0ead654d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/getIntrospectionQuery.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.js new file mode 100644 index 00000000..80a9f13b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/getIntrospectionQuery.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.mjs new file mode 100644 index 00000000..17587380 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getIntrospectionQuery.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/getIntrospectionQuery.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.mts new file mode 100644 index 00000000..2351f5b0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/getOperationAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.ts new file mode 100644 index 00000000..30c68665 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/getOperationAST.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.js new file mode 100644 index 00000000..511cc0fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/getOperationAST.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.mjs new file mode 100644 index 00000000..2666b11f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/getOperationAST.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/getOperationAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.mts new file mode 100644 index 00000000..f9abd737 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.ts new file mode 100644 index 00000000..32b20544 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/index.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.js new file mode 100644 index 00000000..134e1f91 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/index.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.mjs new file mode 100644 index 00000000..b6c8b012 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/index.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.mts new file mode 100644 index 00000000..f371e4d7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/introspectionFromSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.ts new file mode 100644 index 00000000..e41d5389 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/introspectionFromSchema.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.js new file mode 100644 index 00000000..5d8f026e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/introspectionFromSchema.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.mjs new file mode 100644 index 00000000..c5ad4d73 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/introspectionFromSchema.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/introspectionFromSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.mts new file mode 100644 index 00000000..ebfbe53c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/lexicographicSortSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.ts new file mode 100644 index 00000000..7c85e057 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/lexicographicSortSchema.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.js new file mode 100644 index 00000000..7dd91cf3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/lexicographicSortSchema.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.mjs new file mode 100644 index 00000000..1cac647e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/lexicographicSortSchema.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/lexicographicSortSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.mts new file mode 100644 index 00000000..80c10905 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/mapSchemaConfig.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.ts new file mode 100644 index 00000000..bb7689f3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/mapSchemaConfig.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.js new file mode 100644 index 00000000..2ca0b587 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/mapSchemaConfig.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.mjs new file mode 100644 index 00000000..b0912a49 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/mapSchemaConfig.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/mapSchemaConfig.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.mts new file mode 100644 index 00000000..e1752be8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/printSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.ts new file mode 100644 index 00000000..6b44448a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/printSchema.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.js new file mode 100644 index 00000000..9b1afe63 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/printSchema.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.mjs new file mode 100644 index 00000000..ab1df45c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/printSchema.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/printSchema.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.mts new file mode 100644 index 00000000..42731f31 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/replaceVariables.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.ts new file mode 100644 index 00000000..91cb208e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/replaceVariables.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.js new file mode 100644 index 00000000..bcd143ad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/replaceVariables.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.mjs new file mode 100644 index 00000000..e88abe89 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/replaceVariables.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/replaceVariables.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.mts new file mode 100644 index 00000000..524e8ef5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/resolveSchemaCoordinate.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.ts new file mode 100644 index 00000000..e9f5e4d4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/resolveSchemaCoordinate.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.js new file mode 100644 index 00000000..237cd1fb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/resolveSchemaCoordinate.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.mjs new file mode 100644 index 00000000..8f20f8c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/resolveSchemaCoordinate.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/resolveSchemaCoordinate.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.mts new file mode 100644 index 00000000..90562c1f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/separateOperations.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.ts new file mode 100644 index 00000000..44fd62aa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/separateOperations.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.js new file mode 100644 index 00000000..e6ccc16a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/separateOperations.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.mjs new file mode 100644 index 00000000..11c46f65 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/separateOperations.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/separateOperations.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.mts new file mode 100644 index 00000000..490b5474 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/sortValueNode.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.ts new file mode 100644 index 00000000..bf8ed7f1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/sortValueNode.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.js new file mode 100644 index 00000000..48fd7d93 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/sortValueNode.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.mjs new file mode 100644 index 00000000..fbbce64d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/sortValueNode.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/sortValueNode.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.mts new file mode 100644 index 00000000..63d07f1b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/stripIgnoredCharacters.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.ts new file mode 100644 index 00000000..7c25cedb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/stripIgnoredCharacters.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.js new file mode 100644 index 00000000..86da121c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/stripIgnoredCharacters.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.mjs new file mode 100644 index 00000000..59acb818 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/stripIgnoredCharacters.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/stripIgnoredCharacters.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.mts new file mode 100644 index 00000000..e2514432 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/typeComparators.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.ts new file mode 100644 index 00000000..3d2ab15a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/typeComparators.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.js new file mode 100644 index 00000000..b5d49f80 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/typeComparators.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.mjs new file mode 100644 index 00000000..c43005f4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeComparators.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/typeComparators.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.mts new file mode 100644 index 00000000..08865832 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/typeFromAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.ts new file mode 100644 index 00000000..302c18f4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/typeFromAST.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.js new file mode 100644 index 00000000..abb54f4f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/typeFromAST.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.mjs new file mode 100644 index 00000000..66c5c4cb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typeFromAST.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/typeFromAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.mts new file mode 100644 index 00000000..06b57363 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/typedQueryDocumentNode.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.ts new file mode 100644 index 00000000..6f870362 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/typedQueryDocumentNode.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.js new file mode 100644 index 00000000..efd31872 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/typedQueryDocumentNode.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.mjs new file mode 100644 index 00000000..5e0bcd26 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/typedQueryDocumentNode.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/typedQueryDocumentNode.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.mts new file mode 100644 index 00000000..bcf87109 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/validateInputValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.ts new file mode 100644 index 00000000..cad50da9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/validateInputValue.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.js new file mode 100644 index 00000000..491df7ae --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/validateInputValue.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.mjs new file mode 100644 index 00000000..b3c6ed66 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/validateInputValue.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/validateInputValue.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.mts new file mode 100644 index 00000000..3ecd93c5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/valueFromAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.ts new file mode 100644 index 00000000..54b71efe --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/valueFromAST.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.js new file mode 100644 index 00000000..9b387f85 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/valueFromAST.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.mjs new file mode 100644 index 00000000..23f7eae8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromAST.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/valueFromAST.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.mts new file mode 100644 index 00000000..f9dce0e9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/valueFromASTUntyped.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.ts new file mode 100644 index 00000000..7efe1486 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/valueFromASTUntyped.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.js new file mode 100644 index 00000000..fddfef4c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/valueFromASTUntyped.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.mjs new file mode 100644 index 00000000..3b64d467 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueFromASTUntyped.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/valueFromASTUntyped.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.mts new file mode 100644 index 00000000..a75d5cfa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.mts @@ -0,0 +1 @@ +export * from '../../utilities/valueToLiteral.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.ts new file mode 100644 index 00000000..29594c91 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.d.ts @@ -0,0 +1 @@ +export * from '../../utilities/valueToLiteral.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.js new file mode 100644 index 00000000..e9f34a70 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../utilities/valueToLiteral.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.mjs new file mode 100644 index 00000000..08d07d2c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/utilities/valueToLiteral.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../utilities/valueToLiteral.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.mts new file mode 100644 index 00000000..fc689076 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.mts @@ -0,0 +1 @@ +export * from '../../validation/ValidationContext.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.ts new file mode 100644 index 00000000..b207cc16 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.d.ts @@ -0,0 +1 @@ +export * from '../../validation/ValidationContext.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.js new file mode 100644 index 00000000..472ae45a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../validation/ValidationContext.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.mjs new file mode 100644 index 00000000..b15b2b0d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/ValidationContext.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../validation/ValidationContext.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.mts new file mode 100644 index 00000000..da6d9875 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.mts @@ -0,0 +1 @@ +export * from '../../validation/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.ts new file mode 100644 index 00000000..6c4e0f0c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.d.ts @@ -0,0 +1 @@ +export * from '../../validation/index.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.js new file mode 100644 index 00000000..1f8b9135 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../validation/index.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.mjs new file mode 100644 index 00000000..e2d3da5f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/index.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../validation/index.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.mts new file mode 100644 index 00000000..06c5fa47 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/DeferStreamDirectiveLabelRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts new file mode 100644 index 00000000..3ab49f1f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/DeferStreamDirectiveLabelRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.js new file mode 100644 index 00000000..c0f39b72 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/DeferStreamDirectiveLabelRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.mjs new file mode 100644 index 00000000..8647ac85 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveLabelRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/DeferStreamDirectiveLabelRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts new file mode 100644 index 00000000..b2d4040e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts new file mode 100644 index 00000000..d4b06599 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/DeferStreamDirectiveOnRootFieldRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.js new file mode 100644 index 00000000..a1184a2e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/DeferStreamDirectiveOnRootFieldRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs new file mode 100644 index 00000000..5e105a17 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts new file mode 100644 index 00000000..34bfd140 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts new file mode 100644 index 00000000..27a74d36 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/DeferStreamDirectiveOnValidOperationsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js new file mode 100644 index 00000000..be11ce41 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/DeferStreamDirectiveOnValidOperationsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs new file mode 100644 index 00000000..223a12f8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.mts new file mode 100644 index 00000000..d76b9226 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ExecutableDefinitionsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts new file mode 100644 index 00000000..032c24d3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ExecutableDefinitionsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.js new file mode 100644 index 00000000..5d29042c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/ExecutableDefinitionsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.mjs new file mode 100644 index 00000000..9241cdbd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ExecutableDefinitionsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/ExecutableDefinitionsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.mts new file mode 100644 index 00000000..6e2915a6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/FieldsOnCorrectTypeRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts new file mode 100644 index 00000000..a38c89e6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/FieldsOnCorrectTypeRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.js new file mode 100644 index 00000000..db72d379 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/FieldsOnCorrectTypeRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.mjs new file mode 100644 index 00000000..b021626e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FieldsOnCorrectTypeRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/FieldsOnCorrectTypeRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.mts new file mode 100644 index 00000000..14fceb4b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/FragmentsOnCompositeTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts new file mode 100644 index 00000000..04fa0ac3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/FragmentsOnCompositeTypesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.js new file mode 100644 index 00000000..542421e1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/FragmentsOnCompositeTypesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.mjs new file mode 100644 index 00000000..45a407bd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/FragmentsOnCompositeTypesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/FragmentsOnCompositeTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.mts new file mode 100644 index 00000000..f637d5d0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownArgumentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.ts new file mode 100644 index 00000000..c29d4390 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownArgumentNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.js new file mode 100644 index 00000000..f9438b45 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/KnownArgumentNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.mjs new file mode 100644 index 00000000..35e7469e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownArgumentNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/KnownArgumentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.mts new file mode 100644 index 00000000..c310b04a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownDirectivesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.ts new file mode 100644 index 00000000..10a8e96b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownDirectivesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.js new file mode 100644 index 00000000..05950cde --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/KnownDirectivesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.mjs new file mode 100644 index 00000000..79156d57 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownDirectivesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/KnownDirectivesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.mts new file mode 100644 index 00000000..55b3fef9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownFragmentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.ts new file mode 100644 index 00000000..a594ff8e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownFragmentNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.js new file mode 100644 index 00000000..6146b83e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/KnownFragmentNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.mjs new file mode 100644 index 00000000..90df8283 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownFragmentNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/KnownFragmentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.mts new file mode 100644 index 00000000..a1708525 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownOperationTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.ts new file mode 100644 index 00000000..bf85f79e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownOperationTypesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.js new file mode 100644 index 00000000..fe0edcdb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/KnownOperationTypesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.mjs new file mode 100644 index 00000000..fecbe074 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownOperationTypesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/KnownOperationTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.mts new file mode 100644 index 00000000..688845c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownTypeNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.ts new file mode 100644 index 00000000..c251adb5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/KnownTypeNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.js new file mode 100644 index 00000000..ae0ee5c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/KnownTypeNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.mjs new file mode 100644 index 00000000..76b0505e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/KnownTypeNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/KnownTypeNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.mts new file mode 100644 index 00000000..07e33970 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/LoneAnonymousOperationRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts new file mode 100644 index 00000000..a65fd5fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/LoneAnonymousOperationRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.js new file mode 100644 index 00000000..41c799d5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/LoneAnonymousOperationRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.mjs new file mode 100644 index 00000000..9126bb0d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneAnonymousOperationRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/LoneAnonymousOperationRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.mts new file mode 100644 index 00000000..89a25aa1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/LoneSchemaDefinitionRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts new file mode 100644 index 00000000..4f21bb28 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/LoneSchemaDefinitionRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.js new file mode 100644 index 00000000..cfe81991 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/LoneSchemaDefinitionRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.mjs new file mode 100644 index 00000000..f288f55a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/LoneSchemaDefinitionRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/LoneSchemaDefinitionRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.mts new file mode 100644 index 00000000..ac14cbf4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/MaxIntrospectionDepthRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts new file mode 100644 index 00000000..db600937 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/MaxIntrospectionDepthRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.js new file mode 100644 index 00000000..3e4e4d4d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/MaxIntrospectionDepthRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.mjs new file mode 100644 index 00000000..5202deae --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/MaxIntrospectionDepthRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/MaxIntrospectionDepthRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.mts new file mode 100644 index 00000000..01f55143 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoFragmentCyclesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.ts new file mode 100644 index 00000000..601eebf0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoFragmentCyclesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.js new file mode 100644 index 00000000..1ebaba8a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/NoFragmentCyclesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.mjs new file mode 100644 index 00000000..598b375e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoFragmentCyclesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/NoFragmentCyclesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.mts new file mode 100644 index 00000000..f9e2b7fd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoUndefinedVariablesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts new file mode 100644 index 00000000..4550f5eb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoUndefinedVariablesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.js new file mode 100644 index 00000000..c194c064 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/NoUndefinedVariablesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.mjs new file mode 100644 index 00000000..84374051 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUndefinedVariablesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/NoUndefinedVariablesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.mts new file mode 100644 index 00000000..fb61f24d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoUnusedFragmentsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts new file mode 100644 index 00000000..0494a1d1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoUnusedFragmentsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.js new file mode 100644 index 00000000..2ccb5d39 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/NoUnusedFragmentsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.mjs new file mode 100644 index 00000000..bb0f3fd8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedFragmentsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/NoUnusedFragmentsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.mts new file mode 100644 index 00000000..6f8100ab --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoUnusedVariablesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.ts new file mode 100644 index 00000000..709618c4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/NoUnusedVariablesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.js new file mode 100644 index 00000000..21fddf27 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/NoUnusedVariablesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.mjs new file mode 100644 index 00000000..e2099636 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/NoUnusedVariablesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/NoUnusedVariablesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts new file mode 100644 index 00000000..650005c8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/OverlappingFieldsCanBeMergedRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts new file mode 100644 index 00000000..f8427f2e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/OverlappingFieldsCanBeMergedRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.js new file mode 100644 index 00000000..b150d550 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/OverlappingFieldsCanBeMergedRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.mjs new file mode 100644 index 00000000..3c97043b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/OverlappingFieldsCanBeMergedRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/OverlappingFieldsCanBeMergedRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.mts new file mode 100644 index 00000000..1d8c5f64 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/PossibleFragmentSpreadsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts new file mode 100644 index 00000000..ebb302af --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/PossibleFragmentSpreadsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.js new file mode 100644 index 00000000..7f436107 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/PossibleFragmentSpreadsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.mjs new file mode 100644 index 00000000..ae442dc3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleFragmentSpreadsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/PossibleFragmentSpreadsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.mts new file mode 100644 index 00000000..67b26a63 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/PossibleTypeExtensionsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts new file mode 100644 index 00000000..42b96cb3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/PossibleTypeExtensionsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.js new file mode 100644 index 00000000..f4b1a002 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/PossibleTypeExtensionsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.mjs new file mode 100644 index 00000000..b501be51 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/PossibleTypeExtensionsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/PossibleTypeExtensionsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.mts new file mode 100644 index 00000000..8db98324 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ProvidedRequiredArgumentsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts new file mode 100644 index 00000000..5d86ca09 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ProvidedRequiredArgumentsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.js new file mode 100644 index 00000000..49b85667 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/ProvidedRequiredArgumentsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.mjs new file mode 100644 index 00000000..53c0ab47 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ProvidedRequiredArgumentsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/ProvidedRequiredArgumentsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.mts new file mode 100644 index 00000000..5443ff75 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ScalarLeafsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.ts new file mode 100644 index 00000000..4a7f5caa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ScalarLeafsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.js new file mode 100644 index 00000000..e567c3fb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/ScalarLeafsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.mjs new file mode 100644 index 00000000..cbd3795c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ScalarLeafsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/ScalarLeafsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.mts new file mode 100644 index 00000000..3838bc1e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/SingleFieldSubscriptionsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts new file mode 100644 index 00000000..08b32d11 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/SingleFieldSubscriptionsRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.js new file mode 100644 index 00000000..b56facf9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/SingleFieldSubscriptionsRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.mjs new file mode 100644 index 00000000..0cb1cea2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/SingleFieldSubscriptionsRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/SingleFieldSubscriptionsRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.mts new file mode 100644 index 00000000..a4064755 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/StreamDirectiveOnListFieldRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts new file mode 100644 index 00000000..b4730b9c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/StreamDirectiveOnListFieldRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.js new file mode 100644 index 00000000..3ce04455 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/StreamDirectiveOnListFieldRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.mjs new file mode 100644 index 00000000..8bc2828f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/StreamDirectiveOnListFieldRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/StreamDirectiveOnListFieldRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts new file mode 100644 index 00000000..7fa64e48 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueArgumentDefinitionNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts new file mode 100644 index 00000000..db99bbd9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueArgumentDefinitionNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.js new file mode 100644 index 00000000..9b94d19f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueArgumentDefinitionNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.mjs new file mode 100644 index 00000000..d7817d3a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentDefinitionNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueArgumentDefinitionNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.mts new file mode 100644 index 00000000..84bbb37f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueArgumentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts new file mode 100644 index 00000000..276d6920 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueArgumentNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.js new file mode 100644 index 00000000..a20fb19d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueArgumentNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.mjs new file mode 100644 index 00000000..cd930edd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueArgumentNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueArgumentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.mts new file mode 100644 index 00000000..d29dd45d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueDirectiveNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts new file mode 100644 index 00000000..7a6e7d65 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueDirectiveNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.js new file mode 100644 index 00000000..241e6498 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueDirectiveNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.mjs new file mode 100644 index 00000000..2b73729e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectiveNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueDirectiveNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.mts new file mode 100644 index 00000000..fdaeeeb3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueDirectivesPerLocationRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts new file mode 100644 index 00000000..ae3b7f1a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueDirectivesPerLocationRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.js new file mode 100644 index 00000000..f411b899 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueDirectivesPerLocationRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.mjs new file mode 100644 index 00000000..88e9cae9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueDirectivesPerLocationRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueDirectivesPerLocationRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.mts new file mode 100644 index 00000000..1a362ae3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueEnumValueNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts new file mode 100644 index 00000000..52486d5e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueEnumValueNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.js new file mode 100644 index 00000000..41bbdf37 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueEnumValueNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.mjs new file mode 100644 index 00000000..e6c9279f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueEnumValueNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueEnumValueNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.mts new file mode 100644 index 00000000..681576d3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueFieldDefinitionNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts new file mode 100644 index 00000000..503e456b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueFieldDefinitionNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.js new file mode 100644 index 00000000..35ade5b9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueFieldDefinitionNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.mjs new file mode 100644 index 00000000..bd0a6777 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFieldDefinitionNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueFieldDefinitionNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.mts new file mode 100644 index 00000000..ac5c67e1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueFragmentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts new file mode 100644 index 00000000..a4829466 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueFragmentNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.js new file mode 100644 index 00000000..55812b84 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueFragmentNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.mjs new file mode 100644 index 00000000..e048b11a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueFragmentNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueFragmentNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.mts new file mode 100644 index 00000000..398f5f5f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueInputFieldNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts new file mode 100644 index 00000000..ab225d1b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueInputFieldNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.js new file mode 100644 index 00000000..f0a9e821 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueInputFieldNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.mjs new file mode 100644 index 00000000..987746ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueInputFieldNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueInputFieldNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.mts new file mode 100644 index 00000000..93d054e5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueOperationNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.ts new file mode 100644 index 00000000..7326a828 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueOperationNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.js new file mode 100644 index 00000000..8e981c37 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueOperationNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.mjs new file mode 100644 index 00000000..25f02ef8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueOperationNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.mts new file mode 100644 index 00000000..f3f3ba1f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueOperationTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.ts new file mode 100644 index 00000000..531389f4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueOperationTypesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.js new file mode 100644 index 00000000..29520576 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueOperationTypesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.mjs new file mode 100644 index 00000000..5733b635 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueOperationTypesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueOperationTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.mts new file mode 100644 index 00000000..8efe9eea --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueTypeNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.ts new file mode 100644 index 00000000..fde0e729 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueTypeNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.js new file mode 100644 index 00000000..d1309751 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueTypeNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.mjs new file mode 100644 index 00000000..b0400df4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueTypeNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueTypeNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.mts new file mode 100644 index 00000000..c4537c67 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueVariableNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.ts new file mode 100644 index 00000000..cc44800d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/UniqueVariableNamesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.js new file mode 100644 index 00000000..53011b4f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/UniqueVariableNamesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.mjs new file mode 100644 index 00000000..2937b4a3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/UniqueVariableNamesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/UniqueVariableNamesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.mts new file mode 100644 index 00000000..0a7cf7eb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ValuesOfCorrectTypeRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts new file mode 100644 index 00000000..c06fc34d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/ValuesOfCorrectTypeRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.js new file mode 100644 index 00000000..62ecc3ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/ValuesOfCorrectTypeRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.mjs new file mode 100644 index 00000000..0f5a8e84 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/ValuesOfCorrectTypeRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/ValuesOfCorrectTypeRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.mts new file mode 100644 index 00000000..c0e85f8f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/VariablesAreInputTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts new file mode 100644 index 00000000..06491f95 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/VariablesAreInputTypesRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.js new file mode 100644 index 00000000..80acf3e6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/VariablesAreInputTypesRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.mjs new file mode 100644 index 00000000..14629a46 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesAreInputTypesRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/VariablesAreInputTypesRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.mts new file mode 100644 index 00000000..3f6de51e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.mts @@ -0,0 +1 @@ +export * from '../../../validation/rules/VariablesInAllowedPositionRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts new file mode 100644 index 00000000..9ab252f0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.d.ts @@ -0,0 +1 @@ +export * from '../../../validation/rules/VariablesInAllowedPositionRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.js new file mode 100644 index 00000000..dfddc00c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../validation/rules/VariablesInAllowedPositionRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.mjs new file mode 100644 index 00000000..c07578e6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/VariablesInAllowedPositionRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../devMode.mjs'; +enableDevMode(); +export * from '../../../validation/rules/VariablesInAllowedPositionRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.mts new file mode 100644 index 00000000..c782f5e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.mts @@ -0,0 +1 @@ +export * from '../../../../validation/rules/custom/NoDeprecatedCustomRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts new file mode 100644 index 00000000..f8b4243e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.d.ts @@ -0,0 +1 @@ +export * from '../../../../validation/rules/custom/NoDeprecatedCustomRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.js new file mode 100644 index 00000000..1d2d5ff7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../../validation/rules/custom/NoDeprecatedCustomRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.mjs new file mode 100644 index 00000000..0b185975 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoDeprecatedCustomRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../../devMode.mjs'; +enableDevMode(); +export * from '../../../../validation/rules/custom/NoDeprecatedCustomRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts new file mode 100644 index 00000000..ba9aa41f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts @@ -0,0 +1 @@ +export * from '../../../../validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts new file mode 100644 index 00000000..2f41e60f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts @@ -0,0 +1 @@ +export * from '../../../../validation/rules/custom/NoSchemaIntrospectionCustomRule.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.js new file mode 100644 index 00000000..7c94fddb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../../../devMode.js'); +enableDevMode(); +module.exports = require('../../../../validation/rules/custom/NoSchemaIntrospectionCustomRule.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs new file mode 100644 index 00000000..32a2a241 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../../../devMode.mjs'; +enableDevMode(); +export * from '../../../../validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.mts new file mode 100644 index 00000000..e53fc0c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.mts @@ -0,0 +1 @@ +export * from '../../validation/specifiedRules.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.ts new file mode 100644 index 00000000..a3667db0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.d.ts @@ -0,0 +1 @@ +export * from '../../validation/specifiedRules.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.js new file mode 100644 index 00000000..2efe1ae0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../validation/specifiedRules.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.mjs new file mode 100644 index 00000000..9f8c259c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/specifiedRules.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../validation/specifiedRules.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.mts new file mode 100644 index 00000000..78e8b5ce --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.mts @@ -0,0 +1 @@ +export * from '../../validation/validate.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.ts new file mode 100644 index 00000000..29bc9808 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.d.ts @@ -0,0 +1 @@ +export * from '../../validation/validate.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.js new file mode 100644 index 00000000..67a2b1f9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../../devMode.js'); +enableDevMode(); +module.exports = require('../../validation/validate.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.mjs new file mode 100644 index 00000000..56390079 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/validation/validate.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../../devMode.mjs'; +enableDevMode(); +export * from '../../validation/validate.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.mts new file mode 100644 index 00000000..c82c7cc9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.mts @@ -0,0 +1 @@ +export * from '../version.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.ts new file mode 100644 index 00000000..dbf0e7d3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.d.ts @@ -0,0 +1 @@ +export * from '../version.js'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.js new file mode 100644 index 00000000..8ddd2d76 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.js @@ -0,0 +1,3 @@ +const { enableDevMode } = require('../devMode.js'); +enableDevMode(); +module.exports = require('../version.js'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.mjs new file mode 100644 index 00000000..72fa1e60 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/__dev__/version.mjs @@ -0,0 +1,3 @@ +import { enableDevMode } from '../devMode.mjs'; +enableDevMode(); +export * from '../version.mjs'; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.mts new file mode 100644 index 00000000..b84f7d50 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.mts @@ -0,0 +1,31 @@ +/** @category Development Mode */ +/** + * Enables GraphQL.js development mode checks for this module instance. + * + * Production entry points leave development mode disabled by default. Call this + * before constructing schemas or executing requests when additional development + * diagnostics should run. + * @example + * ```ts + * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode'; + * + * isDevModeEnabled(); // => false + * enableDevMode(); + * isDevModeEnabled(); // => true + * ``` + */ +export declare function enableDevMode(): void; +/** + * Returns whether GraphQL.js development mode has been enabled for this module + * instance. + * @returns True when development mode is enabled. + * @example + * ```ts + * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode'; + * + * enableDevMode(); + * + * isDevModeEnabled(); // => true + * ``` + */ +export declare function isDevModeEnabled(): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.ts new file mode 100644 index 00000000..b84f7d50 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.d.ts @@ -0,0 +1,31 @@ +/** @category Development Mode */ +/** + * Enables GraphQL.js development mode checks for this module instance. + * + * Production entry points leave development mode disabled by default. Call this + * before constructing schemas or executing requests when additional development + * diagnostics should run. + * @example + * ```ts + * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode'; + * + * isDevModeEnabled(); // => false + * enableDevMode(); + * isDevModeEnabled(); // => true + * ``` + */ +export declare function enableDevMode(): void; +/** + * Returns whether GraphQL.js development mode has been enabled for this module + * instance. + * @returns True when development mode is enabled. + * @example + * ```ts + * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode'; + * + * enableDevMode(); + * + * isDevModeEnabled(); // => true + * ``` + */ +export declare function isDevModeEnabled(): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js new file mode 100644 index 00000000..d7555ac8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.enableDevMode = enableDevMode; +exports.isDevModeEnabled = isDevModeEnabled; +const instanceOf_ts_1 = require("./jsutils/instanceOf.js"); +let devMode = false; +function enableDevMode() { + devMode = true; + (0, instanceOf_ts_1.enableDevInstanceOf)(); +} +function isDevModeEnabled() { + return devMode; +} +//# sourceMappingURL=devMode.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js.map new file mode 100644 index 00000000..1ae31b30 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"devMode.js","sourceRoot":"","sources":["../src/devMode.ts"],"names":[],"mappings":";;AAqBA,sCAGC;AAeD,4CAEC;AAvCD,2DAA8D;AAE9D,IAAI,OAAO,GAAG,KAAK,CAAC;AAiBpB,SAAgB,aAAa;IAC3B,OAAO,GAAG,IAAI,CAAC;IACf,IAAA,mCAAmB,GAAE,CAAC;AACxB,CAAC;AAeD,SAAgB,gBAAgB;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/** @category Development Mode */\n\nimport { enableDevInstanceOf } from './jsutils/instanceOf.ts';\n\nlet devMode = false;\n\n/**\n * Enables GraphQL.js development mode checks for this module instance.\n *\n * Production entry points leave development mode disabled by default. Call this\n * before constructing schemas or executing requests when additional development\n * diagnostics should run.\n * @example\n * ```ts\n * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode';\n *\n * isDevModeEnabled(); // => false\n * enableDevMode();\n * isDevModeEnabled(); // => true\n * ```\n */\nexport function enableDevMode(): void {\n devMode = true;\n enableDevInstanceOf();\n}\n\n/**\n * Returns whether GraphQL.js development mode has been enabled for this module\n * instance.\n * @returns True when development mode is enabled.\n * @example\n * ```ts\n * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode';\n *\n * enableDevMode();\n *\n * isDevModeEnabled(); // => true\n * ```\n */\nexport function isDevModeEnabled(): boolean {\n return devMode;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs new file mode 100644 index 00000000..6eab4c16 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs @@ -0,0 +1,10 @@ +import { enableDevInstanceOf } from "./jsutils/instanceOf.mjs"; +let devMode = false; +export function enableDevMode() { + devMode = true; + enableDevInstanceOf(); +} +export function isDevModeEnabled() { + return devMode; +} +//# sourceMappingURL=devMode.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs.map new file mode 100644 index 00000000..df9021a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/devMode.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"devMode.js","sourceRoot":"","sources":["../src/devMode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,iCAAgC;AAE9D,IAAI,OAAO,GAAG,KAAK,CAAC;AAiBpB,MAAM,UAAU,aAAa;IAC3B,OAAO,GAAG,IAAI,CAAC;IACf,mBAAmB,EAAE,CAAC;AACxB,CAAC;AAeD,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/** @category Development Mode */\n\nimport { enableDevInstanceOf } from './jsutils/instanceOf.ts';\n\nlet devMode = false;\n\n/**\n * Enables GraphQL.js development mode checks for this module instance.\n *\n * Production entry points leave development mode disabled by default. Call this\n * before constructing schemas or executing requests when additional development\n * diagnostics should run.\n * @example\n * ```ts\n * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode';\n *\n * isDevModeEnabled(); // => false\n * enableDevMode();\n * isDevModeEnabled(); // => true\n * ```\n */\nexport function enableDevMode(): void {\n devMode = true;\n enableDevInstanceOf();\n}\n\n/**\n * Returns whether GraphQL.js development mode has been enabled for this module\n * instance.\n * @returns True when development mode is enabled.\n * @example\n * ```ts\n * import { enableDevMode, isDevModeEnabled } from 'graphql/devMode';\n *\n * enableDevMode();\n *\n * isDevModeEnabled(); // => true\n * ```\n */\nexport function isDevModeEnabled(): boolean {\n return devMode;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.mts new file mode 100644 index 00000000..8e54317e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.mts @@ -0,0 +1,307 @@ +/** + * TracingChannel integration. + * + * GraphQL.js publishes lifecycle events on a set of named tracing channels + * that application performance monitoring (APM) tools can subscribe to in + * order to observe parse, validate, execute, subscribe, and resolver behavior, + * plus selected executor internals. At module load time GraphQL.js resolves + * `node:diagnostics_channel` itself so APMs do not need to interact with the + * GraphQL API to enable tracing. On runtimes that do not expose + * `node:diagnostics_channel` (e.g., browsers) the load silently no-ops and + * emission sites short-circuit. + * + * Within the tracing context types, `error` means the traced JavaScript call + * threw or rejected; it does not mean every `GraphQLError` returned by + * GraphQL.js. Some channels complete normally and publish GraphQL errors on + * `result`. Resolver errors can appear both as `message.error` on + * `graphql:resolve` and as formatted errors in an enclosing execution or + * subscription result. `graphql:parse`, `graphql:validate`, and + * `graphql:execute:variableCoercion` are sync-only channels. + * @category Diagnostics + */ +import type { Maybe } from "./jsutils/Maybe.mjs"; +import type { ObjMap } from "./jsutils/ObjMap.mjs"; +import type { GraphQLError } from "./error/GraphQLError.mjs"; +import type { DocumentNode, OperationDefinitionNode, OperationTypeNode } from "./language/ast.mjs"; +import type { Source } from "./language/source.mjs"; +import type { GraphQLSchema } from "./type/schema.mjs"; +import type { ExecutionResult } from "./execution/Executor.mjs"; +import type { ExperimentalIncrementalExecutionResults } from "./execution/incremental/IncrementalExecutor.mjs"; +import type { VariableValues } from "./execution/values.mjs"; +/** + * Structural subset of `DiagnosticsChannel` sufficient for publishing and + * subscriber gating. The `node:diagnostics_channel` `Channel` satisfies this. + * + * @internal + */ +export interface MinimalChannel { + readonly hasSubscribers?: boolean; + publish: (message: TMessage) => void; + runStores: (context: ContextType, fn: (this: ContextType, ...args: Array) => T, thisArg?: unknown, ...args: Array) => T; +} +/** + * Structural subset of the Node.js `TracingChannel` API. The + * `node:diagnostics_channel` `TracingChannel` satisfies this by duck typing, + * so GraphQL.js does not need a dependency on `@types/node` or on the runtime + * itself. + * + * @internal + */ +export interface MinimalTracingChannel { + readonly hasSubscribers: boolean | undefined; + readonly start: MinimalChannel; + readonly end: MinimalChannel; + readonly asyncStart: MinimalChannel; + readonly asyncEnd: MinimalChannel; + readonly error: MinimalChannel; + traceSync: (fn: (...args: Array) => T, context: TContext extends object ? TContext : object, thisArg?: unknown, ...args: Array) => T; +} +/** Context published on the sync-only `graphql:parse` channel. */ +export interface GraphQLParseContext { + /** Source text or source object passed to the parser. */ + source: string | Source; + /** Error thrown while parsing, when parsing fails. */ + error?: unknown; + /** Parsed document, when parsing succeeds. */ + result?: DocumentNode; +} +/** Context published on the sync-only `graphql:validate` channel. */ +export interface GraphQLValidateContext { + /** Schema used for validation. */ + schema: GraphQLSchema; + /** Parsed document being validated. */ + document: DocumentNode; + /** Error thrown while validating, when validation fails abruptly. */ + error?: unknown; + /** Validation errors returned by validation. */ + result?: ReadonlyArray; +} +/** + * Context published on `graphql:execute`. + * + * Returned results may contain GraphQL errors collected during execution. + */ +export interface GraphQLExecuteContext { + /** Schema used for execution. */ + schema: GraphQLSchema; + /** Parsed document being executed. */ + document: DocumentNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type, if one is available. */ + operationType: OperationTypeNode | undefined; + /** Error thrown or rejected while executing, when execution fails abruptly. */ + error?: unknown; + /** Execution result returned by execution, including GraphQL errors. */ + result?: ExecutionResult | ExperimentalIncrementalExecutionResults; +} +/** + * Context published on `graphql:execute:rootSelectionSet`. + * + * Returned results may contain GraphQL errors collected during execution. + */ +export interface GraphQLExecuteRootSelectionSetContext { + /** Schema used for execution. */ + schema: GraphQLSchema; + /** Parsed document being executed. */ + document: DocumentNode; + /** Operation definition selected for execution. */ + operation: OperationDefinitionNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type. */ + operationType: OperationTypeNode; + /** Error thrown or rejected while executing the root selection set. */ + error?: unknown; + /** + * Execution result returned from the root selection set, including GraphQL + * errors. + */ + result?: ExecutionResult | ExperimentalIncrementalExecutionResults; +} +/** + * Context published on `graphql:execute:variableCoercion`. + * + * Coercion runs synchronously while execution arguments are validated, so only + * the `start`/`end` (and, on an abrupt throw, `error`) lifecycle fires. + * Ordinary variable coercion failures are returned on `result.errors`; when + * execution is invoked through APIs such as `execute()` or `subscribe()`, they + * surface as GraphQL result errors rather than as the tracing `error` + * lifecycle event. + */ +export interface GraphQLExecuteVariableCoercionContext { + /** Schema used for variable coercion. */ + schema: GraphQLSchema; + /** Parsed document being executed. */ + document: DocumentNode; + /** Operation definition whose variables are being coerced. */ + operation: OperationDefinitionNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type. */ + operationType: OperationTypeNode; + /** Error thrown while coercing variables, when coercion fails abruptly. */ + error?: unknown; + /** Coerced variable values or coercion errors returned by coercion. */ + result?: { + variableValues: VariableValues; + } | { + errors: ReadonlyArray; + }; +} +/** + * Context published on `graphql:subscribe`. + * + * Subscription source resolver errors and invalid source stream results are + * returned on `result` as ExecutionResult errors; they do not publish the + * `error` lifecycle event unless subscription setup fails abruptly before + * GraphQL can form a result. + */ +export interface GraphQLSubscribeContext { + /** Schema used for subscription execution. */ + schema: GraphQLSchema; + /** Parsed subscription document. */ + document: DocumentNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type, if one is available. */ + operationType: OperationTypeNode | undefined; + /** Error thrown or rejected while subscribing, when setup fails abruptly. */ + error?: unknown; + /** + * Subscription response stream, or an ExecutionResult containing GraphQL + * errors. + */ + result?: AsyncGenerator | ExecutionResult; +} +/** + * Context published on `graphql:resolve`. + * + * Resolver throws and rejections publish the `error` lifecycle event here. + * The same failure may also be formatted into the enclosing execution or + * subscription result. + */ +export interface GraphQLResolveContext { + /** Field name being resolved. */ + fieldName: string; + /** Response alias for the field being resolved. */ + alias: string; + /** Parent type name for the field being resolved. */ + parentType: string; + /** Return type string for the field being resolved. */ + fieldType: string; + /** Argument values passed to the resolver. */ + args: ObjMap; + /** Whether the field is using the default resolver. */ + isDefaultResolver: boolean; + /** Response path for the field being resolved. */ + fieldPath: string; + /** Error thrown or rejected by the resolver, when resolution fails. */ + error?: unknown; + /** Value returned by the resolver, when resolution succeeds. */ + result?: unknown; +} +/** Mapping from tracing channel name to the context type published on it. */ +export interface GraphQLChannelContextByName { + /** Context published on `graphql:parse`. */ + 'graphql:parse': GraphQLParseContext; + /** Context published on `graphql:validate`. */ + 'graphql:validate': GraphQLValidateContext; + /** Context published on `graphql:execute`. */ + 'graphql:execute': GraphQLExecuteContext; + /** Context published on `graphql:execute:variableCoercion`. */ + 'graphql:execute:variableCoercion': GraphQLExecuteVariableCoercionContext; + /** Context published on `graphql:execute:rootSelectionSet`. */ + 'graphql:execute:rootSelectionSet': GraphQLExecuteRootSelectionSetContext; + /** Context published on `graphql:subscribe`. */ + 'graphql:subscribe': GraphQLSubscribeContext; + /** Context published on `graphql:resolve`. */ + 'graphql:resolve': GraphQLResolveContext; +} +/** + * The collection of tracing channels GraphQL.js emits on. Application + * performance monitoring (APM) tools subscribe to these by name on their own + * `node:diagnostics_channel` import; both paths land on the same channel + * instance because `tracingChannel(name)` is cached by name. + */ +export interface GraphQLChannels { + /** Tracing channel for `graphql:execute`. */ + execute: MinimalTracingChannel; + /** Tracing channel for `graphql:execute:variableCoercion`. */ + executeVariableCoercion: MinimalTracingChannel; + /** Tracing channel for `graphql:execute:rootSelectionSet`. */ + executeRootSelectionSet: MinimalTracingChannel; + /** Tracing channel for `graphql:parse`. */ + parse: MinimalTracingChannel; + /** Tracing channel for `graphql:validate`. */ + validate: MinimalTracingChannel; + /** Tracing channel for `graphql:resolve`. */ + resolve: MinimalTracingChannel; + /** Tracing channel for `graphql:subscribe`. */ + subscribe: MinimalTracingChannel; +} +/** + * Per-channel handles, resolved once at module load. `undefined` when + * `node:diagnostics_channel` isn't available. Emission sites read these + * directly to keep the no-subscriber fast path to a single property access + * plus a `hasSubscribers` check (no function calls, no closures). + * + * @internal + */ +export declare const parseChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const validateChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const executeChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const executeVariableCoercionChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const executeRootSelectionSetChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const subscribeChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const resolveChannel: MinimalTracingChannel | undefined; +/** + * Whether emission sites should publish to `channel`. Trusts the + * `TracingChannel.hasSubscribers` aggregate when the runtime exposes it; if + * the getter is missing (e.g. Bun's `node:diagnostics_channel`, where + * `tracingChannel.hasSubscribers` is `undefined`), falls back to checking + * each of the five underlying lifecycle channels so a subscriber attached + * via `tracingChannel.subscribe(handlers)` is still observed. + * + * @internal + */ +export declare function shouldTrace(channel: MinimalTracingChannel | undefined): channel is MinimalTracingChannel; +interface TraceLifecycleContext { + error?: unknown; + result?: unknown; +} +type TraceStartContext = Omit; +/** + * Publish a traced call that may complete synchronously or with a promise. + * Caller has already verified that a subscriber is attached. On normal + * completion, `result` is attached before the terminal `end` or `asyncEnd` + * event. When the traced call throws or rejects, `error` is attached, the + * `error` sub-channel fires, and the terminal `end` or `asyncEnd` event is + * published before the original failure is propagated. + * + * @internal + */ +export declare function traceMixed(channel: MinimalTracingChannel, contextInput: TraceStartContext, fn: () => TResult): TResult; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.ts new file mode 100644 index 00000000..14a5711e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.d.ts @@ -0,0 +1,307 @@ +/** + * TracingChannel integration. + * + * GraphQL.js publishes lifecycle events on a set of named tracing channels + * that application performance monitoring (APM) tools can subscribe to in + * order to observe parse, validate, execute, subscribe, and resolver behavior, + * plus selected executor internals. At module load time GraphQL.js resolves + * `node:diagnostics_channel` itself so APMs do not need to interact with the + * GraphQL API to enable tracing. On runtimes that do not expose + * `node:diagnostics_channel` (e.g., browsers) the load silently no-ops and + * emission sites short-circuit. + * + * Within the tracing context types, `error` means the traced JavaScript call + * threw or rejected; it does not mean every `GraphQLError` returned by + * GraphQL.js. Some channels complete normally and publish GraphQL errors on + * `result`. Resolver errors can appear both as `message.error` on + * `graphql:resolve` and as formatted errors in an enclosing execution or + * subscription result. `graphql:parse`, `graphql:validate`, and + * `graphql:execute:variableCoercion` are sync-only channels. + * @category Diagnostics + */ +import type { Maybe } from "./jsutils/Maybe.js"; +import type { ObjMap } from "./jsutils/ObjMap.js"; +import type { GraphQLError } from "./error/GraphQLError.js"; +import type { DocumentNode, OperationDefinitionNode, OperationTypeNode } from "./language/ast.js"; +import type { Source } from "./language/source.js"; +import type { GraphQLSchema } from "./type/schema.js"; +import type { ExecutionResult } from "./execution/Executor.js"; +import type { ExperimentalIncrementalExecutionResults } from "./execution/incremental/IncrementalExecutor.js"; +import type { VariableValues } from "./execution/values.js"; +/** + * Structural subset of `DiagnosticsChannel` sufficient for publishing and + * subscriber gating. The `node:diagnostics_channel` `Channel` satisfies this. + * + * @internal + */ +export interface MinimalChannel { + readonly hasSubscribers?: boolean; + publish: (message: TMessage) => void; + runStores: (context: ContextType, fn: (this: ContextType, ...args: Array) => T, thisArg?: unknown, ...args: Array) => T; +} +/** + * Structural subset of the Node.js `TracingChannel` API. The + * `node:diagnostics_channel` `TracingChannel` satisfies this by duck typing, + * so GraphQL.js does not need a dependency on `@types/node` or on the runtime + * itself. + * + * @internal + */ +export interface MinimalTracingChannel { + readonly hasSubscribers: boolean | undefined; + readonly start: MinimalChannel; + readonly end: MinimalChannel; + readonly asyncStart: MinimalChannel; + readonly asyncEnd: MinimalChannel; + readonly error: MinimalChannel; + traceSync: (fn: (...args: Array) => T, context: TContext extends object ? TContext : object, thisArg?: unknown, ...args: Array) => T; +} +/** Context published on the sync-only `graphql:parse` channel. */ +export interface GraphQLParseContext { + /** Source text or source object passed to the parser. */ + source: string | Source; + /** Error thrown while parsing, when parsing fails. */ + error?: unknown; + /** Parsed document, when parsing succeeds. */ + result?: DocumentNode; +} +/** Context published on the sync-only `graphql:validate` channel. */ +export interface GraphQLValidateContext { + /** Schema used for validation. */ + schema: GraphQLSchema; + /** Parsed document being validated. */ + document: DocumentNode; + /** Error thrown while validating, when validation fails abruptly. */ + error?: unknown; + /** Validation errors returned by validation. */ + result?: ReadonlyArray; +} +/** + * Context published on `graphql:execute`. + * + * Returned results may contain GraphQL errors collected during execution. + */ +export interface GraphQLExecuteContext { + /** Schema used for execution. */ + schema: GraphQLSchema; + /** Parsed document being executed. */ + document: DocumentNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type, if one is available. */ + operationType: OperationTypeNode | undefined; + /** Error thrown or rejected while executing, when execution fails abruptly. */ + error?: unknown; + /** Execution result returned by execution, including GraphQL errors. */ + result?: ExecutionResult | ExperimentalIncrementalExecutionResults; +} +/** + * Context published on `graphql:execute:rootSelectionSet`. + * + * Returned results may contain GraphQL errors collected during execution. + */ +export interface GraphQLExecuteRootSelectionSetContext { + /** Schema used for execution. */ + schema: GraphQLSchema; + /** Parsed document being executed. */ + document: DocumentNode; + /** Operation definition selected for execution. */ + operation: OperationDefinitionNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type. */ + operationType: OperationTypeNode; + /** Error thrown or rejected while executing the root selection set. */ + error?: unknown; + /** + * Execution result returned from the root selection set, including GraphQL + * errors. + */ + result?: ExecutionResult | ExperimentalIncrementalExecutionResults; +} +/** + * Context published on `graphql:execute:variableCoercion`. + * + * Coercion runs synchronously while execution arguments are validated, so only + * the `start`/`end` (and, on an abrupt throw, `error`) lifecycle fires. + * Ordinary variable coercion failures are returned on `result.errors`; when + * execution is invoked through APIs such as `execute()` or `subscribe()`, they + * surface as GraphQL result errors rather than as the tracing `error` + * lifecycle event. + */ +export interface GraphQLExecuteVariableCoercionContext { + /** Schema used for variable coercion. */ + schema: GraphQLSchema; + /** Parsed document being executed. */ + document: DocumentNode; + /** Operation definition whose variables are being coerced. */ + operation: OperationDefinitionNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type. */ + operationType: OperationTypeNode; + /** Error thrown while coercing variables, when coercion fails abruptly. */ + error?: unknown; + /** Coerced variable values or coercion errors returned by coercion. */ + result?: { + variableValues: VariableValues; + } | { + errors: ReadonlyArray; + }; +} +/** + * Context published on `graphql:subscribe`. + * + * Subscription source resolver errors and invalid source stream results are + * returned on `result` as ExecutionResult errors; they do not publish the + * `error` lifecycle event unless subscription setup fails abruptly before + * GraphQL can form a result. + */ +export interface GraphQLSubscribeContext { + /** Schema used for subscription execution. */ + schema: GraphQLSchema; + /** Parsed subscription document. */ + document: DocumentNode; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Selected operation name, if one is available. */ + operationName: string | undefined; + /** Selected operation type, if one is available. */ + operationType: OperationTypeNode | undefined; + /** Error thrown or rejected while subscribing, when setup fails abruptly. */ + error?: unknown; + /** + * Subscription response stream, or an ExecutionResult containing GraphQL + * errors. + */ + result?: AsyncGenerator | ExecutionResult; +} +/** + * Context published on `graphql:resolve`. + * + * Resolver throws and rejections publish the `error` lifecycle event here. + * The same failure may also be formatted into the enclosing execution or + * subscription result. + */ +export interface GraphQLResolveContext { + /** Field name being resolved. */ + fieldName: string; + /** Response alias for the field being resolved. */ + alias: string; + /** Parent type name for the field being resolved. */ + parentType: string; + /** Return type string for the field being resolved. */ + fieldType: string; + /** Argument values passed to the resolver. */ + args: ObjMap; + /** Whether the field is using the default resolver. */ + isDefaultResolver: boolean; + /** Response path for the field being resolved. */ + fieldPath: string; + /** Error thrown or rejected by the resolver, when resolution fails. */ + error?: unknown; + /** Value returned by the resolver, when resolution succeeds. */ + result?: unknown; +} +/** Mapping from tracing channel name to the context type published on it. */ +export interface GraphQLChannelContextByName { + /** Context published on `graphql:parse`. */ + 'graphql:parse': GraphQLParseContext; + /** Context published on `graphql:validate`. */ + 'graphql:validate': GraphQLValidateContext; + /** Context published on `graphql:execute`. */ + 'graphql:execute': GraphQLExecuteContext; + /** Context published on `graphql:execute:variableCoercion`. */ + 'graphql:execute:variableCoercion': GraphQLExecuteVariableCoercionContext; + /** Context published on `graphql:execute:rootSelectionSet`. */ + 'graphql:execute:rootSelectionSet': GraphQLExecuteRootSelectionSetContext; + /** Context published on `graphql:subscribe`. */ + 'graphql:subscribe': GraphQLSubscribeContext; + /** Context published on `graphql:resolve`. */ + 'graphql:resolve': GraphQLResolveContext; +} +/** + * The collection of tracing channels GraphQL.js emits on. Application + * performance monitoring (APM) tools subscribe to these by name on their own + * `node:diagnostics_channel` import; both paths land on the same channel + * instance because `tracingChannel(name)` is cached by name. + */ +export interface GraphQLChannels { + /** Tracing channel for `graphql:execute`. */ + execute: MinimalTracingChannel; + /** Tracing channel for `graphql:execute:variableCoercion`. */ + executeVariableCoercion: MinimalTracingChannel; + /** Tracing channel for `graphql:execute:rootSelectionSet`. */ + executeRootSelectionSet: MinimalTracingChannel; + /** Tracing channel for `graphql:parse`. */ + parse: MinimalTracingChannel; + /** Tracing channel for `graphql:validate`. */ + validate: MinimalTracingChannel; + /** Tracing channel for `graphql:resolve`. */ + resolve: MinimalTracingChannel; + /** Tracing channel for `graphql:subscribe`. */ + subscribe: MinimalTracingChannel; +} +/** + * Per-channel handles, resolved once at module load. `undefined` when + * `node:diagnostics_channel` isn't available. Emission sites read these + * directly to keep the no-subscriber fast path to a single property access + * plus a `hasSubscribers` check (no function calls, no closures). + * + * @internal + */ +export declare const parseChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const validateChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const executeChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const executeVariableCoercionChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const executeRootSelectionSetChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const subscribeChannel: MinimalTracingChannel | undefined; +/** @internal */ +export declare const resolveChannel: MinimalTracingChannel | undefined; +/** + * Whether emission sites should publish to `channel`. Trusts the + * `TracingChannel.hasSubscribers` aggregate when the runtime exposes it; if + * the getter is missing (e.g. Bun's `node:diagnostics_channel`, where + * `tracingChannel.hasSubscribers` is `undefined`), falls back to checking + * each of the five underlying lifecycle channels so a subscriber attached + * via `tracingChannel.subscribe(handlers)` is still observed. + * + * @internal + */ +export declare function shouldTrace(channel: MinimalTracingChannel | undefined): channel is MinimalTracingChannel; +interface TraceLifecycleContext { + error?: unknown; + result?: unknown; +} +type TraceStartContext = Omit; +/** + * Publish a traced call that may complete synchronously or with a promise. + * Caller has already verified that a subscriber is attached. On normal + * completion, `result` is attached before the terminal `end` or `asyncEnd` + * event. When the traced call throws or rejects, `error` is attached, the + * `error` sub-channel fires, and the terminal `end` or `asyncEnd` event is + * published before the original failure is propagated. + * + * @internal + */ +export declare function traceMixed(channel: MinimalTracingChannel, contextInput: TraceStartContext, fn: () => TResult): TResult; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js new file mode 100644 index 00000000..15bd0827 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveChannel = exports.subscribeChannel = exports.executeRootSelectionSetChannel = exports.executeVariableCoercionChannel = exports.executeChannel = exports.validateChannel = exports.parseChannel = void 0; +exports.shouldTrace = shouldTrace; +exports.traceMixed = traceMixed; +const isPromise_ts_1 = require("./jsutils/isPromise.js"); +function resolveDiagnosticsChannel() { + let dc; + try { + const processRef = globalThis.process; + if (typeof processRef?.getBuiltinModule === 'function') { + dc = processRef.getBuiltinModule('node:diagnostics_channel'); + } + } + catch { + } + return dc; +} +const dc = resolveDiagnosticsChannel(); +exports.parseChannel = dc?.tracingChannel('graphql:parse'); +exports.validateChannel = dc?.tracingChannel('graphql:validate'); +exports.executeChannel = dc?.tracingChannel('graphql:execute'); +exports.executeVariableCoercionChannel = dc?.tracingChannel('graphql:execute:variableCoercion'); +exports.executeRootSelectionSetChannel = dc?.tracingChannel('graphql:execute:rootSelectionSet'); +exports.subscribeChannel = dc?.tracingChannel('graphql:subscribe'); +exports.resolveChannel = dc?.tracingChannel('graphql:resolve'); +const SUB_CHANNEL_KEYS = ['start', 'end', 'asyncStart', 'asyncEnd', 'error']; +function shouldTrace(channel) { + if (channel == null) { + return false; + } + const aggregate = channel.hasSubscribers; + if (aggregate !== undefined) { + return aggregate; + } + for (const key of SUB_CHANNEL_KEYS) { + if (channel[key].hasSubscribers) { + return true; + } + } + return false; +} +function traceMixed(channel, contextInput, fn) { + const context = contextInput; + return channel.start.runStores(context, () => { + let result; + try { + result = fn(); + } + catch (err) { + context.error = err; + channel.error.publish(context); + channel.end.publish(context); + throw err; + } + if (!(0, isPromise_ts_1.isPromiseLike)(result)) { + context.result = result; + channel.end.publish(context); + return result; + } + channel.end.publish(context); + return result.then((value) => { + context.result = value; + channel.asyncStart.publish(context); + channel.asyncEnd.publish(context); + return value; + }, (err) => { + context.error = err; + channel.error.publish(context); + channel.asyncStart.publish(context); + channel.asyncEnd.publish(context); + throw err; + }); + }); +} +//# sourceMappingURL=diagnostics.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js.map new file mode 100644 index 00000000..47f838c3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":";;;AA6WA,kCAiBC;AAsBD,gCA0CC;AAxaD,yDAAuD;AA2QvD,SAAS,yBAAyB;IAChC,IAAI,EAAwC,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,UAAU,GACd,UAGD,CAAC,OAAO,CAAC;QACV,IAEE,OAAO,UAAU,EAAE,gBAAgB,KAAK,UAAU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OAAO,CAAC,OAAO,CAAC,CAAC;YAClC,MAAM,GAAG,CAAC;QACZ,CAAC,CACS,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * TracingChannel integration.\n *\n * GraphQL.js publishes lifecycle events on a set of named tracing channels\n * that application performance monitoring (APM) tools can subscribe to in\n * order to observe parse, validate, execute, subscribe, and resolver behavior,\n * plus selected executor internals. At module load time GraphQL.js resolves\n * `node:diagnostics_channel` itself so APMs do not need to interact with the\n * GraphQL API to enable tracing. On runtimes that do not expose\n * `node:diagnostics_channel` (e.g., browsers) the load silently no-ops and\n * emission sites short-circuit.\n *\n * Within the tracing context types, `error` means the traced JavaScript call\n * threw or rejected; it does not mean every `GraphQLError` returned by\n * GraphQL.js. Some channels complete normally and publish GraphQL errors on\n * `result`. Resolver errors can appear both as `message.error` on\n * `graphql:resolve` and as formatted errors in an enclosing execution or\n * subscription result. `graphql:parse`, `graphql:validate`, and\n * `graphql:execute:variableCoercion` are sync-only channels.\n * @category Diagnostics\n */\n\nimport { isPromiseLike } from './jsutils/isPromise.ts';\nimport type { Maybe } from './jsutils/Maybe.ts';\nimport type { ObjMap } from './jsutils/ObjMap.ts';\n\nimport type { GraphQLError } from './error/GraphQLError.ts';\n\nimport type {\n DocumentNode,\n OperationDefinitionNode,\n OperationTypeNode,\n} from './language/ast.ts';\nimport type { Source } from './language/source.ts';\n\nimport type { GraphQLSchema } from './type/schema.ts';\n\nimport type { ExecutionResult } from './execution/Executor.ts';\nimport type { ExperimentalIncrementalExecutionResults } from './execution/incremental/IncrementalExecutor.ts';\nimport type { VariableValues } from './execution/values.ts';\n\n/**\n * Structural subset of `DiagnosticsChannel` sufficient for publishing and\n * subscriber gating. The `node:diagnostics_channel` `Channel` satisfies this.\n *\n * @internal\n */\nexport interface MinimalChannel {\n readonly hasSubscribers?: boolean;\n publish: (message: TMessage) => void;\n runStores: (\n context: ContextType,\n fn: (this: ContextType, ...args: Array) => T,\n thisArg?: unknown,\n ...args: Array\n ) => T;\n}\n\n/**\n * Structural subset of the Node.js `TracingChannel` API. The\n * `node:diagnostics_channel` `TracingChannel` satisfies this by duck typing,\n * so GraphQL.js does not need a dependency on `@types/node` or on the runtime\n * itself.\n *\n * @internal\n */\nexport interface MinimalTracingChannel {\n // `undefined` accommodates runtimes (e.g. Bun) that ship `tracingChannel`\n // without exposing the aggregate `hasSubscribers` getter.\n readonly hasSubscribers: boolean | undefined;\n readonly start: MinimalChannel;\n readonly end: MinimalChannel;\n readonly asyncStart: MinimalChannel;\n readonly asyncEnd: MinimalChannel;\n readonly error: MinimalChannel;\n\n traceSync: (\n fn: (...args: Array) => T,\n context: TContext extends object ? TContext : object,\n thisArg?: unknown,\n ...args: Array\n ) => T;\n}\n\ninterface DiagnosticsChannelModule {\n tracingChannel: (\n name: string,\n ) => MinimalTracingChannel;\n}\n\n/** Context published on the sync-only `graphql:parse` channel. */\nexport interface GraphQLParseContext {\n /** Source text or source object passed to the parser. */\n source: string | Source;\n /** Error thrown while parsing, when parsing fails. */\n error?: unknown;\n /** Parsed document, when parsing succeeds. */\n result?: DocumentNode;\n}\n\n/** Context published on the sync-only `graphql:validate` channel. */\nexport interface GraphQLValidateContext {\n /** Schema used for validation. */\n schema: GraphQLSchema;\n /** Parsed document being validated. */\n document: DocumentNode;\n /** Error thrown while validating, when validation fails abruptly. */\n error?: unknown;\n /** Validation errors returned by validation. */\n result?: ReadonlyArray;\n}\n\n/**\n * Context published on `graphql:execute`.\n *\n * Returned results may contain GraphQL errors collected during execution.\n */\nexport interface GraphQLExecuteContext {\n /** Schema used for execution. */\n schema: GraphQLSchema;\n /** Parsed document being executed. */\n document: DocumentNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type, if one is available. */\n operationType: OperationTypeNode | undefined;\n /** Error thrown or rejected while executing, when execution fails abruptly. */\n error?: unknown;\n /** Execution result returned by execution, including GraphQL errors. */\n result?: ExecutionResult | ExperimentalIncrementalExecutionResults;\n}\n\n/**\n * Context published on `graphql:execute:rootSelectionSet`.\n *\n * Returned results may contain GraphQL errors collected during execution.\n */\nexport interface GraphQLExecuteRootSelectionSetContext {\n /** Schema used for execution. */\n schema: GraphQLSchema;\n /** Parsed document being executed. */\n document: DocumentNode;\n /** Operation definition selected for execution. */\n operation: OperationDefinitionNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type. */\n operationType: OperationTypeNode;\n /** Error thrown or rejected while executing the root selection set. */\n error?: unknown;\n /**\n * Execution result returned from the root selection set, including GraphQL\n * errors.\n */\n result?: ExecutionResult | ExperimentalIncrementalExecutionResults;\n}\n\n/**\n * Context published on `graphql:execute:variableCoercion`.\n *\n * Coercion runs synchronously while execution arguments are validated, so only\n * the `start`/`end` (and, on an abrupt throw, `error`) lifecycle fires.\n * Ordinary variable coercion failures are returned on `result.errors`; when\n * execution is invoked through APIs such as `execute()` or `subscribe()`, they\n * surface as GraphQL result errors rather than as the tracing `error`\n * lifecycle event.\n */\nexport interface GraphQLExecuteVariableCoercionContext {\n /** Schema used for variable coercion. */\n schema: GraphQLSchema;\n /** Parsed document being executed. */\n document: DocumentNode;\n /** Operation definition whose variables are being coerced. */\n operation: OperationDefinitionNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type. */\n operationType: OperationTypeNode;\n /** Error thrown while coercing variables, when coercion fails abruptly. */\n error?: unknown;\n /** Coerced variable values or coercion errors returned by coercion. */\n result?:\n | { variableValues: VariableValues }\n | { errors: ReadonlyArray };\n}\n\n/**\n * Context published on `graphql:subscribe`.\n *\n * Subscription source resolver errors and invalid source stream results are\n * returned on `result` as ExecutionResult errors; they do not publish the\n * `error` lifecycle event unless subscription setup fails abruptly before\n * GraphQL can form a result.\n */\nexport interface GraphQLSubscribeContext {\n /** Schema used for subscription execution. */\n schema: GraphQLSchema;\n /** Parsed subscription document. */\n document: DocumentNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type, if one is available. */\n operationType: OperationTypeNode | undefined;\n /** Error thrown or rejected while subscribing, when setup fails abruptly. */\n error?: unknown;\n /**\n * Subscription response stream, or an ExecutionResult containing GraphQL\n * errors.\n */\n result?: AsyncGenerator | ExecutionResult;\n}\n\n/**\n * Context published on `graphql:resolve`.\n *\n * Resolver throws and rejections publish the `error` lifecycle event here.\n * The same failure may also be formatted into the enclosing execution or\n * subscription result.\n */\nexport interface GraphQLResolveContext {\n /** Field name being resolved. */\n fieldName: string;\n /** Response alias for the field being resolved. */\n alias: string;\n /** Parent type name for the field being resolved. */\n parentType: string;\n /** Return type string for the field being resolved. */\n fieldType: string;\n /** Argument values passed to the resolver. */\n args: ObjMap;\n /** Whether the field is using the default resolver. */\n isDefaultResolver: boolean;\n /** Response path for the field being resolved. */\n fieldPath: string;\n /** Error thrown or rejected by the resolver, when resolution fails. */\n error?: unknown;\n /** Value returned by the resolver, when resolution succeeds. */\n result?: unknown;\n}\n\n/** Mapping from tracing channel name to the context type published on it. */\nexport interface GraphQLChannelContextByName {\n /** Context published on `graphql:parse`. */\n 'graphql:parse': GraphQLParseContext;\n /** Context published on `graphql:validate`. */\n 'graphql:validate': GraphQLValidateContext;\n /** Context published on `graphql:execute`. */\n 'graphql:execute': GraphQLExecuteContext;\n /** Context published on `graphql:execute:variableCoercion`. */\n 'graphql:execute:variableCoercion': GraphQLExecuteVariableCoercionContext;\n /** Context published on `graphql:execute:rootSelectionSet`. */\n 'graphql:execute:rootSelectionSet': GraphQLExecuteRootSelectionSetContext;\n /** Context published on `graphql:subscribe`. */\n 'graphql:subscribe': GraphQLSubscribeContext;\n /** Context published on `graphql:resolve`. */\n 'graphql:resolve': GraphQLResolveContext;\n}\n\n/**\n * The collection of tracing channels GraphQL.js emits on. Application\n * performance monitoring (APM) tools subscribe to these by name on their own\n * `node:diagnostics_channel` import; both paths land on the same channel\n * instance because `tracingChannel(name)` is cached by name.\n */\nexport interface GraphQLChannels {\n /** Tracing channel for `graphql:execute`. */\n execute: MinimalTracingChannel;\n /** Tracing channel for `graphql:execute:variableCoercion`. */\n executeVariableCoercion: MinimalTracingChannel;\n /** Tracing channel for `graphql:execute:rootSelectionSet`. */\n executeRootSelectionSet: MinimalTracingChannel;\n /** Tracing channel for `graphql:parse`. */\n parse: MinimalTracingChannel;\n /** Tracing channel for `graphql:validate`. */\n validate: MinimalTracingChannel;\n /** Tracing channel for `graphql:resolve`. */\n resolve: MinimalTracingChannel;\n /** Tracing channel for `graphql:subscribe`. */\n subscribe: MinimalTracingChannel;\n}\n\nfunction resolveDiagnosticsChannel(): DiagnosticsChannelModule | undefined {\n let dc: DiagnosticsChannelModule | undefined;\n try {\n const processRef = (\n globalThis as {\n process?: { getBuiltinModule?: (id: string) => unknown };\n }\n ).process;\n if (\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n typeof processRef?.getBuiltinModule === 'function'\n ) {\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n dc = processRef.getBuiltinModule(\n 'node:diagnostics_channel',\n ) as DiagnosticsChannelModule;\n }\n /* node:coverage ignore next 3 */\n } catch {\n // diagnostics_channel not available on this runtime; tracing is a no-op.\n }\n return dc;\n}\n\nconst dc = resolveDiagnosticsChannel();\n\n/**\n * Per-channel handles, resolved once at module load. `undefined` when\n * `node:diagnostics_channel` isn't available. Emission sites read these\n * directly to keep the no-subscriber fast path to a single property access\n * plus a `hasSubscribers` check (no function calls, no closures).\n *\n * @internal\n */\nexport const parseChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:parse');\n/** @internal */\nexport const validateChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:validate');\n/** @internal */\nexport const executeChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:execute');\n/** @internal */\nexport const executeVariableCoercionChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:execute:variableCoercion');\n/** @internal */\nexport const executeRootSelectionSetChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:execute:rootSelectionSet');\n/** @internal */\nexport const subscribeChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:subscribe');\n/** @internal */\nexport const resolveChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:resolve');\n\nconst SUB_CHANNEL_KEYS: ReadonlyArray<\n 'start' | 'end' | 'asyncStart' | 'asyncEnd' | 'error'\n> = ['start', 'end', 'asyncStart', 'asyncEnd', 'error'];\n\n/**\n * Whether emission sites should publish to `channel`. Trusts the\n * `TracingChannel.hasSubscribers` aggregate when the runtime exposes it; if\n * the getter is missing (e.g. Bun's `node:diagnostics_channel`, where\n * `tracingChannel.hasSubscribers` is `undefined`), falls back to checking\n * each of the five underlying lifecycle channels so a subscriber attached\n * via `tracingChannel.subscribe(handlers)` is still observed.\n *\n * @internal\n */\nexport function shouldTrace(\n channel: MinimalTracingChannel | undefined,\n): channel is MinimalTracingChannel {\n if (channel == null) {\n return false;\n }\n const aggregate = channel.hasSubscribers;\n if (aggregate !== undefined) {\n return aggregate;\n }\n // Bun-only fallback, exercised by integrationTests/diagnostics-bun.\n for (const key of SUB_CHANNEL_KEYS) {\n if (channel[key].hasSubscribers) {\n return true;\n }\n }\n return false;\n}\n\ninterface TraceLifecycleContext {\n error?: unknown;\n result?: unknown;\n}\n\ntype TraceStartContext = Omit<\n TContext,\n 'error' | 'result'\n>;\n\n/**\n * Publish a traced call that may complete synchronously or with a promise.\n * Caller has already verified that a subscriber is attached. On normal\n * completion, `result` is attached before the terminal `end` or `asyncEnd`\n * event. When the traced call throws or rejects, `error` is attached, the\n * `error` sub-channel fires, and the terminal `end` or `asyncEnd` event is\n * published before the original failure is propagated.\n *\n * @internal\n */\nexport function traceMixed(\n channel: MinimalTracingChannel,\n contextInput: TraceStartContext,\n fn: () => TResult,\n): TResult {\n const context = contextInput as TContext;\n\n return channel.start.runStores(context, () => {\n let result: TResult;\n try {\n result = fn();\n } catch (err) {\n context.error = err;\n channel.error.publish(context);\n channel.end.publish(context);\n throw err;\n }\n\n if (!isPromiseLike(result)) {\n context.result = result;\n channel.end.publish(context);\n return result;\n }\n\n channel.end.publish(context);\n\n return result.then(\n (value) => {\n context.result = value;\n channel.asyncStart.publish(context);\n channel.asyncEnd.publish(context);\n return value;\n },\n (err: unknown) => {\n context.error = err;\n channel.error.publish(context);\n channel.asyncStart.publish(context);\n channel.asyncEnd.publish(context);\n throw err;\n },\n ) as TResult;\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs new file mode 100644 index 00000000..f1de43a3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs @@ -0,0 +1,71 @@ +import { isPromiseLike } from "./jsutils/isPromise.mjs"; +function resolveDiagnosticsChannel() { + let dc; + try { + const processRef = globalThis.process; + if (typeof processRef?.getBuiltinModule === 'function') { + dc = processRef.getBuiltinModule('node:diagnostics_channel'); + } + } + catch { + } + return dc; +} +const dc = resolveDiagnosticsChannel(); +export const parseChannel = dc?.tracingChannel('graphql:parse'); +export const validateChannel = dc?.tracingChannel('graphql:validate'); +export const executeChannel = dc?.tracingChannel('graphql:execute'); +export const executeVariableCoercionChannel = dc?.tracingChannel('graphql:execute:variableCoercion'); +export const executeRootSelectionSetChannel = dc?.tracingChannel('graphql:execute:rootSelectionSet'); +export const subscribeChannel = dc?.tracingChannel('graphql:subscribe'); +export const resolveChannel = dc?.tracingChannel('graphql:resolve'); +const SUB_CHANNEL_KEYS = ['start', 'end', 'asyncStart', 'asyncEnd', 'error']; +export function shouldTrace(channel) { + if (channel == null) { + return false; + } + const aggregate = channel.hasSubscribers; + if (aggregate !== undefined) { + return aggregate; + } + for (const key of SUB_CHANNEL_KEYS) { + if (channel[key].hasSubscribers) { + return true; + } + } + return false; +} +export function traceMixed(channel, contextInput, fn) { + const context = contextInput; + return channel.start.runStores(context, () => { + let result; + try { + result = fn(); + } + catch (err) { + context.error = err; + channel.error.publish(context); + channel.end.publish(context); + throw err; + } + if (!isPromiseLike(result)) { + context.result = result; + channel.end.publish(context); + return result; + } + channel.end.publish(context); + return result.then((value) => { + context.result = value; + channel.asyncStart.publish(context); + channel.asyncEnd.publish(context); + return value; + }, (err) => { + context.error = err; + channel.error.publish(context); + channel.asyncStart.publish(context); + channel.asyncEnd.publish(context); + throw err; + }); + }); +} +//# sourceMappingURL=diagnostics.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs.map new file mode 100644 index 00000000..4bcbf651 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/diagnostics.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,aAAa,EAAE,gCAA+B;AA2QvD,SAAS,yBAAyB;IAChC,IAAI,EAAwC,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,UAAU,GACd,UAGD,CAAC,OAAO,CAAC;QACV,IAEE,OAAO,UAAU,EAAE,gBAAgB,KAAK,UAAU,EAClD,CAAC;YAED,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAC9B,0BAA0B,CACC,CAAC;QAChC,CAAC;IAEH,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;IACD,OAAO,EAAE,CAAC;AAC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,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * TracingChannel integration.\n *\n * GraphQL.js publishes lifecycle events on a set of named tracing channels\n * that application performance monitoring (APM) tools can subscribe to in\n * order to observe parse, validate, execute, subscribe, and resolver behavior,\n * plus selected executor internals. At module load time GraphQL.js resolves\n * `node:diagnostics_channel` itself so APMs do not need to interact with the\n * GraphQL API to enable tracing. On runtimes that do not expose\n * `node:diagnostics_channel` (e.g., browsers) the load silently no-ops and\n * emission sites short-circuit.\n *\n * Within the tracing context types, `error` means the traced JavaScript call\n * threw or rejected; it does not mean every `GraphQLError` returned by\n * GraphQL.js. Some channels complete normally and publish GraphQL errors on\n * `result`. Resolver errors can appear both as `message.error` on\n * `graphql:resolve` and as formatted errors in an enclosing execution or\n * subscription result. `graphql:parse`, `graphql:validate`, and\n * `graphql:execute:variableCoercion` are sync-only channels.\n * @category Diagnostics\n */\n\nimport { isPromiseLike } from './jsutils/isPromise.ts';\nimport type { Maybe } from './jsutils/Maybe.ts';\nimport type { ObjMap } from './jsutils/ObjMap.ts';\n\nimport type { GraphQLError } from './error/GraphQLError.ts';\n\nimport type {\n DocumentNode,\n OperationDefinitionNode,\n OperationTypeNode,\n} from './language/ast.ts';\nimport type { Source } from './language/source.ts';\n\nimport type { GraphQLSchema } from './type/schema.ts';\n\nimport type { ExecutionResult } from './execution/Executor.ts';\nimport type { ExperimentalIncrementalExecutionResults } from './execution/incremental/IncrementalExecutor.ts';\nimport type { VariableValues } from './execution/values.ts';\n\n/**\n * Structural subset of `DiagnosticsChannel` sufficient for publishing and\n * subscriber gating. The `node:diagnostics_channel` `Channel` satisfies this.\n *\n * @internal\n */\nexport interface MinimalChannel {\n readonly hasSubscribers?: boolean;\n publish: (message: TMessage) => void;\n runStores: (\n context: ContextType,\n fn: (this: ContextType, ...args: Array) => T,\n thisArg?: unknown,\n ...args: Array\n ) => T;\n}\n\n/**\n * Structural subset of the Node.js `TracingChannel` API. The\n * `node:diagnostics_channel` `TracingChannel` satisfies this by duck typing,\n * so GraphQL.js does not need a dependency on `@types/node` or on the runtime\n * itself.\n *\n * @internal\n */\nexport interface MinimalTracingChannel {\n // `undefined` accommodates runtimes (e.g. Bun) that ship `tracingChannel`\n // without exposing the aggregate `hasSubscribers` getter.\n readonly hasSubscribers: boolean | undefined;\n readonly start: MinimalChannel;\n readonly end: MinimalChannel;\n readonly asyncStart: MinimalChannel;\n readonly asyncEnd: MinimalChannel;\n readonly error: MinimalChannel;\n\n traceSync: (\n fn: (...args: Array) => T,\n context: TContext extends object ? TContext : object,\n thisArg?: unknown,\n ...args: Array\n ) => T;\n}\n\ninterface DiagnosticsChannelModule {\n tracingChannel: (\n name: string,\n ) => MinimalTracingChannel;\n}\n\n/** Context published on the sync-only `graphql:parse` channel. */\nexport interface GraphQLParseContext {\n /** Source text or source object passed to the parser. */\n source: string | Source;\n /** Error thrown while parsing, when parsing fails. */\n error?: unknown;\n /** Parsed document, when parsing succeeds. */\n result?: DocumentNode;\n}\n\n/** Context published on the sync-only `graphql:validate` channel. */\nexport interface GraphQLValidateContext {\n /** Schema used for validation. */\n schema: GraphQLSchema;\n /** Parsed document being validated. */\n document: DocumentNode;\n /** Error thrown while validating, when validation fails abruptly. */\n error?: unknown;\n /** Validation errors returned by validation. */\n result?: ReadonlyArray;\n}\n\n/**\n * Context published on `graphql:execute`.\n *\n * Returned results may contain GraphQL errors collected during execution.\n */\nexport interface GraphQLExecuteContext {\n /** Schema used for execution. */\n schema: GraphQLSchema;\n /** Parsed document being executed. */\n document: DocumentNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type, if one is available. */\n operationType: OperationTypeNode | undefined;\n /** Error thrown or rejected while executing, when execution fails abruptly. */\n error?: unknown;\n /** Execution result returned by execution, including GraphQL errors. */\n result?: ExecutionResult | ExperimentalIncrementalExecutionResults;\n}\n\n/**\n * Context published on `graphql:execute:rootSelectionSet`.\n *\n * Returned results may contain GraphQL errors collected during execution.\n */\nexport interface GraphQLExecuteRootSelectionSetContext {\n /** Schema used for execution. */\n schema: GraphQLSchema;\n /** Parsed document being executed. */\n document: DocumentNode;\n /** Operation definition selected for execution. */\n operation: OperationDefinitionNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type. */\n operationType: OperationTypeNode;\n /** Error thrown or rejected while executing the root selection set. */\n error?: unknown;\n /**\n * Execution result returned from the root selection set, including GraphQL\n * errors.\n */\n result?: ExecutionResult | ExperimentalIncrementalExecutionResults;\n}\n\n/**\n * Context published on `graphql:execute:variableCoercion`.\n *\n * Coercion runs synchronously while execution arguments are validated, so only\n * the `start`/`end` (and, on an abrupt throw, `error`) lifecycle fires.\n * Ordinary variable coercion failures are returned on `result.errors`; when\n * execution is invoked through APIs such as `execute()` or `subscribe()`, they\n * surface as GraphQL result errors rather than as the tracing `error`\n * lifecycle event.\n */\nexport interface GraphQLExecuteVariableCoercionContext {\n /** Schema used for variable coercion. */\n schema: GraphQLSchema;\n /** Parsed document being executed. */\n document: DocumentNode;\n /** Operation definition whose variables are being coerced. */\n operation: OperationDefinitionNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type. */\n operationType: OperationTypeNode;\n /** Error thrown while coercing variables, when coercion fails abruptly. */\n error?: unknown;\n /** Coerced variable values or coercion errors returned by coercion. */\n result?:\n | { variableValues: VariableValues }\n | { errors: ReadonlyArray };\n}\n\n/**\n * Context published on `graphql:subscribe`.\n *\n * Subscription source resolver errors and invalid source stream results are\n * returned on `result` as ExecutionResult errors; they do not publish the\n * `error` lifecycle event unless subscription setup fails abruptly before\n * GraphQL can form a result.\n */\nexport interface GraphQLSubscribeContext {\n /** Schema used for subscription execution. */\n schema: GraphQLSchema;\n /** Parsed subscription document. */\n document: DocumentNode;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Selected operation name, if one is available. */\n operationName: string | undefined;\n /** Selected operation type, if one is available. */\n operationType: OperationTypeNode | undefined;\n /** Error thrown or rejected while subscribing, when setup fails abruptly. */\n error?: unknown;\n /**\n * Subscription response stream, or an ExecutionResult containing GraphQL\n * errors.\n */\n result?: AsyncGenerator | ExecutionResult;\n}\n\n/**\n * Context published on `graphql:resolve`.\n *\n * Resolver throws and rejections publish the `error` lifecycle event here.\n * The same failure may also be formatted into the enclosing execution or\n * subscription result.\n */\nexport interface GraphQLResolveContext {\n /** Field name being resolved. */\n fieldName: string;\n /** Response alias for the field being resolved. */\n alias: string;\n /** Parent type name for the field being resolved. */\n parentType: string;\n /** Return type string for the field being resolved. */\n fieldType: string;\n /** Argument values passed to the resolver. */\n args: ObjMap;\n /** Whether the field is using the default resolver. */\n isDefaultResolver: boolean;\n /** Response path for the field being resolved. */\n fieldPath: string;\n /** Error thrown or rejected by the resolver, when resolution fails. */\n error?: unknown;\n /** Value returned by the resolver, when resolution succeeds. */\n result?: unknown;\n}\n\n/** Mapping from tracing channel name to the context type published on it. */\nexport interface GraphQLChannelContextByName {\n /** Context published on `graphql:parse`. */\n 'graphql:parse': GraphQLParseContext;\n /** Context published on `graphql:validate`. */\n 'graphql:validate': GraphQLValidateContext;\n /** Context published on `graphql:execute`. */\n 'graphql:execute': GraphQLExecuteContext;\n /** Context published on `graphql:execute:variableCoercion`. */\n 'graphql:execute:variableCoercion': GraphQLExecuteVariableCoercionContext;\n /** Context published on `graphql:execute:rootSelectionSet`. */\n 'graphql:execute:rootSelectionSet': GraphQLExecuteRootSelectionSetContext;\n /** Context published on `graphql:subscribe`. */\n 'graphql:subscribe': GraphQLSubscribeContext;\n /** Context published on `graphql:resolve`. */\n 'graphql:resolve': GraphQLResolveContext;\n}\n\n/**\n * The collection of tracing channels GraphQL.js emits on. Application\n * performance monitoring (APM) tools subscribe to these by name on their own\n * `node:diagnostics_channel` import; both paths land on the same channel\n * instance because `tracingChannel(name)` is cached by name.\n */\nexport interface GraphQLChannels {\n /** Tracing channel for `graphql:execute`. */\n execute: MinimalTracingChannel;\n /** Tracing channel for `graphql:execute:variableCoercion`. */\n executeVariableCoercion: MinimalTracingChannel;\n /** Tracing channel for `graphql:execute:rootSelectionSet`. */\n executeRootSelectionSet: MinimalTracingChannel;\n /** Tracing channel for `graphql:parse`. */\n parse: MinimalTracingChannel;\n /** Tracing channel for `graphql:validate`. */\n validate: MinimalTracingChannel;\n /** Tracing channel for `graphql:resolve`. */\n resolve: MinimalTracingChannel;\n /** Tracing channel for `graphql:subscribe`. */\n subscribe: MinimalTracingChannel;\n}\n\nfunction resolveDiagnosticsChannel(): DiagnosticsChannelModule | undefined {\n let dc: DiagnosticsChannelModule | undefined;\n try {\n const processRef = (\n globalThis as {\n process?: { getBuiltinModule?: (id: string) => unknown };\n }\n ).process;\n if (\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n typeof processRef?.getBuiltinModule === 'function'\n ) {\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n dc = processRef.getBuiltinModule(\n 'node:diagnostics_channel',\n ) as DiagnosticsChannelModule;\n }\n /* node:coverage ignore next 3 */\n } catch {\n // diagnostics_channel not available on this runtime; tracing is a no-op.\n }\n return dc;\n}\n\nconst dc = resolveDiagnosticsChannel();\n\n/**\n * Per-channel handles, resolved once at module load. `undefined` when\n * `node:diagnostics_channel` isn't available. Emission sites read these\n * directly to keep the no-subscriber fast path to a single property access\n * plus a `hasSubscribers` check (no function calls, no closures).\n *\n * @internal\n */\nexport const parseChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:parse');\n/** @internal */\nexport const validateChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:validate');\n/** @internal */\nexport const executeChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:execute');\n/** @internal */\nexport const executeVariableCoercionChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:execute:variableCoercion');\n/** @internal */\nexport const executeRootSelectionSetChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:execute:rootSelectionSet');\n/** @internal */\nexport const subscribeChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:subscribe');\n/** @internal */\nexport const resolveChannel:\n | MinimalTracingChannel\n | undefined = dc?.tracingChannel('graphql:resolve');\n\nconst SUB_CHANNEL_KEYS: ReadonlyArray<\n 'start' | 'end' | 'asyncStart' | 'asyncEnd' | 'error'\n> = ['start', 'end', 'asyncStart', 'asyncEnd', 'error'];\n\n/**\n * Whether emission sites should publish to `channel`. Trusts the\n * `TracingChannel.hasSubscribers` aggregate when the runtime exposes it; if\n * the getter is missing (e.g. Bun's `node:diagnostics_channel`, where\n * `tracingChannel.hasSubscribers` is `undefined`), falls back to checking\n * each of the five underlying lifecycle channels so a subscriber attached\n * via `tracingChannel.subscribe(handlers)` is still observed.\n *\n * @internal\n */\nexport function shouldTrace(\n channel: MinimalTracingChannel | undefined,\n): channel is MinimalTracingChannel {\n if (channel == null) {\n return false;\n }\n const aggregate = channel.hasSubscribers;\n if (aggregate !== undefined) {\n return aggregate;\n }\n // Bun-only fallback, exercised by integrationTests/diagnostics-bun.\n for (const key of SUB_CHANNEL_KEYS) {\n if (channel[key].hasSubscribers) {\n return true;\n }\n }\n return false;\n}\n\ninterface TraceLifecycleContext {\n error?: unknown;\n result?: unknown;\n}\n\ntype TraceStartContext = Omit<\n TContext,\n 'error' | 'result'\n>;\n\n/**\n * Publish a traced call that may complete synchronously or with a promise.\n * Caller has already verified that a subscriber is attached. On normal\n * completion, `result` is attached before the terminal `end` or `asyncEnd`\n * event. When the traced call throws or rejects, `error` is attached, the\n * `error` sub-channel fires, and the terminal `end` or `asyncEnd` event is\n * published before the original failure is propagated.\n *\n * @internal\n */\nexport function traceMixed(\n channel: MinimalTracingChannel,\n contextInput: TraceStartContext,\n fn: () => TResult,\n): TResult {\n const context = contextInput as TContext;\n\n return channel.start.runStores(context, () => {\n let result: TResult;\n try {\n result = fn();\n } catch (err) {\n context.error = err;\n channel.error.publish(context);\n channel.end.publish(context);\n throw err;\n }\n\n if (!isPromiseLike(result)) {\n context.result = result;\n channel.end.publish(context);\n return result;\n }\n\n channel.end.publish(context);\n\n return result.then(\n (value) => {\n context.result = value;\n channel.asyncStart.publish(context);\n channel.asyncEnd.publish(context);\n return value;\n },\n (err: unknown) => {\n context.error = err;\n channel.error.publish(context);\n channel.asyncStart.publish(context);\n channel.asyncEnd.publish(context);\n throw err;\n },\n ) as TResult;\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.mts new file mode 100644 index 00000000..78c8c81c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.mts @@ -0,0 +1,206 @@ +/** @category Errors */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ASTNode } from "../language/ast.mjs"; +import type { SourceLocation } from "../language/location.mjs"; +import type { Source } from "../language/source.mjs"; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLErrorExtensions { + [attributeName: string]: unknown; +} +/** + * Custom formatted extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLFormattedErrorExtensions { + [attributeName: string]: unknown; +} +/** Options used to construct a GraphQLError. */ +export interface GraphQLErrorOptions { + /** AST node or nodes associated with this error. */ + nodes?: ReadonlyArray | ASTNode | null | undefined; + /** Source document used to derive error locations. */ + source?: Maybe; + /** Character offsets in the source document associated with this error. */ + positions?: Maybe>; + /** Response path where this error occurred during execution. */ + path?: Maybe>; + /** + * Original error that caused this GraphQLError, if one exists. + * Deprecated in favor of `cause` to better align with JavaScript standards. + * @deprecated Prefer `cause` instead. + */ + originalError?: Maybe; + /** Cause of this GraphQLError, if one exists. */ + cause?: unknown; + /** Extension fields to include in the formatted result. */ + extensions?: Maybe; +} +/** + * A GraphQLError describes an Error found during the parse, validate, or + * execute phases of performing a GraphQL operation. In addition to a message + * and stack trace, it also includes information about the locations in a + * GraphQL document and/or execution result that correspond to the Error. + */ +export declare class GraphQLError extends Error { + /** + * An array of `{ line, column }` locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly locations: ReadonlyArray | undefined; + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly path: ReadonlyArray | undefined; + /** An array of GraphQL AST Nodes corresponding to this error. */ + readonly nodes: ReadonlyArray | undefined; + /** + * The source GraphQL document for the first location of this error. + * + * Note that if this Error represents more than one node, the source may not + * represent nodes after the first node. + */ + readonly source: Source | undefined; + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + readonly positions: ReadonlyArray | undefined; + /** + * Original error that caused this GraphQLError, if one exists. + * Deprecated in favor of `cause` to better align with JavaScript standards. + * @deprecated Use `cause` instead. + */ + readonly originalError: Error | undefined; + /** Extension fields to add to the formatted error. */ + readonly extensions: GraphQLErrorExtensions; + /** + * Creates a GraphQLError instance. + * @param message - Human-readable error message. + * @param options - Error metadata such as source locations, response path, cause, original error, and extensions. + * @example + * ```ts + * // Create an error from AST nodes and response metadata. + * import { parse } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * + * const document = parse('{ greeting }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const error = new GraphQLError('Cannot query this field.', { + * nodes: fieldNode, + * path: ['greeting'], + * extensions: { code: 'FORBIDDEN' }, + * }); + * + * error.message; // => 'Cannot query this field.' + * error.locations; // => [{ line: 1, column: 3 }] + * error.path; // => ['greeting'] + * error.extensions; // => { code: 'FORBIDDEN' } + * ``` + * @example + * ```ts + * // This variant derives locations from source positions and preserves the cause. + * import { Source } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * + * const source = new Source('{ greeting }'); + * const cause = new Error('Database unavailable.'); + * const error = new GraphQLError('Resolver failed.', { + * source, + * positions: [2], + * path: ['greeting'], + * cause, + * }); + * + * error.locations; // => [{ line: 1, column: 3 }] + * error.path; // => ['greeting'] + * error.cause; // => cause + * ``` + */ + constructor(message: string, options?: GraphQLErrorOptions); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns this error as a human-readable message with source locations. + * @returns The formatted error string. + * @example + * ```ts + * import { Source } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * + * const error = new GraphQLError('Cannot query field "name".', { + * source: new Source('{ name }'), + * positions: [2], + * }); + * + * error.toString(); // => 'Cannot query field "name".\n\nGraphQL request:1:3\n1 | { name }\n | ^' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLError } from 'graphql/error'; + * + * const error = new GraphQLError('Resolver failed.', { + * path: ['viewer', 'name'], + * extensions: { code: 'INTERNAL' }, + * }); + * + * error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } } + * ``` + */ + toJSON(): GraphQLFormattedError; +} +/** See: https://spec.graphql.org/draft/#sec-Errors */ +export interface GraphQLFormattedError { + /** + * A short, human-readable summary of the problem that **SHOULD NOT** change + * from occurrence to occurrence of the problem, except for purposes of + * localization. + */ + readonly message: string; + /** + * If an error can be associated to a particular point in the requested + * GraphQL document, it should contain a list of locations. + */ + readonly locations?: ReadonlyArray; + /** + * If an error can be associated to a particular field in the GraphQL result, + * it _must_ contain an entry with the key `path` that details the path of + * the response field which experienced the error. This allows clients to + * identify whether a null result is intentional or caused by a runtime error. + */ + readonly path?: ReadonlyArray; + /** + * Reserved for implementors to extend the protocol however they see fit, + * and hence there are no additional restrictions on its contents. + */ + readonly extensions?: GraphQLFormattedErrorExtensions; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.ts new file mode 100644 index 00000000..4b8b74d2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.d.ts @@ -0,0 +1,206 @@ +/** @category Errors */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ASTNode } from "../language/ast.js"; +import type { SourceLocation } from "../language/location.js"; +import type { Source } from "../language/source.js"; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLErrorExtensions { + [attributeName: string]: unknown; +} +/** + * Custom formatted extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLFormattedErrorExtensions { + [attributeName: string]: unknown; +} +/** Options used to construct a GraphQLError. */ +export interface GraphQLErrorOptions { + /** AST node or nodes associated with this error. */ + nodes?: ReadonlyArray | ASTNode | null | undefined; + /** Source document used to derive error locations. */ + source?: Maybe; + /** Character offsets in the source document associated with this error. */ + positions?: Maybe>; + /** Response path where this error occurred during execution. */ + path?: Maybe>; + /** + * Original error that caused this GraphQLError, if one exists. + * Deprecated in favor of `cause` to better align with JavaScript standards. + * @deprecated Prefer `cause` instead. + */ + originalError?: Maybe; + /** Cause of this GraphQLError, if one exists. */ + cause?: unknown; + /** Extension fields to include in the formatted result. */ + extensions?: Maybe; +} +/** + * A GraphQLError describes an Error found during the parse, validate, or + * execute phases of performing a GraphQL operation. In addition to a message + * and stack trace, it also includes information about the locations in a + * GraphQL document and/or execution result that correspond to the Error. + */ +export declare class GraphQLError extends Error { + /** + * An array of `{ line, column }` locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly locations: ReadonlyArray | undefined; + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + readonly path: ReadonlyArray | undefined; + /** An array of GraphQL AST Nodes corresponding to this error. */ + readonly nodes: ReadonlyArray | undefined; + /** + * The source GraphQL document for the first location of this error. + * + * Note that if this Error represents more than one node, the source may not + * represent nodes after the first node. + */ + readonly source: Source | undefined; + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + readonly positions: ReadonlyArray | undefined; + /** + * Original error that caused this GraphQLError, if one exists. + * Deprecated in favor of `cause` to better align with JavaScript standards. + * @deprecated Use `cause` instead. + */ + readonly originalError: Error | undefined; + /** Extension fields to add to the formatted error. */ + readonly extensions: GraphQLErrorExtensions; + /** + * Creates a GraphQLError instance. + * @param message - Human-readable error message. + * @param options - Error metadata such as source locations, response path, cause, original error, and extensions. + * @example + * ```ts + * // Create an error from AST nodes and response metadata. + * import { parse } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * + * const document = parse('{ greeting }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const error = new GraphQLError('Cannot query this field.', { + * nodes: fieldNode, + * path: ['greeting'], + * extensions: { code: 'FORBIDDEN' }, + * }); + * + * error.message; // => 'Cannot query this field.' + * error.locations; // => [{ line: 1, column: 3 }] + * error.path; // => ['greeting'] + * error.extensions; // => { code: 'FORBIDDEN' } + * ``` + * @example + * ```ts + * // This variant derives locations from source positions and preserves the cause. + * import { Source } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * + * const source = new Source('{ greeting }'); + * const cause = new Error('Database unavailable.'); + * const error = new GraphQLError('Resolver failed.', { + * source, + * positions: [2], + * path: ['greeting'], + * cause, + * }); + * + * error.locations; // => [{ line: 1, column: 3 }] + * error.path; // => ['greeting'] + * error.cause; // => cause + * ``` + */ + constructor(message: string, options?: GraphQLErrorOptions); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns this error as a human-readable message with source locations. + * @returns The formatted error string. + * @example + * ```ts + * import { Source } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * + * const error = new GraphQLError('Cannot query field "name".', { + * source: new Source('{ name }'), + * positions: [2], + * }); + * + * error.toString(); // => 'Cannot query field "name".\n\nGraphQL request:1:3\n1 | { name }\n | ^' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLError } from 'graphql/error'; + * + * const error = new GraphQLError('Resolver failed.', { + * path: ['viewer', 'name'], + * extensions: { code: 'INTERNAL' }, + * }); + * + * error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } } + * ``` + */ + toJSON(): GraphQLFormattedError; +} +/** See: https://spec.graphql.org/draft/#sec-Errors */ +export interface GraphQLFormattedError { + /** + * A short, human-readable summary of the problem that **SHOULD NOT** change + * from occurrence to occurrence of the problem, except for purposes of + * localization. + */ + readonly message: string; + /** + * If an error can be associated to a particular point in the requested + * GraphQL document, it should contain a list of locations. + */ + readonly locations?: ReadonlyArray; + /** + * If an error can be associated to a particular field in the GraphQL result, + * it _must_ contain an entry with the key `path` that details the path of + * the response field which experienced the error. This allows clients to + * identify whether a null result is intentional or caused by a runtime error. + */ + readonly path?: ReadonlyArray; + /** + * Reserved for implementors to extend the protocol however they see fit, + * and hence there are no additional restrictions on its contents. + */ + readonly extensions?: GraphQLFormattedErrorExtensions; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js new file mode 100644 index 00000000..80fc3158 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GraphQLError = void 0; +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const location_ts_1 = require("../language/location.js"); +const printLocation_ts_1 = require("../language/printLocation.js"); +class GraphQLError extends Error { + constructor(message, options = {}) { + const { nodes, source, positions, path, originalError, cause, extensions } = options; + const hasCause = 'cause' in options; + const errorCause = hasCause ? cause : originalError; + const errorOptions = hasCause || originalError != null ? { cause: errorCause } : undefined; + super(message, errorOptions); + this.name = 'GraphQLError'; + this.path = path ?? undefined; + const underlyingError = originalError ?? (cause instanceof Error ? cause : undefined); + this.originalError = underlyingError; + this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined); + const nodeLocations = undefinedIfEmpty(this.nodes + ?.map((node) => node.loc) + .filter((loc) => loc != null)); + this.source = source ?? nodeLocations?.[0]?.source; + this.positions = positions ?? nodeLocations?.map((loc) => loc.start); + this.locations = + positions && source + ? positions.map((pos) => (0, location_ts_1.getLocation)(source, pos)) + : nodeLocations?.map((loc) => (0, location_ts_1.getLocation)(loc.source, loc.start)); + const originalExtensions = (0, isObjectLike_ts_1.isObjectLike)(underlyingError?.extensions) + ? underlyingError.extensions + : undefined; + this.extensions = extensions ?? originalExtensions ?? Object.create(null); + Object.defineProperties(this, { + message: { + writable: true, + enumerable: true, + }, + name: { enumerable: false }, + nodes: { enumerable: false }, + source: { enumerable: false }, + positions: { enumerable: false }, + originalError: { enumerable: false }, + }); + if (originalError?.stack != null) { + Object.defineProperty(this, 'stack', { + value: originalError.stack, + writable: true, + configurable: true, + }); + } + else if (Error.captureStackTrace != null) { + Error.captureStackTrace(this, GraphQLError); + } + else { + Object.defineProperty(this, 'stack', { + value: Error().stack, + writable: true, + configurable: true, + }); + } + } + get [Symbol.toStringTag]() { + return 'GraphQLError'; + } + toString() { + let output = this.message; + if (this.nodes) { + for (const node of this.nodes) { + if (node.loc) { + output += '\n\n' + (0, printLocation_ts_1.printLocation)(node.loc); + } + } + } + else if (this.source && this.locations) { + for (const location of this.locations) { + output += '\n\n' + (0, printLocation_ts_1.printSourceLocation)(this.source, location); + } + } + return output; + } + toJSON() { + const formattedError = { + message: this.message, + }; + if (this.locations != null) { + formattedError.locations = this.locations; + } + if (this.path != null) { + formattedError.path = this.path; + } + if (this.extensions != null && Object.keys(this.extensions).length > 0) { + formattedError.extensions = this.extensions; + } + return formattedError; + } +} +exports.GraphQLError = GraphQLError; +function undefinedIfEmpty(array) { + return array === undefined || array.length === 0 ? undefined : array; +} +//# sourceMappingURL=GraphQLError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js.map new file mode 100644 index 00000000..b616e584 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GraphQLError.js","sourceRoot":"","sources":["../../src/error/GraphQLError.ts"],"names":[],"mappings":";;;AAEA,gEAA0D;AAK1D,yDAAsD;AACtD,mEAGsC;AAuDtC,MAAa,YAAa,SAAQ,KAAK;IA2FrC,YAAY,OAAe,EAAE,UAA+B,EAAE;QAC5D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI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C,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvE,cAAc,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAC9C,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AA3PD,oCA2PC;AAED,SAAS,gBAAgB,CACvB,KAA2B;IAE3B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AACvE,CAAC","sourcesContent":["/** @category Errors */\n\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { ASTNode, Location } from '../language/ast.ts';\nimport type { SourceLocation } from '../language/location.ts';\nimport { getLocation } from '../language/location.ts';\nimport {\n printLocation,\n printSourceLocation,\n} from '../language/printLocation.ts';\nimport type { Source } from '../language/source.ts';\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLErrorExtensions {\n [attributeName: string]: unknown;\n}\n\n/**\n * Custom formatted extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLFormattedErrorExtensions {\n [attributeName: string]: unknown;\n}\n\n/** Options used to construct a GraphQLError. */\nexport interface GraphQLErrorOptions {\n /** AST node or nodes associated with this error. */\n nodes?: ReadonlyArray | ASTNode | null | undefined;\n /** Source document used to derive error locations. */\n source?: Maybe;\n /** Character offsets in the source document associated with this error. */\n positions?: Maybe>;\n /** Response path where this error occurred during execution. */\n path?: Maybe>;\n /**\n * Original error that caused this GraphQLError, if one exists.\n * Deprecated in favor of `cause` to better align with JavaScript standards.\n * @deprecated Prefer `cause` instead.\n */\n originalError?: Maybe;\n /** Cause of this GraphQLError, if one exists. */\n cause?: unknown;\n /** Extension fields to include in the formatted result. */\n extensions?: Maybe;\n}\n\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\nexport class GraphQLError extends Error {\n /**\n * An array of `{ line, column }` locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n readonly locations: ReadonlyArray | undefined;\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n readonly path: ReadonlyArray | undefined;\n\n /** An array of GraphQL AST Nodes corresponding to this error. */\n readonly nodes: ReadonlyArray | undefined;\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n readonly source: Source | undefined;\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n readonly positions: ReadonlyArray | undefined;\n\n /**\n * Original error that caused this GraphQLError, if one exists.\n * Deprecated in favor of `cause` to better align with JavaScript standards.\n * @deprecated Use `cause` instead.\n */\n readonly originalError: Error | undefined;\n\n /** Extension fields to add to the formatted error. */\n readonly extensions: GraphQLErrorExtensions;\n\n /**\n * Creates a GraphQLError instance.\n * @param message - Human-readable error message.\n * @param options - Error metadata such as source locations, response path, cause, original error, and extensions.\n * @example\n * ```ts\n * // Create an error from AST nodes and response metadata.\n * import { parse } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n *\n * const document = parse('{ greeting }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const error = new GraphQLError('Cannot query this field.', {\n * nodes: fieldNode,\n * path: ['greeting'],\n * extensions: { code: 'FORBIDDEN' },\n * });\n *\n * error.message; // => 'Cannot query this field.'\n * error.locations; // => [{ line: 1, column: 3 }]\n * error.path; // => ['greeting']\n * error.extensions; // => { code: 'FORBIDDEN' }\n * ```\n * @example\n * ```ts\n * // This variant derives locations from source positions and preserves the cause.\n * import { Source } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n *\n * const source = new Source('{ greeting }');\n * const cause = new Error('Database unavailable.');\n * const error = new GraphQLError('Resolver failed.', {\n * source,\n * positions: [2],\n * path: ['greeting'],\n * cause,\n * });\n *\n * error.locations; // => [{ line: 1, column: 3 }]\n * error.path; // => ['greeting']\n * error.cause; // => cause\n * ```\n */\n constructor(message: string, options: GraphQLErrorOptions = {}) {\n const { nodes, source, positions, path, originalError, cause, extensions } =\n options;\n\n const hasCause = 'cause' in options;\n const errorCause = hasCause ? cause : originalError;\n const errorOptions =\n hasCause || originalError != null ? { cause: errorCause } : undefined;\n super(message, errorOptions);\n\n this.name = 'GraphQLError';\n this.path = path ?? undefined;\n const underlyingError: typeof originalError =\n originalError ?? (cause instanceof Error ? cause : undefined);\n this.originalError = underlyingError;\n\n // Compute list of blame nodes.\n this.nodes = undefinedIfEmpty(\n Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,\n );\n\n const nodeLocations = undefinedIfEmpty(\n this.nodes\n ?.map((node) => node.loc)\n .filter((loc): loc is Location => loc != null),\n );\n\n // Compute locations in the source for the given nodes/positions.\n this.source = source ?? nodeLocations?.[0]?.source;\n\n this.positions = positions ?? nodeLocations?.map((loc) => loc.start);\n\n this.locations =\n positions && source\n ? positions.map((pos) => getLocation(source, pos))\n : nodeLocations?.map((loc) => getLocation(loc.source, loc.start));\n\n const originalExtensions = isObjectLike(underlyingError?.extensions)\n ? underlyingError.extensions\n : undefined;\n this.extensions = extensions ?? originalExtensions ?? Object.create(null);\n\n // Only properties prescribed by the spec should be enumerable.\n // Keep the rest as non-enumerable.\n Object.defineProperties(this, {\n message: {\n writable: true,\n enumerable: true,\n },\n name: { enumerable: false },\n nodes: { enumerable: false },\n source: { enumerable: false },\n positions: { enumerable: false },\n originalError: { enumerable: false },\n });\n\n // Include (non-enumerable) stack trace.\n // Do not copy over the stack trace of the Error.cause, since the tooling\n // already nicely prints/reports the cause chains.\n // Preserve the copy-over behavior of the `originalError`, since users may\n // expect it to work the way it did originally.\n if (originalError?.stack != null) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true,\n });\n } else if (Error.captureStackTrace != null) {\n Error.captureStackTrace(this, GraphQLError);\n // See: https://github.com/graphql/graphql-js/issues/2317\n /* node:coverage ignore next 7 */\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true,\n });\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLError';\n }\n\n /**\n * Returns this error as a human-readable message with source locations.\n * @returns The formatted error string.\n * @example\n * ```ts\n * import { Source } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n *\n * const error = new GraphQLError('Cannot query field \"name\".', {\n * source: new Source('{ name }'),\n * positions: [2],\n * });\n *\n * error.toString(); // => 'Cannot query field \"name\".\\n\\nGraphQL request:1:3\\n1 | { name }\\n | ^'\n * ```\n */\n override toString(): string {\n let output = this.message;\n\n if (this.nodes) {\n for (const node of this.nodes) {\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (this.source && this.locations) {\n for (const location of this.locations) {\n output += '\\n\\n' + printSourceLocation(this.source, location);\n }\n }\n\n return output;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLError } from 'graphql/error';\n *\n * const error = new GraphQLError('Resolver failed.', {\n * path: ['viewer', 'name'],\n * extensions: { code: 'INTERNAL' },\n * });\n *\n * error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } }\n * ```\n */\n toJSON(): GraphQLFormattedError {\n type WritableFormattedError = {\n -readonly [P in keyof GraphQLFormattedError]: GraphQLFormattedError[P];\n };\n\n const formattedError: WritableFormattedError = {\n message: this.message,\n };\n\n if (this.locations != null) {\n formattedError.locations = this.locations;\n }\n\n if (this.path != null) {\n formattedError.path = this.path;\n }\n\n if (this.extensions != null && Object.keys(this.extensions).length > 0) {\n formattedError.extensions = this.extensions;\n }\n\n return formattedError;\n }\n}\n\nfunction undefinedIfEmpty(\n array: Array | undefined,\n): Array | undefined {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n\n/** See: https://spec.graphql.org/draft/#sec-Errors */\nexport interface GraphQLFormattedError {\n /**\n * A short, human-readable summary of the problem that **SHOULD NOT** change\n * from occurrence to occurrence of the problem, except for purposes of\n * localization.\n */\n readonly message: string;\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n readonly locations?: ReadonlyArray;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n readonly path?: ReadonlyArray;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n readonly extensions?: GraphQLFormattedErrorExtensions;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs new file mode 100644 index 00000000..de30cfbe --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs @@ -0,0 +1,96 @@ +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { getLocation } from "../language/location.mjs"; +import { printLocation, printSourceLocation, } from "../language/printLocation.mjs"; +export class GraphQLError extends Error { + constructor(message, options = {}) { + const { nodes, source, positions, path, originalError, cause, extensions } = options; + const hasCause = 'cause' in options; + const errorCause = hasCause ? cause : originalError; + const errorOptions = hasCause || originalError != null ? { cause: errorCause } : undefined; + super(message, errorOptions); + this.name = 'GraphQLError'; + this.path = path ?? undefined; + const underlyingError = originalError ?? (cause instanceof Error ? cause : undefined); + this.originalError = underlyingError; + this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined); + const nodeLocations = undefinedIfEmpty(this.nodes + ?.map((node) => node.loc) + .filter((loc) => loc != null)); + this.source = source ?? nodeLocations?.[0]?.source; + this.positions = positions ?? nodeLocations?.map((loc) => loc.start); + this.locations = + positions && source + ? positions.map((pos) => getLocation(source, pos)) + : nodeLocations?.map((loc) => getLocation(loc.source, loc.start)); + const originalExtensions = isObjectLike(underlyingError?.extensions) + ? underlyingError.extensions + : undefined; + this.extensions = extensions ?? originalExtensions ?? Object.create(null); + Object.defineProperties(this, { + message: { + writable: true, + enumerable: true, + }, + name: { enumerable: false }, + nodes: { enumerable: false }, + source: { enumerable: false }, + positions: { enumerable: false }, + originalError: { enumerable: false }, + }); + if (originalError?.stack != null) { + Object.defineProperty(this, 'stack', { + value: originalError.stack, + writable: true, + configurable: true, + }); + } + else if (Error.captureStackTrace != null) { + Error.captureStackTrace(this, GraphQLError); + } + else { + Object.defineProperty(this, 'stack', { + value: Error().stack, + writable: true, + configurable: true, + }); + } + } + get [Symbol.toStringTag]() { + return 'GraphQLError'; + } + toString() { + let output = this.message; + if (this.nodes) { + for (const node of this.nodes) { + if (node.loc) { + output += '\n\n' + printLocation(node.loc); + } + } + } + else if (this.source && this.locations) { + for (const location of this.locations) { + output += '\n\n' + printSourceLocation(this.source, location); + } + } + return output; + } + toJSON() { + const formattedError = { + message: this.message, + }; + if (this.locations != null) { + formattedError.locations = this.locations; + } + if (this.path != null) { + formattedError.path = this.path; + } + if (this.extensions != null && Object.keys(this.extensions).length > 0) { + formattedError.extensions = this.extensions; + } + return formattedError; + } +} +function undefinedIfEmpty(array) { + return array === undefined || array.length === 0 ? undefined : array; +} +//# sourceMappingURL=GraphQLError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs.map new file mode 100644 index 00000000..c7314f0a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/GraphQLError.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GraphQLError.js","sourceRoot":"","sources":["../../src/error/GraphQLError.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAK1D,OAAO,EAAE,WAAW,EAAE,iCAAgC;AACtD,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,sCAAqC;AAuDtC,MAAM,OAAO,YAAa,SAAQ,KAAK;IA2FrC,YAAY,OAAe,EAAE,UAA+B,EAAE;QAC5D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,GACxE,OAAO,CAAC;QAEV,MAAM,QAAQ,GAAG,OAAO,IAAI,OAAO,CAAC;QACpC,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC;QACpD,MAAM,YAAY,GAChB,QAAQ,IAAI,aAAa,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACxE,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAE7B,IAAI,CAAC,I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AC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AACvE,CAAC","sourcesContent":["/** @category Errors */\n\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { ASTNode, Location } from '../language/ast.ts';\nimport type { SourceLocation } from '../language/location.ts';\nimport { getLocation } from '../language/location.ts';\nimport {\n printLocation,\n printSourceLocation,\n} from '../language/printLocation.ts';\nimport type { Source } from '../language/source.ts';\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLErrorExtensions {\n [attributeName: string]: unknown;\n}\n\n/**\n * Custom formatted extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLFormattedErrorExtensions {\n [attributeName: string]: unknown;\n}\n\n/** Options used to construct a GraphQLError. */\nexport interface GraphQLErrorOptions {\n /** AST node or nodes associated with this error. */\n nodes?: ReadonlyArray | ASTNode | null | undefined;\n /** Source document used to derive error locations. */\n source?: Maybe;\n /** Character offsets in the source document associated with this error. */\n positions?: Maybe>;\n /** Response path where this error occurred during execution. */\n path?: Maybe>;\n /**\n * Original error that caused this GraphQLError, if one exists.\n * Deprecated in favor of `cause` to better align with JavaScript standards.\n * @deprecated Prefer `cause` instead.\n */\n originalError?: Maybe;\n /** Cause of this GraphQLError, if one exists. */\n cause?: unknown;\n /** Extension fields to include in the formatted result. */\n extensions?: Maybe;\n}\n\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\nexport class GraphQLError extends Error {\n /**\n * An array of `{ line, column }` locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n readonly locations: ReadonlyArray | undefined;\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n readonly path: ReadonlyArray | undefined;\n\n /** An array of GraphQL AST Nodes corresponding to this error. */\n readonly nodes: ReadonlyArray | undefined;\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n readonly source: Source | undefined;\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n readonly positions: ReadonlyArray | undefined;\n\n /**\n * Original error that caused this GraphQLError, if one exists.\n * Deprecated in favor of `cause` to better align with JavaScript standards.\n * @deprecated Use `cause` instead.\n */\n readonly originalError: Error | undefined;\n\n /** Extension fields to add to the formatted error. */\n readonly extensions: GraphQLErrorExtensions;\n\n /**\n * Creates a GraphQLError instance.\n * @param message - Human-readable error message.\n * @param options - Error metadata such as source locations, response path, cause, original error, and extensions.\n * @example\n * ```ts\n * // Create an error from AST nodes and response metadata.\n * import { parse } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n *\n * const document = parse('{ greeting }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const error = new GraphQLError('Cannot query this field.', {\n * nodes: fieldNode,\n * path: ['greeting'],\n * extensions: { code: 'FORBIDDEN' },\n * });\n *\n * error.message; // => 'Cannot query this field.'\n * error.locations; // => [{ line: 1, column: 3 }]\n * error.path; // => ['greeting']\n * error.extensions; // => { code: 'FORBIDDEN' }\n * ```\n * @example\n * ```ts\n * // This variant derives locations from source positions and preserves the cause.\n * import { Source } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n *\n * const source = new Source('{ greeting }');\n * const cause = new Error('Database unavailable.');\n * const error = new GraphQLError('Resolver failed.', {\n * source,\n * positions: [2],\n * path: ['greeting'],\n * cause,\n * });\n *\n * error.locations; // => [{ line: 1, column: 3 }]\n * error.path; // => ['greeting']\n * error.cause; // => cause\n * ```\n */\n constructor(message: string, options: GraphQLErrorOptions = {}) {\n const { nodes, source, positions, path, originalError, cause, extensions } =\n options;\n\n const hasCause = 'cause' in options;\n const errorCause = hasCause ? cause : originalError;\n const errorOptions =\n hasCause || originalError != null ? { cause: errorCause } : undefined;\n super(message, errorOptions);\n\n this.name = 'GraphQLError';\n this.path = path ?? undefined;\n const underlyingError: typeof originalError =\n originalError ?? (cause instanceof Error ? cause : undefined);\n this.originalError = underlyingError;\n\n // Compute list of blame nodes.\n this.nodes = undefinedIfEmpty(\n Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,\n );\n\n const nodeLocations = undefinedIfEmpty(\n this.nodes\n ?.map((node) => node.loc)\n .filter((loc): loc is Location => loc != null),\n );\n\n // Compute locations in the source for the given nodes/positions.\n this.source = source ?? nodeLocations?.[0]?.source;\n\n this.positions = positions ?? nodeLocations?.map((loc) => loc.start);\n\n this.locations =\n positions && source\n ? positions.map((pos) => getLocation(source, pos))\n : nodeLocations?.map((loc) => getLocation(loc.source, loc.start));\n\n const originalExtensions = isObjectLike(underlyingError?.extensions)\n ? underlyingError.extensions\n : undefined;\n this.extensions = extensions ?? originalExtensions ?? Object.create(null);\n\n // Only properties prescribed by the spec should be enumerable.\n // Keep the rest as non-enumerable.\n Object.defineProperties(this, {\n message: {\n writable: true,\n enumerable: true,\n },\n name: { enumerable: false },\n nodes: { enumerable: false },\n source: { enumerable: false },\n positions: { enumerable: false },\n originalError: { enumerable: false },\n });\n\n // Include (non-enumerable) stack trace.\n // Do not copy over the stack trace of the Error.cause, since the tooling\n // already nicely prints/reports the cause chains.\n // Preserve the copy-over behavior of the `originalError`, since users may\n // expect it to work the way it did originally.\n if (originalError?.stack != null) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true,\n });\n } else if (Error.captureStackTrace != null) {\n Error.captureStackTrace(this, GraphQLError);\n // See: https://github.com/graphql/graphql-js/issues/2317\n /* node:coverage ignore next 7 */\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true,\n });\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLError';\n }\n\n /**\n * Returns this error as a human-readable message with source locations.\n * @returns The formatted error string.\n * @example\n * ```ts\n * import { Source } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n *\n * const error = new GraphQLError('Cannot query field \"name\".', {\n * source: new Source('{ name }'),\n * positions: [2],\n * });\n *\n * error.toString(); // => 'Cannot query field \"name\".\\n\\nGraphQL request:1:3\\n1 | { name }\\n | ^'\n * ```\n */\n override toString(): string {\n let output = this.message;\n\n if (this.nodes) {\n for (const node of this.nodes) {\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (this.source && this.locations) {\n for (const location of this.locations) {\n output += '\\n\\n' + printSourceLocation(this.source, location);\n }\n }\n\n return output;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLError } from 'graphql/error';\n *\n * const error = new GraphQLError('Resolver failed.', {\n * path: ['viewer', 'name'],\n * extensions: { code: 'INTERNAL' },\n * });\n *\n * error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } }\n * ```\n */\n toJSON(): GraphQLFormattedError {\n type WritableFormattedError = {\n -readonly [P in keyof GraphQLFormattedError]: GraphQLFormattedError[P];\n };\n\n const formattedError: WritableFormattedError = {\n message: this.message,\n };\n\n if (this.locations != null) {\n formattedError.locations = this.locations;\n }\n\n if (this.path != null) {\n formattedError.path = this.path;\n }\n\n if (this.extensions != null && Object.keys(this.extensions).length > 0) {\n formattedError.extensions = this.extensions;\n }\n\n return formattedError;\n }\n}\n\nfunction undefinedIfEmpty(\n array: Array | undefined,\n): Array | undefined {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n\n/** See: https://spec.graphql.org/draft/#sec-Errors */\nexport interface GraphQLFormattedError {\n /**\n * A short, human-readable summary of the problem that **SHOULD NOT** change\n * from occurrence to occurrence of the problem, except for purposes of\n * localization.\n */\n readonly message: string;\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n readonly locations?: ReadonlyArray;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n readonly path?: ReadonlyArray;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n readonly extensions?: GraphQLFormattedErrorExtensions;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.mts new file mode 100644 index 00000000..ede4899a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.mts @@ -0,0 +1,7 @@ +import { GraphQLError } from "./GraphQLError.mjs"; +/** + * Ensure an unknown thrown value is represented as a GraphQLError. + * + * @internal + */ +export declare function ensureGraphQLError(rawError: unknown): GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.ts new file mode 100644 index 00000000..c4265570 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.d.ts @@ -0,0 +1,7 @@ +import { GraphQLError } from "./GraphQLError.js"; +/** + * Ensure an unknown thrown value is represented as a GraphQLError. + * + * @internal + */ +export declare function ensureGraphQLError(rawError: unknown): GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js new file mode 100644 index 00000000..57bf2339 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensureGraphQLError = ensureGraphQLError; +const toError_ts_1 = require("../jsutils/toError.js"); +const GraphQLError_ts_1 = require("./GraphQLError.js"); +function ensureGraphQLError(rawError) { + if (rawError instanceof GraphQLError_ts_1.GraphQLError) { + return rawError; + } + const originalError = (0, toError_ts_1.toError)(rawError); + return new GraphQLError_ts_1.GraphQLError(originalError.message, { originalError }); +} +//# sourceMappingURL=ensureGraphQLError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js.map new file mode 100644 index 00000000..613f4bda --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ensureGraphQLError.js","sourceRoot":"","sources":["../../src/error/ensureGraphQLError.ts"],"names":[],"mappings":";;AASA,gDAOC;AAhBD,sDAAgD;AAEhD,uDAAiD;AAOjD,SAAgB,kBAAkB,CAAC,QAAiB;IAClD,IAAI,QAAQ,YAAY,8BAAY,EAAE,CAAC;QACrC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,aAAa,GAAG,IAAA,oBAAO,EAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,IAAI,8BAAY,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { toError } from '../jsutils/toError.ts';\n\nimport { GraphQLError } from './GraphQLError.ts';\n\n/**\n * Ensure an unknown thrown value is represented as a GraphQLError.\n *\n * @internal\n */\nexport function ensureGraphQLError(rawError: unknown): GraphQLError {\n if (rawError instanceof GraphQLError) {\n return rawError;\n }\n\n const originalError = toError(rawError);\n return new GraphQLError(originalError.message, { originalError });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs new file mode 100644 index 00000000..5092b8ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs @@ -0,0 +1,10 @@ +import { toError } from "../jsutils/toError.mjs"; +import { GraphQLError } from "./GraphQLError.mjs"; +export function ensureGraphQLError(rawError) { + if (rawError instanceof GraphQLError) { + return rawError; + } + const originalError = toError(rawError); + return new GraphQLError(originalError.message, { originalError }); +} +//# sourceMappingURL=ensureGraphQLError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs.map new file mode 100644 index 00000000..fc3d4b8a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/ensureGraphQLError.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ensureGraphQLError.js","sourceRoot":"","sources":["../../src/error/ensureGraphQLError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAEhD,OAAO,EAAE,YAAY,EAAE,2BAA0B;AAOjD,MAAM,UAAU,kBAAkB,CAAC,QAAiB;IAClD,IAAI,QAAQ,YAAY,YAAY,EAAE,CAAC;QACrC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,IAAI,YAAY,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { toError } from '../jsutils/toError.ts';\n\nimport { GraphQLError } from './GraphQLError.ts';\n\n/**\n * Ensure an unknown thrown value is represented as a GraphQLError.\n *\n * @internal\n */\nexport function ensureGraphQLError(rawError: unknown): GraphQLError {\n if (rawError instanceof GraphQLError) {\n return rawError;\n }\n\n const originalError = toError(rawError);\n return new GraphQLError(originalError.message, { originalError });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.mts new file mode 100644 index 00000000..778f9e8e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.mts @@ -0,0 +1,10 @@ +/** + * Create, format, and locate GraphQL errors. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { GraphQLError } from "./GraphQLError.mjs"; +export type { GraphQLErrorOptions, GraphQLFormattedError, GraphQLErrorExtensions, GraphQLFormattedErrorExtensions, } from "./GraphQLError.mjs"; +export { syntaxError } from "./syntaxError.mjs"; +export { locatedError } from "./locatedError.mjs"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.ts new file mode 100644 index 00000000..07e13ac3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.d.ts @@ -0,0 +1,10 @@ +/** + * Create, format, and locate GraphQL errors. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { GraphQLError } from "./GraphQLError.js"; +export type { GraphQLErrorOptions, GraphQLFormattedError, GraphQLErrorExtensions, GraphQLFormattedErrorExtensions, } from "./GraphQLError.js"; +export { syntaxError } from "./syntaxError.js"; +export { locatedError } from "./locatedError.js"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js new file mode 100644 index 00000000..05c7d61e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.locatedError = exports.syntaxError = exports.GraphQLError = void 0; +var GraphQLError_ts_1 = require("./GraphQLError.js"); +Object.defineProperty(exports, "GraphQLError", { enumerable: true, get: function () { return GraphQLError_ts_1.GraphQLError; } }); +var syntaxError_ts_1 = require("./syntaxError.js"); +Object.defineProperty(exports, "syntaxError", { enumerable: true, get: function () { return syntaxError_ts_1.syntaxError; } }); +var locatedError_ts_1 = require("./locatedError.js"); +Object.defineProperty(exports, "locatedError", { enumerable: true, get: function () { return locatedError_ts_1.locatedError; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js.map new file mode 100644 index 00000000..aa4ebcee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":";;;AAOA,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AAQrB,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AAEpB,qDAAiD;AAAxC,+GAAA,YAAY,OAAA","sourcesContent":["/**\n * Create, format, and locate GraphQL errors.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { GraphQLError } from './GraphQLError.ts';\nexport type {\n GraphQLErrorOptions,\n GraphQLFormattedError,\n GraphQLErrorExtensions,\n GraphQLFormattedErrorExtensions,\n} from './GraphQLError.ts';\n\nexport { syntaxError } from './syntaxError.ts';\n\nexport { locatedError } from './locatedError.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs new file mode 100644 index 00000000..982795e0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs @@ -0,0 +1,4 @@ +export { GraphQLError } from "./GraphQLError.mjs"; +export { syntaxError } from "./syntaxError.mjs"; +export { locatedError } from "./locatedError.mjs"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs.map new file mode 100644 index 00000000..48c305bd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,2BAA0B;AAQjD,OAAO,EAAE,WAAW,EAAE,0BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,2BAA0B","sourcesContent":["/**\n * Create, format, and locate GraphQL errors.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { GraphQLError } from './GraphQLError.ts';\nexport type {\n GraphQLErrorOptions,\n GraphQLFormattedError,\n GraphQLErrorExtensions,\n GraphQLFormattedErrorExtensions,\n} from './GraphQLError.ts';\n\nexport { syntaxError } from './syntaxError.ts';\n\nexport { locatedError } from './locatedError.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.mts new file mode 100644 index 00000000..8c4ec80e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.mts @@ -0,0 +1,27 @@ +/** @category Errors */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ASTNode } from "../language/ast.mjs"; +import { GraphQLError } from "./GraphQLError.mjs"; +/** + * Given an arbitrary value, presumably thrown while attempting to execute a + * GraphQL operation, produce a new GraphQLError aware of the location in the + * document responsible for the original Error. + * @param rawOriginalError - The original error value to wrap. + * @param nodes - The AST nodes associated with the error. + * @param path - The response path associated with the error. + * @returns The GraphQL error. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { locatedError } from 'graphql/error'; + * + * const document = parse('{ viewer { name } }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const error = locatedError(new Error('Resolver failed'), fieldNode, ['viewer']); + * + * error.message; // => 'Resolver failed' + * error.locations; // => [{ line: 1, column: 3 }] + * error.path; // => ['viewer'] + * ``` + */ +export declare function locatedError(rawOriginalError: unknown, nodes: ASTNode | ReadonlyArray | undefined | null, path?: Maybe>): GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.ts new file mode 100644 index 00000000..1d806766 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.d.ts @@ -0,0 +1,27 @@ +/** @category Errors */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ASTNode } from "../language/ast.js"; +import { GraphQLError } from "./GraphQLError.js"; +/** + * Given an arbitrary value, presumably thrown while attempting to execute a + * GraphQL operation, produce a new GraphQLError aware of the location in the + * document responsible for the original Error. + * @param rawOriginalError - The original error value to wrap. + * @param nodes - The AST nodes associated with the error. + * @param path - The response path associated with the error. + * @returns The GraphQL error. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { locatedError } from 'graphql/error'; + * + * const document = parse('{ viewer { name } }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const error = locatedError(new Error('Resolver failed'), fieldNode, ['viewer']); + * + * error.message; // => 'Resolver failed' + * error.locations; // => [{ line: 1, column: 3 }] + * error.path; // => ['viewer'] + * ``` + */ +export declare function locatedError(rawOriginalError: unknown, nodes: ASTNode | ReadonlyArray | undefined | null, path?: Maybe>): GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js new file mode 100644 index 00000000..37ee85a7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.locatedError = locatedError; +const toError_ts_1 = require("../jsutils/toError.js"); +const GraphQLError_ts_1 = require("./GraphQLError.js"); +function locatedError(rawOriginalError, nodes, path) { + const originalError = (0, toError_ts_1.toError)(rawOriginalError); + if (isLocatedGraphQLError(originalError)) { + return originalError; + } + return new GraphQLError_ts_1.GraphQLError(originalError.message, { + nodes: originalError.nodes ?? nodes, + source: originalError.source, + positions: originalError.positions, + path, + originalError, + }); +} +function isLocatedGraphQLError(error) { + return Array.isArray(error.path); +} +//# sourceMappingURL=locatedError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js.map new file mode 100644 index 00000000..d230ca2d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"locatedError.js","sourceRoot":"","sources":["../../src/error/locatedError.ts"],"names":[],"mappings":";;AA+BA,oCAmBC;AA/CD,sDAAgD;AAIhD,uDAAiD;AAwBjD,SAAgB,YAAY,CAC1B,gBAAyB,EACzB,KAA0D,EAC1D,IAA4C;IAE5C,MAAM,aAAa,GAAG,IAAA,oBAAO,EAAC,gBAAgB,CAAC,CAAC;IAGhD,IAAI,qBAAqB,CAAC,aAAa,CAAC,EAAE,CAAC;QACzC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,8BAAY,CAAC,aAAa,CAAC,OAAO,EAAE;QAC7C,KAAK,EAAG,aAA8B,CAAC,KAAK,IAAI,KAAK;QACrD,MAAM,EAAG,aAA8B,CAAC,MAAM;QAC9C,SAAS,EAAG,aAA8B,CAAC,SAAS;QACpD,IAAI;QACJ,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAU;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/** @category Errors */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport { toError } from '../jsutils/toError.ts';\n\nimport type { ASTNode } from '../language/ast.ts';\n\nimport { GraphQLError } from './GraphQLError.ts';\n\n/**\n * Given an arbitrary value, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n * @param rawOriginalError - The original error value to wrap.\n * @param nodes - The AST nodes associated with the error.\n * @param path - The response path associated with the error.\n * @returns The GraphQL error.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { locatedError } from 'graphql/error';\n *\n * const document = parse('{ viewer { name } }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const error = locatedError(new Error('Resolver failed'), fieldNode, ['viewer']);\n *\n * error.message; // => 'Resolver failed'\n * error.locations; // => [{ line: 1, column: 3 }]\n * error.path; // => ['viewer']\n * ```\n */\nexport function locatedError(\n rawOriginalError: unknown,\n nodes: ASTNode | ReadonlyArray | undefined | null,\n path?: Maybe>,\n): GraphQLError {\n const originalError = toError(rawOriginalError);\n\n // Note: this uses a brand-check to support GraphQL errors originating from other contexts.\n if (isLocatedGraphQLError(originalError)) {\n return originalError;\n }\n\n return new GraphQLError(originalError.message, {\n nodes: (originalError as GraphQLError).nodes ?? nodes,\n source: (originalError as GraphQLError).source,\n positions: (originalError as GraphQLError).positions,\n path,\n originalError,\n });\n}\n\nfunction isLocatedGraphQLError(error: any): error is GraphQLError {\n return Array.isArray(error.path);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs new file mode 100644 index 00000000..b92bc614 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs @@ -0,0 +1,19 @@ +import { toError } from "../jsutils/toError.mjs"; +import { GraphQLError } from "./GraphQLError.mjs"; +export function locatedError(rawOriginalError, nodes, path) { + const originalError = toError(rawOriginalError); + if (isLocatedGraphQLError(originalError)) { + return originalError; + } + return new GraphQLError(originalError.message, { + nodes: originalError.nodes ?? nodes, + source: originalError.source, + positions: originalError.positions, + path, + originalError, + }); +} +function isLocatedGraphQLError(error) { + return Array.isArray(error.path); +} +//# sourceMappingURL=locatedError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs.map new file mode 100644 index 00000000..582fa032 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/locatedError.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"locatedError.js","sourceRoot":"","sources":["../../src/error/locatedError.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAIhD,OAAO,EAAE,YAAY,EAAE,2BAA0B;AAwBjD,MAAM,UAAU,YAAY,CAC1B,gBAAyB,EACzB,KAA0D,EAC1D,IAA4C;IAE5C,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAGhD,IAAI,qBAAqB,CAAC,aAAa,CAAC,EAAE,CAAC;QACzC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,YAAY,CAAC,aAAa,CAAC,OAAO,EAAE;QAC7C,KAAK,EAAG,aAA8B,CAAC,KAAK,IAAI,KAAK;QACrD,MAAM,EAAG,aAA8B,CAAC,MAAM;QAC9C,SAAS,EAAG,aAA8B,CAAC,SAAS;QACpD,IAAI;QACJ,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAU;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/** @category Errors */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport { toError } from '../jsutils/toError.ts';\n\nimport type { ASTNode } from '../language/ast.ts';\n\nimport { GraphQLError } from './GraphQLError.ts';\n\n/**\n * Given an arbitrary value, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n * @param rawOriginalError - The original error value to wrap.\n * @param nodes - The AST nodes associated with the error.\n * @param path - The response path associated with the error.\n * @returns The GraphQL error.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { locatedError } from 'graphql/error';\n *\n * const document = parse('{ viewer { name } }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const error = locatedError(new Error('Resolver failed'), fieldNode, ['viewer']);\n *\n * error.message; // => 'Resolver failed'\n * error.locations; // => [{ line: 1, column: 3 }]\n * error.path; // => ['viewer']\n * ```\n */\nexport function locatedError(\n rawOriginalError: unknown,\n nodes: ASTNode | ReadonlyArray | undefined | null,\n path?: Maybe>,\n): GraphQLError {\n const originalError = toError(rawOriginalError);\n\n // Note: this uses a brand-check to support GraphQL errors originating from other contexts.\n if (isLocatedGraphQLError(originalError)) {\n return originalError;\n }\n\n return new GraphQLError(originalError.message, {\n nodes: (originalError as GraphQLError).nodes ?? nodes,\n source: (originalError as GraphQLError).source,\n positions: (originalError as GraphQLError).positions,\n path,\n originalError,\n });\n}\n\nfunction isLocatedGraphQLError(error: any): error is GraphQLError {\n return Array.isArray(error.path);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.mts new file mode 100644 index 00000000..0883fbbf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.mts @@ -0,0 +1,22 @@ +/** @category Errors */ +import type { Source } from "../language/source.mjs"; +import { GraphQLError } from "./GraphQLError.mjs"; +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + * @param source - The GraphQL source containing the syntax error. + * @param position - Character offset where the syntax error was encountered. + * @param description - Human-readable description of the syntax error. + * @returns A GraphQLError located at the syntax error position. + * @example + * ```ts + * import { Source } from 'graphql/language'; + * import { syntaxError } from 'graphql/error'; + * + * const error = syntaxError(new Source('query {'), 7, 'Expected Name'); + * + * error.message; // => 'Syntax Error: Expected Name' + * error.locations; // => [{ line: 1, column: 8 }] + * ``` + */ +export declare function syntaxError(source: Source, position: number, description: string): GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.ts new file mode 100644 index 00000000..096bbbc6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.d.ts @@ -0,0 +1,22 @@ +/** @category Errors */ +import type { Source } from "../language/source.js"; +import { GraphQLError } from "./GraphQLError.js"; +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + * @param source - The GraphQL source containing the syntax error. + * @param position - Character offset where the syntax error was encountered. + * @param description - Human-readable description of the syntax error. + * @returns A GraphQLError located at the syntax error position. + * @example + * ```ts + * import { Source } from 'graphql/language'; + * import { syntaxError } from 'graphql/error'; + * + * const error = syntaxError(new Source('query {'), 7, 'Expected Name'); + * + * error.message; // => 'Syntax Error: Expected Name' + * error.locations; // => [{ line: 1, column: 8 }] + * ``` + */ +export declare function syntaxError(source: Source, position: number, description: string): GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js new file mode 100644 index 00000000..08878ed9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.syntaxError = syntaxError; +const GraphQLError_ts_1 = require("./GraphQLError.js"); +function syntaxError(source, position, description) { + return new GraphQLError_ts_1.GraphQLError(`Syntax Error: ${description}`, { + source, + positions: [position], + }); +} +//# sourceMappingURL=syntaxError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js.map new file mode 100644 index 00000000..5efb14d6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"syntaxError.js","sourceRoot":"","sources":["../../src/error/syntaxError.ts"],"names":[],"mappings":";;AAwBA,kCASC;AA7BD,uDAAiD;AAoBjD,SAAgB,WAAW,CACzB,MAAc,EACd,QAAgB,EAChB,WAAmB;IAEnB,OAAO,IAAI,8BAAY,CAAC,iBAAiB,WAAW,EAAE,EAAE;QACtD,MAAM;QACN,SAAS,EAAE,CAAC,QAAQ,CAAC;KACtB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** @category Errors */\n\nimport type { Source } from '../language/source.ts';\n\nimport { GraphQLError } from './GraphQLError.ts';\n\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n * @param source - The GraphQL source containing the syntax error.\n * @param position - Character offset where the syntax error was encountered.\n * @param description - Human-readable description of the syntax error.\n * @returns A GraphQLError located at the syntax error position.\n * @example\n * ```ts\n * import { Source } from 'graphql/language';\n * import { syntaxError } from 'graphql/error';\n *\n * const error = syntaxError(new Source('query {'), 7, 'Expected Name');\n *\n * error.message; // => 'Syntax Error: Expected Name'\n * error.locations; // => [{ line: 1, column: 8 }]\n * ```\n */\nexport function syntaxError(\n source: Source,\n position: number,\n description: string,\n): GraphQLError {\n return new GraphQLError(`Syntax Error: ${description}`, {\n source,\n positions: [position],\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs new file mode 100644 index 00000000..626c150f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs @@ -0,0 +1,8 @@ +import { GraphQLError } from "./GraphQLError.mjs"; +export function syntaxError(source, position, description) { + return new GraphQLError(`Syntax Error: ${description}`, { + source, + positions: [position], + }); +} +//# sourceMappingURL=syntaxError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs.map new file mode 100644 index 00000000..acf0b4d4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/error/syntaxError.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"syntaxError.js","sourceRoot":"","sources":["../../src/error/syntaxError.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,2BAA0B;AAoBjD,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,QAAgB,EAChB,WAAmB;IAEnB,OAAO,IAAI,YAAY,CAAC,iBAAiB,WAAW,EAAE,EAAE;QACtD,MAAM;QACN,SAAS,EAAE,CAAC,QAAQ,CAAC;KACtB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** @category Errors */\n\nimport type { Source } from '../language/source.ts';\n\nimport { GraphQLError } from './GraphQLError.ts';\n\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n * @param source - The GraphQL source containing the syntax error.\n * @param position - Character offset where the syntax error was encountered.\n * @param description - Human-readable description of the syntax error.\n * @returns A GraphQLError located at the syntax error position.\n * @example\n * ```ts\n * import { Source } from 'graphql/language';\n * import { syntaxError } from 'graphql/error';\n *\n * const error = syntaxError(new Source('query {'), 7, 'Expected Name');\n *\n * error.message; // => 'Syntax Error: Expected Name'\n * error.locations; // => [{ line: 1, column: 8 }]\n * ```\n */\nexport function syntaxError(\n source: Source,\n position: number,\n description: string,\n): GraphQLError {\n return new GraphQLError(`Syntax Error: ${description}`, {\n source,\n positions: [position],\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.mts new file mode 100644 index 00000000..7680b495 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.mts @@ -0,0 +1,33 @@ +/** @category Execution */ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.mjs"; +/** + * Error thrown when GraphQL execution is aborted. + * @typeParam TResult - Result value type. + */ +export declare class AbortedGraphQLExecutionError extends Error { + /** Partial execution result available when execution was aborted. */ + readonly abortedResult: PromiseOrValue; + /** + * Creates an error for an aborted GraphQL execution. + * @param reason - Abort reason used as the error cause. + * @param result - Partial execution result available when execution stopped. + * @example + * ```ts + * import { AbortedGraphQLExecutionError } from 'graphql/execution'; + * + * const cause = new Error('Request cancelled.'); + * const partialResult = { data: { viewer: null } }; + * const error = new AbortedGraphQLExecutionError(cause, partialResult); + * + * error.message; // => 'Request cancelled.' + * error.cause; // => cause + * error.abortedResult; // => partialResult + * ``` + */ + constructor(reason: unknown, result: PromiseOrValue); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.ts new file mode 100644 index 00000000..ccab44d9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.d.ts @@ -0,0 +1,33 @@ +/** @category Execution */ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.js"; +/** + * Error thrown when GraphQL execution is aborted. + * @typeParam TResult - Result value type. + */ +export declare class AbortedGraphQLExecutionError extends Error { + /** Partial execution result available when execution was aborted. */ + readonly abortedResult: PromiseOrValue; + /** + * Creates an error for an aborted GraphQL execution. + * @param reason - Abort reason used as the error cause. + * @param result - Partial execution result available when execution stopped. + * @example + * ```ts + * import { AbortedGraphQLExecutionError } from 'graphql/execution'; + * + * const cause = new Error('Request cancelled.'); + * const partialResult = { data: { viewer: null } }; + * const error = new AbortedGraphQLExecutionError(cause, partialResult); + * + * error.message; // => 'Request cancelled.' + * error.cause; // => cause + * error.abortedResult; // => partialResult + * ``` + */ + constructor(reason: unknown, result: PromiseOrValue); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js new file mode 100644 index 00000000..81be6096 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbortedGraphQLExecutionError = void 0; +class AbortedGraphQLExecutionError extends Error { + constructor(reason, result) { + super(getAbortReasonMessage(reason), { cause: reason }); + this.name = 'AbortedGraphQLExecutionError'; + this.abortedResult = result; + } + get [Symbol.toStringTag]() { + return 'AbortedGraphQLExecutionError'; + } +} +exports.AbortedGraphQLExecutionError = AbortedGraphQLExecutionError; +function getAbortReasonMessage(reason) { + if (reason instanceof Error) { + return reason.message; + } + if (typeof reason === 'object' && + reason !== null && + 'message' in reason && + typeof reason.message === 'string') { + return reason.message; + } + return String(reason); +} +//# sourceMappingURL=AbortedGraphQLExecutionError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js.map new file mode 100644 index 00000000..fbe39d7d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AbortedGraphQLExecutionError.js","sourceRoot":"","sources":["../../src/execution/AbortedGraphQLExecutionError.ts"],"names":[],"mappings":";;;AAQA,MAAa,4BAAsC,SAAQ,KAAK;IAqB9D,YAAY,MAAe,EAAE,MAA+B;QAC1D,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;IAC9B,CAAC;IAMD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,8BAA8B,CAAC;IACxC,CAAC;CACF;AAlCD,oEAkCC;AAED,SAAS,qBAAqB,CAAC,MAAe;IAC5C,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,IACE,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,SAAS,IAAI,MAAM;QACnB,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAClC,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/** @category Execution */\n\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\n/**\n * Error thrown when GraphQL execution is aborted.\n * @typeParam TResult - Result value type.\n */\nexport class AbortedGraphQLExecutionError extends Error {\n /** Partial execution result available when execution was aborted. */\n readonly abortedResult: PromiseOrValue;\n\n /**\n * Creates an error for an aborted GraphQL execution.\n * @param reason - Abort reason used as the error cause.\n * @param result - Partial execution result available when execution stopped.\n * @example\n * ```ts\n * import { AbortedGraphQLExecutionError } from 'graphql/execution';\n *\n * const cause = new Error('Request cancelled.');\n * const partialResult = { data: { viewer: null } };\n * const error = new AbortedGraphQLExecutionError(cause, partialResult);\n *\n * error.message; // => 'Request cancelled.'\n * error.cause; // => cause\n * error.abortedResult; // => partialResult\n * ```\n */\n constructor(reason: unknown, result: PromiseOrValue) {\n super(getAbortReasonMessage(reason), { cause: reason });\n this.name = 'AbortedGraphQLExecutionError';\n this.abortedResult = result;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'AbortedGraphQLExecutionError';\n }\n}\n\nfunction getAbortReasonMessage(reason: unknown): string {\n if (reason instanceof Error) {\n return reason.message;\n }\n if (\n typeof reason === 'object' &&\n reason !== null &&\n 'message' in reason &&\n typeof reason.message === 'string'\n ) {\n return reason.message;\n }\n return String(reason);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs new file mode 100644 index 00000000..cf969a10 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs @@ -0,0 +1,23 @@ +export class AbortedGraphQLExecutionError extends Error { + constructor(reason, result) { + super(getAbortReasonMessage(reason), { cause: reason }); + this.name = 'AbortedGraphQLExecutionError'; + this.abortedResult = result; + } + get [Symbol.toStringTag]() { + return 'AbortedGraphQLExecutionError'; + } +} +function getAbortReasonMessage(reason) { + if (reason instanceof Error) { + return reason.message; + } + if (typeof reason === 'object' && + reason !== null && + 'message' in reason && + typeof reason.message === 'string') { + return reason.message; + } + return String(reason); +} +//# sourceMappingURL=AbortedGraphQLExecutionError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs.map new file mode 100644 index 00000000..aea22fd6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"AbortedGraphQLExecutionError.js","sourceRoot":"","sources":["../../src/execution/AbortedGraphQLExecutionError.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,4BAAsC,SAAQ,KAAK;IAqB9D,YAAY,MAAe,EAAE,MAA+B;QAC1D,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;IAC9B,CAAC;IAMD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,8BAA8B,CAAC;IACxC,CAAC;CACF;AAED,SAAS,qBAAqB,CAAC,MAAe;IAC5C,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,IACE,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,SAAS,IAAI,MAAM;QACnB,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAClC,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/** @category Execution */\n\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\n/**\n * Error thrown when GraphQL execution is aborted.\n * @typeParam TResult - Result value type.\n */\nexport class AbortedGraphQLExecutionError extends Error {\n /** Partial execution result available when execution was aborted. */\n readonly abortedResult: PromiseOrValue;\n\n /**\n * Creates an error for an aborted GraphQL execution.\n * @param reason - Abort reason used as the error cause.\n * @param result - Partial execution result available when execution stopped.\n * @example\n * ```ts\n * import { AbortedGraphQLExecutionError } from 'graphql/execution';\n *\n * const cause = new Error('Request cancelled.');\n * const partialResult = { data: { viewer: null } };\n * const error = new AbortedGraphQLExecutionError(cause, partialResult);\n *\n * error.message; // => 'Request cancelled.'\n * error.cause; // => cause\n * error.abortedResult; // => partialResult\n * ```\n */\n constructor(reason: unknown, result: PromiseOrValue) {\n super(getAbortReasonMessage(reason), { cause: reason });\n this.name = 'AbortedGraphQLExecutionError';\n this.abortedResult = result;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'AbortedGraphQLExecutionError';\n }\n}\n\nfunction getAbortReasonMessage(reason: unknown): string {\n if (reason instanceof Error) {\n return reason.message;\n }\n if (\n typeof reason === 'object' &&\n reason !== null &&\n 'message' in reason &&\n typeof reason.message === 'string'\n ) {\n return reason.message;\n }\n return String(reason);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.mts new file mode 100644 index 00000000..35269084 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.mts @@ -0,0 +1,10 @@ +/** @internal */ +export declare class AsyncWorkTracker { + pendingAsyncWork: Set>; + constructor(); + add(promiseLike: PromiseLike): void; + addValues(values: ReadonlyArray): void; + wait(): Promise | void; + promiseAllTrackOnReject(values: ReadonlyArray | T>): Promise>; + private waitForPendingAsyncWork; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.ts new file mode 100644 index 00000000..35269084 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.d.ts @@ -0,0 +1,10 @@ +/** @internal */ +export declare class AsyncWorkTracker { + pendingAsyncWork: Set>; + constructor(); + add(promiseLike: PromiseLike): void; + addValues(values: ReadonlyArray): void; + wait(): Promise | void; + promiseAllTrackOnReject(values: ReadonlyArray | T>): Promise>; + private waitForPendingAsyncWork; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js new file mode 100644 index 00000000..71ef5d89 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AsyncWorkTracker = void 0; +const isPromise_ts_1 = require("../jsutils/isPromise.js"); +class AsyncWorkTracker { + constructor() { + this.pendingAsyncWork = new Set(); + } + add(promiseLike) { + const pendingAsyncWork = this.pendingAsyncWork; + const promiseToSettle = promiseLike.then(() => { + pendingAsyncWork.delete(promiseToSettle); + }, () => { + pendingAsyncWork.delete(promiseToSettle); + }); + pendingAsyncWork.add(promiseToSettle); + } + addValues(values) { + for (const value of values) { + if ((0, isPromise_ts_1.isPromiseLike)(value)) { + this.add(value); + } + } + } + wait() { + if (this.pendingAsyncWork.size === 0) { + return; + } + return this.waitForPendingAsyncWork(); + } + promiseAllTrackOnReject(values) { + const promise = Promise.all(values); + promise.then(undefined, () => { + this.addValues(values); + }); + return promise; + } + async waitForPendingAsyncWork() { + while (this.pendingAsyncWork.size > 0) { + await Promise.allSettled(Array.from(this.pendingAsyncWork)); + } + } +} +exports.AsyncWorkTracker = AsyncWorkTracker; +//# sourceMappingURL=AsyncWorkTracker.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js.map new file mode 100644 index 00000000..f711cdfa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AsyncWorkTracker.js","sourceRoot":"","sources":["../../src/execution/AsyncWorkTracker.ts"],"names":[],"mappings":";;;AAAA,0DAAwD;AAGxD,MAAa,gBAAgB;IAG3B;QACE,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;IACpC,CAAC;IAED,GAAG,CAAC,WAAiC;QACnC,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC/C,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CACtC,GAAG,EAAE;YACH,gBAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC,EACD,GAAG,EAAE;YACH,gBAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC,CACF,CAAC;QACF,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,MAA8B;QACtC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,IAAA,4BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI;QAGF,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO;QACT,CAAC;QACD,OAAO,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACxC,CAAC;IAED,uBAAuB,CACrB,MAAyC;QAEzC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;YAC3B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,KAAK,CAAC,uBAAuB;QACnC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAEtC,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;CACF;AArDD,4CAqDC","sourcesContent":["import { isPromiseLike } from '../jsutils/isPromise.ts';\n\n/** @internal */\nexport class AsyncWorkTracker {\n pendingAsyncWork: Set>;\n\n constructor() {\n this.pendingAsyncWork = new Set();\n }\n\n add(promiseLike: PromiseLike): void {\n const pendingAsyncWork = this.pendingAsyncWork;\n const promiseToSettle = promiseLike.then(\n () => {\n pendingAsyncWork.delete(promiseToSettle);\n },\n () => {\n pendingAsyncWork.delete(promiseToSettle);\n },\n );\n pendingAsyncWork.add(promiseToSettle);\n }\n\n addValues(values: ReadonlyArray): void {\n for (const value of values) {\n if (isPromiseLike(value)) {\n this.add(value);\n }\n }\n }\n\n wait(): Promise | void {\n // wait can complete synchronously when there is no tracked async work,\n // which allows synchronous execution paths to remain synchronous.\n if (this.pendingAsyncWork.size === 0) {\n return;\n }\n return this.waitForPendingAsyncWork();\n }\n\n promiseAllTrackOnReject(\n values: ReadonlyArray | T>,\n ): Promise> {\n const promise = Promise.all(values);\n promise.then(undefined, () => {\n this.addValues(values);\n });\n return promise;\n }\n\n private async waitForPendingAsyncWork(): Promise {\n while (this.pendingAsyncWork.size > 0) {\n // eslint-disable-next-line no-await-in-loop\n await Promise.allSettled(Array.from(this.pendingAsyncWork));\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs new file mode 100644 index 00000000..ab1c3345 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs @@ -0,0 +1,41 @@ +import { isPromiseLike } from "../jsutils/isPromise.mjs"; +export class AsyncWorkTracker { + constructor() { + this.pendingAsyncWork = new Set(); + } + add(promiseLike) { + const pendingAsyncWork = this.pendingAsyncWork; + const promiseToSettle = promiseLike.then(() => { + pendingAsyncWork.delete(promiseToSettle); + }, () => { + pendingAsyncWork.delete(promiseToSettle); + }); + pendingAsyncWork.add(promiseToSettle); + } + addValues(values) { + for (const value of values) { + if (isPromiseLike(value)) { + this.add(value); + } + } + } + wait() { + if (this.pendingAsyncWork.size === 0) { + return; + } + return this.waitForPendingAsyncWork(); + } + promiseAllTrackOnReject(values) { + const promise = Promise.all(values); + promise.then(undefined, () => { + this.addValues(values); + }); + return promise; + } + async waitForPendingAsyncWork() { + while (this.pendingAsyncWork.size > 0) { + await Promise.allSettled(Array.from(this.pendingAsyncWork)); + } + } +} +//# sourceMappingURL=AsyncWorkTracker.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs.map new file mode 100644 index 00000000..7cc64c17 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/AsyncWorkTracker.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"AsyncWorkTracker.js","sourceRoot":"","sources":["../../src/execution/AsyncWorkTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iCAAgC;AAGxD,MAAM,OAAO,gBAAgB;IAG3B;QACE,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;IACpC,CAAC;IAED,GAAG,CAAC,WAAiC;QACnC,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC/C,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CACtC,GAAG,EAAE;YACH,gBAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC,EACD,GAAG,EAAE;YACH,gBAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC,CACF,CAAC;QACF,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,MAA8B;QACtC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI;QAGF,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO;QACT,CAAC;QACD,OAAO,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACxC,CAAC;IAED,uBAAuB,CACrB,MAAyC;QAEzC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;YAC3B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,KAAK,CAAC,uBAAuB;QACnC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAEtC,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;CACF","sourcesContent":["import { isPromiseLike } from '../jsutils/isPromise.ts';\n\n/** @internal */\nexport class AsyncWorkTracker {\n pendingAsyncWork: Set>;\n\n constructor() {\n this.pendingAsyncWork = new Set();\n }\n\n add(promiseLike: PromiseLike): void {\n const pendingAsyncWork = this.pendingAsyncWork;\n const promiseToSettle = promiseLike.then(\n () => {\n pendingAsyncWork.delete(promiseToSettle);\n },\n () => {\n pendingAsyncWork.delete(promiseToSettle);\n },\n );\n pendingAsyncWork.add(promiseToSettle);\n }\n\n addValues(values: ReadonlyArray): void {\n for (const value of values) {\n if (isPromiseLike(value)) {\n this.add(value);\n }\n }\n }\n\n wait(): Promise | void {\n // wait can complete synchronously when there is no tracked async work,\n // which allows synchronous execution paths to remain synchronous.\n if (this.pendingAsyncWork.size === 0) {\n return;\n }\n return this.waitForPendingAsyncWork();\n }\n\n promiseAllTrackOnReject(\n values: ReadonlyArray | T>,\n ): Promise> {\n const promise = Promise.all(values);\n promise.then(undefined, () => {\n this.addValues(values);\n });\n return promise;\n }\n\n private async waitForPendingAsyncWork(): Promise {\n while (this.pendingAsyncWork.size > 0) {\n // eslint-disable-next-line no-await-in-loop\n await Promise.allSettled(Array.from(this.pendingAsyncWork));\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.mts new file mode 100644 index 00000000..3baef112 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.mts @@ -0,0 +1,107 @@ +/** @category Execution */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { DocumentNode, FragmentDefinitionNode, OperationDefinitionNode, SubscriptionOperationDefinitionNode } from "../language/ast.mjs"; +import type { GraphQLFieldResolver, GraphQLTypeResolver } from "../type/definition.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { FragmentDetails } from "./collectFields.mjs"; +import type { VariableValues } from "./values.mjs"; +/** Arguments accepted by execute and executeSync. */ +export interface ExecutionArgs { + /** The schema used for validation or execution. */ + schema: GraphQLSchema; + /** The parsed GraphQL document to execute. */ + document: DocumentNode; + /** Initial root value passed to the operation. */ + rootValue?: unknown; + /** Application context value passed to every resolver. */ + contextValue?: unknown; + /** Runtime variable values keyed by variable name. */ + variableValues?: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Name of the operation to execute when the document contains multiple operations. */ + operationName?: Maybe; + /** Resolver used when a field does not define its own resolver. */ + fieldResolver?: Maybe>; + /** Resolver used when an abstract type does not define its own resolver. */ + typeResolver?: Maybe>; + /** Resolver used for the root subscription field. */ + subscribeFieldResolver?: Maybe>; + /** Whether suggestion text should be omitted from request errors. */ + hideSuggestions?: Maybe; + /** AbortSignal used to cancel execution. */ + abortSignal?: Maybe; + /** Whether incremental execution may begin eligible work early. */ + enableEarlyExecution?: Maybe; + /** Execution hooks invoked during this operation. */ + hooks?: Maybe; + /** Additional execution options. */ + options?: { + /** + * Set the maximum number of errors allowed for coercing (defaults to 50). + * + * @internal + */ + maxCoercionErrors?: number; + }; +} +/** + * Data that must be available at all points during query execution. + * + * Namely, schema of the type system that is currently executing, + * and the fragments defined in the query document + */ +export interface ValidatedExecutionArgs { + /** Schema used for execution. */ + schema: GraphQLSchema; + /** Parsed GraphQL document being executed. */ + document: DocumentNode; + /** Fragment definitions keyed by fragment name. */ + fragmentDefinitions: ObjMap; + /** Fragment details keyed by fragment name. */ + fragments: ObjMap; + /** Root value passed to the operation. */ + rootValue: unknown; + /** Application context value passed to every resolver. */ + contextValue: unknown; + /** Operation definition selected for execution. */ + operation: OperationDefinitionNode; + /** Operation variable values with source metadata and coerced runtime values. */ + variableValues: VariableValues; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Resolver used for fields without an explicit resolver. */ + fieldResolver: GraphQLFieldResolver; + /** Resolver used for abstract types without an explicit type resolver. */ + typeResolver: GraphQLTypeResolver; + /** Resolver used for subscription fields without an explicit subscribe resolver. */ + subscribeFieldResolver: GraphQLFieldResolver; + /** Whether suggestion text should be omitted from execution errors. */ + hideSuggestions: boolean; + /** Whether execution should use error propagation. */ + errorPropagation: boolean; + /** External signal that may abort execution. */ + externalAbortSignal: AbortSignal | undefined; + /** Whether incremental execution may begin eligible work early. */ + enableEarlyExecution: boolean; + /** Execution hooks supplied by the caller. */ + hooks: ExecutionHooks | undefined; +} +/** Validated execution arguments for a subscription operation. */ +export interface ValidatedSubscriptionArgs extends ValidatedExecutionArgs { + /** Subscription operation definition selected for execution. */ + operation: SubscriptionOperationDefinitionNode; +} +/** Information passed to hooks after asynchronous execution work has finished. */ +export interface AsyncWorkFinishedInfo { + /** Validated execution arguments for the operation that finished async work. */ + validatedExecutionArgs: ValidatedExecutionArgs; +} +/** Optional hooks invoked during GraphQL execution. */ +export interface ExecutionHooks { + /** Called after all tracked asynchronous execution work has settled. */ + asyncWorkFinished?: (info: AsyncWorkFinishedInfo) => void; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.ts new file mode 100644 index 00000000..485b8c13 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.d.ts @@ -0,0 +1,107 @@ +/** @category Execution */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { DocumentNode, FragmentDefinitionNode, OperationDefinitionNode, SubscriptionOperationDefinitionNode } from "../language/ast.js"; +import type { GraphQLFieldResolver, GraphQLTypeResolver } from "../type/definition.js"; +import type { GraphQLSchema } from "../type/schema.js"; +import type { FragmentDetails } from "./collectFields.js"; +import type { VariableValues } from "./values.js"; +/** Arguments accepted by execute and executeSync. */ +export interface ExecutionArgs { + /** The schema used for validation or execution. */ + schema: GraphQLSchema; + /** The parsed GraphQL document to execute. */ + document: DocumentNode; + /** Initial root value passed to the operation. */ + rootValue?: unknown; + /** Application context value passed to every resolver. */ + contextValue?: unknown; + /** Runtime variable values keyed by variable name. */ + variableValues?: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Name of the operation to execute when the document contains multiple operations. */ + operationName?: Maybe; + /** Resolver used when a field does not define its own resolver. */ + fieldResolver?: Maybe>; + /** Resolver used when an abstract type does not define its own resolver. */ + typeResolver?: Maybe>; + /** Resolver used for the root subscription field. */ + subscribeFieldResolver?: Maybe>; + /** Whether suggestion text should be omitted from request errors. */ + hideSuggestions?: Maybe; + /** AbortSignal used to cancel execution. */ + abortSignal?: Maybe; + /** Whether incremental execution may begin eligible work early. */ + enableEarlyExecution?: Maybe; + /** Execution hooks invoked during this operation. */ + hooks?: Maybe; + /** Additional execution options. */ + options?: { + /** + * Set the maximum number of errors allowed for coercing (defaults to 50). + * + * @internal + */ + maxCoercionErrors?: number; + }; +} +/** + * Data that must be available at all points during query execution. + * + * Namely, schema of the type system that is currently executing, + * and the fragments defined in the query document + */ +export interface ValidatedExecutionArgs { + /** Schema used for execution. */ + schema: GraphQLSchema; + /** Parsed GraphQL document being executed. */ + document: DocumentNode; + /** Fragment definitions keyed by fragment name. */ + fragmentDefinitions: ObjMap; + /** Fragment details keyed by fragment name. */ + fragments: ObjMap; + /** Root value passed to the operation. */ + rootValue: unknown; + /** Application context value passed to every resolver. */ + contextValue: unknown; + /** Operation definition selected for execution. */ + operation: OperationDefinitionNode; + /** Operation variable values with source metadata and coerced runtime values. */ + variableValues: VariableValues; + /** Raw variable values provided by the caller before coercion. */ + rawVariableValues: Maybe<{ + readonly [variable: string]: unknown; + }>; + /** Resolver used for fields without an explicit resolver. */ + fieldResolver: GraphQLFieldResolver; + /** Resolver used for abstract types without an explicit type resolver. */ + typeResolver: GraphQLTypeResolver; + /** Resolver used for subscription fields without an explicit subscribe resolver. */ + subscribeFieldResolver: GraphQLFieldResolver; + /** Whether suggestion text should be omitted from execution errors. */ + hideSuggestions: boolean; + /** Whether execution should use error propagation. */ + errorPropagation: boolean; + /** External signal that may abort execution. */ + externalAbortSignal: AbortSignal | undefined; + /** Whether incremental execution may begin eligible work early. */ + enableEarlyExecution: boolean; + /** Execution hooks supplied by the caller. */ + hooks: ExecutionHooks | undefined; +} +/** Validated execution arguments for a subscription operation. */ +export interface ValidatedSubscriptionArgs extends ValidatedExecutionArgs { + /** Subscription operation definition selected for execution. */ + operation: SubscriptionOperationDefinitionNode; +} +/** Information passed to hooks after asynchronous execution work has finished. */ +export interface AsyncWorkFinishedInfo { + /** Validated execution arguments for the operation that finished async work. */ + validatedExecutionArgs: ValidatedExecutionArgs; +} +/** Optional hooks invoked during GraphQL execution. */ +export interface ExecutionHooks { + /** Called after all tracked asynchronous execution work has settled. */ + asyncWorkFinished?: (info: AsyncWorkFinishedInfo) => void; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js new file mode 100644 index 00000000..e98380c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ExecutionArgs.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js.map new file mode 100644 index 00000000..e34d02af --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExecutionArgs.js","sourceRoot":"","sources":["../../src/execution/ExecutionArgs.ts"],"names":[],"mappings":"","sourcesContent":["/** @category Execution */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type {\n DocumentNode,\n FragmentDefinitionNode,\n OperationDefinitionNode,\n SubscriptionOperationDefinitionNode,\n} from '../language/ast.ts';\n\nimport type {\n GraphQLFieldResolver,\n GraphQLTypeResolver,\n} from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type { FragmentDetails } from './collectFields.ts';\nimport type { VariableValues } from './values.ts';\n\n/** Arguments accepted by execute and executeSync. */\nexport interface ExecutionArgs {\n /** The schema used for validation or execution. */\n schema: GraphQLSchema;\n /** The parsed GraphQL document to execute. */\n document: DocumentNode;\n /** Initial root value passed to the operation. */\n rootValue?: unknown;\n /** Application context value passed to every resolver. */\n contextValue?: unknown;\n /** Runtime variable values keyed by variable name. */\n variableValues?: Maybe<{ readonly [variable: string]: unknown }>;\n /** Name of the operation to execute when the document contains multiple operations. */\n operationName?: Maybe;\n /** Resolver used when a field does not define its own resolver. */\n fieldResolver?: Maybe>;\n /** Resolver used when an abstract type does not define its own resolver. */\n typeResolver?: Maybe>;\n /** Resolver used for the root subscription field. */\n subscribeFieldResolver?: Maybe>;\n /** Whether suggestion text should be omitted from request errors. */\n hideSuggestions?: Maybe;\n /** AbortSignal used to cancel execution. */\n abortSignal?: Maybe;\n /** Whether incremental execution may begin eligible work early. */\n enableEarlyExecution?: Maybe;\n /** Execution hooks invoked during this operation. */\n hooks?: Maybe;\n /** Additional execution options. */\n options?: {\n /**\n * Set the maximum number of errors allowed for coercing (defaults to 50).\n *\n * @internal\n */\n maxCoercionErrors?: number;\n };\n}\n\n/**\n * Data that must be available at all points during query execution.\n *\n * Namely, schema of the type system that is currently executing,\n * and the fragments defined in the query document\n */\nexport interface ValidatedExecutionArgs {\n /** Schema used for execution. */\n schema: GraphQLSchema;\n /** Parsed GraphQL document being executed. */\n document: DocumentNode;\n // TODO: consider deprecating/removing fragmentDefinitions if/when fragment\n // arguments are officially supported and/or the full fragment details are\n // exposed within GraphQLResolveInfo.\n /** Fragment definitions keyed by fragment name. */\n fragmentDefinitions: ObjMap;\n /** Fragment details keyed by fragment name. */\n fragments: ObjMap;\n /** Root value passed to the operation. */\n rootValue: unknown;\n /** Application context value passed to every resolver. */\n contextValue: unknown;\n /** Operation definition selected for execution. */\n operation: OperationDefinitionNode;\n /** Operation variable values with source metadata and coerced runtime values. */\n variableValues: VariableValues;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Resolver used for fields without an explicit resolver. */\n fieldResolver: GraphQLFieldResolver;\n /** Resolver used for abstract types without an explicit type resolver. */\n typeResolver: GraphQLTypeResolver;\n /** Resolver used for subscription fields without an explicit subscribe resolver. */\n subscribeFieldResolver: GraphQLFieldResolver;\n /** Whether suggestion text should be omitted from execution errors. */\n hideSuggestions: boolean;\n /** Whether execution should use error propagation. */\n errorPropagation: boolean;\n /** External signal that may abort execution. */\n externalAbortSignal: AbortSignal | undefined;\n /** Whether incremental execution may begin eligible work early. */\n enableEarlyExecution: boolean;\n /** Execution hooks supplied by the caller. */\n hooks: ExecutionHooks | undefined;\n}\n\n/** Validated execution arguments for a subscription operation. */\nexport interface ValidatedSubscriptionArgs extends ValidatedExecutionArgs {\n /** Subscription operation definition selected for execution. */\n operation: SubscriptionOperationDefinitionNode;\n}\n\n/** Information passed to hooks after asynchronous execution work has finished. */\nexport interface AsyncWorkFinishedInfo {\n /** Validated execution arguments for the operation that finished async work. */\n validatedExecutionArgs: ValidatedExecutionArgs;\n}\n\n/** Optional hooks invoked during GraphQL execution. */\nexport interface ExecutionHooks {\n /** Called after all tracked asynchronous execution work has settled. */\n asyncWorkFinished?: (info: AsyncWorkFinishedInfo) => void;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs new file mode 100644 index 00000000..77fcce69 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ExecutionArgs.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs.map new file mode 100644 index 00000000..e34d02af --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutionArgs.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ExecutionArgs.js","sourceRoot":"","sources":["../../src/execution/ExecutionArgs.ts"],"names":[],"mappings":"","sourcesContent":["/** @category Execution */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type {\n DocumentNode,\n FragmentDefinitionNode,\n OperationDefinitionNode,\n SubscriptionOperationDefinitionNode,\n} from '../language/ast.ts';\n\nimport type {\n GraphQLFieldResolver,\n GraphQLTypeResolver,\n} from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type { FragmentDetails } from './collectFields.ts';\nimport type { VariableValues } from './values.ts';\n\n/** Arguments accepted by execute and executeSync. */\nexport interface ExecutionArgs {\n /** The schema used for validation or execution. */\n schema: GraphQLSchema;\n /** The parsed GraphQL document to execute. */\n document: DocumentNode;\n /** Initial root value passed to the operation. */\n rootValue?: unknown;\n /** Application context value passed to every resolver. */\n contextValue?: unknown;\n /** Runtime variable values keyed by variable name. */\n variableValues?: Maybe<{ readonly [variable: string]: unknown }>;\n /** Name of the operation to execute when the document contains multiple operations. */\n operationName?: Maybe;\n /** Resolver used when a field does not define its own resolver. */\n fieldResolver?: Maybe>;\n /** Resolver used when an abstract type does not define its own resolver. */\n typeResolver?: Maybe>;\n /** Resolver used for the root subscription field. */\n subscribeFieldResolver?: Maybe>;\n /** Whether suggestion text should be omitted from request errors. */\n hideSuggestions?: Maybe;\n /** AbortSignal used to cancel execution. */\n abortSignal?: Maybe;\n /** Whether incremental execution may begin eligible work early. */\n enableEarlyExecution?: Maybe;\n /** Execution hooks invoked during this operation. */\n hooks?: Maybe;\n /** Additional execution options. */\n options?: {\n /**\n * Set the maximum number of errors allowed for coercing (defaults to 50).\n *\n * @internal\n */\n maxCoercionErrors?: number;\n };\n}\n\n/**\n * Data that must be available at all points during query execution.\n *\n * Namely, schema of the type system that is currently executing,\n * and the fragments defined in the query document\n */\nexport interface ValidatedExecutionArgs {\n /** Schema used for execution. */\n schema: GraphQLSchema;\n /** Parsed GraphQL document being executed. */\n document: DocumentNode;\n // TODO: consider deprecating/removing fragmentDefinitions if/when fragment\n // arguments are officially supported and/or the full fragment details are\n // exposed within GraphQLResolveInfo.\n /** Fragment definitions keyed by fragment name. */\n fragmentDefinitions: ObjMap;\n /** Fragment details keyed by fragment name. */\n fragments: ObjMap;\n /** Root value passed to the operation. */\n rootValue: unknown;\n /** Application context value passed to every resolver. */\n contextValue: unknown;\n /** Operation definition selected for execution. */\n operation: OperationDefinitionNode;\n /** Operation variable values with source metadata and coerced runtime values. */\n variableValues: VariableValues;\n /** Raw variable values provided by the caller before coercion. */\n rawVariableValues: Maybe<{ readonly [variable: string]: unknown }>;\n /** Resolver used for fields without an explicit resolver. */\n fieldResolver: GraphQLFieldResolver;\n /** Resolver used for abstract types without an explicit type resolver. */\n typeResolver: GraphQLTypeResolver;\n /** Resolver used for subscription fields without an explicit subscribe resolver. */\n subscribeFieldResolver: GraphQLFieldResolver;\n /** Whether suggestion text should be omitted from execution errors. */\n hideSuggestions: boolean;\n /** Whether execution should use error propagation. */\n errorPropagation: boolean;\n /** External signal that may abort execution. */\n externalAbortSignal: AbortSignal | undefined;\n /** Whether incremental execution may begin eligible work early. */\n enableEarlyExecution: boolean;\n /** Execution hooks supplied by the caller. */\n hooks: ExecutionHooks | undefined;\n}\n\n/** Validated execution arguments for a subscription operation. */\nexport interface ValidatedSubscriptionArgs extends ValidatedExecutionArgs {\n /** Subscription operation definition selected for execution. */\n operation: SubscriptionOperationDefinitionNode;\n}\n\n/** Information passed to hooks after asynchronous execution work has finished. */\nexport interface AsyncWorkFinishedInfo {\n /** Validated execution arguments for the operation that finished async work. */\n validatedExecutionArgs: ValidatedExecutionArgs;\n}\n\n/** Optional hooks invoked during GraphQL execution. */\nexport interface ExecutionHooks {\n /** Called after all tracked asynchronous execution work has settled. */\n asyncWorkFinished?: (info: AsyncWorkFinishedInfo) => void;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.mts new file mode 100644 index 00000000..40a2f4d8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.mts @@ -0,0 +1,233 @@ +/** @category Execution */ +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { Path } from "../jsutils/Path.mjs"; +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.mjs"; +import type { GraphQLFormattedError } from "../error/GraphQLError.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import type { GraphQLAbstractType, GraphQLLeafType, GraphQLList, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo, GraphQLResolveInfoHelpers } from "../type/definition.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { GraphQLExecuteRootSelectionSetContext, GraphQLResolveContext, MinimalTracingChannel } from "../diagnostics.mjs"; +import { AbortedGraphQLExecutionError } from "./AbortedGraphQLExecutionError.mjs"; +import type { DeferUsage, FieldDetailsList, GroupedFieldSet } from "./collectFields.mjs"; +import { collectSubfields as _collectSubfields } from "./collectFields.mjs"; +import type { SharedExecutionContext } from "./createSharedExecutionContext.mjs"; +import type { ValidatedExecutionArgs } from "./ExecutionArgs.mjs"; +import type { StreamUsage } from "./getStreamUsage.mjs"; +import { getStreamUsage as _getStreamUsage } from "./getStreamUsage.mjs"; +/** + * Terminology + * + * "Definitions" are the generic name for top-level statements in the document. + * Examples of this include: + * 1) Operations (such as a query) + * 2) Fragments + * + * "Operations" are a generic name for requests in the document. + * Examples of this include: + * 1) query, + * 2) mutation + * + * "Selections" are the definitions that can appear legally and at + * single level of the query. These include: + * 1) field references e.g `a` + * 2) fragment "spreads" e.g. `...c` + * 3) inline fragment "spreads" e.g. `...on Type { a }` + * + * @internal + */ +/** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + * + * @internal + */ +export declare const collectSubfields: (validatedExecutionArgs: ValidatedExecutionArgs, returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList) => ReturnType; +/** @internal */ +export declare const getStreamUsage: typeof _getStreamUsage; +declare class CollectedErrors { + private _errorPositions; + private _errors; + constructor(); + get errors(): ReadonlyArray; + add(error: GraphQLError, path: Path | undefined): void; + hasNulledPosition(startPath: Path | undefined): boolean; +} +/** + * Represents the response produced by executing a GraphQL operation. + * @typeParam TData - Shape of the execution data payload. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface ExecutionResult, TExtensions = ObjMap> { + /** Errors raised while parsing, validating, or executing the operation. */ + errors?: ReadonlyArray; + /** Data returned by execution, or null when execution could not produce data. */ + data?: TData | null; + /** Additional non-standard metadata included in the execution result. */ + extensions?: TExtensions; +} +/** + * A JSON-serializable GraphQL execution result. + * @typeParam TData - Shape of the formatted data payload. + * @typeParam TExtensions - Shape of the formatted extensions payload. + */ +export interface FormattedExecutionResult, TExtensions = ObjMap> { + /** Errors raised while parsing, validating, or executing the operation. */ + errors?: ReadonlyArray; + /** Data returned by execution, or null when execution could not produce data. */ + data?: TData | null; + /** Additional non-standard metadata included in the formatted result. */ + extensions?: TExtensions; +} +/** @internal */ +export declare class Executor { + validatedExecutionArgs: ValidatedExecutionArgs; + aborted: boolean; + abortReason: unknown; + sharedExecutionContext: SharedExecutionContext; + collectedErrors: CollectedErrors; + abortResultPromise: (() => void) | undefined; + resolverAbortController: AbortController | undefined; + getAbortSignal: () => AbortSignal | undefined; + getAsyncHelpers: () => GraphQLResolveInfoHelpers; + promiseAll: (values: ReadonlyArray>) => Promise>; + constructor(validatedExecutionArgs: ValidatedExecutionArgs, sharedExecutionContext?: SharedExecutionContext); + executeRootSelectionSet(serially?: boolean): PromiseOrValue; + /** + * Build a root-selection-set tracing context from validated execution + * arguments. The operation has already been selected during argument + * validation. + * @internal + */ + buildExecuteContextFromValidatedArgs(args: ValidatedExecutionArgs): GraphQLExecuteRootSelectionSetContext; + executeRootSelectionSetImpl(serially?: boolean): PromiseOrValue; + abort(reason?: unknown): void; + finish(result: T): T; + createAbortedExecutionError(result: PromiseOrValue): AbortedGraphQLExecutionError; + getFinishSharedExecution(): () => void; + /** + * Given a completed execution context and data, build the `{ errors, data }` + * response defined by the "Response" section of the GraphQL specification. + * + * @internal + */ + buildResponse(data: ObjMap | null): ExecutionResult | TAlternativeInitialResponse; + executeCollectedRootFields(rootType: GraphQLObjectType, rootValue: unknown, originalGroupedFieldSet: GroupedFieldSet, serially: boolean, _newDeferUsages: ReadonlyArray): PromiseOrValue>; + executeRootGroupedFieldSet(rootType: GraphQLObjectType, rootValue: unknown, groupedFieldSet: GroupedFieldSet, serially: boolean, positionContext?: TPositionContext): PromiseOrValue>; + /** + * Implements the "Executing selection sets" section of the spec + * for fields that must be executed serially. + * + * @internal + */ + executeFieldsSerially(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, groupedFieldSet: GroupedFieldSet, positionContext: TPositionContext | undefined): PromiseOrValue>; + /** + * Implements the "Executing selection sets" section of the spec + * for fields that may be executed in parallel. + * + * @internal + */ + executeFields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, groupedFieldSet: GroupedFieldSet, positionContext: TPositionContext | undefined): PromiseOrValue>; + /** + * Implements the "Executing fields" section of the spec + * In particular, this function figures out the value that the field returns by + * calling its resolve function, then calls completeValue to complete promises, + * coercing scalars, or execute the sub-selection-set for objects. + * + * @internal + */ + executeField(parentType: GraphQLObjectType, source: unknown, fieldDetailsList: FieldDetailsList, path: Path, positionContext: TPositionContext | undefined, tracingChannel: MinimalTracingChannel | undefined): PromiseOrValue; + /** + * Build a graphql:resolve channel context for a single field invocation. + * + * `fieldPath` is exposed as a lazy getter because serializing the response + * path is O(depth) and APMs that depth-filter or skip default resolvers + * often never read it. `args` is passed through by reference. + * @internal + */ + buildResolveContext(args: ObjMap, info: GraphQLResolveInfo, isDefaultResolver: boolean): GraphQLResolveContext; + handleFieldError(rawError: unknown, returnType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, path: Path): void; + /** + * Implements the instructions for completeValue as defined in the + * "Value Completion" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `coerceOutputValue` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by executing all sub-selections. + * + * @internal + */ + completeValue(returnType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue; + completePromisedValue(returnType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: PromiseLike, positionContext: TPositionContext | undefined): Promise; + /** + * Complete a async iterator value by completing the result and calling + * recursively until all the results are completed. + * + * @internal + */ + completeAsyncIterableValue(itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, items: AsyncIterable, positionContext: TPositionContext | undefined): Promise>; + handleStream(_index: number, _path: Path, _iterator: { + handle: Iterator; + isAsync?: never; + } | { + handle: AsyncIterator; + isAsync: true; + }, _streamUsage: StreamUsage, _info: GraphQLResolveInfo, _itemType: GraphQLOutputType): boolean; + /** + * Complete a list value by completing each item in the list with the + * inner type + * + * @internal + */ + completeListValue(returnType: GraphQLList, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + completeIterableValue(itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, items: Iterable, positionContext: TPositionContext | undefined): PromiseOrValue>; + completeMaybePromisedListItemValue(item: unknown, completedResults: Array, itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemPath: Path, positionContext: TPositionContext | undefined): boolean; + /** + * Complete a list item value by adding it to the completed results. + * + * Returns true if the value is a Promise. + * + * @internal + */ + completeListItemValue(item: unknown, completedResults: Array, itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemPath: Path, positionContext: TPositionContext | undefined): boolean; + completePromisedListItemValue(item: PromiseLike, itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemPath: Path, positionContext: TPositionContext | undefined): Promise; + /** + * Complete a Scalar or Enum by serializing to a valid value, returning + * null if serialization is not possible. + * + * @internal + */ + completeLeafValue(returnType: GraphQLLeafType, result: unknown): unknown; + /** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + * + * @internal + */ + completeAbstractValue(returnType: GraphQLAbstractType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + ensureValidRuntimeType(runtimeTypeName: unknown, schema: GraphQLSchema, returnType: GraphQLAbstractType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, result: unknown): GraphQLObjectType; + /** + * Complete an Object value by executing all sub-selections. + * + * @internal + */ + completeObjectValue(returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + invalidReturnTypeError(returnType: GraphQLObjectType, result: unknown, fieldDetailsList: FieldDetailsList): GraphQLError; + collectAndExecuteSubfields(returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + executeCollectedSubfields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, originalGroupedFieldSet: GroupedFieldSet, _newDeferUsages: ReadonlyArray, _positionContext: TPositionContext | undefined): PromiseOrValue>; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.ts new file mode 100644 index 00000000..2790e804 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.d.ts @@ -0,0 +1,233 @@ +/** @category Execution */ +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { Path } from "../jsutils/Path.js"; +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.js"; +import type { GraphQLFormattedError } from "../error/GraphQLError.js"; +import { GraphQLError } from "../error/GraphQLError.js"; +import type { GraphQLAbstractType, GraphQLLeafType, GraphQLList, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo, GraphQLResolveInfoHelpers } from "../type/definition.js"; +import type { GraphQLSchema } from "../type/schema.js"; +import type { GraphQLExecuteRootSelectionSetContext, GraphQLResolveContext, MinimalTracingChannel } from "../diagnostics.js"; +import { AbortedGraphQLExecutionError } from "./AbortedGraphQLExecutionError.js"; +import type { DeferUsage, FieldDetailsList, GroupedFieldSet } from "./collectFields.js"; +import { collectSubfields as _collectSubfields } from "./collectFields.js"; +import type { SharedExecutionContext } from "./createSharedExecutionContext.js"; +import type { ValidatedExecutionArgs } from "./ExecutionArgs.js"; +import type { StreamUsage } from "./getStreamUsage.js"; +import { getStreamUsage as _getStreamUsage } from "./getStreamUsage.js"; +/** + * Terminology + * + * "Definitions" are the generic name for top-level statements in the document. + * Examples of this include: + * 1) Operations (such as a query) + * 2) Fragments + * + * "Operations" are a generic name for requests in the document. + * Examples of this include: + * 1) query, + * 2) mutation + * + * "Selections" are the definitions that can appear legally and at + * single level of the query. These include: + * 1) field references e.g `a` + * 2) fragment "spreads" e.g. `...c` + * 3) inline fragment "spreads" e.g. `...on Type { a }` + * + * @internal + */ +/** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + * + * @internal + */ +export declare const collectSubfields: (validatedExecutionArgs: ValidatedExecutionArgs, returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList) => ReturnType; +/** @internal */ +export declare const getStreamUsage: typeof _getStreamUsage; +declare class CollectedErrors { + private _errorPositions; + private _errors; + constructor(); + get errors(): ReadonlyArray; + add(error: GraphQLError, path: Path | undefined): void; + hasNulledPosition(startPath: Path | undefined): boolean; +} +/** + * Represents the response produced by executing a GraphQL operation. + * @typeParam TData - Shape of the execution data payload. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface ExecutionResult, TExtensions = ObjMap> { + /** Errors raised while parsing, validating, or executing the operation. */ + errors?: ReadonlyArray; + /** Data returned by execution, or null when execution could not produce data. */ + data?: TData | null; + /** Additional non-standard metadata included in the execution result. */ + extensions?: TExtensions; +} +/** + * A JSON-serializable GraphQL execution result. + * @typeParam TData - Shape of the formatted data payload. + * @typeParam TExtensions - Shape of the formatted extensions payload. + */ +export interface FormattedExecutionResult, TExtensions = ObjMap> { + /** Errors raised while parsing, validating, or executing the operation. */ + errors?: ReadonlyArray; + /** Data returned by execution, or null when execution could not produce data. */ + data?: TData | null; + /** Additional non-standard metadata included in the formatted result. */ + extensions?: TExtensions; +} +/** @internal */ +export declare class Executor { + validatedExecutionArgs: ValidatedExecutionArgs; + aborted: boolean; + abortReason: unknown; + sharedExecutionContext: SharedExecutionContext; + collectedErrors: CollectedErrors; + abortResultPromise: (() => void) | undefined; + resolverAbortController: AbortController | undefined; + getAbortSignal: () => AbortSignal | undefined; + getAsyncHelpers: () => GraphQLResolveInfoHelpers; + promiseAll: (values: ReadonlyArray>) => Promise>; + constructor(validatedExecutionArgs: ValidatedExecutionArgs, sharedExecutionContext?: SharedExecutionContext); + executeRootSelectionSet(serially?: boolean): PromiseOrValue; + /** + * Build a root-selection-set tracing context from validated execution + * arguments. The operation has already been selected during argument + * validation. + * @internal + */ + buildExecuteContextFromValidatedArgs(args: ValidatedExecutionArgs): GraphQLExecuteRootSelectionSetContext; + executeRootSelectionSetImpl(serially?: boolean): PromiseOrValue; + abort(reason?: unknown): void; + finish(result: T): T; + createAbortedExecutionError(result: PromiseOrValue): AbortedGraphQLExecutionError; + getFinishSharedExecution(): () => void; + /** + * Given a completed execution context and data, build the `{ errors, data }` + * response defined by the "Response" section of the GraphQL specification. + * + * @internal + */ + buildResponse(data: ObjMap | null): ExecutionResult | TAlternativeInitialResponse; + executeCollectedRootFields(rootType: GraphQLObjectType, rootValue: unknown, originalGroupedFieldSet: GroupedFieldSet, serially: boolean, _newDeferUsages: ReadonlyArray): PromiseOrValue>; + executeRootGroupedFieldSet(rootType: GraphQLObjectType, rootValue: unknown, groupedFieldSet: GroupedFieldSet, serially: boolean, positionContext?: TPositionContext): PromiseOrValue>; + /** + * Implements the "Executing selection sets" section of the spec + * for fields that must be executed serially. + * + * @internal + */ + executeFieldsSerially(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, groupedFieldSet: GroupedFieldSet, positionContext: TPositionContext | undefined): PromiseOrValue>; + /** + * Implements the "Executing selection sets" section of the spec + * for fields that may be executed in parallel. + * + * @internal + */ + executeFields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, groupedFieldSet: GroupedFieldSet, positionContext: TPositionContext | undefined): PromiseOrValue>; + /** + * Implements the "Executing fields" section of the spec + * In particular, this function figures out the value that the field returns by + * calling its resolve function, then calls completeValue to complete promises, + * coercing scalars, or execute the sub-selection-set for objects. + * + * @internal + */ + executeField(parentType: GraphQLObjectType, source: unknown, fieldDetailsList: FieldDetailsList, path: Path, positionContext: TPositionContext | undefined, tracingChannel: MinimalTracingChannel | undefined): PromiseOrValue; + /** + * Build a graphql:resolve channel context for a single field invocation. + * + * `fieldPath` is exposed as a lazy getter because serializing the response + * path is O(depth) and APMs that depth-filter or skip default resolvers + * often never read it. `args` is passed through by reference. + * @internal + */ + buildResolveContext(args: ObjMap, info: GraphQLResolveInfo, isDefaultResolver: boolean): GraphQLResolveContext; + handleFieldError(rawError: unknown, returnType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, path: Path): void; + /** + * Implements the instructions for completeValue as defined in the + * "Value Completion" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `coerceOutputValue` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by executing all sub-selections. + * + * @internal + */ + completeValue(returnType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue; + completePromisedValue(returnType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: PromiseLike, positionContext: TPositionContext | undefined): Promise; + /** + * Complete a async iterator value by completing the result and calling + * recursively until all the results are completed. + * + * @internal + */ + completeAsyncIterableValue(itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, items: AsyncIterable, positionContext: TPositionContext | undefined): Promise>; + handleStream(_index: number, _path: Path, _iterator: { + handle: Iterator; + isAsync?: never; + } | { + handle: AsyncIterator; + isAsync: true; + }, _streamUsage: StreamUsage, _info: GraphQLResolveInfo, _itemType: GraphQLOutputType): boolean; + /** + * Complete a list value by completing each item in the list with the + * inner type + * + * @internal + */ + completeListValue(returnType: GraphQLList, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + completeIterableValue(itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, items: Iterable, positionContext: TPositionContext | undefined): PromiseOrValue>; + completeMaybePromisedListItemValue(item: unknown, completedResults: Array, itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemPath: Path, positionContext: TPositionContext | undefined): boolean; + /** + * Complete a list item value by adding it to the completed results. + * + * Returns true if the value is a Promise. + * + * @internal + */ + completeListItemValue(item: unknown, completedResults: Array, itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemPath: Path, positionContext: TPositionContext | undefined): boolean; + completePromisedListItemValue(item: PromiseLike, itemType: GraphQLOutputType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemPath: Path, positionContext: TPositionContext | undefined): Promise; + /** + * Complete a Scalar or Enum by serializing to a valid value, returning + * null if serialization is not possible. + * + * @internal + */ + completeLeafValue(returnType: GraphQLLeafType, result: unknown): unknown; + /** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + * + * @internal + */ + completeAbstractValue(returnType: GraphQLAbstractType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + ensureValidRuntimeType(runtimeTypeName: unknown, schema: GraphQLSchema, returnType: GraphQLAbstractType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, result: unknown): GraphQLObjectType; + /** + * Complete an Object value by executing all sub-selections. + * + * @internal + */ + completeObjectValue(returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + invalidReturnTypeError(returnType: GraphQLObjectType, result: unknown, fieldDetailsList: FieldDetailsList): GraphQLError; + collectAndExecuteSubfields(returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList, path: Path, result: unknown, positionContext: TPositionContext | undefined): PromiseOrValue>; + executeCollectedSubfields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, originalGroupedFieldSet: GroupedFieldSet, _newDeferUsages: ReadonlyArray, _positionContext: TPositionContext | undefined): PromiseOrValue>; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js new file mode 100644 index 00000000..9bafd5ed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js @@ -0,0 +1,578 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Executor = exports.getStreamUsage = exports.collectSubfields = void 0; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const isAsyncIterable_ts_1 = require("../jsutils/isAsyncIterable.js"); +const isIterableObject_ts_1 = require("../jsutils/isIterableObject.js"); +const isPromise_ts_1 = require("../jsutils/isPromise.js"); +const memoize2_ts_1 = require("../jsutils/memoize2.js"); +const memoize3_ts_1 = require("../jsutils/memoize3.js"); +const Path_ts_1 = require("../jsutils/Path.js"); +const promiseForObject_ts_1 = require("../jsutils/promiseForObject.js"); +const promiseReduce_ts_1 = require("../jsutils/promiseReduce.js"); +const ensureGraphQLError_ts_1 = require("../error/ensureGraphQLError.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const locatedError_ts_1 = require("../error/locatedError.js"); +const ast_ts_1 = require("../language/ast.js"); +const definition_ts_1 = require("../type/definition.js"); +const diagnostics_ts_1 = require("../diagnostics.js"); +const AbortedGraphQLExecutionError_ts_1 = require("./AbortedGraphQLExecutionError.js"); +const buildResolveInfo_ts_1 = require("./buildResolveInfo.js"); +const cancellablePromise_ts_1 = require("./cancellablePromise.js"); +const collectFields_ts_1 = require("./collectFields.js"); +const collectIteratorPromises_ts_1 = require("./collectIteratorPromises.js"); +const createSharedExecutionContext_ts_1 = require("./createSharedExecutionContext.js"); +const getStreamUsage_ts_1 = require("./getStreamUsage.js"); +const hooks_ts_1 = require("./hooks.js"); +const returnIteratorCatchingErrors_ts_1 = require("./returnIteratorCatchingErrors.js"); +const values_ts_1 = require("./values.js"); +exports.collectSubfields = (0, memoize3_ts_1.memoize3)((validatedExecutionArgs, returnType, fieldDetailsList) => { + const { schema, fragments, variableValues, hideSuggestions } = validatedExecutionArgs; + return (0, collectFields_ts_1.collectSubfields)(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions); +}); +exports.getStreamUsage = (0, memoize2_ts_1.memoize2)((validatedExecutionArgs, fieldDetailsList) => (0, getStreamUsage_ts_1.getStreamUsage)(validatedExecutionArgs, fieldDetailsList)); +class CollectedErrors { + constructor() { + this._errorPositions = new Set(); + this._errors = []; + } + get errors() { + return this._errors; + } + add(error, path) { + if (this.hasNulledPosition(path)) { + return; + } + this._errorPositions.add(path); + this._errors.push(error); + } + hasNulledPosition(startPath) { + let path = startPath; + while (path !== undefined) { + if (this._errorPositions.has(path)) { + return true; + } + path = path.prev; + } + return this._errorPositions.has(undefined); + } +} +const defaultAbortReason = new Error('This operation was aborted'); +class Executor { + constructor(validatedExecutionArgs, sharedExecutionContext) { + this.validatedExecutionArgs = validatedExecutionArgs; + this.aborted = false; + this.abortReason = defaultAbortReason; + this.collectedErrors = new CollectedErrors(); + if (sharedExecutionContext === undefined) { + this.resolverAbortController = new AbortController(); + this.sharedExecutionContext = (0, createSharedExecutionContext_ts_1.createSharedExecutionContext)(this.resolverAbortController.signal); + } + else { + this.sharedExecutionContext = sharedExecutionContext; + } + const { getAbortSignal, getAsyncHelpers, promiseAll } = this.sharedExecutionContext; + this.getAbortSignal = getAbortSignal; + this.getAsyncHelpers = getAsyncHelpers; + this.promiseAll = promiseAll; + } + executeRootSelectionSet(serially) { + if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.executeRootSelectionSetChannel)) { + return this.executeRootSelectionSetImpl(serially); + } + return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.executeRootSelectionSetChannel, this.buildExecuteContextFromValidatedArgs(this.validatedExecutionArgs), () => this.executeRootSelectionSetImpl(serially)); + } + buildExecuteContextFromValidatedArgs(args) { + return { + schema: args.schema, + document: args.document, + operation: args.operation, + rawVariableValues: args.rawVariableValues, + operationName: args.operation.name?.value, + operationType: args.operation.operation, + }; + } + executeRootSelectionSetImpl(serially) { + const externalAbortSignal = this.validatedExecutionArgs.externalAbortSignal; + let removeExternalAbortListener; + if (externalAbortSignal) { + externalAbortSignal.throwIfAborted(); + const onExternalAbort = () => { + this.abort(externalAbortSignal.reason); + }; + removeExternalAbortListener = () => externalAbortSignal.removeEventListener('abort', onExternalAbort); + externalAbortSignal.addEventListener('abort', onExternalAbort); + } + const maybeRemoveExternalAbortListener = () => { + removeExternalAbortListener?.(); + }; + let result; + try { + const { schema, fragments, rootValue, operation, variableValues, hideSuggestions, } = this.validatedExecutionArgs; + const { operation: operationType, selectionSet } = operation; + const rootType = schema.getRootType(operationType); + if (rootType == null) { + throw new GraphQLError_ts_1.GraphQLError(`Schema is not configured to execute ${operationType} operation.`, { nodes: operation }); + } + const { groupedFieldSet, newDeferUsages } = (0, collectFields_ts_1.collectFields)(schema, fragments, variableValues, rootType, selectionSet, hideSuggestions); + result = this.executeCollectedRootFields(rootType, rootValue, groupedFieldSet, serially ?? operationType === ast_ts_1.OperationTypeNode.MUTATION, newDeferUsages); + if ((0, isPromise_ts_1.isPromise)(result)) { + const promise = result.then((data) => { + maybeRemoveExternalAbortListener(); + return this.buildResponse(data); + }, (error) => { + maybeRemoveExternalAbortListener(); + this.collectedErrors.add((0, ensureGraphQLError_ts_1.ensureGraphQLError)(error), undefined); + return this.buildResponse(null); + }); + this.sharedExecutionContext.asyncWorkTracker.add(promise); + const { promise: cancellablePromise, abort: abortResultPromise } = (0, cancellablePromise_ts_1.withCancellation)(promise.then((resolved) => this.finish(resolved))); + this.abortResultPromise = () => { + abortResultPromise(this.createAbortedExecutionError(promise)); + }; + if (this.aborted) { + this.abortResultPromise(); + } + return cancellablePromise; + } + maybeRemoveExternalAbortListener(); + } + catch (error) { + maybeRemoveExternalAbortListener(); + this.collectedErrors.add((0, ensureGraphQLError_ts_1.ensureGraphQLError)(error), undefined); + return this.finish(this.buildResponse(null)); + } + return this.finish(this.buildResponse(result)); + } + abort(reason) { + if (this.aborted) { + return; + } + this.aborted = true; + if (reason !== undefined) { + this.abortReason = reason; + } + this.abortResultPromise?.(); + this.resolverAbortController?.abort(this.abortReason); + } + finish(result) { + if (this.aborted) { + throw this.createAbortedExecutionError(result); + } + this.aborted = true; + return result; + } + createAbortedExecutionError(result) { + return new AbortedGraphQLExecutionError_ts_1.AbortedGraphQLExecutionError(this.abortReason, result); + } + getFinishSharedExecution() { + const resolverAbortController = this.resolverAbortController; + const asyncWorkFinishedHook = this.validatedExecutionArgs.hooks?.asyncWorkFinished; + if (asyncWorkFinishedHook === undefined) { + return () => resolverAbortController?.abort(); + } + const validatedExecutionArgs = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + return () => { + resolverAbortController?.abort(); + (0, hooks_ts_1.runAsyncWorkFinishedHook)(validatedExecutionArgs, sharedExecutionContext, asyncWorkFinishedHook); + }; + } + buildResponse(data) { + this.getFinishSharedExecution()(); + const errors = this.collectedErrors.errors; + return errors.length ? { errors, data } : { data }; + } + executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, _newDeferUsages) { + return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, undefined); + } + executeRootGroupedFieldSet(rootType, rootValue, groupedFieldSet, serially, positionContext) { + return serially + ? this.executeFieldsSerially(rootType, rootValue, undefined, groupedFieldSet, positionContext) + : this.executeFields(rootType, rootValue, undefined, groupedFieldSet, positionContext); + } + executeFieldsSerially(parentType, sourceValue, path, groupedFieldSet, positionContext) { + let tracingChannel = (0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.resolveChannel) + ? diagnostics_ts_1.resolveChannel + : undefined; + return (0, promiseReduce_ts_1.promiseReduce)(groupedFieldSet, (results, [responseName, fieldDetailsList]) => { + if (this.aborted) { + throw new Error('Aborted!'); + } + const fieldPath = (0, Path_ts_1.addPath)(path, responseName, parentType.name); + const result = this.executeField(parentType, sourceValue, fieldDetailsList, fieldPath, positionContext, tracingChannel); + if (result === undefined) { + return results; + } + if ((0, isPromise_ts_1.isPromise)(result)) { + return result.then((resolved) => { + results[responseName] = resolved; + tracingChannel = (0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.resolveChannel) + ? diagnostics_ts_1.resolveChannel + : undefined; + return results; + }); + } + results[responseName] = result; + return results; + }, Object.create(null)); + } + executeFields(parentType, sourceValue, path, groupedFieldSet, positionContext) { + const results = Object.create(null); + let containsPromise = false; + const tracingChannel = (0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.resolveChannel) + ? diagnostics_ts_1.resolveChannel + : undefined; + try { + for (const [responseName, fieldDetailsList] of groupedFieldSet) { + const fieldPath = (0, Path_ts_1.addPath)(path, responseName, parentType.name); + const result = this.executeField(parentType, sourceValue, fieldDetailsList, fieldPath, positionContext, tracingChannel); + if (result !== undefined) { + results[responseName] = result; + if ((0, isPromise_ts_1.isPromise)(result)) { + containsPromise = true; + } + } + } + } + catch (error) { + if (containsPromise) { + this.sharedExecutionContext.asyncWorkTracker.addValues(Object.values(results)); + } + throw error; + } + if (!containsPromise) { + return results; + } + return (0, promiseForObject_ts_1.promiseForObject)(results, this.promiseAll); + } + executeField(parentType, source, fieldDetailsList, path, positionContext, tracingChannel) { + const validatedExecutionArgs = this.validatedExecutionArgs; + const { schema, contextValue, variableValues, hideSuggestions } = validatedExecutionArgs; + const firstFieldDetails = fieldDetailsList[0]; + const firstNode = firstFieldDetails.node; + const fieldName = firstNode.name.value; + const fieldDef = schema.getField(parentType, fieldName); + if (!fieldDef) { + return; + } + const returnType = fieldDef.type; + let resolveFn = fieldDef.resolve ?? validatedExecutionArgs.fieldResolver; + if (tracingChannel !== undefined) { + const originalResolveFn = resolveFn; + resolveFn = (s, args, c, info) => (0, diagnostics_ts_1.traceMixed)(tracingChannel, this.buildResolveContext(args, info, fieldDef.resolve === undefined), () => originalResolveFn(s, args, c, info)); + } + const info = (0, buildResolveInfo_ts_1.buildResolveInfo)(validatedExecutionArgs, fieldDef, toNodes(fieldDetailsList), parentType, path, this.getAbortSignal, this.getAsyncHelpers); + try { + const args = (0, values_ts_1.getArgumentValues)(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions); + const result = resolveFn(source, args, contextValue, info); + if ((0, isPromise_ts_1.isPromiseLike)(result)) { + return this.completePromisedValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + const completed = this.completeValue(returnType, fieldDetailsList, info, path, result, positionContext); + if ((0, isPromise_ts_1.isPromise)(completed)) { + return completed.then(undefined, (rawError) => { + this.handleFieldError(rawError, returnType, fieldDetailsList, path); + return null; + }); + } + return completed; + } + catch (rawError) { + this.handleFieldError(rawError, returnType, fieldDetailsList, path); + return null; + } + } + buildResolveContext(args, info, isDefaultResolver) { + let cachedFieldPath; + return { + fieldName: info.fieldName, + alias: String(info.path.key), + parentType: info.parentType.name, + fieldType: String(info.returnType), + args, + isDefaultResolver, + get fieldPath() { + cachedFieldPath ??= (0, Path_ts_1.pathToArray)(info.path).join('.'); + return cachedFieldPath; + }, + }; + } + handleFieldError(rawError, returnType, fieldDetailsList, path) { + const error = (0, locatedError_ts_1.locatedError)(rawError, toNodes(fieldDetailsList), (0, Path_ts_1.pathToArray)(path)); + if (this.validatedExecutionArgs.errorPropagation && + (0, definition_ts_1.isNonNullType)(returnType)) { + throw error; + } + this.collectedErrors.add(error, path); + } + completeValue(returnType, fieldDetailsList, info, path, result, positionContext) { + if (result instanceof Error) { + throw result; + } + if ((0, definition_ts_1.isNonNullType)(returnType)) { + const completed = this.completeValue(returnType.ofType, fieldDetailsList, info, path, result, positionContext); + if (completed === null) { + throw new Error(`Cannot return null for non-nullable field ${info.parentType}.${info.fieldName}.`); + } + return completed; + } + if (result == null) { + return null; + } + if ((0, definition_ts_1.isListType)(returnType)) { + return this.completeListValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + if ((0, definition_ts_1.isLeafType)(returnType)) { + return this.completeLeafValue(returnType, result); + } + if ((0, definition_ts_1.isAbstractType)(returnType)) { + return this.completeAbstractValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + if ((0, definition_ts_1.isObjectType)(returnType)) { + return this.completeObjectValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + (0, invariant_ts_1.invariant)(false, 'Cannot complete value of unexpected output type: ' + (0, inspect_ts_1.inspect)(returnType)); + } + async completePromisedValue(returnType, fieldDetailsList, info, path, result, positionContext) { + try { + const resolved = await result; + if (this.aborted) { + throw new Error('Aborted!'); + } + let completed = this.completeValue(returnType, fieldDetailsList, info, path, resolved, positionContext); + if ((0, isPromise_ts_1.isPromise)(completed)) { + completed = await completed; + } + return completed; + } + catch (rawError) { + this.handleFieldError(rawError, returnType, fieldDetailsList, path); + return null; + } + } + async completeAsyncIterableValue(itemType, fieldDetailsList, info, path, items, positionContext) { + const streamUsage = typeof path.key === 'number' + ? undefined + : (0, exports.getStreamUsage)(this.validatedExecutionArgs, fieldDetailsList); + let containsPromise = false; + const completedResults = []; + const asyncIterator = items[Symbol.asyncIterator](); + let index = 0; + let iteration; + try { + while (true) { + if (streamUsage?.initialCount === index && + this.handleStream(index, path, { handle: asyncIterator, isAsync: true }, streamUsage, info, itemType)) { + break; + } + const itemPath = (0, Path_ts_1.addPath)(path, index, undefined); + try { + iteration = await asyncIterator.next(); + } + catch (rawError) { + throw (0, locatedError_ts_1.locatedError)(rawError, toNodes(fieldDetailsList), (0, Path_ts_1.pathToArray)(path)); + } + if (this.aborted || iteration.done) { + break; + } + const item = iteration.value; + if (this.completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) { + containsPromise = true; + } + index++; + } + } + catch (error) { + this.sharedExecutionContext.asyncWorkTracker.add((0, returnIteratorCatchingErrors_ts_1.returnIteratorCatchingErrors)(asyncIterator)); + if (containsPromise) { + this.sharedExecutionContext.asyncWorkTracker.addValues(completedResults); + } + throw error; + } + if (this.aborted) { + if (!iteration?.done) { + this.sharedExecutionContext.asyncWorkTracker.add((0, returnIteratorCatchingErrors_ts_1.returnIteratorCatchingErrors)(asyncIterator)); + } + throw new Error('Aborted!'); + } + return containsPromise + ? this.promiseAll(completedResults) + : completedResults; + } + handleStream(_index, _path, _iterator, _streamUsage, _info, _itemType) { + return false; + } + completeListValue(returnType, fieldDetailsList, info, path, result, positionContext) { + const itemType = returnType.ofType; + if ((0, isAsyncIterable_ts_1.isAsyncIterable)(result)) { + return this.completeAsyncIterableValue(itemType, fieldDetailsList, info, path, result, positionContext); + } + if (!(0, isIterableObject_ts_1.isIterableObject)(result)) { + throw new GraphQLError_ts_1.GraphQLError(`Expected Iterable, but did not find one for field "${info.parentType}.${info.fieldName}".`); + } + return this.completeIterableValue(itemType, fieldDetailsList, info, path, result, positionContext); + } + completeIterableValue(itemType, fieldDetailsList, info, path, items, positionContext) { + const streamUsage = typeof path.key === 'number' + ? undefined + : (0, exports.getStreamUsage)(this.validatedExecutionArgs, fieldDetailsList); + let containsPromise = false; + const completedResults = []; + let index = 0; + const iterator = items[Symbol.iterator](); + try { + while (true) { + if (streamUsage?.initialCount === index && + this.handleStream(index, path, { handle: iterator }, streamUsage, info, itemType)) { + break; + } + const iteration = iterator.next(); + if (iteration.done) { + break; + } + const item = iteration.value; + const itemPath = (0, Path_ts_1.addPath)(path, index, undefined); + if (this.completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) { + containsPromise = true; + } + index++; + } + } + catch (error) { + const asyncWorkTracker = this.sharedExecutionContext.asyncWorkTracker; + if (containsPromise) { + asyncWorkTracker.addValues(completedResults); + } + asyncWorkTracker.addValues((0, collectIteratorPromises_ts_1.collectIteratorPromises)(iterator)); + throw error; + } + return containsPromise + ? this.promiseAll(completedResults) + : completedResults; + } + completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext) { + if ((0, isPromise_ts_1.isPromiseLike)(item)) { + completedResults.push(this.completePromisedListItemValue(item, itemType, fieldDetailsList, info, itemPath, positionContext)); + return true; + } + else if (this.completeListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) { + return true; + } + return false; + } + completeListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext) { + try { + const completedItem = this.completeValue(itemType, fieldDetailsList, info, itemPath, item, positionContext); + if ((0, isPromise_ts_1.isPromise)(completedItem)) { + completedResults.push(completedItem.then(undefined, (rawError) => { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return null; + })); + return true; + } + completedResults.push(completedItem); + } + catch (rawError) { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + completedResults.push(null); + } + return false; + } + async completePromisedListItemValue(item, itemType, fieldDetailsList, info, itemPath, positionContext) { + try { + const resolved = await item; + if (this.aborted) { + throw new Error('Aborted!'); + } + let completed = this.completeValue(itemType, fieldDetailsList, info, itemPath, resolved, positionContext); + if ((0, isPromise_ts_1.isPromise)(completed)) { + completed = await completed; + } + return completed; + } + catch (rawError) { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return null; + } + } + completeLeafValue(returnType, result) { + const coerced = returnType.coerceOutputValue(result); + if (coerced == null) { + throw new Error(`Expected \`${(0, inspect_ts_1.inspect)(returnType)}.coerceOutputValue(${(0, inspect_ts_1.inspect)(result)})\` to ` + + `return non-nullable value, returned: ${(0, inspect_ts_1.inspect)(coerced)}`); + } + return coerced; + } + completeAbstractValue(returnType, fieldDetailsList, info, path, result, positionContext) { + const validatedExecutionArgs = this.validatedExecutionArgs; + const { schema, contextValue } = validatedExecutionArgs; + const resolveTypeFn = returnType.resolveType ?? validatedExecutionArgs.typeResolver; + const runtimeType = resolveTypeFn(result, contextValue, info, returnType); + if ((0, isPromise_ts_1.isPromiseLike)(runtimeType)) { + return runtimeType.then((resolvedRuntimeType) => { + if (this.aborted) { + throw new Error('Aborted!'); + } + return this.completeObjectValue(this.ensureValidRuntimeType(resolvedRuntimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, positionContext); + }); + } + return this.completeObjectValue(this.ensureValidRuntimeType(runtimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, positionContext); + } + ensureValidRuntimeType(runtimeTypeName, schema, returnType, fieldDetailsList, info, result) { + if (runtimeTypeName == null) { + throw new GraphQLError_ts_1.GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}". Either the "${returnType}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, { nodes: toNodes(fieldDetailsList) }); + } + if (typeof runtimeTypeName !== 'string') { + throw new GraphQLError_ts_1.GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}" with ` + + `value ${(0, inspect_ts_1.inspect)(result)}, received "${(0, inspect_ts_1.inspect)(runtimeTypeName)}", which is not a valid Object type name.`); + } + const runtimeType = schema.getType(runtimeTypeName); + if (runtimeType == null) { + throw new GraphQLError_ts_1.GraphQLError(`Abstract type "${returnType}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { nodes: toNodes(fieldDetailsList) }); + } + if (!(0, definition_ts_1.isObjectType)(runtimeType)) { + throw new GraphQLError_ts_1.GraphQLError(`Abstract type "${returnType}" was resolved to a non-object type "${runtimeTypeName}".`, { nodes: toNodes(fieldDetailsList) }); + } + if (!schema.isSubType(returnType, runtimeType)) { + throw new GraphQLError_ts_1.GraphQLError(`Runtime Object type "${runtimeType}" is not a possible type for "${returnType}".`, { nodes: toNodes(fieldDetailsList) }); + } + return runtimeType; + } + completeObjectValue(returnType, fieldDetailsList, info, path, result, positionContext) { + if (returnType.isTypeOf) { + const isTypeOf = returnType.isTypeOf(result, this.validatedExecutionArgs.contextValue, info); + if ((0, isPromise_ts_1.isPromiseLike)(isTypeOf)) { + return isTypeOf.then((resolvedIsTypeOf) => { + if (this.aborted) { + throw new Error('Aborted!'); + } + if (!resolvedIsTypeOf) { + throw this.invalidReturnTypeError(returnType, result, fieldDetailsList); + } + return this.collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext); + }); + } + if (!isTypeOf) { + throw this.invalidReturnTypeError(returnType, result, fieldDetailsList); + } + } + return this.collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext); + } + invalidReturnTypeError(returnType, result, fieldDetailsList) { + return new GraphQLError_ts_1.GraphQLError(`Expected value of type "${returnType}" but got: ${(0, inspect_ts_1.inspect)(result)}.`, { nodes: toNodes(fieldDetailsList) }); + } + collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext) { + const { groupedFieldSet, newDeferUsages } = (0, exports.collectSubfields)(this.validatedExecutionArgs, returnType, fieldDetailsList); + return this.executeCollectedSubfields(returnType, result, path, groupedFieldSet, newDeferUsages, positionContext); + } + executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, _newDeferUsages, _positionContext) { + return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, undefined); + } +} +exports.Executor = Executor; +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +//# sourceMappingURL=Executor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js.map new file mode 100644 index 00000000..68cfe173 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Executor.js","sourceRoot":"","sources":["../../src/execution/Executor.ts"],"names":[],"mappings":";;;AAEA,sDAAgD;AAChD,0DAAoD;AACpD,sEAAgE;AAChE,wEAAkE;AAClE,0DAAmE;AACnE,wDAAkD;AAClD,wDAAkD;AAGlD,gDAA0D;AAC1D,wEAAkE;AAElE,kEAA4D;AAE5D,0EAAoE;AAEpE,8DAAwD;AACxD,8DAAwD;AAGxD,+CAAuD;AAWvD,yDAM+B;AAQ/B,sDAK2B;AAE3B,uFAAiF;AACjF,+DAAyD;AACzD,mEAA2D;AAM3D,yDAG4B;AAC5B,6EAAuE;AAEvE,uFAAiF;AAGjF,2DAAwE;AACxE,yCAAsD;AACtD,uFAA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AE,CACrC,CAAC;IACJ,CAAC;IAED,0BAA0B,CACxB,UAA6B,EAC7B,gBAAkC,EAClC,IAAU,EACV,MAAe,EACf,eAA6C;QAG7C,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,IAAA,wBAAgB,EAC1D,IAAI,CAAC,sBAAsB,EAC3B,UAAU,EACV,gBAAgB,CACjB,CAAC;QAEF,OAAO,IAAI,CAAC,yBAAyB,CACnC,UAAU,EACV,MAAM,EACN,IAAI,EACJ,eAAe,EACf,cAAc,EACd,eAAe,CAChB,CAAC;IACJ,CAAC;IAED,yBAAyB,CACvB,UAA6B,EAC7B,WAAoB,EACpB,IAAsB,EACtB,uBAAwC,EACxC,eAA0C,EAC1C,gBAA8C;QAE9C,OAAO,IAAI,CAAC,aAAa,CACvB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,uBAAuB,EACvB,SAAS,CACV,CAAC;IACJ,CAAC;CACF;AAvuCD,4BAuuCC;AAED,SAAS,OAAO,CAAC,gBAAkC;IACjD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC","sourcesContent":["/** @category Execution */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isAsyncIterable } from '../jsutils/isAsyncIterable.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isPromise, isPromiseLike } from '../jsutils/isPromise.ts';\nimport { memoize2 } from '../jsutils/memoize2.ts';\nimport { memoize3 } from '../jsutils/memoize3.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport { addPath, pathToArray } from '../jsutils/Path.ts';\nimport { promiseForObject } from '../jsutils/promiseForObject.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\nimport { promiseReduce } from '../jsutils/promiseReduce.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport type { GraphQLFormattedError } from '../error/GraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\nimport { locatedError } from '../error/locatedError.ts';\n\nimport type { FieldNode } from '../language/ast.ts';\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport type {\n GraphQLAbstractType,\n GraphQLLeafType,\n GraphQLList,\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n} from '../type/definition.ts';\nimport {\n isAbstractType,\n isLeafType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type {\n GraphQLExecuteRootSelectionSetContext,\n GraphQLResolveContext,\n MinimalTracingChannel,\n} from '../diagnostics.ts';\nimport {\n executeRootSelectionSetChannel,\n resolveChannel,\n shouldTrace,\n traceMixed,\n} from '../diagnostics.ts';\n\nimport { AbortedGraphQLExecutionError } from './AbortedGraphQLExecutionError.ts';\nimport { buildResolveInfo } from './buildResolveInfo.ts';\nimport { withCancellation } from './cancellablePromise.ts';\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from './collectFields.ts';\nimport {\n collectFields,\n collectSubfields as _collectSubfields,\n} from './collectFields.ts';\nimport { collectIteratorPromises } from './collectIteratorPromises.ts';\nimport type { SharedExecutionContext } from './createSharedExecutionContext.ts';\nimport { createSharedExecutionContext } from './createSharedExecutionContext.ts';\nimport type { ValidatedExecutionArgs } from './ExecutionArgs.ts';\nimport type { StreamUsage } from './getStreamUsage.ts';\nimport { getStreamUsage as _getStreamUsage } from './getStreamUsage.ts';\nimport { runAsyncWorkFinishedHook } from './hooks.ts';\nimport { returnIteratorCatchingErrors } from './returnIteratorCatchingErrors.ts';\nimport { getArgumentValues } from './values.ts';\n\n/* eslint-disable max-params */\n// This file contains a lot of such errors but we plan to refactor it anyway\n// so just disable it for entire file.\n\n/**\n * Terminology\n *\n * \"Definitions\" are the generic name for top-level statements in the document.\n * Examples of this include:\n * 1) Operations (such as a query)\n * 2) Fragments\n *\n * \"Operations\" are a generic name for requests in the document.\n * Examples of this include:\n * 1) query,\n * 2) mutation\n *\n * \"Selections\" are the definitions that can appear legally and at\n * single level of the query. These include:\n * 1) field references e.g `a`\n * 2) fragment \"spreads\" e.g. `...c`\n * 3) inline fragment \"spreads\" e.g. `...on Type { a }`\n *\n * @internal\n */\n\n/**\n * A memoized collection of relevant subfields with regard to the return\n * type. Memoizing ensures the subfields are not repeatedly calculated, which\n * saves overhead when resolving lists of values.\n *\n * @internal\n */\nexport const collectSubfields: (\n validatedExecutionArgs: ValidatedExecutionArgs,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n) => ReturnType = memoize3(\n (\n validatedExecutionArgs: ValidatedExecutionArgs,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n ) => {\n const { schema, fragments, variableValues, hideSuggestions } =\n validatedExecutionArgs;\n return _collectSubfields(\n schema,\n fragments,\n variableValues,\n returnType,\n fieldDetailsList,\n hideSuggestions,\n );\n },\n);\n\n/** @internal */\nexport const getStreamUsage: typeof _getStreamUsage = memoize2(\n (\n validatedExecutionArgs: ValidatedExecutionArgs,\n fieldDetailsList: FieldDetailsList,\n ) => _getStreamUsage(validatedExecutionArgs, fieldDetailsList),\n);\n\nclass CollectedErrors {\n private _errorPositions: Set;\n private _errors: Array;\n constructor() {\n this._errorPositions = new Set();\n this._errors = [];\n }\n\n get errors(): ReadonlyArray {\n return this._errors;\n }\n\n add(error: GraphQLError, path: Path | undefined): void {\n // Do not modify errors list if the execution position for this error or\n // any of its ancestors has already been nulled via error propagation.\n // This check should be unnecessary for implementations able to implement\n // actual cancellation.\n if (this.hasNulledPosition(path)) {\n return;\n }\n this._errorPositions.add(path);\n this._errors.push(error);\n }\n\n hasNulledPosition(startPath: Path | undefined): boolean {\n let path = startPath;\n while (path !== undefined) {\n if (this._errorPositions.has(path)) {\n return true;\n }\n path = path.prev;\n }\n return this._errorPositions.has(undefined);\n }\n}\n\n/**\n * Represents the response produced by executing a GraphQL operation.\n * @typeParam TData - Shape of the execution data payload.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface ExecutionResult<\n TData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Errors raised while parsing, validating, or executing the operation. */\n errors?: ReadonlyArray;\n /** Data returned by execution, or null when execution could not produce data. */\n data?: TData | null;\n /** Additional non-standard metadata included in the execution result. */\n extensions?: TExtensions;\n}\n\n/**\n * A JSON-serializable GraphQL execution result.\n * @typeParam TData - Shape of the formatted data payload.\n * @typeParam TExtensions - Shape of the formatted extensions payload.\n */\nexport interface FormattedExecutionResult<\n TData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Errors raised while parsing, validating, or executing the operation. */\n errors?: ReadonlyArray;\n /** Data returned by execution, or null when execution could not produce data. */\n data?: TData | null;\n /** Additional non-standard metadata included in the formatted result. */\n extensions?: TExtensions;\n}\n\nconst defaultAbortReason = new Error('This operation was aborted');\n\n/** @internal */\nexport class Executor<\n TPositionContext = undefined, // No position context by default\n TAlternativeInitialResponse = ExecutionResult, // No alternative by default\n> {\n validatedExecutionArgs: ValidatedExecutionArgs;\n aborted: boolean;\n abortReason: unknown;\n sharedExecutionContext: SharedExecutionContext;\n collectedErrors: CollectedErrors;\n abortResultPromise: (() => void) | undefined;\n resolverAbortController: AbortController | undefined;\n getAbortSignal: () => AbortSignal | undefined;\n getAsyncHelpers: () => GraphQLResolveInfoHelpers;\n promiseAll: (\n values: ReadonlyArray>,\n ) => Promise>;\n\n constructor(\n validatedExecutionArgs: ValidatedExecutionArgs,\n sharedExecutionContext?: SharedExecutionContext,\n ) {\n this.validatedExecutionArgs = validatedExecutionArgs;\n this.aborted = false;\n this.abortReason = defaultAbortReason;\n this.collectedErrors = new CollectedErrors();\n\n if (sharedExecutionContext === undefined) {\n this.resolverAbortController = new AbortController();\n this.sharedExecutionContext = createSharedExecutionContext(\n this.resolverAbortController.signal,\n );\n } else {\n this.sharedExecutionContext = sharedExecutionContext;\n }\n const { getAbortSignal, getAsyncHelpers, promiseAll } =\n this.sharedExecutionContext;\n this.getAbortSignal = getAbortSignal;\n this.getAsyncHelpers = getAsyncHelpers;\n this.promiseAll = promiseAll;\n }\n\n executeRootSelectionSet(\n serially?: boolean,\n ): PromiseOrValue {\n if (!shouldTrace(executeRootSelectionSetChannel)) {\n return this.executeRootSelectionSetImpl(serially);\n }\n return traceMixed(\n executeRootSelectionSetChannel,\n this.buildExecuteContextFromValidatedArgs(this.validatedExecutionArgs),\n () => this.executeRootSelectionSetImpl(serially),\n );\n }\n\n /**\n * Build a root-selection-set tracing context from validated execution\n * arguments. The operation has already been selected during argument\n * validation.\n * @internal\n */\n buildExecuteContextFromValidatedArgs(\n args: ValidatedExecutionArgs,\n ): GraphQLExecuteRootSelectionSetContext {\n return {\n schema: args.schema,\n document: args.document,\n operation: args.operation,\n rawVariableValues: args.rawVariableValues,\n operationName: args.operation.name?.value,\n operationType: args.operation.operation,\n };\n }\n\n executeRootSelectionSetImpl(\n serially?: boolean,\n ): PromiseOrValue {\n const externalAbortSignal = this.validatedExecutionArgs.externalAbortSignal;\n let removeExternalAbortListener: (() => void) | undefined;\n if (externalAbortSignal) {\n externalAbortSignal.throwIfAborted();\n const onExternalAbort = () => {\n this.abort(externalAbortSignal.reason);\n };\n removeExternalAbortListener = () =>\n externalAbortSignal.removeEventListener('abort', onExternalAbort);\n externalAbortSignal.addEventListener('abort', onExternalAbort);\n }\n\n const maybeRemoveExternalAbortListener = () => {\n removeExternalAbortListener?.();\n };\n\n let result: PromiseOrValue>;\n try {\n const {\n schema,\n fragments,\n rootValue,\n operation,\n variableValues,\n hideSuggestions,\n } = this.validatedExecutionArgs;\n\n const { operation: operationType, selectionSet } = operation;\n\n const rootType = schema.getRootType(operationType);\n if (rootType == null) {\n throw new GraphQLError(\n `Schema is not configured to execute ${operationType} operation.`,\n { nodes: operation },\n );\n }\n\n const { groupedFieldSet, newDeferUsages } = collectFields(\n schema,\n fragments,\n variableValues,\n rootType,\n selectionSet,\n hideSuggestions,\n );\n\n result = this.executeCollectedRootFields(\n rootType,\n rootValue,\n groupedFieldSet,\n serially ?? operationType === OperationTypeNode.MUTATION,\n newDeferUsages,\n );\n\n if (isPromise(result)) {\n const promise = result.then(\n (data) => {\n maybeRemoveExternalAbortListener();\n return this.buildResponse(data);\n },\n (error: unknown) => {\n maybeRemoveExternalAbortListener();\n this.collectedErrors.add(ensureGraphQLError(error), undefined);\n return this.buildResponse(null);\n },\n );\n this.sharedExecutionContext.asyncWorkTracker.add(promise);\n const { promise: cancellablePromise, abort: abortResultPromise } =\n withCancellation(promise.then((resolved) => this.finish(resolved)));\n this.abortResultPromise = () => {\n abortResultPromise(this.createAbortedExecutionError(promise));\n };\n if (this.aborted) {\n this.abortResultPromise();\n }\n return cancellablePromise;\n }\n maybeRemoveExternalAbortListener();\n } catch (error) {\n maybeRemoveExternalAbortListener();\n this.collectedErrors.add(ensureGraphQLError(error), undefined);\n return this.finish(this.buildResponse(null));\n }\n return this.finish(this.buildResponse(result));\n }\n\n abort(reason?: unknown): void {\n if (this.aborted) {\n return;\n }\n this.aborted = true;\n if (reason !== undefined) {\n this.abortReason = reason;\n }\n this.abortResultPromise?.();\n this.resolverAbortController?.abort(this.abortReason);\n }\n\n finish(result: T): T {\n if (this.aborted) {\n throw this.createAbortedExecutionError(result);\n }\n this.aborted = true;\n return result;\n }\n\n createAbortedExecutionError(\n result: PromiseOrValue,\n ): AbortedGraphQLExecutionError {\n return new AbortedGraphQLExecutionError(this.abortReason, result);\n }\n\n getFinishSharedExecution(): () => void {\n const resolverAbortController = this.resolverAbortController;\n const asyncWorkFinishedHook =\n this.validatedExecutionArgs.hooks?.asyncWorkFinished;\n if (asyncWorkFinishedHook === undefined) {\n return () => resolverAbortController?.abort();\n }\n\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n return () => {\n resolverAbortController?.abort();\n runAsyncWorkFinishedHook(\n validatedExecutionArgs,\n sharedExecutionContext,\n asyncWorkFinishedHook,\n );\n };\n }\n\n /**\n * Given a completed execution context and data, build the `{ errors, data }`\n * response defined by the \"Response\" section of the GraphQL specification.\n *\n * @internal\n */\n buildResponse(\n data: ObjMap | null,\n ): ExecutionResult | TAlternativeInitialResponse {\n this.getFinishSharedExecution()();\n const errors = this.collectedErrors.errors;\n return errors.length ? { errors, data } : { data };\n }\n\n executeCollectedRootFields(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n originalGroupedFieldSet: GroupedFieldSet,\n serially: boolean,\n _newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n return this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n originalGroupedFieldSet,\n serially,\n undefined,\n );\n }\n\n executeRootGroupedFieldSet(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n groupedFieldSet: GroupedFieldSet,\n serially: boolean,\n positionContext?: TPositionContext,\n ): PromiseOrValue> {\n return serially\n ? this.executeFieldsSerially(\n rootType,\n rootValue,\n undefined,\n groupedFieldSet,\n positionContext,\n )\n : this.executeFields(\n rootType,\n rootValue,\n undefined,\n groupedFieldSet,\n positionContext,\n );\n }\n\n /**\n * Implements the \"Executing selection sets\" section of the spec\n * for fields that must be executed serially.\n *\n * @internal\n */\n executeFieldsSerially(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n groupedFieldSet: GroupedFieldSet,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n let tracingChannel = shouldTrace(resolveChannel)\n ? resolveChannel\n : undefined;\n\n return promiseReduce(\n groupedFieldSet,\n (results, [responseName, fieldDetailsList]) => {\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n const fieldPath = addPath(path, responseName, parentType.name);\n const result = this.executeField(\n parentType,\n sourceValue,\n fieldDetailsList,\n fieldPath,\n positionContext,\n tracingChannel,\n );\n if (result === undefined) {\n return results;\n }\n if (isPromise(result)) {\n return result.then((resolved) => {\n results[responseName] = resolved;\n tracingChannel = shouldTrace(resolveChannel)\n ? resolveChannel\n : undefined;\n return results;\n });\n }\n results[responseName] = result;\n return results;\n },\n Object.create(null),\n );\n }\n\n /**\n * Implements the \"Executing selection sets\" section of the spec\n * for fields that may be executed in parallel.\n *\n * @internal\n */\n executeFields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n groupedFieldSet: GroupedFieldSet,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n const results = Object.create(null);\n let containsPromise = false;\n const tracingChannel = shouldTrace(resolveChannel)\n ? resolveChannel\n : undefined;\n\n try {\n for (const [responseName, fieldDetailsList] of groupedFieldSet) {\n const fieldPath = addPath(path, responseName, parentType.name);\n const result = this.executeField(\n parentType,\n sourceValue,\n fieldDetailsList,\n fieldPath,\n positionContext,\n tracingChannel,\n );\n\n if (result !== undefined) {\n results[responseName] = result;\n if (isPromise(result)) {\n containsPromise = true;\n }\n }\n }\n } catch (error) {\n if (containsPromise) {\n this.sharedExecutionContext.asyncWorkTracker.addValues(\n Object.values(results),\n );\n }\n throw error;\n }\n\n // If there are no promises, we can just return the object and any incrementalDataRecords\n if (!containsPromise) {\n return results;\n }\n\n // Otherwise, results is a map from field name to the result of resolving that\n // field, which is possibly a promise. Return a promise that will return this\n // same map, but with any promises replaced with the values they resolved to.\n return promiseForObject(results, this.promiseAll);\n }\n\n /**\n * Implements the \"Executing fields\" section of the spec\n * In particular, this function figures out the value that the field returns by\n * calling its resolve function, then calls completeValue to complete promises,\n * coercing scalars, or execute the sub-selection-set for objects.\n *\n * @internal\n */\n executeField(\n parentType: GraphQLObjectType,\n source: unknown,\n fieldDetailsList: FieldDetailsList,\n path: Path,\n positionContext: TPositionContext | undefined,\n tracingChannel: MinimalTracingChannel | undefined,\n ): PromiseOrValue {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const { schema, contextValue, variableValues, hideSuggestions } =\n validatedExecutionArgs;\n const firstFieldDetails = fieldDetailsList[0];\n const firstNode = firstFieldDetails.node;\n const fieldName = firstNode.name.value;\n const fieldDef = schema.getField(parentType, fieldName);\n if (!fieldDef) {\n return;\n }\n\n const returnType = fieldDef.type;\n let resolveFn = fieldDef.resolve ?? validatedExecutionArgs.fieldResolver;\n\n if (tracingChannel !== undefined) {\n const originalResolveFn = resolveFn;\n resolveFn = (s, args, c, info) =>\n traceMixed(\n tracingChannel,\n this.buildResolveContext(args, info, fieldDef.resolve === undefined),\n () => originalResolveFn(s, args, c, info),\n );\n }\n\n const info = buildResolveInfo(\n validatedExecutionArgs,\n fieldDef,\n toNodes(fieldDetailsList),\n parentType,\n path,\n this.getAbortSignal,\n this.getAsyncHelpers,\n );\n\n // Get the resolve function, regardless of if its result is normal or abrupt (error).\n try {\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n // TODO: find a way to memoize, in case this field is within a List type.\n const args = getArgumentValues(\n fieldDef,\n firstNode,\n variableValues,\n firstFieldDetails.fragmentVariableValues,\n hideSuggestions,\n );\n\n // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n const result = resolveFn(source, args, contextValue, info);\n\n if (isPromiseLike(result)) {\n return this.completePromisedValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n const completed = this.completeValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n\n if (isPromise(completed)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n return completed.then(undefined, (rawError: unknown) => {\n this.handleFieldError(rawError, returnType, fieldDetailsList, path);\n return null;\n });\n }\n return completed;\n } catch (rawError) {\n this.handleFieldError(rawError, returnType, fieldDetailsList, path);\n return null;\n }\n }\n\n /**\n * Build a graphql:resolve channel context for a single field invocation.\n *\n * `fieldPath` is exposed as a lazy getter because serializing the response\n * path is O(depth) and APMs that depth-filter or skip default resolvers\n * often never read it. `args` is passed through by reference.\n * @internal\n */\n buildResolveContext(\n args: ObjMap,\n info: GraphQLResolveInfo,\n isDefaultResolver: boolean,\n ): GraphQLResolveContext {\n let cachedFieldPath: string | undefined;\n return {\n fieldName: info.fieldName,\n alias: String(info.path.key),\n parentType: info.parentType.name,\n fieldType: String(info.returnType),\n args,\n isDefaultResolver,\n get fieldPath() {\n cachedFieldPath ??= pathToArray(info.path).join('.');\n return cachedFieldPath;\n },\n };\n }\n\n handleFieldError(\n rawError: unknown,\n returnType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n path: Path,\n ): void {\n const error = locatedError(\n rawError,\n toNodes(fieldDetailsList),\n pathToArray(path),\n );\n\n // If the field type is non-nullable, then it is resolved without any\n // protection from errors, however it still properly locates the error.\n if (\n this.validatedExecutionArgs.errorPropagation &&\n isNonNullType(returnType)\n ) {\n throw error;\n }\n\n // Otherwise, error protection is applied, logging the error and resolving\n // a null value for this field if one is encountered.\n this.collectedErrors.add(error, path);\n }\n\n /**\n * Implements the instructions for completeValue as defined in the\n * \"Value Completion\" section of the spec.\n *\n * If the field type is Non-Null, then this recursively completes the value\n * for the inner type. It throws a field error if that completion returns null,\n * as per the \"Nullability\" section of the spec.\n *\n * If the field type is a List, then this recursively completes the value\n * for the inner type on each item in the list.\n *\n * If the field type is a Scalar or Enum, ensures the completed value is a legal\n * value of the type by calling the `coerceOutputValue` method of GraphQL type\n * definition.\n *\n * If the field is an abstract type, determine the runtime type of the value\n * and then complete based on that type\n *\n * Otherwise, the field type expects a sub-selection set, and will complete the\n * value by executing all sub-selections.\n *\n * @internal\n */\n completeValue(\n returnType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n }\n\n // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n if (isNonNullType(returnType)) {\n const completed = this.completeValue(\n returnType.ofType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n if (completed === null) {\n throw new Error(\n `Cannot return null for non-nullable field ${info.parentType}.${info.fieldName}.`,\n );\n }\n return completed;\n }\n\n // If result value is null or undefined then return null.\n if (result == null) {\n return null;\n }\n\n // If field type is List, complete each item in the list with the inner type\n if (isListType(returnType)) {\n return this.completeListValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n // If field type is a leaf type, Scalar or Enum, coerce to a valid value,\n // returning null if coercion is not possible.\n if (isLeafType(returnType)) {\n return this.completeLeafValue(returnType, result);\n }\n\n // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n if (isAbstractType(returnType)) {\n return this.completeAbstractValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n // If field type is Object, execute and complete all sub-selections.\n if (isObjectType(returnType)) {\n return this.completeObjectValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n /* node:coverage ignore next 7 */\n }\n // Not reachable, all possible output types have been considered.\n invariant(\n false,\n 'Cannot complete value of unexpected output type: ' + inspect(returnType),\n );\n }\n\n async completePromisedValue(\n returnType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: PromiseLike,\n positionContext: TPositionContext | undefined,\n ): Promise {\n try {\n const resolved = await result;\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n let completed = this.completeValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n resolved,\n positionContext,\n );\n\n if (isPromise(completed)) {\n completed = await completed;\n }\n return completed;\n } catch (rawError) {\n this.handleFieldError(rawError, returnType, fieldDetailsList, path);\n return null;\n }\n }\n\n /**\n * Complete a async iterator value by completing the result and calling\n * recursively until all the results are completed.\n *\n * @internal\n */\n async completeAsyncIterableValue(\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n items: AsyncIterable,\n positionContext: TPositionContext | undefined,\n ): Promise> {\n // do not stream inner lists of multi-dimensional lists\n const streamUsage =\n typeof path.key === 'number'\n ? undefined\n : getStreamUsage(this.validatedExecutionArgs, fieldDetailsList);\n\n let containsPromise = false;\n const completedResults: Array = [];\n const asyncIterator = items[Symbol.asyncIterator]();\n let index = 0;\n let iteration;\n try {\n while (true) {\n if (\n streamUsage?.initialCount === index &&\n this.handleStream(\n index,\n path,\n { handle: asyncIterator, isAsync: true },\n streamUsage,\n info,\n itemType,\n )\n ) {\n break;\n }\n const itemPath = addPath(path, index, undefined);\n try {\n // eslint-disable-next-line no-await-in-loop\n iteration = await asyncIterator.next();\n } catch (rawError) {\n throw locatedError(\n rawError,\n toNodes(fieldDetailsList),\n pathToArray(path),\n );\n }\n if (this.aborted || iteration.done) {\n break;\n }\n const item = iteration.value;\n if (\n this.completeMaybePromisedListItemValue(\n item,\n completedResults,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n )\n ) {\n containsPromise = true;\n }\n index++;\n }\n } catch (error) {\n this.sharedExecutionContext.asyncWorkTracker.add(\n returnIteratorCatchingErrors(asyncIterator),\n );\n if (containsPromise) {\n this.sharedExecutionContext.asyncWorkTracker.addValues(\n completedResults,\n );\n }\n throw error;\n }\n\n // Throwing on completion outside of the loop may allow engines to better optimize\n if (this.aborted) {\n if (!iteration?.done) {\n this.sharedExecutionContext.asyncWorkTracker.add(\n returnIteratorCatchingErrors(asyncIterator),\n );\n }\n throw new Error('Aborted!');\n }\n\n return containsPromise\n ? this.promiseAll(completedResults)\n : completedResults;\n }\n\n /* node:coverage ignore next 12 */\n handleStream(\n _index: number,\n _path: Path,\n _iterator:\n | { handle: Iterator; isAsync?: never }\n | { handle: AsyncIterator; isAsync: true },\n _streamUsage: StreamUsage,\n _info: GraphQLResolveInfo,\n _itemType: GraphQLOutputType,\n ): boolean {\n return false;\n }\n\n /**\n * Complete a list value by completing each item in the list with the\n * inner type\n *\n * @internal\n */\n completeListValue(\n returnType: GraphQLList,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n const itemType = returnType.ofType;\n\n if (isAsyncIterable(result)) {\n return this.completeAsyncIterableValue(\n itemType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n if (!isIterableObject(result)) {\n throw new GraphQLError(\n `Expected Iterable, but did not find one for field \"${info.parentType}.${info.fieldName}\".`,\n );\n }\n\n return this.completeIterableValue(\n itemType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n completeIterableValue(\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n items: Iterable,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n // do not stream inner lists of multi-dimensional lists\n const streamUsage =\n typeof path.key === 'number'\n ? undefined\n : getStreamUsage(this.validatedExecutionArgs, fieldDetailsList);\n\n // This is specified as a simple map, however we're optimizing the path\n // where the list contains no Promises by avoiding creating another Promise.\n let containsPromise = false;\n const completedResults: Array = [];\n let index = 0;\n const iterator = items[Symbol.iterator]();\n try {\n while (true) {\n if (\n streamUsage?.initialCount === index &&\n this.handleStream(\n index,\n path,\n { handle: iterator },\n streamUsage,\n info,\n itemType,\n )\n ) {\n break;\n }\n const iteration = iterator.next();\n if (iteration.done) {\n break;\n }\n\n const item = iteration.value;\n\n // No need to modify the info object containing the path,\n // since from here on it is not ever accessed by resolver functions.\n const itemPath = addPath(path, index, undefined);\n\n if (\n this.completeMaybePromisedListItemValue(\n item,\n completedResults,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n )\n ) {\n containsPromise = true;\n }\n\n index++;\n }\n } catch (error) {\n const asyncWorkTracker = this.sharedExecutionContext.asyncWorkTracker;\n if (containsPromise) {\n asyncWorkTracker.addValues(completedResults);\n }\n asyncWorkTracker.addValues(collectIteratorPromises(iterator));\n throw error;\n }\n\n return containsPromise\n ? this.promiseAll(completedResults)\n : completedResults;\n }\n\n completeMaybePromisedListItemValue(\n item: unknown,\n completedResults: Array,\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemPath: Path,\n positionContext: TPositionContext | undefined,\n ): boolean {\n if (isPromiseLike(item)) {\n completedResults.push(\n this.completePromisedListItemValue(\n item,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n ),\n );\n return true;\n } else if (\n this.completeListItemValue(\n item,\n completedResults,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n )\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Complete a list item value by adding it to the completed results.\n *\n * Returns true if the value is a Promise.\n *\n * @internal\n */\n completeListItemValue(\n item: unknown,\n completedResults: Array,\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemPath: Path,\n positionContext: TPositionContext | undefined,\n ): boolean {\n try {\n const completedItem = this.completeValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n item,\n positionContext,\n );\n\n if (isPromise(completedItem)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n completedResults.push(\n completedItem.then(undefined, (rawError: unknown) => {\n this.handleFieldError(\n rawError,\n itemType,\n fieldDetailsList,\n itemPath,\n );\n return null;\n }),\n );\n return true;\n }\n\n completedResults.push(completedItem);\n } catch (rawError) {\n this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);\n completedResults.push(null);\n }\n return false;\n }\n\n async completePromisedListItemValue(\n item: PromiseLike,\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemPath: Path,\n positionContext: TPositionContext | undefined,\n ): Promise {\n try {\n const resolved = await item;\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n let completed = this.completeValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n resolved,\n positionContext,\n );\n if (isPromise(completed)) {\n completed = await completed;\n }\n return completed;\n } catch (rawError) {\n this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);\n return null;\n }\n }\n\n /**\n * Complete a Scalar or Enum by serializing to a valid value, returning\n * null if serialization is not possible.\n *\n * @internal\n */\n completeLeafValue(returnType: GraphQLLeafType, result: unknown): unknown {\n const coerced = returnType.coerceOutputValue(result);\n if (coerced == null) {\n throw new Error(\n `Expected \\`${inspect(returnType)}.coerceOutputValue(${inspect(result)})\\` to ` +\n `return non-nullable value, returned: ${inspect(coerced)}`,\n );\n }\n return coerced;\n }\n\n /**\n * Complete a value of an abstract type by determining the runtime object type\n * of that value, then complete the value for that type.\n *\n * @internal\n */\n completeAbstractValue(\n returnType: GraphQLAbstractType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const { schema, contextValue } = validatedExecutionArgs;\n const resolveTypeFn =\n returnType.resolveType ?? validatedExecutionArgs.typeResolver;\n const runtimeType = resolveTypeFn(result, contextValue, info, returnType);\n\n if (isPromiseLike(runtimeType)) {\n return runtimeType.then((resolvedRuntimeType) => {\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n return this.completeObjectValue(\n this.ensureValidRuntimeType(\n resolvedRuntimeType,\n schema,\n returnType,\n fieldDetailsList,\n info,\n result,\n ),\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n });\n }\n\n return this.completeObjectValue(\n this.ensureValidRuntimeType(\n runtimeType,\n schema,\n returnType,\n fieldDetailsList,\n info,\n result,\n ),\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n ensureValidRuntimeType(\n runtimeTypeName: unknown,\n schema: GraphQLSchema,\n returnType: GraphQLAbstractType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n result: unknown,\n ): GraphQLObjectType {\n if (runtimeTypeName == null) {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" must resolve to an Object type at runtime for field \"${info.parentType}.${info.fieldName}\". Either the \"${returnType}\" type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function.`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n if (typeof runtimeTypeName !== 'string') {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" must resolve to an Object type at runtime for field \"${info.parentType}.${info.fieldName}\" with ` +\n `value ${inspect(result)}, received \"${inspect(\n runtimeTypeName,\n )}\", which is not a valid Object type name.`,\n );\n }\n\n const runtimeType = schema.getType(runtimeTypeName);\n if (runtimeType == null) {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" was resolved to a type \"${runtimeTypeName}\" that does not exist inside the schema.`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n if (!isObjectType(runtimeType)) {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" was resolved to a non-object type \"${runtimeTypeName}\".`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n if (!schema.isSubType(returnType, runtimeType)) {\n throw new GraphQLError(\n `Runtime Object type \"${runtimeType}\" is not a possible type for \"${returnType}\".`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n return runtimeType;\n }\n\n /**\n * Complete an Object value by executing all sub-selections.\n *\n * @internal\n */\n completeObjectValue(\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n // If there is an isTypeOf predicate function, call it with the\n // current result. If isTypeOf returns false, then raise an error rather\n // than continuing execution.\n if (returnType.isTypeOf) {\n const isTypeOf = returnType.isTypeOf(\n result,\n this.validatedExecutionArgs.contextValue,\n info,\n );\n\n if (isPromiseLike(isTypeOf)) {\n return isTypeOf.then((resolvedIsTypeOf) => {\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n if (!resolvedIsTypeOf) {\n throw this.invalidReturnTypeError(\n returnType,\n result,\n fieldDetailsList,\n );\n }\n return this.collectAndExecuteSubfields(\n returnType,\n fieldDetailsList,\n path,\n result,\n positionContext,\n );\n });\n }\n\n if (!isTypeOf) {\n throw this.invalidReturnTypeError(returnType, result, fieldDetailsList);\n }\n }\n\n return this.collectAndExecuteSubfields(\n returnType,\n fieldDetailsList,\n path,\n result,\n positionContext,\n );\n }\n\n invalidReturnTypeError(\n returnType: GraphQLObjectType,\n result: unknown,\n fieldDetailsList: FieldDetailsList,\n ): GraphQLError {\n return new GraphQLError(\n `Expected value of type \"${returnType}\" but got: ${inspect(result)}.`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n collectAndExecuteSubfields(\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n // Collect sub-fields to execute to complete this value.\n const { groupedFieldSet, newDeferUsages } = collectSubfields(\n this.validatedExecutionArgs,\n returnType,\n fieldDetailsList,\n );\n\n return this.executeCollectedSubfields(\n returnType,\n result,\n path,\n groupedFieldSet,\n newDeferUsages,\n positionContext,\n );\n }\n\n executeCollectedSubfields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n originalGroupedFieldSet: GroupedFieldSet,\n _newDeferUsages: ReadonlyArray,\n _positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n return this.executeFields(\n parentType,\n sourceValue,\n path,\n originalGroupedFieldSet,\n undefined,\n );\n }\n}\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs new file mode 100644 index 00000000..58b2974f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs @@ -0,0 +1,574 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { isAsyncIterable } from "../jsutils/isAsyncIterable.mjs"; +import { isIterableObject } from "../jsutils/isIterableObject.mjs"; +import { isPromise, isPromiseLike } from "../jsutils/isPromise.mjs"; +import { memoize2 } from "../jsutils/memoize2.mjs"; +import { memoize3 } from "../jsutils/memoize3.mjs"; +import { addPath, pathToArray } from "../jsutils/Path.mjs"; +import { promiseForObject } from "../jsutils/promiseForObject.mjs"; +import { promiseReduce } from "../jsutils/promiseReduce.mjs"; +import { ensureGraphQLError } from "../error/ensureGraphQLError.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { locatedError } from "../error/locatedError.mjs"; +import { OperationTypeNode } from "../language/ast.mjs"; +import { isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, } from "../type/definition.mjs"; +import { executeRootSelectionSetChannel, resolveChannel, shouldTrace, traceMixed, } from "../diagnostics.mjs"; +import { AbortedGraphQLExecutionError } from "./AbortedGraphQLExecutionError.mjs"; +import { buildResolveInfo } from "./buildResolveInfo.mjs"; +import { withCancellation } from "./cancellablePromise.mjs"; +import { collectFields, collectSubfields as _collectSubfields, } from "./collectFields.mjs"; +import { collectIteratorPromises } from "./collectIteratorPromises.mjs"; +import { createSharedExecutionContext } from "./createSharedExecutionContext.mjs"; +import { getStreamUsage as _getStreamUsage } from "./getStreamUsage.mjs"; +import { runAsyncWorkFinishedHook } from "./hooks.mjs"; +import { returnIteratorCatchingErrors } from "./returnIteratorCatchingErrors.mjs"; +import { getArgumentValues } from "./values.mjs"; +export const collectSubfields = memoize3((validatedExecutionArgs, returnType, fieldDetailsList) => { + const { schema, fragments, variableValues, hideSuggestions } = validatedExecutionArgs; + return _collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions); +}); +export const getStreamUsage = memoize2((validatedExecutionArgs, fieldDetailsList) => _getStreamUsage(validatedExecutionArgs, fieldDetailsList)); +class CollectedErrors { + constructor() { + this._errorPositions = new Set(); + this._errors = []; + } + get errors() { + return this._errors; + } + add(error, path) { + if (this.hasNulledPosition(path)) { + return; + } + this._errorPositions.add(path); + this._errors.push(error); + } + hasNulledPosition(startPath) { + let path = startPath; + while (path !== undefined) { + if (this._errorPositions.has(path)) { + return true; + } + path = path.prev; + } + return this._errorPositions.has(undefined); + } +} +const defaultAbortReason = new Error('This operation was aborted'); +export class Executor { + constructor(validatedExecutionArgs, sharedExecutionContext) { + this.validatedExecutionArgs = validatedExecutionArgs; + this.aborted = false; + this.abortReason = defaultAbortReason; + this.collectedErrors = new CollectedErrors(); + if (sharedExecutionContext === undefined) { + this.resolverAbortController = new AbortController(); + this.sharedExecutionContext = createSharedExecutionContext(this.resolverAbortController.signal); + } + else { + this.sharedExecutionContext = sharedExecutionContext; + } + const { getAbortSignal, getAsyncHelpers, promiseAll } = this.sharedExecutionContext; + this.getAbortSignal = getAbortSignal; + this.getAsyncHelpers = getAsyncHelpers; + this.promiseAll = promiseAll; + } + executeRootSelectionSet(serially) { + if (!shouldTrace(executeRootSelectionSetChannel)) { + return this.executeRootSelectionSetImpl(serially); + } + return traceMixed(executeRootSelectionSetChannel, this.buildExecuteContextFromValidatedArgs(this.validatedExecutionArgs), () => this.executeRootSelectionSetImpl(serially)); + } + buildExecuteContextFromValidatedArgs(args) { + return { + schema: args.schema, + document: args.document, + operation: args.operation, + rawVariableValues: args.rawVariableValues, + operationName: args.operation.name?.value, + operationType: args.operation.operation, + }; + } + executeRootSelectionSetImpl(serially) { + const externalAbortSignal = this.validatedExecutionArgs.externalAbortSignal; + let removeExternalAbortListener; + if (externalAbortSignal) { + externalAbortSignal.throwIfAborted(); + const onExternalAbort = () => { + this.abort(externalAbortSignal.reason); + }; + removeExternalAbortListener = () => externalAbortSignal.removeEventListener('abort', onExternalAbort); + externalAbortSignal.addEventListener('abort', onExternalAbort); + } + const maybeRemoveExternalAbortListener = () => { + removeExternalAbortListener?.(); + }; + let result; + try { + const { schema, fragments, rootValue, operation, variableValues, hideSuggestions, } = this.validatedExecutionArgs; + const { operation: operationType, selectionSet } = operation; + const rootType = schema.getRootType(operationType); + if (rootType == null) { + throw new GraphQLError(`Schema is not configured to execute ${operationType} operation.`, { nodes: operation }); + } + const { groupedFieldSet, newDeferUsages } = collectFields(schema, fragments, variableValues, rootType, selectionSet, hideSuggestions); + result = this.executeCollectedRootFields(rootType, rootValue, groupedFieldSet, serially ?? operationType === OperationTypeNode.MUTATION, newDeferUsages); + if (isPromise(result)) { + const promise = result.then((data) => { + maybeRemoveExternalAbortListener(); + return this.buildResponse(data); + }, (error) => { + maybeRemoveExternalAbortListener(); + this.collectedErrors.add(ensureGraphQLError(error), undefined); + return this.buildResponse(null); + }); + this.sharedExecutionContext.asyncWorkTracker.add(promise); + const { promise: cancellablePromise, abort: abortResultPromise } = withCancellation(promise.then((resolved) => this.finish(resolved))); + this.abortResultPromise = () => { + abortResultPromise(this.createAbortedExecutionError(promise)); + }; + if (this.aborted) { + this.abortResultPromise(); + } + return cancellablePromise; + } + maybeRemoveExternalAbortListener(); + } + catch (error) { + maybeRemoveExternalAbortListener(); + this.collectedErrors.add(ensureGraphQLError(error), undefined); + return this.finish(this.buildResponse(null)); + } + return this.finish(this.buildResponse(result)); + } + abort(reason) { + if (this.aborted) { + return; + } + this.aborted = true; + if (reason !== undefined) { + this.abortReason = reason; + } + this.abortResultPromise?.(); + this.resolverAbortController?.abort(this.abortReason); + } + finish(result) { + if (this.aborted) { + throw this.createAbortedExecutionError(result); + } + this.aborted = true; + return result; + } + createAbortedExecutionError(result) { + return new AbortedGraphQLExecutionError(this.abortReason, result); + } + getFinishSharedExecution() { + const resolverAbortController = this.resolverAbortController; + const asyncWorkFinishedHook = this.validatedExecutionArgs.hooks?.asyncWorkFinished; + if (asyncWorkFinishedHook === undefined) { + return () => resolverAbortController?.abort(); + } + const validatedExecutionArgs = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + return () => { + resolverAbortController?.abort(); + runAsyncWorkFinishedHook(validatedExecutionArgs, sharedExecutionContext, asyncWorkFinishedHook); + }; + } + buildResponse(data) { + this.getFinishSharedExecution()(); + const errors = this.collectedErrors.errors; + return errors.length ? { errors, data } : { data }; + } + executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, _newDeferUsages) { + return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, undefined); + } + executeRootGroupedFieldSet(rootType, rootValue, groupedFieldSet, serially, positionContext) { + return serially + ? this.executeFieldsSerially(rootType, rootValue, undefined, groupedFieldSet, positionContext) + : this.executeFields(rootType, rootValue, undefined, groupedFieldSet, positionContext); + } + executeFieldsSerially(parentType, sourceValue, path, groupedFieldSet, positionContext) { + let tracingChannel = shouldTrace(resolveChannel) + ? resolveChannel + : undefined; + return promiseReduce(groupedFieldSet, (results, [responseName, fieldDetailsList]) => { + if (this.aborted) { + throw new Error('Aborted!'); + } + const fieldPath = addPath(path, responseName, parentType.name); + const result = this.executeField(parentType, sourceValue, fieldDetailsList, fieldPath, positionContext, tracingChannel); + if (result === undefined) { + return results; + } + if (isPromise(result)) { + return result.then((resolved) => { + results[responseName] = resolved; + tracingChannel = shouldTrace(resolveChannel) + ? resolveChannel + : undefined; + return results; + }); + } + results[responseName] = result; + return results; + }, Object.create(null)); + } + executeFields(parentType, sourceValue, path, groupedFieldSet, positionContext) { + const results = Object.create(null); + let containsPromise = false; + const tracingChannel = shouldTrace(resolveChannel) + ? resolveChannel + : undefined; + try { + for (const [responseName, fieldDetailsList] of groupedFieldSet) { + const fieldPath = addPath(path, responseName, parentType.name); + const result = this.executeField(parentType, sourceValue, fieldDetailsList, fieldPath, positionContext, tracingChannel); + if (result !== undefined) { + results[responseName] = result; + if (isPromise(result)) { + containsPromise = true; + } + } + } + } + catch (error) { + if (containsPromise) { + this.sharedExecutionContext.asyncWorkTracker.addValues(Object.values(results)); + } + throw error; + } + if (!containsPromise) { + return results; + } + return promiseForObject(results, this.promiseAll); + } + executeField(parentType, source, fieldDetailsList, path, positionContext, tracingChannel) { + const validatedExecutionArgs = this.validatedExecutionArgs; + const { schema, contextValue, variableValues, hideSuggestions } = validatedExecutionArgs; + const firstFieldDetails = fieldDetailsList[0]; + const firstNode = firstFieldDetails.node; + const fieldName = firstNode.name.value; + const fieldDef = schema.getField(parentType, fieldName); + if (!fieldDef) { + return; + } + const returnType = fieldDef.type; + let resolveFn = fieldDef.resolve ?? validatedExecutionArgs.fieldResolver; + if (tracingChannel !== undefined) { + const originalResolveFn = resolveFn; + resolveFn = (s, args, c, info) => traceMixed(tracingChannel, this.buildResolveContext(args, info, fieldDef.resolve === undefined), () => originalResolveFn(s, args, c, info)); + } + const info = buildResolveInfo(validatedExecutionArgs, fieldDef, toNodes(fieldDetailsList), parentType, path, this.getAbortSignal, this.getAsyncHelpers); + try { + const args = getArgumentValues(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions); + const result = resolveFn(source, args, contextValue, info); + if (isPromiseLike(result)) { + return this.completePromisedValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + const completed = this.completeValue(returnType, fieldDetailsList, info, path, result, positionContext); + if (isPromise(completed)) { + return completed.then(undefined, (rawError) => { + this.handleFieldError(rawError, returnType, fieldDetailsList, path); + return null; + }); + } + return completed; + } + catch (rawError) { + this.handleFieldError(rawError, returnType, fieldDetailsList, path); + return null; + } + } + buildResolveContext(args, info, isDefaultResolver) { + let cachedFieldPath; + return { + fieldName: info.fieldName, + alias: String(info.path.key), + parentType: info.parentType.name, + fieldType: String(info.returnType), + args, + isDefaultResolver, + get fieldPath() { + cachedFieldPath ??= pathToArray(info.path).join('.'); + return cachedFieldPath; + }, + }; + } + handleFieldError(rawError, returnType, fieldDetailsList, path) { + const error = locatedError(rawError, toNodes(fieldDetailsList), pathToArray(path)); + if (this.validatedExecutionArgs.errorPropagation && + isNonNullType(returnType)) { + throw error; + } + this.collectedErrors.add(error, path); + } + completeValue(returnType, fieldDetailsList, info, path, result, positionContext) { + if (result instanceof Error) { + throw result; + } + if (isNonNullType(returnType)) { + const completed = this.completeValue(returnType.ofType, fieldDetailsList, info, path, result, positionContext); + if (completed === null) { + throw new Error(`Cannot return null for non-nullable field ${info.parentType}.${info.fieldName}.`); + } + return completed; + } + if (result == null) { + return null; + } + if (isListType(returnType)) { + return this.completeListValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + if (isLeafType(returnType)) { + return this.completeLeafValue(returnType, result); + } + if (isAbstractType(returnType)) { + return this.completeAbstractValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + if (isObjectType(returnType)) { + return this.completeObjectValue(returnType, fieldDetailsList, info, path, result, positionContext); + } + invariant(false, 'Cannot complete value of unexpected output type: ' + inspect(returnType)); + } + async completePromisedValue(returnType, fieldDetailsList, info, path, result, positionContext) { + try { + const resolved = await result; + if (this.aborted) { + throw new Error('Aborted!'); + } + let completed = this.completeValue(returnType, fieldDetailsList, info, path, resolved, positionContext); + if (isPromise(completed)) { + completed = await completed; + } + return completed; + } + catch (rawError) { + this.handleFieldError(rawError, returnType, fieldDetailsList, path); + return null; + } + } + async completeAsyncIterableValue(itemType, fieldDetailsList, info, path, items, positionContext) { + const streamUsage = typeof path.key === 'number' + ? undefined + : getStreamUsage(this.validatedExecutionArgs, fieldDetailsList); + let containsPromise = false; + const completedResults = []; + const asyncIterator = items[Symbol.asyncIterator](); + let index = 0; + let iteration; + try { + while (true) { + if (streamUsage?.initialCount === index && + this.handleStream(index, path, { handle: asyncIterator, isAsync: true }, streamUsage, info, itemType)) { + break; + } + const itemPath = addPath(path, index, undefined); + try { + iteration = await asyncIterator.next(); + } + catch (rawError) { + throw locatedError(rawError, toNodes(fieldDetailsList), pathToArray(path)); + } + if (this.aborted || iteration.done) { + break; + } + const item = iteration.value; + if (this.completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) { + containsPromise = true; + } + index++; + } + } + catch (error) { + this.sharedExecutionContext.asyncWorkTracker.add(returnIteratorCatchingErrors(asyncIterator)); + if (containsPromise) { + this.sharedExecutionContext.asyncWorkTracker.addValues(completedResults); + } + throw error; + } + if (this.aborted) { + if (!iteration?.done) { + this.sharedExecutionContext.asyncWorkTracker.add(returnIteratorCatchingErrors(asyncIterator)); + } + throw new Error('Aborted!'); + } + return containsPromise + ? this.promiseAll(completedResults) + : completedResults; + } + handleStream(_index, _path, _iterator, _streamUsage, _info, _itemType) { + return false; + } + completeListValue(returnType, fieldDetailsList, info, path, result, positionContext) { + const itemType = returnType.ofType; + if (isAsyncIterable(result)) { + return this.completeAsyncIterableValue(itemType, fieldDetailsList, info, path, result, positionContext); + } + if (!isIterableObject(result)) { + throw new GraphQLError(`Expected Iterable, but did not find one for field "${info.parentType}.${info.fieldName}".`); + } + return this.completeIterableValue(itemType, fieldDetailsList, info, path, result, positionContext); + } + completeIterableValue(itemType, fieldDetailsList, info, path, items, positionContext) { + const streamUsage = typeof path.key === 'number' + ? undefined + : getStreamUsage(this.validatedExecutionArgs, fieldDetailsList); + let containsPromise = false; + const completedResults = []; + let index = 0; + const iterator = items[Symbol.iterator](); + try { + while (true) { + if (streamUsage?.initialCount === index && + this.handleStream(index, path, { handle: iterator }, streamUsage, info, itemType)) { + break; + } + const iteration = iterator.next(); + if (iteration.done) { + break; + } + const item = iteration.value; + const itemPath = addPath(path, index, undefined); + if (this.completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) { + containsPromise = true; + } + index++; + } + } + catch (error) { + const asyncWorkTracker = this.sharedExecutionContext.asyncWorkTracker; + if (containsPromise) { + asyncWorkTracker.addValues(completedResults); + } + asyncWorkTracker.addValues(collectIteratorPromises(iterator)); + throw error; + } + return containsPromise + ? this.promiseAll(completedResults) + : completedResults; + } + completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext) { + if (isPromiseLike(item)) { + completedResults.push(this.completePromisedListItemValue(item, itemType, fieldDetailsList, info, itemPath, positionContext)); + return true; + } + else if (this.completeListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) { + return true; + } + return false; + } + completeListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext) { + try { + const completedItem = this.completeValue(itemType, fieldDetailsList, info, itemPath, item, positionContext); + if (isPromise(completedItem)) { + completedResults.push(completedItem.then(undefined, (rawError) => { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return null; + })); + return true; + } + completedResults.push(completedItem); + } + catch (rawError) { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + completedResults.push(null); + } + return false; + } + async completePromisedListItemValue(item, itemType, fieldDetailsList, info, itemPath, positionContext) { + try { + const resolved = await item; + if (this.aborted) { + throw new Error('Aborted!'); + } + let completed = this.completeValue(itemType, fieldDetailsList, info, itemPath, resolved, positionContext); + if (isPromise(completed)) { + completed = await completed; + } + return completed; + } + catch (rawError) { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return null; + } + } + completeLeafValue(returnType, result) { + const coerced = returnType.coerceOutputValue(result); + if (coerced == null) { + throw new Error(`Expected \`${inspect(returnType)}.coerceOutputValue(${inspect(result)})\` to ` + + `return non-nullable value, returned: ${inspect(coerced)}`); + } + return coerced; + } + completeAbstractValue(returnType, fieldDetailsList, info, path, result, positionContext) { + const validatedExecutionArgs = this.validatedExecutionArgs; + const { schema, contextValue } = validatedExecutionArgs; + const resolveTypeFn = returnType.resolveType ?? validatedExecutionArgs.typeResolver; + const runtimeType = resolveTypeFn(result, contextValue, info, returnType); + if (isPromiseLike(runtimeType)) { + return runtimeType.then((resolvedRuntimeType) => { + if (this.aborted) { + throw new Error('Aborted!'); + } + return this.completeObjectValue(this.ensureValidRuntimeType(resolvedRuntimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, positionContext); + }); + } + return this.completeObjectValue(this.ensureValidRuntimeType(runtimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, positionContext); + } + ensureValidRuntimeType(runtimeTypeName, schema, returnType, fieldDetailsList, info, result) { + if (runtimeTypeName == null) { + throw new GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}". Either the "${returnType}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, { nodes: toNodes(fieldDetailsList) }); + } + if (typeof runtimeTypeName !== 'string') { + throw new GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}" with ` + + `value ${inspect(result)}, received "${inspect(runtimeTypeName)}", which is not a valid Object type name.`); + } + const runtimeType = schema.getType(runtimeTypeName); + if (runtimeType == null) { + throw new GraphQLError(`Abstract type "${returnType}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { nodes: toNodes(fieldDetailsList) }); + } + if (!isObjectType(runtimeType)) { + throw new GraphQLError(`Abstract type "${returnType}" was resolved to a non-object type "${runtimeTypeName}".`, { nodes: toNodes(fieldDetailsList) }); + } + if (!schema.isSubType(returnType, runtimeType)) { + throw new GraphQLError(`Runtime Object type "${runtimeType}" is not a possible type for "${returnType}".`, { nodes: toNodes(fieldDetailsList) }); + } + return runtimeType; + } + completeObjectValue(returnType, fieldDetailsList, info, path, result, positionContext) { + if (returnType.isTypeOf) { + const isTypeOf = returnType.isTypeOf(result, this.validatedExecutionArgs.contextValue, info); + if (isPromiseLike(isTypeOf)) { + return isTypeOf.then((resolvedIsTypeOf) => { + if (this.aborted) { + throw new Error('Aborted!'); + } + if (!resolvedIsTypeOf) { + throw this.invalidReturnTypeError(returnType, result, fieldDetailsList); + } + return this.collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext); + }); + } + if (!isTypeOf) { + throw this.invalidReturnTypeError(returnType, result, fieldDetailsList); + } + } + return this.collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext); + } + invalidReturnTypeError(returnType, result, fieldDetailsList) { + return new GraphQLError(`Expected value of type "${returnType}" but got: ${inspect(result)}.`, { nodes: toNodes(fieldDetailsList) }); + } + collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext) { + const { groupedFieldSet, newDeferUsages } = collectSubfields(this.validatedExecutionArgs, returnType, fieldDetailsList); + return this.executeCollectedSubfields(returnType, result, path, groupedFieldSet, newDeferUsages, positionContext); + } + executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, _newDeferUsages, _positionContext) { + return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, undefined); + } +} +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +//# sourceMappingURL=Executor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs.map new file mode 100644 index 00000000..bad5ffbb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/Executor.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Executor.js","sourceRoot":"","sources":["../../src/execution/Executor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,eAAe,EAAE,uCAAsC;AAChE,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAClE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iCAAgC;AACnE,OAAO,EAAE,QAAQ,EAAE,gCAA+B;AAClD,OAAO,EAAE,QAAQ,EAAE,gCAA+B;AAGlD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,4BAA2B;AAC1D,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAElE,OAAO,EAAE,aAAa,EAAE,qCAAoC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,wCAAuC;AAEpE,OA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BAA0B,CACpC,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACN,eAAe,CAChB,CAAC;IACJ,CAAC;IAED,sBAAsB,CACpB,UAA6B,EAC7B,MAAe,EACf,gBAAkC;QAElC,OAAO,IAAI,YAAY,CACrB,2BAA2B,UAAU,cAAc,OAAO,CAAC,MAAM,CAAC,GAAG,EACrE,EAAE,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAAE,CACrC,CAAC;IACJ,CAAC;IAED,0BAA0B,CACxB,UAA6B,EAC7B,gBAAkC,EAClC,IAAU,EACV,MAAe,EACf,eAA6C;QAG7C,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,gBAAgB,CAC1D,IAAI,CAAC,sBAAsB,EAC3B,UAAU,EACV,gBAAgB,CACjB,CAAC;QAEF,OAAO,IAAI,CAAC,yBAAyB,CACnC,UAAU,EACV,MAAM,EACN,IAAI,EACJ,eAAe,EACf,cAAc,EACd,eAAe,CAChB,CAAC;IACJ,CAAC;IAED,yBAAyB,CACvB,UAA6B,EAC7B,WAAoB,EACpB,IAAsB,EACtB,uBAAwC,EACxC,eAA0C,EAC1C,gBAA8C;QAE9C,OAAO,IAAI,CAAC,aAAa,CACvB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,uBAAuB,EACvB,SAAS,CACV,CAAC;IACJ,CAAC;CACF;AAED,SAAS,OAAO,CAAC,gBAAkC;IACjD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC","sourcesContent":["/** @category Execution */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isAsyncIterable } from '../jsutils/isAsyncIterable.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isPromise, isPromiseLike } from '../jsutils/isPromise.ts';\nimport { memoize2 } from '../jsutils/memoize2.ts';\nimport { memoize3 } from '../jsutils/memoize3.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport { addPath, pathToArray } from '../jsutils/Path.ts';\nimport { promiseForObject } from '../jsutils/promiseForObject.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\nimport { promiseReduce } from '../jsutils/promiseReduce.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport type { GraphQLFormattedError } from '../error/GraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\nimport { locatedError } from '../error/locatedError.ts';\n\nimport type { FieldNode } from '../language/ast.ts';\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport type {\n GraphQLAbstractType,\n GraphQLLeafType,\n GraphQLList,\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n} from '../type/definition.ts';\nimport {\n isAbstractType,\n isLeafType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type {\n GraphQLExecuteRootSelectionSetContext,\n GraphQLResolveContext,\n MinimalTracingChannel,\n} from '../diagnostics.ts';\nimport {\n executeRootSelectionSetChannel,\n resolveChannel,\n shouldTrace,\n traceMixed,\n} from '../diagnostics.ts';\n\nimport { AbortedGraphQLExecutionError } from './AbortedGraphQLExecutionError.ts';\nimport { buildResolveInfo } from './buildResolveInfo.ts';\nimport { withCancellation } from './cancellablePromise.ts';\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from './collectFields.ts';\nimport {\n collectFields,\n collectSubfields as _collectSubfields,\n} from './collectFields.ts';\nimport { collectIteratorPromises } from './collectIteratorPromises.ts';\nimport type { SharedExecutionContext } from './createSharedExecutionContext.ts';\nimport { createSharedExecutionContext } from './createSharedExecutionContext.ts';\nimport type { ValidatedExecutionArgs } from './ExecutionArgs.ts';\nimport type { StreamUsage } from './getStreamUsage.ts';\nimport { getStreamUsage as _getStreamUsage } from './getStreamUsage.ts';\nimport { runAsyncWorkFinishedHook } from './hooks.ts';\nimport { returnIteratorCatchingErrors } from './returnIteratorCatchingErrors.ts';\nimport { getArgumentValues } from './values.ts';\n\n/* eslint-disable max-params */\n// This file contains a lot of such errors but we plan to refactor it anyway\n// so just disable it for entire file.\n\n/**\n * Terminology\n *\n * \"Definitions\" are the generic name for top-level statements in the document.\n * Examples of this include:\n * 1) Operations (such as a query)\n * 2) Fragments\n *\n * \"Operations\" are a generic name for requests in the document.\n * Examples of this include:\n * 1) query,\n * 2) mutation\n *\n * \"Selections\" are the definitions that can appear legally and at\n * single level of the query. These include:\n * 1) field references e.g `a`\n * 2) fragment \"spreads\" e.g. `...c`\n * 3) inline fragment \"spreads\" e.g. `...on Type { a }`\n *\n * @internal\n */\n\n/**\n * A memoized collection of relevant subfields with regard to the return\n * type. Memoizing ensures the subfields are not repeatedly calculated, which\n * saves overhead when resolving lists of values.\n *\n * @internal\n */\nexport const collectSubfields: (\n validatedExecutionArgs: ValidatedExecutionArgs,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n) => ReturnType = memoize3(\n (\n validatedExecutionArgs: ValidatedExecutionArgs,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n ) => {\n const { schema, fragments, variableValues, hideSuggestions } =\n validatedExecutionArgs;\n return _collectSubfields(\n schema,\n fragments,\n variableValues,\n returnType,\n fieldDetailsList,\n hideSuggestions,\n );\n },\n);\n\n/** @internal */\nexport const getStreamUsage: typeof _getStreamUsage = memoize2(\n (\n validatedExecutionArgs: ValidatedExecutionArgs,\n fieldDetailsList: FieldDetailsList,\n ) => _getStreamUsage(validatedExecutionArgs, fieldDetailsList),\n);\n\nclass CollectedErrors {\n private _errorPositions: Set;\n private _errors: Array;\n constructor() {\n this._errorPositions = new Set();\n this._errors = [];\n }\n\n get errors(): ReadonlyArray {\n return this._errors;\n }\n\n add(error: GraphQLError, path: Path | undefined): void {\n // Do not modify errors list if the execution position for this error or\n // any of its ancestors has already been nulled via error propagation.\n // This check should be unnecessary for implementations able to implement\n // actual cancellation.\n if (this.hasNulledPosition(path)) {\n return;\n }\n this._errorPositions.add(path);\n this._errors.push(error);\n }\n\n hasNulledPosition(startPath: Path | undefined): boolean {\n let path = startPath;\n while (path !== undefined) {\n if (this._errorPositions.has(path)) {\n return true;\n }\n path = path.prev;\n }\n return this._errorPositions.has(undefined);\n }\n}\n\n/**\n * Represents the response produced by executing a GraphQL operation.\n * @typeParam TData - Shape of the execution data payload.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface ExecutionResult<\n TData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Errors raised while parsing, validating, or executing the operation. */\n errors?: ReadonlyArray;\n /** Data returned by execution, or null when execution could not produce data. */\n data?: TData | null;\n /** Additional non-standard metadata included in the execution result. */\n extensions?: TExtensions;\n}\n\n/**\n * A JSON-serializable GraphQL execution result.\n * @typeParam TData - Shape of the formatted data payload.\n * @typeParam TExtensions - Shape of the formatted extensions payload.\n */\nexport interface FormattedExecutionResult<\n TData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Errors raised while parsing, validating, or executing the operation. */\n errors?: ReadonlyArray;\n /** Data returned by execution, or null when execution could not produce data. */\n data?: TData | null;\n /** Additional non-standard metadata included in the formatted result. */\n extensions?: TExtensions;\n}\n\nconst defaultAbortReason = new Error('This operation was aborted');\n\n/** @internal */\nexport class Executor<\n TPositionContext = undefined, // No position context by default\n TAlternativeInitialResponse = ExecutionResult, // No alternative by default\n> {\n validatedExecutionArgs: ValidatedExecutionArgs;\n aborted: boolean;\n abortReason: unknown;\n sharedExecutionContext: SharedExecutionContext;\n collectedErrors: CollectedErrors;\n abortResultPromise: (() => void) | undefined;\n resolverAbortController: AbortController | undefined;\n getAbortSignal: () => AbortSignal | undefined;\n getAsyncHelpers: () => GraphQLResolveInfoHelpers;\n promiseAll: (\n values: ReadonlyArray>,\n ) => Promise>;\n\n constructor(\n validatedExecutionArgs: ValidatedExecutionArgs,\n sharedExecutionContext?: SharedExecutionContext,\n ) {\n this.validatedExecutionArgs = validatedExecutionArgs;\n this.aborted = false;\n this.abortReason = defaultAbortReason;\n this.collectedErrors = new CollectedErrors();\n\n if (sharedExecutionContext === undefined) {\n this.resolverAbortController = new AbortController();\n this.sharedExecutionContext = createSharedExecutionContext(\n this.resolverAbortController.signal,\n );\n } else {\n this.sharedExecutionContext = sharedExecutionContext;\n }\n const { getAbortSignal, getAsyncHelpers, promiseAll } =\n this.sharedExecutionContext;\n this.getAbortSignal = getAbortSignal;\n this.getAsyncHelpers = getAsyncHelpers;\n this.promiseAll = promiseAll;\n }\n\n executeRootSelectionSet(\n serially?: boolean,\n ): PromiseOrValue {\n if (!shouldTrace(executeRootSelectionSetChannel)) {\n return this.executeRootSelectionSetImpl(serially);\n }\n return traceMixed(\n executeRootSelectionSetChannel,\n this.buildExecuteContextFromValidatedArgs(this.validatedExecutionArgs),\n () => this.executeRootSelectionSetImpl(serially),\n );\n }\n\n /**\n * Build a root-selection-set tracing context from validated execution\n * arguments. The operation has already been selected during argument\n * validation.\n * @internal\n */\n buildExecuteContextFromValidatedArgs(\n args: ValidatedExecutionArgs,\n ): GraphQLExecuteRootSelectionSetContext {\n return {\n schema: args.schema,\n document: args.document,\n operation: args.operation,\n rawVariableValues: args.rawVariableValues,\n operationName: args.operation.name?.value,\n operationType: args.operation.operation,\n };\n }\n\n executeRootSelectionSetImpl(\n serially?: boolean,\n ): PromiseOrValue {\n const externalAbortSignal = this.validatedExecutionArgs.externalAbortSignal;\n let removeExternalAbortListener: (() => void) | undefined;\n if (externalAbortSignal) {\n externalAbortSignal.throwIfAborted();\n const onExternalAbort = () => {\n this.abort(externalAbortSignal.reason);\n };\n removeExternalAbortListener = () =>\n externalAbortSignal.removeEventListener('abort', onExternalAbort);\n externalAbortSignal.addEventListener('abort', onExternalAbort);\n }\n\n const maybeRemoveExternalAbortListener = () => {\n removeExternalAbortListener?.();\n };\n\n let result: PromiseOrValue>;\n try {\n const {\n schema,\n fragments,\n rootValue,\n operation,\n variableValues,\n hideSuggestions,\n } = this.validatedExecutionArgs;\n\n const { operation: operationType, selectionSet } = operation;\n\n const rootType = schema.getRootType(operationType);\n if (rootType == null) {\n throw new GraphQLError(\n `Schema is not configured to execute ${operationType} operation.`,\n { nodes: operation },\n );\n }\n\n const { groupedFieldSet, newDeferUsages } = collectFields(\n schema,\n fragments,\n variableValues,\n rootType,\n selectionSet,\n hideSuggestions,\n );\n\n result = this.executeCollectedRootFields(\n rootType,\n rootValue,\n groupedFieldSet,\n serially ?? operationType === OperationTypeNode.MUTATION,\n newDeferUsages,\n );\n\n if (isPromise(result)) {\n const promise = result.then(\n (data) => {\n maybeRemoveExternalAbortListener();\n return this.buildResponse(data);\n },\n (error: unknown) => {\n maybeRemoveExternalAbortListener();\n this.collectedErrors.add(ensureGraphQLError(error), undefined);\n return this.buildResponse(null);\n },\n );\n this.sharedExecutionContext.asyncWorkTracker.add(promise);\n const { promise: cancellablePromise, abort: abortResultPromise } =\n withCancellation(promise.then((resolved) => this.finish(resolved)));\n this.abortResultPromise = () => {\n abortResultPromise(this.createAbortedExecutionError(promise));\n };\n if (this.aborted) {\n this.abortResultPromise();\n }\n return cancellablePromise;\n }\n maybeRemoveExternalAbortListener();\n } catch (error) {\n maybeRemoveExternalAbortListener();\n this.collectedErrors.add(ensureGraphQLError(error), undefined);\n return this.finish(this.buildResponse(null));\n }\n return this.finish(this.buildResponse(result));\n }\n\n abort(reason?: unknown): void {\n if (this.aborted) {\n return;\n }\n this.aborted = true;\n if (reason !== undefined) {\n this.abortReason = reason;\n }\n this.abortResultPromise?.();\n this.resolverAbortController?.abort(this.abortReason);\n }\n\n finish(result: T): T {\n if (this.aborted) {\n throw this.createAbortedExecutionError(result);\n }\n this.aborted = true;\n return result;\n }\n\n createAbortedExecutionError(\n result: PromiseOrValue,\n ): AbortedGraphQLExecutionError {\n return new AbortedGraphQLExecutionError(this.abortReason, result);\n }\n\n getFinishSharedExecution(): () => void {\n const resolverAbortController = this.resolverAbortController;\n const asyncWorkFinishedHook =\n this.validatedExecutionArgs.hooks?.asyncWorkFinished;\n if (asyncWorkFinishedHook === undefined) {\n return () => resolverAbortController?.abort();\n }\n\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n return () => {\n resolverAbortController?.abort();\n runAsyncWorkFinishedHook(\n validatedExecutionArgs,\n sharedExecutionContext,\n asyncWorkFinishedHook,\n );\n };\n }\n\n /**\n * Given a completed execution context and data, build the `{ errors, data }`\n * response defined by the \"Response\" section of the GraphQL specification.\n *\n * @internal\n */\n buildResponse(\n data: ObjMap | null,\n ): ExecutionResult | TAlternativeInitialResponse {\n this.getFinishSharedExecution()();\n const errors = this.collectedErrors.errors;\n return errors.length ? { errors, data } : { data };\n }\n\n executeCollectedRootFields(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n originalGroupedFieldSet: GroupedFieldSet,\n serially: boolean,\n _newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n return this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n originalGroupedFieldSet,\n serially,\n undefined,\n );\n }\n\n executeRootGroupedFieldSet(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n groupedFieldSet: GroupedFieldSet,\n serially: boolean,\n positionContext?: TPositionContext,\n ): PromiseOrValue> {\n return serially\n ? this.executeFieldsSerially(\n rootType,\n rootValue,\n undefined,\n groupedFieldSet,\n positionContext,\n )\n : this.executeFields(\n rootType,\n rootValue,\n undefined,\n groupedFieldSet,\n positionContext,\n );\n }\n\n /**\n * Implements the \"Executing selection sets\" section of the spec\n * for fields that must be executed serially.\n *\n * @internal\n */\n executeFieldsSerially(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n groupedFieldSet: GroupedFieldSet,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n let tracingChannel = shouldTrace(resolveChannel)\n ? resolveChannel\n : undefined;\n\n return promiseReduce(\n groupedFieldSet,\n (results, [responseName, fieldDetailsList]) => {\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n const fieldPath = addPath(path, responseName, parentType.name);\n const result = this.executeField(\n parentType,\n sourceValue,\n fieldDetailsList,\n fieldPath,\n positionContext,\n tracingChannel,\n );\n if (result === undefined) {\n return results;\n }\n if (isPromise(result)) {\n return result.then((resolved) => {\n results[responseName] = resolved;\n tracingChannel = shouldTrace(resolveChannel)\n ? resolveChannel\n : undefined;\n return results;\n });\n }\n results[responseName] = result;\n return results;\n },\n Object.create(null),\n );\n }\n\n /**\n * Implements the \"Executing selection sets\" section of the spec\n * for fields that may be executed in parallel.\n *\n * @internal\n */\n executeFields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n groupedFieldSet: GroupedFieldSet,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n const results = Object.create(null);\n let containsPromise = false;\n const tracingChannel = shouldTrace(resolveChannel)\n ? resolveChannel\n : undefined;\n\n try {\n for (const [responseName, fieldDetailsList] of groupedFieldSet) {\n const fieldPath = addPath(path, responseName, parentType.name);\n const result = this.executeField(\n parentType,\n sourceValue,\n fieldDetailsList,\n fieldPath,\n positionContext,\n tracingChannel,\n );\n\n if (result !== undefined) {\n results[responseName] = result;\n if (isPromise(result)) {\n containsPromise = true;\n }\n }\n }\n } catch (error) {\n if (containsPromise) {\n this.sharedExecutionContext.asyncWorkTracker.addValues(\n Object.values(results),\n );\n }\n throw error;\n }\n\n // If there are no promises, we can just return the object and any incrementalDataRecords\n if (!containsPromise) {\n return results;\n }\n\n // Otherwise, results is a map from field name to the result of resolving that\n // field, which is possibly a promise. Return a promise that will return this\n // same map, but with any promises replaced with the values they resolved to.\n return promiseForObject(results, this.promiseAll);\n }\n\n /**\n * Implements the \"Executing fields\" section of the spec\n * In particular, this function figures out the value that the field returns by\n * calling its resolve function, then calls completeValue to complete promises,\n * coercing scalars, or execute the sub-selection-set for objects.\n *\n * @internal\n */\n executeField(\n parentType: GraphQLObjectType,\n source: unknown,\n fieldDetailsList: FieldDetailsList,\n path: Path,\n positionContext: TPositionContext | undefined,\n tracingChannel: MinimalTracingChannel | undefined,\n ): PromiseOrValue {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const { schema, contextValue, variableValues, hideSuggestions } =\n validatedExecutionArgs;\n const firstFieldDetails = fieldDetailsList[0];\n const firstNode = firstFieldDetails.node;\n const fieldName = firstNode.name.value;\n const fieldDef = schema.getField(parentType, fieldName);\n if (!fieldDef) {\n return;\n }\n\n const returnType = fieldDef.type;\n let resolveFn = fieldDef.resolve ?? validatedExecutionArgs.fieldResolver;\n\n if (tracingChannel !== undefined) {\n const originalResolveFn = resolveFn;\n resolveFn = (s, args, c, info) =>\n traceMixed(\n tracingChannel,\n this.buildResolveContext(args, info, fieldDef.resolve === undefined),\n () => originalResolveFn(s, args, c, info),\n );\n }\n\n const info = buildResolveInfo(\n validatedExecutionArgs,\n fieldDef,\n toNodes(fieldDetailsList),\n parentType,\n path,\n this.getAbortSignal,\n this.getAsyncHelpers,\n );\n\n // Get the resolve function, regardless of if its result is normal or abrupt (error).\n try {\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n // TODO: find a way to memoize, in case this field is within a List type.\n const args = getArgumentValues(\n fieldDef,\n firstNode,\n variableValues,\n firstFieldDetails.fragmentVariableValues,\n hideSuggestions,\n );\n\n // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n const result = resolveFn(source, args, contextValue, info);\n\n if (isPromiseLike(result)) {\n return this.completePromisedValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n const completed = this.completeValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n\n if (isPromise(completed)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n return completed.then(undefined, (rawError: unknown) => {\n this.handleFieldError(rawError, returnType, fieldDetailsList, path);\n return null;\n });\n }\n return completed;\n } catch (rawError) {\n this.handleFieldError(rawError, returnType, fieldDetailsList, path);\n return null;\n }\n }\n\n /**\n * Build a graphql:resolve channel context for a single field invocation.\n *\n * `fieldPath` is exposed as a lazy getter because serializing the response\n * path is O(depth) and APMs that depth-filter or skip default resolvers\n * often never read it. `args` is passed through by reference.\n * @internal\n */\n buildResolveContext(\n args: ObjMap,\n info: GraphQLResolveInfo,\n isDefaultResolver: boolean,\n ): GraphQLResolveContext {\n let cachedFieldPath: string | undefined;\n return {\n fieldName: info.fieldName,\n alias: String(info.path.key),\n parentType: info.parentType.name,\n fieldType: String(info.returnType),\n args,\n isDefaultResolver,\n get fieldPath() {\n cachedFieldPath ??= pathToArray(info.path).join('.');\n return cachedFieldPath;\n },\n };\n }\n\n handleFieldError(\n rawError: unknown,\n returnType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n path: Path,\n ): void {\n const error = locatedError(\n rawError,\n toNodes(fieldDetailsList),\n pathToArray(path),\n );\n\n // If the field type is non-nullable, then it is resolved without any\n // protection from errors, however it still properly locates the error.\n if (\n this.validatedExecutionArgs.errorPropagation &&\n isNonNullType(returnType)\n ) {\n throw error;\n }\n\n // Otherwise, error protection is applied, logging the error and resolving\n // a null value for this field if one is encountered.\n this.collectedErrors.add(error, path);\n }\n\n /**\n * Implements the instructions for completeValue as defined in the\n * \"Value Completion\" section of the spec.\n *\n * If the field type is Non-Null, then this recursively completes the value\n * for the inner type. It throws a field error if that completion returns null,\n * as per the \"Nullability\" section of the spec.\n *\n * If the field type is a List, then this recursively completes the value\n * for the inner type on each item in the list.\n *\n * If the field type is a Scalar or Enum, ensures the completed value is a legal\n * value of the type by calling the `coerceOutputValue` method of GraphQL type\n * definition.\n *\n * If the field is an abstract type, determine the runtime type of the value\n * and then complete based on that type\n *\n * Otherwise, the field type expects a sub-selection set, and will complete the\n * value by executing all sub-selections.\n *\n * @internal\n */\n completeValue(\n returnType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n }\n\n // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n if (isNonNullType(returnType)) {\n const completed = this.completeValue(\n returnType.ofType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n if (completed === null) {\n throw new Error(\n `Cannot return null for non-nullable field ${info.parentType}.${info.fieldName}.`,\n );\n }\n return completed;\n }\n\n // If result value is null or undefined then return null.\n if (result == null) {\n return null;\n }\n\n // If field type is List, complete each item in the list with the inner type\n if (isListType(returnType)) {\n return this.completeListValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n // If field type is a leaf type, Scalar or Enum, coerce to a valid value,\n // returning null if coercion is not possible.\n if (isLeafType(returnType)) {\n return this.completeLeafValue(returnType, result);\n }\n\n // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n if (isAbstractType(returnType)) {\n return this.completeAbstractValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n // If field type is Object, execute and complete all sub-selections.\n if (isObjectType(returnType)) {\n return this.completeObjectValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n /* node:coverage ignore next 7 */\n }\n // Not reachable, all possible output types have been considered.\n invariant(\n false,\n 'Cannot complete value of unexpected output type: ' + inspect(returnType),\n );\n }\n\n async completePromisedValue(\n returnType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: PromiseLike,\n positionContext: TPositionContext | undefined,\n ): Promise {\n try {\n const resolved = await result;\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n let completed = this.completeValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n resolved,\n positionContext,\n );\n\n if (isPromise(completed)) {\n completed = await completed;\n }\n return completed;\n } catch (rawError) {\n this.handleFieldError(rawError, returnType, fieldDetailsList, path);\n return null;\n }\n }\n\n /**\n * Complete a async iterator value by completing the result and calling\n * recursively until all the results are completed.\n *\n * @internal\n */\n async completeAsyncIterableValue(\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n items: AsyncIterable,\n positionContext: TPositionContext | undefined,\n ): Promise> {\n // do not stream inner lists of multi-dimensional lists\n const streamUsage =\n typeof path.key === 'number'\n ? undefined\n : getStreamUsage(this.validatedExecutionArgs, fieldDetailsList);\n\n let containsPromise = false;\n const completedResults: Array = [];\n const asyncIterator = items[Symbol.asyncIterator]();\n let index = 0;\n let iteration;\n try {\n while (true) {\n if (\n streamUsage?.initialCount === index &&\n this.handleStream(\n index,\n path,\n { handle: asyncIterator, isAsync: true },\n streamUsage,\n info,\n itemType,\n )\n ) {\n break;\n }\n const itemPath = addPath(path, index, undefined);\n try {\n // eslint-disable-next-line no-await-in-loop\n iteration = await asyncIterator.next();\n } catch (rawError) {\n throw locatedError(\n rawError,\n toNodes(fieldDetailsList),\n pathToArray(path),\n );\n }\n if (this.aborted || iteration.done) {\n break;\n }\n const item = iteration.value;\n if (\n this.completeMaybePromisedListItemValue(\n item,\n completedResults,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n )\n ) {\n containsPromise = true;\n }\n index++;\n }\n } catch (error) {\n this.sharedExecutionContext.asyncWorkTracker.add(\n returnIteratorCatchingErrors(asyncIterator),\n );\n if (containsPromise) {\n this.sharedExecutionContext.asyncWorkTracker.addValues(\n completedResults,\n );\n }\n throw error;\n }\n\n // Throwing on completion outside of the loop may allow engines to better optimize\n if (this.aborted) {\n if (!iteration?.done) {\n this.sharedExecutionContext.asyncWorkTracker.add(\n returnIteratorCatchingErrors(asyncIterator),\n );\n }\n throw new Error('Aborted!');\n }\n\n return containsPromise\n ? this.promiseAll(completedResults)\n : completedResults;\n }\n\n /* node:coverage ignore next 12 */\n handleStream(\n _index: number,\n _path: Path,\n _iterator:\n | { handle: Iterator; isAsync?: never }\n | { handle: AsyncIterator; isAsync: true },\n _streamUsage: StreamUsage,\n _info: GraphQLResolveInfo,\n _itemType: GraphQLOutputType,\n ): boolean {\n return false;\n }\n\n /**\n * Complete a list value by completing each item in the list with the\n * inner type\n *\n * @internal\n */\n completeListValue(\n returnType: GraphQLList,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n const itemType = returnType.ofType;\n\n if (isAsyncIterable(result)) {\n return this.completeAsyncIterableValue(\n itemType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n if (!isIterableObject(result)) {\n throw new GraphQLError(\n `Expected Iterable, but did not find one for field \"${info.parentType}.${info.fieldName}\".`,\n );\n }\n\n return this.completeIterableValue(\n itemType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n completeIterableValue(\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n items: Iterable,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n // do not stream inner lists of multi-dimensional lists\n const streamUsage =\n typeof path.key === 'number'\n ? undefined\n : getStreamUsage(this.validatedExecutionArgs, fieldDetailsList);\n\n // This is specified as a simple map, however we're optimizing the path\n // where the list contains no Promises by avoiding creating another Promise.\n let containsPromise = false;\n const completedResults: Array = [];\n let index = 0;\n const iterator = items[Symbol.iterator]();\n try {\n while (true) {\n if (\n streamUsage?.initialCount === index &&\n this.handleStream(\n index,\n path,\n { handle: iterator },\n streamUsage,\n info,\n itemType,\n )\n ) {\n break;\n }\n const iteration = iterator.next();\n if (iteration.done) {\n break;\n }\n\n const item = iteration.value;\n\n // No need to modify the info object containing the path,\n // since from here on it is not ever accessed by resolver functions.\n const itemPath = addPath(path, index, undefined);\n\n if (\n this.completeMaybePromisedListItemValue(\n item,\n completedResults,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n )\n ) {\n containsPromise = true;\n }\n\n index++;\n }\n } catch (error) {\n const asyncWorkTracker = this.sharedExecutionContext.asyncWorkTracker;\n if (containsPromise) {\n asyncWorkTracker.addValues(completedResults);\n }\n asyncWorkTracker.addValues(collectIteratorPromises(iterator));\n throw error;\n }\n\n return containsPromise\n ? this.promiseAll(completedResults)\n : completedResults;\n }\n\n completeMaybePromisedListItemValue(\n item: unknown,\n completedResults: Array,\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemPath: Path,\n positionContext: TPositionContext | undefined,\n ): boolean {\n if (isPromiseLike(item)) {\n completedResults.push(\n this.completePromisedListItemValue(\n item,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n ),\n );\n return true;\n } else if (\n this.completeListItemValue(\n item,\n completedResults,\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n positionContext,\n )\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Complete a list item value by adding it to the completed results.\n *\n * Returns true if the value is a Promise.\n *\n * @internal\n */\n completeListItemValue(\n item: unknown,\n completedResults: Array,\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemPath: Path,\n positionContext: TPositionContext | undefined,\n ): boolean {\n try {\n const completedItem = this.completeValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n item,\n positionContext,\n );\n\n if (isPromise(completedItem)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n completedResults.push(\n completedItem.then(undefined, (rawError: unknown) => {\n this.handleFieldError(\n rawError,\n itemType,\n fieldDetailsList,\n itemPath,\n );\n return null;\n }),\n );\n return true;\n }\n\n completedResults.push(completedItem);\n } catch (rawError) {\n this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);\n completedResults.push(null);\n }\n return false;\n }\n\n async completePromisedListItemValue(\n item: PromiseLike,\n itemType: GraphQLOutputType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemPath: Path,\n positionContext: TPositionContext | undefined,\n ): Promise {\n try {\n const resolved = await item;\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n let completed = this.completeValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n resolved,\n positionContext,\n );\n if (isPromise(completed)) {\n completed = await completed;\n }\n return completed;\n } catch (rawError) {\n this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);\n return null;\n }\n }\n\n /**\n * Complete a Scalar or Enum by serializing to a valid value, returning\n * null if serialization is not possible.\n *\n * @internal\n */\n completeLeafValue(returnType: GraphQLLeafType, result: unknown): unknown {\n const coerced = returnType.coerceOutputValue(result);\n if (coerced == null) {\n throw new Error(\n `Expected \\`${inspect(returnType)}.coerceOutputValue(${inspect(result)})\\` to ` +\n `return non-nullable value, returned: ${inspect(coerced)}`,\n );\n }\n return coerced;\n }\n\n /**\n * Complete a value of an abstract type by determining the runtime object type\n * of that value, then complete the value for that type.\n *\n * @internal\n */\n completeAbstractValue(\n returnType: GraphQLAbstractType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const { schema, contextValue } = validatedExecutionArgs;\n const resolveTypeFn =\n returnType.resolveType ?? validatedExecutionArgs.typeResolver;\n const runtimeType = resolveTypeFn(result, contextValue, info, returnType);\n\n if (isPromiseLike(runtimeType)) {\n return runtimeType.then((resolvedRuntimeType) => {\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n return this.completeObjectValue(\n this.ensureValidRuntimeType(\n resolvedRuntimeType,\n schema,\n returnType,\n fieldDetailsList,\n info,\n result,\n ),\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n });\n }\n\n return this.completeObjectValue(\n this.ensureValidRuntimeType(\n runtimeType,\n schema,\n returnType,\n fieldDetailsList,\n info,\n result,\n ),\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n\n ensureValidRuntimeType(\n runtimeTypeName: unknown,\n schema: GraphQLSchema,\n returnType: GraphQLAbstractType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n result: unknown,\n ): GraphQLObjectType {\n if (runtimeTypeName == null) {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" must resolve to an Object type at runtime for field \"${info.parentType}.${info.fieldName}\". Either the \"${returnType}\" type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function.`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n if (typeof runtimeTypeName !== 'string') {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" must resolve to an Object type at runtime for field \"${info.parentType}.${info.fieldName}\" with ` +\n `value ${inspect(result)}, received \"${inspect(\n runtimeTypeName,\n )}\", which is not a valid Object type name.`,\n );\n }\n\n const runtimeType = schema.getType(runtimeTypeName);\n if (runtimeType == null) {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" was resolved to a type \"${runtimeTypeName}\" that does not exist inside the schema.`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n if (!isObjectType(runtimeType)) {\n throw new GraphQLError(\n `Abstract type \"${returnType}\" was resolved to a non-object type \"${runtimeTypeName}\".`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n if (!schema.isSubType(returnType, runtimeType)) {\n throw new GraphQLError(\n `Runtime Object type \"${runtimeType}\" is not a possible type for \"${returnType}\".`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n return runtimeType;\n }\n\n /**\n * Complete an Object value by executing all sub-selections.\n *\n * @internal\n */\n completeObjectValue(\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n // If there is an isTypeOf predicate function, call it with the\n // current result. If isTypeOf returns false, then raise an error rather\n // than continuing execution.\n if (returnType.isTypeOf) {\n const isTypeOf = returnType.isTypeOf(\n result,\n this.validatedExecutionArgs.contextValue,\n info,\n );\n\n if (isPromiseLike(isTypeOf)) {\n return isTypeOf.then((resolvedIsTypeOf) => {\n if (this.aborted) {\n throw new Error('Aborted!');\n }\n if (!resolvedIsTypeOf) {\n throw this.invalidReturnTypeError(\n returnType,\n result,\n fieldDetailsList,\n );\n }\n return this.collectAndExecuteSubfields(\n returnType,\n fieldDetailsList,\n path,\n result,\n positionContext,\n );\n });\n }\n\n if (!isTypeOf) {\n throw this.invalidReturnTypeError(returnType, result, fieldDetailsList);\n }\n }\n\n return this.collectAndExecuteSubfields(\n returnType,\n fieldDetailsList,\n path,\n result,\n positionContext,\n );\n }\n\n invalidReturnTypeError(\n returnType: GraphQLObjectType,\n result: unknown,\n fieldDetailsList: FieldDetailsList,\n ): GraphQLError {\n return new GraphQLError(\n `Expected value of type \"${returnType}\" but got: ${inspect(result)}.`,\n { nodes: toNodes(fieldDetailsList) },\n );\n }\n\n collectAndExecuteSubfields(\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n path: Path,\n result: unknown,\n positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n // Collect sub-fields to execute to complete this value.\n const { groupedFieldSet, newDeferUsages } = collectSubfields(\n this.validatedExecutionArgs,\n returnType,\n fieldDetailsList,\n );\n\n return this.executeCollectedSubfields(\n returnType,\n result,\n path,\n groupedFieldSet,\n newDeferUsages,\n positionContext,\n );\n }\n\n executeCollectedSubfields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n originalGroupedFieldSet: GroupedFieldSet,\n _newDeferUsages: ReadonlyArray,\n _positionContext: TPositionContext | undefined,\n ): PromiseOrValue> {\n return this.executeFields(\n parentType,\n sourceValue,\n path,\n originalGroupedFieldSet,\n undefined,\n );\n }\n}\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.mts new file mode 100644 index 00000000..0eed8407 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.mts @@ -0,0 +1,12 @@ +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { Path } from "../jsutils/Path.mjs"; +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.mjs"; +import type { GraphQLList, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo } from "../type/index.mjs"; +import type { DeferUsage, FieldDetailsList, GroupedFieldSet } from "./collectFields.mjs"; +import { Executor } from "./Executor.mjs"; +/** @internal */ +export declare class ExecutorThrowingOnIncremental extends Executor { + executeCollectedRootFields(rootType: GraphQLObjectType, rootValue: unknown, originalGroupedFieldSet: GroupedFieldSet, serially: boolean, newDeferUsages: ReadonlyArray): PromiseOrValue>; + executeCollectedSubfields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, originalGroupedFieldSet: GroupedFieldSet, newDeferUsages: ReadonlyArray): PromiseOrValue>; + completeListValue(returnType: GraphQLList, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: undefined): PromiseOrValue>; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.ts new file mode 100644 index 00000000..50c5c383 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.d.ts @@ -0,0 +1,12 @@ +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { Path } from "../jsutils/Path.js"; +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.js"; +import type { GraphQLList, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo } from "../type/index.js"; +import type { DeferUsage, FieldDetailsList, GroupedFieldSet } from "./collectFields.js"; +import { Executor } from "./Executor.js"; +/** @internal */ +export declare class ExecutorThrowingOnIncremental extends Executor { + executeCollectedRootFields(rootType: GraphQLObjectType, rootValue: unknown, originalGroupedFieldSet: GroupedFieldSet, serially: boolean, newDeferUsages: ReadonlyArray): PromiseOrValue>; + executeCollectedSubfields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, originalGroupedFieldSet: GroupedFieldSet, newDeferUsages: ReadonlyArray): PromiseOrValue>; + completeListValue(returnType: GraphQLList, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, path: Path, result: unknown, positionContext: undefined): PromiseOrValue>; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js new file mode 100644 index 00000000..e863e99d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutorThrowingOnIncremental = void 0; +const invariant_ts_1 = require("../jsutils/invariant.js"); +const ast_ts_1 = require("../language/ast.js"); +const Executor_ts_1 = require("./Executor.js"); +const UNEXPECTED_MULTIPLE_PAYLOADS = 'Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)'; +class ExecutorThrowingOnIncremental extends Executor_ts_1.Executor { + executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, newDeferUsages) { + if (newDeferUsages.length > 0) { + if (!(this.validatedExecutionArgs.operation.operation !== + ast_ts_1.OperationTypeNode.SUBSCRIPTION)) + (0, invariant_ts_1.invariant)(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS); + this.abort(reason); + throw reason; + } + return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, undefined); + } + executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, newDeferUsages) { + if (newDeferUsages.length > 0) { + if (!(this.validatedExecutionArgs.operation.operation !== + ast_ts_1.OperationTypeNode.SUBSCRIPTION)) + (0, invariant_ts_1.invariant)(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS); + this.abort(reason); + throw reason; + } + return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, undefined); + } + completeListValue(returnType, fieldDetailsList, info, path, result, positionContext) { + const streamUsage = (0, Executor_ts_1.getStreamUsage)(this.validatedExecutionArgs, fieldDetailsList); + if (streamUsage !== undefined) { + if (!(this.validatedExecutionArgs.operation.operation !== + ast_ts_1.OperationTypeNode.SUBSCRIPTION)) + (0, invariant_ts_1.invariant)(false, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); + const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS); + this.abort(reason); + throw reason; + } + return super.completeListValue(returnType, fieldDetailsList, info, path, result, positionContext); + } +} +exports.ExecutorThrowingOnIncremental = ExecutorThrowingOnIncremental; +//# sourceMappingURL=ExecutorThrowingOnIncremental.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js.map new file mode 100644 index 00000000..db6992a4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExecutorThrowingOnIncremental.js","sourceRoot":"","sources":["../../src/execution/ExecutorThrowingOnIncremental.ts"],"names":[],"mappings":";;;AAAA,0DAAoD;AAKpD,+CAAuD;AAcvD,+CAAyD;AAEzD,MAAM,4BAA4B,GAChC,oHAAoH,CAAC;AAGvH,MAAa,6BAA8B,SAAQ,sBAAQ;IAChD,0BAA0B,CACjC,QAA2B,EAC3B,SAAkB,EAClB,uBAAwC,EACxC,QAAiB,EACjB,cAAyC;QAEzC,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;kBAE5B,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,SAAS;gBAC7C,0BAAiB,CAAC,YAAY;oBAFlC,wBAAS,SAGP,wHAAwH;YAE1H,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnB,MAAM,MAAM,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC,0BAA0B,CACpC,QAAQ,EACR,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,SAAS,CACV,CAAC;IACJ,CAAC;IAEQ,yBAAyB,CAChC,UAA6B,EAC7B,WAAoB,EACpB,IAAsB,EACtB,uBAAwC,EACxC,cAAyC;QAEzC,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;kBAE5B,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,SAAS;gBAC7C,0BAAiB,CAAC,YAAY;oBAFlC,wBAAS,SAGP,wHAAwH;YAE1H,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnB,MAAM,MAAM,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CACvB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,uBAAuB,EACvB,SAAS,CACV,CAAC;IACJ,CAAC;IAGQ,iBAAiB,CACxB,UAA0C,EAC1C,gBAAkC,EAClC,IAAwB,EACxB,IAAU,EACV,MAAe,EACf,eAA0B;QAE1B,MAAM,WAAW,GAAG,IAAA,4BAAc,EAChC,IAAI,CAAC,sBAAsB,EAC3B,gBAAgB,CACjB,CAAC;QACF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;kBAE5B,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,SAAS;gBAC7C,0BAAiB,CAAC,YAAY;oBAFlC,wBAAS,SAGP,0HAA0H;YAG5H,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnB,MAAM,MAAM,CAAC;QACf,CAAC;QAED,OAAO,KAAK,CAAC,iBAAiB,CAC5B,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,eAAe,CAChB,CAAC;IACJ,CAAC;CACF;AAxFD,sEAwFC","sourcesContent":["import { invariant } from '../jsutils/invariant.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport type {\n GraphQLList,\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n} from '../type/index.ts';\n\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from './collectFields.ts';\nimport { Executor, getStreamUsage } from './Executor.ts';\n\nconst UNEXPECTED_MULTIPLE_PAYLOADS =\n 'Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)';\n\n/** @internal */\nexport class ExecutorThrowingOnIncremental extends Executor {\n override executeCollectedRootFields(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n originalGroupedFieldSet: GroupedFieldSet,\n serially: boolean,\n newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n if (newDeferUsages.length > 0) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);\n this.abort(reason);\n throw reason;\n }\n return this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n originalGroupedFieldSet,\n serially,\n undefined,\n );\n }\n\n override executeCollectedSubfields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n originalGroupedFieldSet: GroupedFieldSet,\n newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n if (newDeferUsages.length > 0) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);\n this.abort(reason);\n throw reason;\n }\n\n return this.executeFields(\n parentType,\n sourceValue,\n path,\n originalGroupedFieldSet,\n undefined,\n );\n }\n\n // eslint-disable-next-line max-params\n override completeListValue(\n returnType: GraphQLList,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: undefined,\n ): PromiseOrValue> {\n const streamUsage = getStreamUsage(\n this.validatedExecutionArgs,\n fieldDetailsList,\n );\n if (streamUsage !== undefined) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.',\n );\n\n const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);\n this.abort(reason);\n throw reason;\n }\n\n return super.completeListValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs new file mode 100644 index 00000000..7c2660cd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs @@ -0,0 +1,41 @@ +import { invariant } from "../jsutils/invariant.mjs"; +import { OperationTypeNode } from "../language/ast.mjs"; +import { Executor, getStreamUsage } from "./Executor.mjs"; +const UNEXPECTED_MULTIPLE_PAYLOADS = 'Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)'; +export class ExecutorThrowingOnIncremental extends Executor { + executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, newDeferUsages) { + if (newDeferUsages.length > 0) { + if (!(this.validatedExecutionArgs.operation.operation !== + OperationTypeNode.SUBSCRIPTION)) + invariant(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS); + this.abort(reason); + throw reason; + } + return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, undefined); + } + executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, newDeferUsages) { + if (newDeferUsages.length > 0) { + if (!(this.validatedExecutionArgs.operation.operation !== + OperationTypeNode.SUBSCRIPTION)) + invariant(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS); + this.abort(reason); + throw reason; + } + return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, undefined); + } + completeListValue(returnType, fieldDetailsList, info, path, result, positionContext) { + const streamUsage = getStreamUsage(this.validatedExecutionArgs, fieldDetailsList); + if (streamUsage !== undefined) { + if (!(this.validatedExecutionArgs.operation.operation !== + OperationTypeNode.SUBSCRIPTION)) + invariant(false, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); + const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS); + this.abort(reason); + throw reason; + } + return super.completeListValue(returnType, fieldDetailsList, info, path, result, positionContext); + } +} +//# sourceMappingURL=ExecutorThrowingOnIncremental.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs.map new file mode 100644 index 00000000..afdc38ba --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ExecutorThrowingOnIncremental.js","sourceRoot":"","sources":["../../src/execution/ExecutorThrowingOnIncremental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAKpD,OAAO,EAAE,iBAAiB,EAAE,4BAA2B;AAcvD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,uBAAsB;AAEzD,MAAM,4BAA4B,GAChC,oHAAoH,CAAC;AAGvH,MAAM,OAAO,6BAA8B,SAAQ,QAAQ;IAChD,0BAA0B,CACjC,QAA2B,EAC3B,SAAkB,EAClB,uBAAwC,EACxC,QAAiB,EACjB,cAAyC;QAEzC,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;kBAE5B,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,SAAS;gBAC7C,iBAAiB,CAAC,YAAY;gBAFlC,SAAS,QAGP,wHAAwH;YAE1H,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnB,MAAM,MAAM,C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;IACJ,CAAC;CACF","sourcesContent":["import { invariant } from '../jsutils/invariant.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport type {\n GraphQLList,\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n} from '../type/index.ts';\n\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from './collectFields.ts';\nimport { Executor, getStreamUsage } from './Executor.ts';\n\nconst UNEXPECTED_MULTIPLE_PAYLOADS =\n 'Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)';\n\n/** @internal */\nexport class ExecutorThrowingOnIncremental extends Executor {\n override executeCollectedRootFields(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n originalGroupedFieldSet: GroupedFieldSet,\n serially: boolean,\n newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n if (newDeferUsages.length > 0) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);\n this.abort(reason);\n throw reason;\n }\n return this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n originalGroupedFieldSet,\n serially,\n undefined,\n );\n }\n\n override executeCollectedSubfields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n originalGroupedFieldSet: GroupedFieldSet,\n newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n if (newDeferUsages.length > 0) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);\n this.abort(reason);\n throw reason;\n }\n\n return this.executeFields(\n parentType,\n sourceValue,\n path,\n originalGroupedFieldSet,\n undefined,\n );\n }\n\n // eslint-disable-next-line max-params\n override completeListValue(\n returnType: GraphQLList,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n path: Path,\n result: unknown,\n positionContext: undefined,\n ): PromiseOrValue> {\n const streamUsage = getStreamUsage(\n this.validatedExecutionArgs,\n fieldDetailsList,\n );\n if (streamUsage !== undefined) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.',\n );\n\n const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);\n this.abort(reason);\n throw reason;\n }\n\n return super.completeListValue(\n returnType,\n fieldDetailsList,\n info,\n path,\n result,\n positionContext,\n );\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.mts new file mode 100644 index 00000000..370b0e07 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.mts @@ -0,0 +1,16 @@ +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { Path } from "../jsutils/Path.mjs"; +import type { FieldNode, FragmentDefinitionNode, OperationDefinitionNode } from "../language/ast.mjs"; +import type { GraphQLField, GraphQLObjectType, GraphQLResolveInfo, GraphQLResolveInfoHelpers } from "../type/index.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { VariableValues } from "./values.mjs"; +/** @internal */ +export interface BuildResolveInfoExecutionArgs { + schema: GraphQLSchema; + fragmentDefinitions: ObjMap; + rootValue: unknown; + operation: OperationDefinitionNode; + variableValues: VariableValues; +} +/** @internal */ +export declare function buildResolveInfo(validatedExecutionArgs: BuildResolveInfoExecutionArgs, fieldDef: GraphQLField, fieldNodes: ReadonlyArray, parentType: GraphQLObjectType, path: Path, getAbortSignal: () => AbortSignal | undefined, getAsyncHelpers: () => GraphQLResolveInfoHelpers): GraphQLResolveInfo; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.ts new file mode 100644 index 00000000..e220e45e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.d.ts @@ -0,0 +1,16 @@ +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { Path } from "../jsutils/Path.js"; +import type { FieldNode, FragmentDefinitionNode, OperationDefinitionNode } from "../language/ast.js"; +import type { GraphQLField, GraphQLObjectType, GraphQLResolveInfo, GraphQLResolveInfoHelpers } from "../type/index.js"; +import type { GraphQLSchema } from "../type/schema.js"; +import type { VariableValues } from "./values.js"; +/** @internal */ +export interface BuildResolveInfoExecutionArgs { + schema: GraphQLSchema; + fragmentDefinitions: ObjMap; + rootValue: unknown; + operation: OperationDefinitionNode; + variableValues: VariableValues; +} +/** @internal */ +export declare function buildResolveInfo(validatedExecutionArgs: BuildResolveInfoExecutionArgs, fieldDef: GraphQLField, fieldNodes: ReadonlyArray, parentType: GraphQLObjectType, path: Path, getAbortSignal: () => AbortSignal | undefined, getAsyncHelpers: () => GraphQLResolveInfoHelpers): GraphQLResolveInfo; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js new file mode 100644 index 00000000..16d414cc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildResolveInfo = buildResolveInfo; +function buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, parentType, path, getAbortSignal, getAsyncHelpers) { + const { schema, fragmentDefinitions, rootValue, operation, variableValues } = validatedExecutionArgs; + return { + fieldName: fieldDef.name, + fieldNodes, + returnType: fieldDef.type, + parentType, + path, + schema, + fragments: fragmentDefinitions, + rootValue, + operation, + variableValues, + getAbortSignal, + getAsyncHelpers, + }; +} +//# sourceMappingURL=buildResolveInfo.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js.map new file mode 100644 index 00000000..6b2d58bf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"buildResolveInfo.js","sourceRoot":"","sources":["../../src/execution/buildResolveInfo.ts"],"names":[],"mappings":";;AA8BA,4CA2BC;AA3BD,SAAgB,gBAAgB,CAC9B,sBAAqD,EACrD,QAAwC,EACxC,UAAoC,EACpC,UAA6B,EAC7B,IAAU,EACV,cAA6C,EAC7C,eAAgD;IAEhD,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,GACzE,sBAAsB,CAAC;IAGzB,OAAO;QACL,SAAS,EAAE,QAAQ,CAAC,IAAI;QACxB,UAAU;QACV,UAAU,EAAE,QAAQ,CAAC,IAAI;QACzB,UAAU;QACV,IAAI;QACJ,MAAM;QACN,SAAS,EAAE,mBAAmB;QAC9B,SAAS;QACT,SAAS;QACT,cAAc;QACd,cAAc;QACd,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\n\nimport type {\n FieldNode,\n FragmentDefinitionNode,\n OperationDefinitionNode,\n} from '../language/ast.ts';\n\nimport type {\n GraphQLField,\n GraphQLObjectType,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n} from '../type/index.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type { VariableValues } from './values.ts';\n\n/** @internal */\nexport interface BuildResolveInfoExecutionArgs {\n schema: GraphQLSchema;\n fragmentDefinitions: ObjMap;\n rootValue: unknown;\n operation: OperationDefinitionNode;\n variableValues: VariableValues;\n}\n\n/** @internal */\n// eslint-disable-next-line max-params\nexport function buildResolveInfo(\n validatedExecutionArgs: BuildResolveInfoExecutionArgs,\n fieldDef: GraphQLField,\n fieldNodes: ReadonlyArray,\n parentType: GraphQLObjectType,\n path: Path,\n getAbortSignal: () => AbortSignal | undefined,\n getAsyncHelpers: () => GraphQLResolveInfoHelpers,\n): GraphQLResolveInfo {\n const { schema, fragmentDefinitions, rootValue, operation, variableValues } =\n validatedExecutionArgs;\n // The resolve function's optional fourth argument is a collection of\n // information about the current execution state.\n return {\n fieldName: fieldDef.name,\n fieldNodes,\n returnType: fieldDef.type,\n parentType,\n path,\n schema,\n fragments: fragmentDefinitions,\n rootValue,\n operation,\n variableValues,\n getAbortSignal,\n getAsyncHelpers,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs new file mode 100644 index 00000000..d7db93ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs @@ -0,0 +1,18 @@ +export function buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, parentType, path, getAbortSignal, getAsyncHelpers) { + const { schema, fragmentDefinitions, rootValue, operation, variableValues } = validatedExecutionArgs; + return { + fieldName: fieldDef.name, + fieldNodes, + returnType: fieldDef.type, + parentType, + path, + schema, + fragments: fragmentDefinitions, + rootValue, + operation, + variableValues, + getAbortSignal, + getAsyncHelpers, + }; +} +//# sourceMappingURL=buildResolveInfo.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs.map new file mode 100644 index 00000000..4b2c95fd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/buildResolveInfo.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"buildResolveInfo.js","sourceRoot":"","sources":["../../src/execution/buildResolveInfo.ts"],"names":[],"mappings":"AA8BA,MAAM,UAAU,gBAAgB,CAC9B,sBAAqD,EACrD,QAAwC,EACxC,UAAoC,EACpC,UAA6B,EAC7B,IAAU,EACV,cAA6C,EAC7C,eAAgD;IAEhD,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,GACzE,sBAAsB,CAAC;IAGzB,OAAO;QACL,SAAS,EAAE,QAAQ,CAAC,IAAI;QACxB,UAAU;QACV,UAAU,EAAE,QAAQ,CAAC,IAAI;QACzB,UAAU;QACV,IAAI;QACJ,MAAM;QACN,SAAS,EAAE,mBAAmB;QAC9B,SAAS;QACT,SAAS;QACT,cAAc;QACd,cAAc;QACd,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\n\nimport type {\n FieldNode,\n FragmentDefinitionNode,\n OperationDefinitionNode,\n} from '../language/ast.ts';\n\nimport type {\n GraphQLField,\n GraphQLObjectType,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n} from '../type/index.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type { VariableValues } from './values.ts';\n\n/** @internal */\nexport interface BuildResolveInfoExecutionArgs {\n schema: GraphQLSchema;\n fragmentDefinitions: ObjMap;\n rootValue: unknown;\n operation: OperationDefinitionNode;\n variableValues: VariableValues;\n}\n\n/** @internal */\n// eslint-disable-next-line max-params\nexport function buildResolveInfo(\n validatedExecutionArgs: BuildResolveInfoExecutionArgs,\n fieldDef: GraphQLField,\n fieldNodes: ReadonlyArray,\n parentType: GraphQLObjectType,\n path: Path,\n getAbortSignal: () => AbortSignal | undefined,\n getAsyncHelpers: () => GraphQLResolveInfoHelpers,\n): GraphQLResolveInfo {\n const { schema, fragmentDefinitions, rootValue, operation, variableValues } =\n validatedExecutionArgs;\n // The resolve function's optional fourth argument is a collection of\n // information about the current execution state.\n return {\n fieldName: fieldDef.name,\n fieldNodes,\n returnType: fieldDef.type,\n parentType,\n path,\n schema,\n fragments: fragmentDefinitions,\n rootValue,\n operation,\n variableValues,\n getAbortSignal,\n getAsyncHelpers,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.mts new file mode 100644 index 00000000..606dfd09 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.mts @@ -0,0 +1,9 @@ +/** @internal */ +export interface CancellablePromise { + promise: Promise; + abort: (reason?: unknown) => void; +} +/** @internal */ +export declare function withCancellation(originalPromise: Promise): CancellablePromise; +/** @internal */ +export declare function cancellablePromise(promise: Promise, abortSignal: AbortSignal): Promise; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.ts new file mode 100644 index 00000000..606dfd09 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.d.ts @@ -0,0 +1,9 @@ +/** @internal */ +export interface CancellablePromise { + promise: Promise; + abort: (reason?: unknown) => void; +} +/** @internal */ +export declare function withCancellation(originalPromise: Promise): CancellablePromise; +/** @internal */ +export declare function cancellablePromise(promise: Promise, abortSignal: AbortSignal): Promise; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js new file mode 100644 index 00000000..991d2789 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withCancellation = withCancellation; +exports.cancellablePromise = cancellablePromise; +const promiseWithResolvers_ts_1 = require("../jsutils/promiseWithResolvers.js"); +function withCancellation(originalPromise) { + const { promise, resolve, reject } = (0, promiseWithResolvers_ts_1.promiseWithResolvers)(); + let settled = false; + const settleResolve = (value) => { + if (settled) { + return; + } + settled = true; + resolve(value); + }; + const settleReject = (error) => { + if (settled) { + return; + } + settled = true; + reject(error); + }; + originalPromise.then(settleResolve, settleReject); + return { + promise, + abort(reason) { + settleReject(reason); + }, + }; +} +function cancellablePromise(promise, abortSignal) { + const withAbort = withCancellation(promise); + if (abortSignal.aborted) { + withAbort.abort(abortSignal.reason); + return withAbort.promise; + } + const onAbort = () => { + abortSignal.removeEventListener('abort', onAbort); + withAbort.abort(abortSignal.reason); + }; + abortSignal.addEventListener('abort', onAbort); + withAbort.promise.then(() => { + abortSignal.removeEventListener('abort', onAbort); + }, () => { + abortSignal.removeEventListener('abort', onAbort); + }); + return withAbort.promise; +} +//# sourceMappingURL=cancellablePromise.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js.map new file mode 100644 index 00000000..ced672e1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cancellablePromise.js","sourceRoot":"","s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AAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE/C,SAAS,CAAC,OAAO,CAAC,IAAI,CACpB,GAAG,EAAE;QACH,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC,EACD,GAAG,EAAE;QACH,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC,CACF,CAAC;IAEF,OAAO,SAAS,CAAC,OAAO,CAAC;AAC3B,CAAC","sourcesContent":["import { promiseWithResolvers } from '../jsutils/promiseWithResolvers.ts';\n\n/** @internal */\nexport interface CancellablePromise {\n promise: Promise;\n abort: (reason?: unknown) => void;\n}\n\n/** @internal */\nexport function withCancellation(\n originalPromise: Promise,\n): CancellablePromise {\n const { promise, resolve, reject } = promiseWithResolvers();\n let settled = false;\n\n const settleResolve = (value: T): void => {\n if (settled) {\n return;\n }\n settled = true;\n resolve(value);\n };\n const settleReject = (error: unknown): void => {\n if (settled) {\n return;\n }\n settled = true;\n reject(error);\n };\n\n originalPromise.then(settleResolve, settleReject);\n\n return {\n promise,\n abort(reason?: unknown): void {\n settleReject(reason);\n },\n };\n}\n\n/** @internal */\nexport function cancellablePromise(\n promise: Promise,\n abortSignal: AbortSignal,\n): Promise {\n const withAbort = withCancellation(promise);\n\n if (abortSignal.aborted) {\n withAbort.abort(abortSignal.reason);\n return withAbort.promise;\n }\n\n const onAbort = () => {\n abortSignal.removeEventListener('abort', onAbort);\n withAbort.abort(abortSignal.reason);\n };\n abortSignal.addEventListener('abort', onAbort);\n\n withAbort.promise.then(\n () => {\n abortSignal.removeEventListener('abort', onAbort);\n },\n () => {\n abortSignal.removeEventListener('abort', onAbort);\n },\n );\n\n return withAbort.promise;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs new file mode 100644 index 00000000..145eea58 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs @@ -0,0 +1,45 @@ +import { promiseWithResolvers } from "../jsutils/promiseWithResolvers.mjs"; +export function withCancellation(originalPromise) { + const { promise, resolve, reject } = promiseWithResolvers(); + let settled = false; + const settleResolve = (value) => { + if (settled) { + return; + } + settled = true; + resolve(value); + }; + const settleReject = (error) => { + if (settled) { + return; + } + settled = true; + reject(error); + }; + originalPromise.then(settleResolve, settleReject); + return { + promise, + abort(reason) { + settleReject(reason); + }, + }; +} +export function cancellablePromise(promise, abortSignal) { + const withAbort = withCancellation(promise); + if (abortSignal.aborted) { + withAbort.abort(abortSignal.reason); + return withAbort.promise; + } + const onAbort = () => { + abortSignal.removeEventListener('abort', onAbort); + withAbort.abort(abortSignal.reason); + }; + abortSignal.addEventListener('abort', onAbort); + withAbort.promise.then(() => { + abortSignal.removeEventListener('abort', onAbort); + }, () => { + abortSignal.removeEventListener('abort', onAbort); + }); + return withAbort.promise; +} +//# sourceMappingURL=cancellablePromise.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs.map new file mode 100644 index 00000000..ea00d3a7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/cancellablePromise.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"cancellablePromise.js","sourceRoot":"","sources":["../../src/execution/cancellablePromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,4CAA2C;AAS1E,MAAM,UAAU,gBAAgB,CAC9B,eAA2B;IAE3B,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,oBAAoB,EAAK,CAAC;IAC/D,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,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AO,CAAC,CAAC;IACpD,CAAC,CACF,CAAC;IAEF,OAAO,SAAS,CAAC,OAAO,CAAC;AAC3B,CAAC","sourcesContent":["import { promiseWithResolvers } from '../jsutils/promiseWithResolvers.ts';\n\n/** @internal */\nexport interface CancellablePromise {\n promise: Promise;\n abort: (reason?: unknown) => void;\n}\n\n/** @internal */\nexport function withCancellation(\n originalPromise: Promise,\n): CancellablePromise {\n const { promise, resolve, reject } = promiseWithResolvers();\n let settled = false;\n\n const settleResolve = (value: T): void => {\n if (settled) {\n return;\n }\n settled = true;\n resolve(value);\n };\n const settleReject = (error: unknown): void => {\n if (settled) {\n return;\n }\n settled = true;\n reject(error);\n };\n\n originalPromise.then(settleResolve, settleReject);\n\n return {\n promise,\n abort(reason?: unknown): void {\n settleReject(reason);\n },\n };\n}\n\n/** @internal */\nexport function cancellablePromise(\n promise: Promise,\n abortSignal: AbortSignal,\n): Promise {\n const withAbort = withCancellation(promise);\n\n if (abortSignal.aborted) {\n withAbort.abort(abortSignal.reason);\n return withAbort.promise;\n }\n\n const onAbort = () => {\n abortSignal.removeEventListener('abort', onAbort);\n withAbort.abort(abortSignal.reason);\n };\n abortSignal.addEventListener('abort', onAbort);\n\n withAbort.promise.then(\n () => {\n abortSignal.removeEventListener('abort', onAbort);\n },\n () => {\n abortSignal.removeEventListener('abort', onAbort);\n },\n );\n\n return withAbort.promise;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.mts new file mode 100644 index 00000000..a05a4fed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.mts @@ -0,0 +1,65 @@ +import type { ObjMap, ReadOnlyObjMap } from "../jsutils/ObjMap.mjs"; +import type { DirectiveNode, FieldNode, FragmentDefinitionNode, SelectionSetNode, ValueNode } from "../language/ast.mjs"; +import type { GraphQLObjectType } from "../type/definition.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { GraphQLVariableSignature } from "./getVariableSignature.mjs"; +import type { VariableValues } from "./values.mjs"; +/** @internal */ +export interface DeferUsage { + label: string | undefined; + parentDeferUsage: DeferUsage | undefined; +} +/** @internal */ +export interface FragmentVariableValues { + readonly sources: ReadOnlyObjMap; + readonly coerced: ReadOnlyObjMap; +} +/** @internal */ +export interface FragmentVariableValueSource { + readonly signature: GraphQLVariableSignature; + readonly value?: ValueNode; + readonly fragmentVariableValues?: FragmentVariableValues; +} +/** @internal */ +export interface FieldDetails { + node: FieldNode; + deferUsage?: DeferUsage | undefined; + fragmentVariableValues?: FragmentVariableValues | undefined; +} +/** @internal */ +export type FieldDetailsList = ReadonlyArray; +/** @internal */ +export type GroupedFieldSet = ReadonlyMap; +/** @internal */ +export interface FragmentDetails { + definition: FragmentDefinitionNode; + variableSignatures?: ObjMap | undefined; +} +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + * @internal + */ +export declare function collectFields(schema: GraphQLSchema, fragments: ObjMap, variableValues: VariableValues, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode, hideSuggestions: boolean, forbidSkipAndInclude?: boolean): { + groupedFieldSet: GroupedFieldSet; + newDeferUsages: ReadonlyArray; + forbiddenDirectiveInstances: ReadonlyArray; +}; +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + * @internal + */ +export declare function collectSubfields(schema: GraphQLSchema, fragments: ObjMap, variableValues: VariableValues, returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList, hideSuggestions: boolean): { + groupedFieldSet: GroupedFieldSet; + newDeferUsages: ReadonlyArray; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.ts new file mode 100644 index 00000000..1abea911 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.d.ts @@ -0,0 +1,65 @@ +import type { ObjMap, ReadOnlyObjMap } from "../jsutils/ObjMap.js"; +import type { DirectiveNode, FieldNode, FragmentDefinitionNode, SelectionSetNode, ValueNode } from "../language/ast.js"; +import type { GraphQLObjectType } from "../type/definition.js"; +import type { GraphQLSchema } from "../type/schema.js"; +import type { GraphQLVariableSignature } from "./getVariableSignature.js"; +import type { VariableValues } from "./values.js"; +/** @internal */ +export interface DeferUsage { + label: string | undefined; + parentDeferUsage: DeferUsage | undefined; +} +/** @internal */ +export interface FragmentVariableValues { + readonly sources: ReadOnlyObjMap; + readonly coerced: ReadOnlyObjMap; +} +/** @internal */ +export interface FragmentVariableValueSource { + readonly signature: GraphQLVariableSignature; + readonly value?: ValueNode; + readonly fragmentVariableValues?: FragmentVariableValues; +} +/** @internal */ +export interface FieldDetails { + node: FieldNode; + deferUsage?: DeferUsage | undefined; + fragmentVariableValues?: FragmentVariableValues | undefined; +} +/** @internal */ +export type FieldDetailsList = ReadonlyArray; +/** @internal */ +export type GroupedFieldSet = ReadonlyMap; +/** @internal */ +export interface FragmentDetails { + definition: FragmentDefinitionNode; + variableSignatures?: ObjMap | undefined; +} +/** + * Given a selectionSet, collects all of the fields and returns them. + * + * CollectFields requires the "runtime type" of an object. For a field that + * returns an Interface or Union type, the "runtime type" will be the actual + * object type returned by that field. + * + * @internal + */ +export declare function collectFields(schema: GraphQLSchema, fragments: ObjMap, variableValues: VariableValues, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode, hideSuggestions: boolean, forbidSkipAndInclude?: boolean): { + groupedFieldSet: GroupedFieldSet; + newDeferUsages: ReadonlyArray; + forbiddenDirectiveInstances: ReadonlyArray; +}; +/** + * Given an array of field nodes, collects all of the subfields of the passed + * in fields, and returns them at the end. + * + * CollectSubFields requires the "return type" of an object. For a field that + * returns an Interface or Union type, the "return type" will be the actual + * object type returned by that field. + * + * @internal + */ +export declare function collectSubfields(schema: GraphQLSchema, fragments: ObjMap, variableValues: VariableValues, returnType: GraphQLObjectType, fieldDetailsList: FieldDetailsList, hideSuggestions: boolean): { + groupedFieldSet: GroupedFieldSet; + newDeferUsages: ReadonlyArray; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js new file mode 100644 index 00000000..44b43a84 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js @@ -0,0 +1,180 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.collectFields = collectFields; +exports.collectSubfields = collectSubfields; +const AccumulatorMap_ts_1 = require("../jsutils/AccumulatorMap.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +const directives_ts_1 = require("../type/directives.js"); +const typeFromAST_ts_1 = require("../utilities/typeFromAST.js"); +const values_ts_1 = require("./values.js"); +function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, hideSuggestions, forbidSkipAndInclude = false) { + const groupedFieldSet = new AccumulatorMap_ts_1.AccumulatorMap(); + const newDeferUsages = []; + const context = { + schema, + fragments, + variableValues, + runtimeType, + visitedFragmentNames: new Map(), + hideSuggestions, + forbiddenDirectiveInstances: [], + forbidSkipAndInclude, + }; + collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages); + return { + groupedFieldSet, + newDeferUsages, + forbiddenDirectiveInstances: context.forbiddenDirectiveInstances, + }; +} +function collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions) { + const context = { + schema, + fragments, + variableValues, + runtimeType: returnType, + visitedFragmentNames: new Map(), + hideSuggestions, + forbiddenDirectiveInstances: [], + forbidSkipAndInclude: false, + }; + const subGroupedFieldSet = new AccumulatorMap_ts_1.AccumulatorMap(); + const newDeferUsages = []; + for (const fieldDetail of fieldDetailsList) { + const selectionSet = fieldDetail.node.selectionSet; + if (selectionSet) { + const { deferUsage, fragmentVariableValues } = fieldDetail; + collectFieldsImpl(context, selectionSet, subGroupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues); + } + } + return { + groupedFieldSet: subGroupedFieldSet, + newDeferUsages, + }; +} +function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues) { + const { schema, fragments, variableValues, runtimeType, visitedFragmentNames, hideSuggestions, } = context; + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case kinds_ts_1.Kind.FIELD: { + if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) { + continue; + } + groupedFieldSet.add(getFieldEntryKey(selection), { + node: selection, + deferUsage, + fragmentVariableValues, + }); + break; + } + case kinds_ts_1.Kind.INLINE_FRAGMENT: { + if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues) || + !doesFragmentConditionMatch(schema, selection, runtimeType)) { + continue; + } + const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage); + if (!newDeferUsage) { + collectFieldsImpl(context, selection.selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues); + } + else { + newDeferUsages.push(newDeferUsage); + collectFieldsImpl(context, selection.selectionSet, groupedFieldSet, newDeferUsages, newDeferUsage, fragmentVariableValues); + } + break; + } + case kinds_ts_1.Kind.FRAGMENT_SPREAD: { + const fragName = selection.name.value; + if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) { + continue; + } + const fragment = fragments[fragName]; + if (fragment == null || + !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)) { + continue; + } + const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage); + const visitedAsDeferred = visitedFragmentNames.get(fragName); + let maybeNewDeferUsage; + if (!newDeferUsage) { + if (visitedAsDeferred === false) { + continue; + } + visitedFragmentNames.set(fragName, false); + maybeNewDeferUsage = deferUsage; + } + else { + if (visitedAsDeferred !== undefined) { + continue; + } + visitedFragmentNames.set(fragName, true); + newDeferUsages.push(newDeferUsage); + maybeNewDeferUsage = newDeferUsage; + } + const fragmentVariableSignatures = fragment.variableSignatures; + let newFragmentVariableValues; + if (fragmentVariableSignatures) { + newFragmentVariableValues = (0, values_ts_1.getFragmentVariableValues)(selection, fragmentVariableSignatures, variableValues, fragmentVariableValues, hideSuggestions); + } + collectFieldsImpl(context, fragment.definition.selectionSet, groupedFieldSet, newDeferUsages, maybeNewDeferUsage, newFragmentVariableValues); + break; + } + } + } +} +function getDeferUsage(variableValues, fragmentVariableValues, node, parentDeferUsage) { + const defer = (0, values_ts_1.getDirectiveValues)(directives_ts_1.GraphQLDeferDirective, node, variableValues, fragmentVariableValues); + if (!defer) { + return; + } + if (defer.if === false) { + return; + } + return { + label: typeof defer.label === 'string' ? defer.label : undefined, + parentDeferUsage, + }; +} +function shouldIncludeNode(context, node, variableValues, fragmentVariableValues) { + const skipDirectiveNode = node.directives?.find((directive) => directive.name.value === directives_ts_1.GraphQLSkipDirective.name); + if (skipDirectiveNode && context.forbidSkipAndInclude) { + context.forbiddenDirectiveInstances.push(skipDirectiveNode); + return false; + } + const skip = skipDirectiveNode + ? (0, values_ts_1.getArgumentValues)(directives_ts_1.GraphQLSkipDirective, skipDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions) + : undefined; + if (skip?.if === true) { + return false; + } + const includeDirectiveNode = node.directives?.find((directive) => directive.name.value === directives_ts_1.GraphQLIncludeDirective.name); + if (includeDirectiveNode && context.forbidSkipAndInclude) { + context.forbiddenDirectiveInstances.push(includeDirectiveNode); + return false; + } + const include = includeDirectiveNode + ? (0, values_ts_1.getArgumentValues)(directives_ts_1.GraphQLIncludeDirective, includeDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions) + : undefined; + if (include?.if === false) { + return false; + } + return true; +} +function doesFragmentConditionMatch(schema, fragment, type) { + const typeConditionNode = fragment.typeCondition; + if (!typeConditionNode) { + return true; + } + const conditionalType = (0, typeFromAST_ts_1.typeFromAST)(schema, typeConditionNode); + if (conditionalType === type) { + return true; + } + if ((0, definition_ts_1.isAbstractType)(conditionalType)) { + return schema.isSubType(conditionalType, type); + } + return false; +} +function getFieldEntryKey(node) { + return node.alias ? node.alias.value : node.name.value; +} +//# sourceMappingURL=collectFields.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js.map new file mode 100644 index 00000000..ac8e35fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collectFields.js","sourceRoot":"","sources":["../../src/execution/collectFields.ts"],"names":[],"mappings":";;AA4FA,sCAgCC;AAaD,4CA2CC;AApLD,oEAA8D;AAY9D,mDAA4C;AAG5C,yDAAuD;AACvD,yDAI+B;AAG/B,gEAA0D;AAI1D,2CAIqB;AA6DrB,SAAgB,aAAa,CAC3B,MAAqB,EACrB,SAAkC,EAClC,cAA8B,EAC9B,WAA8B,EAC9B,YAA8B,EAC9B,eAAwB,EACxB,oBAAoB,GAAG,KAAK;IAM5B,MAAM,eAAe,GAAG,IAAI,kCAAc,EAAwB,CAAC;IACnE,MAAM,cAAc,GAAsB,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAyB;QACpC,MAAM;QACN,SAAS;QACT,cAAc;QACd,WAAW;QACX,oBAAoB,EAAE,IAAI,GAAG,EAAE;QAC/B,eAAe;QACf,2BAA2B,EAAE,EAAE;QAC/B,oBAAoB;KACrB,CAAC;IAEF,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IAC1E,OAAO;QACL,eAAe;QACf,cAAc;QACd,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.ts';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.ts';\n\nimport type {\n DirectiveNode,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionSetNode,\n ValueNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLObjectType } from '../type/definition.ts';\nimport { isAbstractType } from '../type/definition.ts';\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { typeFromAST } from '../utilities/typeFromAST.ts';\n\nimport type { GraphQLVariableSignature } from './getVariableSignature.ts';\nimport type { VariableValues } from './values.ts';\nimport {\n getArgumentValues,\n getDirectiveValues,\n getFragmentVariableValues,\n} from './values.ts';\n\n/** @internal */\nexport interface DeferUsage {\n label: string | undefined;\n parentDeferUsage: DeferUsage | undefined;\n}\n\n/** @internal */\nexport interface FragmentVariableValues {\n readonly sources: ReadOnlyObjMap;\n readonly coerced: ReadOnlyObjMap;\n}\n\n/** @internal */\nexport interface FragmentVariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: ValueNode;\n readonly fragmentVariableValues?: FragmentVariableValues;\n}\n\n/** @internal */\nexport interface FieldDetails {\n node: FieldNode;\n deferUsage?: DeferUsage | undefined;\n fragmentVariableValues?: FragmentVariableValues | undefined;\n}\n\n/** @internal */\nexport type FieldDetailsList = ReadonlyArray;\n\n/** @internal */\nexport type GroupedFieldSet = ReadonlyMap;\n\n/** @internal */\nexport interface FragmentDetails {\n definition: FragmentDefinitionNode;\n variableSignatures?: ObjMap | undefined;\n}\n\ninterface CollectFieldsContext {\n schema: GraphQLSchema;\n fragments: ObjMap;\n variableValues: VariableValues;\n runtimeType: GraphQLObjectType;\n visitedFragmentNames: Map;\n hideSuggestions: boolean;\n forbiddenDirectiveInstances: Array;\n forbidSkipAndInclude: boolean;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectFields(\n schema: GraphQLSchema,\n fragments: ObjMap,\n variableValues: VariableValues,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n hideSuggestions: boolean,\n forbidSkipAndInclude = false,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray;\n forbiddenDirectiveInstances: ReadonlyArray;\n} {\n const groupedFieldSet = new AccumulatorMap();\n const newDeferUsages: Array = [];\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude,\n };\n\n collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);\n return {\n groupedFieldSet,\n newDeferUsages,\n forbiddenDirectiveInstances: context.forbiddenDirectiveInstances,\n };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n schema: GraphQLSchema,\n fragments: ObjMap,\n variableValues: VariableValues,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray;\n} {\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType: returnType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude: false,\n };\n const subGroupedFieldSet = new AccumulatorMap();\n const newDeferUsages: Array = [];\n\n for (const fieldDetail of fieldDetailsList) {\n const selectionSet = fieldDetail.node.selectionSet;\n if (selectionSet) {\n const { deferUsage, fragmentVariableValues } = fieldDetail;\n collectFieldsImpl(\n context,\n selectionSet,\n subGroupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n }\n }\n\n return {\n groupedFieldSet: subGroupedFieldSet,\n newDeferUsages,\n };\n}\n\n/** @internal */\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n context: CollectFieldsContext,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap,\n newDeferUsages: Array,\n deferUsage?: DeferUsage,\n fragmentVariableValues?: FragmentVariableValues,\n): void {\n const {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames,\n hideSuggestions,\n } = context;\n\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), {\n node: selection,\n deferUsage,\n fragmentVariableValues,\n });\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n ) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n if (!newDeferUsage) {\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n fragmentVariableValues,\n );\n }\n\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n\n const fragment = fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n const visitedAsDeferred = visitedFragmentNames.get(fragName);\n\n let maybeNewDeferUsage: DeferUsage | undefined;\n if (!newDeferUsage) {\n // If this spread is not deferred, it may be skipped when already visited\n // as a non-deferred spread. If it was previously visited as a deferred spread,\n // it must be revisited.\n if (visitedAsDeferred === false) {\n continue;\n }\n visitedFragmentNames.set(fragName, false);\n maybeNewDeferUsage = deferUsage;\n } else {\n // If this spread is deferred, it can be skipped if it has already been visited.\n if (visitedAsDeferred !== undefined) {\n continue;\n }\n visitedFragmentNames.set(fragName, true);\n newDeferUsages.push(newDeferUsage);\n maybeNewDeferUsage = newDeferUsage;\n }\n\n const fragmentVariableSignatures = fragment.variableSignatures;\n let newFragmentVariableValues: FragmentVariableValues | undefined;\n if (fragmentVariableSignatures) {\n newFragmentVariableValues = getFragmentVariableValues(\n selection,\n fragmentVariableSignatures,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n maybeNewDeferUsage,\n newFragmentVariableValues,\n );\n break;\n }\n }\n }\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n *\n * @internal\n */\nfunction getDeferUsage(\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n node: FragmentSpreadNode | InlineFragmentNode,\n parentDeferUsage: DeferUsage | undefined,\n): DeferUsage | undefined {\n const defer = getDirectiveValues(\n GraphQLDeferDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n return {\n label: typeof defer.label === 'string' ? defer.label : undefined,\n parentDeferUsage,\n };\n}\n\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n *\n * @internal\n */\nfunction shouldIncludeNode(\n context: CollectFieldsContext,\n node: FragmentSpreadNode | FieldNode | InlineFragmentNode,\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n): boolean {\n const skipDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLSkipDirective.name,\n );\n if (skipDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(skipDirectiveNode);\n return false;\n }\n const skip = skipDirectiveNode\n ? getArgumentValues(\n GraphQLSkipDirective,\n skipDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (skip?.if === true) {\n return false;\n }\n\n const includeDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLIncludeDirective.name,\n );\n if (includeDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(includeDirectiveNode);\n return false;\n }\n const include = includeDirectiveNode\n ? getArgumentValues(\n GraphQLIncludeDirective,\n includeDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (include?.if === false) {\n return false;\n }\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n *\n * @internal\n */\nfunction doesFragmentConditionMatch(\n schema: GraphQLSchema,\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n type: GraphQLObjectType,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n const conditionalType = typeFromAST(schema, typeConditionNode);\n if (conditionalType === type) {\n return true;\n }\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n *\n * @internal\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs new file mode 100644 index 00000000..e73a2373 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs @@ -0,0 +1,176 @@ +import { AccumulatorMap } from "../jsutils/AccumulatorMap.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { isAbstractType } from "../type/definition.mjs"; +import { GraphQLDeferDirective, GraphQLIncludeDirective, GraphQLSkipDirective, } from "../type/directives.mjs"; +import { typeFromAST } from "../utilities/typeFromAST.mjs"; +import { getArgumentValues, getDirectiveValues, getFragmentVariableValues, } from "./values.mjs"; +export function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, hideSuggestions, forbidSkipAndInclude = false) { + const groupedFieldSet = new AccumulatorMap(); + const newDeferUsages = []; + const context = { + schema, + fragments, + variableValues, + runtimeType, + visitedFragmentNames: new Map(), + hideSuggestions, + forbiddenDirectiveInstances: [], + forbidSkipAndInclude, + }; + collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages); + return { + groupedFieldSet, + newDeferUsages, + forbiddenDirectiveInstances: context.forbiddenDirectiveInstances, + }; +} +export function collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions) { + const context = { + schema, + fragments, + variableValues, + runtimeType: returnType, + visitedFragmentNames: new Map(), + hideSuggestions, + forbiddenDirectiveInstances: [], + forbidSkipAndInclude: false, + }; + const subGroupedFieldSet = new AccumulatorMap(); + const newDeferUsages = []; + for (const fieldDetail of fieldDetailsList) { + const selectionSet = fieldDetail.node.selectionSet; + if (selectionSet) { + const { deferUsage, fragmentVariableValues } = fieldDetail; + collectFieldsImpl(context, selectionSet, subGroupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues); + } + } + return { + groupedFieldSet: subGroupedFieldSet, + newDeferUsages, + }; +} +function collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues) { + const { schema, fragments, variableValues, runtimeType, visitedFragmentNames, hideSuggestions, } = context; + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case Kind.FIELD: { + if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) { + continue; + } + groupedFieldSet.add(getFieldEntryKey(selection), { + node: selection, + deferUsage, + fragmentVariableValues, + }); + break; + } + case Kind.INLINE_FRAGMENT: { + if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues) || + !doesFragmentConditionMatch(schema, selection, runtimeType)) { + continue; + } + const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage); + if (!newDeferUsage) { + collectFieldsImpl(context, selection.selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues); + } + else { + newDeferUsages.push(newDeferUsage); + collectFieldsImpl(context, selection.selectionSet, groupedFieldSet, newDeferUsages, newDeferUsage, fragmentVariableValues); + } + break; + } + case Kind.FRAGMENT_SPREAD: { + const fragName = selection.name.value; + if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) { + continue; + } + const fragment = fragments[fragName]; + if (fragment == null || + !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)) { + continue; + } + const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage); + const visitedAsDeferred = visitedFragmentNames.get(fragName); + let maybeNewDeferUsage; + if (!newDeferUsage) { + if (visitedAsDeferred === false) { + continue; + } + visitedFragmentNames.set(fragName, false); + maybeNewDeferUsage = deferUsage; + } + else { + if (visitedAsDeferred !== undefined) { + continue; + } + visitedFragmentNames.set(fragName, true); + newDeferUsages.push(newDeferUsage); + maybeNewDeferUsage = newDeferUsage; + } + const fragmentVariableSignatures = fragment.variableSignatures; + let newFragmentVariableValues; + if (fragmentVariableSignatures) { + newFragmentVariableValues = getFragmentVariableValues(selection, fragmentVariableSignatures, variableValues, fragmentVariableValues, hideSuggestions); + } + collectFieldsImpl(context, fragment.definition.selectionSet, groupedFieldSet, newDeferUsages, maybeNewDeferUsage, newFragmentVariableValues); + break; + } + } + } +} +function getDeferUsage(variableValues, fragmentVariableValues, node, parentDeferUsage) { + const defer = getDirectiveValues(GraphQLDeferDirective, node, variableValues, fragmentVariableValues); + if (!defer) { + return; + } + if (defer.if === false) { + return; + } + return { + label: typeof defer.label === 'string' ? defer.label : undefined, + parentDeferUsage, + }; +} +function shouldIncludeNode(context, node, variableValues, fragmentVariableValues) { + const skipDirectiveNode = node.directives?.find((directive) => directive.name.value === GraphQLSkipDirective.name); + if (skipDirectiveNode && context.forbidSkipAndInclude) { + context.forbiddenDirectiveInstances.push(skipDirectiveNode); + return false; + } + const skip = skipDirectiveNode + ? getArgumentValues(GraphQLSkipDirective, skipDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions) + : undefined; + if (skip?.if === true) { + return false; + } + const includeDirectiveNode = node.directives?.find((directive) => directive.name.value === GraphQLIncludeDirective.name); + if (includeDirectiveNode && context.forbidSkipAndInclude) { + context.forbiddenDirectiveInstances.push(includeDirectiveNode); + return false; + } + const include = includeDirectiveNode + ? getArgumentValues(GraphQLIncludeDirective, includeDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions) + : undefined; + if (include?.if === false) { + return false; + } + return true; +} +function doesFragmentConditionMatch(schema, fragment, type) { + const typeConditionNode = fragment.typeCondition; + if (!typeConditionNode) { + return true; + } + const conditionalType = typeFromAST(schema, typeConditionNode); + if (conditionalType === type) { + return true; + } + if (isAbstractType(conditionalType)) { + return schema.isSubType(conditionalType, type); + } + return false; +} +function getFieldEntryKey(node) { + return node.alias ? node.alias.value : node.name.value; +} +//# sourceMappingURL=collectFields.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs.map new file mode 100644 index 00000000..dbf531e9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectFields.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"collectFields.js","sourceRoot":"","sources":["../../src/execution/collectFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAY9D,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAG5C,OAAO,EAAE,cAAc,EAAE,+BAA8B;AACvD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,+BAA8B;AAG/B,OAAO,EAAE,WAAW,EAAE,qCAAoC;AAI1D,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,GAC1B,qBAAoB;AA6DrB,MAAM,UAAU,aAAa,CAC3B,MAAqB,EACrB,SAAkC,EAClC,cAA8B,EAC9B,WAA8B,EAC9B,YAA8B,EAC9B,eAAwB,EACxB,oBAAoB,GAAG,KAAK;IAM5B,MAAM,eAAe,GAAG,IAAI,cAAc,EAAwB,CAAC;IACnE,MAAM,cAAc,GAAsB,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAyB;QACpC,MAAM;QACN,SAAS;QACT,cAAc;QACd,WAAW;QACX,oBAAoB,EAAE,IAAI,GAAG,EAAE;QAC/B,eAAe;QACf,2BAA2B,EAAE,EAAE;QAC/B,oBAAoB;KACrB,CAAC;IAEF,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IAC1E,OAAO;QACL,eAAe;QACf,cAAc;QACd,2BAA2B,EAAE,OAAO,CAAC,2BAA2B;KACjE,CAAC;AACJ,CAAC;AAaD,MAAM,UAAU,gBAAgB,CAC9B,MAAqB,EACrB,SAAkC,EAClC,cAA8B,EAC9B,UAA6B,EAC7B,gBAAkC,EAClC,eAAwB;IAKxB,MAAM,OAAO,GAAyB;QACpC,MAAM;QACN,SAAS;QACT,cAAc;QACd,WAAW,EAAE,UAAU;QACvB,oBAAoB,EAAE,IAAI,GAAG,EAAE;QAC/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sBAAsB,EACtB,OAAO,CAAC,eAAe,CACxB;QACH,CAAC,CAAC,SAAS,CAAC;IACd,IAAI,OAAO,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAOD,SAAS,0BAA0B,CACjC,MAAqB,EACrB,QAAqD,EACrD,IAAuB;IAEvB,MAAM,iBAAiB,GAAG,QAAQ,CAAC,aAAa,CAAC;IACjD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC/D,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,cAAc,CAAC,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAOD,SAAS,gBAAgB,CAAC,IAAe;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACzD,CAAC","sourcesContent":["import { AccumulatorMap } from '../jsutils/AccumulatorMap.ts';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.ts';\n\nimport type {\n DirectiveNode,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionSetNode,\n ValueNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLObjectType } from '../type/definition.ts';\nimport { isAbstractType } from '../type/definition.ts';\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { typeFromAST } from '../utilities/typeFromAST.ts';\n\nimport type { GraphQLVariableSignature } from './getVariableSignature.ts';\nimport type { VariableValues } from './values.ts';\nimport {\n getArgumentValues,\n getDirectiveValues,\n getFragmentVariableValues,\n} from './values.ts';\n\n/** @internal */\nexport interface DeferUsage {\n label: string | undefined;\n parentDeferUsage: DeferUsage | undefined;\n}\n\n/** @internal */\nexport interface FragmentVariableValues {\n readonly sources: ReadOnlyObjMap;\n readonly coerced: ReadOnlyObjMap;\n}\n\n/** @internal */\nexport interface FragmentVariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: ValueNode;\n readonly fragmentVariableValues?: FragmentVariableValues;\n}\n\n/** @internal */\nexport interface FieldDetails {\n node: FieldNode;\n deferUsage?: DeferUsage | undefined;\n fragmentVariableValues?: FragmentVariableValues | undefined;\n}\n\n/** @internal */\nexport type FieldDetailsList = ReadonlyArray;\n\n/** @internal */\nexport type GroupedFieldSet = ReadonlyMap;\n\n/** @internal */\nexport interface FragmentDetails {\n definition: FragmentDefinitionNode;\n variableSignatures?: ObjMap | undefined;\n}\n\ninterface CollectFieldsContext {\n schema: GraphQLSchema;\n fragments: ObjMap;\n variableValues: VariableValues;\n runtimeType: GraphQLObjectType;\n visitedFragmentNames: Map;\n hideSuggestions: boolean;\n forbiddenDirectiveInstances: Array;\n forbidSkipAndInclude: boolean;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectFields(\n schema: GraphQLSchema,\n fragments: ObjMap,\n variableValues: VariableValues,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n hideSuggestions: boolean,\n forbidSkipAndInclude = false,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray;\n forbiddenDirectiveInstances: ReadonlyArray;\n} {\n const groupedFieldSet = new AccumulatorMap();\n const newDeferUsages: Array = [];\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude,\n };\n\n collectFieldsImpl(context, selectionSet, groupedFieldSet, newDeferUsages);\n return {\n groupedFieldSet,\n newDeferUsages,\n forbiddenDirectiveInstances: context.forbiddenDirectiveInstances,\n };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n schema: GraphQLSchema,\n fragments: ObjMap,\n variableValues: VariableValues,\n returnType: GraphQLObjectType,\n fieldDetailsList: FieldDetailsList,\n hideSuggestions: boolean,\n): {\n groupedFieldSet: GroupedFieldSet;\n newDeferUsages: ReadonlyArray;\n} {\n const context: CollectFieldsContext = {\n schema,\n fragments,\n variableValues,\n runtimeType: returnType,\n visitedFragmentNames: new Map(),\n hideSuggestions,\n forbiddenDirectiveInstances: [],\n forbidSkipAndInclude: false,\n };\n const subGroupedFieldSet = new AccumulatorMap();\n const newDeferUsages: Array = [];\n\n for (const fieldDetail of fieldDetailsList) {\n const selectionSet = fieldDetail.node.selectionSet;\n if (selectionSet) {\n const { deferUsage, fragmentVariableValues } = fieldDetail;\n collectFieldsImpl(\n context,\n selectionSet,\n subGroupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n }\n }\n\n return {\n groupedFieldSet: subGroupedFieldSet,\n newDeferUsages,\n };\n}\n\n/** @internal */\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n context: CollectFieldsContext,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap,\n newDeferUsages: Array,\n deferUsage?: DeferUsage,\n fragmentVariableValues?: FragmentVariableValues,\n): void {\n const {\n schema,\n fragments,\n variableValues,\n runtimeType,\n visitedFragmentNames,\n hideSuggestions,\n } = context;\n\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), {\n node: selection,\n deferUsage,\n fragmentVariableValues,\n });\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n ) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n if (!newDeferUsage) {\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n deferUsage,\n fragmentVariableValues,\n );\n } else {\n newDeferUsages.push(newDeferUsage);\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n newDeferUsage,\n fragmentVariableValues,\n );\n }\n\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n !shouldIncludeNode(\n context,\n selection,\n variableValues,\n fragmentVariableValues,\n )\n ) {\n continue;\n }\n\n const fragment = fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n variableValues,\n fragmentVariableValues,\n selection,\n deferUsage,\n );\n\n const visitedAsDeferred = visitedFragmentNames.get(fragName);\n\n let maybeNewDeferUsage: DeferUsage | undefined;\n if (!newDeferUsage) {\n // If this spread is not deferred, it may be skipped when already visited\n // as a non-deferred spread. If it was previously visited as a deferred spread,\n // it must be revisited.\n if (visitedAsDeferred === false) {\n continue;\n }\n visitedFragmentNames.set(fragName, false);\n maybeNewDeferUsage = deferUsage;\n } else {\n // If this spread is deferred, it can be skipped if it has already been visited.\n if (visitedAsDeferred !== undefined) {\n continue;\n }\n visitedFragmentNames.set(fragName, true);\n newDeferUsages.push(newDeferUsage);\n maybeNewDeferUsage = newDeferUsage;\n }\n\n const fragmentVariableSignatures = fragment.variableSignatures;\n let newFragmentVariableValues: FragmentVariableValues | undefined;\n if (fragmentVariableSignatures) {\n newFragmentVariableValues = getFragmentVariableValues(\n selection,\n fragmentVariableSignatures,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n collectFieldsImpl(\n context,\n fragment.definition.selectionSet,\n groupedFieldSet,\n newDeferUsages,\n maybeNewDeferUsage,\n newFragmentVariableValues,\n );\n break;\n }\n }\n }\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n *\n * @internal\n */\nfunction getDeferUsage(\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n node: FragmentSpreadNode | InlineFragmentNode,\n parentDeferUsage: DeferUsage | undefined,\n): DeferUsage | undefined {\n const defer = getDirectiveValues(\n GraphQLDeferDirective,\n node,\n variableValues,\n fragmentVariableValues,\n );\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n return {\n label: typeof defer.label === 'string' ? defer.label : undefined,\n parentDeferUsage,\n };\n}\n\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n *\n * @internal\n */\nfunction shouldIncludeNode(\n context: CollectFieldsContext,\n node: FragmentSpreadNode | FieldNode | InlineFragmentNode,\n variableValues: VariableValues,\n fragmentVariableValues: FragmentVariableValues | undefined,\n): boolean {\n const skipDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLSkipDirective.name,\n );\n if (skipDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(skipDirectiveNode);\n return false;\n }\n const skip = skipDirectiveNode\n ? getArgumentValues(\n GraphQLSkipDirective,\n skipDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (skip?.if === true) {\n return false;\n }\n\n const includeDirectiveNode = node.directives?.find(\n (directive) => directive.name.value === GraphQLIncludeDirective.name,\n );\n if (includeDirectiveNode && context.forbidSkipAndInclude) {\n context.forbiddenDirectiveInstances.push(includeDirectiveNode);\n return false;\n }\n const include = includeDirectiveNode\n ? getArgumentValues(\n GraphQLIncludeDirective,\n includeDirectiveNode,\n variableValues,\n fragmentVariableValues,\n context.hideSuggestions,\n )\n : undefined;\n if (include?.if === false) {\n return false;\n }\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n *\n * @internal\n */\nfunction doesFragmentConditionMatch(\n schema: GraphQLSchema,\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n type: GraphQLObjectType,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n const conditionalType = typeFromAST(schema, typeConditionNode);\n if (conditionalType === type) {\n return true;\n }\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n *\n * @internal\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.mts new file mode 100644 index 00000000..5f38593a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.mts @@ -0,0 +1,7 @@ +/** + * Drain a sync iterator after abrupt completion so later promise rejections + * can be observed before they become unhandled. + * + * @internal + */ +export declare function collectIteratorPromises(iterator: Iterator): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.ts new file mode 100644 index 00000000..5f38593a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.d.ts @@ -0,0 +1,7 @@ +/** + * Drain a sync iterator after abrupt completion so later promise rejections + * can be observed before they become unhandled. + * + * @internal + */ +export declare function collectIteratorPromises(iterator: Iterator): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js new file mode 100644 index 00000000..4d4905ab --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.collectIteratorPromises = collectIteratorPromises; +const isPromise_ts_1 = require("../jsutils/isPromise.js"); +function collectIteratorPromises(iterator) { + const promises = []; + try { + while (true) { + const iteration = iterator.next(); + if (iteration.done) { + return promises; + } + if ((0, isPromise_ts_1.isPromiseLike)(iteration.value)) { + promises.push(iteration.value); + } + } + } + catch { + return promises; + } +} +//# sourceMappingURL=collectIteratorPromises.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js.map new file mode 100644 index 00000000..bc186b8a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collectIteratorPromises.js","sourceRoot":"","sources":["../../src/execution/collectIteratorPromises.ts"],"names":[],"mappings":";;AAQA,0DAkBC;AA1BD,0DAAwD;AAQxD,SAAgB,uBAAuB,CACrC,QAA2B;IAE3B,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACnB,OAAO,QAAQ,CAAC;YAClB,CAAC;YACD,IAAI,IAAA,4BAAa,EAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QAEP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import { isPromiseLike } from '../jsutils/isPromise.ts';\n\n/**\n * Drain a sync iterator after abrupt completion so later promise rejections\n * can be observed before they become unhandled.\n *\n * @internal\n */\nexport function collectIteratorPromises(\n iterator: Iterator,\n): Array {\n const promises = [];\n try {\n while (true) {\n const iteration = iterator.next();\n if (iteration.done) {\n return promises;\n }\n if (isPromiseLike(iteration.value)) {\n promises.push(iteration.value);\n }\n }\n } catch {\n // Ignore errors while draining the remaining items.\n return promises;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs new file mode 100644 index 00000000..96a05686 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs @@ -0,0 +1,19 @@ +import { isPromiseLike } from "../jsutils/isPromise.mjs"; +export function collectIteratorPromises(iterator) { + const promises = []; + try { + while (true) { + const iteration = iterator.next(); + if (iteration.done) { + return promises; + } + if (isPromiseLike(iteration.value)) { + promises.push(iteration.value); + } + } + } + catch { + return promises; + } +} +//# sourceMappingURL=collectIteratorPromises.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs.map new file mode 100644 index 00000000..0d2616c8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/collectIteratorPromises.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"collectIteratorPromises.js","sourceRoot":"","sources":["../../src/execution/collectIteratorPromises.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iCAAgC;AAQxD,MAAM,UAAU,uBAAuB,CACrC,QAA2B;IAE3B,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACnB,OAAO,QAAQ,CAAC;YAClB,CAAC;YACD,IAAI,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QAEP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import { isPromiseLike } from '../jsutils/isPromise.ts';\n\n/**\n * Drain a sync iterator after abrupt completion so later promise rejections\n * can be observed before they become unhandled.\n *\n * @internal\n */\nexport function collectIteratorPromises(\n iterator: Iterator,\n): Array {\n const promises = [];\n try {\n while (true) {\n const iteration = iterator.next();\n if (iteration.done) {\n return promises;\n }\n if (isPromiseLike(iteration.value)) {\n promises.push(iteration.value);\n }\n }\n } catch {\n // Ignore errors while draining the remaining items.\n return promises;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.mts new file mode 100644 index 00000000..3f029e37 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.mts @@ -0,0 +1,11 @@ +import type { GraphQLResolveInfoHelpers } from "../type/index.mjs"; +import { AsyncWorkTracker } from "./AsyncWorkTracker.mjs"; +/** @internal */ +export interface SharedExecutionContext { + asyncWorkTracker: AsyncWorkTracker; + getAbortSignal: () => AbortSignal | undefined; + getAsyncHelpers: () => GraphQLResolveInfoHelpers; + promiseAll: (values: ReadonlyArray | T>) => Promise>; +} +/** @internal */ +export declare function createSharedExecutionContext(abortSignal: AbortSignal | undefined): SharedExecutionContext; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.ts new file mode 100644 index 00000000..a24bcb09 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.d.ts @@ -0,0 +1,11 @@ +import type { GraphQLResolveInfoHelpers } from "../type/index.js"; +import { AsyncWorkTracker } from "./AsyncWorkTracker.js"; +/** @internal */ +export interface SharedExecutionContext { + asyncWorkTracker: AsyncWorkTracker; + getAbortSignal: () => AbortSignal | undefined; + getAsyncHelpers: () => GraphQLResolveInfoHelpers; + promiseAll: (values: ReadonlyArray | T>) => Promise>; +} +/** @internal */ +export declare function createSharedExecutionContext(abortSignal: AbortSignal | undefined): SharedExecutionContext; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js new file mode 100644 index 00000000..8a629bc7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSharedExecutionContext = createSharedExecutionContext; +const AsyncWorkTracker_ts_1 = require("./AsyncWorkTracker.js"); +function createSharedExecutionContext(abortSignal) { + const asyncWorkTracker = new AsyncWorkTracker_ts_1.AsyncWorkTracker(); + let resolveInfoHelpers; + const promiseAll = (values) => asyncWorkTracker.promiseAllTrackOnReject(values); + const getAsyncHelpers = () => (resolveInfoHelpers ??= { + promiseAll, + track: (maybePromises) => asyncWorkTracker.addValues(maybePromises), + }); + return { + asyncWorkTracker, + getAbortSignal: () => abortSignal, + getAsyncHelpers, + promiseAll, + }; +} +//# sourceMappingURL=createSharedExecutionContext.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js.map new file mode 100644 index 00000000..d1253d75 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createSharedExecutionContext.js","sourceRoot":"","sources":["../../src/execution/createSharedExecutionContext.ts"],"names":[],"mappings":";;AAeA,oEAsBC;AAnCD,+DAAyD;AAazD,SAAgB,4BAA4B,CAC1C,WAAoC;IAEpC,MAAM,gBAAgB,GAAG,IAAI,sCAAgB,EAAE,CAAC;IAChD,IAAI,kBAAyD,CAAC;IAE9D,MAAM,UAAU,GAAG,CACjB,MAAyC,EACtB,EAAE,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,eAAe,GAAG,GAA8B,EAAE,CACtD,CAAC,kBAAkB,KAAK;QACtB,UAAU;QACV,KAAK,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,aAAa,CAAC;KACpE,CAAC,CAAC;IAEL,OAAO;QACL,gBAAgB;QAChB,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW;QACjC,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import type { GraphQLResolveInfoHelpers } from '../type/index.ts';\n\nimport { AsyncWorkTracker } from './AsyncWorkTracker.ts';\n\n/** @internal */\nexport interface SharedExecutionContext {\n asyncWorkTracker: AsyncWorkTracker;\n getAbortSignal: () => AbortSignal | undefined;\n getAsyncHelpers: () => GraphQLResolveInfoHelpers;\n promiseAll: (\n values: ReadonlyArray | T>,\n ) => Promise>;\n}\n\n/** @internal */\nexport function createSharedExecutionContext(\n abortSignal: AbortSignal | undefined,\n): SharedExecutionContext {\n const asyncWorkTracker = new AsyncWorkTracker();\n let resolveInfoHelpers: GraphQLResolveInfoHelpers | undefined;\n\n const promiseAll = (\n values: ReadonlyArray | T>,\n ): Promise> => asyncWorkTracker.promiseAllTrackOnReject(values);\n\n const getAsyncHelpers = (): GraphQLResolveInfoHelpers =>\n (resolveInfoHelpers ??= {\n promiseAll,\n track: (maybePromises) => asyncWorkTracker.addValues(maybePromises),\n });\n\n return {\n asyncWorkTracker,\n getAbortSignal: () => abortSignal,\n getAsyncHelpers,\n promiseAll,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs new file mode 100644 index 00000000..299f5494 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs @@ -0,0 +1,17 @@ +import { AsyncWorkTracker } from "./AsyncWorkTracker.mjs"; +export function createSharedExecutionContext(abortSignal) { + const asyncWorkTracker = new AsyncWorkTracker(); + let resolveInfoHelpers; + const promiseAll = (values) => asyncWorkTracker.promiseAllTrackOnReject(values); + const getAsyncHelpers = () => (resolveInfoHelpers ??= { + promiseAll, + track: (maybePromises) => asyncWorkTracker.addValues(maybePromises), + }); + return { + asyncWorkTracker, + getAbortSignal: () => abortSignal, + getAsyncHelpers, + promiseAll, + }; +} +//# sourceMappingURL=createSharedExecutionContext.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs.map new file mode 100644 index 00000000..482f826d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/createSharedExecutionContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"createSharedExecutionContext.js","sourceRoot":"","sources":["../../src/execution/createSharedExecutionContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,+BAA8B;AAazD,MAAM,UAAU,4BAA4B,CAC1C,WAAoC;IAEpC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAChD,IAAI,kBAAyD,CAAC;IAE9D,MAAM,UAAU,GAAG,CACjB,MAAyC,EACtB,EAAE,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,eAAe,GAAG,GAA8B,EAAE,CACtD,CAAC,kBAAkB,KAAK;QACtB,UAAU;QACV,KAAK,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,aAAa,CAAC;KACpE,CAAC,CAAC;IAEL,OAAO;QACL,gBAAgB;QAChB,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW;QACjC,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import type { GraphQLResolveInfoHelpers } from '../type/index.ts';\n\nimport { AsyncWorkTracker } from './AsyncWorkTracker.ts';\n\n/** @internal */\nexport interface SharedExecutionContext {\n asyncWorkTracker: AsyncWorkTracker;\n getAbortSignal: () => AbortSignal | undefined;\n getAsyncHelpers: () => GraphQLResolveInfoHelpers;\n promiseAll: (\n values: ReadonlyArray | T>,\n ) => Promise>;\n}\n\n/** @internal */\nexport function createSharedExecutionContext(\n abortSignal: AbortSignal | undefined,\n): SharedExecutionContext {\n const asyncWorkTracker = new AsyncWorkTracker();\n let resolveInfoHelpers: GraphQLResolveInfoHelpers | undefined;\n\n const promiseAll = (\n values: ReadonlyArray | T>,\n ): Promise> => asyncWorkTracker.promiseAllTrackOnReject(values);\n\n const getAsyncHelpers = (): GraphQLResolveInfoHelpers =>\n (resolveInfoHelpers ??= {\n promiseAll,\n track: (maybePromises) => asyncWorkTracker.addValues(maybePromises),\n });\n\n return {\n asyncWorkTracker,\n getAbortSignal: () => abortSignal,\n getAsyncHelpers,\n promiseAll,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.mts new file mode 100644 index 00000000..6f78a814 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.mts @@ -0,0 +1,566 @@ +/** @category Execution */ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import type { GraphQLFieldResolver, GraphQLTypeResolver } from "../type/index.mjs"; +import type { ExecutionArgs, ValidatedExecutionArgs, ValidatedSubscriptionArgs } from "./ExecutionArgs.mjs"; +import type { ExecutionResult } from "./Executor.mjs"; +import type { ExperimentalIncrementalExecutionResults } from "./incremental/IncrementalExecutor.mjs"; +/** Function used to execute a validated root selection set for a subscription event. */ +export type RootSelectionSetExecutor = (validatedExecutionArgs: ValidatedSubscriptionArgs) => PromiseOrValue; +/** + * Implements the "Executing requests" section of the GraphQL specification. + * + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. + * + * If the schema is invalid, an error will be thrown immediately. GraphQL + * request errors, including missing operations and variable coercion errors, + * are returned in an errors-only ExecutionResult. + * + * Field errors are collected into the response instead of rejecting the + * returned promise. Only the field that produced the error and its descendants + * are omitted; sibling fields continue to execute. Errors from fields of + * non-null type may propagate to the nearest nullable parent, which can be the + * entire response data. + * + * This function does not support incremental delivery (`@defer` and `@stream`). + * Use `experimentalExecuteIncrementally` to execute operations with + * incremental delivery enabled. + * @param args - The arguments used to perform the operation. + * @returns A completed execution result, or a promise resolving to one when execution is asynchronous. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { execute } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String!): String + * } + * `); + * + * const result = await execute({ + * schema, + * document: parse('query ($name: String!) { greeting(name: $name) }'), + * rootValue: { + * greeting: ({ name }) => `Hello, ${name}!`, + * }, + * variableValues: { name: 'Ada' }, + * }); + * + * result; // => { data: { greeting: 'Hello, Ada!' } } + * ``` + */ +export declare function execute(args: ExecutionArgs): PromiseOrValue; +/** + * Implements the "Executing requests" section of the GraphQL specification, + * including `@defer` and `@stream` as proposed in + * https://github.com/graphql/graphql-spec/pull/742 + * + * This function returns either a single ExecutionResult, or an + * ExperimentalIncrementalExecutionResults object containing an `initialResult` + * and a stream of `subsequentResults`. + * + * If the schema is invalid, an error will be thrown immediately. GraphQL + * request errors, including missing operations and variable coercion errors, + * are returned in an errors-only ExecutionResult. + * @param args - Execution arguments for the GraphQL operation. + * @returns A single execution result or incremental execution results. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { experimentalExecuteIncrementally } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const result = await experimentalExecuteIncrementally({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * ``` + * @category Incremental Execution + */ +export declare function experimentalExecuteIncrementally(args: ExecutionArgs): PromiseOrValue; +/** @internal */ +export declare function executeIgnoringIncremental(args: ExecutionArgs): PromiseOrValue; +/** + * Implements the "Executing operations" section of the spec. + * + * Returns either a synchronous ExecutionResult, or a Promise for an + * ExecutionResult, described by the "Response" section of the GraphQL + * specification. + * + * If errors are encountered while executing a GraphQL field, only that field + * and its descendants will be omitted, and sibling fields will still be + * executed. These field errors are collected into the returned result instead + * of being thrown or rejecting the returned promise. + * + * Errors from sub-fields of a NonNull type may propagate to the top level, at + * which point we still collect the error and null the parent field, which in + * this case is the entire response. + * @param validatedExecutionArgs - Validated execution arguments. + * @returns Execution result for the operation root selection set. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * executeRootSelectionSet, + * validateExecutionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await executeRootSelectionSet(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function executeRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; +/** + * Executes the operation root selection set with incremental delivery enabled. + * @param validatedExecutionArgs - Validated execution arguments. + * @returns A single execution result or incremental execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * experimentalExecuteRootSelectionSet, + * validateExecutionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await experimentalExecuteRootSelectionSet(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + * @category Incremental Execution + */ +export declare function experimentalExecuteRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; +/** @internal */ +export declare function executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; +/** + * Also implements the "Executing requests" section of the GraphQL specification. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + * @param args - The arguments used to perform the operation. + * @returns Completed execution output for a synchronous operation. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { executeSync } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * + * const result = executeSync({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function executeSync(args: ExecutionArgs): ExecutionResult; +/** + * Executes a subscription operation once for a single source event. + * + * Field errors are collected into the returned result instead of being thrown + * or rejecting the returned promise. + * @param validatedExecutionArgs - Validated subscription execution arguments. + * @returns Execution result for the subscription event. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * executeSubscriptionEvent, + * validateSubscriptionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await executeSubscriptionEvent(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function executeSubscriptionEvent(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue; +/** + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns either an AsyncGenerator (if successful), an ExecutionResult (error), + * or a Promise for one of those results. The call will throw immediately if + * the schema is invalid or the selected operation is not a subscription. + * + * GraphQL request errors, including missing operations and variable coercion + * errors, return or resolve to a GraphQL Response (ExecutionResult) with + * descriptive errors and no data. + * + * If the source stream could not be created due to faulty subscription resolver + * logic, a non-async-iterable resolver result, or a system error, the + * function will return or resolve to a single ExecutionResult containing + * `errors` and no `data`. + * + * If the operation succeeded, the function returns or resolves to an + * AsyncGenerator, which yields a stream of ExecutionResults representing the + * response stream. + * + * This function does not support incremental delivery (`@defer` and `@stream`). + * If an operation which would defer or stream data is executed with this + * function, a field error will be raised at the location of the `@defer` or + * `@stream` directive. + * + * Accepts an object with named arguments. + * @param args - Execution arguments for the subscription operation. + * @returns A response stream for a valid subscription, or an execution result containing errors. + * @example + * ```ts + * // Use a same-named rootValue function to provide the source event stream. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { subscribe } from 'graphql/execution'; + * + * async function* greetings() { + * yield { greeting: 'Hello' }; + * yield { greeting: 'Bonjour' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * + * const result = await subscribe({ + * schema, + * document: parse('subscription { greeting }'), + * rootValue: { greeting: () => greetings() }, + * }); + * + * assert('next' in result); + * + * const firstPayload = await result.next(); + * firstPayload.value; // => { data: { greeting: 'Hello' } } + * ``` + * @example + * ```ts + * // This variant supplies events through a custom subscribeFieldResolver. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { subscribe } from 'graphql/execution'; + * + * async function* defaultGreetings() { + * yield { greeting: 'Hello' }; + * } + * + * async function* frenchGreetings() { + * yield { greeting: 'Bonjour' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting(locale: String): String + * } + * `); + * + * const result = await subscribe({ + * schema, + * document: parse( + * 'subscription Greeting($locale: String) { greeting(locale: $locale) }', + * ), + * rootValue: { + * greeting: (args, contextValue) => { + * const locale = args.locale ?? contextValue.defaultLocale; + * return locale === 'fr' ? frenchGreetings() : defaultGreetings(); + * }, + * }, + * contextValue: { defaultLocale: 'fr' }, + * variableValues: { locale: 'fr' }, + * operationName: 'Greeting', + * subscribeFieldResolver: (rootValue, args, contextValue, info) => { + * args.locale; // => 'fr' + * return rootValue[info.fieldName](args, contextValue); + * }, + * }); + * + * assert('next' in result); + * + * const firstPayload = await result.next(); + * firstPayload.value; // => { data: { greeting: 'Bonjour' } } + * ``` + */ +export declare function subscribe(args: ExecutionArgs): PromiseOrValue | ExecutionResult>; +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream for a + * previously validated subscription request. + * + * Returns either an AsyncIterable (if successful), an ExecutionResult (error), + * or a Promise for one of those results. The call will throw immediately if + * it is not passed validated execution arguments. + * + * If the validated arguments do not result in a compliant subscription, a + * GraphQL Response (ExecutionResult) with descriptive errors and no data will + * be returned. + * + * If the source stream could not be created due to faulty subscription + * resolver logic or a system error, the function will return or + * resolve to a single ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the function returns or resolves to the + * AsyncIterable for the event stream returned by the resolver. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + * @param validatedExecutionArgs - Validated subscription execution arguments. + * @returns A source event stream, or an execution result containing errors. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * createSourceEventStream, + * validateSubscriptionArgs, + * } from 'graphql/execution'; + * + * async function* greetings() { + * yield { greeting: 'Hello' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * rootValue: { greeting: () => greetings() }, + * }); + * + * assert('schema' in validatedArgs); + * + * const stream = await createSourceEventStream(validatedArgs); + * Symbol.asyncIterator in stream; // => true + * ``` + */ +export declare function createSourceEventStream(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue | ExecutionResult>; +/** + * Validates the arguments passed to execute, subscribe, and their lower-level + * helpers. + * + * Throws if the schema is invalid. GraphQL request errors, including variable + * coercion errors, are returned as a GraphQLError array. + * @param args - Execution arguments to validate. + * @returns Validated execution arguments, or validation errors. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validateExecutionArgs } from 'graphql/execution'; + * + * const schema = buildSchema(` + * interface Named { + * name: String! + * } + * + * type User implements Named { + * name: String! + * } + * + * type Query { + * viewer: Named + * } + * `); + * const abortController = new AbortController(); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('query Viewer { viewer { __typename name } }'), + * rootValue: { viewer: { kind: 'user', name: 'Ada' } }, + * contextValue: { locale: 'en' }, + * operationName: 'Viewer', + * fieldResolver: (source, _args, contextValue, info) => { + * contextValue.locale; // => 'en' + * return source[info.fieldName]; + * }, + * typeResolver: (value) => { + * return value.kind === 'user' ? 'User' : undefined; + * }, + * hideSuggestions: true, + * abortSignal: abortController.signal, + * enableEarlyExecution: true, + * hooks: { + * asyncWorkFinished: () => {}, + * }, + * options: { maxCoercionErrors: 1 }, + * }); + * + * assert('operation' in validatedArgs); + * + * validatedArgs.operation.name?.value; // => 'Viewer' + * validatedArgs.hideSuggestions; // => true + * ``` + */ +export declare function validateExecutionArgs(args: ExecutionArgs): ReadonlyArray | ValidatedExecutionArgs; +/** + * Validates execution arguments for a subscription operation. + * + * Throws if the schema is invalid or the selected operation is not a + * subscription. GraphQL request errors, including variable coercion errors, are + * returned as a GraphQLError array. + * @param args - Execution arguments to validate. + * @returns Validated subscription execution arguments, or validation errors. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validateSubscriptionArgs } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * }); + * + * assert('operation' in validatedArgs); + * + * validatedArgs.operation.operation; // => 'subscription' + * ``` + */ +export declare function validateSubscriptionArgs(args: ExecutionArgs): ReadonlyArray | ValidatedSubscriptionArgs; +/** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + */ +export declare const defaultTypeResolver: GraphQLTypeResolver; +/** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the source object of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context value. + */ +export declare const defaultFieldResolver: GraphQLFieldResolver; +/** + * Implements the "MapSourceToResponseEvent" algorithm described in the + * GraphQL specification, mapping each event from a subscription source event + * stream to an ExecutionResult in the response stream. + * @param validatedExecutionArgs - Validated subscription execution arguments. + * @param sourceEventStream - Source event stream returned by the subscription resolver. + * @param rootSelectionSetExecutor - Function used to execute each source event. + * @returns A response stream of execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * mapSourceToResponseEvent, + * validateSubscriptionArgs, + * } from 'graphql/execution'; + * + * async function* events() { + * yield { greeting: 'Hello' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * }); + * + * assert('schema' in validatedArgs); + * + * const responseStream = mapSourceToResponseEvent(validatedArgs, events()); + * const firstPayload = await responseStream.next(); + * + * firstPayload.value; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function mapSourceToResponseEvent(validatedExecutionArgs: ValidatedSubscriptionArgs, sourceEventStream: AsyncIterable, rootSelectionSetExecutor?: RootSelectionSetExecutor): AsyncGenerator; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.ts new file mode 100644 index 00000000..597f1cd3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.d.ts @@ -0,0 +1,566 @@ +/** @category Execution */ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.js"; +import { GraphQLError } from "../error/GraphQLError.js"; +import type { GraphQLFieldResolver, GraphQLTypeResolver } from "../type/index.js"; +import type { ExecutionArgs, ValidatedExecutionArgs, ValidatedSubscriptionArgs } from "./ExecutionArgs.js"; +import type { ExecutionResult } from "./Executor.js"; +import type { ExperimentalIncrementalExecutionResults } from "./incremental/IncrementalExecutor.js"; +/** Function used to execute a validated root selection set for a subscription event. */ +export type RootSelectionSetExecutor = (validatedExecutionArgs: ValidatedSubscriptionArgs) => PromiseOrValue; +/** + * Implements the "Executing requests" section of the GraphQL specification. + * + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. + * + * If the schema is invalid, an error will be thrown immediately. GraphQL + * request errors, including missing operations and variable coercion errors, + * are returned in an errors-only ExecutionResult. + * + * Field errors are collected into the response instead of rejecting the + * returned promise. Only the field that produced the error and its descendants + * are omitted; sibling fields continue to execute. Errors from fields of + * non-null type may propagate to the nearest nullable parent, which can be the + * entire response data. + * + * This function does not support incremental delivery (`@defer` and `@stream`). + * Use `experimentalExecuteIncrementally` to execute operations with + * incremental delivery enabled. + * @param args - The arguments used to perform the operation. + * @returns A completed execution result, or a promise resolving to one when execution is asynchronous. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { execute } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String!): String + * } + * `); + * + * const result = await execute({ + * schema, + * document: parse('query ($name: String!) { greeting(name: $name) }'), + * rootValue: { + * greeting: ({ name }) => `Hello, ${name}!`, + * }, + * variableValues: { name: 'Ada' }, + * }); + * + * result; // => { data: { greeting: 'Hello, Ada!' } } + * ``` + */ +export declare function execute(args: ExecutionArgs): PromiseOrValue; +/** + * Implements the "Executing requests" section of the GraphQL specification, + * including `@defer` and `@stream` as proposed in + * https://github.com/graphql/graphql-spec/pull/742 + * + * This function returns either a single ExecutionResult, or an + * ExperimentalIncrementalExecutionResults object containing an `initialResult` + * and a stream of `subsequentResults`. + * + * If the schema is invalid, an error will be thrown immediately. GraphQL + * request errors, including missing operations and variable coercion errors, + * are returned in an errors-only ExecutionResult. + * @param args - Execution arguments for the GraphQL operation. + * @returns A single execution result or incremental execution results. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { experimentalExecuteIncrementally } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const result = await experimentalExecuteIncrementally({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * ``` + * @category Incremental Execution + */ +export declare function experimentalExecuteIncrementally(args: ExecutionArgs): PromiseOrValue; +/** @internal */ +export declare function executeIgnoringIncremental(args: ExecutionArgs): PromiseOrValue; +/** + * Implements the "Executing operations" section of the spec. + * + * Returns either a synchronous ExecutionResult, or a Promise for an + * ExecutionResult, described by the "Response" section of the GraphQL + * specification. + * + * If errors are encountered while executing a GraphQL field, only that field + * and its descendants will be omitted, and sibling fields will still be + * executed. These field errors are collected into the returned result instead + * of being thrown or rejecting the returned promise. + * + * Errors from sub-fields of a NonNull type may propagate to the top level, at + * which point we still collect the error and null the parent field, which in + * this case is the entire response. + * @param validatedExecutionArgs - Validated execution arguments. + * @returns Execution result for the operation root selection set. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * executeRootSelectionSet, + * validateExecutionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await executeRootSelectionSet(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function executeRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; +/** + * Executes the operation root selection set with incremental delivery enabled. + * @param validatedExecutionArgs - Validated execution arguments. + * @returns A single execution result or incremental execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * experimentalExecuteRootSelectionSet, + * validateExecutionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await experimentalExecuteRootSelectionSet(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + * @category Incremental Execution + */ +export declare function experimentalExecuteRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; +/** @internal */ +export declare function executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; +/** + * Also implements the "Executing requests" section of the GraphQL specification. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + * @param args - The arguments used to perform the operation. + * @returns Completed execution output for a synchronous operation. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { executeSync } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * + * const result = executeSync({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function executeSync(args: ExecutionArgs): ExecutionResult; +/** + * Executes a subscription operation once for a single source event. + * + * Field errors are collected into the returned result instead of being thrown + * or rejecting the returned promise. + * @param validatedExecutionArgs - Validated subscription execution arguments. + * @returns Execution result for the subscription event. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * executeSubscriptionEvent, + * validateSubscriptionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await executeSubscriptionEvent(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function executeSubscriptionEvent(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue; +/** + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns either an AsyncGenerator (if successful), an ExecutionResult (error), + * or a Promise for one of those results. The call will throw immediately if + * the schema is invalid or the selected operation is not a subscription. + * + * GraphQL request errors, including missing operations and variable coercion + * errors, return or resolve to a GraphQL Response (ExecutionResult) with + * descriptive errors and no data. + * + * If the source stream could not be created due to faulty subscription resolver + * logic, a non-async-iterable resolver result, or a system error, the + * function will return or resolve to a single ExecutionResult containing + * `errors` and no `data`. + * + * If the operation succeeded, the function returns or resolves to an + * AsyncGenerator, which yields a stream of ExecutionResults representing the + * response stream. + * + * This function does not support incremental delivery (`@defer` and `@stream`). + * If an operation which would defer or stream data is executed with this + * function, a field error will be raised at the location of the `@defer` or + * `@stream` directive. + * + * Accepts an object with named arguments. + * @param args - Execution arguments for the subscription operation. + * @returns A response stream for a valid subscription, or an execution result containing errors. + * @example + * ```ts + * // Use a same-named rootValue function to provide the source event stream. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { subscribe } from 'graphql/execution'; + * + * async function* greetings() { + * yield { greeting: 'Hello' }; + * yield { greeting: 'Bonjour' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * + * const result = await subscribe({ + * schema, + * document: parse('subscription { greeting }'), + * rootValue: { greeting: () => greetings() }, + * }); + * + * assert('next' in result); + * + * const firstPayload = await result.next(); + * firstPayload.value; // => { data: { greeting: 'Hello' } } + * ``` + * @example + * ```ts + * // This variant supplies events through a custom subscribeFieldResolver. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { subscribe } from 'graphql/execution'; + * + * async function* defaultGreetings() { + * yield { greeting: 'Hello' }; + * } + * + * async function* frenchGreetings() { + * yield { greeting: 'Bonjour' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting(locale: String): String + * } + * `); + * + * const result = await subscribe({ + * schema, + * document: parse( + * 'subscription Greeting($locale: String) { greeting(locale: $locale) }', + * ), + * rootValue: { + * greeting: (args, contextValue) => { + * const locale = args.locale ?? contextValue.defaultLocale; + * return locale === 'fr' ? frenchGreetings() : defaultGreetings(); + * }, + * }, + * contextValue: { defaultLocale: 'fr' }, + * variableValues: { locale: 'fr' }, + * operationName: 'Greeting', + * subscribeFieldResolver: (rootValue, args, contextValue, info) => { + * args.locale; // => 'fr' + * return rootValue[info.fieldName](args, contextValue); + * }, + * }); + * + * assert('next' in result); + * + * const firstPayload = await result.next(); + * firstPayload.value; // => { data: { greeting: 'Bonjour' } } + * ``` + */ +export declare function subscribe(args: ExecutionArgs): PromiseOrValue | ExecutionResult>; +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream for a + * previously validated subscription request. + * + * Returns either an AsyncIterable (if successful), an ExecutionResult (error), + * or a Promise for one of those results. The call will throw immediately if + * it is not passed validated execution arguments. + * + * If the validated arguments do not result in a compliant subscription, a + * GraphQL Response (ExecutionResult) with descriptive errors and no data will + * be returned. + * + * If the source stream could not be created due to faulty subscription + * resolver logic or a system error, the function will return or + * resolve to a single ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the function returns or resolves to the + * AsyncIterable for the event stream returned by the resolver. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + * @param validatedExecutionArgs - Validated subscription execution arguments. + * @returns A source event stream, or an execution result containing errors. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * createSourceEventStream, + * validateSubscriptionArgs, + * } from 'graphql/execution'; + * + * async function* greetings() { + * yield { greeting: 'Hello' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * rootValue: { greeting: () => greetings() }, + * }); + * + * assert('schema' in validatedArgs); + * + * const stream = await createSourceEventStream(validatedArgs); + * Symbol.asyncIterator in stream; // => true + * ``` + */ +export declare function createSourceEventStream(validatedExecutionArgs: ValidatedSubscriptionArgs): PromiseOrValue | ExecutionResult>; +/** + * Validates the arguments passed to execute, subscribe, and their lower-level + * helpers. + * + * Throws if the schema is invalid. GraphQL request errors, including variable + * coercion errors, are returned as a GraphQLError array. + * @param args - Execution arguments to validate. + * @returns Validated execution arguments, or validation errors. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validateExecutionArgs } from 'graphql/execution'; + * + * const schema = buildSchema(` + * interface Named { + * name: String! + * } + * + * type User implements Named { + * name: String! + * } + * + * type Query { + * viewer: Named + * } + * `); + * const abortController = new AbortController(); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('query Viewer { viewer { __typename name } }'), + * rootValue: { viewer: { kind: 'user', name: 'Ada' } }, + * contextValue: { locale: 'en' }, + * operationName: 'Viewer', + * fieldResolver: (source, _args, contextValue, info) => { + * contextValue.locale; // => 'en' + * return source[info.fieldName]; + * }, + * typeResolver: (value) => { + * return value.kind === 'user' ? 'User' : undefined; + * }, + * hideSuggestions: true, + * abortSignal: abortController.signal, + * enableEarlyExecution: true, + * hooks: { + * asyncWorkFinished: () => {}, + * }, + * options: { maxCoercionErrors: 1 }, + * }); + * + * assert('operation' in validatedArgs); + * + * validatedArgs.operation.name?.value; // => 'Viewer' + * validatedArgs.hideSuggestions; // => true + * ``` + */ +export declare function validateExecutionArgs(args: ExecutionArgs): ReadonlyArray | ValidatedExecutionArgs; +/** + * Validates execution arguments for a subscription operation. + * + * Throws if the schema is invalid or the selected operation is not a + * subscription. GraphQL request errors, including variable coercion errors, are + * returned as a GraphQLError array. + * @param args - Execution arguments to validate. + * @returns Validated subscription execution arguments, or validation errors. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validateSubscriptionArgs } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * }); + * + * assert('operation' in validatedArgs); + * + * validatedArgs.operation.operation; // => 'subscription' + * ``` + */ +export declare function validateSubscriptionArgs(args: ExecutionArgs): ReadonlyArray | ValidatedSubscriptionArgs; +/** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + */ +export declare const defaultTypeResolver: GraphQLTypeResolver; +/** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the source object of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context value. + */ +export declare const defaultFieldResolver: GraphQLFieldResolver; +/** + * Implements the "MapSourceToResponseEvent" algorithm described in the + * GraphQL specification, mapping each event from a subscription source event + * stream to an ExecutionResult in the response stream. + * @param validatedExecutionArgs - Validated subscription execution arguments. + * @param sourceEventStream - Source event stream returned by the subscription resolver. + * @param rootSelectionSetExecutor - Function used to execute each source event. + * @returns A response stream of execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * mapSourceToResponseEvent, + * validateSubscriptionArgs, + * } from 'graphql/execution'; + * + * async function* events() { + * yield { greeting: 'Hello' }; + * } + * + * const schema = buildSchema(` + * type Query { + * noop: String + * } + * + * type Subscription { + * greeting: String + * } + * `); + * const validatedArgs = validateSubscriptionArgs({ + * schema, + * document: parse('subscription { greeting }'), + * }); + * + * assert('schema' in validatedArgs); + * + * const responseStream = mapSourceToResponseEvent(validatedArgs, events()); + * const firstPayload = await responseStream.next(); + * + * firstPayload.value; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function mapSourceToResponseEvent(validatedExecutionArgs: ValidatedSubscriptionArgs, sourceEventStream: AsyncIterable, rootSelectionSetExecutor?: RootSelectionSetExecutor): AsyncGenerator; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js new file mode 100644 index 00000000..1174b865 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js @@ -0,0 +1,393 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultFieldResolver = exports.defaultTypeResolver = void 0; +exports.execute = execute; +exports.experimentalExecuteIncrementally = experimentalExecuteIncrementally; +exports.executeIgnoringIncremental = executeIgnoringIncremental; +exports.executeRootSelectionSet = executeRootSelectionSet; +exports.experimentalExecuteRootSelectionSet = experimentalExecuteRootSelectionSet; +exports.executeRootSelectionSetIgnoringIncremental = executeRootSelectionSetIgnoringIncremental; +exports.executeSync = executeSync; +exports.executeSubscriptionEvent = executeSubscriptionEvent; +exports.subscribe = subscribe; +exports.createSourceEventStream = createSourceEventStream; +exports.validateExecutionArgs = validateExecutionArgs; +exports.validateSubscriptionArgs = validateSubscriptionArgs; +exports.mapSourceToResponseEvent = mapSourceToResponseEvent; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const isAsyncIterable_ts_1 = require("../jsutils/isAsyncIterable.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const isPromise_ts_1 = require("../jsutils/isPromise.js"); +const Path_ts_1 = require("../jsutils/Path.js"); +const ensureGraphQLError_ts_1 = require("../error/ensureGraphQLError.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const locatedError_ts_1 = require("../error/locatedError.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const predicates_ts_1 = require("../language/predicates.js"); +const directives_ts_1 = require("../type/directives.js"); +const index_ts_1 = require("../type/index.js"); +const getOperationAST_ts_1 = require("../utilities/getOperationAST.js"); +const diagnostics_ts_1 = require("../diagnostics.js"); +const buildResolveInfo_ts_1 = require("./buildResolveInfo.js"); +const cancellablePromise_ts_1 = require("./cancellablePromise.js"); +const collectFields_ts_1 = require("./collectFields.js"); +const createSharedExecutionContext_ts_1 = require("./createSharedExecutionContext.js"); +const Executor_ts_1 = require("./Executor.js"); +const ExecutorThrowingOnIncremental_ts_1 = require("./ExecutorThrowingOnIncremental.js"); +const getVariableSignature_ts_1 = require("./getVariableSignature.js"); +const IncrementalExecutor_ts_1 = require("./incremental/IncrementalExecutor.js"); +const mapAsyncIterable_ts_1 = require("./mapAsyncIterable.js"); +const values_ts_1 = require("./values.js"); +const UNEXPECTED_EXPERIMENTAL_DIRECTIVES = 'The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.'; +function execute(args) { + if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.executeChannel)) { + return executeImpl(args); + } + return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.executeChannel, buildOperationContextFromArgs(args), () => executeImpl(args)); +} +function buildOperationContextFromArgs(args) { + let operation; + const resolveOperation = () => { + if (operation === undefined) { + operation = (0, getOperationAST_ts_1.getOperationAST)(args.document, args.operationName); + } + return operation; + }; + return { + schema: args.schema, + document: args.document, + rawVariableValues: args.variableValues, + get operationName() { + return args.operationName ?? resolveOperation()?.name?.value; + }, + get operationType() { + return resolveOperation()?.operation; + }, + }; +} +function executeImpl(args) { + if (args.schema.getDirective('defer') || args.schema.getDirective('stream')) { + throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES); + } + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return executeRootSelectionSet(validatedExecutionArgs); +} +function experimentalExecuteIncrementally(args) { + if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.executeChannel)) { + return experimentalExecuteIncrementallyImpl(args); + } + return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.executeChannel, buildOperationContextFromArgs(args), () => experimentalExecuteIncrementallyImpl(args)); +} +function experimentalExecuteIncrementallyImpl(args) { + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return experimentalExecuteRootSelectionSet(validatedExecutionArgs); +} +function executeIgnoringIncremental(args) { + if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.executeChannel)) { + return executeIgnoringIncrementalImpl(args); + } + return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.executeChannel, buildOperationContextFromArgs(args), () => executeIgnoringIncrementalImpl(args)); +} +function executeIgnoringIncrementalImpl(args) { + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs); +} +function executeRootSelectionSet(validatedExecutionArgs) { + return new ExecutorThrowingOnIncremental_ts_1.ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(); +} +function experimentalExecuteRootSelectionSet(validatedExecutionArgs) { + return new IncrementalExecutor_ts_1.IncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet(); +} +function executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs) { + return new Executor_ts_1.Executor(validatedExecutionArgs).executeRootSelectionSet(); +} +function executeSync(args) { + const result = experimentalExecuteIncrementally(args); + if ((0, isPromise_ts_1.isPromise)(result) || 'initialResult' in result) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + return result; +} +function executeSubscriptionEvent(validatedExecutionArgs) { + return new ExecutorThrowingOnIncremental_ts_1.ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(false); +} +function subscribe(args) { + if (!(0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.subscribeChannel)) { + return subscribeImpl(args); + } + return (0, diagnostics_ts_1.traceMixed)(diagnostics_ts_1.subscribeChannel, buildOperationContextFromArgs(args), () => subscribeImpl(args)); +} +function subscribeImpl(args) { + const validatedExecutionArgs = validateSubscriptionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + const resultOrStream = createSourceEventStream(validatedExecutionArgs); + if ((0, isPromise_ts_1.isPromise)(resultOrStream)) { + return resultOrStream.then((resolvedResultOrStream) => (0, isAsyncIterable_ts_1.isAsyncIterable)(resolvedResultOrStream) + ? mapSourceToResponseEvent(validatedExecutionArgs, resolvedResultOrStream) + : resolvedResultOrStream); + } + return (0, isAsyncIterable_ts_1.isAsyncIterable)(resultOrStream) + ? mapSourceToResponseEvent(validatedExecutionArgs, resultOrStream) + : resultOrStream; +} +function createSourceEventStream(validatedExecutionArgs) { + if (!('operation' in validatedExecutionArgs)) { + throw new GraphQLError_ts_1.GraphQLError('Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.'); + } + try { + const eventStream = executeSubscription(validatedExecutionArgs); + if ((0, isPromise_ts_1.isPromise)(eventStream)) { + return eventStream.then(undefined, (error) => ({ + errors: [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(error)], + })); + } + return eventStream; + } + catch (error) { + return { errors: [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(error)] }; + } +} +function validateExecutionArgs(args) { + const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, abortSignal: externalAbortSignal, enableEarlyExecution, hooks, options, } = args; + (0, index_ts_1.assertValidSchema)(schema); + let operation; + const fragmentDefinitions = Object.create(null); + const fragments = Object.create(null); + const fragmentVariableSignatureErrors = []; + for (const definition of document.definitions) { + switch (definition.kind) { + case kinds_ts_1.Kind.OPERATION_DEFINITION: + if (operationName == null) { + if (operation !== undefined) { + return [ + new GraphQLError_ts_1.GraphQLError('Must provide operation name if query contains multiple operations.'), + ]; + } + operation = definition; + } + else if (definition.name?.value === operationName) { + operation = definition; + } + break; + case kinds_ts_1.Kind.FRAGMENT_DEFINITION: { + fragmentDefinitions[definition.name.value] = definition; + let variableSignatures; + if (definition.variableDefinitions) { + const signatures = Object.create(null); + for (const varDef of definition.variableDefinitions) { + const signature = (0, getVariableSignature_ts_1.getVariableSignature)(schema, varDef); + if (signature instanceof GraphQLError_ts_1.GraphQLError) { + fragmentVariableSignatureErrors.push(signature); + continue; + } + signatures[signature.name] = signature; + } + variableSignatures = signatures; + } + fragments[definition.name.value] = { definition, variableSignatures }; + break; + } + default: + } + } + if (!operation) { + if (operationName != null) { + return [new GraphQLError_ts_1.GraphQLError(`Unknown operation named "${operationName}".`)]; + } + return [new GraphQLError_ts_1.GraphQLError('Must provide an operation.')]; + } + if (fragmentVariableSignatureErrors.length > 0) { + return fragmentVariableSignatureErrors; + } + const variableDefinitions = operation.variableDefinitions ?? []; + const hideSuggestions = args.hideSuggestions ?? false; + const coercionInput = rawVariableValues ?? {}; + const coercionOptions = { + maxErrors: options?.maxCoercionErrors ?? 50, + hideSuggestions, + }; + const coercionChannel = diagnostics_ts_1.executeVariableCoercionChannel; + const variableValuesOrErrors = (0, diagnostics_ts_1.shouldTrace)(coercionChannel) + ? (0, diagnostics_ts_1.traceMixed)(coercionChannel, { + schema, + document, + operation, + rawVariableValues, + operationName: operation.name?.value, + operationType: operation.operation, + }, () => (0, values_ts_1.getVariableValues)(schema, variableDefinitions, coercionInput, coercionOptions)) + : (0, values_ts_1.getVariableValues)(schema, variableDefinitions, coercionInput, coercionOptions); + if (variableValuesOrErrors.errors) { + return variableValuesOrErrors.errors; + } + const errorPropagation = !operation.directives?.find((directive) => directive.name.value === directives_ts_1.GraphQLDisableErrorPropagationDirective.name); + return { + schema, + document, + fragmentDefinitions, + fragments, + rootValue, + contextValue, + operation, + variableValues: variableValuesOrErrors.variableValues, + fieldResolver: fieldResolver ?? exports.defaultFieldResolver, + typeResolver: typeResolver ?? exports.defaultTypeResolver, + subscribeFieldResolver: subscribeFieldResolver ?? exports.defaultFieldResolver, + hideSuggestions, + errorPropagation, + externalAbortSignal: externalAbortSignal ?? undefined, + enableEarlyExecution: enableEarlyExecution === true, + hooks: hooks ?? undefined, + rawVariableValues, + }; +} +function validateSubscriptionArgs(args) { + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return validatedExecutionArgs; + } + assertSubscriptionExecutionArgs(validatedExecutionArgs); + return validatedExecutionArgs; +} +function assertSubscriptionExecutionArgs(validatedExecutionArgs) { + if (!(0, predicates_ts_1.isSubscriptionOperationDefinitionNode)(validatedExecutionArgs.operation)) { + throw new GraphQLError_ts_1.GraphQLError('Expected subscription operation.'); + } +} +const defaultTypeResolver = function (value, contextValue, info, abstractType) { + if ((0, isObjectLike_ts_1.isObjectLike)(value) && typeof value.__typename === 'string') { + return value.__typename; + } + const possibleTypes = info.schema.getPossibleTypes(abstractType); + const promisedIsTypeOfResults = []; + try { + for (let i = 0; i < possibleTypes.length; i++) { + const type = possibleTypes[i]; + if (type.isTypeOf) { + const isTypeOfResult = type.isTypeOf(value, contextValue, info); + if ((0, isPromise_ts_1.isPromiseLike)(isTypeOfResult)) { + promisedIsTypeOfResults[i] = isTypeOfResult; + } + else if (isTypeOfResult) { + if (promisedIsTypeOfResults.length) { + info.getAsyncHelpers().track(promisedIsTypeOfResults); + } + return type.name; + } + } + } + } + catch (error) { + if (promisedIsTypeOfResults.length) { + info.getAsyncHelpers().track(promisedIsTypeOfResults); + } + throw error; + } + if (promisedIsTypeOfResults.length) { + return info + .getAsyncHelpers() + .promiseAll(promisedIsTypeOfResults) + .then((isTypeOfResults) => { + for (let i = 0; i < isTypeOfResults.length; i++) { + if (isTypeOfResults[i]) { + return possibleTypes[i].name; + } + } + }); + } +}; +exports.defaultTypeResolver = defaultTypeResolver; +const defaultFieldResolver = function (source, args, contextValue, info) { + if ((0, isObjectLike_ts_1.isObjectLike)(source) || typeof source === 'function') { + const property = source[info.fieldName]; + if (typeof property === 'function') { + return source[info.fieldName](args, contextValue, info); + } + return property; + } +}; +exports.defaultFieldResolver = defaultFieldResolver; +function mapSourceToResponseEvent(validatedExecutionArgs, sourceEventStream, rootSelectionSetExecutor = executeSubscriptionEvent) { + function mapFn(payload) { + const perEventExecutionArgs = { + ...validatedExecutionArgs, + rootValue: payload, + }; + return rootSelectionSetExecutor(perEventExecutionArgs); + } + const externalAbortSignal = validatedExecutionArgs.externalAbortSignal; + if (externalAbortSignal) { + const generator = (0, mapAsyncIterable_ts_1.mapAsyncIterable)(sourceEventStream, mapFn); + return { + ...generator, + next: () => (0, cancellablePromise_ts_1.cancellablePromise)(generator.next(), externalAbortSignal), + }; + } + return (0, mapAsyncIterable_ts_1.mapAsyncIterable)(sourceEventStream, mapFn); +} +function executeSubscription(validatedExecutionArgs) { + const { schema, fragments, rootValue, contextValue, operation, variableValues, hideSuggestions, externalAbortSignal, } = validatedExecutionArgs; + const rootType = schema.getSubscriptionType(); + if (rootType == null) { + throw new GraphQLError_ts_1.GraphQLError('Schema is not configured to execute subscription operation.', { nodes: operation }); + } + const { groupedFieldSet } = (0, collectFields_ts_1.collectFields)(schema, fragments, variableValues, rootType, operation.selectionSet, hideSuggestions); + const firstRootField = groupedFieldSet.entries().next().value; + const [responseName, fieldDetailsList] = firstRootField; + const firstFieldDetails = fieldDetailsList[0]; + const firstNode = firstFieldDetails.node; + const fieldName = firstNode.name.value; + const fieldDef = schema.getField(rootType, fieldName); + const fieldNodes = fieldDetailsList.map((fieldDetails) => fieldDetails.node); + if (!fieldDef) { + throw new GraphQLError_ts_1.GraphQLError(`The subscription field "${fieldName}" is not defined.`, { nodes: fieldNodes }); + } + const sharedExecutionContext = (0, createSharedExecutionContext_ts_1.createSharedExecutionContext)(externalAbortSignal); + const path = (0, Path_ts_1.addPath)(undefined, responseName, rootType.name); + const info = (0, buildResolveInfo_ts_1.buildResolveInfo)(validatedExecutionArgs, fieldDef, fieldNodes, rootType, path, sharedExecutionContext.getAbortSignal, sharedExecutionContext.getAsyncHelpers); + try { + const args = (0, values_ts_1.getArgumentValues)(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions); + const resolveFn = fieldDef.subscribe ?? validatedExecutionArgs.subscribeFieldResolver; + const result = resolveFn(rootValue, args, contextValue, info); + if ((0, isPromise_ts_1.isPromiseLike)(result)) { + const promisedResult = Promise.resolve(result); + const promise = externalAbortSignal + ? (0, cancellablePromise_ts_1.cancellablePromise)(promisedResult, externalAbortSignal) + : promisedResult; + return promise + .then(assertEventStream) + .then(undefined, (error) => { + throw (0, locatedError_ts_1.locatedError)(error, toNodes(fieldDetailsList), (0, Path_ts_1.pathToArray)(path)); + }); + } + return assertEventStream(result); + } + catch (error) { + throw (0, locatedError_ts_1.locatedError)(error, fieldNodes, (0, Path_ts_1.pathToArray)(path)); + } +} +function assertEventStream(result) { + if (result instanceof Error) { + throw result; + } + if (!(0, isAsyncIterable_ts_1.isAsyncIterable)(result)) { + throw new GraphQLError_ts_1.GraphQLError('Subscription field must return Async Iterable. ' + + `Received: ${(0, inspect_ts_1.inspect)(result)}.`); + } + return result; +} +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +//# sourceMappingURL=execute.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js.map new file mode 100644 index 00000000..361769ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.js.map @@ -0,0 +1 @@ +{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/execution/execute.ts"],"names":[],"mappings":";;;AAkHA,0BAOC;AAkFD,4EASC;AAkBD,gEASC;AAyDD,0DAMC;AA8BD,kFAMC;AAGD,gGAIC;AAyBD,kCASC;AAwCD,4DAMC;AAoHD,8BAWC;AAkGD,0DAqBC;AA2DD,sDA6IC;AAoCD,4DASC;AAqID,4DAwBC;AA/iCD,sDAAgD;AAChD,sEAAgE;AAChE,gEAA0D;AAC1D,0DAAmE;AAEnE,gDAA0D;AAG1D,0EAAoE;AACpE,8DAAwD;AACxD,8DAAwD;AAOxD,mDAA4C;AAC5C,6DAAkF;AAElF,yDAAgF;AAKhF,+CAAqD;AAErD,wEAAkE;AAGlE,sDAM2B;AAE3B,+DAAyD;AACzD,mEAA6D;AAE7D,yDAAmD;AACnD,uFAAiF;AAOjF,+CAAyC;AACzC,yFAAmF;AAEnF,uEAAiE;AAEjE,iFAA2E;AAC3E,+DAAyD;AACzD,2CAAmE;AAEnE,MAAM,kCAAkC,GACtC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C,CAAC;AACnE,CAAC","sourcesContent":["/** @category Execution */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isAsyncIterable } from '../jsutils/isAsyncIterable.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { isPromise, isPromiseLike } from '../jsutils/isPromise.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { addPath, pathToArray } from '../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\nimport { locatedError } from '../error/locatedError.ts';\n\nimport type {\n FieldNode,\n FragmentDefinitionNode,\n OperationDefinitionNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { isSubscriptionOperationDefinitionNode } from '../language/predicates.ts';\n\nimport { GraphQLDisableErrorPropagationDirective } from '../type/directives.ts';\nimport type {\n GraphQLFieldResolver,\n GraphQLTypeResolver,\n} from '../type/index.ts';\nimport { assertValidSchema } from '../type/index.ts';\n\nimport { getOperationAST } from '../utilities/getOperationAST.ts';\n\nimport type { GraphQLExecuteContext } from '../diagnostics.ts';\nimport {\n executeChannel,\n executeVariableCoercionChannel,\n shouldTrace,\n subscribeChannel,\n traceMixed,\n} from '../diagnostics.ts';\n\nimport { buildResolveInfo } from './buildResolveInfo.ts';\nimport { cancellablePromise } from './cancellablePromise.ts';\nimport type { FieldDetailsList, FragmentDetails } from './collectFields.ts';\nimport { collectFields } from './collectFields.ts';\nimport { createSharedExecutionContext } from './createSharedExecutionContext.ts';\nimport type {\n ExecutionArgs,\n ValidatedExecutionArgs,\n ValidatedSubscriptionArgs,\n} from './ExecutionArgs.ts';\nimport type { ExecutionResult } from './Executor.ts';\nimport { Executor } from './Executor.ts';\nimport { ExecutorThrowingOnIncremental } from './ExecutorThrowingOnIncremental.ts';\nimport type { GraphQLVariableSignature } from './getVariableSignature.ts';\nimport { getVariableSignature } from './getVariableSignature.ts';\nimport type { ExperimentalIncrementalExecutionResults } from './incremental/IncrementalExecutor.ts';\nimport { IncrementalExecutor } from './incremental/IncrementalExecutor.ts';\nimport { mapAsyncIterable } from './mapAsyncIterable.ts';\nimport { getArgumentValues, getVariableValues } from './values.ts';\n\nconst UNEXPECTED_EXPERIMENTAL_DIRECTIVES =\n 'The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.';\n\n/** Function used to execute a validated root selection set for a subscription event. */\nexport type RootSelectionSetExecutor = (\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n) => PromiseOrValue;\n\n/**\n * Implements the \"Executing requests\" section of the GraphQL specification.\n *\n * Returns either a synchronous ExecutionResult (if all encountered resolvers\n * are synchronous), or a Promise of an ExecutionResult that will eventually be\n * resolved and never rejected.\n *\n * If the schema is invalid, an error will be thrown immediately. GraphQL\n * request errors, including missing operations and variable coercion errors,\n * are returned in an errors-only ExecutionResult.\n *\n * Field errors are collected into the response instead of rejecting the\n * returned promise. Only the field that produced the error and its descendants\n * are omitted; sibling fields continue to execute. Errors from fields of\n * non-null type may propagate to the nearest nullable parent, which can be the\n * entire response data.\n *\n * This function does not support incremental delivery (`@defer` and `@stream`).\n * Use `experimentalExecuteIncrementally` to execute operations with\n * incremental delivery enabled.\n * @param args - The arguments used to perform the operation.\n * @returns A completed execution result, or a promise resolving to one when execution is asynchronous.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { execute } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String!): String\n * }\n * `);\n *\n * const result = await execute({\n * schema,\n * document: parse('query ($name: String!) { greeting(name: $name) }'),\n * rootValue: {\n * greeting: ({ name }) => `Hello, ${name}!`,\n * },\n * variableValues: { name: 'Ada' },\n * });\n *\n * result; // => { data: { greeting: 'Hello, Ada!' } }\n * ```\n */\nexport function execute(args: ExecutionArgs): PromiseOrValue {\n if (!shouldTrace(executeChannel)) {\n return executeImpl(args);\n }\n return traceMixed(executeChannel, buildOperationContextFromArgs(args), () =>\n executeImpl(args),\n );\n}\n\n/**\n * Build a graphql:execute channel context from raw ExecutionArgs. Defers\n * resolution of the operation AST to a lazy getter so the cost of walking\n * the document is only paid if a subscriber reads it.\n * @internal\n */\nfunction buildOperationContextFromArgs(\n args: ExecutionArgs,\n): Omit {\n let operation: OperationDefinitionNode | null | undefined;\n const resolveOperation = (): OperationDefinitionNode | null | undefined => {\n if (operation === undefined) {\n operation = getOperationAST(args.document, args.operationName);\n }\n return operation;\n };\n return {\n schema: args.schema,\n document: args.document,\n rawVariableValues: args.variableValues,\n get operationName() {\n return args.operationName ?? resolveOperation()?.name?.value;\n },\n get operationType() {\n return resolveOperation()?.operation;\n },\n };\n}\n\nfunction executeImpl(args: ExecutionArgs): PromiseOrValue {\n if (args.schema.getDirective('defer') || args.schema.getDirective('stream')) {\n throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES);\n }\n\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return executeRootSelectionSet(validatedExecutionArgs);\n}\n\n/**\n * Implements the \"Executing requests\" section of the GraphQL specification,\n * including `@defer` and `@stream` as proposed in\n * https://github.com/graphql/graphql-spec/pull/742\n *\n * This function returns either a single ExecutionResult, or an\n * ExperimentalIncrementalExecutionResults object containing an `initialResult`\n * and a stream of `subsequentResults`.\n *\n * If the schema is invalid, an error will be thrown immediately. GraphQL\n * request errors, including missing operations and variable coercion errors,\n * are returned in an errors-only ExecutionResult.\n * @param args - Execution arguments for the GraphQL operation.\n * @returns A single execution result or incremental execution results.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { experimentalExecuteIncrementally } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const result = await experimentalExecuteIncrementally({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n * @category Incremental Execution\n */\nexport function experimentalExecuteIncrementally(\n args: ExecutionArgs,\n): PromiseOrValue {\n if (!shouldTrace(executeChannel)) {\n return experimentalExecuteIncrementallyImpl(args);\n }\n return traceMixed(executeChannel, buildOperationContextFromArgs(args), () =>\n experimentalExecuteIncrementallyImpl(args),\n );\n}\n\nfunction experimentalExecuteIncrementallyImpl(\n args: ExecutionArgs,\n): PromiseOrValue {\n // If the request cannot produce valid execution arguments, return a\n // \"Response\" with only errors.\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return experimentalExecuteRootSelectionSet(validatedExecutionArgs);\n}\n\n/** @internal */\nexport function executeIgnoringIncremental(\n args: ExecutionArgs,\n): PromiseOrValue {\n if (!shouldTrace(executeChannel)) {\n return executeIgnoringIncrementalImpl(args);\n }\n return traceMixed(executeChannel, buildOperationContextFromArgs(args), () =>\n executeIgnoringIncrementalImpl(args),\n );\n}\n\nfunction executeIgnoringIncrementalImpl(\n args: ExecutionArgs,\n): PromiseOrValue {\n // If the request cannot produce valid execution arguments, return a\n // \"Response\" with only errors.\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs);\n}\n\n/**\n * Implements the \"Executing operations\" section of the spec.\n *\n * Returns either a synchronous ExecutionResult, or a Promise for an\n * ExecutionResult, described by the \"Response\" section of the GraphQL\n * specification.\n *\n * If errors are encountered while executing a GraphQL field, only that field\n * and its descendants will be omitted, and sibling fields will still be\n * executed. These field errors are collected into the returned result instead\n * of being thrown or rejecting the returned promise.\n *\n * Errors from sub-fields of a NonNull type may propagate to the top level, at\n * which point we still collect the error and null the parent field, which in\n * this case is the entire response.\n * @param validatedExecutionArgs - Validated execution arguments.\n * @returns Execution result for the operation root selection set.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * executeRootSelectionSet,\n * validateExecutionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await executeRootSelectionSet(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function executeRootSelectionSet(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue {\n return new ExecutorThrowingOnIncremental(\n validatedExecutionArgs,\n ).executeRootSelectionSet();\n}\n\n/**\n * Executes the operation root selection set with incremental delivery enabled.\n * @param validatedExecutionArgs - Validated execution arguments.\n * @returns A single execution result or incremental execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * experimentalExecuteRootSelectionSet,\n * validateExecutionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await experimentalExecuteRootSelectionSet(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n * @category Incremental Execution\n */\nexport function experimentalExecuteRootSelectionSet(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue {\n return new IncrementalExecutor(\n validatedExecutionArgs,\n ).executeRootSelectionSet();\n}\n\n/** @internal */\nexport function executeRootSelectionSetIgnoringIncremental(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue {\n return new Executor(validatedExecutionArgs).executeRootSelectionSet();\n}\n\n/**\n * Also implements the \"Executing requests\" section of the GraphQL specification.\n * However, it guarantees to complete synchronously (or throw an error) assuming\n * that all field resolvers are also synchronous.\n * @param args - The arguments used to perform the operation.\n * @returns Completed execution output for a synchronous operation.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { executeSync } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n *\n * const result = executeSync({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function executeSync(args: ExecutionArgs): ExecutionResult {\n const result = experimentalExecuteIncrementally(args);\n\n // Assert that the execution was synchronous.\n if (isPromise(result) || 'initialResult' in result) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\n/**\n * Executes a subscription operation once for a single source event.\n *\n * Field errors are collected into the returned result instead of being thrown\n * or rejecting the returned promise.\n * @param validatedExecutionArgs - Validated subscription execution arguments.\n * @returns Execution result for the subscription event.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * executeSubscriptionEvent,\n * validateSubscriptionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await executeSubscriptionEvent(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function executeSubscriptionEvent(\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n): PromiseOrValue {\n return new ExecutorThrowingOnIncremental(\n validatedExecutionArgs,\n ).executeRootSelectionSet(false);\n}\n\n/**\n * Implements the \"Subscribe\" algorithm described in the GraphQL specification.\n *\n * Returns either an AsyncGenerator (if successful), an ExecutionResult (error),\n * or a Promise for one of those results. The call will throw immediately if\n * the schema is invalid or the selected operation is not a subscription.\n *\n * GraphQL request errors, including missing operations and variable coercion\n * errors, return or resolve to a GraphQL Response (ExecutionResult) with\n * descriptive errors and no data.\n *\n * If the source stream could not be created due to faulty subscription resolver\n * logic, a non-async-iterable resolver result, or a system error, the\n * function will return or resolve to a single ExecutionResult containing\n * `errors` and no `data`.\n *\n * If the operation succeeded, the function returns or resolves to an\n * AsyncGenerator, which yields a stream of ExecutionResults representing the\n * response stream.\n *\n * This function does not support incremental delivery (`@defer` and `@stream`).\n * If an operation which would defer or stream data is executed with this\n * function, a field error will be raised at the location of the `@defer` or\n * `@stream` directive.\n *\n * Accepts an object with named arguments.\n * @param args - Execution arguments for the subscription operation.\n * @returns A response stream for a valid subscription, or an execution result containing errors.\n * @example\n * ```ts\n * // Use a same-named rootValue function to provide the source event stream.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { subscribe } from 'graphql/execution';\n *\n * async function* greetings() {\n * yield { greeting: 'Hello' };\n * yield { greeting: 'Bonjour' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n *\n * const result = await subscribe({\n * schema,\n * document: parse('subscription { greeting }'),\n * rootValue: { greeting: () => greetings() },\n * });\n *\n * assert('next' in result);\n *\n * const firstPayload = await result.next();\n * firstPayload.value; // => { data: { greeting: 'Hello' } }\n * ```\n * @example\n * ```ts\n * // This variant supplies events through a custom subscribeFieldResolver.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { subscribe } from 'graphql/execution';\n *\n * async function* defaultGreetings() {\n * yield { greeting: 'Hello' };\n * }\n *\n * async function* frenchGreetings() {\n * yield { greeting: 'Bonjour' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting(locale: String): String\n * }\n * `);\n *\n * const result = await subscribe({\n * schema,\n * document: parse(\n * 'subscription Greeting($locale: String) { greeting(locale: $locale) }',\n * ),\n * rootValue: {\n * greeting: (args, contextValue) => {\n * const locale = args.locale ?? contextValue.defaultLocale;\n * return locale === 'fr' ? frenchGreetings() : defaultGreetings();\n * },\n * },\n * contextValue: { defaultLocale: 'fr' },\n * variableValues: { locale: 'fr' },\n * operationName: 'Greeting',\n * subscribeFieldResolver: (rootValue, args, contextValue, info) => {\n * args.locale; // => 'fr'\n * return rootValue[info.fieldName](args, contextValue);\n * },\n * });\n *\n * assert('next' in result);\n *\n * const firstPayload = await result.next();\n * firstPayload.value; // => { data: { greeting: 'Bonjour' } }\n * ```\n */\nexport function subscribe(\n args: ExecutionArgs,\n): PromiseOrValue<\n AsyncGenerator | ExecutionResult\n> {\n if (!shouldTrace(subscribeChannel)) {\n return subscribeImpl(args);\n }\n return traceMixed(subscribeChannel, buildOperationContextFromArgs(args), () =>\n subscribeImpl(args),\n );\n}\n\nfunction subscribeImpl(\n args: ExecutionArgs,\n): PromiseOrValue<\n AsyncGenerator | ExecutionResult\n> {\n // If the request cannot produce valid execution arguments, return a\n // \"Response\" with only errors.\n const validatedExecutionArgs = validateSubscriptionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n const resultOrStream = createSourceEventStream(validatedExecutionArgs);\n\n if (isPromise(resultOrStream)) {\n return resultOrStream.then((resolvedResultOrStream) =>\n isAsyncIterable(resolvedResultOrStream)\n ? mapSourceToResponseEvent(\n validatedExecutionArgs,\n resolvedResultOrStream,\n )\n : resolvedResultOrStream,\n );\n }\n\n return isAsyncIterable(resultOrStream)\n ? mapSourceToResponseEvent(validatedExecutionArgs, resultOrStream)\n : resultOrStream;\n}\n\n/**\n * Implements the \"CreateSourceEventStream\" algorithm described in the\n * GraphQL specification, resolving the subscription source event stream for a\n * previously validated subscription request.\n *\n * Returns either an AsyncIterable (if successful), an ExecutionResult (error),\n * or a Promise for one of those results. The call will throw immediately if\n * it is not passed validated execution arguments.\n *\n * If the validated arguments do not result in a compliant subscription, a\n * GraphQL Response (ExecutionResult) with descriptive errors and no data will\n * be returned.\n *\n * If the source stream could not be created due to faulty subscription\n * resolver logic or a system error, the function will return or\n * resolve to a single ExecutionResult containing `errors` and no `data`.\n *\n * If the operation succeeded, the function returns or resolves to the\n * AsyncIterable for the event stream returned by the resolver.\n *\n * A Source Event Stream represents a sequence of events, each of which triggers\n * a GraphQL execution for that event.\n *\n * This may be useful when hosting the stateful subscription service in a\n * different process or machine than the stateless GraphQL execution engine,\n * or otherwise separating these two steps. For more on this, see the\n * \"Supporting Subscriptions at Scale\" information in the GraphQL specification.\n * @param validatedExecutionArgs - Validated subscription execution arguments.\n * @returns A source event stream, or an execution result containing errors.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * createSourceEventStream,\n * validateSubscriptionArgs,\n * } from 'graphql/execution';\n *\n * async function* greetings() {\n * yield { greeting: 'Hello' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * rootValue: { greeting: () => greetings() },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const stream = await createSourceEventStream(validatedArgs);\n * Symbol.asyncIterator in stream; // => true\n * ```\n */\nexport function createSourceEventStream(\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n): PromiseOrValue | ExecutionResult> {\n if (!('operation' in validatedExecutionArgs)) {\n throw new GraphQLError(\n 'Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.',\n );\n }\n\n try {\n const eventStream = executeSubscription(validatedExecutionArgs);\n if (isPromise(eventStream)) {\n return eventStream.then(undefined, (error: unknown) => ({\n errors: [ensureGraphQLError(error)],\n }));\n }\n\n return eventStream;\n } catch (error) {\n return { errors: [ensureGraphQLError(error)] };\n }\n}\n\n/**\n * Validates the arguments passed to execute, subscribe, and their lower-level\n * helpers.\n *\n * Throws if the schema is invalid. GraphQL request errors, including variable\n * coercion errors, are returned as a GraphQLError array.\n * @param args - Execution arguments to validate.\n * @returns Validated execution arguments, or validation errors.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validateExecutionArgs } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * interface Named {\n * name: String!\n * }\n *\n * type User implements Named {\n * name: String!\n * }\n *\n * type Query {\n * viewer: Named\n * }\n * `);\n * const abortController = new AbortController();\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('query Viewer { viewer { __typename name } }'),\n * rootValue: { viewer: { kind: 'user', name: 'Ada' } },\n * contextValue: { locale: 'en' },\n * operationName: 'Viewer',\n * fieldResolver: (source, _args, contextValue, info) => {\n * contextValue.locale; // => 'en'\n * return source[info.fieldName];\n * },\n * typeResolver: (value) => {\n * return value.kind === 'user' ? 'User' : undefined;\n * },\n * hideSuggestions: true,\n * abortSignal: abortController.signal,\n * enableEarlyExecution: true,\n * hooks: {\n * asyncWorkFinished: () => {},\n * },\n * options: { maxCoercionErrors: 1 },\n * });\n *\n * assert('operation' in validatedArgs);\n *\n * validatedArgs.operation.name?.value; // => 'Viewer'\n * validatedArgs.hideSuggestions; // => true\n * ```\n */\nexport function validateExecutionArgs(\n args: ExecutionArgs,\n): ReadonlyArray | ValidatedExecutionArgs {\n const {\n schema,\n document,\n rootValue,\n contextValue,\n variableValues: rawVariableValues,\n operationName,\n fieldResolver,\n typeResolver,\n subscribeFieldResolver,\n abortSignal: externalAbortSignal,\n enableEarlyExecution,\n hooks,\n options,\n } = args;\n\n // If the schema used for execution is invalid, throw an error.\n assertValidSchema(schema);\n\n let operation: OperationDefinitionNode | undefined;\n const fragmentDefinitions: ObjMap =\n Object.create(null);\n const fragments: ObjMap = Object.create(null);\n const fragmentVariableSignatureErrors: Array = [];\n for (const definition of document.definitions) {\n switch (definition.kind) {\n case Kind.OPERATION_DEFINITION:\n if (operationName == null) {\n if (operation !== undefined) {\n return [\n new GraphQLError(\n 'Must provide operation name if query contains multiple operations.',\n ),\n ];\n }\n operation = definition;\n } else if (definition.name?.value === operationName) {\n operation = definition;\n }\n break;\n case Kind.FRAGMENT_DEFINITION: {\n fragmentDefinitions[definition.name.value] = definition;\n let variableSignatures;\n if (definition.variableDefinitions) {\n const signatures: ObjMap =\n Object.create(null);\n for (const varDef of definition.variableDefinitions) {\n const signature = getVariableSignature(schema, varDef);\n if (signature instanceof GraphQLError) {\n fragmentVariableSignatureErrors.push(signature);\n continue;\n }\n signatures[signature.name] = signature;\n }\n variableSignatures = signatures;\n }\n fragments[definition.name.value] = { definition, variableSignatures };\n break;\n }\n default:\n // ignore non-executable definitions\n }\n }\n\n if (!operation) {\n if (operationName != null) {\n return [new GraphQLError(`Unknown operation named \"${operationName}\".`)];\n }\n return [new GraphQLError('Must provide an operation.')];\n }\n\n if (fragmentVariableSignatureErrors.length > 0) {\n return fragmentVariableSignatureErrors;\n }\n\n const variableDefinitions = operation.variableDefinitions ?? [];\n const hideSuggestions = args.hideSuggestions ?? false;\n\n const coercionInput = rawVariableValues ?? {};\n const coercionOptions = {\n maxErrors: options?.maxCoercionErrors ?? 50,\n hideSuggestions,\n };\n const coercionChannel = executeVariableCoercionChannel;\n const variableValuesOrErrors = shouldTrace(coercionChannel)\n ? traceMixed(\n coercionChannel,\n {\n schema,\n document,\n operation,\n rawVariableValues,\n operationName: operation.name?.value,\n operationType: operation.operation,\n },\n () =>\n getVariableValues(\n schema,\n variableDefinitions,\n coercionInput,\n coercionOptions,\n ),\n )\n : getVariableValues(\n schema,\n variableDefinitions,\n coercionInput,\n coercionOptions,\n );\n\n if (variableValuesOrErrors.errors) {\n return variableValuesOrErrors.errors;\n }\n\n const errorPropagation = !operation.directives?.find(\n (directive) =>\n directive.name.value === GraphQLDisableErrorPropagationDirective.name,\n );\n\n return {\n schema,\n document,\n fragmentDefinitions,\n fragments,\n rootValue,\n contextValue,\n operation,\n variableValues: variableValuesOrErrors.variableValues,\n fieldResolver: fieldResolver ?? defaultFieldResolver,\n typeResolver: typeResolver ?? defaultTypeResolver,\n subscribeFieldResolver: subscribeFieldResolver ?? defaultFieldResolver,\n hideSuggestions,\n errorPropagation,\n externalAbortSignal: externalAbortSignal ?? undefined,\n enableEarlyExecution: enableEarlyExecution === true,\n hooks: hooks ?? undefined,\n rawVariableValues,\n };\n}\n\n/**\n * Validates execution arguments for a subscription operation.\n *\n * Throws if the schema is invalid or the selected operation is not a\n * subscription. GraphQL request errors, including variable coercion errors, are\n * returned as a GraphQLError array.\n * @param args - Execution arguments to validate.\n * @returns Validated subscription execution arguments, or validation errors.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validateSubscriptionArgs } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * });\n *\n * assert('operation' in validatedArgs);\n *\n * validatedArgs.operation.operation; // => 'subscription'\n * ```\n */\nexport function validateSubscriptionArgs(\n args: ExecutionArgs,\n): ReadonlyArray | ValidatedSubscriptionArgs {\n const validatedExecutionArgs = validateExecutionArgs(args);\n if (!('schema' in validatedExecutionArgs)) {\n return validatedExecutionArgs;\n }\n assertSubscriptionExecutionArgs(validatedExecutionArgs);\n return validatedExecutionArgs;\n}\n\nfunction assertSubscriptionExecutionArgs(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): asserts validatedExecutionArgs is ValidatedSubscriptionArgs {\n if (\n !isSubscriptionOperationDefinitionNode(validatedExecutionArgs.operation)\n ) {\n throw new GraphQLError('Expected subscription operation.');\n }\n}\n\n/**\n * If a resolveType function is not given, then a default resolve behavior is\n * used which attempts two strategies:\n *\n * First, See if the provided value has a `__typename` field defined, if so, use\n * that value as name of the resolved type.\n *\n * Otherwise, test each possible type for the abstract type by calling\n * isTypeOf for the object being coerced, returning the first type that matches.\n */\nexport const defaultTypeResolver: GraphQLTypeResolver =\n function (value, contextValue, info, abstractType) {\n // First, look for `__typename`.\n if (isObjectLike(value) && typeof value.__typename === 'string') {\n return value.__typename;\n }\n\n // Otherwise, test each possible type.\n const possibleTypes = info.schema.getPossibleTypes(abstractType);\n const promisedIsTypeOfResults: Array> = [];\n\n try {\n for (let i = 0; i < possibleTypes.length; i++) {\n const type = possibleTypes[i];\n\n if (type.isTypeOf) {\n const isTypeOfResult = type.isTypeOf(value, contextValue, info);\n\n if (isPromiseLike(isTypeOfResult)) {\n promisedIsTypeOfResults[i] = isTypeOfResult;\n } else if (isTypeOfResult) {\n if (promisedIsTypeOfResults.length) {\n info.getAsyncHelpers().track(promisedIsTypeOfResults);\n }\n return type.name;\n }\n }\n }\n } catch (error) {\n if (promisedIsTypeOfResults.length) {\n info.getAsyncHelpers().track(promisedIsTypeOfResults);\n }\n throw error;\n }\n\n if (promisedIsTypeOfResults.length) {\n return info\n .getAsyncHelpers()\n .promiseAll(promisedIsTypeOfResults)\n .then((isTypeOfResults) => {\n for (let i = 0; i < isTypeOfResults.length; i++) {\n if (isTypeOfResults[i]) {\n return possibleTypes[i].name;\n }\n }\n });\n }\n };\n\n/**\n * If a resolve function is not given, then a default resolve behavior is used\n * which takes the property of the source object of the same name as the field\n * and returns it as the result, or if it's a function, returns the result\n * of calling that function while passing along args and context value.\n */\nexport const defaultFieldResolver: GraphQLFieldResolver =\n function (source: any, args, contextValue, info) {\n // ensure source is a value for which property access is acceptable.\n if (isObjectLike(source) || typeof source === 'function') {\n const property = source[info.fieldName];\n if (typeof property === 'function') {\n return source[info.fieldName](args, contextValue, info);\n }\n return property;\n }\n };\n\n/**\n * Implements the \"MapSourceToResponseEvent\" algorithm described in the\n * GraphQL specification, mapping each event from a subscription source event\n * stream to an ExecutionResult in the response stream.\n * @param validatedExecutionArgs - Validated subscription execution arguments.\n * @param sourceEventStream - Source event stream returned by the subscription resolver.\n * @param rootSelectionSetExecutor - Function used to execute each source event.\n * @returns A response stream of execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * mapSourceToResponseEvent,\n * validateSubscriptionArgs,\n * } from 'graphql/execution';\n *\n * async function* events() {\n * yield { greeting: 'Hello' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const responseStream = mapSourceToResponseEvent(validatedArgs, events());\n * const firstPayload = await responseStream.next();\n *\n * firstPayload.value; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function mapSourceToResponseEvent(\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n sourceEventStream: AsyncIterable,\n rootSelectionSetExecutor: RootSelectionSetExecutor = executeSubscriptionEvent,\n): AsyncGenerator {\n // For each payload yielded from a subscription, map it over the normal\n // GraphQL `execute` function, with `payload` as the rootValue.\n function mapFn(payload: unknown): PromiseOrValue {\n const perEventExecutionArgs: ValidatedSubscriptionArgs = {\n ...validatedExecutionArgs,\n rootValue: payload,\n };\n return rootSelectionSetExecutor(perEventExecutionArgs);\n }\n\n const externalAbortSignal = validatedExecutionArgs.externalAbortSignal;\n if (externalAbortSignal) {\n const generator = mapAsyncIterable(sourceEventStream, mapFn);\n return {\n ...generator,\n next: () => cancellablePromise(generator.next(), externalAbortSignal),\n };\n }\n return mapAsyncIterable(sourceEventStream, mapFn);\n}\n\nfunction executeSubscription(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue> {\n const {\n schema,\n fragments,\n rootValue,\n contextValue,\n operation,\n variableValues,\n hideSuggestions,\n externalAbortSignal,\n } = validatedExecutionArgs;\n\n const rootType = schema.getSubscriptionType();\n if (rootType == null) {\n throw new GraphQLError(\n 'Schema is not configured to execute subscription operation.',\n { nodes: operation },\n );\n }\n\n const { groupedFieldSet } = collectFields(\n schema,\n fragments,\n variableValues,\n rootType,\n operation.selectionSet,\n hideSuggestions,\n );\n\n const firstRootField = groupedFieldSet.entries().next().value as [\n string,\n FieldDetailsList,\n ];\n const [responseName, fieldDetailsList] = firstRootField;\n const firstFieldDetails = fieldDetailsList[0];\n const firstNode = firstFieldDetails.node;\n const fieldName = firstNode.name.value;\n const fieldDef = schema.getField(rootType, fieldName);\n\n const fieldNodes = fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n if (!fieldDef) {\n throw new GraphQLError(\n `The subscription field \"${fieldName}\" is not defined.`,\n { nodes: fieldNodes },\n );\n }\n\n const sharedExecutionContext =\n createSharedExecutionContext(externalAbortSignal);\n const path = addPath(undefined, responseName, rootType.name);\n const info = buildResolveInfo(\n validatedExecutionArgs,\n fieldDef,\n fieldNodes,\n rootType,\n path,\n sharedExecutionContext.getAbortSignal,\n sharedExecutionContext.getAsyncHelpers,\n );\n\n try {\n // Implements the \"ResolveFieldEventStream\" algorithm from GraphQL specification.\n // It differs from \"ResolveFieldValue\" due to providing a different `resolveFn`.\n\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n const args = getArgumentValues(\n fieldDef,\n firstNode,\n variableValues,\n firstFieldDetails.fragmentVariableValues,\n hideSuggestions,\n );\n\n // Call the `subscribe()` resolver or the default resolver to produce an\n // AsyncIterable yielding raw payloads.\n const resolveFn =\n fieldDef.subscribe ?? validatedExecutionArgs.subscribeFieldResolver;\n\n // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n const result = resolveFn(rootValue, args, contextValue, info);\n\n if (isPromiseLike(result)) {\n const promisedResult = Promise.resolve(result);\n const promise = externalAbortSignal\n ? cancellablePromise(promisedResult, externalAbortSignal)\n : promisedResult;\n return promise\n .then(assertEventStream)\n .then(undefined, (error: unknown) => {\n throw locatedError(\n error,\n toNodes(fieldDetailsList),\n pathToArray(path),\n );\n });\n }\n return assertEventStream(result);\n } catch (error) {\n throw locatedError(error, fieldNodes, pathToArray(path));\n }\n}\n\nfunction assertEventStream(result: unknown): AsyncIterable {\n if (result instanceof Error) {\n throw result;\n }\n\n // Assert field returned an event stream, otherwise yield an error.\n if (!isAsyncIterable(result)) {\n throw new GraphQLError(\n 'Subscription field must return Async Iterable. ' +\n `Received: ${inspect(result)}.`,\n );\n }\n\n return result;\n}\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs new file mode 100644 index 00000000..de18be87 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs @@ -0,0 +1,375 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { isAsyncIterable } from "../jsutils/isAsyncIterable.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { isPromise, isPromiseLike } from "../jsutils/isPromise.mjs"; +import { addPath, pathToArray } from "../jsutils/Path.mjs"; +import { ensureGraphQLError } from "../error/ensureGraphQLError.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { locatedError } from "../error/locatedError.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { isSubscriptionOperationDefinitionNode } from "../language/predicates.mjs"; +import { GraphQLDisableErrorPropagationDirective } from "../type/directives.mjs"; +import { assertValidSchema } from "../type/index.mjs"; +import { getOperationAST } from "../utilities/getOperationAST.mjs"; +import { executeChannel, executeVariableCoercionChannel, shouldTrace, subscribeChannel, traceMixed, } from "../diagnostics.mjs"; +import { buildResolveInfo } from "./buildResolveInfo.mjs"; +import { cancellablePromise } from "./cancellablePromise.mjs"; +import { collectFields } from "./collectFields.mjs"; +import { createSharedExecutionContext } from "./createSharedExecutionContext.mjs"; +import { Executor } from "./Executor.mjs"; +import { ExecutorThrowingOnIncremental } from "./ExecutorThrowingOnIncremental.mjs"; +import { getVariableSignature } from "./getVariableSignature.mjs"; +import { IncrementalExecutor } from "./incremental/IncrementalExecutor.mjs"; +import { mapAsyncIterable } from "./mapAsyncIterable.mjs"; +import { getArgumentValues, getVariableValues } from "./values.mjs"; +const UNEXPECTED_EXPERIMENTAL_DIRECTIVES = 'The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.'; +export function execute(args) { + if (!shouldTrace(executeChannel)) { + return executeImpl(args); + } + return traceMixed(executeChannel, buildOperationContextFromArgs(args), () => executeImpl(args)); +} +function buildOperationContextFromArgs(args) { + let operation; + const resolveOperation = () => { + if (operation === undefined) { + operation = getOperationAST(args.document, args.operationName); + } + return operation; + }; + return { + schema: args.schema, + document: args.document, + rawVariableValues: args.variableValues, + get operationName() { + return args.operationName ?? resolveOperation()?.name?.value; + }, + get operationType() { + return resolveOperation()?.operation; + }, + }; +} +function executeImpl(args) { + if (args.schema.getDirective('defer') || args.schema.getDirective('stream')) { + throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES); + } + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return executeRootSelectionSet(validatedExecutionArgs); +} +export function experimentalExecuteIncrementally(args) { + if (!shouldTrace(executeChannel)) { + return experimentalExecuteIncrementallyImpl(args); + } + return traceMixed(executeChannel, buildOperationContextFromArgs(args), () => experimentalExecuteIncrementallyImpl(args)); +} +function experimentalExecuteIncrementallyImpl(args) { + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return experimentalExecuteRootSelectionSet(validatedExecutionArgs); +} +export function executeIgnoringIncremental(args) { + if (!shouldTrace(executeChannel)) { + return executeIgnoringIncrementalImpl(args); + } + return traceMixed(executeChannel, buildOperationContextFromArgs(args), () => executeIgnoringIncrementalImpl(args)); +} +function executeIgnoringIncrementalImpl(args) { + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs); +} +export function executeRootSelectionSet(validatedExecutionArgs) { + return new ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(); +} +export function experimentalExecuteRootSelectionSet(validatedExecutionArgs) { + return new IncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet(); +} +export function executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs) { + return new Executor(validatedExecutionArgs).executeRootSelectionSet(); +} +export function executeSync(args) { + const result = experimentalExecuteIncrementally(args); + if (isPromise(result) || 'initialResult' in result) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + return result; +} +export function executeSubscriptionEvent(validatedExecutionArgs) { + return new ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(false); +} +export function subscribe(args) { + if (!shouldTrace(subscribeChannel)) { + return subscribeImpl(args); + } + return traceMixed(subscribeChannel, buildOperationContextFromArgs(args), () => subscribeImpl(args)); +} +function subscribeImpl(args) { + const validatedExecutionArgs = validateSubscriptionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + const resultOrStream = createSourceEventStream(validatedExecutionArgs); + if (isPromise(resultOrStream)) { + return resultOrStream.then((resolvedResultOrStream) => isAsyncIterable(resolvedResultOrStream) + ? mapSourceToResponseEvent(validatedExecutionArgs, resolvedResultOrStream) + : resolvedResultOrStream); + } + return isAsyncIterable(resultOrStream) + ? mapSourceToResponseEvent(validatedExecutionArgs, resultOrStream) + : resultOrStream; +} +export function createSourceEventStream(validatedExecutionArgs) { + if (!('operation' in validatedExecutionArgs)) { + throw new GraphQLError('Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.'); + } + try { + const eventStream = executeSubscription(validatedExecutionArgs); + if (isPromise(eventStream)) { + return eventStream.then(undefined, (error) => ({ + errors: [ensureGraphQLError(error)], + })); + } + return eventStream; + } + catch (error) { + return { errors: [ensureGraphQLError(error)] }; + } +} +export function validateExecutionArgs(args) { + const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, abortSignal: externalAbortSignal, enableEarlyExecution, hooks, options, } = args; + assertValidSchema(schema); + let operation; + const fragmentDefinitions = Object.create(null); + const fragments = Object.create(null); + const fragmentVariableSignatureErrors = []; + for (const definition of document.definitions) { + switch (definition.kind) { + case Kind.OPERATION_DEFINITION: + if (operationName == null) { + if (operation !== undefined) { + return [ + new GraphQLError('Must provide operation name if query contains multiple operations.'), + ]; + } + operation = definition; + } + else if (definition.name?.value === operationName) { + operation = definition; + } + break; + case Kind.FRAGMENT_DEFINITION: { + fragmentDefinitions[definition.name.value] = definition; + let variableSignatures; + if (definition.variableDefinitions) { + const signatures = Object.create(null); + for (const varDef of definition.variableDefinitions) { + const signature = getVariableSignature(schema, varDef); + if (signature instanceof GraphQLError) { + fragmentVariableSignatureErrors.push(signature); + continue; + } + signatures[signature.name] = signature; + } + variableSignatures = signatures; + } + fragments[definition.name.value] = { definition, variableSignatures }; + break; + } + default: + } + } + if (!operation) { + if (operationName != null) { + return [new GraphQLError(`Unknown operation named "${operationName}".`)]; + } + return [new GraphQLError('Must provide an operation.')]; + } + if (fragmentVariableSignatureErrors.length > 0) { + return fragmentVariableSignatureErrors; + } + const variableDefinitions = operation.variableDefinitions ?? []; + const hideSuggestions = args.hideSuggestions ?? false; + const coercionInput = rawVariableValues ?? {}; + const coercionOptions = { + maxErrors: options?.maxCoercionErrors ?? 50, + hideSuggestions, + }; + const coercionChannel = executeVariableCoercionChannel; + const variableValuesOrErrors = shouldTrace(coercionChannel) + ? traceMixed(coercionChannel, { + schema, + document, + operation, + rawVariableValues, + operationName: operation.name?.value, + operationType: operation.operation, + }, () => getVariableValues(schema, variableDefinitions, coercionInput, coercionOptions)) + : getVariableValues(schema, variableDefinitions, coercionInput, coercionOptions); + if (variableValuesOrErrors.errors) { + return variableValuesOrErrors.errors; + } + const errorPropagation = !operation.directives?.find((directive) => directive.name.value === GraphQLDisableErrorPropagationDirective.name); + return { + schema, + document, + fragmentDefinitions, + fragments, + rootValue, + contextValue, + operation, + variableValues: variableValuesOrErrors.variableValues, + fieldResolver: fieldResolver ?? defaultFieldResolver, + typeResolver: typeResolver ?? defaultTypeResolver, + subscribeFieldResolver: subscribeFieldResolver ?? defaultFieldResolver, + hideSuggestions, + errorPropagation, + externalAbortSignal: externalAbortSignal ?? undefined, + enableEarlyExecution: enableEarlyExecution === true, + hooks: hooks ?? undefined, + rawVariableValues, + }; +} +export function validateSubscriptionArgs(args) { + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return validatedExecutionArgs; + } + assertSubscriptionExecutionArgs(validatedExecutionArgs); + return validatedExecutionArgs; +} +function assertSubscriptionExecutionArgs(validatedExecutionArgs) { + if (!isSubscriptionOperationDefinitionNode(validatedExecutionArgs.operation)) { + throw new GraphQLError('Expected subscription operation.'); + } +} +export const defaultTypeResolver = function (value, contextValue, info, abstractType) { + if (isObjectLike(value) && typeof value.__typename === 'string') { + return value.__typename; + } + const possibleTypes = info.schema.getPossibleTypes(abstractType); + const promisedIsTypeOfResults = []; + try { + for (let i = 0; i < possibleTypes.length; i++) { + const type = possibleTypes[i]; + if (type.isTypeOf) { + const isTypeOfResult = type.isTypeOf(value, contextValue, info); + if (isPromiseLike(isTypeOfResult)) { + promisedIsTypeOfResults[i] = isTypeOfResult; + } + else if (isTypeOfResult) { + if (promisedIsTypeOfResults.length) { + info.getAsyncHelpers().track(promisedIsTypeOfResults); + } + return type.name; + } + } + } + } + catch (error) { + if (promisedIsTypeOfResults.length) { + info.getAsyncHelpers().track(promisedIsTypeOfResults); + } + throw error; + } + if (promisedIsTypeOfResults.length) { + return info + .getAsyncHelpers() + .promiseAll(promisedIsTypeOfResults) + .then((isTypeOfResults) => { + for (let i = 0; i < isTypeOfResults.length; i++) { + if (isTypeOfResults[i]) { + return possibleTypes[i].name; + } + } + }); + } +}; +export const defaultFieldResolver = function (source, args, contextValue, info) { + if (isObjectLike(source) || typeof source === 'function') { + const property = source[info.fieldName]; + if (typeof property === 'function') { + return source[info.fieldName](args, contextValue, info); + } + return property; + } +}; +export function mapSourceToResponseEvent(validatedExecutionArgs, sourceEventStream, rootSelectionSetExecutor = executeSubscriptionEvent) { + function mapFn(payload) { + const perEventExecutionArgs = { + ...validatedExecutionArgs, + rootValue: payload, + }; + return rootSelectionSetExecutor(perEventExecutionArgs); + } + const externalAbortSignal = validatedExecutionArgs.externalAbortSignal; + if (externalAbortSignal) { + const generator = mapAsyncIterable(sourceEventStream, mapFn); + return { + ...generator, + next: () => cancellablePromise(generator.next(), externalAbortSignal), + }; + } + return mapAsyncIterable(sourceEventStream, mapFn); +} +function executeSubscription(validatedExecutionArgs) { + const { schema, fragments, rootValue, contextValue, operation, variableValues, hideSuggestions, externalAbortSignal, } = validatedExecutionArgs; + const rootType = schema.getSubscriptionType(); + if (rootType == null) { + throw new GraphQLError('Schema is not configured to execute subscription operation.', { nodes: operation }); + } + const { groupedFieldSet } = collectFields(schema, fragments, variableValues, rootType, operation.selectionSet, hideSuggestions); + const firstRootField = groupedFieldSet.entries().next().value; + const [responseName, fieldDetailsList] = firstRootField; + const firstFieldDetails = fieldDetailsList[0]; + const firstNode = firstFieldDetails.node; + const fieldName = firstNode.name.value; + const fieldDef = schema.getField(rootType, fieldName); + const fieldNodes = fieldDetailsList.map((fieldDetails) => fieldDetails.node); + if (!fieldDef) { + throw new GraphQLError(`The subscription field "${fieldName}" is not defined.`, { nodes: fieldNodes }); + } + const sharedExecutionContext = createSharedExecutionContext(externalAbortSignal); + const path = addPath(undefined, responseName, rootType.name); + const info = buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, rootType, path, sharedExecutionContext.getAbortSignal, sharedExecutionContext.getAsyncHelpers); + try { + const args = getArgumentValues(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions); + const resolveFn = fieldDef.subscribe ?? validatedExecutionArgs.subscribeFieldResolver; + const result = resolveFn(rootValue, args, contextValue, info); + if (isPromiseLike(result)) { + const promisedResult = Promise.resolve(result); + const promise = externalAbortSignal + ? cancellablePromise(promisedResult, externalAbortSignal) + : promisedResult; + return promise + .then(assertEventStream) + .then(undefined, (error) => { + throw locatedError(error, toNodes(fieldDetailsList), pathToArray(path)); + }); + } + return assertEventStream(result); + } + catch (error) { + throw locatedError(error, fieldNodes, pathToArray(path)); + } +} +function assertEventStream(result) { + if (result instanceof Error) { + throw result; + } + if (!isAsyncIterable(result)) { + throw new GraphQLError('Subscription field must return Async Iterable. ' + + `Received: ${inspect(result)}.`); + } + return result; +} +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +//# sourceMappingURL=execute.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs.map new file mode 100644 index 00000000..5e9466ed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/execute.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":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OAAO,OAAO;iBACX,IAAI,CAAC,iBAAiB,CAAC;iBACvB,IAAI,CAAC,SAAS,EAAE,CAAC,KAAc,EAAE,EAAE;gBAClC,MAAM,YAAY,CAChB,KAAK,EACL,OAAO,CAAC,gBAAgB,CAAC,EACzB,WAAW,CAAC,IAAI,CAAC,CAClB,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC;QACD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAe;IACxC,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;QAC5B,MAAM,MAAM,CAAC;IACf,CAAC;IAGD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,YAAY,CACpB,iDAAiD;YAC/C,aAAa,OAAO,CAAC,MAAM,CAAC,GAAG,CAClC,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,OAAO,CAAC,gBAAkC;IACjD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC","sourcesContent":["/** @category Execution */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isAsyncIterable } from '../jsutils/isAsyncIterable.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { isPromise, isPromiseLike } from '../jsutils/isPromise.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { addPath, pathToArray } from '../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\nimport { locatedError } from '../error/locatedError.ts';\n\nimport type {\n FieldNode,\n FragmentDefinitionNode,\n OperationDefinitionNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { isSubscriptionOperationDefinitionNode } from '../language/predicates.ts';\n\nimport { GraphQLDisableErrorPropagationDirective } from '../type/directives.ts';\nimport type {\n GraphQLFieldResolver,\n GraphQLTypeResolver,\n} from '../type/index.ts';\nimport { assertValidSchema } from '../type/index.ts';\n\nimport { getOperationAST } from '../utilities/getOperationAST.ts';\n\nimport type { GraphQLExecuteContext } from '../diagnostics.ts';\nimport {\n executeChannel,\n executeVariableCoercionChannel,\n shouldTrace,\n subscribeChannel,\n traceMixed,\n} from '../diagnostics.ts';\n\nimport { buildResolveInfo } from './buildResolveInfo.ts';\nimport { cancellablePromise } from './cancellablePromise.ts';\nimport type { FieldDetailsList, FragmentDetails } from './collectFields.ts';\nimport { collectFields } from './collectFields.ts';\nimport { createSharedExecutionContext } from './createSharedExecutionContext.ts';\nimport type {\n ExecutionArgs,\n ValidatedExecutionArgs,\n ValidatedSubscriptionArgs,\n} from './ExecutionArgs.ts';\nimport type { ExecutionResult } from './Executor.ts';\nimport { Executor } from './Executor.ts';\nimport { ExecutorThrowingOnIncremental } from './ExecutorThrowingOnIncremental.ts';\nimport type { GraphQLVariableSignature } from './getVariableSignature.ts';\nimport { getVariableSignature } from './getVariableSignature.ts';\nimport type { ExperimentalIncrementalExecutionResults } from './incremental/IncrementalExecutor.ts';\nimport { IncrementalExecutor } from './incremental/IncrementalExecutor.ts';\nimport { mapAsyncIterable } from './mapAsyncIterable.ts';\nimport { getArgumentValues, getVariableValues } from './values.ts';\n\nconst UNEXPECTED_EXPERIMENTAL_DIRECTIVES =\n 'The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.';\n\n/** Function used to execute a validated root selection set for a subscription event. */\nexport type RootSelectionSetExecutor = (\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n) => PromiseOrValue;\n\n/**\n * Implements the \"Executing requests\" section of the GraphQL specification.\n *\n * Returns either a synchronous ExecutionResult (if all encountered resolvers\n * are synchronous), or a Promise of an ExecutionResult that will eventually be\n * resolved and never rejected.\n *\n * If the schema is invalid, an error will be thrown immediately. GraphQL\n * request errors, including missing operations and variable coercion errors,\n * are returned in an errors-only ExecutionResult.\n *\n * Field errors are collected into the response instead of rejecting the\n * returned promise. Only the field that produced the error and its descendants\n * are omitted; sibling fields continue to execute. Errors from fields of\n * non-null type may propagate to the nearest nullable parent, which can be the\n * entire response data.\n *\n * This function does not support incremental delivery (`@defer` and `@stream`).\n * Use `experimentalExecuteIncrementally` to execute operations with\n * incremental delivery enabled.\n * @param args - The arguments used to perform the operation.\n * @returns A completed execution result, or a promise resolving to one when execution is asynchronous.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { execute } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String!): String\n * }\n * `);\n *\n * const result = await execute({\n * schema,\n * document: parse('query ($name: String!) { greeting(name: $name) }'),\n * rootValue: {\n * greeting: ({ name }) => `Hello, ${name}!`,\n * },\n * variableValues: { name: 'Ada' },\n * });\n *\n * result; // => { data: { greeting: 'Hello, Ada!' } }\n * ```\n */\nexport function execute(args: ExecutionArgs): PromiseOrValue {\n if (!shouldTrace(executeChannel)) {\n return executeImpl(args);\n }\n return traceMixed(executeChannel, buildOperationContextFromArgs(args), () =>\n executeImpl(args),\n );\n}\n\n/**\n * Build a graphql:execute channel context from raw ExecutionArgs. Defers\n * resolution of the operation AST to a lazy getter so the cost of walking\n * the document is only paid if a subscriber reads it.\n * @internal\n */\nfunction buildOperationContextFromArgs(\n args: ExecutionArgs,\n): Omit {\n let operation: OperationDefinitionNode | null | undefined;\n const resolveOperation = (): OperationDefinitionNode | null | undefined => {\n if (operation === undefined) {\n operation = getOperationAST(args.document, args.operationName);\n }\n return operation;\n };\n return {\n schema: args.schema,\n document: args.document,\n rawVariableValues: args.variableValues,\n get operationName() {\n return args.operationName ?? resolveOperation()?.name?.value;\n },\n get operationType() {\n return resolveOperation()?.operation;\n },\n };\n}\n\nfunction executeImpl(args: ExecutionArgs): PromiseOrValue {\n if (args.schema.getDirective('defer') || args.schema.getDirective('stream')) {\n throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES);\n }\n\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return executeRootSelectionSet(validatedExecutionArgs);\n}\n\n/**\n * Implements the \"Executing requests\" section of the GraphQL specification,\n * including `@defer` and `@stream` as proposed in\n * https://github.com/graphql/graphql-spec/pull/742\n *\n * This function returns either a single ExecutionResult, or an\n * ExperimentalIncrementalExecutionResults object containing an `initialResult`\n * and a stream of `subsequentResults`.\n *\n * If the schema is invalid, an error will be thrown immediately. GraphQL\n * request errors, including missing operations and variable coercion errors,\n * are returned in an errors-only ExecutionResult.\n * @param args - Execution arguments for the GraphQL operation.\n * @returns A single execution result or incremental execution results.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { experimentalExecuteIncrementally } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const result = await experimentalExecuteIncrementally({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n * @category Incremental Execution\n */\nexport function experimentalExecuteIncrementally(\n args: ExecutionArgs,\n): PromiseOrValue {\n if (!shouldTrace(executeChannel)) {\n return experimentalExecuteIncrementallyImpl(args);\n }\n return traceMixed(executeChannel, buildOperationContextFromArgs(args), () =>\n experimentalExecuteIncrementallyImpl(args),\n );\n}\n\nfunction experimentalExecuteIncrementallyImpl(\n args: ExecutionArgs,\n): PromiseOrValue {\n // If the request cannot produce valid execution arguments, return a\n // \"Response\" with only errors.\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return experimentalExecuteRootSelectionSet(validatedExecutionArgs);\n}\n\n/** @internal */\nexport function executeIgnoringIncremental(\n args: ExecutionArgs,\n): PromiseOrValue {\n if (!shouldTrace(executeChannel)) {\n return executeIgnoringIncrementalImpl(args);\n }\n return traceMixed(executeChannel, buildOperationContextFromArgs(args), () =>\n executeIgnoringIncrementalImpl(args),\n );\n}\n\nfunction executeIgnoringIncrementalImpl(\n args: ExecutionArgs,\n): PromiseOrValue {\n // If the request cannot produce valid execution arguments, return a\n // \"Response\" with only errors.\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return executeRootSelectionSetIgnoringIncremental(validatedExecutionArgs);\n}\n\n/**\n * Implements the \"Executing operations\" section of the spec.\n *\n * Returns either a synchronous ExecutionResult, or a Promise for an\n * ExecutionResult, described by the \"Response\" section of the GraphQL\n * specification.\n *\n * If errors are encountered while executing a GraphQL field, only that field\n * and its descendants will be omitted, and sibling fields will still be\n * executed. These field errors are collected into the returned result instead\n * of being thrown or rejecting the returned promise.\n *\n * Errors from sub-fields of a NonNull type may propagate to the top level, at\n * which point we still collect the error and null the parent field, which in\n * this case is the entire response.\n * @param validatedExecutionArgs - Validated execution arguments.\n * @returns Execution result for the operation root selection set.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * executeRootSelectionSet,\n * validateExecutionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await executeRootSelectionSet(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function executeRootSelectionSet(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue {\n return new ExecutorThrowingOnIncremental(\n validatedExecutionArgs,\n ).executeRootSelectionSet();\n}\n\n/**\n * Executes the operation root selection set with incremental delivery enabled.\n * @param validatedExecutionArgs - Validated execution arguments.\n * @returns A single execution result or incremental execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * experimentalExecuteRootSelectionSet,\n * validateExecutionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await experimentalExecuteRootSelectionSet(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n * @category Incremental Execution\n */\nexport function experimentalExecuteRootSelectionSet(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue {\n return new IncrementalExecutor(\n validatedExecutionArgs,\n ).executeRootSelectionSet();\n}\n\n/** @internal */\nexport function executeRootSelectionSetIgnoringIncremental(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue {\n return new Executor(validatedExecutionArgs).executeRootSelectionSet();\n}\n\n/**\n * Also implements the \"Executing requests\" section of the GraphQL specification.\n * However, it guarantees to complete synchronously (or throw an error) assuming\n * that all field resolvers are also synchronous.\n * @param args - The arguments used to perform the operation.\n * @returns Completed execution output for a synchronous operation.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { executeSync } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n *\n * const result = executeSync({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function executeSync(args: ExecutionArgs): ExecutionResult {\n const result = experimentalExecuteIncrementally(args);\n\n // Assert that the execution was synchronous.\n if (isPromise(result) || 'initialResult' in result) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\n/**\n * Executes a subscription operation once for a single source event.\n *\n * Field errors are collected into the returned result instead of being thrown\n * or rejecting the returned promise.\n * @param validatedExecutionArgs - Validated subscription execution arguments.\n * @returns Execution result for the subscription event.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * executeSubscriptionEvent,\n * validateSubscriptionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await executeSubscriptionEvent(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function executeSubscriptionEvent(\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n): PromiseOrValue {\n return new ExecutorThrowingOnIncremental(\n validatedExecutionArgs,\n ).executeRootSelectionSet(false);\n}\n\n/**\n * Implements the \"Subscribe\" algorithm described in the GraphQL specification.\n *\n * Returns either an AsyncGenerator (if successful), an ExecutionResult (error),\n * or a Promise for one of those results. The call will throw immediately if\n * the schema is invalid or the selected operation is not a subscription.\n *\n * GraphQL request errors, including missing operations and variable coercion\n * errors, return or resolve to a GraphQL Response (ExecutionResult) with\n * descriptive errors and no data.\n *\n * If the source stream could not be created due to faulty subscription resolver\n * logic, a non-async-iterable resolver result, or a system error, the\n * function will return or resolve to a single ExecutionResult containing\n * `errors` and no `data`.\n *\n * If the operation succeeded, the function returns or resolves to an\n * AsyncGenerator, which yields a stream of ExecutionResults representing the\n * response stream.\n *\n * This function does not support incremental delivery (`@defer` and `@stream`).\n * If an operation which would defer or stream data is executed with this\n * function, a field error will be raised at the location of the `@defer` or\n * `@stream` directive.\n *\n * Accepts an object with named arguments.\n * @param args - Execution arguments for the subscription operation.\n * @returns A response stream for a valid subscription, or an execution result containing errors.\n * @example\n * ```ts\n * // Use a same-named rootValue function to provide the source event stream.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { subscribe } from 'graphql/execution';\n *\n * async function* greetings() {\n * yield { greeting: 'Hello' };\n * yield { greeting: 'Bonjour' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n *\n * const result = await subscribe({\n * schema,\n * document: parse('subscription { greeting }'),\n * rootValue: { greeting: () => greetings() },\n * });\n *\n * assert('next' in result);\n *\n * const firstPayload = await result.next();\n * firstPayload.value; // => { data: { greeting: 'Hello' } }\n * ```\n * @example\n * ```ts\n * // This variant supplies events through a custom subscribeFieldResolver.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { subscribe } from 'graphql/execution';\n *\n * async function* defaultGreetings() {\n * yield { greeting: 'Hello' };\n * }\n *\n * async function* frenchGreetings() {\n * yield { greeting: 'Bonjour' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting(locale: String): String\n * }\n * `);\n *\n * const result = await subscribe({\n * schema,\n * document: parse(\n * 'subscription Greeting($locale: String) { greeting(locale: $locale) }',\n * ),\n * rootValue: {\n * greeting: (args, contextValue) => {\n * const locale = args.locale ?? contextValue.defaultLocale;\n * return locale === 'fr' ? frenchGreetings() : defaultGreetings();\n * },\n * },\n * contextValue: { defaultLocale: 'fr' },\n * variableValues: { locale: 'fr' },\n * operationName: 'Greeting',\n * subscribeFieldResolver: (rootValue, args, contextValue, info) => {\n * args.locale; // => 'fr'\n * return rootValue[info.fieldName](args, contextValue);\n * },\n * });\n *\n * assert('next' in result);\n *\n * const firstPayload = await result.next();\n * firstPayload.value; // => { data: { greeting: 'Bonjour' } }\n * ```\n */\nexport function subscribe(\n args: ExecutionArgs,\n): PromiseOrValue<\n AsyncGenerator | ExecutionResult\n> {\n if (!shouldTrace(subscribeChannel)) {\n return subscribeImpl(args);\n }\n return traceMixed(subscribeChannel, buildOperationContextFromArgs(args), () =>\n subscribeImpl(args),\n );\n}\n\nfunction subscribeImpl(\n args: ExecutionArgs,\n): PromiseOrValue<\n AsyncGenerator | ExecutionResult\n> {\n // If the request cannot produce valid execution arguments, return a\n // \"Response\" with only errors.\n const validatedExecutionArgs = validateSubscriptionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n const resultOrStream = createSourceEventStream(validatedExecutionArgs);\n\n if (isPromise(resultOrStream)) {\n return resultOrStream.then((resolvedResultOrStream) =>\n isAsyncIterable(resolvedResultOrStream)\n ? mapSourceToResponseEvent(\n validatedExecutionArgs,\n resolvedResultOrStream,\n )\n : resolvedResultOrStream,\n );\n }\n\n return isAsyncIterable(resultOrStream)\n ? mapSourceToResponseEvent(validatedExecutionArgs, resultOrStream)\n : resultOrStream;\n}\n\n/**\n * Implements the \"CreateSourceEventStream\" algorithm described in the\n * GraphQL specification, resolving the subscription source event stream for a\n * previously validated subscription request.\n *\n * Returns either an AsyncIterable (if successful), an ExecutionResult (error),\n * or a Promise for one of those results. The call will throw immediately if\n * it is not passed validated execution arguments.\n *\n * If the validated arguments do not result in a compliant subscription, a\n * GraphQL Response (ExecutionResult) with descriptive errors and no data will\n * be returned.\n *\n * If the source stream could not be created due to faulty subscription\n * resolver logic or a system error, the function will return or\n * resolve to a single ExecutionResult containing `errors` and no `data`.\n *\n * If the operation succeeded, the function returns or resolves to the\n * AsyncIterable for the event stream returned by the resolver.\n *\n * A Source Event Stream represents a sequence of events, each of which triggers\n * a GraphQL execution for that event.\n *\n * This may be useful when hosting the stateful subscription service in a\n * different process or machine than the stateless GraphQL execution engine,\n * or otherwise separating these two steps. For more on this, see the\n * \"Supporting Subscriptions at Scale\" information in the GraphQL specification.\n * @param validatedExecutionArgs - Validated subscription execution arguments.\n * @returns A source event stream, or an execution result containing errors.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * createSourceEventStream,\n * validateSubscriptionArgs,\n * } from 'graphql/execution';\n *\n * async function* greetings() {\n * yield { greeting: 'Hello' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * rootValue: { greeting: () => greetings() },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const stream = await createSourceEventStream(validatedArgs);\n * Symbol.asyncIterator in stream; // => true\n * ```\n */\nexport function createSourceEventStream(\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n): PromiseOrValue | ExecutionResult> {\n if (!('operation' in validatedExecutionArgs)) {\n throw new GraphQLError(\n 'Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.',\n );\n }\n\n try {\n const eventStream = executeSubscription(validatedExecutionArgs);\n if (isPromise(eventStream)) {\n return eventStream.then(undefined, (error: unknown) => ({\n errors: [ensureGraphQLError(error)],\n }));\n }\n\n return eventStream;\n } catch (error) {\n return { errors: [ensureGraphQLError(error)] };\n }\n}\n\n/**\n * Validates the arguments passed to execute, subscribe, and their lower-level\n * helpers.\n *\n * Throws if the schema is invalid. GraphQL request errors, including variable\n * coercion errors, are returned as a GraphQLError array.\n * @param args - Execution arguments to validate.\n * @returns Validated execution arguments, or validation errors.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validateExecutionArgs } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * interface Named {\n * name: String!\n * }\n *\n * type User implements Named {\n * name: String!\n * }\n *\n * type Query {\n * viewer: Named\n * }\n * `);\n * const abortController = new AbortController();\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('query Viewer { viewer { __typename name } }'),\n * rootValue: { viewer: { kind: 'user', name: 'Ada' } },\n * contextValue: { locale: 'en' },\n * operationName: 'Viewer',\n * fieldResolver: (source, _args, contextValue, info) => {\n * contextValue.locale; // => 'en'\n * return source[info.fieldName];\n * },\n * typeResolver: (value) => {\n * return value.kind === 'user' ? 'User' : undefined;\n * },\n * hideSuggestions: true,\n * abortSignal: abortController.signal,\n * enableEarlyExecution: true,\n * hooks: {\n * asyncWorkFinished: () => {},\n * },\n * options: { maxCoercionErrors: 1 },\n * });\n *\n * assert('operation' in validatedArgs);\n *\n * validatedArgs.operation.name?.value; // => 'Viewer'\n * validatedArgs.hideSuggestions; // => true\n * ```\n */\nexport function validateExecutionArgs(\n args: ExecutionArgs,\n): ReadonlyArray | ValidatedExecutionArgs {\n const {\n schema,\n document,\n rootValue,\n contextValue,\n variableValues: rawVariableValues,\n operationName,\n fieldResolver,\n typeResolver,\n subscribeFieldResolver,\n abortSignal: externalAbortSignal,\n enableEarlyExecution,\n hooks,\n options,\n } = args;\n\n // If the schema used for execution is invalid, throw an error.\n assertValidSchema(schema);\n\n let operation: OperationDefinitionNode | undefined;\n const fragmentDefinitions: ObjMap =\n Object.create(null);\n const fragments: ObjMap = Object.create(null);\n const fragmentVariableSignatureErrors: Array = [];\n for (const definition of document.definitions) {\n switch (definition.kind) {\n case Kind.OPERATION_DEFINITION:\n if (operationName == null) {\n if (operation !== undefined) {\n return [\n new GraphQLError(\n 'Must provide operation name if query contains multiple operations.',\n ),\n ];\n }\n operation = definition;\n } else if (definition.name?.value === operationName) {\n operation = definition;\n }\n break;\n case Kind.FRAGMENT_DEFINITION: {\n fragmentDefinitions[definition.name.value] = definition;\n let variableSignatures;\n if (definition.variableDefinitions) {\n const signatures: ObjMap =\n Object.create(null);\n for (const varDef of definition.variableDefinitions) {\n const signature = getVariableSignature(schema, varDef);\n if (signature instanceof GraphQLError) {\n fragmentVariableSignatureErrors.push(signature);\n continue;\n }\n signatures[signature.name] = signature;\n }\n variableSignatures = signatures;\n }\n fragments[definition.name.value] = { definition, variableSignatures };\n break;\n }\n default:\n // ignore non-executable definitions\n }\n }\n\n if (!operation) {\n if (operationName != null) {\n return [new GraphQLError(`Unknown operation named \"${operationName}\".`)];\n }\n return [new GraphQLError('Must provide an operation.')];\n }\n\n if (fragmentVariableSignatureErrors.length > 0) {\n return fragmentVariableSignatureErrors;\n }\n\n const variableDefinitions = operation.variableDefinitions ?? [];\n const hideSuggestions = args.hideSuggestions ?? false;\n\n const coercionInput = rawVariableValues ?? {};\n const coercionOptions = {\n maxErrors: options?.maxCoercionErrors ?? 50,\n hideSuggestions,\n };\n const coercionChannel = executeVariableCoercionChannel;\n const variableValuesOrErrors = shouldTrace(coercionChannel)\n ? traceMixed(\n coercionChannel,\n {\n schema,\n document,\n operation,\n rawVariableValues,\n operationName: operation.name?.value,\n operationType: operation.operation,\n },\n () =>\n getVariableValues(\n schema,\n variableDefinitions,\n coercionInput,\n coercionOptions,\n ),\n )\n : getVariableValues(\n schema,\n variableDefinitions,\n coercionInput,\n coercionOptions,\n );\n\n if (variableValuesOrErrors.errors) {\n return variableValuesOrErrors.errors;\n }\n\n const errorPropagation = !operation.directives?.find(\n (directive) =>\n directive.name.value === GraphQLDisableErrorPropagationDirective.name,\n );\n\n return {\n schema,\n document,\n fragmentDefinitions,\n fragments,\n rootValue,\n contextValue,\n operation,\n variableValues: variableValuesOrErrors.variableValues,\n fieldResolver: fieldResolver ?? defaultFieldResolver,\n typeResolver: typeResolver ?? defaultTypeResolver,\n subscribeFieldResolver: subscribeFieldResolver ?? defaultFieldResolver,\n hideSuggestions,\n errorPropagation,\n externalAbortSignal: externalAbortSignal ?? undefined,\n enableEarlyExecution: enableEarlyExecution === true,\n hooks: hooks ?? undefined,\n rawVariableValues,\n };\n}\n\n/**\n * Validates execution arguments for a subscription operation.\n *\n * Throws if the schema is invalid or the selected operation is not a\n * subscription. GraphQL request errors, including variable coercion errors, are\n * returned as a GraphQLError array.\n * @param args - Execution arguments to validate.\n * @returns Validated subscription execution arguments, or validation errors.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validateSubscriptionArgs } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * });\n *\n * assert('operation' in validatedArgs);\n *\n * validatedArgs.operation.operation; // => 'subscription'\n * ```\n */\nexport function validateSubscriptionArgs(\n args: ExecutionArgs,\n): ReadonlyArray | ValidatedSubscriptionArgs {\n const validatedExecutionArgs = validateExecutionArgs(args);\n if (!('schema' in validatedExecutionArgs)) {\n return validatedExecutionArgs;\n }\n assertSubscriptionExecutionArgs(validatedExecutionArgs);\n return validatedExecutionArgs;\n}\n\nfunction assertSubscriptionExecutionArgs(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): asserts validatedExecutionArgs is ValidatedSubscriptionArgs {\n if (\n !isSubscriptionOperationDefinitionNode(validatedExecutionArgs.operation)\n ) {\n throw new GraphQLError('Expected subscription operation.');\n }\n}\n\n/**\n * If a resolveType function is not given, then a default resolve behavior is\n * used which attempts two strategies:\n *\n * First, See if the provided value has a `__typename` field defined, if so, use\n * that value as name of the resolved type.\n *\n * Otherwise, test each possible type for the abstract type by calling\n * isTypeOf for the object being coerced, returning the first type that matches.\n */\nexport const defaultTypeResolver: GraphQLTypeResolver =\n function (value, contextValue, info, abstractType) {\n // First, look for `__typename`.\n if (isObjectLike(value) && typeof value.__typename === 'string') {\n return value.__typename;\n }\n\n // Otherwise, test each possible type.\n const possibleTypes = info.schema.getPossibleTypes(abstractType);\n const promisedIsTypeOfResults: Array> = [];\n\n try {\n for (let i = 0; i < possibleTypes.length; i++) {\n const type = possibleTypes[i];\n\n if (type.isTypeOf) {\n const isTypeOfResult = type.isTypeOf(value, contextValue, info);\n\n if (isPromiseLike(isTypeOfResult)) {\n promisedIsTypeOfResults[i] = isTypeOfResult;\n } else if (isTypeOfResult) {\n if (promisedIsTypeOfResults.length) {\n info.getAsyncHelpers().track(promisedIsTypeOfResults);\n }\n return type.name;\n }\n }\n }\n } catch (error) {\n if (promisedIsTypeOfResults.length) {\n info.getAsyncHelpers().track(promisedIsTypeOfResults);\n }\n throw error;\n }\n\n if (promisedIsTypeOfResults.length) {\n return info\n .getAsyncHelpers()\n .promiseAll(promisedIsTypeOfResults)\n .then((isTypeOfResults) => {\n for (let i = 0; i < isTypeOfResults.length; i++) {\n if (isTypeOfResults[i]) {\n return possibleTypes[i].name;\n }\n }\n });\n }\n };\n\n/**\n * If a resolve function is not given, then a default resolve behavior is used\n * which takes the property of the source object of the same name as the field\n * and returns it as the result, or if it's a function, returns the result\n * of calling that function while passing along args and context value.\n */\nexport const defaultFieldResolver: GraphQLFieldResolver =\n function (source: any, args, contextValue, info) {\n // ensure source is a value for which property access is acceptable.\n if (isObjectLike(source) || typeof source === 'function') {\n const property = source[info.fieldName];\n if (typeof property === 'function') {\n return source[info.fieldName](args, contextValue, info);\n }\n return property;\n }\n };\n\n/**\n * Implements the \"MapSourceToResponseEvent\" algorithm described in the\n * GraphQL specification, mapping each event from a subscription source event\n * stream to an ExecutionResult in the response stream.\n * @param validatedExecutionArgs - Validated subscription execution arguments.\n * @param sourceEventStream - Source event stream returned by the subscription resolver.\n * @param rootSelectionSetExecutor - Function used to execute each source event.\n * @returns A response stream of execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * mapSourceToResponseEvent,\n * validateSubscriptionArgs,\n * } from 'graphql/execution';\n *\n * async function* events() {\n * yield { greeting: 'Hello' };\n * }\n *\n * const schema = buildSchema(`\n * type Query {\n * noop: String\n * }\n *\n * type Subscription {\n * greeting: String\n * }\n * `);\n * const validatedArgs = validateSubscriptionArgs({\n * schema,\n * document: parse('subscription { greeting }'),\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const responseStream = mapSourceToResponseEvent(validatedArgs, events());\n * const firstPayload = await responseStream.next();\n *\n * firstPayload.value; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function mapSourceToResponseEvent(\n validatedExecutionArgs: ValidatedSubscriptionArgs,\n sourceEventStream: AsyncIterable,\n rootSelectionSetExecutor: RootSelectionSetExecutor = executeSubscriptionEvent,\n): AsyncGenerator {\n // For each payload yielded from a subscription, map it over the normal\n // GraphQL `execute` function, with `payload` as the rootValue.\n function mapFn(payload: unknown): PromiseOrValue {\n const perEventExecutionArgs: ValidatedSubscriptionArgs = {\n ...validatedExecutionArgs,\n rootValue: payload,\n };\n return rootSelectionSetExecutor(perEventExecutionArgs);\n }\n\n const externalAbortSignal = validatedExecutionArgs.externalAbortSignal;\n if (externalAbortSignal) {\n const generator = mapAsyncIterable(sourceEventStream, mapFn);\n return {\n ...generator,\n next: () => cancellablePromise(generator.next(), externalAbortSignal),\n };\n }\n return mapAsyncIterable(sourceEventStream, mapFn);\n}\n\nfunction executeSubscription(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue> {\n const {\n schema,\n fragments,\n rootValue,\n contextValue,\n operation,\n variableValues,\n hideSuggestions,\n externalAbortSignal,\n } = validatedExecutionArgs;\n\n const rootType = schema.getSubscriptionType();\n if (rootType == null) {\n throw new GraphQLError(\n 'Schema is not configured to execute subscription operation.',\n { nodes: operation },\n );\n }\n\n const { groupedFieldSet } = collectFields(\n schema,\n fragments,\n variableValues,\n rootType,\n operation.selectionSet,\n hideSuggestions,\n );\n\n const firstRootField = groupedFieldSet.entries().next().value as [\n string,\n FieldDetailsList,\n ];\n const [responseName, fieldDetailsList] = firstRootField;\n const firstFieldDetails = fieldDetailsList[0];\n const firstNode = firstFieldDetails.node;\n const fieldName = firstNode.name.value;\n const fieldDef = schema.getField(rootType, fieldName);\n\n const fieldNodes = fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n if (!fieldDef) {\n throw new GraphQLError(\n `The subscription field \"${fieldName}\" is not defined.`,\n { nodes: fieldNodes },\n );\n }\n\n const sharedExecutionContext =\n createSharedExecutionContext(externalAbortSignal);\n const path = addPath(undefined, responseName, rootType.name);\n const info = buildResolveInfo(\n validatedExecutionArgs,\n fieldDef,\n fieldNodes,\n rootType,\n path,\n sharedExecutionContext.getAbortSignal,\n sharedExecutionContext.getAsyncHelpers,\n );\n\n try {\n // Implements the \"ResolveFieldEventStream\" algorithm from GraphQL specification.\n // It differs from \"ResolveFieldValue\" due to providing a different `resolveFn`.\n\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n const args = getArgumentValues(\n fieldDef,\n firstNode,\n variableValues,\n firstFieldDetails.fragmentVariableValues,\n hideSuggestions,\n );\n\n // Call the `subscribe()` resolver or the default resolver to produce an\n // AsyncIterable yielding raw payloads.\n const resolveFn =\n fieldDef.subscribe ?? validatedExecutionArgs.subscribeFieldResolver;\n\n // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n const result = resolveFn(rootValue, args, contextValue, info);\n\n if (isPromiseLike(result)) {\n const promisedResult = Promise.resolve(result);\n const promise = externalAbortSignal\n ? cancellablePromise(promisedResult, externalAbortSignal)\n : promisedResult;\n return promise\n .then(assertEventStream)\n .then(undefined, (error: unknown) => {\n throw locatedError(\n error,\n toNodes(fieldDetailsList),\n pathToArray(path),\n );\n });\n }\n return assertEventStream(result);\n } catch (error) {\n throw locatedError(error, fieldNodes, pathToArray(path));\n }\n}\n\nfunction assertEventStream(result: unknown): AsyncIterable {\n if (result instanceof Error) {\n throw result;\n }\n\n // Assert field returned an event stream, otherwise yield an error.\n if (!isAsyncIterable(result)) {\n throw new GraphQLError(\n 'Subscription field must return Async Iterable. ' +\n `Received: ${inspect(result)}.`,\n );\n }\n\n return result;\n}\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.mts new file mode 100644 index 00000000..1da6d24b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.mts @@ -0,0 +1,16 @@ +import type { FieldDetailsList } from "./collectFields.mjs"; +import type { ValidatedExecutionArgs } from "./ExecutionArgs.mjs"; +/** @internal */ +export interface StreamUsage { + label: string | undefined; + initialCount: number; + fieldDetailsList: FieldDetailsList; +} +/** + * Returns an object containing info for streaming if a field should be + * streamed based on the experimental flag, stream directive present and + * not disabled by the "if" argument. + * + * @internal + */ +export declare function getStreamUsage(validatedExecutionArgs: ValidatedExecutionArgs, fieldDetailsList: FieldDetailsList): StreamUsage | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.ts new file mode 100644 index 00000000..6e91374a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.d.ts @@ -0,0 +1,16 @@ +import type { FieldDetailsList } from "./collectFields.js"; +import type { ValidatedExecutionArgs } from "./ExecutionArgs.js"; +/** @internal */ +export interface StreamUsage { + label: string | undefined; + initialCount: number; + fieldDetailsList: FieldDetailsList; +} +/** + * Returns an object containing info for streaming if a field should be + * streamed based on the experimental flag, stream directive present and + * not disabled by the "if" argument. + * + * @internal + */ +export declare function getStreamUsage(validatedExecutionArgs: ValidatedExecutionArgs, fieldDetailsList: FieldDetailsList): StreamUsage | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js new file mode 100644 index 00000000..70a8cf45 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStreamUsage = getStreamUsage; +const invariant_ts_1 = require("../jsutils/invariant.js"); +const ast_ts_1 = require("../language/ast.js"); +const directives_ts_1 = require("../type/directives.js"); +const values_ts_1 = require("./values.js"); +function getStreamUsage(validatedExecutionArgs, fieldDetailsList) { + const { operation, variableValues } = validatedExecutionArgs; + const stream = (0, values_ts_1.getDirectiveValues)(directives_ts_1.GraphQLStreamDirective, fieldDetailsList[0].node, variableValues, fieldDetailsList[0].fragmentVariableValues); + if (!stream) { + return; + } + if (stream.if === false) { + return; + } + if (!(typeof stream.initialCount === 'number')) + (0, invariant_ts_1.invariant)(false, 'initialCount must be a number'); + if (!(stream.initialCount >= 0)) + (0, invariant_ts_1.invariant)(false, 'initialCount must be a positive integer'); + if (!(operation.operation !== ast_ts_1.OperationTypeNode.SUBSCRIPTION)) + (0, invariant_ts_1.invariant)(false, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); + const streamedFieldDetailsList = fieldDetailsList.map((fieldDetails) => ({ + node: fieldDetails.node, + deferUsage: undefined, + fragmentVariableValues: fieldDetails.fragmentVariableValues, + })); + return { + initialCount: stream.initialCount, + label: typeof stream.label === 'string' ? stream.label : undefined, + fieldDetailsList: streamedFieldDetailsList, + }; +} +//# sourceMappingURL=getStreamUsage.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js.map new file mode 100644 index 00000000..a3a9af6a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getStreamUsage.js","sourceRoot":"","sources":["../../src/execution/getStreamUsage.ts"],"names":[],"mappings":";;AAwBA,wCAkDC;AA1ED,0DAAoD;AAEpD,+CAAuD;AAEvD,yDAA+D;AAI/D,2CAAiD;AAgBjD,SAAgB,cAAc,CAC5B,sBAA8C,EAC9C,gBAAkC;IAElC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,sBAAsB,CAAC;IAG7D,MAAM,MAAM,GAAG,IAAA,8BAAkB,EAC/B,sCAAsB,EACtB,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,EACxB,cAAc,EACd,gBAAgB,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAC3C,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,MAAM,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;UAGC,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ;YADzC,wBAAS,SAEP,+BAA+B;UAI/B,MAAM,CAAC,YAAY,IAAI,CAAC;YAD1B,wBAAS,SAEP,yCAAyC;UAIzC,SAAS,CAAC,SAAS,KAAK,0BAAiB,CAAC,YAAY;YADxD,wBAAS,SAEP,0HAA0H;IAG5H,MAAM,wBAAwB,GAAqB,gBAAgB,CAAC,GAAG,CACrE,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACjB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,UAAU,EAAE,SAAS;QACrB,sBAAsB,EAAE,YAAY,CAAC,sBAAsB;KAC5D,CAAC,CACH,CAAC;IAEF,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAClE,gBAAgB,EAAE,wBAAwB;KAC3C,CAAC;AACJ,CAAC","sourcesContent":["import { invariant } from '../jsutils/invariant.ts';\n\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport { GraphQLStreamDirective } from '../type/directives.ts';\n\nimport type { FieldDetailsList } from './collectFields.ts';\nimport type { ValidatedExecutionArgs } from './ExecutionArgs.ts';\nimport { getDirectiveValues } from './values.ts';\n\n/** @internal */\nexport interface StreamUsage {\n label: string | undefined;\n initialCount: number;\n fieldDetailsList: FieldDetailsList;\n}\n\n/**\n * Returns an object containing info for streaming if a field should be\n * streamed based on the experimental flag, stream directive present and\n * not disabled by the \"if\" argument.\n *\n * @internal\n */\nexport function getStreamUsage(\n validatedExecutionArgs: ValidatedExecutionArgs,\n fieldDetailsList: FieldDetailsList,\n): StreamUsage | undefined {\n const { operation, variableValues } = validatedExecutionArgs;\n // validation only allows equivalent streams on multiple fields, so it is\n // safe to only check the first fieldNode for the stream directive\n const stream = getDirectiveValues(\n GraphQLStreamDirective,\n fieldDetailsList[0].node,\n variableValues,\n fieldDetailsList[0].fragmentVariableValues,\n );\n\n if (!stream) {\n return;\n }\n\n if (stream.if === false) {\n return;\n }\n\n invariant(\n typeof stream.initialCount === 'number',\n 'initialCount must be a number',\n );\n\n invariant(\n stream.initialCount >= 0,\n 'initialCount must be a positive integer',\n );\n\n invariant(\n operation.operation !== OperationTypeNode.SUBSCRIPTION,\n '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.',\n );\n\n const streamedFieldDetailsList: FieldDetailsList = fieldDetailsList.map(\n (fieldDetails) => ({\n node: fieldDetails.node,\n deferUsage: undefined,\n fragmentVariableValues: fieldDetails.fragmentVariableValues,\n }),\n );\n\n return {\n initialCount: stream.initialCount,\n label: typeof stream.label === 'string' ? stream.label : undefined,\n fieldDetailsList: streamedFieldDetailsList,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs new file mode 100644 index 00000000..1a157526 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs @@ -0,0 +1,31 @@ +import { invariant } from "../jsutils/invariant.mjs"; +import { OperationTypeNode } from "../language/ast.mjs"; +import { GraphQLStreamDirective } from "../type/directives.mjs"; +import { getDirectiveValues } from "./values.mjs"; +export function getStreamUsage(validatedExecutionArgs, fieldDetailsList) { + const { operation, variableValues } = validatedExecutionArgs; + const stream = getDirectiveValues(GraphQLStreamDirective, fieldDetailsList[0].node, variableValues, fieldDetailsList[0].fragmentVariableValues); + if (!stream) { + return; + } + if (stream.if === false) { + return; + } + if (!(typeof stream.initialCount === 'number')) + invariant(false, 'initialCount must be a number'); + if (!(stream.initialCount >= 0)) + invariant(false, 'initialCount must be a positive integer'); + if (!(operation.operation !== OperationTypeNode.SUBSCRIPTION)) + invariant(false, '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.'); + const streamedFieldDetailsList = fieldDetailsList.map((fieldDetails) => ({ + node: fieldDetails.node, + deferUsage: undefined, + fragmentVariableValues: fieldDetails.fragmentVariableValues, + })); + return { + initialCount: stream.initialCount, + label: typeof stream.label === 'string' ? stream.label : undefined, + fieldDetailsList: streamedFieldDetailsList, + }; +} +//# sourceMappingURL=getStreamUsage.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs.map new file mode 100644 index 00000000..cb0c8333 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getStreamUsage.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"getStreamUsage.js","sourceRoot":"","sources":["../../src/execution/getStreamUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,4BAA2B;AAEvD,OAAO,EAAE,sBAAsB,EAAE,+BAA8B;AAI/D,OAAO,EAAE,kBAAkB,EAAE,qBAAoB;AAgBjD,MAAM,UAAU,cAAc,CAC5B,sBAA8C,EAC9C,gBAAkC;IAElC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,sBAAsB,CAAC;IAG7D,MAAM,MAAM,GAAG,kBAAkB,CAC/B,sBAAsB,EACtB,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,EACxB,cAAc,EACd,gBAAgB,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAC3C,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,MAAM,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;UAGC,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ;QADzC,SAAS,QAEP,+BAA+B;UAI/B,MAAM,CAAC,YAAY,IAAI,CAAC;QAD1B,SAAS,QAEP,yCAAyC;UAIzC,SAAS,CAAC,SAAS,KAAK,iBAAiB,CAAC,YAAY;QADxD,SAAS,QAEP,0HAA0H;IAG5H,MAAM,wBAAwB,GAAqB,gBAAgB,CAAC,GAAG,CACrE,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACjB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,UAAU,EAAE,SAAS;QACrB,sBAAsB,EAAE,YAAY,CAAC,sBAAsB;KAC5D,CAAC,CACH,CAAC;IAEF,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAClE,gBAAgB,EAAE,wBAAwB;KAC3C,CAAC;AACJ,CAAC","sourcesContent":["import { invariant } from '../jsutils/invariant.ts';\n\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport { GraphQLStreamDirective } from '../type/directives.ts';\n\nimport type { FieldDetailsList } from './collectFields.ts';\nimport type { ValidatedExecutionArgs } from './ExecutionArgs.ts';\nimport { getDirectiveValues } from './values.ts';\n\n/** @internal */\nexport interface StreamUsage {\n label: string | undefined;\n initialCount: number;\n fieldDetailsList: FieldDetailsList;\n}\n\n/**\n * Returns an object containing info for streaming if a field should be\n * streamed based on the experimental flag, stream directive present and\n * not disabled by the \"if\" argument.\n *\n * @internal\n */\nexport function getStreamUsage(\n validatedExecutionArgs: ValidatedExecutionArgs,\n fieldDetailsList: FieldDetailsList,\n): StreamUsage | undefined {\n const { operation, variableValues } = validatedExecutionArgs;\n // validation only allows equivalent streams on multiple fields, so it is\n // safe to only check the first fieldNode for the stream directive\n const stream = getDirectiveValues(\n GraphQLStreamDirective,\n fieldDetailsList[0].node,\n variableValues,\n fieldDetailsList[0].fragmentVariableValues,\n );\n\n if (!stream) {\n return;\n }\n\n if (stream.if === false) {\n return;\n }\n\n invariant(\n typeof stream.initialCount === 'number',\n 'initialCount must be a number',\n );\n\n invariant(\n stream.initialCount >= 0,\n 'initialCount must be a positive integer',\n );\n\n invariant(\n operation.operation !== OperationTypeNode.SUBSCRIPTION,\n '`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.',\n );\n\n const streamedFieldDetailsList: FieldDetailsList = fieldDetailsList.map(\n (fieldDetails) => ({\n node: fieldDetails.node,\n deferUsage: undefined,\n fragmentVariableValues: fieldDetails.fragmentVariableValues,\n }),\n );\n\n return {\n initialCount: stream.initialCount,\n label: typeof stream.label === 'string' ? stream.label : undefined,\n fieldDetailsList: streamedFieldDetailsList,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.mts new file mode 100644 index 00000000..de7f81d0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.mts @@ -0,0 +1,21 @@ +import { GraphQLError } from "../error/GraphQLError.mjs"; +import type { ConstValueNode, VariableDefinitionNode } from "../language/ast.mjs"; +import type { GraphQLInputType, GraphQLSchema } from "../type/index.mjs"; +/** + * A GraphQLVariableSignature is required to coerce a variable value. + * + * Designed to have comparable interface to GraphQLArgument so that + * getArgumentValues() can be reused for fragment arguments. + * + * @internal + */ +export interface GraphQLVariableSignature { + name: string; + type: GraphQLInputType; + defaultValue?: never; + default: { + literal: ConstValueNode; + } | undefined; +} +/** @internal */ +export declare function getVariableSignature(schema: GraphQLSchema, varDefNode: VariableDefinitionNode): GraphQLVariableSignature | GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.ts new file mode 100644 index 00000000..b28f17c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.d.ts @@ -0,0 +1,21 @@ +import { GraphQLError } from "../error/GraphQLError.js"; +import type { ConstValueNode, VariableDefinitionNode } from "../language/ast.js"; +import type { GraphQLInputType, GraphQLSchema } from "../type/index.js"; +/** + * A GraphQLVariableSignature is required to coerce a variable value. + * + * Designed to have comparable interface to GraphQLArgument so that + * getArgumentValues() can be reused for fragment arguments. + * + * @internal + */ +export interface GraphQLVariableSignature { + name: string; + type: GraphQLInputType; + defaultValue?: never; + default: { + literal: ConstValueNode; + } | undefined; +} +/** @internal */ +export declare function getVariableSignature(schema: GraphQLSchema, varDefNode: VariableDefinitionNode): GraphQLVariableSignature | GraphQLError; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js new file mode 100644 index 00000000..906d78a7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getVariableSignature = getVariableSignature; +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const printer_ts_1 = require("../language/printer.js"); +const definition_ts_1 = require("../type/definition.js"); +const typeFromAST_ts_1 = require("../utilities/typeFromAST.js"); +function getVariableSignature(schema, varDefNode) { + const varName = varDefNode.variable.name.value; + const varType = (0, typeFromAST_ts_1.typeFromAST)(schema, varDefNode.type); + if (!(0, definition_ts_1.isInputType)(varType)) { + const varTypeStr = (0, printer_ts_1.print)(varDefNode.type); + return new GraphQLError_ts_1.GraphQLError(`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, { nodes: varDefNode.type }); + } + const defaultValue = varDefNode.defaultValue; + return { + name: varName, + type: varType, + default: defaultValue && { literal: defaultValue }, + }; +} +//# sourceMappingURL=getVariableSignature.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js.map new file mode 100644 index 00000000..5f216345 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getVariableSignature.js","sourceRoot":"","sources":["../../src/execution/getVariableSignature.ts"],"names":[],"mappings":";;AA6BA,oDAwBC;AArDD,8DAAwD;AAMxD,uDAA+C;AAE/C,yDAAoD;AAGpD,gEAA0D;AAkB1D,SAAgB,oBAAoB,CAClC,MAAqB,EACrB,UAAkC;IAElC,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAA,4BAAW,EAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAErD,IAAI,CAAC,IAAA,2BAAW,EAAC,OAAO,CAAC,EAAE,CAAC;QAG1B,MAAM,UAAU,GAAG,IAAA,kBAAK,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,IAAI,8BAAY,CACrB,cAAc,OAAO,6BAA6B,UAAU,0CAA0C,EACtG,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,CAC3B,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,YAAY,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE;KACnD,CAAC;AACJ,CAAC","sourcesContent":["import { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ConstValueNode,\n VariableDefinitionNode,\n} from '../language/ast.ts';\nimport { print } from '../language/printer.ts';\n\nimport { isInputType } from '../type/definition.ts';\nimport type { GraphQLInputType, GraphQLSchema } from '../type/index.ts';\n\nimport { typeFromAST } from '../utilities/typeFromAST.ts';\n\n/**\n * A GraphQLVariableSignature is required to coerce a variable value.\n *\n * Designed to have comparable interface to GraphQLArgument so that\n * getArgumentValues() can be reused for fragment arguments.\n *\n * @internal\n */\nexport interface GraphQLVariableSignature {\n name: string;\n type: GraphQLInputType;\n defaultValue?: never;\n default: { literal: ConstValueNode } | undefined;\n}\n\n/** @internal */\nexport function getVariableSignature(\n schema: GraphQLSchema,\n varDefNode: VariableDefinitionNode,\n): GraphQLVariableSignature | GraphQLError {\n const varName = varDefNode.variable.name.value;\n const varType = typeFromAST(schema, varDefNode.type);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n const varTypeStr = print(varDefNode.type);\n return new GraphQLError(\n `Variable \"$${varName}\" expected value of type \"${varTypeStr}\" which cannot be used as an input type.`,\n { nodes: varDefNode.type },\n );\n }\n\n const defaultValue = varDefNode.defaultValue;\n\n return {\n name: varName,\n type: varType,\n default: defaultValue && { literal: defaultValue },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs new file mode 100644 index 00000000..37cc6b20 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs @@ -0,0 +1,19 @@ +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { print } from "../language/printer.mjs"; +import { isInputType } from "../type/definition.mjs"; +import { typeFromAST } from "../utilities/typeFromAST.mjs"; +export function getVariableSignature(schema, varDefNode) { + const varName = varDefNode.variable.name.value; + const varType = typeFromAST(schema, varDefNode.type); + if (!isInputType(varType)) { + const varTypeStr = print(varDefNode.type); + return new GraphQLError(`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, { nodes: varDefNode.type }); + } + const defaultValue = varDefNode.defaultValue; + return { + name: varName, + type: varType, + default: defaultValue && { literal: defaultValue }, + }; +} +//# sourceMappingURL=getVariableSignature.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs.map new file mode 100644 index 00000000..0b54508e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/getVariableSignature.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"getVariableSignature.js","sourceRoot":"","sources":["../../src/execution/getVariableSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAMxD,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAE/C,OAAO,EAAE,WAAW,EAAE,+BAA8B;AAGpD,OAAO,EAAE,WAAW,EAAE,qCAAoC;AAkB1D,MAAM,UAAU,oBAAoB,CAClC,MAAqB,EACrB,UAAkC;IAElC,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/C,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAErD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QAG1B,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,IAAI,YAAY,CACrB,cAAc,OAAO,6BAA6B,UAAU,0CAA0C,EACtG,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,CAC3B,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,YAAY,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE;KACnD,CAAC;AACJ,CAAC","sourcesContent":["import { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ConstValueNode,\n VariableDefinitionNode,\n} from '../language/ast.ts';\nimport { print } from '../language/printer.ts';\n\nimport { isInputType } from '../type/definition.ts';\nimport type { GraphQLInputType, GraphQLSchema } from '../type/index.ts';\n\nimport { typeFromAST } from '../utilities/typeFromAST.ts';\n\n/**\n * A GraphQLVariableSignature is required to coerce a variable value.\n *\n * Designed to have comparable interface to GraphQLArgument so that\n * getArgumentValues() can be reused for fragment arguments.\n *\n * @internal\n */\nexport interface GraphQLVariableSignature {\n name: string;\n type: GraphQLInputType;\n defaultValue?: never;\n default: { literal: ConstValueNode } | undefined;\n}\n\n/** @internal */\nexport function getVariableSignature(\n schema: GraphQLSchema,\n varDefNode: VariableDefinitionNode,\n): GraphQLVariableSignature | GraphQLError {\n const varName = varDefNode.variable.name.value;\n const varType = typeFromAST(schema, varDefNode.type);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n const varTypeStr = print(varDefNode.type);\n return new GraphQLError(\n `Variable \"$${varName}\" expected value of type \"${varTypeStr}\" which cannot be used as an input type.`,\n { nodes: varDefNode.type },\n );\n }\n\n const defaultValue = varDefNode.defaultValue;\n\n return {\n name: varName,\n type: varType,\n default: defaultValue && { literal: defaultValue },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.mts new file mode 100644 index 00000000..446dc3fc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.mts @@ -0,0 +1,5 @@ +/** @category Execution */ +import type { SharedExecutionContext } from "./createSharedExecutionContext.mjs"; +import type { AsyncWorkFinishedInfo, ValidatedExecutionArgs } from "./ExecutionArgs.mjs"; +/** @internal */ +export declare function runAsyncWorkFinishedHook(validatedExecutionArgs: ValidatedExecutionArgs, sharedExecutionContext: SharedExecutionContext, asyncWorkFinishedHook: (info: AsyncWorkFinishedInfo) => void): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.ts new file mode 100644 index 00000000..29748340 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.d.ts @@ -0,0 +1,5 @@ +/** @category Execution */ +import type { SharedExecutionContext } from "./createSharedExecutionContext.js"; +import type { AsyncWorkFinishedInfo, ValidatedExecutionArgs } from "./ExecutionArgs.js"; +/** @internal */ +export declare function runAsyncWorkFinishedHook(validatedExecutionArgs: ValidatedExecutionArgs, sharedExecutionContext: SharedExecutionContext, asyncWorkFinishedHook: (info: AsyncWorkFinishedInfo) => void): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js new file mode 100644 index 00000000..0bb373b2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.runAsyncWorkFinishedHook = runAsyncWorkFinishedHook; +function runHookSafely(hook, info) { + try { + hook?.(info); + } + catch { + } +} +function runAsyncWorkFinishedHook(validatedExecutionArgs, sharedExecutionContext, asyncWorkFinishedHook) { + const maybeWaitForAsyncWork = sharedExecutionContext.asyncWorkTracker.wait(); + if (maybeWaitForAsyncWork === undefined) { + runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs }); + return; + } + maybeWaitForAsyncWork + .then(() => { + runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs }); + }) + .catch(() => undefined); +} +//# sourceMappingURL=hooks.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js.map new file mode 100644 index 00000000..08af9603 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/execution/hooks.ts"],"names":[],"mappings":";;AAiBA,4DAeC;AAxBD,SAAS,aAAa,CAAQ,IAA2B,EAAE,IAAW;IACpE,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC;AAGD,SAAgB,wBAAwB,CACtC,sBAA8C,EAC9C,sBAA8C,EAC9C,qBAA4D;IAE5D,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC7E,IAAI,qBAAqB,KAAK,SAAS,EAAE,CAAC;QACxC,aAAa,CAAC,qBAAqB,EAAE,EAAE,sBAAsB,EAAE,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IACD,qBAAqB;SAClB,IAAI,CAAC,GAAG,EAAE;QACT,aAAa,CAAC,qBAAqB,EAAE,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACnE,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["/** @category Execution */\n\nimport type { SharedExecutionContext } from './createSharedExecutionContext.ts';\nimport type {\n AsyncWorkFinishedInfo,\n ValidatedExecutionArgs,\n} from './ExecutionArgs.ts';\n\nfunction runHookSafely(hook: (info: TInfo) => void, info: TInfo): void {\n try {\n hook?.(info);\n } catch {\n // ignore hook errors\n }\n}\n\n/** @internal */\nexport function runAsyncWorkFinishedHook(\n validatedExecutionArgs: ValidatedExecutionArgs,\n sharedExecutionContext: SharedExecutionContext,\n asyncWorkFinishedHook: (info: AsyncWorkFinishedInfo) => void,\n): void {\n const maybeWaitForAsyncWork = sharedExecutionContext.asyncWorkTracker.wait();\n if (maybeWaitForAsyncWork === undefined) {\n runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs });\n return;\n }\n maybeWaitForAsyncWork\n .then(() => {\n runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs });\n })\n .catch(() => undefined);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs new file mode 100644 index 00000000..6755d4b0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs @@ -0,0 +1,20 @@ +function runHookSafely(hook, info) { + try { + hook?.(info); + } + catch { + } +} +export function runAsyncWorkFinishedHook(validatedExecutionArgs, sharedExecutionContext, asyncWorkFinishedHook) { + const maybeWaitForAsyncWork = sharedExecutionContext.asyncWorkTracker.wait(); + if (maybeWaitForAsyncWork === undefined) { + runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs }); + return; + } + maybeWaitForAsyncWork + .then(() => { + runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs }); + }) + .catch(() => undefined); +} +//# sourceMappingURL=hooks.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs.map new file mode 100644 index 00000000..97dfeeec --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/hooks.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/execution/hooks.ts"],"names":[],"mappings":"AAQA,SAAS,aAAa,CAAQ,IAA2B,EAAE,IAAW;IACpE,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC;AAGD,MAAM,UAAU,wBAAwB,CACtC,sBAA8C,EAC9C,sBAA8C,EAC9C,qBAA4D;IAE5D,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC7E,IAAI,qBAAqB,KAAK,SAAS,EAAE,CAAC;QACxC,aAAa,CAAC,qBAAqB,EAAE,EAAE,sBAAsB,EAAE,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IACD,qBAAqB;SAClB,IAAI,CAAC,GAAG,EAAE;QACT,aAAa,CAAC,qBAAqB,EAAE,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACnE,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["/** @category Execution */\n\nimport type { SharedExecutionContext } from './createSharedExecutionContext.ts';\nimport type {\n AsyncWorkFinishedInfo,\n ValidatedExecutionArgs,\n} from './ExecutionArgs.ts';\n\nfunction runHookSafely(hook: (info: TInfo) => void, info: TInfo): void {\n try {\n hook?.(info);\n } catch {\n // ignore hook errors\n }\n}\n\n/** @internal */\nexport function runAsyncWorkFinishedHook(\n validatedExecutionArgs: ValidatedExecutionArgs,\n sharedExecutionContext: SharedExecutionContext,\n asyncWorkFinishedHook: (info: AsyncWorkFinishedInfo) => void,\n): void {\n const maybeWaitForAsyncWork = sharedExecutionContext.asyncWorkTracker.wait();\n if (maybeWaitForAsyncWork === undefined) {\n runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs });\n return;\n }\n maybeWaitForAsyncWork\n .then(() => {\n runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs });\n })\n .catch(() => undefined);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.mts new file mode 100644 index 00000000..f4154beb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.mts @@ -0,0 +1,22 @@ +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.mjs"; +type MaybePromise = { + status: 'fulfilled'; + value: T; +} | { + status: 'pending'; + promise: Promise; +} | { + status: 'rejected'; + reason: unknown; +}; +/** @internal * */ +export declare class Computation { + private _fn; + private _onAbort; + private _maybePromise?; + constructor(fn: () => PromiseOrValue, onAbort?: (reason?: unknown) => PromiseOrValue); + prime(): MaybePromise; + result(): PromiseOrValue; + abort(reason?: unknown): PromiseOrValue; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.ts new file mode 100644 index 00000000..6a2616cc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.d.ts @@ -0,0 +1,22 @@ +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.js"; +type MaybePromise = { + status: 'fulfilled'; + value: T; +} | { + status: 'pending'; + promise: Promise; +} | { + status: 'rejected'; + reason: unknown; +}; +/** @internal * */ +export declare class Computation { + private _fn; + private _onAbort; + private _maybePromise?; + constructor(fn: () => PromiseOrValue, onAbort?: (reason?: unknown) => PromiseOrValue); + prime(): MaybePromise; + result(): PromiseOrValue; + abort(reason?: unknown): PromiseOrValue; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js new file mode 100644 index 00000000..7c8212fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Computation = void 0; +const isPromise_ts_1 = require("../../jsutils/isPromise.js"); +class Computation { + constructor(fn, onAbort) { + this._fn = fn; + this._onAbort = onAbort; + } + prime() { + if (this._maybePromise) { + return this._maybePromise; + } + try { + const result = this._fn(); + if ((0, isPromise_ts_1.isPromise)(result)) { + this._maybePromise = { status: 'pending', promise: result }; + result.then((value) => { + this._maybePromise = { status: 'fulfilled', value }; + }, (reason) => { + this._maybePromise = { status: 'rejected', reason }; + }); + } + else { + this._maybePromise = { status: 'fulfilled', value: result }; + } + } + catch (reason) { + this._maybePromise = { status: 'rejected', reason }; + } + return this._maybePromise; + } + result() { + const maybePromise = this.prime(); + switch (maybePromise.status) { + case 'fulfilled': + return maybePromise.value; + case 'rejected': + throw maybePromise.reason; + case 'pending': { + return maybePromise.promise; + } + } + } + abort(reason) { + const maybePromise = this._maybePromise; + if (!maybePromise) { + this._maybePromise = { + status: 'rejected', + reason, + }; + return; + } + const status = maybePromise.status; + if (status === 'pending') { + this._maybePromise = { + status: 'rejected', + reason, + }; + if (this._onAbort) { + return this._onAbort(reason); + } + } + } +} +exports.Computation = Computation; +//# sourceMappingURL=Computation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js.map new file mode 100644 index 00000000..442b4c1d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Computation.js","sourceRoot":"","sources":["../../../src/execution/incremental/Computation.ts"],"names":[],"mappings":";;;AAAA,6DAAuD;AASvD,MAAa,WAAW;IAItB,YACE,EAA2B,EAC3B,OAAoD;QAEpD,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IACD,KAAK;QACH,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC1B,IAAI,IAAA,wBAAS,EAAC,MAAM,CAAC,EAAE,CAAC;gBACtB,IAAI,CAAC,aAAa,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;gBAC5D,MAAM,CAAC,IAAI,CACT,CAAC,KAAK,EAAE,EAAE;oBACR,IAAI,CAAC,aAAa,GAAG,EAAE,MAAM,EAAE,WAAW,EA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AO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAnED,kCAmEC","sourcesContent":["import { isPromise } from '../../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\ntype MaybePromise =\n | { status: 'fulfilled'; value: T }\n | { status: 'pending'; promise: Promise }\n | { status: 'rejected'; reason: unknown };\n\n/** @internal * */\nexport class Computation {\n private _fn: () => PromiseOrValue;\n private _onAbort: ((reason?: unknown) => PromiseOrValue) | undefined;\n private _maybePromise?: MaybePromise;\n constructor(\n fn: () => PromiseOrValue,\n onAbort?: (reason?: unknown) => PromiseOrValue,\n ) {\n this._fn = fn;\n this._onAbort = onAbort;\n }\n prime(): MaybePromise {\n if (this._maybePromise) {\n return this._maybePromise;\n }\n try {\n const result = this._fn();\n if (isPromise(result)) {\n this._maybePromise = { status: 'pending', promise: result };\n result.then(\n (value) => {\n this._maybePromise = { status: 'fulfilled', value };\n },\n (reason: unknown) => {\n this._maybePromise = { status: 'rejected', reason };\n },\n );\n } else {\n this._maybePromise = { status: 'fulfilled', value: result };\n }\n } catch (reason: unknown) {\n this._maybePromise = { status: 'rejected', reason };\n }\n return this._maybePromise;\n }\n result(): PromiseOrValue {\n const maybePromise = this.prime();\n switch (maybePromise.status) {\n case 'fulfilled':\n return maybePromise.value;\n case 'rejected':\n throw maybePromise.reason;\n case 'pending': {\n return maybePromise.promise;\n }\n }\n }\n abort(reason?: unknown): PromiseOrValue {\n const maybePromise = this._maybePromise;\n if (!maybePromise) {\n this._maybePromise = {\n status: 'rejected',\n reason,\n };\n return;\n }\n const status = maybePromise.status;\n if (status === 'pending') {\n this._maybePromise = {\n status: 'rejected',\n reason,\n };\n if (this._onAbort) {\n return this._onAbort(reason);\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs new file mode 100644 index 00000000..7492d80b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs @@ -0,0 +1,63 @@ +import { isPromise } from "../../jsutils/isPromise.mjs"; +export class Computation { + constructor(fn, onAbort) { + this._fn = fn; + this._onAbort = onAbort; + } + prime() { + if (this._maybePromise) { + return this._maybePromise; + } + try { + const result = this._fn(); + if (isPromise(result)) { + this._maybePromise = { status: 'pending', promise: result }; + result.then((value) => { + this._maybePromise = { status: 'fulfilled', value }; + }, (reason) => { + this._maybePromise = { status: 'rejected', reason }; + }); + } + else { + this._maybePromise = { status: 'fulfilled', value: result }; + } + } + catch (reason) { + this._maybePromise = { status: 'rejected', reason }; + } + return this._maybePromise; + } + result() { + const maybePromise = this.prime(); + switch (maybePromise.status) { + case 'fulfilled': + return maybePromise.value; + case 'rejected': + throw maybePromise.reason; + case 'pending': { + return maybePromise.promise; + } + } + } + abort(reason) { + const maybePromise = this._maybePromise; + if (!maybePromise) { + this._maybePromise = { + status: 'rejected', + reason, + }; + return; + } + const status = maybePromise.status; + if (status === 'pending') { + this._maybePromise = { + status: 'rejected', + reason, + }; + if (this._onAbort) { + return this._onAbort(reason); + } + } + } +} +//# sourceMappingURL=Computation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs.map new file mode 100644 index 00000000..37a648d2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Computation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Computation.js","sourceRoot":"","sources":["../../../src/execution/incremental/Computation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oCAAmC;AASvD,MAAM,OAAO,WAAW;IAItB,YACE,EAA2B,EAC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B,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,OAAO,YAAY,CAAC,OAAO,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,CAAC,MAAgB;QACpB,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,IAAI,CAAC,aAAa,GAAG;gBACnB,MAAM,EAAE,UAAU;gBAClB,MAAM;aACP,CAAC;YACF,OAAO;QACT,CAAC;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;QACnC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,aAAa,GAAG;gBACnB,MAAM,EAAE,UAAU;gBAClB,MAAM;aACP,CAAC;YACF,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { isPromise } from '../../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\ntype MaybePromise =\n | { status: 'fulfilled'; value: T }\n | { status: 'pending'; promise: Promise }\n | { status: 'rejected'; reason: unknown };\n\n/** @internal * */\nexport class Computation {\n private _fn: () => PromiseOrValue;\n private _onAbort: ((reason?: unknown) => PromiseOrValue) | undefined;\n private _maybePromise?: MaybePromise;\n constructor(\n fn: () => PromiseOrValue,\n onAbort?: (reason?: unknown) => PromiseOrValue,\n ) {\n this._fn = fn;\n this._onAbort = onAbort;\n }\n prime(): MaybePromise {\n if (this._maybePromise) {\n return this._maybePromise;\n }\n try {\n const result = this._fn();\n if (isPromise(result)) {\n this._maybePromise = { status: 'pending', promise: result };\n result.then(\n (value) => {\n this._maybePromise = { status: 'fulfilled', value };\n },\n (reason: unknown) => {\n this._maybePromise = { status: 'rejected', reason };\n },\n );\n } else {\n this._maybePromise = { status: 'fulfilled', value: result };\n }\n } catch (reason: unknown) {\n this._maybePromise = { status: 'rejected', reason };\n }\n return this._maybePromise;\n }\n result(): PromiseOrValue {\n const maybePromise = this.prime();\n switch (maybePromise.status) {\n case 'fulfilled':\n return maybePromise.value;\n case 'rejected':\n throw maybePromise.reason;\n case 'pending': {\n return maybePromise.promise;\n }\n }\n }\n abort(reason?: unknown): PromiseOrValue {\n const maybePromise = this._maybePromise;\n if (!maybePromise) {\n this._maybePromise = {\n status: 'rejected',\n reason,\n };\n return;\n }\n const status = maybePromise.status;\n if (status === 'pending') {\n this._maybePromise = {\n status: 'rejected',\n reason,\n };\n if (this._onAbort) {\n return this._onAbort(reason);\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.mts new file mode 100644 index 00000000..33edc7e3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.mts @@ -0,0 +1,297 @@ +/** @category Incremental Execution */ +import type { ObjMap } from "../../jsutils/ObjMap.mjs"; +import type { Path } from "../../jsutils/Path.mjs"; +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.mjs"; +import type { GraphQLError, GraphQLFormattedError } from "../../error/GraphQLError.mjs"; +import type { GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo } from "../../type/definition.mjs"; +import type { DeferUsage, FieldDetailsList, GroupedFieldSet } from "../collectFields.mjs"; +import type { SharedExecutionContext } from "../createSharedExecutionContext.mjs"; +import type { ValidatedExecutionArgs } from "../ExecutionArgs.mjs"; +import type { ExecutionResult, FormattedExecutionResult } from "../Executor.mjs"; +import { Executor } from "../Executor.mjs"; +import type { StreamUsage } from "../getStreamUsage.mjs"; +import type { DeferUsageSet, ExecutionPlan } from "./buildExecutionPlan.mjs"; +import { Computation } from "./Computation.mjs"; +import { Queue } from "./Queue.mjs"; +import type { Group, Stream, Task, Work } from "./WorkQueue.mjs"; +/** + * Results for an operation that produced incremental payloads. + * @typeParam TInitialData - Shape of the initial result data payload. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface ExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Initial execution result delivered before subsequent incremental payloads. */ + initialResult: InitialIncrementalExecutionResult; + /** Async stream of incremental payloads delivered after the initial result. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * JSON-serializable form of incremental execution results. + * @typeParam TInitial - Shape of the formatted initial result data payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Formatted initial execution result. */ + initialResult: FormattedInitialIncrementalExecutionResult; + /** Async stream of formatted incremental payloads. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * Initial execution result for an operation that produced incremental payloads. + * @typeParam TData - Shape of the initial data payload. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface InitialIncrementalExecutionResult, TExtensions = ObjMap> extends ExecutionResult { + /** Data produced by the initial execution payload. */ + data: TData; + /** Incremental payloads that are still pending after the initial result. */ + pending: ReadonlyArray; + /** Indicates that subsequent incremental payloads will follow. */ + hasNext: true; + /** Additional non-standard metadata included in the initial result. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of an initial incremental execution result. + * @typeParam TInitialData - Shape of the formatted initial data payload. + * @typeParam TExtensions - Shape of the formatted extensions payload. + */ +export interface FormattedInitialIncrementalExecutionResult, TExtensions = ObjMap> extends FormattedExecutionResult { + /** Formatted data produced by the initial execution payload. */ + data: TInitialData; + /** Formatted list of incremental payloads still pending after the initial result. */ + pending: ReadonlyArray; + /** Indicates whether subsequent incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in the formatted initial result. */ + extensions?: TExtensions; +} +/** + * Subsequent payload produced by incremental execution. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface SubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Incremental payloads that became pending with this response. */ + pending?: ReadonlyArray; + /** Deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Incremental payloads that completed with this response. */ + completed?: ReadonlyArray; + /** Indicates whether more incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a subsequent incremental execution payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedSubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Indicates whether more incremental payloads will follow. */ + hasNext: boolean; + /** Formatted incremental payloads that became pending with this response. */ + pending?: ReadonlyArray; + /** Formatted deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Formatted incremental payloads that completed with this response. */ + completed?: ReadonlyArray; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * Incremental payload produced by a deferred fragment. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface IncrementalDeferResult, TExtensions = ObjMap> { + /** Identifier matching this payload to a pending deferred fragment. */ + id: string; + /** Path from the deferred fragment location to this payload. */ + subPath?: ReadonlyArray; + /** Errors raised while executing the deferred fragment. */ + errors?: ReadonlyArray; + /** Data produced by the deferred fragment. */ + data: TDeferredData; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a deferred fragment payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedIncrementalDeferResult, TExtensions = ObjMap> { + /** Formatted errors raised while executing the deferred fragment. */ + errors?: ReadonlyArray; + /** Formatted data produced by the deferred fragment. */ + data: TDeferredData; + /** Identifier matching this payload to a pending deferred fragment. */ + id: string; + /** Path from the deferred fragment location to this payload. */ + subPath?: ReadonlyArray; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * Incremental payload produced by a streamed list field. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface IncrementalStreamResult> { + /** Identifier matching this payload to a pending stream. */ + id: string; + /** Path from the streamed field location to these items. */ + subPath?: ReadonlyArray; + /** Errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Streamed list items delivered by this payload. */ + items: ReadonlyArray; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a streamed list payload. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedIncrementalStreamResult, TExtensions = ObjMap> { + /** Formatted errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Formatted streamed list items delivered by this payload. */ + items: ReadonlyArray; + /** Identifier matching this payload to a pending stream. */ + id: string; + /** Path from the streamed field location to these items. */ + subPath?: ReadonlyArray; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * Deferred fragment or streamed list payload produced by incremental execution. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export type IncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = IncrementalDeferResult | IncrementalStreamResult; +/** + * JSON-serializable deferred fragment or streamed list payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export type FormattedIncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = FormattedIncrementalDeferResult | FormattedIncrementalStreamResult; +/** @internal */ +export interface PendingResult { + id: string; + path: ReadonlyArray; + label?: string; +} +/** @internal */ +export interface CompletedResult { + id: string; + errors?: ReadonlyArray; +} +/** @internal */ +export interface FormattedCompletedResult { + id: string; + errors?: ReadonlyArray; +} +interface ExecutionGroup extends Task { + groups: ReadonlyArray; + path: Path | undefined; + computation: Computation; +} +/** @internal */ +export interface DeliveryGroup extends Group { + path: Path | undefined; + label: string | undefined; + parent: DeliveryGroup | undefined; +} +/** @internal */ +export interface ItemStream extends Stream { + path: Path; + label: string | undefined; + initialCount: number; +} +/** @internal */ +export interface ExecutionGroupValue { + deliveryGroups: ReadonlyArray; + path: ReadonlyArray; + errors?: ReadonlyArray; + data: ObjMap; +} +/** @internal */ +export type IncrementalWork = Work; +/** @internal */ +export interface ExecutionGroupResult { + value: ExecutionGroupValue; + work?: IncrementalWork | undefined; +} +/** @internal */ +export interface StreamItemValue { + errors?: ReadonlyArray; + item: unknown; +} +/** @internal */ +export interface StreamItemResult { + value: StreamItemValue; + work?: IncrementalWork | undefined; +} +/** @internal */ +export declare class IncrementalExecutor extends Executor, TExperimental> { + deferUsageSet?: DeferUsageSet | undefined; + groups: Array; + tasks: Array; + streams: Array; + constructor(validatedExecutionArgs: ValidatedExecutionArgs, sharedExecutionContext?: SharedExecutionContext, deferUsageSet?: DeferUsageSet); + getCreateSubExecutor(): (deferUsageSet?: DeferUsageSet) => IncrementalExecutor; + abort(reason?: unknown): void; + /** + * Given a completed execution context and data, build the `{ errors, data }` + * response defined by the "Response" section of the GraphQL specification. + * + * @internal + */ + buildResponse(data: ObjMap | null): ExecutionResult | TExperimental; + executeCollectedRootFields(rootType: GraphQLObjectType, rootValue: unknown, originalGroupedFieldSet: GroupedFieldSet, serially: boolean, newDeferUsages: ReadonlyArray): PromiseOrValue>; + buildRootExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; + executeCollectedSubfields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, originalGroupedFieldSet: GroupedFieldSet, newDeferUsages: ReadonlyArray, deliveryGroupMap: ReadonlyMap | undefined): PromiseOrValue>; + buildSubExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; + collectExecutionGroups(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, newGroupedFieldSets: Map, deliveryGroupMap: ReadonlyMap): void; + executeExecutionGroup(deliveryGroups: ReadonlyArray, parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, groupedFieldSet: GroupedFieldSet, deliveryGroupMap: ReadonlyMap): PromiseOrValue; + buildExecutionGroupResult(deliveryGroups: ReadonlyArray, path: Path | undefined, result: ObjMap): ExecutionGroupResult; + getIncrementalWork(): IncrementalWork; + /** + * Instantiates new DeliveryGroups for the given path, returning an + * updated map of DeferUsage objects to DeliveryGroups. + * + * Note: As defer directives may be used with operations returning lists, + * a DeferUsage object may correspond to many DeliveryGroups. + * + * @internal + */ + getNewDeliveryGroupMap(newDeferUsages: ReadonlyArray, deliveryGroupMap: ReadonlyMap | undefined, path: Path | undefined): { + newDeliveryGroups: ReadonlyArray; + newDeliveryGroupMap: ReadonlyMap; + }; + shouldDefer(parentDeferUsages: undefined | DeferUsageSet, deferUsages: DeferUsageSet): boolean; + handleStream(index: number, path: Path, iterator: { + handle: Iterator; + isAsync?: never; + } | { + handle: AsyncIterator; + isAsync: true; + }, streamUsage: StreamUsage, info: GraphQLResolveInfo, itemType: GraphQLOutputType): boolean; + buildStreamItemQueue(initialIndex: number, streamPath: Path, iterator: Iterator | AsyncIterator, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemType: GraphQLOutputType, isAsync: boolean | undefined): Queue; + completeStreamItem(itemPath: Path, item: unknown, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemType: GraphQLOutputType): PromiseOrValue; + buildStreamItemResult(result: unknown): StreamItemResult; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.ts new file mode 100644 index 00000000..d041b7bc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.d.ts @@ -0,0 +1,297 @@ +/** @category Incremental Execution */ +import type { ObjMap } from "../../jsutils/ObjMap.js"; +import type { Path } from "../../jsutils/Path.js"; +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.js"; +import type { GraphQLError, GraphQLFormattedError } from "../../error/GraphQLError.js"; +import type { GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo } from "../../type/definition.js"; +import type { DeferUsage, FieldDetailsList, GroupedFieldSet } from "../collectFields.js"; +import type { SharedExecutionContext } from "../createSharedExecutionContext.js"; +import type { ValidatedExecutionArgs } from "../ExecutionArgs.js"; +import type { ExecutionResult, FormattedExecutionResult } from "../Executor.js"; +import { Executor } from "../Executor.js"; +import type { StreamUsage } from "../getStreamUsage.js"; +import type { DeferUsageSet, ExecutionPlan } from "./buildExecutionPlan.js"; +import { Computation } from "./Computation.js"; +import { Queue } from "./Queue.js"; +import type { Group, Stream, Task, Work } from "./WorkQueue.js"; +/** + * Results for an operation that produced incremental payloads. + * @typeParam TInitialData - Shape of the initial result data payload. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface ExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Initial execution result delivered before subsequent incremental payloads. */ + initialResult: InitialIncrementalExecutionResult; + /** Async stream of incremental payloads delivered after the initial result. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * JSON-serializable form of incremental execution results. + * @typeParam TInitial - Shape of the formatted initial result data payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Formatted initial execution result. */ + initialResult: FormattedInitialIncrementalExecutionResult; + /** Async stream of formatted incremental payloads. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * Initial execution result for an operation that produced incremental payloads. + * @typeParam TData - Shape of the initial data payload. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface InitialIncrementalExecutionResult, TExtensions = ObjMap> extends ExecutionResult { + /** Data produced by the initial execution payload. */ + data: TData; + /** Incremental payloads that are still pending after the initial result. */ + pending: ReadonlyArray; + /** Indicates that subsequent incremental payloads will follow. */ + hasNext: true; + /** Additional non-standard metadata included in the initial result. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of an initial incremental execution result. + * @typeParam TInitialData - Shape of the formatted initial data payload. + * @typeParam TExtensions - Shape of the formatted extensions payload. + */ +export interface FormattedInitialIncrementalExecutionResult, TExtensions = ObjMap> extends FormattedExecutionResult { + /** Formatted data produced by the initial execution payload. */ + data: TInitialData; + /** Formatted list of incremental payloads still pending after the initial result. */ + pending: ReadonlyArray; + /** Indicates whether subsequent incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in the formatted initial result. */ + extensions?: TExtensions; +} +/** + * Subsequent payload produced by incremental execution. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface SubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Incremental payloads that became pending with this response. */ + pending?: ReadonlyArray; + /** Deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Incremental payloads that completed with this response. */ + completed?: ReadonlyArray; + /** Indicates whether more incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a subsequent incremental execution payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedSubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Indicates whether more incremental payloads will follow. */ + hasNext: boolean; + /** Formatted incremental payloads that became pending with this response. */ + pending?: ReadonlyArray; + /** Formatted deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Formatted incremental payloads that completed with this response. */ + completed?: ReadonlyArray; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * Incremental payload produced by a deferred fragment. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface IncrementalDeferResult, TExtensions = ObjMap> { + /** Identifier matching this payload to a pending deferred fragment. */ + id: string; + /** Path from the deferred fragment location to this payload. */ + subPath?: ReadonlyArray; + /** Errors raised while executing the deferred fragment. */ + errors?: ReadonlyArray; + /** Data produced by the deferred fragment. */ + data: TDeferredData; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a deferred fragment payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedIncrementalDeferResult, TExtensions = ObjMap> { + /** Formatted errors raised while executing the deferred fragment. */ + errors?: ReadonlyArray; + /** Formatted data produced by the deferred fragment. */ + data: TDeferredData; + /** Identifier matching this payload to a pending deferred fragment. */ + id: string; + /** Path from the deferred fragment location to this payload. */ + subPath?: ReadonlyArray; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * Incremental payload produced by a streamed list field. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface IncrementalStreamResult> { + /** Identifier matching this payload to a pending stream. */ + id: string; + /** Path from the streamed field location to these items. */ + subPath?: ReadonlyArray; + /** Errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Streamed list items delivered by this payload. */ + items: ReadonlyArray; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a streamed list payload. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedIncrementalStreamResult, TExtensions = ObjMap> { + /** Formatted errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Formatted streamed list items delivered by this payload. */ + items: ReadonlyArray; + /** Identifier matching this payload to a pending stream. */ + id: string; + /** Path from the streamed field location to these items. */ + subPath?: ReadonlyArray; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * Deferred fragment or streamed list payload produced by incremental execution. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export type IncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = IncrementalDeferResult | IncrementalStreamResult; +/** + * JSON-serializable deferred fragment or streamed list payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export type FormattedIncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = FormattedIncrementalDeferResult | FormattedIncrementalStreamResult; +/** @internal */ +export interface PendingResult { + id: string; + path: ReadonlyArray; + label?: string; +} +/** @internal */ +export interface CompletedResult { + id: string; + errors?: ReadonlyArray; +} +/** @internal */ +export interface FormattedCompletedResult { + id: string; + errors?: ReadonlyArray; +} +interface ExecutionGroup extends Task { + groups: ReadonlyArray; + path: Path | undefined; + computation: Computation; +} +/** @internal */ +export interface DeliveryGroup extends Group { + path: Path | undefined; + label: string | undefined; + parent: DeliveryGroup | undefined; +} +/** @internal */ +export interface ItemStream extends Stream { + path: Path; + label: string | undefined; + initialCount: number; +} +/** @internal */ +export interface ExecutionGroupValue { + deliveryGroups: ReadonlyArray; + path: ReadonlyArray; + errors?: ReadonlyArray; + data: ObjMap; +} +/** @internal */ +export type IncrementalWork = Work; +/** @internal */ +export interface ExecutionGroupResult { + value: ExecutionGroupValue; + work?: IncrementalWork | undefined; +} +/** @internal */ +export interface StreamItemValue { + errors?: ReadonlyArray; + item: unknown; +} +/** @internal */ +export interface StreamItemResult { + value: StreamItemValue; + work?: IncrementalWork | undefined; +} +/** @internal */ +export declare class IncrementalExecutor extends Executor, TExperimental> { + deferUsageSet?: DeferUsageSet | undefined; + groups: Array; + tasks: Array; + streams: Array; + constructor(validatedExecutionArgs: ValidatedExecutionArgs, sharedExecutionContext?: SharedExecutionContext, deferUsageSet?: DeferUsageSet); + getCreateSubExecutor(): (deferUsageSet?: DeferUsageSet) => IncrementalExecutor; + abort(reason?: unknown): void; + /** + * Given a completed execution context and data, build the `{ errors, data }` + * response defined by the "Response" section of the GraphQL specification. + * + * @internal + */ + buildResponse(data: ObjMap | null): ExecutionResult | TExperimental; + executeCollectedRootFields(rootType: GraphQLObjectType, rootValue: unknown, originalGroupedFieldSet: GroupedFieldSet, serially: boolean, newDeferUsages: ReadonlyArray): PromiseOrValue>; + buildRootExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; + executeCollectedSubfields(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, originalGroupedFieldSet: GroupedFieldSet, newDeferUsages: ReadonlyArray, deliveryGroupMap: ReadonlyMap | undefined): PromiseOrValue>; + buildSubExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; + collectExecutionGroups(parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, newGroupedFieldSets: Map, deliveryGroupMap: ReadonlyMap): void; + executeExecutionGroup(deliveryGroups: ReadonlyArray, parentType: GraphQLObjectType, sourceValue: unknown, path: Path | undefined, groupedFieldSet: GroupedFieldSet, deliveryGroupMap: ReadonlyMap): PromiseOrValue; + buildExecutionGroupResult(deliveryGroups: ReadonlyArray, path: Path | undefined, result: ObjMap): ExecutionGroupResult; + getIncrementalWork(): IncrementalWork; + /** + * Instantiates new DeliveryGroups for the given path, returning an + * updated map of DeferUsage objects to DeliveryGroups. + * + * Note: As defer directives may be used with operations returning lists, + * a DeferUsage object may correspond to many DeliveryGroups. + * + * @internal + */ + getNewDeliveryGroupMap(newDeferUsages: ReadonlyArray, deliveryGroupMap: ReadonlyMap | undefined, path: Path | undefined): { + newDeliveryGroups: ReadonlyArray; + newDeliveryGroupMap: ReadonlyMap; + }; + shouldDefer(parentDeferUsages: undefined | DeferUsageSet, deferUsages: DeferUsageSet): boolean; + handleStream(index: number, path: Path, iterator: { + handle: Iterator; + isAsync?: never; + } | { + handle: AsyncIterator; + isAsync: true; + }, streamUsage: StreamUsage, info: GraphQLResolveInfo, itemType: GraphQLOutputType): boolean; + buildStreamItemQueue(initialIndex: number, streamPath: Path, iterator: Iterator | AsyncIterator, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemType: GraphQLOutputType, isAsync: boolean | undefined): Queue; + completeStreamItem(itemPath: Path, item: unknown, fieldDetailsList: FieldDetailsList, info: GraphQLResolveInfo, itemType: GraphQLOutputType): PromiseOrValue; + buildStreamItemResult(result: unknown): StreamItemResult; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js new file mode 100644 index 00000000..8e0954c5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js @@ -0,0 +1,360 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IncrementalExecutor = void 0; +const invariant_ts_1 = require("../../jsutils/invariant.js"); +const isPromise_ts_1 = require("../../jsutils/isPromise.js"); +const memoize1_ts_1 = require("../../jsutils/memoize1.js"); +const memoize2_ts_1 = require("../../jsutils/memoize2.js"); +const Path_ts_1 = require("../../jsutils/Path.js"); +const locatedError_ts_1 = require("../../error/locatedError.js"); +const ast_ts_1 = require("../../language/ast.js"); +const collectFields_ts_1 = require("../collectFields.js"); +const collectIteratorPromises_ts_1 = require("../collectIteratorPromises.js"); +const Executor_ts_1 = require("../Executor.js"); +const returnIteratorCatchingErrors_ts_1 = require("../returnIteratorCatchingErrors.js"); +const buildExecutionPlan_ts_1 = require("./buildExecutionPlan.js"); +const Computation_ts_1 = require("./Computation.js"); +const IncrementalPublisher_ts_1 = require("./IncrementalPublisher.js"); +const Queue_ts_1 = require("./Queue.js"); +const buildExecutionPlanFromInitial = (0, memoize1_ts_1.memoize1)((groupedFieldSet) => (0, buildExecutionPlan_ts_1.buildExecutionPlan)(groupedFieldSet)); +const buildExecutionPlanFromDeferred = (0, memoize2_ts_1.memoize2)((groupedFieldSet, deferUsageSet) => (0, buildExecutionPlan_ts_1.buildExecutionPlan)(groupedFieldSet, deferUsageSet)); +class IncrementalExecutor extends Executor_ts_1.Executor { + constructor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet) { + super(validatedExecutionArgs, sharedExecutionContext); + this.deferUsageSet = deferUsageSet; + this.groups = []; + this.tasks = []; + this.streams = []; + } + getCreateSubExecutor() { + const validatedExecutionArgs = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + return (deferUsageSet) => new IncrementalExecutor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet); + } + abort(reason) { + super.abort(reason); + for (const task of this.tasks) { + const aborted = task.computation.abort(reason); + if (!(!(0, isPromise_ts_1.isPromise)(aborted))) + (0, invariant_ts_1.invariant)(false); + } + for (const stream of this.streams) { + const aborted = stream.queue.abort(reason); + if (!(!(0, isPromise_ts_1.isPromise)(aborted))) + (0, invariant_ts_1.invariant)(false); + } + } + buildResponse(data) { + const work = this.getIncrementalWork(); + const { tasks, streams } = work; + if (tasks?.length === 0 && streams?.length === 0) { + return super.buildResponse(data); + } + const errors = this.collectedErrors.errors; + if (!(data !== null)) + (0, invariant_ts_1.invariant)(false); + const incrementalPublisher = new IncrementalPublisher_ts_1.IncrementalPublisher(); + return incrementalPublisher.buildResponse(data, errors, work, this.validatedExecutionArgs.externalAbortSignal, this.getFinishSharedExecution()); + } + executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, newDeferUsages) { + if (newDeferUsages.length === 0) { + return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, undefined); + } + if (!(this.validatedExecutionArgs.operation.operation !== + ast_ts_1.OperationTypeNode.SUBSCRIPTION)) + (0, invariant_ts_1.invariant)(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + const { newDeliveryGroups, newDeliveryGroupMap } = this.getNewDeliveryGroupMap(newDeferUsages, undefined, undefined); + const { groupedFieldSet, newGroupedFieldSets } = this.buildRootExecutionPlan(originalGroupedFieldSet); + const data = this.executeRootGroupedFieldSet(rootType, rootValue, groupedFieldSet, serially, newDeliveryGroupMap); + this.groups.push(...newDeliveryGroups); + if (newGroupedFieldSets.size > 0) { + this.collectExecutionGroups(rootType, rootValue, undefined, newGroupedFieldSets, newDeliveryGroupMap); + } + return data; + } + buildRootExecutionPlan(originalGroupedFieldSet) { + return buildExecutionPlanFromInitial(originalGroupedFieldSet); + } + executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, newDeferUsages, deliveryGroupMap) { + if (newDeferUsages.length > 0) { + if (!(this.validatedExecutionArgs.operation.operation !== + ast_ts_1.OperationTypeNode.SUBSCRIPTION)) + (0, invariant_ts_1.invariant)(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + } + if (deliveryGroupMap === undefined && newDeferUsages.length === 0) { + return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, deliveryGroupMap); + } + const { newDeliveryGroups, newDeliveryGroupMap } = this.getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path); + const { groupedFieldSet, newGroupedFieldSets } = this.buildSubExecutionPlan(originalGroupedFieldSet); + const data = this.executeFields(parentType, sourceValue, path, groupedFieldSet, newDeliveryGroupMap); + this.groups.push(...newDeliveryGroups); + if (newGroupedFieldSets.size > 0) { + this.collectExecutionGroups(parentType, sourceValue, path, newGroupedFieldSets, newDeliveryGroupMap); + } + return data; + } + buildSubExecutionPlan(originalGroupedFieldSet) { + return this.deferUsageSet === undefined + ? buildExecutionPlanFromInitial(originalGroupedFieldSet) + : buildExecutionPlanFromDeferred(originalGroupedFieldSet, this.deferUsageSet); + } + collectExecutionGroups(parentType, sourceValue, path, newGroupedFieldSets, deliveryGroupMap) { + const createSubExecutor = this.getCreateSubExecutor(); + for (const [deferUsageSet, groupedFieldSet] of newGroupedFieldSets) { + const deliveryGroups = getDeliveryGroups(deferUsageSet, deliveryGroupMap); + const executor = createSubExecutor(deferUsageSet); + const executionGroup = { + groups: deliveryGroups, + path, + computation: new Computation_ts_1.Computation(() => executor.executeExecutionGroup(deliveryGroups, parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap), (reason) => executor.abort(reason)), + }; + const parentDeferUsages = this.deferUsageSet; + if (this.validatedExecutionArgs.enableEarlyExecution) { + if (this.shouldDefer(parentDeferUsages, deferUsageSet)) { + Promise.resolve().then(() => executionGroup.computation.prime()); + } + else { + executionGroup.computation.prime(); + } + } + this.tasks.push(executionGroup); + } + } + executeExecutionGroup(deliveryGroups, parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap) { + let result; + try { + result = this.executeFields(parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap); + } + catch (error) { + this.abort(); + throw error; + } + if ((0, isPromise_ts_1.isPromise)(result)) { + return result.then((resolved) => this.buildExecutionGroupResult(deliveryGroups, path, resolved), (error) => { + this.abort(); + throw error; + }); + } + return this.buildExecutionGroupResult(deliveryGroups, path, result); + } + buildExecutionGroupResult(deliveryGroups, path, result) { + const data = result; + const errors = this.collectedErrors.errors; + return this.finish({ + value: errors.length + ? { deliveryGroups, path: (0, Path_ts_1.pathToArray)(path), errors, data } + : { deliveryGroups, path: (0, Path_ts_1.pathToArray)(path), data }, + work: this.getIncrementalWork(), + }); + } + getIncrementalWork() { + const { groups, tasks, streams, collectedErrors } = this; + if (collectedErrors.errors.length === 0) { + return { groups, tasks, streams }; + } + const cancellationReason = new Error('Cancelled secondary to null within original result'); + const filteredTasks = []; + for (const task of tasks) { + if (collectedErrors.hasNulledPosition(task.path)) { + const aborted = task.computation.abort(cancellationReason); + if (!(!(0, isPromise_ts_1.isPromise)(aborted))) + (0, invariant_ts_1.invariant)(false); + } + else { + filteredTasks.push(task); + } + } + const filteredStreams = []; + for (const stream of streams) { + if (collectedErrors.hasNulledPosition(stream.path)) { + const aborted = stream.queue.abort(cancellationReason); + if (!(!(0, isPromise_ts_1.isPromise)(aborted))) + (0, invariant_ts_1.invariant)(false); + } + else { + filteredStreams.push(stream); + } + } + return { + groups, + tasks: filteredTasks, + streams: filteredStreams, + }; + } + getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path) { + const newDeliveryGroups = []; + const newDeliveryGroupMap = new Map(deliveryGroupMap); + for (const newDeferUsage of newDeferUsages) { + const parentDeferUsage = newDeferUsage.parentDeferUsage; + const parent = parentDeferUsage === undefined + ? undefined + : deliveryGroupFromDeferUsage(parentDeferUsage, newDeliveryGroupMap); + const deliveryGroup = { + path, + label: newDeferUsage.label, + parent, + }; + newDeliveryGroups.push(deliveryGroup); + newDeliveryGroupMap.set(newDeferUsage, deliveryGroup); + } + return { + newDeliveryGroups, + newDeliveryGroupMap, + }; + } + shouldDefer(parentDeferUsages, deferUsages) { + return (parentDeferUsages === undefined || + !Array.from(deferUsages).every((deferUsage) => parentDeferUsages.has(deferUsage))); + } + handleStream(index, path, iterator, streamUsage, info, itemType) { + const { handle, isAsync } = iterator; + const queue = this.buildStreamItemQueue(index, path, handle, streamUsage.fieldDetailsList, info, itemType, isAsync); + const itemStream = { + label: streamUsage.label, + path, + queue, + initialCount: index, + }; + this.streams.push(itemStream); + return true; + } + buildStreamItemQueue(initialIndex, streamPath, iterator, fieldDetailsList, info, itemType, isAsync) { + const createSubExecutor = this.getCreateSubExecutor(); + const { enableEarlyExecution } = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + const queue = new Queue_ts_1.Queue(async ({ push, stop, onStop, started }) => { + const abortStreamItems = new Set(); + let finishedNormally = false; + let stopRequested = false; + onStop((reason) => { + stopRequested = true; + if (!finishedNormally) { + for (const abortStreamItem of abortStreamItems) { + abortStreamItem(reason); + } + if (isAsync) { + sharedExecutionContext.asyncWorkTracker.add((0, returnIteratorCatchingErrors_ts_1.returnIteratorCatchingErrors)(iterator)); + } + else { + sharedExecutionContext.asyncWorkTracker.addValues((0, collectIteratorPromises_ts_1.collectIteratorPromises)(iterator)); + } + } + }); + await (enableEarlyExecution ? Promise.resolve() : started); + if (stopRequested) { + return; + } + let index = initialIndex; + while (true) { + let iteration; + try { + if (isAsync) { + iteration = await iterator.next(); + if (stopRequested) { + return; + } + } + else { + iteration = iterator.next(); + } + } + catch (rawError) { + throw (0, locatedError_ts_1.locatedError)(rawError, toNodes(fieldDetailsList), (0, Path_ts_1.pathToArray)(streamPath)); + } + if (iteration.done) { + finishedNormally = true; + const stopped = stop(); + if ((0, isPromise_ts_1.isPromise)(stopped)) { + stopped.catch(() => undefined); + } + return; + } + const itemPath = (0, Path_ts_1.addPath)(streamPath, index, undefined); + const executor = createSubExecutor(); + let streamItemResult = executor.completeStreamItem(itemPath, iteration.value, fieldDetailsList, info, itemType); + if ((0, isPromise_ts_1.isPromise)(streamItemResult)) { + if (enableEarlyExecution) { + const abortStreamItem = (reason) => executor.abort(reason); + abortStreamItems.add(abortStreamItem); + streamItemResult = streamItemResult.finally(() => { + abortStreamItems.delete(abortStreamItem); + }); + } + else { + streamItemResult = await streamItemResult; + if (stopRequested) { + return; + } + } + } + const pushResult = push(streamItemResult); + if ((0, isPromise_ts_1.isPromise)(pushResult)) { + await pushResult; + if (stopRequested) { + return; + } + } + index += 1; + } + }, 100); + return queue; + } + completeStreamItem(itemPath, item, fieldDetailsList, info, itemType) { + if ((0, isPromise_ts_1.isPromiseLike)(item)) { + return this.completePromisedValue(itemType, fieldDetailsList, info, itemPath, item, undefined) + .then((resolvedItem) => this.buildStreamItemResult(resolvedItem), (rawError) => { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return this.buildStreamItemResult(null); + }) + .then(undefined, (error) => { + this.abort(); + throw error; + }); + } + let result; + try { + try { + result = this.completeValue(itemType, fieldDetailsList, info, itemPath, item, undefined); + } + catch (rawError) { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return this.buildStreamItemResult(null); + } + } + catch (error) { + this.abort(); + throw error; + } + if ((0, isPromise_ts_1.isPromise)(result)) { + return result + .then((resolved) => this.buildStreamItemResult(resolved), (rawError) => { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return this.buildStreamItemResult(null); + }) + .then(undefined, (error) => { + this.abort(); + throw error; + }); + } + return this.buildStreamItemResult(result); + } + buildStreamItemResult(result) { + const item = result; + const errors = this.collectedErrors.errors; + const work = this.getIncrementalWork(); + return this.finish(errors.length > 0 + ? { value: { item, errors }, work } + : { value: { item }, work }); + } +} +exports.IncrementalExecutor = IncrementalExecutor; +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +function getDeliveryGroups(deferUsageSet, deliveryGroupMap) { + return Array.from(deferUsageSet).map((deferUsage) => deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap)); +} +function deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap) { + return deliveryGroupMap.get(deferUsage); +} +//# sourceMappingURL=IncrementalExecutor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js.map new file mode 100644 index 00000000..a1e68e3f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IncrementalExecutor.js","sourceRoot":"","sources":["../../../src/execution/incremental/IncrementalExecutor.ts"],"names":[],"mappings":";;;AAGA,6DAAuD;AACvD,6DAAsE;AACtE,2DAAqD;AACrD,2DAAqD;AAGrD,mDAA6D;AAO7D,iEAA2D;AAG3D,kDAA0D;AAa1D,0DAA4E;AAC5E,8EAAwE;AAIxE,gDAA0C;AAE1C,wFAAkF;AAGlF,mEAA6D;AAC7D,qDAA+C;AAC/C,uEAAiE;AACjE,yCAAmC;AAGnC,MAAM,6BAA6B,GAAG,IAAA,sBAAQ,EAC5C,CAAC,eAAgC,EAAE,EAAE,CAAC,IAAA,0CAAkB,EAAC,eAAe,CAAC,CAC1E,CAAC;AAEF,MAAM,8BAA8B,GAAG,IAAA,sBAAQ,EAC7C,CAAC,eAAgC,EAAE,aAA4B,EAAE,EAAE,CACjE,IAAA,0CAAkB,EAAC,eAAe,EAAE,aAAa,CAAC,CACrD,CAAC;AAsVF,MAAa,mBAEX,SAAQ,sBAA+D;IAMvE,YACE,sBAA8C,EAC9C,sBAA+C,EAC/C,aAA6B;QAE7B,KAAK,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;QACtD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,oBAAoB;QAGlB,MAAM,sBAAsB,GAAG,IAA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I,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,qBAAqB,CAAC,MAAe;QACnC,MAAM,IAAI,GAAG,MAAM,CAAC;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC,MAAM,CAChB,MAAM,CAAC,MAAM,GAAG,CAAC;YACf,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE;YACnC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAC9B,CAAC;IACJ,CAAC;CACF;AAznBD,kDAynBC;AAED,SAAS,OAAO,CAAC,gBAAkC;IACjD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,iBAAiB,CACxB,aAA4B,EAC5B,gBAAwD;IAExD,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAClD,2BAA2B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAClC,UAAsB,EACtB,gBAAwD;IAGxD,OAAO,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;AAC3C,CAAC","sourcesContent":["/** @category Incremental Execution */\n\n/* eslint-disable max-params */\nimport { invariant } from '../../jsutils/invariant.ts';\nimport { isPromise, isPromiseLike } from '../../jsutils/isPromise.ts';\nimport { memoize1 } from '../../jsutils/memoize1.ts';\nimport { memoize2 } from '../../jsutils/memoize2.ts';\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\nimport type { Path } from '../../jsutils/Path.ts';\nimport { addPath, pathToArray } from '../../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\nimport type {\n GraphQLError,\n GraphQLFormattedError,\n} from '../../error/GraphQLError.ts';\nimport { locatedError } from '../../error/locatedError.ts';\n\nimport type { FieldNode } from '../../language/ast.ts';\nimport { OperationTypeNode } from '../../language/ast.ts';\n\nimport type {\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n} from '../../type/definition.ts';\n\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from '../collectFields.ts';\nimport { collectSubfields as _collectSubfields } from '../collectFields.ts';\nimport { collectIteratorPromises } from '../collectIteratorPromises.ts';\nimport type { SharedExecutionContext } from '../createSharedExecutionContext.ts';\nimport type { ValidatedExecutionArgs } from '../ExecutionArgs.ts';\nimport type { ExecutionResult, FormattedExecutionResult } from '../Executor.ts';\nimport { Executor } from '../Executor.ts';\nimport type { StreamUsage } from '../getStreamUsage.ts';\nimport { returnIteratorCatchingErrors } from '../returnIteratorCatchingErrors.ts';\n\nimport type { DeferUsageSet, ExecutionPlan } from './buildExecutionPlan.ts';\nimport { buildExecutionPlan } from './buildExecutionPlan.ts';\nimport { Computation } from './Computation.ts';\nimport { IncrementalPublisher } from './IncrementalPublisher.ts';\nimport { Queue } from './Queue.ts';\nimport type { Group, Stream, Task, Work } from './WorkQueue.ts';\n\nconst buildExecutionPlanFromInitial = memoize1(\n (groupedFieldSet: GroupedFieldSet) => buildExecutionPlan(groupedFieldSet),\n);\n\nconst buildExecutionPlanFromDeferred = memoize2(\n (groupedFieldSet: GroupedFieldSet, deferUsageSet: DeferUsageSet) =>\n buildExecutionPlan(groupedFieldSet, deferUsageSet),\n);\n\n/**\n * Results for an operation that produced incremental payloads.\n * @typeParam TInitialData - Shape of the initial result data payload.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface ExperimentalIncrementalExecutionResults<\n TInitialData = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Initial execution result delivered before subsequent incremental payloads. */\n initialResult: InitialIncrementalExecutionResult;\n /** Async stream of incremental payloads delivered after the initial result. */\n subsequentResults: AsyncGenerator<\n SubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n\n/**\n * JSON-serializable form of incremental execution results.\n * @typeParam TInitial - Shape of the formatted initial result data payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedExperimentalIncrementalExecutionResults<\n TInitial = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted initial execution result. */\n initialResult: FormattedInitialIncrementalExecutionResult<\n TInitial,\n TExtensions\n >;\n /** Async stream of formatted incremental payloads. */\n subsequentResults: AsyncGenerator<\n FormattedSubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n/**\n * Initial execution result for an operation that produced incremental payloads.\n * @typeParam TData - Shape of the initial data payload.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface InitialIncrementalExecutionResult<\n TData = ObjMap,\n TExtensions = ObjMap,\n> extends ExecutionResult {\n /** Data produced by the initial execution payload. */\n data: TData;\n /** Incremental payloads that are still pending after the initial result. */\n pending: ReadonlyArray;\n /** Indicates that subsequent incremental payloads will follow. */\n hasNext: true;\n /** Additional non-standard metadata included in the initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of an initial incremental execution result.\n * @typeParam TInitialData - Shape of the formatted initial data payload.\n * @typeParam TExtensions - Shape of the formatted extensions payload.\n */\nexport interface FormattedInitialIncrementalExecutionResult<\n TInitialData = ObjMap,\n TExtensions = ObjMap,\n> extends FormattedExecutionResult {\n /** Formatted data produced by the initial execution payload. */\n data: TInitialData;\n /** Formatted list of incremental payloads still pending after the initial result. */\n pending: ReadonlyArray;\n /** Indicates whether subsequent incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in the formatted initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * Subsequent payload produced by incremental execution.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface SubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Incremental payloads that became pending with this response. */\n pending?: ReadonlyArray;\n /** Deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n IncrementalResult\n >;\n /** Incremental payloads that completed with this response. */\n completed?: ReadonlyArray;\n /** Indicates whether more incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a subsequent incremental execution payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedSubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Indicates whether more incremental payloads will follow. */\n hasNext: boolean;\n /** Formatted incremental payloads that became pending with this response. */\n pending?: ReadonlyArray;\n /** Formatted deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n FormattedIncrementalResult\n >;\n /** Formatted incremental payloads that completed with this response. */\n completed?: ReadonlyArray;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Incremental payload produced by a deferred fragment.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface IncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Identifier matching this payload to a pending deferred fragment. */\n id: string;\n /** Path from the deferred fragment location to this payload. */\n subPath?: ReadonlyArray;\n /** Errors raised while executing the deferred fragment. */\n errors?: ReadonlyArray;\n /** Data produced by the deferred fragment. */\n data: TDeferredData;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a deferred fragment payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedIncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Formatted errors raised while executing the deferred fragment. */\n errors?: ReadonlyArray;\n /** Formatted data produced by the deferred fragment. */\n data: TDeferredData;\n /** Identifier matching this payload to a pending deferred fragment. */\n id: string;\n /** Path from the deferred fragment location to this payload. */\n subPath?: ReadonlyArray;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Incremental payload produced by a streamed list field.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface IncrementalStreamResult<\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Identifier matching this payload to a pending stream. */\n id: string;\n /** Path from the streamed field location to these items. */\n subPath?: ReadonlyArray;\n /** Errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Streamed list items delivered by this payload. */\n items: ReadonlyArray;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a streamed list payload.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedIncrementalStreamResult<\n TStreamItem = Array,\n TExtensions = ObjMap,\n> {\n /** Formatted errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Formatted streamed list items delivered by this payload. */\n items: ReadonlyArray;\n /** Identifier matching this payload to a pending stream. */\n id: string;\n /** Path from the streamed field location to these items. */\n subPath?: ReadonlyArray;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Deferred fragment or streamed list payload produced by incremental execution.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport type IncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | IncrementalDeferResult\n | IncrementalStreamResult;\n\n/**\n * JSON-serializable deferred fragment or streamed list payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport type FormattedIncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | FormattedIncrementalDeferResult\n | FormattedIncrementalStreamResult;\n\n/** @internal */\nexport interface PendingResult {\n id: string;\n path: ReadonlyArray;\n label?: string;\n}\n\n/** @internal */\nexport interface CompletedResult {\n id: string;\n errors?: ReadonlyArray;\n}\n\n/** @internal */\nexport interface FormattedCompletedResult {\n id: string;\n errors?: ReadonlyArray;\n}\n\ninterface ExecutionGroup extends Task<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n> {\n groups: ReadonlyArray;\n path: Path | undefined;\n computation: Computation;\n}\n\n/** @internal */\nexport interface DeliveryGroup extends Group {\n path: Path | undefined;\n label: string | undefined;\n parent: DeliveryGroup | undefined;\n}\n\n/** @internal */\nexport interface ItemStream extends Stream<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n> {\n path: Path;\n label: string | undefined;\n initialCount: number;\n}\n\n/** @internal */\nexport interface ExecutionGroupValue {\n deliveryGroups: ReadonlyArray;\n path: ReadonlyArray;\n errors?: ReadonlyArray;\n data: ObjMap;\n}\n\n/** @internal */\nexport type IncrementalWork = Work<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n>;\n\n/** @internal */\nexport interface ExecutionGroupResult {\n value: ExecutionGroupValue;\n work?: IncrementalWork | undefined;\n}\n\n/** @internal */\nexport interface StreamItemValue {\n errors?: ReadonlyArray;\n item: unknown;\n}\n\n/** @internal */\nexport interface StreamItemResult {\n value: StreamItemValue;\n work?: IncrementalWork | undefined;\n}\n\n/** @internal */\nexport class IncrementalExecutor<\n TExperimental = ExperimentalIncrementalExecutionResults,\n> extends Executor, TExperimental> {\n deferUsageSet?: DeferUsageSet | undefined;\n groups: Array;\n tasks: Array;\n streams: Array;\n\n constructor(\n validatedExecutionArgs: ValidatedExecutionArgs,\n sharedExecutionContext?: SharedExecutionContext,\n deferUsageSet?: DeferUsageSet,\n ) {\n super(validatedExecutionArgs, sharedExecutionContext);\n this.deferUsageSet = deferUsageSet;\n this.groups = [];\n this.tasks = [];\n this.streams = [];\n }\n\n getCreateSubExecutor(): (\n deferUsageSet?: DeferUsageSet,\n ) => IncrementalExecutor {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n\n return (deferUsageSet?: DeferUsageSet) =>\n new IncrementalExecutor(\n validatedExecutionArgs,\n sharedExecutionContext,\n deferUsageSet,\n );\n }\n\n override abort(reason?: unknown): void {\n super.abort(reason);\n for (const task of this.tasks) {\n const aborted = task.computation.abort(reason);\n invariant(!isPromise(aborted));\n }\n for (const stream of this.streams) {\n const aborted = stream.queue.abort(reason);\n invariant(!isPromise(aborted));\n }\n }\n\n /**\n * Given a completed execution context and data, build the `{ errors, data }`\n * response defined by the \"Response\" section of the GraphQL specification.\n *\n * @internal\n */\n override buildResponse(\n data: ObjMap | null,\n ): ExecutionResult | TExperimental {\n const work = this.getIncrementalWork();\n const { tasks, streams } = work;\n if (tasks?.length === 0 && streams?.length === 0) {\n return super.buildResponse(data);\n }\n\n const errors = this.collectedErrors.errors;\n invariant(data !== null);\n const incrementalPublisher = new IncrementalPublisher();\n return incrementalPublisher.buildResponse(\n data,\n errors,\n work,\n this.validatedExecutionArgs.externalAbortSignal,\n this.getFinishSharedExecution(),\n ) as TExperimental;\n }\n\n override executeCollectedRootFields(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n originalGroupedFieldSet: GroupedFieldSet,\n serially: boolean,\n newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n if (newDeferUsages.length === 0) {\n return this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n originalGroupedFieldSet,\n serially,\n undefined,\n );\n }\n\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n\n const { newDeliveryGroups, newDeliveryGroupMap } =\n this.getNewDeliveryGroupMap(newDeferUsages, undefined, undefined);\n\n const { groupedFieldSet, newGroupedFieldSets } =\n this.buildRootExecutionPlan(originalGroupedFieldSet);\n\n const data = this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n groupedFieldSet,\n serially,\n newDeliveryGroupMap,\n );\n\n this.groups.push(...newDeliveryGroups);\n\n if (newGroupedFieldSets.size > 0) {\n this.collectExecutionGroups(\n rootType,\n rootValue,\n undefined,\n newGroupedFieldSets,\n newDeliveryGroupMap,\n );\n }\n\n return data;\n }\n\n buildRootExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return buildExecutionPlanFromInitial(originalGroupedFieldSet);\n }\n\n override executeCollectedSubfields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n originalGroupedFieldSet: GroupedFieldSet,\n newDeferUsages: ReadonlyArray,\n deliveryGroupMap: ReadonlyMap | undefined,\n ): PromiseOrValue> {\n if (newDeferUsages.length > 0) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n }\n\n if (deliveryGroupMap === undefined && newDeferUsages.length === 0) {\n return this.executeFields(\n parentType,\n sourceValue,\n path,\n originalGroupedFieldSet,\n deliveryGroupMap,\n );\n }\n\n const { newDeliveryGroups, newDeliveryGroupMap } =\n this.getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path);\n\n const { groupedFieldSet, newGroupedFieldSets } = this.buildSubExecutionPlan(\n originalGroupedFieldSet,\n );\n\n const data = this.executeFields(\n parentType,\n sourceValue,\n path,\n groupedFieldSet,\n newDeliveryGroupMap,\n );\n\n this.groups.push(...newDeliveryGroups);\n\n if (newGroupedFieldSets.size > 0) {\n this.collectExecutionGroups(\n parentType,\n sourceValue,\n path,\n newGroupedFieldSets,\n newDeliveryGroupMap,\n );\n }\n\n return data;\n }\n\n buildSubExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return this.deferUsageSet === undefined\n ? buildExecutionPlanFromInitial(originalGroupedFieldSet)\n : buildExecutionPlanFromDeferred(\n originalGroupedFieldSet,\n this.deferUsageSet,\n );\n }\n\n collectExecutionGroups(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n newGroupedFieldSets: Map,\n deliveryGroupMap: ReadonlyMap,\n ): void {\n const createSubExecutor = this.getCreateSubExecutor();\n for (const [deferUsageSet, groupedFieldSet] of newGroupedFieldSets) {\n const deliveryGroups = getDeliveryGroups(deferUsageSet, deliveryGroupMap);\n\n const executor = createSubExecutor(deferUsageSet);\n\n const executionGroup: ExecutionGroup = {\n groups: deliveryGroups,\n path,\n computation: new Computation(\n () =>\n executor.executeExecutionGroup(\n deliveryGroups,\n parentType,\n sourceValue,\n path,\n groupedFieldSet,\n deliveryGroupMap,\n ),\n (reason) => executor.abort(reason),\n ),\n };\n\n const parentDeferUsages = this.deferUsageSet;\n\n if (this.validatedExecutionArgs.enableEarlyExecution) {\n if (this.shouldDefer(parentDeferUsages, deferUsageSet)) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve().then(() => executionGroup.computation.prime());\n } else {\n executionGroup.computation.prime();\n }\n }\n\n this.tasks.push(executionGroup);\n }\n }\n\n executeExecutionGroup(\n deliveryGroups: ReadonlyArray,\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n groupedFieldSet: GroupedFieldSet,\n deliveryGroupMap: ReadonlyMap,\n ): PromiseOrValue {\n let result;\n try {\n result = this.executeFields(\n parentType,\n sourceValue,\n path,\n groupedFieldSet,\n deliveryGroupMap,\n );\n } catch (error) {\n this.abort();\n throw error;\n }\n\n if (isPromise(result)) {\n return result.then(\n (resolved) =>\n this.buildExecutionGroupResult(deliveryGroups, path, resolved),\n (error: unknown) => {\n this.abort();\n throw error;\n },\n );\n }\n\n return this.buildExecutionGroupResult(deliveryGroups, path, result);\n }\n\n buildExecutionGroupResult(\n deliveryGroups: ReadonlyArray,\n path: Path | undefined,\n result: ObjMap,\n ): ExecutionGroupResult {\n const data = result;\n const errors = this.collectedErrors.errors;\n return this.finish({\n value: errors.length\n ? { deliveryGroups, path: pathToArray(path), errors, data }\n : { deliveryGroups, path: pathToArray(path), data },\n work: this.getIncrementalWork(),\n });\n }\n\n getIncrementalWork(): IncrementalWork {\n const { groups, tasks, streams, collectedErrors } = this;\n\n if (collectedErrors.errors.length === 0) {\n return { groups, tasks, streams };\n }\n\n const cancellationReason = new Error(\n 'Cancelled secondary to null within original result',\n );\n\n const filteredTasks: Array = [];\n for (const task of tasks) {\n if (collectedErrors.hasNulledPosition(task.path)) {\n const aborted = task.computation.abort(cancellationReason);\n invariant(!isPromise(aborted));\n } else {\n filteredTasks.push(task);\n }\n }\n\n const filteredStreams: Array = [];\n for (const stream of streams) {\n if (collectedErrors.hasNulledPosition(stream.path)) {\n const aborted = stream.queue.abort(cancellationReason);\n invariant(!isPromise(aborted));\n } else {\n filteredStreams.push(stream);\n }\n }\n\n return {\n groups,\n tasks: filteredTasks,\n streams: filteredStreams,\n };\n }\n\n /**\n * Instantiates new DeliveryGroups for the given path, returning an\n * updated map of DeferUsage objects to DeliveryGroups.\n *\n * Note: As defer directives may be used with operations returning lists,\n * a DeferUsage object may correspond to many DeliveryGroups.\n *\n * @internal\n */\n getNewDeliveryGroupMap(\n newDeferUsages: ReadonlyArray,\n deliveryGroupMap: ReadonlyMap | undefined,\n path: Path | undefined,\n ): {\n newDeliveryGroups: ReadonlyArray;\n newDeliveryGroupMap: ReadonlyMap;\n } {\n const newDeliveryGroups: Array = [];\n const newDeliveryGroupMap = new Map(deliveryGroupMap);\n\n // For each new deferUsage object:\n for (const newDeferUsage of newDeferUsages) {\n const parentDeferUsage = newDeferUsage.parentDeferUsage;\n\n const parent =\n parentDeferUsage === undefined\n ? undefined\n : deliveryGroupFromDeferUsage(parentDeferUsage, newDeliveryGroupMap);\n\n // Create a new DeliveryGroup object\n const deliveryGroup: DeliveryGroup = {\n path,\n label: newDeferUsage.label,\n parent,\n };\n\n // Add it to the list of new groups\n newDeliveryGroups.push(deliveryGroup);\n\n // Update the map\n newDeliveryGroupMap.set(newDeferUsage, deliveryGroup);\n }\n\n return {\n newDeliveryGroups,\n newDeliveryGroupMap,\n };\n }\n\n shouldDefer(\n parentDeferUsages: undefined | DeferUsageSet,\n deferUsages: DeferUsageSet,\n ): boolean {\n // If we have a new child defer usage, defer.\n // Otherwise, this defer usage was already deferred when it was initially\n // encountered, and is now in the midst of executing early, so the new\n // deferred grouped fields set can be executed immediately.\n return (\n parentDeferUsages === undefined ||\n !Array.from(deferUsages).every((deferUsage) =>\n parentDeferUsages.has(deferUsage),\n )\n );\n }\n\n override handleStream(\n index: number,\n path: Path,\n iterator:\n | { handle: Iterator; isAsync?: never }\n | { handle: AsyncIterator; isAsync: true },\n streamUsage: StreamUsage,\n info: GraphQLResolveInfo,\n itemType: GraphQLOutputType,\n ): boolean {\n const { handle, isAsync } = iterator;\n const queue = this.buildStreamItemQueue(\n index,\n path,\n handle,\n streamUsage.fieldDetailsList,\n info,\n itemType,\n isAsync,\n );\n\n const itemStream: ItemStream = {\n label: streamUsage.label,\n path,\n queue,\n initialCount: index,\n };\n\n this.streams.push(itemStream);\n return true;\n }\n\n buildStreamItemQueue(\n initialIndex: number,\n streamPath: Path,\n iterator: Iterator | AsyncIterator,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemType: GraphQLOutputType,\n isAsync: boolean | undefined,\n ): Queue {\n const createSubExecutor = this.getCreateSubExecutor();\n const { enableEarlyExecution } = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n const queue = new Queue(\n async ({ push, stop, onStop, started }) => {\n const abortStreamItems = new Set<(reason?: unknown) => void>();\n let finishedNormally = false;\n let stopRequested = false;\n\n onStop((reason) => {\n stopRequested = true;\n if (!finishedNormally) {\n for (const abortStreamItem of abortStreamItems) {\n abortStreamItem(reason);\n }\n if (isAsync) {\n sharedExecutionContext.asyncWorkTracker.add(\n returnIteratorCatchingErrors(\n iterator as AsyncIterator,\n ),\n );\n } else {\n sharedExecutionContext.asyncWorkTracker.addValues(\n collectIteratorPromises(iterator as Iterator),\n );\n }\n }\n });\n await (enableEarlyExecution ? Promise.resolve() : started);\n if (stopRequested) {\n return;\n }\n let index = initialIndex;\n while (true) {\n let iteration;\n try {\n if (isAsync) {\n // eslint-disable-next-line no-await-in-loop\n iteration = await iterator.next();\n if (stopRequested) {\n return;\n }\n } else {\n iteration = (iterator as Iterator).next();\n }\n } catch (rawError) {\n throw locatedError(\n rawError,\n toNodes(fieldDetailsList),\n pathToArray(streamPath),\n );\n }\n\n if (iteration.done) {\n finishedNormally = true;\n const stopped = stop();\n /* node:coverage disable */\n if (isPromise(stopped)) {\n stopped.catch(() => undefined);\n }\n /* node:coverage enable */\n return;\n }\n\n const itemPath = addPath(streamPath, index, undefined);\n\n const executor = createSubExecutor();\n\n let streamItemResult = executor.completeStreamItem(\n itemPath,\n iteration.value,\n fieldDetailsList,\n info,\n itemType,\n );\n if (isPromise(streamItemResult)) {\n if (enableEarlyExecution) {\n const abortStreamItem = (reason?: unknown) =>\n executor.abort(reason);\n abortStreamItems.add(abortStreamItem);\n streamItemResult = streamItemResult.finally(() => {\n abortStreamItems.delete(abortStreamItem);\n });\n } else {\n // eslint-disable-next-line no-await-in-loop\n streamItemResult = await streamItemResult;\n if (stopRequested) {\n return;\n }\n }\n }\n const pushResult = push(streamItemResult);\n if (isPromise(pushResult)) {\n // eslint-disable-next-line no-await-in-loop\n await pushResult;\n if (stopRequested) {\n return;\n }\n }\n index += 1;\n }\n },\n // set initialCapacity to 100 by default\n 100,\n );\n return queue;\n }\n\n completeStreamItem(\n itemPath: Path,\n item: unknown,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemType: GraphQLOutputType,\n ): PromiseOrValue {\n if (isPromiseLike(item)) {\n return this.completePromisedValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n item,\n undefined,\n )\n .then(\n (resolvedItem) => this.buildStreamItemResult(resolvedItem),\n (rawError: unknown) => {\n this.handleFieldError(\n rawError,\n itemType,\n fieldDetailsList,\n itemPath,\n );\n return this.buildStreamItemResult(null);\n },\n )\n .then(undefined, (error: unknown) => {\n this.abort();\n throw error;\n });\n }\n\n let result: PromiseOrValue;\n try {\n try {\n result = this.completeValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n item,\n undefined,\n );\n } catch (rawError) {\n this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);\n return this.buildStreamItemResult(null);\n }\n } catch (error) {\n this.abort();\n throw error;\n }\n\n if (isPromise(result)) {\n return result\n .then(\n (resolved) => this.buildStreamItemResult(resolved),\n (rawError: unknown) => {\n this.handleFieldError(\n rawError,\n itemType,\n fieldDetailsList,\n itemPath,\n );\n return this.buildStreamItemResult(null);\n },\n )\n .then(undefined, (error: unknown) => {\n this.abort();\n throw error;\n });\n }\n\n return this.buildStreamItemResult(result);\n }\n\n buildStreamItemResult(result: unknown): StreamItemResult {\n const item = result;\n const errors = this.collectedErrors.errors;\n const work = this.getIncrementalWork();\n return this.finish(\n errors.length > 0\n ? { value: { item, errors }, work }\n : { value: { item }, work },\n );\n }\n}\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n\nfunction getDeliveryGroups(\n deferUsageSet: DeferUsageSet,\n deliveryGroupMap: ReadonlyMap,\n): ReadonlyArray {\n return Array.from(deferUsageSet).map((deferUsage) =>\n deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap),\n );\n}\n\nfunction deliveryGroupFromDeferUsage(\n deferUsage: DeferUsage,\n deliveryGroupMap: ReadonlyMap,\n): DeliveryGroup {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return deliveryGroupMap.get(deferUsage)!;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs new file mode 100644 index 00000000..442c50d3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs @@ -0,0 +1,356 @@ +import { invariant } from "../../jsutils/invariant.mjs"; +import { isPromise, isPromiseLike } from "../../jsutils/isPromise.mjs"; +import { memoize1 } from "../../jsutils/memoize1.mjs"; +import { memoize2 } from "../../jsutils/memoize2.mjs"; +import { addPath, pathToArray } from "../../jsutils/Path.mjs"; +import { locatedError } from "../../error/locatedError.mjs"; +import { OperationTypeNode } from "../../language/ast.mjs"; +import { collectSubfields as _collectSubfields } from "../collectFields.mjs"; +import { collectIteratorPromises } from "../collectIteratorPromises.mjs"; +import { Executor } from "../Executor.mjs"; +import { returnIteratorCatchingErrors } from "../returnIteratorCatchingErrors.mjs"; +import { buildExecutionPlan } from "./buildExecutionPlan.mjs"; +import { Computation } from "./Computation.mjs"; +import { IncrementalPublisher } from "./IncrementalPublisher.mjs"; +import { Queue } from "./Queue.mjs"; +const buildExecutionPlanFromInitial = memoize1((groupedFieldSet) => buildExecutionPlan(groupedFieldSet)); +const buildExecutionPlanFromDeferred = memoize2((groupedFieldSet, deferUsageSet) => buildExecutionPlan(groupedFieldSet, deferUsageSet)); +export class IncrementalExecutor extends Executor { + constructor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet) { + super(validatedExecutionArgs, sharedExecutionContext); + this.deferUsageSet = deferUsageSet; + this.groups = []; + this.tasks = []; + this.streams = []; + } + getCreateSubExecutor() { + const validatedExecutionArgs = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + return (deferUsageSet) => new IncrementalExecutor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet); + } + abort(reason) { + super.abort(reason); + for (const task of this.tasks) { + const aborted = task.computation.abort(reason); + if (!(!isPromise(aborted))) + invariant(false); + } + for (const stream of this.streams) { + const aborted = stream.queue.abort(reason); + if (!(!isPromise(aborted))) + invariant(false); + } + } + buildResponse(data) { + const work = this.getIncrementalWork(); + const { tasks, streams } = work; + if (tasks?.length === 0 && streams?.length === 0) { + return super.buildResponse(data); + } + const errors = this.collectedErrors.errors; + if (!(data !== null)) + invariant(false); + const incrementalPublisher = new IncrementalPublisher(); + return incrementalPublisher.buildResponse(data, errors, work, this.validatedExecutionArgs.externalAbortSignal, this.getFinishSharedExecution()); + } + executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, newDeferUsages) { + if (newDeferUsages.length === 0) { + return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, undefined); + } + if (!(this.validatedExecutionArgs.operation.operation !== + OperationTypeNode.SUBSCRIPTION)) + invariant(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + const { newDeliveryGroups, newDeliveryGroupMap } = this.getNewDeliveryGroupMap(newDeferUsages, undefined, undefined); + const { groupedFieldSet, newGroupedFieldSets } = this.buildRootExecutionPlan(originalGroupedFieldSet); + const data = this.executeRootGroupedFieldSet(rootType, rootValue, groupedFieldSet, serially, newDeliveryGroupMap); + this.groups.push(...newDeliveryGroups); + if (newGroupedFieldSets.size > 0) { + this.collectExecutionGroups(rootType, rootValue, undefined, newGroupedFieldSets, newDeliveryGroupMap); + } + return data; + } + buildRootExecutionPlan(originalGroupedFieldSet) { + return buildExecutionPlanFromInitial(originalGroupedFieldSet); + } + executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, newDeferUsages, deliveryGroupMap) { + if (newDeferUsages.length > 0) { + if (!(this.validatedExecutionArgs.operation.operation !== + OperationTypeNode.SUBSCRIPTION)) + invariant(false, '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.'); + } + if (deliveryGroupMap === undefined && newDeferUsages.length === 0) { + return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, deliveryGroupMap); + } + const { newDeliveryGroups, newDeliveryGroupMap } = this.getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path); + const { groupedFieldSet, newGroupedFieldSets } = this.buildSubExecutionPlan(originalGroupedFieldSet); + const data = this.executeFields(parentType, sourceValue, path, groupedFieldSet, newDeliveryGroupMap); + this.groups.push(...newDeliveryGroups); + if (newGroupedFieldSets.size > 0) { + this.collectExecutionGroups(parentType, sourceValue, path, newGroupedFieldSets, newDeliveryGroupMap); + } + return data; + } + buildSubExecutionPlan(originalGroupedFieldSet) { + return this.deferUsageSet === undefined + ? buildExecutionPlanFromInitial(originalGroupedFieldSet) + : buildExecutionPlanFromDeferred(originalGroupedFieldSet, this.deferUsageSet); + } + collectExecutionGroups(parentType, sourceValue, path, newGroupedFieldSets, deliveryGroupMap) { + const createSubExecutor = this.getCreateSubExecutor(); + for (const [deferUsageSet, groupedFieldSet] of newGroupedFieldSets) { + const deliveryGroups = getDeliveryGroups(deferUsageSet, deliveryGroupMap); + const executor = createSubExecutor(deferUsageSet); + const executionGroup = { + groups: deliveryGroups, + path, + computation: new Computation(() => executor.executeExecutionGroup(deliveryGroups, parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap), (reason) => executor.abort(reason)), + }; + const parentDeferUsages = this.deferUsageSet; + if (this.validatedExecutionArgs.enableEarlyExecution) { + if (this.shouldDefer(parentDeferUsages, deferUsageSet)) { + Promise.resolve().then(() => executionGroup.computation.prime()); + } + else { + executionGroup.computation.prime(); + } + } + this.tasks.push(executionGroup); + } + } + executeExecutionGroup(deliveryGroups, parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap) { + let result; + try { + result = this.executeFields(parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap); + } + catch (error) { + this.abort(); + throw error; + } + if (isPromise(result)) { + return result.then((resolved) => this.buildExecutionGroupResult(deliveryGroups, path, resolved), (error) => { + this.abort(); + throw error; + }); + } + return this.buildExecutionGroupResult(deliveryGroups, path, result); + } + buildExecutionGroupResult(deliveryGroups, path, result) { + const data = result; + const errors = this.collectedErrors.errors; + return this.finish({ + value: errors.length + ? { deliveryGroups, path: pathToArray(path), errors, data } + : { deliveryGroups, path: pathToArray(path), data }, + work: this.getIncrementalWork(), + }); + } + getIncrementalWork() { + const { groups, tasks, streams, collectedErrors } = this; + if (collectedErrors.errors.length === 0) { + return { groups, tasks, streams }; + } + const cancellationReason = new Error('Cancelled secondary to null within original result'); + const filteredTasks = []; + for (const task of tasks) { + if (collectedErrors.hasNulledPosition(task.path)) { + const aborted = task.computation.abort(cancellationReason); + if (!(!isPromise(aborted))) + invariant(false); + } + else { + filteredTasks.push(task); + } + } + const filteredStreams = []; + for (const stream of streams) { + if (collectedErrors.hasNulledPosition(stream.path)) { + const aborted = stream.queue.abort(cancellationReason); + if (!(!isPromise(aborted))) + invariant(false); + } + else { + filteredStreams.push(stream); + } + } + return { + groups, + tasks: filteredTasks, + streams: filteredStreams, + }; + } + getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path) { + const newDeliveryGroups = []; + const newDeliveryGroupMap = new Map(deliveryGroupMap); + for (const newDeferUsage of newDeferUsages) { + const parentDeferUsage = newDeferUsage.parentDeferUsage; + const parent = parentDeferUsage === undefined + ? undefined + : deliveryGroupFromDeferUsage(parentDeferUsage, newDeliveryGroupMap); + const deliveryGroup = { + path, + label: newDeferUsage.label, + parent, + }; + newDeliveryGroups.push(deliveryGroup); + newDeliveryGroupMap.set(newDeferUsage, deliveryGroup); + } + return { + newDeliveryGroups, + newDeliveryGroupMap, + }; + } + shouldDefer(parentDeferUsages, deferUsages) { + return (parentDeferUsages === undefined || + !Array.from(deferUsages).every((deferUsage) => parentDeferUsages.has(deferUsage))); + } + handleStream(index, path, iterator, streamUsage, info, itemType) { + const { handle, isAsync } = iterator; + const queue = this.buildStreamItemQueue(index, path, handle, streamUsage.fieldDetailsList, info, itemType, isAsync); + const itemStream = { + label: streamUsage.label, + path, + queue, + initialCount: index, + }; + this.streams.push(itemStream); + return true; + } + buildStreamItemQueue(initialIndex, streamPath, iterator, fieldDetailsList, info, itemType, isAsync) { + const createSubExecutor = this.getCreateSubExecutor(); + const { enableEarlyExecution } = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + const queue = new Queue(async ({ push, stop, onStop, started }) => { + const abortStreamItems = new Set(); + let finishedNormally = false; + let stopRequested = false; + onStop((reason) => { + stopRequested = true; + if (!finishedNormally) { + for (const abortStreamItem of abortStreamItems) { + abortStreamItem(reason); + } + if (isAsync) { + sharedExecutionContext.asyncWorkTracker.add(returnIteratorCatchingErrors(iterator)); + } + else { + sharedExecutionContext.asyncWorkTracker.addValues(collectIteratorPromises(iterator)); + } + } + }); + await (enableEarlyExecution ? Promise.resolve() : started); + if (stopRequested) { + return; + } + let index = initialIndex; + while (true) { + let iteration; + try { + if (isAsync) { + iteration = await iterator.next(); + if (stopRequested) { + return; + } + } + else { + iteration = iterator.next(); + } + } + catch (rawError) { + throw locatedError(rawError, toNodes(fieldDetailsList), pathToArray(streamPath)); + } + if (iteration.done) { + finishedNormally = true; + const stopped = stop(); + if (isPromise(stopped)) { + stopped.catch(() => undefined); + } + return; + } + const itemPath = addPath(streamPath, index, undefined); + const executor = createSubExecutor(); + let streamItemResult = executor.completeStreamItem(itemPath, iteration.value, fieldDetailsList, info, itemType); + if (isPromise(streamItemResult)) { + if (enableEarlyExecution) { + const abortStreamItem = (reason) => executor.abort(reason); + abortStreamItems.add(abortStreamItem); + streamItemResult = streamItemResult.finally(() => { + abortStreamItems.delete(abortStreamItem); + }); + } + else { + streamItemResult = await streamItemResult; + if (stopRequested) { + return; + } + } + } + const pushResult = push(streamItemResult); + if (isPromise(pushResult)) { + await pushResult; + if (stopRequested) { + return; + } + } + index += 1; + } + }, 100); + return queue; + } + completeStreamItem(itemPath, item, fieldDetailsList, info, itemType) { + if (isPromiseLike(item)) { + return this.completePromisedValue(itemType, fieldDetailsList, info, itemPath, item, undefined) + .then((resolvedItem) => this.buildStreamItemResult(resolvedItem), (rawError) => { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return this.buildStreamItemResult(null); + }) + .then(undefined, (error) => { + this.abort(); + throw error; + }); + } + let result; + try { + try { + result = this.completeValue(itemType, fieldDetailsList, info, itemPath, item, undefined); + } + catch (rawError) { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return this.buildStreamItemResult(null); + } + } + catch (error) { + this.abort(); + throw error; + } + if (isPromise(result)) { + return result + .then((resolved) => this.buildStreamItemResult(resolved), (rawError) => { + this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath); + return this.buildStreamItemResult(null); + }) + .then(undefined, (error) => { + this.abort(); + throw error; + }); + } + return this.buildStreamItemResult(result); + } + buildStreamItemResult(result) { + const item = result; + const errors = this.collectedErrors.errors; + const work = this.getIncrementalWork(); + return this.finish(errors.length > 0 + ? { value: { item, errors }, work } + : { value: { item }, work }); + } +} +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +function getDeliveryGroups(deferUsageSet, deliveryGroupMap) { + return Array.from(deferUsageSet).map((deferUsage) => deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap)); +} +function deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap) { + return deliveryGroupMap.get(deferUsage); +} +//# sourceMappingURL=IncrementalExecutor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs.map new file mode 100644 index 00000000..abfc700e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"IncrementalExecutor.js","sourceRoot":"","sources":["../../../src/execution/incremental/IncrementalExecutor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,oCAAmC;AACvD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,oCAAmC;AACtE,OAAO,EAAE,QAAQ,EAAE,mCAAkC;AACrD,OAAO,EAAE,QAAQ,EAAE,mCAAkC;AAGrD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,+BAA8B;AAO7D,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,+BAA8B;AAa1D,OAAO,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,6BAA4B;AAC5E,OAAO,EAAE,uBAAuB,EAAE,uCAAsC;AAIxE,OAAO,EAAE,QAAQ,EAAE,wBAAuB;AAE1C,OAAO,EAAE,4BAA4B,EAAE,4CAA2C;AAGlF,OAAO,EAAE,kBAAkB,EAAE,iCAAgC;AAC7D,OAAO,EAAE,WAAW,EAAE,0BAAyB;AAC/C,OAAO,EAAE,oBAAoB,EAAE,mCAAkC;AACjE,OAAO,EAAE,KAAK,EAAE,oBAAmB;AAGnC,MAAM,6BAA6B,GAAG,QAAQ,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AAC,UAAU,EAAE,gBAAgB,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAClC,UAAsB,EACtB,gBAAwD;IAGxD,OAAO,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;AAC3C,CAAC","sourcesContent":["/** @category Incremental Execution */\n\n/* eslint-disable max-params */\nimport { invariant } from '../../jsutils/invariant.ts';\nimport { isPromise, isPromiseLike } from '../../jsutils/isPromise.ts';\nimport { memoize1 } from '../../jsutils/memoize1.ts';\nimport { memoize2 } from '../../jsutils/memoize2.ts';\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\nimport type { Path } from '../../jsutils/Path.ts';\nimport { addPath, pathToArray } from '../../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\nimport type {\n GraphQLError,\n GraphQLFormattedError,\n} from '../../error/GraphQLError.ts';\nimport { locatedError } from '../../error/locatedError.ts';\n\nimport type { FieldNode } from '../../language/ast.ts';\nimport { OperationTypeNode } from '../../language/ast.ts';\n\nimport type {\n GraphQLObjectType,\n GraphQLOutputType,\n GraphQLResolveInfo,\n} from '../../type/definition.ts';\n\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from '../collectFields.ts';\nimport { collectSubfields as _collectSubfields } from '../collectFields.ts';\nimport { collectIteratorPromises } from '../collectIteratorPromises.ts';\nimport type { SharedExecutionContext } from '../createSharedExecutionContext.ts';\nimport type { ValidatedExecutionArgs } from '../ExecutionArgs.ts';\nimport type { ExecutionResult, FormattedExecutionResult } from '../Executor.ts';\nimport { Executor } from '../Executor.ts';\nimport type { StreamUsage } from '../getStreamUsage.ts';\nimport { returnIteratorCatchingErrors } from '../returnIteratorCatchingErrors.ts';\n\nimport type { DeferUsageSet, ExecutionPlan } from './buildExecutionPlan.ts';\nimport { buildExecutionPlan } from './buildExecutionPlan.ts';\nimport { Computation } from './Computation.ts';\nimport { IncrementalPublisher } from './IncrementalPublisher.ts';\nimport { Queue } from './Queue.ts';\nimport type { Group, Stream, Task, Work } from './WorkQueue.ts';\n\nconst buildExecutionPlanFromInitial = memoize1(\n (groupedFieldSet: GroupedFieldSet) => buildExecutionPlan(groupedFieldSet),\n);\n\nconst buildExecutionPlanFromDeferred = memoize2(\n (groupedFieldSet: GroupedFieldSet, deferUsageSet: DeferUsageSet) =>\n buildExecutionPlan(groupedFieldSet, deferUsageSet),\n);\n\n/**\n * Results for an operation that produced incremental payloads.\n * @typeParam TInitialData - Shape of the initial result data payload.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface ExperimentalIncrementalExecutionResults<\n TInitialData = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Initial execution result delivered before subsequent incremental payloads. */\n initialResult: InitialIncrementalExecutionResult;\n /** Async stream of incremental payloads delivered after the initial result. */\n subsequentResults: AsyncGenerator<\n SubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n\n/**\n * JSON-serializable form of incremental execution results.\n * @typeParam TInitial - Shape of the formatted initial result data payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedExperimentalIncrementalExecutionResults<\n TInitial = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted initial execution result. */\n initialResult: FormattedInitialIncrementalExecutionResult<\n TInitial,\n TExtensions\n >;\n /** Async stream of formatted incremental payloads. */\n subsequentResults: AsyncGenerator<\n FormattedSubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n/**\n * Initial execution result for an operation that produced incremental payloads.\n * @typeParam TData - Shape of the initial data payload.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface InitialIncrementalExecutionResult<\n TData = ObjMap,\n TExtensions = ObjMap,\n> extends ExecutionResult {\n /** Data produced by the initial execution payload. */\n data: TData;\n /** Incremental payloads that are still pending after the initial result. */\n pending: ReadonlyArray;\n /** Indicates that subsequent incremental payloads will follow. */\n hasNext: true;\n /** Additional non-standard metadata included in the initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of an initial incremental execution result.\n * @typeParam TInitialData - Shape of the formatted initial data payload.\n * @typeParam TExtensions - Shape of the formatted extensions payload.\n */\nexport interface FormattedInitialIncrementalExecutionResult<\n TInitialData = ObjMap,\n TExtensions = ObjMap,\n> extends FormattedExecutionResult {\n /** Formatted data produced by the initial execution payload. */\n data: TInitialData;\n /** Formatted list of incremental payloads still pending after the initial result. */\n pending: ReadonlyArray;\n /** Indicates whether subsequent incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in the formatted initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * Subsequent payload produced by incremental execution.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface SubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Incremental payloads that became pending with this response. */\n pending?: ReadonlyArray;\n /** Deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n IncrementalResult\n >;\n /** Incremental payloads that completed with this response. */\n completed?: ReadonlyArray;\n /** Indicates whether more incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a subsequent incremental execution payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedSubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Indicates whether more incremental payloads will follow. */\n hasNext: boolean;\n /** Formatted incremental payloads that became pending with this response. */\n pending?: ReadonlyArray;\n /** Formatted deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n FormattedIncrementalResult\n >;\n /** Formatted incremental payloads that completed with this response. */\n completed?: ReadonlyArray;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Incremental payload produced by a deferred fragment.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface IncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Identifier matching this payload to a pending deferred fragment. */\n id: string;\n /** Path from the deferred fragment location to this payload. */\n subPath?: ReadonlyArray;\n /** Errors raised while executing the deferred fragment. */\n errors?: ReadonlyArray;\n /** Data produced by the deferred fragment. */\n data: TDeferredData;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a deferred fragment payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedIncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> {\n /** Formatted errors raised while executing the deferred fragment. */\n errors?: ReadonlyArray;\n /** Formatted data produced by the deferred fragment. */\n data: TDeferredData;\n /** Identifier matching this payload to a pending deferred fragment. */\n id: string;\n /** Path from the deferred fragment location to this payload. */\n subPath?: ReadonlyArray;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Incremental payload produced by a streamed list field.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface IncrementalStreamResult<\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Identifier matching this payload to a pending stream. */\n id: string;\n /** Path from the streamed field location to these items. */\n subPath?: ReadonlyArray;\n /** Errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Streamed list items delivered by this payload. */\n items: ReadonlyArray;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a streamed list payload.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedIncrementalStreamResult<\n TStreamItem = Array,\n TExtensions = ObjMap,\n> {\n /** Formatted errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Formatted streamed list items delivered by this payload. */\n items: ReadonlyArray;\n /** Identifier matching this payload to a pending stream. */\n id: string;\n /** Path from the streamed field location to these items. */\n subPath?: ReadonlyArray;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Deferred fragment or streamed list payload produced by incremental execution.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport type IncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | IncrementalDeferResult\n | IncrementalStreamResult;\n\n/**\n * JSON-serializable deferred fragment or streamed list payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport type FormattedIncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | FormattedIncrementalDeferResult\n | FormattedIncrementalStreamResult;\n\n/** @internal */\nexport interface PendingResult {\n id: string;\n path: ReadonlyArray;\n label?: string;\n}\n\n/** @internal */\nexport interface CompletedResult {\n id: string;\n errors?: ReadonlyArray;\n}\n\n/** @internal */\nexport interface FormattedCompletedResult {\n id: string;\n errors?: ReadonlyArray;\n}\n\ninterface ExecutionGroup extends Task<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n> {\n groups: ReadonlyArray;\n path: Path | undefined;\n computation: Computation;\n}\n\n/** @internal */\nexport interface DeliveryGroup extends Group {\n path: Path | undefined;\n label: string | undefined;\n parent: DeliveryGroup | undefined;\n}\n\n/** @internal */\nexport interface ItemStream extends Stream<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n> {\n path: Path;\n label: string | undefined;\n initialCount: number;\n}\n\n/** @internal */\nexport interface ExecutionGroupValue {\n deliveryGroups: ReadonlyArray;\n path: ReadonlyArray;\n errors?: ReadonlyArray;\n data: ObjMap;\n}\n\n/** @internal */\nexport type IncrementalWork = Work<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n>;\n\n/** @internal */\nexport interface ExecutionGroupResult {\n value: ExecutionGroupValue;\n work?: IncrementalWork | undefined;\n}\n\n/** @internal */\nexport interface StreamItemValue {\n errors?: ReadonlyArray;\n item: unknown;\n}\n\n/** @internal */\nexport interface StreamItemResult {\n value: StreamItemValue;\n work?: IncrementalWork | undefined;\n}\n\n/** @internal */\nexport class IncrementalExecutor<\n TExperimental = ExperimentalIncrementalExecutionResults,\n> extends Executor, TExperimental> {\n deferUsageSet?: DeferUsageSet | undefined;\n groups: Array;\n tasks: Array;\n streams: Array;\n\n constructor(\n validatedExecutionArgs: ValidatedExecutionArgs,\n sharedExecutionContext?: SharedExecutionContext,\n deferUsageSet?: DeferUsageSet,\n ) {\n super(validatedExecutionArgs, sharedExecutionContext);\n this.deferUsageSet = deferUsageSet;\n this.groups = [];\n this.tasks = [];\n this.streams = [];\n }\n\n getCreateSubExecutor(): (\n deferUsageSet?: DeferUsageSet,\n ) => IncrementalExecutor {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n\n return (deferUsageSet?: DeferUsageSet) =>\n new IncrementalExecutor(\n validatedExecutionArgs,\n sharedExecutionContext,\n deferUsageSet,\n );\n }\n\n override abort(reason?: unknown): void {\n super.abort(reason);\n for (const task of this.tasks) {\n const aborted = task.computation.abort(reason);\n invariant(!isPromise(aborted));\n }\n for (const stream of this.streams) {\n const aborted = stream.queue.abort(reason);\n invariant(!isPromise(aborted));\n }\n }\n\n /**\n * Given a completed execution context and data, build the `{ errors, data }`\n * response defined by the \"Response\" section of the GraphQL specification.\n *\n * @internal\n */\n override buildResponse(\n data: ObjMap | null,\n ): ExecutionResult | TExperimental {\n const work = this.getIncrementalWork();\n const { tasks, streams } = work;\n if (tasks?.length === 0 && streams?.length === 0) {\n return super.buildResponse(data);\n }\n\n const errors = this.collectedErrors.errors;\n invariant(data !== null);\n const incrementalPublisher = new IncrementalPublisher();\n return incrementalPublisher.buildResponse(\n data,\n errors,\n work,\n this.validatedExecutionArgs.externalAbortSignal,\n this.getFinishSharedExecution(),\n ) as TExperimental;\n }\n\n override executeCollectedRootFields(\n rootType: GraphQLObjectType,\n rootValue: unknown,\n originalGroupedFieldSet: GroupedFieldSet,\n serially: boolean,\n newDeferUsages: ReadonlyArray,\n ): PromiseOrValue> {\n if (newDeferUsages.length === 0) {\n return this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n originalGroupedFieldSet,\n serially,\n undefined,\n );\n }\n\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n\n const { newDeliveryGroups, newDeliveryGroupMap } =\n this.getNewDeliveryGroupMap(newDeferUsages, undefined, undefined);\n\n const { groupedFieldSet, newGroupedFieldSets } =\n this.buildRootExecutionPlan(originalGroupedFieldSet);\n\n const data = this.executeRootGroupedFieldSet(\n rootType,\n rootValue,\n groupedFieldSet,\n serially,\n newDeliveryGroupMap,\n );\n\n this.groups.push(...newDeliveryGroups);\n\n if (newGroupedFieldSets.size > 0) {\n this.collectExecutionGroups(\n rootType,\n rootValue,\n undefined,\n newGroupedFieldSets,\n newDeliveryGroupMap,\n );\n }\n\n return data;\n }\n\n buildRootExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return buildExecutionPlanFromInitial(originalGroupedFieldSet);\n }\n\n override executeCollectedSubfields(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n originalGroupedFieldSet: GroupedFieldSet,\n newDeferUsages: ReadonlyArray,\n deliveryGroupMap: ReadonlyMap | undefined,\n ): PromiseOrValue> {\n if (newDeferUsages.length > 0) {\n invariant(\n this.validatedExecutionArgs.operation.operation !==\n OperationTypeNode.SUBSCRIPTION,\n '`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n );\n }\n\n if (deliveryGroupMap === undefined && newDeferUsages.length === 0) {\n return this.executeFields(\n parentType,\n sourceValue,\n path,\n originalGroupedFieldSet,\n deliveryGroupMap,\n );\n }\n\n const { newDeliveryGroups, newDeliveryGroupMap } =\n this.getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path);\n\n const { groupedFieldSet, newGroupedFieldSets } = this.buildSubExecutionPlan(\n originalGroupedFieldSet,\n );\n\n const data = this.executeFields(\n parentType,\n sourceValue,\n path,\n groupedFieldSet,\n newDeliveryGroupMap,\n );\n\n this.groups.push(...newDeliveryGroups);\n\n if (newGroupedFieldSets.size > 0) {\n this.collectExecutionGroups(\n parentType,\n sourceValue,\n path,\n newGroupedFieldSets,\n newDeliveryGroupMap,\n );\n }\n\n return data;\n }\n\n buildSubExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return this.deferUsageSet === undefined\n ? buildExecutionPlanFromInitial(originalGroupedFieldSet)\n : buildExecutionPlanFromDeferred(\n originalGroupedFieldSet,\n this.deferUsageSet,\n );\n }\n\n collectExecutionGroups(\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n newGroupedFieldSets: Map,\n deliveryGroupMap: ReadonlyMap,\n ): void {\n const createSubExecutor = this.getCreateSubExecutor();\n for (const [deferUsageSet, groupedFieldSet] of newGroupedFieldSets) {\n const deliveryGroups = getDeliveryGroups(deferUsageSet, deliveryGroupMap);\n\n const executor = createSubExecutor(deferUsageSet);\n\n const executionGroup: ExecutionGroup = {\n groups: deliveryGroups,\n path,\n computation: new Computation(\n () =>\n executor.executeExecutionGroup(\n deliveryGroups,\n parentType,\n sourceValue,\n path,\n groupedFieldSet,\n deliveryGroupMap,\n ),\n (reason) => executor.abort(reason),\n ),\n };\n\n const parentDeferUsages = this.deferUsageSet;\n\n if (this.validatedExecutionArgs.enableEarlyExecution) {\n if (this.shouldDefer(parentDeferUsages, deferUsageSet)) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve().then(() => executionGroup.computation.prime());\n } else {\n executionGroup.computation.prime();\n }\n }\n\n this.tasks.push(executionGroup);\n }\n }\n\n executeExecutionGroup(\n deliveryGroups: ReadonlyArray,\n parentType: GraphQLObjectType,\n sourceValue: unknown,\n path: Path | undefined,\n groupedFieldSet: GroupedFieldSet,\n deliveryGroupMap: ReadonlyMap,\n ): PromiseOrValue {\n let result;\n try {\n result = this.executeFields(\n parentType,\n sourceValue,\n path,\n groupedFieldSet,\n deliveryGroupMap,\n );\n } catch (error) {\n this.abort();\n throw error;\n }\n\n if (isPromise(result)) {\n return result.then(\n (resolved) =>\n this.buildExecutionGroupResult(deliveryGroups, path, resolved),\n (error: unknown) => {\n this.abort();\n throw error;\n },\n );\n }\n\n return this.buildExecutionGroupResult(deliveryGroups, path, result);\n }\n\n buildExecutionGroupResult(\n deliveryGroups: ReadonlyArray,\n path: Path | undefined,\n result: ObjMap,\n ): ExecutionGroupResult {\n const data = result;\n const errors = this.collectedErrors.errors;\n return this.finish({\n value: errors.length\n ? { deliveryGroups, path: pathToArray(path), errors, data }\n : { deliveryGroups, path: pathToArray(path), data },\n work: this.getIncrementalWork(),\n });\n }\n\n getIncrementalWork(): IncrementalWork {\n const { groups, tasks, streams, collectedErrors } = this;\n\n if (collectedErrors.errors.length === 0) {\n return { groups, tasks, streams };\n }\n\n const cancellationReason = new Error(\n 'Cancelled secondary to null within original result',\n );\n\n const filteredTasks: Array = [];\n for (const task of tasks) {\n if (collectedErrors.hasNulledPosition(task.path)) {\n const aborted = task.computation.abort(cancellationReason);\n invariant(!isPromise(aborted));\n } else {\n filteredTasks.push(task);\n }\n }\n\n const filteredStreams: Array = [];\n for (const stream of streams) {\n if (collectedErrors.hasNulledPosition(stream.path)) {\n const aborted = stream.queue.abort(cancellationReason);\n invariant(!isPromise(aborted));\n } else {\n filteredStreams.push(stream);\n }\n }\n\n return {\n groups,\n tasks: filteredTasks,\n streams: filteredStreams,\n };\n }\n\n /**\n * Instantiates new DeliveryGroups for the given path, returning an\n * updated map of DeferUsage objects to DeliveryGroups.\n *\n * Note: As defer directives may be used with operations returning lists,\n * a DeferUsage object may correspond to many DeliveryGroups.\n *\n * @internal\n */\n getNewDeliveryGroupMap(\n newDeferUsages: ReadonlyArray,\n deliveryGroupMap: ReadonlyMap | undefined,\n path: Path | undefined,\n ): {\n newDeliveryGroups: ReadonlyArray;\n newDeliveryGroupMap: ReadonlyMap;\n } {\n const newDeliveryGroups: Array = [];\n const newDeliveryGroupMap = new Map(deliveryGroupMap);\n\n // For each new deferUsage object:\n for (const newDeferUsage of newDeferUsages) {\n const parentDeferUsage = newDeferUsage.parentDeferUsage;\n\n const parent =\n parentDeferUsage === undefined\n ? undefined\n : deliveryGroupFromDeferUsage(parentDeferUsage, newDeliveryGroupMap);\n\n // Create a new DeliveryGroup object\n const deliveryGroup: DeliveryGroup = {\n path,\n label: newDeferUsage.label,\n parent,\n };\n\n // Add it to the list of new groups\n newDeliveryGroups.push(deliveryGroup);\n\n // Update the map\n newDeliveryGroupMap.set(newDeferUsage, deliveryGroup);\n }\n\n return {\n newDeliveryGroups,\n newDeliveryGroupMap,\n };\n }\n\n shouldDefer(\n parentDeferUsages: undefined | DeferUsageSet,\n deferUsages: DeferUsageSet,\n ): boolean {\n // If we have a new child defer usage, defer.\n // Otherwise, this defer usage was already deferred when it was initially\n // encountered, and is now in the midst of executing early, so the new\n // deferred grouped fields set can be executed immediately.\n return (\n parentDeferUsages === undefined ||\n !Array.from(deferUsages).every((deferUsage) =>\n parentDeferUsages.has(deferUsage),\n )\n );\n }\n\n override handleStream(\n index: number,\n path: Path,\n iterator:\n | { handle: Iterator; isAsync?: never }\n | { handle: AsyncIterator; isAsync: true },\n streamUsage: StreamUsage,\n info: GraphQLResolveInfo,\n itemType: GraphQLOutputType,\n ): boolean {\n const { handle, isAsync } = iterator;\n const queue = this.buildStreamItemQueue(\n index,\n path,\n handle,\n streamUsage.fieldDetailsList,\n info,\n itemType,\n isAsync,\n );\n\n const itemStream: ItemStream = {\n label: streamUsage.label,\n path,\n queue,\n initialCount: index,\n };\n\n this.streams.push(itemStream);\n return true;\n }\n\n buildStreamItemQueue(\n initialIndex: number,\n streamPath: Path,\n iterator: Iterator | AsyncIterator,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemType: GraphQLOutputType,\n isAsync: boolean | undefined,\n ): Queue {\n const createSubExecutor = this.getCreateSubExecutor();\n const { enableEarlyExecution } = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n const queue = new Queue(\n async ({ push, stop, onStop, started }) => {\n const abortStreamItems = new Set<(reason?: unknown) => void>();\n let finishedNormally = false;\n let stopRequested = false;\n\n onStop((reason) => {\n stopRequested = true;\n if (!finishedNormally) {\n for (const abortStreamItem of abortStreamItems) {\n abortStreamItem(reason);\n }\n if (isAsync) {\n sharedExecutionContext.asyncWorkTracker.add(\n returnIteratorCatchingErrors(\n iterator as AsyncIterator,\n ),\n );\n } else {\n sharedExecutionContext.asyncWorkTracker.addValues(\n collectIteratorPromises(iterator as Iterator),\n );\n }\n }\n });\n await (enableEarlyExecution ? Promise.resolve() : started);\n if (stopRequested) {\n return;\n }\n let index = initialIndex;\n while (true) {\n let iteration;\n try {\n if (isAsync) {\n // eslint-disable-next-line no-await-in-loop\n iteration = await iterator.next();\n if (stopRequested) {\n return;\n }\n } else {\n iteration = (iterator as Iterator).next();\n }\n } catch (rawError) {\n throw locatedError(\n rawError,\n toNodes(fieldDetailsList),\n pathToArray(streamPath),\n );\n }\n\n if (iteration.done) {\n finishedNormally = true;\n const stopped = stop();\n /* node:coverage disable */\n if (isPromise(stopped)) {\n stopped.catch(() => undefined);\n }\n /* node:coverage enable */\n return;\n }\n\n const itemPath = addPath(streamPath, index, undefined);\n\n const executor = createSubExecutor();\n\n let streamItemResult = executor.completeStreamItem(\n itemPath,\n iteration.value,\n fieldDetailsList,\n info,\n itemType,\n );\n if (isPromise(streamItemResult)) {\n if (enableEarlyExecution) {\n const abortStreamItem = (reason?: unknown) =>\n executor.abort(reason);\n abortStreamItems.add(abortStreamItem);\n streamItemResult = streamItemResult.finally(() => {\n abortStreamItems.delete(abortStreamItem);\n });\n } else {\n // eslint-disable-next-line no-await-in-loop\n streamItemResult = await streamItemResult;\n if (stopRequested) {\n return;\n }\n }\n }\n const pushResult = push(streamItemResult);\n if (isPromise(pushResult)) {\n // eslint-disable-next-line no-await-in-loop\n await pushResult;\n if (stopRequested) {\n return;\n }\n }\n index += 1;\n }\n },\n // set initialCapacity to 100 by default\n 100,\n );\n return queue;\n }\n\n completeStreamItem(\n itemPath: Path,\n item: unknown,\n fieldDetailsList: FieldDetailsList,\n info: GraphQLResolveInfo,\n itemType: GraphQLOutputType,\n ): PromiseOrValue {\n if (isPromiseLike(item)) {\n return this.completePromisedValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n item,\n undefined,\n )\n .then(\n (resolvedItem) => this.buildStreamItemResult(resolvedItem),\n (rawError: unknown) => {\n this.handleFieldError(\n rawError,\n itemType,\n fieldDetailsList,\n itemPath,\n );\n return this.buildStreamItemResult(null);\n },\n )\n .then(undefined, (error: unknown) => {\n this.abort();\n throw error;\n });\n }\n\n let result: PromiseOrValue;\n try {\n try {\n result = this.completeValue(\n itemType,\n fieldDetailsList,\n info,\n itemPath,\n item,\n undefined,\n );\n } catch (rawError) {\n this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);\n return this.buildStreamItemResult(null);\n }\n } catch (error) {\n this.abort();\n throw error;\n }\n\n if (isPromise(result)) {\n return result\n .then(\n (resolved) => this.buildStreamItemResult(resolved),\n (rawError: unknown) => {\n this.handleFieldError(\n rawError,\n itemType,\n fieldDetailsList,\n itemPath,\n );\n return this.buildStreamItemResult(null);\n },\n )\n .then(undefined, (error: unknown) => {\n this.abort();\n throw error;\n });\n }\n\n return this.buildStreamItemResult(result);\n }\n\n buildStreamItemResult(result: unknown): StreamItemResult {\n const item = result;\n const errors = this.collectedErrors.errors;\n const work = this.getIncrementalWork();\n return this.finish(\n errors.length > 0\n ? { value: { item, errors }, work }\n : { value: { item }, work },\n );\n }\n}\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n\nfunction getDeliveryGroups(\n deferUsageSet: DeferUsageSet,\n deliveryGroupMap: ReadonlyMap,\n): ReadonlyArray {\n return Array.from(deferUsageSet).map((deferUsage) =>\n deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap),\n );\n}\n\nfunction deliveryGroupFromDeferUsage(\n deferUsage: DeferUsage,\n deliveryGroupMap: ReadonlyMap,\n): DeliveryGroup {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return deliveryGroupMap.get(deferUsage)!;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.mts new file mode 100644 index 00000000..e793b604 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.mts @@ -0,0 +1,15 @@ +import type { ObjMap } from "../../jsutils/ObjMap.mjs"; +import type { GraphQLError } from "../../error/GraphQLError.mjs"; +import type { ExperimentalIncrementalExecutionResults, IncrementalWork } from "./IncrementalExecutor.mjs"; +/** @internal */ +export declare class IncrementalPublisher { + private _ids; + private _nextId; + constructor(); + buildResponse(data: ObjMap, errors: ReadonlyArray, work: IncrementalWork, abortSignal: AbortSignal | undefined, onFinished: () => void): ExperimentalIncrementalExecutionResults; + private _ensureId; + private _toPendingResults; + private _handleBatch; + private _handleWorkQueueEvent; + private _getBestIdAndSubPath; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.ts new file mode 100644 index 00000000..20469856 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.d.ts @@ -0,0 +1,15 @@ +import type { ObjMap } from "../../jsutils/ObjMap.js"; +import type { GraphQLError } from "../../error/GraphQLError.js"; +import type { ExperimentalIncrementalExecutionResults, IncrementalWork } from "./IncrementalExecutor.js"; +/** @internal */ +export declare class IncrementalPublisher { + private _ids; + private _nextId; + constructor(); + buildResponse(data: ObjMap, errors: ReadonlyArray, work: IncrementalWork, abortSignal: AbortSignal | undefined, onFinished: () => void): ExperimentalIncrementalExecutionResults; + private _ensureId; + private _toPendingResults; + private _handleBatch; + private _handleWorkQueueEvent; + private _getBestIdAndSubPath; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js new file mode 100644 index 00000000..b8963df5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js @@ -0,0 +1,195 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IncrementalPublisher = void 0; +const Path_ts_1 = require("../../jsutils/Path.js"); +const ensureGraphQLError_ts_1 = require("../../error/ensureGraphQLError.js"); +const mapAsyncIterable_ts_1 = require("../mapAsyncIterable.js"); +const withConcurrentAbruptClose_ts_1 = require("../withConcurrentAbruptClose.js"); +const WorkQueue_ts_1 = require("./WorkQueue.js"); +class IncrementalPublisher { + constructor() { + this._ids = new Map(); + this._nextId = 0; + } + buildResponse(data, errors, work, abortSignal, onFinished) { + const { initialGroups, initialStreams, events } = (0, WorkQueue_ts_1.createWorkQueue)(work); + function abort() { + subsequentResults.throw(abortSignal?.reason).catch(() => { + }); + } + if (abortSignal) { + abortSignal.addEventListener('abort', abort); + } + const onWorkQueueFinished = () => { + onFinished(); + abortSignal?.removeEventListener('abort', abort); + }; + const pending = this._toPendingResults(initialGroups, initialStreams); + const initialResult = errors.length + ? { errors, data, pending, hasNext: true } + : { data, pending, hasNext: true }; + const subsequentResults = (0, withConcurrentAbruptClose_ts_1.withConcurrentAbruptClose)((0, mapAsyncIterable_ts_1.mapAsyncIterable)(events, (batch) => this._handleBatch(batch, onWorkQueueFinished)), () => onWorkQueueFinished()); + return { + initialResult, + subsequentResults, + }; + } + _ensureId(deferredFragmentOrStream) { + let id = this._ids.get(deferredFragmentOrStream); + if (id !== undefined) { + return id; + } + id = String(this._nextId++); + this._ids.set(deferredFragmentOrStream, id); + return id; + } + _toPendingResults(newGroups, newStreams) { + const pendingResults = []; + for (const collection of [newGroups, newStreams]) { + for (const node of collection) { + const id = this._ensureId(node); + const pendingResult = { + id, + path: (0, Path_ts_1.pathToArray)(node.path), + }; + if (node.label !== undefined) { + pendingResult.label = node.label; + } + pendingResults.push(pendingResult); + } + } + return pendingResults; + } + _handleBatch(batch, onWorkQueueFinished) { + const context = { + pending: [], + incremental: [], + completed: [], + hasNext: true, + }; + for (const event of batch) { + this._handleWorkQueueEvent(event, context, onWorkQueueFinished); + } + const { incremental, completed, pending, hasNext } = context; + const result = { hasNext }; + if (pending.length > 0) { + result.pending = pending; + } + if (incremental.length > 0) { + result.incremental = incremental; + } + if (completed.length > 0) { + result.completed = completed; + } + return result; + } + _handleWorkQueueEvent(event, context, onWorkQueueFinished) { + switch (event.kind) { + case 'GROUP_VALUES': { + const group = event.group; + const id = this._ensureId(group); + for (const value of event.values) { + const { bestId, subPath } = this._getBestIdAndSubPath(id, group, value); + const incrementalEntry = { + id: bestId, + data: value.data, + }; + if (value.errors !== undefined) { + incrementalEntry.errors = value.errors; + } + if (subPath !== undefined) { + incrementalEntry.subPath = subPath; + } + context.incremental.push(incrementalEntry); + } + break; + } + case 'GROUP_SUCCESS': { + const group = event.group; + const id = this._ensureId(group); + context.completed.push({ id }); + this._ids.delete(group); + if (event.newGroups.length > 0 || event.newStreams.length > 0) { + context.pending.push(...this._toPendingResults(event.newGroups, event.newStreams)); + } + break; + } + case 'GROUP_FAILURE': { + const { group, error } = event; + const id = this._ensureId(group); + context.completed.push({ + id, + errors: [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(error)], + }); + this._ids.delete(group); + break; + } + case 'STREAM_VALUES': { + const stream = event.stream; + const id = this._ensureId(stream); + const { values, newGroups, newStreams } = event; + const items = []; + const errors = []; + for (const value of values) { + items.push(value.item); + if (value.errors !== undefined) { + errors.push(...value.errors); + } + } + context.incremental.push(errors.length > 0 ? { id, items, errors } : { id, items }); + if (newGroups.length > 0 || newStreams.length > 0) { + context.pending.push(...this._toPendingResults(newGroups, newStreams)); + } + break; + } + case 'STREAM_SUCCESS': { + const stream = event.stream; + context.completed.push({ + id: this._ensureId(stream), + }); + this._ids.delete(stream); + break; + } + case 'STREAM_FAILURE': { + const stream = event.stream; + context.completed.push({ + id: this._ensureId(stream), + errors: [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(event.error)], + }); + this._ids.delete(stream); + break; + } + case 'WORK_QUEUE_TERMINATION': { + onWorkQueueFinished?.(); + context.hasNext = false; + break; + } + } + } + _getBestIdAndSubPath(initialId, initialDeferredFragmentRecord, executionGroupValue) { + let maxLength = (0, Path_ts_1.pathToArray)(initialDeferredFragmentRecord.path).length; + let bestId = initialId; + for (const deliveryGroup of executionGroupValue.deliveryGroups) { + if (deliveryGroup === initialDeferredFragmentRecord) { + continue; + } + const id = this._ids.get(deliveryGroup); + if (id === undefined) { + continue; + } + const path = (0, Path_ts_1.pathToArray)(deliveryGroup.path); + const length = path.length; + if (length > maxLength) { + maxLength = length; + bestId = id; + } + } + const subPath = executionGroupValue.path.slice(maxLength); + return { + bestId, + subPath: subPath.length > 0 ? subPath : undefined, + }; + } +} +exports.IncrementalPublisher = IncrementalPublisher; +//# sourceMappingURL=IncrementalPublisher.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js.map new file mode 100644 index 00000000..897c6952 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IncrementalPublisher.js","sourceRoot":"","sources":["../../../src/execution/incremental/IncrementalPublisher.ts"],"names":[],"mappings":";;;AACA,mDAAoD;AAEpD,6EAAuE;AAGvE,gEAA0D;AAC1D,kFAA4E;AAiB5E,iDAAiD;AAUjD,MAAa,oBAAoB;IAI/B;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACnB,CAAC;IAED,aAAa,CACX,IAAqB,EACrB,MAAmC,EACnC,IAAqB,EACrB,WAAoC,EACpC,UAAsB;QAEtB,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,IAAA,8BAAe,EAK/D,IAAI,CAAC,CAAC;QAER,SAAS,KAAK;YACZ,iBAAiB,CAAC,KAA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YACR,CAAC;YACD,KAAK,wBAAwB,CAAC,CAAC,CAAC;gBAC9B,mBAAmB,EAAE,EAAE,CAAC;gBACxB,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;gBACxB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IAEO,oBAAoB,CAC1B,SAAiB,EACjB,6BAA4C,EAC5C,mBAAwC;QAExC,IAAI,SAAS,GAAG,IAAA,qBAAW,EAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QACvE,IAAI,MAAM,GAAG,SAAS,CAAC;QAEvB,KAAK,MAAM,aAAa,IAAI,mBAAmB,CAAC,cAAc,EAAE,CAAC;YAC/D,IAAI,aAAa,KAAK,6BAA6B,EAAE,CAAC;gBACpD,SAAS;YACX,CAAC;YACD,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAExC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;gBACrB,SAAS;YACX,CAAC;YACD,MAAM,IAAI,GAAG,IAAA,qBAAW,EAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;gBACvB,SAAS,GAAG,MAAM,CAAC;gBACnB,MAAM,GAAG,EAAE,CAAC;YACd,CAAC;QACH,CAAC;QACD,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO;YACL,MAAM;YACN,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SAClD,CAAC;IACJ,CAAC;CACF;AApQD,oDAoQC","sourcesContent":["import type { ObjMap } from '../../jsutils/ObjMap.ts';\nimport { pathToArray } from '../../jsutils/Path.ts';\n\nimport { ensureGraphQLError } from '../../error/ensureGraphQLError.ts';\nimport type { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { mapAsyncIterable } from '../mapAsyncIterable.ts';\nimport { withConcurrentAbruptClose } from '../withConcurrentAbruptClose.ts';\n\nimport type {\n CompletedResult,\n DeliveryGroup,\n ExecutionGroupValue,\n ExperimentalIncrementalExecutionResults,\n IncrementalDeferResult,\n IncrementalResult,\n IncrementalWork,\n InitialIncrementalExecutionResult,\n ItemStream,\n PendingResult,\n StreamItemValue,\n SubsequentIncrementalExecutionResult,\n} from './IncrementalExecutor.ts';\nimport type { WorkQueueEvent } from './WorkQueue.ts';\nimport { createWorkQueue } from './WorkQueue.ts';\n\ninterface SubsequentIncrementalExecutionResultContext {\n pending: Array;\n incremental: Array;\n completed: Array;\n hasNext: boolean;\n}\n\n/** @internal */\nexport class IncrementalPublisher {\n private _ids: Map;\n private _nextId: number;\n\n constructor() {\n this._ids = new Map();\n this._nextId = 0;\n }\n\n buildResponse(\n data: ObjMap,\n errors: ReadonlyArray,\n work: IncrementalWork,\n abortSignal: AbortSignal | undefined,\n onFinished: () => void,\n ): ExperimentalIncrementalExecutionResults {\n const { initialGroups, initialStreams, events } = createWorkQueue<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >(work);\n\n function abort(): void {\n subsequentResults.throw(abortSignal?.reason).catch(() => {\n // Ignore errors\n });\n }\n\n if (abortSignal) {\n abortSignal.addEventListener('abort', abort);\n }\n const onWorkQueueFinished = () => {\n onFinished();\n abortSignal?.removeEventListener('abort', abort);\n };\n\n const pending = this._toPendingResults(initialGroups, initialStreams);\n\n const initialResult: InitialIncrementalExecutionResult = errors.length\n ? { errors, data, pending, hasNext: true }\n : { data, pending, hasNext: true };\n\n const subsequentResults = withConcurrentAbruptClose(\n mapAsyncIterable(events, (batch) =>\n this._handleBatch(batch, onWorkQueueFinished),\n ),\n () => onWorkQueueFinished(),\n );\n\n return {\n initialResult,\n subsequentResults,\n };\n }\n\n private _ensureId(\n deferredFragmentOrStream: DeliveryGroup | ItemStream,\n ): string {\n let id = this._ids.get(deferredFragmentOrStream);\n if (id !== undefined) {\n return id;\n }\n id = String(this._nextId++);\n this._ids.set(deferredFragmentOrStream, id);\n return id;\n }\n\n private _toPendingResults(\n newGroups: ReadonlyArray,\n newStreams: ReadonlyArray,\n ): Array {\n const pendingResults: Array = [];\n for (const collection of [newGroups, newStreams]) {\n for (const node of collection) {\n const id = this._ensureId(node);\n const pendingResult: PendingResult = {\n id,\n path: pathToArray(node.path),\n };\n if (node.label !== undefined) {\n pendingResult.label = node.label;\n }\n pendingResults.push(pendingResult);\n }\n }\n return pendingResults;\n }\n\n private _handleBatch(\n batch: ReadonlyArray<\n WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >\n >,\n onWorkQueueFinished: (() => void) | undefined,\n ): SubsequentIncrementalExecutionResult {\n const context: SubsequentIncrementalExecutionResultContext = {\n pending: [],\n incremental: [],\n completed: [],\n hasNext: true,\n };\n\n for (const event of batch) {\n this._handleWorkQueueEvent(event, context, onWorkQueueFinished);\n }\n\n const { incremental, completed, pending, hasNext } = context;\n\n const result: SubsequentIncrementalExecutionResult = { hasNext };\n if (pending.length > 0) {\n result.pending = pending;\n }\n if (incremental.length > 0) {\n result.incremental = incremental;\n }\n if (completed.length > 0) {\n result.completed = completed;\n }\n\n return result;\n }\n\n private _handleWorkQueueEvent(\n event: WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >,\n context: SubsequentIncrementalExecutionResultContext,\n onWorkQueueFinished: (() => void) | undefined,\n ): void {\n switch (event.kind) {\n case 'GROUP_VALUES': {\n const group = event.group;\n const id = this._ensureId(group);\n for (const value of event.values) {\n const { bestId, subPath } = this._getBestIdAndSubPath(\n id,\n group,\n value,\n );\n const incrementalEntry: IncrementalDeferResult = {\n id: bestId,\n data: value.data,\n };\n if (value.errors !== undefined) {\n incrementalEntry.errors = value.errors;\n }\n if (subPath !== undefined) {\n incrementalEntry.subPath = subPath;\n }\n context.incremental.push(incrementalEntry);\n }\n break;\n }\n case 'GROUP_SUCCESS': {\n const group = event.group;\n const id = this._ensureId(group);\n context.completed.push({ id });\n this._ids.delete(group);\n if (event.newGroups.length > 0 || event.newStreams.length > 0) {\n context.pending.push(\n ...this._toPendingResults(event.newGroups, event.newStreams),\n );\n }\n break;\n }\n case 'GROUP_FAILURE': {\n const { group, error } = event;\n const id = this._ensureId(group);\n context.completed.push({\n id,\n errors: [ensureGraphQLError(error)],\n });\n this._ids.delete(group);\n break;\n }\n case 'STREAM_VALUES': {\n const stream = event.stream;\n const id = this._ensureId(stream);\n const { values, newGroups, newStreams } = event;\n const items: Array = [];\n const errors: Array = [];\n for (const value of values) {\n items.push(value.item);\n if (value.errors !== undefined) {\n errors.push(...value.errors);\n }\n }\n context.incremental.push(\n errors.length > 0 ? { id, items, errors } : { id, items },\n );\n if (newGroups.length > 0 || newStreams.length > 0) {\n context.pending.push(\n ...this._toPendingResults(newGroups, newStreams),\n );\n }\n break;\n }\n case 'STREAM_SUCCESS': {\n const stream = event.stream;\n context.completed.push({\n id: this._ensureId(stream),\n });\n this._ids.delete(stream);\n break;\n }\n case 'STREAM_FAILURE': {\n const stream = event.stream;\n context.completed.push({\n id: this._ensureId(stream),\n errors: [ensureGraphQLError(event.error)],\n });\n this._ids.delete(stream);\n break;\n }\n case 'WORK_QUEUE_TERMINATION': {\n onWorkQueueFinished?.();\n context.hasNext = false;\n break;\n }\n }\n }\n\n private _getBestIdAndSubPath(\n initialId: string,\n initialDeferredFragmentRecord: DeliveryGroup,\n executionGroupValue: ExecutionGroupValue,\n ): { bestId: string; subPath: ReadonlyArray | undefined } {\n let maxLength = pathToArray(initialDeferredFragmentRecord.path).length;\n let bestId = initialId;\n\n for (const deliveryGroup of executionGroupValue.deliveryGroups) {\n if (deliveryGroup === initialDeferredFragmentRecord) {\n continue;\n }\n const id = this._ids.get(deliveryGroup);\n // TODO: Investigate why there is no coverage gap using node native test coverage.\n if (id === undefined) {\n continue;\n }\n const path = pathToArray(deliveryGroup.path);\n const length = path.length;\n if (length > maxLength) {\n maxLength = length;\n bestId = id;\n }\n }\n const subPath = executionGroupValue.path.slice(maxLength);\n return {\n bestId,\n subPath: subPath.length > 0 ? subPath : undefined,\n };\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs new file mode 100644 index 00000000..6a114dae --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs @@ -0,0 +1,191 @@ +import { pathToArray } from "../../jsutils/Path.mjs"; +import { ensureGraphQLError } from "../../error/ensureGraphQLError.mjs"; +import { mapAsyncIterable } from "../mapAsyncIterable.mjs"; +import { withConcurrentAbruptClose } from "../withConcurrentAbruptClose.mjs"; +import { createWorkQueue } from "./WorkQueue.mjs"; +export class IncrementalPublisher { + constructor() { + this._ids = new Map(); + this._nextId = 0; + } + buildResponse(data, errors, work, abortSignal, onFinished) { + const { initialGroups, initialStreams, events } = createWorkQueue(work); + function abort() { + subsequentResults.throw(abortSignal?.reason).catch(() => { + }); + } + if (abortSignal) { + abortSignal.addEventListener('abort', abort); + } + const onWorkQueueFinished = () => { + onFinished(); + abortSignal?.removeEventListener('abort', abort); + }; + const pending = this._toPendingResults(initialGroups, initialStreams); + const initialResult = errors.length + ? { errors, data, pending, hasNext: true } + : { data, pending, hasNext: true }; + const subsequentResults = withConcurrentAbruptClose(mapAsyncIterable(events, (batch) => this._handleBatch(batch, onWorkQueueFinished)), () => onWorkQueueFinished()); + return { + initialResult, + subsequentResults, + }; + } + _ensureId(deferredFragmentOrStream) { + let id = this._ids.get(deferredFragmentOrStream); + if (id !== undefined) { + return id; + } + id = String(this._nextId++); + this._ids.set(deferredFragmentOrStream, id); + return id; + } + _toPendingResults(newGroups, newStreams) { + const pendingResults = []; + for (const collection of [newGroups, newStreams]) { + for (const node of collection) { + const id = this._ensureId(node); + const pendingResult = { + id, + path: pathToArray(node.path), + }; + if (node.label !== undefined) { + pendingResult.label = node.label; + } + pendingResults.push(pendingResult); + } + } + return pendingResults; + } + _handleBatch(batch, onWorkQueueFinished) { + const context = { + pending: [], + incremental: [], + completed: [], + hasNext: true, + }; + for (const event of batch) { + this._handleWorkQueueEvent(event, context, onWorkQueueFinished); + } + const { incremental, completed, pending, hasNext } = context; + const result = { hasNext }; + if (pending.length > 0) { + result.pending = pending; + } + if (incremental.length > 0) { + result.incremental = incremental; + } + if (completed.length > 0) { + result.completed = completed; + } + return result; + } + _handleWorkQueueEvent(event, context, onWorkQueueFinished) { + switch (event.kind) { + case 'GROUP_VALUES': { + const group = event.group; + const id = this._ensureId(group); + for (const value of event.values) { + const { bestId, subPath } = this._getBestIdAndSubPath(id, group, value); + const incrementalEntry = { + id: bestId, + data: value.data, + }; + if (value.errors !== undefined) { + incrementalEntry.errors = value.errors; + } + if (subPath !== undefined) { + incrementalEntry.subPath = subPath; + } + context.incremental.push(incrementalEntry); + } + break; + } + case 'GROUP_SUCCESS': { + const group = event.group; + const id = this._ensureId(group); + context.completed.push({ id }); + this._ids.delete(group); + if (event.newGroups.length > 0 || event.newStreams.length > 0) { + context.pending.push(...this._toPendingResults(event.newGroups, event.newStreams)); + } + break; + } + case 'GROUP_FAILURE': { + const { group, error } = event; + const id = this._ensureId(group); + context.completed.push({ + id, + errors: [ensureGraphQLError(error)], + }); + this._ids.delete(group); + break; + } + case 'STREAM_VALUES': { + const stream = event.stream; + const id = this._ensureId(stream); + const { values, newGroups, newStreams } = event; + const items = []; + const errors = []; + for (const value of values) { + items.push(value.item); + if (value.errors !== undefined) { + errors.push(...value.errors); + } + } + context.incremental.push(errors.length > 0 ? { id, items, errors } : { id, items }); + if (newGroups.length > 0 || newStreams.length > 0) { + context.pending.push(...this._toPendingResults(newGroups, newStreams)); + } + break; + } + case 'STREAM_SUCCESS': { + const stream = event.stream; + context.completed.push({ + id: this._ensureId(stream), + }); + this._ids.delete(stream); + break; + } + case 'STREAM_FAILURE': { + const stream = event.stream; + context.completed.push({ + id: this._ensureId(stream), + errors: [ensureGraphQLError(event.error)], + }); + this._ids.delete(stream); + break; + } + case 'WORK_QUEUE_TERMINATION': { + onWorkQueueFinished?.(); + context.hasNext = false; + break; + } + } + } + _getBestIdAndSubPath(initialId, initialDeferredFragmentRecord, executionGroupValue) { + let maxLength = pathToArray(initialDeferredFragmentRecord.path).length; + let bestId = initialId; + for (const deliveryGroup of executionGroupValue.deliveryGroups) { + if (deliveryGroup === initialDeferredFragmentRecord) { + continue; + } + const id = this._ids.get(deliveryGroup); + if (id === undefined) { + continue; + } + const path = pathToArray(deliveryGroup.path); + const length = path.length; + if (length > maxLength) { + maxLength = length; + bestId = id; + } + } + const subPath = executionGroupValue.path.slice(maxLength); + return { + bestId, + subPath: subPath.length > 0 ? subPath : undefined, + }; + } +} +//# sourceMappingURL=IncrementalPublisher.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs.map new file mode 100644 index 00000000..50dddbab --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"IncrementalPublisher.js","sourceRoot":"","sources":["../../../src/execution/incremental/IncrementalPublisher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,+BAA8B;AAEpD,OAAO,EAAE,kBAAkB,EAAE,2CAA0C;AAGvE,OAAO,EAAE,gBAAgB,EAAE,gCAA+B;AAC1D,OAAO,EAAE,yBAAyB,EAAE,yCAAwC;AAiB5E,OAAO,EAAE,eAAe,EAAE,wBAAuB;AAUj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AAK,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO;YACL,MAAM;YACN,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SAClD,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { ObjMap } from '../../jsutils/ObjMap.ts';\nimport { pathToArray } from '../../jsutils/Path.ts';\n\nimport { ensureGraphQLError } from '../../error/ensureGraphQLError.ts';\nimport type { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { mapAsyncIterable } from '../mapAsyncIterable.ts';\nimport { withConcurrentAbruptClose } from '../withConcurrentAbruptClose.ts';\n\nimport type {\n CompletedResult,\n DeliveryGroup,\n ExecutionGroupValue,\n ExperimentalIncrementalExecutionResults,\n IncrementalDeferResult,\n IncrementalResult,\n IncrementalWork,\n InitialIncrementalExecutionResult,\n ItemStream,\n PendingResult,\n StreamItemValue,\n SubsequentIncrementalExecutionResult,\n} from './IncrementalExecutor.ts';\nimport type { WorkQueueEvent } from './WorkQueue.ts';\nimport { createWorkQueue } from './WorkQueue.ts';\n\ninterface SubsequentIncrementalExecutionResultContext {\n pending: Array;\n incremental: Array;\n completed: Array;\n hasNext: boolean;\n}\n\n/** @internal */\nexport class IncrementalPublisher {\n private _ids: Map;\n private _nextId: number;\n\n constructor() {\n this._ids = new Map();\n this._nextId = 0;\n }\n\n buildResponse(\n data: ObjMap,\n errors: ReadonlyArray,\n work: IncrementalWork,\n abortSignal: AbortSignal | undefined,\n onFinished: () => void,\n ): ExperimentalIncrementalExecutionResults {\n const { initialGroups, initialStreams, events } = createWorkQueue<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >(work);\n\n function abort(): void {\n subsequentResults.throw(abortSignal?.reason).catch(() => {\n // Ignore errors\n });\n }\n\n if (abortSignal) {\n abortSignal.addEventListener('abort', abort);\n }\n const onWorkQueueFinished = () => {\n onFinished();\n abortSignal?.removeEventListener('abort', abort);\n };\n\n const pending = this._toPendingResults(initialGroups, initialStreams);\n\n const initialResult: InitialIncrementalExecutionResult = errors.length\n ? { errors, data, pending, hasNext: true }\n : { data, pending, hasNext: true };\n\n const subsequentResults = withConcurrentAbruptClose(\n mapAsyncIterable(events, (batch) =>\n this._handleBatch(batch, onWorkQueueFinished),\n ),\n () => onWorkQueueFinished(),\n );\n\n return {\n initialResult,\n subsequentResults,\n };\n }\n\n private _ensureId(\n deferredFragmentOrStream: DeliveryGroup | ItemStream,\n ): string {\n let id = this._ids.get(deferredFragmentOrStream);\n if (id !== undefined) {\n return id;\n }\n id = String(this._nextId++);\n this._ids.set(deferredFragmentOrStream, id);\n return id;\n }\n\n private _toPendingResults(\n newGroups: ReadonlyArray,\n newStreams: ReadonlyArray,\n ): Array {\n const pendingResults: Array = [];\n for (const collection of [newGroups, newStreams]) {\n for (const node of collection) {\n const id = this._ensureId(node);\n const pendingResult: PendingResult = {\n id,\n path: pathToArray(node.path),\n };\n if (node.label !== undefined) {\n pendingResult.label = node.label;\n }\n pendingResults.push(pendingResult);\n }\n }\n return pendingResults;\n }\n\n private _handleBatch(\n batch: ReadonlyArray<\n WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >\n >,\n onWorkQueueFinished: (() => void) | undefined,\n ): SubsequentIncrementalExecutionResult {\n const context: SubsequentIncrementalExecutionResultContext = {\n pending: [],\n incremental: [],\n completed: [],\n hasNext: true,\n };\n\n for (const event of batch) {\n this._handleWorkQueueEvent(event, context, onWorkQueueFinished);\n }\n\n const { incremental, completed, pending, hasNext } = context;\n\n const result: SubsequentIncrementalExecutionResult = { hasNext };\n if (pending.length > 0) {\n result.pending = pending;\n }\n if (incremental.length > 0) {\n result.incremental = incremental;\n }\n if (completed.length > 0) {\n result.completed = completed;\n }\n\n return result;\n }\n\n private _handleWorkQueueEvent(\n event: WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >,\n context: SubsequentIncrementalExecutionResultContext,\n onWorkQueueFinished: (() => void) | undefined,\n ): void {\n switch (event.kind) {\n case 'GROUP_VALUES': {\n const group = event.group;\n const id = this._ensureId(group);\n for (const value of event.values) {\n const { bestId, subPath } = this._getBestIdAndSubPath(\n id,\n group,\n value,\n );\n const incrementalEntry: IncrementalDeferResult = {\n id: bestId,\n data: value.data,\n };\n if (value.errors !== undefined) {\n incrementalEntry.errors = value.errors;\n }\n if (subPath !== undefined) {\n incrementalEntry.subPath = subPath;\n }\n context.incremental.push(incrementalEntry);\n }\n break;\n }\n case 'GROUP_SUCCESS': {\n const group = event.group;\n const id = this._ensureId(group);\n context.completed.push({ id });\n this._ids.delete(group);\n if (event.newGroups.length > 0 || event.newStreams.length > 0) {\n context.pending.push(\n ...this._toPendingResults(event.newGroups, event.newStreams),\n );\n }\n break;\n }\n case 'GROUP_FAILURE': {\n const { group, error } = event;\n const id = this._ensureId(group);\n context.completed.push({\n id,\n errors: [ensureGraphQLError(error)],\n });\n this._ids.delete(group);\n break;\n }\n case 'STREAM_VALUES': {\n const stream = event.stream;\n const id = this._ensureId(stream);\n const { values, newGroups, newStreams } = event;\n const items: Array = [];\n const errors: Array = [];\n for (const value of values) {\n items.push(value.item);\n if (value.errors !== undefined) {\n errors.push(...value.errors);\n }\n }\n context.incremental.push(\n errors.length > 0 ? { id, items, errors } : { id, items },\n );\n if (newGroups.length > 0 || newStreams.length > 0) {\n context.pending.push(\n ...this._toPendingResults(newGroups, newStreams),\n );\n }\n break;\n }\n case 'STREAM_SUCCESS': {\n const stream = event.stream;\n context.completed.push({\n id: this._ensureId(stream),\n });\n this._ids.delete(stream);\n break;\n }\n case 'STREAM_FAILURE': {\n const stream = event.stream;\n context.completed.push({\n id: this._ensureId(stream),\n errors: [ensureGraphQLError(event.error)],\n });\n this._ids.delete(stream);\n break;\n }\n case 'WORK_QUEUE_TERMINATION': {\n onWorkQueueFinished?.();\n context.hasNext = false;\n break;\n }\n }\n }\n\n private _getBestIdAndSubPath(\n initialId: string,\n initialDeferredFragmentRecord: DeliveryGroup,\n executionGroupValue: ExecutionGroupValue,\n ): { bestId: string; subPath: ReadonlyArray | undefined } {\n let maxLength = pathToArray(initialDeferredFragmentRecord.path).length;\n let bestId = initialId;\n\n for (const deliveryGroup of executionGroupValue.deliveryGroups) {\n if (deliveryGroup === initialDeferredFragmentRecord) {\n continue;\n }\n const id = this._ids.get(deliveryGroup);\n // TODO: Investigate why there is no coverage gap using node native test coverage.\n if (id === undefined) {\n continue;\n }\n const path = pathToArray(deliveryGroup.path);\n const length = path.length;\n if (length > maxLength) {\n maxLength = length;\n bestId = id;\n }\n }\n const subPath = executionGroupValue.path.slice(maxLength);\n return {\n bestId,\n subPath: subPath.length > 0 ? subPath : undefined,\n };\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.mts new file mode 100644 index 00000000..faedc407 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.mts @@ -0,0 +1,86 @@ +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.mjs"; +interface QueueExecutorOptions { + push: (item: PromiseOrValue) => PromiseOrValue; + stop: (reason?: unknown) => PromiseOrValue; + onStop: (cleanup: (reason?: unknown) => PromiseOrValue) => void; + started: Promise; +} +/** + * A Queue is a lightweight async-generator primitive inspired by Brian Kim's + * Repeater (https://repeater.js.org, https://github.com/repeaterjs/repeater). + * The ergonomics are similar, but this implementation favors clarity over + * performance and gives producers flexibility to remain lazy, become eager, or + * live somewhere in between. + * + * The constructor takes an executor function and an optional `initialCapacity`. + * Executors receive `{ push, stop, onStop, started }` and may return `void` or + * a promise if they perform asynchronous setup. They call `push` whenever + * another item is ready, call `stop` when no more values will be produced + * (optionally supplying an error), register stop-time cleanup via `onStop`, + * and await `started` when setup should run only after iteration begins. + * Because `push`, `stop`, and `onStop` are plain functions, executors can + * hoist them into outside scopes or pass them to helpers. If the executor + * throws or its returned promise rejects, the queue treats it as `stop(error)` + * and propagates the failure. + * + * The `initialCapacity` argument (default `1`) governs backpressure. Capacity + * is the maximum number of buffered items allowed before a push must wait. + * When the backlog reaches capacity, `push` returns a promise that settles + * once consumption releases space; otherwise it returns `undefined`. Setting + * capacity to `1` yields a fully lazy queue (every push waits unless a prior + * item has been consumed); higher capacities buffer that many items eagerly. + * Capacity can be changed later via `setCapacity` and observed via + * `getCapacity`. + * + * `subscribe(reducer)` returns an async generator whose batches feed a generator + * of settled values into the reducer; whatever the reducer returns (other than + * `undefined`) becomes the yielded value for that batch. Calling `return()` on + * the subscription settles pending `next` calls thanks to `withConcurrent`, + * providing direct abort semantics rather than leaving `next()` suspended. + * + * 'forEachBatch(reducer)` is a convenience method that subscribes with the + * given reducer and runs it for each batch until the queue stops. + * + * Producers can stay lazy by awaiting `started`, using zero capacity, and + * awaiting each `push`. Skipping those waits while raising capacity makes the + * queue eager up to its configured limit. The `isStopped()` helper exposes + * whether the queue has fully stopped, which can be useful when the reducer + * function actually performs external work and wants to bail early without + * awaiting another `next`. + * + * @internal + */ +export declare class Queue { + private _capacity; + private _backlog; + private _waiters; + private _entries; + private _isStopped; + private _stopRequested; + private _stopCleanupCallbacks; + private _stopCompletion; + private _batchRequests; + private _resolveStarted; + constructor(executor: ({ push, stop, onStop, started, }: QueueExecutorOptions) => PromiseOrValue, initialCapacity?: number); + subscribe(reducer?: (generator: Generator) => PromiseOrValue): AsyncGenerator; + cancel(): PromiseOrValue; + abort(reason?: unknown): PromiseOrValue; + forEachBatch(reducer: (generator: Generator) => PromiseOrValue): Promise; + setCapacity(nextCapacity: number): void; + getCapacity(): number; + isStopped(): boolean; + private _normalizeCapacity; + private _flush; + private _reserve; + private _release; + private _onStop; + private _runStopCleanup; + private _iteratorLoop; + private _waitForNextBatch; + private _push; + private _terminate; + private _stop; + private _deliverBatchIfReady; + private _drainBatch; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.ts new file mode 100644 index 00000000..450c6721 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.d.ts @@ -0,0 +1,86 @@ +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.js"; +interface QueueExecutorOptions { + push: (item: PromiseOrValue) => PromiseOrValue; + stop: (reason?: unknown) => PromiseOrValue; + onStop: (cleanup: (reason?: unknown) => PromiseOrValue) => void; + started: Promise; +} +/** + * A Queue is a lightweight async-generator primitive inspired by Brian Kim's + * Repeater (https://repeater.js.org, https://github.com/repeaterjs/repeater). + * The ergonomics are similar, but this implementation favors clarity over + * performance and gives producers flexibility to remain lazy, become eager, or + * live somewhere in between. + * + * The constructor takes an executor function and an optional `initialCapacity`. + * Executors receive `{ push, stop, onStop, started }` and may return `void` or + * a promise if they perform asynchronous setup. They call `push` whenever + * another item is ready, call `stop` when no more values will be produced + * (optionally supplying an error), register stop-time cleanup via `onStop`, + * and await `started` when setup should run only after iteration begins. + * Because `push`, `stop`, and `onStop` are plain functions, executors can + * hoist them into outside scopes or pass them to helpers. If the executor + * throws or its returned promise rejects, the queue treats it as `stop(error)` + * and propagates the failure. + * + * The `initialCapacity` argument (default `1`) governs backpressure. Capacity + * is the maximum number of buffered items allowed before a push must wait. + * When the backlog reaches capacity, `push` returns a promise that settles + * once consumption releases space; otherwise it returns `undefined`. Setting + * capacity to `1` yields a fully lazy queue (every push waits unless a prior + * item has been consumed); higher capacities buffer that many items eagerly. + * Capacity can be changed later via `setCapacity` and observed via + * `getCapacity`. + * + * `subscribe(reducer)` returns an async generator whose batches feed a generator + * of settled values into the reducer; whatever the reducer returns (other than + * `undefined`) becomes the yielded value for that batch. Calling `return()` on + * the subscription settles pending `next` calls thanks to `withConcurrent`, + * providing direct abort semantics rather than leaving `next()` suspended. + * + * 'forEachBatch(reducer)` is a convenience method that subscribes with the + * given reducer and runs it for each batch until the queue stops. + * + * Producers can stay lazy by awaiting `started`, using zero capacity, and + * awaiting each `push`. Skipping those waits while raising capacity makes the + * queue eager up to its configured limit. The `isStopped()` helper exposes + * whether the queue has fully stopped, which can be useful when the reducer + * function actually performs external work and wants to bail early without + * awaiting another `next`. + * + * @internal + */ +export declare class Queue { + private _capacity; + private _backlog; + private _waiters; + private _entries; + private _isStopped; + private _stopRequested; + private _stopCleanupCallbacks; + private _stopCompletion; + private _batchRequests; + private _resolveStarted; + constructor(executor: ({ push, stop, onStop, started, }: QueueExecutorOptions) => PromiseOrValue, initialCapacity?: number); + subscribe(reducer?: (generator: Generator) => PromiseOrValue): AsyncGenerator; + cancel(): PromiseOrValue; + abort(reason?: unknown): PromiseOrValue; + forEachBatch(reducer: (generator: Generator) => PromiseOrValue): Promise; + setCapacity(nextCapacity: number): void; + getCapacity(): number; + isStopped(): boolean; + private _normalizeCapacity; + private _flush; + private _reserve; + private _release; + private _onStop; + private _runStopCleanup; + private _iteratorLoop; + private _waitForNextBatch; + private _push; + private _terminate; + private _stop; + private _deliverBatchIfReady; + private _drainBatch; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js new file mode 100644 index 00000000..58533b42 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js @@ -0,0 +1,273 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Queue = void 0; +const invariant_ts_1 = require("../../jsutils/invariant.js"); +const isPromise_ts_1 = require("../../jsutils/isPromise.js"); +const promiseWithResolvers_ts_1 = require("../../jsutils/promiseWithResolvers.js"); +const withConcurrentAbruptClose_ts_1 = require("../withConcurrentAbruptClose.js"); +class Queue { + constructor(executor, initialCapacity = 1) { + this._backlog = 0; + this._waiters = []; + this._entries = []; + this._isStopped = false; + this._stopRequested = false; + this._stopCleanupCallbacks = []; + this._batchRequests = new Set(); + this._capacity = this._normalizeCapacity(initialCapacity); + const { promise: started, resolve: resolveStarted } = (0, promiseWithResolvers_ts_1.promiseWithResolvers)(); + this._resolveStarted = resolveStarted; + try { + const result = executor({ + push: this._push.bind(this), + stop: this._stop.bind(this), + onStop: this._onStop.bind(this), + started, + }); + if ((0, isPromise_ts_1.isPromise)(result)) { + result.catch(this._stop.bind(this)); + } + } + catch (error) { + const stopped = this._stop(error); + if ((0, isPromise_ts_1.isPromise)(stopped)) { + stopped.catch(() => undefined); + } + } + } + subscribe(reducer = (generator) => Array.from(generator)) { + const generator = this._iteratorLoop(reducer); + return (0, withConcurrentAbruptClose_ts_1.withConcurrentAbruptClose)(generator, () => this.cancel(), this.abort.bind(this)); + } + cancel() { + if (this._stopRequested) { + return this._stopCompletion; + } + return this._terminate(undefined, () => { + this._isStopped = true; + this._batchRequests.forEach((request) => request.resolve(undefined)); + this._batchRequests.clear(); + }); + } + abort(reason) { + if (this._stopRequested) { + return this._stopCompletion; + } + return this._terminate(reason, () => { + this._isStopped = true; + if (this._batchRequests.size) { + this._batchRequests.forEach((request) => request.reject(reason)); + this._batchRequests.clear(); + return; + } + this._entries.push({ + kind: 'item', + settled: { status: 'rejected', reason }, + }); + }); + } + async forEachBatch(reducer) { + const sub = this.subscribe(async (generator) => { + const { promise: drained, resolve } = (0, promiseWithResolvers_ts_1.promiseWithResolvers)(); + const wrappedBatch = (function* wrapper() { + yield* generator; + resolve(); + })(); + await Promise.all([reducer(wrappedBatch), drained]); + }); + for await (const _ of sub) { + } + } + setCapacity(nextCapacity) { + this._capacity = this._normalizeCapacity(nextCapacity); + this._flush(); + } + getCapacity() { + return this._capacity; + } + isStopped() { + return this._isStopped; + } + _normalizeCapacity(capacity) { + return Math.max(1, Math.floor(capacity)); + } + _flush() { + while (this._waiters.length > 0 && this._backlog < this._capacity) { + this._waiters.shift()?.(); + } + } + _reserve() { + this._backlog += 1; + if (this._backlog < this._capacity) { + return undefined; + } + const { promise, resolve } = (0, promiseWithResolvers_ts_1.promiseWithResolvers)(); + this._waiters.push(resolve); + return promise; + } + _release() { + if (this._backlog > 0) { + this._backlog -= 1; + } + this._flush(); + } + _onStop(cleanup) { + if (this._stopRequested) { + throw new Error('Cannot register onStop cleanup after stop has been requested.'); + } + this._stopCleanupCallbacks.push(cleanup); + } + _runStopCleanup(reason, afterCleanup) { + this._stopRequested = true; + const cleanupPromises = this._stopCleanupCallbacks.flatMap((cleanupCallback) => { + try { + const result = cleanupCallback(reason); + return (0, isPromise_ts_1.isPromise)(result) ? [result] : []; + } + catch { + return []; + } + }); + const cleanup = cleanupPromises.length > 0 + ? Promise.allSettled(cleanupPromises).then(() => undefined) + : undefined; + if ((0, isPromise_ts_1.isPromise)(cleanup)) { + this._stopCompletion = cleanup + .then(afterCleanup, afterCleanup) + .then(() => undefined); + return this._stopCompletion; + } + afterCleanup(); + } + async *_iteratorLoop(reducer) { + this._resolveStarted(); + let nextBatch; + while ((nextBatch = await this._waitForNextBatch())) { + let reduced = reducer(nextBatch); + if ((0, isPromise_ts_1.isPromise)(reduced)) { + reduced = await reduced; + } + if (reduced === undefined) { + continue; + } + yield reduced; + } + } + _waitForNextBatch() { + const { promise, resolve, reject } = (0, promiseWithResolvers_ts_1.promiseWithResolvers)(); + this._batchRequests.add({ resolve, reject }); + this._deliverBatchIfReady(); + return promise; + } + _push(item) { + if (this._stopRequested) { + return; + } + const maybePushPromise = this._reserve(); + if ((0, isPromise_ts_1.isPromise)(item)) { + const entry = { kind: 'item' }; + this._entries.push(entry); + item.then((resolved) => { + entry.settled = { status: 'fulfilled', value: resolved }; + this._deliverBatchIfReady(); + }, (reason) => { + entry.settled = { status: 'rejected', reason }; + this._deliverBatchIfReady(); + }); + } + else { + this._entries.push({ + kind: 'item', + settled: { status: 'fulfilled', value: item }, + }); + this._deliverBatchIfReady(); + } + return maybePushPromise; + } + _terminate(reason, afterCleanup) { + for (const entry of this._entries) { + if (entry.kind === 'item') { + this._release(); + } + } + this._entries.length = 0; + return this._runStopCleanup(reason, afterCleanup); + } + _stop(reason) { + if (this._stopRequested) { + return this._stopCompletion; + } + const stopCompletion = this._runStopCleanup(reason, () => { + if (reason === undefined) { + if (this._entries.length === 0) { + this._isStopped = true; + this._deliverBatchIfReady(); + return; + } + this._entries.push({ kind: 'stop' }); + this._deliverBatchIfReady(); + return; + } + this._entries.push({ + kind: 'item', + settled: { status: 'rejected', reason }, + }); + this._entries.push({ kind: 'stop' }); + this._deliverBatchIfReady(); + }); + if ((0, isPromise_ts_1.isPromise)(stopCompletion)) { + stopCompletion.catch(() => undefined); + } + return stopCompletion; + } + _deliverBatchIfReady() { + if (!this._batchRequests.size) { + return; + } + const headEntry = this._entries[0]; + const requests = this._batchRequests; + if (headEntry !== undefined) { + if (!(headEntry.kind !== 'stop')) + (0, invariant_ts_1.invariant)(false); + const settled = headEntry.settled; + if (settled !== undefined) { + if (settled.status === 'fulfilled') { + this._batchRequests = new Set(); + requests.forEach((request) => request.resolve(this._drainBatch())); + return; + } + this._entries.shift(); + this._release(); + this._isStopped = true; + this._batchRequests = new Set(); + requests.forEach((request) => request.reject(settled.reason)); + } + } + else if (this._isStopped) { + this._batchRequests = new Set(); + requests.forEach((request) => request.resolve(undefined)); + } + } + *_drainBatch() { + while (true) { + const entry = this._entries[0]; + if (entry === undefined) { + return; + } + if (entry.kind === 'stop') { + this._isStopped = true; + this._entries.shift(); + return; + } + const settled = entry.settled; + if (settled === undefined || settled.status === 'rejected') { + return; + } + this._entries.shift(); + this._release(); + yield settled.value; + } + } +} +exports.Queue = Queue; +//# sourceMappingURL=Queue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js.map new file mode 100644 index 00000000..0e489f4d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Queue.js","sourceRoot":"","sources":["../../../src/execution/incremental/Queue.ts"],"names":[],"mappings":";;;AAAA,6DAAuD;AACvD,6DAAuD;AAEvD,mFAA6E;AAE7E,kFAA4E;AA0E5E,MAAa,KAAK;IAehB,YACE,QAKmD,EACnD,eAAe,GAAG,CAAC;QApBb,aAAQ,GAAG,CAAC,CAAC;QACb,aAAQ,GAAsB,EAAE,CAAC;QACjC,aAAQ,GAAoB,EAAE,CAAC;QAC/B,eAAU,GAAG,KAAK,CAAC;QACnB,mBAAc,GAAG,KAAK,CAAC;QACvB,0BAAqB,GAEzB,EAAE,CAAC;QAEC,mBAAc,GAAG,IAAI,GAAG,EAAmB,CAAC;QAalD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;QAE1D,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,GAEjD,IAAA,8CAAoB,GAAQ,CAAC;QAE/B,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QAEtC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC;gBACtB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC3B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC3B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/B,OAAO;aACR,CAAC,CAAC;YACH,IAAI,IAAA,wBAAS,EAAC,MAAM,CAAC,EAAE,CAAC;gBACtB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAA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AAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAEO,CAAC,WAAW;QAClB,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO;YACT,CAAC;YACD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACtB,OAAO;YACT,CAAC;YACD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;YAC9B,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC3D,OAAO;YACT,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,MAAM,OAAO,CAAC,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;CACF;AA7VD,sBA6VC","sourcesContent":["import { invariant } from '../../jsutils/invariant.ts';\nimport { isPromise } from '../../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\nimport { promiseWithResolvers } from '../../jsutils/promiseWithResolvers.ts';\n\nimport { withConcurrentAbruptClose } from '../withConcurrentAbruptClose.ts';\n\ntype Settled =\n | { status: 'fulfilled'; value: T }\n | { status: 'rejected'; reason: unknown };\n\ninterface ItemEntry {\n kind: 'item';\n settled?: Settled;\n}\n\ninterface StopEntry {\n kind: 'stop';\n}\n\ntype Entry = ItemEntry | StopEntry;\n\ninterface BatchRequest {\n resolve: (generator: Generator | undefined) => void;\n reject: (reason: unknown) => void;\n}\n\ninterface QueueExecutorOptions {\n push: (item: PromiseOrValue) => PromiseOrValue;\n stop: (reason?: unknown) => PromiseOrValue;\n onStop: (cleanup: (reason?: unknown) => PromiseOrValue) => void;\n started: Promise;\n}\n\n/**\n * A Queue is a lightweight async-generator primitive inspired by Brian Kim's\n * Repeater (https://repeater.js.org, https://github.com/repeaterjs/repeater).\n * The ergonomics are similar, but this implementation favors clarity over\n * performance and gives producers flexibility to remain lazy, become eager, or\n * live somewhere in between.\n *\n * The constructor takes an executor function and an optional `initialCapacity`.\n * Executors receive `{ push, stop, onStop, started }` and may return `void` or\n * a promise if they perform asynchronous setup. They call `push` whenever\n * another item is ready, call `stop` when no more values will be produced\n * (optionally supplying an error), register stop-time cleanup via `onStop`,\n * and await `started` when setup should run only after iteration begins.\n * Because `push`, `stop`, and `onStop` are plain functions, executors can\n * hoist them into outside scopes or pass them to helpers. If the executor\n * throws or its returned promise rejects, the queue treats it as `stop(error)`\n * and propagates the failure.\n *\n * The `initialCapacity` argument (default `1`) governs backpressure. Capacity\n * is the maximum number of buffered items allowed before a push must wait.\n * When the backlog reaches capacity, `push` returns a promise that settles\n * once consumption releases space; otherwise it returns `undefined`. Setting\n * capacity to `1` yields a fully lazy queue (every push waits unless a prior\n * item has been consumed); higher capacities buffer that many items eagerly.\n * Capacity can be changed later via `setCapacity` and observed via\n * `getCapacity`.\n *\n * `subscribe(reducer)` returns an async generator whose batches feed a generator\n * of settled values into the reducer; whatever the reducer returns (other than\n * `undefined`) becomes the yielded value for that batch. Calling `return()` on\n * the subscription settles pending `next` calls thanks to `withConcurrent`,\n * providing direct abort semantics rather than leaving `next()` suspended.\n *\n * 'forEachBatch(reducer)` is a convenience method that subscribes with the\n * given reducer and runs it for each batch until the queue stops.\n *\n * Producers can stay lazy by awaiting `started`, using zero capacity, and\n * awaiting each `push`. Skipping those waits while raising capacity makes the\n * queue eager up to its configured limit. The `isStopped()` helper exposes\n * whether the queue has fully stopped, which can be useful when the reducer\n * function actually performs external work and wants to bail early without\n * awaiting another `next`.\n *\n * @internal\n */\nexport class Queue {\n private _capacity: number;\n private _backlog = 0;\n private _waiters: Array<() => void> = [];\n private _entries: Array> = [];\n private _isStopped = false;\n private _stopRequested = false;\n private _stopCleanupCallbacks: Array<\n (reason?: unknown) => PromiseOrValue\n > = [];\n private _stopCompletion: Promise | undefined;\n private _batchRequests = new Set>();\n\n private _resolveStarted: () => void;\n\n constructor(\n executor: ({\n push,\n stop,\n onStop,\n started,\n }: QueueExecutorOptions) => PromiseOrValue,\n initialCapacity = 1,\n ) {\n this._capacity = this._normalizeCapacity(initialCapacity);\n\n const { promise: started, resolve: resolveStarted } =\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n promiseWithResolvers();\n\n this._resolveStarted = resolveStarted;\n\n try {\n const result = executor({\n push: this._push.bind(this),\n stop: this._stop.bind(this),\n onStop: this._onStop.bind(this),\n started,\n });\n if (isPromise(result)) {\n result.catch(this._stop.bind(this));\n }\n } catch (error) {\n const stopped = this._stop(error);\n if (isPromise(stopped)) {\n /* node:coverage ignore next */\n stopped.catch(() => undefined);\n }\n }\n }\n\n subscribe(\n reducer: (\n generator: Generator,\n ) => PromiseOrValue = (generator) =>\n Array.from(generator) as U,\n ): AsyncGenerator {\n const generator = this._iteratorLoop(reducer);\n return withConcurrentAbruptClose(\n generator,\n () => this.cancel(),\n this.abort.bind(this),\n );\n }\n\n cancel(): PromiseOrValue {\n if (this._stopRequested) {\n return this._stopCompletion;\n }\n return this._terminate(undefined, () => {\n this._isStopped = true;\n this._batchRequests.forEach((request) => request.resolve(undefined));\n this._batchRequests.clear();\n });\n }\n\n abort(reason?: unknown): PromiseOrValue {\n if (this._stopRequested) {\n return this._stopCompletion;\n }\n return this._terminate(reason, () => {\n this._isStopped = true;\n if (this._batchRequests.size) {\n this._batchRequests.forEach((request) => request.reject(reason));\n this._batchRequests.clear();\n return;\n }\n // save rejection for later batch requests\n this._entries.push({\n kind: 'item',\n settled: { status: 'rejected', reason },\n });\n });\n }\n\n async forEachBatch(\n reducer: (generator: Generator) => PromiseOrValue,\n ): Promise {\n const sub = this.subscribe(async (generator) => {\n const { promise: drained, resolve } =\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n promiseWithResolvers();\n\n const wrappedBatch = (function* wrapper(): Generator {\n yield* generator;\n resolve();\n })();\n\n await Promise.all([reducer(wrappedBatch), drained]);\n });\n\n // Empty loop body is intentionally used to drain the subscription.\n /* node:coverage ignore next 3 */\n for await (const _ of sub) {\n // intentionally empty\n }\n }\n\n setCapacity(nextCapacity: number): void {\n this._capacity = this._normalizeCapacity(nextCapacity);\n this._flush();\n }\n\n getCapacity(): number {\n return this._capacity;\n }\n\n isStopped(): boolean {\n return this._isStopped;\n }\n\n private _normalizeCapacity(capacity: number): number {\n return Math.max(1, Math.floor(capacity));\n }\n\n private _flush(): void {\n while (this._waiters.length > 0 && this._backlog < this._capacity) {\n this._waiters.shift()?.();\n }\n }\n\n private _reserve(): PromiseOrValue {\n this._backlog += 1;\n if (this._backlog < this._capacity) {\n return undefined;\n }\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n const { promise, resolve } = promiseWithResolvers();\n this._waiters.push(resolve);\n return promise;\n }\n\n private _release(): void {\n if (this._backlog > 0) {\n this._backlog -= 1;\n }\n this._flush();\n }\n\n private _onStop(cleanup: (reason?: unknown) => PromiseOrValue): void {\n if (this._stopRequested) {\n throw new Error(\n 'Cannot register onStop cleanup after stop has been requested.',\n );\n }\n this._stopCleanupCallbacks.push(cleanup);\n }\n\n private _runStopCleanup(\n reason: unknown,\n afterCleanup: () => void,\n ): PromiseOrValue {\n this._stopRequested = true;\n const cleanupPromises = this._stopCleanupCallbacks.flatMap(\n (cleanupCallback): Array> => {\n try {\n const result = cleanupCallback(reason);\n return isPromise(result) ? [result] : [];\n } catch {\n // ignore errors\n return [];\n }\n },\n );\n const cleanup =\n cleanupPromises.length > 0\n ? Promise.allSettled(cleanupPromises).then(() => undefined)\n : undefined;\n if (isPromise(cleanup)) {\n this._stopCompletion = cleanup\n .then(afterCleanup, afterCleanup)\n .then(() => undefined);\n return this._stopCompletion;\n }\n afterCleanup();\n }\n\n private async *_iteratorLoop(\n reducer: (\n generator: Generator,\n ) => PromiseOrValue,\n ): AsyncGenerator {\n this._resolveStarted();\n let nextBatch: Generator | undefined;\n // eslint-disable-next-line no-await-in-loop\n while ((nextBatch = await this._waitForNextBatch())) {\n let reduced = reducer(nextBatch);\n if (isPromise(reduced)) {\n // eslint-disable-next-line no-await-in-loop\n reduced = await reduced;\n }\n if (reduced === undefined) {\n continue;\n }\n yield reduced;\n }\n }\n\n private _waitForNextBatch(): Promise | undefined> {\n const { promise, resolve, reject } = promiseWithResolvers<\n Generator | undefined\n >();\n this._batchRequests.add({ resolve, reject });\n this._deliverBatchIfReady();\n return promise;\n }\n\n private _push(item: PromiseOrValue): PromiseOrValue {\n if (this._stopRequested) {\n return;\n }\n const maybePushPromise = this._reserve();\n if (isPromise(item)) {\n const entry: ItemEntry = { kind: 'item' };\n this._entries.push(entry);\n item.then(\n (resolved) => {\n entry.settled = { status: 'fulfilled', value: resolved };\n this._deliverBatchIfReady();\n },\n (reason: unknown) => {\n entry.settled = { status: 'rejected', reason };\n this._deliverBatchIfReady();\n },\n );\n } else {\n this._entries.push({\n kind: 'item',\n settled: { status: 'fulfilled', value: item },\n });\n this._deliverBatchIfReady();\n }\n return maybePushPromise;\n }\n\n private _terminate(\n reason: unknown,\n afterCleanup: () => void,\n ): PromiseOrValue {\n for (const entry of this._entries) {\n if (entry.kind === 'item') {\n this._release();\n }\n }\n this._entries.length = 0;\n return this._runStopCleanup(reason, afterCleanup);\n }\n\n private _stop(reason?: unknown): PromiseOrValue {\n if (this._stopRequested) {\n return this._stopCompletion;\n }\n const stopCompletion = this._runStopCleanup(reason, () => {\n if (reason === undefined) {\n if (this._entries.length === 0) {\n this._isStopped = true;\n this._deliverBatchIfReady();\n return;\n }\n\n this._entries.push({ kind: 'stop' });\n this._deliverBatchIfReady();\n return;\n }\n\n this._entries.push({\n kind: 'item',\n settled: { status: 'rejected', reason },\n });\n this._entries.push({ kind: 'stop' });\n this._deliverBatchIfReady();\n });\n\n if (isPromise(stopCompletion)) {\n /* node:coverage ignore next */\n stopCompletion.catch(() => undefined);\n }\n return stopCompletion;\n }\n\n private _deliverBatchIfReady(): void {\n if (!this._batchRequests.size) {\n return;\n }\n const headEntry = this._entries[0];\n const requests = this._batchRequests;\n if (headEntry !== undefined) {\n // stop sentinel always follows other work\n invariant(headEntry.kind !== 'stop');\n\n const settled = headEntry.settled;\n if (settled !== undefined) {\n if (settled.status === 'fulfilled') {\n this._batchRequests = new Set();\n requests.forEach((request) => request.resolve(this._drainBatch()));\n return;\n }\n this._entries.shift();\n this._release();\n this._isStopped = true;\n this._batchRequests = new Set();\n requests.forEach((request) => request.reject(settled.reason));\n }\n } else if (this._isStopped) {\n this._batchRequests = new Set();\n requests.forEach((request) => request.resolve(undefined));\n }\n }\n\n private *_drainBatch(): Generator {\n while (true) {\n const entry = this._entries[0];\n if (entry === undefined) {\n return;\n }\n if (entry.kind === 'stop') {\n this._isStopped = true;\n this._entries.shift();\n return;\n }\n const settled = entry.settled;\n if (settled === undefined || settled.status === 'rejected') {\n return;\n }\n this._entries.shift();\n this._release();\n yield settled.value;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs new file mode 100644 index 00000000..4437dac4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs @@ -0,0 +1,269 @@ +import { invariant } from "../../jsutils/invariant.mjs"; +import { isPromise } from "../../jsutils/isPromise.mjs"; +import { promiseWithResolvers } from "../../jsutils/promiseWithResolvers.mjs"; +import { withConcurrentAbruptClose } from "../withConcurrentAbruptClose.mjs"; +export class Queue { + constructor(executor, initialCapacity = 1) { + this._backlog = 0; + this._waiters = []; + this._entries = []; + this._isStopped = false; + this._stopRequested = false; + this._stopCleanupCallbacks = []; + this._batchRequests = new Set(); + this._capacity = this._normalizeCapacity(initialCapacity); + const { promise: started, resolve: resolveStarted } = promiseWithResolvers(); + this._resolveStarted = resolveStarted; + try { + const result = executor({ + push: this._push.bind(this), + stop: this._stop.bind(this), + onStop: this._onStop.bind(this), + started, + }); + if (isPromise(result)) { + result.catch(this._stop.bind(this)); + } + } + catch (error) { + const stopped = this._stop(error); + if (isPromise(stopped)) { + stopped.catch(() => undefined); + } + } + } + subscribe(reducer = (generator) => Array.from(generator)) { + const generator = this._iteratorLoop(reducer); + return withConcurrentAbruptClose(generator, () => this.cancel(), this.abort.bind(this)); + } + cancel() { + if (this._stopRequested) { + return this._stopCompletion; + } + return this._terminate(undefined, () => { + this._isStopped = true; + this._batchRequests.forEach((request) => request.resolve(undefined)); + this._batchRequests.clear(); + }); + } + abort(reason) { + if (this._stopRequested) { + return this._stopCompletion; + } + return this._terminate(reason, () => { + this._isStopped = true; + if (this._batchRequests.size) { + this._batchRequests.forEach((request) => request.reject(reason)); + this._batchRequests.clear(); + return; + } + this._entries.push({ + kind: 'item', + settled: { status: 'rejected', reason }, + }); + }); + } + async forEachBatch(reducer) { + const sub = this.subscribe(async (generator) => { + const { promise: drained, resolve } = promiseWithResolvers(); + const wrappedBatch = (function* wrapper() { + yield* generator; + resolve(); + })(); + await Promise.all([reducer(wrappedBatch), drained]); + }); + for await (const _ of sub) { + } + } + setCapacity(nextCapacity) { + this._capacity = this._normalizeCapacity(nextCapacity); + this._flush(); + } + getCapacity() { + return this._capacity; + } + isStopped() { + return this._isStopped; + } + _normalizeCapacity(capacity) { + return Math.max(1, Math.floor(capacity)); + } + _flush() { + while (this._waiters.length > 0 && this._backlog < this._capacity) { + this._waiters.shift()?.(); + } + } + _reserve() { + this._backlog += 1; + if (this._backlog < this._capacity) { + return undefined; + } + const { promise, resolve } = promiseWithResolvers(); + this._waiters.push(resolve); + return promise; + } + _release() { + if (this._backlog > 0) { + this._backlog -= 1; + } + this._flush(); + } + _onStop(cleanup) { + if (this._stopRequested) { + throw new Error('Cannot register onStop cleanup after stop has been requested.'); + } + this._stopCleanupCallbacks.push(cleanup); + } + _runStopCleanup(reason, afterCleanup) { + this._stopRequested = true; + const cleanupPromises = this._stopCleanupCallbacks.flatMap((cleanupCallback) => { + try { + const result = cleanupCallback(reason); + return isPromise(result) ? [result] : []; + } + catch { + return []; + } + }); + const cleanup = cleanupPromises.length > 0 + ? Promise.allSettled(cleanupPromises).then(() => undefined) + : undefined; + if (isPromise(cleanup)) { + this._stopCompletion = cleanup + .then(afterCleanup, afterCleanup) + .then(() => undefined); + return this._stopCompletion; + } + afterCleanup(); + } + async *_iteratorLoop(reducer) { + this._resolveStarted(); + let nextBatch; + while ((nextBatch = await this._waitForNextBatch())) { + let reduced = reducer(nextBatch); + if (isPromise(reduced)) { + reduced = await reduced; + } + if (reduced === undefined) { + continue; + } + yield reduced; + } + } + _waitForNextBatch() { + const { promise, resolve, reject } = promiseWithResolvers(); + this._batchRequests.add({ resolve, reject }); + this._deliverBatchIfReady(); + return promise; + } + _push(item) { + if (this._stopRequested) { + return; + } + const maybePushPromise = this._reserve(); + if (isPromise(item)) { + const entry = { kind: 'item' }; + this._entries.push(entry); + item.then((resolved) => { + entry.settled = { status: 'fulfilled', value: resolved }; + this._deliverBatchIfReady(); + }, (reason) => { + entry.settled = { status: 'rejected', reason }; + this._deliverBatchIfReady(); + }); + } + else { + this._entries.push({ + kind: 'item', + settled: { status: 'fulfilled', value: item }, + }); + this._deliverBatchIfReady(); + } + return maybePushPromise; + } + _terminate(reason, afterCleanup) { + for (const entry of this._entries) { + if (entry.kind === 'item') { + this._release(); + } + } + this._entries.length = 0; + return this._runStopCleanup(reason, afterCleanup); + } + _stop(reason) { + if (this._stopRequested) { + return this._stopCompletion; + } + const stopCompletion = this._runStopCleanup(reason, () => { + if (reason === undefined) { + if (this._entries.length === 0) { + this._isStopped = true; + this._deliverBatchIfReady(); + return; + } + this._entries.push({ kind: 'stop' }); + this._deliverBatchIfReady(); + return; + } + this._entries.push({ + kind: 'item', + settled: { status: 'rejected', reason }, + }); + this._entries.push({ kind: 'stop' }); + this._deliverBatchIfReady(); + }); + if (isPromise(stopCompletion)) { + stopCompletion.catch(() => undefined); + } + return stopCompletion; + } + _deliverBatchIfReady() { + if (!this._batchRequests.size) { + return; + } + const headEntry = this._entries[0]; + const requests = this._batchRequests; + if (headEntry !== undefined) { + if (!(headEntry.kind !== 'stop')) + invariant(false); + const settled = headEntry.settled; + if (settled !== undefined) { + if (settled.status === 'fulfilled') { + this._batchRequests = new Set(); + requests.forEach((request) => request.resolve(this._drainBatch())); + return; + } + this._entries.shift(); + this._release(); + this._isStopped = true; + this._batchRequests = new Set(); + requests.forEach((request) => request.reject(settled.reason)); + } + } + else if (this._isStopped) { + this._batchRequests = new Set(); + requests.forEach((request) => request.resolve(undefined)); + } + } + *_drainBatch() { + while (true) { + const entry = this._entries[0]; + if (entry === undefined) { + return; + } + if (entry.kind === 'stop') { + this._isStopped = true; + this._entries.shift(); + return; + } + const settled = entry.settled; + if (settled === undefined || settled.status === 'rejected') { + return; + } + this._entries.shift(); + this._release(); + yield settled.value; + } + } +} +//# sourceMappingURL=Queue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs.map new file mode 100644 index 00000000..ba068bf1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/Queue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Queue.js","sourceRoot":"","sources":["../../../src/execution/incremental/Queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oCAAmC;AACvD,OAAO,EAAE,SAAS,EAAE,oCAAmC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,+CAA8C;AAE7E,OAAO,EAAE,yBAAyB,EAAE,yCAAwC;AA0E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I,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACtB,OAAO;YACT,CAAC;YACD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;YAC9B,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC3D,OAAO;YACT,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,MAAM,OAAO,CAAC,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;CACF","sourcesContent":["import { invariant } from '../../jsutils/invariant.ts';\nimport { isPromise } from '../../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\nimport { promiseWithResolvers } from '../../jsutils/promiseWithResolvers.ts';\n\nimport { withConcurrentAbruptClose } from '../withConcurrentAbruptClose.ts';\n\ntype Settled =\n | { status: 'fulfilled'; value: T }\n | { status: 'rejected'; reason: unknown };\n\ninterface ItemEntry {\n kind: 'item';\n settled?: Settled;\n}\n\ninterface StopEntry {\n kind: 'stop';\n}\n\ntype Entry = ItemEntry | StopEntry;\n\ninterface BatchRequest {\n resolve: (generator: Generator | undefined) => void;\n reject: (reason: unknown) => void;\n}\n\ninterface QueueExecutorOptions {\n push: (item: PromiseOrValue) => PromiseOrValue;\n stop: (reason?: unknown) => PromiseOrValue;\n onStop: (cleanup: (reason?: unknown) => PromiseOrValue) => void;\n started: Promise;\n}\n\n/**\n * A Queue is a lightweight async-generator primitive inspired by Brian Kim's\n * Repeater (https://repeater.js.org, https://github.com/repeaterjs/repeater).\n * The ergonomics are similar, but this implementation favors clarity over\n * performance and gives producers flexibility to remain lazy, become eager, or\n * live somewhere in between.\n *\n * The constructor takes an executor function and an optional `initialCapacity`.\n * Executors receive `{ push, stop, onStop, started }` and may return `void` or\n * a promise if they perform asynchronous setup. They call `push` whenever\n * another item is ready, call `stop` when no more values will be produced\n * (optionally supplying an error), register stop-time cleanup via `onStop`,\n * and await `started` when setup should run only after iteration begins.\n * Because `push`, `stop`, and `onStop` are plain functions, executors can\n * hoist them into outside scopes or pass them to helpers. If the executor\n * throws or its returned promise rejects, the queue treats it as `stop(error)`\n * and propagates the failure.\n *\n * The `initialCapacity` argument (default `1`) governs backpressure. Capacity\n * is the maximum number of buffered items allowed before a push must wait.\n * When the backlog reaches capacity, `push` returns a promise that settles\n * once consumption releases space; otherwise it returns `undefined`. Setting\n * capacity to `1` yields a fully lazy queue (every push waits unless a prior\n * item has been consumed); higher capacities buffer that many items eagerly.\n * Capacity can be changed later via `setCapacity` and observed via\n * `getCapacity`.\n *\n * `subscribe(reducer)` returns an async generator whose batches feed a generator\n * of settled values into the reducer; whatever the reducer returns (other than\n * `undefined`) becomes the yielded value for that batch. Calling `return()` on\n * the subscription settles pending `next` calls thanks to `withConcurrent`,\n * providing direct abort semantics rather than leaving `next()` suspended.\n *\n * 'forEachBatch(reducer)` is a convenience method that subscribes with the\n * given reducer and runs it for each batch until the queue stops.\n *\n * Producers can stay lazy by awaiting `started`, using zero capacity, and\n * awaiting each `push`. Skipping those waits while raising capacity makes the\n * queue eager up to its configured limit. The `isStopped()` helper exposes\n * whether the queue has fully stopped, which can be useful when the reducer\n * function actually performs external work and wants to bail early without\n * awaiting another `next`.\n *\n * @internal\n */\nexport class Queue {\n private _capacity: number;\n private _backlog = 0;\n private _waiters: Array<() => void> = [];\n private _entries: Array> = [];\n private _isStopped = false;\n private _stopRequested = false;\n private _stopCleanupCallbacks: Array<\n (reason?: unknown) => PromiseOrValue\n > = [];\n private _stopCompletion: Promise | undefined;\n private _batchRequests = new Set>();\n\n private _resolveStarted: () => void;\n\n constructor(\n executor: ({\n push,\n stop,\n onStop,\n started,\n }: QueueExecutorOptions) => PromiseOrValue,\n initialCapacity = 1,\n ) {\n this._capacity = this._normalizeCapacity(initialCapacity);\n\n const { promise: started, resolve: resolveStarted } =\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n promiseWithResolvers();\n\n this._resolveStarted = resolveStarted;\n\n try {\n const result = executor({\n push: this._push.bind(this),\n stop: this._stop.bind(this),\n onStop: this._onStop.bind(this),\n started,\n });\n if (isPromise(result)) {\n result.catch(this._stop.bind(this));\n }\n } catch (error) {\n const stopped = this._stop(error);\n if (isPromise(stopped)) {\n /* node:coverage ignore next */\n stopped.catch(() => undefined);\n }\n }\n }\n\n subscribe(\n reducer: (\n generator: Generator,\n ) => PromiseOrValue = (generator) =>\n Array.from(generator) as U,\n ): AsyncGenerator {\n const generator = this._iteratorLoop(reducer);\n return withConcurrentAbruptClose(\n generator,\n () => this.cancel(),\n this.abort.bind(this),\n );\n }\n\n cancel(): PromiseOrValue {\n if (this._stopRequested) {\n return this._stopCompletion;\n }\n return this._terminate(undefined, () => {\n this._isStopped = true;\n this._batchRequests.forEach((request) => request.resolve(undefined));\n this._batchRequests.clear();\n });\n }\n\n abort(reason?: unknown): PromiseOrValue {\n if (this._stopRequested) {\n return this._stopCompletion;\n }\n return this._terminate(reason, () => {\n this._isStopped = true;\n if (this._batchRequests.size) {\n this._batchRequests.forEach((request) => request.reject(reason));\n this._batchRequests.clear();\n return;\n }\n // save rejection for later batch requests\n this._entries.push({\n kind: 'item',\n settled: { status: 'rejected', reason },\n });\n });\n }\n\n async forEachBatch(\n reducer: (generator: Generator) => PromiseOrValue,\n ): Promise {\n const sub = this.subscribe(async (generator) => {\n const { promise: drained, resolve } =\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n promiseWithResolvers();\n\n const wrappedBatch = (function* wrapper(): Generator {\n yield* generator;\n resolve();\n })();\n\n await Promise.all([reducer(wrappedBatch), drained]);\n });\n\n // Empty loop body is intentionally used to drain the subscription.\n /* node:coverage ignore next 3 */\n for await (const _ of sub) {\n // intentionally empty\n }\n }\n\n setCapacity(nextCapacity: number): void {\n this._capacity = this._normalizeCapacity(nextCapacity);\n this._flush();\n }\n\n getCapacity(): number {\n return this._capacity;\n }\n\n isStopped(): boolean {\n return this._isStopped;\n }\n\n private _normalizeCapacity(capacity: number): number {\n return Math.max(1, Math.floor(capacity));\n }\n\n private _flush(): void {\n while (this._waiters.length > 0 && this._backlog < this._capacity) {\n this._waiters.shift()?.();\n }\n }\n\n private _reserve(): PromiseOrValue {\n this._backlog += 1;\n if (this._backlog < this._capacity) {\n return undefined;\n }\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n const { promise, resolve } = promiseWithResolvers();\n this._waiters.push(resolve);\n return promise;\n }\n\n private _release(): void {\n if (this._backlog > 0) {\n this._backlog -= 1;\n }\n this._flush();\n }\n\n private _onStop(cleanup: (reason?: unknown) => PromiseOrValue): void {\n if (this._stopRequested) {\n throw new Error(\n 'Cannot register onStop cleanup after stop has been requested.',\n );\n }\n this._stopCleanupCallbacks.push(cleanup);\n }\n\n private _runStopCleanup(\n reason: unknown,\n afterCleanup: () => void,\n ): PromiseOrValue {\n this._stopRequested = true;\n const cleanupPromises = this._stopCleanupCallbacks.flatMap(\n (cleanupCallback): Array> => {\n try {\n const result = cleanupCallback(reason);\n return isPromise(result) ? [result] : [];\n } catch {\n // ignore errors\n return [];\n }\n },\n );\n const cleanup =\n cleanupPromises.length > 0\n ? Promise.allSettled(cleanupPromises).then(() => undefined)\n : undefined;\n if (isPromise(cleanup)) {\n this._stopCompletion = cleanup\n .then(afterCleanup, afterCleanup)\n .then(() => undefined);\n return this._stopCompletion;\n }\n afterCleanup();\n }\n\n private async *_iteratorLoop(\n reducer: (\n generator: Generator,\n ) => PromiseOrValue,\n ): AsyncGenerator {\n this._resolveStarted();\n let nextBatch: Generator | undefined;\n // eslint-disable-next-line no-await-in-loop\n while ((nextBatch = await this._waitForNextBatch())) {\n let reduced = reducer(nextBatch);\n if (isPromise(reduced)) {\n // eslint-disable-next-line no-await-in-loop\n reduced = await reduced;\n }\n if (reduced === undefined) {\n continue;\n }\n yield reduced;\n }\n }\n\n private _waitForNextBatch(): Promise | undefined> {\n const { promise, resolve, reject } = promiseWithResolvers<\n Generator | undefined\n >();\n this._batchRequests.add({ resolve, reject });\n this._deliverBatchIfReady();\n return promise;\n }\n\n private _push(item: PromiseOrValue): PromiseOrValue {\n if (this._stopRequested) {\n return;\n }\n const maybePushPromise = this._reserve();\n if (isPromise(item)) {\n const entry: ItemEntry = { kind: 'item' };\n this._entries.push(entry);\n item.then(\n (resolved) => {\n entry.settled = { status: 'fulfilled', value: resolved };\n this._deliverBatchIfReady();\n },\n (reason: unknown) => {\n entry.settled = { status: 'rejected', reason };\n this._deliverBatchIfReady();\n },\n );\n } else {\n this._entries.push({\n kind: 'item',\n settled: { status: 'fulfilled', value: item },\n });\n this._deliverBatchIfReady();\n }\n return maybePushPromise;\n }\n\n private _terminate(\n reason: unknown,\n afterCleanup: () => void,\n ): PromiseOrValue {\n for (const entry of this._entries) {\n if (entry.kind === 'item') {\n this._release();\n }\n }\n this._entries.length = 0;\n return this._runStopCleanup(reason, afterCleanup);\n }\n\n private _stop(reason?: unknown): PromiseOrValue {\n if (this._stopRequested) {\n return this._stopCompletion;\n }\n const stopCompletion = this._runStopCleanup(reason, () => {\n if (reason === undefined) {\n if (this._entries.length === 0) {\n this._isStopped = true;\n this._deliverBatchIfReady();\n return;\n }\n\n this._entries.push({ kind: 'stop' });\n this._deliverBatchIfReady();\n return;\n }\n\n this._entries.push({\n kind: 'item',\n settled: { status: 'rejected', reason },\n });\n this._entries.push({ kind: 'stop' });\n this._deliverBatchIfReady();\n });\n\n if (isPromise(stopCompletion)) {\n /* node:coverage ignore next */\n stopCompletion.catch(() => undefined);\n }\n return stopCompletion;\n }\n\n private _deliverBatchIfReady(): void {\n if (!this._batchRequests.size) {\n return;\n }\n const headEntry = this._entries[0];\n const requests = this._batchRequests;\n if (headEntry !== undefined) {\n // stop sentinel always follows other work\n invariant(headEntry.kind !== 'stop');\n\n const settled = headEntry.settled;\n if (settled !== undefined) {\n if (settled.status === 'fulfilled') {\n this._batchRequests = new Set();\n requests.forEach((request) => request.resolve(this._drainBatch()));\n return;\n }\n this._entries.shift();\n this._release();\n this._isStopped = true;\n this._batchRequests = new Set();\n requests.forEach((request) => request.reject(settled.reason));\n }\n } else if (this._isStopped) {\n this._batchRequests = new Set();\n requests.forEach((request) => request.resolve(undefined));\n }\n }\n\n private *_drainBatch(): Generator {\n while (true) {\n const entry = this._entries[0];\n if (entry === undefined) {\n return;\n }\n if (entry.kind === 'stop') {\n this._isStopped = true;\n this._entries.shift();\n return;\n }\n const settled = entry.settled;\n if (settled === undefined || settled.status === 'rejected') {\n return;\n }\n this._entries.shift();\n this._release();\n yield settled.value;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.mts new file mode 100644 index 00000000..7b96dd4d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.mts @@ -0,0 +1,75 @@ +import type { Computation } from "./Computation.mjs"; +import { Queue } from "./Queue.mjs"; +/** @internal */ +export interface Group> { + parent?: TSelf | undefined; +} +interface WorkResult, S extends Stream> { + value: TValue; + work?: Work | undefined; +} +/** @internal */ +export interface Stream, S extends Stream> { + queue: Queue>; +} +/** @internal */ +export interface Work, S extends Stream> { + groups?: ReadonlyArray; + tasks?: ReadonlyArray>; + streams?: ReadonlyArray; +} +interface NewWork, S extends Stream> { + newGroups: ReadonlyArray; + newStreams: ReadonlyArray; +} +/** @internal */ +export interface WorkQueue, S extends Stream> { + initialGroups: ReadonlyArray; + initialStreams: ReadonlyArray; + events: AsyncGenerator>, void, void>; +} +/** @internal */ +export type StreamItem, S extends Stream> = WorkResult; +/** @internal */ +export type TaskResult, S extends Stream> = WorkResult; +/** @internal */ +export interface Task, S extends Stream> { + groups: ReadonlyArray; + computation: Computation>; +} +interface StreamSuccessEvent, S extends Stream> { + kind: 'STREAM_SUCCESS'; + stream: S; +} +interface StreamFailureEvent, S extends Stream> { + kind: 'STREAM_FAILURE'; + stream: S; + error: unknown; +} +interface GroupValuesEvent, S extends Stream> { + kind: 'GROUP_VALUES'; + group: G; + values: ReadonlyArray; +} +interface GroupSuccessEvent, S extends Stream> extends NewWork { + kind: 'GROUP_SUCCESS'; + group: G; +} +interface GroupFailureEvent> { + kind: 'GROUP_FAILURE'; + group: G; + error: unknown; +} +interface StreamValuesEvent, S extends Stream> extends NewWork { + kind: 'STREAM_VALUES'; + stream: S; + values: ReadonlyArray; +} +interface WorkQueueTerminationEvent { + kind: 'WORK_QUEUE_TERMINATION'; +} +/** @internal */ +export type WorkQueueEvent, S extends Stream> = GroupValuesEvent | GroupSuccessEvent | GroupFailureEvent | StreamValuesEvent | StreamSuccessEvent | StreamFailureEvent | WorkQueueTerminationEvent; +/** @internal */ +export declare function createWorkQueue, S extends Stream>(initialWork: Work | undefined): WorkQueue; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.ts new file mode 100644 index 00000000..14157d62 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.d.ts @@ -0,0 +1,75 @@ +import type { Computation } from "./Computation.js"; +import { Queue } from "./Queue.js"; +/** @internal */ +export interface Group> { + parent?: TSelf | undefined; +} +interface WorkResult, S extends Stream> { + value: TValue; + work?: Work | undefined; +} +/** @internal */ +export interface Stream, S extends Stream> { + queue: Queue>; +} +/** @internal */ +export interface Work, S extends Stream> { + groups?: ReadonlyArray; + tasks?: ReadonlyArray>; + streams?: ReadonlyArray; +} +interface NewWork, S extends Stream> { + newGroups: ReadonlyArray; + newStreams: ReadonlyArray; +} +/** @internal */ +export interface WorkQueue, S extends Stream> { + initialGroups: ReadonlyArray; + initialStreams: ReadonlyArray; + events: AsyncGenerator>, void, void>; +} +/** @internal */ +export type StreamItem, S extends Stream> = WorkResult; +/** @internal */ +export type TaskResult, S extends Stream> = WorkResult; +/** @internal */ +export interface Task, S extends Stream> { + groups: ReadonlyArray; + computation: Computation>; +} +interface StreamSuccessEvent, S extends Stream> { + kind: 'STREAM_SUCCESS'; + stream: S; +} +interface StreamFailureEvent, S extends Stream> { + kind: 'STREAM_FAILURE'; + stream: S; + error: unknown; +} +interface GroupValuesEvent, S extends Stream> { + kind: 'GROUP_VALUES'; + group: G; + values: ReadonlyArray; +} +interface GroupSuccessEvent, S extends Stream> extends NewWork { + kind: 'GROUP_SUCCESS'; + group: G; +} +interface GroupFailureEvent> { + kind: 'GROUP_FAILURE'; + group: G; + error: unknown; +} +interface StreamValuesEvent, S extends Stream> extends NewWork { + kind: 'STREAM_VALUES'; + stream: S; + values: ReadonlyArray; +} +interface WorkQueueTerminationEvent { + kind: 'WORK_QUEUE_TERMINATION'; +} +/** @internal */ +export type WorkQueueEvent, S extends Stream> = GroupValuesEvent | GroupSuccessEvent | GroupFailureEvent | StreamValuesEvent | StreamSuccessEvent | StreamFailureEvent | WorkQueueTerminationEvent; +/** @internal */ +export declare function createWorkQueue, S extends Stream>(initialWork: Work | undefined): WorkQueue; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js new file mode 100644 index 00000000..25b5f5bc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js @@ -0,0 +1,381 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createWorkQueue = createWorkQueue; +const isPromise_ts_1 = require("../../jsutils/isPromise.js"); +const Queue_ts_1 = require("./Queue.js"); +function createWorkQueue(initialWork) { + const rootGroups = new Set(); + const rootStreams = new Set(); + const groupNodes = new Map(); + const taskNodes = new Map(); + let pushGraphEvent; + let stopGraphEvents; + const { newGroups: initialRootGroups, newStreams: initialRootStreams } = maybeIntegrateWork(initialWork); + const nonEmptyInitialRootGroups = pruneEmptyGroups(initialRootGroups); + for (const group of nonEmptyInitialRootGroups) { + rootGroups.add(group); + } + for (const stream of initialRootStreams) { + rootStreams.add(stream); + } + const events = new Queue_ts_1.Queue(({ push: _push, stop: _stop, onStop, started }) => { + pushGraphEvent = _push; + stopGraphEvents = _stop; + started.then(() => { + for (const group of rootGroups) { + startGroup(group); + } + for (const stream of rootStreams) { + startStream(stream); + } + }); + onStop((reason) => cancel(reason)); + }, 1).subscribe((graphEvents) => handleGraphEvents(graphEvents)); + return { + initialGroups: nonEmptyInitialRootGroups, + initialStreams: initialRootStreams, + events, + }; + function cancel(reason) { + const cancelPromises = []; + for (const group of rootGroups) { + cancelGroup(group, reason, cancelPromises); + } + for (const stream of rootStreams) { + cancelStream(stream, reason, cancelPromises); + } + if (cancelPromises.length > 0) { + return Promise.allSettled(cancelPromises).then(() => undefined); + } + } + function cancelGroup(group, reason, cancelPromises) { + const groupNode = groupNodes.get(group); + if (groupNode) { + for (const task of groupNode.tasks) { + cancelTask(task, reason, cancelPromises); + } + for (const childGroup of groupNode.childGroups) { + cancelGroup(childGroup, reason, cancelPromises); + } + } + } + function cancelTask(task, reason, cancelPromises) { + const abortResult = task.computation.abort(reason); + if ((0, isPromise_ts_1.isPromise)(abortResult)) { + cancelPromises.push(abortResult); + } + const taskNode = taskNodes.get(task); + if (taskNode) { + for (const childStream of taskNode.childStreams) { + cancelStream(childStream, reason, cancelPromises); + } + } + } + function cancelStream(stream, reason, cancelPromises) { + const abortResult = stream.queue.abort(reason); + if ((0, isPromise_ts_1.isPromise)(abortResult)) { + cancelPromises.push(abortResult); + } + } + function maybeIntegrateWork(work, parentTask) { + if (!work) { + return { newGroups: [], newStreams: [] }; + } + const { groups, tasks, streams } = work; + const newGroups = groups ? addGroups(groups, parentTask) : []; + if (tasks) { + for (const task of tasks) { + addTask(task); + } + } + const newStreams = streams ? addStreams(streams, parentTask) : []; + return { newGroups, newStreams }; + } + function addGroups(originalGroups, parentTask) { + const groupSet = new Set(originalGroups); + const visited = new Set(); + const newRootGroups = []; + for (const group of originalGroups) { + addGroup(group, groupSet, newRootGroups, visited, parentTask); + } + return newRootGroups; + } + function addGroup(group, groupSet, newRootGroups, visited, parentTask) { + if (visited.has(group)) { + return; + } + visited.add(group); + const parent = group.parent; + if (parent !== undefined && groupSet.has(parent)) { + addGroup(parent, groupSet, newRootGroups, visited, parentTask); + } + const groupNode = { + childGroups: [], + tasks: new Set(), + pending: 0, + }; + groupNodes.set(group, groupNode); + if (parentTask === undefined && !parent) { + newRootGroups.push(group); + } + else if (parent) { + groupNodes.get(parent)?.childGroups.push(group); + } + } + function addTask(task) { + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + if (groupNode) { + groupNode.tasks.add(task); + groupNode.pending++; + if (rootGroups.has(group)) { + startTask(task); + } + } + } + } + function addStreams(streams, parentTask) { + if (!parentTask) { + return streams; + } + const taskNode = taskNodes.get(parentTask); + if (taskNode) { + taskNode.childStreams.push(...streams); + } + return []; + } + function pruneEmptyGroups(newGroups, nonEmptyNewGroups = []) { + for (const newGroup of newGroups) { + const newGroupState = groupNodes.get(newGroup); + if (newGroupState) { + if (newGroupState.pending === 0) { + groupNodes.delete(newGroup); + pruneEmptyGroups(newGroupState.childGroups, nonEmptyNewGroups); + } + else { + nonEmptyNewGroups.push(newGroup); + } + } + } + return nonEmptyNewGroups; + } + function startNewWork(newGroups, newStreams) { + for (const group of newGroups) { + rootGroups.add(group); + startGroup(group); + } + for (const stream of newStreams) { + rootStreams.add(stream); + startStream(stream); + } + } + function startGroup(group) { + const groupNode = groupNodes.get(group); + if (groupNode) { + for (const task of groupNode.tasks) { + startTask(task); + } + } + } + function startTask(task) { + if (taskNodes.has(task)) { + return; + } + taskNodes.set(task, { + value: undefined, + childStreams: [], + }); + try { + const result = task.computation.result(); + if ((0, isPromise_ts_1.isPromise)(result)) { + result.then((resolved) => { + pushGraphEvent({ kind: 'TASK_SUCCESS', task, result: resolved }); + }, (error) => { + pushGraphEvent({ kind: 'TASK_FAILURE', task, error }); + }); + } + else { + pushGraphEvent({ kind: 'TASK_SUCCESS', task, result }); + } + } + catch (error) { + pushGraphEvent({ kind: 'TASK_FAILURE', task, error }); + } + } + async function startStream(stream) { + try { + await stream.queue.forEachBatch(async (items) => { + const pushed = pushGraphEvent({ + kind: 'STREAM_ITEMS', + stream, + items, + }); + if ((0, isPromise_ts_1.isPromise)(pushed)) { + await pushed; + } + }); + pushGraphEvent({ kind: 'STREAM_SUCCESS', stream }); + } + catch (error) { + pushGraphEvent({ kind: 'STREAM_FAILURE', stream, error }); + } + } + function handleGraphEvents(graphEvents) { + const workQueueEvents = []; + for (const graphEvent of graphEvents) { + switch (graphEvent.kind) { + case 'TASK_SUCCESS': + workQueueEvents.push(...taskSuccess(graphEvent)); + break; + case 'TASK_FAILURE': + workQueueEvents.push(...taskFailure(graphEvent)); + break; + case 'STREAM_ITEMS': + workQueueEvents.push(...streamItems(graphEvent)); + break; + case 'STREAM_SUCCESS': + if (rootStreams.has(graphEvent.stream)) { + rootStreams.delete(graphEvent.stream); + workQueueEvents.push(graphEvent); + } + break; + case 'STREAM_FAILURE': + rootStreams.delete(graphEvent.stream); + workQueueEvents.push(graphEvent); + break; + } + } + if (rootGroups.size === 0 && rootStreams.size === 0) { + stopGraphEvents(); + workQueueEvents.push({ kind: 'WORK_QUEUE_TERMINATION' }); + } + return workQueueEvents.length > 0 ? workQueueEvents : undefined; + } + function taskSuccess(graphEvent) { + const { task, result } = graphEvent; + const { value, work } = result; + const taskNode = taskNodes.get(task); + if (taskNode) { + taskNode.value = value; + } + maybeIntegrateWork(work, task); + const groupEvents = []; + const newGroups = []; + const newStreams = []; + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + if (groupNode) { + groupNode.pending--; + if (rootGroups.has(group) && groupNode.pending === 0) { + const { groupValuesEvent, groupSuccessEvent, newGroups: childNewGroups, newStreams: childNewStreams, } = finishGroupSuccess(group, groupNode); + if (groupValuesEvent) { + groupEvents.push(groupValuesEvent); + } + groupEvents.push(groupSuccessEvent); + newGroups.push(...childNewGroups); + newStreams.push(...childNewStreams); + } + } + } + startNewWork(newGroups, newStreams); + return groupEvents; + } + function taskFailure(graphEvent) { + const { task, error } = graphEvent; + taskNodes.delete(task); + const groupFailureEvents = []; + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + if (groupNode) { + groupFailureEvents.push(finishGroupFailure(group, groupNode, error)); + } + } + return groupFailureEvents; + } + function streamItems(graphEvent) { + const { stream, items } = graphEvent; + const values = []; + const newGroups = []; + const newStreams = []; + for (const { value, work } of items) { + const { newGroups: itemNewGroups, newStreams: itemNewStreams } = maybeIntegrateWork(work); + const nonEmptyNewGroups = pruneEmptyGroups(itemNewGroups); + startNewWork(nonEmptyNewGroups, itemNewStreams); + values.push(value); + newGroups.push(...nonEmptyNewGroups); + newStreams.push(...itemNewStreams); + } + const streamValuesEvent = { + kind: 'STREAM_VALUES', + stream, + values, + newGroups, + newStreams, + }; + if (stream.queue.isStopped()) { + rootStreams.delete(stream); + return [streamValuesEvent, { kind: 'STREAM_SUCCESS', stream }]; + } + return [streamValuesEvent]; + } + function finishGroupSuccess(group, groupNode) { + groupNodes.delete(group); + const values = []; + const newStreams = []; + for (const task of groupNode.tasks) { + const taskNode = taskNodes.get(task); + if (taskNode) { + const { value, childStreams } = taskNode; + if (value !== undefined) { + values.push(value); + } + for (const childStream of childStreams) { + newStreams.push(childStream); + } + removeTask(task); + } + } + const newGroups = pruneEmptyGroups(groupNode.childGroups); + rootGroups.delete(group); + return { + groupValuesEvent: values.length + ? { kind: 'GROUP_VALUES', group, values } + : undefined, + groupSuccessEvent: { + kind: 'GROUP_SUCCESS', + group, + newGroups, + newStreams, + }, + newGroups, + newStreams, + }; + } + function finishGroupFailure(group, groupNode, error) { + removeGroup(group, groupNode); + rootGroups.delete(group); + return { kind: 'GROUP_FAILURE', group, error }; + } + function removeGroup(group, groupNode) { + groupNodes.delete(group); + for (const task of groupNode.tasks) { + if (task.groups.every((taskGroup) => !groupNodes.has(taskGroup))) { + removeTask(task); + } + } + for (const childGroup of groupNode.childGroups) { + const childGroupState = groupNodes.get(childGroup); + if (childGroupState) { + removeGroup(childGroup, childGroupState); + } + } + } + function removeTask(task) { + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + groupNode?.tasks.delete(task); + } + taskNodes.delete(task); + } +} +//# sourceMappingURL=WorkQueue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js.map new file mode 100644 index 00000000..baccbb3a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"WorkQueue.js","sourceRoot":"","sources":["../../../src/execution/incremental/WorkQueue.ts"],"names":[],"mappings":";;AAgNA,0CA4eC;AA5rBD,6DAAuD;AAIvD,yCAAmC;AA4MnC,SAAgB,eAAe,CAK7B,WAAyC;IACzC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAK,CAAC;IAChC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAK,CAAC;IACjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA4B,CAAC;IACvD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA0C,CAAC;IACpE,IAAI,cAAoE,CAAC;IACzE,IAAI,eAAyD,CAAC;IAE9D,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,kBAAkB,EAAE,GACpE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAClC,MAAM,yBAAyB,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IAGtE,KAAK,MAAM,KAAK,IAAI,yBAAyB,EAAE,CAA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C,CAAC;YACnB,CAAC;QACH,CAAC;QACD,KAAK,MAAM,UAAU,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YAC/C,MAAM,eAAe,GAAG,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACnD,IAAI,eAAe,EAAE,CAAC;gBACpB,WAAW,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED,SAAS,UAAU,CAAC,IAAsB;QACxC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACxC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QACD,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;AACH,CAAC","sourcesContent":["import { isPromise } from '../../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\nimport type { Computation } from './Computation.ts';\nimport { Queue } from './Queue.ts';\n\n/** @internal */\nexport interface Group> {\n parent?: TSelf | undefined;\n}\n\ninterface WorkResult<\n TValue,\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n value: TValue;\n work?: Work | undefined;\n}\n\n/** @internal */\nexport interface Stream<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n queue: Queue>;\n}\n\n/** @internal */\nexport interface Work, S extends Stream> {\n groups?: ReadonlyArray;\n tasks?: ReadonlyArray>;\n streams?: ReadonlyArray;\n}\n\ninterface NewWork, S extends Stream> {\n newGroups: ReadonlyArray;\n newStreams: ReadonlyArray;\n}\n\n/** @internal */\nexport interface WorkQueue<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n initialGroups: ReadonlyArray;\n initialStreams: ReadonlyArray;\n events: AsyncGenerator>, void, void>;\n}\n\n/** @internal */\nexport type StreamItem<\n T,\n I,\n G extends Group,\n S extends Stream,\n> = WorkResult;\n\n/** @internal */\nexport type TaskResult<\n T,\n I,\n G extends Group,\n S extends Stream,\n> = WorkResult;\n\n/** @internal */\nexport interface Task, S extends Stream> {\n groups: ReadonlyArray;\n computation: Computation>;\n}\n\ninterface TaskSuccessGraphEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'TASK_SUCCESS';\n task: Task;\n result: TaskResult;\n}\n\ninterface TaskFailureGraphEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'TASK_FAILURE';\n task: Task;\n error: unknown;\n}\n\ninterface StreamItemsEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'STREAM_ITEMS';\n stream: S;\n items: Generator>;\n}\n\ninterface StreamSuccessEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'STREAM_SUCCESS';\n stream: S;\n}\n\ninterface StreamFailureEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'STREAM_FAILURE';\n stream: S;\n error: unknown;\n}\n\ntype GraphEvent, S extends Stream> =\n | TaskSuccessGraphEvent\n | TaskFailureGraphEvent\n | StreamItemsEvent\n | StreamSuccessEvent\n | StreamFailureEvent;\n\ninterface GroupValuesEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'GROUP_VALUES';\n group: G;\n values: ReadonlyArray;\n}\n\ninterface GroupSuccessEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> extends NewWork {\n kind: 'GROUP_SUCCESS';\n group: G;\n}\n\ninterface GroupFailureEvent> {\n kind: 'GROUP_FAILURE';\n group: G;\n error: unknown;\n}\n\ninterface StreamValuesEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> extends NewWork {\n kind: 'STREAM_VALUES';\n stream: S;\n values: ReadonlyArray;\n}\n\ninterface WorkQueueTerminationEvent {\n kind: 'WORK_QUEUE_TERMINATION';\n}\n\n/** @internal */\nexport type WorkQueueEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> =\n | GroupValuesEvent\n | GroupSuccessEvent\n | GroupFailureEvent\n | StreamValuesEvent\n | StreamSuccessEvent\n | StreamFailureEvent\n | WorkQueueTerminationEvent;\n\ninterface GroupNode, S extends Stream> {\n childGroups: Array;\n tasks: Set>;\n pending: number;\n}\n\ninterface TaskNode, S extends Stream> {\n value: T | undefined;\n childStreams: Array;\n}\n\n/** @internal */\nexport function createWorkQueue<\n T,\n I,\n G extends Group,\n S extends Stream,\n>(initialWork: Work | undefined): WorkQueue {\n const rootGroups = new Set();\n const rootStreams = new Set();\n const groupNodes = new Map>();\n const taskNodes = new Map, TaskNode>();\n let pushGraphEvent!: (e: GraphEvent) => PromiseOrValue;\n let stopGraphEvents!: (err?: unknown) => PromiseOrValue;\n\n const { newGroups: initialRootGroups, newStreams: initialRootStreams } =\n maybeIntegrateWork(initialWork);\n const nonEmptyInitialRootGroups = pruneEmptyGroups(initialRootGroups);\n // Initialize root groups and streams at startup to prepare for cancellation\n // prior to starting the work queue\n for (const group of nonEmptyInitialRootGroups) {\n rootGroups.add(group);\n }\n for (const stream of initialRootStreams) {\n rootStreams.add(stream);\n }\n\n const events = new Queue>(\n ({ push: _push, stop: _stop, onStop, started }) => {\n pushGraphEvent = _push;\n stopGraphEvents = _stop;\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n started.then(() => {\n for (const group of rootGroups) {\n startGroup(group);\n }\n for (const stream of rootStreams) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n startStream(stream);\n }\n });\n onStop((reason) => cancel(reason));\n },\n 1,\n ).subscribe((graphEvents) => handleGraphEvents(graphEvents));\n\n return {\n initialGroups: nonEmptyInitialRootGroups,\n initialStreams: initialRootStreams,\n events,\n };\n\n function cancel(reason?: unknown): PromiseOrValue {\n const cancelPromises: Array> = [];\n for (const group of rootGroups) {\n cancelGroup(group, reason, cancelPromises);\n }\n for (const stream of rootStreams) {\n cancelStream(stream, reason, cancelPromises);\n }\n if (cancelPromises.length > 0) {\n return Promise.allSettled(cancelPromises).then(() => undefined);\n }\n }\n\n function cancelGroup(\n group: G,\n reason: unknown,\n cancelPromises: Array>,\n ): void {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n for (const task of groupNode.tasks) {\n cancelTask(task, reason, cancelPromises);\n }\n for (const childGroup of groupNode.childGroups) {\n cancelGroup(childGroup, reason, cancelPromises);\n }\n }\n }\n\n function cancelTask(\n task: Task,\n reason: unknown,\n cancelPromises: Array>,\n ): void {\n const abortResult = task.computation.abort(reason);\n if (isPromise(abortResult)) {\n cancelPromises.push(abortResult);\n }\n const taskNode = taskNodes.get(task);\n if (taskNode) {\n for (const childStream of taskNode.childStreams) {\n cancelStream(childStream, reason, cancelPromises);\n }\n }\n }\n\n function cancelStream(\n stream: S,\n reason: unknown,\n cancelPromises: Array>,\n ): void {\n const abortResult = stream.queue.abort(reason);\n if (isPromise(abortResult)) {\n cancelPromises.push(abortResult);\n }\n }\n\n function maybeIntegrateWork(\n work: Work | undefined,\n parentTask?: Task,\n ): NewWork {\n if (!work) {\n return { newGroups: [], newStreams: [] };\n }\n const { groups, tasks, streams } = work;\n const newGroups = groups ? addGroups(groups, parentTask) : [];\n if (tasks) {\n for (const task of tasks) {\n addTask(task);\n }\n }\n const newStreams = streams ? addStreams(streams, parentTask) : [];\n return { newGroups, newStreams };\n }\n\n function addGroups(\n originalGroups: ReadonlyArray,\n parentTask?: Task,\n ): Array {\n const groupSet = new Set(originalGroups);\n const visited = new Set();\n const newRootGroups: Array = [];\n for (const group of originalGroups) {\n addGroup(group, groupSet, newRootGroups, visited, parentTask);\n }\n return newRootGroups;\n }\n\n function addGroup(\n group: G,\n groupSet: ReadonlySet,\n newRootGroups: Array,\n visited: Set,\n parentTask?: Task,\n ): void {\n if (visited.has(group)) {\n return;\n }\n visited.add(group);\n const parent = group.parent;\n if (parent !== undefined && groupSet.has(parent)) {\n addGroup(parent, groupSet, newRootGroups, visited, parentTask);\n }\n\n const groupNode: GroupNode = {\n childGroups: [],\n tasks: new Set(),\n pending: 0,\n };\n groupNodes.set(group, groupNode);\n\n if (parentTask === undefined && !parent) {\n newRootGroups.push(group);\n } else if (parent) {\n groupNodes.get(parent)?.childGroups.push(group);\n }\n }\n\n function addTask(task: Task): void {\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n groupNode.tasks.add(task);\n groupNode.pending++;\n if (rootGroups.has(group)) {\n startTask(task);\n }\n }\n }\n }\n\n function addStreams(\n streams: ReadonlyArray,\n parentTask?: Task,\n ): ReadonlyArray {\n if (!parentTask) {\n return streams;\n }\n const taskNode = taskNodes.get(parentTask);\n if (taskNode) {\n taskNode.childStreams.push(...streams);\n }\n return [];\n }\n\n function pruneEmptyGroups(\n newGroups: ReadonlyArray,\n nonEmptyNewGroups: Array = [],\n ): ReadonlyArray {\n for (const newGroup of newGroups) {\n const newGroupState = groupNodes.get(newGroup);\n if (newGroupState) {\n if (newGroupState.pending === 0) {\n groupNodes.delete(newGroup);\n pruneEmptyGroups(newGroupState.childGroups, nonEmptyNewGroups);\n } else {\n nonEmptyNewGroups.push(newGroup);\n }\n }\n }\n return nonEmptyNewGroups;\n }\n\n function startNewWork(\n newGroups: ReadonlyArray,\n newStreams: ReadonlyArray,\n ): void {\n for (const group of newGroups) {\n rootGroups.add(group);\n startGroup(group);\n }\n for (const stream of newStreams) {\n rootStreams.add(stream);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n startStream(stream);\n }\n }\n\n function startGroup(group: G): void {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n for (const task of groupNode.tasks) {\n startTask(task);\n }\n }\n }\n\n function startTask(task: Task): void {\n if (taskNodes.has(task)) {\n return;\n }\n taskNodes.set(task, {\n value: undefined,\n childStreams: [],\n });\n try {\n const result = task.computation.result();\n if (isPromise(result)) {\n result.then(\n (resolved) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_SUCCESS', task, result: resolved });\n },\n (error: unknown) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_FAILURE', task, error });\n },\n );\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_SUCCESS', task, result });\n }\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_FAILURE', task, error });\n }\n }\n\n async function startStream(stream: S): Promise {\n try {\n await stream.queue.forEachBatch(async (items) => {\n const pushed = pushGraphEvent({\n kind: 'STREAM_ITEMS',\n stream,\n items,\n });\n if (isPromise(pushed)) {\n await pushed;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'STREAM_SUCCESS', stream });\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'STREAM_FAILURE', stream, error });\n }\n }\n\n function handleGraphEvents(\n graphEvents: Generator>,\n ): ReadonlyArray> | undefined {\n const workQueueEvents: Array> = [];\n for (const graphEvent of graphEvents) {\n switch (graphEvent.kind) {\n case 'TASK_SUCCESS':\n workQueueEvents.push(...taskSuccess(graphEvent));\n break;\n case 'TASK_FAILURE':\n workQueueEvents.push(...taskFailure(graphEvent));\n break;\n case 'STREAM_ITEMS':\n workQueueEvents.push(...streamItems(graphEvent));\n break;\n case 'STREAM_SUCCESS':\n // check whether already deleted within streamItems()\n if (rootStreams.has(graphEvent.stream)) {\n rootStreams.delete(graphEvent.stream);\n workQueueEvents.push(graphEvent);\n }\n break;\n case 'STREAM_FAILURE':\n rootStreams.delete(graphEvent.stream);\n workQueueEvents.push(graphEvent);\n break;\n }\n }\n\n if (rootGroups.size === 0 && rootStreams.size === 0) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n stopGraphEvents();\n workQueueEvents.push({ kind: 'WORK_QUEUE_TERMINATION' });\n }\n\n return workQueueEvents.length > 0 ? workQueueEvents : undefined;\n }\n\n function taskSuccess(\n graphEvent: TaskSuccessGraphEvent,\n ): ReadonlyArray<\n GroupValuesEvent | GroupSuccessEvent\n > {\n const { task, result } = graphEvent;\n const { value, work } = result;\n const taskNode = taskNodes.get(task);\n if (taskNode) {\n taskNode.value = value;\n }\n maybeIntegrateWork(work, task);\n\n const groupEvents: Array<\n GroupValuesEvent | GroupSuccessEvent\n > = [];\n const newGroups: Array = [];\n const newStreams: Array = [];\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n groupNode.pending--;\n if (rootGroups.has(group) && groupNode.pending === 0) {\n const {\n groupValuesEvent,\n groupSuccessEvent,\n newGroups: childNewGroups,\n newStreams: childNewStreams,\n } = finishGroupSuccess(group, groupNode);\n if (groupValuesEvent) {\n groupEvents.push(groupValuesEvent);\n }\n groupEvents.push(groupSuccessEvent);\n newGroups.push(...childNewGroups);\n newStreams.push(...childNewStreams);\n }\n }\n }\n\n startNewWork(newGroups, newStreams);\n return groupEvents;\n }\n\n function taskFailure(\n graphEvent: TaskFailureGraphEvent,\n ): ReadonlyArray> {\n const { task, error } = graphEvent;\n taskNodes.delete(task);\n const groupFailureEvents: Array> = [];\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n groupFailureEvents.push(finishGroupFailure(group, groupNode, error));\n }\n }\n return groupFailureEvents;\n }\n\n function streamItems(\n graphEvent: StreamItemsEvent,\n ):\n | [StreamValuesEvent]\n | [StreamValuesEvent, StreamSuccessEvent] {\n const { stream, items } = graphEvent;\n const values: Array = [];\n const newGroups: Array = [];\n const newStreams: Array = [];\n for (const { value, work } of items) {\n const { newGroups: itemNewGroups, newStreams: itemNewStreams } =\n maybeIntegrateWork(work);\n const nonEmptyNewGroups = pruneEmptyGroups(itemNewGroups);\n startNewWork(nonEmptyNewGroups, itemNewStreams);\n values.push(value);\n newGroups.push(...nonEmptyNewGroups);\n newStreams.push(...itemNewStreams);\n }\n const streamValuesEvent: StreamValuesEvent = {\n kind: 'STREAM_VALUES',\n stream,\n values,\n newGroups,\n newStreams,\n };\n\n // queues allow peeking ahead see if stream has stopped\n if (stream.queue.isStopped()) {\n rootStreams.delete(stream);\n return [streamValuesEvent, { kind: 'STREAM_SUCCESS', stream }];\n }\n return [streamValuesEvent];\n }\n\n function finishGroupSuccess(\n group: G,\n groupNode: GroupNode,\n ): {\n groupValuesEvent: GroupValuesEvent | undefined;\n groupSuccessEvent: GroupSuccessEvent;\n newGroups: ReadonlyArray;\n newStreams: ReadonlyArray;\n } {\n groupNodes.delete(group);\n const values: Array = [];\n const newStreams: Array = [];\n for (const task of groupNode.tasks) {\n const taskNode = taskNodes.get(task);\n if (taskNode) {\n const { value, childStreams } = taskNode;\n if (value !== undefined) {\n values.push(value);\n }\n for (const childStream of childStreams) {\n newStreams.push(childStream);\n }\n removeTask(task);\n }\n }\n const newGroups = pruneEmptyGroups(groupNode.childGroups);\n rootGroups.delete(group);\n return {\n groupValuesEvent: values.length\n ? { kind: 'GROUP_VALUES', group, values }\n : undefined,\n groupSuccessEvent: {\n kind: 'GROUP_SUCCESS',\n group,\n newGroups,\n newStreams,\n },\n newGroups,\n newStreams,\n };\n }\n\n function finishGroupFailure(\n group: G,\n groupNode: GroupNode,\n error: unknown,\n ): GroupFailureEvent {\n removeGroup(group, groupNode);\n rootGroups.delete(group);\n return { kind: 'GROUP_FAILURE', group, error };\n }\n\n function removeGroup(group: G, groupNode: GroupNode): void {\n groupNodes.delete(group);\n for (const task of groupNode.tasks) {\n if (task.groups.every((taskGroup) => !groupNodes.has(taskGroup))) {\n removeTask(task);\n }\n }\n for (const childGroup of groupNode.childGroups) {\n const childGroupState = groupNodes.get(childGroup);\n if (childGroupState) {\n removeGroup(childGroup, childGroupState);\n }\n }\n }\n\n function removeTask(task: Task): void {\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n groupNode?.tasks.delete(task);\n }\n taskNodes.delete(task);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs new file mode 100644 index 00000000..8fd0bd6f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs @@ -0,0 +1,378 @@ +import { isPromise } from "../../jsutils/isPromise.mjs"; +import { Queue } from "./Queue.mjs"; +export function createWorkQueue(initialWork) { + const rootGroups = new Set(); + const rootStreams = new Set(); + const groupNodes = new Map(); + const taskNodes = new Map(); + let pushGraphEvent; + let stopGraphEvents; + const { newGroups: initialRootGroups, newStreams: initialRootStreams } = maybeIntegrateWork(initialWork); + const nonEmptyInitialRootGroups = pruneEmptyGroups(initialRootGroups); + for (const group of nonEmptyInitialRootGroups) { + rootGroups.add(group); + } + for (const stream of initialRootStreams) { + rootStreams.add(stream); + } + const events = new Queue(({ push: _push, stop: _stop, onStop, started }) => { + pushGraphEvent = _push; + stopGraphEvents = _stop; + started.then(() => { + for (const group of rootGroups) { + startGroup(group); + } + for (const stream of rootStreams) { + startStream(stream); + } + }); + onStop((reason) => cancel(reason)); + }, 1).subscribe((graphEvents) => handleGraphEvents(graphEvents)); + return { + initialGroups: nonEmptyInitialRootGroups, + initialStreams: initialRootStreams, + events, + }; + function cancel(reason) { + const cancelPromises = []; + for (const group of rootGroups) { + cancelGroup(group, reason, cancelPromises); + } + for (const stream of rootStreams) { + cancelStream(stream, reason, cancelPromises); + } + if (cancelPromises.length > 0) { + return Promise.allSettled(cancelPromises).then(() => undefined); + } + } + function cancelGroup(group, reason, cancelPromises) { + const groupNode = groupNodes.get(group); + if (groupNode) { + for (const task of groupNode.tasks) { + cancelTask(task, reason, cancelPromises); + } + for (const childGroup of groupNode.childGroups) { + cancelGroup(childGroup, reason, cancelPromises); + } + } + } + function cancelTask(task, reason, cancelPromises) { + const abortResult = task.computation.abort(reason); + if (isPromise(abortResult)) { + cancelPromises.push(abortResult); + } + const taskNode = taskNodes.get(task); + if (taskNode) { + for (const childStream of taskNode.childStreams) { + cancelStream(childStream, reason, cancelPromises); + } + } + } + function cancelStream(stream, reason, cancelPromises) { + const abortResult = stream.queue.abort(reason); + if (isPromise(abortResult)) { + cancelPromises.push(abortResult); + } + } + function maybeIntegrateWork(work, parentTask) { + if (!work) { + return { newGroups: [], newStreams: [] }; + } + const { groups, tasks, streams } = work; + const newGroups = groups ? addGroups(groups, parentTask) : []; + if (tasks) { + for (const task of tasks) { + addTask(task); + } + } + const newStreams = streams ? addStreams(streams, parentTask) : []; + return { newGroups, newStreams }; + } + function addGroups(originalGroups, parentTask) { + const groupSet = new Set(originalGroups); + const visited = new Set(); + const newRootGroups = []; + for (const group of originalGroups) { + addGroup(group, groupSet, newRootGroups, visited, parentTask); + } + return newRootGroups; + } + function addGroup(group, groupSet, newRootGroups, visited, parentTask) { + if (visited.has(group)) { + return; + } + visited.add(group); + const parent = group.parent; + if (parent !== undefined && groupSet.has(parent)) { + addGroup(parent, groupSet, newRootGroups, visited, parentTask); + } + const groupNode = { + childGroups: [], + tasks: new Set(), + pending: 0, + }; + groupNodes.set(group, groupNode); + if (parentTask === undefined && !parent) { + newRootGroups.push(group); + } + else if (parent) { + groupNodes.get(parent)?.childGroups.push(group); + } + } + function addTask(task) { + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + if (groupNode) { + groupNode.tasks.add(task); + groupNode.pending++; + if (rootGroups.has(group)) { + startTask(task); + } + } + } + } + function addStreams(streams, parentTask) { + if (!parentTask) { + return streams; + } + const taskNode = taskNodes.get(parentTask); + if (taskNode) { + taskNode.childStreams.push(...streams); + } + return []; + } + function pruneEmptyGroups(newGroups, nonEmptyNewGroups = []) { + for (const newGroup of newGroups) { + const newGroupState = groupNodes.get(newGroup); + if (newGroupState) { + if (newGroupState.pending === 0) { + groupNodes.delete(newGroup); + pruneEmptyGroups(newGroupState.childGroups, nonEmptyNewGroups); + } + else { + nonEmptyNewGroups.push(newGroup); + } + } + } + return nonEmptyNewGroups; + } + function startNewWork(newGroups, newStreams) { + for (const group of newGroups) { + rootGroups.add(group); + startGroup(group); + } + for (const stream of newStreams) { + rootStreams.add(stream); + startStream(stream); + } + } + function startGroup(group) { + const groupNode = groupNodes.get(group); + if (groupNode) { + for (const task of groupNode.tasks) { + startTask(task); + } + } + } + function startTask(task) { + if (taskNodes.has(task)) { + return; + } + taskNodes.set(task, { + value: undefined, + childStreams: [], + }); + try { + const result = task.computation.result(); + if (isPromise(result)) { + result.then((resolved) => { + pushGraphEvent({ kind: 'TASK_SUCCESS', task, result: resolved }); + }, (error) => { + pushGraphEvent({ kind: 'TASK_FAILURE', task, error }); + }); + } + else { + pushGraphEvent({ kind: 'TASK_SUCCESS', task, result }); + } + } + catch (error) { + pushGraphEvent({ kind: 'TASK_FAILURE', task, error }); + } + } + async function startStream(stream) { + try { + await stream.queue.forEachBatch(async (items) => { + const pushed = pushGraphEvent({ + kind: 'STREAM_ITEMS', + stream, + items, + }); + if (isPromise(pushed)) { + await pushed; + } + }); + pushGraphEvent({ kind: 'STREAM_SUCCESS', stream }); + } + catch (error) { + pushGraphEvent({ kind: 'STREAM_FAILURE', stream, error }); + } + } + function handleGraphEvents(graphEvents) { + const workQueueEvents = []; + for (const graphEvent of graphEvents) { + switch (graphEvent.kind) { + case 'TASK_SUCCESS': + workQueueEvents.push(...taskSuccess(graphEvent)); + break; + case 'TASK_FAILURE': + workQueueEvents.push(...taskFailure(graphEvent)); + break; + case 'STREAM_ITEMS': + workQueueEvents.push(...streamItems(graphEvent)); + break; + case 'STREAM_SUCCESS': + if (rootStreams.has(graphEvent.stream)) { + rootStreams.delete(graphEvent.stream); + workQueueEvents.push(graphEvent); + } + break; + case 'STREAM_FAILURE': + rootStreams.delete(graphEvent.stream); + workQueueEvents.push(graphEvent); + break; + } + } + if (rootGroups.size === 0 && rootStreams.size === 0) { + stopGraphEvents(); + workQueueEvents.push({ kind: 'WORK_QUEUE_TERMINATION' }); + } + return workQueueEvents.length > 0 ? workQueueEvents : undefined; + } + function taskSuccess(graphEvent) { + const { task, result } = graphEvent; + const { value, work } = result; + const taskNode = taskNodes.get(task); + if (taskNode) { + taskNode.value = value; + } + maybeIntegrateWork(work, task); + const groupEvents = []; + const newGroups = []; + const newStreams = []; + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + if (groupNode) { + groupNode.pending--; + if (rootGroups.has(group) && groupNode.pending === 0) { + const { groupValuesEvent, groupSuccessEvent, newGroups: childNewGroups, newStreams: childNewStreams, } = finishGroupSuccess(group, groupNode); + if (groupValuesEvent) { + groupEvents.push(groupValuesEvent); + } + groupEvents.push(groupSuccessEvent); + newGroups.push(...childNewGroups); + newStreams.push(...childNewStreams); + } + } + } + startNewWork(newGroups, newStreams); + return groupEvents; + } + function taskFailure(graphEvent) { + const { task, error } = graphEvent; + taskNodes.delete(task); + const groupFailureEvents = []; + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + if (groupNode) { + groupFailureEvents.push(finishGroupFailure(group, groupNode, error)); + } + } + return groupFailureEvents; + } + function streamItems(graphEvent) { + const { stream, items } = graphEvent; + const values = []; + const newGroups = []; + const newStreams = []; + for (const { value, work } of items) { + const { newGroups: itemNewGroups, newStreams: itemNewStreams } = maybeIntegrateWork(work); + const nonEmptyNewGroups = pruneEmptyGroups(itemNewGroups); + startNewWork(nonEmptyNewGroups, itemNewStreams); + values.push(value); + newGroups.push(...nonEmptyNewGroups); + newStreams.push(...itemNewStreams); + } + const streamValuesEvent = { + kind: 'STREAM_VALUES', + stream, + values, + newGroups, + newStreams, + }; + if (stream.queue.isStopped()) { + rootStreams.delete(stream); + return [streamValuesEvent, { kind: 'STREAM_SUCCESS', stream }]; + } + return [streamValuesEvent]; + } + function finishGroupSuccess(group, groupNode) { + groupNodes.delete(group); + const values = []; + const newStreams = []; + for (const task of groupNode.tasks) { + const taskNode = taskNodes.get(task); + if (taskNode) { + const { value, childStreams } = taskNode; + if (value !== undefined) { + values.push(value); + } + for (const childStream of childStreams) { + newStreams.push(childStream); + } + removeTask(task); + } + } + const newGroups = pruneEmptyGroups(groupNode.childGroups); + rootGroups.delete(group); + return { + groupValuesEvent: values.length + ? { kind: 'GROUP_VALUES', group, values } + : undefined, + groupSuccessEvent: { + kind: 'GROUP_SUCCESS', + group, + newGroups, + newStreams, + }, + newGroups, + newStreams, + }; + } + function finishGroupFailure(group, groupNode, error) { + removeGroup(group, groupNode); + rootGroups.delete(group); + return { kind: 'GROUP_FAILURE', group, error }; + } + function removeGroup(group, groupNode) { + groupNodes.delete(group); + for (const task of groupNode.tasks) { + if (task.groups.every((taskGroup) => !groupNodes.has(taskGroup))) { + removeTask(task); + } + } + for (const childGroup of groupNode.childGroups) { + const childGroupState = groupNodes.get(childGroup); + if (childGroupState) { + removeGroup(childGroup, childGroupState); + } + } + } + function removeTask(task) { + for (const group of task.groups) { + const groupNode = groupNodes.get(group); + groupNode?.tasks.delete(task); + } + taskNodes.delete(task); + } +} +//# sourceMappingURL=WorkQueue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs.map new file mode 100644 index 00000000..a42b1a14 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/WorkQueue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"WorkQueue.js","sourceRoot":"","sources":["../../../src/execution/incremental/WorkQueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oCAAmC;AAIvD,OAAO,EAAE,KAAK,EAAE,oBAAmB;AA4MnC,MAAM,UAAU,eAAe,CAK7B,WAAyC;IACzC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAK,CAAC;IAChC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAK,CAAC;IACjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA4B,CAAC;IACvD,MAAM,SAAS,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7D,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;gBACjE,UAAU,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;QACD,KAAK,MAAM,UAAU,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YAC/C,MAAM,eAAe,GAAG,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACnD,IAAI,eAAe,EAAE,CAAC;gBACpB,WAAW,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED,SAAS,UAAU,CAAC,IAAsB;QACxC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACxC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QACD,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;AACH,CAAC","sourcesContent":["import { isPromise } from '../../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\nimport type { Computation } from './Computation.ts';\nimport { Queue } from './Queue.ts';\n\n/** @internal */\nexport interface Group> {\n parent?: TSelf | undefined;\n}\n\ninterface WorkResult<\n TValue,\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n value: TValue;\n work?: Work | undefined;\n}\n\n/** @internal */\nexport interface Stream<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n queue: Queue>;\n}\n\n/** @internal */\nexport interface Work, S extends Stream> {\n groups?: ReadonlyArray;\n tasks?: ReadonlyArray>;\n streams?: ReadonlyArray;\n}\n\ninterface NewWork, S extends Stream> {\n newGroups: ReadonlyArray;\n newStreams: ReadonlyArray;\n}\n\n/** @internal */\nexport interface WorkQueue<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n initialGroups: ReadonlyArray;\n initialStreams: ReadonlyArray;\n events: AsyncGenerator>, void, void>;\n}\n\n/** @internal */\nexport type StreamItem<\n T,\n I,\n G extends Group,\n S extends Stream,\n> = WorkResult;\n\n/** @internal */\nexport type TaskResult<\n T,\n I,\n G extends Group,\n S extends Stream,\n> = WorkResult;\n\n/** @internal */\nexport interface Task, S extends Stream> {\n groups: ReadonlyArray;\n computation: Computation>;\n}\n\ninterface TaskSuccessGraphEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'TASK_SUCCESS';\n task: Task;\n result: TaskResult;\n}\n\ninterface TaskFailureGraphEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'TASK_FAILURE';\n task: Task;\n error: unknown;\n}\n\ninterface StreamItemsEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'STREAM_ITEMS';\n stream: S;\n items: Generator>;\n}\n\ninterface StreamSuccessEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'STREAM_SUCCESS';\n stream: S;\n}\n\ninterface StreamFailureEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'STREAM_FAILURE';\n stream: S;\n error: unknown;\n}\n\ntype GraphEvent, S extends Stream> =\n | TaskSuccessGraphEvent\n | TaskFailureGraphEvent\n | StreamItemsEvent\n | StreamSuccessEvent\n | StreamFailureEvent;\n\ninterface GroupValuesEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> {\n kind: 'GROUP_VALUES';\n group: G;\n values: ReadonlyArray;\n}\n\ninterface GroupSuccessEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> extends NewWork {\n kind: 'GROUP_SUCCESS';\n group: G;\n}\n\ninterface GroupFailureEvent> {\n kind: 'GROUP_FAILURE';\n group: G;\n error: unknown;\n}\n\ninterface StreamValuesEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> extends NewWork {\n kind: 'STREAM_VALUES';\n stream: S;\n values: ReadonlyArray;\n}\n\ninterface WorkQueueTerminationEvent {\n kind: 'WORK_QUEUE_TERMINATION';\n}\n\n/** @internal */\nexport type WorkQueueEvent<\n T,\n I,\n G extends Group,\n S extends Stream,\n> =\n | GroupValuesEvent\n | GroupSuccessEvent\n | GroupFailureEvent\n | StreamValuesEvent\n | StreamSuccessEvent\n | StreamFailureEvent\n | WorkQueueTerminationEvent;\n\ninterface GroupNode, S extends Stream> {\n childGroups: Array;\n tasks: Set>;\n pending: number;\n}\n\ninterface TaskNode, S extends Stream> {\n value: T | undefined;\n childStreams: Array;\n}\n\n/** @internal */\nexport function createWorkQueue<\n T,\n I,\n G extends Group,\n S extends Stream,\n>(initialWork: Work | undefined): WorkQueue {\n const rootGroups = new Set();\n const rootStreams = new Set();\n const groupNodes = new Map>();\n const taskNodes = new Map, TaskNode>();\n let pushGraphEvent!: (e: GraphEvent) => PromiseOrValue;\n let stopGraphEvents!: (err?: unknown) => PromiseOrValue;\n\n const { newGroups: initialRootGroups, newStreams: initialRootStreams } =\n maybeIntegrateWork(initialWork);\n const nonEmptyInitialRootGroups = pruneEmptyGroups(initialRootGroups);\n // Initialize root groups and streams at startup to prepare for cancellation\n // prior to starting the work queue\n for (const group of nonEmptyInitialRootGroups) {\n rootGroups.add(group);\n }\n for (const stream of initialRootStreams) {\n rootStreams.add(stream);\n }\n\n const events = new Queue>(\n ({ push: _push, stop: _stop, onStop, started }) => {\n pushGraphEvent = _push;\n stopGraphEvents = _stop;\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n started.then(() => {\n for (const group of rootGroups) {\n startGroup(group);\n }\n for (const stream of rootStreams) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n startStream(stream);\n }\n });\n onStop((reason) => cancel(reason));\n },\n 1,\n ).subscribe((graphEvents) => handleGraphEvents(graphEvents));\n\n return {\n initialGroups: nonEmptyInitialRootGroups,\n initialStreams: initialRootStreams,\n events,\n };\n\n function cancel(reason?: unknown): PromiseOrValue {\n const cancelPromises: Array> = [];\n for (const group of rootGroups) {\n cancelGroup(group, reason, cancelPromises);\n }\n for (const stream of rootStreams) {\n cancelStream(stream, reason, cancelPromises);\n }\n if (cancelPromises.length > 0) {\n return Promise.allSettled(cancelPromises).then(() => undefined);\n }\n }\n\n function cancelGroup(\n group: G,\n reason: unknown,\n cancelPromises: Array>,\n ): void {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n for (const task of groupNode.tasks) {\n cancelTask(task, reason, cancelPromises);\n }\n for (const childGroup of groupNode.childGroups) {\n cancelGroup(childGroup, reason, cancelPromises);\n }\n }\n }\n\n function cancelTask(\n task: Task,\n reason: unknown,\n cancelPromises: Array>,\n ): void {\n const abortResult = task.computation.abort(reason);\n if (isPromise(abortResult)) {\n cancelPromises.push(abortResult);\n }\n const taskNode = taskNodes.get(task);\n if (taskNode) {\n for (const childStream of taskNode.childStreams) {\n cancelStream(childStream, reason, cancelPromises);\n }\n }\n }\n\n function cancelStream(\n stream: S,\n reason: unknown,\n cancelPromises: Array>,\n ): void {\n const abortResult = stream.queue.abort(reason);\n if (isPromise(abortResult)) {\n cancelPromises.push(abortResult);\n }\n }\n\n function maybeIntegrateWork(\n work: Work | undefined,\n parentTask?: Task,\n ): NewWork {\n if (!work) {\n return { newGroups: [], newStreams: [] };\n }\n const { groups, tasks, streams } = work;\n const newGroups = groups ? addGroups(groups, parentTask) : [];\n if (tasks) {\n for (const task of tasks) {\n addTask(task);\n }\n }\n const newStreams = streams ? addStreams(streams, parentTask) : [];\n return { newGroups, newStreams };\n }\n\n function addGroups(\n originalGroups: ReadonlyArray,\n parentTask?: Task,\n ): Array {\n const groupSet = new Set(originalGroups);\n const visited = new Set();\n const newRootGroups: Array = [];\n for (const group of originalGroups) {\n addGroup(group, groupSet, newRootGroups, visited, parentTask);\n }\n return newRootGroups;\n }\n\n function addGroup(\n group: G,\n groupSet: ReadonlySet,\n newRootGroups: Array,\n visited: Set,\n parentTask?: Task,\n ): void {\n if (visited.has(group)) {\n return;\n }\n visited.add(group);\n const parent = group.parent;\n if (parent !== undefined && groupSet.has(parent)) {\n addGroup(parent, groupSet, newRootGroups, visited, parentTask);\n }\n\n const groupNode: GroupNode = {\n childGroups: [],\n tasks: new Set(),\n pending: 0,\n };\n groupNodes.set(group, groupNode);\n\n if (parentTask === undefined && !parent) {\n newRootGroups.push(group);\n } else if (parent) {\n groupNodes.get(parent)?.childGroups.push(group);\n }\n }\n\n function addTask(task: Task): void {\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n groupNode.tasks.add(task);\n groupNode.pending++;\n if (rootGroups.has(group)) {\n startTask(task);\n }\n }\n }\n }\n\n function addStreams(\n streams: ReadonlyArray,\n parentTask?: Task,\n ): ReadonlyArray {\n if (!parentTask) {\n return streams;\n }\n const taskNode = taskNodes.get(parentTask);\n if (taskNode) {\n taskNode.childStreams.push(...streams);\n }\n return [];\n }\n\n function pruneEmptyGroups(\n newGroups: ReadonlyArray,\n nonEmptyNewGroups: Array = [],\n ): ReadonlyArray {\n for (const newGroup of newGroups) {\n const newGroupState = groupNodes.get(newGroup);\n if (newGroupState) {\n if (newGroupState.pending === 0) {\n groupNodes.delete(newGroup);\n pruneEmptyGroups(newGroupState.childGroups, nonEmptyNewGroups);\n } else {\n nonEmptyNewGroups.push(newGroup);\n }\n }\n }\n return nonEmptyNewGroups;\n }\n\n function startNewWork(\n newGroups: ReadonlyArray,\n newStreams: ReadonlyArray,\n ): void {\n for (const group of newGroups) {\n rootGroups.add(group);\n startGroup(group);\n }\n for (const stream of newStreams) {\n rootStreams.add(stream);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n startStream(stream);\n }\n }\n\n function startGroup(group: G): void {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n for (const task of groupNode.tasks) {\n startTask(task);\n }\n }\n }\n\n function startTask(task: Task): void {\n if (taskNodes.has(task)) {\n return;\n }\n taskNodes.set(task, {\n value: undefined,\n childStreams: [],\n });\n try {\n const result = task.computation.result();\n if (isPromise(result)) {\n result.then(\n (resolved) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_SUCCESS', task, result: resolved });\n },\n (error: unknown) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_FAILURE', task, error });\n },\n );\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_SUCCESS', task, result });\n }\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'TASK_FAILURE', task, error });\n }\n }\n\n async function startStream(stream: S): Promise {\n try {\n await stream.queue.forEachBatch(async (items) => {\n const pushed = pushGraphEvent({\n kind: 'STREAM_ITEMS',\n stream,\n items,\n });\n if (isPromise(pushed)) {\n await pushed;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'STREAM_SUCCESS', stream });\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n pushGraphEvent({ kind: 'STREAM_FAILURE', stream, error });\n }\n }\n\n function handleGraphEvents(\n graphEvents: Generator>,\n ): ReadonlyArray> | undefined {\n const workQueueEvents: Array> = [];\n for (const graphEvent of graphEvents) {\n switch (graphEvent.kind) {\n case 'TASK_SUCCESS':\n workQueueEvents.push(...taskSuccess(graphEvent));\n break;\n case 'TASK_FAILURE':\n workQueueEvents.push(...taskFailure(graphEvent));\n break;\n case 'STREAM_ITEMS':\n workQueueEvents.push(...streamItems(graphEvent));\n break;\n case 'STREAM_SUCCESS':\n // check whether already deleted within streamItems()\n if (rootStreams.has(graphEvent.stream)) {\n rootStreams.delete(graphEvent.stream);\n workQueueEvents.push(graphEvent);\n }\n break;\n case 'STREAM_FAILURE':\n rootStreams.delete(graphEvent.stream);\n workQueueEvents.push(graphEvent);\n break;\n }\n }\n\n if (rootGroups.size === 0 && rootStreams.size === 0) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n stopGraphEvents();\n workQueueEvents.push({ kind: 'WORK_QUEUE_TERMINATION' });\n }\n\n return workQueueEvents.length > 0 ? workQueueEvents : undefined;\n }\n\n function taskSuccess(\n graphEvent: TaskSuccessGraphEvent,\n ): ReadonlyArray<\n GroupValuesEvent | GroupSuccessEvent\n > {\n const { task, result } = graphEvent;\n const { value, work } = result;\n const taskNode = taskNodes.get(task);\n if (taskNode) {\n taskNode.value = value;\n }\n maybeIntegrateWork(work, task);\n\n const groupEvents: Array<\n GroupValuesEvent | GroupSuccessEvent\n > = [];\n const newGroups: Array = [];\n const newStreams: Array = [];\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n groupNode.pending--;\n if (rootGroups.has(group) && groupNode.pending === 0) {\n const {\n groupValuesEvent,\n groupSuccessEvent,\n newGroups: childNewGroups,\n newStreams: childNewStreams,\n } = finishGroupSuccess(group, groupNode);\n if (groupValuesEvent) {\n groupEvents.push(groupValuesEvent);\n }\n groupEvents.push(groupSuccessEvent);\n newGroups.push(...childNewGroups);\n newStreams.push(...childNewStreams);\n }\n }\n }\n\n startNewWork(newGroups, newStreams);\n return groupEvents;\n }\n\n function taskFailure(\n graphEvent: TaskFailureGraphEvent,\n ): ReadonlyArray> {\n const { task, error } = graphEvent;\n taskNodes.delete(task);\n const groupFailureEvents: Array> = [];\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n if (groupNode) {\n groupFailureEvents.push(finishGroupFailure(group, groupNode, error));\n }\n }\n return groupFailureEvents;\n }\n\n function streamItems(\n graphEvent: StreamItemsEvent,\n ):\n | [StreamValuesEvent]\n | [StreamValuesEvent, StreamSuccessEvent] {\n const { stream, items } = graphEvent;\n const values: Array = [];\n const newGroups: Array = [];\n const newStreams: Array = [];\n for (const { value, work } of items) {\n const { newGroups: itemNewGroups, newStreams: itemNewStreams } =\n maybeIntegrateWork(work);\n const nonEmptyNewGroups = pruneEmptyGroups(itemNewGroups);\n startNewWork(nonEmptyNewGroups, itemNewStreams);\n values.push(value);\n newGroups.push(...nonEmptyNewGroups);\n newStreams.push(...itemNewStreams);\n }\n const streamValuesEvent: StreamValuesEvent = {\n kind: 'STREAM_VALUES',\n stream,\n values,\n newGroups,\n newStreams,\n };\n\n // queues allow peeking ahead see if stream has stopped\n if (stream.queue.isStopped()) {\n rootStreams.delete(stream);\n return [streamValuesEvent, { kind: 'STREAM_SUCCESS', stream }];\n }\n return [streamValuesEvent];\n }\n\n function finishGroupSuccess(\n group: G,\n groupNode: GroupNode,\n ): {\n groupValuesEvent: GroupValuesEvent | undefined;\n groupSuccessEvent: GroupSuccessEvent;\n newGroups: ReadonlyArray;\n newStreams: ReadonlyArray;\n } {\n groupNodes.delete(group);\n const values: Array = [];\n const newStreams: Array = [];\n for (const task of groupNode.tasks) {\n const taskNode = taskNodes.get(task);\n if (taskNode) {\n const { value, childStreams } = taskNode;\n if (value !== undefined) {\n values.push(value);\n }\n for (const childStream of childStreams) {\n newStreams.push(childStream);\n }\n removeTask(task);\n }\n }\n const newGroups = pruneEmptyGroups(groupNode.childGroups);\n rootGroups.delete(group);\n return {\n groupValuesEvent: values.length\n ? { kind: 'GROUP_VALUES', group, values }\n : undefined,\n groupSuccessEvent: {\n kind: 'GROUP_SUCCESS',\n group,\n newGroups,\n newStreams,\n },\n newGroups,\n newStreams,\n };\n }\n\n function finishGroupFailure(\n group: G,\n groupNode: GroupNode,\n error: unknown,\n ): GroupFailureEvent {\n removeGroup(group, groupNode);\n rootGroups.delete(group);\n return { kind: 'GROUP_FAILURE', group, error };\n }\n\n function removeGroup(group: G, groupNode: GroupNode): void {\n groupNodes.delete(group);\n for (const task of groupNode.tasks) {\n if (task.groups.every((taskGroup) => !groupNodes.has(taskGroup))) {\n removeTask(task);\n }\n }\n for (const childGroup of groupNode.childGroups) {\n const childGroupState = groupNodes.get(childGroup);\n if (childGroupState) {\n removeGroup(childGroup, childGroupState);\n }\n }\n }\n\n function removeTask(task: Task): void {\n for (const group of task.groups) {\n const groupNode = groupNodes.get(group);\n groupNode?.tasks.delete(task);\n }\n taskNodes.delete(task);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.mts new file mode 100644 index 00000000..f9f5d047 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.mts @@ -0,0 +1,10 @@ +import type { DeferUsage, GroupedFieldSet } from "../collectFields.mjs"; +/** @internal */ +export type DeferUsageSet = ReadonlySet; +/** @internal */ +export interface ExecutionPlan { + groupedFieldSet: GroupedFieldSet; + newGroupedFieldSets: Map; +} +/** @internal */ +export declare function buildExecutionPlan(originalGroupedFieldSet: GroupedFieldSet, parentDeferUsages?: DeferUsageSet): ExecutionPlan; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.ts new file mode 100644 index 00000000..835e3c28 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.d.ts @@ -0,0 +1,10 @@ +import type { DeferUsage, GroupedFieldSet } from "../collectFields.js"; +/** @internal */ +export type DeferUsageSet = ReadonlySet; +/** @internal */ +export interface ExecutionPlan { + groupedFieldSet: GroupedFieldSet; + newGroupedFieldSets: Map; +} +/** @internal */ +export declare function buildExecutionPlan(originalGroupedFieldSet: GroupedFieldSet, parentDeferUsages?: DeferUsageSet): ExecutionPlan; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js new file mode 100644 index 00000000..47affc4c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildExecutionPlan = buildExecutionPlan; +const getBySet_ts_1 = require("../../jsutils/getBySet.js"); +const isSameSet_ts_1 = require("../../jsutils/isSameSet.js"); +function buildExecutionPlan(originalGroupedFieldSet, parentDeferUsages = new Set()) { + const groupedFieldSet = new Map(); + const newGroupedFieldSets = new Map(); + for (const [responseKey, fieldDetailsList] of originalGroupedFieldSet) { + const filteredDeferUsageSet = getFilteredDeferUsageSet(fieldDetailsList); + if ((0, isSameSet_ts_1.isSameSet)(filteredDeferUsageSet, parentDeferUsages)) { + groupedFieldSet.set(responseKey, fieldDetailsList); + continue; + } + let newGroupedFieldSet = (0, getBySet_ts_1.getBySet)(newGroupedFieldSets, filteredDeferUsageSet); + if (newGroupedFieldSet === undefined) { + newGroupedFieldSet = new Map(); + newGroupedFieldSets.set(filteredDeferUsageSet, newGroupedFieldSet); + } + newGroupedFieldSet.set(responseKey, fieldDetailsList); + } + return { + groupedFieldSet, + newGroupedFieldSets, + }; +} +function getFilteredDeferUsageSet(fieldDetailsList) { + const filteredDeferUsageSet = new Set(); + for (const fieldDetails of fieldDetailsList) { + const deferUsage = fieldDetails.deferUsage; + if (deferUsage === undefined) { + filteredDeferUsageSet.clear(); + return filteredDeferUsageSet; + } + filteredDeferUsageSet.add(deferUsage); + } + for (const deferUsage of filteredDeferUsageSet) { + let parentDeferUsage = deferUsage.parentDeferUsage; + while (parentDeferUsage !== undefined) { + if (filteredDeferUsageSet.has(parentDeferUsage)) { + filteredDeferUsageSet.delete(deferUsage); + break; + } + parentDeferUsage = parentDeferUsage.parentDeferUsage; + } + } + return filteredDeferUsageSet; +} +//# sourceMappingURL=buildExecutionPlan.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js.map new file mode 100644 index 00000000..86ef7993 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"buildExecutionPlan.js","sourceRoot":"","sources":["../../../src/execution/incremental/buildExecutionPlan.ts"],"names":[],"mappings":";;AAmBA,gDAgCC;AAnDD,2DAAqD;AACrD,6DAAuD;AAkBvD,SAAgB,kBAAkB,CAChC,uBAAwC,EACxC,oBAAmC,IAAI,GAAG,EAAc;IAExD,MAAM,eAAe,GAAG,IAAI,GAAG,EAA4B,CAAC;IAC5D,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAGhC,CAAC;IACJ,KAAK,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,IAAI,uBAAuB,EAAE,CAAC;QACtE,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;QAEzE,IAAI,IAAA,wBAAS,EAAC,qBAAqB,EAAE,iBAAiB,CAAC,EAAE,CAAC;YACxD,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;YACnD,SAAS;QACX,CAAC;QAED,IAAI,kBAAkB,GAAG,IAAA,sBAAQ,EAC/B,mBAAmB,EACnB,qBAAqB,CACtB,CAAC;QACF,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACrC,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;YAC/B,mBAAmB,CAAC,GAAG,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;QACrE,CAAC;QACD,kBAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC;IAED,OAAO;QACL,eAAe;QACf,mBAAmB;KACpB,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAC/B,gBAAkC;IAElC,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAc,CAAC;IACpD,KAAK,MAAM,YAAY,IAAI,gBAAgB,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;QAC3C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,qBAAqB,CAAC,KAAK,EAAE,CAAC;YAC9B,OAAO,qBAAqB,CAAC;QAC/B,CAAC;QACD,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,MAAM,UAAU,IAAI,qBAAqB,EAAE,CAAC;QAC/C,IAAI,gBAAgB,GAA2B,UAAU,CAAC,gBAAgB,CAAC;QAC3E,OAAO,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACtC,IAAI,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAChD,qBAAqB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBACzC,MAAM;YACR,CAAC;YACD,gBAAgB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC","sourcesContent":["import { getBySet } from '../../jsutils/getBySet.ts';\nimport { isSameSet } from '../../jsutils/isSameSet.ts';\n\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from '../collectFields.ts';\n\n/** @internal */\nexport type DeferUsageSet = ReadonlySet;\n\n/** @internal */\nexport interface ExecutionPlan {\n groupedFieldSet: GroupedFieldSet;\n newGroupedFieldSets: Map;\n}\n\n/** @internal */\nexport function buildExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n parentDeferUsages: DeferUsageSet = new Set(),\n): ExecutionPlan {\n const groupedFieldSet = new Map();\n const newGroupedFieldSets = new Map<\n DeferUsageSet,\n Map\n >();\n for (const [responseKey, fieldDetailsList] of originalGroupedFieldSet) {\n const filteredDeferUsageSet = getFilteredDeferUsageSet(fieldDetailsList);\n\n if (isSameSet(filteredDeferUsageSet, parentDeferUsages)) {\n groupedFieldSet.set(responseKey, fieldDetailsList);\n continue;\n }\n\n let newGroupedFieldSet = getBySet(\n newGroupedFieldSets,\n filteredDeferUsageSet,\n );\n if (newGroupedFieldSet === undefined) {\n newGroupedFieldSet = new Map();\n newGroupedFieldSets.set(filteredDeferUsageSet, newGroupedFieldSet);\n }\n newGroupedFieldSet.set(responseKey, fieldDetailsList);\n }\n\n return {\n groupedFieldSet,\n newGroupedFieldSets,\n };\n}\n\nfunction getFilteredDeferUsageSet(\n fieldDetailsList: FieldDetailsList,\n): ReadonlySet {\n const filteredDeferUsageSet = new Set();\n for (const fieldDetails of fieldDetailsList) {\n const deferUsage = fieldDetails.deferUsage;\n if (deferUsage === undefined) {\n filteredDeferUsageSet.clear();\n return filteredDeferUsageSet;\n }\n filteredDeferUsageSet.add(deferUsage);\n }\n\n for (const deferUsage of filteredDeferUsageSet) {\n let parentDeferUsage: DeferUsage | undefined = deferUsage.parentDeferUsage;\n while (parentDeferUsage !== undefined) {\n if (filteredDeferUsageSet.has(parentDeferUsage)) {\n filteredDeferUsageSet.delete(deferUsage);\n break;\n }\n parentDeferUsage = parentDeferUsage.parentDeferUsage;\n }\n }\n return filteredDeferUsageSet;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs new file mode 100644 index 00000000..aecd3609 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs @@ -0,0 +1,46 @@ +import { getBySet } from "../../jsutils/getBySet.mjs"; +import { isSameSet } from "../../jsutils/isSameSet.mjs"; +export function buildExecutionPlan(originalGroupedFieldSet, parentDeferUsages = new Set()) { + const groupedFieldSet = new Map(); + const newGroupedFieldSets = new Map(); + for (const [responseKey, fieldDetailsList] of originalGroupedFieldSet) { + const filteredDeferUsageSet = getFilteredDeferUsageSet(fieldDetailsList); + if (isSameSet(filteredDeferUsageSet, parentDeferUsages)) { + groupedFieldSet.set(responseKey, fieldDetailsList); + continue; + } + let newGroupedFieldSet = getBySet(newGroupedFieldSets, filteredDeferUsageSet); + if (newGroupedFieldSet === undefined) { + newGroupedFieldSet = new Map(); + newGroupedFieldSets.set(filteredDeferUsageSet, newGroupedFieldSet); + } + newGroupedFieldSet.set(responseKey, fieldDetailsList); + } + return { + groupedFieldSet, + newGroupedFieldSets, + }; +} +function getFilteredDeferUsageSet(fieldDetailsList) { + const filteredDeferUsageSet = new Set(); + for (const fieldDetails of fieldDetailsList) { + const deferUsage = fieldDetails.deferUsage; + if (deferUsage === undefined) { + filteredDeferUsageSet.clear(); + return filteredDeferUsageSet; + } + filteredDeferUsageSet.add(deferUsage); + } + for (const deferUsage of filteredDeferUsageSet) { + let parentDeferUsage = deferUsage.parentDeferUsage; + while (parentDeferUsage !== undefined) { + if (filteredDeferUsageSet.has(parentDeferUsage)) { + filteredDeferUsageSet.delete(deferUsage); + break; + } + parentDeferUsage = parentDeferUsage.parentDeferUsage; + } + } + return filteredDeferUsageSet; +} +//# sourceMappingURL=buildExecutionPlan.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs.map new file mode 100644 index 00000000..08ab39cf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"buildExecutionPlan.js","source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AAK,EAAE,CAAC;YAC9B,OAAO,qBAAqB,CAAC;QAC/B,CAAC;QACD,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,MAAM,UAAU,IAAI,qBAAqB,EAAE,CAAC;QAC/C,IAAI,gBAAgB,GAA2B,UAAU,CAAC,gBAAgB,CAAC;QAC3E,OAAO,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACtC,IAAI,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAChD,qBAAqB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBACzC,MAAM;YACR,CAAC;YACD,gBAAgB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC","sourcesContent":["import { getBySet } from '../../jsutils/getBySet.ts';\nimport { isSameSet } from '../../jsutils/isSameSet.ts';\n\nimport type {\n DeferUsage,\n FieldDetailsList,\n GroupedFieldSet,\n} from '../collectFields.ts';\n\n/** @internal */\nexport type DeferUsageSet = ReadonlySet;\n\n/** @internal */\nexport interface ExecutionPlan {\n groupedFieldSet: GroupedFieldSet;\n newGroupedFieldSets: Map;\n}\n\n/** @internal */\nexport function buildExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n parentDeferUsages: DeferUsageSet = new Set(),\n): ExecutionPlan {\n const groupedFieldSet = new Map();\n const newGroupedFieldSets = new Map<\n DeferUsageSet,\n Map\n >();\n for (const [responseKey, fieldDetailsList] of originalGroupedFieldSet) {\n const filteredDeferUsageSet = getFilteredDeferUsageSet(fieldDetailsList);\n\n if (isSameSet(filteredDeferUsageSet, parentDeferUsages)) {\n groupedFieldSet.set(responseKey, fieldDetailsList);\n continue;\n }\n\n let newGroupedFieldSet = getBySet(\n newGroupedFieldSets,\n filteredDeferUsageSet,\n );\n if (newGroupedFieldSet === undefined) {\n newGroupedFieldSet = new Map();\n newGroupedFieldSets.set(filteredDeferUsageSet, newGroupedFieldSet);\n }\n newGroupedFieldSet.set(responseKey, fieldDetailsList);\n }\n\n return {\n groupedFieldSet,\n newGroupedFieldSets,\n };\n}\n\nfunction getFilteredDeferUsageSet(\n fieldDetailsList: FieldDetailsList,\n): ReadonlySet {\n const filteredDeferUsageSet = new Set();\n for (const fieldDetails of fieldDetailsList) {\n const deferUsage = fieldDetails.deferUsage;\n if (deferUsage === undefined) {\n filteredDeferUsageSet.clear();\n return filteredDeferUsageSet;\n }\n filteredDeferUsageSet.add(deferUsage);\n }\n\n for (const deferUsage of filteredDeferUsageSet) {\n let parentDeferUsage: DeferUsage | undefined = deferUsage.parentDeferUsage;\n while (parentDeferUsage !== undefined) {\n if (filteredDeferUsageSet.has(parentDeferUsage)) {\n filteredDeferUsageSet.delete(deferUsage);\n break;\n }\n parentDeferUsage = parentDeferUsage.parentDeferUsage;\n }\n }\n return filteredDeferUsageSet;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.mts new file mode 100644 index 00000000..c4eee768 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.mts @@ -0,0 +1,17 @@ +/** + * Execute GraphQL operations and produce GraphQL execution results. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { pathToArray as responsePathAsArray } from "../jsutils/Path.mjs"; +export { createSourceEventStream, execute, executeRootSelectionSet, executeSubscriptionEvent, executeSync, experimentalExecuteIncrementally, experimentalExecuteRootSelectionSet, defaultFieldResolver, defaultTypeResolver, mapSourceToResponseEvent, subscribe, validateExecutionArgs, validateSubscriptionArgs, } from "./execute.mjs"; +export { legacyExecuteIncrementally, legacyExecuteRootSelectionSet, } from "./legacyIncremental/legacyExecuteIncrementally.mjs"; +export type { AsyncWorkFinishedInfo, ExecutionArgs, ExecutionHooks, ValidatedExecutionArgs, ValidatedSubscriptionArgs, } from "./ExecutionArgs.mjs"; +export type { RootSelectionSetExecutor } from "./execute.mjs"; +export type { ExecutionResult, FormattedExecutionResult } from "./Executor.mjs"; +export type { ExperimentalIncrementalExecutionResults, InitialIncrementalExecutionResult, SubsequentIncrementalExecutionResult, IncrementalDeferResult, IncrementalStreamResult, IncrementalResult, FormattedExperimentalIncrementalExecutionResults, FormattedInitialIncrementalExecutionResult, FormattedSubsequentIncrementalExecutionResult, FormattedIncrementalDeferResult, FormattedIncrementalStreamResult, FormattedIncrementalResult, } from "./incremental/IncrementalExecutor.mjs"; +export type { LegacyExperimentalIncrementalExecutionResults, LegacyInitialIncrementalExecutionResult, LegacySubsequentIncrementalExecutionResult, LegacyIncrementalDeferResult, LegacyIncrementalStreamResult, LegacyIncrementalResult, FormattedLegacyExperimentalIncrementalExecutionResults, FormattedLegacyInitialIncrementalExecutionResult, FormattedLegacySubsequentIncrementalExecutionResult, FormattedLegacyIncrementalDeferResult, FormattedLegacyIncrementalStreamResult, FormattedLegacyIncrementalResult, } from "./legacyIncremental/BranchingIncrementalExecutor.mjs"; +export { AbortedGraphQLExecutionError } from "./AbortedGraphQLExecutionError.mjs"; +export { getArgumentValues, getVariableValues, getDirectiveValues, } from "./values.mjs"; +export type { VariableValues } from "./values.mjs"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.ts new file mode 100644 index 00000000..f301b188 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.d.ts @@ -0,0 +1,17 @@ +/** + * Execute GraphQL operations and produce GraphQL execution results. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { pathToArray as responsePathAsArray } from "../jsutils/Path.js"; +export { createSourceEventStream, execute, executeRootSelectionSet, executeSubscriptionEvent, executeSync, experimentalExecuteIncrementally, experimentalExecuteRootSelectionSet, defaultFieldResolver, defaultTypeResolver, mapSourceToResponseEvent, subscribe, validateExecutionArgs, validateSubscriptionArgs, } from "./execute.js"; +export { legacyExecuteIncrementally, legacyExecuteRootSelectionSet, } from "./legacyIncremental/legacyExecuteIncrementally.js"; +export type { AsyncWorkFinishedInfo, ExecutionArgs, ExecutionHooks, ValidatedExecutionArgs, ValidatedSubscriptionArgs, } from "./ExecutionArgs.js"; +export type { RootSelectionSetExecutor } from "./execute.js"; +export type { ExecutionResult, FormattedExecutionResult } from "./Executor.js"; +export type { ExperimentalIncrementalExecutionResults, InitialIncrementalExecutionResult, SubsequentIncrementalExecutionResult, IncrementalDeferResult, IncrementalStreamResult, IncrementalResult, FormattedExperimentalIncrementalExecutionResults, FormattedInitialIncrementalExecutionResult, FormattedSubsequentIncrementalExecutionResult, FormattedIncrementalDeferResult, FormattedIncrementalStreamResult, FormattedIncrementalResult, } from "./incremental/IncrementalExecutor.js"; +export type { LegacyExperimentalIncrementalExecutionResults, LegacyInitialIncrementalExecutionResult, LegacySubsequentIncrementalExecutionResult, LegacyIncrementalDeferResult, LegacyIncrementalStreamResult, LegacyIncrementalResult, FormattedLegacyExperimentalIncrementalExecutionResults, FormattedLegacyInitialIncrementalExecutionResult, FormattedLegacySubsequentIncrementalExecutionResult, FormattedLegacyIncrementalDeferResult, FormattedLegacyIncrementalStreamResult, FormattedLegacyIncrementalResult, } from "./legacyIncremental/BranchingIncrementalExecutor.js"; +export { AbortedGraphQLExecutionError } from "./AbortedGraphQLExecutionError.js"; +export { getArgumentValues, getVariableValues, getDirectiveValues, } from "./values.js"; +export type { VariableValues } from "./values.js"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js new file mode 100644 index 00000000..f7dc5994 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDirectiveValues = exports.getVariableValues = exports.getArgumentValues = exports.AbortedGraphQLExecutionError = exports.legacyExecuteRootSelectionSet = exports.legacyExecuteIncrementally = exports.validateSubscriptionArgs = exports.validateExecutionArgs = exports.subscribe = exports.mapSourceToResponseEvent = exports.defaultTypeResolver = exports.defaultFieldResolver = exports.experimentalExecuteRootSelectionSet = exports.experimentalExecuteIncrementally = exports.executeSync = exports.executeSubscriptionEvent = exports.executeRootSelectionSet = exports.execute = exports.createSourceEventStream = exports.responsePathAsArray = void 0; +var Path_ts_1 = require("../jsutils/Path.js"); +Object.defineProperty(exports, "responsePathAsArray", { enumerable: true, get: function () { return Path_ts_1.pathToArray; } }); +var execute_ts_1 = require("./execute.js"); +Object.defineProperty(exports, "createSourceEventStream", { enumerable: true, get: function () { return execute_ts_1.createSourceEventStream; } }); +Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return execute_ts_1.execute; } }); +Object.defineProperty(exports, "executeRootSelectionSet", { enumerable: true, get: function () { return execute_ts_1.executeRootSelectionSet; } }); +Object.defineProperty(exports, "executeSubscriptionEvent", { enumerable: true, get: function () { return execute_ts_1.executeSubscriptionEvent; } }); +Object.defineProperty(exports, "executeSync", { enumerable: true, get: function () { return execute_ts_1.executeSync; } }); +Object.defineProperty(exports, "experimentalExecuteIncrementally", { enumerable: true, get: function () { return execute_ts_1.experimentalExecuteIncrementally; } }); +Object.defineProperty(exports, "experimentalExecuteRootSelectionSet", { enumerable: true, get: function () { return execute_ts_1.experimentalExecuteRootSelectionSet; } }); +Object.defineProperty(exports, "defaultFieldResolver", { enumerable: true, get: function () { return execute_ts_1.defaultFieldResolver; } }); +Object.defineProperty(exports, "defaultTypeResolver", { enumerable: true, get: function () { return execute_ts_1.defaultTypeResolver; } }); +Object.defineProperty(exports, "mapSourceToResponseEvent", { enumerable: true, get: function () { return execute_ts_1.mapSourceToResponseEvent; } }); +Object.defineProperty(exports, "subscribe", { enumerable: true, get: function () { return execute_ts_1.subscribe; } }); +Object.defineProperty(exports, "validateExecutionArgs", { enumerable: true, get: function () { return execute_ts_1.validateExecutionArgs; } }); +Object.defineProperty(exports, "validateSubscriptionArgs", { enumerable: true, get: function () { return execute_ts_1.validateSubscriptionArgs; } }); +var legacyExecuteIncrementally_ts_1 = require("./legacyIncremental/legacyExecuteIncrementally.js"); +Object.defineProperty(exports, "legacyExecuteIncrementally", { enumerable: true, get: function () { return legacyExecuteIncrementally_ts_1.legacyExecuteIncrementally; } }); +Object.defineProperty(exports, "legacyExecuteRootSelectionSet", { enumerable: true, get: function () { return legacyExecuteIncrementally_ts_1.legacyExecuteRootSelectionSet; } }); +var AbortedGraphQLExecutionError_ts_1 = require("./AbortedGraphQLExecutionError.js"); +Object.defineProperty(exports, "AbortedGraphQLExecutionError", { enumerable: true, get: function () { return AbortedGraphQLExecutionError_ts_1.AbortedGraphQLExecutionError; } }); +var values_ts_1 = require("./values.js"); +Object.defineProperty(exports, "getArgumentValues", { enumerable: true, get: function () { return values_ts_1.getArgumentValues; } }); +Object.defineProperty(exports, "getVariableValues", { enumerable: true, get: function () { return values_ts_1.getVariableValues; } }); +Object.defineProperty(exports, "getDirectiveValues", { enumerable: true, get: function () { return values_ts_1.getDirectiveValues; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js.map new file mode 100644 index 00000000..8c07c511 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":";;;AAOA,8CAAwE;AAA/D,8GAAA,WAAW,OAAuB;AAE3C,2CAcsB;AAbpB,qHAAA,uBAAuB,OAAA;AACvB,qGAAA,OAAO,OAAA;AACP,qHAAA,uBAAuB,OAAA;AACvB,sHAAA,wBAAwB,OAAA;AACxB,yGAAA,WAAW,OAAA;AACX,8HAAA,gCAAgC,OAAA;AAChC,iIAAA,mCAAmC,OAAA;AACnC,kHAAA,oBAAoB,OAAA;AACpB,iHAAA,mBAAmB,OAAA;AACnB,sHAAA,wBAAwB,OAAA;AACxB,uGAAA,SAAS,OAAA;AACT,mHAAA,qBAAqB,OAAA;AACrB,sHAAA,wBAAwB,OAAA;AAE1B,mGAG2D;AAFzD,2IAAA,0BAA0B,OAAA;AAC1B,8IAAA,6BAA6B,OAAA;AA2C/B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,yCAIqB;AAHnB,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA","sourcesContent":["/**\n * Execute GraphQL operations and produce GraphQL execution results.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { pathToArray as responsePathAsArray } from '../jsutils/Path.ts';\n\nexport {\n createSourceEventStream,\n execute,\n executeRootSelectionSet,\n executeSubscriptionEvent,\n executeSync,\n experimentalExecuteIncrementally,\n experimentalExecuteRootSelectionSet,\n defaultFieldResolver,\n defaultTypeResolver,\n mapSourceToResponseEvent,\n subscribe,\n validateExecutionArgs,\n validateSubscriptionArgs,\n} from './execute.ts';\nexport {\n legacyExecuteIncrementally,\n legacyExecuteRootSelectionSet,\n} from './legacyIncremental/legacyExecuteIncrementally.ts';\nexport type {\n AsyncWorkFinishedInfo,\n ExecutionArgs,\n ExecutionHooks,\n ValidatedExecutionArgs,\n ValidatedSubscriptionArgs,\n} from './ExecutionArgs.ts';\nexport type { RootSelectionSetExecutor } from './execute.ts';\n\nexport type { ExecutionResult, FormattedExecutionResult } from './Executor.ts';\n\nexport type {\n ExperimentalIncrementalExecutionResults,\n InitialIncrementalExecutionResult,\n SubsequentIncrementalExecutionResult,\n IncrementalDeferResult,\n IncrementalStreamResult,\n IncrementalResult,\n FormattedExperimentalIncrementalExecutionResults,\n FormattedInitialIncrementalExecutionResult,\n FormattedSubsequentIncrementalExecutionResult,\n FormattedIncrementalDeferResult,\n FormattedIncrementalStreamResult,\n FormattedIncrementalResult,\n} from './incremental/IncrementalExecutor.ts';\n\nexport type {\n LegacyExperimentalIncrementalExecutionResults,\n LegacyInitialIncrementalExecutionResult,\n LegacySubsequentIncrementalExecutionResult,\n LegacyIncrementalDeferResult,\n LegacyIncrementalStreamResult,\n LegacyIncrementalResult,\n FormattedLegacyExperimentalIncrementalExecutionResults,\n FormattedLegacyInitialIncrementalExecutionResult,\n FormattedLegacySubsequentIncrementalExecutionResult,\n FormattedLegacyIncrementalDeferResult,\n FormattedLegacyIncrementalStreamResult,\n FormattedLegacyIncrementalResult,\n} from './legacyIncremental/BranchingIncrementalExecutor.ts';\n\nexport { AbortedGraphQLExecutionError } from './AbortedGraphQLExecutionError.ts';\n\nexport {\n getArgumentValues,\n getVariableValues,\n getDirectiveValues,\n} from './values.ts';\nexport type { VariableValues } from './values.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs new file mode 100644 index 00000000..422337d1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs @@ -0,0 +1,6 @@ +export { pathToArray as responsePathAsArray } from "../jsutils/Path.mjs"; +export { createSourceEventStream, execute, executeRootSelectionSet, executeSubscriptionEvent, executeSync, experimentalExecuteIncrementally, experimentalExecuteRootSelectionSet, defaultFieldResolver, defaultTypeResolver, mapSourceToResponseEvent, subscribe, validateExecutionArgs, validateSubscriptionArgs, } from "./execute.mjs"; +export { legacyExecuteIncrementally, legacyExecuteRootSelectionSet, } from "./legacyIncremental/legacyExecuteIncrementally.mjs"; +export { AbortedGraphQLExecutionError } from "./AbortedGraphQLExecutionError.mjs"; +export { getArgumentValues, getVariableValues, getDirectiveValues, } from "./values.mjs"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs.map new file mode 100644 index 00000000..8c294d65 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,4BAA2B;AAExE,OAAO,EACL,uBAAuB,EACvB,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,gCAAgC,EAChC,mCAAmC,EACnC,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,SAAS,EACT,qBAAqB,EACrB,wBAAwB,GACzB,sBAAqB;AACtB,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAC9B,2DAA0D;AA0C3D,OAAO,EAAE,4BAA4B,EAAE,2CAA0C;AAEjF,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,qBAAoB","sourcesContent":["/**\n * Execute GraphQL operations and produce GraphQL execution results.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { pathToArray as responsePathAsArray } from '../jsutils/Path.ts';\n\nexport {\n createSourceEventStream,\n execute,\n executeRootSelectionSet,\n executeSubscriptionEvent,\n executeSync,\n experimentalExecuteIncrementally,\n experimentalExecuteRootSelectionSet,\n defaultFieldResolver,\n defaultTypeResolver,\n mapSourceToResponseEvent,\n subscribe,\n validateExecutionArgs,\n validateSubscriptionArgs,\n} from './execute.ts';\nexport {\n legacyExecuteIncrementally,\n legacyExecuteRootSelectionSet,\n} from './legacyIncremental/legacyExecuteIncrementally.ts';\nexport type {\n AsyncWorkFinishedInfo,\n ExecutionArgs,\n ExecutionHooks,\n ValidatedExecutionArgs,\n ValidatedSubscriptionArgs,\n} from './ExecutionArgs.ts';\nexport type { RootSelectionSetExecutor } from './execute.ts';\n\nexport type { ExecutionResult, FormattedExecutionResult } from './Executor.ts';\n\nexport type {\n ExperimentalIncrementalExecutionResults,\n InitialIncrementalExecutionResult,\n SubsequentIncrementalExecutionResult,\n IncrementalDeferResult,\n IncrementalStreamResult,\n IncrementalResult,\n FormattedExperimentalIncrementalExecutionResults,\n FormattedInitialIncrementalExecutionResult,\n FormattedSubsequentIncrementalExecutionResult,\n FormattedIncrementalDeferResult,\n FormattedIncrementalStreamResult,\n FormattedIncrementalResult,\n} from './incremental/IncrementalExecutor.ts';\n\nexport type {\n LegacyExperimentalIncrementalExecutionResults,\n LegacyInitialIncrementalExecutionResult,\n LegacySubsequentIncrementalExecutionResult,\n LegacyIncrementalDeferResult,\n LegacyIncrementalStreamResult,\n LegacyIncrementalResult,\n FormattedLegacyExperimentalIncrementalExecutionResults,\n FormattedLegacyInitialIncrementalExecutionResult,\n FormattedLegacySubsequentIncrementalExecutionResult,\n FormattedLegacyIncrementalDeferResult,\n FormattedLegacyIncrementalStreamResult,\n FormattedLegacyIncrementalResult,\n} from './legacyIncremental/BranchingIncrementalExecutor.ts';\n\nexport { AbortedGraphQLExecutionError } from './AbortedGraphQLExecutionError.ts';\n\nexport {\n getArgumentValues,\n getVariableValues,\n getDirectiveValues,\n} from './values.ts';\nexport type { VariableValues } from './values.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts new file mode 100644 index 00000000..72b6ff9e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.mts @@ -0,0 +1,175 @@ +/** @category Legacy Incremental Execution */ +import type { ObjMap } from "../../jsutils/ObjMap.mjs"; +import type { GraphQLError, GraphQLFormattedError } from "../../error/GraphQLError.mjs"; +import type { GroupedFieldSet } from "../collectFields.mjs"; +import type { ExecutionResult, FormattedExecutionResult } from "../Executor.mjs"; +import type { DeferUsageSet, ExecutionPlan } from "../incremental/buildExecutionPlan.mjs"; +import { IncrementalExecutor } from "../incremental/IncrementalExecutor.mjs"; +/** + * Results for an operation that produced legacy incremental payloads. + * @typeParam TInitialData - Shape of the initial result data payload. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface LegacyExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Initial execution result delivered before subsequent legacy incremental payloads. */ + initialResult: LegacyInitialIncrementalExecutionResult; + /** Async stream of legacy incremental payloads delivered after the initial result. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * Initial execution result for an operation that produced legacy incremental payloads. + * + * Unlike `InitialIncrementalExecutionResult`, the legacy initial result does + * not include a `pending` list. Subsequent payloads identify their location + * directly with `path` and optional `label` fields. + * @typeParam TInitialData - Shape of the initial data payload. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface LegacyInitialIncrementalExecutionResult, TExtensions = ObjMap> extends ExecutionResult { + /** Data produced by the initial execution payload. */ + data: TInitialData; + /** Indicates that subsequent legacy incremental payloads will follow. */ + hasNext: true; + /** Additional non-standard metadata included in the initial result. */ + extensions?: TExtensions; +} +/** + * Subsequent payload produced by legacy incremental execution. + * + * Legacy subsequent payloads may contain deferred fragment data, streamed list + * items, or only `hasNext: false` to complete the response stream. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface LegacySubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Indicates whether more legacy incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * Deferred fragment or streamed list payload produced by legacy incremental execution. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export type LegacyIncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = LegacyIncrementalDeferResult | LegacyIncrementalStreamResult; +/** + * Legacy incremental payload produced by a deferred fragment. + * + * The payload location is identified directly by `path` and optional `label` + * instead of by an `id` from a pending entry. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface LegacyIncrementalDeferResult, TExtensions = ObjMap> extends ExecutionResult { + /** Response path to the deferred fragment payload. */ + path: ReadonlyArray; + /** Label from the `@defer` directive. */ + label?: string; +} +/** + * Legacy incremental payload produced by a streamed list field. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface LegacyIncrementalStreamResult> { + /** Errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Streamed list items delivered by this payload. */ + items: ReadonlyArray | null; + /** Response path to the first streamed list item in this payload. */ + path: ReadonlyArray; + /** Label from the `@stream` directive. */ + label?: string; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of legacy incremental execution results. + * @typeParam TInitialData - Shape of the formatted initial result data payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacyExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Formatted initial execution result. */ + initialResult: FormattedLegacyInitialIncrementalExecutionResult; + /** Async stream of formatted legacy incremental payloads. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * JSON-serializable form of a legacy initial incremental execution result. + * @typeParam TInitialData - Shape of the formatted initial data payload. + * @typeParam TExtensions - Shape of the formatted extensions payload. + */ +export interface FormattedLegacyInitialIncrementalExecutionResult, TExtensions = ObjMap> extends FormattedExecutionResult { + /** Formatted data produced by the initial execution payload. */ + data: TInitialData; + /** Indicates that subsequent legacy incremental payloads will follow. */ + hasNext: true; + /** Additional non-standard metadata included in the formatted initial result. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a legacy subsequent incremental execution payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacySubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Formatted deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Indicates whether more legacy incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable deferred fragment or streamed list payload produced by + * legacy incremental execution. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export type FormattedLegacyIncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = FormattedLegacyIncrementalDeferResult | FormattedLegacyIncrementalStreamResult; +/** + * JSON-serializable form of a legacy deferred fragment payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacyIncrementalDeferResult, TExtensions = ObjMap> extends FormattedExecutionResult { + /** Response path to the formatted deferred fragment payload. */ + path: ReadonlyArray; + /** Label from the `@defer` directive. */ + label?: string; +} +/** + * JSON-serializable form of a legacy streamed list payload. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacyIncrementalStreamResult> { + /** Formatted errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Formatted streamed list items delivered by this payload. */ + items: ReadonlyArray | null; + /** Response path to the first streamed list item in this formatted payload. */ + path: ReadonlyArray; + /** Label from the `@stream` directive. */ + label?: string; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** @internal */ +export declare class BranchingIncrementalExecutor extends IncrementalExecutor { + getCreateSubExecutor(): (deferUsageSet?: DeferUsageSet) => BranchingIncrementalExecutor; + buildResponse(data: ObjMap | null): ExecutionResult | LegacyExperimentalIncrementalExecutionResults; + buildRootExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; + buildSubExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts new file mode 100644 index 00000000..0aea9066 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.d.ts @@ -0,0 +1,175 @@ +/** @category Legacy Incremental Execution */ +import type { ObjMap } from "../../jsutils/ObjMap.js"; +import type { GraphQLError, GraphQLFormattedError } from "../../error/GraphQLError.js"; +import type { GroupedFieldSet } from "../collectFields.js"; +import type { ExecutionResult, FormattedExecutionResult } from "../Executor.js"; +import type { DeferUsageSet, ExecutionPlan } from "../incremental/buildExecutionPlan.js"; +import { IncrementalExecutor } from "../incremental/IncrementalExecutor.js"; +/** + * Results for an operation that produced legacy incremental payloads. + * @typeParam TInitialData - Shape of the initial result data payload. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface LegacyExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Initial execution result delivered before subsequent legacy incremental payloads. */ + initialResult: LegacyInitialIncrementalExecutionResult; + /** Async stream of legacy incremental payloads delivered after the initial result. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * Initial execution result for an operation that produced legacy incremental payloads. + * + * Unlike `InitialIncrementalExecutionResult`, the legacy initial result does + * not include a `pending` list. Subsequent payloads identify their location + * directly with `path` and optional `label` fields. + * @typeParam TInitialData - Shape of the initial data payload. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface LegacyInitialIncrementalExecutionResult, TExtensions = ObjMap> extends ExecutionResult { + /** Data produced by the initial execution payload. */ + data: TInitialData; + /** Indicates that subsequent legacy incremental payloads will follow. */ + hasNext: true; + /** Additional non-standard metadata included in the initial result. */ + extensions?: TExtensions; +} +/** + * Subsequent payload produced by legacy incremental execution. + * + * Legacy subsequent payloads may contain deferred fragment data, streamed list + * items, or only `hasNext: false` to complete the response stream. + * @typeParam TDeferredData - Shape of deferred fragment data payloads. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of the extensions payload. + */ +export interface LegacySubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Indicates whether more legacy incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * Deferred fragment or streamed list payload produced by legacy incremental execution. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export type LegacyIncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = LegacyIncrementalDeferResult | LegacyIncrementalStreamResult; +/** + * Legacy incremental payload produced by a deferred fragment. + * + * The payload location is identified directly by `path` and optional `label` + * instead of by an `id` from a pending entry. + * @typeParam TDeferredData - Shape of deferred fragment data. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface LegacyIncrementalDeferResult, TExtensions = ObjMap> extends ExecutionResult { + /** Response path to the deferred fragment payload. */ + path: ReadonlyArray; + /** Label from the `@defer` directive. */ + label?: string; +} +/** + * Legacy incremental payload produced by a streamed list field. + * @typeParam TStreamItem - Shape of streamed list items. + * @typeParam TExtensions - Shape of extensions payloads. + */ +export interface LegacyIncrementalStreamResult> { + /** Errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Streamed list items delivered by this payload. */ + items: ReadonlyArray | null; + /** Response path to the first streamed list item in this payload. */ + path: ReadonlyArray; + /** Label from the `@stream` directive. */ + label?: string; + /** Additional non-standard metadata included in this payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of legacy incremental execution results. + * @typeParam TInitialData - Shape of the formatted initial result data payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacyExperimentalIncrementalExecutionResults, TDeferredData = ObjMap, TStreamItem = unknown, TExtensions = ObjMap> { + /** Formatted initial execution result. */ + initialResult: FormattedLegacyInitialIncrementalExecutionResult; + /** Async stream of formatted legacy incremental payloads. */ + subsequentResults: AsyncGenerator, void, void>; +} +/** + * JSON-serializable form of a legacy initial incremental execution result. + * @typeParam TInitialData - Shape of the formatted initial data payload. + * @typeParam TExtensions - Shape of the formatted extensions payload. + */ +export interface FormattedLegacyInitialIncrementalExecutionResult, TExtensions = ObjMap> extends FormattedExecutionResult { + /** Formatted data produced by the initial execution payload. */ + data: TInitialData; + /** Indicates that subsequent legacy incremental payloads will follow. */ + hasNext: true; + /** Additional non-standard metadata included in the formatted initial result. */ + extensions?: TExtensions; +} +/** + * JSON-serializable form of a legacy subsequent incremental execution payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacySubsequentIncrementalExecutionResult, TStreamItem = unknown, TExtensions = ObjMap> { + /** Formatted deferred or streamed payloads delivered by this response. */ + incremental?: ReadonlyArray>; + /** Indicates whether more legacy incremental payloads will follow. */ + hasNext: boolean; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** + * JSON-serializable deferred fragment or streamed list payload produced by + * legacy incremental execution. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export type FormattedLegacyIncrementalResult, TStreamItem = unknown, TExtensions = ObjMap> = FormattedLegacyIncrementalDeferResult | FormattedLegacyIncrementalStreamResult; +/** + * JSON-serializable form of a legacy deferred fragment payload. + * @typeParam TDeferredData - Shape of formatted deferred fragment data. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacyIncrementalDeferResult, TExtensions = ObjMap> extends FormattedExecutionResult { + /** Response path to the formatted deferred fragment payload. */ + path: ReadonlyArray; + /** Label from the `@defer` directive. */ + label?: string; +} +/** + * JSON-serializable form of a legacy streamed list payload. + * @typeParam TStreamItem - Shape of formatted streamed list items. + * @typeParam TExtensions - Shape of formatted extensions payloads. + */ +export interface FormattedLegacyIncrementalStreamResult> { + /** Formatted errors raised while producing streamed items. */ + errors?: ReadonlyArray; + /** Formatted streamed list items delivered by this payload. */ + items: ReadonlyArray | null; + /** Response path to the first streamed list item in this formatted payload. */ + path: ReadonlyArray; + /** Label from the `@stream` directive. */ + label?: string; + /** Additional non-standard metadata included in this formatted payload. */ + extensions?: TExtensions; +} +/** @internal */ +export declare class BranchingIncrementalExecutor extends IncrementalExecutor { + getCreateSubExecutor(): (deferUsageSet?: DeferUsageSet) => BranchingIncrementalExecutor; + buildResponse(data: ObjMap | null): ExecutionResult | LegacyExperimentalIncrementalExecutionResults; + buildRootExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; + buildSubExecutionPlan(originalGroupedFieldSet: GroupedFieldSet): ExecutionPlan; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js new file mode 100644 index 00000000..acc6b504 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BranchingIncrementalExecutor = void 0; +const AccumulatorMap_ts_1 = require("../../jsutils/AccumulatorMap.js"); +const getBySet_ts_1 = require("../../jsutils/getBySet.js"); +const invariant_ts_1 = require("../../jsutils/invariant.js"); +const isSameSet_ts_1 = require("../../jsutils/isSameSet.js"); +const memoize1_ts_1 = require("../../jsutils/memoize1.js"); +const memoize2_ts_1 = require("../../jsutils/memoize2.js"); +const IncrementalExecutor_ts_1 = require("../incremental/IncrementalExecutor.js"); +const BranchingIncrementalPublisher_ts_1 = require("./BranchingIncrementalPublisher.js"); +const buildBranchingExecutionPlanFromInitial = (0, memoize1_ts_1.memoize1)((groupedFieldSet) => buildBranchingExecutionPlan(groupedFieldSet)); +const buildBranchingExecutionPlanFromDeferred = (0, memoize2_ts_1.memoize2)((groupedFieldSet, deferUsageSet) => buildBranchingExecutionPlan(groupedFieldSet, deferUsageSet)); +class BranchingIncrementalExecutor extends IncrementalExecutor_ts_1.IncrementalExecutor { + getCreateSubExecutor() { + const validatedExecutionArgs = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + return (deferUsageSet) => new BranchingIncrementalExecutor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet); + } + buildResponse(data) { + const work = this.getIncrementalWork(); + const { tasks, streams } = work; + if (tasks?.length === 0 && streams?.length === 0) { + return super.buildResponse(data); + } + const errors = this.collectedErrors.errors; + if (!(data !== null)) + (0, invariant_ts_1.invariant)(false); + const incrementalPublisher = new BranchingIncrementalPublisher_ts_1.BranchingIncrementalPublisher(); + return incrementalPublisher.buildResponse(data, errors, work, this.validatedExecutionArgs.externalAbortSignal, this.getFinishSharedExecution()); + } + buildRootExecutionPlan(originalGroupedFieldSet) { + return buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet); + } + buildSubExecutionPlan(originalGroupedFieldSet) { + return this.deferUsageSet === undefined + ? buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet) + : buildBranchingExecutionPlanFromDeferred(originalGroupedFieldSet, this.deferUsageSet); + } +} +exports.BranchingIncrementalExecutor = BranchingIncrementalExecutor; +function buildBranchingExecutionPlan(originalGroupedFieldSet, parentDeferUsages = new Set()) { + const groupedFieldSet = new AccumulatorMap_ts_1.AccumulatorMap(); + const newGroupedFieldSets = new Map(); + for (const [responseKey, fieldGroup] of originalGroupedFieldSet) { + for (const fieldDetails of fieldGroup) { + const deferUsage = fieldDetails.deferUsage; + const deferUsageSet = deferUsage === undefined + ? new Set() + : new Set([deferUsage]); + if ((0, isSameSet_ts_1.isSameSet)(parentDeferUsages, deferUsageSet)) { + groupedFieldSet.add(responseKey, fieldDetails); + } + else { + let newGroupedFieldSet = (0, getBySet_ts_1.getBySet)(newGroupedFieldSets, deferUsageSet); + if (newGroupedFieldSet === undefined) { + newGroupedFieldSet = new AccumulatorMap_ts_1.AccumulatorMap(); + newGroupedFieldSets.set(deferUsageSet, newGroupedFieldSet); + } + newGroupedFieldSet.add(responseKey, fieldDetails); + } + } + } + return { + groupedFieldSet, + newGroupedFieldSets, + }; +} +//# sourceMappingURL=BranchingIncrementalExecutor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js.map new file mode 100644 index 00000000..a3fee9ac --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BranchingIncrementalExecutor.js","sourceRoot":"","sources":["../../../src/execution/legacyIncremental/BranchingIncrementalExecutor.ts"],"names":[],"mappings":";;;AAEA,uEAAiE;AACjE,2DAAqD;AACrD,6DAAuD;AACvD,6DAAuD;AACvD,2DAAqD;AACrD,2DAAqD;AAkBrD,kFAA4E;AAE5E,yFAAmF;AAkInF,MAAM,sCAAsC,GAAG,IAAA,sBAAQ,EACrD,CAAC,eAAgC,EAAE,EAAE,CACnC,2BAA2B,CAAC,eAAe,CAAC,CAC/C,CAAC;AAEF,MAAM,uCAAuC,GAAG,IAAA,sBAAQ,EACtD,CAAC,eAAgC,EAAE,aAA4B,EAAE,EAAE,CACjE,2BAA2B,CAAC,eAAe,EAAE,aAAa,CAAC,CAC9D,CAAC;AAyHF,MAAa,4BAA6B,SAAQ,4CAAkE;IACzG,oBAAoB;QAG3B,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QAC3D,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QAE3D,OAAO,CAAC,aAA6B,EAAE,EAAE,CACvC,IAAI,4BAA4B,CAC9B,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,CACd,CAAC;IACN,CAAC;IAEQ,aAAa,CACpB,IAA4B;QAE5B,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACvC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAChC,IAAI,KAAK,EAAE,MAAM,KAAK,CAAC,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YACjD,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;cACjC,IAAI,KAAK,IAAI;gBAAvB,wBA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,mBAAmB,EAAE,aAAa,CAAC,CAAC;gBACtE,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;oBACrC,kBAAkB,GAAG,IAAI,kCAAc,EAAE,CAAC;oBAC1C,mBAAmB,CAAC,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;gBAC7D,CAAC;gBACD,kBAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,eAAe;QACf,mBAAmB;KACpB,CAAC;AACJ,CAAC","sourcesContent":["/** @category Legacy Incremental Execution */\n\nimport { AccumulatorMap } from '../../jsutils/AccumulatorMap.ts';\nimport { getBySet } from '../../jsutils/getBySet.ts';\nimport { invariant } from '../../jsutils/invariant.ts';\nimport { isSameSet } from '../../jsutils/isSameSet.ts';\nimport { memoize1 } from '../../jsutils/memoize1.ts';\nimport { memoize2 } from '../../jsutils/memoize2.ts';\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\n\nimport type {\n GraphQLError,\n GraphQLFormattedError,\n} from '../../error/GraphQLError.ts';\n\nimport type {\n DeferUsage,\n FieldDetails,\n GroupedFieldSet,\n} from '../collectFields.ts';\nimport type { ExecutionResult, FormattedExecutionResult } from '../Executor.ts';\nimport type {\n DeferUsageSet,\n ExecutionPlan,\n} from '../incremental/buildExecutionPlan.ts';\nimport { IncrementalExecutor } from '../incremental/IncrementalExecutor.ts';\n\nimport { BranchingIncrementalPublisher } from './BranchingIncrementalPublisher.ts';\n\n/**\n * Results for an operation that produced legacy incremental payloads.\n * @typeParam TInitialData - Shape of the initial result data payload.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface LegacyExperimentalIncrementalExecutionResults<\n TInitialData = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Initial execution result delivered before subsequent legacy incremental payloads. */\n initialResult: LegacyInitialIncrementalExecutionResult<\n TInitialData,\n TExtensions\n >;\n /** Async stream of legacy incremental payloads delivered after the initial result. */\n subsequentResults: AsyncGenerator<\n LegacySubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n\n/**\n * Initial execution result for an operation that produced legacy incremental payloads.\n *\n * Unlike `InitialIncrementalExecutionResult`, the legacy initial result does\n * not include a `pending` list. Subsequent payloads identify their location\n * directly with `path` and optional `label` fields.\n * @typeParam TInitialData - Shape of the initial data payload.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface LegacyInitialIncrementalExecutionResult<\n TInitialData = ObjMap,\n TExtensions = ObjMap,\n> extends ExecutionResult {\n /** Data produced by the initial execution payload. */\n data: TInitialData;\n /** Indicates that subsequent legacy incremental payloads will follow. */\n hasNext: true;\n /** Additional non-standard metadata included in the initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * Subsequent payload produced by legacy incremental execution.\n *\n * Legacy subsequent payloads may contain deferred fragment data, streamed list\n * items, or only `hasNext: false` to complete the response stream.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface LegacySubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n LegacyIncrementalResult\n >;\n /** Indicates whether more legacy incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Deferred fragment or streamed list payload produced by legacy incremental execution.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport type LegacyIncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | LegacyIncrementalDeferResult\n | LegacyIncrementalStreamResult;\n\n/**\n * Legacy incremental payload produced by a deferred fragment.\n *\n * The payload location is identified directly by `path` and optional `label`\n * instead of by an `id` from a pending entry.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface LegacyIncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> extends ExecutionResult {\n /** Response path to the deferred fragment payload. */\n path: ReadonlyArray;\n /** Label from the `@defer` directive. */\n label?: string;\n}\n\n/**\n * Legacy incremental payload produced by a streamed list field.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface LegacyIncrementalStreamResult<\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Streamed list items delivered by this payload. */\n items: ReadonlyArray | null;\n /** Response path to the first streamed list item in this payload. */\n path: ReadonlyArray;\n /** Label from the `@stream` directive. */\n label?: string;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\nconst buildBranchingExecutionPlanFromInitial = memoize1(\n (groupedFieldSet: GroupedFieldSet) =>\n buildBranchingExecutionPlan(groupedFieldSet),\n);\n\nconst buildBranchingExecutionPlanFromDeferred = memoize2(\n (groupedFieldSet: GroupedFieldSet, deferUsageSet: DeferUsageSet) =>\n buildBranchingExecutionPlan(groupedFieldSet, deferUsageSet),\n);\n\n/**\n * JSON-serializable form of legacy incremental execution results.\n * @typeParam TInitialData - Shape of the formatted initial result data payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacyExperimentalIncrementalExecutionResults<\n TInitialData = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted initial execution result. */\n initialResult: FormattedLegacyInitialIncrementalExecutionResult<\n TInitialData,\n TExtensions\n >;\n /** Async stream of formatted legacy incremental payloads. */\n subsequentResults: AsyncGenerator<\n FormattedLegacySubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n\n/**\n * JSON-serializable form of a legacy initial incremental execution result.\n * @typeParam TInitialData - Shape of the formatted initial data payload.\n * @typeParam TExtensions - Shape of the formatted extensions payload.\n */\nexport interface FormattedLegacyInitialIncrementalExecutionResult<\n TInitialData = ObjMap,\n TExtensions = ObjMap,\n> extends FormattedExecutionResult {\n /** Formatted data produced by the initial execution payload. */\n data: TInitialData;\n /** Indicates that subsequent legacy incremental payloads will follow. */\n hasNext: true;\n /** Additional non-standard metadata included in the formatted initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a legacy subsequent incremental execution payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacySubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n FormattedLegacyIncrementalResult\n >;\n /** Indicates whether more legacy incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable deferred fragment or streamed list payload produced by\n * legacy incremental execution.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport type FormattedLegacyIncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | FormattedLegacyIncrementalDeferResult\n | FormattedLegacyIncrementalStreamResult;\n\n/**\n * JSON-serializable form of a legacy deferred fragment payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacyIncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> extends FormattedExecutionResult {\n /** Response path to the formatted deferred fragment payload. */\n path: ReadonlyArray;\n /** Label from the `@defer` directive. */\n label?: string;\n}\n\n/**\n * JSON-serializable form of a legacy streamed list payload.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacyIncrementalStreamResult<\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Formatted streamed list items delivered by this payload. */\n items: ReadonlyArray | null;\n /** Response path to the first streamed list item in this formatted payload. */\n path: ReadonlyArray;\n /** Label from the `@stream` directive. */\n label?: string;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n/** @internal */\nexport class BranchingIncrementalExecutor extends IncrementalExecutor {\n override getCreateSubExecutor(): (\n deferUsageSet?: DeferUsageSet,\n ) => BranchingIncrementalExecutor {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n\n return (deferUsageSet?: DeferUsageSet) =>\n new BranchingIncrementalExecutor(\n validatedExecutionArgs,\n sharedExecutionContext,\n deferUsageSet,\n );\n }\n\n override buildResponse(\n data: ObjMap | null,\n ): ExecutionResult | LegacyExperimentalIncrementalExecutionResults {\n const work = this.getIncrementalWork();\n const { tasks, streams } = work;\n if (tasks?.length === 0 && streams?.length === 0) {\n return super.buildResponse(data);\n }\n\n const errors = this.collectedErrors.errors;\n invariant(data !== null);\n const incrementalPublisher = new BranchingIncrementalPublisher();\n return incrementalPublisher.buildResponse(\n data,\n errors,\n work,\n this.validatedExecutionArgs.externalAbortSignal,\n this.getFinishSharedExecution(),\n );\n }\n\n override buildRootExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet);\n }\n\n override buildSubExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return this.deferUsageSet === undefined\n ? buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet)\n : buildBranchingExecutionPlanFromDeferred(\n originalGroupedFieldSet,\n this.deferUsageSet,\n );\n }\n}\n\nfunction buildBranchingExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n parentDeferUsages: DeferUsageSet = new Set(),\n): ExecutionPlan {\n const groupedFieldSet = new AccumulatorMap();\n\n const newGroupedFieldSets = new Map<\n DeferUsageSet,\n AccumulatorMap\n >();\n\n for (const [responseKey, fieldGroup] of originalGroupedFieldSet) {\n for (const fieldDetails of fieldGroup) {\n const deferUsage = fieldDetails.deferUsage;\n const deferUsageSet =\n deferUsage === undefined\n ? new Set()\n : new Set([deferUsage]);\n if (isSameSet(parentDeferUsages, deferUsageSet)) {\n groupedFieldSet.add(responseKey, fieldDetails);\n } else {\n let newGroupedFieldSet = getBySet(newGroupedFieldSets, deferUsageSet);\n if (newGroupedFieldSet === undefined) {\n newGroupedFieldSet = new AccumulatorMap();\n newGroupedFieldSets.set(deferUsageSet, newGroupedFieldSet);\n }\n newGroupedFieldSet.add(responseKey, fieldDetails);\n }\n }\n }\n\n return {\n groupedFieldSet,\n newGroupedFieldSets,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs new file mode 100644 index 00000000..151b0fd8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs @@ -0,0 +1,65 @@ +import { AccumulatorMap } from "../../jsutils/AccumulatorMap.mjs"; +import { getBySet } from "../../jsutils/getBySet.mjs"; +import { invariant } from "../../jsutils/invariant.mjs"; +import { isSameSet } from "../../jsutils/isSameSet.mjs"; +import { memoize1 } from "../../jsutils/memoize1.mjs"; +import { memoize2 } from "../../jsutils/memoize2.mjs"; +import { IncrementalExecutor } from "../incremental/IncrementalExecutor.mjs"; +import { BranchingIncrementalPublisher } from "./BranchingIncrementalPublisher.mjs"; +const buildBranchingExecutionPlanFromInitial = memoize1((groupedFieldSet) => buildBranchingExecutionPlan(groupedFieldSet)); +const buildBranchingExecutionPlanFromDeferred = memoize2((groupedFieldSet, deferUsageSet) => buildBranchingExecutionPlan(groupedFieldSet, deferUsageSet)); +export class BranchingIncrementalExecutor extends IncrementalExecutor { + getCreateSubExecutor() { + const validatedExecutionArgs = this.validatedExecutionArgs; + const sharedExecutionContext = this.sharedExecutionContext; + return (deferUsageSet) => new BranchingIncrementalExecutor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet); + } + buildResponse(data) { + const work = this.getIncrementalWork(); + const { tasks, streams } = work; + if (tasks?.length === 0 && streams?.length === 0) { + return super.buildResponse(data); + } + const errors = this.collectedErrors.errors; + if (!(data !== null)) + invariant(false); + const incrementalPublisher = new BranchingIncrementalPublisher(); + return incrementalPublisher.buildResponse(data, errors, work, this.validatedExecutionArgs.externalAbortSignal, this.getFinishSharedExecution()); + } + buildRootExecutionPlan(originalGroupedFieldSet) { + return buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet); + } + buildSubExecutionPlan(originalGroupedFieldSet) { + return this.deferUsageSet === undefined + ? buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet) + : buildBranchingExecutionPlanFromDeferred(originalGroupedFieldSet, this.deferUsageSet); + } +} +function buildBranchingExecutionPlan(originalGroupedFieldSet, parentDeferUsages = new Set()) { + const groupedFieldSet = new AccumulatorMap(); + const newGroupedFieldSets = new Map(); + for (const [responseKey, fieldGroup] of originalGroupedFieldSet) { + for (const fieldDetails of fieldGroup) { + const deferUsage = fieldDetails.deferUsage; + const deferUsageSet = deferUsage === undefined + ? new Set() + : new Set([deferUsage]); + if (isSameSet(parentDeferUsages, deferUsageSet)) { + groupedFieldSet.add(responseKey, fieldDetails); + } + else { + let newGroupedFieldSet = getBySet(newGroupedFieldSets, deferUsageSet); + if (newGroupedFieldSet === undefined) { + newGroupedFieldSet = new AccumulatorMap(); + newGroupedFieldSets.set(deferUsageSet, newGroupedFieldSet); + } + newGroupedFieldSet.add(responseKey, fieldDetails); + } + } + } + return { + groupedFieldSet, + newGroupedFieldSets, + }; +} +//# sourceMappingURL=BranchingIncrementalExecutor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs.map new file mode 100644 index 00000000..aad28e7e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"BranchingIncrementalExecutor.js","sourceRoot":"","sources":["../../../src/execution/legacyIncremental/BranchingIncrementalExecutor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,yCAAwC;AACjE,OAAO,EAAE,QAAQ,EAAE,mCAAkC;AACrD,OAAO,EAAE,SAAS,EAAE,oCAAmC;AACvD,OAAO,EAAE,SAAS,EAAE,oCAAmC;AACvD,OAAO,EAAE,QAAQ,EAAE,mCAAkC;AACrD,OAAO,EAAE,QAAQ,EAAE,mCAAkC;AAkBrD,OAAO,EAAE,mBAAmB,EAAE,+CAA8C;AAE5E,OAAO,EAAE,6BAA6B,EAAE,4CAA2C;AAkInF,MAAM,sCAAsC,GAAG,QAAQ,CACrD,CAAC,eAAgC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ental Execution */\n\nimport { AccumulatorMap } from '../../jsutils/AccumulatorMap.ts';\nimport { getBySet } from '../../jsutils/getBySet.ts';\nimport { invariant } from '../../jsutils/invariant.ts';\nimport { isSameSet } from '../../jsutils/isSameSet.ts';\nimport { memoize1 } from '../../jsutils/memoize1.ts';\nimport { memoize2 } from '../../jsutils/memoize2.ts';\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\n\nimport type {\n GraphQLError,\n GraphQLFormattedError,\n} from '../../error/GraphQLError.ts';\n\nimport type {\n DeferUsage,\n FieldDetails,\n GroupedFieldSet,\n} from '../collectFields.ts';\nimport type { ExecutionResult, FormattedExecutionResult } from '../Executor.ts';\nimport type {\n DeferUsageSet,\n ExecutionPlan,\n} from '../incremental/buildExecutionPlan.ts';\nimport { IncrementalExecutor } from '../incremental/IncrementalExecutor.ts';\n\nimport { BranchingIncrementalPublisher } from './BranchingIncrementalPublisher.ts';\n\n/**\n * Results for an operation that produced legacy incremental payloads.\n * @typeParam TInitialData - Shape of the initial result data payload.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface LegacyExperimentalIncrementalExecutionResults<\n TInitialData = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Initial execution result delivered before subsequent legacy incremental payloads. */\n initialResult: LegacyInitialIncrementalExecutionResult<\n TInitialData,\n TExtensions\n >;\n /** Async stream of legacy incremental payloads delivered after the initial result. */\n subsequentResults: AsyncGenerator<\n LegacySubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n\n/**\n * Initial execution result for an operation that produced legacy incremental payloads.\n *\n * Unlike `InitialIncrementalExecutionResult`, the legacy initial result does\n * not include a `pending` list. Subsequent payloads identify their location\n * directly with `path` and optional `label` fields.\n * @typeParam TInitialData - Shape of the initial data payload.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface LegacyInitialIncrementalExecutionResult<\n TInitialData = ObjMap,\n TExtensions = ObjMap,\n> extends ExecutionResult {\n /** Data produced by the initial execution payload. */\n data: TInitialData;\n /** Indicates that subsequent legacy incremental payloads will follow. */\n hasNext: true;\n /** Additional non-standard metadata included in the initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * Subsequent payload produced by legacy incremental execution.\n *\n * Legacy subsequent payloads may contain deferred fragment data, streamed list\n * items, or only `hasNext: false` to complete the response stream.\n * @typeParam TDeferredData - Shape of deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of the extensions payload.\n */\nexport interface LegacySubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n LegacyIncrementalResult\n >;\n /** Indicates whether more legacy incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\n/**\n * Deferred fragment or streamed list payload produced by legacy incremental execution.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport type LegacyIncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | LegacyIncrementalDeferResult\n | LegacyIncrementalStreamResult;\n\n/**\n * Legacy incremental payload produced by a deferred fragment.\n *\n * The payload location is identified directly by `path` and optional `label`\n * instead of by an `id` from a pending entry.\n * @typeParam TDeferredData - Shape of deferred fragment data.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface LegacyIncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> extends ExecutionResult {\n /** Response path to the deferred fragment payload. */\n path: ReadonlyArray;\n /** Label from the `@defer` directive. */\n label?: string;\n}\n\n/**\n * Legacy incremental payload produced by a streamed list field.\n * @typeParam TStreamItem - Shape of streamed list items.\n * @typeParam TExtensions - Shape of extensions payloads.\n */\nexport interface LegacyIncrementalStreamResult<\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Streamed list items delivered by this payload. */\n items: ReadonlyArray | null;\n /** Response path to the first streamed list item in this payload. */\n path: ReadonlyArray;\n /** Label from the `@stream` directive. */\n label?: string;\n /** Additional non-standard metadata included in this payload. */\n extensions?: TExtensions;\n}\n\nconst buildBranchingExecutionPlanFromInitial = memoize1(\n (groupedFieldSet: GroupedFieldSet) =>\n buildBranchingExecutionPlan(groupedFieldSet),\n);\n\nconst buildBranchingExecutionPlanFromDeferred = memoize2(\n (groupedFieldSet: GroupedFieldSet, deferUsageSet: DeferUsageSet) =>\n buildBranchingExecutionPlan(groupedFieldSet, deferUsageSet),\n);\n\n/**\n * JSON-serializable form of legacy incremental execution results.\n * @typeParam TInitialData - Shape of the formatted initial result data payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacyExperimentalIncrementalExecutionResults<\n TInitialData = ObjMap,\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted initial execution result. */\n initialResult: FormattedLegacyInitialIncrementalExecutionResult<\n TInitialData,\n TExtensions\n >;\n /** Async stream of formatted legacy incremental payloads. */\n subsequentResults: AsyncGenerator<\n FormattedLegacySubsequentIncrementalExecutionResult<\n TDeferredData,\n TStreamItem,\n TExtensions\n >,\n void,\n void\n >;\n}\n\n/**\n * JSON-serializable form of a legacy initial incremental execution result.\n * @typeParam TInitialData - Shape of the formatted initial data payload.\n * @typeParam TExtensions - Shape of the formatted extensions payload.\n */\nexport interface FormattedLegacyInitialIncrementalExecutionResult<\n TInitialData = ObjMap,\n TExtensions = ObjMap,\n> extends FormattedExecutionResult {\n /** Formatted data produced by the initial execution payload. */\n data: TInitialData;\n /** Indicates that subsequent legacy incremental payloads will follow. */\n hasNext: true;\n /** Additional non-standard metadata included in the formatted initial result. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable form of a legacy subsequent incremental execution payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data payloads.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacySubsequentIncrementalExecutionResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted deferred or streamed payloads delivered by this response. */\n incremental?: ReadonlyArray<\n FormattedLegacyIncrementalResult\n >;\n /** Indicates whether more legacy incremental payloads will follow. */\n hasNext: boolean;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n\n/**\n * JSON-serializable deferred fragment or streamed list payload produced by\n * legacy incremental execution.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport type FormattedLegacyIncrementalResult<\n TDeferredData = ObjMap,\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> =\n | FormattedLegacyIncrementalDeferResult\n | FormattedLegacyIncrementalStreamResult;\n\n/**\n * JSON-serializable form of a legacy deferred fragment payload.\n * @typeParam TDeferredData - Shape of formatted deferred fragment data.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacyIncrementalDeferResult<\n TDeferredData = ObjMap,\n TExtensions = ObjMap,\n> extends FormattedExecutionResult {\n /** Response path to the formatted deferred fragment payload. */\n path: ReadonlyArray;\n /** Label from the `@defer` directive. */\n label?: string;\n}\n\n/**\n * JSON-serializable form of a legacy streamed list payload.\n * @typeParam TStreamItem - Shape of formatted streamed list items.\n * @typeParam TExtensions - Shape of formatted extensions payloads.\n */\nexport interface FormattedLegacyIncrementalStreamResult<\n TStreamItem = unknown,\n TExtensions = ObjMap,\n> {\n /** Formatted errors raised while producing streamed items. */\n errors?: ReadonlyArray;\n /** Formatted streamed list items delivered by this payload. */\n items: ReadonlyArray | null;\n /** Response path to the first streamed list item in this formatted payload. */\n path: ReadonlyArray;\n /** Label from the `@stream` directive. */\n label?: string;\n /** Additional non-standard metadata included in this formatted payload. */\n extensions?: TExtensions;\n}\n/** @internal */\nexport class BranchingIncrementalExecutor extends IncrementalExecutor {\n override getCreateSubExecutor(): (\n deferUsageSet?: DeferUsageSet,\n ) => BranchingIncrementalExecutor {\n const validatedExecutionArgs = this.validatedExecutionArgs;\n const sharedExecutionContext = this.sharedExecutionContext;\n\n return (deferUsageSet?: DeferUsageSet) =>\n new BranchingIncrementalExecutor(\n validatedExecutionArgs,\n sharedExecutionContext,\n deferUsageSet,\n );\n }\n\n override buildResponse(\n data: ObjMap | null,\n ): ExecutionResult | LegacyExperimentalIncrementalExecutionResults {\n const work = this.getIncrementalWork();\n const { tasks, streams } = work;\n if (tasks?.length === 0 && streams?.length === 0) {\n return super.buildResponse(data);\n }\n\n const errors = this.collectedErrors.errors;\n invariant(data !== null);\n const incrementalPublisher = new BranchingIncrementalPublisher();\n return incrementalPublisher.buildResponse(\n data,\n errors,\n work,\n this.validatedExecutionArgs.externalAbortSignal,\n this.getFinishSharedExecution(),\n );\n }\n\n override buildRootExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet);\n }\n\n override buildSubExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n ): ExecutionPlan {\n return this.deferUsageSet === undefined\n ? buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet)\n : buildBranchingExecutionPlanFromDeferred(\n originalGroupedFieldSet,\n this.deferUsageSet,\n );\n }\n}\n\nfunction buildBranchingExecutionPlan(\n originalGroupedFieldSet: GroupedFieldSet,\n parentDeferUsages: DeferUsageSet = new Set(),\n): ExecutionPlan {\n const groupedFieldSet = new AccumulatorMap();\n\n const newGroupedFieldSets = new Map<\n DeferUsageSet,\n AccumulatorMap\n >();\n\n for (const [responseKey, fieldGroup] of originalGroupedFieldSet) {\n for (const fieldDetails of fieldGroup) {\n const deferUsage = fieldDetails.deferUsage;\n const deferUsageSet =\n deferUsage === undefined\n ? new Set()\n : new Set([deferUsage]);\n if (isSameSet(parentDeferUsages, deferUsageSet)) {\n groupedFieldSet.add(responseKey, fieldDetails);\n } else {\n let newGroupedFieldSet = getBySet(newGroupedFieldSets, deferUsageSet);\n if (newGroupedFieldSet === undefined) {\n newGroupedFieldSet = new AccumulatorMap();\n newGroupedFieldSets.set(deferUsageSet, newGroupedFieldSet);\n }\n newGroupedFieldSet.add(responseKey, fieldDetails);\n }\n }\n }\n\n return {\n groupedFieldSet,\n newGroupedFieldSets,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts new file mode 100644 index 00000000..6d6d3d90 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.mts @@ -0,0 +1,12 @@ +import type { ObjMap } from "../../jsutils/ObjMap.mjs"; +import type { GraphQLError } from "../../error/GraphQLError.mjs"; +import type { IncrementalWork } from "../incremental/IncrementalExecutor.mjs"; +import type { LegacyExperimentalIncrementalExecutionResults } from "./BranchingIncrementalExecutor.mjs"; +/** @internal */ +export declare class BranchingIncrementalPublisher { + private _indices; + constructor(); + buildResponse(data: ObjMap, errors: ReadonlyArray, work: IncrementalWork, abortSignal: AbortSignal | undefined, onFinished: () => void): LegacyExperimentalIncrementalExecutionResults; + private _handleBatch; + private _handleWorkQueueEvent; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts new file mode 100644 index 00000000..b69381c8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.d.ts @@ -0,0 +1,12 @@ +import type { ObjMap } from "../../jsutils/ObjMap.js"; +import type { GraphQLError } from "../../error/GraphQLError.js"; +import type { IncrementalWork } from "../incremental/IncrementalExecutor.js"; +import type { LegacyExperimentalIncrementalExecutionResults } from "./BranchingIncrementalExecutor.js"; +/** @internal */ +export declare class BranchingIncrementalPublisher { + private _indices; + constructor(); + buildResponse(data: ObjMap, errors: ReadonlyArray, work: IncrementalWork, abortSignal: AbortSignal | undefined, onFinished: () => void): LegacyExperimentalIncrementalExecutionResults; + private _handleBatch; + private _handleWorkQueueEvent; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js new file mode 100644 index 00000000..d6978abb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js @@ -0,0 +1,131 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BranchingIncrementalPublisher = void 0; +const Path_ts_1 = require("../../jsutils/Path.js"); +const ensureGraphQLError_ts_1 = require("../../error/ensureGraphQLError.js"); +const WorkQueue_ts_1 = require("../incremental/WorkQueue.js"); +const mapAsyncIterable_ts_1 = require("../mapAsyncIterable.js"); +const withConcurrentAbruptClose_ts_1 = require("../withConcurrentAbruptClose.js"); +class BranchingIncrementalPublisher { + constructor() { + this._indices = new Map(); + } + buildResponse(data, errors, work, abortSignal, onFinished) { + const { initialStreams, events } = (0, WorkQueue_ts_1.createWorkQueue)(work); + for (const stream of initialStreams) { + this._indices.set(stream, stream.initialCount); + } + function abort() { + subsequentResults.throw(abortSignal?.reason).catch(() => { + }); + } + if (abortSignal) { + abortSignal.addEventListener('abort', abort); + } + const onWorkQueueFinished = () => { + onFinished(); + abortSignal?.removeEventListener('abort', abort); + }; + const initialResult = errors.length + ? { errors, data, hasNext: true } + : { data, hasNext: true }; + const subsequentResults = (0, withConcurrentAbruptClose_ts_1.withConcurrentAbruptClose)((0, mapAsyncIterable_ts_1.mapAsyncIterable)(events, (batch) => this._handleBatch(batch, onWorkQueueFinished)), () => onWorkQueueFinished()); + return { + initialResult, + subsequentResults, + }; + } + _handleBatch(batch, onWorkQueueFinished) { + const context = { + incremental: [], + hasNext: true, + }; + for (const event of batch) { + this._handleWorkQueueEvent(event, context, onWorkQueueFinished); + } + const { incremental, hasNext } = context; + const result = { hasNext }; + if (incremental.length > 0) { + result.incremental = incremental; + } + return result; + } + _handleWorkQueueEvent(event, context, onWorkQueueFinished) { + switch (event.kind) { + case 'GROUP_VALUES': { + const group = event.group; + for (const value of event.values) { + context.incremental.push(buildIncrementalResult({ + data: value.data, + path: (0, Path_ts_1.pathToArray)(group.path), + }, group.label, value.errors)); + } + break; + } + case 'GROUP_SUCCESS': { + break; + } + case 'GROUP_FAILURE': { + const group = event.group; + context.incremental.push(buildIncrementalResult({ + data: null, + path: (0, Path_ts_1.pathToArray)(group.path), + }, group.label, [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(event.error)])); + break; + } + case 'STREAM_VALUES': { + const stream = event.stream; + const { values } = event; + const items = []; + const errors = []; + for (const value of values) { + items.push(value.item); + if (value.errors !== undefined) { + errors.push(...value.errors); + } + } + let index = this._indices.get(stream); + if (index === undefined) { + index = stream.initialCount; + this._indices.set(stream, index); + } + this._indices.set(stream, index + items.length); + context.incremental.push(buildIncrementalResult({ + items, + path: (0, Path_ts_1.pathToArray)((0, Path_ts_1.addPath)(stream.path, index, undefined)), + }, stream.label, errors.length > 0 ? errors : undefined)); + break; + } + case 'STREAM_SUCCESS': { + this._indices.delete(event.stream); + break; + } + case 'STREAM_FAILURE': { + this._indices.delete(event.stream); + const stream = event.stream; + context.incremental.push(buildIncrementalResult({ + items: null, + path: (0, Path_ts_1.pathToArray)(stream.path), + }, stream.label, [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(event.error)])); + break; + } + case 'WORK_QUEUE_TERMINATION': { + onWorkQueueFinished?.(); + context.hasNext = false; + break; + } + } + } +} +exports.BranchingIncrementalPublisher = BranchingIncrementalPublisher; +function buildIncrementalResult(originalIncrementalResult, label, errors) { + const incrementalResult = originalIncrementalResult; + if (errors !== undefined) { + incrementalResult.errors = errors; + } + if (label !== undefined) { + incrementalResult.label = label; + } + return incrementalResult; +} +//# sourceMappingURL=BranchingIncrementalPublisher.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js.map new file mode 100644 index 00000000..0829c9e7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BranchingIncrementalPublisher.js","sourceRoot":"","sources":["../../../src/execution/legacyIncremental/BranchingIncrementalPublisher.ts"],"names":[],"mappings":";;;AACA,mDAA6D;AAE7D,6EAAuE;AAWvE,8DAA8D;AAC9D,gEAA0D;AAC1D,kFAA4E;AAiB5E,MAAa,6BAA6B;IAGxC;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,aAAa,CACX,IAAqB,EACrB,MAAmC,EACnC,IAAqB,EACrB,WAAoC,EACpC,UAAsB;QAEtB,MAAM,EAAE,cAA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AC;gBACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACnC,MAAM;YACR,CAAC;YACD,KAAK,gBAAgB,CAAC,CAAC,CAAC;gBACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACnC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC5B,OAAO,CAAC,WAAW,CAAC,IAAI,CACtB,sBAAsB,CACpB;oBACE,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,IAAA,qBAAW,EAAC,MAAM,CAAC,IAAI,CAAC;iBAC/B,EACD,MAAM,CAAC,KAAK,EACZ,CAAC,IAAA,0CAAkB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAClC,CACF,CAAC;gBACF,MAAM;YACR,CAAC;YACD,KAAK,wBAAwB,CAAC,CAAC,CAAC;gBAC9B,mBAAmB,EAAE,EAAE,CAAC;gBACxB,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;gBACxB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAzLD,sEAyLC;AAED,SAAS,sBAAsB,CAC7B,yBAE2D,EAC3D,KAAyB,EACzB,MAA+C;IAE/C,MAAM,iBAAiB,GAA4B,yBAAyB,CAAC;IAC7E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC;IACpC,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;IAClC,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["import type { ObjMap } from '../../jsutils/ObjMap.ts';\nimport { addPath, pathToArray } from '../../jsutils/Path.ts';\n\nimport { ensureGraphQLError } from '../../error/ensureGraphQLError.ts';\nimport type { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n DeliveryGroup,\n ExecutionGroupValue,\n IncrementalWork,\n ItemStream,\n StreamItemValue,\n} from '../incremental/IncrementalExecutor.ts';\nimport type { WorkQueueEvent } from '../incremental/WorkQueue.ts';\nimport { createWorkQueue } from '../incremental/WorkQueue.ts';\nimport { mapAsyncIterable } from '../mapAsyncIterable.ts';\nimport { withConcurrentAbruptClose } from '../withConcurrentAbruptClose.ts';\n\nimport type {\n LegacyExperimentalIncrementalExecutionResults,\n LegacyIncrementalDeferResult,\n LegacyIncrementalResult,\n LegacyIncrementalStreamResult,\n LegacyInitialIncrementalExecutionResult,\n LegacySubsequentIncrementalExecutionResult,\n} from './BranchingIncrementalExecutor.ts';\n\ninterface SubsequentIncrementalExecutionResultContext {\n incremental: Array;\n hasNext: boolean;\n}\n\n/** @internal */\nexport class BranchingIncrementalPublisher {\n private _indices: Map;\n\n constructor() {\n this._indices = new Map();\n }\n\n buildResponse(\n data: ObjMap,\n errors: ReadonlyArray,\n work: IncrementalWork,\n abortSignal: AbortSignal | undefined,\n onFinished: () => void,\n ): LegacyExperimentalIncrementalExecutionResults {\n const { initialStreams, events } = createWorkQueue<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >(work);\n\n for (const stream of initialStreams) {\n this._indices.set(stream, stream.initialCount);\n }\n\n function abort(): void {\n subsequentResults.throw(abortSignal?.reason).catch(() => {\n // Ignore errors\n });\n }\n\n if (abortSignal) {\n abortSignal.addEventListener('abort', abort);\n }\n const onWorkQueueFinished = () => {\n onFinished();\n abortSignal?.removeEventListener('abort', abort);\n };\n\n const initialResult: LegacyInitialIncrementalExecutionResult = errors.length\n ? { errors, data, hasNext: true }\n : { data, hasNext: true };\n\n const subsequentResults = withConcurrentAbruptClose(\n mapAsyncIterable(events, (batch) =>\n this._handleBatch(batch, onWorkQueueFinished),\n ),\n () => onWorkQueueFinished(),\n );\n\n return {\n initialResult,\n subsequentResults,\n };\n }\n\n private _handleBatch(\n batch: ReadonlyArray<\n WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >\n >,\n onWorkQueueFinished: (() => void) | undefined,\n ): LegacySubsequentIncrementalExecutionResult {\n const context: SubsequentIncrementalExecutionResultContext = {\n incremental: [],\n hasNext: true,\n };\n\n for (const event of batch) {\n this._handleWorkQueueEvent(event, context, onWorkQueueFinished);\n }\n\n const { incremental, hasNext } = context;\n\n const result: LegacySubsequentIncrementalExecutionResult = { hasNext };\n if (incremental.length > 0) {\n result.incremental = incremental;\n }\n\n return result;\n }\n\n private _handleWorkQueueEvent(\n event: WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >,\n context: SubsequentIncrementalExecutionResultContext,\n onWorkQueueFinished: (() => void) | undefined,\n ): void {\n switch (event.kind) {\n case 'GROUP_VALUES': {\n const group = event.group;\n for (const value of event.values) {\n context.incremental.push(\n buildIncrementalResult(\n {\n data: value.data,\n path: pathToArray(group.path),\n },\n group.label,\n value.errors,\n ),\n );\n }\n break;\n }\n case 'GROUP_SUCCESS': {\n break;\n }\n case 'GROUP_FAILURE': {\n const group = event.group;\n context.incremental.push(\n buildIncrementalResult(\n {\n data: null,\n path: pathToArray(group.path),\n },\n group.label,\n [ensureGraphQLError(event.error)],\n ),\n );\n break;\n }\n case 'STREAM_VALUES': {\n const stream = event.stream;\n const { values } = event;\n const items: Array = [];\n const errors: Array = [];\n for (const value of values) {\n items.push(value.item);\n if (value.errors !== undefined) {\n errors.push(...value.errors);\n }\n }\n let index = this._indices.get(stream);\n if (index === undefined) {\n index = stream.initialCount;\n this._indices.set(stream, index);\n }\n this._indices.set(stream, index + items.length);\n context.incremental.push(\n buildIncrementalResult(\n {\n items,\n path: pathToArray(addPath(stream.path, index, undefined)),\n },\n stream.label,\n errors.length > 0 ? errors : undefined,\n ),\n );\n break;\n }\n case 'STREAM_SUCCESS': {\n this._indices.delete(event.stream);\n break;\n }\n case 'STREAM_FAILURE': {\n this._indices.delete(event.stream);\n const stream = event.stream;\n context.incremental.push(\n buildIncrementalResult(\n {\n items: null,\n path: pathToArray(stream.path),\n },\n stream.label,\n [ensureGraphQLError(event.error)],\n ),\n );\n break;\n }\n case 'WORK_QUEUE_TERMINATION': {\n onWorkQueueFinished?.();\n context.hasNext = false;\n break;\n }\n }\n }\n}\n\nfunction buildIncrementalResult(\n originalIncrementalResult:\n | Omit\n | Omit,\n label: string | undefined,\n errors: ReadonlyArray | undefined,\n): LegacyIncrementalResult {\n const incrementalResult: LegacyIncrementalResult = originalIncrementalResult;\n if (errors !== undefined) {\n incrementalResult.errors = errors;\n }\n if (label !== undefined) {\n incrementalResult.label = label;\n }\n return incrementalResult;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs new file mode 100644 index 00000000..79b6c606 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs @@ -0,0 +1,127 @@ +import { addPath, pathToArray } from "../../jsutils/Path.mjs"; +import { ensureGraphQLError } from "../../error/ensureGraphQLError.mjs"; +import { createWorkQueue } from "../incremental/WorkQueue.mjs"; +import { mapAsyncIterable } from "../mapAsyncIterable.mjs"; +import { withConcurrentAbruptClose } from "../withConcurrentAbruptClose.mjs"; +export class BranchingIncrementalPublisher { + constructor() { + this._indices = new Map(); + } + buildResponse(data, errors, work, abortSignal, onFinished) { + const { initialStreams, events } = createWorkQueue(work); + for (const stream of initialStreams) { + this._indices.set(stream, stream.initialCount); + } + function abort() { + subsequentResults.throw(abortSignal?.reason).catch(() => { + }); + } + if (abortSignal) { + abortSignal.addEventListener('abort', abort); + } + const onWorkQueueFinished = () => { + onFinished(); + abortSignal?.removeEventListener('abort', abort); + }; + const initialResult = errors.length + ? { errors, data, hasNext: true } + : { data, hasNext: true }; + const subsequentResults = withConcurrentAbruptClose(mapAsyncIterable(events, (batch) => this._handleBatch(batch, onWorkQueueFinished)), () => onWorkQueueFinished()); + return { + initialResult, + subsequentResults, + }; + } + _handleBatch(batch, onWorkQueueFinished) { + const context = { + incremental: [], + hasNext: true, + }; + for (const event of batch) { + this._handleWorkQueueEvent(event, context, onWorkQueueFinished); + } + const { incremental, hasNext } = context; + const result = { hasNext }; + if (incremental.length > 0) { + result.incremental = incremental; + } + return result; + } + _handleWorkQueueEvent(event, context, onWorkQueueFinished) { + switch (event.kind) { + case 'GROUP_VALUES': { + const group = event.group; + for (const value of event.values) { + context.incremental.push(buildIncrementalResult({ + data: value.data, + path: pathToArray(group.path), + }, group.label, value.errors)); + } + break; + } + case 'GROUP_SUCCESS': { + break; + } + case 'GROUP_FAILURE': { + const group = event.group; + context.incremental.push(buildIncrementalResult({ + data: null, + path: pathToArray(group.path), + }, group.label, [ensureGraphQLError(event.error)])); + break; + } + case 'STREAM_VALUES': { + const stream = event.stream; + const { values } = event; + const items = []; + const errors = []; + for (const value of values) { + items.push(value.item); + if (value.errors !== undefined) { + errors.push(...value.errors); + } + } + let index = this._indices.get(stream); + if (index === undefined) { + index = stream.initialCount; + this._indices.set(stream, index); + } + this._indices.set(stream, index + items.length); + context.incremental.push(buildIncrementalResult({ + items, + path: pathToArray(addPath(stream.path, index, undefined)), + }, stream.label, errors.length > 0 ? errors : undefined)); + break; + } + case 'STREAM_SUCCESS': { + this._indices.delete(event.stream); + break; + } + case 'STREAM_FAILURE': { + this._indices.delete(event.stream); + const stream = event.stream; + context.incremental.push(buildIncrementalResult({ + items: null, + path: pathToArray(stream.path), + }, stream.label, [ensureGraphQLError(event.error)])); + break; + } + case 'WORK_QUEUE_TERMINATION': { + onWorkQueueFinished?.(); + context.hasNext = false; + break; + } + } + } +} +function buildIncrementalResult(originalIncrementalResult, label, errors) { + const incrementalResult = originalIncrementalResult; + if (errors !== undefined) { + incrementalResult.errors = errors; + } + if (label !== undefined) { + incrementalResult.label = label; + } + return incrementalResult; +} +//# sourceMappingURL=BranchingIncrementalPublisher.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs.map new file mode 100644 index 00000000..ed90d1c7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"BranchingIncrementalPublisher.js","sourceRoot":"","sources":["../../../src/execution/legacyIncremental/BranchingIncrementalPublisher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,+BAA8B;AAE7D,OAAO,EAAE,kBAAkB,EAAE,2CAA0C;AAWvE,OAAO,EAAE,eAAe,EAAE,qCAAoC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,gCAA+B;AAC1D,OAAO,EAAE,yBAAyB,EAAE,yCAAwC;AAiB5E,MAAM,OAAO,6BAA6B;IAGxC;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,aAAa,CACX,IAAqB,EACrB,MAAmC,EACnC,IAAqB,EACrB,WAAoC,EACpC,UAAsB;QAEtB,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,eAAe,CAKhD,IAAI,CAAC,CAAC;QAER,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC;QAED,SAAS,KAAK;YACZ,iBAAiB,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;YAExD,CAAC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CAAC,MAAM,CAAC,IAAI,CAAC;iBAC/B,EACD,MAAM,CAAC,KAAK,EACZ,CAAC,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAClC,CACF,CAAC;gBACF,MAAM;YACR,CAAC;YACD,KAAK,wBAAwB,CAAC,CAAC,CAAC;gBAC9B,mBAAmB,EAAE,EAAE,CAAC;gBACxB,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;gBACxB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,SAAS,sBAAsB,CAC7B,yBAE2D,EAC3D,KAAyB,EACzB,MAA+C;IAE/C,MAAM,iBAAiB,GAA4B,yBAAyB,CAAC;IAC7E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC;IACpC,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;IAClC,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["import type { ObjMap } from '../../jsutils/ObjMap.ts';\nimport { addPath, pathToArray } from '../../jsutils/Path.ts';\n\nimport { ensureGraphQLError } from '../../error/ensureGraphQLError.ts';\nimport type { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n DeliveryGroup,\n ExecutionGroupValue,\n IncrementalWork,\n ItemStream,\n StreamItemValue,\n} from '../incremental/IncrementalExecutor.ts';\nimport type { WorkQueueEvent } from '../incremental/WorkQueue.ts';\nimport { createWorkQueue } from '../incremental/WorkQueue.ts';\nimport { mapAsyncIterable } from '../mapAsyncIterable.ts';\nimport { withConcurrentAbruptClose } from '../withConcurrentAbruptClose.ts';\n\nimport type {\n LegacyExperimentalIncrementalExecutionResults,\n LegacyIncrementalDeferResult,\n LegacyIncrementalResult,\n LegacyIncrementalStreamResult,\n LegacyInitialIncrementalExecutionResult,\n LegacySubsequentIncrementalExecutionResult,\n} from './BranchingIncrementalExecutor.ts';\n\ninterface SubsequentIncrementalExecutionResultContext {\n incremental: Array;\n hasNext: boolean;\n}\n\n/** @internal */\nexport class BranchingIncrementalPublisher {\n private _indices: Map;\n\n constructor() {\n this._indices = new Map();\n }\n\n buildResponse(\n data: ObjMap,\n errors: ReadonlyArray,\n work: IncrementalWork,\n abortSignal: AbortSignal | undefined,\n onFinished: () => void,\n ): LegacyExperimentalIncrementalExecutionResults {\n const { initialStreams, events } = createWorkQueue<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >(work);\n\n for (const stream of initialStreams) {\n this._indices.set(stream, stream.initialCount);\n }\n\n function abort(): void {\n subsequentResults.throw(abortSignal?.reason).catch(() => {\n // Ignore errors\n });\n }\n\n if (abortSignal) {\n abortSignal.addEventListener('abort', abort);\n }\n const onWorkQueueFinished = () => {\n onFinished();\n abortSignal?.removeEventListener('abort', abort);\n };\n\n const initialResult: LegacyInitialIncrementalExecutionResult = errors.length\n ? { errors, data, hasNext: true }\n : { data, hasNext: true };\n\n const subsequentResults = withConcurrentAbruptClose(\n mapAsyncIterable(events, (batch) =>\n this._handleBatch(batch, onWorkQueueFinished),\n ),\n () => onWorkQueueFinished(),\n );\n\n return {\n initialResult,\n subsequentResults,\n };\n }\n\n private _handleBatch(\n batch: ReadonlyArray<\n WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >\n >,\n onWorkQueueFinished: (() => void) | undefined,\n ): LegacySubsequentIncrementalExecutionResult {\n const context: SubsequentIncrementalExecutionResultContext = {\n incremental: [],\n hasNext: true,\n };\n\n for (const event of batch) {\n this._handleWorkQueueEvent(event, context, onWorkQueueFinished);\n }\n\n const { incremental, hasNext } = context;\n\n const result: LegacySubsequentIncrementalExecutionResult = { hasNext };\n if (incremental.length > 0) {\n result.incremental = incremental;\n }\n\n return result;\n }\n\n private _handleWorkQueueEvent(\n event: WorkQueueEvent<\n ExecutionGroupValue,\n StreamItemValue,\n DeliveryGroup,\n ItemStream\n >,\n context: SubsequentIncrementalExecutionResultContext,\n onWorkQueueFinished: (() => void) | undefined,\n ): void {\n switch (event.kind) {\n case 'GROUP_VALUES': {\n const group = event.group;\n for (const value of event.values) {\n context.incremental.push(\n buildIncrementalResult(\n {\n data: value.data,\n path: pathToArray(group.path),\n },\n group.label,\n value.errors,\n ),\n );\n }\n break;\n }\n case 'GROUP_SUCCESS': {\n break;\n }\n case 'GROUP_FAILURE': {\n const group = event.group;\n context.incremental.push(\n buildIncrementalResult(\n {\n data: null,\n path: pathToArray(group.path),\n },\n group.label,\n [ensureGraphQLError(event.error)],\n ),\n );\n break;\n }\n case 'STREAM_VALUES': {\n const stream = event.stream;\n const { values } = event;\n const items: Array = [];\n const errors: Array = [];\n for (const value of values) {\n items.push(value.item);\n if (value.errors !== undefined) {\n errors.push(...value.errors);\n }\n }\n let index = this._indices.get(stream);\n if (index === undefined) {\n index = stream.initialCount;\n this._indices.set(stream, index);\n }\n this._indices.set(stream, index + items.length);\n context.incremental.push(\n buildIncrementalResult(\n {\n items,\n path: pathToArray(addPath(stream.path, index, undefined)),\n },\n stream.label,\n errors.length > 0 ? errors : undefined,\n ),\n );\n break;\n }\n case 'STREAM_SUCCESS': {\n this._indices.delete(event.stream);\n break;\n }\n case 'STREAM_FAILURE': {\n this._indices.delete(event.stream);\n const stream = event.stream;\n context.incremental.push(\n buildIncrementalResult(\n {\n items: null,\n path: pathToArray(stream.path),\n },\n stream.label,\n [ensureGraphQLError(event.error)],\n ),\n );\n break;\n }\n case 'WORK_QUEUE_TERMINATION': {\n onWorkQueueFinished?.();\n context.hasNext = false;\n break;\n }\n }\n }\n}\n\nfunction buildIncrementalResult(\n originalIncrementalResult:\n | Omit\n | Omit,\n label: string | undefined,\n errors: ReadonlyArray | undefined,\n): LegacyIncrementalResult {\n const incrementalResult: LegacyIncrementalResult = originalIncrementalResult;\n if (errors !== undefined) {\n incrementalResult.errors = errors;\n }\n if (label !== undefined) {\n incrementalResult.label = label;\n }\n return incrementalResult;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.mts new file mode 100644 index 00000000..5c3d6786 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.mts @@ -0,0 +1,165 @@ +/** @category Legacy Incremental Execution */ +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.mjs"; +import type { ExecutionArgs, ValidatedExecutionArgs } from "../ExecutionArgs.mjs"; +import type { ExecutionResult } from "../Executor.mjs"; +import type { LegacyExperimentalIncrementalExecutionResults } from "./BranchingIncrementalExecutor.mjs"; +/** + * Executes a GraphQL operation with support for `@defer` and `@stream` using + * the legacy incremental delivery payload format. + * + * Prefer `experimentalExecuteIncrementally` for the current incremental + * delivery format. In the legacy format, each subsequent incremental payload + * identifies its location with `path` and optional `label` fields. The current + * format instead tracks pending work by `id` and reports completion through + * `completed` entries. + * @param args - Execution arguments for the GraphQL operation. + * @returns A single execution result or legacy incremental execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { legacyExecuteIncrementally } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * hero: Hero + * } + * + * type Hero { + * id: ID! + * name: String! + * } + * `); + * + * const result = await legacyExecuteIncrementally({ + * schema, + * document: parse('{ hero { id ... @defer(label: "HeroName") { name } } }'), + * rootValue: { hero: { id: '1', name: 'Luke' } }, + * }); + * + * assert('initialResult' in result); + * + * result.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true } + * + * const deferred = await result.subsequentResults.next(); + * deferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'], label: 'HeroName' } ], hasNext: false } + * ``` + * @example + * Compare the legacy payload format with the current incremental delivery + * format returned by `experimentalExecuteIncrementally`. + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * experimentalExecuteIncrementally, + * legacyExecuteIncrementally, + * } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * hero: Hero + * } + * + * type Hero { + * id: ID! + * name: String! + * } + * `); + * const document = parse('{ hero { id ... @defer { name } } }'); + * const rootValue = { hero: { id: '1', name: 'Luke' } }; + * + * const experimental = await experimentalExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * const legacy = await legacyExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * + * assert('initialResult' in experimental); + * assert('initialResult' in legacy); + * + * experimental.initialResult; // => { data: { hero: { id: '1' } }, pending: [ { id: '0', path: ['hero'] } ], hasNext: true } + * legacy.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true } + * + * const experimentalDeferred = await experimental.subsequentResults.next(); + * experimentalDeferred.value; // => { incremental: [{ data: { name: 'Luke' }, id: '0' }], completed: [{ id: '0' }], hasNext: false } + * + * const legacyDeferred = await legacy.subsequentResults.next(); + * legacyDeferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'] } ], hasNext: false } + * ``` + * @example + * Compare streamed list payloads in the legacy and current incremental + * delivery formats. + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * experimentalExecuteIncrementally, + * legacyExecuteIncrementally, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { colors: [String] }'); + * const document = parse('{ colors @stream(initialCount: 1) }'); + * const rootValue = { colors: ['red', 'green', 'blue'] }; + * + * const experimental = await experimentalExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * const legacy = await legacyExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * + * assert('initialResult' in experimental); + * assert('initialResult' in legacy); + * + * experimental.initialResult; // => { data: { colors: ['red'] }, pending: [ { id: '0', path: ['colors'] } ], hasNext: true } + * legacy.initialResult; // => { data: { colors: ['red'] }, hasNext: true } + * + * const experimentalStream = await experimental.subsequentResults.next(); + * experimentalStream.value; // => { incremental: [ { items: ['green', 'blue'], id: '0' } ], completed: [{ id: '0' }], hasNext: false } + * + * const legacyStream = await legacy.subsequentResults.next(); + * legacyStream.value; // => { incremental: [ { items: ['green', 'blue'], path: ['colors', 1] } ], hasNext: false } + * ``` + */ +export declare function legacyExecuteIncrementally(args: ExecutionArgs): PromiseOrValue; +/** + * Executes a validated operation root selection set with support for `@defer` + * and `@stream` using the legacy incremental delivery payload format. + * @param validatedExecutionArgs - Validated execution arguments. + * @returns A single execution result or legacy incremental execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * legacyExecuteRootSelectionSet, + * validateExecutionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await legacyExecuteRootSelectionSet(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function legacyExecuteRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.ts new file mode 100644 index 00000000..5ae68bca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.d.ts @@ -0,0 +1,165 @@ +/** @category Legacy Incremental Execution */ +import type { PromiseOrValue } from "../../jsutils/PromiseOrValue.js"; +import type { ExecutionArgs, ValidatedExecutionArgs } from "../ExecutionArgs.js"; +import type { ExecutionResult } from "../Executor.js"; +import type { LegacyExperimentalIncrementalExecutionResults } from "./BranchingIncrementalExecutor.js"; +/** + * Executes a GraphQL operation with support for `@defer` and `@stream` using + * the legacy incremental delivery payload format. + * + * Prefer `experimentalExecuteIncrementally` for the current incremental + * delivery format. In the legacy format, each subsequent incremental payload + * identifies its location with `path` and optional `label` fields. The current + * format instead tracks pending work by `id` and reports completion through + * `completed` entries. + * @param args - Execution arguments for the GraphQL operation. + * @returns A single execution result or legacy incremental execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { legacyExecuteIncrementally } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * hero: Hero + * } + * + * type Hero { + * id: ID! + * name: String! + * } + * `); + * + * const result = await legacyExecuteIncrementally({ + * schema, + * document: parse('{ hero { id ... @defer(label: "HeroName") { name } } }'), + * rootValue: { hero: { id: '1', name: 'Luke' } }, + * }); + * + * assert('initialResult' in result); + * + * result.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true } + * + * const deferred = await result.subsequentResults.next(); + * deferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'], label: 'HeroName' } ], hasNext: false } + * ``` + * @example + * Compare the legacy payload format with the current incremental delivery + * format returned by `experimentalExecuteIncrementally`. + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * experimentalExecuteIncrementally, + * legacyExecuteIncrementally, + * } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * hero: Hero + * } + * + * type Hero { + * id: ID! + * name: String! + * } + * `); + * const document = parse('{ hero { id ... @defer { name } } }'); + * const rootValue = { hero: { id: '1', name: 'Luke' } }; + * + * const experimental = await experimentalExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * const legacy = await legacyExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * + * assert('initialResult' in experimental); + * assert('initialResult' in legacy); + * + * experimental.initialResult; // => { data: { hero: { id: '1' } }, pending: [ { id: '0', path: ['hero'] } ], hasNext: true } + * legacy.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true } + * + * const experimentalDeferred = await experimental.subsequentResults.next(); + * experimentalDeferred.value; // => { incremental: [{ data: { name: 'Luke' }, id: '0' }], completed: [{ id: '0' }], hasNext: false } + * + * const legacyDeferred = await legacy.subsequentResults.next(); + * legacyDeferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'] } ], hasNext: false } + * ``` + * @example + * Compare streamed list payloads in the legacy and current incremental + * delivery formats. + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * experimentalExecuteIncrementally, + * legacyExecuteIncrementally, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { colors: [String] }'); + * const document = parse('{ colors @stream(initialCount: 1) }'); + * const rootValue = { colors: ['red', 'green', 'blue'] }; + * + * const experimental = await experimentalExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * const legacy = await legacyExecuteIncrementally({ + * schema, + * document, + * rootValue, + * }); + * + * assert('initialResult' in experimental); + * assert('initialResult' in legacy); + * + * experimental.initialResult; // => { data: { colors: ['red'] }, pending: [ { id: '0', path: ['colors'] } ], hasNext: true } + * legacy.initialResult; // => { data: { colors: ['red'] }, hasNext: true } + * + * const experimentalStream = await experimental.subsequentResults.next(); + * experimentalStream.value; // => { incremental: [ { items: ['green', 'blue'], id: '0' } ], completed: [{ id: '0' }], hasNext: false } + * + * const legacyStream = await legacy.subsequentResults.next(); + * legacyStream.value; // => { incremental: [ { items: ['green', 'blue'], path: ['colors', 1] } ], hasNext: false } + * ``` + */ +export declare function legacyExecuteIncrementally(args: ExecutionArgs): PromiseOrValue; +/** + * Executes a validated operation root selection set with support for `@defer` + * and `@stream` using the legacy incremental delivery payload format. + * @param validatedExecutionArgs - Validated execution arguments. + * @returns A single execution result or legacy incremental execution results. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * legacyExecuteRootSelectionSet, + * validateExecutionArgs, + * } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const validatedArgs = validateExecutionArgs({ + * schema, + * document: parse('{ greeting }'), + * rootValue: { greeting: 'Hello' }, + * }); + * + * assert('schema' in validatedArgs); + * + * const result = await legacyExecuteRootSelectionSet(validatedArgs); + * result; // => { data: { greeting: 'Hello' } } + * ``` + */ +export declare function legacyExecuteRootSelectionSet(validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js new file mode 100644 index 00000000..513e3ad5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.legacyExecuteIncrementally = legacyExecuteIncrementally; +exports.legacyExecuteRootSelectionSet = legacyExecuteRootSelectionSet; +const execute_ts_1 = require("../execute.js"); +const BranchingIncrementalExecutor_ts_1 = require("./BranchingIncrementalExecutor.js"); +function legacyExecuteIncrementally(args) { + const validatedExecutionArgs = (0, execute_ts_1.validateExecutionArgs)(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return legacyExecuteRootSelectionSet(validatedExecutionArgs); +} +function legacyExecuteRootSelectionSet(validatedExecutionArgs) { + return new BranchingIncrementalExecutor_ts_1.BranchingIncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet(); +} +//# sourceMappingURL=legacyExecuteIncrementally.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js.map new file mode 100644 index 00000000..94b6a302 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.js.map @@ -0,0 +1 @@ +{"version":3,"file":"legacyExecuteIncrementally.js","sourceRoot":"","sources":["../../../src/execution/legacyIncremental/legacyExecuteIncrementally.ts"],"names":[],"mappings":";;AAgJA,gEAeC;AA8BD,sEAQC;AAjMD,8CAAsD;AAQtD,uFAAiF;AAoIjF,SAAgB,0BAA0B,CACxC,IAAmB;IAMnB,MAAM,sBAAsB,GAAG,IAAA,kCAAqB,EAAC,IAAI,CAAC,CAAC;IAG3D,IAAI,CAAC,CAAC,QAAQ,IAAI,sBAAsB,CAAC,EAAE,CAAC;QAC1C,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;IAC5C,CAAC;IAED,OAAO,6BAA6B,CAAC,sBAAsB,CAAC,CAAC;AAC/D,CAAC;AA8BD,SAAgB,6BAA6B,CAC3C,sBAA8C;IAI9C,OAAO,IAAI,8DAA4B,CACrC,sBAAsB,CACvB,CAAC,uBAAuB,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/** @category Legacy Incremental Execution */\n\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\nimport { validateExecutionArgs } from '../execute.ts';\nimport type {\n ExecutionArgs,\n ValidatedExecutionArgs,\n} from '../ExecutionArgs.ts';\nimport type { ExecutionResult } from '../Executor.ts';\n\nimport type { LegacyExperimentalIncrementalExecutionResults } from './BranchingIncrementalExecutor.ts';\nimport { BranchingIncrementalExecutor } from './BranchingIncrementalExecutor.ts';\n\n/**\n * Executes a GraphQL operation with support for `@defer` and `@stream` using\n * the legacy incremental delivery payload format.\n *\n * Prefer `experimentalExecuteIncrementally` for the current incremental\n * delivery format. In the legacy format, each subsequent incremental payload\n * identifies its location with `path` and optional `label` fields. The current\n * format instead tracks pending work by `id` and reports completion through\n * `completed` entries.\n * @param args - Execution arguments for the GraphQL operation.\n * @returns A single execution result or legacy incremental execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { legacyExecuteIncrementally } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * hero: Hero\n * }\n *\n * type Hero {\n * id: ID!\n * name: String!\n * }\n * `);\n *\n * const result = await legacyExecuteIncrementally({\n * schema,\n * document: parse('{ hero { id ... @defer(label: \"HeroName\") { name } } }'),\n * rootValue: { hero: { id: '1', name: 'Luke' } },\n * });\n *\n * assert('initialResult' in result);\n *\n * result.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true }\n *\n * const deferred = await result.subsequentResults.next();\n * deferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'], label: 'HeroName' } ], hasNext: false }\n * ```\n * @example\n * Compare the legacy payload format with the current incremental delivery\n * format returned by `experimentalExecuteIncrementally`.\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * experimentalExecuteIncrementally,\n * legacyExecuteIncrementally,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * hero: Hero\n * }\n *\n * type Hero {\n * id: ID!\n * name: String!\n * }\n * `);\n * const document = parse('{ hero { id ... @defer { name } } }');\n * const rootValue = { hero: { id: '1', name: 'Luke' } };\n *\n * const experimental = await experimentalExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n * const legacy = await legacyExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n *\n * assert('initialResult' in experimental);\n * assert('initialResult' in legacy);\n *\n * experimental.initialResult; // => { data: { hero: { id: '1' } }, pending: [ { id: '0', path: ['hero'] } ], hasNext: true }\n * legacy.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true }\n *\n * const experimentalDeferred = await experimental.subsequentResults.next();\n * experimentalDeferred.value; // => { incremental: [{ data: { name: 'Luke' }, id: '0' }], completed: [{ id: '0' }], hasNext: false }\n *\n * const legacyDeferred = await legacy.subsequentResults.next();\n * legacyDeferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'] } ], hasNext: false }\n * ```\n * @example\n * Compare streamed list payloads in the legacy and current incremental\n * delivery formats.\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * experimentalExecuteIncrementally,\n * legacyExecuteIncrementally,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { colors: [String] }');\n * const document = parse('{ colors @stream(initialCount: 1) }');\n * const rootValue = { colors: ['red', 'green', 'blue'] };\n *\n * const experimental = await experimentalExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n * const legacy = await legacyExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n *\n * assert('initialResult' in experimental);\n * assert('initialResult' in legacy);\n *\n * experimental.initialResult; // => { data: { colors: ['red'] }, pending: [ { id: '0', path: ['colors'] } ], hasNext: true }\n * legacy.initialResult; // => { data: { colors: ['red'] }, hasNext: true }\n *\n * const experimentalStream = await experimental.subsequentResults.next();\n * experimentalStream.value; // => { incremental: [ { items: ['green', 'blue'], id: '0' } ], completed: [{ id: '0' }], hasNext: false }\n *\n * const legacyStream = await legacy.subsequentResults.next();\n * legacyStream.value; // => { incremental: [ { items: ['green', 'blue'], path: ['colors', 1] } ], hasNext: false }\n * ```\n */\nexport function legacyExecuteIncrementally(\n args: ExecutionArgs,\n): PromiseOrValue<\n ExecutionResult | LegacyExperimentalIncrementalExecutionResults\n> {\n // If a valid execution context cannot be created due to incorrect arguments,\n // a \"Response\" with only errors is returned.\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return legacyExecuteRootSelectionSet(validatedExecutionArgs);\n}\n\n/**\n * Executes a validated operation root selection set with support for `@defer`\n * and `@stream` using the legacy incremental delivery payload format.\n * @param validatedExecutionArgs - Validated execution arguments.\n * @returns A single execution result or legacy incremental execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * legacyExecuteRootSelectionSet,\n * validateExecutionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await legacyExecuteRootSelectionSet(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function legacyExecuteRootSelectionSet(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue<\n ExecutionResult | LegacyExperimentalIncrementalExecutionResults\n> {\n return new BranchingIncrementalExecutor(\n validatedExecutionArgs,\n ).executeRootSelectionSet();\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs new file mode 100644 index 00000000..00807095 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs @@ -0,0 +1,13 @@ +import { validateExecutionArgs } from "../execute.mjs"; +import { BranchingIncrementalExecutor } from "./BranchingIncrementalExecutor.mjs"; +export function legacyExecuteIncrementally(args) { + const validatedExecutionArgs = validateExecutionArgs(args); + if (!('schema' in validatedExecutionArgs)) { + return { errors: validatedExecutionArgs }; + } + return legacyExecuteRootSelectionSet(validatedExecutionArgs); +} +export function legacyExecuteRootSelectionSet(validatedExecutionArgs) { + return new BranchingIncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet(); +} +//# sourceMappingURL=legacyExecuteIncrementally.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs.map new file mode 100644 index 00000000..c5bb450f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"legacyExecuteIncrementally.js","sourceRoot":"","sources":["../../../src/execution/legacyIncremental/legacyExecuteIncrementally.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,uBAAsB;AAQtD,OAAO,EAAE,4BAA4B,EAAE,2CAA0C;AAoIjF,MAAM,UAAU,0BAA0B,CACxC,IAAmB;IAMnB,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAG3D,IAAI,CAAC,CAAC,QAAQ,IAAI,sBAAsB,CAAC,EAAE,CAAC;QAC1C,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;IAC5C,CAAC;IAED,OAAO,6BAA6B,CAAC,sBAAsB,CAAC,CAAC;AAC/D,CAAC;AA8BD,MAAM,UAAU,6BAA6B,CAC3C,sBAA8C;IAI9C,OAAO,IAAI,4BAA4B,CACrC,sBAAsB,CACvB,CAAC,uBAAuB,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/** @category Legacy Incremental Execution */\n\nimport type { PromiseOrValue } from '../../jsutils/PromiseOrValue.ts';\n\nimport { validateExecutionArgs } from '../execute.ts';\nimport type {\n ExecutionArgs,\n ValidatedExecutionArgs,\n} from '../ExecutionArgs.ts';\nimport type { ExecutionResult } from '../Executor.ts';\n\nimport type { LegacyExperimentalIncrementalExecutionResults } from './BranchingIncrementalExecutor.ts';\nimport { BranchingIncrementalExecutor } from './BranchingIncrementalExecutor.ts';\n\n/**\n * Executes a GraphQL operation with support for `@defer` and `@stream` using\n * the legacy incremental delivery payload format.\n *\n * Prefer `experimentalExecuteIncrementally` for the current incremental\n * delivery format. In the legacy format, each subsequent incremental payload\n * identifies its location with `path` and optional `label` fields. The current\n * format instead tracks pending work by `id` and reports completion through\n * `completed` entries.\n * @param args - Execution arguments for the GraphQL operation.\n * @returns A single execution result or legacy incremental execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { legacyExecuteIncrementally } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * hero: Hero\n * }\n *\n * type Hero {\n * id: ID!\n * name: String!\n * }\n * `);\n *\n * const result = await legacyExecuteIncrementally({\n * schema,\n * document: parse('{ hero { id ... @defer(label: \"HeroName\") { name } } }'),\n * rootValue: { hero: { id: '1', name: 'Luke' } },\n * });\n *\n * assert('initialResult' in result);\n *\n * result.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true }\n *\n * const deferred = await result.subsequentResults.next();\n * deferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'], label: 'HeroName' } ], hasNext: false }\n * ```\n * @example\n * Compare the legacy payload format with the current incremental delivery\n * format returned by `experimentalExecuteIncrementally`.\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * experimentalExecuteIncrementally,\n * legacyExecuteIncrementally,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * hero: Hero\n * }\n *\n * type Hero {\n * id: ID!\n * name: String!\n * }\n * `);\n * const document = parse('{ hero { id ... @defer { name } } }');\n * const rootValue = { hero: { id: '1', name: 'Luke' } };\n *\n * const experimental = await experimentalExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n * const legacy = await legacyExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n *\n * assert('initialResult' in experimental);\n * assert('initialResult' in legacy);\n *\n * experimental.initialResult; // => { data: { hero: { id: '1' } }, pending: [ { id: '0', path: ['hero'] } ], hasNext: true }\n * legacy.initialResult; // => { data: { hero: { id: '1' } }, hasNext: true }\n *\n * const experimentalDeferred = await experimental.subsequentResults.next();\n * experimentalDeferred.value; // => { incremental: [{ data: { name: 'Luke' }, id: '0' }], completed: [{ id: '0' }], hasNext: false }\n *\n * const legacyDeferred = await legacy.subsequentResults.next();\n * legacyDeferred.value; // => { incremental: [ { data: { name: 'Luke' }, path: ['hero'] } ], hasNext: false }\n * ```\n * @example\n * Compare streamed list payloads in the legacy and current incremental\n * delivery formats.\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * experimentalExecuteIncrementally,\n * legacyExecuteIncrementally,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { colors: [String] }');\n * const document = parse('{ colors @stream(initialCount: 1) }');\n * const rootValue = { colors: ['red', 'green', 'blue'] };\n *\n * const experimental = await experimentalExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n * const legacy = await legacyExecuteIncrementally({\n * schema,\n * document,\n * rootValue,\n * });\n *\n * assert('initialResult' in experimental);\n * assert('initialResult' in legacy);\n *\n * experimental.initialResult; // => { data: { colors: ['red'] }, pending: [ { id: '0', path: ['colors'] } ], hasNext: true }\n * legacy.initialResult; // => { data: { colors: ['red'] }, hasNext: true }\n *\n * const experimentalStream = await experimental.subsequentResults.next();\n * experimentalStream.value; // => { incremental: [ { items: ['green', 'blue'], id: '0' } ], completed: [{ id: '0' }], hasNext: false }\n *\n * const legacyStream = await legacy.subsequentResults.next();\n * legacyStream.value; // => { incremental: [ { items: ['green', 'blue'], path: ['colors', 1] } ], hasNext: false }\n * ```\n */\nexport function legacyExecuteIncrementally(\n args: ExecutionArgs,\n): PromiseOrValue<\n ExecutionResult | LegacyExperimentalIncrementalExecutionResults\n> {\n // If a valid execution context cannot be created due to incorrect arguments,\n // a \"Response\" with only errors is returned.\n const validatedExecutionArgs = validateExecutionArgs(args);\n\n // Return early errors if execution context failed.\n if (!('schema' in validatedExecutionArgs)) {\n return { errors: validatedExecutionArgs };\n }\n\n return legacyExecuteRootSelectionSet(validatedExecutionArgs);\n}\n\n/**\n * Executes a validated operation root selection set with support for `@defer`\n * and `@stream` using the legacy incremental delivery payload format.\n * @param validatedExecutionArgs - Validated execution arguments.\n * @returns A single execution result or legacy incremental execution results.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * legacyExecuteRootSelectionSet,\n * validateExecutionArgs,\n * } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const validatedArgs = validateExecutionArgs({\n * schema,\n * document: parse('{ greeting }'),\n * rootValue: { greeting: 'Hello' },\n * });\n *\n * assert('schema' in validatedArgs);\n *\n * const result = await legacyExecuteRootSelectionSet(validatedArgs);\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n */\nexport function legacyExecuteRootSelectionSet(\n validatedExecutionArgs: ValidatedExecutionArgs,\n): PromiseOrValue<\n ExecutionResult | LegacyExperimentalIncrementalExecutionResults\n> {\n return new BranchingIncrementalExecutor(\n validatedExecutionArgs,\n ).executeRootSelectionSet();\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.mts new file mode 100644 index 00000000..d7c5dc99 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.mts @@ -0,0 +1,8 @@ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.mjs"; +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + * + * @internal + */ +export declare function mapAsyncIterable(iterable: AsyncGenerator | AsyncIterable, callback: (value: T) => PromiseOrValue): AsyncGenerator; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.ts new file mode 100644 index 00000000..57b8047d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.d.ts @@ -0,0 +1,8 @@ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.js"; +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + * + * @internal + */ +export declare function mapAsyncIterable(iterable: AsyncGenerator | AsyncIterable, callback: (value: T) => PromiseOrValue): AsyncGenerator; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js new file mode 100644 index 00000000..1c8e6aa5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mapAsyncIterable = mapAsyncIterable; +const isPromise_ts_1 = require("../jsutils/isPromise.js"); +const withConcurrentAbruptClose_ts_1 = require("./withConcurrentAbruptClose.js"); +function mapAsyncIterable(iterable, callback) { + const iterator = iterable[Symbol.asyncIterator](); + const returnFn = iterator.return?.bind(iterator); + const throwFn = iterator.throw?.bind(iterator); + const onReturn = returnFn + ? () => callIgnoringErrors(returnFn) + : () => Promise.resolve(); + const onThrow = throwFn + ? (reason) => callIgnoringErrors(() => throwFn(reason)) + : onReturn; + return (0, withConcurrentAbruptClose_ts_1.withConcurrentAbruptClose)(mapAsyncIterableImpl(iterable, callback), onReturn, onThrow); +} +async function callIgnoringErrors(fn) { + try { + await fn(); + } + catch { + } +} +async function* mapAsyncIterableImpl(iterable, mapFn) { + for await (const value of iterable) { + const result = mapFn(value); + if ((0, isPromise_ts_1.isPromise)(result)) { + yield await result; + continue; + } + yield result; + } +} +//# sourceMappingURL=mapAsyncIterable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js.map new file mode 100644 index 00000000..17fb36c8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mapAsyncIterable.js","sourceRoot":"","sources":["../../src/execution/mapAsyncIterable.ts"],"names":[],"mappings":";;AAWA,4CAqBC;AAhCD,0DAAoD;AAGpD,iFAA2E;AAQ3E,SAAgB,gBAAgB,CAC9B,QAA8C,EAC9C,QAAyC;IAEzC,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;IAClD,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE/C,MAAM,QAAQ,GAAG,QAAQ;QACvB,CAAC,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC;QACpC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAE5B,MAAM,OAAO,GAAG,OAAO;QACrB,CAAC,CAAC,CAAC,MAAgB,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjE,CAAC,CAAC,QAAQ,CAAC;IAEb,OAAO,IAAA,wDAAyB,EAC9B,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACxC,QAAQ,EACR,OAAO,CACR,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,EAA0B;IAC1D,IAAI,CAAC;QACH,MAAM,EAAE,EAAE,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC;AAED,KAAK,SAAS,CAAC,CAAC,oBAAoB,CAClC,QAAuD,EACvD,KAAsC;IAEtC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,IAAA,wBAAS,EAAC,MAAM,CAAC,EAAE,CAAC;YACtB,MAAM,MAAM,MAAM,CAAC;YACnB,SAAS;QACX,CAAC;QACD,MAAM,MAAM,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import { isPromise } from '../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\nimport { withConcurrentAbruptClose } from './withConcurrentAbruptClose.ts';\n\n/**\n * Given an AsyncIterable and a callback function, return an AsyncIterator\n * which produces values mapped via calling the callback function.\n *\n * @internal\n */\nexport function mapAsyncIterable(\n iterable: AsyncGenerator | AsyncIterable,\n callback: (value: T) => PromiseOrValue,\n): AsyncGenerator {\n const iterator = iterable[Symbol.asyncIterator]();\n const returnFn = iterator.return?.bind(iterator);\n const throwFn = iterator.throw?.bind(iterator);\n\n const onReturn = returnFn\n ? () => callIgnoringErrors(returnFn)\n : () => Promise.resolve();\n\n const onThrow = throwFn\n ? (reason?: unknown) => callIgnoringErrors(() => throwFn(reason))\n : onReturn;\n\n return withConcurrentAbruptClose(\n mapAsyncIterableImpl(iterable, callback),\n onReturn,\n onThrow,\n );\n}\n\nasync function callIgnoringErrors(fn: () => Promise): Promise {\n try {\n await fn();\n } catch {\n // ignore error\n }\n}\n\nasync function* mapAsyncIterableImpl(\n iterable: AsyncGenerator | AsyncIterable,\n mapFn: (value: T) => PromiseOrValue,\n): AsyncGenerator {\n for await (const value of iterable) {\n const result = mapFn(value);\n if (isPromise(result)) {\n yield await result;\n continue;\n }\n yield result;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs new file mode 100644 index 00000000..69ebcb1a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs @@ -0,0 +1,32 @@ +import { isPromise } from "../jsutils/isPromise.mjs"; +import { withConcurrentAbruptClose } from "./withConcurrentAbruptClose.mjs"; +export function mapAsyncIterable(iterable, callback) { + const iterator = iterable[Symbol.asyncIterator](); + const returnFn = iterator.return?.bind(iterator); + const throwFn = iterator.throw?.bind(iterator); + const onReturn = returnFn + ? () => callIgnoringErrors(returnFn) + : () => Promise.resolve(); + const onThrow = throwFn + ? (reason) => callIgnoringErrors(() => throwFn(reason)) + : onReturn; + return withConcurrentAbruptClose(mapAsyncIterableImpl(iterable, callback), onReturn, onThrow); +} +async function callIgnoringErrors(fn) { + try { + await fn(); + } + catch { + } +} +async function* mapAsyncIterableImpl(iterable, mapFn) { + for await (const value of iterable) { + const result = mapFn(value); + if (isPromise(result)) { + yield await result; + continue; + } + yield result; + } +} +//# sourceMappingURL=mapAsyncIterable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs.map new file mode 100644 index 00000000..db29c832 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/mapAsyncIterable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mapAsyncIterable.js","sourceRoot":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AAE,CAAC;YACtB,MAAM,MAAM,MAAM,CAAC;YACnB,SAAS;QACX,CAAC;QACD,MAAM,MAAM,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import { isPromise } from '../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\nimport { withConcurrentAbruptClose } from './withConcurrentAbruptClose.ts';\n\n/**\n * Given an AsyncIterable and a callback function, return an AsyncIterator\n * which produces values mapped via calling the callback function.\n *\n * @internal\n */\nexport function mapAsyncIterable(\n iterable: AsyncGenerator | AsyncIterable,\n callback: (value: T) => PromiseOrValue,\n): AsyncGenerator {\n const iterator = iterable[Symbol.asyncIterator]();\n const returnFn = iterator.return?.bind(iterator);\n const throwFn = iterator.throw?.bind(iterator);\n\n const onReturn = returnFn\n ? () => callIgnoringErrors(returnFn)\n : () => Promise.resolve();\n\n const onThrow = throwFn\n ? (reason?: unknown) => callIgnoringErrors(() => throwFn(reason))\n : onReturn;\n\n return withConcurrentAbruptClose(\n mapAsyncIterableImpl(iterable, callback),\n onReturn,\n onThrow,\n );\n}\n\nasync function callIgnoringErrors(fn: () => Promise): Promise {\n try {\n await fn();\n } catch {\n // ignore error\n }\n}\n\nasync function* mapAsyncIterableImpl(\n iterable: AsyncGenerator | AsyncIterable,\n mapFn: (value: T) => PromiseOrValue,\n): AsyncGenerator {\n for await (const value of iterable) {\n const result = mapFn(value);\n if (isPromise(result)) {\n yield await result;\n continue;\n }\n yield result;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.mts new file mode 100644 index 00000000..1cc1371f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.mts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function returnIteratorCatchingErrors(iterator: AsyncIterator): Promise; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.ts new file mode 100644 index 00000000..1cc1371f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.d.ts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function returnIteratorCatchingErrors(iterator: AsyncIterator): Promise; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js new file mode 100644 index 00000000..12faf36e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.returnIteratorCatchingErrors = returnIteratorCatchingErrors; +async function returnIteratorCatchingErrors(iterator) { + try { + await iterator.return?.(); + } + catch { + } +} +//# sourceMappingURL=returnIteratorCatchingErrors.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js.map new file mode 100644 index 00000000..3a8a19cf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"returnIteratorCatchingErrors.js","sourceRoot":"","sources":["../../src/execution/returnIteratorCatchingErrors.ts"],"names":[],"mappings":";;AACA,oEAQC;AARM,KAAK,UAAU,4BAA4B,CAChD,QAAgC;IAEhC,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC","sourcesContent":["/** @internal */\nexport async function returnIteratorCatchingErrors(\n iterator: AsyncIterator,\n): Promise {\n try {\n await iterator.return?.();\n } catch {\n // ignore errors\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs new file mode 100644 index 00000000..d23bb1ac --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs @@ -0,0 +1,8 @@ +export async function returnIteratorCatchingErrors(iterator) { + try { + await iterator.return?.(); + } + catch { + } +} +//# sourceMappingURL=returnIteratorCatchingErrors.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs.map new file mode 100644 index 00000000..196c74e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"returnIteratorCatchingErrors.js","sourceRoot":"","sources":["../../src/execution/returnIteratorCatchingErrors.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,QAAgC;IAEhC,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC","sourcesContent":["/** @internal */\nexport async function returnIteratorCatchingErrors(\n iterator: AsyncIterator,\n): Promise {\n try {\n await iterator.return?.();\n } catch {\n // ignore errors\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.mts new file mode 100644 index 00000000..eb1bf9ff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.mts @@ -0,0 +1,243 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ObjMap, ReadOnlyObjMap } from "../jsutils/ObjMap.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import type { DirectiveNode, FieldNode, FragmentSpreadNode, VariableDefinitionNode } from "../language/ast.mjs"; +import type { GraphQLField } from "../type/definition.mjs"; +import type { GraphQLDirective } from "../type/directives.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { FragmentVariableValues } from "./collectFields.mjs"; +import type { GraphQLVariableSignature } from "./getVariableSignature.mjs"; +/** + * Coerced variable values prepared for execution. + * + * The `coerced` map contains runtime values keyed by variable name. The + * `sources` map records whether each value came from request input, an operation + * default, or a fragment-variable default so utilities can preserve defaults + * when replacing variables in literals. + */ +export interface VariableValues { + /** Source metadata for each variable value keyed by variable name. */ + readonly sources: ReadOnlyObjMap; + /** Coerced runtime variable values keyed by variable name. */ + readonly coerced: ReadOnlyObjMap; +} +interface VariableValueSource { + readonly signature: GraphQLVariableSignature; + readonly value?: unknown; +} +type VariableValuesOrErrors = { + variableValues: VariableValues; + errors?: never; +} | { + errors: ReadonlyArray; + variableValues?: never; +}; +/** + * Prepares an object map of variableValues of the correct type based on the + * provided variable definitions and arbitrary input. If the input cannot be + * parsed to match the variable definitions, GraphQLError values are returned. + * + * Note: Returned maps use null prototypes to avoid collisions with + * Object prototype properties. + * @param schema - GraphQL schema to use. + * @param varDefNodes - The variable definition AST nodes to coerce. + * @param inputs - The runtime variable values keyed by variable name. + * @param options - Optional configuration for this operation. + * @param [options.maxErrors] - Maximum number of coercion errors to report. + * @param [options.hideSuggestions] - Whether suggestion text should be omitted + * from errors. + * @returns Coerced variable values with source metadata, or request errors. + * @example + * ```ts + * // Coerce provided variables and apply operation defaults. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!, limit: Int = 10): [String] + * } + * `); + * const document = parse(` + * query ($stars: Int!, $limit: Int = 10) { + * reviews(stars: $stars, limit: $limit) + * } + * `); + * const operation = document.definitions[0]; + * + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: '5', + * }); + * + * assert('variableValues' in result); + * + * result.variableValues.coerced; // => { stars: 5, limit: 10 } + * ``` + * @example + * ```ts + * // This variant uses maxErrors to cap reported coercion errors. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput!): String + * } + * `); + * const document = parse(` + * query ($first: ReviewInput!, $second: ReviewInput!) { + * first: review(input: $first) + * second: review(input: $second) + * } + * `); + * const operation = document.definitions[0]; + * + * const result = getVariableValues( + * schema, + * operation.variableDefinitions, + * { first: { stars: 'bad' }, second: { stars: 'also bad' } }, + * { maxErrors: 1 }, + * ); + * + * assert('errors' in result); + * + * result.errors.length; // => 2 + * result.errors[1].message; // matches /error limit reached/ + * ``` + */ +export declare function getVariableValues(schema: GraphQLSchema, varDefNodes: ReadonlyArray, inputs: { + readonly [variable: string]: unknown; +}, options?: { + maxErrors?: number; + hideSuggestions?: boolean; +}): VariableValuesOrErrors; +/** @internal */ +export declare function getFragmentVariableValues(fragmentSpreadNode: FragmentSpreadNode, fragmentSignatures: ReadOnlyObjMap, variableValues: VariableValues, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): FragmentVariableValues; +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: Returned value uses a null prototype to avoid collisions with + * JavaScript's own property names. + * @param def - Field or directive definition that declares the arguments. + * @param node - Field or directive AST node supplying argument literals. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns A map of coerced argument values. + * @example + * ```ts + * // Read literal argument values and defaults. + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getArgumentValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!, limit: Int = 10): [String] + * } + * `); + * const fieldDef = schema.getQueryType().getFields().reviews; + * const document = parse('{ reviews(stars: 5) }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * + * getArgumentValues(fieldDef, fieldNode); // => { stars: 5, limit: 10 } + * ``` + * @example + * ```ts + * // This variant resolves argument values from operation variables. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getArgumentValues, getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!): [String] + * } + * `); + * const fieldDef = schema.getQueryType().getFields().reviews; + * const document = parse('query ($stars: Int!) { reviews(stars: $stars) }'); + * const operation = document.definitions[0]; + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const variables = getVariableValues(schema, operation.variableDefinitions, { + * stars: '5', + * }); + * + * assert('variableValues' in variables); + * + * getArgumentValues(fieldDef, fieldNode, variables.variableValues); // => { stars: 5 } + * getArgumentValues(fieldDef, fieldNode); // throws an error + * ``` + */ +export declare function getArgumentValues(def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Maybe, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): ObjMap; +/** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * Note: Returned value uses a null prototype to avoid collisions with + * JavaScript's own property names. + * @param directiveDef - Directive definition to read argument definitions from. + * @param node - AST node that may contain directives. + * @param node.directives - The directives on the AST node. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns A map of coerced directive argument values, or undefined when absent. + * @example + * ```ts + * // Read literal directive arguments from a node. + * import { parse } from 'graphql/language'; + * import { GraphQLSkipDirective } from 'graphql/type'; + * import { getDirectiveValues } from 'graphql/execution'; + * + * const document = parse('{ name @skip(if: true) }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * + * getDirectiveValues(GraphQLSkipDirective, fieldNode); // => { if: true } + * ``` + * @example + * ```ts + * // This variant resolves directive arguments from variables and handles absent directives. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { GraphQLIncludeDirective } from 'graphql/type'; + * import { buildSchema } from 'graphql/utilities'; + * import { getDirectiveValues, getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { name: String }'); + * const document = parse( + * 'query ($includeName: Boolean!) { name @include(if: $includeName) }', + * ); + * const operation = document.definitions[0]; + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const variables = getVariableValues(schema, operation.variableDefinitions, { + * includeName: false, + * }); + * + * assert('variableValues' in variables); + * + * getDirectiveValues( + * GraphQLIncludeDirective, + * fieldNode, + * variables.variableValues, + * ); // => { if: false } + * getDirectiveValues(GraphQLIncludeDirective, { directives: [] }); // => undefined + * ``` + */ +export declare function getDirectiveValues(directiveDef: GraphQLDirective, node: { + readonly directives?: ReadonlyArray | undefined; +}, variableValues?: Maybe, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): undefined | ObjMap; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.ts new file mode 100644 index 00000000..ef46cfb0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.d.ts @@ -0,0 +1,243 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ObjMap, ReadOnlyObjMap } from "../jsutils/ObjMap.js"; +import { GraphQLError } from "../error/GraphQLError.js"; +import type { DirectiveNode, FieldNode, FragmentSpreadNode, VariableDefinitionNode } from "../language/ast.js"; +import type { GraphQLField } from "../type/definition.js"; +import type { GraphQLDirective } from "../type/directives.js"; +import type { GraphQLSchema } from "../type/schema.js"; +import type { FragmentVariableValues } from "./collectFields.js"; +import type { GraphQLVariableSignature } from "./getVariableSignature.js"; +/** + * Coerced variable values prepared for execution. + * + * The `coerced` map contains runtime values keyed by variable name. The + * `sources` map records whether each value came from request input, an operation + * default, or a fragment-variable default so utilities can preserve defaults + * when replacing variables in literals. + */ +export interface VariableValues { + /** Source metadata for each variable value keyed by variable name. */ + readonly sources: ReadOnlyObjMap; + /** Coerced runtime variable values keyed by variable name. */ + readonly coerced: ReadOnlyObjMap; +} +interface VariableValueSource { + readonly signature: GraphQLVariableSignature; + readonly value?: unknown; +} +type VariableValuesOrErrors = { + variableValues: VariableValues; + errors?: never; +} | { + errors: ReadonlyArray; + variableValues?: never; +}; +/** + * Prepares an object map of variableValues of the correct type based on the + * provided variable definitions and arbitrary input. If the input cannot be + * parsed to match the variable definitions, GraphQLError values are returned. + * + * Note: Returned maps use null prototypes to avoid collisions with + * Object prototype properties. + * @param schema - GraphQL schema to use. + * @param varDefNodes - The variable definition AST nodes to coerce. + * @param inputs - The runtime variable values keyed by variable name. + * @param options - Optional configuration for this operation. + * @param [options.maxErrors] - Maximum number of coercion errors to report. + * @param [options.hideSuggestions] - Whether suggestion text should be omitted + * from errors. + * @returns Coerced variable values with source metadata, or request errors. + * @example + * ```ts + * // Coerce provided variables and apply operation defaults. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!, limit: Int = 10): [String] + * } + * `); + * const document = parse(` + * query ($stars: Int!, $limit: Int = 10) { + * reviews(stars: $stars, limit: $limit) + * } + * `); + * const operation = document.definitions[0]; + * + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: '5', + * }); + * + * assert('variableValues' in result); + * + * result.variableValues.coerced; // => { stars: 5, limit: 10 } + * ``` + * @example + * ```ts + * // This variant uses maxErrors to cap reported coercion errors. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput!): String + * } + * `); + * const document = parse(` + * query ($first: ReviewInput!, $second: ReviewInput!) { + * first: review(input: $first) + * second: review(input: $second) + * } + * `); + * const operation = document.definitions[0]; + * + * const result = getVariableValues( + * schema, + * operation.variableDefinitions, + * { first: { stars: 'bad' }, second: { stars: 'also bad' } }, + * { maxErrors: 1 }, + * ); + * + * assert('errors' in result); + * + * result.errors.length; // => 2 + * result.errors[1].message; // matches /error limit reached/ + * ``` + */ +export declare function getVariableValues(schema: GraphQLSchema, varDefNodes: ReadonlyArray, inputs: { + readonly [variable: string]: unknown; +}, options?: { + maxErrors?: number; + hideSuggestions?: boolean; +}): VariableValuesOrErrors; +/** @internal */ +export declare function getFragmentVariableValues(fragmentSpreadNode: FragmentSpreadNode, fragmentSignatures: ReadOnlyObjMap, variableValues: VariableValues, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): FragmentVariableValues; +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: Returned value uses a null prototype to avoid collisions with + * JavaScript's own property names. + * @param def - Field or directive definition that declares the arguments. + * @param node - Field or directive AST node supplying argument literals. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns A map of coerced argument values. + * @example + * ```ts + * // Read literal argument values and defaults. + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getArgumentValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!, limit: Int = 10): [String] + * } + * `); + * const fieldDef = schema.getQueryType().getFields().reviews; + * const document = parse('{ reviews(stars: 5) }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * + * getArgumentValues(fieldDef, fieldNode); // => { stars: 5, limit: 10 } + * ``` + * @example + * ```ts + * // This variant resolves argument values from operation variables. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { getArgumentValues, getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!): [String] + * } + * `); + * const fieldDef = schema.getQueryType().getFields().reviews; + * const document = parse('query ($stars: Int!) { reviews(stars: $stars) }'); + * const operation = document.definitions[0]; + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const variables = getVariableValues(schema, operation.variableDefinitions, { + * stars: '5', + * }); + * + * assert('variableValues' in variables); + * + * getArgumentValues(fieldDef, fieldNode, variables.variableValues); // => { stars: 5 } + * getArgumentValues(fieldDef, fieldNode); // throws an error + * ``` + */ +export declare function getArgumentValues(def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Maybe, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): ObjMap; +/** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * Note: Returned value uses a null prototype to avoid collisions with + * JavaScript's own property names. + * @param directiveDef - Directive definition to read argument definitions from. + * @param node - AST node that may contain directives. + * @param node.directives - The directives on the AST node. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns A map of coerced directive argument values, or undefined when absent. + * @example + * ```ts + * // Read literal directive arguments from a node. + * import { parse } from 'graphql/language'; + * import { GraphQLSkipDirective } from 'graphql/type'; + * import { getDirectiveValues } from 'graphql/execution'; + * + * const document = parse('{ name @skip(if: true) }'); + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * + * getDirectiveValues(GraphQLSkipDirective, fieldNode); // => { if: true } + * ``` + * @example + * ```ts + * // This variant resolves directive arguments from variables and handles absent directives. + * import assert from 'node:assert'; + * import { parse } from 'graphql/language'; + * import { GraphQLIncludeDirective } from 'graphql/type'; + * import { buildSchema } from 'graphql/utilities'; + * import { getDirectiveValues, getVariableValues } from 'graphql/execution'; + * + * const schema = buildSchema('type Query { name: String }'); + * const document = parse( + * 'query ($includeName: Boolean!) { name @include(if: $includeName) }', + * ); + * const operation = document.definitions[0]; + * const fieldNode = document.definitions[0].selectionSet.selections[0]; + * const variables = getVariableValues(schema, operation.variableDefinitions, { + * includeName: false, + * }); + * + * assert('variableValues' in variables); + * + * getDirectiveValues( + * GraphQLIncludeDirective, + * fieldNode, + * variables.variableValues, + * ); // => { if: false } + * getDirectiveValues(GraphQLIncludeDirective, { directives: [] }); // => undefined + * ``` + */ +export declare function getDirectiveValues(directiveDef: GraphQLDirective, node: { + readonly directives?: ReadonlyArray | undefined; +}, variableValues?: Maybe, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): undefined | ObjMap; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js new file mode 100644 index 00000000..a438f2a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js @@ -0,0 +1,178 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getVariableValues = getVariableValues; +exports.getFragmentVariableValues = getFragmentVariableValues; +exports.getArgumentValues = getArgumentValues; +exports.getDirectiveValues = getDirectiveValues; +const invariant_ts_1 = require("../jsutils/invariant.js"); +const printPathArray_ts_1 = require("../jsutils/printPathArray.js"); +const ensureGraphQLError_ts_1 = require("../error/ensureGraphQLError.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +const validate_ts_1 = require("../type/validate.js"); +const coerceInputValue_ts_1 = require("../utilities/coerceInputValue.js"); +const validateInputValue_ts_1 = require("../utilities/validateInputValue.js"); +const getVariableSignature_ts_1 = require("./getVariableSignature.js"); +function getVariableValues(schema, varDefNodes, inputs, options) { + const errors = []; + const maxErrors = options?.maxErrors; + try { + const variableValues = coerceVariableValues(schema, varDefNodes, inputs, (error) => { + if (maxErrors != null && errors.length >= maxErrors) { + throw new GraphQLError_ts_1.GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.'); + } + errors.push(error); + }, options?.hideSuggestions); + if (errors.length === 0) { + return { variableValues }; + } + } + catch (error) { + errors.push((0, ensureGraphQLError_ts_1.ensureGraphQLError)(error)); + } + return { errors }; +} +function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggestions) { + const sources = Object.create(null); + const coerced = Object.create(null); + for (const varDefNode of varDefNodes) { + const varSignature = (0, getVariableSignature_ts_1.getVariableSignature)(schema, varDefNode); + if (varSignature instanceof GraphQLError_ts_1.GraphQLError) { + onError(varSignature); + continue; + } + const { name: varName, type: varType } = varSignature; + const value = Object.hasOwn(inputs, varName) ? inputs[varName] : undefined; + if (value === undefined) { + sources[varName] = { signature: varSignature }; + if (varDefNode.defaultValue) { + maybeUseDefaultValue(coerced, varName, varSignature, (error, path) => { + onError(new GraphQLError_ts_1.GraphQLError(`Variable "$${varName}" has invalid default value${(0, printPathArray_ts_1.printPathArray)(path)}: ${error.message}`, { nodes: varDefNode })); + }, hideSuggestions); + continue; + } + else if (!(0, definition_ts_1.isNonNullType)(varType)) { + continue; + } + } + else { + sources[varName] = { signature: varSignature, value }; + } + const coercedValue = (0, coerceInputValue_ts_1.coerceInputValue)(value, varType); + if (coercedValue !== undefined) { + coerced[varName] = coercedValue; + } + else { + (0, validateInputValue_ts_1.validateInputValue)(value, varType, (error, path) => { + onError(new GraphQLError_ts_1.GraphQLError(`Variable "$${varName}" has invalid value${(0, printPathArray_ts_1.printPathArray)(path)}: ${error.message}`, { nodes: varDefNode, originalError: error })); + }, hideSuggestions); + } + } + return { sources, coerced }; +} +function maybeUseDefaultValue(coercedValues, name, inputValue, onError, hideSuggestions) { + try { + const coercedDefaultValue = (0, coerceInputValue_ts_1.coerceDefaultValue)(inputValue); + if (coercedDefaultValue !== undefined) { + coercedValues[name] = coercedDefaultValue; + } + } + catch (error) { + const defaultInput = inputValue.default; + if (defaultInput === undefined) { + throw error; + } + let reportedValidationError = false; + (0, validate_ts_1.validateDefaultInput)(defaultInput, inputValue.type, (defaultError, path) => { + reportedValidationError = true; + onError(defaultError, path); + }, hideSuggestions); + if (!reportedValidationError) { + onError((0, ensureGraphQLError_ts_1.ensureGraphQLError)(error), []); + } + } +} +function getFragmentVariableValues(fragmentSpreadNode, fragmentSignatures, variableValues, fragmentVariableValues, hideSuggestions) { + const argumentNodes = fragmentSpreadNode.arguments ?? []; + const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg])); + const sources = Object.create(null); + const coerced = Object.create(null); + for (const [varName, varSignature] of Object.entries(fragmentSignatures)) { + const argumentNode = argNodeMap.get(varName); + if (argumentNode !== undefined) { + sources[varName] = + fragmentVariableValues == null + ? { signature: varSignature, value: argumentNode.value } + : { + signature: varSignature, + value: argumentNode.value, + fragmentVariableValues, + }; + } + else { + sources[varName] = { + signature: varSignature, + }; + } + coerceArgument(coerced, fragmentSpreadNode, varName, varSignature, argumentNode, variableValues, fragmentVariableValues, hideSuggestions); + } + return { sources, coerced }; +} +function getArgumentValues(def, node, variableValues, fragmentVariableValues, hideSuggestions) { + const coercedValues = Object.create(null); + const argumentNodes = node.arguments ?? []; + const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg])); + for (const argDef of def.args) { + const name = argDef.name; + coerceArgument(coercedValues, node, name, argDef, argNodeMap.get(argDef.name), variableValues, fragmentVariableValues, hideSuggestions); + } + return coercedValues; +} +function coerceArgument(coercedValues, node, argName, argDef, argumentNode, variableValues, fragmentVariableValues, hideSuggestions) { + const argType = argDef.type; + const onArgDefaultValueError = (error, path) => { + throw new GraphQLError_ts_1.GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${(0, printPathArray_ts_1.printPathArray)(path)}: ${error.message}`, { nodes: node }); + }; + if (!argumentNode) { + if ((0, definition_ts_1.isRequiredArgument)(argDef)) { + throw new GraphQLError_ts_1.GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} of required type "${argType}" was not provided.`, { nodes: node }); + } + maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions); + return; + } + const valueNode = argumentNode.value; + if (valueNode.kind === kinds_ts_1.Kind.VARIABLE) { + const variableName = valueNode.name.value; + const scopedVariableValues = fragmentVariableValues?.sources[variableName] + ? fragmentVariableValues + : variableValues; + if ((scopedVariableValues == null || + !Object.hasOwn(scopedVariableValues.coerced, variableName)) && + !(0, definition_ts_1.isRequiredArgument)(argDef)) { + maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions); + return; + } + } + const coercedValue = (0, coerceInputValue_ts_1.coerceInputLiteral)(valueNode, argType, variableValues, fragmentVariableValues); + if (coercedValue === undefined) { + (0, validateInputValue_ts_1.validateInputLiteral)(valueNode, argType, (error, path) => { + error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${(0, printPathArray_ts_1.printPathArray)(path)}: ${error.message}`; + throw error; + }, variableValues, fragmentVariableValues, hideSuggestions); + (0, invariant_ts_1.invariant)(false, 'Invalid argument'); + } + coercedValues[argName] = coercedValue; +} +function printArgumentOrFragmentVariable(argDef, node) { + return (0, definition_ts_1.isArgument)(argDef) + ? `Argument "${argDef}"` + : `Variable "$${argDef.name}" defined by fragment "${node.name.value}"`; +} +function getDirectiveValues(directiveDef, node, variableValues, fragmentVariableValues, hideSuggestions) { + const directiveNode = node.directives?.find((directive) => directive.name.value === directiveDef.name); + if (directiveNode) { + return getArgumentValues(directiveDef, directiveNode, variableValues, fragmentVariableValues, hideSuggestions); + } +} +//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js.map new file mode 100644 index 00000000..0b972681 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.js.map @@ -0,0 +1 @@ +{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/execution/values.ts"],"names":[],"mappings":";;AAwJA,8CAgCC;AAoHD,8DAyCC;AA2DD,8CA0BC;AAuKD,gDAoBC;AAnmBD,0DAAoD;AAGpD,oEAA8D;AAE9D,0EAAoE;AACpE,8DAAwD;AAUxD,mDAA4C;AAG5C,yDAI+B;AAG/B,qDAA2D;AAE3D,0EAI0C;AAC1C,8EAG4C;AAO5C,uEAAiE;AA2GjE,SAAgB,iBAAiB,CAC/B,MAAqB,EACrB,WAAkD,EAClD,MAAgD,EAChD,OAA2D;IAE3D,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,oBAAoB,CACzC,MAAM,EACN,WAAW,EACX,MAAM,EACN,CAAC,KAAK,EAAE,EAAE;YACR,IAAI,SAAS,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;gBACpD,MAAM,IAAI,8BAAY,CACpB,+EAA+E,CAChF,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,EACD,OAAO,EAAE,eAAe,CACzB,CAAC;QAEF,IAAI,MAAM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EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,IAAI,CAC1D,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,iBAAiB,CACtB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,eAAe,CAChB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.ts';\nimport { printPathArray } from '../jsutils/printPathArray.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ArgumentNode,\n DirectiveNode,\n FieldNode,\n FragmentArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLArgument, GraphQLField } from '../type/definition.ts';\nimport {\n isArgument,\n isNonNullType,\n isRequiredArgument,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\nimport { validateDefaultInput } from '../type/validate.ts';\n\nimport {\n coerceDefaultValue,\n coerceInputLiteral,\n coerceInputValue,\n} from '../utilities/coerceInputValue.ts';\nimport {\n validateInputLiteral,\n validateInputValue,\n} from '../utilities/validateInputValue.ts';\n\nimport type {\n FragmentVariableValues,\n FragmentVariableValueSource,\n} from './collectFields.ts';\nimport type { GraphQLVariableSignature } from './getVariableSignature.ts';\nimport { getVariableSignature } from './getVariableSignature.ts';\n\n/**\n * Coerced variable values prepared for execution.\n *\n * The `coerced` map contains runtime values keyed by variable name. The\n * `sources` map records whether each value came from request input, an operation\n * default, or a fragment-variable default so utilities can preserve defaults\n * when replacing variables in literals.\n */\nexport interface VariableValues {\n /** Source metadata for each variable value keyed by variable name. */\n readonly sources: ReadOnlyObjMap;\n /** Coerced runtime variable values keyed by variable name. */\n readonly coerced: ReadOnlyObjMap;\n}\n\ninterface VariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: unknown;\n}\n\ntype VariableValuesOrErrors =\n | { variableValues: VariableValues; errors?: never }\n | { errors: ReadonlyArray; variableValues?: never };\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, GraphQLError values are returned.\n *\n * Note: Returned maps use null prototypes to avoid collisions with\n * Object prototype properties.\n * @param schema - GraphQL schema to use.\n * @param varDefNodes - The variable definition AST nodes to coerce.\n * @param inputs - The runtime variable values keyed by variable name.\n * @param options - Optional configuration for this operation.\n * @param [options.maxErrors] - Maximum number of coercion errors to report.\n * @param [options.hideSuggestions] - Whether suggestion text should be omitted\n * from errors.\n * @returns Coerced variable values with source metadata, or request errors.\n * @example\n * ```ts\n * // Coerce provided variables and apply operation defaults.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!, limit: Int = 10): [String]\n * }\n * `);\n * const document = parse(`\n * query ($stars: Int!, $limit: Int = 10) {\n * reviews(stars: $stars, limit: $limit)\n * }\n * `);\n * const operation = document.definitions[0];\n *\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '5',\n * });\n *\n * assert('variableValues' in result);\n *\n * result.variableValues.coerced; // => { stars: 5, limit: 10 }\n * ```\n * @example\n * ```ts\n * // This variant uses maxErrors to cap reported coercion errors.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput!): String\n * }\n * `);\n * const document = parse(`\n * query ($first: ReviewInput!, $second: ReviewInput!) {\n * first: review(input: $first)\n * second: review(input: $second)\n * }\n * `);\n * const operation = document.definitions[0];\n *\n * const result = getVariableValues(\n * schema,\n * operation.variableDefinitions,\n * { first: { stars: 'bad' }, second: { stars: 'also bad' } },\n * { maxErrors: 1 },\n * );\n *\n * assert('errors' in result);\n *\n * result.errors.length; // => 2\n * result.errors[1].message; // matches /error limit reached/\n * ```\n */\nexport function getVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray,\n inputs: { readonly [variable: string]: unknown },\n options?: { maxErrors?: number; hideSuggestions?: boolean },\n): VariableValuesOrErrors {\n const errors: Array = [];\n const maxErrors = options?.maxErrors;\n try {\n const variableValues = coerceVariableValues(\n schema,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n 'Too many errors processing variables, error limit reached. Execution aborted.',\n );\n }\n errors.push(error);\n },\n options?.hideSuggestions,\n );\n\n if (errors.length === 0) {\n return { variableValues };\n }\n } catch (error) {\n errors.push(ensureGraphQLError(error));\n }\n\n return { errors };\n}\n\nfunction coerceVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray,\n inputs: { readonly [variable: string]: unknown },\n onError: (error: GraphQLError) => void,\n hideSuggestions?: Maybe,\n): VariableValues {\n const sources: ObjMap = Object.create(null);\n const coerced: ObjMap = Object.create(null);\n for (const varDefNode of varDefNodes) {\n const varSignature = getVariableSignature(schema, varDefNode);\n\n if (varSignature instanceof GraphQLError) {\n onError(varSignature);\n continue;\n }\n\n const { name: varName, type: varType } = varSignature;\n const value = Object.hasOwn(inputs, varName) ? inputs[varName] : undefined;\n if (value === undefined) {\n sources[varName] = { signature: varSignature };\n if (varDefNode.defaultValue) {\n maybeUseDefaultValue(\n coerced,\n varName,\n varSignature,\n (error, path) => {\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" has invalid default value${printPathArray(path)}: ${error.message}`,\n { nodes: varDefNode },\n ),\n );\n },\n hideSuggestions,\n );\n continue;\n } else if (!isNonNullType(varType)) {\n // Non-provided values for nullable variables are omitted.\n continue;\n }\n } else {\n sources[varName] = { signature: varSignature, value };\n }\n\n const coercedValue = coerceInputValue(value, varType);\n if (coercedValue !== undefined) {\n coerced[varName] = coercedValue;\n } else {\n validateInputValue(\n value,\n varType,\n (error, path) => {\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" has invalid value${printPathArray(path)}: ${\n error.message\n }`,\n { nodes: varDefNode, originalError: error },\n ),\n );\n },\n hideSuggestions,\n );\n }\n }\n\n return { sources, coerced };\n}\n\nfunction maybeUseDefaultValue(\n coercedValues: ObjMap,\n name: string,\n inputValue: GraphQLArgument | GraphQLVariableSignature,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions?: Maybe,\n): void {\n try {\n // coerceDefaultValue assumes validation has already rejected invalid\n // defaults. If validation was skipped, invalid defaults or nested input\n // field defaults can throw here; recover with validation-style errors below.\n const coercedDefaultValue = coerceDefaultValue(inputValue);\n if (coercedDefaultValue !== undefined) {\n coercedValues[name] = coercedDefaultValue;\n }\n } catch (error) {\n const defaultInput = inputValue.default;\n // Defensive: coerceDefaultValue should only throw while coercing a default.\n /* node:coverage ignore next 3 */\n if (defaultInput === undefined) {\n throw error;\n }\n\n // Prefer validation's user-facing errors for invalid defaults.\n let reportedValidationError = false;\n validateDefaultInput(\n defaultInput,\n inputValue.type,\n (defaultError, path) => {\n reportedValidationError = true;\n onError(defaultError, path);\n },\n hideSuggestions,\n );\n\n if (!reportedValidationError) {\n // The default itself validated, so coercion failed while applying a nested\n // input field default. Surface the original coercion error.\n onError(ensureGraphQLError(error), []);\n }\n }\n}\n\n/** @internal */\nexport function getFragmentVariableValues(\n fragmentSpreadNode: FragmentSpreadNode,\n fragmentSignatures: ReadOnlyObjMap,\n variableValues: VariableValues,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): FragmentVariableValues {\n const argumentNodes = fragmentSpreadNode.arguments ?? [];\n const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));\n const sources: ObjMap = Object.create(null);\n const coerced: ObjMap = Object.create(null);\n for (const [varName, varSignature] of Object.entries(fragmentSignatures)) {\n const argumentNode = argNodeMap.get(varName);\n if (argumentNode !== undefined) {\n sources[varName] =\n fragmentVariableValues == null\n ? { signature: varSignature, value: argumentNode.value }\n : {\n signature: varSignature,\n value: argumentNode.value,\n fragmentVariableValues,\n };\n } else {\n sources[varName] = {\n signature: varSignature,\n };\n }\n\n coerceArgument(\n coerced,\n fragmentSpreadNode,\n varName,\n varSignature,\n argumentNode,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n return { sources, coerced };\n}\n\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: Returned value uses a null prototype to avoid collisions with\n * JavaScript's own property names.\n * @param def - Field or directive definition that declares the arguments.\n * @param node - Field or directive AST node supplying argument literals.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns A map of coerced argument values.\n * @example\n * ```ts\n * // Read literal argument values and defaults.\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getArgumentValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!, limit: Int = 10): [String]\n * }\n * `);\n * const fieldDef = schema.getQueryType().getFields().reviews;\n * const document = parse('{ reviews(stars: 5) }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n *\n * getArgumentValues(fieldDef, fieldNode); // => { stars: 5, limit: 10 }\n * ```\n * @example\n * ```ts\n * // This variant resolves argument values from operation variables.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getArgumentValues, getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!): [String]\n * }\n * `);\n * const fieldDef = schema.getQueryType().getFields().reviews;\n * const document = parse('query ($stars: Int!) { reviews(stars: $stars) }');\n * const operation = document.definitions[0];\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const variables = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '5',\n * });\n *\n * assert('variableValues' in variables);\n *\n * getArgumentValues(fieldDef, fieldNode, variables.variableValues); // => { stars: 5 }\n * getArgumentValues(fieldDef, fieldNode); // throws an error\n * ```\n */\nexport function getArgumentValues(\n def: GraphQLField | GraphQLDirective,\n node: FieldNode | DirectiveNode,\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): ObjMap {\n const coercedValues: ObjMap = Object.create(null);\n\n const argumentNodes = node.arguments ?? [];\n const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));\n\n for (const argDef of def.args) {\n const name = argDef.name;\n coerceArgument(\n coercedValues,\n node,\n name,\n argDef,\n argNodeMap.get(argDef.name),\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n return coercedValues;\n}\n\n/** @internal */\n// eslint-disable-next-line max-params\nfunction coerceArgument(\n coercedValues: ObjMap,\n node: FieldNode | DirectiveNode | FragmentSpreadNode,\n argName: string,\n argDef: GraphQLArgument | GraphQLVariableSignature,\n argumentNode: ArgumentNode | FragmentArgumentNode | undefined,\n variableValues: Maybe,\n fragmentVariableValues: Maybe,\n hideSuggestions?: Maybe,\n): void {\n const argType = argDef.type;\n const onArgDefaultValueError = (\n error: GraphQLError,\n path: ReadonlyArray,\n ): never => {\n throw new GraphQLError(\n `${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${printPathArray(path)}: ${error.message}`,\n { nodes: node },\n );\n };\n\n if (!argumentNode) {\n if (isRequiredArgument(argDef)) {\n // Note: ProvidedRequiredArgumentsRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n `${printArgumentOrFragmentVariable(argDef, node)} of required type \"${argType}\" was not provided.`,\n { nodes: node },\n );\n }\n maybeUseDefaultValue(\n coercedValues,\n argName,\n argDef,\n onArgDefaultValueError,\n hideSuggestions,\n );\n return;\n }\n\n const valueNode = argumentNode.value;\n\n // Variables without a value are treated as if no argument was provided if\n // the argument is not required.\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n const scopedVariableValues = fragmentVariableValues?.sources[variableName]\n ? fragmentVariableValues\n : variableValues;\n if (\n (scopedVariableValues == null ||\n !Object.hasOwn(scopedVariableValues.coerced, variableName)) &&\n !isRequiredArgument(argDef)\n ) {\n maybeUseDefaultValue(\n coercedValues,\n argName,\n argDef,\n onArgDefaultValueError,\n hideSuggestions,\n );\n return;\n }\n }\n const coercedValue = coerceInputLiteral(\n valueNode,\n argType,\n variableValues,\n fragmentVariableValues,\n );\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n validateInputLiteral(\n valueNode,\n argType,\n (error, path) => {\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${printPathArray(\n path,\n )}: ${error.message}`;\n throw error;\n },\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n /* node:coverage ignore next */\n invariant(false, 'Invalid argument');\n }\n coercedValues[argName] = coercedValue;\n}\n\n// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\nfunction printArgumentOrFragmentVariable(\n argDef: GraphQLArgument | GraphQLVariableSignature,\n node: FieldNode | DirectiveNode | FragmentSpreadNode,\n): string {\n return isArgument(argDef)\n ? `Argument \"${argDef}\"`\n : `Variable \"$${argDef.name}\" defined by fragment \"${node.name.value}\"`;\n}\n\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: Returned value uses a null prototype to avoid collisions with\n * JavaScript's own property names.\n * @param directiveDef - Directive definition to read argument definitions from.\n * @param node - AST node that may contain directives.\n * @param node.directives - The directives on the AST node.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns A map of coerced directive argument values, or undefined when absent.\n * @example\n * ```ts\n * // Read literal directive arguments from a node.\n * import { parse } from 'graphql/language';\n * import { GraphQLSkipDirective } from 'graphql/type';\n * import { getDirectiveValues } from 'graphql/execution';\n *\n * const document = parse('{ name @skip(if: true) }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n *\n * getDirectiveValues(GraphQLSkipDirective, fieldNode); // => { if: true }\n * ```\n * @example\n * ```ts\n * // This variant resolves directive arguments from variables and handles absent directives.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { GraphQLIncludeDirective } from 'graphql/type';\n * import { buildSchema } from 'graphql/utilities';\n * import { getDirectiveValues, getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { name: String }');\n * const document = parse(\n * 'query ($includeName: Boolean!) { name @include(if: $includeName) }',\n * );\n * const operation = document.definitions[0];\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const variables = getVariableValues(schema, operation.variableDefinitions, {\n * includeName: false,\n * });\n *\n * assert('variableValues' in variables);\n *\n * getDirectiveValues(\n * GraphQLIncludeDirective,\n * fieldNode,\n * variables.variableValues,\n * ); // => { if: false }\n * getDirectiveValues(GraphQLIncludeDirective, { directives: [] }); // => undefined\n * ```\n */\nexport function getDirectiveValues(\n directiveDef: GraphQLDirective,\n node: { readonly directives?: ReadonlyArray | undefined },\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): undefined | ObjMap {\n const directiveNode = node.directives?.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return getArgumentValues(\n directiveDef,\n directiveNode,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs new file mode 100644 index 00000000..dcc578b1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs @@ -0,0 +1,172 @@ +import { invariant } from "../jsutils/invariant.mjs"; +import { printPathArray } from "../jsutils/printPathArray.mjs"; +import { ensureGraphQLError } from "../error/ensureGraphQLError.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { isArgument, isNonNullType, isRequiredArgument, } from "../type/definition.mjs"; +import { validateDefaultInput } from "../type/validate.mjs"; +import { coerceDefaultValue, coerceInputLiteral, coerceInputValue, } from "../utilities/coerceInputValue.mjs"; +import { validateInputLiteral, validateInputValue, } from "../utilities/validateInputValue.mjs"; +import { getVariableSignature } from "./getVariableSignature.mjs"; +export function getVariableValues(schema, varDefNodes, inputs, options) { + const errors = []; + const maxErrors = options?.maxErrors; + try { + const variableValues = coerceVariableValues(schema, varDefNodes, inputs, (error) => { + if (maxErrors != null && errors.length >= maxErrors) { + throw new GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.'); + } + errors.push(error); + }, options?.hideSuggestions); + if (errors.length === 0) { + return { variableValues }; + } + } + catch (error) { + errors.push(ensureGraphQLError(error)); + } + return { errors }; +} +function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggestions) { + const sources = Object.create(null); + const coerced = Object.create(null); + for (const varDefNode of varDefNodes) { + const varSignature = getVariableSignature(schema, varDefNode); + if (varSignature instanceof GraphQLError) { + onError(varSignature); + continue; + } + const { name: varName, type: varType } = varSignature; + const value = Object.hasOwn(inputs, varName) ? inputs[varName] : undefined; + if (value === undefined) { + sources[varName] = { signature: varSignature }; + if (varDefNode.defaultValue) { + maybeUseDefaultValue(coerced, varName, varSignature, (error, path) => { + onError(new GraphQLError(`Variable "$${varName}" has invalid default value${printPathArray(path)}: ${error.message}`, { nodes: varDefNode })); + }, hideSuggestions); + continue; + } + else if (!isNonNullType(varType)) { + continue; + } + } + else { + sources[varName] = { signature: varSignature, value }; + } + const coercedValue = coerceInputValue(value, varType); + if (coercedValue !== undefined) { + coerced[varName] = coercedValue; + } + else { + validateInputValue(value, varType, (error, path) => { + onError(new GraphQLError(`Variable "$${varName}" has invalid value${printPathArray(path)}: ${error.message}`, { nodes: varDefNode, originalError: error })); + }, hideSuggestions); + } + } + return { sources, coerced }; +} +function maybeUseDefaultValue(coercedValues, name, inputValue, onError, hideSuggestions) { + try { + const coercedDefaultValue = coerceDefaultValue(inputValue); + if (coercedDefaultValue !== undefined) { + coercedValues[name] = coercedDefaultValue; + } + } + catch (error) { + const defaultInput = inputValue.default; + if (defaultInput === undefined) { + throw error; + } + let reportedValidationError = false; + validateDefaultInput(defaultInput, inputValue.type, (defaultError, path) => { + reportedValidationError = true; + onError(defaultError, path); + }, hideSuggestions); + if (!reportedValidationError) { + onError(ensureGraphQLError(error), []); + } + } +} +export function getFragmentVariableValues(fragmentSpreadNode, fragmentSignatures, variableValues, fragmentVariableValues, hideSuggestions) { + const argumentNodes = fragmentSpreadNode.arguments ?? []; + const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg])); + const sources = Object.create(null); + const coerced = Object.create(null); + for (const [varName, varSignature] of Object.entries(fragmentSignatures)) { + const argumentNode = argNodeMap.get(varName); + if (argumentNode !== undefined) { + sources[varName] = + fragmentVariableValues == null + ? { signature: varSignature, value: argumentNode.value } + : { + signature: varSignature, + value: argumentNode.value, + fragmentVariableValues, + }; + } + else { + sources[varName] = { + signature: varSignature, + }; + } + coerceArgument(coerced, fragmentSpreadNode, varName, varSignature, argumentNode, variableValues, fragmentVariableValues, hideSuggestions); + } + return { sources, coerced }; +} +export function getArgumentValues(def, node, variableValues, fragmentVariableValues, hideSuggestions) { + const coercedValues = Object.create(null); + const argumentNodes = node.arguments ?? []; + const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg])); + for (const argDef of def.args) { + const name = argDef.name; + coerceArgument(coercedValues, node, name, argDef, argNodeMap.get(argDef.name), variableValues, fragmentVariableValues, hideSuggestions); + } + return coercedValues; +} +function coerceArgument(coercedValues, node, argName, argDef, argumentNode, variableValues, fragmentVariableValues, hideSuggestions) { + const argType = argDef.type; + const onArgDefaultValueError = (error, path) => { + throw new GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${printPathArray(path)}: ${error.message}`, { nodes: node }); + }; + if (!argumentNode) { + if (isRequiredArgument(argDef)) { + throw new GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} of required type "${argType}" was not provided.`, { nodes: node }); + } + maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions); + return; + } + const valueNode = argumentNode.value; + if (valueNode.kind === Kind.VARIABLE) { + const variableName = valueNode.name.value; + const scopedVariableValues = fragmentVariableValues?.sources[variableName] + ? fragmentVariableValues + : variableValues; + if ((scopedVariableValues == null || + !Object.hasOwn(scopedVariableValues.coerced, variableName)) && + !isRequiredArgument(argDef)) { + maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions); + return; + } + } + const coercedValue = coerceInputLiteral(valueNode, argType, variableValues, fragmentVariableValues); + if (coercedValue === undefined) { + validateInputLiteral(valueNode, argType, (error, path) => { + error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${printPathArray(path)}: ${error.message}`; + throw error; + }, variableValues, fragmentVariableValues, hideSuggestions); + invariant(false, 'Invalid argument'); + } + coercedValues[argName] = coercedValue; +} +function printArgumentOrFragmentVariable(argDef, node) { + return isArgument(argDef) + ? `Argument "${argDef}"` + : `Variable "$${argDef.name}" defined by fragment "${node.name.value}"`; +} +export function getDirectiveValues(directiveDef, node, variableValues, fragmentVariableValues, hideSuggestions) { + const directiveNode = node.directives?.find((directive) => directive.name.value === directiveDef.name); + if (directiveNode) { + return getArgumentValues(directiveDef, directiveNode, variableValues, fragmentVariableValues, hideSuggestions); + } +} +//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs.map new file mode 100644 index 00000000..678d62f0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/execution/values.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAGpD,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,wCAAuC;AACpE,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAUxD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAG5C,OAAO,EACL,UAAU,EACV,aAAa,EACb,kBAAkB,GACnB,+BAA8B;AAG/B,OAAO,EAAE,oBAAoB,EAAE,6BAA4B;AAE3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,0CAAyC;AAC1C,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,4CAA2C;AAO5C,OAAO,EAAE,oBAAoB,EAAE,mCAAkC;AA2GjE,MAAM,UAAU,iBAAiB,CAC/B,MAAqB,EACrB,WAAkD,EAClD,MAAgD,EAChD,OAA2D;IAE3D,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,oBAAoB,CACzC,MAAM,EACN,WAAW,EACX,MAAM,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DD,MAAM,UAAU,kBAAkB,CAChC,YAA8B,EAC9B,IAAwE,EACxE,cAAsC,EACtC,sBAAsD,EACtD,eAAgC;IAEhC,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CACzC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,IAAI,CAC1D,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,iBAAiB,CACtB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,eAAe,CAChB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap, ReadOnlyObjMap } from '../jsutils/ObjMap.ts';\nimport { printPathArray } from '../jsutils/printPathArray.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ArgumentNode,\n DirectiveNode,\n FieldNode,\n FragmentArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLArgument, GraphQLField } from '../type/definition.ts';\nimport {\n isArgument,\n isNonNullType,\n isRequiredArgument,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\nimport { validateDefaultInput } from '../type/validate.ts';\n\nimport {\n coerceDefaultValue,\n coerceInputLiteral,\n coerceInputValue,\n} from '../utilities/coerceInputValue.ts';\nimport {\n validateInputLiteral,\n validateInputValue,\n} from '../utilities/validateInputValue.ts';\n\nimport type {\n FragmentVariableValues,\n FragmentVariableValueSource,\n} from './collectFields.ts';\nimport type { GraphQLVariableSignature } from './getVariableSignature.ts';\nimport { getVariableSignature } from './getVariableSignature.ts';\n\n/**\n * Coerced variable values prepared for execution.\n *\n * The `coerced` map contains runtime values keyed by variable name. The\n * `sources` map records whether each value came from request input, an operation\n * default, or a fragment-variable default so utilities can preserve defaults\n * when replacing variables in literals.\n */\nexport interface VariableValues {\n /** Source metadata for each variable value keyed by variable name. */\n readonly sources: ReadOnlyObjMap;\n /** Coerced runtime variable values keyed by variable name. */\n readonly coerced: ReadOnlyObjMap;\n}\n\ninterface VariableValueSource {\n readonly signature: GraphQLVariableSignature;\n readonly value?: unknown;\n}\n\ntype VariableValuesOrErrors =\n | { variableValues: VariableValues; errors?: never }\n | { errors: ReadonlyArray; variableValues?: never };\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, GraphQLError values are returned.\n *\n * Note: Returned maps use null prototypes to avoid collisions with\n * Object prototype properties.\n * @param schema - GraphQL schema to use.\n * @param varDefNodes - The variable definition AST nodes to coerce.\n * @param inputs - The runtime variable values keyed by variable name.\n * @param options - Optional configuration for this operation.\n * @param [options.maxErrors] - Maximum number of coercion errors to report.\n * @param [options.hideSuggestions] - Whether suggestion text should be omitted\n * from errors.\n * @returns Coerced variable values with source metadata, or request errors.\n * @example\n * ```ts\n * // Coerce provided variables and apply operation defaults.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!, limit: Int = 10): [String]\n * }\n * `);\n * const document = parse(`\n * query ($stars: Int!, $limit: Int = 10) {\n * reviews(stars: $stars, limit: $limit)\n * }\n * `);\n * const operation = document.definitions[0];\n *\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '5',\n * });\n *\n * assert('variableValues' in result);\n *\n * result.variableValues.coerced; // => { stars: 5, limit: 10 }\n * ```\n * @example\n * ```ts\n * // This variant uses maxErrors to cap reported coercion errors.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput!): String\n * }\n * `);\n * const document = parse(`\n * query ($first: ReviewInput!, $second: ReviewInput!) {\n * first: review(input: $first)\n * second: review(input: $second)\n * }\n * `);\n * const operation = document.definitions[0];\n *\n * const result = getVariableValues(\n * schema,\n * operation.variableDefinitions,\n * { first: { stars: 'bad' }, second: { stars: 'also bad' } },\n * { maxErrors: 1 },\n * );\n *\n * assert('errors' in result);\n *\n * result.errors.length; // => 2\n * result.errors[1].message; // matches /error limit reached/\n * ```\n */\nexport function getVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray,\n inputs: { readonly [variable: string]: unknown },\n options?: { maxErrors?: number; hideSuggestions?: boolean },\n): VariableValuesOrErrors {\n const errors: Array = [];\n const maxErrors = options?.maxErrors;\n try {\n const variableValues = coerceVariableValues(\n schema,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n 'Too many errors processing variables, error limit reached. Execution aborted.',\n );\n }\n errors.push(error);\n },\n options?.hideSuggestions,\n );\n\n if (errors.length === 0) {\n return { variableValues };\n }\n } catch (error) {\n errors.push(ensureGraphQLError(error));\n }\n\n return { errors };\n}\n\nfunction coerceVariableValues(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray,\n inputs: { readonly [variable: string]: unknown },\n onError: (error: GraphQLError) => void,\n hideSuggestions?: Maybe,\n): VariableValues {\n const sources: ObjMap = Object.create(null);\n const coerced: ObjMap = Object.create(null);\n for (const varDefNode of varDefNodes) {\n const varSignature = getVariableSignature(schema, varDefNode);\n\n if (varSignature instanceof GraphQLError) {\n onError(varSignature);\n continue;\n }\n\n const { name: varName, type: varType } = varSignature;\n const value = Object.hasOwn(inputs, varName) ? inputs[varName] : undefined;\n if (value === undefined) {\n sources[varName] = { signature: varSignature };\n if (varDefNode.defaultValue) {\n maybeUseDefaultValue(\n coerced,\n varName,\n varSignature,\n (error, path) => {\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" has invalid default value${printPathArray(path)}: ${error.message}`,\n { nodes: varDefNode },\n ),\n );\n },\n hideSuggestions,\n );\n continue;\n } else if (!isNonNullType(varType)) {\n // Non-provided values for nullable variables are omitted.\n continue;\n }\n } else {\n sources[varName] = { signature: varSignature, value };\n }\n\n const coercedValue = coerceInputValue(value, varType);\n if (coercedValue !== undefined) {\n coerced[varName] = coercedValue;\n } else {\n validateInputValue(\n value,\n varType,\n (error, path) => {\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" has invalid value${printPathArray(path)}: ${\n error.message\n }`,\n { nodes: varDefNode, originalError: error },\n ),\n );\n },\n hideSuggestions,\n );\n }\n }\n\n return { sources, coerced };\n}\n\nfunction maybeUseDefaultValue(\n coercedValues: ObjMap,\n name: string,\n inputValue: GraphQLArgument | GraphQLVariableSignature,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions?: Maybe,\n): void {\n try {\n // coerceDefaultValue assumes validation has already rejected invalid\n // defaults. If validation was skipped, invalid defaults or nested input\n // field defaults can throw here; recover with validation-style errors below.\n const coercedDefaultValue = coerceDefaultValue(inputValue);\n if (coercedDefaultValue !== undefined) {\n coercedValues[name] = coercedDefaultValue;\n }\n } catch (error) {\n const defaultInput = inputValue.default;\n // Defensive: coerceDefaultValue should only throw while coercing a default.\n /* node:coverage ignore next 3 */\n if (defaultInput === undefined) {\n throw error;\n }\n\n // Prefer validation's user-facing errors for invalid defaults.\n let reportedValidationError = false;\n validateDefaultInput(\n defaultInput,\n inputValue.type,\n (defaultError, path) => {\n reportedValidationError = true;\n onError(defaultError, path);\n },\n hideSuggestions,\n );\n\n if (!reportedValidationError) {\n // The default itself validated, so coercion failed while applying a nested\n // input field default. Surface the original coercion error.\n onError(ensureGraphQLError(error), []);\n }\n }\n}\n\n/** @internal */\nexport function getFragmentVariableValues(\n fragmentSpreadNode: FragmentSpreadNode,\n fragmentSignatures: ReadOnlyObjMap,\n variableValues: VariableValues,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): FragmentVariableValues {\n const argumentNodes = fragmentSpreadNode.arguments ?? [];\n const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));\n const sources: ObjMap = Object.create(null);\n const coerced: ObjMap = Object.create(null);\n for (const [varName, varSignature] of Object.entries(fragmentSignatures)) {\n const argumentNode = argNodeMap.get(varName);\n if (argumentNode !== undefined) {\n sources[varName] =\n fragmentVariableValues == null\n ? { signature: varSignature, value: argumentNode.value }\n : {\n signature: varSignature,\n value: argumentNode.value,\n fragmentVariableValues,\n };\n } else {\n sources[varName] = {\n signature: varSignature,\n };\n }\n\n coerceArgument(\n coerced,\n fragmentSpreadNode,\n varName,\n varSignature,\n argumentNode,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n\n return { sources, coerced };\n}\n\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: Returned value uses a null prototype to avoid collisions with\n * JavaScript's own property names.\n * @param def - Field or directive definition that declares the arguments.\n * @param node - Field or directive AST node supplying argument literals.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns A map of coerced argument values.\n * @example\n * ```ts\n * // Read literal argument values and defaults.\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getArgumentValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!, limit: Int = 10): [String]\n * }\n * `);\n * const fieldDef = schema.getQueryType().getFields().reviews;\n * const document = parse('{ reviews(stars: 5) }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n *\n * getArgumentValues(fieldDef, fieldNode); // => { stars: 5, limit: 10 }\n * ```\n * @example\n * ```ts\n * // This variant resolves argument values from operation variables.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { getArgumentValues, getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!): [String]\n * }\n * `);\n * const fieldDef = schema.getQueryType().getFields().reviews;\n * const document = parse('query ($stars: Int!) { reviews(stars: $stars) }');\n * const operation = document.definitions[0];\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const variables = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '5',\n * });\n *\n * assert('variableValues' in variables);\n *\n * getArgumentValues(fieldDef, fieldNode, variables.variableValues); // => { stars: 5 }\n * getArgumentValues(fieldDef, fieldNode); // throws an error\n * ```\n */\nexport function getArgumentValues(\n def: GraphQLField | GraphQLDirective,\n node: FieldNode | DirectiveNode,\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): ObjMap {\n const coercedValues: ObjMap = Object.create(null);\n\n const argumentNodes = node.arguments ?? [];\n const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));\n\n for (const argDef of def.args) {\n const name = argDef.name;\n coerceArgument(\n coercedValues,\n node,\n name,\n argDef,\n argNodeMap.get(argDef.name),\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n return coercedValues;\n}\n\n/** @internal */\n// eslint-disable-next-line max-params\nfunction coerceArgument(\n coercedValues: ObjMap,\n node: FieldNode | DirectiveNode | FragmentSpreadNode,\n argName: string,\n argDef: GraphQLArgument | GraphQLVariableSignature,\n argumentNode: ArgumentNode | FragmentArgumentNode | undefined,\n variableValues: Maybe,\n fragmentVariableValues: Maybe,\n hideSuggestions?: Maybe,\n): void {\n const argType = argDef.type;\n const onArgDefaultValueError = (\n error: GraphQLError,\n path: ReadonlyArray,\n ): never => {\n throw new GraphQLError(\n `${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${printPathArray(path)}: ${error.message}`,\n { nodes: node },\n );\n };\n\n if (!argumentNode) {\n if (isRequiredArgument(argDef)) {\n // Note: ProvidedRequiredArgumentsRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n `${printArgumentOrFragmentVariable(argDef, node)} of required type \"${argType}\" was not provided.`,\n { nodes: node },\n );\n }\n maybeUseDefaultValue(\n coercedValues,\n argName,\n argDef,\n onArgDefaultValueError,\n hideSuggestions,\n );\n return;\n }\n\n const valueNode = argumentNode.value;\n\n // Variables without a value are treated as if no argument was provided if\n // the argument is not required.\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n const scopedVariableValues = fragmentVariableValues?.sources[variableName]\n ? fragmentVariableValues\n : variableValues;\n if (\n (scopedVariableValues == null ||\n !Object.hasOwn(scopedVariableValues.coerced, variableName)) &&\n !isRequiredArgument(argDef)\n ) {\n maybeUseDefaultValue(\n coercedValues,\n argName,\n argDef,\n onArgDefaultValueError,\n hideSuggestions,\n );\n return;\n }\n }\n const coercedValue = coerceInputLiteral(\n valueNode,\n argType,\n variableValues,\n fragmentVariableValues,\n );\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n validateInputLiteral(\n valueNode,\n argType,\n (error, path) => {\n // TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\n error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${printPathArray(\n path,\n )}: ${error.message}`;\n throw error;\n },\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n /* node:coverage ignore next */\n invariant(false, 'Invalid argument');\n }\n coercedValues[argName] = coercedValue;\n}\n\n// TODO: clean up the naming of isRequiredArgument(), isArgument(), and argDef if/when experimental fragment variables are merged\nfunction printArgumentOrFragmentVariable(\n argDef: GraphQLArgument | GraphQLVariableSignature,\n node: FieldNode | DirectiveNode | FragmentSpreadNode,\n): string {\n return isArgument(argDef)\n ? `Argument \"${argDef}\"`\n : `Variable \"$${argDef.name}\" defined by fragment \"${node.name.value}\"`;\n}\n\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: Returned value uses a null prototype to avoid collisions with\n * JavaScript's own property names.\n * @param directiveDef - Directive definition to read argument definitions from.\n * @param node - AST node that may contain directives.\n * @param node.directives - The directives on the AST node.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns A map of coerced directive argument values, or undefined when absent.\n * @example\n * ```ts\n * // Read literal directive arguments from a node.\n * import { parse } from 'graphql/language';\n * import { GraphQLSkipDirective } from 'graphql/type';\n * import { getDirectiveValues } from 'graphql/execution';\n *\n * const document = parse('{ name @skip(if: true) }');\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n *\n * getDirectiveValues(GraphQLSkipDirective, fieldNode); // => { if: true }\n * ```\n * @example\n * ```ts\n * // This variant resolves directive arguments from variables and handles absent directives.\n * import assert from 'node:assert';\n * import { parse } from 'graphql/language';\n * import { GraphQLIncludeDirective } from 'graphql/type';\n * import { buildSchema } from 'graphql/utilities';\n * import { getDirectiveValues, getVariableValues } from 'graphql/execution';\n *\n * const schema = buildSchema('type Query { name: String }');\n * const document = parse(\n * 'query ($includeName: Boolean!) { name @include(if: $includeName) }',\n * );\n * const operation = document.definitions[0];\n * const fieldNode = document.definitions[0].selectionSet.selections[0];\n * const variables = getVariableValues(schema, operation.variableDefinitions, {\n * includeName: false,\n * });\n *\n * assert('variableValues' in variables);\n *\n * getDirectiveValues(\n * GraphQLIncludeDirective,\n * fieldNode,\n * variables.variableValues,\n * ); // => { if: false }\n * getDirectiveValues(GraphQLIncludeDirective, { directives: [] }); // => undefined\n * ```\n */\nexport function getDirectiveValues(\n directiveDef: GraphQLDirective,\n node: { readonly directives?: ReadonlyArray | undefined },\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): undefined | ObjMap {\n const directiveNode = node.directives?.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return getArgumentValues(\n directiveDef,\n directiveNode,\n variableValues,\n fragmentVariableValues,\n hideSuggestions,\n );\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.mts new file mode 100644 index 00000000..480f4a03 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.mts @@ -0,0 +1,15 @@ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.mjs"; +/** + * Given an AsyncGenerator and provided functions, return an AsyncGenerator + * which calls the given functions when the generator is abruptly closed, + * calling the functions immediately even if the generator is paused. + * + * This is useful for allowing return and throw to trigger logic even if the + * generator is paused on a pending await within a `next()` call (including + * if that logic can cause that hanging `next()` call to return early). + * + * Errors from the provided functions are ignored. + * + * @internal + */ +export declare function withConcurrentAbruptClose(generator: AsyncGenerator, beforeReturn: () => PromiseOrValue, beforeThrow?: (error?: unknown) => PromiseOrValue): AsyncGenerator; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.ts new file mode 100644 index 00000000..ba6b7f60 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.d.ts @@ -0,0 +1,15 @@ +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.js"; +/** + * Given an AsyncGenerator and provided functions, return an AsyncGenerator + * which calls the given functions when the generator is abruptly closed, + * calling the functions immediately even if the generator is paused. + * + * This is useful for allowing return and throw to trigger logic even if the + * generator is paused on a pending await within a `next()` call (including + * if that logic can cause that hanging `next()` call to return early). + * + * Errors from the provided functions are ignored. + * + * @internal + */ +export declare function withConcurrentAbruptClose(generator: AsyncGenerator, beforeReturn: () => PromiseOrValue, beforeThrow?: (error?: unknown) => PromiseOrValue): AsyncGenerator; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js new file mode 100644 index 00000000..66cf80c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withConcurrentAbruptClose = withConcurrentAbruptClose; +const isPromise_ts_1 = require("../jsutils/isPromise.js"); +const asyncDispose = Symbol.asyncDispose ?? Symbol.for('Symbol.asyncDispose'); +function withConcurrentAbruptClose(generator, beforeReturn, beforeThrow = beforeReturn) { + let completed = false; + let abruptCloseRequested = false; + const runAbruptCloseFn = (fn) => { + if (completed || abruptCloseRequested) { + return; + } + abruptCloseRequested = true; + return ignoreErrors(fn); + }; + return { + [Symbol.asyncIterator]() { + return this; + }, + next() { + const result = generator.next(); + result + .then((iteration) => { + if (iteration.done) { + completed = true; + } + }) + .catch(() => undefined); + return result; + }, + async return() { + await runAbruptCloseFn(beforeReturn); + return generator.return(); + }, + async throw(error) { + await runAbruptCloseFn(() => beforeThrow(error)); + return generator.throw(error); + }, + async [asyncDispose]() { + await runAbruptCloseFn(beforeReturn); + if (typeof generator[asyncDispose] === 'function') { + await generator[asyncDispose](); + } + }, + }; +} +function ignoreErrors(fn) { + try { + const result = fn(); + if ((0, isPromise_ts_1.isPromise)(result)) { + return result.catch(() => { + }); + } + } + catch { + } +} +//# sourceMappingURL=withConcurrentAbruptClose.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js.map new file mode 100644 index 00000000..114c7cbd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.js.map @@ -0,0 +1 @@ +{"version":3,"file":"withConcurrentAbruptClose.js","sourceRoot":"","sources":["../../src/execution/withConcurrentAbruptClose.ts"],"names":[],"mappings":";;AAoBA,8DA8CC;AAlED,0DAAoD;AAIpD,MAAM,YAAY,GAChB,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAe3D,SAAgB,yBAAyB,CACvC,SAAwC,EACxC,YAAwC,EACxC,cAAyD,YAAY;IAErE,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,oBAAoB,GAAG,KAAK,CAAC;IAEjC,MAAM,gBAAgB,GAAG,CAAC,EAA8B,EAAE,EAAE;QAC1D,IAAI,SAAS,IAAI,oBAAoB,EAAE,CAAC;YACtC,OAAO;QACT,CAAC;QACD,oBAAoB,GAAG,IAAI,CAAC;QAC5B,OAAO,YAAY,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO;QACL,CAAC,MAAM,CAAC,aAAa,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI;YACF,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;YAChC,MAAM;iBACH,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;gBAClB,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;oBACnB,SAAS,GAAG,IAAI,CAAC;gBACnB,CAAC;YACH,CAAC,CAAC;iBACD,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,KAAK,CAAC,MAAM;YACV,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC;YACrC,OAAO,SAAS,CAAC,MAAM,EAAE,CAAC;QAC5B,CAAC;QACD,KAAK,CAAC,KAAK,CAAC,KAAe;YACzB,MAAM,gBAAgB,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;YACjD,OAAO,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,CAAC,YAAY,CAAC;YAClB,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC;YACrC,IAAI,OAAO,SAAS,CAAC,YAAY,CAAC,KAAK,UAAU,EAAE,CAAC;gBAClD,MAAM,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YAClC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CACnB,EAAiC;IAEjC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,EAAE,EAAE,CAAC;QACpB,IAAI,IAAA,wBAAS,EAAC,MAAM,CAAC,EAAE,CAAC;YACtB,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YAEzB,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC","sourcesContent":["import { isPromise } from '../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\n/* node:coverage ignore next 2 */\nconst asyncDispose: typeof Symbol.asyncDispose =\n Symbol.asyncDispose ?? Symbol.for('Symbol.asyncDispose');\n\n/**\n * Given an AsyncGenerator and provided functions, return an AsyncGenerator\n * which calls the given functions when the generator is abruptly closed,\n * calling the functions immediately even if the generator is paused.\n *\n * This is useful for allowing return and throw to trigger logic even if the\n * generator is paused on a pending await within a `next()` call (including\n * if that logic can cause that hanging `next()` call to return early).\n *\n * Errors from the provided functions are ignored.\n *\n * @internal\n */\nexport function withConcurrentAbruptClose(\n generator: AsyncGenerator,\n beforeReturn: () => PromiseOrValue,\n beforeThrow: (error?: unknown) => PromiseOrValue = beforeReturn,\n): AsyncGenerator {\n let completed = false;\n let abruptCloseRequested = false;\n\n const runAbruptCloseFn = (fn: () => PromiseOrValue) => {\n if (completed || abruptCloseRequested) {\n return;\n }\n abruptCloseRequested = true;\n return ignoreErrors(fn);\n };\n\n return {\n [Symbol.asyncIterator]() {\n return this;\n },\n next() {\n const result = generator.next();\n result\n .then((iteration) => {\n if (iteration.done) {\n completed = true;\n }\n })\n .catch(() => undefined);\n return result;\n },\n async return() {\n await runAbruptCloseFn(beforeReturn);\n return generator.return();\n },\n async throw(error?: unknown) {\n await runAbruptCloseFn(() => beforeThrow(error));\n return generator.throw(error);\n },\n async [asyncDispose]() {\n await runAbruptCloseFn(beforeReturn);\n if (typeof generator[asyncDispose] === 'function') {\n await generator[asyncDispose]();\n }\n },\n };\n}\n\nfunction ignoreErrors(\n fn: () => PromiseOrValue,\n): PromiseOrValue {\n try {\n const result = fn();\n if (isPromise(result)) {\n return result.catch(() => {\n // ignore error\n });\n }\n } catch {\n // ignore error\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs new file mode 100644 index 00000000..4df3bf6a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs @@ -0,0 +1,55 @@ +import { isPromise } from "../jsutils/isPromise.mjs"; +const asyncDispose = Symbol.asyncDispose ?? Symbol.for('Symbol.asyncDispose'); +export function withConcurrentAbruptClose(generator, beforeReturn, beforeThrow = beforeReturn) { + let completed = false; + let abruptCloseRequested = false; + const runAbruptCloseFn = (fn) => { + if (completed || abruptCloseRequested) { + return; + } + abruptCloseRequested = true; + return ignoreErrors(fn); + }; + return { + [Symbol.asyncIterator]() { + return this; + }, + next() { + const result = generator.next(); + result + .then((iteration) => { + if (iteration.done) { + completed = true; + } + }) + .catch(() => undefined); + return result; + }, + async return() { + await runAbruptCloseFn(beforeReturn); + return generator.return(); + }, + async throw(error) { + await runAbruptCloseFn(() => beforeThrow(error)); + return generator.throw(error); + }, + async [asyncDispose]() { + await runAbruptCloseFn(beforeReturn); + if (typeof generator[asyncDispose] === 'function') { + await generator[asyncDispose](); + } + }, + }; +} +function ignoreErrors(fn) { + try { + const result = fn(); + if (isPromise(result)) { + return result.catch(() => { + }); + } + } + catch { + } +} +//# sourceMappingURL=withConcurrentAbruptClose.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs.map new file mode 100644 index 00000000..9c513db7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/execution/withConcurrentAbruptClose.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"withConcurrentAbruptClose.js","sourceRoot":"","sources":["../../src/execution/withConcurrentAbruptClose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAIpD,MAAM,YAAY,GAChB,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAe3D,MAAM,UAAU,yBAAyB,CACvC,SAAwC,EACxC,YAAwC,EACxC,cAAyD,YAAY;IAErE,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,oBAAoB,GAAG,KAAK,CAAC;IAEjC,MAAM,gBAAgB,GAAG,CAAC,EAA8B,EAAE,EAAE;QAC1D,IAAI,SAAS,IAAI,oBAAoB,EAAE,CAAC;YACtC,OAAO;QACT,CAAC;QACD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AC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;AACH,CAAC","sourcesContent":["import { isPromise } from '../jsutils/isPromise.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\n\n/* node:coverage ignore next 2 */\nconst asyncDispose: typeof Symbol.asyncDispose =\n Symbol.asyncDispose ?? Symbol.for('Symbol.asyncDispose');\n\n/**\n * Given an AsyncGenerator and provided functions, return an AsyncGenerator\n * which calls the given functions when the generator is abruptly closed,\n * calling the functions immediately even if the generator is paused.\n *\n * This is useful for allowing return and throw to trigger logic even if the\n * generator is paused on a pending await within a `next()` call (including\n * if that logic can cause that hanging `next()` call to return early).\n *\n * Errors from the provided functions are ignored.\n *\n * @internal\n */\nexport function withConcurrentAbruptClose(\n generator: AsyncGenerator,\n beforeReturn: () => PromiseOrValue,\n beforeThrow: (error?: unknown) => PromiseOrValue = beforeReturn,\n): AsyncGenerator {\n let completed = false;\n let abruptCloseRequested = false;\n\n const runAbruptCloseFn = (fn: () => PromiseOrValue) => {\n if (completed || abruptCloseRequested) {\n return;\n }\n abruptCloseRequested = true;\n return ignoreErrors(fn);\n };\n\n return {\n [Symbol.asyncIterator]() {\n return this;\n },\n next() {\n const result = generator.next();\n result\n .then((iteration) => {\n if (iteration.done) {\n completed = true;\n }\n })\n .catch(() => undefined);\n return result;\n },\n async return() {\n await runAbruptCloseFn(beforeReturn);\n return generator.return();\n },\n async throw(error?: unknown) {\n await runAbruptCloseFn(() => beforeThrow(error));\n return generator.throw(error);\n },\n async [asyncDispose]() {\n await runAbruptCloseFn(beforeReturn);\n if (typeof generator[asyncDispose] === 'function') {\n await generator[asyncDispose]();\n }\n },\n };\n}\n\nfunction ignoreErrors(\n fn: () => PromiseOrValue,\n): PromiseOrValue {\n try {\n const result = fn();\n if (isPromise(result)) {\n return result.catch(() => {\n // ignore error\n });\n }\n } catch {\n // ignore error\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.mts new file mode 100644 index 00000000..f5e75abf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.mts @@ -0,0 +1,209 @@ +/** @category Request Pipeline */ +import type { ParseOptions } from "./language/parser.mjs"; +import type { Source } from "./language/source.mjs"; +import type { ValidationOptions } from "./validation/validate.mjs"; +import type { ValidationRule } from "./validation/ValidationContext.mjs"; +import type { ExecutionArgs } from "./execution/ExecutionArgs.mjs"; +import type { ExecutionResult } from "./execution/Executor.mjs"; +import type { GraphQLHarness } from "./harness.mjs"; +/** + * Describes the input object accepted by `graphql` and `graphqlSync`. + * + * These arguments describe the full parse, validate, and execute lifecycle for + * a GraphQL request. They include parser options, validation options, execution + * options, and an optional harness for replacing pipeline stages. + * + * `graphql` and `graphqlSync` do not support incremental delivery (`@defer` and + * `@stream`); use `experimentalExecuteIncrementally` after parsing and + * validating when incremental delivery is required. + */ +export interface GraphQLArgs extends ParseOptions, ValidationOptions, Omit { + /** + * Custom parse, validate, execute, and subscribe functions for this request + * pipeline. + */ + harness?: GraphQLHarness | undefined; + /** + * A GraphQL language-formatted string or source object representing the + * requested operation. + */ + source: string | Source; + /** Validation rules to use instead of the specified rules. */ + rules?: ReadonlyArray | undefined; +} +/** + * Parses, validates, and executes a GraphQL document against a schema. + * + * This is the primary entry point for fulfilling GraphQL operations. Use this + * when you want a single-call request lifecycle that returns a promise in all + * cases. + * + * More sophisticated GraphQL servers, such as those which persist queries, may + * wish to separate the validation and execution phases to a static-time tooling + * step and a server runtime step. + * @param args - Request execution arguments, including schema and source. + * @returns A promise that resolves to an execution result or validation errors. + * @example + * ```ts + * // Execute a complete asynchronous request with variables. + * import { graphql, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String!): String + * } + * `); + * + * const result = await graphql({ + * schema, + * source: 'query SayHello($name: String!) { greeting(name: $name) }', + * rootValue: { + * greeting: ({ name }) => `Hello, ${name}!`, + * }, + * variableValues: { name: 'Ada' }, + * operationName: 'SayHello', + * }); + * + * result; // => { data: { greeting: 'Hello, Ada!' } } + * ``` + * @example + * ```ts + * // This variant supplies context plus custom field and type resolvers. + * import { graphql, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * interface Named { + * name: String! + * } + * + * type User implements Named { + * name: String! + * } + * + * type Query { + * viewer: Named + * } + * `); + * + * const result = await graphql({ + * schema, + * source: '{ viewer { __typename name } }', + * rootValue: { viewer: { kind: 'user', name: 'Ada' } }, + * contextValue: { locale: 'en' }, + * fieldResolver: (source, _args, context, info) => { + * context.locale; // => 'en' + * return source[info.fieldName]; + * }, + * typeResolver: (value) => { + * return value.kind === 'user' ? 'User' : undefined; + * }, + * }); + * + * result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } } + * ``` + * @example + * ```ts + * // This variant customizes the request pipeline with a harness. + * import { buildSchema, defaultHarness, graphql } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const stages = []; + * const abortController = new AbortController(); + * const harness = { + * parse: (...args) => { + * stages.push('parse'); + * return defaultHarness.parse(...args); + * }, + * validate: (...args) => { + * stages.push('validate'); + * return defaultHarness.validate(...args); + * }, + * execute: (...args) => { + * stages.push('execute'); + * return defaultHarness.execute(...args); + * }, + * subscribe: (...args) => { + * stages.push('subscribe'); + * return defaultHarness.subscribe(...args); + * }, + * }; + * + * const result = await graphql({ + * schema, + * source: '{ greeting }', + * rootValue: { greeting: 'Hello' }, + * rules: [], + * maxErrors: 25, + * hideSuggestions: true, + * noLocation: true, + * abortSignal: abortController.signal, + * harness, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * stages; // => ['parse', 'validate', 'execute'] + * ``` + * @category Request Pipeline + */ +export declare function graphql(args: GraphQLArgs): Promise; +/** + * Parses, validates, and executes a GraphQL document synchronously. + * + * This function guarantees that execution completes synchronously, or throws an + * error, assuming that all field resolvers are also synchronous. It throws when + * any resolver returns a promise. + * @param args - Request execution arguments, including schema and source. + * @returns Completed execution output, or request errors if parsing or + * validation fails. + * @example + * ```ts + * // Execute a complete synchronous request with variables. + * import { graphqlSync, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String!): String + * } + * `); + * + * const result = graphqlSync({ + * schema, + * source: 'query SayHello($name: String!) { greeting(name: $name) }', + * rootValue: { + * greeting: ({ name }) => `Hello, ${name}!`, + * }, + * variableValues: { name: 'Ada' }, + * operationName: 'SayHello', + * }); + * + * result; // => { data: { greeting: 'Hello, Ada!' } } + * ``` + * @example + * ```ts + * // This variant uses a synchronous custom field resolver and context. + * import { graphqlSync, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const result = graphqlSync({ + * schema, + * source: '{ greeting }', + * fieldResolver: (_source, _args, contextValue) => { + * return contextValue.defaultGreeting; + * }, + * contextValue: { defaultGreeting: 'Hello' }, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * ``` + * @category Request Pipeline + */ +export declare function graphqlSync(args: GraphQLArgs): ExecutionResult; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.ts new file mode 100644 index 00000000..cd94a4a7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.d.ts @@ -0,0 +1,209 @@ +/** @category Request Pipeline */ +import type { ParseOptions } from "./language/parser.js"; +import type { Source } from "./language/source.js"; +import type { ValidationOptions } from "./validation/validate.js"; +import type { ValidationRule } from "./validation/ValidationContext.js"; +import type { ExecutionArgs } from "./execution/ExecutionArgs.js"; +import type { ExecutionResult } from "./execution/Executor.js"; +import type { GraphQLHarness } from "./harness.js"; +/** + * Describes the input object accepted by `graphql` and `graphqlSync`. + * + * These arguments describe the full parse, validate, and execute lifecycle for + * a GraphQL request. They include parser options, validation options, execution + * options, and an optional harness for replacing pipeline stages. + * + * `graphql` and `graphqlSync` do not support incremental delivery (`@defer` and + * `@stream`); use `experimentalExecuteIncrementally` after parsing and + * validating when incremental delivery is required. + */ +export interface GraphQLArgs extends ParseOptions, ValidationOptions, Omit { + /** + * Custom parse, validate, execute, and subscribe functions for this request + * pipeline. + */ + harness?: GraphQLHarness | undefined; + /** + * A GraphQL language-formatted string or source object representing the + * requested operation. + */ + source: string | Source; + /** Validation rules to use instead of the specified rules. */ + rules?: ReadonlyArray | undefined; +} +/** + * Parses, validates, and executes a GraphQL document against a schema. + * + * This is the primary entry point for fulfilling GraphQL operations. Use this + * when you want a single-call request lifecycle that returns a promise in all + * cases. + * + * More sophisticated GraphQL servers, such as those which persist queries, may + * wish to separate the validation and execution phases to a static-time tooling + * step and a server runtime step. + * @param args - Request execution arguments, including schema and source. + * @returns A promise that resolves to an execution result or validation errors. + * @example + * ```ts + * // Execute a complete asynchronous request with variables. + * import { graphql, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String!): String + * } + * `); + * + * const result = await graphql({ + * schema, + * source: 'query SayHello($name: String!) { greeting(name: $name) }', + * rootValue: { + * greeting: ({ name }) => `Hello, ${name}!`, + * }, + * variableValues: { name: 'Ada' }, + * operationName: 'SayHello', + * }); + * + * result; // => { data: { greeting: 'Hello, Ada!' } } + * ``` + * @example + * ```ts + * // This variant supplies context plus custom field and type resolvers. + * import { graphql, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * interface Named { + * name: String! + * } + * + * type User implements Named { + * name: String! + * } + * + * type Query { + * viewer: Named + * } + * `); + * + * const result = await graphql({ + * schema, + * source: '{ viewer { __typename name } }', + * rootValue: { viewer: { kind: 'user', name: 'Ada' } }, + * contextValue: { locale: 'en' }, + * fieldResolver: (source, _args, context, info) => { + * context.locale; // => 'en' + * return source[info.fieldName]; + * }, + * typeResolver: (value) => { + * return value.kind === 'user' ? 'User' : undefined; + * }, + * }); + * + * result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } } + * ``` + * @example + * ```ts + * // This variant customizes the request pipeline with a harness. + * import { buildSchema, defaultHarness, graphql } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const stages = []; + * const abortController = new AbortController(); + * const harness = { + * parse: (...args) => { + * stages.push('parse'); + * return defaultHarness.parse(...args); + * }, + * validate: (...args) => { + * stages.push('validate'); + * return defaultHarness.validate(...args); + * }, + * execute: (...args) => { + * stages.push('execute'); + * return defaultHarness.execute(...args); + * }, + * subscribe: (...args) => { + * stages.push('subscribe'); + * return defaultHarness.subscribe(...args); + * }, + * }; + * + * const result = await graphql({ + * schema, + * source: '{ greeting }', + * rootValue: { greeting: 'Hello' }, + * rules: [], + * maxErrors: 25, + * hideSuggestions: true, + * noLocation: true, + * abortSignal: abortController.signal, + * harness, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * stages; // => ['parse', 'validate', 'execute'] + * ``` + * @category Request Pipeline + */ +export declare function graphql(args: GraphQLArgs): Promise; +/** + * Parses, validates, and executes a GraphQL document synchronously. + * + * This function guarantees that execution completes synchronously, or throws an + * error, assuming that all field resolvers are also synchronous. It throws when + * any resolver returns a promise. + * @param args - Request execution arguments, including schema and source. + * @returns Completed execution output, or request errors if parsing or + * validation fails. + * @example + * ```ts + * // Execute a complete synchronous request with variables. + * import { graphqlSync, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String!): String + * } + * `); + * + * const result = graphqlSync({ + * schema, + * source: 'query SayHello($name: String!) { greeting(name: $name) }', + * rootValue: { + * greeting: ({ name }) => `Hello, ${name}!`, + * }, + * variableValues: { name: 'Ada' }, + * operationName: 'SayHello', + * }); + * + * result; // => { data: { greeting: 'Hello, Ada!' } } + * ``` + * @example + * ```ts + * // This variant uses a synchronous custom field resolver and context. + * import { graphqlSync, buildSchema } from 'graphql'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const result = graphqlSync({ + * schema, + * source: '{ greeting }', + * fieldResolver: (_source, _args, contextValue) => { + * return contextValue.defaultGreeting; + * }, + * contextValue: { defaultGreeting: 'Hello' }, + * }); + * + * result; // => { data: { greeting: 'Hello' } } + * ``` + * @category Request Pipeline + */ +export declare function graphqlSync(args: GraphQLArgs): ExecutionResult; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js new file mode 100644 index 00000000..f1190086 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.graphql = graphql; +exports.graphqlSync = graphqlSync; +const isPromise_ts_1 = require("./jsutils/isPromise.js"); +const ensureGraphQLError_ts_1 = require("./error/ensureGraphQLError.js"); +const validate_ts_1 = require("./type/validate.js"); +const harness_ts_1 = require("./harness.js"); +function graphql(args) { + return new Promise((resolve) => resolve(graphqlImpl(args))); +} +function graphqlSync(args) { + const result = graphqlImpl(args); + if ((0, isPromise_ts_1.isPromise)(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + return result; +} +function graphqlImpl(args) { + const harness = args.harness ?? harness_ts_1.defaultHarness; + const { schema, source } = args; + const schemaValidationErrors = (0, validate_ts_1.validateSchema)(schema); + if (schemaValidationErrors.length > 0) { + return { errors: schemaValidationErrors }; + } + let document; + try { + document = harness.parse(source, args); + } + catch (syntaxError) { + return { errors: [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(syntaxError)] }; + } + if ((0, isPromise_ts_1.isPromise)(document)) { + return document.then((resolvedDocument) => validateAndExecute(harness, args, schema, resolvedDocument), (syntaxError) => ({ errors: [(0, ensureGraphQLError_ts_1.ensureGraphQLError)(syntaxError)] })); + } + return validateAndExecute(harness, args, schema, document); +} +function validateAndExecute(harness, args, schema, document) { + const validationResult = harness.validate(schema, document, args.rules, args); + if ((0, isPromise_ts_1.isPromise)(validationResult)) { + return validationResult.then((resolvedValidationResult) => checkValidationAndExecute(harness, args, resolvedValidationResult, document)); + } + return checkValidationAndExecute(harness, args, validationResult, document); +} +function checkValidationAndExecute(harness, args, validationResult, document) { + if (validationResult.length > 0) { + return { errors: validationResult }; + } + return harness.execute({ ...args, document }); +} +//# sourceMappingURL=graphql.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js.map new file mode 100644 index 00000000..86c4a5fc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":";;AAyKA,0BAGC;AA0DD,kCASC;AA7OD,yDAAmD;AAGnD,yEAAmE;AAQnE,oDAAoD;AASpD,6CAA8C;AAmJ9C,SAAgB,OAAO,CAAC,IAAiB;IAEvC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AA0DD,SAAgB,WAAW,CAAC,IAAiB;IAC3C,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAGjC,IAAI,IAAA,wBAAS,EAAC,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,IAAiB;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,2BAAc,CAAC;IAC/C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAGhC,MAAM,sBAAsB,GAAG,IAAA,4BAAc,EAAC,MAAM,CAAC,CA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yB,CAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,yBAAyB,CAChC,OAAuB,EACvB,IAAiB,EACjB,gBAA6C,EAC7C,QAAsB;IAEtB,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IACtC,CAAC;IAGD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAChD,CAAC","sourcesContent":["/** @category Request Pipeline */\n\nimport { isPromise } from './jsutils/isPromise.ts';\nimport type { PromiseOrValue } from './jsutils/PromiseOrValue.ts';\n\nimport { ensureGraphQLError } from './error/ensureGraphQLError.ts';\nimport type { GraphQLError } from './error/GraphQLError.ts';\n\nimport type { DocumentNode } from './language/ast.ts';\nimport type { ParseOptions } from './language/parser.ts';\nimport type { Source } from './language/source.ts';\n\nimport type { GraphQLSchema } from './type/schema.ts';\nimport { validateSchema } from './type/validate.ts';\n\nimport type { ValidationOptions } from './validation/validate.ts';\nimport type { ValidationRule } from './validation/ValidationContext.ts';\n\nimport type { ExecutionArgs } from './execution/ExecutionArgs.ts';\nimport type { ExecutionResult } from './execution/Executor.ts';\n\nimport type { GraphQLHarness } from './harness.ts';\nimport { defaultHarness } from './harness.ts';\n\n/**\n * Describes the input object accepted by `graphql` and `graphqlSync`.\n *\n * These arguments describe the full parse, validate, and execute lifecycle for\n * a GraphQL request. They include parser options, validation options, execution\n * options, and an optional harness for replacing pipeline stages.\n *\n * `graphql` and `graphqlSync` do not support incremental delivery (`@defer` and\n * `@stream`); use `experimentalExecuteIncrementally` after parsing and\n * validating when incremental delivery is required.\n */\nexport interface GraphQLArgs\n extends ParseOptions, ValidationOptions, Omit {\n /**\n * Custom parse, validate, execute, and subscribe functions for this request\n * pipeline.\n */\n harness?: GraphQLHarness | undefined;\n /**\n * A GraphQL language-formatted string or source object representing the\n * requested operation.\n */\n source: string | Source;\n /** Validation rules to use instead of the specified rules. */\n rules?: ReadonlyArray | undefined;\n}\n\n/**\n * Parses, validates, and executes a GraphQL document against a schema.\n *\n * This is the primary entry point for fulfilling GraphQL operations. Use this\n * when you want a single-call request lifecycle that returns a promise in all\n * cases.\n *\n * More sophisticated GraphQL servers, such as those which persist queries, may\n * wish to separate the validation and execution phases to a static-time tooling\n * step and a server runtime step.\n * @param args - Request execution arguments, including schema and source.\n * @returns A promise that resolves to an execution result or validation errors.\n * @example\n * ```ts\n * // Execute a complete asynchronous request with variables.\n * import { graphql, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String!): String\n * }\n * `);\n *\n * const result = await graphql({\n * schema,\n * source: 'query SayHello($name: String!) { greeting(name: $name) }',\n * rootValue: {\n * greeting: ({ name }) => `Hello, ${name}!`,\n * },\n * variableValues: { name: 'Ada' },\n * operationName: 'SayHello',\n * });\n *\n * result; // => { data: { greeting: 'Hello, Ada!' } }\n * ```\n * @example\n * ```ts\n * // This variant supplies context plus custom field and type resolvers.\n * import { graphql, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * interface Named {\n * name: String!\n * }\n *\n * type User implements Named {\n * name: String!\n * }\n *\n * type Query {\n * viewer: Named\n * }\n * `);\n *\n * const result = await graphql({\n * schema,\n * source: '{ viewer { __typename name } }',\n * rootValue: { viewer: { kind: 'user', name: 'Ada' } },\n * contextValue: { locale: 'en' },\n * fieldResolver: (source, _args, context, info) => {\n * context.locale; // => 'en'\n * return source[info.fieldName];\n * },\n * typeResolver: (value) => {\n * return value.kind === 'user' ? 'User' : undefined;\n * },\n * });\n *\n * result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }\n * ```\n * @example\n * ```ts\n * // This variant customizes the request pipeline with a harness.\n * import { buildSchema, defaultHarness, graphql } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const stages = [];\n * const abortController = new AbortController();\n * const harness = {\n * parse: (...args) => {\n * stages.push('parse');\n * return defaultHarness.parse(...args);\n * },\n * validate: (...args) => {\n * stages.push('validate');\n * return defaultHarness.validate(...args);\n * },\n * execute: (...args) => {\n * stages.push('execute');\n * return defaultHarness.execute(...args);\n * },\n * subscribe: (...args) => {\n * stages.push('subscribe');\n * return defaultHarness.subscribe(...args);\n * },\n * };\n *\n * const result = await graphql({\n * schema,\n * source: '{ greeting }',\n * rootValue: { greeting: 'Hello' },\n * rules: [],\n * maxErrors: 25,\n * hideSuggestions: true,\n * noLocation: true,\n * abortSignal: abortController.signal,\n * harness,\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * stages; // => ['parse', 'validate', 'execute']\n * ```\n * @category Request Pipeline\n */\nexport function graphql(args: GraphQLArgs): Promise {\n // Always return a Promise for a consistent API.\n return new Promise((resolve) => resolve(graphqlImpl(args)));\n}\n\n/**\n * Parses, validates, and executes a GraphQL document synchronously.\n *\n * This function guarantees that execution completes synchronously, or throws an\n * error, assuming that all field resolvers are also synchronous. It throws when\n * any resolver returns a promise.\n * @param args - Request execution arguments, including schema and source.\n * @returns Completed execution output, or request errors if parsing or\n * validation fails.\n * @example\n * ```ts\n * // Execute a complete synchronous request with variables.\n * import { graphqlSync, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String!): String\n * }\n * `);\n *\n * const result = graphqlSync({\n * schema,\n * source: 'query SayHello($name: String!) { greeting(name: $name) }',\n * rootValue: {\n * greeting: ({ name }) => `Hello, ${name}!`,\n * },\n * variableValues: { name: 'Ada' },\n * operationName: 'SayHello',\n * });\n *\n * result; // => { data: { greeting: 'Hello, Ada!' } }\n * ```\n * @example\n * ```ts\n * // This variant uses a synchronous custom field resolver and context.\n * import { graphqlSync, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const result = graphqlSync({\n * schema,\n * source: '{ greeting }',\n * fieldResolver: (_source, _args, contextValue) => {\n * return contextValue.defaultGreeting;\n * },\n * contextValue: { defaultGreeting: 'Hello' },\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n * @category Request Pipeline\n */\nexport function graphqlSync(args: GraphQLArgs): ExecutionResult {\n const result = graphqlImpl(args);\n\n // Assert that the execution was synchronous.\n if (isPromise(result)) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\nfunction graphqlImpl(args: GraphQLArgs): PromiseOrValue {\n const harness = args.harness ?? defaultHarness;\n const { schema, source } = args;\n\n // Validate Schema\n const schemaValidationErrors = validateSchema(schema);\n if (schemaValidationErrors.length > 0) {\n return { errors: schemaValidationErrors };\n }\n\n // Parse\n let document;\n try {\n document = harness.parse(source, args);\n } catch (syntaxError) {\n return { errors: [ensureGraphQLError(syntaxError)] };\n }\n\n if (isPromise(document)) {\n return document.then(\n (resolvedDocument) =>\n validateAndExecute(harness, args, schema, resolvedDocument),\n (syntaxError: unknown) => ({ errors: [ensureGraphQLError(syntaxError)] }),\n );\n }\n\n return validateAndExecute(harness, args, schema, document);\n}\n\nfunction validateAndExecute(\n harness: GraphQLHarness,\n args: GraphQLArgs,\n schema: GraphQLSchema,\n document: DocumentNode,\n): PromiseOrValue {\n // Validate\n const validationResult = harness.validate(schema, document, args.rules, args);\n\n if (isPromise(validationResult)) {\n return validationResult.then((resolvedValidationResult) =>\n checkValidationAndExecute(\n harness,\n args,\n resolvedValidationResult,\n document,\n ),\n );\n }\n\n return checkValidationAndExecute(harness, args, validationResult, document);\n}\n\nfunction checkValidationAndExecute(\n harness: GraphQLHarness,\n args: GraphQLArgs,\n validationResult: ReadonlyArray,\n document: DocumentNode,\n): PromiseOrValue {\n if (validationResult.length > 0) {\n return { errors: validationResult };\n }\n\n // Execute\n return harness.execute({ ...args, document });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs new file mode 100644 index 00000000..7db3cecf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs @@ -0,0 +1,47 @@ +import { isPromise } from "./jsutils/isPromise.mjs"; +import { ensureGraphQLError } from "./error/ensureGraphQLError.mjs"; +import { validateSchema } from "./type/validate.mjs"; +import { defaultHarness } from "./harness.mjs"; +export function graphql(args) { + return new Promise((resolve) => resolve(graphqlImpl(args))); +} +export function graphqlSync(args) { + const result = graphqlImpl(args); + if (isPromise(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + return result; +} +function graphqlImpl(args) { + const harness = args.harness ?? defaultHarness; + const { schema, source } = args; + const schemaValidationErrors = validateSchema(schema); + if (schemaValidationErrors.length > 0) { + return { errors: schemaValidationErrors }; + } + let document; + try { + document = harness.parse(source, args); + } + catch (syntaxError) { + return { errors: [ensureGraphQLError(syntaxError)] }; + } + if (isPromise(document)) { + return document.then((resolvedDocument) => validateAndExecute(harness, args, schema, resolvedDocument), (syntaxError) => ({ errors: [ensureGraphQLError(syntaxError)] })); + } + return validateAndExecute(harness, args, schema, document); +} +function validateAndExecute(harness, args, schema, document) { + const validationResult = harness.validate(schema, document, args.rules, args); + if (isPromise(validationResult)) { + return validationResult.then((resolvedValidationResult) => checkValidationAndExecute(harness, args, resolvedValidationResult, document)); + } + return checkValidationAndExecute(harness, args, validationResult, document); +} +function checkValidationAndExecute(harness, args, validationResult, document) { + if (validationResult.length > 0) { + return { errors: validationResult }; + } + return harness.execute({ ...args, document }); +} +//# sourceMappingURL=graphql.mjs.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs.map new file mode 100644 index 00000000..9b0db92d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/graphql.mjs.map @@ -0,0 +1 @@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Promise.ts';\nimport type { PromiseOrValue } from './jsutils/PromiseOrValue.ts';\n\nimport { ensureGraphQLError } from './error/ensureGraphQLError.ts';\nimport type { GraphQLError } from './error/GraphQLError.ts';\n\nimport type { DocumentNode } from './language/ast.ts';\nimport type { ParseOptions } from './language/parser.ts';\nimport type { Source } from './language/source.ts';\n\nimport type { GraphQLSchema } from './type/schema.ts';\nimport { validateSchema } from './type/validate.ts';\n\nimport type { ValidationOptions } from './validation/validate.ts';\nimport type { ValidationRule } from './validation/ValidationContext.ts';\n\nimport type { ExecutionArgs } from './execution/ExecutionArgs.ts';\nimport type { ExecutionResult } from './execution/Executor.ts';\n\nimport type { GraphQLHarness } from './harness.ts';\nimport { defaultHarness } from './harness.ts';\n\n/**\n * Describes the input object accepted by `graphql` and `graphqlSync`.\n *\n * These arguments describe the full parse, validate, and execute lifecycle for\n * a GraphQL request. They include parser options, validation options, execution\n * options, and an optional harness for replacing pipeline stages.\n *\n * `graphql` and `graphqlSync` do not support incremental delivery (`@defer` and\n * `@stream`); use `experimentalExecuteIncrementally` after parsing and\n * validating when incremental delivery is required.\n */\nexport interface GraphQLArgs\n extends ParseOptions, ValidationOptions, Omit {\n /**\n * Custom parse, validate, execute, and subscribe functions for this request\n * pipeline.\n */\n harness?: GraphQLHarness | undefined;\n /**\n * A GraphQL language-formatted string or source object representing the\n * requested operation.\n */\n source: string | Source;\n /** Validation rules to use instead of the specified rules. */\n rules?: ReadonlyArray | undefined;\n}\n\n/**\n * Parses, validates, and executes a GraphQL document against a schema.\n *\n * This is the primary entry point for fulfilling GraphQL operations. Use this\n * when you want a single-call request lifecycle that returns a promise in all\n * cases.\n *\n * More sophisticated GraphQL servers, such as those which persist queries, may\n * wish to separate the validation and execution phases to a static-time tooling\n * step and a server runtime step.\n * @param args - Request execution arguments, including schema and source.\n * @returns A promise that resolves to an execution result or validation errors.\n * @example\n * ```ts\n * // Execute a complete asynchronous request with variables.\n * import { graphql, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String!): String\n * }\n * `);\n *\n * const result = await graphql({\n * schema,\n * source: 'query SayHello($name: String!) { greeting(name: $name) }',\n * rootValue: {\n * greeting: ({ name }) => `Hello, ${name}!`,\n * },\n * variableValues: { name: 'Ada' },\n * operationName: 'SayHello',\n * });\n *\n * result; // => { data: { greeting: 'Hello, Ada!' } }\n * ```\n * @example\n * ```ts\n * // This variant supplies context plus custom field and type resolvers.\n * import { graphql, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * interface Named {\n * name: String!\n * }\n *\n * type User implements Named {\n * name: String!\n * }\n *\n * type Query {\n * viewer: Named\n * }\n * `);\n *\n * const result = await graphql({\n * schema,\n * source: '{ viewer { __typename name } }',\n * rootValue: { viewer: { kind: 'user', name: 'Ada' } },\n * contextValue: { locale: 'en' },\n * fieldResolver: (source, _args, context, info) => {\n * context.locale; // => 'en'\n * return source[info.fieldName];\n * },\n * typeResolver: (value) => {\n * return value.kind === 'user' ? 'User' : undefined;\n * },\n * });\n *\n * result; // => { data: { viewer: { __typename: 'User', name: 'Ada' } } }\n * ```\n * @example\n * ```ts\n * // This variant customizes the request pipeline with a harness.\n * import { buildSchema, defaultHarness, graphql } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const stages = [];\n * const abortController = new AbortController();\n * const harness = {\n * parse: (...args) => {\n * stages.push('parse');\n * return defaultHarness.parse(...args);\n * },\n * validate: (...args) => {\n * stages.push('validate');\n * return defaultHarness.validate(...args);\n * },\n * execute: (...args) => {\n * stages.push('execute');\n * return defaultHarness.execute(...args);\n * },\n * subscribe: (...args) => {\n * stages.push('subscribe');\n * return defaultHarness.subscribe(...args);\n * },\n * };\n *\n * const result = await graphql({\n * schema,\n * source: '{ greeting }',\n * rootValue: { greeting: 'Hello' },\n * rules: [],\n * maxErrors: 25,\n * hideSuggestions: true,\n * noLocation: true,\n * abortSignal: abortController.signal,\n * harness,\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * stages; // => ['parse', 'validate', 'execute']\n * ```\n * @category Request Pipeline\n */\nexport function graphql(args: GraphQLArgs): Promise {\n // Always return a Promise for a consistent API.\n return new Promise((resolve) => resolve(graphqlImpl(args)));\n}\n\n/**\n * Parses, validates, and executes a GraphQL document synchronously.\n *\n * This function guarantees that execution completes synchronously, or throws an\n * error, assuming that all field resolvers are also synchronous. It throws when\n * any resolver returns a promise.\n * @param args - Request execution arguments, including schema and source.\n * @returns Completed execution output, or request errors if parsing or\n * validation fails.\n * @example\n * ```ts\n * // Execute a complete synchronous request with variables.\n * import { graphqlSync, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String!): String\n * }\n * `);\n *\n * const result = graphqlSync({\n * schema,\n * source: 'query SayHello($name: String!) { greeting(name: $name) }',\n * rootValue: {\n * greeting: ({ name }) => `Hello, ${name}!`,\n * },\n * variableValues: { name: 'Ada' },\n * operationName: 'SayHello',\n * });\n *\n * result; // => { data: { greeting: 'Hello, Ada!' } }\n * ```\n * @example\n * ```ts\n * // This variant uses a synchronous custom field resolver and context.\n * import { graphqlSync, buildSchema } from 'graphql';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const result = graphqlSync({\n * schema,\n * source: '{ greeting }',\n * fieldResolver: (_source, _args, contextValue) => {\n * return contextValue.defaultGreeting;\n * },\n * contextValue: { defaultGreeting: 'Hello' },\n * });\n *\n * result; // => { data: { greeting: 'Hello' } }\n * ```\n * @category Request Pipeline\n */\nexport function graphqlSync(args: GraphQLArgs): ExecutionResult {\n const result = graphqlImpl(args);\n\n // Assert that the execution was synchronous.\n if (isPromise(result)) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\nfunction graphqlImpl(args: GraphQLArgs): PromiseOrValue {\n const harness = args.harness ?? defaultHarness;\n const { schema, source } = args;\n\n // Validate Schema\n const schemaValidationErrors = validateSchema(schema);\n if (schemaValidationErrors.length > 0) {\n return { errors: schemaValidationErrors };\n }\n\n // Parse\n let document;\n try {\n document = harness.parse(source, args);\n } catch (syntaxError) {\n return { errors: [ensureGraphQLError(syntaxError)] };\n }\n\n if (isPromise(document)) {\n return document.then(\n (resolvedDocument) =>\n validateAndExecute(harness, args, schema, resolvedDocument),\n (syntaxError: unknown) => ({ errors: [ensureGraphQLError(syntaxError)] }),\n );\n }\n\n return validateAndExecute(harness, args, schema, document);\n}\n\nfunction validateAndExecute(\n harness: GraphQLHarness,\n args: GraphQLArgs,\n schema: GraphQLSchema,\n document: DocumentNode,\n): PromiseOrValue {\n // Validate\n const validationResult = harness.validate(schema, document, args.rules, args);\n\n if (isPromise(validationResult)) {\n return validationResult.then((resolvedValidationResult) =>\n checkValidationAndExecute(\n harness,\n args,\n resolvedValidationResult,\n document,\n ),\n );\n }\n\n return checkValidationAndExecute(harness, args, validationResult, document);\n}\n\nfunction checkValidationAndExecute(\n harness: GraphQLHarness,\n args: GraphQLArgs,\n validationResult: ReadonlyArray,\n document: DocumentNode,\n): PromiseOrValue {\n if (validationResult.length > 0) {\n return { errors: validationResult };\n }\n\n // Execute\n return harness.execute({ ...args, document });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.mts new file mode 100644 index 00000000..305f716f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.mts @@ -0,0 +1,32 @@ +/** @category Harness */ +import type { PromiseOrValue } from "./jsutils/PromiseOrValue.mjs"; +import { parse } from "./language/parser.mjs"; +import { validate } from "./validation/validate.mjs"; +import { execute, subscribe } from "./execution/execute.mjs"; +/** Function used by a GraphQL harness to parse GraphQL source text. */ +export type GraphQLParseFn = (...args: Parameters) => PromiseOrValue>; +/** Function used by a GraphQL harness to validate a parsed document. */ +export type GraphQLValidateFn = (...args: Parameters) => PromiseOrValue>; +/** Function used by a GraphQL harness to execute a valid operation. */ +export type GraphQLExecuteFn = (...args: Parameters) => ReturnType; +/** Function used by a GraphQL harness to create a subscription response stream. */ +export type GraphQLSubscribeFn = (...args: Parameters) => ReturnType; +/** + * Overrides for the parse, validate, execute, and subscribe stages used by the + * high-level `graphql` and `graphqlSync` request pipeline. + */ +export interface GraphQLHarness { + /** Parses GraphQL source text into a document AST. */ + parse: GraphQLParseFn; + /** Validates a document AST against a schema. */ + validate: GraphQLValidateFn; + /** Executes a valid operation. */ + execute: GraphQLExecuteFn; + /** Creates a response stream for a subscription operation. */ + subscribe: GraphQLSubscribeFn; +} +/** + * Default harness backed by GraphQL.js parse, validate, execute, and subscribe + * implementations. + */ +export declare const defaultHarness: GraphQLHarness; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.ts new file mode 100644 index 00000000..1f4fa8a2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.d.ts @@ -0,0 +1,32 @@ +/** @category Harness */ +import type { PromiseOrValue } from "./jsutils/PromiseOrValue.js"; +import { parse } from "./language/parser.js"; +import { validate } from "./validation/validate.js"; +import { execute, subscribe } from "./execution/execute.js"; +/** Function used by a GraphQL harness to parse GraphQL source text. */ +export type GraphQLParseFn = (...args: Parameters) => PromiseOrValue>; +/** Function used by a GraphQL harness to validate a parsed document. */ +export type GraphQLValidateFn = (...args: Parameters) => PromiseOrValue>; +/** Function used by a GraphQL harness to execute a valid operation. */ +export type GraphQLExecuteFn = (...args: Parameters) => ReturnType; +/** Function used by a GraphQL harness to create a subscription response stream. */ +export type GraphQLSubscribeFn = (...args: Parameters) => ReturnType; +/** + * Overrides for the parse, validate, execute, and subscribe stages used by the + * high-level `graphql` and `graphqlSync` request pipeline. + */ +export interface GraphQLHarness { + /** Parses GraphQL source text into a document AST. */ + parse: GraphQLParseFn; + /** Validates a document AST against a schema. */ + validate: GraphQLValidateFn; + /** Executes a valid operation. */ + execute: GraphQLExecuteFn; + /** Creates a response stream for a subscription operation. */ + subscribe: GraphQLSubscribeFn; +} +/** + * Default harness backed by GraphQL.js parse, validate, execute, and subscribe + * implementations. + */ +export declare const defaultHarness: GraphQLHarness; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js new file mode 100644 index 00000000..29dc8e2e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultHarness = void 0; +const parser_ts_1 = require("./language/parser.js"); +const validate_ts_1 = require("./validation/validate.js"); +const execute_ts_1 = require("./execution/execute.js"); +exports.defaultHarness = { + parse: parser_ts_1.parse, + validate: validate_ts_1.validate, + execute: execute_ts_1.execute, + subscribe: execute_ts_1.subscribe, +}; +//# sourceMappingURL=harness.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js.map new file mode 100644 index 00000000..2fdaace6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.js.map @@ -0,0 +1 @@ +{"version":3,"file":"harness.js","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":";;;AAIA,oDAA6C;AAE7C,0DAAoD;AAEpD,uDAA4D;AAyC/C,QAAA,cAAc,GAAmB;IAC5C,KAAK,EAAL,iBAAK;IACL,QAAQ,EAAR,sBAAQ;IACR,OAAO,EAAP,oBAAO;IACP,SAAS,EAAT,sBAAS;CACV,CAAC","sourcesContent":["/** @category Harness */\n\nimport type { PromiseOrValue } from './jsutils/PromiseOrValue.ts';\n\nimport { parse } from './language/parser.ts';\n\nimport { validate } from './validation/validate.ts';\n\nimport { execute, subscribe } from './execution/execute.ts';\n\n/** Function used by a GraphQL harness to parse GraphQL source text. */\nexport type GraphQLParseFn = (\n ...args: Parameters\n) => PromiseOrValue>;\n\n/** Function used by a GraphQL harness to validate a parsed document. */\nexport type GraphQLValidateFn = (\n ...args: Parameters\n) => PromiseOrValue>;\n\n/** Function used by a GraphQL harness to execute a valid operation. */\nexport type GraphQLExecuteFn = (\n ...args: Parameters\n) => ReturnType;\n\n/** Function used by a GraphQL harness to create a subscription response stream. */\nexport type GraphQLSubscribeFn = (\n ...args: Parameters\n) => ReturnType;\n\n/**\n * Overrides for the parse, validate, execute, and subscribe stages used by the\n * high-level `graphql` and `graphqlSync` request pipeline.\n */\nexport interface GraphQLHarness {\n /** Parses GraphQL source text into a document AST. */\n parse: GraphQLParseFn;\n /** Validates a document AST against a schema. */\n validate: GraphQLValidateFn;\n /** Executes a valid operation. */\n execute: GraphQLExecuteFn;\n /** Creates a response stream for a subscription operation. */\n subscribe: GraphQLSubscribeFn;\n}\n\n/**\n * Default harness backed by GraphQL.js parse, validate, execute, and subscribe\n * implementations.\n */\nexport const defaultHarness: GraphQLHarness = {\n parse,\n validate,\n execute,\n subscribe,\n};\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs new file mode 100644 index 00000000..c0362edf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs @@ -0,0 +1,10 @@ +import { parse } from "./language/parser.mjs"; +import { validate } from "./validation/validate.mjs"; +import { execute, subscribe } from "./execution/execute.mjs"; +export const defaultHarness = { + parse, + validate, + execute, + subscribe, +}; +//# sourceMappingURL=harness.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs.map new file mode 100644 index 00000000..2dc4fe3e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/harness.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"harness.js","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,8BAA6B;AAE7C,OAAO,EAAE,QAAQ,EAAE,kCAAiC;AAEpD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gCAA+B;AAyC5D,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,KAAK;IACL,QAAQ;IACR,OAAO;IACP,SAAS;CACV,CAAC","sourcesContent":["/** @category Harness */\n\nimport type { PromiseOrValue } from './jsutils/PromiseOrValue.ts';\n\nimport { parse } from './language/parser.ts';\n\nimport { validate } from './validation/validate.ts';\n\nimport { execute, subscribe } from './execution/execute.ts';\n\n/** Function used by a GraphQL harness to parse GraphQL source text. */\nexport type GraphQLParseFn = (\n ...args: Parameters\n) => PromiseOrValue>;\n\n/** Function used by a GraphQL harness to validate a parsed document. */\nexport type GraphQLValidateFn = (\n ...args: Parameters\n) => PromiseOrValue>;\n\n/** Function used by a GraphQL harness to execute a valid operation. */\nexport type GraphQLExecuteFn = (\n ...args: Parameters\n) => ReturnType;\n\n/** Function used by a GraphQL harness to create a subscription response stream. */\nexport type GraphQLSubscribeFn = (\n ...args: Parameters\n) => ReturnType;\n\n/**\n * Overrides for the parse, validate, execute, and subscribe stages used by the\n * high-level `graphql` and `graphqlSync` request pipeline.\n */\nexport interface GraphQLHarness {\n /** Parses GraphQL source text into a document AST. */\n parse: GraphQLParseFn;\n /** Validates a document AST against a schema. */\n validate: GraphQLValidateFn;\n /** Executes a valid operation. */\n execute: GraphQLExecuteFn;\n /** Creates a response stream for a subscription operation. */\n subscribe: GraphQLSubscribeFn;\n}\n\n/**\n * Default harness backed by GraphQL.js parse, validate, execute, and subscribe\n * implementations.\n */\nexport const defaultHarness: GraphQLHarness = {\n parse,\n validate,\n execute,\n subscribe,\n};\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.mts new file mode 100644 index 00000000..8bc9bcb9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.mts @@ -0,0 +1,54 @@ +/** + * The root `graphql` package re-exports the public GraphQL.js API from its + * submodules and provides the high-level request pipeline helpers defined in + * this module. + * + * You can import public exports from GraphQL.js modules through the root + * `graphql` package or through their module-specific entry point. For example, + * these two references resolve to the same `parse` function: + * + * ```ts + * import { parse } from 'graphql'; + * import { parse } from 'graphql/language'; + * ``` + * + * Use the root package when you want a single import surface, or use submodules + * such as `graphql/language`, `graphql/type`, `graphql/execution`, and + * `graphql/utilities` when you want module-focused imports. This module also + * defines root-only APIs, such as request pipeline helpers and version + * metadata, that do not belong to a narrower submodule. + * @packageDocumentation + */ +export { version, versionInfo } from "./version.mjs"; +export { enableDevMode, isDevModeEnabled } from "./devMode.mjs"; +export type { GraphQLChannelContextByName, GraphQLChannels, GraphQLExecuteContext, GraphQLExecuteRootSelectionSetContext, GraphQLExecuteVariableCoercionContext, GraphQLParseContext, GraphQLResolveContext, GraphQLSubscribeContext, GraphQLValidateContext, } from "./diagnostics.mjs"; +export type { GraphQLArgs } from "./graphql.mjs"; +export { graphql, graphqlSync } from "./graphql.mjs"; +export { defaultHarness } from "./harness.mjs"; +export type { GraphQLHarness, GraphQLParseFn, GraphQLValidateFn, GraphQLExecuteFn, GraphQLSubscribeFn, } from "./harness.mjs"; +export type { GraphQLField, GraphQLArgument, GraphQLEnumValue, GraphQLInputField, } from "./type/index.mjs"; +export { resolveObjMapThunk, resolveReadonlyArrayThunk, GraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeferDirective, GraphQLStreamDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective, TypeKind, DEFAULT_DEPRECATION_REASON, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, isSchema, isDirective, isType, isScalarType, isObjectType, isField, isArgument, isInterfaceType, isUnionType, isEnumType, isEnumValue, isInputObjectType, isInputField, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertField, assertArgument, assertInterfaceType, assertUnionType, assertEnumType, assertEnumValue, assertInputObjectType, assertInputField, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, getNullableType, getNamedType, validateSchema, assertValidSchema, assertName, assertEnumValueName, } from "./type/index.mjs"; +export type { GraphQLType, GraphQLInputType, GraphQLOutputType, GraphQLLeafType, GraphQLCompositeType, GraphQLAbstractType, GraphQLWrappingType, GraphQLNullableType, GraphQLNullableInputType, GraphQLNullableOutputType, GraphQLNamedType, GraphQLNamedInputType, GraphQLNamedOutputType, ThunkReadonlyArray, ThunkObjMap, GraphQLSchemaConfig, GraphQLSchemaExtensions, GraphQLDirectiveConfig, GraphQLDirectiveExtensions, GraphQLArgumentConfig, GraphQLArgumentExtensions, GraphQLEnumTypeConfig, GraphQLEnumTypeExtensions, GraphQLEnumValueConfig, GraphQLEnumValueConfigMap, GraphQLEnumValueExtensions, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLFieldExtensions, GraphQLFieldMap, GraphQLFieldResolver, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputFieldExtensions, GraphQLInputFieldMap, GraphQLInputObjectTypeConfig, GraphQLInputObjectTypeExtensions, GraphQLInterfaceTypeConfig, GraphQLInterfaceTypeExtensions, GraphQLIsTypeOfFn, GraphQLObjectTypeConfig, GraphQLObjectTypeExtensions, GraphQLResolveInfo, GraphQLResolveInfoHelpers, ResponsePath, GraphQLScalarTypeConfig, GraphQLScalarTypeExtensions, GraphQLTypeResolver, GraphQLUnionTypeConfig, GraphQLUnionTypeExtensions, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, GraphQLScalarOutputValueCoercer, GraphQLScalarInputValueCoercer, GraphQLScalarInputLiteralCoercer, GraphQLDefaultInput, } from "./type/index.mjs"; +export { Kind } from "./language/kinds.mjs"; +export { Token, Source, Location, OperationTypeNode, getLocation, printLocation, printSourceLocation, Lexer, TokenKind, parse, parseValue, parseConstValue, parseType, parseSchemaCoordinate, print, visit, visitInParallel, getEnterLeaveForKind, BREAK, DirectiveLocation, isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isConstValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode, isSchemaCoordinateNode, isSubscriptionOperationDefinitionNode, } from "./language/index.mjs"; +export type { ParseOptions, SourceLocation, ASTVisitor, ASTVisitFn, ASTVisitorKeyMap, ASTNode, ASTKindToNode, NameNode, DocumentNode, DefinitionNode, ExecutableDefinitionNode, OperationDefinitionNode, SubscriptionOperationDefinitionNode, VariableDefinitionNode, VariableNode, SelectionSetNode, SelectionNode, FieldNode, ArgumentNode, FragmentArgumentNode, ConstArgumentNode, FragmentSpreadNode, InlineFragmentNode, FragmentDefinitionNode, ValueNode, ConstValueNode, IntValueNode, FloatValueNode, StringValueNode, BooleanValueNode, NullValueNode, EnumValueNode, ListValueNode, ConstListValueNode, ObjectValueNode, ConstObjectValueNode, ObjectFieldNode, ConstObjectFieldNode, DirectiveNode, ConstDirectiveNode, TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, TypeSystemDefinitionNode, SchemaDefinitionNode, OperationTypeDefinitionNode, TypeDefinitionNode, ScalarTypeDefinitionNode, ObjectTypeDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, InputObjectTypeDefinitionNode, DirectiveDefinitionNode, TypeSystemExtensionNode, SchemaExtensionNode, TypeExtensionNode, ScalarTypeExtensionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, UnionTypeExtensionNode, EnumTypeExtensionNode, InputObjectTypeExtensionNode, DirectiveExtensionNode, SchemaCoordinateNode, TypeCoordinateNode, MemberCoordinateNode, ArgumentCoordinateNode, DirectiveCoordinateNode, DirectiveArgumentCoordinateNode, } from "./language/index.mjs"; +export { AbortedGraphQLExecutionError, execute, executeRootSelectionSet, executeSubscriptionEvent, experimentalExecuteIncrementally, experimentalExecuteRootSelectionSet, legacyExecuteIncrementally, legacyExecuteRootSelectionSet, executeSync, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getArgumentValues, getVariableValues, getDirectiveValues, subscribe, createSourceEventStream, mapSourceToResponseEvent, validateExecutionArgs, validateSubscriptionArgs, } from "./execution/index.mjs"; +export type { ExecutionArgs, RootSelectionSetExecutor, AsyncWorkFinishedInfo, ExecutionHooks, VariableValues, ValidatedExecutionArgs, ValidatedSubscriptionArgs, ExecutionResult, ExperimentalIncrementalExecutionResults, InitialIncrementalExecutionResult, SubsequentIncrementalExecutionResult, IncrementalDeferResult, IncrementalStreamResult, IncrementalResult, FormattedExecutionResult, FormattedExperimentalIncrementalExecutionResults, FormattedInitialIncrementalExecutionResult, FormattedSubsequentIncrementalExecutionResult, FormattedIncrementalDeferResult, FormattedIncrementalStreamResult, FormattedIncrementalResult, LegacyExperimentalIncrementalExecutionResults, LegacyInitialIncrementalExecutionResult, LegacySubsequentIncrementalExecutionResult, LegacyIncrementalDeferResult, LegacyIncrementalStreamResult, LegacyIncrementalResult, FormattedLegacyExperimentalIncrementalExecutionResults, FormattedLegacyInitialIncrementalExecutionResult, FormattedLegacySubsequentIncrementalExecutionResult, FormattedLegacyIncrementalDeferResult, FormattedLegacyIncrementalStreamResult, FormattedLegacyIncrementalResult, } from "./execution/index.mjs"; +export { validate, ValidationContext, specifiedRules, recommendedRules, DeferStreamDirectiveLabelRule, DeferStreamDirectiveOnRootFieldRule, DeferStreamDirectiveOnValidOperationsRule, ExecutableDefinitionsRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownOperationTypesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, StreamDirectiveOnListFieldRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule, MaxIntrospectionDepthRule, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueArgumentDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule, NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule, } from "./validation/index.mjs"; +export type { ValidationOptions, ValidationRule } from "./validation/index.mjs"; +export { GraphQLError, syntaxError, locatedError } from "./error/index.mjs"; +export type { GraphQLErrorOptions, GraphQLFormattedError, GraphQLErrorExtensions, GraphQLFormattedErrorExtensions, } from "./error/index.mjs"; +export { getIntrospectionQuery, getOperationAST, introspectionFromSchema, buildClientSchema, buildASTSchema, buildSchema, extendSchema, lexicographicSortSchema, printSchema, printType, printDirective, printIntrospectionSchema, typeFromAST, +/** + * Deprecated export retained for compatibility. Use `coerceInputLiteral()` + * instead. + * @deprecated use `coerceInputLiteral()` instead - will be removed in v18 + */ +valueFromAST, valueFromASTUntyped, +/** + * Deprecated export retained for compatibility. Use `valueToLiteral()` + * instead, and take care to operate on external values. + * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18 + */ +astFromValue, TypeInfo, visitWithTypeInfo, replaceVariables, valueToLiteral, coerceInputValue, coerceInputLiteral, validateInputValue, validateInputLiteral, concatAST, separateOperations, stripIgnoredCharacters, isEqualType, isTypeSubTypeOf, doTypesOverlap, BreakingChangeType, DangerousChangeType, SafeChangeType, findBreakingChanges, findDangerousChanges, findSchemaChanges, resolveSchemaCoordinate, resolveASTSchemaCoordinate, } from "./utilities/index.mjs"; +export type { IntrospectionOptions, IntrospectionQuery, IntrospectionSchema, IntrospectionType, IntrospectionInputType, IntrospectionOutputType, IntrospectionScalarType, IntrospectionObjectType, IntrospectionInterfaceType, IntrospectionUnionType, IntrospectionEnumType, IntrospectionInputObjectType, IntrospectionTypeRef, IntrospectionInputTypeRef, IntrospectionOutputTypeRef, IntrospectionNamedTypeRef, IntrospectionListTypeRef, IntrospectionNonNullTypeRef, IntrospectionField, IntrospectionInputValue, IntrospectionEnumValue, IntrospectionDirective, BuildSchemaOptions, BreakingChange, SafeChange, DangerousChange, SchemaChange, TypedQueryDocumentNode, ResolvedSchemaElement, } from "./utilities/index.mjs"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.ts new file mode 100644 index 00000000..21210fbc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.d.ts @@ -0,0 +1,54 @@ +/** + * The root `graphql` package re-exports the public GraphQL.js API from its + * submodules and provides the high-level request pipeline helpers defined in + * this module. + * + * You can import public exports from GraphQL.js modules through the root + * `graphql` package or through their module-specific entry point. For example, + * these two references resolve to the same `parse` function: + * + * ```ts + * import { parse } from 'graphql'; + * import { parse } from 'graphql/language'; + * ``` + * + * Use the root package when you want a single import surface, or use submodules + * such as `graphql/language`, `graphql/type`, `graphql/execution`, and + * `graphql/utilities` when you want module-focused imports. This module also + * defines root-only APIs, such as request pipeline helpers and version + * metadata, that do not belong to a narrower submodule. + * @packageDocumentation + */ +export { version, versionInfo } from "./version.js"; +export { enableDevMode, isDevModeEnabled } from "./devMode.js"; +export type { GraphQLChannelContextByName, GraphQLChannels, GraphQLExecuteContext, GraphQLExecuteRootSelectionSetContext, GraphQLExecuteVariableCoercionContext, GraphQLParseContext, GraphQLResolveContext, GraphQLSubscribeContext, GraphQLValidateContext, } from "./diagnostics.js"; +export type { GraphQLArgs } from "./graphql.js"; +export { graphql, graphqlSync } from "./graphql.js"; +export { defaultHarness } from "./harness.js"; +export type { GraphQLHarness, GraphQLParseFn, GraphQLValidateFn, GraphQLExecuteFn, GraphQLSubscribeFn, } from "./harness.js"; +export type { GraphQLField, GraphQLArgument, GraphQLEnumValue, GraphQLInputField, } from "./type/index.js"; +export { resolveObjMapThunk, resolveReadonlyArrayThunk, GraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeferDirective, GraphQLStreamDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective, TypeKind, DEFAULT_DEPRECATION_REASON, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, isSchema, isDirective, isType, isScalarType, isObjectType, isField, isArgument, isInterfaceType, isUnionType, isEnumType, isEnumValue, isInputObjectType, isInputField, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertField, assertArgument, assertInterfaceType, assertUnionType, assertEnumType, assertEnumValue, assertInputObjectType, assertInputField, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, getNullableType, getNamedType, validateSchema, assertValidSchema, assertName, assertEnumValueName, } from "./type/index.js"; +export type { GraphQLType, GraphQLInputType, GraphQLOutputType, GraphQLLeafType, GraphQLCompositeType, GraphQLAbstractType, GraphQLWrappingType, GraphQLNullableType, GraphQLNullableInputType, GraphQLNullableOutputType, GraphQLNamedType, GraphQLNamedInputType, GraphQLNamedOutputType, ThunkReadonlyArray, ThunkObjMap, GraphQLSchemaConfig, GraphQLSchemaExtensions, GraphQLDirectiveConfig, GraphQLDirectiveExtensions, GraphQLArgumentConfig, GraphQLArgumentExtensions, GraphQLEnumTypeConfig, GraphQLEnumTypeExtensions, GraphQLEnumValueConfig, GraphQLEnumValueConfigMap, GraphQLEnumValueExtensions, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLFieldExtensions, GraphQLFieldMap, GraphQLFieldResolver, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputFieldExtensions, GraphQLInputFieldMap, GraphQLInputObjectTypeConfig, GraphQLInputObjectTypeExtensions, GraphQLInterfaceTypeConfig, GraphQLInterfaceTypeExtensions, GraphQLIsTypeOfFn, GraphQLObjectTypeConfig, GraphQLObjectTypeExtensions, GraphQLResolveInfo, GraphQLResolveInfoHelpers, ResponsePath, GraphQLScalarTypeConfig, GraphQLScalarTypeExtensions, GraphQLTypeResolver, GraphQLUnionTypeConfig, GraphQLUnionTypeExtensions, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, GraphQLScalarOutputValueCoercer, GraphQLScalarInputValueCoercer, GraphQLScalarInputLiteralCoercer, GraphQLDefaultInput, } from "./type/index.js"; +export { Kind } from "./language/kinds.js"; +export { Token, Source, Location, OperationTypeNode, getLocation, printLocation, printSourceLocation, Lexer, TokenKind, parse, parseValue, parseConstValue, parseType, parseSchemaCoordinate, print, visit, visitInParallel, getEnterLeaveForKind, BREAK, DirectiveLocation, isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isConstValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode, isSchemaCoordinateNode, isSubscriptionOperationDefinitionNode, } from "./language/index.js"; +export type { ParseOptions, SourceLocation, ASTVisitor, ASTVisitFn, ASTVisitorKeyMap, ASTNode, ASTKindToNode, NameNode, DocumentNode, DefinitionNode, ExecutableDefinitionNode, OperationDefinitionNode, SubscriptionOperationDefinitionNode, VariableDefinitionNode, VariableNode, SelectionSetNode, SelectionNode, FieldNode, ArgumentNode, FragmentArgumentNode, ConstArgumentNode, FragmentSpreadNode, InlineFragmentNode, FragmentDefinitionNode, ValueNode, ConstValueNode, IntValueNode, FloatValueNode, StringValueNode, BooleanValueNode, NullValueNode, EnumValueNode, ListValueNode, ConstListValueNode, ObjectValueNode, ConstObjectValueNode, ObjectFieldNode, ConstObjectFieldNode, DirectiveNode, ConstDirectiveNode, TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, TypeSystemDefinitionNode, SchemaDefinitionNode, OperationTypeDefinitionNode, TypeDefinitionNode, ScalarTypeDefinitionNode, ObjectTypeDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, InputObjectTypeDefinitionNode, DirectiveDefinitionNode, TypeSystemExtensionNode, SchemaExtensionNode, TypeExtensionNode, ScalarTypeExtensionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, UnionTypeExtensionNode, EnumTypeExtensionNode, InputObjectTypeExtensionNode, DirectiveExtensionNode, SchemaCoordinateNode, TypeCoordinateNode, MemberCoordinateNode, ArgumentCoordinateNode, DirectiveCoordinateNode, DirectiveArgumentCoordinateNode, } from "./language/index.js"; +export { AbortedGraphQLExecutionError, execute, executeRootSelectionSet, executeSubscriptionEvent, experimentalExecuteIncrementally, experimentalExecuteRootSelectionSet, legacyExecuteIncrementally, legacyExecuteRootSelectionSet, executeSync, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getArgumentValues, getVariableValues, getDirectiveValues, subscribe, createSourceEventStream, mapSourceToResponseEvent, validateExecutionArgs, validateSubscriptionArgs, } from "./execution/index.js"; +export type { ExecutionArgs, RootSelectionSetExecutor, AsyncWorkFinishedInfo, ExecutionHooks, VariableValues, ValidatedExecutionArgs, ValidatedSubscriptionArgs, ExecutionResult, ExperimentalIncrementalExecutionResults, InitialIncrementalExecutionResult, SubsequentIncrementalExecutionResult, IncrementalDeferResult, IncrementalStreamResult, IncrementalResult, FormattedExecutionResult, FormattedExperimentalIncrementalExecutionResults, FormattedInitialIncrementalExecutionResult, FormattedSubsequentIncrementalExecutionResult, FormattedIncrementalDeferResult, FormattedIncrementalStreamResult, FormattedIncrementalResult, LegacyExperimentalIncrementalExecutionResults, LegacyInitialIncrementalExecutionResult, LegacySubsequentIncrementalExecutionResult, LegacyIncrementalDeferResult, LegacyIncrementalStreamResult, LegacyIncrementalResult, FormattedLegacyExperimentalIncrementalExecutionResults, FormattedLegacyInitialIncrementalExecutionResult, FormattedLegacySubsequentIncrementalExecutionResult, FormattedLegacyIncrementalDeferResult, FormattedLegacyIncrementalStreamResult, FormattedLegacyIncrementalResult, } from "./execution/index.js"; +export { validate, ValidationContext, specifiedRules, recommendedRules, DeferStreamDirectiveLabelRule, DeferStreamDirectiveOnRootFieldRule, DeferStreamDirectiveOnValidOperationsRule, ExecutableDefinitionsRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownOperationTypesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, StreamDirectiveOnListFieldRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule, MaxIntrospectionDepthRule, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueArgumentDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule, NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule, } from "./validation/index.js"; +export type { ValidationOptions, ValidationRule } from "./validation/index.js"; +export { GraphQLError, syntaxError, locatedError } from "./error/index.js"; +export type { GraphQLErrorOptions, GraphQLFormattedError, GraphQLErrorExtensions, GraphQLFormattedErrorExtensions, } from "./error/index.js"; +export { getIntrospectionQuery, getOperationAST, introspectionFromSchema, buildClientSchema, buildASTSchema, buildSchema, extendSchema, lexicographicSortSchema, printSchema, printType, printDirective, printIntrospectionSchema, typeFromAST, +/** + * Deprecated export retained for compatibility. Use `coerceInputLiteral()` + * instead. + * @deprecated use `coerceInputLiteral()` instead - will be removed in v18 + */ +valueFromAST, valueFromASTUntyped, +/** + * Deprecated export retained for compatibility. Use `valueToLiteral()` + * instead, and take care to operate on external values. + * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18 + */ +astFromValue, TypeInfo, visitWithTypeInfo, replaceVariables, valueToLiteral, coerceInputValue, coerceInputLiteral, validateInputValue, validateInputLiteral, concatAST, separateOperations, stripIgnoredCharacters, isEqualType, isTypeSubTypeOf, doTypesOverlap, BreakingChangeType, DangerousChangeType, SafeChangeType, findBreakingChanges, findDangerousChanges, findSchemaChanges, resolveSchemaCoordinate, resolveASTSchemaCoordinate, } from "./utilities/index.js"; +export type { IntrospectionOptions, IntrospectionQuery, IntrospectionSchema, IntrospectionType, IntrospectionInputType, IntrospectionOutputType, IntrospectionScalarType, IntrospectionObjectType, IntrospectionInterfaceType, IntrospectionUnionType, IntrospectionEnumType, IntrospectionInputObjectType, IntrospectionTypeRef, IntrospectionInputTypeRef, IntrospectionOutputTypeRef, IntrospectionNamedTypeRef, IntrospectionListTypeRef, IntrospectionNonNullTypeRef, IntrospectionField, IntrospectionInputValue, IntrospectionEnumValue, IntrospectionDirective, BuildSchemaOptions, BreakingChange, SafeChange, DangerousChange, SchemaChange, TypedQueryDocumentNode, ResolvedSchemaElement, } from "./utilities/index.js"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js new file mode 100644 index 00000000..64f46089 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js @@ -0,0 +1,265 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSchema = exports.TypeNameMetaFieldDef = exports.TypeMetaFieldDef = exports.SchemaMetaFieldDef = exports.__TypeKind = exports.__EnumValue = exports.__InputValue = exports.__Field = exports.__Type = exports.__DirectiveLocation = exports.__Directive = exports.__Schema = exports.introspectionTypes = exports.DEFAULT_DEPRECATION_REASON = exports.TypeKind = exports.GraphQLOneOfDirective = exports.GraphQLSpecifiedByDirective = exports.GraphQLDeprecatedDirective = exports.GraphQLStreamDirective = exports.GraphQLDeferDirective = exports.GraphQLSkipDirective = exports.GraphQLIncludeDirective = exports.specifiedDirectives = exports.GRAPHQL_MIN_INT = exports.GRAPHQL_MAX_INT = exports.GraphQLID = exports.GraphQLBoolean = exports.GraphQLString = exports.GraphQLFloat = exports.GraphQLInt = exports.specifiedScalarTypes = exports.GraphQLNonNull = exports.GraphQLList = exports.GraphQLInputObjectType = exports.GraphQLEnumType = exports.GraphQLUnionType = exports.GraphQLInterfaceType = exports.GraphQLObjectType = exports.GraphQLScalarType = exports.GraphQLDirective = exports.GraphQLSchema = exports.resolveReadonlyArrayThunk = exports.resolveObjMapThunk = exports.defaultHarness = exports.graphqlSync = exports.graphql = exports.isDevModeEnabled = exports.enableDevMode = exports.versionInfo = exports.version = void 0; +exports.assertNamedType = exports.assertNullableType = exports.assertWrappingType = exports.assertAbstractType = exports.assertCompositeType = exports.assertLeafType = exports.assertOutputType = exports.assertInputType = exports.assertNonNullType = exports.assertListType = exports.assertInputField = exports.assertInputObjectType = exports.assertEnumValue = exports.assertEnumType = exports.assertUnionType = exports.assertInterfaceType = exports.assertArgument = exports.assertField = exports.assertObjectType = exports.assertScalarType = exports.assertType = exports.assertDirective = exports.assertSchema = exports.isSpecifiedDirective = exports.isIntrospectionType = exports.isSpecifiedScalarType = exports.isRequiredInputField = exports.isRequiredArgument = exports.isNamedType = exports.isNullableType = exports.isWrappingType = exports.isAbstractType = exports.isCompositeType = exports.isLeafType = exports.isOutputType = exports.isInputType = exports.isNonNullType = exports.isListType = exports.isInputField = exports.isInputObjectType = exports.isEnumValue = exports.isEnumType = exports.isUnionType = exports.isInterfaceType = exports.isArgument = exports.isField = exports.isObjectType = exports.isScalarType = exports.isType = exports.isDirective = void 0; +exports.defaultTypeResolver = exports.defaultFieldResolver = exports.executeSync = exports.legacyExecuteRootSelectionSet = exports.legacyExecuteIncrementally = exports.experimentalExecuteRootSelectionSet = exports.experimentalExecuteIncrementally = exports.executeSubscriptionEvent = exports.executeRootSelectionSet = exports.execute = exports.AbortedGraphQLExecutionError = exports.isSubscriptionOperationDefinitionNode = exports.isSchemaCoordinateNode = exports.isTypeExtensionNode = exports.isTypeSystemExtensionNode = exports.isTypeDefinitionNode = exports.isTypeSystemDefinitionNode = exports.isTypeNode = exports.isConstValueNode = exports.isValueNode = exports.isSelectionNode = exports.isExecutableDefinitionNode = exports.isDefinitionNode = exports.DirectiveLocation = exports.BREAK = exports.getEnterLeaveForKind = exports.visitInParallel = exports.visit = exports.print = exports.parseSchemaCoordinate = exports.parseType = exports.parseConstValue = exports.parseValue = exports.parse = exports.TokenKind = exports.Lexer = exports.printSourceLocation = exports.printLocation = exports.getLocation = exports.OperationTypeNode = exports.Location = exports.Source = exports.Token = exports.Kind = exports.assertEnumValueName = exports.assertName = exports.assertValidSchema = exports.validateSchema = exports.getNamedType = exports.getNullableType = void 0; +exports.UniqueFieldDefinitionNamesRule = exports.UniqueEnumValueNamesRule = exports.UniqueTypeNamesRule = exports.UniqueOperationTypesRule = exports.LoneSchemaDefinitionRule = exports.MaxIntrospectionDepthRule = exports.VariablesInAllowedPositionRule = exports.VariablesAreInputTypesRule = exports.ValuesOfCorrectTypeRule = exports.UniqueVariableNamesRule = exports.UniqueOperationNamesRule = exports.UniqueInputFieldNamesRule = exports.UniqueFragmentNamesRule = exports.UniqueDirectivesPerLocationRule = exports.UniqueArgumentNamesRule = exports.StreamDirectiveOnListFieldRule = exports.SingleFieldSubscriptionsRule = exports.ScalarLeafsRule = exports.ProvidedRequiredArgumentsRule = exports.PossibleFragmentSpreadsRule = exports.OverlappingFieldsCanBeMergedRule = exports.NoUnusedVariablesRule = exports.NoUnusedFragmentsRule = exports.NoUndefinedVariablesRule = exports.NoFragmentCyclesRule = exports.LoneAnonymousOperationRule = exports.KnownTypeNamesRule = exports.KnownOperationTypesRule = exports.KnownFragmentNamesRule = exports.KnownDirectivesRule = exports.KnownArgumentNamesRule = exports.FragmentsOnCompositeTypesRule = exports.FieldsOnCorrectTypeRule = exports.ExecutableDefinitionsRule = exports.DeferStreamDirectiveOnValidOperationsRule = exports.DeferStreamDirectiveOnRootFieldRule = exports.DeferStreamDirectiveLabelRule = exports.recommendedRules = exports.specifiedRules = exports.ValidationContext = exports.validate = exports.validateSubscriptionArgs = exports.validateExecutionArgs = exports.mapSourceToResponseEvent = exports.createSourceEventStream = exports.subscribe = exports.getDirectiveValues = exports.getVariableValues = exports.getArgumentValues = exports.responsePathAsArray = void 0; +exports.resolveASTSchemaCoordinate = exports.resolveSchemaCoordinate = exports.findSchemaChanges = exports.findDangerousChanges = exports.findBreakingChanges = exports.SafeChangeType = exports.DangerousChangeType = exports.BreakingChangeType = exports.doTypesOverlap = exports.isTypeSubTypeOf = exports.isEqualType = exports.stripIgnoredCharacters = exports.separateOperations = exports.concatAST = exports.validateInputLiteral = exports.validateInputValue = exports.coerceInputLiteral = exports.coerceInputValue = exports.valueToLiteral = exports.replaceVariables = exports.visitWithTypeInfo = exports.TypeInfo = exports.astFromValue = exports.valueFromASTUntyped = exports.valueFromAST = exports.typeFromAST = exports.printIntrospectionSchema = exports.printDirective = exports.printType = exports.printSchema = exports.lexicographicSortSchema = exports.extendSchema = exports.buildSchema = exports.buildASTSchema = exports.buildClientSchema = exports.introspectionFromSchema = exports.getOperationAST = exports.getIntrospectionQuery = exports.locatedError = exports.syntaxError = exports.GraphQLError = exports.NoSchemaIntrospectionCustomRule = exports.NoDeprecatedCustomRule = exports.PossibleTypeExtensionsRule = exports.UniqueDirectiveNamesRule = exports.UniqueArgumentDefinitionNamesRule = void 0; +var version_ts_1 = require("./version.js"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_ts_1.version; } }); +Object.defineProperty(exports, "versionInfo", { enumerable: true, get: function () { return version_ts_1.versionInfo; } }); +var devMode_ts_1 = require("./devMode.js"); +Object.defineProperty(exports, "enableDevMode", { enumerable: true, get: function () { return devMode_ts_1.enableDevMode; } }); +Object.defineProperty(exports, "isDevModeEnabled", { enumerable: true, get: function () { return devMode_ts_1.isDevModeEnabled; } }); +var graphql_ts_1 = require("./graphql.js"); +Object.defineProperty(exports, "graphql", { enumerable: true, get: function () { return graphql_ts_1.graphql; } }); +Object.defineProperty(exports, "graphqlSync", { enumerable: true, get: function () { return graphql_ts_1.graphqlSync; } }); +var harness_ts_1 = require("./harness.js"); +Object.defineProperty(exports, "defaultHarness", { enumerable: true, get: function () { return harness_ts_1.defaultHarness; } }); +var index_ts_1 = require("./type/index.js"); +Object.defineProperty(exports, "resolveObjMapThunk", { enumerable: true, get: function () { return index_ts_1.resolveObjMapThunk; } }); +Object.defineProperty(exports, "resolveReadonlyArrayThunk", { enumerable: true, get: function () { return index_ts_1.resolveReadonlyArrayThunk; } }); +Object.defineProperty(exports, "GraphQLSchema", { enumerable: true, get: function () { return index_ts_1.GraphQLSchema; } }); +Object.defineProperty(exports, "GraphQLDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLDirective; } }); +Object.defineProperty(exports, "GraphQLScalarType", { enumerable: true, get: function () { return index_ts_1.GraphQLScalarType; } }); +Object.defineProperty(exports, "GraphQLObjectType", { enumerable: true, get: function () { return index_ts_1.GraphQLObjectType; } }); +Object.defineProperty(exports, "GraphQLInterfaceType", { enumerable: true, get: function () { return index_ts_1.GraphQLInterfaceType; } }); +Object.defineProperty(exports, "GraphQLUnionType", { enumerable: true, get: function () { return index_ts_1.GraphQLUnionType; } }); +Object.defineProperty(exports, "GraphQLEnumType", { enumerable: true, get: function () { return index_ts_1.GraphQLEnumType; } }); +Object.defineProperty(exports, "GraphQLInputObjectType", { enumerable: true, get: function () { return index_ts_1.GraphQLInputObjectType; } }); +Object.defineProperty(exports, "GraphQLList", { enumerable: true, get: function () { return index_ts_1.GraphQLList; } }); +Object.defineProperty(exports, "GraphQLNonNull", { enumerable: true, get: function () { return index_ts_1.GraphQLNonNull; } }); +Object.defineProperty(exports, "specifiedScalarTypes", { enumerable: true, get: function () { return index_ts_1.specifiedScalarTypes; } }); +Object.defineProperty(exports, "GraphQLInt", { enumerable: true, get: function () { return index_ts_1.GraphQLInt; } }); +Object.defineProperty(exports, "GraphQLFloat", { enumerable: true, get: function () { return index_ts_1.GraphQLFloat; } }); +Object.defineProperty(exports, "GraphQLString", { enumerable: true, get: function () { return index_ts_1.GraphQLString; } }); +Object.defineProperty(exports, "GraphQLBoolean", { enumerable: true, get: function () { return index_ts_1.GraphQLBoolean; } }); +Object.defineProperty(exports, "GraphQLID", { enumerable: true, get: function () { return index_ts_1.GraphQLID; } }); +Object.defineProperty(exports, "GRAPHQL_MAX_INT", { enumerable: true, get: function () { return index_ts_1.GRAPHQL_MAX_INT; } }); +Object.defineProperty(exports, "GRAPHQL_MIN_INT", { enumerable: true, get: function () { return index_ts_1.GRAPHQL_MIN_INT; } }); +Object.defineProperty(exports, "specifiedDirectives", { enumerable: true, get: function () { return index_ts_1.specifiedDirectives; } }); +Object.defineProperty(exports, "GraphQLIncludeDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLIncludeDirective; } }); +Object.defineProperty(exports, "GraphQLSkipDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLSkipDirective; } }); +Object.defineProperty(exports, "GraphQLDeferDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLDeferDirective; } }); +Object.defineProperty(exports, "GraphQLStreamDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLStreamDirective; } }); +Object.defineProperty(exports, "GraphQLDeprecatedDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLDeprecatedDirective; } }); +Object.defineProperty(exports, "GraphQLSpecifiedByDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLSpecifiedByDirective; } }); +Object.defineProperty(exports, "GraphQLOneOfDirective", { enumerable: true, get: function () { return index_ts_1.GraphQLOneOfDirective; } }); +Object.defineProperty(exports, "TypeKind", { enumerable: true, get: function () { return index_ts_1.TypeKind; } }); +Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", { enumerable: true, get: function () { return index_ts_1.DEFAULT_DEPRECATION_REASON; } }); +Object.defineProperty(exports, "introspectionTypes", { enumerable: true, get: function () { return index_ts_1.introspectionTypes; } }); +Object.defineProperty(exports, "__Schema", { enumerable: true, get: function () { return index_ts_1.__Schema; } }); +Object.defineProperty(exports, "__Directive", { enumerable: true, get: function () { return index_ts_1.__Directive; } }); +Object.defineProperty(exports, "__DirectiveLocation", { enumerable: true, get: function () { return index_ts_1.__DirectiveLocation; } }); +Object.defineProperty(exports, "__Type", { enumerable: true, get: function () { return index_ts_1.__Type; } }); +Object.defineProperty(exports, "__Field", { enumerable: true, get: function () { return index_ts_1.__Field; } }); +Object.defineProperty(exports, "__InputValue", { enumerable: true, get: function () { return index_ts_1.__InputValue; } }); +Object.defineProperty(exports, "__EnumValue", { enumerable: true, get: function () { return index_ts_1.__EnumValue; } }); +Object.defineProperty(exports, "__TypeKind", { enumerable: true, get: function () { return index_ts_1.__TypeKind; } }); +Object.defineProperty(exports, "SchemaMetaFieldDef", { enumerable: true, get: function () { return index_ts_1.SchemaMetaFieldDef; } }); +Object.defineProperty(exports, "TypeMetaFieldDef", { enumerable: true, get: function () { return index_ts_1.TypeMetaFieldDef; } }); +Object.defineProperty(exports, "TypeNameMetaFieldDef", { enumerable: true, get: function () { return index_ts_1.TypeNameMetaFieldDef; } }); +Object.defineProperty(exports, "isSchema", { enumerable: true, get: function () { return index_ts_1.isSchema; } }); +Object.defineProperty(exports, "isDirective", { enumerable: true, get: function () { return index_ts_1.isDirective; } }); +Object.defineProperty(exports, "isType", { enumerable: true, get: function () { return index_ts_1.isType; } }); +Object.defineProperty(exports, "isScalarType", { enumerable: true, get: function () { return index_ts_1.isScalarType; } }); +Object.defineProperty(exports, "isObjectType", { enumerable: true, get: function () { return index_ts_1.isObjectType; } }); +Object.defineProperty(exports, "isField", { enumerable: true, get: function () { return index_ts_1.isField; } }); +Object.defineProperty(exports, "isArgument", { enumerable: true, get: function () { return index_ts_1.isArgument; } }); +Object.defineProperty(exports, "isInterfaceType", { enumerable: true, get: function () { return index_ts_1.isInterfaceType; } }); +Object.defineProperty(exports, "isUnionType", { enumerable: true, get: function () { return index_ts_1.isUnionType; } }); +Object.defineProperty(exports, "isEnumType", { enumerable: true, get: function () { return index_ts_1.isEnumType; } }); +Object.defineProperty(exports, "isEnumValue", { enumerable: true, get: function () { return index_ts_1.isEnumValue; } }); +Object.defineProperty(exports, "isInputObjectType", { enumerable: true, get: function () { return index_ts_1.isInputObjectType; } }); +Object.defineProperty(exports, "isInputField", { enumerable: true, get: function () { return index_ts_1.isInputField; } }); +Object.defineProperty(exports, "isListType", { enumerable: true, get: function () { return index_ts_1.isListType; } }); +Object.defineProperty(exports, "isNonNullType", { enumerable: true, get: function () { return index_ts_1.isNonNullType; } }); +Object.defineProperty(exports, "isInputType", { enumerable: true, get: function () { return index_ts_1.isInputType; } }); +Object.defineProperty(exports, "isOutputType", { enumerable: true, get: function () { return index_ts_1.isOutputType; } }); +Object.defineProperty(exports, "isLeafType", { enumerable: true, get: function () { return index_ts_1.isLeafType; } }); +Object.defineProperty(exports, "isCompositeType", { enumerable: true, get: function () { return index_ts_1.isCompositeType; } }); +Object.defineProperty(exports, "isAbstractType", { enumerable: true, get: function () { return index_ts_1.isAbstractType; } }); +Object.defineProperty(exports, "isWrappingType", { enumerable: true, get: function () { return index_ts_1.isWrappingType; } }); +Object.defineProperty(exports, "isNullableType", { enumerable: true, get: function () { return index_ts_1.isNullableType; } }); +Object.defineProperty(exports, "isNamedType", { enumerable: true, get: function () { return index_ts_1.isNamedType; } }); +Object.defineProperty(exports, "isRequiredArgument", { enumerable: true, get: function () { return index_ts_1.isRequiredArgument; } }); +Object.defineProperty(exports, "isRequiredInputField", { enumerable: true, get: function () { return index_ts_1.isRequiredInputField; } }); +Object.defineProperty(exports, "isSpecifiedScalarType", { enumerable: true, get: function () { return index_ts_1.isSpecifiedScalarType; } }); +Object.defineProperty(exports, "isIntrospectionType", { enumerable: true, get: function () { return index_ts_1.isIntrospectionType; } }); +Object.defineProperty(exports, "isSpecifiedDirective", { enumerable: true, get: function () { return index_ts_1.isSpecifiedDirective; } }); +Object.defineProperty(exports, "assertSchema", { enumerable: true, get: function () { return index_ts_1.assertSchema; } }); +Object.defineProperty(exports, "assertDirective", { enumerable: true, get: function () { return index_ts_1.assertDirective; } }); +Object.defineProperty(exports, "assertType", { enumerable: true, get: function () { return index_ts_1.assertType; } }); +Object.defineProperty(exports, "assertScalarType", { enumerable: true, get: function () { return index_ts_1.assertScalarType; } }); +Object.defineProperty(exports, "assertObjectType", { enumerable: true, get: function () { return index_ts_1.assertObjectType; } }); +Object.defineProperty(exports, "assertField", { enumerable: true, get: function () { return index_ts_1.assertField; } }); +Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_ts_1.assertArgument; } }); +Object.defineProperty(exports, "assertInterfaceType", { enumerable: true, get: function () { return index_ts_1.assertInterfaceType; } }); +Object.defineProperty(exports, "assertUnionType", { enumerable: true, get: function () { return index_ts_1.assertUnionType; } }); +Object.defineProperty(exports, "assertEnumType", { enumerable: true, get: function () { return index_ts_1.assertEnumType; } }); +Object.defineProperty(exports, "assertEnumValue", { enumerable: true, get: function () { return index_ts_1.assertEnumValue; } }); +Object.defineProperty(exports, "assertInputObjectType", { enumerable: true, get: function () { return index_ts_1.assertInputObjectType; } }); +Object.defineProperty(exports, "assertInputField", { enumerable: true, get: function () { return index_ts_1.assertInputField; } }); +Object.defineProperty(exports, "assertListType", { enumerable: true, get: function () { return index_ts_1.assertListType; } }); +Object.defineProperty(exports, "assertNonNullType", { enumerable: true, get: function () { return index_ts_1.assertNonNullType; } }); +Object.defineProperty(exports, "assertInputType", { enumerable: true, get: function () { return index_ts_1.assertInputType; } }); +Object.defineProperty(exports, "assertOutputType", { enumerable: true, get: function () { return index_ts_1.assertOutputType; } }); +Object.defineProperty(exports, "assertLeafType", { enumerable: true, get: function () { return index_ts_1.assertLeafType; } }); +Object.defineProperty(exports, "assertCompositeType", { enumerable: true, get: function () { return index_ts_1.assertCompositeType; } }); +Object.defineProperty(exports, "assertAbstractType", { enumerable: true, get: function () { return index_ts_1.assertAbstractType; } }); +Object.defineProperty(exports, "assertWrappingType", { enumerable: true, get: function () { return index_ts_1.assertWrappingType; } }); +Object.defineProperty(exports, "assertNullableType", { enumerable: true, get: function () { return index_ts_1.assertNullableType; } }); +Object.defineProperty(exports, "assertNamedType", { enumerable: true, get: function () { return index_ts_1.assertNamedType; } }); +Object.defineProperty(exports, "getNullableType", { enumerable: true, get: function () { return index_ts_1.getNullableType; } }); +Object.defineProperty(exports, "getNamedType", { enumerable: true, get: function () { return index_ts_1.getNamedType; } }); +Object.defineProperty(exports, "validateSchema", { enumerable: true, get: function () { return index_ts_1.validateSchema; } }); +Object.defineProperty(exports, "assertValidSchema", { enumerable: true, get: function () { return index_ts_1.assertValidSchema; } }); +Object.defineProperty(exports, "assertName", { enumerable: true, get: function () { return index_ts_1.assertName; } }); +Object.defineProperty(exports, "assertEnumValueName", { enumerable: true, get: function () { return index_ts_1.assertEnumValueName; } }); +var kinds_ts_1 = require("./language/kinds.js"); +Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return kinds_ts_1.Kind; } }); +var index_ts_2 = require("./language/index.js"); +Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return index_ts_2.Token; } }); +Object.defineProperty(exports, "Source", { enumerable: true, get: function () { return index_ts_2.Source; } }); +Object.defineProperty(exports, "Location", { enumerable: true, get: function () { return index_ts_2.Location; } }); +Object.defineProperty(exports, "OperationTypeNode", { enumerable: true, get: function () { return index_ts_2.OperationTypeNode; } }); +Object.defineProperty(exports, "getLocation", { enumerable: true, get: function () { return index_ts_2.getLocation; } }); +Object.defineProperty(exports, "printLocation", { enumerable: true, get: function () { return index_ts_2.printLocation; } }); +Object.defineProperty(exports, "printSourceLocation", { enumerable: true, get: function () { return index_ts_2.printSourceLocation; } }); +Object.defineProperty(exports, "Lexer", { enumerable: true, get: function () { return index_ts_2.Lexer; } }); +Object.defineProperty(exports, "TokenKind", { enumerable: true, get: function () { return index_ts_2.TokenKind; } }); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return index_ts_2.parse; } }); +Object.defineProperty(exports, "parseValue", { enumerable: true, get: function () { return index_ts_2.parseValue; } }); +Object.defineProperty(exports, "parseConstValue", { enumerable: true, get: function () { return index_ts_2.parseConstValue; } }); +Object.defineProperty(exports, "parseType", { enumerable: true, get: function () { return index_ts_2.parseType; } }); +Object.defineProperty(exports, "parseSchemaCoordinate", { enumerable: true, get: function () { return index_ts_2.parseSchemaCoordinate; } }); +Object.defineProperty(exports, "print", { enumerable: true, get: function () { return index_ts_2.print; } }); +Object.defineProperty(exports, "visit", { enumerable: true, get: function () { return index_ts_2.visit; } }); +Object.defineProperty(exports, "visitInParallel", { enumerable: true, get: function () { return index_ts_2.visitInParallel; } }); +Object.defineProperty(exports, "getEnterLeaveForKind", { enumerable: true, get: function () { return index_ts_2.getEnterLeaveForKind; } }); +Object.defineProperty(exports, "BREAK", { enumerable: true, get: function () { return index_ts_2.BREAK; } }); +Object.defineProperty(exports, "DirectiveLocation", { enumerable: true, get: function () { return index_ts_2.DirectiveLocation; } }); +Object.defineProperty(exports, "isDefinitionNode", { enumerable: true, get: function () { return index_ts_2.isDefinitionNode; } }); +Object.defineProperty(exports, "isExecutableDefinitionNode", { enumerable: true, get: function () { return index_ts_2.isExecutableDefinitionNode; } }); +Object.defineProperty(exports, "isSelectionNode", { enumerable: true, get: function () { return index_ts_2.isSelectionNode; } }); +Object.defineProperty(exports, "isValueNode", { enumerable: true, get: function () { return index_ts_2.isValueNode; } }); +Object.defineProperty(exports, "isConstValueNode", { enumerable: true, get: function () { return index_ts_2.isConstValueNode; } }); +Object.defineProperty(exports, "isTypeNode", { enumerable: true, get: function () { return index_ts_2.isTypeNode; } }); +Object.defineProperty(exports, "isTypeSystemDefinitionNode", { enumerable: true, get: function () { return index_ts_2.isTypeSystemDefinitionNode; } }); +Object.defineProperty(exports, "isTypeDefinitionNode", { enumerable: true, get: function () { return index_ts_2.isTypeDefinitionNode; } }); +Object.defineProperty(exports, "isTypeSystemExtensionNode", { enumerable: true, get: function () { return index_ts_2.isTypeSystemExtensionNode; } }); +Object.defineProperty(exports, "isTypeExtensionNode", { enumerable: true, get: function () { return index_ts_2.isTypeExtensionNode; } }); +Object.defineProperty(exports, "isSchemaCoordinateNode", { enumerable: true, get: function () { return index_ts_2.isSchemaCoordinateNode; } }); +Object.defineProperty(exports, "isSubscriptionOperationDefinitionNode", { enumerable: true, get: function () { return index_ts_2.isSubscriptionOperationDefinitionNode; } }); +var index_ts_3 = require("./execution/index.js"); +Object.defineProperty(exports, "AbortedGraphQLExecutionError", { enumerable: true, get: function () { return index_ts_3.AbortedGraphQLExecutionError; } }); +Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return index_ts_3.execute; } }); +Object.defineProperty(exports, "executeRootSelectionSet", { enumerable: true, get: function () { return index_ts_3.executeRootSelectionSet; } }); +Object.defineProperty(exports, "executeSubscriptionEvent", { enumerable: true, get: function () { return index_ts_3.executeSubscriptionEvent; } }); +Object.defineProperty(exports, "experimentalExecuteIncrementally", { enumerable: true, get: function () { return index_ts_3.experimentalExecuteIncrementally; } }); +Object.defineProperty(exports, "experimentalExecuteRootSelectionSet", { enumerable: true, get: function () { return index_ts_3.experimentalExecuteRootSelectionSet; } }); +Object.defineProperty(exports, "legacyExecuteIncrementally", { enumerable: true, get: function () { return index_ts_3.legacyExecuteIncrementally; } }); +Object.defineProperty(exports, "legacyExecuteRootSelectionSet", { enumerable: true, get: function () { return index_ts_3.legacyExecuteRootSelectionSet; } }); +Object.defineProperty(exports, "executeSync", { enumerable: true, get: function () { return index_ts_3.executeSync; } }); +Object.defineProperty(exports, "defaultFieldResolver", { enumerable: true, get: function () { return index_ts_3.defaultFieldResolver; } }); +Object.defineProperty(exports, "defaultTypeResolver", { enumerable: true, get: function () { return index_ts_3.defaultTypeResolver; } }); +Object.defineProperty(exports, "responsePathAsArray", { enumerable: true, get: function () { return index_ts_3.responsePathAsArray; } }); +Object.defineProperty(exports, "getArgumentValues", { enumerable: true, get: function () { return index_ts_3.getArgumentValues; } }); +Object.defineProperty(exports, "getVariableValues", { enumerable: true, get: function () { return index_ts_3.getVariableValues; } }); +Object.defineProperty(exports, "getDirectiveValues", { enumerable: true, get: function () { return index_ts_3.getDirectiveValues; } }); +Object.defineProperty(exports, "subscribe", { enumerable: true, get: function () { return index_ts_3.subscribe; } }); +Object.defineProperty(exports, "createSourceEventStream", { enumerable: true, get: function () { return index_ts_3.createSourceEventStream; } }); +Object.defineProperty(exports, "mapSourceToResponseEvent", { enumerable: true, get: function () { return index_ts_3.mapSourceToResponseEvent; } }); +Object.defineProperty(exports, "validateExecutionArgs", { enumerable: true, get: function () { return index_ts_3.validateExecutionArgs; } }); +Object.defineProperty(exports, "validateSubscriptionArgs", { enumerable: true, get: function () { return index_ts_3.validateSubscriptionArgs; } }); +var index_ts_4 = require("./validation/index.js"); +Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return index_ts_4.validate; } }); +Object.defineProperty(exports, "ValidationContext", { enumerable: true, get: function () { return index_ts_4.ValidationContext; } }); +Object.defineProperty(exports, "specifiedRules", { enumerable: true, get: function () { return index_ts_4.specifiedRules; } }); +Object.defineProperty(exports, "recommendedRules", { enumerable: true, get: function () { return index_ts_4.recommendedRules; } }); +Object.defineProperty(exports, "DeferStreamDirectiveLabelRule", { enumerable: true, get: function () { return index_ts_4.DeferStreamDirectiveLabelRule; } }); +Object.defineProperty(exports, "DeferStreamDirectiveOnRootFieldRule", { enumerable: true, get: function () { return index_ts_4.DeferStreamDirectiveOnRootFieldRule; } }); +Object.defineProperty(exports, "DeferStreamDirectiveOnValidOperationsRule", { enumerable: true, get: function () { return index_ts_4.DeferStreamDirectiveOnValidOperationsRule; } }); +Object.defineProperty(exports, "ExecutableDefinitionsRule", { enumerable: true, get: function () { return index_ts_4.ExecutableDefinitionsRule; } }); +Object.defineProperty(exports, "FieldsOnCorrectTypeRule", { enumerable: true, get: function () { return index_ts_4.FieldsOnCorrectTypeRule; } }); +Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", { enumerable: true, get: function () { return index_ts_4.FragmentsOnCompositeTypesRule; } }); +Object.defineProperty(exports, "KnownArgumentNamesRule", { enumerable: true, get: function () { return index_ts_4.KnownArgumentNamesRule; } }); +Object.defineProperty(exports, "KnownDirectivesRule", { enumerable: true, get: function () { return index_ts_4.KnownDirectivesRule; } }); +Object.defineProperty(exports, "KnownFragmentNamesRule", { enumerable: true, get: function () { return index_ts_4.KnownFragmentNamesRule; } }); +Object.defineProperty(exports, "KnownOperationTypesRule", { enumerable: true, get: function () { return index_ts_4.KnownOperationTypesRule; } }); +Object.defineProperty(exports, "KnownTypeNamesRule", { enumerable: true, get: function () { return index_ts_4.KnownTypeNamesRule; } }); +Object.defineProperty(exports, "LoneAnonymousOperationRule", { enumerable: true, get: function () { return index_ts_4.LoneAnonymousOperationRule; } }); +Object.defineProperty(exports, "NoFragmentCyclesRule", { enumerable: true, get: function () { return index_ts_4.NoFragmentCyclesRule; } }); +Object.defineProperty(exports, "NoUndefinedVariablesRule", { enumerable: true, get: function () { return index_ts_4.NoUndefinedVariablesRule; } }); +Object.defineProperty(exports, "NoUnusedFragmentsRule", { enumerable: true, get: function () { return index_ts_4.NoUnusedFragmentsRule; } }); +Object.defineProperty(exports, "NoUnusedVariablesRule", { enumerable: true, get: function () { return index_ts_4.NoUnusedVariablesRule; } }); +Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", { enumerable: true, get: function () { return index_ts_4.OverlappingFieldsCanBeMergedRule; } }); +Object.defineProperty(exports, "PossibleFragmentSpreadsRule", { enumerable: true, get: function () { return index_ts_4.PossibleFragmentSpreadsRule; } }); +Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", { enumerable: true, get: function () { return index_ts_4.ProvidedRequiredArgumentsRule; } }); +Object.defineProperty(exports, "ScalarLeafsRule", { enumerable: true, get: function () { return index_ts_4.ScalarLeafsRule; } }); +Object.defineProperty(exports, "SingleFieldSubscriptionsRule", { enumerable: true, get: function () { return index_ts_4.SingleFieldSubscriptionsRule; } }); +Object.defineProperty(exports, "StreamDirectiveOnListFieldRule", { enumerable: true, get: function () { return index_ts_4.StreamDirectiveOnListFieldRule; } }); +Object.defineProperty(exports, "UniqueArgumentNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueArgumentNamesRule; } }); +Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", { enumerable: true, get: function () { return index_ts_4.UniqueDirectivesPerLocationRule; } }); +Object.defineProperty(exports, "UniqueFragmentNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueFragmentNamesRule; } }); +Object.defineProperty(exports, "UniqueInputFieldNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueInputFieldNamesRule; } }); +Object.defineProperty(exports, "UniqueOperationNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueOperationNamesRule; } }); +Object.defineProperty(exports, "UniqueVariableNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueVariableNamesRule; } }); +Object.defineProperty(exports, "ValuesOfCorrectTypeRule", { enumerable: true, get: function () { return index_ts_4.ValuesOfCorrectTypeRule; } }); +Object.defineProperty(exports, "VariablesAreInputTypesRule", { enumerable: true, get: function () { return index_ts_4.VariablesAreInputTypesRule; } }); +Object.defineProperty(exports, "VariablesInAllowedPositionRule", { enumerable: true, get: function () { return index_ts_4.VariablesInAllowedPositionRule; } }); +Object.defineProperty(exports, "MaxIntrospectionDepthRule", { enumerable: true, get: function () { return index_ts_4.MaxIntrospectionDepthRule; } }); +Object.defineProperty(exports, "LoneSchemaDefinitionRule", { enumerable: true, get: function () { return index_ts_4.LoneSchemaDefinitionRule; } }); +Object.defineProperty(exports, "UniqueOperationTypesRule", { enumerable: true, get: function () { return index_ts_4.UniqueOperationTypesRule; } }); +Object.defineProperty(exports, "UniqueTypeNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueTypeNamesRule; } }); +Object.defineProperty(exports, "UniqueEnumValueNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueEnumValueNamesRule; } }); +Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueFieldDefinitionNamesRule; } }); +Object.defineProperty(exports, "UniqueArgumentDefinitionNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueArgumentDefinitionNamesRule; } }); +Object.defineProperty(exports, "UniqueDirectiveNamesRule", { enumerable: true, get: function () { return index_ts_4.UniqueDirectiveNamesRule; } }); +Object.defineProperty(exports, "PossibleTypeExtensionsRule", { enumerable: true, get: function () { return index_ts_4.PossibleTypeExtensionsRule; } }); +Object.defineProperty(exports, "NoDeprecatedCustomRule", { enumerable: true, get: function () { return index_ts_4.NoDeprecatedCustomRule; } }); +Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", { enumerable: true, get: function () { return index_ts_4.NoSchemaIntrospectionCustomRule; } }); +var index_ts_5 = require("./error/index.js"); +Object.defineProperty(exports, "GraphQLError", { enumerable: true, get: function () { return index_ts_5.GraphQLError; } }); +Object.defineProperty(exports, "syntaxError", { enumerable: true, get: function () { return index_ts_5.syntaxError; } }); +Object.defineProperty(exports, "locatedError", { enumerable: true, get: function () { return index_ts_5.locatedError; } }); +var index_ts_6 = require("./utilities/index.js"); +Object.defineProperty(exports, "getIntrospectionQuery", { enumerable: true, get: function () { return index_ts_6.getIntrospectionQuery; } }); +Object.defineProperty(exports, "getOperationAST", { enumerable: true, get: function () { return index_ts_6.getOperationAST; } }); +Object.defineProperty(exports, "introspectionFromSchema", { enumerable: true, get: function () { return index_ts_6.introspectionFromSchema; } }); +Object.defineProperty(exports, "buildClientSchema", { enumerable: true, get: function () { return index_ts_6.buildClientSchema; } }); +Object.defineProperty(exports, "buildASTSchema", { enumerable: true, get: function () { return index_ts_6.buildASTSchema; } }); +Object.defineProperty(exports, "buildSchema", { enumerable: true, get: function () { return index_ts_6.buildSchema; } }); +Object.defineProperty(exports, "extendSchema", { enumerable: true, get: function () { return index_ts_6.extendSchema; } }); +Object.defineProperty(exports, "lexicographicSortSchema", { enumerable: true, get: function () { return index_ts_6.lexicographicSortSchema; } }); +Object.defineProperty(exports, "printSchema", { enumerable: true, get: function () { return index_ts_6.printSchema; } }); +Object.defineProperty(exports, "printType", { enumerable: true, get: function () { return index_ts_6.printType; } }); +Object.defineProperty(exports, "printDirective", { enumerable: true, get: function () { return index_ts_6.printDirective; } }); +Object.defineProperty(exports, "printIntrospectionSchema", { enumerable: true, get: function () { return index_ts_6.printIntrospectionSchema; } }); +Object.defineProperty(exports, "typeFromAST", { enumerable: true, get: function () { return index_ts_6.typeFromAST; } }); +Object.defineProperty(exports, "valueFromAST", { enumerable: true, get: function () { return index_ts_6.valueFromAST; } }); +Object.defineProperty(exports, "valueFromASTUntyped", { enumerable: true, get: function () { return index_ts_6.valueFromASTUntyped; } }); +Object.defineProperty(exports, "astFromValue", { enumerable: true, get: function () { return index_ts_6.astFromValue; } }); +Object.defineProperty(exports, "TypeInfo", { enumerable: true, get: function () { return index_ts_6.TypeInfo; } }); +Object.defineProperty(exports, "visitWithTypeInfo", { enumerable: true, get: function () { return index_ts_6.visitWithTypeInfo; } }); +Object.defineProperty(exports, "replaceVariables", { enumerable: true, get: function () { return index_ts_6.replaceVariables; } }); +Object.defineProperty(exports, "valueToLiteral", { enumerable: true, get: function () { return index_ts_6.valueToLiteral; } }); +Object.defineProperty(exports, "coerceInputValue", { enumerable: true, get: function () { return index_ts_6.coerceInputValue; } }); +Object.defineProperty(exports, "coerceInputLiteral", { enumerable: true, get: function () { return index_ts_6.coerceInputLiteral; } }); +Object.defineProperty(exports, "validateInputValue", { enumerable: true, get: function () { return index_ts_6.validateInputValue; } }); +Object.defineProperty(exports, "validateInputLiteral", { enumerable: true, get: function () { return index_ts_6.validateInputLiteral; } }); +Object.defineProperty(exports, "concatAST", { enumerable: true, get: function () { return index_ts_6.concatAST; } }); +Object.defineProperty(exports, "separateOperations", { enumerable: true, get: function () { return index_ts_6.separateOperations; } }); +Object.defineProperty(exports, "stripIgnoredCharacters", { enumerable: true, get: function () { return index_ts_6.stripIgnoredCharacters; } }); +Object.defineProperty(exports, "isEqualType", { enumerable: true, get: function () { return index_ts_6.isEqualType; } }); +Object.defineProperty(exports, "isTypeSubTypeOf", { enumerable: true, get: function () { return index_ts_6.isTypeSubTypeOf; } }); +Object.defineProperty(exports, "doTypesOverlap", { enumerable: true, get: function () { return index_ts_6.doTypesOverlap; } }); +Object.defineProperty(exports, "BreakingChangeType", { enumerable: true, get: function () { return index_ts_6.BreakingChangeType; } }); +Object.defineProperty(exports, "DangerousChangeType", { enumerable: true, get: function () { return index_ts_6.DangerousChangeType; } }); +Object.defineProperty(exports, "SafeChangeType", { enumerable: true, get: function () { return index_ts_6.SafeChangeType; } }); +Object.defineProperty(exports, "findBreakingChanges", { enumerable: true, get: function () { return index_ts_6.findBreakingChanges; } }); +Object.defineProperty(exports, "findDangerousChanges", { enumerable: true, get: function () { return index_ts_6.findDangerousChanges; } }); +Object.defineProperty(exports, "findSchemaChanges", { enumerable: true, get: function () { return index_ts_6.findSchemaChanges; } }); +Object.defineProperty(exports, "resolveSchemaCoordinate", { enumerable: true, get: function () { return index_ts_6.resolveSchemaCoordinate; } }); +Object.defineProperty(exports, "resolveASTSchemaCoordinate", { enumerable: true, get: function () { return index_ts_6.resolveASTSchemaCoordinate; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js.map new file mode 100644 index 00000000..a15df518 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAuBA,2CAAoD;AAA3C,qGAAA,OAAO,OAAA;AAAE,yGAAA,WA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,cAAc,OAAA;AAEd,4GAAA,gBAAgB,OAAA;AAEhB,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAElB,gHAAA,oBAAoB,OAAA;AAEpB,qGAAA,SAAS,OAAA;AAET,8GAAA,kBAAkB,OAAA;AAElB,kHAAA,sBAAsB,OAAA;AAEtB,uGAAA,WAAW,OAAA;AACX,2GAAA,eAAe,OAAA;AACf,0GAAA,cAAc,OAAA;AAEd,8GAAA,kBAAkB,OAAA;AAClB,+GAAA,mBAAmB,OAAA;AACnB,0GAAA,cAAc,OAAA;AACd,+GAAA,mBAAmB,OAAA;AACnB,gHAAA,oBAAoB,OAAA;AACpB,6GAAA,iBAAiB,OAAA;AACjB,mHAAA,uBAAuB,OAAA;AACvB,sHAAA,0BAA0B,OAAA","sourcesContent":["/**\n * The root `graphql` package re-exports the public GraphQL.js API from its\n * submodules and provides the high-level request pipeline helpers defined in\n * this module.\n *\n * You can import public exports from GraphQL.js modules through the root\n * `graphql` package or through their module-specific entry point. For example,\n * these two references resolve to the same `parse` function:\n *\n * ```ts\n * import { parse } from 'graphql';\n * import { parse } from 'graphql/language';\n * ```\n *\n * Use the root package when you want a single import surface, or use submodules\n * such as `graphql/language`, `graphql/type`, `graphql/execution`, and\n * `graphql/utilities` when you want module-focused imports. This module also\n * defines root-only APIs, such as request pipeline helpers and version\n * metadata, that do not belong to a narrower submodule.\n * @packageDocumentation\n */\n\n// The GraphQL.js version info.\nexport { version, versionInfo } from './version.ts';\n\n// Enable development mode for additional checks.\nexport { enableDevMode, isDevModeEnabled } from './devMode.ts';\n\n// Tracing channel types for subscribers that want to strongly type the\n// `graphql:*` channel context payloads. Channels are auto-registered on\n// `node:diagnostics_channel` at module load.\nexport type {\n GraphQLChannelContextByName,\n GraphQLChannels,\n GraphQLExecuteContext,\n GraphQLExecuteRootSelectionSetContext,\n GraphQLExecuteVariableCoercionContext,\n GraphQLParseContext,\n GraphQLResolveContext,\n GraphQLSubscribeContext,\n GraphQLValidateContext,\n} from './diagnostics.ts';\n\n// The primary entry point into fulfilling a GraphQL request.\nexport type { GraphQLArgs } from './graphql.ts';\nexport { graphql, graphqlSync } from './graphql.ts';\n\n// The default versions of the parse/validate/execute/subscribe harness used by `graphql` and `graphqlSync`.\nexport { defaultHarness } from './harness.ts';\nexport type {\n GraphQLHarness,\n GraphQLParseFn,\n GraphQLValidateFn,\n GraphQLExecuteFn,\n GraphQLSubscribeFn,\n} from './harness.ts';\n\n// Create and operate on GraphQL type definitions and schema.\nexport type {\n GraphQLField,\n GraphQLArgument,\n GraphQLEnumValue,\n GraphQLInputField,\n} from './type/index.ts';\nexport {\n resolveObjMapThunk,\n resolveReadonlyArrayThunk,\n // Definitions\n GraphQLSchema,\n GraphQLDirective,\n GraphQLScalarType,\n GraphQLObjectType,\n GraphQLInterfaceType,\n GraphQLUnionType,\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLList,\n GraphQLNonNull,\n // Standard GraphQL Scalars\n specifiedScalarTypes,\n GraphQLInt,\n GraphQLFloat,\n GraphQLString,\n GraphQLBoolean,\n GraphQLID,\n // Int boundaries constants\n GRAPHQL_MAX_INT,\n GRAPHQL_MIN_INT,\n // Built-in Directives defined by the Spec\n specifiedDirectives,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n // \"Enum\" of Type Kinds\n TypeKind,\n // Constant Deprecation Reason\n DEFAULT_DEPRECATION_REASON,\n // GraphQL Types for introspection.\n introspectionTypes,\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n // Meta-field definitions.\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n // Predicates\n isSchema,\n isDirective,\n isType,\n isScalarType,\n isObjectType,\n isField,\n isArgument,\n isInterfaceType,\n isUnionType,\n isEnumType,\n isEnumValue,\n isInputObjectType,\n isInputField,\n isListType,\n isNonNullType,\n isInputType,\n isOutputType,\n isLeafType,\n isCompositeType,\n isAbstractType,\n isWrappingType,\n isNullableType,\n isNamedType,\n isRequiredArgument,\n isRequiredInputField,\n isSpecifiedScalarType,\n isIntrospectionType,\n isSpecifiedDirective,\n // Assertions\n assertSchema,\n assertDirective,\n assertType,\n assertScalarType,\n assertObjectType,\n assertField,\n assertArgument,\n assertInterfaceType,\n assertUnionType,\n assertEnumType,\n assertEnumValue,\n assertInputObjectType,\n assertInputField,\n assertListType,\n assertNonNullType,\n assertInputType,\n assertOutputType,\n assertLeafType,\n assertCompositeType,\n assertAbstractType,\n assertWrappingType,\n assertNullableType,\n assertNamedType,\n // Un-modifiers\n getNullableType,\n getNamedType,\n // Validate GraphQL schema.\n validateSchema,\n assertValidSchema,\n // Upholds the spec rules about naming.\n assertName,\n assertEnumValueName,\n} from './type/index.ts';\n\nexport type {\n GraphQLType,\n GraphQLInputType,\n GraphQLOutputType,\n GraphQLLeafType,\n GraphQLCompositeType,\n GraphQLAbstractType,\n GraphQLWrappingType,\n GraphQLNullableType,\n GraphQLNullableInputType,\n GraphQLNullableOutputType,\n GraphQLNamedType,\n GraphQLNamedInputType,\n GraphQLNamedOutputType,\n ThunkReadonlyArray,\n ThunkObjMap,\n GraphQLSchemaConfig,\n GraphQLSchemaExtensions,\n GraphQLDirectiveConfig,\n GraphQLDirectiveExtensions,\n GraphQLArgumentConfig,\n GraphQLArgumentExtensions,\n GraphQLEnumTypeConfig,\n GraphQLEnumTypeExtensions,\n GraphQLEnumValueConfig,\n GraphQLEnumValueConfigMap,\n GraphQLEnumValueExtensions,\n GraphQLFieldConfig,\n GraphQLFieldConfigArgumentMap,\n GraphQLFieldConfigMap,\n GraphQLFieldExtensions,\n GraphQLFieldMap,\n GraphQLFieldResolver,\n GraphQLInputFieldConfig,\n GraphQLInputFieldConfigMap,\n GraphQLInputFieldExtensions,\n GraphQLInputFieldMap,\n GraphQLInputObjectTypeConfig,\n GraphQLInputObjectTypeExtensions,\n GraphQLInterfaceTypeConfig,\n GraphQLInterfaceTypeExtensions,\n GraphQLIsTypeOfFn,\n GraphQLObjectTypeConfig,\n GraphQLObjectTypeExtensions,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n ResponsePath,\n GraphQLScalarTypeConfig,\n GraphQLScalarTypeExtensions,\n GraphQLTypeResolver,\n GraphQLUnionTypeConfig,\n GraphQLUnionTypeExtensions,\n GraphQLScalarSerializer,\n GraphQLScalarValueParser,\n GraphQLScalarLiteralParser,\n GraphQLScalarOutputValueCoercer,\n GraphQLScalarInputValueCoercer,\n GraphQLScalarInputLiteralCoercer,\n GraphQLDefaultInput,\n} from './type/index.ts';\n\n// Parse and operate on GraphQL language source files.\n// @see https://github.com/typescript-eslint/typescript-eslint/issues/10313\n// Deno misclassifies this merged value+type re-export and requires `export type`.\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore TS1205\n\nexport { Kind } from './language/kinds.ts';\n\nexport {\n Token,\n Source,\n Location,\n OperationTypeNode,\n getLocation,\n // Print source location.\n printLocation,\n printSourceLocation,\n // Lex\n Lexer,\n TokenKind,\n // Parse\n parse,\n parseValue,\n parseConstValue,\n parseType,\n parseSchemaCoordinate,\n // Print\n print,\n // Visit\n visit,\n visitInParallel,\n getEnterLeaveForKind,\n BREAK,\n DirectiveLocation,\n // Predicates\n isDefinitionNode,\n isExecutableDefinitionNode,\n isSelectionNode,\n isValueNode,\n isConstValueNode,\n isTypeNode,\n isTypeSystemDefinitionNode,\n isTypeDefinitionNode,\n isTypeSystemExtensionNode,\n isTypeExtensionNode,\n isSchemaCoordinateNode,\n isSubscriptionOperationDefinitionNode,\n} from './language/index.ts';\n\nexport type {\n ParseOptions,\n SourceLocation,\n // Visitor utilities\n ASTVisitor,\n ASTVisitFn,\n ASTVisitorKeyMap,\n // AST nodes\n ASTNode,\n ASTKindToNode,\n // Each kind of AST node\n NameNode,\n DocumentNode,\n DefinitionNode,\n ExecutableDefinitionNode,\n OperationDefinitionNode,\n SubscriptionOperationDefinitionNode,\n VariableDefinitionNode,\n VariableNode,\n SelectionSetNode,\n SelectionNode,\n FieldNode,\n ArgumentNode,\n FragmentArgumentNode,\n ConstArgumentNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n ValueNode,\n ConstValueNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n NullValueNode,\n EnumValueNode,\n ListValueNode,\n ConstListValueNode,\n ObjectValueNode,\n ConstObjectValueNode,\n ObjectFieldNode,\n ConstObjectFieldNode,\n DirectiveNode,\n ConstDirectiveNode,\n TypeNode,\n NamedTypeNode,\n ListTypeNode,\n NonNullTypeNode,\n TypeSystemDefinitionNode,\n SchemaDefinitionNode,\n OperationTypeDefinitionNode,\n TypeDefinitionNode,\n ScalarTypeDefinitionNode,\n ObjectTypeDefinitionNode,\n FieldDefinitionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n UnionTypeDefinitionNode,\n EnumTypeDefinitionNode,\n EnumValueDefinitionNode,\n InputObjectTypeDefinitionNode,\n DirectiveDefinitionNode,\n TypeSystemExtensionNode,\n SchemaExtensionNode,\n TypeExtensionNode,\n ScalarTypeExtensionNode,\n ObjectTypeExtensionNode,\n InterfaceTypeExtensionNode,\n UnionTypeExtensionNode,\n EnumTypeExtensionNode,\n InputObjectTypeExtensionNode,\n DirectiveExtensionNode,\n SchemaCoordinateNode,\n TypeCoordinateNode,\n MemberCoordinateNode,\n ArgumentCoordinateNode,\n DirectiveCoordinateNode,\n DirectiveArgumentCoordinateNode,\n} from './language/index.ts';\n\n// Execute GraphQL queries.\nexport {\n AbortedGraphQLExecutionError,\n execute,\n executeRootSelectionSet,\n executeSubscriptionEvent,\n experimentalExecuteIncrementally,\n experimentalExecuteRootSelectionSet,\n legacyExecuteIncrementally,\n legacyExecuteRootSelectionSet,\n executeSync,\n defaultFieldResolver,\n defaultTypeResolver,\n responsePathAsArray,\n getArgumentValues,\n getVariableValues,\n getDirectiveValues,\n subscribe,\n createSourceEventStream,\n mapSourceToResponseEvent,\n validateExecutionArgs,\n validateSubscriptionArgs,\n} from './execution/index.ts';\n\nexport type {\n ExecutionArgs,\n RootSelectionSetExecutor,\n AsyncWorkFinishedInfo,\n ExecutionHooks,\n VariableValues,\n ValidatedExecutionArgs,\n ValidatedSubscriptionArgs,\n ExecutionResult,\n ExperimentalIncrementalExecutionResults,\n InitialIncrementalExecutionResult,\n SubsequentIncrementalExecutionResult,\n IncrementalDeferResult,\n IncrementalStreamResult,\n IncrementalResult,\n FormattedExecutionResult,\n FormattedExperimentalIncrementalExecutionResults,\n FormattedInitialIncrementalExecutionResult,\n FormattedSubsequentIncrementalExecutionResult,\n FormattedIncrementalDeferResult,\n FormattedIncrementalStreamResult,\n FormattedIncrementalResult,\n LegacyExperimentalIncrementalExecutionResults,\n LegacyInitialIncrementalExecutionResult,\n LegacySubsequentIncrementalExecutionResult,\n LegacyIncrementalDeferResult,\n LegacyIncrementalStreamResult,\n LegacyIncrementalResult,\n FormattedLegacyExperimentalIncrementalExecutionResults,\n FormattedLegacyInitialIncrementalExecutionResult,\n FormattedLegacySubsequentIncrementalExecutionResult,\n FormattedLegacyIncrementalDeferResult,\n FormattedLegacyIncrementalStreamResult,\n FormattedLegacyIncrementalResult,\n} from './execution/index.ts';\n\n// Validate GraphQL documents.\nexport {\n validate,\n ValidationContext,\n // All validation rules in the GraphQL Specification.\n specifiedRules,\n recommendedRules,\n // Individual validation rules.\n DeferStreamDirectiveLabelRule,\n DeferStreamDirectiveOnRootFieldRule,\n DeferStreamDirectiveOnValidOperationsRule,\n ExecutableDefinitionsRule,\n FieldsOnCorrectTypeRule,\n FragmentsOnCompositeTypesRule,\n KnownArgumentNamesRule,\n KnownDirectivesRule,\n KnownFragmentNamesRule,\n KnownOperationTypesRule,\n KnownTypeNamesRule,\n LoneAnonymousOperationRule,\n NoFragmentCyclesRule,\n NoUndefinedVariablesRule,\n NoUnusedFragmentsRule,\n NoUnusedVariablesRule,\n OverlappingFieldsCanBeMergedRule,\n PossibleFragmentSpreadsRule,\n ProvidedRequiredArgumentsRule,\n ScalarLeafsRule,\n SingleFieldSubscriptionsRule,\n StreamDirectiveOnListFieldRule,\n UniqueArgumentNamesRule,\n UniqueDirectivesPerLocationRule,\n UniqueFragmentNamesRule,\n UniqueInputFieldNamesRule,\n UniqueOperationNamesRule,\n UniqueVariableNamesRule,\n ValuesOfCorrectTypeRule,\n VariablesAreInputTypesRule,\n VariablesInAllowedPositionRule,\n MaxIntrospectionDepthRule,\n // SDL-specific validation rules\n LoneSchemaDefinitionRule,\n UniqueOperationTypesRule,\n UniqueTypeNamesRule,\n UniqueEnumValueNamesRule,\n UniqueFieldDefinitionNamesRule,\n UniqueArgumentDefinitionNamesRule,\n UniqueDirectiveNamesRule,\n PossibleTypeExtensionsRule,\n // Custom validation rules\n NoDeprecatedCustomRule,\n NoSchemaIntrospectionCustomRule,\n} from './validation/index.ts';\n\nexport type { ValidationOptions, ValidationRule } from './validation/index.ts';\n\n// Create, format, and print GraphQL errors.\nexport { GraphQLError, syntaxError, locatedError } from './error/index.ts';\n\nexport type {\n GraphQLErrorOptions,\n GraphQLFormattedError,\n GraphQLErrorExtensions,\n GraphQLFormattedErrorExtensions,\n} from './error/index.ts';\n\n// Utilities for operating on GraphQL type schema and parsed sources.\nexport {\n // Produce the GraphQL query recommended for a full schema introspection.\n // Accepts optional IntrospectionOptions.\n getIntrospectionQuery,\n // Gets the target Operation from a Document.\n getOperationAST,\n // Convert a GraphQLSchema to an IntrospectionQuery.\n introspectionFromSchema,\n // Build a GraphQLSchema from an introspection result.\n buildClientSchema,\n // Build a GraphQLSchema from a parsed GraphQL Schema language AST.\n buildASTSchema,\n // Build a GraphQLSchema from a GraphQL schema language document.\n buildSchema,\n // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.\n extendSchema,\n // Sort a GraphQLSchema.\n lexicographicSortSchema,\n // Print a GraphQLSchema to GraphQL Schema language.\n printSchema,\n // Print a GraphQLType to GraphQL Schema language.\n printType,\n // Print a GraphQLDirective to GraphQL Schema language.\n printDirective,\n // Prints the built-in introspection schema in the Schema Language format.\n printIntrospectionSchema,\n // Create a GraphQLType from a GraphQL language AST.\n typeFromAST,\n // Create a JavaScript value from a GraphQL language AST with a Type.\n /**\n * Deprecated export retained for compatibility. Use `coerceInputLiteral()`\n * instead.\n * @deprecated use `coerceInputLiteral()` instead - will be removed in v18\n */\n valueFromAST,\n // Create a JavaScript value from a GraphQL language AST without a Type.\n valueFromASTUntyped,\n // Create a GraphQL language AST from a JavaScript value.\n /**\n * Deprecated export retained for compatibility. Use `valueToLiteral()`\n * instead, and take care to operate on external values.\n * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18\n */\n astFromValue,\n // A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system.\n TypeInfo,\n visitWithTypeInfo,\n // Converts a value to a const value by replacing variables.\n replaceVariables,\n // Create a GraphQL literal (AST) from a JavaScript input value.\n valueToLiteral,\n // Coerces a JavaScript value to a GraphQL type, or returns undefined.\n coerceInputValue,\n // Coerces a GraphQL literal (AST) to a GraphQL type, or returns undefined.\n coerceInputLiteral,\n // Validate a JavaScript value with a GraphQL type, collecting all errors.\n validateInputValue,\n // Validate a GraphQL literal (AST) with a GraphQL type, collecting all errors.\n validateInputLiteral,\n // Concatenates multiple AST together.\n concatAST,\n // Separates an AST into an AST per Operation.\n separateOperations,\n // Strips characters that are not significant to the validity or execution of a GraphQL document.\n stripIgnoredCharacters,\n // Comparators for types\n isEqualType,\n isTypeSubTypeOf,\n doTypesOverlap,\n // Compares two GraphQLSchemas and detects breaking changes.\n BreakingChangeType,\n DangerousChangeType,\n SafeChangeType,\n findBreakingChanges,\n findDangerousChanges,\n findSchemaChanges,\n resolveSchemaCoordinate,\n resolveASTSchemaCoordinate,\n} from './utilities/index.ts';\n\nexport type {\n IntrospectionOptions,\n IntrospectionQuery,\n IntrospectionSchema,\n IntrospectionType,\n IntrospectionInputType,\n IntrospectionOutputType,\n IntrospectionScalarType,\n IntrospectionObjectType,\n IntrospectionInterfaceType,\n IntrospectionUnionType,\n IntrospectionEnumType,\n IntrospectionInputObjectType,\n IntrospectionTypeRef,\n IntrospectionInputTypeRef,\n IntrospectionOutputTypeRef,\n IntrospectionNamedTypeRef,\n IntrospectionListTypeRef,\n IntrospectionNonNullTypeRef,\n IntrospectionField,\n IntrospectionInputValue,\n IntrospectionEnumValue,\n IntrospectionDirective,\n BuildSchemaOptions,\n BreakingChange,\n SafeChange,\n DangerousChange,\n SchemaChange,\n TypedQueryDocumentNode,\n ResolvedSchemaElement,\n} from './utilities/index.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs new file mode 100644 index 00000000..f4ae7edc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs @@ -0,0 +1,12 @@ +export { version, versionInfo } from "./version.mjs"; +export { enableDevMode, isDevModeEnabled } from "./devMode.mjs"; +export { graphql, graphqlSync } from "./graphql.mjs"; +export { defaultHarness } from "./harness.mjs"; +export { resolveObjMapThunk, resolveReadonlyArrayThunk, GraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeferDirective, GraphQLStreamDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective, TypeKind, DEFAULT_DEPRECATION_REASON, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, isSchema, isDirective, isType, isScalarType, isObjectType, isField, isArgument, isInterfaceType, isUnionType, isEnumType, isEnumValue, isInputObjectType, isInputField, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertField, assertArgument, assertInterfaceType, assertUnionType, assertEnumType, assertEnumValue, assertInputObjectType, assertInputField, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, getNullableType, getNamedType, validateSchema, assertValidSchema, assertName, assertEnumValueName, } from "./type/index.mjs"; +export { Kind } from "./language/kinds.mjs"; +export { Token, Source, Location, OperationTypeNode, getLocation, printLocation, printSourceLocation, Lexer, TokenKind, parse, parseValue, parseConstValue, parseType, parseSchemaCoordinate, print, visit, visitInParallel, getEnterLeaveForKind, BREAK, DirectiveLocation, isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isConstValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode, isSchemaCoordinateNode, isSubscriptionOperationDefinitionNode, } from "./language/index.mjs"; +export { AbortedGraphQLExecutionError, execute, executeRootSelectionSet, executeSubscriptionEvent, experimentalExecuteIncrementally, experimentalExecuteRootSelectionSet, legacyExecuteIncrementally, legacyExecuteRootSelectionSet, executeSync, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getArgumentValues, getVariableValues, getDirectiveValues, subscribe, createSourceEventStream, mapSourceToResponseEvent, validateExecutionArgs, validateSubscriptionArgs, } from "./execution/index.mjs"; +export { validate, ValidationContext, specifiedRules, recommendedRules, DeferStreamDirectiveLabelRule, DeferStreamDirectiveOnRootFieldRule, DeferStreamDirectiveOnValidOperationsRule, ExecutableDefinitionsRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownOperationTypesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, StreamDirectiveOnListFieldRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule, MaxIntrospectionDepthRule, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueArgumentDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule, NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule, } from "./validation/index.mjs"; +export { GraphQLError, syntaxError, locatedError } from "./error/index.mjs"; +export { getIntrospectionQuery, getOperationAST, introspectionFromSchema, buildClientSchema, buildASTSchema, buildSchema, extendSchema, lexicographicSortSchema, printSchema, printType, printDirective, printIntrospectionSchema, typeFromAST, valueFromAST, valueFromASTUntyped, astFromValue, TypeInfo, visitWithTypeInfo, replaceVariables, valueToLiteral, coerceInputValue, coerceInputLiteral, validateInputValue, validateInputLiteral, concatAST, separateOperations, stripIgnoredCharacters, isEqualType, isTypeSubTypeOf, doTypesOverlap, BreakingChangeType, DangerousChangeType, SafeChangeType, findBreakingChanges, findDangerousChanges, findSchemaChanges, resolveSchemaCoordinate, resolveASTSchemaCoordinate, } from "./utilities/index.mjs"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs.map new file mode 100644 index 00000000..e2dd7839 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,sBAAqB;AAGpD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,sBAAqB;AAmB/D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,sBAAqB;AAGpD,OAAO,EAAE,cAAc,EAAE,sBAAqB;AAgB9C,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EAEzB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,cAAc,EAEd,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,SAAS,EAET,eAAe,EACf,eAAe,EAEf,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EAErB,QAAQ,EAER,0BAA0B,EAE1B,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,YAAY,EACZ,WAAW,EACX,UAAU,EAEV,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EAEpB,QAAQ,EACR,WAAW,EACX,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACX,YAAY,EAC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eAAe,EACf,cAAc,EAEd,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,GAC3B,8BAA6B","sourcesContent":["/**\n * The root `graphql` package re-exports the public GraphQL.js API from its\n * submodules and provides the high-level request pipeline helpers defined in\n * this module.\n *\n * You can import public exports from GraphQL.js modules through the root\n * `graphql` package or through their module-specific entry point. For example,\n * these two references resolve to the same `parse` function:\n *\n * ```ts\n * import { parse } from 'graphql';\n * import { parse } from 'graphql/language';\n * ```\n *\n * Use the root package when you want a single import surface, or use submodules\n * such as `graphql/language`, `graphql/type`, `graphql/execution`, and\n * `graphql/utilities` when you want module-focused imports. This module also\n * defines root-only APIs, such as request pipeline helpers and version\n * metadata, that do not belong to a narrower submodule.\n * @packageDocumentation\n */\n\n// The GraphQL.js version info.\nexport { version, versionInfo } from './version.ts';\n\n// Enable development mode for additional checks.\nexport { enableDevMode, isDevModeEnabled } from './devMode.ts';\n\n// Tracing channel types for subscribers that want to strongly type the\n// `graphql:*` channel context payloads. Channels are auto-registered on\n// `node:diagnostics_channel` at module load.\nexport type {\n GraphQLChannelContextByName,\n GraphQLChannels,\n GraphQLExecuteContext,\n GraphQLExecuteRootSelectionSetContext,\n GraphQLExecuteVariableCoercionContext,\n GraphQLParseContext,\n GraphQLResolveContext,\n GraphQLSubscribeContext,\n GraphQLValidateContext,\n} from './diagnostics.ts';\n\n// The primary entry point into fulfilling a GraphQL request.\nexport type { GraphQLArgs } from './graphql.ts';\nexport { graphql, graphqlSync } from './graphql.ts';\n\n// The default versions of the parse/validate/execute/subscribe harness used by `graphql` and `graphqlSync`.\nexport { defaultHarness } from './harness.ts';\nexport type {\n GraphQLHarness,\n GraphQLParseFn,\n GraphQLValidateFn,\n GraphQLExecuteFn,\n GraphQLSubscribeFn,\n} from './harness.ts';\n\n// Create and operate on GraphQL type definitions and schema.\nexport type {\n GraphQLField,\n GraphQLArgument,\n GraphQLEnumValue,\n GraphQLInputField,\n} from './type/index.ts';\nexport {\n resolveObjMapThunk,\n resolveReadonlyArrayThunk,\n // Definitions\n GraphQLSchema,\n GraphQLDirective,\n GraphQLScalarType,\n GraphQLObjectType,\n GraphQLInterfaceType,\n GraphQLUnionType,\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLList,\n GraphQLNonNull,\n // Standard GraphQL Scalars\n specifiedScalarTypes,\n GraphQLInt,\n GraphQLFloat,\n GraphQLString,\n GraphQLBoolean,\n GraphQLID,\n // Int boundaries constants\n GRAPHQL_MAX_INT,\n GRAPHQL_MIN_INT,\n // Built-in Directives defined by the Spec\n specifiedDirectives,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n // \"Enum\" of Type Kinds\n TypeKind,\n // Constant Deprecation Reason\n DEFAULT_DEPRECATION_REASON,\n // GraphQL Types for introspection.\n introspectionTypes,\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n // Meta-field definitions.\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n // Predicates\n isSchema,\n isDirective,\n isType,\n isScalarType,\n isObjectType,\n isField,\n isArgument,\n isInterfaceType,\n isUnionType,\n isEnumType,\n isEnumValue,\n isInputObjectType,\n isInputField,\n isListType,\n isNonNullType,\n isInputType,\n isOutputType,\n isLeafType,\n isCompositeType,\n isAbstractType,\n isWrappingType,\n isNullableType,\n isNamedType,\n isRequiredArgument,\n isRequiredInputField,\n isSpecifiedScalarType,\n isIntrospectionType,\n isSpecifiedDirective,\n // Assertions\n assertSchema,\n assertDirective,\n assertType,\n assertScalarType,\n assertObjectType,\n assertField,\n assertArgument,\n assertInterfaceType,\n assertUnionType,\n assertEnumType,\n assertEnumValue,\n assertInputObjectType,\n assertInputField,\n assertListType,\n assertNonNullType,\n assertInputType,\n assertOutputType,\n assertLeafType,\n assertCompositeType,\n assertAbstractType,\n assertWrappingType,\n assertNullableType,\n assertNamedType,\n // Un-modifiers\n getNullableType,\n getNamedType,\n // Validate GraphQL schema.\n validateSchema,\n assertValidSchema,\n // Upholds the spec rules about naming.\n assertName,\n assertEnumValueName,\n} from './type/index.ts';\n\nexport type {\n GraphQLType,\n GraphQLInputType,\n GraphQLOutputType,\n GraphQLLeafType,\n GraphQLCompositeType,\n GraphQLAbstractType,\n GraphQLWrappingType,\n GraphQLNullableType,\n GraphQLNullableInputType,\n GraphQLNullableOutputType,\n GraphQLNamedType,\n GraphQLNamedInputType,\n GraphQLNamedOutputType,\n ThunkReadonlyArray,\n ThunkObjMap,\n GraphQLSchemaConfig,\n GraphQLSchemaExtensions,\n GraphQLDirectiveConfig,\n GraphQLDirectiveExtensions,\n GraphQLArgumentConfig,\n GraphQLArgumentExtensions,\n GraphQLEnumTypeConfig,\n GraphQLEnumTypeExtensions,\n GraphQLEnumValueConfig,\n GraphQLEnumValueConfigMap,\n GraphQLEnumValueExtensions,\n GraphQLFieldConfig,\n GraphQLFieldConfigArgumentMap,\n GraphQLFieldConfigMap,\n GraphQLFieldExtensions,\n GraphQLFieldMap,\n GraphQLFieldResolver,\n GraphQLInputFieldConfig,\n GraphQLInputFieldConfigMap,\n GraphQLInputFieldExtensions,\n GraphQLInputFieldMap,\n GraphQLInputObjectTypeConfig,\n GraphQLInputObjectTypeExtensions,\n GraphQLInterfaceTypeConfig,\n GraphQLInterfaceTypeExtensions,\n GraphQLIsTypeOfFn,\n GraphQLObjectTypeConfig,\n GraphQLObjectTypeExtensions,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n ResponsePath,\n GraphQLScalarTypeConfig,\n GraphQLScalarTypeExtensions,\n GraphQLTypeResolver,\n GraphQLUnionTypeConfig,\n GraphQLUnionTypeExtensions,\n GraphQLScalarSerializer,\n GraphQLScalarValueParser,\n GraphQLScalarLiteralParser,\n GraphQLScalarOutputValueCoercer,\n GraphQLScalarInputValueCoercer,\n GraphQLScalarInputLiteralCoercer,\n GraphQLDefaultInput,\n} from './type/index.ts';\n\n// Parse and operate on GraphQL language source files.\n// @see https://github.com/typescript-eslint/typescript-eslint/issues/10313\n// Deno misclassifies this merged value+type re-export and requires `export type`.\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore TS1205\n\nexport { Kind } from './language/kinds.ts';\n\nexport {\n Token,\n Source,\n Location,\n OperationTypeNode,\n getLocation,\n // Print source location.\n printLocation,\n printSourceLocation,\n // Lex\n Lexer,\n TokenKind,\n // Parse\n parse,\n parseValue,\n parseConstValue,\n parseType,\n parseSchemaCoordinate,\n // Print\n print,\n // Visit\n visit,\n visitInParallel,\n getEnterLeaveForKind,\n BREAK,\n DirectiveLocation,\n // Predicates\n isDefinitionNode,\n isExecutableDefinitionNode,\n isSelectionNode,\n isValueNode,\n isConstValueNode,\n isTypeNode,\n isTypeSystemDefinitionNode,\n isTypeDefinitionNode,\n isTypeSystemExtensionNode,\n isTypeExtensionNode,\n isSchemaCoordinateNode,\n isSubscriptionOperationDefinitionNode,\n} from './language/index.ts';\n\nexport type {\n ParseOptions,\n SourceLocation,\n // Visitor utilities\n ASTVisitor,\n ASTVisitFn,\n ASTVisitorKeyMap,\n // AST nodes\n ASTNode,\n ASTKindToNode,\n // Each kind of AST node\n NameNode,\n DocumentNode,\n DefinitionNode,\n ExecutableDefinitionNode,\n OperationDefinitionNode,\n SubscriptionOperationDefinitionNode,\n VariableDefinitionNode,\n VariableNode,\n SelectionSetNode,\n SelectionNode,\n FieldNode,\n ArgumentNode,\n FragmentArgumentNode,\n ConstArgumentNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n ValueNode,\n ConstValueNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n NullValueNode,\n EnumValueNode,\n ListValueNode,\n ConstListValueNode,\n ObjectValueNode,\n ConstObjectValueNode,\n ObjectFieldNode,\n ConstObjectFieldNode,\n DirectiveNode,\n ConstDirectiveNode,\n TypeNode,\n NamedTypeNode,\n ListTypeNode,\n NonNullTypeNode,\n TypeSystemDefinitionNode,\n SchemaDefinitionNode,\n OperationTypeDefinitionNode,\n TypeDefinitionNode,\n ScalarTypeDefinitionNode,\n ObjectTypeDefinitionNode,\n FieldDefinitionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n UnionTypeDefinitionNode,\n EnumTypeDefinitionNode,\n EnumValueDefinitionNode,\n InputObjectTypeDefinitionNode,\n DirectiveDefinitionNode,\n TypeSystemExtensionNode,\n SchemaExtensionNode,\n TypeExtensionNode,\n ScalarTypeExtensionNode,\n ObjectTypeExtensionNode,\n InterfaceTypeExtensionNode,\n UnionTypeExtensionNode,\n EnumTypeExtensionNode,\n InputObjectTypeExtensionNode,\n DirectiveExtensionNode,\n SchemaCoordinateNode,\n TypeCoordinateNode,\n MemberCoordinateNode,\n ArgumentCoordinateNode,\n DirectiveCoordinateNode,\n DirectiveArgumentCoordinateNode,\n} from './language/index.ts';\n\n// Execute GraphQL queries.\nexport {\n AbortedGraphQLExecutionError,\n execute,\n executeRootSelectionSet,\n executeSubscriptionEvent,\n experimentalExecuteIncrementally,\n experimentalExecuteRootSelectionSet,\n legacyExecuteIncrementally,\n legacyExecuteRootSelectionSet,\n executeSync,\n defaultFieldResolver,\n defaultTypeResolver,\n responsePathAsArray,\n getArgumentValues,\n getVariableValues,\n getDirectiveValues,\n subscribe,\n createSourceEventStream,\n mapSourceToResponseEvent,\n validateExecutionArgs,\n validateSubscriptionArgs,\n} from './execution/index.ts';\n\nexport type {\n ExecutionArgs,\n RootSelectionSetExecutor,\n AsyncWorkFinishedInfo,\n ExecutionHooks,\n VariableValues,\n ValidatedExecutionArgs,\n ValidatedSubscriptionArgs,\n ExecutionResult,\n ExperimentalIncrementalExecutionResults,\n InitialIncrementalExecutionResult,\n SubsequentIncrementalExecutionResult,\n IncrementalDeferResult,\n IncrementalStreamResult,\n IncrementalResult,\n FormattedExecutionResult,\n FormattedExperimentalIncrementalExecutionResults,\n FormattedInitialIncrementalExecutionResult,\n FormattedSubsequentIncrementalExecutionResult,\n FormattedIncrementalDeferResult,\n FormattedIncrementalStreamResult,\n FormattedIncrementalResult,\n LegacyExperimentalIncrementalExecutionResults,\n LegacyInitialIncrementalExecutionResult,\n LegacySubsequentIncrementalExecutionResult,\n LegacyIncrementalDeferResult,\n LegacyIncrementalStreamResult,\n LegacyIncrementalResult,\n FormattedLegacyExperimentalIncrementalExecutionResults,\n FormattedLegacyInitialIncrementalExecutionResult,\n FormattedLegacySubsequentIncrementalExecutionResult,\n FormattedLegacyIncrementalDeferResult,\n FormattedLegacyIncrementalStreamResult,\n FormattedLegacyIncrementalResult,\n} from './execution/index.ts';\n\n// Validate GraphQL documents.\nexport {\n validate,\n ValidationContext,\n // All validation rules in the GraphQL Specification.\n specifiedRules,\n recommendedRules,\n // Individual validation rules.\n DeferStreamDirectiveLabelRule,\n DeferStreamDirectiveOnRootFieldRule,\n DeferStreamDirectiveOnValidOperationsRule,\n ExecutableDefinitionsRule,\n FieldsOnCorrectTypeRule,\n FragmentsOnCompositeTypesRule,\n KnownArgumentNamesRule,\n KnownDirectivesRule,\n KnownFragmentNamesRule,\n KnownOperationTypesRule,\n KnownTypeNamesRule,\n LoneAnonymousOperationRule,\n NoFragmentCyclesRule,\n NoUndefinedVariablesRule,\n NoUnusedFragmentsRule,\n NoUnusedVariablesRule,\n OverlappingFieldsCanBeMergedRule,\n PossibleFragmentSpreadsRule,\n ProvidedRequiredArgumentsRule,\n ScalarLeafsRule,\n SingleFieldSubscriptionsRule,\n StreamDirectiveOnListFieldRule,\n UniqueArgumentNamesRule,\n UniqueDirectivesPerLocationRule,\n UniqueFragmentNamesRule,\n UniqueInputFieldNamesRule,\n UniqueOperationNamesRule,\n UniqueVariableNamesRule,\n ValuesOfCorrectTypeRule,\n VariablesAreInputTypesRule,\n VariablesInAllowedPositionRule,\n MaxIntrospectionDepthRule,\n // SDL-specific validation rules\n LoneSchemaDefinitionRule,\n UniqueOperationTypesRule,\n UniqueTypeNamesRule,\n UniqueEnumValueNamesRule,\n UniqueFieldDefinitionNamesRule,\n UniqueArgumentDefinitionNamesRule,\n UniqueDirectiveNamesRule,\n PossibleTypeExtensionsRule,\n // Custom validation rules\n NoDeprecatedCustomRule,\n NoSchemaIntrospectionCustomRule,\n} from './validation/index.ts';\n\nexport type { ValidationOptions, ValidationRule } from './validation/index.ts';\n\n// Create, format, and print GraphQL errors.\nexport { GraphQLError, syntaxError, locatedError } from './error/index.ts';\n\nexport type {\n GraphQLErrorOptions,\n GraphQLFormattedError,\n GraphQLErrorExtensions,\n GraphQLFormattedErrorExtensions,\n} from './error/index.ts';\n\n// Utilities for operating on GraphQL type schema and parsed sources.\nexport {\n // Produce the GraphQL query recommended for a full schema introspection.\n // Accepts optional IntrospectionOptions.\n getIntrospectionQuery,\n // Gets the target Operation from a Document.\n getOperationAST,\n // Convert a GraphQLSchema to an IntrospectionQuery.\n introspectionFromSchema,\n // Build a GraphQLSchema from an introspection result.\n buildClientSchema,\n // Build a GraphQLSchema from a parsed GraphQL Schema language AST.\n buildASTSchema,\n // Build a GraphQLSchema from a GraphQL schema language document.\n buildSchema,\n // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.\n extendSchema,\n // Sort a GraphQLSchema.\n lexicographicSortSchema,\n // Print a GraphQLSchema to GraphQL Schema language.\n printSchema,\n // Print a GraphQLType to GraphQL Schema language.\n printType,\n // Print a GraphQLDirective to GraphQL Schema language.\n printDirective,\n // Prints the built-in introspection schema in the Schema Language format.\n printIntrospectionSchema,\n // Create a GraphQLType from a GraphQL language AST.\n typeFromAST,\n // Create a JavaScript value from a GraphQL language AST with a Type.\n /**\n * Deprecated export retained for compatibility. Use `coerceInputLiteral()`\n * instead.\n * @deprecated use `coerceInputLiteral()` instead - will be removed in v18\n */\n valueFromAST,\n // Create a JavaScript value from a GraphQL language AST without a Type.\n valueFromASTUntyped,\n // Create a GraphQL language AST from a JavaScript value.\n /**\n * Deprecated export retained for compatibility. Use `valueToLiteral()`\n * instead, and take care to operate on external values.\n * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18\n */\n astFromValue,\n // A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system.\n TypeInfo,\n visitWithTypeInfo,\n // Converts a value to a const value by replacing variables.\n replaceVariables,\n // Create a GraphQL literal (AST) from a JavaScript input value.\n valueToLiteral,\n // Coerces a JavaScript value to a GraphQL type, or returns undefined.\n coerceInputValue,\n // Coerces a GraphQL literal (AST) to a GraphQL type, or returns undefined.\n coerceInputLiteral,\n // Validate a JavaScript value with a GraphQL type, collecting all errors.\n validateInputValue,\n // Validate a GraphQL literal (AST) with a GraphQL type, collecting all errors.\n validateInputLiteral,\n // Concatenates multiple AST together.\n concatAST,\n // Separates an AST into an AST per Operation.\n separateOperations,\n // Strips characters that are not significant to the validity or execution of a GraphQL document.\n stripIgnoredCharacters,\n // Comparators for types\n isEqualType,\n isTypeSubTypeOf,\n doTypesOverlap,\n // Compares two GraphQLSchemas and detects breaking changes.\n BreakingChangeType,\n DangerousChangeType,\n SafeChangeType,\n findBreakingChanges,\n findDangerousChanges,\n findSchemaChanges,\n resolveSchemaCoordinate,\n resolveASTSchemaCoordinate,\n} from './utilities/index.ts';\n\nexport type {\n IntrospectionOptions,\n IntrospectionQuery,\n IntrospectionSchema,\n IntrospectionType,\n IntrospectionInputType,\n IntrospectionOutputType,\n IntrospectionScalarType,\n IntrospectionObjectType,\n IntrospectionInterfaceType,\n IntrospectionUnionType,\n IntrospectionEnumType,\n IntrospectionInputObjectType,\n IntrospectionTypeRef,\n IntrospectionInputTypeRef,\n IntrospectionOutputTypeRef,\n IntrospectionNamedTypeRef,\n IntrospectionListTypeRef,\n IntrospectionNonNullTypeRef,\n IntrospectionField,\n IntrospectionInputValue,\n IntrospectionEnumValue,\n IntrospectionDirective,\n BuildSchemaOptions,\n BreakingChange,\n SafeChange,\n DangerousChange,\n SchemaChange,\n TypedQueryDocumentNode,\n ResolvedSchemaElement,\n} from './utilities/index.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.mts new file mode 100644 index 00000000..61295f84 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.mts @@ -0,0 +1,9 @@ +/** + * ES6 Map with additional `add` method to accumulate items. + * + * @internal + */ +export declare class AccumulatorMap extends Map> { + get [Symbol.toStringTag](): string; + add(key: K, item: T): void; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.ts new file mode 100644 index 00000000..61295f84 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.d.ts @@ -0,0 +1,9 @@ +/** + * ES6 Map with additional `add` method to accumulate items. + * + * @internal + */ +export declare class AccumulatorMap extends Map> { + get [Symbol.toStringTag](): string; + add(key: K, item: T): void; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js new file mode 100644 index 00000000..3e6b6a51 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccumulatorMap = void 0; +class AccumulatorMap extends Map { + get [Symbol.toStringTag]() { + return 'AccumulatorMap'; + } + add(key, item) { + const group = this.get(key); + if (group === undefined) { + this.set(key, [item]); + } + else { + group.push(item); + } + } +} +exports.AccumulatorMap = AccumulatorMap; +//# sourceMappingURL=AccumulatorMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js.map new file mode 100644 index 00000000..b7fd79f0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AccumulatorMap.js","sourceRoot":"","sources":["../../src/jsutils/AccumulatorMap.ts"],"names":[],"mappings":";;;AAMA,MAAa,cAAqB,SAAQ,GAAgB;IACxD,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/B,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,GAAG,CAAC,GAAM,EAAE,IAAO;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAbD,wCAaC","sourcesContent":["/**\n * ES6 Map with additional `add` method to accumulate items.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\nexport class AccumulatorMap extends Map> {\n override get [Symbol.toStringTag](): string {\n return 'AccumulatorMap';\n }\n\n add(key: K, item: T): void {\n const group = this.get(key);\n if (group === undefined) {\n this.set(key, [item]);\n } else {\n group.push(item);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs new file mode 100644 index 00000000..e7f86e39 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs @@ -0,0 +1,15 @@ +export class AccumulatorMap extends Map { + get [Symbol.toStringTag]() { + return 'AccumulatorMap'; + } + add(key, item) { + const group = this.get(key); + if (group === undefined) { + this.set(key, [item]); + } + else { + group.push(item); + } + } +} +//# sourceMappingURL=AccumulatorMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs.map new file mode 100644 index 00000000..60f4f51a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/AccumulatorMap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"AccumulatorMap.js","sourceRoot":"","sources":["../../src/jsutils/AccumulatorMap.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,cAAqB,SAAQ,GAAgB;IACxD,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/B,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,GAAG,CAAC,GAAM,EAAE,IAAO;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * ES6 Map with additional `add` method to accumulate items.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\nexport class AccumulatorMap extends Map> {\n override get [Symbol.toStringTag](): string {\n return 'AccumulatorMap';\n }\n\n add(key: K, item: T): void {\n const group = this.get(key);\n if (group === undefined) {\n this.set(key, [item]);\n } else {\n group.push(item);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.mts new file mode 100644 index 00000000..db993e88 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.mts @@ -0,0 +1,6 @@ +/** + * Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/ + * + * @internal + */ +export type Maybe = null | undefined | T; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.ts new file mode 100644 index 00000000..db993e88 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.d.ts @@ -0,0 +1,6 @@ +/** + * Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/ + * + * @internal + */ +export type Maybe = null | undefined | T; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js new file mode 100644 index 00000000..52ca3476 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Maybe.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js.map new file mode 100644 index 00000000..db67e524 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Maybe.js","sourceRoot":"","sources":["../../src/jsutils/Maybe.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Conveniently represents flow's \"Maybe\" type https://flow.org/en/docs/types/maybe/\n *\n * @internal\n */\nexport type Maybe = null | undefined | T;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs new file mode 100644 index 00000000..9cdff50f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=Maybe.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs.map new file mode 100644 index 00000000..db67e524 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Maybe.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Maybe.js","sourceRoot":"","sources":["../../src/jsutils/Maybe.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Conveniently represents flow's \"Maybe\" type https://flow.org/en/docs/types/maybe/\n *\n * @internal\n */\nexport type Maybe = null | undefined | T;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.mts new file mode 100644 index 00000000..aefd9d7b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.mts @@ -0,0 +1,24 @@ +/** @internal */ +export interface ObjMap { + [key: string]: T; +} +/** @internal */ +export type ObjMapLike = ObjMap | { + [key: string]: T; +}; +/** @internal */ +export interface ReadOnlyObjMap { + readonly [key: string]: T; +} +/** @internal */ +export interface ReadOnlyObjMapWithSymbol { + readonly [key: string | symbol]: T; +} +/** @internal */ +export type ReadOnlyObjMapLike = ReadOnlyObjMap | { + readonly [key: string]: T; +}; +/** @internal */ +export type ReadOnlyObjMapSymbolLike = ReadOnlyObjMapWithSymbol | { + readonly [key: string | symbol]: T; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.ts new file mode 100644 index 00000000..aefd9d7b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.d.ts @@ -0,0 +1,24 @@ +/** @internal */ +export interface ObjMap { + [key: string]: T; +} +/** @internal */ +export type ObjMapLike = ObjMap | { + [key: string]: T; +}; +/** @internal */ +export interface ReadOnlyObjMap { + readonly [key: string]: T; +} +/** @internal */ +export interface ReadOnlyObjMapWithSymbol { + readonly [key: string | symbol]: T; +} +/** @internal */ +export type ReadOnlyObjMapLike = ReadOnlyObjMap | { + readonly [key: string]: T; +}; +/** @internal */ +export type ReadOnlyObjMapSymbolLike = ReadOnlyObjMapWithSymbol | { + readonly [key: string | symbol]: T; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js new file mode 100644 index 00000000..47124f50 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ObjMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js.map new file mode 100644 index 00000000..bb3fff7c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjMap.js","sourceRoot":"","sources":["../../src/jsutils/ObjMap.ts"],"names":[],"mappings":"","sourcesContent":["/** @internal */\nexport interface ObjMap {\n [key: string]: T;\n}\n\n/** @internal */\nexport type ObjMapLike = ObjMap | { [key: string]: T };\n\n/** @internal */\nexport interface ReadOnlyObjMap {\n readonly [key: string]: T;\n}\n\n/** @internal */\nexport interface ReadOnlyObjMapWithSymbol {\n readonly [key: string | symbol]: T;\n}\n\n/** @internal */\nexport type ReadOnlyObjMapLike =\n | ReadOnlyObjMap\n | { readonly [key: string]: T };\n\n/** @internal */\nexport type ReadOnlyObjMapSymbolLike =\n | ReadOnlyObjMapWithSymbol\n | { readonly [key: string | symbol]: T };\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs new file mode 100644 index 00000000..8df79b1d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ObjMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs.map new file mode 100644 index 00000000..bb3fff7c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/ObjMap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjMap.js","sourceRoot":"","sources":["../../src/jsutils/ObjMap.ts"],"names":[],"mappings":"","sourcesContent":["/** @internal */\nexport interface ObjMap {\n [key: string]: T;\n}\n\n/** @internal */\nexport type ObjMapLike = ObjMap | { [key: string]: T };\n\n/** @internal */\nexport interface ReadOnlyObjMap {\n readonly [key: string]: T;\n}\n\n/** @internal */\nexport interface ReadOnlyObjMapWithSymbol {\n readonly [key: string | symbol]: T;\n}\n\n/** @internal */\nexport type ReadOnlyObjMapLike =\n | ReadOnlyObjMap\n | { readonly [key: string]: T };\n\n/** @internal */\nexport type ReadOnlyObjMapSymbolLike =\n | ReadOnlyObjMapWithSymbol\n | { readonly [key: string | symbol]: T };\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.mts new file mode 100644 index 00000000..979836a3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.mts @@ -0,0 +1,44 @@ +/** @category Paths */ +import type { Maybe } from "./Maybe.mjs"; +/** Represents a linked response path from a field back to the root response. */ +export interface Path { + /** The previous segment in the linked response path, or undefined at the root. */ + readonly prev: Path | undefined; + /** The field name or list index for this response path segment. */ + readonly key: string | number; + /** The runtime object type name associated with this path segment, if known. */ + readonly typename: string | undefined; +} +/** + * Given a Path and a key, return a new Path containing the new key. + * + * @internal + */ +export declare function addPath(prev: Readonly | undefined, key: string | number, typename: string | undefined): Path; +/** + * Given a Path, return an Array of the path keys. + * @param path - The linked response path to flatten. + * @returns An array of response path keys from root to leaf. + * @example + * ```ts + * import { pathToArray } from 'graphql/jsutils/Path'; + * + * const path = { + * prev: { + * prev: { + * prev: undefined, + * key: 'viewer', + * typename: 'Query', + * }, + * key: 'friends', + * typename: 'User', + * }, + * key: 0, + * typename: undefined, + * }; + * + * pathToArray(path); // => ['viewer', 'friends', 0] + * pathToArray(undefined); // => [] + * ``` + */ +export declare function pathToArray(path: Maybe>): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.ts new file mode 100644 index 00000000..dfe8007c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.d.ts @@ -0,0 +1,44 @@ +/** @category Paths */ +import type { Maybe } from "./Maybe.js"; +/** Represents a linked response path from a field back to the root response. */ +export interface Path { + /** The previous segment in the linked response path, or undefined at the root. */ + readonly prev: Path | undefined; + /** The field name or list index for this response path segment. */ + readonly key: string | number; + /** The runtime object type name associated with this path segment, if known. */ + readonly typename: string | undefined; +} +/** + * Given a Path and a key, return a new Path containing the new key. + * + * @internal + */ +export declare function addPath(prev: Readonly | undefined, key: string | number, typename: string | undefined): Path; +/** + * Given a Path, return an Array of the path keys. + * @param path - The linked response path to flatten. + * @returns An array of response path keys from root to leaf. + * @example + * ```ts + * import { pathToArray } from 'graphql/jsutils/Path'; + * + * const path = { + * prev: { + * prev: { + * prev: undefined, + * key: 'viewer', + * typename: 'Query', + * }, + * key: 'friends', + * typename: 'User', + * }, + * key: 0, + * typename: undefined, + * }; + * + * pathToArray(path); // => ['viewer', 'friends', 0] + * pathToArray(undefined); // => [] + * ``` + */ +export declare function pathToArray(path: Maybe>): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js new file mode 100644 index 00000000..aee4cb65 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addPath = addPath; +exports.pathToArray = pathToArray; +function addPath(prev, key, typename) { + return { prev, key, typename }; +} +function pathToArray(path) { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + return flattened.reverse(); +} +//# sourceMappingURL=Path.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js.map new file mode 100644 index 00000000..e3aa32cc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../src/jsutils/Path.ts"],"names":[],"mappings":";;AAmBA,0BAMC;AA4BD,kCAUC;AA5CD,SAAgB,OAAO,CACrB,IAAgC,EAChC,GAAoB,EACpB,QAA4B;IAE5B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACjC,CAAC;AA4BD,SAAgB,WAAW,CACzB,IAA2B;IAE3B,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,OAAO,IAAI,EAAE,CAAC;QACZ,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/** @category Paths */\n\nimport type { Maybe } from './Maybe.ts';\n\n/** Represents a linked response path from a field back to the root response. */\nexport interface Path {\n /** The previous segment in the linked response path, or undefined at the root. */\n readonly prev: Path | undefined;\n /** The field name or list index for this response path segment. */\n readonly key: string | number;\n /** The runtime object type name associated with this path segment, if known. */\n readonly typename: string | undefined;\n}\n\n/**\n * Given a Path and a key, return a new Path containing the new key.\n *\n * @internal\n */\nexport function addPath(\n prev: Readonly | undefined,\n key: string | number,\n typename: string | undefined,\n): Path {\n return { prev, key, typename };\n}\n\n/**\n * Given a Path, return an Array of the path keys.\n * @param path - The linked response path to flatten.\n * @returns An array of response path keys from root to leaf.\n * @example\n * ```ts\n * import { pathToArray } from 'graphql/jsutils/Path';\n *\n * const path = {\n * prev: {\n * prev: {\n * prev: undefined,\n * key: 'viewer',\n * typename: 'Query',\n * },\n * key: 'friends',\n * typename: 'User',\n * },\n * key: 0,\n * typename: undefined,\n * };\n *\n * pathToArray(path); // => ['viewer', 'friends', 0]\n * pathToArray(undefined); // => []\n * ```\n */\nexport function pathToArray(\n path: Maybe>,\n): Array {\n const flattened = [];\n let curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs new file mode 100644 index 00000000..adf5280e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs @@ -0,0 +1,13 @@ +export function addPath(prev, key, typename) { + return { prev, key, typename }; +} +export function pathToArray(path) { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + return flattened.reverse(); +} +//# sourceMappingURL=Path.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs.map new file mode 100644 index 00000000..b2674b51 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/Path.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../src/jsutils/Path.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,OAAO,CACrB,IAAgC,EAChC,GAAoB,EACpB,QAA4B;IAE5B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACjC,CAAC;AA4BD,MAAM,UAAU,WAAW,CACzB,IAA2B;IAE3B,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,OAAO,IAAI,EAAE,CAAC;QACZ,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/** @category Paths */\n\nimport type { Maybe } from './Maybe.ts';\n\n/** Represents a linked response path from a field back to the root response. */\nexport interface Path {\n /** The previous segment in the linked response path, or undefined at the root. */\n readonly prev: Path | undefined;\n /** The field name or list index for this response path segment. */\n readonly key: string | number;\n /** The runtime object type name associated with this path segment, if known. */\n readonly typename: string | undefined;\n}\n\n/**\n * Given a Path and a key, return a new Path containing the new key.\n *\n * @internal\n */\nexport function addPath(\n prev: Readonly | undefined,\n key: string | number,\n typename: string | undefined,\n): Path {\n return { prev, key, typename };\n}\n\n/**\n * Given a Path, return an Array of the path keys.\n * @param path - The linked response path to flatten.\n * @returns An array of response path keys from root to leaf.\n * @example\n * ```ts\n * import { pathToArray } from 'graphql/jsutils/Path';\n *\n * const path = {\n * prev: {\n * prev: {\n * prev: undefined,\n * key: 'viewer',\n * typename: 'Query',\n * },\n * key: 'friends',\n * typename: 'User',\n * },\n * key: 0,\n * typename: undefined,\n * };\n *\n * pathToArray(path); // => ['viewer', 'friends', 0]\n * pathToArray(undefined); // => []\n * ```\n */\nexport function pathToArray(\n path: Maybe>,\n): Array {\n const flattened = [];\n let curr = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return flattened.reverse();\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.mts new file mode 100644 index 00000000..25acd006 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.mts @@ -0,0 +1,2 @@ +/** @internal */ +export type PromiseOrValue = Promise | T; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.ts new file mode 100644 index 00000000..25acd006 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.d.ts @@ -0,0 +1,2 @@ +/** @internal */ +export type PromiseOrValue = Promise | T; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js new file mode 100644 index 00000000..2c8ccca3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=PromiseOrValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js.map new file mode 100644 index 00000000..a0feedde --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PromiseOrValue.js","sourceRoot":"","sources":["../../src/jsutils/PromiseOrValue.ts"],"names":[],"mappings":"","sourcesContent":["/** @internal */\nexport type PromiseOrValue = Promise | T;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs new file mode 100644 index 00000000..dd043441 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=PromiseOrValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs.map new file mode 100644 index 00000000..a0feedde --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/PromiseOrValue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PromiseOrValue.js","sourceRoot":"","sources":["../../src/jsutils/PromiseOrValue.ts"],"names":[],"mappings":"","sourcesContent":["/** @internal */\nexport type PromiseOrValue = Promise | T;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.mts new file mode 100644 index 00000000..080c2b4f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.mts @@ -0,0 +1,6 @@ +/** + * Converts the first character of string to upper case and the remaining to lower case. + * + * @internal + */ +export declare function capitalize(str: string): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.ts new file mode 100644 index 00000000..080c2b4f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.d.ts @@ -0,0 +1,6 @@ +/** + * Converts the first character of string to upper case and the remaining to lower case. + * + * @internal + */ +export declare function capitalize(str: string): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js new file mode 100644 index 00000000..f93faf5a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.capitalize = capitalize; +function capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); +} +//# sourceMappingURL=capitalize.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js.map new file mode 100644 index 00000000..22f89845 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"capitalize.js","sourceRoot":"","sources":["../../src/jsutils/capitalize.ts"],"names":[],"mappings":";;AAKA,gCAEC;AAFD,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAClE,CAAC","sourcesContent":["/**\n * Converts the first character of string to upper case and the remaining to lower case.\n *\n * @internal\n */\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs new file mode 100644 index 00000000..2f6cc492 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs @@ -0,0 +1,4 @@ +export function capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); +} +//# sourceMappingURL=capitalize.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs.map new file mode 100644 index 00000000..ae857d50 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/capitalize.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"capitalize.js","sourceRoot":"","sources":["../../src/jsutils/capitalize.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAClE,CAAC","sourcesContent":["/**\n * Converts the first character of string to upper case and the remaining to lower case.\n *\n * @internal\n */\nexport function capitalize(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.mts new file mode 100644 index 00000000..cb394d63 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.mts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function devAssert(condition: boolean, message: string): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.ts new file mode 100644 index 00000000..cb394d63 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.d.ts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function devAssert(condition: boolean, message: string): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js new file mode 100644 index 00000000..a6bb906c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.devAssert = devAssert; +function devAssert(condition, message) { + if (!condition) { + throw new Error(message); + } +} +//# sourceMappingURL=devAssert.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js.map new file mode 100644 index 00000000..8944a105 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"devAssert.js","sourceRoot":"","sources":["../../src/jsutils/devAssert.ts"],"names":[],"mappings":";;AACA,8BAIC;AAJD,SAAgB,SAAS,CAAC,SAAkB,EAAE,OAAe;IAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["/** @internal */\nexport function devAssert(condition: boolean, message: string): void {\n if (!condition) {\n throw new Error(message);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs new file mode 100644 index 00000000..c7080bff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs @@ -0,0 +1,6 @@ +export function devAssert(condition, message) { + if (!condition) { + throw new Error(message); + } +} +//# sourceMappingURL=devAssert.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs.map new file mode 100644 index 00000000..975b67ec --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/devAssert.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"devAssert.js","sourceRoot":"","sources":["../../src/jsutils/devAssert.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CAAC,SAAkB,EAAE,OAAe;IAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["/** @internal */\nexport function devAssert(condition: boolean, message: string): void {\n if (!condition) {\n throw new Error(message);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.mts new file mode 100644 index 00000000..643d78ea --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.mts @@ -0,0 +1,8 @@ +/** + * Given [A, B, C] return ' Did you mean A, B, or C?'. + * + * @internal + */ +export declare function didYouMean(suggestions: ReadonlyArray): string; +/** @internal */ +export declare function didYouMean(subMessage: string, suggestions: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.ts new file mode 100644 index 00000000..643d78ea --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.d.ts @@ -0,0 +1,8 @@ +/** + * Given [A, B, C] return ' Did you mean A, B, or C?'. + * + * @internal + */ +export declare function didYouMean(suggestions: ReadonlyArray): string; +/** @internal */ +export declare function didYouMean(subMessage: string, suggestions: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js new file mode 100644 index 00000000..1461761a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.didYouMean = didYouMean; +const formatList_ts_1 = require("./formatList.js"); +const MAX_SUGGESTIONS = 5; +function didYouMean(firstArg, secondArg) { + const [subMessage, suggestions] = secondArg + ? [firstArg, secondArg] + : [undefined, firstArg]; + if (suggestions.length === 0) { + return ''; + } + let message = ' Did you mean '; + if (subMessage != null) { + message += subMessage + ' '; + } + const suggestionList = (0, formatList_ts_1.orList)(suggestions.slice(0, MAX_SUGGESTIONS).map((x) => `"${x}"`)); + return message + suggestionList + '?'; +} +//# sourceMappingURL=didYouMean.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js.map new file mode 100644 index 00000000..55ae1df4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.js.map @@ -0,0 +1 @@ +{"version":3,"file":"didYouMean.js","sourceRoot":"","sources":["../../src/jsutils/didYouMean.ts"],"names":[],"mappings":";;AAgBA,gCAqBC;AArCD,mDAAyC;AAEzC,MAAM,eAAe,GAAG,CAAC,CAAC;AAc1B,SAAgB,UAAU,CACxB,QAAwC,EACxC,SAAiC;IAEjC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,SAAS;QACzC,CAAC,CAAC,CAAC,QAAkB,EAAE,SAAS,CAAC;QACjC,CAAC,CAAC,CAAC,SAAS,EAAE,QAAiC,CAAC,CAAC;IAEnD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,OAAO,GAAG,gBAAgB,CAAC;IAC/B,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,IAAI,UAAU,GAAG,GAAG,CAAC;IAC9B,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,sBAAM,EAC3B,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAC3D,CAAC;IACF,OAAO,OAAO,GAAG,cAAc,GAAG,GAAG,CAAC;AACxC,CAAC","sourcesContent":["import { orList } from './formatList.ts';\n\nconst MAX_SUGGESTIONS = 5;\n\n/**\n * Given [A, B, C] return ' Did you mean A, B, or C?'.\n *\n * @internal\n */\nexport function didYouMean(suggestions: ReadonlyArray): string;\n/** @internal */\nexport function didYouMean(\n subMessage: string,\n suggestions: ReadonlyArray,\n): string;\n/** @internal */\nexport function didYouMean(\n firstArg: string | ReadonlyArray,\n secondArg?: ReadonlyArray,\n) {\n const [subMessage, suggestions] = secondArg\n ? [firstArg as string, secondArg]\n : [undefined, firstArg as ReadonlyArray];\n\n if (suggestions.length === 0) {\n return '';\n }\n\n let message = ' Did you mean ';\n if (subMessage != null) {\n message += subMessage + ' ';\n }\n\n const suggestionList = orList(\n suggestions.slice(0, MAX_SUGGESTIONS).map((x) => `\"${x}\"`),\n );\n return message + suggestionList + '?';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs new file mode 100644 index 00000000..4d7fe417 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs @@ -0,0 +1,17 @@ +import { orList } from "./formatList.mjs"; +const MAX_SUGGESTIONS = 5; +export function didYouMean(firstArg, secondArg) { + const [subMessage, suggestions] = secondArg + ? [firstArg, secondArg] + : [undefined, firstArg]; + if (suggestions.length === 0) { + return ''; + } + let message = ' Did you mean '; + if (subMessage != null) { + message += subMessage + ' '; + } + const suggestionList = orList(suggestions.slice(0, MAX_SUGGESTIONS).map((x) => `"${x}"`)); + return message + suggestionList + '?'; +} +//# sourceMappingURL=didYouMean.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs.map new file mode 100644 index 00000000..bfc72ea8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/didYouMean.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"didYouMean.js","sourceRoot":"","sources":["../../src/jsutils/didYouMean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,yBAAwB;AAEzC,MAAM,eAAe,GAAG,CAAC,CAAC;AAc1B,MAAM,UAAU,UAAU,CACxB,QAAwC,EACxC,SAAiC;IAEjC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,SAAS;QACzC,CAAC,CAAC,CAAC,QAAkB,EAAE,SAAS,CAAC;QACjC,CAAC,CAAC,CAAC,SAAS,EAAE,QAAiC,CAAC,CAAC;IAEnD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,OAAO,GAAG,gBAAgB,CAAC;IAC/B,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,IAAI,UAAU,GAAG,GAAG,CAAC;IAC9B,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,CAC3B,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAC3D,CAAC;IACF,OAAO,OAAO,GAAG,cAAc,GAAG,GAAG,CAAC;AACxC,CAAC","sourcesContent":["import { orList } from './formatList.ts';\n\nconst MAX_SUGGESTIONS = 5;\n\n/**\n * Given [A, B, C] return ' Did you mean A, B, or C?'.\n *\n * @internal\n */\nexport function didYouMean(suggestions: ReadonlyArray): string;\n/** @internal */\nexport function didYouMean(\n subMessage: string,\n suggestions: ReadonlyArray,\n): string;\n/** @internal */\nexport function didYouMean(\n firstArg: string | ReadonlyArray,\n secondArg?: ReadonlyArray,\n) {\n const [subMessage, suggestions] = secondArg\n ? [firstArg as string, secondArg]\n : [undefined, firstArg as ReadonlyArray];\n\n if (suggestions.length === 0) {\n return '';\n }\n\n let message = ' Did you mean ';\n if (subMessage != null) {\n message += subMessage + ' ';\n }\n\n const suggestionList = orList(\n suggestions.slice(0, MAX_SUGGESTIONS).map((x) => `\"${x}\"`),\n );\n return message + suggestionList + '?';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.mts new file mode 100644 index 00000000..82dca2af --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.mts @@ -0,0 +1,12 @@ +/** + * Given [A, B, C] return 'A, B, or C'. + * + * @internal + */ +export declare function orList(items: ReadonlyArray): string; +/** + * Given [A, B, C] return 'A, B, and C'. + * + * @internal + */ +export declare function andList(items: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.ts new file mode 100644 index 00000000..82dca2af --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.d.ts @@ -0,0 +1,12 @@ +/** + * Given [A, B, C] return 'A, B, or C'. + * + * @internal + */ +export declare function orList(items: ReadonlyArray): string; +/** + * Given [A, B, C] return 'A, B, and C'. + * + * @internal + */ +export declare function andList(items: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js new file mode 100644 index 00000000..8aa0f14b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.orList = orList; +exports.andList = andList; +const invariant_ts_1 = require("./invariant.js"); +function orList(items) { + return formatList('or', items); +} +function andList(items) { + return formatList('and', items); +} +function formatList(conjunction, items) { + if (!(items.length !== 0)) + (0, invariant_ts_1.invariant)(false); + switch (items.length) { + case 1: + return items[0]; + case 2: + return items[0] + ' ' + conjunction + ' ' + items[1]; + } + const allButLast = items.slice(0, -1); + const lastItem = items.at(-1); + return allButLast.join(', ') + ', ' + conjunction + ' ' + lastItem; +} +//# sourceMappingURL=formatList.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js.map new file mode 100644 index 00000000..ae3fb366 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"formatList.js","sourceRoot":"","sources":["../../src/jsutils/formatList.ts"],"names":[],"mappings":";;AAOA,wBAEC;AAOD,0BAEC;AAlBD,iDAA2C;AAO3C,SAAgB,MAAM,CAAC,KAA4B;IACjD,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC;AAOD,SAAgB,OAAO,CAAC,KAA4B;IAClD,OAAO,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,UAAU,CAAC,WAAmB,EAAE,KAA4B;UACzD,KAAK,CAAC,MAAM,KAAK,CAAC;YAA5B,wBAAS;IAET,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,CAAC;YACJ,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,KAAK,CAAC;YACJ,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,WAAW,GAAG,GAAG,GAAG,QAAQ,CAAC;AACrE,CAAC","sourcesContent":["import { invariant } from './invariant.ts';\n\n/**\n * Given [A, B, C] return 'A, B, or C'.\n *\n * @internal\n */\nexport function orList(items: ReadonlyArray): string {\n return formatList('or', items);\n}\n\n/**\n * Given [A, B, C] return 'A, B, and C'.\n *\n * @internal\n */\nexport function andList(items: ReadonlyArray): string {\n return formatList('and', items);\n}\n\nfunction formatList(conjunction: string, items: ReadonlyArray): string {\n invariant(items.length !== 0);\n\n switch (items.length) {\n case 1:\n return items[0];\n case 2:\n return items[0] + ' ' + conjunction + ' ' + items[1];\n }\n\n const allButLast = items.slice(0, -1);\n const lastItem = items.at(-1);\n return allButLast.join(', ') + ', ' + conjunction + ' ' + lastItem;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs new file mode 100644 index 00000000..5bfb21d5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs @@ -0,0 +1,21 @@ +import { invariant } from "./invariant.mjs"; +export function orList(items) { + return formatList('or', items); +} +export function andList(items) { + return formatList('and', items); +} +function formatList(conjunction, items) { + if (!(items.length !== 0)) + invariant(false); + switch (items.length) { + case 1: + return items[0]; + case 2: + return items[0] + ' ' + conjunction + ' ' + items[1]; + } + const allButLast = items.slice(0, -1); + const lastItem = items.at(-1); + return allButLast.join(', ') + ', ' + conjunction + ' ' + lastItem; +} +//# sourceMappingURL=formatList.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs.map new file mode 100644 index 00000000..60b8901a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/formatList.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"formatList.js","sourceRoot":"","sources":["../../src/jsutils/formatList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAuB;AAO3C,MAAM,UAAU,MAAM,CAAC,KAA4B;IACjD,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC;AAOD,MAAM,UAAU,OAAO,CAAC,KAA4B;IAClD,OAAO,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,UAAU,CAAC,WAAmB,EAAE,KAA4B;UACzD,KAAK,CAAC,MAAM,KAAK,CAAC;QAA5B,SAAS;IAET,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,CAAC;YACJ,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,KAAK,CAAC;YACJ,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,WAAW,GAAG,GAAG,GAAG,QAAQ,CAAC;AACrE,CAAC","sourcesContent":["import { invariant } from './invariant.ts';\n\n/**\n * Given [A, B, C] return 'A, B, or C'.\n *\n * @internal\n */\nexport function orList(items: ReadonlyArray): string {\n return formatList('or', items);\n}\n\n/**\n * Given [A, B, C] return 'A, B, and C'.\n *\n * @internal\n */\nexport function andList(items: ReadonlyArray): string {\n return formatList('and', items);\n}\n\nfunction formatList(conjunction: string, items: ReadonlyArray): string {\n invariant(items.length !== 0);\n\n switch (items.length) {\n case 1:\n return items[0];\n case 2:\n return items[0] + ' ' + conjunction + ' ' + items[1];\n }\n\n const allButLast = items.slice(0, -1);\n const lastItem = items.at(-1);\n return allButLast.join(', ') + ', ' + conjunction + ' ' + lastItem;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.mts new file mode 100644 index 00000000..97476a8c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.mts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function getBySet(map: ReadonlyMap, U>, setToMatch: ReadonlySet): U | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.ts new file mode 100644 index 00000000..97476a8c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.d.ts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function getBySet(map: ReadonlyMap, U>, setToMatch: ReadonlySet): U | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js new file mode 100644 index 00000000..07b2eca5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getBySet = getBySet; +const isSameSet_ts_1 = require("./isSameSet.js"); +function getBySet(map, setToMatch) { + for (const set of map.keys()) { + if ((0, isSameSet_ts_1.isSameSet)(set, setToMatch)) { + return map.get(set); + } + } + return undefined; +} +//# sourceMappingURL=getBySet.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js.map new file mode 100644 index 00000000..3f826cff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getBySet.js","sourceRoot":"","sources":["../../src/jsutils/getBySet.ts"],"names":[],"mappings":";;AAGA,4BAUC;AAbD,iDAA2C;AAG3C,SAAgB,QAAQ,CACtB,GAAmC,EACnC,UAA0B;IAE1B,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7B,IAAI,IAAA,wBAAS,EAAC,GAAG,EAAE,UAAU,CAAC,EAAE,CAAC;YAC/B,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { isSameSet } from './isSameSet.ts';\n\n/** @internal */\nexport function getBySet(\n map: ReadonlyMap, U>,\n setToMatch: ReadonlySet,\n): U | undefined {\n for (const set of map.keys()) {\n if (isSameSet(set, setToMatch)) {\n return map.get(set);\n }\n }\n return undefined;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs new file mode 100644 index 00000000..d0601d12 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs @@ -0,0 +1,10 @@ +import { isSameSet } from "./isSameSet.mjs"; +export function getBySet(map, setToMatch) { + for (const set of map.keys()) { + if (isSameSet(set, setToMatch)) { + return map.get(set); + } + } + return undefined; +} +//# sourceMappingURL=getBySet.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs.map new file mode 100644 index 00000000..658d6dd9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/getBySet.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"getBySet.js","sourceRoot":"","sources":["../../src/jsutils/getBySet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAuB;AAG3C,MAAM,UAAU,QAAQ,CACtB,GAAmC,EACnC,UAA0B;IAE1B,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7B,IAAI,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,CAAC;YAC/B,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { isSameSet } from './isSameSet.ts';\n\n/** @internal */\nexport function getBySet(\n map: ReadonlyMap, U>,\n setToMatch: ReadonlySet,\n): U | undefined {\n for (const set of map.keys()) {\n if (isSameSet(set, setToMatch)) {\n return map.get(set);\n }\n }\n return undefined;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.mts new file mode 100644 index 00000000..296726f9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.mts @@ -0,0 +1,6 @@ +/** + * Groups array items into a Map, given a function to produce grouping key. + * + * @internal + */ +export declare function groupBy(list: ReadonlyArray, keyFn: (item: T) => K): Map>; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.ts new file mode 100644 index 00000000..296726f9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.d.ts @@ -0,0 +1,6 @@ +/** + * Groups array items into a Map, given a function to produce grouping key. + * + * @internal + */ +export declare function groupBy(list: ReadonlyArray, keyFn: (item: T) => K): Map>; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js new file mode 100644 index 00000000..2c46f77d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.groupBy = groupBy; +const AccumulatorMap_ts_1 = require("./AccumulatorMap.js"); +function groupBy(list, keyFn) { + const result = new AccumulatorMap_ts_1.AccumulatorMap(); + for (const item of list) { + result.add(keyFn(item), item); + } + return result; +} +//# sourceMappingURL=groupBy.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js.map new file mode 100644 index 00000000..ce12bc2d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"groupBy.js","sourceRoot":"","sources":["../../src/jsutils/groupBy.ts"],"names":[],"mappings":";;AAOA,0BASC;AAhBD,2DAAqD;AAOrD,SAAgB,OAAO,CACrB,IAAsB,EACtB,KAAqB;IAErB,MAAM,MAAM,GAAG,IAAI,kCAAc,EAAQ,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { AccumulatorMap } from './AccumulatorMap.ts';\n\n/**\n * Groups array items into a Map, given a function to produce grouping key.\n *\n * @internal\n */\nexport function groupBy(\n list: ReadonlyArray,\n keyFn: (item: T) => K,\n): Map> {\n const result = new AccumulatorMap();\n for (const item of list) {\n result.add(keyFn(item), item);\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs new file mode 100644 index 00000000..c20b1758 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs @@ -0,0 +1,9 @@ +import { AccumulatorMap } from "./AccumulatorMap.mjs"; +export function groupBy(list, keyFn) { + const result = new AccumulatorMap(); + for (const item of list) { + result.add(keyFn(item), item); + } + return result; +} +//# sourceMappingURL=groupBy.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs.map new file mode 100644 index 00000000..f0c30481 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/groupBy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"groupBy.js","sourceRoot":"","sources":["../../src/jsutils/groupBy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAA4B;AAOrD,MAAM,UAAU,OAAO,CACrB,IAAsB,EACtB,KAAqB;IAErB,MAAM,MAAM,GAAG,IAAI,cAAc,EAAQ,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { AccumulatorMap } from './AccumulatorMap.ts';\n\n/**\n * Groups array items into a Map, given a function to produce grouping key.\n *\n * @internal\n */\nexport function groupBy(\n list: ReadonlyArray,\n keyFn: (item: T) => K,\n): Map> {\n const result = new AccumulatorMap();\n for (const item of list) {\n result.add(keyFn(item), item);\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.mts new file mode 100644 index 00000000..b6e5e182 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.mts @@ -0,0 +1,6 @@ +/** + * Returns the first argument it receives. + * + * @internal + */ +export declare function identityFunc(x: T): T; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.ts new file mode 100644 index 00000000..b6e5e182 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the first argument it receives. + * + * @internal + */ +export declare function identityFunc(x: T): T; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js new file mode 100644 index 00000000..3f6938de --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.identityFunc = identityFunc; +function identityFunc(x) { + return x; +} +//# sourceMappingURL=identityFunc.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js.map new file mode 100644 index 00000000..989035a1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"identityFunc.js","sourceRoot":"","sources":["../../src/jsutils/identityFunc.ts"],"names":[],"mappings":";;AAKA,oCAEC;AAFD,SAAgB,YAAY,CAAI,CAAI;IAClC,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/**\n * Returns the first argument it receives.\n *\n * @internal\n */\nexport function identityFunc(x: T): T {\n return x;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs new file mode 100644 index 00000000..0ccd9c95 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs @@ -0,0 +1,4 @@ +export function identityFunc(x) { + return x; +} +//# sourceMappingURL=identityFunc.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs.map new file mode 100644 index 00000000..1185014f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/identityFunc.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"identityFunc.js","sourceRoot":"","sources":["../../src/jsutils/identityFunc.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,YAAY,CAAI,CAAI;IAClC,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/**\n * Returns the first argument it receives.\n *\n * @internal\n */\nexport function identityFunc(x: T): T {\n return x;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.mts new file mode 100644 index 00000000..bba898cc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.mts @@ -0,0 +1,6 @@ +/** + * Used to print values in error messages. + * + * @internal + */ +export declare function inspect(value: unknown): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.ts new file mode 100644 index 00000000..bba898cc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.d.ts @@ -0,0 +1,6 @@ +/** + * Used to print values in error messages. + * + * @internal + */ +export declare function inspect(value: unknown): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js new file mode 100644 index 00000000..6c035ed2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inspect = inspect; +const MAX_ARRAY_LENGTH = 10; +const MAX_RECURSIVE_DEPTH = 2; +function inspect(value) { + return formatValue(value, []); +} +function formatValue(value, seenValues) { + switch (typeof value) { + case 'string': + return JSON.stringify(value); + case 'function': + return value.name ? `[function ${value.name}]` : '[function]'; + case 'object': + return formatObjectValue(value, seenValues); + default: + return String(value); + } +} +function formatObjectValue(value, previouslySeenValues) { + if (value === null) { + return 'null'; + } + if (previouslySeenValues.includes(value)) { + return '[Circular]'; + } + const seenValues = [...previouslySeenValues, value]; + if (isJSONable(value)) { + const jsonValue = value.toJSON(); + if (jsonValue !== value) { + return typeof jsonValue === 'string' + ? jsonValue + : formatValue(jsonValue, seenValues); + } + } + else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + return formatObject(value, seenValues); +} +function isJSONable(value) { + return typeof value.toJSON === 'function'; +} +function formatObject(object, seenValues) { + const entries = Object.entries(object); + if (entries.length === 0) { + return '{}'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + const properties = entries.map(([key, value]) => key + ': ' + formatValue(value, seenValues)); + return '{ ' + properties.join(', ') + ' }'; +} +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + const len = Math.min(MAX_ARRAY_LENGTH, array.length); + const remaining = array.length - len; + const items = []; + for (let i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + if (remaining === 1) { + items.push('... 1 more item'); + } + else if (remaining > 1) { + items.push(`... ${remaining} more items`); + } + return '[' + items.join(', ') + ']'; +} +function getObjectTag(object) { + const tag = Object.prototype.toString + .call(object) + .replace(/^\[object /, '') + .replace(/]$/, ''); + if (tag === 'Object' && typeof object.constructor === 'function') { + const name = object.constructor.name; + if (typeof name === 'string' && name !== '') { + return name; + } + } + return tag; +} +//# sourceMappingURL=inspect.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js.map new file mode 100644 index 00000000..8323f9de --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../src/jsutils/inspect.ts"],"names":[],"mappings":";;AAQA,0BAEC;AAVD,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAO9B,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAClB,KAAc,EACd,UAAkC;IAElC,QAAQ,OAAO,KAAK,EAAE,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,UAAU;YACb,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC;QAChE,KAAK,QAAQ;YACX,OAAO,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC9C;YACE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CACxB,KAAoB,EACpB,oBAA4C;IAE5C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,UAAU,GAAG,C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,CAAC,WAAW,CAAC,IAAI,CAAC;QACrC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["const MAX_ARRAY_LENGTH = 10;\nconst MAX_RECURSIVE_DEPTH = 2;\n\n/**\n * Used to print values in error messages.\n *\n * @internal\n */\nexport function inspect(value: unknown): string {\n return formatValue(value, []);\n}\n\nfunction formatValue(\n value: unknown,\n seenValues: ReadonlyArray,\n): string {\n switch (typeof value) {\n case 'string':\n return JSON.stringify(value);\n case 'function':\n return value.name ? `[function ${value.name}]` : '[function]';\n case 'object':\n return formatObjectValue(value, seenValues);\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(\n value: object | null,\n previouslySeenValues: ReadonlyArray,\n): string {\n if (value === null) {\n return 'null';\n }\n\n if (previouslySeenValues.includes(value)) {\n return '[Circular]';\n }\n\n const seenValues = [...previouslySeenValues, value];\n\n if (isJSONable(value)) {\n const jsonValue = value.toJSON();\n\n // check for infinite recursion\n if (jsonValue !== value) {\n return typeof jsonValue === 'string'\n ? jsonValue\n : formatValue(jsonValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction isJSONable(value: any): value is { toJSON: () => unknown } {\n return typeof value.toJSON === 'function';\n}\n\nfunction formatObject(\n object: object,\n seenValues: ReadonlyArray,\n): string {\n const entries = Object.entries(object);\n if (entries.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n const properties = entries.map(\n ([key, value]) => key + ': ' + formatValue(value, seenValues),\n );\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(\n array: ReadonlyArray,\n seenValues: ReadonlyArray,\n): string {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n const len = Math.min(MAX_ARRAY_LENGTH, array.length);\n const remaining = array.length - len;\n const items = [];\n\n for (let i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(`... ${remaining} more items`);\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getObjectTag(object: object): string {\n const tag = Object.prototype.toString\n .call(object)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n const name = object.constructor.name;\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs new file mode 100644 index 00000000..8cea1c59 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs @@ -0,0 +1,87 @@ +const MAX_ARRAY_LENGTH = 10; +const MAX_RECURSIVE_DEPTH = 2; +export function inspect(value) { + return formatValue(value, []); +} +function formatValue(value, seenValues) { + switch (typeof value) { + case 'string': + return JSON.stringify(value); + case 'function': + return value.name ? `[function ${value.name}]` : '[function]'; + case 'object': + return formatObjectValue(value, seenValues); + default: + return String(value); + } +} +function formatObjectValue(value, previouslySeenValues) { + if (value === null) { + return 'null'; + } + if (previouslySeenValues.includes(value)) { + return '[Circular]'; + } + const seenValues = [...previouslySeenValues, value]; + if (isJSONable(value)) { + const jsonValue = value.toJSON(); + if (jsonValue !== value) { + return typeof jsonValue === 'string' + ? jsonValue + : formatValue(jsonValue, seenValues); + } + } + else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + return formatObject(value, seenValues); +} +function isJSONable(value) { + return typeof value.toJSON === 'function'; +} +function formatObject(object, seenValues) { + const entries = Object.entries(object); + if (entries.length === 0) { + return '{}'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + const properties = entries.map(([key, value]) => key + ': ' + formatValue(value, seenValues)); + return '{ ' + properties.join(', ') + ' }'; +} +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + const len = Math.min(MAX_ARRAY_LENGTH, array.length); + const remaining = array.length - len; + const items = []; + for (let i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + if (remaining === 1) { + items.push('... 1 more item'); + } + else if (remaining > 1) { + items.push(`... ${remaining} more items`); + } + return '[' + items.join(', ') + ']'; +} +function getObjectTag(object) { + const tag = Object.prototype.toString + .call(object) + .replace(/^\[object /, '') + .replace(/]$/, ''); + if (tag === 'Object' && typeof object.constructor === 'function') { + const name = object.constructor.name; + if (typeof name === 'string' && name !== '') { + return name; + } + } + return tag; +} +//# sourceMappingURL=inspect.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs.map new file mode 100644 index 00000000..a3a7c14d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/inspect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../src/jsutils/inspect.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAO9B,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,OAAO,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAClB,KAAc,EACd,UAAkC;IAElC,QAAQ,OAAO,KAAK,EAAE,CAAC;QAC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AAC;QACpB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAChC,CAAC;SAAM,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,OAAO,SAAS,aAAa,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AACtC,CAAC;AAED,SAAS,YAAY,CAAC,MAAc;IAClC,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ;SAClC,IAAI,CAAC,MAAM,CAAC;SACZ,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAErB,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACjE,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACrC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["const MAX_ARRAY_LENGTH = 10;\nconst MAX_RECURSIVE_DEPTH = 2;\n\n/**\n * Used to print values in error messages.\n *\n * @internal\n */\nexport function inspect(value: unknown): string {\n return formatValue(value, []);\n}\n\nfunction formatValue(\n value: unknown,\n seenValues: ReadonlyArray,\n): string {\n switch (typeof value) {\n case 'string':\n return JSON.stringify(value);\n case 'function':\n return value.name ? `[function ${value.name}]` : '[function]';\n case 'object':\n return formatObjectValue(value, seenValues);\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(\n value: object | null,\n previouslySeenValues: ReadonlyArray,\n): string {\n if (value === null) {\n return 'null';\n }\n\n if (previouslySeenValues.includes(value)) {\n return '[Circular]';\n }\n\n const seenValues = [...previouslySeenValues, value];\n\n if (isJSONable(value)) {\n const jsonValue = value.toJSON();\n\n // check for infinite recursion\n if (jsonValue !== value) {\n return typeof jsonValue === 'string'\n ? jsonValue\n : formatValue(jsonValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction isJSONable(value: any): value is { toJSON: () => unknown } {\n return typeof value.toJSON === 'function';\n}\n\nfunction formatObject(\n object: object,\n seenValues: ReadonlyArray,\n): string {\n const entries = Object.entries(object);\n if (entries.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n const properties = entries.map(\n ([key, value]) => key + ': ' + formatValue(value, seenValues),\n );\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(\n array: ReadonlyArray,\n seenValues: ReadonlyArray,\n): string {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n const len = Math.min(MAX_ARRAY_LENGTH, array.length);\n const remaining = array.length - len;\n const items = [];\n\n for (let i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(`... ${remaining} more items`);\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getObjectTag(object: object): string {\n const tag = Object.prototype.toString\n .call(object)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n const name = object.constructor.name;\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.mts new file mode 100644 index 00000000..4757ed34 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.mts @@ -0,0 +1,17 @@ +interface Constructor { + prototype: { + [Symbol.toStringTag]: string; + }; + new (...args: Array): any; +} +interface Constructor { + prototype: { + [Symbol.toStringTag]: string; + }; + new (...args: Array): any; +} +/** @internal */ +export declare let instanceOf: (value: unknown, symbol: symbol, constructor: Constructor) => boolean; +/** @internal */ +export declare function enableDevInstanceOf(): void; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.ts new file mode 100644 index 00000000..4757ed34 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.d.ts @@ -0,0 +1,17 @@ +interface Constructor { + prototype: { + [Symbol.toStringTag]: string; + }; + new (...args: Array): any; +} +interface Constructor { + prototype: { + [Symbol.toStringTag]: string; + }; + new (...args: Array): any; +} +/** @internal */ +export declare let instanceOf: (value: unknown, symbol: symbol, constructor: Constructor) => boolean; +/** @internal */ +export declare function enableDevInstanceOf(): void; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js new file mode 100644 index 00000000..496da6ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.instanceOf = void 0; +exports.enableDevInstanceOf = enableDevInstanceOf; +const inspect_ts_1 = require("./inspect.js"); +function devInstanceOf(value, symbol, constructor) { + if (value?.__kind === symbol) { + return true; + } + if (typeof value === 'object' && value !== null) { + const className = constructor.prototype[Symbol.toStringTag]; + const valueClassName = Symbol.toStringTag in value + ? value[Symbol.toStringTag] + : value.constructor?.name; + if (className === valueClassName) { + const stringifiedValue = (0, inspect_ts_1.inspect)(value); + throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`); + } + } + return false; +} +function prodInstanceOf(value, symbol) { + return value?.__kind === symbol; +} +exports.instanceOf = prodInstanceOf; +function enableDevInstanceOf() { + exports.instanceOf = devInstanceOf; +} +//# sourceMappingURL=instanceOf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js.map new file mode 100644 index 00000000..e14c2636 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"instanceOf.js","sourceRoot":"","sources":["../../src/jsutils/instanceOf.ts"],"names":[],"mappings":";;;AA2EA,kDAEC;AA7ED,6CAAuC;AAWvC,SAAS,aAAa,CACpB,KAAc,EACd,MAAc,EACd,WAAwB;IAExB,IAAK,KAAa,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAEhD,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5D,MAAM,cAAc,GAElB,MAAM,CAAC,WAAW,IAAI,KAAK;YACzB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;YAC3B,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC;QAC9B,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;YACjC,MAAM,gBAAgB,GAAG,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CACb,cAAc,SAAS,KAAK,gBAAgB;;;;;;;;;;;kBAWlC,CACX,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,cAAc,CAAC,KAAc,EAAE,MAAc;IACpD,OAAQ,KAAa,EAAE,MAAM,KAAK,MAAM,CAAC;AAC3C,CAAC;AAkBU,QAAA,UAAU,GAIN,cAAc,CAAC;AAG9B,SAAgB,mBAAmB;IACjC,kBAAU,GAAG,aAAa,CAAC;AAC7B,CAAC","sourcesContent":["import { inspect } from './inspect.ts';\n\n/**\n * A replacement for instanceof relying on a symbol-driven type brand which in\n * development mode includes an error warning when multi-realm constructors are\n * detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n *\n * @internal\n */\nfunction devInstanceOf(\n value: unknown,\n symbol: symbol,\n constructor: Constructor,\n): boolean {\n if ((value as any)?.__kind === symbol) {\n return true;\n }\n if (typeof value === 'object' && value !== null) {\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName =\n // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value\n ? value[Symbol.toStringTag]\n : value.constructor?.name;\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(\n `Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`,\n );\n }\n }\n return false;\n}\n\nfunction prodInstanceOf(value: unknown, symbol: symbol): boolean {\n return (value as any)?.__kind === symbol;\n}\n\ninterface Constructor {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n new (...args: Array): any;\n}\n\ninterface Constructor {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n new (...args: Array): any;\n}\n\n/** @internal */\n/* eslint-disable-next-line import/no-mutable-exports */\nexport let instanceOf: (\n value: unknown,\n symbol: symbol,\n constructor: Constructor,\n) => boolean = prodInstanceOf;\n\n/** @internal */\nexport function enableDevInstanceOf(): void {\n instanceOf = devInstanceOf;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs new file mode 100644 index 00000000..0d7af81a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs @@ -0,0 +1,36 @@ +import { inspect } from "./inspect.mjs"; +function devInstanceOf(value, symbol, constructor) { + if (value?.__kind === symbol) { + return true; + } + if (typeof value === 'object' && value !== null) { + const className = constructor.prototype[Symbol.toStringTag]; + const valueClassName = Symbol.toStringTag in value + ? value[Symbol.toStringTag] + : value.constructor?.name; + if (className === valueClassName) { + const stringifiedValue = inspect(value); + throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`); + } + } + return false; +} +function prodInstanceOf(value, symbol) { + return value?.__kind === symbol; +} +export let instanceOf = prodInstanceOf; +export function enableDevInstanceOf() { + instanceOf = devInstanceOf; +} +//# sourceMappingURL=instanceOf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs.map new file mode 100644 index 00000000..488b66f2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/instanceOf.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"instanceOf.js","sourceRoot":"","sources":["../../src/jsutils/instanceOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAqB;AAWvC,SAAS,aAAa,CACpB,KAAc,EACd,MAAc,EACd,WAAwB;IAExB,IAAK,KAAa,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAEhD,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5D,MAAM,cAAc,GAElB,MAAM,CAAC,WAAW,IAAI,KAAK;YACzB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;YAC3B,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC;QAC9B,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;YACjC,MAAM,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CACb,cAAc,SAAS,KAAK,gBAAgB;;;;;;;;;;;kBAWlC,CACX,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,cAAc,CAAC,KAAc,EAAE,MAAc;IACpD,OAAQ,KAAa,EAAE,MAAM,KAAK,MAAM,CAAC;AAC3C,CAAC;AAkBD,MAAM,CAAC,IAAI,UAAU,GAIN,cAAc,CAAC;AAG9B,MAAM,UAAU,mBAAmB;IACjC,UAAU,GAAG,aAAa,CAAC;AAC7B,CAAC","sourcesContent":["import { inspect } from './inspect.ts';\n\n/**\n * A replacement for instanceof relying on a symbol-driven type brand which in\n * development mode includes an error warning when multi-realm constructors are\n * detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n *\n * @internal\n */\nfunction devInstanceOf(\n value: unknown,\n symbol: symbol,\n constructor: Constructor,\n): boolean {\n if ((value as any)?.__kind === symbol) {\n return true;\n }\n if (typeof value === 'object' && value !== null) {\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName =\n // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value\n ? value[Symbol.toStringTag]\n : value.constructor?.name;\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(\n `Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`,\n );\n }\n }\n return false;\n}\n\nfunction prodInstanceOf(value: unknown, symbol: symbol): boolean {\n return (value as any)?.__kind === symbol;\n}\n\ninterface Constructor {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n new (...args: Array): any;\n}\n\ninterface Constructor {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n new (...args: Array): any;\n}\n\n/** @internal */\n/* eslint-disable-next-line import/no-mutable-exports */\nexport let instanceOf: (\n value: unknown,\n symbol: symbol,\n constructor: Constructor,\n) => boolean = prodInstanceOf;\n\n/** @internal */\nexport function enableDevInstanceOf(): void {\n instanceOf = devInstanceOf;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.mts new file mode 100644 index 00000000..92f2852f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.mts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function invariant(condition: boolean, message?: string): asserts condition; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.ts new file mode 100644 index 00000000..92f2852f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.d.ts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function invariant(condition: boolean, message?: string): asserts condition; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js new file mode 100644 index 00000000..3552d92b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.invariant = invariant; +function invariant(condition, message) { + if (!condition) { + throw new Error(message ?? 'Unexpected invariant triggered.'); + } +} +//# sourceMappingURL=invariant.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js.map new file mode 100644 index 00000000..06ec0643 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.js.map @@ -0,0 +1 @@ +{"version":3,"file":"invariant.js","sourceRoot":"","sources":["../../src/jsutils/invariant.ts"],"names":[],"mappings":";;AACA,8BAOC;AAPD,SAAgB,SAAS,CACvB,SAAkB,EAClB,OAAgB;IAEhB,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,iCAAiC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC","sourcesContent":["/** @internal */\nexport function invariant(\n condition: boolean,\n message?: string,\n): asserts condition {\n if (!condition) {\n throw new Error(message ?? 'Unexpected invariant triggered.');\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs new file mode 100644 index 00000000..51f609a8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs @@ -0,0 +1,6 @@ +export function invariant(condition, message) { + if (!condition) { + throw new Error(message ?? 'Unexpected invariant triggered.'); + } +} +//# sourceMappingURL=invariant.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs.map new file mode 100644 index 00000000..2dbe7384 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/invariant.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"invariant.js","sourceRoot":"","sources":["../../src/jsutils/invariant.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CACvB,SAAkB,EAClB,OAAgB;IAEhB,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,iCAAiC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC","sourcesContent":["/** @internal */\nexport function invariant(\n condition: boolean,\n message?: string,\n): asserts condition {\n if (!condition) {\n throw new Error(message ?? 'Unexpected invariant triggered.');\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.mts new file mode 100644 index 00000000..fc7c9554 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.mts @@ -0,0 +1,7 @@ +/** + * Returns true if the provided object implements the AsyncIterator protocol via + * implementing a `Symbol.asyncIterator` method. + * + * @internal + */ +export declare function isAsyncIterable(maybeAsyncIterable: any): maybeAsyncIterable is AsyncIterable; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.ts new file mode 100644 index 00000000..fc7c9554 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.d.ts @@ -0,0 +1,7 @@ +/** + * Returns true if the provided object implements the AsyncIterator protocol via + * implementing a `Symbol.asyncIterator` method. + * + * @internal + */ +export declare function isAsyncIterable(maybeAsyncIterable: any): maybeAsyncIterable is AsyncIterable; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js new file mode 100644 index 00000000..0ba9c181 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isAsyncIterable = isAsyncIterable; +function isAsyncIterable(maybeAsyncIterable) { + return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === 'function'; +} +//# sourceMappingURL=isAsyncIterable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js.map new file mode 100644 index 00000000..bb893ef7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isAsyncIterable.js","sourceRoot":"","sources":["../../src/jsutils/isAsyncIterable.ts"],"names":[],"mappings":";;AAMA,0CAIC;AAJD,SAAgB,eAAe,CAC7B,kBAAuB;IAEvB,OAAO,OAAO,kBAAkB,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Returns true if the provided object implements the AsyncIterator protocol via\n * implementing a `Symbol.asyncIterator` method.\n *\n * @internal\n */\nexport function isAsyncIterable(\n maybeAsyncIterable: any,\n): maybeAsyncIterable is AsyncIterable {\n return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === 'function';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs new file mode 100644 index 00000000..c165ef8e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs @@ -0,0 +1,4 @@ +export function isAsyncIterable(maybeAsyncIterable) { + return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === 'function'; +} +//# sourceMappingURL=isAsyncIterable.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs.map new file mode 100644 index 00000000..1e0093a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isAsyncIterable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"isAsyncIterable.js","sourceRoot":"","sources":["../../src/jsutils/isAsyncIterable.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,eAAe,CAC7B,kBAAuB;IAEvB,OAAO,OAAO,kBAAkB,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Returns true if the provided object implements the AsyncIterator protocol via\n * implementing a `Symbol.asyncIterator` method.\n *\n * @internal\n */\nexport function isAsyncIterable(\n maybeAsyncIterable: any,\n): maybeAsyncIterable is AsyncIterable {\n return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === 'function';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.mts new file mode 100644 index 00000000..33cac592 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.mts @@ -0,0 +1,19 @@ +/** + * Returns true if the provided object is an Object (i.e. not a string literal) + * and implements the Iterator protocol. + * + * This may be used in place of [Array.isArray()][isArray] to determine if + * an object should be iterated-over e.g. Array, Map, Set, Int8Array, + * TypedArray, etc. but excludes string literals. + * + * @internal + * @example + * ```ts + * isIterableObject([1, 2, 3]); // => true + * isIterableObject(new Map()); // => true + * isIterableObject('ABC'); // => false + * isIterableObject({ key: 'value' }); // => false + * isIterableObject({ length: 1, 0: 'Alpha' }); // => false + * ``` + */ +export declare function isIterableObject(maybeIterable: any): maybeIterable is Iterable; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.ts new file mode 100644 index 00000000..33cac592 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.d.ts @@ -0,0 +1,19 @@ +/** + * Returns true if the provided object is an Object (i.e. not a string literal) + * and implements the Iterator protocol. + * + * This may be used in place of [Array.isArray()][isArray] to determine if + * an object should be iterated-over e.g. Array, Map, Set, Int8Array, + * TypedArray, etc. but excludes string literals. + * + * @internal + * @example + * ```ts + * isIterableObject([1, 2, 3]); // => true + * isIterableObject(new Map()); // => true + * isIterableObject('ABC'); // => false + * isIterableObject({ key: 'value' }); // => false + * isIterableObject({ length: 1, 0: 'Alpha' }); // => false + * ``` + */ +export declare function isIterableObject(maybeIterable: any): maybeIterable is Iterable; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js new file mode 100644 index 00000000..87d88d2a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isIterableObject = isIterableObject; +function isIterableObject(maybeIterable) { + return (typeof maybeIterable === 'object' && + typeof maybeIterable?.[Symbol.iterator] === 'function'); +} +//# sourceMappingURL=isIterableObject.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js.map new file mode 100644 index 00000000..0233a983 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isIterableObject.js","sourceRoot":"","sources":["../../src/jsutils/isIterableObject.ts"],"names":[],"mappings":";;AAkBA,4CAOC;AAPD,SAAgB,gBAAgB,CAC9B,aAAkB;IAElB,OAAO,CACL,OAAO,aAAa,KAAK,QAAQ;QACjC,OAAO,aAAa,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CACvD,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Returns true if the provided object is an Object (i.e. not a string literal)\n * and implements the Iterator protocol.\n *\n * This may be used in place of [Array.isArray()][isArray] to determine if\n * an object should be iterated-over e.g. Array, Map, Set, Int8Array,\n * TypedArray, etc. but excludes string literals.\n *\n * @internal\n * @example\n * ```ts\n * isIterableObject([1, 2, 3]); // => true\n * isIterableObject(new Map()); // => true\n * isIterableObject('ABC'); // => false\n * isIterableObject({ key: 'value' }); // => false\n * isIterableObject({ length: 1, 0: 'Alpha' }); // => false\n * ```\n */\nexport function isIterableObject(\n maybeIterable: any,\n): maybeIterable is Iterable {\n return (\n typeof maybeIterable === 'object' &&\n typeof maybeIterable?.[Symbol.iterator] === 'function'\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs new file mode 100644 index 00000000..3bdeb669 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs @@ -0,0 +1,5 @@ +export function isIterableObject(maybeIterable) { + return (typeof maybeIterable === 'object' && + typeof maybeIterable?.[Symbol.iterator] === 'function'); +} +//# sourceMappingURL=isIterableObject.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs.map new file mode 100644 index 00000000..8d12ca68 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isIterableObject.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"isIterableObject.js","sourceRoot":"","sources":["../../src/jsutils/isIterableObject.ts"],"names":[],"mappings":"AAkBA,MAAM,UAAU,gBAAgB,CAC9B,aAAkB;IAElB,OAAO,CACL,OAAO,aAAa,KAAK,QAAQ;QACjC,OAAO,aAAa,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CACvD,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Returns true if the provided object is an Object (i.e. not a string literal)\n * and implements the Iterator protocol.\n *\n * This may be used in place of [Array.isArray()][isArray] to determine if\n * an object should be iterated-over e.g. Array, Map, Set, Int8Array,\n * TypedArray, etc. but excludes string literals.\n *\n * @internal\n * @example\n * ```ts\n * isIterableObject([1, 2, 3]); // => true\n * isIterableObject(new Map()); // => true\n * isIterableObject('ABC'); // => false\n * isIterableObject({ key: 'value' }); // => false\n * isIterableObject({ length: 1, 0: 'Alpha' }); // => false\n * ```\n */\nexport function isIterableObject(\n maybeIterable: any,\n): maybeIterable is Iterable {\n return (\n typeof maybeIterable === 'object' &&\n typeof maybeIterable?.[Symbol.iterator] === 'function'\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.mts new file mode 100644 index 00000000..6dae7009 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.mts @@ -0,0 +1,9 @@ +/** + * Return true if `value` is object-like. A value is object-like if it's not + * `null` and has a `typeof` result of "object". + * + * @internal + */ +export declare function isObjectLike(value: unknown): value is { + [key: string]: unknown; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.ts new file mode 100644 index 00000000..6dae7009 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.d.ts @@ -0,0 +1,9 @@ +/** + * Return true if `value` is object-like. A value is object-like if it's not + * `null` and has a `typeof` result of "object". + * + * @internal + */ +export declare function isObjectLike(value: unknown): value is { + [key: string]: unknown; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js new file mode 100644 index 00000000..9ea8b49a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isObjectLike = isObjectLike; +function isObjectLike(value) { + return typeof value == 'object' && value !== null; +} +//# sourceMappingURL=isObjectLike.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js.map new file mode 100644 index 00000000..8a79e857 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isObjectLike.js","sourceRoot":"","sources":["../../src/jsutils/isObjectLike.ts"],"names":[],"mappings":";;AAMA,oCAIC;AAJD,SAAgB,YAAY,CAC1B,KAAc;IAEd,OAAO,OAAO,KAAK,IAAI,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACpD,CAAC","sourcesContent":["/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n *\n * @internal\n */\nexport function isObjectLike(\n value: unknown,\n): value is { [key: string]: unknown } {\n return typeof value == 'object' && value !== null;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs new file mode 100644 index 00000000..1bed149b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs @@ -0,0 +1,4 @@ +export function isObjectLike(value) { + return typeof value == 'object' && value !== null; +} +//# sourceMappingURL=isObjectLike.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs.map new file mode 100644 index 00000000..afba95d7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isObjectLike.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"isObjectLike.js","sourceRoot":"","sources":["../../src/jsutils/isObjectLike.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,YAAY,CAC1B,KAAc;IAEd,OAAO,OAAO,KAAK,IAAI,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACpD,CAAC","sourcesContent":["/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n *\n * @internal\n */\nexport function isObjectLike(\n value: unknown,\n): value is { [key: string]: unknown } {\n return typeof value == 'object' && value !== null;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.mts new file mode 100644 index 00000000..e4df74ed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.mts @@ -0,0 +1,9 @@ +/** @internal */ +export declare function isPromise(value: unknown): value is Promise; +/** + * Returns true if the value acts like a Promise, i.e. has a "then" function, + * otherwise returns false. + * + * @internal + */ +export declare function isPromiseLike(value: any): value is PromiseLike; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.ts new file mode 100644 index 00000000..e4df74ed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.d.ts @@ -0,0 +1,9 @@ +/** @internal */ +export declare function isPromise(value: unknown): value is Promise; +/** + * Returns true if the value acts like a Promise, i.e. has a "then" function, + * otherwise returns false. + * + * @internal + */ +export declare function isPromiseLike(value: any): value is PromiseLike; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js new file mode 100644 index 00000000..14e71002 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPromise = isPromise; +exports.isPromiseLike = isPromiseLike; +function isPromise(value) { + return value instanceof Promise; +} +function isPromiseLike(value) { + return typeof value?.then === 'function'; +} +//# sourceMappingURL=isPromise.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js.map new file mode 100644 index 00000000..18614d80 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isPromise.js","sourceRoot":"","sources":["../../src/jsutils/isPromise.ts"],"names":[],"mappings":";;AACA,8BAEC;AAQD,sCAEC;AAZD,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,KAAK,YAAY,OAAO,CAAC;AAClC,CAAC;AAQD,SAAgB,aAAa,CAAC,KAAU;IACtC,OAAO,OAAO,KAAK,EAAE,IAAI,KAAK,UAAU,CAAC;AAC3C,CAAC","sourcesContent":["/** @internal */\nexport function isPromise(value: unknown): value is Promise {\n return value instanceof Promise;\n}\n\n/**\n * Returns true if the value acts like a Promise, i.e. has a \"then\" function,\n * otherwise returns false.\n *\n * @internal\n */\nexport function isPromiseLike(value: any): value is PromiseLike {\n return typeof value?.then === 'function';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs new file mode 100644 index 00000000..4901c91a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs @@ -0,0 +1,7 @@ +export function isPromise(value) { + return value instanceof Promise; +} +export function isPromiseLike(value) { + return typeof value?.then === 'function'; +} +//# sourceMappingURL=isPromise.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs.map new file mode 100644 index 00000000..05c9e2fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isPromise.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"isPromise.js","sourceRoot":"","sources":["../../src/jsutils/isPromise.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,KAAK,YAAY,OAAO,CAAC;AAClC,CAAC;AAQD,MAAM,UAAU,aAAa,CAAC,KAAU;IACtC,OAAO,OAAO,KAAK,EAAE,IAAI,KAAK,UAAU,CAAC;AAC3C,CAAC","sourcesContent":["/** @internal */\nexport function isPromise(value: unknown): value is Promise {\n return value instanceof Promise;\n}\n\n/**\n * Returns true if the value acts like a Promise, i.e. has a \"then\" function,\n * otherwise returns false.\n *\n * @internal\n */\nexport function isPromiseLike(value: any): value is PromiseLike {\n return typeof value?.then === 'function';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.mts new file mode 100644 index 00000000..f75fdd9a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.mts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function isSameSet(setA: ReadonlySet, setB: ReadonlySet): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.ts new file mode 100644 index 00000000..f75fdd9a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.d.ts @@ -0,0 +1,2 @@ +/** @internal */ +export declare function isSameSet(setA: ReadonlySet, setB: ReadonlySet): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js new file mode 100644 index 00000000..811b485a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSameSet = isSameSet; +function isSameSet(setA, setB) { + if (setA.size !== setB.size) { + return false; + } + for (const item of setA) { + if (!setB.has(item)) { + return false; + } + } + return true; +} +//# sourceMappingURL=isSameSet.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js.map new file mode 100644 index 00000000..376add1c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isSameSet.js","sourceRoot":"","sources":["../../src/jsutils/isSameSet.ts"],"names":[],"mappings":";;AACA,8BAaC;AAbD,SAAgB,SAAS,CACvB,IAAoB,EACpB,IAAoB;IAEpB,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/** @internal */\nexport function isSameSet(\n setA: ReadonlySet,\n setB: ReadonlySet,\n): boolean {\n if (setA.size !== setB.size) {\n return false;\n }\n for (const item of setA) {\n if (!setB.has(item)) {\n return false;\n }\n }\n return true;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs new file mode 100644 index 00000000..a072b0f5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs @@ -0,0 +1,12 @@ +export function isSameSet(setA, setB) { + if (setA.size !== setB.size) { + return false; + } + for (const item of setA) { + if (!setB.has(item)) { + return false; + } + } + return true; +} +//# sourceMappingURL=isSameSet.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs.map new file mode 100644 index 00000000..40c3f43c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/isSameSet.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"isSameSet.js","sourceRoot":"","sources":["../../src/jsutils/isSameSet.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CACvB,IAAoB,EACpB,IAAoB;IAEpB,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/** @internal */\nexport function isSameSet(\n setA: ReadonlySet,\n setB: ReadonlySet,\n): boolean {\n if (setA.size !== setB.size) {\n return false;\n }\n for (const item of setA) {\n if (!setB.has(item)) {\n return false;\n }\n }\n return true;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.mts new file mode 100644 index 00000000..3ffc6472 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.mts @@ -0,0 +1,22 @@ +import type { ObjMap } from "./ObjMap.mjs"; +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * for each value in the array. + * + * This provides a convenient lookup for the array items if the key function + * produces unique results. + * @internal + * @example + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' }, + * ]; + * + * const entriesByName = keyMap(phoneBook, (entry) => entry.name); + * + * Object.keys(entriesByName); // => ['Jon', 'Jenny'] + * entriesByName['Jenny']; // => { name: 'Jenny', num: '867-5309' } + * ``` + */ +export declare function keyMap(list: ReadonlyArray, keyFn: (item: T) => string): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.ts new file mode 100644 index 00000000..e7b8a315 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.d.ts @@ -0,0 +1,22 @@ +import type { ObjMap } from "./ObjMap.js"; +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * for each value in the array. + * + * This provides a convenient lookup for the array items if the key function + * produces unique results. + * @internal + * @example + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' }, + * ]; + * + * const entriesByName = keyMap(phoneBook, (entry) => entry.name); + * + * Object.keys(entriesByName); // => ['Jon', 'Jenny'] + * entriesByName['Jenny']; // => { name: 'Jenny', num: '867-5309' } + * ``` + */ +export declare function keyMap(list: ReadonlyArray, keyFn: (item: T) => string): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js new file mode 100644 index 00000000..d08e8707 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.keyMap = keyMap; +function keyMap(list, keyFn) { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = item; + } + return result; +} +//# sourceMappingURL=keyMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js.map new file mode 100644 index 00000000..8a5ee32c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keyMap.js","sourceRoot":"","sources":["../../src/jsutils/keyMap.ts"],"names":[],"mappings":";;AAsBA,wBASC;AATD,SAAgB,MAAM,CACpB,IAAsB,EACtB,KAA0B;IAE1B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAC7B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ObjMap } from './ObjMap.ts';\n\n/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n * @internal\n * @example\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' },\n * ];\n *\n * const entriesByName = keyMap(phoneBook, (entry) => entry.name);\n *\n * Object.keys(entriesByName); // => ['Jon', 'Jenny']\n * entriesByName['Jenny']; // => { name: 'Jenny', num: '867-5309' }\n * ```\n */\nexport function keyMap(\n list: ReadonlyArray,\n keyFn: (item: T) => string,\n): ObjMap {\n const result = Object.create(null);\n for (const item of list) {\n result[keyFn(item)] = item;\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs new file mode 100644 index 00000000..76268243 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs @@ -0,0 +1,8 @@ +export function keyMap(list, keyFn) { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = item; + } + return result; +} +//# sourceMappingURL=keyMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs.map new file mode 100644 index 00000000..715a1c87 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyMap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keyMap.js","sourceRoot":"","sources":["../../src/jsutils/keyMap.ts"],"names":[],"mappings":"AAsBA,MAAM,UAAU,MAAM,CACpB,IAAsB,EACtB,KAA0B;IAE1B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAC7B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ObjMap } from './ObjMap.ts';\n\n/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n * @internal\n * @example\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' },\n * ];\n *\n * const entriesByName = keyMap(phoneBook, (entry) => entry.name);\n *\n * Object.keys(entriesByName); // => ['Jon', 'Jenny']\n * entriesByName['Jenny']; // => { name: 'Jenny', num: '867-5309' }\n * ```\n */\nexport function keyMap(\n list: ReadonlyArray,\n keyFn: (item: T) => string,\n): ObjMap {\n const result = Object.create(null);\n for (const item of list) {\n result[keyFn(item)] = item;\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.mts new file mode 100644 index 00000000..e0695611 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.mts @@ -0,0 +1,22 @@ +import type { ObjMap } from "./ObjMap.mjs"; +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * and a function to produce the values from each item in the array. + * @internal + * @example + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' }, + * ]; + * + * const phonesByName = keyValMap( + * phoneBook, + * (entry) => entry.name, + * (entry) => entry.num, + * ); + * + * phonesByName; // => { Jon: '555-1234', Jenny: '867-5309' } + * ``` + */ +export declare function keyValMap(list: ReadonlyArray, keyFn: (item: T) => string, valFn: (item: T) => V): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.ts new file mode 100644 index 00000000..720df214 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.d.ts @@ -0,0 +1,22 @@ +import type { ObjMap } from "./ObjMap.js"; +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * and a function to produce the values from each item in the array. + * @internal + * @example + * ```ts + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' }, + * ]; + * + * const phonesByName = keyValMap( + * phoneBook, + * (entry) => entry.name, + * (entry) => entry.num, + * ); + * + * phonesByName; // => { Jon: '555-1234', Jenny: '867-5309' } + * ``` + */ +export declare function keyValMap(list: ReadonlyArray, keyFn: (item: T) => string, valFn: (item: T) => V): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js new file mode 100644 index 00000000..2a868a14 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.keyValMap = keyValMap; +function keyValMap(list, keyFn, valFn) { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = valFn(item); + } + return result; +} +//# sourceMappingURL=keyValMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js.map new file mode 100644 index 00000000..df28326f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keyValMap.js","sourceRoot":"","sources":["../../src/jsutils/keyValMap.ts"],"names":[],"mappings":";;AAsBA,8BAUC;AAVD,SAAgB,SAAS,CACvB,IAAsB,EACtB,KAA0B,EAC1B,KAAqB;IAErB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ObjMap } from './ObjMap.ts';\n\n/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n * @internal\n * @example\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' },\n * ];\n *\n * const phonesByName = keyValMap(\n * phoneBook,\n * (entry) => entry.name,\n * (entry) => entry.num,\n * );\n *\n * phonesByName; // => { Jon: '555-1234', Jenny: '867-5309' }\n * ```\n */\nexport function keyValMap(\n list: ReadonlyArray,\n keyFn: (item: T) => string,\n valFn: (item: T) => V,\n): ObjMap {\n const result = Object.create(null);\n for (const item of list) {\n result[keyFn(item)] = valFn(item);\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs new file mode 100644 index 00000000..9b32bd77 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs @@ -0,0 +1,8 @@ +export function keyValMap(list, keyFn, valFn) { + const result = Object.create(null); + for (const item of list) { + result[keyFn(item)] = valFn(item); + } + return result; +} +//# sourceMappingURL=keyValMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs.map new file mode 100644 index 00000000..89c9688c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/keyValMap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keyValMap.js","sourceRoot":"","sources":["../../src/jsutils/keyValMap.ts"],"names":[],"mappings":"AAsBA,MAAM,UAAU,SAAS,CACvB,IAAsB,EACtB,KAA0B,EAC1B,KAAqB;IAErB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ObjMap } from './ObjMap.ts';\n\n/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n * @internal\n * @example\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' },\n * ];\n *\n * const phonesByName = keyValMap(\n * phoneBook,\n * (entry) => entry.name,\n * (entry) => entry.num,\n * );\n *\n * phonesByName; // => { Jon: '555-1234', Jenny: '867-5309' }\n * ```\n */\nexport function keyValMap(\n list: ReadonlyArray,\n keyFn: (item: T) => string,\n valFn: (item: T) => V,\n): ObjMap {\n const result = Object.create(null);\n for (const item of list) {\n result[keyFn(item)] = valFn(item);\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.mts new file mode 100644 index 00000000..cd5647aa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.mts @@ -0,0 +1,8 @@ +import type { ObjMap, ReadOnlyObjMap } from "./ObjMap.mjs"; +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + * + * @internal + */ +export declare function mapValue(map: ReadOnlyObjMap, fn: (value: T, key: string) => V): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.ts new file mode 100644 index 00000000..9ad900e6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.d.ts @@ -0,0 +1,8 @@ +import type { ObjMap, ReadOnlyObjMap } from "./ObjMap.js"; +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + * + * @internal + */ +export declare function mapValue(map: ReadOnlyObjMap, fn: (value: T, key: string) => V): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js new file mode 100644 index 00000000..be370650 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mapValue = mapValue; +function mapValue(map, fn) { + const result = Object.create(null); + for (const key of Object.keys(map)) { + result[key] = fn(map[key], key); + } + return result; +} +//# sourceMappingURL=mapValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js.map new file mode 100644 index 00000000..50daaca9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mapValue.js","sourceRoot":"","sources":["../../src/jsutils/mapValue.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAVD,SAAgB,QAAQ,CACtB,GAAsB,EACtB,EAAgC;IAEhC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEnC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ObjMap, ReadOnlyObjMap } from './ObjMap.ts';\n\n/**\n * Creates an object map with the same keys as `map` and values generated by\n * running each value of `map` thru `fn`.\n *\n * @internal\n */\nexport function mapValue(\n map: ReadOnlyObjMap,\n fn: (value: T, key: string) => V,\n): ObjMap {\n const result = Object.create(null);\n\n for (const key of Object.keys(map)) {\n result[key] = fn(map[key], key);\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs new file mode 100644 index 00000000..a85236ad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs @@ -0,0 +1,8 @@ +export function mapValue(map, fn) { + const result = Object.create(null); + for (const key of Object.keys(map)) { + result[key] = fn(map[key], key); + } + return result; +} +//# sourceMappingURL=mapValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs.map new file mode 100644 index 00000000..8f40e8b9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/mapValue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mapValue.js","sourceRoot":"","sources":["../../src/jsutils/mapValue.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,QAAQ,CACtB,GAAsB,EACtB,EAAgC;IAEhC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEnC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ObjMap, ReadOnlyObjMap } from './ObjMap.ts';\n\n/**\n * Creates an object map with the same keys as `map` and values generated by\n * running each value of `map` thru `fn`.\n *\n * @internal\n */\nexport function mapValue(\n map: ReadOnlyObjMap,\n fn: (value: T, key: string) => V,\n): ObjMap {\n const result = Object.create(null);\n\n for (const key of Object.keys(map)) {\n result[key] = fn(map[key], key);\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.mts new file mode 100644 index 00000000..0464f683 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.mts @@ -0,0 +1,6 @@ +/** + * Memoizes the provided one-argument function. + * + * @internal + */ +export declare function memoize1(fn: (a1: A1) => R): (a1: A1) => R; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.ts new file mode 100644 index 00000000..0464f683 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.d.ts @@ -0,0 +1,6 @@ +/** + * Memoizes the provided one-argument function. + * + * @internal + */ +export declare function memoize1(fn: (a1: A1) => R): (a1: A1) => R; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js new file mode 100644 index 00000000..c785c110 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.memoize1 = memoize1; +function memoize1(fn) { + let cache0; + return function memoized(a1) { + cache0 ??= new WeakMap(); + let fnResult = cache0.get(a1); + if (fnResult === undefined) { + fnResult = fn(a1); + cache0.set(a1, fnResult); + } + return fnResult; + }; +} +//# sourceMappingURL=memoize1.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js.map new file mode 100644 index 00000000..9617f316 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"memoize1.js","sourceRoot":"","sources":["../../src/jsutils/memoize1.ts"],"names":[],"mappings":";;AAKA,4BAgBC;AAhBD,SAAgB,QAAQ,CACtB,EAAiB;IAEjB,IAAI,MAAsB,CAAC;IAE3B,OAAO,SAAS,QAAQ,CAAC,EAAE;QACzB,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAEzB,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Memoizes the provided one-argument function.\n *\n * @internal\n */\nexport function memoize1(\n fn: (a1: A1) => R,\n): (a1: A1) => R {\n let cache0: WeakMap;\n\n return function memoized(a1) {\n cache0 ??= new WeakMap();\n\n let fnResult = cache0.get(a1);\n if (fnResult === undefined) {\n fnResult = fn(a1);\n cache0.set(a1, fnResult);\n }\n\n return fnResult;\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs new file mode 100644 index 00000000..15c83241 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs @@ -0,0 +1,13 @@ +export function memoize1(fn) { + let cache0; + return function memoized(a1) { + cache0 ??= new WeakMap(); + let fnResult = cache0.get(a1); + if (fnResult === undefined) { + fnResult = fn(a1); + cache0.set(a1, fnResult); + } + return fnResult; + }; +} +//# sourceMappingURL=memoize1.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs.map new file mode 100644 index 00000000..997e9119 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize1.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"memoize1.js","sourceRoot":"","sources":["../../src/jsutils/memoize1.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,QAAQ,CACtB,EAAiB;IAEjB,IAAI,MAAsB,CAAC;IAE3B,OAAO,SAAS,QAAQ,CAAC,EAAE;QACzB,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAEzB,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Memoizes the provided one-argument function.\n *\n * @internal\n */\nexport function memoize1(\n fn: (a1: A1) => R,\n): (a1: A1) => R {\n let cache0: WeakMap;\n\n return function memoized(a1) {\n cache0 ??= new WeakMap();\n\n let fnResult = cache0.get(a1);\n if (fnResult === undefined) {\n fnResult = fn(a1);\n cache0.set(a1, fnResult);\n }\n\n return fnResult;\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.mts new file mode 100644 index 00000000..fea7942f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.mts @@ -0,0 +1,6 @@ +/** + * Memoizes the provided two-argument function. + * + * @internal + */ +export declare function memoize2(fn: (a1: A1, a2: A2) => R): (a1: A1, a2: A2) => R; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.ts new file mode 100644 index 00000000..fea7942f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.d.ts @@ -0,0 +1,6 @@ +/** + * Memoizes the provided two-argument function. + * + * @internal + */ +export declare function memoize2(fn: (a1: A1, a2: A2) => R): (a1: A1, a2: A2) => R; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js new file mode 100644 index 00000000..eef7f6e7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.memoize2 = memoize2; +function memoize2(fn) { + let cache0; + return function memoized(a1, a2) { + cache0 ??= new WeakMap(); + let cache1 = cache0.get(a1); + if (cache1 === undefined) { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + let fnResult = cache1.get(a2); + if (fnResult === undefined) { + fnResult = fn(a1, a2); + cache1.set(a2, fnResult); + } + return fnResult; + }; +} +//# sourceMappingURL=memoize2.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js.map new file mode 100644 index 00000000..6559c70a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"memoize2.js","sourceRoot":"","sources":["../../src/jsutils/memoize2.ts"],"names":[],"mappings":";;AAKA,4BAsBC;AAtBD,SAAgB,QAAQ,CACtB,EAAyB;IAEzB,IAAI,MAAmC,CAAC;IAExC,OAAO,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE;QAC7B,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAEzB,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Memoizes the provided two-argument function.\n *\n * @internal\n */\nexport function memoize2(\n fn: (a1: A1, a2: A2) => R,\n): (a1: A1, a2: A2) => R {\n let cache0: WeakMap>;\n\n return function memoized(a1, a2) {\n cache0 ??= new WeakMap();\n\n let cache1 = cache0.get(a1);\n if (cache1 === undefined) {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n let fnResult = cache1.get(a2);\n if (fnResult === undefined) {\n fnResult = fn(a1, a2);\n cache1.set(a2, fnResult);\n }\n\n return fnResult;\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs new file mode 100644 index 00000000..22ea3ea8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs @@ -0,0 +1,18 @@ +export function memoize2(fn) { + let cache0; + return function memoized(a1, a2) { + cache0 ??= new WeakMap(); + let cache1 = cache0.get(a1); + if (cache1 === undefined) { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + let fnResult = cache1.get(a2); + if (fnResult === undefined) { + fnResult = fn(a1, a2); + cache1.set(a2, fnResult); + } + return fnResult; + }; +} +//# sourceMappingURL=memoize2.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs.map new file mode 100644 index 00000000..5f86c487 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize2.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"memoize2.js","sourceRoot":"","sources":["../../src/jsutils/memoize2.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,QAAQ,CACtB,EAAyB;IAEzB,IAAI,MAAmC,CAAC;IAExC,OAAO,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE;QAC7B,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAEzB,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Memoizes the provided two-argument function.\n *\n * @internal\n */\nexport function memoize2(\n fn: (a1: A1, a2: A2) => R,\n): (a1: A1, a2: A2) => R {\n let cache0: WeakMap>;\n\n return function memoized(a1, a2) {\n cache0 ??= new WeakMap();\n\n let cache1 = cache0.get(a1);\n if (cache1 === undefined) {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n let fnResult = cache1.get(a2);\n if (fnResult === undefined) {\n fnResult = fn(a1, a2);\n cache1.set(a2, fnResult);\n }\n\n return fnResult;\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.mts new file mode 100644 index 00000000..8f96bae3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.mts @@ -0,0 +1,6 @@ +/** + * Memoizes the provided three-argument function. + * + * @internal + */ +export declare function memoize3(fn: (a1: A1, a2: A2, a3: A3) => R): (a1: A1, a2: A2, a3: A3) => R; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.ts new file mode 100644 index 00000000..8f96bae3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.d.ts @@ -0,0 +1,6 @@ +/** + * Memoizes the provided three-argument function. + * + * @internal + */ +export declare function memoize3(fn: (a1: A1, a2: A2, a3: A3) => R): (a1: A1, a2: A2, a3: A3) => R; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js new file mode 100644 index 00000000..6e213853 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.memoize3 = memoize3; +function memoize3(fn) { + let cache0; + return function memoized(a1, a2, a3) { + cache0 ??= new WeakMap(); + let cache1 = cache0.get(a1); + if (cache1 === undefined) { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + let cache2 = cache1.get(a2); + if (cache2 === undefined) { + cache2 = new WeakMap(); + cache1.set(a2, cache2); + } + let fnResult = cache2.get(a3); + if (fnResult === undefined) { + fnResult = fn(a1, a2, a3); + cache2.set(a3, fnResult); + } + return fnResult; + }; +} +//# sourceMappingURL=memoize3.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js.map new file mode 100644 index 00000000..3c22aef9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"memoize3.js","sourceRoot":"","sources":["../../src/jsutils/memoize3.ts"],"names":[],"mappings":";;AAKA,4BA8BC;AA9BD,SAAgB,QAAQ,CAKtB,EAAiC;IACjC,IAAI,MAAgD,CAAC;IAErD,OAAO,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;QACjC,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAEzB,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC1B,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Memoizes the provided three-argument function.\n *\n * @internal\n */\nexport function memoize3<\n A1 extends object,\n A2 extends object,\n A3 extends object,\n R,\n>(fn: (a1: A1, a2: A2, a3: A3) => R): (a1: A1, a2: A2, a3: A3) => R {\n let cache0: WeakMap>>;\n\n return function memoized(a1, a2, a3) {\n cache0 ??= new WeakMap();\n\n let cache1 = cache0.get(a1);\n if (cache1 === undefined) {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n let cache2 = cache1.get(a2);\n if (cache2 === undefined) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n let fnResult = cache2.get(a3);\n if (fnResult === undefined) {\n fnResult = fn(a1, a2, a3);\n cache2.set(a3, fnResult);\n }\n return fnResult;\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs new file mode 100644 index 00000000..19a953f2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs @@ -0,0 +1,23 @@ +export function memoize3(fn) { + let cache0; + return function memoized(a1, a2, a3) { + cache0 ??= new WeakMap(); + let cache1 = cache0.get(a1); + if (cache1 === undefined) { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + let cache2 = cache1.get(a2); + if (cache2 === undefined) { + cache2 = new WeakMap(); + cache1.set(a2, cache2); + } + let fnResult = cache2.get(a3); + if (fnResult === undefined) { + fnResult = fn(a1, a2, a3); + cache2.set(a3, fnResult); + } + return fnResult; + }; +} +//# sourceMappingURL=memoize3.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs.map new file mode 100644 index 00000000..de41ddaa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/memoize3.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"memoize3.js","sourceRoot":"","sources":["../../src/jsutils/memoize3.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,QAAQ,CAKtB,EAAiC;IACjC,IAAI,MAAgD,CAAC;IAErD,OAAO,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;QACjC,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAEzB,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC1B,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Memoizes the provided three-argument function.\n *\n * @internal\n */\nexport function memoize3<\n A1 extends object,\n A2 extends object,\n A3 extends object,\n R,\n>(fn: (a1: A1, a2: A2, a3: A3) => R): (a1: A1, a2: A2, a3: A3) => R {\n let cache0: WeakMap>>;\n\n return function memoized(a1, a2, a3) {\n cache0 ??= new WeakMap();\n\n let cache1 = cache0.get(a1);\n if (cache1 === undefined) {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n let cache2 = cache1.get(a2);\n if (cache2 === undefined) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n let fnResult = cache2.get(a3);\n if (fnResult === undefined) {\n fnResult = fn(a1, a2, a3);\n cache2.set(a3, fnResult);\n }\n return fnResult;\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.mts new file mode 100644 index 00000000..bd64304f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.mts @@ -0,0 +1,9 @@ +/** + * Returns a number indicating whether a reference string comes before, or after, + * or is the same as the given string in natural sort order. + * + * See: https://en.wikipedia.org/wiki/Natural_sort_order + * + * @internal + */ +export declare function naturalCompare(aStr: string, bStr: string): number; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.ts new file mode 100644 index 00000000..bd64304f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.d.ts @@ -0,0 +1,9 @@ +/** + * Returns a number indicating whether a reference string comes before, or after, + * or is the same as the given string in natural sort order. + * + * See: https://en.wikipedia.org/wiki/Natural_sort_order + * + * @internal + */ +export declare function naturalCompare(aStr: string, bStr: string): number; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js new file mode 100644 index 00000000..dcae233c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.naturalCompare = naturalCompare; +function naturalCompare(aStr, bStr) { + let aIndex = 0; + let bIndex = 0; + while (aIndex < aStr.length && bIndex < bStr.length) { + let aChar = aStr.charCodeAt(aIndex); + let bChar = bStr.charCodeAt(bIndex); + if (isDigit(aChar) && isDigit(bChar)) { + let aNum = 0; + do { + ++aIndex; + aNum = aNum * 10 + aChar - DIGIT_0; + aChar = aStr.charCodeAt(aIndex); + } while (isDigit(aChar) && aNum > 0); + let bNum = 0; + do { + ++bIndex; + bNum = bNum * 10 + bChar - DIGIT_0; + bChar = bStr.charCodeAt(bIndex); + } while (isDigit(bChar) && bNum > 0); + if (aNum < bNum) { + return -1; + } + if (aNum > bNum) { + return 1; + } + } + else { + if (aChar < bChar) { + return -1; + } + if (aChar > bChar) { + return 1; + } + ++aIndex; + ++bIndex; + } + } + return aStr.length - bStr.length; +} +const DIGIT_0 = 48; +const DIGIT_9 = 57; +function isDigit(code) { + return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; +} +//# sourceMappingURL=naturalCompare.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js.map new file mode 100644 index 00000000..07636474 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"naturalCompare.js","sourceRoot":"","sources":["../../src/jsutils/naturalCompare.ts"],"names":[],"mappings":";;AAQA,wCA2CC;AA3CD,SAAgB,cAAc,CAAC,IAAY,EAAE,IAAY;IACvD,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,OAAO,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACpD,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAEpC,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACrC,IAAI,IAAI,GAAG,CAAC,CAAC;YACb,GAAG,CAAC;gBACF,EAAE,MAAM,CAAC;gBACT,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,CAAC;gBACnC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC,QAAQ,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE;YAErC,IAAI,IAAI,GAAG,CAAC,CAAC;YACb,GAAG,CAAC;gBACF,EAAE,MAAM,CAAC;gBACT,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,CAAC;gBACnC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC,QAAQ,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE;YAErC,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;gBAChB,OAAO,CAAC,CAAC,CAAC;YACZ,CAAC;YAED,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;gBAChB,OAAO,CAAC,CAAC;YACX,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,KAAK,GAAG,KAAK,EAAE,CAAC;gBAClB,OAAO,CAAC,CAAC,CAAC;YACZ,CAAC;YACD,IAAI,KAAK,GAAG,KAAK,EAAE,CAAC;gBAClB,OAAO,CAAC,CAAC;YACX,CAAC;YACD,EAAE,MAAM,CAAC;YACT,EAAE,MAAM,CAAC;QACX,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AACnC,CAAC;AAED,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * Returns a number indicating whether a reference string comes before, or after,\n * or is the same as the given string in natural sort order.\n *\n * See: https://en.wikipedia.org/wiki/Natural_sort_order\n *\n * @internal\n */\nexport function naturalCompare(aStr: string, bStr: string): number {\n let aIndex = 0;\n let bIndex = 0;\n\n while (aIndex < aStr.length && bIndex < bStr.length) {\n let aChar = aStr.charCodeAt(aIndex);\n let bChar = bStr.charCodeAt(bIndex);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n let aNum = 0;\n do {\n ++aIndex;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIndex);\n } while (isDigit(aChar) && aNum > 0);\n\n let bNum = 0;\n do {\n ++bIndex;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIndex);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n if (aChar > bChar) {\n return 1;\n }\n ++aIndex;\n ++bIndex;\n }\n }\n\n return aStr.length - bStr.length;\n}\n\nconst DIGIT_0 = 48;\nconst DIGIT_9 = 57;\n\nfunction isDigit(code: number): boolean {\n return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs new file mode 100644 index 00000000..7d21d53f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs @@ -0,0 +1,45 @@ +export function naturalCompare(aStr, bStr) { + let aIndex = 0; + let bIndex = 0; + while (aIndex < aStr.length && bIndex < bStr.length) { + let aChar = aStr.charCodeAt(aIndex); + let bChar = bStr.charCodeAt(bIndex); + if (isDigit(aChar) && isDigit(bChar)) { + let aNum = 0; + do { + ++aIndex; + aNum = aNum * 10 + aChar - DIGIT_0; + aChar = aStr.charCodeAt(aIndex); + } while (isDigit(aChar) && aNum > 0); + let bNum = 0; + do { + ++bIndex; + bNum = bNum * 10 + bChar - DIGIT_0; + bChar = bStr.charCodeAt(bIndex); + } while (isDigit(bChar) && bNum > 0); + if (aNum < bNum) { + return -1; + } + if (aNum > bNum) { + return 1; + } + } + else { + if (aChar < bChar) { + return -1; + } + if (aChar > bChar) { + return 1; + } + ++aIndex; + ++bIndex; + } + } + return aStr.length - bStr.length; +} +const DIGIT_0 = 48; +const DIGIT_9 = 57; +function isDigit(code) { + return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; +} +//# sourceMappingURL=naturalCompare.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs.map new file mode 100644 index 00000000..b22f4cf6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/naturalCompare.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"naturalCompare.js","sourceRoot":"","sources":["../../src/jsutils/naturalCompare.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,IAAY;IACvD,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,OAAO,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACpD,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAEpC,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACrC,IAAI,IAAI,GAAG,CAAC,CAAC;YACb,GAAG,CAAC;gBACF,EAAE,MAAM,CAAC;gBACT,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,CAAC;gBACnC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC,QAAQ,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE;YAErC,IAAI,IAAI,GAAG,CAAC,CAAC;YACb,GAAG,CAAC;gBACF,EAAE,MAAM,CAAC;gBACT,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,CAAC;gBACnC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC,QAAQ,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE;YAErC,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;gBAChB,OAAO,CAAC,CAAC,CAAC;YACZ,CAAC;YAED,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;gBAChB,OAAO,CAAC,CAAC;YACX,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,KAAK,GAAG,KAAK,EAAE,CAAC;gBAClB,OAAO,CAAC,CAAC,CAAC;YACZ,CAAC;YACD,IAAI,KAAK,GAAG,KAAK,EAAE,CAAC;gBAClB,OAAO,CAAC,CAAC;YACX,CAAC;YACD,EAAE,MAAM,CAAC;YACT,EAAE,MAAM,CAAC;QACX,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AACnC,CAAC;AAED,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * Returns a number indicating whether a reference string comes before, or after,\n * or is the same as the given string in natural sort order.\n *\n * See: https://en.wikipedia.org/wiki/Natural_sort_order\n *\n * @internal\n */\nexport function naturalCompare(aStr: string, bStr: string): number {\n let aIndex = 0;\n let bIndex = 0;\n\n while (aIndex < aStr.length && bIndex < bStr.length) {\n let aChar = aStr.charCodeAt(aIndex);\n let bChar = bStr.charCodeAt(bIndex);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n let aNum = 0;\n do {\n ++aIndex;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIndex);\n } while (isDigit(aChar) && aNum > 0);\n\n let bNum = 0;\n do {\n ++bIndex;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIndex);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n if (aChar > bChar) {\n return 1;\n }\n ++aIndex;\n ++bIndex;\n }\n }\n\n return aStr.length - bStr.length;\n}\n\nconst DIGIT_0 = 48;\nconst DIGIT_9 = 57;\n\nfunction isDigit(code: number): boolean {\n return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.mts new file mode 100644 index 00000000..e071d736 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.mts @@ -0,0 +1,6 @@ +/** + * Build a string describing the path. + * + * @internal + */ +export declare function printPathArray(path: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.ts new file mode 100644 index 00000000..e071d736 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.d.ts @@ -0,0 +1,6 @@ +/** + * Build a string describing the path. + * + * @internal + */ +export declare function printPathArray(path: ReadonlyArray): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js new file mode 100644 index 00000000..6307363d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.printPathArray = printPathArray; +function printPathArray(path) { + if (path.length === 0) { + return ''; + } + return ` at ${path + .map((key) => (typeof key === 'number' ? `[${key}]` : `.${key}`)) + .join('')}`; +} +//# sourceMappingURL=printPathArray.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js.map new file mode 100644 index 00000000..ce2fc53d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.js.map @@ -0,0 +1 @@ +{"version":3,"file":"printPathArray.js","sourceRoot":"","sources":["../../src/jsutils/printPathArray.ts"],"names":[],"mappings":";;AAKA,wCAOC;AAPD,SAAgB,cAAc,CAAC,IAAoC;IACjE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,IAAI;SACf,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;SAChE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Build a string describing the path.\n *\n * @internal\n */\nexport function printPathArray(path: ReadonlyArray): string {\n if (path.length === 0) {\n return '';\n }\n return ` at ${path\n .map((key) => (typeof key === 'number' ? `[${key}]` : `.${key}`))\n .join('')}`;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs new file mode 100644 index 00000000..9e256dd6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs @@ -0,0 +1,9 @@ +export function printPathArray(path) { + if (path.length === 0) { + return ''; + } + return ` at ${path + .map((key) => (typeof key === 'number' ? `[${key}]` : `.${key}`)) + .join('')}`; +} +//# sourceMappingURL=printPathArray.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs.map new file mode 100644 index 00000000..23e25461 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/printPathArray.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"printPathArray.js","sourceRoot":"","sources":["../../src/jsutils/printPathArray.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,cAAc,CAAC,IAAoC;IACjE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,IAAI;SACf,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;SAChE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Build a string describing the path.\n *\n * @internal\n */\nexport function printPathArray(path: ReadonlyArray): string {\n if (path.length === 0) {\n return '';\n }\n return ` at ${path\n .map((key) => (typeof key === 'number' ? `[${key}]` : `.${key}`))\n .join('')}`;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.mts new file mode 100644 index 00000000..f8d55c20 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.mts @@ -0,0 +1,12 @@ +import type { ObjMap } from "./ObjMap.mjs"; +import type { PromiseOrValue } from "./PromiseOrValue.mjs"; +/** + * This function transforms a JS object `ObjMap>` into + * a `Promise>` + * + * This is akin to bluebird's `Promise.props`, but implemented only using + * `Promise.all` so it will work with any implementation of ES6 promises. + * + * @internal + */ +export declare function promiseForObject(object: Readonly>>, promiseAll: (values: ReadonlyArray>) => Promise>): Promise>; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.ts new file mode 100644 index 00000000..b41b8f4a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.d.ts @@ -0,0 +1,12 @@ +import type { ObjMap } from "./ObjMap.js"; +import type { PromiseOrValue } from "./PromiseOrValue.js"; +/** + * This function transforms a JS object `ObjMap>` into + * a `Promise>` + * + * This is akin to bluebird's `Promise.props`, but implemented only using + * `Promise.all` so it will work with any implementation of ES6 promises. + * + * @internal + */ +export declare function promiseForObject(object: Readonly>>, promiseAll: (values: ReadonlyArray>) => Promise>): Promise>; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js new file mode 100644 index 00000000..cf4a1a1e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.promiseForObject = promiseForObject; +function promiseForObject(object, promiseAll) { + const keys = Object.keys(object); + const values = Object.values(object); + return promiseAll(values).then((resolvedValues) => { + const resolvedObject = Object.create(null); + for (let i = 0; i < keys.length; ++i) { + resolvedObject[keys[i]] = resolvedValues[i]; + } + return resolvedObject; + }); +} +//# sourceMappingURL=promiseForObject.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js.map new file mode 100644 index 00000000..fca616ad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.js.map @@ -0,0 +1 @@ +{"version":3,"file":"promiseForObject.js","sourceRoot":"","sources":["../../src/jsutils/promiseForObject.ts"],"names":[],"mappings":";;AAYA,4CAgBC;AAhBD,SAAgB,gBAAgB,CAC9B,MAA2C,EAC3C,UAE2B;IAE3B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,EAAE;QAChD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACrC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ObjMap } from './ObjMap.ts';\nimport type { PromiseOrValue } from './PromiseOrValue.ts';\n\n/**\n * This function transforms a JS object `ObjMap>` into\n * a `Promise>`\n *\n * This is akin to bluebird's `Promise.props`, but implemented only using\n * `Promise.all` so it will work with any implementation of ES6 promises.\n *\n * @internal\n */\nexport function promiseForObject(\n object: Readonly>>,\n promiseAll: (\n values: ReadonlyArray>,\n ) => Promise>,\n): Promise> {\n const keys = Object.keys(object);\n const values = Object.values(object);\n\n return promiseAll(values).then((resolvedValues) => {\n const resolvedObject = Object.create(null);\n for (let i = 0; i < keys.length; ++i) {\n resolvedObject[keys[i]] = resolvedValues[i];\n }\n return resolvedObject;\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs new file mode 100644 index 00000000..692ea081 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs @@ -0,0 +1,12 @@ +export function promiseForObject(object, promiseAll) { + const keys = Object.keys(object); + const values = Object.values(object); + return promiseAll(values).then((resolvedValues) => { + const resolvedObject = Object.create(null); + for (let i = 0; i < keys.length; ++i) { + resolvedObject[keys[i]] = resolvedValues[i]; + } + return resolvedObject; + }); +} +//# sourceMappingURL=promiseForObject.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs.map new file mode 100644 index 00000000..f44190c5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseForObject.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"promiseForObject.js","sourceRoot":"","sources":["../../src/jsutils/promiseForObject.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,gBAAgB,CAC9B,MAA2C,EAC3C,UAE2B;IAE3B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,EAAE;QAChD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACrC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ObjMap } from './ObjMap.ts';\nimport type { PromiseOrValue } from './PromiseOrValue.ts';\n\n/**\n * This function transforms a JS object `ObjMap>` into\n * a `Promise>`\n *\n * This is akin to bluebird's `Promise.props`, but implemented only using\n * `Promise.all` so it will work with any implementation of ES6 promises.\n *\n * @internal\n */\nexport function promiseForObject(\n object: Readonly>>,\n promiseAll: (\n values: ReadonlyArray>,\n ) => Promise>,\n): Promise> {\n const keys = Object.keys(object);\n const values = Object.values(object);\n\n return promiseAll(values).then((resolvedValues) => {\n const resolvedObject = Object.create(null);\n for (let i = 0; i < keys.length; ++i) {\n resolvedObject[keys[i]] = resolvedValues[i];\n }\n return resolvedObject;\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.mts new file mode 100644 index 00000000..325132a9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.mts @@ -0,0 +1,11 @@ +import type { PromiseOrValue } from "./PromiseOrValue.mjs"; +/** + * Similar to Array.prototype.reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + * + * @internal + */ +export declare function promiseReduce(values: Iterable, callbackFn: (accumulator: U, currentValue: T) => PromiseOrValue, initialValue: PromiseOrValue): PromiseOrValue; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.ts new file mode 100644 index 00000000..b724a46e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.d.ts @@ -0,0 +1,11 @@ +import type { PromiseOrValue } from "./PromiseOrValue.js"; +/** + * Similar to Array.prototype.reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + * + * @internal + */ +export declare function promiseReduce(values: Iterable, callbackFn: (accumulator: U, currentValue: T) => PromiseOrValue, initialValue: PromiseOrValue): PromiseOrValue; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js new file mode 100644 index 00000000..11dac9cd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.promiseReduce = promiseReduce; +const isPromise_ts_1 = require("./isPromise.js"); +function promiseReduce(values, callbackFn, initialValue) { + let accumulator = initialValue; + for (const value of values) { + accumulator = (0, isPromise_ts_1.isPromise)(accumulator) + ? accumulator.then((resolved) => callbackFn(resolved, value)) + : callbackFn(accumulator, value); + } + return accumulator; +} +//# sourceMappingURL=promiseReduce.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js.map new file mode 100644 index 00000000..9e9eb5b3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.js.map @@ -0,0 +1 @@ +{"version":3,"file":"promiseReduce.js","sourceRoot":"","sources":["../../src/jsutils/promiseReduce.ts"],"names":[],"mappings":";;AAYA,sCAYC;AAxBD,iDAA2C;AAY3C,SAAgB,aAAa,CAC3B,MAAmB,EACnB,UAAkE,EAClE,YAA+B;IAE/B,IAAI,WAAW,GAAG,YAAY,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,WAAW,GAAG,IAAA,wBAAS,EAAC,WAAW,CAAC;YAClC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC7D,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { isPromise } from './isPromise.ts';\nimport type { PromiseOrValue } from './PromiseOrValue.ts';\n\n/**\n * Similar to Array.prototype.reduce(), however the reducing callback may return\n * a Promise, in which case reduction will continue after each promise resolves.\n *\n * If the callback does not return a Promise, then this function will also not\n * return a Promise.\n *\n * @internal\n */\nexport function promiseReduce(\n values: Iterable,\n callbackFn: (accumulator: U, currentValue: T) => PromiseOrValue,\n initialValue: PromiseOrValue,\n): PromiseOrValue {\n let accumulator = initialValue;\n for (const value of values) {\n accumulator = isPromise(accumulator)\n ? accumulator.then((resolved) => callbackFn(resolved, value))\n : callbackFn(accumulator, value);\n }\n return accumulator;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs new file mode 100644 index 00000000..e324a4d7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs @@ -0,0 +1,11 @@ +import { isPromise } from "./isPromise.mjs"; +export function promiseReduce(values, callbackFn, initialValue) { + let accumulator = initialValue; + for (const value of values) { + accumulator = isPromise(accumulator) + ? accumulator.then((resolved) => callbackFn(resolved, value)) + : callbackFn(accumulator, value); + } + return accumulator; +} +//# sourceMappingURL=promiseReduce.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs.map new file mode 100644 index 00000000..c87c91dd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseReduce.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"promiseReduce.js","sourceRoot":"","sources":["../../src/jsutils/promiseReduce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,wBAAuB;AAY3C,MAAM,UAAU,aAAa,CAC3B,MAAmB,EACnB,UAAkE,EAClE,YAA+B;IAE/B,IAAI,WAAW,GAAG,YAAY,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC;YAClC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC7D,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { isPromise } from './isPromise.ts';\nimport type { PromiseOrValue } from './PromiseOrValue.ts';\n\n/**\n * Similar to Array.prototype.reduce(), however the reducing callback may return\n * a Promise, in which case reduction will continue after each promise resolves.\n *\n * If the callback does not return a Promise, then this function will also not\n * return a Promise.\n *\n * @internal\n */\nexport function promiseReduce(\n values: Iterable,\n callbackFn: (accumulator: U, currentValue: T) => PromiseOrValue,\n initialValue: PromiseOrValue,\n): PromiseOrValue {\n let accumulator = initialValue;\n for (const value of values) {\n accumulator = isPromise(accumulator)\n ? accumulator.then((resolved) => callbackFn(resolved, value))\n : callbackFn(accumulator, value);\n }\n return accumulator;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.mts new file mode 100644 index 00000000..b369c0ff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.mts @@ -0,0 +1,12 @@ +import type { PromiseOrValue } from "./PromiseOrValue.mjs"; +/** + * Based on Promise.withResolvers proposal + * https://github.com/tc39/proposal-promise-with-resolvers + * + * @internal + */ +export declare function promiseWithResolvers(): { + promise: Promise; + resolve: (value: T | PromiseOrValue) => void; + reject: (reason?: any) => void; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.ts new file mode 100644 index 00000000..fa55ca60 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.d.ts @@ -0,0 +1,12 @@ +import type { PromiseOrValue } from "./PromiseOrValue.js"; +/** + * Based on Promise.withResolvers proposal + * https://github.com/tc39/proposal-promise-with-resolvers + * + * @internal + */ +export declare function promiseWithResolvers(): { + promise: Promise; + resolve: (value: T | PromiseOrValue) => void; + reject: (reason?: any) => void; +}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js new file mode 100644 index 00000000..1ca99026 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.promiseWithResolvers = promiseWithResolvers; +function promiseWithResolvers() { + let resolve; + let reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; +} +//# sourceMappingURL=promiseWithResolvers.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js.map new file mode 100644 index 00000000..93201916 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"promiseWithResolvers.js","sourceRoot":"","sources":["../../src/jsutils/promiseWithResolvers.ts"],"names":[],"mappings":";;AAQA,oDAaC;AAbD,SAAgB,oBAAoB;IAMlC,IAAI,OAAgD,CAAC;IACrD,IAAI,MAA+B,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC","sourcesContent":["import type { PromiseOrValue } from './PromiseOrValue.ts';\n\n/**\n * Based on Promise.withResolvers proposal\n * https://github.com/tc39/proposal-promise-with-resolvers\n *\n * @internal\n */\nexport function promiseWithResolvers(): {\n promise: Promise;\n resolve: (value: T | PromiseOrValue) => void;\n reject: (reason?: any) => void;\n} {\n // these are assigned synchronously within the Promise constructor\n let resolve!: (value: T | PromiseOrValue) => void;\n let reject!: (reason?: any) => void;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs new file mode 100644 index 00000000..1b86df6c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs @@ -0,0 +1,10 @@ +export function promiseWithResolvers() { + let resolve; + let reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; +} +//# sourceMappingURL=promiseWithResolvers.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs.map new file mode 100644 index 00000000..b76174c3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/promiseWithResolvers.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"promiseWithResolvers.js","sourceRoot":"","sources":["../../src/jsutils/promiseWithResolvers.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,oBAAoB;IAMlC,IAAI,OAAgD,CAAC;IACrD,IAAI,MAA+B,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC","sourcesContent":["import type { PromiseOrValue } from './PromiseOrValue.ts';\n\n/**\n * Based on Promise.withResolvers proposal\n * https://github.com/tc39/proposal-promise-with-resolvers\n *\n * @internal\n */\nexport function promiseWithResolvers(): {\n promise: Promise;\n resolve: (value: T | PromiseOrValue) => void;\n reject: (reason?: any) => void;\n} {\n // these are assigned synchronously within the Promise constructor\n let resolve!: (value: T | PromiseOrValue) => void;\n let reject!: (reason?: any) => void;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.mts new file mode 100644 index 00000000..d7330cfa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.mts @@ -0,0 +1,7 @@ +/** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + * + * @internal + */ +export declare function suggestionList(input: string, options: ReadonlyArray): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.ts new file mode 100644 index 00000000..d7330cfa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.d.ts @@ -0,0 +1,7 @@ +/** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + * + * @internal + */ +export declare function suggestionList(input: string, options: ReadonlyArray): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js new file mode 100644 index 00000000..cbb2e39f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.suggestionList = suggestionList; +const naturalCompare_ts_1 = require("./naturalCompare.js"); +function suggestionList(input, options) { + const optionsByDistance = Object.create(null); + const lexicalDistance = new LexicalDistance(input); + const threshold = Math.floor(input.length * 0.4) + 1; + for (const option of options) { + const distance = lexicalDistance.measure(option, threshold); + if (distance !== undefined) { + optionsByDistance[option] = distance; + } + } + return Object.keys(optionsByDistance).sort((a, b) => { + const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; + return distanceDiff !== 0 ? distanceDiff : (0, naturalCompare_ts_1.naturalCompare)(a, b); + }); +} +class LexicalDistance { + constructor(input) { + this._input = input; + this._inputLowerCase = input.toLowerCase(); + this._inputArray = stringToArray(this._inputLowerCase); + this._rows = [ + new Array(input.length + 1).fill(0), + new Array(input.length + 1).fill(0), + new Array(input.length + 1).fill(0), + ]; + } + measure(option, threshold) { + if (this._input === option) { + return 0; + } + const optionLowerCase = option.toLowerCase(); + if (this._inputLowerCase === optionLowerCase) { + return 1; + } + let a = stringToArray(optionLowerCase); + let b = this._inputArray; + if (a.length < b.length) { + const tmp = a; + a = b; + b = tmp; + } + const aLength = a.length; + const bLength = b.length; + if (aLength - bLength > threshold) { + return undefined; + } + const rows = this._rows; + for (let j = 0; j <= bLength; j++) { + rows[0][j] = j; + } + for (let i = 1; i <= aLength; i++) { + const upRow = rows[(i - 1) % 3]; + const currentRow = rows[i % 3]; + let smallestCell = (currentRow[0] = i); + for (let j = 1; j <= bLength; j++) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + let currentCell = Math.min(upRow[j] + 1, currentRow[j - 1] + 1, upRow[j - 1] + cost); + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; + currentCell = Math.min(currentCell, doubleDiagonalCell + 1); + } + if (currentCell < smallestCell) { + smallestCell = currentCell; + } + currentRow[j] = currentCell; + } + if (smallestCell > threshold) { + return undefined; + } + } + const distance = rows[aLength % 3][bLength]; + return distance <= threshold ? distance : undefined; + } +} +function stringToArray(str) { + const strLength = str.length; + const array = new Array(strLength); + for (let i = 0; i < strLength; ++i) { + array[i] = str.charCodeAt(i); + } + return array; +} +//# sourceMappingURL=suggestionList.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js.map new file mode 100644 index 00000000..8e5579b2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"suggestionList.js","sourceRoot":"","sources":["../../src/jsutils/suggestionList.ts"],"names":[],"mappings":";;AAQA,wCAmBC;AA3BD,2DAAqD;AAQrD,SAAgB,cAAc,CAC5B,KAAa,EACb,OAA8B;IAE9B,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;IAEnD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACrD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC5D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,iBAAiB,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAClD,MAAM,YAAY,GAAG,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAA,kCAAc,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC;AAkBD,MAAM,eAAe;IAMnB,YAAY,KAAa;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAC3C,IAAI,C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AAC;oBACpD,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,GAAG,CAAC,CAAC,CAAC;gBAC9D,CAAC;gBAED,IAAI,WAAW,GAAG,YAAY,EAAE,CAAC;oBAC/B,YAAY,GAAG,WAAW,CAAC;gBAC7B,CAAC;gBAED,UAAU,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;YAC9B,CAAC;YAGD,IAAI,YAAY,GAAG,SAAS,EAAE,CAAC;gBAC7B,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,IAAI,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,CAAC;CACF;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC;IAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { naturalCompare } from './naturalCompare.ts';\n\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n *\n * @internal\n */\nexport function suggestionList(\n input: string,\n options: ReadonlyArray,\n): Array {\n const optionsByDistance = Object.create(null);\n const lexicalDistance = new LexicalDistance(input);\n\n const threshold = Math.floor(input.length * 0.4) + 1;\n for (const option of options) {\n const distance = lexicalDistance.measure(option, threshold);\n if (distance !== undefined) {\n optionsByDistance[option] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort((a, b) => {\n const distanceDiff = optionsByDistance[a] - optionsByDistance[b];\n return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);\n });\n}\n\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n *\n * @internal\n */\nclass LexicalDistance {\n _input: string;\n _inputLowerCase: string;\n _inputArray: Array;\n _rows: [Array, Array, Array];\n\n constructor(input: string) {\n this._input = input;\n this._inputLowerCase = input.toLowerCase();\n this._inputArray = stringToArray(this._inputLowerCase);\n\n this._rows = [\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n ];\n }\n\n measure(option: string, threshold: number): number | undefined {\n if (this._input === option) {\n return 0;\n }\n\n const optionLowerCase = option.toLowerCase();\n\n // Any case change counts as a single edit\n if (this._inputLowerCase === optionLowerCase) {\n return 1;\n }\n\n let a = stringToArray(optionLowerCase);\n let b = this._inputArray;\n\n if (a.length < b.length) {\n const tmp = a;\n a = b;\n b = tmp;\n }\n const aLength = a.length;\n const bLength = b.length;\n\n if (aLength - bLength > threshold) {\n return undefined;\n }\n\n const rows = this._rows;\n for (let j = 0; j <= bLength; j++) {\n rows[0][j] = j;\n }\n\n for (let i = 1; i <= aLength; i++) {\n const upRow = rows[(i - 1) % 3];\n const currentRow = rows[i % 3];\n\n let smallestCell = (currentRow[0] = i);\n for (let j = 1; j <= bLength; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n\n let currentCell = Math.min(\n upRow[j] + 1, // delete\n currentRow[j - 1] + 1, // insert\n upRow[j - 1] + cost, // substitute\n );\n\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n // transposition\n const doubleDiagonalCell = rows[(i - 2) % 3][j - 2];\n currentCell = Math.min(currentCell, doubleDiagonalCell + 1);\n }\n\n if (currentCell < smallestCell) {\n smallestCell = currentCell;\n }\n\n currentRow[j] = currentCell;\n }\n\n // Early exit, since distance can't go smaller than smallest element of the previous row.\n if (smallestCell > threshold) {\n return undefined;\n }\n }\n\n const distance = rows[aLength % 3][bLength];\n return distance <= threshold ? distance : undefined;\n }\n}\n\nfunction stringToArray(str: string): Array {\n const strLength = str.length;\n const array = new Array(strLength);\n for (let i = 0; i < strLength; ++i) {\n array[i] = str.charCodeAt(i);\n }\n return array;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs new file mode 100644 index 00000000..ee65a58f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs @@ -0,0 +1,84 @@ +import { naturalCompare } from "./naturalCompare.mjs"; +export function suggestionList(input, options) { + const optionsByDistance = Object.create(null); + const lexicalDistance = new LexicalDistance(input); + const threshold = Math.floor(input.length * 0.4) + 1; + for (const option of options) { + const distance = lexicalDistance.measure(option, threshold); + if (distance !== undefined) { + optionsByDistance[option] = distance; + } + } + return Object.keys(optionsByDistance).sort((a, b) => { + const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; + return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b); + }); +} +class LexicalDistance { + constructor(input) { + this._input = input; + this._inputLowerCase = input.toLowerCase(); + this._inputArray = stringToArray(this._inputLowerCase); + this._rows = [ + new Array(input.length + 1).fill(0), + new Array(input.length + 1).fill(0), + new Array(input.length + 1).fill(0), + ]; + } + measure(option, threshold) { + if (this._input === option) { + return 0; + } + const optionLowerCase = option.toLowerCase(); + if (this._inputLowerCase === optionLowerCase) { + return 1; + } + let a = stringToArray(optionLowerCase); + let b = this._inputArray; + if (a.length < b.length) { + const tmp = a; + a = b; + b = tmp; + } + const aLength = a.length; + const bLength = b.length; + if (aLength - bLength > threshold) { + return undefined; + } + const rows = this._rows; + for (let j = 0; j <= bLength; j++) { + rows[0][j] = j; + } + for (let i = 1; i <= aLength; i++) { + const upRow = rows[(i - 1) % 3]; + const currentRow = rows[i % 3]; + let smallestCell = (currentRow[0] = i); + for (let j = 1; j <= bLength; j++) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + let currentCell = Math.min(upRow[j] + 1, currentRow[j - 1] + 1, upRow[j - 1] + cost); + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; + currentCell = Math.min(currentCell, doubleDiagonalCell + 1); + } + if (currentCell < smallestCell) { + smallestCell = currentCell; + } + currentRow[j] = currentCell; + } + if (smallestCell > threshold) { + return undefined; + } + } + const distance = rows[aLength % 3][bLength]; + return distance <= threshold ? distance : undefined; + } +} +function stringToArray(str) { + const strLength = str.length; + const array = new Array(strLength); + for (let i = 0; i < strLength; ++i) { + array[i] = str.charCodeAt(i); + } + return array; +} +//# sourceMappingURL=suggestionList.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs.map new file mode 100644 index 00000000..02622ede --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/suggestionList.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"suggestionList.js","sourceRoot":"","sources":["../../src/jsutils/suggestionList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAA4B;AAQrD,MAAM,UAAU,cAAc,CAC5B,KAAa,EACb,OAA8B;IAE9B,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IA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B,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,QAAQ,IAAI,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,CAAC;CACF;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC;IAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { naturalCompare } from './naturalCompare.ts';\n\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n *\n * @internal\n */\nexport function suggestionList(\n input: string,\n options: ReadonlyArray,\n): Array {\n const optionsByDistance = Object.create(null);\n const lexicalDistance = new LexicalDistance(input);\n\n const threshold = Math.floor(input.length * 0.4) + 1;\n for (const option of options) {\n const distance = lexicalDistance.measure(option, threshold);\n if (distance !== undefined) {\n optionsByDistance[option] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort((a, b) => {\n const distanceDiff = optionsByDistance[a] - optionsByDistance[b];\n return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);\n });\n}\n\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n *\n * @internal\n */\nclass LexicalDistance {\n _input: string;\n _inputLowerCase: string;\n _inputArray: Array;\n _rows: [Array, Array, Array];\n\n constructor(input: string) {\n this._input = input;\n this._inputLowerCase = input.toLowerCase();\n this._inputArray = stringToArray(this._inputLowerCase);\n\n this._rows = [\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n ];\n }\n\n measure(option: string, threshold: number): number | undefined {\n if (this._input === option) {\n return 0;\n }\n\n const optionLowerCase = option.toLowerCase();\n\n // Any case change counts as a single edit\n if (this._inputLowerCase === optionLowerCase) {\n return 1;\n }\n\n let a = stringToArray(optionLowerCase);\n let b = this._inputArray;\n\n if (a.length < b.length) {\n const tmp = a;\n a = b;\n b = tmp;\n }\n const aLength = a.length;\n const bLength = b.length;\n\n if (aLength - bLength > threshold) {\n return undefined;\n }\n\n const rows = this._rows;\n for (let j = 0; j <= bLength; j++) {\n rows[0][j] = j;\n }\n\n for (let i = 1; i <= aLength; i++) {\n const upRow = rows[(i - 1) % 3];\n const currentRow = rows[i % 3];\n\n let smallestCell = (currentRow[0] = i);\n for (let j = 1; j <= bLength; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n\n let currentCell = Math.min(\n upRow[j] + 1, // delete\n currentRow[j - 1] + 1, // insert\n upRow[j - 1] + cost, // substitute\n );\n\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n // transposition\n const doubleDiagonalCell = rows[(i - 2) % 3][j - 2];\n currentCell = Math.min(currentCell, doubleDiagonalCell + 1);\n }\n\n if (currentCell < smallestCell) {\n smallestCell = currentCell;\n }\n\n currentRow[j] = currentCell;\n }\n\n // Early exit, since distance can't go smaller than smallest element of the previous row.\n if (smallestCell > threshold) {\n return undefined;\n }\n }\n\n const distance = rows[aLength % 3][bLength];\n return distance <= threshold ? distance : undefined;\n }\n}\n\nfunction stringToArray(str: string): Array {\n const strLength = str.length;\n const array = new Array(strLength);\n for (let i = 0; i < strLength; ++i) {\n array[i] = str.charCodeAt(i);\n }\n return array;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.mts new file mode 100644 index 00000000..58bff7aa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.mts @@ -0,0 +1,6 @@ +/** + * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. + * + * @internal + */ +export declare function toError(thrownValue: unknown): Error; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.ts new file mode 100644 index 00000000..58bff7aa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.d.ts @@ -0,0 +1,6 @@ +/** + * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. + * + * @internal + */ +export declare function toError(thrownValue: unknown): Error; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js new file mode 100644 index 00000000..9e9bdd9c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toError = toError; +const inspect_ts_1 = require("./inspect.js"); +function toError(thrownValue) { + return thrownValue instanceof Error + ? thrownValue + : new NonErrorThrown(thrownValue); +} +class NonErrorThrown extends Error { + constructor(thrownValue) { + super('Unexpected error value: ' + (0, inspect_ts_1.inspect)(thrownValue)); + this.name = 'NonErrorThrown'; + this.thrownValue = thrownValue; + } +} +//# sourceMappingURL=toError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js.map new file mode 100644 index 00000000..74e095e7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"toError.js","sourceRoot":"","sources":["../../src/jsutils/toError.ts"],"names":[],"mappings":";;AAOA,0BAIC;AAXD,6CAAuC;AAOvC,SAAgB,OAAO,CAAC,WAAoB;IAC1C,OAAO,WAAW,YAAY,KAAK;QACjC,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,IAAI,cAAc,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,cAAe,SAAQ,KAAK;IAGhC,YAAY,WAAoB;QAC9B,KAAK,CAAC,0BAA0B,GAAG,IAAA,oBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF","sourcesContent":["import { inspect } from './inspect.ts';\n\n/**\n * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface.\n *\n * @internal\n */\nexport function toError(thrownValue: unknown): Error {\n return thrownValue instanceof Error\n ? thrownValue\n : new NonErrorThrown(thrownValue);\n}\n\nclass NonErrorThrown extends Error {\n thrownValue: unknown;\n\n constructor(thrownValue: unknown) {\n super('Unexpected error value: ' + inspect(thrownValue));\n this.name = 'NonErrorThrown';\n this.thrownValue = thrownValue;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs new file mode 100644 index 00000000..63a0e9bb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs @@ -0,0 +1,14 @@ +import { inspect } from "./inspect.mjs"; +export function toError(thrownValue) { + return thrownValue instanceof Error + ? thrownValue + : new NonErrorThrown(thrownValue); +} +class NonErrorThrown extends Error { + constructor(thrownValue) { + super('Unexpected error value: ' + inspect(thrownValue)); + this.name = 'NonErrorThrown'; + this.thrownValue = thrownValue; + } +} +//# sourceMappingURL=toError.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs.map new file mode 100644 index 00000000..1bdec4ea --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toError.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"toError.js","sourceRoot":"","sources":["../../src/jsutils/toError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAqB;AAOvC,MAAM,UAAU,OAAO,CAAC,WAAoB;IAC1C,OAAO,WAAW,YAAY,KAAK;QACjC,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,IAAI,cAAc,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,cAAe,SAAQ,KAAK;IAGhC,YAAY,WAAoB;QAC9B,KAAK,CAAC,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF","sourcesContent":["import { inspect } from './inspect.ts';\n\n/**\n * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface.\n *\n * @internal\n */\nexport function toError(thrownValue: unknown): Error {\n return thrownValue instanceof Error\n ? thrownValue\n : new NonErrorThrown(thrownValue);\n}\n\nclass NonErrorThrown extends Error {\n thrownValue: unknown;\n\n constructor(thrownValue: unknown) {\n super('Unexpected error value: ' + inspect(thrownValue));\n this.name = 'NonErrorThrown';\n this.thrownValue = thrownValue;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.mts new file mode 100644 index 00000000..c2d4e82f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.mts @@ -0,0 +1,6 @@ +import type { Maybe } from "./Maybe.mjs"; +import type { ReadOnlyObjMap, ReadOnlyObjMapLike, ReadOnlyObjMapSymbolLike, ReadOnlyObjMapWithSymbol } from "./ObjMap.mjs"; +/** @internal */ +export declare function toObjMap(obj: Maybe>): ReadOnlyObjMap; +/** @internal */ +export declare function toObjMapWithSymbols(obj: Maybe>): ReadOnlyObjMapWithSymbol; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.ts new file mode 100644 index 00000000..4ebef723 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.d.ts @@ -0,0 +1,6 @@ +import type { Maybe } from "./Maybe.js"; +import type { ReadOnlyObjMap, ReadOnlyObjMapLike, ReadOnlyObjMapSymbolLike, ReadOnlyObjMapWithSymbol } from "./ObjMap.js"; +/** @internal */ +export declare function toObjMap(obj: Maybe>): ReadOnlyObjMap; +/** @internal */ +export declare function toObjMapWithSymbols(obj: Maybe>): ReadOnlyObjMapWithSymbol; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js new file mode 100644 index 00000000..8dd10f6c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toObjMap = toObjMap; +exports.toObjMapWithSymbols = toObjMapWithSymbols; +function toObjMap(obj) { + if (obj == null) { + return Object.create(null); + } + if (Object.getPrototypeOf(obj) === null) { + return obj; + } + const map = Object.create(null); + for (const [key, value] of Object.entries(obj)) { + map[key] = value; + } + return map; +} +function toObjMapWithSymbols(obj) { + if (obj == null) { + return Object.create(null); + } + if (Object.getPrototypeOf(obj) === null) { + return obj; + } + const map = Object.create(null); + for (const [key, value] of Object.entries(obj)) { + map[key] = value; + } + for (const key of Object.getOwnPropertySymbols(obj)) { + map[key] = obj[key]; + } + return map; +} +//# sourceMappingURL=toObjMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js.map new file mode 100644 index 00000000..362825c4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"toObjMap.js","sourceRoot":"","sources":["../../src/jsutils/toObjMap.ts"],"names":[],"mappings":";;AASA,4BAiBC;AAGD,kDAqBC;AAzCD,SAAgB,QAAQ,CACtB,GAAiC;IAEjC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAGD,SAAgB,mBAAmB,CACjC,GAAuC;IAEvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import type { Maybe } from './Maybe.ts';\nimport type {\n ReadOnlyObjMap,\n ReadOnlyObjMapLike,\n ReadOnlyObjMapSymbolLike,\n ReadOnlyObjMapWithSymbol,\n} from './ObjMap.ts';\n\n/** @internal */\nexport function toObjMap(\n obj: Maybe>,\n): ReadOnlyObjMap {\n if (obj == null) {\n return Object.create(null);\n }\n\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n const map = Object.create(null);\n for (const [key, value] of Object.entries(obj)) {\n map[key] = value;\n }\n\n return map;\n}\n\n/** @internal */\nexport function toObjMapWithSymbols(\n obj: Maybe>,\n): ReadOnlyObjMapWithSymbol {\n if (obj == null) {\n return Object.create(null);\n }\n\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n const map = Object.create(null);\n for (const [key, value] of Object.entries(obj)) {\n map[key] = value;\n }\n\n for (const key of Object.getOwnPropertySymbols(obj)) {\n map[key] = obj[key];\n }\n\n return map;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs new file mode 100644 index 00000000..d61ddb84 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs @@ -0,0 +1,30 @@ +export function toObjMap(obj) { + if (obj == null) { + return Object.create(null); + } + if (Object.getPrototypeOf(obj) === null) { + return obj; + } + const map = Object.create(null); + for (const [key, value] of Object.entries(obj)) { + map[key] = value; + } + return map; +} +export function toObjMapWithSymbols(obj) { + if (obj == null) { + return Object.create(null); + } + if (Object.getPrototypeOf(obj) === null) { + return obj; + } + const map = Object.create(null); + for (const [key, value] of Object.entries(obj)) { + map[key] = value; + } + for (const key of Object.getOwnPropertySymbols(obj)) { + map[key] = obj[key]; + } + return map; +} +//# sourceMappingURL=toObjMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs.map new file mode 100644 index 00000000..7289251a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/jsutils/toObjMap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"toObjMap.js","sourceRoot":"","sources":["../../src/jsutils/toObjMap.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,QAAQ,CACtB,GAAiC;IAEjC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAGD,MAAM,UAAU,mBAAmB,CACjC,GAAuC;IAEvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import type { Maybe } from './Maybe.ts';\nimport type {\n ReadOnlyObjMap,\n ReadOnlyObjMapLike,\n ReadOnlyObjMapSymbolLike,\n ReadOnlyObjMapWithSymbol,\n} from './ObjMap.ts';\n\n/** @internal */\nexport function toObjMap(\n obj: Maybe>,\n): ReadOnlyObjMap {\n if (obj == null) {\n return Object.create(null);\n }\n\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n const map = Object.create(null);\n for (const [key, value] of Object.entries(obj)) {\n map[key] = value;\n }\n\n return map;\n}\n\n/** @internal */\nexport function toObjMapWithSymbols(\n obj: Maybe>,\n): ReadOnlyObjMapWithSymbol {\n if (obj == null) {\n return Object.create(null);\n }\n\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n const map = Object.create(null);\n for (const [key, value] of Object.entries(obj)) {\n map[key] = value;\n }\n\n for (const key of Object.getOwnPropertySymbols(obj)) {\n map[key] = obj[key];\n }\n\n return map;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.mts new file mode 100644 index 00000000..6660252f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.mts @@ -0,0 +1,3 @@ +import type * as Kind_ from "./kinds_.mjs"; +/** @internal */ +export type KindTypeMap = typeof Kind_; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.ts new file mode 100644 index 00000000..e721c72a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.d.ts @@ -0,0 +1,3 @@ +import type * as Kind_ from "./kinds_.js"; +/** @internal */ +export type KindTypeMap = typeof Kind_; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js new file mode 100644 index 00000000..14dc1767 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=KindTypeMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js.map new file mode 100644 index 00000000..bda0fd70 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KindTypeMap.js","sourceRoot":"","sources":["../../src/language/KindTypeMap.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable import/no-namespace */\nimport type * as Kind_ from './kinds_.ts';\n\n// Keep the kind literal map available as a type-only import for `ast.ts`.\n// This avoids depending on the `Kind` runtime namespace in type positions,\n// which Deno's publish type-output validation rejects for this package shape.\n/** @internal */\nexport type KindTypeMap = typeof Kind_;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs new file mode 100644 index 00000000..ab812122 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=KindTypeMap.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs.map new file mode 100644 index 00000000..bda0fd70 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/KindTypeMap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KindTypeMap.js","sourceRoot":"","sources":["../../src/language/KindTypeMap.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable import/no-namespace */\nimport type * as Kind_ from './kinds_.ts';\n\n// Keep the kind literal map available as a type-only import for `ast.ts`.\n// This avoids depending on the `Kind` runtime namespace in type positions,\n// which Deno's publish type-output validation rejects for this package shape.\n/** @internal */\nexport type KindTypeMap = typeof Kind_;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.mts new file mode 100644 index 00000000..91c0d4a7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.mts @@ -0,0 +1,862 @@ +/** @category AST */ +import type { KindTypeMap } from "./KindTypeMap.mjs"; +import type { Source } from "./source.mjs"; +import type { TokenKind } from "./tokenKind.mjs"; +/** + * Contains a range of UTF-8 character offsets and token references that + * identify the region of the source from which the AST derived. + */ +export declare class Location { + /** The character offset at which this Node begins. */ + readonly start: number; + /** The character offset at which this Node ends. */ + readonly end: number; + /** The Token at which this Node begins. */ + readonly startToken: Token; + /** The Token at which this Node ends. */ + readonly endToken: Token; + /** The Source document the AST represents. */ + readonly source: Source; + /** + * Creates a Location instance. + * @param startToken - The start token. + * @param endToken - The end token. + * @param source - Source document used to derive error locations. + * @example + * ```ts + * import { Location, Source, Token, TokenKind } from 'graphql/language'; + * + * const source = new Source('{ hello }'); + * const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1); + * const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9); + * const location = new Location(startToken, endToken, source); + * + * location.start; // => 0 + * location.end; // => 9 + * location.source.body; // => '{ hello }' + * ``` + */ + constructor(startToken: Token, endToken: Token, source: Source); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a JSON representation of this location. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * + * const document = parse('{ hello }'); + * const location = document.loc?.toJSON(); + * + * location; // => { start: 0, end: 9 } + * ``` + */ + toJSON(): { + start: number; + end: number; + }; +} +/** + * Represents a range of characters represented by a lexical token + * within a Source. + */ +export declare class Token { + /** The kind of Token. */ + readonly kind: TokenKind; + /** The character offset at which this Node begins. */ + readonly start: number; + /** The character offset at which this Node ends. */ + readonly end: number; + /** The 1-indexed line number on which this Token appears. */ + readonly line: number; + /** The 1-indexed column number at which this Token begins. */ + readonly column: number; + /** + * For non-punctuation tokens, represents the interpreted value of the token. + * + * Note: is undefined for punctuation tokens, but typed as string for + * convenience in the parser. + */ + readonly value: string; + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + readonly prev: Token | null; + /** Next token in the token stream, including ignored tokens. */ + readonly next: Token | null; + /** + * Creates a Token instance. + * @param kind - Token kind produced by lexical analysis. + * @param start - Character offset where this token begins. + * @param end - Character offset where this token ends. + * @param line - One-indexed line number where this token begins. + * @param column - One-indexed column number where this token begins. + * @param value - Interpreted value for non-punctuation tokens. + * @example + * ```ts + * import { Token, TokenKind } from 'graphql/language'; + * + * const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello'); + * + * token.kind; // => TokenKind.NAME + * token.value; // => 'hello' + * token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 } + * ``` + */ + constructor(kind: TokenKind, start: number, end: number, line: number, column: number, value?: string); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a JSON representation of this token. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { Lexer, Source } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * const token = lexer.advance().toJSON(); + * + * token; // => { kind: '{', value: undefined, line: 1, column: 1 } + * ``` + */ + toJSON(): { + kind: TokenKind; + value?: string; + line: number; + column: number; + }; +} +/** The list of all possible AST node types. */ +export type ASTNode = NameNode | DocumentNode | OperationDefinitionNode | VariableDefinitionNode | VariableNode | SelectionSetNode | FieldNode | ArgumentNode | FragmentArgumentNode | FragmentSpreadNode | InlineFragmentNode | FragmentDefinitionNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode | ObjectFieldNode | DirectiveNode | NamedTypeNode | ListTypeNode | NonNullTypeNode | SchemaDefinitionNode | OperationTypeDefinitionNode | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | EnumValueDefinitionNode | InputObjectTypeDefinitionNode | DirectiveDefinitionNode | SchemaExtensionNode | ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode | DirectiveExtensionNode | TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode; +/** Utility type listing all nodes indexed by their kind. */ +export type ASTKindToNode = { + [NodeT in ASTNode as NodeT['kind']]: NodeT; +}; +/** @internal */ +export declare const QueryDocumentKeys: { + [NodeT in ASTNode as NodeT['kind']]: ReadonlyArray; +}; +/** @internal */ +export declare function isNode(maybeNode: any): maybeNode is ASTNode; +/** An identifier in a GraphQL document. */ +export interface NameNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NAME']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** The root AST node for a parsed GraphQL document. */ +export interface DocumentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DOCUMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Top-level executable and type-system definitions in this document. */ + readonly definitions: ReadonlyArray; + /** The number of lexical tokens parsed for this document, if token counting was enabled. */ + readonly tokenCount?: number | undefined; +} +/** Any top-level definition that may appear in a GraphQL document. */ +export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode | TypeSystemExtensionNode; +/** Any executable definition that may appear in an operation document. */ +export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode; +/** A query, mutation, or subscription operation definition. */ +export interface OperationDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OPERATION_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** The operation selected for execution. */ + readonly operation: OperationTypeNode; + /** Name node identifying this AST node. */ + readonly name?: NameNode | undefined; + /** Variable definitions declared by this operation or fragment. */ + readonly variableDefinitions?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet: SelectionSetNode; +} +/** + * A narrowed OperationDefinitionNode for subscription operations. + * Subscription operations go through a distinct execution pipeline + * (source event stream + per-event execution), so narrowing the operation + * type allows functions in that pipeline to accept only valid input. + */ +export interface SubscriptionOperationDefinitionNode extends OperationDefinitionNode { + /** Subscription operation kind for this definition. */ + readonly operation: (typeof OperationTypeNode)['SUBSCRIPTION']; +} +/** + * The operation types supported by GraphQL executable definitions. + * @category Kinds + */ +export declare const OperationTypeNode: { + readonly QUERY: "query"; + readonly MUTATION: "mutation"; + readonly SUBSCRIPTION: "subscription"; +}; +/** + * The operation types supported by GraphQL executable definitions. + * @category Kinds + */ +export type OperationTypeNode = (typeof OperationTypeNode)[keyof typeof OperationTypeNode]; +/** A variable declaration in an operation or experimental fragment definition. */ +export interface VariableDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['VARIABLE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** The variable being defined or referenced. */ + readonly variable: VariableNode; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; + /** Default value used when no explicit value is supplied. */ + readonly defaultValue?: ConstValueNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** A variable reference, such as `$id`. */ +export interface VariableNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['VARIABLE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A set of fields and fragments selected from an object, interface, or union. */ +export interface SelectionSetNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + kind: KindTypeMap['SELECTION_SET']; + /** The source location for this AST node, if location tracking was enabled. */ + loc?: Location | undefined; + /** Fields and fragments contained in this selection set. */ + selections: ReadonlyArray; +} +/** Any selection that may appear inside a selection set. */ +export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; +/** A field selected in an executable GraphQL document. */ +export interface FieldNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FIELD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The response-key alias for this field, if one was supplied. */ + readonly alias?: NameNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet?: SelectionSetNode | undefined; +} +/** An argument supplied to a field or directive. */ +export interface ArgumentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ARGUMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ValueNode; +} +/** An argument node whose value is guaranteed to be constant. */ +export interface ConstArgumentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ARGUMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ConstValueNode; +} +/** Variable definition declared by a fragment argument. */ +export interface FragmentArgumentNode { + /** AST node kind for a fragment argument. */ + readonly kind: KindTypeMap['FRAGMENT_ARGUMENT']; + /** Source location for this fragment argument. */ + readonly loc?: Location | undefined; + /** Variable name declared by this fragment argument. */ + readonly name: NameNode; + /** Default value literal for this fragment argument, if provided. */ + readonly value: ValueNode; +} +/** A named fragment spread, such as `...userFields`. */ +export interface FragmentSpreadNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FRAGMENT_SPREAD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Argument values supplied to the referenced fragment. */ + readonly arguments?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An inline fragment spread with an optional type condition. */ +export interface InlineFragmentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INLINE_FRAGMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The type condition that limits where this fragment applies. */ + readonly typeCondition?: NamedTypeNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet: SelectionSetNode; +} +/** A reusable fragment definition declared in an executable document. */ +export interface FragmentDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FRAGMENT_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Experimental variable definitions declared by this fragment definition. */ + readonly variableDefinitions?: ReadonlyArray | undefined; + /** The type condition that limits where this fragment applies. */ + readonly typeCondition: NamedTypeNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet: SelectionSetNode; +} +/** Any value literal that may appear in an executable GraphQL document. */ +export type ValueNode = VariableNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode; +/** Any value literal that is guaranteed not to contain a variable reference. */ +export type ConstValueNode = IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ConstListValueNode | ConstObjectValueNode; +/** An integer value literal. */ +export interface IntValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** A floating-point value literal. */ +export interface FloatValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FLOAT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** A string value literal. */ +export interface StringValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['STRING']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; + /** Whether this string was parsed from block string syntax. */ + readonly block?: boolean | undefined; +} +/** A boolean value literal. */ +export interface BooleanValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['BOOLEAN']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: boolean; +} +/** A null value literal. */ +export interface NullValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NULL']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; +} +/** An enum value literal. */ +export interface EnumValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** A list value literal. */ +export interface ListValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['LIST']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values: ReadonlyArray; +} +/** A list value literal whose elements are all constant values. */ +export interface ConstListValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['LIST']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values: ReadonlyArray; +} +/** An input object value literal. */ +export interface ObjectValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; +} +/** An input object value literal whose fields are all constant values. */ +export interface ConstObjectValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; +} +/** A field inside an input object value literal. */ +export interface ObjectFieldNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_FIELD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ValueNode; +} +/** A field inside a constant input object value literal. */ +export interface ConstObjectFieldNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_FIELD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ConstValueNode; +} +/** A directive applied to an executable or type-system location. */ +export interface DirectiveNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; +} +/** A directive whose arguments are all constant values. */ +export interface ConstDirectiveNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; +} +/** Any GraphQL type reference AST node. */ +export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; +/** A named type reference. */ +export interface NamedTypeNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NAMED_TYPE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A list type reference. */ +export interface ListTypeNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['LIST_TYPE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; +} +/** A non-null type reference. */ +export interface NonNullTypeNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NON_NULL_TYPE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: NamedTypeNode | ListTypeNode; +} +/** Any type-system definition that may appear in a schema document. */ +export type TypeSystemDefinitionNode = SchemaDefinitionNode | TypeDefinitionNode | DirectiveDefinitionNode; +/** A schema definition in a type-system document. */ +export interface SchemaDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCHEMA_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Root operation types declared by this schema definition or extension. */ + readonly operationTypes: ReadonlyArray; +} +/** A root operation type declaration inside a schema definition or extension. */ +export interface OperationTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OPERATION_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The operation selected for execution. */ + readonly operation: OperationTypeNode; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: NamedTypeNode; +} +/** Any named type definition that may appear in a schema document. */ +export type TypeDefinitionNode = ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | InputObjectTypeDefinitionNode; +/** A scalar type definition in a type-system document. */ +export interface ScalarTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCALAR_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An object type definition in a type-system document. */ +export interface ObjectTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A field definition declared by an object or interface type. */ +export interface FieldDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FIELD_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An argument or input-field definition. */ +export interface InputValueDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INPUT_VALUE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; + /** Default value used when no explicit value is supplied. */ + readonly defaultValue?: ConstValueNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An interface type definition in a type-system document. */ +export interface InterfaceTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INTERFACE_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A union type definition in a type-system document. */ +export interface UnionTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['UNION_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Object types that belong to this union type. */ + readonly types?: ReadonlyArray | undefined; +} +/** An enum type definition in a type-system document. */ +export interface EnumTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values?: ReadonlyArray | undefined; +} +/** An enum value definition. */ +export interface EnumValueDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM_VALUE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An input object type definition in a type-system document. */ +export interface InputObjectTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A directive definition in a type-system document. */ +export interface DirectiveDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Whether this directive may appear more than once at the same location. */ + readonly repeatable: boolean; + /** Locations where this directive may be applied. */ + readonly locations: ReadonlyArray; +} +/** Any type-system extension that may appear in a schema extension document. */ +export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode | DirectiveExtensionNode; +/** A schema extension in a type-system document. */ +export interface SchemaExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCHEMA_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Root operation types declared by this schema definition or extension. */ + readonly operationTypes?: ReadonlyArray | undefined; +} +/** Any named type extension that may appear in a schema extension document. */ +export type TypeExtensionNode = ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode; +/** A scalar type extension. */ +export interface ScalarTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCALAR_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An object type extension. */ +export interface ObjectTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** An interface type extension. */ +export interface InterfaceTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INTERFACE_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A union type extension. */ +export interface UnionTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['UNION_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Object types that belong to this union type. */ + readonly types?: ReadonlyArray | undefined; +} +/** An enum type extension. */ +export interface EnumTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values?: ReadonlyArray | undefined; +} +/** An input object type extension. */ +export interface InputObjectTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A directive extension. */ +export interface DirectiveExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** Any AST node representing a GraphQL schema coordinate. */ +export type SchemaCoordinateNode = TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode; +/** A schema coordinate that refers to a named type. */ +export interface TypeCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['TYPE_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A schema coordinate that refers to a member of a named type. */ +export interface MemberCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['MEMBER_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The member name referenced by this schema coordinate. */ + readonly memberName: NameNode; +} +/** A schema coordinate that refers to a field or directive argument. */ +export interface ArgumentCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ARGUMENT_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The field name referenced by this schema coordinate. */ + readonly fieldName: NameNode; + /** The argument name referenced by this schema coordinate. */ + readonly argumentName: NameNode; +} +/** A schema coordinate that refers to a directive. */ +export interface DirectiveCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A schema coordinate that refers to a directive argument. */ +export interface DirectiveArgumentCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_ARGUMENT_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The argument name referenced by this schema coordinate. */ + readonly argumentName: NameNode; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.ts new file mode 100644 index 00000000..8ab6be03 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.d.ts @@ -0,0 +1,862 @@ +/** @category AST */ +import type { KindTypeMap } from "./KindTypeMap.js"; +import type { Source } from "./source.js"; +import type { TokenKind } from "./tokenKind.js"; +/** + * Contains a range of UTF-8 character offsets and token references that + * identify the region of the source from which the AST derived. + */ +export declare class Location { + /** The character offset at which this Node begins. */ + readonly start: number; + /** The character offset at which this Node ends. */ + readonly end: number; + /** The Token at which this Node begins. */ + readonly startToken: Token; + /** The Token at which this Node ends. */ + readonly endToken: Token; + /** The Source document the AST represents. */ + readonly source: Source; + /** + * Creates a Location instance. + * @param startToken - The start token. + * @param endToken - The end token. + * @param source - Source document used to derive error locations. + * @example + * ```ts + * import { Location, Source, Token, TokenKind } from 'graphql/language'; + * + * const source = new Source('{ hello }'); + * const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1); + * const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9); + * const location = new Location(startToken, endToken, source); + * + * location.start; // => 0 + * location.end; // => 9 + * location.source.body; // => '{ hello }' + * ``` + */ + constructor(startToken: Token, endToken: Token, source: Source); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a JSON representation of this location. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * + * const document = parse('{ hello }'); + * const location = document.loc?.toJSON(); + * + * location; // => { start: 0, end: 9 } + * ``` + */ + toJSON(): { + start: number; + end: number; + }; +} +/** + * Represents a range of characters represented by a lexical token + * within a Source. + */ +export declare class Token { + /** The kind of Token. */ + readonly kind: TokenKind; + /** The character offset at which this Node begins. */ + readonly start: number; + /** The character offset at which this Node ends. */ + readonly end: number; + /** The 1-indexed line number on which this Token appears. */ + readonly line: number; + /** The 1-indexed column number at which this Token begins. */ + readonly column: number; + /** + * For non-punctuation tokens, represents the interpreted value of the token. + * + * Note: is undefined for punctuation tokens, but typed as string for + * convenience in the parser. + */ + readonly value: string; + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + readonly prev: Token | null; + /** Next token in the token stream, including ignored tokens. */ + readonly next: Token | null; + /** + * Creates a Token instance. + * @param kind - Token kind produced by lexical analysis. + * @param start - Character offset where this token begins. + * @param end - Character offset where this token ends. + * @param line - One-indexed line number where this token begins. + * @param column - One-indexed column number where this token begins. + * @param value - Interpreted value for non-punctuation tokens. + * @example + * ```ts + * import { Token, TokenKind } from 'graphql/language'; + * + * const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello'); + * + * token.kind; // => TokenKind.NAME + * token.value; // => 'hello' + * token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 } + * ``` + */ + constructor(kind: TokenKind, start: number, end: number, line: number, column: number, value?: string); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a JSON representation of this token. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { Lexer, Source } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * const token = lexer.advance().toJSON(); + * + * token; // => { kind: '{', value: undefined, line: 1, column: 1 } + * ``` + */ + toJSON(): { + kind: TokenKind; + value?: string; + line: number; + column: number; + }; +} +/** The list of all possible AST node types. */ +export type ASTNode = NameNode | DocumentNode | OperationDefinitionNode | VariableDefinitionNode | VariableNode | SelectionSetNode | FieldNode | ArgumentNode | FragmentArgumentNode | FragmentSpreadNode | InlineFragmentNode | FragmentDefinitionNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode | ObjectFieldNode | DirectiveNode | NamedTypeNode | ListTypeNode | NonNullTypeNode | SchemaDefinitionNode | OperationTypeDefinitionNode | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | EnumValueDefinitionNode | InputObjectTypeDefinitionNode | DirectiveDefinitionNode | SchemaExtensionNode | ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode | DirectiveExtensionNode | TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode; +/** Utility type listing all nodes indexed by their kind. */ +export type ASTKindToNode = { + [NodeT in ASTNode as NodeT['kind']]: NodeT; +}; +/** @internal */ +export declare const QueryDocumentKeys: { + [NodeT in ASTNode as NodeT['kind']]: ReadonlyArray; +}; +/** @internal */ +export declare function isNode(maybeNode: any): maybeNode is ASTNode; +/** An identifier in a GraphQL document. */ +export interface NameNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NAME']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** The root AST node for a parsed GraphQL document. */ +export interface DocumentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DOCUMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Top-level executable and type-system definitions in this document. */ + readonly definitions: ReadonlyArray; + /** The number of lexical tokens parsed for this document, if token counting was enabled. */ + readonly tokenCount?: number | undefined; +} +/** Any top-level definition that may appear in a GraphQL document. */ +export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode | TypeSystemExtensionNode; +/** Any executable definition that may appear in an operation document. */ +export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode; +/** A query, mutation, or subscription operation definition. */ +export interface OperationDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OPERATION_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** The operation selected for execution. */ + readonly operation: OperationTypeNode; + /** Name node identifying this AST node. */ + readonly name?: NameNode | undefined; + /** Variable definitions declared by this operation or fragment. */ + readonly variableDefinitions?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet: SelectionSetNode; +} +/** + * A narrowed OperationDefinitionNode for subscription operations. + * Subscription operations go through a distinct execution pipeline + * (source event stream + per-event execution), so narrowing the operation + * type allows functions in that pipeline to accept only valid input. + */ +export interface SubscriptionOperationDefinitionNode extends OperationDefinitionNode { + /** Subscription operation kind for this definition. */ + readonly operation: (typeof OperationTypeNode)['SUBSCRIPTION']; +} +/** + * The operation types supported by GraphQL executable definitions. + * @category Kinds + */ +export declare const OperationTypeNode: { + readonly QUERY: "query"; + readonly MUTATION: "mutation"; + readonly SUBSCRIPTION: "subscription"; +}; +/** + * The operation types supported by GraphQL executable definitions. + * @category Kinds + */ +export type OperationTypeNode = (typeof OperationTypeNode)[keyof typeof OperationTypeNode]; +/** A variable declaration in an operation or experimental fragment definition. */ +export interface VariableDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['VARIABLE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** The variable being defined or referenced. */ + readonly variable: VariableNode; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; + /** Default value used when no explicit value is supplied. */ + readonly defaultValue?: ConstValueNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** A variable reference, such as `$id`. */ +export interface VariableNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['VARIABLE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A set of fields and fragments selected from an object, interface, or union. */ +export interface SelectionSetNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + kind: KindTypeMap['SELECTION_SET']; + /** The source location for this AST node, if location tracking was enabled. */ + loc?: Location | undefined; + /** Fields and fragments contained in this selection set. */ + selections: ReadonlyArray; +} +/** Any selection that may appear inside a selection set. */ +export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; +/** A field selected in an executable GraphQL document. */ +export interface FieldNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FIELD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The response-key alias for this field, if one was supplied. */ + readonly alias?: NameNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet?: SelectionSetNode | undefined; +} +/** An argument supplied to a field or directive. */ +export interface ArgumentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ARGUMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ValueNode; +} +/** An argument node whose value is guaranteed to be constant. */ +export interface ConstArgumentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ARGUMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ConstValueNode; +} +/** Variable definition declared by a fragment argument. */ +export interface FragmentArgumentNode { + /** AST node kind for a fragment argument. */ + readonly kind: KindTypeMap['FRAGMENT_ARGUMENT']; + /** Source location for this fragment argument. */ + readonly loc?: Location | undefined; + /** Variable name declared by this fragment argument. */ + readonly name: NameNode; + /** Default value literal for this fragment argument, if provided. */ + readonly value: ValueNode; +} +/** A named fragment spread, such as `...userFields`. */ +export interface FragmentSpreadNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FRAGMENT_SPREAD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Argument values supplied to the referenced fragment. */ + readonly arguments?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An inline fragment spread with an optional type condition. */ +export interface InlineFragmentNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INLINE_FRAGMENT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The type condition that limits where this fragment applies. */ + readonly typeCondition?: NamedTypeNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet: SelectionSetNode; +} +/** A reusable fragment definition declared in an executable document. */ +export interface FragmentDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FRAGMENT_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Experimental variable definitions declared by this fragment definition. */ + readonly variableDefinitions?: ReadonlyArray | undefined; + /** The type condition that limits where this fragment applies. */ + readonly typeCondition: NamedTypeNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Selections made by this operation, field, or fragment. */ + readonly selectionSet: SelectionSetNode; +} +/** Any value literal that may appear in an executable GraphQL document. */ +export type ValueNode = VariableNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode; +/** Any value literal that is guaranteed not to contain a variable reference. */ +export type ConstValueNode = IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ConstListValueNode | ConstObjectValueNode; +/** An integer value literal. */ +export interface IntValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** A floating-point value literal. */ +export interface FloatValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FLOAT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** A string value literal. */ +export interface StringValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['STRING']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; + /** Whether this string was parsed from block string syntax. */ + readonly block?: boolean | undefined; +} +/** A boolean value literal. */ +export interface BooleanValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['BOOLEAN']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: boolean; +} +/** A null value literal. */ +export interface NullValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NULL']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; +} +/** An enum value literal. */ +export interface EnumValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Parsed value represented by this node. */ + readonly value: string; +} +/** A list value literal. */ +export interface ListValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['LIST']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values: ReadonlyArray; +} +/** A list value literal whose elements are all constant values. */ +export interface ConstListValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['LIST']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values: ReadonlyArray; +} +/** An input object value literal. */ +export interface ObjectValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; +} +/** An input object value literal whose fields are all constant values. */ +export interface ConstObjectValueNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; +} +/** A field inside an input object value literal. */ +export interface ObjectFieldNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_FIELD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ValueNode; +} +/** A field inside a constant input object value literal. */ +export interface ConstObjectFieldNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_FIELD']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Parsed value represented by this node. */ + readonly value: ConstValueNode; +} +/** A directive applied to an executable or type-system location. */ +export interface DirectiveNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; +} +/** A directive whose arguments are all constant values. */ +export interface ConstDirectiveNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; +} +/** Any GraphQL type reference AST node. */ +export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; +/** A named type reference. */ +export interface NamedTypeNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NAMED_TYPE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A list type reference. */ +export interface ListTypeNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['LIST_TYPE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; +} +/** A non-null type reference. */ +export interface NonNullTypeNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['NON_NULL_TYPE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: NamedTypeNode | ListTypeNode; +} +/** Any type-system definition that may appear in a schema document. */ +export type TypeSystemDefinitionNode = SchemaDefinitionNode | TypeDefinitionNode | DirectiveDefinitionNode; +/** A schema definition in a type-system document. */ +export interface SchemaDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCHEMA_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Root operation types declared by this schema definition or extension. */ + readonly operationTypes: ReadonlyArray; +} +/** A root operation type declaration inside a schema definition or extension. */ +export interface OperationTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OPERATION_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The operation selected for execution. */ + readonly operation: OperationTypeNode; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: NamedTypeNode; +} +/** Any named type definition that may appear in a schema document. */ +export type TypeDefinitionNode = ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | InputObjectTypeDefinitionNode; +/** A scalar type definition in a type-system document. */ +export interface ScalarTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCALAR_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An object type definition in a type-system document. */ +export interface ObjectTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A field definition declared by an object or interface type. */ +export interface FieldDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['FIELD_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An argument or input-field definition. */ +export interface InputValueDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INPUT_VALUE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: TypeNode; + /** Default value used when no explicit value is supplied. */ + readonly defaultValue?: ConstValueNode | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An interface type definition in a type-system document. */ +export interface InterfaceTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INTERFACE_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A union type definition in a type-system document. */ +export interface UnionTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['UNION_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Object types that belong to this union type. */ + readonly types?: ReadonlyArray | undefined; +} +/** An enum type definition in a type-system document. */ +export interface EnumTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values?: ReadonlyArray | undefined; +} +/** An enum value definition. */ +export interface EnumValueDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM_VALUE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An input object type definition in a type-system document. */ +export interface InputObjectTypeDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A directive definition in a type-system document. */ +export interface DirectiveDefinitionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_DEFINITION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** The optional GraphQL description associated with this definition. */ + readonly description?: StringValueNode | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Arguments supplied to this field, directive, or coordinate. */ + readonly arguments?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Whether this directive may appear more than once at the same location. */ + readonly repeatable: boolean; + /** Locations where this directive may be applied. */ + readonly locations: ReadonlyArray; +} +/** Any type-system extension that may appear in a schema extension document. */ +export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode | DirectiveExtensionNode; +/** A schema extension in a type-system document. */ +export interface SchemaExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCHEMA_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Root operation types declared by this schema definition or extension. */ + readonly operationTypes?: ReadonlyArray | undefined; +} +/** Any named type extension that may appear in a schema extension document. */ +export type TypeExtensionNode = ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode; +/** A scalar type extension. */ +export interface ScalarTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['SCALAR_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** An object type extension. */ +export interface ObjectTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['OBJECT_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** An interface type extension. */ +export interface InterfaceTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INTERFACE_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces?: ReadonlyArray | undefined; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A union type extension. */ +export interface UnionTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['UNION_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Object types that belong to this union type. */ + readonly types?: ReadonlyArray | undefined; +} +/** An enum type extension. */ +export interface EnumTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ENUM_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Values contained in this enum, list, or input-object definition. */ + readonly values?: ReadonlyArray | undefined; +} +/** An input object type extension. */ +export interface InputObjectTypeExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields?: ReadonlyArray | undefined; +} +/** A directive extension. */ +export interface DirectiveExtensionNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_EXTENSION']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location | undefined; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** Directives available in this schema or applied to this AST node. */ + readonly directives?: ReadonlyArray | undefined; +} +/** Any AST node representing a GraphQL schema coordinate. */ +export type SchemaCoordinateNode = TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode; +/** A schema coordinate that refers to a named type. */ +export interface TypeCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['TYPE_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A schema coordinate that refers to a member of a named type. */ +export interface MemberCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['MEMBER_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The member name referenced by this schema coordinate. */ + readonly memberName: NameNode; +} +/** A schema coordinate that refers to a field or directive argument. */ +export interface ArgumentCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['ARGUMENT_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The field name referenced by this schema coordinate. */ + readonly fieldName: NameNode; + /** The argument name referenced by this schema coordinate. */ + readonly argumentName: NameNode; +} +/** A schema coordinate that refers to a directive. */ +export interface DirectiveCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; +} +/** A schema coordinate that refers to a directive argument. */ +export interface DirectiveArgumentCoordinateNode { + /** The discriminator identifying the concrete AST or introspection kind. */ + readonly kind: KindTypeMap['DIRECTIVE_ARGUMENT_COORDINATE']; + /** The source location for this AST node, if location tracking was enabled. */ + readonly loc?: Location; + /** Name node identifying this AST node. */ + readonly name: NameNode; + /** The argument name referenced by this schema coordinate. */ + readonly argumentName: NameNode; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js new file mode 100644 index 00000000..86638a73 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js @@ -0,0 +1,154 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OperationTypeNode = exports.QueryDocumentKeys = exports.Token = exports.Location = void 0; +exports.isNode = isNode; +class Location { + constructor(startToken, endToken, source) { + this.start = startToken.start; + this.end = endToken.end; + this.startToken = startToken; + this.endToken = endToken; + this.source = source; + } + get [Symbol.toStringTag]() { + return 'Location'; + } + toJSON() { + return { start: this.start, end: this.end }; + } +} +exports.Location = Location; +class Token { + constructor(kind, start, end, line, column, value) { + this.kind = kind; + this.start = start; + this.end = end; + this.line = line; + this.column = column; + this.value = value; + this.prev = null; + this.next = null; + } + get [Symbol.toStringTag]() { + return 'Token'; + } + toJSON() { + return { + kind: this.kind, + value: this.value, + line: this.line, + column: this.column, + }; + } +} +exports.Token = Token; +exports.QueryDocumentKeys = { + Name: [], + Document: ['definitions'], + OperationDefinition: [ + 'description', + 'name', + 'variableDefinitions', + 'directives', + 'selectionSet', + ], + VariableDefinition: [ + 'description', + 'variable', + 'type', + 'defaultValue', + 'directives', + ], + Variable: ['name'], + SelectionSet: ['selections'], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + Argument: ['name', 'value'], + FragmentArgument: ['name', 'value'], + FragmentSpread: [ + 'name', + 'arguments', + 'directives', + ], + InlineFragment: ['typeCondition', 'directives', 'selectionSet'], + FragmentDefinition: [ + 'description', + 'name', + 'variableDefinitions', + 'typeCondition', + 'directives', + 'selectionSet', + ], + IntValue: [], + FloatValue: [], + StringValue: [], + BooleanValue: [], + NullValue: [], + EnumValue: [], + ListValue: ['values'], + ObjectValue: ['fields'], + ObjectField: ['name', 'value'], + Directive: ['name', 'arguments'], + NamedType: ['name'], + ListType: ['type'], + NonNullType: ['type'], + SchemaDefinition: ['description', 'directives', 'operationTypes'], + OperationTypeDefinition: ['type'], + ScalarTypeDefinition: ['description', 'name', 'directives'], + ObjectTypeDefinition: [ + 'description', + 'name', + 'interfaces', + 'directives', + 'fields', + ], + FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], + InputValueDefinition: [ + 'description', + 'name', + 'type', + 'defaultValue', + 'directives', + ], + InterfaceTypeDefinition: [ + 'description', + 'name', + 'interfaces', + 'directives', + 'fields', + ], + UnionTypeDefinition: ['description', 'name', 'directives', 'types'], + EnumTypeDefinition: ['description', 'name', 'directives', 'values'], + EnumValueDefinition: ['description', 'name', 'directives'], + InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], + DirectiveDefinition: [ + 'description', + 'name', + 'arguments', + 'directives', + 'locations', + ], + SchemaExtension: ['directives', 'operationTypes'], + DirectiveExtension: ['name', 'directives'], + ScalarTypeExtension: ['name', 'directives'], + ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + UnionTypeExtension: ['name', 'directives', 'types'], + EnumTypeExtension: ['name', 'directives', 'values'], + InputObjectTypeExtension: ['name', 'directives', 'fields'], + TypeCoordinate: ['name'], + MemberCoordinate: ['name', 'memberName'], + ArgumentCoordinate: ['name', 'fieldName', 'argumentName'], + DirectiveCoordinate: ['name'], + DirectiveArgumentCoordinate: ['name', 'argumentName'], +}; +const kindValues = new Set(Object.keys(exports.QueryDocumentKeys)); +function isNode(maybeNode) { + const maybeKind = maybeNode?.kind; + return typeof maybeKind === 'string' && kindValues.has(maybeKind); +} +exports.OperationTypeNode = { + QUERY: 'query', + MUTATION: 'mutation', + SUBSCRIPTION: 'subscription', +}; +//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js.map new file mode 100644 index 00000000..0cc12e20 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/language/ast.ts"],"names":[],"mappings":";;;AAiXA,wBAGC;AA1WD,MAAa,QAAQ;IAmCnB,YAAY,UAAiB,EAAE,QAAe,EAAE,MAAc;QAC5D,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAMD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,UAAU,CAAC;IACpB,CAAC;IAeD,MAAM;QACJ,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IAC9C,CAAC;CACF;AAnED,4BAmEC;AAMD,MAAa,KAAK;IAqDhB,YACE,IAAe,EACf,KAAa,EACb,GAAW,E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;AACpE,CAAC;AAyEY,QAAA,iBAAiB,GAAG;IAC/B,KAAK,EAAE,OAAgB;IACvB,QAAQ,EAAE,UAAmB;IAC7B,YAAY,EAAE,cAAuB;CAC7B,CAAC","sourcesContent":["/** @category AST */\n\nimport type { KindTypeMap } from './KindTypeMap.ts';\nimport type { Source } from './source.ts';\nimport type { TokenKind } from './tokenKind.ts';\n\n/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport class Location {\n /** The character offset at which this Node begins. */\n readonly start: number;\n\n /** The character offset at which this Node ends. */\n readonly end: number;\n\n /** The Token at which this Node begins. */\n readonly startToken: Token;\n\n /** The Token at which this Node ends. */\n readonly endToken: Token;\n\n /** The Source document the AST represents. */\n readonly source: Source;\n\n /**\n * Creates a Location instance.\n * @param startToken - The start token.\n * @param endToken - The end token.\n * @param source - Source document used to derive error locations.\n * @example\n * ```ts\n * import { Location, Source, Token, TokenKind } from 'graphql/language';\n *\n * const source = new Source('{ hello }');\n * const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1);\n * const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9);\n * const location = new Location(startToken, endToken, source);\n *\n * location.start; // => 0\n * location.end; // => 9\n * location.source.body; // => '{ hello }'\n * ```\n */\n constructor(startToken: Token, endToken: Token, source: Source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Location';\n }\n\n /**\n * Returns a JSON representation of this location.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n *\n * const document = parse('{ hello }');\n * const location = document.loc?.toJSON();\n *\n * location; // => { start: 0, end: 9 }\n * ```\n */\n toJSON(): { start: number; end: number } {\n return { start: this.start, end: this.end };\n }\n}\n\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\nexport class Token {\n /** The kind of Token. */\n readonly kind: TokenKind;\n\n /** The character offset at which this Node begins. */\n readonly start: number;\n\n /** The character offset at which this Node ends. */\n readonly end: number;\n\n /** The 1-indexed line number on which this Token appears. */\n readonly line: number;\n\n /** The 1-indexed column number at which this Token begins. */\n readonly column: number;\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n *\n * Note: is undefined for punctuation tokens, but typed as string for\n * convenience in the parser.\n */\n readonly value: string;\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n readonly prev: Token | null;\n /** Next token in the token stream, including ignored tokens. */\n readonly next: Token | null;\n\n /**\n * Creates a Token instance.\n * @param kind - Token kind produced by lexical analysis.\n * @param start - Character offset where this token begins.\n * @param end - Character offset where this token ends.\n * @param line - One-indexed line number where this token begins.\n * @param column - One-indexed column number where this token begins.\n * @param value - Interpreted value for non-punctuation tokens.\n * @example\n * ```ts\n * import { Token, TokenKind } from 'graphql/language';\n *\n * const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello');\n *\n * token.kind; // => TokenKind.NAME\n * token.value; // => 'hello'\n * token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 }\n * ```\n */\n // eslint-disable-next-line max-params\n constructor(\n kind: TokenKind,\n start: number,\n end: number,\n line: number,\n column: number,\n value?: string,\n ) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.value = value!;\n this.prev = null;\n this.next = null;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Token';\n }\n\n /**\n * Returns a JSON representation of this token.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { Lexer, Source } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n * const token = lexer.advance().toJSON();\n *\n * token; // => { kind: '{', value: undefined, line: 1, column: 1 }\n * ```\n */\n toJSON(): {\n kind: TokenKind;\n value?: string;\n line: number;\n column: number;\n } {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column,\n };\n }\n}\n\n/** The list of all possible AST node types. */\nexport type ASTNode =\n | NameNode\n | DocumentNode\n | OperationDefinitionNode\n | VariableDefinitionNode\n | VariableNode\n | SelectionSetNode\n | FieldNode\n | ArgumentNode\n | FragmentArgumentNode\n | FragmentSpreadNode\n | InlineFragmentNode\n | FragmentDefinitionNode\n | IntValueNode\n | FloatValueNode\n | StringValueNode\n | BooleanValueNode\n | NullValueNode\n | EnumValueNode\n | ListValueNode\n | ObjectValueNode\n | ObjectFieldNode\n | DirectiveNode\n | NamedTypeNode\n | ListTypeNode\n | NonNullTypeNode\n | SchemaDefinitionNode\n | OperationTypeDefinitionNode\n | ScalarTypeDefinitionNode\n | ObjectTypeDefinitionNode\n | FieldDefinitionNode\n | InputValueDefinitionNode\n | InterfaceTypeDefinitionNode\n | UnionTypeDefinitionNode\n | EnumTypeDefinitionNode\n | EnumValueDefinitionNode\n | InputObjectTypeDefinitionNode\n | DirectiveDefinitionNode\n | SchemaExtensionNode\n | ScalarTypeExtensionNode\n | ObjectTypeExtensionNode\n | InterfaceTypeExtensionNode\n | UnionTypeExtensionNode\n | EnumTypeExtensionNode\n | InputObjectTypeExtensionNode\n | DirectiveExtensionNode\n | TypeCoordinateNode\n | MemberCoordinateNode\n | ArgumentCoordinateNode\n | DirectiveCoordinateNode\n | DirectiveArgumentCoordinateNode;\n\n/** Utility type listing all nodes indexed by their kind. */\nexport type ASTKindToNode = {\n [NodeT in ASTNode as NodeT['kind']]: NodeT;\n};\n\n/** @internal */\nexport const QueryDocumentKeys: {\n [NodeT in ASTNode as NodeT['kind']]: ReadonlyArray;\n} = {\n Name: [],\n\n Document: ['definitions'],\n OperationDefinition: [\n 'description',\n 'name',\n 'variableDefinitions',\n 'directives',\n 'selectionSet',\n ],\n VariableDefinition: [\n 'description',\n 'variable',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentArgument: ['name', 'value'],\n\n FragmentSpread: [\n 'name',\n // Note: Fragment arguments are experimental and may be changed or removed\n // in the future.\n 'arguments',\n 'directives',\n ],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: [\n 'description',\n 'name',\n // Note: Fragment variables are experimental and may be changed or removed\n // in the future.\n 'variableDefinitions',\n 'typeCondition',\n 'directives',\n 'selectionSet',\n ],\n\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n\n Directive: ['name', 'arguments'],\n\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: [\n 'description',\n 'name',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n InterfaceTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n\n DirectiveDefinition: [\n 'description',\n 'name',\n 'arguments',\n 'directives',\n 'locations',\n ],\n\n SchemaExtension: ['directives', 'operationTypes'],\n DirectiveExtension: ['name', 'directives'],\n\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n\n TypeCoordinate: ['name'],\n MemberCoordinate: ['name', 'memberName'],\n ArgumentCoordinate: ['name', 'fieldName', 'argumentName'],\n DirectiveCoordinate: ['name'],\n DirectiveArgumentCoordinate: ['name', 'argumentName'],\n};\n\nconst kindValues = new Set(Object.keys(QueryDocumentKeys));\n/** @internal */\nexport function isNode(maybeNode: any): maybeNode is ASTNode {\n const maybeKind = maybeNode?.kind;\n return typeof maybeKind === 'string' && kindValues.has(maybeKind);\n}\n\n/** An identifier in a GraphQL document. */\nexport interface NameNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NAME'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** The root AST node for a parsed GraphQL document. */\n\nexport interface DocumentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DOCUMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Top-level executable and type-system definitions in this document. */\n readonly definitions: ReadonlyArray;\n /** The number of lexical tokens parsed for this document, if token counting was enabled. */\n readonly tokenCount?: number | undefined;\n}\n\n/** Any top-level definition that may appear in a GraphQL document. */\nexport type DefinitionNode =\n | ExecutableDefinitionNode\n | TypeSystemDefinitionNode\n | TypeSystemExtensionNode;\n\n/** Any executable definition that may appear in an operation document. */\nexport type ExecutableDefinitionNode =\n | OperationDefinitionNode\n | FragmentDefinitionNode;\n\n/** A query, mutation, or subscription operation definition. */\nexport interface OperationDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OPERATION_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** The operation selected for execution. */\n readonly operation: OperationTypeNode;\n /** Name node identifying this AST node. */\n readonly name?: NameNode | undefined;\n /** Variable definitions declared by this operation or fragment. */\n readonly variableDefinitions?:\n | ReadonlyArray\n | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet: SelectionSetNode;\n}\n\n/**\n * A narrowed OperationDefinitionNode for subscription operations.\n * Subscription operations go through a distinct execution pipeline\n * (source event stream + per-event execution), so narrowing the operation\n * type allows functions in that pipeline to accept only valid input.\n */\nexport interface SubscriptionOperationDefinitionNode extends OperationDefinitionNode {\n /** Subscription operation kind for this definition. */\n readonly operation: (typeof OperationTypeNode)['SUBSCRIPTION'];\n}\n\n/**\n * The operation types supported by GraphQL executable definitions.\n * @category Kinds\n */\nexport const OperationTypeNode = {\n QUERY: 'query' as const,\n MUTATION: 'mutation' as const,\n SUBSCRIPTION: 'subscription' as const,\n} as const;\n\n/**\n * The operation types supported by GraphQL executable definitions.\n * @category Kinds\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type OperationTypeNode =\n (typeof OperationTypeNode)[keyof typeof OperationTypeNode];\n\n/** A variable declaration in an operation or experimental fragment definition. */\nexport interface VariableDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['VARIABLE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** The variable being defined or referenced. */\n readonly variable: VariableNode;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n /** Default value used when no explicit value is supplied. */\n readonly defaultValue?: ConstValueNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** A variable reference, such as `$id`. */\nexport interface VariableNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['VARIABLE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A set of fields and fragments selected from an object, interface, or union. */\nexport interface SelectionSetNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n kind: KindTypeMap['SELECTION_SET'];\n /** The source location for this AST node, if location tracking was enabled. */\n loc?: Location | undefined;\n /** Fields and fragments contained in this selection set. */\n selections: ReadonlyArray;\n}\n\n/** Any selection that may appear inside a selection set. */\nexport type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode;\n\n/** A field selected in an executable GraphQL document. */\nexport interface FieldNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FIELD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The response-key alias for this field, if one was supplied. */\n readonly alias?: NameNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet?: SelectionSetNode | undefined;\n}\n\n/** An argument supplied to a field or directive. */\nexport interface ArgumentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ARGUMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ValueNode;\n}\n\n/** An argument node whose value is guaranteed to be constant. */\nexport interface ConstArgumentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ARGUMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ConstValueNode;\n}\n\n/** Variable definition declared by a fragment argument. */\nexport interface FragmentArgumentNode {\n /** AST node kind for a fragment argument. */\n readonly kind: KindTypeMap['FRAGMENT_ARGUMENT'];\n /** Source location for this fragment argument. */\n readonly loc?: Location | undefined;\n /** Variable name declared by this fragment argument. */\n readonly name: NameNode;\n /** Default value literal for this fragment argument, if provided. */\n readonly value: ValueNode;\n}\n\n/** A named fragment spread, such as `...userFields`. */\nexport interface FragmentSpreadNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FRAGMENT_SPREAD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Argument values supplied to the referenced fragment. */\n readonly arguments?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An inline fragment spread with an optional type condition. */\nexport interface InlineFragmentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INLINE_FRAGMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The type condition that limits where this fragment applies. */\n readonly typeCondition?: NamedTypeNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet: SelectionSetNode;\n}\n\n/** A reusable fragment definition declared in an executable document. */\nexport interface FragmentDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FRAGMENT_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Experimental variable definitions declared by this fragment definition. */\n readonly variableDefinitions?:\n | ReadonlyArray\n | undefined;\n /** The type condition that limits where this fragment applies. */\n readonly typeCondition: NamedTypeNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet: SelectionSetNode;\n}\n\n/** Any value literal that may appear in an executable GraphQL document. */\nexport type ValueNode =\n | VariableNode\n | IntValueNode\n | FloatValueNode\n | StringValueNode\n | BooleanValueNode\n | NullValueNode\n | EnumValueNode\n | ListValueNode\n | ObjectValueNode;\n\n/** Any value literal that is guaranteed not to contain a variable reference. */\nexport type ConstValueNode =\n | IntValueNode\n | FloatValueNode\n | StringValueNode\n | BooleanValueNode\n | NullValueNode\n | EnumValueNode\n | ConstListValueNode\n | ConstObjectValueNode;\n\n/** An integer value literal. */\nexport interface IntValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** A floating-point value literal. */\nexport interface FloatValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FLOAT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** A string value literal. */\nexport interface StringValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['STRING'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n /** Whether this string was parsed from block string syntax. */\n readonly block?: boolean | undefined;\n}\n\n/** A boolean value literal. */\nexport interface BooleanValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['BOOLEAN'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: boolean;\n}\n\n/** A null value literal. */\nexport interface NullValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NULL'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n}\n\n/** An enum value literal. */\nexport interface EnumValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** A list value literal. */\nexport interface ListValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['LIST'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values: ReadonlyArray;\n}\n\n/** A list value literal whose elements are all constant values. */\nexport interface ConstListValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['LIST'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values: ReadonlyArray;\n}\n\n/** An input object value literal. */\nexport interface ObjectValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n}\n\n/** An input object value literal whose fields are all constant values. */\nexport interface ConstObjectValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n}\n\n/** A field inside an input object value literal. */\nexport interface ObjectFieldNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_FIELD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ValueNode;\n}\n\n/** A field inside a constant input object value literal. */\nexport interface ConstObjectFieldNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_FIELD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ConstValueNode;\n}\n\n/** A directive applied to an executable or type-system location. */\nexport interface DirectiveNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n}\n\n/** A directive whose arguments are all constant values. */\nexport interface ConstDirectiveNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n}\n\n// Type Reference\n\n/** Any GraphQL type reference AST node. */\nexport type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;\n\n/** A named type reference. */\nexport interface NamedTypeNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NAMED_TYPE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A list type reference. */\nexport interface ListTypeNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['LIST_TYPE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n}\n\n/** A non-null type reference. */\nexport interface NonNullTypeNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NON_NULL_TYPE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: NamedTypeNode | ListTypeNode;\n}\n\n// Type System Definition\n\n/** Any type-system definition that may appear in a schema document. */\nexport type TypeSystemDefinitionNode =\n | SchemaDefinitionNode\n | TypeDefinitionNode\n | DirectiveDefinitionNode;\n\n/** A schema definition in a type-system document. */\nexport interface SchemaDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCHEMA_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Root operation types declared by this schema definition or extension. */\n readonly operationTypes: ReadonlyArray;\n}\n\n/** A root operation type declaration inside a schema definition or extension. */\nexport interface OperationTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OPERATION_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The operation selected for execution. */\n readonly operation: OperationTypeNode;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: NamedTypeNode;\n}\n\n// Type Definition\n\n/** Any named type definition that may appear in a schema document. */\nexport type TypeDefinitionNode =\n | ScalarTypeDefinitionNode\n | ObjectTypeDefinitionNode\n | InterfaceTypeDefinitionNode\n | UnionTypeDefinitionNode\n | EnumTypeDefinitionNode\n | InputObjectTypeDefinitionNode;\n\n/** A scalar type definition in a type-system document. */\nexport interface ScalarTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCALAR_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An object type definition in a type-system document. */\nexport interface ObjectTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A field definition declared by an object or interface type. */\nexport interface FieldDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FIELD_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An argument or input-field definition. */\nexport interface InputValueDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INPUT_VALUE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n /** Default value used when no explicit value is supplied. */\n readonly defaultValue?: ConstValueNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An interface type definition in a type-system document. */\nexport interface InterfaceTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INTERFACE_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A union type definition in a type-system document. */\nexport interface UnionTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['UNION_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Object types that belong to this union type. */\n readonly types?: ReadonlyArray | undefined;\n}\n\n/** An enum type definition in a type-system document. */\nexport interface EnumTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values?: ReadonlyArray | undefined;\n}\n\n/** An enum value definition. */\nexport interface EnumValueDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM_VALUE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An input object type definition in a type-system document. */\nexport interface InputObjectTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n// Directive Definitions\n\n/** A directive definition in a type-system document. */\nexport interface DirectiveDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Whether this directive may appear more than once at the same location. */\n readonly repeatable: boolean;\n /** Locations where this directive may be applied. */\n readonly locations: ReadonlyArray;\n}\n\n// Type System Extensions\n\n/** Any type-system extension that may appear in a schema extension document. */\nexport type TypeSystemExtensionNode =\n | SchemaExtensionNode\n | TypeExtensionNode\n | DirectiveExtensionNode;\n\n/** A schema extension in a type-system document. */\nexport interface SchemaExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCHEMA_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Root operation types declared by this schema definition or extension. */\n readonly operationTypes?:\n | ReadonlyArray\n | undefined;\n}\n\n// Type Extensions\n\n/** Any named type extension that may appear in a schema extension document. */\nexport type TypeExtensionNode =\n | ScalarTypeExtensionNode\n | ObjectTypeExtensionNode\n | InterfaceTypeExtensionNode\n | UnionTypeExtensionNode\n | EnumTypeExtensionNode\n | InputObjectTypeExtensionNode;\n\n/** A scalar type extension. */\nexport interface ScalarTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCALAR_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An object type extension. */\nexport interface ObjectTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** An interface type extension. */\nexport interface InterfaceTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INTERFACE_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A union type extension. */\nexport interface UnionTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['UNION_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Object types that belong to this union type. */\n readonly types?: ReadonlyArray | undefined;\n}\n\n/** An enum type extension. */\nexport interface EnumTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values?: ReadonlyArray | undefined;\n}\n\n/** An input object type extension. */\nexport interface InputObjectTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A directive extension. */\nexport interface DirectiveExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n// Schema Coordinates\n\n/** Any AST node representing a GraphQL schema coordinate. */\nexport type SchemaCoordinateNode =\n | TypeCoordinateNode\n | MemberCoordinateNode\n | ArgumentCoordinateNode\n | DirectiveCoordinateNode\n | DirectiveArgumentCoordinateNode;\n\n/** A schema coordinate that refers to a named type. */\nexport interface TypeCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['TYPE_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A schema coordinate that refers to a member of a named type. */\nexport interface MemberCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['MEMBER_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The member name referenced by this schema coordinate. */\n readonly memberName: NameNode;\n}\n\n/** A schema coordinate that refers to a field or directive argument. */\nexport interface ArgumentCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ARGUMENT_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The field name referenced by this schema coordinate. */\n readonly fieldName: NameNode;\n /** The argument name referenced by this schema coordinate. */\n readonly argumentName: NameNode;\n}\n\n/** A schema coordinate that refers to a directive. */\nexport interface DirectiveCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A schema coordinate that refers to a directive argument. */\nexport interface DirectiveArgumentCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_ARGUMENT_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The argument name referenced by this schema coordinate. */\n readonly argumentName: NameNode;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs new file mode 100644 index 00000000..b17d6f69 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs @@ -0,0 +1,148 @@ +export class Location { + constructor(startToken, endToken, source) { + this.start = startToken.start; + this.end = endToken.end; + this.startToken = startToken; + this.endToken = endToken; + this.source = source; + } + get [Symbol.toStringTag]() { + return 'Location'; + } + toJSON() { + return { start: this.start, end: this.end }; + } +} +export class Token { + constructor(kind, start, end, line, column, value) { + this.kind = kind; + this.start = start; + this.end = end; + this.line = line; + this.column = column; + this.value = value; + this.prev = null; + this.next = null; + } + get [Symbol.toStringTag]() { + return 'Token'; + } + toJSON() { + return { + kind: this.kind, + value: this.value, + line: this.line, + column: this.column, + }; + } +} +export const QueryDocumentKeys = { + Name: [], + Document: ['definitions'], + OperationDefinition: [ + 'description', + 'name', + 'variableDefinitions', + 'directives', + 'selectionSet', + ], + VariableDefinition: [ + 'description', + 'variable', + 'type', + 'defaultValue', + 'directives', + ], + Variable: ['name'], + SelectionSet: ['selections'], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + Argument: ['name', 'value'], + FragmentArgument: ['name', 'value'], + FragmentSpread: [ + 'name', + 'arguments', + 'directives', + ], + InlineFragment: ['typeCondition', 'directives', 'selectionSet'], + FragmentDefinition: [ + 'description', + 'name', + 'variableDefinitions', + 'typeCondition', + 'directives', + 'selectionSet', + ], + IntValue: [], + FloatValue: [], + StringValue: [], + BooleanValue: [], + NullValue: [], + EnumValue: [], + ListValue: ['values'], + ObjectValue: ['fields'], + ObjectField: ['name', 'value'], + Directive: ['name', 'arguments'], + NamedType: ['name'], + ListType: ['type'], + NonNullType: ['type'], + SchemaDefinition: ['description', 'directives', 'operationTypes'], + OperationTypeDefinition: ['type'], + ScalarTypeDefinition: ['description', 'name', 'directives'], + ObjectTypeDefinition: [ + 'description', + 'name', + 'interfaces', + 'directives', + 'fields', + ], + FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], + InputValueDefinition: [ + 'description', + 'name', + 'type', + 'defaultValue', + 'directives', + ], + InterfaceTypeDefinition: [ + 'description', + 'name', + 'interfaces', + 'directives', + 'fields', + ], + UnionTypeDefinition: ['description', 'name', 'directives', 'types'], + EnumTypeDefinition: ['description', 'name', 'directives', 'values'], + EnumValueDefinition: ['description', 'name', 'directives'], + InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], + DirectiveDefinition: [ + 'description', + 'name', + 'arguments', + 'directives', + 'locations', + ], + SchemaExtension: ['directives', 'operationTypes'], + DirectiveExtension: ['name', 'directives'], + ScalarTypeExtension: ['name', 'directives'], + ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + UnionTypeExtension: ['name', 'directives', 'types'], + EnumTypeExtension: ['name', 'directives', 'values'], + InputObjectTypeExtension: ['name', 'directives', 'fields'], + TypeCoordinate: ['name'], + MemberCoordinate: ['name', 'memberName'], + ArgumentCoordinate: ['name', 'fieldName', 'argumentName'], + DirectiveCoordinate: ['name'], + DirectiveArgumentCoordinate: ['name', 'argumentName'], +}; +const kindValues = new Set(Object.keys(QueryDocumentKeys)); +export function isNode(maybeNode) { + const maybeKind = maybeNode?.kind; + return typeof maybeKind === 'string' && kindValues.has(maybeKind); +} +export const OperationTypeNode = { + QUERY: 'query', + MUTATION: 'mutation', + SUBSCRIPTION: 'subscription', +}; +//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs.map new file mode 100644 index 00000000..d3a5bc6b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/ast.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/language/ast.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,QAAQ;IAmCnB,YAAY,UAAiB,EAAE,QAAe,EAAE,MAAc;QAC5D,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAMD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,UAAU,CAAC;IACpB,CAAC;IAeD,MAAM;QACJ,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IAC9C,CAAC;CACF;AAMD,MAAM,OAAO,KAAK;IAqDhB,YACE,IAAe,EACf,KAAa,EACb,GAAW,EACX,IAAY,EACZ,MAAc,EACd,KAAc;QAEd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB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{ Source } from './source.ts';\nimport type { TokenKind } from './tokenKind.ts';\n\n/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport class Location {\n /** The character offset at which this Node begins. */\n readonly start: number;\n\n /** The character offset at which this Node ends. */\n readonly end: number;\n\n /** The Token at which this Node begins. */\n readonly startToken: Token;\n\n /** The Token at which this Node ends. */\n readonly endToken: Token;\n\n /** The Source document the AST represents. */\n readonly source: Source;\n\n /**\n * Creates a Location instance.\n * @param startToken - The start token.\n * @param endToken - The end token.\n * @param source - Source document used to derive error locations.\n * @example\n * ```ts\n * import { Location, Source, Token, TokenKind } from 'graphql/language';\n *\n * const source = new Source('{ hello }');\n * const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1);\n * const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9);\n * const location = new Location(startToken, endToken, source);\n *\n * location.start; // => 0\n * location.end; // => 9\n * location.source.body; // => '{ hello }'\n * ```\n */\n constructor(startToken: Token, endToken: Token, source: Source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Location';\n }\n\n /**\n * Returns a JSON representation of this location.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n *\n * const document = parse('{ hello }');\n * const location = document.loc?.toJSON();\n *\n * location; // => { start: 0, end: 9 }\n * ```\n */\n toJSON(): { start: number; end: number } {\n return { start: this.start, end: this.end };\n }\n}\n\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\nexport class Token {\n /** The kind of Token. */\n readonly kind: TokenKind;\n\n /** The character offset at which this Node begins. */\n readonly start: number;\n\n /** The character offset at which this Node ends. */\n readonly end: number;\n\n /** The 1-indexed line number on which this Token appears. */\n readonly line: number;\n\n /** The 1-indexed column number at which this Token begins. */\n readonly column: number;\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n *\n * Note: is undefined for punctuation tokens, but typed as string for\n * convenience in the parser.\n */\n readonly value: string;\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n readonly prev: Token | null;\n /** Next token in the token stream, including ignored tokens. */\n readonly next: Token | null;\n\n /**\n * Creates a Token instance.\n * @param kind - Token kind produced by lexical analysis.\n * @param start - Character offset where this token begins.\n * @param end - Character offset where this token ends.\n * @param line - One-indexed line number where this token begins.\n * @param column - One-indexed column number where this token begins.\n * @param value - Interpreted value for non-punctuation tokens.\n * @example\n * ```ts\n * import { Token, TokenKind } from 'graphql/language';\n *\n * const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello');\n *\n * token.kind; // => TokenKind.NAME\n * token.value; // => 'hello'\n * token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 }\n * ```\n */\n // eslint-disable-next-line max-params\n constructor(\n kind: TokenKind,\n start: number,\n end: number,\n line: number,\n column: number,\n value?: string,\n ) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.value = value!;\n this.prev = null;\n this.next = null;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Token';\n }\n\n /**\n * Returns a JSON representation of this token.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { Lexer, Source } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n * const token = lexer.advance().toJSON();\n *\n * token; // => { kind: '{', value: undefined, line: 1, column: 1 }\n * ```\n */\n toJSON(): {\n kind: TokenKind;\n value?: string;\n line: number;\n column: number;\n } {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column,\n };\n }\n}\n\n/** The list of all possible AST node types. */\nexport type ASTNode =\n | NameNode\n | DocumentNode\n | OperationDefinitionNode\n | VariableDefinitionNode\n | VariableNode\n | SelectionSetNode\n | FieldNode\n | ArgumentNode\n | FragmentArgumentNode\n | FragmentSpreadNode\n | InlineFragmentNode\n | FragmentDefinitionNode\n | IntValueNode\n | FloatValueNode\n | StringValueNode\n | BooleanValueNode\n | NullValueNode\n | EnumValueNode\n | ListValueNode\n | ObjectValueNode\n | ObjectFieldNode\n | DirectiveNode\n | NamedTypeNode\n | ListTypeNode\n | NonNullTypeNode\n | SchemaDefinitionNode\n | OperationTypeDefinitionNode\n | ScalarTypeDefinitionNode\n | ObjectTypeDefinitionNode\n | FieldDefinitionNode\n | InputValueDefinitionNode\n | InterfaceTypeDefinitionNode\n | UnionTypeDefinitionNode\n | EnumTypeDefinitionNode\n | EnumValueDefinitionNode\n | InputObjectTypeDefinitionNode\n | DirectiveDefinitionNode\n | SchemaExtensionNode\n | ScalarTypeExtensionNode\n | ObjectTypeExtensionNode\n | InterfaceTypeExtensionNode\n | UnionTypeExtensionNode\n | EnumTypeExtensionNode\n | InputObjectTypeExtensionNode\n | DirectiveExtensionNode\n | TypeCoordinateNode\n | MemberCoordinateNode\n | ArgumentCoordinateNode\n | DirectiveCoordinateNode\n | DirectiveArgumentCoordinateNode;\n\n/** Utility type listing all nodes indexed by their kind. */\nexport type ASTKindToNode = {\n [NodeT in ASTNode as NodeT['kind']]: NodeT;\n};\n\n/** @internal */\nexport const QueryDocumentKeys: {\n [NodeT in ASTNode as NodeT['kind']]: ReadonlyArray;\n} = {\n Name: [],\n\n Document: ['definitions'],\n OperationDefinition: [\n 'description',\n 'name',\n 'variableDefinitions',\n 'directives',\n 'selectionSet',\n ],\n VariableDefinition: [\n 'description',\n 'variable',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentArgument: ['name', 'value'],\n\n FragmentSpread: [\n 'name',\n // Note: Fragment arguments are experimental and may be changed or removed\n // in the future.\n 'arguments',\n 'directives',\n ],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: [\n 'description',\n 'name',\n // Note: Fragment variables are experimental and may be changed or removed\n // in the future.\n 'variableDefinitions',\n 'typeCondition',\n 'directives',\n 'selectionSet',\n ],\n\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n\n Directive: ['name', 'arguments'],\n\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: [\n 'description',\n 'name',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n InterfaceTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n\n DirectiveDefinition: [\n 'description',\n 'name',\n 'arguments',\n 'directives',\n 'locations',\n ],\n\n SchemaExtension: ['directives', 'operationTypes'],\n DirectiveExtension: ['name', 'directives'],\n\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n\n TypeCoordinate: ['name'],\n MemberCoordinate: ['name', 'memberName'],\n ArgumentCoordinate: ['name', 'fieldName', 'argumentName'],\n DirectiveCoordinate: ['name'],\n DirectiveArgumentCoordinate: ['name', 'argumentName'],\n};\n\nconst kindValues = new Set(Object.keys(QueryDocumentKeys));\n/** @internal */\nexport function isNode(maybeNode: any): maybeNode is ASTNode {\n const maybeKind = maybeNode?.kind;\n return typeof maybeKind === 'string' && kindValues.has(maybeKind);\n}\n\n/** An identifier in a GraphQL document. */\nexport interface NameNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NAME'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** The root AST node for a parsed GraphQL document. */\n\nexport interface DocumentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DOCUMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Top-level executable and type-system definitions in this document. */\n readonly definitions: ReadonlyArray;\n /** The number of lexical tokens parsed for this document, if token counting was enabled. */\n readonly tokenCount?: number | undefined;\n}\n\n/** Any top-level definition that may appear in a GraphQL document. */\nexport type DefinitionNode =\n | ExecutableDefinitionNode\n | TypeSystemDefinitionNode\n | TypeSystemExtensionNode;\n\n/** Any executable definition that may appear in an operation document. */\nexport type ExecutableDefinitionNode =\n | OperationDefinitionNode\n | FragmentDefinitionNode;\n\n/** A query, mutation, or subscription operation definition. */\nexport interface OperationDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OPERATION_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** The operation selected for execution. */\n readonly operation: OperationTypeNode;\n /** Name node identifying this AST node. */\n readonly name?: NameNode | undefined;\n /** Variable definitions declared by this operation or fragment. */\n readonly variableDefinitions?:\n | ReadonlyArray\n | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet: SelectionSetNode;\n}\n\n/**\n * A narrowed OperationDefinitionNode for subscription operations.\n * Subscription operations go through a distinct execution pipeline\n * (source event stream + per-event execution), so narrowing the operation\n * type allows functions in that pipeline to accept only valid input.\n */\nexport interface SubscriptionOperationDefinitionNode extends OperationDefinitionNode {\n /** Subscription operation kind for this definition. */\n readonly operation: (typeof OperationTypeNode)['SUBSCRIPTION'];\n}\n\n/**\n * The operation types supported by GraphQL executable definitions.\n * @category Kinds\n */\nexport const OperationTypeNode = {\n QUERY: 'query' as const,\n MUTATION: 'mutation' as const,\n SUBSCRIPTION: 'subscription' as const,\n} as const;\n\n/**\n * The operation types supported by GraphQL executable definitions.\n * @category Kinds\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type OperationTypeNode =\n (typeof OperationTypeNode)[keyof typeof OperationTypeNode];\n\n/** A variable declaration in an operation or experimental fragment definition. */\nexport interface VariableDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['VARIABLE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** The variable being defined or referenced. */\n readonly variable: VariableNode;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n /** Default value used when no explicit value is supplied. */\n readonly defaultValue?: ConstValueNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** A variable reference, such as `$id`. */\nexport interface VariableNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['VARIABLE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A set of fields and fragments selected from an object, interface, or union. */\nexport interface SelectionSetNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n kind: KindTypeMap['SELECTION_SET'];\n /** The source location for this AST node, if location tracking was enabled. */\n loc?: Location | undefined;\n /** Fields and fragments contained in this selection set. */\n selections: ReadonlyArray;\n}\n\n/** Any selection that may appear inside a selection set. */\nexport type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode;\n\n/** A field selected in an executable GraphQL document. */\nexport interface FieldNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FIELD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The response-key alias for this field, if one was supplied. */\n readonly alias?: NameNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet?: SelectionSetNode | undefined;\n}\n\n/** An argument supplied to a field or directive. */\nexport interface ArgumentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ARGUMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ValueNode;\n}\n\n/** An argument node whose value is guaranteed to be constant. */\nexport interface ConstArgumentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ARGUMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ConstValueNode;\n}\n\n/** Variable definition declared by a fragment argument. */\nexport interface FragmentArgumentNode {\n /** AST node kind for a fragment argument. */\n readonly kind: KindTypeMap['FRAGMENT_ARGUMENT'];\n /** Source location for this fragment argument. */\n readonly loc?: Location | undefined;\n /** Variable name declared by this fragment argument. */\n readonly name: NameNode;\n /** Default value literal for this fragment argument, if provided. */\n readonly value: ValueNode;\n}\n\n/** A named fragment spread, such as `...userFields`. */\nexport interface FragmentSpreadNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FRAGMENT_SPREAD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Argument values supplied to the referenced fragment. */\n readonly arguments?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An inline fragment spread with an optional type condition. */\nexport interface InlineFragmentNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INLINE_FRAGMENT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The type condition that limits where this fragment applies. */\n readonly typeCondition?: NamedTypeNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet: SelectionSetNode;\n}\n\n/** A reusable fragment definition declared in an executable document. */\nexport interface FragmentDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FRAGMENT_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Experimental variable definitions declared by this fragment definition. */\n readonly variableDefinitions?:\n | ReadonlyArray\n | undefined;\n /** The type condition that limits where this fragment applies. */\n readonly typeCondition: NamedTypeNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Selections made by this operation, field, or fragment. */\n readonly selectionSet: SelectionSetNode;\n}\n\n/** Any value literal that may appear in an executable GraphQL document. */\nexport type ValueNode =\n | VariableNode\n | IntValueNode\n | FloatValueNode\n | StringValueNode\n | BooleanValueNode\n | NullValueNode\n | EnumValueNode\n | ListValueNode\n | ObjectValueNode;\n\n/** Any value literal that is guaranteed not to contain a variable reference. */\nexport type ConstValueNode =\n | IntValueNode\n | FloatValueNode\n | StringValueNode\n | BooleanValueNode\n | NullValueNode\n | EnumValueNode\n | ConstListValueNode\n | ConstObjectValueNode;\n\n/** An integer value literal. */\nexport interface IntValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** A floating-point value literal. */\nexport interface FloatValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FLOAT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** A string value literal. */\nexport interface StringValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['STRING'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n /** Whether this string was parsed from block string syntax. */\n readonly block?: boolean | undefined;\n}\n\n/** A boolean value literal. */\nexport interface BooleanValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['BOOLEAN'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: boolean;\n}\n\n/** A null value literal. */\nexport interface NullValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NULL'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n}\n\n/** An enum value literal. */\nexport interface EnumValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Parsed value represented by this node. */\n readonly value: string;\n}\n\n/** A list value literal. */\nexport interface ListValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['LIST'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values: ReadonlyArray;\n}\n\n/** A list value literal whose elements are all constant values. */\nexport interface ConstListValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['LIST'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values: ReadonlyArray;\n}\n\n/** An input object value literal. */\nexport interface ObjectValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n}\n\n/** An input object value literal whose fields are all constant values. */\nexport interface ConstObjectValueNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n}\n\n/** A field inside an input object value literal. */\nexport interface ObjectFieldNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_FIELD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ValueNode;\n}\n\n/** A field inside a constant input object value literal. */\nexport interface ConstObjectFieldNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_FIELD'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Parsed value represented by this node. */\n readonly value: ConstValueNode;\n}\n\n/** A directive applied to an executable or type-system location. */\nexport interface DirectiveNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n}\n\n/** A directive whose arguments are all constant values. */\nexport interface ConstDirectiveNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n}\n\n// Type Reference\n\n/** Any GraphQL type reference AST node. */\nexport type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;\n\n/** A named type reference. */\nexport interface NamedTypeNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NAMED_TYPE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A list type reference. */\nexport interface ListTypeNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['LIST_TYPE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n}\n\n/** A non-null type reference. */\nexport interface NonNullTypeNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['NON_NULL_TYPE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: NamedTypeNode | ListTypeNode;\n}\n\n// Type System Definition\n\n/** Any type-system definition that may appear in a schema document. */\nexport type TypeSystemDefinitionNode =\n | SchemaDefinitionNode\n | TypeDefinitionNode\n | DirectiveDefinitionNode;\n\n/** A schema definition in a type-system document. */\nexport interface SchemaDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCHEMA_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Root operation types declared by this schema definition or extension. */\n readonly operationTypes: ReadonlyArray;\n}\n\n/** A root operation type declaration inside a schema definition or extension. */\nexport interface OperationTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OPERATION_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The operation selected for execution. */\n readonly operation: OperationTypeNode;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: NamedTypeNode;\n}\n\n// Type Definition\n\n/** Any named type definition that may appear in a schema document. */\nexport type TypeDefinitionNode =\n | ScalarTypeDefinitionNode\n | ObjectTypeDefinitionNode\n | InterfaceTypeDefinitionNode\n | UnionTypeDefinitionNode\n | EnumTypeDefinitionNode\n | InputObjectTypeDefinitionNode;\n\n/** A scalar type definition in a type-system document. */\nexport interface ScalarTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCALAR_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An object type definition in a type-system document. */\nexport interface ObjectTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A field definition declared by an object or interface type. */\nexport interface FieldDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['FIELD_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An argument or input-field definition. */\nexport interface InputValueDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INPUT_VALUE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: TypeNode;\n /** Default value used when no explicit value is supplied. */\n readonly defaultValue?: ConstValueNode | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An interface type definition in a type-system document. */\nexport interface InterfaceTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INTERFACE_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A union type definition in a type-system document. */\nexport interface UnionTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['UNION_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Object types that belong to this union type. */\n readonly types?: ReadonlyArray | undefined;\n}\n\n/** An enum type definition in a type-system document. */\nexport interface EnumTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values?: ReadonlyArray | undefined;\n}\n\n/** An enum value definition. */\nexport interface EnumValueDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM_VALUE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An input object type definition in a type-system document. */\nexport interface InputObjectTypeDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n// Directive Definitions\n\n/** A directive definition in a type-system document. */\nexport interface DirectiveDefinitionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_DEFINITION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** The optional GraphQL description associated with this definition. */\n readonly description?: StringValueNode | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Arguments supplied to this field, directive, or coordinate. */\n readonly arguments?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Whether this directive may appear more than once at the same location. */\n readonly repeatable: boolean;\n /** Locations where this directive may be applied. */\n readonly locations: ReadonlyArray;\n}\n\n// Type System Extensions\n\n/** Any type-system extension that may appear in a schema extension document. */\nexport type TypeSystemExtensionNode =\n | SchemaExtensionNode\n | TypeExtensionNode\n | DirectiveExtensionNode;\n\n/** A schema extension in a type-system document. */\nexport interface SchemaExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCHEMA_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Root operation types declared by this schema definition or extension. */\n readonly operationTypes?:\n | ReadonlyArray\n | undefined;\n}\n\n// Type Extensions\n\n/** Any named type extension that may appear in a schema extension document. */\nexport type TypeExtensionNode =\n | ScalarTypeExtensionNode\n | ObjectTypeExtensionNode\n | InterfaceTypeExtensionNode\n | UnionTypeExtensionNode\n | EnumTypeExtensionNode\n | InputObjectTypeExtensionNode;\n\n/** A scalar type extension. */\nexport interface ScalarTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['SCALAR_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n/** An object type extension. */\nexport interface ObjectTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['OBJECT_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** An interface type extension. */\nexport interface InterfaceTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INTERFACE_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces?: ReadonlyArray | undefined;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A union type extension. */\nexport interface UnionTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['UNION_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Object types that belong to this union type. */\n readonly types?: ReadonlyArray | undefined;\n}\n\n/** An enum type extension. */\nexport interface EnumTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ENUM_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Values contained in this enum, list, or input-object definition. */\n readonly values?: ReadonlyArray | undefined;\n}\n\n/** An input object type extension. */\nexport interface InputObjectTypeExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['INPUT_OBJECT_TYPE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields?: ReadonlyArray | undefined;\n}\n\n/** A directive extension. */\nexport interface DirectiveExtensionNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_EXTENSION'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location | undefined;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives?: ReadonlyArray | undefined;\n}\n\n// Schema Coordinates\n\n/** Any AST node representing a GraphQL schema coordinate. */\nexport type SchemaCoordinateNode =\n | TypeCoordinateNode\n | MemberCoordinateNode\n | ArgumentCoordinateNode\n | DirectiveCoordinateNode\n | DirectiveArgumentCoordinateNode;\n\n/** A schema coordinate that refers to a named type. */\nexport interface TypeCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['TYPE_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A schema coordinate that refers to a member of a named type. */\nexport interface MemberCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['MEMBER_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The member name referenced by this schema coordinate. */\n readonly memberName: NameNode;\n}\n\n/** A schema coordinate that refers to a field or directive argument. */\nexport interface ArgumentCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['ARGUMENT_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The field name referenced by this schema coordinate. */\n readonly fieldName: NameNode;\n /** The argument name referenced by this schema coordinate. */\n readonly argumentName: NameNode;\n}\n\n/** A schema coordinate that refers to a directive. */\nexport interface DirectiveCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n}\n\n/** A schema coordinate that refers to a directive argument. */\nexport interface DirectiveArgumentCoordinateNode {\n /** The discriminator identifying the concrete AST or introspection kind. */\n readonly kind: KindTypeMap['DIRECTIVE_ARGUMENT_COORDINATE'];\n /** The source location for this AST node, if location tracking was enabled. */\n readonly loc?: Location;\n /** Name node identifying this AST node. */\n readonly name: NameNode;\n /** The argument name referenced by this schema coordinate. */\n readonly argumentName: NameNode;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.mts new file mode 100644 index 00000000..bcb63c69 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.mts @@ -0,0 +1,21 @@ +/** + * Produces the value of a block string from its parsed raw value, similar to + * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + * + * @internal + */ +export declare function dedentBlockStringLines(lines: ReadonlyArray): Array; +/** @internal */ +export declare function isPrintableAsBlockString(value: string): boolean; +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + * + * @internal + */ +export declare function printBlockString(value: string, options?: { + minimize?: boolean; +}): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.ts new file mode 100644 index 00000000..bcb63c69 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.d.ts @@ -0,0 +1,21 @@ +/** + * Produces the value of a block string from its parsed raw value, similar to + * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + * + * @internal + */ +export declare function dedentBlockStringLines(lines: ReadonlyArray): Array; +/** @internal */ +export declare function isPrintableAsBlockString(value: string): boolean; +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + * + * @internal + */ +export declare function printBlockString(value: string, options?: { + minimize?: boolean; +}): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js new file mode 100644 index 00000000..9b9cdecd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js @@ -0,0 +1,114 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dedentBlockStringLines = dedentBlockStringLines; +exports.isPrintableAsBlockString = isPrintableAsBlockString; +exports.printBlockString = printBlockString; +const characterClasses_ts_1 = require("./characterClasses.js"); +function dedentBlockStringLines(lines) { + let commonIndent = Number.MAX_SAFE_INTEGER; + let firstNonEmptyLine = null; + let lastNonEmptyLine = -1; + for (let i = 0; i < lines.length; ++i) { + const line = lines[i]; + const indent = leadingWhitespace(line); + if (indent === line.length) { + continue; + } + firstNonEmptyLine ??= i; + lastNonEmptyLine = i; + if (i !== 0 && indent < commonIndent) { + commonIndent = indent; + } + } + return (lines + .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) + .slice(firstNonEmptyLine ?? 0, lastNonEmptyLine + 1)); +} +function leadingWhitespace(str) { + let i = 0; + while (i < str.length && (0, characterClasses_ts_1.isWhiteSpace)(str.charCodeAt(i))) { + ++i; + } + return i; +} +function isPrintableAsBlockString(value) { + if (value === '') { + return true; + } + let isEmptyLine = true; + let hasIndent = false; + let hasCommonIndent = true; + let seenNonEmptyLine = false; + for (let i = 0; i < value.length; ++i) { + switch (value.codePointAt(i)) { + case 0x0000: + case 0x0001: + case 0x0002: + case 0x0003: + case 0x0004: + case 0x0005: + case 0x0006: + case 0x0007: + case 0x0008: + case 0x000b: + case 0x000c: + case 0x000e: + case 0x000f: + return false; + case 0x000d: + return false; + case 10: + if (isEmptyLine && !seenNonEmptyLine) { + return false; + } + seenNonEmptyLine = true; + isEmptyLine = true; + hasIndent = false; + break; + case 9: + case 32: + hasIndent ||= isEmptyLine; + break; + default: + hasCommonIndent &&= hasIndent; + isEmptyLine = false; + } + } + if (isEmptyLine) { + return false; + } + if (hasCommonIndent && seenNonEmptyLine) { + return false; + } + return true; +} +function printBlockString(value, options) { + const escapedValue = value.replaceAll('"""', '\\"""'); + const lines = escapedValue.split(/\r\n|[\n\r]/g); + const isSingleLine = lines.length === 1; + const forceLeadingNewLine = lines.length > 1 && + lines + .slice(1) + .every((line) => line.length === 0 || (0, characterClasses_ts_1.isWhiteSpace)(line.charCodeAt(0))); + const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); + const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes; + const hasTrailingSlash = value.endsWith('\\'); + const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash; + const printAsMultipleLines = !options?.minimize && + (!isSingleLine || + value.length > 70 || + forceTrailingNewline || + forceLeadingNewLine || + hasTrailingTripleQuotes); + let result = ''; + const skipLeadingNewLine = isSingleLine && (0, characterClasses_ts_1.isWhiteSpace)(value.charCodeAt(0)); + if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) { + result += '\n'; + } + result += escapedValue; + if (printAsMultipleLines || forceTrailingNewline) { + result += '\n'; + } + return '"""' + result + '"""'; +} +//# sourceMappingURL=blockString.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js.map new file mode 100644 index 00000000..e4217b63 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blockString.js","sourceRoot":"","sources":["../../src/language/blockString.ts"],"names":[],"mappings":";;AAUA,wDA8BC;AAWD,4DA0DC;AASD,4CAgDC;AAtKD,+DAAqD;AAUrD,SAAgB,sBAAsB,CACpC,KAA4B;IAE5B,IAAI,YAAY,GAA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AAM,IAAI,IAAI,CAAC;IACjB,CAAC;IAED,MAAM,IAAI,YAAY,CAAC;IACvB,IAAI,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;QACjD,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAChC,CAAC","sourcesContent":["import { isWhiteSpace } from './characterClasses.ts';\n\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringLines(\n lines: ReadonlyArray,\n): Array {\n let commonIndent = Number.MAX_SAFE_INTEGER;\n let firstNonEmptyLine = null;\n let lastNonEmptyLine = -1;\n\n for (let i = 0; i < lines.length; ++i) {\n const line = lines[i];\n const indent = leadingWhitespace(line);\n\n if (indent === line.length) {\n continue; // skip empty lines\n }\n\n firstNonEmptyLine ??= i;\n lastNonEmptyLine = i;\n\n if (i !== 0 && indent < commonIndent) {\n commonIndent = indent;\n }\n }\n\n return (\n lines\n // Remove common indentation from all lines but first.\n .map((line, i) => (i === 0 ? line : line.slice(commonIndent)))\n // Remove leading and trailing blank lines.\n .slice(firstNonEmptyLine ?? 0, lastNonEmptyLine + 1)\n );\n}\n\nfunction leadingWhitespace(str: string): number {\n let i = 0;\n while (i < str.length && isWhiteSpace(str.charCodeAt(i))) {\n ++i;\n }\n return i;\n}\n\n/** @internal */\nexport function isPrintableAsBlockString(value: string): boolean {\n if (value === '') {\n return true; // empty string is printable\n }\n\n let isEmptyLine = true;\n let hasIndent = false;\n let hasCommonIndent = true;\n let seenNonEmptyLine = false;\n\n for (let i = 0; i < value.length; ++i) {\n switch (value.codePointAt(i)) {\n case 0x0000:\n case 0x0001:\n case 0x0002:\n case 0x0003:\n case 0x0004:\n case 0x0005:\n case 0x0006:\n case 0x0007:\n case 0x0008:\n case 0x000b:\n case 0x000c:\n case 0x000e:\n case 0x000f:\n return false; // Has non-printable characters\n\n case 0x000d: // \\r\n return false; // Has \\r or \\r\\n which will be replaced as \\n\n\n case 10: // \\n\n if (isEmptyLine && !seenNonEmptyLine) {\n return false; // Has leading new line\n }\n seenNonEmptyLine = true;\n\n isEmptyLine = true;\n hasIndent = false;\n break;\n case 9: // \\t\n case 32: // \n hasIndent ||= isEmptyLine;\n break;\n default:\n hasCommonIndent &&= hasIndent;\n isEmptyLine = false;\n }\n }\n\n if (isEmptyLine) {\n return false; // Has trailing empty lines\n }\n\n if (hasCommonIndent && seenNonEmptyLine) {\n return false; // Has internal indent\n }\n\n return true;\n}\n\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\nexport function printBlockString(\n value: string,\n options?: { minimize?: boolean },\n): string {\n const escapedValue = value.replaceAll('\"\"\"', '\\\\\"\"\"');\n\n // Expand a block string's raw value into independent lines.\n const lines = escapedValue.split(/\\r\\n|[\\n\\r]/g);\n const isSingleLine = lines.length === 1;\n\n // If common indentation is found we can fix some of those cases by adding leading new line\n const forceLeadingNewLine =\n lines.length > 1 &&\n lines\n .slice(1)\n .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0)));\n\n // Trailing triple quotes just looks confusing but doesn't force trailing new line\n const hasTrailingTripleQuotes = escapedValue.endsWith('\\\\\"\"\"');\n\n // Trailing quote (single or double) or slash forces trailing new line\n const hasTrailingQuote = value.endsWith('\"') && !hasTrailingTripleQuotes;\n const hasTrailingSlash = value.endsWith('\\\\');\n const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;\n\n const printAsMultipleLines =\n !options?.minimize &&\n // add leading and trailing new lines only if it improves readability\n (!isSingleLine ||\n value.length > 70 ||\n forceTrailingNewline ||\n forceLeadingNewLine ||\n hasTrailingTripleQuotes);\n\n let result = '';\n\n // Format a multi-line block quote to account for leading space.\n const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));\n if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) {\n result += '\\n';\n }\n\n result += escapedValue;\n if (printAsMultipleLines || forceTrailingNewline) {\n result += '\\n';\n }\n\n return '\"\"\"' + result + '\"\"\"';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs new file mode 100644 index 00000000..078797a4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs @@ -0,0 +1,109 @@ +import { isWhiteSpace } from "./characterClasses.mjs"; +export function dedentBlockStringLines(lines) { + let commonIndent = Number.MAX_SAFE_INTEGER; + let firstNonEmptyLine = null; + let lastNonEmptyLine = -1; + for (let i = 0; i < lines.length; ++i) { + const line = lines[i]; + const indent = leadingWhitespace(line); + if (indent === line.length) { + continue; + } + firstNonEmptyLine ??= i; + lastNonEmptyLine = i; + if (i !== 0 && indent < commonIndent) { + commonIndent = indent; + } + } + return (lines + .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) + .slice(firstNonEmptyLine ?? 0, lastNonEmptyLine + 1)); +} +function leadingWhitespace(str) { + let i = 0; + while (i < str.length && isWhiteSpace(str.charCodeAt(i))) { + ++i; + } + return i; +} +export function isPrintableAsBlockString(value) { + if (value === '') { + return true; + } + let isEmptyLine = true; + let hasIndent = false; + let hasCommonIndent = true; + let seenNonEmptyLine = false; + for (let i = 0; i < value.length; ++i) { + switch (value.codePointAt(i)) { + case 0x0000: + case 0x0001: + case 0x0002: + case 0x0003: + case 0x0004: + case 0x0005: + case 0x0006: + case 0x0007: + case 0x0008: + case 0x000b: + case 0x000c: + case 0x000e: + case 0x000f: + return false; + case 0x000d: + return false; + case 10: + if (isEmptyLine && !seenNonEmptyLine) { + return false; + } + seenNonEmptyLine = true; + isEmptyLine = true; + hasIndent = false; + break; + case 9: + case 32: + hasIndent ||= isEmptyLine; + break; + default: + hasCommonIndent &&= hasIndent; + isEmptyLine = false; + } + } + if (isEmptyLine) { + return false; + } + if (hasCommonIndent && seenNonEmptyLine) { + return false; + } + return true; +} +export function printBlockString(value, options) { + const escapedValue = value.replaceAll('"""', '\\"""'); + const lines = escapedValue.split(/\r\n|[\n\r]/g); + const isSingleLine = lines.length === 1; + const forceLeadingNewLine = lines.length > 1 && + lines + .slice(1) + .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0))); + const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); + const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes; + const hasTrailingSlash = value.endsWith('\\'); + const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash; + const printAsMultipleLines = !options?.minimize && + (!isSingleLine || + value.length > 70 || + forceTrailingNewline || + forceLeadingNewLine || + hasTrailingTripleQuotes); + let result = ''; + const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0)); + if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) { + result += '\n'; + } + result += escapedValue; + if (printAsMultipleLines || forceTrailingNewline) { + result += '\n'; + } + return '"""' + result + '"""'; +} +//# sourceMappingURL=blockString.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs.map new file mode 100644 index 00000000..56405bfb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/blockString.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"blockString.js","sourceRoot":"","sources":["../../src/language/blockString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,+BAA8B;AAUrD,MAAM,UAAU,sBAAsB,CACpC,KAA4B;IAE5B,IAAI,YAAY,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAC3C,IAAI,iBAAiB,GAA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vB,IAAI,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;QACjD,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAChC,CAAC","sourcesContent":["import { isWhiteSpace } from './characterClasses.ts';\n\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringLines(\n lines: ReadonlyArray,\n): Array {\n let commonIndent = Number.MAX_SAFE_INTEGER;\n let firstNonEmptyLine = null;\n let lastNonEmptyLine = -1;\n\n for (let i = 0; i < lines.length; ++i) {\n const line = lines[i];\n const indent = leadingWhitespace(line);\n\n if (indent === line.length) {\n continue; // skip empty lines\n }\n\n firstNonEmptyLine ??= i;\n lastNonEmptyLine = i;\n\n if (i !== 0 && indent < commonIndent) {\n commonIndent = indent;\n }\n }\n\n return (\n lines\n // Remove common indentation from all lines but first.\n .map((line, i) => (i === 0 ? line : line.slice(commonIndent)))\n // Remove leading and trailing blank lines.\n .slice(firstNonEmptyLine ?? 0, lastNonEmptyLine + 1)\n );\n}\n\nfunction leadingWhitespace(str: string): number {\n let i = 0;\n while (i < str.length && isWhiteSpace(str.charCodeAt(i))) {\n ++i;\n }\n return i;\n}\n\n/** @internal */\nexport function isPrintableAsBlockString(value: string): boolean {\n if (value === '') {\n return true; // empty string is printable\n }\n\n let isEmptyLine = true;\n let hasIndent = false;\n let hasCommonIndent = true;\n let seenNonEmptyLine = false;\n\n for (let i = 0; i < value.length; ++i) {\n switch (value.codePointAt(i)) {\n case 0x0000:\n case 0x0001:\n case 0x0002:\n case 0x0003:\n case 0x0004:\n case 0x0005:\n case 0x0006:\n case 0x0007:\n case 0x0008:\n case 0x000b:\n case 0x000c:\n case 0x000e:\n case 0x000f:\n return false; // Has non-printable characters\n\n case 0x000d: // \\r\n return false; // Has \\r or \\r\\n which will be replaced as \\n\n\n case 10: // \\n\n if (isEmptyLine && !seenNonEmptyLine) {\n return false; // Has leading new line\n }\n seenNonEmptyLine = true;\n\n isEmptyLine = true;\n hasIndent = false;\n break;\n case 9: // \\t\n case 32: // \n hasIndent ||= isEmptyLine;\n break;\n default:\n hasCommonIndent &&= hasIndent;\n isEmptyLine = false;\n }\n }\n\n if (isEmptyLine) {\n return false; // Has trailing empty lines\n }\n\n if (hasCommonIndent && seenNonEmptyLine) {\n return false; // Has internal indent\n }\n\n return true;\n}\n\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\nexport function printBlockString(\n value: string,\n options?: { minimize?: boolean },\n): string {\n const escapedValue = value.replaceAll('\"\"\"', '\\\\\"\"\"');\n\n // Expand a block string's raw value into independent lines.\n const lines = escapedValue.split(/\\r\\n|[\\n\\r]/g);\n const isSingleLine = lines.length === 1;\n\n // If common indentation is found we can fix some of those cases by adding leading new line\n const forceLeadingNewLine =\n lines.length > 1 &&\n lines\n .slice(1)\n .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0)));\n\n // Trailing triple quotes just looks confusing but doesn't force trailing new line\n const hasTrailingTripleQuotes = escapedValue.endsWith('\\\\\"\"\"');\n\n // Trailing quote (single or double) or slash forces trailing new line\n const hasTrailingQuote = value.endsWith('\"') && !hasTrailingTripleQuotes;\n const hasTrailingSlash = value.endsWith('\\\\');\n const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;\n\n const printAsMultipleLines =\n !options?.minimize &&\n // add leading and trailing new lines only if it improves readability\n (!isSingleLine ||\n value.length > 70 ||\n forceTrailingNewline ||\n forceLeadingNewLine ||\n hasTrailingTripleQuotes);\n\n let result = '';\n\n // Format a multi-line block quote to account for leading space.\n const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));\n if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) {\n result += '\\n';\n }\n\n result += escapedValue;\n if (printAsMultipleLines || forceTrailingNewline) {\n result += '\\n';\n }\n\n return '\"\"\"' + result + '\"\"\"';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.mts new file mode 100644 index 00000000..1e5da8ae --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.mts @@ -0,0 +1,47 @@ +/** + * ``` + * WhiteSpace :: + * - "Horizontal Tab (U+0009)" + * - "Space (U+0020)" + * ``` + * @internal + */ +export declare function isWhiteSpace(code: number): boolean; +/** + * ``` + * Digit :: one of + * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + * ``` + * @internal + */ +export declare function isDigit(code: number): boolean; +/** + * ``` + * Letter :: one of + * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` + * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` + * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` + * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` + * ``` + * @internal + */ +export declare function isLetter(code: number): boolean; +/** + * ``` + * NameStart :: + * - Letter + * - `_` + * ``` + * @internal + */ +export declare function isNameStart(code: number): boolean; +/** + * ``` + * NameContinue :: + * - Letter + * - Digit + * - `_` + * ``` + * @internal + */ +export declare function isNameContinue(code: number): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.ts new file mode 100644 index 00000000..1e5da8ae --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.d.ts @@ -0,0 +1,47 @@ +/** + * ``` + * WhiteSpace :: + * - "Horizontal Tab (U+0009)" + * - "Space (U+0020)" + * ``` + * @internal + */ +export declare function isWhiteSpace(code: number): boolean; +/** + * ``` + * Digit :: one of + * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` + * ``` + * @internal + */ +export declare function isDigit(code: number): boolean; +/** + * ``` + * Letter :: one of + * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` + * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` + * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` + * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` + * ``` + * @internal + */ +export declare function isLetter(code: number): boolean; +/** + * ``` + * NameStart :: + * - Letter + * - `_` + * ``` + * @internal + */ +export declare function isNameStart(code: number): boolean; +/** + * ``` + * NameContinue :: + * - Letter + * - Digit + * - `_` + * ``` + * @internal + */ +export declare function isNameContinue(code: number): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js new file mode 100644 index 00000000..8324781a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isWhiteSpace = isWhiteSpace; +exports.isDigit = isDigit; +exports.isLetter = isLetter; +exports.isNameStart = isNameStart; +exports.isNameContinue = isNameContinue; +function isWhiteSpace(code) { + return code === 0x0009 || code === 0x0020; +} +function isDigit(code) { + return code >= 0x0030 && code <= 0x0039; +} +function isLetter(code) { + return ((code >= 0x0061 && code <= 0x007a) || + (code >= 0x0041 && code <= 0x005a)); +} +function isNameStart(code) { + return isLetter(code) || code === 0x005f; +} +function isNameContinue(code) { + return isLetter(code) || isDigit(code) || code === 0x005f; +} +//# sourceMappingURL=characterClasses.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js.map new file mode 100644 index 00000000..8d57831f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.js.map @@ -0,0 +1 @@ +{"version":3,"file":"characterClasses.js","sourceRoot":"","sources":["../../src/language/characterClasses.ts"],"names":[],"mappings":";;AAQA,oCAEC;AASD,0BAEC;AAYD,4BAKC;AAUD,kCAEC;AAWD,wCAEC;AAvDD,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,CAAC;AAC5C,CAAC;AASD,SAAgB,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC;AAC1C,CAAC;AAYD,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,CACL,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC;QAClC,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CACnC,CAAC;AACJ,CAAC;AAUD,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,MAAM,CAAC;AAC3C,CAAC;AAWD,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,MAAM,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * ```\n * WhiteSpace ::\n * - \"Horizontal Tab (U+0009)\"\n * - \"Space (U+0020)\"\n * ```\n * @internal\n */\nexport function isWhiteSpace(code: number): boolean {\n return code === 0x0009 || code === 0x0020;\n}\n\n/**\n * ```\n * Digit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * ```\n * @internal\n */\nexport function isDigit(code: number): boolean {\n return code >= 0x0030 && code <= 0x0039;\n}\n\n/**\n * ```\n * Letter :: one of\n * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`\n * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`\n * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`\n * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`\n * ```\n * @internal\n */\nexport function isLetter(code: number): boolean {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}\n\n/**\n * ```\n * NameStart ::\n * - Letter\n * - `_`\n * ```\n * @internal\n */\nexport function isNameStart(code: number): boolean {\n return isLetter(code) || code === 0x005f;\n}\n\n/**\n * ```\n * NameContinue ::\n * - Letter\n * - Digit\n * - `_`\n * ```\n * @internal\n */\nexport function isNameContinue(code: number): boolean {\n return isLetter(code) || isDigit(code) || code === 0x005f;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs new file mode 100644 index 00000000..e39ca6ea --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs @@ -0,0 +1,17 @@ +export function isWhiteSpace(code) { + return code === 0x0009 || code === 0x0020; +} +export function isDigit(code) { + return code >= 0x0030 && code <= 0x0039; +} +export function isLetter(code) { + return ((code >= 0x0061 && code <= 0x007a) || + (code >= 0x0041 && code <= 0x005a)); +} +export function isNameStart(code) { + return isLetter(code) || code === 0x005f; +} +export function isNameContinue(code) { + return isLetter(code) || isDigit(code) || code === 0x005f; +} +//# sourceMappingURL=characterClasses.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs.map new file mode 100644 index 00000000..8d801b0d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/characterClasses.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"characterClasses.js","sourceRoot":"","sources":["../../src/language/characterClasses.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,CAAC;AAC5C,CAAC;AASD,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC;AAC1C,CAAC;AAYD,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,CACL,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC;QAClC,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CACnC,CAAC;AACJ,CAAC;AAUD,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,MAAM,CAAC;AAC3C,CAAC;AAWD,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,MAAM,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * ```\n * WhiteSpace ::\n * - \"Horizontal Tab (U+0009)\"\n * - \"Space (U+0020)\"\n * ```\n * @internal\n */\nexport function isWhiteSpace(code: number): boolean {\n return code === 0x0009 || code === 0x0020;\n}\n\n/**\n * ```\n * Digit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * ```\n * @internal\n */\nexport function isDigit(code: number): boolean {\n return code >= 0x0030 && code <= 0x0039;\n}\n\n/**\n * ```\n * Letter :: one of\n * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`\n * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`\n * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`\n * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`\n * ```\n * @internal\n */\nexport function isLetter(code: number): boolean {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}\n\n/**\n * ```\n * NameStart ::\n * - Letter\n * - `_`\n * ```\n * @internal\n */\nexport function isNameStart(code: number): boolean {\n return isLetter(code) || code === 0x005f;\n}\n\n/**\n * ```\n * NameContinue ::\n * - Letter\n * - Digit\n * - `_`\n * ```\n * @internal\n */\nexport function isNameContinue(code: number): boolean {\n return isLetter(code) || isDigit(code) || code === 0x005f;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.mts new file mode 100644 index 00000000..d4e318bd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.mts @@ -0,0 +1,48 @@ +/** @category Kinds */ +/** The set of allowed directive location values. */ +export declare const DirectiveLocation: { + /** Directive location for query operations. */ + readonly QUERY: "QUERY"; + /** Directive location for mutation operations. */ + readonly MUTATION: "MUTATION"; + /** Directive location for subscription operations. */ + readonly SUBSCRIPTION: "SUBSCRIPTION"; + /** Directive location for field selections. */ + readonly FIELD: "FIELD"; + /** Directive location for fragment definitions. */ + readonly FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; + /** Directive location for fragment spreads. */ + readonly FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; + /** Directive location for inline fragments. */ + readonly INLINE_FRAGMENT: "INLINE_FRAGMENT"; + /** Directive location for variable definitions. */ + readonly VARIABLE_DEFINITION: "VARIABLE_DEFINITION"; + /** Directive location for fragment variable definitions. */ + readonly FRAGMENT_VARIABLE_DEFINITION: "FRAGMENT_VARIABLE_DEFINITION"; + /** Directive location for schema definitions and extensions. */ + readonly SCHEMA: "SCHEMA"; + /** Directive location for scalar type definitions and extensions. */ + readonly SCALAR: "SCALAR"; + /** Directive location for object type definitions and extensions. */ + readonly OBJECT: "OBJECT"; + /** Directive location for field definitions. */ + readonly FIELD_DEFINITION: "FIELD_DEFINITION"; + /** Directive location for argument definitions. */ + readonly ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; + /** Directive location for interface type definitions and extensions. */ + readonly INTERFACE: "INTERFACE"; + /** Directive location for union type definitions and extensions. */ + readonly UNION: "UNION"; + /** Directive location for enum type definitions and extensions. */ + readonly ENUM: "ENUM"; + /** Directive location for enum value definitions. */ + readonly ENUM_VALUE: "ENUM_VALUE"; + /** Directive location for input object type definitions and extensions. */ + readonly INPUT_OBJECT: "INPUT_OBJECT"; + /** Directive location for input object field definitions. */ + readonly INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; + /** Directive location for directive definitions and extensions. */ + readonly DIRECTIVE_DEFINITION: "DIRECTIVE_DEFINITION"; +}; +/** The set of allowed directive location values. */ +export type DirectiveLocation = (typeof DirectiveLocation)[keyof typeof DirectiveLocation]; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.ts new file mode 100644 index 00000000..d4e318bd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.d.ts @@ -0,0 +1,48 @@ +/** @category Kinds */ +/** The set of allowed directive location values. */ +export declare const DirectiveLocation: { + /** Directive location for query operations. */ + readonly QUERY: "QUERY"; + /** Directive location for mutation operations. */ + readonly MUTATION: "MUTATION"; + /** Directive location for subscription operations. */ + readonly SUBSCRIPTION: "SUBSCRIPTION"; + /** Directive location for field selections. */ + readonly FIELD: "FIELD"; + /** Directive location for fragment definitions. */ + readonly FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; + /** Directive location for fragment spreads. */ + readonly FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; + /** Directive location for inline fragments. */ + readonly INLINE_FRAGMENT: "INLINE_FRAGMENT"; + /** Directive location for variable definitions. */ + readonly VARIABLE_DEFINITION: "VARIABLE_DEFINITION"; + /** Directive location for fragment variable definitions. */ + readonly FRAGMENT_VARIABLE_DEFINITION: "FRAGMENT_VARIABLE_DEFINITION"; + /** Directive location for schema definitions and extensions. */ + readonly SCHEMA: "SCHEMA"; + /** Directive location for scalar type definitions and extensions. */ + readonly SCALAR: "SCALAR"; + /** Directive location for object type definitions and extensions. */ + readonly OBJECT: "OBJECT"; + /** Directive location for field definitions. */ + readonly FIELD_DEFINITION: "FIELD_DEFINITION"; + /** Directive location for argument definitions. */ + readonly ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; + /** Directive location for interface type definitions and extensions. */ + readonly INTERFACE: "INTERFACE"; + /** Directive location for union type definitions and extensions. */ + readonly UNION: "UNION"; + /** Directive location for enum type definitions and extensions. */ + readonly ENUM: "ENUM"; + /** Directive location for enum value definitions. */ + readonly ENUM_VALUE: "ENUM_VALUE"; + /** Directive location for input object type definitions and extensions. */ + readonly INPUT_OBJECT: "INPUT_OBJECT"; + /** Directive location for input object field definitions. */ + readonly INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; + /** Directive location for directive definitions and extensions. */ + readonly DIRECTIVE_DEFINITION: "DIRECTIVE_DEFINITION"; +}; +/** The set of allowed directive location values. */ +export type DirectiveLocation = (typeof DirectiveLocation)[keyof typeof DirectiveLocation]; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js new file mode 100644 index 00000000..f66cd746 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DirectiveLocation = void 0; +exports.DirectiveLocation = { + QUERY: 'QUERY', + MUTATION: 'MUTATION', + SUBSCRIPTION: 'SUBSCRIPTION', + FIELD: 'FIELD', + FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', + FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', + INLINE_FRAGMENT: 'INLINE_FRAGMENT', + VARIABLE_DEFINITION: 'VARIABLE_DEFINITION', + FRAGMENT_VARIABLE_DEFINITION: 'FRAGMENT_VARIABLE_DEFINITION', + SCHEMA: 'SCHEMA', + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + FIELD_DEFINITION: 'FIELD_DEFINITION', + ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + ENUM_VALUE: 'ENUM_VALUE', + INPUT_OBJECT: 'INPUT_OBJECT', + INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION', + DIRECTIVE_DEFINITION: 'DIRECTIVE_DEFINITION', +}; +//# sourceMappingURL=directiveLocation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js.map new file mode 100644 index 00000000..e3a041fe --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"directiveLocation.js","sourceRoot":"","sources":["../../src/language/directiveLocation.ts"],"names":[],"mappings":";;;AAGa,QAAA,iBAAiB,GAAG;IAG/B,KAAK,EAAE,OAAgB;IAEvB,QAAQ,EAAE,UAAmB;IAE7B,YAAY,EAAE,cAAuB;IAErC,KAAK,EAAE,OAAgB;IAEvB,mBAAmB,EAAE,qBAA8B;IAEnD,eAAe,EAAE,iBAA0B;IAE3C,eAAe,EAAE,iBAA0B;IAE3C,mBAAmB,EAAE,qBAA8B;IAEnD,4BAA4B,EAAE,8BAAuC;IAGrE,MAAM,EAAE,QAAiB;IAEzB,MAAM,EAAE,QAAiB;IAEzB,MAAM,EAAE,QAAiB;IAEzB,gBAAgB,EAAE,kBAA2B;IAE7C,mBAAmB,EAAE,qBAA8B;IAEnD,SAAS,EAAE,WAAoB;IAE/B,KAAK,EAAE,OAAgB;IAEvB,IAAI,EAAE,MAAe;IAErB,UAAU,EAAE,YAAqB;IAEjC,YAAY,EAAE,cAAuB;IAErC,sBAAsB,EAAE,wBAAiC;IAEzD,oBAAoB,EAAE,sBAA+B;CAC7C,CAAC","sourcesContent":["/** @category Kinds */\n\n/** The set of allowed directive location values. */\nexport const DirectiveLocation = {\n // Request Definitions\n /** Directive location for query operations. */\n QUERY: 'QUERY' as const,\n /** Directive location for mutation operations. */\n MUTATION: 'MUTATION' as const,\n /** Directive location for subscription operations. */\n SUBSCRIPTION: 'SUBSCRIPTION' as const,\n /** Directive location for field selections. */\n FIELD: 'FIELD' as const,\n /** Directive location for fragment definitions. */\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION' as const,\n /** Directive location for fragment spreads. */\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD' as const,\n /** Directive location for inline fragments. */\n INLINE_FRAGMENT: 'INLINE_FRAGMENT' as const,\n /** Directive location for variable definitions. */\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION' as const,\n /** Directive location for fragment variable definitions. */\n FRAGMENT_VARIABLE_DEFINITION: 'FRAGMENT_VARIABLE_DEFINITION' as const,\n // Type System Definitions\n /** Directive location for schema definitions and extensions. */\n SCHEMA: 'SCHEMA' as const,\n /** Directive location for scalar type definitions and extensions. */\n SCALAR: 'SCALAR' as const,\n /** Directive location for object type definitions and extensions. */\n OBJECT: 'OBJECT' as const,\n /** Directive location for field definitions. */\n FIELD_DEFINITION: 'FIELD_DEFINITION' as const,\n /** Directive location for argument definitions. */\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION' as const,\n /** Directive location for interface type definitions and extensions. */\n INTERFACE: 'INTERFACE' as const,\n /** Directive location for union type definitions and extensions. */\n UNION: 'UNION' as const,\n /** Directive location for enum type definitions and extensions. */\n ENUM: 'ENUM' as const,\n /** Directive location for enum value definitions. */\n ENUM_VALUE: 'ENUM_VALUE' as const,\n /** Directive location for input object type definitions and extensions. */\n INPUT_OBJECT: 'INPUT_OBJECT' as const,\n /** Directive location for input object field definitions. */\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION' as const,\n /** Directive location for directive definitions and extensions. */\n DIRECTIVE_DEFINITION: 'DIRECTIVE_DEFINITION' as const,\n} as const;\n\n/** The set of allowed directive location values. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DirectiveLocation =\n (typeof DirectiveLocation)[keyof typeof DirectiveLocation];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs new file mode 100644 index 00000000..e265c87b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs @@ -0,0 +1,24 @@ +export const DirectiveLocation = { + QUERY: 'QUERY', + MUTATION: 'MUTATION', + SUBSCRIPTION: 'SUBSCRIPTION', + FIELD: 'FIELD', + FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', + FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', + INLINE_FRAGMENT: 'INLINE_FRAGMENT', + VARIABLE_DEFINITION: 'VARIABLE_DEFINITION', + FRAGMENT_VARIABLE_DEFINITION: 'FRAGMENT_VARIABLE_DEFINITION', + SCHEMA: 'SCHEMA', + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + FIELD_DEFINITION: 'FIELD_DEFINITION', + ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + ENUM_VALUE: 'ENUM_VALUE', + INPUT_OBJECT: 'INPUT_OBJECT', + INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION', + DIRECTIVE_DEFINITION: 'DIRECTIVE_DEFINITION', +}; +//# sourceMappingURL=directiveLocation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs.map new file mode 100644 index 00000000..6452d788 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/directiveLocation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"directiveLocation.js","sourceRoot":"","sources":["../../src/language/directiveLocation.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAG/B,KAAK,EAAE,OAAgB;IAEvB,QAAQ,EAAE,UAAmB;IAE7B,YAAY,EAAE,cAAuB;IAErC,KAAK,EAAE,OAAgB;IAEvB,mBAAmB,EAAE,qBAA8B;IAEnD,eAAe,EAAE,iBAA0B;IAE3C,eAAe,EAAE,iBAA0B;IAE3C,mBAAmB,EAAE,qBAA8B;IAEnD,4BAA4B,EAAE,8BAAuC;IAGrE,MAAM,EAAE,QAAiB;IAEzB,MAAM,EAAE,QAAiB;IAEzB,MAAM,EAAE,QAAiB;IAEzB,gBAAgB,EAAE,kBAA2B;IAE7C,mBAAmB,EAAE,qBAA8B;IAEnD,SAAS,EAAE,WAAoB;IAE/B,KAAK,EAAE,OAAgB;IAEvB,IAAI,EAAE,MAAe;IAErB,UAAU,EAAE,YAAqB;IAEjC,YAAY,EAAE,cAAuB;IAErC,sBAAsB,EAAE,wBAAiC;IAEzD,oBAAoB,EAAE,sBAA+B;CAC7C,CAAC","sourcesContent":["/** @category Kinds */\n\n/** The set of allowed directive location values. */\nexport const DirectiveLocation = {\n // Request Definitions\n /** Directive location for query operations. */\n QUERY: 'QUERY' as const,\n /** Directive location for mutation operations. */\n MUTATION: 'MUTATION' as const,\n /** Directive location for subscription operations. */\n SUBSCRIPTION: 'SUBSCRIPTION' as const,\n /** Directive location for field selections. */\n FIELD: 'FIELD' as const,\n /** Directive location for fragment definitions. */\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION' as const,\n /** Directive location for fragment spreads. */\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD' as const,\n /** Directive location for inline fragments. */\n INLINE_FRAGMENT: 'INLINE_FRAGMENT' as const,\n /** Directive location for variable definitions. */\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION' as const,\n /** Directive location for fragment variable definitions. */\n FRAGMENT_VARIABLE_DEFINITION: 'FRAGMENT_VARIABLE_DEFINITION' as const,\n // Type System Definitions\n /** Directive location for schema definitions and extensions. */\n SCHEMA: 'SCHEMA' as const,\n /** Directive location for scalar type definitions and extensions. */\n SCALAR: 'SCALAR' as const,\n /** Directive location for object type definitions and extensions. */\n OBJECT: 'OBJECT' as const,\n /** Directive location for field definitions. */\n FIELD_DEFINITION: 'FIELD_DEFINITION' as const,\n /** Directive location for argument definitions. */\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION' as const,\n /** Directive location for interface type definitions and extensions. */\n INTERFACE: 'INTERFACE' as const,\n /** Directive location for union type definitions and extensions. */\n UNION: 'UNION' as const,\n /** Directive location for enum type definitions and extensions. */\n ENUM: 'ENUM' as const,\n /** Directive location for enum value definitions. */\n ENUM_VALUE: 'ENUM_VALUE' as const,\n /** Directive location for input object type definitions and extensions. */\n INPUT_OBJECT: 'INPUT_OBJECT' as const,\n /** Directive location for input object field definitions. */\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION' as const,\n /** Directive location for directive definitions and extensions. */\n DIRECTIVE_DEFINITION: 'DIRECTIVE_DEFINITION' as const,\n} as const;\n\n/** The set of allowed directive location values. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DirectiveLocation =\n (typeof DirectiveLocation)[keyof typeof DirectiveLocation];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.mts new file mode 100644 index 00000000..0e76d92f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.mts @@ -0,0 +1,22 @@ +/** + * Parse, print, and visit GraphQL language source files and AST nodes. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { Source } from "./source.mjs"; +export { getLocation } from "./location.mjs"; +export type { SourceLocation } from "./location.mjs"; +export { printLocation, printSourceLocation } from "./printLocation.mjs"; +export { Kind } from "./kinds.mjs"; +export { TokenKind } from "./tokenKind.mjs"; +export { Lexer } from "./lexer.mjs"; +export { parse, parseValue, parseConstValue, parseType, parseSchemaCoordinate, } from "./parser.mjs"; +export type { ParseOptions } from "./parser.mjs"; +export { print } from "./printer.mjs"; +export { visit, visitInParallel, getEnterLeaveForKind, BREAK, } from "./visitor.mjs"; +export type { ASTVisitor, ASTVisitFn, ASTVisitorKeyMap } from "./visitor.mjs"; +export { Location, Token, OperationTypeNode } from "./ast.mjs"; +export type { ASTNode, ASTKindToNode, NameNode, DocumentNode, DefinitionNode, ExecutableDefinitionNode, OperationDefinitionNode, SubscriptionOperationDefinitionNode, VariableDefinitionNode, VariableNode, SelectionSetNode, SelectionNode, FieldNode, ArgumentNode, FragmentArgumentNode, ConstArgumentNode, FragmentSpreadNode, InlineFragmentNode, FragmentDefinitionNode, ValueNode, ConstValueNode, IntValueNode, FloatValueNode, StringValueNode, BooleanValueNode, NullValueNode, EnumValueNode, ListValueNode, ConstListValueNode, ObjectValueNode, ConstObjectValueNode, ObjectFieldNode, ConstObjectFieldNode, DirectiveNode, ConstDirectiveNode, TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, TypeSystemDefinitionNode, SchemaDefinitionNode, OperationTypeDefinitionNode, TypeDefinitionNode, ScalarTypeDefinitionNode, ObjectTypeDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, InputObjectTypeDefinitionNode, DirectiveDefinitionNode, TypeSystemExtensionNode, SchemaExtensionNode, TypeExtensionNode, ScalarTypeExtensionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, UnionTypeExtensionNode, EnumTypeExtensionNode, InputObjectTypeExtensionNode, DirectiveExtensionNode, SchemaCoordinateNode, TypeCoordinateNode, MemberCoordinateNode, ArgumentCoordinateNode, DirectiveCoordinateNode, DirectiveArgumentCoordinateNode, } from "./ast.mjs"; +export { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isConstValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode, isSchemaCoordinateNode, isSubscriptionOperationDefinitionNode, } from "./predicates.mjs"; +export { DirectiveLocation } from "./directiveLocation.mjs"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.ts new file mode 100644 index 00000000..73b235bc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.d.ts @@ -0,0 +1,22 @@ +/** + * Parse, print, and visit GraphQL language source files and AST nodes. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { Source } from "./source.js"; +export { getLocation } from "./location.js"; +export type { SourceLocation } from "./location.js"; +export { printLocation, printSourceLocation } from "./printLocation.js"; +export { Kind } from "./kinds.js"; +export { TokenKind } from "./tokenKind.js"; +export { Lexer } from "./lexer.js"; +export { parse, parseValue, parseConstValue, parseType, parseSchemaCoordinate, } from "./parser.js"; +export type { ParseOptions } from "./parser.js"; +export { print } from "./printer.js"; +export { visit, visitInParallel, getEnterLeaveForKind, BREAK, } from "./visitor.js"; +export type { ASTVisitor, ASTVisitFn, ASTVisitorKeyMap } from "./visitor.js"; +export { Location, Token, OperationTypeNode } from "./ast.js"; +export type { ASTNode, ASTKindToNode, NameNode, DocumentNode, DefinitionNode, ExecutableDefinitionNode, OperationDefinitionNode, SubscriptionOperationDefinitionNode, VariableDefinitionNode, VariableNode, SelectionSetNode, SelectionNode, FieldNode, ArgumentNode, FragmentArgumentNode, ConstArgumentNode, FragmentSpreadNode, InlineFragmentNode, FragmentDefinitionNode, ValueNode, ConstValueNode, IntValueNode, FloatValueNode, StringValueNode, BooleanValueNode, NullValueNode, EnumValueNode, ListValueNode, ConstListValueNode, ObjectValueNode, ConstObjectValueNode, ObjectFieldNode, ConstObjectFieldNode, DirectiveNode, ConstDirectiveNode, TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, TypeSystemDefinitionNode, SchemaDefinitionNode, OperationTypeDefinitionNode, TypeDefinitionNode, ScalarTypeDefinitionNode, ObjectTypeDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, InputObjectTypeDefinitionNode, DirectiveDefinitionNode, TypeSystemExtensionNode, SchemaExtensionNode, TypeExtensionNode, ScalarTypeExtensionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, UnionTypeExtensionNode, EnumTypeExtensionNode, InputObjectTypeExtensionNode, DirectiveExtensionNode, SchemaCoordinateNode, TypeCoordinateNode, MemberCoordinateNode, ArgumentCoordinateNode, DirectiveCoordinateNode, DirectiveArgumentCoordinateNode, } from "./ast.js"; +export { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isConstValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode, isSchemaCoordinateNode, isSubscriptionOperationDefinitionNode, } from "./predicates.js"; +export { DirectiveLocation } from "./directiveLocation.js"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js new file mode 100644 index 00000000..fc2e38f4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DirectiveLocation = exports.isSubscriptionOperationDefinitionNode = exports.isSchemaCoordinateNode = exports.isTypeExtensionNode = exports.isTypeSystemExtensionNode = exports.isTypeDefinitionNode = exports.isTypeSystemDefinitionNode = exports.isTypeNode = exports.isConstValueNode = exports.isValueNode = exports.isSelectionNode = exports.isExecutableDefinitionNode = exports.isDefinitionNode = exports.OperationTypeNode = exports.Token = exports.Location = exports.BREAK = exports.getEnterLeaveForKind = exports.visitInParallel = exports.visit = exports.print = exports.parseSchemaCoordinate = exports.parseType = exports.parseConstValue = exports.parseValue = exports.parse = exports.Lexer = exports.TokenKind = exports.Kind = exports.printSourceLocation = exports.printLocation = exports.getLocation = exports.Source = void 0; +var source_ts_1 = require("./source.js"); +Object.defineProperty(exports, "Source", { enumerable: true, get: function () { return source_ts_1.Source; } }); +var location_ts_1 = require("./location.js"); +Object.defineProperty(exports, "getLocation", { enumerable: true, get: function () { return location_ts_1.getLocation; } }); +var printLocation_ts_1 = require("./printLocation.js"); +Object.defineProperty(exports, "printLocation", { enumerable: true, get: function () { return printLocation_ts_1.printLocation; } }); +Object.defineProperty(exports, "printSourceLocation", { enumerable: true, get: function () { return printLocation_ts_1.printSourceLocation; } }); +var kinds_ts_1 = require("./kinds.js"); +Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return kinds_ts_1.Kind; } }); +var tokenKind_ts_1 = require("./tokenKind.js"); +Object.defineProperty(exports, "TokenKind", { enumerable: true, get: function () { return tokenKind_ts_1.TokenKind; } }); +var lexer_ts_1 = require("./lexer.js"); +Object.defineProperty(exports, "Lexer", { enumerable: true, get: function () { return lexer_ts_1.Lexer; } }); +var parser_ts_1 = require("./parser.js"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_ts_1.parse; } }); +Object.defineProperty(exports, "parseValue", { enumerable: true, get: function () { return parser_ts_1.parseValue; } }); +Object.defineProperty(exports, "parseConstValue", { enumerable: true, get: function () { return parser_ts_1.parseConstValue; } }); +Object.defineProperty(exports, "parseType", { enumerable: true, get: function () { return parser_ts_1.parseType; } }); +Object.defineProperty(exports, "parseSchemaCoordinate", { enumerable: true, get: function () { return parser_ts_1.parseSchemaCoordinate; } }); +var printer_ts_1 = require("./printer.js"); +Object.defineProperty(exports, "print", { enumerable: true, get: function () { return printer_ts_1.print; } }); +var visitor_ts_1 = require("./visitor.js"); +Object.defineProperty(exports, "visit", { enumerable: true, get: function () { return visitor_ts_1.visit; } }); +Object.defineProperty(exports, "visitInParallel", { enumerable: true, get: function () { return visitor_ts_1.visitInParallel; } }); +Object.defineProperty(exports, "getEnterLeaveForKind", { enumerable: true, get: function () { return visitor_ts_1.getEnterLeaveForKind; } }); +Object.defineProperty(exports, "BREAK", { enumerable: true, get: function () { return visitor_ts_1.BREAK; } }); +var ast_ts_1 = require("./ast.js"); +Object.defineProperty(exports, "Location", { enumerable: true, get: function () { return ast_ts_1.Location; } }); +Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return ast_ts_1.Token; } }); +Object.defineProperty(exports, "OperationTypeNode", { enumerable: true, get: function () { return ast_ts_1.OperationTypeNode; } }); +var predicates_ts_1 = require("./predicates.js"); +Object.defineProperty(exports, "isDefinitionNode", { enumerable: true, get: function () { return predicates_ts_1.isDefinitionNode; } }); +Object.defineProperty(exports, "isExecutableDefinitionNode", { enumerable: true, get: function () { return predicates_ts_1.isExecutableDefinitionNode; } }); +Object.defineProperty(exports, "isSelectionNode", { enumerable: true, get: function () { return predicates_ts_1.isSelectionNode; } }); +Object.defineProperty(exports, "isValueNode", { enumerable: true, get: function () { return predicates_ts_1.isValueNode; } }); +Object.defineProperty(exports, "isConstValueNode", { enumerable: true, get: function () { return predicates_ts_1.isConstValueNode; } }); +Object.defineProperty(exports, "isTypeNode", { enumerable: true, get: function () { return predicates_ts_1.isTypeNode; } }); +Object.defineProperty(exports, "isTypeSystemDefinitionNode", { enumerable: true, get: function () { return predicates_ts_1.isTypeSystemDefinitionNode; } }); +Object.defineProperty(exports, "isTypeDefinitionNode", { enumerable: true, get: function () { return predicates_ts_1.isTypeDefinitionNode; } }); +Object.defineProperty(exports, "isTypeSystemExtensionNode", { enumerable: true, get: function () { return predicates_ts_1.isTypeSystemExtensionNode; } }); +Object.defineProperty(exports, "isTypeExtensionNode", { enumerable: true, get: function () { return predicates_ts_1.isTypeExtensionNode; } }); +Object.defineProperty(exports, "isSchemaCoordinateNode", { enumerable: true, get: function () { return predicates_ts_1.isSchemaCoordinateNode; } }); +Object.defineProperty(exports, "isSubscriptionOperationDefinitionNode", { enumerable: true, get: function () { return predicates_ts_1.isSubscriptionOperationDefinitionNode; } }); +var directiveLocation_ts_1 = require("./directiveLocation.js"); +Object.defineProperty(exports, "DirectiveLocation", { enumerable: true, get: function () { return directiveLocation_ts_1.DirectiveLocation; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js.map new file mode 100644 index 00000000..956f76c4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/language/index.ts"],"names":[],"mappings":";;;AAOA,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AAEf,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AAGpB,uDAAwE;AAA/D,iHAAA,aAAa,OAAA;AAAE,uHAAA,mBAAmB,OAAA;AAO3C,uCAAkC;AAAzB,gGAAA,IAAI,OAAA;AAEb,+CAA2C;AAAlC,yGAAA,SAAS,OAAA;AAElB,uCAAmC;AAA1B,iGAAA,KAAK,OAAA;AAEd,yCAMqB;AALnB,kGAAA,KAAK,OAAA;AACL,uGAAA,UAAU,OAAA;AACV,4GAAA,eAAe,OAAA;AACf,sGAAA,SAAS,OAAA;AACT,kHAAA,qBAAqB,OAAA;AAIvB,2CAAqC;AAA5B,mGAAA,KAAK,OAAA;AAEd,2CAKsB;AAJpB,mGAAA,KAAK,OAAA;AACL,6GAAA,eAAe,OAAA;AACf,kHAAA,oBAAoB,OAAA;AACpB,mGAAA,KAAK,OAAA;AAIP,mCAA8D;AAArD,kGAAA,QAAQ,OAAA;AAAE,+FAAA,KAAK,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AA0E3C,iDAayB;AAZvB,iHAAA,gBAAgB,OAAA;AAChB,2HAAA,0BAA0B,OAAA;AAC1B,gHAAA,eAAe,OAAA;AACf,4GAAA,WAAW,OAAA;AACX,iHAAA,gBAAgB,OAAA;AAChB,2GAAA,UAAU,OAAA;AACV,2HAAA,0BAA0B,OAAA;AAC1B,qHAAA,oBAAoB,OAAA;AACpB,0HAAA,yBAAyB,OAAA;AACzB,oHAAA,mBAAmB,OAAA;AACnB,uHAAA,sBAAsB,OAAA;AACtB,sIAAA,qCAAqC,OAAA;AAGvC,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA","sourcesContent":["/**\n * Parse, print, and visit GraphQL language source files and AST nodes.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { Source } from './source.ts';\n\nexport { getLocation } from './location.ts';\nexport type { SourceLocation } from './location.ts';\n\nexport { printLocation, printSourceLocation } from './printLocation.ts';\n\n// @see https://github.com/typescript-eslint/typescript-eslint/issues/10313\n// Deno misclassifies this merged value+type re-export and requires `export type`.\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore TS1205\n\nexport { Kind } from './kinds.ts';\n\nexport { TokenKind } from './tokenKind.ts';\n\nexport { Lexer } from './lexer.ts';\n\nexport {\n parse,\n parseValue,\n parseConstValue,\n parseType,\n parseSchemaCoordinate,\n} from './parser.ts';\nexport type { ParseOptions } from './parser.ts';\n\nexport { print } from './printer.ts';\n\nexport {\n visit,\n visitInParallel,\n getEnterLeaveForKind,\n BREAK,\n} from './visitor.ts';\nexport type { ASTVisitor, ASTVisitFn, ASTVisitorKeyMap } from './visitor.ts';\n\nexport { Location, Token, OperationTypeNode } from './ast.ts';\nexport type {\n ASTNode,\n ASTKindToNode,\n // Each kind of AST node\n NameNode,\n DocumentNode,\n DefinitionNode,\n ExecutableDefinitionNode,\n OperationDefinitionNode,\n SubscriptionOperationDefinitionNode,\n VariableDefinitionNode,\n VariableNode,\n SelectionSetNode,\n SelectionNode,\n FieldNode,\n ArgumentNode,\n FragmentArgumentNode /* for experimental fragment arguments */,\n ConstArgumentNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n ValueNode,\n ConstValueNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n NullValueNode,\n EnumValueNode,\n ListValueNode,\n ConstListValueNode,\n ObjectValueNode,\n ConstObjectValueNode,\n ObjectFieldNode,\n ConstObjectFieldNode,\n DirectiveNode,\n ConstDirectiveNode,\n TypeNode,\n NamedTypeNode,\n ListTypeNode,\n NonNullTypeNode,\n TypeSystemDefinitionNode,\n SchemaDefinitionNode,\n OperationTypeDefinitionNode,\n TypeDefinitionNode,\n ScalarTypeDefinitionNode,\n ObjectTypeDefinitionNode,\n FieldDefinitionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n UnionTypeDefinitionNode,\n EnumTypeDefinitionNode,\n EnumValueDefinitionNode,\n InputObjectTypeDefinitionNode,\n DirectiveDefinitionNode,\n TypeSystemExtensionNode,\n SchemaExtensionNode,\n TypeExtensionNode,\n ScalarTypeExtensionNode,\n ObjectTypeExtensionNode,\n InterfaceTypeExtensionNode,\n UnionTypeExtensionNode,\n EnumTypeExtensionNode,\n InputObjectTypeExtensionNode,\n DirectiveExtensionNode,\n SchemaCoordinateNode,\n TypeCoordinateNode,\n MemberCoordinateNode,\n ArgumentCoordinateNode,\n DirectiveCoordinateNode,\n DirectiveArgumentCoordinateNode,\n} from './ast.ts';\n\nexport {\n isDefinitionNode,\n isExecutableDefinitionNode,\n isSelectionNode,\n isValueNode,\n isConstValueNode,\n isTypeNode,\n isTypeSystemDefinitionNode,\n isTypeDefinitionNode,\n isTypeSystemExtensionNode,\n isTypeExtensionNode,\n isSchemaCoordinateNode,\n isSubscriptionOperationDefinitionNode,\n} from './predicates.ts';\n\nexport { DirectiveLocation } from './directiveLocation.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs new file mode 100644 index 00000000..64d02393 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs @@ -0,0 +1,13 @@ +export { Source } from "./source.mjs"; +export { getLocation } from "./location.mjs"; +export { printLocation, printSourceLocation } from "./printLocation.mjs"; +export { Kind } from "./kinds.mjs"; +export { TokenKind } from "./tokenKind.mjs"; +export { Lexer } from "./lexer.mjs"; +export { parse, parseValue, parseConstValue, parseType, parseSchemaCoordinate, } from "./parser.mjs"; +export { print } from "./printer.mjs"; +export { visit, visitInParallel, getEnterLeaveForKind, BREAK, } from "./visitor.mjs"; +export { Location, Token, OperationTypeNode } from "./ast.mjs"; +export { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isConstValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode, isSchemaCoordinateNode, isSubscriptionOperationDefinitionNode, } from "./predicates.mjs"; +export { DirectiveLocation } from "./directiveLocation.mjs"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs.map new file mode 100644 index 00000000..584c8ebd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/language/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,qBAAoB;AAErC,OAAO,EAAE,WAAW,EAAE,uBAAsB;AAG5C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,4BAA2B;AAOxE,OAAO,EAAE,IAAI,EAAE,oBAAmB;AAElC,OAAO,EAAE,SAAS,EAAE,wBAAuB;AAE3C,OAAO,EAAE,KAAK,EAAE,oBAAmB;AAEnC,OAAO,EACL,KAAK,EACL,UAAU,EACV,eAAe,EACf,SAAS,EACT,qBAAqB,GACtB,qBAAoB;AAGrB,OAAO,EAAE,KAAK,EAAE,sBAAqB;AAErC,OAAO,EACL,KAAK,EACL,eAAe,EACf,oBAAoB,EACpB,KAAK,GACN,sBAAqB;AAGtB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAiB;AA0E9D,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,qCAAqC,GACtC,yBAAwB;AAEzB,OAAO,EAAE,iBAAiB,EAAE,gCAA+B","sourcesContent":["/**\n * Parse, print, and visit GraphQL language source files and AST nodes.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { Source } from './source.ts';\n\nexport { getLocation } from './location.ts';\nexport type { SourceLocation } from './location.ts';\n\nexport { printLocation, printSourceLocation } from './printLocation.ts';\n\n// @see https://github.com/typescript-eslint/typescript-eslint/issues/10313\n// Deno misclassifies this merged value+type re-export and requires `export type`.\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore TS1205\n\nexport { Kind } from './kinds.ts';\n\nexport { TokenKind } from './tokenKind.ts';\n\nexport { Lexer } from './lexer.ts';\n\nexport {\n parse,\n parseValue,\n parseConstValue,\n parseType,\n parseSchemaCoordinate,\n} from './parser.ts';\nexport type { ParseOptions } from './parser.ts';\n\nexport { print } from './printer.ts';\n\nexport {\n visit,\n visitInParallel,\n getEnterLeaveForKind,\n BREAK,\n} from './visitor.ts';\nexport type { ASTVisitor, ASTVisitFn, ASTVisitorKeyMap } from './visitor.ts';\n\nexport { Location, Token, OperationTypeNode } from './ast.ts';\nexport type {\n ASTNode,\n ASTKindToNode,\n // Each kind of AST node\n NameNode,\n DocumentNode,\n DefinitionNode,\n ExecutableDefinitionNode,\n OperationDefinitionNode,\n SubscriptionOperationDefinitionNode,\n VariableDefinitionNode,\n VariableNode,\n SelectionSetNode,\n SelectionNode,\n FieldNode,\n ArgumentNode,\n FragmentArgumentNode /* for experimental fragment arguments */,\n ConstArgumentNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n ValueNode,\n ConstValueNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n NullValueNode,\n EnumValueNode,\n ListValueNode,\n ConstListValueNode,\n ObjectValueNode,\n ConstObjectValueNode,\n ObjectFieldNode,\n ConstObjectFieldNode,\n DirectiveNode,\n ConstDirectiveNode,\n TypeNode,\n NamedTypeNode,\n ListTypeNode,\n NonNullTypeNode,\n TypeSystemDefinitionNode,\n SchemaDefinitionNode,\n OperationTypeDefinitionNode,\n TypeDefinitionNode,\n ScalarTypeDefinitionNode,\n ObjectTypeDefinitionNode,\n FieldDefinitionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n UnionTypeDefinitionNode,\n EnumTypeDefinitionNode,\n EnumValueDefinitionNode,\n InputObjectTypeDefinitionNode,\n DirectiveDefinitionNode,\n TypeSystemExtensionNode,\n SchemaExtensionNode,\n TypeExtensionNode,\n ScalarTypeExtensionNode,\n ObjectTypeExtensionNode,\n InterfaceTypeExtensionNode,\n UnionTypeExtensionNode,\n EnumTypeExtensionNode,\n InputObjectTypeExtensionNode,\n DirectiveExtensionNode,\n SchemaCoordinateNode,\n TypeCoordinateNode,\n MemberCoordinateNode,\n ArgumentCoordinateNode,\n DirectiveCoordinateNode,\n DirectiveArgumentCoordinateNode,\n} from './ast.ts';\n\nexport {\n isDefinitionNode,\n isExecutableDefinitionNode,\n isSelectionNode,\n isValueNode,\n isConstValueNode,\n isTypeNode,\n isTypeSystemDefinitionNode,\n isTypeDefinitionNode,\n isTypeSystemExtensionNode,\n isTypeExtensionNode,\n isSchemaCoordinateNode,\n isSubscriptionOperationDefinitionNode,\n} from './predicates.ts';\n\nexport { DirectiveLocation } from './directiveLocation.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.mts new file mode 100644 index 00000000..8bbbd268 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.mts @@ -0,0 +1,6 @@ +/** @category Kinds */ +import type * as Kind_ from "./kinds_.mjs"; +/** The namespace containing all AST node kind constants. */ +export * as Kind from "./kinds_.mjs"; +/** The set of allowed kind values for AST nodes. */ +export type Kind = (typeof Kind_)[keyof typeof Kind_]; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.ts new file mode 100644 index 00000000..4341d78f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.d.ts @@ -0,0 +1,6 @@ +/** @category Kinds */ +import type * as Kind_ from "./kinds_.js"; +/** The namespace containing all AST node kind constants. */ +export * as Kind from "./kinds_.js"; +/** The set of allowed kind values for AST nodes. */ +export type Kind = (typeof Kind_)[keyof typeof Kind_]; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js new file mode 100644 index 00000000..3516e669 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js @@ -0,0 +1,38 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Kind = void 0; +exports.Kind = __importStar(require("./kinds_.js")); +//# sourceMappingURL=kinds.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js.map new file mode 100644 index 00000000..bc940bb8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../src/language/kinds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,oDAAoC","sourcesContent":["/** @category Kinds */\n\n/* eslint-disable import/no-namespace */\nimport type * as Kind_ from './kinds_.ts';\n\n/** The namespace containing all AST node kind constants. */\nexport * as Kind from './kinds_.ts';\n\n/** The set of allowed kind values for AST nodes. */\nexport type Kind = (typeof Kind_)[keyof typeof Kind_];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs new file mode 100644 index 00000000..a62b2c54 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs @@ -0,0 +1,2 @@ +export * as Kind from "./kinds_.mjs"; +//# sourceMappingURL=kinds.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs.map new file mode 100644 index 00000000..8bac5821 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../src/language/kinds.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,IAAI,qBAAoB","sourcesContent":["/** @category Kinds */\n\n/* eslint-disable import/no-namespace */\nimport type * as Kind_ from './kinds_.ts';\n\n/** The namespace containing all AST node kind constants. */\nexport * as Kind from './kinds_.ts';\n\n/** The set of allowed kind values for AST nodes. */\nexport type Kind = (typeof Kind_)[keyof typeof Kind_];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.mts new file mode 100644 index 00000000..fdc0becd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.mts @@ -0,0 +1,199 @@ +/** @category Kinds */ +/** AST kind for name nodes. */ +export declare const NAME = "Name"; +/** Type of the `Kind.NAME` AST kind value. */ +export type NAME = typeof NAME; +/** AST kind for document nodes. */ +export declare const DOCUMENT = "Document"; +/** Type of the `Kind.DOCUMENT` AST kind value. */ +export type DOCUMENT = typeof DOCUMENT; +/** AST kind for operation definition nodes. */ +export declare const OPERATION_DEFINITION = "OperationDefinition"; +/** Type of the `Kind.OPERATION_DEFINITION` AST kind value. */ +export type OPERATION_DEFINITION = typeof OPERATION_DEFINITION; +/** AST kind for variable definition nodes. */ +export declare const VARIABLE_DEFINITION = "VariableDefinition"; +/** Type of the `Kind.VARIABLE_DEFINITION` AST kind value. */ +export type VARIABLE_DEFINITION = typeof VARIABLE_DEFINITION; +/** AST kind for selection set nodes. */ +export declare const SELECTION_SET = "SelectionSet"; +/** Type of the `Kind.SELECTION_SET` AST kind value. */ +export type SELECTION_SET = typeof SELECTION_SET; +/** AST kind for field selection nodes. */ +export declare const FIELD = "Field"; +/** Type of the `Kind.FIELD` AST kind value. */ +export type FIELD = typeof FIELD; +/** AST kind for argument nodes. */ +export declare const ARGUMENT = "Argument"; +/** Type of the `Kind.ARGUMENT` AST kind value. */ +export type ARGUMENT = typeof ARGUMENT; +/** AST kind for fragment argument nodes. */ +export declare const FRAGMENT_ARGUMENT = "FragmentArgument"; +/** Type of the `Kind.FRAGMENT_ARGUMENT` AST kind value. */ +export type FRAGMENT_ARGUMENT = typeof FRAGMENT_ARGUMENT; +/** AST kind for fragment spread nodes. */ +export declare const FRAGMENT_SPREAD = "FragmentSpread"; +/** Type of the `Kind.FRAGMENT_SPREAD` AST kind value. */ +export type FRAGMENT_SPREAD = typeof FRAGMENT_SPREAD; +/** AST kind for inline fragment nodes. */ +export declare const INLINE_FRAGMENT = "InlineFragment"; +/** Type of the `Kind.INLINE_FRAGMENT` AST kind value. */ +export type INLINE_FRAGMENT = typeof INLINE_FRAGMENT; +/** AST kind for fragment definition nodes. */ +export declare const FRAGMENT_DEFINITION = "FragmentDefinition"; +/** Type of the `Kind.FRAGMENT_DEFINITION` AST kind value. */ +export type FRAGMENT_DEFINITION = typeof FRAGMENT_DEFINITION; +/** AST kind for variable reference nodes. */ +export declare const VARIABLE = "Variable"; +/** Type of the `Kind.VARIABLE` AST kind value. */ +export type VARIABLE = typeof VARIABLE; +/** AST kind for integer value nodes. */ +export declare const INT = "IntValue"; +/** Type of the `Kind.INT` AST kind value. */ +export type INT = typeof INT; +/** AST kind for floating-point value nodes. */ +export declare const FLOAT = "FloatValue"; +/** Type of the `Kind.FLOAT` AST kind value. */ +export type FLOAT = typeof FLOAT; +/** AST kind for string value nodes. */ +export declare const STRING = "StringValue"; +/** Type of the `Kind.STRING` AST kind value. */ +export type STRING = typeof STRING; +/** AST kind for boolean value nodes. */ +export declare const BOOLEAN = "BooleanValue"; +/** Type of the `Kind.BOOLEAN` AST kind value. */ +export type BOOLEAN = typeof BOOLEAN; +/** AST kind for null value nodes. */ +export declare const NULL = "NullValue"; +/** Type of the `Kind.NULL` AST kind value. */ +export type NULL = typeof NULL; +/** AST kind for enum value nodes. */ +export declare const ENUM = "EnumValue"; +/** Type of the `Kind.ENUM` AST kind value. */ +export type ENUM = typeof ENUM; +/** AST kind for list value nodes. */ +export declare const LIST = "ListValue"; +/** Type of the `Kind.LIST` AST kind value. */ +export type LIST = typeof LIST; +/** AST kind for object value nodes. */ +export declare const OBJECT = "ObjectValue"; +/** Type of the `Kind.OBJECT` AST kind value. */ +export type OBJECT = typeof OBJECT; +/** AST kind for object field nodes. */ +export declare const OBJECT_FIELD = "ObjectField"; +/** Type of the `Kind.OBJECT_FIELD` AST kind value. */ +export type OBJECT_FIELD = typeof OBJECT_FIELD; +/** AST kind for directive nodes. */ +export declare const DIRECTIVE = "Directive"; +/** Type of the `Kind.DIRECTIVE` AST kind value. */ +export type DIRECTIVE = typeof DIRECTIVE; +/** AST kind for named type reference nodes. */ +export declare const NAMED_TYPE = "NamedType"; +/** Type of the `Kind.NAMED_TYPE` AST kind value. */ +export type NAMED_TYPE = typeof NAMED_TYPE; +/** AST kind for list type reference nodes. */ +export declare const LIST_TYPE = "ListType"; +/** Type of the `Kind.LIST_TYPE` AST kind value. */ +export type LIST_TYPE = typeof LIST_TYPE; +/** AST kind for non-null type reference nodes. */ +export declare const NON_NULL_TYPE = "NonNullType"; +/** Type of the `Kind.NON_NULL_TYPE` AST kind value. */ +export type NON_NULL_TYPE = typeof NON_NULL_TYPE; +/** AST kind for schema definition nodes. */ +export declare const SCHEMA_DEFINITION = "SchemaDefinition"; +/** Type of the `Kind.SCHEMA_DEFINITION` AST kind value. */ +export type SCHEMA_DEFINITION = typeof SCHEMA_DEFINITION; +/** AST kind for operation type definition nodes. */ +export declare const OPERATION_TYPE_DEFINITION = "OperationTypeDefinition"; +/** Type of the `Kind.OPERATION_TYPE_DEFINITION` AST kind value. */ +export type OPERATION_TYPE_DEFINITION = typeof OPERATION_TYPE_DEFINITION; +/** AST kind for scalar type definition nodes. */ +export declare const SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition"; +/** Type of the `Kind.SCALAR_TYPE_DEFINITION` AST kind value. */ +export type SCALAR_TYPE_DEFINITION = typeof SCALAR_TYPE_DEFINITION; +/** AST kind for object type definition nodes. */ +export declare const OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition"; +/** Type of the `Kind.OBJECT_TYPE_DEFINITION` AST kind value. */ +export type OBJECT_TYPE_DEFINITION = typeof OBJECT_TYPE_DEFINITION; +/** AST kind for field definition nodes. */ +export declare const FIELD_DEFINITION = "FieldDefinition"; +/** Type of the `Kind.FIELD_DEFINITION` AST kind value. */ +export type FIELD_DEFINITION = typeof FIELD_DEFINITION; +/** AST kind for input value definition nodes. */ +export declare const INPUT_VALUE_DEFINITION = "InputValueDefinition"; +/** Type of the `Kind.INPUT_VALUE_DEFINITION` AST kind value. */ +export type INPUT_VALUE_DEFINITION = typeof INPUT_VALUE_DEFINITION; +/** AST kind for interface type definition nodes. */ +export declare const INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition"; +/** Type of the `Kind.INTERFACE_TYPE_DEFINITION` AST kind value. */ +export type INTERFACE_TYPE_DEFINITION = typeof INTERFACE_TYPE_DEFINITION; +/** AST kind for union type definition nodes. */ +export declare const UNION_TYPE_DEFINITION = "UnionTypeDefinition"; +/** Type of the `Kind.UNION_TYPE_DEFINITION` AST kind value. */ +export type UNION_TYPE_DEFINITION = typeof UNION_TYPE_DEFINITION; +/** AST kind for enum type definition nodes. */ +export declare const ENUM_TYPE_DEFINITION = "EnumTypeDefinition"; +/** AST kind for enum value definition nodes. */ +export declare const ENUM_VALUE_DEFINITION = "EnumValueDefinition"; +/** Type of the `Kind.ENUM_VALUE_DEFINITION` AST kind value. */ +export type ENUM_VALUE_DEFINITION = typeof ENUM_VALUE_DEFINITION; +/** AST kind for input object type definition nodes. */ +export declare const INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition"; +/** Type of the `Kind.INPUT_OBJECT_TYPE_DEFINITION` AST kind value. */ +export type INPUT_OBJECT_TYPE_DEFINITION = typeof INPUT_OBJECT_TYPE_DEFINITION; +/** AST kind for directive definition nodes. */ +export declare const DIRECTIVE_DEFINITION = "DirectiveDefinition"; +/** Type of the `Kind.DIRECTIVE_DEFINITION` AST kind value. */ +export type DIRECTIVE_DEFINITION = typeof DIRECTIVE_DEFINITION; +/** AST kind for schema extension nodes. */ +export declare const SCHEMA_EXTENSION = "SchemaExtension"; +/** Type of the `Kind.SCHEMA_EXTENSION` AST kind value. */ +export type SCHEMA_EXTENSION = typeof SCHEMA_EXTENSION; +/** AST kind for directive extension nodes. */ +export declare const DIRECTIVE_EXTENSION = "DirectiveExtension"; +/** Type of the `Kind.DIRECTIVE_EXTENSION` AST kind value. */ +export type DIRECTIVE_EXTENSION = typeof DIRECTIVE_EXTENSION; +/** AST kind for scalar type extension nodes. */ +export declare const SCALAR_TYPE_EXTENSION = "ScalarTypeExtension"; +/** Type of the `Kind.SCALAR_TYPE_EXTENSION` AST kind value. */ +export type SCALAR_TYPE_EXTENSION = typeof SCALAR_TYPE_EXTENSION; +/** AST kind for object type extension nodes. */ +export declare const OBJECT_TYPE_EXTENSION = "ObjectTypeExtension"; +/** Type of the `Kind.OBJECT_TYPE_EXTENSION` AST kind value. */ +export type OBJECT_TYPE_EXTENSION = typeof OBJECT_TYPE_EXTENSION; +/** AST kind for interface type extension nodes. */ +export declare const INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension"; +/** Type of the `Kind.INTERFACE_TYPE_EXTENSION` AST kind value. */ +export type INTERFACE_TYPE_EXTENSION = typeof INTERFACE_TYPE_EXTENSION; +/** AST kind for union type extension nodes. */ +export declare const UNION_TYPE_EXTENSION = "UnionTypeExtension"; +/** Type of the `Kind.UNION_TYPE_EXTENSION` AST kind value. */ +export type UNION_TYPE_EXTENSION = typeof UNION_TYPE_EXTENSION; +/** AST kind for enum type extension nodes. */ +export declare const ENUM_TYPE_EXTENSION = "EnumTypeExtension"; +/** Type of the `Kind.ENUM_TYPE_EXTENSION` AST kind value. */ +export type ENUM_TYPE_EXTENSION = typeof ENUM_TYPE_EXTENSION; +/** AST kind for input object type extension nodes. */ +export declare const INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension"; +/** Type of the `Kind.INPUT_OBJECT_TYPE_EXTENSION` AST kind value. */ +export type INPUT_OBJECT_TYPE_EXTENSION = typeof INPUT_OBJECT_TYPE_EXTENSION; +/** AST kind for type coordinate nodes. */ +export declare const TYPE_COORDINATE = "TypeCoordinate"; +/** Type of the `Kind.TYPE_COORDINATE` AST kind value. */ +export type TYPE_COORDINATE = typeof TYPE_COORDINATE; +/** AST kind for member coordinate nodes. */ +export declare const MEMBER_COORDINATE = "MemberCoordinate"; +/** Type of the `Kind.MEMBER_COORDINATE` AST kind value. */ +export type MEMBER_COORDINATE = typeof MEMBER_COORDINATE; +/** AST kind for argument coordinate nodes. */ +export declare const ARGUMENT_COORDINATE = "ArgumentCoordinate"; +/** Type of the `Kind.ARGUMENT_COORDINATE` AST kind value. */ +export type ARGUMENT_COORDINATE = typeof ARGUMENT_COORDINATE; +/** AST kind for directive coordinate nodes. */ +export declare const DIRECTIVE_COORDINATE = "DirectiveCoordinate"; +/** Type of the `Kind.DIRECTIVE_COORDINATE` AST kind value. */ +export type DIRECTIVE_COORDINATE = typeof DIRECTIVE_COORDINATE; +/** AST kind for directive argument coordinate nodes. */ +export declare const DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate"; +/** Type of the `Kind.DIRECTIVE_ARGUMENT_COORDINATE` AST kind value. */ +export type DIRECTIVE_ARGUMENT_COORDINATE = typeof DIRECTIVE_ARGUMENT_COORDINATE; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.ts new file mode 100644 index 00000000..fdc0becd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.d.ts @@ -0,0 +1,199 @@ +/** @category Kinds */ +/** AST kind for name nodes. */ +export declare const NAME = "Name"; +/** Type of the `Kind.NAME` AST kind value. */ +export type NAME = typeof NAME; +/** AST kind for document nodes. */ +export declare const DOCUMENT = "Document"; +/** Type of the `Kind.DOCUMENT` AST kind value. */ +export type DOCUMENT = typeof DOCUMENT; +/** AST kind for operation definition nodes. */ +export declare const OPERATION_DEFINITION = "OperationDefinition"; +/** Type of the `Kind.OPERATION_DEFINITION` AST kind value. */ +export type OPERATION_DEFINITION = typeof OPERATION_DEFINITION; +/** AST kind for variable definition nodes. */ +export declare const VARIABLE_DEFINITION = "VariableDefinition"; +/** Type of the `Kind.VARIABLE_DEFINITION` AST kind value. */ +export type VARIABLE_DEFINITION = typeof VARIABLE_DEFINITION; +/** AST kind for selection set nodes. */ +export declare const SELECTION_SET = "SelectionSet"; +/** Type of the `Kind.SELECTION_SET` AST kind value. */ +export type SELECTION_SET = typeof SELECTION_SET; +/** AST kind for field selection nodes. */ +export declare const FIELD = "Field"; +/** Type of the `Kind.FIELD` AST kind value. */ +export type FIELD = typeof FIELD; +/** AST kind for argument nodes. */ +export declare const ARGUMENT = "Argument"; +/** Type of the `Kind.ARGUMENT` AST kind value. */ +export type ARGUMENT = typeof ARGUMENT; +/** AST kind for fragment argument nodes. */ +export declare const FRAGMENT_ARGUMENT = "FragmentArgument"; +/** Type of the `Kind.FRAGMENT_ARGUMENT` AST kind value. */ +export type FRAGMENT_ARGUMENT = typeof FRAGMENT_ARGUMENT; +/** AST kind for fragment spread nodes. */ +export declare const FRAGMENT_SPREAD = "FragmentSpread"; +/** Type of the `Kind.FRAGMENT_SPREAD` AST kind value. */ +export type FRAGMENT_SPREAD = typeof FRAGMENT_SPREAD; +/** AST kind for inline fragment nodes. */ +export declare const INLINE_FRAGMENT = "InlineFragment"; +/** Type of the `Kind.INLINE_FRAGMENT` AST kind value. */ +export type INLINE_FRAGMENT = typeof INLINE_FRAGMENT; +/** AST kind for fragment definition nodes. */ +export declare const FRAGMENT_DEFINITION = "FragmentDefinition"; +/** Type of the `Kind.FRAGMENT_DEFINITION` AST kind value. */ +export type FRAGMENT_DEFINITION = typeof FRAGMENT_DEFINITION; +/** AST kind for variable reference nodes. */ +export declare const VARIABLE = "Variable"; +/** Type of the `Kind.VARIABLE` AST kind value. */ +export type VARIABLE = typeof VARIABLE; +/** AST kind for integer value nodes. */ +export declare const INT = "IntValue"; +/** Type of the `Kind.INT` AST kind value. */ +export type INT = typeof INT; +/** AST kind for floating-point value nodes. */ +export declare const FLOAT = "FloatValue"; +/** Type of the `Kind.FLOAT` AST kind value. */ +export type FLOAT = typeof FLOAT; +/** AST kind for string value nodes. */ +export declare const STRING = "StringValue"; +/** Type of the `Kind.STRING` AST kind value. */ +export type STRING = typeof STRING; +/** AST kind for boolean value nodes. */ +export declare const BOOLEAN = "BooleanValue"; +/** Type of the `Kind.BOOLEAN` AST kind value. */ +export type BOOLEAN = typeof BOOLEAN; +/** AST kind for null value nodes. */ +export declare const NULL = "NullValue"; +/** Type of the `Kind.NULL` AST kind value. */ +export type NULL = typeof NULL; +/** AST kind for enum value nodes. */ +export declare const ENUM = "EnumValue"; +/** Type of the `Kind.ENUM` AST kind value. */ +export type ENUM = typeof ENUM; +/** AST kind for list value nodes. */ +export declare const LIST = "ListValue"; +/** Type of the `Kind.LIST` AST kind value. */ +export type LIST = typeof LIST; +/** AST kind for object value nodes. */ +export declare const OBJECT = "ObjectValue"; +/** Type of the `Kind.OBJECT` AST kind value. */ +export type OBJECT = typeof OBJECT; +/** AST kind for object field nodes. */ +export declare const OBJECT_FIELD = "ObjectField"; +/** Type of the `Kind.OBJECT_FIELD` AST kind value. */ +export type OBJECT_FIELD = typeof OBJECT_FIELD; +/** AST kind for directive nodes. */ +export declare const DIRECTIVE = "Directive"; +/** Type of the `Kind.DIRECTIVE` AST kind value. */ +export type DIRECTIVE = typeof DIRECTIVE; +/** AST kind for named type reference nodes. */ +export declare const NAMED_TYPE = "NamedType"; +/** Type of the `Kind.NAMED_TYPE` AST kind value. */ +export type NAMED_TYPE = typeof NAMED_TYPE; +/** AST kind for list type reference nodes. */ +export declare const LIST_TYPE = "ListType"; +/** Type of the `Kind.LIST_TYPE` AST kind value. */ +export type LIST_TYPE = typeof LIST_TYPE; +/** AST kind for non-null type reference nodes. */ +export declare const NON_NULL_TYPE = "NonNullType"; +/** Type of the `Kind.NON_NULL_TYPE` AST kind value. */ +export type NON_NULL_TYPE = typeof NON_NULL_TYPE; +/** AST kind for schema definition nodes. */ +export declare const SCHEMA_DEFINITION = "SchemaDefinition"; +/** Type of the `Kind.SCHEMA_DEFINITION` AST kind value. */ +export type SCHEMA_DEFINITION = typeof SCHEMA_DEFINITION; +/** AST kind for operation type definition nodes. */ +export declare const OPERATION_TYPE_DEFINITION = "OperationTypeDefinition"; +/** Type of the `Kind.OPERATION_TYPE_DEFINITION` AST kind value. */ +export type OPERATION_TYPE_DEFINITION = typeof OPERATION_TYPE_DEFINITION; +/** AST kind for scalar type definition nodes. */ +export declare const SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition"; +/** Type of the `Kind.SCALAR_TYPE_DEFINITION` AST kind value. */ +export type SCALAR_TYPE_DEFINITION = typeof SCALAR_TYPE_DEFINITION; +/** AST kind for object type definition nodes. */ +export declare const OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition"; +/** Type of the `Kind.OBJECT_TYPE_DEFINITION` AST kind value. */ +export type OBJECT_TYPE_DEFINITION = typeof OBJECT_TYPE_DEFINITION; +/** AST kind for field definition nodes. */ +export declare const FIELD_DEFINITION = "FieldDefinition"; +/** Type of the `Kind.FIELD_DEFINITION` AST kind value. */ +export type FIELD_DEFINITION = typeof FIELD_DEFINITION; +/** AST kind for input value definition nodes. */ +export declare const INPUT_VALUE_DEFINITION = "InputValueDefinition"; +/** Type of the `Kind.INPUT_VALUE_DEFINITION` AST kind value. */ +export type INPUT_VALUE_DEFINITION = typeof INPUT_VALUE_DEFINITION; +/** AST kind for interface type definition nodes. */ +export declare const INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition"; +/** Type of the `Kind.INTERFACE_TYPE_DEFINITION` AST kind value. */ +export type INTERFACE_TYPE_DEFINITION = typeof INTERFACE_TYPE_DEFINITION; +/** AST kind for union type definition nodes. */ +export declare const UNION_TYPE_DEFINITION = "UnionTypeDefinition"; +/** Type of the `Kind.UNION_TYPE_DEFINITION` AST kind value. */ +export type UNION_TYPE_DEFINITION = typeof UNION_TYPE_DEFINITION; +/** AST kind for enum type definition nodes. */ +export declare const ENUM_TYPE_DEFINITION = "EnumTypeDefinition"; +/** AST kind for enum value definition nodes. */ +export declare const ENUM_VALUE_DEFINITION = "EnumValueDefinition"; +/** Type of the `Kind.ENUM_VALUE_DEFINITION` AST kind value. */ +export type ENUM_VALUE_DEFINITION = typeof ENUM_VALUE_DEFINITION; +/** AST kind for input object type definition nodes. */ +export declare const INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition"; +/** Type of the `Kind.INPUT_OBJECT_TYPE_DEFINITION` AST kind value. */ +export type INPUT_OBJECT_TYPE_DEFINITION = typeof INPUT_OBJECT_TYPE_DEFINITION; +/** AST kind for directive definition nodes. */ +export declare const DIRECTIVE_DEFINITION = "DirectiveDefinition"; +/** Type of the `Kind.DIRECTIVE_DEFINITION` AST kind value. */ +export type DIRECTIVE_DEFINITION = typeof DIRECTIVE_DEFINITION; +/** AST kind for schema extension nodes. */ +export declare const SCHEMA_EXTENSION = "SchemaExtension"; +/** Type of the `Kind.SCHEMA_EXTENSION` AST kind value. */ +export type SCHEMA_EXTENSION = typeof SCHEMA_EXTENSION; +/** AST kind for directive extension nodes. */ +export declare const DIRECTIVE_EXTENSION = "DirectiveExtension"; +/** Type of the `Kind.DIRECTIVE_EXTENSION` AST kind value. */ +export type DIRECTIVE_EXTENSION = typeof DIRECTIVE_EXTENSION; +/** AST kind for scalar type extension nodes. */ +export declare const SCALAR_TYPE_EXTENSION = "ScalarTypeExtension"; +/** Type of the `Kind.SCALAR_TYPE_EXTENSION` AST kind value. */ +export type SCALAR_TYPE_EXTENSION = typeof SCALAR_TYPE_EXTENSION; +/** AST kind for object type extension nodes. */ +export declare const OBJECT_TYPE_EXTENSION = "ObjectTypeExtension"; +/** Type of the `Kind.OBJECT_TYPE_EXTENSION` AST kind value. */ +export type OBJECT_TYPE_EXTENSION = typeof OBJECT_TYPE_EXTENSION; +/** AST kind for interface type extension nodes. */ +export declare const INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension"; +/** Type of the `Kind.INTERFACE_TYPE_EXTENSION` AST kind value. */ +export type INTERFACE_TYPE_EXTENSION = typeof INTERFACE_TYPE_EXTENSION; +/** AST kind for union type extension nodes. */ +export declare const UNION_TYPE_EXTENSION = "UnionTypeExtension"; +/** Type of the `Kind.UNION_TYPE_EXTENSION` AST kind value. */ +export type UNION_TYPE_EXTENSION = typeof UNION_TYPE_EXTENSION; +/** AST kind for enum type extension nodes. */ +export declare const ENUM_TYPE_EXTENSION = "EnumTypeExtension"; +/** Type of the `Kind.ENUM_TYPE_EXTENSION` AST kind value. */ +export type ENUM_TYPE_EXTENSION = typeof ENUM_TYPE_EXTENSION; +/** AST kind for input object type extension nodes. */ +export declare const INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension"; +/** Type of the `Kind.INPUT_OBJECT_TYPE_EXTENSION` AST kind value. */ +export type INPUT_OBJECT_TYPE_EXTENSION = typeof INPUT_OBJECT_TYPE_EXTENSION; +/** AST kind for type coordinate nodes. */ +export declare const TYPE_COORDINATE = "TypeCoordinate"; +/** Type of the `Kind.TYPE_COORDINATE` AST kind value. */ +export type TYPE_COORDINATE = typeof TYPE_COORDINATE; +/** AST kind for member coordinate nodes. */ +export declare const MEMBER_COORDINATE = "MemberCoordinate"; +/** Type of the `Kind.MEMBER_COORDINATE` AST kind value. */ +export type MEMBER_COORDINATE = typeof MEMBER_COORDINATE; +/** AST kind for argument coordinate nodes. */ +export declare const ARGUMENT_COORDINATE = "ArgumentCoordinate"; +/** Type of the `Kind.ARGUMENT_COORDINATE` AST kind value. */ +export type ARGUMENT_COORDINATE = typeof ARGUMENT_COORDINATE; +/** AST kind for directive coordinate nodes. */ +export declare const DIRECTIVE_COORDINATE = "DirectiveCoordinate"; +/** Type of the `Kind.DIRECTIVE_COORDINATE` AST kind value. */ +export type DIRECTIVE_COORDINATE = typeof DIRECTIVE_COORDINATE; +/** AST kind for directive argument coordinate nodes. */ +export declare const DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate"; +/** Type of the `Kind.DIRECTIVE_ARGUMENT_COORDINATE` AST kind value. */ +export type DIRECTIVE_ARGUMENT_COORDINATE = typeof DIRECTIVE_ARGUMENT_COORDINATE; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js new file mode 100644 index 00000000..e09b2771 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DIRECTIVE_ARGUMENT_COORDINATE = exports.DIRECTIVE_COORDINATE = exports.ARGUMENT_COORDINATE = exports.MEMBER_COORDINATE = exports.TYPE_COORDINATE = exports.INPUT_OBJECT_TYPE_EXTENSION = exports.ENUM_TYPE_EXTENSION = exports.UNION_TYPE_EXTENSION = exports.INTERFACE_TYPE_EXTENSION = exports.OBJECT_TYPE_EXTENSION = exports.SCALAR_TYPE_EXTENSION = exports.DIRECTIVE_EXTENSION = exports.SCHEMA_EXTENSION = exports.DIRECTIVE_DEFINITION = exports.INPUT_OBJECT_TYPE_DEFINITION = exports.ENUM_VALUE_DEFINITION = exports.ENUM_TYPE_DEFINITION = exports.UNION_TYPE_DEFINITION = exports.INTERFACE_TYPE_DEFINITION = exports.INPUT_VALUE_DEFINITION = exports.FIELD_DEFINITION = exports.OBJECT_TYPE_DEFINITION = exports.SCALAR_TYPE_DEFINITION = exports.OPERATION_TYPE_DEFINITION = exports.SCHEMA_DEFINITION = exports.NON_NULL_TYPE = exports.LIST_TYPE = exports.NAMED_TYPE = exports.DIRECTIVE = exports.OBJECT_FIELD = exports.OBJECT = exports.LIST = exports.ENUM = exports.NULL = exports.BOOLEAN = exports.STRING = exports.FLOAT = exports.INT = exports.VARIABLE = exports.FRAGMENT_DEFINITION = exports.INLINE_FRAGMENT = exports.FRAGMENT_SPREAD = exports.FRAGMENT_ARGUMENT = exports.ARGUMENT = exports.FIELD = exports.SELECTION_SET = exports.VARIABLE_DEFINITION = exports.OPERATION_DEFINITION = exports.DOCUMENT = exports.NAME = void 0; +exports.NAME = 'Name'; +exports.DOCUMENT = 'Document'; +exports.OPERATION_DEFINITION = 'OperationDefinition'; +exports.VARIABLE_DEFINITION = 'VariableDefinition'; +exports.SELECTION_SET = 'SelectionSet'; +exports.FIELD = 'Field'; +exports.ARGUMENT = 'Argument'; +exports.FRAGMENT_ARGUMENT = 'FragmentArgument'; +exports.FRAGMENT_SPREAD = 'FragmentSpread'; +exports.INLINE_FRAGMENT = 'InlineFragment'; +exports.FRAGMENT_DEFINITION = 'FragmentDefinition'; +exports.VARIABLE = 'Variable'; +exports.INT = 'IntValue'; +exports.FLOAT = 'FloatValue'; +exports.STRING = 'StringValue'; +exports.BOOLEAN = 'BooleanValue'; +exports.NULL = 'NullValue'; +exports.ENUM = 'EnumValue'; +exports.LIST = 'ListValue'; +exports.OBJECT = 'ObjectValue'; +exports.OBJECT_FIELD = 'ObjectField'; +exports.DIRECTIVE = 'Directive'; +exports.NAMED_TYPE = 'NamedType'; +exports.LIST_TYPE = 'ListType'; +exports.NON_NULL_TYPE = 'NonNullType'; +exports.SCHEMA_DEFINITION = 'SchemaDefinition'; +exports.OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition'; +exports.SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition'; +exports.OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition'; +exports.FIELD_DEFINITION = 'FieldDefinition'; +exports.INPUT_VALUE_DEFINITION = 'InputValueDefinition'; +exports.INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition'; +exports.UNION_TYPE_DEFINITION = 'UnionTypeDefinition'; +exports.ENUM_TYPE_DEFINITION = 'EnumTypeDefinition'; +exports.ENUM_VALUE_DEFINITION = 'EnumValueDefinition'; +exports.INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition'; +exports.DIRECTIVE_DEFINITION = 'DirectiveDefinition'; +exports.SCHEMA_EXTENSION = 'SchemaExtension'; +exports.DIRECTIVE_EXTENSION = 'DirectiveExtension'; +exports.SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension'; +exports.OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension'; +exports.INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension'; +exports.UNION_TYPE_EXTENSION = 'UnionTypeExtension'; +exports.ENUM_TYPE_EXTENSION = 'EnumTypeExtension'; +exports.INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension'; +exports.TYPE_COORDINATE = 'TypeCoordinate'; +exports.MEMBER_COORDINATE = 'MemberCoordinate'; +exports.ARGUMENT_COORDINATE = 'ArgumentCoordinate'; +exports.DIRECTIVE_COORDINATE = 'DirectiveCoordinate'; +exports.DIRECTIVE_ARGUMENT_COORDINATE = 'DirectiveArgumentCoordinate'; +//# sourceMappingURL=kinds_.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js.map new file mode 100644 index 00000000..3b3dfc7e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kinds_.js","sourceRoot":"","sources":["../../src/language/kinds_.ts"],"names":[],"mappings":";;;AAKa,QAAA,IAAI,GAAG,MAAM,CAAC;AAKd,QAAA,QAAQ,GAAG,UAAU,CAAC;AAKtB,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAK7C,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAK3C,QAAA,aAAa,GAAG,cAAc,CAAC;AAK/B,QAAA,KAAK,GAAG,OAAO,CAAC;AAKhB,QAAA,QAAQ,GAAG,UAAU,CAAC;AAKtB,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAKvC,QAAA,eAAe,GAAG,gBAAgB,CAAC;AAKnC,QAAA,eAAe,GA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AqB,GAAG,qBAAqB,CAAC;AAK9C,QAAA,wBAAwB,GAAG,wBAAwB,CAAC;AAKpD,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAK5C,QAAA,mBAAmB,GAAG,mBAAmB,CAAC;AAK1C,QAAA,2BAA2B,GAAG,0BAA0B,CAAC;AAKzD,QAAA,eAAe,GAAG,gBAAgB,CAAC;AAKnC,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAKvC,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAK3C,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAK7C,QAAA,6BAA6B,GAAG,6BAA6B,CAAC","sourcesContent":["/** @category Kinds */\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/** AST kind for name nodes. */\nexport const NAME = 'Name';\n/** Type of the `Kind.NAME` AST kind value. */\nexport type NAME = typeof NAME;\n\n/** AST kind for document nodes. */\nexport const DOCUMENT = 'Document';\n/** Type of the `Kind.DOCUMENT` AST kind value. */\nexport type DOCUMENT = typeof DOCUMENT;\n\n/** AST kind for operation definition nodes. */\nexport const OPERATION_DEFINITION = 'OperationDefinition';\n/** Type of the `Kind.OPERATION_DEFINITION` AST kind value. */\nexport type OPERATION_DEFINITION = typeof OPERATION_DEFINITION;\n\n/** AST kind for variable definition nodes. */\nexport const VARIABLE_DEFINITION = 'VariableDefinition';\n/** Type of the `Kind.VARIABLE_DEFINITION` AST kind value. */\nexport type VARIABLE_DEFINITION = typeof VARIABLE_DEFINITION;\n\n/** AST kind for selection set nodes. */\nexport const SELECTION_SET = 'SelectionSet';\n/** Type of the `Kind.SELECTION_SET` AST kind value. */\nexport type SELECTION_SET = typeof SELECTION_SET;\n\n/** AST kind for field selection nodes. */\nexport const FIELD = 'Field';\n/** Type of the `Kind.FIELD` AST kind value. */\nexport type FIELD = typeof FIELD;\n\n/** AST kind for argument nodes. */\nexport const ARGUMENT = 'Argument';\n/** Type of the `Kind.ARGUMENT` AST kind value. */\nexport type ARGUMENT = typeof ARGUMENT;\n\n/** AST kind for fragment argument nodes. */\nexport const FRAGMENT_ARGUMENT = 'FragmentArgument';\n/** Type of the `Kind.FRAGMENT_ARGUMENT` AST kind value. */\nexport type FRAGMENT_ARGUMENT = typeof FRAGMENT_ARGUMENT;\n\n/** AST kind for fragment spread nodes. */\nexport const FRAGMENT_SPREAD = 'FragmentSpread';\n/** Type of the `Kind.FRAGMENT_SPREAD` AST kind value. */\nexport type FRAGMENT_SPREAD = typeof FRAGMENT_SPREAD;\n\n/** AST kind for inline fragment nodes. */\nexport const INLINE_FRAGMENT = 'InlineFragment';\n/** Type of the `Kind.INLINE_FRAGMENT` AST kind value. */\nexport type INLINE_FRAGMENT = typeof INLINE_FRAGMENT;\n\n/** AST kind for fragment definition nodes. */\nexport const FRAGMENT_DEFINITION = 'FragmentDefinition';\n/** Type of the `Kind.FRAGMENT_DEFINITION` AST kind value. */\nexport type FRAGMENT_DEFINITION = typeof FRAGMENT_DEFINITION;\n\n/** AST kind for variable reference nodes. */\nexport const VARIABLE = 'Variable';\n/** Type of the `Kind.VARIABLE` AST kind value. */\nexport type VARIABLE = typeof VARIABLE;\n\n/** AST kind for integer value nodes. */\nexport const INT = 'IntValue';\n/** Type of the `Kind.INT` AST kind value. */\nexport type INT = typeof INT;\n\n/** AST kind for floating-point value nodes. */\nexport const FLOAT = 'FloatValue';\n/** Type of the `Kind.FLOAT` AST kind value. */\nexport type FLOAT = typeof FLOAT;\n\n/** AST kind for string value nodes. */\nexport const STRING = 'StringValue';\n/** Type of the `Kind.STRING` AST kind value. */\nexport type STRING = typeof STRING;\n\n/** AST kind for boolean value nodes. */\nexport const BOOLEAN = 'BooleanValue';\n/** Type of the `Kind.BOOLEAN` AST kind value. */\nexport type BOOLEAN = typeof BOOLEAN;\n\n/** AST kind for null value nodes. */\nexport const NULL = 'NullValue';\n/** Type of the `Kind.NULL` AST kind value. */\nexport type NULL = typeof NULL;\n\n/** AST kind for enum value nodes. */\nexport const ENUM = 'EnumValue';\n/** Type of the `Kind.ENUM` AST kind value. */\nexport type ENUM = typeof ENUM;\n\n/** AST kind for list value nodes. */\nexport const LIST = 'ListValue';\n/** Type of the `Kind.LIST` AST kind value. */\nexport type LIST = typeof LIST;\n\n/** AST kind for object value nodes. */\nexport const OBJECT = 'ObjectValue';\n/** Type of the `Kind.OBJECT` AST kind value. */\nexport type OBJECT = typeof OBJECT;\n\n/** AST kind for object field nodes. */\nexport const OBJECT_FIELD = 'ObjectField';\n/** Type of the `Kind.OBJECT_FIELD` AST kind value. */\nexport type OBJECT_FIELD = typeof OBJECT_FIELD;\n\n/** AST kind for directive nodes. */\nexport const DIRECTIVE = 'Directive';\n/** Type of the `Kind.DIRECTIVE` AST kind value. */\nexport type DIRECTIVE = typeof DIRECTIVE;\n\n/** AST kind for named type reference nodes. */\nexport const NAMED_TYPE = 'NamedType';\n/** Type of the `Kind.NAMED_TYPE` AST kind value. */\nexport type NAMED_TYPE = typeof NAMED_TYPE;\n\n/** AST kind for list type reference nodes. */\nexport const LIST_TYPE = 'ListType';\n/** Type of the `Kind.LIST_TYPE` AST kind value. */\nexport type LIST_TYPE = typeof LIST_TYPE;\n\n/** AST kind for non-null type reference nodes. */\nexport const NON_NULL_TYPE = 'NonNullType';\n/** Type of the `Kind.NON_NULL_TYPE` AST kind value. */\nexport type NON_NULL_TYPE = typeof NON_NULL_TYPE;\n\n/** AST kind for schema definition nodes. */\nexport const SCHEMA_DEFINITION = 'SchemaDefinition';\n/** Type of the `Kind.SCHEMA_DEFINITION` AST kind value. */\nexport type SCHEMA_DEFINITION = typeof SCHEMA_DEFINITION;\n\n/** AST kind for operation type definition nodes. */\nexport const OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';\n/** Type of the `Kind.OPERATION_TYPE_DEFINITION` AST kind value. */\nexport type OPERATION_TYPE_DEFINITION = typeof OPERATION_TYPE_DEFINITION;\n\n/** AST kind for scalar type definition nodes. */\nexport const SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';\n/** Type of the `Kind.SCALAR_TYPE_DEFINITION` AST kind value. */\nexport type SCALAR_TYPE_DEFINITION = typeof SCALAR_TYPE_DEFINITION;\n\n/** AST kind for object type definition nodes. */\nexport const OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';\n/** Type of the `Kind.OBJECT_TYPE_DEFINITION` AST kind value. */\nexport type OBJECT_TYPE_DEFINITION = typeof OBJECT_TYPE_DEFINITION;\n\n/** AST kind for field definition nodes. */\nexport const FIELD_DEFINITION = 'FieldDefinition';\n/** Type of the `Kind.FIELD_DEFINITION` AST kind value. */\nexport type FIELD_DEFINITION = typeof FIELD_DEFINITION;\n\n/** AST kind for input value definition nodes. */\nexport const INPUT_VALUE_DEFINITION = 'InputValueDefinition';\n/** Type of the `Kind.INPUT_VALUE_DEFINITION` AST kind value. */\nexport type INPUT_VALUE_DEFINITION = typeof INPUT_VALUE_DEFINITION;\n\n/** AST kind for interface type definition nodes. */\nexport const INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';\n/** Type of the `Kind.INTERFACE_TYPE_DEFINITION` AST kind value. */\nexport type INTERFACE_TYPE_DEFINITION = typeof INTERFACE_TYPE_DEFINITION;\n\n/** AST kind for union type definition nodes. */\nexport const UNION_TYPE_DEFINITION = 'UnionTypeDefinition';\n/** Type of the `Kind.UNION_TYPE_DEFINITION` AST kind value. */\nexport type UNION_TYPE_DEFINITION = typeof UNION_TYPE_DEFINITION;\n\n/** AST kind for enum type definition nodes. */\nexport const ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';\n\n/** AST kind for enum value definition nodes. */\nexport const ENUM_VALUE_DEFINITION = 'EnumValueDefinition';\n/** Type of the `Kind.ENUM_VALUE_DEFINITION` AST kind value. */\nexport type ENUM_VALUE_DEFINITION = typeof ENUM_VALUE_DEFINITION;\n\n/** AST kind for input object type definition nodes. */\nexport const INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';\n/** Type of the `Kind.INPUT_OBJECT_TYPE_DEFINITION` AST kind value. */\nexport type INPUT_OBJECT_TYPE_DEFINITION = typeof INPUT_OBJECT_TYPE_DEFINITION;\n\n/** AST kind for directive definition nodes. */\nexport const DIRECTIVE_DEFINITION = 'DirectiveDefinition';\n/** Type of the `Kind.DIRECTIVE_DEFINITION` AST kind value. */\nexport type DIRECTIVE_DEFINITION = typeof DIRECTIVE_DEFINITION;\n\n/** AST kind for schema extension nodes. */\nexport const SCHEMA_EXTENSION = 'SchemaExtension';\n/** Type of the `Kind.SCHEMA_EXTENSION` AST kind value. */\nexport type SCHEMA_EXTENSION = typeof SCHEMA_EXTENSION;\n\n/** AST kind for directive extension nodes. */\nexport const DIRECTIVE_EXTENSION = 'DirectiveExtension';\n/** Type of the `Kind.DIRECTIVE_EXTENSION` AST kind value. */\nexport type DIRECTIVE_EXTENSION = typeof DIRECTIVE_EXTENSION;\n\n/** AST kind for scalar type extension nodes. */\nexport const SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension';\n/** Type of the `Kind.SCALAR_TYPE_EXTENSION` AST kind value. */\nexport type SCALAR_TYPE_EXTENSION = typeof SCALAR_TYPE_EXTENSION;\n\n/** AST kind for object type extension nodes. */\nexport const OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension';\n/** Type of the `Kind.OBJECT_TYPE_EXTENSION` AST kind value. */\nexport type OBJECT_TYPE_EXTENSION = typeof OBJECT_TYPE_EXTENSION;\n\n/** AST kind for interface type extension nodes. */\nexport const INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension';\n/** Type of the `Kind.INTERFACE_TYPE_EXTENSION` AST kind value. */\nexport type INTERFACE_TYPE_EXTENSION = typeof INTERFACE_TYPE_EXTENSION;\n\n/** AST kind for union type extension nodes. */\nexport const UNION_TYPE_EXTENSION = 'UnionTypeExtension';\n/** Type of the `Kind.UNION_TYPE_EXTENSION` AST kind value. */\nexport type UNION_TYPE_EXTENSION = typeof UNION_TYPE_EXTENSION;\n\n/** AST kind for enum type extension nodes. */\nexport const ENUM_TYPE_EXTENSION = 'EnumTypeExtension';\n/** Type of the `Kind.ENUM_TYPE_EXTENSION` AST kind value. */\nexport type ENUM_TYPE_EXTENSION = typeof ENUM_TYPE_EXTENSION;\n\n/** AST kind for input object type extension nodes. */\nexport const INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension';\n/** Type of the `Kind.INPUT_OBJECT_TYPE_EXTENSION` AST kind value. */\nexport type INPUT_OBJECT_TYPE_EXTENSION = typeof INPUT_OBJECT_TYPE_EXTENSION;\n\n/** AST kind for type coordinate nodes. */\nexport const TYPE_COORDINATE = 'TypeCoordinate';\n/** Type of the `Kind.TYPE_COORDINATE` AST kind value. */\nexport type TYPE_COORDINATE = typeof TYPE_COORDINATE;\n\n/** AST kind for member coordinate nodes. */\nexport const MEMBER_COORDINATE = 'MemberCoordinate';\n/** Type of the `Kind.MEMBER_COORDINATE` AST kind value. */\nexport type MEMBER_COORDINATE = typeof MEMBER_COORDINATE;\n\n/** AST kind for argument coordinate nodes. */\nexport const ARGUMENT_COORDINATE = 'ArgumentCoordinate';\n/** Type of the `Kind.ARGUMENT_COORDINATE` AST kind value. */\nexport type ARGUMENT_COORDINATE = typeof ARGUMENT_COORDINATE;\n\n/** AST kind for directive coordinate nodes. */\nexport const DIRECTIVE_COORDINATE = 'DirectiveCoordinate';\n/** Type of the `Kind.DIRECTIVE_COORDINATE` AST kind value. */\nexport type DIRECTIVE_COORDINATE = typeof DIRECTIVE_COORDINATE;\n\n/** AST kind for directive argument coordinate nodes. */\nexport const DIRECTIVE_ARGUMENT_COORDINATE = 'DirectiveArgumentCoordinate';\n/** Type of the `Kind.DIRECTIVE_ARGUMENT_COORDINATE` AST kind value. */\nexport type DIRECTIVE_ARGUMENT_COORDINATE =\n typeof DIRECTIVE_ARGUMENT_COORDINATE;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs new file mode 100644 index 00000000..3380c412 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs @@ -0,0 +1,51 @@ +export const NAME = 'Name'; +export const DOCUMENT = 'Document'; +export const OPERATION_DEFINITION = 'OperationDefinition'; +export const VARIABLE_DEFINITION = 'VariableDefinition'; +export const SELECTION_SET = 'SelectionSet'; +export const FIELD = 'Field'; +export const ARGUMENT = 'Argument'; +export const FRAGMENT_ARGUMENT = 'FragmentArgument'; +export const FRAGMENT_SPREAD = 'FragmentSpread'; +export const INLINE_FRAGMENT = 'InlineFragment'; +export const FRAGMENT_DEFINITION = 'FragmentDefinition'; +export const VARIABLE = 'Variable'; +export const INT = 'IntValue'; +export const FLOAT = 'FloatValue'; +export const STRING = 'StringValue'; +export const BOOLEAN = 'BooleanValue'; +export const NULL = 'NullValue'; +export const ENUM = 'EnumValue'; +export const LIST = 'ListValue'; +export const OBJECT = 'ObjectValue'; +export const OBJECT_FIELD = 'ObjectField'; +export const DIRECTIVE = 'Directive'; +export const NAMED_TYPE = 'NamedType'; +export const LIST_TYPE = 'ListType'; +export const NON_NULL_TYPE = 'NonNullType'; +export const SCHEMA_DEFINITION = 'SchemaDefinition'; +export const OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition'; +export const SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition'; +export const OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition'; +export const FIELD_DEFINITION = 'FieldDefinition'; +export const INPUT_VALUE_DEFINITION = 'InputValueDefinition'; +export const INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition'; +export const UNION_TYPE_DEFINITION = 'UnionTypeDefinition'; +export const ENUM_TYPE_DEFINITION = 'EnumTypeDefinition'; +export const ENUM_VALUE_DEFINITION = 'EnumValueDefinition'; +export const INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition'; +export const DIRECTIVE_DEFINITION = 'DirectiveDefinition'; +export const SCHEMA_EXTENSION = 'SchemaExtension'; +export const DIRECTIVE_EXTENSION = 'DirectiveExtension'; +export const SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension'; +export const OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension'; +export const INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension'; +export const UNION_TYPE_EXTENSION = 'UnionTypeExtension'; +export const ENUM_TYPE_EXTENSION = 'EnumTypeExtension'; +export const INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension'; +export const TYPE_COORDINATE = 'TypeCoordinate'; +export const MEMBER_COORDINATE = 'MemberCoordinate'; +export const ARGUMENT_COORDINATE = 'ArgumentCoordinate'; +export const DIRECTIVE_COORDINATE = 'DirectiveCoordinate'; +export const DIRECTIVE_ARGUMENT_COORDINATE = 'DirectiveArgumentCoordinate'; +//# sourceMappingURL=kinds_.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs.map new file mode 100644 index 00000000..6534331e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/kinds_.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"kinds_.js","sourceRoot":"","sources":["../../src/language/kinds_.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAK3B,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAKnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAK1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAKxD,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;AAK5C,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAK7B,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAKnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,k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yB,CAAC;AAKnE,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAK3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAGzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAK3D,MAAM,CAAC,MAAM,4BAA4B,GAAG,2BAA2B,CAAC;AAKxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAK1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAKlD,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAKxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAK3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAK3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAKjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAKzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAKvD,MAAM,CAAC,MAAM,2BAA2B,GAAG,0BAA0B,CAAC;AAKtE,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAKhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAKpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAKxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAK1D,MAAM,CAAC,MAAM,6BAA6B,GAAG,6BAA6B,CAAC","sourcesContent":["/** @category Kinds */\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/** AST kind for name nodes. */\nexport const NAME = 'Name';\n/** Type of the `Kind.NAME` AST kind value. */\nexport type NAME = typeof NAME;\n\n/** AST kind for document nodes. */\nexport const DOCUMENT = 'Document';\n/** Type of the `Kind.DOCUMENT` AST kind value. */\nexport type DOCUMENT = typeof DOCUMENT;\n\n/** AST kind for operation definition nodes. */\nexport const OPERATION_DEFINITION = 'OperationDefinition';\n/** Type of the `Kind.OPERATION_DEFINITION` AST kind value. */\nexport type OPERATION_DEFINITION = typeof OPERATION_DEFINITION;\n\n/** AST kind for variable definition nodes. */\nexport const VARIABLE_DEFINITION = 'VariableDefinition';\n/** Type of the `Kind.VARIABLE_DEFINITION` AST kind value. */\nexport type VARIABLE_DEFINITION = typeof VARIABLE_DEFINITION;\n\n/** AST kind for selection set nodes. */\nexport const SELECTION_SET = 'SelectionSet';\n/** Type of the `Kind.SELECTION_SET` AST kind value. */\nexport type SELECTION_SET = typeof SELECTION_SET;\n\n/** AST kind for field selection nodes. */\nexport const FIELD = 'Field';\n/** Type of the `Kind.FIELD` AST kind value. */\nexport type FIELD = typeof FIELD;\n\n/** AST kind for argument nodes. */\nexport const ARGUMENT = 'Argument';\n/** Type of the `Kind.ARGUMENT` AST kind value. */\nexport type ARGUMENT = typeof ARGUMENT;\n\n/** AST kind for fragment argument nodes. */\nexport const FRAGMENT_ARGUMENT = 'FragmentArgument';\n/** Type of the `Kind.FRAGMENT_ARGUMENT` AST kind value. */\nexport type FRAGMENT_ARGUMENT = typeof FRAGMENT_ARGUMENT;\n\n/** AST kind for fragment spread nodes. */\nexport const FRAGMENT_SPREAD = 'FragmentSpread';\n/** Type of the `Kind.FRAGMENT_SPREAD` AST kind value. */\nexport type FRAGMENT_SPREAD = typeof FRAGMENT_SPREAD;\n\n/** AST kind for inline fragment nodes. */\nexport const INLINE_FRAGMENT = 'InlineFragment';\n/** Type of the `Kind.INLINE_FRAGMENT` AST kind value. */\nexport type INLINE_FRAGMENT = typeof INLINE_FRAGMENT;\n\n/** AST kind for fragment definition nodes. */\nexport const FRAGMENT_DEFINITION = 'FragmentDefinition';\n/** Type of the `Kind.FRAGMENT_DEFINITION` AST kind value. */\nexport type FRAGMENT_DEFINITION = typeof FRAGMENT_DEFINITION;\n\n/** AST kind for variable reference nodes. */\nexport const VARIABLE = 'Variable';\n/** Type of the `Kind.VARIABLE` AST kind value. */\nexport type VARIABLE = typeof VARIABLE;\n\n/** AST kind for integer value nodes. */\nexport const INT = 'IntValue';\n/** Type of the `Kind.INT` AST kind value. */\nexport type INT = typeof INT;\n\n/** AST kind for floating-point value nodes. */\nexport const FLOAT = 'FloatValue';\n/** Type of the `Kind.FLOAT` AST kind value. */\nexport type FLOAT = typeof FLOAT;\n\n/** AST kind for string value nodes. */\nexport const STRING = 'StringValue';\n/** Type of the `Kind.STRING` AST kind value. */\nexport type STRING = typeof STRING;\n\n/** AST kind for boolean value nodes. */\nexport const BOOLEAN = 'BooleanValue';\n/** Type of the `Kind.BOOLEAN` AST kind value. */\nexport type BOOLEAN = typeof BOOLEAN;\n\n/** AST kind for null value nodes. */\nexport const NULL = 'NullValue';\n/** Type of the `Kind.NULL` AST kind value. */\nexport type NULL = typeof NULL;\n\n/** AST kind for enum value nodes. */\nexport const ENUM = 'EnumValue';\n/** Type of the `Kind.ENUM` AST kind value. */\nexport type ENUM = typeof ENUM;\n\n/** AST kind for list value nodes. */\nexport const LIST = 'ListValue';\n/** Type of the `Kind.LIST` AST kind value. */\nexport type LIST = typeof LIST;\n\n/** AST kind for object value nodes. */\nexport const OBJECT = 'ObjectValue';\n/** Type of the `Kind.OBJECT` AST kind value. */\nexport type OBJECT = typeof OBJECT;\n\n/** AST kind for object field nodes. */\nexport const OBJECT_FIELD = 'ObjectField';\n/** Type of the `Kind.OBJECT_FIELD` AST kind value. */\nexport type OBJECT_FIELD = typeof OBJECT_FIELD;\n\n/** AST kind for directive nodes. */\nexport const DIRECTIVE = 'Directive';\n/** Type of the `Kind.DIRECTIVE` AST kind value. */\nexport type DIRECTIVE = typeof DIRECTIVE;\n\n/** AST kind for named type reference nodes. */\nexport const NAMED_TYPE = 'NamedType';\n/** Type of the `Kind.NAMED_TYPE` AST kind value. */\nexport type NAMED_TYPE = typeof NAMED_TYPE;\n\n/** AST kind for list type reference nodes. */\nexport const LIST_TYPE = 'ListType';\n/** Type of the `Kind.LIST_TYPE` AST kind value. */\nexport type LIST_TYPE = typeof LIST_TYPE;\n\n/** AST kind for non-null type reference nodes. */\nexport const NON_NULL_TYPE = 'NonNullType';\n/** Type of the `Kind.NON_NULL_TYPE` AST kind value. */\nexport type NON_NULL_TYPE = typeof NON_NULL_TYPE;\n\n/** AST kind for schema definition nodes. */\nexport const SCHEMA_DEFINITION = 'SchemaDefinition';\n/** Type of the `Kind.SCHEMA_DEFINITION` AST kind value. */\nexport type SCHEMA_DEFINITION = typeof SCHEMA_DEFINITION;\n\n/** AST kind for operation type definition nodes. */\nexport const OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';\n/** Type of the `Kind.OPERATION_TYPE_DEFINITION` AST kind value. */\nexport type OPERATION_TYPE_DEFINITION = typeof OPERATION_TYPE_DEFINITION;\n\n/** AST kind for scalar type definition nodes. */\nexport const SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';\n/** Type of the `Kind.SCALAR_TYPE_DEFINITION` AST kind value. */\nexport type SCALAR_TYPE_DEFINITION = typeof SCALAR_TYPE_DEFINITION;\n\n/** AST kind for object type definition nodes. */\nexport const OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';\n/** Type of the `Kind.OBJECT_TYPE_DEFINITION` AST kind value. */\nexport type OBJECT_TYPE_DEFINITION = typeof OBJECT_TYPE_DEFINITION;\n\n/** AST kind for field definition nodes. */\nexport const FIELD_DEFINITION = 'FieldDefinition';\n/** Type of the `Kind.FIELD_DEFINITION` AST kind value. */\nexport type FIELD_DEFINITION = typeof FIELD_DEFINITION;\n\n/** AST kind for input value definition nodes. */\nexport const INPUT_VALUE_DEFINITION = 'InputValueDefinition';\n/** Type of the `Kind.INPUT_VALUE_DEFINITION` AST kind value. */\nexport type INPUT_VALUE_DEFINITION = typeof INPUT_VALUE_DEFINITION;\n\n/** AST kind for interface type definition nodes. */\nexport const INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';\n/** Type of the `Kind.INTERFACE_TYPE_DEFINITION` AST kind value. */\nexport type INTERFACE_TYPE_DEFINITION = typeof INTERFACE_TYPE_DEFINITION;\n\n/** AST kind for union type definition nodes. */\nexport const UNION_TYPE_DEFINITION = 'UnionTypeDefinition';\n/** Type of the `Kind.UNION_TYPE_DEFINITION` AST kind value. */\nexport type UNION_TYPE_DEFINITION = typeof UNION_TYPE_DEFINITION;\n\n/** AST kind for enum type definition nodes. */\nexport const ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';\n\n/** AST kind for enum value definition nodes. */\nexport const ENUM_VALUE_DEFINITION = 'EnumValueDefinition';\n/** Type of the `Kind.ENUM_VALUE_DEFINITION` AST kind value. */\nexport type ENUM_VALUE_DEFINITION = typeof ENUM_VALUE_DEFINITION;\n\n/** AST kind for input object type definition nodes. */\nexport const INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';\n/** Type of the `Kind.INPUT_OBJECT_TYPE_DEFINITION` AST kind value. */\nexport type INPUT_OBJECT_TYPE_DEFINITION = typeof INPUT_OBJECT_TYPE_DEFINITION;\n\n/** AST kind for directive definition nodes. */\nexport const DIRECTIVE_DEFINITION = 'DirectiveDefinition';\n/** Type of the `Kind.DIRECTIVE_DEFINITION` AST kind value. */\nexport type DIRECTIVE_DEFINITION = typeof DIRECTIVE_DEFINITION;\n\n/** AST kind for schema extension nodes. */\nexport const SCHEMA_EXTENSION = 'SchemaExtension';\n/** Type of the `Kind.SCHEMA_EXTENSION` AST kind value. */\nexport type SCHEMA_EXTENSION = typeof SCHEMA_EXTENSION;\n\n/** AST kind for directive extension nodes. */\nexport const DIRECTIVE_EXTENSION = 'DirectiveExtension';\n/** Type of the `Kind.DIRECTIVE_EXTENSION` AST kind value. */\nexport type DIRECTIVE_EXTENSION = typeof DIRECTIVE_EXTENSION;\n\n/** AST kind for scalar type extension nodes. */\nexport const SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension';\n/** Type of the `Kind.SCALAR_TYPE_EXTENSION` AST kind value. */\nexport type SCALAR_TYPE_EXTENSION = typeof SCALAR_TYPE_EXTENSION;\n\n/** AST kind for object type extension nodes. */\nexport const OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension';\n/** Type of the `Kind.OBJECT_TYPE_EXTENSION` AST kind value. */\nexport type OBJECT_TYPE_EXTENSION = typeof OBJECT_TYPE_EXTENSION;\n\n/** AST kind for interface type extension nodes. */\nexport const INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension';\n/** Type of the `Kind.INTERFACE_TYPE_EXTENSION` AST kind value. */\nexport type INTERFACE_TYPE_EXTENSION = typeof INTERFACE_TYPE_EXTENSION;\n\n/** AST kind for union type extension nodes. */\nexport const UNION_TYPE_EXTENSION = 'UnionTypeExtension';\n/** Type of the `Kind.UNION_TYPE_EXTENSION` AST kind value. */\nexport type UNION_TYPE_EXTENSION = typeof UNION_TYPE_EXTENSION;\n\n/** AST kind for enum type extension nodes. */\nexport const ENUM_TYPE_EXTENSION = 'EnumTypeExtension';\n/** Type of the `Kind.ENUM_TYPE_EXTENSION` AST kind value. */\nexport type ENUM_TYPE_EXTENSION = typeof ENUM_TYPE_EXTENSION;\n\n/** AST kind for input object type extension nodes. */\nexport const INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension';\n/** Type of the `Kind.INPUT_OBJECT_TYPE_EXTENSION` AST kind value. */\nexport type INPUT_OBJECT_TYPE_EXTENSION = typeof INPUT_OBJECT_TYPE_EXTENSION;\n\n/** AST kind for type coordinate nodes. */\nexport const TYPE_COORDINATE = 'TypeCoordinate';\n/** Type of the `Kind.TYPE_COORDINATE` AST kind value. */\nexport type TYPE_COORDINATE = typeof TYPE_COORDINATE;\n\n/** AST kind for member coordinate nodes. */\nexport const MEMBER_COORDINATE = 'MemberCoordinate';\n/** Type of the `Kind.MEMBER_COORDINATE` AST kind value. */\nexport type MEMBER_COORDINATE = typeof MEMBER_COORDINATE;\n\n/** AST kind for argument coordinate nodes. */\nexport const ARGUMENT_COORDINATE = 'ArgumentCoordinate';\n/** Type of the `Kind.ARGUMENT_COORDINATE` AST kind value. */\nexport type ARGUMENT_COORDINATE = typeof ARGUMENT_COORDINATE;\n\n/** AST kind for directive coordinate nodes. */\nexport const DIRECTIVE_COORDINATE = 'DirectiveCoordinate';\n/** Type of the `Kind.DIRECTIVE_COORDINATE` AST kind value. */\nexport type DIRECTIVE_COORDINATE = typeof DIRECTIVE_COORDINATE;\n\n/** AST kind for directive argument coordinate nodes. */\nexport const DIRECTIVE_ARGUMENT_COORDINATE = 'DirectiveArgumentCoordinate';\n/** Type of the `Kind.DIRECTIVE_ARGUMENT_COORDINATE` AST kind value. */\nexport type DIRECTIVE_ARGUMENT_COORDINATE =\n typeof DIRECTIVE_ARGUMENT_COORDINATE;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.mts new file mode 100644 index 00000000..4451fe6a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.mts @@ -0,0 +1,120 @@ +/** @category Lexing */ +import { Token } from "./ast.mjs"; +import type { Source } from "./source.mjs"; +import { TokenKind } from "./tokenKind.mjs"; +/** + * A Lexer interface which provides common properties and methods required for + * lexing GraphQL source. + * + * @internal + */ +export interface LexerInterface { + source: Source; + lastToken: Token; + token: Token; + line: number; + lineStart: number; + advance: () => Token; + lookahead: () => Token; +} +/** + * Given a Source object, creates a Lexer for that source. + * A Lexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + */ +export declare class Lexer implements LexerInterface { + /** Source document used to derive error locations. */ + source: Source; + /** Most recent non-ignored token returned by the lexer. */ + lastToken: Token; + /** Current non-ignored token at the lexer cursor. */ + token: Token; + /** The (1-indexed) line containing the current token. */ + line: number; + /** Character offset where the current line starts. */ + lineStart: number; + /** + * Creates a Lexer instance. + * @param source - Source document used to derive error locations. + * @example + * ```ts + * import { Lexer, Source, TokenKind } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * + * lexer.token.kind; // => TokenKind.SOF + * lexer.advance().kind; // => TokenKind.BRACE_L + * lexer.advance().value; // => 'hello' + * lexer.advance().kind; // => TokenKind.BRACE_R + * ``` + */ + constructor(source: Source); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Advances the token stream to the next non-ignored token. + * @returns The next non-ignored token. + * @example + * ```ts + * import { Lexer, Source } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * const token = lexer.advance(); + * + * token.kind; // => '{' + * lexer.token; // => token + * ``` + */ + advance(): Token; + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the state of Lexer. + * @returns The next non-ignored token without advancing the lexer. + * @example + * ```ts + * import { Lexer, Source } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * const token = lexer.lookahead(); + * + * token.kind; // => '{' + * lexer.token.kind; // => '' + * ``` + */ + lookahead(): Token; +} +/** @internal */ +export declare function isPunctuatorTokenKind(kind: TokenKind): boolean; +/** + * Prints the code point (or end of file reference) at a given location in a + * source for use in error messages. + * + * Printable ASCII is printed quoted, while other points are printed in Unicode + * code point form (ie. U+1234). + * + * @internal + */ +export declare function printCodePointAt(lexer: LexerInterface, location: number): string; +/** + * Create a token with line and column location information. + * + * @internal + */ +export declare function createToken(lexer: LexerInterface, kind: TokenKind, start: number, end: number, value?: string): Token; +/** + * Reads an alphanumeric + underscore name from the source. + * + * ``` + * Name :: + * - NameStart NameContinue* [lookahead != NameContinue] + * ``` + * + * @internal + */ +export declare function readName(lexer: LexerInterface, start: number): Token; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.ts new file mode 100644 index 00000000..7d8ab68d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.d.ts @@ -0,0 +1,120 @@ +/** @category Lexing */ +import { Token } from "./ast.js"; +import type { Source } from "./source.js"; +import { TokenKind } from "./tokenKind.js"; +/** + * A Lexer interface which provides common properties and methods required for + * lexing GraphQL source. + * + * @internal + */ +export interface LexerInterface { + source: Source; + lastToken: Token; + token: Token; + line: number; + lineStart: number; + advance: () => Token; + lookahead: () => Token; +} +/** + * Given a Source object, creates a Lexer for that source. + * A Lexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + */ +export declare class Lexer implements LexerInterface { + /** Source document used to derive error locations. */ + source: Source; + /** Most recent non-ignored token returned by the lexer. */ + lastToken: Token; + /** Current non-ignored token at the lexer cursor. */ + token: Token; + /** The (1-indexed) line containing the current token. */ + line: number; + /** Character offset where the current line starts. */ + lineStart: number; + /** + * Creates a Lexer instance. + * @param source - Source document used to derive error locations. + * @example + * ```ts + * import { Lexer, Source, TokenKind } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * + * lexer.token.kind; // => TokenKind.SOF + * lexer.advance().kind; // => TokenKind.BRACE_L + * lexer.advance().value; // => 'hello' + * lexer.advance().kind; // => TokenKind.BRACE_R + * ``` + */ + constructor(source: Source); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Advances the token stream to the next non-ignored token. + * @returns The next non-ignored token. + * @example + * ```ts + * import { Lexer, Source } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * const token = lexer.advance(); + * + * token.kind; // => '{' + * lexer.token; // => token + * ``` + */ + advance(): Token; + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the state of Lexer. + * @returns The next non-ignored token without advancing the lexer. + * @example + * ```ts + * import { Lexer, Source } from 'graphql/language'; + * + * const lexer = new Lexer(new Source('{ hello }')); + * const token = lexer.lookahead(); + * + * token.kind; // => '{' + * lexer.token.kind; // => '' + * ``` + */ + lookahead(): Token; +} +/** @internal */ +export declare function isPunctuatorTokenKind(kind: TokenKind): boolean; +/** + * Prints the code point (or end of file reference) at a given location in a + * source for use in error messages. + * + * Printable ASCII is printed quoted, while other points are printed in Unicode + * code point form (ie. U+1234). + * + * @internal + */ +export declare function printCodePointAt(lexer: LexerInterface, location: number): string; +/** + * Create a token with line and column location information. + * + * @internal + */ +export declare function createToken(lexer: LexerInterface, kind: TokenKind, start: number, end: number, value?: string): Token; +/** + * Reads an alphanumeric + underscore name from the source. + * + * ``` + * Name :: + * - NameStart NameContinue* [lookahead != NameContinue] + * ``` + * + * @internal + */ +export declare function readName(lexer: LexerInterface, start: number): Token; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js new file mode 100644 index 00000000..1b773d36 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js @@ -0,0 +1,439 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Lexer = void 0; +exports.isPunctuatorTokenKind = isPunctuatorTokenKind; +exports.printCodePointAt = printCodePointAt; +exports.createToken = createToken; +exports.readName = readName; +const syntaxError_ts_1 = require("../error/syntaxError.js"); +const ast_ts_1 = require("./ast.js"); +const blockString_ts_1 = require("./blockString.js"); +const characterClasses_ts_1 = require("./characterClasses.js"); +const tokenKind_ts_1 = require("./tokenKind.js"); +class Lexer { + constructor(source) { + const startOfFileToken = new ast_ts_1.Token(tokenKind_ts_1.TokenKind.SOF, 0, 0, 0, 0); + this.source = source; + this.lastToken = startOfFileToken; + this.token = startOfFileToken; + this.line = 1; + this.lineStart = 0; + } + get [Symbol.toStringTag]() { + return 'Lexer'; + } + advance() { + this.lastToken = this.token; + const token = (this.token = this.lookahead()); + return token; + } + lookahead() { + let token = this.token; + if (token.kind !== tokenKind_ts_1.TokenKind.EOF) { + do { + if (token.next) { + token = token.next; + } + else { + const nextToken = readNextToken(this, token.end); + token.next = nextToken; + nextToken.prev = token; + token = nextToken; + } + } while (token.kind === tokenKind_ts_1.TokenKind.COMMENT); + } + return token; + } +} +exports.Lexer = Lexer; +function isPunctuatorTokenKind(kind) { + return (kind === tokenKind_ts_1.TokenKind.BANG || + kind === tokenKind_ts_1.TokenKind.DOLLAR || + kind === tokenKind_ts_1.TokenKind.AMP || + kind === tokenKind_ts_1.TokenKind.PAREN_L || + kind === tokenKind_ts_1.TokenKind.PAREN_R || + kind === tokenKind_ts_1.TokenKind.DOT || + kind === tokenKind_ts_1.TokenKind.SPREAD || + kind === tokenKind_ts_1.TokenKind.COLON || + kind === tokenKind_ts_1.TokenKind.EQUALS || + kind === tokenKind_ts_1.TokenKind.AT || + kind === tokenKind_ts_1.TokenKind.BRACKET_L || + kind === tokenKind_ts_1.TokenKind.BRACKET_R || + kind === tokenKind_ts_1.TokenKind.BRACE_L || + kind === tokenKind_ts_1.TokenKind.PIPE || + kind === tokenKind_ts_1.TokenKind.BRACE_R); +} +function isUnicodeScalarValue(code) { + return ((code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)); +} +function isSupplementaryCodePoint(body, location) { + return (isLeadingSurrogate(body.charCodeAt(location)) && + isTrailingSurrogate(body.charCodeAt(location + 1))); +} +function isLeadingSurrogate(code) { + return code >= 0xd800 && code <= 0xdbff; +} +function isTrailingSurrogate(code) { + return code >= 0xdc00 && code <= 0xdfff; +} +function printCodePointAt(lexer, location) { + const code = lexer.source.body.codePointAt(location); + if (code === undefined) { + return tokenKind_ts_1.TokenKind.EOF; + } + else if (code >= 0x0020 && code <= 0x007e) { + const char = String.fromCodePoint(code); + return char === '"' ? "'\"'" : `"${char}"`; + } + return 'U+' + code.toString(16).toUpperCase().padStart(4, '0'); +} +function createToken(lexer, kind, start, end, value) { + const line = lexer.line; + const col = 1 + start - lexer.lineStart; + return new ast_ts_1.Token(kind, start, end, line, col, value); +} +function readNextToken(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start; + while (position < bodyLength) { + const code = body.charCodeAt(position); + switch (code) { + case 0xfeff: + case 0x0009: + case 0x0020: + case 0x002c: + ++position; + continue; + case 0x000a: + ++position; + ++lexer.line; + lexer.lineStart = position; + continue; + case 0x000d: + if (body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } + else { + ++position; + } + ++lexer.line; + lexer.lineStart = position; + continue; + case 0x0023: + return readComment(lexer, position); + case 0x0021: + return createToken(lexer, tokenKind_ts_1.TokenKind.BANG, position, position + 1); + case 0x0024: + return createToken(lexer, tokenKind_ts_1.TokenKind.DOLLAR, position, position + 1); + case 0x0026: + return createToken(lexer, tokenKind_ts_1.TokenKind.AMP, position, position + 1); + case 0x0028: + return createToken(lexer, tokenKind_ts_1.TokenKind.PAREN_L, position, position + 1); + case 0x0029: + return createToken(lexer, tokenKind_ts_1.TokenKind.PAREN_R, position, position + 1); + case 0x002e: { + const nextCode = body.charCodeAt(position + 1); + if (nextCode === 0x002e && body.charCodeAt(position + 2) === 0x002e) { + return createToken(lexer, tokenKind_ts_1.TokenKind.SPREAD, position, position + 3); + } + if (nextCode === 0x002e) { + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, 'Unexpected "..", did you mean "..."?'); + } + else if ((0, characterClasses_ts_1.isDigit)(nextCode)) { + const digits = lexer.source.body.slice(position + 1, readDigits(lexer, position + 1, nextCode)); + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid number, expected digit before ".", did you mean "0.${digits}"?`); + } + break; + } + case 0x003a: + return createToken(lexer, tokenKind_ts_1.TokenKind.COLON, position, position + 1); + case 0x003d: + return createToken(lexer, tokenKind_ts_1.TokenKind.EQUALS, position, position + 1); + case 0x0040: + return createToken(lexer, tokenKind_ts_1.TokenKind.AT, position, position + 1); + case 0x005b: + return createToken(lexer, tokenKind_ts_1.TokenKind.BRACKET_L, position, position + 1); + case 0x005d: + return createToken(lexer, tokenKind_ts_1.TokenKind.BRACKET_R, position, position + 1); + case 0x007b: + return createToken(lexer, tokenKind_ts_1.TokenKind.BRACE_L, position, position + 1); + case 0x007c: + return createToken(lexer, tokenKind_ts_1.TokenKind.PIPE, position, position + 1); + case 0x007d: + return createToken(lexer, tokenKind_ts_1.TokenKind.BRACE_R, position, position + 1); + case 0x0022: + if (body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022) { + return readBlockString(lexer, position); + } + return readString(lexer, position); + } + if ((0, characterClasses_ts_1.isDigit)(code) || code === 0x002d) { + return readNumber(lexer, position, code); + } + if ((0, characterClasses_ts_1.isNameStart)(code)) { + return readName(lexer, position); + } + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, code === 0x0027 + ? 'Unexpected single quote character (\'), did you mean to use a double quote (")?' + : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) + ? `Unexpected character: ${printCodePointAt(lexer, position)}.` + : `Invalid character: ${printCodePointAt(lexer, position)}.`); + } + return createToken(lexer, tokenKind_ts_1.TokenKind.EOF, bodyLength, bodyLength); +} +function readComment(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (code === 0x000a || code === 0x000d) { + break; + } + if (isUnicodeScalarValue(code)) { + ++position; + } + else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } + else { + break; + } + } + return createToken(lexer, tokenKind_ts_1.TokenKind.COMMENT, start, position, body.slice(start + 1, position)); +} +function readNumber(lexer, start, firstCode) { + const body = lexer.source.body; + let position = start; + let code = firstCode; + let isFloat = false; + if (code === 0x002d) { + code = body.charCodeAt(++position); + } + if (code === 0x0030) { + code = body.charCodeAt(++position); + if ((0, characterClasses_ts_1.isDigit)(code)) { + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid number, unexpected digit after 0: ${printCodePointAt(lexer, position)}.`); + } + } + else { + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + if (code === 0x002e) { + isFloat = true; + code = body.charCodeAt(++position); + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + if (code === 0x0045 || code === 0x0065) { + isFloat = true; + code = body.charCodeAt(++position); + if (code === 0x002b || code === 0x002d) { + code = body.charCodeAt(++position); + } + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + if (code === 0x002e || (0, characterClasses_ts_1.isNameStart)(code)) { + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid number, expected digit but got: ${printCodePointAt(lexer, position)}.`); + } + return createToken(lexer, isFloat ? tokenKind_ts_1.TokenKind.FLOAT : tokenKind_ts_1.TokenKind.INT, start, position, body.slice(start, position)); +} +function readDigits(lexer, start, firstCode) { + if (!(0, characterClasses_ts_1.isDigit)(firstCode)) { + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, start, `Invalid number, expected digit but got: ${printCodePointAt(lexer, start)}.`); + } + const body = lexer.source.body; + let position = start + 1; + while ((0, characterClasses_ts_1.isDigit)(body.charCodeAt(position))) { + ++position; + } + return position; +} +function readString(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + let chunkStart = position; + let value = ''; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (code === 0x0022) { + value += body.slice(chunkStart, position); + return createToken(lexer, tokenKind_ts_1.TokenKind.STRING, start, position + 1, value); + } + if (code === 0x005c) { + value += body.slice(chunkStart, position); + const escape = body.charCodeAt(position + 1) === 0x0075 + ? body.charCodeAt(position + 2) === 0x007b + ? readEscapedUnicodeVariableWidth(lexer, position) + : readEscapedUnicodeFixedWidth(lexer, position) + : readEscapedCharacter(lexer, position); + value += escape.value; + position += escape.size; + chunkStart = position; + continue; + } + if (code === 0x000a || code === 0x000d) { + break; + } + if (isUnicodeScalarValue(code)) { + ++position; + } + else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } + else { + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); + } + } + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, 'Unterminated string.'); +} +function readEscapedUnicodeVariableWidth(lexer, position) { + const body = lexer.source.body; + let point = 0; + let size = 3; + while (size < 12) { + const code = body.charCodeAt(position + size++); + if (code === 0x007d) { + if (size < 5 || !isUnicodeScalarValue(point)) { + break; + } + return { value: String.fromCodePoint(point), size }; + } + point = (point << 4) | readHexDigit(code); + if (point < 0) { + break; + } + } + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + size)}".`); +} +function readEscapedUnicodeFixedWidth(lexer, position) { + const body = lexer.source.body; + const code = read16BitHexCode(body, position + 2); + if (isUnicodeScalarValue(code)) { + return { value: String.fromCodePoint(code), size: 6 }; + } + if (isLeadingSurrogate(code)) { + if (body.charCodeAt(position + 6) === 0x005c && + body.charCodeAt(position + 7) === 0x0075) { + const trailingCode = read16BitHexCode(body, position + 8); + if (isTrailingSurrogate(trailingCode)) { + return { value: String.fromCodePoint(code, trailingCode), size: 12 }; + } + } + } + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`); +} +function read16BitHexCode(body, position) { + return ((readHexDigit(body.charCodeAt(position)) << 12) | + (readHexDigit(body.charCodeAt(position + 1)) << 8) | + (readHexDigit(body.charCodeAt(position + 2)) << 4) | + readHexDigit(body.charCodeAt(position + 3))); +} +function readHexDigit(code) { + return code >= 0x0030 && code <= 0x0039 + ? code - 0x0030 + : code >= 0x0041 && code <= 0x0046 + ? code - 0x0037 + : code >= 0x0061 && code <= 0x0066 + ? code - 0x0057 + : -1; +} +function readEscapedCharacter(lexer, position) { + const body = lexer.source.body; + const code = body.charCodeAt(position + 1); + switch (code) { + case 0x0022: + return { value: '\u0022', size: 2 }; + case 0x005c: + return { value: '\u005c', size: 2 }; + case 0x002f: + return { value: '\u002f', size: 2 }; + case 0x0062: + return { value: '\u0008', size: 2 }; + case 0x0066: + return { value: '\u000c', size: 2 }; + case 0x006e: + return { value: '\u000a', size: 2 }; + case 0x0072: + return { value: '\u000d', size: 2 }; + case 0x0074: + return { value: '\u0009', size: 2 }; + } + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid character escape sequence: "${body.slice(position, position + 2)}".`); +} +function readBlockString(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let lineStart = lexer.lineStart; + let position = start + 3; + let chunkStart = position; + let currentLine = ''; + const blockLines = []; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (code === 0x0022 && + body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + const token = createToken(lexer, tokenKind_ts_1.TokenKind.BLOCK_STRING, start, position + 3, (0, blockString_ts_1.dedentBlockStringLines)(blockLines).join('\n')); + lexer.line += blockLines.length - 1; + lexer.lineStart = lineStart; + return token; + } + if (code === 0x005c && + body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022 && + body.charCodeAt(position + 3) === 0x0022) { + currentLine += body.slice(chunkStart, position); + chunkStart = position + 1; + position += 4; + continue; + } + if (code === 0x000a || code === 0x000d) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } + else { + ++position; + } + currentLine = ''; + chunkStart = position; + lineStart = position; + continue; + } + if (isUnicodeScalarValue(code)) { + ++position; + } + else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } + else { + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); + } + } + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, 'Unterminated string.'); +} +function readName(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if ((0, characterClasses_ts_1.isNameContinue)(code)) { + ++position; + } + else { + break; + } + } + return createToken(lexer, tokenKind_ts_1.TokenKind.NAME, start, position, body.slice(start, position)); +} +//# sourceMappingURL=lexer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js.map new file mode 100644 index 00000000..e8484961 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lexer.js","sourceRoot":"","sources":["../../src/language/lexer.ts"],"names":[],"mappings":";;;AA4IA,sDAkBC;AAoDD,4CAgBC;AAOD,kCAUC;AAgrBD,4BAqBC;AAt7BD,4DAAsD;AAEtD,qCAAiC;AACjC,qDAA0D;AAC1D,+DAA6E;AAE7E,iDAA2C;AA0B3C,MAAa,KAAK;IA+BhB,YAAY,MAAc;QACxB,MAAM,gBAAgB,GAAG,IAAI,cAAK,CAAC,wBAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;IACrB,CAAC;IAMD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IAgBD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,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,EAAE,CAAC;YACpD,QAAQ,IAAI,CAAC,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,MAAM,IAAA,4BAAW,EACf,KAAK,CAAC,MAAM,EACZ,QAAQ,EACR,oCAAoC,gBAAgB,CAClD,KAAK,EACL,QAAQ,CACT,GAAG,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,IAAA,4BAAW,EAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,sBAAsB,CAAC,CAAC;AACpE,CAAC;AAYD,SAAgB,QAAQ,CAAC,KAAqB,EAAE,KAAa;IAC3D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;IAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/B,IAAI,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAC;IAEzB,OAAO,QAAQ,GAAG,UAAU,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,IAAA,oCAAc,EAAC,IAAI,CAAC,EAAE,CAAC;YACzB,EAAE,QAAQ,CAAC;QACb,CAAC;aAAM,CAAC;YACN,MAAM;QACR,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAChB,KAAK,EACL,wBAAS,CAAC,IAAI,EACd,KAAK,EACL,QAAQ,EACR,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["/** @category Lexing */\n\nimport { syntaxError } from '../error/syntaxError.ts';\n\nimport { Token } from './ast.ts';\nimport { dedentBlockStringLines } from './blockString.ts';\nimport { isDigit, isNameContinue, isNameStart } from './characterClasses.ts';\nimport type { Source } from './source.ts';\nimport { TokenKind } from './tokenKind.ts';\n\n/**\n * A Lexer interface which provides common properties and methods required for\n * lexing GraphQL source.\n *\n * @internal\n */\nexport interface LexerInterface {\n source: Source;\n lastToken: Token;\n token: Token;\n line: number;\n lineStart: number;\n advance: () => Token;\n lookahead: () => Token;\n}\n\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\nexport class Lexer implements LexerInterface {\n /** Source document used to derive error locations. */\n source: Source;\n\n /** Most recent non-ignored token returned by the lexer. */\n lastToken: Token;\n\n /** Current non-ignored token at the lexer cursor. */\n token: Token;\n\n /** The (1-indexed) line containing the current token. */\n line: number;\n\n /** Character offset where the current line starts. */\n lineStart: number;\n\n /**\n * Creates a Lexer instance.\n * @param source - Source document used to derive error locations.\n * @example\n * ```ts\n * import { Lexer, Source, TokenKind } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n *\n * lexer.token.kind; // => TokenKind.SOF\n * lexer.advance().kind; // => TokenKind.BRACE_L\n * lexer.advance().value; // => 'hello'\n * lexer.advance().kind; // => TokenKind.BRACE_R\n * ```\n */\n constructor(source: Source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Lexer';\n }\n\n /**\n * Advances the token stream to the next non-ignored token.\n * @returns The next non-ignored token.\n * @example\n * ```ts\n * import { Lexer, Source } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n * const token = lexer.advance();\n *\n * token.kind; // => '{'\n * lexer.token; // => token\n * ```\n */\n advance(): Token {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n * @returns The next non-ignored token without advancing the lexer.\n * @example\n * ```ts\n * import { Lexer, Source } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n * const token = lexer.lookahead();\n *\n * token.kind; // => '{'\n * lexer.token.kind; // => ''\n * ```\n */\n lookahead(): Token {\n let token = this.token;\n if (token.kind !== TokenKind.EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end);\n // @ts-expect-error next is only mutable during parsing.\n token.next = nextToken;\n // @ts-expect-error prev is only mutable during parsing.\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === TokenKind.COMMENT);\n }\n return token;\n }\n}\n\n/** @internal */\nexport function isPunctuatorTokenKind(kind: TokenKind): boolean {\n return (\n kind === TokenKind.BANG ||\n kind === TokenKind.DOLLAR ||\n kind === TokenKind.AMP ||\n kind === TokenKind.PAREN_L ||\n kind === TokenKind.PAREN_R ||\n kind === TokenKind.DOT ||\n kind === TokenKind.SPREAD ||\n kind === TokenKind.COLON ||\n kind === TokenKind.EQUALS ||\n kind === TokenKind.AT ||\n kind === TokenKind.BRACKET_L ||\n kind === TokenKind.BRACKET_R ||\n kind === TokenKind.BRACE_L ||\n kind === TokenKind.PIPE ||\n kind === TokenKind.BRACE_R\n );\n}\n\n/**\n * A Unicode scalar value is any Unicode code point except surrogate code\n * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and\n * 0xE000 to 0x10FFFF.\n *\n * SourceCharacter ::\n * - \"Any Unicode scalar value\"\n *\n * @internal\n */\nfunction isUnicodeScalarValue(code: number): boolean {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}\n\n/**\n * The GraphQL specification defines source text as a sequence of unicode scalar\n * values (which Unicode defines to exclude surrogate code points). However\n * JavaScript defines strings as a sequence of UTF-16 code units which may\n * include surrogates. A surrogate pair is a valid source character as it\n * encodes a supplementary code point (above U+FFFF), but unpaired surrogate\n * code points are not valid source characters.\n *\n * @internal\n */\nfunction isSupplementaryCodePoint(body: string, location: number): boolean {\n return (\n isLeadingSurrogate(body.charCodeAt(location)) &&\n isTrailingSurrogate(body.charCodeAt(location + 1))\n );\n}\n\nfunction isLeadingSurrogate(code: number): boolean {\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction isTrailingSurrogate(code: number): boolean {\n return code >= 0xdc00 && code <= 0xdfff;\n}\n\n/**\n * Prints the code point (or end of file reference) at a given location in a\n * source for use in error messages.\n *\n * Printable ASCII is printed quoted, while other points are printed in Unicode\n * code point form (ie. U+1234).\n *\n * @internal\n */\nexport function printCodePointAt(\n lexer: LexerInterface,\n location: number,\n): string {\n const code = lexer.source.body.codePointAt(location);\n\n if (code === undefined) {\n return TokenKind.EOF;\n } else if (code >= 0x0020 && code <= 0x007e) {\n // Printable ASCII\n const char = String.fromCodePoint(code);\n return char === '\"' ? \"'\\\"'\" : `\"${char}\"`;\n }\n\n // Unicode code point\n return 'U+' + code.toString(16).toUpperCase().padStart(4, '0');\n}\n\n/**\n * Create a token with line and column location information.\n *\n * @internal\n */\nexport function createToken(\n lexer: LexerInterface,\n kind: TokenKind,\n start: number,\n end: number,\n value?: string,\n): Token {\n const line = lexer.line;\n const col = 1 + start - lexer.lineStart;\n return new Token(kind, start, end, line, col, value);\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n *\n * @internal\n */\nfunction readNextToken(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // SourceCharacter\n switch (code) {\n // Ignored ::\n // - UnicodeBOM\n // - WhiteSpace\n // - LineTerminator\n // - Comment\n // - Comma\n //\n // UnicodeBOM :: \"Byte Order Mark (U+FEFF)\"\n //\n // WhiteSpace ::\n // - \"Horizontal Tab (U+0009)\"\n // - \"Space (U+0020)\"\n //\n // Comma :: ,\n case 0xfeff: // \n case 0x0009: // \\t\n case 0x0020: // \n case 0x002c: // ,\n ++position;\n continue;\n // LineTerminator ::\n // - \"New Line (U+000A)\"\n // - \"Carriage Return (U+000D)\" [lookahead != \"New Line (U+000A)\"]\n // - \"Carriage Return (U+000D)\" \"New Line (U+000A)\"\n case 0x000a: // \\n\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n case 0x000d: // \\r\n if (body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n // Comment\n case 0x0023: // #\n return readComment(lexer, position);\n // Token ::\n // - Punctuator\n // - Name\n // - IntValue\n // - FloatValue\n // - StringValue\n //\n // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }\n case 0x0021: // !\n return createToken(lexer, TokenKind.BANG, position, position + 1);\n case 0x0024: // $\n return createToken(lexer, TokenKind.DOLLAR, position, position + 1);\n case 0x0026: // &\n return createToken(lexer, TokenKind.AMP, position, position + 1);\n case 0x0028: // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n case 0x0029: // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n case 0x002e: {\n // .\n const nextCode = body.charCodeAt(position + 1);\n if (nextCode === 0x002e && body.charCodeAt(position + 2) === 0x002e) {\n return createToken(lexer, TokenKind.SPREAD, position, position + 3);\n }\n if (nextCode === 0x002e) {\n throw syntaxError(\n lexer.source,\n position,\n 'Unexpected \"..\", did you mean \"...\"?',\n );\n } else if (isDigit(nextCode)) {\n const digits = lexer.source.body.slice(\n position + 1,\n readDigits(lexer, position + 1, nextCode),\n );\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit before \".\", did you mean \"0.${digits}\"?`,\n );\n }\n break;\n }\n case 0x003a: // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n case 0x003d: // =\n return createToken(lexer, TokenKind.EQUALS, position, position + 1);\n case 0x0040: // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n case 0x005b: // [\n return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);\n case 0x005d: // ]\n return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);\n case 0x007b: // {\n return createToken(lexer, TokenKind.BRACE_L, position, position + 1);\n case 0x007c: // |\n return createToken(lexer, TokenKind.PIPE, position, position + 1);\n case 0x007d: // }\n return createToken(lexer, TokenKind.BRACE_R, position, position + 1);\n // StringValue\n case 0x0022: // \"\n if (\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n return readBlockString(lexer, position);\n }\n return readString(lexer, position);\n }\n\n // IntValue | FloatValue (Digit | -)\n if (isDigit(code) || code === 0x002d) {\n return readNumber(lexer, position, code);\n }\n\n // Name\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n code === 0x0027\n ? 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?'\n : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position)\n ? `Unexpected character: ${printCodePointAt(lexer, position)}.`\n : `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n\n/**\n * Reads a comment token from the source file.\n *\n * ```\n * Comment :: # CommentChar* [lookahead != CommentChar]\n *\n * CommentChar :: SourceCharacter but not LineTerminator\n * ```\n *\n * @internal\n */\nfunction readComment(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // LineTerminator (\\n | \\r)\n if (code === 0x000a || code === 0x000d) {\n break;\n }\n\n // SourceCharacter\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}\n\n/**\n * Reads a number token from the source file, either a FloatValue or an IntValue\n * depending on whether a FractionalPart or ExponentPart is encountered.\n *\n * ```\n * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]\n *\n * IntegerPart ::\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit Digit*\n *\n * NegativeSign :: -\n *\n * NonZeroDigit :: Digit but not `0`\n *\n * FloatValue ::\n * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n *\n * FractionalPart :: . Digit+\n *\n * ExponentPart :: ExponentIndicator Sign? Digit+\n *\n * ExponentIndicator :: one of `e` `E`\n *\n * Sign :: one of + -\n * ```\n *\n * @internal\n */\nfunction readNumber(lexer: Lexer, start: number, firstCode: number): Token {\n const body = lexer.source.body;\n let position = start;\n let code = firstCode;\n let isFloat = false;\n\n // NegativeSign (-)\n if (code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n\n // Zero (0)\n if (code === 0x0030) {\n code = body.charCodeAt(++position);\n if (isDigit(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, unexpected digit after 0: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n } else {\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n }\n\n // Full stop (.)\n if (code === 0x002e) {\n isFloat = true;\n\n code = body.charCodeAt(++position);\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n }\n\n // E e\n if (code === 0x0045 || code === 0x0065) {\n isFloat = true;\n\n code = body.charCodeAt(++position);\n // + -\n if (code === 0x002b || code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n }\n\n // Numbers cannot be followed by . or NameStart\n if (code === 0x002e || isNameStart(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n\n return createToken(\n lexer,\n isFloat ? TokenKind.FLOAT : TokenKind.INT,\n start,\n position,\n body.slice(start, position),\n );\n}\n\n/**\n * Returns the new position in the source after reading one or more digits.\n *\n * @internal\n */\nfunction readDigits(lexer: Lexer, start: number, firstCode: number): number {\n if (!isDigit(firstCode)) {\n throw syntaxError(\n lexer.source,\n start,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n start,\n )}.`,\n );\n }\n\n const body = lexer.source.body;\n let position = start + 1; // +1 to skip first firstCode\n\n while (isDigit(body.charCodeAt(position))) {\n ++position;\n }\n\n return position;\n}\n\n/**\n * Reads a single-quote string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"` [lookahead != `\"`]\n * - `\"` StringCharacter+ `\"`\n *\n * StringCharacter ::\n * - SourceCharacter but not `\"` or `\\` or LineTerminator\n * - `\\u` EscapedUnicode\n * - `\\` EscapedCharacter\n *\n * EscapedUnicode ::\n * - `{` HexDigit+ `}`\n * - HexDigit HexDigit HexDigit HexDigit\n *\n * EscapedCharacter :: one of `\"` `\\` `/` `b` `f` `n` `r` `t`\n * ```\n *\n * @internal\n */\nfunction readString(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n let chunkStart = position;\n let value = '';\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // Closing Quote (\")\n if (code === 0x0022) {\n value += body.slice(chunkStart, position);\n return createToken(lexer, TokenKind.STRING, start, position + 1, value);\n }\n\n // Escape Sequence (\\)\n if (code === 0x005c) {\n value += body.slice(chunkStart, position);\n const escape =\n body.charCodeAt(position + 1) === 0x0075 // u\n ? body.charCodeAt(position + 2) === 0x007b // {\n ? readEscapedUnicodeVariableWidth(lexer, position)\n : readEscapedUnicodeFixedWidth(lexer, position)\n : readEscapedCharacter(lexer, position);\n value += escape.value;\n position += escape.size;\n chunkStart = position;\n continue;\n }\n\n // LineTerminator (\\n | \\r)\n if (code === 0x000a || code === 0x000d) {\n break;\n }\n\n // SourceCharacter\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n\n// The string value and lexed size of an escape sequence.\ninterface EscapeSequence {\n value: string;\n size: number;\n}\n\nfunction readEscapedUnicodeVariableWidth(\n lexer: Lexer,\n position: number,\n): EscapeSequence {\n const body = lexer.source.body;\n let point = 0;\n let size = 3;\n // Cannot be larger than 12 chars (\\u{00000000}).\n while (size < 12) {\n const code = body.charCodeAt(position + size++);\n // Closing Brace (})\n if (code === 0x007d) {\n // Must be at least 5 chars (\\u{0}) and encode a Unicode scalar value.\n if (size < 5 || !isUnicodeScalarValue(point)) {\n break;\n }\n return { value: String.fromCodePoint(point), size };\n }\n // Append this hex digit to the code point.\n point = (point << 4) | readHexDigit(code);\n if (point < 0) {\n break;\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(\n position,\n position + size,\n )}\".`,\n );\n}\n\nfunction readEscapedUnicodeFixedWidth(\n lexer: Lexer,\n position: number,\n): EscapeSequence {\n const body = lexer.source.body;\n const code = read16BitHexCode(body, position + 2);\n\n if (isUnicodeScalarValue(code)) {\n return { value: String.fromCodePoint(code), size: 6 };\n }\n\n // GraphQL allows JSON-style surrogate pair escape sequences, but only when\n // a valid pair is formed.\n if (isLeadingSurrogate(code)) {\n // \\u\n if (\n body.charCodeAt(position + 6) === 0x005c &&\n body.charCodeAt(position + 7) === 0x0075\n ) {\n const trailingCode = read16BitHexCode(body, position + 8);\n if (isTrailingSurrogate(trailingCode)) {\n // JavaScript defines strings as a sequence of UTF-16 code units and\n // encodes Unicode code points above U+FFFF using a surrogate pair of\n // code units. Since this is a surrogate pair escape sequence, just\n // include both codes into the JavaScript string value. Had JavaScript\n // not been internally based on UTF-16, then this surrogate pair would\n // be decoded to retrieve the supplementary code point.\n return { value: String.fromCodePoint(code, trailingCode), size: 12 };\n }\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(position, position + 6)}\".`,\n );\n}\n\n/**\n * Reads four hexadecimal characters and returns the positive integer that 16bit\n * hexadecimal string represents. For example, \"000f\" will return 15, and \"dead\"\n * will return 57005.\n *\n * Returns a negative number if any char was not a valid hexadecimal digit.\n *\n * @internal\n */\nfunction read16BitHexCode(body: string, position: number): number {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}\n\n/**\n * Reads a hexadecimal character and returns its positive integer value (0-15).\n *\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 if the provided character code was not a valid hexadecimal digit.\n *\n * HexDigit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * - `A` `B` `C` `D` `E` `F`\n * - `a` `b` `c` `d` `e` `f`\n *\n * @internal\n */\nfunction readHexDigit(code: number): number {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}\n\n/**\n * | Escaped Character | Code Point | Character Name |\n * | ----------------- | ---------- | ---------------------------- |\n * | `\"` | U+0022 | double quote |\n * | `\\` | U+005C | reverse solidus (back slash) |\n * | `/` | U+002F | solidus (forward slash) |\n * | `b` | U+0008 | backspace |\n * | `f` | U+000C | form feed |\n * | `n` | U+000A | line feed (new line) |\n * | `r` | U+000D | carriage return |\n * | `t` | U+0009 | horizontal tab |\n *\n * @internal\n */\nfunction readEscapedCharacter(lexer: Lexer, position: number): EscapeSequence {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n switch (code) {\n case 0x0022: // \"\n return { value: '\\u0022', size: 2 };\n case 0x005c: // \\\n return { value: '\\u005c', size: 2 };\n case 0x002f: // /\n return { value: '\\u002f', size: 2 };\n case 0x0062: // b\n return { value: '\\u0008', size: 2 };\n case 0x0066: // f\n return { value: '\\u000c', size: 2 };\n case 0x006e: // n\n return { value: '\\u000a', size: 2 };\n case 0x0072: // r\n return { value: '\\u000d', size: 2 };\n case 0x0074: // t\n return { value: '\\u0009', size: 2 };\n }\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}\n\n/**\n * Reads a block string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"\"` BlockStringCharacter* `\"\"\"`\n *\n * BlockStringCharacter ::\n * - SourceCharacter but not `\"\"\"` or `\\\"\"\"`\n * - `\\\"\"\"`\n * ```\n *\n * @internal\n */\nfunction readBlockString(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n\n const blockLines = [];\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // Closing Triple-Quote (\"\"\")\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n const token = createToken(\n lexer,\n TokenKind.BLOCK_STRING,\n start,\n position + 3,\n // Return a string of the lines joined with U+000A.\n dedentBlockStringLines(blockLines).join('\\n'),\n );\n\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n }\n\n // Escaped Triple-Quote (\\\"\"\")\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n position += 4;\n continue;\n }\n\n // LineTerminator\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n }\n\n // SourceCharacter\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * ```\n * Name ::\n * - NameStart NameContinue* [lookahead != NameContinue]\n * ```\n *\n * @internal\n */\nexport function readName(lexer: LexerInterface, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n if (isNameContinue(code)) {\n ++position;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.NAME,\n start,\n position,\n body.slice(start, position),\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs new file mode 100644 index 00000000..c9cb19a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs @@ -0,0 +1,431 @@ +import { syntaxError } from "../error/syntaxError.mjs"; +import { Token } from "./ast.mjs"; +import { dedentBlockStringLines } from "./blockString.mjs"; +import { isDigit, isNameContinue, isNameStart } from "./characterClasses.mjs"; +import { TokenKind } from "./tokenKind.mjs"; +export class Lexer { + constructor(source) { + const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0); + this.source = source; + this.lastToken = startOfFileToken; + this.token = startOfFileToken; + this.line = 1; + this.lineStart = 0; + } + get [Symbol.toStringTag]() { + return 'Lexer'; + } + advance() { + this.lastToken = this.token; + const token = (this.token = this.lookahead()); + return token; + } + lookahead() { + let token = this.token; + if (token.kind !== TokenKind.EOF) { + do { + if (token.next) { + token = token.next; + } + else { + const nextToken = readNextToken(this, token.end); + token.next = nextToken; + nextToken.prev = token; + token = nextToken; + } + } while (token.kind === TokenKind.COMMENT); + } + return token; + } +} +export function isPunctuatorTokenKind(kind) { + return (kind === TokenKind.BANG || + kind === TokenKind.DOLLAR || + kind === TokenKind.AMP || + kind === TokenKind.PAREN_L || + kind === TokenKind.PAREN_R || + kind === TokenKind.DOT || + kind === TokenKind.SPREAD || + kind === TokenKind.COLON || + kind === TokenKind.EQUALS || + kind === TokenKind.AT || + kind === TokenKind.BRACKET_L || + kind === TokenKind.BRACKET_R || + kind === TokenKind.BRACE_L || + kind === TokenKind.PIPE || + kind === TokenKind.BRACE_R); +} +function isUnicodeScalarValue(code) { + return ((code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)); +} +function isSupplementaryCodePoint(body, location) { + return (isLeadingSurrogate(body.charCodeAt(location)) && + isTrailingSurrogate(body.charCodeAt(location + 1))); +} +function isLeadingSurrogate(code) { + return code >= 0xd800 && code <= 0xdbff; +} +function isTrailingSurrogate(code) { + return code >= 0xdc00 && code <= 0xdfff; +} +export function printCodePointAt(lexer, location) { + const code = lexer.source.body.codePointAt(location); + if (code === undefined) { + return TokenKind.EOF; + } + else if (code >= 0x0020 && code <= 0x007e) { + const char = String.fromCodePoint(code); + return char === '"' ? "'\"'" : `"${char}"`; + } + return 'U+' + code.toString(16).toUpperCase().padStart(4, '0'); +} +export function createToken(lexer, kind, start, end, value) { + const line = lexer.line; + const col = 1 + start - lexer.lineStart; + return new Token(kind, start, end, line, col, value); +} +function readNextToken(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start; + while (position < bodyLength) { + const code = body.charCodeAt(position); + switch (code) { + case 0xfeff: + case 0x0009: + case 0x0020: + case 0x002c: + ++position; + continue; + case 0x000a: + ++position; + ++lexer.line; + lexer.lineStart = position; + continue; + case 0x000d: + if (body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } + else { + ++position; + } + ++lexer.line; + lexer.lineStart = position; + continue; + case 0x0023: + return readComment(lexer, position); + case 0x0021: + return createToken(lexer, TokenKind.BANG, position, position + 1); + case 0x0024: + return createToken(lexer, TokenKind.DOLLAR, position, position + 1); + case 0x0026: + return createToken(lexer, TokenKind.AMP, position, position + 1); + case 0x0028: + return createToken(lexer, TokenKind.PAREN_L, position, position + 1); + case 0x0029: + return createToken(lexer, TokenKind.PAREN_R, position, position + 1); + case 0x002e: { + const nextCode = body.charCodeAt(position + 1); + if (nextCode === 0x002e && body.charCodeAt(position + 2) === 0x002e) { + return createToken(lexer, TokenKind.SPREAD, position, position + 3); + } + if (nextCode === 0x002e) { + throw syntaxError(lexer.source, position, 'Unexpected "..", did you mean "..."?'); + } + else if (isDigit(nextCode)) { + const digits = lexer.source.body.slice(position + 1, readDigits(lexer, position + 1, nextCode)); + throw syntaxError(lexer.source, position, `Invalid number, expected digit before ".", did you mean "0.${digits}"?`); + } + break; + } + case 0x003a: + return createToken(lexer, TokenKind.COLON, position, position + 1); + case 0x003d: + return createToken(lexer, TokenKind.EQUALS, position, position + 1); + case 0x0040: + return createToken(lexer, TokenKind.AT, position, position + 1); + case 0x005b: + return createToken(lexer, TokenKind.BRACKET_L, position, position + 1); + case 0x005d: + return createToken(lexer, TokenKind.BRACKET_R, position, position + 1); + case 0x007b: + return createToken(lexer, TokenKind.BRACE_L, position, position + 1); + case 0x007c: + return createToken(lexer, TokenKind.PIPE, position, position + 1); + case 0x007d: + return createToken(lexer, TokenKind.BRACE_R, position, position + 1); + case 0x0022: + if (body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022) { + return readBlockString(lexer, position); + } + return readString(lexer, position); + } + if (isDigit(code) || code === 0x002d) { + return readNumber(lexer, position, code); + } + if (isNameStart(code)) { + return readName(lexer, position); + } + throw syntaxError(lexer.source, position, code === 0x0027 + ? 'Unexpected single quote character (\'), did you mean to use a double quote (")?' + : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) + ? `Unexpected character: ${printCodePointAt(lexer, position)}.` + : `Invalid character: ${printCodePointAt(lexer, position)}.`); + } + return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength); +} +function readComment(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (code === 0x000a || code === 0x000d) { + break; + } + if (isUnicodeScalarValue(code)) { + ++position; + } + else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } + else { + break; + } + } + return createToken(lexer, TokenKind.COMMENT, start, position, body.slice(start + 1, position)); +} +function readNumber(lexer, start, firstCode) { + const body = lexer.source.body; + let position = start; + let code = firstCode; + let isFloat = false; + if (code === 0x002d) { + code = body.charCodeAt(++position); + } + if (code === 0x0030) { + code = body.charCodeAt(++position); + if (isDigit(code)) { + throw syntaxError(lexer.source, position, `Invalid number, unexpected digit after 0: ${printCodePointAt(lexer, position)}.`); + } + } + else { + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + if (code === 0x002e) { + isFloat = true; + code = body.charCodeAt(++position); + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + if (code === 0x0045 || code === 0x0065) { + isFloat = true; + code = body.charCodeAt(++position); + if (code === 0x002b || code === 0x002d) { + code = body.charCodeAt(++position); + } + position = readDigits(lexer, position, code); + code = body.charCodeAt(position); + } + if (code === 0x002e || isNameStart(code)) { + throw syntaxError(lexer.source, position, `Invalid number, expected digit but got: ${printCodePointAt(lexer, position)}.`); + } + return createToken(lexer, isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, body.slice(start, position)); +} +function readDigits(lexer, start, firstCode) { + if (!isDigit(firstCode)) { + throw syntaxError(lexer.source, start, `Invalid number, expected digit but got: ${printCodePointAt(lexer, start)}.`); + } + const body = lexer.source.body; + let position = start + 1; + while (isDigit(body.charCodeAt(position))) { + ++position; + } + return position; +} +function readString(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + let chunkStart = position; + let value = ''; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (code === 0x0022) { + value += body.slice(chunkStart, position); + return createToken(lexer, TokenKind.STRING, start, position + 1, value); + } + if (code === 0x005c) { + value += body.slice(chunkStart, position); + const escape = body.charCodeAt(position + 1) === 0x0075 + ? body.charCodeAt(position + 2) === 0x007b + ? readEscapedUnicodeVariableWidth(lexer, position) + : readEscapedUnicodeFixedWidth(lexer, position) + : readEscapedCharacter(lexer, position); + value += escape.value; + position += escape.size; + chunkStart = position; + continue; + } + if (code === 0x000a || code === 0x000d) { + break; + } + if (isUnicodeScalarValue(code)) { + ++position; + } + else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } + else { + throw syntaxError(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); + } + } + throw syntaxError(lexer.source, position, 'Unterminated string.'); +} +function readEscapedUnicodeVariableWidth(lexer, position) { + const body = lexer.source.body; + let point = 0; + let size = 3; + while (size < 12) { + const code = body.charCodeAt(position + size++); + if (code === 0x007d) { + if (size < 5 || !isUnicodeScalarValue(point)) { + break; + } + return { value: String.fromCodePoint(point), size }; + } + point = (point << 4) | readHexDigit(code); + if (point < 0) { + break; + } + } + throw syntaxError(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + size)}".`); +} +function readEscapedUnicodeFixedWidth(lexer, position) { + const body = lexer.source.body; + const code = read16BitHexCode(body, position + 2); + if (isUnicodeScalarValue(code)) { + return { value: String.fromCodePoint(code), size: 6 }; + } + if (isLeadingSurrogate(code)) { + if (body.charCodeAt(position + 6) === 0x005c && + body.charCodeAt(position + 7) === 0x0075) { + const trailingCode = read16BitHexCode(body, position + 8); + if (isTrailingSurrogate(trailingCode)) { + return { value: String.fromCodePoint(code, trailingCode), size: 12 }; + } + } + } + throw syntaxError(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`); +} +function read16BitHexCode(body, position) { + return ((readHexDigit(body.charCodeAt(position)) << 12) | + (readHexDigit(body.charCodeAt(position + 1)) << 8) | + (readHexDigit(body.charCodeAt(position + 2)) << 4) | + readHexDigit(body.charCodeAt(position + 3))); +} +function readHexDigit(code) { + return code >= 0x0030 && code <= 0x0039 + ? code - 0x0030 + : code >= 0x0041 && code <= 0x0046 + ? code - 0x0037 + : code >= 0x0061 && code <= 0x0066 + ? code - 0x0057 + : -1; +} +function readEscapedCharacter(lexer, position) { + const body = lexer.source.body; + const code = body.charCodeAt(position + 1); + switch (code) { + case 0x0022: + return { value: '\u0022', size: 2 }; + case 0x005c: + return { value: '\u005c', size: 2 }; + case 0x002f: + return { value: '\u002f', size: 2 }; + case 0x0062: + return { value: '\u0008', size: 2 }; + case 0x0066: + return { value: '\u000c', size: 2 }; + case 0x006e: + return { value: '\u000a', size: 2 }; + case 0x0072: + return { value: '\u000d', size: 2 }; + case 0x0074: + return { value: '\u0009', size: 2 }; + } + throw syntaxError(lexer.source, position, `Invalid character escape sequence: "${body.slice(position, position + 2)}".`); +} +function readBlockString(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let lineStart = lexer.lineStart; + let position = start + 3; + let chunkStart = position; + let currentLine = ''; + const blockLines = []; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (code === 0x0022 && + body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + const token = createToken(lexer, TokenKind.BLOCK_STRING, start, position + 3, dedentBlockStringLines(blockLines).join('\n')); + lexer.line += blockLines.length - 1; + lexer.lineStart = lineStart; + return token; + } + if (code === 0x005c && + body.charCodeAt(position + 1) === 0x0022 && + body.charCodeAt(position + 2) === 0x0022 && + body.charCodeAt(position + 3) === 0x0022) { + currentLine += body.slice(chunkStart, position); + chunkStart = position + 1; + position += 4; + continue; + } + if (code === 0x000a || code === 0x000d) { + currentLine += body.slice(chunkStart, position); + blockLines.push(currentLine); + if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) { + position += 2; + } + else { + ++position; + } + currentLine = ''; + chunkStart = position; + lineStart = position; + continue; + } + if (isUnicodeScalarValue(code)) { + ++position; + } + else if (isSupplementaryCodePoint(body, position)) { + position += 2; + } + else { + throw syntaxError(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`); + } + } + throw syntaxError(lexer.source, position, 'Unterminated string.'); +} +export function readName(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + let position = start + 1; + while (position < bodyLength) { + const code = body.charCodeAt(position); + if (isNameContinue(code)) { + ++position; + } + else { + break; + } + } + return createToken(lexer, TokenKind.NAME, start, position, body.slice(start, position)); +} +//# sourceMappingURL=lexer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs.map new file mode 100644 index 00000000..991f83ad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/lexer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"lexer.js","sourceRoot":"","sources":["../../src/language/lexer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,iCAAgC;AAEtD,OAAO,EAAE,KAAK,EAAE,kBAAiB;AACjC,OAAO,EAAE,sBAAsB,EAAE,0BAAyB;AAC1D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,+BAA8B;AAE7E,OAAO,EAAE,SAAS,EAAE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I,EACd,KAAK,EACL,QAAQ,EACR,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["/** @category Lexing */\n\nimport { syntaxError } from '../error/syntaxError.ts';\n\nimport { Token } from './ast.ts';\nimport { dedentBlockStringLines } from './blockString.ts';\nimport { isDigit, isNameContinue, isNameStart } from './characterClasses.ts';\nimport type { Source } from './source.ts';\nimport { TokenKind } from './tokenKind.ts';\n\n/**\n * A Lexer interface which provides common properties and methods required for\n * lexing GraphQL source.\n *\n * @internal\n */\nexport interface LexerInterface {\n source: Source;\n lastToken: Token;\n token: Token;\n line: number;\n lineStart: number;\n advance: () => Token;\n lookahead: () => Token;\n}\n\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\nexport class Lexer implements LexerInterface {\n /** Source document used to derive error locations. */\n source: Source;\n\n /** Most recent non-ignored token returned by the lexer. */\n lastToken: Token;\n\n /** Current non-ignored token at the lexer cursor. */\n token: Token;\n\n /** The (1-indexed) line containing the current token. */\n line: number;\n\n /** Character offset where the current line starts. */\n lineStart: number;\n\n /**\n * Creates a Lexer instance.\n * @param source - Source document used to derive error locations.\n * @example\n * ```ts\n * import { Lexer, Source, TokenKind } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n *\n * lexer.token.kind; // => TokenKind.SOF\n * lexer.advance().kind; // => TokenKind.BRACE_L\n * lexer.advance().value; // => 'hello'\n * lexer.advance().kind; // => TokenKind.BRACE_R\n * ```\n */\n constructor(source: Source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Lexer';\n }\n\n /**\n * Advances the token stream to the next non-ignored token.\n * @returns The next non-ignored token.\n * @example\n * ```ts\n * import { Lexer, Source } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n * const token = lexer.advance();\n *\n * token.kind; // => '{'\n * lexer.token; // => token\n * ```\n */\n advance(): Token {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n * @returns The next non-ignored token without advancing the lexer.\n * @example\n * ```ts\n * import { Lexer, Source } from 'graphql/language';\n *\n * const lexer = new Lexer(new Source('{ hello }'));\n * const token = lexer.lookahead();\n *\n * token.kind; // => '{'\n * lexer.token.kind; // => ''\n * ```\n */\n lookahead(): Token {\n let token = this.token;\n if (token.kind !== TokenKind.EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end);\n // @ts-expect-error next is only mutable during parsing.\n token.next = nextToken;\n // @ts-expect-error prev is only mutable during parsing.\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === TokenKind.COMMENT);\n }\n return token;\n }\n}\n\n/** @internal */\nexport function isPunctuatorTokenKind(kind: TokenKind): boolean {\n return (\n kind === TokenKind.BANG ||\n kind === TokenKind.DOLLAR ||\n kind === TokenKind.AMP ||\n kind === TokenKind.PAREN_L ||\n kind === TokenKind.PAREN_R ||\n kind === TokenKind.DOT ||\n kind === TokenKind.SPREAD ||\n kind === TokenKind.COLON ||\n kind === TokenKind.EQUALS ||\n kind === TokenKind.AT ||\n kind === TokenKind.BRACKET_L ||\n kind === TokenKind.BRACKET_R ||\n kind === TokenKind.BRACE_L ||\n kind === TokenKind.PIPE ||\n kind === TokenKind.BRACE_R\n );\n}\n\n/**\n * A Unicode scalar value is any Unicode code point except surrogate code\n * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and\n * 0xE000 to 0x10FFFF.\n *\n * SourceCharacter ::\n * - \"Any Unicode scalar value\"\n *\n * @internal\n */\nfunction isUnicodeScalarValue(code: number): boolean {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}\n\n/**\n * The GraphQL specification defines source text as a sequence of unicode scalar\n * values (which Unicode defines to exclude surrogate code points). However\n * JavaScript defines strings as a sequence of UTF-16 code units which may\n * include surrogates. A surrogate pair is a valid source character as it\n * encodes a supplementary code point (above U+FFFF), but unpaired surrogate\n * code points are not valid source characters.\n *\n * @internal\n */\nfunction isSupplementaryCodePoint(body: string, location: number): boolean {\n return (\n isLeadingSurrogate(body.charCodeAt(location)) &&\n isTrailingSurrogate(body.charCodeAt(location + 1))\n );\n}\n\nfunction isLeadingSurrogate(code: number): boolean {\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction isTrailingSurrogate(code: number): boolean {\n return code >= 0xdc00 && code <= 0xdfff;\n}\n\n/**\n * Prints the code point (or end of file reference) at a given location in a\n * source for use in error messages.\n *\n * Printable ASCII is printed quoted, while other points are printed in Unicode\n * code point form (ie. U+1234).\n *\n * @internal\n */\nexport function printCodePointAt(\n lexer: LexerInterface,\n location: number,\n): string {\n const code = lexer.source.body.codePointAt(location);\n\n if (code === undefined) {\n return TokenKind.EOF;\n } else if (code >= 0x0020 && code <= 0x007e) {\n // Printable ASCII\n const char = String.fromCodePoint(code);\n return char === '\"' ? \"'\\\"'\" : `\"${char}\"`;\n }\n\n // Unicode code point\n return 'U+' + code.toString(16).toUpperCase().padStart(4, '0');\n}\n\n/**\n * Create a token with line and column location information.\n *\n * @internal\n */\nexport function createToken(\n lexer: LexerInterface,\n kind: TokenKind,\n start: number,\n end: number,\n value?: string,\n): Token {\n const line = lexer.line;\n const col = 1 + start - lexer.lineStart;\n return new Token(kind, start, end, line, col, value);\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n *\n * @internal\n */\nfunction readNextToken(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // SourceCharacter\n switch (code) {\n // Ignored ::\n // - UnicodeBOM\n // - WhiteSpace\n // - LineTerminator\n // - Comment\n // - Comma\n //\n // UnicodeBOM :: \"Byte Order Mark (U+FEFF)\"\n //\n // WhiteSpace ::\n // - \"Horizontal Tab (U+0009)\"\n // - \"Space (U+0020)\"\n //\n // Comma :: ,\n case 0xfeff: // \n case 0x0009: // \\t\n case 0x0020: // \n case 0x002c: // ,\n ++position;\n continue;\n // LineTerminator ::\n // - \"New Line (U+000A)\"\n // - \"Carriage Return (U+000D)\" [lookahead != \"New Line (U+000A)\"]\n // - \"Carriage Return (U+000D)\" \"New Line (U+000A)\"\n case 0x000a: // \\n\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n case 0x000d: // \\r\n if (body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n // Comment\n case 0x0023: // #\n return readComment(lexer, position);\n // Token ::\n // - Punctuator\n // - Name\n // - IntValue\n // - FloatValue\n // - StringValue\n //\n // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }\n case 0x0021: // !\n return createToken(lexer, TokenKind.BANG, position, position + 1);\n case 0x0024: // $\n return createToken(lexer, TokenKind.DOLLAR, position, position + 1);\n case 0x0026: // &\n return createToken(lexer, TokenKind.AMP, position, position + 1);\n case 0x0028: // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n case 0x0029: // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n case 0x002e: {\n // .\n const nextCode = body.charCodeAt(position + 1);\n if (nextCode === 0x002e && body.charCodeAt(position + 2) === 0x002e) {\n return createToken(lexer, TokenKind.SPREAD, position, position + 3);\n }\n if (nextCode === 0x002e) {\n throw syntaxError(\n lexer.source,\n position,\n 'Unexpected \"..\", did you mean \"...\"?',\n );\n } else if (isDigit(nextCode)) {\n const digits = lexer.source.body.slice(\n position + 1,\n readDigits(lexer, position + 1, nextCode),\n );\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit before \".\", did you mean \"0.${digits}\"?`,\n );\n }\n break;\n }\n case 0x003a: // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n case 0x003d: // =\n return createToken(lexer, TokenKind.EQUALS, position, position + 1);\n case 0x0040: // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n case 0x005b: // [\n return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);\n case 0x005d: // ]\n return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);\n case 0x007b: // {\n return createToken(lexer, TokenKind.BRACE_L, position, position + 1);\n case 0x007c: // |\n return createToken(lexer, TokenKind.PIPE, position, position + 1);\n case 0x007d: // }\n return createToken(lexer, TokenKind.BRACE_R, position, position + 1);\n // StringValue\n case 0x0022: // \"\n if (\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n return readBlockString(lexer, position);\n }\n return readString(lexer, position);\n }\n\n // IntValue | FloatValue (Digit | -)\n if (isDigit(code) || code === 0x002d) {\n return readNumber(lexer, position, code);\n }\n\n // Name\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n code === 0x0027\n ? 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?'\n : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position)\n ? `Unexpected character: ${printCodePointAt(lexer, position)}.`\n : `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n\n/**\n * Reads a comment token from the source file.\n *\n * ```\n * Comment :: # CommentChar* [lookahead != CommentChar]\n *\n * CommentChar :: SourceCharacter but not LineTerminator\n * ```\n *\n * @internal\n */\nfunction readComment(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // LineTerminator (\\n | \\r)\n if (code === 0x000a || code === 0x000d) {\n break;\n }\n\n // SourceCharacter\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}\n\n/**\n * Reads a number token from the source file, either a FloatValue or an IntValue\n * depending on whether a FractionalPart or ExponentPart is encountered.\n *\n * ```\n * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]\n *\n * IntegerPart ::\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit Digit*\n *\n * NegativeSign :: -\n *\n * NonZeroDigit :: Digit but not `0`\n *\n * FloatValue ::\n * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n *\n * FractionalPart :: . Digit+\n *\n * ExponentPart :: ExponentIndicator Sign? Digit+\n *\n * ExponentIndicator :: one of `e` `E`\n *\n * Sign :: one of + -\n * ```\n *\n * @internal\n */\nfunction readNumber(lexer: Lexer, start: number, firstCode: number): Token {\n const body = lexer.source.body;\n let position = start;\n let code = firstCode;\n let isFloat = false;\n\n // NegativeSign (-)\n if (code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n\n // Zero (0)\n if (code === 0x0030) {\n code = body.charCodeAt(++position);\n if (isDigit(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, unexpected digit after 0: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n } else {\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n }\n\n // Full stop (.)\n if (code === 0x002e) {\n isFloat = true;\n\n code = body.charCodeAt(++position);\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n }\n\n // E e\n if (code === 0x0045 || code === 0x0065) {\n isFloat = true;\n\n code = body.charCodeAt(++position);\n // + -\n if (code === 0x002b || code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n }\n\n // Numbers cannot be followed by . or NameStart\n if (code === 0x002e || isNameStart(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n\n return createToken(\n lexer,\n isFloat ? TokenKind.FLOAT : TokenKind.INT,\n start,\n position,\n body.slice(start, position),\n );\n}\n\n/**\n * Returns the new position in the source after reading one or more digits.\n *\n * @internal\n */\nfunction readDigits(lexer: Lexer, start: number, firstCode: number): number {\n if (!isDigit(firstCode)) {\n throw syntaxError(\n lexer.source,\n start,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n start,\n )}.`,\n );\n }\n\n const body = lexer.source.body;\n let position = start + 1; // +1 to skip first firstCode\n\n while (isDigit(body.charCodeAt(position))) {\n ++position;\n }\n\n return position;\n}\n\n/**\n * Reads a single-quote string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"` [lookahead != `\"`]\n * - `\"` StringCharacter+ `\"`\n *\n * StringCharacter ::\n * - SourceCharacter but not `\"` or `\\` or LineTerminator\n * - `\\u` EscapedUnicode\n * - `\\` EscapedCharacter\n *\n * EscapedUnicode ::\n * - `{` HexDigit+ `}`\n * - HexDigit HexDigit HexDigit HexDigit\n *\n * EscapedCharacter :: one of `\"` `\\` `/` `b` `f` `n` `r` `t`\n * ```\n *\n * @internal\n */\nfunction readString(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n let chunkStart = position;\n let value = '';\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // Closing Quote (\")\n if (code === 0x0022) {\n value += body.slice(chunkStart, position);\n return createToken(lexer, TokenKind.STRING, start, position + 1, value);\n }\n\n // Escape Sequence (\\)\n if (code === 0x005c) {\n value += body.slice(chunkStart, position);\n const escape =\n body.charCodeAt(position + 1) === 0x0075 // u\n ? body.charCodeAt(position + 2) === 0x007b // {\n ? readEscapedUnicodeVariableWidth(lexer, position)\n : readEscapedUnicodeFixedWidth(lexer, position)\n : readEscapedCharacter(lexer, position);\n value += escape.value;\n position += escape.size;\n chunkStart = position;\n continue;\n }\n\n // LineTerminator (\\n | \\r)\n if (code === 0x000a || code === 0x000d) {\n break;\n }\n\n // SourceCharacter\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n\n// The string value and lexed size of an escape sequence.\ninterface EscapeSequence {\n value: string;\n size: number;\n}\n\nfunction readEscapedUnicodeVariableWidth(\n lexer: Lexer,\n position: number,\n): EscapeSequence {\n const body = lexer.source.body;\n let point = 0;\n let size = 3;\n // Cannot be larger than 12 chars (\\u{00000000}).\n while (size < 12) {\n const code = body.charCodeAt(position + size++);\n // Closing Brace (})\n if (code === 0x007d) {\n // Must be at least 5 chars (\\u{0}) and encode a Unicode scalar value.\n if (size < 5 || !isUnicodeScalarValue(point)) {\n break;\n }\n return { value: String.fromCodePoint(point), size };\n }\n // Append this hex digit to the code point.\n point = (point << 4) | readHexDigit(code);\n if (point < 0) {\n break;\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(\n position,\n position + size,\n )}\".`,\n );\n}\n\nfunction readEscapedUnicodeFixedWidth(\n lexer: Lexer,\n position: number,\n): EscapeSequence {\n const body = lexer.source.body;\n const code = read16BitHexCode(body, position + 2);\n\n if (isUnicodeScalarValue(code)) {\n return { value: String.fromCodePoint(code), size: 6 };\n }\n\n // GraphQL allows JSON-style surrogate pair escape sequences, but only when\n // a valid pair is formed.\n if (isLeadingSurrogate(code)) {\n // \\u\n if (\n body.charCodeAt(position + 6) === 0x005c &&\n body.charCodeAt(position + 7) === 0x0075\n ) {\n const trailingCode = read16BitHexCode(body, position + 8);\n if (isTrailingSurrogate(trailingCode)) {\n // JavaScript defines strings as a sequence of UTF-16 code units and\n // encodes Unicode code points above U+FFFF using a surrogate pair of\n // code units. Since this is a surrogate pair escape sequence, just\n // include both codes into the JavaScript string value. Had JavaScript\n // not been internally based on UTF-16, then this surrogate pair would\n // be decoded to retrieve the supplementary code point.\n return { value: String.fromCodePoint(code, trailingCode), size: 12 };\n }\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(position, position + 6)}\".`,\n );\n}\n\n/**\n * Reads four hexadecimal characters and returns the positive integer that 16bit\n * hexadecimal string represents. For example, \"000f\" will return 15, and \"dead\"\n * will return 57005.\n *\n * Returns a negative number if any char was not a valid hexadecimal digit.\n *\n * @internal\n */\nfunction read16BitHexCode(body: string, position: number): number {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}\n\n/**\n * Reads a hexadecimal character and returns its positive integer value (0-15).\n *\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 if the provided character code was not a valid hexadecimal digit.\n *\n * HexDigit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * - `A` `B` `C` `D` `E` `F`\n * - `a` `b` `c` `d` `e` `f`\n *\n * @internal\n */\nfunction readHexDigit(code: number): number {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}\n\n/**\n * | Escaped Character | Code Point | Character Name |\n * | ----------------- | ---------- | ---------------------------- |\n * | `\"` | U+0022 | double quote |\n * | `\\` | U+005C | reverse solidus (back slash) |\n * | `/` | U+002F | solidus (forward slash) |\n * | `b` | U+0008 | backspace |\n * | `f` | U+000C | form feed |\n * | `n` | U+000A | line feed (new line) |\n * | `r` | U+000D | carriage return |\n * | `t` | U+0009 | horizontal tab |\n *\n * @internal\n */\nfunction readEscapedCharacter(lexer: Lexer, position: number): EscapeSequence {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n switch (code) {\n case 0x0022: // \"\n return { value: '\\u0022', size: 2 };\n case 0x005c: // \\\n return { value: '\\u005c', size: 2 };\n case 0x002f: // /\n return { value: '\\u002f', size: 2 };\n case 0x0062: // b\n return { value: '\\u0008', size: 2 };\n case 0x0066: // f\n return { value: '\\u000c', size: 2 };\n case 0x006e: // n\n return { value: '\\u000a', size: 2 };\n case 0x0072: // r\n return { value: '\\u000d', size: 2 };\n case 0x0074: // t\n return { value: '\\u0009', size: 2 };\n }\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}\n\n/**\n * Reads a block string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"\"` BlockStringCharacter* `\"\"\"`\n *\n * BlockStringCharacter ::\n * - SourceCharacter but not `\"\"\"` or `\\\"\"\"`\n * - `\\\"\"\"`\n * ```\n *\n * @internal\n */\nfunction readBlockString(lexer: Lexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n\n const blockLines = [];\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n // Closing Triple-Quote (\"\"\")\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n const token = createToken(\n lexer,\n TokenKind.BLOCK_STRING,\n start,\n position + 3,\n // Return a string of the lines joined with U+000A.\n dedentBlockStringLines(blockLines).join('\\n'),\n );\n\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n }\n\n // Escaped Triple-Quote (\\\"\"\")\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n position += 4;\n continue;\n }\n\n // LineTerminator\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n }\n\n // SourceCharacter\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * ```\n * Name ::\n * - NameStart NameContinue* [lookahead != NameContinue]\n * ```\n *\n * @internal\n */\nexport function readName(lexer: LexerInterface, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n if (isNameContinue(code)) {\n ++position;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.NAME,\n start,\n position,\n body.slice(start, position),\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.mts new file mode 100644 index 00000000..57a8547a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.mts @@ -0,0 +1,26 @@ +/** @category Source */ +import type { Source } from "./source.mjs"; +/** Represents a location in a Source. */ +export interface SourceLocation { + /** One-indexed line number in the source document. */ + readonly line: number; + /** One-indexed column number in the source document. */ + readonly column: number; +} +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + * @param source - The source document that contains the position. + * @param position - The UTF-8 character offset in the source body. + * @returns The 1-indexed line and column for the given source position. + * @example + * ```ts + * import { Source, getLocation } from 'graphql/language'; + * + * const source = new Source('type Query { hello: String }'); + * const location = getLocation(source, 13); + * + * location; // => { line: 1, column: 14 } + * ``` + */ +export declare function getLocation(source: Source, position: number): SourceLocation; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.ts new file mode 100644 index 00000000..19b6ef47 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.d.ts @@ -0,0 +1,26 @@ +/** @category Source */ +import type { Source } from "./source.js"; +/** Represents a location in a Source. */ +export interface SourceLocation { + /** One-indexed line number in the source document. */ + readonly line: number; + /** One-indexed column number in the source document. */ + readonly column: number; +} +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + * @param source - The source document that contains the position. + * @param position - The UTF-8 character offset in the source body. + * @returns The 1-indexed line and column for the given source position. + * @example + * ```ts + * import { Source, getLocation } from 'graphql/language'; + * + * const source = new Source('type Query { hello: String }'); + * const location = getLocation(source, 13); + * + * location; // => { line: 1, column: 14 } + * ``` + */ +export declare function getLocation(source: Source, position: number): SourceLocation; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js new file mode 100644 index 00000000..7f105451 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getLocation = getLocation; +const invariant_ts_1 = require("../jsutils/invariant.js"); +const LineRegExp = /\r\n|[\n\r]/g; +function getLocation(source, position) { + let lastLineStart = 0; + let line = 1; + for (const match of source.body.matchAll(LineRegExp)) { + if (!(typeof match.index === 'number')) + (0, invariant_ts_1.invariant)(false); + if (match.index >= position) { + break; + } + lastLineStart = match.index + match[0].length; + line += 1; + } + return { line, column: position + 1 - lastLineStart }; +} +//# sourceMappingURL=location.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js.map new file mode 100644 index 00000000..bf50bf0e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.js.map @@ -0,0 +1 @@ +{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/language/location.ts"],"names":[],"mappings":";;AAgCA,kCAcC;AA5CD,0DAAoD;AAIpD,MAAM,UAAU,GAAG,cAAc,CAAC;AA0BlC,SAAgB,WAAW,CAAC,MAAc,EAAE,QAAgB;IAC1D,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;cAC3C,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;gBAAzC,wBAAS;QACT,IAAI,KAAK,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC5B,MAAM;QACR,CAAC;QACD,aAAa,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9C,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAG,CAAC,GAAG,aAAa,EAAE,CAAC;AACxD,CAAC","sourcesContent":["/** @category Source */\n\nimport { invariant } from '../jsutils/invariant.ts';\n\nimport type { Source } from './source.ts';\n\nconst LineRegExp = /\\r\\n|[\\n\\r]/g;\n\n/** Represents a location in a Source. */\nexport interface SourceLocation {\n /** One-indexed line number in the source document. */\n readonly line: number;\n /** One-indexed column number in the source document. */\n readonly column: number;\n}\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n * @param source - The source document that contains the position.\n * @param position - The UTF-8 character offset in the source body.\n * @returns The 1-indexed line and column for the given source position.\n * @example\n * ```ts\n * import { Source, getLocation } from 'graphql/language';\n *\n * const source = new Source('type Query { hello: String }');\n * const location = getLocation(source, 13);\n *\n * location; // => { line: 1, column: 14 }\n * ```\n */\nexport function getLocation(source: Source, position: number): SourceLocation {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n invariant(typeof match.index === 'number');\n if (match.index >= position) {\n break;\n }\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return { line, column: position + 1 - lastLineStart };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs new file mode 100644 index 00000000..256bb6c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs @@ -0,0 +1,17 @@ +import { invariant } from "../jsutils/invariant.mjs"; +const LineRegExp = /\r\n|[\n\r]/g; +export function getLocation(source, position) { + let lastLineStart = 0; + let line = 1; + for (const match of source.body.matchAll(LineRegExp)) { + if (!(typeof match.index === 'number')) + invariant(false); + if (match.index >= position) { + break; + } + lastLineStart = match.index + match[0].length; + line += 1; + } + return { line, column: position + 1 - lastLineStart }; +} +//# sourceMappingURL=location.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs.map new file mode 100644 index 00000000..37297d41 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/location.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/language/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAIpD,MAAM,UAAU,GAAG,cAAc,CAAC;AA0BlC,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,QAAgB;IAC1D,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;cAC3C,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAAzC,SAAS;QACT,IAAI,KAAK,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC5B,MAAM;QACR,CAAC;QACD,aAAa,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9C,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAG,CAAC,GAAG,aAAa,EAAE,CAAC;AACxD,CAAC","sourcesContent":["/** @category Source */\n\nimport { invariant } from '../jsutils/invariant.ts';\n\nimport type { Source } from './source.ts';\n\nconst LineRegExp = /\\r\\n|[\\n\\r]/g;\n\n/** Represents a location in a Source. */\nexport interface SourceLocation {\n /** One-indexed line number in the source document. */\n readonly line: number;\n /** One-indexed column number in the source document. */\n readonly column: number;\n}\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n * @param source - The source document that contains the position.\n * @param position - The UTF-8 character offset in the source body.\n * @returns The 1-indexed line and column for the given source position.\n * @example\n * ```ts\n * import { Source, getLocation } from 'graphql/language';\n *\n * const source = new Source('type Query { hello: String }');\n * const location = getLocation(source, 13);\n *\n * location; // => { line: 1, column: 14 }\n * ```\n */\nexport function getLocation(source: Source, position: number): SourceLocation {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n invariant(typeof match.index === 'number');\n if (match.index >= position) {\n break;\n }\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return { line, column: position + 1 - lastLineStart };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.mts new file mode 100644 index 00000000..5557bd42 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.mts @@ -0,0 +1,740 @@ +/** @category Parsing */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { GraphQLError } from "../error/GraphQLError.mjs"; +import type { ArgumentNode, ConstArgumentNode, ConstDirectiveNode, ConstListValueNode, ConstObjectFieldNode, ConstObjectValueNode, ConstValueNode, DefinitionNode, DirectiveDefinitionNode, DirectiveExtensionNode, DirectiveNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, EnumValueDefinitionNode, FieldDefinitionNode, FieldNode, FragmentArgumentNode, FragmentDefinitionNode, FragmentSpreadNode, InlineFragmentNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ListValueNode, NamedTypeNode, NameNode, ObjectFieldNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, ObjectValueNode, OperationDefinitionNode, OperationTypeDefinitionNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SchemaCoordinateNode, SchemaDefinitionNode, SchemaExtensionNode, SelectionNode, SelectionSetNode, StringValueNode, Token, TypeNode, TypeSystemExtensionNode, UnionTypeDefinitionNode, UnionTypeExtensionNode, ValueNode, VariableDefinitionNode, VariableNode } from "./ast.mjs"; +import { Location, OperationTypeNode } from "./ast.mjs"; +import type { LexerInterface } from "./lexer.mjs"; +import { Source } from "./source.mjs"; +import { TokenKind } from "./tokenKind.mjs"; +/** Configuration options to control parser behavior */ +export interface ParseOptions { + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean | undefined; + /** + * Parser CPU and memory usage is linear to the number of tokens in a document + * however in extreme cases it becomes quadratic due to memory exhaustion. + * Parsing happens before validation so even invalid queries can burn lots of + * CPU time and memory. + * To prevent this you can set a maximum number of tokens allowed within a document. + */ + maxTokens?: number | undefined; + /** + * EXPERIMENTAL: + * + * If enabled, the parser will understand and parse fragment variable definitions + * and arguments on fragment spreads. Fragment variable definitions will be represented + * in the `variableDefinitions` field of the FragmentDefinitionNode. + * Fragment spread arguments will be represented in the `arguments` field of FragmentSpreadNode. + * @example + * ```graphql prettier-ignore + * { + * t { ...A(var: true) } + * } + * fragment A($var: Boolean = false) on T { + * ...B(x: $var) + * } + * ``` + */ + experimentalFragmentArguments?: boolean | undefined; + /** + * Internal parser hook for GraphQL.js entry points that need to parse a + * restricted grammar with an alternate lexer. + * @internal + */ + lexer?: LexerInterface | undefined; +} +/** + * Given a GraphQL source, parses it into a Document. + * Throws GraphQLError if a syntax error is encountered. + * @param source - A GraphQL source string or source object. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL document AST. + * @example + * ```ts + * // Parse a GraphQL document with the default parser options. + * import { parse } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * + * document.kind; // => 'Document' + * ``` + * @example + * ```ts + * // This variant enables parser options and provides an explicit lexer. + * import { Lexer, Source, parse } from 'graphql/language'; + * + * const document = parse( + * ` + * { + * t { ...A(var: true) } + * } + * fragment A($var: Boolean = false) on T { + * name + * } + * `, + * { + * experimentalFragmentArguments: true, + * maxTokens: 80, + * noLocation: true, + * }, + * ); + * const directiveDocument = parse('directive @foo @bar on FIELD'); + * const source = new Source('{ hero }'); + * const lexerDocument = parse(source, { lexer: new Lexer(source) }); + * + * document.definitions[0].kind; // => 'OperationDefinition' + * document.definitions[1].kind; // => 'FragmentDefinition' + * document.loc; // => undefined + * directiveDocument.definitions[0].kind; // => 'DirectiveDefinition' + * lexerDocument.definitions[0].kind; // => 'OperationDefinition' + * ``` + */ +export declare function parse(source: string | Source, options?: ParseOptions): DocumentNode; +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: valueFromAST(). + * @param source - A GraphQL source string or source object containing a value. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL value AST. + * @example + * ```ts + * import { parseValue } from 'graphql/language'; + * + * const value = parseValue('[42]'); + * + * value.kind; // => 'ListValue' + * ``` + */ +export declare function parseValue(source: string | Source, options?: ParseOptions): ValueNode; +/** + * Similar to parseValue(), but raises a parse error if it encounters a + * variable. The return type will be a constant value. + * @param source - A GraphQL source string or source object containing a constant value. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL constant value AST. + * @example + * ```ts + * import { parseConstValue } from 'graphql/language'; + * + * const value = parseConstValue('{ enabled: true }'); + * + * value.kind; // => 'ObjectValue' + * parseConstValue('$variable'); // throws an error + * ``` + */ +export declare function parseConstValue(source: string | Source, options?: ParseOptions): ConstValueNode; +/** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: typeFromAST(). + * @param source - A GraphQL source string or source object containing a type reference. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL type AST. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * + * const type = parseType('[String!]'); + * + * type.kind; // => 'ListType' + * ``` + */ +export declare function parseType(source: string | Source, options?: ParseOptions): TypeNode; +/** + * Given a string containing a GraphQL Schema Coordinate (ex. `Type.field`), + * parse the AST for that schema coordinate. + * Throws GraphQLError if a syntax error is encountered. + * + * Consider providing the results to the utility function: + * resolveASTSchemaCoordinate(). Or calling resolveSchemaCoordinate() directly + * with an unparsed source. + * @param source - A GraphQL source string or source object containing a schema coordinate. + * @returns The parsed GraphQL schema coordinate AST. + * @example + * ```ts + * import { parseSchemaCoordinate } from 'graphql/language'; + * + * const coordinate = parseSchemaCoordinate('Query.hero'); + * + * coordinate.kind; // => 'MemberCoordinate' + * ``` + */ +export declare function parseSchemaCoordinate(source: string | Source): SchemaCoordinateNode; +/** + * This class is exported only to assist people in implementing their own parsers + * without duplicating too much code and should be used only as last resort for cases + * such as experimental syntax or if certain features could not be contributed upstream. + * + * It is still part of the internal API and is versioned, so any changes to it are never + * considered breaking changes. If you still need to support multiple versions of the + * library, please use the `versionInfo` variable for version detection. + * + * @internal + */ +export declare class Parser { + protected _options: Omit; + protected _lexer: LexerInterface; + protected _tokenCounter: number; + constructor(source: string | Source, options?: ParseOptions); + get tokenCount(): number; + /** + * Converts a name lex token into a name parse node. + * + * @internal + */ + parseName(): NameNode; + /** + * Document : Definition+ + * + * @internal + */ + parseDocument(): DocumentNode; + /** + * Definition : + * - ExecutableDefinition + * - TypeSystemDefinition + * - TypeSystemExtension + * + * ExecutableDefinition : + * - OperationDefinition + * - FragmentDefinition + * + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + * + * @internal + */ + parseDefinition(): DefinitionNode; + /** + * OperationDefinition : + * - SelectionSet + * - OperationType Name? VariableDefinitions? Directives? SelectionSet + * + * @internal + */ + parseOperationDefinition(): OperationDefinitionNode; + /** + * OperationType : one of query mutation subscription + * + * @internal + */ + parseOperationType(): OperationTypeNode; + /** + * VariableDefinitions : ( VariableDefinition+ ) + * + * @internal + */ + parseVariableDefinitions(): Array | undefined; + /** + * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? + * + * @internal + */ + parseVariableDefinition(): VariableDefinitionNode; + /** + * Variable : $ Name + * + * @internal + */ + parseVariable(): VariableNode; + /** + * ``` + * SelectionSet : { Selection+ } + * ``` + * + * @internal + */ + parseSelectionSet(): SelectionSetNode; + /** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + * + * @internal + */ + parseSelection(): SelectionNode; + /** + * Field : Alias? Name Arguments? Directives? SelectionSet? + * + * Alias : Name : + * + * @internal + */ + parseField(): FieldNode; + /** + * Arguments[Const] : ( Argument[?Const]+ ) + * + * @internal + */ + parseArguments(isConst: true): Array | undefined; + parseArguments(isConst: boolean): Array | undefined; + parseFragmentArguments(): Array | undefined; + /** + * Argument[Const] : Name : Value[?Const] + * + * @internal + */ + parseArgument(isConst: true): ConstArgumentNode; + parseArgument(isConst?: boolean): ArgumentNode; + parseConstArgument(): ConstArgumentNode; + parseFragmentArgument(): FragmentArgumentNode; + /** + * Corresponds to both FragmentSpread and InlineFragment in the spec. + * + * FragmentSpread : ... FragmentName Arguments? Directives? + * + * InlineFragment : ... TypeCondition? Directives? SelectionSet + * + * @internal + */ + parseFragment(): FragmentSpreadNode | InlineFragmentNode; + /** + * FragmentDefinition : + * - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + * + * TypeCondition : NamedType + * + * @internal + */ + parseFragmentDefinition(): FragmentDefinitionNode; + /** + * FragmentName : Name but not `on` + * + * @internal + */ + parseFragmentName(): NameNode; + /** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + * + * @internal + */ + parseValueLiteral(isConst: true): ConstValueNode; + parseValueLiteral(isConst: boolean): ValueNode; + parseConstValueLiteral(): ConstValueNode; + parseStringLiteral(): StringValueNode; + /** + * ListValue[Const] : + * - [ ] + * - [ Value[?Const]+ ] + * + * @internal + */ + parseList(isConst: true): ConstListValueNode; + parseList(isConst: boolean): ListValueNode; + /** + * ``` + * ObjectValue[Const] : + * - { } + * - { ObjectField[?Const]+ } + * ``` + * + * @internal + */ + parseObject(isConst: true): ConstObjectValueNode; + parseObject(isConst: boolean): ObjectValueNode; + /** + * ObjectField[Const] : Name : Value[?Const] + * + * @internal + */ + parseObjectField(isConst: true): ConstObjectFieldNode; + parseObjectField(isConst: boolean): ObjectFieldNode; + /** + * Directives[Const] : Directive[?Const]+ + * + * @internal + */ + parseDirectives(isConst: true): Array | undefined; + parseDirectives(isConst: boolean): Array | undefined; + parseConstDirectives(): Array | undefined; + /** + * ``` + * Directive[Const] : @ Name Arguments[?Const]? + * ``` + * + * @internal + */ + parseDirective(isConst: true): ConstDirectiveNode; + parseDirective(isConst: boolean): DirectiveNode; + /** + * Type : + * - NamedType + * - ListType + * - NonNullType + * + * @internal + */ + parseTypeReference(): TypeNode; + /** + * NamedType : Name + * + * @internal + */ + parseNamedType(): NamedTypeNode; + peekDescription(): boolean; + /** + * Description : StringValue + * + * @internal + */ + parseDescription(): undefined | StringValueNode; + /** + * ``` + * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } + * ``` + * + * @internal + */ + parseSchemaDefinition(): SchemaDefinitionNode; + /** + * OperationTypeDefinition : OperationType : NamedType + * + * @internal + */ + parseOperationTypeDefinition(): OperationTypeDefinitionNode; + /** + * ScalarTypeDefinition : Description? scalar Name Directives[Const]? + * + * @internal + */ + parseScalarTypeDefinition(): ScalarTypeDefinitionNode; + /** + * ObjectTypeDefinition : + * Description? + * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? + * + * @internal + */ + parseObjectTypeDefinition(): ObjectTypeDefinitionNode; + /** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + * + * @internal + */ + parseImplementsInterfaces(): Array | undefined; + /** + * ``` + * FieldsDefinition : { FieldDefinition+ } + * ``` + * + * @internal + */ + parseFieldsDefinition(): Array | undefined; + /** + * FieldDefinition : + * - Description? Name ArgumentsDefinition? : Type Directives[Const]? + * + * @internal + */ + parseFieldDefinition(): FieldDefinitionNode; + /** + * ArgumentsDefinition : ( InputValueDefinition+ ) + * + * @internal + */ + parseArgumentDefs(): Array | undefined; + /** + * InputValueDefinition : + * - Description? Name : Type DefaultValue? Directives[Const]? + * + * @internal + */ + parseInputValueDef(): InputValueDefinitionNode; + /** + * InterfaceTypeDefinition : + * - Description? interface Name Directives[Const]? FieldsDefinition? + * + * @internal + */ + parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode; + /** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + * + * @internal + */ + parseUnionTypeDefinition(): UnionTypeDefinitionNode; + /** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + * + * @internal + */ + parseUnionMemberTypes(): Array | undefined; + /** + * EnumTypeDefinition : + * - Description? enum Name Directives[Const]? EnumValuesDefinition? + * + * @internal + */ + parseEnumTypeDefinition(): EnumTypeDefinitionNode; + /** + * ``` + * EnumValuesDefinition : { EnumValueDefinition+ } + * ``` + * + * @internal + */ + parseEnumValuesDefinition(): Array | undefined; + /** + * EnumValueDefinition : Description? EnumValue Directives[Const]? + * + * @internal + */ + parseEnumValueDefinition(): EnumValueDefinitionNode; + /** + * EnumValue : Name but not `true`, `false` or `null` + * + * @internal + */ + parseEnumValueName(): NameNode; + /** + * InputObjectTypeDefinition : + * - Description? input Name Directives[Const]? InputFieldsDefinition? + * + * @internal + */ + parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode; + /** + * ``` + * InputFieldsDefinition : { InputValueDefinition+ } + * ``` + * + * @internal + */ + parseInputFieldsDefinition(): Array | undefined; + /** + * TypeSystemExtension : + * - SchemaExtension + * - TypeExtension + * - DirectiveExtension + * + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeExtension + * + * @internal + */ + parseTypeSystemExtension(): TypeSystemExtensionNode; + /** + * ``` + * SchemaExtension : + * - extend schema Directives[Const]? { OperationTypeDefinition+ } + * - extend schema Directives[Const] + * ``` + * + * @internal + */ + parseSchemaExtension(): SchemaExtensionNode; + /** + * ScalarTypeExtension : + * - extend scalar Name Directives[Const] + * + * @internal + */ + parseScalarTypeExtension(): ScalarTypeExtensionNode; + /** + * ObjectTypeExtension : + * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend type Name ImplementsInterfaces? Directives[Const] + * - extend type Name ImplementsInterfaces + * + * @internal + */ + parseObjectTypeExtension(): ObjectTypeExtensionNode; + /** + * InterfaceTypeExtension : + * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend interface Name ImplementsInterfaces? Directives[Const] + * - extend interface Name ImplementsInterfaces + * + * @internal + */ + parseInterfaceTypeExtension(): InterfaceTypeExtensionNode; + /** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + * + * @internal + */ + parseUnionTypeExtension(): UnionTypeExtensionNode; + /** + * EnumTypeExtension : + * - extend enum Name Directives[Const]? EnumValuesDefinition + * - extend enum Name Directives[Const] + * + * @internal + */ + parseEnumTypeExtension(): EnumTypeExtensionNode; + /** + * InputObjectTypeExtension : + * - extend input Name Directives[Const]? InputFieldsDefinition + * - extend input Name Directives[Const] + * + * @internal + */ + parseInputObjectTypeExtension(): InputObjectTypeExtensionNode; + parseDirectiveExtension(): DirectiveExtensionNode; + /** + * ``` + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? Directives[Const]? `repeatable`? on DirectiveLocations + * ``` + * + * @internal + */ + parseDirectiveDefinition(): DirectiveDefinitionNode; + /** + * DirectiveLocations : + * - `|`? DirectiveLocation + * - DirectiveLocations | DirectiveLocation + * + * @internal + */ + parseDirectiveLocations(): Array; + parseDirectiveLocation(): NameNode; + /** + * SchemaCoordinate : + * - Name + * - Name . Name + * - Name . Name ( Name : ) + * - @ Name + * - @ Name ( Name : ) + * + * @internal + */ + parseSchemaCoordinate(): SchemaCoordinateNode; + /** + * Returns a node that, if configured to do so, sets a "loc" field as a + * location object, used to identify the place in the source that created a + * given parsed object. + * + * @internal + */ + node(startToken: Token, node: T): T; + /** + * Determines if the next token is of a given kind + * + * @internal + */ + peek(kind: TokenKind): boolean; + /** + * If the next token is of the given kind, return that token after advancing the lexer. + * Otherwise, do not change the parser state and throw an error. + * + * @internal + */ + expectToken(kind: TokenKind): Token; + /** + * If the next token is of the given kind, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + * + * @internal + */ + expectOptionalToken(kind: TokenKind): boolean; + /** + * If the next token is a given keyword, advance the lexer. + * Otherwise, do not change the parser state and throw an error. + * + * @internal + */ + expectKeyword(value: string): void; + /** + * If the next token is a given keyword, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + * + * @internal + */ + expectOptionalKeyword(value: string): boolean; + /** + * Helper function for creating an error when an unexpected lexed token is encountered. + * + * @internal + */ + unexpected(atToken?: Maybe): GraphQLError; + /** + * Returns a possibly empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + * + * @internal + */ + any(openKind: TokenKind, parseFn: () => T, closeKind: TokenKind): Array; + /** + * Returns a list of parse nodes, determined by the parseFn. + * It can be empty only if open token is missing otherwise it will always return non-empty list + * that begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + * + * @internal + */ + optionalMany(openKind: TokenKind, parseFn: () => T, closeKind: TokenKind): Array | undefined; + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + * + * @internal + */ + many(openKind: TokenKind, parseFn: () => T, closeKind: TokenKind): Array; + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. + * Advances the parser to the next lex token after last item in the list. + * + * @internal + */ + delimitedMany(delimiterKind: TokenKind, parseFn: () => T): Array; + advanceLexer(): void; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.ts new file mode 100644 index 00000000..0088b1f9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.d.ts @@ -0,0 +1,740 @@ +/** @category Parsing */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { GraphQLError } from "../error/GraphQLError.js"; +import type { ArgumentNode, ConstArgumentNode, ConstDirectiveNode, ConstListValueNode, ConstObjectFieldNode, ConstObjectValueNode, ConstValueNode, DefinitionNode, DirectiveDefinitionNode, DirectiveExtensionNode, DirectiveNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, EnumValueDefinitionNode, FieldDefinitionNode, FieldNode, FragmentArgumentNode, FragmentDefinitionNode, FragmentSpreadNode, InlineFragmentNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ListValueNode, NamedTypeNode, NameNode, ObjectFieldNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, ObjectValueNode, OperationDefinitionNode, OperationTypeDefinitionNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SchemaCoordinateNode, SchemaDefinitionNode, SchemaExtensionNode, SelectionNode, SelectionSetNode, StringValueNode, Token, TypeNode, TypeSystemExtensionNode, UnionTypeDefinitionNode, UnionTypeExtensionNode, ValueNode, VariableDefinitionNode, VariableNode } from "./ast.js"; +import { Location, OperationTypeNode } from "./ast.js"; +import type { LexerInterface } from "./lexer.js"; +import { Source } from "./source.js"; +import { TokenKind } from "./tokenKind.js"; +/** Configuration options to control parser behavior */ +export interface ParseOptions { + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean | undefined; + /** + * Parser CPU and memory usage is linear to the number of tokens in a document + * however in extreme cases it becomes quadratic due to memory exhaustion. + * Parsing happens before validation so even invalid queries can burn lots of + * CPU time and memory. + * To prevent this you can set a maximum number of tokens allowed within a document. + */ + maxTokens?: number | undefined; + /** + * EXPERIMENTAL: + * + * If enabled, the parser will understand and parse fragment variable definitions + * and arguments on fragment spreads. Fragment variable definitions will be represented + * in the `variableDefinitions` field of the FragmentDefinitionNode. + * Fragment spread arguments will be represented in the `arguments` field of FragmentSpreadNode. + * @example + * ```graphql prettier-ignore + * { + * t { ...A(var: true) } + * } + * fragment A($var: Boolean = false) on T { + * ...B(x: $var) + * } + * ``` + */ + experimentalFragmentArguments?: boolean | undefined; + /** + * Internal parser hook for GraphQL.js entry points that need to parse a + * restricted grammar with an alternate lexer. + * @internal + */ + lexer?: LexerInterface | undefined; +} +/** + * Given a GraphQL source, parses it into a Document. + * Throws GraphQLError if a syntax error is encountered. + * @param source - A GraphQL source string or source object. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL document AST. + * @example + * ```ts + * // Parse a GraphQL document with the default parser options. + * import { parse } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * + * document.kind; // => 'Document' + * ``` + * @example + * ```ts + * // This variant enables parser options and provides an explicit lexer. + * import { Lexer, Source, parse } from 'graphql/language'; + * + * const document = parse( + * ` + * { + * t { ...A(var: true) } + * } + * fragment A($var: Boolean = false) on T { + * name + * } + * `, + * { + * experimentalFragmentArguments: true, + * maxTokens: 80, + * noLocation: true, + * }, + * ); + * const directiveDocument = parse('directive @foo @bar on FIELD'); + * const source = new Source('{ hero }'); + * const lexerDocument = parse(source, { lexer: new Lexer(source) }); + * + * document.definitions[0].kind; // => 'OperationDefinition' + * document.definitions[1].kind; // => 'FragmentDefinition' + * document.loc; // => undefined + * directiveDocument.definitions[0].kind; // => 'DirectiveDefinition' + * lexerDocument.definitions[0].kind; // => 'OperationDefinition' + * ``` + */ +export declare function parse(source: string | Source, options?: ParseOptions): DocumentNode; +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: valueFromAST(). + * @param source - A GraphQL source string or source object containing a value. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL value AST. + * @example + * ```ts + * import { parseValue } from 'graphql/language'; + * + * const value = parseValue('[42]'); + * + * value.kind; // => 'ListValue' + * ``` + */ +export declare function parseValue(source: string | Source, options?: ParseOptions): ValueNode; +/** + * Similar to parseValue(), but raises a parse error if it encounters a + * variable. The return type will be a constant value. + * @param source - A GraphQL source string or source object containing a constant value. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL constant value AST. + * @example + * ```ts + * import { parseConstValue } from 'graphql/language'; + * + * const value = parseConstValue('{ enabled: true }'); + * + * value.kind; // => 'ObjectValue' + * parseConstValue('$variable'); // throws an error + * ``` + */ +export declare function parseConstValue(source: string | Source, options?: ParseOptions): ConstValueNode; +/** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: typeFromAST(). + * @param source - A GraphQL source string or source object containing a type reference. + * @param options - Optional parser configuration. + * @returns The parsed GraphQL type AST. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * + * const type = parseType('[String!]'); + * + * type.kind; // => 'ListType' + * ``` + */ +export declare function parseType(source: string | Source, options?: ParseOptions): TypeNode; +/** + * Given a string containing a GraphQL Schema Coordinate (ex. `Type.field`), + * parse the AST for that schema coordinate. + * Throws GraphQLError if a syntax error is encountered. + * + * Consider providing the results to the utility function: + * resolveASTSchemaCoordinate(). Or calling resolveSchemaCoordinate() directly + * with an unparsed source. + * @param source - A GraphQL source string or source object containing a schema coordinate. + * @returns The parsed GraphQL schema coordinate AST. + * @example + * ```ts + * import { parseSchemaCoordinate } from 'graphql/language'; + * + * const coordinate = parseSchemaCoordinate('Query.hero'); + * + * coordinate.kind; // => 'MemberCoordinate' + * ``` + */ +export declare function parseSchemaCoordinate(source: string | Source): SchemaCoordinateNode; +/** + * This class is exported only to assist people in implementing their own parsers + * without duplicating too much code and should be used only as last resort for cases + * such as experimental syntax or if certain features could not be contributed upstream. + * + * It is still part of the internal API and is versioned, so any changes to it are never + * considered breaking changes. If you still need to support multiple versions of the + * library, please use the `versionInfo` variable for version detection. + * + * @internal + */ +export declare class Parser { + protected _options: Omit; + protected _lexer: LexerInterface; + protected _tokenCounter: number; + constructor(source: string | Source, options?: ParseOptions); + get tokenCount(): number; + /** + * Converts a name lex token into a name parse node. + * + * @internal + */ + parseName(): NameNode; + /** + * Document : Definition+ + * + * @internal + */ + parseDocument(): DocumentNode; + /** + * Definition : + * - ExecutableDefinition + * - TypeSystemDefinition + * - TypeSystemExtension + * + * ExecutableDefinition : + * - OperationDefinition + * - FragmentDefinition + * + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + * + * @internal + */ + parseDefinition(): DefinitionNode; + /** + * OperationDefinition : + * - SelectionSet + * - OperationType Name? VariableDefinitions? Directives? SelectionSet + * + * @internal + */ + parseOperationDefinition(): OperationDefinitionNode; + /** + * OperationType : one of query mutation subscription + * + * @internal + */ + parseOperationType(): OperationTypeNode; + /** + * VariableDefinitions : ( VariableDefinition+ ) + * + * @internal + */ + parseVariableDefinitions(): Array | undefined; + /** + * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? + * + * @internal + */ + parseVariableDefinition(): VariableDefinitionNode; + /** + * Variable : $ Name + * + * @internal + */ + parseVariable(): VariableNode; + /** + * ``` + * SelectionSet : { Selection+ } + * ``` + * + * @internal + */ + parseSelectionSet(): SelectionSetNode; + /** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + * + * @internal + */ + parseSelection(): SelectionNode; + /** + * Field : Alias? Name Arguments? Directives? SelectionSet? + * + * Alias : Name : + * + * @internal + */ + parseField(): FieldNode; + /** + * Arguments[Const] : ( Argument[?Const]+ ) + * + * @internal + */ + parseArguments(isConst: true): Array | undefined; + parseArguments(isConst: boolean): Array | undefined; + parseFragmentArguments(): Array | undefined; + /** + * Argument[Const] : Name : Value[?Const] + * + * @internal + */ + parseArgument(isConst: true): ConstArgumentNode; + parseArgument(isConst?: boolean): ArgumentNode; + parseConstArgument(): ConstArgumentNode; + parseFragmentArgument(): FragmentArgumentNode; + /** + * Corresponds to both FragmentSpread and InlineFragment in the spec. + * + * FragmentSpread : ... FragmentName Arguments? Directives? + * + * InlineFragment : ... TypeCondition? Directives? SelectionSet + * + * @internal + */ + parseFragment(): FragmentSpreadNode | InlineFragmentNode; + /** + * FragmentDefinition : + * - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + * + * TypeCondition : NamedType + * + * @internal + */ + parseFragmentDefinition(): FragmentDefinitionNode; + /** + * FragmentName : Name but not `on` + * + * @internal + */ + parseFragmentName(): NameNode; + /** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + * + * @internal + */ + parseValueLiteral(isConst: true): ConstValueNode; + parseValueLiteral(isConst: boolean): ValueNode; + parseConstValueLiteral(): ConstValueNode; + parseStringLiteral(): StringValueNode; + /** + * ListValue[Const] : + * - [ ] + * - [ Value[?Const]+ ] + * + * @internal + */ + parseList(isConst: true): ConstListValueNode; + parseList(isConst: boolean): ListValueNode; + /** + * ``` + * ObjectValue[Const] : + * - { } + * - { ObjectField[?Const]+ } + * ``` + * + * @internal + */ + parseObject(isConst: true): ConstObjectValueNode; + parseObject(isConst: boolean): ObjectValueNode; + /** + * ObjectField[Const] : Name : Value[?Const] + * + * @internal + */ + parseObjectField(isConst: true): ConstObjectFieldNode; + parseObjectField(isConst: boolean): ObjectFieldNode; + /** + * Directives[Const] : Directive[?Const]+ + * + * @internal + */ + parseDirectives(isConst: true): Array | undefined; + parseDirectives(isConst: boolean): Array | undefined; + parseConstDirectives(): Array | undefined; + /** + * ``` + * Directive[Const] : @ Name Arguments[?Const]? + * ``` + * + * @internal + */ + parseDirective(isConst: true): ConstDirectiveNode; + parseDirective(isConst: boolean): DirectiveNode; + /** + * Type : + * - NamedType + * - ListType + * - NonNullType + * + * @internal + */ + parseTypeReference(): TypeNode; + /** + * NamedType : Name + * + * @internal + */ + parseNamedType(): NamedTypeNode; + peekDescription(): boolean; + /** + * Description : StringValue + * + * @internal + */ + parseDescription(): undefined | StringValueNode; + /** + * ``` + * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } + * ``` + * + * @internal + */ + parseSchemaDefinition(): SchemaDefinitionNode; + /** + * OperationTypeDefinition : OperationType : NamedType + * + * @internal + */ + parseOperationTypeDefinition(): OperationTypeDefinitionNode; + /** + * ScalarTypeDefinition : Description? scalar Name Directives[Const]? + * + * @internal + */ + parseScalarTypeDefinition(): ScalarTypeDefinitionNode; + /** + * ObjectTypeDefinition : + * Description? + * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? + * + * @internal + */ + parseObjectTypeDefinition(): ObjectTypeDefinitionNode; + /** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + * + * @internal + */ + parseImplementsInterfaces(): Array | undefined; + /** + * ``` + * FieldsDefinition : { FieldDefinition+ } + * ``` + * + * @internal + */ + parseFieldsDefinition(): Array | undefined; + /** + * FieldDefinition : + * - Description? Name ArgumentsDefinition? : Type Directives[Const]? + * + * @internal + */ + parseFieldDefinition(): FieldDefinitionNode; + /** + * ArgumentsDefinition : ( InputValueDefinition+ ) + * + * @internal + */ + parseArgumentDefs(): Array | undefined; + /** + * InputValueDefinition : + * - Description? Name : Type DefaultValue? Directives[Const]? + * + * @internal + */ + parseInputValueDef(): InputValueDefinitionNode; + /** + * InterfaceTypeDefinition : + * - Description? interface Name Directives[Const]? FieldsDefinition? + * + * @internal + */ + parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode; + /** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + * + * @internal + */ + parseUnionTypeDefinition(): UnionTypeDefinitionNode; + /** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + * + * @internal + */ + parseUnionMemberTypes(): Array | undefined; + /** + * EnumTypeDefinition : + * - Description? enum Name Directives[Const]? EnumValuesDefinition? + * + * @internal + */ + parseEnumTypeDefinition(): EnumTypeDefinitionNode; + /** + * ``` + * EnumValuesDefinition : { EnumValueDefinition+ } + * ``` + * + * @internal + */ + parseEnumValuesDefinition(): Array | undefined; + /** + * EnumValueDefinition : Description? EnumValue Directives[Const]? + * + * @internal + */ + parseEnumValueDefinition(): EnumValueDefinitionNode; + /** + * EnumValue : Name but not `true`, `false` or `null` + * + * @internal + */ + parseEnumValueName(): NameNode; + /** + * InputObjectTypeDefinition : + * - Description? input Name Directives[Const]? InputFieldsDefinition? + * + * @internal + */ + parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode; + /** + * ``` + * InputFieldsDefinition : { InputValueDefinition+ } + * ``` + * + * @internal + */ + parseInputFieldsDefinition(): Array | undefined; + /** + * TypeSystemExtension : + * - SchemaExtension + * - TypeExtension + * - DirectiveExtension + * + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeExtension + * + * @internal + */ + parseTypeSystemExtension(): TypeSystemExtensionNode; + /** + * ``` + * SchemaExtension : + * - extend schema Directives[Const]? { OperationTypeDefinition+ } + * - extend schema Directives[Const] + * ``` + * + * @internal + */ + parseSchemaExtension(): SchemaExtensionNode; + /** + * ScalarTypeExtension : + * - extend scalar Name Directives[Const] + * + * @internal + */ + parseScalarTypeExtension(): ScalarTypeExtensionNode; + /** + * ObjectTypeExtension : + * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend type Name ImplementsInterfaces? Directives[Const] + * - extend type Name ImplementsInterfaces + * + * @internal + */ + parseObjectTypeExtension(): ObjectTypeExtensionNode; + /** + * InterfaceTypeExtension : + * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend interface Name ImplementsInterfaces? Directives[Const] + * - extend interface Name ImplementsInterfaces + * + * @internal + */ + parseInterfaceTypeExtension(): InterfaceTypeExtensionNode; + /** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + * + * @internal + */ + parseUnionTypeExtension(): UnionTypeExtensionNode; + /** + * EnumTypeExtension : + * - extend enum Name Directives[Const]? EnumValuesDefinition + * - extend enum Name Directives[Const] + * + * @internal + */ + parseEnumTypeExtension(): EnumTypeExtensionNode; + /** + * InputObjectTypeExtension : + * - extend input Name Directives[Const]? InputFieldsDefinition + * - extend input Name Directives[Const] + * + * @internal + */ + parseInputObjectTypeExtension(): InputObjectTypeExtensionNode; + parseDirectiveExtension(): DirectiveExtensionNode; + /** + * ``` + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? Directives[Const]? `repeatable`? on DirectiveLocations + * ``` + * + * @internal + */ + parseDirectiveDefinition(): DirectiveDefinitionNode; + /** + * DirectiveLocations : + * - `|`? DirectiveLocation + * - DirectiveLocations | DirectiveLocation + * + * @internal + */ + parseDirectiveLocations(): Array; + parseDirectiveLocation(): NameNode; + /** + * SchemaCoordinate : + * - Name + * - Name . Name + * - Name . Name ( Name : ) + * - @ Name + * - @ Name ( Name : ) + * + * @internal + */ + parseSchemaCoordinate(): SchemaCoordinateNode; + /** + * Returns a node that, if configured to do so, sets a "loc" field as a + * location object, used to identify the place in the source that created a + * given parsed object. + * + * @internal + */ + node(startToken: Token, node: T): T; + /** + * Determines if the next token is of a given kind + * + * @internal + */ + peek(kind: TokenKind): boolean; + /** + * If the next token is of the given kind, return that token after advancing the lexer. + * Otherwise, do not change the parser state and throw an error. + * + * @internal + */ + expectToken(kind: TokenKind): Token; + /** + * If the next token is of the given kind, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + * + * @internal + */ + expectOptionalToken(kind: TokenKind): boolean; + /** + * If the next token is a given keyword, advance the lexer. + * Otherwise, do not change the parser state and throw an error. + * + * @internal + */ + expectKeyword(value: string): void; + /** + * If the next token is a given keyword, return "true" after advancing the lexer. + * Otherwise, do not change the parser state and return "false". + * + * @internal + */ + expectOptionalKeyword(value: string): boolean; + /** + * Helper function for creating an error when an unexpected lexed token is encountered. + * + * @internal + */ + unexpected(atToken?: Maybe): GraphQLError; + /** + * Returns a possibly empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + * + * @internal + */ + any(openKind: TokenKind, parseFn: () => T, closeKind: TokenKind): Array; + /** + * Returns a list of parse nodes, determined by the parseFn. + * It can be empty only if open token is missing otherwise it will always return non-empty list + * that begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + * + * @internal + */ + optionalMany(openKind: TokenKind, parseFn: () => T, closeKind: TokenKind): Array | undefined; + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list begins with a lex token of openKind and ends with a lex token of closeKind. + * Advances the parser to the next lex token after the closing token. + * + * @internal + */ + many(openKind: TokenKind, parseFn: () => T, closeKind: TokenKind): Array; + /** + * Returns a non-empty list of parse nodes, determined by the parseFn. + * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. + * Advances the parser to the next lex token after last item in the list. + * + * @internal + */ + delimitedMany(delimiterKind: TokenKind, parseFn: () => T): Array; + advanceLexer(): void; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js new file mode 100644 index 00000000..a39147c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js @@ -0,0 +1,1016 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Parser = void 0; +exports.parse = parse; +exports.parseValue = parseValue; +exports.parseConstValue = parseConstValue; +exports.parseType = parseType; +exports.parseSchemaCoordinate = parseSchemaCoordinate; +const syntaxError_ts_1 = require("../error/syntaxError.js"); +const diagnostics_ts_1 = require("../diagnostics.js"); +const ast_ts_1 = require("./ast.js"); +const directiveLocation_ts_1 = require("./directiveLocation.js"); +const kinds_ts_1 = require("./kinds.js"); +const lexer_ts_1 = require("./lexer.js"); +const schemaCoordinateLexer_ts_1 = require("./schemaCoordinateLexer.js"); +const source_ts_1 = require("./source.js"); +const tokenKind_ts_1 = require("./tokenKind.js"); +function parse(source, options) { + return (0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.parseChannel) + ? diagnostics_ts_1.parseChannel.traceSync(() => parseImpl(source, options), { source }) + : parseImpl(source, options); +} +function parseImpl(source, options) { + const parser = new Parser(source, options); + const document = parser.parseDocument(); + Object.defineProperty(document, 'tokenCount', { + enumerable: false, + value: parser.tokenCount, + }); + return document; +} +function parseValue(source, options) { + const parser = new Parser(source, options); + parser.expectToken(tokenKind_ts_1.TokenKind.SOF); + const value = parser.parseValueLiteral(false); + parser.expectToken(tokenKind_ts_1.TokenKind.EOF); + return value; +} +function parseConstValue(source, options) { + const parser = new Parser(source, options); + parser.expectToken(tokenKind_ts_1.TokenKind.SOF); + const value = parser.parseConstValueLiteral(); + parser.expectToken(tokenKind_ts_1.TokenKind.EOF); + return value; +} +function parseType(source, options) { + const parser = new Parser(source, options); + parser.expectToken(tokenKind_ts_1.TokenKind.SOF); + const type = parser.parseTypeReference(); + parser.expectToken(tokenKind_ts_1.TokenKind.EOF); + return type; +} +function parseSchemaCoordinate(source) { + const sourceObj = (0, source_ts_1.isSource)(source) ? source : new source_ts_1.Source(source); + const lexer = new schemaCoordinateLexer_ts_1.SchemaCoordinateLexer(sourceObj); + const parser = new Parser(source, { lexer }); + parser.expectToken(tokenKind_ts_1.TokenKind.SOF); + const coordinate = parser.parseSchemaCoordinate(); + parser.expectToken(tokenKind_ts_1.TokenKind.EOF); + return coordinate; +} +class Parser { + constructor(source, options = {}) { + const { lexer, ..._options } = options; + if (lexer) { + this._lexer = lexer; + } + else { + const sourceObj = (0, source_ts_1.isSource)(source) ? source : new source_ts_1.Source(source); + this._lexer = new lexer_ts_1.Lexer(sourceObj); + } + this._options = _options; + this._tokenCounter = 0; + } + get tokenCount() { + return this._tokenCounter; + } + parseName() { + const token = this.expectToken(tokenKind_ts_1.TokenKind.NAME); + return this.node(token, { + kind: kinds_ts_1.Kind.NAME, + value: token.value, + }); + } + parseDocument() { + return this.node(this._lexer.token, { + kind: kinds_ts_1.Kind.DOCUMENT, + definitions: this.many(tokenKind_ts_1.TokenKind.SOF, this.parseDefinition, tokenKind_ts_1.TokenKind.EOF), + }); + } + parseDefinition() { + if (this.peek(tokenKind_ts_1.TokenKind.BRACE_L)) { + return this.parseOperationDefinition(); + } + const hasDescription = this.peekDescription(); + const keywordToken = hasDescription + ? this._lexer.lookahead() + : this._lexer.token; + if (hasDescription && keywordToken.kind === tokenKind_ts_1.TokenKind.BRACE_L) { + throw (0, syntaxError_ts_1.syntaxError)(this._lexer.source, this._lexer.token.start, 'Unexpected description, descriptions are not supported on shorthand queries.'); + } + if (keywordToken.kind === tokenKind_ts_1.TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaDefinition(); + case 'scalar': + return this.parseScalarTypeDefinition(); + case 'type': + return this.parseObjectTypeDefinition(); + case 'interface': + return this.parseInterfaceTypeDefinition(); + case 'union': + return this.parseUnionTypeDefinition(); + case 'enum': + return this.parseEnumTypeDefinition(); + case 'input': + return this.parseInputObjectTypeDefinition(); + case 'directive': + return this.parseDirectiveDefinition(); + } + switch (keywordToken.value) { + case 'query': + case 'mutation': + case 'subscription': + return this.parseOperationDefinition(); + case 'fragment': + return this.parseFragmentDefinition(); + } + if (hasDescription) { + throw (0, syntaxError_ts_1.syntaxError)(this._lexer.source, this._lexer.token.start, 'Unexpected description, only GraphQL definitions support descriptions.'); + } + switch (keywordToken.value) { + case 'extend': + return this.parseTypeSystemExtension(); + } + } + throw this.unexpected(keywordToken); + } + parseOperationDefinition() { + const start = this._lexer.token; + if (this.peek(tokenKind_ts_1.TokenKind.BRACE_L)) { + return this.node(start, { + kind: kinds_ts_1.Kind.OPERATION_DEFINITION, + operation: ast_ts_1.OperationTypeNode.QUERY, + description: undefined, + name: undefined, + variableDefinitions: undefined, + directives: undefined, + selectionSet: this.parseSelectionSet(), + }); + } + const description = this.parseDescription(); + const operation = this.parseOperationType(); + let name; + if (this.peek(tokenKind_ts_1.TokenKind.NAME)) { + name = this.parseName(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.OPERATION_DEFINITION, + operation, + description, + name, + variableDefinitions: this.parseVariableDefinitions(), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + parseOperationType() { + const operationToken = this.expectToken(tokenKind_ts_1.TokenKind.NAME); + switch (operationToken.value) { + case 'query': + return ast_ts_1.OperationTypeNode.QUERY; + case 'mutation': + return ast_ts_1.OperationTypeNode.MUTATION; + case 'subscription': + return ast_ts_1.OperationTypeNode.SUBSCRIPTION; + } + throw this.unexpected(operationToken); + } + parseVariableDefinitions() { + return this.optionalMany(tokenKind_ts_1.TokenKind.PAREN_L, this.parseVariableDefinition, tokenKind_ts_1.TokenKind.PAREN_R); + } + parseVariableDefinition() { + return this.node(this._lexer.token, { + kind: kinds_ts_1.Kind.VARIABLE_DEFINITION, + description: this.parseDescription(), + variable: this.parseVariable(), + type: (this.expectToken(tokenKind_ts_1.TokenKind.COLON), this.parseTypeReference()), + defaultValue: this.expectOptionalToken(tokenKind_ts_1.TokenKind.EQUALS) + ? this.parseConstValueLiteral() + : undefined, + directives: this.parseConstDirectives(), + }); + } + parseVariable() { + const start = this._lexer.token; + this.expectToken(tokenKind_ts_1.TokenKind.DOLLAR); + return this.node(start, { + kind: kinds_ts_1.Kind.VARIABLE, + name: this.parseName(), + }); + } + parseSelectionSet() { + return this.node(this._lexer.token, { + kind: kinds_ts_1.Kind.SELECTION_SET, + selections: this.many(tokenKind_ts_1.TokenKind.BRACE_L, this.parseSelection, tokenKind_ts_1.TokenKind.BRACE_R), + }); + } + parseSelection() { + return this.peek(tokenKind_ts_1.TokenKind.SPREAD) + ? this.parseFragment() + : this.parseField(); + } + parseField() { + const start = this._lexer.token; + const nameOrAlias = this.parseName(); + let alias; + let name; + if (this.expectOptionalToken(tokenKind_ts_1.TokenKind.COLON)) { + alias = nameOrAlias; + name = this.parseName(); + } + else { + name = nameOrAlias; + } + return this.node(start, { + kind: kinds_ts_1.Kind.FIELD, + alias, + name, + arguments: this.parseArguments(false), + directives: this.parseDirectives(false), + selectionSet: this.peek(tokenKind_ts_1.TokenKind.BRACE_L) + ? this.parseSelectionSet() + : undefined, + }); + } + parseArguments(isConst) { + const item = isConst ? this.parseConstArgument : this.parseArgument; + return this.optionalMany(tokenKind_ts_1.TokenKind.PAREN_L, item, tokenKind_ts_1.TokenKind.PAREN_R); + } + parseFragmentArguments() { + const item = this.parseFragmentArgument; + return this.optionalMany(tokenKind_ts_1.TokenKind.PAREN_L, item, tokenKind_ts_1.TokenKind.PAREN_R); + } + parseArgument(isConst = false) { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(tokenKind_ts_1.TokenKind.COLON); + return this.node(start, { + kind: kinds_ts_1.Kind.ARGUMENT, + name, + value: this.parseValueLiteral(isConst), + }); + } + parseConstArgument() { + return this.parseArgument(true); + } + parseFragmentArgument() { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(tokenKind_ts_1.TokenKind.COLON); + return this.node(start, { + kind: kinds_ts_1.Kind.FRAGMENT_ARGUMENT, + name, + value: this.parseValueLiteral(false), + }); + } + parseFragment() { + const start = this._lexer.token; + this.expectToken(tokenKind_ts_1.TokenKind.SPREAD); + const hasTypeCondition = this.expectOptionalKeyword('on'); + if (!hasTypeCondition && this.peek(tokenKind_ts_1.TokenKind.NAME)) { + const name = this.parseFragmentName(); + if (this.peek(tokenKind_ts_1.TokenKind.PAREN_L) && + this._options.experimentalFragmentArguments) { + return this.node(start, { + kind: kinds_ts_1.Kind.FRAGMENT_SPREAD, + name, + arguments: this.parseFragmentArguments(), + directives: this.parseDirectives(false), + }); + } + return this.node(start, { + kind: kinds_ts_1.Kind.FRAGMENT_SPREAD, + name, + directives: this.parseDirectives(false), + }); + } + return this.node(start, { + kind: kinds_ts_1.Kind.INLINE_FRAGMENT, + typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + parseFragmentDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('fragment'); + if (this._options.experimentalFragmentArguments === true) { + return this.node(start, { + kind: kinds_ts_1.Kind.FRAGMENT_DEFINITION, + description, + name: this.parseFragmentName(), + variableDefinitions: this.parseVariableDefinitions(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + return this.node(start, { + kind: kinds_ts_1.Kind.FRAGMENT_DEFINITION, + description, + name: this.parseFragmentName(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + parseFragmentName() { + if (this._lexer.token.value === 'on') { + throw this.unexpected(); + } + return this.parseName(); + } + parseValueLiteral(isConst) { + const token = this._lexer.token; + switch (token.kind) { + case tokenKind_ts_1.TokenKind.BRACKET_L: + return this.parseList(isConst); + case tokenKind_ts_1.TokenKind.BRACE_L: + return this.parseObject(isConst); + case tokenKind_ts_1.TokenKind.INT: + this.advanceLexer(); + return this.node(token, { + kind: kinds_ts_1.Kind.INT, + value: token.value, + }); + case tokenKind_ts_1.TokenKind.FLOAT: + this.advanceLexer(); + return this.node(token, { + kind: kinds_ts_1.Kind.FLOAT, + value: token.value, + }); + case tokenKind_ts_1.TokenKind.STRING: + case tokenKind_ts_1.TokenKind.BLOCK_STRING: + return this.parseStringLiteral(); + case tokenKind_ts_1.TokenKind.NAME: + this.advanceLexer(); + switch (token.value) { + case 'true': + return this.node(token, { + kind: kinds_ts_1.Kind.BOOLEAN, + value: true, + }); + case 'false': + return this.node(token, { + kind: kinds_ts_1.Kind.BOOLEAN, + value: false, + }); + case 'null': + return this.node(token, { kind: kinds_ts_1.Kind.NULL }); + default: + return this.node(token, { + kind: kinds_ts_1.Kind.ENUM, + value: token.value, + }); + } + case tokenKind_ts_1.TokenKind.DOLLAR: + if (isConst) { + this.expectToken(tokenKind_ts_1.TokenKind.DOLLAR); + if (this._lexer.token.kind === tokenKind_ts_1.TokenKind.NAME) { + const varName = this._lexer.token.value; + throw (0, syntaxError_ts_1.syntaxError)(this._lexer.source, token.start, `Unexpected variable "$${varName}" in constant value.`); + } + else { + throw this.unexpected(token); + } + } + return this.parseVariable(); + default: + throw this.unexpected(); + } + } + parseConstValueLiteral() { + return this.parseValueLiteral(true); + } + parseStringLiteral() { + const token = this._lexer.token; + this.advanceLexer(); + return this.node(token, { + kind: kinds_ts_1.Kind.STRING, + value: token.value, + block: token.kind === tokenKind_ts_1.TokenKind.BLOCK_STRING, + }); + } + parseList(isConst) { + const item = () => this.parseValueLiteral(isConst); + return this.node(this._lexer.token, { + kind: kinds_ts_1.Kind.LIST, + values: this.any(tokenKind_ts_1.TokenKind.BRACKET_L, item, tokenKind_ts_1.TokenKind.BRACKET_R), + }); + } + parseObject(isConst) { + const item = () => this.parseObjectField(isConst); + return this.node(this._lexer.token, { + kind: kinds_ts_1.Kind.OBJECT, + fields: this.any(tokenKind_ts_1.TokenKind.BRACE_L, item, tokenKind_ts_1.TokenKind.BRACE_R), + }); + } + parseObjectField(isConst) { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(tokenKind_ts_1.TokenKind.COLON); + return this.node(start, { + kind: kinds_ts_1.Kind.OBJECT_FIELD, + name, + value: this.parseValueLiteral(isConst), + }); + } + parseDirectives(isConst) { + const directives = []; + while (this.peek(tokenKind_ts_1.TokenKind.AT)) { + directives.push(this.parseDirective(isConst)); + } + if (directives.length) { + return directives; + } + return undefined; + } + parseConstDirectives() { + return this.parseDirectives(true); + } + parseDirective(isConst) { + const start = this._lexer.token; + this.expectToken(tokenKind_ts_1.TokenKind.AT); + return this.node(start, { + kind: kinds_ts_1.Kind.DIRECTIVE, + name: this.parseName(), + arguments: this.parseArguments(isConst), + }); + } + parseTypeReference() { + const start = this._lexer.token; + let type; + if (this.expectOptionalToken(tokenKind_ts_1.TokenKind.BRACKET_L)) { + const innerType = this.parseTypeReference(); + this.expectToken(tokenKind_ts_1.TokenKind.BRACKET_R); + type = this.node(start, { + kind: kinds_ts_1.Kind.LIST_TYPE, + type: innerType, + }); + } + else { + type = this.parseNamedType(); + } + if (this.expectOptionalToken(tokenKind_ts_1.TokenKind.BANG)) { + return this.node(start, { + kind: kinds_ts_1.Kind.NON_NULL_TYPE, + type, + }); + } + return type; + } + parseNamedType() { + return this.node(this._lexer.token, { + kind: kinds_ts_1.Kind.NAMED_TYPE, + name: this.parseName(), + }); + } + peekDescription() { + return this.peek(tokenKind_ts_1.TokenKind.STRING) || this.peek(tokenKind_ts_1.TokenKind.BLOCK_STRING); + } + parseDescription() { + if (this.peekDescription()) { + return this.parseStringLiteral(); + } + } + parseSchemaDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.many(tokenKind_ts_1.TokenKind.BRACE_L, this.parseOperationTypeDefinition, tokenKind_ts_1.TokenKind.BRACE_R); + return this.node(start, { + kind: kinds_ts_1.Kind.SCHEMA_DEFINITION, + description, + directives, + operationTypes, + }); + } + parseOperationTypeDefinition() { + const start = this._lexer.token; + const operation = this.parseOperationType(); + this.expectToken(tokenKind_ts_1.TokenKind.COLON); + const type = this.parseNamedType(); + return this.node(start, { + kind: kinds_ts_1.Kind.OPERATION_TYPE_DEFINITION, + operation, + type, + }); + } + parseScalarTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: kinds_ts_1.Kind.SCALAR_TYPE_DEFINITION, + description, + name, + directives, + }); + } + parseObjectTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: kinds_ts_1.Kind.OBJECT_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields, + }); + } + parseImplementsInterfaces() { + return this.expectOptionalKeyword('implements') + ? this.delimitedMany(tokenKind_ts_1.TokenKind.AMP, this.parseNamedType) + : undefined; + } + parseFieldsDefinition() { + return this.optionalMany(tokenKind_ts_1.TokenKind.BRACE_L, this.parseFieldDefinition, tokenKind_ts_1.TokenKind.BRACE_R); + } + parseFieldDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + this.expectToken(tokenKind_ts_1.TokenKind.COLON); + const type = this.parseTypeReference(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: kinds_ts_1.Kind.FIELD_DEFINITION, + description, + name, + arguments: args, + type, + directives, + }); + } + parseArgumentDefs() { + return this.optionalMany(tokenKind_ts_1.TokenKind.PAREN_L, this.parseInputValueDef, tokenKind_ts_1.TokenKind.PAREN_R); + } + parseInputValueDef() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + this.expectToken(tokenKind_ts_1.TokenKind.COLON); + const type = this.parseTypeReference(); + let defaultValue; + if (this.expectOptionalToken(tokenKind_ts_1.TokenKind.EQUALS)) { + defaultValue = this.parseConstValueLiteral(); + } + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: kinds_ts_1.Kind.INPUT_VALUE_DEFINITION, + description, + name, + type, + defaultValue, + directives, + }); + } + parseInterfaceTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: kinds_ts_1.Kind.INTERFACE_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields, + }); + } + parseUnionTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + return this.node(start, { + kind: kinds_ts_1.Kind.UNION_TYPE_DEFINITION, + description, + name, + directives, + types, + }); + } + parseUnionMemberTypes() { + return this.expectOptionalToken(tokenKind_ts_1.TokenKind.EQUALS) + ? this.delimitedMany(tokenKind_ts_1.TokenKind.PIPE, this.parseNamedType) + : undefined; + } + parseEnumTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + return this.node(start, { + kind: kinds_ts_1.Kind.ENUM_TYPE_DEFINITION, + description, + name, + directives, + values, + }); + } + parseEnumValuesDefinition() { + return this.optionalMany(tokenKind_ts_1.TokenKind.BRACE_L, this.parseEnumValueDefinition, tokenKind_ts_1.TokenKind.BRACE_R); + } + parseEnumValueDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseEnumValueName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: kinds_ts_1.Kind.ENUM_VALUE_DEFINITION, + description, + name, + directives, + }); + } + parseEnumValueName() { + if (this._lexer.token.value === 'true' || + this._lexer.token.value === 'false' || + this._lexer.token.value === 'null') { + throw (0, syntaxError_ts_1.syntaxError)(this._lexer.source, this._lexer.token.start, `${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`); + } + return this.parseName(); + } + parseInputObjectTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + return this.node(start, { + kind: kinds_ts_1.Kind.INPUT_OBJECT_TYPE_DEFINITION, + description, + name, + directives, + fields, + }); + } + parseInputFieldsDefinition() { + return this.optionalMany(tokenKind_ts_1.TokenKind.BRACE_L, this.parseInputValueDef, tokenKind_ts_1.TokenKind.BRACE_R); + } + parseTypeSystemExtension() { + const keywordToken = this._lexer.lookahead(); + if (keywordToken.kind === tokenKind_ts_1.TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaExtension(); + case 'scalar': + return this.parseScalarTypeExtension(); + case 'type': + return this.parseObjectTypeExtension(); + case 'interface': + return this.parseInterfaceTypeExtension(); + case 'union': + return this.parseUnionTypeExtension(); + case 'enum': + return this.parseEnumTypeExtension(); + case 'input': + return this.parseInputObjectTypeExtension(); + case 'directive': + return this.parseDirectiveExtension(); + } + } + throw this.unexpected(keywordToken); + } + parseSchemaExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.optionalMany(tokenKind_ts_1.TokenKind.BRACE_L, this.parseOperationTypeDefinition, tokenKind_ts_1.TokenKind.BRACE_R); + if (directives === undefined && operationTypes === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.SCHEMA_EXTENSION, + directives, + operationTypes, + }); + } + parseScalarTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + if (directives === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.SCALAR_TYPE_EXTENSION, + name, + directives, + }); + } + parseObjectTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if (interfaces === undefined && + directives === undefined && + fields === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.OBJECT_TYPE_EXTENSION, + name, + interfaces, + directives, + fields, + }); + } + parseInterfaceTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if (interfaces === undefined && + directives === undefined && + fields === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.INTERFACE_TYPE_EXTENSION, + name, + interfaces, + directives, + fields, + }); + } + parseUnionTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + if (directives === undefined && types === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.UNION_TYPE_EXTENSION, + name, + directives, + types, + }); + } + parseEnumTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + if (directives === undefined && values === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.ENUM_TYPE_EXTENSION, + name, + directives, + values, + }); + } + parseInputObjectTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + if (directives === undefined && fields === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION, + name, + directives, + fields, + }); + } + parseDirectiveExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('directive'); + this.expectToken(tokenKind_ts_1.TokenKind.AT); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + if (directives === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: kinds_ts_1.Kind.DIRECTIVE_EXTENSION, + name, + directives, + }); + } + parseDirectiveDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('directive'); + this.expectToken(tokenKind_ts_1.TokenKind.AT); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + const directives = this.parseConstDirectives(); + const repeatable = this.expectOptionalKeyword('repeatable'); + this.expectKeyword('on'); + const locations = this.parseDirectiveLocations(); + return this.node(start, { + kind: kinds_ts_1.Kind.DIRECTIVE_DEFINITION, + description, + name, + arguments: args, + directives, + repeatable, + locations, + }); + } + parseDirectiveLocations() { + return this.delimitedMany(tokenKind_ts_1.TokenKind.PIPE, this.parseDirectiveLocation); + } + parseDirectiveLocation() { + const start = this._lexer.token; + const name = this.parseName(); + if (Object.hasOwn(directiveLocation_ts_1.DirectiveLocation, name.value)) { + return name; + } + throw this.unexpected(start); + } + parseSchemaCoordinate() { + const start = this._lexer.token; + const ofDirective = this.expectOptionalToken(tokenKind_ts_1.TokenKind.AT); + const name = this.parseName(); + let memberName; + if (!ofDirective && this.expectOptionalToken(tokenKind_ts_1.TokenKind.DOT)) { + memberName = this.parseName(); + } + let argumentName; + if ((ofDirective || memberName) && + this.expectOptionalToken(tokenKind_ts_1.TokenKind.PAREN_L)) { + argumentName = this.parseName(); + this.expectToken(tokenKind_ts_1.TokenKind.COLON); + this.expectToken(tokenKind_ts_1.TokenKind.PAREN_R); + } + if (ofDirective) { + if (argumentName) { + return this.node(start, { + kind: kinds_ts_1.Kind.DIRECTIVE_ARGUMENT_COORDINATE, + name, + argumentName, + }); + } + return this.node(start, { + kind: kinds_ts_1.Kind.DIRECTIVE_COORDINATE, + name, + }); + } + else if (memberName) { + if (argumentName) { + return this.node(start, { + kind: kinds_ts_1.Kind.ARGUMENT_COORDINATE, + name, + fieldName: memberName, + argumentName, + }); + } + return this.node(start, { + kind: kinds_ts_1.Kind.MEMBER_COORDINATE, + name, + memberName, + }); + } + return this.node(start, { + kind: kinds_ts_1.Kind.TYPE_COORDINATE, + name, + }); + } + node(startToken, node) { + if (this._options.noLocation !== true) { + node.loc = new ast_ts_1.Location(startToken, this._lexer.lastToken, this._lexer.source); + } + return node; + } + peek(kind) { + return this._lexer.token.kind === kind; + } + expectToken(kind) { + const token = this._lexer.token; + if (token.kind === kind) { + this.advanceLexer(); + return token; + } + throw (0, syntaxError_ts_1.syntaxError)(this._lexer.source, token.start, `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`); + } + expectOptionalToken(kind) { + const token = this._lexer.token; + if (token.kind === kind) { + this.advanceLexer(); + return true; + } + return false; + } + expectKeyword(value) { + const token = this._lexer.token; + if (token.kind === tokenKind_ts_1.TokenKind.NAME && token.value === value) { + this.advanceLexer(); + } + else { + throw (0, syntaxError_ts_1.syntaxError)(this._lexer.source, token.start, `Expected "${value}", found ${getTokenDesc(token)}.`); + } + } + expectOptionalKeyword(value) { + const token = this._lexer.token; + if (token.kind === tokenKind_ts_1.TokenKind.NAME && token.value === value) { + this.advanceLexer(); + return true; + } + return false; + } + unexpected(atToken) { + const token = atToken ?? this._lexer.token; + return (0, syntaxError_ts_1.syntaxError)(this._lexer.source, token.start, `Unexpected ${getTokenDesc(token)}.`); + } + any(openKind, parseFn, closeKind) { + this.expectToken(openKind); + const nodes = []; + while (!this.expectOptionalToken(closeKind)) { + nodes.push(parseFn.call(this)); + } + return nodes; + } + optionalMany(openKind, parseFn, closeKind) { + if (this.expectOptionalToken(openKind)) { + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + return undefined; + } + many(openKind, parseFn, closeKind) { + this.expectToken(openKind); + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + delimitedMany(delimiterKind, parseFn) { + this.expectOptionalToken(delimiterKind); + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (this.expectOptionalToken(delimiterKind)); + return nodes; + } + advanceLexer() { + const { maxTokens } = this._options; + const token = this._lexer.advance(); + if (token.kind !== tokenKind_ts_1.TokenKind.EOF) { + ++this._tokenCounter; + if (maxTokens !== undefined && this._tokenCounter > maxTokens) { + throw (0, syntaxError_ts_1.syntaxError)(this._lexer.source, token.start, `Document contains more than ${maxTokens} tokens. Parsing aborted.`); + } + } + } +} +exports.Parser = Parser; +function getTokenDesc(token) { + const value = token.value; + return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ''); +} +function getTokenKindDesc(kind) { + return (0, lexer_ts_1.isPunctuatorTokenKind)(kind) ? `"${kind}"` : kind; +} +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js.map new file mode 100644 index 00000000..a5ae0b07 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/language/parser.ts"],"names":[],"mappings":";;;AA8KA,sBAOC;AAoCD,gCASC;AAkBD,0CASC;AAuBD,8BASC;AAqBD,sDAUC;AAvTD,4DAAsD;AAEtD,sDAA8D;AAmE9D,qCAAuD;AACvD,iEAA2D;AAC3D,yCAAkC;AAElC,yCAA0D;AAC1D,yEAAmE;AACnE,2CAA+C;AAC/C,iDAA2C;AA6F3C,SAAgB,KAAK,CACnB,MAAuB,EACvB,OAAsB;IAEtB,OAAO,IAAA,4BAAW,EAAC,6BAAY,CAAC;QAC9B,CAAC,CAAC,6BAAY,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QACtE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,SAAS,CAChB,MAAuB,EACvB,OAAiC;IAEjC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;IACxC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,YAAY,EAAE;QAC5C,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,MAAM,CAAC,UAAU;KACzB,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAuBD,SAAgB,UAAU,CACxB,MAAuB,EACvB,OAAsB;IAEtB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,WAAW,CAAC,wBAAS,CAAC,GA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AC;CACF;AApoDD,wBAooDC;AAOD,SAAS,YAAY,CAAC,KAAY;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC7E,CAAC;AAOD,SAAS,gBAAgB,CAAC,IAAe;IACvC,OAAO,IAAA,gCAAqB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC","sourcesContent":["/** @category Parsing */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { GraphQLError } from '../error/GraphQLError.ts';\nimport { syntaxError } from '../error/syntaxError.ts';\n\nimport { parseChannel, shouldTrace } from '../diagnostics.ts';\n\nimport type {\n ArgumentCoordinateNode,\n ArgumentNode,\n BooleanValueNode,\n ConstArgumentNode,\n ConstDirectiveNode,\n ConstListValueNode,\n ConstObjectFieldNode,\n ConstObjectValueNode,\n ConstValueNode,\n DefinitionNode,\n DirectiveArgumentCoordinateNode,\n DirectiveCoordinateNode,\n DirectiveDefinitionNode,\n DirectiveExtensionNode,\n DirectiveNode,\n DocumentNode,\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n EnumValueDefinitionNode,\n EnumValueNode,\n FieldDefinitionNode,\n FieldNode,\n FloatValueNode,\n FragmentArgumentNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n InputObjectTypeDefinitionNode,\n InputObjectTypeExtensionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n IntValueNode,\n ListTypeNode,\n ListValueNode,\n MemberCoordinateNode,\n NamedTypeNode,\n NameNode,\n NonNullTypeNode,\n NullValueNode,\n ObjectFieldNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n ObjectValueNode,\n OperationDefinitionNode,\n OperationTypeDefinitionNode,\n ScalarTypeDefinitionNode,\n ScalarTypeExtensionNode,\n SchemaCoordinateNode,\n SchemaDefinitionNode,\n SchemaExtensionNode,\n SelectionNode,\n SelectionSetNode,\n StringValueNode,\n Token,\n TypeCoordinateNode,\n TypeNode,\n TypeSystemExtensionNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n ValueNode,\n VariableDefinitionNode,\n VariableNode,\n} from './ast.ts';\nimport { Location, OperationTypeNode } from './ast.ts';\nimport { DirectiveLocation } from './directiveLocation.ts';\nimport { Kind } from './kinds.ts';\nimport type { LexerInterface } from './lexer.ts';\nimport { isPunctuatorTokenKind, Lexer } from './lexer.ts';\nimport { SchemaCoordinateLexer } from './schemaCoordinateLexer.ts';\nimport { isSource, Source } from './source.ts';\nimport { TokenKind } from './tokenKind.ts';\n\n/** Configuration options to control parser behavior */\nexport interface ParseOptions {\n /**\n * By default, the parser creates AST nodes that know the location\n * in the source that they correspond to. This configuration flag\n * disables that behavior for performance or testing.\n */\n noLocation?: boolean | undefined;\n\n /**\n * Parser CPU and memory usage is linear to the number of tokens in a document\n * however in extreme cases it becomes quadratic due to memory exhaustion.\n * Parsing happens before validation so even invalid queries can burn lots of\n * CPU time and memory.\n * To prevent this you can set a maximum number of tokens allowed within a document.\n */\n maxTokens?: number | undefined;\n\n /**\n * EXPERIMENTAL:\n *\n * If enabled, the parser will understand and parse fragment variable definitions\n * and arguments on fragment spreads. Fragment variable definitions will be represented\n * in the `variableDefinitions` field of the FragmentDefinitionNode.\n * Fragment spread arguments will be represented in the `arguments` field of FragmentSpreadNode.\n * @example\n * ```graphql prettier-ignore\n * {\n * t { ...A(var: true) }\n * }\n * fragment A($var: Boolean = false) on T {\n * ...B(x: $var)\n * }\n * ```\n */\n experimentalFragmentArguments?: boolean | undefined;\n\n /**\n * Internal parser hook for GraphQL.js entry points that need to parse a\n * restricted grammar with an alternate lexer.\n * @internal\n */\n lexer?: LexerInterface | undefined;\n}\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n * @param source - A GraphQL source string or source object.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL document AST.\n * @example\n * ```ts\n * // Parse a GraphQL document with the default parser options.\n * import { parse } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n *\n * document.kind; // => 'Document'\n * ```\n * @example\n * ```ts\n * // This variant enables parser options and provides an explicit lexer.\n * import { Lexer, Source, parse } from 'graphql/language';\n *\n * const document = parse(\n * `\n * {\n * t { ...A(var: true) }\n * }\n * fragment A($var: Boolean = false) on T {\n * name\n * }\n * `,\n * {\n * experimentalFragmentArguments: true,\n * maxTokens: 80,\n * noLocation: true,\n * },\n * );\n * const directiveDocument = parse('directive @foo @bar on FIELD');\n * const source = new Source('{ hero }');\n * const lexerDocument = parse(source, { lexer: new Lexer(source) });\n *\n * document.definitions[0].kind; // => 'OperationDefinition'\n * document.definitions[1].kind; // => 'FragmentDefinition'\n * document.loc; // => undefined\n * directiveDocument.definitions[0].kind; // => 'DirectiveDefinition'\n * lexerDocument.definitions[0].kind; // => 'OperationDefinition'\n * ```\n */\nexport function parse(\n source: string | Source,\n options?: ParseOptions,\n): DocumentNode {\n return shouldTrace(parseChannel)\n ? parseChannel.traceSync(() => parseImpl(source, options), { source })\n : parseImpl(source, options);\n}\n\nfunction parseImpl(\n source: string | Source,\n options: ParseOptions | undefined,\n): DocumentNode {\n const parser = new Parser(source, options);\n const document = parser.parseDocument();\n Object.defineProperty(document, 'tokenCount', {\n enumerable: false,\n value: parser.tokenCount,\n });\n return document;\n}\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n * @param source - A GraphQL source string or source object containing a value.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL value AST.\n * @example\n * ```ts\n * import { parseValue } from 'graphql/language';\n *\n * const value = parseValue('[42]');\n *\n * value.kind; // => 'ListValue'\n * ```\n */\nexport function parseValue(\n source: string | Source,\n options?: ParseOptions,\n): ValueNode {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n\n/**\n * Similar to parseValue(), but raises a parse error if it encounters a\n * variable. The return type will be a constant value.\n * @param source - A GraphQL source string or source object containing a constant value.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL constant value AST.\n * @example\n * ```ts\n * import { parseConstValue } from 'graphql/language';\n *\n * const value = parseConstValue('{ enabled: true }');\n *\n * value.kind; // => 'ObjectValue'\n * parseConstValue('$variable'); // throws an error\n * ```\n */\nexport function parseConstValue(\n source: string | Source,\n options?: ParseOptions,\n): ConstValueNode {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseConstValueLiteral();\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n * @param source - A GraphQL source string or source object containing a type reference.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL type AST.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n *\n * const type = parseType('[String!]');\n *\n * type.kind; // => 'ListType'\n * ```\n */\nexport function parseType(\n source: string | Source,\n options?: ParseOptions,\n): TypeNode {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n\n/**\n * Given a string containing a GraphQL Schema Coordinate (ex. `Type.field`),\n * parse the AST for that schema coordinate.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * Consider providing the results to the utility function:\n * resolveASTSchemaCoordinate(). Or calling resolveSchemaCoordinate() directly\n * with an unparsed source.\n * @param source - A GraphQL source string or source object containing a schema coordinate.\n * @returns The parsed GraphQL schema coordinate AST.\n * @example\n * ```ts\n * import { parseSchemaCoordinate } from 'graphql/language';\n *\n * const coordinate = parseSchemaCoordinate('Query.hero');\n *\n * coordinate.kind; // => 'MemberCoordinate'\n * ```\n */\nexport function parseSchemaCoordinate(\n source: string | Source,\n): SchemaCoordinateNode {\n const sourceObj = isSource(source) ? source : new Source(source);\n const lexer = new SchemaCoordinateLexer(sourceObj);\n const parser = new Parser(source, { lexer });\n parser.expectToken(TokenKind.SOF);\n const coordinate = parser.parseSchemaCoordinate();\n parser.expectToken(TokenKind.EOF);\n return coordinate;\n}\n\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\nexport class Parser {\n protected _options: Omit;\n protected _lexer: LexerInterface;\n protected _tokenCounter: number;\n\n constructor(source: string | Source, options: ParseOptions = {}) {\n const { lexer, ..._options } = options;\n\n if (lexer) {\n this._lexer = lexer;\n } else {\n const sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n }\n\n this._options = _options;\n this._tokenCounter = 0;\n }\n\n get tokenCount(): number {\n return this._tokenCounter;\n }\n\n /**\n * Converts a name lex token into a name parse node.\n *\n * @internal\n */\n parseName(): NameNode {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n }\n\n // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n *\n * @internal\n */\n parseDocument(): DocumentNode {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }\n\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n *\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n *\n * @internal\n */\n parseDefinition(): DefinitionNode {\n if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n }\n\n // Many definitions begin with a description and require a lookahead.\n const hasDescription = this.peekDescription();\n const keywordToken = hasDescription\n ? this._lexer.lookahead()\n : this._lexer.token;\n\n if (hasDescription && keywordToken.kind === TokenKind.BRACE_L) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, descriptions are not supported on shorthand queries.',\n );\n }\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n case 'scalar':\n return this.parseScalarTypeDefinition();\n case 'type':\n return this.parseObjectTypeDefinition();\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n case 'union':\n return this.parseUnionTypeDefinition();\n case 'enum':\n return this.parseEnumTypeDefinition();\n case 'input':\n return this.parseInputObjectTypeDefinition();\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n\n switch (keywordToken.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n case 'fragment':\n return this.parseFragmentDefinition();\n }\n\n if (hasDescription) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, only GraphQL definitions support descriptions.',\n );\n }\n\n switch (keywordToken.value) {\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n\n // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n *\n * @internal\n */\n parseOperationDefinition(): OperationDefinitionNode {\n const start = this._lexer.token;\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n description: undefined,\n name: undefined,\n variableDefinitions: undefined,\n directives: undefined,\n selectionSet: this.parseSelectionSet(),\n });\n }\n const description = this.parseDescription();\n const operation = this.parseOperationType();\n let name;\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation,\n description,\n name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n /**\n * OperationType : one of query mutation subscription\n *\n * @internal\n */\n parseOperationType(): OperationTypeNode {\n const operationToken = this.expectToken(TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n case 'mutation':\n return OperationTypeNode.MUTATION;\n case 'subscription':\n return OperationTypeNode.SUBSCRIPTION;\n }\n\n throw this.unexpected(operationToken);\n }\n\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n *\n * @internal\n */\n parseVariableDefinitions(): Array | undefined {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }\n\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n *\n * @internal\n */\n parseVariableDefinition(): VariableDefinitionNode {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n description: this.parseDescription(),\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseConstValueLiteral()\n : undefined,\n directives: this.parseConstDirectives(),\n });\n }\n\n /**\n * Variable : $ Name\n *\n * @internal\n */\n parseVariable(): VariableNode {\n const start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return this.node(start, {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n });\n }\n\n /**\n * ```\n * SelectionSet : { Selection+ }\n * ```\n *\n * @internal\n */\n parseSelectionSet(): SelectionSetNode {\n return this.node(this._lexer.token, {\n kind: Kind.SELECTION_SET,\n selections: this.many(\n TokenKind.BRACE_L,\n this.parseSelection,\n TokenKind.BRACE_R,\n ),\n });\n }\n\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n *\n * @internal\n */\n parseSelection(): SelectionNode {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }\n\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n *\n * @internal\n */\n parseField(): FieldNode {\n const start = this._lexer.token;\n\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }\n\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n *\n * @internal\n */\n parseArguments(isConst: true): Array | undefined;\n parseArguments(isConst: boolean): Array | undefined;\n parseArguments(isConst: boolean): Array | undefined {\n const item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n\n /* experimental */\n parseFragmentArguments(): Array | undefined {\n const item = this.parseFragmentArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n\n /**\n * Argument[Const] : Name : Value[?Const]\n *\n * @internal\n */\n parseArgument(isConst: true): ConstArgumentNode;\n parseArgument(isConst?: boolean): ArgumentNode;\n parseArgument(isConst: boolean = false): ArgumentNode {\n const start = this._lexer.token;\n const name = this.parseName();\n\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n parseConstArgument(): ConstArgumentNode {\n return this.parseArgument(true);\n }\n\n /* experimental */\n parseFragmentArgument(): FragmentArgumentNode {\n const start = this._lexer.token;\n const name = this.parseName();\n\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.FRAGMENT_ARGUMENT,\n name,\n value: this.parseValueLiteral(false),\n });\n }\n\n // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Arguments? Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n *\n * @internal\n */\n parseFragment(): FragmentSpreadNode | InlineFragmentNode {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n\n const hasTypeCondition = this.expectOptionalKeyword('on');\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n const name = this.parseFragmentName();\n if (\n this.peek(TokenKind.PAREN_L) &&\n this._options.experimentalFragmentArguments\n ) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name,\n arguments: this.parseFragmentArguments(),\n directives: this.parseDirectives(false),\n });\n }\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name,\n directives: this.parseDirectives(false),\n });\n }\n return this.node(start, {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n /**\n * FragmentDefinition :\n * - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n *\n * @internal\n */\n parseFragmentDefinition(): FragmentDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('fragment');\n if (this._options.experimentalFragmentArguments === true) {\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n description,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n description,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n /**\n * FragmentName : Name but not `on`\n *\n * @internal\n */\n parseFragmentName(): NameNode {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n return this.parseName();\n }\n\n // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n *\n * @internal\n */\n parseValueLiteral(isConst: true): ConstValueNode;\n parseValueLiteral(isConst: boolean): ValueNode;\n parseValueLiteral(isConst: boolean): ValueNode {\n const token = this._lexer.token;\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n case TokenKind.INT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n case TokenKind.FLOAT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n case TokenKind.NAME:\n this.advanceLexer();\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n case 'null':\n return this.node(token, { kind: Kind.NULL });\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n return this.parseVariable();\n default:\n throw this.unexpected();\n }\n }\n\n parseConstValueLiteral(): ConstValueNode {\n return this.parseValueLiteral(true);\n }\n\n parseStringLiteral(): StringValueNode {\n const token = this._lexer.token;\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n });\n }\n\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n *\n * @internal\n */\n parseList(isConst: true): ConstListValueNode;\n parseList(isConst: boolean): ListValueNode;\n parseList(isConst: boolean): ListValueNode {\n const item = () => this.parseValueLiteral(isConst);\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }\n\n /**\n * ```\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n * ```\n *\n * @internal\n */\n parseObject(isConst: true): ConstObjectValueNode;\n parseObject(isConst: boolean): ObjectValueNode;\n parseObject(isConst: boolean): ObjectValueNode {\n const item = () => this.parseObjectField(isConst);\n return this.node(this._lexer.token, {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n });\n }\n\n /**\n * ObjectField[Const] : Name : Value[?Const]\n *\n * @internal\n */\n parseObjectField(isConst: true): ConstObjectFieldNode;\n parseObjectField(isConst: boolean): ObjectFieldNode;\n parseObjectField(isConst: boolean): ObjectFieldNode {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.OBJECT_FIELD,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n *\n * @internal\n */\n parseDirectives(isConst: true): Array | undefined;\n parseDirectives(isConst: boolean): Array | undefined;\n parseDirectives(isConst: boolean): Array | undefined {\n const directives = [];\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n if (directives.length) {\n return directives;\n }\n return undefined;\n }\n\n parseConstDirectives(): Array | undefined {\n return this.parseDirectives(true);\n }\n\n /**\n * ```\n * Directive[Const] : @ Name Arguments[?Const]?\n * ```\n *\n * @internal\n */\n parseDirective(isConst: true): ConstDirectiveNode;\n parseDirective(isConst: boolean): DirectiveNode;\n parseDirective(isConst: boolean): DirectiveNode {\n const start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return this.node(start, {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n });\n }\n\n // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n *\n * @internal\n */\n parseTypeReference(): TypeNode {\n const start = this._lexer.token;\n let type;\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n const innerType = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = this.node(start, {\n kind: Kind.LIST_TYPE,\n type: innerType,\n });\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return this.node(start, {\n kind: Kind.NON_NULL_TYPE,\n type,\n });\n }\n\n return type;\n }\n\n /**\n * NamedType : Name\n *\n * @internal\n */\n parseNamedType(): NamedTypeNode {\n return this.node(this._lexer.token, {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n });\n }\n\n // Implements the parsing rules in the Type Definition section.\n\n peekDescription(): boolean {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n\n /**\n * Description : StringValue\n *\n * @internal\n */\n parseDescription(): undefined | StringValueNode {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n\n /**\n * ```\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n * ```\n *\n * @internal\n */\n parseSchemaDefinition(): SchemaDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.many(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n return this.node(start, {\n kind: Kind.SCHEMA_DEFINITION,\n description,\n directives,\n operationTypes,\n });\n }\n\n /**\n * OperationTypeDefinition : OperationType : NamedType\n *\n * @internal\n */\n parseOperationTypeDefinition(): OperationTypeDefinitionNode {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n });\n }\n\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n *\n * @internal\n */\n parseScalarTypeDefinition(): ScalarTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n *\n * @internal\n */\n parseObjectTypeDefinition(): ObjectTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n *\n * @internal\n */\n parseImplementsInterfaces(): Array | undefined {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : undefined;\n }\n\n /**\n * ```\n * FieldsDefinition : { FieldDefinition+ }\n * ```\n *\n * @internal\n */\n parseFieldsDefinition(): Array | undefined {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseFieldDefinition,\n TokenKind.BRACE_R,\n );\n }\n\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n *\n * @internal\n */\n parseFieldDefinition(): FieldDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }\n\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n *\n * @internal\n */\n parseArgumentDefs(): Array | undefined {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }\n\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n *\n * @internal\n */\n parseInputValueDef(): InputValueDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseConstValueLiteral();\n }\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description,\n name,\n type,\n defaultValue,\n directives,\n });\n }\n\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n *\n * @internal\n */\n parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n *\n * @internal\n */\n parseUnionTypeDefinition(): UnionTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }\n\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n *\n * @internal\n */\n parseUnionMemberTypes(): Array | undefined {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : undefined;\n }\n\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n *\n * @internal\n */\n parseEnumTypeDefinition(): EnumTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(start, {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description,\n name,\n directives,\n values,\n });\n }\n\n /**\n * ```\n * EnumValuesDefinition : { EnumValueDefinition+ }\n * ```\n *\n * @internal\n */\n parseEnumValuesDefinition(): Array | undefined {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseEnumValueDefinition,\n TokenKind.BRACE_R,\n );\n }\n\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * @internal\n */\n parseEnumValueDefinition(): EnumValueDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n\n /**\n * EnumValue : Name but not `true`, `false` or `null`\n *\n * @internal\n */\n parseEnumValueName(): NameNode {\n if (\n this._lexer.token.value === 'true' ||\n this._lexer.token.value === 'false' ||\n this._lexer.token.value === 'null'\n ) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this._lexer.token,\n )} is reserved and cannot be used for an enum value.`,\n );\n }\n return this.parseName();\n }\n\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n *\n * @internal\n */\n parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }\n\n /**\n * ```\n * InputFieldsDefinition : { InputValueDefinition+ }\n * ```\n *\n * @internal\n */\n parseInputFieldsDefinition(): Array | undefined {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseInputValueDef,\n TokenKind.BRACE_R,\n );\n }\n\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n * - DirectiveExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeExtension\n *\n * @internal\n */\n parseTypeSystemExtension(): TypeSystemExtensionNode {\n const keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n case 'scalar':\n return this.parseScalarTypeExtension();\n case 'type':\n return this.parseObjectTypeExtension();\n case 'interface':\n return this.parseInterfaceTypeExtension();\n case 'union':\n return this.parseUnionTypeExtension();\n case 'enum':\n return this.parseEnumTypeExtension();\n case 'input':\n return this.parseInputObjectTypeExtension();\n case 'directive':\n return this.parseDirectiveExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n\n /**\n * ```\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n * ```\n *\n * @internal\n */\n parseSchemaExtension(): SchemaExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.optionalMany(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n if (directives === undefined && operationTypes === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.SCHEMA_EXTENSION,\n directives,\n operationTypes,\n });\n }\n\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n *\n * @internal\n */\n parseScalarTypeExtension(): ScalarTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n if (directives === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name,\n directives,\n });\n }\n\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n *\n * @internal\n */\n parseObjectTypeExtension(): ObjectTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n if (\n interfaces === undefined &&\n directives === undefined &&\n fields === undefined\n ) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n *\n * @internal\n */\n parseInterfaceTypeExtension(): InterfaceTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n if (\n interfaces === undefined &&\n directives === undefined &&\n fields === undefined\n ) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n *\n * @internal\n */\n parseUnionTypeExtension(): UnionTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n if (directives === undefined && types === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.UNION_TYPE_EXTENSION,\n name,\n directives,\n types,\n });\n }\n\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n *\n * @internal\n */\n parseEnumTypeExtension(): EnumTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n if (directives === undefined && values === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name,\n directives,\n values,\n });\n }\n\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n *\n * @internal\n */\n parseInputObjectTypeExtension(): InputObjectTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n if (directives === undefined && fields === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name,\n directives,\n fields,\n });\n }\n\n parseDirectiveExtension(): DirectiveExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n if (directives === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.DIRECTIVE_EXTENSION,\n name,\n directives,\n });\n }\n\n /**\n * ```\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? Directives[Const]? `repeatable`? on DirectiveLocations\n * ```\n *\n * @internal\n */\n parseDirectiveDefinition(): DirectiveDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n const directives = this.parseConstDirectives();\n const repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n const locations = this.parseDirectiveLocations();\n return this.node(start, {\n kind: Kind.DIRECTIVE_DEFINITION,\n description,\n name,\n arguments: args,\n directives,\n repeatable,\n locations,\n });\n }\n\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n *\n * @internal\n */\n parseDirectiveLocations(): Array {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n * `VARIABLE_DEFINITION`\n * `FRAGMENT_VARIABLE_DEFINITION`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n * `DIRECTIVE_DEFINITION`\n */\n parseDirectiveLocation(): NameNode {\n const start = this._lexer.token;\n const name = this.parseName();\n if (Object.hasOwn(DirectiveLocation, name.value)) {\n return name;\n }\n throw this.unexpected(start);\n }\n\n // Implements the parsing rules in the Schema Coordinates section.\n\n /**\n * SchemaCoordinate :\n * - Name\n * - Name . Name\n * - Name . Name ( Name : )\n * - @ Name\n * - @ Name ( Name : )\n *\n * @internal\n */\n parseSchemaCoordinate(): SchemaCoordinateNode {\n const start = this._lexer.token;\n const ofDirective = this.expectOptionalToken(TokenKind.AT);\n const name = this.parseName();\n let memberName: NameNode | undefined;\n if (!ofDirective && this.expectOptionalToken(TokenKind.DOT)) {\n memberName = this.parseName();\n }\n let argumentName: NameNode | undefined;\n if (\n (ofDirective || memberName) &&\n this.expectOptionalToken(TokenKind.PAREN_L)\n ) {\n argumentName = this.parseName();\n this.expectToken(TokenKind.COLON);\n this.expectToken(TokenKind.PAREN_R);\n }\n\n if (ofDirective) {\n if (argumentName) {\n return this.node(start, {\n kind: Kind.DIRECTIVE_ARGUMENT_COORDINATE,\n name,\n argumentName,\n });\n }\n return this.node(start, {\n kind: Kind.DIRECTIVE_COORDINATE,\n name,\n });\n } else if (memberName) {\n if (argumentName) {\n return this.node(start, {\n kind: Kind.ARGUMENT_COORDINATE,\n name,\n fieldName: memberName,\n argumentName,\n });\n }\n return this.node(start, {\n kind: Kind.MEMBER_COORDINATE,\n name,\n memberName,\n });\n }\n\n return this.node(start, {\n kind: Kind.TYPE_COORDINATE,\n name,\n });\n }\n\n // Core parsing utility functions\n\n /**\n * Returns a node that, if configured to do so, sets a \"loc\" field as a\n * location object, used to identify the place in the source that created a\n * given parsed object.\n *\n * @internal\n */\n node(\n startToken: Token,\n node: T,\n ): T {\n if (this._options.noLocation !== true) {\n node.loc = new Location(\n startToken,\n this._lexer.lastToken,\n this._lexer.source,\n );\n }\n return node;\n }\n\n /**\n * Determines if the next token is of a given kind\n *\n * @internal\n */\n peek(kind: TokenKind): boolean {\n return this._lexer.token.kind === kind;\n }\n\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n *\n * @internal\n */\n expectToken(kind: TokenKind): Token {\n const token = this._lexer.token;\n if (token.kind === kind) {\n this.advanceLexer();\n return token;\n }\n\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`,\n );\n }\n\n /**\n * If the next token is of the given kind, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n *\n * @internal\n */\n expectOptionalToken(kind: TokenKind): boolean {\n const token = this._lexer.token;\n if (token.kind === kind) {\n this.advanceLexer();\n return true;\n }\n return false;\n }\n\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n *\n * @internal\n */\n expectKeyword(value: string): void {\n const token = this._lexer.token;\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n } else {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected \"${value}\", found ${getTokenDesc(token)}.`,\n );\n }\n }\n\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n *\n * @internal\n */\n expectOptionalKeyword(value: string): boolean {\n const token = this._lexer.token;\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n return true;\n }\n return false;\n }\n\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n *\n * @internal\n */\n unexpected(atToken?: Maybe): GraphQLError {\n const token = atToken ?? this._lexer.token;\n return syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected ${getTokenDesc(token)}.`,\n );\n }\n\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n *\n * @internal\n */\n any(\n openKind: TokenKind,\n parseFn: () => T,\n closeKind: TokenKind,\n ): Array {\n this.expectToken(openKind);\n const nodes = [];\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n return nodes;\n }\n\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n *\n * @internal\n */\n optionalMany(\n openKind: TokenKind,\n parseFn: () => T,\n closeKind: TokenKind,\n ): Array | undefined {\n if (this.expectOptionalToken(openKind)) {\n const nodes = [];\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n return nodes;\n }\n return undefined;\n }\n\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n *\n * @internal\n */\n many(\n openKind: TokenKind,\n parseFn: () => T,\n closeKind: TokenKind,\n ): Array {\n this.expectToken(openKind);\n const nodes = [];\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n return nodes;\n }\n\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n *\n * @internal\n */\n delimitedMany(delimiterKind: TokenKind, parseFn: () => T): Array {\n this.expectOptionalToken(delimiterKind);\n\n const nodes = [];\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n return nodes;\n }\n\n advanceLexer(): void {\n const { maxTokens } = this._options;\n const token = this._lexer.advance();\n\n if (token.kind !== TokenKind.EOF) {\n ++this._tokenCounter;\n if (maxTokens !== undefined && this._tokenCounter > maxTokens) {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Document contains more than ${maxTokens} tokens. Parsing aborted.`,\n );\n }\n }\n }\n}\n\n/**\n * A helper function to describe a token as a string for debugging.\n *\n * @internal\n */\nfunction getTokenDesc(token: Token): string {\n const value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? ` \"${value}\"` : '');\n}\n\n/**\n * A helper function to describe a token kind as a string for debugging.\n *\n * @internal\n */\nfunction getTokenKindDesc(kind: TokenKind): string {\n return isPunctuatorTokenKind(kind) ? `\"${kind}\"` : kind;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs new file mode 100644 index 00000000..09410f1b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs @@ -0,0 +1,1007 @@ +import { syntaxError } from "../error/syntaxError.mjs"; +import { parseChannel, shouldTrace } from "../diagnostics.mjs"; +import { Location, OperationTypeNode } from "./ast.mjs"; +import { DirectiveLocation } from "./directiveLocation.mjs"; +import { Kind } from "./kinds.mjs"; +import { isPunctuatorTokenKind, Lexer } from "./lexer.mjs"; +import { SchemaCoordinateLexer } from "./schemaCoordinateLexer.mjs"; +import { isSource, Source } from "./source.mjs"; +import { TokenKind } from "./tokenKind.mjs"; +export function parse(source, options) { + return shouldTrace(parseChannel) + ? parseChannel.traceSync(() => parseImpl(source, options), { source }) + : parseImpl(source, options); +} +function parseImpl(source, options) { + const parser = new Parser(source, options); + const document = parser.parseDocument(); + Object.defineProperty(document, 'tokenCount', { + enumerable: false, + value: parser.tokenCount, + }); + return document; +} +export function parseValue(source, options) { + const parser = new Parser(source, options); + parser.expectToken(TokenKind.SOF); + const value = parser.parseValueLiteral(false); + parser.expectToken(TokenKind.EOF); + return value; +} +export function parseConstValue(source, options) { + const parser = new Parser(source, options); + parser.expectToken(TokenKind.SOF); + const value = parser.parseConstValueLiteral(); + parser.expectToken(TokenKind.EOF); + return value; +} +export function parseType(source, options) { + const parser = new Parser(source, options); + parser.expectToken(TokenKind.SOF); + const type = parser.parseTypeReference(); + parser.expectToken(TokenKind.EOF); + return type; +} +export function parseSchemaCoordinate(source) { + const sourceObj = isSource(source) ? source : new Source(source); + const lexer = new SchemaCoordinateLexer(sourceObj); + const parser = new Parser(source, { lexer }); + parser.expectToken(TokenKind.SOF); + const coordinate = parser.parseSchemaCoordinate(); + parser.expectToken(TokenKind.EOF); + return coordinate; +} +export class Parser { + constructor(source, options = {}) { + const { lexer, ..._options } = options; + if (lexer) { + this._lexer = lexer; + } + else { + const sourceObj = isSource(source) ? source : new Source(source); + this._lexer = new Lexer(sourceObj); + } + this._options = _options; + this._tokenCounter = 0; + } + get tokenCount() { + return this._tokenCounter; + } + parseName() { + const token = this.expectToken(TokenKind.NAME); + return this.node(token, { + kind: Kind.NAME, + value: token.value, + }); + } + parseDocument() { + return this.node(this._lexer.token, { + kind: Kind.DOCUMENT, + definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF), + }); + } + parseDefinition() { + if (this.peek(TokenKind.BRACE_L)) { + return this.parseOperationDefinition(); + } + const hasDescription = this.peekDescription(); + const keywordToken = hasDescription + ? this._lexer.lookahead() + : this._lexer.token; + if (hasDescription && keywordToken.kind === TokenKind.BRACE_L) { + throw syntaxError(this._lexer.source, this._lexer.token.start, 'Unexpected description, descriptions are not supported on shorthand queries.'); + } + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaDefinition(); + case 'scalar': + return this.parseScalarTypeDefinition(); + case 'type': + return this.parseObjectTypeDefinition(); + case 'interface': + return this.parseInterfaceTypeDefinition(); + case 'union': + return this.parseUnionTypeDefinition(); + case 'enum': + return this.parseEnumTypeDefinition(); + case 'input': + return this.parseInputObjectTypeDefinition(); + case 'directive': + return this.parseDirectiveDefinition(); + } + switch (keywordToken.value) { + case 'query': + case 'mutation': + case 'subscription': + return this.parseOperationDefinition(); + case 'fragment': + return this.parseFragmentDefinition(); + } + if (hasDescription) { + throw syntaxError(this._lexer.source, this._lexer.token.start, 'Unexpected description, only GraphQL definitions support descriptions.'); + } + switch (keywordToken.value) { + case 'extend': + return this.parseTypeSystemExtension(); + } + } + throw this.unexpected(keywordToken); + } + parseOperationDefinition() { + const start = this._lexer.token; + if (this.peek(TokenKind.BRACE_L)) { + return this.node(start, { + kind: Kind.OPERATION_DEFINITION, + operation: OperationTypeNode.QUERY, + description: undefined, + name: undefined, + variableDefinitions: undefined, + directives: undefined, + selectionSet: this.parseSelectionSet(), + }); + } + const description = this.parseDescription(); + const operation = this.parseOperationType(); + let name; + if (this.peek(TokenKind.NAME)) { + name = this.parseName(); + } + return this.node(start, { + kind: Kind.OPERATION_DEFINITION, + operation, + description, + name, + variableDefinitions: this.parseVariableDefinitions(), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + parseOperationType() { + const operationToken = this.expectToken(TokenKind.NAME); + switch (operationToken.value) { + case 'query': + return OperationTypeNode.QUERY; + case 'mutation': + return OperationTypeNode.MUTATION; + case 'subscription': + return OperationTypeNode.SUBSCRIPTION; + } + throw this.unexpected(operationToken); + } + parseVariableDefinitions() { + return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R); + } + parseVariableDefinition() { + return this.node(this._lexer.token, { + kind: Kind.VARIABLE_DEFINITION, + description: this.parseDescription(), + variable: this.parseVariable(), + type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()), + defaultValue: this.expectOptionalToken(TokenKind.EQUALS) + ? this.parseConstValueLiteral() + : undefined, + directives: this.parseConstDirectives(), + }); + } + parseVariable() { + const start = this._lexer.token; + this.expectToken(TokenKind.DOLLAR); + return this.node(start, { + kind: Kind.VARIABLE, + name: this.parseName(), + }); + } + parseSelectionSet() { + return this.node(this._lexer.token, { + kind: Kind.SELECTION_SET, + selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R), + }); + } + parseSelection() { + return this.peek(TokenKind.SPREAD) + ? this.parseFragment() + : this.parseField(); + } + parseField() { + const start = this._lexer.token; + const nameOrAlias = this.parseName(); + let alias; + let name; + if (this.expectOptionalToken(TokenKind.COLON)) { + alias = nameOrAlias; + name = this.parseName(); + } + else { + name = nameOrAlias; + } + return this.node(start, { + kind: Kind.FIELD, + alias, + name, + arguments: this.parseArguments(false), + directives: this.parseDirectives(false), + selectionSet: this.peek(TokenKind.BRACE_L) + ? this.parseSelectionSet() + : undefined, + }); + } + parseArguments(isConst) { + const item = isConst ? this.parseConstArgument : this.parseArgument; + return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R); + } + parseFragmentArguments() { + const item = this.parseFragmentArgument; + return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R); + } + parseArgument(isConst = false) { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(TokenKind.COLON); + return this.node(start, { + kind: Kind.ARGUMENT, + name, + value: this.parseValueLiteral(isConst), + }); + } + parseConstArgument() { + return this.parseArgument(true); + } + parseFragmentArgument() { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(TokenKind.COLON); + return this.node(start, { + kind: Kind.FRAGMENT_ARGUMENT, + name, + value: this.parseValueLiteral(false), + }); + } + parseFragment() { + const start = this._lexer.token; + this.expectToken(TokenKind.SPREAD); + const hasTypeCondition = this.expectOptionalKeyword('on'); + if (!hasTypeCondition && this.peek(TokenKind.NAME)) { + const name = this.parseFragmentName(); + if (this.peek(TokenKind.PAREN_L) && + this._options.experimentalFragmentArguments) { + return this.node(start, { + kind: Kind.FRAGMENT_SPREAD, + name, + arguments: this.parseFragmentArguments(), + directives: this.parseDirectives(false), + }); + } + return this.node(start, { + kind: Kind.FRAGMENT_SPREAD, + name, + directives: this.parseDirectives(false), + }); + } + return this.node(start, { + kind: Kind.INLINE_FRAGMENT, + typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + parseFragmentDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('fragment'); + if (this._options.experimentalFragmentArguments === true) { + return this.node(start, { + kind: Kind.FRAGMENT_DEFINITION, + description, + name: this.parseFragmentName(), + variableDefinitions: this.parseVariableDefinitions(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + return this.node(start, { + kind: Kind.FRAGMENT_DEFINITION, + description, + name: this.parseFragmentName(), + typeCondition: (this.expectKeyword('on'), this.parseNamedType()), + directives: this.parseDirectives(false), + selectionSet: this.parseSelectionSet(), + }); + } + parseFragmentName() { + if (this._lexer.token.value === 'on') { + throw this.unexpected(); + } + return this.parseName(); + } + parseValueLiteral(isConst) { + const token = this._lexer.token; + switch (token.kind) { + case TokenKind.BRACKET_L: + return this.parseList(isConst); + case TokenKind.BRACE_L: + return this.parseObject(isConst); + case TokenKind.INT: + this.advanceLexer(); + return this.node(token, { + kind: Kind.INT, + value: token.value, + }); + case TokenKind.FLOAT: + this.advanceLexer(); + return this.node(token, { + kind: Kind.FLOAT, + value: token.value, + }); + case TokenKind.STRING: + case TokenKind.BLOCK_STRING: + return this.parseStringLiteral(); + case TokenKind.NAME: + this.advanceLexer(); + switch (token.value) { + case 'true': + return this.node(token, { + kind: Kind.BOOLEAN, + value: true, + }); + case 'false': + return this.node(token, { + kind: Kind.BOOLEAN, + value: false, + }); + case 'null': + return this.node(token, { kind: Kind.NULL }); + default: + return this.node(token, { + kind: Kind.ENUM, + value: token.value, + }); + } + case TokenKind.DOLLAR: + if (isConst) { + this.expectToken(TokenKind.DOLLAR); + if (this._lexer.token.kind === TokenKind.NAME) { + const varName = this._lexer.token.value; + throw syntaxError(this._lexer.source, token.start, `Unexpected variable "$${varName}" in constant value.`); + } + else { + throw this.unexpected(token); + } + } + return this.parseVariable(); + default: + throw this.unexpected(); + } + } + parseConstValueLiteral() { + return this.parseValueLiteral(true); + } + parseStringLiteral() { + const token = this._lexer.token; + this.advanceLexer(); + return this.node(token, { + kind: Kind.STRING, + value: token.value, + block: token.kind === TokenKind.BLOCK_STRING, + }); + } + parseList(isConst) { + const item = () => this.parseValueLiteral(isConst); + return this.node(this._lexer.token, { + kind: Kind.LIST, + values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R), + }); + } + parseObject(isConst) { + const item = () => this.parseObjectField(isConst); + return this.node(this._lexer.token, { + kind: Kind.OBJECT, + fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R), + }); + } + parseObjectField(isConst) { + const start = this._lexer.token; + const name = this.parseName(); + this.expectToken(TokenKind.COLON); + return this.node(start, { + kind: Kind.OBJECT_FIELD, + name, + value: this.parseValueLiteral(isConst), + }); + } + parseDirectives(isConst) { + const directives = []; + while (this.peek(TokenKind.AT)) { + directives.push(this.parseDirective(isConst)); + } + if (directives.length) { + return directives; + } + return undefined; + } + parseConstDirectives() { + return this.parseDirectives(true); + } + parseDirective(isConst) { + const start = this._lexer.token; + this.expectToken(TokenKind.AT); + return this.node(start, { + kind: Kind.DIRECTIVE, + name: this.parseName(), + arguments: this.parseArguments(isConst), + }); + } + parseTypeReference() { + const start = this._lexer.token; + let type; + if (this.expectOptionalToken(TokenKind.BRACKET_L)) { + const innerType = this.parseTypeReference(); + this.expectToken(TokenKind.BRACKET_R); + type = this.node(start, { + kind: Kind.LIST_TYPE, + type: innerType, + }); + } + else { + type = this.parseNamedType(); + } + if (this.expectOptionalToken(TokenKind.BANG)) { + return this.node(start, { + kind: Kind.NON_NULL_TYPE, + type, + }); + } + return type; + } + parseNamedType() { + return this.node(this._lexer.token, { + kind: Kind.NAMED_TYPE, + name: this.parseName(), + }); + } + peekDescription() { + return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING); + } + parseDescription() { + if (this.peekDescription()) { + return this.parseStringLiteral(); + } + } + parseSchemaDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R); + return this.node(start, { + kind: Kind.SCHEMA_DEFINITION, + description, + directives, + operationTypes, + }); + } + parseOperationTypeDefinition() { + const start = this._lexer.token; + const operation = this.parseOperationType(); + this.expectToken(TokenKind.COLON); + const type = this.parseNamedType(); + return this.node(start, { + kind: Kind.OPERATION_TYPE_DEFINITION, + operation, + type, + }); + } + parseScalarTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.SCALAR_TYPE_DEFINITION, + description, + name, + directives, + }); + } + parseObjectTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: Kind.OBJECT_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields, + }); + } + parseImplementsInterfaces() { + return this.expectOptionalKeyword('implements') + ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) + : undefined; + } + parseFieldsDefinition() { + return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R); + } + parseFieldDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + this.expectToken(TokenKind.COLON); + const type = this.parseTypeReference(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.FIELD_DEFINITION, + description, + name, + arguments: args, + type, + directives, + }); + } + parseArgumentDefs() { + return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R); + } + parseInputValueDef() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseName(); + this.expectToken(TokenKind.COLON); + const type = this.parseTypeReference(); + let defaultValue; + if (this.expectOptionalToken(TokenKind.EQUALS)) { + defaultValue = this.parseConstValueLiteral(); + } + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.INPUT_VALUE_DEFINITION, + description, + name, + type, + defaultValue, + directives, + }); + } + parseInterfaceTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + return this.node(start, { + kind: Kind.INTERFACE_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields, + }); + } + parseUnionTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + return this.node(start, { + kind: Kind.UNION_TYPE_DEFINITION, + description, + name, + directives, + types, + }); + } + parseUnionMemberTypes() { + return this.expectOptionalToken(TokenKind.EQUALS) + ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) + : undefined; + } + parseEnumTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + return this.node(start, { + kind: Kind.ENUM_TYPE_DEFINITION, + description, + name, + directives, + values, + }); + } + parseEnumValuesDefinition() { + return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R); + } + parseEnumValueDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + const name = this.parseEnumValueName(); + const directives = this.parseConstDirectives(); + return this.node(start, { + kind: Kind.ENUM_VALUE_DEFINITION, + description, + name, + directives, + }); + } + parseEnumValueName() { + if (this._lexer.token.value === 'true' || + this._lexer.token.value === 'false' || + this._lexer.token.value === 'null') { + throw syntaxError(this._lexer.source, this._lexer.token.start, `${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`); + } + return this.parseName(); + } + parseInputObjectTypeDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + return this.node(start, { + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, + description, + name, + directives, + fields, + }); + } + parseInputFieldsDefinition() { + return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R); + } + parseTypeSystemExtension() { + const keywordToken = this._lexer.lookahead(); + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return this.parseSchemaExtension(); + case 'scalar': + return this.parseScalarTypeExtension(); + case 'type': + return this.parseObjectTypeExtension(); + case 'interface': + return this.parseInterfaceTypeExtension(); + case 'union': + return this.parseUnionTypeExtension(); + case 'enum': + return this.parseEnumTypeExtension(); + case 'input': + return this.parseInputObjectTypeExtension(); + case 'directive': + return this.parseDirectiveExtension(); + } + } + throw this.unexpected(keywordToken); + } + parseSchemaExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('schema'); + const directives = this.parseConstDirectives(); + const operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R); + if (directives === undefined && operationTypes === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.SCHEMA_EXTENSION, + directives, + operationTypes, + }); + } + parseScalarTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('scalar'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + if (directives === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.SCALAR_TYPE_EXTENSION, + name, + directives, + }); + } + parseObjectTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('type'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if (interfaces === undefined && + directives === undefined && + fields === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.OBJECT_TYPE_EXTENSION, + name, + interfaces, + directives, + fields, + }); + } + parseInterfaceTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('interface'); + const name = this.parseName(); + const interfaces = this.parseImplementsInterfaces(); + const directives = this.parseConstDirectives(); + const fields = this.parseFieldsDefinition(); + if (interfaces === undefined && + directives === undefined && + fields === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.INTERFACE_TYPE_EXTENSION, + name, + interfaces, + directives, + fields, + }); + } + parseUnionTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('union'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const types = this.parseUnionMemberTypes(); + if (directives === undefined && types === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.UNION_TYPE_EXTENSION, + name, + directives, + types, + }); + } + parseEnumTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('enum'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const values = this.parseEnumValuesDefinition(); + if (directives === undefined && values === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.ENUM_TYPE_EXTENSION, + name, + directives, + values, + }); + } + parseInputObjectTypeExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('input'); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + const fields = this.parseInputFieldsDefinition(); + if (directives === undefined && fields === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.INPUT_OBJECT_TYPE_EXTENSION, + name, + directives, + fields, + }); + } + parseDirectiveExtension() { + const start = this._lexer.token; + this.expectKeyword('extend'); + this.expectKeyword('directive'); + this.expectToken(TokenKind.AT); + const name = this.parseName(); + const directives = this.parseConstDirectives(); + if (directives === undefined) { + throw this.unexpected(); + } + return this.node(start, { + kind: Kind.DIRECTIVE_EXTENSION, + name, + directives, + }); + } + parseDirectiveDefinition() { + const start = this._lexer.token; + const description = this.parseDescription(); + this.expectKeyword('directive'); + this.expectToken(TokenKind.AT); + const name = this.parseName(); + const args = this.parseArgumentDefs(); + const directives = this.parseConstDirectives(); + const repeatable = this.expectOptionalKeyword('repeatable'); + this.expectKeyword('on'); + const locations = this.parseDirectiveLocations(); + return this.node(start, { + kind: Kind.DIRECTIVE_DEFINITION, + description, + name, + arguments: args, + directives, + repeatable, + locations, + }); + } + parseDirectiveLocations() { + return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation); + } + parseDirectiveLocation() { + const start = this._lexer.token; + const name = this.parseName(); + if (Object.hasOwn(DirectiveLocation, name.value)) { + return name; + } + throw this.unexpected(start); + } + parseSchemaCoordinate() { + const start = this._lexer.token; + const ofDirective = this.expectOptionalToken(TokenKind.AT); + const name = this.parseName(); + let memberName; + if (!ofDirective && this.expectOptionalToken(TokenKind.DOT)) { + memberName = this.parseName(); + } + let argumentName; + if ((ofDirective || memberName) && + this.expectOptionalToken(TokenKind.PAREN_L)) { + argumentName = this.parseName(); + this.expectToken(TokenKind.COLON); + this.expectToken(TokenKind.PAREN_R); + } + if (ofDirective) { + if (argumentName) { + return this.node(start, { + kind: Kind.DIRECTIVE_ARGUMENT_COORDINATE, + name, + argumentName, + }); + } + return this.node(start, { + kind: Kind.DIRECTIVE_COORDINATE, + name, + }); + } + else if (memberName) { + if (argumentName) { + return this.node(start, { + kind: Kind.ARGUMENT_COORDINATE, + name, + fieldName: memberName, + argumentName, + }); + } + return this.node(start, { + kind: Kind.MEMBER_COORDINATE, + name, + memberName, + }); + } + return this.node(start, { + kind: Kind.TYPE_COORDINATE, + name, + }); + } + node(startToken, node) { + if (this._options.noLocation !== true) { + node.loc = new Location(startToken, this._lexer.lastToken, this._lexer.source); + } + return node; + } + peek(kind) { + return this._lexer.token.kind === kind; + } + expectToken(kind) { + const token = this._lexer.token; + if (token.kind === kind) { + this.advanceLexer(); + return token; + } + throw syntaxError(this._lexer.source, token.start, `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`); + } + expectOptionalToken(kind) { + const token = this._lexer.token; + if (token.kind === kind) { + this.advanceLexer(); + return true; + } + return false; + } + expectKeyword(value) { + const token = this._lexer.token; + if (token.kind === TokenKind.NAME && token.value === value) { + this.advanceLexer(); + } + else { + throw syntaxError(this._lexer.source, token.start, `Expected "${value}", found ${getTokenDesc(token)}.`); + } + } + expectOptionalKeyword(value) { + const token = this._lexer.token; + if (token.kind === TokenKind.NAME && token.value === value) { + this.advanceLexer(); + return true; + } + return false; + } + unexpected(atToken) { + const token = atToken ?? this._lexer.token; + return syntaxError(this._lexer.source, token.start, `Unexpected ${getTokenDesc(token)}.`); + } + any(openKind, parseFn, closeKind) { + this.expectToken(openKind); + const nodes = []; + while (!this.expectOptionalToken(closeKind)) { + nodes.push(parseFn.call(this)); + } + return nodes; + } + optionalMany(openKind, parseFn, closeKind) { + if (this.expectOptionalToken(openKind)) { + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + return undefined; + } + many(openKind, parseFn, closeKind) { + this.expectToken(openKind); + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (!this.expectOptionalToken(closeKind)); + return nodes; + } + delimitedMany(delimiterKind, parseFn) { + this.expectOptionalToken(delimiterKind); + const nodes = []; + do { + nodes.push(parseFn.call(this)); + } while (this.expectOptionalToken(delimiterKind)); + return nodes; + } + advanceLexer() { + const { maxTokens } = this._options; + const token = this._lexer.advance(); + if (token.kind !== TokenKind.EOF) { + ++this._tokenCounter; + if (maxTokens !== undefined && this._tokenCounter > maxTokens) { + throw syntaxError(this._lexer.source, token.start, `Document contains more than ${maxTokens} tokens. Parsing aborted.`); + } + } + } +} +function getTokenDesc(token) { + const value = token.value; + return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ''); +} +function getTokenKindDesc(kind) { + return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind; +} +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs.map new file mode 100644 index 00000000..4a538739 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/parser.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/language/parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,iCAAgC;AAEtD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,2BAA0B;AAmE9D,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAiB;AACvD,OAAO,EAAE,iBAAiB,EAAE,gCAA+B;AAC3D,OAAO,EAAE,IAAI,EAAE,oBAAmB;AAElC,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,oBAAmB;AAC1D,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,qBAAoB;AAC/C,OAAO,EAAE,SAAS,EAAE,wBAAuB;AA6F3C,MAAM,UAAU,KAAK,CACnB,MAAuB,EACvB,OAAsB;IAEtB,OAAO,WAAW,CAAC,YAAY,CAAC;QAC9B,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QACtE,CAAC,CAAC,SAAS,CAAC,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C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAEpC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,GAAG,EAAE,CAAC;YACjC,EAAE,IAAI,CAAC,aAAa,CAAC;YACrB,IAAI,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,GAAG,SAAS,EAAE,CAAC;gBAC9D,MAAM,WAAW,CACf,IAAI,CAAC,MAAM,CAAC,MAAM,EAClB,KAAK,CAAC,KAAK,EACX,+BAA+B,SAAS,2BAA2B,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAOD,SAAS,YAAY,CAAC,KAAY;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC7E,CAAC;AAOD,SAAS,gBAAgB,CAAC,IAAe;IACvC,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC","sourcesContent":["/** @category Parsing */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { GraphQLError } from '../error/GraphQLError.ts';\nimport { syntaxError } from '../error/syntaxError.ts';\n\nimport { parseChannel, shouldTrace } from '../diagnostics.ts';\n\nimport type {\n ArgumentCoordinateNode,\n ArgumentNode,\n BooleanValueNode,\n ConstArgumentNode,\n ConstDirectiveNode,\n ConstListValueNode,\n ConstObjectFieldNode,\n ConstObjectValueNode,\n ConstValueNode,\n DefinitionNode,\n DirectiveArgumentCoordinateNode,\n DirectiveCoordinateNode,\n DirectiveDefinitionNode,\n DirectiveExtensionNode,\n DirectiveNode,\n DocumentNode,\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n EnumValueDefinitionNode,\n EnumValueNode,\n FieldDefinitionNode,\n FieldNode,\n FloatValueNode,\n FragmentArgumentNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n InputObjectTypeDefinitionNode,\n InputObjectTypeExtensionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n IntValueNode,\n ListTypeNode,\n ListValueNode,\n MemberCoordinateNode,\n NamedTypeNode,\n NameNode,\n NonNullTypeNode,\n NullValueNode,\n ObjectFieldNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n ObjectValueNode,\n OperationDefinitionNode,\n OperationTypeDefinitionNode,\n ScalarTypeDefinitionNode,\n ScalarTypeExtensionNode,\n SchemaCoordinateNode,\n SchemaDefinitionNode,\n SchemaExtensionNode,\n SelectionNode,\n SelectionSetNode,\n StringValueNode,\n Token,\n TypeCoordinateNode,\n TypeNode,\n TypeSystemExtensionNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n ValueNode,\n VariableDefinitionNode,\n VariableNode,\n} from './ast.ts';\nimport { Location, OperationTypeNode } from './ast.ts';\nimport { DirectiveLocation } from './directiveLocation.ts';\nimport { Kind } from './kinds.ts';\nimport type { LexerInterface } from './lexer.ts';\nimport { isPunctuatorTokenKind, Lexer } from './lexer.ts';\nimport { SchemaCoordinateLexer } from './schemaCoordinateLexer.ts';\nimport { isSource, Source } from './source.ts';\nimport { TokenKind } from './tokenKind.ts';\n\n/** Configuration options to control parser behavior */\nexport interface ParseOptions {\n /**\n * By default, the parser creates AST nodes that know the location\n * in the source that they correspond to. This configuration flag\n * disables that behavior for performance or testing.\n */\n noLocation?: boolean | undefined;\n\n /**\n * Parser CPU and memory usage is linear to the number of tokens in a document\n * however in extreme cases it becomes quadratic due to memory exhaustion.\n * Parsing happens before validation so even invalid queries can burn lots of\n * CPU time and memory.\n * To prevent this you can set a maximum number of tokens allowed within a document.\n */\n maxTokens?: number | undefined;\n\n /**\n * EXPERIMENTAL:\n *\n * If enabled, the parser will understand and parse fragment variable definitions\n * and arguments on fragment spreads. Fragment variable definitions will be represented\n * in the `variableDefinitions` field of the FragmentDefinitionNode.\n * Fragment spread arguments will be represented in the `arguments` field of FragmentSpreadNode.\n * @example\n * ```graphql prettier-ignore\n * {\n * t { ...A(var: true) }\n * }\n * fragment A($var: Boolean = false) on T {\n * ...B(x: $var)\n * }\n * ```\n */\n experimentalFragmentArguments?: boolean | undefined;\n\n /**\n * Internal parser hook for GraphQL.js entry points that need to parse a\n * restricted grammar with an alternate lexer.\n * @internal\n */\n lexer?: LexerInterface | undefined;\n}\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n * @param source - A GraphQL source string or source object.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL document AST.\n * @example\n * ```ts\n * // Parse a GraphQL document with the default parser options.\n * import { parse } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n *\n * document.kind; // => 'Document'\n * ```\n * @example\n * ```ts\n * // This variant enables parser options and provides an explicit lexer.\n * import { Lexer, Source, parse } from 'graphql/language';\n *\n * const document = parse(\n * `\n * {\n * t { ...A(var: true) }\n * }\n * fragment A($var: Boolean = false) on T {\n * name\n * }\n * `,\n * {\n * experimentalFragmentArguments: true,\n * maxTokens: 80,\n * noLocation: true,\n * },\n * );\n * const directiveDocument = parse('directive @foo @bar on FIELD');\n * const source = new Source('{ hero }');\n * const lexerDocument = parse(source, { lexer: new Lexer(source) });\n *\n * document.definitions[0].kind; // => 'OperationDefinition'\n * document.definitions[1].kind; // => 'FragmentDefinition'\n * document.loc; // => undefined\n * directiveDocument.definitions[0].kind; // => 'DirectiveDefinition'\n * lexerDocument.definitions[0].kind; // => 'OperationDefinition'\n * ```\n */\nexport function parse(\n source: string | Source,\n options?: ParseOptions,\n): DocumentNode {\n return shouldTrace(parseChannel)\n ? parseChannel.traceSync(() => parseImpl(source, options), { source })\n : parseImpl(source, options);\n}\n\nfunction parseImpl(\n source: string | Source,\n options: ParseOptions | undefined,\n): DocumentNode {\n const parser = new Parser(source, options);\n const document = parser.parseDocument();\n Object.defineProperty(document, 'tokenCount', {\n enumerable: false,\n value: parser.tokenCount,\n });\n return document;\n}\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n * @param source - A GraphQL source string or source object containing a value.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL value AST.\n * @example\n * ```ts\n * import { parseValue } from 'graphql/language';\n *\n * const value = parseValue('[42]');\n *\n * value.kind; // => 'ListValue'\n * ```\n */\nexport function parseValue(\n source: string | Source,\n options?: ParseOptions,\n): ValueNode {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n\n/**\n * Similar to parseValue(), but raises a parse error if it encounters a\n * variable. The return type will be a constant value.\n * @param source - A GraphQL source string or source object containing a constant value.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL constant value AST.\n * @example\n * ```ts\n * import { parseConstValue } from 'graphql/language';\n *\n * const value = parseConstValue('{ enabled: true }');\n *\n * value.kind; // => 'ObjectValue'\n * parseConstValue('$variable'); // throws an error\n * ```\n */\nexport function parseConstValue(\n source: string | Source,\n options?: ParseOptions,\n): ConstValueNode {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseConstValueLiteral();\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n * @param source - A GraphQL source string or source object containing a type reference.\n * @param options - Optional parser configuration.\n * @returns The parsed GraphQL type AST.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n *\n * const type = parseType('[String!]');\n *\n * type.kind; // => 'ListType'\n * ```\n */\nexport function parseType(\n source: string | Source,\n options?: ParseOptions,\n): TypeNode {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n\n/**\n * Given a string containing a GraphQL Schema Coordinate (ex. `Type.field`),\n * parse the AST for that schema coordinate.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * Consider providing the results to the utility function:\n * resolveASTSchemaCoordinate(). Or calling resolveSchemaCoordinate() directly\n * with an unparsed source.\n * @param source - A GraphQL source string or source object containing a schema coordinate.\n * @returns The parsed GraphQL schema coordinate AST.\n * @example\n * ```ts\n * import { parseSchemaCoordinate } from 'graphql/language';\n *\n * const coordinate = parseSchemaCoordinate('Query.hero');\n *\n * coordinate.kind; // => 'MemberCoordinate'\n * ```\n */\nexport function parseSchemaCoordinate(\n source: string | Source,\n): SchemaCoordinateNode {\n const sourceObj = isSource(source) ? source : new Source(source);\n const lexer = new SchemaCoordinateLexer(sourceObj);\n const parser = new Parser(source, { lexer });\n parser.expectToken(TokenKind.SOF);\n const coordinate = parser.parseSchemaCoordinate();\n parser.expectToken(TokenKind.EOF);\n return coordinate;\n}\n\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\nexport class Parser {\n protected _options: Omit;\n protected _lexer: LexerInterface;\n protected _tokenCounter: number;\n\n constructor(source: string | Source, options: ParseOptions = {}) {\n const { lexer, ..._options } = options;\n\n if (lexer) {\n this._lexer = lexer;\n } else {\n const sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n }\n\n this._options = _options;\n this._tokenCounter = 0;\n }\n\n get tokenCount(): number {\n return this._tokenCounter;\n }\n\n /**\n * Converts a name lex token into a name parse node.\n *\n * @internal\n */\n parseName(): NameNode {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n }\n\n // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n *\n * @internal\n */\n parseDocument(): DocumentNode {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }\n\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n *\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n *\n * @internal\n */\n parseDefinition(): DefinitionNode {\n if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n }\n\n // Many definitions begin with a description and require a lookahead.\n const hasDescription = this.peekDescription();\n const keywordToken = hasDescription\n ? this._lexer.lookahead()\n : this._lexer.token;\n\n if (hasDescription && keywordToken.kind === TokenKind.BRACE_L) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, descriptions are not supported on shorthand queries.',\n );\n }\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n case 'scalar':\n return this.parseScalarTypeDefinition();\n case 'type':\n return this.parseObjectTypeDefinition();\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n case 'union':\n return this.parseUnionTypeDefinition();\n case 'enum':\n return this.parseEnumTypeDefinition();\n case 'input':\n return this.parseInputObjectTypeDefinition();\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n\n switch (keywordToken.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n case 'fragment':\n return this.parseFragmentDefinition();\n }\n\n if (hasDescription) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, only GraphQL definitions support descriptions.',\n );\n }\n\n switch (keywordToken.value) {\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n\n // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n *\n * @internal\n */\n parseOperationDefinition(): OperationDefinitionNode {\n const start = this._lexer.token;\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n description: undefined,\n name: undefined,\n variableDefinitions: undefined,\n directives: undefined,\n selectionSet: this.parseSelectionSet(),\n });\n }\n const description = this.parseDescription();\n const operation = this.parseOperationType();\n let name;\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation,\n description,\n name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n /**\n * OperationType : one of query mutation subscription\n *\n * @internal\n */\n parseOperationType(): OperationTypeNode {\n const operationToken = this.expectToken(TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n case 'mutation':\n return OperationTypeNode.MUTATION;\n case 'subscription':\n return OperationTypeNode.SUBSCRIPTION;\n }\n\n throw this.unexpected(operationToken);\n }\n\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n *\n * @internal\n */\n parseVariableDefinitions(): Array | undefined {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }\n\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n *\n * @internal\n */\n parseVariableDefinition(): VariableDefinitionNode {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n description: this.parseDescription(),\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseConstValueLiteral()\n : undefined,\n directives: this.parseConstDirectives(),\n });\n }\n\n /**\n * Variable : $ Name\n *\n * @internal\n */\n parseVariable(): VariableNode {\n const start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return this.node(start, {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n });\n }\n\n /**\n * ```\n * SelectionSet : { Selection+ }\n * ```\n *\n * @internal\n */\n parseSelectionSet(): SelectionSetNode {\n return this.node(this._lexer.token, {\n kind: Kind.SELECTION_SET,\n selections: this.many(\n TokenKind.BRACE_L,\n this.parseSelection,\n TokenKind.BRACE_R,\n ),\n });\n }\n\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n *\n * @internal\n */\n parseSelection(): SelectionNode {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }\n\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n *\n * @internal\n */\n parseField(): FieldNode {\n const start = this._lexer.token;\n\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }\n\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n *\n * @internal\n */\n parseArguments(isConst: true): Array | undefined;\n parseArguments(isConst: boolean): Array | undefined;\n parseArguments(isConst: boolean): Array | undefined {\n const item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n\n /* experimental */\n parseFragmentArguments(): Array | undefined {\n const item = this.parseFragmentArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n\n /**\n * Argument[Const] : Name : Value[?Const]\n *\n * @internal\n */\n parseArgument(isConst: true): ConstArgumentNode;\n parseArgument(isConst?: boolean): ArgumentNode;\n parseArgument(isConst: boolean = false): ArgumentNode {\n const start = this._lexer.token;\n const name = this.parseName();\n\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n parseConstArgument(): ConstArgumentNode {\n return this.parseArgument(true);\n }\n\n /* experimental */\n parseFragmentArgument(): FragmentArgumentNode {\n const start = this._lexer.token;\n const name = this.parseName();\n\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.FRAGMENT_ARGUMENT,\n name,\n value: this.parseValueLiteral(false),\n });\n }\n\n // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Arguments? Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n *\n * @internal\n */\n parseFragment(): FragmentSpreadNode | InlineFragmentNode {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n\n const hasTypeCondition = this.expectOptionalKeyword('on');\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n const name = this.parseFragmentName();\n if (\n this.peek(TokenKind.PAREN_L) &&\n this._options.experimentalFragmentArguments\n ) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name,\n arguments: this.parseFragmentArguments(),\n directives: this.parseDirectives(false),\n });\n }\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name,\n directives: this.parseDirectives(false),\n });\n }\n return this.node(start, {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n /**\n * FragmentDefinition :\n * - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n *\n * @internal\n */\n parseFragmentDefinition(): FragmentDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('fragment');\n if (this._options.experimentalFragmentArguments === true) {\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n description,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n description,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n /**\n * FragmentName : Name but not `on`\n *\n * @internal\n */\n parseFragmentName(): NameNode {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n return this.parseName();\n }\n\n // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n *\n * @internal\n */\n parseValueLiteral(isConst: true): ConstValueNode;\n parseValueLiteral(isConst: boolean): ValueNode;\n parseValueLiteral(isConst: boolean): ValueNode {\n const token = this._lexer.token;\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n case TokenKind.INT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n case TokenKind.FLOAT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n case TokenKind.NAME:\n this.advanceLexer();\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n case 'null':\n return this.node(token, { kind: Kind.NULL });\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n return this.parseVariable();\n default:\n throw this.unexpected();\n }\n }\n\n parseConstValueLiteral(): ConstValueNode {\n return this.parseValueLiteral(true);\n }\n\n parseStringLiteral(): StringValueNode {\n const token = this._lexer.token;\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n });\n }\n\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n *\n * @internal\n */\n parseList(isConst: true): ConstListValueNode;\n parseList(isConst: boolean): ListValueNode;\n parseList(isConst: boolean): ListValueNode {\n const item = () => this.parseValueLiteral(isConst);\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }\n\n /**\n * ```\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n * ```\n *\n * @internal\n */\n parseObject(isConst: true): ConstObjectValueNode;\n parseObject(isConst: boolean): ObjectValueNode;\n parseObject(isConst: boolean): ObjectValueNode {\n const item = () => this.parseObjectField(isConst);\n return this.node(this._lexer.token, {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n });\n }\n\n /**\n * ObjectField[Const] : Name : Value[?Const]\n *\n * @internal\n */\n parseObjectField(isConst: true): ConstObjectFieldNode;\n parseObjectField(isConst: boolean): ObjectFieldNode;\n parseObjectField(isConst: boolean): ObjectFieldNode {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.OBJECT_FIELD,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n *\n * @internal\n */\n parseDirectives(isConst: true): Array | undefined;\n parseDirectives(isConst: boolean): Array | undefined;\n parseDirectives(isConst: boolean): Array | undefined {\n const directives = [];\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n if (directives.length) {\n return directives;\n }\n return undefined;\n }\n\n parseConstDirectives(): Array | undefined {\n return this.parseDirectives(true);\n }\n\n /**\n * ```\n * Directive[Const] : @ Name Arguments[?Const]?\n * ```\n *\n * @internal\n */\n parseDirective(isConst: true): ConstDirectiveNode;\n parseDirective(isConst: boolean): DirectiveNode;\n parseDirective(isConst: boolean): DirectiveNode {\n const start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return this.node(start, {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n });\n }\n\n // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n *\n * @internal\n */\n parseTypeReference(): TypeNode {\n const start = this._lexer.token;\n let type;\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n const innerType = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = this.node(start, {\n kind: Kind.LIST_TYPE,\n type: innerType,\n });\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return this.node(start, {\n kind: Kind.NON_NULL_TYPE,\n type,\n });\n }\n\n return type;\n }\n\n /**\n * NamedType : Name\n *\n * @internal\n */\n parseNamedType(): NamedTypeNode {\n return this.node(this._lexer.token, {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n });\n }\n\n // Implements the parsing rules in the Type Definition section.\n\n peekDescription(): boolean {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n\n /**\n * Description : StringValue\n *\n * @internal\n */\n parseDescription(): undefined | StringValueNode {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n\n /**\n * ```\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n * ```\n *\n * @internal\n */\n parseSchemaDefinition(): SchemaDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.many(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n return this.node(start, {\n kind: Kind.SCHEMA_DEFINITION,\n description,\n directives,\n operationTypes,\n });\n }\n\n /**\n * OperationTypeDefinition : OperationType : NamedType\n *\n * @internal\n */\n parseOperationTypeDefinition(): OperationTypeDefinitionNode {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n });\n }\n\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n *\n * @internal\n */\n parseScalarTypeDefinition(): ScalarTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n *\n * @internal\n */\n parseObjectTypeDefinition(): ObjectTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n *\n * @internal\n */\n parseImplementsInterfaces(): Array | undefined {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : undefined;\n }\n\n /**\n * ```\n * FieldsDefinition : { FieldDefinition+ }\n * ```\n *\n * @internal\n */\n parseFieldsDefinition(): Array | undefined {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseFieldDefinition,\n TokenKind.BRACE_R,\n );\n }\n\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n *\n * @internal\n */\n parseFieldDefinition(): FieldDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }\n\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n *\n * @internal\n */\n parseArgumentDefs(): Array | undefined {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }\n\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n *\n * @internal\n */\n parseInputValueDef(): InputValueDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseConstValueLiteral();\n }\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description,\n name,\n type,\n defaultValue,\n directives,\n });\n }\n\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n *\n * @internal\n */\n parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n *\n * @internal\n */\n parseUnionTypeDefinition(): UnionTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }\n\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n *\n * @internal\n */\n parseUnionMemberTypes(): Array | undefined {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : undefined;\n }\n\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n *\n * @internal\n */\n parseEnumTypeDefinition(): EnumTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(start, {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description,\n name,\n directives,\n values,\n });\n }\n\n /**\n * ```\n * EnumValuesDefinition : { EnumValueDefinition+ }\n * ```\n *\n * @internal\n */\n parseEnumValuesDefinition(): Array | undefined {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseEnumValueDefinition,\n TokenKind.BRACE_R,\n );\n }\n\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * @internal\n */\n parseEnumValueDefinition(): EnumValueDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n\n /**\n * EnumValue : Name but not `true`, `false` or `null`\n *\n * @internal\n */\n parseEnumValueName(): NameNode {\n if (\n this._lexer.token.value === 'true' ||\n this._lexer.token.value === 'false' ||\n this._lexer.token.value === 'null'\n ) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this._lexer.token,\n )} is reserved and cannot be used for an enum value.`,\n );\n }\n return this.parseName();\n }\n\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n *\n * @internal\n */\n parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }\n\n /**\n * ```\n * InputFieldsDefinition : { InputValueDefinition+ }\n * ```\n *\n * @internal\n */\n parseInputFieldsDefinition(): Array | undefined {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseInputValueDef,\n TokenKind.BRACE_R,\n );\n }\n\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n * - DirectiveExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeExtension\n *\n * @internal\n */\n parseTypeSystemExtension(): TypeSystemExtensionNode {\n const keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n case 'scalar':\n return this.parseScalarTypeExtension();\n case 'type':\n return this.parseObjectTypeExtension();\n case 'interface':\n return this.parseInterfaceTypeExtension();\n case 'union':\n return this.parseUnionTypeExtension();\n case 'enum':\n return this.parseEnumTypeExtension();\n case 'input':\n return this.parseInputObjectTypeExtension();\n case 'directive':\n return this.parseDirectiveExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n\n /**\n * ```\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n * ```\n *\n * @internal\n */\n parseSchemaExtension(): SchemaExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.optionalMany(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n if (directives === undefined && operationTypes === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.SCHEMA_EXTENSION,\n directives,\n operationTypes,\n });\n }\n\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n *\n * @internal\n */\n parseScalarTypeExtension(): ScalarTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n if (directives === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name,\n directives,\n });\n }\n\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n *\n * @internal\n */\n parseObjectTypeExtension(): ObjectTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n if (\n interfaces === undefined &&\n directives === undefined &&\n fields === undefined\n ) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n *\n * @internal\n */\n parseInterfaceTypeExtension(): InterfaceTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n if (\n interfaces === undefined &&\n directives === undefined &&\n fields === undefined\n ) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n *\n * @internal\n */\n parseUnionTypeExtension(): UnionTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n if (directives === undefined && types === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.UNION_TYPE_EXTENSION,\n name,\n directives,\n types,\n });\n }\n\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n *\n * @internal\n */\n parseEnumTypeExtension(): EnumTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n if (directives === undefined && values === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name,\n directives,\n values,\n });\n }\n\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n *\n * @internal\n */\n parseInputObjectTypeExtension(): InputObjectTypeExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n if (directives === undefined && fields === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name,\n directives,\n fields,\n });\n }\n\n parseDirectiveExtension(): DirectiveExtensionNode {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n if (directives === undefined) {\n throw this.unexpected();\n }\n return this.node(start, {\n kind: Kind.DIRECTIVE_EXTENSION,\n name,\n directives,\n });\n }\n\n /**\n * ```\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? Directives[Const]? `repeatable`? on DirectiveLocations\n * ```\n *\n * @internal\n */\n parseDirectiveDefinition(): DirectiveDefinitionNode {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n const directives = this.parseConstDirectives();\n const repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n const locations = this.parseDirectiveLocations();\n return this.node(start, {\n kind: Kind.DIRECTIVE_DEFINITION,\n description,\n name,\n arguments: args,\n directives,\n repeatable,\n locations,\n });\n }\n\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n *\n * @internal\n */\n parseDirectiveLocations(): Array {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n * `VARIABLE_DEFINITION`\n * `FRAGMENT_VARIABLE_DEFINITION`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n * `DIRECTIVE_DEFINITION`\n */\n parseDirectiveLocation(): NameNode {\n const start = this._lexer.token;\n const name = this.parseName();\n if (Object.hasOwn(DirectiveLocation, name.value)) {\n return name;\n }\n throw this.unexpected(start);\n }\n\n // Implements the parsing rules in the Schema Coordinates section.\n\n /**\n * SchemaCoordinate :\n * - Name\n * - Name . Name\n * - Name . Name ( Name : )\n * - @ Name\n * - @ Name ( Name : )\n *\n * @internal\n */\n parseSchemaCoordinate(): SchemaCoordinateNode {\n const start = this._lexer.token;\n const ofDirective = this.expectOptionalToken(TokenKind.AT);\n const name = this.parseName();\n let memberName: NameNode | undefined;\n if (!ofDirective && this.expectOptionalToken(TokenKind.DOT)) {\n memberName = this.parseName();\n }\n let argumentName: NameNode | undefined;\n if (\n (ofDirective || memberName) &&\n this.expectOptionalToken(TokenKind.PAREN_L)\n ) {\n argumentName = this.parseName();\n this.expectToken(TokenKind.COLON);\n this.expectToken(TokenKind.PAREN_R);\n }\n\n if (ofDirective) {\n if (argumentName) {\n return this.node(start, {\n kind: Kind.DIRECTIVE_ARGUMENT_COORDINATE,\n name,\n argumentName,\n });\n }\n return this.node(start, {\n kind: Kind.DIRECTIVE_COORDINATE,\n name,\n });\n } else if (memberName) {\n if (argumentName) {\n return this.node(start, {\n kind: Kind.ARGUMENT_COORDINATE,\n name,\n fieldName: memberName,\n argumentName,\n });\n }\n return this.node(start, {\n kind: Kind.MEMBER_COORDINATE,\n name,\n memberName,\n });\n }\n\n return this.node(start, {\n kind: Kind.TYPE_COORDINATE,\n name,\n });\n }\n\n // Core parsing utility functions\n\n /**\n * Returns a node that, if configured to do so, sets a \"loc\" field as a\n * location object, used to identify the place in the source that created a\n * given parsed object.\n *\n * @internal\n */\n node(\n startToken: Token,\n node: T,\n ): T {\n if (this._options.noLocation !== true) {\n node.loc = new Location(\n startToken,\n this._lexer.lastToken,\n this._lexer.source,\n );\n }\n return node;\n }\n\n /**\n * Determines if the next token is of a given kind\n *\n * @internal\n */\n peek(kind: TokenKind): boolean {\n return this._lexer.token.kind === kind;\n }\n\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n *\n * @internal\n */\n expectToken(kind: TokenKind): Token {\n const token = this._lexer.token;\n if (token.kind === kind) {\n this.advanceLexer();\n return token;\n }\n\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`,\n );\n }\n\n /**\n * If the next token is of the given kind, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n *\n * @internal\n */\n expectOptionalToken(kind: TokenKind): boolean {\n const token = this._lexer.token;\n if (token.kind === kind) {\n this.advanceLexer();\n return true;\n }\n return false;\n }\n\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n *\n * @internal\n */\n expectKeyword(value: string): void {\n const token = this._lexer.token;\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n } else {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected \"${value}\", found ${getTokenDesc(token)}.`,\n );\n }\n }\n\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n *\n * @internal\n */\n expectOptionalKeyword(value: string): boolean {\n const token = this._lexer.token;\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n return true;\n }\n return false;\n }\n\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n *\n * @internal\n */\n unexpected(atToken?: Maybe): GraphQLError {\n const token = atToken ?? this._lexer.token;\n return syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected ${getTokenDesc(token)}.`,\n );\n }\n\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n *\n * @internal\n */\n any(\n openKind: TokenKind,\n parseFn: () => T,\n closeKind: TokenKind,\n ): Array {\n this.expectToken(openKind);\n const nodes = [];\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n return nodes;\n }\n\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n *\n * @internal\n */\n optionalMany(\n openKind: TokenKind,\n parseFn: () => T,\n closeKind: TokenKind,\n ): Array | undefined {\n if (this.expectOptionalToken(openKind)) {\n const nodes = [];\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n return nodes;\n }\n return undefined;\n }\n\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n *\n * @internal\n */\n many(\n openKind: TokenKind,\n parseFn: () => T,\n closeKind: TokenKind,\n ): Array {\n this.expectToken(openKind);\n const nodes = [];\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n return nodes;\n }\n\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n *\n * @internal\n */\n delimitedMany(delimiterKind: TokenKind, parseFn: () => T): Array {\n this.expectOptionalToken(delimiterKind);\n\n const nodes = [];\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n return nodes;\n }\n\n advanceLexer(): void {\n const { maxTokens } = this._options;\n const token = this._lexer.advance();\n\n if (token.kind !== TokenKind.EOF) {\n ++this._tokenCounter;\n if (maxTokens !== undefined && this._tokenCounter > maxTokens) {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Document contains more than ${maxTokens} tokens. Parsing aborted.`,\n );\n }\n }\n }\n}\n\n/**\n * A helper function to describe a token as a string for debugging.\n *\n * @internal\n */\nfunction getTokenDesc(token: Token): string {\n const value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? ` \"${value}\"` : '');\n}\n\n/**\n * A helper function to describe a token kind as a string for debugging.\n *\n * @internal\n */\nfunction getTokenKindDesc(kind: TokenKind): string {\n return isPunctuatorTokenKind(kind) ? `\"${kind}\"` : kind;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.mts new file mode 100644 index 00000000..d64819c1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.mts @@ -0,0 +1,204 @@ +/** @category AST Predicates */ +import type { ASTNode, ConstValueNode, DefinitionNode, ExecutableDefinitionNode, OperationDefinitionNode, SchemaCoordinateNode, SelectionNode, SubscriptionOperationDefinitionNode, TypeDefinitionNode, TypeExtensionNode, TypeNode, TypeSystemDefinitionNode, TypeSystemExtensionNode, ValueNode } from "./ast.mjs"; +/** + * Returns true when the AST node is a definition node. + * @param node - The AST node to test. + * @returns True when the AST node is a definition node. + * @example + * ```ts + * import { parse, isDefinitionNode } from 'graphql/language'; + * + * const document = parse('{ hello }'); + * + * isDefinitionNode(document.definitions[0]); // => true + * isDefinitionNode(document); // => false + * ``` + */ +export declare function isDefinitionNode(node: ASTNode): node is DefinitionNode; +/** + * Returns true when the AST node is an executable definition node. + * @param node - The AST node to test. + * @returns True when the AST node is an executable definition node. + * @example + * ```ts + * import { parse, isExecutableDefinitionNode } from 'graphql/language'; + * + * const query = parse('{ hello }'); + * const schema = parse('type Query { hello: String }'); + * + * isExecutableDefinitionNode(query.definitions[0]); // => true + * isExecutableDefinitionNode(schema.definitions[0]); // => false + * ``` + */ +export declare function isExecutableDefinitionNode(node: ASTNode): node is ExecutableDefinitionNode; +/** + * A type predicate for SubscriptionOperationDefinitionNode. + * Useful anywhere that must distinguish subscription operations from + * queries and mutations, such as the subscription execution pipeline + * which routes events through a different code path. + * @param node - Operation definition node to test. + * @returns True when the operation definition is a subscription. + * @example + * ```ts + * import { parse, isSubscriptionOperationDefinitionNode } from 'graphql/language'; + * + * const subscription = parse('subscription { greeting }').definitions[0]; + * const query = parse('{ greeting }').definitions[0]; + * + * isSubscriptionOperationDefinitionNode(subscription); // => true + * isSubscriptionOperationDefinitionNode(query); // => false + * ``` + */ +export declare function isSubscriptionOperationDefinitionNode(node: OperationDefinitionNode): node is SubscriptionOperationDefinitionNode; +/** + * Returns true when the AST node is a selection node. + * @param node - The AST node to test. + * @returns True when the AST node is a selection node. + * @example + * ```ts + * import { Kind, isSelectionNode } from 'graphql/language'; + * + * const field = { kind: Kind.FIELD, name: { kind: Kind.NAME, value: 'hello' } }; + * const document = { kind: Kind.DOCUMENT, definitions: [] }; + * + * isSelectionNode(field); // => true + * isSelectionNode(document); // => false + * ``` + */ +export declare function isSelectionNode(node: ASTNode): node is SelectionNode; +/** + * Returns true when the AST node is a value node. + * @param node - The AST node to test. + * @returns True when the AST node is a value node. + * @example + * ```ts + * import { parseType, parseValue, isValueNode } from 'graphql/language'; + * + * const value = parseValue('[42]'); + * const type = parseType('[String!]'); + * + * isValueNode(value); // => true + * isValueNode(type); // => false + * ``` + */ +export declare function isValueNode(node: ASTNode): node is ValueNode; +/** + * Returns true when the AST node is a constant value node. + * @param node - The AST node to test. + * @returns True when the AST node is a constant value node. + * @example + * ```ts + * import { + * parseConstValue, + * parseValue, + * isConstValueNode, + * } from 'graphql/language'; + * + * const value = parseConstValue('[42]'); + * const variable = parseValue('$id'); + * + * isConstValueNode(value); // => true + * isConstValueNode(variable); // => false + * ``` + */ +export declare function isConstValueNode(node: ASTNode): node is ConstValueNode; +/** + * Returns true when the AST node is a type node. + * @param node - The AST node to test. + * @returns True when the AST node is a type node. + * @example + * ```ts + * import { parseType, parseValue, isTypeNode } from 'graphql/language'; + * + * const type = parseType('[String!]'); + * const value = parseValue('[42]'); + * + * isTypeNode(type); // => true + * isTypeNode(value); // => false + * ``` + */ +export declare function isTypeNode(node: ASTNode): node is TypeNode; +/** + * Returns true when the AST node is a type system definition node. + * @param node - The AST node to test. + * @returns True when the AST node is a type system definition node. + * @example + * ```ts + * import { parse, isTypeSystemDefinitionNode } from 'graphql/language'; + * + * const schema = parse('type Query { hello: String }'); + * const query = parse('{ hello }'); + * + * isTypeSystemDefinitionNode(schema.definitions[0]); // => true + * isTypeSystemDefinitionNode(query.definitions[0]); // => false + * ``` + */ +export declare function isTypeSystemDefinitionNode(node: ASTNode): node is TypeSystemDefinitionNode; +/** + * Returns true when the AST node is a type definition node. + * @param node - The AST node to test. + * @returns True when the AST node is a type definition node. + * @example + * ```ts + * import { parse, isTypeDefinitionNode } from 'graphql/language'; + * + * const typeDefinition = parse('type Query { hello: String }'); + * const directiveDefinition = parse('directive @cache on FIELD'); + * + * isTypeDefinitionNode(typeDefinition.definitions[0]); // => true + * isTypeDefinitionNode(directiveDefinition.definitions[0]); // => false + * ``` + */ +export declare function isTypeDefinitionNode(node: ASTNode): node is TypeDefinitionNode; +/** + * Returns true when the AST node is a type system extension node. + * @param node - The AST node to test. + * @returns True when the AST node is a type system extension node. + * @example + * ```ts + * import { parse, isTypeSystemExtensionNode } from 'graphql/language'; + * + * const extension = parse('extend type Query { hello: String }'); + * const definition = parse('type Query { hello: String }'); + * + * isTypeSystemExtensionNode(extension.definitions[0]); // => true + * isTypeSystemExtensionNode(definition.definitions[0]); // => false + * ``` + */ +export declare function isTypeSystemExtensionNode(node: ASTNode): node is TypeSystemExtensionNode; +/** + * Returns true when the AST node is a type extension node. + * @param node - The AST node to test. + * @returns True when the AST node is a type extension node. + * @example + * ```ts + * import { parse, isTypeExtensionNode } from 'graphql/language'; + * + * const extension = parse('extend type Query { hello: String }'); + * const schemaExtension = parse('extend schema { query: Query }'); + * + * isTypeExtensionNode(extension.definitions[0]); // => true + * isTypeExtensionNode(schemaExtension.definitions[0]); // => false + * ``` + */ +export declare function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode; +/** + * Returns true when the AST node is a schema coordinate node. + * @param node - The AST node to test. + * @returns True when the AST node is a schema coordinate node. + * @example + * ```ts + * import { + * parse, + * parseSchemaCoordinate, + * isSchemaCoordinateNode, + * } from 'graphql/language'; + * + * const coordinate = parseSchemaCoordinate('Query.hero'); + * const document = parse('{ hero }'); + * + * isSchemaCoordinateNode(coordinate); // => true + * isSchemaCoordinateNode(document); // => false + * ``` + */ +export declare function isSchemaCoordinateNode(node: ASTNode): node is SchemaCoordinateNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.ts new file mode 100644 index 00000000..46df55eb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.d.ts @@ -0,0 +1,204 @@ +/** @category AST Predicates */ +import type { ASTNode, ConstValueNode, DefinitionNode, ExecutableDefinitionNode, OperationDefinitionNode, SchemaCoordinateNode, SelectionNode, SubscriptionOperationDefinitionNode, TypeDefinitionNode, TypeExtensionNode, TypeNode, TypeSystemDefinitionNode, TypeSystemExtensionNode, ValueNode } from "./ast.js"; +/** + * Returns true when the AST node is a definition node. + * @param node - The AST node to test. + * @returns True when the AST node is a definition node. + * @example + * ```ts + * import { parse, isDefinitionNode } from 'graphql/language'; + * + * const document = parse('{ hello }'); + * + * isDefinitionNode(document.definitions[0]); // => true + * isDefinitionNode(document); // => false + * ``` + */ +export declare function isDefinitionNode(node: ASTNode): node is DefinitionNode; +/** + * Returns true when the AST node is an executable definition node. + * @param node - The AST node to test. + * @returns True when the AST node is an executable definition node. + * @example + * ```ts + * import { parse, isExecutableDefinitionNode } from 'graphql/language'; + * + * const query = parse('{ hello }'); + * const schema = parse('type Query { hello: String }'); + * + * isExecutableDefinitionNode(query.definitions[0]); // => true + * isExecutableDefinitionNode(schema.definitions[0]); // => false + * ``` + */ +export declare function isExecutableDefinitionNode(node: ASTNode): node is ExecutableDefinitionNode; +/** + * A type predicate for SubscriptionOperationDefinitionNode. + * Useful anywhere that must distinguish subscription operations from + * queries and mutations, such as the subscription execution pipeline + * which routes events through a different code path. + * @param node - Operation definition node to test. + * @returns True when the operation definition is a subscription. + * @example + * ```ts + * import { parse, isSubscriptionOperationDefinitionNode } from 'graphql/language'; + * + * const subscription = parse('subscription { greeting }').definitions[0]; + * const query = parse('{ greeting }').definitions[0]; + * + * isSubscriptionOperationDefinitionNode(subscription); // => true + * isSubscriptionOperationDefinitionNode(query); // => false + * ``` + */ +export declare function isSubscriptionOperationDefinitionNode(node: OperationDefinitionNode): node is SubscriptionOperationDefinitionNode; +/** + * Returns true when the AST node is a selection node. + * @param node - The AST node to test. + * @returns True when the AST node is a selection node. + * @example + * ```ts + * import { Kind, isSelectionNode } from 'graphql/language'; + * + * const field = { kind: Kind.FIELD, name: { kind: Kind.NAME, value: 'hello' } }; + * const document = { kind: Kind.DOCUMENT, definitions: [] }; + * + * isSelectionNode(field); // => true + * isSelectionNode(document); // => false + * ``` + */ +export declare function isSelectionNode(node: ASTNode): node is SelectionNode; +/** + * Returns true when the AST node is a value node. + * @param node - The AST node to test. + * @returns True when the AST node is a value node. + * @example + * ```ts + * import { parseType, parseValue, isValueNode } from 'graphql/language'; + * + * const value = parseValue('[42]'); + * const type = parseType('[String!]'); + * + * isValueNode(value); // => true + * isValueNode(type); // => false + * ``` + */ +export declare function isValueNode(node: ASTNode): node is ValueNode; +/** + * Returns true when the AST node is a constant value node. + * @param node - The AST node to test. + * @returns True when the AST node is a constant value node. + * @example + * ```ts + * import { + * parseConstValue, + * parseValue, + * isConstValueNode, + * } from 'graphql/language'; + * + * const value = parseConstValue('[42]'); + * const variable = parseValue('$id'); + * + * isConstValueNode(value); // => true + * isConstValueNode(variable); // => false + * ``` + */ +export declare function isConstValueNode(node: ASTNode): node is ConstValueNode; +/** + * Returns true when the AST node is a type node. + * @param node - The AST node to test. + * @returns True when the AST node is a type node. + * @example + * ```ts + * import { parseType, parseValue, isTypeNode } from 'graphql/language'; + * + * const type = parseType('[String!]'); + * const value = parseValue('[42]'); + * + * isTypeNode(type); // => true + * isTypeNode(value); // => false + * ``` + */ +export declare function isTypeNode(node: ASTNode): node is TypeNode; +/** + * Returns true when the AST node is a type system definition node. + * @param node - The AST node to test. + * @returns True when the AST node is a type system definition node. + * @example + * ```ts + * import { parse, isTypeSystemDefinitionNode } from 'graphql/language'; + * + * const schema = parse('type Query { hello: String }'); + * const query = parse('{ hello }'); + * + * isTypeSystemDefinitionNode(schema.definitions[0]); // => true + * isTypeSystemDefinitionNode(query.definitions[0]); // => false + * ``` + */ +export declare function isTypeSystemDefinitionNode(node: ASTNode): node is TypeSystemDefinitionNode; +/** + * Returns true when the AST node is a type definition node. + * @param node - The AST node to test. + * @returns True when the AST node is a type definition node. + * @example + * ```ts + * import { parse, isTypeDefinitionNode } from 'graphql/language'; + * + * const typeDefinition = parse('type Query { hello: String }'); + * const directiveDefinition = parse('directive @cache on FIELD'); + * + * isTypeDefinitionNode(typeDefinition.definitions[0]); // => true + * isTypeDefinitionNode(directiveDefinition.definitions[0]); // => false + * ``` + */ +export declare function isTypeDefinitionNode(node: ASTNode): node is TypeDefinitionNode; +/** + * Returns true when the AST node is a type system extension node. + * @param node - The AST node to test. + * @returns True when the AST node is a type system extension node. + * @example + * ```ts + * import { parse, isTypeSystemExtensionNode } from 'graphql/language'; + * + * const extension = parse('extend type Query { hello: String }'); + * const definition = parse('type Query { hello: String }'); + * + * isTypeSystemExtensionNode(extension.definitions[0]); // => true + * isTypeSystemExtensionNode(definition.definitions[0]); // => false + * ``` + */ +export declare function isTypeSystemExtensionNode(node: ASTNode): node is TypeSystemExtensionNode; +/** + * Returns true when the AST node is a type extension node. + * @param node - The AST node to test. + * @returns True when the AST node is a type extension node. + * @example + * ```ts + * import { parse, isTypeExtensionNode } from 'graphql/language'; + * + * const extension = parse('extend type Query { hello: String }'); + * const schemaExtension = parse('extend schema { query: Query }'); + * + * isTypeExtensionNode(extension.definitions[0]); // => true + * isTypeExtensionNode(schemaExtension.definitions[0]); // => false + * ``` + */ +export declare function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode; +/** + * Returns true when the AST node is a schema coordinate node. + * @param node - The AST node to test. + * @returns True when the AST node is a schema coordinate node. + * @example + * ```ts + * import { + * parse, + * parseSchemaCoordinate, + * isSchemaCoordinateNode, + * } from 'graphql/language'; + * + * const coordinate = parseSchemaCoordinate('Query.hero'); + * const document = parse('{ hero }'); + * + * isSchemaCoordinateNode(coordinate); // => true + * isSchemaCoordinateNode(document); // => false + * ``` + */ +export declare function isSchemaCoordinateNode(node: ASTNode): node is SchemaCoordinateNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js new file mode 100644 index 00000000..2bb52a75 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isDefinitionNode = isDefinitionNode; +exports.isExecutableDefinitionNode = isExecutableDefinitionNode; +exports.isSubscriptionOperationDefinitionNode = isSubscriptionOperationDefinitionNode; +exports.isSelectionNode = isSelectionNode; +exports.isValueNode = isValueNode; +exports.isConstValueNode = isConstValueNode; +exports.isTypeNode = isTypeNode; +exports.isTypeSystemDefinitionNode = isTypeSystemDefinitionNode; +exports.isTypeDefinitionNode = isTypeDefinitionNode; +exports.isTypeSystemExtensionNode = isTypeSystemExtensionNode; +exports.isTypeExtensionNode = isTypeExtensionNode; +exports.isSchemaCoordinateNode = isSchemaCoordinateNode; +const ast_ts_1 = require("./ast.js"); +const kinds_ts_1 = require("./kinds.js"); +function isDefinitionNode(node) { + return (isExecutableDefinitionNode(node) || + isTypeSystemDefinitionNode(node) || + isTypeSystemExtensionNode(node)); +} +function isExecutableDefinitionNode(node) { + return (node.kind === kinds_ts_1.Kind.OPERATION_DEFINITION || + node.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION); +} +function isSubscriptionOperationDefinitionNode(node) { + return node.operation === ast_ts_1.OperationTypeNode.SUBSCRIPTION; +} +function isSelectionNode(node) { + return (node.kind === kinds_ts_1.Kind.FIELD || + node.kind === kinds_ts_1.Kind.FRAGMENT_SPREAD || + node.kind === kinds_ts_1.Kind.INLINE_FRAGMENT); +} +function isValueNode(node) { + return (node.kind === kinds_ts_1.Kind.VARIABLE || + node.kind === kinds_ts_1.Kind.INT || + node.kind === kinds_ts_1.Kind.FLOAT || + node.kind === kinds_ts_1.Kind.STRING || + node.kind === kinds_ts_1.Kind.BOOLEAN || + node.kind === kinds_ts_1.Kind.NULL || + node.kind === kinds_ts_1.Kind.ENUM || + node.kind === kinds_ts_1.Kind.LIST || + node.kind === kinds_ts_1.Kind.OBJECT); +} +function isConstValueNode(node) { + return (isValueNode(node) && + (node.kind === kinds_ts_1.Kind.LIST + ? node.values.some(isConstValueNode) + : node.kind === kinds_ts_1.Kind.OBJECT + ? node.fields.some((field) => isConstValueNode(field.value)) + : node.kind !== kinds_ts_1.Kind.VARIABLE)); +} +function isTypeNode(node) { + return (node.kind === kinds_ts_1.Kind.NAMED_TYPE || + node.kind === kinds_ts_1.Kind.LIST_TYPE || + node.kind === kinds_ts_1.Kind.NON_NULL_TYPE); +} +function isTypeSystemDefinitionNode(node) { + return (node.kind === kinds_ts_1.Kind.SCHEMA_DEFINITION || + isTypeDefinitionNode(node) || + node.kind === kinds_ts_1.Kind.DIRECTIVE_DEFINITION); +} +function isTypeDefinitionNode(node) { + return (node.kind === kinds_ts_1.Kind.SCALAR_TYPE_DEFINITION || + node.kind === kinds_ts_1.Kind.OBJECT_TYPE_DEFINITION || + node.kind === kinds_ts_1.Kind.INTERFACE_TYPE_DEFINITION || + node.kind === kinds_ts_1.Kind.UNION_TYPE_DEFINITION || + node.kind === kinds_ts_1.Kind.ENUM_TYPE_DEFINITION || + node.kind === kinds_ts_1.Kind.INPUT_OBJECT_TYPE_DEFINITION); +} +function isTypeSystemExtensionNode(node) { + return (node.kind === kinds_ts_1.Kind.SCHEMA_EXTENSION || + node.kind === kinds_ts_1.Kind.DIRECTIVE_EXTENSION || + isTypeExtensionNode(node)); +} +function isTypeExtensionNode(node) { + return (node.kind === kinds_ts_1.Kind.SCALAR_TYPE_EXTENSION || + node.kind === kinds_ts_1.Kind.OBJECT_TYPE_EXTENSION || + node.kind === kinds_ts_1.Kind.INTERFACE_TYPE_EXTENSION || + node.kind === kinds_ts_1.Kind.UNION_TYPE_EXTENSION || + node.kind === kinds_ts_1.Kind.ENUM_TYPE_EXTENSION || + node.kind === kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION); +} +function isSchemaCoordinateNode(node) { + return (node.kind === kinds_ts_1.Kind.TYPE_COORDINATE || + node.kind === kinds_ts_1.Kind.MEMBER_COORDINATE || + node.kind === kinds_ts_1.Kind.ARGUMENT_COORDINATE || + node.kind === kinds_ts_1.Kind.DIRECTIVE_COORDINATE || + node.kind === kinds_ts_1.Kind.DIRECTIVE_ARGUMENT_COORDINATE); +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js.map new file mode 100644 index 00000000..2334aeb7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../src/language/predicates.ts"],"names":[],"mappings":";;AAmCA,4CAMC;AAiBD,gEAOC;AAoBD,sFAIC;AAiBD,0CAMC;AAiBD,kCAYC;AAqBD,4CASC;AAiBD,gCAMC;AAiBD,gEAQC;AAiBD,oDAWC;AAiBD,8DAQC;AAiBD,kDASC;AAqBD,wDAUC;AAvTD,qCAA6C;AAC7C,yCAAkC;AAgBlC,SAAgB,gBAAgB,CAAC,IAAa;IAC5C,OAAO,CACL,0BAA0B,CAAC,IAAI,CAAC;QAChC,0BAA0B,CAAC,IAAI,CAAC;QAChC,yBAAyB,CAAC,IAAI,CAAC,CAChC,CAAC;AACJ,CAAC;AAiBD,SAAgB,0BAA0B,CACxC,IAAa;IAEb,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,oBAAoB;QACvC,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,mBAAmB,CACvC,CAAC;AACJ,CAAC;AAoBD,SAAgB,qCAAqC,CACnD,IAA6B;IAE7B,OAAO,IAAI,CAAC,SAAS,KAAK,0BAAiB,CAAC,YAAY,CAAC;AAC3D,CAAC;A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C,IAAI,KAAK,eAAI,CAAC,mBAAmB;QACtC,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,2BAA2B,CAC/C,CAAC;AACJ,CAAC;AAqBD,SAAgB,sBAAsB,CACpC,IAAa;IAEb,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,eAAe;QAClC,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,iBAAiB;QACpC,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,mBAAmB;QACtC,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,oBAAoB;QACvC,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,6BAA6B,CACjD,CAAC;AACJ,CAAC","sourcesContent":["/** @category AST Predicates */\n\nimport type {\n ASTNode,\n ConstValueNode,\n DefinitionNode,\n ExecutableDefinitionNode,\n OperationDefinitionNode,\n SchemaCoordinateNode,\n SelectionNode,\n SubscriptionOperationDefinitionNode,\n TypeDefinitionNode,\n TypeExtensionNode,\n TypeNode,\n TypeSystemDefinitionNode,\n TypeSystemExtensionNode,\n ValueNode,\n} from './ast.ts';\nimport { OperationTypeNode } from './ast.ts';\nimport { Kind } from './kinds.ts';\n\n/**\n * Returns true when the AST node is a definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a definition node.\n * @example\n * ```ts\n * import { parse, isDefinitionNode } from 'graphql/language';\n *\n * const document = parse('{ hello }');\n *\n * isDefinitionNode(document.definitions[0]); // => true\n * isDefinitionNode(document); // => false\n * ```\n */\nexport function isDefinitionNode(node: ASTNode): node is DefinitionNode {\n return (\n isExecutableDefinitionNode(node) ||\n isTypeSystemDefinitionNode(node) ||\n isTypeSystemExtensionNode(node)\n );\n}\n\n/**\n * Returns true when the AST node is an executable definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is an executable definition node.\n * @example\n * ```ts\n * import { parse, isExecutableDefinitionNode } from 'graphql/language';\n *\n * const query = parse('{ hello }');\n * const schema = parse('type Query { hello: String }');\n *\n * isExecutableDefinitionNode(query.definitions[0]); // => true\n * isExecutableDefinitionNode(schema.definitions[0]); // => false\n * ```\n */\nexport function isExecutableDefinitionNode(\n node: ASTNode,\n): node is ExecutableDefinitionNode {\n return (\n node.kind === Kind.OPERATION_DEFINITION ||\n node.kind === Kind.FRAGMENT_DEFINITION\n );\n}\n\n/**\n * A type predicate for SubscriptionOperationDefinitionNode.\n * Useful anywhere that must distinguish subscription operations from\n * queries and mutations, such as the subscription execution pipeline\n * which routes events through a different code path.\n * @param node - Operation definition node to test.\n * @returns True when the operation definition is a subscription.\n * @example\n * ```ts\n * import { parse, isSubscriptionOperationDefinitionNode } from 'graphql/language';\n *\n * const subscription = parse('subscription { greeting }').definitions[0];\n * const query = parse('{ greeting }').definitions[0];\n *\n * isSubscriptionOperationDefinitionNode(subscription); // => true\n * isSubscriptionOperationDefinitionNode(query); // => false\n * ```\n */\nexport function isSubscriptionOperationDefinitionNode(\n node: OperationDefinitionNode,\n): node is SubscriptionOperationDefinitionNode {\n return node.operation === OperationTypeNode.SUBSCRIPTION;\n}\n\n/**\n * Returns true when the AST node is a selection node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a selection node.\n * @example\n * ```ts\n * import { Kind, isSelectionNode } from 'graphql/language';\n *\n * const field = { kind: Kind.FIELD, name: { kind: Kind.NAME, value: 'hello' } };\n * const document = { kind: Kind.DOCUMENT, definitions: [] };\n *\n * isSelectionNode(field); // => true\n * isSelectionNode(document); // => false\n * ```\n */\nexport function isSelectionNode(node: ASTNode): node is SelectionNode {\n return (\n node.kind === Kind.FIELD ||\n node.kind === Kind.FRAGMENT_SPREAD ||\n node.kind === Kind.INLINE_FRAGMENT\n );\n}\n\n/**\n * Returns true when the AST node is a value node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a value node.\n * @example\n * ```ts\n * import { parseType, parseValue, isValueNode } from 'graphql/language';\n *\n * const value = parseValue('[42]');\n * const type = parseType('[String!]');\n *\n * isValueNode(value); // => true\n * isValueNode(type); // => false\n * ```\n */\nexport function isValueNode(node: ASTNode): node is ValueNode {\n return (\n node.kind === Kind.VARIABLE ||\n node.kind === Kind.INT ||\n node.kind === Kind.FLOAT ||\n node.kind === Kind.STRING ||\n node.kind === Kind.BOOLEAN ||\n node.kind === Kind.NULL ||\n node.kind === Kind.ENUM ||\n node.kind === Kind.LIST ||\n node.kind === Kind.OBJECT\n );\n}\n\n/**\n * Returns true when the AST node is a constant value node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a constant value node.\n * @example\n * ```ts\n * import {\n * parseConstValue,\n * parseValue,\n * isConstValueNode,\n * } from 'graphql/language';\n *\n * const value = parseConstValue('[42]');\n * const variable = parseValue('$id');\n *\n * isConstValueNode(value); // => true\n * isConstValueNode(variable); // => false\n * ```\n */\nexport function isConstValueNode(node: ASTNode): node is ConstValueNode {\n return (\n isValueNode(node) &&\n (node.kind === Kind.LIST\n ? node.values.some(isConstValueNode)\n : node.kind === Kind.OBJECT\n ? node.fields.some((field) => isConstValueNode(field.value))\n : node.kind !== Kind.VARIABLE)\n );\n}\n\n/**\n * Returns true when the AST node is a type node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type node.\n * @example\n * ```ts\n * import { parseType, parseValue, isTypeNode } from 'graphql/language';\n *\n * const type = parseType('[String!]');\n * const value = parseValue('[42]');\n *\n * isTypeNode(type); // => true\n * isTypeNode(value); // => false\n * ```\n */\nexport function isTypeNode(node: ASTNode): node is TypeNode {\n return (\n node.kind === Kind.NAMED_TYPE ||\n node.kind === Kind.LIST_TYPE ||\n node.kind === Kind.NON_NULL_TYPE\n );\n}\n\n/**\n * Returns true when the AST node is a type system definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type system definition node.\n * @example\n * ```ts\n * import { parse, isTypeSystemDefinitionNode } from 'graphql/language';\n *\n * const schema = parse('type Query { hello: String }');\n * const query = parse('{ hello }');\n *\n * isTypeSystemDefinitionNode(schema.definitions[0]); // => true\n * isTypeSystemDefinitionNode(query.definitions[0]); // => false\n * ```\n */\nexport function isTypeSystemDefinitionNode(\n node: ASTNode,\n): node is TypeSystemDefinitionNode {\n return (\n node.kind === Kind.SCHEMA_DEFINITION ||\n isTypeDefinitionNode(node) ||\n node.kind === Kind.DIRECTIVE_DEFINITION\n );\n}\n\n/**\n * Returns true when the AST node is a type definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type definition node.\n * @example\n * ```ts\n * import { parse, isTypeDefinitionNode } from 'graphql/language';\n *\n * const typeDefinition = parse('type Query { hello: String }');\n * const directiveDefinition = parse('directive @cache on FIELD');\n *\n * isTypeDefinitionNode(typeDefinition.definitions[0]); // => true\n * isTypeDefinitionNode(directiveDefinition.definitions[0]); // => false\n * ```\n */\nexport function isTypeDefinitionNode(\n node: ASTNode,\n): node is TypeDefinitionNode {\n return (\n node.kind === Kind.SCALAR_TYPE_DEFINITION ||\n node.kind === Kind.OBJECT_TYPE_DEFINITION ||\n node.kind === Kind.INTERFACE_TYPE_DEFINITION ||\n node.kind === Kind.UNION_TYPE_DEFINITION ||\n node.kind === Kind.ENUM_TYPE_DEFINITION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION\n );\n}\n\n/**\n * Returns true when the AST node is a type system extension node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type system extension node.\n * @example\n * ```ts\n * import { parse, isTypeSystemExtensionNode } from 'graphql/language';\n *\n * const extension = parse('extend type Query { hello: String }');\n * const definition = parse('type Query { hello: String }');\n *\n * isTypeSystemExtensionNode(extension.definitions[0]); // => true\n * isTypeSystemExtensionNode(definition.definitions[0]); // => false\n * ```\n */\nexport function isTypeSystemExtensionNode(\n node: ASTNode,\n): node is TypeSystemExtensionNode {\n return (\n node.kind === Kind.SCHEMA_EXTENSION ||\n node.kind === Kind.DIRECTIVE_EXTENSION ||\n isTypeExtensionNode(node)\n );\n}\n\n/**\n * Returns true when the AST node is a type extension node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type extension node.\n * @example\n * ```ts\n * import { parse, isTypeExtensionNode } from 'graphql/language';\n *\n * const extension = parse('extend type Query { hello: String }');\n * const schemaExtension = parse('extend schema { query: Query }');\n *\n * isTypeExtensionNode(extension.definitions[0]); // => true\n * isTypeExtensionNode(schemaExtension.definitions[0]); // => false\n * ```\n */\nexport function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode {\n return (\n node.kind === Kind.SCALAR_TYPE_EXTENSION ||\n node.kind === Kind.OBJECT_TYPE_EXTENSION ||\n node.kind === Kind.INTERFACE_TYPE_EXTENSION ||\n node.kind === Kind.UNION_TYPE_EXTENSION ||\n node.kind === Kind.ENUM_TYPE_EXTENSION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n );\n}\n\n/**\n * Returns true when the AST node is a schema coordinate node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a schema coordinate node.\n * @example\n * ```ts\n * import {\n * parse,\n * parseSchemaCoordinate,\n * isSchemaCoordinateNode,\n * } from 'graphql/language';\n *\n * const coordinate = parseSchemaCoordinate('Query.hero');\n * const document = parse('{ hero }');\n *\n * isSchemaCoordinateNode(coordinate); // => true\n * isSchemaCoordinateNode(document); // => false\n * ```\n */\nexport function isSchemaCoordinateNode(\n node: ASTNode,\n): node is SchemaCoordinateNode {\n return (\n node.kind === Kind.TYPE_COORDINATE ||\n node.kind === Kind.MEMBER_COORDINATE ||\n node.kind === Kind.ARGUMENT_COORDINATE ||\n node.kind === Kind.DIRECTIVE_COORDINATE ||\n node.kind === Kind.DIRECTIVE_ARGUMENT_COORDINATE\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs new file mode 100644 index 00000000..54cce1ed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs @@ -0,0 +1,77 @@ +import { OperationTypeNode } from "./ast.mjs"; +import { Kind } from "./kinds.mjs"; +export function isDefinitionNode(node) { + return (isExecutableDefinitionNode(node) || + isTypeSystemDefinitionNode(node) || + isTypeSystemExtensionNode(node)); +} +export function isExecutableDefinitionNode(node) { + return (node.kind === Kind.OPERATION_DEFINITION || + node.kind === Kind.FRAGMENT_DEFINITION); +} +export function isSubscriptionOperationDefinitionNode(node) { + return node.operation === OperationTypeNode.SUBSCRIPTION; +} +export function isSelectionNode(node) { + return (node.kind === Kind.FIELD || + node.kind === Kind.FRAGMENT_SPREAD || + node.kind === Kind.INLINE_FRAGMENT); +} +export function isValueNode(node) { + return (node.kind === Kind.VARIABLE || + node.kind === Kind.INT || + node.kind === Kind.FLOAT || + node.kind === Kind.STRING || + node.kind === Kind.BOOLEAN || + node.kind === Kind.NULL || + node.kind === Kind.ENUM || + node.kind === Kind.LIST || + node.kind === Kind.OBJECT); +} +export function isConstValueNode(node) { + return (isValueNode(node) && + (node.kind === Kind.LIST + ? node.values.some(isConstValueNode) + : node.kind === Kind.OBJECT + ? node.fields.some((field) => isConstValueNode(field.value)) + : node.kind !== Kind.VARIABLE)); +} +export function isTypeNode(node) { + return (node.kind === Kind.NAMED_TYPE || + node.kind === Kind.LIST_TYPE || + node.kind === Kind.NON_NULL_TYPE); +} +export function isTypeSystemDefinitionNode(node) { + return (node.kind === Kind.SCHEMA_DEFINITION || + isTypeDefinitionNode(node) || + node.kind === Kind.DIRECTIVE_DEFINITION); +} +export function isTypeDefinitionNode(node) { + return (node.kind === Kind.SCALAR_TYPE_DEFINITION || + node.kind === Kind.OBJECT_TYPE_DEFINITION || + node.kind === Kind.INTERFACE_TYPE_DEFINITION || + node.kind === Kind.UNION_TYPE_DEFINITION || + node.kind === Kind.ENUM_TYPE_DEFINITION || + node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION); +} +export function isTypeSystemExtensionNode(node) { + return (node.kind === Kind.SCHEMA_EXTENSION || + node.kind === Kind.DIRECTIVE_EXTENSION || + isTypeExtensionNode(node)); +} +export function isTypeExtensionNode(node) { + return (node.kind === Kind.SCALAR_TYPE_EXTENSION || + node.kind === Kind.OBJECT_TYPE_EXTENSION || + node.kind === Kind.INTERFACE_TYPE_EXTENSION || + node.kind === Kind.UNION_TYPE_EXTENSION || + node.kind === Kind.ENUM_TYPE_EXTENSION || + node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION); +} +export function isSchemaCoordinateNode(node) { + return (node.kind === Kind.TYPE_COORDINATE || + node.kind === Kind.MEMBER_COORDINATE || + node.kind === Kind.ARGUMENT_COORDINATE || + node.kind === Kind.DIRECTIVE_COORDINATE || + node.kind === Kind.DIRECTIVE_ARGUMENT_COORDINATE); +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs.map new file mode 100644 index 00000000..51f70a50 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/predicates.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../src/language/predicates.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,iBAAiB,EAAE,kBAAiB;AAC7C,OAAO,EAAE,IAAI,EAAE,oBAAmB;AAgBlC,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC5C,OAAO,CACL,0BAA0B,CAAC,IAAI,CAAC;QAChC,0BAA0B,CAAC,IAAI,CAAC;QAChC,yBAAyB,CAAC,IAAI,CAAC,CAChC,CAAC;AACJ,CAAC;AAiBD,MAAM,UAAU,0BAA0B,CACxC,IAAa;IAEb,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,oBAAoB;QACvC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,mBAAmB,CACvC,CAAC;AACJ,CAAC;AAoBD,MAAM,UAAU,qCAAqC,CACnD,IAA6B;IAE7B,OAAO,IAAI,CAAC,SAAS,KAAK,iBAAiB,CAAC,YAAY,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AAI,CAAC,IAAI,KAAK,IAAI,CAAC,oBAAoB;QACvC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,mBAAmB;QACtC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,2BAA2B,CAC/C,CAAC;AACJ,CAAC;AAqBD,MAAM,UAAU,sBAAsB,CACpC,IAAa;IAEb,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,eAAe;QAClC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,iBAAiB;QACpC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,mBAAmB;QACtC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,oBAAoB;QACvC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,6BAA6B,CACjD,CAAC;AACJ,CAAC","sourcesContent":["/** @category AST Predicates */\n\nimport type {\n ASTNode,\n ConstValueNode,\n DefinitionNode,\n ExecutableDefinitionNode,\n OperationDefinitionNode,\n SchemaCoordinateNode,\n SelectionNode,\n SubscriptionOperationDefinitionNode,\n TypeDefinitionNode,\n TypeExtensionNode,\n TypeNode,\n TypeSystemDefinitionNode,\n TypeSystemExtensionNode,\n ValueNode,\n} from './ast.ts';\nimport { OperationTypeNode } from './ast.ts';\nimport { Kind } from './kinds.ts';\n\n/**\n * Returns true when the AST node is a definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a definition node.\n * @example\n * ```ts\n * import { parse, isDefinitionNode } from 'graphql/language';\n *\n * const document = parse('{ hello }');\n *\n * isDefinitionNode(document.definitions[0]); // => true\n * isDefinitionNode(document); // => false\n * ```\n */\nexport function isDefinitionNode(node: ASTNode): node is DefinitionNode {\n return (\n isExecutableDefinitionNode(node) ||\n isTypeSystemDefinitionNode(node) ||\n isTypeSystemExtensionNode(node)\n );\n}\n\n/**\n * Returns true when the AST node is an executable definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is an executable definition node.\n * @example\n * ```ts\n * import { parse, isExecutableDefinitionNode } from 'graphql/language';\n *\n * const query = parse('{ hello }');\n * const schema = parse('type Query { hello: String }');\n *\n * isExecutableDefinitionNode(query.definitions[0]); // => true\n * isExecutableDefinitionNode(schema.definitions[0]); // => false\n * ```\n */\nexport function isExecutableDefinitionNode(\n node: ASTNode,\n): node is ExecutableDefinitionNode {\n return (\n node.kind === Kind.OPERATION_DEFINITION ||\n node.kind === Kind.FRAGMENT_DEFINITION\n );\n}\n\n/**\n * A type predicate for SubscriptionOperationDefinitionNode.\n * Useful anywhere that must distinguish subscription operations from\n * queries and mutations, such as the subscription execution pipeline\n * which routes events through a different code path.\n * @param node - Operation definition node to test.\n * @returns True when the operation definition is a subscription.\n * @example\n * ```ts\n * import { parse, isSubscriptionOperationDefinitionNode } from 'graphql/language';\n *\n * const subscription = parse('subscription { greeting }').definitions[0];\n * const query = parse('{ greeting }').definitions[0];\n *\n * isSubscriptionOperationDefinitionNode(subscription); // => true\n * isSubscriptionOperationDefinitionNode(query); // => false\n * ```\n */\nexport function isSubscriptionOperationDefinitionNode(\n node: OperationDefinitionNode,\n): node is SubscriptionOperationDefinitionNode {\n return node.operation === OperationTypeNode.SUBSCRIPTION;\n}\n\n/**\n * Returns true when the AST node is a selection node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a selection node.\n * @example\n * ```ts\n * import { Kind, isSelectionNode } from 'graphql/language';\n *\n * const field = { kind: Kind.FIELD, name: { kind: Kind.NAME, value: 'hello' } };\n * const document = { kind: Kind.DOCUMENT, definitions: [] };\n *\n * isSelectionNode(field); // => true\n * isSelectionNode(document); // => false\n * ```\n */\nexport function isSelectionNode(node: ASTNode): node is SelectionNode {\n return (\n node.kind === Kind.FIELD ||\n node.kind === Kind.FRAGMENT_SPREAD ||\n node.kind === Kind.INLINE_FRAGMENT\n );\n}\n\n/**\n * Returns true when the AST node is a value node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a value node.\n * @example\n * ```ts\n * import { parseType, parseValue, isValueNode } from 'graphql/language';\n *\n * const value = parseValue('[42]');\n * const type = parseType('[String!]');\n *\n * isValueNode(value); // => true\n * isValueNode(type); // => false\n * ```\n */\nexport function isValueNode(node: ASTNode): node is ValueNode {\n return (\n node.kind === Kind.VARIABLE ||\n node.kind === Kind.INT ||\n node.kind === Kind.FLOAT ||\n node.kind === Kind.STRING ||\n node.kind === Kind.BOOLEAN ||\n node.kind === Kind.NULL ||\n node.kind === Kind.ENUM ||\n node.kind === Kind.LIST ||\n node.kind === Kind.OBJECT\n );\n}\n\n/**\n * Returns true when the AST node is a constant value node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a constant value node.\n * @example\n * ```ts\n * import {\n * parseConstValue,\n * parseValue,\n * isConstValueNode,\n * } from 'graphql/language';\n *\n * const value = parseConstValue('[42]');\n * const variable = parseValue('$id');\n *\n * isConstValueNode(value); // => true\n * isConstValueNode(variable); // => false\n * ```\n */\nexport function isConstValueNode(node: ASTNode): node is ConstValueNode {\n return (\n isValueNode(node) &&\n (node.kind === Kind.LIST\n ? node.values.some(isConstValueNode)\n : node.kind === Kind.OBJECT\n ? node.fields.some((field) => isConstValueNode(field.value))\n : node.kind !== Kind.VARIABLE)\n );\n}\n\n/**\n * Returns true when the AST node is a type node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type node.\n * @example\n * ```ts\n * import { parseType, parseValue, isTypeNode } from 'graphql/language';\n *\n * const type = parseType('[String!]');\n * const value = parseValue('[42]');\n *\n * isTypeNode(type); // => true\n * isTypeNode(value); // => false\n * ```\n */\nexport function isTypeNode(node: ASTNode): node is TypeNode {\n return (\n node.kind === Kind.NAMED_TYPE ||\n node.kind === Kind.LIST_TYPE ||\n node.kind === Kind.NON_NULL_TYPE\n );\n}\n\n/**\n * Returns true when the AST node is a type system definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type system definition node.\n * @example\n * ```ts\n * import { parse, isTypeSystemDefinitionNode } from 'graphql/language';\n *\n * const schema = parse('type Query { hello: String }');\n * const query = parse('{ hello }');\n *\n * isTypeSystemDefinitionNode(schema.definitions[0]); // => true\n * isTypeSystemDefinitionNode(query.definitions[0]); // => false\n * ```\n */\nexport function isTypeSystemDefinitionNode(\n node: ASTNode,\n): node is TypeSystemDefinitionNode {\n return (\n node.kind === Kind.SCHEMA_DEFINITION ||\n isTypeDefinitionNode(node) ||\n node.kind === Kind.DIRECTIVE_DEFINITION\n );\n}\n\n/**\n * Returns true when the AST node is a type definition node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type definition node.\n * @example\n * ```ts\n * import { parse, isTypeDefinitionNode } from 'graphql/language';\n *\n * const typeDefinition = parse('type Query { hello: String }');\n * const directiveDefinition = parse('directive @cache on FIELD');\n *\n * isTypeDefinitionNode(typeDefinition.definitions[0]); // => true\n * isTypeDefinitionNode(directiveDefinition.definitions[0]); // => false\n * ```\n */\nexport function isTypeDefinitionNode(\n node: ASTNode,\n): node is TypeDefinitionNode {\n return (\n node.kind === Kind.SCALAR_TYPE_DEFINITION ||\n node.kind === Kind.OBJECT_TYPE_DEFINITION ||\n node.kind === Kind.INTERFACE_TYPE_DEFINITION ||\n node.kind === Kind.UNION_TYPE_DEFINITION ||\n node.kind === Kind.ENUM_TYPE_DEFINITION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION\n );\n}\n\n/**\n * Returns true when the AST node is a type system extension node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type system extension node.\n * @example\n * ```ts\n * import { parse, isTypeSystemExtensionNode } from 'graphql/language';\n *\n * const extension = parse('extend type Query { hello: String }');\n * const definition = parse('type Query { hello: String }');\n *\n * isTypeSystemExtensionNode(extension.definitions[0]); // => true\n * isTypeSystemExtensionNode(definition.definitions[0]); // => false\n * ```\n */\nexport function isTypeSystemExtensionNode(\n node: ASTNode,\n): node is TypeSystemExtensionNode {\n return (\n node.kind === Kind.SCHEMA_EXTENSION ||\n node.kind === Kind.DIRECTIVE_EXTENSION ||\n isTypeExtensionNode(node)\n );\n}\n\n/**\n * Returns true when the AST node is a type extension node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a type extension node.\n * @example\n * ```ts\n * import { parse, isTypeExtensionNode } from 'graphql/language';\n *\n * const extension = parse('extend type Query { hello: String }');\n * const schemaExtension = parse('extend schema { query: Query }');\n *\n * isTypeExtensionNode(extension.definitions[0]); // => true\n * isTypeExtensionNode(schemaExtension.definitions[0]); // => false\n * ```\n */\nexport function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode {\n return (\n node.kind === Kind.SCALAR_TYPE_EXTENSION ||\n node.kind === Kind.OBJECT_TYPE_EXTENSION ||\n node.kind === Kind.INTERFACE_TYPE_EXTENSION ||\n node.kind === Kind.UNION_TYPE_EXTENSION ||\n node.kind === Kind.ENUM_TYPE_EXTENSION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n );\n}\n\n/**\n * Returns true when the AST node is a schema coordinate node.\n * @param node - The AST node to test.\n * @returns True when the AST node is a schema coordinate node.\n * @example\n * ```ts\n * import {\n * parse,\n * parseSchemaCoordinate,\n * isSchemaCoordinateNode,\n * } from 'graphql/language';\n *\n * const coordinate = parseSchemaCoordinate('Query.hero');\n * const document = parse('{ hero }');\n *\n * isSchemaCoordinateNode(coordinate); // => true\n * isSchemaCoordinateNode(document); // => false\n * ```\n */\nexport function isSchemaCoordinateNode(\n node: ASTNode,\n): node is SchemaCoordinateNode {\n return (\n node.kind === Kind.TYPE_COORDINATE ||\n node.kind === Kind.MEMBER_COORDINATE ||\n node.kind === Kind.ARGUMENT_COORDINATE ||\n node.kind === Kind.DIRECTIVE_COORDINATE ||\n node.kind === Kind.DIRECTIVE_ARGUMENT_COORDINATE\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.mts new file mode 100644 index 00000000..95196b55 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.mts @@ -0,0 +1,39 @@ +/** @category Source */ +import type { Location } from "./ast.mjs"; +import type { SourceLocation } from "./location.mjs"; +import type { Source } from "./source.mjs"; +/** + * Render a helpful description of the location in the GraphQL Source document. + * @param location - The AST location to print. + * @returns A formatted source excerpt with line and column information. + * @example + * ```ts + * import { parse, printLocation } from 'graphql/language'; + * + * const document = parse('type Query { hello: String }'); + * const location = document.definitions[0].loc; + * + * if (location) { + * const printed = printLocation(location); + * + * printed; // => 'GraphQL request:1:1\n1 | type Query { hello: String }\n | ^' + * } + * ``` + */ +export declare function printLocation(location: Location): string; +/** + * Render a helpful description of the location in the GraphQL Source document. + * @param source - The source document that contains the location. + * @param sourceLocation - The 1-indexed line and column to print. + * @returns A formatted source excerpt with line and column information. + * @example + * ```ts + * import { Source, printSourceLocation } from 'graphql/language'; + * + * const source = new Source('type Query { hello: String }'); + * const printed = printSourceLocation(source, { line: 1, column: 14 }); + * + * printed; // => 'GraphQL request:1:14\n1 | type Query { hello: String }\n | ^' + * ``` + */ +export declare function printSourceLocation(source: Source, sourceLocation: SourceLocation): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.ts new file mode 100644 index 00000000..4b214a01 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.d.ts @@ -0,0 +1,39 @@ +/** @category Source */ +import type { Location } from "./ast.js"; +import type { SourceLocation } from "./location.js"; +import type { Source } from "./source.js"; +/** + * Render a helpful description of the location in the GraphQL Source document. + * @param location - The AST location to print. + * @returns A formatted source excerpt with line and column information. + * @example + * ```ts + * import { parse, printLocation } from 'graphql/language'; + * + * const document = parse('type Query { hello: String }'); + * const location = document.definitions[0].loc; + * + * if (location) { + * const printed = printLocation(location); + * + * printed; // => 'GraphQL request:1:1\n1 | type Query { hello: String }\n | ^' + * } + * ``` + */ +export declare function printLocation(location: Location): string; +/** + * Render a helpful description of the location in the GraphQL Source document. + * @param source - The source document that contains the location. + * @param sourceLocation - The 1-indexed line and column to print. + * @returns A formatted source excerpt with line and column information. + * @example + * ```ts + * import { Source, printSourceLocation } from 'graphql/language'; + * + * const source = new Source('type Query { hello: String }'); + * const printed = printSourceLocation(source, { line: 1, column: 14 }); + * + * printed; // => 'GraphQL request:1:14\n1 | type Query { hello: String }\n | ^' + * ``` + */ +export declare function printSourceLocation(source: Source, sourceLocation: SourceLocation): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js new file mode 100644 index 00000000..492656e9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.printLocation = printLocation; +exports.printSourceLocation = printSourceLocation; +const location_ts_1 = require("./location.js"); +function printLocation(location) { + return printSourceLocation(location.source, (0, location_ts_1.getLocation)(location.source, location.start)); +} +function printSourceLocation(source, sourceLocation) { + const firstLineColumnOffset = source.locationOffset.column - 1; + const body = ''.padStart(firstLineColumnOffset) + source.body; + const lineIndex = sourceLocation.line - 1; + const lineOffset = source.locationOffset.line - 1; + const lineNum = sourceLocation.line + lineOffset; + const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; + const columnNum = sourceLocation.column + columnOffset; + const locationStr = `${source.name}:${lineNum}:${columnNum}\n`; + const lines = body.split(/\r\n|[\n\r]/g); + const locationLine = lines[lineIndex]; + if (locationLine.length > 120) { + const subLineIndex = Math.floor(columnNum / 80); + const subLineColumnNum = columnNum % 80; + const subLines = []; + for (let i = 0; i < locationLine.length; i += 80) { + subLines.push(locationLine.slice(i, i + 80)); + } + return (locationStr + + printPrefixedLines([ + [`${lineNum} |`, subLines[0]], + ...subLines + .slice(1, subLineIndex + 1) + .map((subLine) => ['|', subLine]), + ['|', '^'.padStart(subLineColumnNum)], + ['|', subLines[subLineIndex + 1]], + ])); + } + return (locationStr + + printPrefixedLines([ + [`${lineNum - 1} |`, lines[lineIndex - 1]], + [`${lineNum} |`, locationLine], + ['|', '^'.padStart(columnNum)], + [`${lineNum + 1} |`, lines[lineIndex + 1]], + ])); +} +function printPrefixedLines(lines) { + const existingLines = lines.filter(([_, line]) => line !== undefined); + const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); + return existingLines + .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : '')) + .join('\n'); +} +//# sourceMappingURL=printLocation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js.map new file mode 100644 index 00000000..3ddac4fe --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"printLocation.js","sourceRoot":"","sources":["../../src/language/printLocation.ts"],"names":[],"mappings":";;AAyBA,sCAKC;AAiBD,kDAkDC;AA7FD,+CAA4C;AAqB5C,SAAgB,aAAa,CAAC,QAAkB;IAC9C,OAAO,mBAAmB,CACxB,QAAQ,CAAC,MAAM,EACf,IAAA,yBAAW,EAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAC7C,CAAC;AACJ,CAAC;AAiBD,SAAgB,mBAAmB,CACjC,MAAc,EACd,cAA8B;IAE9B,MAAM,qBAAqB,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;IAE9D,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,GAAG,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,G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AgB,CAAC,CAAC;gBACrC,CAAC,GAAG,EAAE,QAAQ,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;aAClC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,WAAW;QACX,kBAAkB,CAAC;YAEjB,CAAC,GAAG,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;YAC1C,CAAC,GAAG,OAAO,IAAI,EAAE,YAAY,CAAC;YAC9B,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC9B,CAAC,GAAG,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;SAC3C,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,KAA+C;IAE/C,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAEtE,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3E,OAAO,aAAa;SACjB,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC3E,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC","sourcesContent":["/** @category Source */\n\nimport type { Location } from './ast.ts';\nimport type { SourceLocation } from './location.ts';\nimport { getLocation } from './location.ts';\nimport type { Source } from './source.ts';\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n * @param location - The AST location to print.\n * @returns A formatted source excerpt with line and column information.\n * @example\n * ```ts\n * import { parse, printLocation } from 'graphql/language';\n *\n * const document = parse('type Query { hello: String }');\n * const location = document.definitions[0].loc;\n *\n * if (location) {\n * const printed = printLocation(location);\n *\n * printed; // => 'GraphQL request:1:1\\n1 | type Query { hello: String }\\n | ^'\n * }\n * ```\n */\nexport function printLocation(location: Location): string {\n return printSourceLocation(\n location.source,\n getLocation(location.source, location.start),\n );\n}\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n * @param source - The source document that contains the location.\n * @param sourceLocation - The 1-indexed line and column to print.\n * @returns A formatted source excerpt with line and column information.\n * @example\n * ```ts\n * import { Source, printSourceLocation } from 'graphql/language';\n *\n * const source = new Source('type Query { hello: String }');\n * const printed = printSourceLocation(source, { line: 1, column: 14 });\n *\n * printed; // => 'GraphQL request:1:14\\n1 | type Query { hello: String }\\n | ^'\n * ```\n */\nexport function printSourceLocation(\n source: Source,\n sourceLocation: SourceLocation,\n): string {\n const firstLineColumnOffset = source.locationOffset.column - 1;\n const body = ''.padStart(firstLineColumnOffset) + source.body;\n\n const lineIndex = sourceLocation.line - 1;\n const lineOffset = source.locationOffset.line - 1;\n const lineNum = sourceLocation.line + lineOffset;\n\n const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n const columnNum = sourceLocation.column + columnOffset;\n const locationStr = `${source.name}:${lineNum}:${columnNum}\\n`;\n\n const lines = body.split(/\\r\\n|[\\n\\r]/g);\n const locationLine = lines[lineIndex];\n\n // Special case for minified documents\n if (locationLine.length > 120) {\n const subLineIndex = Math.floor(columnNum / 80);\n const subLineColumnNum = columnNum % 80;\n const subLines: Array = [];\n for (let i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return (\n locationStr +\n printPrefixedLines([\n [`${lineNum} |`, subLines[0]],\n ...subLines\n .slice(1, subLineIndex + 1)\n .map((subLine) => ['|', subLine] as const),\n ['|', '^'.padStart(subLineColumnNum)],\n ['|', subLines[subLineIndex + 1]],\n ])\n );\n }\n\n return (\n locationStr +\n printPrefixedLines([\n // Lines specified like this: [\"prefix\", \"string\"],\n [`${lineNum - 1} |`, lines[lineIndex - 1]],\n [`${lineNum} |`, locationLine],\n ['|', '^'.padStart(columnNum)],\n [`${lineNum + 1} |`, lines[lineIndex + 1]],\n ])\n );\n}\n\nfunction printPrefixedLines(\n lines: ReadonlyArray,\n): string {\n const existingLines = lines.filter(([_, line]) => line !== undefined);\n\n const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));\n return existingLines\n .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : ''))\n .join('\\n');\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs new file mode 100644 index 00000000..c64c314f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs @@ -0,0 +1,48 @@ +import { getLocation } from "./location.mjs"; +export function printLocation(location) { + return printSourceLocation(location.source, getLocation(location.source, location.start)); +} +export function printSourceLocation(source, sourceLocation) { + const firstLineColumnOffset = source.locationOffset.column - 1; + const body = ''.padStart(firstLineColumnOffset) + source.body; + const lineIndex = sourceLocation.line - 1; + const lineOffset = source.locationOffset.line - 1; + const lineNum = sourceLocation.line + lineOffset; + const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; + const columnNum = sourceLocation.column + columnOffset; + const locationStr = `${source.name}:${lineNum}:${columnNum}\n`; + const lines = body.split(/\r\n|[\n\r]/g); + const locationLine = lines[lineIndex]; + if (locationLine.length > 120) { + const subLineIndex = Math.floor(columnNum / 80); + const subLineColumnNum = columnNum % 80; + const subLines = []; + for (let i = 0; i < locationLine.length; i += 80) { + subLines.push(locationLine.slice(i, i + 80)); + } + return (locationStr + + printPrefixedLines([ + [`${lineNum} |`, subLines[0]], + ...subLines + .slice(1, subLineIndex + 1) + .map((subLine) => ['|', subLine]), + ['|', '^'.padStart(subLineColumnNum)], + ['|', subLines[subLineIndex + 1]], + ])); + } + return (locationStr + + printPrefixedLines([ + [`${lineNum - 1} |`, lines[lineIndex - 1]], + [`${lineNum} |`, locationLine], + ['|', '^'.padStart(columnNum)], + [`${lineNum + 1} |`, lines[lineIndex + 1]], + ])); +} +function printPrefixedLines(lines) { + const existingLines = lines.filter(([_, line]) => line !== undefined); + const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); + return existingLines + .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : '')) + .join('\n'); +} +//# sourceMappingURL=printLocation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs.map new file mode 100644 index 00000000..c0b0629e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printLocation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"printLocation.js","sourceRoot":"","sources":["../../src/language/printLocation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,uBAAsB;AAqB5C,MAAM,UAAU,aAAa,CAAC,QAAkB;IAC9C,OAAO,mBAAmB,CACxB,QAAQ,CAAC,MAAM,EACf,WAAW,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAC7C,CAAC;AACJ,CAAC;AAiBD,MAAM,UAAU,mBAAmB,CACjC,MAAc,EACd,cAA8B;IAE9B,MAAM,qBAAqB,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;IAE9D,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,GAAG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O,CAAU,CAAC;gBAC5C,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBACrC,CAAC,GAAG,EAAE,QAAQ,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;aAClC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,WAAW;QACX,kBAAkB,CAAC;YAEjB,CAAC,GAAG,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;YAC1C,CAAC,GAAG,OAAO,IAAI,EAAE,YAAY,CAAC;YAC9B,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC9B,CAAC,GAAG,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;SAC3C,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,KAA+C;IAE/C,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAEtE,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3E,OAAO,aAAa;SACjB,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC3E,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC","sourcesContent":["/** @category Source */\n\nimport type { Location } from './ast.ts';\nimport type { SourceLocation } from './location.ts';\nimport { getLocation } from './location.ts';\nimport type { Source } from './source.ts';\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n * @param location - The AST location to print.\n * @returns A formatted source excerpt with line and column information.\n * @example\n * ```ts\n * import { parse, printLocation } from 'graphql/language';\n *\n * const document = parse('type Query { hello: String }');\n * const location = document.definitions[0].loc;\n *\n * if (location) {\n * const printed = printLocation(location);\n *\n * printed; // => 'GraphQL request:1:1\\n1 | type Query { hello: String }\\n | ^'\n * }\n * ```\n */\nexport function printLocation(location: Location): string {\n return printSourceLocation(\n location.source,\n getLocation(location.source, location.start),\n );\n}\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n * @param source - The source document that contains the location.\n * @param sourceLocation - The 1-indexed line and column to print.\n * @returns A formatted source excerpt with line and column information.\n * @example\n * ```ts\n * import { Source, printSourceLocation } from 'graphql/language';\n *\n * const source = new Source('type Query { hello: String }');\n * const printed = printSourceLocation(source, { line: 1, column: 14 });\n *\n * printed; // => 'GraphQL request:1:14\\n1 | type Query { hello: String }\\n | ^'\n * ```\n */\nexport function printSourceLocation(\n source: Source,\n sourceLocation: SourceLocation,\n): string {\n const firstLineColumnOffset = source.locationOffset.column - 1;\n const body = ''.padStart(firstLineColumnOffset) + source.body;\n\n const lineIndex = sourceLocation.line - 1;\n const lineOffset = source.locationOffset.line - 1;\n const lineNum = sourceLocation.line + lineOffset;\n\n const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n const columnNum = sourceLocation.column + columnOffset;\n const locationStr = `${source.name}:${lineNum}:${columnNum}\\n`;\n\n const lines = body.split(/\\r\\n|[\\n\\r]/g);\n const locationLine = lines[lineIndex];\n\n // Special case for minified documents\n if (locationLine.length > 120) {\n const subLineIndex = Math.floor(columnNum / 80);\n const subLineColumnNum = columnNum % 80;\n const subLines: Array = [];\n for (let i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return (\n locationStr +\n printPrefixedLines([\n [`${lineNum} |`, subLines[0]],\n ...subLines\n .slice(1, subLineIndex + 1)\n .map((subLine) => ['|', subLine] as const),\n ['|', '^'.padStart(subLineColumnNum)],\n ['|', subLines[subLineIndex + 1]],\n ])\n );\n }\n\n return (\n locationStr +\n printPrefixedLines([\n // Lines specified like this: [\"prefix\", \"string\"],\n [`${lineNum - 1} |`, lines[lineIndex - 1]],\n [`${lineNum} |`, locationLine],\n ['|', '^'.padStart(columnNum)],\n [`${lineNum + 1} |`, lines[lineIndex + 1]],\n ])\n );\n}\n\nfunction printPrefixedLines(\n lines: ReadonlyArray,\n): string {\n const existingLines = lines.filter(([_, line]) => line !== undefined);\n\n const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));\n return existingLines\n .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : ''))\n .join('\\n');\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.mts new file mode 100644 index 00000000..ac7833c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.mts @@ -0,0 +1,7 @@ +/** + * Prints a string as a GraphQL StringValue literal. Replaces control characters + * and excluded characters (" U+0022 and \\ U+005C) with escape sequences. + * + * @internal + */ +export declare function printString(str: string): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.ts new file mode 100644 index 00000000..ac7833c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.d.ts @@ -0,0 +1,7 @@ +/** + * Prints a string as a GraphQL StringValue literal. Replaces control characters + * and excluded characters (" U+0022 and \\ U+005C) with escape sequences. + * + * @internal + */ +export declare function printString(str: string): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js new file mode 100644 index 00000000..2933d27b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.printString = printString; +function printString(str) { + return `"${str.replace(escapedRegExp, escapedReplacer)}"`; +} +const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; +function escapedReplacer(str) { + return escapeSequences[str.charCodeAt(0)]; +} +const escapeSequences = [ + '\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004', '\\u0005', '\\u0006', '\\u0007', + '\\b', '\\t', '\\n', '\\u000B', '\\f', '\\r', '\\u000E', '\\u000F', + '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', + '\\u0018', '\\u0019', '\\u001A', '\\u001B', '\\u001C', '\\u001D', '\\u001E', '\\u001F', + '', '', '\\"', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '\\\\', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '\\u007F', + '\\u0080', '\\u0081', '\\u0082', '\\u0083', '\\u0084', '\\u0085', '\\u0086', '\\u0087', + '\\u0088', '\\u0089', '\\u008A', '\\u008B', '\\u008C', '\\u008D', '\\u008E', '\\u008F', + '\\u0090', '\\u0091', '\\u0092', '\\u0093', '\\u0094', '\\u0095', '\\u0096', '\\u0097', + '\\u0098', '\\u0099', '\\u009A', '\\u009B', '\\u009C', '\\u009D', '\\u009E', '\\u009F', +]; +//# sourceMappingURL=printString.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js.map new file mode 100644 index 00000000..25cb50ca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.js.map @@ -0,0 +1 @@ +{"version":3,"file":"printString.js","sourceRoot":"","sources":["../../src/language/printString.ts"],"names":[],"mappings":";;AAMA,kCAEC;AAFD,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,CAAC;AAC5D,CAAC;AAID,MAAM,aAAa,GAAG,+BAA+B,CAAC;AAEtD,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAGD,MAAM,eAAe,GAAG;IACtB,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtF,KAAK,EAAM,KAAK,EAAM,KAAK,EAAM,SAAS,EAAE,KAAK,EAAM,KAAK,EAAM,SAAS,EAAE,SAAS;IACtF,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtF,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtF,EAAE,EAAS,EAAE,EAAS,KAAK,EAAM,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE;IAC/E,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE;IAC/E,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE;IAC/E,EAAE,EAAS,EAAE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SAAS;CACvF,CAAC","sourcesContent":["/**\n * Prints a string as a GraphQL StringValue literal. Replaces control characters\n * and excluded characters (\" U+0022 and \\\\ U+005C) with escape sequences.\n *\n * @internal\n */\nexport function printString(str: string): string {\n return `\"${str.replace(escapedRegExp, escapedReplacer)}\"`;\n}\n\n/** @internal */\n// eslint-disable-next-line no-control-regex\nconst escapedRegExp = /[\\x00-\\x1f\\x22\\x5c\\x7f-\\x9f]/g;\n\nfunction escapedReplacer(str: string): string {\n return escapeSequences[str.charCodeAt(0)];\n}\n\n// prettier-ignore\nconst escapeSequences = [\n '\\\\u0000', '\\\\u0001', '\\\\u0002', '\\\\u0003', '\\\\u0004', '\\\\u0005', '\\\\u0006', '\\\\u0007',\n '\\\\b', '\\\\t', '\\\\n', '\\\\u000B', '\\\\f', '\\\\r', '\\\\u000E', '\\\\u000F',\n '\\\\u0010', '\\\\u0011', '\\\\u0012', '\\\\u0013', '\\\\u0014', '\\\\u0015', '\\\\u0016', '\\\\u0017',\n '\\\\u0018', '\\\\u0019', '\\\\u001A', '\\\\u001B', '\\\\u001C', '\\\\u001D', '\\\\u001E', '\\\\u001F',\n '', '', '\\\\\"', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 2F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 3F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 4F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '\\\\\\\\', '', '', '', // 5F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 6F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '\\\\u007F',\n '\\\\u0080', '\\\\u0081', '\\\\u0082', '\\\\u0083', '\\\\u0084', '\\\\u0085', '\\\\u0086', '\\\\u0087',\n '\\\\u0088', '\\\\u0089', '\\\\u008A', '\\\\u008B', '\\\\u008C', '\\\\u008D', '\\\\u008E', '\\\\u008F',\n '\\\\u0090', '\\\\u0091', '\\\\u0092', '\\\\u0093', '\\\\u0094', '\\\\u0095', '\\\\u0096', '\\\\u0097',\n '\\\\u0098', '\\\\u0099', '\\\\u009A', '\\\\u009B', '\\\\u009C', '\\\\u009D', '\\\\u009E', '\\\\u009F',\n];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs new file mode 100644 index 00000000..a71165ba --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs @@ -0,0 +1,30 @@ +export function printString(str) { + return `"${str.replace(escapedRegExp, escapedReplacer)}"`; +} +const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; +function escapedReplacer(str) { + return escapeSequences[str.charCodeAt(0)]; +} +const escapeSequences = [ + '\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004', '\\u0005', '\\u0006', '\\u0007', + '\\b', '\\t', '\\n', '\\u000B', '\\f', '\\r', '\\u000E', '\\u000F', + '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', + '\\u0018', '\\u0019', '\\u001A', '\\u001B', '\\u001C', '\\u001D', '\\u001E', '\\u001F', + '', '', '\\"', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '\\\\', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '', + '', '', '', '', '', '', '', '\\u007F', + '\\u0080', '\\u0081', '\\u0082', '\\u0083', '\\u0084', '\\u0085', '\\u0086', '\\u0087', + '\\u0088', '\\u0089', '\\u008A', '\\u008B', '\\u008C', '\\u008D', '\\u008E', '\\u008F', + '\\u0090', '\\u0091', '\\u0092', '\\u0093', '\\u0094', '\\u0095', '\\u0096', '\\u0097', + '\\u0098', '\\u0099', '\\u009A', '\\u009B', '\\u009C', '\\u009D', '\\u009E', '\\u009F', +]; +//# sourceMappingURL=printString.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs.map new file mode 100644 index 00000000..286a8045 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printString.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"printString.js","sourceRoot":"","sources":["../../src/language/printString.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,CAAC;AAC5D,CAAC;AAID,MAAM,aAAa,GAAG,+BAA+B,CAAC;AAEtD,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAGD,MAAM,eAAe,GAAG;IACtB,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtF,KAAK,EAAM,KAAK,EAAM,KAAK,EAAM,SAAS,EAAE,KAAK,EAAM,KAAK,EAAM,SAAS,EAAE,SAAS;IACtF,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtF,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtF,EAAE,EAAS,EAAE,EAAS,KAAK,EAAM,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE,EAAS,EAAE;IAC/E,EAAE,EAAS,EAAE,EAAS,EAAE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F,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtF,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;CACvF,CAAC","sourcesContent":["/**\n * Prints a string as a GraphQL StringValue literal. Replaces control characters\n * and excluded characters (\" U+0022 and \\\\ U+005C) with escape sequences.\n *\n * @internal\n */\nexport function printString(str: string): string {\n return `\"${str.replace(escapedRegExp, escapedReplacer)}\"`;\n}\n\n/** @internal */\n// eslint-disable-next-line no-control-regex\nconst escapedRegExp = /[\\x00-\\x1f\\x22\\x5c\\x7f-\\x9f]/g;\n\nfunction escapedReplacer(str: string): string {\n return escapeSequences[str.charCodeAt(0)];\n}\n\n// prettier-ignore\nconst escapeSequences = [\n '\\\\u0000', '\\\\u0001', '\\\\u0002', '\\\\u0003', '\\\\u0004', '\\\\u0005', '\\\\u0006', '\\\\u0007',\n '\\\\b', '\\\\t', '\\\\n', '\\\\u000B', '\\\\f', '\\\\r', '\\\\u000E', '\\\\u000F',\n '\\\\u0010', '\\\\u0011', '\\\\u0012', '\\\\u0013', '\\\\u0014', '\\\\u0015', '\\\\u0016', '\\\\u0017',\n '\\\\u0018', '\\\\u0019', '\\\\u001A', '\\\\u001B', '\\\\u001C', '\\\\u001D', '\\\\u001E', '\\\\u001F',\n '', '', '\\\\\"', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 2F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 3F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 4F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '\\\\\\\\', '', '', '', // 5F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '', // 6F\n '', '', '', '', '', '', '', '',\n '', '', '', '', '', '', '', '\\\\u007F',\n '\\\\u0080', '\\\\u0081', '\\\\u0082', '\\\\u0083', '\\\\u0084', '\\\\u0085', '\\\\u0086', '\\\\u0087',\n '\\\\u0088', '\\\\u0089', '\\\\u008A', '\\\\u008B', '\\\\u008C', '\\\\u008D', '\\\\u008E', '\\\\u008F',\n '\\\\u0090', '\\\\u0091', '\\\\u0092', '\\\\u0093', '\\\\u0094', '\\\\u0095', '\\\\u0096', '\\\\u0097',\n '\\\\u0098', '\\\\u0099', '\\\\u009A', '\\\\u009B', '\\\\u009C', '\\\\u009D', '\\\\u009E', '\\\\u009F',\n];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.mts new file mode 100644 index 00000000..16e2e506 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.mts @@ -0,0 +1,18 @@ +/** @category Printing */ +import type { ASTNode } from "./ast.mjs"; +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + * @param ast - The GraphQL AST node to print. + * @returns A stable string representation of the AST. + * @example + * ```ts + * import { parse, print } from 'graphql'; + * + * const ast = parse('{ hero { name } }'); + * const text = print(ast); + * + * text; // => '{\n hero {\n name\n }\n}' + * ``` + */ +export declare function print(ast: ASTNode): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.ts new file mode 100644 index 00000000..aec93d7a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.d.ts @@ -0,0 +1,18 @@ +/** @category Printing */ +import type { ASTNode } from "./ast.js"; +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + * @param ast - The GraphQL AST node to print. + * @returns A stable string representation of the AST. + * @example + * ```ts + * import { parse, print } from 'graphql'; + * + * const ast = parse('{ hero { name } }'); + * const text = print(ast); + * + * text; // => '{\n hero {\n name\n }\n}' + * ``` + */ +export declare function print(ast: ASTNode): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js new file mode 100644 index 00000000..12463690 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js @@ -0,0 +1,251 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.print = print; +const blockString_ts_1 = require("./blockString.js"); +const printString_ts_1 = require("./printString.js"); +const visitor_ts_1 = require("./visitor.js"); +function print(ast) { + return (0, visitor_ts_1.visit)(ast, printDocASTReducer); +} +const MAX_LINE_LENGTH = 80; +const printDocASTReducer = { + Name: { leave: (node) => node.value }, + Variable: { leave: (node) => '$' + node.name }, + Document: { + leave: (node) => join(node.definitions, '\n\n'), + }, + OperationDefinition: { + leave(node) { + const varDefs = hasMultilineItems(node.variableDefinitions) + ? wrap('(\n', join(node.variableDefinitions, '\n'), '\n)') + : wrap('(', join(node.variableDefinitions, ', '), ')'); + const prefix = wrap('', node.description, '\n') + + join([ + node.operation, + join([node.name, varDefs]), + join(node.directives, ' '), + ], ' '); + return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet; + }, + }, + VariableDefinition: { + leave: ({ variable, type, defaultValue, directives, description }) => wrap('', description, '\n') + + variable + + ': ' + + type + + wrap(' = ', defaultValue) + + wrap(' ', join(directives, ' ')), + }, + SelectionSet: { leave: ({ selections }) => block(selections) }, + Field: { + leave({ alias, name, arguments: args, directives, selectionSet }) { + const prefix = join([wrap('', alias, ': '), name], ''); + return join([ + wrappedLineAndArgs(prefix, args), + wrap(' ', join(directives, ' ')), + wrap(' ', selectionSet), + ]); + }, + }, + Argument: { leave: ({ name, value }) => name + ': ' + value }, + FragmentArgument: { leave: ({ name, value }) => name + ': ' + value }, + FragmentSpread: { + leave: ({ name, arguments: args, directives }) => { + const prefix = '...' + name; + return (wrappedLineAndArgs(prefix, args) + wrap(' ', join(directives, ' '))); + }, + }, + InlineFragment: { + leave: ({ typeCondition, directives, selectionSet }) => join([ + '...', + wrap('on ', typeCondition), + join(directives, ' '), + selectionSet, + ], ' '), + }, + FragmentDefinition: { + leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet, description, }) => wrap('', description, '\n') + + `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + + selectionSet, + }, + IntValue: { leave: ({ value }) => value }, + FloatValue: { leave: ({ value }) => value }, + StringValue: { + leave: ({ value, block: isBlockString }) => isBlockString === true ? (0, blockString_ts_1.printBlockString)(value) : (0, printString_ts_1.printString)(value), + }, + BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') }, + NullValue: { leave: () => 'null' }, + EnumValue: { leave: ({ value }) => value }, + ListValue: { + leave: ({ values }) => { + const valuesLine = '[' + join(values, ', ') + ']'; + if (valuesLine.length > MAX_LINE_LENGTH) { + return '[\n' + indent(join(values, '\n')) + '\n]'; + } + return valuesLine; + }, + }, + ObjectValue: { + leave: ({ fields }) => { + const fieldsLine = '{ ' + join(fields, ', ') + ' }'; + return fieldsLine.length > MAX_LINE_LENGTH ? block(fields) : fieldsLine; + }, + }, + ObjectField: { leave: ({ name, value }) => name + ': ' + value }, + Directive: { + leave: ({ name, arguments: args }) => '@' + name + wrap('(', join(args, ', '), ')'), + }, + NamedType: { leave: ({ name }) => name }, + ListType: { leave: ({ type }) => '[' + type + ']' }, + NonNullType: { leave: ({ type }) => type + '!' }, + SchemaDefinition: { + leave: ({ description, directives, operationTypes }) => wrap('', description, '\n') + + join(['schema', join(directives, ' '), block(operationTypes)], ' '), + }, + OperationTypeDefinition: { + leave: ({ operation, type }) => operation + ': ' + type, + }, + ScalarTypeDefinition: { + leave: ({ description, name, directives }) => wrap('', description, '\n') + + join(['scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeDefinition: { + leave: ({ description, name, interfaces, directives, fields }) => wrap('', description, '\n') + + join([ + 'type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + FieldDefinition: { + leave: ({ description, name, arguments: args, type, directives }) => wrap('', description, '\n') + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + ': ' + + type + + wrap(' ', join(directives, ' ')), + }, + InputValueDefinition: { + leave: ({ description, name, type, defaultValue, directives }) => wrap('', description, '\n') + + join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '), + }, + InterfaceTypeDefinition: { + leave: ({ description, name, interfaces, directives, fields }) => wrap('', description, '\n') + + join([ + 'interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeDefinition: { + leave: ({ description, name, directives, types }) => wrap('', description, '\n') + + join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '), + }, + EnumTypeDefinition: { + leave: ({ description, name, directives, values }) => wrap('', description, '\n') + + join(['enum', name, join(directives, ' '), block(values)], ' '), + }, + EnumValueDefinition: { + leave: ({ description, name, directives }) => wrap('', description, '\n') + join([name, join(directives, ' ')], ' '), + }, + InputObjectTypeDefinition: { + leave: ({ description, name, directives, fields }) => wrap('', description, '\n') + + join(['input', name, join(directives, ' '), block(fields)], ' '), + }, + DirectiveDefinition: { + leave: ({ description, name, arguments: args, directives, repeatable, locations, }) => wrap('', description, '\n') + + 'directive @' + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + wrap(' ', join(directives, ' ')) + + (repeatable ? ' repeatable' : '') + + ' on ' + + join(locations, ' | '), + }, + SchemaExtension: { + leave: ({ directives, operationTypes }) => join(['extend schema', join(directives, ' '), block(operationTypes)], ' '), + }, + ScalarTypeExtension: { + leave: ({ name, directives }) => join(['extend scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + InterfaceTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeExtension: { + leave: ({ name, directives, types }) => join([ + 'extend union', + name, + join(directives, ' '), + wrap('= ', join(types, ' | ')), + ], ' '), + }, + EnumTypeExtension: { + leave: ({ name, directives, values }) => join(['extend enum', name, join(directives, ' '), block(values)], ' '), + }, + InputObjectTypeExtension: { + leave: ({ name, directives, fields }) => join(['extend input', name, join(directives, ' '), block(fields)], ' '), + }, + DirectiveExtension: { + leave: ({ name, directives }) => join(['extend directive @' + name, join(directives, ' ')], ' '), + }, + TypeCoordinate: { leave: ({ name }) => name }, + MemberCoordinate: { + leave: ({ name, memberName }) => join([name, wrap('.', memberName)]), + }, + ArgumentCoordinate: { + leave: ({ name, fieldName, argumentName }) => join([name, wrap('.', fieldName), wrap('(', argumentName, ':)')]), + }, + DirectiveCoordinate: { leave: ({ name }) => join(['@', name]) }, + DirectiveArgumentCoordinate: { + leave: ({ name, argumentName }) => join(['@', name, wrap('(', argumentName, ':)')]), + }, +}; +function join(maybeArray, separator = '') { + return (maybeArray?.filter((x) => x !== undefined && x !== '').join(separator) ?? ''); +} +function block(array) { + return wrap('{\n', indent(join(array, '\n')), '\n}'); +} +function wrap(start, maybeString, end = '') { + return maybeString != null && maybeString !== '' + ? start + maybeString + end + : ''; +} +function indent(str) { + return wrap(' ', str.replaceAll('\n', '\n ')); +} +function hasMultilineItems(maybeArray) { + return maybeArray?.some((str) => str.includes('\n')) ?? false; +} +function wrappedLineAndArgs(prefix, args) { + let argsLine = prefix + wrap('(', join(args, ', '), ')'); + if (argsLine.length > MAX_LINE_LENGTH) { + argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); + } + return argsLine; +} +//# sourceMappingURL=printer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js.map new file mode 100644 index 00000000..bb403934 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"printer.js","sourceRoot":"","sources":["../../src/language/printer.ts"],"names":[],"mappings":";;AAyBA,sBAEC;AAtBD,qDAAoD;AACpD,qDAA+C;AAE/C,6CAAqC;AAiBrC,SAAgB,KAAK,CAAC,GAAY;IAChC,OAAO,IAAA,kBAAK,EAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,kBAAkB,GAAuB;IAC7C,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE;IACrC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE;IAI9C,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;KAChD;IAED,mBAAmB,EAAE;QACnB,KAAK,CAAC,IAAI;YACR,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,CAAC;gBACzD,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC;gBAC1D,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;YACzD,MAAM,MAAM,GACV,IAAI,CAAC,EAAE,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T,CAAC;AAED,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,iBAAiB,CAAC,UAAwC;IACjE,OAAO,UAAU,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC;AAChE,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAc,EACd,IAAuC;IAEvC,IAAI,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAEzD,IAAI,QAAQ,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;QACtC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/** @category Printing */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { ASTNode } from './ast.ts';\nimport { printBlockString } from './blockString.ts';\nimport { printString } from './printString.ts';\nimport type { ASTReducer } from './visitor.ts';\nimport { visit } from './visitor.ts';\n\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n * @param ast - The GraphQL AST node to print.\n * @returns A stable string representation of the AST.\n * @example\n * ```ts\n * import { parse, print } from 'graphql';\n *\n * const ast = parse('{ hero { name } }');\n * const text = print(ast);\n *\n * text; // => '{\\n hero {\\n name\\n }\\n}'\n * ```\n */\nexport function print(ast: ASTNode): string {\n return visit(ast, printDocASTReducer);\n}\n\nconst MAX_LINE_LENGTH = 80;\n\nconst printDocASTReducer: ASTReducer = {\n Name: { leave: (node) => node.value },\n Variable: { leave: (node) => '$' + node.name },\n\n // Document\n\n Document: {\n leave: (node) => join(node.definitions, '\\n\\n'),\n },\n\n OperationDefinition: {\n leave(node) {\n const varDefs = hasMultilineItems(node.variableDefinitions)\n ? wrap('(\\n', join(node.variableDefinitions, '\\n'), '\\n)')\n : wrap('(', join(node.variableDefinitions, ', '), ')');\n const prefix =\n wrap('', node.description, '\\n') +\n join(\n [\n node.operation,\n join([node.name, varDefs]),\n join(node.directives, ' '),\n ],\n ' ',\n );\n\n // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;\n },\n },\n\n VariableDefinition: {\n leave: ({ variable, type, defaultValue, directives, description }) =>\n wrap('', description, '\\n') +\n variable +\n ': ' +\n type +\n wrap(' = ', defaultValue) +\n wrap(' ', join(directives, ' ')),\n },\n SelectionSet: { leave: ({ selections }) => block(selections) },\n\n Field: {\n leave({ alias, name, arguments: args, directives, selectionSet }) {\n const prefix = join([wrap('', alias, ': '), name], '');\n\n return join([\n wrappedLineAndArgs(prefix, args),\n wrap(' ', join(directives, ' ')),\n wrap(' ', selectionSet),\n ]);\n },\n },\n Argument: { leave: ({ name, value }) => name + ': ' + value },\n FragmentArgument: { leave: ({ name, value }) => name + ': ' + value },\n\n // Fragments\n\n FragmentSpread: {\n leave: ({ name, arguments: args, directives }) => {\n const prefix = '...' + name;\n return (\n wrappedLineAndArgs(prefix, args) + wrap(' ', join(directives, ' '))\n );\n },\n },\n\n InlineFragment: {\n leave: ({ typeCondition, directives, selectionSet }) =>\n join(\n [\n '...',\n wrap('on ', typeCondition),\n join(directives, ' '),\n selectionSet,\n ],\n ' ',\n ),\n },\n\n FragmentDefinition: {\n leave: ({\n name,\n typeCondition,\n variableDefinitions,\n directives,\n selectionSet,\n description,\n }) =>\n wrap('', description, '\\n') +\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +\n `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +\n selectionSet,\n },\n\n // Value\n\n IntValue: { leave: ({ value }) => value },\n FloatValue: { leave: ({ value }) => value },\n StringValue: {\n leave: ({ value, block: isBlockString }) =>\n isBlockString === true ? printBlockString(value) : printString(value),\n },\n BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') },\n NullValue: { leave: () => 'null' },\n EnumValue: { leave: ({ value }) => value },\n ListValue: {\n leave: ({ values }) => {\n const valuesLine = '[' + join(values, ', ') + ']';\n\n if (valuesLine.length > MAX_LINE_LENGTH) {\n return '[\\n' + indent(join(values, '\\n')) + '\\n]';\n }\n return valuesLine;\n },\n },\n ObjectValue: {\n leave: ({ fields }) => {\n const fieldsLine = '{ ' + join(fields, ', ') + ' }';\n return fieldsLine.length > MAX_LINE_LENGTH ? block(fields) : fieldsLine;\n },\n },\n ObjectField: { leave: ({ name, value }) => name + ': ' + value },\n\n // Directive\n\n Directive: {\n leave: ({ name, arguments: args }) =>\n '@' + name + wrap('(', join(args, ', '), ')'),\n },\n\n // Type\n\n NamedType: { leave: ({ name }) => name },\n ListType: { leave: ({ type }) => '[' + type + ']' },\n NonNullType: { leave: ({ type }) => type + '!' },\n\n // Type System Definitions\n\n SchemaDefinition: {\n leave: ({ description, directives, operationTypes }) =>\n wrap('', description, '\\n') +\n join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n },\n\n OperationTypeDefinition: {\n leave: ({ operation, type }) => operation + ': ' + type,\n },\n\n ScalarTypeDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') +\n join(['scalar', name, join(directives, ' ')], ' '),\n },\n\n ObjectTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n FieldDefinition: {\n leave: ({ description, name, arguments: args, type, directives }) =>\n wrap('', description, '\\n') +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n ': ' +\n type +\n wrap(' ', join(directives, ' ')),\n },\n\n InputValueDefinition: {\n leave: ({ description, name, type, defaultValue, directives }) =>\n wrap('', description, '\\n') +\n join(\n [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],\n ' ',\n ),\n },\n\n InterfaceTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n UnionTypeDefinition: {\n leave: ({ description, name, directives, types }) =>\n wrap('', description, '\\n') +\n join(\n ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],\n ' ',\n ),\n },\n\n EnumTypeDefinition: {\n leave: ({ description, name, directives, values }) =>\n wrap('', description, '\\n') +\n join(['enum', name, join(directives, ' '), block(values)], ' '),\n },\n\n EnumValueDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') + join([name, join(directives, ' ')], ' '),\n },\n\n InputObjectTypeDefinition: {\n leave: ({ description, name, directives, fields }) =>\n wrap('', description, '\\n') +\n join(['input', name, join(directives, ' '), block(fields)], ' '),\n },\n\n DirectiveDefinition: {\n leave: ({\n description,\n name,\n arguments: args,\n directives,\n repeatable,\n locations,\n }) =>\n wrap('', description, '\\n') +\n 'directive @' +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n wrap(' ', join(directives, ' ')) +\n (repeatable ? ' repeatable' : '') +\n ' on ' +\n join(locations, ' | '),\n },\n\n SchemaExtension: {\n leave: ({ directives, operationTypes }) =>\n join(\n ['extend schema', join(directives, ' '), block(operationTypes)],\n ' ',\n ),\n },\n\n ScalarTypeExtension: {\n leave: ({ name, directives }) =>\n join(['extend scalar', name, join(directives, ' ')], ' '),\n },\n\n ObjectTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n InterfaceTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n UnionTypeExtension: {\n leave: ({ name, directives, types }) =>\n join(\n [\n 'extend union',\n name,\n join(directives, ' '),\n wrap('= ', join(types, ' | ')),\n ],\n ' ',\n ),\n },\n\n EnumTypeExtension: {\n leave: ({ name, directives, values }) =>\n join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n },\n\n InputObjectTypeExtension: {\n leave: ({ name, directives, fields }) =>\n join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n },\n\n DirectiveExtension: {\n leave: ({ name, directives }) =>\n join(['extend directive @' + name, join(directives, ' ')], ' '),\n },\n\n // Schema Coordinates\n\n TypeCoordinate: { leave: ({ name }) => name },\n\n MemberCoordinate: {\n leave: ({ name, memberName }) => join([name, wrap('.', memberName)]),\n },\n\n ArgumentCoordinate: {\n leave: ({ name, fieldName, argumentName }) =>\n join([name, wrap('.', fieldName), wrap('(', argumentName, ':)')]),\n },\n\n DirectiveCoordinate: { leave: ({ name }) => join(['@', name]) },\n\n DirectiveArgumentCoordinate: {\n leave: ({ name, argumentName }) =>\n join(['@', name, wrap('(', argumentName, ':)')]),\n },\n};\n\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n *\n * @internal\n */\nfunction join(\n maybeArray: Maybe>,\n separator = '',\n): string {\n return (\n maybeArray?.filter((x) => x !== undefined && x !== '').join(separator) ?? ''\n );\n}\n\n/**\n * Given array, print each item on its own line, wrapped in an indented `{ }` block.\n *\n * @internal\n */\nfunction block(array: Maybe>): string {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n *\n * @internal\n */\nfunction wrap(\n start: string,\n maybeString: Maybe,\n end: string = '',\n): string {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}\n\nfunction indent(str: string): string {\n return wrap(' ', str.replaceAll('\\n', '\\n '));\n}\n\nfunction hasMultilineItems(maybeArray: Maybe>): boolean {\n return maybeArray?.some((str) => str.includes('\\n')) ?? false;\n}\n\nfunction wrappedLineAndArgs(\n prefix: string,\n args: ReadonlyArray | undefined,\n): string {\n let argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n return argsLine;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs new file mode 100644 index 00000000..22b11779 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs @@ -0,0 +1,248 @@ +import { printBlockString } from "./blockString.mjs"; +import { printString } from "./printString.mjs"; +import { visit } from "./visitor.mjs"; +export function print(ast) { + return visit(ast, printDocASTReducer); +} +const MAX_LINE_LENGTH = 80; +const printDocASTReducer = { + Name: { leave: (node) => node.value }, + Variable: { leave: (node) => '$' + node.name }, + Document: { + leave: (node) => join(node.definitions, '\n\n'), + }, + OperationDefinition: { + leave(node) { + const varDefs = hasMultilineItems(node.variableDefinitions) + ? wrap('(\n', join(node.variableDefinitions, '\n'), '\n)') + : wrap('(', join(node.variableDefinitions, ', '), ')'); + const prefix = wrap('', node.description, '\n') + + join([ + node.operation, + join([node.name, varDefs]), + join(node.directives, ' '), + ], ' '); + return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet; + }, + }, + VariableDefinition: { + leave: ({ variable, type, defaultValue, directives, description }) => wrap('', description, '\n') + + variable + + ': ' + + type + + wrap(' = ', defaultValue) + + wrap(' ', join(directives, ' ')), + }, + SelectionSet: { leave: ({ selections }) => block(selections) }, + Field: { + leave({ alias, name, arguments: args, directives, selectionSet }) { + const prefix = join([wrap('', alias, ': '), name], ''); + return join([ + wrappedLineAndArgs(prefix, args), + wrap(' ', join(directives, ' ')), + wrap(' ', selectionSet), + ]); + }, + }, + Argument: { leave: ({ name, value }) => name + ': ' + value }, + FragmentArgument: { leave: ({ name, value }) => name + ': ' + value }, + FragmentSpread: { + leave: ({ name, arguments: args, directives }) => { + const prefix = '...' + name; + return (wrappedLineAndArgs(prefix, args) + wrap(' ', join(directives, ' '))); + }, + }, + InlineFragment: { + leave: ({ typeCondition, directives, selectionSet }) => join([ + '...', + wrap('on ', typeCondition), + join(directives, ' '), + selectionSet, + ], ' '), + }, + FragmentDefinition: { + leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet, description, }) => wrap('', description, '\n') + + `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + + selectionSet, + }, + IntValue: { leave: ({ value }) => value }, + FloatValue: { leave: ({ value }) => value }, + StringValue: { + leave: ({ value, block: isBlockString }) => isBlockString === true ? printBlockString(value) : printString(value), + }, + BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') }, + NullValue: { leave: () => 'null' }, + EnumValue: { leave: ({ value }) => value }, + ListValue: { + leave: ({ values }) => { + const valuesLine = '[' + join(values, ', ') + ']'; + if (valuesLine.length > MAX_LINE_LENGTH) { + return '[\n' + indent(join(values, '\n')) + '\n]'; + } + return valuesLine; + }, + }, + ObjectValue: { + leave: ({ fields }) => { + const fieldsLine = '{ ' + join(fields, ', ') + ' }'; + return fieldsLine.length > MAX_LINE_LENGTH ? block(fields) : fieldsLine; + }, + }, + ObjectField: { leave: ({ name, value }) => name + ': ' + value }, + Directive: { + leave: ({ name, arguments: args }) => '@' + name + wrap('(', join(args, ', '), ')'), + }, + NamedType: { leave: ({ name }) => name }, + ListType: { leave: ({ type }) => '[' + type + ']' }, + NonNullType: { leave: ({ type }) => type + '!' }, + SchemaDefinition: { + leave: ({ description, directives, operationTypes }) => wrap('', description, '\n') + + join(['schema', join(directives, ' '), block(operationTypes)], ' '), + }, + OperationTypeDefinition: { + leave: ({ operation, type }) => operation + ': ' + type, + }, + ScalarTypeDefinition: { + leave: ({ description, name, directives }) => wrap('', description, '\n') + + join(['scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeDefinition: { + leave: ({ description, name, interfaces, directives, fields }) => wrap('', description, '\n') + + join([ + 'type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + FieldDefinition: { + leave: ({ description, name, arguments: args, type, directives }) => wrap('', description, '\n') + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + ': ' + + type + + wrap(' ', join(directives, ' ')), + }, + InputValueDefinition: { + leave: ({ description, name, type, defaultValue, directives }) => wrap('', description, '\n') + + join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '), + }, + InterfaceTypeDefinition: { + leave: ({ description, name, interfaces, directives, fields }) => wrap('', description, '\n') + + join([ + 'interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeDefinition: { + leave: ({ description, name, directives, types }) => wrap('', description, '\n') + + join(['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], ' '), + }, + EnumTypeDefinition: { + leave: ({ description, name, directives, values }) => wrap('', description, '\n') + + join(['enum', name, join(directives, ' '), block(values)], ' '), + }, + EnumValueDefinition: { + leave: ({ description, name, directives }) => wrap('', description, '\n') + join([name, join(directives, ' ')], ' '), + }, + InputObjectTypeDefinition: { + leave: ({ description, name, directives, fields }) => wrap('', description, '\n') + + join(['input', name, join(directives, ' '), block(fields)], ' '), + }, + DirectiveDefinition: { + leave: ({ description, name, arguments: args, directives, repeatable, locations, }) => wrap('', description, '\n') + + 'directive @' + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + wrap(' ', join(directives, ' ')) + + (repeatable ? ' repeatable' : '') + + ' on ' + + join(locations, ' | '), + }, + SchemaExtension: { + leave: ({ directives, operationTypes }) => join(['extend schema', join(directives, ' '), block(operationTypes)], ' '), + }, + ScalarTypeExtension: { + leave: ({ name, directives }) => join(['extend scalar', name, join(directives, ' ')], ' '), + }, + ObjectTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + InterfaceTypeExtension: { + leave: ({ name, interfaces, directives, fields }) => join([ + 'extend interface', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], ' '), + }, + UnionTypeExtension: { + leave: ({ name, directives, types }) => join([ + 'extend union', + name, + join(directives, ' '), + wrap('= ', join(types, ' | ')), + ], ' '), + }, + EnumTypeExtension: { + leave: ({ name, directives, values }) => join(['extend enum', name, join(directives, ' '), block(values)], ' '), + }, + InputObjectTypeExtension: { + leave: ({ name, directives, fields }) => join(['extend input', name, join(directives, ' '), block(fields)], ' '), + }, + DirectiveExtension: { + leave: ({ name, directives }) => join(['extend directive @' + name, join(directives, ' ')], ' '), + }, + TypeCoordinate: { leave: ({ name }) => name }, + MemberCoordinate: { + leave: ({ name, memberName }) => join([name, wrap('.', memberName)]), + }, + ArgumentCoordinate: { + leave: ({ name, fieldName, argumentName }) => join([name, wrap('.', fieldName), wrap('(', argumentName, ':)')]), + }, + DirectiveCoordinate: { leave: ({ name }) => join(['@', name]) }, + DirectiveArgumentCoordinate: { + leave: ({ name, argumentName }) => join(['@', name, wrap('(', argumentName, ':)')]), + }, +}; +function join(maybeArray, separator = '') { + return (maybeArray?.filter((x) => x !== undefined && x !== '').join(separator) ?? ''); +} +function block(array) { + return wrap('{\n', indent(join(array, '\n')), '\n}'); +} +function wrap(start, maybeString, end = '') { + return maybeString != null && maybeString !== '' + ? start + maybeString + end + : ''; +} +function indent(str) { + return wrap(' ', str.replaceAll('\n', '\n ')); +} +function hasMultilineItems(maybeArray) { + return maybeArray?.some((str) => str.includes('\n')) ?? false; +} +function wrappedLineAndArgs(prefix, args) { + let argsLine = prefix + wrap('(', join(args, ', '), ')'); + if (argsLine.length > MAX_LINE_LENGTH) { + argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); + } + return argsLine; +} +//# sourceMappingURL=printer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs.map new file mode 100644 index 00000000..ef5914fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/printer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"printer.js","sourceRoot":"","sources":["../../src/language/printer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,0BAAyB;AACpD,OAAO,EAAE,WAAW,EAAE,0BAAyB;AAE/C,OAAO,EAAE,KAAK,EAAE,sBAAqB;AAiBrC,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,OAAO,KAAK,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,kBAAkB,GAAuB;IAC7C,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE;IACrC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE;IAI9C,QAAQ,EAAE;QACR,KAAK,E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n\nimport type { ASTNode } from './ast.ts';\nimport { printBlockString } from './blockString.ts';\nimport { printString } from './printString.ts';\nimport type { ASTReducer } from './visitor.ts';\nimport { visit } from './visitor.ts';\n\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n * @param ast - The GraphQL AST node to print.\n * @returns A stable string representation of the AST.\n * @example\n * ```ts\n * import { parse, print } from 'graphql';\n *\n * const ast = parse('{ hero { name } }');\n * const text = print(ast);\n *\n * text; // => '{\\n hero {\\n name\\n }\\n}'\n * ```\n */\nexport function print(ast: ASTNode): string {\n return visit(ast, printDocASTReducer);\n}\n\nconst MAX_LINE_LENGTH = 80;\n\nconst printDocASTReducer: ASTReducer = {\n Name: { leave: (node) => node.value },\n Variable: { leave: (node) => '$' + node.name },\n\n // Document\n\n Document: {\n leave: (node) => join(node.definitions, '\\n\\n'),\n },\n\n OperationDefinition: {\n leave(node) {\n const varDefs = hasMultilineItems(node.variableDefinitions)\n ? wrap('(\\n', join(node.variableDefinitions, '\\n'), '\\n)')\n : wrap('(', join(node.variableDefinitions, ', '), ')');\n const prefix =\n wrap('', node.description, '\\n') +\n join(\n [\n node.operation,\n join([node.name, varDefs]),\n join(node.directives, ' '),\n ],\n ' ',\n );\n\n // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;\n },\n },\n\n VariableDefinition: {\n leave: ({ variable, type, defaultValue, directives, description }) =>\n wrap('', description, '\\n') +\n variable +\n ': ' +\n type +\n wrap(' = ', defaultValue) +\n wrap(' ', join(directives, ' ')),\n },\n SelectionSet: { leave: ({ selections }) => block(selections) },\n\n Field: {\n leave({ alias, name, arguments: args, directives, selectionSet }) {\n const prefix = join([wrap('', alias, ': '), name], '');\n\n return join([\n wrappedLineAndArgs(prefix, args),\n wrap(' ', join(directives, ' ')),\n wrap(' ', selectionSet),\n ]);\n },\n },\n Argument: { leave: ({ name, value }) => name + ': ' + value },\n FragmentArgument: { leave: ({ name, value }) => name + ': ' + value },\n\n // Fragments\n\n FragmentSpread: {\n leave: ({ name, arguments: args, directives }) => {\n const prefix = '...' + name;\n return (\n wrappedLineAndArgs(prefix, args) + wrap(' ', join(directives, ' '))\n );\n },\n },\n\n InlineFragment: {\n leave: ({ typeCondition, directives, selectionSet }) =>\n join(\n [\n '...',\n wrap('on ', typeCondition),\n join(directives, ' '),\n selectionSet,\n ],\n ' ',\n ),\n },\n\n FragmentDefinition: {\n leave: ({\n name,\n typeCondition,\n variableDefinitions,\n directives,\n selectionSet,\n description,\n }) =>\n wrap('', description, '\\n') +\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +\n `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +\n selectionSet,\n },\n\n // Value\n\n IntValue: { leave: ({ value }) => value },\n FloatValue: { leave: ({ value }) => value },\n StringValue: {\n leave: ({ value, block: isBlockString }) =>\n isBlockString === true ? printBlockString(value) : printString(value),\n },\n BooleanValue: { leave: ({ value }) => (value ? 'true' : 'false') },\n NullValue: { leave: () => 'null' },\n EnumValue: { leave: ({ value }) => value },\n ListValue: {\n leave: ({ values }) => {\n const valuesLine = '[' + join(values, ', ') + ']';\n\n if (valuesLine.length > MAX_LINE_LENGTH) {\n return '[\\n' + indent(join(values, '\\n')) + '\\n]';\n }\n return valuesLine;\n },\n },\n ObjectValue: {\n leave: ({ fields }) => {\n const fieldsLine = '{ ' + join(fields, ', ') + ' }';\n return fieldsLine.length > MAX_LINE_LENGTH ? block(fields) : fieldsLine;\n },\n },\n ObjectField: { leave: ({ name, value }) => name + ': ' + value },\n\n // Directive\n\n Directive: {\n leave: ({ name, arguments: args }) =>\n '@' + name + wrap('(', join(args, ', '), ')'),\n },\n\n // Type\n\n NamedType: { leave: ({ name }) => name },\n ListType: { leave: ({ type }) => '[' + type + ']' },\n NonNullType: { leave: ({ type }) => type + '!' },\n\n // Type System Definitions\n\n SchemaDefinition: {\n leave: ({ description, directives, operationTypes }) =>\n wrap('', description, '\\n') +\n join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n },\n\n OperationTypeDefinition: {\n leave: ({ operation, type }) => operation + ': ' + type,\n },\n\n ScalarTypeDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') +\n join(['scalar', name, join(directives, ' ')], ' '),\n },\n\n ObjectTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n FieldDefinition: {\n leave: ({ description, name, arguments: args, type, directives }) =>\n wrap('', description, '\\n') +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n ': ' +\n type +\n wrap(' ', join(directives, ' ')),\n },\n\n InputValueDefinition: {\n leave: ({ description, name, type, defaultValue, directives }) =>\n wrap('', description, '\\n') +\n join(\n [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],\n ' ',\n ),\n },\n\n InterfaceTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n UnionTypeDefinition: {\n leave: ({ description, name, directives, types }) =>\n wrap('', description, '\\n') +\n join(\n ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],\n ' ',\n ),\n },\n\n EnumTypeDefinition: {\n leave: ({ description, name, directives, values }) =>\n wrap('', description, '\\n') +\n join(['enum', name, join(directives, ' '), block(values)], ' '),\n },\n\n EnumValueDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') + join([name, join(directives, ' ')], ' '),\n },\n\n InputObjectTypeDefinition: {\n leave: ({ description, name, directives, fields }) =>\n wrap('', description, '\\n') +\n join(['input', name, join(directives, ' '), block(fields)], ' '),\n },\n\n DirectiveDefinition: {\n leave: ({\n description,\n name,\n arguments: args,\n directives,\n repeatable,\n locations,\n }) =>\n wrap('', description, '\\n') +\n 'directive @' +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n wrap(' ', join(directives, ' ')) +\n (repeatable ? ' repeatable' : '') +\n ' on ' +\n join(locations, ' | '),\n },\n\n SchemaExtension: {\n leave: ({ directives, operationTypes }) =>\n join(\n ['extend schema', join(directives, ' '), block(operationTypes)],\n ' ',\n ),\n },\n\n ScalarTypeExtension: {\n leave: ({ name, directives }) =>\n join(['extend scalar', name, join(directives, ' ')], ' '),\n },\n\n ObjectTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n InterfaceTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n\n UnionTypeExtension: {\n leave: ({ name, directives, types }) =>\n join(\n [\n 'extend union',\n name,\n join(directives, ' '),\n wrap('= ', join(types, ' | ')),\n ],\n ' ',\n ),\n },\n\n EnumTypeExtension: {\n leave: ({ name, directives, values }) =>\n join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n },\n\n InputObjectTypeExtension: {\n leave: ({ name, directives, fields }) =>\n join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n },\n\n DirectiveExtension: {\n leave: ({ name, directives }) =>\n join(['extend directive @' + name, join(directives, ' ')], ' '),\n },\n\n // Schema Coordinates\n\n TypeCoordinate: { leave: ({ name }) => name },\n\n MemberCoordinate: {\n leave: ({ name, memberName }) => join([name, wrap('.', memberName)]),\n },\n\n ArgumentCoordinate: {\n leave: ({ name, fieldName, argumentName }) =>\n join([name, wrap('.', fieldName), wrap('(', argumentName, ':)')]),\n },\n\n DirectiveCoordinate: { leave: ({ name }) => join(['@', name]) },\n\n DirectiveArgumentCoordinate: {\n leave: ({ name, argumentName }) =>\n join(['@', name, wrap('(', argumentName, ':)')]),\n },\n};\n\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n *\n * @internal\n */\nfunction join(\n maybeArray: Maybe>,\n separator = '',\n): string {\n return (\n maybeArray?.filter((x) => x !== undefined && x !== '').join(separator) ?? ''\n );\n}\n\n/**\n * Given array, print each item on its own line, wrapped in an indented `{ }` block.\n *\n * @internal\n */\nfunction block(array: Maybe>): string {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n *\n * @internal\n */\nfunction wrap(\n start: string,\n maybeString: Maybe,\n end: string = '',\n): string {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}\n\nfunction indent(str: string): string {\n return wrap(' ', str.replaceAll('\\n', '\\n '));\n}\n\nfunction hasMultilineItems(maybeArray: Maybe>): boolean {\n return maybeArray?.some((str) => str.includes('\\n')) ?? false;\n}\n\nfunction wrappedLineAndArgs(\n prefix: string,\n args: ReadonlyArray | undefined,\n): string {\n let argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n return argsLine;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.mts new file mode 100644 index 00000000..56bb1d0f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.mts @@ -0,0 +1,57 @@ +import { Token } from "./ast.mjs"; +import type { LexerInterface } from "./lexer.mjs"; +import type { Source } from "./source.mjs"; +/** + * Given a Source schema coordinate, creates a Lexer for that source. + * A SchemaCoordinateLexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + * + * @internal + */ +export declare class SchemaCoordinateLexer implements LexerInterface { + source: Source; + /** + * The previously focused non-ignored token. + * + * @internal + */ + lastToken: Token; + /** + * The currently focused non-ignored token. + * + * @internal + */ + token: Token; + /** + * The (1-indexed) line containing the current token. + * Since a schema coordinate may not contain newline, this value is always 1. + * + * @internal + */ + line: 1; + /** + * The character offset at which the current line begins. + * Since a schema coordinate may not contain newline, this value is always 0. + * + * @internal + */ + lineStart: 0; + constructor(source: Source); + get [Symbol.toStringTag](): string; + /** + * Advances the token stream to the next non-ignored token. + * + * @internal + */ + advance(): Token; + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the current Lexer token. + * + * @internal + */ + lookahead(): Token; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.ts new file mode 100644 index 00000000..2ba17d89 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.d.ts @@ -0,0 +1,57 @@ +import { Token } from "./ast.js"; +import type { LexerInterface } from "./lexer.js"; +import type { Source } from "./source.js"; +/** + * Given a Source schema coordinate, creates a Lexer for that source. + * A SchemaCoordinateLexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + * + * @internal + */ +export declare class SchemaCoordinateLexer implements LexerInterface { + source: Source; + /** + * The previously focused non-ignored token. + * + * @internal + */ + lastToken: Token; + /** + * The currently focused non-ignored token. + * + * @internal + */ + token: Token; + /** + * The (1-indexed) line containing the current token. + * Since a schema coordinate may not contain newline, this value is always 1. + * + * @internal + */ + line: 1; + /** + * The character offset at which the current line begins. + * Since a schema coordinate may not contain newline, this value is always 0. + * + * @internal + */ + lineStart: 0; + constructor(source: Source); + get [Symbol.toStringTag](): string; + /** + * Advances the token stream to the next non-ignored token. + * + * @internal + */ + advance(): Token; + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the current Lexer token. + * + * @internal + */ + lookahead(): Token; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js new file mode 100644 index 00000000..67b46065 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchemaCoordinateLexer = void 0; +const syntaxError_ts_1 = require("../error/syntaxError.js"); +const ast_ts_1 = require("./ast.js"); +const characterClasses_ts_1 = require("./characterClasses.js"); +const lexer_ts_1 = require("./lexer.js"); +const tokenKind_ts_1 = require("./tokenKind.js"); +class SchemaCoordinateLexer { + constructor(source) { + this.line = 1; + this.lineStart = 0; + const startOfFileToken = new ast_ts_1.Token(tokenKind_ts_1.TokenKind.SOF, 0, 0, 0, 0); + this.source = source; + this.lastToken = startOfFileToken; + this.token = startOfFileToken; + } + get [Symbol.toStringTag]() { + return 'SchemaCoordinateLexer'; + } + advance() { + this.lastToken = this.token; + const token = (this.token = this.lookahead()); + return token; + } + lookahead() { + let token = this.token; + if (token.kind !== tokenKind_ts_1.TokenKind.EOF) { + const nextToken = readNextToken(this, token.end); + token.next = nextToken; + nextToken.prev = token; + token = nextToken; + } + return token; + } +} +exports.SchemaCoordinateLexer = SchemaCoordinateLexer; +function readNextToken(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + const position = start; + if (position < bodyLength) { + const code = body.charCodeAt(position); + switch (code) { + case 0x002e: + return (0, lexer_ts_1.createToken)(lexer, tokenKind_ts_1.TokenKind.DOT, position, position + 1); + case 0x0028: + return (0, lexer_ts_1.createToken)(lexer, tokenKind_ts_1.TokenKind.PAREN_L, position, position + 1); + case 0x0029: + return (0, lexer_ts_1.createToken)(lexer, tokenKind_ts_1.TokenKind.PAREN_R, position, position + 1); + case 0x003a: + return (0, lexer_ts_1.createToken)(lexer, tokenKind_ts_1.TokenKind.COLON, position, position + 1); + case 0x0040: + return (0, lexer_ts_1.createToken)(lexer, tokenKind_ts_1.TokenKind.AT, position, position + 1); + } + if ((0, characterClasses_ts_1.isNameStart)(code)) { + return (0, lexer_ts_1.readName)(lexer, position); + } + throw (0, syntaxError_ts_1.syntaxError)(lexer.source, position, `Invalid character: ${(0, lexer_ts_1.printCodePointAt)(lexer, position)}.`); + } + return (0, lexer_ts_1.createToken)(lexer, tokenKind_ts_1.TokenKind.EOF, bodyLength, bodyLength); +} +//# sourceMappingURL=schemaCoordinateLexer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js.map new file mode 100644 index 00000000..0cfee995 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaCoordinateLexer.js","sourceRoot":"","sources":["../../src/language/schemaCoordinateLexer.ts"],"names":[],"mappings":";;;AAAA,4DAAsD;AAEtD,qCAAiC;AACjC,+DAAoD;AAEpD,yCAAqE;AAErE,iDAA2C;AAY3C,MAAa,qBAAqB;IAiChC,YAAY,MAAc;QAV1B,SAAI,GAAM,CAAU,CAAC;QAQrB,cAAS,GAAM,CAAU,CAAC;QAGxB,M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,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,MAAM;gBACT,OAAO,IAAA,sBAAW,EAAC,KAAK,EAAE,wBAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;YACnE,KAAK,MAAM;gBACT,OAAO,IAAA,sBAAW,EAAC,KAAK,EAAE,wBAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;YACvE,KAAK,MAAM;gBACT,OAAO,IAAA,sBAAW,EAAC,KAAK,EAAE,wBAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;YACvE,KAAK,MAAM;gBACT,OAAO,IAAA,sBAAW,EAAC,KAAK,EAAE,wBAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;YACrE,KAAK,MAAM;gBACT,OAAO,IAAA,sBAAW,EAAC,KAAK,EAAE,wBAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;QACpE,CAAC;QAGD,IAAI,IAAA,iCAAW,EAAC,IAAI,CAAC,EAAE,CAAC;YACtB,OAAO,IAAA,mBAAQ,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,IAAA,4BAAW,EACf,KAAK,CAAC,MAAM,EACZ,QAAQ,EACR,sBAAsB,IAAA,2BAAgB,EAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAC3D,CAAC;IACJ,CAAC;IAED,OAAO,IAAA,sBAAW,EAAC,KAAK,EAAE,wBAAS,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import { syntaxError } from '../error/syntaxError.ts';\n\nimport { Token } from './ast.ts';\nimport { isNameStart } from './characterClasses.ts';\nimport type { LexerInterface } from './lexer.ts';\nimport { createToken, printCodePointAt, readName } from './lexer.ts';\nimport type { Source } from './source.ts';\nimport { TokenKind } from './tokenKind.ts';\n\n/**\n * Given a Source schema coordinate, creates a Lexer for that source.\n * A SchemaCoordinateLexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n *\n * @internal\n */\nexport class SchemaCoordinateLexer implements LexerInterface {\n source: Source;\n\n /**\n * The previously focused non-ignored token.\n *\n * @internal\n */\n lastToken: Token;\n\n /**\n * The currently focused non-ignored token.\n *\n * @internal\n */\n token: Token;\n\n /**\n * The (1-indexed) line containing the current token.\n * Since a schema coordinate may not contain newline, this value is always 1.\n *\n * @internal\n */\n line: 1 = 1 as const;\n\n /**\n * The character offset at which the current line begins.\n * Since a schema coordinate may not contain newline, this value is always 0.\n *\n * @internal\n */\n lineStart: 0 = 0 as const;\n\n constructor(source: Source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n }\n\n get [Symbol.toStringTag](): string {\n return 'SchemaCoordinateLexer';\n }\n\n /**\n * Advances the token stream to the next non-ignored token.\n *\n * @internal\n */\n advance(): Token {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the current Lexer token.\n *\n * @internal\n */\n lookahead(): Token {\n let token = this.token;\n if (token.kind !== TokenKind.EOF) {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end);\n // @ts-expect-error next is only mutable during parsing.\n token.next = nextToken;\n // @ts-expect-error prev is only mutable during parsing.\n nextToken.prev = token;\n token = nextToken;\n }\n return token;\n }\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * @internal\n */\nfunction readNextToken(lexer: SchemaCoordinateLexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n const position = start;\n\n if (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n switch (code) {\n case 0x002e: // .\n return createToken(lexer, TokenKind.DOT, position, position + 1);\n case 0x0028: // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n case 0x0029: // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n case 0x003a: // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n case 0x0040: // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n }\n\n // Name\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs new file mode 100644 index 00000000..4cb89db1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs @@ -0,0 +1,59 @@ +import { syntaxError } from "../error/syntaxError.mjs"; +import { Token } from "./ast.mjs"; +import { isNameStart } from "./characterClasses.mjs"; +import { createToken, printCodePointAt, readName } from "./lexer.mjs"; +import { TokenKind } from "./tokenKind.mjs"; +export class SchemaCoordinateLexer { + constructor(source) { + this.line = 1; + this.lineStart = 0; + const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0); + this.source = source; + this.lastToken = startOfFileToken; + this.token = startOfFileToken; + } + get [Symbol.toStringTag]() { + return 'SchemaCoordinateLexer'; + } + advance() { + this.lastToken = this.token; + const token = (this.token = this.lookahead()); + return token; + } + lookahead() { + let token = this.token; + if (token.kind !== TokenKind.EOF) { + const nextToken = readNextToken(this, token.end); + token.next = nextToken; + nextToken.prev = token; + token = nextToken; + } + return token; + } +} +function readNextToken(lexer, start) { + const body = lexer.source.body; + const bodyLength = body.length; + const position = start; + if (position < bodyLength) { + const code = body.charCodeAt(position); + switch (code) { + case 0x002e: + return createToken(lexer, TokenKind.DOT, position, position + 1); + case 0x0028: + return createToken(lexer, TokenKind.PAREN_L, position, position + 1); + case 0x0029: + return createToken(lexer, TokenKind.PAREN_R, position, position + 1); + case 0x003a: + return createToken(lexer, TokenKind.COLON, position, position + 1); + case 0x0040: + return createToken(lexer, TokenKind.AT, position, position + 1); + } + if (isNameStart(code)) { + return readName(lexer, position); + } + throw syntaxError(lexer.source, position, `Invalid character: ${printCodePointAt(lexer, position)}.`); + } + return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength); +} +//# sourceMappingURL=schemaCoordinateLexer.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs.map new file mode 100644 index 00000000..e97d5ba9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/schemaCoordinateLexer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"schemaCoordinateLexer.js","sourceRoot":"","sources":["../../src/language/schemaCoordinateLexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iCAAgC;AAEtD,OAAO,EAAE,KAAK,EAAE,kBAAiB;AACjC,OAAO,EAAE,WAAW,EAAE,+BAA8B;AAEpD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAmB;AAErE,OAAO,EAAE,SAAS,EAAE,wBAAuB;AAY3C,MAAM,OAAO,qBAAqB;IAiChC,YAAY,MAAc;QAV1B,SAAI,GAAM,CAAU,CAAC;QAQrB,cAAS,GAAM,CAAU,CAAC;QAGxB,MAAM,gBAAgB,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CA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GAAG,CAAC,CAAC,CAAC;YACnE,KAAK,MAAM;gBACT,OAAO,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;YACvE,KAAK,MAAM;gBACT,OAAO,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;YACvE,KAAK,MAAM;gBACT,OAAO,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;YACrE,KAAK,MAAM;gBACT,OAAO,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;QACpE,CAAC;QAGD,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,OAAO,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,WAAW,CACf,KAAK,CAAC,MAAM,EACZ,QAAQ,EACR,sBAAsB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAC3D,CAAC;IACJ,CAAC;IAED,OAAO,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import { syntaxError } from '../error/syntaxError.ts';\n\nimport { Token } from './ast.ts';\nimport { isNameStart } from './characterClasses.ts';\nimport type { LexerInterface } from './lexer.ts';\nimport { createToken, printCodePointAt, readName } from './lexer.ts';\nimport type { Source } from './source.ts';\nimport { TokenKind } from './tokenKind.ts';\n\n/**\n * Given a Source schema coordinate, creates a Lexer for that source.\n * A SchemaCoordinateLexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n *\n * @internal\n */\nexport class SchemaCoordinateLexer implements LexerInterface {\n source: Source;\n\n /**\n * The previously focused non-ignored token.\n *\n * @internal\n */\n lastToken: Token;\n\n /**\n * The currently focused non-ignored token.\n *\n * @internal\n */\n token: Token;\n\n /**\n * The (1-indexed) line containing the current token.\n * Since a schema coordinate may not contain newline, this value is always 1.\n *\n * @internal\n */\n line: 1 = 1 as const;\n\n /**\n * The character offset at which the current line begins.\n * Since a schema coordinate may not contain newline, this value is always 0.\n *\n * @internal\n */\n lineStart: 0 = 0 as const;\n\n constructor(source: Source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n }\n\n get [Symbol.toStringTag](): string {\n return 'SchemaCoordinateLexer';\n }\n\n /**\n * Advances the token stream to the next non-ignored token.\n *\n * @internal\n */\n advance(): Token {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the current Lexer token.\n *\n * @internal\n */\n lookahead(): Token {\n let token = this.token;\n if (token.kind !== TokenKind.EOF) {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end);\n // @ts-expect-error next is only mutable during parsing.\n token.next = nextToken;\n // @ts-expect-error prev is only mutable during parsing.\n nextToken.prev = token;\n token = nextToken;\n }\n return token;\n }\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * @internal\n */\nfunction readNextToken(lexer: SchemaCoordinateLexer, start: number): Token {\n const body = lexer.source.body;\n const bodyLength = body.length;\n const position = start;\n\n if (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n switch (code) {\n case 0x002e: // .\n return createToken(lexer, TokenKind.DOT, position, position + 1);\n case 0x0028: // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n case 0x0029: // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n case 0x003a: // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n case 0x0040: // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n }\n\n // Name\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.mts new file mode 100644 index 00000000..1ae1b45d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.mts @@ -0,0 +1,52 @@ +/** @category Source */ +interface Location { + line: number; + column: number; +} +/** + * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are + * optional, but they are useful for clients who store GraphQL documents in source files. + * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might + * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. + * The `line` and `column` properties in `locationOffset` are 1-indexed. + */ +export declare class Source { + /** The GraphQL source text. */ + body: string; + /** Name used in diagnostics for this source, such as a file path or request name. */ + name: string; + /** One-indexed line and column where this source begins. */ + locationOffset: Location; + /** + * Creates a Source instance. + * @param body - The GraphQL source text. + * @param name - Name used in diagnostics for this source. + * @param locationOffset - One-indexed line and column where this source begins. + * @example + * ```ts + * import { Source } from 'graphql/language'; + * + * const source = new Source('type Query { greeting: String }', 'schema.graphql', { + * line: 10, + * column: 1, + * }); + * + * source.body; // => 'type Query { greeting: String }' + * source.name; // => 'schema.graphql' + * source.locationOffset; // => { line: 10, column: 1 } + * ``` + */ + constructor(body: string, name?: string, locationOffset?: Location); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; +} +/** + * Test if the given value is a Source object. + * + * @internal + */ +export declare function isSource(source: unknown): source is Source; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.ts new file mode 100644 index 00000000..1ae1b45d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.d.ts @@ -0,0 +1,52 @@ +/** @category Source */ +interface Location { + line: number; + column: number; +} +/** + * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are + * optional, but they are useful for clients who store GraphQL documents in source files. + * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might + * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. + * The `line` and `column` properties in `locationOffset` are 1-indexed. + */ +export declare class Source { + /** The GraphQL source text. */ + body: string; + /** Name used in diagnostics for this source, such as a file path or request name. */ + name: string; + /** One-indexed line and column where this source begins. */ + locationOffset: Location; + /** + * Creates a Source instance. + * @param body - The GraphQL source text. + * @param name - Name used in diagnostics for this source. + * @param locationOffset - One-indexed line and column where this source begins. + * @example + * ```ts + * import { Source } from 'graphql/language'; + * + * const source = new Source('type Query { greeting: String }', 'schema.graphql', { + * line: 10, + * column: 1, + * }); + * + * source.body; // => 'type Query { greeting: String }' + * source.name; // => 'schema.graphql' + * source.locationOffset; // => { line: 10, column: 1 } + * ``` + */ + constructor(body: string, name?: string, locationOffset?: Location); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; +} +/** + * Test if the given value is a Source object. + * + * @internal + */ +export declare function isSource(source: unknown): source is Source; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js new file mode 100644 index 00000000..72ed71fd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Source = void 0; +exports.isSource = isSource; +const devAssert_ts_1 = require("../jsutils/devAssert.js"); +const instanceOf_ts_1 = require("../jsutils/instanceOf.js"); +const sourceSymbol = Symbol('Source'); +class Source { + constructor(body, name = 'GraphQL request', locationOffset = { line: 1, column: 1 }) { + this.__kind = sourceSymbol; + this.body = body; + this.name = name; + this.locationOffset = locationOffset; + if (!(this.locationOffset.line > 0)) + (0, devAssert_ts_1.devAssert)(false, 'line in locationOffset is 1-indexed and must be positive.'); + if (!(this.locationOffset.column > 0)) + (0, devAssert_ts_1.devAssert)(false, 'column in locationOffset is 1-indexed and must be positive.'); + } + get [Symbol.toStringTag]() { + return 'Source'; + } +} +exports.Source = Source; +function isSource(source) { + return (0, instanceOf_ts_1.instanceOf)(source, sourceSymbol, Source); +} +//# sourceMappingURL=source.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js.map new file mode 100644 index 00000000..d248d9ad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.js.map @@ -0,0 +1 @@ +{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/language/source.ts"],"names":[],"mappings":";;;AAsFA,4BAEC;AAtFD,0DAAoD;AACpD,4DAAsD;AAQtD,MAAM,YAAY,GAAkB,MAAM,CAAC,QAAQ,CAAC,CAAC;AASrD,MAAa,MAAM;IAiCjB,YACE,IAAY,EACZ,OAAe,iBAAiB,EAChC,iBAA2B,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QAEjD,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;cAEnC,IAAI,CAAC,cAAc,CAAC,IAAI,GAAG,CAAC;gBAD9B,wBAAS,SAEP,2DAA2D;cAG3D,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;gBADhC,wBAAS,SAEP,6DAA6D;IAEjE,CAAC;IAMD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA3DD,wBA2DC;AAOD,SAAgB,QAAQ,CAAC,MAAe;IACtC,OAAO,IAAA,0BAAU,EAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/** @category Source */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { instanceOf } from '../jsutils/instanceOf.ts';\n\ninterface Location {\n line: number;\n column: number;\n}\n\n/** @private */\nconst sourceSymbol: unique symbol = Symbol('Source');\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport class Source {\n /**\n * Internal runtime marker used to identify Source instances.\n * @private\n */\n readonly __kind: symbol;\n\n /** The GraphQL source text. */\n body: string;\n /** Name used in diagnostics for this source, such as a file path or request name. */\n name: string;\n /** One-indexed line and column where this source begins. */\n locationOffset: Location;\n\n /**\n * Creates a Source instance.\n * @param body - The GraphQL source text.\n * @param name - Name used in diagnostics for this source.\n * @param locationOffset - One-indexed line and column where this source begins.\n * @example\n * ```ts\n * import { Source } from 'graphql/language';\n *\n * const source = new Source('type Query { greeting: String }', 'schema.graphql', {\n * line: 10,\n * column: 1,\n * });\n *\n * source.body; // => 'type Query { greeting: String }'\n * source.name; // => 'schema.graphql'\n * source.locationOffset; // => { line: 10, column: 1 }\n * ```\n */\n constructor(\n body: string,\n name: string = 'GraphQL request',\n locationOffset: Location = { line: 1, column: 1 },\n ) {\n this.__kind = sourceSymbol;\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n devAssert(\n this.locationOffset.line > 0,\n 'line in locationOffset is 1-indexed and must be positive.',\n );\n devAssert(\n this.locationOffset.column > 0,\n 'column in locationOffset is 1-indexed and must be positive.',\n );\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Source';\n }\n}\n\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\nexport function isSource(source: unknown): source is Source {\n return instanceOf(source, sourceSymbol, Source);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs new file mode 100644 index 00000000..945e9f44 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs @@ -0,0 +1,22 @@ +import { devAssert } from "../jsutils/devAssert.mjs"; +import { instanceOf } from "../jsutils/instanceOf.mjs"; +const sourceSymbol = Symbol('Source'); +export class Source { + constructor(body, name = 'GraphQL request', locationOffset = { line: 1, column: 1 }) { + this.__kind = sourceSymbol; + this.body = body; + this.name = name; + this.locationOffset = locationOffset; + if (!(this.locationOffset.line > 0)) + devAssert(false, 'line in locationOffset is 1-indexed and must be positive.'); + if (!(this.locationOffset.column > 0)) + devAssert(false, 'column in locationOffset is 1-indexed and must be positive.'); + } + get [Symbol.toStringTag]() { + return 'Source'; + } +} +export function isSource(source) { + return instanceOf(source, sourceSymbol, Source); +} +//# sourceMappingURL=source.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs.map new file mode 100644 index 00000000..abe75496 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/source.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/language/source.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,UAAU,EAAE,kCAAiC;AAQtD,MAAM,YAAY,GAAkB,MAAM,CAAC,QAAQ,CAAC,CAAC;AASrD,MAAM,OAAO,MAAM;IAiCjB,YACE,IAAY,EACZ,OAAe,iBAAiB,EAChC,iBAA2B,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QAEjD,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;cAEnC,IAAI,CAAC,cAAc,CAAC,IAAI,GAAG,CAAC;YAD9B,SAAS,QAEP,2DAA2D;cAG3D,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;YADhC,SAAS,QAEP,6DAA6D;IAEjE,CAAC;IAMD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAOD,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,OAAO,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/** @category Source */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { instanceOf } from '../jsutils/instanceOf.ts';\n\ninterface Location {\n line: number;\n column: number;\n}\n\n/** @private */\nconst sourceSymbol: unique symbol = Symbol('Source');\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport class Source {\n /**\n * Internal runtime marker used to identify Source instances.\n * @private\n */\n readonly __kind: symbol;\n\n /** The GraphQL source text. */\n body: string;\n /** Name used in diagnostics for this source, such as a file path or request name. */\n name: string;\n /** One-indexed line and column where this source begins. */\n locationOffset: Location;\n\n /**\n * Creates a Source instance.\n * @param body - The GraphQL source text.\n * @param name - Name used in diagnostics for this source.\n * @param locationOffset - One-indexed line and column where this source begins.\n * @example\n * ```ts\n * import { Source } from 'graphql/language';\n *\n * const source = new Source('type Query { greeting: String }', 'schema.graphql', {\n * line: 10,\n * column: 1,\n * });\n *\n * source.body; // => 'type Query { greeting: String }'\n * source.name; // => 'schema.graphql'\n * source.locationOffset; // => { line: 10, column: 1 }\n * ```\n */\n constructor(\n body: string,\n name: string = 'GraphQL request',\n locationOffset: Location = { line: 1, column: 1 },\n ) {\n this.__kind = sourceSymbol;\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n devAssert(\n this.locationOffset.line > 0,\n 'line in locationOffset is 1-indexed and must be positive.',\n );\n devAssert(\n this.locationOffset.column > 0,\n 'column in locationOffset is 1-indexed and must be positive.',\n );\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'Source';\n }\n}\n\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\nexport function isSource(source: unknown): source is Source {\n return instanceOf(source, sourceSymbol, Source);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.mts new file mode 100644 index 00000000..9cab9477 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.mts @@ -0,0 +1,35 @@ +/** @category Lexing */ +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +export declare const TokenKind: { + readonly SOF: ""; + readonly EOF: ""; + readonly BANG: "!"; + readonly DOLLAR: "$"; + readonly AMP: "&"; + readonly PAREN_L: "("; + readonly PAREN_R: ")"; + readonly DOT: "."; + readonly SPREAD: "..."; + readonly COLON: ":"; + readonly EQUALS: "="; + readonly AT: "@"; + readonly BRACKET_L: "["; + readonly BRACKET_R: "]"; + readonly BRACE_L: "{"; + readonly PIPE: "|"; + readonly BRACE_R: "}"; + readonly NAME: "Name"; + readonly INT: "Int"; + readonly FLOAT: "Float"; + readonly STRING: "String"; + readonly BLOCK_STRING: "BlockString"; + readonly COMMENT: "Comment"; +}; +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +export type TokenKind = (typeof TokenKind)[keyof typeof TokenKind]; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.ts new file mode 100644 index 00000000..9cab9477 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.d.ts @@ -0,0 +1,35 @@ +/** @category Lexing */ +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +export declare const TokenKind: { + readonly SOF: ""; + readonly EOF: ""; + readonly BANG: "!"; + readonly DOLLAR: "$"; + readonly AMP: "&"; + readonly PAREN_L: "("; + readonly PAREN_R: ")"; + readonly DOT: "."; + readonly SPREAD: "..."; + readonly COLON: ":"; + readonly EQUALS: "="; + readonly AT: "@"; + readonly BRACKET_L: "["; + readonly BRACKET_R: "]"; + readonly BRACE_L: "{"; + readonly PIPE: "|"; + readonly BRACE_R: "}"; + readonly NAME: "Name"; + readonly INT: "Int"; + readonly FLOAT: "Float"; + readonly STRING: "String"; + readonly BLOCK_STRING: "BlockString"; + readonly COMMENT: "Comment"; +}; +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +export type TokenKind = (typeof TokenKind)[keyof typeof TokenKind]; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js new file mode 100644 index 00000000..121ae5ee --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TokenKind = void 0; +exports.TokenKind = { + SOF: '', + EOF: '', + BANG: '!', + DOLLAR: '$', + AMP: '&', + PAREN_L: '(', + PAREN_R: ')', + DOT: '.', + SPREAD: '...', + COLON: ':', + EQUALS: '=', + AT: '@', + BRACKET_L: '[', + BRACKET_R: ']', + BRACE_L: '{', + PIPE: '|', + BRACE_R: '}', + NAME: 'Name', + INT: 'Int', + FLOAT: 'Float', + STRING: 'String', + BLOCK_STRING: 'BlockString', + COMMENT: 'Comment', +}; +//# sourceMappingURL=tokenKind.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js.map new file mode 100644 index 00000000..c2d41e5b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tokenKind.js","sourceRoot":"","sources":["../../src/language/tokenKind.ts"],"names":[],"mappings":";;;AAMa,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,OAAgB;IACrB,GAAG,EAAE,OAAgB;IACrB,IAAI,EAAE,GAAY;IAClB,MAAM,EAAE,GAAY;IACpB,GAAG,EAAE,GAAY;IACjB,OAAO,EAAE,GAAY;IACrB,OAAO,EAAE,GAAY;IACrB,GAAG,EAAE,GAAY;IACjB,MAAM,EAAE,KAAc;IACtB,KAAK,EAAE,GAAY;IACnB,MAAM,EAAE,GAAY;IACpB,EAAE,EAAE,GAAY;IAChB,SAAS,EAAE,GAAY;IACvB,SAAS,EAAE,GAAY;IACvB,OAAO,EAAE,GAAY;IACrB,IAAI,EAAE,GAAY;IAClB,OAAO,EAAE,GAAY;IACrB,IAAI,EAAE,MAAe;IACrB,GAAG,EAAE,KAAc;IACnB,KAAK,EAAE,OAAgB;IACvB,MAAM,EAAE,QAAiB;IACzB,YAAY,EAAE,aAAsB;IACpC,OAAO,EAAE,SAAkB;CACnB,CAAC","sourcesContent":["/** @category Lexing */\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport const TokenKind = {\n SOF: '' as const,\n EOF: '' as const,\n BANG: '!' as const,\n DOLLAR: '$' as const,\n AMP: '&' as const,\n PAREN_L: '(' as const,\n PAREN_R: ')' as const,\n DOT: '.' as const,\n SPREAD: '...' as const,\n COLON: ':' as const,\n EQUALS: '=' as const,\n AT: '@' as const,\n BRACKET_L: '[' as const,\n BRACKET_R: ']' as const,\n BRACE_L: '{' as const,\n PIPE: '|' as const,\n BRACE_R: '}' as const,\n NAME: 'Name' as const,\n INT: 'Int' as const,\n FLOAT: 'Float' as const,\n STRING: 'String' as const,\n BLOCK_STRING: 'BlockString' as const,\n COMMENT: 'Comment' as const,\n} as const;\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TokenKind = (typeof TokenKind)[keyof typeof TokenKind];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs new file mode 100644 index 00000000..343b73b2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs @@ -0,0 +1,26 @@ +export const TokenKind = { + SOF: '', + EOF: '', + BANG: '!', + DOLLAR: '$', + AMP: '&', + PAREN_L: '(', + PAREN_R: ')', + DOT: '.', + SPREAD: '...', + COLON: ':', + EQUALS: '=', + AT: '@', + BRACKET_L: '[', + BRACKET_R: ']', + BRACE_L: '{', + PIPE: '|', + BRACE_R: '}', + NAME: 'Name', + INT: 'Int', + FLOAT: 'Float', + STRING: 'String', + BLOCK_STRING: 'BlockString', + COMMENT: 'Comment', +}; +//# sourceMappingURL=tokenKind.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs.map new file mode 100644 index 00000000..989d5f36 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/tokenKind.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"tokenKind.js","sourceRoot":"","sources":["../../src/language/tokenKind.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,OAAgB;IACrB,GAAG,EAAE,OAAgB;IACrB,IAAI,EAAE,GAAY;IAClB,MAAM,EAAE,GAAY;IACpB,GAAG,EAAE,GAAY;IACjB,OAAO,EAAE,GAAY;IACrB,OAAO,EAAE,GAAY;IACrB,GAAG,EAAE,GAAY;IACjB,MAAM,EAAE,KAAc;IACtB,KAAK,EAAE,GAAY;IACnB,MAAM,EAAE,GAAY;IACpB,EAAE,EAAE,GAAY;IAChB,SAAS,EAAE,GAAY;IACvB,SAAS,EAAE,GAAY;IACvB,OAAO,EAAE,GAAY;IACrB,IAAI,EAAE,GAAY;IAClB,OAAO,EAAE,GAAY;IACrB,IAAI,EAAE,MAAe;IACrB,GAAG,EAAE,KAAc;IACnB,KAAK,EAAE,OAAgB;IACvB,MAAM,EAAE,QAAiB;IACzB,YAAY,EAAE,aAAsB;IACpC,OAAO,EAAE,SAAkB;CACnB,CAAC","sourcesContent":["/** @category Lexing */\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport const TokenKind = {\n SOF: '' as const,\n EOF: '' as const,\n BANG: '!' as const,\n DOLLAR: '$' as const,\n AMP: '&' as const,\n PAREN_L: '(' as const,\n PAREN_R: ')' as const,\n DOT: '.' as const,\n SPREAD: '...' as const,\n COLON: ':' as const,\n EQUALS: '=' as const,\n AT: '@' as const,\n BRACKET_L: '[' as const,\n BRACKET_R: ']' as const,\n BRACE_L: '{' as const,\n PIPE: '|' as const,\n BRACE_R: '}' as const,\n NAME: 'Name' as const,\n INT: 'Int' as const,\n FLOAT: 'Float' as const,\n STRING: 'String' as const,\n BLOCK_STRING: 'BlockString' as const,\n COMMENT: 'Comment' as const,\n} as const;\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TokenKind = (typeof TokenKind)[keyof typeof TokenKind];\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.mts new file mode 100644 index 00000000..9709b7bd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.mts @@ -0,0 +1,278 @@ +/** @category Visiting */ +import type { ASTNode } from "./ast.mjs"; +import { Kind } from "./kinds.mjs"; +/** A visitor defines the callbacks called during AST traversal. */ +export type ASTVisitor = EnterLeaveVisitor | KindVisitor; +type KindVisitor = { + readonly [NodeT in ASTNode as NodeT['kind']]?: ASTVisitFn | EnterLeaveVisitor; +}; +interface EnterLeaveVisitor { + readonly enter?: ASTVisitFn | undefined; + readonly leave?: ASTVisitFn | undefined; +} +/** + * A visitor is composed of visit functions called for each node during traversal. + * @typeParam TVisitedNode - AST node type handled by this visitor function. + */ +export type ASTVisitFn = ( +/** Current node being visited. */ +node: TVisitedNode, +/** Index or key for this node within the parent node or array. */ +key: string | number | undefined, +/** Parent immediately above this node, which may be an array. */ +parent: ASTNode | ReadonlyArray | undefined, +/** Key path from the root node to this node. */ +path: ReadonlyArray, +/** + * All nodes and arrays visited before reaching this node's parent. + * These correspond to array indices in `path`. + * Note: ancestors includes arrays that contain the visited node's parent. + */ +ancestors: ReadonlyArray>) => any; +/** + * A reducer is composed of reducer functions that convert AST nodes into another form. + * + * @internal + */ +export type ASTReducer = { + readonly [NodeT in ASTNode as NodeT['kind']]?: { + readonly enter?: ASTVisitFn; + readonly leave: ASTReducerFn; + }; +}; +type ASTReducerFn = ( +/** + * Current node being visited. + * @internal + */ +node: { + [K in keyof TReducedNode]: ReducedField; +}, +/** + * Index or key for this node within the parent node or array. + * @internal + */ +key: string | number | undefined, +/** + * Parent immediately above this node, which may be an array. + * @internal + */ +parent: ASTNode | ReadonlyArray | undefined, +/** + * Key path from the root node to this node. + * @internal + */ +path: ReadonlyArray, +/** + * All nodes and arrays visited before reaching this node's parent. + * These correspond to array indices in `path`. + * Note: ancestors includes arrays that contain the visited node's parent. + * @internal + */ +ancestors: ReadonlyArray>) => R; +type ReducedField = T extends ASTNode ? R : T extends ReadonlyArray ? ReadonlyArray : T; +/** A visitor key map describes the traversable child properties for each node kind. */ +export type ASTVisitorKeyMap = { + [NodeT in ASTNode as NodeT['kind']]?: ReadonlyArray; +}; +/** A value that can be returned from a visitor function to stop traversal. */ +export declare const BREAK: unknown; +/** + * visit() will walk through an AST using a depth-first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * @param root - The AST node at which to start traversal. + * @param visitor - The visitor or reducer functions to call while traversing. + * @param visitorKeys - Optional map of child keys to visit for each AST node kind. + * @returns The original AST, an edited AST, or a reduced value depending on the visitor. + * @typeParam N - The root AST node type returned when visiting without reducing. + * @example + * ```ts + * // Return values control traversal: undefined makes no change, false skips + * // a subtree, BREAK stops traversal, null removes a node, and any other + * // value replaces the current node. + * import { Kind, parse, print, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const editedAST = visit(document, { + * Field: (node) => { + * if (node.name.value === 'hero') { + * return { + * ...node, + * name: { kind: Kind.NAME, value: 'human' }, + * }; + * } + * }, + * }); + * + * print(editedAST); // => '{\n human {\n name\n }\n}' + * ``` + * @example + * ```ts + * // A named visitor function runs when entering nodes of that kind. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const fieldNames = []; + * + * visit(document, { + * Field: (node) => { + * fieldNames.push(node.name.value); + * }, + * }); + * + * fieldNames; // => ['hero', 'name'] + * ``` + * @example + * ```ts + * // A named visitor object can provide separate enter and leave handlers for + * // nodes of that kind. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const events = []; + * + * visit(document, { + * Field: { + * enter: (node) => { + * events.push(`enter:${node.name.value}`); + * }, + * leave: (node) => { + * events.push(`leave:${node.name.value}`); + * }, + * }, + * }); + * + * events; // => ['enter:hero', 'enter:name', 'leave:name', 'leave:hero'] + * ``` + * @example + * ```ts + * // Generic enter and leave handlers run for every node. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * let enterCount = 0; + * let leaveCount = 0; + * + * visit(document, { + * enter: (node) => { + * enterCount += 1; + * }, + * leave: (node) => { + * leaveCount += 1; + * }, + * }); + * + * enterCount; // => leaveCount + * enterCount > 0; // => true + * ``` + */ +export declare function visit(root: N, visitor: ASTVisitor, visitorKeys?: ASTVisitorKeyMap): N; +/** + * Traverses an AST with reducer callbacks and returns the reduced value. + * @param root - The AST node where traversal starts. + * @param visitor - Reducer callbacks to invoke during traversal. + * @param visitorKeys - Optional mapping of child keys for each AST node kind. + * @returns The value produced by the reducer visitor. + * @typeParam R - The value produced by reducer visitor callbacks. + * @example + * ```ts + * // A reducer visitor returns values from leave handlers to build a reduced + * // result instead of returning an edited AST. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const printed = visit(document, { + * Name: { + * leave: (node) => { + * return node.value; + * }, + * }, + * Field: { + * leave: (node) => { + * return node.selectionSet == null + * ? node.name + * : `${node.name} { ${node.selectionSet} }`; + * }, + * }, + * SelectionSet: { + * leave: (node) => { + * return node.selections.join(' '); + * }, + * }, + * OperationDefinition: { + * leave: (node) => { + * return node.selectionSet; + * }, + * }, + * Document: { + * leave: (node) => { + * return node.definitions.join('\n'); + * }, + * }, + * }); + * + * printed; // => 'hero { name }' + * ``` + */ +export declare function visit(root: ASTNode, visitor: ASTReducer, visitorKeys?: ASTVisitorKeyMap): R; +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + * @param visitors - The visitors to merge into one parallel visitor. + * @returns A visitor that delegates traversal to each provided visitor. + * @example + * ```ts + * import { parse, visit, visitInParallel } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const events = []; + * + * visit( + * document, + * visitInParallel([ + * { + * Field: (node) => { + * events.push(`field:${node.name.value}`); + * }, + * }, + * { + * Name: (node) => { + * events.push(`name:${node.value}`); + * }, + * }, + * ]), + * ); + * + * events; // => ['field:hero', 'name:hero', 'field:name', 'name:name'] + * ``` + */ +export declare function visitInParallel(visitors: ReadonlyArray): ASTVisitor; +/** + * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind. + * @param visitor - The visitor object to inspect. + * @param kind - The AST node kind to resolve handlers for. + * @returns The enter and leave handlers that apply for the given node kind. + * @example + * ```ts + * import { Kind, getEnterLeaveForKind } from 'graphql/language'; + * + * const handlers = getEnterLeaveForKind({ Field: () => {} }, Kind.FIELD); + * + * typeof handlers.enter; // => 'function' + * handlers.leave; // => undefined + * ``` + */ +export declare function getEnterLeaveForKind(visitor: ASTVisitor, kind: Kind): EnterLeaveVisitor; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.ts new file mode 100644 index 00000000..6e84320a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.d.ts @@ -0,0 +1,278 @@ +/** @category Visiting */ +import type { ASTNode } from "./ast.js"; +import { Kind } from "./kinds.js"; +/** A visitor defines the callbacks called during AST traversal. */ +export type ASTVisitor = EnterLeaveVisitor | KindVisitor; +type KindVisitor = { + readonly [NodeT in ASTNode as NodeT['kind']]?: ASTVisitFn | EnterLeaveVisitor; +}; +interface EnterLeaveVisitor { + readonly enter?: ASTVisitFn | undefined; + readonly leave?: ASTVisitFn | undefined; +} +/** + * A visitor is composed of visit functions called for each node during traversal. + * @typeParam TVisitedNode - AST node type handled by this visitor function. + */ +export type ASTVisitFn = ( +/** Current node being visited. */ +node: TVisitedNode, +/** Index or key for this node within the parent node or array. */ +key: string | number | undefined, +/** Parent immediately above this node, which may be an array. */ +parent: ASTNode | ReadonlyArray | undefined, +/** Key path from the root node to this node. */ +path: ReadonlyArray, +/** + * All nodes and arrays visited before reaching this node's parent. + * These correspond to array indices in `path`. + * Note: ancestors includes arrays that contain the visited node's parent. + */ +ancestors: ReadonlyArray>) => any; +/** + * A reducer is composed of reducer functions that convert AST nodes into another form. + * + * @internal + */ +export type ASTReducer = { + readonly [NodeT in ASTNode as NodeT['kind']]?: { + readonly enter?: ASTVisitFn; + readonly leave: ASTReducerFn; + }; +}; +type ASTReducerFn = ( +/** + * Current node being visited. + * @internal + */ +node: { + [K in keyof TReducedNode]: ReducedField; +}, +/** + * Index or key for this node within the parent node or array. + * @internal + */ +key: string | number | undefined, +/** + * Parent immediately above this node, which may be an array. + * @internal + */ +parent: ASTNode | ReadonlyArray | undefined, +/** + * Key path from the root node to this node. + * @internal + */ +path: ReadonlyArray, +/** + * All nodes and arrays visited before reaching this node's parent. + * These correspond to array indices in `path`. + * Note: ancestors includes arrays that contain the visited node's parent. + * @internal + */ +ancestors: ReadonlyArray>) => R; +type ReducedField = T extends ASTNode ? R : T extends ReadonlyArray ? ReadonlyArray : T; +/** A visitor key map describes the traversable child properties for each node kind. */ +export type ASTVisitorKeyMap = { + [NodeT in ASTNode as NodeT['kind']]?: ReadonlyArray; +}; +/** A value that can be returned from a visitor function to stop traversal. */ +export declare const BREAK: unknown; +/** + * visit() will walk through an AST using a depth-first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * @param root - The AST node at which to start traversal. + * @param visitor - The visitor or reducer functions to call while traversing. + * @param visitorKeys - Optional map of child keys to visit for each AST node kind. + * @returns The original AST, an edited AST, or a reduced value depending on the visitor. + * @typeParam N - The root AST node type returned when visiting without reducing. + * @example + * ```ts + * // Return values control traversal: undefined makes no change, false skips + * // a subtree, BREAK stops traversal, null removes a node, and any other + * // value replaces the current node. + * import { Kind, parse, print, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const editedAST = visit(document, { + * Field: (node) => { + * if (node.name.value === 'hero') { + * return { + * ...node, + * name: { kind: Kind.NAME, value: 'human' }, + * }; + * } + * }, + * }); + * + * print(editedAST); // => '{\n human {\n name\n }\n}' + * ``` + * @example + * ```ts + * // A named visitor function runs when entering nodes of that kind. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const fieldNames = []; + * + * visit(document, { + * Field: (node) => { + * fieldNames.push(node.name.value); + * }, + * }); + * + * fieldNames; // => ['hero', 'name'] + * ``` + * @example + * ```ts + * // A named visitor object can provide separate enter and leave handlers for + * // nodes of that kind. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const events = []; + * + * visit(document, { + * Field: { + * enter: (node) => { + * events.push(`enter:${node.name.value}`); + * }, + * leave: (node) => { + * events.push(`leave:${node.name.value}`); + * }, + * }, + * }); + * + * events; // => ['enter:hero', 'enter:name', 'leave:name', 'leave:hero'] + * ``` + * @example + * ```ts + * // Generic enter and leave handlers run for every node. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * let enterCount = 0; + * let leaveCount = 0; + * + * visit(document, { + * enter: (node) => { + * enterCount += 1; + * }, + * leave: (node) => { + * leaveCount += 1; + * }, + * }); + * + * enterCount; // => leaveCount + * enterCount > 0; // => true + * ``` + */ +export declare function visit(root: N, visitor: ASTVisitor, visitorKeys?: ASTVisitorKeyMap): N; +/** + * Traverses an AST with reducer callbacks and returns the reduced value. + * @param root - The AST node where traversal starts. + * @param visitor - Reducer callbacks to invoke during traversal. + * @param visitorKeys - Optional mapping of child keys for each AST node kind. + * @returns The value produced by the reducer visitor. + * @typeParam R - The value produced by reducer visitor callbacks. + * @example + * ```ts + * // A reducer visitor returns values from leave handlers to build a reduced + * // result instead of returning an edited AST. + * import { parse, visit } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const printed = visit(document, { + * Name: { + * leave: (node) => { + * return node.value; + * }, + * }, + * Field: { + * leave: (node) => { + * return node.selectionSet == null + * ? node.name + * : `${node.name} { ${node.selectionSet} }`; + * }, + * }, + * SelectionSet: { + * leave: (node) => { + * return node.selections.join(' '); + * }, + * }, + * OperationDefinition: { + * leave: (node) => { + * return node.selectionSet; + * }, + * }, + * Document: { + * leave: (node) => { + * return node.definitions.join('\n'); + * }, + * }, + * }); + * + * printed; // => 'hero { name }' + * ``` + */ +export declare function visit(root: ASTNode, visitor: ASTReducer, visitorKeys?: ASTVisitorKeyMap): R; +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + * @param visitors - The visitors to merge into one parallel visitor. + * @returns A visitor that delegates traversal to each provided visitor. + * @example + * ```ts + * import { parse, visit, visitInParallel } from 'graphql/language'; + * + * const document = parse('{ hero { name } }'); + * const events = []; + * + * visit( + * document, + * visitInParallel([ + * { + * Field: (node) => { + * events.push(`field:${node.name.value}`); + * }, + * }, + * { + * Name: (node) => { + * events.push(`name:${node.value}`); + * }, + * }, + * ]), + * ); + * + * events; // => ['field:hero', 'name:hero', 'field:name', 'name:name'] + * ``` + */ +export declare function visitInParallel(visitors: ReadonlyArray): ASTVisitor; +/** + * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind. + * @param visitor - The visitor object to inspect. + * @param kind - The AST node kind to resolve handlers for. + * @returns The enter and leave handlers that apply for the given node kind. + * @example + * ```ts + * import { Kind, getEnterLeaveForKind } from 'graphql/language'; + * + * const handlers = getEnterLeaveForKind({ Field: () => {} }, Kind.FIELD); + * + * typeof handlers.enter; // => 'function' + * handlers.leave; // => undefined + * ``` + */ +export declare function getEnterLeaveForKind(visitor: ASTVisitor, kind: Kind): EnterLeaveVisitor; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js new file mode 100644 index 00000000..a171bbf9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BREAK = void 0; +exports.visit = visit; +exports.visitInParallel = visitInParallel; +exports.getEnterLeaveForKind = getEnterLeaveForKind; +const devAssert_ts_1 = require("../jsutils/devAssert.js"); +const inspect_ts_1 = require("../jsutils/inspect.js"); +const ast_ts_1 = require("./ast.js"); +const kinds_ts_1 = require("./kinds.js"); +exports.BREAK = Object.freeze({}); +function visit(root, visitor, visitorKeys = ast_ts_1.QueryDocumentKeys) { + const enterLeaveMap = new Map(); + for (const kind of Object.values(kinds_ts_1.Kind)) { + enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind)); + } + let stack = undefined; + let inArray = Array.isArray(root); + let keys = [root]; + let index = -1; + let edits = []; + let node = root; + let key = undefined; + let parent = undefined; + const path = []; + const ancestors = []; + do { + index++; + const isLeaving = index === keys.length; + const isEdited = isLeaving && edits.length !== 0; + if (isLeaving) { + key = ancestors.length === 0 ? undefined : path[path.length - 1]; + node = parent; + parent = ancestors.pop(); + if (isEdited) { + if (inArray) { + node = node.slice(); + let editOffset = 0; + for (const [editKey, editValue] of edits) { + const arrayKey = editKey - editOffset; + if (editValue === null) { + node.splice(arrayKey, 1); + editOffset++; + } + else { + node[arrayKey] = editValue; + } + } + } + else { + node = { ...node }; + for (const [editKey, editValue] of edits) { + node[editKey] = editValue; + } + } + } + index = stack.index; + keys = stack.keys; + edits = stack.edits; + inArray = stack.inArray; + stack = stack.prev; + } + else if (parent != null) { + key = inArray ? index : keys[index]; + node = parent[key]; + if (node === null || node === undefined) { + continue; + } + path.push(key); + } + let result; + if (!Array.isArray(node)) { + if (!((0, ast_ts_1.isNode)(node))) + (0, devAssert_ts_1.devAssert)(false, `Invalid AST Node: ${(0, inspect_ts_1.inspect)(node)}.`); + const visitFn = isLeaving + ? enterLeaveMap.get(node.kind)?.leave + : enterLeaveMap.get(node.kind)?.enter; + result = visitFn?.call(visitor, node, key, parent, path, ancestors); + if (result === exports.BREAK) { + break; + } + if (result === false) { + if (!isLeaving) { + path.pop(); + continue; + } + } + else if (result !== undefined) { + edits.push([key, result]); + if (!isLeaving) { + if ((0, ast_ts_1.isNode)(result)) { + node = result; + } + else { + path.pop(); + continue; + } + } + } + } + if (result === undefined && isEdited) { + edits.push([key, node]); + } + if (isLeaving) { + path.pop(); + } + else { + stack = { inArray, index, keys, edits, prev: stack }; + inArray = Array.isArray(node); + keys = inArray ? node : (visitorKeys[node.kind] ?? []); + index = -1; + edits = []; + if (parent != null) { + ancestors.push(parent); + } + parent = node; + } + } while (stack !== undefined); + if (edits.length !== 0) { + return edits.at(-1)[1]; + } + return root; +} +function visitInParallel(visitors) { + const skipping = new Array(visitors.length).fill(null); + const mergedVisitor = Object.create(null); + for (const kind of Object.values(kinds_ts_1.Kind)) { + let hasVisitor = false; + const enterList = new Array(visitors.length).fill(undefined); + const leaveList = new Array(visitors.length).fill(undefined); + for (let i = 0; i < visitors.length; ++i) { + const { enter, leave } = getEnterLeaveForKind(visitors[i], kind); + hasVisitor ||= enter != null || leave != null; + enterList[i] = enter; + leaveList[i] = leave; + } + if (!hasVisitor) { + continue; + } + const mergedEnterLeave = { + enter(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + const result = enterList[i]?.apply(visitors[i], args); + if (result === false) { + skipping[i] = node; + } + else if (result === exports.BREAK) { + skipping[i] = exports.BREAK; + } + else if (result !== undefined) { + return result; + } + } + } + }, + leave(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + const result = leaveList[i]?.apply(visitors[i], args); + if (result === exports.BREAK) { + skipping[i] = exports.BREAK; + } + else if (result !== undefined && result !== false) { + return result; + } + } + else if (skipping[i] === node) { + skipping[i] = null; + } + } + }, + }; + mergedVisitor[kind] = mergedEnterLeave; + } + return mergedVisitor; +} +function getEnterLeaveForKind(visitor, kind) { + const kindVisitor = visitor[kind]; + if (typeof kindVisitor === 'object') { + return kindVisitor; + } + else if (typeof kindVisitor === 'function') { + return { enter: kindVisitor, leave: undefined }; + } + return { enter: visitor.enter, leave: visitor.leave }; +} +//# sourceMappingURL=visitor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js.map new file mode 100644 index 00000000..748ca05c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"visitor.js","sourceRoot":"","sources":["../../src/language/visitor.ts"],"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AAW,CAAC;IACrB,CAAC;SAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QAE7C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAClD,CAAC;IAGD,OAAO,EAAE,KAAK,EAAG,OAAe,CAAC,KAAK,EAAE,KAAK,EAAG,OAAe,CAAC,KAAK,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["/** @category Visiting */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { inspect } from '../jsutils/inspect.ts';\n\nimport type { ASTNode } from './ast.ts';\nimport { isNode, QueryDocumentKeys } from './ast.ts';\nimport { Kind } from './kinds.ts';\n\n/** A visitor defines the callbacks called during AST traversal. */\nexport type ASTVisitor = EnterLeaveVisitor | KindVisitor;\n\ntype KindVisitor = {\n readonly [NodeT in ASTNode as NodeT['kind']]?:\n | ASTVisitFn\n | EnterLeaveVisitor;\n};\n\ninterface EnterLeaveVisitor {\n readonly enter?: ASTVisitFn | undefined;\n readonly leave?: ASTVisitFn | undefined;\n}\n\n/**\n * A visitor is composed of visit functions called for each node during traversal.\n * @typeParam TVisitedNode - AST node type handled by this visitor function.\n */\nexport type ASTVisitFn = (\n /** Current node being visited. */\n node: TVisitedNode,\n /** Index or key for this node within the parent node or array. */\n key: string | number | undefined,\n /** Parent immediately above this node, which may be an array. */\n parent: ASTNode | ReadonlyArray | undefined,\n /** Key path from the root node to this node. */\n path: ReadonlyArray,\n /**\n * All nodes and arrays visited before reaching this node's parent.\n * These correspond to array indices in `path`.\n * Note: ancestors includes arrays that contain the visited node's parent.\n */\n ancestors: ReadonlyArray>,\n) => any;\n\n/**\n * A reducer is composed of reducer functions that convert AST nodes into another form.\n *\n * @internal\n */\nexport type ASTReducer = {\n readonly [NodeT in ASTNode as NodeT['kind']]?: {\n readonly enter?: ASTVisitFn;\n readonly leave: ASTReducerFn;\n };\n};\n\ntype ASTReducerFn = (\n /**\n * Current node being visited.\n * @internal\n */\n node: { [K in keyof TReducedNode]: ReducedField },\n /**\n * Index or key for this node within the parent node or array.\n * @internal\n */\n key: string | number | undefined,\n /**\n * Parent immediately above this node, which may be an array.\n * @internal\n */\n parent: ASTNode | ReadonlyArray | undefined,\n /**\n * Key path from the root node to this node.\n * @internal\n */\n path: ReadonlyArray,\n /**\n * All nodes and arrays visited before reaching this node's parent.\n * These correspond to array indices in `path`.\n * Note: ancestors includes arrays that contain the visited node's parent.\n * @internal\n */\n ancestors: ReadonlyArray>,\n) => R;\n\ntype ReducedField = T extends ASTNode\n ? R\n : T extends ReadonlyArray\n ? ReadonlyArray\n : T;\n\n/** A visitor key map describes the traversable child properties for each node kind. */\nexport type ASTVisitorKeyMap = {\n [NodeT in ASTNode as NodeT['kind']]?: ReadonlyArray;\n};\n\n/** A value that can be returned from a visitor function to stop traversal. */\nexport const BREAK: unknown = Object.freeze({});\n\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n * @param root - The AST node at which to start traversal.\n * @param visitor - The visitor or reducer functions to call while traversing.\n * @param visitorKeys - Optional map of child keys to visit for each AST node kind.\n * @returns The original AST, an edited AST, or a reduced value depending on the visitor.\n * @typeParam N - The root AST node type returned when visiting without reducing.\n * @example\n * ```ts\n * // Return values control traversal: undefined makes no change, false skips\n * // a subtree, BREAK stops traversal, null removes a node, and any other\n * // value replaces the current node.\n * import { Kind, parse, print, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const editedAST = visit(document, {\n * Field: (node) => {\n * if (node.name.value === 'hero') {\n * return {\n * ...node,\n * name: { kind: Kind.NAME, value: 'human' },\n * };\n * }\n * },\n * });\n *\n * print(editedAST); // => '{\\n human {\\n name\\n }\\n}'\n * ```\n * @example\n * ```ts\n * // A named visitor function runs when entering nodes of that kind.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const fieldNames = [];\n *\n * visit(document, {\n * Field: (node) => {\n * fieldNames.push(node.name.value);\n * },\n * });\n *\n * fieldNames; // => ['hero', 'name']\n * ```\n * @example\n * ```ts\n * // A named visitor object can provide separate enter and leave handlers for\n * // nodes of that kind.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const events = [];\n *\n * visit(document, {\n * Field: {\n * enter: (node) => {\n * events.push(`enter:${node.name.value}`);\n * },\n * leave: (node) => {\n * events.push(`leave:${node.name.value}`);\n * },\n * },\n * });\n *\n * events; // => ['enter:hero', 'enter:name', 'leave:name', 'leave:hero']\n * ```\n * @example\n * ```ts\n * // Generic enter and leave handlers run for every node.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * let enterCount = 0;\n * let leaveCount = 0;\n *\n * visit(document, {\n * enter: (node) => {\n * enterCount += 1;\n * },\n * leave: (node) => {\n * leaveCount += 1;\n * },\n * });\n *\n * enterCount; // => leaveCount\n * enterCount > 0; // => true\n * ```\n */\nexport function visit(\n root: N,\n visitor: ASTVisitor,\n visitorKeys?: ASTVisitorKeyMap,\n): N;\n/**\n * Traverses an AST with reducer callbacks and returns the reduced value.\n * @param root - The AST node where traversal starts.\n * @param visitor - Reducer callbacks to invoke during traversal.\n * @param visitorKeys - Optional mapping of child keys for each AST node kind.\n * @returns The value produced by the reducer visitor.\n * @typeParam R - The value produced by reducer visitor callbacks.\n * @example\n * ```ts\n * // A reducer visitor returns values from leave handlers to build a reduced\n * // result instead of returning an edited AST.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const printed = visit(document, {\n * Name: {\n * leave: (node) => {\n * return node.value;\n * },\n * },\n * Field: {\n * leave: (node) => {\n * return node.selectionSet == null\n * ? node.name\n * : `${node.name} { ${node.selectionSet} }`;\n * },\n * },\n * SelectionSet: {\n * leave: (node) => {\n * return node.selections.join(' ');\n * },\n * },\n * OperationDefinition: {\n * leave: (node) => {\n * return node.selectionSet;\n * },\n * },\n * Document: {\n * leave: (node) => {\n * return node.definitions.join('\\n');\n * },\n * },\n * });\n *\n * printed; // => 'hero { name }'\n * ```\n */\nexport function visit(\n root: ASTNode,\n visitor: ASTReducer,\n visitorKeys?: ASTVisitorKeyMap,\n): R;\n/**\n * Traverses an AST with visitor or reducer callbacks.\n * @internal\n */\nexport function visit(\n root: ASTNode,\n visitor: ASTVisitor | ASTReducer,\n visitorKeys: ASTVisitorKeyMap = QueryDocumentKeys,\n): any {\n const enterLeaveMap = new Map>();\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n\n /* eslint-disable no-undef-init */\n let stack: any = undefined;\n let inArray = Array.isArray(root);\n let keys: any = [root];\n let index = -1;\n let edits = [];\n let node: any = root;\n let key: any = undefined;\n let parent: any = undefined;\n const path: any = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n\n let editOffset = 0;\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = { ...node };\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent != null) {\n key = inArray ? index : keys[index];\n node = parent[key];\n if (node === null || node === undefined) {\n continue;\n }\n path.push(key);\n }\n\n let result;\n if (!Array.isArray(node)) {\n devAssert(isNode(node), `Invalid AST Node: ${inspect(node)}.`);\n\n const visitFn = isLeaving\n ? enterLeaveMap.get(node.kind)?.leave\n : enterLeaveMap.get(node.kind)?.enter;\n\n result = visitFn?.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = { inArray, index, keys, edits, prev: stack };\n inArray = Array.isArray(node);\n keys = inArray ? node : ((visitorKeys as any)[node.kind] ?? []);\n index = -1;\n edits = [];\n if (parent != null) {\n ancestors.push(parent);\n }\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits.at(-1)[1];\n }\n\n return root;\n}\n\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n * @param visitors - The visitors to merge into one parallel visitor.\n * @returns A visitor that delegates traversal to each provided visitor.\n * @example\n * ```ts\n * import { parse, visit, visitInParallel } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const events = [];\n *\n * visit(\n * document,\n * visitInParallel([\n * {\n * Field: (node) => {\n * events.push(`field:${node.name.value}`);\n * },\n * },\n * {\n * Name: (node) => {\n * events.push(`name:${node.value}`);\n * },\n * },\n * ]),\n * );\n *\n * events; // => ['field:hero', 'name:hero', 'field:name', 'name:name']\n * ```\n */\nexport function visitInParallel(\n visitors: ReadonlyArray,\n): ASTVisitor {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor ||= enter != null || leave != null;\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave: EnterLeaveVisitor = {\n enter(...args) {\n const node = args[0];\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n const result = enterList[i]?.apply(visitors[i], args);\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n leave(...args) {\n const node = args[0];\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n const result = leaveList[i]?.apply(visitors[i], args);\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n * @param visitor - The visitor object to inspect.\n * @param kind - The AST node kind to resolve handlers for.\n * @returns The enter and leave handlers that apply for the given node kind.\n * @example\n * ```ts\n * import { Kind, getEnterLeaveForKind } from 'graphql/language';\n *\n * const handlers = getEnterLeaveForKind({ Field: () => {} }, Kind.FIELD);\n *\n * typeof handlers.enter; // => 'function'\n * handlers.leave; // => undefined\n * ```\n */\nexport function getEnterLeaveForKind(\n visitor: ASTVisitor,\n kind: Kind,\n): EnterLeaveVisitor {\n const kindVisitor:\n | ASTVisitFn\n | EnterLeaveVisitor\n | undefined = (visitor as any)[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return { enter: kindVisitor, leave: undefined };\n }\n\n // { enter() {}, leave() {} }\n return { enter: (visitor as any).enter, leave: (visitor as any).leave };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs new file mode 100644 index 00000000..857565c7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs @@ -0,0 +1,184 @@ +import { devAssert } from "../jsutils/devAssert.mjs"; +import { inspect } from "../jsutils/inspect.mjs"; +import { isNode, QueryDocumentKeys } from "./ast.mjs"; +import { Kind } from "./kinds.mjs"; +export const BREAK = Object.freeze({}); +export function visit(root, visitor, visitorKeys = QueryDocumentKeys) { + const enterLeaveMap = new Map(); + for (const kind of Object.values(Kind)) { + enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind)); + } + let stack = undefined; + let inArray = Array.isArray(root); + let keys = [root]; + let index = -1; + let edits = []; + let node = root; + let key = undefined; + let parent = undefined; + const path = []; + const ancestors = []; + do { + index++; + const isLeaving = index === keys.length; + const isEdited = isLeaving && edits.length !== 0; + if (isLeaving) { + key = ancestors.length === 0 ? undefined : path[path.length - 1]; + node = parent; + parent = ancestors.pop(); + if (isEdited) { + if (inArray) { + node = node.slice(); + let editOffset = 0; + for (const [editKey, editValue] of edits) { + const arrayKey = editKey - editOffset; + if (editValue === null) { + node.splice(arrayKey, 1); + editOffset++; + } + else { + node[arrayKey] = editValue; + } + } + } + else { + node = { ...node }; + for (const [editKey, editValue] of edits) { + node[editKey] = editValue; + } + } + } + index = stack.index; + keys = stack.keys; + edits = stack.edits; + inArray = stack.inArray; + stack = stack.prev; + } + else if (parent != null) { + key = inArray ? index : keys[index]; + node = parent[key]; + if (node === null || node === undefined) { + continue; + } + path.push(key); + } + let result; + if (!Array.isArray(node)) { + if (!(isNode(node))) + devAssert(false, `Invalid AST Node: ${inspect(node)}.`); + const visitFn = isLeaving + ? enterLeaveMap.get(node.kind)?.leave + : enterLeaveMap.get(node.kind)?.enter; + result = visitFn?.call(visitor, node, key, parent, path, ancestors); + if (result === BREAK) { + break; + } + if (result === false) { + if (!isLeaving) { + path.pop(); + continue; + } + } + else if (result !== undefined) { + edits.push([key, result]); + if (!isLeaving) { + if (isNode(result)) { + node = result; + } + else { + path.pop(); + continue; + } + } + } + } + if (result === undefined && isEdited) { + edits.push([key, node]); + } + if (isLeaving) { + path.pop(); + } + else { + stack = { inArray, index, keys, edits, prev: stack }; + inArray = Array.isArray(node); + keys = inArray ? node : (visitorKeys[node.kind] ?? []); + index = -1; + edits = []; + if (parent != null) { + ancestors.push(parent); + } + parent = node; + } + } while (stack !== undefined); + if (edits.length !== 0) { + return edits.at(-1)[1]; + } + return root; +} +export function visitInParallel(visitors) { + const skipping = new Array(visitors.length).fill(null); + const mergedVisitor = Object.create(null); + for (const kind of Object.values(Kind)) { + let hasVisitor = false; + const enterList = new Array(visitors.length).fill(undefined); + const leaveList = new Array(visitors.length).fill(undefined); + for (let i = 0; i < visitors.length; ++i) { + const { enter, leave } = getEnterLeaveForKind(visitors[i], kind); + hasVisitor ||= enter != null || leave != null; + enterList[i] = enter; + leaveList[i] = leave; + } + if (!hasVisitor) { + continue; + } + const mergedEnterLeave = { + enter(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + const result = enterList[i]?.apply(visitors[i], args); + if (result === false) { + skipping[i] = node; + } + else if (result === BREAK) { + skipping[i] = BREAK; + } + else if (result !== undefined) { + return result; + } + } + } + }, + leave(...args) { + const node = args[0]; + for (let i = 0; i < visitors.length; i++) { + if (skipping[i] === null) { + const result = leaveList[i]?.apply(visitors[i], args); + if (result === BREAK) { + skipping[i] = BREAK; + } + else if (result !== undefined && result !== false) { + return result; + } + } + else if (skipping[i] === node) { + skipping[i] = null; + } + } + }, + }; + mergedVisitor[kind] = mergedEnterLeave; + } + return mergedVisitor; +} +export function getEnterLeaveForKind(visitor, kind) { + const kindVisitor = visitor[kind]; + if (typeof kindVisitor === 'object') { + return kindVisitor; + } + else if (typeof kindVisitor === 'function') { + return { enter: kindVisitor, leave: undefined }; + } + return { enter: visitor.enter, leave: visitor.leave }; +} +//# sourceMappingURL=visitor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs.map new file mode 100644 index 00000000..fb82f25a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/language/visitor.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visitor.js","sourceRoot":"","sources":["../../src/language/visitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAGhD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAiB;AACrD,OAAO,EAAE,IAAI,EAAE,oBAAmB;AA2FlC,MAAM,CAAC,MAAM,KAAK,GAAY,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAkKhD,MAAM,UAAU,KAAK,CACnB,IAAa,EACb,OAAqC,EACrC,cAAgC,iBAAiB;IAEjD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAoC,CAAC;IAClE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAGD,IAAI,KAAK,GAAQ,SAAS,CAAC;IAC3B,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAI,GAAQ,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;IACf,IAAI,KA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AS,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;4BACpD,OAAO,MAAM,CAAC;wBAChB,CAAC;oBACH,CAAC;yBAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;wBAChC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;oBACrB,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;QAEF,aAAa,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC;IACzC,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAiBD,MAAM,UAAU,oBAAoB,CAClC,OAAmB,EACnB,IAAU;IAEV,MAAM,WAAW,GAGA,OAAe,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QAEpC,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QAE7C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAClD,CAAC;IAGD,OAAO,EAAE,KAAK,EAAG,OAAe,CAAC,KAAK,EAAE,KAAK,EAAG,OAAe,CAAC,KAAK,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["/** @category Visiting */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { inspect } from '../jsutils/inspect.ts';\n\nimport type { ASTNode } from './ast.ts';\nimport { isNode, QueryDocumentKeys } from './ast.ts';\nimport { Kind } from './kinds.ts';\n\n/** A visitor defines the callbacks called during AST traversal. */\nexport type ASTVisitor = EnterLeaveVisitor | KindVisitor;\n\ntype KindVisitor = {\n readonly [NodeT in ASTNode as NodeT['kind']]?:\n | ASTVisitFn\n | EnterLeaveVisitor;\n};\n\ninterface EnterLeaveVisitor {\n readonly enter?: ASTVisitFn | undefined;\n readonly leave?: ASTVisitFn | undefined;\n}\n\n/**\n * A visitor is composed of visit functions called for each node during traversal.\n * @typeParam TVisitedNode - AST node type handled by this visitor function.\n */\nexport type ASTVisitFn = (\n /** Current node being visited. */\n node: TVisitedNode,\n /** Index or key for this node within the parent node or array. */\n key: string | number | undefined,\n /** Parent immediately above this node, which may be an array. */\n parent: ASTNode | ReadonlyArray | undefined,\n /** Key path from the root node to this node. */\n path: ReadonlyArray,\n /**\n * All nodes and arrays visited before reaching this node's parent.\n * These correspond to array indices in `path`.\n * Note: ancestors includes arrays that contain the visited node's parent.\n */\n ancestors: ReadonlyArray>,\n) => any;\n\n/**\n * A reducer is composed of reducer functions that convert AST nodes into another form.\n *\n * @internal\n */\nexport type ASTReducer = {\n readonly [NodeT in ASTNode as NodeT['kind']]?: {\n readonly enter?: ASTVisitFn;\n readonly leave: ASTReducerFn;\n };\n};\n\ntype ASTReducerFn = (\n /**\n * Current node being visited.\n * @internal\n */\n node: { [K in keyof TReducedNode]: ReducedField },\n /**\n * Index or key for this node within the parent node or array.\n * @internal\n */\n key: string | number | undefined,\n /**\n * Parent immediately above this node, which may be an array.\n * @internal\n */\n parent: ASTNode | ReadonlyArray | undefined,\n /**\n * Key path from the root node to this node.\n * @internal\n */\n path: ReadonlyArray,\n /**\n * All nodes and arrays visited before reaching this node's parent.\n * These correspond to array indices in `path`.\n * Note: ancestors includes arrays that contain the visited node's parent.\n * @internal\n */\n ancestors: ReadonlyArray>,\n) => R;\n\ntype ReducedField = T extends ASTNode\n ? R\n : T extends ReadonlyArray\n ? ReadonlyArray\n : T;\n\n/** A visitor key map describes the traversable child properties for each node kind. */\nexport type ASTVisitorKeyMap = {\n [NodeT in ASTNode as NodeT['kind']]?: ReadonlyArray;\n};\n\n/** A value that can be returned from a visitor function to stop traversal. */\nexport const BREAK: unknown = Object.freeze({});\n\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n * @param root - The AST node at which to start traversal.\n * @param visitor - The visitor or reducer functions to call while traversing.\n * @param visitorKeys - Optional map of child keys to visit for each AST node kind.\n * @returns The original AST, an edited AST, or a reduced value depending on the visitor.\n * @typeParam N - The root AST node type returned when visiting without reducing.\n * @example\n * ```ts\n * // Return values control traversal: undefined makes no change, false skips\n * // a subtree, BREAK stops traversal, null removes a node, and any other\n * // value replaces the current node.\n * import { Kind, parse, print, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const editedAST = visit(document, {\n * Field: (node) => {\n * if (node.name.value === 'hero') {\n * return {\n * ...node,\n * name: { kind: Kind.NAME, value: 'human' },\n * };\n * }\n * },\n * });\n *\n * print(editedAST); // => '{\\n human {\\n name\\n }\\n}'\n * ```\n * @example\n * ```ts\n * // A named visitor function runs when entering nodes of that kind.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const fieldNames = [];\n *\n * visit(document, {\n * Field: (node) => {\n * fieldNames.push(node.name.value);\n * },\n * });\n *\n * fieldNames; // => ['hero', 'name']\n * ```\n * @example\n * ```ts\n * // A named visitor object can provide separate enter and leave handlers for\n * // nodes of that kind.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const events = [];\n *\n * visit(document, {\n * Field: {\n * enter: (node) => {\n * events.push(`enter:${node.name.value}`);\n * },\n * leave: (node) => {\n * events.push(`leave:${node.name.value}`);\n * },\n * },\n * });\n *\n * events; // => ['enter:hero', 'enter:name', 'leave:name', 'leave:hero']\n * ```\n * @example\n * ```ts\n * // Generic enter and leave handlers run for every node.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * let enterCount = 0;\n * let leaveCount = 0;\n *\n * visit(document, {\n * enter: (node) => {\n * enterCount += 1;\n * },\n * leave: (node) => {\n * leaveCount += 1;\n * },\n * });\n *\n * enterCount; // => leaveCount\n * enterCount > 0; // => true\n * ```\n */\nexport function visit(\n root: N,\n visitor: ASTVisitor,\n visitorKeys?: ASTVisitorKeyMap,\n): N;\n/**\n * Traverses an AST with reducer callbacks and returns the reduced value.\n * @param root - The AST node where traversal starts.\n * @param visitor - Reducer callbacks to invoke during traversal.\n * @param visitorKeys - Optional mapping of child keys for each AST node kind.\n * @returns The value produced by the reducer visitor.\n * @typeParam R - The value produced by reducer visitor callbacks.\n * @example\n * ```ts\n * // A reducer visitor returns values from leave handlers to build a reduced\n * // result instead of returning an edited AST.\n * import { parse, visit } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const printed = visit(document, {\n * Name: {\n * leave: (node) => {\n * return node.value;\n * },\n * },\n * Field: {\n * leave: (node) => {\n * return node.selectionSet == null\n * ? node.name\n * : `${node.name} { ${node.selectionSet} }`;\n * },\n * },\n * SelectionSet: {\n * leave: (node) => {\n * return node.selections.join(' ');\n * },\n * },\n * OperationDefinition: {\n * leave: (node) => {\n * return node.selectionSet;\n * },\n * },\n * Document: {\n * leave: (node) => {\n * return node.definitions.join('\\n');\n * },\n * },\n * });\n *\n * printed; // => 'hero { name }'\n * ```\n */\nexport function visit(\n root: ASTNode,\n visitor: ASTReducer,\n visitorKeys?: ASTVisitorKeyMap,\n): R;\n/**\n * Traverses an AST with visitor or reducer callbacks.\n * @internal\n */\nexport function visit(\n root: ASTNode,\n visitor: ASTVisitor | ASTReducer,\n visitorKeys: ASTVisitorKeyMap = QueryDocumentKeys,\n): any {\n const enterLeaveMap = new Map>();\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n\n /* eslint-disable no-undef-init */\n let stack: any = undefined;\n let inArray = Array.isArray(root);\n let keys: any = [root];\n let index = -1;\n let edits = [];\n let node: any = root;\n let key: any = undefined;\n let parent: any = undefined;\n const path: any = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n\n let editOffset = 0;\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = { ...node };\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent != null) {\n key = inArray ? index : keys[index];\n node = parent[key];\n if (node === null || node === undefined) {\n continue;\n }\n path.push(key);\n }\n\n let result;\n if (!Array.isArray(node)) {\n devAssert(isNode(node), `Invalid AST Node: ${inspect(node)}.`);\n\n const visitFn = isLeaving\n ? enterLeaveMap.get(node.kind)?.leave\n : enterLeaveMap.get(node.kind)?.enter;\n\n result = visitFn?.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = { inArray, index, keys, edits, prev: stack };\n inArray = Array.isArray(node);\n keys = inArray ? node : ((visitorKeys as any)[node.kind] ?? []);\n index = -1;\n edits = [];\n if (parent != null) {\n ancestors.push(parent);\n }\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits.at(-1)[1];\n }\n\n return root;\n}\n\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n * @param visitors - The visitors to merge into one parallel visitor.\n * @returns A visitor that delegates traversal to each provided visitor.\n * @example\n * ```ts\n * import { parse, visit, visitInParallel } from 'graphql/language';\n *\n * const document = parse('{ hero { name } }');\n * const events = [];\n *\n * visit(\n * document,\n * visitInParallel([\n * {\n * Field: (node) => {\n * events.push(`field:${node.name.value}`);\n * },\n * },\n * {\n * Name: (node) => {\n * events.push(`name:${node.value}`);\n * },\n * },\n * ]),\n * );\n *\n * events; // => ['field:hero', 'name:hero', 'field:name', 'name:name']\n * ```\n */\nexport function visitInParallel(\n visitors: ReadonlyArray,\n): ASTVisitor {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor ||= enter != null || leave != null;\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave: EnterLeaveVisitor = {\n enter(...args) {\n const node = args[0];\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n const result = enterList[i]?.apply(visitors[i], args);\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n leave(...args) {\n const node = args[0];\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n const result = leaveList[i]?.apply(visitors[i], args);\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n * @param visitor - The visitor object to inspect.\n * @param kind - The AST node kind to resolve handlers for.\n * @returns The enter and leave handlers that apply for the given node kind.\n * @example\n * ```ts\n * import { Kind, getEnterLeaveForKind } from 'graphql/language';\n *\n * const handlers = getEnterLeaveForKind({ Field: () => {} }, Kind.FIELD);\n *\n * typeof handlers.enter; // => 'function'\n * handlers.leave; // => undefined\n * ```\n */\nexport function getEnterLeaveForKind(\n visitor: ASTVisitor,\n kind: Kind,\n): EnterLeaveVisitor {\n const kindVisitor:\n | ASTVisitFn\n | EnterLeaveVisitor\n | undefined = (visitor as any)[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return { enter: kindVisitor, leave: undefined };\n }\n\n // { enter() {}, leave() {} }\n return { enter: (visitor as any).enter, leave: (visitor as any).leave };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/package.json b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/package.json new file mode 100644 index 00000000..ea6af544 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/package.json @@ -0,0 +1,203 @@ +{ + "name": "graphql", + "version": "17.0.2", + "description": "A Query Language and Runtime which can target any service.", + "license": "MIT", + "typesVersions": { + ">=4.4.0": { + "*": [ + "*" + ] + }, + "*": { + "*": [ + "NotSupportedTSVersion.d.ts" + ] + } + }, + "sideEffects": [ + "__dev__/*" + ], + "homepage": "https://github.com/graphql/graphql-js", + "bugs": { + "url": "https://github.com/graphql/graphql-js/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/graphql/graphql-js.git" + }, + "keywords": [ + "graphql", + "graphql-js" + ], + "engines": { + "node": "^22.0.0 || ^24.0.0 || ^25.0.0 || >=26.0.0" + }, + "main": "index.js", + "module": "index.mjs", + "types": "index.d.ts", + "exports": { + "./error": { + "development": { + "module": "./__dev__/error/index.mjs", + "bun": "./__dev__/error/index.mjs", + "module-sync": "./__dev__/error/index.mjs", + "node": "./__dev__/error/index.js", + "require": "./__dev__/error/index.js", + "default": "./__dev__/error/index.mjs" + }, + "default": { + "module": "./error/index.mjs", + "bun": "./error/index.mjs", + "module-sync": "./error/index.mjs", + "node": "./error/index.js", + "require": "./error/index.js", + "default": "./error/index.mjs" + } + }, + "./execution": { + "development": { + "module": "./__dev__/execution/index.mjs", + "bun": "./__dev__/execution/index.mjs", + "module-sync": "./__dev__/execution/index.mjs", + "node": "./__dev__/execution/index.js", + "require": "./__dev__/execution/index.js", + "default": "./__dev__/execution/index.mjs" + }, + "default": { + "module": "./execution/index.mjs", + "bun": "./execution/index.mjs", + "module-sync": "./execution/index.mjs", + "node": "./execution/index.js", + "require": "./execution/index.js", + "default": "./execution/index.mjs" + } + }, + ".": { + "development": { + "module": "./__dev__/index.mjs", + "bun": "./__dev__/index.mjs", + "module-sync": "./__dev__/index.mjs", + "node": "./__dev__/index.js", + "require": "./__dev__/index.js", + "default": "./__dev__/index.mjs" + }, + "default": { + "module": "./index.mjs", + "bun": "./index.mjs", + "module-sync": "./index.mjs", + "node": "./index.js", + "require": "./index.js", + "default": "./index.mjs" + } + }, + "./language": { + "development": { + "module": "./__dev__/language/index.mjs", + "bun": "./__dev__/language/index.mjs", + "module-sync": "./__dev__/language/index.mjs", + "node": "./__dev__/language/index.js", + "require": "./__dev__/language/index.js", + "default": "./__dev__/language/index.mjs" + }, + "default": { + "module": "./language/index.mjs", + "bun": "./language/index.mjs", + "module-sync": "./language/index.mjs", + "node": "./language/index.js", + "require": "./language/index.js", + "default": "./language/index.mjs" + } + }, + "./type": { + "development": { + "module": "./__dev__/type/index.mjs", + "bun": "./__dev__/type/index.mjs", + "module-sync": "./__dev__/type/index.mjs", + "node": "./__dev__/type/index.js", + "require": "./__dev__/type/index.js", + "default": "./__dev__/type/index.mjs" + }, + "default": { + "module": "./type/index.mjs", + "bun": "./type/index.mjs", + "module-sync": "./type/index.mjs", + "node": "./type/index.js", + "require": "./type/index.js", + "default": "./type/index.mjs" + } + }, + "./utilities": { + "development": { + "module": "./__dev__/utilities/index.mjs", + "bun": "./__dev__/utilities/index.mjs", + "module-sync": "./__dev__/utilities/index.mjs", + "node": "./__dev__/utilities/index.js", + "require": "./__dev__/utilities/index.js", + "default": "./__dev__/utilities/index.mjs" + }, + "default": { + "module": "./utilities/index.mjs", + "bun": "./utilities/index.mjs", + "module-sync": "./utilities/index.mjs", + "node": "./utilities/index.js", + "require": "./utilities/index.js", + "default": "./utilities/index.mjs" + } + }, + "./validation": { + "development": { + "module": "./__dev__/validation/index.mjs", + "bun": "./__dev__/validation/index.mjs", + "module-sync": "./__dev__/validation/index.mjs", + "node": "./__dev__/validation/index.js", + "require": "./__dev__/validation/index.js", + "default": "./__dev__/validation/index.mjs" + }, + "default": { + "module": "./validation/index.mjs", + "bun": "./validation/index.mjs", + "module-sync": "./validation/index.mjs", + "node": "./validation/index.js", + "require": "./validation/index.js", + "default": "./validation/index.mjs" + } + }, + "./*.js": { + "development": { + "module": "./__dev__/*.mjs", + "bun": "./__dev__/*.mjs", + "module-sync": "./__dev__/*.mjs", + "node": "./__dev__/*.js", + "require": "./__dev__/*.js", + "default": "./__dev__/*.mjs" + }, + "default": { + "module": "./*.mjs", + "bun": "./*.mjs", + "module-sync": "./*.mjs", + "node": "./*.js", + "require": "./*.js", + "default": "./*.mjs" + } + }, + "./*": { + "development": { + "module": "./__dev__/*.mjs", + "bun": "./__dev__/*.mjs", + "module-sync": "./__dev__/*.mjs", + "node": "./__dev__/*.js", + "require": "./__dev__/*.js", + "default": "./__dev__/*.mjs" + }, + "default": { + "module": "./*.mjs", + "bun": "./*.mjs", + "module-sync": "./*.mjs", + "node": "./*.js", + "require": "./*.js", + "default": "./*.mjs" + } + } + } +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.mts new file mode 100644 index 00000000..18f01a36 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.mts @@ -0,0 +1,27 @@ +/** @category Names */ +/** + * Upholds the spec rules about naming. + * @param name - The GraphQL name to validate. + * @returns The validated GraphQL name. + * @example + * ```ts + * import { assertName } from 'graphql/type'; + * + * assertName('User'); // => 'User' + * assertName('123User'); // throws an error + * ``` + */ +export declare function assertName(name: string): string; +/** + * Upholds the spec rules about naming enum values. + * @param name - The GraphQL name to validate. + * @returns The validated GraphQL name. + * @example + * ```ts + * import { assertEnumValueName } from 'graphql/type'; + * + * assertEnumValueName('ACTIVE'); // => 'ACTIVE' + * assertEnumValueName('true'); // throws an error + * ``` + */ +export declare function assertEnumValueName(name: string): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.ts new file mode 100644 index 00000000..18f01a36 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.d.ts @@ -0,0 +1,27 @@ +/** @category Names */ +/** + * Upholds the spec rules about naming. + * @param name - The GraphQL name to validate. + * @returns The validated GraphQL name. + * @example + * ```ts + * import { assertName } from 'graphql/type'; + * + * assertName('User'); // => 'User' + * assertName('123User'); // throws an error + * ``` + */ +export declare function assertName(name: string): string; +/** + * Upholds the spec rules about naming enum values. + * @param name - The GraphQL name to validate. + * @returns The validated GraphQL name. + * @example + * ```ts + * import { assertEnumValueName } from 'graphql/type'; + * + * assertEnumValueName('ACTIVE'); // => 'ACTIVE' + * assertEnumValueName('true'); // throws an error + * ``` + */ +export declare function assertEnumValueName(name: string): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js new file mode 100644 index 00000000..be079668 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertName = assertName; +exports.assertEnumValueName = assertEnumValueName; +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const characterClasses_ts_1 = require("../language/characterClasses.js"); +function assertName(name) { + if (name.length === 0) { + throw new GraphQLError_ts_1.GraphQLError('Expected name to be a non-empty string.'); + } + for (let i = 1; i < name.length; ++i) { + if (!(0, characterClasses_ts_1.isNameContinue)(name.charCodeAt(i))) { + throw new GraphQLError_ts_1.GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${name}" does not.`); + } + } + if (!(0, characterClasses_ts_1.isNameStart)(name.charCodeAt(0))) { + throw new GraphQLError_ts_1.GraphQLError(`Names must start with [_a-zA-Z] but "${name}" does not.`); + } + return name; +} +function assertEnumValueName(name) { + if (name === 'true' || name === 'false' || name === 'null') { + throw new GraphQLError_ts_1.GraphQLError(`Enum values cannot be named: ${name}`); + } + return assertName(name); +} +//# sourceMappingURL=assertName.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js.map new file mode 100644 index 00000000..5f3195ea --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assertName.js","sourceRoot":"","sources":["../../src/type/assertName.ts"],"names":[],"mappings":";;AAkBA,gCAoBC;AAcD,kDAKC;AAvDD,8DAAwD;AAExD,yEAA8E;AAc9E,SAAgB,UAAU,CAAC,IAAY;IACrC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,8BAAY,CAAC,yCAAyC,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,IAAA,oCAAc,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,8BAAY,CACpB,6CAA6C,IAAI,aAAa,CAC/D,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,IAAA,iCAAW,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,8BAAY,CACpB,wCAAwC,IAAI,aAAa,CAC1D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAcD,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3D,MAAM,IAAI,8BAAY,CAAC,gCAAgC,IAAI,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/** @category Names */\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport { isNameContinue, isNameStart } from '../language/characterClasses.ts';\n\n/**\n * Upholds the spec rules about naming.\n * @param name - The GraphQL name to validate.\n * @returns The validated GraphQL name.\n * @example\n * ```ts\n * import { assertName } from 'graphql/type';\n *\n * assertName('User'); // => 'User'\n * assertName('123User'); // throws an error\n * ```\n */\nexport function assertName(name: string): string {\n if (name.length === 0) {\n throw new GraphQLError('Expected name to be a non-empty string.');\n }\n\n for (let i = 1; i < name.length; ++i) {\n if (!isNameContinue(name.charCodeAt(i))) {\n throw new GraphQLError(\n `Names must only contain [_a-zA-Z0-9] but \"${name}\" does not.`,\n );\n }\n }\n\n if (!isNameStart(name.charCodeAt(0))) {\n throw new GraphQLError(\n `Names must start with [_a-zA-Z] but \"${name}\" does not.`,\n );\n }\n\n return name;\n}\n\n/**\n * Upholds the spec rules about naming enum values.\n * @param name - The GraphQL name to validate.\n * @returns The validated GraphQL name.\n * @example\n * ```ts\n * import { assertEnumValueName } from 'graphql/type';\n *\n * assertEnumValueName('ACTIVE'); // => 'ACTIVE'\n * assertEnumValueName('true'); // throws an error\n * ```\n */\nexport function assertEnumValueName(name: string): string {\n if (name === 'true' || name === 'false' || name === 'null') {\n throw new GraphQLError(`Enum values cannot be named: ${name}`);\n }\n return assertName(name);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs new file mode 100644 index 00000000..5d8a24ca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs @@ -0,0 +1,23 @@ +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { isNameContinue, isNameStart } from "../language/characterClasses.mjs"; +export function assertName(name) { + if (name.length === 0) { + throw new GraphQLError('Expected name to be a non-empty string.'); + } + for (let i = 1; i < name.length; ++i) { + if (!isNameContinue(name.charCodeAt(i))) { + throw new GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${name}" does not.`); + } + } + if (!isNameStart(name.charCodeAt(0))) { + throw new GraphQLError(`Names must start with [_a-zA-Z] but "${name}" does not.`); + } + return name; +} +export function assertEnumValueName(name) { + if (name === 'true' || name === 'false' || name === 'null') { + throw new GraphQLError(`Enum values cannot be named: ${name}`); + } + return assertName(name); +} +//# sourceMappingURL=assertName.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs.map new file mode 100644 index 00000000..d3193b26 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/assertName.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"assertName.js","sourceRoot":"","sources":["../../src/type/assertName.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAExD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,yCAAwC;AAc9E,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,YAAY,CAAC,yCAAyC,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,YAAY,CACpB,6CAA6C,IAAI,aAAa,CAC/D,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,YAAY,CACpB,wCAAwC,IAAI,aAAa,CAC1D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAcD,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3D,MAAM,IAAI,YAAY,CAAC,gCAAgC,IAAI,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/** @category Names */\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport { isNameContinue, isNameStart } from '../language/characterClasses.ts';\n\n/**\n * Upholds the spec rules about naming.\n * @param name - The GraphQL name to validate.\n * @returns The validated GraphQL name.\n * @example\n * ```ts\n * import { assertName } from 'graphql/type';\n *\n * assertName('User'); // => 'User'\n * assertName('123User'); // throws an error\n * ```\n */\nexport function assertName(name: string): string {\n if (name.length === 0) {\n throw new GraphQLError('Expected name to be a non-empty string.');\n }\n\n for (let i = 1; i < name.length; ++i) {\n if (!isNameContinue(name.charCodeAt(i))) {\n throw new GraphQLError(\n `Names must only contain [_a-zA-Z0-9] but \"${name}\" does not.`,\n );\n }\n }\n\n if (!isNameStart(name.charCodeAt(0))) {\n throw new GraphQLError(\n `Names must start with [_a-zA-Z] but \"${name}\" does not.`,\n );\n }\n\n return name;\n}\n\n/**\n * Upholds the spec rules about naming enum values.\n * @param name - The GraphQL name to validate.\n * @returns The validated GraphQL name.\n * @example\n * ```ts\n * import { assertEnumValueName } from 'graphql/type';\n *\n * assertEnumValueName('ACTIVE'); // => 'ACTIVE'\n * assertEnumValueName('true'); // throws an error\n * ```\n */\nexport function assertEnumValueName(name: string): string {\n if (name === 'true' || name === 'false' || name === 'null') {\n throw new GraphQLError(`Enum values cannot be named: ${name}`);\n }\n return assertName(name);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.mts new file mode 100644 index 00000000..5acd714c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.mts @@ -0,0 +1,4095 @@ +/** @category Types */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { Path } from "../jsutils/Path.mjs"; +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.mjs"; +import type { ConstValueNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, EnumValueDefinitionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationDefinitionNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, UnionTypeDefinitionNode, UnionTypeExtensionNode, ValueNode } from "../language/ast.mjs"; +import type { GraphQLVariableSignature } from "../execution/getVariableSignature.mjs"; +import type { VariableValues } from "../execution/values.mjs"; +import type { GraphQLDirective } from "./directives.mjs"; +import type { GraphQLSchema } from "./schema.mjs"; +/** These are all of the possible kinds of types. */ +export type GraphQLType = GraphQLNamedType | GraphQLWrappingType; +/** + * Returns true when the value is any GraphQL type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is any GraphQL type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLList, GraphQLString, isType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * isType(GraphQLString); // => true + * isType(new GraphQLList(GraphQLString)); // => true + * isType(schema.getType('Query')); // => true + * isType('String'); // => false + * ``` + */ +export declare function isType(type: unknown): type is GraphQLType; +/** + * Returns the value as a GraphQL type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const queryType = assertType(schema.getType('Query')); + * + * queryType.toString(); // => 'Query' + * assertType('Query'); // throws an error + * ``` + */ +export declare function assertType(type: unknown): GraphQLType; +/** + * There are predicates for each kind of GraphQL type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLScalarType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isScalarType } from 'graphql/type'; + * + * const schema = buildSchema(` + * scalar DateTime + * + * type Query { + * createdAt: DateTime + * } + * `); + * + * isScalarType(schema.getType('DateTime')); // => true + * isScalarType(schema.getType('Query')); // => false + * ``` + */ +export declare function isScalarType(type: unknown): type is GraphQLScalarType; +/** + * Returns the value as a GraphQLScalarType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLScalarType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertScalarType } from 'graphql/type'; + * + * const schema = buildSchema(` + * scalar DateTime + * + * type Query { + * createdAt: DateTime + * } + * `); + * + * const dateTimeType = assertScalarType(schema.getType('DateTime')); + * + * dateTimeType.name; // => 'DateTime' + * assertScalarType(schema.getType('Query')); // throws an error + * ``` + */ +export declare function assertScalarType(type: unknown): GraphQLScalarType; +/** + * Returns true when the value is a GraphQLObjectType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type User { + * name: String + * } + * + * type Query { + * user: User + * } + * `); + * + * isObjectType(schema.getType('User')); // => true + * isObjectType(schema.getType('ReviewInput')); // => false + * ``` + */ +export declare function isObjectType(type: unknown): type is GraphQLObjectType; +/** + * Returns the value as a GraphQLObjectType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type User { + * name: String + * } + * + * type Query { + * user: User + * } + * `); + * + * const userType = assertObjectType(schema.getType('User')); + * + * Object.keys(userType.getFields()); // => ['name'] + * assertObjectType(schema.getType('ReviewInput')); // throws an error + * ``` + */ +export declare function assertObjectType(type: unknown): GraphQLObjectType; +/** + * Returns true when the value is a resolved GraphQL field definition. + * @param field - Value to inspect. + * @returns True when the value is a GraphQLField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isField } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const field = schema.getQueryType().getFields().greeting; + * + * isField(field); // => true + * isField(schema.getQueryType()); // => false + * ``` + */ +export declare function isField(field: unknown): field is GraphQLField; +/** + * Returns the value as a GraphQLField, or throws if it is not one. + * @param field - Value to inspect. + * @returns The value typed as a GraphQLField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertField } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const field = assertField(schema.getQueryType().getFields().greeting); + * + * field.name; // => 'greeting' + * assertField(schema.getQueryType()); // throws an error + * ``` + */ +export declare function assertField(field: unknown): GraphQLField; +/** + * Returns true when the value is a resolved GraphQL argument definition. + * @param arg - Value to inspect. + * @returns True when the value is a GraphQLArgument. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isArgument } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting(name: String): String }'); + * const arg = schema.getQueryType().getFields().greeting.args[0]; + * + * isArgument(arg); // => true + * isArgument(schema.getQueryType()); // => false + * ``` + */ +export declare function isArgument(arg: unknown): arg is GraphQLArgument; +/** + * Returns the value as a GraphQLArgument, or throws if it is not one. + * @param arg - Value to inspect. + * @returns The value typed as a GraphQLArgument. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertArgument } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting(name: String): String }'); + * const arg = assertArgument(schema.getQueryType().getFields().greeting.args[0]); + * + * arg.name; // => 'name' + * assertArgument(schema.getQueryType()); // throws an error + * ``` + */ +export declare function assertArgument(arg: unknown): GraphQLArgument; +/** + * Returns true when the value is a GraphQLInterfaceType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLInterfaceType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * isInterfaceType(schema.getType('Node')); // => true + * isInterfaceType(schema.getType('User')); // => false + * ``` + */ +export declare function isInterfaceType(type: unknown): type is GraphQLInterfaceType; +/** + * Returns the value as a GraphQLInterfaceType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLInterfaceType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const nodeType = assertInterfaceType(schema.getType('Node')); + * + * nodeType.name; // => 'Node' + * assertInterfaceType(schema.getType('User')); // throws an error + * ``` + */ +export declare function assertInterfaceType(type: unknown): GraphQLInterfaceType; +/** + * Returns true when the value is a GraphQLUnionType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLUnionType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * + * type Query { + * media: [Media] + * } + * `); + * + * isUnionType(schema.getType('Media')); // => true + * isUnionType(schema.getType('Photo')); // => false + * ``` + */ +export declare function isUnionType(type: unknown): type is GraphQLUnionType; +/** + * Returns the value as a GraphQLUnionType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLUnionType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * + * type Query { + * media: [Media] + * } + * `); + * + * const mediaType = assertUnionType(schema.getType('Media')); + * + * mediaType.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * assertUnionType(schema.getType('Photo')); // throws an error + * ``` + */ +export declare function assertUnionType(type: unknown): GraphQLUnionType; +/** + * Returns true when the value is a GraphQLEnumType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLEnumType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * favoriteEpisode: Episode + * } + * `); + * + * isEnumType(schema.getType('Episode')); // => true + * isEnumType(schema.getType('Query')); // => false + * ``` + */ +export declare function isEnumType(type: unknown): type is GraphQLEnumType; +/** + * Returns the value as a GraphQLEnumType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLEnumType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * favoriteEpisode: Episode + * } + * `); + * + * const episodeType = assertEnumType(schema.getType('Episode')); + * + * episodeType.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE'] + * assertEnumType(schema.getType('Query')); // throws an error + * ``` + */ +export declare function assertEnumType(type: unknown): GraphQLEnumType; +/** + * Returns true when the value is a resolved GraphQL enum value definition. + * @param value - Value to inspect. + * @returns True when the value is a GraphQLEnumValue. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType, isEnumValue } from 'graphql/type'; + * + * const schema = buildSchema( + * 'enum Episode { NEW_HOPE } type Query { episode: Episode }', + * ); + * const enumValue = assertEnumType(schema.getType('Episode')).getValues()[0]; + * + * isEnumValue(enumValue); // => true + * isEnumValue(schema.getType('Episode')); // => false + * ``` + */ +export declare function isEnumValue(value: unknown): value is GraphQLEnumValue; +/** + * Returns the value as a GraphQLEnumValue, or throws if it is not one. + * @param value - Value to inspect. + * @returns The value typed as a GraphQLEnumValue. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType, assertEnumValue } from 'graphql/type'; + * + * const schema = buildSchema( + * 'enum Episode { NEW_HOPE } type Query { episode: Episode }', + * ); + * const enumValue = assertEnumValue( + * assertEnumType(schema.getType('Episode')).getValues()[0], + * ); + * + * enumValue.name; // => 'NEW_HOPE' + * assertEnumValue(schema.getType('Episode')); // throws an error + * ``` + */ +export declare function assertEnumValue(value: unknown): GraphQLEnumValue; +/** + * Returns true when the value is a GraphQLInputObjectType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLInputObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * isInputObjectType(schema.getType('ReviewInput')); // => true + * isInputObjectType(schema.getType('Review')); // => false + * ``` + */ +export declare function isInputObjectType(type: unknown): type is GraphQLInputObjectType; +/** + * Returns the value as a GraphQLInputObjectType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLInputObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * const inputType = assertInputObjectType(schema.getType('ReviewInput')); + * + * Object.keys(inputType.getFields()); // => ['stars'] + * assertInputObjectType(schema.getType('Review')); // throws an error + * ``` + */ +export declare function assertInputObjectType(type: unknown): GraphQLInputObjectType; +/** + * Returns true when the value is a resolved GraphQL input field definition. + * @param field - Value to inspect. + * @returns True when the value is a GraphQLInputField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType, isInputField } from 'graphql/type'; + * + * const schema = buildSchema( + * 'input ReviewInput { stars: Int } type Query { ok: Boolean }', + * ); + * const inputField = assertInputObjectType( + * schema.getType('ReviewInput'), + * ).getFields().stars; + * + * isInputField(inputField); // => true + * isInputField(schema.getQueryType()); // => false + * ``` + */ +export declare function isInputField(field: unknown): field is GraphQLInputField; +/** + * Returns the value as a GraphQLInputField, or throws if it is not one. + * @param field - Value to inspect. + * @returns The value typed as a GraphQLInputField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputField, assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema( + * 'input ReviewInput { stars: Int } type Query { ok: Boolean }', + * ); + * const inputField = assertInputField( + * assertInputObjectType(schema.getType('ReviewInput')).getFields().stars, + * ); + * + * inputField.name; // => 'stars' + * assertInputField(schema.getQueryType()); // throws an error + * ``` + */ +export declare function assertInputField(field: unknown): GraphQLInputField; +/** + * Returns true when the value is a GraphQLList. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLList. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLList, GraphQLString, isListType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * tags: [String!]! + * } + * `); + * + * const tagsField = schema.getQueryType()?.getFields().tags; + * + * isListType(new GraphQLList(GraphQLString)); // => true + * isListType(GraphQLString); // => false + * isListType(tagsField?.type); // => false + * ``` + */ +export declare function isListType(type: GraphQLInputType): type is GraphQLList; +/** + * Returns true when the output type is a GraphQLList. + * @param type - The GraphQL output type to inspect. + * @returns True when the output type is a list type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { getNullableType, isListType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * tags: [String!]! + * } + * `); + * + * const tagsField = schema.getQueryType()?.getFields().tags; + * const nullableTagsType = getNullableType(tagsField?.type); + * + * isListType(nullableTagsType); // => true + * ``` + */ +export declare function isListType(type: GraphQLOutputType): type is GraphQLList; +/** + * Returns true when the value is a GraphQLList. + * @param type - The value to inspect. + * @returns True when the value is a list type. + * @example + * ```ts + * import { isListType } from 'graphql/type'; + * + * isListType('[String]'); // => false + * isListType(null); // => false + * ``` + */ +export declare function isListType(type: unknown): type is GraphQLList; +/** + * Returns the value as a GraphQLList, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLList. + * @example + * ```ts + * import { GraphQLList, GraphQLString, assertListType } from 'graphql/type'; + * + * const listType = assertListType(new GraphQLList(GraphQLString)); + * + * listType.ofType; // => GraphQLString + * assertListType(GraphQLString); // throws an error + * ``` + */ +export declare function assertListType(type: unknown): GraphQLList; +/** + * Returns true when the value is a GraphQLNonNull. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLNonNull. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLNonNull, GraphQLString, isNonNullType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String! + * nickname: String + * } + * `); + * + * const fields = schema.getQueryType()?.getFields(); + * + * isNonNullType(new GraphQLNonNull(GraphQLString)); // => true + * isNonNullType(fields?.name.type); // => true + * isNonNullType(fields?.nickname.type); // => false + * ``` + */ +export declare function isNonNullType(type: GraphQLInputType): type is GraphQLNonNull; +/** + * Returns true when the output type is a GraphQLNonNull. + * @param type - The GraphQL output type to inspect. + * @returns True when the output type is a non-null type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isNonNullType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String! + * nickname: String + * } + * `); + * + * const fields = schema.getQueryType()?.getFields(); + * + * isNonNullType(fields?.name.type); // => true + * isNonNullType(fields?.nickname.type); // => false + * ``` + */ +export declare function isNonNullType(type: GraphQLOutputType): type is GraphQLNonNull; +/** + * Returns true when the value is a GraphQLNonNull. + * @param type - The value to inspect. + * @returns True when the value is a non-null type. + * @example + * ```ts + * import { isNonNullType } from 'graphql/type'; + * + * isNonNullType('String!'); // => false + * isNonNullType(null); // => false + * ``` + */ +export declare function isNonNullType(type: unknown): type is GraphQLNonNull; +/** + * Returns the value as a GraphQLNonNull, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLNonNull. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString, assertNonNullType } from 'graphql/type'; + * + * const nonNullType = assertNonNullType(new GraphQLNonNull(GraphQLString)); + * + * nonNullType.ofType; // => GraphQLString + * assertNonNullType(GraphQLString); // throws an error + * ``` + */ +export declare function assertNonNullType(type: unknown): GraphQLNonNull; +/** These types may be used as input types for arguments and directives. */ +export type GraphQLNullableInputType = GraphQLNamedInputType | GraphQLList; +/** These types may be used as input types for arguments and directives. */ +export type GraphQLInputType = GraphQLNullableInputType | GraphQLNonNull; +/** + * Returns true when the value can be used as a GraphQL input type. + * @param type - The GraphQL type to inspect. + * @returns True when the value can be used as a GraphQL input type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isInputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * isInputType(schema.getType('ReviewInput')); // => true + * isInputType(schema.getType('Review')); // => false + * ``` + */ +export declare function isInputType(type: unknown): type is GraphQLInputType; +/** + * Returns the value as a GraphQL input type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL input type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * const inputType = assertInputType(schema.getType('ReviewInput')); + * + * inputType.toString(); // => 'ReviewInput' + * assertInputType(schema.getType('Review')); // throws an error + * ``` + */ +export declare function assertInputType(type: unknown): GraphQLInputType; +/** These types may be used as output types as the result of fields. */ +export type GraphQLNullableOutputType = GraphQLNamedOutputType | GraphQLList; +/** These types may be used as output types as the result of fields. */ +export type GraphQLOutputType = GraphQLNullableOutputType | GraphQLNonNull; +/** + * Returns true when the value can be used as a GraphQL output type. + * @param type - The GraphQL type to inspect. + * @returns True when the value can be used as a GraphQL output type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isOutputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * isOutputType(schema.getType('Review')); // => true + * isOutputType(schema.getType('ReviewInput')); // => false + * ``` + */ +export declare function isOutputType(type: unknown): type is GraphQLOutputType; +/** + * Returns the value as a GraphQL output type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL output type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertOutputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * const outputType = assertOutputType(schema.getType('Review')); + * + * outputType.toString(); // => 'Review' + * assertOutputType(schema.getType('ReviewInput')); // throws an error + * ``` + */ +export declare function assertOutputType(type: unknown): GraphQLOutputType; +/** These types may describe types which may be leaf values. */ +export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; +/** + * Returns true when the value is a GraphQL scalar or enum type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL scalar or enum type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isLeafType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * episode: Episode + * review: Review + * } + * `); + * + * isLeafType(schema.getType('Episode')); // => true + * isLeafType(schema.getType('String')); // => true + * isLeafType(schema.getType('Review')); // => false + * ``` + */ +export declare function isLeafType(type: unknown): type is GraphQLLeafType; +/** + * Returns the value as a GraphQL leaf type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL leaf type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertLeafType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * episode: Episode + * review: Review + * } + * `); + * + * const episodeType = assertLeafType(schema.getType('Episode')); + * + * episodeType.toString(); // => 'Episode' + * assertLeafType(schema.getType('Review')); // throws an error + * ``` + */ +export declare function assertLeafType(type: unknown): GraphQLLeafType; +/** These types may describe the parent context of a selection set. */ +export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; +/** + * Returns true when the value is a GraphQL object, interface, or union type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL object, interface, or union type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isCompositeType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * union SearchResult = User + * + * type Query { + * node: Node + * search: [SearchResult] + * } + * `); + * + * isCompositeType(schema.getType('User')); // => true + * isCompositeType(schema.getType('Node')); // => true + * isCompositeType(schema.getType('SearchResult')); // => true + * isCompositeType(schema.getType('String')); // => false + * ``` + */ +export declare function isCompositeType(type: unknown): type is GraphQLCompositeType; +/** + * Returns the value as a GraphQL composite type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL composite type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertCompositeType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const userType = assertCompositeType(schema.getType('User')); + * + * userType.toString(); // => 'User' + * assertCompositeType(schema.getType('String')); // throws an error + * ``` + */ +export declare function assertCompositeType(type: unknown): GraphQLCompositeType; +/** These types may describe the parent context of a selection set. */ +export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; +/** + * Returns true when the value is a GraphQL interface or union type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL interface or union type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isAbstractType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * union SearchResult = User + * + * type Query { + * node: Node + * search: [SearchResult] + * } + * `); + * + * isAbstractType(schema.getType('Node')); // => true + * isAbstractType(schema.getType('SearchResult')); // => true + * isAbstractType(schema.getType('User')); // => false + * ``` + */ +export declare function isAbstractType(type: unknown): type is GraphQLAbstractType; +/** + * Returns the value as a GraphQL abstract type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL abstract type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertAbstractType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const nodeType = assertAbstractType(schema.getType('Node')); + * + * nodeType.toString(); // => 'Node' + * assertAbstractType(schema.getType('User')); // throws an error + * ``` + */ +export declare function assertAbstractType(type: unknown): GraphQLAbstractType; +/** + * List Type Wrapper + * + * A list is a wrapping type which points to another type. + * Lists are often created within the context of defining the fields of + * an object type. + * @typeParam T - The GraphQL type wrapped by this list type. + * @example + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: new GraphQLList(PersonType) }, + * children: { type: new GraphQLList(PersonType) }, + * }), + * }); + * ``` + */ +export declare class GraphQLList implements GraphQLSchemaElement { + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; + private readonly __GraphQLListTypeBrand; + /** + * Creates a GraphQLList instance. + * @param ofType - The type to wrap. + * @example + * ```ts + * import { GraphQLList, GraphQLString } from 'graphql/type'; + * + * const stringList = new GraphQLList(GraphQLString); + * + * stringList.ofType; // => GraphQLString + * String(stringList); // => '[String]' + * ``` + */ + constructor(ofType: T); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns this wrapping type as a GraphQL type-reference string. + * @returns The GraphQL type-reference string. + * @example + * ```ts + * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const stringList = new GraphQLList(GraphQLString); + * const requiredStringList = new GraphQLList(new GraphQLNonNull(GraphQLString)); + * + * stringList.toString(); // => '[String]' + * requiredStringList.toString(); // => '[String!]' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLList, GraphQLString } from 'graphql/type'; + * + * const stringList = new GraphQLList(GraphQLString); + * + * stringList.toJSON(); // => '[String]' + * JSON.stringify({ type: stringList }); // => '{"type":"[String]"}' + * ``` + */ + toJSON(): string; +} +/** + * Non-Null Type Wrapper + * + * A non-null is a wrapping type which points to another type. + * Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * @typeParam T - The nullable GraphQL type wrapped by this non-null type. + * @example + * ```ts + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: new GraphQLNonNull(GraphQLString) }, + * }), + * }); + * ``` + * + * Note: the enforcement of non-nullability occurs within the executor. + */ +export declare class GraphQLNonNull implements GraphQLSchemaElement { + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; + private readonly __GraphQLNonNullTypeBrand; + /** + * Creates a GraphQLNonNull instance. + * @param ofType - The type to wrap. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * + * requiredString.ofType; // => GraphQLString + * String(requiredString); // => 'String!' + * ``` + */ + constructor(ofType: T); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns this wrapping type as a GraphQL type-reference string. + * @returns The GraphQL type-reference string. + * @example + * ```ts + * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString)); + * + * requiredString.toString(); // => 'String!' + * requiredStringList.toString(); // => '[String]!' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * + * requiredString.toJSON(); // => 'String!' + * JSON.stringify({ type: requiredString }); // => '{"type":"String!"}' + * ``` + */ + toJSON(): string; +} +/** These types wrap and modify other types */ +export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; +/** + * Returns true when the value is a GraphQL list or non-null wrapper type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL list or non-null wrapper type. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * isWrappingType, + * } from 'graphql/type'; + * + * isWrappingType(new GraphQLList(GraphQLString)); // => true + * isWrappingType(new GraphQLNonNull(GraphQLString)); // => true + * isWrappingType(GraphQLString); // => false + * ``` + */ +export declare function isWrappingType(type: unknown): type is GraphQLWrappingType; +/** + * Returns the value as a GraphQL wrapping type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL wrapping type. + * @example + * ```ts + * import { GraphQLList, GraphQLString, assertWrappingType } from 'graphql/type'; + * + * const wrappingType = assertWrappingType(new GraphQLList(GraphQLString)); + * + * wrappingType.toString(); // => '[String]' + * assertWrappingType(GraphQLString); // throws an error + * ``` + */ +export declare function assertWrappingType(type: unknown): GraphQLWrappingType; +/** These types can all accept null as a value. */ +export type GraphQLNullableType = GraphQLNamedType | GraphQLList; +/** + * Returns true when the value is a GraphQL type that can accept null. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL type that can accept null. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString, isNullableType } from 'graphql/type'; + * + * isNullableType(GraphQLString); // => true + * isNullableType(new GraphQLNonNull(GraphQLString)); // => false + * isNullableType(null); // => false + * ``` + */ +export declare function isNullableType(type: unknown): type is GraphQLNullableType; +/** + * Returns the value as a nullable GraphQL type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a nullable GraphQL type. + * @example + * ```ts + * import { + * GraphQLNonNull, + * GraphQLString, + * assertNullableType, + * } from 'graphql/type'; + * + * const nullableType = assertNullableType(GraphQLString); + * + * nullableType; // => GraphQLString + * assertNullableType(new GraphQLNonNull(GraphQLString)); // throws an error + * ``` + */ +export declare function assertNullableType(type: unknown): GraphQLNullableType; +/** + * Returns the nullable type. + * @param type - The GraphQL type to inspect. + * @returns The nullable type after removing one non-null wrapper, if present. + * @example + * ```ts + * import { getNullableType } from 'graphql/type'; + * + * getNullableType(null); // => undefined + * getNullableType(undefined); // => undefined + * ``` + */ +export declare function getNullableType(type: undefined | null): void; +/** + * Returns the nullable type after removing one non-null wrapper. + * @param type - A nullable type or non-null wrapper. + * @returns The nullable type after removing one non-null wrapper, if present. + * @typeParam T - The nullable GraphQL type returned after removing one non-null wrapper. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * getNullableType, + * } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * const stringList = new GraphQLList(GraphQLString); + * + * getNullableType(requiredString); // => GraphQLString + * getNullableType(stringList); // => stringList + * ``` + */ +export declare function getNullableType(type: T | GraphQLNonNull): T; +/** + * Returns the nullable type after removing one non-null wrapper. + * @param type - The GraphQL type to inspect. + * @returns The nullable type after removing one non-null wrapper, if present. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * getNullableType, + * } from 'graphql/type'; + * + * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString)); + * + * getNullableType(requiredStringList).toString(); // => '[String]' + * getNullableType(GraphQLString); // => GraphQLString + * ``` + */ +export declare function getNullableType(type: Maybe): GraphQLNullableType | undefined; +/** These named types do not include modifiers like List or NonNull. */ +export type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType; +/** A named GraphQL type that can be used as an input type. */ +export type GraphQLNamedInputType = GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType; +/** A named GraphQL type that can be used as an output type. */ +export type GraphQLNamedOutputType = GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType; +/** + * Returns true when the value is a GraphQL named type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL named type. + * @example + * ```ts + * import { GraphQLList, GraphQLString, isNamedType } from 'graphql/type'; + * + * isNamedType(GraphQLString); // => true + * isNamedType(new GraphQLList(GraphQLString)); // => false + * isNamedType(null); // => false + * ``` + */ +export declare function isNamedType(type: unknown): type is GraphQLNamedType; +/** + * Returns the value as a GraphQL named type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL named type. + * @example + * ```ts + * import { GraphQLList, GraphQLString, assertNamedType } from 'graphql/type'; + * + * const namedType = assertNamedType(GraphQLString); + * + * namedType.name; // => 'String' + * assertNamedType(new GraphQLList(GraphQLString)); // throws an error + * ``` + */ +export declare function assertNamedType(type: unknown): GraphQLNamedType; +/** + * Returns the named type. + * @param type - The GraphQL type to inspect. + * @returns The named type after unwrapping all list and non-null wrappers. + * @example + * ```ts + * import { getNamedType } from 'graphql/type'; + * + * getNamedType(null); // => undefined + * getNamedType(undefined); // => undefined + * ``` + */ +export declare function getNamedType(type: undefined | null): void; +/** + * Returns the named input type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL input type to inspect. + * @returns The named input type after unwrapping all wrappers. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { getNamedType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Query { + * review(input: [ReviewInput!]!): Boolean + * } + * `); + * + * const inputArg = schema.getQueryType()?.getFields().review.args[0]; + * + * getNamedType(inputArg?.type).toString(); // => 'ReviewInput' + * ``` + */ +export declare function getNamedType(type: GraphQLInputType): GraphQLNamedInputType; +/** + * Returns the named output type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL output type to inspect. + * @returns The named output type after unwrapping all wrappers. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { getNamedType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * users: [User!]! + * } + * `); + * + * const usersField = schema.getQueryType()?.getFields().users; + * + * getNamedType(usersField?.type).toString(); // => 'User' + * ``` + */ +export declare function getNamedType(type: GraphQLOutputType): GraphQLNamedOutputType; +/** + * Returns the named type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL type to inspect. + * @returns The named type after unwrapping all wrappers. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * getNamedType, + * } from 'graphql/type'; + * + * const nestedType = new GraphQLNonNull( + * new GraphQLList(new GraphQLNonNull(GraphQLString)), + * ); + * + * getNamedType(nestedType); // => GraphQLString + * ``` + */ +export declare function getNamedType(type: GraphQLType): GraphQLNamedType; +/** + * Returns the named type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL type to inspect. + * @returns The named type after unwrapping all wrappers, or undefined for nullish input. + * @example + * ```ts + * import { GraphQLList, GraphQLString, getNamedType } from 'graphql/type'; + * + * getNamedType(new GraphQLList(GraphQLString)); // => GraphQLString + * getNamedType(undefined); // => undefined + * ``` + */ +export declare function getNamedType(type: Maybe): GraphQLNamedType | undefined; +/** + * An interface for all Schema Elements. + * + * @internal + */ +export interface GraphQLSchemaElement { + toString: () => string; + toJSON: () => string; +} +/** + * Used while defining GraphQL types to allow for circular references in + * otherwise immutable type definitions. + * @typeParam T - The element type returned by the thunk or array. + */ +export type ThunkReadonlyArray = (() => ReadonlyArray) | ReadonlyArray; +/** + * A thunk that resolves to an object map. + * @typeParam T - Value type stored in the object map. + */ +export type ThunkObjMap = (() => ObjMap) | ObjMap; +/** + * Resolves a thunked readonly array. + * @param thunk - The thunk or value to resolve. + * @returns The resolved readonly array. + * @typeParam T - The element type resolved from the thunk or array. + * @example + * ```ts + * import { GraphQLString, resolveReadonlyArrayThunk } from 'graphql/type'; + * + * const lazyFields = resolveReadonlyArrayThunk(() => [GraphQLString]); + * const fields = resolveReadonlyArrayThunk([GraphQLString]); + * + * lazyFields; // => [GraphQLString] + * fields; // => [GraphQLString] + * ``` + */ +export declare function resolveReadonlyArrayThunk(thunk: ThunkReadonlyArray): ReadonlyArray; +/** + * Resolves a thunked object map. + * @param thunk - The thunk or value to resolve. + * @returns The resolved object map. + * @typeParam T - The object-map value type resolved from the thunk or map. + * @example + * ```ts + * import { GraphQLString, resolveObjMapThunk } from 'graphql/type'; + * + * const lazyFields = resolveObjMapThunk(() => ({ name: GraphQLString })); + * const fields = resolveObjMapThunk({ name: GraphQLString }); + * + * lazyFields.name; // => GraphQLString + * fields.name; // => GraphQLString + * ``` + */ +export declare function resolveObjMapThunk(thunk: ThunkObjMap): ObjMap; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLScalarTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Scalar Type Definition + * + * Scalar types define the leaf values of a GraphQL response and the input + * values accepted by arguments and input object fields. A scalar type has a + * name and coercion functions that validate and convert runtime values and + * GraphQL literals. + * + * If a type's coerceOutputValue function returns `null` or does not return a + * value (i.e. it returns `undefined`) then an error will be raised and a + * `null` value will be returned in the response. Prefer validating inputs + * before execution so clients receive input diagnostics before result coercion + * fails. + * Custom scalar behavior is defined via the following functions: + * + * - coerceOutputValue(value): Implements "Result Coercion". Given an internal value, + * produces an external value valid for this type. Returns undefined or + * throws an error to indicate invalid values. + * + * - coerceInputValue(value): Implements "Input Coercion" for values. Given an + * external value (for example, variable values), produces an internal value + * valid for this type. Returns undefined or throws an error to indicate + * invalid values. + * + * - coerceInputLiteral(ast): Implements "Input Coercion" for constant literals. + * Given a GraphQL literal (AST) (for example, an argument value), produces + * an internal value valid for this type. Returns undefined or throws an + * error to indicate invalid values. + * + * - valueToLiteral(value): Converts an external value to a GraphQL + * literal (AST). Returns undefined or throws an error to indicate + * invalid values. + * + * Deprecated, to be removed in v18: + * + * - serialize(value): Implements "Result Coercion". Renamed to + * `coerceOutputValue()`. + * + * - parseValue(value): Implements "Input Coercion" for values. Renamed to + * `coerceInputValue()`. + * + * - parseLiteral(ast): Implements "Input Coercion" for literals including + * non-specified replacement of variables embedded within complex scalars. + * Replaced by the combination of the `replaceVariables()` utility and the + * `coerceInputLiteral()` method. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @typeParam TExternal - External representation accepted from or returned to callers. + * @example + * ```ts + * import { GraphQLScalarType, Kind } from 'graphql'; + * + * const ensureOdd = (value) => { + * if (!Number.isFinite(value)) { + * throw new Error( + * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`, + * ); + * } + * + * if (value % 2 === 0) { + * throw new Error( + * `Scalar "Odd" cannot represent "${value}" since it is even.`, + * ); + * } + * + * return value; + * }; + * + * const OddType = new GraphQLScalarType({ + * name: 'Odd', + * coerceOutputValue: (value) => { + * return ensureOdd(value); + * }, + * coerceInputValue: (value) => { + * return ensureOdd(value); + * }, + * valueToLiteral: (value) => { + * return { kind: Kind.INT, value: String(ensureOdd(value)) }; + * }, + * }); + * ``` + */ +export declare class GraphQLScalarType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** URL identifying the behavior specified for this custom scalar. */ + specifiedByURL: Maybe; + /** + * Deprecated legacy serializer used to convert internal values for response + * output. Use `coerceOutputValue()` instead. + * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 + */ + serialize: GraphQLScalarSerializer; + /** + * Deprecated legacy parser used to convert externally provided input values. + * Use `coerceInputValue()` instead. + * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 + */ + parseValue: GraphQLScalarValueParser; + /** + * Deprecated legacy parser used to convert externally provided input + * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead. + * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 + */ + parseLiteral: GraphQLScalarLiteralParser; + /** Coercer used to convert internal scalar values for response output. */ + coerceOutputValue: GraphQLScalarOutputValueCoercer; + /** Coercer used to convert externally provided scalar input values. */ + coerceInputValue: GraphQLScalarInputValueCoercer; + /** Coercer used to convert GraphQL scalar input literals. */ + coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined; + /** Converter used to produce GraphQL literals from runtime input values. */ + valueToLiteral: GraphQLScalarValueToLiteral | undefined; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** + * Creates a GraphQLScalarType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { Kind, parse } from 'graphql/language'; + * import { GraphQLScalarType } from 'graphql/type'; + * + * const document = parse(` + * "Odd integer values." + * scalar Odd @specifiedBy(url: "https://example.com/odd") + * + * extend scalar Odd @specifiedBy(url: "https://example.com/odd-v2") + * `); + * + * const Odd = new GraphQLScalarType({ + * name: 'Odd', + * description: 'Odd integer values.', + * specifiedByURL: 'https://example.com/odd', + * coerceOutputValue: (value) => { + * if (typeof value !== 'number' || value % 2 === 0) { + * throw new TypeError('Odd can only produce odd numbers.'); + * } + * return value; + * }, + * coerceInputValue: (value) => { + * if (typeof value !== 'number' || value % 2 === 0) { + * throw new TypeError('Odd can only accept odd numbers.'); + * } + * return value; + * }, + * coerceInputLiteral: (ast) => { + * if (ast.kind !== Kind.INT) { + * throw new TypeError('Odd can only accept integer literals.'); + * } + * const value = Number(ast.value); + * if (value % 2 === 0) { + * throw new TypeError('Odd can only accept odd integer literals.'); + * } + * return value; + * }, + * valueToLiteral: (value) => { + * return { kind: Kind.INT, value: String(ensureOdd(value)) }; + * }, + * extensions: { numeric: true }, + * astNode: document.definitions[0], + * extensionASTNodes: [document.definitions[1]], + * }); + * + * Odd.description; // => 'Odd integer values.' + * Odd.specifiedByURL; // => 'https://example.com/odd' + * Odd.coerceOutputValue(3); // => 3 + * Odd.coerceInputValue(5); // => 5 + * Odd.extensions; // => { numeric: true } + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLScalarType } from 'graphql/type'; + * + * const Url = new GraphQLScalarType({ + * name: 'Url', + * description: 'An absolute URL string.', + * specifiedByURL: 'https://url.spec.whatwg.org/', + * }); + * + * const config = Url.toConfig(); + * const UrlCopy = new GraphQLScalarType(config); + * + * config.name; // => 'Url' + * config.specifiedByURL; // => 'https://url.spec.whatwg.org/' + * UrlCopy.name; // => Url.name + * ``` + */ + toConfig(): GraphQLScalarTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this scalar type. + * @returns The schema coordinate for this scalar type. + * @example + * ```ts + * import { GraphQLScalarType } from 'graphql/type'; + * + * const DateTime = new GraphQLScalarType({ name: 'DateTime' }); + * + * DateTime.toString(); // => 'DateTime' + * String(DateTime); // => 'DateTime' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLScalarType } from 'graphql/type'; + * + * const DateTime = new GraphQLScalarType({ name: 'DateTime' }); + * + * DateTime.toJSON(); // => 'DateTime' + * JSON.stringify({ type: DateTime }); // => '{"type":"DateTime"}' + * ``` + */ + toJSON(): string; +} +/** + * Deprecated function type that serializes a runtime value as a scalar output + * value. Use `GraphQLScalarOutputValueCoercer` instead. + * @typeParam TExternal - External representation accepted from or returned to callers. + * @deprecated Use GraphQLScalarOutputValueCoercer instead. Will be removed in v18. + */ +export type GraphQLScalarSerializer = (outputValue: unknown) => TExternal; +/** + * Function used to coerce internal scalar values for response output. + * @typeParam TExternal - External representation accepted from or returned to callers. + */ +export type GraphQLScalarOutputValueCoercer = (outputValue: unknown) => TExternal; +/** + * Deprecated function type that parses a runtime input value as a scalar input + * value. Use `GraphQLScalarInputValueCoercer` instead. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @deprecated Use GraphQLScalarInputValueCoercer instead. Will be removed in v18. + */ +export type GraphQLScalarValueParser = (inputValue: unknown) => TInternal; +/** + * Function used to coerce externally provided scalar input values. + * @typeParam TInternal - Internal runtime representation for this scalar. + */ +export type GraphQLScalarInputValueCoercer = (inputValue: unknown) => TInternal; +/** + * Deprecated function type that parses a GraphQL value literal as a scalar + * input value. Use `GraphQLScalarInputLiteralCoercer` instead. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @deprecated Use GraphQLScalarInputLiteralCoercer instead. Will be removed in v18. + */ +export type GraphQLScalarLiteralParser = (valueNode: ValueNode, variables: Maybe>) => Maybe; +/** + * Function used to coerce GraphQL scalar input literals. + * @typeParam TInternal - Internal runtime representation for this scalar. + */ +export type GraphQLScalarInputLiteralCoercer = (valueNode: ConstValueNode) => Maybe; +/** @internal */ +export type GraphQLScalarValueToLiteral = (inputValue: unknown) => ConstValueNode | undefined; +/** + * Configuration used to construct a GraphQLScalarType. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @typeParam TExternal - External representation accepted from or returned to callers. + */ +export interface GraphQLScalarTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** URL identifying the behavior specified for this custom scalar. */ + specifiedByURL?: Maybe; + /** + * Deprecated legacy serializer used to convert internal values for response + * output. Use `coerceOutputValue()` instead. + * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 + */ + serialize?: GraphQLScalarSerializer | undefined; + /** + * Deprecated legacy parser used to convert externally provided input values. + * Use `coerceInputValue()` instead. + * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 + */ + parseValue?: GraphQLScalarValueParser | undefined; + /** + * Deprecated legacy parser used to convert externally provided input + * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead. + * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 + */ + parseLiteral?: GraphQLScalarLiteralParser | undefined; + /** Coerces an internal value to include in a response. */ + coerceOutputValue?: GraphQLScalarOutputValueCoercer | undefined; + /** Coerces an externally provided value to use as an input. */ + coerceInputValue?: GraphQLScalarInputValueCoercer | undefined; + /** Coerces an externally provided const literal value to use as an input. */ + coerceInputLiteral?: GraphQLScalarInputLiteralCoercer | undefined; + /** Translates an externally provided value to a literal (AST). */ + valueToLiteral?: GraphQLScalarValueToLiteral | undefined; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLScalarTypeNormalizedConfig extends GraphQLScalarTypeConfig { + serialize: GraphQLScalarSerializer; + parseValue: GraphQLScalarValueParser; + parseLiteral: GraphQLScalarLiteralParser; + coerceOutputValue: GraphQLScalarOutputValueCoercer; + coerceInputValue: GraphQLScalarInputValueCoercer; + coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + * We've provided these template arguments because this is an open type and + * you may find them useful. + * @typeParam _TSource - Reserved source type parameter for extension typing. + * @typeParam _TContext - Reserved context type parameter for extension typing. + */ +export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> { + [attributeName: string | symbol]: unknown; +} +/** + * Object Type Definition + * + * Almost all of the GraphQL types you define will be object types. Object types + * have a name, but most importantly describe their fields. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TAbstract - Runtime value type used for abstract type resolution. + * @example + * ```ts + * const AddressType = new GraphQLObjectType({ + * name: 'Address', + * fields: { + * street: { type: GraphQLString }, + * number: { type: GraphQLInt }, + * formatted: { + * type: GraphQLString, + * resolve: (obj) => { + * return obj.number + ' ' + obj.street; + * }, + * }, + * }, + * }); + * ``` + * @example + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. + * + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * name: { type: GraphQLString }, + * bestFriend: { type: PersonType }, + * }), + * }); + * ``` + */ +export declare class GraphQLObjectType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Predicate used to determine whether a runtime value belongs to this object type. */ + isTypeOf: Maybe>; + /** Custom extension fields reserved for users. */ + extensions: Readonly>; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _fields; + private _interfaces; + /** + * Creates a GraphQLObjectType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * // Configure an object type with interfaces, fields, arguments, and metadata. + * import { parse } from 'graphql/language'; + * import { + * GraphQLID, + * GraphQLInterfaceType, + * GraphQLNonNull, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const document = parse(` + * type User implements Node { + * id: ID! + * name(format: String = "short"): String + * } + * + * extend type User { + * displayName: String + * } + * `); + * const definition = document.definitions[0]; + * const nameField = definition.fields[1]; + * const formatArg = nameField.arguments[0]; + * + * const Node = new GraphQLInterfaceType({ + * name: 'Node', + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * }); + * + * const User = new GraphQLObjectType({ + * name: 'User', + * description: 'A registered user.', + * interfaces: [Node], + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * name: { + * description: 'The formatted user name.', + * type: GraphQLString, + * args: { + * format: { + * description: 'Controls the name format.', + * type: GraphQLString, + * default: { value: 'short' }, + * deprecationReason: 'Use locale instead.', + * extensions: { public: true }, + * astNode: formatArg, + * }, + * }, + * resolve: (user, { format }) => { + * return format === 'long' ? user.fullName : user.name; + * }, + * deprecationReason: 'Use displayName.', + * extensions: { cacheSeconds: 60 }, + * astNode: nameField, + * }, + * }, + * isTypeOf: (value) => { + * return typeof value === 'object' && value != null && 'id' in value; + * }, + * extensions: { entity: 'User' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * }); + * + * User.name; // => 'User' + * User.getInterfaces(); // => [Node] + * Object.keys(User.getFields()); // => ['id', 'name'] + * User.getFields().name.args[0].default.value; // => 'short' + * User.extensions; // => { entity: 'User' } + * ``` + * @example + * ```ts + * // This variant configures a subscription field with subscribe and resolve functions. + * import { GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Subscription = new GraphQLObjectType({ + * name: 'Subscription', + * fields: { + * greeting: { + * type: GraphQLString, + * subscribe: async function* () { + * yield { greeting: 'Hello!' }; + * }, + * resolve: (event) => { + * return event.greeting; + * }, + * }, + * }, + * }); + * + * typeof Subscription.getFields().greeting.subscribe; // => 'function' + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the fields defined by this type. + * @returns The fields keyed by field name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type User { + * id: ID! + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const User = assertObjectType(schema.getType('User')); + * const fields = User.getFields(); + * + * Object.keys(fields); // => ['id', 'name'] + * String(fields.id.type); // => 'ID!' + * ``` + */ + getFields(): GraphQLFieldMap; + /** + * Returns the interfaces implemented by this type. + * @returns The implemented interfaces. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const User = assertObjectType(schema.getType('User')); + * + * User.getInterfaces().map((type) => type.name); // => ['Node'] + * ``` + */ + getInterfaces(): ReadonlyArray; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const User = new GraphQLObjectType({ + * name: 'User', + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const config = User.toConfig(); + * const UserCopy = new GraphQLObjectType(config); + * + * config.fields.name.type; // => GraphQLString + * UserCopy.getFields().name.type; // => GraphQLString + * ``` + */ + toConfig(): GraphQLObjectTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this object type. + * @returns The schema coordinate for this object type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const User = assertObjectType(schema.getType('User')); + * + * User.toString(); // => 'User' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const User = new GraphQLObjectType({ + * name: 'User', + * fields: { name: { type: GraphQLString } }, + * }); + * + * User.toJSON(); // => 'User' + * JSON.stringify({ type: User }); // => '{"type":"User"}' + * ``` + */ + toJSON(): string; +} +/** + * Configuration used to construct a GraphQLObjectType. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TAbstract - Runtime value type used for abstract type resolution. + */ +export interface GraphQLObjectTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Interfaces implemented by this object or interface type. */ + interfaces?: ThunkReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + fields: ThunkObjMap>; + /** Predicate used to determine whether a runtime value belongs to this object type. */ + isTypeOf?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLObjectTypeNormalizedConfig extends GraphQLObjectTypeConfig { + interfaces: ReadonlyArray; + fields: GraphQLFieldNormalizedConfigMap; + extensions: Readonly>; + extensionASTNodes: ReadonlyArray; +} +/** + * Resolves the concrete object type for an abstract GraphQL type. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLTypeResolver = (value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: GraphQLAbstractType) => PromiseOrValue; +/** + * Checks whether a runtime value belongs to a GraphQL object type. + * @typeParam TAbstract - Runtime value type used for abstract type resolution. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLIsTypeOfFn = (value: TAbstract, context: TContext, info: GraphQLResolveInfo) => PromiseOrValue; +/** + * Resolves the runtime value for a GraphQL field. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TArgs - Argument object type passed to resolvers. + * @typeParam TResult - Result value type. + */ +export type GraphQLFieldResolver = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult; +/** Utilities available from resolver info for tracking asynchronous work. */ +export interface GraphQLResolveInfoHelpers { + /** + * Promise.all wrapper that allows rejected branches to be tracked + * as execution async work. + * + * Intended use: return or await this promise from resolver work. + * Un-awaited async side effects are an anti-pattern: + * + * const { promiseAll } = info.getAsyncHelpers(); + * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined); + * + * In that anti-pattern, tracking starts only after rejection (on a + * later microtask), so this work is not guaranteed to delay + * `hooks.asyncWorkFinished`. + * + * Use `track(...)` for un-awaited async side effects: + * + * const { track } = info.getAsyncHelpers(); + * track([ + * someAsyncWork().catch(() => undefined), + * someOtherAsyncWork().catch(() => undefined) + * ]); + */ + readonly promiseAll: (values: ReadonlyArray | T>) => Promise>; + /** Tracks asynchronous work that should delay execution completion hooks. */ + readonly track: (maybePromises: ReadonlyArray) => void; +} +/** Information about the currently executing GraphQL field. */ +export interface GraphQLResolveInfo { + /** The field name referenced by this schema coordinate. */ + readonly fieldName: string; + /** AST field nodes that contributed to the current field execution. */ + readonly fieldNodes: ReadonlyArray; + /** GraphQL output type declared for the current field. */ + readonly returnType: GraphQLOutputType; + /** Object type that owns the current field. */ + readonly parentType: GraphQLObjectType; + /** Response path where this error occurred during execution. */ + readonly path: Path; + /** The schema used for validation or execution. */ + readonly schema: GraphQLSchema; + /** Fragment definitions in the operation document keyed by fragment name. */ + readonly fragments: ObjMap; + /** Initial root value passed to the operation. */ + readonly rootValue: unknown; + /** The operation selected for execution. */ + readonly operation: OperationDefinitionNode; + /** + * Coerced variable values and source metadata for this operation. Resolver + * code that needs runtime variable values should read `variableValues.coerced`. + */ + readonly variableValues: VariableValues; + /** Returns the AbortSignal supplied for this execution, if any. */ + readonly getAbortSignal: () => AbortSignal | undefined; + /** Returns helper functions for tracking asynchronous resolver work. */ + readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + * We've provided these template arguments because this is an open type and + * you may find them useful. + * @typeParam _TSource - Reserved source type parameter for extension typing. + * @typeParam _TContext - Reserved context type parameter for extension typing. + * @typeParam _TArgs - Reserved argument type parameter for extension typing. + */ +export interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> { + [attributeName: string | symbol]: unknown; +} +/** + * Configuration used to define a GraphQL field. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TArgs - Argument object type passed to resolvers. + */ +export interface GraphQLFieldConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLOutputType; + /** Arguments accepted by this field or directive. */ + args?: GraphQLFieldConfigArgumentMap | undefined; + /** Resolver function used to produce this field value. */ + resolve?: GraphQLFieldResolver | undefined; + /** Resolver function used to create a subscription event stream for this field. */ + subscribe?: GraphQLFieldResolver | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** @internal */ +export interface GraphQLFieldNormalizedConfig extends GraphQLFieldConfig { + args: GraphQLFieldNormalizedConfigArgumentMap; + extensions: Readonly>; +} +/** A map of argument names to argument configuration objects. */ +export type GraphQLFieldConfigArgumentMap = ObjMap; +/** @internal */ +export type GraphQLFieldNormalizedConfigArgumentMap = ObjMap; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLArgumentExtensions { + [attributeName: string | symbol]: unknown; +} +/** Configuration used to define a GraphQL argument. */ +export interface GraphQLArgumentConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value for this argument. Use `default` instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue?: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default?: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** @internal */ +export interface GraphQLArgumentNormalizedConfig extends GraphQLArgumentConfig { + default: GraphQLDefaultInput | undefined; + extensions: Readonly; +} +/** + * A map of field names to field configuration objects. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLFieldConfigMap = ObjMap>; +/** @internal */ +export type GraphQLFieldNormalizedConfigMap = ObjMap>; +/** + * A resolved GraphQL field definition. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TArgs - Argument object type passed to resolvers. + */ +export declare class GraphQLField implements GraphQLSchemaElement { + /** Object or interface type that owns this field, if known. */ + parentType: GraphQLObjectType | GraphQLInterfaceType | undefined; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLOutputType; + /** Arguments accepted by this field or directive. */ + args: ReadonlyArray; + /** Resolver function used to produce this field value. */ + resolve?: GraphQLFieldResolver | undefined; + /** Resolver function used to create a subscription event stream for this field. */ + subscribe?: GraphQLFieldResolver | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly>; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL field definition. + * @param parentType - Object or interface type that owns this field, if known. + * @param name - Field name. + * @param config - Field configuration. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const document = parse('type Query { greeting: String }'); + * const fieldNode = document.definitions[0].fields[0]; + * const field = new GraphQLField(Query, 'greeting', { + * description: 'Greeting text.', + * type: GraphQLString, + * args: { + * name: { type: GraphQLString, default: { value: 'world' } }, + * }, + * resolve: (_source, { name }) => `Hello, ${name}!`, + * subscribe: async function* () { + * yield { greeting: 'Hello!' }; + * }, + * deprecationReason: 'Use hello.', + * extensions: { cacheSeconds: 60 }, + * astNode: fieldNode, + * }); + * + * field.parentType; // => Query + * field.name; // => 'greeting' + * field.args[0].default.value; // => 'world' + * typeof field.subscribe; // => 'function' + * field.deprecationReason; // => 'Use hello.' + * field.astNode; // => fieldNode + * ``` + */ + constructor(parentType: GraphQLObjectType | GraphQLInterfaceType | undefined, name: string, config: GraphQLFieldConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this field. + * @returns A configuration object that can be used to recreate this field. + * @example + * ```ts + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { + * type: GraphQLString, + * extensions: { cacheSeconds: 60 }, + * }); + * + * field.toConfig().type; // => GraphQLString + * field.toConfig().extensions; // => { cacheSeconds: 60 } + * ``` + */ + toConfig(): GraphQLFieldNormalizedConfig; + /** + * Returns this field as a schema coordinate string. + * @returns The field coordinate. + * @example + * ```ts + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * + * field.toString(); // => 'Query.greeting' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The field coordinate. + * @example + * ```ts + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * + * JSON.stringify(field); // => '"Query.greeting"' + * ``` + */ + toJSON(): string; +} +/** A resolved GraphQL argument definition. */ +export declare class GraphQLArgument implements GraphQLSchemaElement { + /** Field or directive that owns this argument. */ + parent: GraphQLField | GraphQLDirective; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value used when no explicit value is supplied. + * Use `default` instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL argument definition. + * @param parent - Field or directive that owns this argument. + * @param name - Argument name. + * @param config - Argument configuration. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { + * type: GraphQLString, + * default: { value: 'world' }, + * }); + * + * arg.parent; // => field + * arg.name; // => 'name' + * arg.default.value; // => 'world' + * ``` + */ + constructor(parent: GraphQLField | GraphQLDirective, name: string, config: GraphQLArgumentConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this argument. + * @returns A configuration object that can be used to recreate this argument. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { + * type: GraphQLString, + * default: { value: 'world' }, + * }); + * + * arg.toConfig().default.value; // => 'world' + * ``` + */ + toConfig(): GraphQLArgumentNormalizedConfig; + /** + * Returns this argument as a schema coordinate string. + * @returns The argument coordinate. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString }); + * + * arg.toString(); // => 'Query.greeting(name:)' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The argument coordinate. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString }); + * + * JSON.stringify(arg); // => '"Query.greeting(name:)"' + * ``` + */ + toJSON(): string; +} +/** + * Returns true when the argument is non-null and has no default value. + * @param arg - The argument definition to inspect. + * @returns True when the argument is non-null and has no default value. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLObjectType, + * GraphQLString, + * isRequiredArgument, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'reviews', { type: GraphQLString }); + * const requiredArgument = new GraphQLArgument(field, 'id', { + * type: new GraphQLNonNull(GraphQLInt), + * }); + * const optionalArgument = new GraphQLArgument(field, 'name', { + * type: GraphQLString, + * }); + * const argumentWithDefault = new GraphQLArgument(field, 'limit', { + * type: new GraphQLNonNull(GraphQLInt), + * default: { value: 10 }, + * }); + * + * isRequiredArgument(requiredArgument); // => true + * isRequiredArgument(optionalArgument); // => false + * isRequiredArgument(argumentWithDefault); // => false + * ``` + */ +export declare function isRequiredArgument(arg: GraphQLArgument | GraphQLVariableSignature): boolean; +/** + * A map of field names to resolved field definitions. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLFieldMap = ObjMap>; +/** Default input represented as either a runtime value or a GraphQL literal. */ +export type GraphQLDefaultInput = { + /** Runtime default value. */ + value: unknown; + /** GraphQL literal default value is not provided in this variant. */ + literal?: never; +} | { + /** GraphQL literal default value. */ + literal: ConstValueNode; + /** Runtime default value is not provided in this variant. */ + value?: never; +}; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInterfaceTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Interface Type Definition + * + * When a field can return one of a heterogeneous set of types, a Interface type + * is used to describe what types are possible, what fields are in common across + * all types, as well as a function to determine which type is actually used + * when the field is resolved. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @example + * ```ts + * const EntityType = new GraphQLInterfaceType({ + * name: 'Entity', + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * ``` + */ +export declare class GraphQLInterfaceType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Function that resolves the concrete object type for this abstract type. */ + resolveType: Maybe>; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _fields; + private _interfaces; + /** + * Creates a GraphQLInterfaceType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type'; + * + * const document = parse(` + * interface Node { + * id: ID! + * } + * + * interface Resource implements Node { + * id: ID! + * } + * + * extend interface Resource { + * url: String + * } + * `); + * + * const Node = new GraphQLInterfaceType({ + * name: 'Node', + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * }); + * + * const Resource = new GraphQLInterfaceType({ + * name: 'Resource', + * description: 'An addressable resource.', + * interfaces: [Node], + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * resolveType: (value) => { + * return typeof value === 'object' && value != null && 'url' in value + * ? 'WebPage' + * : null; + * }, + * extensions: { abstract: true }, + * astNode: document.definitions[1], + * extensionASTNodes: [document.definitions[2]], + * }); + * + * Resource.name; // => 'Resource' + * Resource.getInterfaces(); // => [Node] + * Object.keys(Resource.getFields()); // => ['id'] + * Resource.extensions; // => { abstract: true } + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the fields defined by this type. + * @returns The fields keyed by field name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * const fields = Node.getFields(); + * + * Object.keys(fields); // => ['id'] + * String(fields.id.type); // => 'ID!' + * ``` + */ + getFields(): GraphQLFieldMap; + /** + * Returns the interfaces implemented by this type. + * @returns The implemented interfaces. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Resource { + * url: String! + * } + * + * interface Image implements Resource { + * url: String! + * width: Int + * } + * + * type Photo implements Resource & Image { + * url: String! + * width: Int + * } + * + * type Query { + * image: Image + * } + * `); + * + * const Image = assertInterfaceType(schema.getType('Image')); + * + * Image.getInterfaces().map((type) => type.name); // => ['Resource'] + * ``` + */ + getInterfaces(): ReadonlyArray; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type'; + * + * const Node = new GraphQLInterfaceType({ + * name: 'Node', + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * }); + * + * const config = Node.toConfig(); + * const NodeCopy = new GraphQLInterfaceType(config); + * + * String(config.fields.id.type); // => 'ID!' + * String(NodeCopy.getFields().id.type); // => 'ID!' + * ``` + */ + toConfig(): GraphQLInterfaceTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this interface type. + * @returns The schema coordinate for this interface type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * + * Node.toString(); // => 'Node' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLInterfaceType, GraphQLString } from 'graphql/type'; + * + * const Named = new GraphQLInterfaceType({ + * name: 'Named', + * fields: { name: { type: GraphQLString } }, + * }); + * + * Named.toJSON(); // => 'Named' + * JSON.stringify({ type: Named }); // => '{"type":"Named"}' + * ``` + */ + toJSON(): string; +} +/** + * Configuration used to construct a GraphQLInterfaceType. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export interface GraphQLInterfaceTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Interfaces implemented by this object or interface type. */ + interfaces?: ThunkReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + fields: ThunkObjMap>; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLInterfaceTypeNormalizedConfig extends GraphQLInterfaceTypeConfig { + interfaces: ReadonlyArray; + fields: GraphQLFieldNormalizedConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLUnionTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Union Type Definition + * + * When a field can return one of a heterogeneous set of types, a Union type + * is used to describe what types are possible as well as providing a function + * to determine which type is actually used when the field is resolved. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @example + * ```ts + * const PetType = new GraphQLUnionType({ + * name: 'Pet', + * types: [DogType, CatType], + * resolveType: (value) => { + * if (value instanceof Dog) { + * return DogType; + * } + * if (value instanceof Cat) { + * return CatType; + * } + * }, + * }); + * ``` + */ +export declare class GraphQLUnionType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Function that resolves the concrete object type for this abstract type. */ + resolveType: Maybe>; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _types; + /** + * Creates a GraphQLUnionType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { + * GraphQLObjectType, + * GraphQLString, + * GraphQLUnionType, + * } from 'graphql/type'; + * + * const document = parse(` + * union Media = Photo | Video + * + * extend union Media = Audio + * `); + * + * const Photo = new GraphQLObjectType({ + * name: 'Photo', + * fields: { url: { type: GraphQLString } }, + * }); + * const Video = new GraphQLObjectType({ + * name: 'Video', + * fields: { url: { type: GraphQLString } }, + * }); + * + * const Media = new GraphQLUnionType({ + * name: 'Media', + * description: 'Media that can appear in a search result.', + * types: [Photo, Video], + * resolveType: (value) => { + * return typeof value === 'object' && value != null && 'duration' in value + * ? 'Video' + * : 'Photo'; + * }, + * extensions: { searchable: true }, + * astNode: document.definitions[0], + * extensionASTNodes: [document.definitions[1]], + * }); + * + * Media.description; // => 'Media that can appear in a search result.' + * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * Media.extensions; // => { searchable: true } + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the object types included in this union. + * @returns The union member object types. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * + * type Query { + * media: [Media] + * } + * `); + * + * const Media = assertUnionType(schema.getType('Media')); + * + * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * ``` + */ + getTypes(): ReadonlyArray; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { + * GraphQLObjectType, + * GraphQLString, + * GraphQLUnionType, + * } from 'graphql/type'; + * + * const Photo = new GraphQLObjectType({ + * name: 'Photo', + * fields: { url: { type: GraphQLString } }, + * }); + * const Video = new GraphQLObjectType({ + * name: 'Video', + * fields: { url: { type: GraphQLString } }, + * }); + * const Media = new GraphQLUnionType({ + * name: 'Media', + * types: [Photo, Video], + * }); + * + * const config = Media.toConfig(); + * const MediaCopy = new GraphQLUnionType(config); + * + * MediaCopy.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * ``` + */ + toConfig(): GraphQLUnionTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this union type. + * @returns The schema coordinate for this union type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * union SearchResult = Photo + * + * type Query { + * search: [SearchResult] + * } + * `); + * + * const SearchResult = assertUnionType(schema.getType('SearchResult')); + * + * SearchResult.toString(); // => 'SearchResult' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { + * GraphQLObjectType, + * GraphQLString, + * GraphQLUnionType, + * } from 'graphql/type'; + * + * const Photo = new GraphQLObjectType({ + * name: 'Photo', + * fields: { url: { type: GraphQLString } }, + * }); + * const SearchResult = new GraphQLUnionType({ + * name: 'SearchResult', + * types: [Photo], + * }); + * + * SearchResult.toJSON(); // => 'SearchResult' + * JSON.stringify({ type: SearchResult }); // => '{"type":"SearchResult"}' + * ``` + */ + toJSON(): string; +} +/** + * Configuration used to construct a GraphQLUnionType. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export interface GraphQLUnionTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Object types that belong to this union type. */ + types: ThunkReadonlyArray; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLUnionTypeNormalizedConfig extends GraphQLUnionTypeConfig { + types: ReadonlyArray; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLEnumTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Enum Type Definition + * + * Enum types define leaf values whose serialized form is one of a fixed set + * of GraphQL enum names. Internally, enum values can map to any runtime value, + * often integers. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGBType = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGBType.getValue('GREEN')?.value; // => 1 + * ``` + * + * Note: If a value is not provided in a definition, the name of the enum value + * will be used as its internal value. + */ +export declare class GraphQLEnumType/* */ implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _values; + private _valueLookup; + private _nameLookup; + /** + * Creates a GraphQLEnumType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const document = parse(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * JEDI + * } + * + * extend enum Episode { + * FORCE_AWAKENS + * } + * `); + * const definition = document.definitions[0]; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * description: 'A Star Wars film episode.', + * values: { + * NEW_HOPE: { + * value: 4, + * description: 'Released in 1977.', + * extensions: { trilogy: 'original' }, + * astNode: definition.values[0], + * }, + * EMPIRE: { value: 5, astNode: definition.values[1] }, + * JEDI: { + * value: 6, + * deprecationReason: 'Use RETURN_OF_THE_JEDI.', + * astNode: definition.values[2], + * }, + * }, + * extensions: { catalog: 'films' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * }); + * + * Episode.description; // => 'A Star Wars film episode.' + * Episode.coerceOutputValue(5); // => 'EMPIRE' + * Episode.coerceInputValue('JEDI'); // => 6 + * Episode.getValue('JEDI').deprecationReason; // => 'Use RETURN_OF_THE_JEDI.' + * Episode.extensions; // => { catalog: 'films' } + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the values defined by this enum type. + * @returns Enum value definitions in schema order. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * JEDI + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const Episode = assertEnumType(schema.getType('Episode')); + * + * Episode.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE', 'JEDI'] + * ``` + */ + getValues(): ReadonlyArray; + /** + * Returns the enum value definition for a value name. + * @param name - The GraphQL name to look up. + * @returns The matching enum value definition, if it exists. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const Episode = assertEnumType(schema.getType('Episode')); + * + * Episode.getValue('EMPIRE')?.name; // => 'EMPIRE' + * Episode.getValue('JEDI'); // => undefined + * ``` + */ + getValue(name: string): Maybe; + /** + * Serializes a runtime enum value as a GraphQL enum name. + * @param outputValue - Runtime enum value to serialize. + * @returns The GraphQL enum name for the runtime value. + * + * This deprecated method delegates to `coerceOutputValue()`; call + * `coerceOutputValue()` directly instead. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.serialize(1); // => 'GREEN' + * RGB.serialize(3); // throws an error + * ``` + * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 + */ + serialize(outputValue: unknown): Maybe; + /** + * Coerces a runtime enum value to a GraphQL enum name. + * @param outputValue - Runtime enum value to coerce. + * @returns The GraphQL enum name for the runtime value. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.coerceOutputValue(1); // => 'GREEN' + * RGB.coerceOutputValue(3); // throws an error + * ``` + */ + coerceOutputValue(outputValue: unknown): Maybe; + /** + * Deprecated legacy enum parser for externally provided input values. Use + * `coerceInputValue()` instead. + * @param inputValue - External enum name to parse. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum name. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.parseValue('BLUE'); // => 2 + * RGB.parseValue('PURPLE', true); // throws an error + * ``` + * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 + */ + parseValue(inputValue: unknown, hideSuggestions?: Maybe): Maybe; + /** + * Coerces an external enum name to its internal runtime value. + * @param inputValue - External enum name to coerce. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum name. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.coerceInputValue('BLUE'); // => 2 + * RGB.coerceInputValue('PURPLE'); // throws an error + * RGB.coerceInputValue(2); // throws an error + * ``` + */ + coerceInputValue(inputValue: unknown, hideSuggestions?: Maybe): Maybe; + /** + * Deprecated legacy enum parser for externally provided input literals. Use + * `coerceInputLiteral()` instead. + * @param valueNode - Enum value AST node to parse. + * @param _variables - Deprecated variable values parameter that is no longer used. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum literal. + * @example + * ```ts + * import { parseValue } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.parseLiteral(parseValue('RED')); // => 0 + * RGB.parseLiteral(parseValue('"RED"')); // throws an error + * ``` + * @deprecated use `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 + */ + parseLiteral(valueNode: ValueNode, _variables: Maybe>, hideSuggestions?: Maybe): Maybe; + /** + * Coerces an enum value AST node to its internal runtime value. + * @param valueNode - Enum value AST node to coerce. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum literal. + * @example + * ```ts + * import { parseConstValue } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.coerceInputLiteral(parseConstValue('RED')); // => 0 + * RGB.coerceInputLiteral(parseConstValue('"RED"'), true); // throws an error + * ``` + */ + coerceInputLiteral(valueNode: ConstValueNode, hideSuggestions?: Maybe): Maybe; + /** + * Converts a runtime enum value to a GraphQL enum value AST node. + * @param value - Runtime enum value to convert. + * @returns Enum value AST node, or undefined if the value is invalid. + * @example + * ```ts + * import { print } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * print(RGB.valueToLiteral(2)); // => 'BLUE' + * RGB.valueToLiteral(3); // => undefined + * ``` + */ + valueToLiteral(value: unknown): ConstValueNode | undefined; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * const config = RGB.toConfig(); + * const RGBCopy = new GraphQLEnumType(config); + * + * config.values.GREEN.value; // => 1 + * RGBCopy.coerceOutputValue(2); // => 'BLUE' + * ``` + */ + toConfig(): GraphQLEnumTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this enum type. + * @returns The schema coordinate for this enum type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const Episode = assertEnumType(schema.getType('Episode')); + * + * Episode.toString(); // => 'Episode' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { + * NEW_HOPE: {}, + * }, + * }); + * + * Episode.toJSON(); // => 'Episode' + * JSON.stringify({ type: Episode }); // => '{"type":"Episode"}' + * ``` + */ + toJSON(): string; +} +/** Configuration used to construct a GraphQLEnumType. */ +export interface GraphQLEnumTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Values contained in this enum, list, or input-object definition. */ + values: ThunkObjMap; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig { + values: GraphQLEnumValueNormalizedConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** A map of enum value names to enum value configuration objects. */ +export type GraphQLEnumValueConfigMap = ObjMap; +/** @internal */ +export type GraphQLEnumValueNormalizedConfigMap = ObjMap; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLEnumValueExtensions { + [attributeName: string | symbol]: unknown; +} +/** Configuration used to define a GraphQL enum value. */ +export interface GraphQLEnumValueConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Parsed value represented by this node. */ + value?: any; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** @internal */ +export interface GraphQLEnumValueNormalizedConfig extends GraphQLEnumValueConfig { + extensions: Readonly; +} +/** A resolved GraphQL enum value definition. */ +export declare class GraphQLEnumValue implements GraphQLSchemaElement { + /** Enum type that owns this enum value. */ + parentEnum: GraphQLEnumType; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Parsed value represented by this node. */ + value: any; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL enum value definition. + * @param parentEnum - Enum type that owns this enum value. + * @param name - Enum value name. + * @param config - Enum value configuration. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { + * value: 5, + * description: 'Released in 1980.', + * }); + * + * enumValue.parentEnum; // => Episode + * enumValue.name; // => 'EMPIRE' + * enumValue.value; // => 5 + * ``` + */ + constructor(parentEnum: GraphQLEnumType, name: string, config: GraphQLEnumValueConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this enum value. + * @returns A configuration object that can be used to recreate this enum value. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { + * value: 5, + * extensions: { trilogy: 'original' }, + * }); + * + * enumValue.toConfig(); // => { description: undefined, value: 5, deprecationReason: undefined, extensions: { trilogy: 'original' }, astNode: undefined } + * ``` + */ + toConfig(): GraphQLEnumValueNormalizedConfig; + /** + * Returns this enum value as a schema coordinate string. + * @returns Enum value coordinate. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 }); + * + * enumValue.toString(); // => 'Episode.EMPIRE' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns Enum value coordinate. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 }); + * + * JSON.stringify(enumValue); // => '"Episode.EMPIRE"' + * ``` + */ + toJSON(): string; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInputObjectTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Input Object Type Definition + * + * An input object defines a structured collection of fields which may be + * supplied to a field argument. + * + * Using `NonNull` will ensure that a value must be provided by the query + * @example + * ```ts + * const GeoPoint = new GraphQLInputObjectType({ + * name: 'GeoPoint', + * fields: { + * lat: { type: new GraphQLNonNull(GraphQLFloat) }, + * lon: { type: new GraphQLNonNull(GraphQLFloat) }, + * alt: { type: GraphQLFloat, default: { value: 0 } }, + * }, + * }); + * ``` + */ +export declare class GraphQLInputObjectType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** Whether this input object uses the experimental OneOf input object semantics. */ + isOneOf: boolean; + private _fields; + /** + * Creates a GraphQLInputObjectType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { + * GraphQLID, + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * + * const document = parse(` + * input ReviewInput { + * stars: Int! + * commentary: String + * } + * + * extend input ReviewInput { + * body: String + * } + * `); + * const definition = document.definitions[0]; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * description: 'Input collected when reviewing a product.', + * fields: { + * stars: { + * description: 'Star rating from one to five.', + * type: new GraphQLNonNull(GraphQLInt), + * extensions: { min: 1, max: 5 }, + * astNode: definition.fields[0], + * }, + * commentary: { + * type: GraphQLString, + * default: { value: '' }, + * deprecationReason: 'Use body.', + * astNode: definition.fields[1], + * }, + * }, + * extensions: { form: 'review' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * isOneOf: false, + * }); + * const SearchBy = new GraphQLInputObjectType({ + * name: 'SearchBy', + * fields: { + * id: { type: GraphQLID }, + * slug: { type: GraphQLString }, + * }, + * isOneOf: true, + * }); + * + * const fields = ReviewInput.getFields(); + * + * ReviewInput.description; // => 'Input collected when reviewing a product.' + * String(fields.stars.type); // => 'Int!' + * fields.stars.extensions; // => { min: 1, max: 5 } + * fields.commentary.default.value; // => '' + * fields.commentary.deprecationReason; // => 'Use body.' + * ReviewInput.isOneOf; // => false + * SearchBy.isOneOf; // => true + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the fields defined by this type. + * @returns The fields keyed by field name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * commentary: String = "" + * } + * + * type Query { + * reviews(filter: ReviewInput): [String] + * } + * `); + * + * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput')); + * const fields = ReviewInput.getFields(); + * + * Object.keys(fields); // => ['stars', 'commentary'] + * fields.commentary.default; // => { literal: { kind: 'StringValue', value: '' } } + * ``` + */ + getFields(): GraphQLInputFieldMap; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * }, + * }); + * + * const config = ReviewInput.toConfig(); + * const ReviewInputCopy = new GraphQLInputObjectType(config); + * + * String(config.fields.stars.type); // => 'Int!' + * String(ReviewInputCopy.getFields().stars.type); // => 'Int!' + * ``` + */ + toConfig(): GraphQLInputObjectTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this input object type. + * @returns The schema coordinate for this input object type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Query { + * reviews(filter: ReviewInput): [String] + * } + * `); + * + * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput')); + * + * ReviewInput.toString(); // => 'ReviewInput' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * commentary: { type: GraphQLString }, + * }, + * }); + * + * ReviewInput.toJSON(); // => 'ReviewInput' + * JSON.stringify({ type: ReviewInput }); // => '{"type":"ReviewInput"}' + * ``` + */ + toJSON(): string; +} +/** Configuration used to construct a GraphQLInputObjectType. */ +export interface GraphQLInputObjectTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Fields declared by this object, interface, input object, or literal. */ + fields: ThunkObjMap; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; + /** Whether this input object uses the experimental OneOf input object semantics. */ + isOneOf?: boolean; +} +/** @internal */ +export interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObjectTypeConfig { + fields: GraphQLInputFieldNormalizedConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInputFieldExtensions { + [attributeName: string | symbol]: unknown; +} +/** Configuration used to define a GraphQL input field. */ +export interface GraphQLInputFieldConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value for this input field. Use `default` + * instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue?: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default?: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** A map of input field names to input field configuration objects. */ +export type GraphQLInputFieldConfigMap = ObjMap; +/** @internal */ +export interface GraphQLInputFieldNormalizedConfig extends GraphQLInputFieldConfig { + default: GraphQLDefaultInput | undefined; + extensions: Readonly; +} +/** @internal */ +export type GraphQLInputFieldNormalizedConfigMap = ObjMap; +/** A resolved GraphQL input field definition. */ +export declare class GraphQLInputField implements GraphQLSchemaElement { + /** Input object type that owns this input field. */ + parentType: GraphQLInputObjectType; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value used when no explicit value is supplied. + * Use `default` instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL input field definition. + * @param parentType - Input object type that owns this field. + * @param name - Input field name. + * @param config - Input field configuration. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * default: { value: '' }, + * }); + * + * field.parentType; // => ReviewInput + * field.name; // => 'commentary' + * field.default.value; // => '' + * ``` + */ + constructor(parentType: GraphQLInputObjectType, name: string, config: GraphQLInputFieldConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this input field. + * @returns A configuration object that can be used to recreate this input field. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * extensions: { form: 'review' }, + * }); + * + * field.toConfig().extensions; // => { form: 'review' } + * ``` + */ + toConfig(): GraphQLInputFieldNormalizedConfig; + /** + * Returns this input field as a schema coordinate string. + * @returns The input field coordinate. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * }); + * + * field.toString(); // => 'ReviewInput.commentary' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The input field coordinate. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * }); + * + * JSON.stringify(field); // => '"ReviewInput.commentary"' + * ``` + */ + toJSON(): string; +} +/** + * Returns true when the input field is non-null and has no default value. + * @param field - The input field definition to inspect. + * @returns True when the input field is non-null and has no default value. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLString, + * isRequiredInputField, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const requiredField = new GraphQLInputField(ReviewInput, 'id', { + * type: new GraphQLNonNull(GraphQLInt), + * }); + * const optionalField = new GraphQLInputField(ReviewInput, 'name', { + * type: GraphQLString, + * }); + * const fieldWithDefault = new GraphQLInputField(ReviewInput, 'limit', { + * type: new GraphQLNonNull(GraphQLInt), + * default: { value: 10 }, + * }); + * + * isRequiredInputField(requiredField); // => true + * isRequiredInputField(optionalField); // => false + * isRequiredInputField(fieldWithDefault); // => false + * ``` + */ +export declare function isRequiredInputField(field: GraphQLInputField): boolean; +/** A map of input field names to resolved input field definitions. */ +export type GraphQLInputFieldMap = ObjMap; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.ts new file mode 100644 index 00000000..3c2a05b1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.d.ts @@ -0,0 +1,4095 @@ +/** @category Types */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { Path } from "../jsutils/Path.js"; +import type { PromiseOrValue } from "../jsutils/PromiseOrValue.js"; +import type { ConstValueNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, EnumValueDefinitionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationDefinitionNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, UnionTypeDefinitionNode, UnionTypeExtensionNode, ValueNode } from "../language/ast.js"; +import type { GraphQLVariableSignature } from "../execution/getVariableSignature.js"; +import type { VariableValues } from "../execution/values.js"; +import type { GraphQLDirective } from "./directives.js"; +import type { GraphQLSchema } from "./schema.js"; +/** These are all of the possible kinds of types. */ +export type GraphQLType = GraphQLNamedType | GraphQLWrappingType; +/** + * Returns true when the value is any GraphQL type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is any GraphQL type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLList, GraphQLString, isType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * isType(GraphQLString); // => true + * isType(new GraphQLList(GraphQLString)); // => true + * isType(schema.getType('Query')); // => true + * isType('String'); // => false + * ``` + */ +export declare function isType(type: unknown): type is GraphQLType; +/** + * Returns the value as a GraphQL type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const queryType = assertType(schema.getType('Query')); + * + * queryType.toString(); // => 'Query' + * assertType('Query'); // throws an error + * ``` + */ +export declare function assertType(type: unknown): GraphQLType; +/** + * There are predicates for each kind of GraphQL type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLScalarType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isScalarType } from 'graphql/type'; + * + * const schema = buildSchema(` + * scalar DateTime + * + * type Query { + * createdAt: DateTime + * } + * `); + * + * isScalarType(schema.getType('DateTime')); // => true + * isScalarType(schema.getType('Query')); // => false + * ``` + */ +export declare function isScalarType(type: unknown): type is GraphQLScalarType; +/** + * Returns the value as a GraphQLScalarType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLScalarType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertScalarType } from 'graphql/type'; + * + * const schema = buildSchema(` + * scalar DateTime + * + * type Query { + * createdAt: DateTime + * } + * `); + * + * const dateTimeType = assertScalarType(schema.getType('DateTime')); + * + * dateTimeType.name; // => 'DateTime' + * assertScalarType(schema.getType('Query')); // throws an error + * ``` + */ +export declare function assertScalarType(type: unknown): GraphQLScalarType; +/** + * Returns true when the value is a GraphQLObjectType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type User { + * name: String + * } + * + * type Query { + * user: User + * } + * `); + * + * isObjectType(schema.getType('User')); // => true + * isObjectType(schema.getType('ReviewInput')); // => false + * ``` + */ +export declare function isObjectType(type: unknown): type is GraphQLObjectType; +/** + * Returns the value as a GraphQLObjectType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type User { + * name: String + * } + * + * type Query { + * user: User + * } + * `); + * + * const userType = assertObjectType(schema.getType('User')); + * + * Object.keys(userType.getFields()); // => ['name'] + * assertObjectType(schema.getType('ReviewInput')); // throws an error + * ``` + */ +export declare function assertObjectType(type: unknown): GraphQLObjectType; +/** + * Returns true when the value is a resolved GraphQL field definition. + * @param field - Value to inspect. + * @returns True when the value is a GraphQLField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isField } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const field = schema.getQueryType().getFields().greeting; + * + * isField(field); // => true + * isField(schema.getQueryType()); // => false + * ``` + */ +export declare function isField(field: unknown): field is GraphQLField; +/** + * Returns the value as a GraphQLField, or throws if it is not one. + * @param field - Value to inspect. + * @returns The value typed as a GraphQLField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertField } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting: String }'); + * const field = assertField(schema.getQueryType().getFields().greeting); + * + * field.name; // => 'greeting' + * assertField(schema.getQueryType()); // throws an error + * ``` + */ +export declare function assertField(field: unknown): GraphQLField; +/** + * Returns true when the value is a resolved GraphQL argument definition. + * @param arg - Value to inspect. + * @returns True when the value is a GraphQLArgument. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isArgument } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting(name: String): String }'); + * const arg = schema.getQueryType().getFields().greeting.args[0]; + * + * isArgument(arg); // => true + * isArgument(schema.getQueryType()); // => false + * ``` + */ +export declare function isArgument(arg: unknown): arg is GraphQLArgument; +/** + * Returns the value as a GraphQLArgument, or throws if it is not one. + * @param arg - Value to inspect. + * @returns The value typed as a GraphQLArgument. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertArgument } from 'graphql/type'; + * + * const schema = buildSchema('type Query { greeting(name: String): String }'); + * const arg = assertArgument(schema.getQueryType().getFields().greeting.args[0]); + * + * arg.name; // => 'name' + * assertArgument(schema.getQueryType()); // throws an error + * ``` + */ +export declare function assertArgument(arg: unknown): GraphQLArgument; +/** + * Returns true when the value is a GraphQLInterfaceType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLInterfaceType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * isInterfaceType(schema.getType('Node')); // => true + * isInterfaceType(schema.getType('User')); // => false + * ``` + */ +export declare function isInterfaceType(type: unknown): type is GraphQLInterfaceType; +/** + * Returns the value as a GraphQLInterfaceType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLInterfaceType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const nodeType = assertInterfaceType(schema.getType('Node')); + * + * nodeType.name; // => 'Node' + * assertInterfaceType(schema.getType('User')); // throws an error + * ``` + */ +export declare function assertInterfaceType(type: unknown): GraphQLInterfaceType; +/** + * Returns true when the value is a GraphQLUnionType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLUnionType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * + * type Query { + * media: [Media] + * } + * `); + * + * isUnionType(schema.getType('Media')); // => true + * isUnionType(schema.getType('Photo')); // => false + * ``` + */ +export declare function isUnionType(type: unknown): type is GraphQLUnionType; +/** + * Returns the value as a GraphQLUnionType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLUnionType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * + * type Query { + * media: [Media] + * } + * `); + * + * const mediaType = assertUnionType(schema.getType('Media')); + * + * mediaType.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * assertUnionType(schema.getType('Photo')); // throws an error + * ``` + */ +export declare function assertUnionType(type: unknown): GraphQLUnionType; +/** + * Returns true when the value is a GraphQLEnumType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLEnumType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * favoriteEpisode: Episode + * } + * `); + * + * isEnumType(schema.getType('Episode')); // => true + * isEnumType(schema.getType('Query')); // => false + * ``` + */ +export declare function isEnumType(type: unknown): type is GraphQLEnumType; +/** + * Returns the value as a GraphQLEnumType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLEnumType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * favoriteEpisode: Episode + * } + * `); + * + * const episodeType = assertEnumType(schema.getType('Episode')); + * + * episodeType.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE'] + * assertEnumType(schema.getType('Query')); // throws an error + * ``` + */ +export declare function assertEnumType(type: unknown): GraphQLEnumType; +/** + * Returns true when the value is a resolved GraphQL enum value definition. + * @param value - Value to inspect. + * @returns True when the value is a GraphQLEnumValue. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType, isEnumValue } from 'graphql/type'; + * + * const schema = buildSchema( + * 'enum Episode { NEW_HOPE } type Query { episode: Episode }', + * ); + * const enumValue = assertEnumType(schema.getType('Episode')).getValues()[0]; + * + * isEnumValue(enumValue); // => true + * isEnumValue(schema.getType('Episode')); // => false + * ``` + */ +export declare function isEnumValue(value: unknown): value is GraphQLEnumValue; +/** + * Returns the value as a GraphQLEnumValue, or throws if it is not one. + * @param value - Value to inspect. + * @returns The value typed as a GraphQLEnumValue. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType, assertEnumValue } from 'graphql/type'; + * + * const schema = buildSchema( + * 'enum Episode { NEW_HOPE } type Query { episode: Episode }', + * ); + * const enumValue = assertEnumValue( + * assertEnumType(schema.getType('Episode')).getValues()[0], + * ); + * + * enumValue.name; // => 'NEW_HOPE' + * assertEnumValue(schema.getType('Episode')); // throws an error + * ``` + */ +export declare function assertEnumValue(value: unknown): GraphQLEnumValue; +/** + * Returns true when the value is a GraphQLInputObjectType. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLInputObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * isInputObjectType(schema.getType('ReviewInput')); // => true + * isInputObjectType(schema.getType('Review')); // => false + * ``` + */ +export declare function isInputObjectType(type: unknown): type is GraphQLInputObjectType; +/** + * Returns the value as a GraphQLInputObjectType, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLInputObjectType. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * const inputType = assertInputObjectType(schema.getType('ReviewInput')); + * + * Object.keys(inputType.getFields()); // => ['stars'] + * assertInputObjectType(schema.getType('Review')); // throws an error + * ``` + */ +export declare function assertInputObjectType(type: unknown): GraphQLInputObjectType; +/** + * Returns true when the value is a resolved GraphQL input field definition. + * @param field - Value to inspect. + * @returns True when the value is a GraphQLInputField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType, isInputField } from 'graphql/type'; + * + * const schema = buildSchema( + * 'input ReviewInput { stars: Int } type Query { ok: Boolean }', + * ); + * const inputField = assertInputObjectType( + * schema.getType('ReviewInput'), + * ).getFields().stars; + * + * isInputField(inputField); // => true + * isInputField(schema.getQueryType()); // => false + * ``` + */ +export declare function isInputField(field: unknown): field is GraphQLInputField; +/** + * Returns the value as a GraphQLInputField, or throws if it is not one. + * @param field - Value to inspect. + * @returns The value typed as a GraphQLInputField. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputField, assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema( + * 'input ReviewInput { stars: Int } type Query { ok: Boolean }', + * ); + * const inputField = assertInputField( + * assertInputObjectType(schema.getType('ReviewInput')).getFields().stars, + * ); + * + * inputField.name; // => 'stars' + * assertInputField(schema.getQueryType()); // throws an error + * ``` + */ +export declare function assertInputField(field: unknown): GraphQLInputField; +/** + * Returns true when the value is a GraphQLList. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLList. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLList, GraphQLString, isListType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * tags: [String!]! + * } + * `); + * + * const tagsField = schema.getQueryType()?.getFields().tags; + * + * isListType(new GraphQLList(GraphQLString)); // => true + * isListType(GraphQLString); // => false + * isListType(tagsField?.type); // => false + * ``` + */ +export declare function isListType(type: GraphQLInputType): type is GraphQLList; +/** + * Returns true when the output type is a GraphQLList. + * @param type - The GraphQL output type to inspect. + * @returns True when the output type is a list type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { getNullableType, isListType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * tags: [String!]! + * } + * `); + * + * const tagsField = schema.getQueryType()?.getFields().tags; + * const nullableTagsType = getNullableType(tagsField?.type); + * + * isListType(nullableTagsType); // => true + * ``` + */ +export declare function isListType(type: GraphQLOutputType): type is GraphQLList; +/** + * Returns true when the value is a GraphQLList. + * @param type - The value to inspect. + * @returns True when the value is a list type. + * @example + * ```ts + * import { isListType } from 'graphql/type'; + * + * isListType('[String]'); // => false + * isListType(null); // => false + * ``` + */ +export declare function isListType(type: unknown): type is GraphQLList; +/** + * Returns the value as a GraphQLList, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLList. + * @example + * ```ts + * import { GraphQLList, GraphQLString, assertListType } from 'graphql/type'; + * + * const listType = assertListType(new GraphQLList(GraphQLString)); + * + * listType.ofType; // => GraphQLString + * assertListType(GraphQLString); // throws an error + * ``` + */ +export declare function assertListType(type: unknown): GraphQLList; +/** + * Returns true when the value is a GraphQLNonNull. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQLNonNull. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLNonNull, GraphQLString, isNonNullType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String! + * nickname: String + * } + * `); + * + * const fields = schema.getQueryType()?.getFields(); + * + * isNonNullType(new GraphQLNonNull(GraphQLString)); // => true + * isNonNullType(fields?.name.type); // => true + * isNonNullType(fields?.nickname.type); // => false + * ``` + */ +export declare function isNonNullType(type: GraphQLInputType): type is GraphQLNonNull; +/** + * Returns true when the output type is a GraphQLNonNull. + * @param type - The GraphQL output type to inspect. + * @returns True when the output type is a non-null type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isNonNullType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * name: String! + * nickname: String + * } + * `); + * + * const fields = schema.getQueryType()?.getFields(); + * + * isNonNullType(fields?.name.type); // => true + * isNonNullType(fields?.nickname.type); // => false + * ``` + */ +export declare function isNonNullType(type: GraphQLOutputType): type is GraphQLNonNull; +/** + * Returns true when the value is a GraphQLNonNull. + * @param type - The value to inspect. + * @returns True when the value is a non-null type. + * @example + * ```ts + * import { isNonNullType } from 'graphql/type'; + * + * isNonNullType('String!'); // => false + * isNonNullType(null); // => false + * ``` + */ +export declare function isNonNullType(type: unknown): type is GraphQLNonNull; +/** + * Returns the value as a GraphQLNonNull, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQLNonNull. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString, assertNonNullType } from 'graphql/type'; + * + * const nonNullType = assertNonNullType(new GraphQLNonNull(GraphQLString)); + * + * nonNullType.ofType; // => GraphQLString + * assertNonNullType(GraphQLString); // throws an error + * ``` + */ +export declare function assertNonNullType(type: unknown): GraphQLNonNull; +/** These types may be used as input types for arguments and directives. */ +export type GraphQLNullableInputType = GraphQLNamedInputType | GraphQLList; +/** These types may be used as input types for arguments and directives. */ +export type GraphQLInputType = GraphQLNullableInputType | GraphQLNonNull; +/** + * Returns true when the value can be used as a GraphQL input type. + * @param type - The GraphQL type to inspect. + * @returns True when the value can be used as a GraphQL input type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isInputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * isInputType(schema.getType('ReviewInput')); // => true + * isInputType(schema.getType('Review')); // => false + * ``` + */ +export declare function isInputType(type: unknown): type is GraphQLInputType; +/** + * Returns the value as a GraphQL input type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL input type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * const inputType = assertInputType(schema.getType('ReviewInput')); + * + * inputType.toString(); // => 'ReviewInput' + * assertInputType(schema.getType('Review')); // throws an error + * ``` + */ +export declare function assertInputType(type: unknown): GraphQLInputType; +/** These types may be used as output types as the result of fields. */ +export type GraphQLNullableOutputType = GraphQLNamedOutputType | GraphQLList; +/** These types may be used as output types as the result of fields. */ +export type GraphQLOutputType = GraphQLNullableOutputType | GraphQLNonNull; +/** + * Returns true when the value can be used as a GraphQL output type. + * @param type - The GraphQL type to inspect. + * @returns True when the value can be used as a GraphQL output type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isOutputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * isOutputType(schema.getType('Review')); // => true + * isOutputType(schema.getType('ReviewInput')); // => false + * ``` + */ +export declare function isOutputType(type: unknown): type is GraphQLOutputType; +/** + * Returns the value as a GraphQL output type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL output type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertOutputType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * review(input: ReviewInput): Review + * } + * `); + * + * const outputType = assertOutputType(schema.getType('Review')); + * + * outputType.toString(); // => 'Review' + * assertOutputType(schema.getType('ReviewInput')); // throws an error + * ``` + */ +export declare function assertOutputType(type: unknown): GraphQLOutputType; +/** These types may describe types which may be leaf values. */ +export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; +/** + * Returns true when the value is a GraphQL scalar or enum type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL scalar or enum type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isLeafType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * episode: Episode + * review: Review + * } + * `); + * + * isLeafType(schema.getType('Episode')); // => true + * isLeafType(schema.getType('String')); // => true + * isLeafType(schema.getType('Review')); // => false + * ``` + */ +export declare function isLeafType(type: unknown): type is GraphQLLeafType; +/** + * Returns the value as a GraphQL leaf type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL leaf type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertLeafType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Review { + * stars: Int! + * } + * + * type Query { + * episode: Episode + * review: Review + * } + * `); + * + * const episodeType = assertLeafType(schema.getType('Episode')); + * + * episodeType.toString(); // => 'Episode' + * assertLeafType(schema.getType('Review')); // throws an error + * ``` + */ +export declare function assertLeafType(type: unknown): GraphQLLeafType; +/** These types may describe the parent context of a selection set. */ +export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; +/** + * Returns true when the value is a GraphQL object, interface, or union type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL object, interface, or union type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isCompositeType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * union SearchResult = User + * + * type Query { + * node: Node + * search: [SearchResult] + * } + * `); + * + * isCompositeType(schema.getType('User')); // => true + * isCompositeType(schema.getType('Node')); // => true + * isCompositeType(schema.getType('SearchResult')); // => true + * isCompositeType(schema.getType('String')); // => false + * ``` + */ +export declare function isCompositeType(type: unknown): type is GraphQLCompositeType; +/** + * Returns the value as a GraphQL composite type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL composite type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertCompositeType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const userType = assertCompositeType(schema.getType('User')); + * + * userType.toString(); // => 'User' + * assertCompositeType(schema.getType('String')); // throws an error + * ``` + */ +export declare function assertCompositeType(type: unknown): GraphQLCompositeType; +/** These types may describe the parent context of a selection set. */ +export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; +/** + * Returns true when the value is a GraphQL interface or union type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL interface or union type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { isAbstractType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * union SearchResult = User + * + * type Query { + * node: Node + * search: [SearchResult] + * } + * `); + * + * isAbstractType(schema.getType('Node')); // => true + * isAbstractType(schema.getType('SearchResult')); // => true + * isAbstractType(schema.getType('User')); // => false + * ``` + */ +export declare function isAbstractType(type: unknown): type is GraphQLAbstractType; +/** + * Returns the value as a GraphQL abstract type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL abstract type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertAbstractType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const nodeType = assertAbstractType(schema.getType('Node')); + * + * nodeType.toString(); // => 'Node' + * assertAbstractType(schema.getType('User')); // throws an error + * ``` + */ +export declare function assertAbstractType(type: unknown): GraphQLAbstractType; +/** + * List Type Wrapper + * + * A list is a wrapping type which points to another type. + * Lists are often created within the context of defining the fields of + * an object type. + * @typeParam T - The GraphQL type wrapped by this list type. + * @example + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: new GraphQLList(PersonType) }, + * children: { type: new GraphQLList(PersonType) }, + * }), + * }); + * ``` + */ +export declare class GraphQLList implements GraphQLSchemaElement { + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; + private readonly __GraphQLListTypeBrand; + /** + * Creates a GraphQLList instance. + * @param ofType - The type to wrap. + * @example + * ```ts + * import { GraphQLList, GraphQLString } from 'graphql/type'; + * + * const stringList = new GraphQLList(GraphQLString); + * + * stringList.ofType; // => GraphQLString + * String(stringList); // => '[String]' + * ``` + */ + constructor(ofType: T); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns this wrapping type as a GraphQL type-reference string. + * @returns The GraphQL type-reference string. + * @example + * ```ts + * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const stringList = new GraphQLList(GraphQLString); + * const requiredStringList = new GraphQLList(new GraphQLNonNull(GraphQLString)); + * + * stringList.toString(); // => '[String]' + * requiredStringList.toString(); // => '[String!]' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLList, GraphQLString } from 'graphql/type'; + * + * const stringList = new GraphQLList(GraphQLString); + * + * stringList.toJSON(); // => '[String]' + * JSON.stringify({ type: stringList }); // => '{"type":"[String]"}' + * ``` + */ + toJSON(): string; +} +/** + * Non-Null Type Wrapper + * + * A non-null is a wrapping type which points to another type. + * Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * @typeParam T - The nullable GraphQL type wrapped by this non-null type. + * @example + * ```ts + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: new GraphQLNonNull(GraphQLString) }, + * }), + * }); + * ``` + * + * Note: the enforcement of non-nullability occurs within the executor. + */ +export declare class GraphQLNonNull implements GraphQLSchemaElement { + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; + private readonly __GraphQLNonNullTypeBrand; + /** + * Creates a GraphQLNonNull instance. + * @param ofType - The type to wrap. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * + * requiredString.ofType; // => GraphQLString + * String(requiredString); // => 'String!' + * ``` + */ + constructor(ofType: T); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns this wrapping type as a GraphQL type-reference string. + * @returns The GraphQL type-reference string. + * @example + * ```ts + * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString)); + * + * requiredString.toString(); // => 'String!' + * requiredStringList.toString(); // => '[String]!' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * + * requiredString.toJSON(); // => 'String!' + * JSON.stringify({ type: requiredString }); // => '{"type":"String!"}' + * ``` + */ + toJSON(): string; +} +/** These types wrap and modify other types */ +export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; +/** + * Returns true when the value is a GraphQL list or non-null wrapper type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL list or non-null wrapper type. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * isWrappingType, + * } from 'graphql/type'; + * + * isWrappingType(new GraphQLList(GraphQLString)); // => true + * isWrappingType(new GraphQLNonNull(GraphQLString)); // => true + * isWrappingType(GraphQLString); // => false + * ``` + */ +export declare function isWrappingType(type: unknown): type is GraphQLWrappingType; +/** + * Returns the value as a GraphQL wrapping type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL wrapping type. + * @example + * ```ts + * import { GraphQLList, GraphQLString, assertWrappingType } from 'graphql/type'; + * + * const wrappingType = assertWrappingType(new GraphQLList(GraphQLString)); + * + * wrappingType.toString(); // => '[String]' + * assertWrappingType(GraphQLString); // throws an error + * ``` + */ +export declare function assertWrappingType(type: unknown): GraphQLWrappingType; +/** These types can all accept null as a value. */ +export type GraphQLNullableType = GraphQLNamedType | GraphQLList; +/** + * Returns true when the value is a GraphQL type that can accept null. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL type that can accept null. + * @example + * ```ts + * import { GraphQLNonNull, GraphQLString, isNullableType } from 'graphql/type'; + * + * isNullableType(GraphQLString); // => true + * isNullableType(new GraphQLNonNull(GraphQLString)); // => false + * isNullableType(null); // => false + * ``` + */ +export declare function isNullableType(type: unknown): type is GraphQLNullableType; +/** + * Returns the value as a nullable GraphQL type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a nullable GraphQL type. + * @example + * ```ts + * import { + * GraphQLNonNull, + * GraphQLString, + * assertNullableType, + * } from 'graphql/type'; + * + * const nullableType = assertNullableType(GraphQLString); + * + * nullableType; // => GraphQLString + * assertNullableType(new GraphQLNonNull(GraphQLString)); // throws an error + * ``` + */ +export declare function assertNullableType(type: unknown): GraphQLNullableType; +/** + * Returns the nullable type. + * @param type - The GraphQL type to inspect. + * @returns The nullable type after removing one non-null wrapper, if present. + * @example + * ```ts + * import { getNullableType } from 'graphql/type'; + * + * getNullableType(null); // => undefined + * getNullableType(undefined); // => undefined + * ``` + */ +export declare function getNullableType(type: undefined | null): void; +/** + * Returns the nullable type after removing one non-null wrapper. + * @param type - A nullable type or non-null wrapper. + * @returns The nullable type after removing one non-null wrapper, if present. + * @typeParam T - The nullable GraphQL type returned after removing one non-null wrapper. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * getNullableType, + * } from 'graphql/type'; + * + * const requiredString = new GraphQLNonNull(GraphQLString); + * const stringList = new GraphQLList(GraphQLString); + * + * getNullableType(requiredString); // => GraphQLString + * getNullableType(stringList); // => stringList + * ``` + */ +export declare function getNullableType(type: T | GraphQLNonNull): T; +/** + * Returns the nullable type after removing one non-null wrapper. + * @param type - The GraphQL type to inspect. + * @returns The nullable type after removing one non-null wrapper, if present. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * getNullableType, + * } from 'graphql/type'; + * + * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString)); + * + * getNullableType(requiredStringList).toString(); // => '[String]' + * getNullableType(GraphQLString); // => GraphQLString + * ``` + */ +export declare function getNullableType(type: Maybe): GraphQLNullableType | undefined; +/** These named types do not include modifiers like List or NonNull. */ +export type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType; +/** A named GraphQL type that can be used as an input type. */ +export type GraphQLNamedInputType = GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType; +/** A named GraphQL type that can be used as an output type. */ +export type GraphQLNamedOutputType = GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType; +/** + * Returns true when the value is a GraphQL named type. + * @param type - The GraphQL type to inspect. + * @returns True when the value is a GraphQL named type. + * @example + * ```ts + * import { GraphQLList, GraphQLString, isNamedType } from 'graphql/type'; + * + * isNamedType(GraphQLString); // => true + * isNamedType(new GraphQLList(GraphQLString)); // => false + * isNamedType(null); // => false + * ``` + */ +export declare function isNamedType(type: unknown): type is GraphQLNamedType; +/** + * Returns the value as a GraphQL named type, or throws if it is not one. + * @param type - The GraphQL type to inspect. + * @returns The value typed as a GraphQL named type. + * @example + * ```ts + * import { GraphQLList, GraphQLString, assertNamedType } from 'graphql/type'; + * + * const namedType = assertNamedType(GraphQLString); + * + * namedType.name; // => 'String' + * assertNamedType(new GraphQLList(GraphQLString)); // throws an error + * ``` + */ +export declare function assertNamedType(type: unknown): GraphQLNamedType; +/** + * Returns the named type. + * @param type - The GraphQL type to inspect. + * @returns The named type after unwrapping all list and non-null wrappers. + * @example + * ```ts + * import { getNamedType } from 'graphql/type'; + * + * getNamedType(null); // => undefined + * getNamedType(undefined); // => undefined + * ``` + */ +export declare function getNamedType(type: undefined | null): void; +/** + * Returns the named input type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL input type to inspect. + * @returns The named input type after unwrapping all wrappers. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { getNamedType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Query { + * review(input: [ReviewInput!]!): Boolean + * } + * `); + * + * const inputArg = schema.getQueryType()?.getFields().review.args[0]; + * + * getNamedType(inputArg?.type).toString(); // => 'ReviewInput' + * ``` + */ +export declare function getNamedType(type: GraphQLInputType): GraphQLNamedInputType; +/** + * Returns the named output type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL output type to inspect. + * @returns The named output type after unwrapping all wrappers. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { getNamedType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * users: [User!]! + * } + * `); + * + * const usersField = schema.getQueryType()?.getFields().users; + * + * getNamedType(usersField?.type).toString(); // => 'User' + * ``` + */ +export declare function getNamedType(type: GraphQLOutputType): GraphQLNamedOutputType; +/** + * Returns the named type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL type to inspect. + * @returns The named type after unwrapping all wrappers. + * @example + * ```ts + * import { + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * getNamedType, + * } from 'graphql/type'; + * + * const nestedType = new GraphQLNonNull( + * new GraphQLList(new GraphQLNonNull(GraphQLString)), + * ); + * + * getNamedType(nestedType); // => GraphQLString + * ``` + */ +export declare function getNamedType(type: GraphQLType): GraphQLNamedType; +/** + * Returns the named type after unwrapping all list and non-null wrappers. + * @param type - The GraphQL type to inspect. + * @returns The named type after unwrapping all wrappers, or undefined for nullish input. + * @example + * ```ts + * import { GraphQLList, GraphQLString, getNamedType } from 'graphql/type'; + * + * getNamedType(new GraphQLList(GraphQLString)); // => GraphQLString + * getNamedType(undefined); // => undefined + * ``` + */ +export declare function getNamedType(type: Maybe): GraphQLNamedType | undefined; +/** + * An interface for all Schema Elements. + * + * @internal + */ +export interface GraphQLSchemaElement { + toString: () => string; + toJSON: () => string; +} +/** + * Used while defining GraphQL types to allow for circular references in + * otherwise immutable type definitions. + * @typeParam T - The element type returned by the thunk or array. + */ +export type ThunkReadonlyArray = (() => ReadonlyArray) | ReadonlyArray; +/** + * A thunk that resolves to an object map. + * @typeParam T - Value type stored in the object map. + */ +export type ThunkObjMap = (() => ObjMap) | ObjMap; +/** + * Resolves a thunked readonly array. + * @param thunk - The thunk or value to resolve. + * @returns The resolved readonly array. + * @typeParam T - The element type resolved from the thunk or array. + * @example + * ```ts + * import { GraphQLString, resolveReadonlyArrayThunk } from 'graphql/type'; + * + * const lazyFields = resolveReadonlyArrayThunk(() => [GraphQLString]); + * const fields = resolveReadonlyArrayThunk([GraphQLString]); + * + * lazyFields; // => [GraphQLString] + * fields; // => [GraphQLString] + * ``` + */ +export declare function resolveReadonlyArrayThunk(thunk: ThunkReadonlyArray): ReadonlyArray; +/** + * Resolves a thunked object map. + * @param thunk - The thunk or value to resolve. + * @returns The resolved object map. + * @typeParam T - The object-map value type resolved from the thunk or map. + * @example + * ```ts + * import { GraphQLString, resolveObjMapThunk } from 'graphql/type'; + * + * const lazyFields = resolveObjMapThunk(() => ({ name: GraphQLString })); + * const fields = resolveObjMapThunk({ name: GraphQLString }); + * + * lazyFields.name; // => GraphQLString + * fields.name; // => GraphQLString + * ``` + */ +export declare function resolveObjMapThunk(thunk: ThunkObjMap): ObjMap; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLScalarTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Scalar Type Definition + * + * Scalar types define the leaf values of a GraphQL response and the input + * values accepted by arguments and input object fields. A scalar type has a + * name and coercion functions that validate and convert runtime values and + * GraphQL literals. + * + * If a type's coerceOutputValue function returns `null` or does not return a + * value (i.e. it returns `undefined`) then an error will be raised and a + * `null` value will be returned in the response. Prefer validating inputs + * before execution so clients receive input diagnostics before result coercion + * fails. + * Custom scalar behavior is defined via the following functions: + * + * - coerceOutputValue(value): Implements "Result Coercion". Given an internal value, + * produces an external value valid for this type. Returns undefined or + * throws an error to indicate invalid values. + * + * - coerceInputValue(value): Implements "Input Coercion" for values. Given an + * external value (for example, variable values), produces an internal value + * valid for this type. Returns undefined or throws an error to indicate + * invalid values. + * + * - coerceInputLiteral(ast): Implements "Input Coercion" for constant literals. + * Given a GraphQL literal (AST) (for example, an argument value), produces + * an internal value valid for this type. Returns undefined or throws an + * error to indicate invalid values. + * + * - valueToLiteral(value): Converts an external value to a GraphQL + * literal (AST). Returns undefined or throws an error to indicate + * invalid values. + * + * Deprecated, to be removed in v18: + * + * - serialize(value): Implements "Result Coercion". Renamed to + * `coerceOutputValue()`. + * + * - parseValue(value): Implements "Input Coercion" for values. Renamed to + * `coerceInputValue()`. + * + * - parseLiteral(ast): Implements "Input Coercion" for literals including + * non-specified replacement of variables embedded within complex scalars. + * Replaced by the combination of the `replaceVariables()` utility and the + * `coerceInputLiteral()` method. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @typeParam TExternal - External representation accepted from or returned to callers. + * @example + * ```ts + * import { GraphQLScalarType, Kind } from 'graphql'; + * + * const ensureOdd = (value) => { + * if (!Number.isFinite(value)) { + * throw new Error( + * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`, + * ); + * } + * + * if (value % 2 === 0) { + * throw new Error( + * `Scalar "Odd" cannot represent "${value}" since it is even.`, + * ); + * } + * + * return value; + * }; + * + * const OddType = new GraphQLScalarType({ + * name: 'Odd', + * coerceOutputValue: (value) => { + * return ensureOdd(value); + * }, + * coerceInputValue: (value) => { + * return ensureOdd(value); + * }, + * valueToLiteral: (value) => { + * return { kind: Kind.INT, value: String(ensureOdd(value)) }; + * }, + * }); + * ``` + */ +export declare class GraphQLScalarType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** URL identifying the behavior specified for this custom scalar. */ + specifiedByURL: Maybe; + /** + * Deprecated legacy serializer used to convert internal values for response + * output. Use `coerceOutputValue()` instead. + * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 + */ + serialize: GraphQLScalarSerializer; + /** + * Deprecated legacy parser used to convert externally provided input values. + * Use `coerceInputValue()` instead. + * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 + */ + parseValue: GraphQLScalarValueParser; + /** + * Deprecated legacy parser used to convert externally provided input + * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead. + * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 + */ + parseLiteral: GraphQLScalarLiteralParser; + /** Coercer used to convert internal scalar values for response output. */ + coerceOutputValue: GraphQLScalarOutputValueCoercer; + /** Coercer used to convert externally provided scalar input values. */ + coerceInputValue: GraphQLScalarInputValueCoercer; + /** Coercer used to convert GraphQL scalar input literals. */ + coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined; + /** Converter used to produce GraphQL literals from runtime input values. */ + valueToLiteral: GraphQLScalarValueToLiteral | undefined; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** + * Creates a GraphQLScalarType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { Kind, parse } from 'graphql/language'; + * import { GraphQLScalarType } from 'graphql/type'; + * + * const document = parse(` + * "Odd integer values." + * scalar Odd @specifiedBy(url: "https://example.com/odd") + * + * extend scalar Odd @specifiedBy(url: "https://example.com/odd-v2") + * `); + * + * const Odd = new GraphQLScalarType({ + * name: 'Odd', + * description: 'Odd integer values.', + * specifiedByURL: 'https://example.com/odd', + * coerceOutputValue: (value) => { + * if (typeof value !== 'number' || value % 2 === 0) { + * throw new TypeError('Odd can only produce odd numbers.'); + * } + * return value; + * }, + * coerceInputValue: (value) => { + * if (typeof value !== 'number' || value % 2 === 0) { + * throw new TypeError('Odd can only accept odd numbers.'); + * } + * return value; + * }, + * coerceInputLiteral: (ast) => { + * if (ast.kind !== Kind.INT) { + * throw new TypeError('Odd can only accept integer literals.'); + * } + * const value = Number(ast.value); + * if (value % 2 === 0) { + * throw new TypeError('Odd can only accept odd integer literals.'); + * } + * return value; + * }, + * valueToLiteral: (value) => { + * return { kind: Kind.INT, value: String(ensureOdd(value)) }; + * }, + * extensions: { numeric: true }, + * astNode: document.definitions[0], + * extensionASTNodes: [document.definitions[1]], + * }); + * + * Odd.description; // => 'Odd integer values.' + * Odd.specifiedByURL; // => 'https://example.com/odd' + * Odd.coerceOutputValue(3); // => 3 + * Odd.coerceInputValue(5); // => 5 + * Odd.extensions; // => { numeric: true } + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLScalarType } from 'graphql/type'; + * + * const Url = new GraphQLScalarType({ + * name: 'Url', + * description: 'An absolute URL string.', + * specifiedByURL: 'https://url.spec.whatwg.org/', + * }); + * + * const config = Url.toConfig(); + * const UrlCopy = new GraphQLScalarType(config); + * + * config.name; // => 'Url' + * config.specifiedByURL; // => 'https://url.spec.whatwg.org/' + * UrlCopy.name; // => Url.name + * ``` + */ + toConfig(): GraphQLScalarTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this scalar type. + * @returns The schema coordinate for this scalar type. + * @example + * ```ts + * import { GraphQLScalarType } from 'graphql/type'; + * + * const DateTime = new GraphQLScalarType({ name: 'DateTime' }); + * + * DateTime.toString(); // => 'DateTime' + * String(DateTime); // => 'DateTime' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLScalarType } from 'graphql/type'; + * + * const DateTime = new GraphQLScalarType({ name: 'DateTime' }); + * + * DateTime.toJSON(); // => 'DateTime' + * JSON.stringify({ type: DateTime }); // => '{"type":"DateTime"}' + * ``` + */ + toJSON(): string; +} +/** + * Deprecated function type that serializes a runtime value as a scalar output + * value. Use `GraphQLScalarOutputValueCoercer` instead. + * @typeParam TExternal - External representation accepted from or returned to callers. + * @deprecated Use GraphQLScalarOutputValueCoercer instead. Will be removed in v18. + */ +export type GraphQLScalarSerializer = (outputValue: unknown) => TExternal; +/** + * Function used to coerce internal scalar values for response output. + * @typeParam TExternal - External representation accepted from or returned to callers. + */ +export type GraphQLScalarOutputValueCoercer = (outputValue: unknown) => TExternal; +/** + * Deprecated function type that parses a runtime input value as a scalar input + * value. Use `GraphQLScalarInputValueCoercer` instead. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @deprecated Use GraphQLScalarInputValueCoercer instead. Will be removed in v18. + */ +export type GraphQLScalarValueParser = (inputValue: unknown) => TInternal; +/** + * Function used to coerce externally provided scalar input values. + * @typeParam TInternal - Internal runtime representation for this scalar. + */ +export type GraphQLScalarInputValueCoercer = (inputValue: unknown) => TInternal; +/** + * Deprecated function type that parses a GraphQL value literal as a scalar + * input value. Use `GraphQLScalarInputLiteralCoercer` instead. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @deprecated Use GraphQLScalarInputLiteralCoercer instead. Will be removed in v18. + */ +export type GraphQLScalarLiteralParser = (valueNode: ValueNode, variables: Maybe>) => Maybe; +/** + * Function used to coerce GraphQL scalar input literals. + * @typeParam TInternal - Internal runtime representation for this scalar. + */ +export type GraphQLScalarInputLiteralCoercer = (valueNode: ConstValueNode) => Maybe; +/** @internal */ +export type GraphQLScalarValueToLiteral = (inputValue: unknown) => ConstValueNode | undefined; +/** + * Configuration used to construct a GraphQLScalarType. + * @typeParam TInternal - Internal runtime representation for this scalar. + * @typeParam TExternal - External representation accepted from or returned to callers. + */ +export interface GraphQLScalarTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** URL identifying the behavior specified for this custom scalar. */ + specifiedByURL?: Maybe; + /** + * Deprecated legacy serializer used to convert internal values for response + * output. Use `coerceOutputValue()` instead. + * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 + */ + serialize?: GraphQLScalarSerializer | undefined; + /** + * Deprecated legacy parser used to convert externally provided input values. + * Use `coerceInputValue()` instead. + * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 + */ + parseValue?: GraphQLScalarValueParser | undefined; + /** + * Deprecated legacy parser used to convert externally provided input + * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead. + * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 + */ + parseLiteral?: GraphQLScalarLiteralParser | undefined; + /** Coerces an internal value to include in a response. */ + coerceOutputValue?: GraphQLScalarOutputValueCoercer | undefined; + /** Coerces an externally provided value to use as an input. */ + coerceInputValue?: GraphQLScalarInputValueCoercer | undefined; + /** Coerces an externally provided const literal value to use as an input. */ + coerceInputLiteral?: GraphQLScalarInputLiteralCoercer | undefined; + /** Translates an externally provided value to a literal (AST). */ + valueToLiteral?: GraphQLScalarValueToLiteral | undefined; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLScalarTypeNormalizedConfig extends GraphQLScalarTypeConfig { + serialize: GraphQLScalarSerializer; + parseValue: GraphQLScalarValueParser; + parseLiteral: GraphQLScalarLiteralParser; + coerceOutputValue: GraphQLScalarOutputValueCoercer; + coerceInputValue: GraphQLScalarInputValueCoercer; + coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + * We've provided these template arguments because this is an open type and + * you may find them useful. + * @typeParam _TSource - Reserved source type parameter for extension typing. + * @typeParam _TContext - Reserved context type parameter for extension typing. + */ +export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> { + [attributeName: string | symbol]: unknown; +} +/** + * Object Type Definition + * + * Almost all of the GraphQL types you define will be object types. Object types + * have a name, but most importantly describe their fields. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TAbstract - Runtime value type used for abstract type resolution. + * @example + * ```ts + * const AddressType = new GraphQLObjectType({ + * name: 'Address', + * fields: { + * street: { type: GraphQLString }, + * number: { type: GraphQLInt }, + * formatted: { + * type: GraphQLString, + * resolve: (obj) => { + * return obj.number + ' ' + obj.street; + * }, + * }, + * }, + * }); + * ``` + * @example + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. + * + * ```ts + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * name: { type: GraphQLString }, + * bestFriend: { type: PersonType }, + * }), + * }); + * ``` + */ +export declare class GraphQLObjectType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Predicate used to determine whether a runtime value belongs to this object type. */ + isTypeOf: Maybe>; + /** Custom extension fields reserved for users. */ + extensions: Readonly>; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _fields; + private _interfaces; + /** + * Creates a GraphQLObjectType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * // Configure an object type with interfaces, fields, arguments, and metadata. + * import { parse } from 'graphql/language'; + * import { + * GraphQLID, + * GraphQLInterfaceType, + * GraphQLNonNull, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const document = parse(` + * type User implements Node { + * id: ID! + * name(format: String = "short"): String + * } + * + * extend type User { + * displayName: String + * } + * `); + * const definition = document.definitions[0]; + * const nameField = definition.fields[1]; + * const formatArg = nameField.arguments[0]; + * + * const Node = new GraphQLInterfaceType({ + * name: 'Node', + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * }); + * + * const User = new GraphQLObjectType({ + * name: 'User', + * description: 'A registered user.', + * interfaces: [Node], + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * name: { + * description: 'The formatted user name.', + * type: GraphQLString, + * args: { + * format: { + * description: 'Controls the name format.', + * type: GraphQLString, + * default: { value: 'short' }, + * deprecationReason: 'Use locale instead.', + * extensions: { public: true }, + * astNode: formatArg, + * }, + * }, + * resolve: (user, { format }) => { + * return format === 'long' ? user.fullName : user.name; + * }, + * deprecationReason: 'Use displayName.', + * extensions: { cacheSeconds: 60 }, + * astNode: nameField, + * }, + * }, + * isTypeOf: (value) => { + * return typeof value === 'object' && value != null && 'id' in value; + * }, + * extensions: { entity: 'User' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * }); + * + * User.name; // => 'User' + * User.getInterfaces(); // => [Node] + * Object.keys(User.getFields()); // => ['id', 'name'] + * User.getFields().name.args[0].default.value; // => 'short' + * User.extensions; // => { entity: 'User' } + * ``` + * @example + * ```ts + * // This variant configures a subscription field with subscribe and resolve functions. + * import { GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Subscription = new GraphQLObjectType({ + * name: 'Subscription', + * fields: { + * greeting: { + * type: GraphQLString, + * subscribe: async function* () { + * yield { greeting: 'Hello!' }; + * }, + * resolve: (event) => { + * return event.greeting; + * }, + * }, + * }, + * }); + * + * typeof Subscription.getFields().greeting.subscribe; // => 'function' + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the fields defined by this type. + * @returns The fields keyed by field name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type User { + * id: ID! + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const User = assertObjectType(schema.getType('User')); + * const fields = User.getFields(); + * + * Object.keys(fields); // => ['id', 'name'] + * String(fields.id.type); // => 'ID!' + * ``` + */ + getFields(): GraphQLFieldMap; + /** + * Returns the interfaces implemented by this type. + * @returns The implemented interfaces. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const User = assertObjectType(schema.getType('User')); + * + * User.getInterfaces().map((type) => type.name); // => ['Node'] + * ``` + */ + getInterfaces(): ReadonlyArray; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const User = new GraphQLObjectType({ + * name: 'User', + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const config = User.toConfig(); + * const UserCopy = new GraphQLObjectType(config); + * + * config.fields.name.type; // => GraphQLString + * UserCopy.getFields().name.type; // => GraphQLString + * ``` + */ + toConfig(): GraphQLObjectTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this object type. + * @returns The schema coordinate for this object type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const User = assertObjectType(schema.getType('User')); + * + * User.toString(); // => 'User' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const User = new GraphQLObjectType({ + * name: 'User', + * fields: { name: { type: GraphQLString } }, + * }); + * + * User.toJSON(); // => 'User' + * JSON.stringify({ type: User }); // => '{"type":"User"}' + * ``` + */ + toJSON(): string; +} +/** + * Configuration used to construct a GraphQLObjectType. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TAbstract - Runtime value type used for abstract type resolution. + */ +export interface GraphQLObjectTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Interfaces implemented by this object or interface type. */ + interfaces?: ThunkReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + fields: ThunkObjMap>; + /** Predicate used to determine whether a runtime value belongs to this object type. */ + isTypeOf?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLObjectTypeNormalizedConfig extends GraphQLObjectTypeConfig { + interfaces: ReadonlyArray; + fields: GraphQLFieldNormalizedConfigMap; + extensions: Readonly>; + extensionASTNodes: ReadonlyArray; +} +/** + * Resolves the concrete object type for an abstract GraphQL type. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLTypeResolver = (value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: GraphQLAbstractType) => PromiseOrValue; +/** + * Checks whether a runtime value belongs to a GraphQL object type. + * @typeParam TAbstract - Runtime value type used for abstract type resolution. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLIsTypeOfFn = (value: TAbstract, context: TContext, info: GraphQLResolveInfo) => PromiseOrValue; +/** + * Resolves the runtime value for a GraphQL field. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TArgs - Argument object type passed to resolvers. + * @typeParam TResult - Result value type. + */ +export type GraphQLFieldResolver = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult; +/** Utilities available from resolver info for tracking asynchronous work. */ +export interface GraphQLResolveInfoHelpers { + /** + * Promise.all wrapper that allows rejected branches to be tracked + * as execution async work. + * + * Intended use: return or await this promise from resolver work. + * Un-awaited async side effects are an anti-pattern: + * + * const { promiseAll } = info.getAsyncHelpers(); + * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined); + * + * In that anti-pattern, tracking starts only after rejection (on a + * later microtask), so this work is not guaranteed to delay + * `hooks.asyncWorkFinished`. + * + * Use `track(...)` for un-awaited async side effects: + * + * const { track } = info.getAsyncHelpers(); + * track([ + * someAsyncWork().catch(() => undefined), + * someOtherAsyncWork().catch(() => undefined) + * ]); + */ + readonly promiseAll: (values: ReadonlyArray | T>) => Promise>; + /** Tracks asynchronous work that should delay execution completion hooks. */ + readonly track: (maybePromises: ReadonlyArray) => void; +} +/** Information about the currently executing GraphQL field. */ +export interface GraphQLResolveInfo { + /** The field name referenced by this schema coordinate. */ + readonly fieldName: string; + /** AST field nodes that contributed to the current field execution. */ + readonly fieldNodes: ReadonlyArray; + /** GraphQL output type declared for the current field. */ + readonly returnType: GraphQLOutputType; + /** Object type that owns the current field. */ + readonly parentType: GraphQLObjectType; + /** Response path where this error occurred during execution. */ + readonly path: Path; + /** The schema used for validation or execution. */ + readonly schema: GraphQLSchema; + /** Fragment definitions in the operation document keyed by fragment name. */ + readonly fragments: ObjMap; + /** Initial root value passed to the operation. */ + readonly rootValue: unknown; + /** The operation selected for execution. */ + readonly operation: OperationDefinitionNode; + /** + * Coerced variable values and source metadata for this operation. Resolver + * code that needs runtime variable values should read `variableValues.coerced`. + */ + readonly variableValues: VariableValues; + /** Returns the AbortSignal supplied for this execution, if any. */ + readonly getAbortSignal: () => AbortSignal | undefined; + /** Returns helper functions for tracking asynchronous resolver work. */ + readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + * We've provided these template arguments because this is an open type and + * you may find them useful. + * @typeParam _TSource - Reserved source type parameter for extension typing. + * @typeParam _TContext - Reserved context type parameter for extension typing. + * @typeParam _TArgs - Reserved argument type parameter for extension typing. + */ +export interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> { + [attributeName: string | symbol]: unknown; +} +/** + * Configuration used to define a GraphQL field. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TArgs - Argument object type passed to resolvers. + */ +export interface GraphQLFieldConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLOutputType; + /** Arguments accepted by this field or directive. */ + args?: GraphQLFieldConfigArgumentMap | undefined; + /** Resolver function used to produce this field value. */ + resolve?: GraphQLFieldResolver | undefined; + /** Resolver function used to create a subscription event stream for this field. */ + subscribe?: GraphQLFieldResolver | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** @internal */ +export interface GraphQLFieldNormalizedConfig extends GraphQLFieldConfig { + args: GraphQLFieldNormalizedConfigArgumentMap; + extensions: Readonly>; +} +/** A map of argument names to argument configuration objects. */ +export type GraphQLFieldConfigArgumentMap = ObjMap; +/** @internal */ +export type GraphQLFieldNormalizedConfigArgumentMap = ObjMap; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLArgumentExtensions { + [attributeName: string | symbol]: unknown; +} +/** Configuration used to define a GraphQL argument. */ +export interface GraphQLArgumentConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value for this argument. Use `default` instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue?: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default?: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** @internal */ +export interface GraphQLArgumentNormalizedConfig extends GraphQLArgumentConfig { + default: GraphQLDefaultInput | undefined; + extensions: Readonly; +} +/** + * A map of field names to field configuration objects. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLFieldConfigMap = ObjMap>; +/** @internal */ +export type GraphQLFieldNormalizedConfigMap = ObjMap>; +/** + * A resolved GraphQL field definition. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @typeParam TArgs - Argument object type passed to resolvers. + */ +export declare class GraphQLField implements GraphQLSchemaElement { + /** Object or interface type that owns this field, if known. */ + parentType: GraphQLObjectType | GraphQLInterfaceType | undefined; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLOutputType; + /** Arguments accepted by this field or directive. */ + args: ReadonlyArray; + /** Resolver function used to produce this field value. */ + resolve?: GraphQLFieldResolver | undefined; + /** Resolver function used to create a subscription event stream for this field. */ + subscribe?: GraphQLFieldResolver | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly>; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL field definition. + * @param parentType - Object or interface type that owns this field, if known. + * @param name - Field name. + * @param config - Field configuration. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const document = parse('type Query { greeting: String }'); + * const fieldNode = document.definitions[0].fields[0]; + * const field = new GraphQLField(Query, 'greeting', { + * description: 'Greeting text.', + * type: GraphQLString, + * args: { + * name: { type: GraphQLString, default: { value: 'world' } }, + * }, + * resolve: (_source, { name }) => `Hello, ${name}!`, + * subscribe: async function* () { + * yield { greeting: 'Hello!' }; + * }, + * deprecationReason: 'Use hello.', + * extensions: { cacheSeconds: 60 }, + * astNode: fieldNode, + * }); + * + * field.parentType; // => Query + * field.name; // => 'greeting' + * field.args[0].default.value; // => 'world' + * typeof field.subscribe; // => 'function' + * field.deprecationReason; // => 'Use hello.' + * field.astNode; // => fieldNode + * ``` + */ + constructor(parentType: GraphQLObjectType | GraphQLInterfaceType | undefined, name: string, config: GraphQLFieldConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this field. + * @returns A configuration object that can be used to recreate this field. + * @example + * ```ts + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { + * type: GraphQLString, + * extensions: { cacheSeconds: 60 }, + * }); + * + * field.toConfig().type; // => GraphQLString + * field.toConfig().extensions; // => { cacheSeconds: 60 } + * ``` + */ + toConfig(): GraphQLFieldNormalizedConfig; + /** + * Returns this field as a schema coordinate string. + * @returns The field coordinate. + * @example + * ```ts + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * + * field.toString(); // => 'Query.greeting' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The field coordinate. + * @example + * ```ts + * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * + * JSON.stringify(field); // => '"Query.greeting"' + * ``` + */ + toJSON(): string; +} +/** A resolved GraphQL argument definition. */ +export declare class GraphQLArgument implements GraphQLSchemaElement { + /** Field or directive that owns this argument. */ + parent: GraphQLField | GraphQLDirective; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value used when no explicit value is supplied. + * Use `default` instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL argument definition. + * @param parent - Field or directive that owns this argument. + * @param name - Argument name. + * @param config - Argument configuration. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { + * type: GraphQLString, + * default: { value: 'world' }, + * }); + * + * arg.parent; // => field + * arg.name; // => 'name' + * arg.default.value; // => 'world' + * ``` + */ + constructor(parent: GraphQLField | GraphQLDirective, name: string, config: GraphQLArgumentConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this argument. + * @returns A configuration object that can be used to recreate this argument. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { + * type: GraphQLString, + * default: { value: 'world' }, + * }); + * + * arg.toConfig().default.value; // => 'world' + * ``` + */ + toConfig(): GraphQLArgumentNormalizedConfig; + /** + * Returns this argument as a schema coordinate string. + * @returns The argument coordinate. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString }); + * + * arg.toString(); // => 'Query.greeting(name:)' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The argument coordinate. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString }); + * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString }); + * + * JSON.stringify(arg); // => '"Query.greeting(name:)"' + * ``` + */ + toJSON(): string; +} +/** + * Returns true when the argument is non-null and has no default value. + * @param arg - The argument definition to inspect. + * @returns True when the argument is non-null and has no default value. + * @example + * ```ts + * import { + * GraphQLArgument, + * GraphQLField, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLObjectType, + * GraphQLString, + * isRequiredArgument, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ name: 'Query', fields: {} }); + * const field = new GraphQLField(Query, 'reviews', { type: GraphQLString }); + * const requiredArgument = new GraphQLArgument(field, 'id', { + * type: new GraphQLNonNull(GraphQLInt), + * }); + * const optionalArgument = new GraphQLArgument(field, 'name', { + * type: GraphQLString, + * }); + * const argumentWithDefault = new GraphQLArgument(field, 'limit', { + * type: new GraphQLNonNull(GraphQLInt), + * default: { value: 10 }, + * }); + * + * isRequiredArgument(requiredArgument); // => true + * isRequiredArgument(optionalArgument); // => false + * isRequiredArgument(argumentWithDefault); // => false + * ``` + */ +export declare function isRequiredArgument(arg: GraphQLArgument | GraphQLVariableSignature): boolean; +/** + * A map of field names to resolved field definitions. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export type GraphQLFieldMap = ObjMap>; +/** Default input represented as either a runtime value or a GraphQL literal. */ +export type GraphQLDefaultInput = { + /** Runtime default value. */ + value: unknown; + /** GraphQL literal default value is not provided in this variant. */ + literal?: never; +} | { + /** GraphQL literal default value. */ + literal: ConstValueNode; + /** Runtime default value is not provided in this variant. */ + value?: never; +}; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInterfaceTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Interface Type Definition + * + * When a field can return one of a heterogeneous set of types, a Interface type + * is used to describe what types are possible, what fields are in common across + * all types, as well as a function to determine which type is actually used + * when the field is resolved. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @example + * ```ts + * const EntityType = new GraphQLInterfaceType({ + * name: 'Entity', + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * ``` + */ +export declare class GraphQLInterfaceType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Function that resolves the concrete object type for this abstract type. */ + resolveType: Maybe>; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _fields; + private _interfaces; + /** + * Creates a GraphQLInterfaceType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type'; + * + * const document = parse(` + * interface Node { + * id: ID! + * } + * + * interface Resource implements Node { + * id: ID! + * } + * + * extend interface Resource { + * url: String + * } + * `); + * + * const Node = new GraphQLInterfaceType({ + * name: 'Node', + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * }); + * + * const Resource = new GraphQLInterfaceType({ + * name: 'Resource', + * description: 'An addressable resource.', + * interfaces: [Node], + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * resolveType: (value) => { + * return typeof value === 'object' && value != null && 'url' in value + * ? 'WebPage' + * : null; + * }, + * extensions: { abstract: true }, + * astNode: document.definitions[1], + * extensionASTNodes: [document.definitions[2]], + * }); + * + * Resource.name; // => 'Resource' + * Resource.getInterfaces(); // => [Node] + * Object.keys(Resource.getFields()); // => ['id'] + * Resource.extensions; // => { abstract: true } + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the fields defined by this type. + * @returns The fields keyed by field name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * const fields = Node.getFields(); + * + * Object.keys(fields); // => ['id'] + * String(fields.id.type); // => 'ID!' + * ``` + */ + getFields(): GraphQLFieldMap; + /** + * Returns the interfaces implemented by this type. + * @returns The implemented interfaces. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Resource { + * url: String! + * } + * + * interface Image implements Resource { + * url: String! + * width: Int + * } + * + * type Photo implements Resource & Image { + * url: String! + * width: Int + * } + * + * type Query { + * image: Image + * } + * `); + * + * const Image = assertInterfaceType(schema.getType('Image')); + * + * Image.getInterfaces().map((type) => type.name); // => ['Resource'] + * ``` + */ + getInterfaces(): ReadonlyArray; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type'; + * + * const Node = new GraphQLInterfaceType({ + * name: 'Node', + * fields: { + * id: { type: new GraphQLNonNull(GraphQLID) }, + * }, + * }); + * + * const config = Node.toConfig(); + * const NodeCopy = new GraphQLInterfaceType(config); + * + * String(config.fields.id.type); // => 'ID!' + * String(NodeCopy.getFields().id.type); // => 'ID!' + * ``` + */ + toConfig(): GraphQLInterfaceTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this interface type. + * @returns The schema coordinate for this interface type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * + * Node.toString(); // => 'Node' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLInterfaceType, GraphQLString } from 'graphql/type'; + * + * const Named = new GraphQLInterfaceType({ + * name: 'Named', + * fields: { name: { type: GraphQLString } }, + * }); + * + * Named.toJSON(); // => 'Named' + * JSON.stringify({ type: Named }); // => '{"type":"Named"}' + * ``` + */ + toJSON(): string; +} +/** + * Configuration used to construct a GraphQLInterfaceType. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export interface GraphQLInterfaceTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Interfaces implemented by this object or interface type. */ + interfaces?: ThunkReadonlyArray | undefined; + /** Fields declared by this object, interface, input object, or literal. */ + fields: ThunkObjMap>; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLInterfaceTypeNormalizedConfig extends GraphQLInterfaceTypeConfig { + interfaces: ReadonlyArray; + fields: GraphQLFieldNormalizedConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLUnionTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Union Type Definition + * + * When a field can return one of a heterogeneous set of types, a Union type + * is used to describe what types are possible as well as providing a function + * to determine which type is actually used when the field is resolved. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + * @example + * ```ts + * const PetType = new GraphQLUnionType({ + * name: 'Pet', + * types: [DogType, CatType], + * resolveType: (value) => { + * if (value instanceof Dog) { + * return DogType; + * } + * if (value instanceof Cat) { + * return CatType; + * } + * }, + * }); + * ``` + */ +export declare class GraphQLUnionType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Function that resolves the concrete object type for this abstract type. */ + resolveType: Maybe>; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _types; + /** + * Creates a GraphQLUnionType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { + * GraphQLObjectType, + * GraphQLString, + * GraphQLUnionType, + * } from 'graphql/type'; + * + * const document = parse(` + * union Media = Photo | Video + * + * extend union Media = Audio + * `); + * + * const Photo = new GraphQLObjectType({ + * name: 'Photo', + * fields: { url: { type: GraphQLString } }, + * }); + * const Video = new GraphQLObjectType({ + * name: 'Video', + * fields: { url: { type: GraphQLString } }, + * }); + * + * const Media = new GraphQLUnionType({ + * name: 'Media', + * description: 'Media that can appear in a search result.', + * types: [Photo, Video], + * resolveType: (value) => { + * return typeof value === 'object' && value != null && 'duration' in value + * ? 'Video' + * : 'Photo'; + * }, + * extensions: { searchable: true }, + * astNode: document.definitions[0], + * extensionASTNodes: [document.definitions[1]], + * }); + * + * Media.description; // => 'Media that can appear in a search result.' + * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * Media.extensions; // => { searchable: true } + * ``` + */ + constructor(config: Readonly>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the object types included in this union. + * @returns The union member object types. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * + * type Query { + * media: [Media] + * } + * `); + * + * const Media = assertUnionType(schema.getType('Media')); + * + * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * ``` + */ + getTypes(): ReadonlyArray; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { + * GraphQLObjectType, + * GraphQLString, + * GraphQLUnionType, + * } from 'graphql/type'; + * + * const Photo = new GraphQLObjectType({ + * name: 'Photo', + * fields: { url: { type: GraphQLString } }, + * }); + * const Video = new GraphQLObjectType({ + * name: 'Video', + * fields: { url: { type: GraphQLString } }, + * }); + * const Media = new GraphQLUnionType({ + * name: 'Media', + * types: [Photo, Video], + * }); + * + * const config = Media.toConfig(); + * const MediaCopy = new GraphQLUnionType(config); + * + * MediaCopy.getTypes().map((type) => type.name); // => ['Photo', 'Video'] + * ``` + */ + toConfig(): GraphQLUnionTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this union type. + * @returns The schema coordinate for this union type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * union SearchResult = Photo + * + * type Query { + * search: [SearchResult] + * } + * `); + * + * const SearchResult = assertUnionType(schema.getType('SearchResult')); + * + * SearchResult.toString(); // => 'SearchResult' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { + * GraphQLObjectType, + * GraphQLString, + * GraphQLUnionType, + * } from 'graphql/type'; + * + * const Photo = new GraphQLObjectType({ + * name: 'Photo', + * fields: { url: { type: GraphQLString } }, + * }); + * const SearchResult = new GraphQLUnionType({ + * name: 'SearchResult', + * types: [Photo], + * }); + * + * SearchResult.toJSON(); // => 'SearchResult' + * JSON.stringify({ type: SearchResult }); // => '{"type":"SearchResult"}' + * ``` + */ + toJSON(): string; +} +/** + * Configuration used to construct a GraphQLUnionType. + * @typeParam TSource - Source object type passed to resolvers. + * @typeParam TContext - Context object type passed to resolvers. + */ +export interface GraphQLUnionTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Object types that belong to this union type. */ + types: ThunkReadonlyArray; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLUnionTypeNormalizedConfig extends GraphQLUnionTypeConfig { + types: ReadonlyArray; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLEnumTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Enum Type Definition + * + * Enum types define leaf values whose serialized form is one of a fixed set + * of GraphQL enum names. Internally, enum values can map to any runtime value, + * often integers. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGBType = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGBType.getValue('GREEN')?.value; // => 1 + * ``` + * + * Note: If a value is not provided in a definition, the name of the enum value + * will be used as its internal value. + */ +export declare class GraphQLEnumType/* */ implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + private _values; + private _valueLookup; + private _nameLookup; + /** + * Creates a GraphQLEnumType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const document = parse(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * JEDI + * } + * + * extend enum Episode { + * FORCE_AWAKENS + * } + * `); + * const definition = document.definitions[0]; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * description: 'A Star Wars film episode.', + * values: { + * NEW_HOPE: { + * value: 4, + * description: 'Released in 1977.', + * extensions: { trilogy: 'original' }, + * astNode: definition.values[0], + * }, + * EMPIRE: { value: 5, astNode: definition.values[1] }, + * JEDI: { + * value: 6, + * deprecationReason: 'Use RETURN_OF_THE_JEDI.', + * astNode: definition.values[2], + * }, + * }, + * extensions: { catalog: 'films' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * }); + * + * Episode.description; // => 'A Star Wars film episode.' + * Episode.coerceOutputValue(5); // => 'EMPIRE' + * Episode.coerceInputValue('JEDI'); // => 6 + * Episode.getValue('JEDI').deprecationReason; // => 'Use RETURN_OF_THE_JEDI.' + * Episode.extensions; // => { catalog: 'films' } + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the values defined by this enum type. + * @returns Enum value definitions in schema order. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * JEDI + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const Episode = assertEnumType(schema.getType('Episode')); + * + * Episode.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE', 'JEDI'] + * ``` + */ + getValues(): ReadonlyArray; + /** + * Returns the enum value definition for a value name. + * @param name - The GraphQL name to look up. + * @returns The matching enum value definition, if it exists. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const Episode = assertEnumType(schema.getType('Episode')); + * + * Episode.getValue('EMPIRE')?.name; // => 'EMPIRE' + * Episode.getValue('JEDI'); // => undefined + * ``` + */ + getValue(name: string): Maybe; + /** + * Serializes a runtime enum value as a GraphQL enum name. + * @param outputValue - Runtime enum value to serialize. + * @returns The GraphQL enum name for the runtime value. + * + * This deprecated method delegates to `coerceOutputValue()`; call + * `coerceOutputValue()` directly instead. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.serialize(1); // => 'GREEN' + * RGB.serialize(3); // throws an error + * ``` + * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18 + */ + serialize(outputValue: unknown): Maybe; + /** + * Coerces a runtime enum value to a GraphQL enum name. + * @param outputValue - Runtime enum value to coerce. + * @returns The GraphQL enum name for the runtime value. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.coerceOutputValue(1); // => 'GREEN' + * RGB.coerceOutputValue(3); // throws an error + * ``` + */ + coerceOutputValue(outputValue: unknown): Maybe; + /** + * Deprecated legacy enum parser for externally provided input values. Use + * `coerceInputValue()` instead. + * @param inputValue - External enum name to parse. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum name. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.parseValue('BLUE'); // => 2 + * RGB.parseValue('PURPLE', true); // throws an error + * ``` + * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18 + */ + parseValue(inputValue: unknown, hideSuggestions?: Maybe): Maybe; + /** + * Coerces an external enum name to its internal runtime value. + * @param inputValue - External enum name to coerce. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum name. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.coerceInputValue('BLUE'); // => 2 + * RGB.coerceInputValue('PURPLE'); // throws an error + * RGB.coerceInputValue(2); // throws an error + * ``` + */ + coerceInputValue(inputValue: unknown, hideSuggestions?: Maybe): Maybe; + /** + * Deprecated legacy enum parser for externally provided input literals. Use + * `coerceInputLiteral()` instead. + * @param valueNode - Enum value AST node to parse. + * @param _variables - Deprecated variable values parameter that is no longer used. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum literal. + * @example + * ```ts + * import { parseValue } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.parseLiteral(parseValue('RED')); // => 0 + * RGB.parseLiteral(parseValue('"RED"')); // throws an error + * ``` + * @deprecated use `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18 + */ + parseLiteral(valueNode: ValueNode, _variables: Maybe>, hideSuggestions?: Maybe): Maybe; + /** + * Coerces an enum value AST node to its internal runtime value. + * @param valueNode - Enum value AST node to coerce. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns The internal runtime value for the enum literal. + * @example + * ```ts + * import { parseConstValue } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * RGB.coerceInputLiteral(parseConstValue('RED')); // => 0 + * RGB.coerceInputLiteral(parseConstValue('"RED"'), true); // throws an error + * ``` + */ + coerceInputLiteral(valueNode: ConstValueNode, hideSuggestions?: Maybe): Maybe; + /** + * Converts a runtime enum value to a GraphQL enum value AST node. + * @param value - Runtime enum value to convert. + * @returns Enum value AST node, or undefined if the value is invalid. + * @example + * ```ts + * import { print } from 'graphql/language'; + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * print(RGB.valueToLiteral(2)); // => 'BLUE' + * RGB.valueToLiteral(3); // => undefined + * ``` + */ + valueToLiteral(value: unknown): ConstValueNode | undefined; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const RGB = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 }, + * }, + * }); + * + * const config = RGB.toConfig(); + * const RGBCopy = new GraphQLEnumType(config); + * + * config.values.GREEN.value; // => 1 + * RGBCopy.coerceOutputValue(2); // => 'BLUE' + * ``` + */ + toConfig(): GraphQLEnumTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this enum type. + * @returns The schema coordinate for this enum type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertEnumType } from 'graphql/type'; + * + * const schema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const Episode = assertEnumType(schema.getType('Episode')); + * + * Episode.toString(); // => 'Episode' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLEnumType } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { + * NEW_HOPE: {}, + * }, + * }); + * + * Episode.toJSON(); // => 'Episode' + * JSON.stringify({ type: Episode }); // => '{"type":"Episode"}' + * ``` + */ + toJSON(): string; +} +/** Configuration used to construct a GraphQLEnumType. */ +export interface GraphQLEnumTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Values contained in this enum, list, or input-object definition. */ + values: ThunkObjMap; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig { + values: GraphQLEnumValueNormalizedConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** A map of enum value names to enum value configuration objects. */ +export type GraphQLEnumValueConfigMap = ObjMap; +/** @internal */ +export type GraphQLEnumValueNormalizedConfigMap = ObjMap; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLEnumValueExtensions { + [attributeName: string | symbol]: unknown; +} +/** Configuration used to define a GraphQL enum value. */ +export interface GraphQLEnumValueConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Parsed value represented by this node. */ + value?: any; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** @internal */ +export interface GraphQLEnumValueNormalizedConfig extends GraphQLEnumValueConfig { + extensions: Readonly; +} +/** A resolved GraphQL enum value definition. */ +export declare class GraphQLEnumValue implements GraphQLSchemaElement { + /** Enum type that owns this enum value. */ + parentEnum: GraphQLEnumType; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Parsed value represented by this node. */ + value: any; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL enum value definition. + * @param parentEnum - Enum type that owns this enum value. + * @param name - Enum value name. + * @param config - Enum value configuration. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { + * value: 5, + * description: 'Released in 1980.', + * }); + * + * enumValue.parentEnum; // => Episode + * enumValue.name; // => 'EMPIRE' + * enumValue.value; // => 5 + * ``` + */ + constructor(parentEnum: GraphQLEnumType, name: string, config: GraphQLEnumValueConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this enum value. + * @returns A configuration object that can be used to recreate this enum value. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { + * value: 5, + * extensions: { trilogy: 'original' }, + * }); + * + * enumValue.toConfig(); // => { description: undefined, value: 5, deprecationReason: undefined, extensions: { trilogy: 'original' }, astNode: undefined } + * ``` + */ + toConfig(): GraphQLEnumValueNormalizedConfig; + /** + * Returns this enum value as a schema coordinate string. + * @returns Enum value coordinate. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 }); + * + * enumValue.toString(); // => 'Episode.EMPIRE' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns Enum value coordinate. + * @example + * ```ts + * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type'; + * + * const Episode = new GraphQLEnumType({ + * name: 'Episode', + * values: { NEW_HOPE: { value: 4 } }, + * }); + * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 }); + * + * JSON.stringify(enumValue); // => '"Episode.EMPIRE"' + * ``` + */ + toJSON(): string; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInputObjectTypeExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Input Object Type Definition + * + * An input object defines a structured collection of fields which may be + * supplied to a field argument. + * + * Using `NonNull` will ensure that a value must be provided by the query + * @example + * ```ts + * const GeoPoint = new GraphQLInputObjectType({ + * name: 'GeoPoint', + * fields: { + * lat: { type: new GraphQLNonNull(GraphQLFloat) }, + * lon: { type: new GraphQLNonNull(GraphQLFloat) }, + * alt: { type: GraphQLFloat, default: { value: 0 } }, + * }, + * }); + * ``` + */ +export declare class GraphQLInputObjectType implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** Whether this input object uses the experimental OneOf input object semantics. */ + isOneOf: boolean; + private _fields; + /** + * Creates a GraphQLInputObjectType instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { + * GraphQLID, + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * + * const document = parse(` + * input ReviewInput { + * stars: Int! + * commentary: String + * } + * + * extend input ReviewInput { + * body: String + * } + * `); + * const definition = document.definitions[0]; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * description: 'Input collected when reviewing a product.', + * fields: { + * stars: { + * description: 'Star rating from one to five.', + * type: new GraphQLNonNull(GraphQLInt), + * extensions: { min: 1, max: 5 }, + * astNode: definition.fields[0], + * }, + * commentary: { + * type: GraphQLString, + * default: { value: '' }, + * deprecationReason: 'Use body.', + * astNode: definition.fields[1], + * }, + * }, + * extensions: { form: 'review' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * isOneOf: false, + * }); + * const SearchBy = new GraphQLInputObjectType({ + * name: 'SearchBy', + * fields: { + * id: { type: GraphQLID }, + * slug: { type: GraphQLString }, + * }, + * isOneOf: true, + * }); + * + * const fields = ReviewInput.getFields(); + * + * ReviewInput.description; // => 'Input collected when reviewing a product.' + * String(fields.stars.type); // => 'Int!' + * fields.stars.extensions; // => { min: 1, max: 5 } + * fields.commentary.default.value; // => '' + * fields.commentary.deprecationReason; // => 'Use body.' + * ReviewInput.isOneOf; // => false + * SearchBy.isOneOf; // => true + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the fields defined by this type. + * @returns The fields keyed by field name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * commentary: String = "" + * } + * + * type Query { + * reviews(filter: ReviewInput): [String] + * } + * `); + * + * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput')); + * const fields = ReviewInput.getFields(); + * + * Object.keys(fields); // => ['stars', 'commentary'] + * fields.commentary.default; // => { literal: { kind: 'StringValue', value: '' } } + * ``` + */ + getFields(): GraphQLInputFieldMap; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * }, + * }); + * + * const config = ReviewInput.toConfig(); + * const ReviewInputCopy = new GraphQLInputObjectType(config); + * + * String(config.fields.stars.type); // => 'Int!' + * String(ReviewInputCopy.getFields().stars.type); // => 'Int!' + * ``` + */ + toConfig(): GraphQLInputObjectTypeNormalizedConfig; + /** + * Returns the schema coordinate identifying this input object type. + * @returns The schema coordinate for this input object type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInputObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * input ReviewInput { + * stars: Int! + * } + * + * type Query { + * reviews(filter: ReviewInput): [String] + * } + * `); + * + * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput')); + * + * ReviewInput.toString(); // => 'ReviewInput' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * commentary: { type: GraphQLString }, + * }, + * }); + * + * ReviewInput.toJSON(); // => 'ReviewInput' + * JSON.stringify({ type: ReviewInput }); // => '{"type":"ReviewInput"}' + * ``` + */ + toJSON(): string; +} +/** Configuration used to construct a GraphQLInputObjectType. */ +export interface GraphQLInputObjectTypeConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Fields declared by this object, interface, input object, or literal. */ + fields: ThunkObjMap; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; + /** Whether this input object uses the experimental OneOf input object semantics. */ + isOneOf?: boolean; +} +/** @internal */ +export interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObjectTypeConfig { + fields: GraphQLInputFieldNormalizedConfigMap; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLInputFieldExtensions { + [attributeName: string | symbol]: unknown; +} +/** Configuration used to define a GraphQL input field. */ +export interface GraphQLInputFieldConfig { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value for this input field. Use `default` + * instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue?: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default?: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; +} +/** A map of input field names to input field configuration objects. */ +export type GraphQLInputFieldConfigMap = ObjMap; +/** @internal */ +export interface GraphQLInputFieldNormalizedConfig extends GraphQLInputFieldConfig { + default: GraphQLDefaultInput | undefined; + extensions: Readonly; +} +/** @internal */ +export type GraphQLInputFieldNormalizedConfigMap = ObjMap; +/** A resolved GraphQL input field definition. */ +export declare class GraphQLInputField implements GraphQLSchemaElement { + /** Input object type that owns this input field. */ + parentType: GraphQLInputObjectType; + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + type: GraphQLInputType; + /** + * Deprecated legacy default value used when no explicit value is supplied. + * Use `default` instead. + * @deprecated use `default` instead, `defaultValue` will be removed in v18 + */ + defaultValue: unknown; + /** Default value represented as either a runtime value or a GraphQL literal. */ + default: GraphQLDefaultInput | undefined; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** + * Creates a resolved GraphQL input field definition. + * @param parentType - Input object type that owns this field. + * @param name - Input field name. + * @param config - Input field configuration. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * default: { value: '' }, + * }); + * + * field.parentType; // => ReviewInput + * field.name; // => 'commentary' + * field.default.value; // => '' + * ``` + */ + constructor(parentType: GraphQLInputObjectType, name: string, config: GraphQLInputFieldConfig); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this input field. + * @returns A configuration object that can be used to recreate this input field. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * extensions: { form: 'review' }, + * }); + * + * field.toConfig().extensions; // => { form: 'review' } + * ``` + */ + toConfig(): GraphQLInputFieldNormalizedConfig; + /** + * Returns this input field as a schema coordinate string. + * @returns The input field coordinate. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * }); + * + * field.toString(); // => 'ReviewInput.commentary' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The input field coordinate. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLString, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const field = new GraphQLInputField(ReviewInput, 'commentary', { + * type: GraphQLString, + * }); + * + * JSON.stringify(field); // => '"ReviewInput.commentary"' + * ``` + */ + toJSON(): string; +} +/** + * Returns true when the input field is non-null and has no default value. + * @param field - The input field definition to inspect. + * @returns True when the input field is non-null and has no default value. + * @example + * ```ts + * import { + * GraphQLInputField, + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLString, + * isRequiredInputField, + * } from 'graphql/type'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: {}, + * }); + * const requiredField = new GraphQLInputField(ReviewInput, 'id', { + * type: new GraphQLNonNull(GraphQLInt), + * }); + * const optionalField = new GraphQLInputField(ReviewInput, 'name', { + * type: GraphQLString, + * }); + * const fieldWithDefault = new GraphQLInputField(ReviewInput, 'limit', { + * type: new GraphQLNonNull(GraphQLInt), + * default: { value: 10 }, + * }); + * + * isRequiredInputField(requiredField); // => true + * isRequiredInputField(optionalField); // => false + * isRequiredInputField(fieldWithDefault); // => false + * ``` + */ +export declare function isRequiredInputField(field: GraphQLInputField): boolean; +/** A map of input field names to resolved input field definitions. */ +export type GraphQLInputFieldMap = ObjMap; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js new file mode 100644 index 00000000..c1f4653e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js @@ -0,0 +1,846 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GraphQLInputField = exports.GraphQLInputObjectType = exports.GraphQLEnumValue = exports.GraphQLEnumType = exports.GraphQLUnionType = exports.GraphQLInterfaceType = exports.GraphQLArgument = exports.GraphQLField = exports.GraphQLObjectType = exports.GraphQLScalarType = exports.GraphQLNonNull = exports.GraphQLList = void 0; +exports.isType = isType; +exports.assertType = assertType; +exports.isScalarType = isScalarType; +exports.assertScalarType = assertScalarType; +exports.isObjectType = isObjectType; +exports.assertObjectType = assertObjectType; +exports.isField = isField; +exports.assertField = assertField; +exports.isArgument = isArgument; +exports.assertArgument = assertArgument; +exports.isInterfaceType = isInterfaceType; +exports.assertInterfaceType = assertInterfaceType; +exports.isUnionType = isUnionType; +exports.assertUnionType = assertUnionType; +exports.isEnumType = isEnumType; +exports.assertEnumType = assertEnumType; +exports.isEnumValue = isEnumValue; +exports.assertEnumValue = assertEnumValue; +exports.isInputObjectType = isInputObjectType; +exports.assertInputObjectType = assertInputObjectType; +exports.isInputField = isInputField; +exports.assertInputField = assertInputField; +exports.isListType = isListType; +exports.assertListType = assertListType; +exports.isNonNullType = isNonNullType; +exports.assertNonNullType = assertNonNullType; +exports.isInputType = isInputType; +exports.assertInputType = assertInputType; +exports.isOutputType = isOutputType; +exports.assertOutputType = assertOutputType; +exports.isLeafType = isLeafType; +exports.assertLeafType = assertLeafType; +exports.isCompositeType = isCompositeType; +exports.assertCompositeType = assertCompositeType; +exports.isAbstractType = isAbstractType; +exports.assertAbstractType = assertAbstractType; +exports.isWrappingType = isWrappingType; +exports.assertWrappingType = assertWrappingType; +exports.isNullableType = isNullableType; +exports.assertNullableType = assertNullableType; +exports.getNullableType = getNullableType; +exports.isNamedType = isNamedType; +exports.assertNamedType = assertNamedType; +exports.getNamedType = getNamedType; +exports.resolveReadonlyArrayThunk = resolveReadonlyArrayThunk; +exports.resolveObjMapThunk = resolveObjMapThunk; +exports.isRequiredArgument = isRequiredArgument; +exports.isRequiredInputField = isRequiredInputField; +const devAssert_ts_1 = require("../jsutils/devAssert.js"); +const didYouMean_ts_1 = require("../jsutils/didYouMean.js"); +const identityFunc_ts_1 = require("../jsutils/identityFunc.js"); +const inspect_ts_1 = require("../jsutils/inspect.js"); +const instanceOf_ts_1 = require("../jsutils/instanceOf.js"); +const keyMap_ts_1 = require("../jsutils/keyMap.js"); +const keyValMap_ts_1 = require("../jsutils/keyValMap.js"); +const mapValue_ts_1 = require("../jsutils/mapValue.js"); +const suggestionList_ts_1 = require("../jsutils/suggestionList.js"); +const toObjMap_ts_1 = require("../jsutils/toObjMap.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const printer_ts_1 = require("../language/printer.js"); +const valueFromASTUntyped_ts_1 = require("../utilities/valueFromASTUntyped.js"); +const assertName_ts_1 = require("./assertName.js"); +function isType(type) { + return (isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type) || + isListType(type) || + isNonNullType(type)); +} +function assertType(type) { + if (!isType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL type.`); + } + return type; +} +const scalarSymbol = Symbol('Scalar'); +function isScalarType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, scalarSymbol, GraphQLScalarType); +} +function assertScalarType(type) { + if (!isScalarType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL Scalar type.`); + } + return type; +} +const objectSymbol = Symbol('Object'); +function isObjectType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, objectSymbol, GraphQLObjectType); +} +function assertObjectType(type) { + if (!isObjectType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL Object type.`); + } + return type; +} +const fieldSymbol = Symbol('Field'); +function isField(field) { + return (0, instanceOf_ts_1.instanceOf)(field, fieldSymbol, GraphQLField); +} +function assertField(field) { + if (!isField(field)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(field)} to be a GraphQL field.`); + } + return field; +} +const argumentSymbol = Symbol('Argument'); +function isArgument(arg) { + return (0, instanceOf_ts_1.instanceOf)(arg, argumentSymbol, GraphQLArgument); +} +function assertArgument(arg) { + if (!isArgument(arg)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(arg)} to be a GraphQL argument.`); + } + return arg; +} +const interfaceSymbol = Symbol('Interface'); +function isInterfaceType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, interfaceSymbol, GraphQLInterfaceType); +} +function assertInterfaceType(type) { + if (!isInterfaceType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL Interface type.`); + } + return type; +} +const unionSymbol = Symbol('Union'); +function isUnionType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, unionSymbol, GraphQLUnionType); +} +function assertUnionType(type) { + if (!isUnionType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL Union type.`); + } + return type; +} +const enumSymbol = Symbol('Enum'); +function isEnumType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, enumSymbol, GraphQLEnumType); +} +function assertEnumType(type) { + if (!isEnumType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL Enum type.`); + } + return type; +} +const enumValueSymbol = Symbol('EnumValue'); +function isEnumValue(value) { + return (0, instanceOf_ts_1.instanceOf)(value, enumValueSymbol, GraphQLEnumValue); +} +function assertEnumValue(value) { + if (!isEnumValue(value)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(value)} to be a GraphQL Enum value.`); + } + return value; +} +const inputObjectSymbol = Symbol('InputObject'); +function isInputObjectType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, inputObjectSymbol, GraphQLInputObjectType); +} +function assertInputObjectType(type) { + if (!isInputObjectType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL Input Object type.`); + } + return type; +} +const inputFieldSymbol = Symbol('InputField'); +function isInputField(field) { + return (0, instanceOf_ts_1.instanceOf)(field, inputFieldSymbol, GraphQLInputField); +} +function assertInputField(field) { + if (!isInputField(field)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(field)} to be a GraphQL input field.`); + } + return field; +} +const listSymbol = Symbol('List'); +function isListType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, listSymbol, GraphQLList); +} +function assertListType(type) { + if (!isListType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL List type.`); + } + return type; +} +const nonNullSymbol = Symbol('NonNull'); +function isNonNullType(type) { + return (0, instanceOf_ts_1.instanceOf)(type, nonNullSymbol, GraphQLNonNull); +} +function assertNonNullType(type) { + if (!isNonNullType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL Non-Null type.`); + } + return type; +} +function isInputType(type) { + return (isScalarType(type) || + isEnumType(type) || + isInputObjectType(type) || + (isWrappingType(type) && isInputType(type.ofType))); +} +function assertInputType(type) { + if (!isInputType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL input type.`); + } + return type; +} +function isOutputType(type) { + return (isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + (isWrappingType(type) && isOutputType(type.ofType))); +} +function assertOutputType(type) { + if (!isOutputType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL output type.`); + } + return type; +} +function isLeafType(type) { + return isScalarType(type) || isEnumType(type); +} +function assertLeafType(type) { + if (!isLeafType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL leaf type.`); + } + return type; +} +function isCompositeType(type) { + return isObjectType(type) || isInterfaceType(type) || isUnionType(type); +} +function assertCompositeType(type) { + if (!isCompositeType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL composite type.`); + } + return type; +} +function isAbstractType(type) { + return isInterfaceType(type) || isUnionType(type); +} +function assertAbstractType(type) { + if (!isAbstractType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL abstract type.`); + } + return type; +} +class GraphQLList { + constructor(ofType) { + this.__kind = listSymbol; + this.ofType = ofType; + } + get [Symbol.toStringTag]() { + return 'GraphQLList'; + } + toString() { + return '[' + String(this.ofType) + ']'; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLList = GraphQLList; +class GraphQLNonNull { + constructor(ofType) { + this.__kind = nonNullSymbol; + this.ofType = ofType; + } + get [Symbol.toStringTag]() { + return 'GraphQLNonNull'; + } + toString() { + return String(this.ofType) + '!'; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLNonNull = GraphQLNonNull; +function isWrappingType(type) { + return isListType(type) || isNonNullType(type); +} +function assertWrappingType(type) { + if (!isWrappingType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL wrapping type.`); + } + return type; +} +function isNullableType(type) { + return isType(type) && !isNonNullType(type); +} +function assertNullableType(type) { + if (!isNullableType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL nullable type.`); + } + return type; +} +function getNullableType(type) { + if (type) { + return isNonNullType(type) ? type.ofType : type; + } +} +function isNamedType(type) { + return (isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type)); +} +function assertNamedType(type) { + if (!isNamedType(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(type)} to be a GraphQL named type.`); + } + return type; +} +function getNamedType(type) { + if (type) { + let unwrappedType = type; + while (isWrappingType(unwrappedType)) { + unwrappedType = unwrappedType.ofType; + } + return unwrappedType; + } +} +function resolveReadonlyArrayThunk(thunk) { + return typeof thunk === 'function' ? thunk() : thunk; +} +function resolveObjMapThunk(thunk) { + return typeof thunk === 'function' ? thunk() : thunk; +} +class GraphQLScalarType { + constructor(config) { + this.__kind = scalarSymbol; + this.name = (0, assertName_ts_1.assertName)(config.name); + this.description = config.description; + this.specifiedByURL = config.specifiedByURL; + this.serialize = + config.serialize ?? + config.coerceOutputValue ?? + identityFunc_ts_1.identityFunc; + this.parseValue = + config.parseValue ?? + config.coerceInputValue ?? + identityFunc_ts_1.identityFunc; + this.parseLiteral = + config.parseLiteral ?? + ((node, variables) => this.coerceInputValue((0, valueFromASTUntyped_ts_1.valueFromASTUntyped)(node, variables))); + this.coerceOutputValue = config.coerceOutputValue ?? this.serialize; + this.coerceInputValue = config.coerceInputValue ?? this.parseValue; + this.coerceInputLiteral = config.coerceInputLiteral; + this.valueToLiteral = config.valueToLiteral; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + if (config.parseLiteral) { + if (!(typeof config.parseValue === 'function' && + typeof config.parseLiteral === 'function')) + (0, devAssert_ts_1.devAssert)(false, `${this.name} must provide both "parseValue" and "parseLiteral" functions.`); + } + if (config.coerceInputLiteral) { + if (!(typeof config.coerceInputValue === 'function' && + typeof config.coerceInputLiteral === 'function')) + (0, devAssert_ts_1.devAssert)(false, `${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`); + } + } + get [Symbol.toStringTag]() { + return 'GraphQLScalarType'; + } + toConfig() { + return { + name: this.name, + description: this.description, + specifiedByURL: this.specifiedByURL, + serialize: this.serialize, + parseValue: this.parseValue, + parseLiteral: this.parseLiteral, + coerceOutputValue: this.coerceOutputValue, + coerceInputValue: this.coerceInputValue, + coerceInputLiteral: this.coerceInputLiteral, + valueToLiteral: this.valueToLiteral, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLScalarType = GraphQLScalarType; +class GraphQLObjectType { + constructor(config) { + this.__kind = objectSymbol; + this.__kind = objectSymbol; + this.name = (0, assertName_ts_1.assertName)(config.name); + this.description = config.description; + this.isTypeOf = config.isTypeOf; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._fields = (defineFieldMap).bind(undefined, this, config.fields); + this._interfaces = defineInterfaces.bind(undefined, config.interfaces); + } + get [Symbol.toStringTag]() { + return 'GraphQLObjectType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; + } + toConfig() { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: (0, mapValue_ts_1.mapValue)(this.getFields(), (field) => field.toConfig()), + isTypeOf: this.isTypeOf, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLObjectType = GraphQLObjectType; +function defineInterfaces(interfaces) { + return resolveReadonlyArrayThunk(interfaces ?? []); +} +function defineFieldMap(parentType, fields) { + const fieldMap = resolveObjMapThunk(fields); + return (0, mapValue_ts_1.mapValue)(fieldMap, (fieldConfig, fieldName) => new GraphQLField(parentType, fieldName, fieldConfig)); +} +class GraphQLField { + constructor(parentType, name, config) { + this.__kind = fieldSymbol; + this.parentType = parentType; + this.name = (0, assertName_ts_1.assertName)(name); + this.description = config.description; + this.type = config.type; + const argsConfig = config.args; + this.args = argsConfig + ? Object.entries(argsConfig).map(([argName, argConfig]) => new GraphQLArgument(this, argName, argConfig)) + : []; + this.resolve = config.resolve; + this.subscribe = config.subscribe; + this.deprecationReason = config.deprecationReason; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLField'; + } + toConfig() { + return { + description: this.description, + type: this.type, + args: (0, keyValMap_ts_1.keyValMap)(this.args, (arg) => arg.name, (arg) => arg.toConfig()), + resolve: this.resolve, + subscribe: this.subscribe, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parentType ?? ''}.${this.name}`; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLField = GraphQLField; +class GraphQLArgument { + constructor(parent, name, config) { + this.__kind = argumentSymbol; + this.parent = parent; + this.name = (0, assertName_ts_1.assertName)(name); + this.description = config.description; + this.type = config.type; + this.defaultValue = config.defaultValue; + this.default = config.default; + this._memoizedCoercedDefaultValue = undefined; + this.deprecationReason = config.deprecationReason; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLArgument'; + } + toConfig() { + return { + description: this.description, + type: this.type, + defaultValue: this.defaultValue, + default: this.default, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parent}(${this.name}:)`; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLArgument = GraphQLArgument; +function isRequiredArgument(arg) { + return (isNonNullType(arg.type) && + arg.default === undefined && + arg.defaultValue === undefined); +} +class GraphQLInterfaceType { + constructor(config) { + this.__kind = interfaceSymbol; + this.name = (0, assertName_ts_1.assertName)(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._fields = (defineFieldMap).bind(undefined, this, config.fields); + this._interfaces = defineInterfaces.bind(undefined, config.interfaces); + } + get [Symbol.toStringTag]() { + return 'GraphQLInterfaceType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; + } + toConfig() { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: (0, mapValue_ts_1.mapValue)(this.getFields(), (field) => field.toConfig()), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLInterfaceType = GraphQLInterfaceType; +class GraphQLUnionType { + constructor(config) { + this.__kind = unionSymbol; + this.name = (0, assertName_ts_1.assertName)(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._types = defineTypes.bind(undefined, config.types); + } + get [Symbol.toStringTag]() { + return 'GraphQLUnionType'; + } + getTypes() { + if (typeof this._types === 'function') { + this._types = this._types(); + } + return this._types; + } + toConfig() { + return { + name: this.name, + description: this.description, + types: this.getTypes(), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLUnionType = GraphQLUnionType; +function defineTypes(types) { + return resolveReadonlyArrayThunk(types); +} +class GraphQLEnumType { + constructor(config) { + this.__kind = enumSymbol; + this.name = (0, assertName_ts_1.assertName)(config.name); + this.description = config.description; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._values = defineEnumValues.bind(undefined, this, config.values); + this._valueLookup = null; + this._nameLookup = null; + } + get [Symbol.toStringTag]() { + return 'GraphQLEnumType'; + } + getValues() { + if (typeof this._values === 'function') { + this._values = this._values(); + } + return this._values; + } + getValue(name) { + this._nameLookup ??= (0, keyMap_ts_1.keyMap)(this.getValues(), (value) => value.name); + return this._nameLookup[name]; + } + serialize(outputValue) { + return this.coerceOutputValue(outputValue); + } + coerceOutputValue(outputValue) { + this._valueLookup ??= new Map(this.getValues().map((enumValue) => [enumValue.value, enumValue])); + const enumValue = this._valueLookup.get(outputValue); + if (enumValue === undefined) { + throw new GraphQLError_ts_1.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0, inspect_ts_1.inspect)(outputValue)}`); + } + return enumValue.name; + } + parseValue(inputValue, hideSuggestions) { + return this.coerceInputValue(inputValue, hideSuggestions); + } + coerceInputValue(inputValue, hideSuggestions) { + if (typeof inputValue !== 'string') { + const valueStr = (0, inspect_ts_1.inspect)(inputValue); + throw new GraphQLError_ts_1.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr))); + } + const enumValue = this.getValue(inputValue); + if (enumValue == null) { + throw new GraphQLError_ts_1.GraphQLError(`Value "${inputValue}" does not exist in "${this.name}" enum.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, inputValue))); + } + return enumValue.value; + } + parseLiteral(valueNode, _variables, hideSuggestions) { + return this.coerceInputLiteral(valueNode, hideSuggestions); + } + coerceInputLiteral(valueNode, hideSuggestions) { + if (valueNode.kind !== kinds_ts_1.Kind.ENUM) { + const valueStr = (0, printer_ts_1.print)(valueNode); + throw new GraphQLError_ts_1.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)), { nodes: valueNode }); + } + const enumValue = this.getValue(valueNode.value); + if (enumValue == null) { + const valueStr = (0, printer_ts_1.print)(valueNode); + throw new GraphQLError_ts_1.GraphQLError(`Value "${valueStr}" does not exist in "${this.name}" enum.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)), { nodes: valueNode }); + } + return enumValue.value; + } + valueToLiteral(value) { + if (typeof value === 'string' && this.getValue(value)) { + return { kind: kinds_ts_1.Kind.ENUM, value }; + } + } + toConfig() { + return { + name: this.name, + description: this.description, + values: (0, keyValMap_ts_1.keyValMap)(this.getValues(), (value) => value.name, (value) => value.toConfig()), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLEnumType = GraphQLEnumType; +function defineEnumValues(parentEnum, values) { + const valueMap = resolveObjMapThunk(values); + return Object.entries(valueMap).map(([valueName, valueConfig]) => new GraphQLEnumValue(parentEnum, valueName, valueConfig)); +} +function didYouMeanEnumValue(enumType, unknownValueStr) { + const allNames = enumType.getValues().map((value) => value.name); + const suggestedValues = (0, suggestionList_ts_1.suggestionList)(unknownValueStr, allNames); + return (0, didYouMean_ts_1.didYouMean)('the enum value', suggestedValues); +} +class GraphQLEnumValue { + constructor(parentEnum, name, config) { + this.__kind = enumValueSymbol; + this.parentEnum = parentEnum; + this.name = (0, assertName_ts_1.assertEnumValueName)(name); + this.description = config.description; + this.value = config.value !== undefined ? config.value : name; + this.deprecationReason = config.deprecationReason; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLEnumValue'; + } + toConfig() { + return { + description: this.description, + value: this.value, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parentEnum.name}.${this.name}`; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLEnumValue = GraphQLEnumValue; +class GraphQLInputObjectType { + constructor(config) { + this.__kind = inputObjectSymbol; + this.name = (0, assertName_ts_1.assertName)(config.name); + this.description = config.description; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this.isOneOf = config.isOneOf ?? false; + this._fields = defineInputFieldMap.bind(undefined, this, config.fields); + } + get [Symbol.toStringTag]() { + return 'GraphQLInputObjectType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + toConfig() { + return { + name: this.name, + description: this.description, + fields: (0, mapValue_ts_1.mapValue)(this.getFields(), (field) => field.toConfig()), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + isOneOf: this.isOneOf, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLInputObjectType = GraphQLInputObjectType; +function defineInputFieldMap(parentType, fields) { + const fieldMap = resolveObjMapThunk(fields); + return (0, mapValue_ts_1.mapValue)(fieldMap, (fieldConfig, fieldName) => new GraphQLInputField(parentType, fieldName, fieldConfig)); +} +class GraphQLInputField { + constructor(parentType, name, config) { + if (!(!('resolve' in config))) + (0, devAssert_ts_1.devAssert)(false, `${parentType}.${name} field has a resolve property, but Input Types cannot define resolvers.`); + this.__kind = inputFieldSymbol; + this.parentType = parentType; + this.name = (0, assertName_ts_1.assertName)(name); + this.description = config.description; + this.type = config.type; + this.defaultValue = config.defaultValue; + this.default = config.default; + this._memoizedCoercedDefaultValue = undefined; + this.deprecationReason = config.deprecationReason; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLInputField'; + } + toConfig() { + return { + description: this.description, + type: this.type, + defaultValue: this.defaultValue, + default: this.default, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parentType}.${this.name}`; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLInputField = GraphQLInputField; +function isRequiredInputField(field) { + return (isNonNullType(field.type) && + field.defaultValue === undefined && + field.default === undefined); +} +//# sourceMappingURL=definition.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js.map new file mode 100644 index 00000000..7a68a8b3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"definition.js","sourceRo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AC/B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;IAwBD,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;IAC3C,CAAC;IAwBD,MAAM;QACJ,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CACF;AAlLD,8CAkLC;AAqCD,SAAgB,oBAAoB,CAAC,KAAwB;IAC3D,OAAO,CACL,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;QACzB,KAAK,CAAC,YAAY,KAAK,SAAS;QAChC,KAAK,CAAC,OAAO,KAAK,SAAS,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["/** @category Types */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { didYouMean } from '../jsutils/didYouMean.ts';\nimport { identityFunc } from '../jsutils/identityFunc.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { instanceOf } from '../jsutils/instanceOf.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\nimport { keyValMap } from '../jsutils/keyValMap.ts';\nimport { mapValue } from '../jsutils/mapValue.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\nimport { suggestionList } from '../jsutils/suggestionList.ts';\nimport { toObjMapWithSymbols } from '../jsutils/toObjMap.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ConstValueNode,\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n EnumValueDefinitionNode,\n FieldDefinitionNode,\n FieldNode,\n FragmentDefinitionNode,\n InputObjectTypeDefinitionNode,\n InputObjectTypeExtensionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n OperationDefinitionNode,\n ScalarTypeDefinitionNode,\n ScalarTypeExtensionNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n ValueNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport type { GraphQLVariableSignature } from '../execution/getVariableSignature.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { valueFromASTUntyped } from '../utilities/valueFromASTUntyped.ts';\n\nimport { assertEnumValueName, assertName } from './assertName.ts';\nimport type { GraphQLDirective } from './directives.ts';\nimport type { GraphQLSchema } from './schema.ts';\n\n// Predicates & Assertions\n\n/** These are all of the possible kinds of types. */\nexport type GraphQLType = GraphQLNamedType | GraphQLWrappingType;\n\n/**\n * Returns true when the value is any GraphQL type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is any GraphQL type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLList, GraphQLString, isType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * isType(GraphQLString); // => true\n * isType(new GraphQLList(GraphQLString)); // => true\n * isType(schema.getType('Query')); // => true\n * isType('String'); // => false\n * ```\n */\nexport function isType(type: unknown): type is GraphQLType {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n isListType(type) ||\n isNonNullType(type)\n );\n}\n\n/**\n * Returns the value as a GraphQL type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const queryType = assertType(schema.getType('Query'));\n *\n * queryType.toString(); // => 'Query'\n * assertType('Query'); // throws an error\n * ```\n */\nexport function assertType(type: unknown): GraphQLType {\n if (!isType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL type.`);\n }\n return type;\n}\n\n/** @private */\nconst scalarSymbol: unique symbol = Symbol('Scalar');\n\n/**\n * There are predicates for each kind of GraphQL type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLScalarType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isScalarType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * scalar DateTime\n *\n * type Query {\n * createdAt: DateTime\n * }\n * `);\n *\n * isScalarType(schema.getType('DateTime')); // => true\n * isScalarType(schema.getType('Query')); // => false\n * ```\n */\nexport function isScalarType(type: unknown): type is GraphQLScalarType {\n return instanceOf(type, scalarSymbol, GraphQLScalarType);\n}\n\n/**\n * Returns the value as a GraphQLScalarType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLScalarType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertScalarType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * scalar DateTime\n *\n * type Query {\n * createdAt: DateTime\n * }\n * `);\n *\n * const dateTimeType = assertScalarType(schema.getType('DateTime'));\n *\n * dateTimeType.name; // => 'DateTime'\n * assertScalarType(schema.getType('Query')); // throws an error\n * ```\n */\nexport function assertScalarType(type: unknown): GraphQLScalarType {\n if (!isScalarType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`);\n }\n return type;\n}\n\n/** @private */\nconst objectSymbol: unique symbol = Symbol('Object');\n\n/**\n * Returns true when the value is a GraphQLObjectType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type User {\n * name: String\n * }\n *\n * type Query {\n * user: User\n * }\n * `);\n *\n * isObjectType(schema.getType('User')); // => true\n * isObjectType(schema.getType('ReviewInput')); // => false\n * ```\n */\nexport function isObjectType(type: unknown): type is GraphQLObjectType {\n return instanceOf(type, objectSymbol, GraphQLObjectType);\n}\n\n/**\n * Returns the value as a GraphQLObjectType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type User {\n * name: String\n * }\n *\n * type Query {\n * user: User\n * }\n * `);\n *\n * const userType = assertObjectType(schema.getType('User'));\n *\n * Object.keys(userType.getFields()); // => ['name']\n * assertObjectType(schema.getType('ReviewInput')); // throws an error\n * ```\n */\nexport function assertObjectType(type: unknown): GraphQLObjectType {\n if (!isObjectType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`);\n }\n return type;\n}\n\n/** @private */\nconst fieldSymbol: unique symbol = Symbol('Field');\n\n/**\n * Returns true when the value is a resolved GraphQL field definition.\n * @param field - Value to inspect.\n * @returns True when the value is a GraphQLField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isField } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const field = schema.getQueryType().getFields().greeting;\n *\n * isField(field); // => true\n * isField(schema.getQueryType()); // => false\n * ```\n */\nexport function isField(field: unknown): field is GraphQLField {\n return instanceOf(field, fieldSymbol, GraphQLField);\n}\n\n/**\n * Returns the value as a GraphQLField, or throws if it is not one.\n * @param field - Value to inspect.\n * @returns The value typed as a GraphQLField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertField } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const field = assertField(schema.getQueryType().getFields().greeting);\n *\n * field.name; // => 'greeting'\n * assertField(schema.getQueryType()); // throws an error\n * ```\n */\nexport function assertField(field: unknown): GraphQLField {\n if (!isField(field)) {\n throw new Error(`Expected ${inspect(field)} to be a GraphQL field.`);\n }\n return field;\n}\n\n/** @private */\nconst argumentSymbol: unique symbol = Symbol('Argument');\n\n/**\n * Returns true when the value is a resolved GraphQL argument definition.\n * @param arg - Value to inspect.\n * @returns True when the value is a GraphQLArgument.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isArgument } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting(name: String): String }');\n * const arg = schema.getQueryType().getFields().greeting.args[0];\n *\n * isArgument(arg); // => true\n * isArgument(schema.getQueryType()); // => false\n * ```\n */\nexport function isArgument(arg: unknown): arg is GraphQLArgument {\n return instanceOf(arg, argumentSymbol, GraphQLArgument);\n}\n\n/**\n * Returns the value as a GraphQLArgument, or throws if it is not one.\n * @param arg - Value to inspect.\n * @returns The value typed as a GraphQLArgument.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertArgument } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting(name: String): String }');\n * const arg = assertArgument(schema.getQueryType().getFields().greeting.args[0]);\n *\n * arg.name; // => 'name'\n * assertArgument(schema.getQueryType()); // throws an error\n * ```\n */\nexport function assertArgument(arg: unknown): GraphQLArgument {\n if (!isArgument(arg)) {\n throw new Error(`Expected ${inspect(arg)} to be a GraphQL argument.`);\n }\n return arg;\n}\n\n/** @private */\nconst interfaceSymbol: unique symbol = Symbol('Interface');\n\n/**\n * Returns true when the value is a GraphQLInterfaceType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLInterfaceType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * isInterfaceType(schema.getType('Node')); // => true\n * isInterfaceType(schema.getType('User')); // => false\n * ```\n */\nexport function isInterfaceType(type: unknown): type is GraphQLInterfaceType {\n return instanceOf(type, interfaceSymbol, GraphQLInterfaceType);\n}\n\n/**\n * Returns the value as a GraphQLInterfaceType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLInterfaceType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const nodeType = assertInterfaceType(schema.getType('Node'));\n *\n * nodeType.name; // => 'Node'\n * assertInterfaceType(schema.getType('User')); // throws an error\n * ```\n */\nexport function assertInterfaceType(type: unknown): GraphQLInterfaceType {\n if (!isInterfaceType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Interface type.`,\n );\n }\n return type;\n}\n\n/** @private */\nconst unionSymbol: unique symbol = Symbol('Union');\n\n/**\n * Returns true when the value is a GraphQLUnionType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLUnionType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n *\n * isUnionType(schema.getType('Media')); // => true\n * isUnionType(schema.getType('Photo')); // => false\n * ```\n */\nexport function isUnionType(type: unknown): type is GraphQLUnionType {\n return instanceOf(type, unionSymbol, GraphQLUnionType);\n}\n\n/**\n * Returns the value as a GraphQLUnionType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLUnionType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n *\n * const mediaType = assertUnionType(schema.getType('Media'));\n *\n * mediaType.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * assertUnionType(schema.getType('Photo')); // throws an error\n * ```\n */\nexport function assertUnionType(type: unknown): GraphQLUnionType {\n if (!isUnionType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`);\n }\n return type;\n}\n\n/** @private */\nconst enumSymbol: unique symbol = Symbol('Enum');\n\n/**\n * Returns true when the value is a GraphQLEnumType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLEnumType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * favoriteEpisode: Episode\n * }\n * `);\n *\n * isEnumType(schema.getType('Episode')); // => true\n * isEnumType(schema.getType('Query')); // => false\n * ```\n */\nexport function isEnumType(type: unknown): type is GraphQLEnumType {\n return instanceOf(type, enumSymbol, GraphQLEnumType);\n}\n\n/**\n * Returns the value as a GraphQLEnumType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLEnumType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * favoriteEpisode: Episode\n * }\n * `);\n *\n * const episodeType = assertEnumType(schema.getType('Episode'));\n *\n * episodeType.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE']\n * assertEnumType(schema.getType('Query')); // throws an error\n * ```\n */\nexport function assertEnumType(type: unknown): GraphQLEnumType {\n if (!isEnumType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`);\n }\n return type;\n}\n\n/** @private */\nconst enumValueSymbol: unique symbol = Symbol('EnumValue');\n\n/**\n * Returns true when the value is a resolved GraphQL enum value definition.\n * @param value - Value to inspect.\n * @returns True when the value is a GraphQLEnumValue.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType, isEnumValue } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'enum Episode { NEW_HOPE } type Query { episode: Episode }',\n * );\n * const enumValue = assertEnumType(schema.getType('Episode')).getValues()[0];\n *\n * isEnumValue(enumValue); // => true\n * isEnumValue(schema.getType('Episode')); // => false\n * ```\n */\nexport function isEnumValue(value: unknown): value is GraphQLEnumValue {\n return instanceOf(value, enumValueSymbol, GraphQLEnumValue);\n}\n\n/**\n * Returns the value as a GraphQLEnumValue, or throws if it is not one.\n * @param value - Value to inspect.\n * @returns The value typed as a GraphQLEnumValue.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType, assertEnumValue } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'enum Episode { NEW_HOPE } type Query { episode: Episode }',\n * );\n * const enumValue = assertEnumValue(\n * assertEnumType(schema.getType('Episode')).getValues()[0],\n * );\n *\n * enumValue.name; // => 'NEW_HOPE'\n * assertEnumValue(schema.getType('Episode')); // throws an error\n * ```\n */\nexport function assertEnumValue(value: unknown): GraphQLEnumValue {\n if (!isEnumValue(value)) {\n throw new Error(`Expected ${inspect(value)} to be a GraphQL Enum value.`);\n }\n return value;\n}\n\n/** @private */\nconst inputObjectSymbol: unique symbol = Symbol('InputObject');\n\n/**\n * Returns true when the value is a GraphQLInputObjectType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLInputObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * isInputObjectType(schema.getType('ReviewInput')); // => true\n * isInputObjectType(schema.getType('Review')); // => false\n * ```\n */\nexport function isInputObjectType(\n type: unknown,\n): type is GraphQLInputObjectType {\n return instanceOf(type, inputObjectSymbol, GraphQLInputObjectType);\n}\n\n/**\n * Returns the value as a GraphQLInputObjectType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLInputObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * const inputType = assertInputObjectType(schema.getType('ReviewInput'));\n *\n * Object.keys(inputType.getFields()); // => ['stars']\n * assertInputObjectType(schema.getType('Review')); // throws an error\n * ```\n */\nexport function assertInputObjectType(type: unknown): GraphQLInputObjectType {\n if (!isInputObjectType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Input Object type.`,\n );\n }\n return type;\n}\n\n/** @private */\nconst inputFieldSymbol: unique symbol = Symbol('InputField');\n\n/**\n * Returns true when the value is a resolved GraphQL input field definition.\n * @param field - Value to inspect.\n * @returns True when the value is a GraphQLInputField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType, isInputField } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'input ReviewInput { stars: Int } type Query { ok: Boolean }',\n * );\n * const inputField = assertInputObjectType(\n * schema.getType('ReviewInput'),\n * ).getFields().stars;\n *\n * isInputField(inputField); // => true\n * isInputField(schema.getQueryType()); // => false\n * ```\n */\nexport function isInputField(field: unknown): field is GraphQLInputField {\n return instanceOf(field, inputFieldSymbol, GraphQLInputField);\n}\n\n/**\n * Returns the value as a GraphQLInputField, or throws if it is not one.\n * @param field - Value to inspect.\n * @returns The value typed as a GraphQLInputField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputField, assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'input ReviewInput { stars: Int } type Query { ok: Boolean }',\n * );\n * const inputField = assertInputField(\n * assertInputObjectType(schema.getType('ReviewInput')).getFields().stars,\n * );\n *\n * inputField.name; // => 'stars'\n * assertInputField(schema.getQueryType()); // throws an error\n * ```\n */\nexport function assertInputField(field: unknown): GraphQLInputField {\n if (!isInputField(field)) {\n throw new Error(`Expected ${inspect(field)} to be a GraphQL input field.`);\n }\n return field;\n}\n\n/** @private */\nconst listSymbol: unique symbol = Symbol('List');\n\n/**\n * Returns true when the value is a GraphQLList.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLList.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLList, GraphQLString, isListType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * tags: [String!]!\n * }\n * `);\n *\n * const tagsField = schema.getQueryType()?.getFields().tags;\n *\n * isListType(new GraphQLList(GraphQLString)); // => true\n * isListType(GraphQLString); // => false\n * isListType(tagsField?.type); // => false\n * ```\n */\nexport function isListType(\n type: GraphQLInputType,\n): type is GraphQLList;\n/**\n * Returns true when the output type is a GraphQLList.\n * @param type - The GraphQL output type to inspect.\n * @returns True when the output type is a list type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { getNullableType, isListType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * tags: [String!]!\n * }\n * `);\n *\n * const tagsField = schema.getQueryType()?.getFields().tags;\n * const nullableTagsType = getNullableType(tagsField?.type);\n *\n * isListType(nullableTagsType); // => true\n * ```\n */\nexport function isListType(\n type: GraphQLOutputType,\n): type is GraphQLList;\n/**\n * Returns true when the value is a GraphQLList.\n * @param type - The value to inspect.\n * @returns True when the value is a list type.\n * @example\n * ```ts\n * import { isListType } from 'graphql/type';\n *\n * isListType('[String]'); // => false\n * isListType(null); // => false\n * ```\n */\nexport function isListType(type: unknown): type is GraphQLList;\n/**\n * Returns true when the value is a GraphQLList.\n * @internal\n */\nexport function isListType(type: unknown): type is GraphQLList {\n return instanceOf(type, listSymbol, GraphQLList);\n}\n\n/**\n * Returns the value as a GraphQLList, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLList.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, assertListType } from 'graphql/type';\n *\n * const listType = assertListType(new GraphQLList(GraphQLString));\n *\n * listType.ofType; // => GraphQLString\n * assertListType(GraphQLString); // throws an error\n * ```\n */\nexport function assertListType(type: unknown): GraphQLList {\n if (!isListType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`);\n }\n return type;\n}\n\n/** @private */\nconst nonNullSymbol: unique symbol = Symbol('NonNull');\n\n/**\n * Returns true when the value is a GraphQLNonNull.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLNonNull.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLNonNull, GraphQLString, isNonNullType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String!\n * nickname: String\n * }\n * `);\n *\n * const fields = schema.getQueryType()?.getFields();\n *\n * isNonNullType(new GraphQLNonNull(GraphQLString)); // => true\n * isNonNullType(fields?.name.type); // => true\n * isNonNullType(fields?.nickname.type); // => false\n * ```\n */\nexport function isNonNullType(\n type: GraphQLInputType,\n): type is GraphQLNonNull;\n/**\n * Returns true when the output type is a GraphQLNonNull.\n * @param type - The GraphQL output type to inspect.\n * @returns True when the output type is a non-null type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isNonNullType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String!\n * nickname: String\n * }\n * `);\n *\n * const fields = schema.getQueryType()?.getFields();\n *\n * isNonNullType(fields?.name.type); // => true\n * isNonNullType(fields?.nickname.type); // => false\n * ```\n */\nexport function isNonNullType(\n type: GraphQLOutputType,\n): type is GraphQLNonNull;\n/**\n * Returns true when the value is a GraphQLNonNull.\n * @param type - The value to inspect.\n * @returns True when the value is a non-null type.\n * @example\n * ```ts\n * import { isNonNullType } from 'graphql/type';\n *\n * isNonNullType('String!'); // => false\n * isNonNullType(null); // => false\n * ```\n */\nexport function isNonNullType(\n type: unknown,\n): type is GraphQLNonNull;\n/**\n * Returns true when the value is a GraphQLNonNull.\n * @internal\n */\nexport function isNonNullType(\n type: unknown,\n): type is GraphQLNonNull {\n return instanceOf(type, nonNullSymbol, GraphQLNonNull);\n}\n\n/**\n * Returns the value as a GraphQLNonNull, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLNonNull.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString, assertNonNullType } from 'graphql/type';\n *\n * const nonNullType = assertNonNullType(new GraphQLNonNull(GraphQLString));\n *\n * nonNullType.ofType; // => GraphQLString\n * assertNonNullType(GraphQLString); // throws an error\n * ```\n */\nexport function assertNonNullType(\n type: unknown,\n): GraphQLNonNull {\n if (!isNonNullType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`);\n }\n return type;\n}\n\n/** These types may be used as input types for arguments and directives. */\nexport type GraphQLNullableInputType =\n | GraphQLNamedInputType\n | GraphQLList;\n\n/** These types may be used as input types for arguments and directives. */\nexport type GraphQLInputType =\n | GraphQLNullableInputType\n | GraphQLNonNull;\n\n/**\n * Returns true when the value can be used as a GraphQL input type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value can be used as a GraphQL input type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isInputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * isInputType(schema.getType('ReviewInput')); // => true\n * isInputType(schema.getType('Review')); // => false\n * ```\n */\nexport function isInputType(type: unknown): type is GraphQLInputType {\n return (\n isScalarType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n (isWrappingType(type) && isInputType(type.ofType))\n );\n}\n\n/**\n * Returns the value as a GraphQL input type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL input type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * const inputType = assertInputType(schema.getType('ReviewInput'));\n *\n * inputType.toString(); // => 'ReviewInput'\n * assertInputType(schema.getType('Review')); // throws an error\n * ```\n */\nexport function assertInputType(type: unknown): GraphQLInputType {\n if (!isInputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL input type.`);\n }\n return type;\n}\n\n/** These types may be used as output types as the result of fields. */\nexport type GraphQLNullableOutputType =\n | GraphQLNamedOutputType\n | GraphQLList;\n\n/** These types may be used as output types as the result of fields. */\nexport type GraphQLOutputType =\n | GraphQLNullableOutputType\n | GraphQLNonNull;\n\n/**\n * Returns true when the value can be used as a GraphQL output type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value can be used as a GraphQL output type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isOutputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * isOutputType(schema.getType('Review')); // => true\n * isOutputType(schema.getType('ReviewInput')); // => false\n * ```\n */\nexport function isOutputType(type: unknown): type is GraphQLOutputType {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n (isWrappingType(type) && isOutputType(type.ofType))\n );\n}\n\n/**\n * Returns the value as a GraphQL output type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL output type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertOutputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * const outputType = assertOutputType(schema.getType('Review'));\n *\n * outputType.toString(); // => 'Review'\n * assertOutputType(schema.getType('ReviewInput')); // throws an error\n * ```\n */\nexport function assertOutputType(type: unknown): GraphQLOutputType {\n if (!isOutputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL output type.`);\n }\n return type;\n}\n\n/** These types may describe types which may be leaf values. */\nexport type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;\n\n/**\n * Returns true when the value is a GraphQL scalar or enum type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL scalar or enum type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isLeafType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * episode: Episode\n * review: Review\n * }\n * `);\n *\n * isLeafType(schema.getType('Episode')); // => true\n * isLeafType(schema.getType('String')); // => true\n * isLeafType(schema.getType('Review')); // => false\n * ```\n */\nexport function isLeafType(type: unknown): type is GraphQLLeafType {\n return isScalarType(type) || isEnumType(type);\n}\n\n/**\n * Returns the value as a GraphQL leaf type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL leaf type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertLeafType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * episode: Episode\n * review: Review\n * }\n * `);\n *\n * const episodeType = assertLeafType(schema.getType('Episode'));\n *\n * episodeType.toString(); // => 'Episode'\n * assertLeafType(schema.getType('Review')); // throws an error\n * ```\n */\nexport function assertLeafType(type: unknown): GraphQLLeafType {\n if (!isLeafType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`);\n }\n return type;\n}\n\n/** These types may describe the parent context of a selection set. */\nexport type GraphQLCompositeType =\n | GraphQLObjectType\n | GraphQLInterfaceType\n | GraphQLUnionType;\n\n/**\n * Returns true when the value is a GraphQL object, interface, or union type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL object, interface, or union type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isCompositeType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * union SearchResult = User\n *\n * type Query {\n * node: Node\n * search: [SearchResult]\n * }\n * `);\n *\n * isCompositeType(schema.getType('User')); // => true\n * isCompositeType(schema.getType('Node')); // => true\n * isCompositeType(schema.getType('SearchResult')); // => true\n * isCompositeType(schema.getType('String')); // => false\n * ```\n */\nexport function isCompositeType(type: unknown): type is GraphQLCompositeType {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\n\n/**\n * Returns the value as a GraphQL composite type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL composite type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertCompositeType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const userType = assertCompositeType(schema.getType('User'));\n *\n * userType.toString(); // => 'User'\n * assertCompositeType(schema.getType('String')); // throws an error\n * ```\n */\nexport function assertCompositeType(type: unknown): GraphQLCompositeType {\n if (!isCompositeType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL composite type.`,\n );\n }\n return type;\n}\n\n/** These types may describe the parent context of a selection set. */\nexport type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType;\n\n/**\n * Returns true when the value is a GraphQL interface or union type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL interface or union type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isAbstractType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * union SearchResult = User\n *\n * type Query {\n * node: Node\n * search: [SearchResult]\n * }\n * `);\n *\n * isAbstractType(schema.getType('Node')); // => true\n * isAbstractType(schema.getType('SearchResult')); // => true\n * isAbstractType(schema.getType('User')); // => false\n * ```\n */\nexport function isAbstractType(type: unknown): type is GraphQLAbstractType {\n return isInterfaceType(type) || isUnionType(type);\n}\n\n/**\n * Returns the value as a GraphQL abstract type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL abstract type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertAbstractType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const nodeType = assertAbstractType(schema.getType('Node'));\n *\n * nodeType.toString(); // => 'Node'\n * assertAbstractType(schema.getType('User')); // throws an error\n * ```\n */\nexport function assertAbstractType(type: unknown): GraphQLAbstractType {\n if (!isAbstractType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`);\n }\n return type;\n}\n\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n * @typeParam T - The GraphQL type wrapped by this list type.\n * @example\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: new GraphQLList(PersonType) },\n * children: { type: new GraphQLList(PersonType) },\n * }),\n * });\n * ```\n */\nexport class GraphQLList<\n T extends GraphQLType,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLList instances.\n * @private\n */\n readonly __kind: symbol;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n // eslint-disable-next-line @typescript-eslint/no-unused-private-class-members\n declare private readonly __GraphQLListTypeBrand: never;\n\n /**\n * Creates a GraphQLList instance.\n * @param ofType - The type to wrap.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString } from 'graphql/type';\n *\n * const stringList = new GraphQLList(GraphQLString);\n *\n * stringList.ofType; // => GraphQLString\n * String(stringList); // => '[String]'\n * ```\n */\n constructor(ofType: T) {\n this.__kind = listSymbol;\n this.ofType = ofType;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLList';\n }\n\n /**\n * Returns this wrapping type as a GraphQL type-reference string.\n * @returns The GraphQL type-reference string.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const stringList = new GraphQLList(GraphQLString);\n * const requiredStringList = new GraphQLList(new GraphQLNonNull(GraphQLString));\n *\n * stringList.toString(); // => '[String]'\n * requiredStringList.toString(); // => '[String!]'\n * ```\n */\n toString(): string {\n return '[' + String(this.ofType) + ']';\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString } from 'graphql/type';\n *\n * const stringList = new GraphQLList(GraphQLString);\n *\n * stringList.toJSON(); // => '[String]'\n * JSON.stringify({ type: stringList }); // => '{\"type\":\"[String]\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n * @typeParam T - The nullable GraphQL type wrapped by this non-null type.\n * @example\n * ```ts\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: new GraphQLNonNull(GraphQLString) },\n * }),\n * });\n * ```\n *\n * Note: the enforcement of non-nullability occurs within the executor.\n */\nexport class GraphQLNonNull<\n T extends GraphQLNullableType,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLNonNull instances.\n * @private\n */\n readonly __kind: symbol;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n // eslint-disable-next-line @typescript-eslint/no-unused-private-class-members\n declare private readonly __GraphQLNonNullTypeBrand: never;\n\n /**\n * Creates a GraphQLNonNull instance.\n * @param ofType - The type to wrap.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n *\n * requiredString.ofType; // => GraphQLString\n * String(requiredString); // => 'String!'\n * ```\n */\n constructor(ofType: T) {\n this.__kind = nonNullSymbol;\n this.ofType = ofType;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLNonNull';\n }\n\n /**\n * Returns this wrapping type as a GraphQL type-reference string.\n * @returns The GraphQL type-reference string.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString));\n *\n * requiredString.toString(); // => 'String!'\n * requiredStringList.toString(); // => '[String]!'\n * ```\n */\n toString(): string {\n return String(this.ofType) + '!';\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n *\n * requiredString.toJSON(); // => 'String!'\n * JSON.stringify({ type: requiredString }); // => '{\"type\":\"String!\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/** These types wrap and modify other types */\n\nexport type GraphQLWrappingType =\n | GraphQLList\n | GraphQLNonNull;\n\n/**\n * Returns true when the value is a GraphQL list or non-null wrapper type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL list or non-null wrapper type.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * isWrappingType,\n * } from 'graphql/type';\n *\n * isWrappingType(new GraphQLList(GraphQLString)); // => true\n * isWrappingType(new GraphQLNonNull(GraphQLString)); // => true\n * isWrappingType(GraphQLString); // => false\n * ```\n */\nexport function isWrappingType(type: unknown): type is GraphQLWrappingType {\n return isListType(type) || isNonNullType(type);\n}\n\n/**\n * Returns the value as a GraphQL wrapping type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL wrapping type.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, assertWrappingType } from 'graphql/type';\n *\n * const wrappingType = assertWrappingType(new GraphQLList(GraphQLString));\n *\n * wrappingType.toString(); // => '[String]'\n * assertWrappingType(GraphQLString); // throws an error\n * ```\n */\nexport function assertWrappingType(type: unknown): GraphQLWrappingType {\n if (!isWrappingType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`);\n }\n return type;\n}\n\n/** These types can all accept null as a value. */\nexport type GraphQLNullableType = GraphQLNamedType | GraphQLList;\n\n/**\n * Returns true when the value is a GraphQL type that can accept null.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL type that can accept null.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString, isNullableType } from 'graphql/type';\n *\n * isNullableType(GraphQLString); // => true\n * isNullableType(new GraphQLNonNull(GraphQLString)); // => false\n * isNullableType(null); // => false\n * ```\n */\nexport function isNullableType(type: unknown): type is GraphQLNullableType {\n return isType(type) && !isNonNullType(type);\n}\n\n/**\n * Returns the value as a nullable GraphQL type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a nullable GraphQL type.\n * @example\n * ```ts\n * import {\n * GraphQLNonNull,\n * GraphQLString,\n * assertNullableType,\n * } from 'graphql/type';\n *\n * const nullableType = assertNullableType(GraphQLString);\n *\n * nullableType; // => GraphQLString\n * assertNullableType(new GraphQLNonNull(GraphQLString)); // throws an error\n * ```\n */\nexport function assertNullableType(type: unknown): GraphQLNullableType {\n if (!isNullableType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`);\n }\n return type;\n}\n\n/**\n * Returns the nullable type.\n * @param type - The GraphQL type to inspect.\n * @returns The nullable type after removing one non-null wrapper, if present.\n * @example\n * ```ts\n * import { getNullableType } from 'graphql/type';\n *\n * getNullableType(null); // => undefined\n * getNullableType(undefined); // => undefined\n * ```\n */\nexport function getNullableType(type: undefined | null): void;\n/**\n * Returns the nullable type after removing one non-null wrapper.\n * @param type - A nullable type or non-null wrapper.\n * @returns The nullable type after removing one non-null wrapper, if present.\n * @typeParam T - The nullable GraphQL type returned after removing one non-null wrapper.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * getNullableType,\n * } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n * const stringList = new GraphQLList(GraphQLString);\n *\n * getNullableType(requiredString); // => GraphQLString\n * getNullableType(stringList); // => stringList\n * ```\n */\nexport function getNullableType(\n type: T | GraphQLNonNull,\n): T;\n/**\n * Returns the nullable type after removing one non-null wrapper.\n * @param type - The GraphQL type to inspect.\n * @returns The nullable type after removing one non-null wrapper, if present.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * getNullableType,\n * } from 'graphql/type';\n *\n * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString));\n *\n * getNullableType(requiredStringList).toString(); // => '[String]'\n * getNullableType(GraphQLString); // => GraphQLString\n * ```\n */\nexport function getNullableType(\n type: Maybe,\n): GraphQLNullableType | undefined;\n/**\n * Returns the nullable type after removing one non-null wrapper.\n * @internal\n */\nexport function getNullableType(\n type: Maybe,\n): GraphQLNullableType | undefined {\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n\n/** These named types do not include modifiers like List or NonNull. */\nexport type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType;\n\n/** A named GraphQL type that can be used as an input type. */\nexport type GraphQLNamedInputType =\n | GraphQLScalarType\n | GraphQLEnumType\n | GraphQLInputObjectType;\n\n/** A named GraphQL type that can be used as an output type. */\nexport type GraphQLNamedOutputType =\n | GraphQLScalarType\n | GraphQLObjectType\n | GraphQLInterfaceType\n | GraphQLUnionType\n | GraphQLEnumType;\n\n/**\n * Returns true when the value is a GraphQL named type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL named type.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, isNamedType } from 'graphql/type';\n *\n * isNamedType(GraphQLString); // => true\n * isNamedType(new GraphQLList(GraphQLString)); // => false\n * isNamedType(null); // => false\n * ```\n */\nexport function isNamedType(type: unknown): type is GraphQLNamedType {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type)\n );\n}\n\n/**\n * Returns the value as a GraphQL named type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL named type.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, assertNamedType } from 'graphql/type';\n *\n * const namedType = assertNamedType(GraphQLString);\n *\n * namedType.name; // => 'String'\n * assertNamedType(new GraphQLList(GraphQLString)); // throws an error\n * ```\n */\nexport function assertNamedType(type: unknown): GraphQLNamedType {\n if (!isNamedType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL named type.`);\n }\n return type;\n}\n\n/**\n * Returns the named type.\n * @param type - The GraphQL type to inspect.\n * @returns The named type after unwrapping all list and non-null wrappers.\n * @example\n * ```ts\n * import { getNamedType } from 'graphql/type';\n *\n * getNamedType(null); // => undefined\n * getNamedType(undefined); // => undefined\n * ```\n */\nexport function getNamedType(type: undefined | null): void;\n/**\n * Returns the named input type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL input type to inspect.\n * @returns The named input type after unwrapping all wrappers.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { getNamedType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: [ReviewInput!]!): Boolean\n * }\n * `);\n *\n * const inputArg = schema.getQueryType()?.getFields().review.args[0];\n *\n * getNamedType(inputArg?.type).toString(); // => 'ReviewInput'\n * ```\n */\nexport function getNamedType(type: GraphQLInputType): GraphQLNamedInputType;\n/**\n * Returns the named output type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL output type to inspect.\n * @returns The named output type after unwrapping all wrappers.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { getNamedType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * users: [User!]!\n * }\n * `);\n *\n * const usersField = schema.getQueryType()?.getFields().users;\n *\n * getNamedType(usersField?.type).toString(); // => 'User'\n * ```\n */\nexport function getNamedType(type: GraphQLOutputType): GraphQLNamedOutputType;\n/**\n * Returns the named type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL type to inspect.\n * @returns The named type after unwrapping all wrappers.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * getNamedType,\n * } from 'graphql/type';\n *\n * const nestedType = new GraphQLNonNull(\n * new GraphQLList(new GraphQLNonNull(GraphQLString)),\n * );\n *\n * getNamedType(nestedType); // => GraphQLString\n * ```\n */\nexport function getNamedType(type: GraphQLType): GraphQLNamedType;\n/**\n * Returns the named type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL type to inspect.\n * @returns The named type after unwrapping all wrappers, or undefined for nullish input.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, getNamedType } from 'graphql/type';\n *\n * getNamedType(new GraphQLList(GraphQLString)); // => GraphQLString\n * getNamedType(undefined); // => undefined\n * ```\n */\nexport function getNamedType(\n type: Maybe,\n): GraphQLNamedType | undefined;\n/**\n * Returns the named type after unwrapping all list and non-null wrappers.\n * @internal\n */\nexport function getNamedType(\n type: Maybe,\n): GraphQLNamedType | undefined {\n if (type) {\n let unwrappedType = type;\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n return unwrappedType;\n }\n}\n\n/**\n * An interface for all Schema Elements.\n *\n * @internal\n */\n\nexport interface GraphQLSchemaElement {\n toString: () => string;\n toJSON: () => string;\n}\n\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n * @typeParam T - The element type returned by the thunk or array.\n */\nexport type ThunkReadonlyArray = (() => ReadonlyArray) | ReadonlyArray;\n/**\n * A thunk that resolves to an object map.\n * @typeParam T - Value type stored in the object map.\n */\nexport type ThunkObjMap = (() => ObjMap) | ObjMap;\n\n/**\n * Resolves a thunked readonly array.\n * @param thunk - The thunk or value to resolve.\n * @returns The resolved readonly array.\n * @typeParam T - The element type resolved from the thunk or array.\n * @example\n * ```ts\n * import { GraphQLString, resolveReadonlyArrayThunk } from 'graphql/type';\n *\n * const lazyFields = resolveReadonlyArrayThunk(() => [GraphQLString]);\n * const fields = resolveReadonlyArrayThunk([GraphQLString]);\n *\n * lazyFields; // => [GraphQLString]\n * fields; // => [GraphQLString]\n * ```\n */\nexport function resolveReadonlyArrayThunk(\n thunk: ThunkReadonlyArray,\n): ReadonlyArray {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n\n/**\n * Resolves a thunked object map.\n * @param thunk - The thunk or value to resolve.\n * @returns The resolved object map.\n * @typeParam T - The object-map value type resolved from the thunk or map.\n * @example\n * ```ts\n * import { GraphQLString, resolveObjMapThunk } from 'graphql/type';\n *\n * const lazyFields = resolveObjMapThunk(() => ({ name: GraphQLString }));\n * const fields = resolveObjMapThunk({ name: GraphQLString });\n *\n * lazyFields.name; // => GraphQLString\n * fields.name; // => GraphQLString\n * ```\n */\nexport function resolveObjMapThunk(thunk: ThunkObjMap): ObjMap {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLScalarTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Scalar Type Definition\n *\n * Scalar types define the leaf values of a GraphQL response and the input\n * values accepted by arguments and input object fields. A scalar type has a\n * name and coercion functions that validate and convert runtime values and\n * GraphQL literals.\n *\n * If a type's coerceOutputValue function returns `null` or does not return a\n * value (i.e. it returns `undefined`) then an error will be raised and a\n * `null` value will be returned in the response. Prefer validating inputs\n * before execution so clients receive input diagnostics before result coercion\n * fails.\n * Custom scalar behavior is defined via the following functions:\n *\n * - coerceOutputValue(value): Implements \"Result Coercion\". Given an internal value,\n * produces an external value valid for this type. Returns undefined or\n * throws an error to indicate invalid values.\n *\n * - coerceInputValue(value): Implements \"Input Coercion\" for values. Given an\n * external value (for example, variable values), produces an internal value\n * valid for this type. Returns undefined or throws an error to indicate\n * invalid values.\n *\n * - coerceInputLiteral(ast): Implements \"Input Coercion\" for constant literals.\n * Given a GraphQL literal (AST) (for example, an argument value), produces\n * an internal value valid for this type. Returns undefined or throws an\n * error to indicate invalid values.\n *\n * - valueToLiteral(value): Converts an external value to a GraphQL\n * literal (AST). Returns undefined or throws an error to indicate\n * invalid values.\n *\n * Deprecated, to be removed in v18:\n *\n * - serialize(value): Implements \"Result Coercion\". Renamed to\n * `coerceOutputValue()`.\n *\n * - parseValue(value): Implements \"Input Coercion\" for values. Renamed to\n * `coerceInputValue()`.\n *\n * - parseLiteral(ast): Implements \"Input Coercion\" for literals including\n * non-specified replacement of variables embedded within complex scalars.\n * Replaced by the combination of the `replaceVariables()` utility and the\n * `coerceInputLiteral()` method.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n * @example\n * ```ts\n * import { GraphQLScalarType, Kind } from 'graphql';\n *\n * const ensureOdd = (value) => {\n * if (!Number.isFinite(value)) {\n * throw new Error(\n * `Scalar \"Odd\" cannot represent \"${value}\" since it is not a finite number.`,\n * );\n * }\n *\n * if (value % 2 === 0) {\n * throw new Error(\n * `Scalar \"Odd\" cannot represent \"${value}\" since it is even.`,\n * );\n * }\n *\n * return value;\n * };\n *\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * coerceOutputValue: (value) => {\n * return ensureOdd(value);\n * },\n * coerceInputValue: (value) => {\n * return ensureOdd(value);\n * },\n * valueToLiteral: (value) => {\n * return { kind: Kind.INT, value: String(ensureOdd(value)) };\n * },\n * });\n * ```\n */\nexport class GraphQLScalarType<\n TInternal = unknown,\n TExternal = TInternal,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLScalarType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** URL identifying the behavior specified for this custom scalar. */\n specifiedByURL: Maybe;\n /**\n * Deprecated legacy serializer used to convert internal values for response\n * output. Use `coerceOutputValue()` instead.\n * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18\n */\n serialize: GraphQLScalarSerializer;\n /**\n * Deprecated legacy parser used to convert externally provided input values.\n * Use `coerceInputValue()` instead.\n * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18\n */\n parseValue: GraphQLScalarValueParser;\n /**\n * Deprecated legacy parser used to convert externally provided input\n * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.\n * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18\n */\n parseLiteral: GraphQLScalarLiteralParser;\n /** Coercer used to convert internal scalar values for response output. */\n coerceOutputValue: GraphQLScalarOutputValueCoercer;\n /** Coercer used to convert externally provided scalar input values. */\n coerceInputValue: GraphQLScalarInputValueCoercer;\n /** Coercer used to convert GraphQL scalar input literals. */\n coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined;\n /** Converter used to produce GraphQL literals from runtime input values. */\n valueToLiteral: GraphQLScalarValueToLiteral | undefined;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n /**\n * Creates a GraphQLScalarType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { Kind, parse } from 'graphql/language';\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const document = parse(`\n * \"Odd integer values.\"\n * scalar Odd @specifiedBy(url: \"https://example.com/odd\")\n *\n * extend scalar Odd @specifiedBy(url: \"https://example.com/odd-v2\")\n * `);\n *\n * const Odd = new GraphQLScalarType({\n * name: 'Odd',\n * description: 'Odd integer values.',\n * specifiedByURL: 'https://example.com/odd',\n * coerceOutputValue: (value) => {\n * if (typeof value !== 'number' || value % 2 === 0) {\n * throw new TypeError('Odd can only produce odd numbers.');\n * }\n * return value;\n * },\n * coerceInputValue: (value) => {\n * if (typeof value !== 'number' || value % 2 === 0) {\n * throw new TypeError('Odd can only accept odd numbers.');\n * }\n * return value;\n * },\n * coerceInputLiteral: (ast) => {\n * if (ast.kind !== Kind.INT) {\n * throw new TypeError('Odd can only accept integer literals.');\n * }\n * const value = Number(ast.value);\n * if (value % 2 === 0) {\n * throw new TypeError('Odd can only accept odd integer literals.');\n * }\n * return value;\n * },\n * valueToLiteral: (value) => {\n * return { kind: Kind.INT, value: String(ensureOdd(value)) };\n * },\n * extensions: { numeric: true },\n * astNode: document.definitions[0],\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * Odd.description; // => 'Odd integer values.'\n * Odd.specifiedByURL; // => 'https://example.com/odd'\n * Odd.coerceOutputValue(3); // => 3\n * Odd.coerceInputValue(5); // => 5\n * Odd.extensions; // => { numeric: true }\n * ```\n */\n constructor(config: Readonly>) {\n this.__kind = scalarSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.specifiedByURL = config.specifiedByURL;\n this.serialize =\n config.serialize ??\n config.coerceOutputValue ??\n (identityFunc as GraphQLScalarSerializer);\n this.parseValue =\n config.parseValue ??\n config.coerceInputValue ??\n (identityFunc as GraphQLScalarValueParser);\n this.parseLiteral =\n config.parseLiteral ??\n ((node, variables) =>\n this.coerceInputValue(valueFromASTUntyped(node, variables)));\n this.coerceOutputValue = config.coerceOutputValue ?? this.serialize;\n this.coerceInputValue = config.coerceInputValue ?? this.parseValue;\n this.coerceInputLiteral = config.coerceInputLiteral;\n this.valueToLiteral = config.valueToLiteral;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n if (config.parseLiteral) {\n devAssert(\n typeof config.parseValue === 'function' &&\n typeof config.parseLiteral === 'function',\n `${this.name} must provide both \"parseValue\" and \"parseLiteral\" functions.`,\n );\n }\n\n if (config.coerceInputLiteral) {\n devAssert(\n typeof config.coerceInputValue === 'function' &&\n typeof config.coerceInputLiteral === 'function',\n `${this.name} must provide both \"coerceInputValue\" and \"coerceInputLiteral\" functions.`,\n );\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLScalarType';\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const Url = new GraphQLScalarType({\n * name: 'Url',\n * description: 'An absolute URL string.',\n * specifiedByURL: 'https://url.spec.whatwg.org/',\n * });\n *\n * const config = Url.toConfig();\n * const UrlCopy = new GraphQLScalarType(config);\n *\n * config.name; // => 'Url'\n * config.specifiedByURL; // => 'https://url.spec.whatwg.org/'\n * UrlCopy.name; // => Url.name\n * ```\n */\n toConfig(): GraphQLScalarTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n specifiedByURL: this.specifiedByURL,\n serialize: this.serialize,\n parseValue: this.parseValue,\n parseLiteral: this.parseLiteral,\n coerceOutputValue: this.coerceOutputValue,\n coerceInputValue: this.coerceInputValue,\n coerceInputLiteral: this.coerceInputLiteral,\n valueToLiteral: this.valueToLiteral,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this scalar type.\n * @returns The schema coordinate for this scalar type.\n * @example\n * ```ts\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const DateTime = new GraphQLScalarType({ name: 'DateTime' });\n *\n * DateTime.toString(); // => 'DateTime'\n * String(DateTime); // => 'DateTime'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const DateTime = new GraphQLScalarType({ name: 'DateTime' });\n *\n * DateTime.toJSON(); // => 'DateTime'\n * JSON.stringify({ type: DateTime }); // => '{\"type\":\"DateTime\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Deprecated function type that serializes a runtime value as a scalar output\n * value. Use `GraphQLScalarOutputValueCoercer` instead.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n * @deprecated Use GraphQLScalarOutputValueCoercer instead. Will be removed in v18.\n */\nexport type GraphQLScalarSerializer = (\n outputValue: unknown,\n) => TExternal;\n\n/**\n * Function used to coerce internal scalar values for response output.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n */\nexport type GraphQLScalarOutputValueCoercer = (\n outputValue: unknown,\n) => TExternal;\n\n/**\n * Deprecated function type that parses a runtime input value as a scalar input\n * value. Use `GraphQLScalarInputValueCoercer` instead.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @deprecated Use GraphQLScalarInputValueCoercer instead. Will be removed in v18.\n */\nexport type GraphQLScalarValueParser = (\n inputValue: unknown,\n) => TInternal;\n\n/**\n * Function used to coerce externally provided scalar input values.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n */\nexport type GraphQLScalarInputValueCoercer = (\n inputValue: unknown,\n) => TInternal;\n\n/**\n * Deprecated function type that parses a GraphQL value literal as a scalar\n * input value. Use `GraphQLScalarInputLiteralCoercer` instead.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @deprecated Use GraphQLScalarInputLiteralCoercer instead. Will be removed in v18.\n */\nexport type GraphQLScalarLiteralParser = (\n valueNode: ValueNode,\n variables: Maybe>,\n) => Maybe;\n\n/**\n * Function used to coerce GraphQL scalar input literals.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n */\nexport type GraphQLScalarInputLiteralCoercer = (\n valueNode: ConstValueNode,\n) => Maybe;\n\n/** @internal */\nexport type GraphQLScalarValueToLiteral = (\n inputValue: unknown,\n) => ConstValueNode | undefined;\n\n/**\n * Configuration used to construct a GraphQLScalarType.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n */\nexport interface GraphQLScalarTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** URL identifying the behavior specified for this custom scalar. */\n specifiedByURL?: Maybe;\n /**\n * Deprecated legacy serializer used to convert internal values for response\n * output. Use `coerceOutputValue()` instead.\n * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18\n */\n serialize?: GraphQLScalarSerializer | undefined;\n /**\n * Deprecated legacy parser used to convert externally provided input values.\n * Use `coerceInputValue()` instead.\n * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18\n */\n parseValue?: GraphQLScalarValueParser | undefined;\n /**\n * Deprecated legacy parser used to convert externally provided input\n * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.\n * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18\n */\n parseLiteral?: GraphQLScalarLiteralParser | undefined;\n /** Coerces an internal value to include in a response. */\n coerceOutputValue?: GraphQLScalarOutputValueCoercer | undefined;\n /** Coerces an externally provided value to use as an input. */\n coerceInputValue?: GraphQLScalarInputValueCoercer | undefined;\n /** Coerces an externally provided const literal value to use as an input. */\n coerceInputLiteral?: GraphQLScalarInputLiteralCoercer | undefined;\n /** Translates an externally provided value to a literal (AST). */\n valueToLiteral?: GraphQLScalarValueToLiteral | undefined;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLScalarTypeNormalizedConfig<\n TInternal,\n TExternal,\n> extends GraphQLScalarTypeConfig {\n serialize: GraphQLScalarSerializer;\n parseValue: GraphQLScalarValueParser;\n parseLiteral: GraphQLScalarLiteralParser;\n coerceOutputValue: GraphQLScalarOutputValueCoercer;\n coerceInputValue: GraphQLScalarInputValueCoercer;\n coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n * We've provided these template arguments because this is an open type and\n * you may find them useful.\n * @typeParam _TSource - Reserved source type parameter for extension typing.\n * @typeParam _TContext - Reserved context type parameter for extension typing.\n */\nexport interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TAbstract - Runtime value type used for abstract type resolution.\n * @example\n * ```ts\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve: (obj) => {\n * return obj.number + ' ' + obj.street;\n * },\n * },\n * },\n * });\n * ```\n * @example\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * }),\n * });\n * ```\n */\nexport class GraphQLObjectType<\n TSource = any,\n TContext = any,\n TAbstract = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLObjectType instances.\n * @private\n */\n readonly __kind: typeof objectSymbol = objectSymbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Predicate used to determine whether a runtime value belongs to this object type. */\n isTypeOf: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions: Readonly>;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _fields: ThunkObjMap>;\n private _interfaces: ThunkReadonlyArray;\n\n /**\n * Creates a GraphQLObjectType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * // Configure an object type with interfaces, fields, arguments, and metadata.\n * import { parse } from 'graphql/language';\n * import {\n * GraphQLID,\n * GraphQLInterfaceType,\n * GraphQLNonNull,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * type User implements Node {\n * id: ID!\n * name(format: String = \"short\"): String\n * }\n *\n * extend type User {\n * displayName: String\n * }\n * `);\n * const definition = document.definitions[0];\n * const nameField = definition.fields[1];\n * const formatArg = nameField.arguments[0];\n *\n * const Node = new GraphQLInterfaceType({\n * name: 'Node',\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * });\n *\n * const User = new GraphQLObjectType({\n * name: 'User',\n * description: 'A registered user.',\n * interfaces: [Node],\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * name: {\n * description: 'The formatted user name.',\n * type: GraphQLString,\n * args: {\n * format: {\n * description: 'Controls the name format.',\n * type: GraphQLString,\n * default: { value: 'short' },\n * deprecationReason: 'Use locale instead.',\n * extensions: { public: true },\n * astNode: formatArg,\n * },\n * },\n * resolve: (user, { format }) => {\n * return format === 'long' ? user.fullName : user.name;\n * },\n * deprecationReason: 'Use displayName.',\n * extensions: { cacheSeconds: 60 },\n * astNode: nameField,\n * },\n * },\n * isTypeOf: (value) => {\n * return typeof value === 'object' && value != null && 'id' in value;\n * },\n * extensions: { entity: 'User' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * User.name; // => 'User'\n * User.getInterfaces(); // => [Node]\n * Object.keys(User.getFields()); // => ['id', 'name']\n * User.getFields().name.args[0].default.value; // => 'short'\n * User.extensions; // => { entity: 'User' }\n * ```\n * @example\n * ```ts\n * // This variant configures a subscription field with subscribe and resolve functions.\n * import { GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Subscription = new GraphQLObjectType({\n * name: 'Subscription',\n * fields: {\n * greeting: {\n * type: GraphQLString,\n * subscribe: async function* () {\n * yield { greeting: 'Hello!' };\n * },\n * resolve: (event) => {\n * return event.greeting;\n * },\n * },\n * },\n * });\n *\n * typeof Subscription.getFields().greeting.subscribe; // => 'function'\n * ```\n */\n constructor(\n config: Readonly>,\n ) {\n this.__kind = objectSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.isTypeOf = config.isTypeOf;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n this._fields = (defineFieldMap).bind(\n undefined,\n this,\n config.fields,\n );\n this._interfaces = defineInterfaces.bind(undefined, config.interfaces);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLObjectType';\n }\n\n /**\n * Returns the fields defined by this type.\n * @returns The fields keyed by field name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type User {\n * id: ID!\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const User = assertObjectType(schema.getType('User'));\n * const fields = User.getFields();\n *\n * Object.keys(fields); // => ['id', 'name']\n * String(fields.id.type); // => 'ID!'\n * ```\n */\n getFields(): GraphQLFieldMap {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n return this._fields;\n }\n\n /**\n * Returns the interfaces implemented by this type.\n * @returns The implemented interfaces.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const User = assertObjectType(schema.getType('User'));\n *\n * User.getInterfaces().map((type) => type.name); // => ['Node']\n * ```\n */\n getInterfaces(): ReadonlyArray {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n return this._interfaces;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const User = new GraphQLObjectType({\n * name: 'User',\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const config = User.toConfig();\n * const UserCopy = new GraphQLObjectType(config);\n *\n * config.fields.name.type; // => GraphQLString\n * UserCopy.getFields().name.type; // => GraphQLString\n * ```\n */\n toConfig(): GraphQLObjectTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: mapValue(this.getFields(), (field) => field.toConfig()),\n isTypeOf: this.isTypeOf,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this object type.\n * @returns The schema coordinate for this object type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const User = assertObjectType(schema.getType('User'));\n *\n * User.toString(); // => 'User'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const User = new GraphQLObjectType({\n * name: 'User',\n * fields: { name: { type: GraphQLString } },\n * });\n *\n * User.toJSON(); // => 'User'\n * JSON.stringify({ type: User }); // => '{\"type\":\"User\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineInterfaces(\n interfaces: Maybe>,\n): ReadonlyArray {\n return resolveReadonlyArrayThunk(interfaces ?? []);\n}\n\nfunction defineFieldMap(\n parentType:\n | GraphQLObjectType\n | GraphQLInterfaceType,\n fields: ThunkObjMap>,\n): GraphQLFieldMap {\n const fieldMap = resolveObjMapThunk(fields);\n\n return mapValue(\n fieldMap,\n (fieldConfig, fieldName) =>\n new GraphQLField(parentType, fieldName, fieldConfig),\n );\n}\n\n/**\n * Configuration used to construct a GraphQLObjectType.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TAbstract - Runtime value type used for abstract type resolution.\n */\nexport interface GraphQLObjectTypeConfig<\n TSource,\n TContext,\n TAbstract = unknown,\n> {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Interfaces implemented by this object or interface type. */\n interfaces?: ThunkReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n fields: ThunkObjMap>;\n /** Predicate used to determine whether a runtime value belongs to this object type. */\n isTypeOf?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLObjectTypeNormalizedConfig<\n TSource,\n TContext,\n TAbstract = unknown,\n> extends GraphQLObjectTypeConfig {\n interfaces: ReadonlyArray;\n fields: GraphQLFieldNormalizedConfigMap;\n extensions: Readonly>;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Resolves the concrete object type for an abstract GraphQL type.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLTypeResolver = (\n value: TSource,\n context: TContext,\n info: GraphQLResolveInfo,\n abstractType: GraphQLAbstractType,\n) => PromiseOrValue;\n\n/**\n * Checks whether a runtime value belongs to a GraphQL object type.\n * @typeParam TAbstract - Runtime value type used for abstract type resolution.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLIsTypeOfFn = (\n value: TAbstract,\n context: TContext,\n info: GraphQLResolveInfo,\n) => PromiseOrValue;\n\n/**\n * Resolves the runtime value for a GraphQL field.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TArgs - Argument object type passed to resolvers.\n * @typeParam TResult - Result value type.\n */\nexport type GraphQLFieldResolver<\n TSource,\n TContext,\n TArgs = any,\n TResult = unknown,\n> = (\n source: TSource,\n args: TArgs,\n context: TContext,\n info: GraphQLResolveInfo,\n) => TResult;\n\n/** Utilities available from resolver info for tracking asynchronous work. */\nexport interface GraphQLResolveInfoHelpers {\n /**\n * Promise.all wrapper that allows rejected branches to be tracked\n * as execution async work.\n *\n * Intended use: return or await this promise from resolver work.\n * Un-awaited async side effects are an anti-pattern:\n *\n * const { promiseAll } = info.getAsyncHelpers();\n * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined);\n *\n * In that anti-pattern, tracking starts only after rejection (on a\n * later microtask), so this work is not guaranteed to delay\n * `hooks.asyncWorkFinished`.\n *\n * Use `track(...)` for un-awaited async side effects:\n *\n * const { track } = info.getAsyncHelpers();\n * track([\n * someAsyncWork().catch(() => undefined),\n * someOtherAsyncWork().catch(() => undefined)\n * ]);\n */\n readonly promiseAll: (\n values: ReadonlyArray | T>,\n ) => Promise>;\n /** Tracks asynchronous work that should delay execution completion hooks. */\n readonly track: (maybePromises: ReadonlyArray) => void;\n}\n\n/** Information about the currently executing GraphQL field. */\nexport interface GraphQLResolveInfo {\n /** The field name referenced by this schema coordinate. */\n readonly fieldName: string;\n /** AST field nodes that contributed to the current field execution. */\n readonly fieldNodes: ReadonlyArray;\n /** GraphQL output type declared for the current field. */\n readonly returnType: GraphQLOutputType;\n /** Object type that owns the current field. */\n readonly parentType: GraphQLObjectType;\n /** Response path where this error occurred during execution. */\n readonly path: Path;\n /** The schema used for validation or execution. */\n readonly schema: GraphQLSchema;\n /** Fragment definitions in the operation document keyed by fragment name. */\n readonly fragments: ObjMap;\n /** Initial root value passed to the operation. */\n readonly rootValue: unknown;\n /** The operation selected for execution. */\n readonly operation: OperationDefinitionNode;\n /**\n * Coerced variable values and source metadata for this operation. Resolver\n * code that needs runtime variable values should read `variableValues.coerced`.\n */\n readonly variableValues: VariableValues;\n /** Returns the AbortSignal supplied for this execution, if any. */\n readonly getAbortSignal: () => AbortSignal | undefined;\n /** Returns helper functions for tracking asynchronous resolver work. */\n readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n * We've provided these template arguments because this is an open type and\n * you may find them useful.\n * @typeParam _TSource - Reserved source type parameter for extension typing.\n * @typeParam _TContext - Reserved context type parameter for extension typing.\n * @typeParam _TArgs - Reserved argument type parameter for extension typing.\n */\nexport interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Configuration used to define a GraphQL field.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TArgs - Argument object type passed to resolvers.\n */\nexport interface GraphQLFieldConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLOutputType;\n /** Arguments accepted by this field or directive. */\n args?: GraphQLFieldConfigArgumentMap | undefined;\n /** Resolver function used to produce this field value. */\n resolve?: GraphQLFieldResolver | undefined;\n /** Resolver function used to create a subscription event stream for this field. */\n subscribe?: GraphQLFieldResolver | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe<\n Readonly>\n >;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** @internal */\nexport interface GraphQLFieldNormalizedConfig<\n TSource,\n TContext,\n TArgs = any,\n> extends GraphQLFieldConfig {\n args: GraphQLFieldNormalizedConfigArgumentMap;\n extensions: Readonly>;\n}\n\n/** A map of argument names to argument configuration objects. */\nexport type GraphQLFieldConfigArgumentMap = ObjMap;\n\n/** @internal */\nexport type GraphQLFieldNormalizedConfigArgumentMap =\n ObjMap;\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLArgumentExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** Configuration used to define a GraphQL argument. */\nexport interface GraphQLArgumentConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value for this argument. Use `default` instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue?: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default?: GraphQLDefaultInput | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** @internal */\nexport interface GraphQLArgumentNormalizedConfig extends GraphQLArgumentConfig {\n default: GraphQLDefaultInput | undefined;\n extensions: Readonly;\n}\n\n/**\n * A map of field names to field configuration objects.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLFieldConfigMap = ObjMap<\n GraphQLFieldConfig\n>;\n\n/** @internal */\nexport type GraphQLFieldNormalizedConfigMap = ObjMap<\n GraphQLFieldNormalizedConfig\n>;\n\n/**\n * A resolved GraphQL field definition.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TArgs - Argument object type passed to resolvers.\n */\nexport class GraphQLField<\n TSource = any,\n TContext = any,\n TArgs = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLField instances.\n * @private\n */\n readonly __kind: symbol;\n /** Object or interface type that owns this field, if known. */\n parentType:\n | GraphQLObjectType\n | GraphQLInterfaceType\n | undefined;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLOutputType;\n /** Arguments accepted by this field or directive. */\n args: ReadonlyArray;\n /** Resolver function used to produce this field value. */\n resolve?: GraphQLFieldResolver | undefined;\n /** Resolver function used to create a subscription event stream for this field. */\n subscribe?: GraphQLFieldResolver | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly>;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL field definition.\n * @param parentType - Object or interface type that owns this field, if known.\n * @param name - Field name.\n * @param config - Field configuration.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const document = parse('type Query { greeting: String }');\n * const fieldNode = document.definitions[0].fields[0];\n * const field = new GraphQLField(Query, 'greeting', {\n * description: 'Greeting text.',\n * type: GraphQLString,\n * args: {\n * name: { type: GraphQLString, default: { value: 'world' } },\n * },\n * resolve: (_source, { name }) => `Hello, ${name}!`,\n * subscribe: async function* () {\n * yield { greeting: 'Hello!' };\n * },\n * deprecationReason: 'Use hello.',\n * extensions: { cacheSeconds: 60 },\n * astNode: fieldNode,\n * });\n *\n * field.parentType; // => Query\n * field.name; // => 'greeting'\n * field.args[0].default.value; // => 'world'\n * typeof field.subscribe; // => 'function'\n * field.deprecationReason; // => 'Use hello.'\n * field.astNode; // => fieldNode\n * ```\n */\n constructor(\n parentType:\n | GraphQLObjectType\n | GraphQLInterfaceType\n | undefined,\n name: string,\n config: GraphQLFieldConfig,\n ) {\n this.__kind = fieldSymbol;\n this.parentType = parentType;\n this.name = assertName(name);\n this.description = config.description;\n this.type = config.type;\n\n const argsConfig = config.args;\n this.args = argsConfig\n ? Object.entries(argsConfig).map(\n ([argName, argConfig]) =>\n new GraphQLArgument(this, argName, argConfig),\n )\n : [];\n\n this.resolve = config.resolve;\n this.subscribe = config.subscribe;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLField';\n }\n\n /**\n * Returns a normalized configuration object for this field.\n * @returns A configuration object that can be used to recreate this field.\n * @example\n * ```ts\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', {\n * type: GraphQLString,\n * extensions: { cacheSeconds: 60 },\n * });\n *\n * field.toConfig().type; // => GraphQLString\n * field.toConfig().extensions; // => { cacheSeconds: 60 }\n * ```\n */\n toConfig(): GraphQLFieldNormalizedConfig {\n return {\n description: this.description,\n type: this.type,\n args: keyValMap(\n this.args,\n (arg) => arg.name,\n (arg) => arg.toConfig(),\n ),\n resolve: this.resolve,\n subscribe: this.subscribe,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this field as a schema coordinate string.\n * @returns The field coordinate.\n * @example\n * ```ts\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n *\n * field.toString(); // => 'Query.greeting'\n * ```\n */\n toString(): string {\n return `${this.parentType ?? ''}.${this.name}`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The field coordinate.\n * @example\n * ```ts\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n *\n * JSON.stringify(field); // => '\"Query.greeting\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/** A resolved GraphQL argument definition. */\nexport class GraphQLArgument implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLArgument instances.\n * @private\n */\n readonly __kind: symbol;\n /** Field or directive that owns this argument. */\n parent: GraphQLField | GraphQLDirective;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value used when no explicit value is supplied.\n * Use `default` instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default: GraphQLDefaultInput | undefined;\n /**\n * Cached coerced default value.\n * @private\n */\n _memoizedCoercedDefaultValue: unknown;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL argument definition.\n * @param parent - Field or directive that owns this argument.\n * @param name - Argument name.\n * @param config - Argument configuration.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', {\n * type: GraphQLString,\n * default: { value: 'world' },\n * });\n *\n * arg.parent; // => field\n * arg.name; // => 'name'\n * arg.default.value; // => 'world'\n * ```\n */\n constructor(\n parent: GraphQLField | GraphQLDirective,\n name: string,\n config: GraphQLArgumentConfig,\n ) {\n this.__kind = argumentSymbol;\n this.parent = parent;\n this.name = assertName(name);\n this.description = config.description;\n this.type = config.type;\n this.defaultValue = config.defaultValue;\n this.default = config.default;\n this._memoizedCoercedDefaultValue = undefined;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLArgument';\n }\n\n /**\n * Returns a normalized configuration object for this argument.\n * @returns A configuration object that can be used to recreate this argument.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', {\n * type: GraphQLString,\n * default: { value: 'world' },\n * });\n *\n * arg.toConfig().default.value; // => 'world'\n * ```\n */\n toConfig(): GraphQLArgumentNormalizedConfig {\n return {\n description: this.description,\n type: this.type,\n defaultValue: this.defaultValue,\n default: this.default,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this argument as a schema coordinate string.\n * @returns The argument coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });\n *\n * arg.toString(); // => 'Query.greeting(name:)'\n * ```\n */\n toString(): string {\n return `${this.parent}(${this.name}:)`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The argument coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });\n *\n * JSON.stringify(arg); // => '\"Query.greeting(name:)\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Returns true when the argument is non-null and has no default value.\n * @param arg - The argument definition to inspect.\n * @returns True when the argument is non-null and has no default value.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLObjectType,\n * GraphQLString,\n * isRequiredArgument,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'reviews', { type: GraphQLString });\n * const requiredArgument = new GraphQLArgument(field, 'id', {\n * type: new GraphQLNonNull(GraphQLInt),\n * });\n * const optionalArgument = new GraphQLArgument(field, 'name', {\n * type: GraphQLString,\n * });\n * const argumentWithDefault = new GraphQLArgument(field, 'limit', {\n * type: new GraphQLNonNull(GraphQLInt),\n * default: { value: 10 },\n * });\n *\n * isRequiredArgument(requiredArgument); // => true\n * isRequiredArgument(optionalArgument); // => false\n * isRequiredArgument(argumentWithDefault); // => false\n * ```\n */\nexport function isRequiredArgument(\n arg: GraphQLArgument | GraphQLVariableSignature,\n): boolean {\n return (\n isNonNullType(arg.type) &&\n arg.default === undefined &&\n arg.defaultValue === undefined\n );\n}\n\n/**\n * A map of field names to resolved field definitions.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLFieldMap = ObjMap<\n GraphQLField\n>;\n\n/** Default input represented as either a runtime value or a GraphQL literal. */\nexport type GraphQLDefaultInput =\n | {\n /** Runtime default value. */\n value: unknown;\n /** GraphQL literal default value is not provided in this variant. */\n literal?: never;\n }\n | {\n /** GraphQL literal default value. */\n literal: ConstValueNode;\n /** Runtime default value is not provided in this variant. */\n value?: never;\n };\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLInterfaceTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @example\n * ```ts\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n * ```\n */\nexport class GraphQLInterfaceType<\n TSource = any,\n TContext = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLInterfaceType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Function that resolves the concrete object type for this abstract type. */\n resolveType: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _fields: ThunkObjMap>;\n private _interfaces: ThunkReadonlyArray;\n\n /**\n * Creates a GraphQLInterfaceType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';\n *\n * const document = parse(`\n * interface Node {\n * id: ID!\n * }\n *\n * interface Resource implements Node {\n * id: ID!\n * }\n *\n * extend interface Resource {\n * url: String\n * }\n * `);\n *\n * const Node = new GraphQLInterfaceType({\n * name: 'Node',\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * });\n *\n * const Resource = new GraphQLInterfaceType({\n * name: 'Resource',\n * description: 'An addressable resource.',\n * interfaces: [Node],\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * resolveType: (value) => {\n * return typeof value === 'object' && value != null && 'url' in value\n * ? 'WebPage'\n * : null;\n * },\n * extensions: { abstract: true },\n * astNode: document.definitions[1],\n * extensionASTNodes: [document.definitions[2]],\n * });\n *\n * Resource.name; // => 'Resource'\n * Resource.getInterfaces(); // => [Node]\n * Object.keys(Resource.getFields()); // => ['id']\n * Resource.extensions; // => { abstract: true }\n * ```\n */\n constructor(config: Readonly>) {\n this.__kind = interfaceSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n this._fields = (defineFieldMap).bind(\n undefined,\n this,\n config.fields,\n );\n this._interfaces = defineInterfaces.bind(undefined, config.interfaces);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLInterfaceType';\n }\n\n /**\n * Returns the fields defined by this type.\n * @returns The fields keyed by field name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const fields = Node.getFields();\n *\n * Object.keys(fields); // => ['id']\n * String(fields.id.type); // => 'ID!'\n * ```\n */\n getFields(): GraphQLFieldMap {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n return this._fields;\n }\n\n /**\n * Returns the interfaces implemented by this type.\n * @returns The implemented interfaces.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Resource {\n * url: String!\n * }\n *\n * interface Image implements Resource {\n * url: String!\n * width: Int\n * }\n *\n * type Photo implements Resource & Image {\n * url: String!\n * width: Int\n * }\n *\n * type Query {\n * image: Image\n * }\n * `);\n *\n * const Image = assertInterfaceType(schema.getType('Image'));\n *\n * Image.getInterfaces().map((type) => type.name); // => ['Resource']\n * ```\n */\n getInterfaces(): ReadonlyArray {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n return this._interfaces;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';\n *\n * const Node = new GraphQLInterfaceType({\n * name: 'Node',\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * });\n *\n * const config = Node.toConfig();\n * const NodeCopy = new GraphQLInterfaceType(config);\n *\n * String(config.fields.id.type); // => 'ID!'\n * String(NodeCopy.getFields().id.type); // => 'ID!'\n * ```\n */\n toConfig(): GraphQLInterfaceTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: mapValue(this.getFields(), (field) => field.toConfig()),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this interface type.\n * @returns The schema coordinate for this interface type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n *\n * Node.toString(); // => 'Node'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLInterfaceType, GraphQLString } from 'graphql/type';\n *\n * const Named = new GraphQLInterfaceType({\n * name: 'Named',\n * fields: { name: { type: GraphQLString } },\n * });\n *\n * Named.toJSON(); // => 'Named'\n * JSON.stringify({ type: Named }); // => '{\"type\":\"Named\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Configuration used to construct a GraphQLInterfaceType.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport interface GraphQLInterfaceTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Interfaces implemented by this object or interface type. */\n interfaces?: ThunkReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n fields: ThunkObjMap>;\n /**\n * Optionally provide a custom type resolver function. If one is not provided,\n * the default implementation will call `isTypeOf` on each implementing\n * Object type.\n */\n resolveType?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLInterfaceTypeNormalizedConfig<\n TSource,\n TContext,\n> extends GraphQLInterfaceTypeConfig {\n interfaces: ReadonlyArray;\n fields: GraphQLFieldNormalizedConfigMap;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLUnionTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @example\n * ```ts\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [DogType, CatType],\n * resolveType: (value) => {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * },\n * });\n * ```\n */\nexport class GraphQLUnionType<\n TSource = any,\n TContext = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLUnionType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Function that resolves the concrete object type for this abstract type. */\n resolveType: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _types: ThunkReadonlyArray;\n\n /**\n * Creates a GraphQLUnionType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import {\n * GraphQLObjectType,\n * GraphQLString,\n * GraphQLUnionType,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * union Media = Photo | Video\n *\n * extend union Media = Audio\n * `);\n *\n * const Photo = new GraphQLObjectType({\n * name: 'Photo',\n * fields: { url: { type: GraphQLString } },\n * });\n * const Video = new GraphQLObjectType({\n * name: 'Video',\n * fields: { url: { type: GraphQLString } },\n * });\n *\n * const Media = new GraphQLUnionType({\n * name: 'Media',\n * description: 'Media that can appear in a search result.',\n * types: [Photo, Video],\n * resolveType: (value) => {\n * return typeof value === 'object' && value != null && 'duration' in value\n * ? 'Video'\n * : 'Photo';\n * },\n * extensions: { searchable: true },\n * astNode: document.definitions[0],\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * Media.description; // => 'Media that can appear in a search result.'\n * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * Media.extensions; // => { searchable: true }\n * ```\n */\n constructor(config: Readonly>) {\n this.__kind = unionSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n this._types = defineTypes.bind(undefined, config.types);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLUnionType';\n }\n\n /**\n * Returns the object types included in this union.\n * @returns The union member object types.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n *\n * const Media = assertUnionType(schema.getType('Media'));\n *\n * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * ```\n */\n getTypes(): ReadonlyArray {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n return this._types;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import {\n * GraphQLObjectType,\n * GraphQLString,\n * GraphQLUnionType,\n * } from 'graphql/type';\n *\n * const Photo = new GraphQLObjectType({\n * name: 'Photo',\n * fields: { url: { type: GraphQLString } },\n * });\n * const Video = new GraphQLObjectType({\n * name: 'Video',\n * fields: { url: { type: GraphQLString } },\n * });\n * const Media = new GraphQLUnionType({\n * name: 'Media',\n * types: [Photo, Video],\n * });\n *\n * const config = Media.toConfig();\n * const MediaCopy = new GraphQLUnionType(config);\n *\n * MediaCopy.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * ```\n */\n toConfig(): GraphQLUnionTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n types: this.getTypes(),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this union type.\n * @returns The schema coordinate for this union type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * union SearchResult = Photo\n *\n * type Query {\n * search: [SearchResult]\n * }\n * `);\n *\n * const SearchResult = assertUnionType(schema.getType('SearchResult'));\n *\n * SearchResult.toString(); // => 'SearchResult'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import {\n * GraphQLObjectType,\n * GraphQLString,\n * GraphQLUnionType,\n * } from 'graphql/type';\n *\n * const Photo = new GraphQLObjectType({\n * name: 'Photo',\n * fields: { url: { type: GraphQLString } },\n * });\n * const SearchResult = new GraphQLUnionType({\n * name: 'SearchResult',\n * types: [Photo],\n * });\n *\n * SearchResult.toJSON(); // => 'SearchResult'\n * JSON.stringify({ type: SearchResult }); // => '{\"type\":\"SearchResult\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineTypes(\n types: ThunkReadonlyArray,\n): ReadonlyArray {\n return resolveReadonlyArrayThunk(types);\n}\n\n/**\n * Configuration used to construct a GraphQLUnionType.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport interface GraphQLUnionTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Object types that belong to this union type. */\n types: ThunkReadonlyArray;\n /**\n * Optionally provide a custom type resolver function. If one is not provided,\n * the default implementation will call `isTypeOf` on each implementing\n * Object type.\n */\n resolveType?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLUnionTypeNormalizedConfig<\n TSource,\n TContext,\n> extends GraphQLUnionTypeConfig {\n types: ReadonlyArray;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLEnumTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Enum Type Definition\n *\n * Enum types define leaf values whose serialized form is one of a fixed set\n * of GraphQL enum names. Internally, enum values can map to any runtime value,\n * often integers.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGBType.getValue('GREEN')?.value; // => 1\n * ```\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport class GraphQLEnumType /* */ implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLEnumType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _values:\n | ReadonlyArray */>\n | (() => ReadonlyArray) /* */;\n\n private _valueLookup: ReadonlyMap | null;\n private _nameLookup: ObjMap | null;\n\n /**\n * Creates a GraphQLEnumType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const document = parse(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * JEDI\n * }\n *\n * extend enum Episode {\n * FORCE_AWAKENS\n * }\n * `);\n * const definition = document.definitions[0];\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * description: 'A Star Wars film episode.',\n * values: {\n * NEW_HOPE: {\n * value: 4,\n * description: 'Released in 1977.',\n * extensions: { trilogy: 'original' },\n * astNode: definition.values[0],\n * },\n * EMPIRE: { value: 5, astNode: definition.values[1] },\n * JEDI: {\n * value: 6,\n * deprecationReason: 'Use RETURN_OF_THE_JEDI.',\n * astNode: definition.values[2],\n * },\n * },\n * extensions: { catalog: 'films' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * Episode.description; // => 'A Star Wars film episode.'\n * Episode.coerceOutputValue(5); // => 'EMPIRE'\n * Episode.coerceInputValue('JEDI'); // => 6\n * Episode.getValue('JEDI').deprecationReason; // => 'Use RETURN_OF_THE_JEDI.'\n * Episode.extensions; // => { catalog: 'films' }\n * ```\n */\n constructor(config: Readonly */>) {\n this.__kind = enumSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n this._values = defineEnumValues.bind(undefined, this, config.values);\n this._valueLookup = null;\n this._nameLookup = null;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLEnumType';\n }\n\n /**\n * Returns the values defined by this enum type.\n * @returns Enum value definitions in schema order.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * JEDI\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const Episode = assertEnumType(schema.getType('Episode'));\n *\n * Episode.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE', 'JEDI']\n * ```\n */\n getValues(): ReadonlyArray */> {\n if (typeof this._values === 'function') {\n this._values = this._values();\n }\n return this._values;\n }\n\n /**\n * Returns the enum value definition for a value name.\n * @param name - The GraphQL name to look up.\n * @returns The matching enum value definition, if it exists.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const Episode = assertEnumType(schema.getType('Episode'));\n *\n * Episode.getValue('EMPIRE')?.name; // => 'EMPIRE'\n * Episode.getValue('JEDI'); // => undefined\n * ```\n */\n getValue(name: string): Maybe {\n this._nameLookup ??= keyMap(this.getValues(), (value) => value.name);\n return this._nameLookup[name];\n }\n\n /**\n * Serializes a runtime enum value as a GraphQL enum name.\n * @param outputValue - Runtime enum value to serialize.\n * @returns The GraphQL enum name for the runtime value.\n *\n * This deprecated method delegates to `coerceOutputValue()`; call\n * `coerceOutputValue()` directly instead.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.serialize(1); // => 'GREEN'\n * RGB.serialize(3); // throws an error\n * ```\n * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18\n */\n serialize(outputValue: unknown /* T */): Maybe {\n return this.coerceOutputValue(outputValue);\n }\n\n /**\n * Coerces a runtime enum value to a GraphQL enum name.\n * @param outputValue - Runtime enum value to coerce.\n * @returns The GraphQL enum name for the runtime value.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.coerceOutputValue(1); // => 'GREEN'\n * RGB.coerceOutputValue(3); // throws an error\n * ```\n */\n coerceOutputValue(outputValue: unknown /* T */): Maybe {\n this._valueLookup ??= new Map(\n this.getValues().map((enumValue) => [enumValue.value, enumValue]),\n );\n const enumValue = this._valueLookup.get(outputValue);\n if (enumValue === undefined) {\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent value: ${inspect(outputValue)}`,\n );\n }\n return enumValue.name;\n }\n\n /**\n * Deprecated legacy enum parser for externally provided input values. Use\n * `coerceInputValue()` instead.\n * @param inputValue - External enum name to parse.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum name.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.parseValue('BLUE'); // => 2\n * RGB.parseValue('PURPLE', true); // throws an error\n * ```\n * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18\n */\n parseValue(\n inputValue: unknown,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n return this.coerceInputValue(inputValue, hideSuggestions);\n }\n\n /**\n * Coerces an external enum name to its internal runtime value.\n * @param inputValue - External enum name to coerce.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum name.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.coerceInputValue('BLUE'); // => 2\n * RGB.coerceInputValue('PURPLE'); // throws an error\n * RGB.coerceInputValue(2); // throws an error\n * ```\n */\n coerceInputValue(\n inputValue: unknown,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n if (typeof inputValue !== 'string') {\n const valueStr = inspect(inputValue);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-string value: ${valueStr}.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)),\n );\n }\n\n const enumValue = this.getValue(inputValue);\n if (enumValue == null) {\n throw new GraphQLError(\n `Value \"${inputValue}\" does not exist in \"${this.name}\" enum.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, inputValue)),\n );\n }\n return enumValue.value;\n }\n\n /**\n * Deprecated legacy enum parser for externally provided input literals. Use\n * `coerceInputLiteral()` instead.\n * @param valueNode - Enum value AST node to parse.\n * @param _variables - Deprecated variable values parameter that is no longer used.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum literal.\n * @example\n * ```ts\n * import { parseValue } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.parseLiteral(parseValue('RED')); // => 0\n * RGB.parseLiteral(parseValue('\"RED\"')); // throws an error\n * ```\n * @deprecated use `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18\n */\n parseLiteral(\n valueNode: ValueNode,\n _variables: Maybe>,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n // Note: variables will be resolved to a value before calling this function.\n return this.coerceInputLiteral(\n valueNode as ConstValueNode,\n hideSuggestions,\n );\n }\n\n /**\n * Coerces an enum value AST node to its internal runtime value.\n * @param valueNode - Enum value AST node to coerce.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum literal.\n * @example\n * ```ts\n * import { parseConstValue } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.coerceInputLiteral(parseConstValue('RED')); // => 0\n * RGB.coerceInputLiteral(parseConstValue('\"RED\"'), true); // throws an error\n * ```\n */\n coerceInputLiteral(\n valueNode: ConstValueNode,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n if (valueNode.kind !== Kind.ENUM) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-enum value: ${valueStr}.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)),\n { nodes: valueNode },\n );\n }\n\n const enumValue = this.getValue(valueNode.value);\n if (enumValue == null) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Value \"${valueStr}\" does not exist in \"${this.name}\" enum.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)),\n { nodes: valueNode },\n );\n }\n return enumValue.value;\n }\n\n /**\n * Converts a runtime enum value to a GraphQL enum value AST node.\n * @param value - Runtime enum value to convert.\n * @returns Enum value AST node, or undefined if the value is invalid.\n * @example\n * ```ts\n * import { print } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * print(RGB.valueToLiteral(2)); // => 'BLUE'\n * RGB.valueToLiteral(3); // => undefined\n * ```\n */\n valueToLiteral(value: unknown): ConstValueNode | undefined {\n if (typeof value === 'string' && this.getValue(value)) {\n return { kind: Kind.ENUM, value };\n }\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * const config = RGB.toConfig();\n * const RGBCopy = new GraphQLEnumType(config);\n *\n * config.values.GREEN.value; // => 1\n * RGBCopy.coerceOutputValue(2); // => 'BLUE'\n * ```\n */\n toConfig(): GraphQLEnumTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n values: keyValMap(\n this.getValues(),\n (value) => value.name,\n (value) => value.toConfig(),\n ),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this enum type.\n * @returns The schema coordinate for this enum type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const Episode = assertEnumType(schema.getType('Episode'));\n *\n * Episode.toString(); // => 'Episode'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: {\n * NEW_HOPE: {},\n * },\n * });\n *\n * Episode.toJSON(); // => 'Episode'\n * JSON.stringify({ type: Episode }); // => '{\"type\":\"Episode\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineEnumValues(\n parentEnum: GraphQLEnumType,\n values: ThunkObjMap */>,\n): ReadonlyArray {\n const valueMap = resolveObjMapThunk(values);\n\n return Object.entries(valueMap).map(\n ([valueName, valueConfig]) =>\n new GraphQLEnumValue(parentEnum, valueName, valueConfig),\n );\n}\n\nfunction didYouMeanEnumValue(\n enumType: GraphQLEnumType,\n unknownValueStr: string,\n): string {\n const allNames = enumType.getValues().map((value) => value.name);\n const suggestedValues = suggestionList(unknownValueStr, allNames);\n\n return didYouMean('the enum value', suggestedValues);\n}\n\n/** Configuration used to construct a GraphQLEnumType. */\nexport interface GraphQLEnumTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Values contained in this enum, list, or input-object definition. */\n values: ThunkObjMap */>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig {\n values: GraphQLEnumValueNormalizedConfigMap;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/** A map of enum value names to enum value configuration objects. */\nexport type GraphQLEnumValueConfigMap /* */ =\n ObjMap */>;\n\n/** @internal */\nexport type GraphQLEnumValueNormalizedConfigMap /* */ =\n ObjMap */>;\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLEnumValueExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** Configuration used to define a GraphQL enum value. */\nexport interface GraphQLEnumValueConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Parsed value represented by this node. */\n value?: any /* T */;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** @internal */\nexport interface GraphQLEnumValueNormalizedConfig extends GraphQLEnumValueConfig {\n extensions: Readonly;\n}\n\n/** A resolved GraphQL enum value definition. */\nexport class GraphQLEnumValue implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLEnumValue instances.\n * @private\n */\n readonly __kind: symbol;\n /** Enum type that owns this enum value. */\n parentEnum: GraphQLEnumType;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Parsed value represented by this node. */\n value: any /* T */;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL enum value definition.\n * @param parentEnum - Enum type that owns this enum value.\n * @param name - Enum value name.\n * @param config - Enum value configuration.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {\n * value: 5,\n * description: 'Released in 1980.',\n * });\n *\n * enumValue.parentEnum; // => Episode\n * enumValue.name; // => 'EMPIRE'\n * enumValue.value; // => 5\n * ```\n */\n constructor(\n parentEnum: GraphQLEnumType,\n name: string,\n config: GraphQLEnumValueConfig,\n ) {\n this.__kind = enumValueSymbol;\n this.parentEnum = parentEnum;\n this.name = assertEnumValueName(name);\n this.description = config.description;\n this.value = config.value !== undefined ? config.value : name;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLEnumValue';\n }\n\n /**\n * Returns a normalized configuration object for this enum value.\n * @returns A configuration object that can be used to recreate this enum value.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {\n * value: 5,\n * extensions: { trilogy: 'original' },\n * });\n *\n * enumValue.toConfig(); // => { description: undefined, value: 5, deprecationReason: undefined, extensions: { trilogy: 'original' }, astNode: undefined }\n * ```\n */\n toConfig(): GraphQLEnumValueNormalizedConfig {\n return {\n description: this.description,\n value: this.value,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this enum value as a schema coordinate string.\n * @returns Enum value coordinate.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });\n *\n * enumValue.toString(); // => 'Episode.EMPIRE'\n * ```\n */\n toString(): string {\n return `${this.parentEnum.name}.${this.name}`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns Enum value coordinate.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });\n *\n * JSON.stringify(enumValue); // => '\"Episode.EMPIRE\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLInputObjectTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n * @example\n * ```ts\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: new GraphQLNonNull(GraphQLFloat) },\n * lon: { type: new GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, default: { value: 0 } },\n * },\n * });\n * ```\n */\nexport class GraphQLInputObjectType implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLInputObjectType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n /** Whether this input object uses the experimental OneOf input object semantics. */\n isOneOf: boolean;\n\n private _fields: ThunkObjMap;\n\n /**\n * Creates a GraphQLInputObjectType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import {\n * GraphQLID,\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * input ReviewInput {\n * stars: Int!\n * commentary: String\n * }\n *\n * extend input ReviewInput {\n * body: String\n * }\n * `);\n * const definition = document.definitions[0];\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * description: 'Input collected when reviewing a product.',\n * fields: {\n * stars: {\n * description: 'Star rating from one to five.',\n * type: new GraphQLNonNull(GraphQLInt),\n * extensions: { min: 1, max: 5 },\n * astNode: definition.fields[0],\n * },\n * commentary: {\n * type: GraphQLString,\n * default: { value: '' },\n * deprecationReason: 'Use body.',\n * astNode: definition.fields[1],\n * },\n * },\n * extensions: { form: 'review' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * isOneOf: false,\n * });\n * const SearchBy = new GraphQLInputObjectType({\n * name: 'SearchBy',\n * fields: {\n * id: { type: GraphQLID },\n * slug: { type: GraphQLString },\n * },\n * isOneOf: true,\n * });\n *\n * const fields = ReviewInput.getFields();\n *\n * ReviewInput.description; // => 'Input collected when reviewing a product.'\n * String(fields.stars.type); // => 'Int!'\n * fields.stars.extensions; // => { min: 1, max: 5 }\n * fields.commentary.default.value; // => ''\n * fields.commentary.deprecationReason; // => 'Use body.'\n * ReviewInput.isOneOf; // => false\n * SearchBy.isOneOf; // => true\n * ```\n */\n constructor(config: Readonly) {\n this.__kind = inputObjectSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n this.isOneOf = config.isOneOf ?? false;\n\n this._fields = defineInputFieldMap.bind(undefined, this, config.fields);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLInputObjectType';\n }\n\n /**\n * Returns the fields defined by this type.\n * @returns The fields keyed by field name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * commentary: String = \"\"\n * }\n *\n * type Query {\n * reviews(filter: ReviewInput): [String]\n * }\n * `);\n *\n * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));\n * const fields = ReviewInput.getFields();\n *\n * Object.keys(fields); // => ['stars', 'commentary']\n * fields.commentary.default; // => { literal: { kind: 'StringValue', value: '' } }\n * ```\n */\n getFields(): GraphQLInputFieldMap {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n return this._fields;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * },\n * });\n *\n * const config = ReviewInput.toConfig();\n * const ReviewInputCopy = new GraphQLInputObjectType(config);\n *\n * String(config.fields.stars.type); // => 'Int!'\n * String(ReviewInputCopy.getFields().stars.type); // => 'Int!'\n * ```\n */\n toConfig(): GraphQLInputObjectTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n fields: mapValue(this.getFields(), (field) => field.toConfig()),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n isOneOf: this.isOneOf,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this input object type.\n * @returns The schema coordinate for this input object type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Query {\n * reviews(filter: ReviewInput): [String]\n * }\n * `);\n *\n * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));\n *\n * ReviewInput.toString(); // => 'ReviewInput'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * commentary: { type: GraphQLString },\n * },\n * });\n *\n * ReviewInput.toJSON(); // => 'ReviewInput'\n * JSON.stringify({ type: ReviewInput }); // => '{\"type\":\"ReviewInput\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineInputFieldMap(\n parentType: GraphQLInputObjectType,\n fields: ThunkObjMap,\n): GraphQLInputFieldMap {\n const fieldMap = resolveObjMapThunk(fields);\n return mapValue(\n fieldMap,\n (fieldConfig, fieldName) =>\n new GraphQLInputField(parentType, fieldName, fieldConfig),\n );\n}\n\n/** Configuration used to construct a GraphQLInputObjectType. */\nexport interface GraphQLInputObjectTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Fields declared by this object, interface, input object, or literal. */\n fields: ThunkObjMap;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n /** Whether this input object uses the experimental OneOf input object semantics. */\n isOneOf?: boolean;\n}\n\n/** @internal */\nexport interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObjectTypeConfig {\n fields: GraphQLInputFieldNormalizedConfigMap;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLInputFieldExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** Configuration used to define a GraphQL input field. */\nexport interface GraphQLInputFieldConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value for this input field. Use `default`\n * instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue?: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default?: GraphQLDefaultInput | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** A map of input field names to input field configuration objects. */\nexport type GraphQLInputFieldConfigMap = ObjMap;\n\n/** @internal */\nexport interface GraphQLInputFieldNormalizedConfig extends GraphQLInputFieldConfig {\n default: GraphQLDefaultInput | undefined;\n extensions: Readonly;\n}\n\n/** @internal */\nexport type GraphQLInputFieldNormalizedConfigMap =\n ObjMap;\n\n/** A resolved GraphQL input field definition. */\nexport class GraphQLInputField implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLInputField instances.\n * @private\n */\n readonly __kind: symbol;\n /** Input object type that owns this input field. */\n parentType: GraphQLInputObjectType;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value used when no explicit value is supplied.\n * Use `default` instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default: GraphQLDefaultInput | undefined;\n /**\n * Cached coerced default value.\n * @private\n */\n _memoizedCoercedDefaultValue: unknown;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL input field definition.\n * @param parentType - Input object type that owns this field.\n * @param name - Input field name.\n * @param config - Input field configuration.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * default: { value: '' },\n * });\n *\n * field.parentType; // => ReviewInput\n * field.name; // => 'commentary'\n * field.default.value; // => ''\n * ```\n */\n constructor(\n parentType: GraphQLInputObjectType,\n name: string,\n config: GraphQLInputFieldConfig,\n ) {\n devAssert(\n !('resolve' in config),\n `${parentType}.${name} field has a resolve property, but Input Types cannot define resolvers.`,\n );\n\n this.__kind = inputFieldSymbol;\n this.parentType = parentType;\n this.name = assertName(name);\n this.description = config.description;\n this.type = config.type;\n this.defaultValue = config.defaultValue;\n this.default = config.default;\n this._memoizedCoercedDefaultValue = undefined;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLInputField';\n }\n\n /**\n * Returns a normalized configuration object for this input field.\n * @returns A configuration object that can be used to recreate this input field.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * extensions: { form: 'review' },\n * });\n *\n * field.toConfig().extensions; // => { form: 'review' }\n * ```\n */\n toConfig(): GraphQLInputFieldNormalizedConfig {\n return {\n description: this.description,\n type: this.type,\n defaultValue: this.defaultValue,\n default: this.default,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this input field as a schema coordinate string.\n * @returns The input field coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * });\n *\n * field.toString(); // => 'ReviewInput.commentary'\n * ```\n */\n toString(): string {\n return `${this.parentType}.${this.name}`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The input field coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * });\n *\n * JSON.stringify(field); // => '\"ReviewInput.commentary\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Returns true when the input field is non-null and has no default value.\n * @param field - The input field definition to inspect.\n * @returns True when the input field is non-null and has no default value.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLString,\n * isRequiredInputField,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const requiredField = new GraphQLInputField(ReviewInput, 'id', {\n * type: new GraphQLNonNull(GraphQLInt),\n * });\n * const optionalField = new GraphQLInputField(ReviewInput, 'name', {\n * type: GraphQLString,\n * });\n * const fieldWithDefault = new GraphQLInputField(ReviewInput, 'limit', {\n * type: new GraphQLNonNull(GraphQLInt),\n * default: { value: 10 },\n * });\n *\n * isRequiredInputField(requiredField); // => true\n * isRequiredInputField(optionalField); // => false\n * isRequiredInputField(fieldWithDefault); // => false\n * ```\n */\nexport function isRequiredInputField(field: GraphQLInputField): boolean {\n return (\n isNonNullType(field.type) &&\n field.defaultValue === undefined &&\n field.default === undefined\n );\n}\n\n/** A map of input field names to resolved input field definitions. */\nexport type GraphQLInputFieldMap = ObjMap;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs new file mode 100644 index 00000000..e488c2d7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs @@ -0,0 +1,783 @@ +import { devAssert } from "../jsutils/devAssert.mjs"; +import { didYouMean } from "../jsutils/didYouMean.mjs"; +import { identityFunc } from "../jsutils/identityFunc.mjs"; +import { inspect } from "../jsutils/inspect.mjs"; +import { instanceOf } from "../jsutils/instanceOf.mjs"; +import { keyMap } from "../jsutils/keyMap.mjs"; +import { keyValMap } from "../jsutils/keyValMap.mjs"; +import { mapValue } from "../jsutils/mapValue.mjs"; +import { suggestionList } from "../jsutils/suggestionList.mjs"; +import { toObjMapWithSymbols } from "../jsutils/toObjMap.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { print } from "../language/printer.mjs"; +import { valueFromASTUntyped } from "../utilities/valueFromASTUntyped.mjs"; +import { assertEnumValueName, assertName } from "./assertName.mjs"; +export function isType(type) { + return (isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type) || + isListType(type) || + isNonNullType(type)); +} +export function assertType(type) { + if (!isType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL type.`); + } + return type; +} +const scalarSymbol = Symbol('Scalar'); +export function isScalarType(type) { + return instanceOf(type, scalarSymbol, GraphQLScalarType); +} +export function assertScalarType(type) { + if (!isScalarType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`); + } + return type; +} +const objectSymbol = Symbol('Object'); +export function isObjectType(type) { + return instanceOf(type, objectSymbol, GraphQLObjectType); +} +export function assertObjectType(type) { + if (!isObjectType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`); + } + return type; +} +const fieldSymbol = Symbol('Field'); +export function isField(field) { + return instanceOf(field, fieldSymbol, GraphQLField); +} +export function assertField(field) { + if (!isField(field)) { + throw new Error(`Expected ${inspect(field)} to be a GraphQL field.`); + } + return field; +} +const argumentSymbol = Symbol('Argument'); +export function isArgument(arg) { + return instanceOf(arg, argumentSymbol, GraphQLArgument); +} +export function assertArgument(arg) { + if (!isArgument(arg)) { + throw new Error(`Expected ${inspect(arg)} to be a GraphQL argument.`); + } + return arg; +} +const interfaceSymbol = Symbol('Interface'); +export function isInterfaceType(type) { + return instanceOf(type, interfaceSymbol, GraphQLInterfaceType); +} +export function assertInterfaceType(type) { + if (!isInterfaceType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Interface type.`); + } + return type; +} +const unionSymbol = Symbol('Union'); +export function isUnionType(type) { + return instanceOf(type, unionSymbol, GraphQLUnionType); +} +export function assertUnionType(type) { + if (!isUnionType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`); + } + return type; +} +const enumSymbol = Symbol('Enum'); +export function isEnumType(type) { + return instanceOf(type, enumSymbol, GraphQLEnumType); +} +export function assertEnumType(type) { + if (!isEnumType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`); + } + return type; +} +const enumValueSymbol = Symbol('EnumValue'); +export function isEnumValue(value) { + return instanceOf(value, enumValueSymbol, GraphQLEnumValue); +} +export function assertEnumValue(value) { + if (!isEnumValue(value)) { + throw new Error(`Expected ${inspect(value)} to be a GraphQL Enum value.`); + } + return value; +} +const inputObjectSymbol = Symbol('InputObject'); +export function isInputObjectType(type) { + return instanceOf(type, inputObjectSymbol, GraphQLInputObjectType); +} +export function assertInputObjectType(type) { + if (!isInputObjectType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Input Object type.`); + } + return type; +} +const inputFieldSymbol = Symbol('InputField'); +export function isInputField(field) { + return instanceOf(field, inputFieldSymbol, GraphQLInputField); +} +export function assertInputField(field) { + if (!isInputField(field)) { + throw new Error(`Expected ${inspect(field)} to be a GraphQL input field.`); + } + return field; +} +const listSymbol = Symbol('List'); +export function isListType(type) { + return instanceOf(type, listSymbol, GraphQLList); +} +export function assertListType(type) { + if (!isListType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`); + } + return type; +} +const nonNullSymbol = Symbol('NonNull'); +export function isNonNullType(type) { + return instanceOf(type, nonNullSymbol, GraphQLNonNull); +} +export function assertNonNullType(type) { + if (!isNonNullType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`); + } + return type; +} +export function isInputType(type) { + return (isScalarType(type) || + isEnumType(type) || + isInputObjectType(type) || + (isWrappingType(type) && isInputType(type.ofType))); +} +export function assertInputType(type) { + if (!isInputType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL input type.`); + } + return type; +} +export function isOutputType(type) { + return (isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + (isWrappingType(type) && isOutputType(type.ofType))); +} +export function assertOutputType(type) { + if (!isOutputType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL output type.`); + } + return type; +} +export function isLeafType(type) { + return isScalarType(type) || isEnumType(type); +} +export function assertLeafType(type) { + if (!isLeafType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`); + } + return type; +} +export function isCompositeType(type) { + return isObjectType(type) || isInterfaceType(type) || isUnionType(type); +} +export function assertCompositeType(type) { + if (!isCompositeType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL composite type.`); + } + return type; +} +export function isAbstractType(type) { + return isInterfaceType(type) || isUnionType(type); +} +export function assertAbstractType(type) { + if (!isAbstractType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`); + } + return type; +} +export class GraphQLList { + constructor(ofType) { + this.__kind = listSymbol; + this.ofType = ofType; + } + get [Symbol.toStringTag]() { + return 'GraphQLList'; + } + toString() { + return '[' + String(this.ofType) + ']'; + } + toJSON() { + return this.toString(); + } +} +export class GraphQLNonNull { + constructor(ofType) { + this.__kind = nonNullSymbol; + this.ofType = ofType; + } + get [Symbol.toStringTag]() { + return 'GraphQLNonNull'; + } + toString() { + return String(this.ofType) + '!'; + } + toJSON() { + return this.toString(); + } +} +export function isWrappingType(type) { + return isListType(type) || isNonNullType(type); +} +export function assertWrappingType(type) { + if (!isWrappingType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`); + } + return type; +} +export function isNullableType(type) { + return isType(type) && !isNonNullType(type); +} +export function assertNullableType(type) { + if (!isNullableType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`); + } + return type; +} +export function getNullableType(type) { + if (type) { + return isNonNullType(type) ? type.ofType : type; + } +} +export function isNamedType(type) { + return (isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type)); +} +export function assertNamedType(type) { + if (!isNamedType(type)) { + throw new Error(`Expected ${inspect(type)} to be a GraphQL named type.`); + } + return type; +} +export function getNamedType(type) { + if (type) { + let unwrappedType = type; + while (isWrappingType(unwrappedType)) { + unwrappedType = unwrappedType.ofType; + } + return unwrappedType; + } +} +export function resolveReadonlyArrayThunk(thunk) { + return typeof thunk === 'function' ? thunk() : thunk; +} +export function resolveObjMapThunk(thunk) { + return typeof thunk === 'function' ? thunk() : thunk; +} +export class GraphQLScalarType { + constructor(config) { + this.__kind = scalarSymbol; + this.name = assertName(config.name); + this.description = config.description; + this.specifiedByURL = config.specifiedByURL; + this.serialize = + config.serialize ?? + config.coerceOutputValue ?? + identityFunc; + this.parseValue = + config.parseValue ?? + config.coerceInputValue ?? + identityFunc; + this.parseLiteral = + config.parseLiteral ?? + ((node, variables) => this.coerceInputValue(valueFromASTUntyped(node, variables))); + this.coerceOutputValue = config.coerceOutputValue ?? this.serialize; + this.coerceInputValue = config.coerceInputValue ?? this.parseValue; + this.coerceInputLiteral = config.coerceInputLiteral; + this.valueToLiteral = config.valueToLiteral; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + if (config.parseLiteral) { + if (!(typeof config.parseValue === 'function' && + typeof config.parseLiteral === 'function')) + devAssert(false, `${this.name} must provide both "parseValue" and "parseLiteral" functions.`); + } + if (config.coerceInputLiteral) { + if (!(typeof config.coerceInputValue === 'function' && + typeof config.coerceInputLiteral === 'function')) + devAssert(false, `${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`); + } + } + get [Symbol.toStringTag]() { + return 'GraphQLScalarType'; + } + toConfig() { + return { + name: this.name, + description: this.description, + specifiedByURL: this.specifiedByURL, + serialize: this.serialize, + parseValue: this.parseValue, + parseLiteral: this.parseLiteral, + coerceOutputValue: this.coerceOutputValue, + coerceInputValue: this.coerceInputValue, + coerceInputLiteral: this.coerceInputLiteral, + valueToLiteral: this.valueToLiteral, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +export class GraphQLObjectType { + constructor(config) { + this.__kind = objectSymbol; + this.__kind = objectSymbol; + this.name = assertName(config.name); + this.description = config.description; + this.isTypeOf = config.isTypeOf; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._fields = (defineFieldMap).bind(undefined, this, config.fields); + this._interfaces = defineInterfaces.bind(undefined, config.interfaces); + } + get [Symbol.toStringTag]() { + return 'GraphQLObjectType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; + } + toConfig() { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: mapValue(this.getFields(), (field) => field.toConfig()), + isTypeOf: this.isTypeOf, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +function defineInterfaces(interfaces) { + return resolveReadonlyArrayThunk(interfaces ?? []); +} +function defineFieldMap(parentType, fields) { + const fieldMap = resolveObjMapThunk(fields); + return mapValue(fieldMap, (fieldConfig, fieldName) => new GraphQLField(parentType, fieldName, fieldConfig)); +} +export class GraphQLField { + constructor(parentType, name, config) { + this.__kind = fieldSymbol; + this.parentType = parentType; + this.name = assertName(name); + this.description = config.description; + this.type = config.type; + const argsConfig = config.args; + this.args = argsConfig + ? Object.entries(argsConfig).map(([argName, argConfig]) => new GraphQLArgument(this, argName, argConfig)) + : []; + this.resolve = config.resolve; + this.subscribe = config.subscribe; + this.deprecationReason = config.deprecationReason; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLField'; + } + toConfig() { + return { + description: this.description, + type: this.type, + args: keyValMap(this.args, (arg) => arg.name, (arg) => arg.toConfig()), + resolve: this.resolve, + subscribe: this.subscribe, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parentType ?? ''}.${this.name}`; + } + toJSON() { + return this.toString(); + } +} +export class GraphQLArgument { + constructor(parent, name, config) { + this.__kind = argumentSymbol; + this.parent = parent; + this.name = assertName(name); + this.description = config.description; + this.type = config.type; + this.defaultValue = config.defaultValue; + this.default = config.default; + this._memoizedCoercedDefaultValue = undefined; + this.deprecationReason = config.deprecationReason; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLArgument'; + } + toConfig() { + return { + description: this.description, + type: this.type, + defaultValue: this.defaultValue, + default: this.default, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parent}(${this.name}:)`; + } + toJSON() { + return this.toString(); + } +} +export function isRequiredArgument(arg) { + return (isNonNullType(arg.type) && + arg.default === undefined && + arg.defaultValue === undefined); +} +export class GraphQLInterfaceType { + constructor(config) { + this.__kind = interfaceSymbol; + this.name = assertName(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._fields = (defineFieldMap).bind(undefined, this, config.fields); + this._interfaces = defineInterfaces.bind(undefined, config.interfaces); + } + get [Symbol.toStringTag]() { + return 'GraphQLInterfaceType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; + } + toConfig() { + return { + name: this.name, + description: this.description, + interfaces: this.getInterfaces(), + fields: mapValue(this.getFields(), (field) => field.toConfig()), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +export class GraphQLUnionType { + constructor(config) { + this.__kind = unionSymbol; + this.name = assertName(config.name); + this.description = config.description; + this.resolveType = config.resolveType; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._types = defineTypes.bind(undefined, config.types); + } + get [Symbol.toStringTag]() { + return 'GraphQLUnionType'; + } + getTypes() { + if (typeof this._types === 'function') { + this._types = this._types(); + } + return this._types; + } + toConfig() { + return { + name: this.name, + description: this.description, + types: this.getTypes(), + resolveType: this.resolveType, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +function defineTypes(types) { + return resolveReadonlyArrayThunk(types); +} +export class GraphQLEnumType { + constructor(config) { + this.__kind = enumSymbol; + this.name = assertName(config.name); + this.description = config.description; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._values = defineEnumValues.bind(undefined, this, config.values); + this._valueLookup = null; + this._nameLookup = null; + } + get [Symbol.toStringTag]() { + return 'GraphQLEnumType'; + } + getValues() { + if (typeof this._values === 'function') { + this._values = this._values(); + } + return this._values; + } + getValue(name) { + this._nameLookup ??= keyMap(this.getValues(), (value) => value.name); + return this._nameLookup[name]; + } + serialize(outputValue) { + return this.coerceOutputValue(outputValue); + } + coerceOutputValue(outputValue) { + this._valueLookup ??= new Map(this.getValues().map((enumValue) => [enumValue.value, enumValue])); + const enumValue = this._valueLookup.get(outputValue); + if (enumValue === undefined) { + throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${inspect(outputValue)}`); + } + return enumValue.name; + } + parseValue(inputValue, hideSuggestions) { + return this.coerceInputValue(inputValue, hideSuggestions); + } + coerceInputValue(inputValue, hideSuggestions) { + if (typeof inputValue !== 'string') { + const valueStr = inspect(inputValue); + throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr))); + } + const enumValue = this.getValue(inputValue); + if (enumValue == null) { + throw new GraphQLError(`Value "${inputValue}" does not exist in "${this.name}" enum.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, inputValue))); + } + return enumValue.value; + } + parseLiteral(valueNode, _variables, hideSuggestions) { + return this.coerceInputLiteral(valueNode, hideSuggestions); + } + coerceInputLiteral(valueNode, hideSuggestions) { + if (valueNode.kind !== Kind.ENUM) { + const valueStr = print(valueNode); + throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)), { nodes: valueNode }); + } + const enumValue = this.getValue(valueNode.value); + if (enumValue == null) { + const valueStr = print(valueNode); + throw new GraphQLError(`Value "${valueStr}" does not exist in "${this.name}" enum.` + + (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)), { nodes: valueNode }); + } + return enumValue.value; + } + valueToLiteral(value) { + if (typeof value === 'string' && this.getValue(value)) { + return { kind: Kind.ENUM, value }; + } + } + toConfig() { + return { + name: this.name, + description: this.description, + values: keyValMap(this.getValues(), (value) => value.name, (value) => value.toConfig()), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +function defineEnumValues(parentEnum, values) { + const valueMap = resolveObjMapThunk(values); + return Object.entries(valueMap).map(([valueName, valueConfig]) => new GraphQLEnumValue(parentEnum, valueName, valueConfig)); +} +function didYouMeanEnumValue(enumType, unknownValueStr) { + const allNames = enumType.getValues().map((value) => value.name); + const suggestedValues = suggestionList(unknownValueStr, allNames); + return didYouMean('the enum value', suggestedValues); +} +export class GraphQLEnumValue { + constructor(parentEnum, name, config) { + this.__kind = enumValueSymbol; + this.parentEnum = parentEnum; + this.name = assertEnumValueName(name); + this.description = config.description; + this.value = config.value !== undefined ? config.value : name; + this.deprecationReason = config.deprecationReason; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLEnumValue'; + } + toConfig() { + return { + description: this.description, + value: this.value, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parentEnum.name}.${this.name}`; + } + toJSON() { + return this.toString(); + } +} +export class GraphQLInputObjectType { + constructor(config) { + this.__kind = inputObjectSymbol; + this.name = assertName(config.name); + this.description = config.description; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this.isOneOf = config.isOneOf ?? false; + this._fields = defineInputFieldMap.bind(undefined, this, config.fields); + } + get [Symbol.toStringTag]() { + return 'GraphQLInputObjectType'; + } + getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + toConfig() { + return { + name: this.name, + description: this.description, + fields: mapValue(this.getFields(), (field) => field.toConfig()), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + isOneOf: this.isOneOf, + }; + } + toString() { + return this.name; + } + toJSON() { + return this.toString(); + } +} +function defineInputFieldMap(parentType, fields) { + const fieldMap = resolveObjMapThunk(fields); + return mapValue(fieldMap, (fieldConfig, fieldName) => new GraphQLInputField(parentType, fieldName, fieldConfig)); +} +export class GraphQLInputField { + constructor(parentType, name, config) { + if (!(!('resolve' in config))) + devAssert(false, `${parentType}.${name} field has a resolve property, but Input Types cannot define resolvers.`); + this.__kind = inputFieldSymbol; + this.parentType = parentType; + this.name = assertName(name); + this.description = config.description; + this.type = config.type; + this.defaultValue = config.defaultValue; + this.default = config.default; + this._memoizedCoercedDefaultValue = undefined; + this.deprecationReason = config.deprecationReason; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + } + get [Symbol.toStringTag]() { + return 'GraphQLInputField'; + } + toConfig() { + return { + description: this.description, + type: this.type, + defaultValue: this.defaultValue, + default: this.default, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + }; + } + toString() { + return `${this.parentType}.${this.name}`; + } + toJSON() { + return this.toString(); + } +} +export function isRequiredInputField(field) { + return (isNonNullType(field.type) && + field.defaultValue === undefined && + field.default === undefined); +} +//# sourceMappingURL=definition.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs.map new file mode 100644 index 00000000..864f8498 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/definition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/type/definition.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,UAAU,EAAE,kCAAiC;AACtD,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAC1D,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,UAAU,EAAE,kCAAiC;AACtD,OAAO,EAAE,MAAM,EAAE,8BAA6B;AAC9C,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,QAAQ,EAAE,gCAA+B;AAKlD,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,gCAA+B;AAE7D,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAwBxD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAC5C,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAK/C,OAAO,EAAE,mBAAmB,EAAE,6CAA4C;AAE1E,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,yBAAwB;AA8BlE,MAAM,UAAU,MAAM,CAAC,IAAa;IAClC,OAAO,CACL,YAAY,CAAC,IAAI,CAAC;QAClB,YAAY,CAAC,IAAI,CAAC;QAClB,eAAe,CAAC,IAAI,CAAC;QACrB,WAAW,CAAC,IAAI,CAAC;QACjB,UA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C3C,CAAC;IAwBD,MAAM;QACJ,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CACF;AAqCD,MAAM,UAAU,oBAAoB,CAAC,KAAwB;IAC3D,OAAO,CACL,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;QACzB,KAAK,CAAC,YAAY,KAAK,SAAS;QAChC,KAAK,CAAC,OAAO,KAAK,SAAS,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["/** @category Types */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { didYouMean } from '../jsutils/didYouMean.ts';\nimport { identityFunc } from '../jsutils/identityFunc.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { instanceOf } from '../jsutils/instanceOf.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\nimport { keyValMap } from '../jsutils/keyValMap.ts';\nimport { mapValue } from '../jsutils/mapValue.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport type { PromiseOrValue } from '../jsutils/PromiseOrValue.ts';\nimport { suggestionList } from '../jsutils/suggestionList.ts';\nimport { toObjMapWithSymbols } from '../jsutils/toObjMap.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ConstValueNode,\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n EnumValueDefinitionNode,\n FieldDefinitionNode,\n FieldNode,\n FragmentDefinitionNode,\n InputObjectTypeDefinitionNode,\n InputObjectTypeExtensionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n OperationDefinitionNode,\n ScalarTypeDefinitionNode,\n ScalarTypeExtensionNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n ValueNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport type { GraphQLVariableSignature } from '../execution/getVariableSignature.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { valueFromASTUntyped } from '../utilities/valueFromASTUntyped.ts';\n\nimport { assertEnumValueName, assertName } from './assertName.ts';\nimport type { GraphQLDirective } from './directives.ts';\nimport type { GraphQLSchema } from './schema.ts';\n\n// Predicates & Assertions\n\n/** These are all of the possible kinds of types. */\nexport type GraphQLType = GraphQLNamedType | GraphQLWrappingType;\n\n/**\n * Returns true when the value is any GraphQL type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is any GraphQL type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLList, GraphQLString, isType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * isType(GraphQLString); // => true\n * isType(new GraphQLList(GraphQLString)); // => true\n * isType(schema.getType('Query')); // => true\n * isType('String'); // => false\n * ```\n */\nexport function isType(type: unknown): type is GraphQLType {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n isListType(type) ||\n isNonNullType(type)\n );\n}\n\n/**\n * Returns the value as a GraphQL type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const queryType = assertType(schema.getType('Query'));\n *\n * queryType.toString(); // => 'Query'\n * assertType('Query'); // throws an error\n * ```\n */\nexport function assertType(type: unknown): GraphQLType {\n if (!isType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL type.`);\n }\n return type;\n}\n\n/** @private */\nconst scalarSymbol: unique symbol = Symbol('Scalar');\n\n/**\n * There are predicates for each kind of GraphQL type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLScalarType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isScalarType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * scalar DateTime\n *\n * type Query {\n * createdAt: DateTime\n * }\n * `);\n *\n * isScalarType(schema.getType('DateTime')); // => true\n * isScalarType(schema.getType('Query')); // => false\n * ```\n */\nexport function isScalarType(type: unknown): type is GraphQLScalarType {\n return instanceOf(type, scalarSymbol, GraphQLScalarType);\n}\n\n/**\n * Returns the value as a GraphQLScalarType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLScalarType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertScalarType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * scalar DateTime\n *\n * type Query {\n * createdAt: DateTime\n * }\n * `);\n *\n * const dateTimeType = assertScalarType(schema.getType('DateTime'));\n *\n * dateTimeType.name; // => 'DateTime'\n * assertScalarType(schema.getType('Query')); // throws an error\n * ```\n */\nexport function assertScalarType(type: unknown): GraphQLScalarType {\n if (!isScalarType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`);\n }\n return type;\n}\n\n/** @private */\nconst objectSymbol: unique symbol = Symbol('Object');\n\n/**\n * Returns true when the value is a GraphQLObjectType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type User {\n * name: String\n * }\n *\n * type Query {\n * user: User\n * }\n * `);\n *\n * isObjectType(schema.getType('User')); // => true\n * isObjectType(schema.getType('ReviewInput')); // => false\n * ```\n */\nexport function isObjectType(type: unknown): type is GraphQLObjectType {\n return instanceOf(type, objectSymbol, GraphQLObjectType);\n}\n\n/**\n * Returns the value as a GraphQLObjectType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type User {\n * name: String\n * }\n *\n * type Query {\n * user: User\n * }\n * `);\n *\n * const userType = assertObjectType(schema.getType('User'));\n *\n * Object.keys(userType.getFields()); // => ['name']\n * assertObjectType(schema.getType('ReviewInput')); // throws an error\n * ```\n */\nexport function assertObjectType(type: unknown): GraphQLObjectType {\n if (!isObjectType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`);\n }\n return type;\n}\n\n/** @private */\nconst fieldSymbol: unique symbol = Symbol('Field');\n\n/**\n * Returns true when the value is a resolved GraphQL field definition.\n * @param field - Value to inspect.\n * @returns True when the value is a GraphQLField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isField } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const field = schema.getQueryType().getFields().greeting;\n *\n * isField(field); // => true\n * isField(schema.getQueryType()); // => false\n * ```\n */\nexport function isField(field: unknown): field is GraphQLField {\n return instanceOf(field, fieldSymbol, GraphQLField);\n}\n\n/**\n * Returns the value as a GraphQLField, or throws if it is not one.\n * @param field - Value to inspect.\n * @returns The value typed as a GraphQLField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertField } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting: String }');\n * const field = assertField(schema.getQueryType().getFields().greeting);\n *\n * field.name; // => 'greeting'\n * assertField(schema.getQueryType()); // throws an error\n * ```\n */\nexport function assertField(field: unknown): GraphQLField {\n if (!isField(field)) {\n throw new Error(`Expected ${inspect(field)} to be a GraphQL field.`);\n }\n return field;\n}\n\n/** @private */\nconst argumentSymbol: unique symbol = Symbol('Argument');\n\n/**\n * Returns true when the value is a resolved GraphQL argument definition.\n * @param arg - Value to inspect.\n * @returns True when the value is a GraphQLArgument.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isArgument } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting(name: String): String }');\n * const arg = schema.getQueryType().getFields().greeting.args[0];\n *\n * isArgument(arg); // => true\n * isArgument(schema.getQueryType()); // => false\n * ```\n */\nexport function isArgument(arg: unknown): arg is GraphQLArgument {\n return instanceOf(arg, argumentSymbol, GraphQLArgument);\n}\n\n/**\n * Returns the value as a GraphQLArgument, or throws if it is not one.\n * @param arg - Value to inspect.\n * @returns The value typed as a GraphQLArgument.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertArgument } from 'graphql/type';\n *\n * const schema = buildSchema('type Query { greeting(name: String): String }');\n * const arg = assertArgument(schema.getQueryType().getFields().greeting.args[0]);\n *\n * arg.name; // => 'name'\n * assertArgument(schema.getQueryType()); // throws an error\n * ```\n */\nexport function assertArgument(arg: unknown): GraphQLArgument {\n if (!isArgument(arg)) {\n throw new Error(`Expected ${inspect(arg)} to be a GraphQL argument.`);\n }\n return arg;\n}\n\n/** @private */\nconst interfaceSymbol: unique symbol = Symbol('Interface');\n\n/**\n * Returns true when the value is a GraphQLInterfaceType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLInterfaceType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * isInterfaceType(schema.getType('Node')); // => true\n * isInterfaceType(schema.getType('User')); // => false\n * ```\n */\nexport function isInterfaceType(type: unknown): type is GraphQLInterfaceType {\n return instanceOf(type, interfaceSymbol, GraphQLInterfaceType);\n}\n\n/**\n * Returns the value as a GraphQLInterfaceType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLInterfaceType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const nodeType = assertInterfaceType(schema.getType('Node'));\n *\n * nodeType.name; // => 'Node'\n * assertInterfaceType(schema.getType('User')); // throws an error\n * ```\n */\nexport function assertInterfaceType(type: unknown): GraphQLInterfaceType {\n if (!isInterfaceType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Interface type.`,\n );\n }\n return type;\n}\n\n/** @private */\nconst unionSymbol: unique symbol = Symbol('Union');\n\n/**\n * Returns true when the value is a GraphQLUnionType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLUnionType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n *\n * isUnionType(schema.getType('Media')); // => true\n * isUnionType(schema.getType('Photo')); // => false\n * ```\n */\nexport function isUnionType(type: unknown): type is GraphQLUnionType {\n return instanceOf(type, unionSymbol, GraphQLUnionType);\n}\n\n/**\n * Returns the value as a GraphQLUnionType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLUnionType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n *\n * const mediaType = assertUnionType(schema.getType('Media'));\n *\n * mediaType.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * assertUnionType(schema.getType('Photo')); // throws an error\n * ```\n */\nexport function assertUnionType(type: unknown): GraphQLUnionType {\n if (!isUnionType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`);\n }\n return type;\n}\n\n/** @private */\nconst enumSymbol: unique symbol = Symbol('Enum');\n\n/**\n * Returns true when the value is a GraphQLEnumType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLEnumType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * favoriteEpisode: Episode\n * }\n * `);\n *\n * isEnumType(schema.getType('Episode')); // => true\n * isEnumType(schema.getType('Query')); // => false\n * ```\n */\nexport function isEnumType(type: unknown): type is GraphQLEnumType {\n return instanceOf(type, enumSymbol, GraphQLEnumType);\n}\n\n/**\n * Returns the value as a GraphQLEnumType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLEnumType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * favoriteEpisode: Episode\n * }\n * `);\n *\n * const episodeType = assertEnumType(schema.getType('Episode'));\n *\n * episodeType.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE']\n * assertEnumType(schema.getType('Query')); // throws an error\n * ```\n */\nexport function assertEnumType(type: unknown): GraphQLEnumType {\n if (!isEnumType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`);\n }\n return type;\n}\n\n/** @private */\nconst enumValueSymbol: unique symbol = Symbol('EnumValue');\n\n/**\n * Returns true when the value is a resolved GraphQL enum value definition.\n * @param value - Value to inspect.\n * @returns True when the value is a GraphQLEnumValue.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType, isEnumValue } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'enum Episode { NEW_HOPE } type Query { episode: Episode }',\n * );\n * const enumValue = assertEnumType(schema.getType('Episode')).getValues()[0];\n *\n * isEnumValue(enumValue); // => true\n * isEnumValue(schema.getType('Episode')); // => false\n * ```\n */\nexport function isEnumValue(value: unknown): value is GraphQLEnumValue {\n return instanceOf(value, enumValueSymbol, GraphQLEnumValue);\n}\n\n/**\n * Returns the value as a GraphQLEnumValue, or throws if it is not one.\n * @param value - Value to inspect.\n * @returns The value typed as a GraphQLEnumValue.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType, assertEnumValue } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'enum Episode { NEW_HOPE } type Query { episode: Episode }',\n * );\n * const enumValue = assertEnumValue(\n * assertEnumType(schema.getType('Episode')).getValues()[0],\n * );\n *\n * enumValue.name; // => 'NEW_HOPE'\n * assertEnumValue(schema.getType('Episode')); // throws an error\n * ```\n */\nexport function assertEnumValue(value: unknown): GraphQLEnumValue {\n if (!isEnumValue(value)) {\n throw new Error(`Expected ${inspect(value)} to be a GraphQL Enum value.`);\n }\n return value;\n}\n\n/** @private */\nconst inputObjectSymbol: unique symbol = Symbol('InputObject');\n\n/**\n * Returns true when the value is a GraphQLInputObjectType.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLInputObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * isInputObjectType(schema.getType('ReviewInput')); // => true\n * isInputObjectType(schema.getType('Review')); // => false\n * ```\n */\nexport function isInputObjectType(\n type: unknown,\n): type is GraphQLInputObjectType {\n return instanceOf(type, inputObjectSymbol, GraphQLInputObjectType);\n}\n\n/**\n * Returns the value as a GraphQLInputObjectType, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLInputObjectType.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * const inputType = assertInputObjectType(schema.getType('ReviewInput'));\n *\n * Object.keys(inputType.getFields()); // => ['stars']\n * assertInputObjectType(schema.getType('Review')); // throws an error\n * ```\n */\nexport function assertInputObjectType(type: unknown): GraphQLInputObjectType {\n if (!isInputObjectType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Input Object type.`,\n );\n }\n return type;\n}\n\n/** @private */\nconst inputFieldSymbol: unique symbol = Symbol('InputField');\n\n/**\n * Returns true when the value is a resolved GraphQL input field definition.\n * @param field - Value to inspect.\n * @returns True when the value is a GraphQLInputField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType, isInputField } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'input ReviewInput { stars: Int } type Query { ok: Boolean }',\n * );\n * const inputField = assertInputObjectType(\n * schema.getType('ReviewInput'),\n * ).getFields().stars;\n *\n * isInputField(inputField); // => true\n * isInputField(schema.getQueryType()); // => false\n * ```\n */\nexport function isInputField(field: unknown): field is GraphQLInputField {\n return instanceOf(field, inputFieldSymbol, GraphQLInputField);\n}\n\n/**\n * Returns the value as a GraphQLInputField, or throws if it is not one.\n * @param field - Value to inspect.\n * @returns The value typed as a GraphQLInputField.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputField, assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(\n * 'input ReviewInput { stars: Int } type Query { ok: Boolean }',\n * );\n * const inputField = assertInputField(\n * assertInputObjectType(schema.getType('ReviewInput')).getFields().stars,\n * );\n *\n * inputField.name; // => 'stars'\n * assertInputField(schema.getQueryType()); // throws an error\n * ```\n */\nexport function assertInputField(field: unknown): GraphQLInputField {\n if (!isInputField(field)) {\n throw new Error(`Expected ${inspect(field)} to be a GraphQL input field.`);\n }\n return field;\n}\n\n/** @private */\nconst listSymbol: unique symbol = Symbol('List');\n\n/**\n * Returns true when the value is a GraphQLList.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLList.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLList, GraphQLString, isListType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * tags: [String!]!\n * }\n * `);\n *\n * const tagsField = schema.getQueryType()?.getFields().tags;\n *\n * isListType(new GraphQLList(GraphQLString)); // => true\n * isListType(GraphQLString); // => false\n * isListType(tagsField?.type); // => false\n * ```\n */\nexport function isListType(\n type: GraphQLInputType,\n): type is GraphQLList;\n/**\n * Returns true when the output type is a GraphQLList.\n * @param type - The GraphQL output type to inspect.\n * @returns True when the output type is a list type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { getNullableType, isListType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * tags: [String!]!\n * }\n * `);\n *\n * const tagsField = schema.getQueryType()?.getFields().tags;\n * const nullableTagsType = getNullableType(tagsField?.type);\n *\n * isListType(nullableTagsType); // => true\n * ```\n */\nexport function isListType(\n type: GraphQLOutputType,\n): type is GraphQLList;\n/**\n * Returns true when the value is a GraphQLList.\n * @param type - The value to inspect.\n * @returns True when the value is a list type.\n * @example\n * ```ts\n * import { isListType } from 'graphql/type';\n *\n * isListType('[String]'); // => false\n * isListType(null); // => false\n * ```\n */\nexport function isListType(type: unknown): type is GraphQLList;\n/**\n * Returns true when the value is a GraphQLList.\n * @internal\n */\nexport function isListType(type: unknown): type is GraphQLList {\n return instanceOf(type, listSymbol, GraphQLList);\n}\n\n/**\n * Returns the value as a GraphQLList, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLList.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, assertListType } from 'graphql/type';\n *\n * const listType = assertListType(new GraphQLList(GraphQLString));\n *\n * listType.ofType; // => GraphQLString\n * assertListType(GraphQLString); // throws an error\n * ```\n */\nexport function assertListType(type: unknown): GraphQLList {\n if (!isListType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`);\n }\n return type;\n}\n\n/** @private */\nconst nonNullSymbol: unique symbol = Symbol('NonNull');\n\n/**\n * Returns true when the value is a GraphQLNonNull.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQLNonNull.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLNonNull, GraphQLString, isNonNullType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String!\n * nickname: String\n * }\n * `);\n *\n * const fields = schema.getQueryType()?.getFields();\n *\n * isNonNullType(new GraphQLNonNull(GraphQLString)); // => true\n * isNonNullType(fields?.name.type); // => true\n * isNonNullType(fields?.nickname.type); // => false\n * ```\n */\nexport function isNonNullType(\n type: GraphQLInputType,\n): type is GraphQLNonNull;\n/**\n * Returns true when the output type is a GraphQLNonNull.\n * @param type - The GraphQL output type to inspect.\n * @returns True when the output type is a non-null type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isNonNullType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String!\n * nickname: String\n * }\n * `);\n *\n * const fields = schema.getQueryType()?.getFields();\n *\n * isNonNullType(fields?.name.type); // => true\n * isNonNullType(fields?.nickname.type); // => false\n * ```\n */\nexport function isNonNullType(\n type: GraphQLOutputType,\n): type is GraphQLNonNull;\n/**\n * Returns true when the value is a GraphQLNonNull.\n * @param type - The value to inspect.\n * @returns True when the value is a non-null type.\n * @example\n * ```ts\n * import { isNonNullType } from 'graphql/type';\n *\n * isNonNullType('String!'); // => false\n * isNonNullType(null); // => false\n * ```\n */\nexport function isNonNullType(\n type: unknown,\n): type is GraphQLNonNull;\n/**\n * Returns true when the value is a GraphQLNonNull.\n * @internal\n */\nexport function isNonNullType(\n type: unknown,\n): type is GraphQLNonNull {\n return instanceOf(type, nonNullSymbol, GraphQLNonNull);\n}\n\n/**\n * Returns the value as a GraphQLNonNull, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQLNonNull.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString, assertNonNullType } from 'graphql/type';\n *\n * const nonNullType = assertNonNullType(new GraphQLNonNull(GraphQLString));\n *\n * nonNullType.ofType; // => GraphQLString\n * assertNonNullType(GraphQLString); // throws an error\n * ```\n */\nexport function assertNonNullType(\n type: unknown,\n): GraphQLNonNull {\n if (!isNonNullType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`);\n }\n return type;\n}\n\n/** These types may be used as input types for arguments and directives. */\nexport type GraphQLNullableInputType =\n | GraphQLNamedInputType\n | GraphQLList;\n\n/** These types may be used as input types for arguments and directives. */\nexport type GraphQLInputType =\n | GraphQLNullableInputType\n | GraphQLNonNull;\n\n/**\n * Returns true when the value can be used as a GraphQL input type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value can be used as a GraphQL input type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isInputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * isInputType(schema.getType('ReviewInput')); // => true\n * isInputType(schema.getType('Review')); // => false\n * ```\n */\nexport function isInputType(type: unknown): type is GraphQLInputType {\n return (\n isScalarType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n (isWrappingType(type) && isInputType(type.ofType))\n );\n}\n\n/**\n * Returns the value as a GraphQL input type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL input type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * const inputType = assertInputType(schema.getType('ReviewInput'));\n *\n * inputType.toString(); // => 'ReviewInput'\n * assertInputType(schema.getType('Review')); // throws an error\n * ```\n */\nexport function assertInputType(type: unknown): GraphQLInputType {\n if (!isInputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL input type.`);\n }\n return type;\n}\n\n/** These types may be used as output types as the result of fields. */\nexport type GraphQLNullableOutputType =\n | GraphQLNamedOutputType\n | GraphQLList;\n\n/** These types may be used as output types as the result of fields. */\nexport type GraphQLOutputType =\n | GraphQLNullableOutputType\n | GraphQLNonNull;\n\n/**\n * Returns true when the value can be used as a GraphQL output type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value can be used as a GraphQL output type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isOutputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * isOutputType(schema.getType('Review')); // => true\n * isOutputType(schema.getType('ReviewInput')); // => false\n * ```\n */\nexport function isOutputType(type: unknown): type is GraphQLOutputType {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n (isWrappingType(type) && isOutputType(type.ofType))\n );\n}\n\n/**\n * Returns the value as a GraphQL output type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL output type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertOutputType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: ReviewInput): Review\n * }\n * `);\n *\n * const outputType = assertOutputType(schema.getType('Review'));\n *\n * outputType.toString(); // => 'Review'\n * assertOutputType(schema.getType('ReviewInput')); // throws an error\n * ```\n */\nexport function assertOutputType(type: unknown): GraphQLOutputType {\n if (!isOutputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL output type.`);\n }\n return type;\n}\n\n/** These types may describe types which may be leaf values. */\nexport type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;\n\n/**\n * Returns true when the value is a GraphQL scalar or enum type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL scalar or enum type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isLeafType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * episode: Episode\n * review: Review\n * }\n * `);\n *\n * isLeafType(schema.getType('Episode')); // => true\n * isLeafType(schema.getType('String')); // => true\n * isLeafType(schema.getType('Review')); // => false\n * ```\n */\nexport function isLeafType(type: unknown): type is GraphQLLeafType {\n return isScalarType(type) || isEnumType(type);\n}\n\n/**\n * Returns the value as a GraphQL leaf type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL leaf type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertLeafType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Review {\n * stars: Int!\n * }\n *\n * type Query {\n * episode: Episode\n * review: Review\n * }\n * `);\n *\n * const episodeType = assertLeafType(schema.getType('Episode'));\n *\n * episodeType.toString(); // => 'Episode'\n * assertLeafType(schema.getType('Review')); // throws an error\n * ```\n */\nexport function assertLeafType(type: unknown): GraphQLLeafType {\n if (!isLeafType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`);\n }\n return type;\n}\n\n/** These types may describe the parent context of a selection set. */\nexport type GraphQLCompositeType =\n | GraphQLObjectType\n | GraphQLInterfaceType\n | GraphQLUnionType;\n\n/**\n * Returns true when the value is a GraphQL object, interface, or union type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL object, interface, or union type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isCompositeType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * union SearchResult = User\n *\n * type Query {\n * node: Node\n * search: [SearchResult]\n * }\n * `);\n *\n * isCompositeType(schema.getType('User')); // => true\n * isCompositeType(schema.getType('Node')); // => true\n * isCompositeType(schema.getType('SearchResult')); // => true\n * isCompositeType(schema.getType('String')); // => false\n * ```\n */\nexport function isCompositeType(type: unknown): type is GraphQLCompositeType {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\n\n/**\n * Returns the value as a GraphQL composite type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL composite type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertCompositeType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const userType = assertCompositeType(schema.getType('User'));\n *\n * userType.toString(); // => 'User'\n * assertCompositeType(schema.getType('String')); // throws an error\n * ```\n */\nexport function assertCompositeType(type: unknown): GraphQLCompositeType {\n if (!isCompositeType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL composite type.`,\n );\n }\n return type;\n}\n\n/** These types may describe the parent context of a selection set. */\nexport type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType;\n\n/**\n * Returns true when the value is a GraphQL interface or union type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL interface or union type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { isAbstractType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * union SearchResult = User\n *\n * type Query {\n * node: Node\n * search: [SearchResult]\n * }\n * `);\n *\n * isAbstractType(schema.getType('Node')); // => true\n * isAbstractType(schema.getType('SearchResult')); // => true\n * isAbstractType(schema.getType('User')); // => false\n * ```\n */\nexport function isAbstractType(type: unknown): type is GraphQLAbstractType {\n return isInterfaceType(type) || isUnionType(type);\n}\n\n/**\n * Returns the value as a GraphQL abstract type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL abstract type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertAbstractType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const nodeType = assertAbstractType(schema.getType('Node'));\n *\n * nodeType.toString(); // => 'Node'\n * assertAbstractType(schema.getType('User')); // throws an error\n * ```\n */\nexport function assertAbstractType(type: unknown): GraphQLAbstractType {\n if (!isAbstractType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`);\n }\n return type;\n}\n\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n * @typeParam T - The GraphQL type wrapped by this list type.\n * @example\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: new GraphQLList(PersonType) },\n * children: { type: new GraphQLList(PersonType) },\n * }),\n * });\n * ```\n */\nexport class GraphQLList<\n T extends GraphQLType,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLList instances.\n * @private\n */\n readonly __kind: symbol;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n // eslint-disable-next-line @typescript-eslint/no-unused-private-class-members\n declare private readonly __GraphQLListTypeBrand: never;\n\n /**\n * Creates a GraphQLList instance.\n * @param ofType - The type to wrap.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString } from 'graphql/type';\n *\n * const stringList = new GraphQLList(GraphQLString);\n *\n * stringList.ofType; // => GraphQLString\n * String(stringList); // => '[String]'\n * ```\n */\n constructor(ofType: T) {\n this.__kind = listSymbol;\n this.ofType = ofType;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLList';\n }\n\n /**\n * Returns this wrapping type as a GraphQL type-reference string.\n * @returns The GraphQL type-reference string.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const stringList = new GraphQLList(GraphQLString);\n * const requiredStringList = new GraphQLList(new GraphQLNonNull(GraphQLString));\n *\n * stringList.toString(); // => '[String]'\n * requiredStringList.toString(); // => '[String!]'\n * ```\n */\n toString(): string {\n return '[' + String(this.ofType) + ']';\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString } from 'graphql/type';\n *\n * const stringList = new GraphQLList(GraphQLString);\n *\n * stringList.toJSON(); // => '[String]'\n * JSON.stringify({ type: stringList }); // => '{\"type\":\"[String]\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n * @typeParam T - The nullable GraphQL type wrapped by this non-null type.\n * @example\n * ```ts\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: new GraphQLNonNull(GraphQLString) },\n * }),\n * });\n * ```\n *\n * Note: the enforcement of non-nullability occurs within the executor.\n */\nexport class GraphQLNonNull<\n T extends GraphQLNullableType,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLNonNull instances.\n * @private\n */\n readonly __kind: symbol;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n // eslint-disable-next-line @typescript-eslint/no-unused-private-class-members\n declare private readonly __GraphQLNonNullTypeBrand: never;\n\n /**\n * Creates a GraphQLNonNull instance.\n * @param ofType - The type to wrap.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n *\n * requiredString.ofType; // => GraphQLString\n * String(requiredString); // => 'String!'\n * ```\n */\n constructor(ofType: T) {\n this.__kind = nonNullSymbol;\n this.ofType = ofType;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLNonNull';\n }\n\n /**\n * Returns this wrapping type as a GraphQL type-reference string.\n * @returns The GraphQL type-reference string.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString));\n *\n * requiredString.toString(); // => 'String!'\n * requiredStringList.toString(); // => '[String]!'\n * ```\n */\n toString(): string {\n return String(this.ofType) + '!';\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n *\n * requiredString.toJSON(); // => 'String!'\n * JSON.stringify({ type: requiredString }); // => '{\"type\":\"String!\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/** These types wrap and modify other types */\n\nexport type GraphQLWrappingType =\n | GraphQLList\n | GraphQLNonNull;\n\n/**\n * Returns true when the value is a GraphQL list or non-null wrapper type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL list or non-null wrapper type.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * isWrappingType,\n * } from 'graphql/type';\n *\n * isWrappingType(new GraphQLList(GraphQLString)); // => true\n * isWrappingType(new GraphQLNonNull(GraphQLString)); // => true\n * isWrappingType(GraphQLString); // => false\n * ```\n */\nexport function isWrappingType(type: unknown): type is GraphQLWrappingType {\n return isListType(type) || isNonNullType(type);\n}\n\n/**\n * Returns the value as a GraphQL wrapping type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL wrapping type.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, assertWrappingType } from 'graphql/type';\n *\n * const wrappingType = assertWrappingType(new GraphQLList(GraphQLString));\n *\n * wrappingType.toString(); // => '[String]'\n * assertWrappingType(GraphQLString); // throws an error\n * ```\n */\nexport function assertWrappingType(type: unknown): GraphQLWrappingType {\n if (!isWrappingType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`);\n }\n return type;\n}\n\n/** These types can all accept null as a value. */\nexport type GraphQLNullableType = GraphQLNamedType | GraphQLList;\n\n/**\n * Returns true when the value is a GraphQL type that can accept null.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL type that can accept null.\n * @example\n * ```ts\n * import { GraphQLNonNull, GraphQLString, isNullableType } from 'graphql/type';\n *\n * isNullableType(GraphQLString); // => true\n * isNullableType(new GraphQLNonNull(GraphQLString)); // => false\n * isNullableType(null); // => false\n * ```\n */\nexport function isNullableType(type: unknown): type is GraphQLNullableType {\n return isType(type) && !isNonNullType(type);\n}\n\n/**\n * Returns the value as a nullable GraphQL type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a nullable GraphQL type.\n * @example\n * ```ts\n * import {\n * GraphQLNonNull,\n * GraphQLString,\n * assertNullableType,\n * } from 'graphql/type';\n *\n * const nullableType = assertNullableType(GraphQLString);\n *\n * nullableType; // => GraphQLString\n * assertNullableType(new GraphQLNonNull(GraphQLString)); // throws an error\n * ```\n */\nexport function assertNullableType(type: unknown): GraphQLNullableType {\n if (!isNullableType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`);\n }\n return type;\n}\n\n/**\n * Returns the nullable type.\n * @param type - The GraphQL type to inspect.\n * @returns The nullable type after removing one non-null wrapper, if present.\n * @example\n * ```ts\n * import { getNullableType } from 'graphql/type';\n *\n * getNullableType(null); // => undefined\n * getNullableType(undefined); // => undefined\n * ```\n */\nexport function getNullableType(type: undefined | null): void;\n/**\n * Returns the nullable type after removing one non-null wrapper.\n * @param type - A nullable type or non-null wrapper.\n * @returns The nullable type after removing one non-null wrapper, if present.\n * @typeParam T - The nullable GraphQL type returned after removing one non-null wrapper.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * getNullableType,\n * } from 'graphql/type';\n *\n * const requiredString = new GraphQLNonNull(GraphQLString);\n * const stringList = new GraphQLList(GraphQLString);\n *\n * getNullableType(requiredString); // => GraphQLString\n * getNullableType(stringList); // => stringList\n * ```\n */\nexport function getNullableType(\n type: T | GraphQLNonNull,\n): T;\n/**\n * Returns the nullable type after removing one non-null wrapper.\n * @param type - The GraphQL type to inspect.\n * @returns The nullable type after removing one non-null wrapper, if present.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * getNullableType,\n * } from 'graphql/type';\n *\n * const requiredStringList = new GraphQLNonNull(new GraphQLList(GraphQLString));\n *\n * getNullableType(requiredStringList).toString(); // => '[String]'\n * getNullableType(GraphQLString); // => GraphQLString\n * ```\n */\nexport function getNullableType(\n type: Maybe,\n): GraphQLNullableType | undefined;\n/**\n * Returns the nullable type after removing one non-null wrapper.\n * @internal\n */\nexport function getNullableType(\n type: Maybe,\n): GraphQLNullableType | undefined {\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n\n/** These named types do not include modifiers like List or NonNull. */\nexport type GraphQLNamedType = GraphQLNamedInputType | GraphQLNamedOutputType;\n\n/** A named GraphQL type that can be used as an input type. */\nexport type GraphQLNamedInputType =\n | GraphQLScalarType\n | GraphQLEnumType\n | GraphQLInputObjectType;\n\n/** A named GraphQL type that can be used as an output type. */\nexport type GraphQLNamedOutputType =\n | GraphQLScalarType\n | GraphQLObjectType\n | GraphQLInterfaceType\n | GraphQLUnionType\n | GraphQLEnumType;\n\n/**\n * Returns true when the value is a GraphQL named type.\n * @param type - The GraphQL type to inspect.\n * @returns True when the value is a GraphQL named type.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, isNamedType } from 'graphql/type';\n *\n * isNamedType(GraphQLString); // => true\n * isNamedType(new GraphQLList(GraphQLString)); // => false\n * isNamedType(null); // => false\n * ```\n */\nexport function isNamedType(type: unknown): type is GraphQLNamedType {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type)\n );\n}\n\n/**\n * Returns the value as a GraphQL named type, or throws if it is not one.\n * @param type - The GraphQL type to inspect.\n * @returns The value typed as a GraphQL named type.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, assertNamedType } from 'graphql/type';\n *\n * const namedType = assertNamedType(GraphQLString);\n *\n * namedType.name; // => 'String'\n * assertNamedType(new GraphQLList(GraphQLString)); // throws an error\n * ```\n */\nexport function assertNamedType(type: unknown): GraphQLNamedType {\n if (!isNamedType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL named type.`);\n }\n return type;\n}\n\n/**\n * Returns the named type.\n * @param type - The GraphQL type to inspect.\n * @returns The named type after unwrapping all list and non-null wrappers.\n * @example\n * ```ts\n * import { getNamedType } from 'graphql/type';\n *\n * getNamedType(null); // => undefined\n * getNamedType(undefined); // => undefined\n * ```\n */\nexport function getNamedType(type: undefined | null): void;\n/**\n * Returns the named input type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL input type to inspect.\n * @returns The named input type after unwrapping all wrappers.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { getNamedType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Query {\n * review(input: [ReviewInput!]!): Boolean\n * }\n * `);\n *\n * const inputArg = schema.getQueryType()?.getFields().review.args[0];\n *\n * getNamedType(inputArg?.type).toString(); // => 'ReviewInput'\n * ```\n */\nexport function getNamedType(type: GraphQLInputType): GraphQLNamedInputType;\n/**\n * Returns the named output type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL output type to inspect.\n * @returns The named output type after unwrapping all wrappers.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { getNamedType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * users: [User!]!\n * }\n * `);\n *\n * const usersField = schema.getQueryType()?.getFields().users;\n *\n * getNamedType(usersField?.type).toString(); // => 'User'\n * ```\n */\nexport function getNamedType(type: GraphQLOutputType): GraphQLNamedOutputType;\n/**\n * Returns the named type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL type to inspect.\n * @returns The named type after unwrapping all wrappers.\n * @example\n * ```ts\n * import {\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * getNamedType,\n * } from 'graphql/type';\n *\n * const nestedType = new GraphQLNonNull(\n * new GraphQLList(new GraphQLNonNull(GraphQLString)),\n * );\n *\n * getNamedType(nestedType); // => GraphQLString\n * ```\n */\nexport function getNamedType(type: GraphQLType): GraphQLNamedType;\n/**\n * Returns the named type after unwrapping all list and non-null wrappers.\n * @param type - The GraphQL type to inspect.\n * @returns The named type after unwrapping all wrappers, or undefined for nullish input.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLString, getNamedType } from 'graphql/type';\n *\n * getNamedType(new GraphQLList(GraphQLString)); // => GraphQLString\n * getNamedType(undefined); // => undefined\n * ```\n */\nexport function getNamedType(\n type: Maybe,\n): GraphQLNamedType | undefined;\n/**\n * Returns the named type after unwrapping all list and non-null wrappers.\n * @internal\n */\nexport function getNamedType(\n type: Maybe,\n): GraphQLNamedType | undefined {\n if (type) {\n let unwrappedType = type;\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n return unwrappedType;\n }\n}\n\n/**\n * An interface for all Schema Elements.\n *\n * @internal\n */\n\nexport interface GraphQLSchemaElement {\n toString: () => string;\n toJSON: () => string;\n}\n\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n * @typeParam T - The element type returned by the thunk or array.\n */\nexport type ThunkReadonlyArray = (() => ReadonlyArray) | ReadonlyArray;\n/**\n * A thunk that resolves to an object map.\n * @typeParam T - Value type stored in the object map.\n */\nexport type ThunkObjMap = (() => ObjMap) | ObjMap;\n\n/**\n * Resolves a thunked readonly array.\n * @param thunk - The thunk or value to resolve.\n * @returns The resolved readonly array.\n * @typeParam T - The element type resolved from the thunk or array.\n * @example\n * ```ts\n * import { GraphQLString, resolveReadonlyArrayThunk } from 'graphql/type';\n *\n * const lazyFields = resolveReadonlyArrayThunk(() => [GraphQLString]);\n * const fields = resolveReadonlyArrayThunk([GraphQLString]);\n *\n * lazyFields; // => [GraphQLString]\n * fields; // => [GraphQLString]\n * ```\n */\nexport function resolveReadonlyArrayThunk(\n thunk: ThunkReadonlyArray,\n): ReadonlyArray {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n\n/**\n * Resolves a thunked object map.\n * @param thunk - The thunk or value to resolve.\n * @returns The resolved object map.\n * @typeParam T - The object-map value type resolved from the thunk or map.\n * @example\n * ```ts\n * import { GraphQLString, resolveObjMapThunk } from 'graphql/type';\n *\n * const lazyFields = resolveObjMapThunk(() => ({ name: GraphQLString }));\n * const fields = resolveObjMapThunk({ name: GraphQLString });\n *\n * lazyFields.name; // => GraphQLString\n * fields.name; // => GraphQLString\n * ```\n */\nexport function resolveObjMapThunk(thunk: ThunkObjMap): ObjMap {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLScalarTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Scalar Type Definition\n *\n * Scalar types define the leaf values of a GraphQL response and the input\n * values accepted by arguments and input object fields. A scalar type has a\n * name and coercion functions that validate and convert runtime values and\n * GraphQL literals.\n *\n * If a type's coerceOutputValue function returns `null` or does not return a\n * value (i.e. it returns `undefined`) then an error will be raised and a\n * `null` value will be returned in the response. Prefer validating inputs\n * before execution so clients receive input diagnostics before result coercion\n * fails.\n * Custom scalar behavior is defined via the following functions:\n *\n * - coerceOutputValue(value): Implements \"Result Coercion\". Given an internal value,\n * produces an external value valid for this type. Returns undefined or\n * throws an error to indicate invalid values.\n *\n * - coerceInputValue(value): Implements \"Input Coercion\" for values. Given an\n * external value (for example, variable values), produces an internal value\n * valid for this type. Returns undefined or throws an error to indicate\n * invalid values.\n *\n * - coerceInputLiteral(ast): Implements \"Input Coercion\" for constant literals.\n * Given a GraphQL literal (AST) (for example, an argument value), produces\n * an internal value valid for this type. Returns undefined or throws an\n * error to indicate invalid values.\n *\n * - valueToLiteral(value): Converts an external value to a GraphQL\n * literal (AST). Returns undefined or throws an error to indicate\n * invalid values.\n *\n * Deprecated, to be removed in v18:\n *\n * - serialize(value): Implements \"Result Coercion\". Renamed to\n * `coerceOutputValue()`.\n *\n * - parseValue(value): Implements \"Input Coercion\" for values. Renamed to\n * `coerceInputValue()`.\n *\n * - parseLiteral(ast): Implements \"Input Coercion\" for literals including\n * non-specified replacement of variables embedded within complex scalars.\n * Replaced by the combination of the `replaceVariables()` utility and the\n * `coerceInputLiteral()` method.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n * @example\n * ```ts\n * import { GraphQLScalarType, Kind } from 'graphql';\n *\n * const ensureOdd = (value) => {\n * if (!Number.isFinite(value)) {\n * throw new Error(\n * `Scalar \"Odd\" cannot represent \"${value}\" since it is not a finite number.`,\n * );\n * }\n *\n * if (value % 2 === 0) {\n * throw new Error(\n * `Scalar \"Odd\" cannot represent \"${value}\" since it is even.`,\n * );\n * }\n *\n * return value;\n * };\n *\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * coerceOutputValue: (value) => {\n * return ensureOdd(value);\n * },\n * coerceInputValue: (value) => {\n * return ensureOdd(value);\n * },\n * valueToLiteral: (value) => {\n * return { kind: Kind.INT, value: String(ensureOdd(value)) };\n * },\n * });\n * ```\n */\nexport class GraphQLScalarType<\n TInternal = unknown,\n TExternal = TInternal,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLScalarType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** URL identifying the behavior specified for this custom scalar. */\n specifiedByURL: Maybe;\n /**\n * Deprecated legacy serializer used to convert internal values for response\n * output. Use `coerceOutputValue()` instead.\n * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18\n */\n serialize: GraphQLScalarSerializer;\n /**\n * Deprecated legacy parser used to convert externally provided input values.\n * Use `coerceInputValue()` instead.\n * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18\n */\n parseValue: GraphQLScalarValueParser;\n /**\n * Deprecated legacy parser used to convert externally provided input\n * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.\n * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18\n */\n parseLiteral: GraphQLScalarLiteralParser;\n /** Coercer used to convert internal scalar values for response output. */\n coerceOutputValue: GraphQLScalarOutputValueCoercer;\n /** Coercer used to convert externally provided scalar input values. */\n coerceInputValue: GraphQLScalarInputValueCoercer;\n /** Coercer used to convert GraphQL scalar input literals. */\n coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined;\n /** Converter used to produce GraphQL literals from runtime input values. */\n valueToLiteral: GraphQLScalarValueToLiteral | undefined;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n /**\n * Creates a GraphQLScalarType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { Kind, parse } from 'graphql/language';\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const document = parse(`\n * \"Odd integer values.\"\n * scalar Odd @specifiedBy(url: \"https://example.com/odd\")\n *\n * extend scalar Odd @specifiedBy(url: \"https://example.com/odd-v2\")\n * `);\n *\n * const Odd = new GraphQLScalarType({\n * name: 'Odd',\n * description: 'Odd integer values.',\n * specifiedByURL: 'https://example.com/odd',\n * coerceOutputValue: (value) => {\n * if (typeof value !== 'number' || value % 2 === 0) {\n * throw new TypeError('Odd can only produce odd numbers.');\n * }\n * return value;\n * },\n * coerceInputValue: (value) => {\n * if (typeof value !== 'number' || value % 2 === 0) {\n * throw new TypeError('Odd can only accept odd numbers.');\n * }\n * return value;\n * },\n * coerceInputLiteral: (ast) => {\n * if (ast.kind !== Kind.INT) {\n * throw new TypeError('Odd can only accept integer literals.');\n * }\n * const value = Number(ast.value);\n * if (value % 2 === 0) {\n * throw new TypeError('Odd can only accept odd integer literals.');\n * }\n * return value;\n * },\n * valueToLiteral: (value) => {\n * return { kind: Kind.INT, value: String(ensureOdd(value)) };\n * },\n * extensions: { numeric: true },\n * astNode: document.definitions[0],\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * Odd.description; // => 'Odd integer values.'\n * Odd.specifiedByURL; // => 'https://example.com/odd'\n * Odd.coerceOutputValue(3); // => 3\n * Odd.coerceInputValue(5); // => 5\n * Odd.extensions; // => { numeric: true }\n * ```\n */\n constructor(config: Readonly>) {\n this.__kind = scalarSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.specifiedByURL = config.specifiedByURL;\n this.serialize =\n config.serialize ??\n config.coerceOutputValue ??\n (identityFunc as GraphQLScalarSerializer);\n this.parseValue =\n config.parseValue ??\n config.coerceInputValue ??\n (identityFunc as GraphQLScalarValueParser);\n this.parseLiteral =\n config.parseLiteral ??\n ((node, variables) =>\n this.coerceInputValue(valueFromASTUntyped(node, variables)));\n this.coerceOutputValue = config.coerceOutputValue ?? this.serialize;\n this.coerceInputValue = config.coerceInputValue ?? this.parseValue;\n this.coerceInputLiteral = config.coerceInputLiteral;\n this.valueToLiteral = config.valueToLiteral;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n if (config.parseLiteral) {\n devAssert(\n typeof config.parseValue === 'function' &&\n typeof config.parseLiteral === 'function',\n `${this.name} must provide both \"parseValue\" and \"parseLiteral\" functions.`,\n );\n }\n\n if (config.coerceInputLiteral) {\n devAssert(\n typeof config.coerceInputValue === 'function' &&\n typeof config.coerceInputLiteral === 'function',\n `${this.name} must provide both \"coerceInputValue\" and \"coerceInputLiteral\" functions.`,\n );\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLScalarType';\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const Url = new GraphQLScalarType({\n * name: 'Url',\n * description: 'An absolute URL string.',\n * specifiedByURL: 'https://url.spec.whatwg.org/',\n * });\n *\n * const config = Url.toConfig();\n * const UrlCopy = new GraphQLScalarType(config);\n *\n * config.name; // => 'Url'\n * config.specifiedByURL; // => 'https://url.spec.whatwg.org/'\n * UrlCopy.name; // => Url.name\n * ```\n */\n toConfig(): GraphQLScalarTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n specifiedByURL: this.specifiedByURL,\n serialize: this.serialize,\n parseValue: this.parseValue,\n parseLiteral: this.parseLiteral,\n coerceOutputValue: this.coerceOutputValue,\n coerceInputValue: this.coerceInputValue,\n coerceInputLiteral: this.coerceInputLiteral,\n valueToLiteral: this.valueToLiteral,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this scalar type.\n * @returns The schema coordinate for this scalar type.\n * @example\n * ```ts\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const DateTime = new GraphQLScalarType({ name: 'DateTime' });\n *\n * DateTime.toString(); // => 'DateTime'\n * String(DateTime); // => 'DateTime'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLScalarType } from 'graphql/type';\n *\n * const DateTime = new GraphQLScalarType({ name: 'DateTime' });\n *\n * DateTime.toJSON(); // => 'DateTime'\n * JSON.stringify({ type: DateTime }); // => '{\"type\":\"DateTime\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Deprecated function type that serializes a runtime value as a scalar output\n * value. Use `GraphQLScalarOutputValueCoercer` instead.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n * @deprecated Use GraphQLScalarOutputValueCoercer instead. Will be removed in v18.\n */\nexport type GraphQLScalarSerializer = (\n outputValue: unknown,\n) => TExternal;\n\n/**\n * Function used to coerce internal scalar values for response output.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n */\nexport type GraphQLScalarOutputValueCoercer = (\n outputValue: unknown,\n) => TExternal;\n\n/**\n * Deprecated function type that parses a runtime input value as a scalar input\n * value. Use `GraphQLScalarInputValueCoercer` instead.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @deprecated Use GraphQLScalarInputValueCoercer instead. Will be removed in v18.\n */\nexport type GraphQLScalarValueParser = (\n inputValue: unknown,\n) => TInternal;\n\n/**\n * Function used to coerce externally provided scalar input values.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n */\nexport type GraphQLScalarInputValueCoercer = (\n inputValue: unknown,\n) => TInternal;\n\n/**\n * Deprecated function type that parses a GraphQL value literal as a scalar\n * input value. Use `GraphQLScalarInputLiteralCoercer` instead.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @deprecated Use GraphQLScalarInputLiteralCoercer instead. Will be removed in v18.\n */\nexport type GraphQLScalarLiteralParser = (\n valueNode: ValueNode,\n variables: Maybe>,\n) => Maybe;\n\n/**\n * Function used to coerce GraphQL scalar input literals.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n */\nexport type GraphQLScalarInputLiteralCoercer = (\n valueNode: ConstValueNode,\n) => Maybe;\n\n/** @internal */\nexport type GraphQLScalarValueToLiteral = (\n inputValue: unknown,\n) => ConstValueNode | undefined;\n\n/**\n * Configuration used to construct a GraphQLScalarType.\n * @typeParam TInternal - Internal runtime representation for this scalar.\n * @typeParam TExternal - External representation accepted from or returned to callers.\n */\nexport interface GraphQLScalarTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** URL identifying the behavior specified for this custom scalar. */\n specifiedByURL?: Maybe;\n /**\n * Deprecated legacy serializer used to convert internal values for response\n * output. Use `coerceOutputValue()` instead.\n * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18\n */\n serialize?: GraphQLScalarSerializer | undefined;\n /**\n * Deprecated legacy parser used to convert externally provided input values.\n * Use `coerceInputValue()` instead.\n * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18\n */\n parseValue?: GraphQLScalarValueParser | undefined;\n /**\n * Deprecated legacy parser used to convert externally provided input\n * literals. Use `replaceVariables()` and `coerceInputLiteral()` instead.\n * @deprecated use `replaceVariables()` and `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18\n */\n parseLiteral?: GraphQLScalarLiteralParser | undefined;\n /** Coerces an internal value to include in a response. */\n coerceOutputValue?: GraphQLScalarOutputValueCoercer | undefined;\n /** Coerces an externally provided value to use as an input. */\n coerceInputValue?: GraphQLScalarInputValueCoercer | undefined;\n /** Coerces an externally provided const literal value to use as an input. */\n coerceInputLiteral?: GraphQLScalarInputLiteralCoercer | undefined;\n /** Translates an externally provided value to a literal (AST). */\n valueToLiteral?: GraphQLScalarValueToLiteral | undefined;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLScalarTypeNormalizedConfig<\n TInternal,\n TExternal,\n> extends GraphQLScalarTypeConfig {\n serialize: GraphQLScalarSerializer;\n parseValue: GraphQLScalarValueParser;\n parseLiteral: GraphQLScalarLiteralParser;\n coerceOutputValue: GraphQLScalarOutputValueCoercer;\n coerceInputValue: GraphQLScalarInputValueCoercer;\n coerceInputLiteral: GraphQLScalarInputLiteralCoercer | undefined;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n * We've provided these template arguments because this is an open type and\n * you may find them useful.\n * @typeParam _TSource - Reserved source type parameter for extension typing.\n * @typeParam _TContext - Reserved context type parameter for extension typing.\n */\nexport interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TAbstract - Runtime value type used for abstract type resolution.\n * @example\n * ```ts\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve: (obj) => {\n * return obj.number + ' ' + obj.street;\n * },\n * },\n * },\n * });\n * ```\n * @example\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * }),\n * });\n * ```\n */\nexport class GraphQLObjectType<\n TSource = any,\n TContext = any,\n TAbstract = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLObjectType instances.\n * @private\n */\n readonly __kind: typeof objectSymbol = objectSymbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Predicate used to determine whether a runtime value belongs to this object type. */\n isTypeOf: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions: Readonly>;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _fields: ThunkObjMap>;\n private _interfaces: ThunkReadonlyArray;\n\n /**\n * Creates a GraphQLObjectType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * // Configure an object type with interfaces, fields, arguments, and metadata.\n * import { parse } from 'graphql/language';\n * import {\n * GraphQLID,\n * GraphQLInterfaceType,\n * GraphQLNonNull,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * type User implements Node {\n * id: ID!\n * name(format: String = \"short\"): String\n * }\n *\n * extend type User {\n * displayName: String\n * }\n * `);\n * const definition = document.definitions[0];\n * const nameField = definition.fields[1];\n * const formatArg = nameField.arguments[0];\n *\n * const Node = new GraphQLInterfaceType({\n * name: 'Node',\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * });\n *\n * const User = new GraphQLObjectType({\n * name: 'User',\n * description: 'A registered user.',\n * interfaces: [Node],\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * name: {\n * description: 'The formatted user name.',\n * type: GraphQLString,\n * args: {\n * format: {\n * description: 'Controls the name format.',\n * type: GraphQLString,\n * default: { value: 'short' },\n * deprecationReason: 'Use locale instead.',\n * extensions: { public: true },\n * astNode: formatArg,\n * },\n * },\n * resolve: (user, { format }) => {\n * return format === 'long' ? user.fullName : user.name;\n * },\n * deprecationReason: 'Use displayName.',\n * extensions: { cacheSeconds: 60 },\n * astNode: nameField,\n * },\n * },\n * isTypeOf: (value) => {\n * return typeof value === 'object' && value != null && 'id' in value;\n * },\n * extensions: { entity: 'User' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * User.name; // => 'User'\n * User.getInterfaces(); // => [Node]\n * Object.keys(User.getFields()); // => ['id', 'name']\n * User.getFields().name.args[0].default.value; // => 'short'\n * User.extensions; // => { entity: 'User' }\n * ```\n * @example\n * ```ts\n * // This variant configures a subscription field with subscribe and resolve functions.\n * import { GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Subscription = new GraphQLObjectType({\n * name: 'Subscription',\n * fields: {\n * greeting: {\n * type: GraphQLString,\n * subscribe: async function* () {\n * yield { greeting: 'Hello!' };\n * },\n * resolve: (event) => {\n * return event.greeting;\n * },\n * },\n * },\n * });\n *\n * typeof Subscription.getFields().greeting.subscribe; // => 'function'\n * ```\n */\n constructor(\n config: Readonly>,\n ) {\n this.__kind = objectSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.isTypeOf = config.isTypeOf;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n this._fields = (defineFieldMap).bind(\n undefined,\n this,\n config.fields,\n );\n this._interfaces = defineInterfaces.bind(undefined, config.interfaces);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLObjectType';\n }\n\n /**\n * Returns the fields defined by this type.\n * @returns The fields keyed by field name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type User {\n * id: ID!\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const User = assertObjectType(schema.getType('User'));\n * const fields = User.getFields();\n *\n * Object.keys(fields); // => ['id', 'name']\n * String(fields.id.type); // => 'ID!'\n * ```\n */\n getFields(): GraphQLFieldMap {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n return this._fields;\n }\n\n /**\n * Returns the interfaces implemented by this type.\n * @returns The implemented interfaces.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const User = assertObjectType(schema.getType('User'));\n *\n * User.getInterfaces().map((type) => type.name); // => ['Node']\n * ```\n */\n getInterfaces(): ReadonlyArray {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n return this._interfaces;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const User = new GraphQLObjectType({\n * name: 'User',\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const config = User.toConfig();\n * const UserCopy = new GraphQLObjectType(config);\n *\n * config.fields.name.type; // => GraphQLString\n * UserCopy.getFields().name.type; // => GraphQLString\n * ```\n */\n toConfig(): GraphQLObjectTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: mapValue(this.getFields(), (field) => field.toConfig()),\n isTypeOf: this.isTypeOf,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this object type.\n * @returns The schema coordinate for this object type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const User = assertObjectType(schema.getType('User'));\n *\n * User.toString(); // => 'User'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const User = new GraphQLObjectType({\n * name: 'User',\n * fields: { name: { type: GraphQLString } },\n * });\n *\n * User.toJSON(); // => 'User'\n * JSON.stringify({ type: User }); // => '{\"type\":\"User\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineInterfaces(\n interfaces: Maybe>,\n): ReadonlyArray {\n return resolveReadonlyArrayThunk(interfaces ?? []);\n}\n\nfunction defineFieldMap(\n parentType:\n | GraphQLObjectType\n | GraphQLInterfaceType,\n fields: ThunkObjMap>,\n): GraphQLFieldMap {\n const fieldMap = resolveObjMapThunk(fields);\n\n return mapValue(\n fieldMap,\n (fieldConfig, fieldName) =>\n new GraphQLField(parentType, fieldName, fieldConfig),\n );\n}\n\n/**\n * Configuration used to construct a GraphQLObjectType.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TAbstract - Runtime value type used for abstract type resolution.\n */\nexport interface GraphQLObjectTypeConfig<\n TSource,\n TContext,\n TAbstract = unknown,\n> {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Interfaces implemented by this object or interface type. */\n interfaces?: ThunkReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n fields: ThunkObjMap>;\n /** Predicate used to determine whether a runtime value belongs to this object type. */\n isTypeOf?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLObjectTypeNormalizedConfig<\n TSource,\n TContext,\n TAbstract = unknown,\n> extends GraphQLObjectTypeConfig {\n interfaces: ReadonlyArray;\n fields: GraphQLFieldNormalizedConfigMap;\n extensions: Readonly>;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Resolves the concrete object type for an abstract GraphQL type.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLTypeResolver = (\n value: TSource,\n context: TContext,\n info: GraphQLResolveInfo,\n abstractType: GraphQLAbstractType,\n) => PromiseOrValue;\n\n/**\n * Checks whether a runtime value belongs to a GraphQL object type.\n * @typeParam TAbstract - Runtime value type used for abstract type resolution.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLIsTypeOfFn = (\n value: TAbstract,\n context: TContext,\n info: GraphQLResolveInfo,\n) => PromiseOrValue;\n\n/**\n * Resolves the runtime value for a GraphQL field.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TArgs - Argument object type passed to resolvers.\n * @typeParam TResult - Result value type.\n */\nexport type GraphQLFieldResolver<\n TSource,\n TContext,\n TArgs = any,\n TResult = unknown,\n> = (\n source: TSource,\n args: TArgs,\n context: TContext,\n info: GraphQLResolveInfo,\n) => TResult;\n\n/** Utilities available from resolver info for tracking asynchronous work. */\nexport interface GraphQLResolveInfoHelpers {\n /**\n * Promise.all wrapper that allows rejected branches to be tracked\n * as execution async work.\n *\n * Intended use: return or await this promise from resolver work.\n * Un-awaited async side effects are an anti-pattern:\n *\n * const { promiseAll } = info.getAsyncHelpers();\n * promiseAll([someAsyncWork(), someOtherAsyncWork()]).catch(() => undefined);\n *\n * In that anti-pattern, tracking starts only after rejection (on a\n * later microtask), so this work is not guaranteed to delay\n * `hooks.asyncWorkFinished`.\n *\n * Use `track(...)` for un-awaited async side effects:\n *\n * const { track } = info.getAsyncHelpers();\n * track([\n * someAsyncWork().catch(() => undefined),\n * someOtherAsyncWork().catch(() => undefined)\n * ]);\n */\n readonly promiseAll: (\n values: ReadonlyArray | T>,\n ) => Promise>;\n /** Tracks asynchronous work that should delay execution completion hooks. */\n readonly track: (maybePromises: ReadonlyArray) => void;\n}\n\n/** Information about the currently executing GraphQL field. */\nexport interface GraphQLResolveInfo {\n /** The field name referenced by this schema coordinate. */\n readonly fieldName: string;\n /** AST field nodes that contributed to the current field execution. */\n readonly fieldNodes: ReadonlyArray;\n /** GraphQL output type declared for the current field. */\n readonly returnType: GraphQLOutputType;\n /** Object type that owns the current field. */\n readonly parentType: GraphQLObjectType;\n /** Response path where this error occurred during execution. */\n readonly path: Path;\n /** The schema used for validation or execution. */\n readonly schema: GraphQLSchema;\n /** Fragment definitions in the operation document keyed by fragment name. */\n readonly fragments: ObjMap;\n /** Initial root value passed to the operation. */\n readonly rootValue: unknown;\n /** The operation selected for execution. */\n readonly operation: OperationDefinitionNode;\n /**\n * Coerced variable values and source metadata for this operation. Resolver\n * code that needs runtime variable values should read `variableValues.coerced`.\n */\n readonly variableValues: VariableValues;\n /** Returns the AbortSignal supplied for this execution, if any. */\n readonly getAbortSignal: () => AbortSignal | undefined;\n /** Returns helper functions for tracking asynchronous resolver work. */\n readonly getAsyncHelpers: () => GraphQLResolveInfoHelpers;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n * We've provided these template arguments because this is an open type and\n * you may find them useful.\n * @typeParam _TSource - Reserved source type parameter for extension typing.\n * @typeParam _TContext - Reserved context type parameter for extension typing.\n * @typeParam _TArgs - Reserved argument type parameter for extension typing.\n */\nexport interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Configuration used to define a GraphQL field.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TArgs - Argument object type passed to resolvers.\n */\nexport interface GraphQLFieldConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLOutputType;\n /** Arguments accepted by this field or directive. */\n args?: GraphQLFieldConfigArgumentMap | undefined;\n /** Resolver function used to produce this field value. */\n resolve?: GraphQLFieldResolver | undefined;\n /** Resolver function used to create a subscription event stream for this field. */\n subscribe?: GraphQLFieldResolver | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe<\n Readonly>\n >;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** @internal */\nexport interface GraphQLFieldNormalizedConfig<\n TSource,\n TContext,\n TArgs = any,\n> extends GraphQLFieldConfig {\n args: GraphQLFieldNormalizedConfigArgumentMap;\n extensions: Readonly>;\n}\n\n/** A map of argument names to argument configuration objects. */\nexport type GraphQLFieldConfigArgumentMap = ObjMap;\n\n/** @internal */\nexport type GraphQLFieldNormalizedConfigArgumentMap =\n ObjMap;\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLArgumentExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** Configuration used to define a GraphQL argument. */\nexport interface GraphQLArgumentConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value for this argument. Use `default` instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue?: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default?: GraphQLDefaultInput | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** @internal */\nexport interface GraphQLArgumentNormalizedConfig extends GraphQLArgumentConfig {\n default: GraphQLDefaultInput | undefined;\n extensions: Readonly;\n}\n\n/**\n * A map of field names to field configuration objects.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLFieldConfigMap = ObjMap<\n GraphQLFieldConfig\n>;\n\n/** @internal */\nexport type GraphQLFieldNormalizedConfigMap = ObjMap<\n GraphQLFieldNormalizedConfig\n>;\n\n/**\n * A resolved GraphQL field definition.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @typeParam TArgs - Argument object type passed to resolvers.\n */\nexport class GraphQLField<\n TSource = any,\n TContext = any,\n TArgs = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLField instances.\n * @private\n */\n readonly __kind: symbol;\n /** Object or interface type that owns this field, if known. */\n parentType:\n | GraphQLObjectType\n | GraphQLInterfaceType\n | undefined;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLOutputType;\n /** Arguments accepted by this field or directive. */\n args: ReadonlyArray;\n /** Resolver function used to produce this field value. */\n resolve?: GraphQLFieldResolver | undefined;\n /** Resolver function used to create a subscription event stream for this field. */\n subscribe?: GraphQLFieldResolver | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly>;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL field definition.\n * @param parentType - Object or interface type that owns this field, if known.\n * @param name - Field name.\n * @param config - Field configuration.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const document = parse('type Query { greeting: String }');\n * const fieldNode = document.definitions[0].fields[0];\n * const field = new GraphQLField(Query, 'greeting', {\n * description: 'Greeting text.',\n * type: GraphQLString,\n * args: {\n * name: { type: GraphQLString, default: { value: 'world' } },\n * },\n * resolve: (_source, { name }) => `Hello, ${name}!`,\n * subscribe: async function* () {\n * yield { greeting: 'Hello!' };\n * },\n * deprecationReason: 'Use hello.',\n * extensions: { cacheSeconds: 60 },\n * astNode: fieldNode,\n * });\n *\n * field.parentType; // => Query\n * field.name; // => 'greeting'\n * field.args[0].default.value; // => 'world'\n * typeof field.subscribe; // => 'function'\n * field.deprecationReason; // => 'Use hello.'\n * field.astNode; // => fieldNode\n * ```\n */\n constructor(\n parentType:\n | GraphQLObjectType\n | GraphQLInterfaceType\n | undefined,\n name: string,\n config: GraphQLFieldConfig,\n ) {\n this.__kind = fieldSymbol;\n this.parentType = parentType;\n this.name = assertName(name);\n this.description = config.description;\n this.type = config.type;\n\n const argsConfig = config.args;\n this.args = argsConfig\n ? Object.entries(argsConfig).map(\n ([argName, argConfig]) =>\n new GraphQLArgument(this, argName, argConfig),\n )\n : [];\n\n this.resolve = config.resolve;\n this.subscribe = config.subscribe;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLField';\n }\n\n /**\n * Returns a normalized configuration object for this field.\n * @returns A configuration object that can be used to recreate this field.\n * @example\n * ```ts\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', {\n * type: GraphQLString,\n * extensions: { cacheSeconds: 60 },\n * });\n *\n * field.toConfig().type; // => GraphQLString\n * field.toConfig().extensions; // => { cacheSeconds: 60 }\n * ```\n */\n toConfig(): GraphQLFieldNormalizedConfig {\n return {\n description: this.description,\n type: this.type,\n args: keyValMap(\n this.args,\n (arg) => arg.name,\n (arg) => arg.toConfig(),\n ),\n resolve: this.resolve,\n subscribe: this.subscribe,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this field as a schema coordinate string.\n * @returns The field coordinate.\n * @example\n * ```ts\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n *\n * field.toString(); // => 'Query.greeting'\n * ```\n */\n toString(): string {\n return `${this.parentType ?? ''}.${this.name}`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The field coordinate.\n * @example\n * ```ts\n * import { GraphQLField, GraphQLObjectType, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n *\n * JSON.stringify(field); // => '\"Query.greeting\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/** A resolved GraphQL argument definition. */\nexport class GraphQLArgument implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLArgument instances.\n * @private\n */\n readonly __kind: symbol;\n /** Field or directive that owns this argument. */\n parent: GraphQLField | GraphQLDirective;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value used when no explicit value is supplied.\n * Use `default` instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default: GraphQLDefaultInput | undefined;\n /**\n * Cached coerced default value.\n * @private\n */\n _memoizedCoercedDefaultValue: unknown;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL argument definition.\n * @param parent - Field or directive that owns this argument.\n * @param name - Argument name.\n * @param config - Argument configuration.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', {\n * type: GraphQLString,\n * default: { value: 'world' },\n * });\n *\n * arg.parent; // => field\n * arg.name; // => 'name'\n * arg.default.value; // => 'world'\n * ```\n */\n constructor(\n parent: GraphQLField | GraphQLDirective,\n name: string,\n config: GraphQLArgumentConfig,\n ) {\n this.__kind = argumentSymbol;\n this.parent = parent;\n this.name = assertName(name);\n this.description = config.description;\n this.type = config.type;\n this.defaultValue = config.defaultValue;\n this.default = config.default;\n this._memoizedCoercedDefaultValue = undefined;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLArgument';\n }\n\n /**\n * Returns a normalized configuration object for this argument.\n * @returns A configuration object that can be used to recreate this argument.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', {\n * type: GraphQLString,\n * default: { value: 'world' },\n * });\n *\n * arg.toConfig().default.value; // => 'world'\n * ```\n */\n toConfig(): GraphQLArgumentNormalizedConfig {\n return {\n description: this.description,\n type: this.type,\n defaultValue: this.defaultValue,\n default: this.default,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this argument as a schema coordinate string.\n * @returns The argument coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });\n *\n * arg.toString(); // => 'Query.greeting(name:)'\n * ```\n */\n toString(): string {\n return `${this.parent}(${this.name}:)`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The argument coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'greeting', { type: GraphQLString });\n * const arg = new GraphQLArgument(field, 'name', { type: GraphQLString });\n *\n * JSON.stringify(arg); // => '\"Query.greeting(name:)\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Returns true when the argument is non-null and has no default value.\n * @param arg - The argument definition to inspect.\n * @returns True when the argument is non-null and has no default value.\n * @example\n * ```ts\n * import {\n * GraphQLArgument,\n * GraphQLField,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLObjectType,\n * GraphQLString,\n * isRequiredArgument,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({ name: 'Query', fields: {} });\n * const field = new GraphQLField(Query, 'reviews', { type: GraphQLString });\n * const requiredArgument = new GraphQLArgument(field, 'id', {\n * type: new GraphQLNonNull(GraphQLInt),\n * });\n * const optionalArgument = new GraphQLArgument(field, 'name', {\n * type: GraphQLString,\n * });\n * const argumentWithDefault = new GraphQLArgument(field, 'limit', {\n * type: new GraphQLNonNull(GraphQLInt),\n * default: { value: 10 },\n * });\n *\n * isRequiredArgument(requiredArgument); // => true\n * isRequiredArgument(optionalArgument); // => false\n * isRequiredArgument(argumentWithDefault); // => false\n * ```\n */\nexport function isRequiredArgument(\n arg: GraphQLArgument | GraphQLVariableSignature,\n): boolean {\n return (\n isNonNullType(arg.type) &&\n arg.default === undefined &&\n arg.defaultValue === undefined\n );\n}\n\n/**\n * A map of field names to resolved field definitions.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport type GraphQLFieldMap = ObjMap<\n GraphQLField\n>;\n\n/** Default input represented as either a runtime value or a GraphQL literal. */\nexport type GraphQLDefaultInput =\n | {\n /** Runtime default value. */\n value: unknown;\n /** GraphQL literal default value is not provided in this variant. */\n literal?: never;\n }\n | {\n /** GraphQL literal default value. */\n literal: ConstValueNode;\n /** Runtime default value is not provided in this variant. */\n value?: never;\n };\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLInterfaceTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @example\n * ```ts\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n * ```\n */\nexport class GraphQLInterfaceType<\n TSource = any,\n TContext = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLInterfaceType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Function that resolves the concrete object type for this abstract type. */\n resolveType: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _fields: ThunkObjMap>;\n private _interfaces: ThunkReadonlyArray;\n\n /**\n * Creates a GraphQLInterfaceType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';\n *\n * const document = parse(`\n * interface Node {\n * id: ID!\n * }\n *\n * interface Resource implements Node {\n * id: ID!\n * }\n *\n * extend interface Resource {\n * url: String\n * }\n * `);\n *\n * const Node = new GraphQLInterfaceType({\n * name: 'Node',\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * });\n *\n * const Resource = new GraphQLInterfaceType({\n * name: 'Resource',\n * description: 'An addressable resource.',\n * interfaces: [Node],\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * resolveType: (value) => {\n * return typeof value === 'object' && value != null && 'url' in value\n * ? 'WebPage'\n * : null;\n * },\n * extensions: { abstract: true },\n * astNode: document.definitions[1],\n * extensionASTNodes: [document.definitions[2]],\n * });\n *\n * Resource.name; // => 'Resource'\n * Resource.getInterfaces(); // => [Node]\n * Object.keys(Resource.getFields()); // => ['id']\n * Resource.extensions; // => { abstract: true }\n * ```\n */\n constructor(config: Readonly>) {\n this.__kind = interfaceSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n this._fields = (defineFieldMap).bind(\n undefined,\n this,\n config.fields,\n );\n this._interfaces = defineInterfaces.bind(undefined, config.interfaces);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLInterfaceType';\n }\n\n /**\n * Returns the fields defined by this type.\n * @returns The fields keyed by field name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const fields = Node.getFields();\n *\n * Object.keys(fields); // => ['id']\n * String(fields.id.type); // => 'ID!'\n * ```\n */\n getFields(): GraphQLFieldMap {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n return this._fields;\n }\n\n /**\n * Returns the interfaces implemented by this type.\n * @returns The implemented interfaces.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Resource {\n * url: String!\n * }\n *\n * interface Image implements Resource {\n * url: String!\n * width: Int\n * }\n *\n * type Photo implements Resource & Image {\n * url: String!\n * width: Int\n * }\n *\n * type Query {\n * image: Image\n * }\n * `);\n *\n * const Image = assertInterfaceType(schema.getType('Image'));\n *\n * Image.getInterfaces().map((type) => type.name); // => ['Resource']\n * ```\n */\n getInterfaces(): ReadonlyArray {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n return this._interfaces;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLID, GraphQLInterfaceType, GraphQLNonNull } from 'graphql/type';\n *\n * const Node = new GraphQLInterfaceType({\n * name: 'Node',\n * fields: {\n * id: { type: new GraphQLNonNull(GraphQLID) },\n * },\n * });\n *\n * const config = Node.toConfig();\n * const NodeCopy = new GraphQLInterfaceType(config);\n *\n * String(config.fields.id.type); // => 'ID!'\n * String(NodeCopy.getFields().id.type); // => 'ID!'\n * ```\n */\n toConfig(): GraphQLInterfaceTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: mapValue(this.getFields(), (field) => field.toConfig()),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this interface type.\n * @returns The schema coordinate for this interface type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n *\n * Node.toString(); // => 'Node'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLInterfaceType, GraphQLString } from 'graphql/type';\n *\n * const Named = new GraphQLInterfaceType({\n * name: 'Named',\n * fields: { name: { type: GraphQLString } },\n * });\n *\n * Named.toJSON(); // => 'Named'\n * JSON.stringify({ type: Named }); // => '{\"type\":\"Named\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Configuration used to construct a GraphQLInterfaceType.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport interface GraphQLInterfaceTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Interfaces implemented by this object or interface type. */\n interfaces?: ThunkReadonlyArray | undefined;\n /** Fields declared by this object, interface, input object, or literal. */\n fields: ThunkObjMap>;\n /**\n * Optionally provide a custom type resolver function. If one is not provided,\n * the default implementation will call `isTypeOf` on each implementing\n * Object type.\n */\n resolveType?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLInterfaceTypeNormalizedConfig<\n TSource,\n TContext,\n> extends GraphQLInterfaceTypeConfig {\n interfaces: ReadonlyArray;\n fields: GraphQLFieldNormalizedConfigMap;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLUnionTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n * @example\n * ```ts\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [DogType, CatType],\n * resolveType: (value) => {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * },\n * });\n * ```\n */\nexport class GraphQLUnionType<\n TSource = any,\n TContext = any,\n> implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLUnionType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Function that resolves the concrete object type for this abstract type. */\n resolveType: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _types: ThunkReadonlyArray;\n\n /**\n * Creates a GraphQLUnionType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import {\n * GraphQLObjectType,\n * GraphQLString,\n * GraphQLUnionType,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * union Media = Photo | Video\n *\n * extend union Media = Audio\n * `);\n *\n * const Photo = new GraphQLObjectType({\n * name: 'Photo',\n * fields: { url: { type: GraphQLString } },\n * });\n * const Video = new GraphQLObjectType({\n * name: 'Video',\n * fields: { url: { type: GraphQLString } },\n * });\n *\n * const Media = new GraphQLUnionType({\n * name: 'Media',\n * description: 'Media that can appear in a search result.',\n * types: [Photo, Video],\n * resolveType: (value) => {\n * return typeof value === 'object' && value != null && 'duration' in value\n * ? 'Video'\n * : 'Photo';\n * },\n * extensions: { searchable: true },\n * astNode: document.definitions[0],\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * Media.description; // => 'Media that can appear in a search result.'\n * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * Media.extensions; // => { searchable: true }\n * ```\n */\n constructor(config: Readonly>) {\n this.__kind = unionSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n this._types = defineTypes.bind(undefined, config.types);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLUnionType';\n }\n\n /**\n * Returns the object types included in this union.\n * @returns The union member object types.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n *\n * const Media = assertUnionType(schema.getType('Media'));\n *\n * Media.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * ```\n */\n getTypes(): ReadonlyArray {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n return this._types;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import {\n * GraphQLObjectType,\n * GraphQLString,\n * GraphQLUnionType,\n * } from 'graphql/type';\n *\n * const Photo = new GraphQLObjectType({\n * name: 'Photo',\n * fields: { url: { type: GraphQLString } },\n * });\n * const Video = new GraphQLObjectType({\n * name: 'Video',\n * fields: { url: { type: GraphQLString } },\n * });\n * const Media = new GraphQLUnionType({\n * name: 'Media',\n * types: [Photo, Video],\n * });\n *\n * const config = Media.toConfig();\n * const MediaCopy = new GraphQLUnionType(config);\n *\n * MediaCopy.getTypes().map((type) => type.name); // => ['Photo', 'Video']\n * ```\n */\n toConfig(): GraphQLUnionTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n types: this.getTypes(),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this union type.\n * @returns The schema coordinate for this union type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * union SearchResult = Photo\n *\n * type Query {\n * search: [SearchResult]\n * }\n * `);\n *\n * const SearchResult = assertUnionType(schema.getType('SearchResult'));\n *\n * SearchResult.toString(); // => 'SearchResult'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import {\n * GraphQLObjectType,\n * GraphQLString,\n * GraphQLUnionType,\n * } from 'graphql/type';\n *\n * const Photo = new GraphQLObjectType({\n * name: 'Photo',\n * fields: { url: { type: GraphQLString } },\n * });\n * const SearchResult = new GraphQLUnionType({\n * name: 'SearchResult',\n * types: [Photo],\n * });\n *\n * SearchResult.toJSON(); // => 'SearchResult'\n * JSON.stringify({ type: SearchResult }); // => '{\"type\":\"SearchResult\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineTypes(\n types: ThunkReadonlyArray,\n): ReadonlyArray {\n return resolveReadonlyArrayThunk(types);\n}\n\n/**\n * Configuration used to construct a GraphQLUnionType.\n * @typeParam TSource - Source object type passed to resolvers.\n * @typeParam TContext - Context object type passed to resolvers.\n */\nexport interface GraphQLUnionTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Object types that belong to this union type. */\n types: ThunkReadonlyArray;\n /**\n * Optionally provide a custom type resolver function. If one is not provided,\n * the default implementation will call `isTypeOf` on each implementing\n * Object type.\n */\n resolveType?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLUnionTypeNormalizedConfig<\n TSource,\n TContext,\n> extends GraphQLUnionTypeConfig {\n types: ReadonlyArray;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLEnumTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Enum Type Definition\n *\n * Enum types define leaf values whose serialized form is one of a fixed set\n * of GraphQL enum names. Internally, enum values can map to any runtime value,\n * often integers.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGBType.getValue('GREEN')?.value; // => 1\n * ```\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport class GraphQLEnumType /* */ implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLEnumType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n private _values:\n | ReadonlyArray */>\n | (() => ReadonlyArray) /* */;\n\n private _valueLookup: ReadonlyMap | null;\n private _nameLookup: ObjMap | null;\n\n /**\n * Creates a GraphQLEnumType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const document = parse(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * JEDI\n * }\n *\n * extend enum Episode {\n * FORCE_AWAKENS\n * }\n * `);\n * const definition = document.definitions[0];\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * description: 'A Star Wars film episode.',\n * values: {\n * NEW_HOPE: {\n * value: 4,\n * description: 'Released in 1977.',\n * extensions: { trilogy: 'original' },\n * astNode: definition.values[0],\n * },\n * EMPIRE: { value: 5, astNode: definition.values[1] },\n * JEDI: {\n * value: 6,\n * deprecationReason: 'Use RETURN_OF_THE_JEDI.',\n * astNode: definition.values[2],\n * },\n * },\n * extensions: { catalog: 'films' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * Episode.description; // => 'A Star Wars film episode.'\n * Episode.coerceOutputValue(5); // => 'EMPIRE'\n * Episode.coerceInputValue('JEDI'); // => 6\n * Episode.getValue('JEDI').deprecationReason; // => 'Use RETURN_OF_THE_JEDI.'\n * Episode.extensions; // => { catalog: 'films' }\n * ```\n */\n constructor(config: Readonly */>) {\n this.__kind = enumSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n this._values = defineEnumValues.bind(undefined, this, config.values);\n this._valueLookup = null;\n this._nameLookup = null;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLEnumType';\n }\n\n /**\n * Returns the values defined by this enum type.\n * @returns Enum value definitions in schema order.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * JEDI\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const Episode = assertEnumType(schema.getType('Episode'));\n *\n * Episode.getValues().map((value) => value.name); // => ['NEW_HOPE', 'EMPIRE', 'JEDI']\n * ```\n */\n getValues(): ReadonlyArray */> {\n if (typeof this._values === 'function') {\n this._values = this._values();\n }\n return this._values;\n }\n\n /**\n * Returns the enum value definition for a value name.\n * @param name - The GraphQL name to look up.\n * @returns The matching enum value definition, if it exists.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const Episode = assertEnumType(schema.getType('Episode'));\n *\n * Episode.getValue('EMPIRE')?.name; // => 'EMPIRE'\n * Episode.getValue('JEDI'); // => undefined\n * ```\n */\n getValue(name: string): Maybe {\n this._nameLookup ??= keyMap(this.getValues(), (value) => value.name);\n return this._nameLookup[name];\n }\n\n /**\n * Serializes a runtime enum value as a GraphQL enum name.\n * @param outputValue - Runtime enum value to serialize.\n * @returns The GraphQL enum name for the runtime value.\n *\n * This deprecated method delegates to `coerceOutputValue()`; call\n * `coerceOutputValue()` directly instead.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.serialize(1); // => 'GREEN'\n * RGB.serialize(3); // throws an error\n * ```\n * @deprecated use `coerceOutputValue()` instead, `serialize()` will be removed in v18\n */\n serialize(outputValue: unknown /* T */): Maybe {\n return this.coerceOutputValue(outputValue);\n }\n\n /**\n * Coerces a runtime enum value to a GraphQL enum name.\n * @param outputValue - Runtime enum value to coerce.\n * @returns The GraphQL enum name for the runtime value.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.coerceOutputValue(1); // => 'GREEN'\n * RGB.coerceOutputValue(3); // throws an error\n * ```\n */\n coerceOutputValue(outputValue: unknown /* T */): Maybe {\n this._valueLookup ??= new Map(\n this.getValues().map((enumValue) => [enumValue.value, enumValue]),\n );\n const enumValue = this._valueLookup.get(outputValue);\n if (enumValue === undefined) {\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent value: ${inspect(outputValue)}`,\n );\n }\n return enumValue.name;\n }\n\n /**\n * Deprecated legacy enum parser for externally provided input values. Use\n * `coerceInputValue()` instead.\n * @param inputValue - External enum name to parse.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum name.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.parseValue('BLUE'); // => 2\n * RGB.parseValue('PURPLE', true); // throws an error\n * ```\n * @deprecated use `coerceInputValue()` instead, `parseValue()` will be removed in v18\n */\n parseValue(\n inputValue: unknown,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n return this.coerceInputValue(inputValue, hideSuggestions);\n }\n\n /**\n * Coerces an external enum name to its internal runtime value.\n * @param inputValue - External enum name to coerce.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum name.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.coerceInputValue('BLUE'); // => 2\n * RGB.coerceInputValue('PURPLE'); // throws an error\n * RGB.coerceInputValue(2); // throws an error\n * ```\n */\n coerceInputValue(\n inputValue: unknown,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n if (typeof inputValue !== 'string') {\n const valueStr = inspect(inputValue);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-string value: ${valueStr}.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)),\n );\n }\n\n const enumValue = this.getValue(inputValue);\n if (enumValue == null) {\n throw new GraphQLError(\n `Value \"${inputValue}\" does not exist in \"${this.name}\" enum.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, inputValue)),\n );\n }\n return enumValue.value;\n }\n\n /**\n * Deprecated legacy enum parser for externally provided input literals. Use\n * `coerceInputLiteral()` instead.\n * @param valueNode - Enum value AST node to parse.\n * @param _variables - Deprecated variable values parameter that is no longer used.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum literal.\n * @example\n * ```ts\n * import { parseValue } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.parseLiteral(parseValue('RED')); // => 0\n * RGB.parseLiteral(parseValue('\"RED\"')); // throws an error\n * ```\n * @deprecated use `coerceInputLiteral()` instead, `parseLiteral()` will be removed in v18\n */\n parseLiteral(\n valueNode: ValueNode,\n _variables: Maybe>,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n // Note: variables will be resolved to a value before calling this function.\n return this.coerceInputLiteral(\n valueNode as ConstValueNode,\n hideSuggestions,\n );\n }\n\n /**\n * Coerces an enum value AST node to its internal runtime value.\n * @param valueNode - Enum value AST node to coerce.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns The internal runtime value for the enum literal.\n * @example\n * ```ts\n * import { parseConstValue } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * RGB.coerceInputLiteral(parseConstValue('RED')); // => 0\n * RGB.coerceInputLiteral(parseConstValue('\"RED\"'), true); // throws an error\n * ```\n */\n coerceInputLiteral(\n valueNode: ConstValueNode,\n hideSuggestions?: Maybe,\n ): Maybe /* T */ {\n if (valueNode.kind !== Kind.ENUM) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-enum value: ${valueStr}.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)),\n { nodes: valueNode },\n );\n }\n\n const enumValue = this.getValue(valueNode.value);\n if (enumValue == null) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Value \"${valueStr}\" does not exist in \"${this.name}\" enum.` +\n (hideSuggestions ? '' : didYouMeanEnumValue(this, valueStr)),\n { nodes: valueNode },\n );\n }\n return enumValue.value;\n }\n\n /**\n * Converts a runtime enum value to a GraphQL enum value AST node.\n * @param value - Runtime enum value to convert.\n * @returns Enum value AST node, or undefined if the value is invalid.\n * @example\n * ```ts\n * import { print } from 'graphql/language';\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * print(RGB.valueToLiteral(2)); // => 'BLUE'\n * RGB.valueToLiteral(3); // => undefined\n * ```\n */\n valueToLiteral(value: unknown): ConstValueNode | undefined {\n if (typeof value === 'string' && this.getValue(value)) {\n return { kind: Kind.ENUM, value };\n }\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const RGB = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 },\n * },\n * });\n *\n * const config = RGB.toConfig();\n * const RGBCopy = new GraphQLEnumType(config);\n *\n * config.values.GREEN.value; // => 1\n * RGBCopy.coerceOutputValue(2); // => 'BLUE'\n * ```\n */\n toConfig(): GraphQLEnumTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n values: keyValMap(\n this.getValues(),\n (value) => value.name,\n (value) => value.toConfig(),\n ),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this enum type.\n * @returns The schema coordinate for this enum type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertEnumType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const Episode = assertEnumType(schema.getType('Episode'));\n *\n * Episode.toString(); // => 'Episode'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLEnumType } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: {\n * NEW_HOPE: {},\n * },\n * });\n *\n * Episode.toJSON(); // => 'Episode'\n * JSON.stringify({ type: Episode }); // => '{\"type\":\"Episode\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineEnumValues(\n parentEnum: GraphQLEnumType,\n values: ThunkObjMap */>,\n): ReadonlyArray {\n const valueMap = resolveObjMapThunk(values);\n\n return Object.entries(valueMap).map(\n ([valueName, valueConfig]) =>\n new GraphQLEnumValue(parentEnum, valueName, valueConfig),\n );\n}\n\nfunction didYouMeanEnumValue(\n enumType: GraphQLEnumType,\n unknownValueStr: string,\n): string {\n const allNames = enumType.getValues().map((value) => value.name);\n const suggestedValues = suggestionList(unknownValueStr, allNames);\n\n return didYouMean('the enum value', suggestedValues);\n}\n\n/** Configuration used to construct a GraphQLEnumType. */\nexport interface GraphQLEnumTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Values contained in this enum, list, or input-object definition. */\n values: ThunkObjMap */>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig {\n values: GraphQLEnumValueNormalizedConfigMap;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/** A map of enum value names to enum value configuration objects. */\nexport type GraphQLEnumValueConfigMap /* */ =\n ObjMap */>;\n\n/** @internal */\nexport type GraphQLEnumValueNormalizedConfigMap /* */ =\n ObjMap */>;\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLEnumValueExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** Configuration used to define a GraphQL enum value. */\nexport interface GraphQLEnumValueConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Parsed value represented by this node. */\n value?: any /* T */;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** @internal */\nexport interface GraphQLEnumValueNormalizedConfig extends GraphQLEnumValueConfig {\n extensions: Readonly;\n}\n\n/** A resolved GraphQL enum value definition. */\nexport class GraphQLEnumValue implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLEnumValue instances.\n * @private\n */\n readonly __kind: symbol;\n /** Enum type that owns this enum value. */\n parentEnum: GraphQLEnumType;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Parsed value represented by this node. */\n value: any /* T */;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL enum value definition.\n * @param parentEnum - Enum type that owns this enum value.\n * @param name - Enum value name.\n * @param config - Enum value configuration.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {\n * value: 5,\n * description: 'Released in 1980.',\n * });\n *\n * enumValue.parentEnum; // => Episode\n * enumValue.name; // => 'EMPIRE'\n * enumValue.value; // => 5\n * ```\n */\n constructor(\n parentEnum: GraphQLEnumType,\n name: string,\n config: GraphQLEnumValueConfig,\n ) {\n this.__kind = enumValueSymbol;\n this.parentEnum = parentEnum;\n this.name = assertEnumValueName(name);\n this.description = config.description;\n this.value = config.value !== undefined ? config.value : name;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLEnumValue';\n }\n\n /**\n * Returns a normalized configuration object for this enum value.\n * @returns A configuration object that can be used to recreate this enum value.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', {\n * value: 5,\n * extensions: { trilogy: 'original' },\n * });\n *\n * enumValue.toConfig(); // => { description: undefined, value: 5, deprecationReason: undefined, extensions: { trilogy: 'original' }, astNode: undefined }\n * ```\n */\n toConfig(): GraphQLEnumValueNormalizedConfig {\n return {\n description: this.description,\n value: this.value,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this enum value as a schema coordinate string.\n * @returns Enum value coordinate.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });\n *\n * enumValue.toString(); // => 'Episode.EMPIRE'\n * ```\n */\n toString(): string {\n return `${this.parentEnum.name}.${this.name}`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns Enum value coordinate.\n * @example\n * ```ts\n * import { GraphQLEnumType, GraphQLEnumValue } from 'graphql/type';\n *\n * const Episode = new GraphQLEnumType({\n * name: 'Episode',\n * values: { NEW_HOPE: { value: 4 } },\n * });\n * const enumValue = new GraphQLEnumValue(Episode, 'EMPIRE', { value: 5 });\n *\n * JSON.stringify(enumValue); // => '\"Episode.EMPIRE\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLInputObjectTypeExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n * @example\n * ```ts\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: new GraphQLNonNull(GraphQLFloat) },\n * lon: { type: new GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, default: { value: 0 } },\n * },\n * });\n * ```\n */\nexport class GraphQLInputObjectType implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLInputObjectType instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n /** Whether this input object uses the experimental OneOf input object semantics. */\n isOneOf: boolean;\n\n private _fields: ThunkObjMap;\n\n /**\n * Creates a GraphQLInputObjectType instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import {\n * GraphQLID,\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * input ReviewInput {\n * stars: Int!\n * commentary: String\n * }\n *\n * extend input ReviewInput {\n * body: String\n * }\n * `);\n * const definition = document.definitions[0];\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * description: 'Input collected when reviewing a product.',\n * fields: {\n * stars: {\n * description: 'Star rating from one to five.',\n * type: new GraphQLNonNull(GraphQLInt),\n * extensions: { min: 1, max: 5 },\n * astNode: definition.fields[0],\n * },\n * commentary: {\n * type: GraphQLString,\n * default: { value: '' },\n * deprecationReason: 'Use body.',\n * astNode: definition.fields[1],\n * },\n * },\n * extensions: { form: 'review' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * isOneOf: false,\n * });\n * const SearchBy = new GraphQLInputObjectType({\n * name: 'SearchBy',\n * fields: {\n * id: { type: GraphQLID },\n * slug: { type: GraphQLString },\n * },\n * isOneOf: true,\n * });\n *\n * const fields = ReviewInput.getFields();\n *\n * ReviewInput.description; // => 'Input collected when reviewing a product.'\n * String(fields.stars.type); // => 'Int!'\n * fields.stars.extensions; // => { min: 1, max: 5 }\n * fields.commentary.default.value; // => ''\n * fields.commentary.deprecationReason; // => 'Use body.'\n * ReviewInput.isOneOf; // => false\n * SearchBy.isOneOf; // => true\n * ```\n */\n constructor(config: Readonly) {\n this.__kind = inputObjectSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n this.isOneOf = config.isOneOf ?? false;\n\n this._fields = defineInputFieldMap.bind(undefined, this, config.fields);\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLInputObjectType';\n }\n\n /**\n * Returns the fields defined by this type.\n * @returns The fields keyed by field name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * commentary: String = \"\"\n * }\n *\n * type Query {\n * reviews(filter: ReviewInput): [String]\n * }\n * `);\n *\n * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));\n * const fields = ReviewInput.getFields();\n *\n * Object.keys(fields); // => ['stars', 'commentary']\n * fields.commentary.default; // => { literal: { kind: 'StringValue', value: '' } }\n * ```\n */\n getFields(): GraphQLInputFieldMap {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n return this._fields;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * },\n * });\n *\n * const config = ReviewInput.toConfig();\n * const ReviewInputCopy = new GraphQLInputObjectType(config);\n *\n * String(config.fields.stars.type); // => 'Int!'\n * String(ReviewInputCopy.getFields().stars.type); // => 'Int!'\n * ```\n */\n toConfig(): GraphQLInputObjectTypeNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n fields: mapValue(this.getFields(), (field) => field.toConfig()),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n isOneOf: this.isOneOf,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this input object type.\n * @returns The schema coordinate for this input object type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInputObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * type Query {\n * reviews(filter: ReviewInput): [String]\n * }\n * `);\n *\n * const ReviewInput = assertInputObjectType(schema.getType('ReviewInput'));\n *\n * ReviewInput.toString(); // => 'ReviewInput'\n * ```\n */\n toString(): string {\n return this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * commentary: { type: GraphQLString },\n * },\n * });\n *\n * ReviewInput.toJSON(); // => 'ReviewInput'\n * JSON.stringify({ type: ReviewInput }); // => '{\"type\":\"ReviewInput\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\nfunction defineInputFieldMap(\n parentType: GraphQLInputObjectType,\n fields: ThunkObjMap,\n): GraphQLInputFieldMap {\n const fieldMap = resolveObjMapThunk(fields);\n return mapValue(\n fieldMap,\n (fieldConfig, fieldName) =>\n new GraphQLInputField(parentType, fieldName, fieldConfig),\n );\n}\n\n/** Configuration used to construct a GraphQLInputObjectType. */\nexport interface GraphQLInputObjectTypeConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Fields declared by this object, interface, input object, or literal. */\n fields: ThunkObjMap;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n /** Whether this input object uses the experimental OneOf input object semantics. */\n isOneOf?: boolean;\n}\n\n/** @internal */\nexport interface GraphQLInputObjectTypeNormalizedConfig extends GraphQLInputObjectTypeConfig {\n fields: GraphQLInputFieldNormalizedConfigMap;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLInputFieldExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** Configuration used to define a GraphQL input field. */\nexport interface GraphQLInputFieldConfig {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value for this input field. Use `default`\n * instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue?: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default?: GraphQLDefaultInput | undefined;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n}\n\n/** A map of input field names to input field configuration objects. */\nexport type GraphQLInputFieldConfigMap = ObjMap;\n\n/** @internal */\nexport interface GraphQLInputFieldNormalizedConfig extends GraphQLInputFieldConfig {\n default: GraphQLDefaultInput | undefined;\n extensions: Readonly;\n}\n\n/** @internal */\nexport type GraphQLInputFieldNormalizedConfigMap =\n ObjMap;\n\n/** A resolved GraphQL input field definition. */\nexport class GraphQLInputField implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLInputField instances.\n * @private\n */\n readonly __kind: symbol;\n /** Input object type that owns this input field. */\n parentType: GraphQLInputObjectType;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n type: GraphQLInputType;\n /**\n * Deprecated legacy default value used when no explicit value is supplied.\n * Use `default` instead.\n * @deprecated use `default` instead, `defaultValue` will be removed in v18\n */\n defaultValue: unknown;\n /** Default value represented as either a runtime value or a GraphQL literal. */\n default: GraphQLDefaultInput | undefined;\n /**\n * Cached coerced default value.\n * @private\n */\n _memoizedCoercedDefaultValue: unknown;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n\n /**\n * Creates a resolved GraphQL input field definition.\n * @param parentType - Input object type that owns this field.\n * @param name - Input field name.\n * @param config - Input field configuration.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * default: { value: '' },\n * });\n *\n * field.parentType; // => ReviewInput\n * field.name; // => 'commentary'\n * field.default.value; // => ''\n * ```\n */\n constructor(\n parentType: GraphQLInputObjectType,\n name: string,\n config: GraphQLInputFieldConfig,\n ) {\n devAssert(\n !('resolve' in config),\n `${parentType}.${name} field has a resolve property, but Input Types cannot define resolvers.`,\n );\n\n this.__kind = inputFieldSymbol;\n this.parentType = parentType;\n this.name = assertName(name);\n this.description = config.description;\n this.type = config.type;\n this.defaultValue = config.defaultValue;\n this.default = config.default;\n this._memoizedCoercedDefaultValue = undefined;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLInputField';\n }\n\n /**\n * Returns a normalized configuration object for this input field.\n * @returns A configuration object that can be used to recreate this input field.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * extensions: { form: 'review' },\n * });\n *\n * field.toConfig().extensions; // => { form: 'review' }\n * ```\n */\n toConfig(): GraphQLInputFieldNormalizedConfig {\n return {\n description: this.description,\n type: this.type,\n defaultValue: this.defaultValue,\n default: this.default,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n /**\n * Returns this input field as a schema coordinate string.\n * @returns The input field coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * });\n *\n * field.toString(); // => 'ReviewInput.commentary'\n * ```\n */\n toString(): string {\n return `${this.parentType}.${this.name}`;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The input field coordinate.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const field = new GraphQLInputField(ReviewInput, 'commentary', {\n * type: GraphQLString,\n * });\n *\n * JSON.stringify(field); // => '\"ReviewInput.commentary\"'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/**\n * Returns true when the input field is non-null and has no default value.\n * @param field - The input field definition to inspect.\n * @returns True when the input field is non-null and has no default value.\n * @example\n * ```ts\n * import {\n * GraphQLInputField,\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLString,\n * isRequiredInputField,\n * } from 'graphql/type';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {},\n * });\n * const requiredField = new GraphQLInputField(ReviewInput, 'id', {\n * type: new GraphQLNonNull(GraphQLInt),\n * });\n * const optionalField = new GraphQLInputField(ReviewInput, 'name', {\n * type: GraphQLString,\n * });\n * const fieldWithDefault = new GraphQLInputField(ReviewInput, 'limit', {\n * type: new GraphQLNonNull(GraphQLInt),\n * default: { value: 10 },\n * });\n *\n * isRequiredInputField(requiredField); // => true\n * isRequiredInputField(optionalField); // => false\n * isRequiredInputField(fieldWithDefault); // => false\n * ```\n */\nexport function isRequiredInputField(field: GraphQLInputField): boolean {\n return (\n isNonNullType(field.type) &&\n field.defaultValue === undefined &&\n field.default === undefined\n );\n}\n\n/** A map of input field names to resolved input field definitions. */\nexport type GraphQLInputFieldMap = ObjMap;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.mts new file mode 100644 index 00000000..24543fb9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.mts @@ -0,0 +1,291 @@ +/** @category Directives */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { DirectiveDefinitionNode, DirectiveExtensionNode } from "../language/ast.mjs"; +import { DirectiveLocation } from "../language/directiveLocation.mjs"; +import type { GraphQLArgumentConfig, GraphQLFieldNormalizedConfigArgumentMap, GraphQLSchemaElement } from "./definition.mjs"; +import { GraphQLArgument } from "./definition.mjs"; +/** + * Test if the given value is a GraphQL directive. + * @param directive - Value to inspect. + * @returns True when the value is a GraphQLDirective. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective, GraphQLString, isDirective } from 'graphql/type'; + * + * const upper = new GraphQLDirective({ + * name: 'upper', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * isDirective(upper); // => true + * isDirective(GraphQLString); // => false + * ``` + */ +export declare function isDirective(directive: unknown): directive is GraphQLDirective; +/** + * Returns the value as a GraphQLDirective, or throws if it is not a directive. + * @param directive - Value to inspect. + * @returns The value typed as a GraphQLDirective. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { assertDirective, GraphQLDirective, GraphQLString } from 'graphql/type'; + * + * const upper = new GraphQLDirective({ + * name: 'upper', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * assertDirective(upper); // => upper + * assertDirective(GraphQLString); // throws an error + * ``` + */ +export declare function assertDirective(directive: unknown): GraphQLDirective; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLDirectiveExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Directives are used by the GraphQL runtime as a way of modifying execution + * behavior. Type system creators will usually not create these directly. + */ +export declare class GraphQLDirective implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Locations where this directive may be applied. */ + locations: ReadonlyArray; + /** Arguments accepted by this field or directive. */ + args: ReadonlyArray; + /** Whether this directive may appear more than once at the same location. */ + isRepeatable: boolean; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** + * Creates a GraphQLDirective instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { DirectiveLocation, parse } from 'graphql/language'; + * import { + * GraphQLBoolean, + * GraphQLDirective, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * + * const document = parse(` + * directive @cacheControl(maxAge: Int) repeatable on FIELD_DEFINITION + * extend directive @cacheControl(maxAge: Int) on FIELD_DEFINITION + * `); + * const definition = document.definitions[0]; + * + * const cacheControl = new GraphQLDirective({ + * name: 'cacheControl', + * description: 'Controls HTTP cache hints for a field.', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { + * inheritMaxAge: { + * description: 'Inherit the parent cache hint.', + * type: new GraphQLNonNull(GraphQLBoolean), + * default: { value: false }, + * deprecationReason: 'Use maxAge instead.', + * extensions: { scope: 'cache' }, + * }, + * maxAge: { + * type: GraphQLInt, + * astNode: definition.arguments[0], + * }, + * }, + * isRepeatable: true, + * deprecationReason: 'Use @cache instead.', + * extensions: { scope: 'cache' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * }); + * + * cacheControl.name; // => 'cacheControl' + * cacheControl.description; // => 'Controls HTTP cache hints for a field.' + * cacheControl.args[0].name; // => 'inheritMaxAge' + * cacheControl.args[0].default.value; // => false + * cacheControl.isRepeatable; // => true + * cacheControl.extensions; // => { scope: 'cache' } + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective, GraphQLString } from 'graphql/type'; + * + * const tag = new GraphQLDirective({ + * name: 'tag', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const config = tag.toConfig(); + * const tagCopy = new GraphQLDirective(config); + * + * config.args.name.type; // => GraphQLString + * tagCopy.args[0].name; // => 'name' + * ``` + */ + toConfig(): GraphQLDirectiveNormalizedConfig; + /** + * Returns the schema coordinate identifying this directive. + * @returns The directive schema coordinate. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective } from 'graphql/type'; + * + * const tag = new GraphQLDirective({ + * name: 'tag', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * tag.toString(); // => '@tag' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective } from 'graphql/type'; + * + * const tag = new GraphQLDirective({ + * name: 'tag', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * tag.toJSON(); // => '@tag' + * JSON.stringify({ directive: tag }); // => '{"directive":"@tag"}' + * ``` + */ + toJSON(): string; +} +/** Configuration used to construct a GraphQLDirective. */ +export interface GraphQLDirectiveConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Locations where this directive may be applied. */ + locations: ReadonlyArray; + /** Arguments accepted by this field or directive. */ + args?: Maybe>; + /** Whether this directive may appear more than once at the same location. */ + isRepeatable?: Maybe; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig { + args: GraphQLFieldNormalizedConfigArgumentMap; + isRepeatable: boolean; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** Used to conditionally include fields or fragments. */ +export declare const GraphQLIncludeDirective: GraphQLDirective; +/** Used to conditionally skip (exclude) fields or fragments. */ +export declare const GraphQLSkipDirective: GraphQLDirective; +/** + * Experimental directive used to conditionally defer fragments. + * + * This directive is exported for schemas that explicitly opt in to incremental + * delivery. It is not included in `specifiedDirectives`. + */ +export declare const GraphQLDeferDirective: GraphQLDirective; +/** + * Experimental directive used to conditionally stream list fields. + * + * This directive is exported for schemas that explicitly opt in to incremental + * delivery. It is not included in `specifiedDirectives`. + */ +export declare const GraphQLStreamDirective: GraphQLDirective; +/** Constant string used for default reason for a deprecation. */ +export declare const DEFAULT_DEPRECATION_REASON = "No longer supported"; +/** + * Used to declare element of a GraphQL schema as deprecated. + * + * The `reason` argument is non-null and defaults to + * `DEFAULT_DEPRECATION_REASON`. + */ +export declare const GraphQLDeprecatedDirective: GraphQLDirective; +/** Used to provide a URL for specifying the behavior of custom scalar definitions. */ +export declare const GraphQLSpecifiedByDirective: GraphQLDirective; +/** Used to indicate an Input Object is a OneOf Input Object. */ +export declare const GraphQLOneOfDirective: GraphQLDirective; +/** + * Disables error propagation (experimental). + * + * @internal + */ +export declare const GraphQLDisableErrorPropagationDirective: GraphQLDirective; +/** + * Full list of stable directives specified by GraphQL.js. + * + * Experimental `@defer` and `@stream` are exported separately and are not + * included in this list. + */ +export declare const specifiedDirectives: ReadonlyArray; +/** + * Returns true when the directive is one of the directives specified by GraphQL. + * @param directive - Directive to inspect. + * @returns True when the directive is specified by GraphQL. + * @example + * ```ts + * import { + * GraphQLDirective, + * GraphQLIncludeDirective, + * isSpecifiedDirective, + * } from 'graphql/type'; + * import { DirectiveLocation } from 'graphql/language'; + * + * const customDirective = new GraphQLDirective({ + * name: 'auth', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * isSpecifiedDirective(GraphQLIncludeDirective); // => true + * isSpecifiedDirective(customDirective); // => false + * ``` + */ +export declare function isSpecifiedDirective(directive: GraphQLDirective): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.ts new file mode 100644 index 00000000..ece1e37a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.d.ts @@ -0,0 +1,291 @@ +/** @category Directives */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { DirectiveDefinitionNode, DirectiveExtensionNode } from "../language/ast.js"; +import { DirectiveLocation } from "../language/directiveLocation.js"; +import type { GraphQLArgumentConfig, GraphQLFieldNormalizedConfigArgumentMap, GraphQLSchemaElement } from "./definition.js"; +import { GraphQLArgument } from "./definition.js"; +/** + * Test if the given value is a GraphQL directive. + * @param directive - Value to inspect. + * @returns True when the value is a GraphQLDirective. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective, GraphQLString, isDirective } from 'graphql/type'; + * + * const upper = new GraphQLDirective({ + * name: 'upper', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * isDirective(upper); // => true + * isDirective(GraphQLString); // => false + * ``` + */ +export declare function isDirective(directive: unknown): directive is GraphQLDirective; +/** + * Returns the value as a GraphQLDirective, or throws if it is not a directive. + * @param directive - Value to inspect. + * @returns The value typed as a GraphQLDirective. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { assertDirective, GraphQLDirective, GraphQLString } from 'graphql/type'; + * + * const upper = new GraphQLDirective({ + * name: 'upper', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * assertDirective(upper); // => upper + * assertDirective(GraphQLString); // throws an error + * ``` + */ +export declare function assertDirective(directive: unknown): GraphQLDirective; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLDirectiveExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Directives are used by the GraphQL runtime as a way of modifying execution + * behavior. Type system creators will usually not create these directly. + */ +export declare class GraphQLDirective implements GraphQLSchemaElement { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Locations where this directive may be applied. */ + locations: ReadonlyArray; + /** Arguments accepted by this field or directive. */ + args: ReadonlyArray; + /** Whether this directive may appear more than once at the same location. */ + isRepeatable: boolean; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** + * Creates a GraphQLDirective instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * import { DirectiveLocation, parse } from 'graphql/language'; + * import { + * GraphQLBoolean, + * GraphQLDirective, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * + * const document = parse(` + * directive @cacheControl(maxAge: Int) repeatable on FIELD_DEFINITION + * extend directive @cacheControl(maxAge: Int) on FIELD_DEFINITION + * `); + * const definition = document.definitions[0]; + * + * const cacheControl = new GraphQLDirective({ + * name: 'cacheControl', + * description: 'Controls HTTP cache hints for a field.', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { + * inheritMaxAge: { + * description: 'Inherit the parent cache hint.', + * type: new GraphQLNonNull(GraphQLBoolean), + * default: { value: false }, + * deprecationReason: 'Use maxAge instead.', + * extensions: { scope: 'cache' }, + * }, + * maxAge: { + * type: GraphQLInt, + * astNode: definition.arguments[0], + * }, + * }, + * isRepeatable: true, + * deprecationReason: 'Use @cache instead.', + * extensions: { scope: 'cache' }, + * astNode: definition, + * extensionASTNodes: [document.definitions[1]], + * }); + * + * cacheControl.name; // => 'cacheControl' + * cacheControl.description; // => 'Controls HTTP cache hints for a field.' + * cacheControl.args[0].name; // => 'inheritMaxAge' + * cacheControl.args[0].default.value; // => false + * cacheControl.isRepeatable; // => true + * cacheControl.extensions; // => { scope: 'cache' } + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns a normalized configuration object for this object. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective, GraphQLString } from 'graphql/type'; + * + * const tag = new GraphQLDirective({ + * name: 'tag', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const config = tag.toConfig(); + * const tagCopy = new GraphQLDirective(config); + * + * config.args.name.type; // => GraphQLString + * tagCopy.args[0].name; // => 'name' + * ``` + */ + toConfig(): GraphQLDirectiveNormalizedConfig; + /** + * Returns the schema coordinate identifying this directive. + * @returns The directive schema coordinate. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective } from 'graphql/type'; + * + * const tag = new GraphQLDirective({ + * name: 'tag', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * tag.toString(); // => '@tag' + * ``` + */ + toString(): string; + /** + * Returns the JSON representation used when this object is serialized. + * @returns The JSON-serializable representation. + * @example + * ```ts + * import { DirectiveLocation } from 'graphql/language'; + * import { GraphQLDirective } from 'graphql/type'; + * + * const tag = new GraphQLDirective({ + * name: 'tag', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * tag.toJSON(); // => '@tag' + * JSON.stringify({ directive: tag }); // => '{"directive":"@tag"}' + * ``` + */ + toJSON(): string; +} +/** Configuration used to construct a GraphQLDirective. */ +export interface GraphQLDirectiveConfig { + /** The GraphQL name for this schema element. */ + name: string; + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Locations where this directive may be applied. */ + locations: ReadonlyArray; + /** Arguments accepted by this field or directive. */ + args?: Maybe>; + /** Whether this directive may appear more than once at the same location. */ + isRepeatable?: Maybe; + /** Reason this element is deprecated, if one was provided. */ + deprecationReason?: Maybe; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig { + args: GraphQLFieldNormalizedConfigArgumentMap; + isRepeatable: boolean; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; +} +/** Used to conditionally include fields or fragments. */ +export declare const GraphQLIncludeDirective: GraphQLDirective; +/** Used to conditionally skip (exclude) fields or fragments. */ +export declare const GraphQLSkipDirective: GraphQLDirective; +/** + * Experimental directive used to conditionally defer fragments. + * + * This directive is exported for schemas that explicitly opt in to incremental + * delivery. It is not included in `specifiedDirectives`. + */ +export declare const GraphQLDeferDirective: GraphQLDirective; +/** + * Experimental directive used to conditionally stream list fields. + * + * This directive is exported for schemas that explicitly opt in to incremental + * delivery. It is not included in `specifiedDirectives`. + */ +export declare const GraphQLStreamDirective: GraphQLDirective; +/** Constant string used for default reason for a deprecation. */ +export declare const DEFAULT_DEPRECATION_REASON = "No longer supported"; +/** + * Used to declare element of a GraphQL schema as deprecated. + * + * The `reason` argument is non-null and defaults to + * `DEFAULT_DEPRECATION_REASON`. + */ +export declare const GraphQLDeprecatedDirective: GraphQLDirective; +/** Used to provide a URL for specifying the behavior of custom scalar definitions. */ +export declare const GraphQLSpecifiedByDirective: GraphQLDirective; +/** Used to indicate an Input Object is a OneOf Input Object. */ +export declare const GraphQLOneOfDirective: GraphQLDirective; +/** + * Disables error propagation (experimental). + * + * @internal + */ +export declare const GraphQLDisableErrorPropagationDirective: GraphQLDirective; +/** + * Full list of stable directives specified by GraphQL.js. + * + * Experimental `@defer` and `@stream` are exported separately and are not + * included in this list. + */ +export declare const specifiedDirectives: ReadonlyArray; +/** + * Returns true when the directive is one of the directives specified by GraphQL. + * @param directive - Directive to inspect. + * @returns True when the directive is specified by GraphQL. + * @example + * ```ts + * import { + * GraphQLDirective, + * GraphQLIncludeDirective, + * isSpecifiedDirective, + * } from 'graphql/type'; + * import { DirectiveLocation } from 'graphql/language'; + * + * const customDirective = new GraphQLDirective({ + * name: 'auth', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * }); + * + * isSpecifiedDirective(GraphQLIncludeDirective); // => true + * isSpecifiedDirective(customDirective); // => false + * ``` + */ +export declare function isSpecifiedDirective(directive: GraphQLDirective): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js new file mode 100644 index 00000000..b112e92b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js @@ -0,0 +1,194 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.specifiedDirectives = exports.GraphQLDisableErrorPropagationDirective = exports.GraphQLOneOfDirective = exports.GraphQLSpecifiedByDirective = exports.GraphQLDeprecatedDirective = exports.DEFAULT_DEPRECATION_REASON = exports.GraphQLStreamDirective = exports.GraphQLDeferDirective = exports.GraphQLSkipDirective = exports.GraphQLIncludeDirective = exports.GraphQLDirective = void 0; +exports.isDirective = isDirective; +exports.assertDirective = assertDirective; +exports.isSpecifiedDirective = isSpecifiedDirective; +const devAssert_ts_1 = require("../jsutils/devAssert.js"); +const inspect_ts_1 = require("../jsutils/inspect.js"); +const instanceOf_ts_1 = require("../jsutils/instanceOf.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const keyValMap_ts_1 = require("../jsutils/keyValMap.js"); +const toObjMap_ts_1 = require("../jsutils/toObjMap.js"); +const directiveLocation_ts_1 = require("../language/directiveLocation.js"); +const assertName_ts_1 = require("./assertName.js"); +const definition_ts_1 = require("./definition.js"); +const scalars_ts_1 = require("./scalars.js"); +const directiveSymbol = Symbol('Directive'); +function isDirective(directive) { + return (0, instanceOf_ts_1.instanceOf)(directive, directiveSymbol, GraphQLDirective); +} +function assertDirective(directive) { + if (!isDirective(directive)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(directive)} to be a GraphQL directive.`); + } + return directive; +} +class GraphQLDirective { + constructor(config) { + this.__kind = directiveSymbol; + this.name = (0, assertName_ts_1.assertName)(config.name); + this.description = config.description; + this.locations = config.locations; + this.isRepeatable = config.isRepeatable ?? false; + this.deprecationReason = config.deprecationReason; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + if (!(Array.isArray(config.locations))) + (0, devAssert_ts_1.devAssert)(false, `@${this.name} locations must be an Array.`); + const args = config.args ?? {}; + if (!((0, isObjectLike_ts_1.isObjectLike)(args) && !Array.isArray(args))) + (0, devAssert_ts_1.devAssert)(false, `@${this.name} args must be an object with argument names as keys.`); + this.args = Object.entries(args).map(([argName, argConfig]) => new definition_ts_1.GraphQLArgument(this, argName, argConfig)); + } + get [Symbol.toStringTag]() { + return 'GraphQLDirective'; + } + toConfig() { + return { + name: this.name, + description: this.description, + locations: this.locations, + args: (0, keyValMap_ts_1.keyValMap)(this.args, (arg) => arg.name, (arg) => arg.toConfig()), + isRepeatable: this.isRepeatable, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return '@' + this.name; + } + toJSON() { + return this.toString(); + } +} +exports.GraphQLDirective = GraphQLDirective; +exports.GraphQLIncludeDirective = new GraphQLDirective({ + name: 'include', + description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + locations: [ + directiveLocation_ts_1.DirectiveLocation.FIELD, + directiveLocation_ts_1.DirectiveLocation.FRAGMENT_SPREAD, + directiveLocation_ts_1.DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + description: 'Included when true.', + }, + }, +}); +exports.GraphQLSkipDirective = new GraphQLDirective({ + name: 'skip', + description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + locations: [ + directiveLocation_ts_1.DirectiveLocation.FIELD, + directiveLocation_ts_1.DirectiveLocation.FRAGMENT_SPREAD, + directiveLocation_ts_1.DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + description: 'Skipped when true.', + }, + }, +}); +exports.GraphQLDeferDirective = new GraphQLDirective({ + name: 'defer', + description: 'Directs the executor to defer this fragment when the `if` argument is true or undefined.', + locations: [ + directiveLocation_ts_1.DirectiveLocation.FRAGMENT_SPREAD, + directiveLocation_ts_1.DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + description: 'Deferred when true or undefined.', + default: { value: true }, + }, + label: { + type: scalars_ts_1.GraphQLString, + description: 'Unique name', + }, + }, +}); +exports.GraphQLStreamDirective = new GraphQLDirective({ + name: 'stream', + description: 'Directs the executor to stream plural fields when the `if` argument is true or undefined.', + locations: [directiveLocation_ts_1.DirectiveLocation.FIELD], + args: { + initialCount: { + default: { value: 0 }, + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLInt), + description: 'Number of items to return immediately', + }, + if: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + description: 'Stream when true or undefined.', + default: { value: true }, + }, + label: { + type: scalars_ts_1.GraphQLString, + description: 'Unique name', + }, + }, +}); +exports.DEFAULT_DEPRECATION_REASON = 'No longer supported'; +exports.GraphQLDeprecatedDirective = new GraphQLDirective({ + name: 'deprecated', + description: 'Marks an element of a GraphQL schema as no longer supported.', + locations: [ + directiveLocation_ts_1.DirectiveLocation.FIELD_DEFINITION, + directiveLocation_ts_1.DirectiveLocation.ARGUMENT_DEFINITION, + directiveLocation_ts_1.DirectiveLocation.INPUT_FIELD_DEFINITION, + directiveLocation_ts_1.DirectiveLocation.ENUM_VALUE, + directiveLocation_ts_1.DirectiveLocation.DIRECTIVE_DEFINITION, + ], + args: { + reason: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString), + description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', + default: { value: exports.DEFAULT_DEPRECATION_REASON }, + }, + }, +}); +exports.GraphQLSpecifiedByDirective = new GraphQLDirective({ + name: 'specifiedBy', + description: 'Exposes a URL that specifies the behavior of this scalar.', + locations: [directiveLocation_ts_1.DirectiveLocation.SCALAR], + args: { + url: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString), + description: 'The URL that specifies the behavior of this scalar.', + }, + }, +}); +exports.GraphQLOneOfDirective = new GraphQLDirective({ + name: 'oneOf', + description: 'Indicates exactly one field must be supplied and this field must not be `null`.', + locations: [directiveLocation_ts_1.DirectiveLocation.INPUT_OBJECT], + args: {}, +}); +exports.GraphQLDisableErrorPropagationDirective = new GraphQLDirective({ + name: 'experimental_disableErrorPropagation', + description: 'Disables error propagation.', + locations: [ + directiveLocation_ts_1.DirectiveLocation.QUERY, + directiveLocation_ts_1.DirectiveLocation.MUTATION, + directiveLocation_ts_1.DirectiveLocation.SUBSCRIPTION, + ], +}); +exports.specifiedDirectives = Object.freeze([ + exports.GraphQLIncludeDirective, + exports.GraphQLSkipDirective, + exports.GraphQLDeprecatedDirective, + exports.GraphQLSpecifiedByDirective, + exports.GraphQLOneOfDirective, +]); +function isSpecifiedDirective(directive) { + return exports.specifiedDirectives.some(({ name }) => name === directive.name); +} +//# sourceMappingURL=directives.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js.map new file mode 100644 index 00000000..b0c36b9b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.js.map @@ -0,0 +1 @@ +{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../src/type/directives.ts"],"names":[],"mappings":";;;AA+CA,kCAEC;AAoBD,0CAOC;AAwbD,oDAEC;AApgBD,0DAAoD;AACpD,sDAAgD;AAChD,4DAAsD;AACtD,gEAA0D;AAC1D,0DAAoD;AAGpD,wDAA6D;AAM7D,2EAAqE;AAErE,mDAA6C;AAM7C,mDAAkE;AAClE,6CAAyE;AAGzE,MAAM,eAAe,GAAkB,MAAM,CAAC,WAAW,CAAC,CAAC;AAoB3D,SAAgB,WAAW,CAAC,SAAkB;IAC5C,OAAO,IAAA,0BAAU,EAAC,SAAS,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAClE,CAAC;AAoBD,SAAgB,eAAe,CAAC,SAAkB;IAChD,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CACb,Y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CAAC;IACZ,+BAAuB;IACvB,4BAAoB;IACpB,kCAA0B;IAC1B,mCAA2B;IAC3B,6BAAqB;CACtB,CAAC,CAAC;AAwBL,SAAgB,oBAAoB,CAAC,SAA2B;IAC9D,OAAO,2BAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC","sourcesContent":["/** @category Directives */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { instanceOf } from '../jsutils/instanceOf.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyValMap } from '../jsutils/keyValMap.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { toObjMapWithSymbols } from '../jsutils/toObjMap.ts';\n\nimport type {\n DirectiveDefinitionNode,\n DirectiveExtensionNode,\n} from '../language/ast.ts';\nimport { DirectiveLocation } from '../language/directiveLocation.ts';\n\nimport { assertName } from './assertName.ts';\nimport type {\n GraphQLArgumentConfig,\n GraphQLFieldNormalizedConfigArgumentMap,\n GraphQLSchemaElement,\n} from './definition.ts';\nimport { GraphQLArgument, GraphQLNonNull } from './definition.ts';\nimport { GraphQLBoolean, GraphQLInt, GraphQLString } from './scalars.ts';\n\n/** @private */\nconst directiveSymbol: unique symbol = Symbol('Directive');\n\n/**\n * Test if the given value is a GraphQL directive.\n * @param directive - Value to inspect.\n * @returns True when the value is a GraphQLDirective.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective, GraphQLString, isDirective } from 'graphql/type';\n *\n * const upper = new GraphQLDirective({\n * name: 'upper',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * isDirective(upper); // => true\n * isDirective(GraphQLString); // => false\n * ```\n */\nexport function isDirective(directive: unknown): directive is GraphQLDirective {\n return instanceOf(directive, directiveSymbol, GraphQLDirective);\n}\n\n/**\n * Returns the value as a GraphQLDirective, or throws if it is not a directive.\n * @param directive - Value to inspect.\n * @returns The value typed as a GraphQLDirective.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { assertDirective, GraphQLDirective, GraphQLString } from 'graphql/type';\n *\n * const upper = new GraphQLDirective({\n * name: 'upper',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * assertDirective(upper); // => upper\n * assertDirective(GraphQLString); // throws an error\n * ```\n */\nexport function assertDirective(directive: unknown): GraphQLDirective {\n if (!isDirective(directive)) {\n throw new Error(\n `Expected ${inspect(directive)} to be a GraphQL directive.`,\n );\n }\n return directive;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLDirectiveExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\nexport class GraphQLDirective implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLDirective instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Locations where this directive may be applied. */\n locations: ReadonlyArray;\n /** Arguments accepted by this field or directive. */\n args: ReadonlyArray;\n /** Whether this directive may appear more than once at the same location. */\n isRepeatable: boolean;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n /**\n * Creates a GraphQLDirective instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { DirectiveLocation, parse } from 'graphql/language';\n * import {\n * GraphQLBoolean,\n * GraphQLDirective,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * directive @cacheControl(maxAge: Int) repeatable on FIELD_DEFINITION\n * extend directive @cacheControl(maxAge: Int) on FIELD_DEFINITION\n * `);\n * const definition = document.definitions[0];\n *\n * const cacheControl = new GraphQLDirective({\n * name: 'cacheControl',\n * description: 'Controls HTTP cache hints for a field.',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: {\n * inheritMaxAge: {\n * description: 'Inherit the parent cache hint.',\n * type: new GraphQLNonNull(GraphQLBoolean),\n * default: { value: false },\n * deprecationReason: 'Use maxAge instead.',\n * extensions: { scope: 'cache' },\n * },\n * maxAge: {\n * type: GraphQLInt,\n * astNode: definition.arguments[0],\n * },\n * },\n * isRepeatable: true,\n * deprecationReason: 'Use @cache instead.',\n * extensions: { scope: 'cache' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * cacheControl.name; // => 'cacheControl'\n * cacheControl.description; // => 'Controls HTTP cache hints for a field.'\n * cacheControl.args[0].name; // => 'inheritMaxAge'\n * cacheControl.args[0].default.value; // => false\n * cacheControl.isRepeatable; // => true\n * cacheControl.extensions; // => { scope: 'cache' }\n * ```\n */\n constructor(config: Readonly) {\n this.__kind = directiveSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.locations = config.locations;\n this.isRepeatable = config.isRepeatable ?? false;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n devAssert(\n Array.isArray(config.locations),\n `@${this.name} locations must be an Array.`,\n );\n\n const args = config.args ?? {};\n devAssert(\n isObjectLike(args) && !Array.isArray(args),\n `@${this.name} args must be an object with argument names as keys.`,\n );\n\n this.args = Object.entries(args).map(\n ([argName, argConfig]) => new GraphQLArgument(this, argName, argConfig),\n );\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLDirective';\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective, GraphQLString } from 'graphql/type';\n *\n * const tag = new GraphQLDirective({\n * name: 'tag',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const config = tag.toConfig();\n * const tagCopy = new GraphQLDirective(config);\n *\n * config.args.name.type; // => GraphQLString\n * tagCopy.args[0].name; // => 'name'\n * ```\n */\n toConfig(): GraphQLDirectiveNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n locations: this.locations,\n args: keyValMap(\n this.args,\n (arg) => arg.name,\n (arg) => arg.toConfig(),\n ),\n isRepeatable: this.isRepeatable,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this directive.\n * @returns The directive schema coordinate.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective } from 'graphql/type';\n *\n * const tag = new GraphQLDirective({\n * name: 'tag',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * tag.toString(); // => '@tag'\n * ```\n */\n toString(): string {\n return '@' + this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective } from 'graphql/type';\n *\n * const tag = new GraphQLDirective({\n * name: 'tag',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * tag.toJSON(); // => '@tag'\n * JSON.stringify({ directive: tag }); // => '{\"directive\":\"@tag\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/** Configuration used to construct a GraphQLDirective. */\nexport interface GraphQLDirectiveConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Locations where this directive may be applied. */\n locations: ReadonlyArray;\n /** Arguments accepted by this field or directive. */\n args?: Maybe>;\n /** Whether this directive may appear more than once at the same location. */\n isRepeatable?: Maybe;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig {\n args: GraphQLFieldNormalizedConfigArgumentMap;\n isRepeatable: boolean;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/** Used to conditionally include fields or fragments. */\nexport const GraphQLIncludeDirective: GraphQLDirective = new GraphQLDirective({\n name: 'include',\n description:\n 'Directs the executor to include this field or fragment only when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.',\n },\n },\n});\n\n/** Used to conditionally skip (exclude) fields or fragments. */\nexport const GraphQLSkipDirective: GraphQLDirective = new GraphQLDirective({\n name: 'skip',\n description:\n 'Directs the executor to skip this field or fragment when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.',\n },\n },\n});\n\n/**\n * Experimental directive used to conditionally defer fragments.\n *\n * This directive is exported for schemas that explicitly opt in to incremental\n * delivery. It is not included in `specifiedDirectives`.\n */\nexport const GraphQLDeferDirective: GraphQLDirective = new GraphQLDirective({\n name: 'defer',\n description:\n 'Directs the executor to defer this fragment when the `if` argument is true or undefined.',\n locations: [\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Deferred when true or undefined.',\n default: { value: true },\n },\n label: {\n type: GraphQLString,\n description: 'Unique name',\n },\n },\n});\n\n/**\n * Experimental directive used to conditionally stream list fields.\n *\n * This directive is exported for schemas that explicitly opt in to incremental\n * delivery. It is not included in `specifiedDirectives`.\n */\nexport const GraphQLStreamDirective: GraphQLDirective = new GraphQLDirective({\n name: 'stream',\n description:\n 'Directs the executor to stream plural fields when the `if` argument is true or undefined.',\n locations: [DirectiveLocation.FIELD],\n args: {\n initialCount: {\n default: { value: 0 },\n type: new GraphQLNonNull(GraphQLInt),\n description: 'Number of items to return immediately',\n },\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Stream when true or undefined.',\n default: { value: true },\n },\n label: {\n type: GraphQLString,\n description: 'Unique name',\n },\n },\n});\n\n/** Constant string used for default reason for a deprecation. */\nexport const DEFAULT_DEPRECATION_REASON = 'No longer supported';\n\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n *\n * The `reason` argument is non-null and defaults to\n * `DEFAULT_DEPRECATION_REASON`.\n */\nexport const GraphQLDeprecatedDirective: GraphQLDirective =\n new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [\n DirectiveLocation.FIELD_DEFINITION,\n DirectiveLocation.ARGUMENT_DEFINITION,\n DirectiveLocation.INPUT_FIELD_DEFINITION,\n DirectiveLocation.ENUM_VALUE,\n DirectiveLocation.DIRECTIVE_DEFINITION,\n ],\n args: {\n reason: {\n type: new GraphQLNonNull(GraphQLString),\n description:\n 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',\n default: { value: DEFAULT_DEPRECATION_REASON },\n },\n },\n });\n\n/** Used to provide a URL for specifying the behavior of custom scalar definitions. */\nexport const GraphQLSpecifiedByDirective: GraphQLDirective =\n new GraphQLDirective({\n name: 'specifiedBy',\n description: 'Exposes a URL that specifies the behavior of this scalar.',\n locations: [DirectiveLocation.SCALAR],\n args: {\n url: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The URL that specifies the behavior of this scalar.',\n },\n },\n });\n\n/** Used to indicate an Input Object is a OneOf Input Object. */\nexport const GraphQLOneOfDirective: GraphQLDirective = new GraphQLDirective({\n name: 'oneOf',\n description:\n 'Indicates exactly one field must be supplied and this field must not be `null`.',\n locations: [DirectiveLocation.INPUT_OBJECT],\n args: {},\n});\n\n/**\n * Disables error propagation (experimental).\n *\n * @internal\n */\nexport const GraphQLDisableErrorPropagationDirective: GraphQLDirective =\n new GraphQLDirective({\n name: 'experimental_disableErrorPropagation',\n description: 'Disables error propagation.',\n locations: [\n DirectiveLocation.QUERY,\n DirectiveLocation.MUTATION,\n DirectiveLocation.SUBSCRIPTION,\n ],\n });\n\n/**\n * Full list of stable directives specified by GraphQL.js.\n *\n * Experimental `@defer` and `@stream` are exported separately and are not\n * included in this list.\n */\nexport const specifiedDirectives: ReadonlyArray =\n Object.freeze([\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n ]);\n\n/**\n * Returns true when the directive is one of the directives specified by GraphQL.\n * @param directive - Directive to inspect.\n * @returns True when the directive is specified by GraphQL.\n * @example\n * ```ts\n * import {\n * GraphQLDirective,\n * GraphQLIncludeDirective,\n * isSpecifiedDirective,\n * } from 'graphql/type';\n * import { DirectiveLocation } from 'graphql/language';\n *\n * const customDirective = new GraphQLDirective({\n * name: 'auth',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * isSpecifiedDirective(GraphQLIncludeDirective); // => true\n * isSpecifiedDirective(customDirective); // => false\n * ```\n */\nexport function isSpecifiedDirective(directive: GraphQLDirective): boolean {\n return specifiedDirectives.some(({ name }) => name === directive.name);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs new file mode 100644 index 00000000..9915b31e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs @@ -0,0 +1,187 @@ +import { devAssert } from "../jsutils/devAssert.mjs"; +import { inspect } from "../jsutils/inspect.mjs"; +import { instanceOf } from "../jsutils/instanceOf.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { keyValMap } from "../jsutils/keyValMap.mjs"; +import { toObjMapWithSymbols } from "../jsutils/toObjMap.mjs"; +import { DirectiveLocation } from "../language/directiveLocation.mjs"; +import { assertName } from "./assertName.mjs"; +import { GraphQLArgument, GraphQLNonNull } from "./definition.mjs"; +import { GraphQLBoolean, GraphQLInt, GraphQLString } from "./scalars.mjs"; +const directiveSymbol = Symbol('Directive'); +export function isDirective(directive) { + return instanceOf(directive, directiveSymbol, GraphQLDirective); +} +export function assertDirective(directive) { + if (!isDirective(directive)) { + throw new Error(`Expected ${inspect(directive)} to be a GraphQL directive.`); + } + return directive; +} +export class GraphQLDirective { + constructor(config) { + this.__kind = directiveSymbol; + this.name = assertName(config.name); + this.description = config.description; + this.locations = config.locations; + this.isRepeatable = config.isRepeatable ?? false; + this.deprecationReason = config.deprecationReason; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + if (!(Array.isArray(config.locations))) + devAssert(false, `@${this.name} locations must be an Array.`); + const args = config.args ?? {}; + if (!(isObjectLike(args) && !Array.isArray(args))) + devAssert(false, `@${this.name} args must be an object with argument names as keys.`); + this.args = Object.entries(args).map(([argName, argConfig]) => new GraphQLArgument(this, argName, argConfig)); + } + get [Symbol.toStringTag]() { + return 'GraphQLDirective'; + } + toConfig() { + return { + name: this.name, + description: this.description, + locations: this.locations, + args: keyValMap(this.args, (arg) => arg.name, (arg) => arg.toConfig()), + isRepeatable: this.isRepeatable, + deprecationReason: this.deprecationReason, + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + }; + } + toString() { + return '@' + this.name; + } + toJSON() { + return this.toString(); + } +} +export const GraphQLIncludeDirective = new GraphQLDirective({ + name: 'include', + description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + locations: [ + DirectiveLocation.FIELD, + DirectiveLocation.FRAGMENT_SPREAD, + DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Included when true.', + }, + }, +}); +export const GraphQLSkipDirective = new GraphQLDirective({ + name: 'skip', + description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + locations: [ + DirectiveLocation.FIELD, + DirectiveLocation.FRAGMENT_SPREAD, + DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Skipped when true.', + }, + }, +}); +export const GraphQLDeferDirective = new GraphQLDirective({ + name: 'defer', + description: 'Directs the executor to defer this fragment when the `if` argument is true or undefined.', + locations: [ + DirectiveLocation.FRAGMENT_SPREAD, + DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Deferred when true or undefined.', + default: { value: true }, + }, + label: { + type: GraphQLString, + description: 'Unique name', + }, + }, +}); +export const GraphQLStreamDirective = new GraphQLDirective({ + name: 'stream', + description: 'Directs the executor to stream plural fields when the `if` argument is true or undefined.', + locations: [DirectiveLocation.FIELD], + args: { + initialCount: { + default: { value: 0 }, + type: new GraphQLNonNull(GraphQLInt), + description: 'Number of items to return immediately', + }, + if: { + type: new GraphQLNonNull(GraphQLBoolean), + description: 'Stream when true or undefined.', + default: { value: true }, + }, + label: { + type: GraphQLString, + description: 'Unique name', + }, + }, +}); +export const DEFAULT_DEPRECATION_REASON = 'No longer supported'; +export const GraphQLDeprecatedDirective = new GraphQLDirective({ + name: 'deprecated', + description: 'Marks an element of a GraphQL schema as no longer supported.', + locations: [ + DirectiveLocation.FIELD_DEFINITION, + DirectiveLocation.ARGUMENT_DEFINITION, + DirectiveLocation.INPUT_FIELD_DEFINITION, + DirectiveLocation.ENUM_VALUE, + DirectiveLocation.DIRECTIVE_DEFINITION, + ], + args: { + reason: { + type: new GraphQLNonNull(GraphQLString), + description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', + default: { value: DEFAULT_DEPRECATION_REASON }, + }, + }, +}); +export const GraphQLSpecifiedByDirective = new GraphQLDirective({ + name: 'specifiedBy', + description: 'Exposes a URL that specifies the behavior of this scalar.', + locations: [DirectiveLocation.SCALAR], + args: { + url: { + type: new GraphQLNonNull(GraphQLString), + description: 'The URL that specifies the behavior of this scalar.', + }, + }, +}); +export const GraphQLOneOfDirective = new GraphQLDirective({ + name: 'oneOf', + description: 'Indicates exactly one field must be supplied and this field must not be `null`.', + locations: [DirectiveLocation.INPUT_OBJECT], + args: {}, +}); +export const GraphQLDisableErrorPropagationDirective = new GraphQLDirective({ + name: 'experimental_disableErrorPropagation', + description: 'Disables error propagation.', + locations: [ + DirectiveLocation.QUERY, + DirectiveLocation.MUTATION, + DirectiveLocation.SUBSCRIPTION, + ], +}); +export const specifiedDirectives = Object.freeze([ + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + GraphQLSpecifiedByDirective, + GraphQLOneOfDirective, +]); +export function isSpecifiedDirective(directive) { + return specifiedDirectives.some(({ name }) => name === directive.name); +} +//# sourceMappingURL=directives.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs.map new file mode 100644 index 00000000..3427c820 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/directives.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../src/type/directives.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,UAAU,EAAE,kCAAiC;AACtD,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAC1D,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,gCAA+B;AAM7D,OAAO,EAAE,iBAAiB,EAAE,0CAAyC;AAErE,OAAO,EAAE,UAAU,EAAE,yBAAwB;AAM7C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,yBAAwB;AAClE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,sBAAqB;AAGzE,MAAM,eAAe,GAAkB,MAAM,CAAC,WAAW,CAAC,CAAC;AAoB3D,MAAM,UAAU,WAAW,CAAC,SAAkB;IAC5C,OAAO,UAAU,CAAC,SAAS,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAClE,CAAC;AAoBD,MAAM,UAAU,eAAe,CAAC,SAAkB;IAChD,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CACb,YAAY,OAAO,CAAC,SAAS,CAAC,6BAA6B,CAC5D,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAkBD,MAAM,OAAO,gBAAgB;IA4E3B,YAAY,MAAwC;QAClD,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WA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AC;AACzE,CAAC","sourcesContent":["/** @category Directives */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { instanceOf } from '../jsutils/instanceOf.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyValMap } from '../jsutils/keyValMap.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { toObjMapWithSymbols } from '../jsutils/toObjMap.ts';\n\nimport type {\n DirectiveDefinitionNode,\n DirectiveExtensionNode,\n} from '../language/ast.ts';\nimport { DirectiveLocation } from '../language/directiveLocation.ts';\n\nimport { assertName } from './assertName.ts';\nimport type {\n GraphQLArgumentConfig,\n GraphQLFieldNormalizedConfigArgumentMap,\n GraphQLSchemaElement,\n} from './definition.ts';\nimport { GraphQLArgument, GraphQLNonNull } from './definition.ts';\nimport { GraphQLBoolean, GraphQLInt, GraphQLString } from './scalars.ts';\n\n/** @private */\nconst directiveSymbol: unique symbol = Symbol('Directive');\n\n/**\n * Test if the given value is a GraphQL directive.\n * @param directive - Value to inspect.\n * @returns True when the value is a GraphQLDirective.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective, GraphQLString, isDirective } from 'graphql/type';\n *\n * const upper = new GraphQLDirective({\n * name: 'upper',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * isDirective(upper); // => true\n * isDirective(GraphQLString); // => false\n * ```\n */\nexport function isDirective(directive: unknown): directive is GraphQLDirective {\n return instanceOf(directive, directiveSymbol, GraphQLDirective);\n}\n\n/**\n * Returns the value as a GraphQLDirective, or throws if it is not a directive.\n * @param directive - Value to inspect.\n * @returns The value typed as a GraphQLDirective.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { assertDirective, GraphQLDirective, GraphQLString } from 'graphql/type';\n *\n * const upper = new GraphQLDirective({\n * name: 'upper',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * assertDirective(upper); // => upper\n * assertDirective(GraphQLString); // throws an error\n * ```\n */\nexport function assertDirective(directive: unknown): GraphQLDirective {\n if (!isDirective(directive)) {\n throw new Error(\n `Expected ${inspect(directive)} to be a GraphQL directive.`,\n );\n }\n return directive;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLDirectiveExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\nexport class GraphQLDirective implements GraphQLSchemaElement {\n /**\n * Internal runtime marker used to identify GraphQLDirective instances.\n * @private\n */\n readonly __kind: symbol;\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Locations where this directive may be applied. */\n locations: ReadonlyArray;\n /** Arguments accepted by this field or directive. */\n args: ReadonlyArray;\n /** Whether this directive may appear more than once at the same location. */\n isRepeatable: boolean;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n /**\n * Creates a GraphQLDirective instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * import { DirectiveLocation, parse } from 'graphql/language';\n * import {\n * GraphQLBoolean,\n * GraphQLDirective,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n *\n * const document = parse(`\n * directive @cacheControl(maxAge: Int) repeatable on FIELD_DEFINITION\n * extend directive @cacheControl(maxAge: Int) on FIELD_DEFINITION\n * `);\n * const definition = document.definitions[0];\n *\n * const cacheControl = new GraphQLDirective({\n * name: 'cacheControl',\n * description: 'Controls HTTP cache hints for a field.',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: {\n * inheritMaxAge: {\n * description: 'Inherit the parent cache hint.',\n * type: new GraphQLNonNull(GraphQLBoolean),\n * default: { value: false },\n * deprecationReason: 'Use maxAge instead.',\n * extensions: { scope: 'cache' },\n * },\n * maxAge: {\n * type: GraphQLInt,\n * astNode: definition.arguments[0],\n * },\n * },\n * isRepeatable: true,\n * deprecationReason: 'Use @cache instead.',\n * extensions: { scope: 'cache' },\n * astNode: definition,\n * extensionASTNodes: [document.definitions[1]],\n * });\n *\n * cacheControl.name; // => 'cacheControl'\n * cacheControl.description; // => 'Controls HTTP cache hints for a field.'\n * cacheControl.args[0].name; // => 'inheritMaxAge'\n * cacheControl.args[0].default.value; // => false\n * cacheControl.isRepeatable; // => true\n * cacheControl.extensions; // => { scope: 'cache' }\n * ```\n */\n constructor(config: Readonly) {\n this.__kind = directiveSymbol;\n this.name = assertName(config.name);\n this.description = config.description;\n this.locations = config.locations;\n this.isRepeatable = config.isRepeatable ?? false;\n this.deprecationReason = config.deprecationReason;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n devAssert(\n Array.isArray(config.locations),\n `@${this.name} locations must be an Array.`,\n );\n\n const args = config.args ?? {};\n devAssert(\n isObjectLike(args) && !Array.isArray(args),\n `@${this.name} args must be an object with argument names as keys.`,\n );\n\n this.args = Object.entries(args).map(\n ([argName, argConfig]) => new GraphQLArgument(this, argName, argConfig),\n );\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLDirective';\n }\n\n /**\n * Returns a normalized configuration object for this object.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective, GraphQLString } from 'graphql/type';\n *\n * const tag = new GraphQLDirective({\n * name: 'tag',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const config = tag.toConfig();\n * const tagCopy = new GraphQLDirective(config);\n *\n * config.args.name.type; // => GraphQLString\n * tagCopy.args[0].name; // => 'name'\n * ```\n */\n toConfig(): GraphQLDirectiveNormalizedConfig {\n return {\n name: this.name,\n description: this.description,\n locations: this.locations,\n args: keyValMap(\n this.args,\n (arg) => arg.name,\n (arg) => arg.toConfig(),\n ),\n isRepeatable: this.isRepeatable,\n deprecationReason: this.deprecationReason,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n /**\n * Returns the schema coordinate identifying this directive.\n * @returns The directive schema coordinate.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective } from 'graphql/type';\n *\n * const tag = new GraphQLDirective({\n * name: 'tag',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * tag.toString(); // => '@tag'\n * ```\n */\n toString(): string {\n return '@' + this.name;\n }\n\n /**\n * Returns the JSON representation used when this object is serialized.\n * @returns The JSON-serializable representation.\n * @example\n * ```ts\n * import { DirectiveLocation } from 'graphql/language';\n * import { GraphQLDirective } from 'graphql/type';\n *\n * const tag = new GraphQLDirective({\n * name: 'tag',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * tag.toJSON(); // => '@tag'\n * JSON.stringify({ directive: tag }); // => '{\"directive\":\"@tag\"}'\n * ```\n */\n toJSON(): string {\n return this.toString();\n }\n}\n\n/** Configuration used to construct a GraphQLDirective. */\nexport interface GraphQLDirectiveConfig {\n /** The GraphQL name for this schema element. */\n name: string;\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Locations where this directive may be applied. */\n locations: ReadonlyArray;\n /** Arguments accepted by this field or directive. */\n args?: Maybe>;\n /** Whether this directive may appear more than once at the same location. */\n isRepeatable?: Maybe;\n /** Reason this element is deprecated, if one was provided. */\n deprecationReason?: Maybe;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig {\n args: GraphQLFieldNormalizedConfigArgumentMap;\n isRepeatable: boolean;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n}\n\n/** Used to conditionally include fields or fragments. */\nexport const GraphQLIncludeDirective: GraphQLDirective = new GraphQLDirective({\n name: 'include',\n description:\n 'Directs the executor to include this field or fragment only when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.',\n },\n },\n});\n\n/** Used to conditionally skip (exclude) fields or fragments. */\nexport const GraphQLSkipDirective: GraphQLDirective = new GraphQLDirective({\n name: 'skip',\n description:\n 'Directs the executor to skip this field or fragment when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.',\n },\n },\n});\n\n/**\n * Experimental directive used to conditionally defer fragments.\n *\n * This directive is exported for schemas that explicitly opt in to incremental\n * delivery. It is not included in `specifiedDirectives`.\n */\nexport const GraphQLDeferDirective: GraphQLDirective = new GraphQLDirective({\n name: 'defer',\n description:\n 'Directs the executor to defer this fragment when the `if` argument is true or undefined.',\n locations: [\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Deferred when true or undefined.',\n default: { value: true },\n },\n label: {\n type: GraphQLString,\n description: 'Unique name',\n },\n },\n});\n\n/**\n * Experimental directive used to conditionally stream list fields.\n *\n * This directive is exported for schemas that explicitly opt in to incremental\n * delivery. It is not included in `specifiedDirectives`.\n */\nexport const GraphQLStreamDirective: GraphQLDirective = new GraphQLDirective({\n name: 'stream',\n description:\n 'Directs the executor to stream plural fields when the `if` argument is true or undefined.',\n locations: [DirectiveLocation.FIELD],\n args: {\n initialCount: {\n default: { value: 0 },\n type: new GraphQLNonNull(GraphQLInt),\n description: 'Number of items to return immediately',\n },\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Stream when true or undefined.',\n default: { value: true },\n },\n label: {\n type: GraphQLString,\n description: 'Unique name',\n },\n },\n});\n\n/** Constant string used for default reason for a deprecation. */\nexport const DEFAULT_DEPRECATION_REASON = 'No longer supported';\n\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n *\n * The `reason` argument is non-null and defaults to\n * `DEFAULT_DEPRECATION_REASON`.\n */\nexport const GraphQLDeprecatedDirective: GraphQLDirective =\n new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [\n DirectiveLocation.FIELD_DEFINITION,\n DirectiveLocation.ARGUMENT_DEFINITION,\n DirectiveLocation.INPUT_FIELD_DEFINITION,\n DirectiveLocation.ENUM_VALUE,\n DirectiveLocation.DIRECTIVE_DEFINITION,\n ],\n args: {\n reason: {\n type: new GraphQLNonNull(GraphQLString),\n description:\n 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',\n default: { value: DEFAULT_DEPRECATION_REASON },\n },\n },\n });\n\n/** Used to provide a URL for specifying the behavior of custom scalar definitions. */\nexport const GraphQLSpecifiedByDirective: GraphQLDirective =\n new GraphQLDirective({\n name: 'specifiedBy',\n description: 'Exposes a URL that specifies the behavior of this scalar.',\n locations: [DirectiveLocation.SCALAR],\n args: {\n url: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The URL that specifies the behavior of this scalar.',\n },\n },\n });\n\n/** Used to indicate an Input Object is a OneOf Input Object. */\nexport const GraphQLOneOfDirective: GraphQLDirective = new GraphQLDirective({\n name: 'oneOf',\n description:\n 'Indicates exactly one field must be supplied and this field must not be `null`.',\n locations: [DirectiveLocation.INPUT_OBJECT],\n args: {},\n});\n\n/**\n * Disables error propagation (experimental).\n *\n * @internal\n */\nexport const GraphQLDisableErrorPropagationDirective: GraphQLDirective =\n new GraphQLDirective({\n name: 'experimental_disableErrorPropagation',\n description: 'Disables error propagation.',\n locations: [\n DirectiveLocation.QUERY,\n DirectiveLocation.MUTATION,\n DirectiveLocation.SUBSCRIPTION,\n ],\n });\n\n/**\n * Full list of stable directives specified by GraphQL.js.\n *\n * Experimental `@defer` and `@stream` are exported separately and are not\n * included in this list.\n */\nexport const specifiedDirectives: ReadonlyArray =\n Object.freeze([\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n ]);\n\n/**\n * Returns true when the directive is one of the directives specified by GraphQL.\n * @param directive - Directive to inspect.\n * @returns True when the directive is specified by GraphQL.\n * @example\n * ```ts\n * import {\n * GraphQLDirective,\n * GraphQLIncludeDirective,\n * isSpecifiedDirective,\n * } from 'graphql/type';\n * import { DirectiveLocation } from 'graphql/language';\n *\n * const customDirective = new GraphQLDirective({\n * name: 'auth',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * });\n *\n * isSpecifiedDirective(GraphQLIncludeDirective); // => true\n * isSpecifiedDirective(customDirective); // => false\n * ```\n */\nexport function isSpecifiedDirective(directive: GraphQLDirective): boolean {\n return specifiedDirectives.some(({ name }) => name === directive.name);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.mts new file mode 100644 index 00000000..aadee3f7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.mts @@ -0,0 +1,18 @@ +/** + * Create and inspect GraphQL type definitions and schemas. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export type { Path as ResponsePath } from "../jsutils/Path.mjs"; +export { isSchema, assertSchema, GraphQLSchema, } from "./schema.mjs"; +export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from "./schema.mjs"; +export type { GraphQLField, GraphQLArgument, GraphQLEnumValue, GraphQLInputField, } from "./definition.mjs"; +export { resolveObjMapThunk, resolveReadonlyArrayThunk, isType, isScalarType, isObjectType, isField, isArgument, isInterfaceType, isUnionType, isEnumType, isEnumValue, isInputObjectType, isListType, isNonNullType, isInputType, isInputField, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, assertType, assertScalarType, assertObjectType, assertField, assertArgument, assertInterfaceType, assertUnionType, assertEnumType, assertEnumValue, assertInputObjectType, assertInputField, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, getNullableType, getNamedType, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, } from "./definition.mjs"; +export type { GraphQLType, GraphQLInputType, GraphQLOutputType, GraphQLLeafType, GraphQLCompositeType, GraphQLAbstractType, GraphQLWrappingType, GraphQLNullableType, GraphQLNullableInputType, GraphQLNullableOutputType, GraphQLNamedType, GraphQLNamedInputType, GraphQLNamedOutputType, ThunkReadonlyArray, ThunkObjMap, GraphQLArgumentConfig, GraphQLArgumentExtensions, GraphQLEnumTypeConfig, GraphQLEnumTypeExtensions, GraphQLEnumValueConfig, GraphQLEnumValueConfigMap, GraphQLEnumValueExtensions, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLFieldExtensions, GraphQLFieldMap, GraphQLFieldResolver, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputFieldExtensions, GraphQLInputFieldMap, GraphQLInputObjectTypeConfig, GraphQLInputObjectTypeExtensions, GraphQLInterfaceTypeConfig, GraphQLInterfaceTypeExtensions, GraphQLIsTypeOfFn, GraphQLObjectTypeConfig, GraphQLObjectTypeExtensions, GraphQLResolveInfo, GraphQLResolveInfoHelpers, GraphQLScalarTypeConfig, GraphQLScalarTypeExtensions, GraphQLTypeResolver, GraphQLUnionTypeConfig, GraphQLUnionTypeExtensions, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, GraphQLScalarOutputValueCoercer, GraphQLScalarInputValueCoercer, GraphQLScalarInputLiteralCoercer, GraphQLDefaultInput, } from "./definition.mjs"; +export { isDirective, assertDirective, GraphQLDirective, isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeferDirective, GraphQLStreamDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective, DEFAULT_DEPRECATION_REASON, } from "./directives.mjs"; +export type { GraphQLDirectiveConfig, GraphQLDirectiveExtensions, } from "./directives.mjs"; +export { isSpecifiedScalarType, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, } from "./scalars.mjs"; +export { isIntrospectionType, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, TypeKind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from "./introspection.mjs"; +export { validateSchema, assertValidSchema } from "./validate.mjs"; +export { assertName, assertEnumValueName } from "./assertName.mjs"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.ts new file mode 100644 index 00000000..af161a93 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.d.ts @@ -0,0 +1,18 @@ +/** + * Create and inspect GraphQL type definitions and schemas. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export type { Path as ResponsePath } from "../jsutils/Path.js"; +export { isSchema, assertSchema, GraphQLSchema, } from "./schema.js"; +export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from "./schema.js"; +export type { GraphQLField, GraphQLArgument, GraphQLEnumValue, GraphQLInputField, } from "./definition.js"; +export { resolveObjMapThunk, resolveReadonlyArrayThunk, isType, isScalarType, isObjectType, isField, isArgument, isInterfaceType, isUnionType, isEnumType, isEnumValue, isInputObjectType, isListType, isNonNullType, isInputType, isInputField, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, assertType, assertScalarType, assertObjectType, assertField, assertArgument, assertInterfaceType, assertUnionType, assertEnumType, assertEnumValue, assertInputObjectType, assertInputField, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, getNullableType, getNamedType, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, } from "./definition.js"; +export type { GraphQLType, GraphQLInputType, GraphQLOutputType, GraphQLLeafType, GraphQLCompositeType, GraphQLAbstractType, GraphQLWrappingType, GraphQLNullableType, GraphQLNullableInputType, GraphQLNullableOutputType, GraphQLNamedType, GraphQLNamedInputType, GraphQLNamedOutputType, ThunkReadonlyArray, ThunkObjMap, GraphQLArgumentConfig, GraphQLArgumentExtensions, GraphQLEnumTypeConfig, GraphQLEnumTypeExtensions, GraphQLEnumValueConfig, GraphQLEnumValueConfigMap, GraphQLEnumValueExtensions, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLFieldExtensions, GraphQLFieldMap, GraphQLFieldResolver, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputFieldExtensions, GraphQLInputFieldMap, GraphQLInputObjectTypeConfig, GraphQLInputObjectTypeExtensions, GraphQLInterfaceTypeConfig, GraphQLInterfaceTypeExtensions, GraphQLIsTypeOfFn, GraphQLObjectTypeConfig, GraphQLObjectTypeExtensions, GraphQLResolveInfo, GraphQLResolveInfoHelpers, GraphQLScalarTypeConfig, GraphQLScalarTypeExtensions, GraphQLTypeResolver, GraphQLUnionTypeConfig, GraphQLUnionTypeExtensions, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, GraphQLScalarOutputValueCoercer, GraphQLScalarInputValueCoercer, GraphQLScalarInputLiteralCoercer, GraphQLDefaultInput, } from "./definition.js"; +export { isDirective, assertDirective, GraphQLDirective, isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeferDirective, GraphQLStreamDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective, DEFAULT_DEPRECATION_REASON, } from "./directives.js"; +export type { GraphQLDirectiveConfig, GraphQLDirectiveExtensions, } from "./directives.js"; +export { isSpecifiedScalarType, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, } from "./scalars.js"; +export { isIntrospectionType, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, TypeKind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from "./introspection.js"; +export { validateSchema, assertValidSchema } from "./validate.js"; +export { assertName, assertEnumValueName } from "./assertName.js"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js new file mode 100644 index 00000000..d3f82887 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js @@ -0,0 +1,111 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getNullableType = exports.assertNamedType = exports.assertNullableType = exports.assertWrappingType = exports.assertAbstractType = exports.assertCompositeType = exports.assertLeafType = exports.assertOutputType = exports.assertInputType = exports.assertNonNullType = exports.assertListType = exports.assertInputField = exports.assertInputObjectType = exports.assertEnumValue = exports.assertEnumType = exports.assertUnionType = exports.assertInterfaceType = exports.assertArgument = exports.assertField = exports.assertObjectType = exports.assertScalarType = exports.assertType = exports.isRequiredInputField = exports.isRequiredArgument = exports.isNamedType = exports.isNullableType = exports.isWrappingType = exports.isAbstractType = exports.isCompositeType = exports.isLeafType = exports.isOutputType = exports.isInputField = exports.isInputType = exports.isNonNullType = exports.isListType = exports.isInputObjectType = exports.isEnumValue = exports.isEnumType = exports.isUnionType = exports.isInterfaceType = exports.isArgument = exports.isField = exports.isObjectType = exports.isScalarType = exports.isType = exports.resolveReadonlyArrayThunk = exports.resolveObjMapThunk = exports.GraphQLSchema = exports.assertSchema = exports.isSchema = void 0; +exports.assertEnumValueName = exports.assertName = exports.assertValidSchema = exports.validateSchema = exports.TypeNameMetaFieldDef = exports.TypeMetaFieldDef = exports.SchemaMetaFieldDef = exports.TypeKind = exports.__TypeKind = exports.__EnumValue = exports.__InputValue = exports.__Field = exports.__Type = exports.__DirectiveLocation = exports.__Directive = exports.__Schema = exports.introspectionTypes = exports.isIntrospectionType = exports.GRAPHQL_MIN_INT = exports.GRAPHQL_MAX_INT = exports.GraphQLID = exports.GraphQLBoolean = exports.GraphQLString = exports.GraphQLFloat = exports.GraphQLInt = exports.specifiedScalarTypes = exports.isSpecifiedScalarType = exports.DEFAULT_DEPRECATION_REASON = exports.GraphQLOneOfDirective = exports.GraphQLSpecifiedByDirective = exports.GraphQLDeprecatedDirective = exports.GraphQLStreamDirective = exports.GraphQLDeferDirective = exports.GraphQLSkipDirective = exports.GraphQLIncludeDirective = exports.specifiedDirectives = exports.isSpecifiedDirective = exports.GraphQLDirective = exports.assertDirective = exports.isDirective = exports.GraphQLNonNull = exports.GraphQLList = exports.GraphQLInputObjectType = exports.GraphQLEnumType = exports.GraphQLUnionType = exports.GraphQLInterfaceType = exports.GraphQLObjectType = exports.GraphQLScalarType = exports.getNamedType = void 0; +var schema_ts_1 = require("./schema.js"); +Object.defineProperty(exports, "isSchema", { enumerable: true, get: function () { return schema_ts_1.isSchema; } }); +Object.defineProperty(exports, "assertSchema", { enumerable: true, get: function () { return schema_ts_1.assertSchema; } }); +Object.defineProperty(exports, "GraphQLSchema", { enumerable: true, get: function () { return schema_ts_1.GraphQLSchema; } }); +var definition_ts_1 = require("./definition.js"); +Object.defineProperty(exports, "resolveObjMapThunk", { enumerable: true, get: function () { return definition_ts_1.resolveObjMapThunk; } }); +Object.defineProperty(exports, "resolveReadonlyArrayThunk", { enumerable: true, get: function () { return definition_ts_1.resolveReadonlyArrayThunk; } }); +Object.defineProperty(exports, "isType", { enumerable: true, get: function () { return definition_ts_1.isType; } }); +Object.defineProperty(exports, "isScalarType", { enumerable: true, get: function () { return definition_ts_1.isScalarType; } }); +Object.defineProperty(exports, "isObjectType", { enumerable: true, get: function () { return definition_ts_1.isObjectType; } }); +Object.defineProperty(exports, "isField", { enumerable: true, get: function () { return definition_ts_1.isField; } }); +Object.defineProperty(exports, "isArgument", { enumerable: true, get: function () { return definition_ts_1.isArgument; } }); +Object.defineProperty(exports, "isInterfaceType", { enumerable: true, get: function () { return definition_ts_1.isInterfaceType; } }); +Object.defineProperty(exports, "isUnionType", { enumerable: true, get: function () { return definition_ts_1.isUnionType; } }); +Object.defineProperty(exports, "isEnumType", { enumerable: true, get: function () { return definition_ts_1.isEnumType; } }); +Object.defineProperty(exports, "isEnumValue", { enumerable: true, get: function () { return definition_ts_1.isEnumValue; } }); +Object.defineProperty(exports, "isInputObjectType", { enumerable: true, get: function () { return definition_ts_1.isInputObjectType; } }); +Object.defineProperty(exports, "isListType", { enumerable: true, get: function () { return definition_ts_1.isListType; } }); +Object.defineProperty(exports, "isNonNullType", { enumerable: true, get: function () { return definition_ts_1.isNonNullType; } }); +Object.defineProperty(exports, "isInputType", { enumerable: true, get: function () { return definition_ts_1.isInputType; } }); +Object.defineProperty(exports, "isInputField", { enumerable: true, get: function () { return definition_ts_1.isInputField; } }); +Object.defineProperty(exports, "isOutputType", { enumerable: true, get: function () { return definition_ts_1.isOutputType; } }); +Object.defineProperty(exports, "isLeafType", { enumerable: true, get: function () { return definition_ts_1.isLeafType; } }); +Object.defineProperty(exports, "isCompositeType", { enumerable: true, get: function () { return definition_ts_1.isCompositeType; } }); +Object.defineProperty(exports, "isAbstractType", { enumerable: true, get: function () { return definition_ts_1.isAbstractType; } }); +Object.defineProperty(exports, "isWrappingType", { enumerable: true, get: function () { return definition_ts_1.isWrappingType; } }); +Object.defineProperty(exports, "isNullableType", { enumerable: true, get: function () { return definition_ts_1.isNullableType; } }); +Object.defineProperty(exports, "isNamedType", { enumerable: true, get: function () { return definition_ts_1.isNamedType; } }); +Object.defineProperty(exports, "isRequiredArgument", { enumerable: true, get: function () { return definition_ts_1.isRequiredArgument; } }); +Object.defineProperty(exports, "isRequiredInputField", { enumerable: true, get: function () { return definition_ts_1.isRequiredInputField; } }); +Object.defineProperty(exports, "assertType", { enumerable: true, get: function () { return definition_ts_1.assertType; } }); +Object.defineProperty(exports, "assertScalarType", { enumerable: true, get: function () { return definition_ts_1.assertScalarType; } }); +Object.defineProperty(exports, "assertObjectType", { enumerable: true, get: function () { return definition_ts_1.assertObjectType; } }); +Object.defineProperty(exports, "assertField", { enumerable: true, get: function () { return definition_ts_1.assertField; } }); +Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return definition_ts_1.assertArgument; } }); +Object.defineProperty(exports, "assertInterfaceType", { enumerable: true, get: function () { return definition_ts_1.assertInterfaceType; } }); +Object.defineProperty(exports, "assertUnionType", { enumerable: true, get: function () { return definition_ts_1.assertUnionType; } }); +Object.defineProperty(exports, "assertEnumType", { enumerable: true, get: function () { return definition_ts_1.assertEnumType; } }); +Object.defineProperty(exports, "assertEnumValue", { enumerable: true, get: function () { return definition_ts_1.assertEnumValue; } }); +Object.defineProperty(exports, "assertInputObjectType", { enumerable: true, get: function () { return definition_ts_1.assertInputObjectType; } }); +Object.defineProperty(exports, "assertInputField", { enumerable: true, get: function () { return definition_ts_1.assertInputField; } }); +Object.defineProperty(exports, "assertListType", { enumerable: true, get: function () { return definition_ts_1.assertListType; } }); +Object.defineProperty(exports, "assertNonNullType", { enumerable: true, get: function () { return definition_ts_1.assertNonNullType; } }); +Object.defineProperty(exports, "assertInputType", { enumerable: true, get: function () { return definition_ts_1.assertInputType; } }); +Object.defineProperty(exports, "assertOutputType", { enumerable: true, get: function () { return definition_ts_1.assertOutputType; } }); +Object.defineProperty(exports, "assertLeafType", { enumerable: true, get: function () { return definition_ts_1.assertLeafType; } }); +Object.defineProperty(exports, "assertCompositeType", { enumerable: true, get: function () { return definition_ts_1.assertCompositeType; } }); +Object.defineProperty(exports, "assertAbstractType", { enumerable: true, get: function () { return definition_ts_1.assertAbstractType; } }); +Object.defineProperty(exports, "assertWrappingType", { enumerable: true, get: function () { return definition_ts_1.assertWrappingType; } }); +Object.defineProperty(exports, "assertNullableType", { enumerable: true, get: function () { return definition_ts_1.assertNullableType; } }); +Object.defineProperty(exports, "assertNamedType", { enumerable: true, get: function () { return definition_ts_1.assertNamedType; } }); +Object.defineProperty(exports, "getNullableType", { enumerable: true, get: function () { return definition_ts_1.getNullableType; } }); +Object.defineProperty(exports, "getNamedType", { enumerable: true, get: function () { return definition_ts_1.getNamedType; } }); +Object.defineProperty(exports, "GraphQLScalarType", { enumerable: true, get: function () { return definition_ts_1.GraphQLScalarType; } }); +Object.defineProperty(exports, "GraphQLObjectType", { enumerable: true, get: function () { return definition_ts_1.GraphQLObjectType; } }); +Object.defineProperty(exports, "GraphQLInterfaceType", { enumerable: true, get: function () { return definition_ts_1.GraphQLInterfaceType; } }); +Object.defineProperty(exports, "GraphQLUnionType", { enumerable: true, get: function () { return definition_ts_1.GraphQLUnionType; } }); +Object.defineProperty(exports, "GraphQLEnumType", { enumerable: true, get: function () { return definition_ts_1.GraphQLEnumType; } }); +Object.defineProperty(exports, "GraphQLInputObjectType", { enumerable: true, get: function () { return definition_ts_1.GraphQLInputObjectType; } }); +Object.defineProperty(exports, "GraphQLList", { enumerable: true, get: function () { return definition_ts_1.GraphQLList; } }); +Object.defineProperty(exports, "GraphQLNonNull", { enumerable: true, get: function () { return definition_ts_1.GraphQLNonNull; } }); +var directives_ts_1 = require("./directives.js"); +Object.defineProperty(exports, "isDirective", { enumerable: true, get: function () { return directives_ts_1.isDirective; } }); +Object.defineProperty(exports, "assertDirective", { enumerable: true, get: function () { return directives_ts_1.assertDirective; } }); +Object.defineProperty(exports, "GraphQLDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLDirective; } }); +Object.defineProperty(exports, "isSpecifiedDirective", { enumerable: true, get: function () { return directives_ts_1.isSpecifiedDirective; } }); +Object.defineProperty(exports, "specifiedDirectives", { enumerable: true, get: function () { return directives_ts_1.specifiedDirectives; } }); +Object.defineProperty(exports, "GraphQLIncludeDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLIncludeDirective; } }); +Object.defineProperty(exports, "GraphQLSkipDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLSkipDirective; } }); +Object.defineProperty(exports, "GraphQLDeferDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLDeferDirective; } }); +Object.defineProperty(exports, "GraphQLStreamDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLStreamDirective; } }); +Object.defineProperty(exports, "GraphQLDeprecatedDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLDeprecatedDirective; } }); +Object.defineProperty(exports, "GraphQLSpecifiedByDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLSpecifiedByDirective; } }); +Object.defineProperty(exports, "GraphQLOneOfDirective", { enumerable: true, get: function () { return directives_ts_1.GraphQLOneOfDirective; } }); +Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", { enumerable: true, get: function () { return directives_ts_1.DEFAULT_DEPRECATION_REASON; } }); +var scalars_ts_1 = require("./scalars.js"); +Object.defineProperty(exports, "isSpecifiedScalarType", { enumerable: true, get: function () { return scalars_ts_1.isSpecifiedScalarType; } }); +Object.defineProperty(exports, "specifiedScalarTypes", { enumerable: true, get: function () { return scalars_ts_1.specifiedScalarTypes; } }); +Object.defineProperty(exports, "GraphQLInt", { enumerable: true, get: function () { return scalars_ts_1.GraphQLInt; } }); +Object.defineProperty(exports, "GraphQLFloat", { enumerable: true, get: function () { return scalars_ts_1.GraphQLFloat; } }); +Object.defineProperty(exports, "GraphQLString", { enumerable: true, get: function () { return scalars_ts_1.GraphQLString; } }); +Object.defineProperty(exports, "GraphQLBoolean", { enumerable: true, get: function () { return scalars_ts_1.GraphQLBoolean; } }); +Object.defineProperty(exports, "GraphQLID", { enumerable: true, get: function () { return scalars_ts_1.GraphQLID; } }); +Object.defineProperty(exports, "GRAPHQL_MAX_INT", { enumerable: true, get: function () { return scalars_ts_1.GRAPHQL_MAX_INT; } }); +Object.defineProperty(exports, "GRAPHQL_MIN_INT", { enumerable: true, get: function () { return scalars_ts_1.GRAPHQL_MIN_INT; } }); +var introspection_ts_1 = require("./introspection.js"); +Object.defineProperty(exports, "isIntrospectionType", { enumerable: true, get: function () { return introspection_ts_1.isIntrospectionType; } }); +Object.defineProperty(exports, "introspectionTypes", { enumerable: true, get: function () { return introspection_ts_1.introspectionTypes; } }); +Object.defineProperty(exports, "__Schema", { enumerable: true, get: function () { return introspection_ts_1.__Schema; } }); +Object.defineProperty(exports, "__Directive", { enumerable: true, get: function () { return introspection_ts_1.__Directive; } }); +Object.defineProperty(exports, "__DirectiveLocation", { enumerable: true, get: function () { return introspection_ts_1.__DirectiveLocation; } }); +Object.defineProperty(exports, "__Type", { enumerable: true, get: function () { return introspection_ts_1.__Type; } }); +Object.defineProperty(exports, "__Field", { enumerable: true, get: function () { return introspection_ts_1.__Field; } }); +Object.defineProperty(exports, "__InputValue", { enumerable: true, get: function () { return introspection_ts_1.__InputValue; } }); +Object.defineProperty(exports, "__EnumValue", { enumerable: true, get: function () { return introspection_ts_1.__EnumValue; } }); +Object.defineProperty(exports, "__TypeKind", { enumerable: true, get: function () { return introspection_ts_1.__TypeKind; } }); +Object.defineProperty(exports, "TypeKind", { enumerable: true, get: function () { return introspection_ts_1.TypeKind; } }); +Object.defineProperty(exports, "SchemaMetaFieldDef", { enumerable: true, get: function () { return introspection_ts_1.SchemaMetaFieldDef; } }); +Object.defineProperty(exports, "TypeMetaFieldDef", { enumerable: true, get: function () { return introspection_ts_1.TypeMetaFieldDef; } }); +Object.defineProperty(exports, "TypeNameMetaFieldDef", { enumerable: true, get: function () { return introspection_ts_1.TypeNameMetaFieldDef; } }); +var validate_ts_1 = require("./validate.js"); +Object.defineProperty(exports, "validateSchema", { enumerable: true, get: function () { return validate_ts_1.validateSchema; } }); +Object.defineProperty(exports, "assertValidSchema", { enumerable: true, get: function () { return validate_ts_1.assertValidSchema; } }); +var assertName_ts_1 = require("./assertName.js"); +Object.defineProperty(exports, "assertName", { enumerable: true, get: function () { return assertName_ts_1.assertName; } }); +Object.defineProperty(exports, "assertEnumValueName", { enumerable: true, get: function () { return assertName_ts_1.assertEnumValueName; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js.map new file mode 100644 index 00000000..917985fb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/type/index.ts"],"names":[],"mappings":";;;;AASA,yCAOqB;AALnB,qGAAA,QAAQ,OAAA;AAER,yGAAA,YAAY,OAAA;AAEZ,0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AAoB,OAAA;AAItB,6CAAkE;AAAzD,6GAAA,cAAc,OAAA;AAAE,gHAAA,iBAAiB,OAAA;AAG1C,iDAAkE;AAAzD,2GAAA,UAAU,OAAA;AAAE,oHAAA,mBAAmB,OAAA","sourcesContent":["/**\n * Create and inspect GraphQL type definitions and schemas.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport type { Path as ResponsePath } from '../jsutils/Path.ts';\n\nexport {\n // Predicate\n isSchema,\n // Assertion\n assertSchema,\n // GraphQL Schema definition\n GraphQLSchema,\n} from './schema.ts';\nexport type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema.ts';\n\nexport type {\n GraphQLField,\n GraphQLArgument,\n GraphQLEnumValue,\n GraphQLInputField,\n} from './definition.ts';\nexport {\n resolveObjMapThunk,\n resolveReadonlyArrayThunk,\n // Predicates\n isType,\n isScalarType,\n isObjectType,\n isField,\n isArgument,\n isInterfaceType,\n isUnionType,\n isEnumType,\n isEnumValue,\n isInputObjectType,\n isListType,\n isNonNullType,\n isInputType,\n isInputField,\n isOutputType,\n isLeafType,\n isCompositeType,\n isAbstractType,\n isWrappingType,\n isNullableType,\n isNamedType,\n isRequiredArgument,\n isRequiredInputField,\n // Assertions\n assertType,\n assertScalarType,\n assertObjectType,\n assertField,\n assertArgument,\n assertInterfaceType,\n assertUnionType,\n assertEnumType,\n assertEnumValue,\n assertInputObjectType,\n assertInputField,\n assertListType,\n assertNonNullType,\n assertInputType,\n assertOutputType,\n assertLeafType,\n assertCompositeType,\n assertAbstractType,\n assertWrappingType,\n assertNullableType,\n assertNamedType,\n // Un-modifiers\n getNullableType,\n getNamedType,\n // Definitions\n GraphQLScalarType,\n GraphQLObjectType,\n GraphQLInterfaceType,\n GraphQLUnionType,\n GraphQLEnumType,\n GraphQLInputObjectType,\n // Type Wrappers\n GraphQLList,\n GraphQLNonNull,\n} from './definition.ts';\n\nexport type {\n GraphQLType,\n GraphQLInputType,\n GraphQLOutputType,\n GraphQLLeafType,\n GraphQLCompositeType,\n GraphQLAbstractType,\n GraphQLWrappingType,\n GraphQLNullableType,\n GraphQLNullableInputType,\n GraphQLNullableOutputType,\n GraphQLNamedType,\n GraphQLNamedInputType,\n GraphQLNamedOutputType,\n ThunkReadonlyArray,\n ThunkObjMap,\n GraphQLArgumentConfig,\n GraphQLArgumentExtensions,\n GraphQLEnumTypeConfig,\n GraphQLEnumTypeExtensions,\n GraphQLEnumValueConfig,\n GraphQLEnumValueConfigMap,\n GraphQLEnumValueExtensions,\n GraphQLFieldConfig,\n GraphQLFieldConfigArgumentMap,\n GraphQLFieldConfigMap,\n GraphQLFieldExtensions,\n GraphQLFieldMap,\n GraphQLFieldResolver,\n GraphQLInputFieldConfig,\n GraphQLInputFieldConfigMap,\n GraphQLInputFieldExtensions,\n GraphQLInputFieldMap,\n GraphQLInputObjectTypeConfig,\n GraphQLInputObjectTypeExtensions,\n GraphQLInterfaceTypeConfig,\n GraphQLInterfaceTypeExtensions,\n GraphQLIsTypeOfFn,\n GraphQLObjectTypeConfig,\n GraphQLObjectTypeExtensions,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n GraphQLScalarTypeConfig,\n GraphQLScalarTypeExtensions,\n GraphQLTypeResolver,\n GraphQLUnionTypeConfig,\n GraphQLUnionTypeExtensions,\n GraphQLScalarSerializer,\n GraphQLScalarValueParser,\n GraphQLScalarLiteralParser,\n GraphQLScalarOutputValueCoercer,\n GraphQLScalarInputValueCoercer,\n GraphQLScalarInputLiteralCoercer,\n GraphQLDefaultInput,\n} from './definition.ts';\n\nexport {\n // Predicate\n isDirective,\n // Assertion\n assertDirective,\n // Directives Definition\n GraphQLDirective,\n // Built-in Directives defined by the Spec\n isSpecifiedDirective,\n specifiedDirectives,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n // Constant Deprecation Reason\n DEFAULT_DEPRECATION_REASON,\n} from './directives.ts';\n\nexport type {\n GraphQLDirectiveConfig,\n GraphQLDirectiveExtensions,\n} from './directives.ts';\n\n// Common built-in scalar instances.\nexport {\n // Predicate\n isSpecifiedScalarType,\n // Standard GraphQL Scalars\n specifiedScalarTypes,\n GraphQLInt,\n GraphQLFloat,\n GraphQLString,\n GraphQLBoolean,\n GraphQLID,\n // Int boundaries constants\n GRAPHQL_MAX_INT,\n GRAPHQL_MIN_INT,\n} from './scalars.ts';\n\nexport {\n // Predicate\n isIntrospectionType,\n // GraphQL Types for introspection.\n introspectionTypes,\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n // \"Enum\" of Type Kinds\n TypeKind,\n // Meta-field definitions.\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n} from './introspection.ts';\n\n// Validate GraphQL schema.\nexport { validateSchema, assertValidSchema } from './validate.ts';\n\n// Upholds the spec rules about naming.\nexport { assertName, assertEnumValueName } from './assertName.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs new file mode 100644 index 00000000..f92af07b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs @@ -0,0 +1,8 @@ +export { isSchema, assertSchema, GraphQLSchema, } from "./schema.mjs"; +export { resolveObjMapThunk, resolveReadonlyArrayThunk, isType, isScalarType, isObjectType, isField, isArgument, isInterfaceType, isUnionType, isEnumType, isEnumValue, isInputObjectType, isListType, isNonNullType, isInputType, isInputField, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, assertType, assertScalarType, assertObjectType, assertField, assertArgument, assertInterfaceType, assertUnionType, assertEnumType, assertEnumValue, assertInputObjectType, assertInputField, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, getNullableType, getNamedType, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, } from "./definition.mjs"; +export { isDirective, assertDirective, GraphQLDirective, isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeferDirective, GraphQLStreamDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective, DEFAULT_DEPRECATION_REASON, } from "./directives.mjs"; +export { isSpecifiedScalarType, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, } from "./scalars.mjs"; +export { isIntrospectionType, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, TypeKind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from "./introspection.mjs"; +export { validateSchema, assertValidSchema } from "./validate.mjs"; +export { assertName, assertEnumValueName } from "./assertName.mjs"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs.map new file mode 100644 index 00000000..122837e5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/type/index.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,QAAQ,EAER,YAAY,EAEZ,aAAa,GACd,qBAAoB;AASrB,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EAEzB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,UAAU,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;AAGlE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,yBAAwB","sourcesContent":["/**\n * Create and inspect GraphQL type definitions and schemas.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport type { Path as ResponsePath } from '../jsutils/Path.ts';\n\nexport {\n // Predicate\n isSchema,\n // Assertion\n assertSchema,\n // GraphQL Schema definition\n GraphQLSchema,\n} from './schema.ts';\nexport type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema.ts';\n\nexport type {\n GraphQLField,\n GraphQLArgument,\n GraphQLEnumValue,\n GraphQLInputField,\n} from './definition.ts';\nexport {\n resolveObjMapThunk,\n resolveReadonlyArrayThunk,\n // Predicates\n isType,\n isScalarType,\n isObjectType,\n isField,\n isArgument,\n isInterfaceType,\n isUnionType,\n isEnumType,\n isEnumValue,\n isInputObjectType,\n isListType,\n isNonNullType,\n isInputType,\n isInputField,\n isOutputType,\n isLeafType,\n isCompositeType,\n isAbstractType,\n isWrappingType,\n isNullableType,\n isNamedType,\n isRequiredArgument,\n isRequiredInputField,\n // Assertions\n assertType,\n assertScalarType,\n assertObjectType,\n assertField,\n assertArgument,\n assertInterfaceType,\n assertUnionType,\n assertEnumType,\n assertEnumValue,\n assertInputObjectType,\n assertInputField,\n assertListType,\n assertNonNullType,\n assertInputType,\n assertOutputType,\n assertLeafType,\n assertCompositeType,\n assertAbstractType,\n assertWrappingType,\n assertNullableType,\n assertNamedType,\n // Un-modifiers\n getNullableType,\n getNamedType,\n // Definitions\n GraphQLScalarType,\n GraphQLObjectType,\n GraphQLInterfaceType,\n GraphQLUnionType,\n GraphQLEnumType,\n GraphQLInputObjectType,\n // Type Wrappers\n GraphQLList,\n GraphQLNonNull,\n} from './definition.ts';\n\nexport type {\n GraphQLType,\n GraphQLInputType,\n GraphQLOutputType,\n GraphQLLeafType,\n GraphQLCompositeType,\n GraphQLAbstractType,\n GraphQLWrappingType,\n GraphQLNullableType,\n GraphQLNullableInputType,\n GraphQLNullableOutputType,\n GraphQLNamedType,\n GraphQLNamedInputType,\n GraphQLNamedOutputType,\n ThunkReadonlyArray,\n ThunkObjMap,\n GraphQLArgumentConfig,\n GraphQLArgumentExtensions,\n GraphQLEnumTypeConfig,\n GraphQLEnumTypeExtensions,\n GraphQLEnumValueConfig,\n GraphQLEnumValueConfigMap,\n GraphQLEnumValueExtensions,\n GraphQLFieldConfig,\n GraphQLFieldConfigArgumentMap,\n GraphQLFieldConfigMap,\n GraphQLFieldExtensions,\n GraphQLFieldMap,\n GraphQLFieldResolver,\n GraphQLInputFieldConfig,\n GraphQLInputFieldConfigMap,\n GraphQLInputFieldExtensions,\n GraphQLInputFieldMap,\n GraphQLInputObjectTypeConfig,\n GraphQLInputObjectTypeExtensions,\n GraphQLInterfaceTypeConfig,\n GraphQLInterfaceTypeExtensions,\n GraphQLIsTypeOfFn,\n GraphQLObjectTypeConfig,\n GraphQLObjectTypeExtensions,\n GraphQLResolveInfo,\n GraphQLResolveInfoHelpers,\n GraphQLScalarTypeConfig,\n GraphQLScalarTypeExtensions,\n GraphQLTypeResolver,\n GraphQLUnionTypeConfig,\n GraphQLUnionTypeExtensions,\n GraphQLScalarSerializer,\n GraphQLScalarValueParser,\n GraphQLScalarLiteralParser,\n GraphQLScalarOutputValueCoercer,\n GraphQLScalarInputValueCoercer,\n GraphQLScalarInputLiteralCoercer,\n GraphQLDefaultInput,\n} from './definition.ts';\n\nexport {\n // Predicate\n isDirective,\n // Assertion\n assertDirective,\n // Directives Definition\n GraphQLDirective,\n // Built-in Directives defined by the Spec\n isSpecifiedDirective,\n specifiedDirectives,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n // Constant Deprecation Reason\n DEFAULT_DEPRECATION_REASON,\n} from './directives.ts';\n\nexport type {\n GraphQLDirectiveConfig,\n GraphQLDirectiveExtensions,\n} from './directives.ts';\n\n// Common built-in scalar instances.\nexport {\n // Predicate\n isSpecifiedScalarType,\n // Standard GraphQL Scalars\n specifiedScalarTypes,\n GraphQLInt,\n GraphQLFloat,\n GraphQLString,\n GraphQLBoolean,\n GraphQLID,\n // Int boundaries constants\n GRAPHQL_MAX_INT,\n GRAPHQL_MIN_INT,\n} from './scalars.ts';\n\nexport {\n // Predicate\n isIntrospectionType,\n // GraphQL Types for introspection.\n introspectionTypes,\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n // \"Enum\" of Type Kinds\n TypeKind,\n // Meta-field definitions.\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n} from './introspection.ts';\n\n// Validate GraphQL schema.\nexport { validateSchema, assertValidSchema } from './validate.ts';\n\n// Upholds the spec rules about naming.\nexport { assertName, assertEnumValueName } from './assertName.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.mts new file mode 100644 index 00000000..3741a27e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.mts @@ -0,0 +1,62 @@ +/** @category Introspection */ +import type { GraphQLNamedType } from "./definition.mjs"; +import { GraphQLEnumType, GraphQLField, GraphQLObjectType } from "./definition.mjs"; +/** The introspection type describing a GraphQL schema. */ +export declare const __Schema: GraphQLObjectType; +/** The introspection type describing a GraphQL directive. */ +export declare const __Directive: GraphQLObjectType; +/** The introspection enum describing directive locations. */ +export declare const __DirectiveLocation: GraphQLEnumType; +/** The introspection type describing GraphQL types. */ +export declare const __Type: GraphQLObjectType; +/** The introspection type describing object and interface fields. */ +export declare const __Field: GraphQLObjectType; +/** The introspection type describing arguments and input fields. */ +export declare const __InputValue: GraphQLObjectType; +/** The introspection type describing enum values. */ +export declare const __EnumValue: GraphQLObjectType; +/** + * The introspection enum describing the different kinds of GraphQL types. + * @category Introspection + */ +export declare const TypeKind: { + readonly SCALAR: "SCALAR"; + readonly OBJECT: "OBJECT"; + readonly INTERFACE: "INTERFACE"; + readonly UNION: "UNION"; + readonly ENUM: "ENUM"; + readonly INPUT_OBJECT: "INPUT_OBJECT"; + readonly LIST: "LIST"; + readonly NON_NULL: "NON_NULL"; +}; +/** + * The introspection enum describing the different kinds of GraphQL types. + * @category Introspection + */ +export type TypeKind = (typeof TypeKind)[keyof typeof TypeKind]; +/** The introspection enum describing GraphQL type kinds. */ +export declare const __TypeKind: GraphQLEnumType; +/** + * Note that these are GraphQLField and not GraphQLFieldConfig, + * so the format for args is different. + */ +export declare const SchemaMetaFieldDef: GraphQLField; +/** The `__type` meta field definition used by introspection. */ +export declare const TypeMetaFieldDef: GraphQLField; +/** The `__typename` meta field definition used by execution and introspection. */ +export declare const TypeNameMetaFieldDef: GraphQLField; +/** All introspection types defined by the GraphQL specification. */ +export declare const introspectionTypes: ReadonlyArray; +/** + * Returns true when the type is one of the built-in introspection types. + * @param type - The GraphQL type to inspect. + * @returns True when the type is one of the built-in introspection types. + * @example + * ```ts + * import { GraphQLString, isIntrospectionType, __Type } from 'graphql/type'; + * + * isIntrospectionType(__Type); // => true + * isIntrospectionType(GraphQLString); // => false + * ``` + */ +export declare function isIntrospectionType(type: GraphQLNamedType): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.ts new file mode 100644 index 00000000..a7504849 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.d.ts @@ -0,0 +1,62 @@ +/** @category Introspection */ +import type { GraphQLNamedType } from "./definition.js"; +import { GraphQLEnumType, GraphQLField, GraphQLObjectType } from "./definition.js"; +/** The introspection type describing a GraphQL schema. */ +export declare const __Schema: GraphQLObjectType; +/** The introspection type describing a GraphQL directive. */ +export declare const __Directive: GraphQLObjectType; +/** The introspection enum describing directive locations. */ +export declare const __DirectiveLocation: GraphQLEnumType; +/** The introspection type describing GraphQL types. */ +export declare const __Type: GraphQLObjectType; +/** The introspection type describing object and interface fields. */ +export declare const __Field: GraphQLObjectType; +/** The introspection type describing arguments and input fields. */ +export declare const __InputValue: GraphQLObjectType; +/** The introspection type describing enum values. */ +export declare const __EnumValue: GraphQLObjectType; +/** + * The introspection enum describing the different kinds of GraphQL types. + * @category Introspection + */ +export declare const TypeKind: { + readonly SCALAR: "SCALAR"; + readonly OBJECT: "OBJECT"; + readonly INTERFACE: "INTERFACE"; + readonly UNION: "UNION"; + readonly ENUM: "ENUM"; + readonly INPUT_OBJECT: "INPUT_OBJECT"; + readonly LIST: "LIST"; + readonly NON_NULL: "NON_NULL"; +}; +/** + * The introspection enum describing the different kinds of GraphQL types. + * @category Introspection + */ +export type TypeKind = (typeof TypeKind)[keyof typeof TypeKind]; +/** The introspection enum describing GraphQL type kinds. */ +export declare const __TypeKind: GraphQLEnumType; +/** + * Note that these are GraphQLField and not GraphQLFieldConfig, + * so the format for args is different. + */ +export declare const SchemaMetaFieldDef: GraphQLField; +/** The `__type` meta field definition used by introspection. */ +export declare const TypeMetaFieldDef: GraphQLField; +/** The `__typename` meta field definition used by execution and introspection. */ +export declare const TypeNameMetaFieldDef: GraphQLField; +/** All introspection types defined by the GraphQL specification. */ +export declare const introspectionTypes: ReadonlyArray; +/** + * Returns true when the type is one of the built-in introspection types. + * @param type - The GraphQL type to inspect. + * @returns True when the type is one of the built-in introspection types. + * @example + * ```ts + * import { GraphQLString, isIntrospectionType, __Type } from 'graphql/type'; + * + * isIntrospectionType(__Type); // => true + * isIntrospectionType(GraphQLString); // => false + * ``` + */ +export declare function isIntrospectionType(type: GraphQLNamedType): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js new file mode 100644 index 00000000..c15d809b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js @@ -0,0 +1,496 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.introspectionTypes = exports.TypeNameMetaFieldDef = exports.TypeMetaFieldDef = exports.SchemaMetaFieldDef = exports.__TypeKind = exports.TypeKind = exports.__EnumValue = exports.__InputValue = exports.__Field = exports.__Type = exports.__DirectiveLocation = exports.__Directive = exports.__Schema = void 0; +exports.isIntrospectionType = isIntrospectionType; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const directiveLocation_ts_1 = require("../language/directiveLocation.js"); +const printer_ts_1 = require("../language/printer.js"); +const getDefaultValueAST_ts_1 = require("../utilities/getDefaultValueAST.js"); +const definition_ts_1 = require("./definition.js"); +const scalars_ts_1 = require("./scalars.js"); +exports.__Schema = new definition_ts_1.GraphQLObjectType({ + name: '__Schema', + description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + fields: () => ({ + description: { + type: scalars_ts_1.GraphQLString, + resolve: (schema) => schema.description, + }, + types: { + description: 'A list of all types supported by this server.', + type: new definition_ts_1.GraphQLNonNull(new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__Type))), + resolve(schema) { + return Object.values(schema.getTypeMap()); + }, + }, + queryType: { + description: 'The type that query operations will be rooted at.', + type: new definition_ts_1.GraphQLNonNull(exports.__Type), + resolve: (schema) => schema.getQueryType(), + }, + mutationType: { + description: 'If this server supports mutation, the type that mutation operations will be rooted at.', + type: exports.__Type, + resolve: (schema) => schema.getMutationType(), + }, + subscriptionType: { + description: 'If this server support subscription, the type that subscription operations will be rooted at.', + type: exports.__Type, + resolve: (schema) => schema.getSubscriptionType(), + }, + directives: { + description: 'A list of all directives supported by this server.', + type: new definition_ts_1.GraphQLNonNull(new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__Directive))), + args: { + includeDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + default: { value: false }, + }, + }, + resolve: (schema, { includeDeprecated }) => includeDeprecated === true + ? schema.getDirectives() + : schema + .getDirectives() + .filter((directive) => directive.deprecationReason == null), + }, + }), +}); +exports.__Directive = new definition_ts_1.GraphQLObjectType({ + name: '__Directive', + description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + fields: () => ({ + name: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString), + resolve: (directive) => directive.name, + }, + description: { + type: scalars_ts_1.GraphQLString, + resolve: (directive) => directive.description, + }, + isRepeatable: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + resolve: (directive) => directive.isRepeatable, + }, + locations: { + type: new definition_ts_1.GraphQLNonNull(new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__DirectiveLocation))), + resolve: (directive) => directive.locations, + }, + args: { + type: new definition_ts_1.GraphQLNonNull(new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__InputValue))), + args: { + includeDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(field, { includeDeprecated }) { + return includeDeprecated === true + ? field.args + : field.args.filter((arg) => arg.deprecationReason == null); + }, + }, + isDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + resolve: (directive) => directive.deprecationReason != null, + }, + deprecationReason: { + type: scalars_ts_1.GraphQLString, + resolve: (directive) => directive.deprecationReason, + }, + }), +}); +exports.__DirectiveLocation = new definition_ts_1.GraphQLEnumType({ + name: '__DirectiveLocation', + description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + values: { + QUERY: { + value: directiveLocation_ts_1.DirectiveLocation.QUERY, + description: 'Location adjacent to a query operation.', + }, + MUTATION: { + value: directiveLocation_ts_1.DirectiveLocation.MUTATION, + description: 'Location adjacent to a mutation operation.', + }, + SUBSCRIPTION: { + value: directiveLocation_ts_1.DirectiveLocation.SUBSCRIPTION, + description: 'Location adjacent to a subscription operation.', + }, + FIELD: { + value: directiveLocation_ts_1.DirectiveLocation.FIELD, + description: 'Location adjacent to a field.', + }, + FRAGMENT_DEFINITION: { + value: directiveLocation_ts_1.DirectiveLocation.FRAGMENT_DEFINITION, + description: 'Location adjacent to a fragment definition.', + }, + FRAGMENT_SPREAD: { + value: directiveLocation_ts_1.DirectiveLocation.FRAGMENT_SPREAD, + description: 'Location adjacent to a fragment spread.', + }, + INLINE_FRAGMENT: { + value: directiveLocation_ts_1.DirectiveLocation.INLINE_FRAGMENT, + description: 'Location adjacent to an inline fragment.', + }, + VARIABLE_DEFINITION: { + value: directiveLocation_ts_1.DirectiveLocation.VARIABLE_DEFINITION, + description: 'Location adjacent to an operation variable definition.', + }, + FRAGMENT_VARIABLE_DEFINITION: { + value: directiveLocation_ts_1.DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION, + description: 'Location adjacent to a fragment variable definition.', + }, + SCHEMA: { + value: directiveLocation_ts_1.DirectiveLocation.SCHEMA, + description: 'Location adjacent to a schema definition.', + }, + SCALAR: { + value: directiveLocation_ts_1.DirectiveLocation.SCALAR, + description: 'Location adjacent to a scalar definition.', + }, + OBJECT: { + value: directiveLocation_ts_1.DirectiveLocation.OBJECT, + description: 'Location adjacent to an object type definition.', + }, + FIELD_DEFINITION: { + value: directiveLocation_ts_1.DirectiveLocation.FIELD_DEFINITION, + description: 'Location adjacent to a field definition.', + }, + ARGUMENT_DEFINITION: { + value: directiveLocation_ts_1.DirectiveLocation.ARGUMENT_DEFINITION, + description: 'Location adjacent to an argument definition.', + }, + INTERFACE: { + value: directiveLocation_ts_1.DirectiveLocation.INTERFACE, + description: 'Location adjacent to an interface definition.', + }, + UNION: { + value: directiveLocation_ts_1.DirectiveLocation.UNION, + description: 'Location adjacent to a union definition.', + }, + ENUM: { + value: directiveLocation_ts_1.DirectiveLocation.ENUM, + description: 'Location adjacent to an enum definition.', + }, + ENUM_VALUE: { + value: directiveLocation_ts_1.DirectiveLocation.ENUM_VALUE, + description: 'Location adjacent to an enum value definition.', + }, + INPUT_OBJECT: { + value: directiveLocation_ts_1.DirectiveLocation.INPUT_OBJECT, + description: 'Location adjacent to an input object type definition.', + }, + INPUT_FIELD_DEFINITION: { + value: directiveLocation_ts_1.DirectiveLocation.INPUT_FIELD_DEFINITION, + description: 'Location adjacent to an input object field definition.', + }, + DIRECTIVE_DEFINITION: { + value: directiveLocation_ts_1.DirectiveLocation.DIRECTIVE_DEFINITION, + description: 'Location adjacent to a directive definition.', + }, + }, +}); +exports.__Type = new definition_ts_1.GraphQLObjectType({ + name: '__Type', + description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + fields: () => ({ + kind: { + type: new definition_ts_1.GraphQLNonNull(exports.__TypeKind), + resolve(type) { + if ((0, definition_ts_1.isScalarType)(type)) { + return exports.TypeKind.SCALAR; + } + if ((0, definition_ts_1.isObjectType)(type)) { + return exports.TypeKind.OBJECT; + } + if ((0, definition_ts_1.isInterfaceType)(type)) { + return exports.TypeKind.INTERFACE; + } + if ((0, definition_ts_1.isUnionType)(type)) { + return exports.TypeKind.UNION; + } + if ((0, definition_ts_1.isEnumType)(type)) { + return exports.TypeKind.ENUM; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + return exports.TypeKind.INPUT_OBJECT; + } + if ((0, definition_ts_1.isListType)(type)) { + return exports.TypeKind.LIST; + } + if ((0, definition_ts_1.isNonNullType)(type)) { + return exports.TypeKind.NON_NULL; + } + (0, invariant_ts_1.invariant)(false, `Unexpected type: "${(0, inspect_ts_1.inspect)(type)}".`); + }, + }, + name: { + type: scalars_ts_1.GraphQLString, + resolve: (type) => ('name' in type ? type.name : undefined), + }, + description: { + type: scalars_ts_1.GraphQLString, + resolve: (type) => 'description' in type ? type.description : undefined, + }, + specifiedByURL: { + type: scalars_ts_1.GraphQLString, + resolve: (obj) => 'specifiedByURL' in obj ? obj.specifiedByURL : undefined, + }, + fields: { + type: new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__Field)), + args: { + includeDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(type, { includeDeprecated }) { + if ((0, definition_ts_1.isObjectType)(type) || (0, definition_ts_1.isInterfaceType)(type)) { + const fields = Object.values(type.getFields()); + return includeDeprecated === true + ? fields + : fields.filter((field) => field.deprecationReason == null); + } + }, + }, + interfaces: { + type: new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__Type)), + resolve(type) { + if ((0, definition_ts_1.isObjectType)(type) || (0, definition_ts_1.isInterfaceType)(type)) { + return type.getInterfaces(); + } + }, + }, + possibleTypes: { + type: new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__Type)), + resolve(type, _args, _context, { schema }) { + if ((0, definition_ts_1.isAbstractType)(type)) { + return schema.getPossibleTypes(type); + } + }, + }, + enumValues: { + type: new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__EnumValue)), + args: { + includeDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(type, { includeDeprecated }) { + if ((0, definition_ts_1.isEnumType)(type)) { + const values = type.getValues(); + return includeDeprecated === true + ? values + : values.filter((field) => field.deprecationReason == null); + } + }, + }, + inputFields: { + type: new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__InputValue)), + args: { + includeDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(type, { includeDeprecated }) { + if ((0, definition_ts_1.isInputObjectType)(type)) { + const values = Object.values(type.getFields()); + return includeDeprecated === true + ? values + : values.filter((field) => field.deprecationReason == null); + } + }, + }, + ofType: { + type: exports.__Type, + resolve: (type) => ('ofType' in type ? type.ofType : undefined), + }, + isOneOf: { + type: scalars_ts_1.GraphQLBoolean, + resolve: (type) => { + if ((0, definition_ts_1.isInputObjectType)(type)) { + return type.isOneOf; + } + }, + }, + }), +}); +exports.__Field = new definition_ts_1.GraphQLObjectType({ + name: '__Field', + description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + fields: () => ({ + name: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString), + resolve: (field) => field.name, + }, + description: { + type: scalars_ts_1.GraphQLString, + resolve: (field) => field.description, + }, + args: { + type: new definition_ts_1.GraphQLNonNull(new definition_ts_1.GraphQLList(new definition_ts_1.GraphQLNonNull(exports.__InputValue))), + args: { + includeDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(field, { includeDeprecated }) { + return includeDeprecated === true + ? field.args + : field.args.filter((arg) => arg.deprecationReason == null); + }, + }, + type: { + type: new definition_ts_1.GraphQLNonNull(exports.__Type), + resolve: (field) => field.type, + }, + isDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + resolve: (field) => field.deprecationReason != null, + }, + deprecationReason: { + type: scalars_ts_1.GraphQLString, + resolve: (field) => field.deprecationReason, + }, + }), +}); +exports.__InputValue = new definition_ts_1.GraphQLObjectType({ + name: '__InputValue', + description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + fields: () => ({ + name: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString), + resolve: (inputValue) => inputValue.name, + }, + description: { + type: scalars_ts_1.GraphQLString, + resolve: (inputValue) => inputValue.description, + }, + type: { + type: new definition_ts_1.GraphQLNonNull(exports.__Type), + resolve: (inputValue) => inputValue.type, + }, + defaultValue: { + type: scalars_ts_1.GraphQLString, + description: 'A GraphQL-formatted string representing the default value for this input value.', + resolve(inputValue) { + const ast = (0, getDefaultValueAST_ts_1.getDefaultValueAST)(inputValue); + if (ast) { + return (0, printer_ts_1.print)(ast); + } + return null; + }, + }, + isDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + resolve: (field) => field.deprecationReason != null, + }, + deprecationReason: { + type: scalars_ts_1.GraphQLString, + resolve: (obj) => obj.deprecationReason, + }, + }), +}); +exports.__EnumValue = new definition_ts_1.GraphQLObjectType({ + name: '__EnumValue', + description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + fields: () => ({ + name: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString), + resolve: (enumValue) => enumValue.name, + }, + description: { + type: scalars_ts_1.GraphQLString, + resolve: (enumValue) => enumValue.description, + }, + isDeprecated: { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLBoolean), + resolve: (enumValue) => enumValue.deprecationReason != null, + }, + deprecationReason: { + type: scalars_ts_1.GraphQLString, + resolve: (enumValue) => enumValue.deprecationReason, + }, + }), +}); +exports.TypeKind = { + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + INPUT_OBJECT: 'INPUT_OBJECT', + LIST: 'LIST', + NON_NULL: 'NON_NULL', +}; +exports.__TypeKind = new definition_ts_1.GraphQLEnumType({ + name: '__TypeKind', + description: 'An enum describing what kind of type a given `__Type` is.', + values: { + SCALAR: { + value: exports.TypeKind.SCALAR, + description: 'Indicates this type is a scalar.', + }, + OBJECT: { + value: exports.TypeKind.OBJECT, + description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.', + }, + INTERFACE: { + value: exports.TypeKind.INTERFACE, + description: 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.', + }, + UNION: { + value: exports.TypeKind.UNION, + description: 'Indicates this type is a union. `possibleTypes` is a valid field.', + }, + ENUM: { + value: exports.TypeKind.ENUM, + description: 'Indicates this type is an enum. `enumValues` is a valid field.', + }, + INPUT_OBJECT: { + value: exports.TypeKind.INPUT_OBJECT, + description: 'Indicates this type is an input object. `inputFields` is a valid field.', + }, + LIST: { + value: exports.TypeKind.LIST, + description: 'Indicates this type is a list. `ofType` is a valid field.', + }, + NON_NULL: { + value: exports.TypeKind.NON_NULL, + description: 'Indicates this type is a non-null. `ofType` is a valid field.', + }, + }, +}); +exports.SchemaMetaFieldDef = new definition_ts_1.GraphQLField(undefined, '__schema', { + type: new definition_ts_1.GraphQLNonNull(exports.__Schema), + description: 'Access the current type schema of this server.', + resolve: (_source, _args, _context, { schema }) => schema, +}); +exports.TypeMetaFieldDef = new definition_ts_1.GraphQLField(undefined, '__type', { + type: exports.__Type, + description: 'Request the type information of a single type.', + args: { name: { type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString) } }, + resolve: (_source, { name }, _context, { schema }) => schema.getType(name), +}); +exports.TypeNameMetaFieldDef = new definition_ts_1.GraphQLField(undefined, '__typename', { + type: new definition_ts_1.GraphQLNonNull(scalars_ts_1.GraphQLString), + description: 'The name of the current Object type at runtime.', + resolve: (_source, _args, _context, { parentType }) => parentType.name, +}); +exports.introspectionTypes = Object.freeze([ + exports.__Schema, + exports.__Directive, + exports.__DirectiveLocation, + exports.__Type, + exports.__Field, + exports.__InputValue, + exports.__EnumValue, + exports.__TypeKind, +]); +function isIntrospectionType(type) { + return exports.introspectionTypes.some(({ name }) => type.name === name); +} +//# sourceMappingURL=introspection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js.map new file mode 100644 index 00000000..fdb91de7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../../src/type/introspection.ts"],"names":[],"mappings":";;;AAkmBA,kDAEC;AAlmBD,sDAAgD;AAChD,0DAAoD;AAEpD,2EAAqE;AACrE,uDAA+C;AAE/C,8EAAwE;AASxE,mDAeyB;AAEzB,6CAA6D;AAIhD,QAAA,QAAQ,GAAsB,IAAI,iCAAiB,CAAC;IAC/D,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,2MAA2M;IAC7M,MAAM,EAAE,GAAG,EAAE,CACX,CAAC;QACC,WAAW,EAAE;YACX,IAAI,EAAE,0BAAa;YACnB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW;SACxC;QACD,KAAK,EAAE;YACL,WAAW,EAAE,+CAA+C;YAC5D,IAAI,EAAE,IAAI,8BAAc,CAAC,IAAI,2BAAW,CAAC,IAAI,8BAAc,CAAC,cAAM,CAAC,CAAC,CAAC;YACrE,OAAO,CAAC,MAAM;gBACZ,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YAC5C,CAAC;SACF;QACD,SAAS,EAAE;YACT,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,IAAI,8BAAc,CAAC,cAAM,CAAC;YAChC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE;SAC3C;QACD,YAAY,EAAE;YACZ,WAAW,EACT,wFAAwF;YAC1F,IAAI,EAAE,cAAM;YACZ,OAAO,EAAE,CAAC,MAAM,E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AK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM;CAC1D,CAAC,CAAC;AAGQ,QAAA,gBAAgB,GAC3B,IAAI,4BAAY,CAAmB,SAAS,EAAE,QAAQ,EAAE;IACtD,IAAI,EAAE,cAAM;IACZ,WAAW,EAAE,gDAAgD;IAC7D,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,8BAAc,CAAC,0BAAa,CAAC,EAAE,EAAE;IAC3D,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;CAC3E,CAAC,CAAC;AAGQ,QAAA,oBAAoB,GAC/B,IAAI,4BAAY,CAAmB,SAAS,EAAE,YAAY,EAAE;IAC1D,IAAI,EAAE,IAAI,8BAAc,CAAC,0BAAa,CAAC;IACvC,WAAW,EAAE,iDAAiD;IAC9D,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI;CACvE,CAAC,CAAC;AAGQ,QAAA,kBAAkB,GAC7B,MAAM,CAAC,MAAM,CAAC;IACZ,gBAAQ;IACR,mBAAW;IACX,2BAAmB;IACnB,cAAM;IACN,eAAO;IACP,oBAAY;IACZ,mBAAW;IACX,kBAAU;CACX,CAAC,CAAC;AAcL,SAAgB,mBAAmB,CAAC,IAAsB;IACxD,OAAO,0BAAkB,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACnE,CAAC","sourcesContent":["/** @category Introspection */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\n\nimport { DirectiveLocation } from '../language/directiveLocation.ts';\nimport { print } from '../language/printer.ts';\n\nimport { getDefaultValueAST } from '../utilities/getDefaultValueAST.ts';\n\nimport type {\n GraphQLEnumValue,\n GraphQLFieldConfigMap,\n GraphQLInputField,\n GraphQLNamedType,\n GraphQLType,\n} from './definition.ts';\nimport {\n GraphQLEnumType,\n GraphQLField,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n isAbstractType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from './definition.ts';\nimport type { GraphQLDirective } from './directives.ts';\nimport { GraphQLBoolean, GraphQLString } from './scalars.ts';\nimport type { GraphQLSchema } from './schema.ts';\n\n/** The introspection type describing a GraphQL schema. */\nexport const __Schema: GraphQLObjectType = new GraphQLObjectType({\n name: '__Schema',\n description:\n 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',\n fields: () =>\n ({\n description: {\n type: GraphQLString,\n resolve: (schema) => schema.description,\n },\n types: {\n description: 'A list of all types supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),\n resolve(schema) {\n return Object.values(schema.getTypeMap());\n },\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: new GraphQLNonNull(__Type),\n resolve: (schema) => schema.getQueryType(),\n },\n mutationType: {\n description:\n 'If this server supports mutation, the type that mutation operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getMutationType(),\n },\n subscriptionType: {\n description:\n 'If this server support subscription, the type that subscription operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getSubscriptionType(),\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__Directive)),\n ),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve: (schema, { includeDeprecated }) =>\n includeDeprecated === true\n ? schema.getDirectives()\n : schema\n .getDirectives()\n .filter((directive) => directive.deprecationReason == null),\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection type describing a GraphQL directive. */\nexport const __Directive: GraphQLObjectType = new GraphQLObjectType({\n name: '__Directive',\n description:\n \"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.\",\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (directive) => directive.name,\n },\n description: {\n type: GraphQLString,\n resolve: (directive) => directive.description,\n },\n isRepeatable: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (directive) => directive.isRepeatable,\n },\n locations: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__DirectiveLocation)),\n ),\n resolve: (directive) => directive.locations,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(field, { includeDeprecated }) {\n return includeDeprecated === true\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (directive) => directive.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (directive) => directive.deprecationReason,\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection enum describing directive locations. */\nexport const __DirectiveLocation: GraphQLEnumType = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description:\n 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.',\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.',\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.',\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.',\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.',\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.',\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.',\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to an operation variable definition.',\n },\n FRAGMENT_VARIABLE_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION,\n description: 'Location adjacent to a fragment variable definition.',\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.',\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.',\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.',\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.',\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.',\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.',\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.',\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.',\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.',\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.',\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.',\n },\n DIRECTIVE_DEFINITION: {\n value: DirectiveLocation.DIRECTIVE_DEFINITION,\n description: 'Location adjacent to a directive definition.',\n },\n },\n});\n\n/** The introspection type describing GraphQL types. */\nexport const __Type: GraphQLObjectType = new GraphQLObjectType({\n name: '__Type',\n description:\n 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.',\n fields: () =>\n ({\n kind: {\n type: new GraphQLNonNull(__TypeKind),\n resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n }\n if (isObjectType(type)) {\n return TypeKind.OBJECT;\n }\n if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n }\n if (isUnionType(type)) {\n return TypeKind.UNION;\n }\n if (isEnumType(type)) {\n return TypeKind.ENUM;\n }\n if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n }\n if (isListType(type)) {\n return TypeKind.LIST;\n }\n if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered)\n invariant(false, `Unexpected type: \"${inspect(type)}\".`);\n },\n },\n name: {\n type: GraphQLString,\n resolve: (type) => ('name' in type ? type.name : undefined),\n },\n description: {\n type: GraphQLString,\n resolve: (type) =>\n // FIXME: add test case\n /* node:coverage ignore next */\n 'description' in type ? type.description : undefined,\n },\n specifiedByURL: {\n type: GraphQLString,\n resolve: (obj) =>\n 'specifiedByURL' in obj ? obj.specifiedByURL : undefined,\n },\n fields: {\n type: new GraphQLList(new GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(type, { includeDeprecated }) {\n if (isObjectType(type) || isInterfaceType(type)) {\n const fields = Object.values(type.getFields());\n return includeDeprecated === true\n ? fields\n : fields.filter((field) => field.deprecationReason == null);\n }\n },\n },\n interfaces: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve(type) {\n if (isObjectType(type) || isInterfaceType(type)) {\n return type.getInterfaces();\n }\n },\n },\n possibleTypes: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve(type, _args, _context, { schema }) {\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n },\n },\n enumValues: {\n type: new GraphQLList(new GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(type, { includeDeprecated }) {\n if (isEnumType(type)) {\n const values = type.getValues();\n return includeDeprecated === true\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n inputFields: {\n type: new GraphQLList(new GraphQLNonNull(__InputValue)),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(type, { includeDeprecated }) {\n if (isInputObjectType(type)) {\n const values = Object.values(type.getFields());\n return includeDeprecated === true\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n ofType: {\n type: __Type,\n resolve: (type) => ('ofType' in type ? type.ofType : undefined),\n },\n isOneOf: {\n type: GraphQLBoolean,\n resolve: (type) => {\n if (isInputObjectType(type)) {\n return type.isOneOf;\n }\n },\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection type describing object and interface fields. */\nexport const __Field: GraphQLObjectType = new GraphQLObjectType({\n name: '__Field',\n description:\n 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.',\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (field) => field.name,\n },\n description: {\n type: GraphQLString,\n resolve: (field) => field.description,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(field, { includeDeprecated }) {\n return includeDeprecated === true\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (field) => field.type,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (field) => field.deprecationReason,\n },\n }) as GraphQLFieldConfigMap, unknown>,\n});\n\n/** The introspection type describing arguments and input fields. */\nexport const __InputValue: GraphQLObjectType = new GraphQLObjectType({\n name: '__InputValue',\n description:\n 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.',\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (inputValue) => inputValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (inputValue) => inputValue.description,\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (inputValue) => inputValue.type,\n },\n defaultValue: {\n type: GraphQLString,\n description:\n 'A GraphQL-formatted string representing the default value for this input value.',\n resolve(inputValue) {\n const ast = getDefaultValueAST(inputValue);\n if (ast) {\n return print(ast);\n }\n return null;\n },\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (obj) => obj.deprecationReason,\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection type describing enum values. */\nexport const __EnumValue: GraphQLObjectType = new GraphQLObjectType({\n name: '__EnumValue',\n description:\n 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.',\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (enumValue) => enumValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.description,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (enumValue) => enumValue.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.deprecationReason,\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/**\n * The introspection enum describing the different kinds of GraphQL types.\n * @category Introspection\n */\nexport const TypeKind = {\n SCALAR: 'SCALAR' as const,\n OBJECT: 'OBJECT' as const,\n INTERFACE: 'INTERFACE' as const,\n UNION: 'UNION' as const,\n ENUM: 'ENUM' as const,\n INPUT_OBJECT: 'INPUT_OBJECT' as const,\n LIST: 'LIST' as const,\n NON_NULL: 'NON_NULL' as const,\n} as const;\n\n/**\n * The introspection enum describing the different kinds of GraphQL types.\n * @category Introspection\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TypeKind = (typeof TypeKind)[keyof typeof TypeKind];\n\n/** The introspection enum describing GraphQL type kinds. */\nexport const __TypeKind: GraphQLEnumType = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.',\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description:\n 'Indicates this type is an object. `fields` and `interfaces` are valid fields.',\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description:\n 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.',\n },\n UNION: {\n value: TypeKind.UNION,\n description:\n 'Indicates this type is a union. `possibleTypes` is a valid field.',\n },\n ENUM: {\n value: TypeKind.ENUM,\n description:\n 'Indicates this type is an enum. `enumValues` is a valid field.',\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description:\n 'Indicates this type is an input object. `inputFields` is a valid field.',\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.',\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description:\n 'Indicates this type is a non-null. `ofType` is a valid field.',\n },\n },\n});\n\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\nexport const SchemaMetaFieldDef: GraphQLField =\n new GraphQLField(undefined, '__schema', {\n type: new GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n resolve: (_source, _args, _context, { schema }) => schema,\n });\n\n/** The `__type` meta field definition used by introspection. */\nexport const TypeMetaFieldDef: GraphQLField =\n new GraphQLField(undefined, '__type', {\n type: __Type,\n description: 'Request the type information of a single type.',\n args: { name: { type: new GraphQLNonNull(GraphQLString) } },\n resolve: (_source, { name }, _context, { schema }) => schema.getType(name),\n });\n\n/** The `__typename` meta field definition used by execution and introspection. */\nexport const TypeNameMetaFieldDef: GraphQLField =\n new GraphQLField(undefined, '__typename', {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n resolve: (_source, _args, _context, { parentType }) => parentType.name,\n });\n\n/** All introspection types defined by the GraphQL specification. */\nexport const introspectionTypes: ReadonlyArray =\n Object.freeze([\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n ]);\n\n/**\n * Returns true when the type is one of the built-in introspection types.\n * @param type - The GraphQL type to inspect.\n * @returns True when the type is one of the built-in introspection types.\n * @example\n * ```ts\n * import { GraphQLString, isIntrospectionType, __Type } from 'graphql/type';\n *\n * isIntrospectionType(__Type); // => true\n * isIntrospectionType(GraphQLString); // => false\n * ```\n */\nexport function isIntrospectionType(type: GraphQLNamedType): boolean {\n return introspectionTypes.some(({ name }) => type.name === name);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs new file mode 100644 index 00000000..c70da426 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs @@ -0,0 +1,492 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { DirectiveLocation } from "../language/directiveLocation.mjs"; +import { print } from "../language/printer.mjs"; +import { getDefaultValueAST } from "../utilities/getDefaultValueAST.mjs"; +import { GraphQLEnumType, GraphQLField, GraphQLList, GraphQLNonNull, GraphQLObjectType, isAbstractType, isEnumType, isInputObjectType, isInterfaceType, isListType, isNonNullType, isObjectType, isScalarType, isUnionType, } from "./definition.mjs"; +import { GraphQLBoolean, GraphQLString } from "./scalars.mjs"; +export const __Schema = new GraphQLObjectType({ + name: '__Schema', + description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + fields: () => ({ + description: { + type: GraphQLString, + resolve: (schema) => schema.description, + }, + types: { + description: 'A list of all types supported by this server.', + type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))), + resolve(schema) { + return Object.values(schema.getTypeMap()); + }, + }, + queryType: { + description: 'The type that query operations will be rooted at.', + type: new GraphQLNonNull(__Type), + resolve: (schema) => schema.getQueryType(), + }, + mutationType: { + description: 'If this server supports mutation, the type that mutation operations will be rooted at.', + type: __Type, + resolve: (schema) => schema.getMutationType(), + }, + subscriptionType: { + description: 'If this server support subscription, the type that subscription operations will be rooted at.', + type: __Type, + resolve: (schema) => schema.getSubscriptionType(), + }, + directives: { + description: 'A list of all directives supported by this server.', + type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))), + args: { + includeDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + default: { value: false }, + }, + }, + resolve: (schema, { includeDeprecated }) => includeDeprecated === true + ? schema.getDirectives() + : schema + .getDirectives() + .filter((directive) => directive.deprecationReason == null), + }, + }), +}); +export const __Directive = new GraphQLObjectType({ + name: '__Directive', + description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + fields: () => ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (directive) => directive.name, + }, + description: { + type: GraphQLString, + resolve: (directive) => directive.description, + }, + isRepeatable: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (directive) => directive.isRepeatable, + }, + locations: { + type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))), + resolve: (directive) => directive.locations, + }, + args: { + type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))), + args: { + includeDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(field, { includeDeprecated }) { + return includeDeprecated === true + ? field.args + : field.args.filter((arg) => arg.deprecationReason == null); + }, + }, + isDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (directive) => directive.deprecationReason != null, + }, + deprecationReason: { + type: GraphQLString, + resolve: (directive) => directive.deprecationReason, + }, + }), +}); +export const __DirectiveLocation = new GraphQLEnumType({ + name: '__DirectiveLocation', + description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + values: { + QUERY: { + value: DirectiveLocation.QUERY, + description: 'Location adjacent to a query operation.', + }, + MUTATION: { + value: DirectiveLocation.MUTATION, + description: 'Location adjacent to a mutation operation.', + }, + SUBSCRIPTION: { + value: DirectiveLocation.SUBSCRIPTION, + description: 'Location adjacent to a subscription operation.', + }, + FIELD: { + value: DirectiveLocation.FIELD, + description: 'Location adjacent to a field.', + }, + FRAGMENT_DEFINITION: { + value: DirectiveLocation.FRAGMENT_DEFINITION, + description: 'Location adjacent to a fragment definition.', + }, + FRAGMENT_SPREAD: { + value: DirectiveLocation.FRAGMENT_SPREAD, + description: 'Location adjacent to a fragment spread.', + }, + INLINE_FRAGMENT: { + value: DirectiveLocation.INLINE_FRAGMENT, + description: 'Location adjacent to an inline fragment.', + }, + VARIABLE_DEFINITION: { + value: DirectiveLocation.VARIABLE_DEFINITION, + description: 'Location adjacent to an operation variable definition.', + }, + FRAGMENT_VARIABLE_DEFINITION: { + value: DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION, + description: 'Location adjacent to a fragment variable definition.', + }, + SCHEMA: { + value: DirectiveLocation.SCHEMA, + description: 'Location adjacent to a schema definition.', + }, + SCALAR: { + value: DirectiveLocation.SCALAR, + description: 'Location adjacent to a scalar definition.', + }, + OBJECT: { + value: DirectiveLocation.OBJECT, + description: 'Location adjacent to an object type definition.', + }, + FIELD_DEFINITION: { + value: DirectiveLocation.FIELD_DEFINITION, + description: 'Location adjacent to a field definition.', + }, + ARGUMENT_DEFINITION: { + value: DirectiveLocation.ARGUMENT_DEFINITION, + description: 'Location adjacent to an argument definition.', + }, + INTERFACE: { + value: DirectiveLocation.INTERFACE, + description: 'Location adjacent to an interface definition.', + }, + UNION: { + value: DirectiveLocation.UNION, + description: 'Location adjacent to a union definition.', + }, + ENUM: { + value: DirectiveLocation.ENUM, + description: 'Location adjacent to an enum definition.', + }, + ENUM_VALUE: { + value: DirectiveLocation.ENUM_VALUE, + description: 'Location adjacent to an enum value definition.', + }, + INPUT_OBJECT: { + value: DirectiveLocation.INPUT_OBJECT, + description: 'Location adjacent to an input object type definition.', + }, + INPUT_FIELD_DEFINITION: { + value: DirectiveLocation.INPUT_FIELD_DEFINITION, + description: 'Location adjacent to an input object field definition.', + }, + DIRECTIVE_DEFINITION: { + value: DirectiveLocation.DIRECTIVE_DEFINITION, + description: 'Location adjacent to a directive definition.', + }, + }, +}); +export const __Type = new GraphQLObjectType({ + name: '__Type', + description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + fields: () => ({ + kind: { + type: new GraphQLNonNull(__TypeKind), + resolve(type) { + if (isScalarType(type)) { + return TypeKind.SCALAR; + } + if (isObjectType(type)) { + return TypeKind.OBJECT; + } + if (isInterfaceType(type)) { + return TypeKind.INTERFACE; + } + if (isUnionType(type)) { + return TypeKind.UNION; + } + if (isEnumType(type)) { + return TypeKind.ENUM; + } + if (isInputObjectType(type)) { + return TypeKind.INPUT_OBJECT; + } + if (isListType(type)) { + return TypeKind.LIST; + } + if (isNonNullType(type)) { + return TypeKind.NON_NULL; + } + invariant(false, `Unexpected type: "${inspect(type)}".`); + }, + }, + name: { + type: GraphQLString, + resolve: (type) => ('name' in type ? type.name : undefined), + }, + description: { + type: GraphQLString, + resolve: (type) => 'description' in type ? type.description : undefined, + }, + specifiedByURL: { + type: GraphQLString, + resolve: (obj) => 'specifiedByURL' in obj ? obj.specifiedByURL : undefined, + }, + fields: { + type: new GraphQLList(new GraphQLNonNull(__Field)), + args: { + includeDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(type, { includeDeprecated }) { + if (isObjectType(type) || isInterfaceType(type)) { + const fields = Object.values(type.getFields()); + return includeDeprecated === true + ? fields + : fields.filter((field) => field.deprecationReason == null); + } + }, + }, + interfaces: { + type: new GraphQLList(new GraphQLNonNull(__Type)), + resolve(type) { + if (isObjectType(type) || isInterfaceType(type)) { + return type.getInterfaces(); + } + }, + }, + possibleTypes: { + type: new GraphQLList(new GraphQLNonNull(__Type)), + resolve(type, _args, _context, { schema }) { + if (isAbstractType(type)) { + return schema.getPossibleTypes(type); + } + }, + }, + enumValues: { + type: new GraphQLList(new GraphQLNonNull(__EnumValue)), + args: { + includeDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(type, { includeDeprecated }) { + if (isEnumType(type)) { + const values = type.getValues(); + return includeDeprecated === true + ? values + : values.filter((field) => field.deprecationReason == null); + } + }, + }, + inputFields: { + type: new GraphQLList(new GraphQLNonNull(__InputValue)), + args: { + includeDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(type, { includeDeprecated }) { + if (isInputObjectType(type)) { + const values = Object.values(type.getFields()); + return includeDeprecated === true + ? values + : values.filter((field) => field.deprecationReason == null); + } + }, + }, + ofType: { + type: __Type, + resolve: (type) => ('ofType' in type ? type.ofType : undefined), + }, + isOneOf: { + type: GraphQLBoolean, + resolve: (type) => { + if (isInputObjectType(type)) { + return type.isOneOf; + } + }, + }, + }), +}); +export const __Field = new GraphQLObjectType({ + name: '__Field', + description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + fields: () => ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (field) => field.name, + }, + description: { + type: GraphQLString, + resolve: (field) => field.description, + }, + args: { + type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))), + args: { + includeDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + default: { value: false }, + }, + }, + resolve(field, { includeDeprecated }) { + return includeDeprecated === true + ? field.args + : field.args.filter((arg) => arg.deprecationReason == null); + }, + }, + type: { + type: new GraphQLNonNull(__Type), + resolve: (field) => field.type, + }, + isDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (field) => field.deprecationReason != null, + }, + deprecationReason: { + type: GraphQLString, + resolve: (field) => field.deprecationReason, + }, + }), +}); +export const __InputValue = new GraphQLObjectType({ + name: '__InputValue', + description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + fields: () => ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (inputValue) => inputValue.name, + }, + description: { + type: GraphQLString, + resolve: (inputValue) => inputValue.description, + }, + type: { + type: new GraphQLNonNull(__Type), + resolve: (inputValue) => inputValue.type, + }, + defaultValue: { + type: GraphQLString, + description: 'A GraphQL-formatted string representing the default value for this input value.', + resolve(inputValue) { + const ast = getDefaultValueAST(inputValue); + if (ast) { + return print(ast); + } + return null; + }, + }, + isDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (field) => field.deprecationReason != null, + }, + deprecationReason: { + type: GraphQLString, + resolve: (obj) => obj.deprecationReason, + }, + }), +}); +export const __EnumValue = new GraphQLObjectType({ + name: '__EnumValue', + description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + fields: () => ({ + name: { + type: new GraphQLNonNull(GraphQLString), + resolve: (enumValue) => enumValue.name, + }, + description: { + type: GraphQLString, + resolve: (enumValue) => enumValue.description, + }, + isDeprecated: { + type: new GraphQLNonNull(GraphQLBoolean), + resolve: (enumValue) => enumValue.deprecationReason != null, + }, + deprecationReason: { + type: GraphQLString, + resolve: (enumValue) => enumValue.deprecationReason, + }, + }), +}); +export const TypeKind = { + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + INPUT_OBJECT: 'INPUT_OBJECT', + LIST: 'LIST', + NON_NULL: 'NON_NULL', +}; +export const __TypeKind = new GraphQLEnumType({ + name: '__TypeKind', + description: 'An enum describing what kind of type a given `__Type` is.', + values: { + SCALAR: { + value: TypeKind.SCALAR, + description: 'Indicates this type is a scalar.', + }, + OBJECT: { + value: TypeKind.OBJECT, + description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.', + }, + INTERFACE: { + value: TypeKind.INTERFACE, + description: 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.', + }, + UNION: { + value: TypeKind.UNION, + description: 'Indicates this type is a union. `possibleTypes` is a valid field.', + }, + ENUM: { + value: TypeKind.ENUM, + description: 'Indicates this type is an enum. `enumValues` is a valid field.', + }, + INPUT_OBJECT: { + value: TypeKind.INPUT_OBJECT, + description: 'Indicates this type is an input object. `inputFields` is a valid field.', + }, + LIST: { + value: TypeKind.LIST, + description: 'Indicates this type is a list. `ofType` is a valid field.', + }, + NON_NULL: { + value: TypeKind.NON_NULL, + description: 'Indicates this type is a non-null. `ofType` is a valid field.', + }, + }, +}); +export const SchemaMetaFieldDef = new GraphQLField(undefined, '__schema', { + type: new GraphQLNonNull(__Schema), + description: 'Access the current type schema of this server.', + resolve: (_source, _args, _context, { schema }) => schema, +}); +export const TypeMetaFieldDef = new GraphQLField(undefined, '__type', { + type: __Type, + description: 'Request the type information of a single type.', + args: { name: { type: new GraphQLNonNull(GraphQLString) } }, + resolve: (_source, { name }, _context, { schema }) => schema.getType(name), +}); +export const TypeNameMetaFieldDef = new GraphQLField(undefined, '__typename', { + type: new GraphQLNonNull(GraphQLString), + description: 'The name of the current Object type at runtime.', + resolve: (_source, _args, _context, { parentType }) => parentType.name, +}); +export const introspectionTypes = Object.freeze([ + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, +]); +export function isIntrospectionType(type) { + return introspectionTypes.some(({ name }) => type.name === name); +} +//# sourceMappingURL=introspection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs.map new file mode 100644 index 00000000..ff6df419 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/introspection.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../../src/type/introspection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,0CAAyC;AACrE,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAE/C,OAAO,EAAE,kBAAkB,EAAE,4CAA2C;AASxE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBA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,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;CAC3E,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,oBAAoB,GAC/B,IAAI,YAAY,CAAmB,SAAS,EAAE,YAAY,EAAE;IAC1D,IAAI,EAAE,IAAI,cAAc,CAAC,aAAa,CAAC;IACvC,WAAW,EAAE,iDAAiD;IAC9D,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI;CACvE,CAAC,CAAC;AAGL,MAAM,CAAC,MAAM,kBAAkB,GAC7B,MAAM,CAAC,MAAM,CAAC;IACZ,QAAQ;IACR,WAAW;IACX,mBAAmB;IACnB,MAAM;IACN,OAAO;IACP,YAAY;IACZ,WAAW;IACX,UAAU;CACX,CAAC,CAAC;AAcL,MAAM,UAAU,mBAAmB,CAAC,IAAsB;IACxD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACnE,CAAC","sourcesContent":["/** @category Introspection */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\n\nimport { DirectiveLocation } from '../language/directiveLocation.ts';\nimport { print } from '../language/printer.ts';\n\nimport { getDefaultValueAST } from '../utilities/getDefaultValueAST.ts';\n\nimport type {\n GraphQLEnumValue,\n GraphQLFieldConfigMap,\n GraphQLInputField,\n GraphQLNamedType,\n GraphQLType,\n} from './definition.ts';\nimport {\n GraphQLEnumType,\n GraphQLField,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n isAbstractType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from './definition.ts';\nimport type { GraphQLDirective } from './directives.ts';\nimport { GraphQLBoolean, GraphQLString } from './scalars.ts';\nimport type { GraphQLSchema } from './schema.ts';\n\n/** The introspection type describing a GraphQL schema. */\nexport const __Schema: GraphQLObjectType = new GraphQLObjectType({\n name: '__Schema',\n description:\n 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',\n fields: () =>\n ({\n description: {\n type: GraphQLString,\n resolve: (schema) => schema.description,\n },\n types: {\n description: 'A list of all types supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),\n resolve(schema) {\n return Object.values(schema.getTypeMap());\n },\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: new GraphQLNonNull(__Type),\n resolve: (schema) => schema.getQueryType(),\n },\n mutationType: {\n description:\n 'If this server supports mutation, the type that mutation operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getMutationType(),\n },\n subscriptionType: {\n description:\n 'If this server support subscription, the type that subscription operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getSubscriptionType(),\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__Directive)),\n ),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve: (schema, { includeDeprecated }) =>\n includeDeprecated === true\n ? schema.getDirectives()\n : schema\n .getDirectives()\n .filter((directive) => directive.deprecationReason == null),\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection type describing a GraphQL directive. */\nexport const __Directive: GraphQLObjectType = new GraphQLObjectType({\n name: '__Directive',\n description:\n \"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.\",\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (directive) => directive.name,\n },\n description: {\n type: GraphQLString,\n resolve: (directive) => directive.description,\n },\n isRepeatable: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (directive) => directive.isRepeatable,\n },\n locations: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__DirectiveLocation)),\n ),\n resolve: (directive) => directive.locations,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(field, { includeDeprecated }) {\n return includeDeprecated === true\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (directive) => directive.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (directive) => directive.deprecationReason,\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection enum describing directive locations. */\nexport const __DirectiveLocation: GraphQLEnumType = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description:\n 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.',\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.',\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.',\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.',\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.',\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.',\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.',\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to an operation variable definition.',\n },\n FRAGMENT_VARIABLE_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION,\n description: 'Location adjacent to a fragment variable definition.',\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.',\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.',\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.',\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.',\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.',\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.',\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.',\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.',\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.',\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.',\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.',\n },\n DIRECTIVE_DEFINITION: {\n value: DirectiveLocation.DIRECTIVE_DEFINITION,\n description: 'Location adjacent to a directive definition.',\n },\n },\n});\n\n/** The introspection type describing GraphQL types. */\nexport const __Type: GraphQLObjectType = new GraphQLObjectType({\n name: '__Type',\n description:\n 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.',\n fields: () =>\n ({\n kind: {\n type: new GraphQLNonNull(__TypeKind),\n resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n }\n if (isObjectType(type)) {\n return TypeKind.OBJECT;\n }\n if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n }\n if (isUnionType(type)) {\n return TypeKind.UNION;\n }\n if (isEnumType(type)) {\n return TypeKind.ENUM;\n }\n if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n }\n if (isListType(type)) {\n return TypeKind.LIST;\n }\n if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered)\n invariant(false, `Unexpected type: \"${inspect(type)}\".`);\n },\n },\n name: {\n type: GraphQLString,\n resolve: (type) => ('name' in type ? type.name : undefined),\n },\n description: {\n type: GraphQLString,\n resolve: (type) =>\n // FIXME: add test case\n /* node:coverage ignore next */\n 'description' in type ? type.description : undefined,\n },\n specifiedByURL: {\n type: GraphQLString,\n resolve: (obj) =>\n 'specifiedByURL' in obj ? obj.specifiedByURL : undefined,\n },\n fields: {\n type: new GraphQLList(new GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(type, { includeDeprecated }) {\n if (isObjectType(type) || isInterfaceType(type)) {\n const fields = Object.values(type.getFields());\n return includeDeprecated === true\n ? fields\n : fields.filter((field) => field.deprecationReason == null);\n }\n },\n },\n interfaces: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve(type) {\n if (isObjectType(type) || isInterfaceType(type)) {\n return type.getInterfaces();\n }\n },\n },\n possibleTypes: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve(type, _args, _context, { schema }) {\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n },\n },\n enumValues: {\n type: new GraphQLList(new GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(type, { includeDeprecated }) {\n if (isEnumType(type)) {\n const values = type.getValues();\n return includeDeprecated === true\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n inputFields: {\n type: new GraphQLList(new GraphQLNonNull(__InputValue)),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(type, { includeDeprecated }) {\n if (isInputObjectType(type)) {\n const values = Object.values(type.getFields());\n return includeDeprecated === true\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n ofType: {\n type: __Type,\n resolve: (type) => ('ofType' in type ? type.ofType : undefined),\n },\n isOneOf: {\n type: GraphQLBoolean,\n resolve: (type) => {\n if (isInputObjectType(type)) {\n return type.isOneOf;\n }\n },\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection type describing object and interface fields. */\nexport const __Field: GraphQLObjectType = new GraphQLObjectType({\n name: '__Field',\n description:\n 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.',\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (field) => field.name,\n },\n description: {\n type: GraphQLString,\n resolve: (field) => field.description,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n default: { value: false },\n },\n },\n resolve(field, { includeDeprecated }) {\n return includeDeprecated === true\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (field) => field.type,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (field) => field.deprecationReason,\n },\n }) as GraphQLFieldConfigMap, unknown>,\n});\n\n/** The introspection type describing arguments and input fields. */\nexport const __InputValue: GraphQLObjectType = new GraphQLObjectType({\n name: '__InputValue',\n description:\n 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.',\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (inputValue) => inputValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (inputValue) => inputValue.description,\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (inputValue) => inputValue.type,\n },\n defaultValue: {\n type: GraphQLString,\n description:\n 'A GraphQL-formatted string representing the default value for this input value.',\n resolve(inputValue) {\n const ast = getDefaultValueAST(inputValue);\n if (ast) {\n return print(ast);\n }\n return null;\n },\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (obj) => obj.deprecationReason,\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/** The introspection type describing enum values. */\nexport const __EnumValue: GraphQLObjectType = new GraphQLObjectType({\n name: '__EnumValue',\n description:\n 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.',\n fields: () =>\n ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (enumValue) => enumValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.description,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (enumValue) => enumValue.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.deprecationReason,\n },\n }) as GraphQLFieldConfigMap,\n});\n\n/**\n * The introspection enum describing the different kinds of GraphQL types.\n * @category Introspection\n */\nexport const TypeKind = {\n SCALAR: 'SCALAR' as const,\n OBJECT: 'OBJECT' as const,\n INTERFACE: 'INTERFACE' as const,\n UNION: 'UNION' as const,\n ENUM: 'ENUM' as const,\n INPUT_OBJECT: 'INPUT_OBJECT' as const,\n LIST: 'LIST' as const,\n NON_NULL: 'NON_NULL' as const,\n} as const;\n\n/**\n * The introspection enum describing the different kinds of GraphQL types.\n * @category Introspection\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TypeKind = (typeof TypeKind)[keyof typeof TypeKind];\n\n/** The introspection enum describing GraphQL type kinds. */\nexport const __TypeKind: GraphQLEnumType = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.',\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description:\n 'Indicates this type is an object. `fields` and `interfaces` are valid fields.',\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description:\n 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.',\n },\n UNION: {\n value: TypeKind.UNION,\n description:\n 'Indicates this type is a union. `possibleTypes` is a valid field.',\n },\n ENUM: {\n value: TypeKind.ENUM,\n description:\n 'Indicates this type is an enum. `enumValues` is a valid field.',\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description:\n 'Indicates this type is an input object. `inputFields` is a valid field.',\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.',\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description:\n 'Indicates this type is a non-null. `ofType` is a valid field.',\n },\n },\n});\n\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\nexport const SchemaMetaFieldDef: GraphQLField =\n new GraphQLField(undefined, '__schema', {\n type: new GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n resolve: (_source, _args, _context, { schema }) => schema,\n });\n\n/** The `__type` meta field definition used by introspection. */\nexport const TypeMetaFieldDef: GraphQLField =\n new GraphQLField(undefined, '__type', {\n type: __Type,\n description: 'Request the type information of a single type.',\n args: { name: { type: new GraphQLNonNull(GraphQLString) } },\n resolve: (_source, { name }, _context, { schema }) => schema.getType(name),\n });\n\n/** The `__typename` meta field definition used by execution and introspection. */\nexport const TypeNameMetaFieldDef: GraphQLField =\n new GraphQLField(undefined, '__typename', {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n resolve: (_source, _args, _context, { parentType }) => parentType.name,\n });\n\n/** All introspection types defined by the GraphQL specification. */\nexport const introspectionTypes: ReadonlyArray =\n Object.freeze([\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n ]);\n\n/**\n * Returns true when the type is one of the built-in introspection types.\n * @param type - The GraphQL type to inspect.\n * @returns True when the type is one of the built-in introspection types.\n * @example\n * ```ts\n * import { GraphQLString, isIntrospectionType, __Type } from 'graphql/type';\n *\n * isIntrospectionType(__Type); // => true\n * isIntrospectionType(GraphQLString); // => false\n * ```\n */\nexport function isIntrospectionType(type: GraphQLNamedType): boolean {\n return introspectionTypes.some(({ name }) => type.name === name);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.mts new file mode 100644 index 00000000..f3a4096e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.mts @@ -0,0 +1,46 @@ +/** @category Scalars */ +import type { GraphQLNamedType } from "./definition.mjs"; +import { GraphQLScalarType } from "./definition.mjs"; +/** + * Maximum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1 + */ +export declare const GRAPHQL_MAX_INT = 2147483647; +/** + * Minimum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1) + */ +export declare const GRAPHQL_MIN_INT = -2147483648; +/** The built-in `Int` scalar type. */ +export declare const GraphQLInt: GraphQLScalarType; +/** The built-in `Float` scalar type. */ +export declare const GraphQLFloat: GraphQLScalarType; +/** The built-in `String` scalar type. */ +export declare const GraphQLString: GraphQLScalarType; +/** The built-in `Boolean` scalar type. */ +export declare const GraphQLBoolean: GraphQLScalarType; +/** The built-in `ID` scalar type. */ +export declare const GraphQLID: GraphQLScalarType; +/** All built-in scalar types defined by the GraphQL specification. */ +export declare const specifiedScalarTypes: ReadonlyArray; +/** + * Returns true when the scalar type is one of the scalars specified by GraphQL. + * @param type - The GraphQL type to inspect. + * @returns True when the scalar type is one of the scalars specified by GraphQL. + * @example + * ```ts + * import { + * GraphQLScalarType, + * GraphQLString, + * isSpecifiedScalarType, + * } from 'graphql/type'; + * + * const DateTime = new GraphQLScalarType({ + * name: 'DateTime', + * }); + * + * isSpecifiedScalarType(GraphQLString); // => true + * isSpecifiedScalarType(DateTime); // => false + * ``` + */ +export declare function isSpecifiedScalarType(type: GraphQLNamedType): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.ts new file mode 100644 index 00000000..422170d1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.d.ts @@ -0,0 +1,46 @@ +/** @category Scalars */ +import type { GraphQLNamedType } from "./definition.js"; +import { GraphQLScalarType } from "./definition.js"; +/** + * Maximum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1 + */ +export declare const GRAPHQL_MAX_INT = 2147483647; +/** + * Minimum possible Int value as per GraphQL Spec (32-bit signed integer). + * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1) + */ +export declare const GRAPHQL_MIN_INT = -2147483648; +/** The built-in `Int` scalar type. */ +export declare const GraphQLInt: GraphQLScalarType; +/** The built-in `Float` scalar type. */ +export declare const GraphQLFloat: GraphQLScalarType; +/** The built-in `String` scalar type. */ +export declare const GraphQLString: GraphQLScalarType; +/** The built-in `Boolean` scalar type. */ +export declare const GraphQLBoolean: GraphQLScalarType; +/** The built-in `ID` scalar type. */ +export declare const GraphQLID: GraphQLScalarType; +/** All built-in scalar types defined by the GraphQL specification. */ +export declare const specifiedScalarTypes: ReadonlyArray; +/** + * Returns true when the scalar type is one of the scalars specified by GraphQL. + * @param type - The GraphQL type to inspect. + * @returns True when the scalar type is one of the scalars specified by GraphQL. + * @example + * ```ts + * import { + * GraphQLScalarType, + * GraphQLString, + * isSpecifiedScalarType, + * } from 'graphql/type'; + * + * const DateTime = new GraphQLScalarType({ + * name: 'DateTime', + * }); + * + * isSpecifiedScalarType(GraphQLString); // => true + * isSpecifiedScalarType(DateTime); // => false + * ``` + */ +export declare function isSpecifiedScalarType(type: GraphQLNamedType): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js new file mode 100644 index 00000000..0006cd03 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js @@ -0,0 +1,320 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.specifiedScalarTypes = exports.GraphQLID = exports.GraphQLBoolean = exports.GraphQLString = exports.GraphQLFloat = exports.GraphQLInt = exports.GRAPHQL_MIN_INT = exports.GRAPHQL_MAX_INT = void 0; +exports.isSpecifiedScalarType = isSpecifiedScalarType; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const printer_ts_1 = require("../language/printer.js"); +const valueToLiteral_ts_1 = require("../utilities/valueToLiteral.js"); +const definition_ts_1 = require("./definition.js"); +exports.GRAPHQL_MAX_INT = 2147483647; +exports.GRAPHQL_MIN_INT = -2147483648; +exports.GraphQLInt = new definition_ts_1.GraphQLScalarType({ + name: 'Int', + description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'number') { + return coerceIntFromNumber(coercedValue); + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; + } + if (typeof coercedValue === 'string') { + return coerceIntFromString(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return coerceIntFromBigInt(coercedValue); + } + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non-integer value: ${(0, inspect_ts_1.inspect)(coercedValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue === 'number') { + return coerceIntFromNumber(inputValue); + } + if (typeof inputValue === 'bigint') { + return coerceIntFromBigInt(inputValue); + } + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non-integer value: ${(0, inspect_ts_1.inspect)(inputValue)}`); + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== kinds_ts_1.Kind.INT) { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non-integer value: ${(0, printer_ts_1.print)(valueNode)}`, { nodes: valueNode }); + } + const num = parseInt(valueNode.value, 10); + if (num > exports.GRAPHQL_MAX_INT || num < exports.GRAPHQL_MIN_INT) { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, { nodes: valueNode }); + } + return num; + }, + valueToLiteral(value) { + if (((typeof value === 'number' && Number.isInteger(value)) || + typeof value === 'bigint') && + value <= exports.GRAPHQL_MAX_INT && + value >= exports.GRAPHQL_MIN_INT) { + return { kind: kinds_ts_1.Kind.INT, value: String(value) }; + } + }, +}); +exports.GraphQLFloat = new definition_ts_1.GraphQLScalarType({ + name: 'Float', + description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'number') { + return coerceFloatFromNumber(coercedValue); + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; + } + if (typeof coercedValue === 'string') { + return coerceFloatFromString(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return coerceFloatFromBigInt(coercedValue); + } + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, inspect_ts_1.inspect)(coercedValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue === 'number') { + return coerceFloatFromNumber(inputValue); + } + if (typeof inputValue === 'bigint') { + return coerceFloatFromBigInt(inputValue); + } + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, inspect_ts_1.inspect)(inputValue)}`); + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== kinds_ts_1.Kind.FLOAT && valueNode.kind !== kinds_ts_1.Kind.INT) { + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, printer_ts_1.print)(valueNode)}`, { nodes: valueNode }); + } + return parseFloat(valueNode.value); + }, + valueToLiteral(value) { + const literal = (0, valueToLiteral_ts_1.defaultScalarValueToLiteral)(value); + if (literal.kind === kinds_ts_1.Kind.FLOAT || literal.kind === kinds_ts_1.Kind.INT) { + return literal; + } + }, +}); +exports.GraphQLString = new definition_ts_1.GraphQLScalarType({ + name: 'String', + description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'string') { + return coercedValue; + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 'true' : 'false'; + } + if (typeof coercedValue === 'number') { + return coerceStringFromNumber(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return String(coercedValue); + } + throw new GraphQLError_ts_1.GraphQLError(`String cannot represent value: ${(0, inspect_ts_1.inspect)(outputValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue !== 'string') { + throw new GraphQLError_ts_1.GraphQLError(`String cannot represent a non string value: ${(0, inspect_ts_1.inspect)(inputValue)}`); + } + return inputValue; + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== kinds_ts_1.Kind.STRING) { + throw new GraphQLError_ts_1.GraphQLError(`String cannot represent a non string value: ${(0, printer_ts_1.print)(valueNode)}`, { nodes: valueNode }); + } + return valueNode.value; + }, + valueToLiteral(value) { + const literal = (0, valueToLiteral_ts_1.defaultScalarValueToLiteral)(value); + if (literal.kind === kinds_ts_1.Kind.STRING) { + return literal; + } + }, +}); +exports.GraphQLBoolean = new definition_ts_1.GraphQLScalarType({ + name: 'Boolean', + description: 'The `Boolean` scalar type represents `true` or `false`.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'boolean') { + return coercedValue; + } + if (typeof coercedValue === 'number') { + return coerceBooleanFromNumber(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return coercedValue !== 0n; + } + throw new GraphQLError_ts_1.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, inspect_ts_1.inspect)(coercedValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue !== 'boolean') { + throw new GraphQLError_ts_1.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, inspect_ts_1.inspect)(inputValue)}`); + } + return inputValue; + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== kinds_ts_1.Kind.BOOLEAN) { + throw new GraphQLError_ts_1.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, printer_ts_1.print)(valueNode)}`, { nodes: valueNode }); + } + return valueNode.value; + }, + valueToLiteral(value) { + const literal = (0, valueToLiteral_ts_1.defaultScalarValueToLiteral)(value); + if (literal.kind === kinds_ts_1.Kind.BOOLEAN) { + return literal; + } + }, +}); +exports.GraphQLID = new definition_ts_1.GraphQLScalarType({ + name: 'ID', + description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'string') { + return coercedValue; + } + if (typeof coercedValue === 'number') { + return coerceIDFromNumber(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return String(coercedValue); + } + throw new GraphQLError_ts_1.GraphQLError(`ID cannot represent value: ${(0, inspect_ts_1.inspect)(outputValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue === 'string') { + return inputValue; + } + if (typeof inputValue === 'number') { + return coerceIDFromNumber(inputValue); + } + if (typeof inputValue === 'bigint') { + return String(inputValue); + } + throw new GraphQLError_ts_1.GraphQLError(`ID cannot represent value: ${(0, inspect_ts_1.inspect)(inputValue)}`); + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== kinds_ts_1.Kind.STRING && valueNode.kind !== kinds_ts_1.Kind.INT) { + throw new GraphQLError_ts_1.GraphQLError('ID cannot represent a non-string and non-integer value: ' + + (0, printer_ts_1.print)(valueNode), { nodes: valueNode }); + } + return valueNode.value; + }, + valueToLiteral(value) { + if (typeof value === 'string') { + return /^-?(?:0|[1-9][0-9]*)$/.test(value) + ? { kind: kinds_ts_1.Kind.INT, value } + : { kind: kinds_ts_1.Kind.STRING, value, block: false }; + } + if (typeof value === 'number') { + return { kind: kinds_ts_1.Kind.INT, value: coerceIDFromNumber(value) }; + } + if (typeof value === 'bigint') { + return { kind: kinds_ts_1.Kind.INT, value: String(value) }; + } + }, +}); +exports.specifiedScalarTypes = Object.freeze([ + exports.GraphQLString, + exports.GraphQLInt, + exports.GraphQLFloat, + exports.GraphQLBoolean, + exports.GraphQLID, +]); +function isSpecifiedScalarType(type) { + return exports.specifiedScalarTypes.some(({ name }) => type.name === name); +} +function coerceOutputValueObject(outputValue) { + if ((0, isObjectLike_ts_1.isObjectLike)(outputValue)) { + if (typeof outputValue.valueOf === 'function') { + const valueOfResult = outputValue.valueOf(); + if (!(0, isObjectLike_ts_1.isObjectLike)(valueOfResult)) { + return valueOfResult; + } + } + if (typeof outputValue.toJSON === 'function') { + return outputValue.toJSON(); + } + } + return outputValue; +} +function coerceIntFromNumber(value) { + if (!Number.isInteger(value)) { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non-integer value: ${(0, inspect_ts_1.inspect)(value)}`); + } + if (value > exports.GRAPHQL_MAX_INT || value < exports.GRAPHQL_MIN_INT) { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${(0, inspect_ts_1.inspect)(value)}`); + } + return value; +} +function coerceIntFromString(value) { + if (value === '') { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non-integer value: ${(0, inspect_ts_1.inspect)(value)}`); + } + const num = Number(value); + if (!Number.isInteger(num)) { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non-integer value: ${(0, inspect_ts_1.inspect)(value)}`); + } + if (num > exports.GRAPHQL_MAX_INT || num < exports.GRAPHQL_MIN_INT) { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${(0, inspect_ts_1.inspect)(value)}`); + } + return num; +} +function coerceIntFromBigInt(value) { + if (value > exports.GRAPHQL_MAX_INT || value < exports.GRAPHQL_MIN_INT) { + throw new GraphQLError_ts_1.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${String(value)}`); + } + return Number(value); +} +function coerceFloatFromNumber(value) { + if (!Number.isFinite(value)) { + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, inspect_ts_1.inspect)(value)}`); + } + return value; +} +function coerceFloatFromString(value) { + if (value === '') { + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, inspect_ts_1.inspect)(value)}`); + } + const num = Number(value); + if (!Number.isFinite(num)) { + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, inspect_ts_1.inspect)(value)}`); + } + return num; +} +function coerceFloatFromBigInt(coercedValue) { + const num = Number(coercedValue); + if (!Number.isFinite(num)) { + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, inspect_ts_1.inspect)(coercedValue)} (value is too large)`); + } + if (BigInt(num) !== coercedValue) { + throw new GraphQLError_ts_1.GraphQLError(`Float cannot represent non numeric value: ${(0, inspect_ts_1.inspect)(coercedValue)} (value would lose precision)`); + } + return num; +} +function coerceStringFromNumber(value) { + if (!Number.isFinite(value)) { + throw new GraphQLError_ts_1.GraphQLError(`String cannot represent value: ${(0, inspect_ts_1.inspect)(value)}`); + } + return String(value); +} +function coerceBooleanFromNumber(value) { + if (!Number.isFinite(value)) { + throw new GraphQLError_ts_1.GraphQLError(`Boolean cannot represent a non boolean value: ${(0, inspect_ts_1.inspect)(value)}`); + } + return value !== 0; +} +function coerceIDFromNumber(value) { + if (!Number.isInteger(value)) { + throw new GraphQLError_ts_1.GraphQLError(`ID cannot represent value: ${(0, inspect_ts_1.inspect)(value)}`); + } + return String(value); +} +//# sourceMappingURL=scalars.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js.map new file mode 100644 index 00000000..a6166fa3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scalars.js","sourceRoot":"","sources":["../../src/type/scalars.ts"],"names":[],"mappings":";;;AA8VA,sDAEC;AA9VD,sDAAgD;AAChD,gEAA0D;AAE1D,8DAAwD;AAExD,mDAA4C;AAC5C,uDAA+C;AAE/C,sEAA6E;AAG7E,mDAAoD;AAMvC,QAAA,eAAe,GAAG,UAAU,CAAC;AAM7B,QAAA,eAAe,G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\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport { defaultScalarValueToLiteral } from '../utilities/valueToLiteral.ts';\n\nimport type { GraphQLNamedType } from './definition.ts';\nimport { GraphQLScalarType } from './definition.ts';\n\n/**\n * Maximum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1\n */\nexport const GRAPHQL_MAX_INT = 2147483647;\n\n/**\n * Minimum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)\n */\nexport const GRAPHQL_MIN_INT = -2147483648;\n\n/** The built-in `Int` scalar type. */\nexport const GraphQLInt: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'Int',\n description:\n 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'number') {\n return coerceIntFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n if (typeof coercedValue === 'string') {\n return coerceIntFromString(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return coerceIntFromBigInt(coercedValue);\n }\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(coercedValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue === 'number') {\n return coerceIntFromNumber(inputValue);\n }\n if (typeof inputValue === 'bigint') {\n return coerceIntFromBigInt(inputValue);\n }\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(inputValue)}`,\n );\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n const num = parseInt(valueNode.value, 10);\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`,\n { nodes: valueNode },\n );\n }\n return num;\n },\n valueToLiteral(value) {\n if (\n ((typeof value === 'number' && Number.isInteger(value)) ||\n typeof value === 'bigint') &&\n value <= GRAPHQL_MAX_INT &&\n value >= GRAPHQL_MIN_INT\n ) {\n return { kind: Kind.INT, value: String(value) };\n }\n },\n });\n\n/** The built-in `Float` scalar type. */\nexport const GraphQLFloat: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'Float',\n description:\n 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'number') {\n return coerceFloatFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n if (typeof coercedValue === 'string') {\n return coerceFloatFromString(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return coerceFloatFromBigInt(coercedValue);\n }\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue === 'number') {\n return coerceFloatFromNumber(inputValue);\n }\n if (typeof inputValue === 'bigint') {\n return coerceFloatFromBigInt(inputValue);\n }\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(inputValue)}`,\n );\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n return parseFloat(valueNode.value);\n },\n valueToLiteral(value) {\n const literal = defaultScalarValueToLiteral(value);\n if (literal.kind === Kind.FLOAT || literal.kind === Kind.INT) {\n return literal;\n }\n },\n });\n\n/** The built-in `String` scalar type. */\nexport const GraphQLString: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'String',\n description:\n 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n // Coerces string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 'true' : 'false';\n }\n if (typeof coercedValue === 'number') {\n return coerceStringFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return String(coercedValue);\n }\n throw new GraphQLError(\n `String cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue !== 'string') {\n throw new GraphQLError(\n `String cannot represent a non string value: ${inspect(inputValue)}`,\n );\n }\n return inputValue;\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING) {\n throw new GraphQLError(\n `String cannot represent a non string value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n return valueNode.value;\n },\n valueToLiteral(value) {\n const literal = defaultScalarValueToLiteral(value);\n if (literal.kind === Kind.STRING) {\n return literal;\n }\n },\n });\n\n/** The built-in `Boolean` scalar type. */\nexport const GraphQLBoolean: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue;\n }\n if (typeof coercedValue === 'number') {\n return coerceBooleanFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return coercedValue !== 0n;\n }\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue !== 'boolean') {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(inputValue)}`,\n );\n }\n return inputValue;\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.BOOLEAN) {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n return valueNode.value;\n },\n valueToLiteral(value) {\n const literal = defaultScalarValueToLiteral(value);\n if (literal.kind === Kind.BOOLEAN) {\n return literal;\n }\n },\n });\n\n/** The built-in `ID` scalar type. */\nexport const GraphQLID: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'ID',\n description:\n 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n if (typeof coercedValue === 'number') {\n return coerceIDFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return String(coercedValue);\n }\n throw new GraphQLError(\n `ID cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue === 'string') {\n return inputValue;\n }\n if (typeof inputValue === 'number') {\n return coerceIDFromNumber(inputValue);\n }\n if (typeof inputValue === 'bigint') {\n return String(inputValue);\n }\n throw new GraphQLError(\n `ID cannot represent value: ${inspect(inputValue)}`,\n );\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n 'ID cannot represent a non-string and non-integer value: ' +\n print(valueNode),\n { nodes: valueNode },\n );\n }\n return valueNode.value;\n },\n valueToLiteral(value) {\n // ID types can use number values and Int literals.\n if (typeof value === 'string') {\n // Will parse as an IntValue.\n return /^-?(?:0|[1-9][0-9]*)$/.test(value)\n ? { kind: Kind.INT, value }\n : { kind: Kind.STRING, value, block: false };\n }\n if (typeof value === 'number') {\n return { kind: Kind.INT, value: coerceIDFromNumber(value) };\n }\n if (typeof value === 'bigint') {\n return { kind: Kind.INT, value: String(value) };\n }\n },\n });\n\n/** All built-in scalar types defined by the GraphQL specification. */\nexport const specifiedScalarTypes: ReadonlyArray =\n Object.freeze([\n GraphQLString,\n GraphQLInt,\n GraphQLFloat,\n GraphQLBoolean,\n GraphQLID,\n ]);\n\n/**\n * Returns true when the scalar type is one of the scalars specified by GraphQL.\n * @param type - The GraphQL type to inspect.\n * @returns True when the scalar type is one of the scalars specified by GraphQL.\n * @example\n * ```ts\n * import {\n * GraphQLScalarType,\n * GraphQLString,\n * isSpecifiedScalarType,\n * } from 'graphql/type';\n *\n * const DateTime = new GraphQLScalarType({\n * name: 'DateTime',\n * });\n *\n * isSpecifiedScalarType(GraphQLString); // => true\n * isSpecifiedScalarType(DateTime); // => false\n * ```\n */\nexport function isSpecifiedScalarType(type: GraphQLNamedType): boolean {\n return specifiedScalarTypes.some(({ name }) => type.name === name);\n}\n\n// Support coercing objects with custom valueOf() or toJSON() functions -\n// a common way to represent a complex value which can be represented as\n// a string (ex: MongoDB id objects).\nfunction coerceOutputValueObject(outputValue: unknown): unknown {\n if (isObjectLike(outputValue)) {\n if (typeof outputValue.valueOf === 'function') {\n const valueOfResult = outputValue.valueOf();\n if (!isObjectLike(valueOfResult)) {\n return valueOfResult;\n }\n }\n if (typeof outputValue.toJSON === 'function') {\n return outputValue.toJSON();\n }\n }\n return outputValue;\n}\n\nfunction coerceIntFromNumber(value: number): number {\n if (!Number.isInteger(value)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(value)}`,\n );\n }\n if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`,\n );\n }\n return value;\n}\n\nfunction coerceIntFromString(value: string): number {\n if (value === '') {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(value)}`,\n );\n }\n const num = Number(value);\n if (!Number.isInteger(num)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(value)}`,\n );\n }\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`,\n );\n }\n return num;\n}\n\nfunction coerceIntFromBigInt(value: bigint): number {\n if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${String(value)}`,\n );\n }\n return Number(value);\n}\n\nfunction coerceFloatFromNumber(value: number): number {\n if (!Number.isFinite(value)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(value)}`,\n );\n }\n return value;\n}\n\nfunction coerceFloatFromString(value: string): number {\n if (value === '') {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(value)}`,\n );\n }\n const num = Number(value);\n if (!Number.isFinite(num)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(value)}`,\n );\n }\n return num;\n}\n\nfunction coerceFloatFromBigInt(coercedValue: bigint): number {\n const num = Number(coercedValue);\n if (!Number.isFinite(num)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)} (value is too large)`,\n );\n }\n if (BigInt(num) !== coercedValue) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)} (value would lose precision)`,\n );\n }\n return num;\n}\n\nfunction coerceStringFromNumber(value: number): string {\n if (!Number.isFinite(value)) {\n throw new GraphQLError(`String cannot represent value: ${inspect(value)}`);\n }\n return String(value);\n}\n\nfunction coerceBooleanFromNumber(value: number): boolean {\n if (!Number.isFinite(value)) {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(value)}`,\n );\n }\n return value !== 0;\n}\n\nfunction coerceIDFromNumber(value: number): string {\n if (!Number.isInteger(value)) {\n throw new GraphQLError(`ID cannot represent value: ${inspect(value)}`);\n }\n return String(value);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs new file mode 100644 index 00000000..827377cd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs @@ -0,0 +1,316 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { print } from "../language/printer.mjs"; +import { defaultScalarValueToLiteral } from "../utilities/valueToLiteral.mjs"; +import { GraphQLScalarType } from "./definition.mjs"; +export const GRAPHQL_MAX_INT = 2147483647; +export const GRAPHQL_MIN_INT = -2147483648; +export const GraphQLInt = new GraphQLScalarType({ + name: 'Int', + description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'number') { + return coerceIntFromNumber(coercedValue); + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; + } + if (typeof coercedValue === 'string') { + return coerceIntFromString(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return coerceIntFromBigInt(coercedValue); + } + throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(coercedValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue === 'number') { + return coerceIntFromNumber(inputValue); + } + if (typeof inputValue === 'bigint') { + return coerceIntFromBigInt(inputValue); + } + throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(inputValue)}`); + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== Kind.INT) { + throw new GraphQLError(`Int cannot represent non-integer value: ${print(valueNode)}`, { nodes: valueNode }); + } + const num = parseInt(valueNode.value, 10); + if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { + throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, { nodes: valueNode }); + } + return num; + }, + valueToLiteral(value) { + if (((typeof value === 'number' && Number.isInteger(value)) || + typeof value === 'bigint') && + value <= GRAPHQL_MAX_INT && + value >= GRAPHQL_MIN_INT) { + return { kind: Kind.INT, value: String(value) }; + } + }, +}); +export const GraphQLFloat = new GraphQLScalarType({ + name: 'Float', + description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'number') { + return coerceFloatFromNumber(coercedValue); + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 1 : 0; + } + if (typeof coercedValue === 'string') { + return coerceFloatFromString(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return coerceFloatFromBigInt(coercedValue); + } + throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(coercedValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue === 'number') { + return coerceFloatFromNumber(inputValue); + } + if (typeof inputValue === 'bigint') { + return coerceFloatFromBigInt(inputValue); + } + throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(inputValue)}`); + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) { + throw new GraphQLError(`Float cannot represent non numeric value: ${print(valueNode)}`, { nodes: valueNode }); + } + return parseFloat(valueNode.value); + }, + valueToLiteral(value) { + const literal = defaultScalarValueToLiteral(value); + if (literal.kind === Kind.FLOAT || literal.kind === Kind.INT) { + return literal; + } + }, +}); +export const GraphQLString = new GraphQLScalarType({ + name: 'String', + description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'string') { + return coercedValue; + } + if (typeof coercedValue === 'boolean') { + return coercedValue ? 'true' : 'false'; + } + if (typeof coercedValue === 'number') { + return coerceStringFromNumber(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return String(coercedValue); + } + throw new GraphQLError(`String cannot represent value: ${inspect(outputValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue !== 'string') { + throw new GraphQLError(`String cannot represent a non string value: ${inspect(inputValue)}`); + } + return inputValue; + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== Kind.STRING) { + throw new GraphQLError(`String cannot represent a non string value: ${print(valueNode)}`, { nodes: valueNode }); + } + return valueNode.value; + }, + valueToLiteral(value) { + const literal = defaultScalarValueToLiteral(value); + if (literal.kind === Kind.STRING) { + return literal; + } + }, +}); +export const GraphQLBoolean = new GraphQLScalarType({ + name: 'Boolean', + description: 'The `Boolean` scalar type represents `true` or `false`.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'boolean') { + return coercedValue; + } + if (typeof coercedValue === 'number') { + return coerceBooleanFromNumber(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return coercedValue !== 0n; + } + throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue !== 'boolean') { + throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(inputValue)}`); + } + return inputValue; + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== Kind.BOOLEAN) { + throw new GraphQLError(`Boolean cannot represent a non boolean value: ${print(valueNode)}`, { nodes: valueNode }); + } + return valueNode.value; + }, + valueToLiteral(value) { + const literal = defaultScalarValueToLiteral(value); + if (literal.kind === Kind.BOOLEAN) { + return literal; + } + }, +}); +export const GraphQLID = new GraphQLScalarType({ + name: 'ID', + description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + coerceOutputValue(outputValue) { + const coercedValue = coerceOutputValueObject(outputValue); + if (typeof coercedValue === 'string') { + return coercedValue; + } + if (typeof coercedValue === 'number') { + return coerceIDFromNumber(coercedValue); + } + if (typeof coercedValue === 'bigint') { + return String(coercedValue); + } + throw new GraphQLError(`ID cannot represent value: ${inspect(outputValue)}`); + }, + coerceInputValue(inputValue) { + if (typeof inputValue === 'string') { + return inputValue; + } + if (typeof inputValue === 'number') { + return coerceIDFromNumber(inputValue); + } + if (typeof inputValue === 'bigint') { + return String(inputValue); + } + throw new GraphQLError(`ID cannot represent value: ${inspect(inputValue)}`); + }, + coerceInputLiteral(valueNode) { + if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) { + throw new GraphQLError('ID cannot represent a non-string and non-integer value: ' + + print(valueNode), { nodes: valueNode }); + } + return valueNode.value; + }, + valueToLiteral(value) { + if (typeof value === 'string') { + return /^-?(?:0|[1-9][0-9]*)$/.test(value) + ? { kind: Kind.INT, value } + : { kind: Kind.STRING, value, block: false }; + } + if (typeof value === 'number') { + return { kind: Kind.INT, value: coerceIDFromNumber(value) }; + } + if (typeof value === 'bigint') { + return { kind: Kind.INT, value: String(value) }; + } + }, +}); +export const specifiedScalarTypes = Object.freeze([ + GraphQLString, + GraphQLInt, + GraphQLFloat, + GraphQLBoolean, + GraphQLID, +]); +export function isSpecifiedScalarType(type) { + return specifiedScalarTypes.some(({ name }) => type.name === name); +} +function coerceOutputValueObject(outputValue) { + if (isObjectLike(outputValue)) { + if (typeof outputValue.valueOf === 'function') { + const valueOfResult = outputValue.valueOf(); + if (!isObjectLike(valueOfResult)) { + return valueOfResult; + } + } + if (typeof outputValue.toJSON === 'function') { + return outputValue.toJSON(); + } + } + return outputValue; +} +function coerceIntFromNumber(value) { + if (!Number.isInteger(value)) { + throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(value)}`); + } + if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) { + throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${inspect(value)}`); + } + return value; +} +function coerceIntFromString(value) { + if (value === '') { + throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(value)}`); + } + const num = Number(value); + if (!Number.isInteger(num)) { + throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(value)}`); + } + if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { + throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${inspect(value)}`); + } + return num; +} +function coerceIntFromBigInt(value) { + if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) { + throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${String(value)}`); + } + return Number(value); +} +function coerceFloatFromNumber(value) { + if (!Number.isFinite(value)) { + throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(value)}`); + } + return value; +} +function coerceFloatFromString(value) { + if (value === '') { + throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(value)}`); + } + const num = Number(value); + if (!Number.isFinite(num)) { + throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(value)}`); + } + return num; +} +function coerceFloatFromBigInt(coercedValue) { + const num = Number(coercedValue); + if (!Number.isFinite(num)) { + throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(coercedValue)} (value is too large)`); + } + if (BigInt(num) !== coercedValue) { + throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(coercedValue)} (value would lose precision)`); + } + return num; +} +function coerceStringFromNumber(value) { + if (!Number.isFinite(value)) { + throw new GraphQLError(`String cannot represent value: ${inspect(value)}`); + } + return String(value); +} +function coerceBooleanFromNumber(value) { + if (!Number.isFinite(value)) { + throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(value)}`); + } + return value !== 0; +} +function coerceIDFromNumber(value) { + if (!Number.isInteger(value)) { + throw new GraphQLError(`ID cannot represent value: ${inspect(value)}`); + } + return String(value); +} +//# sourceMappingURL=scalars.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs.map new file mode 100644 index 00000000..b1f48e93 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/scalars.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scalars.js","sourceRoot":"","sources":["../../src/type/scalars.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAE1D,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAExD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAC5C,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAE/C,OAAO,EAAE,2BAA2B,EAAE,wCAAuC;AAG7E,OAAO,EAAE,iBAAiB,EAAE,yBAAwB;AAMpD,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAM1C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAU,CAAC;AAG3C,MAAM,CAAC,MAAM,UAAU,GACrB,IAAI,iBAAiB,CAAS;IAC5B,IAAI,EAAE,KAAK;IACX,WAAW,EACT,qIAAqI;IAEvI,iBAAiB,CAAC,WAAW;QAC3B,MAAM,YAAY,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;QAE1D,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,OAAO,YAAY,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,mBAAmB,CAAC,YAAY,CAAC,CAAC;QA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C,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,YAAY,CACpB,iDAAiD,OAAO,CAAC,KAAK,CAAC,EAAE,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,KAAK,CAAC,CAAC;AACrB,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,YAAY,CAAC,8BAA8B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["/** @category Scalars */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport { defaultScalarValueToLiteral } from '../utilities/valueToLiteral.ts';\n\nimport type { GraphQLNamedType } from './definition.ts';\nimport { GraphQLScalarType } from './definition.ts';\n\n/**\n * Maximum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1\n */\nexport const GRAPHQL_MAX_INT = 2147483647;\n\n/**\n * Minimum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)\n */\nexport const GRAPHQL_MIN_INT = -2147483648;\n\n/** The built-in `Int` scalar type. */\nexport const GraphQLInt: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'Int',\n description:\n 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'number') {\n return coerceIntFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n if (typeof coercedValue === 'string') {\n return coerceIntFromString(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return coerceIntFromBigInt(coercedValue);\n }\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(coercedValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue === 'number') {\n return coerceIntFromNumber(inputValue);\n }\n if (typeof inputValue === 'bigint') {\n return coerceIntFromBigInt(inputValue);\n }\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(inputValue)}`,\n );\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n const num = parseInt(valueNode.value, 10);\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`,\n { nodes: valueNode },\n );\n }\n return num;\n },\n valueToLiteral(value) {\n if (\n ((typeof value === 'number' && Number.isInteger(value)) ||\n typeof value === 'bigint') &&\n value <= GRAPHQL_MAX_INT &&\n value >= GRAPHQL_MIN_INT\n ) {\n return { kind: Kind.INT, value: String(value) };\n }\n },\n });\n\n/** The built-in `Float` scalar type. */\nexport const GraphQLFloat: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'Float',\n description:\n 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'number') {\n return coerceFloatFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n if (typeof coercedValue === 'string') {\n return coerceFloatFromString(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return coerceFloatFromBigInt(coercedValue);\n }\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue === 'number') {\n return coerceFloatFromNumber(inputValue);\n }\n if (typeof inputValue === 'bigint') {\n return coerceFloatFromBigInt(inputValue);\n }\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(inputValue)}`,\n );\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n return parseFloat(valueNode.value);\n },\n valueToLiteral(value) {\n const literal = defaultScalarValueToLiteral(value);\n if (literal.kind === Kind.FLOAT || literal.kind === Kind.INT) {\n return literal;\n }\n },\n });\n\n/** The built-in `String` scalar type. */\nexport const GraphQLString: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'String',\n description:\n 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n // Coerces string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 'true' : 'false';\n }\n if (typeof coercedValue === 'number') {\n return coerceStringFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return String(coercedValue);\n }\n throw new GraphQLError(\n `String cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue !== 'string') {\n throw new GraphQLError(\n `String cannot represent a non string value: ${inspect(inputValue)}`,\n );\n }\n return inputValue;\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING) {\n throw new GraphQLError(\n `String cannot represent a non string value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n return valueNode.value;\n },\n valueToLiteral(value) {\n const literal = defaultScalarValueToLiteral(value);\n if (literal.kind === Kind.STRING) {\n return literal;\n }\n },\n });\n\n/** The built-in `Boolean` scalar type. */\nexport const GraphQLBoolean: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue;\n }\n if (typeof coercedValue === 'number') {\n return coerceBooleanFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return coercedValue !== 0n;\n }\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue !== 'boolean') {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(inputValue)}`,\n );\n }\n return inputValue;\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.BOOLEAN) {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${print(valueNode)}`,\n { nodes: valueNode },\n );\n }\n return valueNode.value;\n },\n valueToLiteral(value) {\n const literal = defaultScalarValueToLiteral(value);\n if (literal.kind === Kind.BOOLEAN) {\n return literal;\n }\n },\n });\n\n/** The built-in `ID` scalar type. */\nexport const GraphQLID: GraphQLScalarType =\n new GraphQLScalarType({\n name: 'ID',\n description:\n 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.',\n\n coerceOutputValue(outputValue) {\n const coercedValue = coerceOutputValueObject(outputValue);\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n if (typeof coercedValue === 'number') {\n return coerceIDFromNumber(coercedValue);\n }\n if (typeof coercedValue === 'bigint') {\n return String(coercedValue);\n }\n throw new GraphQLError(\n `ID cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n coerceInputValue(inputValue) {\n if (typeof inputValue === 'string') {\n return inputValue;\n }\n if (typeof inputValue === 'number') {\n return coerceIDFromNumber(inputValue);\n }\n if (typeof inputValue === 'bigint') {\n return String(inputValue);\n }\n throw new GraphQLError(\n `ID cannot represent value: ${inspect(inputValue)}`,\n );\n },\n\n coerceInputLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n 'ID cannot represent a non-string and non-integer value: ' +\n print(valueNode),\n { nodes: valueNode },\n );\n }\n return valueNode.value;\n },\n valueToLiteral(value) {\n // ID types can use number values and Int literals.\n if (typeof value === 'string') {\n // Will parse as an IntValue.\n return /^-?(?:0|[1-9][0-9]*)$/.test(value)\n ? { kind: Kind.INT, value }\n : { kind: Kind.STRING, value, block: false };\n }\n if (typeof value === 'number') {\n return { kind: Kind.INT, value: coerceIDFromNumber(value) };\n }\n if (typeof value === 'bigint') {\n return { kind: Kind.INT, value: String(value) };\n }\n },\n });\n\n/** All built-in scalar types defined by the GraphQL specification. */\nexport const specifiedScalarTypes: ReadonlyArray =\n Object.freeze([\n GraphQLString,\n GraphQLInt,\n GraphQLFloat,\n GraphQLBoolean,\n GraphQLID,\n ]);\n\n/**\n * Returns true when the scalar type is one of the scalars specified by GraphQL.\n * @param type - The GraphQL type to inspect.\n * @returns True when the scalar type is one of the scalars specified by GraphQL.\n * @example\n * ```ts\n * import {\n * GraphQLScalarType,\n * GraphQLString,\n * isSpecifiedScalarType,\n * } from 'graphql/type';\n *\n * const DateTime = new GraphQLScalarType({\n * name: 'DateTime',\n * });\n *\n * isSpecifiedScalarType(GraphQLString); // => true\n * isSpecifiedScalarType(DateTime); // => false\n * ```\n */\nexport function isSpecifiedScalarType(type: GraphQLNamedType): boolean {\n return specifiedScalarTypes.some(({ name }) => type.name === name);\n}\n\n// Support coercing objects with custom valueOf() or toJSON() functions -\n// a common way to represent a complex value which can be represented as\n// a string (ex: MongoDB id objects).\nfunction coerceOutputValueObject(outputValue: unknown): unknown {\n if (isObjectLike(outputValue)) {\n if (typeof outputValue.valueOf === 'function') {\n const valueOfResult = outputValue.valueOf();\n if (!isObjectLike(valueOfResult)) {\n return valueOfResult;\n }\n }\n if (typeof outputValue.toJSON === 'function') {\n return outputValue.toJSON();\n }\n }\n return outputValue;\n}\n\nfunction coerceIntFromNumber(value: number): number {\n if (!Number.isInteger(value)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(value)}`,\n );\n }\n if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`,\n );\n }\n return value;\n}\n\nfunction coerceIntFromString(value: string): number {\n if (value === '') {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(value)}`,\n );\n }\n const num = Number(value);\n if (!Number.isInteger(num)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(value)}`,\n );\n }\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`,\n );\n }\n return num;\n}\n\nfunction coerceIntFromBigInt(value: bigint): number {\n if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${String(value)}`,\n );\n }\n return Number(value);\n}\n\nfunction coerceFloatFromNumber(value: number): number {\n if (!Number.isFinite(value)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(value)}`,\n );\n }\n return value;\n}\n\nfunction coerceFloatFromString(value: string): number {\n if (value === '') {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(value)}`,\n );\n }\n const num = Number(value);\n if (!Number.isFinite(num)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(value)}`,\n );\n }\n return num;\n}\n\nfunction coerceFloatFromBigInt(coercedValue: bigint): number {\n const num = Number(coercedValue);\n if (!Number.isFinite(num)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)} (value is too large)`,\n );\n }\n if (BigInt(num) !== coercedValue) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)} (value would lose precision)`,\n );\n }\n return num;\n}\n\nfunction coerceStringFromNumber(value: number): string {\n if (!Number.isFinite(value)) {\n throw new GraphQLError(`String cannot represent value: ${inspect(value)}`);\n }\n return String(value);\n}\n\nfunction coerceBooleanFromNumber(value: number): boolean {\n if (!Number.isFinite(value)) {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(value)}`,\n );\n }\n return value !== 0;\n}\n\nfunction coerceIDFromNumber(value: number): string {\n if (!Number.isInteger(value)) {\n throw new GraphQLError(`ID cannot represent value: ${inspect(value)}`);\n }\n return String(value);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.mts new file mode 100644 index 00000000..63094236 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.mts @@ -0,0 +1,644 @@ +/** @category Schema */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { GraphQLError } from "../error/GraphQLError.mjs"; +import type { SchemaDefinitionNode, SchemaExtensionNode } from "../language/ast.mjs"; +import { OperationTypeNode } from "../language/ast.mjs"; +import type { GraphQLAbstractType, GraphQLCompositeType, GraphQLField, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType } from "./definition.mjs"; +import type { GraphQLDirective } from "./directives.mjs"; +/** + * Test if the given value is a GraphQL schema. + * @param schema - Value to inspect. + * @returns True when the value is a GraphQLSchema. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLString, isSchema } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * isSchema(schema); // => true + * isSchema(GraphQLString); // => false + * ``` + */ +export declare function isSchema(schema: unknown): schema is GraphQLSchema; +/** + * Returns the value as a GraphQLSchema, or throws if it is not a schema. + * @param schema - GraphQL schema to use. + * @returns The value typed as a GraphQLSchema. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertSchema, GraphQLString } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * assertSchema(schema); // => schema + * assertSchema(GraphQLString); // throws an error + * ``` + */ +export declare function assertSchema(schema: unknown): GraphQLSchema; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLSchemaExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Schema Definition + * + * A Schema is created by supplying the root types of each type of operation, + * query and mutation (optional). A schema definition is then supplied to the + * validator and executor. + * @example + * ```ts + * const MyAppQueryRootType = new GraphQLObjectType({ + * name: 'Query', + * fields: { + * greeting: { type: GraphQLString }, + * }, + * }); + * + * const MyAppMutationRootType = new GraphQLObjectType({ + * name: 'Mutation', + * fields: { + * setGreeting: { type: GraphQLString }, + * }, + * }); + * + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * mutation: MyAppMutationRootType, + * }); + * ``` + * @example + * When the schema is constructed, by default only the types that are reachable + * by traversing the root types are included, other types must be explicitly + * referenced. + * + * ```ts + * const characterInterface = new GraphQLInterfaceType({ + * name: 'Character', + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const humanType = new GraphQLObjectType({ + * name: 'Human', + * interfaces: [characterInterface], + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const droidType = new GraphQLObjectType({ + * name: 'Droid', + * interfaces: [characterInterface], + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * hero: { type: characterInterface }, + * }, + * }), + * // Since this schema references only the `Character` interface it's + * // necessary to explicitly list the types that implement it if + * // you want them to be included in the final schema. + * types: [humanType, droidType], + * }); + * ``` + * @example + * If an array of `directives` are provided to GraphQLSchema, that will be the + * exact list of directives represented and allowed. If `directives` is not + * provided then a default set of the specified directives (e.g. `@include` and + * `@skip`) will be used. If you wish to provide *additional* directives to + * these specified directives, you must explicitly declare them. + * + * ```ts + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * directives: specifiedDirectives.concat([myCustomDirective]), + * }); + * ``` + */ +export declare class GraphQLSchema { + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** Whether this schema instance skips validation checks. */ + assumeValid: boolean; + private _queryType; + private _mutationType; + private _subscriptionType; + private _directives; + private _typeMap; + private _subTypeMap; + private _implementationsMap; + /** + * Creates a GraphQLSchema instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * // Create a schema with the required query root. + * import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ + * name: 'Query', + * fields: { + * greeting: { + * type: GraphQLString, + * resolve: () => 'Hello', + * }, + * }, + * }); + * + * const schema = new GraphQLSchema({ + * description: 'The application schema.', + * query: Query, + * }); + * + * schema.getQueryType(); // => Query + * schema.description; // => 'The application schema.' + * ``` + * @example + * ```ts + * // This variant configures every schema option, including directives and extensions. + * import { DirectiveLocation, parse } from 'graphql/language'; + * import { + * GraphQLBoolean, + * GraphQLDirective, + * GraphQLObjectType, + * GraphQLSchema, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ + * name: 'Query', + * fields: { greeting: { type: GraphQLString } }, + * }); + * const Mutation = new GraphQLObjectType({ + * name: 'Mutation', + * fields: { setGreeting: { type: GraphQLString } }, + * }); + * const Subscription = new GraphQLObjectType({ + * name: 'Subscription', + * fields: { greetingChanged: { type: GraphQLString } }, + * }); + * const AuditEvent = new GraphQLObjectType({ + * name: 'AuditEvent', + * fields: { message: { type: GraphQLString } }, + * }); + * const authDirective = new GraphQLDirective({ + * name: 'auth', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { required: { type: GraphQLBoolean } }, + * }); + * const schemaDocument = parse(` + * schema { + * query: Query + * mutation: Mutation + * subscription: Subscription + * } + * + * extend schema @auth + * `); + * + * const schema = new GraphQLSchema({ + * description: 'Operations exposed by the application.', + * query: Query, + * mutation: Mutation, + * subscription: Subscription, + * types: [AuditEvent], + * directives: [authDirective], + * extensions: { owner: 'platform' }, + * astNode: schemaDocument.definitions[0], + * extensionASTNodes: [schemaDocument.definitions[1]], + * assumeValid: true, + * }); + * + * schema.getMutationType(); // => Mutation + * schema.getSubscriptionType(); // => Subscription + * schema.getType('AuditEvent'); // => AuditEvent + * schema.getDirective('auth'); // => authDirective + * schema.extensions; // => { owner: 'platform' } + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the root object type for query operations. + * @returns The query root type, if this schema defines one. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * schema.getQueryType()?.name; // => 'Query' + * ``` + */ + getQueryType(): Maybe; + /** + * Returns the root object type for mutation operations. + * @returns The mutation root type, if this schema defines one. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * + * type Mutation { + * setGreeting(value: String!): String + * } + * `); + * + * schema.getMutationType()?.name; // => 'Mutation' + * ``` + */ + getMutationType(): Maybe; + /** + * Returns the root object type for subscription operations. + * @returns The subscription root type, if this schema defines one. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * + * type Subscription { + * greetings: String + * } + * `); + * + * schema.getSubscriptionType()?.name; // => 'Subscription' + * ``` + */ + getSubscriptionType(): Maybe; + /** + * Returns the root object type for the requested operation kind. + * @param operation - Operation kind to resolve. + * @returns The root object type for the operation kind, if this schema defines one. + * @example + * ```ts + * import { OperationTypeNode } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * + * type Mutation { + * setGreeting(value: String!): String + * } + * `); + * + * schema.getRootType(OperationTypeNode.QUERY)?.name; // => 'Query' + * schema.getRootType(OperationTypeNode.MUTATION)?.name; // => 'Mutation' + * schema.getRootType(OperationTypeNode.SUBSCRIPTION); // => undefined + * ``` + */ + getRootType(operation: OperationTypeNode): Maybe; + /** + * Returns all named types known to this schema. + * @returns A map of schema types keyed by type name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const typeMap = schema.getTypeMap(); + * + * typeMap.User.name; // => 'User' + * typeMap.Query.name; // => 'Query' + * typeMap.String.name; // => 'String' + * ``` + */ + getTypeMap(): TypeMap; + /** + * Returns the named type with the provided name. + * @param name - The GraphQL name to look up. + * @returns The named schema type, if one exists. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * schema.getType('User')?.toString(); // => 'User' + * schema.getType('Missing'); // => undefined + * ``` + */ + getType(name: string): GraphQLNamedType | undefined; + /** + * Returns object types that may be returned for an abstract type. + * @param abstractType - Interface or union type to inspect. + * @returns Object types that may satisfy the abstract type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType, assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Organization implements Node { + * id: ID! + * } + * + * union SearchResult = User | Organization + * + * type Query { + * node: Node + * search: [SearchResult] + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * const SearchResult = assertUnionType(schema.getType('SearchResult')); + * + * schema.getPossibleTypes(Node).map((type) => type.name); // => ['User', 'Organization'] + * schema.getPossibleTypes(SearchResult).map((type) => type.name); // => ['User', 'Organization'] + * ``` + */ + getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray; + /** + * Returns objects and interfaces that implement an interface type. + * @param interfaceType - Interface type to inspect. + * @returns Object and interface implementations of the interface. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Resource { + * url: String! + * } + * + * interface Image implements Resource { + * url: String! + * width: Int + * } + * + * type Photo implements Resource & Image { + * url: String! + * width: Int + * } + * + * type Query { + * resource: Resource + * } + * `); + * + * const Resource = assertInterfaceType(schema.getType('Resource')); + * const implementations = schema.getImplementations(Resource); + * + * implementations.interfaces.map((type) => type.name); // => ['Image'] + * implementations.objects.map((type) => type.name); // => ['Photo'] + * ``` + */ + getImplementations(interfaceType: GraphQLInterfaceType): { + objects: ReadonlyArray; + interfaces: ReadonlyArray; + }; + /** + * Returns whether one type is a possible runtime subtype of an abstract type. + * @param abstractType - Interface or union type to inspect. + * @param maybeSubType - Object or interface type to test as a possible subtype. + * @returns True when the subtype may satisfy the abstract type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType, assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Review { + * body: String + * } + * + * type Query { + * node: Node + * review: Review + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * const User = assertObjectType(schema.getType('User')); + * const Review = assertObjectType(schema.getType('Review')); + * + * schema.isSubType(Node, User); // => true + * schema.isSubType(Node, Review); // => false + * ``` + */ + isSubType(abstractType: GraphQLAbstractType, maybeSubType: GraphQLObjectType | GraphQLInterfaceType): boolean; + /** + * Returns directives available in this schema. + * @returns Directives available in this schema. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @upper on FIELD_DEFINITION + * + * type Query { + * greeting: String @upper + * } + * `); + * + * schema.getDirectives().map((directive) => directive.name); // => ['include', 'skip', 'deprecated', 'specifiedBy', 'oneOf', 'upper'] + * ``` + */ + getDirectives(): ReadonlyArray; + /** + * Returns the current directive definition. + * @param name - The GraphQL name to look up. + * @returns The current directive definition, if known. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @upper on FIELD_DEFINITION + * + * type Query { + * greeting: String @upper + * } + * `); + * + * schema.getDirective('upper')?.name; // => 'upper' + * schema.getDirective('missing'); // => undefined + * ``` + */ + getDirective(name: string): Maybe; + /** + * This method looks up the field on the given type definition. + * It has special casing for the three introspection fields, `__schema`, + * `__type` and `__typename`. + * + * `__typename` is special because it can always be queried as a field, even + * in situations where no other fields are allowed, like on a Union. + * + * `__schema` and `__type` could get automatically added to the query type, + * but that would require mutating type definitions, which would cause issues. + * @param parentType - Composite type to look up the field on. + * @param fieldName - Field name to look up. + * @returns The field definition, including supported introspection fields. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const queryType = schema.getQueryType(); + * + * schema.getField(queryType, 'greeting')?.name; // => 'greeting' + * schema.getField(queryType, '__typename')?.name; // => '__typename' + * schema.getField(queryType, 'missing'); // => undefined + * ``` + */ + getField(parentType: GraphQLCompositeType, fieldName: string): GraphQLField | undefined; + /** + * Returns a normalized configuration object for this object. + * + * The returned config preserves the original `assumeValid` flag so the schema + * can be recreated with the same validation behavior. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLSchema } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const config = schema.toConfig(); + * const schemaCopy = new GraphQLSchema(config); + * + * config.query?.name; // => 'Query' + * schemaCopy.getQueryType()?.name; // => 'Query' + * ``` + */ + toConfig(): GraphQLSchemaNormalizedConfig; +} +type TypeMap = ObjMap; +/** @internal */ +export interface GraphQLSchemaValidationOptions { + /** + * When building a schema from a GraphQL service's introspection result, it + * might be safe to assume the schema is valid. Set to true to assume the + * produced schema is valid. + * + * Default: false + * + * @internal + */ + assumeValid?: boolean | undefined; +} +/** Configuration used to construct a GraphQLSchema. */ +export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Root object type for query operations. */ + query?: Maybe; + /** Root object type for mutation operations. */ + mutation?: Maybe; + /** Root object type for subscription operations. */ + subscription?: Maybe; + /** Object types that belong to this union type. */ + types?: Maybe>; + /** Directives available in this schema or applied to this AST node. */ + directives?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig { + description: Maybe; + types: ReadonlyArray; + directives: ReadonlyArray; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; + assumeValid: boolean; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.ts new file mode 100644 index 00000000..0b69b0d9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.d.ts @@ -0,0 +1,644 @@ +/** @category Schema */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { GraphQLError } from "../error/GraphQLError.js"; +import type { SchemaDefinitionNode, SchemaExtensionNode } from "../language/ast.js"; +import { OperationTypeNode } from "../language/ast.js"; +import type { GraphQLAbstractType, GraphQLCompositeType, GraphQLField, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType } from "./definition.js"; +import type { GraphQLDirective } from "./directives.js"; +/** + * Test if the given value is a GraphQL schema. + * @param schema - Value to inspect. + * @returns True when the value is a GraphQLSchema. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLString, isSchema } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * isSchema(schema); // => true + * isSchema(GraphQLString); // => false + * ``` + */ +export declare function isSchema(schema: unknown): schema is GraphQLSchema; +/** + * Returns the value as a GraphQLSchema, or throws if it is not a schema. + * @param schema - GraphQL schema to use. + * @returns The value typed as a GraphQLSchema. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertSchema, GraphQLString } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * assertSchema(schema); // => schema + * assertSchema(GraphQLString); // throws an error + * ``` + */ +export declare function assertSchema(schema: unknown): GraphQLSchema; +/** + * Custom extensions + * @remarks + * Use a unique identifier name for your extension, for example the name of + * your library or project. Do not use a shortened identifier as this increases + * the risk of conflicts. We recommend you add at most one extension field, + * an object which can contain all the values you need. + */ +export interface GraphQLSchemaExtensions { + [attributeName: string | symbol]: unknown; +} +/** + * Schema Definition + * + * A Schema is created by supplying the root types of each type of operation, + * query and mutation (optional). A schema definition is then supplied to the + * validator and executor. + * @example + * ```ts + * const MyAppQueryRootType = new GraphQLObjectType({ + * name: 'Query', + * fields: { + * greeting: { type: GraphQLString }, + * }, + * }); + * + * const MyAppMutationRootType = new GraphQLObjectType({ + * name: 'Mutation', + * fields: { + * setGreeting: { type: GraphQLString }, + * }, + * }); + * + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * mutation: MyAppMutationRootType, + * }); + * ``` + * @example + * When the schema is constructed, by default only the types that are reachable + * by traversing the root types are included, other types must be explicitly + * referenced. + * + * ```ts + * const characterInterface = new GraphQLInterfaceType({ + * name: 'Character', + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const humanType = new GraphQLObjectType({ + * name: 'Human', + * interfaces: [characterInterface], + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const droidType = new GraphQLObjectType({ + * name: 'Droid', + * interfaces: [characterInterface], + * fields: { + * name: { type: GraphQLString }, + * }, + * }); + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * hero: { type: characterInterface }, + * }, + * }), + * // Since this schema references only the `Character` interface it's + * // necessary to explicitly list the types that implement it if + * // you want them to be included in the final schema. + * types: [humanType, droidType], + * }); + * ``` + * @example + * If an array of `directives` are provided to GraphQLSchema, that will be the + * exact list of directives represented and allowed. If `directives` is not + * provided then a default set of the specified directives (e.g. `@include` and + * `@skip`) will be used. If you wish to provide *additional* directives to + * these specified directives, you must explicitly declare them. + * + * ```ts + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * directives: specifiedDirectives.concat([myCustomDirective]), + * }); + * ``` + */ +export declare class GraphQLSchema { + /** Human-readable description for this schema element, if provided. */ + description: Maybe; + /** Custom extension fields reserved for users. */ + extensions: Readonly; + /** AST node from which this schema element was built, if available. */ + astNode: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes: ReadonlyArray; + /** Whether this schema instance skips validation checks. */ + assumeValid: boolean; + private _queryType; + private _mutationType; + private _subscriptionType; + private _directives; + private _typeMap; + private _subTypeMap; + private _implementationsMap; + /** + * Creates a GraphQLSchema instance. + * @param config - Configuration describing this object. + * @example + * ```ts + * // Create a schema with the required query root. + * import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ + * name: 'Query', + * fields: { + * greeting: { + * type: GraphQLString, + * resolve: () => 'Hello', + * }, + * }, + * }); + * + * const schema = new GraphQLSchema({ + * description: 'The application schema.', + * query: Query, + * }); + * + * schema.getQueryType(); // => Query + * schema.description; // => 'The application schema.' + * ``` + * @example + * ```ts + * // This variant configures every schema option, including directives and extensions. + * import { DirectiveLocation, parse } from 'graphql/language'; + * import { + * GraphQLBoolean, + * GraphQLDirective, + * GraphQLObjectType, + * GraphQLSchema, + * GraphQLString, + * } from 'graphql/type'; + * + * const Query = new GraphQLObjectType({ + * name: 'Query', + * fields: { greeting: { type: GraphQLString } }, + * }); + * const Mutation = new GraphQLObjectType({ + * name: 'Mutation', + * fields: { setGreeting: { type: GraphQLString } }, + * }); + * const Subscription = new GraphQLObjectType({ + * name: 'Subscription', + * fields: { greetingChanged: { type: GraphQLString } }, + * }); + * const AuditEvent = new GraphQLObjectType({ + * name: 'AuditEvent', + * fields: { message: { type: GraphQLString } }, + * }); + * const authDirective = new GraphQLDirective({ + * name: 'auth', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { required: { type: GraphQLBoolean } }, + * }); + * const schemaDocument = parse(` + * schema { + * query: Query + * mutation: Mutation + * subscription: Subscription + * } + * + * extend schema @auth + * `); + * + * const schema = new GraphQLSchema({ + * description: 'Operations exposed by the application.', + * query: Query, + * mutation: Mutation, + * subscription: Subscription, + * types: [AuditEvent], + * directives: [authDirective], + * extensions: { owner: 'platform' }, + * astNode: schemaDocument.definitions[0], + * extensionASTNodes: [schemaDocument.definitions[1]], + * assumeValid: true, + * }); + * + * schema.getMutationType(); // => Mutation + * schema.getSubscriptionType(); // => Subscription + * schema.getType('AuditEvent'); // => AuditEvent + * schema.getDirective('auth'); // => authDirective + * schema.extensions; // => { owner: 'platform' } + * ``` + */ + constructor(config: Readonly); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the root object type for query operations. + * @returns The query root type, if this schema defines one. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * schema.getQueryType()?.name; // => 'Query' + * ``` + */ + getQueryType(): Maybe; + /** + * Returns the root object type for mutation operations. + * @returns The mutation root type, if this schema defines one. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * + * type Mutation { + * setGreeting(value: String!): String + * } + * `); + * + * schema.getMutationType()?.name; // => 'Mutation' + * ``` + */ + getMutationType(): Maybe; + /** + * Returns the root object type for subscription operations. + * @returns The subscription root type, if this schema defines one. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * + * type Subscription { + * greetings: String + * } + * `); + * + * schema.getSubscriptionType()?.name; // => 'Subscription' + * ``` + */ + getSubscriptionType(): Maybe; + /** + * Returns the root object type for the requested operation kind. + * @param operation - Operation kind to resolve. + * @returns The root object type for the operation kind, if this schema defines one. + * @example + * ```ts + * import { OperationTypeNode } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * + * type Mutation { + * setGreeting(value: String!): String + * } + * `); + * + * schema.getRootType(OperationTypeNode.QUERY)?.name; // => 'Query' + * schema.getRootType(OperationTypeNode.MUTATION)?.name; // => 'Mutation' + * schema.getRootType(OperationTypeNode.SUBSCRIPTION); // => undefined + * ``` + */ + getRootType(operation: OperationTypeNode): Maybe; + /** + * Returns all named types known to this schema. + * @returns A map of schema types keyed by type name. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * const typeMap = schema.getTypeMap(); + * + * typeMap.User.name; // => 'User' + * typeMap.Query.name; // => 'Query' + * typeMap.String.name; // => 'String' + * ``` + */ + getTypeMap(): TypeMap; + /** + * Returns the named type with the provided name. + * @param name - The GraphQL name to look up. + * @returns The named schema type, if one exists. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * schema.getType('User')?.toString(); // => 'User' + * schema.getType('Missing'); // => undefined + * ``` + */ + getType(name: string): GraphQLNamedType | undefined; + /** + * Returns object types that may be returned for an abstract type. + * @param abstractType - Interface or union type to inspect. + * @returns Object types that may satisfy the abstract type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType, assertUnionType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Organization implements Node { + * id: ID! + * } + * + * union SearchResult = User | Organization + * + * type Query { + * node: Node + * search: [SearchResult] + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * const SearchResult = assertUnionType(schema.getType('SearchResult')); + * + * schema.getPossibleTypes(Node).map((type) => type.name); // => ['User', 'Organization'] + * schema.getPossibleTypes(SearchResult).map((type) => type.name); // => ['User', 'Organization'] + * ``` + */ + getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray; + /** + * Returns objects and interfaces that implement an interface type. + * @param interfaceType - Interface type to inspect. + * @returns Object and interface implementations of the interface. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Resource { + * url: String! + * } + * + * interface Image implements Resource { + * url: String! + * width: Int + * } + * + * type Photo implements Resource & Image { + * url: String! + * width: Int + * } + * + * type Query { + * resource: Resource + * } + * `); + * + * const Resource = assertInterfaceType(schema.getType('Resource')); + * const implementations = schema.getImplementations(Resource); + * + * implementations.interfaces.map((type) => type.name); // => ['Image'] + * implementations.objects.map((type) => type.name); // => ['Photo'] + * ``` + */ + getImplementations(interfaceType: GraphQLInterfaceType): { + objects: ReadonlyArray; + interfaces: ReadonlyArray; + }; + /** + * Returns whether one type is a possible runtime subtype of an abstract type. + * @param abstractType - Interface or union type to inspect. + * @param maybeSubType - Object or interface type to test as a possible subtype. + * @returns True when the subtype may satisfy the abstract type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertInterfaceType, assertObjectType } from 'graphql/type'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Review { + * body: String + * } + * + * type Query { + * node: Node + * review: Review + * } + * `); + * + * const Node = assertInterfaceType(schema.getType('Node')); + * const User = assertObjectType(schema.getType('User')); + * const Review = assertObjectType(schema.getType('Review')); + * + * schema.isSubType(Node, User); // => true + * schema.isSubType(Node, Review); // => false + * ``` + */ + isSubType(abstractType: GraphQLAbstractType, maybeSubType: GraphQLObjectType | GraphQLInterfaceType): boolean; + /** + * Returns directives available in this schema. + * @returns Directives available in this schema. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @upper on FIELD_DEFINITION + * + * type Query { + * greeting: String @upper + * } + * `); + * + * schema.getDirectives().map((directive) => directive.name); // => ['include', 'skip', 'deprecated', 'specifiedBy', 'oneOf', 'upper'] + * ``` + */ + getDirectives(): ReadonlyArray; + /** + * Returns the current directive definition. + * @param name - The GraphQL name to look up. + * @returns The current directive definition, if known. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @upper on FIELD_DEFINITION + * + * type Query { + * greeting: String @upper + * } + * `); + * + * schema.getDirective('upper')?.name; // => 'upper' + * schema.getDirective('missing'); // => undefined + * ``` + */ + getDirective(name: string): Maybe; + /** + * This method looks up the field on the given type definition. + * It has special casing for the three introspection fields, `__schema`, + * `__type` and `__typename`. + * + * `__typename` is special because it can always be queried as a field, even + * in situations where no other fields are allowed, like on a Union. + * + * `__schema` and `__type` could get automatically added to the query type, + * but that would require mutating type definitions, which would cause issues. + * @param parentType - Composite type to look up the field on. + * @param fieldName - Field name to look up. + * @returns The field definition, including supported introspection fields. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const queryType = schema.getQueryType(); + * + * schema.getField(queryType, 'greeting')?.name; // => 'greeting' + * schema.getField(queryType, '__typename')?.name; // => '__typename' + * schema.getField(queryType, 'missing'); // => undefined + * ``` + */ + getField(parentType: GraphQLCompositeType, fieldName: string): GraphQLField | undefined; + /** + * Returns a normalized configuration object for this object. + * + * The returned config preserves the original `assumeValid` flag so the schema + * can be recreated with the same validation behavior. + * @returns A configuration object that can be used to recreate this object. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { GraphQLSchema } from 'graphql/type'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const config = schema.toConfig(); + * const schemaCopy = new GraphQLSchema(config); + * + * config.query?.name; // => 'Query' + * schemaCopy.getQueryType()?.name; // => 'Query' + * ``` + */ + toConfig(): GraphQLSchemaNormalizedConfig; +} +type TypeMap = ObjMap; +/** @internal */ +export interface GraphQLSchemaValidationOptions { + /** + * When building a schema from a GraphQL service's introspection result, it + * might be safe to assume the schema is valid. Set to true to assume the + * produced schema is valid. + * + * Default: false + * + * @internal + */ + assumeValid?: boolean | undefined; +} +/** Configuration used to construct a GraphQLSchema. */ +export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { + /** Human-readable description for this schema element, if provided. */ + description?: Maybe; + /** Root object type for query operations. */ + query?: Maybe; + /** Root object type for mutation operations. */ + mutation?: Maybe; + /** Root object type for subscription operations. */ + subscription?: Maybe; + /** Object types that belong to this union type. */ + types?: Maybe>; + /** Directives available in this schema or applied to this AST node. */ + directives?: Maybe>; + /** Custom extension fields reserved for users. */ + extensions?: Maybe>; + /** AST node from which this schema element was built, if available. */ + astNode?: Maybe; + /** AST extension nodes applied to this schema element. */ + extensionASTNodes?: Maybe>; +} +/** @internal */ +export interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig { + description: Maybe; + types: ReadonlyArray; + directives: ReadonlyArray; + extensions: Readonly; + extensionASTNodes: ReadonlyArray; + assumeValid: boolean; +} +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js new file mode 100644 index 00000000..4881cba8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js @@ -0,0 +1,220 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GraphQLSchema = void 0; +exports.isSchema = isSchema; +exports.assertSchema = assertSchema; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const instanceOf_ts_1 = require("../jsutils/instanceOf.js"); +const toObjMap_ts_1 = require("../jsutils/toObjMap.js"); +const ast_ts_1 = require("../language/ast.js"); +const definition_ts_1 = require("./definition.js"); +const directives_ts_1 = require("./directives.js"); +const introspection_ts_1 = require("./introspection.js"); +function isSchema(schema) { + return (0, instanceOf_ts_1.instanceOf)(schema, schemaSymbol, GraphQLSchema); +} +function assertSchema(schema) { + if (!isSchema(schema)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(schema)} to be a GraphQL schema.`); + } + return schema; +} +const schemaSymbol = Symbol('Schema'); +class GraphQLSchema { + constructor(config) { + this.__kind = schemaSymbol; + this.assumeValid = config.assumeValid ?? false; + this.__validationErrors = config.assumeValid === true ? [] : undefined; + this.description = config.description; + this.extensions = (0, toObjMap_ts_1.toObjMapWithSymbols)(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._queryType = config.query; + this._mutationType = config.mutation; + this._subscriptionType = config.subscription; + this._directives = config.directives ?? directives_ts_1.specifiedDirectives; + const allReferencedTypes = new Set(config.types); + if (config.types != null) { + for (const type of config.types) { + allReferencedTypes.delete(type); + collectReferencedTypes(type, allReferencedTypes); + } + } + if (this._queryType != null) { + collectReferencedTypes(this._queryType, allReferencedTypes); + } + if (this._mutationType != null) { + collectReferencedTypes(this._mutationType, allReferencedTypes); + } + if (this._subscriptionType != null) { + collectReferencedTypes(this._subscriptionType, allReferencedTypes); + } + for (const directive of this._directives) { + if ((0, directives_ts_1.isDirective)(directive)) { + for (const arg of directive.args) { + collectReferencedTypes(arg.type, allReferencedTypes); + } + } + } + collectReferencedTypes(introspection_ts_1.__Schema, allReferencedTypes); + this._typeMap = Object.create(null); + this._subTypeMap = new Map(); + this._implementationsMap = Object.create(null); + for (const namedType of allReferencedTypes) { + if (namedType == null) { + continue; + } + const typeName = namedType.name; + if (this._typeMap[typeName] !== undefined) { + throw new Error(`Schema must contain uniquely named types but contains multiple types named "${typeName}".`); + } + this._typeMap[typeName] = namedType; + if ((0, definition_ts_1.isInterfaceType)(namedType)) { + for (const iface of namedType.getInterfaces()) { + if ((0, definition_ts_1.isInterfaceType)(iface)) { + let implementations = this._implementationsMap[iface.name]; + implementations ??= this._implementationsMap[iface.name] = { + objects: [], + interfaces: [], + }; + implementations.interfaces.push(namedType); + } + } + } + else if ((0, definition_ts_1.isObjectType)(namedType)) { + for (const iface of namedType.getInterfaces()) { + if ((0, definition_ts_1.isInterfaceType)(iface)) { + let implementations = this._implementationsMap[iface.name]; + implementations ??= this._implementationsMap[iface.name] = { + objects: [], + interfaces: [], + }; + implementations.objects.push(namedType); + } + } + } + } + } + get [Symbol.toStringTag]() { + return 'GraphQLSchema'; + } + getQueryType() { + return this._queryType; + } + getMutationType() { + return this._mutationType; + } + getSubscriptionType() { + return this._subscriptionType; + } + getRootType(operation) { + switch (operation) { + case ast_ts_1.OperationTypeNode.QUERY: + return this.getQueryType(); + case ast_ts_1.OperationTypeNode.MUTATION: + return this.getMutationType(); + case ast_ts_1.OperationTypeNode.SUBSCRIPTION: + return this.getSubscriptionType(); + } + } + getTypeMap() { + return this._typeMap; + } + getType(name) { + return this.getTypeMap()[name]; + } + getPossibleTypes(abstractType) { + return (0, definition_ts_1.isUnionType)(abstractType) + ? abstractType.getTypes() + : this.getImplementations(abstractType).objects; + } + getImplementations(interfaceType) { + const implementations = this._implementationsMap[interfaceType.name]; + return implementations ?? { objects: [], interfaces: [] }; + } + isSubType(abstractType, maybeSubType) { + let set = this._subTypeMap.get(abstractType); + if (set === undefined) { + if ((0, definition_ts_1.isUnionType)(abstractType)) { + set = new Set(abstractType.getTypes()); + } + else { + const implementations = this.getImplementations(abstractType); + set = new Set([ + ...implementations.objects, + ...implementations.interfaces, + ]); + } + this._subTypeMap.set(abstractType, set); + } + return set.has(maybeSubType); + } + getDirectives() { + return this._directives; + } + getDirective(name) { + return this.getDirectives().find((directive) => directive.name === name); + } + getField(parentType, fieldName) { + switch (fieldName) { + case introspection_ts_1.SchemaMetaFieldDef.name: + return this.getQueryType() === parentType + ? introspection_ts_1.SchemaMetaFieldDef + : undefined; + case introspection_ts_1.TypeMetaFieldDef.name: + return this.getQueryType() === parentType + ? introspection_ts_1.TypeMetaFieldDef + : undefined; + case introspection_ts_1.TypeNameMetaFieldDef.name: + return introspection_ts_1.TypeNameMetaFieldDef; + } + if ('getFields' in parentType) { + return parentType.getFields()[fieldName]; + } + return undefined; + } + toConfig() { + return { + description: this.description, + query: this.getQueryType(), + mutation: this.getMutationType(), + subscription: this.getSubscriptionType(), + types: Object.values(this.getTypeMap()), + directives: this.getDirectives(), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + assumeValid: this.assumeValid, + }; + } +} +exports.GraphQLSchema = GraphQLSchema; +function collectReferencedTypes(type, typeSet) { + const namedType = (0, definition_ts_1.getNamedType)(type); + if (!typeSet.has(namedType)) { + typeSet.add(namedType); + if ((0, definition_ts_1.isUnionType)(namedType)) { + for (const memberType of namedType.getTypes()) { + collectReferencedTypes(memberType, typeSet); + } + } + else if ((0, definition_ts_1.isObjectType)(namedType) || (0, definition_ts_1.isInterfaceType)(namedType)) { + for (const interfaceType of namedType.getInterfaces()) { + collectReferencedTypes(interfaceType, typeSet); + } + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + for (const arg of field.args) { + collectReferencedTypes(arg.type, typeSet); + } + } + } + else if ((0, definition_ts_1.isInputObjectType)(namedType)) { + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + } + } + } + return typeSet; +} +//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js.map new file mode 100644 index 00000000..191ffb45 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/type/schema.ts"],"names":[],"mappings":";;;AA4DA,4BAEC;AAqBD,oCAKC;AAtFD,sDAAgD;AAChD,4DAAsD;AAGtD,wDAA6D;AAQ7D,+CAAuD;AAWvD,mDAMyB;AAEzB,mDAAmE;AACnE,yDAK4B;AAqB5B,SAAgB,QAAQ,CAAC,MAAe;IACtC,OAAO,IAAA,0BAAU,EAAC,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AACzD,CAAC;AAqBD,SAAgB,YAAY,CAAC,MAAe;IAC1C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,YAAY,IAAA,oBAAO,EAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAeD,MAAM,YAAY,GAAkB,MAAM,CAAC,QAAQ,CAAC,CAAC;AAqFrD,MAAa,aAAa;IA+HxB,YAAY,MAAqC;QA1HxC,WAAM,GAAwB,YAAY,CAAC;QA6HlD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC;QAE/C,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,C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M,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;gBACzD,sBAAsB,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/** @category Schema */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { instanceOf } from '../jsutils/instanceOf.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { toObjMapWithSymbols } from '../jsutils/toObjMap.ts';\n\nimport type { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n SchemaDefinitionNode,\n SchemaExtensionNode,\n} from '../language/ast.ts';\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport type {\n GraphQLAbstractType,\n GraphQLCompositeType,\n GraphQLField,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n GraphQLType,\n} from './definition.ts';\nimport {\n getNamedType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isUnionType,\n} from './definition.ts';\nimport type { GraphQLDirective } from './directives.ts';\nimport { isDirective, specifiedDirectives } from './directives.ts';\nimport {\n __Schema,\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n} from './introspection.ts';\n\n/**\n * Test if the given value is a GraphQL schema.\n * @param schema - Value to inspect.\n * @returns True when the value is a GraphQLSchema.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLString, isSchema } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * isSchema(schema); // => true\n * isSchema(GraphQLString); // => false\n * ```\n */\nexport function isSchema(schema: unknown): schema is GraphQLSchema {\n return instanceOf(schema, schemaSymbol, GraphQLSchema);\n}\n\n/**\n * Returns the value as a GraphQLSchema, or throws if it is not a schema.\n * @param schema - GraphQL schema to use.\n * @returns The value typed as a GraphQLSchema.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertSchema, GraphQLString } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * assertSchema(schema); // => schema\n * assertSchema(GraphQLString); // throws an error\n * ```\n */\nexport function assertSchema(schema: unknown): GraphQLSchema {\n if (!isSchema(schema)) {\n throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`);\n }\n return schema;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLSchemaExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** @private */\nconst schemaSymbol: unique symbol = Symbol('Schema');\n\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n * @example\n * ```ts\n * const MyAppQueryRootType = new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * greeting: { type: GraphQLString },\n * },\n * });\n *\n * const MyAppMutationRootType = new GraphQLObjectType({\n * name: 'Mutation',\n * fields: {\n * setGreeting: { type: GraphQLString },\n * },\n * });\n *\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * });\n * ```\n * @example\n * When the schema is constructed, by default only the types that are reachable\n * by traversing the root types are included, other types must be explicitly\n * referenced.\n *\n * ```ts\n * const characterInterface = new GraphQLInterfaceType({\n * name: 'Character',\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const humanType = new GraphQLObjectType({\n * name: 'Human',\n * interfaces: [characterInterface],\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const droidType = new GraphQLObjectType({\n * name: 'Droid',\n * interfaces: [characterInterface],\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * hero: { type: characterInterface },\n * },\n * }),\n * // Since this schema references only the `Character` interface it's\n * // necessary to explicitly list the types that implement it if\n * // you want them to be included in the final schema.\n * types: [humanType, droidType],\n * });\n * ```\n * @example\n * If an array of `directives` are provided to GraphQLSchema, that will be the\n * exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. `@include` and\n * `@skip`) will be used. If you wish to provide *additional* directives to\n * these specified directives, you must explicitly declare them.\n *\n * ```ts\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * directives: specifiedDirectives.concat([myCustomDirective]),\n * });\n * ```\n */\nexport class GraphQLSchema {\n /**\n * Internal runtime marker used to identify GraphQLSchema instances.\n * @private\n */\n readonly __kind: typeof schemaSymbol = schemaSymbol;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n /** Whether this schema instance skips validation checks. */\n assumeValid: boolean;\n /**\n * Cached schema validation errors, if validation has already run.\n * @private\n */\n __validationErrors: Maybe>;\n\n private _queryType: Maybe;\n private _mutationType: Maybe;\n private _subscriptionType: Maybe;\n private _directives: ReadonlyArray;\n private _typeMap: TypeMap;\n private _subTypeMap: Map<\n GraphQLAbstractType,\n Set\n >;\n\n private _implementationsMap: ObjMap<{\n objects: Array;\n interfaces: Array;\n }>;\n\n /**\n * Creates a GraphQLSchema instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * // Create a schema with the required query root.\n * import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * greeting: {\n * type: GraphQLString,\n * resolve: () => 'Hello',\n * },\n * },\n * });\n *\n * const schema = new GraphQLSchema({\n * description: 'The application schema.',\n * query: Query,\n * });\n *\n * schema.getQueryType(); // => Query\n * schema.description; // => 'The application schema.'\n * ```\n * @example\n * ```ts\n * // This variant configures every schema option, including directives and extensions.\n * import { DirectiveLocation, parse } from 'graphql/language';\n * import {\n * GraphQLBoolean,\n * GraphQLDirective,\n * GraphQLObjectType,\n * GraphQLSchema,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({\n * name: 'Query',\n * fields: { greeting: { type: GraphQLString } },\n * });\n * const Mutation = new GraphQLObjectType({\n * name: 'Mutation',\n * fields: { setGreeting: { type: GraphQLString } },\n * });\n * const Subscription = new GraphQLObjectType({\n * name: 'Subscription',\n * fields: { greetingChanged: { type: GraphQLString } },\n * });\n * const AuditEvent = new GraphQLObjectType({\n * name: 'AuditEvent',\n * fields: { message: { type: GraphQLString } },\n * });\n * const authDirective = new GraphQLDirective({\n * name: 'auth',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: { required: { type: GraphQLBoolean } },\n * });\n * const schemaDocument = parse(`\n * schema {\n * query: Query\n * mutation: Mutation\n * subscription: Subscription\n * }\n *\n * extend schema @auth\n * `);\n *\n * const schema = new GraphQLSchema({\n * description: 'Operations exposed by the application.',\n * query: Query,\n * mutation: Mutation,\n * subscription: Subscription,\n * types: [AuditEvent],\n * directives: [authDirective],\n * extensions: { owner: 'platform' },\n * astNode: schemaDocument.definitions[0],\n * extensionASTNodes: [schemaDocument.definitions[1]],\n * assumeValid: true,\n * });\n *\n * schema.getMutationType(); // => Mutation\n * schema.getSubscriptionType(); // => Subscription\n * schema.getType('AuditEvent'); // => AuditEvent\n * schema.getDirective('auth'); // => authDirective\n * schema.extensions; // => { owner: 'platform' }\n * ```\n */\n constructor(config: Readonly) {\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.assumeValid = config.assumeValid ?? false;\n // Used as a cache for validateSchema().\n this.__validationErrors = config.assumeValid === true ? [] : undefined;\n\n this.description = config.description;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription;\n // Provide specified directives (e.g. @include and @skip) by default.\n this._directives = config.directives ?? specifiedDirectives;\n\n // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n const allReferencedTypes = new Set(config.types);\n if (config.types != null) {\n for (const type of config.types) {\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (const directive of this._directives) {\n // Directives are not validated until validateSchema() is called.\n if (isDirective(directive)) {\n for (const arg of directive.args) {\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n collectReferencedTypes(__Schema, allReferencedTypes);\n\n // Storing the resulting map for reference by the schema.\n this._typeMap = Object.create(null);\n this._subTypeMap = new Map();\n // Keep track of all implementations by interface name.\n this._implementationsMap = Object.create(null);\n\n for (const namedType of allReferencedTypes) {\n if (namedType == null) {\n continue;\n }\n\n const typeName = namedType.name;\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\n `Schema must contain uniquely named types but contains multiple types named \"${typeName}\".`,\n );\n }\n this._typeMap[typeName] = namedType;\n\n if (isInterfaceType(namedType)) {\n // Store implementations by interface.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n implementations ??= this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (isObjectType(namedType)) {\n // Store implementations by objects.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n implementations ??= this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n\n implementations.objects.push(namedType);\n }\n }\n }\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLSchema';\n }\n\n /**\n * Returns the root object type for query operations.\n * @returns The query root type, if this schema defines one.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * schema.getQueryType()?.name; // => 'Query'\n * ```\n */\n getQueryType(): Maybe {\n return this._queryType;\n }\n\n /**\n * Returns the root object type for mutation operations.\n * @returns The mutation root type, if this schema defines one.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n *\n * type Mutation {\n * setGreeting(value: String!): String\n * }\n * `);\n *\n * schema.getMutationType()?.name; // => 'Mutation'\n * ```\n */\n getMutationType(): Maybe {\n return this._mutationType;\n }\n\n /**\n * Returns the root object type for subscription operations.\n * @returns The subscription root type, if this schema defines one.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n *\n * type Subscription {\n * greetings: String\n * }\n * `);\n *\n * schema.getSubscriptionType()?.name; // => 'Subscription'\n * ```\n */\n getSubscriptionType(): Maybe {\n return this._subscriptionType;\n }\n\n /**\n * Returns the root object type for the requested operation kind.\n * @param operation - Operation kind to resolve.\n * @returns The root object type for the operation kind, if this schema defines one.\n * @example\n * ```ts\n * import { OperationTypeNode } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n *\n * type Mutation {\n * setGreeting(value: String!): String\n * }\n * `);\n *\n * schema.getRootType(OperationTypeNode.QUERY)?.name; // => 'Query'\n * schema.getRootType(OperationTypeNode.MUTATION)?.name; // => 'Mutation'\n * schema.getRootType(OperationTypeNode.SUBSCRIPTION); // => undefined\n * ```\n */\n getRootType(operation: OperationTypeNode): Maybe {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return this.getQueryType();\n case OperationTypeNode.MUTATION:\n return this.getMutationType();\n case OperationTypeNode.SUBSCRIPTION:\n return this.getSubscriptionType();\n }\n }\n\n /**\n * Returns all named types known to this schema.\n * @returns A map of schema types keyed by type name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const typeMap = schema.getTypeMap();\n *\n * typeMap.User.name; // => 'User'\n * typeMap.Query.name; // => 'Query'\n * typeMap.String.name; // => 'String'\n * ```\n */\n getTypeMap(): TypeMap {\n return this._typeMap;\n }\n\n /**\n * Returns the named type with the provided name.\n * @param name - The GraphQL name to look up.\n * @returns The named schema type, if one exists.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * schema.getType('User')?.toString(); // => 'User'\n * schema.getType('Missing'); // => undefined\n * ```\n */\n getType(name: string): GraphQLNamedType | undefined {\n return this.getTypeMap()[name];\n }\n\n /**\n * Returns object types that may be returned for an abstract type.\n * @param abstractType - Interface or union type to inspect.\n * @returns Object types that may satisfy the abstract type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType, assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Organization implements Node {\n * id: ID!\n * }\n *\n * union SearchResult = User | Organization\n *\n * type Query {\n * node: Node\n * search: [SearchResult]\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const SearchResult = assertUnionType(schema.getType('SearchResult'));\n *\n * schema.getPossibleTypes(Node).map((type) => type.name); // => ['User', 'Organization']\n * schema.getPossibleTypes(SearchResult).map((type) => type.name); // => ['User', 'Organization']\n * ```\n */\n getPossibleTypes(\n abstractType: GraphQLAbstractType,\n ): ReadonlyArray {\n return isUnionType(abstractType)\n ? abstractType.getTypes()\n : this.getImplementations(abstractType).objects;\n }\n\n /**\n * Returns objects and interfaces that implement an interface type.\n * @param interfaceType - Interface type to inspect.\n * @returns Object and interface implementations of the interface.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Resource {\n * url: String!\n * }\n *\n * interface Image implements Resource {\n * url: String!\n * width: Int\n * }\n *\n * type Photo implements Resource & Image {\n * url: String!\n * width: Int\n * }\n *\n * type Query {\n * resource: Resource\n * }\n * `);\n *\n * const Resource = assertInterfaceType(schema.getType('Resource'));\n * const implementations = schema.getImplementations(Resource);\n *\n * implementations.interfaces.map((type) => type.name); // => ['Image']\n * implementations.objects.map((type) => type.name); // => ['Photo']\n * ```\n */\n getImplementations(interfaceType: GraphQLInterfaceType): {\n objects: ReadonlyArray;\n interfaces: ReadonlyArray;\n } {\n const implementations = this._implementationsMap[interfaceType.name];\n return implementations ?? { objects: [], interfaces: [] };\n }\n\n /**\n * Returns whether one type is a possible runtime subtype of an abstract type.\n * @param abstractType - Interface or union type to inspect.\n * @param maybeSubType - Object or interface type to test as a possible subtype.\n * @returns True when the subtype may satisfy the abstract type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType, assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Review {\n * body: String\n * }\n *\n * type Query {\n * node: Node\n * review: Review\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const User = assertObjectType(schema.getType('User'));\n * const Review = assertObjectType(schema.getType('Review'));\n *\n * schema.isSubType(Node, User); // => true\n * schema.isSubType(Node, Review); // => false\n * ```\n */\n isSubType(\n abstractType: GraphQLAbstractType,\n maybeSubType: GraphQLObjectType | GraphQLInterfaceType,\n ): boolean {\n let set = this._subTypeMap.get(abstractType);\n if (set === undefined) {\n if (isUnionType(abstractType)) {\n set = new Set(abstractType.getTypes());\n } else {\n const implementations = this.getImplementations(abstractType);\n set = new Set([\n ...implementations.objects,\n ...implementations.interfaces,\n ]);\n }\n\n this._subTypeMap.set(abstractType, set);\n }\n return set.has(maybeSubType);\n }\n\n /**\n * Returns directives available in this schema.\n * @returns Directives available in this schema.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @upper on FIELD_DEFINITION\n *\n * type Query {\n * greeting: String @upper\n * }\n * `);\n *\n * schema.getDirectives().map((directive) => directive.name); // => ['include', 'skip', 'deprecated', 'specifiedBy', 'oneOf', 'upper']\n * ```\n */\n getDirectives(): ReadonlyArray {\n return this._directives;\n }\n\n /**\n * Returns the current directive definition.\n * @param name - The GraphQL name to look up.\n * @returns The current directive definition, if known.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @upper on FIELD_DEFINITION\n *\n * type Query {\n * greeting: String @upper\n * }\n * `);\n *\n * schema.getDirective('upper')?.name; // => 'upper'\n * schema.getDirective('missing'); // => undefined\n * ```\n */\n getDirective(name: string): Maybe {\n return this.getDirectives().find((directive) => directive.name === name);\n }\n\n /**\n * This method looks up the field on the given type definition.\n * It has special casing for the three introspection fields, `__schema`,\n * `__type` and `__typename`.\n *\n * `__typename` is special because it can always be queried as a field, even\n * in situations where no other fields are allowed, like on a Union.\n *\n * `__schema` and `__type` could get automatically added to the query type,\n * but that would require mutating type definitions, which would cause issues.\n * @param parentType - Composite type to look up the field on.\n * @param fieldName - Field name to look up.\n * @returns The field definition, including supported introspection fields.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const queryType = schema.getQueryType();\n *\n * schema.getField(queryType, 'greeting')?.name; // => 'greeting'\n * schema.getField(queryType, '__typename')?.name; // => '__typename'\n * schema.getField(queryType, 'missing'); // => undefined\n * ```\n */\n getField(\n parentType: GraphQLCompositeType,\n fieldName: string,\n ): GraphQLField | undefined {\n switch (fieldName) {\n case SchemaMetaFieldDef.name:\n return this.getQueryType() === parentType\n ? SchemaMetaFieldDef\n : undefined;\n case TypeMetaFieldDef.name:\n return this.getQueryType() === parentType\n ? TypeMetaFieldDef\n : undefined;\n case TypeNameMetaFieldDef.name:\n return TypeNameMetaFieldDef;\n }\n\n // this function is part \"hot\" path inside executor and check presence\n // of 'getFields' is faster than to use `!isUnionType`\n if ('getFields' in parentType) {\n return parentType.getFields()[fieldName];\n }\n return undefined;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n *\n * The returned config preserves the original `assumeValid` flag so the schema\n * can be recreated with the same validation behavior.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLSchema } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const config = schema.toConfig();\n * const schemaCopy = new GraphQLSchema(config);\n *\n * config.query?.name; // => 'Query'\n * schemaCopy.getQueryType()?.name; // => 'Query'\n * ```\n */\n toConfig(): GraphQLSchemaNormalizedConfig {\n return {\n description: this.description,\n query: this.getQueryType(),\n mutation: this.getMutationType(),\n subscription: this.getSubscriptionType(),\n types: Object.values(this.getTypeMap()),\n directives: this.getDirectives(),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n assumeValid: this.assumeValid,\n };\n }\n}\n\ntype TypeMap = ObjMap;\n\n/** @internal */\nexport interface GraphQLSchemaValidationOptions {\n /**\n * When building a schema from a GraphQL service's introspection result, it\n * might be safe to assume the schema is valid. Set to true to assume the\n * produced schema is valid.\n *\n * Default: false\n *\n * @internal\n */\n assumeValid?: boolean | undefined;\n}\n\n/** Configuration used to construct a GraphQLSchema. */\nexport interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Root object type for query operations. */\n query?: Maybe;\n /** Root object type for mutation operations. */\n mutation?: Maybe;\n /** Root object type for subscription operations. */\n subscription?: Maybe;\n /** Object types that belong to this union type. */\n types?: Maybe>;\n /** Directives available in this schema or applied to this AST node. */\n directives?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig {\n description: Maybe;\n types: ReadonlyArray;\n directives: ReadonlyArray;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n assumeValid: boolean;\n}\n\nfunction collectReferencedTypes(\n type: GraphQLType,\n typeSet: Set,\n): Set {\n const namedType = getNamedType(type);\n\n if (!typeSet.has(namedType)) {\n typeSet.add(namedType);\n if (isUnionType(namedType)) {\n for (const memberType of namedType.getTypes()) {\n collectReferencedTypes(memberType, typeSet);\n }\n } else if (isObjectType(namedType) || isInterfaceType(namedType)) {\n for (const interfaceType of namedType.getInterfaces()) {\n collectReferencedTypes(interfaceType, typeSet);\n }\n\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n for (const arg of field.args) {\n collectReferencedTypes(arg.type, typeSet);\n }\n }\n } else if (isInputObjectType(namedType)) {\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n }\n }\n }\n\n return typeSet;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs new file mode 100644 index 00000000..b98bf01b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs @@ -0,0 +1,214 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { instanceOf } from "../jsutils/instanceOf.mjs"; +import { toObjMapWithSymbols } from "../jsutils/toObjMap.mjs"; +import { OperationTypeNode } from "../language/ast.mjs"; +import { getNamedType, isInputObjectType, isInterfaceType, isObjectType, isUnionType, } from "./definition.mjs"; +import { isDirective, specifiedDirectives } from "./directives.mjs"; +import { __Schema, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from "./introspection.mjs"; +export function isSchema(schema) { + return instanceOf(schema, schemaSymbol, GraphQLSchema); +} +export function assertSchema(schema) { + if (!isSchema(schema)) { + throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`); + } + return schema; +} +const schemaSymbol = Symbol('Schema'); +export class GraphQLSchema { + constructor(config) { + this.__kind = schemaSymbol; + this.assumeValid = config.assumeValid ?? false; + this.__validationErrors = config.assumeValid === true ? [] : undefined; + this.description = config.description; + this.extensions = toObjMapWithSymbols(config.extensions); + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes ?? []; + this._queryType = config.query; + this._mutationType = config.mutation; + this._subscriptionType = config.subscription; + this._directives = config.directives ?? specifiedDirectives; + const allReferencedTypes = new Set(config.types); + if (config.types != null) { + for (const type of config.types) { + allReferencedTypes.delete(type); + collectReferencedTypes(type, allReferencedTypes); + } + } + if (this._queryType != null) { + collectReferencedTypes(this._queryType, allReferencedTypes); + } + if (this._mutationType != null) { + collectReferencedTypes(this._mutationType, allReferencedTypes); + } + if (this._subscriptionType != null) { + collectReferencedTypes(this._subscriptionType, allReferencedTypes); + } + for (const directive of this._directives) { + if (isDirective(directive)) { + for (const arg of directive.args) { + collectReferencedTypes(arg.type, allReferencedTypes); + } + } + } + collectReferencedTypes(__Schema, allReferencedTypes); + this._typeMap = Object.create(null); + this._subTypeMap = new Map(); + this._implementationsMap = Object.create(null); + for (const namedType of allReferencedTypes) { + if (namedType == null) { + continue; + } + const typeName = namedType.name; + if (this._typeMap[typeName] !== undefined) { + throw new Error(`Schema must contain uniquely named types but contains multiple types named "${typeName}".`); + } + this._typeMap[typeName] = namedType; + if (isInterfaceType(namedType)) { + for (const iface of namedType.getInterfaces()) { + if (isInterfaceType(iface)) { + let implementations = this._implementationsMap[iface.name]; + implementations ??= this._implementationsMap[iface.name] = { + objects: [], + interfaces: [], + }; + implementations.interfaces.push(namedType); + } + } + } + else if (isObjectType(namedType)) { + for (const iface of namedType.getInterfaces()) { + if (isInterfaceType(iface)) { + let implementations = this._implementationsMap[iface.name]; + implementations ??= this._implementationsMap[iface.name] = { + objects: [], + interfaces: [], + }; + implementations.objects.push(namedType); + } + } + } + } + } + get [Symbol.toStringTag]() { + return 'GraphQLSchema'; + } + getQueryType() { + return this._queryType; + } + getMutationType() { + return this._mutationType; + } + getSubscriptionType() { + return this._subscriptionType; + } + getRootType(operation) { + switch (operation) { + case OperationTypeNode.QUERY: + return this.getQueryType(); + case OperationTypeNode.MUTATION: + return this.getMutationType(); + case OperationTypeNode.SUBSCRIPTION: + return this.getSubscriptionType(); + } + } + getTypeMap() { + return this._typeMap; + } + getType(name) { + return this.getTypeMap()[name]; + } + getPossibleTypes(abstractType) { + return isUnionType(abstractType) + ? abstractType.getTypes() + : this.getImplementations(abstractType).objects; + } + getImplementations(interfaceType) { + const implementations = this._implementationsMap[interfaceType.name]; + return implementations ?? { objects: [], interfaces: [] }; + } + isSubType(abstractType, maybeSubType) { + let set = this._subTypeMap.get(abstractType); + if (set === undefined) { + if (isUnionType(abstractType)) { + set = new Set(abstractType.getTypes()); + } + else { + const implementations = this.getImplementations(abstractType); + set = new Set([ + ...implementations.objects, + ...implementations.interfaces, + ]); + } + this._subTypeMap.set(abstractType, set); + } + return set.has(maybeSubType); + } + getDirectives() { + return this._directives; + } + getDirective(name) { + return this.getDirectives().find((directive) => directive.name === name); + } + getField(parentType, fieldName) { + switch (fieldName) { + case SchemaMetaFieldDef.name: + return this.getQueryType() === parentType + ? SchemaMetaFieldDef + : undefined; + case TypeMetaFieldDef.name: + return this.getQueryType() === parentType + ? TypeMetaFieldDef + : undefined; + case TypeNameMetaFieldDef.name: + return TypeNameMetaFieldDef; + } + if ('getFields' in parentType) { + return parentType.getFields()[fieldName]; + } + return undefined; + } + toConfig() { + return { + description: this.description, + query: this.getQueryType(), + mutation: this.getMutationType(), + subscription: this.getSubscriptionType(), + types: Object.values(this.getTypeMap()), + directives: this.getDirectives(), + extensions: this.extensions, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes, + assumeValid: this.assumeValid, + }; + } +} +function collectReferencedTypes(type, typeSet) { + const namedType = getNamedType(type); + if (!typeSet.has(namedType)) { + typeSet.add(namedType); + if (isUnionType(namedType)) { + for (const memberType of namedType.getTypes()) { + collectReferencedTypes(memberType, typeSet); + } + } + else if (isObjectType(namedType) || isInterfaceType(namedType)) { + for (const interfaceType of namedType.getInterfaces()) { + collectReferencedTypes(interfaceType, typeSet); + } + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + for (const arg of field.args) { + collectReferencedTypes(arg.type, typeSet); + } + } + } + else if (isInputObjectType(namedType)) { + for (const field of Object.values(namedType.getFields())) { + collectReferencedTypes(field.type, typeSet); + } + } + } + return typeSet; +} +//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs.map new file mode 100644 index 00000000..fb823ff8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/schema.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"schema.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f.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { toObjMapWithSymbols } from '../jsutils/toObjMap.ts';\n\nimport type { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n SchemaDefinitionNode,\n SchemaExtensionNode,\n} from '../language/ast.ts';\nimport { OperationTypeNode } from '../language/ast.ts';\n\nimport type {\n GraphQLAbstractType,\n GraphQLCompositeType,\n GraphQLField,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n GraphQLType,\n} from './definition.ts';\nimport {\n getNamedType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isUnionType,\n} from './definition.ts';\nimport type { GraphQLDirective } from './directives.ts';\nimport { isDirective, specifiedDirectives } from './directives.ts';\nimport {\n __Schema,\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n} from './introspection.ts';\n\n/**\n * Test if the given value is a GraphQL schema.\n * @param schema - Value to inspect.\n * @returns True when the value is a GraphQLSchema.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLString, isSchema } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * isSchema(schema); // => true\n * isSchema(GraphQLString); // => false\n * ```\n */\nexport function isSchema(schema: unknown): schema is GraphQLSchema {\n return instanceOf(schema, schemaSymbol, GraphQLSchema);\n}\n\n/**\n * Returns the value as a GraphQLSchema, or throws if it is not a schema.\n * @param schema - GraphQL schema to use.\n * @returns The value typed as a GraphQLSchema.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertSchema, GraphQLString } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * assertSchema(schema); // => schema\n * assertSchema(GraphQLString); // throws an error\n * ```\n */\nexport function assertSchema(schema: unknown): GraphQLSchema {\n if (!isSchema(schema)) {\n throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`);\n }\n return schema;\n}\n\n/**\n * Custom extensions\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\nexport interface GraphQLSchemaExtensions {\n [attributeName: string | symbol]: unknown;\n}\n\n/** @private */\nconst schemaSymbol: unique symbol = Symbol('Schema');\n\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n * @example\n * ```ts\n * const MyAppQueryRootType = new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * greeting: { type: GraphQLString },\n * },\n * });\n *\n * const MyAppMutationRootType = new GraphQLObjectType({\n * name: 'Mutation',\n * fields: {\n * setGreeting: { type: GraphQLString },\n * },\n * });\n *\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * });\n * ```\n * @example\n * When the schema is constructed, by default only the types that are reachable\n * by traversing the root types are included, other types must be explicitly\n * referenced.\n *\n * ```ts\n * const characterInterface = new GraphQLInterfaceType({\n * name: 'Character',\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const humanType = new GraphQLObjectType({\n * name: 'Human',\n * interfaces: [characterInterface],\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const droidType = new GraphQLObjectType({\n * name: 'Droid',\n * interfaces: [characterInterface],\n * fields: {\n * name: { type: GraphQLString },\n * },\n * });\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * hero: { type: characterInterface },\n * },\n * }),\n * // Since this schema references only the `Character` interface it's\n * // necessary to explicitly list the types that implement it if\n * // you want them to be included in the final schema.\n * types: [humanType, droidType],\n * });\n * ```\n * @example\n * If an array of `directives` are provided to GraphQLSchema, that will be the\n * exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. `@include` and\n * `@skip`) will be used. If you wish to provide *additional* directives to\n * these specified directives, you must explicitly declare them.\n *\n * ```ts\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * directives: specifiedDirectives.concat([myCustomDirective]),\n * });\n * ```\n */\nexport class GraphQLSchema {\n /**\n * Internal runtime marker used to identify GraphQLSchema instances.\n * @private\n */\n readonly __kind: typeof schemaSymbol = schemaSymbol;\n /** Human-readable description for this schema element, if provided. */\n description: Maybe;\n /** Custom extension fields reserved for users. */\n extensions: Readonly;\n /** AST node from which this schema element was built, if available. */\n astNode: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes: ReadonlyArray;\n\n /** Whether this schema instance skips validation checks. */\n assumeValid: boolean;\n /**\n * Cached schema validation errors, if validation has already run.\n * @private\n */\n __validationErrors: Maybe>;\n\n private _queryType: Maybe;\n private _mutationType: Maybe;\n private _subscriptionType: Maybe;\n private _directives: ReadonlyArray;\n private _typeMap: TypeMap;\n private _subTypeMap: Map<\n GraphQLAbstractType,\n Set\n >;\n\n private _implementationsMap: ObjMap<{\n objects: Array;\n interfaces: Array;\n }>;\n\n /**\n * Creates a GraphQLSchema instance.\n * @param config - Configuration describing this object.\n * @example\n * ```ts\n * // Create a schema with the required query root.\n * import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * greeting: {\n * type: GraphQLString,\n * resolve: () => 'Hello',\n * },\n * },\n * });\n *\n * const schema = new GraphQLSchema({\n * description: 'The application schema.',\n * query: Query,\n * });\n *\n * schema.getQueryType(); // => Query\n * schema.description; // => 'The application schema.'\n * ```\n * @example\n * ```ts\n * // This variant configures every schema option, including directives and extensions.\n * import { DirectiveLocation, parse } from 'graphql/language';\n * import {\n * GraphQLBoolean,\n * GraphQLDirective,\n * GraphQLObjectType,\n * GraphQLSchema,\n * GraphQLString,\n * } from 'graphql/type';\n *\n * const Query = new GraphQLObjectType({\n * name: 'Query',\n * fields: { greeting: { type: GraphQLString } },\n * });\n * const Mutation = new GraphQLObjectType({\n * name: 'Mutation',\n * fields: { setGreeting: { type: GraphQLString } },\n * });\n * const Subscription = new GraphQLObjectType({\n * name: 'Subscription',\n * fields: { greetingChanged: { type: GraphQLString } },\n * });\n * const AuditEvent = new GraphQLObjectType({\n * name: 'AuditEvent',\n * fields: { message: { type: GraphQLString } },\n * });\n * const authDirective = new GraphQLDirective({\n * name: 'auth',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: { required: { type: GraphQLBoolean } },\n * });\n * const schemaDocument = parse(`\n * schema {\n * query: Query\n * mutation: Mutation\n * subscription: Subscription\n * }\n *\n * extend schema @auth\n * `);\n *\n * const schema = new GraphQLSchema({\n * description: 'Operations exposed by the application.',\n * query: Query,\n * mutation: Mutation,\n * subscription: Subscription,\n * types: [AuditEvent],\n * directives: [authDirective],\n * extensions: { owner: 'platform' },\n * astNode: schemaDocument.definitions[0],\n * extensionASTNodes: [schemaDocument.definitions[1]],\n * assumeValid: true,\n * });\n *\n * schema.getMutationType(); // => Mutation\n * schema.getSubscriptionType(); // => Subscription\n * schema.getType('AuditEvent'); // => AuditEvent\n * schema.getDirective('auth'); // => authDirective\n * schema.extensions; // => { owner: 'platform' }\n * ```\n */\n constructor(config: Readonly) {\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.assumeValid = config.assumeValid ?? false;\n // Used as a cache for validateSchema().\n this.__validationErrors = config.assumeValid === true ? [] : undefined;\n\n this.description = config.description;\n this.extensions = toObjMapWithSymbols(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes ?? [];\n\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription;\n // Provide specified directives (e.g. @include and @skip) by default.\n this._directives = config.directives ?? specifiedDirectives;\n\n // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n const allReferencedTypes = new Set(config.types);\n if (config.types != null) {\n for (const type of config.types) {\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (const directive of this._directives) {\n // Directives are not validated until validateSchema() is called.\n if (isDirective(directive)) {\n for (const arg of directive.args) {\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n collectReferencedTypes(__Schema, allReferencedTypes);\n\n // Storing the resulting map for reference by the schema.\n this._typeMap = Object.create(null);\n this._subTypeMap = new Map();\n // Keep track of all implementations by interface name.\n this._implementationsMap = Object.create(null);\n\n for (const namedType of allReferencedTypes) {\n if (namedType == null) {\n continue;\n }\n\n const typeName = namedType.name;\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\n `Schema must contain uniquely named types but contains multiple types named \"${typeName}\".`,\n );\n }\n this._typeMap[typeName] = namedType;\n\n if (isInterfaceType(namedType)) {\n // Store implementations by interface.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n implementations ??= this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (isObjectType(namedType)) {\n // Store implementations by objects.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n implementations ??= this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n\n implementations.objects.push(namedType);\n }\n }\n }\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'GraphQLSchema';\n }\n\n /**\n * Returns the root object type for query operations.\n * @returns The query root type, if this schema defines one.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * schema.getQueryType()?.name; // => 'Query'\n * ```\n */\n getQueryType(): Maybe {\n return this._queryType;\n }\n\n /**\n * Returns the root object type for mutation operations.\n * @returns The mutation root type, if this schema defines one.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n *\n * type Mutation {\n * setGreeting(value: String!): String\n * }\n * `);\n *\n * schema.getMutationType()?.name; // => 'Mutation'\n * ```\n */\n getMutationType(): Maybe {\n return this._mutationType;\n }\n\n /**\n * Returns the root object type for subscription operations.\n * @returns The subscription root type, if this schema defines one.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n *\n * type Subscription {\n * greetings: String\n * }\n * `);\n *\n * schema.getSubscriptionType()?.name; // => 'Subscription'\n * ```\n */\n getSubscriptionType(): Maybe {\n return this._subscriptionType;\n }\n\n /**\n * Returns the root object type for the requested operation kind.\n * @param operation - Operation kind to resolve.\n * @returns The root object type for the operation kind, if this schema defines one.\n * @example\n * ```ts\n * import { OperationTypeNode } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n *\n * type Mutation {\n * setGreeting(value: String!): String\n * }\n * `);\n *\n * schema.getRootType(OperationTypeNode.QUERY)?.name; // => 'Query'\n * schema.getRootType(OperationTypeNode.MUTATION)?.name; // => 'Mutation'\n * schema.getRootType(OperationTypeNode.SUBSCRIPTION); // => undefined\n * ```\n */\n getRootType(operation: OperationTypeNode): Maybe {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return this.getQueryType();\n case OperationTypeNode.MUTATION:\n return this.getMutationType();\n case OperationTypeNode.SUBSCRIPTION:\n return this.getSubscriptionType();\n }\n }\n\n /**\n * Returns all named types known to this schema.\n * @returns A map of schema types keyed by type name.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * const typeMap = schema.getTypeMap();\n *\n * typeMap.User.name; // => 'User'\n * typeMap.Query.name; // => 'Query'\n * typeMap.String.name; // => 'String'\n * ```\n */\n getTypeMap(): TypeMap {\n return this._typeMap;\n }\n\n /**\n * Returns the named type with the provided name.\n * @param name - The GraphQL name to look up.\n * @returns The named schema type, if one exists.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * schema.getType('User')?.toString(); // => 'User'\n * schema.getType('Missing'); // => undefined\n * ```\n */\n getType(name: string): GraphQLNamedType | undefined {\n return this.getTypeMap()[name];\n }\n\n /**\n * Returns object types that may be returned for an abstract type.\n * @param abstractType - Interface or union type to inspect.\n * @returns Object types that may satisfy the abstract type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType, assertUnionType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Organization implements Node {\n * id: ID!\n * }\n *\n * union SearchResult = User | Organization\n *\n * type Query {\n * node: Node\n * search: [SearchResult]\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const SearchResult = assertUnionType(schema.getType('SearchResult'));\n *\n * schema.getPossibleTypes(Node).map((type) => type.name); // => ['User', 'Organization']\n * schema.getPossibleTypes(SearchResult).map((type) => type.name); // => ['User', 'Organization']\n * ```\n */\n getPossibleTypes(\n abstractType: GraphQLAbstractType,\n ): ReadonlyArray {\n return isUnionType(abstractType)\n ? abstractType.getTypes()\n : this.getImplementations(abstractType).objects;\n }\n\n /**\n * Returns objects and interfaces that implement an interface type.\n * @param interfaceType - Interface type to inspect.\n * @returns Object and interface implementations of the interface.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Resource {\n * url: String!\n * }\n *\n * interface Image implements Resource {\n * url: String!\n * width: Int\n * }\n *\n * type Photo implements Resource & Image {\n * url: String!\n * width: Int\n * }\n *\n * type Query {\n * resource: Resource\n * }\n * `);\n *\n * const Resource = assertInterfaceType(schema.getType('Resource'));\n * const implementations = schema.getImplementations(Resource);\n *\n * implementations.interfaces.map((type) => type.name); // => ['Image']\n * implementations.objects.map((type) => type.name); // => ['Photo']\n * ```\n */\n getImplementations(interfaceType: GraphQLInterfaceType): {\n objects: ReadonlyArray;\n interfaces: ReadonlyArray;\n } {\n const implementations = this._implementationsMap[interfaceType.name];\n return implementations ?? { objects: [], interfaces: [] };\n }\n\n /**\n * Returns whether one type is a possible runtime subtype of an abstract type.\n * @param abstractType - Interface or union type to inspect.\n * @param maybeSubType - Object or interface type to test as a possible subtype.\n * @returns True when the subtype may satisfy the abstract type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertInterfaceType, assertObjectType } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Review {\n * body: String\n * }\n *\n * type Query {\n * node: Node\n * review: Review\n * }\n * `);\n *\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const User = assertObjectType(schema.getType('User'));\n * const Review = assertObjectType(schema.getType('Review'));\n *\n * schema.isSubType(Node, User); // => true\n * schema.isSubType(Node, Review); // => false\n * ```\n */\n isSubType(\n abstractType: GraphQLAbstractType,\n maybeSubType: GraphQLObjectType | GraphQLInterfaceType,\n ): boolean {\n let set = this._subTypeMap.get(abstractType);\n if (set === undefined) {\n if (isUnionType(abstractType)) {\n set = new Set(abstractType.getTypes());\n } else {\n const implementations = this.getImplementations(abstractType);\n set = new Set([\n ...implementations.objects,\n ...implementations.interfaces,\n ]);\n }\n\n this._subTypeMap.set(abstractType, set);\n }\n return set.has(maybeSubType);\n }\n\n /**\n * Returns directives available in this schema.\n * @returns Directives available in this schema.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @upper on FIELD_DEFINITION\n *\n * type Query {\n * greeting: String @upper\n * }\n * `);\n *\n * schema.getDirectives().map((directive) => directive.name); // => ['include', 'skip', 'deprecated', 'specifiedBy', 'oneOf', 'upper']\n * ```\n */\n getDirectives(): ReadonlyArray {\n return this._directives;\n }\n\n /**\n * Returns the current directive definition.\n * @param name - The GraphQL name to look up.\n * @returns The current directive definition, if known.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @upper on FIELD_DEFINITION\n *\n * type Query {\n * greeting: String @upper\n * }\n * `);\n *\n * schema.getDirective('upper')?.name; // => 'upper'\n * schema.getDirective('missing'); // => undefined\n * ```\n */\n getDirective(name: string): Maybe {\n return this.getDirectives().find((directive) => directive.name === name);\n }\n\n /**\n * This method looks up the field on the given type definition.\n * It has special casing for the three introspection fields, `__schema`,\n * `__type` and `__typename`.\n *\n * `__typename` is special because it can always be queried as a field, even\n * in situations where no other fields are allowed, like on a Union.\n *\n * `__schema` and `__type` could get automatically added to the query type,\n * but that would require mutating type definitions, which would cause issues.\n * @param parentType - Composite type to look up the field on.\n * @param fieldName - Field name to look up.\n * @returns The field definition, including supported introspection fields.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const queryType = schema.getQueryType();\n *\n * schema.getField(queryType, 'greeting')?.name; // => 'greeting'\n * schema.getField(queryType, '__typename')?.name; // => '__typename'\n * schema.getField(queryType, 'missing'); // => undefined\n * ```\n */\n getField(\n parentType: GraphQLCompositeType,\n fieldName: string,\n ): GraphQLField | undefined {\n switch (fieldName) {\n case SchemaMetaFieldDef.name:\n return this.getQueryType() === parentType\n ? SchemaMetaFieldDef\n : undefined;\n case TypeMetaFieldDef.name:\n return this.getQueryType() === parentType\n ? TypeMetaFieldDef\n : undefined;\n case TypeNameMetaFieldDef.name:\n return TypeNameMetaFieldDef;\n }\n\n // this function is part \"hot\" path inside executor and check presence\n // of 'getFields' is faster than to use `!isUnionType`\n if ('getFields' in parentType) {\n return parentType.getFields()[fieldName];\n }\n return undefined;\n }\n\n /**\n * Returns a normalized configuration object for this object.\n *\n * The returned config preserves the original `assumeValid` flag so the schema\n * can be recreated with the same validation behavior.\n * @returns A configuration object that can be used to recreate this object.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { GraphQLSchema } from 'graphql/type';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const config = schema.toConfig();\n * const schemaCopy = new GraphQLSchema(config);\n *\n * config.query?.name; // => 'Query'\n * schemaCopy.getQueryType()?.name; // => 'Query'\n * ```\n */\n toConfig(): GraphQLSchemaNormalizedConfig {\n return {\n description: this.description,\n query: this.getQueryType(),\n mutation: this.getMutationType(),\n subscription: this.getSubscriptionType(),\n types: Object.values(this.getTypeMap()),\n directives: this.getDirectives(),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n assumeValid: this.assumeValid,\n };\n }\n}\n\ntype TypeMap = ObjMap;\n\n/** @internal */\nexport interface GraphQLSchemaValidationOptions {\n /**\n * When building a schema from a GraphQL service's introspection result, it\n * might be safe to assume the schema is valid. Set to true to assume the\n * produced schema is valid.\n *\n * Default: false\n *\n * @internal\n */\n assumeValid?: boolean | undefined;\n}\n\n/** Configuration used to construct a GraphQLSchema. */\nexport interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {\n /** Human-readable description for this schema element, if provided. */\n description?: Maybe;\n /** Root object type for query operations. */\n query?: Maybe;\n /** Root object type for mutation operations. */\n mutation?: Maybe;\n /** Root object type for subscription operations. */\n subscription?: Maybe;\n /** Object types that belong to this union type. */\n types?: Maybe>;\n /** Directives available in this schema or applied to this AST node. */\n directives?: Maybe>;\n /** Custom extension fields reserved for users. */\n extensions?: Maybe>;\n /** AST node from which this schema element was built, if available. */\n astNode?: Maybe;\n /** AST extension nodes applied to this schema element. */\n extensionASTNodes?: Maybe>;\n}\n\n/** @internal */\nexport interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig {\n description: Maybe;\n types: ReadonlyArray;\n directives: ReadonlyArray;\n extensions: Readonly;\n extensionASTNodes: ReadonlyArray;\n assumeValid: boolean;\n}\n\nfunction collectReferencedTypes(\n type: GraphQLType,\n typeSet: Set,\n): Set {\n const namedType = getNamedType(type);\n\n if (!typeSet.has(namedType)) {\n typeSet.add(namedType);\n if (isUnionType(namedType)) {\n for (const memberType of namedType.getTypes()) {\n collectReferencedTypes(memberType, typeSet);\n }\n } else if (isObjectType(namedType) || isInterfaceType(namedType)) {\n for (const interfaceType of namedType.getInterfaces()) {\n collectReferencedTypes(interfaceType, typeSet);\n }\n\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n for (const arg of field.args) {\n collectReferencedTypes(arg.type, typeSet);\n }\n }\n } else if (isInputObjectType(namedType)) {\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n }\n }\n }\n\n return typeSet;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.mts new file mode 100644 index 00000000..f3a90152 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.mts @@ -0,0 +1,50 @@ +/** @category Validation */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import type { GraphQLDefaultInput, GraphQLInputType } from "./definition.mjs"; +import type { GraphQLSchema } from "./schema.mjs"; +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + * @param schema - GraphQL schema to use. + * @returns Schema validation errors, or an empty array when the schema is valid. + * @example + * ```ts + * import { validateSchema } from 'graphql/type'; + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * const errors = validateSchema(schema); + * + * errors; // => [] + * ``` + */ +export declare function validateSchema(schema: GraphQLSchema): ReadonlyArray; +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + * @param schema - GraphQL schema to use. + * @example + * ```ts + * import { assertValidSchema } from 'graphql/type'; + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * assertValidSchema(schema); // does not throw + * ``` + */ +export declare function assertValidSchema(schema: GraphQLSchema): void; +/** @internal */ +export declare function validateDefaultInput(defaultInput: GraphQLDefaultInput, inputType: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray) => void, hideSuggestions?: Maybe): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.ts new file mode 100644 index 00000000..3cf02baa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.d.ts @@ -0,0 +1,50 @@ +/** @category Validation */ +import type { Maybe } from "../jsutils/Maybe.js"; +import { GraphQLError } from "../error/GraphQLError.js"; +import type { GraphQLDefaultInput, GraphQLInputType } from "./definition.js"; +import type { GraphQLSchema } from "./schema.js"; +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + * @param schema - GraphQL schema to use. + * @returns Schema validation errors, or an empty array when the schema is valid. + * @example + * ```ts + * import { validateSchema } from 'graphql/type'; + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * const errors = validateSchema(schema); + * + * errors; // => [] + * ``` + */ +export declare function validateSchema(schema: GraphQLSchema): ReadonlyArray; +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + * @param schema - GraphQL schema to use. + * @example + * ```ts + * import { assertValidSchema } from 'graphql/type'; + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * assertValidSchema(schema); // does not throw + * ``` + */ +export declare function assertValidSchema(schema: GraphQLSchema): void; +/** @internal */ +export declare function validateDefaultInput(defaultInput: GraphQLDefaultInput, inputType: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray) => void, hideSuggestions?: Maybe): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js new file mode 100644 index 00000000..4a58e9bc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js @@ -0,0 +1,593 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSchema = validateSchema; +exports.assertValidSchema = assertValidSchema; +exports.validateDefaultInput = validateDefaultInput; +const AccumulatorMap_ts_1 = require("../jsutils/AccumulatorMap.js"); +const capitalize_ts_1 = require("../jsutils/capitalize.js"); +const formatList_ts_1 = require("../jsutils/formatList.js"); +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const isIterableObject_ts_1 = require("../jsutils/isIterableObject.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const keyMap_ts_1 = require("../jsutils/keyMap.js"); +const mapValue_ts_1 = require("../jsutils/mapValue.js"); +const printPathArray_ts_1 = require("../jsutils/printPathArray.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const ast_ts_1 = require("../language/ast.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const typeComparators_ts_1 = require("../utilities/typeComparators.js"); +const validateInputValue_ts_1 = require("../utilities/validateInputValue.js"); +const definition_ts_1 = require("./definition.js"); +const directives_ts_1 = require("./directives.js"); +const introspection_ts_1 = require("./introspection.js"); +const schema_ts_1 = require("./schema.js"); +function validateSchema(schema) { + (0, schema_ts_1.assertSchema)(schema); + if (schema.__validationErrors) { + return schema.__validationErrors; + } + const context = new SchemaValidationContext(schema); + validateRootTypes(context); + validateDirectives(context); + validateTypes(context); + const errors = context.getErrors(); + schema.__validationErrors = errors; + return errors; +} +function assertValidSchema(schema) { + const errors = validateSchema(schema); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} +class SchemaValidationContext { + constructor(schema) { + this._errors = []; + this.schema = schema; + } + reportError(message, nodes) { + const _nodes = Array.isArray(nodes) + ? nodes.filter(Boolean) + : nodes; + this._errors.push(new GraphQLError_ts_1.GraphQLError(message, { nodes: _nodes })); + } + getErrors() { + return this._errors; + } +} +function validateRootTypes(context) { + const schema = context.schema; + if (schema.getQueryType() == null) { + context.reportError('Query root type must be provided.', schema.astNode); + } + const rootTypesMap = new AccumulatorMap_ts_1.AccumulatorMap(); + for (const operationType of Object.values(ast_ts_1.OperationTypeNode)) { + const rootType = schema.getRootType(operationType); + if (rootType != null) { + if (!(0, definition_ts_1.isObjectType)(rootType)) { + const operationTypeStr = (0, capitalize_ts_1.capitalize)(operationType); + const rootTypeStr = (0, inspect_ts_1.inspect)(rootType); + context.reportError(operationType === ast_ts_1.OperationTypeNode.QUERY + ? `${operationTypeStr} root type must be Object type, it cannot be ${rootTypeStr}.` + : `${operationTypeStr} root type must be Object type if provided, it cannot be ${rootTypeStr}.`, getOperationTypeNode(schema, operationType) ?? + rootType.astNode); + } + else { + rootTypesMap.add(rootType, operationType); + } + } + } + for (const [rootType, operationTypes] of rootTypesMap) { + if (operationTypes.length > 1) { + const operationList = (0, formatList_ts_1.andList)(operationTypes); + context.reportError(`All root types must be different, "${rootType}" type is used as ${operationList} root types.`, operationTypes.map((operationType) => getOperationTypeNode(schema, operationType))); + } + } +} +function getOperationTypeNode(schema, operation) { + return [schema.astNode, ...schema.extensionASTNodes] + .flatMap((schemaNode) => schemaNode?.operationTypes ?? []) + .find((operationNode) => operationNode.operation === operation)?.type; +} +function validateDirectives(context) { + for (const directive of context.schema.getDirectives()) { + if (!(0, directives_ts_1.isDirective)(directive)) { + context.reportError(`Expected directive but got: ${(0, inspect_ts_1.inspect)(directive)}.`, directive?.astNode); + continue; + } + validateName(context, directive); + if (directive.locations.length === 0) { + context.reportError(`Directive ${directive} must include 1 or more locations.`, directive.astNode); + } + for (const arg of directive.args) { + validateName(context, arg); + if (!(0, definition_ts_1.isInputType)(arg.type)) { + context.reportError(`The type of ${arg} must be Input Type ` + + `but got: ${(0, inspect_ts_1.inspect)(arg.type)}.`, arg.astNode); + } + if ((0, definition_ts_1.isRequiredArgument)(arg) && arg.deprecationReason != null) { + context.reportError(`Required argument ${arg} cannot be deprecated.`, [ + getDeprecatedDirectiveNode(arg.astNode), + arg.astNode?.type, + ]); + } + validateDefaultValue(context, arg); + } + } +} +function validateDefaultValue(context, inputValue) { + const defaultInput = inputValue.default; + if (!defaultInput) { + return; + } + const errors = []; + validateDefaultInput(defaultInput, inputValue.type, (error, path) => { + errors.push([error, path]); + }); + if (errors.length === 0) { + return; + } + if (!defaultInput.literal) { + try { + const uncoercedValue = uncoerceDefaultValue(defaultInput.value, inputValue.type); + const uncoercedErrors = []; + (0, validateInputValue_ts_1.validateInputValue)(uncoercedValue, inputValue.type, (error, path) => { + uncoercedErrors.push([error, path]); + }); + if (uncoercedErrors.length === 0) { + context.reportError(`${inputValue} has invalid default value: ${(0, inspect_ts_1.inspect)(defaultInput.value)}. Did you mean: ${(0, inspect_ts_1.inspect)(uncoercedValue)}?`, inputValue.astNode?.defaultValue); + return; + } + } + catch (_error) { + } + } + for (const [error, path] of errors) { + context.reportError(`${inputValue} has invalid default value${(0, printPathArray_ts_1.printPathArray)(path)}: ${error.message}`, error.nodes ?? inputValue.astNode?.defaultValue); + } +} +function validateDefaultInput(defaultInput, inputType, onError, hideSuggestions) { + if (defaultInput.literal) { + (0, validateInputValue_ts_1.validateInputLiteral)(defaultInput.literal, inputType, onError, undefined, undefined, hideSuggestions); + return; + } + (0, validateInputValue_ts_1.validateInputValue)(defaultInput.value, inputType, onError, hideSuggestions); +} +function uncoerceDefaultValue(value, type) { + if ((0, definition_ts_1.isNonNullType)(type)) { + return uncoerceDefaultValue(value, type.ofType); + } + if (value === null) { + return null; + } + if ((0, definition_ts_1.isListType)(type)) { + if ((0, isIterableObject_ts_1.isIterableObject)(value)) { + return Array.from(value, (itemValue) => uncoerceDefaultValue(itemValue, type.ofType)); + } + return [uncoerceDefaultValue(value, type.ofType)]; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + if (!((0, isObjectLike_ts_1.isObjectLike)(value))) + (0, invariant_ts_1.invariant)(false); + const fieldDefs = type.getFields(); + return (0, mapValue_ts_1.mapValue)(value, (fieldValue, fieldName) => { + if (!(fieldName in fieldDefs)) + (0, invariant_ts_1.invariant)(false); + return uncoerceDefaultValue(fieldValue, fieldDefs[fieldName].type); + }); + } + (0, definition_ts_1.assertLeafType)(type); + return type.coerceOutputValue(value); +} +function validateName(context, node) { + if (node.name.startsWith('__')) { + context.reportError(`Name "${node.name}" must not begin with "__", which is reserved by GraphQL introspection.`, node.astNode); + } +} +function validateTypes(context) { + const validateInputObjectDefaultValueCircularRefs = createInputObjectDefaultValueCircularRefsValidator(context); + const typeMap = context.schema.getTypeMap(); + const finiteValueStates = new Map(); + for (const type of Object.values(typeMap)) { + if (!(0, definition_ts_1.isNamedType)(type)) { + context.reportError(`Expected GraphQL named type but got: ${(0, inspect_ts_1.inspect)(type)}.`, type.astNode); + continue; + } + if (!(0, introspection_ts_1.isIntrospectionType)(type)) { + validateName(context, type); + } + if ((0, definition_ts_1.isObjectType)(type)) { + validateFields(context, type); + validateInterfaces(context, type); + } + else if ((0, definition_ts_1.isInterfaceType)(type)) { + validateFields(context, type); + validateInterfaces(context, type); + } + else if ((0, definition_ts_1.isUnionType)(type)) { + validateUnionMembers(context, type); + } + else if ((0, definition_ts_1.isEnumType)(type)) { + validateEnumValues(context, type); + } + else if ((0, definition_ts_1.isInputObjectType)(type)) { + validateInputFields(context, type); + initializeInputObjectFiniteValueState(type); + validateInputObjectDefaultValueCircularRefs(type); + } + } + detectInputObjectNonFiniteValues(context, finiteValueStates); + function initializeInputObjectFiniteValueState(inputObj) { + finiteValueStates.set(inputObj, { + inputObj, + targets: [], + dependents: [], + unresolvedTargetCount: 0, + hasFiniteValue: false, + }); + } +} +function validateFields(context, type) { + const fields = Object.values(type.getFields()); + if (fields.length === 0) { + context.reportError(`Type ${type} must define one or more fields.`, [ + type.astNode, + ...type.extensionASTNodes, + ]); + } + for (const field of fields) { + validateName(context, field); + if (!(0, definition_ts_1.isOutputType)(field.type)) { + context.reportError(`The type of ${field} must be Output Type ` + + `but got: ${(0, inspect_ts_1.inspect)(field.type)}.`, field.astNode?.type); + } + for (const arg of field.args) { + validateName(context, arg); + if (!(0, definition_ts_1.isInputType)(arg.type)) { + context.reportError(`The type of ${arg} must be Input Type but got: ${(0, inspect_ts_1.inspect)(arg.type)}.`, arg.astNode?.type); + } + if ((0, definition_ts_1.isRequiredArgument)(arg) && arg.deprecationReason != null) { + context.reportError(`Required argument ${arg} cannot be deprecated.`, [ + getDeprecatedDirectiveNode(arg.astNode), + arg.astNode?.type, + ]); + } + validateDefaultValue(context, arg); + } + } +} +function validateInterfaces(context, type) { + const ifaceTypeNames = new Set(); + for (const iface of type.getInterfaces()) { + if (!(0, definition_ts_1.isInterfaceType)(iface)) { + context.reportError(`Type ${type} must only implement Interface types, ` + + `it cannot implement ${(0, inspect_ts_1.inspect)(iface)}.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + if (type === iface) { + context.reportError(`Type ${type} cannot implement itself because it would create a circular reference.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + if (ifaceTypeNames.has(iface.name)) { + context.reportError(`Type ${type} can only implement ${iface} once.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + ifaceTypeNames.add(iface.name); + validateTypeImplementsAncestors(context, type, iface); + validateTypeImplementsInterface(context, type, iface); + } +} +function validateTypeImplementsInterface(context, type, iface) { + const typeFieldMap = type.getFields(); + for (const ifaceField of Object.values(iface.getFields())) { + const typeField = typeFieldMap[ifaceField.name]; + if (typeField == null) { + context.reportError(`Interface field ${ifaceField} expected but ${type} does not provide it.`, [ifaceField.astNode, type.astNode, ...type.extensionASTNodes]); + continue; + } + if (!(0, typeComparators_ts_1.isTypeSubTypeOf)(context.schema, typeField.type, ifaceField.type)) { + context.reportError(`Interface field ${ifaceField} expects type ${ifaceField.type} ` + + `but ${typeField} is type ${typeField.type}.`, [ifaceField.astNode?.type, typeField.astNode?.type]); + } + for (const ifaceArg of ifaceField.args) { + const typeArg = typeField.args.find((arg) => arg.name === ifaceArg.name); + if (!typeArg) { + context.reportError(`Interface field argument ${ifaceArg} expected but ${typeField} does not provide it.`, [ifaceArg.astNode, typeField.astNode]); + continue; + } + if (!(0, typeComparators_ts_1.isEqualType)(ifaceArg.type, typeArg.type)) { + context.reportError(`Interface field argument ${ifaceArg} expects type ${ifaceArg.type} ` + + `but ${typeArg} is type ${typeArg.type}.`, [ifaceArg.astNode?.type, typeArg.astNode?.type]); + } + } + for (const typeArg of typeField.args) { + if ((0, definition_ts_1.isRequiredArgument)(typeArg)) { + const ifaceArg = ifaceField.args.find((arg) => arg.name === typeArg.name); + if (!ifaceArg) { + context.reportError(`Argument "${typeArg}" must not be required type "${typeArg.type}" ` + + `if not provided by the Interface field "${ifaceField}".`, [typeArg.astNode, ifaceField.astNode]); + } + } + } + if (typeField.deprecationReason != null && + ifaceField.deprecationReason == null) { + context.reportError(`Interface field ${iface.name}.${ifaceField.name} is not deprecated, so ` + + `implementation field ${type.name}.${typeField.name} must not be deprecated.`, [ + getDeprecatedDirectiveNode(typeField.astNode), + typeField.astNode?.type, + ]); + } + } +} +function validateTypeImplementsAncestors(context, type, iface) { + const ifaceInterfaces = type.getInterfaces(); + for (const transitive of iface.getInterfaces()) { + if (!ifaceInterfaces.includes(transitive)) { + context.reportError(transitive === type + ? `Type ${type} cannot implement ${iface} because it would create a circular reference.` + : `Type ${type} must implement ${transitive} because it is implemented by ${iface}.`, [ + ...getAllImplementsInterfaceNodes(iface, transitive), + ...getAllImplementsInterfaceNodes(type, iface), + ]); + } + } +} +function validateUnionMembers(context, union) { + const memberTypes = union.getTypes(); + if (memberTypes.length === 0) { + context.reportError(`Union type ${union} must define one or more member types.`, [union.astNode, ...union.extensionASTNodes]); + } + const includedTypeNames = new Set(); + for (const memberType of memberTypes) { + if (includedTypeNames.has(memberType.name)) { + context.reportError(`Union type ${union} can only include type ${memberType} once.`, getUnionMemberTypeNodes(union, memberType.name)); + continue; + } + includedTypeNames.add(memberType.name); + if (!(0, definition_ts_1.isObjectType)(memberType)) { + context.reportError(`Union type ${union} can only include Object types, ` + + `it cannot include ${(0, inspect_ts_1.inspect)(memberType)}.`, getUnionMemberTypeNodes(union, String(memberType))); + } + } +} +function validateEnumValues(context, enumType) { + const enumValues = enumType.getValues(); + if (enumValues.length === 0) { + context.reportError(`Enum type ${enumType} must define one or more values.`, [enumType.astNode, ...enumType.extensionASTNodes]); + } + for (const enumValue of enumValues) { + validateName(context, enumValue); + } +} +function validateInputFields(context, inputObj) { + const fields = Object.values(inputObj.getFields()); + if (fields.length === 0) { + context.reportError(`Input Object type ${inputObj} must define one or more fields.`, [inputObj.astNode, ...inputObj.extensionASTNodes]); + } + for (const field of fields) { + validateName(context, field); + if (!(0, definition_ts_1.isInputType)(field.type)) { + context.reportError(`The type of ${field} must be Input Type ` + + `but got: ${(0, inspect_ts_1.inspect)(field.type)}.`, field.astNode?.type); + } + if ((0, definition_ts_1.isRequiredInputField)(field) && field.deprecationReason != null) { + context.reportError(`Required input field ${field} cannot be deprecated.`, [getDeprecatedDirectiveNode(field.astNode), field.astNode?.type]); + } + validateDefaultValue(context, field); + if (inputObj.isOneOf) { + validateOneOfInputObjectField(inputObj, field, context); + } + } +} +function validateOneOfInputObjectField(type, field, context) { + if ((0, definition_ts_1.isNonNullType)(field.type)) { + context.reportError(`OneOf input field ${type}.${field.name} must be nullable.`, field.astNode?.type); + } + if (field.default !== undefined || field.defaultValue !== undefined) { + context.reportError(`OneOf input field ${type}.${field.name} cannot have a default value.`, field.astNode); + } +} +function detectInputObjectNonFiniteValues(context, finiteValueStates) { + const inputObjectsWithFiniteValues = []; + for (const state of finiteValueStates.values()) { + const inputObj = state.inputObj; + const fields = Object.values(inputObj.getFields()); + for (const field of fields) { + const target = getFiniteValueTarget(inputObj, field.type); + if (target === undefined) { + continue; + } + state.targets.push({ field, target }); + const targetState = finiteValueStates.get(target); + if (targetState !== undefined) { + targetState.dependents.push(state); + } + } + if (inputObj.isOneOf) { + if (fields.length === 0 || state.targets.length < fields.length) { + markInputObjectHasFiniteValue(state); + } + } + else { + state.unresolvedTargetCount = state.targets.length; + if (state.targets.length === 0) { + markInputObjectHasFiniteValue(state); + } + } + } + let nextFiniteValueState; + while ((nextFiniteValueState = inputObjectsWithFiniteValues.pop()) !== undefined) { + for (const dependentState of nextFiniteValueState.dependents) { + if (dependentState.hasFiniteValue) { + continue; + } + if (dependentState.inputObj.isOneOf) { + markInputObjectHasFiniteValue(dependentState); + continue; + } + --dependentState.unresolvedTargetCount; + if (dependentState.unresolvedTargetCount === 0) { + markInputObjectHasFiniteValue(dependentState); + } + } + } + const visitedTypes = new Set(); + const fieldPath = []; + const fieldPathIndexByType = new Map(); + for (const state of finiteValueStates.values()) { + if (!state.hasFiniteValue) { + reportCycleRecursive(state); + } + } + function markInputObjectHasFiniteValue(finiteValueState) { + if (!finiteValueState.hasFiniteValue) { + finiteValueState.hasFiniteValue = true; + inputObjectsWithFiniteValues.push(finiteValueState); + } + } + function reportCycleRecursive(state) { + const inputObj = state.inputObj; + if (visitedTypes.has(inputObj)) { + return; + } + visitedTypes.add(inputObj); + fieldPathIndexByType.set(inputObj, fieldPath.length); + for (const { field, target } of state.targets) { + const targetState = finiteValueStates.get(target); + if (targetState?.hasFiniteValue !== false) { + continue; + } + const cycleIndex = fieldPathIndexByType.get(target); + fieldPath.push({ + fieldStr: `${inputObj}.${field.name}`, + astNode: field.astNode, + }); + if (cycleIndex === undefined) { + reportCycleRecursive(targetState); + } + else { + const cyclePath = fieldPath.slice(cycleIndex); + const pathStr = cyclePath.map((p) => p.fieldStr).join(', '); + context.reportError(`Input Object ${target} cannot be provided a finite value because it references itself through fields: ${pathStr}.`, cyclePath.map((p) => p.astNode)); + } + fieldPath.pop(); + } + fieldPathIndexByType.delete(inputObj); + } +} +function getFiniteValueTarget(inputObj, fieldType) { + if (inputObj.isOneOf) { + if ((0, definition_ts_1.isInputObjectType)(fieldType)) { + return fieldType; + } + return; + } + if ((0, definition_ts_1.isNonNullType)(fieldType) && (0, definition_ts_1.isInputObjectType)(fieldType.ofType)) { + return fieldType.ofType; + } +} +function createInputObjectDefaultValueCircularRefsValidator(context) { + const visitedFields = Object.create(null); + const fieldPath = []; + const fieldPathIndex = Object.create(null); + return function validateInputObjectDefaultValueCircularRefs(inputObj) { + return detectValueDefaultValueCycle(inputObj, Object.create(null)); + }; + function detectValueDefaultValueCycle(inputObj, defaultValue) { + if ((0, isIterableObject_ts_1.isIterableObject)(defaultValue)) { + for (const itemValue of defaultValue) { + detectValueDefaultValueCycle(inputObj, itemValue); + } + return; + } + else if (!(0, isObjectLike_ts_1.isObjectLike)(defaultValue)) { + return; + } + for (const field of Object.values(inputObj.getFields())) { + const namedFieldType = (0, definition_ts_1.getNamedType)(field.type); + if (!(0, definition_ts_1.isInputObjectType)(namedFieldType)) { + continue; + } + if (Object.hasOwn(defaultValue, field.name)) { + detectValueDefaultValueCycle(namedFieldType, defaultValue[field.name]); + } + else { + detectFieldDefaultValueCycle(field, namedFieldType, `${inputObj}.${field.name}`); + } + } + } + function detectLiteralDefaultValueCycle(inputObj, defaultValue) { + if (defaultValue.kind === kinds_ts_1.Kind.LIST) { + for (const itemLiteral of defaultValue.values) { + detectLiteralDefaultValueCycle(inputObj, itemLiteral); + } + return; + } + else if (defaultValue.kind !== kinds_ts_1.Kind.OBJECT) { + return; + } + const fieldNodes = (0, keyMap_ts_1.keyMap)(defaultValue.fields, (field) => field.name.value); + for (const field of Object.values(inputObj.getFields())) { + const namedFieldType = (0, definition_ts_1.getNamedType)(field.type); + if (!(0, definition_ts_1.isInputObjectType)(namedFieldType)) { + continue; + } + if (Object.hasOwn(fieldNodes, field.name)) { + detectLiteralDefaultValueCycle(namedFieldType, fieldNodes[field.name].value); + } + else { + detectFieldDefaultValueCycle(field, namedFieldType, `${inputObj}.${field.name}`); + } + } + } + function detectFieldDefaultValueCycle(field, fieldType, fieldStr) { + const defaultInput = field.default; + if (defaultInput === undefined) { + return; + } + const cycleIndex = fieldPathIndex[fieldStr]; + if (cycleIndex !== undefined) { + context.reportError(`Invalid circular reference. The default value of Input Object field ${fieldStr} references itself${cycleIndex < fieldPath.length + ? ` via the default values of: ${fieldPath + .slice(cycleIndex) + .map(([stringForMessage]) => stringForMessage) + .join(', ')}` + : ''}.`, fieldPath.slice(cycleIndex - 1).map(([, node]) => node)); + return; + } + if (visitedFields[fieldStr] === undefined) { + visitedFields[fieldStr] = true; + fieldPathIndex[fieldStr] = fieldPath.push([ + fieldStr, + field.astNode?.defaultValue, + ]); + if (defaultInput.literal) { + detectLiteralDefaultValueCycle(fieldType, defaultInput.literal); + } + else { + detectValueDefaultValueCycle(fieldType, defaultInput.value); + } + fieldPath.pop(); + fieldPathIndex[fieldStr] = undefined; + } + } +} +function getAllImplementsInterfaceNodes(type, iface) { + const { astNode, extensionASTNodes } = type; + const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; + return nodes + .flatMap((typeNode) => typeNode.interfaces ?? []) + .filter((ifaceNode) => ifaceNode.name.value === iface.name); +} +function getUnionMemberTypeNodes(union, typeName) { + const { astNode, extensionASTNodes } = union; + const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; + return nodes + .flatMap((unionNode) => unionNode.types ?? []) + .filter((typeNode) => typeNode.name.value === typeName); +} +function getDeprecatedDirectiveNode(definitionNode) { + return definitionNode?.directives?.find((node) => node.name.value === directives_ts_1.GraphQLDeprecatedDirective.name); +} +//# sourceMappingURL=validate.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js.map new file mode 100644 index 00000000..5f082de5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/type/validate.ts"],"names":[],"mappings":";;AA6FA,wCAsBC;AAoBD,8CAKC;AA0LD,oDAkBC;AAtVD,oEAA8D;AAC9D,4DAAsD;AACtD,4DAAmD;AACnD,sDAAgD;AAChD,0DAAoD;AACpD,wEAAkE;AAClE,gEAA0D;AAC1D,oDAA8C;AAC9C,wDAAkD;AAGlD,oEAA8D;AAE9D,8DAAwD;AAcxD,+CAAuD;AACvD,mDAA4C;AAE5C,wEAA+E;AAC/E,8EAG4C;AAa5C,mDAeyB;AACzB,mDAA0E;AAC1E,yDAAyD;AAEzD,2CAA2C;AAyB3C,SAAgB,cAAc,CAC5B,MAAqB;IAGrB,IAAA,wBAAY,EAAC,MAAM,CAAC,CAAC;IAGrB,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAGD,MAAM,OAAO,GAAG,IAAI,uBAAuB,CAAC,MAA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;SACT,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;SAC7C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,0BAA0B,CACjC,cAEE;IAEF,OAAO,cAAc,EAAE,UAAU,EAAE,IAAI,CACrC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,0CAA0B,CAAC,IAAI,CAC9D,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation */\n\nimport { AccumulatorMap } from '../jsutils/AccumulatorMap.ts';\nimport { capitalize } from '../jsutils/capitalize.ts';\nimport { andList } from '../jsutils/formatList.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\nimport { mapValue } from '../jsutils/mapValue.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { printPathArray } from '../jsutils/printPathArray.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ASTNode,\n ConstValueNode,\n DirectiveNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n NamedTypeNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n} from '../language/ast.ts';\nimport { OperationTypeNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport { isEqualType, isTypeSubTypeOf } from '../utilities/typeComparators.ts';\nimport {\n validateInputLiteral,\n validateInputValue,\n} from '../utilities/validateInputValue.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLDefaultInput,\n GraphQLEnumType,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInputType,\n GraphQLInterfaceType,\n GraphQLObjectType,\n GraphQLUnionType,\n} from './definition.ts';\nimport {\n assertLeafType,\n getNamedType,\n isEnumType,\n isInputObjectType,\n isInputType,\n isInterfaceType,\n isListType,\n isNamedType,\n isNonNullType,\n isObjectType,\n isOutputType,\n isRequiredArgument,\n isRequiredInputField,\n isUnionType,\n} from './definition.ts';\nimport { GraphQLDeprecatedDirective, isDirective } from './directives.ts';\nimport { isIntrospectionType } from './introspection.ts';\nimport type { GraphQLSchema } from './schema.ts';\nimport { assertSchema } from './schema.ts';\n\n/**\n * Implements the \"Type Validation\" sub-sections of the specification's\n * \"Type System\" section.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the Schema is valid.\n * @param schema - GraphQL schema to use.\n * @returns Schema validation errors, or an empty array when the schema is valid.\n * @example\n * ```ts\n * import { validateSchema } from 'graphql/type';\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n * const errors = validateSchema(schema);\n *\n * errors; // => []\n * ```\n */\nexport function validateSchema(\n schema: GraphQLSchema,\n): ReadonlyArray {\n // First check to ensure the provided value is in fact a GraphQLSchema.\n assertSchema(schema);\n\n // If this Schema has already been validated, return the previous results.\n if (schema.__validationErrors) {\n return schema.__validationErrors;\n }\n\n // Validate the schema, producing a list of errors.\n const context = new SchemaValidationContext(schema);\n validateRootTypes(context);\n validateDirectives(context);\n validateTypes(context);\n\n // Persist the results of validation before returning to ensure validation\n // does not run multiple times for this schema.\n const errors = context.getErrors();\n schema.__validationErrors = errors;\n return errors;\n}\n\n/**\n * Utility function which asserts a schema is valid by throwing an error if\n * it is invalid.\n * @param schema - GraphQL schema to use.\n * @example\n * ```ts\n * import { assertValidSchema } from 'graphql/type';\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * assertValidSchema(schema); // does not throw\n * ```\n */\nexport function assertValidSchema(schema: GraphQLSchema): void {\n const errors = validateSchema(schema);\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n\nclass SchemaValidationContext {\n readonly _errors: Array;\n readonly schema: GraphQLSchema;\n\n constructor(schema: GraphQLSchema) {\n this._errors = [];\n this.schema = schema;\n }\n\n reportError(\n message: string,\n nodes?: ReadonlyArray> | Maybe,\n ): void {\n const _nodes = Array.isArray(nodes)\n ? (nodes.filter(Boolean) as ReadonlyArray)\n : (nodes as Maybe);\n this._errors.push(new GraphQLError(message, { nodes: _nodes }));\n }\n\n getErrors(): ReadonlyArray {\n return this._errors;\n }\n}\n\nfunction validateRootTypes(context: SchemaValidationContext): void {\n const schema = context.schema;\n\n if (schema.getQueryType() == null) {\n context.reportError('Query root type must be provided.', schema.astNode);\n }\n\n const rootTypesMap = new AccumulatorMap<\n GraphQLObjectType,\n OperationTypeNode\n >();\n for (const operationType of Object.values(OperationTypeNode)) {\n const rootType = schema.getRootType(operationType);\n\n if (rootType != null) {\n if (!isObjectType(rootType)) {\n const operationTypeStr = capitalize(operationType);\n const rootTypeStr = inspect(rootType);\n context.reportError(\n operationType === OperationTypeNode.QUERY\n ? `${operationTypeStr} root type must be Object type, it cannot be ${rootTypeStr}.`\n : `${operationTypeStr} root type must be Object type if provided, it cannot be ${rootTypeStr}.`,\n getOperationTypeNode(schema, operationType) ??\n (rootType as any).astNode,\n );\n } else {\n rootTypesMap.add(rootType, operationType);\n }\n }\n }\n\n for (const [rootType, operationTypes] of rootTypesMap) {\n if (operationTypes.length > 1) {\n const operationList = andList(operationTypes);\n context.reportError(\n `All root types must be different, \"${rootType}\" type is used as ${operationList} root types.`,\n operationTypes.map((operationType) =>\n getOperationTypeNode(schema, operationType),\n ),\n );\n }\n }\n}\n\nfunction getOperationTypeNode(\n schema: GraphQLSchema,\n operation: OperationTypeNode,\n): Maybe {\n return [schema.astNode, ...schema.extensionASTNodes]\n .flatMap((schemaNode) => schemaNode?.operationTypes ?? [])\n .find((operationNode) => operationNode.operation === operation)?.type;\n}\n\nfunction validateDirectives(context: SchemaValidationContext): void {\n for (const directive of context.schema.getDirectives()) {\n // Ensure all directives are in fact GraphQL directives.\n if (!isDirective(directive)) {\n context.reportError(\n `Expected directive but got: ${inspect(directive)}.`,\n (directive as any)?.astNode,\n );\n continue;\n }\n\n // Ensure they are named correctly.\n validateName(context, directive);\n\n if (directive.locations.length === 0) {\n context.reportError(\n `Directive ${directive} must include 1 or more locations.`,\n directive.astNode,\n );\n }\n\n // Ensure the arguments are valid.\n for (const arg of directive.args) {\n // Ensure they are named correctly.\n validateName(context, arg);\n\n // Ensure the type is an input type.\n if (!isInputType(arg.type)) {\n context.reportError(\n `The type of ${arg} must be Input Type ` +\n `but got: ${inspect(arg.type)}.`,\n arg.astNode,\n );\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n context.reportError(`Required argument ${arg} cannot be deprecated.`, [\n getDeprecatedDirectiveNode(arg.astNode),\n arg.astNode?.type,\n ]);\n }\n\n validateDefaultValue(context, arg);\n }\n }\n}\n\nfunction validateDefaultValue(\n context: SchemaValidationContext,\n inputValue: GraphQLArgument | GraphQLInputField,\n): void {\n const defaultInput = inputValue.default;\n\n if (!defaultInput) {\n return;\n }\n\n const errors: Array<[GraphQLError, ReadonlyArray]> = [];\n validateDefaultInput(defaultInput, inputValue.type, (error, path) => {\n errors.push([error, path]);\n });\n\n if (errors.length === 0) {\n return;\n }\n\n if (!defaultInput.literal) {\n // If there were validation errors, check to see if it can be \"uncoerced\"\n // and then correctly validated. If so, report a clear error with a path\n // to resolution.\n try {\n const uncoercedValue = uncoerceDefaultValue(\n defaultInput.value,\n inputValue.type,\n );\n\n const uncoercedErrors = [];\n validateInputValue(uncoercedValue, inputValue.type, (error, path) => {\n uncoercedErrors.push([error, path]);\n });\n\n if (uncoercedErrors.length === 0) {\n context.reportError(\n `${inputValue} has invalid default value: ${inspect(\n defaultInput.value,\n )}. Did you mean: ${inspect(uncoercedValue)}?`,\n inputValue.astNode?.defaultValue,\n );\n return;\n }\n } catch (_error) {\n // ignore\n }\n }\n\n // Otherwise report the original set of errors.\n for (const [error, path] of errors) {\n context.reportError(\n `${inputValue} has invalid default value${printPathArray(path)}: ${\n error.message\n }`,\n error.nodes ?? inputValue.astNode?.defaultValue,\n );\n }\n}\n\n/** @internal */\nexport function validateDefaultInput(\n defaultInput: GraphQLDefaultInput,\n inputType: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions?: Maybe,\n): void {\n if (defaultInput.literal) {\n validateInputLiteral(\n defaultInput.literal,\n inputType,\n onError,\n undefined,\n undefined,\n hideSuggestions,\n );\n return;\n }\n validateInputValue(defaultInput.value, inputType, onError, hideSuggestions);\n}\n\n/**\n * Historically GraphQL.js allowed default values to be provided as\n * assumed-coerced \"internal\" values, however default values should be provided\n * as \"external\" pre-coerced values. `uncoerceDefaultValue()` will convert such\n * \"internal\" values to \"external\" values to display as part of validation.\n *\n * This performs the \"opposite\" of `coerceInputValue()`. Given an \"internal\"\n * coerced value, reverse the process to provide an \"external\" uncoerced value.\n *\n * @internal\n */\nfunction uncoerceDefaultValue(value: unknown, type: GraphQLInputType): unknown {\n if (isNonNullType(type)) {\n return uncoerceDefaultValue(value, type.ofType);\n }\n\n if (value === null) {\n return null;\n }\n\n if (isListType(type)) {\n if (isIterableObject(value)) {\n return Array.from(value, (itemValue) =>\n uncoerceDefaultValue(itemValue, type.ofType),\n );\n }\n return [uncoerceDefaultValue(value, type.ofType)];\n }\n\n if (isInputObjectType(type)) {\n invariant(isObjectLike(value));\n const fieldDefs = type.getFields();\n return mapValue(value, (fieldValue, fieldName) => {\n invariant(fieldName in fieldDefs);\n return uncoerceDefaultValue(fieldValue, fieldDefs[fieldName].type);\n });\n }\n\n assertLeafType(type);\n\n // For most leaf types (Scalars, Enums), output value coercion (\"serialize\") is\n // the inverse of input coercion (\"parseValue\") and will produce an\n // \"external\" value. Historically, this method was also used as part of the\n // now-deprecated \"astFromValue\" to perform the same behavior.\n return type.coerceOutputValue(value);\n}\n\nfunction validateName(\n context: SchemaValidationContext,\n node: { readonly name: string; readonly astNode: Maybe },\n): void {\n // Ensure names are valid, however introspection types opt out.\n if (node.name.startsWith('__')) {\n context.reportError(\n `Name \"${node.name}\" must not begin with \"__\", which is reserved by GraphQL introspection.`,\n node.astNode,\n );\n }\n}\n\nfunction validateTypes(context: SchemaValidationContext): void {\n const validateInputObjectDefaultValueCircularRefs =\n createInputObjectDefaultValueCircularRefsValidator(context);\n const typeMap = context.schema.getTypeMap();\n const finiteValueStates = new Map<\n GraphQLInputObjectType,\n InputObjectFiniteValueState\n >();\n\n for (const type of Object.values(typeMap)) {\n // Ensure all provided types are in fact GraphQL type.\n if (!isNamedType(type)) {\n context.reportError(\n `Expected GraphQL named type but got: ${inspect(type)}.`,\n (type as any).astNode,\n );\n continue;\n }\n\n // Ensure it is named correctly (excluding introspection types).\n if (!isIntrospectionType(type)) {\n validateName(context, type);\n }\n\n if (isObjectType(type)) {\n // Ensure fields are valid\n validateFields(context, type);\n\n // Ensure objects implement the interfaces they claim to.\n validateInterfaces(context, type);\n } else if (isInterfaceType(type)) {\n // Ensure fields are valid.\n validateFields(context, type);\n\n // Ensure interfaces implement the interfaces they claim to.\n validateInterfaces(context, type);\n } else if (isUnionType(type)) {\n // Ensure Unions include valid member types.\n validateUnionMembers(context, type);\n } else if (isEnumType(type)) {\n // Ensure Enums have valid values.\n validateEnumValues(context, type);\n } else if (isInputObjectType(type)) {\n // Ensure Input Object fields are valid.\n validateInputFields(context, type);\n\n initializeInputObjectFiniteValueState(type);\n\n // Ensure Input Objects do not contain invalid default value circular references.\n validateInputObjectDefaultValueCircularRefs(type);\n }\n }\n\n detectInputObjectNonFiniteValues(context, finiteValueStates);\n\n function initializeInputObjectFiniteValueState(\n inputObj: GraphQLInputObjectType,\n ): void {\n finiteValueStates.set(inputObj, {\n inputObj,\n targets: [],\n dependents: [],\n unresolvedTargetCount: 0,\n hasFiniteValue: false,\n });\n }\n}\n\nfunction validateFields(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n): void {\n const fields = Object.values(type.getFields());\n\n // Objects and Interfaces both must define one or more fields.\n if (fields.length === 0) {\n context.reportError(`Type ${type} must define one or more fields.`, [\n type.astNode,\n ...type.extensionASTNodes,\n ]);\n }\n\n for (const field of fields) {\n // Ensure they are named correctly.\n validateName(context, field);\n\n // Ensure the type is an output type\n if (!isOutputType(field.type)) {\n context.reportError(\n `The type of ${field} must be Output Type ` +\n `but got: ${inspect(field.type)}.`,\n field.astNode?.type,\n );\n }\n\n // Ensure the arguments are valid\n for (const arg of field.args) {\n // Ensure they are named correctly.\n validateName(context, arg);\n\n // Ensure the type is an input type\n if (!isInputType(arg.type)) {\n context.reportError(\n `The type of ${arg} must be Input Type but got: ${inspect(arg.type)}.`,\n arg.astNode?.type,\n );\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n context.reportError(`Required argument ${arg} cannot be deprecated.`, [\n getDeprecatedDirectiveNode(arg.astNode),\n arg.astNode?.type,\n ]);\n }\n\n validateDefaultValue(context, arg);\n }\n }\n}\n\nfunction validateInterfaces(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n): void {\n const ifaceTypeNames = new Set();\n for (const iface of type.getInterfaces()) {\n if (!isInterfaceType(iface)) {\n context.reportError(\n `Type ${type} must only implement Interface types, ` +\n `it cannot implement ${inspect(iface)}.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n if (type === iface) {\n context.reportError(\n `Type ${type} cannot implement itself because it would create a circular reference.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n if (ifaceTypeNames.has(iface.name)) {\n context.reportError(\n `Type ${type} can only implement ${iface} once.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n ifaceTypeNames.add(iface.name);\n\n validateTypeImplementsAncestors(context, type, iface);\n validateTypeImplementsInterface(context, type, iface);\n }\n}\n\nfunction validateTypeImplementsInterface(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n iface: GraphQLInterfaceType,\n): void {\n const typeFieldMap = type.getFields();\n\n // Assert each interface field is implemented.\n for (const ifaceField of Object.values(iface.getFields())) {\n const typeField = typeFieldMap[ifaceField.name];\n\n // Assert interface field exists on type.\n if (typeField == null) {\n context.reportError(\n `Interface field ${ifaceField} expected but ${type} does not provide it.`,\n [ifaceField.astNode, type.astNode, ...type.extensionASTNodes],\n );\n continue;\n }\n\n // Assert interface field type is satisfied by type field type, by being\n // a valid subtype. (covariant)\n if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) {\n context.reportError(\n `Interface field ${ifaceField} expects type ${ifaceField.type} ` +\n `but ${typeField} is type ${typeField.type}.`,\n [ifaceField.astNode?.type, typeField.astNode?.type],\n );\n }\n\n // Assert each interface field arg is implemented.\n for (const ifaceArg of ifaceField.args) {\n const typeArg = typeField.args.find((arg) => arg.name === ifaceArg.name);\n\n // Assert interface field arg exists on object field.\n if (!typeArg) {\n context.reportError(\n `Interface field argument ${ifaceArg} expected but ${typeField} does not provide it.`,\n [ifaceArg.astNode, typeField.astNode],\n );\n continue;\n }\n\n // Assert interface field arg type matches object field arg type.\n // (invariant)\n // TODO: change to contravariant?\n if (!isEqualType(ifaceArg.type, typeArg.type)) {\n context.reportError(\n `Interface field argument ${ifaceArg} expects type ${ifaceArg.type} ` +\n `but ${typeArg} is type ${typeArg.type}.`,\n [ifaceArg.astNode?.type, typeArg.astNode?.type],\n );\n }\n }\n\n // Assert additional arguments must not be required.\n for (const typeArg of typeField.args) {\n if (isRequiredArgument(typeArg)) {\n const ifaceArg = ifaceField.args.find(\n (arg) => arg.name === typeArg.name,\n );\n if (!ifaceArg) {\n context.reportError(\n `Argument \"${typeArg}\" must not be required type \"${typeArg.type}\" ` +\n `if not provided by the Interface field \"${ifaceField}\".`,\n [typeArg.astNode, ifaceField.astNode],\n );\n }\n }\n }\n\n // Asserts that field is not deprecated unless interface field is\n if (\n typeField.deprecationReason != null &&\n ifaceField.deprecationReason == null\n ) {\n context.reportError(\n `Interface field ${iface.name}.${ifaceField.name} is not deprecated, so ` +\n `implementation field ${type.name}.${typeField.name} must not be deprecated.`,\n [\n getDeprecatedDirectiveNode(typeField.astNode),\n typeField.astNode?.type,\n ],\n );\n }\n }\n}\n\nfunction validateTypeImplementsAncestors(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n iface: GraphQLInterfaceType,\n): void {\n const ifaceInterfaces = type.getInterfaces();\n for (const transitive of iface.getInterfaces()) {\n if (!ifaceInterfaces.includes(transitive)) {\n context.reportError(\n transitive === type\n ? `Type ${type} cannot implement ${iface} because it would create a circular reference.`\n : `Type ${type} must implement ${transitive} because it is implemented by ${iface}.`,\n [\n ...getAllImplementsInterfaceNodes(iface, transitive),\n ...getAllImplementsInterfaceNodes(type, iface),\n ],\n );\n }\n }\n}\n\nfunction validateUnionMembers(\n context: SchemaValidationContext,\n union: GraphQLUnionType,\n): void {\n const memberTypes = union.getTypes();\n\n if (memberTypes.length === 0) {\n context.reportError(\n `Union type ${union} must define one or more member types.`,\n [union.astNode, ...union.extensionASTNodes],\n );\n }\n\n const includedTypeNames = new Set();\n for (const memberType of memberTypes) {\n if (includedTypeNames.has(memberType.name)) {\n context.reportError(\n `Union type ${union} can only include type ${memberType} once.`,\n getUnionMemberTypeNodes(union, memberType.name),\n );\n continue;\n }\n includedTypeNames.add(memberType.name);\n if (!isObjectType(memberType)) {\n context.reportError(\n `Union type ${union} can only include Object types, ` +\n `it cannot include ${inspect(memberType)}.`,\n getUnionMemberTypeNodes(union, String(memberType)),\n );\n }\n }\n}\n\nfunction validateEnumValues(\n context: SchemaValidationContext,\n enumType: GraphQLEnumType,\n): void {\n const enumValues = enumType.getValues();\n\n if (enumValues.length === 0) {\n context.reportError(\n `Enum type ${enumType} must define one or more values.`,\n [enumType.astNode, ...enumType.extensionASTNodes],\n );\n }\n\n for (const enumValue of enumValues) {\n // Ensure valid name.\n validateName(context, enumValue);\n }\n}\n\nfunction validateInputFields(\n context: SchemaValidationContext,\n inputObj: GraphQLInputObjectType,\n): void {\n const fields = Object.values(inputObj.getFields());\n\n if (fields.length === 0) {\n context.reportError(\n `Input Object type ${inputObj} must define one or more fields.`,\n [inputObj.astNode, ...inputObj.extensionASTNodes],\n );\n }\n\n // Ensure the input fields are valid\n for (const field of fields) {\n // Ensure they are named correctly.\n validateName(context, field);\n\n // Ensure the type is an input type\n if (!isInputType(field.type)) {\n context.reportError(\n `The type of ${field} must be Input Type ` +\n `but got: ${inspect(field.type)}.`,\n field.astNode?.type,\n );\n }\n\n if (isRequiredInputField(field) && field.deprecationReason != null) {\n context.reportError(\n `Required input field ${field} cannot be deprecated.`,\n [getDeprecatedDirectiveNode(field.astNode), field.astNode?.type],\n );\n }\n\n validateDefaultValue(context, field);\n\n if (inputObj.isOneOf) {\n validateOneOfInputObjectField(inputObj, field, context);\n }\n }\n}\n\nfunction validateOneOfInputObjectField(\n type: GraphQLInputObjectType,\n field: GraphQLInputField,\n context: SchemaValidationContext,\n): void {\n if (isNonNullType(field.type)) {\n context.reportError(\n `OneOf input field ${type}.${field.name} must be nullable.`,\n field.astNode?.type,\n );\n }\n\n if (field.default !== undefined || field.defaultValue !== undefined) {\n context.reportError(\n `OneOf input field ${type}.${field.name} cannot have a default value.`,\n field.astNode,\n );\n }\n}\n\ninterface InputObjectFiniteValueTarget {\n field: GraphQLInputField;\n target: GraphQLInputObjectType;\n}\n\ninterface InputObjectFiniteValueState {\n inputObj: GraphQLInputObjectType;\n targets: Array;\n dependents: Array;\n unresolvedTargetCount: number;\n hasFiniteValue: boolean;\n}\n\n// Implements the spec's InputObjectHasUnbreakableCycle algorithm for all Input\n// Objects in one pass by propagating known breakable types through reverse edges.\nfunction detectInputObjectNonFiniteValues(\n context: SchemaValidationContext,\n finiteValueStates: ReadonlyMap<\n GraphQLInputObjectType,\n InputObjectFiniteValueState\n >,\n): void {\n const inputObjectsWithFiniteValues: Array = [];\n\n for (const state of finiteValueStates.values()) {\n const inputObj = state.inputObj;\n const fields = Object.values(inputObj.getFields());\n\n for (const field of fields) {\n const target = getFiniteValueTarget(inputObj, field.type);\n if (target === undefined) {\n continue;\n }\n\n state.targets.push({ field, target });\n const targetState = finiteValueStates.get(target);\n if (targetState !== undefined) {\n targetState.dependents.push(state);\n }\n }\n\n if (inputObj.isOneOf) {\n // OneOf Input Objects have an unbreakable cycle if every field leads to an unbreakable cycle.\n if (fields.length === 0 || state.targets.length < fields.length) {\n markInputObjectHasFiniteValue(state);\n }\n } else {\n // Non-OneOf Input Objects have an unbreakable cycle if any non-null field has one.\n state.unresolvedTargetCount = state.targets.length;\n if (state.targets.length === 0) {\n markInputObjectHasFiniteValue(state);\n }\n }\n }\n\n let nextFiniteValueState: InputObjectFiniteValueState | undefined;\n while (\n (nextFiniteValueState = inputObjectsWithFiniteValues.pop()) !== undefined\n ) {\n for (const dependentState of nextFiniteValueState.dependents) {\n if (dependentState.hasFiniteValue) {\n continue;\n }\n\n if (dependentState.inputObj.isOneOf) {\n markInputObjectHasFiniteValue(dependentState);\n continue;\n }\n\n --dependentState.unresolvedTargetCount;\n if (dependentState.unresolvedTargetCount === 0) {\n markInputObjectHasFiniteValue(dependentState);\n }\n }\n }\n\n // Tracks already visited types to ensure that cycles are not redundantly\n // reported.\n const visitedTypes = new Set();\n\n // Array of fields used to produce meaningful errors.\n const fieldPath: Array<{ fieldStr: string; astNode: Maybe }> = [];\n\n // Position in the field path.\n const fieldPathIndexByType = new Map();\n\n for (const state of finiteValueStates.values()) {\n if (!state.hasFiniteValue) {\n reportCycleRecursive(state);\n }\n }\n\n function markInputObjectHasFiniteValue(\n finiteValueState: InputObjectFiniteValueState,\n ): void {\n if (!finiteValueState.hasFiniteValue) {\n finiteValueState.hasFiniteValue = true;\n inputObjectsWithFiniteValues.push(finiteValueState);\n }\n }\n\n function reportCycleRecursive(state: InputObjectFiniteValueState): void {\n const inputObj = state.inputObj;\n if (visitedTypes.has(inputObj)) {\n return;\n }\n\n visitedTypes.add(inputObj);\n fieldPathIndexByType.set(inputObj, fieldPath.length);\n\n for (const { field, target } of state.targets) {\n const targetState = finiteValueStates.get(target);\n if (targetState?.hasFiniteValue !== false) {\n continue;\n }\n\n const cycleIndex = fieldPathIndexByType.get(target);\n fieldPath.push({\n fieldStr: `${inputObj}.${field.name}`,\n astNode: field.astNode,\n });\n\n if (cycleIndex === undefined) {\n reportCycleRecursive(targetState);\n } else {\n const cyclePath = fieldPath.slice(cycleIndex);\n const pathStr = cyclePath.map((p) => p.fieldStr).join(', ');\n context.reportError(\n `Input Object ${target} cannot be provided a finite value because it references itself through fields: ${pathStr}.`,\n cyclePath.map((p) => p.astNode),\n );\n }\n\n fieldPath.pop();\n }\n\n fieldPathIndexByType.delete(inputObj);\n }\n}\n\nfunction getFiniteValueTarget(\n inputObj: GraphQLInputObjectType,\n fieldType: GraphQLInputType,\n): GraphQLInputObjectType | undefined {\n if (inputObj.isOneOf) {\n if (isInputObjectType(fieldType)) {\n return fieldType;\n }\n return;\n }\n\n if (isNonNullType(fieldType) && isInputObjectType(fieldType.ofType)) {\n return fieldType.ofType;\n }\n}\n\nfunction createInputObjectDefaultValueCircularRefsValidator(\n context: SchemaValidationContext,\n): (inputObj: GraphQLInputObjectType) => void {\n // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'.\n // Tracks already visited types to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n const visitedFields = Object.create(null);\n\n // Array of keys for fields and default values used to produce meaningful errors.\n const fieldPath: Array<\n [fieldStr: string, defaultValue: ConstValueNode | undefined]\n > = [];\n\n // Position in the path\n const fieldPathIndex: ObjMap = Object.create(null);\n\n // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n return function validateInputObjectDefaultValueCircularRefs(\n inputObj: GraphQLInputObjectType,\n ): void {\n // Start with an empty object as a way to visit every field in this input\n // object type and apply every default value.\n return detectValueDefaultValueCycle(inputObj, Object.create(null));\n };\n\n function detectValueDefaultValueCycle(\n inputObj: GraphQLInputObjectType,\n defaultValue: unknown,\n ): void {\n // If the value is a List, recursively check each entry for a cycle.\n // Otherwise, only object values can contain a cycle.\n if (isIterableObject(defaultValue)) {\n for (const itemValue of defaultValue) {\n detectValueDefaultValueCycle(inputObj, itemValue);\n }\n return;\n } else if (!isObjectLike(defaultValue)) {\n return;\n }\n\n // Check each defined field for a cycle.\n for (const field of Object.values(inputObj.getFields())) {\n const namedFieldType = getNamedType(field.type);\n\n // Only input object type fields can result in a cycle.\n if (!isInputObjectType(namedFieldType)) {\n continue;\n }\n\n if (Object.hasOwn(defaultValue, field.name)) {\n // If the provided value has this field defined, recursively check it\n // for cycles.\n detectValueDefaultValueCycle(namedFieldType, defaultValue[field.name]);\n } else {\n // Otherwise check this field's default value for cycles.\n detectFieldDefaultValueCycle(\n field,\n namedFieldType,\n `${inputObj}.${field.name}`,\n );\n }\n }\n }\n\n function detectLiteralDefaultValueCycle(\n inputObj: GraphQLInputObjectType,\n defaultValue: ConstValueNode,\n ): void {\n // If the value is a List, recursively check each entry for a cycle.\n // Otherwise, only object values can contain a cycle.\n if (defaultValue.kind === Kind.LIST) {\n for (const itemLiteral of defaultValue.values) {\n detectLiteralDefaultValueCycle(inputObj, itemLiteral);\n }\n return;\n } else if (defaultValue.kind !== Kind.OBJECT) {\n return;\n }\n\n // Check each defined field for a cycle.\n const fieldNodes = keyMap(defaultValue.fields, (field) => field.name.value);\n for (const field of Object.values(inputObj.getFields())) {\n const namedFieldType = getNamedType(field.type);\n\n // Only input object type fields can result in a cycle.\n if (!isInputObjectType(namedFieldType)) {\n continue;\n }\n\n if (Object.hasOwn(fieldNodes, field.name)) {\n // If the provided value has this field defined, recursively check it\n // for cycles.\n detectLiteralDefaultValueCycle(\n namedFieldType,\n fieldNodes[field.name].value,\n );\n } else {\n // Otherwise check this field's default value for cycles.\n detectFieldDefaultValueCycle(\n field,\n namedFieldType,\n `${inputObj}.${field.name}`,\n );\n }\n }\n }\n\n function detectFieldDefaultValueCycle(\n field: GraphQLInputField,\n fieldType: GraphQLInputObjectType,\n fieldStr: string,\n ): void {\n // Only a field with a default value can result in a cycle.\n const defaultInput = field.default;\n if (defaultInput === undefined) {\n return;\n }\n\n // Check to see if there is cycle.\n const cycleIndex = fieldPathIndex[fieldStr];\n if (cycleIndex !== undefined) {\n context.reportError(\n `Invalid circular reference. The default value of Input Object field ${fieldStr} references itself${\n cycleIndex < fieldPath.length\n ? ` via the default values of: ${fieldPath\n .slice(cycleIndex)\n .map(([stringForMessage]) => stringForMessage)\n .join(', ')}`\n : ''\n }.`,\n fieldPath.slice(cycleIndex - 1).map(([, node]) => node),\n );\n return;\n }\n\n // Recurse into this field's default value once, tracking the path.\n if (visitedFields[fieldStr] === undefined) {\n visitedFields[fieldStr] = true;\n fieldPathIndex[fieldStr] = fieldPath.push([\n fieldStr,\n field.astNode?.defaultValue,\n ]);\n if (defaultInput.literal) {\n detectLiteralDefaultValueCycle(fieldType, defaultInput.literal);\n } else {\n detectValueDefaultValueCycle(fieldType, defaultInput.value);\n }\n fieldPath.pop();\n fieldPathIndex[fieldStr] = undefined;\n }\n }\n}\n\nfunction getAllImplementsInterfaceNodes(\n type: GraphQLObjectType | GraphQLInterfaceType,\n iface: GraphQLInterfaceType,\n): ReadonlyArray {\n const { astNode, extensionASTNodes } = type;\n const nodes: ReadonlyArray<\n | ObjectTypeDefinitionNode\n | ObjectTypeExtensionNode\n | InterfaceTypeDefinitionNode\n | InterfaceTypeExtensionNode\n > = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes;\n\n return nodes\n .flatMap((typeNode) => typeNode.interfaces ?? [])\n .filter((ifaceNode) => ifaceNode.name.value === iface.name);\n}\n\nfunction getUnionMemberTypeNodes(\n union: GraphQLUnionType,\n typeName: string,\n): ReadonlyArray {\n const { astNode, extensionASTNodes } = union;\n const nodes: ReadonlyArray =\n astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes;\n\n return nodes\n .flatMap((unionNode) => unionNode.types ?? [])\n .filter((typeNode) => typeNode.name.value === typeName);\n}\n\nfunction getDeprecatedDirectiveNode(\n definitionNode: Maybe<{\n readonly directives?: ReadonlyArray | undefined;\n }>,\n): Maybe {\n return definitionNode?.directives?.find(\n (node) => node.name.value === GraphQLDeprecatedDirective.name,\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs new file mode 100644 index 00000000..aa65f786 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs @@ -0,0 +1,588 @@ +import { AccumulatorMap } from "../jsutils/AccumulatorMap.mjs"; +import { capitalize } from "../jsutils/capitalize.mjs"; +import { andList } from "../jsutils/formatList.mjs"; +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { isIterableObject } from "../jsutils/isIterableObject.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { keyMap } from "../jsutils/keyMap.mjs"; +import { mapValue } from "../jsutils/mapValue.mjs"; +import { printPathArray } from "../jsutils/printPathArray.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { OperationTypeNode } from "../language/ast.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { isEqualType, isTypeSubTypeOf } from "../utilities/typeComparators.mjs"; +import { validateInputLiteral, validateInputValue, } from "../utilities/validateInputValue.mjs"; +import { assertLeafType, getNamedType, isEnumType, isInputObjectType, isInputType, isInterfaceType, isListType, isNamedType, isNonNullType, isObjectType, isOutputType, isRequiredArgument, isRequiredInputField, isUnionType, } from "./definition.mjs"; +import { GraphQLDeprecatedDirective, isDirective } from "./directives.mjs"; +import { isIntrospectionType } from "./introspection.mjs"; +import { assertSchema } from "./schema.mjs"; +export function validateSchema(schema) { + assertSchema(schema); + if (schema.__validationErrors) { + return schema.__validationErrors; + } + const context = new SchemaValidationContext(schema); + validateRootTypes(context); + validateDirectives(context); + validateTypes(context); + const errors = context.getErrors(); + schema.__validationErrors = errors; + return errors; +} +export function assertValidSchema(schema) { + const errors = validateSchema(schema); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} +class SchemaValidationContext { + constructor(schema) { + this._errors = []; + this.schema = schema; + } + reportError(message, nodes) { + const _nodes = Array.isArray(nodes) + ? nodes.filter(Boolean) + : nodes; + this._errors.push(new GraphQLError(message, { nodes: _nodes })); + } + getErrors() { + return this._errors; + } +} +function validateRootTypes(context) { + const schema = context.schema; + if (schema.getQueryType() == null) { + context.reportError('Query root type must be provided.', schema.astNode); + } + const rootTypesMap = new AccumulatorMap(); + for (const operationType of Object.values(OperationTypeNode)) { + const rootType = schema.getRootType(operationType); + if (rootType != null) { + if (!isObjectType(rootType)) { + const operationTypeStr = capitalize(operationType); + const rootTypeStr = inspect(rootType); + context.reportError(operationType === OperationTypeNode.QUERY + ? `${operationTypeStr} root type must be Object type, it cannot be ${rootTypeStr}.` + : `${operationTypeStr} root type must be Object type if provided, it cannot be ${rootTypeStr}.`, getOperationTypeNode(schema, operationType) ?? + rootType.astNode); + } + else { + rootTypesMap.add(rootType, operationType); + } + } + } + for (const [rootType, operationTypes] of rootTypesMap) { + if (operationTypes.length > 1) { + const operationList = andList(operationTypes); + context.reportError(`All root types must be different, "${rootType}" type is used as ${operationList} root types.`, operationTypes.map((operationType) => getOperationTypeNode(schema, operationType))); + } + } +} +function getOperationTypeNode(schema, operation) { + return [schema.astNode, ...schema.extensionASTNodes] + .flatMap((schemaNode) => schemaNode?.operationTypes ?? []) + .find((operationNode) => operationNode.operation === operation)?.type; +} +function validateDirectives(context) { + for (const directive of context.schema.getDirectives()) { + if (!isDirective(directive)) { + context.reportError(`Expected directive but got: ${inspect(directive)}.`, directive?.astNode); + continue; + } + validateName(context, directive); + if (directive.locations.length === 0) { + context.reportError(`Directive ${directive} must include 1 or more locations.`, directive.astNode); + } + for (const arg of directive.args) { + validateName(context, arg); + if (!isInputType(arg.type)) { + context.reportError(`The type of ${arg} must be Input Type ` + + `but got: ${inspect(arg.type)}.`, arg.astNode); + } + if (isRequiredArgument(arg) && arg.deprecationReason != null) { + context.reportError(`Required argument ${arg} cannot be deprecated.`, [ + getDeprecatedDirectiveNode(arg.astNode), + arg.astNode?.type, + ]); + } + validateDefaultValue(context, arg); + } + } +} +function validateDefaultValue(context, inputValue) { + const defaultInput = inputValue.default; + if (!defaultInput) { + return; + } + const errors = []; + validateDefaultInput(defaultInput, inputValue.type, (error, path) => { + errors.push([error, path]); + }); + if (errors.length === 0) { + return; + } + if (!defaultInput.literal) { + try { + const uncoercedValue = uncoerceDefaultValue(defaultInput.value, inputValue.type); + const uncoercedErrors = []; + validateInputValue(uncoercedValue, inputValue.type, (error, path) => { + uncoercedErrors.push([error, path]); + }); + if (uncoercedErrors.length === 0) { + context.reportError(`${inputValue} has invalid default value: ${inspect(defaultInput.value)}. Did you mean: ${inspect(uncoercedValue)}?`, inputValue.astNode?.defaultValue); + return; + } + } + catch (_error) { + } + } + for (const [error, path] of errors) { + context.reportError(`${inputValue} has invalid default value${printPathArray(path)}: ${error.message}`, error.nodes ?? inputValue.astNode?.defaultValue); + } +} +export function validateDefaultInput(defaultInput, inputType, onError, hideSuggestions) { + if (defaultInput.literal) { + validateInputLiteral(defaultInput.literal, inputType, onError, undefined, undefined, hideSuggestions); + return; + } + validateInputValue(defaultInput.value, inputType, onError, hideSuggestions); +} +function uncoerceDefaultValue(value, type) { + if (isNonNullType(type)) { + return uncoerceDefaultValue(value, type.ofType); + } + if (value === null) { + return null; + } + if (isListType(type)) { + if (isIterableObject(value)) { + return Array.from(value, (itemValue) => uncoerceDefaultValue(itemValue, type.ofType)); + } + return [uncoerceDefaultValue(value, type.ofType)]; + } + if (isInputObjectType(type)) { + if (!(isObjectLike(value))) + invariant(false); + const fieldDefs = type.getFields(); + return mapValue(value, (fieldValue, fieldName) => { + if (!(fieldName in fieldDefs)) + invariant(false); + return uncoerceDefaultValue(fieldValue, fieldDefs[fieldName].type); + }); + } + assertLeafType(type); + return type.coerceOutputValue(value); +} +function validateName(context, node) { + if (node.name.startsWith('__')) { + context.reportError(`Name "${node.name}" must not begin with "__", which is reserved by GraphQL introspection.`, node.astNode); + } +} +function validateTypes(context) { + const validateInputObjectDefaultValueCircularRefs = createInputObjectDefaultValueCircularRefsValidator(context); + const typeMap = context.schema.getTypeMap(); + const finiteValueStates = new Map(); + for (const type of Object.values(typeMap)) { + if (!isNamedType(type)) { + context.reportError(`Expected GraphQL named type but got: ${inspect(type)}.`, type.astNode); + continue; + } + if (!isIntrospectionType(type)) { + validateName(context, type); + } + if (isObjectType(type)) { + validateFields(context, type); + validateInterfaces(context, type); + } + else if (isInterfaceType(type)) { + validateFields(context, type); + validateInterfaces(context, type); + } + else if (isUnionType(type)) { + validateUnionMembers(context, type); + } + else if (isEnumType(type)) { + validateEnumValues(context, type); + } + else if (isInputObjectType(type)) { + validateInputFields(context, type); + initializeInputObjectFiniteValueState(type); + validateInputObjectDefaultValueCircularRefs(type); + } + } + detectInputObjectNonFiniteValues(context, finiteValueStates); + function initializeInputObjectFiniteValueState(inputObj) { + finiteValueStates.set(inputObj, { + inputObj, + targets: [], + dependents: [], + unresolvedTargetCount: 0, + hasFiniteValue: false, + }); + } +} +function validateFields(context, type) { + const fields = Object.values(type.getFields()); + if (fields.length === 0) { + context.reportError(`Type ${type} must define one or more fields.`, [ + type.astNode, + ...type.extensionASTNodes, + ]); + } + for (const field of fields) { + validateName(context, field); + if (!isOutputType(field.type)) { + context.reportError(`The type of ${field} must be Output Type ` + + `but got: ${inspect(field.type)}.`, field.astNode?.type); + } + for (const arg of field.args) { + validateName(context, arg); + if (!isInputType(arg.type)) { + context.reportError(`The type of ${arg} must be Input Type but got: ${inspect(arg.type)}.`, arg.astNode?.type); + } + if (isRequiredArgument(arg) && arg.deprecationReason != null) { + context.reportError(`Required argument ${arg} cannot be deprecated.`, [ + getDeprecatedDirectiveNode(arg.astNode), + arg.astNode?.type, + ]); + } + validateDefaultValue(context, arg); + } + } +} +function validateInterfaces(context, type) { + const ifaceTypeNames = new Set(); + for (const iface of type.getInterfaces()) { + if (!isInterfaceType(iface)) { + context.reportError(`Type ${type} must only implement Interface types, ` + + `it cannot implement ${inspect(iface)}.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + if (type === iface) { + context.reportError(`Type ${type} cannot implement itself because it would create a circular reference.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + if (ifaceTypeNames.has(iface.name)) { + context.reportError(`Type ${type} can only implement ${iface} once.`, getAllImplementsInterfaceNodes(type, iface)); + continue; + } + ifaceTypeNames.add(iface.name); + validateTypeImplementsAncestors(context, type, iface); + validateTypeImplementsInterface(context, type, iface); + } +} +function validateTypeImplementsInterface(context, type, iface) { + const typeFieldMap = type.getFields(); + for (const ifaceField of Object.values(iface.getFields())) { + const typeField = typeFieldMap[ifaceField.name]; + if (typeField == null) { + context.reportError(`Interface field ${ifaceField} expected but ${type} does not provide it.`, [ifaceField.astNode, type.astNode, ...type.extensionASTNodes]); + continue; + } + if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) { + context.reportError(`Interface field ${ifaceField} expects type ${ifaceField.type} ` + + `but ${typeField} is type ${typeField.type}.`, [ifaceField.astNode?.type, typeField.astNode?.type]); + } + for (const ifaceArg of ifaceField.args) { + const typeArg = typeField.args.find((arg) => arg.name === ifaceArg.name); + if (!typeArg) { + context.reportError(`Interface field argument ${ifaceArg} expected but ${typeField} does not provide it.`, [ifaceArg.astNode, typeField.astNode]); + continue; + } + if (!isEqualType(ifaceArg.type, typeArg.type)) { + context.reportError(`Interface field argument ${ifaceArg} expects type ${ifaceArg.type} ` + + `but ${typeArg} is type ${typeArg.type}.`, [ifaceArg.astNode?.type, typeArg.astNode?.type]); + } + } + for (const typeArg of typeField.args) { + if (isRequiredArgument(typeArg)) { + const ifaceArg = ifaceField.args.find((arg) => arg.name === typeArg.name); + if (!ifaceArg) { + context.reportError(`Argument "${typeArg}" must not be required type "${typeArg.type}" ` + + `if not provided by the Interface field "${ifaceField}".`, [typeArg.astNode, ifaceField.astNode]); + } + } + } + if (typeField.deprecationReason != null && + ifaceField.deprecationReason == null) { + context.reportError(`Interface field ${iface.name}.${ifaceField.name} is not deprecated, so ` + + `implementation field ${type.name}.${typeField.name} must not be deprecated.`, [ + getDeprecatedDirectiveNode(typeField.astNode), + typeField.astNode?.type, + ]); + } + } +} +function validateTypeImplementsAncestors(context, type, iface) { + const ifaceInterfaces = type.getInterfaces(); + for (const transitive of iface.getInterfaces()) { + if (!ifaceInterfaces.includes(transitive)) { + context.reportError(transitive === type + ? `Type ${type} cannot implement ${iface} because it would create a circular reference.` + : `Type ${type} must implement ${transitive} because it is implemented by ${iface}.`, [ + ...getAllImplementsInterfaceNodes(iface, transitive), + ...getAllImplementsInterfaceNodes(type, iface), + ]); + } + } +} +function validateUnionMembers(context, union) { + const memberTypes = union.getTypes(); + if (memberTypes.length === 0) { + context.reportError(`Union type ${union} must define one or more member types.`, [union.astNode, ...union.extensionASTNodes]); + } + const includedTypeNames = new Set(); + for (const memberType of memberTypes) { + if (includedTypeNames.has(memberType.name)) { + context.reportError(`Union type ${union} can only include type ${memberType} once.`, getUnionMemberTypeNodes(union, memberType.name)); + continue; + } + includedTypeNames.add(memberType.name); + if (!isObjectType(memberType)) { + context.reportError(`Union type ${union} can only include Object types, ` + + `it cannot include ${inspect(memberType)}.`, getUnionMemberTypeNodes(union, String(memberType))); + } + } +} +function validateEnumValues(context, enumType) { + const enumValues = enumType.getValues(); + if (enumValues.length === 0) { + context.reportError(`Enum type ${enumType} must define one or more values.`, [enumType.astNode, ...enumType.extensionASTNodes]); + } + for (const enumValue of enumValues) { + validateName(context, enumValue); + } +} +function validateInputFields(context, inputObj) { + const fields = Object.values(inputObj.getFields()); + if (fields.length === 0) { + context.reportError(`Input Object type ${inputObj} must define one or more fields.`, [inputObj.astNode, ...inputObj.extensionASTNodes]); + } + for (const field of fields) { + validateName(context, field); + if (!isInputType(field.type)) { + context.reportError(`The type of ${field} must be Input Type ` + + `but got: ${inspect(field.type)}.`, field.astNode?.type); + } + if (isRequiredInputField(field) && field.deprecationReason != null) { + context.reportError(`Required input field ${field} cannot be deprecated.`, [getDeprecatedDirectiveNode(field.astNode), field.astNode?.type]); + } + validateDefaultValue(context, field); + if (inputObj.isOneOf) { + validateOneOfInputObjectField(inputObj, field, context); + } + } +} +function validateOneOfInputObjectField(type, field, context) { + if (isNonNullType(field.type)) { + context.reportError(`OneOf input field ${type}.${field.name} must be nullable.`, field.astNode?.type); + } + if (field.default !== undefined || field.defaultValue !== undefined) { + context.reportError(`OneOf input field ${type}.${field.name} cannot have a default value.`, field.astNode); + } +} +function detectInputObjectNonFiniteValues(context, finiteValueStates) { + const inputObjectsWithFiniteValues = []; + for (const state of finiteValueStates.values()) { + const inputObj = state.inputObj; + const fields = Object.values(inputObj.getFields()); + for (const field of fields) { + const target = getFiniteValueTarget(inputObj, field.type); + if (target === undefined) { + continue; + } + state.targets.push({ field, target }); + const targetState = finiteValueStates.get(target); + if (targetState !== undefined) { + targetState.dependents.push(state); + } + } + if (inputObj.isOneOf) { + if (fields.length === 0 || state.targets.length < fields.length) { + markInputObjectHasFiniteValue(state); + } + } + else { + state.unresolvedTargetCount = state.targets.length; + if (state.targets.length === 0) { + markInputObjectHasFiniteValue(state); + } + } + } + let nextFiniteValueState; + while ((nextFiniteValueState = inputObjectsWithFiniteValues.pop()) !== undefined) { + for (const dependentState of nextFiniteValueState.dependents) { + if (dependentState.hasFiniteValue) { + continue; + } + if (dependentState.inputObj.isOneOf) { + markInputObjectHasFiniteValue(dependentState); + continue; + } + --dependentState.unresolvedTargetCount; + if (dependentState.unresolvedTargetCount === 0) { + markInputObjectHasFiniteValue(dependentState); + } + } + } + const visitedTypes = new Set(); + const fieldPath = []; + const fieldPathIndexByType = new Map(); + for (const state of finiteValueStates.values()) { + if (!state.hasFiniteValue) { + reportCycleRecursive(state); + } + } + function markInputObjectHasFiniteValue(finiteValueState) { + if (!finiteValueState.hasFiniteValue) { + finiteValueState.hasFiniteValue = true; + inputObjectsWithFiniteValues.push(finiteValueState); + } + } + function reportCycleRecursive(state) { + const inputObj = state.inputObj; + if (visitedTypes.has(inputObj)) { + return; + } + visitedTypes.add(inputObj); + fieldPathIndexByType.set(inputObj, fieldPath.length); + for (const { field, target } of state.targets) { + const targetState = finiteValueStates.get(target); + if (targetState?.hasFiniteValue !== false) { + continue; + } + const cycleIndex = fieldPathIndexByType.get(target); + fieldPath.push({ + fieldStr: `${inputObj}.${field.name}`, + astNode: field.astNode, + }); + if (cycleIndex === undefined) { + reportCycleRecursive(targetState); + } + else { + const cyclePath = fieldPath.slice(cycleIndex); + const pathStr = cyclePath.map((p) => p.fieldStr).join(', '); + context.reportError(`Input Object ${target} cannot be provided a finite value because it references itself through fields: ${pathStr}.`, cyclePath.map((p) => p.astNode)); + } + fieldPath.pop(); + } + fieldPathIndexByType.delete(inputObj); + } +} +function getFiniteValueTarget(inputObj, fieldType) { + if (inputObj.isOneOf) { + if (isInputObjectType(fieldType)) { + return fieldType; + } + return; + } + if (isNonNullType(fieldType) && isInputObjectType(fieldType.ofType)) { + return fieldType.ofType; + } +} +function createInputObjectDefaultValueCircularRefsValidator(context) { + const visitedFields = Object.create(null); + const fieldPath = []; + const fieldPathIndex = Object.create(null); + return function validateInputObjectDefaultValueCircularRefs(inputObj) { + return detectValueDefaultValueCycle(inputObj, Object.create(null)); + }; + function detectValueDefaultValueCycle(inputObj, defaultValue) { + if (isIterableObject(defaultValue)) { + for (const itemValue of defaultValue) { + detectValueDefaultValueCycle(inputObj, itemValue); + } + return; + } + else if (!isObjectLike(defaultValue)) { + return; + } + for (const field of Object.values(inputObj.getFields())) { + const namedFieldType = getNamedType(field.type); + if (!isInputObjectType(namedFieldType)) { + continue; + } + if (Object.hasOwn(defaultValue, field.name)) { + detectValueDefaultValueCycle(namedFieldType, defaultValue[field.name]); + } + else { + detectFieldDefaultValueCycle(field, namedFieldType, `${inputObj}.${field.name}`); + } + } + } + function detectLiteralDefaultValueCycle(inputObj, defaultValue) { + if (defaultValue.kind === Kind.LIST) { + for (const itemLiteral of defaultValue.values) { + detectLiteralDefaultValueCycle(inputObj, itemLiteral); + } + return; + } + else if (defaultValue.kind !== Kind.OBJECT) { + return; + } + const fieldNodes = keyMap(defaultValue.fields, (field) => field.name.value); + for (const field of Object.values(inputObj.getFields())) { + const namedFieldType = getNamedType(field.type); + if (!isInputObjectType(namedFieldType)) { + continue; + } + if (Object.hasOwn(fieldNodes, field.name)) { + detectLiteralDefaultValueCycle(namedFieldType, fieldNodes[field.name].value); + } + else { + detectFieldDefaultValueCycle(field, namedFieldType, `${inputObj}.${field.name}`); + } + } + } + function detectFieldDefaultValueCycle(field, fieldType, fieldStr) { + const defaultInput = field.default; + if (defaultInput === undefined) { + return; + } + const cycleIndex = fieldPathIndex[fieldStr]; + if (cycleIndex !== undefined) { + context.reportError(`Invalid circular reference. The default value of Input Object field ${fieldStr} references itself${cycleIndex < fieldPath.length + ? ` via the default values of: ${fieldPath + .slice(cycleIndex) + .map(([stringForMessage]) => stringForMessage) + .join(', ')}` + : ''}.`, fieldPath.slice(cycleIndex - 1).map(([, node]) => node)); + return; + } + if (visitedFields[fieldStr] === undefined) { + visitedFields[fieldStr] = true; + fieldPathIndex[fieldStr] = fieldPath.push([ + fieldStr, + field.astNode?.defaultValue, + ]); + if (defaultInput.literal) { + detectLiteralDefaultValueCycle(fieldType, defaultInput.literal); + } + else { + detectValueDefaultValueCycle(fieldType, defaultInput.value); + } + fieldPath.pop(); + fieldPathIndex[fieldStr] = undefined; + } + } +} +function getAllImplementsInterfaceNodes(type, iface) { + const { astNode, extensionASTNodes } = type; + const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; + return nodes + .flatMap((typeNode) => typeNode.interfaces ?? []) + .filter((ifaceNode) => ifaceNode.name.value === iface.name); +} +function getUnionMemberTypeNodes(union, typeName) { + const { astNode, extensionASTNodes } = union; + const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; + return nodes + .flatMap((unionNode) => unionNode.types ?? []) + .filter((typeNode) => typeNode.name.value === typeName); +} +function getDeprecatedDirectiveNode(definitionNode) { + return definitionNode?.directives?.find((node) => node.name.value === GraphQLDeprecatedDirective.name); +} +//# sourceMappingURL=validate.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs.map new file mode 100644 index 00000000..67acfc1a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/type/validate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/type/validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAC9D,OAAO,EAAE,UAAU,EAAE,kCAAiC;AACtD,OAAO,EAAE,OAAO,EAAE,kCAAiC;AACnD,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAClE,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAC1D,OAAO,EAAE,MAAM,EAAE,8BAA6B;AAC9C,OAAO,EAAE,QAAQ,EAAE,gCAA+B;AAGlD,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAE9D,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAcxD,OAAO,EAAE,iBAAiB,EAAE,4BAA2B;AACvD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAE5C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,yCAAwC;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,EACvB,QAAgB;IAEhB,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,KAAK,GACT,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAExE,OAAO,KAAK;SACT,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;SAC7C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,0BAA0B,CACjC,cAEE;IAEF,OAAO,cAAc,EAAE,UAAU,EAAE,IAAI,CACrC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,0BAA0B,CAAC,IAAI,CAC9D,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation */\n\nimport { AccumulatorMap } from '../jsutils/AccumulatorMap.ts';\nimport { capitalize } from '../jsutils/capitalize.ts';\nimport { andList } from '../jsutils/formatList.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\nimport { mapValue } from '../jsutils/mapValue.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\nimport { printPathArray } from '../jsutils/printPathArray.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n ASTNode,\n ConstValueNode,\n DirectiveNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n NamedTypeNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n} from '../language/ast.ts';\nimport { OperationTypeNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport { isEqualType, isTypeSubTypeOf } from '../utilities/typeComparators.ts';\nimport {\n validateInputLiteral,\n validateInputValue,\n} from '../utilities/validateInputValue.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLDefaultInput,\n GraphQLEnumType,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInputType,\n GraphQLInterfaceType,\n GraphQLObjectType,\n GraphQLUnionType,\n} from './definition.ts';\nimport {\n assertLeafType,\n getNamedType,\n isEnumType,\n isInputObjectType,\n isInputType,\n isInterfaceType,\n isListType,\n isNamedType,\n isNonNullType,\n isObjectType,\n isOutputType,\n isRequiredArgument,\n isRequiredInputField,\n isUnionType,\n} from './definition.ts';\nimport { GraphQLDeprecatedDirective, isDirective } from './directives.ts';\nimport { isIntrospectionType } from './introspection.ts';\nimport type { GraphQLSchema } from './schema.ts';\nimport { assertSchema } from './schema.ts';\n\n/**\n * Implements the \"Type Validation\" sub-sections of the specification's\n * \"Type System\" section.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the Schema is valid.\n * @param schema - GraphQL schema to use.\n * @returns Schema validation errors, or an empty array when the schema is valid.\n * @example\n * ```ts\n * import { validateSchema } from 'graphql/type';\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n * const errors = validateSchema(schema);\n *\n * errors; // => []\n * ```\n */\nexport function validateSchema(\n schema: GraphQLSchema,\n): ReadonlyArray {\n // First check to ensure the provided value is in fact a GraphQLSchema.\n assertSchema(schema);\n\n // If this Schema has already been validated, return the previous results.\n if (schema.__validationErrors) {\n return schema.__validationErrors;\n }\n\n // Validate the schema, producing a list of errors.\n const context = new SchemaValidationContext(schema);\n validateRootTypes(context);\n validateDirectives(context);\n validateTypes(context);\n\n // Persist the results of validation before returning to ensure validation\n // does not run multiple times for this schema.\n const errors = context.getErrors();\n schema.__validationErrors = errors;\n return errors;\n}\n\n/**\n * Utility function which asserts a schema is valid by throwing an error if\n * it is invalid.\n * @param schema - GraphQL schema to use.\n * @example\n * ```ts\n * import { assertValidSchema } from 'graphql/type';\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * assertValidSchema(schema); // does not throw\n * ```\n */\nexport function assertValidSchema(schema: GraphQLSchema): void {\n const errors = validateSchema(schema);\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n\nclass SchemaValidationContext {\n readonly _errors: Array;\n readonly schema: GraphQLSchema;\n\n constructor(schema: GraphQLSchema) {\n this._errors = [];\n this.schema = schema;\n }\n\n reportError(\n message: string,\n nodes?: ReadonlyArray> | Maybe,\n ): void {\n const _nodes = Array.isArray(nodes)\n ? (nodes.filter(Boolean) as ReadonlyArray)\n : (nodes as Maybe);\n this._errors.push(new GraphQLError(message, { nodes: _nodes }));\n }\n\n getErrors(): ReadonlyArray {\n return this._errors;\n }\n}\n\nfunction validateRootTypes(context: SchemaValidationContext): void {\n const schema = context.schema;\n\n if (schema.getQueryType() == null) {\n context.reportError('Query root type must be provided.', schema.astNode);\n }\n\n const rootTypesMap = new AccumulatorMap<\n GraphQLObjectType,\n OperationTypeNode\n >();\n for (const operationType of Object.values(OperationTypeNode)) {\n const rootType = schema.getRootType(operationType);\n\n if (rootType != null) {\n if (!isObjectType(rootType)) {\n const operationTypeStr = capitalize(operationType);\n const rootTypeStr = inspect(rootType);\n context.reportError(\n operationType === OperationTypeNode.QUERY\n ? `${operationTypeStr} root type must be Object type, it cannot be ${rootTypeStr}.`\n : `${operationTypeStr} root type must be Object type if provided, it cannot be ${rootTypeStr}.`,\n getOperationTypeNode(schema, operationType) ??\n (rootType as any).astNode,\n );\n } else {\n rootTypesMap.add(rootType, operationType);\n }\n }\n }\n\n for (const [rootType, operationTypes] of rootTypesMap) {\n if (operationTypes.length > 1) {\n const operationList = andList(operationTypes);\n context.reportError(\n `All root types must be different, \"${rootType}\" type is used as ${operationList} root types.`,\n operationTypes.map((operationType) =>\n getOperationTypeNode(schema, operationType),\n ),\n );\n }\n }\n}\n\nfunction getOperationTypeNode(\n schema: GraphQLSchema,\n operation: OperationTypeNode,\n): Maybe {\n return [schema.astNode, ...schema.extensionASTNodes]\n .flatMap((schemaNode) => schemaNode?.operationTypes ?? [])\n .find((operationNode) => operationNode.operation === operation)?.type;\n}\n\nfunction validateDirectives(context: SchemaValidationContext): void {\n for (const directive of context.schema.getDirectives()) {\n // Ensure all directives are in fact GraphQL directives.\n if (!isDirective(directive)) {\n context.reportError(\n `Expected directive but got: ${inspect(directive)}.`,\n (directive as any)?.astNode,\n );\n continue;\n }\n\n // Ensure they are named correctly.\n validateName(context, directive);\n\n if (directive.locations.length === 0) {\n context.reportError(\n `Directive ${directive} must include 1 or more locations.`,\n directive.astNode,\n );\n }\n\n // Ensure the arguments are valid.\n for (const arg of directive.args) {\n // Ensure they are named correctly.\n validateName(context, arg);\n\n // Ensure the type is an input type.\n if (!isInputType(arg.type)) {\n context.reportError(\n `The type of ${arg} must be Input Type ` +\n `but got: ${inspect(arg.type)}.`,\n arg.astNode,\n );\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n context.reportError(`Required argument ${arg} cannot be deprecated.`, [\n getDeprecatedDirectiveNode(arg.astNode),\n arg.astNode?.type,\n ]);\n }\n\n validateDefaultValue(context, arg);\n }\n }\n}\n\nfunction validateDefaultValue(\n context: SchemaValidationContext,\n inputValue: GraphQLArgument | GraphQLInputField,\n): void {\n const defaultInput = inputValue.default;\n\n if (!defaultInput) {\n return;\n }\n\n const errors: Array<[GraphQLError, ReadonlyArray]> = [];\n validateDefaultInput(defaultInput, inputValue.type, (error, path) => {\n errors.push([error, path]);\n });\n\n if (errors.length === 0) {\n return;\n }\n\n if (!defaultInput.literal) {\n // If there were validation errors, check to see if it can be \"uncoerced\"\n // and then correctly validated. If so, report a clear error with a path\n // to resolution.\n try {\n const uncoercedValue = uncoerceDefaultValue(\n defaultInput.value,\n inputValue.type,\n );\n\n const uncoercedErrors = [];\n validateInputValue(uncoercedValue, inputValue.type, (error, path) => {\n uncoercedErrors.push([error, path]);\n });\n\n if (uncoercedErrors.length === 0) {\n context.reportError(\n `${inputValue} has invalid default value: ${inspect(\n defaultInput.value,\n )}. Did you mean: ${inspect(uncoercedValue)}?`,\n inputValue.astNode?.defaultValue,\n );\n return;\n }\n } catch (_error) {\n // ignore\n }\n }\n\n // Otherwise report the original set of errors.\n for (const [error, path] of errors) {\n context.reportError(\n `${inputValue} has invalid default value${printPathArray(path)}: ${\n error.message\n }`,\n error.nodes ?? inputValue.astNode?.defaultValue,\n );\n }\n}\n\n/** @internal */\nexport function validateDefaultInput(\n defaultInput: GraphQLDefaultInput,\n inputType: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions?: Maybe,\n): void {\n if (defaultInput.literal) {\n validateInputLiteral(\n defaultInput.literal,\n inputType,\n onError,\n undefined,\n undefined,\n hideSuggestions,\n );\n return;\n }\n validateInputValue(defaultInput.value, inputType, onError, hideSuggestions);\n}\n\n/**\n * Historically GraphQL.js allowed default values to be provided as\n * assumed-coerced \"internal\" values, however default values should be provided\n * as \"external\" pre-coerced values. `uncoerceDefaultValue()` will convert such\n * \"internal\" values to \"external\" values to display as part of validation.\n *\n * This performs the \"opposite\" of `coerceInputValue()`. Given an \"internal\"\n * coerced value, reverse the process to provide an \"external\" uncoerced value.\n *\n * @internal\n */\nfunction uncoerceDefaultValue(value: unknown, type: GraphQLInputType): unknown {\n if (isNonNullType(type)) {\n return uncoerceDefaultValue(value, type.ofType);\n }\n\n if (value === null) {\n return null;\n }\n\n if (isListType(type)) {\n if (isIterableObject(value)) {\n return Array.from(value, (itemValue) =>\n uncoerceDefaultValue(itemValue, type.ofType),\n );\n }\n return [uncoerceDefaultValue(value, type.ofType)];\n }\n\n if (isInputObjectType(type)) {\n invariant(isObjectLike(value));\n const fieldDefs = type.getFields();\n return mapValue(value, (fieldValue, fieldName) => {\n invariant(fieldName in fieldDefs);\n return uncoerceDefaultValue(fieldValue, fieldDefs[fieldName].type);\n });\n }\n\n assertLeafType(type);\n\n // For most leaf types (Scalars, Enums), output value coercion (\"serialize\") is\n // the inverse of input coercion (\"parseValue\") and will produce an\n // \"external\" value. Historically, this method was also used as part of the\n // now-deprecated \"astFromValue\" to perform the same behavior.\n return type.coerceOutputValue(value);\n}\n\nfunction validateName(\n context: SchemaValidationContext,\n node: { readonly name: string; readonly astNode: Maybe },\n): void {\n // Ensure names are valid, however introspection types opt out.\n if (node.name.startsWith('__')) {\n context.reportError(\n `Name \"${node.name}\" must not begin with \"__\", which is reserved by GraphQL introspection.`,\n node.astNode,\n );\n }\n}\n\nfunction validateTypes(context: SchemaValidationContext): void {\n const validateInputObjectDefaultValueCircularRefs =\n createInputObjectDefaultValueCircularRefsValidator(context);\n const typeMap = context.schema.getTypeMap();\n const finiteValueStates = new Map<\n GraphQLInputObjectType,\n InputObjectFiniteValueState\n >();\n\n for (const type of Object.values(typeMap)) {\n // Ensure all provided types are in fact GraphQL type.\n if (!isNamedType(type)) {\n context.reportError(\n `Expected GraphQL named type but got: ${inspect(type)}.`,\n (type as any).astNode,\n );\n continue;\n }\n\n // Ensure it is named correctly (excluding introspection types).\n if (!isIntrospectionType(type)) {\n validateName(context, type);\n }\n\n if (isObjectType(type)) {\n // Ensure fields are valid\n validateFields(context, type);\n\n // Ensure objects implement the interfaces they claim to.\n validateInterfaces(context, type);\n } else if (isInterfaceType(type)) {\n // Ensure fields are valid.\n validateFields(context, type);\n\n // Ensure interfaces implement the interfaces they claim to.\n validateInterfaces(context, type);\n } else if (isUnionType(type)) {\n // Ensure Unions include valid member types.\n validateUnionMembers(context, type);\n } else if (isEnumType(type)) {\n // Ensure Enums have valid values.\n validateEnumValues(context, type);\n } else if (isInputObjectType(type)) {\n // Ensure Input Object fields are valid.\n validateInputFields(context, type);\n\n initializeInputObjectFiniteValueState(type);\n\n // Ensure Input Objects do not contain invalid default value circular references.\n validateInputObjectDefaultValueCircularRefs(type);\n }\n }\n\n detectInputObjectNonFiniteValues(context, finiteValueStates);\n\n function initializeInputObjectFiniteValueState(\n inputObj: GraphQLInputObjectType,\n ): void {\n finiteValueStates.set(inputObj, {\n inputObj,\n targets: [],\n dependents: [],\n unresolvedTargetCount: 0,\n hasFiniteValue: false,\n });\n }\n}\n\nfunction validateFields(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n): void {\n const fields = Object.values(type.getFields());\n\n // Objects and Interfaces both must define one or more fields.\n if (fields.length === 0) {\n context.reportError(`Type ${type} must define one or more fields.`, [\n type.astNode,\n ...type.extensionASTNodes,\n ]);\n }\n\n for (const field of fields) {\n // Ensure they are named correctly.\n validateName(context, field);\n\n // Ensure the type is an output type\n if (!isOutputType(field.type)) {\n context.reportError(\n `The type of ${field} must be Output Type ` +\n `but got: ${inspect(field.type)}.`,\n field.astNode?.type,\n );\n }\n\n // Ensure the arguments are valid\n for (const arg of field.args) {\n // Ensure they are named correctly.\n validateName(context, arg);\n\n // Ensure the type is an input type\n if (!isInputType(arg.type)) {\n context.reportError(\n `The type of ${arg} must be Input Type but got: ${inspect(arg.type)}.`,\n arg.astNode?.type,\n );\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n context.reportError(`Required argument ${arg} cannot be deprecated.`, [\n getDeprecatedDirectiveNode(arg.astNode),\n arg.astNode?.type,\n ]);\n }\n\n validateDefaultValue(context, arg);\n }\n }\n}\n\nfunction validateInterfaces(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n): void {\n const ifaceTypeNames = new Set();\n for (const iface of type.getInterfaces()) {\n if (!isInterfaceType(iface)) {\n context.reportError(\n `Type ${type} must only implement Interface types, ` +\n `it cannot implement ${inspect(iface)}.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n if (type === iface) {\n context.reportError(\n `Type ${type} cannot implement itself because it would create a circular reference.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n if (ifaceTypeNames.has(iface.name)) {\n context.reportError(\n `Type ${type} can only implement ${iface} once.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n ifaceTypeNames.add(iface.name);\n\n validateTypeImplementsAncestors(context, type, iface);\n validateTypeImplementsInterface(context, type, iface);\n }\n}\n\nfunction validateTypeImplementsInterface(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n iface: GraphQLInterfaceType,\n): void {\n const typeFieldMap = type.getFields();\n\n // Assert each interface field is implemented.\n for (const ifaceField of Object.values(iface.getFields())) {\n const typeField = typeFieldMap[ifaceField.name];\n\n // Assert interface field exists on type.\n if (typeField == null) {\n context.reportError(\n `Interface field ${ifaceField} expected but ${type} does not provide it.`,\n [ifaceField.astNode, type.astNode, ...type.extensionASTNodes],\n );\n continue;\n }\n\n // Assert interface field type is satisfied by type field type, by being\n // a valid subtype. (covariant)\n if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) {\n context.reportError(\n `Interface field ${ifaceField} expects type ${ifaceField.type} ` +\n `but ${typeField} is type ${typeField.type}.`,\n [ifaceField.astNode?.type, typeField.astNode?.type],\n );\n }\n\n // Assert each interface field arg is implemented.\n for (const ifaceArg of ifaceField.args) {\n const typeArg = typeField.args.find((arg) => arg.name === ifaceArg.name);\n\n // Assert interface field arg exists on object field.\n if (!typeArg) {\n context.reportError(\n `Interface field argument ${ifaceArg} expected but ${typeField} does not provide it.`,\n [ifaceArg.astNode, typeField.astNode],\n );\n continue;\n }\n\n // Assert interface field arg type matches object field arg type.\n // (invariant)\n // TODO: change to contravariant?\n if (!isEqualType(ifaceArg.type, typeArg.type)) {\n context.reportError(\n `Interface field argument ${ifaceArg} expects type ${ifaceArg.type} ` +\n `but ${typeArg} is type ${typeArg.type}.`,\n [ifaceArg.astNode?.type, typeArg.astNode?.type],\n );\n }\n }\n\n // Assert additional arguments must not be required.\n for (const typeArg of typeField.args) {\n if (isRequiredArgument(typeArg)) {\n const ifaceArg = ifaceField.args.find(\n (arg) => arg.name === typeArg.name,\n );\n if (!ifaceArg) {\n context.reportError(\n `Argument \"${typeArg}\" must not be required type \"${typeArg.type}\" ` +\n `if not provided by the Interface field \"${ifaceField}\".`,\n [typeArg.astNode, ifaceField.astNode],\n );\n }\n }\n }\n\n // Asserts that field is not deprecated unless interface field is\n if (\n typeField.deprecationReason != null &&\n ifaceField.deprecationReason == null\n ) {\n context.reportError(\n `Interface field ${iface.name}.${ifaceField.name} is not deprecated, so ` +\n `implementation field ${type.name}.${typeField.name} must not be deprecated.`,\n [\n getDeprecatedDirectiveNode(typeField.astNode),\n typeField.astNode?.type,\n ],\n );\n }\n }\n}\n\nfunction validateTypeImplementsAncestors(\n context: SchemaValidationContext,\n type: GraphQLObjectType | GraphQLInterfaceType,\n iface: GraphQLInterfaceType,\n): void {\n const ifaceInterfaces = type.getInterfaces();\n for (const transitive of iface.getInterfaces()) {\n if (!ifaceInterfaces.includes(transitive)) {\n context.reportError(\n transitive === type\n ? `Type ${type} cannot implement ${iface} because it would create a circular reference.`\n : `Type ${type} must implement ${transitive} because it is implemented by ${iface}.`,\n [\n ...getAllImplementsInterfaceNodes(iface, transitive),\n ...getAllImplementsInterfaceNodes(type, iface),\n ],\n );\n }\n }\n}\n\nfunction validateUnionMembers(\n context: SchemaValidationContext,\n union: GraphQLUnionType,\n): void {\n const memberTypes = union.getTypes();\n\n if (memberTypes.length === 0) {\n context.reportError(\n `Union type ${union} must define one or more member types.`,\n [union.astNode, ...union.extensionASTNodes],\n );\n }\n\n const includedTypeNames = new Set();\n for (const memberType of memberTypes) {\n if (includedTypeNames.has(memberType.name)) {\n context.reportError(\n `Union type ${union} can only include type ${memberType} once.`,\n getUnionMemberTypeNodes(union, memberType.name),\n );\n continue;\n }\n includedTypeNames.add(memberType.name);\n if (!isObjectType(memberType)) {\n context.reportError(\n `Union type ${union} can only include Object types, ` +\n `it cannot include ${inspect(memberType)}.`,\n getUnionMemberTypeNodes(union, String(memberType)),\n );\n }\n }\n}\n\nfunction validateEnumValues(\n context: SchemaValidationContext,\n enumType: GraphQLEnumType,\n): void {\n const enumValues = enumType.getValues();\n\n if (enumValues.length === 0) {\n context.reportError(\n `Enum type ${enumType} must define one or more values.`,\n [enumType.astNode, ...enumType.extensionASTNodes],\n );\n }\n\n for (const enumValue of enumValues) {\n // Ensure valid name.\n validateName(context, enumValue);\n }\n}\n\nfunction validateInputFields(\n context: SchemaValidationContext,\n inputObj: GraphQLInputObjectType,\n): void {\n const fields = Object.values(inputObj.getFields());\n\n if (fields.length === 0) {\n context.reportError(\n `Input Object type ${inputObj} must define one or more fields.`,\n [inputObj.astNode, ...inputObj.extensionASTNodes],\n );\n }\n\n // Ensure the input fields are valid\n for (const field of fields) {\n // Ensure they are named correctly.\n validateName(context, field);\n\n // Ensure the type is an input type\n if (!isInputType(field.type)) {\n context.reportError(\n `The type of ${field} must be Input Type ` +\n `but got: ${inspect(field.type)}.`,\n field.astNode?.type,\n );\n }\n\n if (isRequiredInputField(field) && field.deprecationReason != null) {\n context.reportError(\n `Required input field ${field} cannot be deprecated.`,\n [getDeprecatedDirectiveNode(field.astNode), field.astNode?.type],\n );\n }\n\n validateDefaultValue(context, field);\n\n if (inputObj.isOneOf) {\n validateOneOfInputObjectField(inputObj, field, context);\n }\n }\n}\n\nfunction validateOneOfInputObjectField(\n type: GraphQLInputObjectType,\n field: GraphQLInputField,\n context: SchemaValidationContext,\n): void {\n if (isNonNullType(field.type)) {\n context.reportError(\n `OneOf input field ${type}.${field.name} must be nullable.`,\n field.astNode?.type,\n );\n }\n\n if (field.default !== undefined || field.defaultValue !== undefined) {\n context.reportError(\n `OneOf input field ${type}.${field.name} cannot have a default value.`,\n field.astNode,\n );\n }\n}\n\ninterface InputObjectFiniteValueTarget {\n field: GraphQLInputField;\n target: GraphQLInputObjectType;\n}\n\ninterface InputObjectFiniteValueState {\n inputObj: GraphQLInputObjectType;\n targets: Array;\n dependents: Array;\n unresolvedTargetCount: number;\n hasFiniteValue: boolean;\n}\n\n// Implements the spec's InputObjectHasUnbreakableCycle algorithm for all Input\n// Objects in one pass by propagating known breakable types through reverse edges.\nfunction detectInputObjectNonFiniteValues(\n context: SchemaValidationContext,\n finiteValueStates: ReadonlyMap<\n GraphQLInputObjectType,\n InputObjectFiniteValueState\n >,\n): void {\n const inputObjectsWithFiniteValues: Array = [];\n\n for (const state of finiteValueStates.values()) {\n const inputObj = state.inputObj;\n const fields = Object.values(inputObj.getFields());\n\n for (const field of fields) {\n const target = getFiniteValueTarget(inputObj, field.type);\n if (target === undefined) {\n continue;\n }\n\n state.targets.push({ field, target });\n const targetState = finiteValueStates.get(target);\n if (targetState !== undefined) {\n targetState.dependents.push(state);\n }\n }\n\n if (inputObj.isOneOf) {\n // OneOf Input Objects have an unbreakable cycle if every field leads to an unbreakable cycle.\n if (fields.length === 0 || state.targets.length < fields.length) {\n markInputObjectHasFiniteValue(state);\n }\n } else {\n // Non-OneOf Input Objects have an unbreakable cycle if any non-null field has one.\n state.unresolvedTargetCount = state.targets.length;\n if (state.targets.length === 0) {\n markInputObjectHasFiniteValue(state);\n }\n }\n }\n\n let nextFiniteValueState: InputObjectFiniteValueState | undefined;\n while (\n (nextFiniteValueState = inputObjectsWithFiniteValues.pop()) !== undefined\n ) {\n for (const dependentState of nextFiniteValueState.dependents) {\n if (dependentState.hasFiniteValue) {\n continue;\n }\n\n if (dependentState.inputObj.isOneOf) {\n markInputObjectHasFiniteValue(dependentState);\n continue;\n }\n\n --dependentState.unresolvedTargetCount;\n if (dependentState.unresolvedTargetCount === 0) {\n markInputObjectHasFiniteValue(dependentState);\n }\n }\n }\n\n // Tracks already visited types to ensure that cycles are not redundantly\n // reported.\n const visitedTypes = new Set();\n\n // Array of fields used to produce meaningful errors.\n const fieldPath: Array<{ fieldStr: string; astNode: Maybe }> = [];\n\n // Position in the field path.\n const fieldPathIndexByType = new Map();\n\n for (const state of finiteValueStates.values()) {\n if (!state.hasFiniteValue) {\n reportCycleRecursive(state);\n }\n }\n\n function markInputObjectHasFiniteValue(\n finiteValueState: InputObjectFiniteValueState,\n ): void {\n if (!finiteValueState.hasFiniteValue) {\n finiteValueState.hasFiniteValue = true;\n inputObjectsWithFiniteValues.push(finiteValueState);\n }\n }\n\n function reportCycleRecursive(state: InputObjectFiniteValueState): void {\n const inputObj = state.inputObj;\n if (visitedTypes.has(inputObj)) {\n return;\n }\n\n visitedTypes.add(inputObj);\n fieldPathIndexByType.set(inputObj, fieldPath.length);\n\n for (const { field, target } of state.targets) {\n const targetState = finiteValueStates.get(target);\n if (targetState?.hasFiniteValue !== false) {\n continue;\n }\n\n const cycleIndex = fieldPathIndexByType.get(target);\n fieldPath.push({\n fieldStr: `${inputObj}.${field.name}`,\n astNode: field.astNode,\n });\n\n if (cycleIndex === undefined) {\n reportCycleRecursive(targetState);\n } else {\n const cyclePath = fieldPath.slice(cycleIndex);\n const pathStr = cyclePath.map((p) => p.fieldStr).join(', ');\n context.reportError(\n `Input Object ${target} cannot be provided a finite value because it references itself through fields: ${pathStr}.`,\n cyclePath.map((p) => p.astNode),\n );\n }\n\n fieldPath.pop();\n }\n\n fieldPathIndexByType.delete(inputObj);\n }\n}\n\nfunction getFiniteValueTarget(\n inputObj: GraphQLInputObjectType,\n fieldType: GraphQLInputType,\n): GraphQLInputObjectType | undefined {\n if (inputObj.isOneOf) {\n if (isInputObjectType(fieldType)) {\n return fieldType;\n }\n return;\n }\n\n if (isNonNullType(fieldType) && isInputObjectType(fieldType.ofType)) {\n return fieldType.ofType;\n }\n}\n\nfunction createInputObjectDefaultValueCircularRefsValidator(\n context: SchemaValidationContext,\n): (inputObj: GraphQLInputObjectType) => void {\n // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'.\n // Tracks already visited types to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n const visitedFields = Object.create(null);\n\n // Array of keys for fields and default values used to produce meaningful errors.\n const fieldPath: Array<\n [fieldStr: string, defaultValue: ConstValueNode | undefined]\n > = [];\n\n // Position in the path\n const fieldPathIndex: ObjMap = Object.create(null);\n\n // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n return function validateInputObjectDefaultValueCircularRefs(\n inputObj: GraphQLInputObjectType,\n ): void {\n // Start with an empty object as a way to visit every field in this input\n // object type and apply every default value.\n return detectValueDefaultValueCycle(inputObj, Object.create(null));\n };\n\n function detectValueDefaultValueCycle(\n inputObj: GraphQLInputObjectType,\n defaultValue: unknown,\n ): void {\n // If the value is a List, recursively check each entry for a cycle.\n // Otherwise, only object values can contain a cycle.\n if (isIterableObject(defaultValue)) {\n for (const itemValue of defaultValue) {\n detectValueDefaultValueCycle(inputObj, itemValue);\n }\n return;\n } else if (!isObjectLike(defaultValue)) {\n return;\n }\n\n // Check each defined field for a cycle.\n for (const field of Object.values(inputObj.getFields())) {\n const namedFieldType = getNamedType(field.type);\n\n // Only input object type fields can result in a cycle.\n if (!isInputObjectType(namedFieldType)) {\n continue;\n }\n\n if (Object.hasOwn(defaultValue, field.name)) {\n // If the provided value has this field defined, recursively check it\n // for cycles.\n detectValueDefaultValueCycle(namedFieldType, defaultValue[field.name]);\n } else {\n // Otherwise check this field's default value for cycles.\n detectFieldDefaultValueCycle(\n field,\n namedFieldType,\n `${inputObj}.${field.name}`,\n );\n }\n }\n }\n\n function detectLiteralDefaultValueCycle(\n inputObj: GraphQLInputObjectType,\n defaultValue: ConstValueNode,\n ): void {\n // If the value is a List, recursively check each entry for a cycle.\n // Otherwise, only object values can contain a cycle.\n if (defaultValue.kind === Kind.LIST) {\n for (const itemLiteral of defaultValue.values) {\n detectLiteralDefaultValueCycle(inputObj, itemLiteral);\n }\n return;\n } else if (defaultValue.kind !== Kind.OBJECT) {\n return;\n }\n\n // Check each defined field for a cycle.\n const fieldNodes = keyMap(defaultValue.fields, (field) => field.name.value);\n for (const field of Object.values(inputObj.getFields())) {\n const namedFieldType = getNamedType(field.type);\n\n // Only input object type fields can result in a cycle.\n if (!isInputObjectType(namedFieldType)) {\n continue;\n }\n\n if (Object.hasOwn(fieldNodes, field.name)) {\n // If the provided value has this field defined, recursively check it\n // for cycles.\n detectLiteralDefaultValueCycle(\n namedFieldType,\n fieldNodes[field.name].value,\n );\n } else {\n // Otherwise check this field's default value for cycles.\n detectFieldDefaultValueCycle(\n field,\n namedFieldType,\n `${inputObj}.${field.name}`,\n );\n }\n }\n }\n\n function detectFieldDefaultValueCycle(\n field: GraphQLInputField,\n fieldType: GraphQLInputObjectType,\n fieldStr: string,\n ): void {\n // Only a field with a default value can result in a cycle.\n const defaultInput = field.default;\n if (defaultInput === undefined) {\n return;\n }\n\n // Check to see if there is cycle.\n const cycleIndex = fieldPathIndex[fieldStr];\n if (cycleIndex !== undefined) {\n context.reportError(\n `Invalid circular reference. The default value of Input Object field ${fieldStr} references itself${\n cycleIndex < fieldPath.length\n ? ` via the default values of: ${fieldPath\n .slice(cycleIndex)\n .map(([stringForMessage]) => stringForMessage)\n .join(', ')}`\n : ''\n }.`,\n fieldPath.slice(cycleIndex - 1).map(([, node]) => node),\n );\n return;\n }\n\n // Recurse into this field's default value once, tracking the path.\n if (visitedFields[fieldStr] === undefined) {\n visitedFields[fieldStr] = true;\n fieldPathIndex[fieldStr] = fieldPath.push([\n fieldStr,\n field.astNode?.defaultValue,\n ]);\n if (defaultInput.literal) {\n detectLiteralDefaultValueCycle(fieldType, defaultInput.literal);\n } else {\n detectValueDefaultValueCycle(fieldType, defaultInput.value);\n }\n fieldPath.pop();\n fieldPathIndex[fieldStr] = undefined;\n }\n }\n}\n\nfunction getAllImplementsInterfaceNodes(\n type: GraphQLObjectType | GraphQLInterfaceType,\n iface: GraphQLInterfaceType,\n): ReadonlyArray {\n const { astNode, extensionASTNodes } = type;\n const nodes: ReadonlyArray<\n | ObjectTypeDefinitionNode\n | ObjectTypeExtensionNode\n | InterfaceTypeDefinitionNode\n | InterfaceTypeExtensionNode\n > = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes;\n\n return nodes\n .flatMap((typeNode) => typeNode.interfaces ?? [])\n .filter((ifaceNode) => ifaceNode.name.value === iface.name);\n}\n\nfunction getUnionMemberTypeNodes(\n union: GraphQLUnionType,\n typeName: string,\n): ReadonlyArray {\n const { astNode, extensionASTNodes } = union;\n const nodes: ReadonlyArray =\n astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes;\n\n return nodes\n .flatMap((unionNode) => unionNode.types ?? [])\n .filter((typeNode) => typeNode.name.value === typeName);\n}\n\nfunction getDeprecatedDirectiveNode(\n definitionNode: Maybe<{\n readonly directives?: ReadonlyArray | undefined;\n }>,\n): Maybe {\n return definitionNode?.directives?.find(\n (node) => node.name.value === GraphQLDeprecatedDirective.name,\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.mts new file mode 100644 index 00000000..d4c9130d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.mts @@ -0,0 +1,618 @@ +/** @category Type Info */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ASTNode, FragmentDefinitionNode, VariableDefinitionNode } from "../language/ast.mjs"; +import type { ASTVisitor } from "../language/visitor.mjs"; +import type { GraphQLArgument, GraphQLCompositeType, GraphQLEnumValue, GraphQLField, GraphQLInputType, GraphQLOutputType, GraphQLType } from "../type/definition.mjs"; +import type { GraphQLDirective } from "../type/directives.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +/** @internal */ +export interface FragmentSignature { + readonly definition: FragmentDefinitionNode; + readonly variableDefinitions: Map; +} +/** + * TypeInfo is a utility class which, given a GraphQL schema, can keep track + * of the current field and type definitions at any point in a GraphQL document + * AST during a recursive descent by calling `enter(node)` and `leave(node)`. + */ +export declare class TypeInfo { + private _schema; + private _typeStack; + private _parentTypeStack; + private _inputTypeStack; + private _fieldDefStack; + private _defaultValueStack; + private _directive; + private _argument; + private _enumValue; + private _fragmentSignaturesByName; + private _fragmentSignature; + private _fragmentArgument; + /** + * Creates a TypeInfo instance. + * @param schema - Schema used for type lookups. + * @param initialType - Optional type to use at the start of traversal. + * @param fragmentSignatures - Fragment signatures available during traversal. + * @example + * ```ts + * // Track field types during a visitWithTypeInfo traversal. + * import { parse, visit } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const seenTypes = []; + * + * visit( + * parse('{ greeting }'), + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * seenTypes.push(String(typeInfo.getType())); + * }, + * }), + * ); + * + * seenTypes; // => ['String'] + * ``` + * @example + * ```ts + * // This variant starts from an initial type and supplies fragment signatures. + * import { Kind, parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const fragmentDocument = parse( + * 'fragment GreetingFields($name: String) on Query { greeting(name: $name) }', + * { experimentalFragmentArguments: true }, + * ); + * const fragmentDefinition = fragmentDocument.definitions[0]; + * const variableDefinition = fragmentDefinition.variableDefinitions[0]; + * const typeInfo = new TypeInfo(schema, schema.getQueryType(), (name) => + * name === 'GreetingFields' + * ? { + * definition: fragmentDefinition, + * variableDefinitions: new Map([['name', variableDefinition]]), + * } + * : undefined, + * ); + * + * typeInfo.enter({ + * kind: Kind.SELECTION_SET, + * selections: [], + * }); + * typeInfo.enter({ + * kind: Kind.FRAGMENT_SPREAD, + * name: { kind: Kind.NAME, value: 'GreetingFields' }, + * arguments: [], + * directives: [], + * }); + * + * String(typeInfo.getParentType()); // => 'Query' + * typeInfo.getFragmentSignature()?.definition.name.value; // => 'GreetingFields' + * ``` + */ + constructor(schema: GraphQLSchema, + /** + * Initial type may be provided in rare cases to facilitate traversals + * beginning somewhere other than documents. + */ + initialType?: Maybe, fragmentSignatures?: Maybe<(fragmentName: string) => Maybe>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the current output type at this point in traversal. + * @returns The current output type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * viewer: User + * } + * + * type User { + * name: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const fieldTypes = {}; + * + * visit( + * parse('{ viewer { name } }'), + * visitWithTypeInfo(typeInfo, { + * Field: (node) => { + * fieldTypes[node.name.value] = String(typeInfo.getType()); + * }, + * }), + * ); + * + * fieldTypes; // => { viewer: 'User', name: 'String' } + * ``` + */ + getType(): Maybe; + /** + * Returns the current parent composite type. + * @returns The current parent composite type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * viewer: User + * } + * + * type User { + * name: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const parentTypes = {}; + * + * visit( + * parse('{ viewer { name } }'), + * visitWithTypeInfo(typeInfo, { + * Field: (node) => { + * parentTypes[node.name.value] = String(typeInfo.getParentType()); + * }, + * }), + * ); + * + * parentTypes; // => { viewer: 'Query', name: 'User' } + * ``` + */ + getParentType(): Maybe; + /** + * Returns the current input type at this point in traversal. + * @returns The current input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!, sort: Sort = NEWEST): [String] + * } + * + * enum Sort { + * NEWEST + * OLDEST + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const inputTypes = {}; + * + * visit( + * parse('{ reviews(stars: 5, sort: OLDEST) }'), + * visitWithTypeInfo(typeInfo, { + * Argument: (node) => { + * inputTypes[node.name.value] = String(typeInfo.getInputType()); + * }, + * }), + * ); + * + * inputTypes; // => { stars: 'Int!', sort: 'Sort' } + * ``` + */ + getInputType(): Maybe; + /** + * Returns the parent input type for the current input position. + * @returns The parent input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * input ReviewFilter { + * stars: Int! + * } + * + * type Query { + * reviews(filter: ReviewFilter): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const parentInputTypes = {}; + * + * visit( + * parse('{ reviews(filter: { stars: 5 }) }'), + * visitWithTypeInfo(typeInfo, { + * ObjectField: (node) => { + * parentInputTypes[node.name.value] = String(typeInfo.getParentInputType()); + * }, + * }), + * ); + * + * parentInputTypes; // => { stars: 'ReviewFilter' } + * ``` + */ + getParentInputType(): Maybe; + /** + * Returns the current field definition. + * @returns The current field definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let fieldName; + * + * visit( + * parse('{ greeting }'), + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * fieldName = typeInfo.getFieldDef()?.name; + * }, + * }), + * ); + * + * fieldName; // => 'greeting' + * ``` + */ + getFieldDef(): Maybe>; + /** + * Returns the default input representation for the current input position. + * @returns The current default input, if one is available. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int = 10): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let defaultLimit; + * + * visit( + * parse('{ reviews(limit: 5) }'), + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * defaultLimit = typeInfo.getDefaultValue(); + * }, + * }), + * ); + * + * defaultLimit; // => { literal: { kind: 'IntValue', value: '10' } } + * ``` + */ + getDefaultValue(): unknown; + /** + * Returns the current directive definition. + * @returns The current directive definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let directiveName; + * + * visit( + * parse('{ greeting @include(if: true) }'), + * visitWithTypeInfo(typeInfo, { + * Directive: () => { + * directiveName = typeInfo.getDirective()?.name; + * }, + * }), + * ); + * + * directiveName; // => 'include' + * ``` + */ + getDirective(): Maybe; + /** + * Returns the current argument definition. + * @returns The current argument definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int = 10): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let argumentName; + * + * visit( + * parse('{ reviews(limit: 5) }'), + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * argumentName = typeInfo.getArgument()?.name; + * }, + * }), + * ); + * + * argumentName; // => 'limit' + * ``` + */ + getArgument(): Maybe; + /** + * Returns the current fragment signature. + * @returns The fragment signature for the current fragment definition. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * FragmentSpread: () => { + * fragmentName = typeInfo.getFragmentSignature()?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignature(): Maybe; + /** + * Returns the function used to look up fragment signatures by name. + * @returns A function that maps fragment names to fragment signatures. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Document: () => { + * const getFragmentSignature = typeInfo.getFragmentSignatureByName(); + * fragmentName = + * getFragmentSignature('GreetingFields')?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignatureByName(): (fragmentName: string) => Maybe; + /** + * Returns the current fragment argument definition. + * @returns The variable definition for the current fragment argument. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields(name: "Ada") + * } + * + * fragment GreetingFields($name: String) on Query { + * greeting(name: $name) + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * let argumentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * FragmentArgument: () => { + * argumentName = typeInfo.getFragmentArgument()?.variable.name.value; + * }, + * }), + * ); + * + * argumentName; // => 'name' + * ``` + */ + getFragmentArgument(): Maybe; + /** + * Returns the current enum value definition. + * @returns The current enum value definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * enum Sort { + * NEWEST + * OLDEST + * } + * + * type Query { + * reviews(sort: Sort = NEWEST): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let enumValueName; + * + * visit( + * parse('{ reviews(sort: OLDEST) }'), + * visitWithTypeInfo(typeInfo, { + * EnumValue: () => { + * enumValueName = typeInfo.getEnumValue()?.name; + * }, + * }), + * ); + * + * enumValueName; // => 'OLDEST' + * ``` + */ + getEnumValue(): Maybe; + /** + * Updates this TypeInfo instance for an entered AST node. + * @param node - AST node being entered. + * @returns Nothing. + * @example + * ```ts + * import { Kind, parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const operation = document.definitions[0]; + * const selectionSet = operation.selectionSet; + * const field = selectionSet.selections[0]; + * const typeInfo = new TypeInfo(schema); + * + * typeInfo.enter(operation); + * typeInfo.enter(selectionSet); + * typeInfo.enter(field); + * + * field.kind; // => Kind.FIELD + * typeInfo.getParentType()?.name; // => 'Query' + * String(typeInfo.getType()); // => 'String' + * ``` + */ + enter(node: ASTNode): void; + /** + * Updates this TypeInfo instance for a left AST node. + * @param node - AST node being entered. + * @returns Nothing. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const operation = document.definitions[0]; + * const selectionSet = operation.selectionSet; + * const field = selectionSet.selections[0]; + * const typeInfo = new TypeInfo(schema); + * + * typeInfo.enter(operation); + * typeInfo.enter(selectionSet); + * typeInfo.enter(field); + * String(typeInfo.getType()); // => 'String' + * + * typeInfo.leave(field); + * typeInfo.getType(); // => undefined + * ``` + */ + leave(node: ASTNode): void; +} +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + * @param typeInfo - TypeInfo instance to update during traversal. + * @param visitor - Visitor callbacks to wrap with TypeInfo updates. + * @returns A visitor that keeps TypeInfo in sync while delegating callbacks. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const fields = []; + * + * visit( + * parse('{ greeting }'), + * visitWithTypeInfo(typeInfo, { + * Field: (node) => { + * fields.push({ + * name: node.name.value, + * parentType: String(typeInfo.getParentType()), + * type: String(typeInfo.getType()), + * }); + * }, + * }), + * ); + * + * fields; // => [{ name: 'greeting', parentType: 'Query', type: 'String' }] + * ``` + */ +export declare function visitWithTypeInfo(typeInfo: TypeInfo, visitor: ASTVisitor): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.ts new file mode 100644 index 00000000..e2359465 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.d.ts @@ -0,0 +1,618 @@ +/** @category Type Info */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ASTNode, FragmentDefinitionNode, VariableDefinitionNode } from "../language/ast.js"; +import type { ASTVisitor } from "../language/visitor.js"; +import type { GraphQLArgument, GraphQLCompositeType, GraphQLEnumValue, GraphQLField, GraphQLInputType, GraphQLOutputType, GraphQLType } from "../type/definition.js"; +import type { GraphQLDirective } from "../type/directives.js"; +import type { GraphQLSchema } from "../type/schema.js"; +/** @internal */ +export interface FragmentSignature { + readonly definition: FragmentDefinitionNode; + readonly variableDefinitions: Map; +} +/** + * TypeInfo is a utility class which, given a GraphQL schema, can keep track + * of the current field and type definitions at any point in a GraphQL document + * AST during a recursive descent by calling `enter(node)` and `leave(node)`. + */ +export declare class TypeInfo { + private _schema; + private _typeStack; + private _parentTypeStack; + private _inputTypeStack; + private _fieldDefStack; + private _defaultValueStack; + private _directive; + private _argument; + private _enumValue; + private _fragmentSignaturesByName; + private _fragmentSignature; + private _fragmentArgument; + /** + * Creates a TypeInfo instance. + * @param schema - Schema used for type lookups. + * @param initialType - Optional type to use at the start of traversal. + * @param fragmentSignatures - Fragment signatures available during traversal. + * @example + * ```ts + * // Track field types during a visitWithTypeInfo traversal. + * import { parse, visit } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const seenTypes = []; + * + * visit( + * parse('{ greeting }'), + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * seenTypes.push(String(typeInfo.getType())); + * }, + * }), + * ); + * + * seenTypes; // => ['String'] + * ``` + * @example + * ```ts + * // This variant starts from an initial type and supplies fragment signatures. + * import { Kind, parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const fragmentDocument = parse( + * 'fragment GreetingFields($name: String) on Query { greeting(name: $name) }', + * { experimentalFragmentArguments: true }, + * ); + * const fragmentDefinition = fragmentDocument.definitions[0]; + * const variableDefinition = fragmentDefinition.variableDefinitions[0]; + * const typeInfo = new TypeInfo(schema, schema.getQueryType(), (name) => + * name === 'GreetingFields' + * ? { + * definition: fragmentDefinition, + * variableDefinitions: new Map([['name', variableDefinition]]), + * } + * : undefined, + * ); + * + * typeInfo.enter({ + * kind: Kind.SELECTION_SET, + * selections: [], + * }); + * typeInfo.enter({ + * kind: Kind.FRAGMENT_SPREAD, + * name: { kind: Kind.NAME, value: 'GreetingFields' }, + * arguments: [], + * directives: [], + * }); + * + * String(typeInfo.getParentType()); // => 'Query' + * typeInfo.getFragmentSignature()?.definition.name.value; // => 'GreetingFields' + * ``` + */ + constructor(schema: GraphQLSchema, + /** + * Initial type may be provided in rare cases to facilitate traversals + * beginning somewhere other than documents. + */ + initialType?: Maybe, fragmentSignatures?: Maybe<(fragmentName: string) => Maybe>); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns the current output type at this point in traversal. + * @returns The current output type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * viewer: User + * } + * + * type User { + * name: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const fieldTypes = {}; + * + * visit( + * parse('{ viewer { name } }'), + * visitWithTypeInfo(typeInfo, { + * Field: (node) => { + * fieldTypes[node.name.value] = String(typeInfo.getType()); + * }, + * }), + * ); + * + * fieldTypes; // => { viewer: 'User', name: 'String' } + * ``` + */ + getType(): Maybe; + /** + * Returns the current parent composite type. + * @returns The current parent composite type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * viewer: User + * } + * + * type User { + * name: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const parentTypes = {}; + * + * visit( + * parse('{ viewer { name } }'), + * visitWithTypeInfo(typeInfo, { + * Field: (node) => { + * parentTypes[node.name.value] = String(typeInfo.getParentType()); + * }, + * }), + * ); + * + * parentTypes; // => { viewer: 'Query', name: 'User' } + * ``` + */ + getParentType(): Maybe; + /** + * Returns the current input type at this point in traversal. + * @returns The current input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * reviews(stars: Int!, sort: Sort = NEWEST): [String] + * } + * + * enum Sort { + * NEWEST + * OLDEST + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const inputTypes = {}; + * + * visit( + * parse('{ reviews(stars: 5, sort: OLDEST) }'), + * visitWithTypeInfo(typeInfo, { + * Argument: (node) => { + * inputTypes[node.name.value] = String(typeInfo.getInputType()); + * }, + * }), + * ); + * + * inputTypes; // => { stars: 'Int!', sort: 'Sort' } + * ``` + */ + getInputType(): Maybe; + /** + * Returns the parent input type for the current input position. + * @returns The parent input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * input ReviewFilter { + * stars: Int! + * } + * + * type Query { + * reviews(filter: ReviewFilter): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const parentInputTypes = {}; + * + * visit( + * parse('{ reviews(filter: { stars: 5 }) }'), + * visitWithTypeInfo(typeInfo, { + * ObjectField: (node) => { + * parentInputTypes[node.name.value] = String(typeInfo.getParentInputType()); + * }, + * }), + * ); + * + * parentInputTypes; // => { stars: 'ReviewFilter' } + * ``` + */ + getParentInputType(): Maybe; + /** + * Returns the current field definition. + * @returns The current field definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let fieldName; + * + * visit( + * parse('{ greeting }'), + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * fieldName = typeInfo.getFieldDef()?.name; + * }, + * }), + * ); + * + * fieldName; // => 'greeting' + * ``` + */ + getFieldDef(): Maybe>; + /** + * Returns the default input representation for the current input position. + * @returns The current default input, if one is available. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int = 10): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let defaultLimit; + * + * visit( + * parse('{ reviews(limit: 5) }'), + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * defaultLimit = typeInfo.getDefaultValue(); + * }, + * }), + * ); + * + * defaultLimit; // => { literal: { kind: 'IntValue', value: '10' } } + * ``` + */ + getDefaultValue(): unknown; + /** + * Returns the current directive definition. + * @returns The current directive definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let directiveName; + * + * visit( + * parse('{ greeting @include(if: true) }'), + * visitWithTypeInfo(typeInfo, { + * Directive: () => { + * directiveName = typeInfo.getDirective()?.name; + * }, + * }), + * ); + * + * directiveName; // => 'include' + * ``` + */ + getDirective(): Maybe; + /** + * Returns the current argument definition. + * @returns The current argument definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int = 10): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let argumentName; + * + * visit( + * parse('{ reviews(limit: 5) }'), + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * argumentName = typeInfo.getArgument()?.name; + * }, + * }), + * ); + * + * argumentName; // => 'limit' + * ``` + */ + getArgument(): Maybe; + /** + * Returns the current fragment signature. + * @returns The fragment signature for the current fragment definition. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * FragmentSpread: () => { + * fragmentName = typeInfo.getFragmentSignature()?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignature(): Maybe; + /** + * Returns the function used to look up fragment signatures by name. + * @returns A function that maps fragment names to fragment signatures. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Document: () => { + * const getFragmentSignature = typeInfo.getFragmentSignatureByName(); + * fragmentName = + * getFragmentSignature('GreetingFields')?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignatureByName(): (fragmentName: string) => Maybe; + /** + * Returns the current fragment argument definition. + * @returns The variable definition for the current fragment argument. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields(name: "Ada") + * } + * + * fragment GreetingFields($name: String) on Query { + * greeting(name: $name) + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * let argumentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * FragmentArgument: () => { + * argumentName = typeInfo.getFragmentArgument()?.variable.name.value; + * }, + * }), + * ); + * + * argumentName; // => 'name' + * ``` + */ + getFragmentArgument(): Maybe; + /** + * Returns the current enum value definition. + * @returns The current enum value definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * enum Sort { + * NEWEST + * OLDEST + * } + * + * type Query { + * reviews(sort: Sort = NEWEST): [String] + * } + * `); + * const typeInfo = new TypeInfo(schema); + * let enumValueName; + * + * visit( + * parse('{ reviews(sort: OLDEST) }'), + * visitWithTypeInfo(typeInfo, { + * EnumValue: () => { + * enumValueName = typeInfo.getEnumValue()?.name; + * }, + * }), + * ); + * + * enumValueName; // => 'OLDEST' + * ``` + */ + getEnumValue(): Maybe; + /** + * Updates this TypeInfo instance for an entered AST node. + * @param node - AST node being entered. + * @returns Nothing. + * @example + * ```ts + * import { Kind, parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const operation = document.definitions[0]; + * const selectionSet = operation.selectionSet; + * const field = selectionSet.selections[0]; + * const typeInfo = new TypeInfo(schema); + * + * typeInfo.enter(operation); + * typeInfo.enter(selectionSet); + * typeInfo.enter(field); + * + * field.kind; // => Kind.FIELD + * typeInfo.getParentType()?.name; // => 'Query' + * String(typeInfo.getType()); // => 'String' + * ``` + */ + enter(node: ASTNode): void; + /** + * Updates this TypeInfo instance for a left AST node. + * @param node - AST node being entered. + * @returns Nothing. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const operation = document.definitions[0]; + * const selectionSet = operation.selectionSet; + * const field = selectionSet.selections[0]; + * const typeInfo = new TypeInfo(schema); + * + * typeInfo.enter(operation); + * typeInfo.enter(selectionSet); + * typeInfo.enter(field); + * String(typeInfo.getType()); // => 'String' + * + * typeInfo.leave(field); + * typeInfo.getType(); // => undefined + * ``` + */ + leave(node: ASTNode): void; +} +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + * @param typeInfo - TypeInfo instance to update during traversal. + * @param visitor - Visitor callbacks to wrap with TypeInfo updates. + * @returns A visitor that keeps TypeInfo in sync while delegating callbacks. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const typeInfo = new TypeInfo(schema); + * const fields = []; + * + * visit( + * parse('{ greeting }'), + * visitWithTypeInfo(typeInfo, { + * Field: (node) => { + * fields.push({ + * name: node.name.value, + * parentType: String(typeInfo.getParentType()), + * type: String(typeInfo.getType()), + * }); + * }, + * }), + * ); + * + * fields; // => [{ name: 'greeting', parentType: 'Query', type: 'String' }] + * ``` + */ +export declare function visitWithTypeInfo(typeInfo: TypeInfo, visitor: ASTVisitor): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js new file mode 100644 index 00000000..20dbbefa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js @@ -0,0 +1,284 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeInfo = void 0; +exports.visitWithTypeInfo = visitWithTypeInfo; +const ast_ts_1 = require("../language/ast.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const visitor_ts_1 = require("../language/visitor.js"); +const definition_ts_1 = require("../type/definition.js"); +const typeFromAST_ts_1 = require("./typeFromAST.js"); +class TypeInfo { + constructor(schema, initialType, fragmentSignatures) { + this._schema = schema; + this._typeStack = []; + this._parentTypeStack = []; + this._inputTypeStack = []; + this._fieldDefStack = []; + this._defaultValueStack = []; + this._directive = null; + this._argument = null; + this._enumValue = null; + this._fragmentSignaturesByName = fragmentSignatures ?? (() => null); + this._fragmentSignature = null; + this._fragmentArgument = null; + if (initialType) { + if ((0, definition_ts_1.isInputType)(initialType)) { + this._inputTypeStack.push(initialType); + } + if ((0, definition_ts_1.isCompositeType)(initialType)) { + this._parentTypeStack.push(initialType); + } + if ((0, definition_ts_1.isOutputType)(initialType)) { + this._typeStack.push(initialType); + } + } + } + get [Symbol.toStringTag]() { + return 'TypeInfo'; + } + getType() { + return this._typeStack.at(-1); + } + getParentType() { + return this._parentTypeStack.at(-1); + } + getInputType() { + return this._inputTypeStack.at(-1); + } + getParentInputType() { + return this._inputTypeStack.at(-2); + } + getFieldDef() { + return this._fieldDefStack.at(-1); + } + getDefaultValue() { + return this._defaultValueStack.at(-1); + } + getDirective() { + return this._directive; + } + getArgument() { + return this._argument; + } + getFragmentSignature() { + return this._fragmentSignature; + } + getFragmentSignatureByName() { + return this._fragmentSignaturesByName; + } + getFragmentArgument() { + return this._fragmentArgument; + } + getEnumValue() { + return this._enumValue; + } + enter(node) { + const schema = this._schema; + switch (node.kind) { + case kinds_ts_1.Kind.DOCUMENT: { + const fragmentSignatures = getFragmentSignatures(node); + this._fragmentSignaturesByName = (fragmentName) => fragmentSignatures.get(fragmentName); + break; + } + case kinds_ts_1.Kind.SELECTION_SET: { + const namedType = (0, definition_ts_1.getNamedType)(this.getType()); + this._parentTypeStack.push((0, definition_ts_1.isCompositeType)(namedType) ? namedType : undefined); + break; + } + case kinds_ts_1.Kind.FIELD: { + const parentType = this.getParentType(); + let fieldDef; + let fieldType; + if (parentType) { + fieldDef = schema.getField(parentType, node.name.value); + if (fieldDef) { + fieldType = fieldDef.type; + } + } + this._fieldDefStack.push(fieldDef); + this._typeStack.push((0, definition_ts_1.isOutputType)(fieldType) ? fieldType : undefined); + break; + } + case kinds_ts_1.Kind.DIRECTIVE: + this._directive = schema.getDirective(node.name.value); + break; + case kinds_ts_1.Kind.OPERATION_DEFINITION: { + const rootType = schema.getRootType(node.operation); + this._typeStack.push((0, definition_ts_1.isObjectType)(rootType) ? rootType : undefined); + break; + } + case kinds_ts_1.Kind.FRAGMENT_SPREAD: { + this._fragmentSignature = this.getFragmentSignatureByName()(node.name.value); + break; + } + case kinds_ts_1.Kind.INLINE_FRAGMENT: + case kinds_ts_1.Kind.FRAGMENT_DEFINITION: { + const typeConditionAST = node.typeCondition; + const outputType = typeConditionAST + ? (0, typeFromAST_ts_1.typeFromAST)(schema, typeConditionAST) + : (0, definition_ts_1.getNamedType)(this.getType()); + this._typeStack.push((0, definition_ts_1.isOutputType)(outputType) ? outputType : undefined); + break; + } + case kinds_ts_1.Kind.VARIABLE_DEFINITION: { + const inputType = (0, typeFromAST_ts_1.typeFromAST)(schema, node.type); + this._inputTypeStack.push((0, definition_ts_1.isInputType)(inputType) ? inputType : undefined); + break; + } + case kinds_ts_1.Kind.ARGUMENT: { + let argDef; + let argType; + const fieldOrDirective = this.getDirective() ?? this.getFieldDef(); + if (fieldOrDirective) { + argDef = fieldOrDirective.args.find((arg) => arg.name === node.name.value); + if (argDef) { + argType = argDef.type; + } + } + this._argument = argDef; + this._defaultValueStack.push(argDef?.default ?? argDef?.defaultValue ?? undefined); + this._inputTypeStack.push((0, definition_ts_1.isInputType)(argType) ? argType : undefined); + break; + } + case kinds_ts_1.Kind.FRAGMENT_ARGUMENT: { + const fragmentSignature = this.getFragmentSignature(); + const argDef = fragmentSignature?.variableDefinitions.get(node.name.value); + this._fragmentArgument = argDef; + let argType; + if (argDef) { + argType = (0, typeFromAST_ts_1.typeFromAST)(this._schema, argDef.type); + } + this._inputTypeStack.push((0, definition_ts_1.isInputType)(argType) ? argType : undefined); + break; + } + case kinds_ts_1.Kind.LIST: { + const listType = (0, definition_ts_1.getNullableType)(this.getInputType()); + const itemType = (0, definition_ts_1.isListType)(listType) + ? listType.ofType + : undefined; + this._defaultValueStack.push(undefined); + this._inputTypeStack.push((0, definition_ts_1.isInputType)(itemType) ? itemType : undefined); + break; + } + case kinds_ts_1.Kind.OBJECT_FIELD: { + const objectType = (0, definition_ts_1.getNamedType)(this.getInputType()); + let inputFieldType; + let inputField; + if ((0, definition_ts_1.isInputObjectType)(objectType)) { + inputField = objectType.getFields()[node.name.value]; + if (inputField != null) { + inputFieldType = inputField.type; + } + } + this._defaultValueStack.push(inputField?.default ?? inputField?.defaultValue ?? undefined); + this._inputTypeStack.push((0, definition_ts_1.isInputType)(inputFieldType) ? inputFieldType : undefined); + break; + } + case kinds_ts_1.Kind.ENUM: { + const enumType = (0, definition_ts_1.getNamedType)(this.getInputType()); + let enumValue; + if ((0, definition_ts_1.isEnumType)(enumType)) { + enumValue = enumType.getValue(node.value); + } + this._enumValue = enumValue; + break; + } + default: + } + } + leave(node) { + switch (node.kind) { + case kinds_ts_1.Kind.DOCUMENT: + this._fragmentSignaturesByName = () => null; + break; + case kinds_ts_1.Kind.SELECTION_SET: + this._parentTypeStack.pop(); + break; + case kinds_ts_1.Kind.FIELD: + this._fieldDefStack.pop(); + this._typeStack.pop(); + break; + case kinds_ts_1.Kind.DIRECTIVE: + this._directive = null; + break; + case kinds_ts_1.Kind.FRAGMENT_SPREAD: + this._fragmentSignature = null; + break; + case kinds_ts_1.Kind.OPERATION_DEFINITION: + case kinds_ts_1.Kind.INLINE_FRAGMENT: + case kinds_ts_1.Kind.FRAGMENT_DEFINITION: + this._typeStack.pop(); + break; + case kinds_ts_1.Kind.VARIABLE_DEFINITION: + this._inputTypeStack.pop(); + break; + case kinds_ts_1.Kind.ARGUMENT: + this._argument = null; + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case kinds_ts_1.Kind.FRAGMENT_ARGUMENT: { + this._fragmentArgument = null; + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + } + case kinds_ts_1.Kind.LIST: + case kinds_ts_1.Kind.OBJECT_FIELD: + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case kinds_ts_1.Kind.ENUM: + this._enumValue = null; + break; + default: + } + } +} +exports.TypeInfo = TypeInfo; +function getFragmentSignatures(document) { + const fragmentSignatures = new Map(); + for (const definition of document.definitions) { + if (definition.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION) { + const variableDefinitions = new Map(); + if (definition.variableDefinitions) { + for (const varDef of definition.variableDefinitions) { + variableDefinitions.set(varDef.variable.name.value, varDef); + } + } + const signature = { definition, variableDefinitions }; + fragmentSignatures.set(definition.name.value, signature); + } + } + return fragmentSignatures; +} +function visitWithTypeInfo(typeInfo, visitor) { + return { + enter(...args) { + const node = args[0]; + typeInfo.enter(node); + const fn = (0, visitor_ts_1.getEnterLeaveForKind)(visitor, node.kind).enter; + if (fn) { + const result = fn.apply(visitor, args); + if (result !== undefined) { + typeInfo.leave(node); + if ((0, ast_ts_1.isNode)(result)) { + typeInfo.enter(result); + } + } + return result; + } + }, + leave(...args) { + const node = args[0]; + const fn = (0, visitor_ts_1.getEnterLeaveForKind)(visitor, node.kind).leave; + let result; + if (fn) { + result = fn.apply(visitor, args); + } + typeInfo.leave(node); + return result; + }, + }; +} +//# sourceMappingURL=TypeInfo.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js.map new file mode 100644 index 00000000..48c59d2a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeInfo.js","sourceRoot":"","sources":["../../src/utilities/TypeInfo.ts"],"names":[],"mappings":";;;AAs6BA,8CA+BC;AA37BD,+CAA4C;AAC5C,mDAA4C;AAE5C,uDAA8D;AAY9D,yDAU+B;AAI/B,qDAA+C;AAa/C,MAAa,QAAQ;IAyFnB,YACE,MAAqB,EAKrB,WAAgC,EAChC,kBAEC;QAED,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC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I,CAAC,CAAC,CAAC,CAAC;YACrB,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACrB,MAAM,EAAE,GAAG,IAAA,iCAAoB,EAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;YAC1D,IAAI,EAAE,EAAE,CAAC;gBACP,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBACvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBACzB,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBACrB,IAAI,IAAA,eAAM,EAAC,MAAM,CAAC,EAAE,CAAC;wBACnB,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACzB,CAAC;gBACH,CAAC;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;QACD,KAAK,CAAC,GAAG,IAAI;YACX,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACrB,MAAM,EAAE,GAAG,IAAA,iCAAoB,EAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;YAC1D,IAAI,MAAM,CAAC;YACX,IAAI,EAAE,EAAE,CAAC;gBACP,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACnC,CAAC;YACD,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Type Info */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n ASTNode,\n DocumentNode,\n FragmentDefinitionNode,\n VariableDefinitionNode,\n} from '../language/ast.ts';\nimport { isNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport type { ASTVisitor } from '../language/visitor.ts';\nimport { getEnterLeaveForKind } from '../language/visitor.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLCompositeType,\n GraphQLEnumValue,\n GraphQLField,\n GraphQLInputField,\n GraphQLInputType,\n GraphQLOutputType,\n GraphQLType,\n} from '../type/definition.ts';\nimport {\n getNamedType,\n getNullableType,\n isCompositeType,\n isEnumType,\n isInputObjectType,\n isInputType,\n isListType,\n isObjectType,\n isOutputType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { typeFromAST } from './typeFromAST.ts';\n\n/** @internal */\nexport interface FragmentSignature {\n readonly definition: FragmentDefinitionNode;\n readonly variableDefinitions: Map;\n}\n\n/**\n * TypeInfo is a utility class which, given a GraphQL schema, can keep track\n * of the current field and type definitions at any point in a GraphQL document\n * AST during a recursive descent by calling `enter(node)` and `leave(node)`.\n */\nexport class TypeInfo {\n private _schema: GraphQLSchema;\n private _typeStack: Array>;\n private _parentTypeStack: Array>;\n private _inputTypeStack: Array>;\n private _fieldDefStack: Array>>;\n private _defaultValueStack: Array;\n private _directive: Maybe;\n private _argument: Maybe;\n private _enumValue: Maybe;\n private _fragmentSignaturesByName: (\n fragmentName: string,\n ) => Maybe;\n\n private _fragmentSignature: Maybe;\n private _fragmentArgument: Maybe;\n\n /**\n * Creates a TypeInfo instance.\n * @param schema - Schema used for type lookups.\n * @param initialType - Optional type to use at the start of traversal.\n * @param fragmentSignatures - Fragment signatures available during traversal.\n * @example\n * ```ts\n * // Track field types during a visitWithTypeInfo traversal.\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const seenTypes = [];\n *\n * visit(\n * parse('{ greeting }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * seenTypes.push(String(typeInfo.getType()));\n * },\n * }),\n * );\n *\n * seenTypes; // => ['String']\n * ```\n * @example\n * ```ts\n * // This variant starts from an initial type and supplies fragment signatures.\n * import { Kind, parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const fragmentDocument = parse(\n * 'fragment GreetingFields($name: String) on Query { greeting(name: $name) }',\n * { experimentalFragmentArguments: true },\n * );\n * const fragmentDefinition = fragmentDocument.definitions[0];\n * const variableDefinition = fragmentDefinition.variableDefinitions[0];\n * const typeInfo = new TypeInfo(schema, schema.getQueryType(), (name) =>\n * name === 'GreetingFields'\n * ? {\n * definition: fragmentDefinition,\n * variableDefinitions: new Map([['name', variableDefinition]]),\n * }\n * : undefined,\n * );\n *\n * typeInfo.enter({\n * kind: Kind.SELECTION_SET,\n * selections: [],\n * });\n * typeInfo.enter({\n * kind: Kind.FRAGMENT_SPREAD,\n * name: { kind: Kind.NAME, value: 'GreetingFields' },\n * arguments: [],\n * directives: [],\n * });\n *\n * String(typeInfo.getParentType()); // => 'Query'\n * typeInfo.getFragmentSignature()?.definition.name.value; // => 'GreetingFields'\n * ```\n */\n constructor(\n schema: GraphQLSchema,\n /**\n * Initial type may be provided in rare cases to facilitate traversals\n * beginning somewhere other than documents.\n */\n initialType?: Maybe,\n fragmentSignatures?: Maybe<\n (fragmentName: string) => Maybe\n >,\n ) {\n this._schema = schema;\n this._typeStack = [];\n this._parentTypeStack = [];\n this._inputTypeStack = [];\n this._fieldDefStack = [];\n this._defaultValueStack = [];\n this._directive = null;\n this._argument = null;\n this._enumValue = null;\n this._fragmentSignaturesByName = fragmentSignatures ?? (() => null);\n this._fragmentSignature = null;\n this._fragmentArgument = null;\n if (initialType) {\n if (isInputType(initialType)) {\n this._inputTypeStack.push(initialType);\n }\n if (isCompositeType(initialType)) {\n this._parentTypeStack.push(initialType);\n }\n if (isOutputType(initialType)) {\n this._typeStack.push(initialType);\n }\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'TypeInfo';\n }\n\n /**\n * Returns the current output type at this point in traversal.\n * @returns The current output type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * viewer: User\n * }\n *\n * type User {\n * name: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const fieldTypes = {};\n *\n * visit(\n * parse('{ viewer { name } }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: (node) => {\n * fieldTypes[node.name.value] = String(typeInfo.getType());\n * },\n * }),\n * );\n *\n * fieldTypes; // => { viewer: 'User', name: 'String' }\n * ```\n */\n getType(): Maybe {\n return this._typeStack.at(-1);\n }\n\n /**\n * Returns the current parent composite type.\n * @returns The current parent composite type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * viewer: User\n * }\n *\n * type User {\n * name: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const parentTypes = {};\n *\n * visit(\n * parse('{ viewer { name } }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: (node) => {\n * parentTypes[node.name.value] = String(typeInfo.getParentType());\n * },\n * }),\n * );\n *\n * parentTypes; // => { viewer: 'Query', name: 'User' }\n * ```\n */\n getParentType(): Maybe {\n return this._parentTypeStack.at(-1);\n }\n\n /**\n * Returns the current input type at this point in traversal.\n * @returns The current input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!, sort: Sort = NEWEST): [String]\n * }\n *\n * enum Sort {\n * NEWEST\n * OLDEST\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const inputTypes = {};\n *\n * visit(\n * parse('{ reviews(stars: 5, sort: OLDEST) }'),\n * visitWithTypeInfo(typeInfo, {\n * Argument: (node) => {\n * inputTypes[node.name.value] = String(typeInfo.getInputType());\n * },\n * }),\n * );\n *\n * inputTypes; // => { stars: 'Int!', sort: 'Sort' }\n * ```\n */\n getInputType(): Maybe {\n return this._inputTypeStack.at(-1);\n }\n\n // Note: continues to expose the closest enclosing valid input type if\n // traversal descends into syntax with no corresponding GraphQL input type.\n /**\n * Returns the parent input type for the current input position.\n * @returns The parent input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * input ReviewFilter {\n * stars: Int!\n * }\n *\n * type Query {\n * reviews(filter: ReviewFilter): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const parentInputTypes = {};\n *\n * visit(\n * parse('{ reviews(filter: { stars: 5 }) }'),\n * visitWithTypeInfo(typeInfo, {\n * ObjectField: (node) => {\n * parentInputTypes[node.name.value] = String(typeInfo.getParentInputType());\n * },\n * }),\n * );\n *\n * parentInputTypes; // => { stars: 'ReviewFilter' }\n * ```\n */\n getParentInputType(): Maybe {\n return this._inputTypeStack.at(-2);\n }\n\n /**\n * Returns the current field definition.\n * @returns The current field definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let fieldName;\n *\n * visit(\n * parse('{ greeting }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * fieldName = typeInfo.getFieldDef()?.name;\n * },\n * }),\n * );\n *\n * fieldName; // => 'greeting'\n * ```\n */\n getFieldDef(): Maybe> {\n return this._fieldDefStack.at(-1);\n }\n\n /**\n * Returns the default input representation for the current input position.\n * @returns The current default input, if one is available.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int = 10): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let defaultLimit;\n *\n * visit(\n * parse('{ reviews(limit: 5) }'),\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * defaultLimit = typeInfo.getDefaultValue();\n * },\n * }),\n * );\n *\n * defaultLimit; // => { literal: { kind: 'IntValue', value: '10' } }\n * ```\n */\n getDefaultValue(): unknown {\n return this._defaultValueStack.at(-1);\n }\n\n /**\n * Returns the current directive definition.\n * @returns The current directive definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let directiveName;\n *\n * visit(\n * parse('{ greeting @include(if: true) }'),\n * visitWithTypeInfo(typeInfo, {\n * Directive: () => {\n * directiveName = typeInfo.getDirective()?.name;\n * },\n * }),\n * );\n *\n * directiveName; // => 'include'\n * ```\n */\n getDirective(): Maybe {\n return this._directive;\n }\n\n /**\n * Returns the current argument definition.\n * @returns The current argument definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int = 10): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let argumentName;\n *\n * visit(\n * parse('{ reviews(limit: 5) }'),\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * argumentName = typeInfo.getArgument()?.name;\n * },\n * }),\n * );\n *\n * argumentName; // => 'limit'\n * ```\n */\n getArgument(): Maybe {\n return this._argument;\n }\n\n /**\n * Returns the current fragment signature.\n * @returns The fragment signature for the current fragment definition.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * FragmentSpread: () => {\n * fragmentName = typeInfo.getFragmentSignature()?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignature(): Maybe {\n return this._fragmentSignature;\n }\n\n /**\n * Returns the function used to look up fragment signatures by name.\n * @returns A function that maps fragment names to fragment signatures.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Document: () => {\n * const getFragmentSignature = typeInfo.getFragmentSignatureByName();\n * fragmentName =\n * getFragmentSignature('GreetingFields')?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignatureByName(): (\n fragmentName: string,\n ) => Maybe {\n return this._fragmentSignaturesByName;\n }\n\n /**\n * Returns the current fragment argument definition.\n * @returns The variable definition for the current fragment argument.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields(name: \"Ada\")\n * }\n *\n * fragment GreetingFields($name: String) on Query {\n * greeting(name: $name)\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * let argumentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * FragmentArgument: () => {\n * argumentName = typeInfo.getFragmentArgument()?.variable.name.value;\n * },\n * }),\n * );\n *\n * argumentName; // => 'name'\n * ```\n */\n getFragmentArgument(): Maybe {\n return this._fragmentArgument;\n }\n\n /**\n * Returns the current enum value definition.\n * @returns The current enum value definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * enum Sort {\n * NEWEST\n * OLDEST\n * }\n *\n * type Query {\n * reviews(sort: Sort = NEWEST): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let enumValueName;\n *\n * visit(\n * parse('{ reviews(sort: OLDEST) }'),\n * visitWithTypeInfo(typeInfo, {\n * EnumValue: () => {\n * enumValueName = typeInfo.getEnumValue()?.name;\n * },\n * }),\n * );\n *\n * enumValueName; // => 'OLDEST'\n * ```\n */\n getEnumValue(): Maybe {\n return this._enumValue;\n }\n\n /**\n * Updates this TypeInfo instance for an entered AST node.\n * @param node - AST node being entered.\n * @returns Nothing.\n * @example\n * ```ts\n * import { Kind, parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const operation = document.definitions[0];\n * const selectionSet = operation.selectionSet;\n * const field = selectionSet.selections[0];\n * const typeInfo = new TypeInfo(schema);\n *\n * typeInfo.enter(operation);\n * typeInfo.enter(selectionSet);\n * typeInfo.enter(field);\n *\n * field.kind; // => Kind.FIELD\n * typeInfo.getParentType()?.name; // => 'Query'\n * String(typeInfo.getType()); // => 'String'\n * ```\n */\n enter(node: ASTNode): void {\n const schema = this._schema;\n // Note: many of the types below are explicitly typed as \"unknown\" to drop\n // any assumptions of a valid schema to ensure runtime types are properly\n // checked before continuing since TypeInfo is used as part of validation\n // which occurs before guarantees of schema and document validity.\n switch (node.kind) {\n case Kind.DOCUMENT: {\n const fragmentSignatures = getFragmentSignatures(node);\n this._fragmentSignaturesByName = (fragmentName: string) =>\n fragmentSignatures.get(fragmentName);\n break;\n }\n case Kind.SELECTION_SET: {\n const namedType: unknown = getNamedType(this.getType());\n this._parentTypeStack.push(\n isCompositeType(namedType) ? namedType : undefined,\n );\n break;\n }\n case Kind.FIELD: {\n const parentType = this.getParentType();\n let fieldDef;\n let fieldType: unknown;\n if (parentType) {\n fieldDef = schema.getField(parentType, node.name.value);\n if (fieldDef) {\n fieldType = fieldDef.type;\n }\n }\n this._fieldDefStack.push(fieldDef);\n this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined);\n break;\n }\n case Kind.DIRECTIVE:\n this._directive = schema.getDirective(node.name.value);\n break;\n case Kind.OPERATION_DEFINITION: {\n const rootType = schema.getRootType(node.operation);\n this._typeStack.push(isObjectType(rootType) ? rootType : undefined);\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n this._fragmentSignature = this.getFragmentSignatureByName()(\n node.name.value,\n );\n break;\n }\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION: {\n const typeConditionAST = node.typeCondition;\n const outputType: unknown = typeConditionAST\n ? typeFromAST(schema, typeConditionAST)\n : getNamedType(this.getType());\n this._typeStack.push(isOutputType(outputType) ? outputType : undefined);\n break;\n }\n case Kind.VARIABLE_DEFINITION: {\n const inputType: unknown = typeFromAST(schema, node.type);\n this._inputTypeStack.push(\n isInputType(inputType) ? inputType : undefined,\n );\n break;\n }\n case Kind.ARGUMENT: {\n let argDef;\n let argType: unknown;\n const fieldOrDirective = this.getDirective() ?? this.getFieldDef();\n if (fieldOrDirective) {\n argDef = fieldOrDirective.args.find(\n (arg) => arg.name === node.name.value,\n );\n if (argDef) {\n argType = argDef.type;\n }\n }\n this._argument = argDef;\n this._defaultValueStack.push(\n argDef?.default ?? argDef?.defaultValue ?? undefined,\n );\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n break;\n }\n case Kind.FRAGMENT_ARGUMENT: {\n const fragmentSignature = this.getFragmentSignature();\n const argDef = fragmentSignature?.variableDefinitions.get(\n node.name.value,\n );\n this._fragmentArgument = argDef;\n let argType: unknown;\n if (argDef) {\n argType = typeFromAST(this._schema, argDef.type);\n }\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n break;\n }\n case Kind.LIST: {\n const listType: unknown = getNullableType(this.getInputType());\n const itemType: unknown = isListType(listType)\n ? listType.ofType\n : undefined;\n // List positions never have a default value.\n this._defaultValueStack.push(undefined);\n this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined);\n break;\n }\n case Kind.OBJECT_FIELD: {\n const objectType: unknown = getNamedType(this.getInputType());\n let inputFieldType: GraphQLInputType | undefined;\n let inputField: GraphQLInputField | undefined;\n if (isInputObjectType(objectType)) {\n inputField = objectType.getFields()[node.name.value];\n if (inputField != null) {\n inputFieldType = inputField.type;\n }\n }\n this._defaultValueStack.push(\n inputField?.default ?? inputField?.defaultValue ?? undefined,\n );\n this._inputTypeStack.push(\n isInputType(inputFieldType) ? inputFieldType : undefined,\n );\n break;\n }\n case Kind.ENUM: {\n const enumType: unknown = getNamedType(this.getInputType());\n let enumValue;\n if (isEnumType(enumType)) {\n enumValue = enumType.getValue(node.value);\n }\n this._enumValue = enumValue;\n break;\n }\n default:\n // Ignore other nodes\n }\n }\n\n /**\n * Updates this TypeInfo instance for a left AST node.\n * @param node - AST node being entered.\n * @returns Nothing.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const operation = document.definitions[0];\n * const selectionSet = operation.selectionSet;\n * const field = selectionSet.selections[0];\n * const typeInfo = new TypeInfo(schema);\n *\n * typeInfo.enter(operation);\n * typeInfo.enter(selectionSet);\n * typeInfo.enter(field);\n * String(typeInfo.getType()); // => 'String'\n *\n * typeInfo.leave(field);\n * typeInfo.getType(); // => undefined\n * ```\n */\n leave(node: ASTNode): void {\n switch (node.kind) {\n case Kind.DOCUMENT:\n this._fragmentSignaturesByName = () => null;\n break;\n case Kind.SELECTION_SET:\n this._parentTypeStack.pop();\n break;\n case Kind.FIELD:\n this._fieldDefStack.pop();\n this._typeStack.pop();\n break;\n case Kind.DIRECTIVE:\n this._directive = null;\n break;\n case Kind.FRAGMENT_SPREAD:\n this._fragmentSignature = null;\n break;\n case Kind.OPERATION_DEFINITION:\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n this._typeStack.pop();\n break;\n case Kind.VARIABLE_DEFINITION:\n this._inputTypeStack.pop();\n break;\n case Kind.ARGUMENT:\n this._argument = null;\n this._defaultValueStack.pop();\n this._inputTypeStack.pop();\n break;\n case Kind.FRAGMENT_ARGUMENT: {\n this._fragmentArgument = null;\n this._defaultValueStack.pop();\n this._inputTypeStack.pop();\n break;\n }\n case Kind.LIST:\n case Kind.OBJECT_FIELD:\n this._defaultValueStack.pop();\n this._inputTypeStack.pop();\n break;\n case Kind.ENUM:\n this._enumValue = null;\n break;\n default:\n // Ignore other nodes\n }\n }\n}\n\nfunction getFragmentSignatures(\n document: DocumentNode,\n): Map {\n const fragmentSignatures = new Map();\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n const variableDefinitions = new Map();\n if (definition.variableDefinitions) {\n for (const varDef of definition.variableDefinitions) {\n variableDefinitions.set(varDef.variable.name.value, varDef);\n }\n }\n const signature = { definition, variableDefinitions };\n fragmentSignatures.set(definition.name.value, signature);\n }\n }\n return fragmentSignatures;\n}\n\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n * @param typeInfo - TypeInfo instance to update during traversal.\n * @param visitor - Visitor callbacks to wrap with TypeInfo updates.\n * @returns A visitor that keeps TypeInfo in sync while delegating callbacks.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const fields = [];\n *\n * visit(\n * parse('{ greeting }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: (node) => {\n * fields.push({\n * name: node.name.value,\n * parentType: String(typeInfo.getParentType()),\n * type: String(typeInfo.getType()),\n * });\n * },\n * }),\n * );\n *\n * fields; // => [{ name: 'greeting', parentType: 'Query', type: 'String' }]\n * ```\n */\nexport function visitWithTypeInfo(\n typeInfo: TypeInfo,\n visitor: ASTVisitor,\n): ASTVisitor {\n return {\n enter(...args) {\n const node = args[0];\n typeInfo.enter(node);\n const fn = getEnterLeaveForKind(visitor, node.kind).enter;\n if (fn) {\n const result = fn.apply(visitor, args);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave(...args) {\n const node = args[0];\n const fn = getEnterLeaveForKind(visitor, node.kind).leave;\n let result;\n if (fn) {\n result = fn.apply(visitor, args);\n }\n typeInfo.leave(node);\n return result;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs new file mode 100644 index 00000000..919ce7a8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs @@ -0,0 +1,279 @@ +import { isNode } from "../language/ast.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { getEnterLeaveForKind } from "../language/visitor.mjs"; +import { getNamedType, getNullableType, isCompositeType, isEnumType, isInputObjectType, isInputType, isListType, isObjectType, isOutputType, } from "../type/definition.mjs"; +import { typeFromAST } from "./typeFromAST.mjs"; +export class TypeInfo { + constructor(schema, initialType, fragmentSignatures) { + this._schema = schema; + this._typeStack = []; + this._parentTypeStack = []; + this._inputTypeStack = []; + this._fieldDefStack = []; + this._defaultValueStack = []; + this._directive = null; + this._argument = null; + this._enumValue = null; + this._fragmentSignaturesByName = fragmentSignatures ?? (() => null); + this._fragmentSignature = null; + this._fragmentArgument = null; + if (initialType) { + if (isInputType(initialType)) { + this._inputTypeStack.push(initialType); + } + if (isCompositeType(initialType)) { + this._parentTypeStack.push(initialType); + } + if (isOutputType(initialType)) { + this._typeStack.push(initialType); + } + } + } + get [Symbol.toStringTag]() { + return 'TypeInfo'; + } + getType() { + return this._typeStack.at(-1); + } + getParentType() { + return this._parentTypeStack.at(-1); + } + getInputType() { + return this._inputTypeStack.at(-1); + } + getParentInputType() { + return this._inputTypeStack.at(-2); + } + getFieldDef() { + return this._fieldDefStack.at(-1); + } + getDefaultValue() { + return this._defaultValueStack.at(-1); + } + getDirective() { + return this._directive; + } + getArgument() { + return this._argument; + } + getFragmentSignature() { + return this._fragmentSignature; + } + getFragmentSignatureByName() { + return this._fragmentSignaturesByName; + } + getFragmentArgument() { + return this._fragmentArgument; + } + getEnumValue() { + return this._enumValue; + } + enter(node) { + const schema = this._schema; + switch (node.kind) { + case Kind.DOCUMENT: { + const fragmentSignatures = getFragmentSignatures(node); + this._fragmentSignaturesByName = (fragmentName) => fragmentSignatures.get(fragmentName); + break; + } + case Kind.SELECTION_SET: { + const namedType = getNamedType(this.getType()); + this._parentTypeStack.push(isCompositeType(namedType) ? namedType : undefined); + break; + } + case Kind.FIELD: { + const parentType = this.getParentType(); + let fieldDef; + let fieldType; + if (parentType) { + fieldDef = schema.getField(parentType, node.name.value); + if (fieldDef) { + fieldType = fieldDef.type; + } + } + this._fieldDefStack.push(fieldDef); + this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined); + break; + } + case Kind.DIRECTIVE: + this._directive = schema.getDirective(node.name.value); + break; + case Kind.OPERATION_DEFINITION: { + const rootType = schema.getRootType(node.operation); + this._typeStack.push(isObjectType(rootType) ? rootType : undefined); + break; + } + case Kind.FRAGMENT_SPREAD: { + this._fragmentSignature = this.getFragmentSignatureByName()(node.name.value); + break; + } + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: { + const typeConditionAST = node.typeCondition; + const outputType = typeConditionAST + ? typeFromAST(schema, typeConditionAST) + : getNamedType(this.getType()); + this._typeStack.push(isOutputType(outputType) ? outputType : undefined); + break; + } + case Kind.VARIABLE_DEFINITION: { + const inputType = typeFromAST(schema, node.type); + this._inputTypeStack.push(isInputType(inputType) ? inputType : undefined); + break; + } + case Kind.ARGUMENT: { + let argDef; + let argType; + const fieldOrDirective = this.getDirective() ?? this.getFieldDef(); + if (fieldOrDirective) { + argDef = fieldOrDirective.args.find((arg) => arg.name === node.name.value); + if (argDef) { + argType = argDef.type; + } + } + this._argument = argDef; + this._defaultValueStack.push(argDef?.default ?? argDef?.defaultValue ?? undefined); + this._inputTypeStack.push(isInputType(argType) ? argType : undefined); + break; + } + case Kind.FRAGMENT_ARGUMENT: { + const fragmentSignature = this.getFragmentSignature(); + const argDef = fragmentSignature?.variableDefinitions.get(node.name.value); + this._fragmentArgument = argDef; + let argType; + if (argDef) { + argType = typeFromAST(this._schema, argDef.type); + } + this._inputTypeStack.push(isInputType(argType) ? argType : undefined); + break; + } + case Kind.LIST: { + const listType = getNullableType(this.getInputType()); + const itemType = isListType(listType) + ? listType.ofType + : undefined; + this._defaultValueStack.push(undefined); + this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined); + break; + } + case Kind.OBJECT_FIELD: { + const objectType = getNamedType(this.getInputType()); + let inputFieldType; + let inputField; + if (isInputObjectType(objectType)) { + inputField = objectType.getFields()[node.name.value]; + if (inputField != null) { + inputFieldType = inputField.type; + } + } + this._defaultValueStack.push(inputField?.default ?? inputField?.defaultValue ?? undefined); + this._inputTypeStack.push(isInputType(inputFieldType) ? inputFieldType : undefined); + break; + } + case Kind.ENUM: { + const enumType = getNamedType(this.getInputType()); + let enumValue; + if (isEnumType(enumType)) { + enumValue = enumType.getValue(node.value); + } + this._enumValue = enumValue; + break; + } + default: + } + } + leave(node) { + switch (node.kind) { + case Kind.DOCUMENT: + this._fragmentSignaturesByName = () => null; + break; + case Kind.SELECTION_SET: + this._parentTypeStack.pop(); + break; + case Kind.FIELD: + this._fieldDefStack.pop(); + this._typeStack.pop(); + break; + case Kind.DIRECTIVE: + this._directive = null; + break; + case Kind.FRAGMENT_SPREAD: + this._fragmentSignature = null; + break; + case Kind.OPERATION_DEFINITION: + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: + this._typeStack.pop(); + break; + case Kind.VARIABLE_DEFINITION: + this._inputTypeStack.pop(); + break; + case Kind.ARGUMENT: + this._argument = null; + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case Kind.FRAGMENT_ARGUMENT: { + this._fragmentArgument = null; + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + } + case Kind.LIST: + case Kind.OBJECT_FIELD: + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case Kind.ENUM: + this._enumValue = null; + break; + default: + } + } +} +function getFragmentSignatures(document) { + const fragmentSignatures = new Map(); + for (const definition of document.definitions) { + if (definition.kind === Kind.FRAGMENT_DEFINITION) { + const variableDefinitions = new Map(); + if (definition.variableDefinitions) { + for (const varDef of definition.variableDefinitions) { + variableDefinitions.set(varDef.variable.name.value, varDef); + } + } + const signature = { definition, variableDefinitions }; + fragmentSignatures.set(definition.name.value, signature); + } + } + return fragmentSignatures; +} +export function visitWithTypeInfo(typeInfo, visitor) { + return { + enter(...args) { + const node = args[0]; + typeInfo.enter(node); + const fn = getEnterLeaveForKind(visitor, node.kind).enter; + if (fn) { + const result = fn.apply(visitor, args); + if (result !== undefined) { + typeInfo.leave(node); + if (isNode(result)) { + typeInfo.enter(result); + } + } + return result; + } + }, + leave(...args) { + const node = args[0]; + const fn = getEnterLeaveForKind(visitor, node.kind).leave; + let result; + if (fn) { + result = fn.apply(visitor, args); + } + typeInfo.leave(node); + return result; + }, + }; +} +//# sourceMappingURL=TypeInfo.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs.map new file mode 100644 index 00000000..e4a9013f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/TypeInfo.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeInfo.js","sourceRoot":"","sources":["../../src/utilities/TypeInfo.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,4BAA2B;AAC5C,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAE5C,OAAO,EAAE,oBAAoB,EAAE,gCAA+B;AAY9D,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,GACb,+BAA8B;AAI/B,OAAO,EAAE,WAAW,EAAE,0BAAyB;AAa/C,MAAM,OAAO,QAAQ;IAyFnB,YACE,MAAqB,EAKrB,WAAgC,EAChC,kBAEC;QAED,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,kBAAkB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,EAAE,CAAC;gBACP,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBACvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBACzB,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBACrB,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;wBACnB,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACzB,CAAC;gBACH,CAAC;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;QACD,KAAK,CAAC,GAAG,IAAI;YACX,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACrB,MAAM,EAAE,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;YAC1D,IAAI,MAAM,CAAC;YACX,IAAI,EAAE,EAAE,CAAC;gBACP,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACnC,CAAC;YACD,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Type Info */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n ASTNode,\n DocumentNode,\n FragmentDefinitionNode,\n VariableDefinitionNode,\n} from '../language/ast.ts';\nimport { isNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport type { ASTVisitor } from '../language/visitor.ts';\nimport { getEnterLeaveForKind } from '../language/visitor.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLCompositeType,\n GraphQLEnumValue,\n GraphQLField,\n GraphQLInputField,\n GraphQLInputType,\n GraphQLOutputType,\n GraphQLType,\n} from '../type/definition.ts';\nimport {\n getNamedType,\n getNullableType,\n isCompositeType,\n isEnumType,\n isInputObjectType,\n isInputType,\n isListType,\n isObjectType,\n isOutputType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { typeFromAST } from './typeFromAST.ts';\n\n/** @internal */\nexport interface FragmentSignature {\n readonly definition: FragmentDefinitionNode;\n readonly variableDefinitions: Map;\n}\n\n/**\n * TypeInfo is a utility class which, given a GraphQL schema, can keep track\n * of the current field and type definitions at any point in a GraphQL document\n * AST during a recursive descent by calling `enter(node)` and `leave(node)`.\n */\nexport class TypeInfo {\n private _schema: GraphQLSchema;\n private _typeStack: Array>;\n private _parentTypeStack: Array>;\n private _inputTypeStack: Array>;\n private _fieldDefStack: Array>>;\n private _defaultValueStack: Array;\n private _directive: Maybe;\n private _argument: Maybe;\n private _enumValue: Maybe;\n private _fragmentSignaturesByName: (\n fragmentName: string,\n ) => Maybe;\n\n private _fragmentSignature: Maybe;\n private _fragmentArgument: Maybe;\n\n /**\n * Creates a TypeInfo instance.\n * @param schema - Schema used for type lookups.\n * @param initialType - Optional type to use at the start of traversal.\n * @param fragmentSignatures - Fragment signatures available during traversal.\n * @example\n * ```ts\n * // Track field types during a visitWithTypeInfo traversal.\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const seenTypes = [];\n *\n * visit(\n * parse('{ greeting }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * seenTypes.push(String(typeInfo.getType()));\n * },\n * }),\n * );\n *\n * seenTypes; // => ['String']\n * ```\n * @example\n * ```ts\n * // This variant starts from an initial type and supplies fragment signatures.\n * import { Kind, parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const fragmentDocument = parse(\n * 'fragment GreetingFields($name: String) on Query { greeting(name: $name) }',\n * { experimentalFragmentArguments: true },\n * );\n * const fragmentDefinition = fragmentDocument.definitions[0];\n * const variableDefinition = fragmentDefinition.variableDefinitions[0];\n * const typeInfo = new TypeInfo(schema, schema.getQueryType(), (name) =>\n * name === 'GreetingFields'\n * ? {\n * definition: fragmentDefinition,\n * variableDefinitions: new Map([['name', variableDefinition]]),\n * }\n * : undefined,\n * );\n *\n * typeInfo.enter({\n * kind: Kind.SELECTION_SET,\n * selections: [],\n * });\n * typeInfo.enter({\n * kind: Kind.FRAGMENT_SPREAD,\n * name: { kind: Kind.NAME, value: 'GreetingFields' },\n * arguments: [],\n * directives: [],\n * });\n *\n * String(typeInfo.getParentType()); // => 'Query'\n * typeInfo.getFragmentSignature()?.definition.name.value; // => 'GreetingFields'\n * ```\n */\n constructor(\n schema: GraphQLSchema,\n /**\n * Initial type may be provided in rare cases to facilitate traversals\n * beginning somewhere other than documents.\n */\n initialType?: Maybe,\n fragmentSignatures?: Maybe<\n (fragmentName: string) => Maybe\n >,\n ) {\n this._schema = schema;\n this._typeStack = [];\n this._parentTypeStack = [];\n this._inputTypeStack = [];\n this._fieldDefStack = [];\n this._defaultValueStack = [];\n this._directive = null;\n this._argument = null;\n this._enumValue = null;\n this._fragmentSignaturesByName = fragmentSignatures ?? (() => null);\n this._fragmentSignature = null;\n this._fragmentArgument = null;\n if (initialType) {\n if (isInputType(initialType)) {\n this._inputTypeStack.push(initialType);\n }\n if (isCompositeType(initialType)) {\n this._parentTypeStack.push(initialType);\n }\n if (isOutputType(initialType)) {\n this._typeStack.push(initialType);\n }\n }\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n get [Symbol.toStringTag](): string {\n return 'TypeInfo';\n }\n\n /**\n * Returns the current output type at this point in traversal.\n * @returns The current output type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * viewer: User\n * }\n *\n * type User {\n * name: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const fieldTypes = {};\n *\n * visit(\n * parse('{ viewer { name } }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: (node) => {\n * fieldTypes[node.name.value] = String(typeInfo.getType());\n * },\n * }),\n * );\n *\n * fieldTypes; // => { viewer: 'User', name: 'String' }\n * ```\n */\n getType(): Maybe {\n return this._typeStack.at(-1);\n }\n\n /**\n * Returns the current parent composite type.\n * @returns The current parent composite type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * viewer: User\n * }\n *\n * type User {\n * name: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const parentTypes = {};\n *\n * visit(\n * parse('{ viewer { name } }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: (node) => {\n * parentTypes[node.name.value] = String(typeInfo.getParentType());\n * },\n * }),\n * );\n *\n * parentTypes; // => { viewer: 'Query', name: 'User' }\n * ```\n */\n getParentType(): Maybe {\n return this._parentTypeStack.at(-1);\n }\n\n /**\n * Returns the current input type at this point in traversal.\n * @returns The current input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(stars: Int!, sort: Sort = NEWEST): [String]\n * }\n *\n * enum Sort {\n * NEWEST\n * OLDEST\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const inputTypes = {};\n *\n * visit(\n * parse('{ reviews(stars: 5, sort: OLDEST) }'),\n * visitWithTypeInfo(typeInfo, {\n * Argument: (node) => {\n * inputTypes[node.name.value] = String(typeInfo.getInputType());\n * },\n * }),\n * );\n *\n * inputTypes; // => { stars: 'Int!', sort: 'Sort' }\n * ```\n */\n getInputType(): Maybe {\n return this._inputTypeStack.at(-1);\n }\n\n // Note: continues to expose the closest enclosing valid input type if\n // traversal descends into syntax with no corresponding GraphQL input type.\n /**\n * Returns the parent input type for the current input position.\n * @returns The parent input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * input ReviewFilter {\n * stars: Int!\n * }\n *\n * type Query {\n * reviews(filter: ReviewFilter): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const parentInputTypes = {};\n *\n * visit(\n * parse('{ reviews(filter: { stars: 5 }) }'),\n * visitWithTypeInfo(typeInfo, {\n * ObjectField: (node) => {\n * parentInputTypes[node.name.value] = String(typeInfo.getParentInputType());\n * },\n * }),\n * );\n *\n * parentInputTypes; // => { stars: 'ReviewFilter' }\n * ```\n */\n getParentInputType(): Maybe {\n return this._inputTypeStack.at(-2);\n }\n\n /**\n * Returns the current field definition.\n * @returns The current field definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let fieldName;\n *\n * visit(\n * parse('{ greeting }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * fieldName = typeInfo.getFieldDef()?.name;\n * },\n * }),\n * );\n *\n * fieldName; // => 'greeting'\n * ```\n */\n getFieldDef(): Maybe> {\n return this._fieldDefStack.at(-1);\n }\n\n /**\n * Returns the default input representation for the current input position.\n * @returns The current default input, if one is available.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int = 10): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let defaultLimit;\n *\n * visit(\n * parse('{ reviews(limit: 5) }'),\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * defaultLimit = typeInfo.getDefaultValue();\n * },\n * }),\n * );\n *\n * defaultLimit; // => { literal: { kind: 'IntValue', value: '10' } }\n * ```\n */\n getDefaultValue(): unknown {\n return this._defaultValueStack.at(-1);\n }\n\n /**\n * Returns the current directive definition.\n * @returns The current directive definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let directiveName;\n *\n * visit(\n * parse('{ greeting @include(if: true) }'),\n * visitWithTypeInfo(typeInfo, {\n * Directive: () => {\n * directiveName = typeInfo.getDirective()?.name;\n * },\n * }),\n * );\n *\n * directiveName; // => 'include'\n * ```\n */\n getDirective(): Maybe {\n return this._directive;\n }\n\n /**\n * Returns the current argument definition.\n * @returns The current argument definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int = 10): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let argumentName;\n *\n * visit(\n * parse('{ reviews(limit: 5) }'),\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * argumentName = typeInfo.getArgument()?.name;\n * },\n * }),\n * );\n *\n * argumentName; // => 'limit'\n * ```\n */\n getArgument(): Maybe {\n return this._argument;\n }\n\n /**\n * Returns the current fragment signature.\n * @returns The fragment signature for the current fragment definition.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * FragmentSpread: () => {\n * fragmentName = typeInfo.getFragmentSignature()?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignature(): Maybe {\n return this._fragmentSignature;\n }\n\n /**\n * Returns the function used to look up fragment signatures by name.\n * @returns A function that maps fragment names to fragment signatures.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Document: () => {\n * const getFragmentSignature = typeInfo.getFragmentSignatureByName();\n * fragmentName =\n * getFragmentSignature('GreetingFields')?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignatureByName(): (\n fragmentName: string,\n ) => Maybe {\n return this._fragmentSignaturesByName;\n }\n\n /**\n * Returns the current fragment argument definition.\n * @returns The variable definition for the current fragment argument.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields(name: \"Ada\")\n * }\n *\n * fragment GreetingFields($name: String) on Query {\n * greeting(name: $name)\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * let argumentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * FragmentArgument: () => {\n * argumentName = typeInfo.getFragmentArgument()?.variable.name.value;\n * },\n * }),\n * );\n *\n * argumentName; // => 'name'\n * ```\n */\n getFragmentArgument(): Maybe {\n return this._fragmentArgument;\n }\n\n /**\n * Returns the current enum value definition.\n * @returns The current enum value definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * enum Sort {\n * NEWEST\n * OLDEST\n * }\n *\n * type Query {\n * reviews(sort: Sort = NEWEST): [String]\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * let enumValueName;\n *\n * visit(\n * parse('{ reviews(sort: OLDEST) }'),\n * visitWithTypeInfo(typeInfo, {\n * EnumValue: () => {\n * enumValueName = typeInfo.getEnumValue()?.name;\n * },\n * }),\n * );\n *\n * enumValueName; // => 'OLDEST'\n * ```\n */\n getEnumValue(): Maybe {\n return this._enumValue;\n }\n\n /**\n * Updates this TypeInfo instance for an entered AST node.\n * @param node - AST node being entered.\n * @returns Nothing.\n * @example\n * ```ts\n * import { Kind, parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const operation = document.definitions[0];\n * const selectionSet = operation.selectionSet;\n * const field = selectionSet.selections[0];\n * const typeInfo = new TypeInfo(schema);\n *\n * typeInfo.enter(operation);\n * typeInfo.enter(selectionSet);\n * typeInfo.enter(field);\n *\n * field.kind; // => Kind.FIELD\n * typeInfo.getParentType()?.name; // => 'Query'\n * String(typeInfo.getType()); // => 'String'\n * ```\n */\n enter(node: ASTNode): void {\n const schema = this._schema;\n // Note: many of the types below are explicitly typed as \"unknown\" to drop\n // any assumptions of a valid schema to ensure runtime types are properly\n // checked before continuing since TypeInfo is used as part of validation\n // which occurs before guarantees of schema and document validity.\n switch (node.kind) {\n case Kind.DOCUMENT: {\n const fragmentSignatures = getFragmentSignatures(node);\n this._fragmentSignaturesByName = (fragmentName: string) =>\n fragmentSignatures.get(fragmentName);\n break;\n }\n case Kind.SELECTION_SET: {\n const namedType: unknown = getNamedType(this.getType());\n this._parentTypeStack.push(\n isCompositeType(namedType) ? namedType : undefined,\n );\n break;\n }\n case Kind.FIELD: {\n const parentType = this.getParentType();\n let fieldDef;\n let fieldType: unknown;\n if (parentType) {\n fieldDef = schema.getField(parentType, node.name.value);\n if (fieldDef) {\n fieldType = fieldDef.type;\n }\n }\n this._fieldDefStack.push(fieldDef);\n this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined);\n break;\n }\n case Kind.DIRECTIVE:\n this._directive = schema.getDirective(node.name.value);\n break;\n case Kind.OPERATION_DEFINITION: {\n const rootType = schema.getRootType(node.operation);\n this._typeStack.push(isObjectType(rootType) ? rootType : undefined);\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n this._fragmentSignature = this.getFragmentSignatureByName()(\n node.name.value,\n );\n break;\n }\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION: {\n const typeConditionAST = node.typeCondition;\n const outputType: unknown = typeConditionAST\n ? typeFromAST(schema, typeConditionAST)\n : getNamedType(this.getType());\n this._typeStack.push(isOutputType(outputType) ? outputType : undefined);\n break;\n }\n case Kind.VARIABLE_DEFINITION: {\n const inputType: unknown = typeFromAST(schema, node.type);\n this._inputTypeStack.push(\n isInputType(inputType) ? inputType : undefined,\n );\n break;\n }\n case Kind.ARGUMENT: {\n let argDef;\n let argType: unknown;\n const fieldOrDirective = this.getDirective() ?? this.getFieldDef();\n if (fieldOrDirective) {\n argDef = fieldOrDirective.args.find(\n (arg) => arg.name === node.name.value,\n );\n if (argDef) {\n argType = argDef.type;\n }\n }\n this._argument = argDef;\n this._defaultValueStack.push(\n argDef?.default ?? argDef?.defaultValue ?? undefined,\n );\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n break;\n }\n case Kind.FRAGMENT_ARGUMENT: {\n const fragmentSignature = this.getFragmentSignature();\n const argDef = fragmentSignature?.variableDefinitions.get(\n node.name.value,\n );\n this._fragmentArgument = argDef;\n let argType: unknown;\n if (argDef) {\n argType = typeFromAST(this._schema, argDef.type);\n }\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n break;\n }\n case Kind.LIST: {\n const listType: unknown = getNullableType(this.getInputType());\n const itemType: unknown = isListType(listType)\n ? listType.ofType\n : undefined;\n // List positions never have a default value.\n this._defaultValueStack.push(undefined);\n this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined);\n break;\n }\n case Kind.OBJECT_FIELD: {\n const objectType: unknown = getNamedType(this.getInputType());\n let inputFieldType: GraphQLInputType | undefined;\n let inputField: GraphQLInputField | undefined;\n if (isInputObjectType(objectType)) {\n inputField = objectType.getFields()[node.name.value];\n if (inputField != null) {\n inputFieldType = inputField.type;\n }\n }\n this._defaultValueStack.push(\n inputField?.default ?? inputField?.defaultValue ?? undefined,\n );\n this._inputTypeStack.push(\n isInputType(inputFieldType) ? inputFieldType : undefined,\n );\n break;\n }\n case Kind.ENUM: {\n const enumType: unknown = getNamedType(this.getInputType());\n let enumValue;\n if (isEnumType(enumType)) {\n enumValue = enumType.getValue(node.value);\n }\n this._enumValue = enumValue;\n break;\n }\n default:\n // Ignore other nodes\n }\n }\n\n /**\n * Updates this TypeInfo instance for a left AST node.\n * @param node - AST node being entered.\n * @returns Nothing.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const operation = document.definitions[0];\n * const selectionSet = operation.selectionSet;\n * const field = selectionSet.selections[0];\n * const typeInfo = new TypeInfo(schema);\n *\n * typeInfo.enter(operation);\n * typeInfo.enter(selectionSet);\n * typeInfo.enter(field);\n * String(typeInfo.getType()); // => 'String'\n *\n * typeInfo.leave(field);\n * typeInfo.getType(); // => undefined\n * ```\n */\n leave(node: ASTNode): void {\n switch (node.kind) {\n case Kind.DOCUMENT:\n this._fragmentSignaturesByName = () => null;\n break;\n case Kind.SELECTION_SET:\n this._parentTypeStack.pop();\n break;\n case Kind.FIELD:\n this._fieldDefStack.pop();\n this._typeStack.pop();\n break;\n case Kind.DIRECTIVE:\n this._directive = null;\n break;\n case Kind.FRAGMENT_SPREAD:\n this._fragmentSignature = null;\n break;\n case Kind.OPERATION_DEFINITION:\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n this._typeStack.pop();\n break;\n case Kind.VARIABLE_DEFINITION:\n this._inputTypeStack.pop();\n break;\n case Kind.ARGUMENT:\n this._argument = null;\n this._defaultValueStack.pop();\n this._inputTypeStack.pop();\n break;\n case Kind.FRAGMENT_ARGUMENT: {\n this._fragmentArgument = null;\n this._defaultValueStack.pop();\n this._inputTypeStack.pop();\n break;\n }\n case Kind.LIST:\n case Kind.OBJECT_FIELD:\n this._defaultValueStack.pop();\n this._inputTypeStack.pop();\n break;\n case Kind.ENUM:\n this._enumValue = null;\n break;\n default:\n // Ignore other nodes\n }\n }\n}\n\nfunction getFragmentSignatures(\n document: DocumentNode,\n): Map {\n const fragmentSignatures = new Map();\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n const variableDefinitions = new Map();\n if (definition.variableDefinitions) {\n for (const varDef of definition.variableDefinitions) {\n variableDefinitions.set(varDef.variable.name.value, varDef);\n }\n }\n const signature = { definition, variableDefinitions };\n fragmentSignatures.set(definition.name.value, signature);\n }\n }\n return fragmentSignatures;\n}\n\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n * @param typeInfo - TypeInfo instance to update during traversal.\n * @param visitor - Visitor callbacks to wrap with TypeInfo updates.\n * @returns A visitor that keeps TypeInfo in sync while delegating callbacks.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const typeInfo = new TypeInfo(schema);\n * const fields = [];\n *\n * visit(\n * parse('{ greeting }'),\n * visitWithTypeInfo(typeInfo, {\n * Field: (node) => {\n * fields.push({\n * name: node.name.value,\n * parentType: String(typeInfo.getParentType()),\n * type: String(typeInfo.getType()),\n * });\n * },\n * }),\n * );\n *\n * fields; // => [{ name: 'greeting', parentType: 'Query', type: 'String' }]\n * ```\n */\nexport function visitWithTypeInfo(\n typeInfo: TypeInfo,\n visitor: ASTVisitor,\n): ASTVisitor {\n return {\n enter(...args) {\n const node = args[0];\n typeInfo.enter(node);\n const fn = getEnterLeaveForKind(visitor, node.kind).enter;\n if (fn) {\n const result = fn.apply(visitor, args);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave(...args) {\n const node = args[0];\n const fn = getEnterLeaveForKind(visitor, node.kind).leave;\n let result;\n if (fn) {\n result = fn.apply(visitor, args);\n }\n typeInfo.leave(node);\n return result;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.mts new file mode 100644 index 00000000..9893ccc7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.mts @@ -0,0 +1,60 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ConstValueNode } from "../language/ast.mjs"; +import type { GraphQLInputType } from "../type/definition.mjs"; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * This deprecated function will be removed in v18. Use `valueToLiteral()` + * instead, and take care to operate on external values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | BigInt | Int | + * | Unknown | Enum Value | + * | null | NullValue | + * @param value - Runtime value to convert. + * @param type - The GraphQL type to inspect. + * @returns A GraphQL value AST for the provided JavaScript value, or null when no literal can represent it. + * @example + * ```ts + * import { print } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { astFromValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * const valueNode = astFromValue( + * { stars: 5, tags: ['featured', 'verified'] }, + * ReviewInput, + * ); + * + * print(valueNode); // => '{ stars: 5, tags: ["featured", "verified"] }' + * astFromValue(undefined, GraphQLString); // => null + * astFromValue(null, new GraphQLNonNull(GraphQLString)); // => null + * ``` + * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18 + */ +export declare function astFromValue(value: unknown, type: GraphQLInputType): Maybe; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.ts new file mode 100644 index 00000000..a56651db --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.d.ts @@ -0,0 +1,60 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ConstValueNode } from "../language/ast.js"; +import type { GraphQLInputType } from "../type/definition.js"; +/** + * Produces a GraphQL Value AST given a JavaScript object. + * Function will match JavaScript/JSON values to GraphQL AST schema format + * by using suggested GraphQLInputType. + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * This deprecated function will be removed in v18. Use `valueToLiteral()` + * instead, and take care to operate on external values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | BigInt | Int | + * | Unknown | Enum Value | + * | null | NullValue | + * @param value - Runtime value to convert. + * @param type - The GraphQL type to inspect. + * @returns A GraphQL value AST for the provided JavaScript value, or null when no literal can represent it. + * @example + * ```ts + * import { print } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { astFromValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * const valueNode = astFromValue( + * { stars: 5, tags: ['featured', 'verified'] }, + * ReviewInput, + * ); + * + * print(valueNode); // => '{ stars: 5, tags: ["featured", "verified"] }' + * astFromValue(undefined, GraphQLString); // => null + * astFromValue(null, new GraphQLNonNull(GraphQLString)); // => null + * ``` + * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18 + */ +export declare function astFromValue(value: unknown, type: GraphQLInputType): Maybe; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js new file mode 100644 index 00000000..93421e64 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astFromValue = astFromValue; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const isIterableObject_ts_1 = require("../jsutils/isIterableObject.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +const scalars_ts_1 = require("../type/scalars.js"); +function astFromValue(value, type) { + if ((0, definition_ts_1.isNonNullType)(type)) { + const astValue = astFromValue(value, type.ofType); + if (astValue?.kind === kinds_ts_1.Kind.NULL) { + return null; + } + return astValue; + } + if (value === null) { + return { kind: kinds_ts_1.Kind.NULL }; + } + if (value === undefined) { + return null; + } + if ((0, definition_ts_1.isListType)(type)) { + const itemType = type.ofType; + if ((0, isIterableObject_ts_1.isIterableObject)(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValue(item, itemType); + if (itemNode != null) { + valuesNodes.push(itemNode); + } + } + return { kind: kinds_ts_1.Kind.LIST, values: valuesNodes }; + } + return astFromValue(value, itemType); + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + if (!(0, isObjectLike_ts_1.isObjectLike)(value)) { + return null; + } + const fieldNodes = []; + for (const field of Object.values(type.getFields())) { + const fieldValue = astFromValue(value[field.name], field.type); + if (fieldValue) { + fieldNodes.push({ + kind: kinds_ts_1.Kind.OBJECT_FIELD, + name: { kind: kinds_ts_1.Kind.NAME, value: field.name }, + value: fieldValue, + }); + } + } + return { kind: kinds_ts_1.Kind.OBJECT, fields: fieldNodes }; + } + if ((0, definition_ts_1.isLeafType)(type)) { + const coerced = type.coerceOutputValue(value); + if (coerced == null) { + return null; + } + if (typeof coerced === 'boolean') { + return { kind: kinds_ts_1.Kind.BOOLEAN, value: coerced }; + } + if (typeof coerced === 'number' && Number.isFinite(coerced)) { + const stringNum = String(coerced); + return integerStringRegExp.test(stringNum) + ? { kind: kinds_ts_1.Kind.INT, value: stringNum } + : { kind: kinds_ts_1.Kind.FLOAT, value: stringNum }; + } + if (typeof coerced === 'bigint') { + return { kind: kinds_ts_1.Kind.INT, value: String(coerced) }; + } + if (typeof coerced === 'string') { + if ((0, definition_ts_1.isEnumType)(type)) { + return { kind: kinds_ts_1.Kind.ENUM, value: coerced }; + } + if (type === scalars_ts_1.GraphQLID && integerStringRegExp.test(coerced)) { + return { kind: kinds_ts_1.Kind.INT, value: coerced }; + } + return { + kind: kinds_ts_1.Kind.STRING, + value: coerced, + }; + } + throw new TypeError(`Cannot convert value to AST: ${(0, inspect_ts_1.inspect)(coerced)}.`); + } + (0, invariant_ts_1.invariant)(false, 'Unexpected input type: ' + (0, inspect_ts_1.inspect)(type)); +} +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; +//# sourceMappingURL=astFromValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js.map new file mode 100644 index 00000000..9ff77ccb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"astFromValue.js","sourceRoot":"","sources":["../../src/utilities/astFromValue.ts"],"names":[],"mappings":";;AA4EA,oCA0GC;AApLD,sDAAgD;AAChD,0DAAoD;AACpD,wEAAkE;AAClE,gEAA0D;AAI1D,mDAA4C;AAG5C,yDAM+B;AAC/B,mDAA+C;AAyD/C,SAAgB,YAAY,CAC1B,KAAc,EACd,IAAsB;IAEtB,IAAI,IAAA,6BAAa,EAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,QAAQ,EAAE,IAAI,KAAK,eAAI,CAAC,IAAI,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAGD,IAAI,KAAK,KAAK,IAAI,EA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AAI,IAAA,0BAAU,EAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,OAAO,EAAE,IAAI,EAAE,eAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;YAC7C,CAAC;YAGD,IAAI,IAAI,KAAK,sBAAS,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5D,OAAO,EAAE,IAAI,EAAE,eAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;YAC5C,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,eAAI,CAAC,MAAM;gBACjB,KAAK,EAAE,OAAO;aACf,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,gCAAgC,IAAA,oBAAO,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE3E,CAAC;IAED,IAAA,wBAAS,EAAC,KAAK,EAAE,yBAAyB,GAAG,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,CAAC;AASD,MAAM,mBAAmB,GAAG,uBAAuB,CAAC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { ConstObjectFieldNode, ConstValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.ts';\nimport { GraphQLID } from '../type/scalars.ts';\n\n/**\n * Produces a GraphQL Value AST given a JavaScript object.\n * Function will match JavaScript/JSON values to GraphQL AST schema format\n * by using suggested GraphQLInputType.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * This deprecated function will be removed in v18. Use `valueToLiteral()`\n * instead, and take care to operate on external values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | BigInt | Int |\n * | Unknown | Enum Value |\n * | null | NullValue |\n * @param value - Runtime value to convert.\n * @param type - The GraphQL type to inspect.\n * @returns A GraphQL value AST for the provided JavaScript value, or null when no literal can represent it.\n * @example\n * ```ts\n * import { print } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { astFromValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * const valueNode = astFromValue(\n * { stars: 5, tags: ['featured', 'verified'] },\n * ReviewInput,\n * );\n *\n * print(valueNode); // => '{ stars: 5, tags: [\"featured\", \"verified\"] }'\n * astFromValue(undefined, GraphQLString); // => null\n * astFromValue(null, new GraphQLNonNull(GraphQLString)); // => null\n * ```\n * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18\n */\nexport function astFromValue(\n value: unknown,\n type: GraphQLInputType,\n): Maybe {\n if (isNonNullType(type)) {\n const astValue = astFromValue(value, type.ofType);\n if (astValue?.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined\n if (value === undefined) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (isListType(type)) {\n const itemType = type.ofType;\n if (isIterableObject(value)) {\n const valuesNodes = [];\n for (const item of value) {\n const itemNode = astFromValue(item, itemType);\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return null;\n }\n const fieldNodes: Array = [];\n for (const field of Object.values(type.getFields())) {\n const fieldValue = astFromValue(value[field.name], field.type);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: field.name },\n value: fieldValue,\n });\n }\n }\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n if (isLeafType(type)) {\n // Since value is an internally represented value, it must be coerced\n // to an externally represented value before converting into an AST.\n const coerced = type.coerceOutputValue(value);\n if (coerced == null) {\n return null;\n }\n\n // Others coerce based on their corresponding JavaScript scalar types.\n if (typeof coerced === 'boolean') {\n return { kind: Kind.BOOLEAN, value: coerced };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof coerced === 'number' && Number.isFinite(coerced)) {\n const stringNum = String(coerced);\n return integerStringRegExp.test(stringNum)\n ? { kind: Kind.INT, value: stringNum }\n : { kind: Kind.FLOAT, value: stringNum };\n }\n\n if (typeof coerced === 'bigint') {\n return { kind: Kind.INT, value: String(coerced) };\n }\n\n if (typeof coerced === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return { kind: Kind.ENUM, value: coerced };\n }\n\n // ID types can use Int literals.\n if (type === GraphQLID && integerStringRegExp.test(coerced)) {\n return { kind: Kind.INT, value: coerced };\n }\n\n return {\n kind: Kind.STRING,\n value: coerced,\n };\n }\n\n throw new TypeError(`Cannot convert value to AST: ${inspect(coerced)}.`);\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered.\n invariant(false, 'Unexpected input type: ' + inspect(type));\n}\n\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n *\n * @internal\n */\nconst integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs new file mode 100644 index 00000000..736cc8f8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs @@ -0,0 +1,87 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { isIterableObject } from "../jsutils/isIterableObject.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { isEnumType, isInputObjectType, isLeafType, isListType, isNonNullType, } from "../type/definition.mjs"; +import { GraphQLID } from "../type/scalars.mjs"; +export function astFromValue(value, type) { + if (isNonNullType(type)) { + const astValue = astFromValue(value, type.ofType); + if (astValue?.kind === Kind.NULL) { + return null; + } + return astValue; + } + if (value === null) { + return { kind: Kind.NULL }; + } + if (value === undefined) { + return null; + } + if (isListType(type)) { + const itemType = type.ofType; + if (isIterableObject(value)) { + const valuesNodes = []; + for (const item of value) { + const itemNode = astFromValue(item, itemType); + if (itemNode != null) { + valuesNodes.push(itemNode); + } + } + return { kind: Kind.LIST, values: valuesNodes }; + } + return astFromValue(value, itemType); + } + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return null; + } + const fieldNodes = []; + for (const field of Object.values(type.getFields())) { + const fieldValue = astFromValue(value[field.name], field.type); + if (fieldValue) { + fieldNodes.push({ + kind: Kind.OBJECT_FIELD, + name: { kind: Kind.NAME, value: field.name }, + value: fieldValue, + }); + } + } + return { kind: Kind.OBJECT, fields: fieldNodes }; + } + if (isLeafType(type)) { + const coerced = type.coerceOutputValue(value); + if (coerced == null) { + return null; + } + if (typeof coerced === 'boolean') { + return { kind: Kind.BOOLEAN, value: coerced }; + } + if (typeof coerced === 'number' && Number.isFinite(coerced)) { + const stringNum = String(coerced); + return integerStringRegExp.test(stringNum) + ? { kind: Kind.INT, value: stringNum } + : { kind: Kind.FLOAT, value: stringNum }; + } + if (typeof coerced === 'bigint') { + return { kind: Kind.INT, value: String(coerced) }; + } + if (typeof coerced === 'string') { + if (isEnumType(type)) { + return { kind: Kind.ENUM, value: coerced }; + } + if (type === GraphQLID && integerStringRegExp.test(coerced)) { + return { kind: Kind.INT, value: coerced }; + } + return { + kind: Kind.STRING, + value: coerced, + }; + } + throw new TypeError(`Cannot convert value to AST: ${inspect(coerced)}.`); + } + invariant(false, 'Unexpected input type: ' + inspect(type)); +} +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; +//# sourceMappingURL=astFromValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs.map new file mode 100644 index 00000000..ff95def1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/astFromValue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"astFromValue.js","sourceRoot":"","sources":["../../src/utilities/astFromValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAClE,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAI1D,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAG5C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,aAAa,GACd,+BAA8B;AAC/B,OAAO,EAAE,SAAS,EAAE,4BAA2B;AAyD/C,MAAM,UAAU,YAAY,CAC1B,KAAc,EACd,IAAsB;IAEtB,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE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ChC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACpD,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAEhC,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;YAC7C,CAAC;YAGD,IAAI,IAAI,KAAK,SAAS,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;YAC5C,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,MAAM;gBACjB,KAAK,EAAE,OAAO;aACf,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,gCAAgC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE3E,CAAC;IAED,SAAS,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,CAAC;AASD,MAAM,mBAAmB,GAAG,uBAAuB,CAAC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { ConstObjectFieldNode, ConstValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.ts';\nimport { GraphQLID } from '../type/scalars.ts';\n\n/**\n * Produces a GraphQL Value AST given a JavaScript object.\n * Function will match JavaScript/JSON values to GraphQL AST schema format\n * by using suggested GraphQLInputType.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * This deprecated function will be removed in v18. Use `valueToLiteral()`\n * instead, and take care to operate on external values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | BigInt | Int |\n * | Unknown | Enum Value |\n * | null | NullValue |\n * @param value - Runtime value to convert.\n * @param type - The GraphQL type to inspect.\n * @returns A GraphQL value AST for the provided JavaScript value, or null when no literal can represent it.\n * @example\n * ```ts\n * import { print } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { astFromValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * const valueNode = astFromValue(\n * { stars: 5, tags: ['featured', 'verified'] },\n * ReviewInput,\n * );\n *\n * print(valueNode); // => '{ stars: 5, tags: [\"featured\", \"verified\"] }'\n * astFromValue(undefined, GraphQLString); // => null\n * astFromValue(null, new GraphQLNonNull(GraphQLString)); // => null\n * ```\n * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18\n */\nexport function astFromValue(\n value: unknown,\n type: GraphQLInputType,\n): Maybe {\n if (isNonNullType(type)) {\n const astValue = astFromValue(value, type.ofType);\n if (astValue?.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined\n if (value === undefined) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (isListType(type)) {\n const itemType = type.ofType;\n if (isIterableObject(value)) {\n const valuesNodes = [];\n for (const item of value) {\n const itemNode = astFromValue(item, itemType);\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return null;\n }\n const fieldNodes: Array = [];\n for (const field of Object.values(type.getFields())) {\n const fieldValue = astFromValue(value[field.name], field.type);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: field.name },\n value: fieldValue,\n });\n }\n }\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n if (isLeafType(type)) {\n // Since value is an internally represented value, it must be coerced\n // to an externally represented value before converting into an AST.\n const coerced = type.coerceOutputValue(value);\n if (coerced == null) {\n return null;\n }\n\n // Others coerce based on their corresponding JavaScript scalar types.\n if (typeof coerced === 'boolean') {\n return { kind: Kind.BOOLEAN, value: coerced };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof coerced === 'number' && Number.isFinite(coerced)) {\n const stringNum = String(coerced);\n return integerStringRegExp.test(stringNum)\n ? { kind: Kind.INT, value: stringNum }\n : { kind: Kind.FLOAT, value: stringNum };\n }\n\n if (typeof coerced === 'bigint') {\n return { kind: Kind.INT, value: String(coerced) };\n }\n\n if (typeof coerced === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return { kind: Kind.ENUM, value: coerced };\n }\n\n // ID types can use Int literals.\n if (type === GraphQLID && integerStringRegExp.test(coerced)) {\n return { kind: Kind.INT, value: coerced };\n }\n\n return {\n kind: Kind.STRING,\n value: coerced,\n };\n }\n\n throw new TypeError(`Cannot convert value to AST: ${inspect(coerced)}.`);\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered.\n invariant(false, 'Unexpected input type: ' + inspect(type));\n}\n\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n *\n * @internal\n */\nconst integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.mts new file mode 100644 index 00000000..bcd266fc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.mts @@ -0,0 +1,88 @@ +/** @category Schema Construction */ +import type { DocumentNode } from "../language/ast.mjs"; +import type { ParseOptions } from "../language/parser.mjs"; +import type { Source } from "../language/source.mjs"; +import type { GraphQLSchemaValidationOptions } from "../type/schema.mjs"; +import { GraphQLSchema } from "../type/schema.mjs"; +/** Options used when building a schema from SDL or a parsed SDL document. */ +export interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { + /** + * Set to true to assume the SDL is valid. + * + * Default: false + */ + assumeValidSDL?: boolean | undefined; +} +/** + * Builds a GraphQLSchema from a parsed schema definition language document. + * + * If no schema definition is provided, then it will look for types named Query, + * Mutation and Subscription. + * + * The resulting schema has no resolver functions, so execution will use the + * default field resolver. + * @param documentAST - The parsed GraphQL document AST. + * @param options - Optional configuration for this operation. + * @returns The schema built from the provided SDL document. + * @example + * ```ts + * // Build a schema from a valid parsed SDL document. + * import { parse } from 'graphql/language'; + * import { buildASTSchema } from 'graphql/utilities'; + * + * const document = parse('type Query { hello: String }'); + * const schema = buildASTSchema(document); + * + * schema.getQueryType().name; // => 'Query' + * ``` + * @example + * ```ts + * // This variant uses validation options when the SDL references unknown types. + * import { parse } from 'graphql/language'; + * import { buildASTSchema } from 'graphql/utilities'; + * + * const document = parse('type Query { broken: MissingType }'); + * + * buildASTSchema(document); // throws an error + * buildASTSchema(document, { + * assumeValid: true, + * assumeValidSDL: true, + * }); // does not throw + * ``` + */ +export declare function buildASTSchema(documentAST: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema; +/** + * Builds a GraphQLSchema directly from a schema definition language source. + * @param source - The GraphQL source text or source object. + * @param options - Optional configuration for this operation. + * @returns The schema built from the provided SDL document. + * @example + * ```ts + * // Build a schema from SDL source using the default options. + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema('type Query { hello: String }'); + * + * schema.getQueryType().name; // => 'Query' + * ``` + * @example + * ```ts + * // This variant enables parser options and omits source locations. + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema( + * 'directive @tag on FIELD_DEFINITION\n' + + * 'directive @compose @tag on FIELD_DEFINITION', + * { + * experimentalFragmentArguments: true, + * noLocation: true, + * }, + * ); + * + * const directive = schema.getDirective('compose'); + * + * directive.name; // => 'compose' + * directive.astNode.loc; // => undefined + * ``` + */ +export declare function buildSchema(source: string | Source, options?: BuildSchemaOptions & ParseOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.ts new file mode 100644 index 00000000..ee016058 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.d.ts @@ -0,0 +1,88 @@ +/** @category Schema Construction */ +import type { DocumentNode } from "../language/ast.js"; +import type { ParseOptions } from "../language/parser.js"; +import type { Source } from "../language/source.js"; +import type { GraphQLSchemaValidationOptions } from "../type/schema.js"; +import { GraphQLSchema } from "../type/schema.js"; +/** Options used when building a schema from SDL or a parsed SDL document. */ +export interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { + /** + * Set to true to assume the SDL is valid. + * + * Default: false + */ + assumeValidSDL?: boolean | undefined; +} +/** + * Builds a GraphQLSchema from a parsed schema definition language document. + * + * If no schema definition is provided, then it will look for types named Query, + * Mutation and Subscription. + * + * The resulting schema has no resolver functions, so execution will use the + * default field resolver. + * @param documentAST - The parsed GraphQL document AST. + * @param options - Optional configuration for this operation. + * @returns The schema built from the provided SDL document. + * @example + * ```ts + * // Build a schema from a valid parsed SDL document. + * import { parse } from 'graphql/language'; + * import { buildASTSchema } from 'graphql/utilities'; + * + * const document = parse('type Query { hello: String }'); + * const schema = buildASTSchema(document); + * + * schema.getQueryType().name; // => 'Query' + * ``` + * @example + * ```ts + * // This variant uses validation options when the SDL references unknown types. + * import { parse } from 'graphql/language'; + * import { buildASTSchema } from 'graphql/utilities'; + * + * const document = parse('type Query { broken: MissingType }'); + * + * buildASTSchema(document); // throws an error + * buildASTSchema(document, { + * assumeValid: true, + * assumeValidSDL: true, + * }); // does not throw + * ``` + */ +export declare function buildASTSchema(documentAST: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema; +/** + * Builds a GraphQLSchema directly from a schema definition language source. + * @param source - The GraphQL source text or source object. + * @param options - Optional configuration for this operation. + * @returns The schema built from the provided SDL document. + * @example + * ```ts + * // Build a schema from SDL source using the default options. + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema('type Query { hello: String }'); + * + * schema.getQueryType().name; // => 'Query' + * ``` + * @example + * ```ts + * // This variant enables parser options and omits source locations. + * import { buildSchema } from 'graphql/utilities'; + * + * const schema = buildSchema( + * 'directive @tag on FIELD_DEFINITION\n' + + * 'directive @compose @tag on FIELD_DEFINITION', + * { + * experimentalFragmentArguments: true, + * noLocation: true, + * }, + * ); + * + * const directive = schema.getDirective('compose'); + * + * directive.name; // => 'compose' + * directive.astNode.loc; // => undefined + * ``` + */ +export declare function buildSchema(source: string | Source, options?: BuildSchemaOptions & ParseOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js new file mode 100644 index 00000000..6de6641a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildASTSchema = buildASTSchema; +exports.buildSchema = buildSchema; +const parser_ts_1 = require("../language/parser.js"); +const directives_ts_1 = require("../type/directives.js"); +const schema_ts_1 = require("../type/schema.js"); +const validate_ts_1 = require("../validation/validate.js"); +const extendSchema_ts_1 = require("./extendSchema.js"); +function buildASTSchema(documentAST, options) { + if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { + (0, validate_ts_1.assertValidSDL)(documentAST); + } + const emptySchemaConfig = { + description: undefined, + types: [], + directives: [], + extensions: Object.create(null), + extensionASTNodes: [], + assumeValid: false, + }; + const config = (0, extendSchema_ts_1.extendSchemaImpl)(emptySchemaConfig, documentAST, options); + if (config.astNode == null) { + for (const type of config.types) { + switch (type.name) { + case 'Query': + config.query = type; + break; + case 'Mutation': + config.mutation = type; + break; + case 'Subscription': + config.subscription = type; + break; + } + } + } + const directives = [ + ...config.directives, + ...directives_ts_1.specifiedDirectives.filter((stdDirective) => config.directives.every((directive) => directive.name !== stdDirective.name)), + ]; + return new schema_ts_1.GraphQLSchema({ ...config, directives }); +} +function buildSchema(source, options) { + const document = (0, parser_ts_1.parse)(source, { + noLocation: options?.noLocation, + experimentalFragmentArguments: options?.experimentalFragmentArguments, + }); + return buildASTSchema(document, { + assumeValidSDL: options?.assumeValidSDL, + assumeValid: options?.assumeValid, + }); +} +//# sourceMappingURL=buildASTSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js.map new file mode 100644 index 00000000..f3de9b15 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"buildASTSchema.js","s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K,CACrB,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CACpD,CACF;KACF,CAAC;IAEF,OAAO,IAAI,yBAAa,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AACtD,CAAC;AAoCD,SAAgB,WAAW,CACzB,MAAuB,EACvB,OAA2C;IAE3C,MAAM,QAAQ,GAAG,IAAA,iBAAK,EAAC,MAAM,EAAE;QAC7B,UAAU,EAAE,OAAO,EAAE,UAAU;QAC/B,6BAA6B,EAAE,OAAO,EAAE,6BAA6B;KACtE,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,QAAQ,EAAE;QAC9B,cAAc,EAAE,OAAO,EAAE,cAAc;QACvC,WAAW,EAAE,OAAO,EAAE,WAAW;KAClC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** @category Schema Construction */\n\nimport type { DocumentNode } from '../language/ast.ts';\nimport type { ParseOptions } from '../language/parser.ts';\nimport { parse } from '../language/parser.ts';\nimport type { Source } from '../language/source.ts';\n\nimport { specifiedDirectives } from '../type/directives.ts';\nimport type { GraphQLSchemaValidationOptions } from '../type/schema.ts';\nimport { GraphQLSchema } from '../type/schema.ts';\n\nimport { assertValidSDL } from '../validation/validate.ts';\n\nimport { extendSchemaImpl } from './extendSchema.ts';\n\n/** Options used when building a schema from SDL or a parsed SDL document. */\nexport interface BuildSchemaOptions extends GraphQLSchemaValidationOptions {\n /**\n * Set to true to assume the SDL is valid.\n *\n * Default: false\n */\n assumeValidSDL?: boolean | undefined;\n}\n\n/**\n * Builds a GraphQLSchema from a parsed schema definition language document.\n *\n * If no schema definition is provided, then it will look for types named Query,\n * Mutation and Subscription.\n *\n * The resulting schema has no resolver functions, so execution will use the\n * default field resolver.\n * @param documentAST - The parsed GraphQL document AST.\n * @param options - Optional configuration for this operation.\n * @returns The schema built from the provided SDL document.\n * @example\n * ```ts\n * // Build a schema from a valid parsed SDL document.\n * import { parse } from 'graphql/language';\n * import { buildASTSchema } from 'graphql/utilities';\n *\n * const document = parse('type Query { hello: String }');\n * const schema = buildASTSchema(document);\n *\n * schema.getQueryType().name; // => 'Query'\n * ```\n * @example\n * ```ts\n * // This variant uses validation options when the SDL references unknown types.\n * import { parse } from 'graphql/language';\n * import { buildASTSchema } from 'graphql/utilities';\n *\n * const document = parse('type Query { broken: MissingType }');\n *\n * buildASTSchema(document); // throws an error\n * buildASTSchema(document, {\n * assumeValid: true,\n * assumeValidSDL: true,\n * }); // does not throw\n * ```\n */\nexport function buildASTSchema(\n documentAST: DocumentNode,\n options?: BuildSchemaOptions,\n): GraphQLSchema {\n if (options?.assumeValid !== true && options?.assumeValidSDL !== true) {\n assertValidSDL(documentAST);\n }\n\n const emptySchemaConfig = {\n description: undefined,\n types: [],\n directives: [],\n extensions: Object.create(null),\n extensionASTNodes: [],\n assumeValid: false,\n };\n const config = extendSchemaImpl(emptySchemaConfig, documentAST, options);\n\n if (config.astNode == null) {\n for (const type of config.types) {\n switch (type.name) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n case 'Query':\n // @ts-expect-error validated in `validateSchema`\n config.query = type;\n break;\n case 'Mutation':\n // @ts-expect-error validated in `validateSchema`\n config.mutation = type;\n break;\n case 'Subscription':\n // @ts-expect-error validated in `validateSchema`\n config.subscription = type;\n break;\n }\n }\n }\n\n const directives = [\n ...config.directives,\n // If specified directives were not explicitly declared, add them.\n ...specifiedDirectives.filter((stdDirective) =>\n config.directives.every(\n (directive) => directive.name !== stdDirective.name,\n ),\n ),\n ];\n\n return new GraphQLSchema({ ...config, directives });\n}\n\n/**\n * Builds a GraphQLSchema directly from a schema definition language source.\n * @param source - The GraphQL source text or source object.\n * @param options - Optional configuration for this operation.\n * @returns The schema built from the provided SDL document.\n * @example\n * ```ts\n * // Build a schema from SDL source using the default options.\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema('type Query { hello: String }');\n *\n * schema.getQueryType().name; // => 'Query'\n * ```\n * @example\n * ```ts\n * // This variant enables parser options and omits source locations.\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(\n * 'directive @tag on FIELD_DEFINITION\\n' +\n * 'directive @compose @tag on FIELD_DEFINITION',\n * {\n * experimentalFragmentArguments: true,\n * noLocation: true,\n * },\n * );\n *\n * const directive = schema.getDirective('compose');\n *\n * directive.name; // => 'compose'\n * directive.astNode.loc; // => undefined\n * ```\n */\nexport function buildSchema(\n source: string | Source,\n options?: BuildSchemaOptions & ParseOptions,\n): GraphQLSchema {\n const document = parse(source, {\n noLocation: options?.noLocation,\n experimentalFragmentArguments: options?.experimentalFragmentArguments,\n });\n\n return buildASTSchema(document, {\n assumeValidSDL: options?.assumeValidSDL,\n assumeValid: options?.assumeValid,\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs new file mode 100644 index 00000000..d8fb21f7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs @@ -0,0 +1,50 @@ +import { parse } from "../language/parser.mjs"; +import { specifiedDirectives } from "../type/directives.mjs"; +import { GraphQLSchema } from "../type/schema.mjs"; +import { assertValidSDL } from "../validation/validate.mjs"; +import { extendSchemaImpl } from "./extendSchema.mjs"; +export function buildASTSchema(documentAST, options) { + if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { + assertValidSDL(documentAST); + } + const emptySchemaConfig = { + description: undefined, + types: [], + directives: [], + extensions: Object.create(null), + extensionASTNodes: [], + assumeValid: false, + }; + const config = extendSchemaImpl(emptySchemaConfig, documentAST, options); + if (config.astNode == null) { + for (const type of config.types) { + switch (type.name) { + case 'Query': + config.query = type; + break; + case 'Mutation': + config.mutation = type; + break; + case 'Subscription': + config.subscription = type; + break; + } + } + } + const directives = [ + ...config.directives, + ...specifiedDirectives.filter((stdDirective) => config.directives.every((directive) => directive.name !== stdDirective.name)), + ]; + return new GraphQLSchema({ ...config, directives }); +} +export function buildSchema(source, options) { + const document = parse(source, { + noLocation: options?.noLocation, + experimentalFragmentArguments: options?.experimentalFragmentArguments, + }); + return buildASTSchema(document, { + assumeValidSDL: options?.assumeValidSDL, + assumeValid: options?.assumeValid, + }); +} +//# sourceMappingURL=buildASTSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs.map new file mode 100644 index 00000000..43bb1359 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildASTSchema.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"buildASTSchema.js","sourceRoot":"","sources":["../../src/utilities/buildASTSchema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,+BAA8B;AAG9C,OAAO,EAAE,mBAAmB,EAAE,+BAA8B;AAE5D,OAAO,EAAE,aAAa,EAAE,2BAA0B;AAElD,OAAO,EAAE,cAAc,EAAE,mCAAkC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,2BAA0B;AAiDrD,MAAM,UAAU,cAAc,CAC5B,WAAyB,EACzB,OAA4B;IAE5B,IAAI,OAAO,EAAE,WAAW,KAAK,IAAI,IAAI,OAAO,EAAE,cAAc,KAAK,IAAI,EAAE,CAAC;QACtE,cAAc,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,iBAAiB,GAAG;QACxB,WAAW,EAAE,SAAS;QACtB,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAC/B,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,KAAK;KACnB,CAAC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../language/ast.ts';\nimport type { ParseOptions } from '../language/parser.ts';\nimport { parse } from '../language/parser.ts';\nimport type { Source } from '../language/source.ts';\n\nimport { specifiedDirectives } from '../type/directives.ts';\nimport type { GraphQLSchemaValidationOptions } from '../type/schema.ts';\nimport { GraphQLSchema } from '../type/schema.ts';\n\nimport { assertValidSDL } from '../validation/validate.ts';\n\nimport { extendSchemaImpl } from './extendSchema.ts';\n\n/** Options used when building a schema from SDL or a parsed SDL document. */\nexport interface BuildSchemaOptions extends GraphQLSchemaValidationOptions {\n /**\n * Set to true to assume the SDL is valid.\n *\n * Default: false\n */\n assumeValidSDL?: boolean | undefined;\n}\n\n/**\n * Builds a GraphQLSchema from a parsed schema definition language document.\n *\n * If no schema definition is provided, then it will look for types named Query,\n * Mutation and Subscription.\n *\n * The resulting schema has no resolver functions, so execution will use the\n * default field resolver.\n * @param documentAST - The parsed GraphQL document AST.\n * @param options - Optional configuration for this operation.\n * @returns The schema built from the provided SDL document.\n * @example\n * ```ts\n * // Build a schema from a valid parsed SDL document.\n * import { parse } from 'graphql/language';\n * import { buildASTSchema } from 'graphql/utilities';\n *\n * const document = parse('type Query { hello: String }');\n * const schema = buildASTSchema(document);\n *\n * schema.getQueryType().name; // => 'Query'\n * ```\n * @example\n * ```ts\n * // This variant uses validation options when the SDL references unknown types.\n * import { parse } from 'graphql/language';\n * import { buildASTSchema } from 'graphql/utilities';\n *\n * const document = parse('type Query { broken: MissingType }');\n *\n * buildASTSchema(document); // throws an error\n * buildASTSchema(document, {\n * assumeValid: true,\n * assumeValidSDL: true,\n * }); // does not throw\n * ```\n */\nexport function buildASTSchema(\n documentAST: DocumentNode,\n options?: BuildSchemaOptions,\n): GraphQLSchema {\n if (options?.assumeValid !== true && options?.assumeValidSDL !== true) {\n assertValidSDL(documentAST);\n }\n\n const emptySchemaConfig = {\n description: undefined,\n types: [],\n directives: [],\n extensions: Object.create(null),\n extensionASTNodes: [],\n assumeValid: false,\n };\n const config = extendSchemaImpl(emptySchemaConfig, documentAST, options);\n\n if (config.astNode == null) {\n for (const type of config.types) {\n switch (type.name) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n case 'Query':\n // @ts-expect-error validated in `validateSchema`\n config.query = type;\n break;\n case 'Mutation':\n // @ts-expect-error validated in `validateSchema`\n config.mutation = type;\n break;\n case 'Subscription':\n // @ts-expect-error validated in `validateSchema`\n config.subscription = type;\n break;\n }\n }\n }\n\n const directives = [\n ...config.directives,\n // If specified directives were not explicitly declared, add them.\n ...specifiedDirectives.filter((stdDirective) =>\n config.directives.every(\n (directive) => directive.name !== stdDirective.name,\n ),\n ),\n ];\n\n return new GraphQLSchema({ ...config, directives });\n}\n\n/**\n * Builds a GraphQLSchema directly from a schema definition language source.\n * @param source - The GraphQL source text or source object.\n * @param options - Optional configuration for this operation.\n * @returns The schema built from the provided SDL document.\n * @example\n * ```ts\n * // Build a schema from SDL source using the default options.\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema('type Query { hello: String }');\n *\n * schema.getQueryType().name; // => 'Query'\n * ```\n * @example\n * ```ts\n * // This variant enables parser options and omits source locations.\n * import { buildSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(\n * 'directive @tag on FIELD_DEFINITION\\n' +\n * 'directive @compose @tag on FIELD_DEFINITION',\n * {\n * experimentalFragmentArguments: true,\n * noLocation: true,\n * },\n * );\n *\n * const directive = schema.getDirective('compose');\n *\n * directive.name; // => 'compose'\n * directive.astNode.loc; // => undefined\n * ```\n */\nexport function buildSchema(\n source: string | Source,\n options?: BuildSchemaOptions & ParseOptions,\n): GraphQLSchema {\n const document = parse(source, {\n noLocation: options?.noLocation,\n experimentalFragmentArguments: options?.experimentalFragmentArguments,\n });\n\n return buildASTSchema(document, {\n assumeValidSDL: options?.assumeValidSDL,\n assumeValid: options?.assumeValid,\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.mts new file mode 100644 index 00000000..e5a62bcf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.mts @@ -0,0 +1,35 @@ +/** @category Introspection */ +import type { GraphQLSchemaValidationOptions } from "../type/schema.mjs"; +import { GraphQLSchema } from "../type/schema.mjs"; +import type { IntrospectionQuery } from "./getIntrospectionQuery.mjs"; +/** + * Build a GraphQLSchema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a GraphQLSchema instance which can be then used with all graphql-js + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + * @param introspection - Introspection result data to build from. + * @param options - Optional configuration for this operation. + * @returns The client schema represented by the introspection result. + * @example + * ```ts + * import { + * buildClientSchema, + * introspectionFromSchema, + * buildSchema, + * } from 'graphql/utilities'; + * + * const schema = buildSchema('type Query { hello: String }'); + * const clientSchema = buildClientSchema(introspectionFromSchema(schema), { + * assumeValid: true, + * }); + * + * clientSchema.getQueryType().name; // => 'Query' + * ``` + */ +export declare function buildClientSchema(introspection: IntrospectionQuery, options?: GraphQLSchemaValidationOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.ts new file mode 100644 index 00000000..8b171d7b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.d.ts @@ -0,0 +1,35 @@ +/** @category Introspection */ +import type { GraphQLSchemaValidationOptions } from "../type/schema.js"; +import { GraphQLSchema } from "../type/schema.js"; +import type { IntrospectionQuery } from "./getIntrospectionQuery.js"; +/** + * Build a GraphQLSchema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a GraphQLSchema instance which can be then used with all graphql-js + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + * @param introspection - Introspection result data to build from. + * @param options - Optional configuration for this operation. + * @returns The client schema represented by the introspection result. + * @example + * ```ts + * import { + * buildClientSchema, + * introspectionFromSchema, + * buildSchema, + * } from 'graphql/utilities'; + * + * const schema = buildSchema('type Query { hello: String }'); + * const clientSchema = buildClientSchema(introspectionFromSchema(schema), { + * assumeValid: true, + * }); + * + * clientSchema.getQueryType().name; // => 'Query' + * ``` + */ +export declare function buildClientSchema(introspection: IntrospectionQuery, options?: GraphQLSchemaValidationOptions): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js new file mode 100644 index 00000000..afae7abc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js @@ -0,0 +1,232 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildClientSchema = buildClientSchema; +const devAssert_ts_1 = require("../jsutils/devAssert.js"); +const inspect_ts_1 = require("../jsutils/inspect.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const keyValMap_ts_1 = require("../jsutils/keyValMap.js"); +const parser_ts_1 = require("../language/parser.js"); +const definition_ts_1 = require("../type/definition.js"); +const directives_ts_1 = require("../type/directives.js"); +const introspection_ts_1 = require("../type/introspection.js"); +const scalars_ts_1 = require("../type/scalars.js"); +const schema_ts_1 = require("../type/schema.js"); +function buildClientSchema(introspection, options) { + if (!((0, isObjectLike_ts_1.isObjectLike)(introspection) && (0, isObjectLike_ts_1.isObjectLike)(introspection.__schema))) + (0, devAssert_ts_1.devAssert)(false, `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0, inspect_ts_1.inspect)(introspection)}.`); + const schemaIntrospection = introspection.__schema; + const typeMap = new Map(schemaIntrospection.types.map((typeIntrospection) => [ + typeIntrospection.name, + buildType(typeIntrospection), + ])); + for (const stdType of [...scalars_ts_1.specifiedScalarTypes, ...introspection_ts_1.introspectionTypes]) { + if (typeMap.has(stdType.name)) { + typeMap.set(stdType.name, stdType); + } + } + const queryType = schemaIntrospection.queryType != null + ? getObjectType(schemaIntrospection.queryType) + : null; + const mutationType = schemaIntrospection.mutationType != null + ? getObjectType(schemaIntrospection.mutationType) + : null; + const subscriptionType = schemaIntrospection.subscriptionType != null + ? getObjectType(schemaIntrospection.subscriptionType) + : null; + const directives = schemaIntrospection.directives != null + ? schemaIntrospection.directives.map(buildDirective) + : []; + return new schema_ts_1.GraphQLSchema({ + description: schemaIntrospection.description, + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + types: [...typeMap.values()], + directives, + assumeValid: options?.assumeValid, + }); + function getType(typeRef) { + if (typeRef.kind === introspection_ts_1.TypeKind.LIST) { + const itemRef = typeRef.ofType; + if (itemRef == null) { + throw new Error('Decorated type deeper than introspection query.'); + } + return new definition_ts_1.GraphQLList(getType(itemRef)); + } + if (typeRef.kind === introspection_ts_1.TypeKind.NON_NULL) { + const nullableRef = typeRef.ofType; + if (nullableRef == null) { + throw new Error('Decorated type deeper than introspection query.'); + } + const nullableType = getType(nullableRef); + return new definition_ts_1.GraphQLNonNull((0, definition_ts_1.assertNullableType)(nullableType)); + } + return getNamedType(typeRef); + } + function getNamedType(typeRef) { + const typeName = typeRef.name; + if (!typeName) { + throw new Error(`Unknown type reference: ${(0, inspect_ts_1.inspect)(typeRef)}.`); + } + const type = typeMap.get(typeName); + if (type == null) { + throw new Error(`Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`); + } + return type; + } + function getObjectType(typeRef) { + return (0, definition_ts_1.assertObjectType)(getNamedType(typeRef)); + } + function getInterfaceType(typeRef) { + return (0, definition_ts_1.assertInterfaceType)(getNamedType(typeRef)); + } + function buildType(type) { + switch (type.kind) { + case introspection_ts_1.TypeKind.SCALAR: + return buildScalarDef(type); + case introspection_ts_1.TypeKind.OBJECT: + return buildObjectDef(type); + case introspection_ts_1.TypeKind.INTERFACE: + return buildInterfaceDef(type); + case introspection_ts_1.TypeKind.UNION: + return buildUnionDef(type); + case introspection_ts_1.TypeKind.ENUM: + return buildEnumDef(type); + case introspection_ts_1.TypeKind.INPUT_OBJECT: + return buildInputObjectDef(type); + default: + throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${(0, inspect_ts_1.inspect)(type)}.`); + } + } + function buildScalarDef(scalarIntrospection) { + return new definition_ts_1.GraphQLScalarType({ + name: scalarIntrospection.name, + description: scalarIntrospection.description, + specifiedByURL: scalarIntrospection.specifiedByURL, + }); + } + function buildImplementationsList(implementingIntrospection) { + if (implementingIntrospection.interfaces === null && + implementingIntrospection.kind === introspection_ts_1.TypeKind.INTERFACE) { + return []; + } + if (implementingIntrospection.interfaces == null) { + const implementingIntrospectionStr = (0, inspect_ts_1.inspect)(implementingIntrospection); + throw new Error(`Introspection result missing interfaces: ${implementingIntrospectionStr}.`); + } + return implementingIntrospection.interfaces.map(getInterfaceType); + } + function buildObjectDef(objectIntrospection) { + return new definition_ts_1.GraphQLObjectType({ + name: objectIntrospection.name, + description: objectIntrospection.description, + interfaces: () => buildImplementationsList(objectIntrospection), + fields: () => buildFieldDefMap(objectIntrospection), + }); + } + function buildInterfaceDef(interfaceIntrospection) { + return new definition_ts_1.GraphQLInterfaceType({ + name: interfaceIntrospection.name, + description: interfaceIntrospection.description, + interfaces: () => buildImplementationsList(interfaceIntrospection), + fields: () => buildFieldDefMap(interfaceIntrospection), + }); + } + function buildUnionDef(unionIntrospection) { + if (unionIntrospection.possibleTypes == null) { + const unionIntrospectionStr = (0, inspect_ts_1.inspect)(unionIntrospection); + throw new Error(`Introspection result missing possibleTypes: ${unionIntrospectionStr}.`); + } + return new definition_ts_1.GraphQLUnionType({ + name: unionIntrospection.name, + description: unionIntrospection.description, + types: () => unionIntrospection.possibleTypes.map(getObjectType), + }); + } + function buildEnumDef(enumIntrospection) { + if (enumIntrospection.enumValues == null) { + const enumIntrospectionStr = (0, inspect_ts_1.inspect)(enumIntrospection); + throw new Error(`Introspection result missing enumValues: ${enumIntrospectionStr}.`); + } + return new definition_ts_1.GraphQLEnumType({ + name: enumIntrospection.name, + description: enumIntrospection.description, + values: (0, keyValMap_ts_1.keyValMap)(enumIntrospection.enumValues, (valueIntrospection) => valueIntrospection.name, (valueIntrospection) => ({ + description: valueIntrospection.description, + deprecationReason: valueIntrospection.deprecationReason, + })), + }); + } + function buildInputObjectDef(inputObjectIntrospection) { + if (inputObjectIntrospection.inputFields == null) { + const inputObjectIntrospectionStr = (0, inspect_ts_1.inspect)(inputObjectIntrospection); + throw new Error(`Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`); + } + return new definition_ts_1.GraphQLInputObjectType({ + name: inputObjectIntrospection.name, + description: inputObjectIntrospection.description, + fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), + isOneOf: inputObjectIntrospection.isOneOf, + }); + } + function buildFieldDefMap(typeIntrospection) { + if (typeIntrospection.fields == null) { + throw new Error(`Introspection result missing fields: ${(0, inspect_ts_1.inspect)(typeIntrospection)}.`); + } + return (0, keyValMap_ts_1.keyValMap)(typeIntrospection.fields, (fieldIntrospection) => fieldIntrospection.name, buildField); + } + function buildField(fieldIntrospection) { + const type = getType(fieldIntrospection.type); + if (!(0, definition_ts_1.isOutputType)(type)) { + const typeStr = (0, inspect_ts_1.inspect)(type); + throw new Error(`Introspection must provide output type for fields, but received: ${typeStr}.`); + } + if (fieldIntrospection.args == null) { + const fieldIntrospectionStr = (0, inspect_ts_1.inspect)(fieldIntrospection); + throw new Error(`Introspection result missing field args: ${fieldIntrospectionStr}.`); + } + return { + description: fieldIntrospection.description, + deprecationReason: fieldIntrospection.deprecationReason, + type, + args: buildInputValueDefMap(fieldIntrospection.args), + }; + } + function buildInputValueDefMap(inputValueIntrospections) { + return (0, keyValMap_ts_1.keyValMap)(inputValueIntrospections, (inputValue) => inputValue.name, buildInputValue); + } + function buildInputValue(inputValueIntrospection) { + const type = getType(inputValueIntrospection.type); + if (!(0, definition_ts_1.isInputType)(type)) { + const typeStr = (0, inspect_ts_1.inspect)(type); + throw new Error(`Introspection must provide input type for arguments, but received: ${typeStr}.`); + } + return { + description: inputValueIntrospection.description, + type, + default: inputValueIntrospection.defaultValue != null + ? { literal: (0, parser_ts_1.parseConstValue)(inputValueIntrospection.defaultValue) } + : undefined, + deprecationReason: inputValueIntrospection.deprecationReason, + }; + } + function buildDirective(directiveIntrospection) { + if (directiveIntrospection.args == null) { + const directiveIntrospectionStr = (0, inspect_ts_1.inspect)(directiveIntrospection); + throw new Error(`Introspection result missing directive args: ${directiveIntrospectionStr}.`); + } + if (directiveIntrospection.locations == null) { + const directiveIntrospectionStr = (0, inspect_ts_1.inspect)(directiveIntrospection); + throw new Error(`Introspection result missing directive locations: ${directiveIntrospectionStr}.`); + } + return new directives_ts_1.GraphQLDirective({ + name: directiveIntrospection.name, + description: directiveIntrospection.description, + isRepeatable: directiveIntrospection.isRepeatable, + deprecationReason: directiveIntrospection.deprecationReason, + locations: directiveIntrospection.locations.slice(), + args: buildInputValueDefMap(directiveIntrospection.args), + }); + } +} +//# sourceMappingURL=buildClientSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js.map new file mode 100644 index 00000000..cf45e312 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"buildClientSchema.js","sourceRoot":"","sources":["../../src/utilities/buildClientSchema.ts"],"names":[],"mappings":";;AAkFA,8CA8VC;AA9aD,0DAAoD;AACpD,sDAAgD;AAChD,gEAA0D;AAC1D,0DAAoD;AAEpD,qDAAwD;AAQxD,yDAc+B;AAC/B,yDAAyD;AACzD,+DAAwE;AACxE,mDAA0D;AAE1D,iDAAkD;AAgDlD,SAAgB,iBAAiB,CAC/B,aAAiC,EACjC,OAAwC;UAKtC,IAAA,8BAAY,EAAC,aAAa,CAAC,IAAI,IAAA,8BAAY,EAAC,aAAa,CAAC,QAAQ,CAAC;YADrE,wBAAS,SAEP,6JAA6J,IAAA,oBAAO,EAClK,aAAa,CACd,GAAG;IAIN,MAAM,mBAAmB,GAAG,aAAa,CAAC,QAAQ,CAAC;IAGnD,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACnD,iBAAiB,CAAC,IAAI;QACtB,SAAS,CAAC,iBAAiB,CAAC;KAC7B,CAAC,CACH,CAAC;IAGF,KAAK,MAAM,OAAO,IAAI,CAAC,GAAG,iCAAoB,EAAE,GAAG,qCAAkB,CAAC,EAAE,CAAC;QACvE,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAA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OAAO;YACL,WAAW,EAAE,uBAAuB,CAAC,WAAW;YAChD,IAAI;YACJ,OAAO,EACL,uBAAuB,CAAC,YAAY,IAAI,IAAI;gBAC1C,CAAC,CAAC,EAAE,OAAO,EAAE,IAAA,2BAAe,EAAC,uBAAuB,CAAC,YAAY,CAAC,EAAE;gBACpE,CAAC,CAAC,SAAS;YACf,iBAAiB,EAAE,uBAAuB,CAAC,iBAAiB;SAC7D,CAAC;IACJ,CAAC;IAED,SAAS,cAAc,CACrB,sBAA8C;QAE9C,IAAI,sBAAsB,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACxC,MAAM,yBAAyB,GAAG,IAAA,oBAAO,EAAC,sBAAsB,CAAC,CAAC;YAClE,MAAM,IAAI,KAAK,CACb,gDAAgD,yBAAyB,GAAG,CAC7E,CAAC;QACJ,CAAC;QACD,IAAI,sBAAsB,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC7C,MAAM,yBAAyB,GAAG,IAAA,oBAAO,EAAC,sBAAsB,CAAC,CAAC;YAClE,MAAM,IAAI,KAAK,CACb,qDAAqD,yBAAyB,GAAG,CAClF,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,gCAAgB,CAAC;YAC1B,IAAI,EAAE,sBAAsB,CAAC,IAAI;YACjC,WAAW,EAAE,sBAAsB,CAAC,WAAW;YAC/C,YAAY,EAAE,sBAAsB,CAAC,YAAY;YACjD,iBAAiB,EAAE,sBAAsB,CAAC,iBAAiB;YAC3D,SAAS,EAAE,sBAAsB,CAAC,SAAS,CAAC,KAAK,EAAE;YACnD,IAAI,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,IAAI,CAAC;SACzD,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["/** @category Introspection */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyValMap } from '../jsutils/keyValMap.ts';\n\nimport { parseConstValue } from '../language/parser.ts';\n\nimport type {\n GraphQLFieldConfig,\n GraphQLFieldConfigMap,\n GraphQLNamedType,\n GraphQLType,\n} from '../type/definition.ts';\nimport {\n assertInterfaceType,\n assertNullableType,\n assertObjectType,\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n isInputType,\n isOutputType,\n} from '../type/definition.ts';\nimport { GraphQLDirective } from '../type/directives.ts';\nimport { introspectionTypes, TypeKind } from '../type/introspection.ts';\nimport { specifiedScalarTypes } from '../type/scalars.ts';\nimport type { GraphQLSchemaValidationOptions } from '../type/schema.ts';\nimport { GraphQLSchema } from '../type/schema.ts';\n\nimport type {\n IntrospectionDirective,\n IntrospectionEnumType,\n IntrospectionField,\n IntrospectionInputObjectType,\n IntrospectionInputValue,\n IntrospectionInterfaceType,\n IntrospectionNamedTypeRef,\n IntrospectionObjectType,\n IntrospectionQuery,\n IntrospectionScalarType,\n IntrospectionType,\n IntrospectionTypeRef,\n IntrospectionUnionType,\n} from './getIntrospectionQuery.ts';\n\n/**\n * Build a GraphQLSchema for use by client tools.\n *\n * Given the result of a client running the introspection query, creates and\n * returns a GraphQLSchema instance which can be then used with all graphql-js\n * tools, but cannot be used to execute a query, as introspection does not\n * represent the \"resolver\", \"parse\" or \"serialize\" functions or any other\n * server-internal mechanisms.\n *\n * This function expects a complete introspection result. Don't forget to check\n * the \"errors\" field of a server response before calling this function.\n * @param introspection - Introspection result data to build from.\n * @param options - Optional configuration for this operation.\n * @returns The client schema represented by the introspection result.\n * @example\n * ```ts\n * import {\n * buildClientSchema,\n * introspectionFromSchema,\n * buildSchema,\n * } from 'graphql/utilities';\n *\n * const schema = buildSchema('type Query { hello: String }');\n * const clientSchema = buildClientSchema(introspectionFromSchema(schema), {\n * assumeValid: true,\n * });\n *\n * clientSchema.getQueryType().name; // => 'Query'\n * ```\n */\nexport function buildClientSchema(\n introspection: IntrospectionQuery,\n options?: GraphQLSchemaValidationOptions,\n): GraphQLSchema {\n // Even though the `introspection` argument is typed, in most cases it's received\n // as an untyped value from the server, so we will do an additional check here.\n devAssert(\n isObjectLike(introspection) && isObjectLike(introspection.__schema),\n `Invalid or incomplete introspection result. Ensure that you are passing \"data\" property of introspection response and no \"errors\" was returned alongside: ${inspect(\n introspection,\n )}.`,\n );\n\n // Get the schema from the introspection result.\n const schemaIntrospection = introspection.__schema;\n\n // Iterate through all types, getting the type definition for each.\n const typeMap = new Map(\n schemaIntrospection.types.map((typeIntrospection) => [\n typeIntrospection.name,\n buildType(typeIntrospection),\n ]),\n );\n\n // Include standard types only if they are used.\n for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) {\n if (typeMap.has(stdType.name)) {\n typeMap.set(stdType.name, stdType);\n }\n }\n\n // Get the root Query, Mutation, and Subscription types.\n const queryType =\n schemaIntrospection.queryType != null\n ? getObjectType(schemaIntrospection.queryType)\n : null;\n\n const mutationType =\n schemaIntrospection.mutationType != null\n ? getObjectType(schemaIntrospection.mutationType)\n : null;\n\n const subscriptionType =\n schemaIntrospection.subscriptionType != null\n ? getObjectType(schemaIntrospection.subscriptionType)\n : null;\n\n // Get the directives supported by Introspection, assuming empty-set if\n // directives were not queried for.\n const directives =\n schemaIntrospection.directives != null\n ? schemaIntrospection.directives.map(buildDirective)\n : [];\n\n // Then produce and return a Schema with these types.\n return new GraphQLSchema({\n description: schemaIntrospection.description,\n query: queryType,\n mutation: mutationType,\n subscription: subscriptionType,\n types: [...typeMap.values()],\n directives,\n assumeValid: options?.assumeValid,\n });\n\n // Given a type reference in introspection, return the GraphQLType instance.\n // preferring cached instances before building new instances.\n function getType(typeRef: IntrospectionTypeRef): GraphQLType {\n if (typeRef.kind === TypeKind.LIST) {\n const itemRef = typeRef.ofType;\n if (itemRef == null) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n return new GraphQLList(getType(itemRef));\n }\n if (typeRef.kind === TypeKind.NON_NULL) {\n const nullableRef = typeRef.ofType;\n if (nullableRef == null) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n const nullableType = getType(nullableRef);\n return new GraphQLNonNull(assertNullableType(nullableType));\n }\n return getNamedType(typeRef);\n }\n\n function getNamedType(typeRef: IntrospectionNamedTypeRef): GraphQLNamedType {\n const typeName = typeRef.name;\n if (!typeName) {\n throw new Error(`Unknown type reference: ${inspect(typeRef)}.`);\n }\n\n const type = typeMap.get(typeName);\n if (type == null) {\n throw new Error(\n `Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`,\n );\n }\n\n return type;\n }\n\n function getObjectType(\n typeRef: IntrospectionNamedTypeRef,\n ): GraphQLObjectType {\n return assertObjectType(getNamedType(typeRef));\n }\n\n function getInterfaceType(\n typeRef: IntrospectionNamedTypeRef,\n ): GraphQLInterfaceType {\n return assertInterfaceType(getNamedType(typeRef));\n }\n\n // Given a type's introspection result, construct the correct\n // GraphQLType instance.\n function buildType(type: IntrospectionType): GraphQLNamedType {\n switch (type.kind) {\n case TypeKind.SCALAR:\n return buildScalarDef(type);\n case TypeKind.OBJECT:\n return buildObjectDef(type);\n case TypeKind.INTERFACE:\n return buildInterfaceDef(type);\n case TypeKind.UNION:\n return buildUnionDef(type);\n case TypeKind.ENUM:\n return buildEnumDef(type);\n case TypeKind.INPUT_OBJECT:\n return buildInputObjectDef(type);\n default:\n // TypeScript considers this unreachable, but invalid runtime input can reach it.\n // Note: we include a default case rather than throwing after the switch to avoid\n // the use of a @ts-expect-error statement.\n throw new Error(\n `Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${inspect(\n type,\n )}.`,\n );\n }\n }\n\n function buildScalarDef(\n scalarIntrospection: IntrospectionScalarType,\n ): GraphQLScalarType {\n return new GraphQLScalarType({\n name: scalarIntrospection.name,\n description: scalarIntrospection.description,\n specifiedByURL: scalarIntrospection.specifiedByURL,\n });\n }\n\n function buildImplementationsList(\n implementingIntrospection:\n | IntrospectionObjectType\n | IntrospectionInterfaceType,\n ): Array {\n // TODO: Temporary workaround until GraphQL ecosystem will fully support\n // 'interfaces' on interface types.\n if (\n implementingIntrospection.interfaces === null &&\n implementingIntrospection.kind === TypeKind.INTERFACE\n ) {\n return [];\n }\n\n if (implementingIntrospection.interfaces == null) {\n const implementingIntrospectionStr = inspect(implementingIntrospection);\n throw new Error(\n `Introspection result missing interfaces: ${implementingIntrospectionStr}.`,\n );\n }\n\n return implementingIntrospection.interfaces.map(getInterfaceType);\n }\n\n function buildObjectDef(\n objectIntrospection: IntrospectionObjectType,\n ): GraphQLObjectType {\n return new GraphQLObjectType({\n name: objectIntrospection.name,\n description: objectIntrospection.description,\n interfaces: () => buildImplementationsList(objectIntrospection),\n fields: () => buildFieldDefMap(objectIntrospection),\n });\n }\n\n function buildInterfaceDef(\n interfaceIntrospection: IntrospectionInterfaceType,\n ): GraphQLInterfaceType {\n return new GraphQLInterfaceType({\n name: interfaceIntrospection.name,\n description: interfaceIntrospection.description,\n interfaces: () => buildImplementationsList(interfaceIntrospection),\n fields: () => buildFieldDefMap(interfaceIntrospection),\n });\n }\n\n function buildUnionDef(\n unionIntrospection: IntrospectionUnionType,\n ): GraphQLUnionType {\n if (unionIntrospection.possibleTypes == null) {\n const unionIntrospectionStr = inspect(unionIntrospection);\n throw new Error(\n `Introspection result missing possibleTypes: ${unionIntrospectionStr}.`,\n );\n }\n return new GraphQLUnionType({\n name: unionIntrospection.name,\n description: unionIntrospection.description,\n types: () => unionIntrospection.possibleTypes.map(getObjectType),\n });\n }\n\n function buildEnumDef(\n enumIntrospection: IntrospectionEnumType,\n ): GraphQLEnumType {\n if (enumIntrospection.enumValues == null) {\n const enumIntrospectionStr = inspect(enumIntrospection);\n throw new Error(\n `Introspection result missing enumValues: ${enumIntrospectionStr}.`,\n );\n }\n return new GraphQLEnumType({\n name: enumIntrospection.name,\n description: enumIntrospection.description,\n values: keyValMap(\n enumIntrospection.enumValues,\n (valueIntrospection) => valueIntrospection.name,\n (valueIntrospection) => ({\n description: valueIntrospection.description,\n deprecationReason: valueIntrospection.deprecationReason,\n }),\n ),\n });\n }\n\n function buildInputObjectDef(\n inputObjectIntrospection: IntrospectionInputObjectType,\n ): GraphQLInputObjectType {\n if (inputObjectIntrospection.inputFields == null) {\n const inputObjectIntrospectionStr = inspect(inputObjectIntrospection);\n throw new Error(\n `Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`,\n );\n }\n return new GraphQLInputObjectType({\n name: inputObjectIntrospection.name,\n description: inputObjectIntrospection.description,\n fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields),\n isOneOf: inputObjectIntrospection.isOneOf,\n });\n }\n\n function buildFieldDefMap(\n typeIntrospection: IntrospectionObjectType | IntrospectionInterfaceType,\n ): GraphQLFieldConfigMap {\n if (typeIntrospection.fields == null) {\n throw new Error(\n `Introspection result missing fields: ${inspect(typeIntrospection)}.`,\n );\n }\n\n return keyValMap(\n typeIntrospection.fields,\n (fieldIntrospection) => fieldIntrospection.name,\n buildField,\n );\n }\n\n function buildField(\n fieldIntrospection: IntrospectionField,\n ): GraphQLFieldConfig {\n const type = getType(fieldIntrospection.type);\n if (!isOutputType(type)) {\n const typeStr = inspect(type);\n throw new Error(\n `Introspection must provide output type for fields, but received: ${typeStr}.`,\n );\n }\n\n if (fieldIntrospection.args == null) {\n const fieldIntrospectionStr = inspect(fieldIntrospection);\n throw new Error(\n `Introspection result missing field args: ${fieldIntrospectionStr}.`,\n );\n }\n\n return {\n description: fieldIntrospection.description,\n deprecationReason: fieldIntrospection.deprecationReason,\n type,\n args: buildInputValueDefMap(fieldIntrospection.args),\n };\n }\n\n function buildInputValueDefMap(\n inputValueIntrospections: ReadonlyArray,\n ) {\n return keyValMap(\n inputValueIntrospections,\n (inputValue) => inputValue.name,\n buildInputValue,\n );\n }\n\n function buildInputValue(inputValueIntrospection: IntrospectionInputValue) {\n const type = getType(inputValueIntrospection.type);\n if (!isInputType(type)) {\n const typeStr = inspect(type);\n throw new Error(\n `Introspection must provide input type for arguments, but received: ${typeStr}.`,\n );\n }\n\n return {\n description: inputValueIntrospection.description,\n type,\n default:\n inputValueIntrospection.defaultValue != null\n ? { literal: parseConstValue(inputValueIntrospection.defaultValue) }\n : undefined,\n deprecationReason: inputValueIntrospection.deprecationReason,\n };\n }\n\n function buildDirective(\n directiveIntrospection: IntrospectionDirective,\n ): GraphQLDirective {\n if (directiveIntrospection.args == null) {\n const directiveIntrospectionStr = inspect(directiveIntrospection);\n throw new Error(\n `Introspection result missing directive args: ${directiveIntrospectionStr}.`,\n );\n }\n if (directiveIntrospection.locations == null) {\n const directiveIntrospectionStr = inspect(directiveIntrospection);\n throw new Error(\n `Introspection result missing directive locations: ${directiveIntrospectionStr}.`,\n );\n }\n return new GraphQLDirective({\n name: directiveIntrospection.name,\n description: directiveIntrospection.description,\n isRepeatable: directiveIntrospection.isRepeatable,\n deprecationReason: directiveIntrospection.deprecationReason,\n locations: directiveIntrospection.locations.slice(),\n args: buildInputValueDefMap(directiveIntrospection.args),\n });\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs new file mode 100644 index 00000000..8af7eaf7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs @@ -0,0 +1,229 @@ +import { devAssert } from "../jsutils/devAssert.mjs"; +import { inspect } from "../jsutils/inspect.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { keyValMap } from "../jsutils/keyValMap.mjs"; +import { parseConstValue } from "../language/parser.mjs"; +import { assertInterfaceType, assertNullableType, assertObjectType, GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isInputType, isOutputType, } from "../type/definition.mjs"; +import { GraphQLDirective } from "../type/directives.mjs"; +import { introspectionTypes, TypeKind } from "../type/introspection.mjs"; +import { specifiedScalarTypes } from "../type/scalars.mjs"; +import { GraphQLSchema } from "../type/schema.mjs"; +export function buildClientSchema(introspection, options) { + if (!(isObjectLike(introspection) && isObjectLike(introspection.__schema))) + devAssert(false, `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${inspect(introspection)}.`); + const schemaIntrospection = introspection.__schema; + const typeMap = new Map(schemaIntrospection.types.map((typeIntrospection) => [ + typeIntrospection.name, + buildType(typeIntrospection), + ])); + for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) { + if (typeMap.has(stdType.name)) { + typeMap.set(stdType.name, stdType); + } + } + const queryType = schemaIntrospection.queryType != null + ? getObjectType(schemaIntrospection.queryType) + : null; + const mutationType = schemaIntrospection.mutationType != null + ? getObjectType(schemaIntrospection.mutationType) + : null; + const subscriptionType = schemaIntrospection.subscriptionType != null + ? getObjectType(schemaIntrospection.subscriptionType) + : null; + const directives = schemaIntrospection.directives != null + ? schemaIntrospection.directives.map(buildDirective) + : []; + return new GraphQLSchema({ + description: schemaIntrospection.description, + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + types: [...typeMap.values()], + directives, + assumeValid: options?.assumeValid, + }); + function getType(typeRef) { + if (typeRef.kind === TypeKind.LIST) { + const itemRef = typeRef.ofType; + if (itemRef == null) { + throw new Error('Decorated type deeper than introspection query.'); + } + return new GraphQLList(getType(itemRef)); + } + if (typeRef.kind === TypeKind.NON_NULL) { + const nullableRef = typeRef.ofType; + if (nullableRef == null) { + throw new Error('Decorated type deeper than introspection query.'); + } + const nullableType = getType(nullableRef); + return new GraphQLNonNull(assertNullableType(nullableType)); + } + return getNamedType(typeRef); + } + function getNamedType(typeRef) { + const typeName = typeRef.name; + if (!typeName) { + throw new Error(`Unknown type reference: ${inspect(typeRef)}.`); + } + const type = typeMap.get(typeName); + if (type == null) { + throw new Error(`Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`); + } + return type; + } + function getObjectType(typeRef) { + return assertObjectType(getNamedType(typeRef)); + } + function getInterfaceType(typeRef) { + return assertInterfaceType(getNamedType(typeRef)); + } + function buildType(type) { + switch (type.kind) { + case TypeKind.SCALAR: + return buildScalarDef(type); + case TypeKind.OBJECT: + return buildObjectDef(type); + case TypeKind.INTERFACE: + return buildInterfaceDef(type); + case TypeKind.UNION: + return buildUnionDef(type); + case TypeKind.ENUM: + return buildEnumDef(type); + case TypeKind.INPUT_OBJECT: + return buildInputObjectDef(type); + default: + throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${inspect(type)}.`); + } + } + function buildScalarDef(scalarIntrospection) { + return new GraphQLScalarType({ + name: scalarIntrospection.name, + description: scalarIntrospection.description, + specifiedByURL: scalarIntrospection.specifiedByURL, + }); + } + function buildImplementationsList(implementingIntrospection) { + if (implementingIntrospection.interfaces === null && + implementingIntrospection.kind === TypeKind.INTERFACE) { + return []; + } + if (implementingIntrospection.interfaces == null) { + const implementingIntrospectionStr = inspect(implementingIntrospection); + throw new Error(`Introspection result missing interfaces: ${implementingIntrospectionStr}.`); + } + return implementingIntrospection.interfaces.map(getInterfaceType); + } + function buildObjectDef(objectIntrospection) { + return new GraphQLObjectType({ + name: objectIntrospection.name, + description: objectIntrospection.description, + interfaces: () => buildImplementationsList(objectIntrospection), + fields: () => buildFieldDefMap(objectIntrospection), + }); + } + function buildInterfaceDef(interfaceIntrospection) { + return new GraphQLInterfaceType({ + name: interfaceIntrospection.name, + description: interfaceIntrospection.description, + interfaces: () => buildImplementationsList(interfaceIntrospection), + fields: () => buildFieldDefMap(interfaceIntrospection), + }); + } + function buildUnionDef(unionIntrospection) { + if (unionIntrospection.possibleTypes == null) { + const unionIntrospectionStr = inspect(unionIntrospection); + throw new Error(`Introspection result missing possibleTypes: ${unionIntrospectionStr}.`); + } + return new GraphQLUnionType({ + name: unionIntrospection.name, + description: unionIntrospection.description, + types: () => unionIntrospection.possibleTypes.map(getObjectType), + }); + } + function buildEnumDef(enumIntrospection) { + if (enumIntrospection.enumValues == null) { + const enumIntrospectionStr = inspect(enumIntrospection); + throw new Error(`Introspection result missing enumValues: ${enumIntrospectionStr}.`); + } + return new GraphQLEnumType({ + name: enumIntrospection.name, + description: enumIntrospection.description, + values: keyValMap(enumIntrospection.enumValues, (valueIntrospection) => valueIntrospection.name, (valueIntrospection) => ({ + description: valueIntrospection.description, + deprecationReason: valueIntrospection.deprecationReason, + })), + }); + } + function buildInputObjectDef(inputObjectIntrospection) { + if (inputObjectIntrospection.inputFields == null) { + const inputObjectIntrospectionStr = inspect(inputObjectIntrospection); + throw new Error(`Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`); + } + return new GraphQLInputObjectType({ + name: inputObjectIntrospection.name, + description: inputObjectIntrospection.description, + fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), + isOneOf: inputObjectIntrospection.isOneOf, + }); + } + function buildFieldDefMap(typeIntrospection) { + if (typeIntrospection.fields == null) { + throw new Error(`Introspection result missing fields: ${inspect(typeIntrospection)}.`); + } + return keyValMap(typeIntrospection.fields, (fieldIntrospection) => fieldIntrospection.name, buildField); + } + function buildField(fieldIntrospection) { + const type = getType(fieldIntrospection.type); + if (!isOutputType(type)) { + const typeStr = inspect(type); + throw new Error(`Introspection must provide output type for fields, but received: ${typeStr}.`); + } + if (fieldIntrospection.args == null) { + const fieldIntrospectionStr = inspect(fieldIntrospection); + throw new Error(`Introspection result missing field args: ${fieldIntrospectionStr}.`); + } + return { + description: fieldIntrospection.description, + deprecationReason: fieldIntrospection.deprecationReason, + type, + args: buildInputValueDefMap(fieldIntrospection.args), + }; + } + function buildInputValueDefMap(inputValueIntrospections) { + return keyValMap(inputValueIntrospections, (inputValue) => inputValue.name, buildInputValue); + } + function buildInputValue(inputValueIntrospection) { + const type = getType(inputValueIntrospection.type); + if (!isInputType(type)) { + const typeStr = inspect(type); + throw new Error(`Introspection must provide input type for arguments, but received: ${typeStr}.`); + } + return { + description: inputValueIntrospection.description, + type, + default: inputValueIntrospection.defaultValue != null + ? { literal: parseConstValue(inputValueIntrospection.defaultValue) } + : undefined, + deprecationReason: inputValueIntrospection.deprecationReason, + }; + } + function buildDirective(directiveIntrospection) { + if (directiveIntrospection.args == null) { + const directiveIntrospectionStr = inspect(directiveIntrospection); + throw new Error(`Introspection result missing directive args: ${directiveIntrospectionStr}.`); + } + if (directiveIntrospection.locations == null) { + const directiveIntrospectionStr = inspect(directiveIntrospection); + throw new Error(`Introspection result missing directive locations: ${directiveIntrospectionStr}.`); + } + return new GraphQLDirective({ + name: directiveIntrospection.name, + description: directiveIntrospection.description, + isRepeatable: directiveIntrospection.isRepeatable, + deprecationReason: directiveIntrospection.deprecationReason, + locations: directiveIntrospection.locations.slice(), + args: buildInputValueDefMap(directiveIntrospection.args), + }); + } +} +//# sourceMappingURL=buildClientSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs.map new file mode 100644 index 00000000..a242b43c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/buildClientSchema.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"buildClientSchema.js","sourceRoot":"","sources":["../../src/utilities/buildClientSchema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAC1D,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAEpD,OAAO,EAAE,eAAe,EAAE,+BAA8B;AAQxD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,iBAAiB,EAC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I,IAAI,EAAE,CAAC;YAC7C,MAAM,yBAAyB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;YAClE,MAAM,IAAI,KAAK,CACb,qDAAqD,yBAAyB,GAAG,CAClF,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,gBAAgB,CAAC;YAC1B,IAAI,EAAE,sBAAsB,CAAC,IAAI;YACjC,WAAW,EAAE,sBAAsB,CAAC,WAAW;YAC/C,YAAY,EAAE,sBAAsB,CAAC,YAAY;YACjD,iBAAiB,EAAE,sBAAsB,CAAC,iBAAiB;YAC3D,SAAS,EAAE,sBAAsB,CAAC,SAAS,CAAC,KAAK,EAAE;YACnD,IAAI,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,IAAI,CAAC;SACzD,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["/** @category Introspection */\n\nimport { devAssert } from '../jsutils/devAssert.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyValMap } from '../jsutils/keyValMap.ts';\n\nimport { parseConstValue } from '../language/parser.ts';\n\nimport type {\n GraphQLFieldConfig,\n GraphQLFieldConfigMap,\n GraphQLNamedType,\n GraphQLType,\n} from '../type/definition.ts';\nimport {\n assertInterfaceType,\n assertNullableType,\n assertObjectType,\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n isInputType,\n isOutputType,\n} from '../type/definition.ts';\nimport { GraphQLDirective } from '../type/directives.ts';\nimport { introspectionTypes, TypeKind } from '../type/introspection.ts';\nimport { specifiedScalarTypes } from '../type/scalars.ts';\nimport type { GraphQLSchemaValidationOptions } from '../type/schema.ts';\nimport { GraphQLSchema } from '../type/schema.ts';\n\nimport type {\n IntrospectionDirective,\n IntrospectionEnumType,\n IntrospectionField,\n IntrospectionInputObjectType,\n IntrospectionInputValue,\n IntrospectionInterfaceType,\n IntrospectionNamedTypeRef,\n IntrospectionObjectType,\n IntrospectionQuery,\n IntrospectionScalarType,\n IntrospectionType,\n IntrospectionTypeRef,\n IntrospectionUnionType,\n} from './getIntrospectionQuery.ts';\n\n/**\n * Build a GraphQLSchema for use by client tools.\n *\n * Given the result of a client running the introspection query, creates and\n * returns a GraphQLSchema instance which can be then used with all graphql-js\n * tools, but cannot be used to execute a query, as introspection does not\n * represent the \"resolver\", \"parse\" or \"serialize\" functions or any other\n * server-internal mechanisms.\n *\n * This function expects a complete introspection result. Don't forget to check\n * the \"errors\" field of a server response before calling this function.\n * @param introspection - Introspection result data to build from.\n * @param options - Optional configuration for this operation.\n * @returns The client schema represented by the introspection result.\n * @example\n * ```ts\n * import {\n * buildClientSchema,\n * introspectionFromSchema,\n * buildSchema,\n * } from 'graphql/utilities';\n *\n * const schema = buildSchema('type Query { hello: String }');\n * const clientSchema = buildClientSchema(introspectionFromSchema(schema), {\n * assumeValid: true,\n * });\n *\n * clientSchema.getQueryType().name; // => 'Query'\n * ```\n */\nexport function buildClientSchema(\n introspection: IntrospectionQuery,\n options?: GraphQLSchemaValidationOptions,\n): GraphQLSchema {\n // Even though the `introspection` argument is typed, in most cases it's received\n // as an untyped value from the server, so we will do an additional check here.\n devAssert(\n isObjectLike(introspection) && isObjectLike(introspection.__schema),\n `Invalid or incomplete introspection result. Ensure that you are passing \"data\" property of introspection response and no \"errors\" was returned alongside: ${inspect(\n introspection,\n )}.`,\n );\n\n // Get the schema from the introspection result.\n const schemaIntrospection = introspection.__schema;\n\n // Iterate through all types, getting the type definition for each.\n const typeMap = new Map(\n schemaIntrospection.types.map((typeIntrospection) => [\n typeIntrospection.name,\n buildType(typeIntrospection),\n ]),\n );\n\n // Include standard types only if they are used.\n for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) {\n if (typeMap.has(stdType.name)) {\n typeMap.set(stdType.name, stdType);\n }\n }\n\n // Get the root Query, Mutation, and Subscription types.\n const queryType =\n schemaIntrospection.queryType != null\n ? getObjectType(schemaIntrospection.queryType)\n : null;\n\n const mutationType =\n schemaIntrospection.mutationType != null\n ? getObjectType(schemaIntrospection.mutationType)\n : null;\n\n const subscriptionType =\n schemaIntrospection.subscriptionType != null\n ? getObjectType(schemaIntrospection.subscriptionType)\n : null;\n\n // Get the directives supported by Introspection, assuming empty-set if\n // directives were not queried for.\n const directives =\n schemaIntrospection.directives != null\n ? schemaIntrospection.directives.map(buildDirective)\n : [];\n\n // Then produce and return a Schema with these types.\n return new GraphQLSchema({\n description: schemaIntrospection.description,\n query: queryType,\n mutation: mutationType,\n subscription: subscriptionType,\n types: [...typeMap.values()],\n directives,\n assumeValid: options?.assumeValid,\n });\n\n // Given a type reference in introspection, return the GraphQLType instance.\n // preferring cached instances before building new instances.\n function getType(typeRef: IntrospectionTypeRef): GraphQLType {\n if (typeRef.kind === TypeKind.LIST) {\n const itemRef = typeRef.ofType;\n if (itemRef == null) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n return new GraphQLList(getType(itemRef));\n }\n if (typeRef.kind === TypeKind.NON_NULL) {\n const nullableRef = typeRef.ofType;\n if (nullableRef == null) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n const nullableType = getType(nullableRef);\n return new GraphQLNonNull(assertNullableType(nullableType));\n }\n return getNamedType(typeRef);\n }\n\n function getNamedType(typeRef: IntrospectionNamedTypeRef): GraphQLNamedType {\n const typeName = typeRef.name;\n if (!typeName) {\n throw new Error(`Unknown type reference: ${inspect(typeRef)}.`);\n }\n\n const type = typeMap.get(typeName);\n if (type == null) {\n throw new Error(\n `Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`,\n );\n }\n\n return type;\n }\n\n function getObjectType(\n typeRef: IntrospectionNamedTypeRef,\n ): GraphQLObjectType {\n return assertObjectType(getNamedType(typeRef));\n }\n\n function getInterfaceType(\n typeRef: IntrospectionNamedTypeRef,\n ): GraphQLInterfaceType {\n return assertInterfaceType(getNamedType(typeRef));\n }\n\n // Given a type's introspection result, construct the correct\n // GraphQLType instance.\n function buildType(type: IntrospectionType): GraphQLNamedType {\n switch (type.kind) {\n case TypeKind.SCALAR:\n return buildScalarDef(type);\n case TypeKind.OBJECT:\n return buildObjectDef(type);\n case TypeKind.INTERFACE:\n return buildInterfaceDef(type);\n case TypeKind.UNION:\n return buildUnionDef(type);\n case TypeKind.ENUM:\n return buildEnumDef(type);\n case TypeKind.INPUT_OBJECT:\n return buildInputObjectDef(type);\n default:\n // TypeScript considers this unreachable, but invalid runtime input can reach it.\n // Note: we include a default case rather than throwing after the switch to avoid\n // the use of a @ts-expect-error statement.\n throw new Error(\n `Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${inspect(\n type,\n )}.`,\n );\n }\n }\n\n function buildScalarDef(\n scalarIntrospection: IntrospectionScalarType,\n ): GraphQLScalarType {\n return new GraphQLScalarType({\n name: scalarIntrospection.name,\n description: scalarIntrospection.description,\n specifiedByURL: scalarIntrospection.specifiedByURL,\n });\n }\n\n function buildImplementationsList(\n implementingIntrospection:\n | IntrospectionObjectType\n | IntrospectionInterfaceType,\n ): Array {\n // TODO: Temporary workaround until GraphQL ecosystem will fully support\n // 'interfaces' on interface types.\n if (\n implementingIntrospection.interfaces === null &&\n implementingIntrospection.kind === TypeKind.INTERFACE\n ) {\n return [];\n }\n\n if (implementingIntrospection.interfaces == null) {\n const implementingIntrospectionStr = inspect(implementingIntrospection);\n throw new Error(\n `Introspection result missing interfaces: ${implementingIntrospectionStr}.`,\n );\n }\n\n return implementingIntrospection.interfaces.map(getInterfaceType);\n }\n\n function buildObjectDef(\n objectIntrospection: IntrospectionObjectType,\n ): GraphQLObjectType {\n return new GraphQLObjectType({\n name: objectIntrospection.name,\n description: objectIntrospection.description,\n interfaces: () => buildImplementationsList(objectIntrospection),\n fields: () => buildFieldDefMap(objectIntrospection),\n });\n }\n\n function buildInterfaceDef(\n interfaceIntrospection: IntrospectionInterfaceType,\n ): GraphQLInterfaceType {\n return new GraphQLInterfaceType({\n name: interfaceIntrospection.name,\n description: interfaceIntrospection.description,\n interfaces: () => buildImplementationsList(interfaceIntrospection),\n fields: () => buildFieldDefMap(interfaceIntrospection),\n });\n }\n\n function buildUnionDef(\n unionIntrospection: IntrospectionUnionType,\n ): GraphQLUnionType {\n if (unionIntrospection.possibleTypes == null) {\n const unionIntrospectionStr = inspect(unionIntrospection);\n throw new Error(\n `Introspection result missing possibleTypes: ${unionIntrospectionStr}.`,\n );\n }\n return new GraphQLUnionType({\n name: unionIntrospection.name,\n description: unionIntrospection.description,\n types: () => unionIntrospection.possibleTypes.map(getObjectType),\n });\n }\n\n function buildEnumDef(\n enumIntrospection: IntrospectionEnumType,\n ): GraphQLEnumType {\n if (enumIntrospection.enumValues == null) {\n const enumIntrospectionStr = inspect(enumIntrospection);\n throw new Error(\n `Introspection result missing enumValues: ${enumIntrospectionStr}.`,\n );\n }\n return new GraphQLEnumType({\n name: enumIntrospection.name,\n description: enumIntrospection.description,\n values: keyValMap(\n enumIntrospection.enumValues,\n (valueIntrospection) => valueIntrospection.name,\n (valueIntrospection) => ({\n description: valueIntrospection.description,\n deprecationReason: valueIntrospection.deprecationReason,\n }),\n ),\n });\n }\n\n function buildInputObjectDef(\n inputObjectIntrospection: IntrospectionInputObjectType,\n ): GraphQLInputObjectType {\n if (inputObjectIntrospection.inputFields == null) {\n const inputObjectIntrospectionStr = inspect(inputObjectIntrospection);\n throw new Error(\n `Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`,\n );\n }\n return new GraphQLInputObjectType({\n name: inputObjectIntrospection.name,\n description: inputObjectIntrospection.description,\n fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields),\n isOneOf: inputObjectIntrospection.isOneOf,\n });\n }\n\n function buildFieldDefMap(\n typeIntrospection: IntrospectionObjectType | IntrospectionInterfaceType,\n ): GraphQLFieldConfigMap {\n if (typeIntrospection.fields == null) {\n throw new Error(\n `Introspection result missing fields: ${inspect(typeIntrospection)}.`,\n );\n }\n\n return keyValMap(\n typeIntrospection.fields,\n (fieldIntrospection) => fieldIntrospection.name,\n buildField,\n );\n }\n\n function buildField(\n fieldIntrospection: IntrospectionField,\n ): GraphQLFieldConfig {\n const type = getType(fieldIntrospection.type);\n if (!isOutputType(type)) {\n const typeStr = inspect(type);\n throw new Error(\n `Introspection must provide output type for fields, but received: ${typeStr}.`,\n );\n }\n\n if (fieldIntrospection.args == null) {\n const fieldIntrospectionStr = inspect(fieldIntrospection);\n throw new Error(\n `Introspection result missing field args: ${fieldIntrospectionStr}.`,\n );\n }\n\n return {\n description: fieldIntrospection.description,\n deprecationReason: fieldIntrospection.deprecationReason,\n type,\n args: buildInputValueDefMap(fieldIntrospection.args),\n };\n }\n\n function buildInputValueDefMap(\n inputValueIntrospections: ReadonlyArray,\n ) {\n return keyValMap(\n inputValueIntrospections,\n (inputValue) => inputValue.name,\n buildInputValue,\n );\n }\n\n function buildInputValue(inputValueIntrospection: IntrospectionInputValue) {\n const type = getType(inputValueIntrospection.type);\n if (!isInputType(type)) {\n const typeStr = inspect(type);\n throw new Error(\n `Introspection must provide input type for arguments, but received: ${typeStr}.`,\n );\n }\n\n return {\n description: inputValueIntrospection.description,\n type,\n default:\n inputValueIntrospection.defaultValue != null\n ? { literal: parseConstValue(inputValueIntrospection.defaultValue) }\n : undefined,\n deprecationReason: inputValueIntrospection.deprecationReason,\n };\n }\n\n function buildDirective(\n directiveIntrospection: IntrospectionDirective,\n ): GraphQLDirective {\n if (directiveIntrospection.args == null) {\n const directiveIntrospectionStr = inspect(directiveIntrospection);\n throw new Error(\n `Introspection result missing directive args: ${directiveIntrospectionStr}.`,\n );\n }\n if (directiveIntrospection.locations == null) {\n const directiveIntrospectionStr = inspect(directiveIntrospection);\n throw new Error(\n `Introspection result missing directive locations: ${directiveIntrospectionStr}.`,\n );\n }\n return new GraphQLDirective({\n name: directiveIntrospection.name,\n description: directiveIntrospection.description,\n isRepeatable: directiveIntrospection.isRepeatable,\n deprecationReason: directiveIntrospection.deprecationReason,\n locations: directiveIntrospection.locations.slice(),\n args: buildInputValueDefMap(directiveIntrospection.args),\n });\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.mts new file mode 100644 index 00000000..974d9ad6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.mts @@ -0,0 +1,117 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ValueNode } from "../language/ast.mjs"; +import type { GraphQLDefaultInput, GraphQLInputType } from "../type/definition.mjs"; +import type { FragmentVariableValues } from "../execution/collectFields.mjs"; +import type { VariableValues } from "../execution/values.mjs"; +/** + * Coerces a JavaScript value given a GraphQL Input Type. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. Use `validateInputValue` when coercion diagnostics + * are needed. + * @param inputValue - JavaScript value to coerce. + * @param type - GraphQL input type to coerce the value against. + * @returns Coerced value, or undefined if coercion fails. + * @example + * ```ts + * // Coerce runtime input values, returning undefined when coercion fails. + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { coerceInputValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * coerceInputValue({ stars: '5', tags: ['featured'] }, ReviewInput); // => { stars: 5, tags: ['featured'] } + * coerceInputValue({ stars: 'bad' }, ReviewInput); // => undefined + * ``` + */ +export declare function coerceInputValue(inputValue: unknown, type: GraphQLInputType): unknown; +/** + * Produces a coerced "internal" JavaScript value given a GraphQL Value AST. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * @param valueNode - GraphQL value AST node to coerce. + * @param type - GraphQL input type to coerce the literal against. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @returns Coerced value, or undefined if coercion fails. + * @example + * ```ts + * // Coerce literal input values without variables. + * import { parseValue } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { coerceInputLiteral } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * comment: { type: GraphQLString }, + * }, + * }); + * + * coerceInputLiteral( + * parseValue('{ stars: 5, comment: "Loved it" }'), + * ReviewInput, + * ); // => { stars: 5, comment: 'Loved it' } + * coerceInputLiteral(parseValue('{ comment: "Missing" }'), ReviewInput); // => undefined + * ``` + * @example + * ```ts + * // This variant resolves variable references using VariableValues from getVariableValues(). + * import assert from 'node:assert'; + * import { parse, parseValue } from 'graphql/language'; + * import { GraphQLInt } from 'graphql/type'; + * import { getVariableValues } from 'graphql/execution'; + * import { buildSchema, coerceInputLiteral } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * review(stars: Int): String + * } + * `); + * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }'); + * const operation = document.definitions[0]; + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: '4', + * }); + * + * assert('variableValues' in result); + * + * coerceInputLiteral(parseValue('$stars'), GraphQLInt, result.variableValues); // => 4 + * ``` + */ +export declare function coerceInputLiteral(valueNode: ValueNode, type: GraphQLInputType, variableValues?: Maybe, fragmentVariableValues?: Maybe): unknown; +interface InputValue { + type: GraphQLInputType; + default?: GraphQLDefaultInput | undefined; + defaultValue?: unknown; +} +/** + * Returns the coerced default value for an input value definition, if it exists. + * + * If the default value is invalid, this will throw an error. Invalid default + * values should be caught during validation, however, so this function assumes + * that the default value is valid. + * @internal + */ +export declare function coerceDefaultValue(inputValue: InputValue): unknown; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.ts new file mode 100644 index 00000000..da3abe6c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.d.ts @@ -0,0 +1,117 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ValueNode } from "../language/ast.js"; +import type { GraphQLDefaultInput, GraphQLInputType } from "../type/definition.js"; +import type { FragmentVariableValues } from "../execution/collectFields.js"; +import type { VariableValues } from "../execution/values.js"; +/** + * Coerces a JavaScript value given a GraphQL Input Type. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. Use `validateInputValue` when coercion diagnostics + * are needed. + * @param inputValue - JavaScript value to coerce. + * @param type - GraphQL input type to coerce the value against. + * @returns Coerced value, or undefined if coercion fails. + * @example + * ```ts + * // Coerce runtime input values, returning undefined when coercion fails. + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { coerceInputValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * coerceInputValue({ stars: '5', tags: ['featured'] }, ReviewInput); // => { stars: 5, tags: ['featured'] } + * coerceInputValue({ stars: 'bad' }, ReviewInput); // => undefined + * ``` + */ +export declare function coerceInputValue(inputValue: unknown, type: GraphQLInputType): unknown; +/** + * Produces a coerced "internal" JavaScript value given a GraphQL Value AST. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * @param valueNode - GraphQL value AST node to coerce. + * @param type - GraphQL input type to coerce the literal against. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @returns Coerced value, or undefined if coercion fails. + * @example + * ```ts + * // Coerce literal input values without variables. + * import { parseValue } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { coerceInputLiteral } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * comment: { type: GraphQLString }, + * }, + * }); + * + * coerceInputLiteral( + * parseValue('{ stars: 5, comment: "Loved it" }'), + * ReviewInput, + * ); // => { stars: 5, comment: 'Loved it' } + * coerceInputLiteral(parseValue('{ comment: "Missing" }'), ReviewInput); // => undefined + * ``` + * @example + * ```ts + * // This variant resolves variable references using VariableValues from getVariableValues(). + * import assert from 'node:assert'; + * import { parse, parseValue } from 'graphql/language'; + * import { GraphQLInt } from 'graphql/type'; + * import { getVariableValues } from 'graphql/execution'; + * import { buildSchema, coerceInputLiteral } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * review(stars: Int): String + * } + * `); + * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }'); + * const operation = document.definitions[0]; + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: '4', + * }); + * + * assert('variableValues' in result); + * + * coerceInputLiteral(parseValue('$stars'), GraphQLInt, result.variableValues); // => 4 + * ``` + */ +export declare function coerceInputLiteral(valueNode: ValueNode, type: GraphQLInputType, variableValues?: Maybe, fragmentVariableValues?: Maybe): unknown; +interface InputValue { + type: GraphQLInputType; + default?: GraphQLDefaultInput | undefined; + defaultValue?: unknown; +} +/** + * Returns the coerced default value for an input value definition, if it exists. + * + * If the default value is invalid, this will throw an error. Invalid default + * values should be caught during validation, however, so this function assumes + * that the default value is valid. + * @internal + */ +export declare function coerceDefaultValue(inputValue: InputValue): unknown; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js new file mode 100644 index 00000000..a8687032 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js @@ -0,0 +1,228 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.coerceInputValue = coerceInputValue; +exports.coerceInputLiteral = coerceInputLiteral; +exports.coerceDefaultValue = coerceDefaultValue; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const isIterableObject_ts_1 = require("../jsutils/isIterableObject.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +const replaceVariables_ts_1 = require("./replaceVariables.js"); +function coerceInputValue(inputValue, type) { + if ((0, definition_ts_1.isNonNullType)(type)) { + if (inputValue == null) { + return; + } + return coerceInputValue(inputValue, type.ofType); + } + if (inputValue == null) { + return null; + } + if ((0, definition_ts_1.isListType)(type)) { + if (!(0, isIterableObject_ts_1.isIterableObject)(inputValue)) { + const coercedItem = coerceInputValue(inputValue, type.ofType); + if (coercedItem === undefined) { + return; + } + return [coercedItem]; + } + const coercedValue = []; + for (const itemValue of inputValue) { + const coercedItem = coerceInputValue(itemValue, type.ofType); + if (coercedItem === undefined) { + return; + } + coercedValue.push(coercedItem); + } + return coercedValue; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + if (!(0, isObjectLike_ts_1.isObjectLike)(inputValue) || Array.isArray(inputValue)) { + return; + } + const coercedValue = Object.create(null); + const fieldDefs = type.getFields(); + let definedFieldCount = 0; + for (const fieldName of Object.keys(inputValue)) { + if (inputValue[fieldName] === undefined) { + continue; + } + definedFieldCount++; + if (!Object.hasOwn(fieldDefs, fieldName)) { + return; + } + } + for (const field of Object.values(fieldDefs)) { + const fieldValue = inputValue[field.name]; + if (fieldValue === undefined) { + if ((0, definition_ts_1.isRequiredInputField)(field)) { + return; + } + const coercedDefaultValue = coerceDefaultValue(field); + if (coercedDefaultValue !== undefined) { + coercedValue[field.name] = coercedDefaultValue; + } + } + else { + const coercedField = coerceInputValue(fieldValue, field.type); + if (coercedField === undefined) { + return; + } + coercedValue[field.name] = coercedField; + } + } + if (type.isOneOf) { + const keys = Object.keys(coercedValue); + if (definedFieldCount !== 1 || keys.length !== 1) { + return; + } + const key = keys[0]; + const value = coercedValue[key]; + if (value === null) { + return; + } + } + return coercedValue; + } + const leafType = (0, definition_ts_1.assertLeafType)(type); + try { + return leafType.coerceInputValue(inputValue); + } + catch (_error) { + } +} +function coerceInputLiteral(valueNode, type, variableValues, fragmentVariableValues) { + if (valueNode.kind === kinds_ts_1.Kind.VARIABLE) { + const coercedVariableValue = getCoercedVariableValue(valueNode, variableValues, fragmentVariableValues); + if (coercedVariableValue == null && (0, definition_ts_1.isNonNullType)(type)) { + return; + } + return coercedVariableValue; + } + if ((0, definition_ts_1.isNonNullType)(type)) { + if (valueNode.kind === kinds_ts_1.Kind.NULL) { + return; + } + return coerceInputLiteral(valueNode, type.ofType, variableValues, fragmentVariableValues); + } + if (valueNode.kind === kinds_ts_1.Kind.NULL) { + return null; + } + if ((0, definition_ts_1.isListType)(type)) { + if (valueNode.kind !== kinds_ts_1.Kind.LIST) { + const itemValue = coerceInputLiteral(valueNode, type.ofType, variableValues, fragmentVariableValues); + if (itemValue === undefined) { + return; + } + return [itemValue]; + } + const coercedValue = []; + for (const itemNode of valueNode.values) { + let itemValue = coerceInputLiteral(itemNode, type.ofType, variableValues, fragmentVariableValues); + if (itemValue === undefined) { + if (itemNode.kind === kinds_ts_1.Kind.VARIABLE && + getCoercedVariableValue(itemNode, variableValues, fragmentVariableValues) == null && + !(0, definition_ts_1.isNonNullType)(type.ofType)) { + itemValue = null; + } + else { + return; + } + } + coercedValue.push(itemValue); + } + return coercedValue; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + if (valueNode.kind !== kinds_ts_1.Kind.OBJECT) { + return; + } + const coercedValue = Object.create(null); + const fieldDefs = type.getFields(); + const hasUndefinedField = valueNode.fields.some((field) => !Object.hasOwn(fieldDefs, field.name.value)); + if (hasUndefinedField) { + return; + } + const fieldNodes = new Map(valueNode.fields.map((field) => [field.name.value, field])); + for (const field of Object.values(fieldDefs)) { + const fieldNode = fieldNodes.get(field.name); + if (!fieldNode || + (fieldNode.value.kind === kinds_ts_1.Kind.VARIABLE && + isMissingVariable(fieldNode.value, variableValues, fragmentVariableValues))) { + if ((0, definition_ts_1.isRequiredInputField)(field)) { + return; + } + const coercedDefaultValue = coerceDefaultValue(field); + if (coercedDefaultValue !== undefined) { + coercedValue[field.name] = coercedDefaultValue; + } + } + else { + const fieldValue = coerceInputLiteral(fieldNode.value, field.type, variableValues, fragmentVariableValues); + if (fieldValue === undefined) { + return; + } + coercedValue[field.name] = fieldValue; + } + } + if (type.isOneOf) { + const coercedKeys = Object.keys(coercedValue); + if (fieldNodes.size !== 1 || coercedKeys.length !== 1) { + return; + } + for (const [fieldName, fieldNode] of fieldNodes) { + if (fieldNode.value.kind === kinds_ts_1.Kind.NULL || + coercedValue[fieldName] === null) { + return; + } + } + } + return coercedValue; + } + const leafType = (0, definition_ts_1.assertLeafType)(type); + try { + return leafType.coerceInputLiteral + ? leafType.coerceInputLiteral((0, replaceVariables_ts_1.replaceVariables)(valueNode, variableValues, fragmentVariableValues)) + : leafType.parseLiteral(valueNode, variableValues?.coerced); + } + catch (_error) { + } +} +function getCoercedVariableValue(variableNode, variableValues, fragmentVariableValues) { + const varName = variableNode.name.value; + if (fragmentVariableValues?.sources[varName] !== undefined) { + return fragmentVariableValues.coerced[varName]; + } + return variableValues?.coerced[varName]; +} +function isMissingVariable(variableNode, variableValues, fragmentVariableValues) { + const varName = variableNode.name.value; + const scopedValues = fragmentVariableValues?.sources[varName] !== undefined + ? fragmentVariableValues.coerced + : variableValues?.coerced; + return scopedValues?.[varName] === undefined; +} +function coerceDefaultValue(inputValue) { + let coercedDefaultValue = inputValue._memoizedCoercedDefaultValue; + if (coercedDefaultValue !== undefined) { + return coercedDefaultValue; + } + const defaultInput = inputValue.default; + if (defaultInput !== undefined) { + coercedDefaultValue = defaultInput.literal + ? coerceInputLiteral(defaultInput.literal, inputValue.type) + : coerceInputValue(defaultInput.value, inputValue.type); + if (!(coercedDefaultValue !== undefined)) + (0, invariant_ts_1.invariant)(false, `Expected value of type "${inputValue.type}" to be valid, found: ${(0, inspect_ts_1.inspect)(defaultInput.literal ?? defaultInput.value)}.`); + inputValue._memoizedCoercedDefaultValue = coercedDefaultValue; + return coercedDefaultValue; + } + const defaultValue = inputValue.defaultValue; + if (defaultValue !== undefined) { + inputValue._memoizedCoercedDefaultValue = defaultValue; + } + return defaultValue; +} +//# sourceMappingURL=coerceInputValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js.map new file mode 100644 index 00000000..4d08641b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"coerceInputValue.js","sourceRoot":"","sources":["../../src/utilities/coerceInputValue.ts"],"names":[],"mappings":";;AA8DA,4CA8FC;AA+DD,gDA4JC;AA6CD,gDA2BC;AA7bD,sDAAgD;AAChD,0DAAoD;AACpD,wEAAkE;AAClE,gEAA0D;AAK1D,mDAA4C;AAM5C,yDAM+B;AAK/B,+DAAyD;AAmCzD,SAAgB,gBAAgB,CAC9B,UAAmB,EACnB,IAAsB;IAEtB,IAAI,IAAA,6BAAa,EAAC,IAAI,CAAC,EAAE,CAAC;QACxB,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QACD,OAAO,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,MAA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ACpD,CAAC,CAAC,sBAAsB,CAAC,OAAO;QAChC,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC;IAC9B,OAAO,YAAY,EAAE,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;AAC/C,CAAC;AAkBD,SAAgB,kBAAkB,CAAC,UAAsB;IAEvD,IAAI,mBAAmB,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAClE,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC;IACxC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,mBAAmB,GAAG,YAAY,CAAC,OAAO;YACxC,CAAC,CAAC,kBAAkB,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;YAC3D,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;cAExD,mBAAmB,KAAK,SAAS;gBADnC,wBAAS,SAEP,2BAA2B,UAAU,CAAC,IAAI,yBAAyB,IAAA,oBAAO,EACxE,YAAY,CAAC,OAAO,IAAI,YAAY,CAAC,KAAK,CAC3C,GAAG;QAEN,UAAU,CAAC,4BAA4B,GAAG,mBAAmB,CAAC;QAC9D,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAC7C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,UAAU,CAAC,4BAA4B,GAAG,YAAY,CAAC;IACzD,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { ValueNode, VariableNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type {\n GraphQLDefaultInput,\n GraphQLInputType,\n} from '../type/definition.ts';\nimport {\n assertLeafType,\n isInputObjectType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../type/definition.ts';\n\nimport type { FragmentVariableValues } from '../execution/collectFields.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { replaceVariables } from './replaceVariables.ts';\n\n/**\n * Coerces a JavaScript value given a GraphQL Input Type.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type. Use `validateInputValue` when coercion diagnostics\n * are needed.\n * @param inputValue - JavaScript value to coerce.\n * @param type - GraphQL input type to coerce the value against.\n * @returns Coerced value, or undefined if coercion fails.\n * @example\n * ```ts\n * // Coerce runtime input values, returning undefined when coercion fails.\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { coerceInputValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * coerceInputValue({ stars: '5', tags: ['featured'] }, ReviewInput); // => { stars: 5, tags: ['featured'] }\n * coerceInputValue({ stars: 'bad' }, ReviewInput); // => undefined\n * ```\n */\nexport function coerceInputValue(\n inputValue: unknown,\n type: GraphQLInputType,\n): unknown {\n if (isNonNullType(type)) {\n if (inputValue == null) {\n return; // Invalid: intentionally return no value.\n }\n return coerceInputValue(inputValue, type.ofType);\n }\n\n if (inputValue == null) {\n return null; // Explicitly return the value null.\n }\n\n if (isListType(type)) {\n if (!isIterableObject(inputValue)) {\n // Lists accept a non-list value as a list of one.\n const coercedItem = coerceInputValue(inputValue, type.ofType);\n if (coercedItem === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedItem];\n }\n const coercedValue = [];\n for (const itemValue of inputValue) {\n const coercedItem = coerceInputValue(itemValue, type.ofType);\n if (coercedItem === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValue.push(coercedItem);\n }\n return coercedValue;\n }\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(inputValue) || Array.isArray(inputValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n const coercedValue: ObjMap = Object.create(null);\n const fieldDefs = type.getFields();\n let definedFieldCount = 0;\n for (const fieldName of Object.keys(inputValue)) {\n if (inputValue[fieldName] === undefined) {\n continue;\n }\n definedFieldCount++;\n if (!Object.hasOwn(fieldDefs, fieldName)) {\n return; // Invalid: intentionally return no value.\n }\n }\n for (const field of Object.values(fieldDefs)) {\n const fieldValue = inputValue[field.name];\n if (fieldValue === undefined) {\n if (isRequiredInputField(field)) {\n return; // Invalid: intentionally return no value.\n }\n const coercedDefaultValue = coerceDefaultValue(field);\n if (coercedDefaultValue !== undefined) {\n coercedValue[field.name] = coercedDefaultValue;\n }\n } else {\n const coercedField = coerceInputValue(fieldValue, field.type);\n if (coercedField === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValue[field.name] = coercedField;\n }\n }\n\n if (type.isOneOf) {\n const keys = Object.keys(coercedValue);\n if (definedFieldCount !== 1 || keys.length !== 1) {\n return; // Invalid: intentionally return no value.\n }\n\n const key = keys[0];\n const value = coercedValue[key];\n if (value === null) {\n return; // Invalid: intentionally return no value.\n }\n }\n\n return coercedValue;\n }\n\n const leafType = assertLeafType(type);\n\n try {\n return leafType.coerceInputValue(inputValue);\n } catch (_error) {\n // Invalid: ignore error and intentionally return no value.\n }\n}\n\n/**\n * Produces a coerced \"internal\" JavaScript value given a GraphQL Value AST.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n * @param valueNode - GraphQL value AST node to coerce.\n * @param type - GraphQL input type to coerce the literal against.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @returns Coerced value, or undefined if coercion fails.\n * @example\n * ```ts\n * // Coerce literal input values without variables.\n * import { parseValue } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { coerceInputLiteral } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * comment: { type: GraphQLString },\n * },\n * });\n *\n * coerceInputLiteral(\n * parseValue('{ stars: 5, comment: \"Loved it\" }'),\n * ReviewInput,\n * ); // => { stars: 5, comment: 'Loved it' }\n * coerceInputLiteral(parseValue('{ comment: \"Missing\" }'), ReviewInput); // => undefined\n * ```\n * @example\n * ```ts\n * // This variant resolves variable references using VariableValues from getVariableValues().\n * import assert from 'node:assert';\n * import { parse, parseValue } from 'graphql/language';\n * import { GraphQLInt } from 'graphql/type';\n * import { getVariableValues } from 'graphql/execution';\n * import { buildSchema, coerceInputLiteral } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * review(stars: Int): String\n * }\n * `);\n * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');\n * const operation = document.definitions[0];\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '4',\n * });\n *\n * assert('variableValues' in result);\n *\n * coerceInputLiteral(parseValue('$stars'), GraphQLInt, result.variableValues); // => 4\n * ```\n */\nexport function coerceInputLiteral(\n valueNode: ValueNode,\n type: GraphQLInputType,\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n): unknown {\n if (valueNode.kind === Kind.VARIABLE) {\n const coercedVariableValue = getCoercedVariableValue(\n valueNode,\n variableValues,\n fragmentVariableValues,\n );\n if (coercedVariableValue == null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n }\n // Note: This does no further checking that this variable is correct.\n // This assumes validated has checked this variable is of the correct type.\n return coercedVariableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return coerceInputLiteral(\n valueNode,\n type.ofType,\n variableValues,\n fragmentVariableValues,\n );\n }\n\n if (valueNode.kind === Kind.NULL) {\n return null; // Explicitly return the value null.\n }\n\n if (isListType(type)) {\n if (valueNode.kind !== Kind.LIST) {\n // Lists accept a non-list value as a list of one.\n const itemValue = coerceInputLiteral(\n valueNode,\n type.ofType,\n variableValues,\n fragmentVariableValues,\n );\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return [itemValue];\n }\n const coercedValue: Array = [];\n for (const itemNode of valueNode.values) {\n let itemValue = coerceInputLiteral(\n itemNode,\n type.ofType,\n variableValues,\n fragmentVariableValues,\n );\n if (itemValue === undefined) {\n if (\n itemNode.kind === Kind.VARIABLE &&\n getCoercedVariableValue(\n itemNode,\n variableValues,\n fragmentVariableValues,\n ) == null &&\n !isNonNullType(type.ofType)\n ) {\n // A missing variable within a list is coerced to null.\n itemValue = null;\n } else {\n return; // Invalid: intentionally return no value.\n }\n }\n coercedValue.push(itemValue);\n }\n return coercedValue;\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n const coercedValue: ObjMap = Object.create(null);\n const fieldDefs = type.getFields();\n const hasUndefinedField = valueNode.fields.some(\n (field) => !Object.hasOwn(fieldDefs, field.name.value),\n );\n if (hasUndefinedField) {\n return; // Invalid: intentionally return no value.\n }\n const fieldNodes = new Map(\n valueNode.fields.map((field) => [field.name.value, field]),\n );\n for (const field of Object.values(fieldDefs)) {\n const fieldNode = fieldNodes.get(field.name);\n if (\n !fieldNode ||\n (fieldNode.value.kind === Kind.VARIABLE &&\n isMissingVariable(\n fieldNode.value,\n variableValues,\n fragmentVariableValues,\n ))\n ) {\n if (isRequiredInputField(field)) {\n return; // Invalid: intentionally return no value.\n }\n const coercedDefaultValue = coerceDefaultValue(field);\n if (coercedDefaultValue !== undefined) {\n coercedValue[field.name] = coercedDefaultValue;\n }\n } else {\n const fieldValue = coerceInputLiteral(\n fieldNode.value,\n field.type,\n variableValues,\n fragmentVariableValues,\n );\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValue[field.name] = fieldValue;\n }\n }\n\n if (type.isOneOf) {\n const coercedKeys = Object.keys(coercedValue);\n if (fieldNodes.size !== 1 || coercedKeys.length !== 1) {\n return; // Invalid: not exactly one key, intentionally return no value.\n }\n\n for (const [fieldName, fieldNode] of fieldNodes) {\n if (\n fieldNode.value.kind === Kind.NULL ||\n coercedValue[fieldName] === null\n ) {\n return; // Invalid: value not non-null, intentionally return no value.\n }\n }\n }\n\n return coercedValue;\n }\n\n const leafType = assertLeafType(type);\n try {\n return leafType.coerceInputLiteral\n ? leafType.coerceInputLiteral(\n replaceVariables(valueNode, variableValues, fragmentVariableValues),\n )\n : leafType.parseLiteral(valueNode, variableValues?.coerced);\n } catch (_error) {\n // Invalid: ignore error and intentionally return no value.\n }\n}\n\n// Retrieves the variable value for the given variable node.\nfunction getCoercedVariableValue(\n variableNode: VariableNode,\n variableValues: Maybe,\n fragmentVariableValues: Maybe,\n): unknown {\n const varName = variableNode.name.value;\n if (fragmentVariableValues?.sources[varName] !== undefined) {\n return fragmentVariableValues.coerced[varName];\n }\n\n return variableValues?.coerced[varName];\n}\n\nfunction isMissingVariable(\n variableNode: VariableNode,\n variableValues: Maybe,\n fragmentVariableValues: Maybe,\n): boolean {\n const varName = variableNode.name.value;\n const scopedValues =\n fragmentVariableValues?.sources[varName] !== undefined\n ? fragmentVariableValues.coerced\n : variableValues?.coerced;\n return scopedValues?.[varName] === undefined;\n}\n\ninterface InputValue {\n type: GraphQLInputType;\n default?: GraphQLDefaultInput | undefined;\n defaultValue?: unknown;\n /** @private */\n _memoizedCoercedDefaultValue?: unknown;\n}\n\n/**\n * Returns the coerced default value for an input value definition, if it exists.\n *\n * If the default value is invalid, this will throw an error. Invalid default\n * values should be caught during validation, however, so this function assumes\n * that the default value is valid.\n * @internal\n */\nexport function coerceDefaultValue(inputValue: InputValue): unknown {\n // Memoize the result of coercing the default value in a hidden field.\n let coercedDefaultValue = inputValue._memoizedCoercedDefaultValue;\n if (coercedDefaultValue !== undefined) {\n return coercedDefaultValue;\n }\n\n const defaultInput = inputValue.default;\n if (defaultInput !== undefined) {\n coercedDefaultValue = defaultInput.literal\n ? coerceInputLiteral(defaultInput.literal, inputValue.type)\n : coerceInputValue(defaultInput.value, inputValue.type);\n invariant(\n coercedDefaultValue !== undefined,\n `Expected value of type \"${inputValue.type}\" to be valid, found: ${inspect(\n defaultInput.literal ?? defaultInput.value,\n )}.`,\n );\n inputValue._memoizedCoercedDefaultValue = coercedDefaultValue;\n return coercedDefaultValue;\n }\n\n const defaultValue = inputValue.defaultValue;\n if (defaultValue !== undefined) {\n inputValue._memoizedCoercedDefaultValue = defaultValue;\n }\n return defaultValue;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs new file mode 100644 index 00000000..93349a0b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs @@ -0,0 +1,223 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { isIterableObject } from "../jsutils/isIterableObject.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { assertLeafType, isInputObjectType, isListType, isNonNullType, isRequiredInputField, } from "../type/definition.mjs"; +import { replaceVariables } from "./replaceVariables.mjs"; +export function coerceInputValue(inputValue, type) { + if (isNonNullType(type)) { + if (inputValue == null) { + return; + } + return coerceInputValue(inputValue, type.ofType); + } + if (inputValue == null) { + return null; + } + if (isListType(type)) { + if (!isIterableObject(inputValue)) { + const coercedItem = coerceInputValue(inputValue, type.ofType); + if (coercedItem === undefined) { + return; + } + return [coercedItem]; + } + const coercedValue = []; + for (const itemValue of inputValue) { + const coercedItem = coerceInputValue(itemValue, type.ofType); + if (coercedItem === undefined) { + return; + } + coercedValue.push(coercedItem); + } + return coercedValue; + } + if (isInputObjectType(type)) { + if (!isObjectLike(inputValue) || Array.isArray(inputValue)) { + return; + } + const coercedValue = Object.create(null); + const fieldDefs = type.getFields(); + let definedFieldCount = 0; + for (const fieldName of Object.keys(inputValue)) { + if (inputValue[fieldName] === undefined) { + continue; + } + definedFieldCount++; + if (!Object.hasOwn(fieldDefs, fieldName)) { + return; + } + } + for (const field of Object.values(fieldDefs)) { + const fieldValue = inputValue[field.name]; + if (fieldValue === undefined) { + if (isRequiredInputField(field)) { + return; + } + const coercedDefaultValue = coerceDefaultValue(field); + if (coercedDefaultValue !== undefined) { + coercedValue[field.name] = coercedDefaultValue; + } + } + else { + const coercedField = coerceInputValue(fieldValue, field.type); + if (coercedField === undefined) { + return; + } + coercedValue[field.name] = coercedField; + } + } + if (type.isOneOf) { + const keys = Object.keys(coercedValue); + if (definedFieldCount !== 1 || keys.length !== 1) { + return; + } + const key = keys[0]; + const value = coercedValue[key]; + if (value === null) { + return; + } + } + return coercedValue; + } + const leafType = assertLeafType(type); + try { + return leafType.coerceInputValue(inputValue); + } + catch (_error) { + } +} +export function coerceInputLiteral(valueNode, type, variableValues, fragmentVariableValues) { + if (valueNode.kind === Kind.VARIABLE) { + const coercedVariableValue = getCoercedVariableValue(valueNode, variableValues, fragmentVariableValues); + if (coercedVariableValue == null && isNonNullType(type)) { + return; + } + return coercedVariableValue; + } + if (isNonNullType(type)) { + if (valueNode.kind === Kind.NULL) { + return; + } + return coerceInputLiteral(valueNode, type.ofType, variableValues, fragmentVariableValues); + } + if (valueNode.kind === Kind.NULL) { + return null; + } + if (isListType(type)) { + if (valueNode.kind !== Kind.LIST) { + const itemValue = coerceInputLiteral(valueNode, type.ofType, variableValues, fragmentVariableValues); + if (itemValue === undefined) { + return; + } + return [itemValue]; + } + const coercedValue = []; + for (const itemNode of valueNode.values) { + let itemValue = coerceInputLiteral(itemNode, type.ofType, variableValues, fragmentVariableValues); + if (itemValue === undefined) { + if (itemNode.kind === Kind.VARIABLE && + getCoercedVariableValue(itemNode, variableValues, fragmentVariableValues) == null && + !isNonNullType(type.ofType)) { + itemValue = null; + } + else { + return; + } + } + coercedValue.push(itemValue); + } + return coercedValue; + } + if (isInputObjectType(type)) { + if (valueNode.kind !== Kind.OBJECT) { + return; + } + const coercedValue = Object.create(null); + const fieldDefs = type.getFields(); + const hasUndefinedField = valueNode.fields.some((field) => !Object.hasOwn(fieldDefs, field.name.value)); + if (hasUndefinedField) { + return; + } + const fieldNodes = new Map(valueNode.fields.map((field) => [field.name.value, field])); + for (const field of Object.values(fieldDefs)) { + const fieldNode = fieldNodes.get(field.name); + if (!fieldNode || + (fieldNode.value.kind === Kind.VARIABLE && + isMissingVariable(fieldNode.value, variableValues, fragmentVariableValues))) { + if (isRequiredInputField(field)) { + return; + } + const coercedDefaultValue = coerceDefaultValue(field); + if (coercedDefaultValue !== undefined) { + coercedValue[field.name] = coercedDefaultValue; + } + } + else { + const fieldValue = coerceInputLiteral(fieldNode.value, field.type, variableValues, fragmentVariableValues); + if (fieldValue === undefined) { + return; + } + coercedValue[field.name] = fieldValue; + } + } + if (type.isOneOf) { + const coercedKeys = Object.keys(coercedValue); + if (fieldNodes.size !== 1 || coercedKeys.length !== 1) { + return; + } + for (const [fieldName, fieldNode] of fieldNodes) { + if (fieldNode.value.kind === Kind.NULL || + coercedValue[fieldName] === null) { + return; + } + } + } + return coercedValue; + } + const leafType = assertLeafType(type); + try { + return leafType.coerceInputLiteral + ? leafType.coerceInputLiteral(replaceVariables(valueNode, variableValues, fragmentVariableValues)) + : leafType.parseLiteral(valueNode, variableValues?.coerced); + } + catch (_error) { + } +} +function getCoercedVariableValue(variableNode, variableValues, fragmentVariableValues) { + const varName = variableNode.name.value; + if (fragmentVariableValues?.sources[varName] !== undefined) { + return fragmentVariableValues.coerced[varName]; + } + return variableValues?.coerced[varName]; +} +function isMissingVariable(variableNode, variableValues, fragmentVariableValues) { + const varName = variableNode.name.value; + const scopedValues = fragmentVariableValues?.sources[varName] !== undefined + ? fragmentVariableValues.coerced + : variableValues?.coerced; + return scopedValues?.[varName] === undefined; +} +export function coerceDefaultValue(inputValue) { + let coercedDefaultValue = inputValue._memoizedCoercedDefaultValue; + if (coercedDefaultValue !== undefined) { + return coercedDefaultValue; + } + const defaultInput = inputValue.default; + if (defaultInput !== undefined) { + coercedDefaultValue = defaultInput.literal + ? coerceInputLiteral(defaultInput.literal, inputValue.type) + : coerceInputValue(defaultInput.value, inputValue.type); + if (!(coercedDefaultValue !== undefined)) + invariant(false, `Expected value of type "${inputValue.type}" to be valid, found: ${inspect(defaultInput.literal ?? defaultInput.value)}.`); + inputValue._memoizedCoercedDefaultValue = coercedDefaultValue; + return coercedDefaultValue; + } + const defaultValue = inputValue.defaultValue; + if (defaultValue !== undefined) { + inputValue._memoizedCoercedDefaultValue = defaultValue; + } + return defaultValue; +} +//# sourceMappingURL=coerceInputValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs.map new file mode 100644 index 00000000..c9ba4d4e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/coerceInputValue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"coerceInputValue.js","sourceRoot":"","sources":["../../src/utilities/coerceInputValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAClE,OAAO,EAAE,YAAY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IAC7C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,UAAU,CAAC,4BAA4B,GAAG,YAAY,CAAC;IACzD,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { ValueNode, VariableNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type {\n GraphQLDefaultInput,\n GraphQLInputType,\n} from '../type/definition.ts';\nimport {\n assertLeafType,\n isInputObjectType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../type/definition.ts';\n\nimport type { FragmentVariableValues } from '../execution/collectFields.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { replaceVariables } from './replaceVariables.ts';\n\n/**\n * Coerces a JavaScript value given a GraphQL Input Type.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type. Use `validateInputValue` when coercion diagnostics\n * are needed.\n * @param inputValue - JavaScript value to coerce.\n * @param type - GraphQL input type to coerce the value against.\n * @returns Coerced value, or undefined if coercion fails.\n * @example\n * ```ts\n * // Coerce runtime input values, returning undefined when coercion fails.\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { coerceInputValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * coerceInputValue({ stars: '5', tags: ['featured'] }, ReviewInput); // => { stars: 5, tags: ['featured'] }\n * coerceInputValue({ stars: 'bad' }, ReviewInput); // => undefined\n * ```\n */\nexport function coerceInputValue(\n inputValue: unknown,\n type: GraphQLInputType,\n): unknown {\n if (isNonNullType(type)) {\n if (inputValue == null) {\n return; // Invalid: intentionally return no value.\n }\n return coerceInputValue(inputValue, type.ofType);\n }\n\n if (inputValue == null) {\n return null; // Explicitly return the value null.\n }\n\n if (isListType(type)) {\n if (!isIterableObject(inputValue)) {\n // Lists accept a non-list value as a list of one.\n const coercedItem = coerceInputValue(inputValue, type.ofType);\n if (coercedItem === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedItem];\n }\n const coercedValue = [];\n for (const itemValue of inputValue) {\n const coercedItem = coerceInputValue(itemValue, type.ofType);\n if (coercedItem === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValue.push(coercedItem);\n }\n return coercedValue;\n }\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(inputValue) || Array.isArray(inputValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n const coercedValue: ObjMap = Object.create(null);\n const fieldDefs = type.getFields();\n let definedFieldCount = 0;\n for (const fieldName of Object.keys(inputValue)) {\n if (inputValue[fieldName] === undefined) {\n continue;\n }\n definedFieldCount++;\n if (!Object.hasOwn(fieldDefs, fieldName)) {\n return; // Invalid: intentionally return no value.\n }\n }\n for (const field of Object.values(fieldDefs)) {\n const fieldValue = inputValue[field.name];\n if (fieldValue === undefined) {\n if (isRequiredInputField(field)) {\n return; // Invalid: intentionally return no value.\n }\n const coercedDefaultValue = coerceDefaultValue(field);\n if (coercedDefaultValue !== undefined) {\n coercedValue[field.name] = coercedDefaultValue;\n }\n } else {\n const coercedField = coerceInputValue(fieldValue, field.type);\n if (coercedField === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValue[field.name] = coercedField;\n }\n }\n\n if (type.isOneOf) {\n const keys = Object.keys(coercedValue);\n if (definedFieldCount !== 1 || keys.length !== 1) {\n return; // Invalid: intentionally return no value.\n }\n\n const key = keys[0];\n const value = coercedValue[key];\n if (value === null) {\n return; // Invalid: intentionally return no value.\n }\n }\n\n return coercedValue;\n }\n\n const leafType = assertLeafType(type);\n\n try {\n return leafType.coerceInputValue(inputValue);\n } catch (_error) {\n // Invalid: ignore error and intentionally return no value.\n }\n}\n\n/**\n * Produces a coerced \"internal\" JavaScript value given a GraphQL Value AST.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n * @param valueNode - GraphQL value AST node to coerce.\n * @param type - GraphQL input type to coerce the literal against.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @returns Coerced value, or undefined if coercion fails.\n * @example\n * ```ts\n * // Coerce literal input values without variables.\n * import { parseValue } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { coerceInputLiteral } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * comment: { type: GraphQLString },\n * },\n * });\n *\n * coerceInputLiteral(\n * parseValue('{ stars: 5, comment: \"Loved it\" }'),\n * ReviewInput,\n * ); // => { stars: 5, comment: 'Loved it' }\n * coerceInputLiteral(parseValue('{ comment: \"Missing\" }'), ReviewInput); // => undefined\n * ```\n * @example\n * ```ts\n * // This variant resolves variable references using VariableValues from getVariableValues().\n * import assert from 'node:assert';\n * import { parse, parseValue } from 'graphql/language';\n * import { GraphQLInt } from 'graphql/type';\n * import { getVariableValues } from 'graphql/execution';\n * import { buildSchema, coerceInputLiteral } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * review(stars: Int): String\n * }\n * `);\n * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');\n * const operation = document.definitions[0];\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '4',\n * });\n *\n * assert('variableValues' in result);\n *\n * coerceInputLiteral(parseValue('$stars'), GraphQLInt, result.variableValues); // => 4\n * ```\n */\nexport function coerceInputLiteral(\n valueNode: ValueNode,\n type: GraphQLInputType,\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n): unknown {\n if (valueNode.kind === Kind.VARIABLE) {\n const coercedVariableValue = getCoercedVariableValue(\n valueNode,\n variableValues,\n fragmentVariableValues,\n );\n if (coercedVariableValue == null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n }\n // Note: This does no further checking that this variable is correct.\n // This assumes validated has checked this variable is of the correct type.\n return coercedVariableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return coerceInputLiteral(\n valueNode,\n type.ofType,\n variableValues,\n fragmentVariableValues,\n );\n }\n\n if (valueNode.kind === Kind.NULL) {\n return null; // Explicitly return the value null.\n }\n\n if (isListType(type)) {\n if (valueNode.kind !== Kind.LIST) {\n // Lists accept a non-list value as a list of one.\n const itemValue = coerceInputLiteral(\n valueNode,\n type.ofType,\n variableValues,\n fragmentVariableValues,\n );\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return [itemValue];\n }\n const coercedValue: Array = [];\n for (const itemNode of valueNode.values) {\n let itemValue = coerceInputLiteral(\n itemNode,\n type.ofType,\n variableValues,\n fragmentVariableValues,\n );\n if (itemValue === undefined) {\n if (\n itemNode.kind === Kind.VARIABLE &&\n getCoercedVariableValue(\n itemNode,\n variableValues,\n fragmentVariableValues,\n ) == null &&\n !isNonNullType(type.ofType)\n ) {\n // A missing variable within a list is coerced to null.\n itemValue = null;\n } else {\n return; // Invalid: intentionally return no value.\n }\n }\n coercedValue.push(itemValue);\n }\n return coercedValue;\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n const coercedValue: ObjMap = Object.create(null);\n const fieldDefs = type.getFields();\n const hasUndefinedField = valueNode.fields.some(\n (field) => !Object.hasOwn(fieldDefs, field.name.value),\n );\n if (hasUndefinedField) {\n return; // Invalid: intentionally return no value.\n }\n const fieldNodes = new Map(\n valueNode.fields.map((field) => [field.name.value, field]),\n );\n for (const field of Object.values(fieldDefs)) {\n const fieldNode = fieldNodes.get(field.name);\n if (\n !fieldNode ||\n (fieldNode.value.kind === Kind.VARIABLE &&\n isMissingVariable(\n fieldNode.value,\n variableValues,\n fragmentVariableValues,\n ))\n ) {\n if (isRequiredInputField(field)) {\n return; // Invalid: intentionally return no value.\n }\n const coercedDefaultValue = coerceDefaultValue(field);\n if (coercedDefaultValue !== undefined) {\n coercedValue[field.name] = coercedDefaultValue;\n }\n } else {\n const fieldValue = coerceInputLiteral(\n fieldNode.value,\n field.type,\n variableValues,\n fragmentVariableValues,\n );\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValue[field.name] = fieldValue;\n }\n }\n\n if (type.isOneOf) {\n const coercedKeys = Object.keys(coercedValue);\n if (fieldNodes.size !== 1 || coercedKeys.length !== 1) {\n return; // Invalid: not exactly one key, intentionally return no value.\n }\n\n for (const [fieldName, fieldNode] of fieldNodes) {\n if (\n fieldNode.value.kind === Kind.NULL ||\n coercedValue[fieldName] === null\n ) {\n return; // Invalid: value not non-null, intentionally return no value.\n }\n }\n }\n\n return coercedValue;\n }\n\n const leafType = assertLeafType(type);\n try {\n return leafType.coerceInputLiteral\n ? leafType.coerceInputLiteral(\n replaceVariables(valueNode, variableValues, fragmentVariableValues),\n )\n : leafType.parseLiteral(valueNode, variableValues?.coerced);\n } catch (_error) {\n // Invalid: ignore error and intentionally return no value.\n }\n}\n\n// Retrieves the variable value for the given variable node.\nfunction getCoercedVariableValue(\n variableNode: VariableNode,\n variableValues: Maybe,\n fragmentVariableValues: Maybe,\n): unknown {\n const varName = variableNode.name.value;\n if (fragmentVariableValues?.sources[varName] !== undefined) {\n return fragmentVariableValues.coerced[varName];\n }\n\n return variableValues?.coerced[varName];\n}\n\nfunction isMissingVariable(\n variableNode: VariableNode,\n variableValues: Maybe,\n fragmentVariableValues: Maybe,\n): boolean {\n const varName = variableNode.name.value;\n const scopedValues =\n fragmentVariableValues?.sources[varName] !== undefined\n ? fragmentVariableValues.coerced\n : variableValues?.coerced;\n return scopedValues?.[varName] === undefined;\n}\n\ninterface InputValue {\n type: GraphQLInputType;\n default?: GraphQLDefaultInput | undefined;\n defaultValue?: unknown;\n /** @private */\n _memoizedCoercedDefaultValue?: unknown;\n}\n\n/**\n * Returns the coerced default value for an input value definition, if it exists.\n *\n * If the default value is invalid, this will throw an error. Invalid default\n * values should be caught during validation, however, so this function assumes\n * that the default value is valid.\n * @internal\n */\nexport function coerceDefaultValue(inputValue: InputValue): unknown {\n // Memoize the result of coercing the default value in a hidden field.\n let coercedDefaultValue = inputValue._memoizedCoercedDefaultValue;\n if (coercedDefaultValue !== undefined) {\n return coercedDefaultValue;\n }\n\n const defaultInput = inputValue.default;\n if (defaultInput !== undefined) {\n coercedDefaultValue = defaultInput.literal\n ? coerceInputLiteral(defaultInput.literal, inputValue.type)\n : coerceInputValue(defaultInput.value, inputValue.type);\n invariant(\n coercedDefaultValue !== undefined,\n `Expected value of type \"${inputValue.type}\" to be valid, found: ${inspect(\n defaultInput.literal ?? defaultInput.value,\n )}.`,\n );\n inputValue._memoizedCoercedDefaultValue = coercedDefaultValue;\n return coercedDefaultValue;\n }\n\n const defaultValue = inputValue.defaultValue;\n if (defaultValue !== undefined) {\n inputValue._memoizedCoercedDefaultValue = defaultValue;\n }\n return defaultValue;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.mts new file mode 100644 index 00000000..2a4e80f8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.mts @@ -0,0 +1,22 @@ +/** @category AST Utilities */ +import type { DocumentNode } from "../language/ast.mjs"; +/** + * Provided a collection of ASTs, presumably each from different files, + * concatenate the ASTs together into batched AST, useful for validating many + * GraphQL source files which together represent one conceptual application. + * @param documents - Document ASTs to concatenate. + * @returns A document AST containing all definitions from the provided documents. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { concatAST } from 'graphql/utilities'; + * + * const document = concatAST([ + * parse('type Query { a: String }'), + * parse('type User { id: ID }'), + * ]); + * + * document.definitions.length; // => 2 + * ``` + */ +export declare function concatAST(documents: ReadonlyArray): DocumentNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.ts new file mode 100644 index 00000000..9a5d5d7c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.d.ts @@ -0,0 +1,22 @@ +/** @category AST Utilities */ +import type { DocumentNode } from "../language/ast.js"; +/** + * Provided a collection of ASTs, presumably each from different files, + * concatenate the ASTs together into batched AST, useful for validating many + * GraphQL source files which together represent one conceptual application. + * @param documents - Document ASTs to concatenate. + * @returns A document AST containing all definitions from the provided documents. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { concatAST } from 'graphql/utilities'; + * + * const document = concatAST([ + * parse('type Query { a: String }'), + * parse('type User { id: ID }'), + * ]); + * + * document.definitions.length; // => 2 + * ``` + */ +export declare function concatAST(documents: ReadonlyArray): DocumentNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js new file mode 100644 index 00000000..ece9333c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.concatAST = concatAST; +const kinds_ts_1 = require("../language/kinds.js"); +function concatAST(documents) { + const definitions = []; + for (const doc of documents) { + definitions.push(...doc.definitions); + } + return { kind: kinds_ts_1.Kind.DOCUMENT, definitions }; +} +//# sourceMappingURL=concatAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js.map new file mode 100644 index 00000000..160ece49 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.js.map @@ -0,0 +1 @@ +{"version":3,"file":"concatAST.js","sourceRoot":"","sources":["../../src/utilities/concatAST.ts"],"names":[],"mappings":";;AAwBA,8BAQC;AA7BD,mDAA4C;AAqB5C,SAAgB,SAAS,CACvB,SAAsC;IAEtC,MAAM,WAAW,GAA0B,EAAE,CAAC;IAC9C,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,WAAW,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,eAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["/** @category AST Utilities */\n\nimport type { DefinitionNode, DocumentNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Provided a collection of ASTs, presumably each from different files,\n * concatenate the ASTs together into batched AST, useful for validating many\n * GraphQL source files which together represent one conceptual application.\n * @param documents - Document ASTs to concatenate.\n * @returns A document AST containing all definitions from the provided documents.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { concatAST } from 'graphql/utilities';\n *\n * const document = concatAST([\n * parse('type Query { a: String }'),\n * parse('type User { id: ID }'),\n * ]);\n *\n * document.definitions.length; // => 2\n * ```\n */\nexport function concatAST(\n documents: ReadonlyArray,\n): DocumentNode {\n const definitions: Array = [];\n for (const doc of documents) {\n definitions.push(...doc.definitions);\n }\n return { kind: Kind.DOCUMENT, definitions };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs new file mode 100644 index 00000000..67a93ade --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs @@ -0,0 +1,9 @@ +import { Kind } from "../language/kinds.mjs"; +export function concatAST(documents) { + const definitions = []; + for (const doc of documents) { + definitions.push(...doc.definitions); + } + return { kind: Kind.DOCUMENT, definitions }; +} +//# sourceMappingURL=concatAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs.map new file mode 100644 index 00000000..54985cb9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/concatAST.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"concatAST.js","sourceRoot":"","sources":["../../src/utilities/concatAST.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAqB5C,MAAM,UAAU,SAAS,CACvB,SAAsC;IAEtC,MAAM,WAAW,GAA0B,EAAE,CAAC;IAC9C,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,WAAW,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["/** @category AST Utilities */\n\nimport type { DefinitionNode, DocumentNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Provided a collection of ASTs, presumably each from different files,\n * concatenate the ASTs together into batched AST, useful for validating many\n * GraphQL source files which together represent one conceptual application.\n * @param documents - Document ASTs to concatenate.\n * @returns A document AST containing all definitions from the provided documents.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { concatAST } from 'graphql/utilities';\n *\n * const document = concatAST([\n * parse('type Query { a: String }'),\n * parse('type User { id: ID }'),\n * ]);\n *\n * document.definitions.length; // => 2\n * ```\n */\nexport function concatAST(\n documents: ReadonlyArray,\n): DocumentNode {\n const definitions: Array = [];\n for (const doc of documents) {\n definitions.push(...doc.definitions);\n }\n return { kind: Kind.DOCUMENT, definitions };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.mts new file mode 100644 index 00000000..76c36f99 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.mts @@ -0,0 +1,84 @@ +/** @category Schema Construction */ +import type { DocumentNode } from "../language/ast.mjs"; +import type { GraphQLSchemaNormalizedConfig, GraphQLSchemaValidationOptions } from "../type/schema.mjs"; +import { GraphQLSchema } from "../type/schema.mjs"; +interface Options extends GraphQLSchemaValidationOptions { + /** + * Set to true to assume the SDL is valid. + * + * Default: false + * + * @internal + */ + assumeValidSDL?: boolean | undefined; +} +/** + * Produces a new schema given an existing schema and a document which may + * contain GraphQL type extensions and definitions. The original schema will + * remain unaltered. + * + * Because a schema represents a graph of references, a schema cannot be + * extended without effectively making an entire copy. We do not know until it's + * too late if subgraphs remain unchanged. + * + * This algorithm copies the provided schema, applying extensions while + * producing the copy. The original schema remains unaltered. + * @param schema - GraphQL schema to use. + * @param documentAST - The parsed GraphQL document AST. + * @param options - Optional configuration for this operation. + * @returns A new schema with the extensions and definitions applied. + * @example + * ```ts + * // Extend a schema with new fields and types. + * import { parse } from 'graphql/language'; + * import { buildSchema, extendSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const extensionAST = parse(` + * extend type Query { + * farewell: String + * } + * + * type Review { + * body: String + * } + * `); + * + * const extendedSchema = extendSchema(schema, extensionAST); + * + * schema.getType('Review'); // => undefined + * extendedSchema.getType('Review')?.name; // => 'Review' + * Object.keys(extendedSchema.getQueryType().getFields()); // => ['greeting', 'farewell'] + * ``` + * @example + * ```ts + * // This variant bypasses validation for an otherwise invalid extension. + * import { parse } from 'graphql/language'; + * import { buildSchema, extendSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const invalidExtension = parse(` + * extend type Missing { + * field: String + * } + * `); + * + * extendSchema(schema, invalidExtension); // throws an error + * extendSchema(schema, invalidExtension, { + * assumeValid: true, + * assumeValidSDL: true, + * }); // does not throw + * ``` + */ +export declare function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode, options?: Options): GraphQLSchema; +/** @internal */ +export declare function extendSchemaImpl(schemaConfig: GraphQLSchemaNormalizedConfig, documentAST: DocumentNode, options?: Options): GraphQLSchemaNormalizedConfig; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.ts new file mode 100644 index 00000000..16f7a012 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.d.ts @@ -0,0 +1,84 @@ +/** @category Schema Construction */ +import type { DocumentNode } from "../language/ast.js"; +import type { GraphQLSchemaNormalizedConfig, GraphQLSchemaValidationOptions } from "../type/schema.js"; +import { GraphQLSchema } from "../type/schema.js"; +interface Options extends GraphQLSchemaValidationOptions { + /** + * Set to true to assume the SDL is valid. + * + * Default: false + * + * @internal + */ + assumeValidSDL?: boolean | undefined; +} +/** + * Produces a new schema given an existing schema and a document which may + * contain GraphQL type extensions and definitions. The original schema will + * remain unaltered. + * + * Because a schema represents a graph of references, a schema cannot be + * extended without effectively making an entire copy. We do not know until it's + * too late if subgraphs remain unchanged. + * + * This algorithm copies the provided schema, applying extensions while + * producing the copy. The original schema remains unaltered. + * @param schema - GraphQL schema to use. + * @param documentAST - The parsed GraphQL document AST. + * @param options - Optional configuration for this operation. + * @returns A new schema with the extensions and definitions applied. + * @example + * ```ts + * // Extend a schema with new fields and types. + * import { parse } from 'graphql/language'; + * import { buildSchema, extendSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const extensionAST = parse(` + * extend type Query { + * farewell: String + * } + * + * type Review { + * body: String + * } + * `); + * + * const extendedSchema = extendSchema(schema, extensionAST); + * + * schema.getType('Review'); // => undefined + * extendedSchema.getType('Review')?.name; // => 'Review' + * Object.keys(extendedSchema.getQueryType().getFields()); // => ['greeting', 'farewell'] + * ``` + * @example + * ```ts + * // This variant bypasses validation for an otherwise invalid extension. + * import { parse } from 'graphql/language'; + * import { buildSchema, extendSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const invalidExtension = parse(` + * extend type Missing { + * field: String + * } + * `); + * + * extendSchema(schema, invalidExtension); // throws an error + * extendSchema(schema, invalidExtension, { + * assumeValid: true, + * assumeValidSDL: true, + * }); // does not throw + * ``` + */ +export declare function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode, options?: Options): GraphQLSchema; +/** @internal */ +export declare function extendSchemaImpl(schemaConfig: GraphQLSchemaNormalizedConfig, documentAST: DocumentNode, options?: Options): GraphQLSchemaNormalizedConfig; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js new file mode 100644 index 00000000..1df9d88d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js @@ -0,0 +1,413 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendSchema = extendSchema; +exports.extendSchemaImpl = extendSchemaImpl; +const AccumulatorMap_ts_1 = require("../jsutils/AccumulatorMap.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +const directives_ts_1 = require("../type/directives.js"); +const introspection_ts_1 = require("../type/introspection.js"); +const scalars_ts_1 = require("../type/scalars.js"); +const schema_ts_1 = require("../type/schema.js"); +const validate_ts_1 = require("../validation/validate.js"); +const values_ts_1 = require("../execution/values.js"); +const mapSchemaConfig_ts_1 = require("./mapSchemaConfig.js"); +function extendSchema(schema, documentAST, options) { + (0, schema_ts_1.assertSchema)(schema); + if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { + (0, validate_ts_1.assertValidSDLExtension)(documentAST, schema); + } + const schemaConfig = schema.toConfig(); + const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); + return schemaConfig === extendedConfig + ? schema + : new schema_ts_1.GraphQLSchema(extendedConfig); +} +function extendSchemaImpl(schemaConfig, documentAST, options) { + const typeDefs = []; + const scalarExtensions = new AccumulatorMap_ts_1.AccumulatorMap(); + const objectExtensions = new AccumulatorMap_ts_1.AccumulatorMap(); + const interfaceExtensions = new AccumulatorMap_ts_1.AccumulatorMap(); + const unionExtensions = new AccumulatorMap_ts_1.AccumulatorMap(); + const enumExtensions = new AccumulatorMap_ts_1.AccumulatorMap(); + const inputObjectExtensions = new AccumulatorMap_ts_1.AccumulatorMap(); + const directiveExtensions = new AccumulatorMap_ts_1.AccumulatorMap(); + const directiveDefs = []; + let schemaDef; + const schemaExtensions = []; + let isSchemaChanged = false; + for (const def of documentAST.definitions) { + switch (def.kind) { + case kinds_ts_1.Kind.SCHEMA_DEFINITION: + schemaDef = def; + break; + case kinds_ts_1.Kind.SCHEMA_EXTENSION: + schemaExtensions.push(def); + break; + case kinds_ts_1.Kind.DIRECTIVE_DEFINITION: + directiveDefs.push(def); + break; + case kinds_ts_1.Kind.DIRECTIVE_EXTENSION: + directiveExtensions.add(def.name.value, def); + break; + case kinds_ts_1.Kind.SCALAR_TYPE_DEFINITION: + case kinds_ts_1.Kind.OBJECT_TYPE_DEFINITION: + case kinds_ts_1.Kind.INTERFACE_TYPE_DEFINITION: + case kinds_ts_1.Kind.UNION_TYPE_DEFINITION: + case kinds_ts_1.Kind.ENUM_TYPE_DEFINITION: + case kinds_ts_1.Kind.INPUT_OBJECT_TYPE_DEFINITION: + typeDefs.push(def); + break; + case kinds_ts_1.Kind.SCALAR_TYPE_EXTENSION: + scalarExtensions.add(def.name.value, def); + break; + case kinds_ts_1.Kind.OBJECT_TYPE_EXTENSION: + objectExtensions.add(def.name.value, def); + break; + case kinds_ts_1.Kind.INTERFACE_TYPE_EXTENSION: + interfaceExtensions.add(def.name.value, def); + break; + case kinds_ts_1.Kind.UNION_TYPE_EXTENSION: + unionExtensions.add(def.name.value, def); + break; + case kinds_ts_1.Kind.ENUM_TYPE_EXTENSION: + enumExtensions.add(def.name.value, def); + break; + case kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION: + inputObjectExtensions.add(def.name.value, def); + break; + default: + continue; + } + isSchemaChanged = true; + } + if (!isSchemaChanged) { + return schemaConfig; + } + return (0, mapSchemaConfig_ts_1.mapSchemaConfig)(schemaConfig, (context) => { + const { getNamedType, setNamedType, getNamedTypes } = context; + return { + [mapSchemaConfig_ts_1.SchemaElementKind.SCHEMA]: (config) => { + for (const typeNode of typeDefs) { + const type = stdTypeMap.get(typeNode.name.value) ?? buildNamedType(typeNode); + setNamedType(type); + } + const operationTypes = { + query: config.query && + getNamedType(config.query.name), + mutation: config.mutation && + getNamedType(config.mutation.name), + subscription: config.subscription && + getNamedType(config.subscription.name), + ...(schemaDef && getOperationTypes([schemaDef])), + ...getOperationTypes(schemaExtensions), + }; + return { + description: schemaDef?.description?.value ?? config.description, + ...operationTypes, + types: getNamedTypes(), + directives: [ + ...config.directives.map(extendDirective), + ...directiveDefs.map(buildDirective), + ], + extensions: config.extensions, + astNode: schemaDef ?? config.astNode, + extensionASTNodes: config.extensionASTNodes.concat(schemaExtensions), + assumeValid: options?.assumeValid ?? false, + }; + }, + [mapSchemaConfig_ts_1.SchemaElementKind.INPUT_OBJECT]: (config) => { + const extensions = inputObjectExtensions.get(config.name) ?? []; + return { + ...config, + fields: () => ({ + ...config.fields(), + ...buildInputFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [mapSchemaConfig_ts_1.SchemaElementKind.ENUM]: (config) => { + const extensions = enumExtensions.get(config.name) ?? []; + return { + ...config, + values: () => ({ + ...config.values(), + ...buildEnumValueMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [mapSchemaConfig_ts_1.SchemaElementKind.SCALAR]: (config) => { + const extensions = scalarExtensions.get(config.name) ?? []; + let specifiedByURL = config.specifiedByURL; + for (const extensionNode of extensions) { + specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL; + } + return { + ...config, + specifiedByURL, + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [mapSchemaConfig_ts_1.SchemaElementKind.OBJECT]: (config) => { + const extensions = objectExtensions.get(config.name) ?? []; + return { + ...config, + interfaces: () => [ + ...config.interfaces(), + ...buildInterfaces(extensions), + ], + fields: () => ({ + ...config.fields(), + ...buildFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [mapSchemaConfig_ts_1.SchemaElementKind.INTERFACE]: (config) => { + const extensions = interfaceExtensions.get(config.name) ?? []; + return { + ...config, + interfaces: () => [ + ...config.interfaces(), + ...buildInterfaces(extensions), + ], + fields: () => ({ + ...config.fields(), + ...buildFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [mapSchemaConfig_ts_1.SchemaElementKind.UNION]: (config) => { + const extensions = unionExtensions.get(config.name) ?? []; + return { + ...config, + types: () => [...config.types(), ...buildUnionTypes(extensions)], + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + }; + function getOperationTypes(nodes) { + const opTypes = {}; + for (const node of nodes) { + const operationTypesNodes = node.operationTypes ?? []; + for (const operationType of operationTypesNodes) { + opTypes[operationType.operation] = namedTypeFromAST(operationType.type); + } + } + return opTypes; + } + function namedTypeFromAST(node) { + const name = node.name.value; + const type = getNamedType(name); + if (!(type !== undefined)) + (0, invariant_ts_1.invariant)(false, `Unknown type: "${name}".`); + return type; + } + function typeFromAST(node) { + if (node.kind === kinds_ts_1.Kind.LIST_TYPE) { + return new definition_ts_1.GraphQLList(typeFromAST(node.type)); + } + if (node.kind === kinds_ts_1.Kind.NON_NULL_TYPE) { + return new definition_ts_1.GraphQLNonNull(typeFromAST(node.type)); + } + return namedTypeFromAST(node); + } + function buildDirective(node) { + const extensionASTNodes = directiveExtensions.get(node.name.value) ?? []; + const deprecationReason = getDeprecationReason(node) ?? + extensionASTNodes + .map((extensionNode) => getDeprecationReason(extensionNode)) + .find((reason) => reason != null); + return new directives_ts_1.GraphQLDirective({ + name: node.name.value, + description: node.description?.value, + locations: node.locations.map(({ value }) => value), + isRepeatable: node.repeatable, + args: buildArgumentMap(node.arguments), + deprecationReason, + astNode: node, + extensionASTNodes, + }); + } + function extendDirective(directive) { + const extensionASTNodes = directiveExtensions.get(directive.name) ?? []; + if (extensionASTNodes.length === 0) { + return directive; + } + const deprecationReason = directive.deprecationReason ?? + extensionASTNodes + .map((extensionNode) => getDeprecationReason(extensionNode)) + .find((reason) => reason != null); + return new directives_ts_1.GraphQLDirective({ + ...directive.toConfig(), + deprecationReason, + extensionASTNodes: directive.extensionASTNodes.concat(extensionASTNodes), + }); + } + function buildFieldMap(nodes) { + const fieldConfigMap = Object.create(null); + for (const node of nodes) { + const nodeFields = node.fields ?? []; + for (const field of nodeFields) { + fieldConfigMap[field.name.value] = { + type: typeFromAST(field.type), + description: field.description?.value, + args: buildArgumentMap(field.arguments), + deprecationReason: getDeprecationReason(field), + astNode: field, + }; + } + } + return fieldConfigMap; + } + function buildArgumentMap(args) { + const argsNodes = args ?? []; + const argConfigMap = Object.create(null); + for (const arg of argsNodes) { + const type = typeFromAST(arg.type); + argConfigMap[arg.name.value] = { + type, + description: arg.description?.value, + default: arg.defaultValue && { literal: arg.defaultValue }, + deprecationReason: getDeprecationReason(arg), + astNode: arg, + }; + } + return argConfigMap; + } + function buildInputFieldMap(nodes) { + const inputFieldMap = Object.create(null); + for (const node of nodes) { + const fieldsNodes = node.fields ?? []; + for (const field of fieldsNodes) { + const type = typeFromAST(field.type); + inputFieldMap[field.name.value] = { + type, + description: field.description?.value, + default: field.defaultValue && { literal: field.defaultValue }, + deprecationReason: getDeprecationReason(field), + astNode: field, + }; + } + } + return inputFieldMap; + } + function buildEnumValueMap(nodes) { + const enumValueMap = Object.create(null); + for (const node of nodes) { + const valuesNodes = node.values ?? []; + for (const value of valuesNodes) { + enumValueMap[value.name.value] = { + description: value.description?.value, + deprecationReason: getDeprecationReason(value), + astNode: value, + }; + } + } + return enumValueMap; + } + function buildInterfaces(nodes) { + return nodes.flatMap((node) => node.interfaces?.map(namedTypeFromAST) ?? []); + } + function buildUnionTypes(nodes) { + return nodes.flatMap((node) => node.types?.map(namedTypeFromAST) ?? []); + } + function buildNamedType(astNode) { + const name = astNode.name.value; + switch (astNode.kind) { + case kinds_ts_1.Kind.OBJECT_TYPE_DEFINITION: { + const extensionASTNodes = objectExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new definition_ts_1.GraphQLObjectType({ + name, + description: astNode.description?.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case kinds_ts_1.Kind.INTERFACE_TYPE_DEFINITION: { + const extensionASTNodes = interfaceExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new definition_ts_1.GraphQLInterfaceType({ + name, + description: astNode.description?.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case kinds_ts_1.Kind.ENUM_TYPE_DEFINITION: { + const extensionASTNodes = enumExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new definition_ts_1.GraphQLEnumType({ + name, + description: astNode.description?.value, + values: () => buildEnumValueMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case kinds_ts_1.Kind.UNION_TYPE_DEFINITION: { + const extensionASTNodes = unionExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new definition_ts_1.GraphQLUnionType({ + name, + description: astNode.description?.value, + types: () => buildUnionTypes(allNodes), + astNode, + extensionASTNodes, + }); + } + case kinds_ts_1.Kind.SCALAR_TYPE_DEFINITION: { + const extensionASTNodes = scalarExtensions.get(name) ?? []; + let specifiedByURL = getSpecifiedByURL(astNode); + for (const extensionNode of extensionASTNodes) { + specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL; + } + return new definition_ts_1.GraphQLScalarType({ + name, + description: astNode.description?.value, + specifiedByURL, + astNode, + extensionASTNodes, + }); + } + case kinds_ts_1.Kind.INPUT_OBJECT_TYPE_DEFINITION: { + const extensionASTNodes = inputObjectExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new definition_ts_1.GraphQLInputObjectType({ + name, + description: astNode.description?.value, + fields: () => buildInputFieldMap(allNodes), + astNode, + extensionASTNodes, + isOneOf: isOneOf(astNode), + }); + } + } + } + }); +} +const stdTypeMap = new Map([...scalars_ts_1.specifiedScalarTypes, ...introspection_ts_1.introspectionTypes].map((type) => [ + type.name, + type, +])); +function getDeprecationReason(node) { + const deprecated = (0, values_ts_1.getDirectiveValues)(directives_ts_1.GraphQLDeprecatedDirective, node); + return deprecated?.reason; +} +function getSpecifiedByURL(node) { + const specifiedBy = (0, values_ts_1.getDirectiveValues)(directives_ts_1.GraphQLSpecifiedByDirective, node); + return specifiedBy?.url; +} +function isOneOf(node) { + return Boolean((0, values_ts_1.getDirectiveValues)(directives_ts_1.GraphQLOneOfDirective, node)); +} +//# sourceMappingURL=extendSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js.map new file mode 100644 index 00000000..8e9e69b7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"extendSchema.js","sourceRoot":"","sources":["../../src/utilities/extendSchema.ts"],"names":[],"mappings":";;AAqJA,oCAgBC;AAGD,4CAsfC;AA5pBD,oEAA8D;AAC9D,0DAAoD;AA4BpD,mDAA4C;AAW5C,yDAS+B;AAC/B,yDAK+B;AAC/B,+DAA8D;AAC9D,mDAA0D;AAK1D,iDAAgE;AAEhE,2DAAoE;AAEpE,sDAA4D;AAE5D,6DAA0E;AA+E1E,SAAgB,YAAY,CAC1B,MAAqB,EACrB,WAAyB,EACzB,OAAiB;IAEjB,IAAA,wBAAY,EAAC,MAAM,CAAC,CAAC;IAErB,IAAI,OAAO,EAAE,WAAW,KAAK,IAAI,IAAI,OAAO,EAAE,cAAc,KAAK,IAAI,EAAE,CAAC;QACtE,IAAA,qCAAuB,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IACvC,MAAM,cAAc,GAAG,gBAAgB,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5E,OAAO,YAAY,KAAK,cAAc;QACpC,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,IAAI,yBAAa,CAAC,cAAc,CAAC,CAAC;AACxC,CAAC;AAGD,SAAgB,gBAAgB,CAC9B,YAA2C,EAC3C,WAAyB,EACzB,OAAiB;IAGjB,MAAM,QAAQ,GAA8B,EAAE,CAAC;IAE/C,MAAM,gBAAgB,GAAG,IAAI,kCAAc,EAGxC,CAAC;IACJ,MA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,EAAE,CAAC;IAC7D,IAAI,CAAC,IAAI;IACT,IAAI;CACL,CAAC,CACH,CAAC;AAQF,SAAS,oBAAoB,CAC3B,IAK0B;IAE1B,MAAM,UAAU,GAAG,IAAA,8BAAkB,EAAC,0CAA0B,EAAE,IAAI,CAAC,CAAC;IAExE,OAAO,UAAU,EAAE,MAAM,CAAC;AAC5B,CAAC;AAOD,SAAS,iBAAiB,CACxB,IAAwD;IAExD,MAAM,WAAW,GAAG,IAAA,8BAAkB,EAAC,2CAA2B,EAAE,IAAI,CAAC,CAAC;IAE1E,OAAO,WAAW,EAAE,GAAG,CAAC;AAC1B,CAAC;AAOD,SAAS,OAAO,CAAC,IAAmC;IAClD,OAAO,OAAO,CAAC,IAAA,8BAAkB,EAAC,qCAAqB,EAAE,IAAI,CAAC,CAAC,CAAC;AAClE,CAAC","sourcesContent":["/** @category Schema Construction */\n\nimport { AccumulatorMap } from '../jsutils/AccumulatorMap.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n DirectiveDefinitionNode,\n DirectiveExtensionNode,\n DocumentNode,\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n EnumValueDefinitionNode,\n FieldDefinitionNode,\n InputObjectTypeDefinitionNode,\n InputObjectTypeExtensionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n NamedTypeNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n ScalarTypeDefinitionNode,\n ScalarTypeExtensionNode,\n SchemaDefinitionNode,\n SchemaExtensionNode,\n TypeDefinitionNode,\n TypeNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type {\n GraphQLEnumValueNormalizedConfigMap,\n GraphQLFieldConfigArgumentMap,\n GraphQLFieldNormalizedConfigMap,\n GraphQLInputFieldNormalizedConfigMap,\n GraphQLNamedType,\n GraphQLNullableType,\n GraphQLType,\n} from '../type/definition.ts';\nimport {\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n} from '../type/definition.ts';\nimport {\n GraphQLDeprecatedDirective,\n GraphQLDirective,\n GraphQLOneOfDirective,\n GraphQLSpecifiedByDirective,\n} from '../type/directives.ts';\nimport { introspectionTypes } from '../type/introspection.ts';\nimport { specifiedScalarTypes } from '../type/scalars.ts';\nimport type {\n GraphQLSchemaNormalizedConfig,\n GraphQLSchemaValidationOptions,\n} from '../type/schema.ts';\nimport { assertSchema, GraphQLSchema } from '../type/schema.ts';\n\nimport { assertValidSDLExtension } from '../validation/validate.ts';\n\nimport { getDirectiveValues } from '../execution/values.ts';\n\nimport { mapSchemaConfig, SchemaElementKind } from './mapSchemaConfig.ts';\n\ninterface Options extends GraphQLSchemaValidationOptions {\n /**\n * Set to true to assume the SDL is valid.\n *\n * Default: false\n *\n * @internal\n */\n assumeValidSDL?: boolean | undefined;\n}\n\n/**\n * Produces a new schema given an existing schema and a document which may\n * contain GraphQL type extensions and definitions. The original schema will\n * remain unaltered.\n *\n * Because a schema represents a graph of references, a schema cannot be\n * extended without effectively making an entire copy. We do not know until it's\n * too late if subgraphs remain unchanged.\n *\n * This algorithm copies the provided schema, applying extensions while\n * producing the copy. The original schema remains unaltered.\n * @param schema - GraphQL schema to use.\n * @param documentAST - The parsed GraphQL document AST.\n * @param options - Optional configuration for this operation.\n * @returns A new schema with the extensions and definitions applied.\n * @example\n * ```ts\n * // Extend a schema with new fields and types.\n * import { parse } from 'graphql/language';\n * import { buildSchema, extendSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const extensionAST = parse(`\n * extend type Query {\n * farewell: String\n * }\n *\n * type Review {\n * body: String\n * }\n * `);\n *\n * const extendedSchema = extendSchema(schema, extensionAST);\n *\n * schema.getType('Review'); // => undefined\n * extendedSchema.getType('Review')?.name; // => 'Review'\n * Object.keys(extendedSchema.getQueryType().getFields()); // => ['greeting', 'farewell']\n * ```\n * @example\n * ```ts\n * // This variant bypasses validation for an otherwise invalid extension.\n * import { parse } from 'graphql/language';\n * import { buildSchema, extendSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const invalidExtension = parse(`\n * extend type Missing {\n * field: String\n * }\n * `);\n *\n * extendSchema(schema, invalidExtension); // throws an error\n * extendSchema(schema, invalidExtension, {\n * assumeValid: true,\n * assumeValidSDL: true,\n * }); // does not throw\n * ```\n */\nexport function extendSchema(\n schema: GraphQLSchema,\n documentAST: DocumentNode,\n options?: Options,\n): GraphQLSchema {\n assertSchema(schema);\n\n if (options?.assumeValid !== true && options?.assumeValidSDL !== true) {\n assertValidSDLExtension(documentAST, schema);\n }\n\n const schemaConfig = schema.toConfig();\n const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options);\n return schemaConfig === extendedConfig\n ? schema\n : new GraphQLSchema(extendedConfig);\n}\n\n/** @internal */\nexport function extendSchemaImpl(\n schemaConfig: GraphQLSchemaNormalizedConfig,\n documentAST: DocumentNode,\n options?: Options,\n): GraphQLSchemaNormalizedConfig {\n // Collect the type definitions and extensions found in the document.\n const typeDefs: Array = [];\n\n const scalarExtensions = new AccumulatorMap<\n string,\n ScalarTypeExtensionNode\n >();\n const objectExtensions = new AccumulatorMap<\n string,\n ObjectTypeExtensionNode\n >();\n const interfaceExtensions = new AccumulatorMap<\n string,\n InterfaceTypeExtensionNode\n >();\n const unionExtensions = new AccumulatorMap();\n const enumExtensions = new AccumulatorMap();\n const inputObjectExtensions = new AccumulatorMap<\n string,\n InputObjectTypeExtensionNode\n >();\n const directiveExtensions = new AccumulatorMap<\n string,\n DirectiveExtensionNode\n >();\n\n // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n const directiveDefs: Array = [];\n\n let schemaDef: Maybe;\n // Schema extensions are collected which may add additional operation types.\n const schemaExtensions: Array = [];\n\n let isSchemaChanged = false;\n for (const def of documentAST.definitions) {\n switch (def.kind) {\n case Kind.SCHEMA_DEFINITION:\n schemaDef = def;\n break;\n case Kind.SCHEMA_EXTENSION:\n schemaExtensions.push(def);\n break;\n case Kind.DIRECTIVE_DEFINITION:\n directiveDefs.push(def);\n break;\n case Kind.DIRECTIVE_EXTENSION:\n directiveExtensions.add(def.name.value, def);\n break;\n\n // Type Definitions\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n typeDefs.push(def);\n break;\n\n // Type System Extensions\n case Kind.SCALAR_TYPE_EXTENSION:\n scalarExtensions.add(def.name.value, def);\n break;\n case Kind.OBJECT_TYPE_EXTENSION:\n objectExtensions.add(def.name.value, def);\n break;\n case Kind.INTERFACE_TYPE_EXTENSION:\n interfaceExtensions.add(def.name.value, def);\n break;\n case Kind.UNION_TYPE_EXTENSION:\n unionExtensions.add(def.name.value, def);\n break;\n case Kind.ENUM_TYPE_EXTENSION:\n enumExtensions.add(def.name.value, def);\n break;\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n inputObjectExtensions.add(def.name.value, def);\n break;\n default:\n continue;\n }\n isSchemaChanged = true;\n }\n\n // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n if (!isSchemaChanged) {\n return schemaConfig;\n }\n\n return mapSchemaConfig(schemaConfig, (context) => {\n const { getNamedType, setNamedType, getNamedTypes } = context;\n return {\n [SchemaElementKind.SCHEMA]: (config) => {\n for (const typeNode of typeDefs) {\n const type =\n stdTypeMap.get(typeNode.name.value) ?? buildNamedType(typeNode);\n setNamedType(type);\n }\n\n const operationTypes = {\n // Get the extended root operation types.\n query:\n config.query &&\n (getNamedType(config.query.name) as GraphQLObjectType),\n mutation:\n config.mutation &&\n (getNamedType(config.mutation.name) as GraphQLObjectType),\n subscription:\n config.subscription &&\n (getNamedType(config.subscription.name) as GraphQLObjectType),\n // Then, incorporate schema definition and all schema extensions.\n ...(schemaDef && getOperationTypes([schemaDef])),\n ...getOperationTypes(schemaExtensions),\n };\n\n // Then produce and return a Schema config with these types.\n return {\n description: schemaDef?.description?.value ?? config.description,\n ...operationTypes,\n types: getNamedTypes(),\n directives: [\n ...config.directives.map(extendDirective),\n ...directiveDefs.map(buildDirective),\n ],\n extensions: config.extensions,\n astNode: schemaDef ?? config.astNode,\n extensionASTNodes: config.extensionASTNodes.concat(schemaExtensions),\n assumeValid: options?.assumeValid ?? false,\n };\n },\n [SchemaElementKind.INPUT_OBJECT]: (config) => {\n const extensions = inputObjectExtensions.get(config.name) ?? [];\n return {\n ...config,\n fields: () => ({\n ...config.fields(),\n ...buildInputFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.ENUM]: (config) => {\n const extensions = enumExtensions.get(config.name) ?? [];\n return {\n ...config,\n values: () => ({\n ...config.values(),\n ...buildEnumValueMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.SCALAR]: (config) => {\n const extensions = scalarExtensions.get(config.name) ?? [];\n let specifiedByURL = config.specifiedByURL;\n for (const extensionNode of extensions) {\n specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL;\n }\n return {\n ...config,\n specifiedByURL,\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.OBJECT]: (config) => {\n const extensions = objectExtensions.get(config.name) ?? [];\n return {\n ...config,\n interfaces: () => [\n ...config.interfaces(),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...config.fields(),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.INTERFACE]: (config) => {\n const extensions = interfaceExtensions.get(config.name) ?? [];\n return {\n ...config,\n interfaces: () => [\n ...config.interfaces(),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...config.fields(),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.UNION]: (config) => {\n const extensions = unionExtensions.get(config.name) ?? [];\n return {\n ...config,\n types: () => [...config.types(), ...buildUnionTypes(extensions)],\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n };\n\n function getOperationTypes(\n nodes: ReadonlyArray,\n ): {\n query?: Maybe;\n mutation?: Maybe;\n subscription?: Maybe;\n } {\n const opTypes = {};\n for (const node of nodes) {\n const operationTypesNodes = node.operationTypes ?? [];\n\n for (const operationType of operationTypesNodes) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n opTypes[operationType.operation] = namedTypeFromAST(\n operationType.type,\n );\n }\n }\n\n return opTypes;\n }\n\n function namedTypeFromAST(node: NamedTypeNode): GraphQLNamedType {\n const name = node.name.value;\n const type = getNamedType(name);\n invariant(type !== undefined, `Unknown type: \"${name}\".`);\n return type;\n }\n\n function typeFromAST(node: TypeNode): GraphQLType {\n if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(typeFromAST(node.type));\n }\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(\n typeFromAST(node.type) as GraphQLNullableType,\n );\n }\n return namedTypeFromAST(node);\n }\n\n function buildDirective(node: DirectiveDefinitionNode): GraphQLDirective {\n const extensionASTNodes = directiveExtensions.get(node.name.value) ?? [];\n const deprecationReason =\n getDeprecationReason(node) ??\n extensionASTNodes\n .map((extensionNode) => getDeprecationReason(extensionNode))\n .find((reason) => reason != null);\n\n return new GraphQLDirective({\n name: node.name.value,\n description: node.description?.value,\n // @ts-expect-error\n locations: node.locations.map(({ value }) => value),\n isRepeatable: node.repeatable,\n args: buildArgumentMap(node.arguments),\n deprecationReason,\n astNode: node,\n extensionASTNodes,\n });\n }\n\n function extendDirective(directive: GraphQLDirective): GraphQLDirective {\n const extensionASTNodes = directiveExtensions.get(directive.name) ?? [];\n if (extensionASTNodes.length === 0) {\n return directive;\n }\n const deprecationReason =\n directive.deprecationReason ??\n extensionASTNodes\n .map((extensionNode) => getDeprecationReason(extensionNode))\n .find((reason) => reason != null);\n\n return new GraphQLDirective({\n ...directive.toConfig(),\n deprecationReason,\n extensionASTNodes:\n directive.extensionASTNodes.concat(extensionASTNodes),\n });\n }\n\n function buildFieldMap(\n nodes: ReadonlyArray<\n | InterfaceTypeDefinitionNode\n | InterfaceTypeExtensionNode\n | ObjectTypeDefinitionNode\n | ObjectTypeExtensionNode\n >,\n ): GraphQLFieldNormalizedConfigMap {\n const fieldConfigMap = Object.create(null);\n for (const node of nodes) {\n const nodeFields = node.fields ?? [];\n\n for (const field of nodeFields) {\n fieldConfigMap[field.name.value] = {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n type: typeFromAST(field.type),\n description: field.description?.value,\n args: buildArgumentMap(field.arguments),\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n return fieldConfigMap;\n }\n\n function buildArgumentMap(\n args: Maybe>,\n ): GraphQLFieldConfigArgumentMap {\n const argsNodes = args ?? [];\n\n const argConfigMap = Object.create(null);\n for (const arg of argsNodes) {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type: any = typeFromAST(arg.type);\n\n argConfigMap[arg.name.value] = {\n type,\n description: arg.description?.value,\n default: arg.defaultValue && { literal: arg.defaultValue },\n deprecationReason: getDeprecationReason(arg),\n astNode: arg,\n };\n }\n return argConfigMap;\n }\n\n function buildInputFieldMap(\n nodes: ReadonlyArray<\n InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode\n >,\n ): GraphQLInputFieldNormalizedConfigMap {\n const inputFieldMap = Object.create(null);\n for (const node of nodes) {\n const fieldsNodes = node.fields ?? [];\n\n for (const field of fieldsNodes) {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type: any = typeFromAST(field.type);\n\n inputFieldMap[field.name.value] = {\n type,\n description: field.description?.value,\n default: field.defaultValue && { literal: field.defaultValue },\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n return inputFieldMap;\n }\n\n function buildEnumValueMap(\n nodes: ReadonlyArray,\n ): GraphQLEnumValueNormalizedConfigMap {\n const enumValueMap = Object.create(null);\n for (const node of nodes) {\n const valuesNodes = node.values ?? [];\n\n for (const value of valuesNodes) {\n enumValueMap[value.name.value] = {\n description: value.description?.value,\n deprecationReason: getDeprecationReason(value),\n astNode: value,\n };\n }\n }\n return enumValueMap;\n }\n\n function buildInterfaces(\n nodes: ReadonlyArray<\n | InterfaceTypeDefinitionNode\n | InterfaceTypeExtensionNode\n | ObjectTypeDefinitionNode\n | ObjectTypeExtensionNode\n >,\n ): Array {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap(\n (node) => node.interfaces?.map(namedTypeFromAST) ?? [],\n );\n }\n\n function buildUnionTypes(\n nodes: ReadonlyArray,\n ): Array {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap((node) => node.types?.map(namedTypeFromAST) ?? []);\n }\n\n function buildNamedType(astNode: TypeDefinitionNode): GraphQLNamedType {\n const name = astNode.name.value;\n\n switch (astNode.kind) {\n case Kind.OBJECT_TYPE_DEFINITION: {\n const extensionASTNodes = objectExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLObjectType({\n name,\n description: astNode.description?.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.INTERFACE_TYPE_DEFINITION: {\n const extensionASTNodes = interfaceExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLInterfaceType({\n name,\n description: astNode.description?.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.ENUM_TYPE_DEFINITION: {\n const extensionASTNodes = enumExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLEnumType({\n name,\n description: astNode.description?.value,\n values: () => buildEnumValueMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.UNION_TYPE_DEFINITION: {\n const extensionASTNodes = unionExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLUnionType({\n name,\n description: astNode.description?.value,\n types: () => buildUnionTypes(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.SCALAR_TYPE_DEFINITION: {\n const extensionASTNodes = scalarExtensions.get(name) ?? [];\n let specifiedByURL = getSpecifiedByURL(astNode);\n for (const extensionNode of extensionASTNodes) {\n specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL;\n }\n return new GraphQLScalarType({\n name,\n description: astNode.description?.value,\n specifiedByURL,\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.INPUT_OBJECT_TYPE_DEFINITION: {\n const extensionASTNodes = inputObjectExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLInputObjectType({\n name,\n description: astNode.description?.value,\n fields: () => buildInputFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n isOneOf: isOneOf(astNode),\n });\n }\n }\n }\n });\n}\n\nconst stdTypeMap = new Map(\n [...specifiedScalarTypes, ...introspectionTypes].map((type) => [\n type.name,\n type,\n ]),\n);\n\n/**\n * Given a field or enum value node, returns the string value for the\n * deprecation reason.\n *\n * @internal\n */\nfunction getDeprecationReason(\n node:\n | EnumValueDefinitionNode\n | FieldDefinitionNode\n | InputValueDefinitionNode\n | DirectiveDefinitionNode\n | DirectiveExtensionNode,\n): Maybe {\n const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);\n // @ts-expect-error validated by `getDirectiveValues`\n return deprecated?.reason;\n}\n\n/**\n * Given a scalar node, returns the string value for the specifiedByURL.\n *\n * @internal\n */\nfunction getSpecifiedByURL(\n node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode,\n): Maybe {\n const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node);\n // @ts-expect-error validated by `getDirectiveValues`\n return specifiedBy?.url;\n}\n\n/**\n * Given an input object node, returns if the node should be OneOf.\n *\n * @internal\n */\nfunction isOneOf(node: InputObjectTypeDefinitionNode): boolean {\n return Boolean(getDirectiveValues(GraphQLOneOfDirective, node));\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs new file mode 100644 index 00000000..f27f1f33 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs @@ -0,0 +1,409 @@ +import { AccumulatorMap } from "../jsutils/AccumulatorMap.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, } from "../type/definition.mjs"; +import { GraphQLDeprecatedDirective, GraphQLDirective, GraphQLOneOfDirective, GraphQLSpecifiedByDirective, } from "../type/directives.mjs"; +import { introspectionTypes } from "../type/introspection.mjs"; +import { specifiedScalarTypes } from "../type/scalars.mjs"; +import { assertSchema, GraphQLSchema } from "../type/schema.mjs"; +import { assertValidSDLExtension } from "../validation/validate.mjs"; +import { getDirectiveValues } from "../execution/values.mjs"; +import { mapSchemaConfig, SchemaElementKind } from "./mapSchemaConfig.mjs"; +export function extendSchema(schema, documentAST, options) { + assertSchema(schema); + if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { + assertValidSDLExtension(documentAST, schema); + } + const schemaConfig = schema.toConfig(); + const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); + return schemaConfig === extendedConfig + ? schema + : new GraphQLSchema(extendedConfig); +} +export function extendSchemaImpl(schemaConfig, documentAST, options) { + const typeDefs = []; + const scalarExtensions = new AccumulatorMap(); + const objectExtensions = new AccumulatorMap(); + const interfaceExtensions = new AccumulatorMap(); + const unionExtensions = new AccumulatorMap(); + const enumExtensions = new AccumulatorMap(); + const inputObjectExtensions = new AccumulatorMap(); + const directiveExtensions = new AccumulatorMap(); + const directiveDefs = []; + let schemaDef; + const schemaExtensions = []; + let isSchemaChanged = false; + for (const def of documentAST.definitions) { + switch (def.kind) { + case Kind.SCHEMA_DEFINITION: + schemaDef = def; + break; + case Kind.SCHEMA_EXTENSION: + schemaExtensions.push(def); + break; + case Kind.DIRECTIVE_DEFINITION: + directiveDefs.push(def); + break; + case Kind.DIRECTIVE_EXTENSION: + directiveExtensions.add(def.name.value, def); + break; + case Kind.SCALAR_TYPE_DEFINITION: + case Kind.OBJECT_TYPE_DEFINITION: + case Kind.INTERFACE_TYPE_DEFINITION: + case Kind.UNION_TYPE_DEFINITION: + case Kind.ENUM_TYPE_DEFINITION: + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + typeDefs.push(def); + break; + case Kind.SCALAR_TYPE_EXTENSION: + scalarExtensions.add(def.name.value, def); + break; + case Kind.OBJECT_TYPE_EXTENSION: + objectExtensions.add(def.name.value, def); + break; + case Kind.INTERFACE_TYPE_EXTENSION: + interfaceExtensions.add(def.name.value, def); + break; + case Kind.UNION_TYPE_EXTENSION: + unionExtensions.add(def.name.value, def); + break; + case Kind.ENUM_TYPE_EXTENSION: + enumExtensions.add(def.name.value, def); + break; + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + inputObjectExtensions.add(def.name.value, def); + break; + default: + continue; + } + isSchemaChanged = true; + } + if (!isSchemaChanged) { + return schemaConfig; + } + return mapSchemaConfig(schemaConfig, (context) => { + const { getNamedType, setNamedType, getNamedTypes } = context; + return { + [SchemaElementKind.SCHEMA]: (config) => { + for (const typeNode of typeDefs) { + const type = stdTypeMap.get(typeNode.name.value) ?? buildNamedType(typeNode); + setNamedType(type); + } + const operationTypes = { + query: config.query && + getNamedType(config.query.name), + mutation: config.mutation && + getNamedType(config.mutation.name), + subscription: config.subscription && + getNamedType(config.subscription.name), + ...(schemaDef && getOperationTypes([schemaDef])), + ...getOperationTypes(schemaExtensions), + }; + return { + description: schemaDef?.description?.value ?? config.description, + ...operationTypes, + types: getNamedTypes(), + directives: [ + ...config.directives.map(extendDirective), + ...directiveDefs.map(buildDirective), + ], + extensions: config.extensions, + astNode: schemaDef ?? config.astNode, + extensionASTNodes: config.extensionASTNodes.concat(schemaExtensions), + assumeValid: options?.assumeValid ?? false, + }; + }, + [SchemaElementKind.INPUT_OBJECT]: (config) => { + const extensions = inputObjectExtensions.get(config.name) ?? []; + return { + ...config, + fields: () => ({ + ...config.fields(), + ...buildInputFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [SchemaElementKind.ENUM]: (config) => { + const extensions = enumExtensions.get(config.name) ?? []; + return { + ...config, + values: () => ({ + ...config.values(), + ...buildEnumValueMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [SchemaElementKind.SCALAR]: (config) => { + const extensions = scalarExtensions.get(config.name) ?? []; + let specifiedByURL = config.specifiedByURL; + for (const extensionNode of extensions) { + specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL; + } + return { + ...config, + specifiedByURL, + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [SchemaElementKind.OBJECT]: (config) => { + const extensions = objectExtensions.get(config.name) ?? []; + return { + ...config, + interfaces: () => [ + ...config.interfaces(), + ...buildInterfaces(extensions), + ], + fields: () => ({ + ...config.fields(), + ...buildFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [SchemaElementKind.INTERFACE]: (config) => { + const extensions = interfaceExtensions.get(config.name) ?? []; + return { + ...config, + interfaces: () => [ + ...config.interfaces(), + ...buildInterfaces(extensions), + ], + fields: () => ({ + ...config.fields(), + ...buildFieldMap(extensions), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + [SchemaElementKind.UNION]: (config) => { + const extensions = unionExtensions.get(config.name) ?? []; + return { + ...config, + types: () => [...config.types(), ...buildUnionTypes(extensions)], + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }; + }, + }; + function getOperationTypes(nodes) { + const opTypes = {}; + for (const node of nodes) { + const operationTypesNodes = node.operationTypes ?? []; + for (const operationType of operationTypesNodes) { + opTypes[operationType.operation] = namedTypeFromAST(operationType.type); + } + } + return opTypes; + } + function namedTypeFromAST(node) { + const name = node.name.value; + const type = getNamedType(name); + if (!(type !== undefined)) + invariant(false, `Unknown type: "${name}".`); + return type; + } + function typeFromAST(node) { + if (node.kind === Kind.LIST_TYPE) { + return new GraphQLList(typeFromAST(node.type)); + } + if (node.kind === Kind.NON_NULL_TYPE) { + return new GraphQLNonNull(typeFromAST(node.type)); + } + return namedTypeFromAST(node); + } + function buildDirective(node) { + const extensionASTNodes = directiveExtensions.get(node.name.value) ?? []; + const deprecationReason = getDeprecationReason(node) ?? + extensionASTNodes + .map((extensionNode) => getDeprecationReason(extensionNode)) + .find((reason) => reason != null); + return new GraphQLDirective({ + name: node.name.value, + description: node.description?.value, + locations: node.locations.map(({ value }) => value), + isRepeatable: node.repeatable, + args: buildArgumentMap(node.arguments), + deprecationReason, + astNode: node, + extensionASTNodes, + }); + } + function extendDirective(directive) { + const extensionASTNodes = directiveExtensions.get(directive.name) ?? []; + if (extensionASTNodes.length === 0) { + return directive; + } + const deprecationReason = directive.deprecationReason ?? + extensionASTNodes + .map((extensionNode) => getDeprecationReason(extensionNode)) + .find((reason) => reason != null); + return new GraphQLDirective({ + ...directive.toConfig(), + deprecationReason, + extensionASTNodes: directive.extensionASTNodes.concat(extensionASTNodes), + }); + } + function buildFieldMap(nodes) { + const fieldConfigMap = Object.create(null); + for (const node of nodes) { + const nodeFields = node.fields ?? []; + for (const field of nodeFields) { + fieldConfigMap[field.name.value] = { + type: typeFromAST(field.type), + description: field.description?.value, + args: buildArgumentMap(field.arguments), + deprecationReason: getDeprecationReason(field), + astNode: field, + }; + } + } + return fieldConfigMap; + } + function buildArgumentMap(args) { + const argsNodes = args ?? []; + const argConfigMap = Object.create(null); + for (const arg of argsNodes) { + const type = typeFromAST(arg.type); + argConfigMap[arg.name.value] = { + type, + description: arg.description?.value, + default: arg.defaultValue && { literal: arg.defaultValue }, + deprecationReason: getDeprecationReason(arg), + astNode: arg, + }; + } + return argConfigMap; + } + function buildInputFieldMap(nodes) { + const inputFieldMap = Object.create(null); + for (const node of nodes) { + const fieldsNodes = node.fields ?? []; + for (const field of fieldsNodes) { + const type = typeFromAST(field.type); + inputFieldMap[field.name.value] = { + type, + description: field.description?.value, + default: field.defaultValue && { literal: field.defaultValue }, + deprecationReason: getDeprecationReason(field), + astNode: field, + }; + } + } + return inputFieldMap; + } + function buildEnumValueMap(nodes) { + const enumValueMap = Object.create(null); + for (const node of nodes) { + const valuesNodes = node.values ?? []; + for (const value of valuesNodes) { + enumValueMap[value.name.value] = { + description: value.description?.value, + deprecationReason: getDeprecationReason(value), + astNode: value, + }; + } + } + return enumValueMap; + } + function buildInterfaces(nodes) { + return nodes.flatMap((node) => node.interfaces?.map(namedTypeFromAST) ?? []); + } + function buildUnionTypes(nodes) { + return nodes.flatMap((node) => node.types?.map(namedTypeFromAST) ?? []); + } + function buildNamedType(astNode) { + const name = astNode.name.value; + switch (astNode.kind) { + case Kind.OBJECT_TYPE_DEFINITION: { + const extensionASTNodes = objectExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new GraphQLObjectType({ + name, + description: astNode.description?.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.INTERFACE_TYPE_DEFINITION: { + const extensionASTNodes = interfaceExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new GraphQLInterfaceType({ + name, + description: astNode.description?.value, + interfaces: () => buildInterfaces(allNodes), + fields: () => buildFieldMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.ENUM_TYPE_DEFINITION: { + const extensionASTNodes = enumExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new GraphQLEnumType({ + name, + description: astNode.description?.value, + values: () => buildEnumValueMap(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.UNION_TYPE_DEFINITION: { + const extensionASTNodes = unionExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new GraphQLUnionType({ + name, + description: astNode.description?.value, + types: () => buildUnionTypes(allNodes), + astNode, + extensionASTNodes, + }); + } + case Kind.SCALAR_TYPE_DEFINITION: { + const extensionASTNodes = scalarExtensions.get(name) ?? []; + let specifiedByURL = getSpecifiedByURL(astNode); + for (const extensionNode of extensionASTNodes) { + specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL; + } + return new GraphQLScalarType({ + name, + description: astNode.description?.value, + specifiedByURL, + astNode, + extensionASTNodes, + }); + } + case Kind.INPUT_OBJECT_TYPE_DEFINITION: { + const extensionASTNodes = inputObjectExtensions.get(name) ?? []; + const allNodes = [astNode, ...extensionASTNodes]; + return new GraphQLInputObjectType({ + name, + description: astNode.description?.value, + fields: () => buildInputFieldMap(allNodes), + astNode, + extensionASTNodes, + isOneOf: isOneOf(astNode), + }); + } + } + } + }); +} +const stdTypeMap = new Map([...specifiedScalarTypes, ...introspectionTypes].map((type) => [ + type.name, + type, +])); +function getDeprecationReason(node) { + const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); + return deprecated?.reason; +} +function getSpecifiedByURL(node) { + const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node); + return specifiedBy?.url; +} +function isOneOf(node) { + return Boolean(getDirectiveValues(GraphQLOneOfDirective, node)); +} +//# sourceMappingURL=extendSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs.map new file mode 100644 index 00000000..32afbd42 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/extendSchema.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"extendSchema.js","sourceRoot":"","sources":["../../src/utilities/extendSchema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAC9D,OAAO,EAAE,SAAS,EAAE,iCAAgC;AA4BpD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAW5C,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,+BAA8B;AAC/B,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,GAC5B,+BAA8B;AAC/B,OAAO,EAAE,kBAAkB,EAAE,kCAAiC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,4BAA2B;AAK1D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,2BAA0B;AAEhE,OAAO,EAAE,uBAAuB,EAAE,mCAAkC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,gCAA+B;AAE5D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,8BA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ap.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n DirectiveDefinitionNode,\n DirectiveExtensionNode,\n DocumentNode,\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n EnumValueDefinitionNode,\n FieldDefinitionNode,\n InputObjectTypeDefinitionNode,\n InputObjectTypeExtensionNode,\n InputValueDefinitionNode,\n InterfaceTypeDefinitionNode,\n InterfaceTypeExtensionNode,\n NamedTypeNode,\n ObjectTypeDefinitionNode,\n ObjectTypeExtensionNode,\n ScalarTypeDefinitionNode,\n ScalarTypeExtensionNode,\n SchemaDefinitionNode,\n SchemaExtensionNode,\n TypeDefinitionNode,\n TypeNode,\n UnionTypeDefinitionNode,\n UnionTypeExtensionNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type {\n GraphQLEnumValueNormalizedConfigMap,\n GraphQLFieldConfigArgumentMap,\n GraphQLFieldNormalizedConfigMap,\n GraphQLInputFieldNormalizedConfigMap,\n GraphQLNamedType,\n GraphQLNullableType,\n GraphQLType,\n} from '../type/definition.ts';\nimport {\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n} from '../type/definition.ts';\nimport {\n GraphQLDeprecatedDirective,\n GraphQLDirective,\n GraphQLOneOfDirective,\n GraphQLSpecifiedByDirective,\n} from '../type/directives.ts';\nimport { introspectionTypes } from '../type/introspection.ts';\nimport { specifiedScalarTypes } from '../type/scalars.ts';\nimport type {\n GraphQLSchemaNormalizedConfig,\n GraphQLSchemaValidationOptions,\n} from '../type/schema.ts';\nimport { assertSchema, GraphQLSchema } from '../type/schema.ts';\n\nimport { assertValidSDLExtension } from '../validation/validate.ts';\n\nimport { getDirectiveValues } from '../execution/values.ts';\n\nimport { mapSchemaConfig, SchemaElementKind } from './mapSchemaConfig.ts';\n\ninterface Options extends GraphQLSchemaValidationOptions {\n /**\n * Set to true to assume the SDL is valid.\n *\n * Default: false\n *\n * @internal\n */\n assumeValidSDL?: boolean | undefined;\n}\n\n/**\n * Produces a new schema given an existing schema and a document which may\n * contain GraphQL type extensions and definitions. The original schema will\n * remain unaltered.\n *\n * Because a schema represents a graph of references, a schema cannot be\n * extended without effectively making an entire copy. We do not know until it's\n * too late if subgraphs remain unchanged.\n *\n * This algorithm copies the provided schema, applying extensions while\n * producing the copy. The original schema remains unaltered.\n * @param schema - GraphQL schema to use.\n * @param documentAST - The parsed GraphQL document AST.\n * @param options - Optional configuration for this operation.\n * @returns A new schema with the extensions and definitions applied.\n * @example\n * ```ts\n * // Extend a schema with new fields and types.\n * import { parse } from 'graphql/language';\n * import { buildSchema, extendSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const extensionAST = parse(`\n * extend type Query {\n * farewell: String\n * }\n *\n * type Review {\n * body: String\n * }\n * `);\n *\n * const extendedSchema = extendSchema(schema, extensionAST);\n *\n * schema.getType('Review'); // => undefined\n * extendedSchema.getType('Review')?.name; // => 'Review'\n * Object.keys(extendedSchema.getQueryType().getFields()); // => ['greeting', 'farewell']\n * ```\n * @example\n * ```ts\n * // This variant bypasses validation for an otherwise invalid extension.\n * import { parse } from 'graphql/language';\n * import { buildSchema, extendSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const invalidExtension = parse(`\n * extend type Missing {\n * field: String\n * }\n * `);\n *\n * extendSchema(schema, invalidExtension); // throws an error\n * extendSchema(schema, invalidExtension, {\n * assumeValid: true,\n * assumeValidSDL: true,\n * }); // does not throw\n * ```\n */\nexport function extendSchema(\n schema: GraphQLSchema,\n documentAST: DocumentNode,\n options?: Options,\n): GraphQLSchema {\n assertSchema(schema);\n\n if (options?.assumeValid !== true && options?.assumeValidSDL !== true) {\n assertValidSDLExtension(documentAST, schema);\n }\n\n const schemaConfig = schema.toConfig();\n const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options);\n return schemaConfig === extendedConfig\n ? schema\n : new GraphQLSchema(extendedConfig);\n}\n\n/** @internal */\nexport function extendSchemaImpl(\n schemaConfig: GraphQLSchemaNormalizedConfig,\n documentAST: DocumentNode,\n options?: Options,\n): GraphQLSchemaNormalizedConfig {\n // Collect the type definitions and extensions found in the document.\n const typeDefs: Array = [];\n\n const scalarExtensions = new AccumulatorMap<\n string,\n ScalarTypeExtensionNode\n >();\n const objectExtensions = new AccumulatorMap<\n string,\n ObjectTypeExtensionNode\n >();\n const interfaceExtensions = new AccumulatorMap<\n string,\n InterfaceTypeExtensionNode\n >();\n const unionExtensions = new AccumulatorMap();\n const enumExtensions = new AccumulatorMap();\n const inputObjectExtensions = new AccumulatorMap<\n string,\n InputObjectTypeExtensionNode\n >();\n const directiveExtensions = new AccumulatorMap<\n string,\n DirectiveExtensionNode\n >();\n\n // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n const directiveDefs: Array = [];\n\n let schemaDef: Maybe;\n // Schema extensions are collected which may add additional operation types.\n const schemaExtensions: Array = [];\n\n let isSchemaChanged = false;\n for (const def of documentAST.definitions) {\n switch (def.kind) {\n case Kind.SCHEMA_DEFINITION:\n schemaDef = def;\n break;\n case Kind.SCHEMA_EXTENSION:\n schemaExtensions.push(def);\n break;\n case Kind.DIRECTIVE_DEFINITION:\n directiveDefs.push(def);\n break;\n case Kind.DIRECTIVE_EXTENSION:\n directiveExtensions.add(def.name.value, def);\n break;\n\n // Type Definitions\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n typeDefs.push(def);\n break;\n\n // Type System Extensions\n case Kind.SCALAR_TYPE_EXTENSION:\n scalarExtensions.add(def.name.value, def);\n break;\n case Kind.OBJECT_TYPE_EXTENSION:\n objectExtensions.add(def.name.value, def);\n break;\n case Kind.INTERFACE_TYPE_EXTENSION:\n interfaceExtensions.add(def.name.value, def);\n break;\n case Kind.UNION_TYPE_EXTENSION:\n unionExtensions.add(def.name.value, def);\n break;\n case Kind.ENUM_TYPE_EXTENSION:\n enumExtensions.add(def.name.value, def);\n break;\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n inputObjectExtensions.add(def.name.value, def);\n break;\n default:\n continue;\n }\n isSchemaChanged = true;\n }\n\n // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n if (!isSchemaChanged) {\n return schemaConfig;\n }\n\n return mapSchemaConfig(schemaConfig, (context) => {\n const { getNamedType, setNamedType, getNamedTypes } = context;\n return {\n [SchemaElementKind.SCHEMA]: (config) => {\n for (const typeNode of typeDefs) {\n const type =\n stdTypeMap.get(typeNode.name.value) ?? buildNamedType(typeNode);\n setNamedType(type);\n }\n\n const operationTypes = {\n // Get the extended root operation types.\n query:\n config.query &&\n (getNamedType(config.query.name) as GraphQLObjectType),\n mutation:\n config.mutation &&\n (getNamedType(config.mutation.name) as GraphQLObjectType),\n subscription:\n config.subscription &&\n (getNamedType(config.subscription.name) as GraphQLObjectType),\n // Then, incorporate schema definition and all schema extensions.\n ...(schemaDef && getOperationTypes([schemaDef])),\n ...getOperationTypes(schemaExtensions),\n };\n\n // Then produce and return a Schema config with these types.\n return {\n description: schemaDef?.description?.value ?? config.description,\n ...operationTypes,\n types: getNamedTypes(),\n directives: [\n ...config.directives.map(extendDirective),\n ...directiveDefs.map(buildDirective),\n ],\n extensions: config.extensions,\n astNode: schemaDef ?? config.astNode,\n extensionASTNodes: config.extensionASTNodes.concat(schemaExtensions),\n assumeValid: options?.assumeValid ?? false,\n };\n },\n [SchemaElementKind.INPUT_OBJECT]: (config) => {\n const extensions = inputObjectExtensions.get(config.name) ?? [];\n return {\n ...config,\n fields: () => ({\n ...config.fields(),\n ...buildInputFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.ENUM]: (config) => {\n const extensions = enumExtensions.get(config.name) ?? [];\n return {\n ...config,\n values: () => ({\n ...config.values(),\n ...buildEnumValueMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.SCALAR]: (config) => {\n const extensions = scalarExtensions.get(config.name) ?? [];\n let specifiedByURL = config.specifiedByURL;\n for (const extensionNode of extensions) {\n specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL;\n }\n return {\n ...config,\n specifiedByURL,\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.OBJECT]: (config) => {\n const extensions = objectExtensions.get(config.name) ?? [];\n return {\n ...config,\n interfaces: () => [\n ...config.interfaces(),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...config.fields(),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.INTERFACE]: (config) => {\n const extensions = interfaceExtensions.get(config.name) ?? [];\n return {\n ...config,\n interfaces: () => [\n ...config.interfaces(),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...config.fields(),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n [SchemaElementKind.UNION]: (config) => {\n const extensions = unionExtensions.get(config.name) ?? [];\n return {\n ...config,\n types: () => [...config.types(), ...buildUnionTypes(extensions)],\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n };\n },\n };\n\n function getOperationTypes(\n nodes: ReadonlyArray,\n ): {\n query?: Maybe;\n mutation?: Maybe;\n subscription?: Maybe;\n } {\n const opTypes = {};\n for (const node of nodes) {\n const operationTypesNodes = node.operationTypes ?? [];\n\n for (const operationType of operationTypesNodes) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n opTypes[operationType.operation] = namedTypeFromAST(\n operationType.type,\n );\n }\n }\n\n return opTypes;\n }\n\n function namedTypeFromAST(node: NamedTypeNode): GraphQLNamedType {\n const name = node.name.value;\n const type = getNamedType(name);\n invariant(type !== undefined, `Unknown type: \"${name}\".`);\n return type;\n }\n\n function typeFromAST(node: TypeNode): GraphQLType {\n if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(typeFromAST(node.type));\n }\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(\n typeFromAST(node.type) as GraphQLNullableType,\n );\n }\n return namedTypeFromAST(node);\n }\n\n function buildDirective(node: DirectiveDefinitionNode): GraphQLDirective {\n const extensionASTNodes = directiveExtensions.get(node.name.value) ?? [];\n const deprecationReason =\n getDeprecationReason(node) ??\n extensionASTNodes\n .map((extensionNode) => getDeprecationReason(extensionNode))\n .find((reason) => reason != null);\n\n return new GraphQLDirective({\n name: node.name.value,\n description: node.description?.value,\n // @ts-expect-error\n locations: node.locations.map(({ value }) => value),\n isRepeatable: node.repeatable,\n args: buildArgumentMap(node.arguments),\n deprecationReason,\n astNode: node,\n extensionASTNodes,\n });\n }\n\n function extendDirective(directive: GraphQLDirective): GraphQLDirective {\n const extensionASTNodes = directiveExtensions.get(directive.name) ?? [];\n if (extensionASTNodes.length === 0) {\n return directive;\n }\n const deprecationReason =\n directive.deprecationReason ??\n extensionASTNodes\n .map((extensionNode) => getDeprecationReason(extensionNode))\n .find((reason) => reason != null);\n\n return new GraphQLDirective({\n ...directive.toConfig(),\n deprecationReason,\n extensionASTNodes:\n directive.extensionASTNodes.concat(extensionASTNodes),\n });\n }\n\n function buildFieldMap(\n nodes: ReadonlyArray<\n | InterfaceTypeDefinitionNode\n | InterfaceTypeExtensionNode\n | ObjectTypeDefinitionNode\n | ObjectTypeExtensionNode\n >,\n ): GraphQLFieldNormalizedConfigMap {\n const fieldConfigMap = Object.create(null);\n for (const node of nodes) {\n const nodeFields = node.fields ?? [];\n\n for (const field of nodeFields) {\n fieldConfigMap[field.name.value] = {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n type: typeFromAST(field.type),\n description: field.description?.value,\n args: buildArgumentMap(field.arguments),\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n return fieldConfigMap;\n }\n\n function buildArgumentMap(\n args: Maybe>,\n ): GraphQLFieldConfigArgumentMap {\n const argsNodes = args ?? [];\n\n const argConfigMap = Object.create(null);\n for (const arg of argsNodes) {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type: any = typeFromAST(arg.type);\n\n argConfigMap[arg.name.value] = {\n type,\n description: arg.description?.value,\n default: arg.defaultValue && { literal: arg.defaultValue },\n deprecationReason: getDeprecationReason(arg),\n astNode: arg,\n };\n }\n return argConfigMap;\n }\n\n function buildInputFieldMap(\n nodes: ReadonlyArray<\n InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode\n >,\n ): GraphQLInputFieldNormalizedConfigMap {\n const inputFieldMap = Object.create(null);\n for (const node of nodes) {\n const fieldsNodes = node.fields ?? [];\n\n for (const field of fieldsNodes) {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type: any = typeFromAST(field.type);\n\n inputFieldMap[field.name.value] = {\n type,\n description: field.description?.value,\n default: field.defaultValue && { literal: field.defaultValue },\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n return inputFieldMap;\n }\n\n function buildEnumValueMap(\n nodes: ReadonlyArray,\n ): GraphQLEnumValueNormalizedConfigMap {\n const enumValueMap = Object.create(null);\n for (const node of nodes) {\n const valuesNodes = node.values ?? [];\n\n for (const value of valuesNodes) {\n enumValueMap[value.name.value] = {\n description: value.description?.value,\n deprecationReason: getDeprecationReason(value),\n astNode: value,\n };\n }\n }\n return enumValueMap;\n }\n\n function buildInterfaces(\n nodes: ReadonlyArray<\n | InterfaceTypeDefinitionNode\n | InterfaceTypeExtensionNode\n | ObjectTypeDefinitionNode\n | ObjectTypeExtensionNode\n >,\n ): Array {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap(\n (node) => node.interfaces?.map(namedTypeFromAST) ?? [],\n );\n }\n\n function buildUnionTypes(\n nodes: ReadonlyArray,\n ): Array {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap((node) => node.types?.map(namedTypeFromAST) ?? []);\n }\n\n function buildNamedType(astNode: TypeDefinitionNode): GraphQLNamedType {\n const name = astNode.name.value;\n\n switch (astNode.kind) {\n case Kind.OBJECT_TYPE_DEFINITION: {\n const extensionASTNodes = objectExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLObjectType({\n name,\n description: astNode.description?.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.INTERFACE_TYPE_DEFINITION: {\n const extensionASTNodes = interfaceExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLInterfaceType({\n name,\n description: astNode.description?.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.ENUM_TYPE_DEFINITION: {\n const extensionASTNodes = enumExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLEnumType({\n name,\n description: astNode.description?.value,\n values: () => buildEnumValueMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.UNION_TYPE_DEFINITION: {\n const extensionASTNodes = unionExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLUnionType({\n name,\n description: astNode.description?.value,\n types: () => buildUnionTypes(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.SCALAR_TYPE_DEFINITION: {\n const extensionASTNodes = scalarExtensions.get(name) ?? [];\n let specifiedByURL = getSpecifiedByURL(astNode);\n for (const extensionNode of extensionASTNodes) {\n specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL;\n }\n return new GraphQLScalarType({\n name,\n description: astNode.description?.value,\n specifiedByURL,\n astNode,\n extensionASTNodes,\n });\n }\n case Kind.INPUT_OBJECT_TYPE_DEFINITION: {\n const extensionASTNodes = inputObjectExtensions.get(name) ?? [];\n const allNodes = [astNode, ...extensionASTNodes];\n\n return new GraphQLInputObjectType({\n name,\n description: astNode.description?.value,\n fields: () => buildInputFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n isOneOf: isOneOf(astNode),\n });\n }\n }\n }\n });\n}\n\nconst stdTypeMap = new Map(\n [...specifiedScalarTypes, ...introspectionTypes].map((type) => [\n type.name,\n type,\n ]),\n);\n\n/**\n * Given a field or enum value node, returns the string value for the\n * deprecation reason.\n *\n * @internal\n */\nfunction getDeprecationReason(\n node:\n | EnumValueDefinitionNode\n | FieldDefinitionNode\n | InputValueDefinitionNode\n | DirectiveDefinitionNode\n | DirectiveExtensionNode,\n): Maybe {\n const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);\n // @ts-expect-error validated by `getDirectiveValues`\n return deprecated?.reason;\n}\n\n/**\n * Given a scalar node, returns the string value for the specifiedByURL.\n *\n * @internal\n */\nfunction getSpecifiedByURL(\n node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode,\n): Maybe {\n const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node);\n // @ts-expect-error validated by `getDirectiveValues`\n return specifiedBy?.url;\n}\n\n/**\n * Given an input object node, returns if the node should be OneOf.\n *\n * @internal\n */\nfunction isOneOf(node: InputObjectTypeDefinitionNode): boolean {\n return Boolean(getDirectiveValues(GraphQLOneOfDirective, node));\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.mts new file mode 100644 index 00000000..bf452337 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.mts @@ -0,0 +1,172 @@ +/** @category Schema Changes */ +import type { GraphQLSchema } from "../type/schema.mjs"; +/** Categories of schema changes that may break existing operations. */ +export declare const BreakingChangeType: { + readonly TYPE_REMOVED: "TYPE_REMOVED"; + readonly TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; + readonly TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION"; + readonly VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM"; + readonly REQUIRED_INPUT_FIELD_ADDED: "REQUIRED_INPUT_FIELD_ADDED"; + readonly IMPLEMENTED_INTERFACE_REMOVED: "IMPLEMENTED_INTERFACE_REMOVED"; + readonly FIELD_REMOVED: "FIELD_REMOVED"; + readonly FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; + readonly REQUIRED_ARG_ADDED: "REQUIRED_ARG_ADDED"; + readonly ARG_REMOVED: "ARG_REMOVED"; + readonly ARG_CHANGED_KIND: "ARG_CHANGED_KIND"; + readonly DIRECTIVE_REMOVED: "DIRECTIVE_REMOVED"; + readonly DIRECTIVE_ARG_REMOVED: "DIRECTIVE_ARG_REMOVED"; + readonly REQUIRED_DIRECTIVE_ARG_ADDED: "REQUIRED_DIRECTIVE_ARG_ADDED"; + readonly DIRECTIVE_REPEATABLE_REMOVED: "DIRECTIVE_REPEATABLE_REMOVED"; + readonly DIRECTIVE_LOCATION_REMOVED: "DIRECTIVE_LOCATION_REMOVED"; +}; +/** Categories of schema changes that may break existing operations. */ +export type BreakingChangeType = (typeof BreakingChangeType)[keyof typeof BreakingChangeType]; +/** Categories of schema changes that may be dangerous for existing operations. */ +export declare const DangerousChangeType: { + readonly VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM"; + readonly TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION"; + readonly OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED"; + readonly OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED"; + readonly IMPLEMENTED_INTERFACE_ADDED: "IMPLEMENTED_INTERFACE_ADDED"; + readonly ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE"; + readonly INPUT_FIELD_DEFAULT_VALUE_CHANGE: "INPUT_FIELD_DEFAULT_VALUE_CHANGE"; +}; +/** Categories of schema changes that may be dangerous for existing operations. */ +export type DangerousChangeType = (typeof DangerousChangeType)[keyof typeof DangerousChangeType]; +/** Categories of schema changes that are considered safe for existing operations. */ +export declare const SafeChangeType: { + readonly DESCRIPTION_CHANGED: "DESCRIPTION_CHANGED"; + readonly TYPE_ADDED: "TYPE_ADDED"; + readonly OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED"; + readonly OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED"; + readonly DIRECTIVE_ADDED: "DIRECTIVE_ADDED"; + readonly FIELD_ADDED: "FIELD_ADDED"; + readonly DIRECTIVE_REPEATABLE_ADDED: "DIRECTIVE_REPEATABLE_ADDED"; + readonly DIRECTIVE_LOCATION_ADDED: "DIRECTIVE_LOCATION_ADDED"; + readonly OPTIONAL_DIRECTIVE_ARG_ADDED: "OPTIONAL_DIRECTIVE_ARG_ADDED"; + readonly FIELD_CHANGED_KIND_SAFE: "FIELD_CHANGED_KIND_SAFE"; + readonly ARG_CHANGED_KIND_SAFE: "ARG_CHANGED_KIND_SAFE"; + readonly ARG_DEFAULT_VALUE_ADDED: "ARG_DEFAULT_VALUE_ADDED"; + readonly INPUT_FIELD_DEFAULT_VALUE_ADDED: "INPUT_FIELD_DEFAULT_VALUE_ADDED"; +}; +/** Categories of schema changes that are considered safe for existing operations. */ +export type SafeChangeType = (typeof SafeChangeType)[keyof typeof SafeChangeType]; +/** Description of a schema change that may break existing operations. */ +export interface BreakingChange { + /** Specific kind of breaking schema change. */ + type: BreakingChangeType; + /** Human-readable description of the breaking schema change. */ + description: string; +} +/** Description of a schema change that may be dangerous for existing operations. */ +export interface DangerousChange { + /** Specific kind of dangerous schema change. */ + type: DangerousChangeType; + /** Human-readable description of the dangerous schema change. */ + description: string; +} +/** Description of a schema change that is considered safe for existing operations. */ +export interface SafeChange { + /** Specific kind of safe schema change. */ + type: SafeChangeType; + /** Human-readable description of the safe schema change. */ + description: string; +} +/** Any schema change detected between two schemas. */ +export type SchemaChange = SafeChange | DangerousChange | BreakingChange; +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of breaking changes covered by the other functions down below. This + * deprecated wrapper will be removed in v18; use `findSchemaChanges()` instead + * and filter for breaking changes. + * @param oldSchema - Schema before the change. + * @param newSchema - Schema after the change. + * @returns Breaking changes between the two schemas. + * @example + * ```ts + * import { buildSchema, findBreakingChanges } from 'graphql/utilities'; + * + * const oldSchema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const newSchema = buildSchema(` + * type Query { + * hello: String + * } + * `); + * + * const changes = findBreakingChanges(oldSchema, newSchema); + * + * changes.map((change) => change.type); // => ['FIELD_REMOVED'] + * ``` + * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18. + */ +export declare function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + * This deprecated wrapper will be removed in v18; use `findSchemaChanges()` + * instead and filter for dangerous changes. + * @param oldSchema - Schema before the change. + * @param newSchema - Schema after the change. + * @returns Dangerous changes between the two schemas. + * @example + * ```ts + * import { buildSchema, findDangerousChanges } from 'graphql/utilities'; + * + * const oldSchema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Query { + * episode: Episode + * } + * `); + * const newSchema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const changes = findDangerousChanges(oldSchema, newSchema); + * + * changes.map((change) => change.type); // => ['VALUE_ADDED_TO_ENUM'] + * ``` + * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18. + */ +export declare function findDangerousChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; +/** + * Finds all schema changes between two schemas. + * @param oldSchema - Schema before the change. + * @param newSchema - Schema after the change. + * @returns Safe, dangerous, and breaking changes between the two schemas. + * @example + * ```ts + * import { buildSchema, findSchemaChanges } from 'graphql/utilities'; + * + * const oldSchema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const newSchema = buildSchema(` + * type Query { + * greeting(name: String): String + * farewell: String + * } + * `); + * + * const changes = findSchemaChanges(oldSchema, newSchema); + * + * changes.map((change) => change.type); // => ['OPTIONAL_ARG_ADDED', 'FIELD_ADDED'] + * ``` + */ +export declare function findSchemaChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.ts new file mode 100644 index 00000000..116c5e8d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.d.ts @@ -0,0 +1,172 @@ +/** @category Schema Changes */ +import type { GraphQLSchema } from "../type/schema.js"; +/** Categories of schema changes that may break existing operations. */ +export declare const BreakingChangeType: { + readonly TYPE_REMOVED: "TYPE_REMOVED"; + readonly TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; + readonly TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION"; + readonly VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM"; + readonly REQUIRED_INPUT_FIELD_ADDED: "REQUIRED_INPUT_FIELD_ADDED"; + readonly IMPLEMENTED_INTERFACE_REMOVED: "IMPLEMENTED_INTERFACE_REMOVED"; + readonly FIELD_REMOVED: "FIELD_REMOVED"; + readonly FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; + readonly REQUIRED_ARG_ADDED: "REQUIRED_ARG_ADDED"; + readonly ARG_REMOVED: "ARG_REMOVED"; + readonly ARG_CHANGED_KIND: "ARG_CHANGED_KIND"; + readonly DIRECTIVE_REMOVED: "DIRECTIVE_REMOVED"; + readonly DIRECTIVE_ARG_REMOVED: "DIRECTIVE_ARG_REMOVED"; + readonly REQUIRED_DIRECTIVE_ARG_ADDED: "REQUIRED_DIRECTIVE_ARG_ADDED"; + readonly DIRECTIVE_REPEATABLE_REMOVED: "DIRECTIVE_REPEATABLE_REMOVED"; + readonly DIRECTIVE_LOCATION_REMOVED: "DIRECTIVE_LOCATION_REMOVED"; +}; +/** Categories of schema changes that may break existing operations. */ +export type BreakingChangeType = (typeof BreakingChangeType)[keyof typeof BreakingChangeType]; +/** Categories of schema changes that may be dangerous for existing operations. */ +export declare const DangerousChangeType: { + readonly VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM"; + readonly TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION"; + readonly OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED"; + readonly OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED"; + readonly IMPLEMENTED_INTERFACE_ADDED: "IMPLEMENTED_INTERFACE_ADDED"; + readonly ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE"; + readonly INPUT_FIELD_DEFAULT_VALUE_CHANGE: "INPUT_FIELD_DEFAULT_VALUE_CHANGE"; +}; +/** Categories of schema changes that may be dangerous for existing operations. */ +export type DangerousChangeType = (typeof DangerousChangeType)[keyof typeof DangerousChangeType]; +/** Categories of schema changes that are considered safe for existing operations. */ +export declare const SafeChangeType: { + readonly DESCRIPTION_CHANGED: "DESCRIPTION_CHANGED"; + readonly TYPE_ADDED: "TYPE_ADDED"; + readonly OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED"; + readonly OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED"; + readonly DIRECTIVE_ADDED: "DIRECTIVE_ADDED"; + readonly FIELD_ADDED: "FIELD_ADDED"; + readonly DIRECTIVE_REPEATABLE_ADDED: "DIRECTIVE_REPEATABLE_ADDED"; + readonly DIRECTIVE_LOCATION_ADDED: "DIRECTIVE_LOCATION_ADDED"; + readonly OPTIONAL_DIRECTIVE_ARG_ADDED: "OPTIONAL_DIRECTIVE_ARG_ADDED"; + readonly FIELD_CHANGED_KIND_SAFE: "FIELD_CHANGED_KIND_SAFE"; + readonly ARG_CHANGED_KIND_SAFE: "ARG_CHANGED_KIND_SAFE"; + readonly ARG_DEFAULT_VALUE_ADDED: "ARG_DEFAULT_VALUE_ADDED"; + readonly INPUT_FIELD_DEFAULT_VALUE_ADDED: "INPUT_FIELD_DEFAULT_VALUE_ADDED"; +}; +/** Categories of schema changes that are considered safe for existing operations. */ +export type SafeChangeType = (typeof SafeChangeType)[keyof typeof SafeChangeType]; +/** Description of a schema change that may break existing operations. */ +export interface BreakingChange { + /** Specific kind of breaking schema change. */ + type: BreakingChangeType; + /** Human-readable description of the breaking schema change. */ + description: string; +} +/** Description of a schema change that may be dangerous for existing operations. */ +export interface DangerousChange { + /** Specific kind of dangerous schema change. */ + type: DangerousChangeType; + /** Human-readable description of the dangerous schema change. */ + description: string; +} +/** Description of a schema change that is considered safe for existing operations. */ +export interface SafeChange { + /** Specific kind of safe schema change. */ + type: SafeChangeType; + /** Human-readable description of the safe schema change. */ + description: string; +} +/** Any schema change detected between two schemas. */ +export type SchemaChange = SafeChange | DangerousChange | BreakingChange; +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of breaking changes covered by the other functions down below. This + * deprecated wrapper will be removed in v18; use `findSchemaChanges()` instead + * and filter for breaking changes. + * @param oldSchema - Schema before the change. + * @param newSchema - Schema after the change. + * @returns Breaking changes between the two schemas. + * @example + * ```ts + * import { buildSchema, findBreakingChanges } from 'graphql/utilities'; + * + * const oldSchema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const newSchema = buildSchema(` + * type Query { + * hello: String + * } + * `); + * + * const changes = findBreakingChanges(oldSchema, newSchema); + * + * changes.map((change) => change.type); // => ['FIELD_REMOVED'] + * ``` + * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18. + */ +export declare function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + * This deprecated wrapper will be removed in v18; use `findSchemaChanges()` + * instead and filter for dangerous changes. + * @param oldSchema - Schema before the change. + * @param newSchema - Schema after the change. + * @returns Dangerous changes between the two schemas. + * @example + * ```ts + * import { buildSchema, findDangerousChanges } from 'graphql/utilities'; + * + * const oldSchema = buildSchema(` + * enum Episode { + * NEW_HOPE + * } + * + * type Query { + * episode: Episode + * } + * `); + * const newSchema = buildSchema(` + * enum Episode { + * NEW_HOPE + * EMPIRE + * } + * + * type Query { + * episode: Episode + * } + * `); + * + * const changes = findDangerousChanges(oldSchema, newSchema); + * + * changes.map((change) => change.type); // => ['VALUE_ADDED_TO_ENUM'] + * ``` + * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18. + */ +export declare function findDangerousChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; +/** + * Finds all schema changes between two schemas. + * @param oldSchema - Schema before the change. + * @param newSchema - Schema after the change. + * @returns Safe, dangerous, and breaking changes between the two schemas. + * @example + * ```ts + * import { buildSchema, findSchemaChanges } from 'graphql/utilities'; + * + * const oldSchema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const newSchema = buildSchema(` + * type Query { + * greeting(name: String): String + * farewell: String + * } + * `); + * + * const changes = findSchemaChanges(oldSchema, newSchema); + * + * changes.map((change) => change.type); // => ['OPTIONAL_ARG_ADDED', 'FIELD_ADDED'] + * ``` + */ +export declare function findSchemaChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js new file mode 100644 index 00000000..1da9d81a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js @@ -0,0 +1,553 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SafeChangeType = exports.DangerousChangeType = exports.BreakingChangeType = void 0; +exports.findBreakingChanges = findBreakingChanges; +exports.findDangerousChanges = findDangerousChanges; +exports.findSchemaChanges = findSchemaChanges; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const keyMap_ts_1 = require("../jsutils/keyMap.js"); +const printer_ts_1 = require("../language/printer.js"); +const definition_ts_1 = require("../type/definition.js"); +const scalars_ts_1 = require("../type/scalars.js"); +const getDefaultValueAST_ts_1 = require("./getDefaultValueAST.js"); +const sortValueNode_ts_1 = require("./sortValueNode.js"); +exports.BreakingChangeType = { + TYPE_REMOVED: 'TYPE_REMOVED', + TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', + TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', + VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', + REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED', + IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED', + FIELD_REMOVED: 'FIELD_REMOVED', + FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', + REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED', + ARG_REMOVED: 'ARG_REMOVED', + ARG_CHANGED_KIND: 'ARG_CHANGED_KIND', + DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED', + DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED', + REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED', + DIRECTIVE_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED', + DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED', +}; +exports.DangerousChangeType = { + VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM', + TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION', + OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', + IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED', + ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE', + INPUT_FIELD_DEFAULT_VALUE_CHANGE: 'INPUT_FIELD_DEFAULT_VALUE_CHANGE', +}; +exports.SafeChangeType = { + DESCRIPTION_CHANGED: 'DESCRIPTION_CHANGED', + TYPE_ADDED: 'TYPE_ADDED', + OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', + DIRECTIVE_ADDED: 'DIRECTIVE_ADDED', + FIELD_ADDED: 'FIELD_ADDED', + DIRECTIVE_REPEATABLE_ADDED: 'DIRECTIVE_REPEATABLE_ADDED', + DIRECTIVE_LOCATION_ADDED: 'DIRECTIVE_LOCATION_ADDED', + OPTIONAL_DIRECTIVE_ARG_ADDED: 'OPTIONAL_DIRECTIVE_ARG_ADDED', + FIELD_CHANGED_KIND_SAFE: 'FIELD_CHANGED_KIND_SAFE', + ARG_CHANGED_KIND_SAFE: 'ARG_CHANGED_KIND_SAFE', + ARG_DEFAULT_VALUE_ADDED: 'ARG_DEFAULT_VALUE_ADDED', + INPUT_FIELD_DEFAULT_VALUE_ADDED: 'INPUT_FIELD_DEFAULT_VALUE_ADDED', +}; +function findBreakingChanges(oldSchema, newSchema) { + return findSchemaChanges(oldSchema, newSchema).filter((change) => change.type in exports.BreakingChangeType); +} +function findDangerousChanges(oldSchema, newSchema) { + return findSchemaChanges(oldSchema, newSchema).filter((change) => change.type in exports.DangerousChangeType); +} +function findSchemaChanges(oldSchema, newSchema) { + return [ + ...findTypeChanges(oldSchema, newSchema), + ...findDirectiveChanges(oldSchema, newSchema), + ]; +} +function findDirectiveChanges(oldSchema, newSchema) { + const schemaChanges = []; + const directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives()); + for (const oldDirective of directivesDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.DIRECTIVE_REMOVED, + description: `Directive ${oldDirective} was removed.`, + }); + } + for (const newDirective of directivesDiff.added) { + schemaChanges.push({ + type: exports.SafeChangeType.DIRECTIVE_ADDED, + description: `Directive @${newDirective.name} was added.`, + }); + } + for (const [oldDirective, newDirective] of directivesDiff.persisted) { + const argsDiff = diff(oldDirective.args, newDirective.args); + for (const newArg of argsDiff.added) { + if ((0, definition_ts_1.isRequiredArgument)(newArg)) { + schemaChanges.push({ + type: exports.BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: `A required argument ${newArg} was added.`, + }); + } + else { + schemaChanges.push({ + type: exports.SafeChangeType.OPTIONAL_DIRECTIVE_ARG_ADDED, + description: `An optional argument @${oldDirective.name}(${newArg.name}:) was added.`, + }); + } + } + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: `Argument ${oldArg} was removed.`, + }); + } + for (const [oldArg, newArg] of argsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type); + const oldDefaultValueStr = getDefaultValue(oldArg); + const newDefaultValueStr = getDefaultValue(newArg); + if (!isSafe) { + schemaChanges.push({ + type: exports.BreakingChangeType.ARG_CHANGED_KIND, + description: `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } + else if (oldDefaultValueStr !== undefined) { + if (newDefaultValueStr === undefined) { + schemaChanges.push({ + type: exports.DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `@${oldDirective.name}(${oldArg.name}:) defaultValue was removed.`, + }); + } + else if (oldDefaultValueStr !== newDefaultValueStr) { + schemaChanges.push({ + type: exports.DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `@${oldDirective.name}(${oldArg.name}:) has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`, + }); + } + } + else if (newDefaultValueStr !== undefined && + oldDefaultValueStr === undefined) { + schemaChanges.push({ + type: exports.SafeChangeType.ARG_DEFAULT_VALUE_ADDED, + description: `@${oldDirective.name}(${oldArg.name}:) added a defaultValue ${newDefaultValueStr}.`, + }); + } + else if (oldArg.type.toString() !== newArg.type.toString()) { + schemaChanges.push({ + type: exports.SafeChangeType.ARG_CHANGED_KIND_SAFE, + description: `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } + if (oldArg.description !== newArg.description) { + schemaChanges.push({ + type: exports.SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of @${oldDirective.name}(${oldDirective.name}) has changed to "${newArg.description}".`, + }); + } + } + if (oldDirective.isRepeatable && !newDirective.isRepeatable) { + schemaChanges.push({ + type: exports.BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, + description: `Repeatable flag was removed from ${oldDirective}.`, + }); + } + else if (newDirective.isRepeatable && !oldDirective.isRepeatable) { + schemaChanges.push({ + type: exports.SafeChangeType.DIRECTIVE_REPEATABLE_ADDED, + description: `Repeatable flag was added to @${oldDirective.name}.`, + }); + } + if (oldDirective.description !== newDirective.description) { + schemaChanges.push({ + type: exports.SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of @${oldDirective.name} has changed to "${newDirective.description}".`, + }); + } + for (const location of oldDirective.locations) { + if (!newDirective.locations.includes(location)) { + schemaChanges.push({ + type: exports.BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: `${location} was removed from ${oldDirective}.`, + }); + } + } + for (const location of newDirective.locations) { + if (!oldDirective.locations.includes(location)) { + schemaChanges.push({ + type: exports.SafeChangeType.DIRECTIVE_LOCATION_ADDED, + description: `${location} was added to @${oldDirective.name}.`, + }); + } + } + } + return schemaChanges; +} +function findTypeChanges(oldSchema, newSchema) { + const schemaChanges = []; + const typesDiff = diff(Object.values(oldSchema.getTypeMap()), Object.values(newSchema.getTypeMap())); + for (const oldType of typesDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.TYPE_REMOVED, + description: (0, scalars_ts_1.isSpecifiedScalarType)(oldType) + ? `Standard scalar ${oldType} was removed because it is not referenced anymore.` + : `${oldType} was removed.`, + }); + } + for (const newType of typesDiff.added) { + schemaChanges.push({ + type: exports.SafeChangeType.TYPE_ADDED, + description: `${newType} was added.`, + }); + } + for (const [oldType, newType] of typesDiff.persisted) { + if (oldType.description !== newType.description) { + schemaChanges.push({ + type: exports.SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of ${oldType.name} has changed to "${newType.description}".`, + }); + } + if ((0, definition_ts_1.isEnumType)(oldType) && (0, definition_ts_1.isEnumType)(newType)) { + schemaChanges.push(...findEnumTypeChanges(oldType, newType)); + } + else if ((0, definition_ts_1.isUnionType)(oldType) && (0, definition_ts_1.isUnionType)(newType)) { + schemaChanges.push(...findUnionTypeChanges(oldType, newType)); + } + else if ((0, definition_ts_1.isInputObjectType)(oldType) && (0, definition_ts_1.isInputObjectType)(newType)) { + schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); + } + else if ((0, definition_ts_1.isObjectType)(oldType) && (0, definition_ts_1.isObjectType)(newType)) { + schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); + } + else if ((0, definition_ts_1.isInterfaceType)(oldType) && (0, definition_ts_1.isInterfaceType)(newType)) { + schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); + } + else if (oldType.constructor !== newType.constructor) { + schemaChanges.push({ + type: exports.BreakingChangeType.TYPE_CHANGED_KIND, + description: `${oldType} changed from ${typeKindName(oldType)} to ${typeKindName(newType)}.`, + }); + } + } + return schemaChanges; +} +function findInputObjectTypeChanges(oldType, newType) { + const schemaChanges = []; + const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); + for (const newField of fieldsDiff.added) { + if ((0, definition_ts_1.isRequiredInputField)(newField)) { + schemaChanges.push({ + type: exports.BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: `A required field ${newField} was added.`, + }); + } + else { + schemaChanges.push({ + type: exports.DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: `An optional field ${newField} was added.`, + }); + } + } + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.FIELD_REMOVED, + description: `Field ${oldField} was removed.`, + }); + } + for (const [oldField, newField] of fieldsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldField.type, newField.type); + const oldDefaultValueStr = getDefaultValue(oldField); + const newDefaultValueStr = getDefaultValue(newField); + if (!isSafe) { + schemaChanges.push({ + type: exports.BreakingChangeType.FIELD_CHANGED_KIND, + description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`, + }); + } + else if (oldDefaultValueStr !== undefined) { + if (newDefaultValueStr === undefined) { + schemaChanges.push({ + type: exports.DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE, + description: `${oldField} defaultValue was removed.`, + }); + } + else if (oldDefaultValueStr !== newDefaultValueStr) { + schemaChanges.push({ + type: exports.DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE, + description: `${oldField} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`, + }); + } + } + else if (newDefaultValueStr !== undefined && + oldDefaultValueStr === undefined) { + schemaChanges.push({ + type: exports.SafeChangeType.INPUT_FIELD_DEFAULT_VALUE_ADDED, + description: `${oldField} added a defaultValue ${newDefaultValueStr}.`, + }); + } + else if (oldField.type.toString() !== newField.type.toString()) { + schemaChanges.push({ + type: exports.SafeChangeType.FIELD_CHANGED_KIND_SAFE, + description: `Field ${oldType}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + if (oldField.description !== newField.description) { + schemaChanges.push({ + type: exports.SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of input-field ${newType}.${newField.name} has changed to "${newField.description}".`, + }); + } + } + return schemaChanges; +} +function findUnionTypeChanges(oldType, newType) { + const schemaChanges = []; + const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); + for (const newPossibleType of possibleTypesDiff.added) { + schemaChanges.push({ + type: exports.DangerousChangeType.TYPE_ADDED_TO_UNION, + description: `${newPossibleType} was added to union type ${oldType}.`, + }); + } + for (const oldPossibleType of possibleTypesDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: `${oldPossibleType} was removed from union type ${oldType}.`, + }); + } + return schemaChanges; +} +function findEnumTypeChanges(oldType, newType) { + const schemaChanges = []; + const valuesDiff = diff(oldType.getValues(), newType.getValues()); + for (const newValue of valuesDiff.added) { + schemaChanges.push({ + type: exports.DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: `Enum value ${newValue} was added.`, + }); + } + for (const oldValue of valuesDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: `Enum value ${oldValue} was removed.`, + }); + } + for (const [oldValue, newValue] of valuesDiff.persisted) { + if (oldValue.description !== newValue.description) { + schemaChanges.push({ + type: exports.SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of enum value ${oldType}.${oldValue.name} has changed to "${newValue.description}".`, + }); + } + } + return schemaChanges; +} +function findImplementedInterfacesChanges(oldType, newType) { + const schemaChanges = []; + const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); + for (const newInterface of interfacesDiff.added) { + schemaChanges.push({ + type: exports.DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, + description: `${newInterface} added to interfaces implemented by ${oldType}.`, + }); + } + for (const oldInterface of interfacesDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, + description: `${oldType} no longer implements interface ${oldInterface}.`, + }); + } + return schemaChanges; +} +function findFieldChanges(oldType, newType) { + const schemaChanges = []; + const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.FIELD_REMOVED, + description: `Field ${oldField} was removed.`, + }); + } + for (const newField of fieldsDiff.added) { + schemaChanges.push({ + type: exports.SafeChangeType.FIELD_ADDED, + description: `Field ${oldType}.${newField.name} was added.`, + }); + } + for (const [oldField, newField] of fieldsDiff.persisted) { + schemaChanges.push(...findArgChanges(oldField, newField)); + const isSafe = isChangeSafeForObjectOrInterfaceField(oldField.type, newField.type); + if (!isSafe) { + schemaChanges.push({ + type: exports.BreakingChangeType.FIELD_CHANGED_KIND, + description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`, + }); + } + else if (oldField.type.toString() !== newField.type.toString()) { + schemaChanges.push({ + type: exports.SafeChangeType.FIELD_CHANGED_KIND_SAFE, + description: `Field ${oldType}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + if (oldField.description !== newField.description) { + schemaChanges.push({ + type: exports.SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of field ${oldType}.${oldField.name} has changed to "${newField.description}".`, + }); + } + } + return schemaChanges; +} +function findArgChanges(oldField, newField) { + const schemaChanges = []; + const argsDiff = diff(oldField.args, newField.args); + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: exports.BreakingChangeType.ARG_REMOVED, + description: `Argument ${oldArg} was removed.`, + }); + } + for (const [oldArg, newArg] of argsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type); + const oldDefaultValueStr = getDefaultValue(oldArg); + const newDefaultValueStr = getDefaultValue(newArg); + if (!isSafe) { + schemaChanges.push({ + type: exports.BreakingChangeType.ARG_CHANGED_KIND, + description: `Argument ${newArg} has changed type from ${oldArg.type} to ${newArg.type}.`, + }); + } + else if (oldDefaultValueStr !== undefined) { + if (newDefaultValueStr === undefined) { + schemaChanges.push({ + type: exports.DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldArg} defaultValue was removed.`, + }); + } + else if (oldDefaultValueStr !== newDefaultValueStr) { + schemaChanges.push({ + type: exports.DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldArg} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`, + }); + } + } + else if (newDefaultValueStr !== undefined && + oldDefaultValueStr === undefined) { + schemaChanges.push({ + type: exports.SafeChangeType.ARG_DEFAULT_VALUE_ADDED, + description: `${oldArg} added a defaultValue ${newDefaultValueStr}.`, + }); + } + else if (oldArg.type.toString() !== newArg.type.toString()) { + schemaChanges.push({ + type: exports.SafeChangeType.ARG_CHANGED_KIND_SAFE, + description: `Argument ${oldArg} has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } + if (oldArg.description !== newArg.description) { + schemaChanges.push({ + type: exports.SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of argument ${oldArg} has changed to "${newArg.description}".`, + }); + } + } + for (const newArg of argsDiff.added) { + if ((0, definition_ts_1.isRequiredArgument)(newArg)) { + schemaChanges.push({ + type: exports.BreakingChangeType.REQUIRED_ARG_ADDED, + description: `A required argument ${newArg} was added.`, + }); + } + else { + schemaChanges.push({ + type: exports.DangerousChangeType.OPTIONAL_ARG_ADDED, + description: `An optional argument ${newArg} was added.`, + }); + } + } + return schemaChanges; +} +function isChangeSafeForObjectOrInterfaceField(oldType, newType) { + if ((0, definition_ts_1.isListType)(oldType)) { + return (((0, definition_ts_1.isListType)(newType) && + isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)) || + ((0, definition_ts_1.isNonNullType)(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))); + } + if ((0, definition_ts_1.isNonNullType)(oldType)) { + return ((0, definition_ts_1.isNonNullType)(newType) && + isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)); + } + return (((0, definition_ts_1.isNamedType)(newType) && oldType.name === newType.name) || + ((0, definition_ts_1.isNonNullType)(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))); +} +function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { + if ((0, definition_ts_1.isListType)(oldType)) { + return ((0, definition_ts_1.isListType)(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)); + } + if ((0, definition_ts_1.isNonNullType)(oldType)) { + return (((0, definition_ts_1.isNonNullType)(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)) || + (!(0, definition_ts_1.isNonNullType)(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType))); + } + return (0, definition_ts_1.isNamedType)(newType) && oldType.name === newType.name; +} +function typeKindName(type) { + if ((0, definition_ts_1.isScalarType)(type)) { + return 'a Scalar type'; + } + if ((0, definition_ts_1.isObjectType)(type)) { + return 'an Object type'; + } + if ((0, definition_ts_1.isInterfaceType)(type)) { + return 'an Interface type'; + } + if ((0, definition_ts_1.isUnionType)(type)) { + return 'a Union type'; + } + if ((0, definition_ts_1.isEnumType)(type)) { + return 'an Enum type'; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + return 'an Input type'; + } + (0, invariant_ts_1.invariant)(false, 'Unexpected type: ' + (0, inspect_ts_1.inspect)(type)); +} +function getDefaultValue(argOrInputField) { + const ast = (0, getDefaultValueAST_ts_1.getDefaultValueAST)(argOrInputField); + if (ast) { + return (0, printer_ts_1.print)((0, sortValueNode_ts_1.sortValueNode)(ast)); + } +} +function diff(oldArray, newArray) { + const added = []; + const removed = []; + const persisted = []; + const oldMap = (0, keyMap_ts_1.keyMap)(oldArray, ({ name }) => name); + const newMap = (0, keyMap_ts_1.keyMap)(newArray, ({ name }) => name); + for (const oldItem of oldArray) { + const newItem = newMap[oldItem.name]; + if (newItem === undefined) { + removed.push(oldItem); + } + else { + persisted.push([oldItem, newItem]); + } + } + for (const newItem of newArray) { + if (oldMap[newItem.name] === undefined) { + added.push(newItem); + } + } + return { added, persisted, removed }; +} +//# sourceMappingURL=findSchemaChanges.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js.map new file mode 100644 index 00000000..4dd79d6a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.js.map @@ -0,0 +1 @@ +{"version":3,"file":"findSchemaChanges.js","sourceRoot":"","sources":["../../src/utilities/findSchemaChanges.ts"],"names":[],"mappings":";;;AA8JA,kDAQC;AAwCD,oDAQC;AA4BD,8CAQC;AAxPD,sDAAgD;AAChD,0DAAoD;AACpD,oDAA8C;AAE9C,uDAA+C;AAc/C,yDAY+B;AAC/B,mDAA2D;AAG3D,mEAA6D;AAC7D,yDAAmD;AAGtC,QAAA,kBAAkB,GAAG;IAChC,YAAY,EAAE,cAAuB;IACrC,iBAAiB,EAAE,mBAA4B;IAC/C,uBAAuB,EAAE,yBAAkC;IAC3D,uBAAuB,EAA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IAEpC,MAAM,MAAM,GAAG,IAAA,kBAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,IAAA,kBAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEpD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC","sourcesContent":["/** @category Schema Changes */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\n\nimport { print } from '../language/printer.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLEnumType,\n GraphQLField,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n GraphQLType,\n GraphQLUnionType,\n} from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNamedType,\n isNonNullType,\n isObjectType,\n isRequiredArgument,\n isRequiredInputField,\n isScalarType,\n isUnionType,\n} from '../type/definition.ts';\nimport { isSpecifiedScalarType } from '../type/scalars.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { getDefaultValueAST } from './getDefaultValueAST.ts';\nimport { sortValueNode } from './sortValueNode.ts';\n\n/** Categories of schema changes that may break existing operations. */\nexport const BreakingChangeType = {\n TYPE_REMOVED: 'TYPE_REMOVED' as const,\n TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND' as const,\n TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION' as const,\n VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM' as const,\n REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED' as const,\n IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED' as const,\n FIELD_REMOVED: 'FIELD_REMOVED' as const,\n FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND' as const,\n REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED' as const,\n ARG_REMOVED: 'ARG_REMOVED' as const,\n ARG_CHANGED_KIND: 'ARG_CHANGED_KIND' as const,\n DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED' as const,\n DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED' as const,\n REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED' as const,\n DIRECTIVE_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED' as const,\n DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED' as const,\n} as const;\n\n/** Categories of schema changes that may break existing operations. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type BreakingChangeType =\n (typeof BreakingChangeType)[keyof typeof BreakingChangeType];\n\n/** Categories of schema changes that may be dangerous for existing operations. */\nexport const DangerousChangeType = {\n VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM' as const,\n TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION' as const,\n OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED' as const,\n OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED' as const,\n IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED' as const,\n ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE' as const,\n INPUT_FIELD_DEFAULT_VALUE_CHANGE: 'INPUT_FIELD_DEFAULT_VALUE_CHANGE' as const,\n} as const;\n\n/** Categories of schema changes that may be dangerous for existing operations. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DangerousChangeType =\n (typeof DangerousChangeType)[keyof typeof DangerousChangeType];\n\n/** Categories of schema changes that are considered safe for existing operations. */\nexport const SafeChangeType = {\n DESCRIPTION_CHANGED: 'DESCRIPTION_CHANGED' as const,\n TYPE_ADDED: 'TYPE_ADDED' as const,\n OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED' as const,\n OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED' as const,\n DIRECTIVE_ADDED: 'DIRECTIVE_ADDED' as const,\n FIELD_ADDED: 'FIELD_ADDED' as const,\n DIRECTIVE_REPEATABLE_ADDED: 'DIRECTIVE_REPEATABLE_ADDED' as const,\n DIRECTIVE_LOCATION_ADDED: 'DIRECTIVE_LOCATION_ADDED' as const,\n OPTIONAL_DIRECTIVE_ARG_ADDED: 'OPTIONAL_DIRECTIVE_ARG_ADDED' as const,\n FIELD_CHANGED_KIND_SAFE: 'FIELD_CHANGED_KIND_SAFE' as const,\n ARG_CHANGED_KIND_SAFE: 'ARG_CHANGED_KIND_SAFE' as const,\n ARG_DEFAULT_VALUE_ADDED: 'ARG_DEFAULT_VALUE_ADDED' as const,\n INPUT_FIELD_DEFAULT_VALUE_ADDED: 'INPUT_FIELD_DEFAULT_VALUE_ADDED' as const,\n} as const;\n\n/** Categories of schema changes that are considered safe for existing operations. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type SafeChangeType =\n (typeof SafeChangeType)[keyof typeof SafeChangeType];\n\n/** Description of a schema change that may break existing operations. */\nexport interface BreakingChange {\n /** Specific kind of breaking schema change. */\n type: BreakingChangeType;\n /** Human-readable description of the breaking schema change. */\n description: string;\n}\n\n/** Description of a schema change that may be dangerous for existing operations. */\nexport interface DangerousChange {\n /** Specific kind of dangerous schema change. */\n type: DangerousChangeType;\n /** Human-readable description of the dangerous schema change. */\n description: string;\n}\n\n/** Description of a schema change that is considered safe for existing operations. */\nexport interface SafeChange {\n /** Specific kind of safe schema change. */\n type: SafeChangeType;\n /** Human-readable description of the safe schema change. */\n description: string;\n}\n\n/** Any schema change detected between two schemas. */\nexport type SchemaChange = SafeChange | DangerousChange | BreakingChange;\n\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of breaking changes covered by the other functions down below. This\n * deprecated wrapper will be removed in v18; use `findSchemaChanges()` instead\n * and filter for breaking changes.\n * @param oldSchema - Schema before the change.\n * @param newSchema - Schema after the change.\n * @returns Breaking changes between the two schemas.\n * @example\n * ```ts\n * import { buildSchema, findBreakingChanges } from 'graphql/utilities';\n *\n * const oldSchema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const newSchema = buildSchema(`\n * type Query {\n * hello: String\n * }\n * `);\n *\n * const changes = findBreakingChanges(oldSchema, newSchema);\n *\n * changes.map((change) => change.type); // => ['FIELD_REMOVED']\n * ```\n * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18.\n */\nexport function findBreakingChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n // @ts-expect-error\n return findSchemaChanges(oldSchema, newSchema).filter(\n (change) => change.type in BreakingChangeType,\n );\n}\n\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of potentially dangerous changes covered by the other functions down below.\n * This deprecated wrapper will be removed in v18; use `findSchemaChanges()`\n * instead and filter for dangerous changes.\n * @param oldSchema - Schema before the change.\n * @param newSchema - Schema after the change.\n * @returns Dangerous changes between the two schemas.\n * @example\n * ```ts\n * import { buildSchema, findDangerousChanges } from 'graphql/utilities';\n *\n * const oldSchema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n * const newSchema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const changes = findDangerousChanges(oldSchema, newSchema);\n *\n * changes.map((change) => change.type); // => ['VALUE_ADDED_TO_ENUM']\n * ```\n * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18.\n */\nexport function findDangerousChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n // @ts-expect-error\n return findSchemaChanges(oldSchema, newSchema).filter(\n (change) => change.type in DangerousChangeType,\n );\n}\n\n/**\n * Finds all schema changes between two schemas.\n * @param oldSchema - Schema before the change.\n * @param newSchema - Schema after the change.\n * @returns Safe, dangerous, and breaking changes between the two schemas.\n * @example\n * ```ts\n * import { buildSchema, findSchemaChanges } from 'graphql/utilities';\n *\n * const oldSchema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const newSchema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * farewell: String\n * }\n * `);\n *\n * const changes = findSchemaChanges(oldSchema, newSchema);\n *\n * changes.map((change) => change.type); // => ['OPTIONAL_ARG_ADDED', 'FIELD_ADDED']\n * ```\n */\nexport function findSchemaChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n return [\n ...findTypeChanges(oldSchema, newSchema),\n ...findDirectiveChanges(oldSchema, newSchema),\n ];\n}\n\nfunction findDirectiveChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n const schemaChanges = [];\n\n const directivesDiff = diff(\n oldSchema.getDirectives(),\n newSchema.getDirectives(),\n );\n\n for (const oldDirective of directivesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REMOVED,\n description: `Directive ${oldDirective} was removed.`,\n });\n }\n\n for (const newDirective of directivesDiff.added) {\n schemaChanges.push({\n type: SafeChangeType.DIRECTIVE_ADDED,\n description: `Directive @${newDirective.name} was added.`,\n });\n }\n\n for (const [oldDirective, newDirective] of directivesDiff.persisted) {\n const argsDiff = diff(oldDirective.args, newDirective.args);\n\n for (const newArg of argsDiff.added) {\n if (isRequiredArgument(newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,\n description: `A required argument ${newArg} was added.`,\n });\n } else {\n schemaChanges.push({\n type: SafeChangeType.OPTIONAL_DIRECTIVE_ARG_ADDED,\n description: `An optional argument @${oldDirective.name}(${newArg.name}:) was added.`,\n });\n }\n }\n\n for (const oldArg of argsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,\n description: `Argument ${oldArg} was removed.`,\n });\n }\n\n for (const [oldArg, newArg] of argsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldArg.type,\n newArg.type,\n );\n\n const oldDefaultValueStr = getDefaultValue(oldArg);\n const newDefaultValueStr = getDefaultValue(newArg);\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_CHANGED_KIND,\n description:\n `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` +\n `${String(oldArg.type)} to ${String(newArg.type)}.`,\n });\n } else if (oldDefaultValueStr !== undefined) {\n if (newDefaultValueStr === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `@${oldDirective.name}(${oldArg.name}:) defaultValue was removed.`,\n });\n } else if (oldDefaultValueStr !== newDefaultValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `@${oldDirective.name}(${oldArg.name}:) has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`,\n });\n }\n } else if (\n newDefaultValueStr !== undefined &&\n oldDefaultValueStr === undefined\n ) {\n schemaChanges.push({\n type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED,\n description: `@${oldDirective.name}(${oldArg.name}:) added a defaultValue ${newDefaultValueStr}.`,\n });\n } else if (oldArg.type.toString() !== newArg.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.ARG_CHANGED_KIND_SAFE,\n description:\n `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` +\n `${String(oldArg.type)} to ${String(newArg.type)}.`,\n });\n }\n\n if (oldArg.description !== newArg.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of @${oldDirective.name}(${oldDirective.name}) has changed to \"${newArg.description}\".`,\n });\n }\n }\n\n if (oldDirective.isRepeatable && !newDirective.isRepeatable) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED,\n description: `Repeatable flag was removed from ${oldDirective}.`,\n });\n } else if (newDirective.isRepeatable && !oldDirective.isRepeatable) {\n schemaChanges.push({\n type: SafeChangeType.DIRECTIVE_REPEATABLE_ADDED,\n description: `Repeatable flag was added to @${oldDirective.name}.`,\n });\n }\n\n if (oldDirective.description !== newDirective.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of @${oldDirective.name} has changed to \"${newDirective.description}\".`,\n });\n }\n\n for (const location of oldDirective.locations) {\n if (!newDirective.locations.includes(location)) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,\n description: `${location} was removed from ${oldDirective}.`,\n });\n }\n }\n\n for (const location of newDirective.locations) {\n if (!oldDirective.locations.includes(location)) {\n schemaChanges.push({\n type: SafeChangeType.DIRECTIVE_LOCATION_ADDED,\n description: `${location} was added to @${oldDirective.name}.`,\n });\n }\n }\n }\n\n return schemaChanges;\n}\n\nfunction findTypeChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n const schemaChanges = [];\n\n const typesDiff = diff(\n Object.values(oldSchema.getTypeMap()),\n Object.values(newSchema.getTypeMap()),\n );\n\n for (const oldType of typesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED,\n description: isSpecifiedScalarType(oldType)\n ? `Standard scalar ${oldType} was removed because it is not referenced anymore.`\n : `${oldType} was removed.`,\n });\n }\n\n for (const newType of typesDiff.added) {\n schemaChanges.push({\n type: SafeChangeType.TYPE_ADDED,\n description: `${newType} was added.`,\n });\n }\n\n for (const [oldType, newType] of typesDiff.persisted) {\n if (oldType.description !== newType.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of ${oldType.name} has changed to \"${newType.description}\".`,\n });\n }\n\n if (isEnumType(oldType) && isEnumType(newType)) {\n schemaChanges.push(...findEnumTypeChanges(oldType, newType));\n } else if (isUnionType(oldType) && isUnionType(newType)) {\n schemaChanges.push(...findUnionTypeChanges(oldType, newType));\n } else if (isInputObjectType(oldType) && isInputObjectType(newType)) {\n schemaChanges.push(...findInputObjectTypeChanges(oldType, newType));\n } else if (isObjectType(oldType) && isObjectType(newType)) {\n schemaChanges.push(\n ...findFieldChanges(oldType, newType),\n ...findImplementedInterfacesChanges(oldType, newType),\n );\n } else if (isInterfaceType(oldType) && isInterfaceType(newType)) {\n schemaChanges.push(\n ...findFieldChanges(oldType, newType),\n ...findImplementedInterfacesChanges(oldType, newType),\n );\n } else if (oldType.constructor !== newType.constructor) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_CHANGED_KIND,\n description: `${oldType} changed from ${typeKindName(\n oldType,\n )} to ${typeKindName(newType)}.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findInputObjectTypeChanges(\n oldType: GraphQLInputObjectType,\n newType: GraphQLInputObjectType,\n): Array {\n const schemaChanges = [];\n const fieldsDiff = diff(\n Object.values(oldType.getFields()),\n Object.values(newType.getFields()),\n );\n\n for (const newField of fieldsDiff.added) {\n if (isRequiredInputField(newField)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,\n description: `A required field ${newField} was added.`,\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,\n description: `An optional field ${newField} was added.`,\n });\n }\n }\n\n for (const oldField of fieldsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: `Field ${oldField} was removed.`,\n });\n }\n\n for (const [oldField, newField] of fieldsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldField.type,\n newField.type,\n );\n\n const oldDefaultValueStr = getDefaultValue(oldField);\n const newDefaultValueStr = getDefaultValue(newField);\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`,\n });\n } else if (oldDefaultValueStr !== undefined) {\n if (newDefaultValueStr === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE,\n description: `${oldField} defaultValue was removed.`,\n });\n } else if (oldDefaultValueStr !== newDefaultValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE,\n description: `${oldField} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`,\n });\n }\n } else if (\n newDefaultValueStr !== undefined &&\n oldDefaultValueStr === undefined\n ) {\n schemaChanges.push({\n type: SafeChangeType.INPUT_FIELD_DEFAULT_VALUE_ADDED,\n description: `${oldField} added a defaultValue ${newDefaultValueStr}.`,\n });\n } else if (oldField.type.toString() !== newField.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.FIELD_CHANGED_KIND_SAFE,\n description:\n `Field ${oldType}.${oldField.name} changed type from ` +\n `${String(oldField.type)} to ${String(newField.type)}.`,\n });\n }\n\n if (oldField.description !== newField.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of input-field ${newType}.${newField.name} has changed to \"${newField.description}\".`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findUnionTypeChanges(\n oldType: GraphQLUnionType,\n newType: GraphQLUnionType,\n): Array {\n const schemaChanges = [];\n const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes());\n\n for (const newPossibleType of possibleTypesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.TYPE_ADDED_TO_UNION,\n description: `${newPossibleType} was added to union type ${oldType}.`,\n });\n }\n\n for (const oldPossibleType of possibleTypesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,\n description: `${oldPossibleType} was removed from union type ${oldType}.`,\n });\n }\n\n return schemaChanges;\n}\n\nfunction findEnumTypeChanges(\n oldType: GraphQLEnumType,\n newType: GraphQLEnumType,\n): Array {\n const schemaChanges = [];\n const valuesDiff = diff(oldType.getValues(), newType.getValues());\n\n for (const newValue of valuesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.VALUE_ADDED_TO_ENUM,\n description: `Enum value ${newValue} was added.`,\n });\n }\n\n for (const oldValue of valuesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,\n description: `Enum value ${oldValue} was removed.`,\n });\n }\n\n for (const [oldValue, newValue] of valuesDiff.persisted) {\n if (oldValue.description !== newValue.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of enum value ${oldType}.${oldValue.name} has changed to \"${newValue.description}\".`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findImplementedInterfacesChanges(\n oldType: GraphQLObjectType | GraphQLInterfaceType,\n newType: GraphQLObjectType | GraphQLInterfaceType,\n): Array {\n const schemaChanges = [];\n const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces());\n\n for (const newInterface of interfacesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED,\n description: `${newInterface} added to interfaces implemented by ${oldType}.`,\n });\n }\n\n for (const oldInterface of interfacesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED,\n description: `${oldType} no longer implements interface ${oldInterface}.`,\n });\n }\n\n return schemaChanges;\n}\n\nfunction findFieldChanges(\n oldType: GraphQLObjectType | GraphQLInterfaceType,\n newType: GraphQLObjectType | GraphQLInterfaceType,\n): Array {\n const schemaChanges = [];\n const fieldsDiff = diff(\n Object.values(oldType.getFields()),\n Object.values(newType.getFields()),\n );\n\n for (const oldField of fieldsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: `Field ${oldField} was removed.`,\n });\n }\n\n for (const newField of fieldsDiff.added) {\n schemaChanges.push({\n type: SafeChangeType.FIELD_ADDED,\n description: `Field ${oldType}.${newField.name} was added.`,\n });\n }\n\n for (const [oldField, newField] of fieldsDiff.persisted) {\n schemaChanges.push(...findArgChanges(oldField, newField));\n\n const isSafe = isChangeSafeForObjectOrInterfaceField(\n oldField.type,\n newField.type,\n );\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`,\n });\n } else if (oldField.type.toString() !== newField.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.FIELD_CHANGED_KIND_SAFE,\n description:\n `Field ${oldType}.${oldField.name} changed type from ` +\n `${String(oldField.type)} to ${String(newField.type)}.`,\n });\n }\n\n if (oldField.description !== newField.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of field ${oldType}.${oldField.name} has changed to \"${newField.description}\".`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findArgChanges(\n oldField: GraphQLField,\n newField: GraphQLField,\n): Array {\n const schemaChanges = [];\n const argsDiff = diff(oldField.args, newField.args);\n\n for (const oldArg of argsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_REMOVED,\n description: `Argument ${oldArg} was removed.`,\n });\n }\n\n for (const [oldArg, newArg] of argsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldArg.type,\n newArg.type,\n );\n\n const oldDefaultValueStr = getDefaultValue(oldArg);\n const newDefaultValueStr = getDefaultValue(newArg);\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_CHANGED_KIND,\n description: `Argument ${newArg} has changed type from ${oldArg.type} to ${newArg.type}.`,\n });\n } else if (oldDefaultValueStr !== undefined) {\n if (newDefaultValueStr === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `${oldArg} defaultValue was removed.`,\n });\n } else if (oldDefaultValueStr !== newDefaultValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `${oldArg} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`,\n });\n }\n } else if (\n newDefaultValueStr !== undefined &&\n oldDefaultValueStr === undefined\n ) {\n schemaChanges.push({\n type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED,\n description: `${oldArg} added a defaultValue ${newDefaultValueStr}.`,\n });\n } else if (oldArg.type.toString() !== newArg.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.ARG_CHANGED_KIND_SAFE,\n description:\n `Argument ${oldArg} has changed type from ` +\n `${String(oldArg.type)} to ${String(newArg.type)}.`,\n });\n }\n\n if (oldArg.description !== newArg.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of argument ${oldArg} has changed to \"${newArg.description}\".`,\n });\n }\n }\n\n for (const newArg of argsDiff.added) {\n if (isRequiredArgument(newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_ARG_ADDED,\n description: `A required argument ${newArg} was added.`,\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_ARG_ADDED,\n description: `An optional argument ${newArg} was added.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction isChangeSafeForObjectOrInterfaceField(\n oldType: GraphQLType,\n newType: GraphQLType,\n): boolean {\n if (isListType(oldType)) {\n return (\n // if they're both lists, make sure the underlying types are compatible\n (isListType(newType) &&\n isChangeSafeForObjectOrInterfaceField(\n oldType.ofType,\n newType.ofType,\n )) ||\n // moving from nullable to non-null of the same underlying type is safe\n (isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))\n );\n }\n\n if (isNonNullType(oldType)) {\n // if they're both non-null, make sure the underlying types are compatible\n return (\n isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)\n );\n }\n\n return (\n // if they're both named types, see if their names are equivalent\n (isNamedType(newType) && oldType.name === newType.name) ||\n // moving from nullable to non-null of the same underlying type is safe\n (isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))\n );\n}\n\nfunction isChangeSafeForInputObjectFieldOrFieldArg(\n oldType: GraphQLType,\n newType: GraphQLType,\n): boolean {\n if (isListType(oldType)) {\n // if they're both lists, make sure the underlying types are compatible\n return (\n isListType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)\n );\n }\n\n if (isNonNullType(oldType)) {\n return (\n // if they're both non-null, make sure the underlying types are\n // compatible\n (isNonNullType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(\n oldType.ofType,\n newType.ofType,\n )) ||\n // moving from non-null to nullable of the same underlying type is safe\n (!isNonNullType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType))\n );\n }\n\n // if they're both named types, see if their names are equivalent\n return isNamedType(newType) && oldType.name === newType.name;\n}\n\nfunction typeKindName(type: GraphQLNamedType): string {\n if (isScalarType(type)) {\n return 'a Scalar type';\n }\n if (isObjectType(type)) {\n return 'an Object type';\n }\n if (isInterfaceType(type)) {\n return 'an Interface type';\n }\n if (isUnionType(type)) {\n return 'a Union type';\n }\n if (isEnumType(type)) {\n return 'an Enum type';\n }\n if (isInputObjectType(type)) {\n return 'an Input type';\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered.\n invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\n// Since we looking only for client's observable changes we should\n// compare default values in the same representation as they are\n// represented inside introspection.\nfunction getDefaultValue(\n argOrInputField: GraphQLArgument | GraphQLInputField,\n): string | undefined {\n const ast = getDefaultValueAST(argOrInputField);\n if (ast) {\n return print(sortValueNode(ast));\n }\n}\n\nfunction diff(\n oldArray: ReadonlyArray,\n newArray: ReadonlyArray,\n): {\n added: ReadonlyArray;\n removed: ReadonlyArray;\n persisted: ReadonlyArray<[T, T]>;\n} {\n const added: Array = [];\n const removed: Array = [];\n const persisted: Array<[T, T]> = [];\n\n const oldMap = keyMap(oldArray, ({ name }) => name);\n const newMap = keyMap(newArray, ({ name }) => name);\n\n for (const oldItem of oldArray) {\n const newItem = newMap[oldItem.name];\n if (newItem === undefined) {\n removed.push(oldItem);\n } else {\n persisted.push([oldItem, newItem]);\n }\n }\n\n for (const newItem of newArray) {\n if (oldMap[newItem.name] === undefined) {\n added.push(newItem);\n }\n }\n\n return { added, persisted, removed };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs new file mode 100644 index 00000000..6751f54b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs @@ -0,0 +1,547 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { keyMap } from "../jsutils/keyMap.mjs"; +import { print } from "../language/printer.mjs"; +import { isEnumType, isInputObjectType, isInterfaceType, isListType, isNamedType, isNonNullType, isObjectType, isRequiredArgument, isRequiredInputField, isScalarType, isUnionType, } from "../type/definition.mjs"; +import { isSpecifiedScalarType } from "../type/scalars.mjs"; +import { getDefaultValueAST } from "./getDefaultValueAST.mjs"; +import { sortValueNode } from "./sortValueNode.mjs"; +export const BreakingChangeType = { + TYPE_REMOVED: 'TYPE_REMOVED', + TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', + TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', + VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', + REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED', + IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED', + FIELD_REMOVED: 'FIELD_REMOVED', + FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', + REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED', + ARG_REMOVED: 'ARG_REMOVED', + ARG_CHANGED_KIND: 'ARG_CHANGED_KIND', + DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED', + DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED', + REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED', + DIRECTIVE_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED', + DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED', +}; +export const DangerousChangeType = { + VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM', + TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION', + OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', + IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED', + ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE', + INPUT_FIELD_DEFAULT_VALUE_CHANGE: 'INPUT_FIELD_DEFAULT_VALUE_CHANGE', +}; +export const SafeChangeType = { + DESCRIPTION_CHANGED: 'DESCRIPTION_CHANGED', + TYPE_ADDED: 'TYPE_ADDED', + OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', + DIRECTIVE_ADDED: 'DIRECTIVE_ADDED', + FIELD_ADDED: 'FIELD_ADDED', + DIRECTIVE_REPEATABLE_ADDED: 'DIRECTIVE_REPEATABLE_ADDED', + DIRECTIVE_LOCATION_ADDED: 'DIRECTIVE_LOCATION_ADDED', + OPTIONAL_DIRECTIVE_ARG_ADDED: 'OPTIONAL_DIRECTIVE_ARG_ADDED', + FIELD_CHANGED_KIND_SAFE: 'FIELD_CHANGED_KIND_SAFE', + ARG_CHANGED_KIND_SAFE: 'ARG_CHANGED_KIND_SAFE', + ARG_DEFAULT_VALUE_ADDED: 'ARG_DEFAULT_VALUE_ADDED', + INPUT_FIELD_DEFAULT_VALUE_ADDED: 'INPUT_FIELD_DEFAULT_VALUE_ADDED', +}; +export function findBreakingChanges(oldSchema, newSchema) { + return findSchemaChanges(oldSchema, newSchema).filter((change) => change.type in BreakingChangeType); +} +export function findDangerousChanges(oldSchema, newSchema) { + return findSchemaChanges(oldSchema, newSchema).filter((change) => change.type in DangerousChangeType); +} +export function findSchemaChanges(oldSchema, newSchema) { + return [ + ...findTypeChanges(oldSchema, newSchema), + ...findDirectiveChanges(oldSchema, newSchema), + ]; +} +function findDirectiveChanges(oldSchema, newSchema) { + const schemaChanges = []; + const directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives()); + for (const oldDirective of directivesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: `Directive ${oldDirective} was removed.`, + }); + } + for (const newDirective of directivesDiff.added) { + schemaChanges.push({ + type: SafeChangeType.DIRECTIVE_ADDED, + description: `Directive @${newDirective.name} was added.`, + }); + } + for (const [oldDirective, newDirective] of directivesDiff.persisted) { + const argsDiff = diff(oldDirective.args, newDirective.args); + for (const newArg of argsDiff.added) { + if (isRequiredArgument(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: `A required argument ${newArg} was added.`, + }); + } + else { + schemaChanges.push({ + type: SafeChangeType.OPTIONAL_DIRECTIVE_ARG_ADDED, + description: `An optional argument @${oldDirective.name}(${newArg.name}:) was added.`, + }); + } + } + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: `Argument ${oldArg} was removed.`, + }); + } + for (const [oldArg, newArg] of argsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type); + const oldDefaultValueStr = getDefaultValue(oldArg); + const newDefaultValueStr = getDefaultValue(newArg); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.ARG_CHANGED_KIND, + description: `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } + else if (oldDefaultValueStr !== undefined) { + if (newDefaultValueStr === undefined) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `@${oldDirective.name}(${oldArg.name}:) defaultValue was removed.`, + }); + } + else if (oldDefaultValueStr !== newDefaultValueStr) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `@${oldDirective.name}(${oldArg.name}:) has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`, + }); + } + } + else if (newDefaultValueStr !== undefined && + oldDefaultValueStr === undefined) { + schemaChanges.push({ + type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED, + description: `@${oldDirective.name}(${oldArg.name}:) added a defaultValue ${newDefaultValueStr}.`, + }); + } + else if (oldArg.type.toString() !== newArg.type.toString()) { + schemaChanges.push({ + type: SafeChangeType.ARG_CHANGED_KIND_SAFE, + description: `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } + if (oldArg.description !== newArg.description) { + schemaChanges.push({ + type: SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of @${oldDirective.name}(${oldDirective.name}) has changed to "${newArg.description}".`, + }); + } + } + if (oldDirective.isRepeatable && !newDirective.isRepeatable) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, + description: `Repeatable flag was removed from ${oldDirective}.`, + }); + } + else if (newDirective.isRepeatable && !oldDirective.isRepeatable) { + schemaChanges.push({ + type: SafeChangeType.DIRECTIVE_REPEATABLE_ADDED, + description: `Repeatable flag was added to @${oldDirective.name}.`, + }); + } + if (oldDirective.description !== newDirective.description) { + schemaChanges.push({ + type: SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of @${oldDirective.name} has changed to "${newDirective.description}".`, + }); + } + for (const location of oldDirective.locations) { + if (!newDirective.locations.includes(location)) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: `${location} was removed from ${oldDirective}.`, + }); + } + } + for (const location of newDirective.locations) { + if (!oldDirective.locations.includes(location)) { + schemaChanges.push({ + type: SafeChangeType.DIRECTIVE_LOCATION_ADDED, + description: `${location} was added to @${oldDirective.name}.`, + }); + } + } + } + return schemaChanges; +} +function findTypeChanges(oldSchema, newSchema) { + const schemaChanges = []; + const typesDiff = diff(Object.values(oldSchema.getTypeMap()), Object.values(newSchema.getTypeMap())); + for (const oldType of typesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED, + description: isSpecifiedScalarType(oldType) + ? `Standard scalar ${oldType} was removed because it is not referenced anymore.` + : `${oldType} was removed.`, + }); + } + for (const newType of typesDiff.added) { + schemaChanges.push({ + type: SafeChangeType.TYPE_ADDED, + description: `${newType} was added.`, + }); + } + for (const [oldType, newType] of typesDiff.persisted) { + if (oldType.description !== newType.description) { + schemaChanges.push({ + type: SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of ${oldType.name} has changed to "${newType.description}".`, + }); + } + if (isEnumType(oldType) && isEnumType(newType)) { + schemaChanges.push(...findEnumTypeChanges(oldType, newType)); + } + else if (isUnionType(oldType) && isUnionType(newType)) { + schemaChanges.push(...findUnionTypeChanges(oldType, newType)); + } + else if (isInputObjectType(oldType) && isInputObjectType(newType)) { + schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); + } + else if (isObjectType(oldType) && isObjectType(newType)) { + schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); + } + else if (isInterfaceType(oldType) && isInterfaceType(newType)) { + schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType)); + } + else if (oldType.constructor !== newType.constructor) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: `${oldType} changed from ${typeKindName(oldType)} to ${typeKindName(newType)}.`, + }); + } + } + return schemaChanges; +} +function findInputObjectTypeChanges(oldType, newType) { + const schemaChanges = []; + const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); + for (const newField of fieldsDiff.added) { + if (isRequiredInputField(newField)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: `A required field ${newField} was added.`, + }); + } + else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: `An optional field ${newField} was added.`, + }); + } + } + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `Field ${oldField} was removed.`, + }); + } + for (const [oldField, newField] of fieldsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldField.type, newField.type); + const oldDefaultValueStr = getDefaultValue(oldField); + const newDefaultValueStr = getDefaultValue(newField); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`, + }); + } + else if (oldDefaultValueStr !== undefined) { + if (newDefaultValueStr === undefined) { + schemaChanges.push({ + type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE, + description: `${oldField} defaultValue was removed.`, + }); + } + else if (oldDefaultValueStr !== newDefaultValueStr) { + schemaChanges.push({ + type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE, + description: `${oldField} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`, + }); + } + } + else if (newDefaultValueStr !== undefined && + oldDefaultValueStr === undefined) { + schemaChanges.push({ + type: SafeChangeType.INPUT_FIELD_DEFAULT_VALUE_ADDED, + description: `${oldField} added a defaultValue ${newDefaultValueStr}.`, + }); + } + else if (oldField.type.toString() !== newField.type.toString()) { + schemaChanges.push({ + type: SafeChangeType.FIELD_CHANGED_KIND_SAFE, + description: `Field ${oldType}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + if (oldField.description !== newField.description) { + schemaChanges.push({ + type: SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of input-field ${newType}.${newField.name} has changed to "${newField.description}".`, + }); + } + } + return schemaChanges; +} +function findUnionTypeChanges(oldType, newType) { + const schemaChanges = []; + const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); + for (const newPossibleType of possibleTypesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: `${newPossibleType} was added to union type ${oldType}.`, + }); + } + for (const oldPossibleType of possibleTypesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: `${oldPossibleType} was removed from union type ${oldType}.`, + }); + } + return schemaChanges; +} +function findEnumTypeChanges(oldType, newType) { + const schemaChanges = []; + const valuesDiff = diff(oldType.getValues(), newType.getValues()); + for (const newValue of valuesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: `Enum value ${newValue} was added.`, + }); + } + for (const oldValue of valuesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: `Enum value ${oldValue} was removed.`, + }); + } + for (const [oldValue, newValue] of valuesDiff.persisted) { + if (oldValue.description !== newValue.description) { + schemaChanges.push({ + type: SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of enum value ${oldType}.${oldValue.name} has changed to "${newValue.description}".`, + }); + } + } + return schemaChanges; +} +function findImplementedInterfacesChanges(oldType, newType) { + const schemaChanges = []; + const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); + for (const newInterface of interfacesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, + description: `${newInterface} added to interfaces implemented by ${oldType}.`, + }); + } + for (const oldInterface of interfacesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, + description: `${oldType} no longer implements interface ${oldInterface}.`, + }); + } + return schemaChanges; +} +function findFieldChanges(oldType, newType) { + const schemaChanges = []; + const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields())); + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `Field ${oldField} was removed.`, + }); + } + for (const newField of fieldsDiff.added) { + schemaChanges.push({ + type: SafeChangeType.FIELD_ADDED, + description: `Field ${oldType}.${newField.name} was added.`, + }); + } + for (const [oldField, newField] of fieldsDiff.persisted) { + schemaChanges.push(...findArgChanges(oldField, newField)); + const isSafe = isChangeSafeForObjectOrInterfaceField(oldField.type, newField.type); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`, + }); + } + else if (oldField.type.toString() !== newField.type.toString()) { + schemaChanges.push({ + type: SafeChangeType.FIELD_CHANGED_KIND_SAFE, + description: `Field ${oldType}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + if (oldField.description !== newField.description) { + schemaChanges.push({ + type: SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of field ${oldType}.${oldField.name} has changed to "${newField.description}".`, + }); + } + } + return schemaChanges; +} +function findArgChanges(oldField, newField) { + const schemaChanges = []; + const argsDiff = diff(oldField.args, newField.args); + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.ARG_REMOVED, + description: `Argument ${oldArg} was removed.`, + }); + } + for (const [oldArg, newArg] of argsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type); + const oldDefaultValueStr = getDefaultValue(oldArg); + const newDefaultValueStr = getDefaultValue(newArg); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.ARG_CHANGED_KIND, + description: `Argument ${newArg} has changed type from ${oldArg.type} to ${newArg.type}.`, + }); + } + else if (oldDefaultValueStr !== undefined) { + if (newDefaultValueStr === undefined) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldArg} defaultValue was removed.`, + }); + } + else if (oldDefaultValueStr !== newDefaultValueStr) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldArg} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`, + }); + } + } + else if (newDefaultValueStr !== undefined && + oldDefaultValueStr === undefined) { + schemaChanges.push({ + type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED, + description: `${oldArg} added a defaultValue ${newDefaultValueStr}.`, + }); + } + else if (oldArg.type.toString() !== newArg.type.toString()) { + schemaChanges.push({ + type: SafeChangeType.ARG_CHANGED_KIND_SAFE, + description: `Argument ${oldArg} has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } + if (oldArg.description !== newArg.description) { + schemaChanges.push({ + type: SafeChangeType.DESCRIPTION_CHANGED, + description: `Description of argument ${oldArg} has changed to "${newArg.description}".`, + }); + } + } + for (const newArg of argsDiff.added) { + if (isRequiredArgument(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_ARG_ADDED, + description: `A required argument ${newArg} was added.`, + }); + } + else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_ARG_ADDED, + description: `An optional argument ${newArg} was added.`, + }); + } + } + return schemaChanges; +} +function isChangeSafeForObjectOrInterfaceField(oldType, newType) { + if (isListType(oldType)) { + return ((isListType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)) || + (isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))); + } + if (isNonNullType(oldType)) { + return (isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)); + } + return ((isNamedType(newType) && oldType.name === newType.name) || + (isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))); +} +function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { + if (isListType(oldType)) { + return (isListType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)); + } + if (isNonNullType(oldType)) { + return ((isNonNullType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)) || + (!isNonNullType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType))); + } + return isNamedType(newType) && oldType.name === newType.name; +} +function typeKindName(type) { + if (isScalarType(type)) { + return 'a Scalar type'; + } + if (isObjectType(type)) { + return 'an Object type'; + } + if (isInterfaceType(type)) { + return 'an Interface type'; + } + if (isUnionType(type)) { + return 'a Union type'; + } + if (isEnumType(type)) { + return 'an Enum type'; + } + if (isInputObjectType(type)) { + return 'an Input type'; + } + invariant(false, 'Unexpected type: ' + inspect(type)); +} +function getDefaultValue(argOrInputField) { + const ast = getDefaultValueAST(argOrInputField); + if (ast) { + return print(sortValueNode(ast)); + } +} +function diff(oldArray, newArray) { + const added = []; + const removed = []; + const persisted = []; + const oldMap = keyMap(oldArray, ({ name }) => name); + const newMap = keyMap(newArray, ({ name }) => name); + for (const oldItem of oldArray) { + const newItem = newMap[oldItem.name]; + if (newItem === undefined) { + removed.push(oldItem); + } + else { + persisted.push([oldItem, newItem]); + } + } + for (const newItem of newArray) { + if (oldMap[newItem.name] === undefined) { + added.push(newItem); + } + } + return { added, persisted, removed }; +} +//# sourceMappingURL=findSchemaChanges.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs.map new file mode 100644 index 00000000..f85920ef --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/findSchemaChanges.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"findSchemaChanges.js","sourceRoot":"","sources":["../../src/utilities/findSchemaChanges.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AACpD,OAAO,EAAE,MAAM,EAAE,8BAA6B;AAE9C,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAc/C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,WAAW,GACZ,+BAA8B;AAC/B,OAAO,EAAE,qBAAqB,EAAE,4BAA2B;AAG3D,OAAO,EAAE,kBAAkB,EAAE,iCAAgC;AAC7D,OAAO,EAAE,aAAa,EAAE,4BAA2B;AAGnD,MAAM,CAAC,MAAM,kBAAkB,GAAG;I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AAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEpD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC","sourcesContent":["/** @category Schema Changes */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\n\nimport { print } from '../language/printer.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLEnumType,\n GraphQLField,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n GraphQLType,\n GraphQLUnionType,\n} from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNamedType,\n isNonNullType,\n isObjectType,\n isRequiredArgument,\n isRequiredInputField,\n isScalarType,\n isUnionType,\n} from '../type/definition.ts';\nimport { isSpecifiedScalarType } from '../type/scalars.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { getDefaultValueAST } from './getDefaultValueAST.ts';\nimport { sortValueNode } from './sortValueNode.ts';\n\n/** Categories of schema changes that may break existing operations. */\nexport const BreakingChangeType = {\n TYPE_REMOVED: 'TYPE_REMOVED' as const,\n TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND' as const,\n TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION' as const,\n VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM' as const,\n REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED' as const,\n IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED' as const,\n FIELD_REMOVED: 'FIELD_REMOVED' as const,\n FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND' as const,\n REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED' as const,\n ARG_REMOVED: 'ARG_REMOVED' as const,\n ARG_CHANGED_KIND: 'ARG_CHANGED_KIND' as const,\n DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED' as const,\n DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED' as const,\n REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED' as const,\n DIRECTIVE_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED' as const,\n DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED' as const,\n} as const;\n\n/** Categories of schema changes that may break existing operations. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type BreakingChangeType =\n (typeof BreakingChangeType)[keyof typeof BreakingChangeType];\n\n/** Categories of schema changes that may be dangerous for existing operations. */\nexport const DangerousChangeType = {\n VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM' as const,\n TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION' as const,\n OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED' as const,\n OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED' as const,\n IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED' as const,\n ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE' as const,\n INPUT_FIELD_DEFAULT_VALUE_CHANGE: 'INPUT_FIELD_DEFAULT_VALUE_CHANGE' as const,\n} as const;\n\n/** Categories of schema changes that may be dangerous for existing operations. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DangerousChangeType =\n (typeof DangerousChangeType)[keyof typeof DangerousChangeType];\n\n/** Categories of schema changes that are considered safe for existing operations. */\nexport const SafeChangeType = {\n DESCRIPTION_CHANGED: 'DESCRIPTION_CHANGED' as const,\n TYPE_ADDED: 'TYPE_ADDED' as const,\n OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED' as const,\n OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED' as const,\n DIRECTIVE_ADDED: 'DIRECTIVE_ADDED' as const,\n FIELD_ADDED: 'FIELD_ADDED' as const,\n DIRECTIVE_REPEATABLE_ADDED: 'DIRECTIVE_REPEATABLE_ADDED' as const,\n DIRECTIVE_LOCATION_ADDED: 'DIRECTIVE_LOCATION_ADDED' as const,\n OPTIONAL_DIRECTIVE_ARG_ADDED: 'OPTIONAL_DIRECTIVE_ARG_ADDED' as const,\n FIELD_CHANGED_KIND_SAFE: 'FIELD_CHANGED_KIND_SAFE' as const,\n ARG_CHANGED_KIND_SAFE: 'ARG_CHANGED_KIND_SAFE' as const,\n ARG_DEFAULT_VALUE_ADDED: 'ARG_DEFAULT_VALUE_ADDED' as const,\n INPUT_FIELD_DEFAULT_VALUE_ADDED: 'INPUT_FIELD_DEFAULT_VALUE_ADDED' as const,\n} as const;\n\n/** Categories of schema changes that are considered safe for existing operations. */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type SafeChangeType =\n (typeof SafeChangeType)[keyof typeof SafeChangeType];\n\n/** Description of a schema change that may break existing operations. */\nexport interface BreakingChange {\n /** Specific kind of breaking schema change. */\n type: BreakingChangeType;\n /** Human-readable description of the breaking schema change. */\n description: string;\n}\n\n/** Description of a schema change that may be dangerous for existing operations. */\nexport interface DangerousChange {\n /** Specific kind of dangerous schema change. */\n type: DangerousChangeType;\n /** Human-readable description of the dangerous schema change. */\n description: string;\n}\n\n/** Description of a schema change that is considered safe for existing operations. */\nexport interface SafeChange {\n /** Specific kind of safe schema change. */\n type: SafeChangeType;\n /** Human-readable description of the safe schema change. */\n description: string;\n}\n\n/** Any schema change detected between two schemas. */\nexport type SchemaChange = SafeChange | DangerousChange | BreakingChange;\n\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of breaking changes covered by the other functions down below. This\n * deprecated wrapper will be removed in v18; use `findSchemaChanges()` instead\n * and filter for breaking changes.\n * @param oldSchema - Schema before the change.\n * @param newSchema - Schema after the change.\n * @returns Breaking changes between the two schemas.\n * @example\n * ```ts\n * import { buildSchema, findBreakingChanges } from 'graphql/utilities';\n *\n * const oldSchema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const newSchema = buildSchema(`\n * type Query {\n * hello: String\n * }\n * `);\n *\n * const changes = findBreakingChanges(oldSchema, newSchema);\n *\n * changes.map((change) => change.type); // => ['FIELD_REMOVED']\n * ```\n * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18.\n */\nexport function findBreakingChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n // @ts-expect-error\n return findSchemaChanges(oldSchema, newSchema).filter(\n (change) => change.type in BreakingChangeType,\n );\n}\n\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of potentially dangerous changes covered by the other functions down below.\n * This deprecated wrapper will be removed in v18; use `findSchemaChanges()`\n * instead and filter for dangerous changes.\n * @param oldSchema - Schema before the change.\n * @param newSchema - Schema after the change.\n * @returns Dangerous changes between the two schemas.\n * @example\n * ```ts\n * import { buildSchema, findDangerousChanges } from 'graphql/utilities';\n *\n * const oldSchema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n * const newSchema = buildSchema(`\n * enum Episode {\n * NEW_HOPE\n * EMPIRE\n * }\n *\n * type Query {\n * episode: Episode\n * }\n * `);\n *\n * const changes = findDangerousChanges(oldSchema, newSchema);\n *\n * changes.map((change) => change.type); // => ['VALUE_ADDED_TO_ENUM']\n * ```\n * @deprecated Please use `findSchemaChanges` instead. Will be removed in v18.\n */\nexport function findDangerousChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n // @ts-expect-error\n return findSchemaChanges(oldSchema, newSchema).filter(\n (change) => change.type in DangerousChangeType,\n );\n}\n\n/**\n * Finds all schema changes between two schemas.\n * @param oldSchema - Schema before the change.\n * @param newSchema - Schema after the change.\n * @returns Safe, dangerous, and breaking changes between the two schemas.\n * @example\n * ```ts\n * import { buildSchema, findSchemaChanges } from 'graphql/utilities';\n *\n * const oldSchema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const newSchema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * farewell: String\n * }\n * `);\n *\n * const changes = findSchemaChanges(oldSchema, newSchema);\n *\n * changes.map((change) => change.type); // => ['OPTIONAL_ARG_ADDED', 'FIELD_ADDED']\n * ```\n */\nexport function findSchemaChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n return [\n ...findTypeChanges(oldSchema, newSchema),\n ...findDirectiveChanges(oldSchema, newSchema),\n ];\n}\n\nfunction findDirectiveChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n const schemaChanges = [];\n\n const directivesDiff = diff(\n oldSchema.getDirectives(),\n newSchema.getDirectives(),\n );\n\n for (const oldDirective of directivesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REMOVED,\n description: `Directive ${oldDirective} was removed.`,\n });\n }\n\n for (const newDirective of directivesDiff.added) {\n schemaChanges.push({\n type: SafeChangeType.DIRECTIVE_ADDED,\n description: `Directive @${newDirective.name} was added.`,\n });\n }\n\n for (const [oldDirective, newDirective] of directivesDiff.persisted) {\n const argsDiff = diff(oldDirective.args, newDirective.args);\n\n for (const newArg of argsDiff.added) {\n if (isRequiredArgument(newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,\n description: `A required argument ${newArg} was added.`,\n });\n } else {\n schemaChanges.push({\n type: SafeChangeType.OPTIONAL_DIRECTIVE_ARG_ADDED,\n description: `An optional argument @${oldDirective.name}(${newArg.name}:) was added.`,\n });\n }\n }\n\n for (const oldArg of argsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,\n description: `Argument ${oldArg} was removed.`,\n });\n }\n\n for (const [oldArg, newArg] of argsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldArg.type,\n newArg.type,\n );\n\n const oldDefaultValueStr = getDefaultValue(oldArg);\n const newDefaultValueStr = getDefaultValue(newArg);\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_CHANGED_KIND,\n description:\n `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` +\n `${String(oldArg.type)} to ${String(newArg.type)}.`,\n });\n } else if (oldDefaultValueStr !== undefined) {\n if (newDefaultValueStr === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `@${oldDirective.name}(${oldArg.name}:) defaultValue was removed.`,\n });\n } else if (oldDefaultValueStr !== newDefaultValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `@${oldDirective.name}(${oldArg.name}:) has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`,\n });\n }\n } else if (\n newDefaultValueStr !== undefined &&\n oldDefaultValueStr === undefined\n ) {\n schemaChanges.push({\n type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED,\n description: `@${oldDirective.name}(${oldArg.name}:) added a defaultValue ${newDefaultValueStr}.`,\n });\n } else if (oldArg.type.toString() !== newArg.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.ARG_CHANGED_KIND_SAFE,\n description:\n `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ` +\n `${String(oldArg.type)} to ${String(newArg.type)}.`,\n });\n }\n\n if (oldArg.description !== newArg.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of @${oldDirective.name}(${oldDirective.name}) has changed to \"${newArg.description}\".`,\n });\n }\n }\n\n if (oldDirective.isRepeatable && !newDirective.isRepeatable) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED,\n description: `Repeatable flag was removed from ${oldDirective}.`,\n });\n } else if (newDirective.isRepeatable && !oldDirective.isRepeatable) {\n schemaChanges.push({\n type: SafeChangeType.DIRECTIVE_REPEATABLE_ADDED,\n description: `Repeatable flag was added to @${oldDirective.name}.`,\n });\n }\n\n if (oldDirective.description !== newDirective.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of @${oldDirective.name} has changed to \"${newDirective.description}\".`,\n });\n }\n\n for (const location of oldDirective.locations) {\n if (!newDirective.locations.includes(location)) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,\n description: `${location} was removed from ${oldDirective}.`,\n });\n }\n }\n\n for (const location of newDirective.locations) {\n if (!oldDirective.locations.includes(location)) {\n schemaChanges.push({\n type: SafeChangeType.DIRECTIVE_LOCATION_ADDED,\n description: `${location} was added to @${oldDirective.name}.`,\n });\n }\n }\n }\n\n return schemaChanges;\n}\n\nfunction findTypeChanges(\n oldSchema: GraphQLSchema,\n newSchema: GraphQLSchema,\n): Array {\n const schemaChanges = [];\n\n const typesDiff = diff(\n Object.values(oldSchema.getTypeMap()),\n Object.values(newSchema.getTypeMap()),\n );\n\n for (const oldType of typesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED,\n description: isSpecifiedScalarType(oldType)\n ? `Standard scalar ${oldType} was removed because it is not referenced anymore.`\n : `${oldType} was removed.`,\n });\n }\n\n for (const newType of typesDiff.added) {\n schemaChanges.push({\n type: SafeChangeType.TYPE_ADDED,\n description: `${newType} was added.`,\n });\n }\n\n for (const [oldType, newType] of typesDiff.persisted) {\n if (oldType.description !== newType.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of ${oldType.name} has changed to \"${newType.description}\".`,\n });\n }\n\n if (isEnumType(oldType) && isEnumType(newType)) {\n schemaChanges.push(...findEnumTypeChanges(oldType, newType));\n } else if (isUnionType(oldType) && isUnionType(newType)) {\n schemaChanges.push(...findUnionTypeChanges(oldType, newType));\n } else if (isInputObjectType(oldType) && isInputObjectType(newType)) {\n schemaChanges.push(...findInputObjectTypeChanges(oldType, newType));\n } else if (isObjectType(oldType) && isObjectType(newType)) {\n schemaChanges.push(\n ...findFieldChanges(oldType, newType),\n ...findImplementedInterfacesChanges(oldType, newType),\n );\n } else if (isInterfaceType(oldType) && isInterfaceType(newType)) {\n schemaChanges.push(\n ...findFieldChanges(oldType, newType),\n ...findImplementedInterfacesChanges(oldType, newType),\n );\n } else if (oldType.constructor !== newType.constructor) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_CHANGED_KIND,\n description: `${oldType} changed from ${typeKindName(\n oldType,\n )} to ${typeKindName(newType)}.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findInputObjectTypeChanges(\n oldType: GraphQLInputObjectType,\n newType: GraphQLInputObjectType,\n): Array {\n const schemaChanges = [];\n const fieldsDiff = diff(\n Object.values(oldType.getFields()),\n Object.values(newType.getFields()),\n );\n\n for (const newField of fieldsDiff.added) {\n if (isRequiredInputField(newField)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,\n description: `A required field ${newField} was added.`,\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,\n description: `An optional field ${newField} was added.`,\n });\n }\n }\n\n for (const oldField of fieldsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: `Field ${oldField} was removed.`,\n });\n }\n\n for (const [oldField, newField] of fieldsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldField.type,\n newField.type,\n );\n\n const oldDefaultValueStr = getDefaultValue(oldField);\n const newDefaultValueStr = getDefaultValue(newField);\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`,\n });\n } else if (oldDefaultValueStr !== undefined) {\n if (newDefaultValueStr === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE,\n description: `${oldField} defaultValue was removed.`,\n });\n } else if (oldDefaultValueStr !== newDefaultValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE,\n description: `${oldField} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`,\n });\n }\n } else if (\n newDefaultValueStr !== undefined &&\n oldDefaultValueStr === undefined\n ) {\n schemaChanges.push({\n type: SafeChangeType.INPUT_FIELD_DEFAULT_VALUE_ADDED,\n description: `${oldField} added a defaultValue ${newDefaultValueStr}.`,\n });\n } else if (oldField.type.toString() !== newField.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.FIELD_CHANGED_KIND_SAFE,\n description:\n `Field ${oldType}.${oldField.name} changed type from ` +\n `${String(oldField.type)} to ${String(newField.type)}.`,\n });\n }\n\n if (oldField.description !== newField.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of input-field ${newType}.${newField.name} has changed to \"${newField.description}\".`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findUnionTypeChanges(\n oldType: GraphQLUnionType,\n newType: GraphQLUnionType,\n): Array {\n const schemaChanges = [];\n const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes());\n\n for (const newPossibleType of possibleTypesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.TYPE_ADDED_TO_UNION,\n description: `${newPossibleType} was added to union type ${oldType}.`,\n });\n }\n\n for (const oldPossibleType of possibleTypesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,\n description: `${oldPossibleType} was removed from union type ${oldType}.`,\n });\n }\n\n return schemaChanges;\n}\n\nfunction findEnumTypeChanges(\n oldType: GraphQLEnumType,\n newType: GraphQLEnumType,\n): Array {\n const schemaChanges = [];\n const valuesDiff = diff(oldType.getValues(), newType.getValues());\n\n for (const newValue of valuesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.VALUE_ADDED_TO_ENUM,\n description: `Enum value ${newValue} was added.`,\n });\n }\n\n for (const oldValue of valuesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,\n description: `Enum value ${oldValue} was removed.`,\n });\n }\n\n for (const [oldValue, newValue] of valuesDiff.persisted) {\n if (oldValue.description !== newValue.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of enum value ${oldType}.${oldValue.name} has changed to \"${newValue.description}\".`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findImplementedInterfacesChanges(\n oldType: GraphQLObjectType | GraphQLInterfaceType,\n newType: GraphQLObjectType | GraphQLInterfaceType,\n): Array {\n const schemaChanges = [];\n const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces());\n\n for (const newInterface of interfacesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED,\n description: `${newInterface} added to interfaces implemented by ${oldType}.`,\n });\n }\n\n for (const oldInterface of interfacesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED,\n description: `${oldType} no longer implements interface ${oldInterface}.`,\n });\n }\n\n return schemaChanges;\n}\n\nfunction findFieldChanges(\n oldType: GraphQLObjectType | GraphQLInterfaceType,\n newType: GraphQLObjectType | GraphQLInterfaceType,\n): Array {\n const schemaChanges = [];\n const fieldsDiff = diff(\n Object.values(oldType.getFields()),\n Object.values(newType.getFields()),\n );\n\n for (const oldField of fieldsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: `Field ${oldField} was removed.`,\n });\n }\n\n for (const newField of fieldsDiff.added) {\n schemaChanges.push({\n type: SafeChangeType.FIELD_ADDED,\n description: `Field ${oldType}.${newField.name} was added.`,\n });\n }\n\n for (const [oldField, newField] of fieldsDiff.persisted) {\n schemaChanges.push(...findArgChanges(oldField, newField));\n\n const isSafe = isChangeSafeForObjectOrInterfaceField(\n oldField.type,\n newField.type,\n );\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`,\n });\n } else if (oldField.type.toString() !== newField.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.FIELD_CHANGED_KIND_SAFE,\n description:\n `Field ${oldType}.${oldField.name} changed type from ` +\n `${String(oldField.type)} to ${String(newField.type)}.`,\n });\n }\n\n if (oldField.description !== newField.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of field ${oldType}.${oldField.name} has changed to \"${newField.description}\".`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findArgChanges(\n oldField: GraphQLField,\n newField: GraphQLField,\n): Array {\n const schemaChanges = [];\n const argsDiff = diff(oldField.args, newField.args);\n\n for (const oldArg of argsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_REMOVED,\n description: `Argument ${oldArg} was removed.`,\n });\n }\n\n for (const [oldArg, newArg] of argsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldArg.type,\n newArg.type,\n );\n\n const oldDefaultValueStr = getDefaultValue(oldArg);\n const newDefaultValueStr = getDefaultValue(newArg);\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_CHANGED_KIND,\n description: `Argument ${newArg} has changed type from ${oldArg.type} to ${newArg.type}.`,\n });\n } else if (oldDefaultValueStr !== undefined) {\n if (newDefaultValueStr === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `${oldArg} defaultValue was removed.`,\n });\n } else if (oldDefaultValueStr !== newDefaultValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `${oldArg} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`,\n });\n }\n } else if (\n newDefaultValueStr !== undefined &&\n oldDefaultValueStr === undefined\n ) {\n schemaChanges.push({\n type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED,\n description: `${oldArg} added a defaultValue ${newDefaultValueStr}.`,\n });\n } else if (oldArg.type.toString() !== newArg.type.toString()) {\n schemaChanges.push({\n type: SafeChangeType.ARG_CHANGED_KIND_SAFE,\n description:\n `Argument ${oldArg} has changed type from ` +\n `${String(oldArg.type)} to ${String(newArg.type)}.`,\n });\n }\n\n if (oldArg.description !== newArg.description) {\n schemaChanges.push({\n type: SafeChangeType.DESCRIPTION_CHANGED,\n description: `Description of argument ${oldArg} has changed to \"${newArg.description}\".`,\n });\n }\n }\n\n for (const newArg of argsDiff.added) {\n if (isRequiredArgument(newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_ARG_ADDED,\n description: `A required argument ${newArg} was added.`,\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_ARG_ADDED,\n description: `An optional argument ${newArg} was added.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction isChangeSafeForObjectOrInterfaceField(\n oldType: GraphQLType,\n newType: GraphQLType,\n): boolean {\n if (isListType(oldType)) {\n return (\n // if they're both lists, make sure the underlying types are compatible\n (isListType(newType) &&\n isChangeSafeForObjectOrInterfaceField(\n oldType.ofType,\n newType.ofType,\n )) ||\n // moving from nullable to non-null of the same underlying type is safe\n (isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))\n );\n }\n\n if (isNonNullType(oldType)) {\n // if they're both non-null, make sure the underlying types are compatible\n return (\n isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)\n );\n }\n\n return (\n // if they're both named types, see if their names are equivalent\n (isNamedType(newType) && oldType.name === newType.name) ||\n // moving from nullable to non-null of the same underlying type is safe\n (isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))\n );\n}\n\nfunction isChangeSafeForInputObjectFieldOrFieldArg(\n oldType: GraphQLType,\n newType: GraphQLType,\n): boolean {\n if (isListType(oldType)) {\n // if they're both lists, make sure the underlying types are compatible\n return (\n isListType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)\n );\n }\n\n if (isNonNullType(oldType)) {\n return (\n // if they're both non-null, make sure the underlying types are\n // compatible\n (isNonNullType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(\n oldType.ofType,\n newType.ofType,\n )) ||\n // moving from non-null to nullable of the same underlying type is safe\n (!isNonNullType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType))\n );\n }\n\n // if they're both named types, see if their names are equivalent\n return isNamedType(newType) && oldType.name === newType.name;\n}\n\nfunction typeKindName(type: GraphQLNamedType): string {\n if (isScalarType(type)) {\n return 'a Scalar type';\n }\n if (isObjectType(type)) {\n return 'an Object type';\n }\n if (isInterfaceType(type)) {\n return 'an Interface type';\n }\n if (isUnionType(type)) {\n return 'a Union type';\n }\n if (isEnumType(type)) {\n return 'an Enum type';\n }\n if (isInputObjectType(type)) {\n return 'an Input type';\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered.\n invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\n// Since we looking only for client's observable changes we should\n// compare default values in the same representation as they are\n// represented inside introspection.\nfunction getDefaultValue(\n argOrInputField: GraphQLArgument | GraphQLInputField,\n): string | undefined {\n const ast = getDefaultValueAST(argOrInputField);\n if (ast) {\n return print(sortValueNode(ast));\n }\n}\n\nfunction diff(\n oldArray: ReadonlyArray,\n newArray: ReadonlyArray,\n): {\n added: ReadonlyArray;\n removed: ReadonlyArray;\n persisted: ReadonlyArray<[T, T]>;\n} {\n const added: Array = [];\n const removed: Array = [];\n const persisted: Array<[T, T]> = [];\n\n const oldMap = keyMap(oldArray, ({ name }) => name);\n const newMap = keyMap(newArray, ({ name }) => name);\n\n for (const oldItem of oldArray) {\n const newItem = newMap[oldItem.name];\n if (newItem === undefined) {\n removed.push(oldItem);\n } else {\n persisted.push([oldItem, newItem]);\n }\n }\n\n for (const newItem of newArray) {\n if (oldMap[newItem.name] === undefined) {\n added.push(newItem);\n }\n }\n\n return { added, persisted, removed };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.mts new file mode 100644 index 00000000..75cccd4e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.mts @@ -0,0 +1,4 @@ +import type { ConstValueNode } from "../language/ast.mjs"; +import type { GraphQLArgument, GraphQLInputField } from "../type/definition.mjs"; +/** @internal */ +export declare function getDefaultValueAST(argOrInputField: GraphQLArgument | GraphQLInputField): ConstValueNode | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.ts new file mode 100644 index 00000000..34b23a70 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.d.ts @@ -0,0 +1,4 @@ +import type { ConstValueNode } from "../language/ast.js"; +import type { GraphQLArgument, GraphQLInputField } from "../type/definition.js"; +/** @internal */ +export declare function getDefaultValueAST(argOrInputField: GraphQLArgument | GraphQLInputField): ConstValueNode | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js new file mode 100644 index 00000000..f5888ba1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDefaultValueAST = getDefaultValueAST; +const invariant_ts_1 = require("../jsutils/invariant.js"); +const astFromValue_ts_1 = require("./astFromValue.js"); +const valueToLiteral_ts_1 = require("./valueToLiteral.js"); +function getDefaultValueAST(argOrInputField) { + const type = argOrInputField.type; + const defaultInput = argOrInputField.default; + if (defaultInput) { + const literal = defaultInput.literal ?? (0, valueToLiteral_ts_1.valueToLiteral)(defaultInput.value, type); + if (!(literal != null)) + (0, invariant_ts_1.invariant)(false, 'Invalid default value'); + return literal; + } + const defaultValue = argOrInputField.defaultValue; + if (defaultValue !== undefined) { + const valueAST = (0, astFromValue_ts_1.astFromValue)(defaultValue, type); + if (!(valueAST != null)) + (0, invariant_ts_1.invariant)(false, 'Invalid default value'); + return valueAST; + } + return undefined; +} +//# sourceMappingURL=getDefaultValueAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js.map new file mode 100644 index 00000000..6af0a338 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getDefaultValueAST.js","sourceRoot":"","sources":["../../src/utilities/getDefaultValueAST.ts"],"names":[],"mappings":";;AAWA,gDAoBC;AA/BD,0DAAoD;AAOpD,uDAAiD;AACjD,2DAAqD;AAGrD,SAAgB,kBAAkB,CAChC,eAAoD;IAEpD,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IAClC,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC;IAC7C,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,OAAO,GACX,YAAY,CAAC,OAAO,IAAI,IAAA,kCAAc,EAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;cACzD,OAAO,IAAI,IAAI;gBAAzB,wBAAS,SAAkB,uBAAuB;QAClD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,YAAY,GAAG,eAAe,CAAC,YAAY,CAAC;IAClD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAE/B,MAAM,QAAQ,GAAG,IAAA,8BAAY,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;cACxC,QAAQ,IAAI,IAAI;gBAA1B,wBAAS,SAAmB,uBAAuB;QACnD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { invariant } from '../jsutils/invariant.ts';\n\nimport type { ConstValueNode } from '../language/ast.ts';\n\nimport type { GraphQLArgument, GraphQLInputField } from '../type/definition.ts';\n\n// eslint-disable-next-line import/no-deprecated\nimport { astFromValue } from './astFromValue.ts';\nimport { valueToLiteral } from './valueToLiteral.ts';\n\n/** @internal */\nexport function getDefaultValueAST(\n argOrInputField: GraphQLArgument | GraphQLInputField,\n): ConstValueNode | undefined {\n const type = argOrInputField.type;\n const defaultInput = argOrInputField.default;\n if (defaultInput) {\n const literal =\n defaultInput.literal ?? valueToLiteral(defaultInput.value, type);\n invariant(literal != null, 'Invalid default value');\n return literal;\n }\n\n const defaultValue = argOrInputField.defaultValue;\n if (defaultValue !== undefined) {\n // eslint-disable-next-line import/no-deprecated\n const valueAST = astFromValue(defaultValue, type);\n invariant(valueAST != null, 'Invalid default value');\n return valueAST;\n }\n return undefined;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs new file mode 100644 index 00000000..cec38400 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs @@ -0,0 +1,22 @@ +import { invariant } from "../jsutils/invariant.mjs"; +import { astFromValue } from "./astFromValue.mjs"; +import { valueToLiteral } from "./valueToLiteral.mjs"; +export function getDefaultValueAST(argOrInputField) { + const type = argOrInputField.type; + const defaultInput = argOrInputField.default; + if (defaultInput) { + const literal = defaultInput.literal ?? valueToLiteral(defaultInput.value, type); + if (!(literal != null)) + invariant(false, 'Invalid default value'); + return literal; + } + const defaultValue = argOrInputField.defaultValue; + if (defaultValue !== undefined) { + const valueAST = astFromValue(defaultValue, type); + if (!(valueAST != null)) + invariant(false, 'Invalid default value'); + return valueAST; + } + return undefined; +} +//# sourceMappingURL=getDefaultValueAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs.map new file mode 100644 index 00000000..c2491bdb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getDefaultValueAST.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"getDefaultValueAST.js","sourceRoot":"","sources":["../../src/utilities/getDefaultValueAST.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAOpD,OAAO,EAAE,YAAY,EAAE,2BAA0B;AACjD,OAAO,EAAE,cAAc,EAAE,6BAA4B;AAGrD,MAAM,UAAU,kBAAkB,CAChC,eAAoD;IAEpD,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IAClC,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC;IAC7C,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,OAAO,GACX,YAAY,CAAC,OAAO,IAAI,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;cACzD,OAAO,IAAI,IAAI;YAAzB,SAAS,QAAkB,uBAAuB;QAClD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,YAAY,GAAG,eAAe,CAAC,YAAY,CAAC;IAClD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAE/B,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;cACxC,QAAQ,IAAI,IAAI;YAA1B,SAAS,QAAmB,uBAAuB;QACnD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { invariant } from '../jsutils/invariant.ts';\n\nimport type { ConstValueNode } from '../language/ast.ts';\n\nimport type { GraphQLArgument, GraphQLInputField } from '../type/definition.ts';\n\n// eslint-disable-next-line import/no-deprecated\nimport { astFromValue } from './astFromValue.ts';\nimport { valueToLiteral } from './valueToLiteral.ts';\n\n/** @internal */\nexport function getDefaultValueAST(\n argOrInputField: GraphQLArgument | GraphQLInputField,\n): ConstValueNode | undefined {\n const type = argOrInputField.type;\n const defaultInput = argOrInputField.default;\n if (defaultInput) {\n const literal =\n defaultInput.literal ?? valueToLiteral(defaultInput.value, type);\n invariant(literal != null, 'Invalid default value');\n return literal;\n }\n\n const defaultValue = argOrInputField.defaultValue;\n if (defaultValue !== undefined) {\n // eslint-disable-next-line import/no-deprecated\n const valueAST = astFromValue(defaultValue, type);\n invariant(valueAST != null, 'Invalid default value');\n return valueAST;\n }\n return undefined;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.mts new file mode 100644 index 00000000..aa518d66 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.mts @@ -0,0 +1,286 @@ +/** @category Introspection */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { DirectiveLocation } from "../language/directiveLocation.mjs"; +import type { TypeKind } from "../type/introspection.mjs"; +/** Options controlling which fields are included in the introspection query. */ +export interface IntrospectionOptions { + /** + * Whether to include descriptions in the introspection result. + * Default: true + */ + descriptions?: boolean; + /** + * Whether to include `specifiedByURL` in the introspection result. + * Default: false + */ + specifiedByUrl?: boolean; + /** + * Whether to include `isRepeatable` flag on directives. + * Default: false + */ + directiveIsRepeatable?: boolean; + /** + * Whether to include `description` field on schema. + * Default: false + */ + schemaDescription?: boolean; + /** + * Whether target GraphQL server support deprecation of input values. + * Default: false + */ + inputValueDeprecation?: boolean; + /** + * Whether target GraphQL server supports deprecation of directives. + * Default: false + */ + experimentalDirectiveDeprecation?: boolean; + /** + * Whether target GraphQL server supports `@oneOf` input objects. + * Default: false + */ + oneOf?: boolean; + /** + * How deep to recurse into nested types, larger values will result in more + * accurate results, but have a higher load on the server. + * Some servers might restrict the maximum query depth or complexity. + * If that's the case, try decreasing this value. + * + * Default: 9 + */ + typeDepth?: number; +} +/** + * Produce the GraphQL query recommended for a full schema introspection. + * Accepts optional IntrospectionOptions. + * @param options - Optional configuration for this operation. + * @returns The resolved introspection query. + * @example + * ```ts + * // Generate the default introspection query. + * import { getIntrospectionQuery } from 'graphql/utilities'; + * + * const query = getIntrospectionQuery(); + * + * query; // matches /__schema/ + * query; // matches /description/ + * query; // does not match /specifiedByURL/ + * ``` + * @example + * ```ts + * // This variant customizes optional introspection fields and nesting depth. + * import { getIntrospectionQuery } from 'graphql/utilities'; + * + * const query = getIntrospectionQuery({ + * descriptions: false, + * specifiedByUrl: true, + * directiveIsRepeatable: true, + * schemaDescription: true, + * inputValueDeprecation: true, + * experimentalDirectiveDeprecation: true, + * oneOf: true, + * typeDepth: 3, + * }); + * + * query; // does not match /description/ + * query; // matches /specifiedByURL/ + * query; // matches /isRepeatable/ + * query; // matches /includeDeprecated: true/ + * query; // matches /isOneOf/ + * (query.match(/ofType/g)?.length ?? 0) > 0; // => true + * ``` + */ +export declare function getIntrospectionQuery(options?: IntrospectionOptions): string; +/** The result shape returned by a full introspection query. */ +export interface IntrospectionQuery { + /** The schema. */ + readonly __schema: IntrospectionSchema; +} +/** The introspection representation of a GraphQL schema. */ +export interface IntrospectionSchema { + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** The root object type used for query operations. */ + readonly queryType: IntrospectionNamedTypeRef; + /** The root object type used for mutation operations, if supported. */ + readonly mutationType: Maybe>; + /** The root object type used for subscription operations, if supported. */ + readonly subscriptionType: Maybe>; + /** Object types that belong to this union type. */ + readonly types: ReadonlyArray; + /** Directives available in this schema or applied to this AST node. */ + readonly directives: ReadonlyArray; +} +/** Any introspection representation of a GraphQL type. */ +export type IntrospectionType = IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | IntrospectionUnionType | IntrospectionEnumType | IntrospectionInputObjectType; +/** An introspection type that can appear in output position. */ +export type IntrospectionOutputType = IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | IntrospectionUnionType | IntrospectionEnumType; +/** An introspection type that can appear in input position. */ +export type IntrospectionInputType = IntrospectionScalarType | IntrospectionEnumType | IntrospectionInputObjectType; +/** The introspection representation of a scalar type. */ +export interface IntrospectionScalarType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.SCALAR; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** URL identifying the behavior specified for this custom scalar. */ + readonly specifiedByURL?: Maybe; +} +/** The introspection representation of an object type. */ +export interface IntrospectionObjectType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.OBJECT; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces: ReadonlyArray>; +} +/** The introspection representation of an interface type. */ +export interface IntrospectionInterfaceType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.INTERFACE; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces: ReadonlyArray>; + /** Object types that may be returned for this abstract type. */ + readonly possibleTypes: ReadonlyArray>; +} +/** The introspection representation of a union type. */ +export interface IntrospectionUnionType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.UNION; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Object types that may be returned for this abstract type. */ + readonly possibleTypes: ReadonlyArray>; +} +/** The introspection representation of an enum type. */ +export interface IntrospectionEnumType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.ENUM; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Values declared by this enum type. */ + readonly enumValues: ReadonlyArray; +} +/** The introspection representation of an input object type. */ +export interface IntrospectionInputObjectType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.INPUT_OBJECT; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Input fields declared by this input object type. */ + readonly inputFields: ReadonlyArray; + /** Whether this input object uses the experimental OneOf input object semantics. */ + readonly isOneOf: boolean; +} +/** + * The introspection representation of a list type reference. + * @typeParam T - The introspection type reference wrapped by this list type reference. + */ +export interface IntrospectionListTypeRef { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.LIST; + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; +} +/** + * The introspection representation of a non-null type reference. + * @typeParam T - The introspection type reference wrapped by this non-null type reference. + */ +export interface IntrospectionNonNullTypeRef { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.NON_NULL; + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; +} +/** Any introspection representation of a type reference. */ +export type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef; +/** An introspection type reference that can appear in output position. */ +export type IntrospectionOutputTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; +/** An introspection type reference that can appear in input position. */ +export type IntrospectionInputTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; +/** + * The introspection representation of a named type reference. + * @typeParam T - The introspection type represented by this named type reference. + */ +export interface IntrospectionNamedTypeRef { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: T['kind']; + /** The GraphQL name for this schema element. */ + readonly name: string; +} +/** The introspection representation of a field. */ +export interface IntrospectionField { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Arguments accepted by this field or directive. */ + readonly args: ReadonlyArray; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: IntrospectionOutputTypeRef; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason: Maybe; +} +/** The introspection representation of an argument or input field. */ +export interface IntrospectionInputValue { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: IntrospectionInputTypeRef; + /** Default value used when no explicit value is supplied. */ + readonly defaultValue: Maybe; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated?: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason?: Maybe; +} +/** The introspection representation of an enum value. */ +export interface IntrospectionEnumValue { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason: Maybe; +} +/** The introspection representation of a directive. */ +export interface IntrospectionDirective { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Whether this directive may appear more than once at the same location. */ + readonly isRepeatable?: boolean; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated?: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason?: Maybe; + /** Locations where this directive may be applied. */ + readonly locations: ReadonlyArray; + /** Arguments accepted by this field or directive. */ + readonly args: ReadonlyArray; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.ts new file mode 100644 index 00000000..135e8e8d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.d.ts @@ -0,0 +1,286 @@ +/** @category Introspection */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { DirectiveLocation } from "../language/directiveLocation.js"; +import type { TypeKind } from "../type/introspection.js"; +/** Options controlling which fields are included in the introspection query. */ +export interface IntrospectionOptions { + /** + * Whether to include descriptions in the introspection result. + * Default: true + */ + descriptions?: boolean; + /** + * Whether to include `specifiedByURL` in the introspection result. + * Default: false + */ + specifiedByUrl?: boolean; + /** + * Whether to include `isRepeatable` flag on directives. + * Default: false + */ + directiveIsRepeatable?: boolean; + /** + * Whether to include `description` field on schema. + * Default: false + */ + schemaDescription?: boolean; + /** + * Whether target GraphQL server support deprecation of input values. + * Default: false + */ + inputValueDeprecation?: boolean; + /** + * Whether target GraphQL server supports deprecation of directives. + * Default: false + */ + experimentalDirectiveDeprecation?: boolean; + /** + * Whether target GraphQL server supports `@oneOf` input objects. + * Default: false + */ + oneOf?: boolean; + /** + * How deep to recurse into nested types, larger values will result in more + * accurate results, but have a higher load on the server. + * Some servers might restrict the maximum query depth or complexity. + * If that's the case, try decreasing this value. + * + * Default: 9 + */ + typeDepth?: number; +} +/** + * Produce the GraphQL query recommended for a full schema introspection. + * Accepts optional IntrospectionOptions. + * @param options - Optional configuration for this operation. + * @returns The resolved introspection query. + * @example + * ```ts + * // Generate the default introspection query. + * import { getIntrospectionQuery } from 'graphql/utilities'; + * + * const query = getIntrospectionQuery(); + * + * query; // matches /__schema/ + * query; // matches /description/ + * query; // does not match /specifiedByURL/ + * ``` + * @example + * ```ts + * // This variant customizes optional introspection fields and nesting depth. + * import { getIntrospectionQuery } from 'graphql/utilities'; + * + * const query = getIntrospectionQuery({ + * descriptions: false, + * specifiedByUrl: true, + * directiveIsRepeatable: true, + * schemaDescription: true, + * inputValueDeprecation: true, + * experimentalDirectiveDeprecation: true, + * oneOf: true, + * typeDepth: 3, + * }); + * + * query; // does not match /description/ + * query; // matches /specifiedByURL/ + * query; // matches /isRepeatable/ + * query; // matches /includeDeprecated: true/ + * query; // matches /isOneOf/ + * (query.match(/ofType/g)?.length ?? 0) > 0; // => true + * ``` + */ +export declare function getIntrospectionQuery(options?: IntrospectionOptions): string; +/** The result shape returned by a full introspection query. */ +export interface IntrospectionQuery { + /** The schema. */ + readonly __schema: IntrospectionSchema; +} +/** The introspection representation of a GraphQL schema. */ +export interface IntrospectionSchema { + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** The root object type used for query operations. */ + readonly queryType: IntrospectionNamedTypeRef; + /** The root object type used for mutation operations, if supported. */ + readonly mutationType: Maybe>; + /** The root object type used for subscription operations, if supported. */ + readonly subscriptionType: Maybe>; + /** Object types that belong to this union type. */ + readonly types: ReadonlyArray; + /** Directives available in this schema or applied to this AST node. */ + readonly directives: ReadonlyArray; +} +/** Any introspection representation of a GraphQL type. */ +export type IntrospectionType = IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | IntrospectionUnionType | IntrospectionEnumType | IntrospectionInputObjectType; +/** An introspection type that can appear in output position. */ +export type IntrospectionOutputType = IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | IntrospectionUnionType | IntrospectionEnumType; +/** An introspection type that can appear in input position. */ +export type IntrospectionInputType = IntrospectionScalarType | IntrospectionEnumType | IntrospectionInputObjectType; +/** The introspection representation of a scalar type. */ +export interface IntrospectionScalarType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.SCALAR; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** URL identifying the behavior specified for this custom scalar. */ + readonly specifiedByURL?: Maybe; +} +/** The introspection representation of an object type. */ +export interface IntrospectionObjectType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.OBJECT; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces: ReadonlyArray>; +} +/** The introspection representation of an interface type. */ +export interface IntrospectionInterfaceType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.INTERFACE; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Fields declared by this object, interface, input object, or literal. */ + readonly fields: ReadonlyArray; + /** Interfaces implemented by this object or interface type. */ + readonly interfaces: ReadonlyArray>; + /** Object types that may be returned for this abstract type. */ + readonly possibleTypes: ReadonlyArray>; +} +/** The introspection representation of a union type. */ +export interface IntrospectionUnionType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.UNION; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Object types that may be returned for this abstract type. */ + readonly possibleTypes: ReadonlyArray>; +} +/** The introspection representation of an enum type. */ +export interface IntrospectionEnumType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.ENUM; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Values declared by this enum type. */ + readonly enumValues: ReadonlyArray; +} +/** The introspection representation of an input object type. */ +export interface IntrospectionInputObjectType { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.INPUT_OBJECT; + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Input fields declared by this input object type. */ + readonly inputFields: ReadonlyArray; + /** Whether this input object uses the experimental OneOf input object semantics. */ + readonly isOneOf: boolean; +} +/** + * The introspection representation of a list type reference. + * @typeParam T - The introspection type reference wrapped by this list type reference. + */ +export interface IntrospectionListTypeRef { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.LIST; + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; +} +/** + * The introspection representation of a non-null type reference. + * @typeParam T - The introspection type reference wrapped by this non-null type reference. + */ +export interface IntrospectionNonNullTypeRef { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: typeof TypeKind.NON_NULL; + /** The type wrapped by this list or non-null type. */ + readonly ofType: T; +} +/** Any introspection representation of a type reference. */ +export type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef; +/** An introspection type reference that can appear in output position. */ +export type IntrospectionOutputTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; +/** An introspection type reference that can appear in input position. */ +export type IntrospectionInputTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; +/** + * The introspection representation of a named type reference. + * @typeParam T - The introspection type represented by this named type reference. + */ +export interface IntrospectionNamedTypeRef { + /** The introspection kind discriminator for this type reference or type. */ + readonly kind: T['kind']; + /** The GraphQL name for this schema element. */ + readonly name: string; +} +/** The introspection representation of a field. */ +export interface IntrospectionField { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Arguments accepted by this field or directive. */ + readonly args: ReadonlyArray; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: IntrospectionOutputTypeRef; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason: Maybe; +} +/** The introspection representation of an argument or input field. */ +export interface IntrospectionInputValue { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** The GraphQL type reference or runtime type for this element. */ + readonly type: IntrospectionInputTypeRef; + /** Default value used when no explicit value is supplied. */ + readonly defaultValue: Maybe; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated?: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason?: Maybe; +} +/** The introspection representation of an enum value. */ +export interface IntrospectionEnumValue { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason: Maybe; +} +/** The introspection representation of a directive. */ +export interface IntrospectionDirective { + /** The GraphQL name for this schema element. */ + readonly name: string; + /** Human-readable description for this schema element, if provided. */ + readonly description?: Maybe; + /** Whether this directive may appear more than once at the same location. */ + readonly isRepeatable?: boolean; + /** Whether this field, argument, enum value, or input value is deprecated. */ + readonly isDeprecated?: boolean; + /** Reason this element is deprecated, if one was provided. */ + readonly deprecationReason?: Maybe; + /** Locations where this directive may be applied. */ + readonly locations: ReadonlyArray; + /** Arguments accepted by this field or directive. */ + readonly args: ReadonlyArray; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js new file mode 100644 index 00000000..cf6a3005 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getIntrospectionQuery = getIntrospectionQuery; +function getIntrospectionQuery(options) { + const optionsWithDefault = { + descriptions: true, + specifiedByUrl: false, + directiveIsRepeatable: false, + schemaDescription: false, + inputValueDeprecation: false, + experimentalDirectiveDeprecation: false, + oneOf: false, + typeDepth: 9, + ...options, + }; + const descriptions = optionsWithDefault.descriptions ? 'description' : ''; + const specifiedByUrl = optionsWithDefault.specifiedByUrl + ? 'specifiedByURL' + : ''; + const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable + ? 'isRepeatable' + : ''; + const schemaDescription = optionsWithDefault.schemaDescription + ? descriptions + : ''; + function inputDeprecation(str) { + return optionsWithDefault.inputValueDeprecation ? str : ''; + } + function experimentalDirectiveDeprecation(str) { + return optionsWithDefault.experimentalDirectiveDeprecation ? str : ''; + } + const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : ''; + function ofType(level, indent) { + if (level <= 0) { + return ''; + } + if (level > 100) { + throw new Error('Please set typeDepth to a reasonable value between 0 and 100; the default is 9.'); + } + return ` +${indent}ofType { +${indent} name +${indent} kind${ofType(level - 1, indent + ' ')} +${indent}}`; + } + return ` + query IntrospectionQuery { + __schema { + ${schemaDescription} + queryType { name kind } + mutationType { name kind } + subscriptionType { name kind } + types { + ...FullType + } + directives${experimentalDirectiveDeprecation('(includeDeprecated: true)')} { + name + ${descriptions} + ${directiveIsRepeatable} + ${experimentalDirectiveDeprecation('isDeprecated')} + ${experimentalDirectiveDeprecation('deprecationReason')} + locations + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${descriptions} + ${specifiedByUrl} + ${oneOf} + fields(includeDeprecated: true) { + name + ${descriptions} + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${descriptions} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${descriptions} + type { ...TypeRef } + defaultValue + ${inputDeprecation('isDeprecated')} + ${inputDeprecation('deprecationReason')} + } + + fragment TypeRef on __Type { + kind + name${ofType(optionsWithDefault.typeDepth, ' ')} + } + `; +} +//# sourceMappingURL=getIntrospectionQuery.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js.map new file mode 100644 index 00000000..eeebf2e3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getIntrospectionQuery.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OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;QACJ,CAAC;QACD,OAAO;EACT,MAAM;EACN,MAAM;EACN,MAAM,SAAS,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;EAC/C,MAAM,GAAG,CAAC;IACV,CAAC;IAED,OAAO;;;UAGC,iBAAiB;;;;;;;oBAOP,gCAAgC,CAC1C,2BAA2B,CAC5B;;YAEG,YAAY;YACZ,qBAAqB;YACrB,gCAAgC,CAAC,cAAc,CAAC;YAChD,gCAAgC,CAAC,mBAAmB,CAAC;;gBAEjD,gBAAgB,CAAC,2BAA2B,CAAC;;;;;;;;;;QAUrD,YAAY;QACZ,cAAc;QACd,KAAK;;;UAGH,YAAY;cACR,gBAAgB,CAAC,2BAA2B,CAAC;;;;;;;;;mBASxC,gBAAgB,CAAC,2BAA2B,CAAC;;;;;;;;UAQtD,YAAY;;;;;;;;;;;QAWd,YAAY;;;QAGZ,gBAAgB,CAAC,cAAc,CAAC;QAChC,gBAAgB,CAAC,mBAAmB,CAAC;;;;;YAKjC,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC;;GAEvD,CAAC;AACJ,CAAC","sourcesContent":["/** @category Introspection */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { DirectiveLocation } from '../language/directiveLocation.ts';\n\nimport type { TypeKind } from '../type/introspection.ts';\n\n/** Options controlling which fields are included in the introspection query. */\nexport interface IntrospectionOptions {\n /**\n * Whether to include descriptions in the introspection result.\n * Default: true\n */\n descriptions?: boolean;\n\n /**\n * Whether to include `specifiedByURL` in the introspection result.\n * Default: false\n */\n specifiedByUrl?: boolean;\n\n /**\n * Whether to include `isRepeatable` flag on directives.\n * Default: false\n */\n directiveIsRepeatable?: boolean;\n\n /**\n * Whether to include `description` field on schema.\n * Default: false\n */\n schemaDescription?: boolean;\n\n /**\n * Whether target GraphQL server support deprecation of input values.\n * Default: false\n */\n inputValueDeprecation?: boolean;\n\n /**\n * Whether target GraphQL server supports deprecation of directives.\n * Default: false\n */\n experimentalDirectiveDeprecation?: boolean;\n\n /**\n * Whether target GraphQL server supports `@oneOf` input objects.\n * Default: false\n */\n oneOf?: boolean;\n\n /**\n * How deep to recurse into nested types, larger values will result in more\n * accurate results, but have a higher load on the server.\n * Some servers might restrict the maximum query depth or complexity.\n * If that's the case, try decreasing this value.\n *\n * Default: 9\n */\n typeDepth?: number;\n}\n\n/**\n * Produce the GraphQL query recommended for a full schema introspection.\n * Accepts optional IntrospectionOptions.\n * @param options - Optional configuration for this operation.\n * @returns The resolved introspection query.\n * @example\n * ```ts\n * // Generate the default introspection query.\n * import { getIntrospectionQuery } from 'graphql/utilities';\n *\n * const query = getIntrospectionQuery();\n *\n * query; // matches /__schema/\n * query; // matches /description/\n * query; // does not match /specifiedByURL/\n * ```\n * @example\n * ```ts\n * // This variant customizes optional introspection fields and nesting depth.\n * import { getIntrospectionQuery } from 'graphql/utilities';\n *\n * const query = getIntrospectionQuery({\n * descriptions: false,\n * specifiedByUrl: true,\n * directiveIsRepeatable: true,\n * schemaDescription: true,\n * inputValueDeprecation: true,\n * experimentalDirectiveDeprecation: true,\n * oneOf: true,\n * typeDepth: 3,\n * });\n *\n * query; // does not match /description/\n * query; // matches /specifiedByURL/\n * query; // matches /isRepeatable/\n * query; // matches /includeDeprecated: true/\n * query; // matches /isOneOf/\n * (query.match(/ofType/g)?.length ?? 0) > 0; // => true\n * ```\n */\nexport function getIntrospectionQuery(options?: IntrospectionOptions): string {\n const optionsWithDefault = {\n descriptions: true,\n specifiedByUrl: false,\n directiveIsRepeatable: false,\n schemaDescription: false,\n inputValueDeprecation: false,\n experimentalDirectiveDeprecation: false,\n oneOf: false,\n typeDepth: 9,\n ...options,\n };\n\n const descriptions = optionsWithDefault.descriptions ? 'description' : '';\n const specifiedByUrl = optionsWithDefault.specifiedByUrl\n ? 'specifiedByURL'\n : '';\n const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable\n ? 'isRepeatable'\n : '';\n const schemaDescription = optionsWithDefault.schemaDescription\n ? descriptions\n : '';\n\n function inputDeprecation(str: string) {\n return optionsWithDefault.inputValueDeprecation ? str : '';\n }\n function experimentalDirectiveDeprecation(str: string) {\n return optionsWithDefault.experimentalDirectiveDeprecation ? str : '';\n }\n const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : '';\n function ofType(level: number, indent: string): string {\n if (level <= 0) {\n return '';\n }\n if (level > 100) {\n throw new Error(\n 'Please set typeDepth to a reasonable value between 0 and 100; the default is 9.',\n );\n }\n return `\n${indent}ofType {\n${indent} name\n${indent} kind${ofType(level - 1, indent + ' ')}\n${indent}}`;\n }\n\n return `\n query IntrospectionQuery {\n __schema {\n ${schemaDescription}\n queryType { name kind }\n mutationType { name kind }\n subscriptionType { name kind }\n types {\n ...FullType\n }\n directives${experimentalDirectiveDeprecation(\n '(includeDeprecated: true)',\n )} {\n name\n ${descriptions}\n ${directiveIsRepeatable}\n ${experimentalDirectiveDeprecation('isDeprecated')}\n ${experimentalDirectiveDeprecation('deprecationReason')}\n locations\n args${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${descriptions}\n ${specifiedByUrl}\n ${oneOf}\n fields(includeDeprecated: true) {\n name\n ${descriptions}\n args${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${descriptions}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${descriptions}\n type { ...TypeRef }\n defaultValue\n ${inputDeprecation('isDeprecated')}\n ${inputDeprecation('deprecationReason')}\n }\n\n fragment TypeRef on __Type {\n kind\n name${ofType(optionsWithDefault.typeDepth, ' ')}\n }\n `;\n}\n\n/** The result shape returned by a full introspection query. */\nexport interface IntrospectionQuery {\n /** The schema. */\n readonly __schema: IntrospectionSchema;\n}\n\n/** The introspection representation of a GraphQL schema. */\nexport interface IntrospectionSchema {\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** The root object type used for query operations. */\n readonly queryType: IntrospectionNamedTypeRef;\n /** The root object type used for mutation operations, if supported. */\n readonly mutationType: Maybe<\n IntrospectionNamedTypeRef\n >;\n /** The root object type used for subscription operations, if supported. */\n readonly subscriptionType: Maybe<\n IntrospectionNamedTypeRef\n >;\n /** Object types that belong to this union type. */\n readonly types: ReadonlyArray;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives: ReadonlyArray;\n}\n\n/** Any introspection representation of a GraphQL type. */\nexport type IntrospectionType =\n | IntrospectionScalarType\n | IntrospectionObjectType\n | IntrospectionInterfaceType\n | IntrospectionUnionType\n | IntrospectionEnumType\n | IntrospectionInputObjectType;\n\n/** An introspection type that can appear in output position. */\nexport type IntrospectionOutputType =\n | IntrospectionScalarType\n | IntrospectionObjectType\n | IntrospectionInterfaceType\n | IntrospectionUnionType\n | IntrospectionEnumType;\n\n/** An introspection type that can appear in input position. */\nexport type IntrospectionInputType =\n | IntrospectionScalarType\n | IntrospectionEnumType\n | IntrospectionInputObjectType;\n\n/** The introspection representation of a scalar type. */\nexport interface IntrospectionScalarType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.SCALAR;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** URL identifying the behavior specified for this custom scalar. */\n readonly specifiedByURL?: Maybe;\n}\n\n/** The introspection representation of an object type. */\nexport interface IntrospectionObjectType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.OBJECT;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n}\n\n/** The introspection representation of an interface type. */\nexport interface IntrospectionInterfaceType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.INTERFACE;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n /** Object types that may be returned for this abstract type. */\n readonly possibleTypes: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n}\n\n/** The introspection representation of a union type. */\nexport interface IntrospectionUnionType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.UNION;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Object types that may be returned for this abstract type. */\n readonly possibleTypes: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n}\n\n/** The introspection representation of an enum type. */\nexport interface IntrospectionEnumType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.ENUM;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Values declared by this enum type. */\n readonly enumValues: ReadonlyArray;\n}\n\n/** The introspection representation of an input object type. */\nexport interface IntrospectionInputObjectType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.INPUT_OBJECT;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Input fields declared by this input object type. */\n readonly inputFields: ReadonlyArray;\n /** Whether this input object uses the experimental OneOf input object semantics. */\n readonly isOneOf: boolean;\n}\n\n/**\n * The introspection representation of a list type reference.\n * @typeParam T - The introspection type reference wrapped by this list type reference.\n */\nexport interface IntrospectionListTypeRef<\n T extends IntrospectionTypeRef = IntrospectionTypeRef,\n> {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.LIST;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n}\n\n/**\n * The introspection representation of a non-null type reference.\n * @typeParam T - The introspection type reference wrapped by this non-null type reference.\n */\nexport interface IntrospectionNonNullTypeRef<\n T extends IntrospectionTypeRef = IntrospectionTypeRef,\n> {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.NON_NULL;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n}\n\n/** Any introspection representation of a type reference. */\nexport type IntrospectionTypeRef =\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n | IntrospectionNonNullTypeRef<\n IntrospectionNamedTypeRef | IntrospectionListTypeRef\n >;\n\n/** An introspection type reference that can appear in output position. */\nexport type IntrospectionOutputTypeRef =\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n | IntrospectionNonNullTypeRef<\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n >;\n\n/** An introspection type reference that can appear in input position. */\nexport type IntrospectionInputTypeRef =\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n | IntrospectionNonNullTypeRef<\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n >;\n\n/**\n * The introspection representation of a named type reference.\n * @typeParam T - The introspection type represented by this named type reference.\n */\nexport interface IntrospectionNamedTypeRef<\n T extends IntrospectionType = IntrospectionType,\n> {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: T['kind'];\n /** The GraphQL name for this schema element. */\n readonly name: string;\n}\n\n/** The introspection representation of a field. */\nexport interface IntrospectionField {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Arguments accepted by this field or directive. */\n readonly args: ReadonlyArray;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: IntrospectionOutputTypeRef;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason: Maybe;\n}\n\n/** The introspection representation of an argument or input field. */\nexport interface IntrospectionInputValue {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: IntrospectionInputTypeRef;\n /** Default value used when no explicit value is supplied. */\n readonly defaultValue: Maybe;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated?: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason?: Maybe;\n}\n\n/** The introspection representation of an enum value. */\nexport interface IntrospectionEnumValue {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason: Maybe;\n}\n\n/** The introspection representation of a directive. */\nexport interface IntrospectionDirective {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Whether this directive may appear more than once at the same location. */\n readonly isRepeatable?: boolean;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated?: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason?: Maybe;\n /** Locations where this directive may be applied. */\n readonly locations: ReadonlyArray;\n /** Arguments accepted by this field or directive. */\n readonly args: ReadonlyArray;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs new file mode 100644 index 00000000..c050a901 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs @@ -0,0 +1,117 @@ +export function getIntrospectionQuery(options) { + const optionsWithDefault = { + descriptions: true, + specifiedByUrl: false, + directiveIsRepeatable: false, + schemaDescription: false, + inputValueDeprecation: false, + experimentalDirectiveDeprecation: false, + oneOf: false, + typeDepth: 9, + ...options, + }; + const descriptions = optionsWithDefault.descriptions ? 'description' : ''; + const specifiedByUrl = optionsWithDefault.specifiedByUrl + ? 'specifiedByURL' + : ''; + const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable + ? 'isRepeatable' + : ''; + const schemaDescription = optionsWithDefault.schemaDescription + ? descriptions + : ''; + function inputDeprecation(str) { + return optionsWithDefault.inputValueDeprecation ? str : ''; + } + function experimentalDirectiveDeprecation(str) { + return optionsWithDefault.experimentalDirectiveDeprecation ? str : ''; + } + const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : ''; + function ofType(level, indent) { + if (level <= 0) { + return ''; + } + if (level > 100) { + throw new Error('Please set typeDepth to a reasonable value between 0 and 100; the default is 9.'); + } + return ` +${indent}ofType { +${indent} name +${indent} kind${ofType(level - 1, indent + ' ')} +${indent}}`; + } + return ` + query IntrospectionQuery { + __schema { + ${schemaDescription} + queryType { name kind } + mutationType { name kind } + subscriptionType { name kind } + types { + ...FullType + } + directives${experimentalDirectiveDeprecation('(includeDeprecated: true)')} { + name + ${descriptions} + ${directiveIsRepeatable} + ${experimentalDirectiveDeprecation('isDeprecated')} + ${experimentalDirectiveDeprecation('deprecationReason')} + locations + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${descriptions} + ${specifiedByUrl} + ${oneOf} + fields(includeDeprecated: true) { + name + ${descriptions} + args${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${inputDeprecation('(includeDeprecated: true)')} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${descriptions} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${descriptions} + type { ...TypeRef } + defaultValue + ${inputDeprecation('isDeprecated')} + ${inputDeprecation('deprecationReason')} + } + + fragment TypeRef on __Type { + kind + name${ofType(optionsWithDefault.typeDepth, ' ')} + } + `; +} +//# sourceMappingURL=getIntrospectionQuery.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs.map new file mode 100644 index 00000000..bf779080 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getIntrospectionQuery.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"getIntrospectionQuery.js","sourceRoot":"","sources":["../../src/utilities/getIntrospectionQuery.ts"],"names":[],"mappings":"AAuGA,MAAM,UAAU,qBAAqB,CAAC,OAA8B;IAClE,MAAM,kBAAkB,GAAG;QACzB,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,KAAK;QACrB,qBAAqB,EAAE,KAAK;QAC5B,iBAAiB,EAAE,KAAK;QACxB,qBAAqB,EAAE,KAAK;QAC5B,gCAAgC,EAAE,KAAK;QACvC,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,CAAC;QACZ,GAAG,OAAO;KACX,CAAC;IAEF,MAAM,YAAY,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,MAAM,cAAc,GAAG,kBAAkB,CAAC,cAAc;QACtD,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,EAAE,CAAC;I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CAAC;;;;;;;;;mBASxC,gBAAgB,CAAC,2BAA2B,CAAC;;;;;;;;UAQtD,YAAY;;;;;;;;;;;QAWd,YAAY;;;QAGZ,gBAAgB,CAAC,cAAc,CAAC;QAChC,gBAAgB,CAAC,mBAAmB,CAAC;;;;;YAKjC,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC;;GAEvD,CAAC;AACJ,CAAC","sourcesContent":["/** @category Introspection */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { DirectiveLocation } from '../language/directiveLocation.ts';\n\nimport type { TypeKind } from '../type/introspection.ts';\n\n/** Options controlling which fields are included in the introspection query. */\nexport interface IntrospectionOptions {\n /**\n * Whether to include descriptions in the introspection result.\n * Default: true\n */\n descriptions?: boolean;\n\n /**\n * Whether to include `specifiedByURL` in the introspection result.\n * Default: false\n */\n specifiedByUrl?: boolean;\n\n /**\n * Whether to include `isRepeatable` flag on directives.\n * Default: false\n */\n directiveIsRepeatable?: boolean;\n\n /**\n * Whether to include `description` field on schema.\n * Default: false\n */\n schemaDescription?: boolean;\n\n /**\n * Whether target GraphQL server support deprecation of input values.\n * Default: false\n */\n inputValueDeprecation?: boolean;\n\n /**\n * Whether target GraphQL server supports deprecation of directives.\n * Default: false\n */\n experimentalDirectiveDeprecation?: boolean;\n\n /**\n * Whether target GraphQL server supports `@oneOf` input objects.\n * Default: false\n */\n oneOf?: boolean;\n\n /**\n * How deep to recurse into nested types, larger values will result in more\n * accurate results, but have a higher load on the server.\n * Some servers might restrict the maximum query depth or complexity.\n * If that's the case, try decreasing this value.\n *\n * Default: 9\n */\n typeDepth?: number;\n}\n\n/**\n * Produce the GraphQL query recommended for a full schema introspection.\n * Accepts optional IntrospectionOptions.\n * @param options - Optional configuration for this operation.\n * @returns The resolved introspection query.\n * @example\n * ```ts\n * // Generate the default introspection query.\n * import { getIntrospectionQuery } from 'graphql/utilities';\n *\n * const query = getIntrospectionQuery();\n *\n * query; // matches /__schema/\n * query; // matches /description/\n * query; // does not match /specifiedByURL/\n * ```\n * @example\n * ```ts\n * // This variant customizes optional introspection fields and nesting depth.\n * import { getIntrospectionQuery } from 'graphql/utilities';\n *\n * const query = getIntrospectionQuery({\n * descriptions: false,\n * specifiedByUrl: true,\n * directiveIsRepeatable: true,\n * schemaDescription: true,\n * inputValueDeprecation: true,\n * experimentalDirectiveDeprecation: true,\n * oneOf: true,\n * typeDepth: 3,\n * });\n *\n * query; // does not match /description/\n * query; // matches /specifiedByURL/\n * query; // matches /isRepeatable/\n * query; // matches /includeDeprecated: true/\n * query; // matches /isOneOf/\n * (query.match(/ofType/g)?.length ?? 0) > 0; // => true\n * ```\n */\nexport function getIntrospectionQuery(options?: IntrospectionOptions): string {\n const optionsWithDefault = {\n descriptions: true,\n specifiedByUrl: false,\n directiveIsRepeatable: false,\n schemaDescription: false,\n inputValueDeprecation: false,\n experimentalDirectiveDeprecation: false,\n oneOf: false,\n typeDepth: 9,\n ...options,\n };\n\n const descriptions = optionsWithDefault.descriptions ? 'description' : '';\n const specifiedByUrl = optionsWithDefault.specifiedByUrl\n ? 'specifiedByURL'\n : '';\n const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable\n ? 'isRepeatable'\n : '';\n const schemaDescription = optionsWithDefault.schemaDescription\n ? descriptions\n : '';\n\n function inputDeprecation(str: string) {\n return optionsWithDefault.inputValueDeprecation ? str : '';\n }\n function experimentalDirectiveDeprecation(str: string) {\n return optionsWithDefault.experimentalDirectiveDeprecation ? str : '';\n }\n const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : '';\n function ofType(level: number, indent: string): string {\n if (level <= 0) {\n return '';\n }\n if (level > 100) {\n throw new Error(\n 'Please set typeDepth to a reasonable value between 0 and 100; the default is 9.',\n );\n }\n return `\n${indent}ofType {\n${indent} name\n${indent} kind${ofType(level - 1, indent + ' ')}\n${indent}}`;\n }\n\n return `\n query IntrospectionQuery {\n __schema {\n ${schemaDescription}\n queryType { name kind }\n mutationType { name kind }\n subscriptionType { name kind }\n types {\n ...FullType\n }\n directives${experimentalDirectiveDeprecation(\n '(includeDeprecated: true)',\n )} {\n name\n ${descriptions}\n ${directiveIsRepeatable}\n ${experimentalDirectiveDeprecation('isDeprecated')}\n ${experimentalDirectiveDeprecation('deprecationReason')}\n locations\n args${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${descriptions}\n ${specifiedByUrl}\n ${oneOf}\n fields(includeDeprecated: true) {\n name\n ${descriptions}\n args${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${descriptions}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${descriptions}\n type { ...TypeRef }\n defaultValue\n ${inputDeprecation('isDeprecated')}\n ${inputDeprecation('deprecationReason')}\n }\n\n fragment TypeRef on __Type {\n kind\n name${ofType(optionsWithDefault.typeDepth, ' ')}\n }\n `;\n}\n\n/** The result shape returned by a full introspection query. */\nexport interface IntrospectionQuery {\n /** The schema. */\n readonly __schema: IntrospectionSchema;\n}\n\n/** The introspection representation of a GraphQL schema. */\nexport interface IntrospectionSchema {\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** The root object type used for query operations. */\n readonly queryType: IntrospectionNamedTypeRef;\n /** The root object type used for mutation operations, if supported. */\n readonly mutationType: Maybe<\n IntrospectionNamedTypeRef\n >;\n /** The root object type used for subscription operations, if supported. */\n readonly subscriptionType: Maybe<\n IntrospectionNamedTypeRef\n >;\n /** Object types that belong to this union type. */\n readonly types: ReadonlyArray;\n /** Directives available in this schema or applied to this AST node. */\n readonly directives: ReadonlyArray;\n}\n\n/** Any introspection representation of a GraphQL type. */\nexport type IntrospectionType =\n | IntrospectionScalarType\n | IntrospectionObjectType\n | IntrospectionInterfaceType\n | IntrospectionUnionType\n | IntrospectionEnumType\n | IntrospectionInputObjectType;\n\n/** An introspection type that can appear in output position. */\nexport type IntrospectionOutputType =\n | IntrospectionScalarType\n | IntrospectionObjectType\n | IntrospectionInterfaceType\n | IntrospectionUnionType\n | IntrospectionEnumType;\n\n/** An introspection type that can appear in input position. */\nexport type IntrospectionInputType =\n | IntrospectionScalarType\n | IntrospectionEnumType\n | IntrospectionInputObjectType;\n\n/** The introspection representation of a scalar type. */\nexport interface IntrospectionScalarType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.SCALAR;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** URL identifying the behavior specified for this custom scalar. */\n readonly specifiedByURL?: Maybe;\n}\n\n/** The introspection representation of an object type. */\nexport interface IntrospectionObjectType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.OBJECT;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n}\n\n/** The introspection representation of an interface type. */\nexport interface IntrospectionInterfaceType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.INTERFACE;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Fields declared by this object, interface, input object, or literal. */\n readonly fields: ReadonlyArray;\n /** Interfaces implemented by this object or interface type. */\n readonly interfaces: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n /** Object types that may be returned for this abstract type. */\n readonly possibleTypes: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n}\n\n/** The introspection representation of a union type. */\nexport interface IntrospectionUnionType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.UNION;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Object types that may be returned for this abstract type. */\n readonly possibleTypes: ReadonlyArray<\n IntrospectionNamedTypeRef\n >;\n}\n\n/** The introspection representation of an enum type. */\nexport interface IntrospectionEnumType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.ENUM;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Values declared by this enum type. */\n readonly enumValues: ReadonlyArray;\n}\n\n/** The introspection representation of an input object type. */\nexport interface IntrospectionInputObjectType {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.INPUT_OBJECT;\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Input fields declared by this input object type. */\n readonly inputFields: ReadonlyArray;\n /** Whether this input object uses the experimental OneOf input object semantics. */\n readonly isOneOf: boolean;\n}\n\n/**\n * The introspection representation of a list type reference.\n * @typeParam T - The introspection type reference wrapped by this list type reference.\n */\nexport interface IntrospectionListTypeRef<\n T extends IntrospectionTypeRef = IntrospectionTypeRef,\n> {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.LIST;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n}\n\n/**\n * The introspection representation of a non-null type reference.\n * @typeParam T - The introspection type reference wrapped by this non-null type reference.\n */\nexport interface IntrospectionNonNullTypeRef<\n T extends IntrospectionTypeRef = IntrospectionTypeRef,\n> {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: typeof TypeKind.NON_NULL;\n /** The type wrapped by this list or non-null type. */\n readonly ofType: T;\n}\n\n/** Any introspection representation of a type reference. */\nexport type IntrospectionTypeRef =\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n | IntrospectionNonNullTypeRef<\n IntrospectionNamedTypeRef | IntrospectionListTypeRef\n >;\n\n/** An introspection type reference that can appear in output position. */\nexport type IntrospectionOutputTypeRef =\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n | IntrospectionNonNullTypeRef<\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n >;\n\n/** An introspection type reference that can appear in input position. */\nexport type IntrospectionInputTypeRef =\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n | IntrospectionNonNullTypeRef<\n | IntrospectionNamedTypeRef\n | IntrospectionListTypeRef\n >;\n\n/**\n * The introspection representation of a named type reference.\n * @typeParam T - The introspection type represented by this named type reference.\n */\nexport interface IntrospectionNamedTypeRef<\n T extends IntrospectionType = IntrospectionType,\n> {\n /** The introspection kind discriminator for this type reference or type. */\n readonly kind: T['kind'];\n /** The GraphQL name for this schema element. */\n readonly name: string;\n}\n\n/** The introspection representation of a field. */\nexport interface IntrospectionField {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Arguments accepted by this field or directive. */\n readonly args: ReadonlyArray;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: IntrospectionOutputTypeRef;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason: Maybe;\n}\n\n/** The introspection representation of an argument or input field. */\nexport interface IntrospectionInputValue {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** The GraphQL type reference or runtime type for this element. */\n readonly type: IntrospectionInputTypeRef;\n /** Default value used when no explicit value is supplied. */\n readonly defaultValue: Maybe;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated?: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason?: Maybe;\n}\n\n/** The introspection representation of an enum value. */\nexport interface IntrospectionEnumValue {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason: Maybe;\n}\n\n/** The introspection representation of a directive. */\nexport interface IntrospectionDirective {\n /** The GraphQL name for this schema element. */\n readonly name: string;\n /** Human-readable description for this schema element, if provided. */\n readonly description?: Maybe;\n /** Whether this directive may appear more than once at the same location. */\n readonly isRepeatable?: boolean;\n /** Whether this field, argument, enum value, or input value is deprecated. */\n readonly isDeprecated?: boolean;\n /** Reason this element is deprecated, if one was provided. */\n readonly deprecationReason?: Maybe;\n /** Locations where this directive may be applied. */\n readonly locations: ReadonlyArray;\n /** Arguments accepted by this field or directive. */\n readonly args: ReadonlyArray;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.mts new file mode 100644 index 00000000..3613ec97 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.mts @@ -0,0 +1,23 @@ +/** @category Operations */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { DocumentNode, OperationDefinitionNode } from "../language/ast.mjs"; +/** + * Returns an operation AST given a document AST and optionally an operation + * name. If a name is not provided, an operation is only returned if only one is + * provided in the document. + * @param documentAST - The parsed GraphQL document AST. + * @param operationName - The optional operation name to select. + * @returns The resolved operation ast. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { getOperationAST } from 'graphql/utilities'; + * + * const document = parse('query GetName { name }'); + * const operation = getOperationAST(document, 'GetName'); + * + * operation.name.value; // => 'GetName' + * getOperationAST(document, 'Missing'); // => undefined + * ``` + */ +export declare function getOperationAST(documentAST: DocumentNode, operationName?: Maybe): Maybe; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.ts new file mode 100644 index 00000000..951a9c1b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.d.ts @@ -0,0 +1,23 @@ +/** @category Operations */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { DocumentNode, OperationDefinitionNode } from "../language/ast.js"; +/** + * Returns an operation AST given a document AST and optionally an operation + * name. If a name is not provided, an operation is only returned if only one is + * provided in the document. + * @param documentAST - The parsed GraphQL document AST. + * @param operationName - The optional operation name to select. + * @returns The resolved operation ast. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { getOperationAST } from 'graphql/utilities'; + * + * const document = parse('query GetName { name }'); + * const operation = getOperationAST(document, 'GetName'); + * + * operation.name.value; // => 'GetName' + * getOperationAST(document, 'Missing'); // => undefined + * ``` + */ +export declare function getOperationAST(documentAST: DocumentNode, operationName?: Maybe): Maybe; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js new file mode 100644 index 00000000..4c754512 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getOperationAST = getOperationAST; +const kinds_ts_1 = require("../language/kinds.js"); +function getOperationAST(documentAST, operationName) { + let operation = null; + for (const definition of documentAST.definitions) { + if (definition.kind === kinds_ts_1.Kind.OPERATION_DEFINITION) { + if (operationName == null) { + if (operation) { + return null; + } + operation = definition; + } + else if (definition.name?.value === operationName) { + return definition; + } + } + } + return operation; +} +//# sourceMappingURL=getOperationAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js.map new file mode 100644 index 00000000..01649774 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getOperationAST.js","sourceRoot":"","sources":["../../src/utilities/getOperationAST.ts"],"names":[],"mappings":";;AA0BA,0CAqBC;AA1CD,mDAA4C;AAqB5C,SAAgB,eAAe,CAC7B,WAAyB,EACzB,aAA6B;IAE7B,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,KAAK,MAAM,UAAU,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC;QACjD,IAAI,UAAU,CAAC,IAAI,KAAK,eAAI,CAAC,oBAAoB,EAAE,CAAC;YAClD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBAI1B,IAAI,SAAS,EAAE,CAAC;oBACd,OAAO,IAAI,CAAC;gBACd,CAAC;gBACD,SAAS,GAAG,UAAU,CAAC;YACzB,CAAC;iBAAM,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,KAAK,aAAa,EAAE,CAAC;gBACpD,OAAO,UAAU,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/** @category Operations */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { DocumentNode, OperationDefinitionNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Returns an operation AST given a document AST and optionally an operation\n * name. If a name is not provided, an operation is only returned if only one is\n * provided in the document.\n * @param documentAST - The parsed GraphQL document AST.\n * @param operationName - The optional operation name to select.\n * @returns The resolved operation ast.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { getOperationAST } from 'graphql/utilities';\n *\n * const document = parse('query GetName { name }');\n * const operation = getOperationAST(document, 'GetName');\n *\n * operation.name.value; // => 'GetName'\n * getOperationAST(document, 'Missing'); // => undefined\n * ```\n */\nexport function getOperationAST(\n documentAST: DocumentNode,\n operationName?: Maybe,\n): Maybe {\n let operation = null;\n for (const definition of documentAST.definitions) {\n if (definition.kind === Kind.OPERATION_DEFINITION) {\n if (operationName == null) {\n // If no operation name was provided, only return an Operation if there\n // is one defined in the document. Upon encountering the second, return\n // null.\n if (operation) {\n return null;\n }\n operation = definition;\n } else if (definition.name?.value === operationName) {\n return definition;\n }\n }\n }\n return operation;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs new file mode 100644 index 00000000..fe18bac2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs @@ -0,0 +1,19 @@ +import { Kind } from "../language/kinds.mjs"; +export function getOperationAST(documentAST, operationName) { + let operation = null; + for (const definition of documentAST.definitions) { + if (definition.kind === Kind.OPERATION_DEFINITION) { + if (operationName == null) { + if (operation) { + return null; + } + operation = definition; + } + else if (definition.name?.value === operationName) { + return definition; + } + } + } + return operation; +} +//# sourceMappingURL=getOperationAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs.map new file mode 100644 index 00000000..d7b7cb3e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/getOperationAST.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"getOperationAST.js","sourceRoot":"","sources":["../../src/utilities/getOperationAST.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAqB5C,MAAM,UAAU,eAAe,CAC7B,WAAyB,EACzB,aAA6B;IAE7B,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,KAAK,MAAM,UAAU,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC;QACjD,IAAI,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAClD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBAI1B,IAAI,SAAS,EAAE,CAAC;oBACd,OAAO,IAAI,CAAC;gBACd,CAAC;gBACD,SAAS,GAAG,UAAU,CAAC;YACzB,CAAC;iBAAM,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,KAAK,aAAa,EAAE,CAAC;gBACpD,OAAO,UAAU,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/** @category Operations */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type { DocumentNode, OperationDefinitionNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Returns an operation AST given a document AST and optionally an operation\n * name. If a name is not provided, an operation is only returned if only one is\n * provided in the document.\n * @param documentAST - The parsed GraphQL document AST.\n * @param operationName - The optional operation name to select.\n * @returns The resolved operation ast.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { getOperationAST } from 'graphql/utilities';\n *\n * const document = parse('query GetName { name }');\n * const operation = getOperationAST(document, 'GetName');\n *\n * operation.name.value; // => 'GetName'\n * getOperationAST(document, 'Missing'); // => undefined\n * ```\n */\nexport function getOperationAST(\n documentAST: DocumentNode,\n operationName?: Maybe,\n): Maybe {\n let operation = null;\n for (const definition of documentAST.definitions) {\n if (definition.kind === Kind.OPERATION_DEFINITION) {\n if (operationName == null) {\n // If no operation name was provided, only return an Operation if there\n // is one defined in the document. Upon encountering the second, return\n // null.\n if (operation) {\n return null;\n }\n operation = definition;\n } else if (definition.name?.value === operationName) {\n return definition;\n }\n }\n }\n return operation;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.mts new file mode 100644 index 00000000..111e2fbd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.mts @@ -0,0 +1,47 @@ +/** + * Utilities for building schemas, working with introspection, transforming ASTs, + * and comparing GraphQL types. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { getIntrospectionQuery } from "./getIntrospectionQuery.mjs"; +export type { IntrospectionOptions, IntrospectionQuery, IntrospectionSchema, IntrospectionType, IntrospectionInputType, IntrospectionOutputType, IntrospectionScalarType, IntrospectionObjectType, IntrospectionInterfaceType, IntrospectionUnionType, IntrospectionEnumType, IntrospectionInputObjectType, IntrospectionTypeRef, IntrospectionInputTypeRef, IntrospectionOutputTypeRef, IntrospectionNamedTypeRef, IntrospectionListTypeRef, IntrospectionNonNullTypeRef, IntrospectionField, IntrospectionInputValue, IntrospectionEnumValue, IntrospectionDirective, } from "./getIntrospectionQuery.mjs"; +export { getOperationAST } from "./getOperationAST.mjs"; +export { introspectionFromSchema } from "./introspectionFromSchema.mjs"; +export { buildClientSchema } from "./buildClientSchema.mjs"; +export { buildASTSchema, buildSchema } from "./buildASTSchema.mjs"; +export type { BuildSchemaOptions } from "./buildASTSchema.mjs"; +export { extendSchema } from "./extendSchema.mjs"; +export { lexicographicSortSchema } from "./lexicographicSortSchema.mjs"; +export { printSchema, printType, printDirective, printIntrospectionSchema, } from "./printSchema.mjs"; +export { typeFromAST } from "./typeFromAST.mjs"; +export { +/** + * Deprecated export retained for compatibility. Use `coerceInputLiteral()` + * instead. + * @deprecated use `coerceInputLiteral()` instead - will be removed in v18 + */ +valueFromAST, } from "./valueFromAST.mjs"; +export { valueFromASTUntyped } from "./valueFromASTUntyped.mjs"; +export { +/** + * Deprecated export retained for compatibility. Use `valueToLiteral()` + * instead, and take care to operate on external values. + * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18 + */ +astFromValue, } from "./astFromValue.mjs"; +export { TypeInfo, visitWithTypeInfo } from "./TypeInfo.mjs"; +export { replaceVariables } from "./replaceVariables.mjs"; +export { valueToLiteral } from "./valueToLiteral.mjs"; +export { coerceInputValue, coerceInputLiteral, } from "./coerceInputValue.mjs"; +export { validateInputValue, validateInputLiteral, } from "./validateInputValue.mjs"; +export { concatAST } from "./concatAST.mjs"; +export { separateOperations } from "./separateOperations.mjs"; +export { stripIgnoredCharacters } from "./stripIgnoredCharacters.mjs"; +export { isEqualType, isTypeSubTypeOf, doTypesOverlap, } from "./typeComparators.mjs"; +export { BreakingChangeType, DangerousChangeType, SafeChangeType, findBreakingChanges, findDangerousChanges, findSchemaChanges, } from "./findSchemaChanges.mjs"; +export type { BreakingChange, DangerousChange, SafeChange, SchemaChange, } from "./findSchemaChanges.mjs"; +export type { TypedQueryDocumentNode } from "./typedQueryDocumentNode.mjs"; +export { resolveSchemaCoordinate, resolveASTSchemaCoordinate, } from "./resolveSchemaCoordinate.mjs"; +export type { ResolvedSchemaElement } from "./resolveSchemaCoordinate.mjs"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.ts new file mode 100644 index 00000000..0b623296 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.d.ts @@ -0,0 +1,47 @@ +/** + * Utilities for building schemas, working with introspection, transforming ASTs, + * and comparing GraphQL types. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { getIntrospectionQuery } from "./getIntrospectionQuery.js"; +export type { IntrospectionOptions, IntrospectionQuery, IntrospectionSchema, IntrospectionType, IntrospectionInputType, IntrospectionOutputType, IntrospectionScalarType, IntrospectionObjectType, IntrospectionInterfaceType, IntrospectionUnionType, IntrospectionEnumType, IntrospectionInputObjectType, IntrospectionTypeRef, IntrospectionInputTypeRef, IntrospectionOutputTypeRef, IntrospectionNamedTypeRef, IntrospectionListTypeRef, IntrospectionNonNullTypeRef, IntrospectionField, IntrospectionInputValue, IntrospectionEnumValue, IntrospectionDirective, } from "./getIntrospectionQuery.js"; +export { getOperationAST } from "./getOperationAST.js"; +export { introspectionFromSchema } from "./introspectionFromSchema.js"; +export { buildClientSchema } from "./buildClientSchema.js"; +export { buildASTSchema, buildSchema } from "./buildASTSchema.js"; +export type { BuildSchemaOptions } from "./buildASTSchema.js"; +export { extendSchema } from "./extendSchema.js"; +export { lexicographicSortSchema } from "./lexicographicSortSchema.js"; +export { printSchema, printType, printDirective, printIntrospectionSchema, } from "./printSchema.js"; +export { typeFromAST } from "./typeFromAST.js"; +export { +/** + * Deprecated export retained for compatibility. Use `coerceInputLiteral()` + * instead. + * @deprecated use `coerceInputLiteral()` instead - will be removed in v18 + */ +valueFromAST, } from "./valueFromAST.js"; +export { valueFromASTUntyped } from "./valueFromASTUntyped.js"; +export { +/** + * Deprecated export retained for compatibility. Use `valueToLiteral()` + * instead, and take care to operate on external values. + * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18 + */ +astFromValue, } from "./astFromValue.js"; +export { TypeInfo, visitWithTypeInfo } from "./TypeInfo.js"; +export { replaceVariables } from "./replaceVariables.js"; +export { valueToLiteral } from "./valueToLiteral.js"; +export { coerceInputValue, coerceInputLiteral, } from "./coerceInputValue.js"; +export { validateInputValue, validateInputLiteral, } from "./validateInputValue.js"; +export { concatAST } from "./concatAST.js"; +export { separateOperations } from "./separateOperations.js"; +export { stripIgnoredCharacters } from "./stripIgnoredCharacters.js"; +export { isEqualType, isTypeSubTypeOf, doTypesOverlap, } from "./typeComparators.js"; +export { BreakingChangeType, DangerousChangeType, SafeChangeType, findBreakingChanges, findDangerousChanges, findSchemaChanges, } from "./findSchemaChanges.js"; +export type { BreakingChange, DangerousChange, SafeChange, SchemaChange, } from "./findSchemaChanges.js"; +export type { TypedQueryDocumentNode } from "./typedQueryDocumentNode.js"; +export { resolveSchemaCoordinate, resolveASTSchemaCoordinate, } from "./resolveSchemaCoordinate.js"; +export type { ResolvedSchemaElement } from "./resolveSchemaCoordinate.js"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js new file mode 100644 index 00000000..9887238b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveASTSchemaCoordinate = exports.resolveSchemaCoordinate = exports.findSchemaChanges = exports.findDangerousChanges = exports.findBreakingChanges = exports.SafeChangeType = exports.DangerousChangeType = exports.BreakingChangeType = exports.doTypesOverlap = exports.isTypeSubTypeOf = exports.isEqualType = exports.stripIgnoredCharacters = exports.separateOperations = exports.concatAST = exports.validateInputLiteral = exports.validateInputValue = exports.coerceInputLiteral = exports.coerceInputValue = exports.valueToLiteral = exports.replaceVariables = exports.visitWithTypeInfo = exports.TypeInfo = exports.astFromValue = exports.valueFromASTUntyped = exports.valueFromAST = exports.typeFromAST = exports.printIntrospectionSchema = exports.printDirective = exports.printType = exports.printSchema = exports.lexicographicSortSchema = exports.extendSchema = exports.buildSchema = exports.buildASTSchema = exports.buildClientSchema = exports.introspectionFromSchema = exports.getOperationAST = exports.getIntrospectionQuery = void 0; +var getIntrospectionQuery_ts_1 = require("./getIntrospectionQuery.js"); +Object.defineProperty(exports, "getIntrospectionQuery", { enumerable: true, get: function () { return getIntrospectionQuery_ts_1.getIntrospectionQuery; } }); +var getOperationAST_ts_1 = require("./getOperationAST.js"); +Object.defineProperty(exports, "getOperationAST", { enumerable: true, get: function () { return getOperationAST_ts_1.getOperationAST; } }); +var introspectionFromSchema_ts_1 = require("./introspectionFromSchema.js"); +Object.defineProperty(exports, "introspectionFromSchema", { enumerable: true, get: function () { return introspectionFromSchema_ts_1.introspectionFromSchema; } }); +var buildClientSchema_ts_1 = require("./buildClientSchema.js"); +Object.defineProperty(exports, "buildClientSchema", { enumerable: true, get: function () { return buildClientSchema_ts_1.buildClientSchema; } }); +var buildASTSchema_ts_1 = require("./buildASTSchema.js"); +Object.defineProperty(exports, "buildASTSchema", { enumerable: true, get: function () { return buildASTSchema_ts_1.buildASTSchema; } }); +Object.defineProperty(exports, "buildSchema", { enumerable: true, get: function () { return buildASTSchema_ts_1.buildSchema; } }); +var extendSchema_ts_1 = require("./extendSchema.js"); +Object.defineProperty(exports, "extendSchema", { enumerable: true, get: function () { return extendSchema_ts_1.extendSchema; } }); +var lexicographicSortSchema_ts_1 = require("./lexicographicSortSchema.js"); +Object.defineProperty(exports, "lexicographicSortSchema", { enumerable: true, get: function () { return lexicographicSortSchema_ts_1.lexicographicSortSchema; } }); +var printSchema_ts_1 = require("./printSchema.js"); +Object.defineProperty(exports, "printSchema", { enumerable: true, get: function () { return printSchema_ts_1.printSchema; } }); +Object.defineProperty(exports, "printType", { enumerable: true, get: function () { return printSchema_ts_1.printType; } }); +Object.defineProperty(exports, "printDirective", { enumerable: true, get: function () { return printSchema_ts_1.printDirective; } }); +Object.defineProperty(exports, "printIntrospectionSchema", { enumerable: true, get: function () { return printSchema_ts_1.printIntrospectionSchema; } }); +var typeFromAST_ts_1 = require("./typeFromAST.js"); +Object.defineProperty(exports, "typeFromAST", { enumerable: true, get: function () { return typeFromAST_ts_1.typeFromAST; } }); +var valueFromAST_ts_1 = require("./valueFromAST.js"); +Object.defineProperty(exports, "valueFromAST", { enumerable: true, get: function () { return valueFromAST_ts_1.valueFromAST; } }); +var valueFromASTUntyped_ts_1 = require("./valueFromASTUntyped.js"); +Object.defineProperty(exports, "valueFromASTUntyped", { enumerable: true, get: function () { return valueFromASTUntyped_ts_1.valueFromASTUntyped; } }); +var astFromValue_ts_1 = require("./astFromValue.js"); +Object.defineProperty(exports, "astFromValue", { enumerable: true, get: function () { return astFromValue_ts_1.astFromValue; } }); +var TypeInfo_ts_1 = require("./TypeInfo.js"); +Object.defineProperty(exports, "TypeInfo", { enumerable: true, get: function () { return TypeInfo_ts_1.TypeInfo; } }); +Object.defineProperty(exports, "visitWithTypeInfo", { enumerable: true, get: function () { return TypeInfo_ts_1.visitWithTypeInfo; } }); +var replaceVariables_ts_1 = require("./replaceVariables.js"); +Object.defineProperty(exports, "replaceVariables", { enumerable: true, get: function () { return replaceVariables_ts_1.replaceVariables; } }); +var valueToLiteral_ts_1 = require("./valueToLiteral.js"); +Object.defineProperty(exports, "valueToLiteral", { enumerable: true, get: function () { return valueToLiteral_ts_1.valueToLiteral; } }); +var coerceInputValue_ts_1 = require("./coerceInputValue.js"); +Object.defineProperty(exports, "coerceInputValue", { enumerable: true, get: function () { return coerceInputValue_ts_1.coerceInputValue; } }); +Object.defineProperty(exports, "coerceInputLiteral", { enumerable: true, get: function () { return coerceInputValue_ts_1.coerceInputLiteral; } }); +var validateInputValue_ts_1 = require("./validateInputValue.js"); +Object.defineProperty(exports, "validateInputValue", { enumerable: true, get: function () { return validateInputValue_ts_1.validateInputValue; } }); +Object.defineProperty(exports, "validateInputLiteral", { enumerable: true, get: function () { return validateInputValue_ts_1.validateInputLiteral; } }); +var concatAST_ts_1 = require("./concatAST.js"); +Object.defineProperty(exports, "concatAST", { enumerable: true, get: function () { return concatAST_ts_1.concatAST; } }); +var separateOperations_ts_1 = require("./separateOperations.js"); +Object.defineProperty(exports, "separateOperations", { enumerable: true, get: function () { return separateOperations_ts_1.separateOperations; } }); +var stripIgnoredCharacters_ts_1 = require("./stripIgnoredCharacters.js"); +Object.defineProperty(exports, "stripIgnoredCharacters", { enumerable: true, get: function () { return stripIgnoredCharacters_ts_1.stripIgnoredCharacters; } }); +var typeComparators_ts_1 = require("./typeComparators.js"); +Object.defineProperty(exports, "isEqualType", { enumerable: true, get: function () { return typeComparators_ts_1.isEqualType; } }); +Object.defineProperty(exports, "isTypeSubTypeOf", { enumerable: true, get: function () { return typeComparators_ts_1.isTypeSubTypeOf; } }); +Object.defineProperty(exports, "doTypesOverlap", { enumerable: true, get: function () { return typeComparators_ts_1.doTypesOverlap; } }); +var findSchemaChanges_ts_1 = require("./findSchemaChanges.js"); +Object.defineProperty(exports, "BreakingChangeType", { enumerable: true, get: function () { return findSchemaChanges_ts_1.BreakingChangeType; } }); +Object.defineProperty(exports, "DangerousChangeType", { enumerable: true, get: function () { return findSchemaChanges_ts_1.DangerousChangeType; } }); +Object.defineProperty(exports, "SafeChangeType", { enumerable: true, get: function () { return findSchemaChanges_ts_1.SafeChangeType; } }); +Object.defineProperty(exports, "findBreakingChanges", { enumerable: true, get: function () { return findSchemaChanges_ts_1.findBreakingChanges; } }); +Object.defineProperty(exports, "findDangerousChanges", { enumerable: true, get: function () { return findSchemaChanges_ts_1.findDangerousChanges; } }); +Object.defineProperty(exports, "findSchemaChanges", { enumerable: true, get: function () { return findSchemaChanges_ts_1.findSchemaChanges; } }); +var resolveSchemaCoordinate_ts_1 = require("./resolveSchemaCoordinate.js"); +Object.defineProperty(exports, "resolveSchemaCoordinate", { enumerable: true, get: function () { return resolveSchemaCoordinate_ts_1.resolveSchemaCoordinate; } }); +Object.defineProperty(exports, "resolveASTSchemaCoordinate", { enumerable: true, get: function () { return resolveSchemaCoordinate_ts_1.resolveASTSchemaCoordinate; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js.map new file mode 100644 index 00000000..bf23348e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":";;;AASA,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AA4B9B,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AAG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sC;AAFpC,qIAAA,uBAAuB,OAAA;AACvB,wIAAA,0BAA0B,OAAA","sourcesContent":["/**\n * Utilities for building schemas, working with introspection, transforming ASTs,\n * and comparing GraphQL types.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\n// Produce the GraphQL query recommended for a full schema introspection.\nexport { getIntrospectionQuery } from './getIntrospectionQuery.ts';\n\nexport type {\n IntrospectionOptions,\n IntrospectionQuery,\n IntrospectionSchema,\n IntrospectionType,\n IntrospectionInputType,\n IntrospectionOutputType,\n IntrospectionScalarType,\n IntrospectionObjectType,\n IntrospectionInterfaceType,\n IntrospectionUnionType,\n IntrospectionEnumType,\n IntrospectionInputObjectType,\n IntrospectionTypeRef,\n IntrospectionInputTypeRef,\n IntrospectionOutputTypeRef,\n IntrospectionNamedTypeRef,\n IntrospectionListTypeRef,\n IntrospectionNonNullTypeRef,\n IntrospectionField,\n IntrospectionInputValue,\n IntrospectionEnumValue,\n IntrospectionDirective,\n} from './getIntrospectionQuery.ts';\n\n// Gets the target Operation from a Document.\nexport { getOperationAST } from './getOperationAST.ts';\n\n// Convert a GraphQLSchema to an IntrospectionQuery.\nexport { introspectionFromSchema } from './introspectionFromSchema.ts';\n\n// Build a GraphQLSchema from an introspection result.\nexport { buildClientSchema } from './buildClientSchema.ts';\n\n// Build a GraphQLSchema from GraphQL Schema language.\nexport { buildASTSchema, buildSchema } from './buildASTSchema.ts';\nexport type { BuildSchemaOptions } from './buildASTSchema.ts';\n\n// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.\nexport { extendSchema } from './extendSchema.ts';\n\n// Sort a GraphQLSchema.\nexport { lexicographicSortSchema } from './lexicographicSortSchema.ts';\n\n// Print a GraphQLSchema to GraphQL Schema language.\nexport {\n printSchema,\n printType,\n printDirective,\n printIntrospectionSchema,\n} from './printSchema.ts';\n\n// Create a GraphQLType from a GraphQL language AST.\nexport { typeFromAST } from './typeFromAST.ts';\n\n// Create a JavaScript value from a GraphQL language AST with a type.\nexport {\n /**\n * Deprecated export retained for compatibility. Use `coerceInputLiteral()`\n * instead.\n * @deprecated use `coerceInputLiteral()` instead - will be removed in v18\n */\n valueFromAST,\n} from './valueFromAST.ts';\n\n// Create a JavaScript value from a GraphQL language AST without a type.\nexport { valueFromASTUntyped } from './valueFromASTUntyped.ts';\n\n// Create a GraphQL language AST from a JavaScript value.\nexport {\n /**\n * Deprecated export retained for compatibility. Use `valueToLiteral()`\n * instead, and take care to operate on external values.\n * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18\n */\n astFromValue,\n} from './astFromValue.ts';\n\n// A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system.\nexport { TypeInfo, visitWithTypeInfo } from './TypeInfo.ts';\n\n// Converts a value to a const value by replacing variables.\nexport { replaceVariables } from './replaceVariables.ts';\n\n// Create a GraphQL literal (AST) from a JavaScript input value.\nexport { valueToLiteral } from './valueToLiteral.ts';\n\nexport {\n // Coerces a JavaScript value to a GraphQL type, or returns undefined.\n coerceInputValue,\n // Coerces a GraphQL literal (AST) to a GraphQL type, or returns undefined.\n coerceInputLiteral,\n} from './coerceInputValue.ts';\n\nexport {\n // Validate a JavaScript value with a GraphQL type, collecting all errors.\n validateInputValue,\n // Validate a GraphQL literal (AST) with a GraphQL type, collecting all errors.\n validateInputLiteral,\n} from './validateInputValue.ts';\n\n// Concatenates multiple AST together.\nexport { concatAST } from './concatAST.ts';\n\n// Separates an AST into an AST per Operation.\nexport { separateOperations } from './separateOperations.ts';\n\n// Strips characters that are not significant to the validity or execution of a GraphQL document.\nexport { stripIgnoredCharacters } from './stripIgnoredCharacters.ts';\n\n// Comparators for types\nexport {\n isEqualType,\n isTypeSubTypeOf,\n doTypesOverlap,\n} from './typeComparators.ts';\n\n// Compares two GraphQLSchemas and detects breaking changes.\nexport {\n BreakingChangeType,\n DangerousChangeType,\n SafeChangeType,\n findBreakingChanges,\n findDangerousChanges,\n findSchemaChanges,\n} from './findSchemaChanges.ts';\nexport type {\n BreakingChange,\n DangerousChange,\n SafeChange,\n SchemaChange,\n} from './findSchemaChanges.ts';\n\n// Wrapper type that contains DocumentNode and types that can be deduced from it.\nexport type { TypedQueryDocumentNode } from './typedQueryDocumentNode.ts';\n\n// Schema coordinates\nexport {\n resolveSchemaCoordinate,\n resolveASTSchemaCoordinate,\n} from './resolveSchemaCoordinate.ts';\nexport type { ResolvedSchemaElement } from './resolveSchemaCoordinate.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs new file mode 100644 index 00000000..fe6a27a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs @@ -0,0 +1,24 @@ +export { getIntrospectionQuery } from "./getIntrospectionQuery.mjs"; +export { getOperationAST } from "./getOperationAST.mjs"; +export { introspectionFromSchema } from "./introspectionFromSchema.mjs"; +export { buildClientSchema } from "./buildClientSchema.mjs"; +export { buildASTSchema, buildSchema } from "./buildASTSchema.mjs"; +export { extendSchema } from "./extendSchema.mjs"; +export { lexicographicSortSchema } from "./lexicographicSortSchema.mjs"; +export { printSchema, printType, printDirective, printIntrospectionSchema, } from "./printSchema.mjs"; +export { typeFromAST } from "./typeFromAST.mjs"; +export { valueFromAST, } from "./valueFromAST.mjs"; +export { valueFromASTUntyped } from "./valueFromASTUntyped.mjs"; +export { astFromValue, } from "./astFromValue.mjs"; +export { TypeInfo, visitWithTypeInfo } from "./TypeInfo.mjs"; +export { replaceVariables } from "./replaceVariables.mjs"; +export { valueToLiteral } from "./valueToLiteral.mjs"; +export { coerceInputValue, coerceInputLiteral, } from "./coerceInputValue.mjs"; +export { validateInputValue, validateInputLiteral, } from "./validateInputValue.mjs"; +export { concatAST } from "./concatAST.mjs"; +export { separateOperations } from "./separateOperations.mjs"; +export { stripIgnoredCharacters } from "./stripIgnoredCharacters.mjs"; +export { isEqualType, isTypeSubTypeOf, doTypesOverlap, } from "./typeComparators.mjs"; +export { BreakingChangeType, DangerousChangeType, SafeChangeType, findBreakingChanges, findDangerousChanges, findSchemaChanges, } from "./findSchemaChanges.mjs"; +export { resolveSchemaCoordinate, resolveASTSchemaCoordinate, } from "./resolveSchemaCoordinate.mjs"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs.map new file mode 100644 index 00000000..2ffd2aa8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AA4BnE,OAAO,EAAE,eAAe,EAAE,8BAA6B;AAGvD,OAAO,EAAE,uBAAuB,EAAE,sCAAqC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,gCAA+B;AAG3D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,6BAA4B;AAIlE,OAAO,EAAE,YAAY,EAAE,2BAA0B;AAGjD,OAAO,EAAE,uBAAuB,EAAE,sCAAqC;AAGvE,OAAO,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,wBAAwB,GACzB,0BAAyB;AAG1B,OAAO,EAAE,WAAW,EAAE,0BAAyB;AAG/C,OAAO,EAML,YAAY,GACb,2BAA0B;AAG3B,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAG/D,OAAO,EAML,YAAY,GACb,2BAA0B;AAG3B,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,uBAAsB;AAG5D,OAAO,EAAE,gBAAgB,EAAE,+BAA8B;AAGzD,OAAO,EAAE,cAAc,EAAE,6BAA4B;AAErD,OAAO,EAEL,gBAAgB,EAEhB,kBAAkB,GACnB,+BAA8B;AAE/B,OAAO,EAEL,kBAAkB,EAElB,oBAAoB,GACrB,iCAAgC;AAGjC,OAAO,EAAE,SAAS,EAAE,wBAAuB;AAG3C,OAAO,EAAE,kBAAkB,EAAE,iCAAgC;AAG7D,OAAO,EAAE,sBAAsB,EAAE,qCAAoC;AAGrE,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,GACf,8BAA6B;AAG9B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,gCAA+B;AAYhC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,sCAAqC","sourcesContent":["/**\n * Utilities for building schemas, working with introspection, transforming ASTs,\n * and comparing GraphQL types.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\n// Produce the GraphQL query recommended for a full schema introspection.\nexport { getIntrospectionQuery } from './getIntrospectionQuery.ts';\n\nexport type {\n IntrospectionOptions,\n IntrospectionQuery,\n IntrospectionSchema,\n IntrospectionType,\n IntrospectionInputType,\n IntrospectionOutputType,\n IntrospectionScalarType,\n IntrospectionObjectType,\n IntrospectionInterfaceType,\n IntrospectionUnionType,\n IntrospectionEnumType,\n IntrospectionInputObjectType,\n IntrospectionTypeRef,\n IntrospectionInputTypeRef,\n IntrospectionOutputTypeRef,\n IntrospectionNamedTypeRef,\n IntrospectionListTypeRef,\n IntrospectionNonNullTypeRef,\n IntrospectionField,\n IntrospectionInputValue,\n IntrospectionEnumValue,\n IntrospectionDirective,\n} from './getIntrospectionQuery.ts';\n\n// Gets the target Operation from a Document.\nexport { getOperationAST } from './getOperationAST.ts';\n\n// Convert a GraphQLSchema to an IntrospectionQuery.\nexport { introspectionFromSchema } from './introspectionFromSchema.ts';\n\n// Build a GraphQLSchema from an introspection result.\nexport { buildClientSchema } from './buildClientSchema.ts';\n\n// Build a GraphQLSchema from GraphQL Schema language.\nexport { buildASTSchema, buildSchema } from './buildASTSchema.ts';\nexport type { BuildSchemaOptions } from './buildASTSchema.ts';\n\n// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.\nexport { extendSchema } from './extendSchema.ts';\n\n// Sort a GraphQLSchema.\nexport { lexicographicSortSchema } from './lexicographicSortSchema.ts';\n\n// Print a GraphQLSchema to GraphQL Schema language.\nexport {\n printSchema,\n printType,\n printDirective,\n printIntrospectionSchema,\n} from './printSchema.ts';\n\n// Create a GraphQLType from a GraphQL language AST.\nexport { typeFromAST } from './typeFromAST.ts';\n\n// Create a JavaScript value from a GraphQL language AST with a type.\nexport {\n /**\n * Deprecated export retained for compatibility. Use `coerceInputLiteral()`\n * instead.\n * @deprecated use `coerceInputLiteral()` instead - will be removed in v18\n */\n valueFromAST,\n} from './valueFromAST.ts';\n\n// Create a JavaScript value from a GraphQL language AST without a type.\nexport { valueFromASTUntyped } from './valueFromASTUntyped.ts';\n\n// Create a GraphQL language AST from a JavaScript value.\nexport {\n /**\n * Deprecated export retained for compatibility. Use `valueToLiteral()`\n * instead, and take care to operate on external values.\n * @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18\n */\n astFromValue,\n} from './astFromValue.ts';\n\n// A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system.\nexport { TypeInfo, visitWithTypeInfo } from './TypeInfo.ts';\n\n// Converts a value to a const value by replacing variables.\nexport { replaceVariables } from './replaceVariables.ts';\n\n// Create a GraphQL literal (AST) from a JavaScript input value.\nexport { valueToLiteral } from './valueToLiteral.ts';\n\nexport {\n // Coerces a JavaScript value to a GraphQL type, or returns undefined.\n coerceInputValue,\n // Coerces a GraphQL literal (AST) to a GraphQL type, or returns undefined.\n coerceInputLiteral,\n} from './coerceInputValue.ts';\n\nexport {\n // Validate a JavaScript value with a GraphQL type, collecting all errors.\n validateInputValue,\n // Validate a GraphQL literal (AST) with a GraphQL type, collecting all errors.\n validateInputLiteral,\n} from './validateInputValue.ts';\n\n// Concatenates multiple AST together.\nexport { concatAST } from './concatAST.ts';\n\n// Separates an AST into an AST per Operation.\nexport { separateOperations } from './separateOperations.ts';\n\n// Strips characters that are not significant to the validity or execution of a GraphQL document.\nexport { stripIgnoredCharacters } from './stripIgnoredCharacters.ts';\n\n// Comparators for types\nexport {\n isEqualType,\n isTypeSubTypeOf,\n doTypesOverlap,\n} from './typeComparators.ts';\n\n// Compares two GraphQLSchemas and detects breaking changes.\nexport {\n BreakingChangeType,\n DangerousChangeType,\n SafeChangeType,\n findBreakingChanges,\n findDangerousChanges,\n findSchemaChanges,\n} from './findSchemaChanges.ts';\nexport type {\n BreakingChange,\n DangerousChange,\n SafeChange,\n SchemaChange,\n} from './findSchemaChanges.ts';\n\n// Wrapper type that contains DocumentNode and types that can be deduced from it.\nexport type { TypedQueryDocumentNode } from './typedQueryDocumentNode.ts';\n\n// Schema coordinates\nexport {\n resolveSchemaCoordinate,\n resolveASTSchemaCoordinate,\n} from './resolveSchemaCoordinate.ts';\nexport type { ResolvedSchemaElement } from './resolveSchemaCoordinate.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.mts new file mode 100644 index 00000000..dff23cf0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.mts @@ -0,0 +1,70 @@ +/** @category Introspection */ +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { IntrospectionOptions, IntrospectionQuery } from "./getIntrospectionQuery.mjs"; +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + * @param schema - GraphQL schema to use. + * @param options - Optional configuration for this operation. + * @returns Introspection result data for the schema. + * @example + * ```ts + * // Include schema metadata using the default introspection options. + * import { buildSchema, introspectionFromSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * scalar Url @specifiedBy(url: "https://url.spec.whatwg.org/") + * + * type Query { + * homepage: Url + * } + * `); + * + * const introspection = introspectionFromSchema(schema); + * const urlType = introspection.__schema.types.find( + * (type) => type.name === 'Url', + * ); + * + * urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/' + * ``` + * @example + * ```ts + * // This variant disables optional introspection metadata. + * import { buildSchema, introspectionFromSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * scalar Url @specifiedBy(url: "https://url.spec.whatwg.org/") + * + * type Query { + * homepage: Url + * } + * `); + * + * const introspection = introspectionFromSchema(schema, { + * descriptions: false, + * specifiedByUrl: false, + * directiveIsRepeatable: false, + * schemaDescription: false, + * inputValueDeprecation: false, + * experimentalDirectiveDeprecation: false, + * oneOf: false, + * }); + * const urlType = introspection.__schema.types.find( + * (type) => type.name === 'Url', + * ); + * const deprecatedDirective = introspection.__schema.directives.find( + * (directive) => directive.name === 'deprecated', + * ); + * + * urlType.specifiedByURL; // => undefined + * urlType.description; // => undefined + * introspection.__schema.description; // => undefined + * deprecatedDirective.isRepeatable; // => undefined + * ``` + */ +export declare function introspectionFromSchema(schema: GraphQLSchema, options?: IntrospectionOptions): IntrospectionQuery; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.ts new file mode 100644 index 00000000..da34aa2b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.d.ts @@ -0,0 +1,70 @@ +/** @category Introspection */ +import type { GraphQLSchema } from "../type/schema.js"; +import type { IntrospectionOptions, IntrospectionQuery } from "./getIntrospectionQuery.js"; +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + * @param schema - GraphQL schema to use. + * @param options - Optional configuration for this operation. + * @returns Introspection result data for the schema. + * @example + * ```ts + * // Include schema metadata using the default introspection options. + * import { buildSchema, introspectionFromSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * scalar Url @specifiedBy(url: "https://url.spec.whatwg.org/") + * + * type Query { + * homepage: Url + * } + * `); + * + * const introspection = introspectionFromSchema(schema); + * const urlType = introspection.__schema.types.find( + * (type) => type.name === 'Url', + * ); + * + * urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/' + * ``` + * @example + * ```ts + * // This variant disables optional introspection metadata. + * import { buildSchema, introspectionFromSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * scalar Url @specifiedBy(url: "https://url.spec.whatwg.org/") + * + * type Query { + * homepage: Url + * } + * `); + * + * const introspection = introspectionFromSchema(schema, { + * descriptions: false, + * specifiedByUrl: false, + * directiveIsRepeatable: false, + * schemaDescription: false, + * inputValueDeprecation: false, + * experimentalDirectiveDeprecation: false, + * oneOf: false, + * }); + * const urlType = introspection.__schema.types.find( + * (type) => type.name === 'Url', + * ); + * const deprecatedDirective = introspection.__schema.directives.find( + * (directive) => directive.name === 'deprecated', + * ); + * + * urlType.specifiedByURL; // => undefined + * urlType.description; // => undefined + * introspection.__schema.description; // => undefined + * deprecatedDirective.isRepeatable; // => undefined + * ``` + */ +export declare function introspectionFromSchema(schema: GraphQLSchema, options?: IntrospectionOptions): IntrospectionQuery; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js new file mode 100644 index 00000000..7c0d7920 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.introspectionFromSchema = introspectionFromSchema; +const invariant_ts_1 = require("../jsutils/invariant.js"); +const parser_ts_1 = require("../language/parser.js"); +const execute_ts_1 = require("../execution/execute.js"); +const getIntrospectionQuery_ts_1 = require("./getIntrospectionQuery.js"); +function introspectionFromSchema(schema, options) { + const optionsWithDefaults = { + specifiedByUrl: true, + directiveIsRepeatable: true, + schemaDescription: true, + inputValueDeprecation: true, + experimentalDirectiveDeprecation: true, + oneOf: true, + ...options, + }; + const document = (0, parser_ts_1.parse)((0, getIntrospectionQuery_ts_1.getIntrospectionQuery)(optionsWithDefaults)); + const result = (0, execute_ts_1.executeSync)({ schema, document }); + if (!(result.errors == null && result.data != null)) + (0, invariant_ts_1.invariant)(false); + return result.data; +} +//# sourceMappingURL=introspectionFromSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js.map new file mode 100644 index 00000000..03a77b58 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"introspectionFromSchema.js","sourceRoot":"","sources":["../../src/utilities/introspectionFromSchema.ts"],"names":[],"mappings":";;AAkFA,0DAkBC;AAlGD,0DAAoD;AAEpD,qDAA8C;AAI9C,wDAAsD;AAMtD,yEAAmE;AAoEnE,SAAgB,uBAAuB,CACrC,MAAqB,EACrB,OAA8B;IAE9B,MAAM,mBAAmB,GAAG;QAC1B,cAAc,EAAE,IAAI;QACpB,qBAAqB,EAAE,IAAI;QAC3B,iBAAiB,EAAE,IAAI;QACvB,qBAAqB,EAAE,IAAI;QAC3B,gCAAgC,EAAE,IAAI;QACtC,KAAK,EAAE,IAAI;QACX,GAAG,OAAO;KACX,CAAC;IAEF,MAAM,QAAQ,GAAG,IAAA,iBAAK,EAAC,IAAA,gDAAqB,EAAC,mBAAmB,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAA,wBAAW,EAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;UACvC,MAAM,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI;YAAtD,wBAAS;IACT,OAAO,MAAM,CAAC,IAAW,CAAC;AAC5B,CAAC","sourcesContent":["/** @category Introspection */\n\nimport { invariant } from '../jsutils/invariant.ts';\n\nimport { parse } from '../language/parser.ts';\n\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { executeSync } from '../execution/execute.ts';\n\nimport type {\n IntrospectionOptions,\n IntrospectionQuery,\n} from './getIntrospectionQuery.ts';\nimport { getIntrospectionQuery } from './getIntrospectionQuery.ts';\n\n/**\n * Build an IntrospectionQuery from a GraphQLSchema\n *\n * IntrospectionQuery is useful for utilities that care about type and field\n * relationships, but do not need to traverse through those relationships.\n *\n * This is the inverse of buildClientSchema. The primary use case is outside\n * of the server context, for instance when doing schema comparisons.\n * @param schema - GraphQL schema to use.\n * @param options - Optional configuration for this operation.\n * @returns Introspection result data for the schema.\n * @example\n * ```ts\n * // Include schema metadata using the default introspection options.\n * import { buildSchema, introspectionFromSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * scalar Url @specifiedBy(url: \"https://url.spec.whatwg.org/\")\n *\n * type Query {\n * homepage: Url\n * }\n * `);\n *\n * const introspection = introspectionFromSchema(schema);\n * const urlType = introspection.__schema.types.find(\n * (type) => type.name === 'Url',\n * );\n *\n * urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/'\n * ```\n * @example\n * ```ts\n * // This variant disables optional introspection metadata.\n * import { buildSchema, introspectionFromSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * scalar Url @specifiedBy(url: \"https://url.spec.whatwg.org/\")\n *\n * type Query {\n * homepage: Url\n * }\n * `);\n *\n * const introspection = introspectionFromSchema(schema, {\n * descriptions: false,\n * specifiedByUrl: false,\n * directiveIsRepeatable: false,\n * schemaDescription: false,\n * inputValueDeprecation: false,\n * experimentalDirectiveDeprecation: false,\n * oneOf: false,\n * });\n * const urlType = introspection.__schema.types.find(\n * (type) => type.name === 'Url',\n * );\n * const deprecatedDirective = introspection.__schema.directives.find(\n * (directive) => directive.name === 'deprecated',\n * );\n *\n * urlType.specifiedByURL; // => undefined\n * urlType.description; // => undefined\n * introspection.__schema.description; // => undefined\n * deprecatedDirective.isRepeatable; // => undefined\n * ```\n */\nexport function introspectionFromSchema(\n schema: GraphQLSchema,\n options?: IntrospectionOptions,\n): IntrospectionQuery {\n const optionsWithDefaults = {\n specifiedByUrl: true,\n directiveIsRepeatable: true,\n schemaDescription: true,\n inputValueDeprecation: true,\n experimentalDirectiveDeprecation: true,\n oneOf: true,\n ...options,\n };\n\n const document = parse(getIntrospectionQuery(optionsWithDefaults));\n const result = executeSync({ schema, document });\n invariant(result.errors == null && result.data != null);\n return result.data as any;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs new file mode 100644 index 00000000..9df080e8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs @@ -0,0 +1,21 @@ +import { invariant } from "../jsutils/invariant.mjs"; +import { parse } from "../language/parser.mjs"; +import { executeSync } from "../execution/execute.mjs"; +import { getIntrospectionQuery } from "./getIntrospectionQuery.mjs"; +export function introspectionFromSchema(schema, options) { + const optionsWithDefaults = { + specifiedByUrl: true, + directiveIsRepeatable: true, + schemaDescription: true, + inputValueDeprecation: true, + experimentalDirectiveDeprecation: true, + oneOf: true, + ...options, + }; + const document = parse(getIntrospectionQuery(optionsWithDefaults)); + const result = executeSync({ schema, document }); + if (!(result.errors == null && result.data != null)) + invariant(false); + return result.data; +} +//# sourceMappingURL=introspectionFromSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs.map new file mode 100644 index 00000000..4db95768 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/introspectionFromSchema.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"introspectionFromSchema.js","sourceRoot":"","sources":["../../src/utilities/introspectionFromSchema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAEpD,OAAO,EAAE,KAAK,EAAE,+BAA8B;AAI9C,OAAO,EAAE,WAAW,EAAE,iCAAgC;AAMtD,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AAoEnE,MAAM,UAAU,uBAAuB,CACrC,MAAqB,EACrB,OAA8B;IAE9B,MAAM,mBAAmB,GAAG;QAC1B,cAAc,EAAE,IAAI;QACpB,qBAAqB,EAAE,IAAI;QAC3B,iBAAiB,EAAE,IAAI;QACvB,qBAAqB,EAAE,IAAI;QAC3B,gCAAgC,EAAE,IAAI;QACtC,KAAK,EAAE,IAAI;QACX,GAAG,OAAO;KACX,CAAC;IAEF,MAAM,QAAQ,GAAG,KAAK,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;UACvC,MAAM,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI;QAAtD,SAAS;IACT,OAAO,MAAM,CAAC,IAAW,CAAC;AAC5B,CAAC","sourcesContent":["/** @category Introspection */\n\nimport { invariant } from '../jsutils/invariant.ts';\n\nimport { parse } from '../language/parser.ts';\n\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { executeSync } from '../execution/execute.ts';\n\nimport type {\n IntrospectionOptions,\n IntrospectionQuery,\n} from './getIntrospectionQuery.ts';\nimport { getIntrospectionQuery } from './getIntrospectionQuery.ts';\n\n/**\n * Build an IntrospectionQuery from a GraphQLSchema\n *\n * IntrospectionQuery is useful for utilities that care about type and field\n * relationships, but do not need to traverse through those relationships.\n *\n * This is the inverse of buildClientSchema. The primary use case is outside\n * of the server context, for instance when doing schema comparisons.\n * @param schema - GraphQL schema to use.\n * @param options - Optional configuration for this operation.\n * @returns Introspection result data for the schema.\n * @example\n * ```ts\n * // Include schema metadata using the default introspection options.\n * import { buildSchema, introspectionFromSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * scalar Url @specifiedBy(url: \"https://url.spec.whatwg.org/\")\n *\n * type Query {\n * homepage: Url\n * }\n * `);\n *\n * const introspection = introspectionFromSchema(schema);\n * const urlType = introspection.__schema.types.find(\n * (type) => type.name === 'Url',\n * );\n *\n * urlType.specifiedByURL; // => 'https://url.spec.whatwg.org/'\n * ```\n * @example\n * ```ts\n * // This variant disables optional introspection metadata.\n * import { buildSchema, introspectionFromSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * scalar Url @specifiedBy(url: \"https://url.spec.whatwg.org/\")\n *\n * type Query {\n * homepage: Url\n * }\n * `);\n *\n * const introspection = introspectionFromSchema(schema, {\n * descriptions: false,\n * specifiedByUrl: false,\n * directiveIsRepeatable: false,\n * schemaDescription: false,\n * inputValueDeprecation: false,\n * experimentalDirectiveDeprecation: false,\n * oneOf: false,\n * });\n * const urlType = introspection.__schema.types.find(\n * (type) => type.name === 'Url',\n * );\n * const deprecatedDirective = introspection.__schema.directives.find(\n * (directive) => directive.name === 'deprecated',\n * );\n *\n * urlType.specifiedByURL; // => undefined\n * urlType.description; // => undefined\n * introspection.__schema.description; // => undefined\n * deprecatedDirective.isRepeatable; // => undefined\n * ```\n */\nexport function introspectionFromSchema(\n schema: GraphQLSchema,\n options?: IntrospectionOptions,\n): IntrospectionQuery {\n const optionsWithDefaults = {\n specifiedByUrl: true,\n directiveIsRepeatable: true,\n schemaDescription: true,\n inputValueDeprecation: true,\n experimentalDirectiveDeprecation: true,\n oneOf: true,\n ...options,\n };\n\n const document = parse(getIntrospectionQuery(optionsWithDefaults));\n const result = executeSync({ schema, document });\n invariant(result.errors == null && result.data != null);\n return result.data as any;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.mts new file mode 100644 index 00000000..10fa93f8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.mts @@ -0,0 +1,46 @@ +/** @category Schema Construction */ +import { GraphQLSchema } from "../type/schema.mjs"; +/** + * Sort GraphQLSchema. + * + * This function returns a sorted copy of the given GraphQLSchema. + * @param schema - GraphQL schema to use. + * @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically. + * @example + * ```ts + * import { + * buildSchema, + * lexicographicSortSchema, + * printSchema, + * } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * zebra: String + * apple: String + * } + * + * enum Episode { + * JEDI + * NEW_HOPE + * EMPIRE + * } + * `); + * + * const sortedSchema = lexicographicSortSchema(schema); + * + * printSchema(sortedSchema); + * // => + * // enum Episode { + * // EMPIRE + * // JEDI + * // NEW_HOPE + * // } + * // + * // type Query { + * // apple: String + * // zebra: String + * // } + * ``` + */ +export declare function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.ts new file mode 100644 index 00000000..2efe3392 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.d.ts @@ -0,0 +1,46 @@ +/** @category Schema Construction */ +import { GraphQLSchema } from "../type/schema.js"; +/** + * Sort GraphQLSchema. + * + * This function returns a sorted copy of the given GraphQLSchema. + * @param schema - GraphQL schema to use. + * @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically. + * @example + * ```ts + * import { + * buildSchema, + * lexicographicSortSchema, + * printSchema, + * } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * zebra: String + * apple: String + * } + * + * enum Episode { + * JEDI + * NEW_HOPE + * EMPIRE + * } + * `); + * + * const sortedSchema = lexicographicSortSchema(schema); + * + * printSchema(sortedSchema); + * // => + * // enum Episode { + * // EMPIRE + * // JEDI + * // NEW_HOPE + * // } + * // + * // type Query { + * // apple: String + * // zebra: String + * // } + * ``` + */ +export declare function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js new file mode 100644 index 00000000..3728d0d2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lexicographicSortSchema = lexicographicSortSchema; +const naturalCompare_ts_1 = require("../jsutils/naturalCompare.js"); +const schema_ts_1 = require("../type/schema.js"); +const mapSchemaConfig_ts_1 = require("./mapSchemaConfig.js"); +function lexicographicSortSchema(schema) { + return new schema_ts_1.GraphQLSchema((0, mapSchemaConfig_ts_1.mapSchemaConfig)(schema.toConfig(), () => ({ + [mapSchemaConfig_ts_1.SchemaElementKind.OBJECT]: (config) => ({ + ...config, + interfaces: () => sortByName(config.interfaces()), + fields: () => sortObjMap(config.fields()), + }), + [mapSchemaConfig_ts_1.SchemaElementKind.FIELD]: (config) => ({ + ...config, + args: sortObjMap(config.args), + }), + [mapSchemaConfig_ts_1.SchemaElementKind.INTERFACE]: (config) => ({ + ...config, + interfaces: () => sortByName(config.interfaces()), + fields: () => sortObjMap(config.fields()), + }), + [mapSchemaConfig_ts_1.SchemaElementKind.UNION]: (config) => ({ + ...config, + types: () => sortByName(config.types()), + }), + [mapSchemaConfig_ts_1.SchemaElementKind.ENUM]: (config) => ({ + ...config, + values: () => sortObjMap(config.values()), + }), + [mapSchemaConfig_ts_1.SchemaElementKind.INPUT_OBJECT]: (config) => ({ + ...config, + fields: () => sortObjMap(config.fields()), + }), + [mapSchemaConfig_ts_1.SchemaElementKind.DIRECTIVE]: (config) => ({ + ...config, + locations: sortBy(config.locations, (x) => x), + args: sortObjMap(config.args), + }), + [mapSchemaConfig_ts_1.SchemaElementKind.SCHEMA]: (config) => ({ + ...config, + types: sortByName(config.types), + directives: sortByName(config.directives), + }), + }))); +} +function sortObjMap(map) { + const sortedMap = Object.create(null); + for (const key of Object.keys(map).sort(naturalCompare_ts_1.naturalCompare)) { + sortedMap[key] = map[key]; + } + return sortedMap; +} +function sortByName(array) { + return sortBy(array, (obj) => obj.name); +} +function sortBy(array, mapToKey) { + return array.slice().sort((obj1, obj2) => { + const key1 = mapToKey(obj1); + const key2 = mapToKey(obj2); + return (0, naturalCompare_ts_1.naturalCompare)(key1, key2); + }); +} +//# sourceMappingURL=lexicographicSortSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js.map new file mode 100644 index 00000000..d388ecfb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lexicographicSortSchema.js","sourceRoot":"","sources":["../../src/utilities/lexicographicSortSchema.ts"],"names":[],"mappings":";;AAoDA,0DAyCC;AA3FD,oEAA8D;AAG9D,iDAAk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,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QACvC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,kCAAc,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** @category Schema Construction */\n\nimport { naturalCompare } from '../jsutils/naturalCompare.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport { GraphQLSchema } from '../type/schema.ts';\n\nimport { mapSchemaConfig, SchemaElementKind } from './mapSchemaConfig.ts';\n\n/**\n * Sort GraphQLSchema.\n *\n * This function returns a sorted copy of the given GraphQLSchema.\n * @param schema - GraphQL schema to use.\n * @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically.\n * @example\n * ```ts\n * import {\n * buildSchema,\n * lexicographicSortSchema,\n * printSchema,\n * } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * zebra: String\n * apple: String\n * }\n *\n * enum Episode {\n * JEDI\n * NEW_HOPE\n * EMPIRE\n * }\n * `);\n *\n * const sortedSchema = lexicographicSortSchema(schema);\n *\n * printSchema(sortedSchema);\n * // =>\n * // enum Episode {\n * // EMPIRE\n * // JEDI\n * // NEW_HOPE\n * // }\n * //\n * // type Query {\n * // apple: String\n * // zebra: String\n * // }\n * ```\n */\nexport function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema {\n return new GraphQLSchema(\n mapSchemaConfig(schema.toConfig(), () => ({\n [SchemaElementKind.OBJECT]: (config) => ({\n ...config,\n interfaces: () => sortByName(config.interfaces()),\n fields: () => sortObjMap(config.fields()),\n }),\n [SchemaElementKind.FIELD]: (config) => ({\n ...config,\n args: sortObjMap(config.args),\n }),\n [SchemaElementKind.INTERFACE]: (config) => ({\n ...config,\n interfaces: () => sortByName(config.interfaces()),\n fields: () => sortObjMap(config.fields()),\n }),\n [SchemaElementKind.UNION]: (config) => ({\n ...config,\n types: () => sortByName(config.types()),\n }),\n [SchemaElementKind.ENUM]: (config) => ({\n ...config,\n values: () => sortObjMap(config.values()),\n }),\n [SchemaElementKind.INPUT_OBJECT]: (config) => ({\n ...config,\n fields: () => sortObjMap(config.fields()),\n }),\n [SchemaElementKind.DIRECTIVE]: (config) => ({\n ...config,\n locations: sortBy(config.locations, (x) => x),\n args: sortObjMap(config.args),\n }),\n [SchemaElementKind.SCHEMA]: (config) => ({\n ...config,\n types: sortByName(config.types),\n directives: sortByName(config.directives),\n }),\n })),\n );\n}\n\nfunction sortObjMap(map: ObjMap): ObjMap {\n const sortedMap = Object.create(null);\n for (const key of Object.keys(map).sort(naturalCompare)) {\n sortedMap[key] = map[key];\n }\n return sortedMap;\n}\n\nfunction sortByName(\n array: ReadonlyArray,\n): Array {\n return sortBy(array, (obj) => obj.name);\n}\n\nfunction sortBy(\n array: ReadonlyArray,\n mapToKey: (item: T) => string,\n): Array {\n return array.slice().sort((obj1, obj2) => {\n const key1 = mapToKey(obj1);\n const key2 = mapToKey(obj2);\n return naturalCompare(key1, key2);\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs new file mode 100644 index 00000000..67bbc59b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs @@ -0,0 +1,61 @@ +import { naturalCompare } from "../jsutils/naturalCompare.mjs"; +import { GraphQLSchema } from "../type/schema.mjs"; +import { mapSchemaConfig, SchemaElementKind } from "./mapSchemaConfig.mjs"; +export function lexicographicSortSchema(schema) { + return new GraphQLSchema(mapSchemaConfig(schema.toConfig(), () => ({ + [SchemaElementKind.OBJECT]: (config) => ({ + ...config, + interfaces: () => sortByName(config.interfaces()), + fields: () => sortObjMap(config.fields()), + }), + [SchemaElementKind.FIELD]: (config) => ({ + ...config, + args: sortObjMap(config.args), + }), + [SchemaElementKind.INTERFACE]: (config) => ({ + ...config, + interfaces: () => sortByName(config.interfaces()), + fields: () => sortObjMap(config.fields()), + }), + [SchemaElementKind.UNION]: (config) => ({ + ...config, + types: () => sortByName(config.types()), + }), + [SchemaElementKind.ENUM]: (config) => ({ + ...config, + values: () => sortObjMap(config.values()), + }), + [SchemaElementKind.INPUT_OBJECT]: (config) => ({ + ...config, + fields: () => sortObjMap(config.fields()), + }), + [SchemaElementKind.DIRECTIVE]: (config) => ({ + ...config, + locations: sortBy(config.locations, (x) => x), + args: sortObjMap(config.args), + }), + [SchemaElementKind.SCHEMA]: (config) => ({ + ...config, + types: sortByName(config.types), + directives: sortByName(config.directives), + }), + }))); +} +function sortObjMap(map) { + const sortedMap = Object.create(null); + for (const key of Object.keys(map).sort(naturalCompare)) { + sortedMap[key] = map[key]; + } + return sortedMap; +} +function sortByName(array) { + return sortBy(array, (obj) => obj.name); +} +function sortBy(array, mapToKey) { + return array.slice().sort((obj1, obj2) => { + const key1 = mapToKey(obj1); + const key2 = mapToKey(obj2); + return naturalCompare(key1, key2); + }); +} +//# sourceMappingURL=lexicographicSortSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs.map new file mode 100644 index 00000000..a6f869e0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/lexicographicSortSchema.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"lexicographicSortSchema.js","sourceRoot":"","sources":["../../src/utilities/lexicographicSortSchema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAG9D,OAAO,EAAE,aAAa,EAA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ACb,KAAuB,EACvB,QAA6B;IAE7B,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QACvC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** @category Schema Construction */\n\nimport { naturalCompare } from '../jsutils/naturalCompare.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport { GraphQLSchema } from '../type/schema.ts';\n\nimport { mapSchemaConfig, SchemaElementKind } from './mapSchemaConfig.ts';\n\n/**\n * Sort GraphQLSchema.\n *\n * This function returns a sorted copy of the given GraphQLSchema.\n * @param schema - GraphQL schema to use.\n * @returns A copy of the schema with types, fields, arguments, and values sorted lexicographically.\n * @example\n * ```ts\n * import {\n * buildSchema,\n * lexicographicSortSchema,\n * printSchema,\n * } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * zebra: String\n * apple: String\n * }\n *\n * enum Episode {\n * JEDI\n * NEW_HOPE\n * EMPIRE\n * }\n * `);\n *\n * const sortedSchema = lexicographicSortSchema(schema);\n *\n * printSchema(sortedSchema);\n * // =>\n * // enum Episode {\n * // EMPIRE\n * // JEDI\n * // NEW_HOPE\n * // }\n * //\n * // type Query {\n * // apple: String\n * // zebra: String\n * // }\n * ```\n */\nexport function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema {\n return new GraphQLSchema(\n mapSchemaConfig(schema.toConfig(), () => ({\n [SchemaElementKind.OBJECT]: (config) => ({\n ...config,\n interfaces: () => sortByName(config.interfaces()),\n fields: () => sortObjMap(config.fields()),\n }),\n [SchemaElementKind.FIELD]: (config) => ({\n ...config,\n args: sortObjMap(config.args),\n }),\n [SchemaElementKind.INTERFACE]: (config) => ({\n ...config,\n interfaces: () => sortByName(config.interfaces()),\n fields: () => sortObjMap(config.fields()),\n }),\n [SchemaElementKind.UNION]: (config) => ({\n ...config,\n types: () => sortByName(config.types()),\n }),\n [SchemaElementKind.ENUM]: (config) => ({\n ...config,\n values: () => sortObjMap(config.values()),\n }),\n [SchemaElementKind.INPUT_OBJECT]: (config) => ({\n ...config,\n fields: () => sortObjMap(config.fields()),\n }),\n [SchemaElementKind.DIRECTIVE]: (config) => ({\n ...config,\n locations: sortBy(config.locations, (x) => x),\n args: sortObjMap(config.args),\n }),\n [SchemaElementKind.SCHEMA]: (config) => ({\n ...config,\n types: sortByName(config.types),\n directives: sortByName(config.directives),\n }),\n })),\n );\n}\n\nfunction sortObjMap(map: ObjMap): ObjMap {\n const sortedMap = Object.create(null);\n for (const key of Object.keys(map).sort(naturalCompare)) {\n sortedMap[key] = map[key];\n }\n return sortedMap;\n}\n\nfunction sortByName(\n array: ReadonlyArray,\n): Array {\n return sortBy(array, (obj) => obj.name);\n}\n\nfunction sortBy(\n array: ReadonlyArray,\n mapToKey: (item: T) => string,\n): Array {\n return array.slice().sort((obj1, obj2) => {\n const key1 = mapToKey(obj1);\n const key2 = mapToKey(obj2);\n return naturalCompare(key1, key2);\n });\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.mts new file mode 100644 index 00000000..5aa0ac3f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.mts @@ -0,0 +1,69 @@ +import type { GraphQLArgumentNormalizedConfig, GraphQLEnumTypeNormalizedConfig, GraphQLEnumValueConfig, GraphQLFieldNormalizedConfig, GraphQLInputFieldConfig, GraphQLInputObjectTypeNormalizedConfig, GraphQLInterfaceTypeNormalizedConfig, GraphQLNamedType, GraphQLObjectTypeNormalizedConfig, GraphQLScalarTypeNormalizedConfig, GraphQLUnionTypeNormalizedConfig } from "../type/definition.mjs"; +import type { GraphQLDirectiveNormalizedConfig } from "../type/directives.mjs"; +import type { GraphQLSchemaNormalizedConfig } from "../type/schema.mjs"; +/** + * The set of GraphQL Schema Elements. + * + * @internal + */ +export declare const SchemaElementKind: { + readonly SCHEMA: "SCHEMA"; + readonly SCALAR: "SCALAR"; + readonly OBJECT: "OBJECT"; + readonly FIELD: "FIELD"; + readonly ARGUMENT: "ARGUMENT"; + readonly INTERFACE: "INTERFACE"; + readonly UNION: "UNION"; + readonly ENUM: "ENUM"; + readonly ENUM_VALUE: "ENUM_VALUE"; + readonly INPUT_OBJECT: "INPUT_OBJECT"; + readonly INPUT_FIELD: "INPUT_FIELD"; + readonly DIRECTIVE: "DIRECTIVE"; +}; +/** @internal */ +type SchemaElementKind = (typeof SchemaElementKind)[keyof typeof SchemaElementKind]; +/** @internal */ +export interface MappedSchemaContext { + getNamedType: (typeName: string) => GraphQLNamedType; + setNamedType: (type: GraphQLNamedType) => void; + getNamedTypes: () => ReadonlyArray; +} +type GraphQLScalarTypeMappedConfig = GraphQLScalarTypeNormalizedConfig; +type EnsureThunks = { + [K in keyof T]: K extends ThunkFields ? () => T[K] : T[K]; +}; +type GraphQLObjectTypeMappedConfig = EnsureThunks, 'interfaces' | 'fields'>; +type GraphQLInterfaceTypeMappedConfig = EnsureThunks, 'interfaces' | 'fields'>; +type GraphQLUnionTypeMappedConfig = EnsureThunks, 'types'>; +type GraphQLEnumTypeMappedConfig = EnsureThunks; +type GraphQLInputObjectTypeMappedConfig = EnsureThunks; +type ScalarTypeConfigMapper = (scalarConfig: GraphQLScalarTypeMappedConfig) => GraphQLScalarTypeMappedConfig; +type ObjectTypeConfigMapper = (objectConfig: GraphQLObjectTypeMappedConfig) => GraphQLObjectTypeMappedConfig; +type FieldConfigMapper = (fieldConfig: GraphQLFieldNormalizedConfig, parentTypeName: string) => GraphQLFieldNormalizedConfig; +type ArgumentConfigMapper = (argConfig: GraphQLArgumentNormalizedConfig, fieldOrDirectiveName: string, parentTypeName?: string) => GraphQLArgumentNormalizedConfig; +type InterfaceTypeConfigMapper = (interfaceConfig: GraphQLInterfaceTypeMappedConfig) => GraphQLInterfaceTypeMappedConfig; +type UnionTypeConfigMapper = (unionConfig: GraphQLUnionTypeMappedConfig) => GraphQLUnionTypeMappedConfig; +type EnumTypeConfigMapper = (enumConfig: GraphQLEnumTypeMappedConfig) => GraphQLEnumTypeMappedConfig; +type EnumValueConfigMapper = (enumValueConfig: GraphQLEnumValueConfig, valueName: string, enumName: string) => GraphQLEnumValueConfig; +type InputObjectTypeConfigMapper = (inputObjectConfig: GraphQLInputObjectTypeMappedConfig) => GraphQLInputObjectTypeMappedConfig; +type InputFieldConfigMapper = (inputFieldConfig: GraphQLInputFieldConfig, inputFieldName: string, inputObjectTypeName: string) => GraphQLInputFieldConfig; +type DirectiveConfigMapper = (directiveConfig: GraphQLDirectiveNormalizedConfig) => GraphQLDirectiveNormalizedConfig; +type SchemaConfigMapper = (originalSchemaConfig: GraphQLSchemaNormalizedConfig) => GraphQLSchemaNormalizedConfig; +/** @internal */ +export interface ConfigMapperMap { + [SchemaElementKind.SCALAR]?: ScalarTypeConfigMapper; + [SchemaElementKind.OBJECT]?: ObjectTypeConfigMapper; + [SchemaElementKind.FIELD]?: FieldConfigMapper; + [SchemaElementKind.ARGUMENT]?: ArgumentConfigMapper; + [SchemaElementKind.INTERFACE]?: InterfaceTypeConfigMapper; + [SchemaElementKind.UNION]?: UnionTypeConfigMapper; + [SchemaElementKind.ENUM]?: EnumTypeConfigMapper; + [SchemaElementKind.ENUM_VALUE]?: EnumValueConfigMapper; + [SchemaElementKind.INPUT_OBJECT]?: InputObjectTypeConfigMapper; + [SchemaElementKind.INPUT_FIELD]?: InputFieldConfigMapper; + [SchemaElementKind.DIRECTIVE]?: DirectiveConfigMapper; + [SchemaElementKind.SCHEMA]?: SchemaConfigMapper; +} +/** @internal */ +export declare function mapSchemaConfig(schemaConfig: GraphQLSchemaNormalizedConfig, configMapperMapFn: (context: MappedSchemaContext) => ConfigMapperMap): GraphQLSchemaNormalizedConfig; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.ts new file mode 100644 index 00000000..44f65f17 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.d.ts @@ -0,0 +1,69 @@ +import type { GraphQLArgumentNormalizedConfig, GraphQLEnumTypeNormalizedConfig, GraphQLEnumValueConfig, GraphQLFieldNormalizedConfig, GraphQLInputFieldConfig, GraphQLInputObjectTypeNormalizedConfig, GraphQLInterfaceTypeNormalizedConfig, GraphQLNamedType, GraphQLObjectTypeNormalizedConfig, GraphQLScalarTypeNormalizedConfig, GraphQLUnionTypeNormalizedConfig } from "../type/definition.js"; +import type { GraphQLDirectiveNormalizedConfig } from "../type/directives.js"; +import type { GraphQLSchemaNormalizedConfig } from "../type/schema.js"; +/** + * The set of GraphQL Schema Elements. + * + * @internal + */ +export declare const SchemaElementKind: { + readonly SCHEMA: "SCHEMA"; + readonly SCALAR: "SCALAR"; + readonly OBJECT: "OBJECT"; + readonly FIELD: "FIELD"; + readonly ARGUMENT: "ARGUMENT"; + readonly INTERFACE: "INTERFACE"; + readonly UNION: "UNION"; + readonly ENUM: "ENUM"; + readonly ENUM_VALUE: "ENUM_VALUE"; + readonly INPUT_OBJECT: "INPUT_OBJECT"; + readonly INPUT_FIELD: "INPUT_FIELD"; + readonly DIRECTIVE: "DIRECTIVE"; +}; +/** @internal */ +type SchemaElementKind = (typeof SchemaElementKind)[keyof typeof SchemaElementKind]; +/** @internal */ +export interface MappedSchemaContext { + getNamedType: (typeName: string) => GraphQLNamedType; + setNamedType: (type: GraphQLNamedType) => void; + getNamedTypes: () => ReadonlyArray; +} +type GraphQLScalarTypeMappedConfig = GraphQLScalarTypeNormalizedConfig; +type EnsureThunks = { + [K in keyof T]: K extends ThunkFields ? () => T[K] : T[K]; +}; +type GraphQLObjectTypeMappedConfig = EnsureThunks, 'interfaces' | 'fields'>; +type GraphQLInterfaceTypeMappedConfig = EnsureThunks, 'interfaces' | 'fields'>; +type GraphQLUnionTypeMappedConfig = EnsureThunks, 'types'>; +type GraphQLEnumTypeMappedConfig = EnsureThunks; +type GraphQLInputObjectTypeMappedConfig = EnsureThunks; +type ScalarTypeConfigMapper = (scalarConfig: GraphQLScalarTypeMappedConfig) => GraphQLScalarTypeMappedConfig; +type ObjectTypeConfigMapper = (objectConfig: GraphQLObjectTypeMappedConfig) => GraphQLObjectTypeMappedConfig; +type FieldConfigMapper = (fieldConfig: GraphQLFieldNormalizedConfig, parentTypeName: string) => GraphQLFieldNormalizedConfig; +type ArgumentConfigMapper = (argConfig: GraphQLArgumentNormalizedConfig, fieldOrDirectiveName: string, parentTypeName?: string) => GraphQLArgumentNormalizedConfig; +type InterfaceTypeConfigMapper = (interfaceConfig: GraphQLInterfaceTypeMappedConfig) => GraphQLInterfaceTypeMappedConfig; +type UnionTypeConfigMapper = (unionConfig: GraphQLUnionTypeMappedConfig) => GraphQLUnionTypeMappedConfig; +type EnumTypeConfigMapper = (enumConfig: GraphQLEnumTypeMappedConfig) => GraphQLEnumTypeMappedConfig; +type EnumValueConfigMapper = (enumValueConfig: GraphQLEnumValueConfig, valueName: string, enumName: string) => GraphQLEnumValueConfig; +type InputObjectTypeConfigMapper = (inputObjectConfig: GraphQLInputObjectTypeMappedConfig) => GraphQLInputObjectTypeMappedConfig; +type InputFieldConfigMapper = (inputFieldConfig: GraphQLInputFieldConfig, inputFieldName: string, inputObjectTypeName: string) => GraphQLInputFieldConfig; +type DirectiveConfigMapper = (directiveConfig: GraphQLDirectiveNormalizedConfig) => GraphQLDirectiveNormalizedConfig; +type SchemaConfigMapper = (originalSchemaConfig: GraphQLSchemaNormalizedConfig) => GraphQLSchemaNormalizedConfig; +/** @internal */ +export interface ConfigMapperMap { + [SchemaElementKind.SCALAR]?: ScalarTypeConfigMapper; + [SchemaElementKind.OBJECT]?: ObjectTypeConfigMapper; + [SchemaElementKind.FIELD]?: FieldConfigMapper; + [SchemaElementKind.ARGUMENT]?: ArgumentConfigMapper; + [SchemaElementKind.INTERFACE]?: InterfaceTypeConfigMapper; + [SchemaElementKind.UNION]?: UnionTypeConfigMapper; + [SchemaElementKind.ENUM]?: EnumTypeConfigMapper; + [SchemaElementKind.ENUM_VALUE]?: EnumValueConfigMapper; + [SchemaElementKind.INPUT_OBJECT]?: InputObjectTypeConfigMapper; + [SchemaElementKind.INPUT_FIELD]?: InputFieldConfigMapper; + [SchemaElementKind.DIRECTIVE]?: DirectiveConfigMapper; + [SchemaElementKind.SCHEMA]?: SchemaConfigMapper; +} +/** @internal */ +export declare function mapSchemaConfig(schemaConfig: GraphQLSchemaNormalizedConfig, configMapperMapFn: (context: MappedSchemaContext) => ConfigMapperMap): GraphQLSchemaNormalizedConfig; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js new file mode 100644 index 00000000..748ef1a0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js @@ -0,0 +1,243 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchemaElementKind = void 0; +exports.mapSchemaConfig = mapSchemaConfig; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const definition_ts_1 = require("../type/definition.js"); +const directives_ts_1 = require("../type/directives.js"); +const introspection_ts_1 = require("../type/introspection.js"); +const scalars_ts_1 = require("../type/scalars.js"); +exports.SchemaElementKind = { + SCHEMA: 'SCHEMA', + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + FIELD: 'FIELD', + ARGUMENT: 'ARGUMENT', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + ENUM_VALUE: 'ENUM_VALUE', + INPUT_OBJECT: 'INPUT_OBJECT', + INPUT_FIELD: 'INPUT_FIELD', + DIRECTIVE: 'DIRECTIVE', +}; +function mapSchemaConfig(schemaConfig, configMapperMapFn) { + const configMapperMap = configMapperMapFn({ + getNamedType, + setNamedType, + getNamedTypes, + }); + const mappedTypeMap = new Map(); + for (const type of schemaConfig.types) { + const typeName = type.name; + const mappedNamedType = mapNamedType(type); + if (mappedNamedType) { + mappedTypeMap.set(typeName, mappedNamedType); + } + } + const mappedDirectives = []; + for (const directive of schemaConfig.directives) { + if ((0, directives_ts_1.isSpecifiedDirective)(directive)) { + mappedDirectives.push(directive); + continue; + } + const mappedDirectiveConfig = mapDirective(directive.toConfig()); + if (mappedDirectiveConfig) { + mappedDirectives.push(new directives_ts_1.GraphQLDirective(mappedDirectiveConfig)); + } + } + const mappedSchemaConfig = { + ...schemaConfig, + query: schemaConfig.query && + getNamedType(schemaConfig.query.name), + mutation: schemaConfig.mutation && + getNamedType(schemaConfig.mutation.name), + subscription: schemaConfig.subscription && + getNamedType(schemaConfig.subscription.name), + types: Array.from(mappedTypeMap.values()), + directives: mappedDirectives, + }; + const schemaMapper = configMapperMap[exports.SchemaElementKind.SCHEMA]; + return schemaMapper == null + ? mappedSchemaConfig + : schemaMapper(mappedSchemaConfig); + function getType(type) { + if ((0, definition_ts_1.isListType)(type)) { + return new definition_ts_1.GraphQLList(getType(type.ofType)); + } + if ((0, definition_ts_1.isNonNullType)(type)) { + return new definition_ts_1.GraphQLNonNull(getType(type.ofType)); + } + return getNamedType(type.name); + } + function getNamedType(typeName) { + const type = stdTypeMap.get(typeName) ?? mappedTypeMap.get(typeName); + if (!(type !== undefined)) + (0, invariant_ts_1.invariant)(false, `Unknown type: "${typeName}".`); + return type; + } + function setNamedType(type) { + mappedTypeMap.set(type.name, type); + } + function getNamedTypes() { + return Array.from(mappedTypeMap.values()); + } + function mapNamedType(type) { + if ((0, introspection_ts_1.isIntrospectionType)(type) || (0, scalars_ts_1.isSpecifiedScalarType)(type)) { + return type; + } + if ((0, definition_ts_1.isScalarType)(type)) { + return mapScalarType(type); + } + if ((0, definition_ts_1.isObjectType)(type)) { + return mapObjectType(type); + } + if ((0, definition_ts_1.isInterfaceType)(type)) { + return mapInterfaceType(type); + } + if ((0, definition_ts_1.isUnionType)(type)) { + return mapUnionType(type); + } + if ((0, definition_ts_1.isEnumType)(type)) { + return mapEnumType(type); + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + return mapInputObjectType(type); + } + (0, invariant_ts_1.invariant)(false, 'Unexpected type: ' + (0, inspect_ts_1.inspect)(type)); + } + function mapScalarType(type) { + let mappedConfig = type.toConfig(); + const mapper = configMapperMap[exports.SchemaElementKind.SCALAR]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new definition_ts_1.GraphQLScalarType(mappedConfig); + } + function mapObjectType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + interfaces: () => config.interfaces.map((iface) => getNamedType(iface.name)), + fields: () => mapFields(config.fields, type.name), + }; + const mapper = configMapperMap[exports.SchemaElementKind.OBJECT]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new definition_ts_1.GraphQLObjectType(mappedConfig); + } + function mapFields(fieldMap, parentTypeName) { + const newFieldMap = Object.create(null); + for (const [fieldName, field] of Object.entries(fieldMap)) { + let mappedField = { + ...field, + type: getType(field.type), + args: mapArgs(field.args, fieldName, parentTypeName), + }; + const mapper = configMapperMap[exports.SchemaElementKind.FIELD]; + if (mapper) { + mappedField = mapper(mappedField, parentTypeName); + } + newFieldMap[fieldName] = mappedField; + } + return newFieldMap; + } + function mapArgs(argumentMap, fieldOrDirectiveName, parentTypeName) { + const newArgumentMap = Object.create(null); + for (const [argName, arg] of Object.entries(argumentMap)) { + let mappedArg = { + ...arg, + type: getType(arg.type), + }; + const mapper = configMapperMap[exports.SchemaElementKind.ARGUMENT]; + if (mapper) { + mappedArg = mapper(mappedArg, fieldOrDirectiveName, parentTypeName); + } + newArgumentMap[argName] = mappedArg; + } + return newArgumentMap; + } + function mapInterfaceType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + interfaces: () => config.interfaces.map((iface) => getNamedType(iface.name)), + fields: () => mapFields(config.fields, type.name), + }; + const mapper = configMapperMap[exports.SchemaElementKind.INTERFACE]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new definition_ts_1.GraphQLInterfaceType(mappedConfig); + } + function mapUnionType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + types: () => config.types.map((memberType) => getNamedType(memberType.name)), + }; + const mapper = configMapperMap[exports.SchemaElementKind.UNION]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new definition_ts_1.GraphQLUnionType(mappedConfig); + } + function mapEnumType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + values: () => { + const newEnumValues = Object.create(null); + for (const [valueName, value] of Object.entries(config.values)) { + const mappedValue = mapEnumValue(value, valueName, type.name); + newEnumValues[valueName] = mappedValue; + } + return newEnumValues; + }, + }; + const mapper = configMapperMap[exports.SchemaElementKind.ENUM]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new definition_ts_1.GraphQLEnumType(mappedConfig); + } + function mapEnumValue(valueConfig, valueName, enumName) { + const mappedConfig = { ...valueConfig }; + const mapper = configMapperMap[exports.SchemaElementKind.ENUM_VALUE]; + return mapper == null + ? mappedConfig + : mapper(mappedConfig, valueName, enumName); + } + function mapInputObjectType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + fields: () => { + const newInputFieldMap = Object.create(null); + for (const [fieldName, field] of Object.entries(config.fields)) { + const mappedField = mapInputField(field, fieldName, type.name); + newInputFieldMap[fieldName] = mappedField; + } + return newInputFieldMap; + }, + }; + const mapper = configMapperMap[exports.SchemaElementKind.INPUT_OBJECT]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new definition_ts_1.GraphQLInputObjectType(mappedConfig); + } + function mapInputField(inputFieldConfig, inputFieldName, inputObjectTypeName) { + const mappedConfig = { + ...inputFieldConfig, + type: getType(inputFieldConfig.type), + }; + const mapper = configMapperMap[exports.SchemaElementKind.INPUT_FIELD]; + return mapper == null + ? mappedConfig + : mapper(mappedConfig, inputFieldName, inputObjectTypeName); + } + function mapDirective(config) { + const mappedConfig = { + ...config, + args: mapArgs(config.args, config.name, undefined), + }; + const mapper = configMapperMap[exports.SchemaElementKind.DIRECTIVE]; + return mapper == null ? mappedConfig : mapper(mappedConfig); + } +} +const stdTypeMap = new Map([...scalars_ts_1.specifiedScalarTypes, ...introspection_ts_1.introspectionTypes].map((type) => [ + type.name, + type, +])); +//# sourceMappingURL=mapSchemaConfig.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js.map new file mode 100644 index 00000000..d1c5a011 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mapSchemaConfig.js","sourceRoot":"","sources":["../../src/utilities/mapSchemaConfig.ts"],"names":[],"mappings":";;;AAwLA,0CAoRC;AA5cD,sDAAgD;AAChD,0DAAoD;AAmBpD,yDAiB+B;AAE/B,yDAA+E;AAC/E,+DAGkC;AAClC,mDAG4B;AAQf,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAiB;IACzB,MAAM,EAAE,QAAiB;IACzB,MAAM,EAAE,QAAiB;IACzB,KAAK,EAAE,OAAgB;IACvB,QAAQ,EAAE,UAAmB;IAC7B,SAAS,EAAE,WAAoB;IAC/B,KAAK,EAAE,OAAgB;IACvB,IAAI,EAAE,MAAe;IACrB,UAAU,EA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CAAC;QACpE,OAAO,IAAI,sCAAsB,CAAC,YAAY,CAAC,CAAC;IAClD,CAAC;IAED,SAAS,aAAa,CACpB,gBAAyC,EACzC,cAAsB,EACtB,mBAA2B;QAE3B,MAAM,YAAY,GAAG;YACnB,GAAG,gBAAgB;YACnB,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC;SACrC,CAAC;QACF,MAAM,MAAM,GAAG,eAAe,CAAC,yBAAiB,CAAC,WAAW,CAAC,CAAC;QAC9D,OAAO,MAAM,IAAI,IAAI;YACnB,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC;IAChE,CAAC;IAED,SAAS,YAAY,CACnB,MAAwC;QAExC,MAAM,YAAY,GAAG;YACnB,GAAG,MAAM;YACT,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;SACnD,CAAC;QACF,MAAM,MAAM,GAAG,eAAe,CAAC,yBAAiB,CAAC,SAAS,CAAC,CAAC;QAC5D,OAAO,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AAED,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,CAAC,GAAG,iCAAoB,EAAE,GAAG,qCAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IAC7D,IAAI,CAAC,IAAI;IACT,IAAI;CACL,CAAC,CACH,CAAC","sourcesContent":["import { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n GraphQLArgumentNormalizedConfig,\n GraphQLEnumTypeNormalizedConfig,\n GraphQLEnumValueConfig,\n GraphQLFieldNormalizedConfig,\n GraphQLFieldNormalizedConfigArgumentMap,\n GraphQLFieldNormalizedConfigMap,\n GraphQLInputFieldConfig,\n GraphQLInputObjectTypeNormalizedConfig,\n GraphQLInterfaceTypeNormalizedConfig,\n GraphQLNamedType,\n GraphQLObjectTypeNormalizedConfig,\n GraphQLScalarTypeNormalizedConfig,\n GraphQLType,\n GraphQLUnionTypeNormalizedConfig,\n} from '../type/definition.ts';\nimport {\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.ts';\nimport type { GraphQLDirectiveNormalizedConfig } from '../type/directives.ts';\nimport { GraphQLDirective, isSpecifiedDirective } from '../type/directives.ts';\nimport {\n introspectionTypes,\n isIntrospectionType,\n} from '../type/introspection.ts';\nimport {\n isSpecifiedScalarType,\n specifiedScalarTypes,\n} from '../type/scalars.ts';\nimport type { GraphQLSchemaNormalizedConfig } from '../type/schema.ts';\n\n/**\n * The set of GraphQL Schema Elements.\n *\n * @internal\n */\nexport const SchemaElementKind = {\n SCHEMA: 'SCHEMA' as const,\n SCALAR: 'SCALAR' as const,\n OBJECT: 'OBJECT' as const,\n FIELD: 'FIELD' as const,\n ARGUMENT: 'ARGUMENT' as const,\n INTERFACE: 'INTERFACE' as const,\n UNION: 'UNION' as const,\n ENUM: 'ENUM' as const,\n ENUM_VALUE: 'ENUM_VALUE' as const,\n INPUT_OBJECT: 'INPUT_OBJECT' as const,\n INPUT_FIELD: 'INPUT_FIELD' as const,\n DIRECTIVE: 'DIRECTIVE' as const,\n} as const;\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\ntype SchemaElementKind =\n (typeof SchemaElementKind)[keyof typeof SchemaElementKind];\n\n/** @internal */\nexport interface MappedSchemaContext {\n getNamedType: (typeName: string) => GraphQLNamedType;\n setNamedType: (type: GraphQLNamedType) => void;\n getNamedTypes: () => ReadonlyArray;\n}\n\ntype GraphQLScalarTypeMappedConfig = GraphQLScalarTypeNormalizedConfig<\n any,\n any\n>;\n\ntype EnsureThunks = {\n [K in keyof T]: K extends ThunkFields ? () => T[K] : T[K];\n};\n\ntype GraphQLObjectTypeMappedConfig = EnsureThunks<\n GraphQLObjectTypeNormalizedConfig,\n 'interfaces' | 'fields'\n>;\ntype GraphQLInterfaceTypeMappedConfig = EnsureThunks<\n GraphQLInterfaceTypeNormalizedConfig,\n 'interfaces' | 'fields'\n>;\ntype GraphQLUnionTypeMappedConfig = EnsureThunks<\n GraphQLUnionTypeNormalizedConfig,\n 'types'\n>;\ntype GraphQLEnumTypeMappedConfig = EnsureThunks<\n GraphQLEnumTypeNormalizedConfig,\n 'values'\n>;\ntype GraphQLInputObjectTypeMappedConfig = EnsureThunks<\n GraphQLInputObjectTypeNormalizedConfig,\n 'fields'\n>;\n\ntype ScalarTypeConfigMapper = (\n scalarConfig: GraphQLScalarTypeMappedConfig,\n) => GraphQLScalarTypeMappedConfig;\n\ntype ObjectTypeConfigMapper = (\n objectConfig: GraphQLObjectTypeMappedConfig,\n) => GraphQLObjectTypeMappedConfig;\n\ntype FieldConfigMapper = (\n fieldConfig: GraphQLFieldNormalizedConfig,\n parentTypeName: string,\n) => GraphQLFieldNormalizedConfig;\n\ntype ArgumentConfigMapper = (\n argConfig: GraphQLArgumentNormalizedConfig,\n fieldOrDirectiveName: string,\n parentTypeName?: string,\n) => GraphQLArgumentNormalizedConfig;\n\ntype InterfaceTypeConfigMapper = (\n interfaceConfig: GraphQLInterfaceTypeMappedConfig,\n) => GraphQLInterfaceTypeMappedConfig;\n\ntype UnionTypeConfigMapper = (\n unionConfig: GraphQLUnionTypeMappedConfig,\n) => GraphQLUnionTypeMappedConfig;\n\ntype EnumTypeConfigMapper = (\n enumConfig: GraphQLEnumTypeMappedConfig,\n) => GraphQLEnumTypeMappedConfig;\n\ntype EnumValueConfigMapper = (\n enumValueConfig: GraphQLEnumValueConfig,\n valueName: string,\n enumName: string,\n) => GraphQLEnumValueConfig;\n\ntype InputObjectTypeConfigMapper = (\n inputObjectConfig: GraphQLInputObjectTypeMappedConfig,\n) => GraphQLInputObjectTypeMappedConfig;\n\ntype InputFieldConfigMapper = (\n inputFieldConfig: GraphQLInputFieldConfig,\n inputFieldName: string,\n inputObjectTypeName: string,\n) => GraphQLInputFieldConfig;\n\ntype DirectiveConfigMapper = (\n directiveConfig: GraphQLDirectiveNormalizedConfig,\n) => GraphQLDirectiveNormalizedConfig;\n\ntype SchemaConfigMapper = (\n originalSchemaConfig: GraphQLSchemaNormalizedConfig,\n) => GraphQLSchemaNormalizedConfig;\n\n/** @internal */\nexport interface ConfigMapperMap {\n [SchemaElementKind.SCALAR]?: ScalarTypeConfigMapper;\n [SchemaElementKind.OBJECT]?: ObjectTypeConfigMapper;\n [SchemaElementKind.FIELD]?: FieldConfigMapper;\n [SchemaElementKind.ARGUMENT]?: ArgumentConfigMapper;\n [SchemaElementKind.INTERFACE]?: InterfaceTypeConfigMapper;\n [SchemaElementKind.UNION]?: UnionTypeConfigMapper;\n [SchemaElementKind.ENUM]?: EnumTypeConfigMapper;\n [SchemaElementKind.ENUM_VALUE]?: EnumValueConfigMapper;\n [SchemaElementKind.INPUT_OBJECT]?: InputObjectTypeConfigMapper;\n [SchemaElementKind.INPUT_FIELD]?: InputFieldConfigMapper;\n [SchemaElementKind.DIRECTIVE]?: DirectiveConfigMapper;\n [SchemaElementKind.SCHEMA]?: SchemaConfigMapper;\n}\n\n/** @internal */\nexport function mapSchemaConfig(\n schemaConfig: GraphQLSchemaNormalizedConfig,\n configMapperMapFn: (context: MappedSchemaContext) => ConfigMapperMap,\n): GraphQLSchemaNormalizedConfig {\n const configMapperMap = configMapperMapFn({\n getNamedType,\n setNamedType,\n getNamedTypes,\n });\n\n const mappedTypeMap = new Map();\n for (const type of schemaConfig.types) {\n const typeName = type.name;\n const mappedNamedType = mapNamedType(type);\n if (mappedNamedType) {\n mappedTypeMap.set(typeName, mappedNamedType);\n }\n }\n\n const mappedDirectives: Array = [];\n for (const directive of schemaConfig.directives) {\n if (isSpecifiedDirective(directive)) {\n // Builtin directives cannot be mapped.\n mappedDirectives.push(directive);\n continue;\n }\n\n const mappedDirectiveConfig = mapDirective(directive.toConfig());\n if (mappedDirectiveConfig) {\n mappedDirectives.push(new GraphQLDirective(mappedDirectiveConfig));\n }\n }\n\n const mappedSchemaConfig = {\n ...schemaConfig,\n query:\n schemaConfig.query &&\n (getNamedType(schemaConfig.query.name) as GraphQLObjectType),\n mutation:\n schemaConfig.mutation &&\n (getNamedType(schemaConfig.mutation.name) as GraphQLObjectType),\n subscription:\n schemaConfig.subscription &&\n (getNamedType(schemaConfig.subscription.name) as GraphQLObjectType),\n types: Array.from(mappedTypeMap.values()),\n directives: mappedDirectives,\n };\n\n const schemaMapper = configMapperMap[SchemaElementKind.SCHEMA];\n\n return schemaMapper == null\n ? mappedSchemaConfig\n : schemaMapper(mappedSchemaConfig);\n\n function getType(type: T): T {\n if (isListType(type)) {\n return new GraphQLList(getType(type.ofType)) as T;\n }\n if (isNonNullType(type)) {\n return new GraphQLNonNull(getType(type.ofType)) as T;\n }\n\n return getNamedType(type.name) as T;\n }\n\n function getNamedType(typeName: string): GraphQLNamedType {\n const type = stdTypeMap.get(typeName) ?? mappedTypeMap.get(typeName);\n invariant(type !== undefined, `Unknown type: \"${typeName}\".`);\n return type;\n }\n\n function setNamedType(type: GraphQLNamedType): void {\n mappedTypeMap.set(type.name, type);\n }\n\n function getNamedTypes(): ReadonlyArray {\n return Array.from(mappedTypeMap.values());\n }\n\n function mapNamedType(type: GraphQLNamedType): Maybe {\n if (isIntrospectionType(type) || isSpecifiedScalarType(type)) {\n // Builtin types cannot be mapped.\n return type;\n }\n\n if (isScalarType(type)) {\n return mapScalarType(type);\n }\n if (isObjectType(type)) {\n return mapObjectType(type);\n }\n if (isInterfaceType(type)) {\n return mapInterfaceType(type);\n }\n if (isUnionType(type)) {\n return mapUnionType(type);\n }\n if (isEnumType(type)) {\n return mapEnumType(type);\n }\n if (isInputObjectType(type)) {\n return mapInputObjectType(type);\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible type definition nodes have been considered.\n invariant(false, 'Unexpected type: ' + inspect(type));\n }\n\n function mapScalarType(type: GraphQLScalarType): GraphQLScalarType {\n let mappedConfig: Maybe = type.toConfig();\n const mapper = configMapperMap[SchemaElementKind.SCALAR];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLScalarType(mappedConfig);\n }\n\n function mapObjectType(type: GraphQLObjectType): GraphQLObjectType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n interfaces: () =>\n config.interfaces.map(\n (iface) => getNamedType(iface.name) as GraphQLInterfaceType,\n ),\n fields: () => mapFields(config.fields, type.name),\n };\n const mapper = configMapperMap[SchemaElementKind.OBJECT];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLObjectType(mappedConfig);\n }\n\n function mapFields(\n fieldMap: GraphQLFieldNormalizedConfigMap,\n parentTypeName: string,\n ): GraphQLFieldNormalizedConfigMap {\n const newFieldMap = Object.create(null);\n for (const [fieldName, field] of Object.entries(fieldMap)) {\n let mappedField = {\n ...field,\n type: getType(field.type),\n args: mapArgs(field.args, fieldName, parentTypeName),\n };\n const mapper = configMapperMap[SchemaElementKind.FIELD];\n if (mapper) {\n mappedField = mapper(mappedField, parentTypeName);\n }\n newFieldMap[fieldName] = mappedField;\n }\n return newFieldMap;\n }\n\n function mapArgs(\n argumentMap: GraphQLFieldNormalizedConfigArgumentMap,\n fieldOrDirectiveName: string,\n parentTypeName?: string,\n ): GraphQLFieldNormalizedConfigArgumentMap {\n const newArgumentMap = Object.create(null);\n\n for (const [argName, arg] of Object.entries(argumentMap)) {\n let mappedArg = {\n ...arg,\n type: getType(arg.type),\n };\n const mapper = configMapperMap[SchemaElementKind.ARGUMENT];\n if (mapper) {\n mappedArg = mapper(mappedArg, fieldOrDirectiveName, parentTypeName);\n }\n newArgumentMap[argName] = mappedArg;\n }\n\n return newArgumentMap;\n }\n\n function mapInterfaceType(type: GraphQLInterfaceType): GraphQLInterfaceType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n interfaces: () =>\n config.interfaces.map(\n (iface) => getNamedType(iface.name) as GraphQLInterfaceType,\n ),\n fields: () => mapFields(config.fields, type.name),\n };\n const mapper = configMapperMap[SchemaElementKind.INTERFACE];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLInterfaceType(mappedConfig);\n }\n\n function mapUnionType(type: GraphQLUnionType): GraphQLUnionType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n types: () =>\n config.types.map(\n (memberType) => getNamedType(memberType.name) as GraphQLObjectType,\n ),\n };\n const mapper = configMapperMap[SchemaElementKind.UNION];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLUnionType(mappedConfig);\n }\n\n function mapEnumType(type: GraphQLEnumType): GraphQLEnumType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n values: () => {\n const newEnumValues = Object.create(null);\n for (const [valueName, value] of Object.entries(config.values)) {\n const mappedValue = mapEnumValue(value, valueName, type.name);\n newEnumValues[valueName] = mappedValue;\n }\n return newEnumValues;\n },\n };\n const mapper = configMapperMap[SchemaElementKind.ENUM];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLEnumType(mappedConfig);\n }\n\n function mapEnumValue(\n valueConfig: GraphQLEnumValueConfig,\n valueName: string,\n enumName: string,\n ): GraphQLEnumValueConfig {\n const mappedConfig = { ...valueConfig };\n const mapper = configMapperMap[SchemaElementKind.ENUM_VALUE];\n return mapper == null\n ? mappedConfig\n : mapper(mappedConfig, valueName, enumName);\n }\n\n function mapInputObjectType(\n type: GraphQLInputObjectType,\n ): GraphQLInputObjectType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n fields: () => {\n const newInputFieldMap = Object.create(null);\n for (const [fieldName, field] of Object.entries(config.fields)) {\n const mappedField = mapInputField(field, fieldName, type.name);\n newInputFieldMap[fieldName] = mappedField;\n }\n return newInputFieldMap;\n },\n };\n const mapper = configMapperMap[SchemaElementKind.INPUT_OBJECT];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLInputObjectType(mappedConfig);\n }\n\n function mapInputField(\n inputFieldConfig: GraphQLInputFieldConfig,\n inputFieldName: string,\n inputObjectTypeName: string,\n ): GraphQLInputFieldConfig {\n const mappedConfig = {\n ...inputFieldConfig,\n type: getType(inputFieldConfig.type),\n };\n const mapper = configMapperMap[SchemaElementKind.INPUT_FIELD];\n return mapper == null\n ? mappedConfig\n : mapper(mappedConfig, inputFieldName, inputObjectTypeName);\n }\n\n function mapDirective(\n config: GraphQLDirectiveNormalizedConfig,\n ): Maybe {\n const mappedConfig = {\n ...config,\n args: mapArgs(config.args, config.name, undefined),\n };\n const mapper = configMapperMap[SchemaElementKind.DIRECTIVE];\n return mapper == null ? mappedConfig : mapper(mappedConfig);\n }\n}\n\nconst stdTypeMap = new Map(\n [...specifiedScalarTypes, ...introspectionTypes].map((type) => [\n type.name,\n type,\n ]),\n);\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs new file mode 100644 index 00000000..81051ce1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs @@ -0,0 +1,239 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isEnumType, isInputObjectType, isInterfaceType, isListType, isNonNullType, isObjectType, isScalarType, isUnionType, } from "../type/definition.mjs"; +import { GraphQLDirective, isSpecifiedDirective } from "../type/directives.mjs"; +import { introspectionTypes, isIntrospectionType, } from "../type/introspection.mjs"; +import { isSpecifiedScalarType, specifiedScalarTypes, } from "../type/scalars.mjs"; +export const SchemaElementKind = { + SCHEMA: 'SCHEMA', + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + FIELD: 'FIELD', + ARGUMENT: 'ARGUMENT', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + ENUM_VALUE: 'ENUM_VALUE', + INPUT_OBJECT: 'INPUT_OBJECT', + INPUT_FIELD: 'INPUT_FIELD', + DIRECTIVE: 'DIRECTIVE', +}; +export function mapSchemaConfig(schemaConfig, configMapperMapFn) { + const configMapperMap = configMapperMapFn({ + getNamedType, + setNamedType, + getNamedTypes, + }); + const mappedTypeMap = new Map(); + for (const type of schemaConfig.types) { + const typeName = type.name; + const mappedNamedType = mapNamedType(type); + if (mappedNamedType) { + mappedTypeMap.set(typeName, mappedNamedType); + } + } + const mappedDirectives = []; + for (const directive of schemaConfig.directives) { + if (isSpecifiedDirective(directive)) { + mappedDirectives.push(directive); + continue; + } + const mappedDirectiveConfig = mapDirective(directive.toConfig()); + if (mappedDirectiveConfig) { + mappedDirectives.push(new GraphQLDirective(mappedDirectiveConfig)); + } + } + const mappedSchemaConfig = { + ...schemaConfig, + query: schemaConfig.query && + getNamedType(schemaConfig.query.name), + mutation: schemaConfig.mutation && + getNamedType(schemaConfig.mutation.name), + subscription: schemaConfig.subscription && + getNamedType(schemaConfig.subscription.name), + types: Array.from(mappedTypeMap.values()), + directives: mappedDirectives, + }; + const schemaMapper = configMapperMap[SchemaElementKind.SCHEMA]; + return schemaMapper == null + ? mappedSchemaConfig + : schemaMapper(mappedSchemaConfig); + function getType(type) { + if (isListType(type)) { + return new GraphQLList(getType(type.ofType)); + } + if (isNonNullType(type)) { + return new GraphQLNonNull(getType(type.ofType)); + } + return getNamedType(type.name); + } + function getNamedType(typeName) { + const type = stdTypeMap.get(typeName) ?? mappedTypeMap.get(typeName); + if (!(type !== undefined)) + invariant(false, `Unknown type: "${typeName}".`); + return type; + } + function setNamedType(type) { + mappedTypeMap.set(type.name, type); + } + function getNamedTypes() { + return Array.from(mappedTypeMap.values()); + } + function mapNamedType(type) { + if (isIntrospectionType(type) || isSpecifiedScalarType(type)) { + return type; + } + if (isScalarType(type)) { + return mapScalarType(type); + } + if (isObjectType(type)) { + return mapObjectType(type); + } + if (isInterfaceType(type)) { + return mapInterfaceType(type); + } + if (isUnionType(type)) { + return mapUnionType(type); + } + if (isEnumType(type)) { + return mapEnumType(type); + } + if (isInputObjectType(type)) { + return mapInputObjectType(type); + } + invariant(false, 'Unexpected type: ' + inspect(type)); + } + function mapScalarType(type) { + let mappedConfig = type.toConfig(); + const mapper = configMapperMap[SchemaElementKind.SCALAR]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new GraphQLScalarType(mappedConfig); + } + function mapObjectType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + interfaces: () => config.interfaces.map((iface) => getNamedType(iface.name)), + fields: () => mapFields(config.fields, type.name), + }; + const mapper = configMapperMap[SchemaElementKind.OBJECT]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new GraphQLObjectType(mappedConfig); + } + function mapFields(fieldMap, parentTypeName) { + const newFieldMap = Object.create(null); + for (const [fieldName, field] of Object.entries(fieldMap)) { + let mappedField = { + ...field, + type: getType(field.type), + args: mapArgs(field.args, fieldName, parentTypeName), + }; + const mapper = configMapperMap[SchemaElementKind.FIELD]; + if (mapper) { + mappedField = mapper(mappedField, parentTypeName); + } + newFieldMap[fieldName] = mappedField; + } + return newFieldMap; + } + function mapArgs(argumentMap, fieldOrDirectiveName, parentTypeName) { + const newArgumentMap = Object.create(null); + for (const [argName, arg] of Object.entries(argumentMap)) { + let mappedArg = { + ...arg, + type: getType(arg.type), + }; + const mapper = configMapperMap[SchemaElementKind.ARGUMENT]; + if (mapper) { + mappedArg = mapper(mappedArg, fieldOrDirectiveName, parentTypeName); + } + newArgumentMap[argName] = mappedArg; + } + return newArgumentMap; + } + function mapInterfaceType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + interfaces: () => config.interfaces.map((iface) => getNamedType(iface.name)), + fields: () => mapFields(config.fields, type.name), + }; + const mapper = configMapperMap[SchemaElementKind.INTERFACE]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new GraphQLInterfaceType(mappedConfig); + } + function mapUnionType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + types: () => config.types.map((memberType) => getNamedType(memberType.name)), + }; + const mapper = configMapperMap[SchemaElementKind.UNION]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new GraphQLUnionType(mappedConfig); + } + function mapEnumType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + values: () => { + const newEnumValues = Object.create(null); + for (const [valueName, value] of Object.entries(config.values)) { + const mappedValue = mapEnumValue(value, valueName, type.name); + newEnumValues[valueName] = mappedValue; + } + return newEnumValues; + }, + }; + const mapper = configMapperMap[SchemaElementKind.ENUM]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new GraphQLEnumType(mappedConfig); + } + function mapEnumValue(valueConfig, valueName, enumName) { + const mappedConfig = { ...valueConfig }; + const mapper = configMapperMap[SchemaElementKind.ENUM_VALUE]; + return mapper == null + ? mappedConfig + : mapper(mappedConfig, valueName, enumName); + } + function mapInputObjectType(type) { + const config = type.toConfig(); + let mappedConfig = { + ...config, + fields: () => { + const newInputFieldMap = Object.create(null); + for (const [fieldName, field] of Object.entries(config.fields)) { + const mappedField = mapInputField(field, fieldName, type.name); + newInputFieldMap[fieldName] = mappedField; + } + return newInputFieldMap; + }, + }; + const mapper = configMapperMap[SchemaElementKind.INPUT_OBJECT]; + mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig); + return new GraphQLInputObjectType(mappedConfig); + } + function mapInputField(inputFieldConfig, inputFieldName, inputObjectTypeName) { + const mappedConfig = { + ...inputFieldConfig, + type: getType(inputFieldConfig.type), + }; + const mapper = configMapperMap[SchemaElementKind.INPUT_FIELD]; + return mapper == null + ? mappedConfig + : mapper(mappedConfig, inputFieldName, inputObjectTypeName); + } + function mapDirective(config) { + const mappedConfig = { + ...config, + args: mapArgs(config.args, config.name, undefined), + }; + const mapper = configMapperMap[SchemaElementKind.DIRECTIVE]; + return mapper == null ? mappedConfig : mapper(mappedConfig); + } +} +const stdTypeMap = new Map([...specifiedScalarTypes, ...introspectionTypes].map((type) => [ + type.name, + type, +])); +//# sourceMappingURL=mapSchemaConfig.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs.map new file mode 100644 index 00000000..7cf20159 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/mapSchemaConfig.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mapSchemaConfig.js","sourceRoot":"","sources":["../../src/utilities/mapSchemaConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAmBpD,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,+BAA8B;AAE/B,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,+BAA8B;AAC/E,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GACpB,kCAAiC;AAClC,OAAO,EACL,qBAA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from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n GraphQLArgumentNormalizedConfig,\n GraphQLEnumTypeNormalizedConfig,\n GraphQLEnumValueConfig,\n GraphQLFieldNormalizedConfig,\n GraphQLFieldNormalizedConfigArgumentMap,\n GraphQLFieldNormalizedConfigMap,\n GraphQLInputFieldConfig,\n GraphQLInputObjectTypeNormalizedConfig,\n GraphQLInterfaceTypeNormalizedConfig,\n GraphQLNamedType,\n GraphQLObjectTypeNormalizedConfig,\n GraphQLScalarTypeNormalizedConfig,\n GraphQLType,\n GraphQLUnionTypeNormalizedConfig,\n} from '../type/definition.ts';\nimport {\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.ts';\nimport type { GraphQLDirectiveNormalizedConfig } from '../type/directives.ts';\nimport { GraphQLDirective, isSpecifiedDirective } from '../type/directives.ts';\nimport {\n introspectionTypes,\n isIntrospectionType,\n} from '../type/introspection.ts';\nimport {\n isSpecifiedScalarType,\n specifiedScalarTypes,\n} from '../type/scalars.ts';\nimport type { GraphQLSchemaNormalizedConfig } from '../type/schema.ts';\n\n/**\n * The set of GraphQL Schema Elements.\n *\n * @internal\n */\nexport const SchemaElementKind = {\n SCHEMA: 'SCHEMA' as const,\n SCALAR: 'SCALAR' as const,\n OBJECT: 'OBJECT' as const,\n FIELD: 'FIELD' as const,\n ARGUMENT: 'ARGUMENT' as const,\n INTERFACE: 'INTERFACE' as const,\n UNION: 'UNION' as const,\n ENUM: 'ENUM' as const,\n ENUM_VALUE: 'ENUM_VALUE' as const,\n INPUT_OBJECT: 'INPUT_OBJECT' as const,\n INPUT_FIELD: 'INPUT_FIELD' as const,\n DIRECTIVE: 'DIRECTIVE' as const,\n} as const;\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\ntype SchemaElementKind =\n (typeof SchemaElementKind)[keyof typeof SchemaElementKind];\n\n/** @internal */\nexport interface MappedSchemaContext {\n getNamedType: (typeName: string) => GraphQLNamedType;\n setNamedType: (type: GraphQLNamedType) => void;\n getNamedTypes: () => ReadonlyArray;\n}\n\ntype GraphQLScalarTypeMappedConfig = GraphQLScalarTypeNormalizedConfig<\n any,\n any\n>;\n\ntype EnsureThunks = {\n [K in keyof T]: K extends ThunkFields ? () => T[K] : T[K];\n};\n\ntype GraphQLObjectTypeMappedConfig = EnsureThunks<\n GraphQLObjectTypeNormalizedConfig,\n 'interfaces' | 'fields'\n>;\ntype GraphQLInterfaceTypeMappedConfig = EnsureThunks<\n GraphQLInterfaceTypeNormalizedConfig,\n 'interfaces' | 'fields'\n>;\ntype GraphQLUnionTypeMappedConfig = EnsureThunks<\n GraphQLUnionTypeNormalizedConfig,\n 'types'\n>;\ntype GraphQLEnumTypeMappedConfig = EnsureThunks<\n GraphQLEnumTypeNormalizedConfig,\n 'values'\n>;\ntype GraphQLInputObjectTypeMappedConfig = EnsureThunks<\n GraphQLInputObjectTypeNormalizedConfig,\n 'fields'\n>;\n\ntype ScalarTypeConfigMapper = (\n scalarConfig: GraphQLScalarTypeMappedConfig,\n) => GraphQLScalarTypeMappedConfig;\n\ntype ObjectTypeConfigMapper = (\n objectConfig: GraphQLObjectTypeMappedConfig,\n) => GraphQLObjectTypeMappedConfig;\n\ntype FieldConfigMapper = (\n fieldConfig: GraphQLFieldNormalizedConfig,\n parentTypeName: string,\n) => GraphQLFieldNormalizedConfig;\n\ntype ArgumentConfigMapper = (\n argConfig: GraphQLArgumentNormalizedConfig,\n fieldOrDirectiveName: string,\n parentTypeName?: string,\n) => GraphQLArgumentNormalizedConfig;\n\ntype InterfaceTypeConfigMapper = (\n interfaceConfig: GraphQLInterfaceTypeMappedConfig,\n) => GraphQLInterfaceTypeMappedConfig;\n\ntype UnionTypeConfigMapper = (\n unionConfig: GraphQLUnionTypeMappedConfig,\n) => GraphQLUnionTypeMappedConfig;\n\ntype EnumTypeConfigMapper = (\n enumConfig: GraphQLEnumTypeMappedConfig,\n) => GraphQLEnumTypeMappedConfig;\n\ntype EnumValueConfigMapper = (\n enumValueConfig: GraphQLEnumValueConfig,\n valueName: string,\n enumName: string,\n) => GraphQLEnumValueConfig;\n\ntype InputObjectTypeConfigMapper = (\n inputObjectConfig: GraphQLInputObjectTypeMappedConfig,\n) => GraphQLInputObjectTypeMappedConfig;\n\ntype InputFieldConfigMapper = (\n inputFieldConfig: GraphQLInputFieldConfig,\n inputFieldName: string,\n inputObjectTypeName: string,\n) => GraphQLInputFieldConfig;\n\ntype DirectiveConfigMapper = (\n directiveConfig: GraphQLDirectiveNormalizedConfig,\n) => GraphQLDirectiveNormalizedConfig;\n\ntype SchemaConfigMapper = (\n originalSchemaConfig: GraphQLSchemaNormalizedConfig,\n) => GraphQLSchemaNormalizedConfig;\n\n/** @internal */\nexport interface ConfigMapperMap {\n [SchemaElementKind.SCALAR]?: ScalarTypeConfigMapper;\n [SchemaElementKind.OBJECT]?: ObjectTypeConfigMapper;\n [SchemaElementKind.FIELD]?: FieldConfigMapper;\n [SchemaElementKind.ARGUMENT]?: ArgumentConfigMapper;\n [SchemaElementKind.INTERFACE]?: InterfaceTypeConfigMapper;\n [SchemaElementKind.UNION]?: UnionTypeConfigMapper;\n [SchemaElementKind.ENUM]?: EnumTypeConfigMapper;\n [SchemaElementKind.ENUM_VALUE]?: EnumValueConfigMapper;\n [SchemaElementKind.INPUT_OBJECT]?: InputObjectTypeConfigMapper;\n [SchemaElementKind.INPUT_FIELD]?: InputFieldConfigMapper;\n [SchemaElementKind.DIRECTIVE]?: DirectiveConfigMapper;\n [SchemaElementKind.SCHEMA]?: SchemaConfigMapper;\n}\n\n/** @internal */\nexport function mapSchemaConfig(\n schemaConfig: GraphQLSchemaNormalizedConfig,\n configMapperMapFn: (context: MappedSchemaContext) => ConfigMapperMap,\n): GraphQLSchemaNormalizedConfig {\n const configMapperMap = configMapperMapFn({\n getNamedType,\n setNamedType,\n getNamedTypes,\n });\n\n const mappedTypeMap = new Map();\n for (const type of schemaConfig.types) {\n const typeName = type.name;\n const mappedNamedType = mapNamedType(type);\n if (mappedNamedType) {\n mappedTypeMap.set(typeName, mappedNamedType);\n }\n }\n\n const mappedDirectives: Array = [];\n for (const directive of schemaConfig.directives) {\n if (isSpecifiedDirective(directive)) {\n // Builtin directives cannot be mapped.\n mappedDirectives.push(directive);\n continue;\n }\n\n const mappedDirectiveConfig = mapDirective(directive.toConfig());\n if (mappedDirectiveConfig) {\n mappedDirectives.push(new GraphQLDirective(mappedDirectiveConfig));\n }\n }\n\n const mappedSchemaConfig = {\n ...schemaConfig,\n query:\n schemaConfig.query &&\n (getNamedType(schemaConfig.query.name) as GraphQLObjectType),\n mutation:\n schemaConfig.mutation &&\n (getNamedType(schemaConfig.mutation.name) as GraphQLObjectType),\n subscription:\n schemaConfig.subscription &&\n (getNamedType(schemaConfig.subscription.name) as GraphQLObjectType),\n types: Array.from(mappedTypeMap.values()),\n directives: mappedDirectives,\n };\n\n const schemaMapper = configMapperMap[SchemaElementKind.SCHEMA];\n\n return schemaMapper == null\n ? mappedSchemaConfig\n : schemaMapper(mappedSchemaConfig);\n\n function getType(type: T): T {\n if (isListType(type)) {\n return new GraphQLList(getType(type.ofType)) as T;\n }\n if (isNonNullType(type)) {\n return new GraphQLNonNull(getType(type.ofType)) as T;\n }\n\n return getNamedType(type.name) as T;\n }\n\n function getNamedType(typeName: string): GraphQLNamedType {\n const type = stdTypeMap.get(typeName) ?? mappedTypeMap.get(typeName);\n invariant(type !== undefined, `Unknown type: \"${typeName}\".`);\n return type;\n }\n\n function setNamedType(type: GraphQLNamedType): void {\n mappedTypeMap.set(type.name, type);\n }\n\n function getNamedTypes(): ReadonlyArray {\n return Array.from(mappedTypeMap.values());\n }\n\n function mapNamedType(type: GraphQLNamedType): Maybe {\n if (isIntrospectionType(type) || isSpecifiedScalarType(type)) {\n // Builtin types cannot be mapped.\n return type;\n }\n\n if (isScalarType(type)) {\n return mapScalarType(type);\n }\n if (isObjectType(type)) {\n return mapObjectType(type);\n }\n if (isInterfaceType(type)) {\n return mapInterfaceType(type);\n }\n if (isUnionType(type)) {\n return mapUnionType(type);\n }\n if (isEnumType(type)) {\n return mapEnumType(type);\n }\n if (isInputObjectType(type)) {\n return mapInputObjectType(type);\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible type definition nodes have been considered.\n invariant(false, 'Unexpected type: ' + inspect(type));\n }\n\n function mapScalarType(type: GraphQLScalarType): GraphQLScalarType {\n let mappedConfig: Maybe = type.toConfig();\n const mapper = configMapperMap[SchemaElementKind.SCALAR];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLScalarType(mappedConfig);\n }\n\n function mapObjectType(type: GraphQLObjectType): GraphQLObjectType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n interfaces: () =>\n config.interfaces.map(\n (iface) => getNamedType(iface.name) as GraphQLInterfaceType,\n ),\n fields: () => mapFields(config.fields, type.name),\n };\n const mapper = configMapperMap[SchemaElementKind.OBJECT];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLObjectType(mappedConfig);\n }\n\n function mapFields(\n fieldMap: GraphQLFieldNormalizedConfigMap,\n parentTypeName: string,\n ): GraphQLFieldNormalizedConfigMap {\n const newFieldMap = Object.create(null);\n for (const [fieldName, field] of Object.entries(fieldMap)) {\n let mappedField = {\n ...field,\n type: getType(field.type),\n args: mapArgs(field.args, fieldName, parentTypeName),\n };\n const mapper = configMapperMap[SchemaElementKind.FIELD];\n if (mapper) {\n mappedField = mapper(mappedField, parentTypeName);\n }\n newFieldMap[fieldName] = mappedField;\n }\n return newFieldMap;\n }\n\n function mapArgs(\n argumentMap: GraphQLFieldNormalizedConfigArgumentMap,\n fieldOrDirectiveName: string,\n parentTypeName?: string,\n ): GraphQLFieldNormalizedConfigArgumentMap {\n const newArgumentMap = Object.create(null);\n\n for (const [argName, arg] of Object.entries(argumentMap)) {\n let mappedArg = {\n ...arg,\n type: getType(arg.type),\n };\n const mapper = configMapperMap[SchemaElementKind.ARGUMENT];\n if (mapper) {\n mappedArg = mapper(mappedArg, fieldOrDirectiveName, parentTypeName);\n }\n newArgumentMap[argName] = mappedArg;\n }\n\n return newArgumentMap;\n }\n\n function mapInterfaceType(type: GraphQLInterfaceType): GraphQLInterfaceType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n interfaces: () =>\n config.interfaces.map(\n (iface) => getNamedType(iface.name) as GraphQLInterfaceType,\n ),\n fields: () => mapFields(config.fields, type.name),\n };\n const mapper = configMapperMap[SchemaElementKind.INTERFACE];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLInterfaceType(mappedConfig);\n }\n\n function mapUnionType(type: GraphQLUnionType): GraphQLUnionType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n types: () =>\n config.types.map(\n (memberType) => getNamedType(memberType.name) as GraphQLObjectType,\n ),\n };\n const mapper = configMapperMap[SchemaElementKind.UNION];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLUnionType(mappedConfig);\n }\n\n function mapEnumType(type: GraphQLEnumType): GraphQLEnumType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n values: () => {\n const newEnumValues = Object.create(null);\n for (const [valueName, value] of Object.entries(config.values)) {\n const mappedValue = mapEnumValue(value, valueName, type.name);\n newEnumValues[valueName] = mappedValue;\n }\n return newEnumValues;\n },\n };\n const mapper = configMapperMap[SchemaElementKind.ENUM];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLEnumType(mappedConfig);\n }\n\n function mapEnumValue(\n valueConfig: GraphQLEnumValueConfig,\n valueName: string,\n enumName: string,\n ): GraphQLEnumValueConfig {\n const mappedConfig = { ...valueConfig };\n const mapper = configMapperMap[SchemaElementKind.ENUM_VALUE];\n return mapper == null\n ? mappedConfig\n : mapper(mappedConfig, valueName, enumName);\n }\n\n function mapInputObjectType(\n type: GraphQLInputObjectType,\n ): GraphQLInputObjectType {\n const config = type.toConfig();\n let mappedConfig: Maybe = {\n ...config,\n fields: () => {\n const newInputFieldMap = Object.create(null);\n for (const [fieldName, field] of Object.entries(config.fields)) {\n const mappedField = mapInputField(field, fieldName, type.name);\n newInputFieldMap[fieldName] = mappedField;\n }\n return newInputFieldMap;\n },\n };\n const mapper = configMapperMap[SchemaElementKind.INPUT_OBJECT];\n mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);\n return new GraphQLInputObjectType(mappedConfig);\n }\n\n function mapInputField(\n inputFieldConfig: GraphQLInputFieldConfig,\n inputFieldName: string,\n inputObjectTypeName: string,\n ): GraphQLInputFieldConfig {\n const mappedConfig = {\n ...inputFieldConfig,\n type: getType(inputFieldConfig.type),\n };\n const mapper = configMapperMap[SchemaElementKind.INPUT_FIELD];\n return mapper == null\n ? mappedConfig\n : mapper(mappedConfig, inputFieldName, inputObjectTypeName);\n }\n\n function mapDirective(\n config: GraphQLDirectiveNormalizedConfig,\n ): Maybe {\n const mappedConfig = {\n ...config,\n args: mapArgs(config.args, config.name, undefined),\n };\n const mapper = configMapperMap[SchemaElementKind.DIRECTIVE];\n return mapper == null ? mappedConfig : mapper(mappedConfig);\n }\n}\n\nconst stdTypeMap = new Map(\n [...specifiedScalarTypes, ...introspectionTypes].map((type) => [\n type.name,\n type,\n ]),\n);\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.mts new file mode 100644 index 00000000..772cb2f2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.mts @@ -0,0 +1,95 @@ +/** @category Schema Printing */ +import type { GraphQLNamedType } from "../type/definition.mjs"; +import type { GraphQLDirective } from "../type/directives.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +/** + * Prints the schema. + * @param schema - GraphQL schema to use. + * @returns The printed string representation. + * @example + * ```ts + * import { buildSchema, printSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @upper on FIELD_DEFINITION + * + * type Query { + * greeting: String @upper + * } + * `); + * + * printSchema(schema); // => ['directive @upper on FIELD_DEFINITION', '', 'type Query {', ' greeting: String', '}'].join('\n') + * ``` + */ +export declare function printSchema(schema: GraphQLSchema): string; +/** + * Prints the introspection schema. + * @param schema - GraphQL schema to use. + * @returns The printed string representation. + * @example + * ```ts + * import { buildSchema, printIntrospectionSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const printed = printIntrospectionSchema(schema); + * + * printed; // matches /type __Schema/ + * printed; // matches /enum __TypeKind/ + * printed; // does not match /type Query/ + * ``` + */ +export declare function printIntrospectionSchema(schema: GraphQLSchema): string; +/** + * Prints the type. + * @param type - The GraphQL type to inspect. + * @returns The printed string representation. + * @example + * ```ts + * import { buildSchema, printType } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * id: ID! + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * printType(schema.getType('User')); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\n') + * ``` + */ +export declare function printType(type: GraphQLNamedType): string; +/** + * Prints a directive definition in GraphQL SDL. + * @param directive - Directive to print. + * @returns SDL string for the directive definition. + * @example + * ```ts + * import { + * DirectiveLocation, + * GraphQLDirective, + * GraphQLString, + * } from 'graphql/type'; + * import { printDirective } from 'graphql/utilities'; + * + * const authDirective = new GraphQLDirective({ + * name: 'auth', + * description: 'Requires authorization.', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { + * scope: { type: GraphQLString }, + * }, + * }); + * + * printDirective(authDirective); // => '"""Requires authorization."""\ndirective @auth(scope: String) on FIELD_DEFINITION' + * ``` + */ +export declare function printDirective(directive: GraphQLDirective): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.ts new file mode 100644 index 00000000..96da1a3f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.d.ts @@ -0,0 +1,95 @@ +/** @category Schema Printing */ +import type { GraphQLNamedType } from "../type/definition.js"; +import type { GraphQLDirective } from "../type/directives.js"; +import type { GraphQLSchema } from "../type/schema.js"; +/** + * Prints the schema. + * @param schema - GraphQL schema to use. + * @returns The printed string representation. + * @example + * ```ts + * import { buildSchema, printSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @upper on FIELD_DEFINITION + * + * type Query { + * greeting: String @upper + * } + * `); + * + * printSchema(schema); // => ['directive @upper on FIELD_DEFINITION', '', 'type Query {', ' greeting: String', '}'].join('\n') + * ``` + */ +export declare function printSchema(schema: GraphQLSchema): string; +/** + * Prints the introspection schema. + * @param schema - GraphQL schema to use. + * @returns The printed string representation. + * @example + * ```ts + * import { buildSchema, printIntrospectionSchema } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * + * const printed = printIntrospectionSchema(schema); + * + * printed; // matches /type __Schema/ + * printed; // matches /enum __TypeKind/ + * printed; // does not match /type Query/ + * ``` + */ +export declare function printIntrospectionSchema(schema: GraphQLSchema): string; +/** + * Prints the type. + * @param type - The GraphQL type to inspect. + * @returns The printed string representation. + * @example + * ```ts + * import { buildSchema, printType } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * id: ID! + * name: String + * } + * + * type Query { + * viewer: User + * } + * `); + * + * printType(schema.getType('User')); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\n') + * ``` + */ +export declare function printType(type: GraphQLNamedType): string; +/** + * Prints a directive definition in GraphQL SDL. + * @param directive - Directive to print. + * @returns SDL string for the directive definition. + * @example + * ```ts + * import { + * DirectiveLocation, + * GraphQLDirective, + * GraphQLString, + * } from 'graphql/type'; + * import { printDirective } from 'graphql/utilities'; + * + * const authDirective = new GraphQLDirective({ + * name: 'auth', + * description: 'Requires authorization.', + * locations: [DirectiveLocation.FIELD_DEFINITION], + * args: { + * scope: { type: GraphQLString }, + * }, + * }); + * + * printDirective(authDirective); // => '"""Requires authorization."""\ndirective @auth(scope: String) on FIELD_DEFINITION' + * ``` + */ +export declare function printDirective(directive: GraphQLDirective): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js new file mode 100644 index 00000000..10992a4e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js @@ -0,0 +1,202 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.printSchema = printSchema; +exports.printIntrospectionSchema = printIntrospectionSchema; +exports.printType = printType; +exports.printDirective = printDirective; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const blockString_ts_1 = require("../language/blockString.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const printer_ts_1 = require("../language/printer.js"); +const definition_ts_1 = require("../type/definition.js"); +const directives_ts_1 = require("../type/directives.js"); +const introspection_ts_1 = require("../type/introspection.js"); +const scalars_ts_1 = require("../type/scalars.js"); +const getDefaultValueAST_ts_1 = require("./getDefaultValueAST.js"); +function printSchema(schema) { + return printFilteredSchema(schema, (n) => !(0, directives_ts_1.isSpecifiedDirective)(n), isDefinedType); +} +function printIntrospectionSchema(schema) { + return printFilteredSchema(schema, directives_ts_1.isSpecifiedDirective, introspection_ts_1.isIntrospectionType); +} +function isDefinedType(type) { + return !(0, scalars_ts_1.isSpecifiedScalarType)(type) && !(0, introspection_ts_1.isIntrospectionType)(type); +} +function printFilteredSchema(schema, directiveFilter, typeFilter) { + const directives = schema.getDirectives().filter(directiveFilter); + const types = Object.values(schema.getTypeMap()).filter(typeFilter); + return [ + printSchemaDefinition(schema), + ...directives.map((directive) => printDirective(directive)), + ...types.map((type) => printType(type)), + ] + .filter(Boolean) + .join('\n\n'); +} +function printSchemaDefinition(schema) { + const queryType = schema.getQueryType(); + const mutationType = schema.getMutationType(); + const subscriptionType = schema.getSubscriptionType(); + if (!queryType && !mutationType && !subscriptionType) { + return; + } + if (schema.description != null || !hasDefaultRootOperationTypes(schema)) { + return (printDescription(schema) + + 'schema {\n' + + (queryType ? ` query: ${queryType}\n` : '') + + (mutationType ? ` mutation: ${mutationType}\n` : '') + + (subscriptionType ? ` subscription: ${subscriptionType}\n` : '') + + '}'); + } +} +function hasDefaultRootOperationTypes(schema) { + return (schema.getQueryType() == schema.getType('Query') && + schema.getMutationType() == schema.getType('Mutation') && + schema.getSubscriptionType() == schema.getType('Subscription')); +} +function printType(type) { + if ((0, definition_ts_1.isScalarType)(type)) { + return printScalar(type); + } + if ((0, definition_ts_1.isObjectType)(type)) { + return printObject(type); + } + if ((0, definition_ts_1.isInterfaceType)(type)) { + return printInterface(type); + } + if ((0, definition_ts_1.isUnionType)(type)) { + return printUnion(type); + } + if ((0, definition_ts_1.isEnumType)(type)) { + return printEnum(type); + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + return printInputObject(type); + } + (0, invariant_ts_1.invariant)(false, 'Unexpected type: ' + (0, inspect_ts_1.inspect)(type)); +} +function printScalar(type) { + return printDescription(type) + `scalar ${type}` + printSpecifiedByURL(type); +} +function printImplementedInterfaces(type) { + const interfaces = type.getInterfaces(); + return interfaces.length + ? ' implements ' + interfaces.map((i) => i.name).join(' & ') + : ''; +} +function printObject(type) { + return (printDescription(type) + + `type ${type}` + + printImplementedInterfaces(type) + + printFields(type)); +} +function printInterface(type) { + return (printDescription(type) + + `interface ${type}` + + printImplementedInterfaces(type) + + printFields(type)); +} +function printUnion(type) { + const types = type.getTypes(); + const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; + return printDescription(type) + `union ${type.name}` + possibleTypes; +} +function printEnum(type) { + const values = type + .getValues() + .map((value, i) => printDescription(value, ' ', !i) + + ' ' + + value.name + + printDeprecated(value.deprecationReason)); + return printDescription(type) + `enum ${type}` + printBlock(values); +} +function printInputObject(type) { + const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f)); + return (printDescription(type) + + `input ${type}` + + (type.isOneOf ? ' @oneOf' : '') + + printBlock(fields)); +} +function printFields(type) { + const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + + ' ' + + f.name + + printArgs(f.args, ' ') + + ': ' + + String(f.type) + + printDeprecated(f.deprecationReason)); + return printBlock(fields); +} +function printBlock(items) { + return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; +} +function printArgs(args, indentation = '') { + if (args.length === 0) { + return ''; + } + if (args.every((arg) => arg.description == null)) { + return '(' + args.map(printInputValue).join(', ') + ')'; + } + return ('(\n' + + args + .map((arg, i) => printDescription(arg, ' ' + indentation, !i) + + ' ' + + indentation + + printInputValue(arg)) + .join('\n') + + '\n' + + indentation + + ')'); +} +function printInputValue(argOrInputField) { + let argDecl = argOrInputField.name + ': ' + String(argOrInputField.type); + const defaultValueAST = (0, getDefaultValueAST_ts_1.getDefaultValueAST)(argOrInputField); + if (defaultValueAST) { + argDecl += ` = ${(0, printer_ts_1.print)(defaultValueAST)}`; + } + return argDecl + printDeprecated(argOrInputField.deprecationReason); +} +function printDirective(directive) { + return (printDescription(directive) + + `directive ${directive}` + + printArgs(directive.args) + + printDeprecated(directive.deprecationReason) + + (directive.isRepeatable ? ' repeatable' : '') + + ' on ' + + directive.locations.join(' | ')); +} +function printDeprecated(reason) { + if (reason == null) { + return ''; + } + if (reason !== directives_ts_1.DEFAULT_DEPRECATION_REASON) { + const astValue = (0, printer_ts_1.print)({ kind: kinds_ts_1.Kind.STRING, value: reason }); + return ` @deprecated(reason: ${astValue})`; + } + return ' @deprecated'; +} +function printSpecifiedByURL(scalar) { + if (scalar.specifiedByURL == null) { + return ''; + } + const astValue = (0, printer_ts_1.print)({ + kind: kinds_ts_1.Kind.STRING, + value: scalar.specifiedByURL, + }); + return ` @specifiedBy(url: ${astValue})`; +} +function printDescription(def, indentation = '', firstInBlock = true) { + const { description } = def; + if (description == null) { + return ''; + } + const blockString = (0, printer_ts_1.print)({ + kind: kinds_ts_1.Kind.STRING, + value: description, + block: (0, blockString_ts_1.isPrintableAsBlockString)(description), + }); + const prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; + return prefix + blockString.replaceAll('\n', '\n' + indentation) + '\n'; +} +//# sourceMappingURL=printSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js.map new file mode 100644 index 00000000..7863e4cb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"printSchema.js","sourceRoot":"","sources":["../../src/utilities/printSchema.ts"],"names":[],"mappings":";;AA2DA,kCAMC;AAuBD,4DAEC;AAqGD,8BAsBC;AAqJD,wCAUC;AAlXD,sDAAgD;AAChD,0DAAoD;AAGpD,+DAAsE;AACtE,mDAA4C;AAC5C,uDAA+C;AAa/C,yDAO+B;AAE/B,yDAG+B;AAC/B,+DAA+D;AAC/D,mDAA2D;AAG3D,mEAA6D;AAqB7D,SAAgB,WAAW,CAAC,MAAqB;IAC/C,OAAO,mBAAmB,CACxB,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,oCAAoB,EAAC,CAAC,CAAC,EAC/B,aAAa,CACd,CAAC;AACJ,CAAC;AAuBD,SAAgB,wBAAwB,CAAC,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C,cAAc;KAC7B,CAAC,CAAC;IACH,OAAO,sBAAsB,QAAQ,GAAG,CAAC;AAC3C,CAAC;AAED,SAAS,gBAAgB,CACvB,GAA4C,EAC5C,cAAsB,EAAE,EACxB,eAAwB,IAAI;IAE5B,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;IAC5B,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,kBAAK,EAAC;QACxB,IAAI,EAAE,eAAI,CAAC,MAAM;QACjB,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,IAAA,yCAAwB,EAAC,WAAW,CAAC;KAC7C,CAAC,CAAC;IAEH,MAAM,MAAM,GACV,WAAW,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;IAElE,OAAO,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,IAAI,CAAC;AAC1E,CAAC","sourcesContent":["/** @category Schema Printing */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport { isPrintableAsBlockString } from '../language/blockString.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLEnumType,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n} from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport {\n DEFAULT_DEPRECATION_REASON,\n isSpecifiedDirective,\n} from '../type/directives.ts';\nimport { isIntrospectionType } from '../type/introspection.ts';\nimport { isSpecifiedScalarType } from '../type/scalars.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { getDefaultValueAST } from './getDefaultValueAST.ts';\n\n/**\n * Prints the schema.\n * @param schema - GraphQL schema to use.\n * @returns The printed string representation.\n * @example\n * ```ts\n * import { buildSchema, printSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @upper on FIELD_DEFINITION\n *\n * type Query {\n * greeting: String @upper\n * }\n * `);\n *\n * printSchema(schema); // => ['directive @upper on FIELD_DEFINITION', '', 'type Query {', ' greeting: String', '}'].join('\\n')\n * ```\n */\nexport function printSchema(schema: GraphQLSchema): string {\n return printFilteredSchema(\n schema,\n (n) => !isSpecifiedDirective(n),\n isDefinedType,\n );\n}\n\n/**\n * Prints the introspection schema.\n * @param schema - GraphQL schema to use.\n * @returns The printed string representation.\n * @example\n * ```ts\n * import { buildSchema, printIntrospectionSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const printed = printIntrospectionSchema(schema);\n *\n * printed; // matches /type __Schema/\n * printed; // matches /enum __TypeKind/\n * printed; // does not match /type Query/\n * ```\n */\nexport function printIntrospectionSchema(schema: GraphQLSchema): string {\n return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType);\n}\n\nfunction isDefinedType(type: GraphQLNamedType): boolean {\n return !isSpecifiedScalarType(type) && !isIntrospectionType(type);\n}\n\nfunction printFilteredSchema(\n schema: GraphQLSchema,\n directiveFilter: (type: GraphQLDirective) => boolean,\n typeFilter: (type: GraphQLNamedType) => boolean,\n): string {\n const directives = schema.getDirectives().filter(directiveFilter);\n const types = Object.values(schema.getTypeMap()).filter(typeFilter);\n\n return [\n printSchemaDefinition(schema),\n ...directives.map((directive) => printDirective(directive)),\n ...types.map((type) => printType(type)),\n ]\n .filter(Boolean)\n .join('\\n\\n');\n}\n\nfunction printSchemaDefinition(schema: GraphQLSchema): Maybe {\n const queryType = schema.getQueryType();\n const mutationType = schema.getMutationType();\n const subscriptionType = schema.getSubscriptionType();\n\n // Special case: When a schema has no root operation types, no valid schema\n // definition can be printed.\n if (!queryType && !mutationType && !subscriptionType) {\n return;\n }\n\n // Only print a schema definition if there is a description or if it should\n // not be omitted because of having default type names.\n if (schema.description != null || !hasDefaultRootOperationTypes(schema)) {\n return (\n printDescription(schema) +\n 'schema {\\n' +\n (queryType ? ` query: ${queryType}\\n` : '') +\n (mutationType ? ` mutation: ${mutationType}\\n` : '') +\n (subscriptionType ? ` subscription: ${subscriptionType}\\n` : '') +\n '}'\n );\n }\n}\n\n/**\n * GraphQL schema define root types for each type of operation. These types are\n * the same as any other type and can be named in any manner, however there is\n * a common naming convention:\n *\n * ```graphql\n * schema {\n * query: Query\n * mutation: Mutation\n * subscription: Subscription\n * }\n * ```\n *\n * When using this naming convention, the schema description can be omitted so\n * long as these names are only used for operation types.\n *\n * Note however that if any of these default names are used elsewhere in the\n * schema but not as a root operation type, the schema definition must still\n * be printed to avoid ambiguity.\n *\n * @internal\n */\nfunction hasDefaultRootOperationTypes(schema: GraphQLSchema): boolean {\n /* eslint-disable eqeqeq */\n return (\n schema.getQueryType() == schema.getType('Query') &&\n schema.getMutationType() == schema.getType('Mutation') &&\n schema.getSubscriptionType() == schema.getType('Subscription')\n );\n}\n\n/**\n * Prints the type.\n * @param type - The GraphQL type to inspect.\n * @returns The printed string representation.\n * @example\n * ```ts\n * import { buildSchema, printType } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * id: ID!\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * printType(schema.getType('User')); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\\n')\n * ```\n */\nexport function printType(type: GraphQLNamedType): string {\n if (isScalarType(type)) {\n return printScalar(type);\n }\n if (isObjectType(type)) {\n return printObject(type);\n }\n if (isInterfaceType(type)) {\n return printInterface(type);\n }\n if (isUnionType(type)) {\n return printUnion(type);\n }\n if (isEnumType(type)) {\n return printEnum(type);\n }\n if (isInputObjectType(type)) {\n return printInputObject(type);\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered.\n invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction printScalar(type: GraphQLScalarType): string {\n return printDescription(type) + `scalar ${type}` + printSpecifiedByURL(type);\n}\n\nfunction printImplementedInterfaces(\n type: GraphQLObjectType | GraphQLInterfaceType,\n): string {\n const interfaces = type.getInterfaces();\n return interfaces.length\n ? ' implements ' + interfaces.map((i) => i.name).join(' & ')\n : '';\n}\n\nfunction printObject(type: GraphQLObjectType): string {\n return (\n printDescription(type) +\n `type ${type}` +\n printImplementedInterfaces(type) +\n printFields(type)\n );\n}\n\nfunction printInterface(type: GraphQLInterfaceType): string {\n return (\n printDescription(type) +\n `interface ${type}` +\n printImplementedInterfaces(type) +\n printFields(type)\n );\n}\n\nfunction printUnion(type: GraphQLUnionType): string {\n const types = type.getTypes();\n const possibleTypes = types.length ? ' = ' + types.join(' | ') : '';\n return printDescription(type) + `union ${type.name}` + possibleTypes;\n}\n\nfunction printEnum(type: GraphQLEnumType): string {\n const values = type\n .getValues()\n .map(\n (value, i) =>\n printDescription(value, ' ', !i) +\n ' ' +\n value.name +\n printDeprecated(value.deprecationReason),\n );\n\n return printDescription(type) + `enum ${type}` + printBlock(values);\n}\n\nfunction printInputObject(type: GraphQLInputObjectType): string {\n const fields = Object.values(type.getFields()).map(\n (f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f),\n );\n return (\n printDescription(type) +\n `input ${type}` +\n (type.isOneOf ? ' @oneOf' : '') +\n printBlock(fields)\n );\n}\n\nfunction printFields(type: GraphQLObjectType | GraphQLInterfaceType): string {\n const fields = Object.values(type.getFields()).map(\n (f, i) =>\n printDescription(f, ' ', !i) +\n ' ' +\n f.name +\n printArgs(f.args, ' ') +\n ': ' +\n String(f.type) +\n printDeprecated(f.deprecationReason),\n );\n return printBlock(fields);\n}\n\nfunction printBlock(items: ReadonlyArray): string {\n return items.length !== 0 ? ' {\\n' + items.join('\\n') + '\\n}' : '';\n}\n\nfunction printArgs(\n args: ReadonlyArray,\n indentation: string = '',\n): string {\n if (args.length === 0) {\n return '';\n }\n\n // If every arg does not have a description, print them on one line.\n if (args.every((arg) => arg.description == null)) {\n return '(' + args.map(printInputValue).join(', ') + ')';\n }\n\n return (\n '(\\n' +\n args\n .map(\n (arg, i) =>\n printDescription(arg, ' ' + indentation, !i) +\n ' ' +\n indentation +\n printInputValue(arg),\n )\n .join('\\n') +\n '\\n' +\n indentation +\n ')'\n );\n}\n\nfunction printInputValue(\n argOrInputField: GraphQLArgument | GraphQLInputField,\n): string {\n let argDecl = argOrInputField.name + ': ' + String(argOrInputField.type);\n const defaultValueAST = getDefaultValueAST(argOrInputField);\n if (defaultValueAST) {\n argDecl += ` = ${print(defaultValueAST)}`;\n }\n return argDecl + printDeprecated(argOrInputField.deprecationReason);\n}\n\n/**\n * Prints a directive definition in GraphQL SDL.\n * @param directive - Directive to print.\n * @returns SDL string for the directive definition.\n * @example\n * ```ts\n * import {\n * DirectiveLocation,\n * GraphQLDirective,\n * GraphQLString,\n * } from 'graphql/type';\n * import { printDirective } from 'graphql/utilities';\n *\n * const authDirective = new GraphQLDirective({\n * name: 'auth',\n * description: 'Requires authorization.',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: {\n * scope: { type: GraphQLString },\n * },\n * });\n *\n * printDirective(authDirective); // => '\"\"\"Requires authorization.\"\"\"\\ndirective @auth(scope: String) on FIELD_DEFINITION'\n * ```\n */\nexport function printDirective(directive: GraphQLDirective): string {\n return (\n printDescription(directive) +\n `directive ${directive}` +\n printArgs(directive.args) +\n printDeprecated(directive.deprecationReason) +\n (directive.isRepeatable ? ' repeatable' : '') +\n ' on ' +\n directive.locations.join(' | ')\n );\n}\n\nfunction printDeprecated(reason: Maybe): string {\n if (reason == null) {\n return '';\n }\n if (reason !== DEFAULT_DEPRECATION_REASON) {\n const astValue = print({ kind: Kind.STRING, value: reason });\n return ` @deprecated(reason: ${astValue})`;\n }\n return ' @deprecated';\n}\n\nfunction printSpecifiedByURL(scalar: GraphQLScalarType): string {\n if (scalar.specifiedByURL == null) {\n return '';\n }\n const astValue = print({\n kind: Kind.STRING,\n value: scalar.specifiedByURL,\n });\n return ` @specifiedBy(url: ${astValue})`;\n}\n\nfunction printDescription(\n def: { readonly description: Maybe },\n indentation: string = '',\n firstInBlock: boolean = true,\n): string {\n const { description } = def;\n if (description == null) {\n return '';\n }\n\n const blockString = print({\n kind: Kind.STRING,\n value: description,\n block: isPrintableAsBlockString(description),\n });\n\n const prefix =\n indentation && !firstInBlock ? '\\n' + indentation : indentation;\n\n return prefix + blockString.replaceAll('\\n', '\\n' + indentation) + '\\n';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs new file mode 100644 index 00000000..94ed15c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs @@ -0,0 +1,196 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { isPrintableAsBlockString } from "../language/blockString.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { print } from "../language/printer.mjs"; +import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isUnionType, } from "../type/definition.mjs"; +import { DEFAULT_DEPRECATION_REASON, isSpecifiedDirective, } from "../type/directives.mjs"; +import { isIntrospectionType } from "../type/introspection.mjs"; +import { isSpecifiedScalarType } from "../type/scalars.mjs"; +import { getDefaultValueAST } from "./getDefaultValueAST.mjs"; +export function printSchema(schema) { + return printFilteredSchema(schema, (n) => !isSpecifiedDirective(n), isDefinedType); +} +export function printIntrospectionSchema(schema) { + return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType); +} +function isDefinedType(type) { + return !isSpecifiedScalarType(type) && !isIntrospectionType(type); +} +function printFilteredSchema(schema, directiveFilter, typeFilter) { + const directives = schema.getDirectives().filter(directiveFilter); + const types = Object.values(schema.getTypeMap()).filter(typeFilter); + return [ + printSchemaDefinition(schema), + ...directives.map((directive) => printDirective(directive)), + ...types.map((type) => printType(type)), + ] + .filter(Boolean) + .join('\n\n'); +} +function printSchemaDefinition(schema) { + const queryType = schema.getQueryType(); + const mutationType = schema.getMutationType(); + const subscriptionType = schema.getSubscriptionType(); + if (!queryType && !mutationType && !subscriptionType) { + return; + } + if (schema.description != null || !hasDefaultRootOperationTypes(schema)) { + return (printDescription(schema) + + 'schema {\n' + + (queryType ? ` query: ${queryType}\n` : '') + + (mutationType ? ` mutation: ${mutationType}\n` : '') + + (subscriptionType ? ` subscription: ${subscriptionType}\n` : '') + + '}'); + } +} +function hasDefaultRootOperationTypes(schema) { + return (schema.getQueryType() == schema.getType('Query') && + schema.getMutationType() == schema.getType('Mutation') && + schema.getSubscriptionType() == schema.getType('Subscription')); +} +export function printType(type) { + if (isScalarType(type)) { + return printScalar(type); + } + if (isObjectType(type)) { + return printObject(type); + } + if (isInterfaceType(type)) { + return printInterface(type); + } + if (isUnionType(type)) { + return printUnion(type); + } + if (isEnumType(type)) { + return printEnum(type); + } + if (isInputObjectType(type)) { + return printInputObject(type); + } + invariant(false, 'Unexpected type: ' + inspect(type)); +} +function printScalar(type) { + return printDescription(type) + `scalar ${type}` + printSpecifiedByURL(type); +} +function printImplementedInterfaces(type) { + const interfaces = type.getInterfaces(); + return interfaces.length + ? ' implements ' + interfaces.map((i) => i.name).join(' & ') + : ''; +} +function printObject(type) { + return (printDescription(type) + + `type ${type}` + + printImplementedInterfaces(type) + + printFields(type)); +} +function printInterface(type) { + return (printDescription(type) + + `interface ${type}` + + printImplementedInterfaces(type) + + printFields(type)); +} +function printUnion(type) { + const types = type.getTypes(); + const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; + return printDescription(type) + `union ${type.name}` + possibleTypes; +} +function printEnum(type) { + const values = type + .getValues() + .map((value, i) => printDescription(value, ' ', !i) + + ' ' + + value.name + + printDeprecated(value.deprecationReason)); + return printDescription(type) + `enum ${type}` + printBlock(values); +} +function printInputObject(type) { + const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f)); + return (printDescription(type) + + `input ${type}` + + (type.isOneOf ? ' @oneOf' : '') + + printBlock(fields)); +} +function printFields(type) { + const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, ' ', !i) + + ' ' + + f.name + + printArgs(f.args, ' ') + + ': ' + + String(f.type) + + printDeprecated(f.deprecationReason)); + return printBlock(fields); +} +function printBlock(items) { + return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; +} +function printArgs(args, indentation = '') { + if (args.length === 0) { + return ''; + } + if (args.every((arg) => arg.description == null)) { + return '(' + args.map(printInputValue).join(', ') + ')'; + } + return ('(\n' + + args + .map((arg, i) => printDescription(arg, ' ' + indentation, !i) + + ' ' + + indentation + + printInputValue(arg)) + .join('\n') + + '\n' + + indentation + + ')'); +} +function printInputValue(argOrInputField) { + let argDecl = argOrInputField.name + ': ' + String(argOrInputField.type); + const defaultValueAST = getDefaultValueAST(argOrInputField); + if (defaultValueAST) { + argDecl += ` = ${print(defaultValueAST)}`; + } + return argDecl + printDeprecated(argOrInputField.deprecationReason); +} +export function printDirective(directive) { + return (printDescription(directive) + + `directive ${directive}` + + printArgs(directive.args) + + printDeprecated(directive.deprecationReason) + + (directive.isRepeatable ? ' repeatable' : '') + + ' on ' + + directive.locations.join(' | ')); +} +function printDeprecated(reason) { + if (reason == null) { + return ''; + } + if (reason !== DEFAULT_DEPRECATION_REASON) { + const astValue = print({ kind: Kind.STRING, value: reason }); + return ` @deprecated(reason: ${astValue})`; + } + return ' @deprecated'; +} +function printSpecifiedByURL(scalar) { + if (scalar.specifiedByURL == null) { + return ''; + } + const astValue = print({ + kind: Kind.STRING, + value: scalar.specifiedByURL, + }); + return ` @specifiedBy(url: ${astValue})`; +} +function printDescription(def, indentation = '', firstInBlock = true) { + const { description } = def; + if (description == null) { + return ''; + } + const blockString = print({ + kind: Kind.STRING, + value: description, + block: isPrintableAsBlockString(description), + }); + const prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; + return prefix + blockString.replaceAll('\n', '\n' + indentation) + '\n'; +} +//# sourceMappingURL=printSchema.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs.map new file mode 100644 index 00000000..86ac15a1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/printSchema.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"printSchema.js","sourceRoot":"","sources":["../../src/utilities/printSchema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAGpD,OAAO,EAAE,wBAAwB,EAAE,oCAAmC;AACtE,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAC5C,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAa/C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,+BAA8B;AAE/B,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GACrB,+BAA8B;AAC/B,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,4BAA2B;AAG3D,OAAO,EAAE,kBAAkB,EAAE,iCAAgC;AAqB7D,MAAM,UAAU,WAAW,CAAC,MAAqB;IAC/C,OAAO,mBAAmB,CACxB,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAC/B,aAAa,CACd,CAAC;AACJ,CAAC;AAuBD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,CAAC;AAC3C,CAAC;AAED,SAAS,gBAAgB,CACvB,GAA4C,EAC5C,cAAsB,EAAE,EACxB,eAAwB,IAAI;IAE5B,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;IAC5B,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC;QACxB,IAAI,EAAE,IAAI,CAAC,MAAM;QACjB,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,wBAAwB,CAAC,WAAW,CAAC;KAC7C,CAAC,CAAC;IAEH,MAAM,MAAM,GACV,WAAW,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;IAElE,OAAO,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,IAAI,CAAC;AAC1E,CAAC","sourcesContent":["/** @category Schema Printing */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport { isPrintableAsBlockString } from '../language/blockString.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLEnumType,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n} from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport {\n DEFAULT_DEPRECATION_REASON,\n isSpecifiedDirective,\n} from '../type/directives.ts';\nimport { isIntrospectionType } from '../type/introspection.ts';\nimport { isSpecifiedScalarType } from '../type/scalars.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport { getDefaultValueAST } from './getDefaultValueAST.ts';\n\n/**\n * Prints the schema.\n * @param schema - GraphQL schema to use.\n * @returns The printed string representation.\n * @example\n * ```ts\n * import { buildSchema, printSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @upper on FIELD_DEFINITION\n *\n * type Query {\n * greeting: String @upper\n * }\n * `);\n *\n * printSchema(schema); // => ['directive @upper on FIELD_DEFINITION', '', 'type Query {', ' greeting: String', '}'].join('\\n')\n * ```\n */\nexport function printSchema(schema: GraphQLSchema): string {\n return printFilteredSchema(\n schema,\n (n) => !isSpecifiedDirective(n),\n isDefinedType,\n );\n}\n\n/**\n * Prints the introspection schema.\n * @param schema - GraphQL schema to use.\n * @returns The printed string representation.\n * @example\n * ```ts\n * import { buildSchema, printIntrospectionSchema } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n *\n * const printed = printIntrospectionSchema(schema);\n *\n * printed; // matches /type __Schema/\n * printed; // matches /enum __TypeKind/\n * printed; // does not match /type Query/\n * ```\n */\nexport function printIntrospectionSchema(schema: GraphQLSchema): string {\n return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType);\n}\n\nfunction isDefinedType(type: GraphQLNamedType): boolean {\n return !isSpecifiedScalarType(type) && !isIntrospectionType(type);\n}\n\nfunction printFilteredSchema(\n schema: GraphQLSchema,\n directiveFilter: (type: GraphQLDirective) => boolean,\n typeFilter: (type: GraphQLNamedType) => boolean,\n): string {\n const directives = schema.getDirectives().filter(directiveFilter);\n const types = Object.values(schema.getTypeMap()).filter(typeFilter);\n\n return [\n printSchemaDefinition(schema),\n ...directives.map((directive) => printDirective(directive)),\n ...types.map((type) => printType(type)),\n ]\n .filter(Boolean)\n .join('\\n\\n');\n}\n\nfunction printSchemaDefinition(schema: GraphQLSchema): Maybe {\n const queryType = schema.getQueryType();\n const mutationType = schema.getMutationType();\n const subscriptionType = schema.getSubscriptionType();\n\n // Special case: When a schema has no root operation types, no valid schema\n // definition can be printed.\n if (!queryType && !mutationType && !subscriptionType) {\n return;\n }\n\n // Only print a schema definition if there is a description or if it should\n // not be omitted because of having default type names.\n if (schema.description != null || !hasDefaultRootOperationTypes(schema)) {\n return (\n printDescription(schema) +\n 'schema {\\n' +\n (queryType ? ` query: ${queryType}\\n` : '') +\n (mutationType ? ` mutation: ${mutationType}\\n` : '') +\n (subscriptionType ? ` subscription: ${subscriptionType}\\n` : '') +\n '}'\n );\n }\n}\n\n/**\n * GraphQL schema define root types for each type of operation. These types are\n * the same as any other type and can be named in any manner, however there is\n * a common naming convention:\n *\n * ```graphql\n * schema {\n * query: Query\n * mutation: Mutation\n * subscription: Subscription\n * }\n * ```\n *\n * When using this naming convention, the schema description can be omitted so\n * long as these names are only used for operation types.\n *\n * Note however that if any of these default names are used elsewhere in the\n * schema but not as a root operation type, the schema definition must still\n * be printed to avoid ambiguity.\n *\n * @internal\n */\nfunction hasDefaultRootOperationTypes(schema: GraphQLSchema): boolean {\n /* eslint-disable eqeqeq */\n return (\n schema.getQueryType() == schema.getType('Query') &&\n schema.getMutationType() == schema.getType('Mutation') &&\n schema.getSubscriptionType() == schema.getType('Subscription')\n );\n}\n\n/**\n * Prints the type.\n * @param type - The GraphQL type to inspect.\n * @returns The printed string representation.\n * @example\n * ```ts\n * import { buildSchema, printType } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * id: ID!\n * name: String\n * }\n *\n * type Query {\n * viewer: User\n * }\n * `);\n *\n * printType(schema.getType('User')); // => ['type User {', ' id: ID!', ' name: String', '}'].join('\\n')\n * ```\n */\nexport function printType(type: GraphQLNamedType): string {\n if (isScalarType(type)) {\n return printScalar(type);\n }\n if (isObjectType(type)) {\n return printObject(type);\n }\n if (isInterfaceType(type)) {\n return printInterface(type);\n }\n if (isUnionType(type)) {\n return printUnion(type);\n }\n if (isEnumType(type)) {\n return printEnum(type);\n }\n if (isInputObjectType(type)) {\n return printInputObject(type);\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible types have been considered.\n invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction printScalar(type: GraphQLScalarType): string {\n return printDescription(type) + `scalar ${type}` + printSpecifiedByURL(type);\n}\n\nfunction printImplementedInterfaces(\n type: GraphQLObjectType | GraphQLInterfaceType,\n): string {\n const interfaces = type.getInterfaces();\n return interfaces.length\n ? ' implements ' + interfaces.map((i) => i.name).join(' & ')\n : '';\n}\n\nfunction printObject(type: GraphQLObjectType): string {\n return (\n printDescription(type) +\n `type ${type}` +\n printImplementedInterfaces(type) +\n printFields(type)\n );\n}\n\nfunction printInterface(type: GraphQLInterfaceType): string {\n return (\n printDescription(type) +\n `interface ${type}` +\n printImplementedInterfaces(type) +\n printFields(type)\n );\n}\n\nfunction printUnion(type: GraphQLUnionType): string {\n const types = type.getTypes();\n const possibleTypes = types.length ? ' = ' + types.join(' | ') : '';\n return printDescription(type) + `union ${type.name}` + possibleTypes;\n}\n\nfunction printEnum(type: GraphQLEnumType): string {\n const values = type\n .getValues()\n .map(\n (value, i) =>\n printDescription(value, ' ', !i) +\n ' ' +\n value.name +\n printDeprecated(value.deprecationReason),\n );\n\n return printDescription(type) + `enum ${type}` + printBlock(values);\n}\n\nfunction printInputObject(type: GraphQLInputObjectType): string {\n const fields = Object.values(type.getFields()).map(\n (f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f),\n );\n return (\n printDescription(type) +\n `input ${type}` +\n (type.isOneOf ? ' @oneOf' : '') +\n printBlock(fields)\n );\n}\n\nfunction printFields(type: GraphQLObjectType | GraphQLInterfaceType): string {\n const fields = Object.values(type.getFields()).map(\n (f, i) =>\n printDescription(f, ' ', !i) +\n ' ' +\n f.name +\n printArgs(f.args, ' ') +\n ': ' +\n String(f.type) +\n printDeprecated(f.deprecationReason),\n );\n return printBlock(fields);\n}\n\nfunction printBlock(items: ReadonlyArray): string {\n return items.length !== 0 ? ' {\\n' + items.join('\\n') + '\\n}' : '';\n}\n\nfunction printArgs(\n args: ReadonlyArray,\n indentation: string = '',\n): string {\n if (args.length === 0) {\n return '';\n }\n\n // If every arg does not have a description, print them on one line.\n if (args.every((arg) => arg.description == null)) {\n return '(' + args.map(printInputValue).join(', ') + ')';\n }\n\n return (\n '(\\n' +\n args\n .map(\n (arg, i) =>\n printDescription(arg, ' ' + indentation, !i) +\n ' ' +\n indentation +\n printInputValue(arg),\n )\n .join('\\n') +\n '\\n' +\n indentation +\n ')'\n );\n}\n\nfunction printInputValue(\n argOrInputField: GraphQLArgument | GraphQLInputField,\n): string {\n let argDecl = argOrInputField.name + ': ' + String(argOrInputField.type);\n const defaultValueAST = getDefaultValueAST(argOrInputField);\n if (defaultValueAST) {\n argDecl += ` = ${print(defaultValueAST)}`;\n }\n return argDecl + printDeprecated(argOrInputField.deprecationReason);\n}\n\n/**\n * Prints a directive definition in GraphQL SDL.\n * @param directive - Directive to print.\n * @returns SDL string for the directive definition.\n * @example\n * ```ts\n * import {\n * DirectiveLocation,\n * GraphQLDirective,\n * GraphQLString,\n * } from 'graphql/type';\n * import { printDirective } from 'graphql/utilities';\n *\n * const authDirective = new GraphQLDirective({\n * name: 'auth',\n * description: 'Requires authorization.',\n * locations: [DirectiveLocation.FIELD_DEFINITION],\n * args: {\n * scope: { type: GraphQLString },\n * },\n * });\n *\n * printDirective(authDirective); // => '\"\"\"Requires authorization.\"\"\"\\ndirective @auth(scope: String) on FIELD_DEFINITION'\n * ```\n */\nexport function printDirective(directive: GraphQLDirective): string {\n return (\n printDescription(directive) +\n `directive ${directive}` +\n printArgs(directive.args) +\n printDeprecated(directive.deprecationReason) +\n (directive.isRepeatable ? ' repeatable' : '') +\n ' on ' +\n directive.locations.join(' | ')\n );\n}\n\nfunction printDeprecated(reason: Maybe): string {\n if (reason == null) {\n return '';\n }\n if (reason !== DEFAULT_DEPRECATION_REASON) {\n const astValue = print({ kind: Kind.STRING, value: reason });\n return ` @deprecated(reason: ${astValue})`;\n }\n return ' @deprecated';\n}\n\nfunction printSpecifiedByURL(scalar: GraphQLScalarType): string {\n if (scalar.specifiedByURL == null) {\n return '';\n }\n const astValue = print({\n kind: Kind.STRING,\n value: scalar.specifiedByURL,\n });\n return ` @specifiedBy(url: ${astValue})`;\n}\n\nfunction printDescription(\n def: { readonly description: Maybe },\n indentation: string = '',\n firstInBlock: boolean = true,\n): string {\n const { description } = def;\n if (description == null) {\n return '';\n }\n\n const blockString = print({\n kind: Kind.STRING,\n value: description,\n block: isPrintableAsBlockString(description),\n });\n\n const prefix =\n indentation && !firstInBlock ? '\\n' + indentation : indentation;\n\n return prefix + blockString.replaceAll('\\n', '\\n' + indentation) + '\\n';\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.mts new file mode 100644 index 00000000..9262b3ea --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.mts @@ -0,0 +1,45 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ConstValueNode, ValueNode } from "../language/ast.mjs"; +import type { FragmentVariableValues } from "../execution/collectFields.mjs"; +import type { VariableValues } from "../execution/values.mjs"; +/** + * Replaces any Variables found within an AST Value literal with literals + * supplied from a map of variable values, or removed if no variable replacement + * exists, returning a constant value. + * + * Used primarily to ensure only complete constant values are used during input + * coercion of custom scalars which accept complex literals. + * @param valueNode - Value AST node in which variables should be replaced. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @returns A constant value AST with variables replaced. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse, parseValue, print } from 'graphql/language'; + * import { getVariableValues } from 'graphql/execution'; + * import { buildSchema, replaceVariables } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * review(stars: Int = 5): String + * } + * `); + * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }'); + * const operation = document.definitions[0]; + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: 4, + * }); + * + * assert('variableValues' in result); + * + * const literal = replaceVariables( + * parseValue('{ stars: $stars, comment: $missing }'), + * result.variableValues, + * ); + * + * print(literal); // => '{ stars: 4 }' + * ``` + */ +export declare function replaceVariables(valueNode: ValueNode, variableValues?: Maybe, fragmentVariableValues?: Maybe): ConstValueNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.ts new file mode 100644 index 00000000..d1333799 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.d.ts @@ -0,0 +1,45 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ConstValueNode, ValueNode } from "../language/ast.js"; +import type { FragmentVariableValues } from "../execution/collectFields.js"; +import type { VariableValues } from "../execution/values.js"; +/** + * Replaces any Variables found within an AST Value literal with literals + * supplied from a map of variable values, or removed if no variable replacement + * exists, returning a constant value. + * + * Used primarily to ensure only complete constant values are used during input + * coercion of custom scalars which accept complex literals. + * @param valueNode - Value AST node in which variables should be replaced. + * @param variableValues - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @returns A constant value AST with variables replaced. + * @example + * ```ts + * import assert from 'node:assert'; + * import { parse, parseValue, print } from 'graphql/language'; + * import { getVariableValues } from 'graphql/execution'; + * import { buildSchema, replaceVariables } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * review(stars: Int = 5): String + * } + * `); + * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }'); + * const operation = document.definitions[0]; + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: 4, + * }); + * + * assert('variableValues' in result); + * + * const literal = replaceVariables( + * parseValue('{ stars: $stars, comment: $missing }'), + * result.variableValues, + * ); + * + * print(literal); // => '{ stars: 4 }' + * ``` + */ +export declare function replaceVariables(valueNode: ValueNode, variableValues?: Maybe, fragmentVariableValues?: Maybe): ConstValueNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js new file mode 100644 index 00000000..0591b62a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.replaceVariables = replaceVariables; +const kinds_ts_1 = require("../language/kinds.js"); +const valueToLiteral_ts_1 = require("./valueToLiteral.js"); +function replaceVariables(valueNode, variableValues, fragmentVariableValues) { + switch (valueNode.kind) { + case kinds_ts_1.Kind.VARIABLE: { + const varName = valueNode.name.value; + const fragmentVariableValueSource = fragmentVariableValues?.sources[varName]; + if (fragmentVariableValueSource) { + const value = fragmentVariableValueSource.value; + if (value === undefined) { + const defaultValue = fragmentVariableValueSource.signature.default; + if (defaultValue !== undefined) { + return defaultValue.literal; + } + return { kind: kinds_ts_1.Kind.NULL }; + } + return replaceVariables(value, variableValues, fragmentVariableValueSource.fragmentVariableValues); + } + const variableValueSource = variableValues?.sources[varName]; + if (variableValueSource == null) { + return { kind: kinds_ts_1.Kind.NULL }; + } + if (variableValueSource.value === undefined) { + const defaultValue = variableValueSource.signature.default; + if (defaultValue !== undefined) { + return defaultValue.literal; + } + } + return (0, valueToLiteral_ts_1.valueToLiteral)(variableValueSource.value, variableValueSource.signature.type); + } + case kinds_ts_1.Kind.OBJECT: { + const newFields = []; + for (const field of valueNode.fields) { + if (field.value.kind === kinds_ts_1.Kind.VARIABLE) { + const scopedVariableSource = fragmentVariableValues?.sources[field.value.name.value] ?? + variableValues?.sources[field.value.name.value]; + if (scopedVariableSource?.value === undefined && + scopedVariableSource?.signature.default === undefined) { + continue; + } + } + const newFieldNodeValue = replaceVariables(field.value, variableValues, fragmentVariableValues); + newFields.push({ + ...field, + value: newFieldNodeValue, + }); + } + return { + ...valueNode, + fields: newFields, + }; + } + case kinds_ts_1.Kind.LIST: { + const newValues = []; + for (const value of valueNode.values) { + const newItemNodeValue = replaceVariables(value, variableValues, fragmentVariableValues); + newValues.push(newItemNodeValue); + } + return { + ...valueNode, + values: newValues, + }; + } + default: { + return valueNode; + } + } +} +//# sourceMappingURL=replaceVariables.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js.map new file mode 100644 index 00000000..17ac6567 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.js.map @@ -0,0 +1 @@ +{"version":3,"file":"replaceVariables.js","sourceRoot":"","sources":["../../src/utilities/replaceVariables.ts"],"names":[],"mappings":";;AAuDA,4CA6FC;AA3ID,mDAA4C;AAK5C,2DAAqD;AAyCrD,SAAgB,gBAAgB,CAC9B,SAAoB,EACpB,cAAsC,EACtC,sBAAsD;IAEtD,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,eAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnB,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;YACrC,MAAM,2BAA2B,GAC/B,sBAAsB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAE3C,IAAI,2BAA2B,EAAE,CAAC;gBAChC,MAAM,KAAK,GAAG,2BAA2B,CAAC,KAAK,CAAC;gBAChD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,MAAM,YAAY,GAAG,2BAA2B,CAAC,SAAS,CAAC,OAAO,CAAC;oBACnE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;wBAC/B,OAAO,YAAY,CAAC,OAAO,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rD,CAAC;wBACD,SAAS;oBACX,CAAC;gBACH,CAAC;gBACD,MAAM,iBAAiB,GAAG,gBAAgB,CACxC,KAAK,CAAC,KAAK,EACX,cAAc,EACd,sBAAsB,CACvB,CAAC;gBACF,SAAS,CAAC,IAAI,CAAC;oBACb,GAAG,KAAK;oBACR,KAAK,EAAE,iBAAiB;iBACzB,CAAC,CAAC;YACL,CAAC;YACD,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,SAAS;aACA,CAAC;QACtB,CAAC;QACD,KAAK,eAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACf,MAAM,SAAS,GAAqB,EAAE,CAAC;YACvC,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;gBACrC,MAAM,gBAAgB,GAAG,gBAAgB,CACvC,KAAK,EACL,cAAc,EACd,sBAAsB,CACvB,CAAC;gBACF,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACnC,CAAC;YACD,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,SAAS;aACA,CAAC;QACtB,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n ConstValueNode,\n ObjectFieldNode,\n ValueNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { FragmentVariableValues } from '../execution/collectFields.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { valueToLiteral } from './valueToLiteral.ts';\n\n/**\n * Replaces any Variables found within an AST Value literal with literals\n * supplied from a map of variable values, or removed if no variable replacement\n * exists, returning a constant value.\n *\n * Used primarily to ensure only complete constant values are used during input\n * coercion of custom scalars which accept complex literals.\n * @param valueNode - Value AST node in which variables should be replaced.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @returns A constant value AST with variables replaced.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse, parseValue, print } from 'graphql/language';\n * import { getVariableValues } from 'graphql/execution';\n * import { buildSchema, replaceVariables } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * review(stars: Int = 5): String\n * }\n * `);\n * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');\n * const operation = document.definitions[0];\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: 4,\n * });\n *\n * assert('variableValues' in result);\n *\n * const literal = replaceVariables(\n * parseValue('{ stars: $stars, comment: $missing }'),\n * result.variableValues,\n * );\n *\n * print(literal); // => '{ stars: 4 }'\n * ```\n */\nexport function replaceVariables(\n valueNode: ValueNode,\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n): ConstValueNode {\n switch (valueNode.kind) {\n case Kind.VARIABLE: {\n const varName = valueNode.name.value;\n const fragmentVariableValueSource =\n fragmentVariableValues?.sources[varName];\n\n if (fragmentVariableValueSource) {\n const value = fragmentVariableValueSource.value;\n if (value === undefined) {\n const defaultValue = fragmentVariableValueSource.signature.default;\n if (defaultValue !== undefined) {\n return defaultValue.literal;\n }\n return { kind: Kind.NULL };\n }\n return replaceVariables(\n value,\n variableValues,\n fragmentVariableValueSource.fragmentVariableValues,\n );\n }\n\n const variableValueSource = variableValues?.sources[varName];\n if (variableValueSource == null) {\n return { kind: Kind.NULL };\n }\n\n if (variableValueSource.value === undefined) {\n const defaultValue = variableValueSource.signature.default;\n if (defaultValue !== undefined) {\n return defaultValue.literal;\n }\n }\n\n return valueToLiteral(\n variableValueSource.value,\n variableValueSource.signature.type,\n ) as ConstValueNode;\n }\n case Kind.OBJECT: {\n const newFields: Array = [];\n for (const field of valueNode.fields) {\n if (field.value.kind === Kind.VARIABLE) {\n const scopedVariableSource =\n fragmentVariableValues?.sources[field.value.name.value] ??\n variableValues?.sources[field.value.name.value];\n\n if (\n scopedVariableSource?.value === undefined &&\n scopedVariableSource?.signature.default === undefined\n ) {\n continue;\n }\n }\n const newFieldNodeValue = replaceVariables(\n field.value,\n variableValues,\n fragmentVariableValues,\n );\n newFields.push({\n ...field,\n value: newFieldNodeValue,\n });\n }\n return {\n ...valueNode,\n fields: newFields,\n } as ConstValueNode;\n }\n case Kind.LIST: {\n const newValues: Array = [];\n for (const value of valueNode.values) {\n const newItemNodeValue = replaceVariables(\n value,\n variableValues,\n fragmentVariableValues,\n );\n newValues.push(newItemNodeValue);\n }\n return {\n ...valueNode,\n values: newValues,\n } as ConstValueNode;\n }\n default: {\n return valueNode;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs new file mode 100644 index 00000000..1fe119de --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs @@ -0,0 +1,69 @@ +import { Kind } from "../language/kinds.mjs"; +import { valueToLiteral } from "./valueToLiteral.mjs"; +export function replaceVariables(valueNode, variableValues, fragmentVariableValues) { + switch (valueNode.kind) { + case Kind.VARIABLE: { + const varName = valueNode.name.value; + const fragmentVariableValueSource = fragmentVariableValues?.sources[varName]; + if (fragmentVariableValueSource) { + const value = fragmentVariableValueSource.value; + if (value === undefined) { + const defaultValue = fragmentVariableValueSource.signature.default; + if (defaultValue !== undefined) { + return defaultValue.literal; + } + return { kind: Kind.NULL }; + } + return replaceVariables(value, variableValues, fragmentVariableValueSource.fragmentVariableValues); + } + const variableValueSource = variableValues?.sources[varName]; + if (variableValueSource == null) { + return { kind: Kind.NULL }; + } + if (variableValueSource.value === undefined) { + const defaultValue = variableValueSource.signature.default; + if (defaultValue !== undefined) { + return defaultValue.literal; + } + } + return valueToLiteral(variableValueSource.value, variableValueSource.signature.type); + } + case Kind.OBJECT: { + const newFields = []; + for (const field of valueNode.fields) { + if (field.value.kind === Kind.VARIABLE) { + const scopedVariableSource = fragmentVariableValues?.sources[field.value.name.value] ?? + variableValues?.sources[field.value.name.value]; + if (scopedVariableSource?.value === undefined && + scopedVariableSource?.signature.default === undefined) { + continue; + } + } + const newFieldNodeValue = replaceVariables(field.value, variableValues, fragmentVariableValues); + newFields.push({ + ...field, + value: newFieldNodeValue, + }); + } + return { + ...valueNode, + fields: newFields, + }; + } + case Kind.LIST: { + const newValues = []; + for (const value of valueNode.values) { + const newItemNodeValue = replaceVariables(value, variableValues, fragmentVariableValues); + newValues.push(newItemNodeValue); + } + return { + ...valueNode, + values: newValues, + }; + } + default: { + return valueNode; + } + } +} +//# sourceMappingURL=replaceVariables.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs.map new file mode 100644 index 00000000..5cc6edec --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/replaceVariables.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"replaceVariables.js","sourceRoot":"","sources":["../../src/utilities/replaceVariables.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAK5C,OAAO,EAAE,cAAc,EAAE,6BAA4B;AAyCrD,MAAM,UAAU,gBAAgB,CAC9B,SAAoB,EACpB,cAAsC,EACtC,sBAAsD;IAEtD,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnB,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;YACrC,MAAM,2BAA2B,GAC/B,sBAAsB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAE3C,IAAI,2BAA2B,EAAE,CAAC;gBAChC,MAAM,KAAK,GAAG,2BAA2B,CAAC,KAAK,CAAC;gB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c,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAElD,IACE,oBAAoB,EAAE,KAAK,KAAK,SAAS;wBACzC,oBAAoB,EAAE,SAAS,CAAC,OAAO,KAAK,SAAS,EACrD,CAAC;wBACD,SAAS;oBACX,CAAC;gBACH,CAAC;gBACD,MAAM,iBAAiB,GAAG,gBAAgB,CACxC,KAAK,CAAC,KAAK,EACX,cAAc,EACd,sBAAsB,CACvB,CAAC;gBACF,SAAS,CAAC,IAAI,CAAC;oBACb,GAAG,KAAK;oBACR,KAAK,EAAE,iBAAiB;iBACzB,CAAC,CAAC;YACL,CAAC;YACD,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,SAAS;aACA,CAAC;QACtB,CAAC;QACD,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACf,MAAM,SAAS,GAAqB,EAAE,CAAC;YACvC,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;gBACrC,MAAM,gBAAgB,GAAG,gBAAgB,CACvC,KAAK,EACL,cAAc,EACd,sBAAsB,CACvB,CAAC;gBACF,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACnC,CAAC;YACD,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,SAAS;aACA,CAAC;QACtB,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport type {\n ConstValueNode,\n ObjectFieldNode,\n ValueNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { FragmentVariableValues } from '../execution/collectFields.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { valueToLiteral } from './valueToLiteral.ts';\n\n/**\n * Replaces any Variables found within an AST Value literal with literals\n * supplied from a map of variable values, or removed if no variable replacement\n * exists, returning a constant value.\n *\n * Used primarily to ensure only complete constant values are used during input\n * coercion of custom scalars which accept complex literals.\n * @param valueNode - Value AST node in which variables should be replaced.\n * @param variableValues - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @returns A constant value AST with variables replaced.\n * @example\n * ```ts\n * import assert from 'node:assert';\n * import { parse, parseValue, print } from 'graphql/language';\n * import { getVariableValues } from 'graphql/execution';\n * import { buildSchema, replaceVariables } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * review(stars: Int = 5): String\n * }\n * `);\n * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');\n * const operation = document.definitions[0];\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: 4,\n * });\n *\n * assert('variableValues' in result);\n *\n * const literal = replaceVariables(\n * parseValue('{ stars: $stars, comment: $missing }'),\n * result.variableValues,\n * );\n *\n * print(literal); // => '{ stars: 4 }'\n * ```\n */\nexport function replaceVariables(\n valueNode: ValueNode,\n variableValues?: Maybe,\n fragmentVariableValues?: Maybe,\n): ConstValueNode {\n switch (valueNode.kind) {\n case Kind.VARIABLE: {\n const varName = valueNode.name.value;\n const fragmentVariableValueSource =\n fragmentVariableValues?.sources[varName];\n\n if (fragmentVariableValueSource) {\n const value = fragmentVariableValueSource.value;\n if (value === undefined) {\n const defaultValue = fragmentVariableValueSource.signature.default;\n if (defaultValue !== undefined) {\n return defaultValue.literal;\n }\n return { kind: Kind.NULL };\n }\n return replaceVariables(\n value,\n variableValues,\n fragmentVariableValueSource.fragmentVariableValues,\n );\n }\n\n const variableValueSource = variableValues?.sources[varName];\n if (variableValueSource == null) {\n return { kind: Kind.NULL };\n }\n\n if (variableValueSource.value === undefined) {\n const defaultValue = variableValueSource.signature.default;\n if (defaultValue !== undefined) {\n return defaultValue.literal;\n }\n }\n\n return valueToLiteral(\n variableValueSource.value,\n variableValueSource.signature.type,\n ) as ConstValueNode;\n }\n case Kind.OBJECT: {\n const newFields: Array = [];\n for (const field of valueNode.fields) {\n if (field.value.kind === Kind.VARIABLE) {\n const scopedVariableSource =\n fragmentVariableValues?.sources[field.value.name.value] ??\n variableValues?.sources[field.value.name.value];\n\n if (\n scopedVariableSource?.value === undefined &&\n scopedVariableSource?.signature.default === undefined\n ) {\n continue;\n }\n }\n const newFieldNodeValue = replaceVariables(\n field.value,\n variableValues,\n fragmentVariableValues,\n );\n newFields.push({\n ...field,\n value: newFieldNodeValue,\n });\n }\n return {\n ...valueNode,\n fields: newFields,\n } as ConstValueNode;\n }\n case Kind.LIST: {\n const newValues: Array = [];\n for (const value of valueNode.values) {\n const newItemNodeValue = replaceVariables(\n value,\n variableValues,\n fragmentVariableValues,\n );\n newValues.push(newItemNodeValue);\n }\n return {\n ...valueNode,\n values: newValues,\n } as ConstValueNode;\n }\n default: {\n return valueNode;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.mts new file mode 100644 index 00000000..0b72f734 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.mts @@ -0,0 +1,119 @@ +/** @category Schema Coordinates */ +import type { SchemaCoordinateNode } from "../language/ast.mjs"; +import type { Source } from "../language/source.mjs"; +import type { GraphQLArgument, GraphQLEnumType, GraphQLEnumValue, GraphQLField, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType } from "../type/definition.mjs"; +import type { GraphQLDirective } from "../type/directives.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +/** + * A resolved schema element may be one of the following kinds: + * + * @internal + */ +export interface ResolvedNamedType { + readonly kind: 'NamedType'; + readonly type: GraphQLNamedType; +} +/** @internal */ +export interface ResolvedField { + readonly kind: 'Field'; + readonly type: GraphQLObjectType | GraphQLInterfaceType; + readonly field: GraphQLField; +} +/** @internal */ +export interface ResolvedInputField { + readonly kind: 'InputField'; + readonly type: GraphQLInputObjectType; + readonly inputField: GraphQLInputField; +} +/** @internal */ +export interface ResolvedEnumValue { + readonly kind: 'EnumValue'; + readonly type: GraphQLEnumType; + readonly enumValue: GraphQLEnumValue; +} +/** @internal */ +export interface ResolvedFieldArgument { + readonly kind: 'FieldArgument'; + readonly type: GraphQLObjectType | GraphQLInterfaceType; + readonly field: GraphQLField; + readonly fieldArgument: GraphQLArgument; +} +/** @internal */ +export interface ResolvedDirective { + readonly kind: 'Directive'; + readonly directive: GraphQLDirective; +} +/** @internal */ +export interface ResolvedDirectiveArgument { + readonly kind: 'DirectiveArgument'; + readonly directive: GraphQLDirective; + readonly directiveArgument: GraphQLArgument; +} +/** A schema element resolved from a schema coordinate. */ +export type ResolvedSchemaElement = ResolvedNamedType | ResolvedField | ResolvedInputField | ResolvedEnumValue | ResolvedFieldArgument | ResolvedDirective | ResolvedDirectiveArgument; +/** + * A schema coordinate is resolved in the context of a GraphQL schema to + * uniquely identify a schema element. It returns undefined if the schema + * coordinate does not resolve to a schema element, meta-field, or introspection + * schema element. It will throw if the containing schema element (if + * applicable) does not exist. + * + * https://spec.graphql.org/draft/#sec-Schema-Coordinates.Semantics + * @param schema - GraphQL schema to use. + * @param schemaCoordinate - The schema coordinate to resolve. + * @returns The schema element identified by the coordinate, or undefined if none exists. + * @example + * ```ts + * import { buildSchema, resolveSchemaCoordinate } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @tag(name: String!) on FIELD_DEFINITION + * + * input ReviewInput { + * stars: Int! + * } + * + * enum Episode { + * NEW_HOPE + * } + * + * type Query { + * reviews(input: ReviewInput): [String] @tag(name: "reviews") + * } + * `); + * + * resolveSchemaCoordinate(schema, 'Query').kind; // => 'NamedType' + * resolveSchemaCoordinate(schema, 'Query.reviews').kind; // => 'Field' + * resolveSchemaCoordinate(schema, 'Query.reviews(input:)').kind; // => 'FieldArgument' + * resolveSchemaCoordinate(schema, 'ReviewInput.stars').kind; // => 'InputField' + * resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE').kind; // => 'EnumValue' + * resolveSchemaCoordinate(schema, '@tag').kind; // => 'Directive' + * resolveSchemaCoordinate(schema, '@tag(name:)').kind; // => 'DirectiveArgument' + * resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined + * ``` + */ +export declare function resolveSchemaCoordinate(schema: GraphQLSchema, schemaCoordinate: string | Source): ResolvedSchemaElement | undefined; +/** + * Resolves schema coordinate from a parsed SchemaCoordinate node. + * @param schema - GraphQL schema to use. + * @param schemaCoordinate - The schema coordinate to resolve. + * @returns The schema element identified by the parsed coordinate, or undefined if none exists. + * @example + * ```ts + * import { parseSchemaCoordinate } from 'graphql/language'; + * import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const coordinate = parseSchemaCoordinate('Query.greeting(name:)'); + * const resolved = resolveASTSchemaCoordinate(schema, coordinate); + * + * resolved.kind; // => 'FieldArgument' + * resolved.field.name; // => 'greeting' + * resolved.fieldArgument.name; // => 'name' + * ``` + */ +export declare function resolveASTSchemaCoordinate(schema: GraphQLSchema, schemaCoordinate: SchemaCoordinateNode): ResolvedSchemaElement | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts new file mode 100644 index 00000000..8c59f4e6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts @@ -0,0 +1,119 @@ +/** @category Schema Coordinates */ +import type { SchemaCoordinateNode } from "../language/ast.js"; +import type { Source } from "../language/source.js"; +import type { GraphQLArgument, GraphQLEnumType, GraphQLEnumValue, GraphQLField, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType } from "../type/definition.js"; +import type { GraphQLDirective } from "../type/directives.js"; +import type { GraphQLSchema } from "../type/schema.js"; +/** + * A resolved schema element may be one of the following kinds: + * + * @internal + */ +export interface ResolvedNamedType { + readonly kind: 'NamedType'; + readonly type: GraphQLNamedType; +} +/** @internal */ +export interface ResolvedField { + readonly kind: 'Field'; + readonly type: GraphQLObjectType | GraphQLInterfaceType; + readonly field: GraphQLField; +} +/** @internal */ +export interface ResolvedInputField { + readonly kind: 'InputField'; + readonly type: GraphQLInputObjectType; + readonly inputField: GraphQLInputField; +} +/** @internal */ +export interface ResolvedEnumValue { + readonly kind: 'EnumValue'; + readonly type: GraphQLEnumType; + readonly enumValue: GraphQLEnumValue; +} +/** @internal */ +export interface ResolvedFieldArgument { + readonly kind: 'FieldArgument'; + readonly type: GraphQLObjectType | GraphQLInterfaceType; + readonly field: GraphQLField; + readonly fieldArgument: GraphQLArgument; +} +/** @internal */ +export interface ResolvedDirective { + readonly kind: 'Directive'; + readonly directive: GraphQLDirective; +} +/** @internal */ +export interface ResolvedDirectiveArgument { + readonly kind: 'DirectiveArgument'; + readonly directive: GraphQLDirective; + readonly directiveArgument: GraphQLArgument; +} +/** A schema element resolved from a schema coordinate. */ +export type ResolvedSchemaElement = ResolvedNamedType | ResolvedField | ResolvedInputField | ResolvedEnumValue | ResolvedFieldArgument | ResolvedDirective | ResolvedDirectiveArgument; +/** + * A schema coordinate is resolved in the context of a GraphQL schema to + * uniquely identify a schema element. It returns undefined if the schema + * coordinate does not resolve to a schema element, meta-field, or introspection + * schema element. It will throw if the containing schema element (if + * applicable) does not exist. + * + * https://spec.graphql.org/draft/#sec-Schema-Coordinates.Semantics + * @param schema - GraphQL schema to use. + * @param schemaCoordinate - The schema coordinate to resolve. + * @returns The schema element identified by the coordinate, or undefined if none exists. + * @example + * ```ts + * import { buildSchema, resolveSchemaCoordinate } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * directive @tag(name: String!) on FIELD_DEFINITION + * + * input ReviewInput { + * stars: Int! + * } + * + * enum Episode { + * NEW_HOPE + * } + * + * type Query { + * reviews(input: ReviewInput): [String] @tag(name: "reviews") + * } + * `); + * + * resolveSchemaCoordinate(schema, 'Query').kind; // => 'NamedType' + * resolveSchemaCoordinate(schema, 'Query.reviews').kind; // => 'Field' + * resolveSchemaCoordinate(schema, 'Query.reviews(input:)').kind; // => 'FieldArgument' + * resolveSchemaCoordinate(schema, 'ReviewInput.stars').kind; // => 'InputField' + * resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE').kind; // => 'EnumValue' + * resolveSchemaCoordinate(schema, '@tag').kind; // => 'Directive' + * resolveSchemaCoordinate(schema, '@tag(name:)').kind; // => 'DirectiveArgument' + * resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined + * ``` + */ +export declare function resolveSchemaCoordinate(schema: GraphQLSchema, schemaCoordinate: string | Source): ResolvedSchemaElement | undefined; +/** + * Resolves schema coordinate from a parsed SchemaCoordinate node. + * @param schema - GraphQL schema to use. + * @param schemaCoordinate - The schema coordinate to resolve. + * @returns The schema element identified by the parsed coordinate, or undefined if none exists. + * @example + * ```ts + * import { parseSchemaCoordinate } from 'graphql/language'; + * import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const coordinate = parseSchemaCoordinate('Query.greeting(name:)'); + * const resolved = resolveASTSchemaCoordinate(schema, coordinate); + * + * resolved.kind; // => 'FieldArgument' + * resolved.field.name; // => 'greeting' + * resolved.fieldArgument.name; // => 'name' + * ``` + */ +export declare function resolveASTSchemaCoordinate(schema: GraphQLSchema, schemaCoordinate: SchemaCoordinateNode): ResolvedSchemaElement | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js new file mode 100644 index 00000000..6a8ad210 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js @@ -0,0 +1,111 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveSchemaCoordinate = resolveSchemaCoordinate; +exports.resolveASTSchemaCoordinate = resolveASTSchemaCoordinate; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const parser_ts_1 = require("../language/parser.js"); +const definition_ts_1 = require("../type/definition.js"); +function resolveSchemaCoordinate(schema, schemaCoordinate) { + return resolveASTSchemaCoordinate(schema, (0, parser_ts_1.parseSchemaCoordinate)(schemaCoordinate)); +} +function resolveTypeCoordinate(schema, schemaCoordinate) { + const typeName = schemaCoordinate.name.value; + const type = schema.getType(typeName); + if (type == null) { + return; + } + return { kind: 'NamedType', type }; +} +function resolveMemberCoordinate(schema, schemaCoordinate) { + const typeName = schemaCoordinate.name.value; + const type = schema.getType(typeName); + if (!type) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(typeName)} to be defined as a type in the schema.`); + } + if (!(0, definition_ts_1.isEnumType)(type) && + !(0, definition_ts_1.isInputObjectType)(type) && + !(0, definition_ts_1.isObjectType)(type) && + !(0, definition_ts_1.isInterfaceType)(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(typeName)} to be an Enum, Input Object, Object or Interface type.`); + } + if ((0, definition_ts_1.isEnumType)(type)) { + const enumValueName = schemaCoordinate.memberName.value; + const enumValue = type.getValue(enumValueName); + if (enumValue == null) { + return; + } + return { kind: 'EnumValue', type, enumValue }; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + const inputFieldName = schemaCoordinate.memberName.value; + const inputField = type.getFields()[inputFieldName]; + if (inputField == null) { + return; + } + return { kind: 'InputField', type, inputField }; + } + const fieldName = schemaCoordinate.memberName.value; + const field = schema.getField(type, fieldName); + if (field == null) { + return; + } + return { kind: 'Field', type, field }; +} +function resolveArgumentCoordinate(schema, schemaCoordinate) { + const typeName = schemaCoordinate.name.value; + const type = schema.getType(typeName); + if (type == null) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(typeName)} to be defined as a type in the schema.`); + } + if (!(0, definition_ts_1.isObjectType)(type) && !(0, definition_ts_1.isInterfaceType)(type)) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(typeName)} to be an object type or interface type.`); + } + const fieldName = schemaCoordinate.fieldName.value; + const field = schema.getField(type, fieldName); + if (field == null) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(fieldName)} to exist as a field of type ${(0, inspect_ts_1.inspect)(typeName)} in the schema.`); + } + const fieldArgumentName = schemaCoordinate.argumentName.value; + const fieldArgument = field.args.find((arg) => arg.name === fieldArgumentName); + if (fieldArgument == null) { + return; + } + return { kind: 'FieldArgument', type, field, fieldArgument }; +} +function resolveDirectiveCoordinate(schema, schemaCoordinate) { + const directiveName = schemaCoordinate.name.value; + const directive = schema.getDirective(directiveName); + if (!directive) { + return; + } + return { kind: 'Directive', directive }; +} +function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) { + const directiveName = schemaCoordinate.name.value; + const directive = schema.getDirective(directiveName); + if (!directive) { + throw new Error(`Expected ${(0, inspect_ts_1.inspect)(directiveName)} to be defined as a directive in the schema.`); + } + const { argumentName: { value: directiveArgumentName }, } = schemaCoordinate; + const directiveArgument = directive.args.find((arg) => arg.name === directiveArgumentName); + if (!directiveArgument) { + return; + } + return { kind: 'DirectiveArgument', directive, directiveArgument }; +} +function resolveASTSchemaCoordinate(schema, schemaCoordinate) { + switch (schemaCoordinate.kind) { + case kinds_ts_1.Kind.TYPE_COORDINATE: + return resolveTypeCoordinate(schema, schemaCoordinate); + case kinds_ts_1.Kind.MEMBER_COORDINATE: + return resolveMemberCoordinate(schema, schemaCoordinate); + case kinds_ts_1.Kind.ARGUMENT_COORDINATE: + return resolveArgumentCoordinate(schema, schemaCoordinate); + case kinds_ts_1.Kind.DIRECTIVE_COORDINATE: + return resolveDirectiveCoordinate(schema, schemaCoordinate); + case kinds_ts_1.Kind.DIRECTIVE_ARGUMENT_COORDINATE: + return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate); + } +} +//# sourceMappingURL=resolveSchemaCoordinate.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js.map new file mode 100644 index 00000000..c43cf2ca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolveSchemaCoordinate.js","sourceRoot":"","sources":["../../src/utilities/resolveSchemaCoordinate.ts"],"names":[],"mappings":";;AA2IA,0DAQC;AAoOD,gEAgBC;AArYD,sDAAgD;AAUhD,mDAA4C;AAC5C,qDAA8D;AAc9D,yDAK+B;AA2G/B,SAAgB,uBAAuB,CACrC,MAAqB,EACrB,gBAAiC;IAEjC,OAAO,0BAA0B,CAC/B,MAAM,EACN,IAAA,iCAAqB,EAAC,gBAAgB,CAAC,CACxC,CAAC;AACJ,CAAC;AAOD,SAAS,qBAAqB,CAC5B,MAAqB,EACrB,gBAAoC;IAGpC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;IAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAGtC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC;AAOD,SAAS,uBAAuB,CAC9B,MAAqB,EACrB,gBAAsC;IAItC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;IAC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ACxC,MAAqB,EACrB,gBAAsC;IAEtC,QAAQ,gBAAgB,CAAC,IAAI,EAAE,CAAC;QAC9B,KAAK,eAAI,CAAC,eAAe;YACvB,OAAO,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QACzD,KAAK,eAAI,CAAC,iBAAiB;YACzB,OAAO,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAC3D,KAAK,eAAI,CAAC,mBAAmB;YAC3B,OAAO,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAC7D,KAAK,eAAI,CAAC,oBAAoB;YAC5B,OAAO,0BAA0B,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAC9D,KAAK,eAAI,CAAC,6BAA6B;YACrC,OAAO,kCAAkC,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACxE,CAAC;AACH,CAAC","sourcesContent":["/** @category Schema Coordinates */\n\nimport { inspect } from '../jsutils/inspect.ts';\n\nimport type {\n ArgumentCoordinateNode,\n DirectiveArgumentCoordinateNode,\n DirectiveCoordinateNode,\n MemberCoordinateNode,\n SchemaCoordinateNode,\n TypeCoordinateNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { parseSchemaCoordinate } from '../language/parser.ts';\nimport type { Source } from '../language/source.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLEnumType,\n GraphQLEnumValue,\n GraphQLField,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n} from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\n/**\n * A resolved schema element may be one of the following kinds:\n *\n * @internal\n */\nexport interface ResolvedNamedType {\n readonly kind: 'NamedType';\n readonly type: GraphQLNamedType;\n}\n\n/** @internal */\nexport interface ResolvedField {\n readonly kind: 'Field';\n readonly type: GraphQLObjectType | GraphQLInterfaceType;\n readonly field: GraphQLField;\n}\n\n/** @internal */\nexport interface ResolvedInputField {\n readonly kind: 'InputField';\n readonly type: GraphQLInputObjectType;\n readonly inputField: GraphQLInputField;\n}\n\n/** @internal */\nexport interface ResolvedEnumValue {\n readonly kind: 'EnumValue';\n readonly type: GraphQLEnumType;\n readonly enumValue: GraphQLEnumValue;\n}\n\n/** @internal */\nexport interface ResolvedFieldArgument {\n readonly kind: 'FieldArgument';\n readonly type: GraphQLObjectType | GraphQLInterfaceType;\n readonly field: GraphQLField;\n readonly fieldArgument: GraphQLArgument;\n}\n\n/** @internal */\nexport interface ResolvedDirective {\n readonly kind: 'Directive';\n readonly directive: GraphQLDirective;\n}\n\n/** @internal */\nexport interface ResolvedDirectiveArgument {\n readonly kind: 'DirectiveArgument';\n readonly directive: GraphQLDirective;\n readonly directiveArgument: GraphQLArgument;\n}\n\n/** A schema element resolved from a schema coordinate. */\nexport type ResolvedSchemaElement =\n | ResolvedNamedType\n | ResolvedField\n | ResolvedInputField\n | ResolvedEnumValue\n | ResolvedFieldArgument\n | ResolvedDirective\n | ResolvedDirectiveArgument;\n\n/**\n * A schema coordinate is resolved in the context of a GraphQL schema to\n * uniquely identify a schema element. It returns undefined if the schema\n * coordinate does not resolve to a schema element, meta-field, or introspection\n * schema element. It will throw if the containing schema element (if\n * applicable) does not exist.\n *\n * https://spec.graphql.org/draft/#sec-Schema-Coordinates.Semantics\n * @param schema - GraphQL schema to use.\n * @param schemaCoordinate - The schema coordinate to resolve.\n * @returns The schema element identified by the coordinate, or undefined if none exists.\n * @example\n * ```ts\n * import { buildSchema, resolveSchemaCoordinate } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @tag(name: String!) on FIELD_DEFINITION\n *\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Query {\n * reviews(input: ReviewInput): [String] @tag(name: \"reviews\")\n * }\n * `);\n *\n * resolveSchemaCoordinate(schema, 'Query').kind; // => 'NamedType'\n * resolveSchemaCoordinate(schema, 'Query.reviews').kind; // => 'Field'\n * resolveSchemaCoordinate(schema, 'Query.reviews(input:)').kind; // => 'FieldArgument'\n * resolveSchemaCoordinate(schema, 'ReviewInput.stars').kind; // => 'InputField'\n * resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE').kind; // => 'EnumValue'\n * resolveSchemaCoordinate(schema, '@tag').kind; // => 'Directive'\n * resolveSchemaCoordinate(schema, '@tag(name:)').kind; // => 'DirectiveArgument'\n * resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined\n * ```\n */\nexport function resolveSchemaCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: string | Source,\n): ResolvedSchemaElement | undefined {\n return resolveASTSchemaCoordinate(\n schema,\n parseSchemaCoordinate(schemaCoordinate),\n );\n}\n\n/**\n * TypeCoordinate : Name\n *\n * @internal\n */\nfunction resolveTypeCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: TypeCoordinateNode,\n): ResolvedNamedType | undefined {\n // 1. Let {typeName} be the value of {Name}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName);\n\n // 2. Return the type in the {schema} named {typeName} if it exists.\n if (type == null) {\n return;\n }\n\n return { kind: 'NamedType', type };\n}\n\n/**\n * MemberCoordinate : Name . Name\n *\n * @internal\n */\nfunction resolveMemberCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: MemberCoordinateNode,\n): ResolvedField | ResolvedInputField | ResolvedEnumValue | undefined {\n // 1. Let {typeName} be the value of the first {Name}.\n // 2. Let {type} be the type in the {schema} named {typeName}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName);\n\n // 3. Assert: {type} must exist, and must be an Enum, Input Object, Object or Interface type.\n if (!type) {\n throw new Error(\n `Expected ${inspect(typeName)} to be defined as a type in the schema.`,\n );\n }\n if (\n !isEnumType(type) &&\n !isInputObjectType(type) &&\n !isObjectType(type) &&\n !isInterfaceType(type)\n ) {\n throw new Error(\n `Expected ${inspect(typeName)} to be an Enum, Input Object, Object or Interface type.`,\n );\n }\n\n // 4. If {type} is an Enum type:\n if (isEnumType(type)) {\n // 1. Let {enumValueName} be the value of the second {Name}.\n const enumValueName = schemaCoordinate.memberName.value;\n const enumValue = type.getValue(enumValueName);\n\n // 2. Return the enum value of {type} named {enumValueName} if it exists.\n if (enumValue == null) {\n return;\n }\n\n return { kind: 'EnumValue', type, enumValue };\n }\n\n // 5. Otherwise, if {type} is an Input Object type:\n if (isInputObjectType(type)) {\n // 1. Let {inputFieldName} be the value of the second {Name}.\n const inputFieldName = schemaCoordinate.memberName.value;\n const inputField = type.getFields()[inputFieldName];\n\n // 2. Return the input field of {type} named {inputFieldName} if it exists.\n if (inputField == null) {\n return;\n }\n\n return { kind: 'InputField', type, inputField };\n }\n\n // 6. Otherwise:\n // 1. Let {fieldName} be the value of the second {Name}.\n const fieldName = schemaCoordinate.memberName.value;\n const field = schema.getField(type, fieldName);\n\n // 2. Return the field of {type} named {fieldName} if it exists.\n if (field == null) {\n return;\n }\n\n return { kind: 'Field', type, field };\n}\n\n/**\n * ArgumentCoordinate : Name . Name ( Name : )\n *\n * @internal\n */\nfunction resolveArgumentCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: ArgumentCoordinateNode,\n): ResolvedFieldArgument | undefined {\n // 1. Let {typeName} be the value of the first {Name}.\n // 2. Let {type} be the type in the {schema} named {typeName}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName);\n\n // 3. Assert: {type} must exist, and be an Object or Interface type.\n if (type == null) {\n throw new Error(\n `Expected ${inspect(typeName)} to be defined as a type in the schema.`,\n );\n }\n if (!isObjectType(type) && !isInterfaceType(type)) {\n throw new Error(\n `Expected ${inspect(typeName)} to be an object type or interface type.`,\n );\n }\n\n // 4. Let {fieldName} be the value of the second {Name}.\n // 5. Let {field} be the field of {type} named {fieldName}.\n const fieldName = schemaCoordinate.fieldName.value;\n const field = schema.getField(type, fieldName);\n\n // 7. Assert: {field} must exist.\n if (field == null) {\n throw new Error(\n `Expected ${inspect(fieldName)} to exist as a field of type ${inspect(typeName)} in the schema.`,\n );\n }\n\n // 7. Let {fieldArgumentName} be the value of the third {Name}.\n const fieldArgumentName = schemaCoordinate.argumentName.value;\n const fieldArgument = field.args.find(\n (arg) => arg.name === fieldArgumentName,\n );\n\n // 8. Return the argument of {field} named {fieldArgumentName} if it exists.\n if (fieldArgument == null) {\n return;\n }\n\n return { kind: 'FieldArgument', type, field, fieldArgument };\n}\n\n/**\n * DirectiveCoordinate : @ Name\n *\n * @internal\n */\nfunction resolveDirectiveCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: DirectiveCoordinateNode,\n): ResolvedDirective | undefined {\n // 1. Let {directiveName} be the value of {Name}.\n const directiveName = schemaCoordinate.name.value;\n const directive = schema.getDirective(directiveName);\n\n // 2. Return the directive in the {schema} named {directiveName} if it exists.\n if (!directive) {\n return;\n }\n\n return { kind: 'Directive', directive };\n}\n\n/**\n * DirectiveArgumentCoordinate : @ Name ( Name : )\n *\n * @internal\n */\nfunction resolveDirectiveArgumentCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: DirectiveArgumentCoordinateNode,\n): ResolvedDirectiveArgument | undefined {\n // 1. Let {directiveName} be the value of the first {Name}.\n // 2. Let {directive} be the directive in the {schema} named {directiveName}.\n const directiveName = schemaCoordinate.name.value;\n const directive = schema.getDirective(directiveName);\n\n // 3. Assert {directive} must exist.\n if (!directive) {\n throw new Error(\n `Expected ${inspect(directiveName)} to be defined as a directive in the schema.`,\n );\n }\n\n // 4. Let {directiveArgumentName} be the value of the second {Name}.\n const {\n argumentName: { value: directiveArgumentName },\n } = schemaCoordinate;\n const directiveArgument = directive.args.find(\n (arg) => arg.name === directiveArgumentName,\n );\n\n // 5. Return the argument of {directive} named {directiveArgumentName} if it exists.\n if (!directiveArgument) {\n return;\n }\n\n return { kind: 'DirectiveArgument', directive, directiveArgument };\n}\n\n/**\n * Resolves schema coordinate from a parsed SchemaCoordinate node.\n * @param schema - GraphQL schema to use.\n * @param schemaCoordinate - The schema coordinate to resolve.\n * @returns The schema element identified by the parsed coordinate, or undefined if none exists.\n * @example\n * ```ts\n * import { parseSchemaCoordinate } from 'graphql/language';\n * import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const coordinate = parseSchemaCoordinate('Query.greeting(name:)');\n * const resolved = resolveASTSchemaCoordinate(schema, coordinate);\n *\n * resolved.kind; // => 'FieldArgument'\n * resolved.field.name; // => 'greeting'\n * resolved.fieldArgument.name; // => 'name'\n * ```\n */\nexport function resolveASTSchemaCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: SchemaCoordinateNode,\n): ResolvedSchemaElement | undefined {\n switch (schemaCoordinate.kind) {\n case Kind.TYPE_COORDINATE:\n return resolveTypeCoordinate(schema, schemaCoordinate);\n case Kind.MEMBER_COORDINATE:\n return resolveMemberCoordinate(schema, schemaCoordinate);\n case Kind.ARGUMENT_COORDINATE:\n return resolveArgumentCoordinate(schema, schemaCoordinate);\n case Kind.DIRECTIVE_COORDINATE:\n return resolveDirectiveCoordinate(schema, schemaCoordinate);\n case Kind.DIRECTIVE_ARGUMENT_COORDINATE:\n return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs new file mode 100644 index 00000000..f9106309 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs @@ -0,0 +1,107 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { parseSchemaCoordinate } from "../language/parser.mjs"; +import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, } from "../type/definition.mjs"; +export function resolveSchemaCoordinate(schema, schemaCoordinate) { + return resolveASTSchemaCoordinate(schema, parseSchemaCoordinate(schemaCoordinate)); +} +function resolveTypeCoordinate(schema, schemaCoordinate) { + const typeName = schemaCoordinate.name.value; + const type = schema.getType(typeName); + if (type == null) { + return; + } + return { kind: 'NamedType', type }; +} +function resolveMemberCoordinate(schema, schemaCoordinate) { + const typeName = schemaCoordinate.name.value; + const type = schema.getType(typeName); + if (!type) { + throw new Error(`Expected ${inspect(typeName)} to be defined as a type in the schema.`); + } + if (!isEnumType(type) && + !isInputObjectType(type) && + !isObjectType(type) && + !isInterfaceType(type)) { + throw new Error(`Expected ${inspect(typeName)} to be an Enum, Input Object, Object or Interface type.`); + } + if (isEnumType(type)) { + const enumValueName = schemaCoordinate.memberName.value; + const enumValue = type.getValue(enumValueName); + if (enumValue == null) { + return; + } + return { kind: 'EnumValue', type, enumValue }; + } + if (isInputObjectType(type)) { + const inputFieldName = schemaCoordinate.memberName.value; + const inputField = type.getFields()[inputFieldName]; + if (inputField == null) { + return; + } + return { kind: 'InputField', type, inputField }; + } + const fieldName = schemaCoordinate.memberName.value; + const field = schema.getField(type, fieldName); + if (field == null) { + return; + } + return { kind: 'Field', type, field }; +} +function resolveArgumentCoordinate(schema, schemaCoordinate) { + const typeName = schemaCoordinate.name.value; + const type = schema.getType(typeName); + if (type == null) { + throw new Error(`Expected ${inspect(typeName)} to be defined as a type in the schema.`); + } + if (!isObjectType(type) && !isInterfaceType(type)) { + throw new Error(`Expected ${inspect(typeName)} to be an object type or interface type.`); + } + const fieldName = schemaCoordinate.fieldName.value; + const field = schema.getField(type, fieldName); + if (field == null) { + throw new Error(`Expected ${inspect(fieldName)} to exist as a field of type ${inspect(typeName)} in the schema.`); + } + const fieldArgumentName = schemaCoordinate.argumentName.value; + const fieldArgument = field.args.find((arg) => arg.name === fieldArgumentName); + if (fieldArgument == null) { + return; + } + return { kind: 'FieldArgument', type, field, fieldArgument }; +} +function resolveDirectiveCoordinate(schema, schemaCoordinate) { + const directiveName = schemaCoordinate.name.value; + const directive = schema.getDirective(directiveName); + if (!directive) { + return; + } + return { kind: 'Directive', directive }; +} +function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) { + const directiveName = schemaCoordinate.name.value; + const directive = schema.getDirective(directiveName); + if (!directive) { + throw new Error(`Expected ${inspect(directiveName)} to be defined as a directive in the schema.`); + } + const { argumentName: { value: directiveArgumentName }, } = schemaCoordinate; + const directiveArgument = directive.args.find((arg) => arg.name === directiveArgumentName); + if (!directiveArgument) { + return; + } + return { kind: 'DirectiveArgument', directive, directiveArgument }; +} +export function resolveASTSchemaCoordinate(schema, schemaCoordinate) { + switch (schemaCoordinate.kind) { + case Kind.TYPE_COORDINATE: + return resolveTypeCoordinate(schema, schemaCoordinate); + case Kind.MEMBER_COORDINATE: + return resolveMemberCoordinate(schema, schemaCoordinate); + case Kind.ARGUMENT_COORDINATE: + return resolveArgumentCoordinate(schema, schemaCoordinate); + case Kind.DIRECTIVE_COORDINATE: + return resolveDirectiveCoordinate(schema, schemaCoordinate); + case Kind.DIRECTIVE_ARGUMENT_COORDINATE: + return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate); + } +} +//# sourceMappingURL=resolveSchemaCoordinate.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs.map new file mode 100644 index 00000000..d46af31f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolveSchemaCoordinate.js","sourceRoot":"","sources":["../../src/utilities/resolveSchemaCoordinate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,E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ordinates */\n\nimport { inspect } from '../jsutils/inspect.ts';\n\nimport type {\n ArgumentCoordinateNode,\n DirectiveArgumentCoordinateNode,\n DirectiveCoordinateNode,\n MemberCoordinateNode,\n SchemaCoordinateNode,\n TypeCoordinateNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { parseSchemaCoordinate } from '../language/parser.ts';\nimport type { Source } from '../language/source.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLEnumType,\n GraphQLEnumValue,\n GraphQLField,\n GraphQLInputField,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLNamedType,\n GraphQLObjectType,\n} from '../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\n/**\n * A resolved schema element may be one of the following kinds:\n *\n * @internal\n */\nexport interface ResolvedNamedType {\n readonly kind: 'NamedType';\n readonly type: GraphQLNamedType;\n}\n\n/** @internal */\nexport interface ResolvedField {\n readonly kind: 'Field';\n readonly type: GraphQLObjectType | GraphQLInterfaceType;\n readonly field: GraphQLField;\n}\n\n/** @internal */\nexport interface ResolvedInputField {\n readonly kind: 'InputField';\n readonly type: GraphQLInputObjectType;\n readonly inputField: GraphQLInputField;\n}\n\n/** @internal */\nexport interface ResolvedEnumValue {\n readonly kind: 'EnumValue';\n readonly type: GraphQLEnumType;\n readonly enumValue: GraphQLEnumValue;\n}\n\n/** @internal */\nexport interface ResolvedFieldArgument {\n readonly kind: 'FieldArgument';\n readonly type: GraphQLObjectType | GraphQLInterfaceType;\n readonly field: GraphQLField;\n readonly fieldArgument: GraphQLArgument;\n}\n\n/** @internal */\nexport interface ResolvedDirective {\n readonly kind: 'Directive';\n readonly directive: GraphQLDirective;\n}\n\n/** @internal */\nexport interface ResolvedDirectiveArgument {\n readonly kind: 'DirectiveArgument';\n readonly directive: GraphQLDirective;\n readonly directiveArgument: GraphQLArgument;\n}\n\n/** A schema element resolved from a schema coordinate. */\nexport type ResolvedSchemaElement =\n | ResolvedNamedType\n | ResolvedField\n | ResolvedInputField\n | ResolvedEnumValue\n | ResolvedFieldArgument\n | ResolvedDirective\n | ResolvedDirectiveArgument;\n\n/**\n * A schema coordinate is resolved in the context of a GraphQL schema to\n * uniquely identify a schema element. It returns undefined if the schema\n * coordinate does not resolve to a schema element, meta-field, or introspection\n * schema element. It will throw if the containing schema element (if\n * applicable) does not exist.\n *\n * https://spec.graphql.org/draft/#sec-Schema-Coordinates.Semantics\n * @param schema - GraphQL schema to use.\n * @param schemaCoordinate - The schema coordinate to resolve.\n * @returns The schema element identified by the coordinate, or undefined if none exists.\n * @example\n * ```ts\n * import { buildSchema, resolveSchemaCoordinate } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * directive @tag(name: String!) on FIELD_DEFINITION\n *\n * input ReviewInput {\n * stars: Int!\n * }\n *\n * enum Episode {\n * NEW_HOPE\n * }\n *\n * type Query {\n * reviews(input: ReviewInput): [String] @tag(name: \"reviews\")\n * }\n * `);\n *\n * resolveSchemaCoordinate(schema, 'Query').kind; // => 'NamedType'\n * resolveSchemaCoordinate(schema, 'Query.reviews').kind; // => 'Field'\n * resolveSchemaCoordinate(schema, 'Query.reviews(input:)').kind; // => 'FieldArgument'\n * resolveSchemaCoordinate(schema, 'ReviewInput.stars').kind; // => 'InputField'\n * resolveSchemaCoordinate(schema, 'Episode.NEW_HOPE').kind; // => 'EnumValue'\n * resolveSchemaCoordinate(schema, '@tag').kind; // => 'Directive'\n * resolveSchemaCoordinate(schema, '@tag(name:)').kind; // => 'DirectiveArgument'\n * resolveSchemaCoordinate(schema, 'Query.missing'); // => undefined\n * ```\n */\nexport function resolveSchemaCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: string | Source,\n): ResolvedSchemaElement | undefined {\n return resolveASTSchemaCoordinate(\n schema,\n parseSchemaCoordinate(schemaCoordinate),\n );\n}\n\n/**\n * TypeCoordinate : Name\n *\n * @internal\n */\nfunction resolveTypeCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: TypeCoordinateNode,\n): ResolvedNamedType | undefined {\n // 1. Let {typeName} be the value of {Name}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName);\n\n // 2. Return the type in the {schema} named {typeName} if it exists.\n if (type == null) {\n return;\n }\n\n return { kind: 'NamedType', type };\n}\n\n/**\n * MemberCoordinate : Name . Name\n *\n * @internal\n */\nfunction resolveMemberCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: MemberCoordinateNode,\n): ResolvedField | ResolvedInputField | ResolvedEnumValue | undefined {\n // 1. Let {typeName} be the value of the first {Name}.\n // 2. Let {type} be the type in the {schema} named {typeName}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName);\n\n // 3. Assert: {type} must exist, and must be an Enum, Input Object, Object or Interface type.\n if (!type) {\n throw new Error(\n `Expected ${inspect(typeName)} to be defined as a type in the schema.`,\n );\n }\n if (\n !isEnumType(type) &&\n !isInputObjectType(type) &&\n !isObjectType(type) &&\n !isInterfaceType(type)\n ) {\n throw new Error(\n `Expected ${inspect(typeName)} to be an Enum, Input Object, Object or Interface type.`,\n );\n }\n\n // 4. If {type} is an Enum type:\n if (isEnumType(type)) {\n // 1. Let {enumValueName} be the value of the second {Name}.\n const enumValueName = schemaCoordinate.memberName.value;\n const enumValue = type.getValue(enumValueName);\n\n // 2. Return the enum value of {type} named {enumValueName} if it exists.\n if (enumValue == null) {\n return;\n }\n\n return { kind: 'EnumValue', type, enumValue };\n }\n\n // 5. Otherwise, if {type} is an Input Object type:\n if (isInputObjectType(type)) {\n // 1. Let {inputFieldName} be the value of the second {Name}.\n const inputFieldName = schemaCoordinate.memberName.value;\n const inputField = type.getFields()[inputFieldName];\n\n // 2. Return the input field of {type} named {inputFieldName} if it exists.\n if (inputField == null) {\n return;\n }\n\n return { kind: 'InputField', type, inputField };\n }\n\n // 6. Otherwise:\n // 1. Let {fieldName} be the value of the second {Name}.\n const fieldName = schemaCoordinate.memberName.value;\n const field = schema.getField(type, fieldName);\n\n // 2. Return the field of {type} named {fieldName} if it exists.\n if (field == null) {\n return;\n }\n\n return { kind: 'Field', type, field };\n}\n\n/**\n * ArgumentCoordinate : Name . Name ( Name : )\n *\n * @internal\n */\nfunction resolveArgumentCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: ArgumentCoordinateNode,\n): ResolvedFieldArgument | undefined {\n // 1. Let {typeName} be the value of the first {Name}.\n // 2. Let {type} be the type in the {schema} named {typeName}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName);\n\n // 3. Assert: {type} must exist, and be an Object or Interface type.\n if (type == null) {\n throw new Error(\n `Expected ${inspect(typeName)} to be defined as a type in the schema.`,\n );\n }\n if (!isObjectType(type) && !isInterfaceType(type)) {\n throw new Error(\n `Expected ${inspect(typeName)} to be an object type or interface type.`,\n );\n }\n\n // 4. Let {fieldName} be the value of the second {Name}.\n // 5. Let {field} be the field of {type} named {fieldName}.\n const fieldName = schemaCoordinate.fieldName.value;\n const field = schema.getField(type, fieldName);\n\n // 7. Assert: {field} must exist.\n if (field == null) {\n throw new Error(\n `Expected ${inspect(fieldName)} to exist as a field of type ${inspect(typeName)} in the schema.`,\n );\n }\n\n // 7. Let {fieldArgumentName} be the value of the third {Name}.\n const fieldArgumentName = schemaCoordinate.argumentName.value;\n const fieldArgument = field.args.find(\n (arg) => arg.name === fieldArgumentName,\n );\n\n // 8. Return the argument of {field} named {fieldArgumentName} if it exists.\n if (fieldArgument == null) {\n return;\n }\n\n return { kind: 'FieldArgument', type, field, fieldArgument };\n}\n\n/**\n * DirectiveCoordinate : @ Name\n *\n * @internal\n */\nfunction resolveDirectiveCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: DirectiveCoordinateNode,\n): ResolvedDirective | undefined {\n // 1. Let {directiveName} be the value of {Name}.\n const directiveName = schemaCoordinate.name.value;\n const directive = schema.getDirective(directiveName);\n\n // 2. Return the directive in the {schema} named {directiveName} if it exists.\n if (!directive) {\n return;\n }\n\n return { kind: 'Directive', directive };\n}\n\n/**\n * DirectiveArgumentCoordinate : @ Name ( Name : )\n *\n * @internal\n */\nfunction resolveDirectiveArgumentCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: DirectiveArgumentCoordinateNode,\n): ResolvedDirectiveArgument | undefined {\n // 1. Let {directiveName} be the value of the first {Name}.\n // 2. Let {directive} be the directive in the {schema} named {directiveName}.\n const directiveName = schemaCoordinate.name.value;\n const directive = schema.getDirective(directiveName);\n\n // 3. Assert {directive} must exist.\n if (!directive) {\n throw new Error(\n `Expected ${inspect(directiveName)} to be defined as a directive in the schema.`,\n );\n }\n\n // 4. Let {directiveArgumentName} be the value of the second {Name}.\n const {\n argumentName: { value: directiveArgumentName },\n } = schemaCoordinate;\n const directiveArgument = directive.args.find(\n (arg) => arg.name === directiveArgumentName,\n );\n\n // 5. Return the argument of {directive} named {directiveArgumentName} if it exists.\n if (!directiveArgument) {\n return;\n }\n\n return { kind: 'DirectiveArgument', directive, directiveArgument };\n}\n\n/**\n * Resolves schema coordinate from a parsed SchemaCoordinate node.\n * @param schema - GraphQL schema to use.\n * @param schemaCoordinate - The schema coordinate to resolve.\n * @returns The schema element identified by the parsed coordinate, or undefined if none exists.\n * @example\n * ```ts\n * import { parseSchemaCoordinate } from 'graphql/language';\n * import { buildSchema, resolveASTSchemaCoordinate } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const coordinate = parseSchemaCoordinate('Query.greeting(name:)');\n * const resolved = resolveASTSchemaCoordinate(schema, coordinate);\n *\n * resolved.kind; // => 'FieldArgument'\n * resolved.field.name; // => 'greeting'\n * resolved.fieldArgument.name; // => 'name'\n * ```\n */\nexport function resolveASTSchemaCoordinate(\n schema: GraphQLSchema,\n schemaCoordinate: SchemaCoordinateNode,\n): ResolvedSchemaElement | undefined {\n switch (schemaCoordinate.kind) {\n case Kind.TYPE_COORDINATE:\n return resolveTypeCoordinate(schema, schemaCoordinate);\n case Kind.MEMBER_COORDINATE:\n return resolveMemberCoordinate(schema, schemaCoordinate);\n case Kind.ARGUMENT_COORDINATE:\n return resolveArgumentCoordinate(schema, schemaCoordinate);\n case Kind.DIRECTIVE_COORDINATE:\n return resolveDirectiveCoordinate(schema, schemaCoordinate);\n case Kind.DIRECTIVE_ARGUMENT_COORDINATE:\n return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.mts new file mode 100644 index 00000000..fb68a8f1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.mts @@ -0,0 +1,39 @@ +/** @category AST Utilities */ +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { DocumentNode } from "../language/ast.mjs"; +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + * @param documentAST - The parsed GraphQL document AST. + * @returns A map of operation names to documents containing each operation and its referenced fragments. + * @example + * ```ts + * import { parse, print } from 'graphql/language'; + * import { separateOperations } from 'graphql/utilities'; + * + * const document = parse(` + * query GetUser { + * viewer { + * ...UserFields + * } + * } + * + * query GetStatus { + * status + * } + * + * fragment UserFields on User { + * id + * } + * `); + * + * const separated = separateOperations(document); + * + * Object.keys(separated); // => ['GetUser', 'GetStatus'] + * print(separated.GetUser); // matches /fragment UserFields/ + * print(separated.GetStatus); // does not match /fragment UserFields/ + * ``` + */ +export declare function separateOperations(documentAST: DocumentNode): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.ts new file mode 100644 index 00000000..38792c6e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.d.ts @@ -0,0 +1,39 @@ +/** @category AST Utilities */ +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { DocumentNode } from "../language/ast.js"; +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + * @param documentAST - The parsed GraphQL document AST. + * @returns A map of operation names to documents containing each operation and its referenced fragments. + * @example + * ```ts + * import { parse, print } from 'graphql/language'; + * import { separateOperations } from 'graphql/utilities'; + * + * const document = parse(` + * query GetUser { + * viewer { + * ...UserFields + * } + * } + * + * query GetStatus { + * status + * } + * + * fragment UserFields on User { + * id + * } + * `); + * + * const separated = separateOperations(document); + * + * Object.keys(separated); // => ['GetUser', 'GetStatus'] + * print(separated.GetUser); // matches /fragment UserFields/ + * print(separated.GetStatus); // does not match /fragment UserFields/ + * ``` + */ +export declare function separateOperations(documentAST: DocumentNode): ObjMap; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js new file mode 100644 index 00000000..a32c3277 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.separateOperations = separateOperations; +const kinds_ts_1 = require("../language/kinds.js"); +const visitor_ts_1 = require("../language/visitor.js"); +function separateOperations(documentAST) { + const operations = []; + const depGraph = Object.create(null); + for (const definitionNode of documentAST.definitions) { + switch (definitionNode.kind) { + case kinds_ts_1.Kind.OPERATION_DEFINITION: + operations.push(definitionNode); + break; + case kinds_ts_1.Kind.FRAGMENT_DEFINITION: + depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet); + break; + default: + } + } + const separatedDocumentASTs = Object.create(null); + for (const operation of operations) { + const dependencies = new Set(); + for (const fragmentName of collectDependencies(operation.selectionSet)) { + collectTransitiveDependencies(dependencies, depGraph, fragmentName); + } + const operationName = operation.name ? operation.name.value : ''; + separatedDocumentASTs[operationName] = { + kind: kinds_ts_1.Kind.DOCUMENT, + definitions: documentAST.definitions.filter((node) => node === operation || + (node.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION && + dependencies.has(node.name.value))), + }; + } + return separatedDocumentASTs; +} +function collectTransitiveDependencies(collected, depGraph, fromName) { + if (!collected.has(fromName)) { + collected.add(fromName); + const immediateDeps = depGraph[fromName]; + if (immediateDeps !== undefined) { + for (const toName of immediateDeps) { + collectTransitiveDependencies(collected, depGraph, toName); + } + } + } +} +function collectDependencies(selectionSet) { + const dependencies = []; + (0, visitor_ts_1.visit)(selectionSet, { + FragmentSpread(node) { + dependencies.push(node.name.value); + }, + }); + return dependencies; +} +//# sourceMappingURL=separateOperations.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js.map new file mode 100644 index 00000000..ab00b4e2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"separateOperations.js","sourceRoot":"","sources":["../../src/utilities/separateOperations.ts"],"names":[],"mappings":";;AA+CA,gDAiDC;AAvFD,mDAA4C;AAC5C,uDAA+C;AAqC/C,SAAgB,kBAAkB,CAChC,WAAyB;IAEzB,MAAM,UAAU,GAAmC,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAG/C,KAAK,MAAM,cAAc,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC;QACrD,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,eA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AC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAExB,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;gBACnC,6BAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,YAA8B;IACzD,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,IAAA,kBAAK,EAAC,YAAY,EAAE;QAClB,cAAc,CAAC,IAAI;YACjB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;KACF,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/** @category AST Utilities */\n\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { visit } from '../language/visitor.ts';\n\n/**\n * separateOperations accepts a single AST document which may contain many\n * operations and fragments and returns a collection of AST documents each of\n * which contains a single operation as well the fragment definitions it\n * refers to.\n * @param documentAST - The parsed GraphQL document AST.\n * @returns A map of operation names to documents containing each operation and its referenced fragments.\n * @example\n * ```ts\n * import { parse, print } from 'graphql/language';\n * import { separateOperations } from 'graphql/utilities';\n *\n * const document = parse(`\n * query GetUser {\n * viewer {\n * ...UserFields\n * }\n * }\n *\n * query GetStatus {\n * status\n * }\n *\n * fragment UserFields on User {\n * id\n * }\n * `);\n *\n * const separated = separateOperations(document);\n *\n * Object.keys(separated); // => ['GetUser', 'GetStatus']\n * print(separated.GetUser); // matches /fragment UserFields/\n * print(separated.GetStatus); // does not match /fragment UserFields/\n * ```\n */\nexport function separateOperations(\n documentAST: DocumentNode,\n): ObjMap {\n const operations: Array = [];\n const depGraph: DepGraph = Object.create(null);\n\n // Populate metadata and build a dependency graph.\n for (const definitionNode of documentAST.definitions) {\n switch (definitionNode.kind) {\n case Kind.OPERATION_DEFINITION:\n operations.push(definitionNode);\n break;\n case Kind.FRAGMENT_DEFINITION:\n depGraph[definitionNode.name.value] = collectDependencies(\n definitionNode.selectionSet,\n );\n break;\n default:\n // ignore non-executable definitions\n }\n }\n\n // For each operation, produce a new synthesized AST which includes only what\n // is necessary for completing that operation.\n const separatedDocumentASTs = Object.create(null);\n for (const operation of operations) {\n const dependencies = new Set();\n\n for (const fragmentName of collectDependencies(operation.selectionSet)) {\n collectTransitiveDependencies(dependencies, depGraph, fragmentName);\n }\n\n // Provides the empty string for anonymous operations.\n const operationName = operation.name ? operation.name.value : '';\n\n // The list of definition nodes to be included for this operation, sorted\n // to retain the same order as the original document.\n separatedDocumentASTs[operationName] = {\n kind: Kind.DOCUMENT,\n definitions: documentAST.definitions.filter(\n (node) =>\n node === operation ||\n (node.kind === Kind.FRAGMENT_DEFINITION &&\n dependencies.has(node.name.value)),\n ),\n };\n }\n\n return separatedDocumentASTs;\n}\n\ntype DepGraph = ObjMap>;\n\n// From a dependency graph, collects a list of transitive dependencies by\n// recursing through a dependency graph.\nfunction collectTransitiveDependencies(\n collected: Set,\n depGraph: DepGraph,\n fromName: string,\n): void {\n if (!collected.has(fromName)) {\n collected.add(fromName);\n\n const immediateDeps = depGraph[fromName];\n if (immediateDeps !== undefined) {\n for (const toName of immediateDeps) {\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}\n\nfunction collectDependencies(selectionSet: SelectionSetNode): Array {\n const dependencies: Array = [];\n\n visit(selectionSet, {\n FragmentSpread(node) {\n dependencies.push(node.name.value);\n },\n });\n return dependencies;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs new file mode 100644 index 00000000..0fe42a02 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs @@ -0,0 +1,53 @@ +import { Kind } from "../language/kinds.mjs"; +import { visit } from "../language/visitor.mjs"; +export function separateOperations(documentAST) { + const operations = []; + const depGraph = Object.create(null); + for (const definitionNode of documentAST.definitions) { + switch (definitionNode.kind) { + case Kind.OPERATION_DEFINITION: + operations.push(definitionNode); + break; + case Kind.FRAGMENT_DEFINITION: + depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet); + break; + default: + } + } + const separatedDocumentASTs = Object.create(null); + for (const operation of operations) { + const dependencies = new Set(); + for (const fragmentName of collectDependencies(operation.selectionSet)) { + collectTransitiveDependencies(dependencies, depGraph, fragmentName); + } + const operationName = operation.name ? operation.name.value : ''; + separatedDocumentASTs[operationName] = { + kind: Kind.DOCUMENT, + definitions: documentAST.definitions.filter((node) => node === operation || + (node.kind === Kind.FRAGMENT_DEFINITION && + dependencies.has(node.name.value))), + }; + } + return separatedDocumentASTs; +} +function collectTransitiveDependencies(collected, depGraph, fromName) { + if (!collected.has(fromName)) { + collected.add(fromName); + const immediateDeps = depGraph[fromName]; + if (immediateDeps !== undefined) { + for (const toName of immediateDeps) { + collectTransitiveDependencies(collected, depGraph, toName); + } + } + } +} +function collectDependencies(selectionSet) { + const dependencies = []; + visit(selectionSet, { + FragmentSpread(node) { + dependencies.push(node.name.value); + }, + }); + return dependencies; +} +//# sourceMappingURL=separateOperations.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs.map new file mode 100644 index 00000000..91d24965 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/separateOperations.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"separateOperations.js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,CACzC,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,KAAK,SAAS;gBAClB,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,mBAAmB;oBACrC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CACvC;SACF,CAAC;IACJ,CAAC;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAMD,SAAS,6BAA6B,CACpC,SAAsB,EACtB,QAAkB,EAClB,QAAgB;IAEhB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAExB,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;gBACnC,6BAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,YAA8B;IACzD,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,KAAK,CAAC,YAAY,EAAE;QAClB,cAAc,CAAC,IAAI;YACjB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;KACF,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/** @category AST Utilities */\n\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { visit } from '../language/visitor.ts';\n\n/**\n * separateOperations accepts a single AST document which may contain many\n * operations and fragments and returns a collection of AST documents each of\n * which contains a single operation as well the fragment definitions it\n * refers to.\n * @param documentAST - The parsed GraphQL document AST.\n * @returns A map of operation names to documents containing each operation and its referenced fragments.\n * @example\n * ```ts\n * import { parse, print } from 'graphql/language';\n * import { separateOperations } from 'graphql/utilities';\n *\n * const document = parse(`\n * query GetUser {\n * viewer {\n * ...UserFields\n * }\n * }\n *\n * query GetStatus {\n * status\n * }\n *\n * fragment UserFields on User {\n * id\n * }\n * `);\n *\n * const separated = separateOperations(document);\n *\n * Object.keys(separated); // => ['GetUser', 'GetStatus']\n * print(separated.GetUser); // matches /fragment UserFields/\n * print(separated.GetStatus); // does not match /fragment UserFields/\n * ```\n */\nexport function separateOperations(\n documentAST: DocumentNode,\n): ObjMap {\n const operations: Array = [];\n const depGraph: DepGraph = Object.create(null);\n\n // Populate metadata and build a dependency graph.\n for (const definitionNode of documentAST.definitions) {\n switch (definitionNode.kind) {\n case Kind.OPERATION_DEFINITION:\n operations.push(definitionNode);\n break;\n case Kind.FRAGMENT_DEFINITION:\n depGraph[definitionNode.name.value] = collectDependencies(\n definitionNode.selectionSet,\n );\n break;\n default:\n // ignore non-executable definitions\n }\n }\n\n // For each operation, produce a new synthesized AST which includes only what\n // is necessary for completing that operation.\n const separatedDocumentASTs = Object.create(null);\n for (const operation of operations) {\n const dependencies = new Set();\n\n for (const fragmentName of collectDependencies(operation.selectionSet)) {\n collectTransitiveDependencies(dependencies, depGraph, fragmentName);\n }\n\n // Provides the empty string for anonymous operations.\n const operationName = operation.name ? operation.name.value : '';\n\n // The list of definition nodes to be included for this operation, sorted\n // to retain the same order as the original document.\n separatedDocumentASTs[operationName] = {\n kind: Kind.DOCUMENT,\n definitions: documentAST.definitions.filter(\n (node) =>\n node === operation ||\n (node.kind === Kind.FRAGMENT_DEFINITION &&\n dependencies.has(node.name.value)),\n ),\n };\n }\n\n return separatedDocumentASTs;\n}\n\ntype DepGraph = ObjMap>;\n\n// From a dependency graph, collects a list of transitive dependencies by\n// recursing through a dependency graph.\nfunction collectTransitiveDependencies(\n collected: Set,\n depGraph: DepGraph,\n fromName: string,\n): void {\n if (!collected.has(fromName)) {\n collected.add(fromName);\n\n const immediateDeps = depGraph[fromName];\n if (immediateDeps !== undefined) {\n for (const toName of immediateDeps) {\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}\n\nfunction collectDependencies(selectionSet: SelectionSetNode): Array {\n const dependencies: Array = [];\n\n visit(selectionSet, {\n FragmentSpread(node) {\n dependencies.push(node.name.value);\n },\n });\n return dependencies;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.mts new file mode 100644 index 00000000..ff6b11a8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.mts @@ -0,0 +1,9 @@ +import type { ValueNode } from "../language/ast.mjs"; +/** + * Sort ValueNode. + * + * This function returns a sorted copy of the given ValueNode. + * + * @internal + */ +export declare function sortValueNode(valueNode: ValueNode): ValueNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.ts new file mode 100644 index 00000000..40957f92 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.d.ts @@ -0,0 +1,9 @@ +import type { ValueNode } from "../language/ast.js"; +/** + * Sort ValueNode. + * + * This function returns a sorted copy of the given ValueNode. + * + * @internal + */ +export declare function sortValueNode(valueNode: ValueNode): ValueNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js new file mode 100644 index 00000000..424f997a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sortValueNode = sortValueNode; +const naturalCompare_ts_1 = require("../jsutils/naturalCompare.js"); +const kinds_ts_1 = require("../language/kinds.js"); +function sortValueNode(valueNode) { + switch (valueNode.kind) { + case kinds_ts_1.Kind.OBJECT: + return { + ...valueNode, + fields: sortFields(valueNode.fields), + }; + case kinds_ts_1.Kind.LIST: + return { + ...valueNode, + values: valueNode.values.map(sortValueNode), + }; + case kinds_ts_1.Kind.INT: + case kinds_ts_1.Kind.FLOAT: + case kinds_ts_1.Kind.STRING: + case kinds_ts_1.Kind.BOOLEAN: + case kinds_ts_1.Kind.NULL: + case kinds_ts_1.Kind.ENUM: + case kinds_ts_1.Kind.VARIABLE: + return valueNode; + } +} +function sortFields(fields) { + return fields + .map((fieldNode) => ({ + ...fieldNode, + value: sortValueNode(fieldNode.value), + })) + .sort((fieldA, fieldB) => (0, naturalCompare_ts_1.naturalCompare)(fieldA.name.value, fieldB.name.value)); +} +//# sourceMappingURL=sortValueNode.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js.map new file mode 100644 index 00000000..b43b83dc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sortValueNode.js","sourceRoot":"","sources":["../../src/utilities/sortValueNode.ts"],"names":[],"mappings":";;AAYA,sCAqBC;AAjCD,oEAA8D;AAG9D,mDAA4C;AAS5C,SAAgB,aAAa,CAAC,SAAoB;IAChD,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,eAAI,CAAC,MAAM;YACd,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC;aACrC,CAAC;QACJ,KAAK,eAAI,CAAC,IAAI;YACZ,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;aAC5C,CAAC;QACJ,KAAK,eAAI,CAAC,GAAG,CAAC;QACd,KAAK,eAAI,CAAC,KAAK,CAAC;QAChB,KAAK,eAAI,CAAC,MAAM,CAAC;QACjB,KAAK,eAAI,CAAC,OAAO,CAAC;QAClB,KAAK,eAAI,CAAC,IAAI,CAAC;QACf,KAAK,eAAI,CAAC,IAAI,CAAC;QACf,KAAK,eAAI,CAAC,QAAQ;YAChB,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CACjB,MAAsC;IAEtC,OAAO,MAAM;SACV,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACnB,GAAG,SAAS;QACZ,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC;KACtC,CAAC,CAAC;SACF,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CACvB,IAAA,kCAAc,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CACrD,CAAC;AACN,CAAC","sourcesContent":["import { naturalCompare } from '../jsutils/naturalCompare.ts';\n\nimport type { ObjectFieldNode, ValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Sort ValueNode.\n *\n * This function returns a sorted copy of the given ValueNode.\n *\n * @internal\n */\nexport function sortValueNode(valueNode: ValueNode): ValueNode {\n switch (valueNode.kind) {\n case Kind.OBJECT:\n return {\n ...valueNode,\n fields: sortFields(valueNode.fields),\n };\n case Kind.LIST:\n return {\n ...valueNode,\n values: valueNode.values.map(sortValueNode),\n };\n case Kind.INT:\n case Kind.FLOAT:\n case Kind.STRING:\n case Kind.BOOLEAN:\n case Kind.NULL:\n case Kind.ENUM:\n case Kind.VARIABLE:\n return valueNode;\n }\n}\n\nfunction sortFields(\n fields: ReadonlyArray,\n): Array {\n return fields\n .map((fieldNode) => ({\n ...fieldNode,\n value: sortValueNode(fieldNode.value),\n }))\n .sort((fieldA, fieldB) =>\n naturalCompare(fieldA.name.value, fieldB.name.value),\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs new file mode 100644 index 00000000..a33bca68 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs @@ -0,0 +1,33 @@ +import { naturalCompare } from "../jsutils/naturalCompare.mjs"; +import { Kind } from "../language/kinds.mjs"; +export function sortValueNode(valueNode) { + switch (valueNode.kind) { + case Kind.OBJECT: + return { + ...valueNode, + fields: sortFields(valueNode.fields), + }; + case Kind.LIST: + return { + ...valueNode, + values: valueNode.values.map(sortValueNode), + }; + case Kind.INT: + case Kind.FLOAT: + case Kind.STRING: + case Kind.BOOLEAN: + case Kind.NULL: + case Kind.ENUM: + case Kind.VARIABLE: + return valueNode; + } +} +function sortFields(fields) { + return fields + .map((fieldNode) => ({ + ...fieldNode, + value: sortValueNode(fieldNode.value), + })) + .sort((fieldA, fieldB) => naturalCompare(fieldA.name.value, fieldB.name.value)); +} +//# sourceMappingURL=sortValueNode.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs.map new file mode 100644 index 00000000..d919d39a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/sortValueNode.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sortValueNode.js","sourceRoot":"","sources":["../../src/utilities/sortValueNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAG9D,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAS5C,MAAM,UAAU,aAAa,CAAC,SAAoB;IAChD,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,IAAI,CAAC,MAAM;YACd,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC;aACrC,CAAC;QACJ,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO;gBACL,GAAG,SAAS;gBACZ,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;aAC5C,CAAC;QACJ,KAAK,IAAI,CAAC,GAAG,CAAC;QACd,KAAK,IAAI,CAAC,KAAK,CAAC;QAChB,KAAK,IAAI,CAAC,MAAM,CAAC;QACjB,KAAK,IAAI,CAAC,OAAO,CAAC;QAClB,KAAK,IAAI,CAAC,IAAI,CAAC;QACf,KAAK,IAAI,CAAC,IAAI,CAAC;QACf,KAAK,IAAI,CAAC,QAAQ;YAChB,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CACjB,MAAsC;IAEtC,OAAO,MAAM;SACV,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACnB,GAAG,SAAS;QACZ,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC;KACtC,CAAC,CAAC;SACF,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CACvB,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CACrD,CAAC;AACN,CAAC","sourcesContent":["import { naturalCompare } from '../jsutils/naturalCompare.ts';\n\nimport type { ObjectFieldNode, ValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Sort ValueNode.\n *\n * This function returns a sorted copy of the given ValueNode.\n *\n * @internal\n */\nexport function sortValueNode(valueNode: ValueNode): ValueNode {\n switch (valueNode.kind) {\n case Kind.OBJECT:\n return {\n ...valueNode,\n fields: sortFields(valueNode.fields),\n };\n case Kind.LIST:\n return {\n ...valueNode,\n values: valueNode.values.map(sortValueNode),\n };\n case Kind.INT:\n case Kind.FLOAT:\n case Kind.STRING:\n case Kind.BOOLEAN:\n case Kind.NULL:\n case Kind.ENUM:\n case Kind.VARIABLE:\n return valueNode;\n }\n}\n\nfunction sortFields(\n fields: ReadonlyArray,\n): Array {\n return fields\n .map((fieldNode) => ({\n ...fieldNode,\n value: sortValueNode(fieldNode.value),\n }))\n .sort((fieldA, fieldB) =>\n naturalCompare(fieldA.name.value, fieldB.name.value),\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.mts new file mode 100644 index 00000000..93eda824 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.mts @@ -0,0 +1,69 @@ +/** @category AST Utilities */ +import { Source } from "../language/source.mjs"; +/** + * Strips characters that are not significant to the validity or execution + * of a GraphQL document: + * - UnicodeBOM + * - WhiteSpace + * - LineTerminator + * - Comment + * - Comma + * - BlockString indentation + * + * Note: It is required to have a delimiter character between neighboring + * non-punctuator tokens and this function always uses single space as delimiter. + * + * It is guaranteed that both input and output documents if parsed would result + * in the exact same AST except for nodes location. + * + * Warning: It is guaranteed that this function will always produce stable results. + * However, it's not guaranteed that it will stay the same between different + * releases due to bugfixes or changes in the GraphQL specification. + * @param source - The GraphQL source text or source object. + * @returns A semantically equivalent GraphQL source string without ignored characters. + * @example Query source + * ```graphql + * query SomeQuery($foo: String!, $bar: String) { + * someField(foo: $foo, bar: $bar) { + * a + * b { + * c + * d + * } + * } + * } + * ``` + * + * Becomes: + * + * ```graphql prettier-ignore + * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} + * ``` + * @example SDL source + * ```graphql + * """ + * Type description + * """ + * type Foo { + * """ + * Field description + * """ + * bar: String + * } + * ``` + * + * Becomes: + * + * ```graphql prettier-ignore + * """Type description""" type Foo{"""Field description""" bar:String} + * ``` + * @example + * ```ts + * import { stripIgnoredCharacters } from 'graphql/utilities'; + * + * const source = stripIgnoredCharacters('query Example { name }'); + * + * source; // => 'query Example{name}' + * ``` + */ +export declare function stripIgnoredCharacters(source: string | Source): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts new file mode 100644 index 00000000..ae60a408 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts @@ -0,0 +1,69 @@ +/** @category AST Utilities */ +import { Source } from "../language/source.js"; +/** + * Strips characters that are not significant to the validity or execution + * of a GraphQL document: + * - UnicodeBOM + * - WhiteSpace + * - LineTerminator + * - Comment + * - Comma + * - BlockString indentation + * + * Note: It is required to have a delimiter character between neighboring + * non-punctuator tokens and this function always uses single space as delimiter. + * + * It is guaranteed that both input and output documents if parsed would result + * in the exact same AST except for nodes location. + * + * Warning: It is guaranteed that this function will always produce stable results. + * However, it's not guaranteed that it will stay the same between different + * releases due to bugfixes or changes in the GraphQL specification. + * @param source - The GraphQL source text or source object. + * @returns A semantically equivalent GraphQL source string without ignored characters. + * @example Query source + * ```graphql + * query SomeQuery($foo: String!, $bar: String) { + * someField(foo: $foo, bar: $bar) { + * a + * b { + * c + * d + * } + * } + * } + * ``` + * + * Becomes: + * + * ```graphql prettier-ignore + * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} + * ``` + * @example SDL source + * ```graphql + * """ + * Type description + * """ + * type Foo { + * """ + * Field description + * """ + * bar: String + * } + * ``` + * + * Becomes: + * + * ```graphql prettier-ignore + * """Type description""" type Foo{"""Field description""" bar:String} + * ``` + * @example + * ```ts + * import { stripIgnoredCharacters } from 'graphql/utilities'; + * + * const source = stripIgnoredCharacters('query Example { name }'); + * + * source; // => 'query Example{name}' + * ``` + */ +export declare function stripIgnoredCharacters(source: string | Source): string; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js new file mode 100644 index 00000000..31252f99 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stripIgnoredCharacters = stripIgnoredCharacters; +const blockString_ts_1 = require("../language/blockString.js"); +const lexer_ts_1 = require("../language/lexer.js"); +const source_ts_1 = require("../language/source.js"); +const tokenKind_ts_1 = require("../language/tokenKind.js"); +function stripIgnoredCharacters(source) { + const sourceObj = (0, source_ts_1.isSource)(source) ? source : new source_ts_1.Source(source); + const body = sourceObj.body; + const lexer = new lexer_ts_1.Lexer(sourceObj); + let strippedBody = ''; + let wasLastAddedTokenNonPunctuator = false; + while (lexer.advance().kind !== tokenKind_ts_1.TokenKind.EOF) { + const currentToken = lexer.token; + const tokenKind = currentToken.kind; + const isNonPunctuator = !(0, lexer_ts_1.isPunctuatorTokenKind)(currentToken.kind); + if (wasLastAddedTokenNonPunctuator) { + if (isNonPunctuator || currentToken.kind === tokenKind_ts_1.TokenKind.SPREAD) { + strippedBody += ' '; + } + } + const tokenBody = body.slice(currentToken.start, currentToken.end); + if (tokenKind === tokenKind_ts_1.TokenKind.BLOCK_STRING) { + strippedBody += (0, blockString_ts_1.printBlockString)(currentToken.value, { minimize: true }); + } + else { + strippedBody += tokenBody; + } + wasLastAddedTokenNonPunctuator = isNonPunctuator; + } + return strippedBody; +} +//# sourceMappingURL=stripIgnoredCharacters.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js.map new file mode 100644 index 00000000..88716c27 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stripIgnoredCharacters.js","sourceRoot":"","sources":["../../src/utilities/stripIgnoredCharacters.ts"],"names":[],"mappings":";;AAyEA,wDAqCC;AA5GD,+DAA8D;AAC9D,mDAAoE;AACpE,qDAAyD;AACzD,2DAAqD;AAoErD,SAAgB,sBAAsB,CAAC,MAAuB;IAC5D,MAAM,SAAS,GAAG,IAAA,oBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,kBAAM,CAAC,MAAM,CAAC,CAAC;IAEjE,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,gBAAK,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,YAAY,GAAG,EAAE,CAAC;IAEtB,IAAI,8BAA8B,GAAG,KAAK,CAAC;IAC3C,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK,wBAAS,CAAC,GAAG,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;QACjC,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC;QASpC,MAAM,eAAe,GAAG,CAAC,IAAA,gCAAqB,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAClE,IAAI,8BAA8B,EAAE,CAAC;YACnC,IAAI,eAAe,IAAI,YAAY,CAAC,IAAI,KAAK,wBAAS,CAAC,MAAM,EAAE,CAAC;gBAC9D,YAAY,IAAI,GAAG,CAAC;YACtB,CAAC;QACH,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,wBAAS,CAAC,YAAY,EAAE,CAAC;YACzC,YAAY,IAAI,IAAA,iCAAgB,EAAC,YAAY,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3E,CAAC;aAAM,CAAC;YACN,YAAY,IAAI,SAAS,CAAC;QAC5B,CAAC;QAED,8BAA8B,GAAG,eAAe,CAAC;IACnD,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/** @category AST Utilities */\n\nimport { printBlockString } from '../language/blockString.ts';\nimport { isPunctuatorTokenKind, Lexer } from '../language/lexer.ts';\nimport { isSource, Source } from '../language/source.ts';\nimport { TokenKind } from '../language/tokenKind.ts';\n\n/**\n * Strips characters that are not significant to the validity or execution\n * of a GraphQL document:\n * - UnicodeBOM\n * - WhiteSpace\n * - LineTerminator\n * - Comment\n * - Comma\n * - BlockString indentation\n *\n * Note: It is required to have a delimiter character between neighboring\n * non-punctuator tokens and this function always uses single space as delimiter.\n *\n * It is guaranteed that both input and output documents if parsed would result\n * in the exact same AST except for nodes location.\n *\n * Warning: It is guaranteed that this function will always produce stable results.\n * However, it's not guaranteed that it will stay the same between different\n * releases due to bugfixes or changes in the GraphQL specification.\n * @param source - The GraphQL source text or source object.\n * @returns A semantically equivalent GraphQL source string without ignored characters.\n * @example Query source\n * ```graphql\n * query SomeQuery($foo: String!, $bar: String) {\n * someField(foo: $foo, bar: $bar) {\n * a\n * b {\n * c\n * d\n * }\n * }\n * }\n * ```\n *\n * Becomes:\n *\n * ```graphql prettier-ignore\n * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}\n * ```\n * @example SDL source\n * ```graphql\n * \"\"\"\n * Type description\n * \"\"\"\n * type Foo {\n * \"\"\"\n * Field description\n * \"\"\"\n * bar: String\n * }\n * ```\n *\n * Becomes:\n *\n * ```graphql prettier-ignore\n * \"\"\"Type description\"\"\" type Foo{\"\"\"Field description\"\"\" bar:String}\n * ```\n * @example\n * ```ts\n * import { stripIgnoredCharacters } from 'graphql/utilities';\n *\n * const source = stripIgnoredCharacters('query Example { name }');\n *\n * source; // => 'query Example{name}'\n * ```\n */\nexport function stripIgnoredCharacters(source: string | Source): string {\n const sourceObj = isSource(source) ? source : new Source(source);\n\n const body = sourceObj.body;\n const lexer = new Lexer(sourceObj);\n let strippedBody = '';\n\n let wasLastAddedTokenNonPunctuator = false;\n while (lexer.advance().kind !== TokenKind.EOF) {\n const currentToken = lexer.token;\n const tokenKind = currentToken.kind;\n\n /**\n * Every two non-punctuator tokens should have space between them.\n * Also prevent case of non-punctuator token following by spread resulting\n * in invalid token (e.g. `1...` is invalid Float token).\n *\n * @internal\n */\n const isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind);\n if (wasLastAddedTokenNonPunctuator) {\n if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) {\n strippedBody += ' ';\n }\n }\n\n const tokenBody = body.slice(currentToken.start, currentToken.end);\n if (tokenKind === TokenKind.BLOCK_STRING) {\n strippedBody += printBlockString(currentToken.value, { minimize: true });\n } else {\n strippedBody += tokenBody;\n }\n\n wasLastAddedTokenNonPunctuator = isNonPunctuator;\n }\n\n return strippedBody;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs new file mode 100644 index 00000000..3e7da161 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs @@ -0,0 +1,31 @@ +import { printBlockString } from "../language/blockString.mjs"; +import { isPunctuatorTokenKind, Lexer } from "../language/lexer.mjs"; +import { isSource, Source } from "../language/source.mjs"; +import { TokenKind } from "../language/tokenKind.mjs"; +export function stripIgnoredCharacters(source) { + const sourceObj = isSource(source) ? source : new Source(source); + const body = sourceObj.body; + const lexer = new Lexer(sourceObj); + let strippedBody = ''; + let wasLastAddedTokenNonPunctuator = false; + while (lexer.advance().kind !== TokenKind.EOF) { + const currentToken = lexer.token; + const tokenKind = currentToken.kind; + const isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind); + if (wasLastAddedTokenNonPunctuator) { + if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) { + strippedBody += ' '; + } + } + const tokenBody = body.slice(currentToken.start, currentToken.end); + if (tokenKind === TokenKind.BLOCK_STRING) { + strippedBody += printBlockString(currentToken.value, { minimize: true }); + } + else { + strippedBody += tokenBody; + } + wasLastAddedTokenNonPunctuator = isNonPunctuator; + } + return strippedBody; +} +//# sourceMappingURL=stripIgnoredCharacters.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs.map new file mode 100644 index 00000000..93cc41d4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/stripIgnoredCharacters.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"stripIgnoredCharacters.js","sourceRoot":"","sources":["../../src/utilities/stripIgnoredCharacters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,oCAAmC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,8BAA6B;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,+BAA8B;AACzD,OAAO,EAAE,SAAS,EAAE,kCAAiC;AAoErD,MAAM,UAAU,sBAAsB,CAAC,MAAuB;IAC5D,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAEjE,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,YAAY,GAAG,EAAE,CAAC;IAEtB,IAAI,8BAA8B,GAAG,KAAK,CAAC;IAC3C,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,GAAG,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;QACjC,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC;QASpC,MAAM,eAAe,GAAG,CAAC,qBAAqB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAClE,IAAI,8BAA8B,EAAE,CAAC;YACnC,IAAI,eAAe,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;gBAC9D,YAAY,IAAI,GAAG,CAAC;YACtB,CAAC;QACH,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,SAAS,CAAC,YAAY,EAAE,CAAC;YACzC,YAAY,IAAI,gBAAgB,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3E,CAAC;aAAM,CAAC;YACN,YAAY,IAAI,SAAS,CAAC;QAC5B,CAAC;QAED,8BAA8B,GAAG,eAAe,CAAC;IACnD,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/** @category AST Utilities */\n\nimport { printBlockString } from '../language/blockString.ts';\nimport { isPunctuatorTokenKind, Lexer } from '../language/lexer.ts';\nimport { isSource, Source } from '../language/source.ts';\nimport { TokenKind } from '../language/tokenKind.ts';\n\n/**\n * Strips characters that are not significant to the validity or execution\n * of a GraphQL document:\n * - UnicodeBOM\n * - WhiteSpace\n * - LineTerminator\n * - Comment\n * - Comma\n * - BlockString indentation\n *\n * Note: It is required to have a delimiter character between neighboring\n * non-punctuator tokens and this function always uses single space as delimiter.\n *\n * It is guaranteed that both input and output documents if parsed would result\n * in the exact same AST except for nodes location.\n *\n * Warning: It is guaranteed that this function will always produce stable results.\n * However, it's not guaranteed that it will stay the same between different\n * releases due to bugfixes or changes in the GraphQL specification.\n * @param source - The GraphQL source text or source object.\n * @returns A semantically equivalent GraphQL source string without ignored characters.\n * @example Query source\n * ```graphql\n * query SomeQuery($foo: String!, $bar: String) {\n * someField(foo: $foo, bar: $bar) {\n * a\n * b {\n * c\n * d\n * }\n * }\n * }\n * ```\n *\n * Becomes:\n *\n * ```graphql prettier-ignore\n * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}\n * ```\n * @example SDL source\n * ```graphql\n * \"\"\"\n * Type description\n * \"\"\"\n * type Foo {\n * \"\"\"\n * Field description\n * \"\"\"\n * bar: String\n * }\n * ```\n *\n * Becomes:\n *\n * ```graphql prettier-ignore\n * \"\"\"Type description\"\"\" type Foo{\"\"\"Field description\"\"\" bar:String}\n * ```\n * @example\n * ```ts\n * import { stripIgnoredCharacters } from 'graphql/utilities';\n *\n * const source = stripIgnoredCharacters('query Example { name }');\n *\n * source; // => 'query Example{name}'\n * ```\n */\nexport function stripIgnoredCharacters(source: string | Source): string {\n const sourceObj = isSource(source) ? source : new Source(source);\n\n const body = sourceObj.body;\n const lexer = new Lexer(sourceObj);\n let strippedBody = '';\n\n let wasLastAddedTokenNonPunctuator = false;\n while (lexer.advance().kind !== TokenKind.EOF) {\n const currentToken = lexer.token;\n const tokenKind = currentToken.kind;\n\n /**\n * Every two non-punctuator tokens should have space between them.\n * Also prevent case of non-punctuator token following by spread resulting\n * in invalid token (e.g. `1...` is invalid Float token).\n *\n * @internal\n */\n const isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind);\n if (wasLastAddedTokenNonPunctuator) {\n if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) {\n strippedBody += ' ';\n }\n }\n\n const tokenBody = body.slice(currentToken.start, currentToken.end);\n if (tokenKind === TokenKind.BLOCK_STRING) {\n strippedBody += printBlockString(currentToken.value, { minimize: true });\n } else {\n strippedBody += tokenBody;\n }\n\n wasLastAddedTokenNonPunctuator = isNonPunctuator;\n }\n\n return strippedBody;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.mts new file mode 100644 index 00000000..9104946b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.mts @@ -0,0 +1,101 @@ +/** @category Type Comparisons */ +import type { GraphQLCompositeType, GraphQLType } from "../type/definition.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +/** + * Provided two types, return true if the types are equal (invariant). + * @param typeA - The first GraphQL type to compare. + * @param typeB - The second GraphQL type to compare. + * @returns True when both types are equal. + * @example + * ```ts + * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type'; + * import { isEqualType } from 'graphql/utilities'; + * + * isEqualType(GraphQLString, GraphQLString); // => true + * isEqualType(new GraphQLList(GraphQLString), new GraphQLList(GraphQLString)); // => true + * isEqualType(new GraphQLNonNull(GraphQLString), GraphQLString); // => false + * ``` + */ +export declare function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean; +/** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + * @param schema - GraphQL schema to use. + * @param maybeSubType - The possible subtype to compare. + * @param superType - The possible supertype to compare. + * @returns True when `maybeSubType` is equal to or a subtype of `superType`. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { + * GraphQLNonNull, + * assertInterfaceType, + * assertObjectType, + * } from 'graphql/type'; + * import { isTypeSubTypeOf } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * const Node = assertInterfaceType(schema.getType('Node')); + * const User = assertObjectType(schema.getType('User')); + * + * isTypeSubTypeOf(schema, User, Node); // => true + * isTypeSubTypeOf(schema, new GraphQLNonNull(User), Node); // => true + * isTypeSubTypeOf(schema, Node, User); // => false + * ``` + */ +export declare function isTypeSubTypeOf(schema: GraphQLSchema, maybeSubType: GraphQLType, superType: GraphQLType): boolean; +/** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + * @param schema - GraphQL schema to use. + * @param typeA - The first GraphQL type to compare. + * @param typeB - The second GraphQL type to compare. + * @returns True when the two composite types can apply to at least one common object type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType, assertUnionType } from 'graphql/type'; + * import { doTypesOverlap } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * union StillImage = Photo + * + * type Query { + * media: [Media] + * } + * `); + * const Media = assertUnionType(schema.getType('Media')); + * const StillImage = assertUnionType(schema.getType('StillImage')); + * const Video = assertObjectType(schema.getType('Video')); + * + * doTypesOverlap(schema, Media, StillImage); // => true + * doTypesOverlap(schema, StillImage, Video); // => false + * ``` + */ +export declare function doTypesOverlap(schema: GraphQLSchema, typeA: GraphQLCompositeType, typeB: GraphQLCompositeType): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.ts new file mode 100644 index 00000000..26368750 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.d.ts @@ -0,0 +1,101 @@ +/** @category Type Comparisons */ +import type { GraphQLCompositeType, GraphQLType } from "../type/definition.js"; +import type { GraphQLSchema } from "../type/schema.js"; +/** + * Provided two types, return true if the types are equal (invariant). + * @param typeA - The first GraphQL type to compare. + * @param typeB - The second GraphQL type to compare. + * @returns True when both types are equal. + * @example + * ```ts + * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type'; + * import { isEqualType } from 'graphql/utilities'; + * + * isEqualType(GraphQLString, GraphQLString); // => true + * isEqualType(new GraphQLList(GraphQLString), new GraphQLList(GraphQLString)); // => true + * isEqualType(new GraphQLNonNull(GraphQLString), GraphQLString); // => false + * ``` + */ +export declare function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean; +/** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + * @param schema - GraphQL schema to use. + * @param maybeSubType - The possible subtype to compare. + * @param superType - The possible supertype to compare. + * @returns True when `maybeSubType` is equal to or a subtype of `superType`. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { + * GraphQLNonNull, + * assertInterfaceType, + * assertObjectType, + * } from 'graphql/type'; + * import { isTypeSubTypeOf } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * interface Node { + * id: ID! + * } + * + * type User implements Node { + * id: ID! + * } + * + * type Query { + * node: Node + * } + * `); + * const Node = assertInterfaceType(schema.getType('Node')); + * const User = assertObjectType(schema.getType('User')); + * + * isTypeSubTypeOf(schema, User, Node); // => true + * isTypeSubTypeOf(schema, new GraphQLNonNull(User), Node); // => true + * isTypeSubTypeOf(schema, Node, User); // => false + * ``` + */ +export declare function isTypeSubTypeOf(schema: GraphQLSchema, maybeSubType: GraphQLType, superType: GraphQLType): boolean; +/** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + * @param schema - GraphQL schema to use. + * @param typeA - The first GraphQL type to compare. + * @param typeB - The second GraphQL type to compare. + * @returns True when the two composite types can apply to at least one common object type. + * @example + * ```ts + * import { buildSchema } from 'graphql/utilities'; + * import { assertObjectType, assertUnionType } from 'graphql/type'; + * import { doTypesOverlap } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Photo { + * url: String! + * } + * + * type Video { + * url: String! + * } + * + * union Media = Photo | Video + * union StillImage = Photo + * + * type Query { + * media: [Media] + * } + * `); + * const Media = assertUnionType(schema.getType('Media')); + * const StillImage = assertUnionType(schema.getType('StillImage')); + * const Video = assertObjectType(schema.getType('Video')); + * + * doTypesOverlap(schema, Media, StillImage); // => true + * doTypesOverlap(schema, StillImage, Video); // => false + * ``` + */ +export declare function doTypesOverlap(schema: GraphQLSchema, typeA: GraphQLCompositeType, typeB: GraphQLCompositeType): boolean; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js new file mode 100644 index 00000000..ecb2e7f2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEqualType = isEqualType; +exports.isTypeSubTypeOf = isTypeSubTypeOf; +exports.doTypesOverlap = doTypesOverlap; +const definition_ts_1 = require("../type/definition.js"); +function isEqualType(typeA, typeB) { + if (typeA === typeB) { + return true; + } + if ((0, definition_ts_1.isNonNullType)(typeA) && (0, definition_ts_1.isNonNullType)(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + if ((0, definition_ts_1.isListType)(typeA) && (0, definition_ts_1.isListType)(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + return false; +} +function isTypeSubTypeOf(schema, maybeSubType, superType) { + if (maybeSubType === superType) { + return true; + } + if ((0, definition_ts_1.isNonNullType)(superType)) { + if ((0, definition_ts_1.isNonNullType)(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if ((0, definition_ts_1.isNonNullType)(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); + } + if ((0, definition_ts_1.isListType)(superType)) { + if ((0, definition_ts_1.isListType)(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if ((0, definition_ts_1.isListType)(maybeSubType)) { + return false; + } + return ((0, definition_ts_1.isAbstractType)(superType) && + ((0, definition_ts_1.isInterfaceType)(maybeSubType) || (0, definition_ts_1.isObjectType)(maybeSubType)) && + schema.isSubType(superType, maybeSubType)); +} +function doTypesOverlap(schema, typeA, typeB) { + if (typeA === typeB) { + return true; + } + if ((0, definition_ts_1.isAbstractType)(typeA)) { + if ((0, definition_ts_1.isAbstractType)(typeB)) { + return schema + .getPossibleTypes(typeA) + .some((type) => schema.isSubType(typeB, type)); + } + return schema.isSubType(typeA, typeB); + } + if ((0, definition_ts_1.isAbstractType)(typeB)) { + return schema.isSubType(typeB, typeA); + } + return false; +} +//# sourceMappingURL=typeComparators.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js.map new file mode 100644 index 00000000..903aa766 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"typeComparators.js","sourceRoot":"","sources":["../../src/utilities/typeComparators.ts"],"names":[],"mappings":";;AA2BA,kCAkBC;AAwCD,0CAyCC;AA4CD,wCA6BC;AApMD,yDAM+B;AAkB/B,SAAgB,WAAW,CAAC,KAAkB,EAAE,KAAkB;IAEhE,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IA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AAC;QAE7B,OAAO,KAAK,CAAC;IACf,CAAC;IAID,OAAO,CACL,IAAA,8BAAc,EAAC,SAAS,CAAC;QACzB,CAAC,IAAA,+BAAe,EAAC,YAAY,CAAC,IAAI,IAAA,4BAAY,EAAC,YAAY,CAAC,CAAC;QAC7D,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAC1C,CAAC;AACJ,CAAC;AA4CD,SAAgB,cAAc,CAC5B,MAAqB,EACrB,KAA2B,EAC3B,KAA2B;IAG3B,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAA,8BAAc,EAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,IAAI,IAAA,8BAAc,EAAC,KAAK,CAAC,EAAE,CAAC;YAG1B,OAAO,MAAM;iBACV,gBAAgB,CAAC,KAAK,CAAC;iBACvB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,IAAA,8BAAc,EAAC,KAAK,CAAC,EAAE,CAAC;QAE1B,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAGD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/** @category Type Comparisons */\n\nimport type { GraphQLCompositeType, GraphQLType } from '../type/definition.ts';\nimport {\n isAbstractType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\n/**\n * Provided two types, return true if the types are equal (invariant).\n * @param typeA - The first GraphQL type to compare.\n * @param typeB - The second GraphQL type to compare.\n * @returns True when both types are equal.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';\n * import { isEqualType } from 'graphql/utilities';\n *\n * isEqualType(GraphQLString, GraphQLString); // => true\n * isEqualType(new GraphQLList(GraphQLString), new GraphQLList(GraphQLString)); // => true\n * isEqualType(new GraphQLNonNull(GraphQLString), GraphQLString); // => false\n * ```\n */\nexport function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean {\n // Equivalent types are equal.\n if (typeA === typeB) {\n return true;\n }\n\n // If either type is non-null, the other must also be non-null.\n if (isNonNullType(typeA) && isNonNullType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n }\n\n // If either type is a list, the other must also be a list.\n if (isListType(typeA) && isListType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n }\n\n // Otherwise the types are not equal.\n return false;\n}\n\n/**\n * Provided a type and a super type, return true if the first type is either\n * equal or a subset of the second super type (covariant).\n * @param schema - GraphQL schema to use.\n * @param maybeSubType - The possible subtype to compare.\n * @param superType - The possible supertype to compare.\n * @returns True when `maybeSubType` is equal to or a subtype of `superType`.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * GraphQLNonNull,\n * assertInterfaceType,\n * assertObjectType,\n * } from 'graphql/type';\n * import { isTypeSubTypeOf } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const User = assertObjectType(schema.getType('User'));\n *\n * isTypeSubTypeOf(schema, User, Node); // => true\n * isTypeSubTypeOf(schema, new GraphQLNonNull(User), Node); // => true\n * isTypeSubTypeOf(schema, Node, User); // => false\n * ```\n */\nexport function isTypeSubTypeOf(\n schema: GraphQLSchema,\n maybeSubType: GraphQLType,\n superType: GraphQLType,\n): boolean {\n // Equivalent type is a valid subtype\n if (maybeSubType === superType) {\n return true;\n }\n\n // If superType is non-null, maybeSubType must also be non-null.\n if (isNonNullType(superType)) {\n if (isNonNullType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n return false;\n }\n if (isNonNullType(maybeSubType)) {\n // If superType is nullable, maybeSubType may be non-null or nullable.\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);\n }\n\n // If superType type is a list, maybeSubType type must also be a list.\n if (isListType(superType)) {\n if (isListType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n return false;\n }\n if (isListType(maybeSubType)) {\n // If superType is not a list, maybeSubType must also be not a list.\n return false;\n }\n\n // If superType type is an abstract type, check if it is super type of maybeSubType.\n // Otherwise, the child type is not a valid subtype of the parent type.\n return (\n isAbstractType(superType) &&\n (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) &&\n schema.isSubType(superType, maybeSubType)\n );\n}\n\n/**\n * Provided two composite types, determine if they \"overlap\". Two composite\n * types overlap when the Sets of possible concrete types for each intersect.\n *\n * This is often used to determine if a fragment of a given type could possibly\n * be visited in a context of another type.\n *\n * This function is commutative.\n * @param schema - GraphQL schema to use.\n * @param typeA - The first GraphQL type to compare.\n * @param typeB - The second GraphQL type to compare.\n * @returns True when the two composite types can apply to at least one common object type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType, assertUnionType } from 'graphql/type';\n * import { doTypesOverlap } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n * union StillImage = Photo\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n * const Media = assertUnionType(schema.getType('Media'));\n * const StillImage = assertUnionType(schema.getType('StillImage'));\n * const Video = assertObjectType(schema.getType('Video'));\n *\n * doTypesOverlap(schema, Media, StillImage); // => true\n * doTypesOverlap(schema, StillImage, Video); // => false\n * ```\n */\nexport function doTypesOverlap(\n schema: GraphQLSchema,\n typeA: GraphQLCompositeType,\n typeB: GraphQLCompositeType,\n): boolean {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (isAbstractType(typeA)) {\n if (isAbstractType(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema\n .getPossibleTypes(typeA)\n .some((type) => schema.isSubType(typeB, type));\n }\n // Determine if the latter type is a possible concrete type of the former.\n return schema.isSubType(typeA, typeB);\n }\n\n if (isAbstractType(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n }\n\n // Otherwise the types do not overlap.\n return false;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs new file mode 100644 index 00000000..793211fd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs @@ -0,0 +1,57 @@ +import { isAbstractType, isInterfaceType, isListType, isNonNullType, isObjectType, } from "../type/definition.mjs"; +export function isEqualType(typeA, typeB) { + if (typeA === typeB) { + return true; + } + if (isNonNullType(typeA) && isNonNullType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + if (isListType(typeA) && isListType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + return false; +} +export function isTypeSubTypeOf(schema, maybeSubType, superType) { + if (maybeSubType === superType) { + return true; + } + if (isNonNullType(superType)) { + if (isNonNullType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if (isNonNullType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); + } + if (isListType(superType)) { + if (isListType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if (isListType(maybeSubType)) { + return false; + } + return (isAbstractType(superType) && + (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && + schema.isSubType(superType, maybeSubType)); +} +export function doTypesOverlap(schema, typeA, typeB) { + if (typeA === typeB) { + return true; + } + if (isAbstractType(typeA)) { + if (isAbstractType(typeB)) { + return schema + .getPossibleTypes(typeA) + .some((type) => schema.isSubType(typeB, type)); + } + return schema.isSubType(typeA, typeB); + } + if (isAbstractType(typeB)) { + return schema.isSubType(typeB, typeA); + } + return false; +} +//# sourceMappingURL=typeComparators.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs.map new file mode 100644 index 00000000..48f6c29f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeComparators.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"typeComparators.js","sourceRoot":"","sources":["../../src/utilities/typeComparators.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,YAAY,GACb,+BAA8B;AAkB/B,MAAM,UAAU,WAAW,CAAC,KAAkB,EAAE,KAAkB;IAEhE,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAGD,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3C,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAGD,OAAO,KAAK,CAAC;AACf,CAAC;AAwCD,MAAM,UAAU,eAAe,CAC7B,MAAqB,EACrB,YAAy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MAAM;iBACV,gBAAgB,CAAC,KAAK,CAAC;iBACvB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAE1B,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAGD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/** @category Type Comparisons */\n\nimport type { GraphQLCompositeType, GraphQLType } from '../type/definition.ts';\nimport {\n isAbstractType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\n/**\n * Provided two types, return true if the types are equal (invariant).\n * @param typeA - The first GraphQL type to compare.\n * @param typeB - The second GraphQL type to compare.\n * @returns True when both types are equal.\n * @example\n * ```ts\n * import { GraphQLList, GraphQLNonNull, GraphQLString } from 'graphql/type';\n * import { isEqualType } from 'graphql/utilities';\n *\n * isEqualType(GraphQLString, GraphQLString); // => true\n * isEqualType(new GraphQLList(GraphQLString), new GraphQLList(GraphQLString)); // => true\n * isEqualType(new GraphQLNonNull(GraphQLString), GraphQLString); // => false\n * ```\n */\nexport function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean {\n // Equivalent types are equal.\n if (typeA === typeB) {\n return true;\n }\n\n // If either type is non-null, the other must also be non-null.\n if (isNonNullType(typeA) && isNonNullType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n }\n\n // If either type is a list, the other must also be a list.\n if (isListType(typeA) && isListType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n }\n\n // Otherwise the types are not equal.\n return false;\n}\n\n/**\n * Provided a type and a super type, return true if the first type is either\n * equal or a subset of the second super type (covariant).\n * @param schema - GraphQL schema to use.\n * @param maybeSubType - The possible subtype to compare.\n * @param superType - The possible supertype to compare.\n * @returns True when `maybeSubType` is equal to or a subtype of `superType`.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * GraphQLNonNull,\n * assertInterfaceType,\n * assertObjectType,\n * } from 'graphql/type';\n * import { isTypeSubTypeOf } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * interface Node {\n * id: ID!\n * }\n *\n * type User implements Node {\n * id: ID!\n * }\n *\n * type Query {\n * node: Node\n * }\n * `);\n * const Node = assertInterfaceType(schema.getType('Node'));\n * const User = assertObjectType(schema.getType('User'));\n *\n * isTypeSubTypeOf(schema, User, Node); // => true\n * isTypeSubTypeOf(schema, new GraphQLNonNull(User), Node); // => true\n * isTypeSubTypeOf(schema, Node, User); // => false\n * ```\n */\nexport function isTypeSubTypeOf(\n schema: GraphQLSchema,\n maybeSubType: GraphQLType,\n superType: GraphQLType,\n): boolean {\n // Equivalent type is a valid subtype\n if (maybeSubType === superType) {\n return true;\n }\n\n // If superType is non-null, maybeSubType must also be non-null.\n if (isNonNullType(superType)) {\n if (isNonNullType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n return false;\n }\n if (isNonNullType(maybeSubType)) {\n // If superType is nullable, maybeSubType may be non-null or nullable.\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);\n }\n\n // If superType type is a list, maybeSubType type must also be a list.\n if (isListType(superType)) {\n if (isListType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n return false;\n }\n if (isListType(maybeSubType)) {\n // If superType is not a list, maybeSubType must also be not a list.\n return false;\n }\n\n // If superType type is an abstract type, check if it is super type of maybeSubType.\n // Otherwise, the child type is not a valid subtype of the parent type.\n return (\n isAbstractType(superType) &&\n (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) &&\n schema.isSubType(superType, maybeSubType)\n );\n}\n\n/**\n * Provided two composite types, determine if they \"overlap\". Two composite\n * types overlap when the Sets of possible concrete types for each intersect.\n *\n * This is often used to determine if a fragment of a given type could possibly\n * be visited in a context of another type.\n *\n * This function is commutative.\n * @param schema - GraphQL schema to use.\n * @param typeA - The first GraphQL type to compare.\n * @param typeB - The second GraphQL type to compare.\n * @returns True when the two composite types can apply to at least one common object type.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql/utilities';\n * import { assertObjectType, assertUnionType } from 'graphql/type';\n * import { doTypesOverlap } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Photo {\n * url: String!\n * }\n *\n * type Video {\n * url: String!\n * }\n *\n * union Media = Photo | Video\n * union StillImage = Photo\n *\n * type Query {\n * media: [Media]\n * }\n * `);\n * const Media = assertUnionType(schema.getType('Media'));\n * const StillImage = assertUnionType(schema.getType('StillImage'));\n * const Video = assertObjectType(schema.getType('Video'));\n *\n * doTypesOverlap(schema, Media, StillImage); // => true\n * doTypesOverlap(schema, StillImage, Video); // => false\n * ```\n */\nexport function doTypesOverlap(\n schema: GraphQLSchema,\n typeA: GraphQLCompositeType,\n typeB: GraphQLCompositeType,\n): boolean {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (isAbstractType(typeA)) {\n if (isAbstractType(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema\n .getPossibleTypes(typeA)\n .some((type) => schema.isSubType(typeB, type));\n }\n // Determine if the latter type is a possible concrete type of the former.\n return schema.isSubType(typeA, typeB);\n }\n\n if (isAbstractType(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n }\n\n // Otherwise the types do not overlap.\n return false;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.mts new file mode 100644 index 00000000..ae1cfbcd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.mts @@ -0,0 +1,101 @@ +/** @category Values */ +import type { ListTypeNode, NamedTypeNode, NonNullTypeNode, TypeNode } from "../language/ast.mjs"; +import type { GraphQLNamedType, GraphQLType } from "../type/definition.mjs"; +import { GraphQLList, GraphQLNonNull } from "../type/definition.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +/** + * Given a Schema and an AST node describing a type, return a GraphQLType + * definition which applies to that type. For example, if provided the parsed + * AST node for `[User]`, a GraphQLList instance will be returned, containing + * the type called "User" found in the schema. If a type called "User" is not + * found in the schema, then undefined will be returned. + * @param schema - GraphQL schema to use. + * @param typeNode - The GraphQL type AST node to resolve. + * @returns The GraphQL type referenced by the AST node, or undefined if it cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * typeFromAST(schema, parseType('String'))?.toString(); // => 'String' + * typeFromAST(schema, parseType('Missing')); // => undefined + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: NamedTypeNode): GraphQLNamedType | undefined; +/** + * Resolves a list type AST node against a schema. + * @param schema - GraphQL schema to use. + * @param typeNode - The list type AST node to resolve. + * @returns The GraphQL list type referenced by the AST node, or undefined if + * it cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * tags: [String] + * } + * `); + * + * typeFromAST(schema, parseType('[String]'))?.toString(); // => '[String]' + * typeFromAST(schema, parseType('[Missing]')); // => undefined + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: ListTypeNode): GraphQLList | undefined; +/** + * Resolves a non-null type AST node against a schema. + * @param schema - GraphQL schema to use. + * @param typeNode - The non-null type AST node to resolve. + * @returns The GraphQL non-null type referenced by the AST node, or undefined + * if it cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String! + * } + * `); + * + * typeFromAST(schema, parseType('String!'))?.toString(); // => 'String!' + * typeFromAST(schema, parseType('[String!]!'))?.toString(); // => '[String!]!' + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: NonNullTypeNode): GraphQLNonNull | undefined; +/** + * Resolves a type AST node against a schema. + * @param schema - GraphQL schema to use. + * @param typeNode - The GraphQL type AST node to resolve. + * @returns The GraphQL type referenced by the AST node, or undefined if it + * cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * users: [User!]! + * } + * `); + * + * typeFromAST(schema, parseType('User'))?.toString(); // => 'User' + * typeFromAST(schema, parseType('[User!]!'))?.toString(); // => '[User!]!' + * typeFromAST(schema, parseType('Missing')); // => undefined + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: TypeNode): GraphQLType | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.ts new file mode 100644 index 00000000..7b19c445 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.d.ts @@ -0,0 +1,101 @@ +/** @category Values */ +import type { ListTypeNode, NamedTypeNode, NonNullTypeNode, TypeNode } from "../language/ast.js"; +import type { GraphQLNamedType, GraphQLType } from "../type/definition.js"; +import { GraphQLList, GraphQLNonNull } from "../type/definition.js"; +import type { GraphQLSchema } from "../type/schema.js"; +/** + * Given a Schema and an AST node describing a type, return a GraphQLType + * definition which applies to that type. For example, if provided the parsed + * AST node for `[User]`, a GraphQLList instance will be returned, containing + * the type called "User" found in the schema. If a type called "User" is not + * found in the schema, then undefined will be returned. + * @param schema - GraphQL schema to use. + * @param typeNode - The GraphQL type AST node to resolve. + * @returns The GraphQL type referenced by the AST node, or undefined if it cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * typeFromAST(schema, parseType('String'))?.toString(); // => 'String' + * typeFromAST(schema, parseType('Missing')); // => undefined + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: NamedTypeNode): GraphQLNamedType | undefined; +/** + * Resolves a list type AST node against a schema. + * @param schema - GraphQL schema to use. + * @param typeNode - The list type AST node to resolve. + * @returns The GraphQL list type referenced by the AST node, or undefined if + * it cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * tags: [String] + * } + * `); + * + * typeFromAST(schema, parseType('[String]'))?.toString(); // => '[String]' + * typeFromAST(schema, parseType('[Missing]')); // => undefined + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: ListTypeNode): GraphQLList | undefined; +/** + * Resolves a non-null type AST node against a schema. + * @param schema - GraphQL schema to use. + * @param typeNode - The non-null type AST node to resolve. + * @returns The GraphQL non-null type referenced by the AST node, or undefined + * if it cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * name: String! + * } + * `); + * + * typeFromAST(schema, parseType('String!'))?.toString(); // => 'String!' + * typeFromAST(schema, parseType('[String!]!'))?.toString(); // => '[String!]!' + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: NonNullTypeNode): GraphQLNonNull | undefined; +/** + * Resolves a type AST node against a schema. + * @param schema - GraphQL schema to use. + * @param typeNode - The GraphQL type AST node to resolve. + * @returns The GraphQL type referenced by the AST node, or undefined if it + * cannot be resolved. + * @example + * ```ts + * import { parseType } from 'graphql/language'; + * import { buildSchema, typeFromAST } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type User { + * name: String + * } + * + * type Query { + * users: [User!]! + * } + * `); + * + * typeFromAST(schema, parseType('User'))?.toString(); // => 'User' + * typeFromAST(schema, parseType('[User!]!'))?.toString(); // => '[User!]!' + * typeFromAST(schema, parseType('Missing')); // => undefined + * ``` + */ +export declare function typeFromAST(schema: GraphQLSchema, typeNode: TypeNode): GraphQLType | undefined; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js new file mode 100644 index 00000000..52d2b8ad --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeFromAST = typeFromAST; +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +function typeFromAST(schema, typeNode) { + switch (typeNode.kind) { + case kinds_ts_1.Kind.LIST_TYPE: { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new definition_ts_1.GraphQLList(innerType); + } + case kinds_ts_1.Kind.NON_NULL_TYPE: { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new definition_ts_1.GraphQLNonNull(innerType); + } + case kinds_ts_1.Kind.NAMED_TYPE: + return schema.getType(typeNode.name.value); + } +} +//# sourceMappingURL=typeFromAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js.map new file mode 100644 index 00000000..7a87c782 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.js.map @@ -0,0 +1 @@ +{"version":3,"file":"typeFromAST.js","sourceRoot":"","sources":["../../src/utilities/typeFromAST.ts"],"names":[],"mappings":";;AAkIA,kCAkBC;AA5ID,mDAA4C;AAO5C,yDAAoE;AAmHpE,SAAgB,WAAW,CACzB,MAAqB,EACrB,QAAkB;IAElB,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,KAAK,eAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,SAAS,IAAI,IAAI,2BAAW,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;QACD,KAAK,eAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YACxB,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAEtC,CAAC;YACd,OAAO,SAAS,IAAI,IAAI,8BAAc,CAAC,SAAS,CAAC,CAAC;QACpD,CAAC;QACD,KAAK,eAAI,CAAC,UAAU;YAClB,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport type {\n ListTypeNode,\n NamedTypeNode,\n NonNullTypeNode,\n TypeNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type {\n GraphQLNamedType,\n GraphQLNullableType,\n GraphQLType,\n} from '../type/definition.ts';\nimport { GraphQLList, GraphQLNonNull } from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\n/**\n * Given a Schema and an AST node describing a type, return a GraphQLType\n * definition which applies to that type. For example, if provided the parsed\n * AST node for `[User]`, a GraphQLList instance will be returned, containing\n * the type called \"User\" found in the schema. If a type called \"User\" is not\n * found in the schema, then undefined will be returned.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The GraphQL type AST node to resolve.\n * @returns The GraphQL type referenced by the AST node, or undefined if it cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * typeFromAST(schema, parseType('String'))?.toString(); // => 'String'\n * typeFromAST(schema, parseType('Missing')); // => undefined\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: NamedTypeNode,\n): GraphQLNamedType | undefined;\n/**\n * Resolves a list type AST node against a schema.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The list type AST node to resolve.\n * @returns The GraphQL list type referenced by the AST node, or undefined if\n * it cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * tags: [String]\n * }\n * `);\n *\n * typeFromAST(schema, parseType('[String]'))?.toString(); // => '[String]'\n * typeFromAST(schema, parseType('[Missing]')); // => undefined\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: ListTypeNode,\n): GraphQLList | undefined;\n/**\n * Resolves a non-null type AST node against a schema.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The non-null type AST node to resolve.\n * @returns The GraphQL non-null type referenced by the AST node, or undefined\n * if it cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String!\n * }\n * `);\n *\n * typeFromAST(schema, parseType('String!'))?.toString(); // => 'String!'\n * typeFromAST(schema, parseType('[String!]!'))?.toString(); // => '[String!]!'\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: NonNullTypeNode,\n): GraphQLNonNull | undefined;\n/**\n * Resolves a type AST node against a schema.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The GraphQL type AST node to resolve.\n * @returns The GraphQL type referenced by the AST node, or undefined if it\n * cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * users: [User!]!\n * }\n * `);\n *\n * typeFromAST(schema, parseType('User'))?.toString(); // => 'User'\n * typeFromAST(schema, parseType('[User!]!'))?.toString(); // => '[User!]!'\n * typeFromAST(schema, parseType('Missing')); // => undefined\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: TypeNode,\n): GraphQLType | undefined;\n/**\n * Resolves a type AST node against a schema.\n * @internal\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: TypeNode,\n): GraphQLType | undefined {\n switch (typeNode.kind) {\n case Kind.LIST_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLList(innerType);\n }\n case Kind.NON_NULL_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type) as\n | GraphQLNullableType\n | undefined;\n return innerType && new GraphQLNonNull(innerType);\n }\n case Kind.NAMED_TYPE:\n return schema.getType(typeNode.name.value);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs new file mode 100644 index 00000000..3df3deff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs @@ -0,0 +1,17 @@ +import { Kind } from "../language/kinds.mjs"; +import { GraphQLList, GraphQLNonNull } from "../type/definition.mjs"; +export function typeFromAST(schema, typeNode) { + switch (typeNode.kind) { + case Kind.LIST_TYPE: { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new GraphQLList(innerType); + } + case Kind.NON_NULL_TYPE: { + const innerType = typeFromAST(schema, typeNode.type); + return innerType && new GraphQLNonNull(innerType); + } + case Kind.NAMED_TYPE: + return schema.getType(typeNode.name.value); + } +} +//# sourceMappingURL=typeFromAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs.map new file mode 100644 index 00000000..f2630c98 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typeFromAST.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"typeFromAST.js","sourceRoot":"","sources":["../../src/utilities/typeFromAST.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAO5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,+BAA8B;AAmHpE,MAAM,UAAU,WAAW,CACzB,MAAqB,EACrB,QAAkB;IAElB,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,SAAS,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;QACD,KAAK,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YACxB,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAEtC,CAAC;YACd,OAAO,SAAS,IAAI,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;QACpD,CAAC;QACD,KAAK,IAAI,CAAC,UAAU;YAClB,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport type {\n ListTypeNode,\n NamedTypeNode,\n NonNullTypeNode,\n TypeNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type {\n GraphQLNamedType,\n GraphQLNullableType,\n GraphQLType,\n} from '../type/definition.ts';\nimport { GraphQLList, GraphQLNonNull } from '../type/definition.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\n/**\n * Given a Schema and an AST node describing a type, return a GraphQLType\n * definition which applies to that type. For example, if provided the parsed\n * AST node for `[User]`, a GraphQLList instance will be returned, containing\n * the type called \"User\" found in the schema. If a type called \"User\" is not\n * found in the schema, then undefined will be returned.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The GraphQL type AST node to resolve.\n * @returns The GraphQL type referenced by the AST node, or undefined if it cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * typeFromAST(schema, parseType('String'))?.toString(); // => 'String'\n * typeFromAST(schema, parseType('Missing')); // => undefined\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: NamedTypeNode,\n): GraphQLNamedType | undefined;\n/**\n * Resolves a list type AST node against a schema.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The list type AST node to resolve.\n * @returns The GraphQL list type referenced by the AST node, or undefined if\n * it cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * tags: [String]\n * }\n * `);\n *\n * typeFromAST(schema, parseType('[String]'))?.toString(); // => '[String]'\n * typeFromAST(schema, parseType('[Missing]')); // => undefined\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: ListTypeNode,\n): GraphQLList | undefined;\n/**\n * Resolves a non-null type AST node against a schema.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The non-null type AST node to resolve.\n * @returns The GraphQL non-null type referenced by the AST node, or undefined\n * if it cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String!\n * }\n * `);\n *\n * typeFromAST(schema, parseType('String!'))?.toString(); // => 'String!'\n * typeFromAST(schema, parseType('[String!]!'))?.toString(); // => '[String!]!'\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: NonNullTypeNode,\n): GraphQLNonNull | undefined;\n/**\n * Resolves a type AST node against a schema.\n * @param schema - GraphQL schema to use.\n * @param typeNode - The GraphQL type AST node to resolve.\n * @returns The GraphQL type referenced by the AST node, or undefined if it\n * cannot be resolved.\n * @example\n * ```ts\n * import { parseType } from 'graphql/language';\n * import { buildSchema, typeFromAST } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type User {\n * name: String\n * }\n *\n * type Query {\n * users: [User!]!\n * }\n * `);\n *\n * typeFromAST(schema, parseType('User'))?.toString(); // => 'User'\n * typeFromAST(schema, parseType('[User!]!'))?.toString(); // => '[User!]!'\n * typeFromAST(schema, parseType('Missing')); // => undefined\n * ```\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: TypeNode,\n): GraphQLType | undefined;\n/**\n * Resolves a type AST node against a schema.\n * @internal\n */\nexport function typeFromAST(\n schema: GraphQLSchema,\n typeNode: TypeNode,\n): GraphQLType | undefined {\n switch (typeNode.kind) {\n case Kind.LIST_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLList(innerType);\n }\n case Kind.NON_NULL_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type) as\n | GraphQLNullableType\n | undefined;\n return innerType && new GraphQLNonNull(innerType);\n }\n case Kind.NAMED_TYPE:\n return schema.getType(typeNode.name.value);\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.mts new file mode 100644 index 00000000..da0dcffc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.mts @@ -0,0 +1,21 @@ +/** @category Typed Documents */ +import type { DocumentNode, ExecutableDefinitionNode } from "../language/ast.mjs"; +/** + * Wrapper type that contains DocumentNode and types that can be deduced from it. + * @typeParam TResponseData - Typed GraphQL response data shape. + * @typeParam TRequestVariables - Typed GraphQL request variables shape. + */ +export interface TypedQueryDocumentNode extends DocumentNode { + /** Top-level executable and type-system definitions in this document. */ + readonly definitions: ReadonlyArray; + /** + * This type is used to ensure that the variables you pass in to the query are assignable to Variables + * and that the Result is assignable to whatever you pass your result to. The method is never actually + * implemented, but the type is valid because we list it as optional + */ + __ensureTypesOfVariablesAndResultMatching?: (variables: TRequestVariables) => TResponseData; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts new file mode 100644 index 00000000..d2bb14d6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts @@ -0,0 +1,21 @@ +/** @category Typed Documents */ +import type { DocumentNode, ExecutableDefinitionNode } from "../language/ast.js"; +/** + * Wrapper type that contains DocumentNode and types that can be deduced from it. + * @typeParam TResponseData - Typed GraphQL response data shape. + * @typeParam TRequestVariables - Typed GraphQL request variables shape. + */ +export interface TypedQueryDocumentNode extends DocumentNode { + /** Top-level executable and type-system definitions in this document. */ + readonly definitions: ReadonlyArray; + /** + * This type is used to ensure that the variables you pass in to the query are assignable to Variables + * and that the Result is assignable to whatever you pass your result to. The method is never actually + * implemented, but the type is valid because we list it as optional + */ + __ensureTypesOfVariablesAndResultMatching?: (variables: TRequestVariables) => TResponseData; +} diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js new file mode 100644 index 00000000..44dd2a44 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=typedQueryDocumentNode.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js.map new file mode 100644 index 00000000..5409858a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"typedQueryDocumentNode.js","sourceRoot":"","sources":["../../src/utilities/typedQueryDocumentNode.ts"],"names":[],"mappings":"","sourcesContent":["/** @category Typed Documents */\n\nimport type {\n DocumentNode,\n ExecutableDefinitionNode,\n} from '../language/ast.ts';\n/**\n * Wrapper type that contains DocumentNode and types that can be deduced from it.\n * @typeParam TResponseData - Typed GraphQL response data shape.\n * @typeParam TRequestVariables - Typed GraphQL request variables shape.\n */\nexport interface TypedQueryDocumentNode<\n TResponseData = { [key: string]: any },\n TRequestVariables = { [key: string]: any },\n> extends DocumentNode {\n /** Top-level executable and type-system definitions in this document. */\n readonly definitions: ReadonlyArray;\n // FIXME: remove once TS implements proper way to enforce nominal typing\n /**\n * This type is used to ensure that the variables you pass in to the query are assignable to Variables\n * and that the Result is assignable to whatever you pass your result to. The method is never actually\n * implemented, but the type is valid because we list it as optional\n */\n __ensureTypesOfVariablesAndResultMatching?: (\n variables: TRequestVariables,\n ) => TResponseData;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs new file mode 100644 index 00000000..4e9ff8c5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=typedQueryDocumentNode.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs.map new file mode 100644 index 00000000..5409858a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/typedQueryDocumentNode.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"typedQueryDocumentNode.js","sourceRoot":"","sources":["../../src/utilities/typedQueryDocumentNode.ts"],"names":[],"mappings":"","sourcesContent":["/** @category Typed Documents */\n\nimport type {\n DocumentNode,\n ExecutableDefinitionNode,\n} from '../language/ast.ts';\n/**\n * Wrapper type that contains DocumentNode and types that can be deduced from it.\n * @typeParam TResponseData - Typed GraphQL response data shape.\n * @typeParam TRequestVariables - Typed GraphQL request variables shape.\n */\nexport interface TypedQueryDocumentNode<\n TResponseData = { [key: string]: any },\n TRequestVariables = { [key: string]: any },\n> extends DocumentNode {\n /** Top-level executable and type-system definitions in this document. */\n readonly definitions: ReadonlyArray;\n // FIXME: remove once TS implements proper way to enforce nominal typing\n /**\n * This type is used to ensure that the variables you pass in to the query are assignable to Variables\n * and that the Result is assignable to whatever you pass your result to. The method is never actually\n * implemented, but the type is valid because we list it as optional\n */\n __ensureTypesOfVariablesAndResultMatching?: (\n variables: TRequestVariables,\n ) => TResponseData;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.mts new file mode 100644 index 00000000..61996622 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.mts @@ -0,0 +1,144 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import type { ValueNode } from "../language/ast.mjs"; +import type { GraphQLInputType } from "../type/definition.mjs"; +import type { FragmentVariableValues } from "../execution/collectFields.mjs"; +import type { VariableValues } from "../execution/values.mjs"; +/** + * Validate that the provided input value is allowed for this type, collecting + * all errors via a callback function. + * @param inputValue - JavaScript value to validate. + * @param type - GraphQL input type to validate the value against. + * @param onError - Callback invoked for each validation error and path. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns Nothing. + * @example + * ```ts + * // Collect validation errors with their input paths. + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * import { validateInputValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * }, + * }); + * const errors = []; + * + * validateInputValue({ stars: 'bad' }, ReviewInput, (error, path) => { + * errors.push({ message: error.message, path }); + * }); + * + * errors; // => [ { message: 'Expected value of type "Int", found: "bad".', path: ['stars'] } ] + * ``` + * @example + * ```ts + * // This variant hides suggestion text for unknown input fields. + * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type'; + * import { validateInputValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * comment: { type: GraphQLString }, + * }, + * }); + * const errors = []; + * + * validateInputValue( + * { rating: 'extra field' }, + * ReviewInput, + * (error) => { + * errors.push(error.message); + * }, + * true, + * ); + * + * errors; // => ['Expected value of type "ReviewInput" not to include unknown field "rating", found: { rating: "extra field" }.'] + * ``` + */ +export declare function validateInputValue(inputValue: unknown, type: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray) => void, hideSuggestions?: Maybe): void; +/** + * Validate that the provided input literal is allowed for this type, collecting + * all errors via a callback function. + * + * If variable values are not provided, the literal is validated statically + * (not assuming that those variables are missing runtime values). + * @param valueNode - GraphQL value AST node to validate. + * @param type - GraphQL input type to validate the literal against. + * @param onError - Callback invoked for each validation error and path. + * @param variables - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns Nothing. + * @example + * ```ts + * // Validate literal input values and collect literal paths. + * import { parseValue } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * import { validateInputLiteral } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * }, + * }); + * const errors = []; + * + * validateInputLiteral( + * parseValue('{ stars: "bad" }'), + * ReviewInput, + * (error, path) => { + * errors.push({ message: error.message, path }); + * }, + * ); + * + * errors; // => [ { message: 'Expected value of type "Int", found: "bad".', path: ['stars'] } ] + * ``` + * @example + * ```ts + * // This variant resolves variable references using VariableValues from getVariableValues(). + * import assert from 'node:assert'; + * import { parse, parseValue } from 'graphql/language'; + * import { GraphQLInt } from 'graphql/type'; + * import { getVariableValues } from 'graphql/execution'; + * import { buildSchema, validateInputLiteral } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * review(stars: Int): String + * } + * `); + * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }'); + * const operation = document.definitions[0]; + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: '4', + * }); + * + * assert('variableValues' in result); + * + * const errors = []; + * validateInputLiteral( + * parseValue('$stars'), + * GraphQLInt, + * (error) => errors.push(error.message), + * result.variableValues, + * undefined, + * true, + * ); + * + * errors; // => [] + * ``` + */ +export declare function validateInputLiteral(valueNode: ValueNode, type: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray) => void, variables?: Maybe, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.ts new file mode 100644 index 00000000..12f6c551 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.d.ts @@ -0,0 +1,144 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.js"; +import { GraphQLError } from "../error/GraphQLError.js"; +import type { ValueNode } from "../language/ast.js"; +import type { GraphQLInputType } from "../type/definition.js"; +import type { FragmentVariableValues } from "../execution/collectFields.js"; +import type { VariableValues } from "../execution/values.js"; +/** + * Validate that the provided input value is allowed for this type, collecting + * all errors via a callback function. + * @param inputValue - JavaScript value to validate. + * @param type - GraphQL input type to validate the value against. + * @param onError - Callback invoked for each validation error and path. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns Nothing. + * @example + * ```ts + * // Collect validation errors with their input paths. + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * import { validateInputValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * }, + * }); + * const errors = []; + * + * validateInputValue({ stars: 'bad' }, ReviewInput, (error, path) => { + * errors.push({ message: error.message, path }); + * }); + * + * errors; // => [ { message: 'Expected value of type "Int", found: "bad".', path: ['stars'] } ] + * ``` + * @example + * ```ts + * // This variant hides suggestion text for unknown input fields. + * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type'; + * import { validateInputValue } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * comment: { type: GraphQLString }, + * }, + * }); + * const errors = []; + * + * validateInputValue( + * { rating: 'extra field' }, + * ReviewInput, + * (error) => { + * errors.push(error.message); + * }, + * true, + * ); + * + * errors; // => ['Expected value of type "ReviewInput" not to include unknown field "rating", found: { rating: "extra field" }.'] + * ``` + */ +export declare function validateInputValue(inputValue: unknown, type: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray) => void, hideSuggestions?: Maybe): void; +/** + * Validate that the provided input literal is allowed for this type, collecting + * all errors via a callback function. + * + * If variable values are not provided, the literal is validated statically + * (not assuming that those variables are missing runtime values). + * @param valueNode - GraphQL value AST node to validate. + * @param type - GraphQL input type to validate the literal against. + * @param onError - Callback invoked for each validation error and path. + * @param variables - Operation variable values returned by getVariableValues. + * @param fragmentVariableValues - Fragment variable values for the current fragment scope. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @returns Nothing. + * @example + * ```ts + * // Validate literal input values and collect literal paths. + * import { parseValue } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLNonNull, + * } from 'graphql/type'; + * import { validateInputLiteral } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * }, + * }); + * const errors = []; + * + * validateInputLiteral( + * parseValue('{ stars: "bad" }'), + * ReviewInput, + * (error, path) => { + * errors.push({ message: error.message, path }); + * }, + * ); + * + * errors; // => [ { message: 'Expected value of type "Int", found: "bad".', path: ['stars'] } ] + * ``` + * @example + * ```ts + * // This variant resolves variable references using VariableValues from getVariableValues(). + * import assert from 'node:assert'; + * import { parse, parseValue } from 'graphql/language'; + * import { GraphQLInt } from 'graphql/type'; + * import { getVariableValues } from 'graphql/execution'; + * import { buildSchema, validateInputLiteral } from 'graphql/utilities'; + * + * const schema = buildSchema(` + * type Query { + * review(stars: Int): String + * } + * `); + * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }'); + * const operation = document.definitions[0]; + * const result = getVariableValues(schema, operation.variableDefinitions, { + * stars: '4', + * }); + * + * assert('variableValues' in result); + * + * const errors = []; + * validateInputLiteral( + * parseValue('$stars'), + * GraphQLInt, + * (error) => errors.push(error.message), + * result.variableValues, + * undefined, + * true, + * ); + * + * errors; // => [] + * ``` + */ +export declare function validateInputLiteral(valueNode: ValueNode, type: GraphQLInputType, onError: (error: GraphQLError, path: ReadonlyArray) => void, variables?: Maybe, fragmentVariableValues?: Maybe, hideSuggestions?: Maybe): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js new file mode 100644 index 00000000..5cf9b7b1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js @@ -0,0 +1,270 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateInputValue = validateInputValue; +exports.validateInputLiteral = validateInputLiteral; +const didYouMean_ts_1 = require("../jsutils/didYouMean.js"); +const inspect_ts_1 = require("../jsutils/inspect.js"); +const isIterableObject_ts_1 = require("../jsutils/isIterableObject.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const keyMap_ts_1 = require("../jsutils/keyMap.js"); +const Path_ts_1 = require("../jsutils/Path.js"); +const suggestionList_ts_1 = require("../jsutils/suggestionList.js"); +const ensureGraphQLError_ts_1 = require("../error/ensureGraphQLError.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const printer_ts_1 = require("../language/printer.js"); +const definition_ts_1 = require("../type/definition.js"); +const replaceVariables_ts_1 = require("./replaceVariables.js"); +function validateInputValue(inputValue, type, onError, hideSuggestions) { + return validateInputValueImpl(inputValue, type, onError, hideSuggestions, undefined); +} +function validateInputValueImpl(inputValue, type, onError, hideSuggestions, path) { + if ((0, definition_ts_1.isNonNullType)(type)) { + if (inputValue === undefined) { + reportInvalidValue(onError, `Expected a value of non-null type "${type}" to be provided.`, path); + return; + } + if (inputValue === null) { + reportInvalidValue(onError, `Expected value of non-null type "${type}" not to be null.`, path); + return; + } + return validateInputValueImpl(inputValue, type.ofType, onError, hideSuggestions, path); + } + if (inputValue == null) { + return; + } + if ((0, definition_ts_1.isListType)(type)) { + if (!(0, isIterableObject_ts_1.isIterableObject)(inputValue)) { + validateInputValueImpl(inputValue, type.ofType, onError, hideSuggestions, path); + } + else { + let index = 0; + for (const itemValue of inputValue) { + validateInputValueImpl(itemValue, type.ofType, onError, hideSuggestions, (0, Path_ts_1.addPath)(path, index++, undefined)); + } + } + } + else if ((0, definition_ts_1.isInputObjectType)(type)) { + if (!(0, isObjectLike_ts_1.isObjectLike)(inputValue) || Array.isArray(inputValue)) { + reportInvalidValue(onError, `Expected value of type "${type}" to be an object, found: ${(0, inspect_ts_1.inspect)(inputValue)}.`, path); + return; + } + const fieldDefs = type.getFields(); + for (const field of Object.values(fieldDefs)) { + const fieldValue = inputValue[field.name]; + if (fieldValue === undefined) { + if ((0, definition_ts_1.isRequiredInputField)(field)) { + reportInvalidValue(onError, `Expected value of type "${type}" to include required field "${field.name}", found: ${(0, inspect_ts_1.inspect)(inputValue)}.`, path); + } + } + else { + validateInputValueImpl(fieldValue, field.type, onError, hideSuggestions, (0, Path_ts_1.addPath)(path, field.name, type.name)); + } + } + const fields = []; + for (const fieldName of Object.keys(inputValue)) { + if (inputValue[fieldName] === undefined) { + continue; + } + if (!Object.hasOwn(fieldDefs, fieldName)) { + const suggestion = hideSuggestions + ? '' + : (0, didYouMean_ts_1.didYouMean)((0, suggestionList_ts_1.suggestionList)(fieldName, Object.keys(fieldDefs))); + reportInvalidValue(onError, `Expected value of type "${type}" not to include unknown field "${fieldName}"${suggestion ? `.${suggestion} Found` : ', found'}: ${(0, inspect_ts_1.inspect)(inputValue)}.`, path); + continue; + } + fields.push(fieldName); + } + if (type.isOneOf) { + if (fields.length !== 1) { + reportInvalidValue(onError, getOneOfInputObjectErrorMessage(type), path); + } + const field = fields[0]; + const value = inputValue[field]; + if (value === null) { + reportInvalidValue(onError, getOneOfInputObjectErrorMessage(type), (0, Path_ts_1.addPath)(path, field, type.name)); + } + } + } + else { + (0, definition_ts_1.assertLeafType)(type); + let result; + let caughtError; + try { + result = type.coerceInputValue(inputValue, hideSuggestions); + } + catch (error) { + if (error instanceof GraphQLError_ts_1.GraphQLError) { + onError(error, (0, Path_ts_1.pathToArray)(path)); + return; + } + caughtError = error; + } + if (result === undefined) { + reportInvalidValue(onError, `Expected value of type "${type}"${caughtError != null + ? `, but encountered error "${getCaughtErrorMessage(caughtError)}"; found` + : ', found'}: ${(0, inspect_ts_1.inspect)(inputValue)}.`, path, (0, ensureGraphQLError_ts_1.ensureGraphQLError)(caughtError)); + } + } +} +function reportInvalidValue(onError, message, path, originalError) { + onError(new GraphQLError_ts_1.GraphQLError(message, { originalError }), (0, Path_ts_1.pathToArray)(path)); +} +function validateInputLiteral(valueNode, type, onError, variables, fragmentVariableValues, hideSuggestions) { + const context = { + static: !variables && !fragmentVariableValues, + onError, + variables, + fragmentVariableValues, + }; + return validateInputLiteralImpl(context, valueNode, type, hideSuggestions, undefined); +} +function validateInputLiteralImpl(context, valueNode, type, hideSuggestions, path) { + if (valueNode.kind === kinds_ts_1.Kind.VARIABLE) { + if (context.static) { + return; + } + const scopedVariableValues = getScopedVariableValues(context, valueNode); + const value = scopedVariableValues?.coerced[valueNode.name.value]; + if ((0, definition_ts_1.isNonNullType)(type)) { + if (value === undefined) { + reportInvalidLiteral(context.onError, `Expected variable "$${valueNode.name.value}" provided to type "${type}" to provide a runtime value.`, valueNode, path); + } + else if (value === null) { + reportInvalidLiteral(context.onError, `Expected variable "$${valueNode.name.value}" provided to non-null type "${type}" not to be null.`, valueNode, path); + } + } + return; + } + if ((0, definition_ts_1.isNonNullType)(type)) { + if (valueNode.kind === kinds_ts_1.Kind.NULL) { + reportInvalidLiteral(context.onError, `Expected value of non-null type "${type}" not to be null.`, valueNode, path); + return; + } + return validateInputLiteralImpl(context, valueNode, type.ofType, hideSuggestions, path); + } + if (valueNode.kind === kinds_ts_1.Kind.NULL) { + return; + } + if ((0, definition_ts_1.isListType)(type)) { + if (valueNode.kind !== kinds_ts_1.Kind.LIST) { + validateInputLiteralImpl(context, valueNode, type.ofType, hideSuggestions, path); + } + else { + let index = 0; + for (const itemNode of valueNode.values) { + validateInputLiteralImpl(context, itemNode, type.ofType, hideSuggestions, (0, Path_ts_1.addPath)(path, index++, undefined)); + } + } + } + else if ((0, definition_ts_1.isInputObjectType)(type)) { + if (valueNode.kind !== kinds_ts_1.Kind.OBJECT) { + reportInvalidLiteral(context.onError, `Expected value of type "${type}" to be an object, found: ${(0, printer_ts_1.print)(valueNode)}.`, valueNode, path); + return; + } + const fieldDefs = type.getFields(); + const fieldNodes = (0, keyMap_ts_1.keyMap)(valueNode.fields, (field) => field.name.value); + for (const field of Object.values(fieldDefs)) { + const fieldNode = fieldNodes[field.name]; + if (fieldNode === undefined) { + if ((0, definition_ts_1.isRequiredInputField)(field)) { + reportInvalidLiteral(context.onError, `Expected value of type "${type}" to include required field "${field.name}", found: ${(0, printer_ts_1.print)(valueNode)}.`, valueNode, path); + } + } + else { + const fieldValueNode = fieldNode.value; + if (fieldValueNode.kind === kinds_ts_1.Kind.VARIABLE && !context.static) { + const scopedVariableValues = getScopedVariableValues(context, fieldValueNode); + const variableName = fieldValueNode.name.value; + const value = scopedVariableValues?.coerced[variableName]; + if (type.isOneOf) { + if (value === undefined) { + reportInvalidLiteral(context.onError, `Expected variable "$${variableName}" provided to field "${field.name}" for OneOf Input Object type "${type}" to provide a runtime value.`, valueNode, path); + } + else if (value === null) { + reportInvalidLiteral(context.onError, `Expected variable "$${variableName}" provided to field "${field.name}" for OneOf Input Object type "${type}" not to be null.`, valueNode, path); + } + } + else if (value === undefined && !(0, definition_ts_1.isRequiredInputField)(field)) { + continue; + } + } + validateInputLiteralImpl(context, fieldValueNode, field.type, hideSuggestions, (0, Path_ts_1.addPath)(path, field.name, type.name)); + } + } + const fields = valueNode.fields; + const knownFields = []; + for (const fieldNode of fields) { + const fieldName = fieldNode.name.value; + if (!Object.hasOwn(fieldDefs, fieldName)) { + const suggestion = hideSuggestions + ? '' + : (0, didYouMean_ts_1.didYouMean)((0, suggestionList_ts_1.suggestionList)(fieldName, Object.keys(fieldDefs))); + reportInvalidLiteral(context.onError, `Expected value of type "${type}" not to include unknown field "${fieldName}"${suggestion ? `.${suggestion} Found` : ', found'}: ${(0, printer_ts_1.print)(valueNode)}.`, fieldNode, path); + } + else { + knownFields.push(fieldNode); + } + } + if (type.isOneOf) { + const isNotExactlyOneField = knownFields.length !== 1; + if (isNotExactlyOneField) { + reportInvalidLiteral(context.onError, getOneOfInputObjectErrorMessage(type), valueNode, path); + return; + } + const fieldValueNode = knownFields[0].value; + if (fieldValueNode.kind === kinds_ts_1.Kind.NULL) { + const fieldName = knownFields[0].name.value; + reportInvalidLiteral(context.onError, getOneOfInputObjectErrorMessage(type), valueNode, (0, Path_ts_1.addPath)(path, fieldName, undefined)); + } + } + } + else { + (0, definition_ts_1.assertLeafType)(type); + let result; + let caughtError; + try { + result = type.coerceInputLiteral + ? type.coerceInputLiteral((0, replaceVariables_ts_1.replaceVariables)(valueNode, context.variables, context.fragmentVariableValues), hideSuggestions) + : type.parseLiteral(valueNode, undefined, hideSuggestions); + } + catch (error) { + if (error instanceof GraphQLError_ts_1.GraphQLError) { + context.onError(error, (0, Path_ts_1.pathToArray)(path)); + return; + } + caughtError = error; + } + if (result === undefined) { + reportInvalidLiteral(context.onError, `Expected value of type "${type}"${caughtError != null + ? `, but encountered error "${getCaughtErrorMessage(caughtError)}"; found` + : ', found'}: ${(0, printer_ts_1.print)(valueNode)}.`, valueNode, path, (0, ensureGraphQLError_ts_1.ensureGraphQLError)(caughtError)); + } + } +} +function getScopedVariableValues(context, valueNode) { + const variableName = valueNode.name.value; + const { fragmentVariableValues, variables } = context; + return fragmentVariableValues?.sources[variableName] + ? fragmentVariableValues + : variables; +} +function reportInvalidLiteral(onError, message, valueNode, path, originalError) { + onError(new GraphQLError_ts_1.GraphQLError(message, { + nodes: valueNode, + originalError, + }), (0, Path_ts_1.pathToArray)(path)); +} +function getCaughtErrorMessage(caughtError) { + if ((0, isObjectLike_ts_1.isObjectLike)(caughtError)) { + const message = caughtError.message; + if (typeof message === 'string' && message !== '') { + return message; + } + } + return String(caughtError); +} +function getOneOfInputObjectErrorMessage(type) { + return `Within OneOf Input Object type "${type}", exactly one field must be specified, and the value for that field must be non-null.`; +} +//# sourceMappingURL=validateInputValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js.map new file mode 100644 index 00000000..512c7df4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validateInputValue.js","sourceRoot":"","sources":["../../src/utilities/validateInputValue.ts"],"names":[],"mappings":";;AA2FA,gDAaC;AAiQD,oDAqBC;AA5XD,4DAAsD;AACtD,sDAAgD;AAChD,wEAAkE;AAClE,gEAA0D;AAC1D,oDAA8C;AAG9C,gDAA0D;AAC1D,oEAA8D;AAE9D,0EAAoE;AACpE,8DAAwD;AAGxD,mDAA4C;AAC5C,uDAA+C;AAG/C,yDAM+B;AAK/B,+DAAyD;AA4DzD,SAAgB,kBAAkB,CAChC,UAAmB,EACnB,IAAsB,EACtB,OAA4E,EAC5E,eAAgC;IAEhC,OAAO,sBAAsB,CAC3B,UAAU,EACV,IAAI,EACJ,OAAO,EACP,eAAe,EACf,SAAS,CACV,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAC7B,UAAmB,EACnB,IAAsB,EACtB,OAA4E,EAC5E,eAA+B,EAC/B,IAAsB;IAEtB,IAAI,IAAA,6BAAa,EAAC,IAAI,CAAC,EAAE,CAAC;QACxB,IAAI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5E,OAAe,EACf,SAAkB,EAClB,IAAsB,EACtB,aAA4B;IAE5B,OAAO,CACL,IAAI,8BAAY,CAAC,OAAO,EAAE;QACxB,KAAK,EAAE,SAAS;QAChB,aAAa;KACd,CAAC,EACF,IAAA,qBAAW,EAAC,IAAI,CAAC,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,WAAoB;IACjD,IAAI,IAAA,8BAAY,EAAC,WAAW,CAAC,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;QACpC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;YAClD,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,+BAA+B,CAAC,IAAsB;IAC7D,OAAO,mCAAmC,IAAI,wFAAwF,CAAC;AACzI,CAAC","sourcesContent":["/** @category Values */\n\nimport { didYouMean } from '../jsutils/didYouMean.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport { addPath, pathToArray } from '../jsutils/Path.ts';\nimport { suggestionList } from '../jsutils/suggestionList.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type { ASTNode, ValueNode, VariableNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n assertLeafType,\n isInputObjectType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../type/definition.ts';\n\nimport type { FragmentVariableValues } from '../execution/collectFields.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { replaceVariables } from './replaceVariables.ts';\n\n/**\n * Validate that the provided input value is allowed for this type, collecting\n * all errors via a callback function.\n * @param inputValue - JavaScript value to validate.\n * @param type - GraphQL input type to validate the value against.\n * @param onError - Callback invoked for each validation error and path.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns Nothing.\n * @example\n * ```ts\n * // Collect validation errors with their input paths.\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n * import { validateInputValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * },\n * });\n * const errors = [];\n *\n * validateInputValue({ stars: 'bad' }, ReviewInput, (error, path) => {\n * errors.push({ message: error.message, path });\n * });\n *\n * errors; // => [ { message: 'Expected value of type \"Int\", found: \"bad\".', path: ['stars'] } ]\n * ```\n * @example\n * ```ts\n * // This variant hides suggestion text for unknown input fields.\n * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type';\n * import { validateInputValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * comment: { type: GraphQLString },\n * },\n * });\n * const errors = [];\n *\n * validateInputValue(\n * { rating: 'extra field' },\n * ReviewInput,\n * (error) => {\n * errors.push(error.message);\n * },\n * true,\n * );\n *\n * errors; // => ['Expected value of type \"ReviewInput\" not to include unknown field \"rating\", found: { rating: \"extra field\" }.']\n * ```\n */\nexport function validateInputValue(\n inputValue: unknown,\n type: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions?: Maybe,\n): void {\n return validateInputValueImpl(\n inputValue,\n type,\n onError,\n hideSuggestions,\n undefined,\n );\n}\n\nfunction validateInputValueImpl(\n inputValue: unknown,\n type: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions: Maybe,\n path: Path | undefined,\n): void {\n if (isNonNullType(type)) {\n if (inputValue === undefined) {\n reportInvalidValue(\n onError,\n `Expected a value of non-null type \"${type}\" to be provided.`,\n path,\n );\n return;\n }\n if (inputValue === null) {\n reportInvalidValue(\n onError,\n `Expected value of non-null type \"${type}\" not to be null.`,\n path,\n );\n return;\n }\n return validateInputValueImpl(\n inputValue,\n type.ofType,\n onError,\n hideSuggestions,\n path,\n );\n }\n\n if (inputValue == null) {\n return;\n }\n\n if (isListType(type)) {\n if (!isIterableObject(inputValue)) {\n // Lists accept a non-list value as a list of one.\n validateInputValueImpl(\n inputValue,\n type.ofType,\n onError,\n hideSuggestions,\n path,\n );\n } else {\n let index = 0;\n for (const itemValue of inputValue) {\n validateInputValueImpl(\n itemValue,\n type.ofType,\n onError,\n hideSuggestions,\n addPath(path, index++, undefined),\n );\n }\n }\n } else if (isInputObjectType(type)) {\n if (!isObjectLike(inputValue) || Array.isArray(inputValue)) {\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\" to be an object, found: ${inspect(\n inputValue,\n )}.`,\n path,\n );\n return;\n }\n\n const fieldDefs = type.getFields();\n\n for (const field of Object.values(fieldDefs)) {\n const fieldValue = inputValue[field.name];\n if (fieldValue === undefined) {\n if (isRequiredInputField(field)) {\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\" to include required field \"${\n field.name\n }\", found: ${inspect(inputValue)}.`,\n path,\n );\n }\n } else {\n validateInputValueImpl(\n fieldValue,\n field.type,\n onError,\n hideSuggestions,\n addPath(path, field.name, type.name),\n );\n }\n }\n\n const fields: Array = [];\n // Ensure every provided field is defined.\n for (const fieldName of Object.keys(inputValue)) {\n if (inputValue[fieldName] === undefined) {\n continue;\n }\n if (!Object.hasOwn(fieldDefs, fieldName)) {\n const suggestion = hideSuggestions\n ? ''\n : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs)));\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\" not to include unknown field \"${fieldName}\"${\n suggestion ? `.${suggestion} Found` : ', found'\n }: ${inspect(inputValue)}.`,\n path,\n );\n continue;\n }\n fields.push(fieldName);\n }\n\n if (type.isOneOf) {\n if (fields.length !== 1) {\n reportInvalidValue(\n onError,\n getOneOfInputObjectErrorMessage(type),\n path,\n );\n }\n\n const field = fields[0];\n const value = inputValue[field];\n if (value === null) {\n reportInvalidValue(\n onError,\n getOneOfInputObjectErrorMessage(type),\n addPath(path, field, type.name),\n );\n }\n }\n } else {\n assertLeafType(type);\n\n let result;\n let caughtError: unknown;\n\n try {\n result = type.coerceInputValue(inputValue, hideSuggestions);\n } catch (error) {\n if (error instanceof GraphQLError) {\n onError(error, pathToArray(path));\n return;\n }\n caughtError = error;\n }\n\n if (result === undefined) {\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\"${\n caughtError != null\n ? `, but encountered error \"${getCaughtErrorMessage(caughtError)}\"; found`\n : ', found'\n }: ${inspect(inputValue)}.`,\n path,\n ensureGraphQLError(caughtError),\n );\n }\n }\n}\n\nfunction reportInvalidValue(\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n message: string,\n path: Path | undefined,\n originalError?: GraphQLError,\n): void {\n onError(new GraphQLError(message, { originalError }), pathToArray(path));\n}\n\n/**\n * Validate that the provided input literal is allowed for this type, collecting\n * all errors via a callback function.\n *\n * If variable values are not provided, the literal is validated statically\n * (not assuming that those variables are missing runtime values).\n * @param valueNode - GraphQL value AST node to validate.\n * @param type - GraphQL input type to validate the literal against.\n * @param onError - Callback invoked for each validation error and path.\n * @param variables - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns Nothing.\n * @example\n * ```ts\n * // Validate literal input values and collect literal paths.\n * import { parseValue } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n * import { validateInputLiteral } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * },\n * });\n * const errors = [];\n *\n * validateInputLiteral(\n * parseValue('{ stars: \"bad\" }'),\n * ReviewInput,\n * (error, path) => {\n * errors.push({ message: error.message, path });\n * },\n * );\n *\n * errors; // => [ { message: 'Expected value of type \"Int\", found: \"bad\".', path: ['stars'] } ]\n * ```\n * @example\n * ```ts\n * // This variant resolves variable references using VariableValues from getVariableValues().\n * import assert from 'node:assert';\n * import { parse, parseValue } from 'graphql/language';\n * import { GraphQLInt } from 'graphql/type';\n * import { getVariableValues } from 'graphql/execution';\n * import { buildSchema, validateInputLiteral } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * review(stars: Int): String\n * }\n * `);\n * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');\n * const operation = document.definitions[0];\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '4',\n * });\n *\n * assert('variableValues' in result);\n *\n * const errors = [];\n * validateInputLiteral(\n * parseValue('$stars'),\n * GraphQLInt,\n * (error) => errors.push(error.message),\n * result.variableValues,\n * undefined,\n * true,\n * );\n *\n * errors; // => []\n * ```\n */\n// eslint-disable-next-line max-params\nexport function validateInputLiteral(\n valueNode: ValueNode,\n type: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n variables?: Maybe,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): void {\n const context: ValidationContext = {\n static: !variables && !fragmentVariableValues,\n onError,\n variables,\n fragmentVariableValues,\n };\n return validateInputLiteralImpl(\n context,\n valueNode,\n type,\n hideSuggestions,\n undefined,\n );\n}\n\ninterface ValidationContext {\n static: boolean;\n onError: (error: GraphQLError, path: ReadonlyArray) => void;\n variables?: Maybe;\n fragmentVariableValues?: Maybe;\n}\n\nfunction validateInputLiteralImpl(\n context: ValidationContext,\n valueNode: ValueNode,\n type: GraphQLInputType,\n hideSuggestions: Maybe,\n path: Path | undefined,\n): void {\n if (valueNode.kind === Kind.VARIABLE) {\n if (context.static) {\n // If no variable values are provided, this is being validated statically,\n // and cannot yet produce any validation errors for variables.\n return;\n }\n const scopedVariableValues = getScopedVariableValues(context, valueNode);\n const value = scopedVariableValues?.coerced[valueNode.name.value];\n if (isNonNullType(type)) {\n if (value === undefined) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${valueNode.name.value}\" provided to type \"${type}\" to provide a runtime value.`,\n valueNode,\n path,\n );\n } else if (value === null) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${valueNode.name.value}\" provided to non-null type \"${type}\" not to be null.`,\n valueNode,\n path,\n );\n }\n }\n // Note: This does no further checking that this variable is correct.\n // This assumes this variable usage has already been validated.\n return;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of non-null type \"${type}\" not to be null.`,\n valueNode,\n path,\n );\n return;\n }\n return validateInputLiteralImpl(\n context,\n valueNode,\n type.ofType,\n hideSuggestions,\n path,\n );\n }\n\n if (valueNode.kind === Kind.NULL) {\n return;\n }\n\n if (isListType(type)) {\n if (valueNode.kind !== Kind.LIST) {\n // Lists accept a non-list value as a list of one.\n validateInputLiteralImpl(\n context,\n valueNode,\n type.ofType,\n hideSuggestions,\n path,\n );\n } else {\n let index = 0;\n for (const itemNode of valueNode.values) {\n validateInputLiteralImpl(\n context,\n itemNode,\n type.ofType,\n hideSuggestions,\n addPath(path, index++, undefined),\n );\n }\n }\n } else if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\" to be an object, found: ${print(\n valueNode,\n )}.`,\n valueNode,\n path,\n );\n return;\n }\n\n const fieldDefs = type.getFields();\n const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value);\n\n for (const field of Object.values(fieldDefs)) {\n const fieldNode = fieldNodes[field.name];\n if (fieldNode === undefined) {\n if (isRequiredInputField(field)) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\" to include required field \"${\n field.name\n }\", found: ${print(valueNode)}.`,\n valueNode,\n path,\n );\n }\n } else {\n const fieldValueNode = fieldNode.value;\n if (fieldValueNode.kind === Kind.VARIABLE && !context.static) {\n const scopedVariableValues = getScopedVariableValues(\n context,\n fieldValueNode,\n );\n const variableName = fieldValueNode.name.value;\n const value = scopedVariableValues?.coerced[variableName];\n if (type.isOneOf) {\n if (value === undefined) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${variableName}\" provided to field \"${field.name}\" for OneOf Input Object type \"${type}\" to provide a runtime value.`,\n valueNode,\n path,\n );\n } else if (value === null) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${variableName}\" provided to field \"${field.name}\" for OneOf Input Object type \"${type}\" not to be null.`,\n valueNode,\n path,\n );\n }\n } else if (value === undefined && !isRequiredInputField(field)) {\n continue;\n }\n }\n\n validateInputLiteralImpl(\n context,\n fieldValueNode,\n field.type,\n hideSuggestions,\n addPath(path, field.name, type.name),\n );\n }\n }\n\n const fields = valueNode.fields;\n const knownFields: Array<(typeof fields)[number]> = [];\n // Ensure every provided field is defined.\n for (const fieldNode of fields) {\n const fieldName = fieldNode.name.value;\n if (!Object.hasOwn(fieldDefs, fieldName)) {\n const suggestion = hideSuggestions\n ? ''\n : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs)));\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\" not to include unknown field \"${fieldName}\"${\n suggestion ? `.${suggestion} Found` : ', found'\n }: ${print(valueNode)}.`,\n fieldNode,\n path,\n );\n } else {\n knownFields.push(fieldNode);\n }\n }\n\n if (type.isOneOf) {\n const isNotExactlyOneField = knownFields.length !== 1;\n if (isNotExactlyOneField) {\n reportInvalidLiteral(\n context.onError,\n getOneOfInputObjectErrorMessage(type),\n valueNode,\n path,\n );\n return;\n }\n\n const fieldValueNode = knownFields[0].value;\n if (fieldValueNode.kind === Kind.NULL) {\n const fieldName = knownFields[0].name.value;\n reportInvalidLiteral(\n context.onError,\n getOneOfInputObjectErrorMessage(type),\n valueNode,\n addPath(path, fieldName, undefined),\n );\n }\n }\n } else {\n assertLeafType(type);\n\n let result;\n let caughtError: unknown;\n try {\n result = type.coerceInputLiteral\n ? type.coerceInputLiteral(\n replaceVariables(\n valueNode,\n context.variables,\n context.fragmentVariableValues,\n ),\n hideSuggestions,\n )\n : type.parseLiteral(valueNode, undefined, hideSuggestions);\n } catch (error) {\n if (error instanceof GraphQLError) {\n context.onError(error, pathToArray(path));\n return;\n }\n caughtError = error;\n }\n\n if (result === undefined) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\"${\n caughtError != null\n ? `, but encountered error \"${getCaughtErrorMessage(caughtError)}\"; found`\n : ', found'\n }: ${print(valueNode)}.`,\n valueNode,\n path,\n ensureGraphQLError(caughtError),\n );\n }\n }\n}\n\nfunction getScopedVariableValues(\n context: ValidationContext,\n valueNode: VariableNode,\n): Maybe {\n const variableName = valueNode.name.value;\n const { fragmentVariableValues, variables } = context;\n return fragmentVariableValues?.sources[variableName]\n ? fragmentVariableValues\n : variables;\n}\n\nfunction reportInvalidLiteral(\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n message: string,\n valueNode: ASTNode,\n path: Path | undefined,\n originalError?: GraphQLError,\n): void {\n onError(\n new GraphQLError(message, {\n nodes: valueNode,\n originalError,\n }),\n pathToArray(path),\n );\n}\n\nfunction getCaughtErrorMessage(caughtError: unknown): string {\n if (isObjectLike(caughtError)) {\n const message = caughtError.message;\n if (typeof message === 'string' && message !== '') {\n return message;\n }\n }\n\n return String(caughtError);\n}\n\nfunction getOneOfInputObjectErrorMessage(type: GraphQLInputType): string {\n return `Within OneOf Input Object type \"${type}\", exactly one field must be specified, and the value for that field must be non-null.`;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs new file mode 100644 index 00000000..e7faf4f5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs @@ -0,0 +1,266 @@ +import { didYouMean } from "../jsutils/didYouMean.mjs"; +import { inspect } from "../jsutils/inspect.mjs"; +import { isIterableObject } from "../jsutils/isIterableObject.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { keyMap } from "../jsutils/keyMap.mjs"; +import { addPath, pathToArray } from "../jsutils/Path.mjs"; +import { suggestionList } from "../jsutils/suggestionList.mjs"; +import { ensureGraphQLError } from "../error/ensureGraphQLError.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { print } from "../language/printer.mjs"; +import { assertLeafType, isInputObjectType, isListType, isNonNullType, isRequiredInputField, } from "../type/definition.mjs"; +import { replaceVariables } from "./replaceVariables.mjs"; +export function validateInputValue(inputValue, type, onError, hideSuggestions) { + return validateInputValueImpl(inputValue, type, onError, hideSuggestions, undefined); +} +function validateInputValueImpl(inputValue, type, onError, hideSuggestions, path) { + if (isNonNullType(type)) { + if (inputValue === undefined) { + reportInvalidValue(onError, `Expected a value of non-null type "${type}" to be provided.`, path); + return; + } + if (inputValue === null) { + reportInvalidValue(onError, `Expected value of non-null type "${type}" not to be null.`, path); + return; + } + return validateInputValueImpl(inputValue, type.ofType, onError, hideSuggestions, path); + } + if (inputValue == null) { + return; + } + if (isListType(type)) { + if (!isIterableObject(inputValue)) { + validateInputValueImpl(inputValue, type.ofType, onError, hideSuggestions, path); + } + else { + let index = 0; + for (const itemValue of inputValue) { + validateInputValueImpl(itemValue, type.ofType, onError, hideSuggestions, addPath(path, index++, undefined)); + } + } + } + else if (isInputObjectType(type)) { + if (!isObjectLike(inputValue) || Array.isArray(inputValue)) { + reportInvalidValue(onError, `Expected value of type "${type}" to be an object, found: ${inspect(inputValue)}.`, path); + return; + } + const fieldDefs = type.getFields(); + for (const field of Object.values(fieldDefs)) { + const fieldValue = inputValue[field.name]; + if (fieldValue === undefined) { + if (isRequiredInputField(field)) { + reportInvalidValue(onError, `Expected value of type "${type}" to include required field "${field.name}", found: ${inspect(inputValue)}.`, path); + } + } + else { + validateInputValueImpl(fieldValue, field.type, onError, hideSuggestions, addPath(path, field.name, type.name)); + } + } + const fields = []; + for (const fieldName of Object.keys(inputValue)) { + if (inputValue[fieldName] === undefined) { + continue; + } + if (!Object.hasOwn(fieldDefs, fieldName)) { + const suggestion = hideSuggestions + ? '' + : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs))); + reportInvalidValue(onError, `Expected value of type "${type}" not to include unknown field "${fieldName}"${suggestion ? `.${suggestion} Found` : ', found'}: ${inspect(inputValue)}.`, path); + continue; + } + fields.push(fieldName); + } + if (type.isOneOf) { + if (fields.length !== 1) { + reportInvalidValue(onError, getOneOfInputObjectErrorMessage(type), path); + } + const field = fields[0]; + const value = inputValue[field]; + if (value === null) { + reportInvalidValue(onError, getOneOfInputObjectErrorMessage(type), addPath(path, field, type.name)); + } + } + } + else { + assertLeafType(type); + let result; + let caughtError; + try { + result = type.coerceInputValue(inputValue, hideSuggestions); + } + catch (error) { + if (error instanceof GraphQLError) { + onError(error, pathToArray(path)); + return; + } + caughtError = error; + } + if (result === undefined) { + reportInvalidValue(onError, `Expected value of type "${type}"${caughtError != null + ? `, but encountered error "${getCaughtErrorMessage(caughtError)}"; found` + : ', found'}: ${inspect(inputValue)}.`, path, ensureGraphQLError(caughtError)); + } + } +} +function reportInvalidValue(onError, message, path, originalError) { + onError(new GraphQLError(message, { originalError }), pathToArray(path)); +} +export function validateInputLiteral(valueNode, type, onError, variables, fragmentVariableValues, hideSuggestions) { + const context = { + static: !variables && !fragmentVariableValues, + onError, + variables, + fragmentVariableValues, + }; + return validateInputLiteralImpl(context, valueNode, type, hideSuggestions, undefined); +} +function validateInputLiteralImpl(context, valueNode, type, hideSuggestions, path) { + if (valueNode.kind === Kind.VARIABLE) { + if (context.static) { + return; + } + const scopedVariableValues = getScopedVariableValues(context, valueNode); + const value = scopedVariableValues?.coerced[valueNode.name.value]; + if (isNonNullType(type)) { + if (value === undefined) { + reportInvalidLiteral(context.onError, `Expected variable "$${valueNode.name.value}" provided to type "${type}" to provide a runtime value.`, valueNode, path); + } + else if (value === null) { + reportInvalidLiteral(context.onError, `Expected variable "$${valueNode.name.value}" provided to non-null type "${type}" not to be null.`, valueNode, path); + } + } + return; + } + if (isNonNullType(type)) { + if (valueNode.kind === Kind.NULL) { + reportInvalidLiteral(context.onError, `Expected value of non-null type "${type}" not to be null.`, valueNode, path); + return; + } + return validateInputLiteralImpl(context, valueNode, type.ofType, hideSuggestions, path); + } + if (valueNode.kind === Kind.NULL) { + return; + } + if (isListType(type)) { + if (valueNode.kind !== Kind.LIST) { + validateInputLiteralImpl(context, valueNode, type.ofType, hideSuggestions, path); + } + else { + let index = 0; + for (const itemNode of valueNode.values) { + validateInputLiteralImpl(context, itemNode, type.ofType, hideSuggestions, addPath(path, index++, undefined)); + } + } + } + else if (isInputObjectType(type)) { + if (valueNode.kind !== Kind.OBJECT) { + reportInvalidLiteral(context.onError, `Expected value of type "${type}" to be an object, found: ${print(valueNode)}.`, valueNode, path); + return; + } + const fieldDefs = type.getFields(); + const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value); + for (const field of Object.values(fieldDefs)) { + const fieldNode = fieldNodes[field.name]; + if (fieldNode === undefined) { + if (isRequiredInputField(field)) { + reportInvalidLiteral(context.onError, `Expected value of type "${type}" to include required field "${field.name}", found: ${print(valueNode)}.`, valueNode, path); + } + } + else { + const fieldValueNode = fieldNode.value; + if (fieldValueNode.kind === Kind.VARIABLE && !context.static) { + const scopedVariableValues = getScopedVariableValues(context, fieldValueNode); + const variableName = fieldValueNode.name.value; + const value = scopedVariableValues?.coerced[variableName]; + if (type.isOneOf) { + if (value === undefined) { + reportInvalidLiteral(context.onError, `Expected variable "$${variableName}" provided to field "${field.name}" for OneOf Input Object type "${type}" to provide a runtime value.`, valueNode, path); + } + else if (value === null) { + reportInvalidLiteral(context.onError, `Expected variable "$${variableName}" provided to field "${field.name}" for OneOf Input Object type "${type}" not to be null.`, valueNode, path); + } + } + else if (value === undefined && !isRequiredInputField(field)) { + continue; + } + } + validateInputLiteralImpl(context, fieldValueNode, field.type, hideSuggestions, addPath(path, field.name, type.name)); + } + } + const fields = valueNode.fields; + const knownFields = []; + for (const fieldNode of fields) { + const fieldName = fieldNode.name.value; + if (!Object.hasOwn(fieldDefs, fieldName)) { + const suggestion = hideSuggestions + ? '' + : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs))); + reportInvalidLiteral(context.onError, `Expected value of type "${type}" not to include unknown field "${fieldName}"${suggestion ? `.${suggestion} Found` : ', found'}: ${print(valueNode)}.`, fieldNode, path); + } + else { + knownFields.push(fieldNode); + } + } + if (type.isOneOf) { + const isNotExactlyOneField = knownFields.length !== 1; + if (isNotExactlyOneField) { + reportInvalidLiteral(context.onError, getOneOfInputObjectErrorMessage(type), valueNode, path); + return; + } + const fieldValueNode = knownFields[0].value; + if (fieldValueNode.kind === Kind.NULL) { + const fieldName = knownFields[0].name.value; + reportInvalidLiteral(context.onError, getOneOfInputObjectErrorMessage(type), valueNode, addPath(path, fieldName, undefined)); + } + } + } + else { + assertLeafType(type); + let result; + let caughtError; + try { + result = type.coerceInputLiteral + ? type.coerceInputLiteral(replaceVariables(valueNode, context.variables, context.fragmentVariableValues), hideSuggestions) + : type.parseLiteral(valueNode, undefined, hideSuggestions); + } + catch (error) { + if (error instanceof GraphQLError) { + context.onError(error, pathToArray(path)); + return; + } + caughtError = error; + } + if (result === undefined) { + reportInvalidLiteral(context.onError, `Expected value of type "${type}"${caughtError != null + ? `, but encountered error "${getCaughtErrorMessage(caughtError)}"; found` + : ', found'}: ${print(valueNode)}.`, valueNode, path, ensureGraphQLError(caughtError)); + } + } +} +function getScopedVariableValues(context, valueNode) { + const variableName = valueNode.name.value; + const { fragmentVariableValues, variables } = context; + return fragmentVariableValues?.sources[variableName] + ? fragmentVariableValues + : variables; +} +function reportInvalidLiteral(onError, message, valueNode, path, originalError) { + onError(new GraphQLError(message, { + nodes: valueNode, + originalError, + }), pathToArray(path)); +} +function getCaughtErrorMessage(caughtError) { + if (isObjectLike(caughtError)) { + const message = caughtError.message; + if (typeof message === 'string' && message !== '') { + return message; + } + } + return String(caughtError); +} +function getOneOfInputObjectErrorMessage(type) { + return `Within OneOf Input Object type "${type}", exactly one field must be specified, and the value for that field must be non-null.`; +} +//# sourceMappingURL=validateInputValue.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs.map new file mode 100644 index 00000000..af7b9fc0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/validateInputValue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"validateInputValue.js","sourceRoot":"","sources":["../../src/utilities/validateInputValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,kCAAiC;AACtD,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAClE,OAAO,EAAE,YAAY,EAAE,oCAAmC;AAC1D,OAAO,EAAE,MAAM,EAAE,8BAA6B;AAG9C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,4BAA2B;AAC1D,OAAO,EAAE,cAAc,EAAE,sCAAqC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,wCAAuC;AACpE,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAGxD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAC5C,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAG/C,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,oBA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AE,OAAO,CAAC,YAAY,CAAC;QAClD,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,oBAAoB,CAC3B,OAA4E,EAC5E,OAAe,EACf,SAAkB,EAClB,IAAsB,EACtB,aAA4B;IAE5B,OAAO,CACL,IAAI,YAAY,CAAC,OAAO,EAAE;QACxB,KAAK,EAAE,SAAS;QAChB,aAAa;KACd,CAAC,EACF,WAAW,CAAC,IAAI,CAAC,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,WAAoB;IACjD,IAAI,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;QACpC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;YAClD,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,+BAA+B,CAAC,IAAsB;IAC7D,OAAO,mCAAmC,IAAI,wFAAwF,CAAC;AACzI,CAAC","sourcesContent":["/** @category Values */\n\nimport { didYouMean } from '../jsutils/didYouMean.ts';\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\nimport { keyMap } from '../jsutils/keyMap.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { Path } from '../jsutils/Path.ts';\nimport { addPath, pathToArray } from '../jsutils/Path.ts';\nimport { suggestionList } from '../jsutils/suggestionList.ts';\n\nimport { ensureGraphQLError } from '../error/ensureGraphQLError.ts';\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type { ASTNode, ValueNode, VariableNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport { print } from '../language/printer.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n assertLeafType,\n isInputObjectType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../type/definition.ts';\n\nimport type { FragmentVariableValues } from '../execution/collectFields.ts';\nimport type { VariableValues } from '../execution/values.ts';\n\nimport { replaceVariables } from './replaceVariables.ts';\n\n/**\n * Validate that the provided input value is allowed for this type, collecting\n * all errors via a callback function.\n * @param inputValue - JavaScript value to validate.\n * @param type - GraphQL input type to validate the value against.\n * @param onError - Callback invoked for each validation error and path.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns Nothing.\n * @example\n * ```ts\n * // Collect validation errors with their input paths.\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n * import { validateInputValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * },\n * });\n * const errors = [];\n *\n * validateInputValue({ stars: 'bad' }, ReviewInput, (error, path) => {\n * errors.push({ message: error.message, path });\n * });\n *\n * errors; // => [ { message: 'Expected value of type \"Int\", found: \"bad\".', path: ['stars'] } ]\n * ```\n * @example\n * ```ts\n * // This variant hides suggestion text for unknown input fields.\n * import { GraphQLInputObjectType, GraphQLString } from 'graphql/type';\n * import { validateInputValue } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * comment: { type: GraphQLString },\n * },\n * });\n * const errors = [];\n *\n * validateInputValue(\n * { rating: 'extra field' },\n * ReviewInput,\n * (error) => {\n * errors.push(error.message);\n * },\n * true,\n * );\n *\n * errors; // => ['Expected value of type \"ReviewInput\" not to include unknown field \"rating\", found: { rating: \"extra field\" }.']\n * ```\n */\nexport function validateInputValue(\n inputValue: unknown,\n type: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions?: Maybe,\n): void {\n return validateInputValueImpl(\n inputValue,\n type,\n onError,\n hideSuggestions,\n undefined,\n );\n}\n\nfunction validateInputValueImpl(\n inputValue: unknown,\n type: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n hideSuggestions: Maybe,\n path: Path | undefined,\n): void {\n if (isNonNullType(type)) {\n if (inputValue === undefined) {\n reportInvalidValue(\n onError,\n `Expected a value of non-null type \"${type}\" to be provided.`,\n path,\n );\n return;\n }\n if (inputValue === null) {\n reportInvalidValue(\n onError,\n `Expected value of non-null type \"${type}\" not to be null.`,\n path,\n );\n return;\n }\n return validateInputValueImpl(\n inputValue,\n type.ofType,\n onError,\n hideSuggestions,\n path,\n );\n }\n\n if (inputValue == null) {\n return;\n }\n\n if (isListType(type)) {\n if (!isIterableObject(inputValue)) {\n // Lists accept a non-list value as a list of one.\n validateInputValueImpl(\n inputValue,\n type.ofType,\n onError,\n hideSuggestions,\n path,\n );\n } else {\n let index = 0;\n for (const itemValue of inputValue) {\n validateInputValueImpl(\n itemValue,\n type.ofType,\n onError,\n hideSuggestions,\n addPath(path, index++, undefined),\n );\n }\n }\n } else if (isInputObjectType(type)) {\n if (!isObjectLike(inputValue) || Array.isArray(inputValue)) {\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\" to be an object, found: ${inspect(\n inputValue,\n )}.`,\n path,\n );\n return;\n }\n\n const fieldDefs = type.getFields();\n\n for (const field of Object.values(fieldDefs)) {\n const fieldValue = inputValue[field.name];\n if (fieldValue === undefined) {\n if (isRequiredInputField(field)) {\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\" to include required field \"${\n field.name\n }\", found: ${inspect(inputValue)}.`,\n path,\n );\n }\n } else {\n validateInputValueImpl(\n fieldValue,\n field.type,\n onError,\n hideSuggestions,\n addPath(path, field.name, type.name),\n );\n }\n }\n\n const fields: Array = [];\n // Ensure every provided field is defined.\n for (const fieldName of Object.keys(inputValue)) {\n if (inputValue[fieldName] === undefined) {\n continue;\n }\n if (!Object.hasOwn(fieldDefs, fieldName)) {\n const suggestion = hideSuggestions\n ? ''\n : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs)));\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\" not to include unknown field \"${fieldName}\"${\n suggestion ? `.${suggestion} Found` : ', found'\n }: ${inspect(inputValue)}.`,\n path,\n );\n continue;\n }\n fields.push(fieldName);\n }\n\n if (type.isOneOf) {\n if (fields.length !== 1) {\n reportInvalidValue(\n onError,\n getOneOfInputObjectErrorMessage(type),\n path,\n );\n }\n\n const field = fields[0];\n const value = inputValue[field];\n if (value === null) {\n reportInvalidValue(\n onError,\n getOneOfInputObjectErrorMessage(type),\n addPath(path, field, type.name),\n );\n }\n }\n } else {\n assertLeafType(type);\n\n let result;\n let caughtError: unknown;\n\n try {\n result = type.coerceInputValue(inputValue, hideSuggestions);\n } catch (error) {\n if (error instanceof GraphQLError) {\n onError(error, pathToArray(path));\n return;\n }\n caughtError = error;\n }\n\n if (result === undefined) {\n reportInvalidValue(\n onError,\n `Expected value of type \"${type}\"${\n caughtError != null\n ? `, but encountered error \"${getCaughtErrorMessage(caughtError)}\"; found`\n : ', found'\n }: ${inspect(inputValue)}.`,\n path,\n ensureGraphQLError(caughtError),\n );\n }\n }\n}\n\nfunction reportInvalidValue(\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n message: string,\n path: Path | undefined,\n originalError?: GraphQLError,\n): void {\n onError(new GraphQLError(message, { originalError }), pathToArray(path));\n}\n\n/**\n * Validate that the provided input literal is allowed for this type, collecting\n * all errors via a callback function.\n *\n * If variable values are not provided, the literal is validated statically\n * (not assuming that those variables are missing runtime values).\n * @param valueNode - GraphQL value AST node to validate.\n * @param type - GraphQL input type to validate the literal against.\n * @param onError - Callback invoked for each validation error and path.\n * @param variables - Operation variable values returned by getVariableValues.\n * @param fragmentVariableValues - Fragment variable values for the current fragment scope.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @returns Nothing.\n * @example\n * ```ts\n * // Validate literal input values and collect literal paths.\n * import { parseValue } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLNonNull,\n * } from 'graphql/type';\n * import { validateInputLiteral } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * },\n * });\n * const errors = [];\n *\n * validateInputLiteral(\n * parseValue('{ stars: \"bad\" }'),\n * ReviewInput,\n * (error, path) => {\n * errors.push({ message: error.message, path });\n * },\n * );\n *\n * errors; // => [ { message: 'Expected value of type \"Int\", found: \"bad\".', path: ['stars'] } ]\n * ```\n * @example\n * ```ts\n * // This variant resolves variable references using VariableValues from getVariableValues().\n * import assert from 'node:assert';\n * import { parse, parseValue } from 'graphql/language';\n * import { GraphQLInt } from 'graphql/type';\n * import { getVariableValues } from 'graphql/execution';\n * import { buildSchema, validateInputLiteral } from 'graphql/utilities';\n *\n * const schema = buildSchema(`\n * type Query {\n * review(stars: Int): String\n * }\n * `);\n * const document = parse('query ($stars: Int = 5) { review(stars: $stars) }');\n * const operation = document.definitions[0];\n * const result = getVariableValues(schema, operation.variableDefinitions, {\n * stars: '4',\n * });\n *\n * assert('variableValues' in result);\n *\n * const errors = [];\n * validateInputLiteral(\n * parseValue('$stars'),\n * GraphQLInt,\n * (error) => errors.push(error.message),\n * result.variableValues,\n * undefined,\n * true,\n * );\n *\n * errors; // => []\n * ```\n */\n// eslint-disable-next-line max-params\nexport function validateInputLiteral(\n valueNode: ValueNode,\n type: GraphQLInputType,\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n variables?: Maybe,\n fragmentVariableValues?: Maybe,\n hideSuggestions?: Maybe,\n): void {\n const context: ValidationContext = {\n static: !variables && !fragmentVariableValues,\n onError,\n variables,\n fragmentVariableValues,\n };\n return validateInputLiteralImpl(\n context,\n valueNode,\n type,\n hideSuggestions,\n undefined,\n );\n}\n\ninterface ValidationContext {\n static: boolean;\n onError: (error: GraphQLError, path: ReadonlyArray) => void;\n variables?: Maybe;\n fragmentVariableValues?: Maybe;\n}\n\nfunction validateInputLiteralImpl(\n context: ValidationContext,\n valueNode: ValueNode,\n type: GraphQLInputType,\n hideSuggestions: Maybe,\n path: Path | undefined,\n): void {\n if (valueNode.kind === Kind.VARIABLE) {\n if (context.static) {\n // If no variable values are provided, this is being validated statically,\n // and cannot yet produce any validation errors for variables.\n return;\n }\n const scopedVariableValues = getScopedVariableValues(context, valueNode);\n const value = scopedVariableValues?.coerced[valueNode.name.value];\n if (isNonNullType(type)) {\n if (value === undefined) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${valueNode.name.value}\" provided to type \"${type}\" to provide a runtime value.`,\n valueNode,\n path,\n );\n } else if (value === null) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${valueNode.name.value}\" provided to non-null type \"${type}\" not to be null.`,\n valueNode,\n path,\n );\n }\n }\n // Note: This does no further checking that this variable is correct.\n // This assumes this variable usage has already been validated.\n return;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of non-null type \"${type}\" not to be null.`,\n valueNode,\n path,\n );\n return;\n }\n return validateInputLiteralImpl(\n context,\n valueNode,\n type.ofType,\n hideSuggestions,\n path,\n );\n }\n\n if (valueNode.kind === Kind.NULL) {\n return;\n }\n\n if (isListType(type)) {\n if (valueNode.kind !== Kind.LIST) {\n // Lists accept a non-list value as a list of one.\n validateInputLiteralImpl(\n context,\n valueNode,\n type.ofType,\n hideSuggestions,\n path,\n );\n } else {\n let index = 0;\n for (const itemNode of valueNode.values) {\n validateInputLiteralImpl(\n context,\n itemNode,\n type.ofType,\n hideSuggestions,\n addPath(path, index++, undefined),\n );\n }\n }\n } else if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\" to be an object, found: ${print(\n valueNode,\n )}.`,\n valueNode,\n path,\n );\n return;\n }\n\n const fieldDefs = type.getFields();\n const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value);\n\n for (const field of Object.values(fieldDefs)) {\n const fieldNode = fieldNodes[field.name];\n if (fieldNode === undefined) {\n if (isRequiredInputField(field)) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\" to include required field \"${\n field.name\n }\", found: ${print(valueNode)}.`,\n valueNode,\n path,\n );\n }\n } else {\n const fieldValueNode = fieldNode.value;\n if (fieldValueNode.kind === Kind.VARIABLE && !context.static) {\n const scopedVariableValues = getScopedVariableValues(\n context,\n fieldValueNode,\n );\n const variableName = fieldValueNode.name.value;\n const value = scopedVariableValues?.coerced[variableName];\n if (type.isOneOf) {\n if (value === undefined) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${variableName}\" provided to field \"${field.name}\" for OneOf Input Object type \"${type}\" to provide a runtime value.`,\n valueNode,\n path,\n );\n } else if (value === null) {\n reportInvalidLiteral(\n context.onError,\n `Expected variable \"$${variableName}\" provided to field \"${field.name}\" for OneOf Input Object type \"${type}\" not to be null.`,\n valueNode,\n path,\n );\n }\n } else if (value === undefined && !isRequiredInputField(field)) {\n continue;\n }\n }\n\n validateInputLiteralImpl(\n context,\n fieldValueNode,\n field.type,\n hideSuggestions,\n addPath(path, field.name, type.name),\n );\n }\n }\n\n const fields = valueNode.fields;\n const knownFields: Array<(typeof fields)[number]> = [];\n // Ensure every provided field is defined.\n for (const fieldNode of fields) {\n const fieldName = fieldNode.name.value;\n if (!Object.hasOwn(fieldDefs, fieldName)) {\n const suggestion = hideSuggestions\n ? ''\n : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs)));\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\" not to include unknown field \"${fieldName}\"${\n suggestion ? `.${suggestion} Found` : ', found'\n }: ${print(valueNode)}.`,\n fieldNode,\n path,\n );\n } else {\n knownFields.push(fieldNode);\n }\n }\n\n if (type.isOneOf) {\n const isNotExactlyOneField = knownFields.length !== 1;\n if (isNotExactlyOneField) {\n reportInvalidLiteral(\n context.onError,\n getOneOfInputObjectErrorMessage(type),\n valueNode,\n path,\n );\n return;\n }\n\n const fieldValueNode = knownFields[0].value;\n if (fieldValueNode.kind === Kind.NULL) {\n const fieldName = knownFields[0].name.value;\n reportInvalidLiteral(\n context.onError,\n getOneOfInputObjectErrorMessage(type),\n valueNode,\n addPath(path, fieldName, undefined),\n );\n }\n }\n } else {\n assertLeafType(type);\n\n let result;\n let caughtError: unknown;\n try {\n result = type.coerceInputLiteral\n ? type.coerceInputLiteral(\n replaceVariables(\n valueNode,\n context.variables,\n context.fragmentVariableValues,\n ),\n hideSuggestions,\n )\n : type.parseLiteral(valueNode, undefined, hideSuggestions);\n } catch (error) {\n if (error instanceof GraphQLError) {\n context.onError(error, pathToArray(path));\n return;\n }\n caughtError = error;\n }\n\n if (result === undefined) {\n reportInvalidLiteral(\n context.onError,\n `Expected value of type \"${type}\"${\n caughtError != null\n ? `, but encountered error \"${getCaughtErrorMessage(caughtError)}\"; found`\n : ', found'\n }: ${print(valueNode)}.`,\n valueNode,\n path,\n ensureGraphQLError(caughtError),\n );\n }\n }\n}\n\nfunction getScopedVariableValues(\n context: ValidationContext,\n valueNode: VariableNode,\n): Maybe {\n const variableName = valueNode.name.value;\n const { fragmentVariableValues, variables } = context;\n return fragmentVariableValues?.sources[variableName]\n ? fragmentVariableValues\n : variables;\n}\n\nfunction reportInvalidLiteral(\n onError: (error: GraphQLError, path: ReadonlyArray) => void,\n message: string,\n valueNode: ASTNode,\n path: Path | undefined,\n originalError?: GraphQLError,\n): void {\n onError(\n new GraphQLError(message, {\n nodes: valueNode,\n originalError,\n }),\n pathToArray(path),\n );\n}\n\nfunction getCaughtErrorMessage(caughtError: unknown): string {\n if (isObjectLike(caughtError)) {\n const message = caughtError.message;\n if (typeof message === 'string' && message !== '') {\n return message;\n }\n }\n\n return String(caughtError);\n}\n\nfunction getOneOfInputObjectErrorMessage(type: GraphQLInputType): string {\n return `Within OneOf Input Object type \"${type}\", exactly one field must be specified, and the value for that field must be non-null.`;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.mts new file mode 100644 index 00000000..396f8e98 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.mts @@ -0,0 +1,67 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { ValueNode } from "../language/ast.mjs"; +import type { GraphQLInputType } from "../type/definition.mjs"; +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * This deprecated function will be removed in v18. Use `coerceInputLiteral()` + * instead. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Unknown | + * | NullValue | null | + * @param valueNode - GraphQL value AST node to convert. + * @param type - The GraphQL type to inspect. + * @param variables - Optional runtime variable values keyed by variable name. + * @returns The coerced JavaScript value, or undefined if the AST value cannot be coerced to the type. + * @example + * ```ts + * // Coerce literal values without variables. + * import { parseValue } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { valueFromAST } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * valueFromAST(parseValue('{ stars: 5, tags: ["featured"] }'), ReviewInput); // => { stars: 5, tags: ['featured'] } + * valueFromAST(parseValue('{ stars: "bad" }'), ReviewInput); // => undefined + * ``` + * @example + * ```ts + * // This variant resolves variable references from runtime values. + * import { parseValue } from 'graphql/language'; + * import { GraphQLInt } from 'graphql/type'; + * import { valueFromAST } from 'graphql/utilities'; + * + * valueFromAST(parseValue('$stars'), GraphQLInt, { stars: 5 }); // => 5 + * valueFromAST(parseValue('$stars'), GraphQLInt, {}); // => undefined + * ``` + * @deprecated use `coerceInputLiteral()` instead - will be removed in v18 + */ +export declare function valueFromAST(valueNode: Maybe, type: GraphQLInputType, variables?: Maybe>): unknown; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.ts new file mode 100644 index 00000000..7306cc9d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.d.ts @@ -0,0 +1,67 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { ValueNode } from "../language/ast.js"; +import type { GraphQLInputType } from "../type/definition.js"; +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * This deprecated function will be removed in v18. Use `coerceInputLiteral()` + * instead. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Unknown | + * | NullValue | null | + * @param valueNode - GraphQL value AST node to convert. + * @param type - The GraphQL type to inspect. + * @param variables - Optional runtime variable values keyed by variable name. + * @returns The coerced JavaScript value, or undefined if the AST value cannot be coerced to the type. + * @example + * ```ts + * // Coerce literal values without variables. + * import { parseValue } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { valueFromAST } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * valueFromAST(parseValue('{ stars: 5, tags: ["featured"] }'), ReviewInput); // => { stars: 5, tags: ['featured'] } + * valueFromAST(parseValue('{ stars: "bad" }'), ReviewInput); // => undefined + * ``` + * @example + * ```ts + * // This variant resolves variable references from runtime values. + * import { parseValue } from 'graphql/language'; + * import { GraphQLInt } from 'graphql/type'; + * import { valueFromAST } from 'graphql/utilities'; + * + * valueFromAST(parseValue('$stars'), GraphQLInt, { stars: 5 }); // => 5 + * valueFromAST(parseValue('$stars'), GraphQLInt, {}); // => undefined + * ``` + * @deprecated use `coerceInputLiteral()` instead - will be removed in v18 + */ +export declare function valueFromAST(valueNode: Maybe, type: GraphQLInputType, variables?: Maybe>): unknown; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js new file mode 100644 index 00000000..4c7e9f16 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.valueFromAST = valueFromAST; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const invariant_ts_1 = require("../jsutils/invariant.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +function valueFromAST(valueNode, type, variables) { + if (!valueNode) { + return; + } + if (valueNode.kind === kinds_ts_1.Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (variables == null || !Object.hasOwn(variables, variableName)) { + return; + } + const variableValue = variables[variableName]; + if (variableValue === undefined) { + return; + } + if (variableValue === null && (0, definition_ts_1.isNonNullType)(type)) { + return; + } + return variableValue; + } + if ((0, definition_ts_1.isNonNullType)(type)) { + if (valueNode.kind === kinds_ts_1.Kind.NULL) { + return; + } + return valueFromAST(valueNode, type.ofType, variables); + } + if (valueNode.kind === kinds_ts_1.Kind.NULL) { + return null; + } + if ((0, definition_ts_1.isListType)(type)) { + const itemType = type.ofType; + if (valueNode.kind === kinds_ts_1.Kind.LIST) { + const coercedValues = []; + for (const itemNode of valueNode.values) { + if (isMissingVariable(itemNode, variables)) { + if ((0, definition_ts_1.isNonNullType)(itemType)) { + return; + } + coercedValues.push(null); + } + else { + const itemValue = valueFromAST(itemNode, itemType, variables); + if (itemValue === undefined) { + return; + } + coercedValues.push(itemValue); + } + } + return coercedValues; + } + const coercedValue = valueFromAST(valueNode, itemType, variables); + if (coercedValue === undefined) { + return; + } + return [coercedValue]; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + if (valueNode.kind !== kinds_ts_1.Kind.OBJECT) { + return; + } + const coercedObj = Object.create(null); + const fieldDefs = type.getFields(); + const hasUnknownField = valueNode.fields.some((field) => !Object.hasOwn(fieldDefs, field.name.value)); + if (hasUnknownField) { + return; + } + const fieldNodes = new Map(valueNode.fields.map((field) => [field.name.value, field])); + for (const field of Object.values(fieldDefs)) { + const fieldNode = fieldNodes.get(field.name); + if (fieldNode == null || isMissingVariable(fieldNode.value, variables)) { + if (field.defaultValue !== undefined) { + coercedObj[field.name] = field.defaultValue; + } + else if ((0, definition_ts_1.isNonNullType)(field.type)) { + return; + } + continue; + } + const fieldValue = valueFromAST(fieldNode.value, field.type, variables); + if (fieldValue === undefined) { + return; + } + coercedObj[field.name] = fieldValue; + } + if (type.isOneOf) { + const coercedKeys = Object.keys(coercedObj); + if (fieldNodes.size !== 1 || coercedKeys.length !== 1) { + return; + } + for (const [fieldName, fieldNode] of fieldNodes) { + if (fieldNode.value.kind === kinds_ts_1.Kind.NULL || + coercedObj[fieldName] === null) { + return; + } + } + } + return coercedObj; + } + if ((0, definition_ts_1.isLeafType)(type)) { + let result; + try { + result = type.parseLiteral(valueNode, variables); + } + catch (_error) { + return; + } + if (result === undefined) { + return; + } + return result; + } + (0, invariant_ts_1.invariant)(false, 'Unexpected input type: ' + (0, inspect_ts_1.inspect)(type)); +} +function isMissingVariable(valueNode, variables) { + return (valueNode.kind === kinds_ts_1.Kind.VARIABLE && + (variables?.[valueNode.name.value] === undefined || + !Object.hasOwn(variables, valueNode.name.value))); +} +//# sourceMappingURL=valueFromAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js.map new file mode 100644 index 00000000..6b720aca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.js.map @@ -0,0 +1 @@ +{"version":3,"file":"valueFromAST.js","sourceRoot":"","sources":["../../src/utilities/valueFromAST.ts"],"names":[],"mappings":";;AA+EA,oCA6IC;AA1ND,sDAAgD;AAChD,0DAAoD;AAKpD,mDAA4C;AAG5C,yDAK+B;AA+D/B,SAAgB,YAAY,CAC1B,SAA2B,EAC3B,IAAsB,EACtB,SAAkC;IAElC,IAAI,CAAC,SAAS,EAAE,CAAC;QAGf,OAAO;IACT,CAAC;IAED,IAAI,SAAS,CAAC,IAAI,KAAK,eAAI,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;QAC1C,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,CAAC;YAEjE,OAAO;QACT,CAAC;QACD,MAAM,aAAa,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;QAC9C,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAEhC,OAAO;QACT,CAAC;QACD,IAAI,aAAa,KAAK,IAAI,IAA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AAA,oBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,CAAC;AAID,SAAS,iBAAiB,CACxB,SAAoB,EACpB,SAAiC;IAEjC,OAAO,CACL,SAAS,CAAC,IAAI,KAAK,eAAI,CAAC,QAAQ;QAChC,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS;YAC9C,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CACnD,CAAC;AACJ,CAAC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { ValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.ts';\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n *\n * This deprecated function will be removed in v18. Use `coerceInputLiteral()`\n * instead.\n *\n * | GraphQL Value | JSON Value |\n * | -------------------- | ------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Number |\n * | Enum Value | Unknown |\n * | NullValue | null |\n * @param valueNode - GraphQL value AST node to convert.\n * @param type - The GraphQL type to inspect.\n * @param variables - Optional runtime variable values keyed by variable name.\n * @returns The coerced JavaScript value, or undefined if the AST value cannot be coerced to the type.\n * @example\n * ```ts\n * // Coerce literal values without variables.\n * import { parseValue } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { valueFromAST } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * valueFromAST(parseValue('{ stars: 5, tags: [\"featured\"] }'), ReviewInput); // => { stars: 5, tags: ['featured'] }\n * valueFromAST(parseValue('{ stars: \"bad\" }'), ReviewInput); // => undefined\n * ```\n * @example\n * ```ts\n * // This variant resolves variable references from runtime values.\n * import { parseValue } from 'graphql/language';\n * import { GraphQLInt } from 'graphql/type';\n * import { valueFromAST } from 'graphql/utilities';\n *\n * valueFromAST(parseValue('$stars'), GraphQLInt, { stars: 5 }); // => 5\n * valueFromAST(parseValue('$stars'), GraphQLInt, {}); // => undefined\n * ```\n * @deprecated use `coerceInputLiteral()` instead - will be removed in v18\n */\nexport function valueFromAST(\n valueNode: Maybe,\n type: GraphQLInputType,\n variables?: Maybe>,\n): unknown {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n if (variables == null || !Object.hasOwn(variables, variableName)) {\n // No valid return value.\n return;\n }\n const variableValue = variables[variableName];\n if (variableValue === undefined) {\n // No valid return value.\n return;\n }\n if (variableValue === null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n }\n // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n return variableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (isListType(type)) {\n const itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n const coercedValues = [];\n for (const itemNode of valueNode.values) {\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (isNonNullType(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(null);\n } else {\n const itemValue = valueFromAST(itemNode, itemType, variables);\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n }\n return coercedValues;\n }\n const coercedValue = valueFromAST(valueNode, itemType, variables);\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedValue];\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n const coercedObj = Object.create(null);\n const fieldDefs = type.getFields();\n const hasUnknownField = valueNode.fields.some(\n (field) => !Object.hasOwn(fieldDefs, field.name.value),\n );\n if (hasUnknownField) {\n return; // Invalid: intentionally return no value.\n }\n const fieldNodes = new Map(\n valueNode.fields.map((field) => [field.name.value, field]),\n );\n for (const field of Object.values(fieldDefs)) {\n const fieldNode = fieldNodes.get(field.name);\n if (fieldNode == null || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n continue;\n }\n const fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedObj[field.name] = fieldValue;\n }\n\n if (type.isOneOf) {\n const coercedKeys = Object.keys(coercedObj);\n if (fieldNodes.size !== 1 || coercedKeys.length !== 1) {\n return; // Invalid: not exactly one key, intentionally return no value.\n }\n\n for (const [fieldName, fieldNode] of fieldNodes) {\n if (\n fieldNode.value.kind === Kind.NULL ||\n coercedObj[fieldName] === null\n ) {\n return; // Invalid: value not non-null, intentionally return no value.\n }\n }\n }\n\n return coercedObj;\n }\n\n if (isLeafType(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n let result;\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return result;\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible input types have been considered.\n invariant(false, 'Unexpected input type: ' + inspect(type));\n}\n\n// Returns true if the provided valueNode is a variable which is not defined\n// in the set of variables.\nfunction isMissingVariable(\n valueNode: ValueNode,\n variables: Maybe>,\n): boolean {\n return (\n valueNode.kind === Kind.VARIABLE &&\n (variables?.[valueNode.name.value] === undefined ||\n !Object.hasOwn(variables, valueNode.name.value))\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs new file mode 100644 index 00000000..67db4f21 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs @@ -0,0 +1,121 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { invariant } from "../jsutils/invariant.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { isInputObjectType, isLeafType, isListType, isNonNullType, } from "../type/definition.mjs"; +export function valueFromAST(valueNode, type, variables) { + if (!valueNode) { + return; + } + if (valueNode.kind === Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (variables == null || !Object.hasOwn(variables, variableName)) { + return; + } + const variableValue = variables[variableName]; + if (variableValue === undefined) { + return; + } + if (variableValue === null && isNonNullType(type)) { + return; + } + return variableValue; + } + if (isNonNullType(type)) { + if (valueNode.kind === Kind.NULL) { + return; + } + return valueFromAST(valueNode, type.ofType, variables); + } + if (valueNode.kind === Kind.NULL) { + return null; + } + if (isListType(type)) { + const itemType = type.ofType; + if (valueNode.kind === Kind.LIST) { + const coercedValues = []; + for (const itemNode of valueNode.values) { + if (isMissingVariable(itemNode, variables)) { + if (isNonNullType(itemType)) { + return; + } + coercedValues.push(null); + } + else { + const itemValue = valueFromAST(itemNode, itemType, variables); + if (itemValue === undefined) { + return; + } + coercedValues.push(itemValue); + } + } + return coercedValues; + } + const coercedValue = valueFromAST(valueNode, itemType, variables); + if (coercedValue === undefined) { + return; + } + return [coercedValue]; + } + if (isInputObjectType(type)) { + if (valueNode.kind !== Kind.OBJECT) { + return; + } + const coercedObj = Object.create(null); + const fieldDefs = type.getFields(); + const hasUnknownField = valueNode.fields.some((field) => !Object.hasOwn(fieldDefs, field.name.value)); + if (hasUnknownField) { + return; + } + const fieldNodes = new Map(valueNode.fields.map((field) => [field.name.value, field])); + for (const field of Object.values(fieldDefs)) { + const fieldNode = fieldNodes.get(field.name); + if (fieldNode == null || isMissingVariable(fieldNode.value, variables)) { + if (field.defaultValue !== undefined) { + coercedObj[field.name] = field.defaultValue; + } + else if (isNonNullType(field.type)) { + return; + } + continue; + } + const fieldValue = valueFromAST(fieldNode.value, field.type, variables); + if (fieldValue === undefined) { + return; + } + coercedObj[field.name] = fieldValue; + } + if (type.isOneOf) { + const coercedKeys = Object.keys(coercedObj); + if (fieldNodes.size !== 1 || coercedKeys.length !== 1) { + return; + } + for (const [fieldName, fieldNode] of fieldNodes) { + if (fieldNode.value.kind === Kind.NULL || + coercedObj[fieldName] === null) { + return; + } + } + } + return coercedObj; + } + if (isLeafType(type)) { + let result; + try { + result = type.parseLiteral(valueNode, variables); + } + catch (_error) { + return; + } + if (result === undefined) { + return; + } + return result; + } + invariant(false, 'Unexpected input type: ' + inspect(type)); +} +function isMissingVariable(valueNode, variables) { + return (valueNode.kind === Kind.VARIABLE && + (variables?.[valueNode.name.value] === undefined || + !Object.hasOwn(variables, valueNode.name.value))); +} +//# sourceMappingURL=valueFromAST.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs.map new file mode 100644 index 00000000..f18e8a6a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromAST.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"valueFromAST.js","sourceRoot":"","sources":["../../src/utilities/valueFromAST.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,+BAA8B;AAChD,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAKpD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAG5C,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,aAAa,GACd,+BAA8B;AA+D/B,MAAM,UAAU,YAAY,CAC1B,SAA2B,EAC3B,IAAsB,EACtB,SAAkC;IAElC,IAAI,CAAC,SAAS,EAAE,CAAC;QAGf,OAAO;IACT,CAAC;IAED,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;QAC1C,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,CAAC;YAEjE,OAAO;QACT,CAAC;QACD,MAAM,aAAa,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;QAC9C,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAEhC,OAAO;QACT,CAAC;QACD,IAAI,aAAa,KAAK,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAClD,OAAO;QACT,CAAC;QAID,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YACjC,OAAO;QACT,CAAC;QACD,OAAO,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAA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AC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { invariant } from '../jsutils/invariant.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { ValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.ts';\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n *\n * This deprecated function will be removed in v18. Use `coerceInputLiteral()`\n * instead.\n *\n * | GraphQL Value | JSON Value |\n * | -------------------- | ------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Number |\n * | Enum Value | Unknown |\n * | NullValue | null |\n * @param valueNode - GraphQL value AST node to convert.\n * @param type - The GraphQL type to inspect.\n * @param variables - Optional runtime variable values keyed by variable name.\n * @returns The coerced JavaScript value, or undefined if the AST value cannot be coerced to the type.\n * @example\n * ```ts\n * // Coerce literal values without variables.\n * import { parseValue } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { valueFromAST } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * valueFromAST(parseValue('{ stars: 5, tags: [\"featured\"] }'), ReviewInput); // => { stars: 5, tags: ['featured'] }\n * valueFromAST(parseValue('{ stars: \"bad\" }'), ReviewInput); // => undefined\n * ```\n * @example\n * ```ts\n * // This variant resolves variable references from runtime values.\n * import { parseValue } from 'graphql/language';\n * import { GraphQLInt } from 'graphql/type';\n * import { valueFromAST } from 'graphql/utilities';\n *\n * valueFromAST(parseValue('$stars'), GraphQLInt, { stars: 5 }); // => 5\n * valueFromAST(parseValue('$stars'), GraphQLInt, {}); // => undefined\n * ```\n * @deprecated use `coerceInputLiteral()` instead - will be removed in v18\n */\nexport function valueFromAST(\n valueNode: Maybe,\n type: GraphQLInputType,\n variables?: Maybe>,\n): unknown {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n if (variables == null || !Object.hasOwn(variables, variableName)) {\n // No valid return value.\n return;\n }\n const variableValue = variables[variableName];\n if (variableValue === undefined) {\n // No valid return value.\n return;\n }\n if (variableValue === null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n }\n // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n return variableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (isListType(type)) {\n const itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n const coercedValues = [];\n for (const itemNode of valueNode.values) {\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (isNonNullType(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(null);\n } else {\n const itemValue = valueFromAST(itemNode, itemType, variables);\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n }\n return coercedValues;\n }\n const coercedValue = valueFromAST(valueNode, itemType, variables);\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedValue];\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n const coercedObj = Object.create(null);\n const fieldDefs = type.getFields();\n const hasUnknownField = valueNode.fields.some(\n (field) => !Object.hasOwn(fieldDefs, field.name.value),\n );\n if (hasUnknownField) {\n return; // Invalid: intentionally return no value.\n }\n const fieldNodes = new Map(\n valueNode.fields.map((field) => [field.name.value, field]),\n );\n for (const field of Object.values(fieldDefs)) {\n const fieldNode = fieldNodes.get(field.name);\n if (fieldNode == null || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n continue;\n }\n const fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n coercedObj[field.name] = fieldValue;\n }\n\n if (type.isOneOf) {\n const coercedKeys = Object.keys(coercedObj);\n if (fieldNodes.size !== 1 || coercedKeys.length !== 1) {\n return; // Invalid: not exactly one key, intentionally return no value.\n }\n\n for (const [fieldName, fieldNode] of fieldNodes) {\n if (\n fieldNode.value.kind === Kind.NULL ||\n coercedObj[fieldName] === null\n ) {\n return; // Invalid: value not non-null, intentionally return no value.\n }\n }\n }\n\n return coercedObj;\n }\n\n if (isLeafType(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n let result;\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n return result;\n /* node:coverage ignore next 4 */\n }\n // Not reachable, all possible input types have been considered.\n invariant(false, 'Unexpected input type: ' + inspect(type));\n}\n\n// Returns true if the provided valueNode is a variable which is not defined\n// in the set of variables.\nfunction isMissingVariable(\n valueNode: ValueNode,\n variables: Maybe>,\n): boolean {\n return (\n valueNode.kind === Kind.VARIABLE &&\n (variables?.[valueNode.name.value] === undefined ||\n !Object.hasOwn(variables, valueNode.name.value))\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.mts new file mode 100644 index 00000000..36057680 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.mts @@ -0,0 +1,33 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { ObjMap } from "../jsutils/ObjMap.mjs"; +import type { ValueNode } from "../language/ast.mjs"; +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Because no GraphQL type is provided, the returned JavaScript value reflects + * the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * @param valueNode - GraphQL value AST node to convert. + * @param variables - Optional runtime variable values keyed by variable name. + * @returns JavaScript value represented by the GraphQL value AST. + * @example + * ```ts + * import { parseValue } from 'graphql/language'; + * import { valueFromASTUntyped } from 'graphql/utilities'; + * + * const value = valueFromASTUntyped(parseValue('[1, 2, 3]')); + * + * value; // => [1, 2, 3] + * valueFromASTUntyped(parseValue('$name'), { name: 'Ada' }); // => 'Ada' + * ``` + */ +export declare function valueFromASTUntyped(valueNode: ValueNode, variables?: Maybe>): unknown; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.ts new file mode 100644 index 00000000..a9d8639f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.d.ts @@ -0,0 +1,33 @@ +/** @category Values */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { ObjMap } from "../jsutils/ObjMap.js"; +import type { ValueNode } from "../language/ast.js"; +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Because no GraphQL type is provided, the returned JavaScript value reflects + * the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * @param valueNode - GraphQL value AST node to convert. + * @param variables - Optional runtime variable values keyed by variable name. + * @returns JavaScript value represented by the GraphQL value AST. + * @example + * ```ts + * import { parseValue } from 'graphql/language'; + * import { valueFromASTUntyped } from 'graphql/utilities'; + * + * const value = valueFromASTUntyped(parseValue('[1, 2, 3]')); + * + * value; // => [1, 2, 3] + * valueFromASTUntyped(parseValue('$name'), { name: 'Ada' }); // => 'Ada' + * ``` + */ +export declare function valueFromASTUntyped(valueNode: ValueNode, variables?: Maybe>): unknown; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js new file mode 100644 index 00000000..6567030c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.valueFromASTUntyped = valueFromASTUntyped; +const keyValMap_ts_1 = require("../jsutils/keyValMap.js"); +const kinds_ts_1 = require("../language/kinds.js"); +function valueFromASTUntyped(valueNode, variables) { + switch (valueNode.kind) { + case kinds_ts_1.Kind.NULL: + return null; + case kinds_ts_1.Kind.INT: + return parseInt(valueNode.value, 10); + case kinds_ts_1.Kind.FLOAT: + return parseFloat(valueNode.value); + case kinds_ts_1.Kind.STRING: + case kinds_ts_1.Kind.ENUM: + case kinds_ts_1.Kind.BOOLEAN: + return valueNode.value; + case kinds_ts_1.Kind.LIST: + return valueNode.values.map((node) => valueFromASTUntyped(node, variables)); + case kinds_ts_1.Kind.OBJECT: + return (0, keyValMap_ts_1.keyValMap)(valueNode.fields, (field) => field.name.value, (field) => valueFromASTUntyped(field.value, variables)); + case kinds_ts_1.Kind.VARIABLE: + return variables?.[valueNode.name.value]; + } +} +//# sourceMappingURL=valueFromASTUntyped.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js.map new file mode 100644 index 00000000..1e447ae6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.js.map @@ -0,0 +1 @@ +{"version":3,"file":"valueFromASTUntyped.js","sourceRoot":"","sources":["../../src/utilities/valueFromASTUntyped.ts"],"names":[],"mappings":";;AAqCA,kDA4BC;AA/DD,0DAAoD;AAKpD,mDAA4C;AA8B5C,SAAgB,mBAAmB,CACjC,SAAoB,EACpB,SAAkC;IAElC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,eAAI,CAAC,IAAI;YACZ,OAAO,IAAI,CAAC;QACd,KAAK,eAAI,CAAC,GAAG;YACX,OAAO,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvC,KAAK,eAAI,CAAC,KAAK;YACb,OAAO,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,eAAI,CAAC,MAAM,CAAC;QACjB,KAAK,eAAI,CAAC,IAAI,CAAC;QACf,KAAK,eAAI,CAAC,OAAO;YACf,OAAO,SAAS,CAAC,KAAK,CAAC;QACzB,KAAK,eAAI,CAAC,IAAI;YACZ,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACnC,mBAAmB,CAAC,IAAI,EAAE,SAAS,CAAC,CACrC,CAAC;QACJ,KAAK,eAAI,CAAC,MAAM;YACd,OAAO,IAAA,wBAAS,EACd,SAAS,CAAC,MAAM,EAChB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CACvD,CAAC;QACJ,KAAK,eAAI,CAAC,QAAQ;YAChB,OAAO,SAAS,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport { keyValMap } from '../jsutils/keyValMap.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { ValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Because no GraphQL type is provided, the returned JavaScript value reflects\n * the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n * @param valueNode - GraphQL value AST node to convert.\n * @param variables - Optional runtime variable values keyed by variable name.\n * @returns JavaScript value represented by the GraphQL value AST.\n * @example\n * ```ts\n * import { parseValue } from 'graphql/language';\n * import { valueFromASTUntyped } from 'graphql/utilities';\n *\n * const value = valueFromASTUntyped(parseValue('[1, 2, 3]'));\n *\n * value; // => [1, 2, 3]\n * valueFromASTUntyped(parseValue('$name'), { name: 'Ada' }); // => 'Ada'\n * ```\n */\nexport function valueFromASTUntyped(\n valueNode: ValueNode,\n variables?: Maybe>,\n): unknown {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n case Kind.LIST:\n return valueNode.values.map((node) =>\n valueFromASTUntyped(node, variables),\n );\n case Kind.OBJECT:\n return keyValMap(\n valueNode.fields,\n (field) => field.name.value,\n (field) => valueFromASTUntyped(field.value, variables),\n );\n case Kind.VARIABLE:\n return variables?.[valueNode.name.value];\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs new file mode 100644 index 00000000..380345f3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs @@ -0,0 +1,23 @@ +import { keyValMap } from "../jsutils/keyValMap.mjs"; +import { Kind } from "../language/kinds.mjs"; +export function valueFromASTUntyped(valueNode, variables) { + switch (valueNode.kind) { + case Kind.NULL: + return null; + case Kind.INT: + return parseInt(valueNode.value, 10); + case Kind.FLOAT: + return parseFloat(valueNode.value); + case Kind.STRING: + case Kind.ENUM: + case Kind.BOOLEAN: + return valueNode.value; + case Kind.LIST: + return valueNode.values.map((node) => valueFromASTUntyped(node, variables)); + case Kind.OBJECT: + return keyValMap(valueNode.fields, (field) => field.name.value, (field) => valueFromASTUntyped(field.value, variables)); + case Kind.VARIABLE: + return variables?.[valueNode.name.value]; + } +} +//# sourceMappingURL=valueFromASTUntyped.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs.map new file mode 100644 index 00000000..004bffba --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueFromASTUntyped.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"valueFromASTUntyped.js","sourceRoot":"","sources":["../../src/utilities/valueFromASTUntyped.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAAgC;AAKpD,OAAO,EAAE,IAAI,EAAE,8BAA6B;AA8B5C,MAAM,UAAU,mBAAmB,CACjC,SAAoB,EACpB,SAAkC;IAElC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO,IAAI,CAAC;QACd,KAAK,IAAI,CAAC,GAAG;YACX,OAAO,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvC,KAAK,IAAI,CAAC,KAAK;YACb,OAAO,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,IAAI,CAAC,MAAM,CAAC;QACjB,KAAK,IAAI,CAAC,IAAI,CAAC;QACf,KAAK,IAAI,CAAC,OAAO;YACf,OAAO,SAAS,CAAC,KAAK,CAAC;QACzB,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACnC,mBAAmB,CAAC,IAAI,EAAE,SAAS,CAAC,CACrC,CAAC;QACJ,KAAK,IAAI,CAAC,MAAM;YACd,OAAO,SAAS,CACd,SAAS,CAAC,MAAM,EAChB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CACvD,CAAC;QACJ,KAAK,IAAI,CAAC,QAAQ;YAChB,OAAO,SAAS,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC","sourcesContent":["/** @category Values */\n\nimport { keyValMap } from '../jsutils/keyValMap.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { ValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Because no GraphQL type is provided, the returned JavaScript value reflects\n * the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n * @param valueNode - GraphQL value AST node to convert.\n * @param variables - Optional runtime variable values keyed by variable name.\n * @returns JavaScript value represented by the GraphQL value AST.\n * @example\n * ```ts\n * import { parseValue } from 'graphql/language';\n * import { valueFromASTUntyped } from 'graphql/utilities';\n *\n * const value = valueFromASTUntyped(parseValue('[1, 2, 3]'));\n *\n * value; // => [1, 2, 3]\n * valueFromASTUntyped(parseValue('$name'), { name: 'Ada' }); // => 'Ada'\n * ```\n */\nexport function valueFromASTUntyped(\n valueNode: ValueNode,\n variables?: Maybe>,\n): unknown {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n case Kind.LIST:\n return valueNode.values.map((node) =>\n valueFromASTUntyped(node, variables),\n );\n case Kind.OBJECT:\n return keyValMap(\n valueNode.fields,\n (field) => field.name.value,\n (field) => valueFromASTUntyped(field.value, variables),\n );\n case Kind.VARIABLE:\n return variables?.[valueNode.name.value];\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.mts new file mode 100644 index 00000000..e9cec1aa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.mts @@ -0,0 +1,60 @@ +/** @category Values */ +import type { ConstValueNode } from "../language/ast.mjs"; +import type { GraphQLInputType } from "../type/definition.mjs"; +/** + * Produces a GraphQL Value AST given a JavaScript value and a GraphQL type. + * + * Scalar types are converted by calling the `valueToLiteral` method on that + * type, otherwise the default scalar `valueToLiteral` method is used, defined + * below. + * + * Provided value is a non-coerced "input" value. This function does not + * perform any coercion, however it does perform validation. Provided values + * which are invalid for the given type will result in an `undefined` return + * value. + * @param value - JavaScript value to convert. + * @param type - GraphQL input type to convert the value against. + * @returns A GraphQL value AST, or undefined if the value is invalid. + * @example + * ```ts + * import { print } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { valueToLiteral } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * const literal = valueToLiteral({ stars: 5, tags: ['featured'] }, ReviewInput); + * + * print(literal); // => '{ stars: 5, tags: ["featured"] }' + * valueToLiteral({ tags: ['missing stars'] }, ReviewInput); // => undefined + * ``` + */ +export declare function valueToLiteral(value: unknown, type: GraphQLInputType): ConstValueNode | undefined; +/** + * The default implementation to convert scalar values to literals. + * + * | JavaScript Value | GraphQL Value | + * | ----------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String | + * | Number | Int / Float | + * | BigInt | Int | + * | null / undefined | Null | + * + * @internal + */ +export declare function defaultScalarValueToLiteral(value: unknown): ConstValueNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.ts new file mode 100644 index 00000000..083f55c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.d.ts @@ -0,0 +1,60 @@ +/** @category Values */ +import type { ConstValueNode } from "../language/ast.js"; +import type { GraphQLInputType } from "../type/definition.js"; +/** + * Produces a GraphQL Value AST given a JavaScript value and a GraphQL type. + * + * Scalar types are converted by calling the `valueToLiteral` method on that + * type, otherwise the default scalar `valueToLiteral` method is used, defined + * below. + * + * Provided value is a non-coerced "input" value. This function does not + * perform any coercion, however it does perform validation. Provided values + * which are invalid for the given type will result in an `undefined` return + * value. + * @param value - JavaScript value to convert. + * @param type - GraphQL input type to convert the value against. + * @returns A GraphQL value AST, or undefined if the value is invalid. + * @example + * ```ts + * import { print } from 'graphql/language'; + * import { + * GraphQLInputObjectType, + * GraphQLInt, + * GraphQLList, + * GraphQLNonNull, + * GraphQLString, + * } from 'graphql/type'; + * import { valueToLiteral } from 'graphql/utilities'; + * + * const ReviewInput = new GraphQLInputObjectType({ + * name: 'ReviewInput', + * fields: { + * stars: { type: new GraphQLNonNull(GraphQLInt) }, + * tags: { type: new GraphQLList(GraphQLString) }, + * }, + * }); + * + * const literal = valueToLiteral({ stars: 5, tags: ['featured'] }, ReviewInput); + * + * print(literal); // => '{ stars: 5, tags: ["featured"] }' + * valueToLiteral({ tags: ['missing stars'] }, ReviewInput); // => undefined + * ``` + */ +export declare function valueToLiteral(value: unknown, type: GraphQLInputType): ConstValueNode | undefined; +/** + * The default implementation to convert scalar values to literals. + * + * | JavaScript Value | GraphQL Value | + * | ----------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String | + * | Number | Int / Float | + * | BigInt | Int | + * | null / undefined | Null | + * + * @internal + */ +export declare function defaultScalarValueToLiteral(value: unknown): ConstValueNode; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js new file mode 100644 index 00000000..f9fefffd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.valueToLiteral = valueToLiteral; +exports.defaultScalarValueToLiteral = defaultScalarValueToLiteral; +const inspect_ts_1 = require("../jsutils/inspect.js"); +const isIterableObject_ts_1 = require("../jsutils/isIterableObject.js"); +const isObjectLike_ts_1 = require("../jsutils/isObjectLike.js"); +const kinds_ts_1 = require("../language/kinds.js"); +const definition_ts_1 = require("../type/definition.js"); +function valueToLiteral(value, type) { + if ((0, definition_ts_1.isNonNullType)(type)) { + if (value == null) { + return; + } + return valueToLiteral(value, type.ofType); + } + if (value == null) { + return { kind: kinds_ts_1.Kind.NULL }; + } + if ((0, definition_ts_1.isListType)(type)) { + if (!(0, isIterableObject_ts_1.isIterableObject)(value)) { + return valueToLiteral(value, type.ofType); + } + const values = []; + for (const itemValue of value) { + const itemNode = valueToLiteral(itemValue, type.ofType); + if (!itemNode) { + return; + } + values.push(itemNode); + } + return { kind: kinds_ts_1.Kind.LIST, values }; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + if (!(0, isObjectLike_ts_1.isObjectLike)(value)) { + return; + } + const fields = []; + const fieldDefs = type.getFields(); + const hasUndefinedField = Object.keys(value).some((name) => value[name] !== undefined && !Object.hasOwn(fieldDefs, name)); + if (hasUndefinedField) { + return; + } + for (const field of Object.values(type.getFields())) { + const fieldValue = value[field.name]; + if (fieldValue === undefined) { + if ((0, definition_ts_1.isRequiredInputField)(field)) { + return; + } + } + else { + const fieldNode = valueToLiteral(value[field.name], field.type); + if (!fieldNode) { + return; + } + fields.push({ + kind: kinds_ts_1.Kind.OBJECT_FIELD, + name: { kind: kinds_ts_1.Kind.NAME, value: field.name }, + value: fieldNode, + }); + } + } + return { kind: kinds_ts_1.Kind.OBJECT, fields }; + } + const leafType = (0, definition_ts_1.assertLeafType)(type); + if (leafType.valueToLiteral) { + try { + return leafType.valueToLiteral(value); + } + catch (_error) { + return; + } + } + return defaultScalarValueToLiteral(value); +} +function defaultScalarValueToLiteral(value) { + if (value == null) { + return { kind: kinds_ts_1.Kind.NULL }; + } + switch (typeof value) { + case 'boolean': + return { kind: kinds_ts_1.Kind.BOOLEAN, value }; + case 'string': + return { kind: kinds_ts_1.Kind.STRING, value, block: false }; + case 'bigint': + return { kind: kinds_ts_1.Kind.INT, value: value.toString() }; + case 'number': { + if (!Number.isFinite(value)) { + return { kind: kinds_ts_1.Kind.NULL }; + } + const stringValue = String(value); + return /^-?(?:0|[1-9][0-9]*)$/.test(stringValue) + ? { kind: kinds_ts_1.Kind.INT, value: stringValue } + : { kind: kinds_ts_1.Kind.FLOAT, value: stringValue }; + } + case 'object': { + if ((0, isIterableObject_ts_1.isIterableObject)(value)) { + return { + kind: kinds_ts_1.Kind.LIST, + values: Array.from(value, defaultScalarValueToLiteral), + }; + } + const objValue = value; + const fields = []; + for (const fieldName of Object.keys(objValue)) { + const fieldValue = objValue[fieldName]; + if (fieldValue !== undefined) { + fields.push({ + kind: kinds_ts_1.Kind.OBJECT_FIELD, + name: { kind: kinds_ts_1.Kind.NAME, value: fieldName }, + value: defaultScalarValueToLiteral(fieldValue), + }); + } + } + return { kind: kinds_ts_1.Kind.OBJECT, fields }; + } + } + throw new TypeError(`Cannot convert value to AST: ${(0, inspect_ts_1.inspect)(value)}.`); +} +//# sourceMappingURL=valueToLiteral.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js.map new file mode 100644 index 00000000..20aee19a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.js.map @@ -0,0 +1 @@ +{"version":3,"file":"valueToLiteral.js","sourceRoot":"","sources":["../../src/utilities/valueToLiteral.ts"],"names":[],"mappings":";;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,EAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,OAAO;oBACL,IAAI,EAAE,eAAI,CAAC,IAAI;oBACf,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,2BAA2B,CAAC;iBACvD,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,GAAG,KAAoC,CAAC;YACtD,MAAM,MAAM,GAAgC,EAAE,CAAC;YAC/C,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC9C,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;gBAEvC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;oBAC7B,MAAM,CAAC,IAAI,CAAC;wBACV,IAAI,EAAE,eAAI,CAAC,YAAY;wBACvB,IAAI,EAAE,EAAE,IAAI,EAAE,eAAI,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;wBAC3C,KAAK,EAAE,2BAA2B,CAAC,UAAU,CAAC;qBAC/C,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,eAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QACvC,CAAC;IACH,CAAC;IAED,MAAM,IAAI,SAAS,CAAC,gCAAgC,IAAA,oBAAO,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzE,CAAC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\n\nimport type { ConstObjectFieldNode, ConstValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n assertLeafType,\n isInputObjectType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../type/definition.ts';\n\n/**\n * Produces a GraphQL Value AST given a JavaScript value and a GraphQL type.\n *\n * Scalar types are converted by calling the `valueToLiteral` method on that\n * type, otherwise the default scalar `valueToLiteral` method is used, defined\n * below.\n *\n * Provided value is a non-coerced \"input\" value. This function does not\n * perform any coercion, however it does perform validation. Provided values\n * which are invalid for the given type will result in an `undefined` return\n * value.\n * @param value - JavaScript value to convert.\n * @param type - GraphQL input type to convert the value against.\n * @returns A GraphQL value AST, or undefined if the value is invalid.\n * @example\n * ```ts\n * import { print } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { valueToLiteral } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * const literal = valueToLiteral({ stars: 5, tags: ['featured'] }, ReviewInput);\n *\n * print(literal); // => '{ stars: 5, tags: [\"featured\"] }'\n * valueToLiteral({ tags: ['missing stars'] }, ReviewInput); // => undefined\n * ```\n */\nexport function valueToLiteral(\n value: unknown,\n type: GraphQLInputType,\n): ConstValueNode | undefined {\n if (isNonNullType(type)) {\n if (value == null) {\n return; // Invalid: intentionally return no value.\n }\n return valueToLiteral(value, type.ofType);\n }\n\n // Like JSON, a null literal is produced for both null and undefined.\n if (value == null) {\n return { kind: Kind.NULL };\n }\n\n if (isListType(type)) {\n if (!isIterableObject(value)) {\n return valueToLiteral(value, type.ofType);\n }\n const values: Array = [];\n for (const itemValue of value) {\n const itemNode = valueToLiteral(itemValue, type.ofType);\n if (!itemNode) {\n return; // Invalid: intentionally return no value.\n }\n values.push(itemNode);\n }\n return { kind: Kind.LIST, values };\n }\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return; // Invalid: intentionally return no value.\n }\n const fields: Array = [];\n const fieldDefs = type.getFields();\n const hasUndefinedField = Object.keys(value).some(\n (name) => value[name] !== undefined && !Object.hasOwn(fieldDefs, name),\n );\n if (hasUndefinedField) {\n return; // Invalid: intentionally return no value.\n }\n for (const field of Object.values(type.getFields())) {\n const fieldValue = value[field.name];\n if (fieldValue === undefined) {\n if (isRequiredInputField(field)) {\n return; // Invalid: intentionally return no value.\n }\n } else {\n const fieldNode = valueToLiteral(value[field.name], field.type);\n if (!fieldNode) {\n return; // Invalid: intentionally return no value.\n }\n fields.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: field.name },\n value: fieldNode,\n });\n }\n }\n return { kind: Kind.OBJECT, fields };\n }\n\n const leafType = assertLeafType(type);\n\n if (leafType.valueToLiteral) {\n try {\n return leafType.valueToLiteral(value);\n } catch (_error) {\n return; // Invalid: intentionally ignore error and return no value.\n }\n }\n\n return defaultScalarValueToLiteral(value);\n}\n\n/**\n * The default implementation to convert scalar values to literals.\n *\n * | JavaScript Value | GraphQL Value |\n * | ----------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String |\n * | Number | Int / Float |\n * | BigInt | Int |\n * | null / undefined | Null |\n *\n * @internal\n */\nexport function defaultScalarValueToLiteral(value: unknown): ConstValueNode {\n // Like JSON, a null literal is produced for both null and undefined.\n if (value == null) {\n return { kind: Kind.NULL };\n }\n\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n switch (typeof value) {\n case 'boolean':\n return { kind: Kind.BOOLEAN, value };\n case 'string':\n return { kind: Kind.STRING, value, block: false };\n case 'bigint':\n return { kind: Kind.INT, value: value.toString() };\n case 'number': {\n if (!Number.isFinite(value)) {\n // Like JSON, a null literal is produced for non-finite values.\n return { kind: Kind.NULL };\n }\n const stringValue = String(value);\n // Will parse as an IntValue.\n return /^-?(?:0|[1-9][0-9]*)$/.test(stringValue)\n ? { kind: Kind.INT, value: stringValue }\n : { kind: Kind.FLOAT, value: stringValue };\n }\n case 'object': {\n if (isIterableObject(value)) {\n return {\n kind: Kind.LIST,\n values: Array.from(value, defaultScalarValueToLiteral),\n };\n }\n const objValue = value as { [prop: string]: unknown };\n const fields: Array = [];\n for (const fieldName of Object.keys(objValue)) {\n const fieldValue = objValue[fieldName];\n // Like JSON, undefined fields are not included in the literal result.\n if (fieldValue !== undefined) {\n fields.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: defaultScalarValueToLiteral(fieldValue),\n });\n }\n }\n return { kind: Kind.OBJECT, fields };\n }\n }\n\n throw new TypeError(`Cannot convert value to AST: ${inspect(value)}.`);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs new file mode 100644 index 00000000..90d56339 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs @@ -0,0 +1,116 @@ +import { inspect } from "../jsutils/inspect.mjs"; +import { isIterableObject } from "../jsutils/isIterableObject.mjs"; +import { isObjectLike } from "../jsutils/isObjectLike.mjs"; +import { Kind } from "../language/kinds.mjs"; +import { assertLeafType, isInputObjectType, isListType, isNonNullType, isRequiredInputField, } from "../type/definition.mjs"; +export function valueToLiteral(value, type) { + if (isNonNullType(type)) { + if (value == null) { + return; + } + return valueToLiteral(value, type.ofType); + } + if (value == null) { + return { kind: Kind.NULL }; + } + if (isListType(type)) { + if (!isIterableObject(value)) { + return valueToLiteral(value, type.ofType); + } + const values = []; + for (const itemValue of value) { + const itemNode = valueToLiteral(itemValue, type.ofType); + if (!itemNode) { + return; + } + values.push(itemNode); + } + return { kind: Kind.LIST, values }; + } + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return; + } + const fields = []; + const fieldDefs = type.getFields(); + const hasUndefinedField = Object.keys(value).some((name) => value[name] !== undefined && !Object.hasOwn(fieldDefs, name)); + if (hasUndefinedField) { + return; + } + for (const field of Object.values(type.getFields())) { + const fieldValue = value[field.name]; + if (fieldValue === undefined) { + if (isRequiredInputField(field)) { + return; + } + } + else { + const fieldNode = valueToLiteral(value[field.name], field.type); + if (!fieldNode) { + return; + } + fields.push({ + kind: Kind.OBJECT_FIELD, + name: { kind: Kind.NAME, value: field.name }, + value: fieldNode, + }); + } + } + return { kind: Kind.OBJECT, fields }; + } + const leafType = assertLeafType(type); + if (leafType.valueToLiteral) { + try { + return leafType.valueToLiteral(value); + } + catch (_error) { + return; + } + } + return defaultScalarValueToLiteral(value); +} +export function defaultScalarValueToLiteral(value) { + if (value == null) { + return { kind: Kind.NULL }; + } + switch (typeof value) { + case 'boolean': + return { kind: Kind.BOOLEAN, value }; + case 'string': + return { kind: Kind.STRING, value, block: false }; + case 'bigint': + return { kind: Kind.INT, value: value.toString() }; + case 'number': { + if (!Number.isFinite(value)) { + return { kind: Kind.NULL }; + } + const stringValue = String(value); + return /^-?(?:0|[1-9][0-9]*)$/.test(stringValue) + ? { kind: Kind.INT, value: stringValue } + : { kind: Kind.FLOAT, value: stringValue }; + } + case 'object': { + if (isIterableObject(value)) { + return { + kind: Kind.LIST, + values: Array.from(value, defaultScalarValueToLiteral), + }; + } + const objValue = value; + const fields = []; + for (const fieldName of Object.keys(objValue)) { + const fieldValue = objValue[fieldName]; + if (fieldValue !== undefined) { + fields.push({ + kind: Kind.OBJECT_FIELD, + name: { kind: Kind.NAME, value: fieldName }, + value: defaultScalarValueToLiteral(fieldValue), + }); + } + } + return { kind: Kind.OBJECT, fields }; + } + } + throw new TypeError(`Cannot convert value to AST: ${inspect(value)}.`); +} +//# sourceMappingURL=valueToLiteral.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs.map new file mode 100644 index 00000000..fffb5674 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/utilities/valueToLiteral.mjs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AG,EAAE,KAAK,EAAE,WAAW,EAAE;gBACxC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAC/C,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,OAAO;oBACL,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,2BAA2B,CAAC;iBACvD,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,GAAG,KAAoC,CAAC;YACtD,MAAM,MAAM,GAAgC,EAAE,CAAC;YAC/C,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC9C,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;gBAEvC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;oBAC7B,MAAM,CAAC,IAAI,CAAC;wBACV,IAAI,EAAE,IAAI,CAAC,YAAY;wBACvB,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;wBAC3C,KAAK,EAAE,2BAA2B,CAAC,UAAU,CAAC;qBAC/C,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QACvC,CAAC;IACH,CAAC;IAED,MAAM,IAAI,SAAS,CAAC,gCAAgC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzE,CAAC","sourcesContent":["/** @category Values */\n\nimport { inspect } from '../jsutils/inspect.ts';\nimport { isIterableObject } from '../jsutils/isIterableObject.ts';\nimport { isObjectLike } from '../jsutils/isObjectLike.ts';\n\nimport type { ConstObjectFieldNode, ConstValueNode } from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\n\nimport type { GraphQLInputType } from '../type/definition.ts';\nimport {\n assertLeafType,\n isInputObjectType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../type/definition.ts';\n\n/**\n * Produces a GraphQL Value AST given a JavaScript value and a GraphQL type.\n *\n * Scalar types are converted by calling the `valueToLiteral` method on that\n * type, otherwise the default scalar `valueToLiteral` method is used, defined\n * below.\n *\n * Provided value is a non-coerced \"input\" value. This function does not\n * perform any coercion, however it does perform validation. Provided values\n * which are invalid for the given type will result in an `undefined` return\n * value.\n * @param value - JavaScript value to convert.\n * @param type - GraphQL input type to convert the value against.\n * @returns A GraphQL value AST, or undefined if the value is invalid.\n * @example\n * ```ts\n * import { print } from 'graphql/language';\n * import {\n * GraphQLInputObjectType,\n * GraphQLInt,\n * GraphQLList,\n * GraphQLNonNull,\n * GraphQLString,\n * } from 'graphql/type';\n * import { valueToLiteral } from 'graphql/utilities';\n *\n * const ReviewInput = new GraphQLInputObjectType({\n * name: 'ReviewInput',\n * fields: {\n * stars: { type: new GraphQLNonNull(GraphQLInt) },\n * tags: { type: new GraphQLList(GraphQLString) },\n * },\n * });\n *\n * const literal = valueToLiteral({ stars: 5, tags: ['featured'] }, ReviewInput);\n *\n * print(literal); // => '{ stars: 5, tags: [\"featured\"] }'\n * valueToLiteral({ tags: ['missing stars'] }, ReviewInput); // => undefined\n * ```\n */\nexport function valueToLiteral(\n value: unknown,\n type: GraphQLInputType,\n): ConstValueNode | undefined {\n if (isNonNullType(type)) {\n if (value == null) {\n return; // Invalid: intentionally return no value.\n }\n return valueToLiteral(value, type.ofType);\n }\n\n // Like JSON, a null literal is produced for both null and undefined.\n if (value == null) {\n return { kind: Kind.NULL };\n }\n\n if (isListType(type)) {\n if (!isIterableObject(value)) {\n return valueToLiteral(value, type.ofType);\n }\n const values: Array = [];\n for (const itemValue of value) {\n const itemNode = valueToLiteral(itemValue, type.ofType);\n if (!itemNode) {\n return; // Invalid: intentionally return no value.\n }\n values.push(itemNode);\n }\n return { kind: Kind.LIST, values };\n }\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return; // Invalid: intentionally return no value.\n }\n const fields: Array = [];\n const fieldDefs = type.getFields();\n const hasUndefinedField = Object.keys(value).some(\n (name) => value[name] !== undefined && !Object.hasOwn(fieldDefs, name),\n );\n if (hasUndefinedField) {\n return; // Invalid: intentionally return no value.\n }\n for (const field of Object.values(type.getFields())) {\n const fieldValue = value[field.name];\n if (fieldValue === undefined) {\n if (isRequiredInputField(field)) {\n return; // Invalid: intentionally return no value.\n }\n } else {\n const fieldNode = valueToLiteral(value[field.name], field.type);\n if (!fieldNode) {\n return; // Invalid: intentionally return no value.\n }\n fields.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: field.name },\n value: fieldNode,\n });\n }\n }\n return { kind: Kind.OBJECT, fields };\n }\n\n const leafType = assertLeafType(type);\n\n if (leafType.valueToLiteral) {\n try {\n return leafType.valueToLiteral(value);\n } catch (_error) {\n return; // Invalid: intentionally ignore error and return no value.\n }\n }\n\n return defaultScalarValueToLiteral(value);\n}\n\n/**\n * The default implementation to convert scalar values to literals.\n *\n * | JavaScript Value | GraphQL Value |\n * | ----------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String |\n * | Number | Int / Float |\n * | BigInt | Int |\n * | null / undefined | Null |\n *\n * @internal\n */\nexport function defaultScalarValueToLiteral(value: unknown): ConstValueNode {\n // Like JSON, a null literal is produced for both null and undefined.\n if (value == null) {\n return { kind: Kind.NULL };\n }\n\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n switch (typeof value) {\n case 'boolean':\n return { kind: Kind.BOOLEAN, value };\n case 'string':\n return { kind: Kind.STRING, value, block: false };\n case 'bigint':\n return { kind: Kind.INT, value: value.toString() };\n case 'number': {\n if (!Number.isFinite(value)) {\n // Like JSON, a null literal is produced for non-finite values.\n return { kind: Kind.NULL };\n }\n const stringValue = String(value);\n // Will parse as an IntValue.\n return /^-?(?:0|[1-9][0-9]*)$/.test(stringValue)\n ? { kind: Kind.INT, value: stringValue }\n : { kind: Kind.FLOAT, value: stringValue };\n }\n case 'object': {\n if (isIterableObject(value)) {\n return {\n kind: Kind.LIST,\n values: Array.from(value, defaultScalarValueToLiteral),\n };\n }\n const objValue = value as { [prop: string]: unknown };\n const fields: Array = [];\n for (const fieldName of Object.keys(objValue)) {\n const fieldValue = objValue[fieldName];\n // Like JSON, undefined fields are not included in the literal result.\n if (fieldValue !== undefined) {\n fields.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: defaultScalarValueToLiteral(fieldValue),\n });\n }\n }\n return { kind: Kind.OBJECT, fields };\n }\n }\n\n throw new TypeError(`Cannot convert value to AST: ${inspect(value)}.`);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.mts new file mode 100644 index 00000000..92090900 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.mts @@ -0,0 +1,560 @@ +/** @category Validation Context */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import type { GraphQLError } from "../error/GraphQLError.mjs"; +import type { DocumentNode, FragmentDefinitionNode, FragmentSpreadNode, OperationDefinitionNode, SelectionSetNode, VariableDefinitionNode, VariableNode } from "../language/ast.mjs"; +import type { ASTVisitor } from "../language/visitor.mjs"; +import type { GraphQLArgument, GraphQLCompositeType, GraphQLEnumValue, GraphQLField, GraphQLInputType, GraphQLOutputType } from "../type/definition.mjs"; +import type { GraphQLDirective } from "../type/directives.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { FragmentSignature } from "../utilities/TypeInfo.mjs"; +import { TypeInfo } from "../utilities/TypeInfo.mjs"; +type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +interface VariableUsage { + readonly node: VariableNode; + readonly type: Maybe; + readonly parentType: Maybe; + readonly defaultValue: unknown; + readonly fragmentVariableDefinition: Maybe; +} +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + * + * @internal + */ +export declare class ASTValidationContext { + private _ast; + private _onError; + private _fragments; + private _fragmentSpreads; + private _recursivelyReferencedFragments; + constructor(ast: DocumentNode, onError: (error: GraphQLError) => void); + get [Symbol.toStringTag](): string; + reportError(error: GraphQLError): void; + getDocument(): DocumentNode; + getFragment(name: string): Maybe; + getFragmentSpreads(node: SelectionSetNode): ReadonlyArray; + getRecursivelyReferencedFragments(operation: OperationDefinitionNode): ReadonlyArray; +} +/** @internal */ +export type ASTValidationRule = (context: ASTValidationContext) => ASTVisitor; +/** @internal */ +export declare class SDLValidationContext extends ASTValidationContext { + private _schema; + constructor(ast: DocumentNode, schema: Maybe, onError: (error: GraphQLError) => void); + get hideSuggestions(): boolean; + get [Symbol.toStringTag](): string; + getSchema(): Maybe; +} +/** @internal */ +export type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor; +/** Validation context passed to query validation rules. */ +export declare class ValidationContext extends ASTValidationContext { + private _schema; + private _typeInfo; + private _variableUsages; + private _recursiveVariableUsages; + private _hideSuggestions; + /** + * Creates a ValidationContext instance. + * @param schema - Schema used to validate the document. + * @param ast - Document AST being validated. + * @param typeInfo - TypeInfo instance used to track traversal state. + * @param onError - Callback invoked for each validation error. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const errors = []; + * const context = new ValidationContext( + * schema, + * document, + * new TypeInfo(schema), + * (error) => errors.push(error), + * ); + * + * context.reportError(new GraphQLError('Example validation error.')); + * + * context.getSchema(); // => schema + * errors[0].message; // => 'Example validation error.' + * ``` + */ + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo, onError: (error: GraphQLError) => void, hideSuggestions?: Maybe); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns whether validation error suggestions are hidden. + * @returns True when suggestion text should be omitted from errors. + */ + get hideSuggestions(): boolean; + /** + * Returns the schema being used by this validation context. + * @returns The schema being validated against. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const context = new ValidationContext( + * schema, + * parse('{ greeting }'), + * new TypeInfo(schema), + * () => {}, + * ); + * + * context.getSchema().getQueryType()?.name; // => 'Query' + * ``` + */ + getSchema(): GraphQLSchema; + /** + * Returns variable usages found directly within this node. + * @param node - The AST node to inspect or visit. + * @returns Variable usages found directly within this node. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const document = parse('query ($name: String) { greeting(name: $name) }'); + * const operation = document.definitions[0]; + * const context = new ValidationContext( + * schema, + * document, + * new TypeInfo(schema), + * () => {}, + * ); + * + * const usages = context.getVariableUsages(operation); + * + * usages[0].node.name.value; // => 'name' + * String(usages[0].type); // => 'String' + * ``` + */ + getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray; + /** + * Returns variable usages for an operation, including variables used by referenced fragments. + * @param operation - Operation definition to inspect. + * @returns Variable usages reachable from the operation. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * viewer: User + * } + * + * type User { + * name(prefix: String): String + * } + * `); + * const document = parse(` + * query ($prefix: String) { + * viewer { + * ...UserName + * } + * } + * + * fragment UserName on User { + * name(prefix: $prefix) + * } + * `); + * const operation = document.definitions[0]; + * const context = new ValidationContext( + * schema, + * document, + * new TypeInfo(schema), + * () => {}, + * ); + * + * const usages = context.getRecursiveVariableUsages(operation); + * + * usages.map((usage) => usage.node.name.value); // => ['prefix'] + * ``` + */ + getRecursiveVariableUsages(operation: OperationDefinitionNode): ReadonlyArray; + /** + * Returns the current output type at this point in traversal. + * @returns The current output type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let typeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * typeName = String(context.getType()); + * }, + * }), + * ); + * + * typeName; // => 'String' + * ``` + */ + getType(): Maybe; + /** + * Returns the current parent composite type. + * @returns The current parent composite type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let parentTypeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * parentTypeName = context.getParentType()?.name; + * }, + * }), + * ); + * + * parentTypeName; // => 'Query' + * ``` + */ + getParentType(): Maybe; + /** + * Returns the current input type at this point in traversal. + * @returns The current input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int): [String] + * } + * `); + * const document = parse('{ reviews(limit: 5) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let inputTypeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * inputTypeName = String(context.getInputType()); + * }, + * }), + * ); + * + * inputTypeName; // => 'Int' + * ``` + */ + getInputType(): Maybe; + /** + * Returns the parent input type for the current input position. + * @returns The parent input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * input ReviewFilter { + * stars: Int + * } + * + * type Query { + * reviews(filter: ReviewFilter): [String] + * } + * `); + * const document = parse('{ reviews(filter: { stars: 5 }) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let parentInputTypeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * ObjectField: () => { + * parentInputTypeName = String(context.getParentInputType()); + * }, + * }), + * ); + * + * parentInputTypeName; // => 'ReviewFilter' + * ``` + */ + getParentInputType(): Maybe; + /** + * Returns the current field definition. + * @returns The current field definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let fieldName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * fieldName = context.getFieldDef()?.name; + * }, + * }), + * ); + * + * fieldName; // => 'greeting' + * ``` + */ + getFieldDef(): Maybe>; + /** + * Returns the current directive definition. + * @returns The current directive definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting @include(if: true) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let directiveName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Directive: () => { + * directiveName = context.getDirective()?.name; + * }, + * }), + * ); + * + * directiveName; // => 'include' + * ``` + */ + getDirective(): Maybe; + /** + * Returns the current argument definition. + * @returns The current argument definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int): [String] + * } + * `); + * const document = parse('{ reviews(limit: 5) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let argumentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * argumentName = context.getArgument()?.name; + * }, + * }), + * ); + * + * argumentName; // => 'limit' + * ``` + */ + getArgument(): Maybe; + /** + * Returns the fragment signature at the current traversal position. + * @returns The current fragment signature, if one is active. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * FragmentSpread: () => { + * fragmentName = context.getFragmentSignature()?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignature(): Maybe; + /** + * Returns the function used to look up fragment signatures by name. + * @returns A function that maps fragment names to fragment signatures. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Document: () => { + * const getFragmentSignature = context.getFragmentSignatureByName(); + * fragmentName = + * getFragmentSignature('GreetingFields')?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignatureByName(): (fragmentName: string) => Maybe; + /** + * Returns the current enum value definition. + * @returns The current enum value definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * enum Sort { + * NEWEST + * OLDEST + * } + * + * type Query { + * reviews(sort: Sort): [String] + * } + * `); + * const document = parse('{ reviews(sort: OLDEST) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let enumValueName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * EnumValue: () => { + * enumValueName = context.getEnumValue()?.name; + * }, + * }), + * ); + * + * enumValueName; // => 'OLDEST' + * ``` + */ + getEnumValue(): Maybe; +} +/** A function that creates an AST visitor for validating a GraphQL document. */ +export type ValidationRule = (context: ValidationContext) => ASTVisitor; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.ts new file mode 100644 index 00000000..0fe10d57 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.d.ts @@ -0,0 +1,560 @@ +/** @category Validation Context */ +import type { Maybe } from "../jsutils/Maybe.js"; +import type { GraphQLError } from "../error/GraphQLError.js"; +import type { DocumentNode, FragmentDefinitionNode, FragmentSpreadNode, OperationDefinitionNode, SelectionSetNode, VariableDefinitionNode, VariableNode } from "../language/ast.js"; +import type { ASTVisitor } from "../language/visitor.js"; +import type { GraphQLArgument, GraphQLCompositeType, GraphQLEnumValue, GraphQLField, GraphQLInputType, GraphQLOutputType } from "../type/definition.js"; +import type { GraphQLDirective } from "../type/directives.js"; +import type { GraphQLSchema } from "../type/schema.js"; +import type { FragmentSignature } from "../utilities/TypeInfo.js"; +import { TypeInfo } from "../utilities/TypeInfo.js"; +type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +interface VariableUsage { + readonly node: VariableNode; + readonly type: Maybe; + readonly parentType: Maybe; + readonly defaultValue: unknown; + readonly fragmentVariableDefinition: Maybe; +} +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + * + * @internal + */ +export declare class ASTValidationContext { + private _ast; + private _onError; + private _fragments; + private _fragmentSpreads; + private _recursivelyReferencedFragments; + constructor(ast: DocumentNode, onError: (error: GraphQLError) => void); + get [Symbol.toStringTag](): string; + reportError(error: GraphQLError): void; + getDocument(): DocumentNode; + getFragment(name: string): Maybe; + getFragmentSpreads(node: SelectionSetNode): ReadonlyArray; + getRecursivelyReferencedFragments(operation: OperationDefinitionNode): ReadonlyArray; +} +/** @internal */ +export type ASTValidationRule = (context: ASTValidationContext) => ASTVisitor; +/** @internal */ +export declare class SDLValidationContext extends ASTValidationContext { + private _schema; + constructor(ast: DocumentNode, schema: Maybe, onError: (error: GraphQLError) => void); + get hideSuggestions(): boolean; + get [Symbol.toStringTag](): string; + getSchema(): Maybe; +} +/** @internal */ +export type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor; +/** Validation context passed to query validation rules. */ +export declare class ValidationContext extends ASTValidationContext { + private _schema; + private _typeInfo; + private _variableUsages; + private _recursiveVariableUsages; + private _hideSuggestions; + /** + * Creates a ValidationContext instance. + * @param schema - Schema used to validate the document. + * @param ast - Document AST being validated. + * @param typeInfo - TypeInfo instance used to track traversal state. + * @param onError - Callback invoked for each validation error. + * @param hideSuggestions - Whether suggestion text should be omitted from errors. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { GraphQLError } from 'graphql/error'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const errors = []; + * const context = new ValidationContext( + * schema, + * document, + * new TypeInfo(schema), + * (error) => errors.push(error), + * ); + * + * context.reportError(new GraphQLError('Example validation error.')); + * + * context.getSchema(); // => schema + * errors[0].message; // => 'Example validation error.' + * ``` + */ + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo, onError: (error: GraphQLError) => void, hideSuggestions?: Maybe); + /** + * Returns the value used by `Object.prototype.toString`. + * @returns The built-in string tag for this object. + */ + get [Symbol.toStringTag](): string; + /** + * Returns whether validation error suggestions are hidden. + * @returns True when suggestion text should be omitted from errors. + */ + get hideSuggestions(): boolean; + /** + * Returns the schema being used by this validation context. + * @returns The schema being validated against. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const context = new ValidationContext( + * schema, + * parse('{ greeting }'), + * new TypeInfo(schema), + * () => {}, + * ); + * + * context.getSchema().getQueryType()?.name; // => 'Query' + * ``` + */ + getSchema(): GraphQLSchema; + /** + * Returns variable usages found directly within this node. + * @param node - The AST node to inspect or visit. + * @returns Variable usages found directly within this node. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting(name: String): String + * } + * `); + * const document = parse('query ($name: String) { greeting(name: $name) }'); + * const operation = document.definitions[0]; + * const context = new ValidationContext( + * schema, + * document, + * new TypeInfo(schema), + * () => {}, + * ); + * + * const usages = context.getVariableUsages(operation); + * + * usages[0].node.name.value; // => 'name' + * String(usages[0].type); // => 'String' + * ``` + */ + getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray; + /** + * Returns variable usages for an operation, including variables used by referenced fragments. + * @param operation - Operation definition to inspect. + * @returns Variable usages reachable from the operation. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema, TypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * viewer: User + * } + * + * type User { + * name(prefix: String): String + * } + * `); + * const document = parse(` + * query ($prefix: String) { + * viewer { + * ...UserName + * } + * } + * + * fragment UserName on User { + * name(prefix: $prefix) + * } + * `); + * const operation = document.definitions[0]; + * const context = new ValidationContext( + * schema, + * document, + * new TypeInfo(schema), + * () => {}, + * ); + * + * const usages = context.getRecursiveVariableUsages(operation); + * + * usages.map((usage) => usage.node.name.value); // => ['prefix'] + * ``` + */ + getRecursiveVariableUsages(operation: OperationDefinitionNode): ReadonlyArray; + /** + * Returns the current output type at this point in traversal. + * @returns The current output type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let typeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * typeName = String(context.getType()); + * }, + * }), + * ); + * + * typeName; // => 'String' + * ``` + */ + getType(): Maybe; + /** + * Returns the current parent composite type. + * @returns The current parent composite type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let parentTypeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * parentTypeName = context.getParentType()?.name; + * }, + * }), + * ); + * + * parentTypeName; // => 'Query' + * ``` + */ + getParentType(): Maybe; + /** + * Returns the current input type at this point in traversal. + * @returns The current input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int): [String] + * } + * `); + * const document = parse('{ reviews(limit: 5) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let inputTypeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * inputTypeName = String(context.getInputType()); + * }, + * }), + * ); + * + * inputTypeName; // => 'Int' + * ``` + */ + getInputType(): Maybe; + /** + * Returns the parent input type for the current input position. + * @returns The parent input type, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * input ReviewFilter { + * stars: Int + * } + * + * type Query { + * reviews(filter: ReviewFilter): [String] + * } + * `); + * const document = parse('{ reviews(filter: { stars: 5 }) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let parentInputTypeName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * ObjectField: () => { + * parentInputTypeName = String(context.getParentInputType()); + * }, + * }), + * ); + * + * parentInputTypeName; // => 'ReviewFilter' + * ``` + */ + getParentInputType(): Maybe; + /** + * Returns the current field definition. + * @returns The current field definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let fieldName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Field: () => { + * fieldName = context.getFieldDef()?.name; + * }, + * }), + * ); + * + * fieldName; // => 'greeting' + * ``` + */ + getFieldDef(): Maybe>; + /** + * Returns the current directive definition. + * @returns The current directive definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ greeting @include(if: true) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let directiveName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Directive: () => { + * directiveName = context.getDirective()?.name; + * }, + * }), + * ); + * + * directiveName; // => 'include' + * ``` + */ + getDirective(): Maybe; + /** + * Returns the current argument definition. + * @returns The current argument definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * reviews(limit: Int): [String] + * } + * `); + * const document = parse('{ reviews(limit: 5) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let argumentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Argument: () => { + * argumentName = context.getArgument()?.name; + * }, + * }), + * ); + * + * argumentName; // => 'limit' + * ``` + */ + getArgument(): Maybe; + /** + * Returns the fragment signature at the current traversal position. + * @returns The current fragment signature, if one is active. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * FragmentSpread: () => { + * fragmentName = context.getFragmentSignature()?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignature(): Maybe; + /** + * Returns the function used to look up fragment signatures by name. + * @returns A function that maps fragment names to fragment signatures. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse( + * ` + * { + * ...GreetingFields + * } + * + * fragment GreetingFields on Query { + * greeting + * } + * `, + * { experimentalFragmentArguments: true }, + * ); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let fragmentName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * Document: () => { + * const getFragmentSignature = context.getFragmentSignatureByName(); + * fragmentName = + * getFragmentSignature('GreetingFields')?.definition.name.value; + * }, + * }), + * ); + * + * fragmentName; // => 'GreetingFields' + * ``` + */ + getFragmentSignatureByName(): (fragmentName: string) => Maybe; + /** + * Returns the current enum value definition. + * @returns The current enum value definition, if known. + * @example + * ```ts + * import { parse, visit } from 'graphql/language'; + * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities'; + * import { ValidationContext } from 'graphql/validation'; + * + * const schema = buildSchema(` + * enum Sort { + * NEWEST + * OLDEST + * } + * + * type Query { + * reviews(sort: Sort): [String] + * } + * `); + * const document = parse('{ reviews(sort: OLDEST) }'); + * const typeInfo = new TypeInfo(schema); + * const context = new ValidationContext(schema, document, typeInfo, () => {}); + * let enumValueName; + * + * visit( + * document, + * visitWithTypeInfo(typeInfo, { + * EnumValue: () => { + * enumValueName = context.getEnumValue()?.name; + * }, + * }), + * ); + * + * enumValueName; // => 'OLDEST' + * ``` + */ + getEnumValue(): Maybe; +} +/** A function that creates an AST visitor for validating a GraphQL document. */ +export type ValidationRule = (context: ValidationContext) => ASTVisitor; +export {}; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js new file mode 100644 index 00000000..3465d600 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js @@ -0,0 +1,201 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValidationContext = exports.SDLValidationContext = exports.ASTValidationContext = void 0; +const kinds_ts_1 = require("../language/kinds.js"); +const visitor_ts_1 = require("../language/visitor.js"); +const TypeInfo_ts_1 = require("../utilities/TypeInfo.js"); +class ASTValidationContext { + constructor(ast, onError) { + this._ast = ast; + this._fragments = undefined; + this._fragmentSpreads = new Map(); + this._recursivelyReferencedFragments = new Map(); + this._onError = onError; + } + get [Symbol.toStringTag]() { + return 'ASTValidationContext'; + } + reportError(error) { + this._onError(error); + } + getDocument() { + return this._ast; + } + getFragment(name) { + let fragments; + if (this._fragments) { + fragments = this._fragments; + } + else { + fragments = Object.create(null); + for (const defNode of this.getDocument().definitions) { + if (defNode.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION) { + fragments[defNode.name.value] = defNode; + } + } + this._fragments = fragments; + } + return fragments[name]; + } + getFragmentSpreads(node) { + let spreads = this._fragmentSpreads.get(node); + if (!spreads) { + spreads = []; + const setsToVisit = [node]; + let set; + while ((set = setsToVisit.pop())) { + for (const selection of set.selections) { + if (selection.kind === kinds_ts_1.Kind.FRAGMENT_SPREAD) { + spreads.push(selection); + } + else if (selection.selectionSet) { + setsToVisit.push(selection.selectionSet); + } + } + } + this._fragmentSpreads.set(node, spreads); + } + return spreads; + } + getRecursivelyReferencedFragments(operation) { + let fragments = this._recursivelyReferencedFragments.get(operation); + if (!fragments) { + fragments = []; + const collectedNames = new Set(); + const nodesToVisit = [operation.selectionSet]; + let node; + while ((node = nodesToVisit.pop())) { + for (const spread of this.getFragmentSpreads(node)) { + const fragName = spread.name.value; + if (!collectedNames.has(fragName)) { + collectedNames.add(fragName); + const fragment = this.getFragment(fragName); + if (fragment) { + fragments.push(fragment); + nodesToVisit.push(fragment.selectionSet); + } + } + } + } + this._recursivelyReferencedFragments.set(operation, fragments); + } + return fragments; + } +} +exports.ASTValidationContext = ASTValidationContext; +class SDLValidationContext extends ASTValidationContext { + constructor(ast, schema, onError) { + super(ast, onError); + this._schema = schema; + } + get hideSuggestions() { + return false; + } + get [Symbol.toStringTag]() { + return 'SDLValidationContext'; + } + getSchema() { + return this._schema; + } +} +exports.SDLValidationContext = SDLValidationContext; +class ValidationContext extends ASTValidationContext { + constructor(schema, ast, typeInfo, onError, hideSuggestions) { + super(ast, onError); + this._schema = schema; + this._typeInfo = typeInfo; + this._variableUsages = new Map(); + this._recursiveVariableUsages = new Map(); + this._hideSuggestions = hideSuggestions ?? false; + } + get [Symbol.toStringTag]() { + return 'ValidationContext'; + } + get hideSuggestions() { + return this._hideSuggestions; + } + getSchema() { + return this._schema; + } + getVariableUsages(node) { + let usages = this._variableUsages.get(node); + if (!usages) { + const newUsages = []; + const typeInfo = new TypeInfo_ts_1.TypeInfo(this._schema, undefined, this._typeInfo.getFragmentSignatureByName()); + const fragmentDefinition = node.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION ? node : undefined; + (0, visitor_ts_1.visit)(node, (0, TypeInfo_ts_1.visitWithTypeInfo)(typeInfo, { + VariableDefinition: () => false, + Variable(variable) { + let fragmentVariableDefinition; + if (fragmentDefinition) { + const fragmentSignature = typeInfo.getFragmentSignatureByName()(fragmentDefinition.name.value); + fragmentVariableDefinition = + fragmentSignature?.variableDefinitions.get(variable.name.value); + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + parentType: typeInfo.getParentInputType(), + defaultValue: undefined, + fragmentVariableDefinition, + }); + } + else { + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + parentType: typeInfo.getParentInputType(), + defaultValue: typeInfo.getDefaultValue(), + fragmentVariableDefinition: undefined, + }); + } + }, + })); + usages = newUsages; + this._variableUsages.set(node, usages); + } + return usages; + } + getRecursiveVariableUsages(operation) { + let usages = this._recursiveVariableUsages.get(operation); + if (!usages) { + usages = this.getVariableUsages(operation); + for (const frag of this.getRecursivelyReferencedFragments(operation)) { + usages = usages.concat(this.getVariableUsages(frag)); + } + this._recursiveVariableUsages.set(operation, usages); + } + return usages; + } + getType() { + return this._typeInfo.getType(); + } + getParentType() { + return this._typeInfo.getParentType(); + } + getInputType() { + return this._typeInfo.getInputType(); + } + getParentInputType() { + return this._typeInfo.getParentInputType(); + } + getFieldDef() { + return this._typeInfo.getFieldDef(); + } + getDirective() { + return this._typeInfo.getDirective(); + } + getArgument() { + return this._typeInfo.getArgument(); + } + getFragmentSignature() { + return this._typeInfo.getFragmentSignature(); + } + getFragmentSignatureByName() { + return this._typeInfo.getFragmentSignatureByName(); + } + getEnumValue() { + return this._typeInfo.getEnumValue(); + } +} +exports.ValidationContext = ValidationContext; +//# sourceMappingURL=ValidationContext.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js.map new file mode 100644 index 00000000..2524203e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ValidationContext.js","sourceRoot":"","sources":["../../src/validation/ValidationContext.ts"],"names":[],"mappings":";;;AAgBA,mDAA4C;AAE5C,uDAA+C;AAc/C,0DAAuE;AAkBvE,MAAa,oBAAoB;IAU/B,YAAY,GAAiB,EAAE,OAAsC;QACnE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,+BAA+B,GAAG,IAAI,GAAG,EAAE,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,sBAAsB,CAAC;IAChC,CAAC;IAED,WAAW,CAAC,KAAmB;QAC7B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,IAAI,SAAyC,CAAC;QAC9C,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAChC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,CAAC,SAAS,CAAC,CAAC;YAC3C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,iCAAiC,CAAC,SAAS,CAAC,EAAE,CAAC;gBACrE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;YACvD,CAAC;YACD,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAiCD,OAAO;QACL,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;IAiCD,aAAa;QACX,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC;IAiCD,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;IACvC,CAAC;IAuCD,kBAAkB;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC;IAiCD,WAAW;QACT,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAiCD,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;IACvC,CAAC;IAiCD,WAAW;QACT,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IA4CD,oBAAoB;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC;IAC/C,CAAC;IA8CD,0BAA0B;QAGxB,OAAO,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,CAAC;IACrD,CAAC;IAsCD,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;IACvC,CAAC;CACF;AArnBD,8CAqnBC","sourcesContent":["/** @category Validation Context */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n DocumentNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n OperationDefinitionNode,\n SelectionSetNode,\n VariableDefinitionNode,\n VariableNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport type { ASTVisitor } from '../language/visitor.ts';\nimport { visit } from '../language/visitor.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLCompositeType,\n GraphQLEnumValue,\n GraphQLField,\n GraphQLInputType,\n GraphQLOutputType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type { FragmentSignature } from '../utilities/TypeInfo.ts';\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.ts';\n\ntype NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;\ninterface VariableUsage {\n readonly node: VariableNode;\n readonly type: Maybe;\n readonly parentType: Maybe;\n readonly defaultValue: unknown;\n readonly fragmentVariableDefinition: Maybe;\n}\n\n/**\n * An instance of this class is passed as the \"this\" context to all validators,\n * allowing access to commonly useful contextual information from within a\n * validation rule.\n *\n * @internal\n */\nexport class ASTValidationContext {\n private _ast: DocumentNode;\n private _onError: (error: GraphQLError) => void;\n private _fragments: ObjMap | undefined;\n private _fragmentSpreads: Map>;\n private _recursivelyReferencedFragments: Map<\n OperationDefinitionNode,\n Array\n >;\n\n constructor(ast: DocumentNode, onError: (error: GraphQLError) => void) {\n this._ast = ast;\n this._fragments = undefined;\n this._fragmentSpreads = new Map();\n this._recursivelyReferencedFragments = new Map();\n this._onError = onError;\n }\n\n get [Symbol.toStringTag](): string {\n return 'ASTValidationContext';\n }\n\n reportError(error: GraphQLError): void {\n this._onError(error);\n }\n\n getDocument(): DocumentNode {\n return this._ast;\n }\n\n getFragment(name: string): Maybe {\n let fragments: ObjMap;\n if (this._fragments) {\n fragments = this._fragments;\n } else {\n fragments = Object.create(null);\n for (const defNode of this.getDocument().definitions) {\n if (defNode.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[defNode.name.value] = defNode;\n }\n }\n this._fragments = fragments;\n }\n return fragments[name];\n }\n\n getFragmentSpreads(\n node: SelectionSetNode,\n ): ReadonlyArray {\n let spreads = this._fragmentSpreads.get(node);\n if (!spreads) {\n spreads = [];\n const setsToVisit: Array = [node];\n let set: SelectionSetNode | undefined;\n while ((set = setsToVisit.pop())) {\n for (const selection of set.selections) {\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n spreads.push(selection);\n } else if (selection.selectionSet) {\n setsToVisit.push(selection.selectionSet);\n }\n }\n }\n this._fragmentSpreads.set(node, spreads);\n }\n return spreads;\n }\n\n getRecursivelyReferencedFragments(\n operation: OperationDefinitionNode,\n ): ReadonlyArray {\n let fragments = this._recursivelyReferencedFragments.get(operation);\n if (!fragments) {\n fragments = [];\n const collectedNames = new Set();\n const nodesToVisit: Array = [operation.selectionSet];\n let node: SelectionSetNode | undefined;\n while ((node = nodesToVisit.pop())) {\n for (const spread of this.getFragmentSpreads(node)) {\n const fragName = spread.name.value;\n if (!collectedNames.has(fragName)) {\n collectedNames.add(fragName);\n const fragment = this.getFragment(fragName);\n if (fragment) {\n fragments.push(fragment);\n nodesToVisit.push(fragment.selectionSet);\n }\n }\n }\n }\n this._recursivelyReferencedFragments.set(operation, fragments);\n }\n return fragments;\n }\n}\n\n/** @internal */\nexport type ASTValidationRule = (context: ASTValidationContext) => ASTVisitor;\n\n/** @internal */\nexport class SDLValidationContext extends ASTValidationContext {\n private _schema: Maybe;\n\n constructor(\n ast: DocumentNode,\n schema: Maybe,\n onError: (error: GraphQLError) => void,\n ) {\n super(ast, onError);\n this._schema = schema;\n }\n\n get hideSuggestions(): boolean {\n return false;\n }\n\n override get [Symbol.toStringTag](): string {\n return 'SDLValidationContext';\n }\n\n getSchema(): Maybe {\n return this._schema;\n }\n}\n\n/** @internal */\nexport type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor;\n\n/** Validation context passed to query validation rules. */\nexport class ValidationContext extends ASTValidationContext {\n private _schema: GraphQLSchema;\n private _typeInfo: TypeInfo;\n private _variableUsages: Map<\n NodeWithSelectionSet,\n ReadonlyArray\n >;\n\n private _recursiveVariableUsages: Map<\n OperationDefinitionNode,\n ReadonlyArray\n >;\n private _hideSuggestions: boolean;\n\n /**\n * Creates a ValidationContext instance.\n * @param schema - Schema used to validate the document.\n * @param ast - Document AST being validated.\n * @param typeInfo - TypeInfo instance used to track traversal state.\n * @param onError - Callback invoked for each validation error.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const errors = [];\n * const context = new ValidationContext(\n * schema,\n * document,\n * new TypeInfo(schema),\n * (error) => errors.push(error),\n * );\n *\n * context.reportError(new GraphQLError('Example validation error.'));\n *\n * context.getSchema(); // => schema\n * errors[0].message; // => 'Example validation error.'\n * ```\n */\n constructor(\n schema: GraphQLSchema,\n ast: DocumentNode,\n typeInfo: TypeInfo,\n onError: (error: GraphQLError) => void,\n hideSuggestions?: Maybe,\n ) {\n super(ast, onError);\n this._schema = schema;\n this._typeInfo = typeInfo;\n this._variableUsages = new Map();\n this._recursiveVariableUsages = new Map();\n this._hideSuggestions = hideSuggestions ?? false;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n override get [Symbol.toStringTag](): string {\n return 'ValidationContext';\n }\n\n /**\n * Returns whether validation error suggestions are hidden.\n * @returns True when suggestion text should be omitted from errors.\n */\n get hideSuggestions(): boolean {\n return this._hideSuggestions;\n }\n\n /**\n * Returns the schema being used by this validation context.\n * @returns The schema being validated against.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const context = new ValidationContext(\n * schema,\n * parse('{ greeting }'),\n * new TypeInfo(schema),\n * () => {},\n * );\n *\n * context.getSchema().getQueryType()?.name; // => 'Query'\n * ```\n */\n getSchema(): GraphQLSchema {\n return this._schema;\n }\n\n /**\n * Returns variable usages found directly within this node.\n * @param node - The AST node to inspect or visit.\n * @returns Variable usages found directly within this node.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const document = parse('query ($name: String) { greeting(name: $name) }');\n * const operation = document.definitions[0];\n * const context = new ValidationContext(\n * schema,\n * document,\n * new TypeInfo(schema),\n * () => {},\n * );\n *\n * const usages = context.getVariableUsages(operation);\n *\n * usages[0].node.name.value; // => 'name'\n * String(usages[0].type); // => 'String'\n * ```\n */\n getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray {\n let usages = this._variableUsages.get(node);\n if (!usages) {\n const newUsages: Array = [];\n const typeInfo = new TypeInfo(\n this._schema,\n undefined,\n this._typeInfo.getFragmentSignatureByName(),\n );\n const fragmentDefinition =\n node.kind === Kind.FRAGMENT_DEFINITION ? node : undefined;\n visit(\n node,\n visitWithTypeInfo(typeInfo, {\n VariableDefinition: () => false,\n Variable(variable) {\n let fragmentVariableDefinition;\n if (fragmentDefinition) {\n const fragmentSignature = typeInfo.getFragmentSignatureByName()(\n fragmentDefinition.name.value,\n );\n\n fragmentVariableDefinition =\n fragmentSignature?.variableDefinitions.get(variable.name.value);\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n parentType: typeInfo.getParentInputType(),\n defaultValue: undefined, // fragment variables have a variable default but no location default, which is what this default value represents\n fragmentVariableDefinition,\n });\n } else {\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n parentType: typeInfo.getParentInputType(),\n defaultValue: typeInfo.getDefaultValue(),\n fragmentVariableDefinition: undefined,\n });\n }\n },\n }),\n );\n usages = newUsages;\n this._variableUsages.set(node, usages);\n }\n return usages;\n }\n\n /**\n * Returns variable usages for an operation, including variables used by referenced fragments.\n * @param operation - Operation definition to inspect.\n * @returns Variable usages reachable from the operation.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * viewer: User\n * }\n *\n * type User {\n * name(prefix: String): String\n * }\n * `);\n * const document = parse(`\n * query ($prefix: String) {\n * viewer {\n * ...UserName\n * }\n * }\n *\n * fragment UserName on User {\n * name(prefix: $prefix)\n * }\n * `);\n * const operation = document.definitions[0];\n * const context = new ValidationContext(\n * schema,\n * document,\n * new TypeInfo(schema),\n * () => {},\n * );\n *\n * const usages = context.getRecursiveVariableUsages(operation);\n *\n * usages.map((usage) => usage.node.name.value); // => ['prefix']\n * ```\n */\n getRecursiveVariableUsages(\n operation: OperationDefinitionNode,\n ): ReadonlyArray {\n let usages = this._recursiveVariableUsages.get(operation);\n if (!usages) {\n usages = this.getVariableUsages(operation);\n for (const frag of this.getRecursivelyReferencedFragments(operation)) {\n usages = usages.concat(this.getVariableUsages(frag));\n }\n this._recursiveVariableUsages.set(operation, usages);\n }\n return usages;\n }\n\n /**\n * Returns the current output type at this point in traversal.\n * @returns The current output type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let typeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * typeName = String(context.getType());\n * },\n * }),\n * );\n *\n * typeName; // => 'String'\n * ```\n */\n getType(): Maybe {\n return this._typeInfo.getType();\n }\n\n /**\n * Returns the current parent composite type.\n * @returns The current parent composite type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let parentTypeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * parentTypeName = context.getParentType()?.name;\n * },\n * }),\n * );\n *\n * parentTypeName; // => 'Query'\n * ```\n */\n getParentType(): Maybe {\n return this._typeInfo.getParentType();\n }\n\n /**\n * Returns the current input type at this point in traversal.\n * @returns The current input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int): [String]\n * }\n * `);\n * const document = parse('{ reviews(limit: 5) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let inputTypeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * inputTypeName = String(context.getInputType());\n * },\n * }),\n * );\n *\n * inputTypeName; // => 'Int'\n * ```\n */\n getInputType(): Maybe {\n return this._typeInfo.getInputType();\n }\n\n // Note: continues to expose the closest enclosing valid input type if\n // traversal descends into syntax with no corresponding GraphQL input type.\n /**\n * Returns the parent input type for the current input position.\n * @returns The parent input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * input ReviewFilter {\n * stars: Int\n * }\n *\n * type Query {\n * reviews(filter: ReviewFilter): [String]\n * }\n * `);\n * const document = parse('{ reviews(filter: { stars: 5 }) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let parentInputTypeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * ObjectField: () => {\n * parentInputTypeName = String(context.getParentInputType());\n * },\n * }),\n * );\n *\n * parentInputTypeName; // => 'ReviewFilter'\n * ```\n */\n getParentInputType(): Maybe {\n return this._typeInfo.getParentInputType();\n }\n\n /**\n * Returns the current field definition.\n * @returns The current field definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let fieldName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * fieldName = context.getFieldDef()?.name;\n * },\n * }),\n * );\n *\n * fieldName; // => 'greeting'\n * ```\n */\n getFieldDef(): Maybe> {\n return this._typeInfo.getFieldDef();\n }\n\n /**\n * Returns the current directive definition.\n * @returns The current directive definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting @include(if: true) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let directiveName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Directive: () => {\n * directiveName = context.getDirective()?.name;\n * },\n * }),\n * );\n *\n * directiveName; // => 'include'\n * ```\n */\n getDirective(): Maybe {\n return this._typeInfo.getDirective();\n }\n\n /**\n * Returns the current argument definition.\n * @returns The current argument definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int): [String]\n * }\n * `);\n * const document = parse('{ reviews(limit: 5) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let argumentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * argumentName = context.getArgument()?.name;\n * },\n * }),\n * );\n *\n * argumentName; // => 'limit'\n * ```\n */\n getArgument(): Maybe {\n return this._typeInfo.getArgument();\n }\n\n /**\n * Returns the fragment signature at the current traversal position.\n * @returns The current fragment signature, if one is active.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * FragmentSpread: () => {\n * fragmentName = context.getFragmentSignature()?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignature(): Maybe {\n return this._typeInfo.getFragmentSignature();\n }\n\n /**\n * Returns the function used to look up fragment signatures by name.\n * @returns A function that maps fragment names to fragment signatures.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Document: () => {\n * const getFragmentSignature = context.getFragmentSignatureByName();\n * fragmentName =\n * getFragmentSignature('GreetingFields')?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignatureByName(): (\n fragmentName: string,\n ) => Maybe {\n return this._typeInfo.getFragmentSignatureByName();\n }\n\n /**\n * Returns the current enum value definition.\n * @returns The current enum value definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * enum Sort {\n * NEWEST\n * OLDEST\n * }\n *\n * type Query {\n * reviews(sort: Sort): [String]\n * }\n * `);\n * const document = parse('{ reviews(sort: OLDEST) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let enumValueName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * EnumValue: () => {\n * enumValueName = context.getEnumValue()?.name;\n * },\n * }),\n * );\n *\n * enumValueName; // => 'OLDEST'\n * ```\n */\n getEnumValue(): Maybe {\n return this._typeInfo.getEnumValue();\n }\n}\n\n/** A function that creates an AST visitor for validating a GraphQL document. */\nexport type ValidationRule = (context: ValidationContext) => ASTVisitor;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs new file mode 100644 index 00000000..7c00bf71 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs @@ -0,0 +1,195 @@ +import { Kind } from "../language/kinds.mjs"; +import { visit } from "../language/visitor.mjs"; +import { TypeInfo, visitWithTypeInfo } from "../utilities/TypeInfo.mjs"; +export class ASTValidationContext { + constructor(ast, onError) { + this._ast = ast; + this._fragments = undefined; + this._fragmentSpreads = new Map(); + this._recursivelyReferencedFragments = new Map(); + this._onError = onError; + } + get [Symbol.toStringTag]() { + return 'ASTValidationContext'; + } + reportError(error) { + this._onError(error); + } + getDocument() { + return this._ast; + } + getFragment(name) { + let fragments; + if (this._fragments) { + fragments = this._fragments; + } + else { + fragments = Object.create(null); + for (const defNode of this.getDocument().definitions) { + if (defNode.kind === Kind.FRAGMENT_DEFINITION) { + fragments[defNode.name.value] = defNode; + } + } + this._fragments = fragments; + } + return fragments[name]; + } + getFragmentSpreads(node) { + let spreads = this._fragmentSpreads.get(node); + if (!spreads) { + spreads = []; + const setsToVisit = [node]; + let set; + while ((set = setsToVisit.pop())) { + for (const selection of set.selections) { + if (selection.kind === Kind.FRAGMENT_SPREAD) { + spreads.push(selection); + } + else if (selection.selectionSet) { + setsToVisit.push(selection.selectionSet); + } + } + } + this._fragmentSpreads.set(node, spreads); + } + return spreads; + } + getRecursivelyReferencedFragments(operation) { + let fragments = this._recursivelyReferencedFragments.get(operation); + if (!fragments) { + fragments = []; + const collectedNames = new Set(); + const nodesToVisit = [operation.selectionSet]; + let node; + while ((node = nodesToVisit.pop())) { + for (const spread of this.getFragmentSpreads(node)) { + const fragName = spread.name.value; + if (!collectedNames.has(fragName)) { + collectedNames.add(fragName); + const fragment = this.getFragment(fragName); + if (fragment) { + fragments.push(fragment); + nodesToVisit.push(fragment.selectionSet); + } + } + } + } + this._recursivelyReferencedFragments.set(operation, fragments); + } + return fragments; + } +} +export class SDLValidationContext extends ASTValidationContext { + constructor(ast, schema, onError) { + super(ast, onError); + this._schema = schema; + } + get hideSuggestions() { + return false; + } + get [Symbol.toStringTag]() { + return 'SDLValidationContext'; + } + getSchema() { + return this._schema; + } +} +export class ValidationContext extends ASTValidationContext { + constructor(schema, ast, typeInfo, onError, hideSuggestions) { + super(ast, onError); + this._schema = schema; + this._typeInfo = typeInfo; + this._variableUsages = new Map(); + this._recursiveVariableUsages = new Map(); + this._hideSuggestions = hideSuggestions ?? false; + } + get [Symbol.toStringTag]() { + return 'ValidationContext'; + } + get hideSuggestions() { + return this._hideSuggestions; + } + getSchema() { + return this._schema; + } + getVariableUsages(node) { + let usages = this._variableUsages.get(node); + if (!usages) { + const newUsages = []; + const typeInfo = new TypeInfo(this._schema, undefined, this._typeInfo.getFragmentSignatureByName()); + const fragmentDefinition = node.kind === Kind.FRAGMENT_DEFINITION ? node : undefined; + visit(node, visitWithTypeInfo(typeInfo, { + VariableDefinition: () => false, + Variable(variable) { + let fragmentVariableDefinition; + if (fragmentDefinition) { + const fragmentSignature = typeInfo.getFragmentSignatureByName()(fragmentDefinition.name.value); + fragmentVariableDefinition = + fragmentSignature?.variableDefinitions.get(variable.name.value); + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + parentType: typeInfo.getParentInputType(), + defaultValue: undefined, + fragmentVariableDefinition, + }); + } + else { + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + parentType: typeInfo.getParentInputType(), + defaultValue: typeInfo.getDefaultValue(), + fragmentVariableDefinition: undefined, + }); + } + }, + })); + usages = newUsages; + this._variableUsages.set(node, usages); + } + return usages; + } + getRecursiveVariableUsages(operation) { + let usages = this._recursiveVariableUsages.get(operation); + if (!usages) { + usages = this.getVariableUsages(operation); + for (const frag of this.getRecursivelyReferencedFragments(operation)) { + usages = usages.concat(this.getVariableUsages(frag)); + } + this._recursiveVariableUsages.set(operation, usages); + } + return usages; + } + getType() { + return this._typeInfo.getType(); + } + getParentType() { + return this._typeInfo.getParentType(); + } + getInputType() { + return this._typeInfo.getInputType(); + } + getParentInputType() { + return this._typeInfo.getParentInputType(); + } + getFieldDef() { + return this._typeInfo.getFieldDef(); + } + getDirective() { + return this._typeInfo.getDirective(); + } + getArgument() { + return this._typeInfo.getArgument(); + } + getFragmentSignature() { + return this._typeInfo.getFragmentSignature(); + } + getFragmentSignatureByName() { + return this._typeInfo.getFragmentSignatureByName(); + } + getEnumValue() { + return this._typeInfo.getEnumValue(); + } +} +//# sourceMappingURL=ValidationContext.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs.map new file mode 100644 index 00000000..76d71bc5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/ValidationContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ValidationContext.js","sourceRoot":"","sources":["../../src/validation/ValidationContext.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,IAAI,EAAE,8BAA6B;AAE5C,OAAO,EAAE,KAAK,EAAE,gCAA+B;AAc/C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kCAAiC;AAkBvE,MAAM,OAAO,oBAAoB;IAU/B,YAAY,GAAiB,EAAE,OAAsC;QACnE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,+BAA+B,GAAG,IAAI,GAAG,EAAE,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B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iCD,WAAW;QACT,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IA4CD,oBAAoB;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC;IAC/C,CAAC;IA8CD,0BAA0B;QAGxB,OAAO,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,CAAC;IACrD,CAAC;IAsCD,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;IACvC,CAAC;CACF","sourcesContent":["/** @category Validation Context */\n\nimport type { Maybe } from '../jsutils/Maybe.ts';\nimport type { ObjMap } from '../jsutils/ObjMap.ts';\n\nimport type { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type {\n DocumentNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n OperationDefinitionNode,\n SelectionSetNode,\n VariableDefinitionNode,\n VariableNode,\n} from '../language/ast.ts';\nimport { Kind } from '../language/kinds.ts';\nimport type { ASTVisitor } from '../language/visitor.ts';\nimport { visit } from '../language/visitor.ts';\n\nimport type {\n GraphQLArgument,\n GraphQLCompositeType,\n GraphQLEnumValue,\n GraphQLField,\n GraphQLInputType,\n GraphQLOutputType,\n} from '../type/definition.ts';\nimport type { GraphQLDirective } from '../type/directives.ts';\nimport type { GraphQLSchema } from '../type/schema.ts';\n\nimport type { FragmentSignature } from '../utilities/TypeInfo.ts';\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.ts';\n\ntype NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;\ninterface VariableUsage {\n readonly node: VariableNode;\n readonly type: Maybe;\n readonly parentType: Maybe;\n readonly defaultValue: unknown;\n readonly fragmentVariableDefinition: Maybe;\n}\n\n/**\n * An instance of this class is passed as the \"this\" context to all validators,\n * allowing access to commonly useful contextual information from within a\n * validation rule.\n *\n * @internal\n */\nexport class ASTValidationContext {\n private _ast: DocumentNode;\n private _onError: (error: GraphQLError) => void;\n private _fragments: ObjMap | undefined;\n private _fragmentSpreads: Map>;\n private _recursivelyReferencedFragments: Map<\n OperationDefinitionNode,\n Array\n >;\n\n constructor(ast: DocumentNode, onError: (error: GraphQLError) => void) {\n this._ast = ast;\n this._fragments = undefined;\n this._fragmentSpreads = new Map();\n this._recursivelyReferencedFragments = new Map();\n this._onError = onError;\n }\n\n get [Symbol.toStringTag](): string {\n return 'ASTValidationContext';\n }\n\n reportError(error: GraphQLError): void {\n this._onError(error);\n }\n\n getDocument(): DocumentNode {\n return this._ast;\n }\n\n getFragment(name: string): Maybe {\n let fragments: ObjMap;\n if (this._fragments) {\n fragments = this._fragments;\n } else {\n fragments = Object.create(null);\n for (const defNode of this.getDocument().definitions) {\n if (defNode.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[defNode.name.value] = defNode;\n }\n }\n this._fragments = fragments;\n }\n return fragments[name];\n }\n\n getFragmentSpreads(\n node: SelectionSetNode,\n ): ReadonlyArray {\n let spreads = this._fragmentSpreads.get(node);\n if (!spreads) {\n spreads = [];\n const setsToVisit: Array = [node];\n let set: SelectionSetNode | undefined;\n while ((set = setsToVisit.pop())) {\n for (const selection of set.selections) {\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n spreads.push(selection);\n } else if (selection.selectionSet) {\n setsToVisit.push(selection.selectionSet);\n }\n }\n }\n this._fragmentSpreads.set(node, spreads);\n }\n return spreads;\n }\n\n getRecursivelyReferencedFragments(\n operation: OperationDefinitionNode,\n ): ReadonlyArray {\n let fragments = this._recursivelyReferencedFragments.get(operation);\n if (!fragments) {\n fragments = [];\n const collectedNames = new Set();\n const nodesToVisit: Array = [operation.selectionSet];\n let node: SelectionSetNode | undefined;\n while ((node = nodesToVisit.pop())) {\n for (const spread of this.getFragmentSpreads(node)) {\n const fragName = spread.name.value;\n if (!collectedNames.has(fragName)) {\n collectedNames.add(fragName);\n const fragment = this.getFragment(fragName);\n if (fragment) {\n fragments.push(fragment);\n nodesToVisit.push(fragment.selectionSet);\n }\n }\n }\n }\n this._recursivelyReferencedFragments.set(operation, fragments);\n }\n return fragments;\n }\n}\n\n/** @internal */\nexport type ASTValidationRule = (context: ASTValidationContext) => ASTVisitor;\n\n/** @internal */\nexport class SDLValidationContext extends ASTValidationContext {\n private _schema: Maybe;\n\n constructor(\n ast: DocumentNode,\n schema: Maybe,\n onError: (error: GraphQLError) => void,\n ) {\n super(ast, onError);\n this._schema = schema;\n }\n\n get hideSuggestions(): boolean {\n return false;\n }\n\n override get [Symbol.toStringTag](): string {\n return 'SDLValidationContext';\n }\n\n getSchema(): Maybe {\n return this._schema;\n }\n}\n\n/** @internal */\nexport type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor;\n\n/** Validation context passed to query validation rules. */\nexport class ValidationContext extends ASTValidationContext {\n private _schema: GraphQLSchema;\n private _typeInfo: TypeInfo;\n private _variableUsages: Map<\n NodeWithSelectionSet,\n ReadonlyArray\n >;\n\n private _recursiveVariableUsages: Map<\n OperationDefinitionNode,\n ReadonlyArray\n >;\n private _hideSuggestions: boolean;\n\n /**\n * Creates a ValidationContext instance.\n * @param schema - Schema used to validate the document.\n * @param ast - Document AST being validated.\n * @param typeInfo - TypeInfo instance used to track traversal state.\n * @param onError - Callback invoked for each validation error.\n * @param hideSuggestions - Whether suggestion text should be omitted from errors.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { GraphQLError } from 'graphql/error';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const errors = [];\n * const context = new ValidationContext(\n * schema,\n * document,\n * new TypeInfo(schema),\n * (error) => errors.push(error),\n * );\n *\n * context.reportError(new GraphQLError('Example validation error.'));\n *\n * context.getSchema(); // => schema\n * errors[0].message; // => 'Example validation error.'\n * ```\n */\n constructor(\n schema: GraphQLSchema,\n ast: DocumentNode,\n typeInfo: TypeInfo,\n onError: (error: GraphQLError) => void,\n hideSuggestions?: Maybe,\n ) {\n super(ast, onError);\n this._schema = schema;\n this._typeInfo = typeInfo;\n this._variableUsages = new Map();\n this._recursiveVariableUsages = new Map();\n this._hideSuggestions = hideSuggestions ?? false;\n }\n\n /**\n * Returns the value used by `Object.prototype.toString`.\n * @returns The built-in string tag for this object.\n */\n override get [Symbol.toStringTag](): string {\n return 'ValidationContext';\n }\n\n /**\n * Returns whether validation error suggestions are hidden.\n * @returns True when suggestion text should be omitted from errors.\n */\n get hideSuggestions(): boolean {\n return this._hideSuggestions;\n }\n\n /**\n * Returns the schema being used by this validation context.\n * @returns The schema being validated against.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const context = new ValidationContext(\n * schema,\n * parse('{ greeting }'),\n * new TypeInfo(schema),\n * () => {},\n * );\n *\n * context.getSchema().getQueryType()?.name; // => 'Query'\n * ```\n */\n getSchema(): GraphQLSchema {\n return this._schema;\n }\n\n /**\n * Returns variable usages found directly within this node.\n * @param node - The AST node to inspect or visit.\n * @returns Variable usages found directly within this node.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting(name: String): String\n * }\n * `);\n * const document = parse('query ($name: String) { greeting(name: $name) }');\n * const operation = document.definitions[0];\n * const context = new ValidationContext(\n * schema,\n * document,\n * new TypeInfo(schema),\n * () => {},\n * );\n *\n * const usages = context.getVariableUsages(operation);\n *\n * usages[0].node.name.value; // => 'name'\n * String(usages[0].type); // => 'String'\n * ```\n */\n getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray {\n let usages = this._variableUsages.get(node);\n if (!usages) {\n const newUsages: Array = [];\n const typeInfo = new TypeInfo(\n this._schema,\n undefined,\n this._typeInfo.getFragmentSignatureByName(),\n );\n const fragmentDefinition =\n node.kind === Kind.FRAGMENT_DEFINITION ? node : undefined;\n visit(\n node,\n visitWithTypeInfo(typeInfo, {\n VariableDefinition: () => false,\n Variable(variable) {\n let fragmentVariableDefinition;\n if (fragmentDefinition) {\n const fragmentSignature = typeInfo.getFragmentSignatureByName()(\n fragmentDefinition.name.value,\n );\n\n fragmentVariableDefinition =\n fragmentSignature?.variableDefinitions.get(variable.name.value);\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n parentType: typeInfo.getParentInputType(),\n defaultValue: undefined, // fragment variables have a variable default but no location default, which is what this default value represents\n fragmentVariableDefinition,\n });\n } else {\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n parentType: typeInfo.getParentInputType(),\n defaultValue: typeInfo.getDefaultValue(),\n fragmentVariableDefinition: undefined,\n });\n }\n },\n }),\n );\n usages = newUsages;\n this._variableUsages.set(node, usages);\n }\n return usages;\n }\n\n /**\n * Returns variable usages for an operation, including variables used by referenced fragments.\n * @param operation - Operation definition to inspect.\n * @returns Variable usages reachable from the operation.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema, TypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * viewer: User\n * }\n *\n * type User {\n * name(prefix: String): String\n * }\n * `);\n * const document = parse(`\n * query ($prefix: String) {\n * viewer {\n * ...UserName\n * }\n * }\n *\n * fragment UserName on User {\n * name(prefix: $prefix)\n * }\n * `);\n * const operation = document.definitions[0];\n * const context = new ValidationContext(\n * schema,\n * document,\n * new TypeInfo(schema),\n * () => {},\n * );\n *\n * const usages = context.getRecursiveVariableUsages(operation);\n *\n * usages.map((usage) => usage.node.name.value); // => ['prefix']\n * ```\n */\n getRecursiveVariableUsages(\n operation: OperationDefinitionNode,\n ): ReadonlyArray {\n let usages = this._recursiveVariableUsages.get(operation);\n if (!usages) {\n usages = this.getVariableUsages(operation);\n for (const frag of this.getRecursivelyReferencedFragments(operation)) {\n usages = usages.concat(this.getVariableUsages(frag));\n }\n this._recursiveVariableUsages.set(operation, usages);\n }\n return usages;\n }\n\n /**\n * Returns the current output type at this point in traversal.\n * @returns The current output type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let typeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * typeName = String(context.getType());\n * },\n * }),\n * );\n *\n * typeName; // => 'String'\n * ```\n */\n getType(): Maybe {\n return this._typeInfo.getType();\n }\n\n /**\n * Returns the current parent composite type.\n * @returns The current parent composite type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let parentTypeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * parentTypeName = context.getParentType()?.name;\n * },\n * }),\n * );\n *\n * parentTypeName; // => 'Query'\n * ```\n */\n getParentType(): Maybe {\n return this._typeInfo.getParentType();\n }\n\n /**\n * Returns the current input type at this point in traversal.\n * @returns The current input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int): [String]\n * }\n * `);\n * const document = parse('{ reviews(limit: 5) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let inputTypeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * inputTypeName = String(context.getInputType());\n * },\n * }),\n * );\n *\n * inputTypeName; // => 'Int'\n * ```\n */\n getInputType(): Maybe {\n return this._typeInfo.getInputType();\n }\n\n // Note: continues to expose the closest enclosing valid input type if\n // traversal descends into syntax with no corresponding GraphQL input type.\n /**\n * Returns the parent input type for the current input position.\n * @returns The parent input type, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * input ReviewFilter {\n * stars: Int\n * }\n *\n * type Query {\n * reviews(filter: ReviewFilter): [String]\n * }\n * `);\n * const document = parse('{ reviews(filter: { stars: 5 }) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let parentInputTypeName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * ObjectField: () => {\n * parentInputTypeName = String(context.getParentInputType());\n * },\n * }),\n * );\n *\n * parentInputTypeName; // => 'ReviewFilter'\n * ```\n */\n getParentInputType(): Maybe {\n return this._typeInfo.getParentInputType();\n }\n\n /**\n * Returns the current field definition.\n * @returns The current field definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let fieldName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Field: () => {\n * fieldName = context.getFieldDef()?.name;\n * },\n * }),\n * );\n *\n * fieldName; // => 'greeting'\n * ```\n */\n getFieldDef(): Maybe> {\n return this._typeInfo.getFieldDef();\n }\n\n /**\n * Returns the current directive definition.\n * @returns The current directive definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ greeting @include(if: true) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let directiveName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Directive: () => {\n * directiveName = context.getDirective()?.name;\n * },\n * }),\n * );\n *\n * directiveName; // => 'include'\n * ```\n */\n getDirective(): Maybe {\n return this._typeInfo.getDirective();\n }\n\n /**\n * Returns the current argument definition.\n * @returns The current argument definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * reviews(limit: Int): [String]\n * }\n * `);\n * const document = parse('{ reviews(limit: 5) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let argumentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Argument: () => {\n * argumentName = context.getArgument()?.name;\n * },\n * }),\n * );\n *\n * argumentName; // => 'limit'\n * ```\n */\n getArgument(): Maybe {\n return this._typeInfo.getArgument();\n }\n\n /**\n * Returns the fragment signature at the current traversal position.\n * @returns The current fragment signature, if one is active.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * FragmentSpread: () => {\n * fragmentName = context.getFragmentSignature()?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignature(): Maybe {\n return this._typeInfo.getFragmentSignature();\n }\n\n /**\n * Returns the function used to look up fragment signatures by name.\n * @returns A function that maps fragment names to fragment signatures.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse(\n * `\n * {\n * ...GreetingFields\n * }\n *\n * fragment GreetingFields on Query {\n * greeting\n * }\n * `,\n * { experimentalFragmentArguments: true },\n * );\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let fragmentName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * Document: () => {\n * const getFragmentSignature = context.getFragmentSignatureByName();\n * fragmentName =\n * getFragmentSignature('GreetingFields')?.definition.name.value;\n * },\n * }),\n * );\n *\n * fragmentName; // => 'GreetingFields'\n * ```\n */\n getFragmentSignatureByName(): (\n fragmentName: string,\n ) => Maybe {\n return this._typeInfo.getFragmentSignatureByName();\n }\n\n /**\n * Returns the current enum value definition.\n * @returns The current enum value definition, if known.\n * @example\n * ```ts\n * import { parse, visit } from 'graphql/language';\n * import { buildSchema, TypeInfo, visitWithTypeInfo } from 'graphql/utilities';\n * import { ValidationContext } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * enum Sort {\n * NEWEST\n * OLDEST\n * }\n *\n * type Query {\n * reviews(sort: Sort): [String]\n * }\n * `);\n * const document = parse('{ reviews(sort: OLDEST) }');\n * const typeInfo = new TypeInfo(schema);\n * const context = new ValidationContext(schema, document, typeInfo, () => {});\n * let enumValueName;\n *\n * visit(\n * document,\n * visitWithTypeInfo(typeInfo, {\n * EnumValue: () => {\n * enumValueName = context.getEnumValue()?.name;\n * },\n * }),\n * );\n *\n * enumValueName; // => 'OLDEST'\n * ```\n */\n getEnumValue(): Maybe {\n return this._typeInfo.getEnumValue();\n }\n}\n\n/** A function that creates an AST visitor for validating a GraphQL document. */\nexport type ValidationRule = (context: ValidationContext) => ASTVisitor;\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.mts new file mode 100644 index 00000000..4af103c3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.mts @@ -0,0 +1,53 @@ +/** + * Validate GraphQL documents and schemas with the specified validation rules. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { validate } from "./validate.mjs"; +export type { ValidationOptions } from "./validate.mjs"; +export { ValidationContext } from "./ValidationContext.mjs"; +export type { ValidationRule } from "./ValidationContext.mjs"; +export { specifiedRules, recommendedRules } from "./specifiedRules.mjs"; +export { DeferStreamDirectiveLabelRule } from "./rules/DeferStreamDirectiveLabelRule.mjs"; +export { DeferStreamDirectiveOnRootFieldRule } from "./rules/DeferStreamDirectiveOnRootFieldRule.mjs"; +export { DeferStreamDirectiveOnValidOperationsRule } from "./rules/DeferStreamDirectiveOnValidOperationsRule.mjs"; +export { ExecutableDefinitionsRule } from "./rules/ExecutableDefinitionsRule.mjs"; +export { FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectTypeRule.mjs"; +export { FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypesRule.mjs"; +export { KnownArgumentNamesRule } from "./rules/KnownArgumentNamesRule.mjs"; +export { KnownDirectivesRule } from "./rules/KnownDirectivesRule.mjs"; +export { KnownFragmentNamesRule } from "./rules/KnownFragmentNamesRule.mjs"; +export { KnownOperationTypesRule } from "./rules/KnownOperationTypesRule.mjs"; +export { KnownTypeNamesRule } from "./rules/KnownTypeNamesRule.mjs"; +export { LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperationRule.mjs"; +export { NoFragmentCyclesRule } from "./rules/NoFragmentCyclesRule.mjs"; +export { NoUndefinedVariablesRule } from "./rules/NoUndefinedVariablesRule.mjs"; +export { NoUnusedFragmentsRule } from "./rules/NoUnusedFragmentsRule.mjs"; +export { NoUnusedVariablesRule } from "./rules/NoUnusedVariablesRule.mjs"; +export { OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMergedRule.mjs"; +export { PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreadsRule.mjs"; +export { ProvidedRequiredArgumentsRule } from "./rules/ProvidedRequiredArgumentsRule.mjs"; +export { ScalarLeafsRule } from "./rules/ScalarLeafsRule.mjs"; +export { SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptionsRule.mjs"; +export { StreamDirectiveOnListFieldRule } from "./rules/StreamDirectiveOnListFieldRule.mjs"; +export { UniqueArgumentNamesRule } from "./rules/UniqueArgumentNamesRule.mjs"; +export { UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocationRule.mjs"; +export { UniqueFragmentNamesRule } from "./rules/UniqueFragmentNamesRule.mjs"; +export { UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNamesRule.mjs"; +export { UniqueOperationNamesRule } from "./rules/UniqueOperationNamesRule.mjs"; +export { UniqueVariableNamesRule } from "./rules/UniqueVariableNamesRule.mjs"; +export { ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectTypeRule.mjs"; +export { VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypesRule.mjs"; +export { VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPositionRule.mjs"; +export { MaxIntrospectionDepthRule } from "./rules/MaxIntrospectionDepthRule.mjs"; +export { LoneSchemaDefinitionRule } from "./rules/LoneSchemaDefinitionRule.mjs"; +export { UniqueOperationTypesRule } from "./rules/UniqueOperationTypesRule.mjs"; +export { UniqueTypeNamesRule } from "./rules/UniqueTypeNamesRule.mjs"; +export { UniqueEnumValueNamesRule } from "./rules/UniqueEnumValueNamesRule.mjs"; +export { UniqueFieldDefinitionNamesRule } from "./rules/UniqueFieldDefinitionNamesRule.mjs"; +export { UniqueArgumentDefinitionNamesRule } from "./rules/UniqueArgumentDefinitionNamesRule.mjs"; +export { UniqueDirectiveNamesRule } from "./rules/UniqueDirectiveNamesRule.mjs"; +export { PossibleTypeExtensionsRule } from "./rules/PossibleTypeExtensionsRule.mjs"; +export { NoDeprecatedCustomRule } from "./rules/custom/NoDeprecatedCustomRule.mjs"; +export { NoSchemaIntrospectionCustomRule } from "./rules/custom/NoSchemaIntrospectionCustomRule.mjs"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.ts new file mode 100644 index 00000000..6636b36b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.d.ts @@ -0,0 +1,53 @@ +/** + * Validate GraphQL documents and schemas with the specified validation rules. + * + * These exports are also available from the root `graphql` package. + * @packageDocumentation + */ +export { validate } from "./validate.js"; +export type { ValidationOptions } from "./validate.js"; +export { ValidationContext } from "./ValidationContext.js"; +export type { ValidationRule } from "./ValidationContext.js"; +export { specifiedRules, recommendedRules } from "./specifiedRules.js"; +export { DeferStreamDirectiveLabelRule } from "./rules/DeferStreamDirectiveLabelRule.js"; +export { DeferStreamDirectiveOnRootFieldRule } from "./rules/DeferStreamDirectiveOnRootFieldRule.js"; +export { DeferStreamDirectiveOnValidOperationsRule } from "./rules/DeferStreamDirectiveOnValidOperationsRule.js"; +export { ExecutableDefinitionsRule } from "./rules/ExecutableDefinitionsRule.js"; +export { FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectTypeRule.js"; +export { FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypesRule.js"; +export { KnownArgumentNamesRule } from "./rules/KnownArgumentNamesRule.js"; +export { KnownDirectivesRule } from "./rules/KnownDirectivesRule.js"; +export { KnownFragmentNamesRule } from "./rules/KnownFragmentNamesRule.js"; +export { KnownOperationTypesRule } from "./rules/KnownOperationTypesRule.js"; +export { KnownTypeNamesRule } from "./rules/KnownTypeNamesRule.js"; +export { LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperationRule.js"; +export { NoFragmentCyclesRule } from "./rules/NoFragmentCyclesRule.js"; +export { NoUndefinedVariablesRule } from "./rules/NoUndefinedVariablesRule.js"; +export { NoUnusedFragmentsRule } from "./rules/NoUnusedFragmentsRule.js"; +export { NoUnusedVariablesRule } from "./rules/NoUnusedVariablesRule.js"; +export { OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMergedRule.js"; +export { PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreadsRule.js"; +export { ProvidedRequiredArgumentsRule } from "./rules/ProvidedRequiredArgumentsRule.js"; +export { ScalarLeafsRule } from "./rules/ScalarLeafsRule.js"; +export { SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptionsRule.js"; +export { StreamDirectiveOnListFieldRule } from "./rules/StreamDirectiveOnListFieldRule.js"; +export { UniqueArgumentNamesRule } from "./rules/UniqueArgumentNamesRule.js"; +export { UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocationRule.js"; +export { UniqueFragmentNamesRule } from "./rules/UniqueFragmentNamesRule.js"; +export { UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNamesRule.js"; +export { UniqueOperationNamesRule } from "./rules/UniqueOperationNamesRule.js"; +export { UniqueVariableNamesRule } from "./rules/UniqueVariableNamesRule.js"; +export { ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectTypeRule.js"; +export { VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypesRule.js"; +export { VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPositionRule.js"; +export { MaxIntrospectionDepthRule } from "./rules/MaxIntrospectionDepthRule.js"; +export { LoneSchemaDefinitionRule } from "./rules/LoneSchemaDefinitionRule.js"; +export { UniqueOperationTypesRule } from "./rules/UniqueOperationTypesRule.js"; +export { UniqueTypeNamesRule } from "./rules/UniqueTypeNamesRule.js"; +export { UniqueEnumValueNamesRule } from "./rules/UniqueEnumValueNamesRule.js"; +export { UniqueFieldDefinitionNamesRule } from "./rules/UniqueFieldDefinitionNamesRule.js"; +export { UniqueArgumentDefinitionNamesRule } from "./rules/UniqueArgumentDefinitionNamesRule.js"; +export { UniqueDirectiveNamesRule } from "./rules/UniqueDirectiveNamesRule.js"; +export { PossibleTypeExtensionsRule } from "./rules/PossibleTypeExtensionsRule.js"; +export { NoDeprecatedCustomRule } from "./rules/custom/NoDeprecatedCustomRule.js"; +export { NoSchemaIntrospectionCustomRule } from "./rules/custom/NoSchemaIntrospectionCustomRule.js"; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js new file mode 100644 index 00000000..540a683b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoSchemaIntrospectionCustomRule = exports.NoDeprecatedCustomRule = exports.PossibleTypeExtensionsRule = exports.UniqueDirectiveNamesRule = exports.UniqueArgumentDefinitionNamesRule = exports.UniqueFieldDefinitionNamesRule = exports.UniqueEnumValueNamesRule = exports.UniqueTypeNamesRule = exports.UniqueOperationTypesRule = exports.LoneSchemaDefinitionRule = exports.MaxIntrospectionDepthRule = exports.VariablesInAllowedPositionRule = exports.VariablesAreInputTypesRule = exports.ValuesOfCorrectTypeRule = exports.UniqueVariableNamesRule = exports.UniqueOperationNamesRule = exports.UniqueInputFieldNamesRule = exports.UniqueFragmentNamesRule = exports.UniqueDirectivesPerLocationRule = exports.UniqueArgumentNamesRule = exports.StreamDirectiveOnListFieldRule = exports.SingleFieldSubscriptionsRule = exports.ScalarLeafsRule = exports.ProvidedRequiredArgumentsRule = exports.PossibleFragmentSpreadsRule = exports.OverlappingFieldsCanBeMergedRule = exports.NoUnusedVariablesRule = exports.NoUnusedFragmentsRule = exports.NoUndefinedVariablesRule = exports.NoFragmentCyclesRule = exports.LoneAnonymousOperationRule = exports.KnownTypeNamesRule = exports.KnownOperationTypesRule = exports.KnownFragmentNamesRule = exports.KnownDirectivesRule = exports.KnownArgumentNamesRule = exports.FragmentsOnCompositeTypesRule = exports.FieldsOnCorrectTypeRule = exports.ExecutableDefinitionsRule = exports.DeferStreamDirectiveOnValidOperationsRule = exports.DeferStreamDirectiveOnRootFieldRule = exports.DeferStreamDirectiveLabelRule = exports.recommendedRules = exports.specifiedRules = exports.ValidationContext = exports.validate = void 0; +var validate_ts_1 = require("./validate.js"); +Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_ts_1.validate; } }); +var ValidationContext_ts_1 = require("./ValidationContext.js"); +Object.defineProperty(exports, "ValidationContext", { enumerable: true, get: function () { return ValidationContext_ts_1.ValidationContext; } }); +var specifiedRules_ts_1 = require("./specifiedRules.js"); +Object.defineProperty(exports, "specifiedRules", { enumerable: true, get: function () { return specifiedRules_ts_1.specifiedRules; } }); +Object.defineProperty(exports, "recommendedRules", { enumerable: true, get: function () { return specifiedRules_ts_1.recommendedRules; } }); +var DeferStreamDirectiveLabelRule_ts_1 = require("./rules/DeferStreamDirectiveLabelRule.js"); +Object.defineProperty(exports, "DeferStreamDirectiveLabelRule", { enumerable: true, get: function () { return DeferStreamDirectiveLabelRule_ts_1.DeferStreamDirectiveLabelRule; } }); +var DeferStreamDirectiveOnRootFieldRule_ts_1 = require("./rules/DeferStreamDirectiveOnRootFieldRule.js"); +Object.defineProperty(exports, "DeferStreamDirectiveOnRootFieldRule", { enumerable: true, get: function () { return DeferStreamDirectiveOnRootFieldRule_ts_1.DeferStreamDirectiveOnRootFieldRule; } }); +var DeferStreamDirectiveOnValidOperationsRule_ts_1 = require("./rules/DeferStreamDirectiveOnValidOperationsRule.js"); +Object.defineProperty(exports, "DeferStreamDirectiveOnValidOperationsRule", { enumerable: true, get: function () { return DeferStreamDirectiveOnValidOperationsRule_ts_1.DeferStreamDirectiveOnValidOperationsRule; } }); +var ExecutableDefinitionsRule_ts_1 = require("./rules/ExecutableDefinitionsRule.js"); +Object.defineProperty(exports, "ExecutableDefinitionsRule", { enumerable: true, get: function () { return ExecutableDefinitionsRule_ts_1.ExecutableDefinitionsRule; } }); +var FieldsOnCorrectTypeRule_ts_1 = require("./rules/FieldsOnCorrectTypeRule.js"); +Object.defineProperty(exports, "FieldsOnCorrectTypeRule", { enumerable: true, get: function () { return FieldsOnCorrectTypeRule_ts_1.FieldsOnCorrectTypeRule; } }); +var FragmentsOnCompositeTypesRule_ts_1 = require("./rules/FragmentsOnCompositeTypesRule.js"); +Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", { enumerable: true, get: function () { return FragmentsOnCompositeTypesRule_ts_1.FragmentsOnCompositeTypesRule; } }); +var KnownArgumentNamesRule_ts_1 = require("./rules/KnownArgumentNamesRule.js"); +Object.defineProperty(exports, "KnownArgumentNamesRule", { enumerable: true, get: function () { return KnownArgumentNamesRule_ts_1.KnownArgumentNamesRule; } }); +var KnownDirectivesRule_ts_1 = require("./rules/KnownDirectivesRule.js"); +Object.defineProperty(exports, "KnownDirectivesRule", { enumerable: true, get: function () { return KnownDirectivesRule_ts_1.KnownDirectivesRule; } }); +var KnownFragmentNamesRule_ts_1 = require("./rules/KnownFragmentNamesRule.js"); +Object.defineProperty(exports, "KnownFragmentNamesRule", { enumerable: true, get: function () { return KnownFragmentNamesRule_ts_1.KnownFragmentNamesRule; } }); +var KnownOperationTypesRule_ts_1 = require("./rules/KnownOperationTypesRule.js"); +Object.defineProperty(exports, "KnownOperationTypesRule", { enumerable: true, get: function () { return KnownOperationTypesRule_ts_1.KnownOperationTypesRule; } }); +var KnownTypeNamesRule_ts_1 = require("./rules/KnownTypeNamesRule.js"); +Object.defineProperty(exports, "KnownTypeNamesRule", { enumerable: true, get: function () { return KnownTypeNamesRule_ts_1.KnownTypeNamesRule; } }); +var LoneAnonymousOperationRule_ts_1 = require("./rules/LoneAnonymousOperationRule.js"); +Object.defineProperty(exports, "LoneAnonymousOperationRule", { enumerable: true, get: function () { return LoneAnonymousOperationRule_ts_1.LoneAnonymousOperationRule; } }); +var NoFragmentCyclesRule_ts_1 = require("./rules/NoFragmentCyclesRule.js"); +Object.defineProperty(exports, "NoFragmentCyclesRule", { enumerable: true, get: function () { return NoFragmentCyclesRule_ts_1.NoFragmentCyclesRule; } }); +var NoUndefinedVariablesRule_ts_1 = require("./rules/NoUndefinedVariablesRule.js"); +Object.defineProperty(exports, "NoUndefinedVariablesRule", { enumerable: true, get: function () { return NoUndefinedVariablesRule_ts_1.NoUndefinedVariablesRule; } }); +var NoUnusedFragmentsRule_ts_1 = require("./rules/NoUnusedFragmentsRule.js"); +Object.defineProperty(exports, "NoUnusedFragmentsRule", { enumerable: true, get: function () { return NoUnusedFragmentsRule_ts_1.NoUnusedFragmentsRule; } }); +var NoUnusedVariablesRule_ts_1 = require("./rules/NoUnusedVariablesRule.js"); +Object.defineProperty(exports, "NoUnusedVariablesRule", { enumerable: true, get: function () { return NoUnusedVariablesRule_ts_1.NoUnusedVariablesRule; } }); +var OverlappingFieldsCanBeMergedRule_ts_1 = require("./rules/OverlappingFieldsCanBeMergedRule.js"); +Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", { enumerable: true, get: function () { return OverlappingFieldsCanBeMergedRule_ts_1.OverlappingFieldsCanBeMergedRule; } }); +var PossibleFragmentSpreadsRule_ts_1 = require("./rules/PossibleFragmentSpreadsRule.js"); +Object.defineProperty(exports, "PossibleFragmentSpreadsRule", { enumerable: true, get: function () { return PossibleFragmentSpreadsRule_ts_1.PossibleFragmentSpreadsRule; } }); +var ProvidedRequiredArgumentsRule_ts_1 = require("./rules/ProvidedRequiredArgumentsRule.js"); +Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", { enumerable: true, get: function () { return ProvidedRequiredArgumentsRule_ts_1.ProvidedRequiredArgumentsRule; } }); +var ScalarLeafsRule_ts_1 = require("./rules/ScalarLeafsRule.js"); +Object.defineProperty(exports, "ScalarLeafsRule", { enumerable: true, get: function () { return ScalarLeafsRule_ts_1.ScalarLeafsRule; } }); +var SingleFieldSubscriptionsRule_ts_1 = require("./rules/SingleFieldSubscriptionsRule.js"); +Object.defineProperty(exports, "SingleFieldSubscriptionsRule", { enumerable: true, get: function () { return SingleFieldSubscriptionsRule_ts_1.SingleFieldSubscriptionsRule; } }); +var StreamDirectiveOnListFieldRule_ts_1 = require("./rules/StreamDirectiveOnListFieldRule.js"); +Object.defineProperty(exports, "StreamDirectiveOnListFieldRule", { enumerable: true, get: function () { return StreamDirectiveOnListFieldRule_ts_1.StreamDirectiveOnListFieldRule; } }); +var UniqueArgumentNamesRule_ts_1 = require("./rules/UniqueArgumentNamesRule.js"); +Object.defineProperty(exports, "UniqueArgumentNamesRule", { enumerable: true, get: function () { return UniqueArgumentNamesRule_ts_1.UniqueArgumentNamesRule; } }); +var UniqueDirectivesPerLocationRule_ts_1 = require("./rules/UniqueDirectivesPerLocationRule.js"); +Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", { enumerable: true, get: function () { return UniqueDirectivesPerLocationRule_ts_1.UniqueDirectivesPerLocationRule; } }); +var UniqueFragmentNamesRule_ts_1 = require("./rules/UniqueFragmentNamesRule.js"); +Object.defineProperty(exports, "UniqueFragmentNamesRule", { enumerable: true, get: function () { return UniqueFragmentNamesRule_ts_1.UniqueFragmentNamesRule; } }); +var UniqueInputFieldNamesRule_ts_1 = require("./rules/UniqueInputFieldNamesRule.js"); +Object.defineProperty(exports, "UniqueInputFieldNamesRule", { enumerable: true, get: function () { return UniqueInputFieldNamesRule_ts_1.UniqueInputFieldNamesRule; } }); +var UniqueOperationNamesRule_ts_1 = require("./rules/UniqueOperationNamesRule.js"); +Object.defineProperty(exports, "UniqueOperationNamesRule", { enumerable: true, get: function () { return UniqueOperationNamesRule_ts_1.UniqueOperationNamesRule; } }); +var UniqueVariableNamesRule_ts_1 = require("./rules/UniqueVariableNamesRule.js"); +Object.defineProperty(exports, "UniqueVariableNamesRule", { enumerable: true, get: function () { return UniqueVariableNamesRule_ts_1.UniqueVariableNamesRule; } }); +var ValuesOfCorrectTypeRule_ts_1 = require("./rules/ValuesOfCorrectTypeRule.js"); +Object.defineProperty(exports, "ValuesOfCorrectTypeRule", { enumerable: true, get: function () { return ValuesOfCorrectTypeRule_ts_1.ValuesOfCorrectTypeRule; } }); +var VariablesAreInputTypesRule_ts_1 = require("./rules/VariablesAreInputTypesRule.js"); +Object.defineProperty(exports, "VariablesAreInputTypesRule", { enumerable: true, get: function () { return VariablesAreInputTypesRule_ts_1.VariablesAreInputTypesRule; } }); +var VariablesInAllowedPositionRule_ts_1 = require("./rules/VariablesInAllowedPositionRule.js"); +Object.defineProperty(exports, "VariablesInAllowedPositionRule", { enumerable: true, get: function () { return VariablesInAllowedPositionRule_ts_1.VariablesInAllowedPositionRule; } }); +var MaxIntrospectionDepthRule_ts_1 = require("./rules/MaxIntrospectionDepthRule.js"); +Object.defineProperty(exports, "MaxIntrospectionDepthRule", { enumerable: true, get: function () { return MaxIntrospectionDepthRule_ts_1.MaxIntrospectionDepthRule; } }); +var LoneSchemaDefinitionRule_ts_1 = require("./rules/LoneSchemaDefinitionRule.js"); +Object.defineProperty(exports, "LoneSchemaDefinitionRule", { enumerable: true, get: function () { return LoneSchemaDefinitionRule_ts_1.LoneSchemaDefinitionRule; } }); +var UniqueOperationTypesRule_ts_1 = require("./rules/UniqueOperationTypesRule.js"); +Object.defineProperty(exports, "UniqueOperationTypesRule", { enumerable: true, get: function () { return UniqueOperationTypesRule_ts_1.UniqueOperationTypesRule; } }); +var UniqueTypeNamesRule_ts_1 = require("./rules/UniqueTypeNamesRule.js"); +Object.defineProperty(exports, "UniqueTypeNamesRule", { enumerable: true, get: function () { return UniqueTypeNamesRule_ts_1.UniqueTypeNamesRule; } }); +var UniqueEnumValueNamesRule_ts_1 = require("./rules/UniqueEnumValueNamesRule.js"); +Object.defineProperty(exports, "UniqueEnumValueNamesRule", { enumerable: true, get: function () { return UniqueEnumValueNamesRule_ts_1.UniqueEnumValueNamesRule; } }); +var UniqueFieldDefinitionNamesRule_ts_1 = require("./rules/UniqueFieldDefinitionNamesRule.js"); +Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", { enumerable: true, get: function () { return UniqueFieldDefinitionNamesRule_ts_1.UniqueFieldDefinitionNamesRule; } }); +var UniqueArgumentDefinitionNamesRule_ts_1 = require("./rules/UniqueArgumentDefinitionNamesRule.js"); +Object.defineProperty(exports, "UniqueArgumentDefinitionNamesRule", { enumerable: true, get: function () { return UniqueArgumentDefinitionNamesRule_ts_1.UniqueArgumentDefinitionNamesRule; } }); +var UniqueDirectiveNamesRule_ts_1 = require("./rules/UniqueDirectiveNamesRule.js"); +Object.defineProperty(exports, "UniqueDirectiveNamesRule", { enumerable: true, get: function () { return UniqueDirectiveNamesRule_ts_1.UniqueDirectiveNamesRule; } }); +var PossibleTypeExtensionsRule_ts_1 = require("./rules/PossibleTypeExtensionsRule.js"); +Object.defineProperty(exports, "PossibleTypeExtensionsRule", { enumerable: true, get: function () { return PossibleTypeExtensionsRule_ts_1.PossibleTypeExtensionsRule; } }); +var NoDeprecatedCustomRule_ts_1 = require("./rules/custom/NoDeprecatedCustomRule.js"); +Object.defineProperty(exports, "NoDeprecatedCustomRule", { enumerable: true, get: function () { return NoDeprecatedCustomRule_ts_1.NoDeprecatedCustomRule; } }); +var NoSchemaIntrospectionCustomRule_ts_1 = require("./rules/custom/NoSchemaIntrospectionCustomRule.js"); +Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", { enumerable: true, get: function () { return NoSchemaIntrospectionCustomRule_ts_1.NoSchemaIntrospectionCustomRule; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js.map new file mode 100644 index 00000000..f42ee4ab --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";;;AAOA,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AAGjB,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAI1B,yDAAuE;AAA9D,mHAAA,cAAc,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAGzC,6FAAyF;AAAhF,iJAAA,6BAA6B,OAAA;AAGtC,yGAAqG;AAA5F,6JAAA,mCAAmC,OAAA;AAG5C,qHAAiH;AAAxG,yKAAA,yCAAyC,OAAA;AAGlD,qFAAiF;AAAxE,yIAAA,yBAAyB,OAAA;AAGlC,iFAA6E;AAApE,qIAAA,uBAAuB,OAAA;AAGhC,6FAAyF;AAAhF,iJAAA,6BAA6B,OAAA;AAGtC,+EAA2E;AAAlE,mIAAA,sBAAsB,OAAA;AAG/B,yEAAqE;AAA5D,6HAAA,mBAAmB,OAAA;AAG5B,+EAA2E;AAAlE,mIAAA,sBAAsB,OAAA;AAG/B,iFAA6E;AAApE,qIAAA,uBAAuB,OAAA;AAGhC,uEAAmE;AAA1D,2HAAA,kBAAkB,OAAA;AAG3B,uFAAmF;AAA1E,2IAAA,0BAA0B,OAAA;AAGnC,2EAAuE;AAA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E,mIAAA,sBAAsB,OAAA;AAC/B,wGAAoG;AAA3F,qJAAA,+BAA+B,OAAA","sourcesContent":["/**\n * Validate GraphQL documents and schemas with the specified validation rules.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { validate } from './validate.ts';\nexport type { ValidationOptions } from './validate.ts';\n\nexport { ValidationContext } from './ValidationContext.ts';\nexport type { ValidationRule } from './ValidationContext.ts';\n\n// All validation rules in the GraphQL Specification.\nexport { specifiedRules, recommendedRules } from './specifiedRules.ts';\n\n// Spec Section: \"Defer And Stream Directive Labels Are Unique\"\nexport { DeferStreamDirectiveLabelRule } from './rules/DeferStreamDirectiveLabelRule.ts';\n\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Root Field\"\nexport { DeferStreamDirectiveOnRootFieldRule } from './rules/DeferStreamDirectiveOnRootFieldRule.ts';\n\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Operations\"\nexport { DeferStreamDirectiveOnValidOperationsRule } from './rules/DeferStreamDirectiveOnValidOperationsRule.ts';\n\n// Spec Section: \"Executable Definitions\"\nexport { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule.ts';\n\n// Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\nexport { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule.ts';\n\n// Spec Section: \"Fragments on Composite Types\"\nexport { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule.ts';\n\n// Spec Section: \"Argument Names\"\nexport { KnownArgumentNamesRule } from './rules/KnownArgumentNamesRule.ts';\n\n// Spec Section: \"Directives Are Defined\"\nexport { KnownDirectivesRule } from './rules/KnownDirectivesRule.ts';\n\n// Spec Section: \"Fragment spread target defined\"\nexport { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule.ts';\n\n// Spec Section: \"Operation Type Existence\"\nexport { KnownOperationTypesRule } from './rules/KnownOperationTypesRule.ts';\n\n// Spec Section: \"Fragment Spread Type Existence\"\nexport { KnownTypeNamesRule } from './rules/KnownTypeNamesRule.ts';\n\n// Spec Section: \"Lone Anonymous Operation\"\nexport { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule.ts';\n\n// Spec Section: \"Fragments must not form cycles\"\nexport { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule.ts';\n\n// Spec Section: \"All Variable Used Defined\"\nexport { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule.ts';\n\n// Spec Section: \"Fragments must be used\"\nexport { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule.ts';\n\n// Spec Section: \"All Variables Used\"\nexport { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule.ts';\n\n// Spec Section: \"Field Selection Merging\"\nexport { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule.ts';\n\n// Spec Section: \"Fragment spread is possible\"\nexport { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule.ts';\n\n// Spec Section: \"Argument Optionality\"\nexport { ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArgumentsRule.ts';\n\n// Spec Section: \"Leaf Field Selections\"\nexport { ScalarLeafsRule } from './rules/ScalarLeafsRule.ts';\n\n// Spec Section: \"Subscriptions with Single Root Field\"\nexport { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule.ts';\n\n// Spec Section: \"Stream Directives Are Used On List Fields\"\nexport { StreamDirectiveOnListFieldRule } from './rules/StreamDirectiveOnListFieldRule.ts';\n\n// Spec Section: \"Argument Uniqueness\"\nexport { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule.ts';\n\n// Spec Section: \"Directives Are Unique Per Location\"\nexport { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule.ts';\n\n// Spec Section: \"Fragment Name Uniqueness\"\nexport { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule.ts';\n\n// Spec Section: \"Input Object Field Uniqueness\"\nexport { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule.ts';\n\n// Spec Section: \"Operation Name Uniqueness\"\nexport { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule.ts';\n\n// Spec Section: \"Variable Uniqueness\"\nexport { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule.ts';\n\n// Spec Section: \"Values Type Correctness\"\nexport { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule.ts';\n\n// Spec Section: \"Variables are Input Types\"\nexport { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule.ts';\n\n// Spec Section: \"All Variable Usages Are Allowed\"\nexport { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule.ts';\n\nexport { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.ts';\n\n// SDL-specific validation rules\nexport { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule.ts';\nexport { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule.ts';\nexport { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule.ts';\nexport { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule.ts';\nexport { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule.ts';\nexport { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule.ts';\nexport { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule.ts';\nexport { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule.ts';\n\n// Optional rules not defined by the GraphQL Specification\nexport { NoDeprecatedCustomRule } from './rules/custom/NoDeprecatedCustomRule.ts';\nexport { NoSchemaIntrospectionCustomRule } from './rules/custom/NoSchemaIntrospectionCustomRule.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs new file mode 100644 index 00000000..32dfebca --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs @@ -0,0 +1,46 @@ +export { validate } from "./validate.mjs"; +export { ValidationContext } from "./ValidationContext.mjs"; +export { specifiedRules, recommendedRules } from "./specifiedRules.mjs"; +export { DeferStreamDirectiveLabelRule } from "./rules/DeferStreamDirectiveLabelRule.mjs"; +export { DeferStreamDirectiveOnRootFieldRule } from "./rules/DeferStreamDirectiveOnRootFieldRule.mjs"; +export { DeferStreamDirectiveOnValidOperationsRule } from "./rules/DeferStreamDirectiveOnValidOperationsRule.mjs"; +export { ExecutableDefinitionsRule } from "./rules/ExecutableDefinitionsRule.mjs"; +export { FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectTypeRule.mjs"; +export { FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypesRule.mjs"; +export { KnownArgumentNamesRule } from "./rules/KnownArgumentNamesRule.mjs"; +export { KnownDirectivesRule } from "./rules/KnownDirectivesRule.mjs"; +export { KnownFragmentNamesRule } from "./rules/KnownFragmentNamesRule.mjs"; +export { KnownOperationTypesRule } from "./rules/KnownOperationTypesRule.mjs"; +export { KnownTypeNamesRule } from "./rules/KnownTypeNamesRule.mjs"; +export { LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperationRule.mjs"; +export { NoFragmentCyclesRule } from "./rules/NoFragmentCyclesRule.mjs"; +export { NoUndefinedVariablesRule } from "./rules/NoUndefinedVariablesRule.mjs"; +export { NoUnusedFragmentsRule } from "./rules/NoUnusedFragmentsRule.mjs"; +export { NoUnusedVariablesRule } from "./rules/NoUnusedVariablesRule.mjs"; +export { OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMergedRule.mjs"; +export { PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreadsRule.mjs"; +export { ProvidedRequiredArgumentsRule } from "./rules/ProvidedRequiredArgumentsRule.mjs"; +export { ScalarLeafsRule } from "./rules/ScalarLeafsRule.mjs"; +export { SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptionsRule.mjs"; +export { StreamDirectiveOnListFieldRule } from "./rules/StreamDirectiveOnListFieldRule.mjs"; +export { UniqueArgumentNamesRule } from "./rules/UniqueArgumentNamesRule.mjs"; +export { UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocationRule.mjs"; +export { UniqueFragmentNamesRule } from "./rules/UniqueFragmentNamesRule.mjs"; +export { UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNamesRule.mjs"; +export { UniqueOperationNamesRule } from "./rules/UniqueOperationNamesRule.mjs"; +export { UniqueVariableNamesRule } from "./rules/UniqueVariableNamesRule.mjs"; +export { ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectTypeRule.mjs"; +export { VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypesRule.mjs"; +export { VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPositionRule.mjs"; +export { MaxIntrospectionDepthRule } from "./rules/MaxIntrospectionDepthRule.mjs"; +export { LoneSchemaDefinitionRule } from "./rules/LoneSchemaDefinitionRule.mjs"; +export { UniqueOperationTypesRule } from "./rules/UniqueOperationTypesRule.mjs"; +export { UniqueTypeNamesRule } from "./rules/UniqueTypeNamesRule.mjs"; +export { UniqueEnumValueNamesRule } from "./rules/UniqueEnumValueNamesRule.mjs"; +export { UniqueFieldDefinitionNamesRule } from "./rules/UniqueFieldDefinitionNamesRule.mjs"; +export { UniqueArgumentDefinitionNamesRule } from "./rules/UniqueArgumentDefinitionNamesRule.mjs"; +export { UniqueDirectiveNamesRule } from "./rules/UniqueDirectiveNamesRule.mjs"; +export { PossibleTypeExtensionsRule } from "./rules/PossibleTypeExtensionsRule.mjs"; +export { NoDeprecatedCustomRule } from "./rules/custom/NoDeprecatedCustomRule.mjs"; +export { NoSchemaIntrospectionCustomRule } from "./rules/custom/NoSchemaIntrospectionCustomRule.mjs"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs.map new file mode 100644 index 00000000..83f0a935 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,uBAAsB;AAGzC,OAAO,EAAE,iBAAiB,EAAE,gCAA+B;AAI3D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,6BAA4B;AAGvE,OAAO,EAAE,6BAA6B,EAAE,kDAAiD;AAGzF,OAAO,EAAE,mCAAmC,EAAE,wDAAuD;AAGrG,OAAO,EAAE,yCAAyC,EAAE,8DAA6D;AAGjH,OAAO,EAAE,yBAAyB,EAAE,8CAA6C;AAGjF,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAG7E,OAAO,EAAE,6BAA6B,EAAE,kDAAiD;AAGzF,OAAO,EAAE,sBAAsB,EAAE,2CAA0C;AAG3E,OAAO,EAAE,mBAAmB,EAAE,wCAAuC;AAGrE,OAAO,EAAE,sBAAsB,EAAE,2CAA0C;AAG3E,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAG7E,OAAO,EAAE,kBAAkB,EAAE,uCAAsC;AAGnE,OAAO,EAAE,0BAA0B,EAAE,+CAA8C;AAGnF,OAAO,EAAE,oBAAoB,EAAE,yCAAwC;AAGvE,OAAO,EAAE,wBAAwB,EAAE,6CAA4C;AAG/E,OAAO,EAAE,qBAAqB,EAAE,0CAAyC;AAGzE,OAAO,EAAE,qBAAqB,EAAE,0CAAyC;AAGzE,OAAO,EAAE,gCAAgC,EAAE,qDAAoD;AAG/F,OAAO,EAAE,2BAA2B,EAAE,gDAA+C;AAGrF,OAAO,EAAE,6BAA6B,EAAE,kDAAiD;AAGzF,OAAO,EAAE,eAAe,EAAE,oCAAmC;AAG7D,OAAO,EAAE,4BAA4B,EAAE,iDAAgD;AAGvF,OAAO,EAAE,8BAA8B,EAAE,mDAAkD;AAG3F,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAG7E,OAAO,EAAE,+BAA+B,EAAE,oDAAmD;AAG7F,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAG7E,OAAO,EAAE,yBAAyB,EAAE,8CAA6C;AAGjF,OAAO,EAAE,wBAAwB,EAAE,6CAA4C;AAG/E,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAG7E,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAG7E,OAAO,EAAE,0BAA0B,EAAE,+CAA8C;AAGnF,OAAO,EAAE,8BAA8B,EAAE,mDAAkD;AAE3F,OAAO,EAAE,yBAAyB,EAAE,8CAA6C;AAGjF,OAAO,EAAE,wBAAwB,EAAE,6CAA4C;AAC/E,OAAO,EAAE,wBAAwB,EAAE,6CAA4C;AAC/E,OAAO,EAAE,mBAAmB,EAAE,wCAAuC;AACrE,OAAO,EAAE,wBAAwB,EAAE,6CAA4C;AAC/E,OAAO,EAAE,8BAA8B,EAAE,mDAAkD;AAC3F,OAAO,EAAE,iCAAiC,EAAE,sDAAqD;AACjG,OAAO,EAAE,wBAAwB,EAAE,6CAA4C;AAC/E,OAAO,EAAE,0BAA0B,EAAE,+CAA8C;AAGnF,OAAO,EAAE,sBAAsB,EAAE,kDAAiD;AAClF,OAAO,EAAE,+BAA+B,EAAE,2DAA0D","sourcesContent":["/**\n * Validate GraphQL documents and schemas with the specified validation rules.\n *\n * These exports are also available from the root `graphql` package.\n * @packageDocumentation\n */\n\nexport { validate } from './validate.ts';\nexport type { ValidationOptions } from './validate.ts';\n\nexport { ValidationContext } from './ValidationContext.ts';\nexport type { ValidationRule } from './ValidationContext.ts';\n\n// All validation rules in the GraphQL Specification.\nexport { specifiedRules, recommendedRules } from './specifiedRules.ts';\n\n// Spec Section: \"Defer And Stream Directive Labels Are Unique\"\nexport { DeferStreamDirectiveLabelRule } from './rules/DeferStreamDirectiveLabelRule.ts';\n\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Root Field\"\nexport { DeferStreamDirectiveOnRootFieldRule } from './rules/DeferStreamDirectiveOnRootFieldRule.ts';\n\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Operations\"\nexport { DeferStreamDirectiveOnValidOperationsRule } from './rules/DeferStreamDirectiveOnValidOperationsRule.ts';\n\n// Spec Section: \"Executable Definitions\"\nexport { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule.ts';\n\n// Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\nexport { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule.ts';\n\n// Spec Section: \"Fragments on Composite Types\"\nexport { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule.ts';\n\n// Spec Section: \"Argument Names\"\nexport { KnownArgumentNamesRule } from './rules/KnownArgumentNamesRule.ts';\n\n// Spec Section: \"Directives Are Defined\"\nexport { KnownDirectivesRule } from './rules/KnownDirectivesRule.ts';\n\n// Spec Section: \"Fragment spread target defined\"\nexport { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule.ts';\n\n// Spec Section: \"Operation Type Existence\"\nexport { KnownOperationTypesRule } from './rules/KnownOperationTypesRule.ts';\n\n// Spec Section: \"Fragment Spread Type Existence\"\nexport { KnownTypeNamesRule } from './rules/KnownTypeNamesRule.ts';\n\n// Spec Section: \"Lone Anonymous Operation\"\nexport { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule.ts';\n\n// Spec Section: \"Fragments must not form cycles\"\nexport { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule.ts';\n\n// Spec Section: \"All Variable Used Defined\"\nexport { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule.ts';\n\n// Spec Section: \"Fragments must be used\"\nexport { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule.ts';\n\n// Spec Section: \"All Variables Used\"\nexport { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule.ts';\n\n// Spec Section: \"Field Selection Merging\"\nexport { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule.ts';\n\n// Spec Section: \"Fragment spread is possible\"\nexport { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule.ts';\n\n// Spec Section: \"Argument Optionality\"\nexport { ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArgumentsRule.ts';\n\n// Spec Section: \"Leaf Field Selections\"\nexport { ScalarLeafsRule } from './rules/ScalarLeafsRule.ts';\n\n// Spec Section: \"Subscriptions with Single Root Field\"\nexport { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule.ts';\n\n// Spec Section: \"Stream Directives Are Used On List Fields\"\nexport { StreamDirectiveOnListFieldRule } from './rules/StreamDirectiveOnListFieldRule.ts';\n\n// Spec Section: \"Argument Uniqueness\"\nexport { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule.ts';\n\n// Spec Section: \"Directives Are Unique Per Location\"\nexport { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule.ts';\n\n// Spec Section: \"Fragment Name Uniqueness\"\nexport { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule.ts';\n\n// Spec Section: \"Input Object Field Uniqueness\"\nexport { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule.ts';\n\n// Spec Section: \"Operation Name Uniqueness\"\nexport { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule.ts';\n\n// Spec Section: \"Variable Uniqueness\"\nexport { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule.ts';\n\n// Spec Section: \"Values Type Correctness\"\nexport { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule.ts';\n\n// Spec Section: \"Variables are Input Types\"\nexport { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule.ts';\n\n// Spec Section: \"All Variable Usages Are Allowed\"\nexport { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule.ts';\n\nexport { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.ts';\n\n// SDL-specific validation rules\nexport { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule.ts';\nexport { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule.ts';\nexport { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule.ts';\nexport { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule.ts';\nexport { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule.ts';\nexport { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule.ts';\nexport { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule.ts';\nexport { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule.ts';\n\n// Optional rules not defined by the GraphQL Specification\nexport { NoDeprecatedCustomRule } from './rules/custom/NoDeprecatedCustomRule.ts';\nexport { NoSchemaIntrospectionCustomRule } from './rules/custom/NoSchemaIntrospectionCustomRule.ts';\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.mts new file mode 100644 index 00000000..b494c0b2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.mts @@ -0,0 +1,38 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Defer and stream directive labels are unique + * + * A GraphQL document is only valid if defer and stream directives' label argument is static and unique. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate, DeferStreamDirectiveLabelRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * friends: [String] + * } + * `); + * const invalidDocument = parse(` + * { + * friends @stream(label: "friends") + * other: friends @stream(label: "friends") + * } + * `); + * const validDocument = parse(` + * { + * friends @stream(label: "friends") + * other: friends @stream(label: "otherFriends") + * } + * `); + * + * validate(schema, invalidDocument, [DeferStreamDirectiveLabelRule]).length; // => 1 + * validate(schema, validDocument, [DeferStreamDirectiveLabelRule]); // => [] + * ``` + */ +export declare function DeferStreamDirectiveLabelRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.ts new file mode 100644 index 00000000..f654ee39 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.d.ts @@ -0,0 +1,38 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Defer and stream directive labels are unique + * + * A GraphQL document is only valid if defer and stream directives' label argument is static and unique. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate, DeferStreamDirectiveLabelRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * friends: [String] + * } + * `); + * const invalidDocument = parse(` + * { + * friends @stream(label: "friends") + * other: friends @stream(label: "friends") + * } + * `); + * const validDocument = parse(` + * { + * friends @stream(label: "friends") + * other: friends @stream(label: "otherFriends") + * } + * `); + * + * validate(schema, invalidDocument, [DeferStreamDirectiveLabelRule]).length; // => 1 + * validate(schema, validDocument, [DeferStreamDirectiveLabelRule]); // => [] + * ``` + */ +export declare function DeferStreamDirectiveLabelRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js new file mode 100644 index 00000000..9901a3a8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeferStreamDirectiveLabelRule = DeferStreamDirectiveLabelRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const directives_ts_1 = require("../../type/directives.js"); +function DeferStreamDirectiveLabelRule(context) { + const knownLabels = new Map(); + return { + Directive(node) { + if (node.name.value === directives_ts_1.GraphQLDeferDirective.name || + node.name.value === directives_ts_1.GraphQLStreamDirective.name) { + const labelArgument = node.arguments?.find((arg) => arg.name.value === 'label'); + const labelValue = labelArgument?.value; + if (!labelValue || labelValue.kind === kinds_ts_1.Kind.NULL) { + return; + } + if (labelValue.kind !== kinds_ts_1.Kind.STRING) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Argument "@${node.name.value}(label:)" must be a static string.`, { nodes: node })); + return; + } + const knownLabel = knownLabels.get(labelValue.value); + if (knownLabel != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.', { nodes: [knownLabel, node] })); + } + else { + knownLabels.set(labelValue.value, node); + } + } + }, + }; +} +//# sourceMappingURL=DeferStreamDirectiveLabelRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js.map new file mode 100644 index 00000000..90fb8243 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DeferStreamDirectiveLabelRule.js","sourceRoot":"","sources":["../../../src/validation/rules/DeferStreamDirectiveLabelRule.ts"],"names":[],"mappings":";;AAiDA,sEAyCC;AAxFD,iEAA2D;AAG3D,sDAA+C;AAG/C,4DAGkC;AAsClC,SAAgB,6BAA6B,CAC3C,OAA0B;IAE1B,MAAM,WAAW,GAAG,IAAI,GAAG,EAAyB,CAAC;IACrD,OAAO;QACL,SAAS,CAAC,IAAI;YACZ,IACE,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,qCAAqB,CAAC,IAAI;gBAC9C,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,sCAAsB,CAAC,IAAI,EAC/C,CAAC;gBACD,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CACxC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,CACpC,CAAC;gBACF,MAAM,UAAU,GAAG,aAAa,EAAE,KAAK,CAAC;gBACxC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,KAAK,eAAI,CAAC,IAAI,EAAE,CAAC;oBACjD,OAAO;gBACT,CAAC;gBACD,IAAI,UAAU,CAAC,IAAI,KAAK,eAAI,CAAC,MAAM,EAAE,CAAC;oBACpC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,cAAc,IAAI,CAAC,IAAI,CAAC,KAAK,oCAAoC,EACjE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;oBACF,OAAO;gBACT,CAAC;gBAED,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBACrD,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;oBACvB,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,mHAAmH,EACnH,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAC9B,CACF,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { DirectiveNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport {\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n} from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Defer and stream directive labels are unique\n *\n * A GraphQL document is only valid if defer and stream directives' label argument is static and unique.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate, DeferStreamDirectiveLabelRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * friends: [String]\n * }\n * `);\n * const invalidDocument = parse(`\n * {\n * friends @stream(label: \"friends\")\n * other: friends @stream(label: \"friends\")\n * }\n * `);\n * const validDocument = parse(`\n * {\n * friends @stream(label: \"friends\")\n * other: friends @stream(label: \"otherFriends\")\n * }\n * `);\n *\n * validate(schema, invalidDocument, [DeferStreamDirectiveLabelRule]).length; // => 1\n * validate(schema, validDocument, [DeferStreamDirectiveLabelRule]); // => []\n * ```\n */\nexport function DeferStreamDirectiveLabelRule(\n context: ValidationContext,\n): ASTVisitor {\n const knownLabels = new Map();\n return {\n Directive(node) {\n if (\n node.name.value === GraphQLDeferDirective.name ||\n node.name.value === GraphQLStreamDirective.name\n ) {\n const labelArgument = node.arguments?.find(\n (arg) => arg.name.value === 'label',\n );\n const labelValue = labelArgument?.value;\n if (!labelValue || labelValue.kind === Kind.NULL) {\n return;\n }\n if (labelValue.kind !== Kind.STRING) {\n context.reportError(\n new GraphQLError(\n `Argument \"@${node.name.value}(label:)\" must be a static string.`,\n { nodes: node },\n ),\n );\n return;\n }\n\n const knownLabel = knownLabels.get(labelValue.value);\n if (knownLabel != null) {\n context.reportError(\n new GraphQLError(\n 'Value for arguments \"defer(label:)\" and \"stream(label:)\" must be unique across all Defer/Stream directive usages.',\n { nodes: [knownLabel, node] },\n ),\n );\n } else {\n knownLabels.set(labelValue.value, node);\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs new file mode 100644 index 00000000..301f390d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs @@ -0,0 +1,30 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { GraphQLDeferDirective, GraphQLStreamDirective, } from "../../type/directives.mjs"; +export function DeferStreamDirectiveLabelRule(context) { + const knownLabels = new Map(); + return { + Directive(node) { + if (node.name.value === GraphQLDeferDirective.name || + node.name.value === GraphQLStreamDirective.name) { + const labelArgument = node.arguments?.find((arg) => arg.name.value === 'label'); + const labelValue = labelArgument?.value; + if (!labelValue || labelValue.kind === Kind.NULL) { + return; + } + if (labelValue.kind !== Kind.STRING) { + context.reportError(new GraphQLError(`Argument "@${node.name.value}(label:)" must be a static string.`, { nodes: node })); + return; + } + const knownLabel = knownLabels.get(labelValue.value); + if (knownLabel != null) { + context.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.', { nodes: [knownLabel, node] })); + } + else { + knownLabels.set(labelValue.value, node); + } + } + }, + }; +} +//# sourceMappingURL=DeferStreamDirectiveLabelRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs.map new file mode 100644 index 00000000..11d1b9e1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DeferStreamDirectiveLabelRule.js","sourceRoot":"","sources":["../../../src/validation/rules/DeferStreamDirectiveLabelRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAG/C,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,kCAAiC;AAsClC,MAAM,UAAU,6BAA6B,CAC3C,OAA0B;IAE1B,MAAM,WAAW,GAAG,IAAI,GAAG,EAAyB,CAAC;IACrD,OAAO;QACL,SAAS,CAAC,IAAI;YACZ,IACE,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,qBAAqB,CAAC,IAAI;gBAC9C,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,sBAAsB,CAAC,IAAI,EAC/C,CAAC;gBACD,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CACxC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,CACpC,CAAC;gBACF,MAAM,UAAU,GAAG,aAAa,EAAE,KAAK,CAAC;gBACxC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;oBACjD,OAAO;gBACT,CAAC;gBACD,IAAI,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;oBACpC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,cAAc,IAAI,CAAC,IAAI,CAAC,KAAK,oCAAoC,EACjE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;oBACF,OAAO;gBACT,CAAC;gBAED,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBACrD,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;oBACvB,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,mHAAmH,EACnH,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAC9B,CACF,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { DirectiveNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport {\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n} from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Defer and stream directive labels are unique\n *\n * A GraphQL document is only valid if defer and stream directives' label argument is static and unique.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate, DeferStreamDirectiveLabelRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * friends: [String]\n * }\n * `);\n * const invalidDocument = parse(`\n * {\n * friends @stream(label: \"friends\")\n * other: friends @stream(label: \"friends\")\n * }\n * `);\n * const validDocument = parse(`\n * {\n * friends @stream(label: \"friends\")\n * other: friends @stream(label: \"otherFriends\")\n * }\n * `);\n *\n * validate(schema, invalidDocument, [DeferStreamDirectiveLabelRule]).length; // => 1\n * validate(schema, validDocument, [DeferStreamDirectiveLabelRule]); // => []\n * ```\n */\nexport function DeferStreamDirectiveLabelRule(\n context: ValidationContext,\n): ASTVisitor {\n const knownLabels = new Map();\n return {\n Directive(node) {\n if (\n node.name.value === GraphQLDeferDirective.name ||\n node.name.value === GraphQLStreamDirective.name\n ) {\n const labelArgument = node.arguments?.find(\n (arg) => arg.name.value === 'label',\n );\n const labelValue = labelArgument?.value;\n if (!labelValue || labelValue.kind === Kind.NULL) {\n return;\n }\n if (labelValue.kind !== Kind.STRING) {\n context.reportError(\n new GraphQLError(\n `Argument \"@${node.name.value}(label:)\" must be a static string.`,\n { nodes: node },\n ),\n );\n return;\n }\n\n const knownLabel = knownLabels.get(labelValue.value);\n if (knownLabel != null) {\n context.reportError(\n new GraphQLError(\n 'Value for arguments \"defer(label:)\" and \"stream(label:)\" must be unique across all Defer/Stream directive usages.',\n { nodes: [knownLabel, node] },\n ),\n );\n } else {\n knownLabels.set(labelValue.value, node);\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts new file mode 100644 index 00000000..632e75b4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.mts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Defer and stream directives are used on valid root field + * + * A GraphQL document is only valid if defer directives are not used on root mutation or subscription types. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * validate, + * DeferStreamDirectiveOnRootFieldRule, + * } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * message: String + * } + * + * type Mutation { + * updateMessage: String + * } + * `); + * const invalidDocument = parse(` + * mutation { ... @defer { updateMessage } } + * `); + * const validDocument = parse(` + * { ... @defer { message } } + * `); + * + * validate(schema, invalidDocument, [DeferStreamDirectiveOnRootFieldRule]).length; // => 1 + * validate(schema, validDocument, [DeferStreamDirectiveOnRootFieldRule]); // => [] + * ``` + */ +export declare function DeferStreamDirectiveOnRootFieldRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts new file mode 100644 index 00000000..ccd895db --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.d.ts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Defer and stream directives are used on valid root field + * + * A GraphQL document is only valid if defer directives are not used on root mutation or subscription types. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * validate, + * DeferStreamDirectiveOnRootFieldRule, + * } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * message: String + * } + * + * type Mutation { + * updateMessage: String + * } + * `); + * const invalidDocument = parse(` + * mutation { ... @defer { updateMessage } } + * `); + * const validDocument = parse(` + * { ... @defer { message } } + * `); + * + * validate(schema, invalidDocument, [DeferStreamDirectiveOnRootFieldRule]).length; // => 1 + * validate(schema, validDocument, [DeferStreamDirectiveOnRootFieldRule]); // => [] + * ``` + */ +export declare function DeferStreamDirectiveOnRootFieldRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js new file mode 100644 index 00000000..f9472895 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js @@ -0,0 +1,84 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeferStreamDirectiveOnRootFieldRule = DeferStreamDirectiveOnRootFieldRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const directives_ts_1 = require("../../type/directives.js"); +function DeferStreamDirectiveOnRootFieldRule(context) { + return { + OperationDefinition(node) { + const document = context.getDocument(); + const fragments = new Map(); + for (const definition of document.definitions) { + if (definition.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION) { + fragments.set(definition.name.value, definition); + } + } + if (node.operation !== 'subscription' && node.operation !== 'mutation') { + return; + } + const schema = context.getSchema(); + const rootType = schema.getRootType(node.operation); + if (rootType) { + forbidDeferStream({ + context, + operationType: node.operation, + rootType, + fragments, + selectionSet: node.selectionSet, + visitedFragments: new Set(), + }); + } + }, + }; +} +function forbidDeferStream({ context, operationType, rootType, fragments, selectionSet, visitedFragments, }) { + for (const selection of selectionSet.selections) { + if (selection.kind === 'Field') { + const stream = selection.directives?.find((d) => d.name.value === directives_ts_1.GraphQLStreamDirective.name); + if (stream) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Stream directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: stream })); + } + } + else if (selection.kind === 'FragmentSpread') { + const fragmentName = selection.name.value; + if (visitedFragments.has(fragmentName)) { + continue; + } + const fragment = fragments.get(fragmentName); + if (fragment) { + const defer = getDeferDirective(selection); + if (defer !== undefined) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Defer directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: defer })); + } + forbidDeferStream({ + context, + operationType, + rootType, + fragments, + selectionSet: fragment.selectionSet, + visitedFragments, + }); + } + visitedFragments.add(fragmentName); + } + else if (selection.kind === 'InlineFragment') { + const defer = getDeferDirective(selection); + if (defer !== undefined) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Defer directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: defer })); + } + forbidDeferStream({ + context, + operationType, + rootType, + fragments, + selectionSet: selection.selectionSet, + visitedFragments, + }); + } + } +} +function getDeferDirective(fragment) { + return fragment.directives?.find((d) => d.name.value === directives_ts_1.GraphQLDeferDirective.name); +} +//# sourceMappingURL=DeferStreamDirectiveOnRootFieldRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js.map new file mode 100644 index 00000000..51c32167 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DeferStreamDirectiveOnRootFieldRule.js","sourceRoot":"","sources":["../../../src/validation/rules/DeferStreamDirectiveOnRootFieldRule.ts"],"names":[],"mappings":";;AA0DA,kFA8BC;AAtFD,iEAA2D;AAU3D,sDAA+C;AAI/C,4DAGkC;AAuClC,SAAgB,mCAAmC,CACjD,OAA0B;IAE1B,OAAO;QACL,mBAAmB,CAAC,IAA6B;YAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YACvC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkC,CAAC;YAE5D,KAAK,MAAM,UAA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E,SAAS,CAAC,YAAY;gBACpC,gBAAgB;aACjB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAiD;IAC1E,OAAO,QAAQ,CAAC,UAAU,EAAE,IAAI,CAC9B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,qCAAqB,CAAC,IAAI,CACnD,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n OperationDefinitionNode,\n OperationTypeNode,\n SelectionSetNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLObjectType } from '../../type/definition.ts';\nimport {\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n} from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Defer and stream directives are used on valid root field\n *\n * A GraphQL document is only valid if defer directives are not used on root mutation or subscription types.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * validate,\n * DeferStreamDirectiveOnRootFieldRule,\n * } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * message: String\n * }\n *\n * type Mutation {\n * updateMessage: String\n * }\n * `);\n * const invalidDocument = parse(`\n * mutation { ... @defer { updateMessage } }\n * `);\n * const validDocument = parse(`\n * { ... @defer { message } }\n * `);\n *\n * validate(schema, invalidDocument, [DeferStreamDirectiveOnRootFieldRule]).length; // => 1\n * validate(schema, validDocument, [DeferStreamDirectiveOnRootFieldRule]); // => []\n * ```\n */\nexport function DeferStreamDirectiveOnRootFieldRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(node: OperationDefinitionNode) {\n const document = context.getDocument();\n const fragments = new Map();\n\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments.set(definition.name.value, definition);\n }\n }\n if (node.operation !== 'subscription' && node.operation !== 'mutation') {\n return;\n }\n const schema = context.getSchema();\n const rootType = schema.getRootType(node.operation);\n if (rootType) {\n forbidDeferStream({\n context,\n operationType: node.operation,\n rootType,\n fragments,\n selectionSet: node.selectionSet,\n visitedFragments: new Set(),\n });\n }\n },\n };\n}\n\nfunction forbidDeferStream({\n context,\n operationType,\n rootType,\n fragments,\n selectionSet,\n visitedFragments,\n}: {\n context: ValidationContext;\n operationType: OperationTypeNode;\n rootType: GraphQLObjectType;\n fragments: Map;\n selectionSet: SelectionSetNode;\n visitedFragments: Set;\n}) {\n for (const selection of selectionSet.selections) {\n if (selection.kind === 'Field') {\n const stream = selection.directives?.find(\n (d) => d.name.value === GraphQLStreamDirective.name,\n );\n if (stream) {\n context.reportError(\n new GraphQLError(\n `Stream directive cannot be used on root ${operationType} type \"${rootType}\".`,\n { nodes: stream },\n ),\n );\n }\n } else if (selection.kind === 'FragmentSpread') {\n const fragmentName = selection.name.value;\n if (visitedFragments.has(fragmentName)) {\n continue;\n }\n const fragment = fragments.get(fragmentName);\n if (fragment) {\n const defer = getDeferDirective(selection);\n if (defer !== undefined) {\n context.reportError(\n new GraphQLError(\n `Defer directive cannot be used on root ${operationType} type \"${rootType}\".`,\n { nodes: defer },\n ),\n );\n }\n forbidDeferStream({\n context,\n operationType,\n rootType,\n fragments,\n selectionSet: fragment.selectionSet,\n visitedFragments,\n });\n }\n visitedFragments.add(fragmentName);\n } else if (selection.kind === 'InlineFragment') {\n const defer = getDeferDirective(selection);\n if (defer !== undefined) {\n context.reportError(\n new GraphQLError(\n `Defer directive cannot be used on root ${operationType} type \"${rootType}\".`,\n { nodes: defer },\n ),\n );\n }\n forbidDeferStream({\n context,\n operationType,\n rootType,\n fragments,\n selectionSet: selection.selectionSet,\n visitedFragments,\n });\n }\n }\n}\n\nfunction getDeferDirective(fragment: FragmentSpreadNode | InlineFragmentNode) {\n return fragment.directives?.find(\n (d) => d.name.value === GraphQLDeferDirective.name,\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs new file mode 100644 index 00000000..cf2315fd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs @@ -0,0 +1,81 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { GraphQLDeferDirective, GraphQLStreamDirective, } from "../../type/directives.mjs"; +export function DeferStreamDirectiveOnRootFieldRule(context) { + return { + OperationDefinition(node) { + const document = context.getDocument(); + const fragments = new Map(); + for (const definition of document.definitions) { + if (definition.kind === Kind.FRAGMENT_DEFINITION) { + fragments.set(definition.name.value, definition); + } + } + if (node.operation !== 'subscription' && node.operation !== 'mutation') { + return; + } + const schema = context.getSchema(); + const rootType = schema.getRootType(node.operation); + if (rootType) { + forbidDeferStream({ + context, + operationType: node.operation, + rootType, + fragments, + selectionSet: node.selectionSet, + visitedFragments: new Set(), + }); + } + }, + }; +} +function forbidDeferStream({ context, operationType, rootType, fragments, selectionSet, visitedFragments, }) { + for (const selection of selectionSet.selections) { + if (selection.kind === 'Field') { + const stream = selection.directives?.find((d) => d.name.value === GraphQLStreamDirective.name); + if (stream) { + context.reportError(new GraphQLError(`Stream directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: stream })); + } + } + else if (selection.kind === 'FragmentSpread') { + const fragmentName = selection.name.value; + if (visitedFragments.has(fragmentName)) { + continue; + } + const fragment = fragments.get(fragmentName); + if (fragment) { + const defer = getDeferDirective(selection); + if (defer !== undefined) { + context.reportError(new GraphQLError(`Defer directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: defer })); + } + forbidDeferStream({ + context, + operationType, + rootType, + fragments, + selectionSet: fragment.selectionSet, + visitedFragments, + }); + } + visitedFragments.add(fragmentName); + } + else if (selection.kind === 'InlineFragment') { + const defer = getDeferDirective(selection); + if (defer !== undefined) { + context.reportError(new GraphQLError(`Defer directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: defer })); + } + forbidDeferStream({ + context, + operationType, + rootType, + fragments, + selectionSet: selection.selectionSet, + visitedFragments, + }); + } + } +} +function getDeferDirective(fragment) { + return fragment.directives?.find((d) => d.name.value === GraphQLDeferDirective.name); +} +//# sourceMappingURL=DeferStreamDirectiveOnRootFieldRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs.map new file mode 100644 index 00000000..7780f912 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DeferStreamDirectiveOnRootFieldRule.js","sourceRoot":"","sources":["../../../src/validation/rules/DeferStreamDirectiveOnRootFieldRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAU3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAI/C,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,kCAAiC;AAuClC,MAAM,UAAU,mCAAmC,CACjD,OAA0B;IAE1B,OAAO;QACL,mBAAmB,CAAC,IAA6B;YAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YACvC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkC,CAAC;YAE5D,KAAK,MA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EAAE,SAAS,CAAC,YAAY;gBACpC,gBAAgB;aACjB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAiD;IAC1E,OAAO,QAAQ,CAAC,UAAU,EAAE,IAAI,CAC9B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,qBAAqB,CAAC,IAAI,CACnD,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n OperationDefinitionNode,\n OperationTypeNode,\n SelectionSetNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLObjectType } from '../../type/definition.ts';\nimport {\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n} from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Defer and stream directives are used on valid root field\n *\n * A GraphQL document is only valid if defer directives are not used on root mutation or subscription types.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * validate,\n * DeferStreamDirectiveOnRootFieldRule,\n * } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * message: String\n * }\n *\n * type Mutation {\n * updateMessage: String\n * }\n * `);\n * const invalidDocument = parse(`\n * mutation { ... @defer { updateMessage } }\n * `);\n * const validDocument = parse(`\n * { ... @defer { message } }\n * `);\n *\n * validate(schema, invalidDocument, [DeferStreamDirectiveOnRootFieldRule]).length; // => 1\n * validate(schema, validDocument, [DeferStreamDirectiveOnRootFieldRule]); // => []\n * ```\n */\nexport function DeferStreamDirectiveOnRootFieldRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(node: OperationDefinitionNode) {\n const document = context.getDocument();\n const fragments = new Map();\n\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments.set(definition.name.value, definition);\n }\n }\n if (node.operation !== 'subscription' && node.operation !== 'mutation') {\n return;\n }\n const schema = context.getSchema();\n const rootType = schema.getRootType(node.operation);\n if (rootType) {\n forbidDeferStream({\n context,\n operationType: node.operation,\n rootType,\n fragments,\n selectionSet: node.selectionSet,\n visitedFragments: new Set(),\n });\n }\n },\n };\n}\n\nfunction forbidDeferStream({\n context,\n operationType,\n rootType,\n fragments,\n selectionSet,\n visitedFragments,\n}: {\n context: ValidationContext;\n operationType: OperationTypeNode;\n rootType: GraphQLObjectType;\n fragments: Map;\n selectionSet: SelectionSetNode;\n visitedFragments: Set;\n}) {\n for (const selection of selectionSet.selections) {\n if (selection.kind === 'Field') {\n const stream = selection.directives?.find(\n (d) => d.name.value === GraphQLStreamDirective.name,\n );\n if (stream) {\n context.reportError(\n new GraphQLError(\n `Stream directive cannot be used on root ${operationType} type \"${rootType}\".`,\n { nodes: stream },\n ),\n );\n }\n } else if (selection.kind === 'FragmentSpread') {\n const fragmentName = selection.name.value;\n if (visitedFragments.has(fragmentName)) {\n continue;\n }\n const fragment = fragments.get(fragmentName);\n if (fragment) {\n const defer = getDeferDirective(selection);\n if (defer !== undefined) {\n context.reportError(\n new GraphQLError(\n `Defer directive cannot be used on root ${operationType} type \"${rootType}\".`,\n { nodes: defer },\n ),\n );\n }\n forbidDeferStream({\n context,\n operationType,\n rootType,\n fragments,\n selectionSet: fragment.selectionSet,\n visitedFragments,\n });\n }\n visitedFragments.add(fragmentName);\n } else if (selection.kind === 'InlineFragment') {\n const defer = getDeferDirective(selection);\n if (defer !== undefined) {\n context.reportError(\n new GraphQLError(\n `Defer directive cannot be used on root ${operationType} type \"${rootType}\".`,\n { nodes: defer },\n ),\n );\n }\n forbidDeferStream({\n context,\n operationType,\n rootType,\n fragments,\n selectionSet: selection.selectionSet,\n visitedFragments,\n });\n }\n }\n}\n\nfunction getDeferDirective(fragment: FragmentSpreadNode | InlineFragmentNode) {\n return fragment.directives?.find(\n (d) => d.name.value === GraphQLDeferDirective.name,\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts new file mode 100644 index 00000000..c997b389 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.mts @@ -0,0 +1,60 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Defer And Stream Directives Are Used On Valid Operations + * + * A GraphQL document is only valid if defer and stream directives are not used on root mutation or subscription types. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * validate, + * DeferStreamDirectiveOnValidOperationsRule, + * } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * message: Message + * } + * + * type Subscription { + * message: Message + * } + * + * type Message { + * body: String + * } + * `); + * const invalidDocument = parse(` + * subscription { + * message { + * ...MessageBody @defer + * } + * } + * + * fragment MessageBody on Message { + * body + * } + * `); + * const validDocument = parse(` + * subscription { + * message { + * ...MessageBody @defer(if: false) + * } + * } + * + * fragment MessageBody on Message { + * body + * } + * `); + * + * validate(schema, invalidDocument, [DeferStreamDirectiveOnValidOperationsRule]) + * .length; // => 1 + * validate(schema, validDocument, [DeferStreamDirectiveOnValidOperationsRule]); // => [] + * ``` + */ +export declare function DeferStreamDirectiveOnValidOperationsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts new file mode 100644 index 00000000..5fdcc7e4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.d.ts @@ -0,0 +1,60 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Defer And Stream Directives Are Used On Valid Operations + * + * A GraphQL document is only valid if defer and stream directives are not used on root mutation or subscription types. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { + * validate, + * DeferStreamDirectiveOnValidOperationsRule, + * } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * message: Message + * } + * + * type Subscription { + * message: Message + * } + * + * type Message { + * body: String + * } + * `); + * const invalidDocument = parse(` + * subscription { + * message { + * ...MessageBody @defer + * } + * } + * + * fragment MessageBody on Message { + * body + * } + * `); + * const validDocument = parse(` + * subscription { + * message { + * ...MessageBody @defer(if: false) + * } + * } + * + * fragment MessageBody on Message { + * body + * } + * `); + * + * validate(schema, invalidDocument, [DeferStreamDirectiveOnValidOperationsRule]) + * .length; // => 1 + * validate(schema, validDocument, [DeferStreamDirectiveOnValidOperationsRule]); // => [] + * ``` + */ +export declare function DeferStreamDirectiveOnValidOperationsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js new file mode 100644 index 00000000..8a1ee263 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeferStreamDirectiveOnValidOperationsRule = DeferStreamDirectiveOnValidOperationsRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const ast_ts_1 = require("../../language/ast.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const directives_ts_1 = require("../../type/directives.js"); +function ifArgumentCanBeFalse(node) { + const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if'); + if (!ifArgument) { + return false; + } + if (ifArgument.value.kind === kinds_ts_1.Kind.BOOLEAN) { + if (ifArgument.value.value) { + return false; + } + } + else if (ifArgument.value.kind !== kinds_ts_1.Kind.VARIABLE) { + return false; + } + return true; +} +function canBeSkippedViaSkipDirective(node) { + const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if'); + if (!ifArgument) { + return true; + } + if (ifArgument.value.kind === kinds_ts_1.Kind.BOOLEAN) { + if (ifArgument.value.value) { + return true; + } + return false; + } + return true; +} +function canBeSkippedViaIncludeDirective(node) { + const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if'); + if (!ifArgument) { + return false; + } + if (ifArgument?.value.kind === kinds_ts_1.Kind.BOOLEAN) { + if (ifArgument.value.value) { + return false; + } + return true; + } + return true; +} +function DeferStreamDirectiveOnValidOperationsRule(context) { + return { + OperationDefinition(operation) { + if (operation.operation !== ast_ts_1.OperationTypeNode.SUBSCRIPTION) { + return; + } + const document = context.getDocument(); + const fragments = new Map(); + for (const definition of document.definitions) { + if (definition.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION) { + fragments.set(definition.name.value, definition); + } + } + const visitedFragments = new Set(); + forbidUnconditionalDeferStream({ + context, + fragments, + selectionSet: operation.selectionSet, + parentNodes: [], + visitedFragments, + }); + }, + }; +} +function forbidUnconditionalDeferStream({ context, fragments, selectionSet, parentNodes, visitedFragments, }) { + for (const selection of selectionSet.selections) { + const skip = selection.directives?.find((d) => d.name.value === directives_ts_1.GraphQLSkipDirective.name); + if (skip && canBeSkippedViaSkipDirective(skip)) { + continue; + } + const include = selection.directives?.find((d) => d.name.value === directives_ts_1.GraphQLIncludeDirective.name); + if (include && canBeSkippedViaIncludeDirective(include)) { + continue; + } + for (const directive of selection.directives ?? []) { + if (directive.name.value === directives_ts_1.GraphQLDeferDirective.name) { + if (!ifArgumentCanBeFalse(directive)) { + context.reportError(new GraphQLError_ts_1.GraphQLError('Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.', { nodes: [directive, ...parentNodes] })); + } + } + else if (directive.name.value === directives_ts_1.GraphQLStreamDirective.name) { + if (!ifArgumentCanBeFalse(directive)) { + context.reportError(new GraphQLError_ts_1.GraphQLError('Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.', { nodes: [directive, ...parentNodes] })); + } + } + } + if (selection.kind === 'FragmentSpread') { + const fragmentName = selection.name.value; + if (visitedFragments.has(fragmentName)) { + continue; + } + visitedFragments.add(fragmentName); + const fragment = fragments.get(fragmentName); + if (fragment) { + forbidUnconditionalDeferStream({ + context, + fragments, + parentNodes: [selection, ...parentNodes], + selectionSet: fragment?.selectionSet, + visitedFragments, + }); + } + } + else if (selection.selectionSet) { + forbidUnconditionalDeferStream({ + context, + fragments, + selectionSet: selection.selectionSet, + parentNodes, + visitedFragments, + }); + } + } +} +//# sourceMappingURL=DeferStreamDirectiveOnValidOperationsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js.map new file mode 100644 index 00000000..3a26dda9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DeferStreamDirectiveOnValidOperationsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/DeferStreamDirectiveOnValidOperationsRule.ts"],"names":[],"mappings":";;AA+IA,8FA0BC;AAvKD,iEAA2D;AAQ3D,kDAA0D;AAC1D,sDAA+C;AAG/C,4DAKkC;AAIlC,SAAS,oBAAoB,CAAC,IAAmB;IAG/C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;IAC1E,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,eAAI,CAAC,OAAO,EAAE,CAAC;QAC3C,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;SAAM,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,eAAI,CAAC,QAAQ,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,4BAA4B,CAAC,IAAmB;IAGvD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;IAC1E,IAAI,CAAC,UAAU,EAAE,CAAC;QAGhB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,eAAI,CAAC,OAAO,EAAE,CAAC;QAE3C,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAE3B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAGD,OAAO,IA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EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC,EAAE,CACvC,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;YACxC,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;YAC1C,IAAI,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBACvC,SAAS;YACX,CAAC;YACD,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC7C,IAAI,QAAQ,EAAE,CAAC;gBACb,8BAA8B,CAAC;oBAC7B,OAAO;oBACP,SAAS;oBACT,WAAW,EAAE,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC;oBACxC,YAAY,EAAE,QAAQ,EAAE,YAAY;oBACpC,gBAAgB;iBACjB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;aAAM,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;YAClC,8BAA8B,CAAC;gBAC7B,OAAO;gBACP,SAAS;gBACT,YAAY,EAAE,SAAS,CAAC,YAAY;gBACpC,WAAW;gBACX,gBAAgB;aACjB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n DirectiveNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n SelectionSetNode,\n} from '../../language/ast.ts';\nimport { OperationTypeNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLStreamDirective,\n} from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\nfunction ifArgumentCanBeFalse(node: DirectiveNode): boolean {\n // @defer(if: false) / @stream(if: false)\n // @defer(if: $shouldDefer) / @stream(if: $shouldStream)\n const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if');\n if (!ifArgument) {\n return false;\n }\n if (ifArgument.value.kind === Kind.BOOLEAN) {\n if (ifArgument.value.value) {\n return false;\n }\n } else if (ifArgument.value.kind !== Kind.VARIABLE) {\n return false;\n }\n return true;\n}\n\nfunction canBeSkippedViaSkipDirective(node: DirectiveNode): boolean {\n // @skip(if: true)\n // @skip(if: $shouldSkip)\n const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if');\n if (!ifArgument) {\n // Missing `if` is reported by ProvidedRequiredArgumentsRule. For this rule,\n // treat malformed @skip as potentially skipped to avoid duplicate errors.\n return true;\n }\n\n if (ifArgument.value.kind === Kind.BOOLEAN) {\n // If argument is a Static boolean\n if (ifArgument.value.value) {\n // always skipped\n return true;\n }\n // Never skipped\n return false;\n }\n\n // Can be skipped via variable\n return true;\n}\n\nfunction canBeSkippedViaIncludeDirective(node: DirectiveNode): boolean {\n // @include(if: false)\n // @include(if: $shouldInclude)\n const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if');\n if (!ifArgument) {\n // Missing `if` is reported by ProvidedRequiredArgumentsRule. For this rule,\n // treat malformed @include as not skippable.\n return false;\n }\n if (ifArgument?.value.kind === Kind.BOOLEAN) {\n // If argument is a Static boolean\n if (ifArgument.value.value) {\n // Never skipped\n return false;\n }\n // Always skipped\n return true;\n }\n\n // Can be skipped via variable\n return true;\n}\n\n/**\n * Defer And Stream Directives Are Used On Valid Operations\n *\n * A GraphQL document is only valid if defer and stream directives are not used on root mutation or subscription types.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * validate,\n * DeferStreamDirectiveOnValidOperationsRule,\n * } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * message: Message\n * }\n *\n * type Subscription {\n * message: Message\n * }\n *\n * type Message {\n * body: String\n * }\n * `);\n * const invalidDocument = parse(`\n * subscription {\n * message {\n * ...MessageBody @defer\n * }\n * }\n *\n * fragment MessageBody on Message {\n * body\n * }\n * `);\n * const validDocument = parse(`\n * subscription {\n * message {\n * ...MessageBody @defer(if: false)\n * }\n * }\n *\n * fragment MessageBody on Message {\n * body\n * }\n * `);\n *\n * validate(schema, invalidDocument, [DeferStreamDirectiveOnValidOperationsRule])\n * .length; // => 1\n * validate(schema, validDocument, [DeferStreamDirectiveOnValidOperationsRule]); // => []\n * ```\n */\nexport function DeferStreamDirectiveOnValidOperationsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(operation) {\n if (operation.operation !== OperationTypeNode.SUBSCRIPTION) {\n return;\n }\n const document = context.getDocument();\n const fragments = new Map();\n\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments.set(definition.name.value, definition);\n }\n }\n const visitedFragments = new Set();\n forbidUnconditionalDeferStream({\n context,\n fragments,\n selectionSet: operation.selectionSet,\n parentNodes: [],\n visitedFragments,\n });\n },\n };\n}\n\nfunction forbidUnconditionalDeferStream({\n context,\n fragments,\n selectionSet,\n parentNodes,\n visitedFragments,\n}: {\n context: ValidationContext;\n fragments: Map;\n selectionSet: SelectionSetNode;\n parentNodes: Array;\n visitedFragments: Set;\n}) {\n for (const selection of selectionSet.selections) {\n const skip = selection.directives?.find(\n (d) => d.name.value === GraphQLSkipDirective.name,\n );\n if (skip && canBeSkippedViaSkipDirective(skip)) {\n continue;\n }\n const include = selection.directives?.find(\n (d) => d.name.value === GraphQLIncludeDirective.name,\n );\n if (include && canBeSkippedViaIncludeDirective(include)) {\n continue;\n }\n for (const directive of selection.directives ?? []) {\n if (directive.name.value === GraphQLDeferDirective.name) {\n if (!ifArgumentCanBeFalse(directive)) {\n context.reportError(\n new GraphQLError(\n 'Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n { nodes: [directive, ...parentNodes] },\n ),\n );\n }\n } else if (directive.name.value === GraphQLStreamDirective.name) {\n if (!ifArgumentCanBeFalse(directive)) {\n context.reportError(\n new GraphQLError(\n 'Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.',\n { nodes: [directive, ...parentNodes] },\n ),\n );\n }\n }\n }\n if (selection.kind === 'FragmentSpread') {\n const fragmentName = selection.name.value;\n if (visitedFragments.has(fragmentName)) {\n continue;\n }\n visitedFragments.add(fragmentName);\n const fragment = fragments.get(fragmentName);\n if (fragment) {\n forbidUnconditionalDeferStream({\n context,\n fragments,\n parentNodes: [selection, ...parentNodes],\n selectionSet: fragment?.selectionSet,\n visitedFragments,\n });\n }\n } else if (selection.selectionSet) {\n forbidUnconditionalDeferStream({\n context,\n fragments,\n selectionSet: selection.selectionSet,\n parentNodes,\n visitedFragments,\n });\n }\n }\n}\n\n// - For each {selection} in {selectionSet}:\n// - If {selection} provides the `@skip` directive, and the \"if\" argument on that\n// directive is not the boolean value {true}:\n// - Continue to the next {selection} in {selectionSet}.\n// - If {selection} provides the `@include` directive, and the \"if\" argument on\n// that directive is not the boolean value {false}:\n// - Continue to the next {selection} in {selectionSet}.\n// - For each {directive} on {selection}:\n// - If {directive} is `@defer` or `@stream`:\n// - Let {if} be the argument named \"if\" on {directive}.\n// - {if} must be defined.\n// - Let {argumentValue} be the value passed to {if}.\n// - {argumentValue} must be a variable, or the boolean value \"false\".\n// - If {selection} is a {FragmentSpread}:\n// - Let {fragmentSpreadName} be the name of {selection}.\n// - If {fragmentSpreadName} is in {visitedFragments}, continue with the next\n// {selection} in {selectionSet}.\n// - Add {fragmentSpreadName} to {visitedFragments}.\n// - Let {fragment} be the Fragment in the current Document whose name is\n// {fragmentSpreadName}.\n// - Let {fragmentSelectionSet} be the selection set of {selection}.\n// - {ForbidUnconditionalDeferStream(fragmentSelectionSet)}\n// - If {selection} is an {InlineFragment}:\n// - Let {fragmentSelectionSet} be the selection set of {selection}.\n// - {ForbidUnconditionalDeferStream(fragmentSelectionSet)}\n// - If {selection} is a {Field}:\n// - Let {fieldSelectionSet} be the selection set of {selection}.\n// - {ForbidUnconditionalDeferStream(fieldSelectionSet)}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs new file mode 100644 index 00000000..fbc8e990 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs @@ -0,0 +1,120 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { OperationTypeNode } from "../../language/ast.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { GraphQLDeferDirective, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLStreamDirective, } from "../../type/directives.mjs"; +function ifArgumentCanBeFalse(node) { + const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if'); + if (!ifArgument) { + return false; + } + if (ifArgument.value.kind === Kind.BOOLEAN) { + if (ifArgument.value.value) { + return false; + } + } + else if (ifArgument.value.kind !== Kind.VARIABLE) { + return false; + } + return true; +} +function canBeSkippedViaSkipDirective(node) { + const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if'); + if (!ifArgument) { + return true; + } + if (ifArgument.value.kind === Kind.BOOLEAN) { + if (ifArgument.value.value) { + return true; + } + return false; + } + return true; +} +function canBeSkippedViaIncludeDirective(node) { + const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if'); + if (!ifArgument) { + return false; + } + if (ifArgument?.value.kind === Kind.BOOLEAN) { + if (ifArgument.value.value) { + return false; + } + return true; + } + return true; +} +export function DeferStreamDirectiveOnValidOperationsRule(context) { + return { + OperationDefinition(operation) { + if (operation.operation !== OperationTypeNode.SUBSCRIPTION) { + return; + } + const document = context.getDocument(); + const fragments = new Map(); + for (const definition of document.definitions) { + if (definition.kind === Kind.FRAGMENT_DEFINITION) { + fragments.set(definition.name.value, definition); + } + } + const visitedFragments = new Set(); + forbidUnconditionalDeferStream({ + context, + fragments, + selectionSet: operation.selectionSet, + parentNodes: [], + visitedFragments, + }); + }, + }; +} +function forbidUnconditionalDeferStream({ context, fragments, selectionSet, parentNodes, visitedFragments, }) { + for (const selection of selectionSet.selections) { + const skip = selection.directives?.find((d) => d.name.value === GraphQLSkipDirective.name); + if (skip && canBeSkippedViaSkipDirective(skip)) { + continue; + } + const include = selection.directives?.find((d) => d.name.value === GraphQLIncludeDirective.name); + if (include && canBeSkippedViaIncludeDirective(include)) { + continue; + } + for (const directive of selection.directives ?? []) { + if (directive.name.value === GraphQLDeferDirective.name) { + if (!ifArgumentCanBeFalse(directive)) { + context.reportError(new GraphQLError('Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.', { nodes: [directive, ...parentNodes] })); + } + } + else if (directive.name.value === GraphQLStreamDirective.name) { + if (!ifArgumentCanBeFalse(directive)) { + context.reportError(new GraphQLError('Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.', { nodes: [directive, ...parentNodes] })); + } + } + } + if (selection.kind === 'FragmentSpread') { + const fragmentName = selection.name.value; + if (visitedFragments.has(fragmentName)) { + continue; + } + visitedFragments.add(fragmentName); + const fragment = fragments.get(fragmentName); + if (fragment) { + forbidUnconditionalDeferStream({ + context, + fragments, + parentNodes: [selection, ...parentNodes], + selectionSet: fragment?.selectionSet, + visitedFragments, + }); + } + } + else if (selection.selectionSet) { + forbidUnconditionalDeferStream({ + context, + fragments, + selectionSet: selection.selectionSet, + parentNodes, + visitedFragments, + }); + } + } +} +//# sourceMappingURL=DeferStreamDirectiveOnValidOperationsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs.map new file mode 100644 index 00000000..e1e83166 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DeferStreamDirectiveOnValidOperationsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/DeferStreamDirectiveOnValidOperationsRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAQ3D,OAAO,EAAE,iBAAiB,EAAE,+BAA8B;AAC1D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAG/C,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,GACvB,kCAAiC;AAIlC,SAAS,oBAAoB,CAAC,IAAmB;IAG/C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;IAC1E,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3C,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;SAAM,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,4BAA4B,CAAC,IAAmB;IAGvD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC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AC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n DirectiveNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n SelectionSetNode,\n} from '../../language/ast.ts';\nimport { OperationTypeNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport {\n GraphQLDeferDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLStreamDirective,\n} from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\nfunction ifArgumentCanBeFalse(node: DirectiveNode): boolean {\n // @defer(if: false) / @stream(if: false)\n // @defer(if: $shouldDefer) / @stream(if: $shouldStream)\n const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if');\n if (!ifArgument) {\n return false;\n }\n if (ifArgument.value.kind === Kind.BOOLEAN) {\n if (ifArgument.value.value) {\n return false;\n }\n } else if (ifArgument.value.kind !== Kind.VARIABLE) {\n return false;\n }\n return true;\n}\n\nfunction canBeSkippedViaSkipDirective(node: DirectiveNode): boolean {\n // @skip(if: true)\n // @skip(if: $shouldSkip)\n const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if');\n if (!ifArgument) {\n // Missing `if` is reported by ProvidedRequiredArgumentsRule. For this rule,\n // treat malformed @skip as potentially skipped to avoid duplicate errors.\n return true;\n }\n\n if (ifArgument.value.kind === Kind.BOOLEAN) {\n // If argument is a Static boolean\n if (ifArgument.value.value) {\n // always skipped\n return true;\n }\n // Never skipped\n return false;\n }\n\n // Can be skipped via variable\n return true;\n}\n\nfunction canBeSkippedViaIncludeDirective(node: DirectiveNode): boolean {\n // @include(if: false)\n // @include(if: $shouldInclude)\n const ifArgument = node.arguments?.find((arg) => arg.name.value === 'if');\n if (!ifArgument) {\n // Missing `if` is reported by ProvidedRequiredArgumentsRule. For this rule,\n // treat malformed @include as not skippable.\n return false;\n }\n if (ifArgument?.value.kind === Kind.BOOLEAN) {\n // If argument is a Static boolean\n if (ifArgument.value.value) {\n // Never skipped\n return false;\n }\n // Always skipped\n return true;\n }\n\n // Can be skipped via variable\n return true;\n}\n\n/**\n * Defer And Stream Directives Are Used On Valid Operations\n *\n * A GraphQL document is only valid if defer and stream directives are not used on root mutation or subscription types.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import {\n * validate,\n * DeferStreamDirectiveOnValidOperationsRule,\n * } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * message: Message\n * }\n *\n * type Subscription {\n * message: Message\n * }\n *\n * type Message {\n * body: String\n * }\n * `);\n * const invalidDocument = parse(`\n * subscription {\n * message {\n * ...MessageBody @defer\n * }\n * }\n *\n * fragment MessageBody on Message {\n * body\n * }\n * `);\n * const validDocument = parse(`\n * subscription {\n * message {\n * ...MessageBody @defer(if: false)\n * }\n * }\n *\n * fragment MessageBody on Message {\n * body\n * }\n * `);\n *\n * validate(schema, invalidDocument, [DeferStreamDirectiveOnValidOperationsRule])\n * .length; // => 1\n * validate(schema, validDocument, [DeferStreamDirectiveOnValidOperationsRule]); // => []\n * ```\n */\nexport function DeferStreamDirectiveOnValidOperationsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(operation) {\n if (operation.operation !== OperationTypeNode.SUBSCRIPTION) {\n return;\n }\n const document = context.getDocument();\n const fragments = new Map();\n\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments.set(definition.name.value, definition);\n }\n }\n const visitedFragments = new Set();\n forbidUnconditionalDeferStream({\n context,\n fragments,\n selectionSet: operation.selectionSet,\n parentNodes: [],\n visitedFragments,\n });\n },\n };\n}\n\nfunction forbidUnconditionalDeferStream({\n context,\n fragments,\n selectionSet,\n parentNodes,\n visitedFragments,\n}: {\n context: ValidationContext;\n fragments: Map;\n selectionSet: SelectionSetNode;\n parentNodes: Array;\n visitedFragments: Set;\n}) {\n for (const selection of selectionSet.selections) {\n const skip = selection.directives?.find(\n (d) => d.name.value === GraphQLSkipDirective.name,\n );\n if (skip && canBeSkippedViaSkipDirective(skip)) {\n continue;\n }\n const include = selection.directives?.find(\n (d) => d.name.value === GraphQLIncludeDirective.name,\n );\n if (include && canBeSkippedViaIncludeDirective(include)) {\n continue;\n }\n for (const directive of selection.directives ?? []) {\n if (directive.name.value === GraphQLDeferDirective.name) {\n if (!ifArgumentCanBeFalse(directive)) {\n context.reportError(\n new GraphQLError(\n 'Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.',\n { nodes: [directive, ...parentNodes] },\n ),\n );\n }\n } else if (directive.name.value === GraphQLStreamDirective.name) {\n if (!ifArgumentCanBeFalse(directive)) {\n context.reportError(\n new GraphQLError(\n 'Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.',\n { nodes: [directive, ...parentNodes] },\n ),\n );\n }\n }\n }\n if (selection.kind === 'FragmentSpread') {\n const fragmentName = selection.name.value;\n if (visitedFragments.has(fragmentName)) {\n continue;\n }\n visitedFragments.add(fragmentName);\n const fragment = fragments.get(fragmentName);\n if (fragment) {\n forbidUnconditionalDeferStream({\n context,\n fragments,\n parentNodes: [selection, ...parentNodes],\n selectionSet: fragment?.selectionSet,\n visitedFragments,\n });\n }\n } else if (selection.selectionSet) {\n forbidUnconditionalDeferStream({\n context,\n fragments,\n selectionSet: selection.selectionSet,\n parentNodes,\n visitedFragments,\n });\n }\n }\n}\n\n// - For each {selection} in {selectionSet}:\n// - If {selection} provides the `@skip` directive, and the \"if\" argument on that\n// directive is not the boolean value {true}:\n// - Continue to the next {selection} in {selectionSet}.\n// - If {selection} provides the `@include` directive, and the \"if\" argument on\n// that directive is not the boolean value {false}:\n// - Continue to the next {selection} in {selectionSet}.\n// - For each {directive} on {selection}:\n// - If {directive} is `@defer` or `@stream`:\n// - Let {if} be the argument named \"if\" on {directive}.\n// - {if} must be defined.\n// - Let {argumentValue} be the value passed to {if}.\n// - {argumentValue} must be a variable, or the boolean value \"false\".\n// - If {selection} is a {FragmentSpread}:\n// - Let {fragmentSpreadName} be the name of {selection}.\n// - If {fragmentSpreadName} is in {visitedFragments}, continue with the next\n// {selection} in {selectionSet}.\n// - Add {fragmentSpreadName} to {visitedFragments}.\n// - Let {fragment} be the Fragment in the current Document whose name is\n// {fragmentSpreadName}.\n// - Let {fragmentSelectionSet} be the selection set of {selection}.\n// - {ForbidUnconditionalDeferStream(fragmentSelectionSet)}\n// - If {selection} is an {InlineFragment}:\n// - Let {fragmentSelectionSet} be the selection set of {selection}.\n// - {ForbidUnconditionalDeferStream(fragmentSelectionSet)}\n// - If {selection} is a {Field}:\n// - Let {fieldSelectionSet} be the selection set of {selection}.\n// - {ForbidUnconditionalDeferStream(fieldSelectionSet)}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.mts new file mode 100644 index 00000000..cbd513e3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.mts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + * + * See https://spec.graphql.org/draft/#sec-Executable-Definitions + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ExecutableDefinitionsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * type Extra { field: String } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * ExecutableDefinitionsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * ExecutableDefinitionsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function ExecutableDefinitionsRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts new file mode 100644 index 00000000..d3bebb33 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + * + * See https://spec.graphql.org/draft/#sec-Executable-Definitions + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ExecutableDefinitionsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * type Extra { field: String } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * ExecutableDefinitionsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * ExecutableDefinitionsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function ExecutableDefinitionsRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js new file mode 100644 index 00000000..5e679041 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutableDefinitionsRule = ExecutableDefinitionsRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const predicates_ts_1 = require("../../language/predicates.js"); +function ExecutableDefinitionsRule(context) { + return { + Document(node) { + for (const definition of node.definitions) { + if (!(0, predicates_ts_1.isExecutableDefinitionNode)(definition)) { + const defName = definition.kind === kinds_ts_1.Kind.SCHEMA_DEFINITION || + definition.kind === kinds_ts_1.Kind.SCHEMA_EXTENSION + ? 'schema' + : '"' + definition.name.value + '"'; + context.reportError(new GraphQLError_ts_1.GraphQLError(`The ${defName} definition is not executable.`, { + nodes: definition, + })); + } + } + return false; + }, + }; +} +//# sourceMappingURL=ExecutableDefinitionsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.map new file mode 100644 index 00000000..0c7522bf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExecutableDefinitionsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/ExecutableDefinitionsRule.ts"],"names":[],"mappings":";;AAiDA,8DAsBC;AArED,iEAA2D;AAE3D,sDAA+C;AAC/C,gEAA0E;AA4C1E,SAAgB,yBAAyB,CACvC,OAA6B;IAE7B,OAAO;QACL,QAAQ,CAAC,IAAI;YACX,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1C,IAAI,CAAC,IAAA,0CAA0B,EAAC,UAAU,CAAC,EAAE,CAAC;oBAC5C,MAAM,OAAO,GACX,UAAU,CAAC,IAAI,KAAK,eAAI,CAAC,iBAAiB;wBAC1C,UAAU,CAAC,IAAI,KAAK,eAAI,CAAC,gBAAgB;wBACvC,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;oBACxC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CAAC,OAAO,OAAO,gCAAgC,EAAE;wBAC/D,KAAK,EAAE,UAAU;qBAClB,CAAC,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { Kind } from '../../language/kinds.ts';\nimport { isExecutableDefinitionNode } from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Executable definitions\n *\n * A GraphQL document is only valid for execution if all definitions are either\n * operation or fragment definitions.\n *\n * See https://spec.graphql.org/draft/#sec-Executable-Definitions\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ExecutableDefinitionsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * type Extra { field: String }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * ExecutableDefinitionsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * ExecutableDefinitionsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ExecutableDefinitionsRule(\n context: ASTValidationContext,\n): ASTVisitor {\n return {\n Document(node) {\n for (const definition of node.definitions) {\n if (!isExecutableDefinitionNode(definition)) {\n const defName =\n definition.kind === Kind.SCHEMA_DEFINITION ||\n definition.kind === Kind.SCHEMA_EXTENSION\n ? 'schema'\n : '\"' + definition.name.value + '\"';\n context.reportError(\n new GraphQLError(`The ${defName} definition is not executable.`, {\n nodes: definition,\n }),\n );\n }\n }\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs new file mode 100644 index 00000000..d587f00e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs @@ -0,0 +1,22 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { isExecutableDefinitionNode } from "../../language/predicates.mjs"; +export function ExecutableDefinitionsRule(context) { + return { + Document(node) { + for (const definition of node.definitions) { + if (!isExecutableDefinitionNode(definition)) { + const defName = definition.kind === Kind.SCHEMA_DEFINITION || + definition.kind === Kind.SCHEMA_EXTENSION + ? 'schema' + : '"' + definition.name.value + '"'; + context.reportError(new GraphQLError(`The ${defName} definition is not executable.`, { + nodes: definition, + })); + } + } + return false; + }, + }; +} +//# sourceMappingURL=ExecutableDefinitionsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs.map new file mode 100644 index 00000000..464df80c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ExecutableDefinitionsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/ExecutableDefinitionsRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAE3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,sCAAqC;AA4C1E,MAAM,UAAU,yBAAyB,CACvC,OAA6B;IAE7B,OAAO;QACL,QAAQ,CAAC,IAAI;YACX,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1C,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC5C,MAAM,OAAO,GACX,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,iBAAiB;wBAC1C,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,gBAAgB;wBACvC,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;oBACxC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CAAC,OAAO,OAAO,gCAAgC,EAAE;wBAC/D,KAAK,EAAE,UAAU;qBAClB,CAAC,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { Kind } from '../../language/kinds.ts';\nimport { isExecutableDefinitionNode } from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Executable definitions\n *\n * A GraphQL document is only valid for execution if all definitions are either\n * operation or fragment definitions.\n *\n * See https://spec.graphql.org/draft/#sec-Executable-Definitions\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ExecutableDefinitionsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * type Extra { field: String }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * ExecutableDefinitionsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * ExecutableDefinitionsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ExecutableDefinitionsRule(\n context: ASTValidationContext,\n): ASTVisitor {\n return {\n Document(node) {\n for (const definition of node.definitions) {\n if (!isExecutableDefinitionNode(definition)) {\n const defName =\n definition.kind === Kind.SCHEMA_DEFINITION ||\n definition.kind === Kind.SCHEMA_EXTENSION\n ? 'schema'\n : '\"' + definition.name.value + '\"';\n context.reportError(\n new GraphQLError(`The ${defName} definition is not executable.`, {\n nodes: definition,\n }),\n );\n }\n }\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.mts new file mode 100644 index 00000000..9e48558f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.mts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Fields on correct type + * + * A GraphQL document is only valid if all fields selected are defined by the + * parent type, or are an allowed meta field such as __typename. + * + * See https://spec.graphql.org/draft/#sec-Field-Selections + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { FieldsOnCorrectTypeRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { missing } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * FieldsOnCorrectTypeRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [FieldsOnCorrectTypeRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function FieldsOnCorrectTypeRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts new file mode 100644 index 00000000..efbe7d50 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Fields on correct type + * + * A GraphQL document is only valid if all fields selected are defined by the + * parent type, or are an allowed meta field such as __typename. + * + * See https://spec.graphql.org/draft/#sec-Field-Selections + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { FieldsOnCorrectTypeRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { missing } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * FieldsOnCorrectTypeRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [FieldsOnCorrectTypeRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function FieldsOnCorrectTypeRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js new file mode 100644 index 00000000..8ad1ba40 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FieldsOnCorrectTypeRule = FieldsOnCorrectTypeRule; +const didYouMean_ts_1 = require("../../jsutils/didYouMean.js"); +const naturalCompare_ts_1 = require("../../jsutils/naturalCompare.js"); +const suggestionList_ts_1 = require("../../jsutils/suggestionList.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const definition_ts_1 = require("../../type/definition.js"); +function FieldsOnCorrectTypeRule(context) { + return { + Field(node) { + const type = context.getParentType(); + if (type) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + const schema = context.getSchema(); + const fieldName = node.name.value; + let suggestion = (0, didYouMean_ts_1.didYouMean)('to use an inline fragment on', context.hideSuggestions + ? [] + : getSuggestedTypeNames(schema, type, fieldName)); + if (suggestion === '') { + suggestion = (0, didYouMean_ts_1.didYouMean)(context.hideSuggestions + ? [] + : getSuggestedFieldNames(type, fieldName)); + } + context.reportError(new GraphQLError_ts_1.GraphQLError(`Cannot query field "${fieldName}" on type "${type}".` + + suggestion, { nodes: node })); + } + } + }, + }; +} +function getSuggestedTypeNames(schema, type, fieldName) { + if (!(0, definition_ts_1.isAbstractType)(type)) { + return []; + } + const suggestedTypes = new Set(); + const usageCount = Object.create(null); + for (const possibleType of schema.getPossibleTypes(type)) { + if (possibleType.getFields()[fieldName] == null) { + continue; + } + suggestedTypes.add(possibleType); + usageCount[possibleType.name] = 1; + for (const possibleInterface of possibleType.getInterfaces()) { + if (possibleInterface.getFields()[fieldName] == null) { + continue; + } + suggestedTypes.add(possibleInterface); + usageCount[possibleInterface.name] = + (usageCount[possibleInterface.name] ?? 0) + 1; + } + } + return [...suggestedTypes] + .sort((typeA, typeB) => { + const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; + if (usageCountDiff !== 0) { + return usageCountDiff; + } + if ((0, definition_ts_1.isInterfaceType)(typeA) && schema.isSubType(typeA, typeB)) { + return -1; + } + if ((0, definition_ts_1.isInterfaceType)(typeB) && schema.isSubType(typeB, typeA)) { + return 1; + } + return (0, naturalCompare_ts_1.naturalCompare)(typeA.name, typeB.name); + }) + .map((x) => x.name); +} +function getSuggestedFieldNames(type, fieldName) { + if ((0, definition_ts_1.isObjectType)(type) || (0, definition_ts_1.isInterfaceType)(type)) { + const possibleFieldNames = Object.keys(type.getFields()); + return (0, suggestionList_ts_1.suggestionList)(fieldName, possibleFieldNames); + } + return []; +} +//# sourceMappingURL=FieldsOnCorrectTypeRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.map new file mode 100644 index 00000000..b32b0b3c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FieldsOnCorrectTypeRule.js","sourceRoot":"","sources":["../../../src/validation/rules/FieldsOnCorrectTypeRule.ts"],"names":[],"mappings":";;AA8DA,0DA0CC;AAtGD,+DAAyD;AACzD,uEAAiE;AACjE,uEAAiE;AAEjE,iEAA2D;AAU3D,4DAIkC;AA0ClC,SAAgB,uBAAuB,CACrC,OAA0B;IAE1B,OAAO;QACL,KAAK,CAAC,IAAe;YACnB,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YACrC,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAEd,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;oBACnC,MAAM,SAAS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e,EAAC,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACzD,OAAO,IAAA,kCAAc,EAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { naturalCompare } from '../../jsutils/naturalCompare.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FieldNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type {\n GraphQLInterfaceType,\n GraphQLObjectType,\n GraphQLOutputType,\n} from '../../type/definition.ts';\nimport {\n isAbstractType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.ts';\nimport type { GraphQLSchema } from '../../type/schema.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Fields on correct type\n *\n * A GraphQL document is only valid if all fields selected are defined by the\n * parent type, or are an allowed meta field such as __typename.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selections\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { FieldsOnCorrectTypeRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { missing }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * FieldsOnCorrectTypeRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [FieldsOnCorrectTypeRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function FieldsOnCorrectTypeRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n Field(node: FieldNode) {\n const type = context.getParentType();\n if (type) {\n const fieldDef = context.getFieldDef();\n if (!fieldDef) {\n // This field doesn't exist, lets look for suggestions.\n const schema = context.getSchema();\n const fieldName = node.name.value;\n\n // First determine if there are any suggested types to condition on.\n let suggestion = didYouMean(\n 'to use an inline fragment on',\n context.hideSuggestions\n ? []\n : getSuggestedTypeNames(schema, type, fieldName),\n );\n\n // If there are no suggested types, then perhaps this was a typo?\n if (suggestion === '') {\n suggestion = didYouMean(\n context.hideSuggestions\n ? []\n : getSuggestedFieldNames(type, fieldName),\n );\n }\n\n // Report an error, including helpful suggestions.\n context.reportError(\n new GraphQLError(\n `Cannot query field \"${fieldName}\" on type \"${type}\".` +\n suggestion,\n { nodes: node },\n ),\n );\n }\n }\n },\n };\n}\n\n/**\n * Go through all of the implementations of type, as well as the interfaces that\n * they implement. If any of those types include the provided field, suggest them,\n * sorted by how often the type is referenced.\n *\n * @internal\n */\nfunction getSuggestedTypeNames(\n schema: GraphQLSchema,\n type: GraphQLOutputType,\n fieldName: string,\n): Array {\n if (!isAbstractType(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n const suggestedTypes = new Set();\n const usageCount = Object.create(null);\n for (const possibleType of schema.getPossibleTypes(type)) {\n if (possibleType.getFields()[fieldName] == null) {\n continue;\n }\n\n // This object type defines this field.\n suggestedTypes.add(possibleType);\n usageCount[possibleType.name] = 1;\n\n for (const possibleInterface of possibleType.getInterfaces()) {\n if (possibleInterface.getFields()[fieldName] == null) {\n continue;\n }\n\n // This interface type defines this field.\n suggestedTypes.add(possibleInterface);\n usageCount[possibleInterface.name] =\n (usageCount[possibleInterface.name] ?? 0) + 1;\n }\n }\n\n return [...suggestedTypes]\n .sort((typeA, typeB) => {\n // Suggest both interface and object types based on how common they are.\n const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];\n if (usageCountDiff !== 0) {\n return usageCountDiff;\n }\n\n // Suggest super types first followed by subtypes\n if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) {\n return -1;\n }\n if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) {\n return 1;\n }\n\n return naturalCompare(typeA.name, typeB.name);\n })\n .map((x) => x.name);\n}\n\n/**\n * For the field name provided, determine if there are any similar field names\n * that may be the result of a typo.\n *\n * @internal\n */\nfunction getSuggestedFieldNames(\n type: GraphQLOutputType,\n fieldName: string,\n): Array {\n if (isObjectType(type) || isInterfaceType(type)) {\n const possibleFieldNames = Object.keys(type.getFields());\n return suggestionList(fieldName, possibleFieldNames);\n }\n // Otherwise, must be a Union type, which does not define fields.\n return [];\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs new file mode 100644 index 00000000..7384332b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs @@ -0,0 +1,74 @@ +import { didYouMean } from "../../jsutils/didYouMean.mjs"; +import { naturalCompare } from "../../jsutils/naturalCompare.mjs"; +import { suggestionList } from "../../jsutils/suggestionList.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { isAbstractType, isInterfaceType, isObjectType, } from "../../type/definition.mjs"; +export function FieldsOnCorrectTypeRule(context) { + return { + Field(node) { + const type = context.getParentType(); + if (type) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + const schema = context.getSchema(); + const fieldName = node.name.value; + let suggestion = didYouMean('to use an inline fragment on', context.hideSuggestions + ? [] + : getSuggestedTypeNames(schema, type, fieldName)); + if (suggestion === '') { + suggestion = didYouMean(context.hideSuggestions + ? [] + : getSuggestedFieldNames(type, fieldName)); + } + context.reportError(new GraphQLError(`Cannot query field "${fieldName}" on type "${type}".` + + suggestion, { nodes: node })); + } + } + }, + }; +} +function getSuggestedTypeNames(schema, type, fieldName) { + if (!isAbstractType(type)) { + return []; + } + const suggestedTypes = new Set(); + const usageCount = Object.create(null); + for (const possibleType of schema.getPossibleTypes(type)) { + if (possibleType.getFields()[fieldName] == null) { + continue; + } + suggestedTypes.add(possibleType); + usageCount[possibleType.name] = 1; + for (const possibleInterface of possibleType.getInterfaces()) { + if (possibleInterface.getFields()[fieldName] == null) { + continue; + } + suggestedTypes.add(possibleInterface); + usageCount[possibleInterface.name] = + (usageCount[possibleInterface.name] ?? 0) + 1; + } + } + return [...suggestedTypes] + .sort((typeA, typeB) => { + const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; + if (usageCountDiff !== 0) { + return usageCountDiff; + } + if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) { + return -1; + } + if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) { + return 1; + } + return naturalCompare(typeA.name, typeB.name); + }) + .map((x) => x.name); +} +function getSuggestedFieldNames(type, fieldName) { + if (isObjectType(type) || isInterfaceType(type)) { + const possibleFieldNames = Object.keys(type.getFields()); + return suggestionList(fieldName, possibleFieldNames); + } + return []; +} +//# sourceMappingURL=FieldsOnCorrectTypeRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs.map new file mode 100644 index 00000000..b45d98a0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"FieldsOnCorrectTypeRule.js","sourceRoot":"","sources":["../../../src/validation/rules/FieldsOnCorrectTypeRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,qCAAoC;AACzD,OAAO,EAAE,cAAc,EAAE,yCAAwC;AACjE,OAAO,EAAE,cAAc,EAAE,yCAAwC;AA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AC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;YAC7D,OAAO,CAAC,CAAC;QACX,CAAC;QAED,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAQD,SAAS,sBAAsB,CAC7B,IAAuB,EACvB,SAAiB;IAEjB,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACzD,OAAO,cAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { naturalCompare } from '../../jsutils/naturalCompare.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FieldNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type {\n GraphQLInterfaceType,\n GraphQLObjectType,\n GraphQLOutputType,\n} from '../../type/definition.ts';\nimport {\n isAbstractType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.ts';\nimport type { GraphQLSchema } from '../../type/schema.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Fields on correct type\n *\n * A GraphQL document is only valid if all fields selected are defined by the\n * parent type, or are an allowed meta field such as __typename.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selections\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { FieldsOnCorrectTypeRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { missing }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * FieldsOnCorrectTypeRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [FieldsOnCorrectTypeRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function FieldsOnCorrectTypeRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n Field(node: FieldNode) {\n const type = context.getParentType();\n if (type) {\n const fieldDef = context.getFieldDef();\n if (!fieldDef) {\n // This field doesn't exist, lets look for suggestions.\n const schema = context.getSchema();\n const fieldName = node.name.value;\n\n // First determine if there are any suggested types to condition on.\n let suggestion = didYouMean(\n 'to use an inline fragment on',\n context.hideSuggestions\n ? []\n : getSuggestedTypeNames(schema, type, fieldName),\n );\n\n // If there are no suggested types, then perhaps this was a typo?\n if (suggestion === '') {\n suggestion = didYouMean(\n context.hideSuggestions\n ? []\n : getSuggestedFieldNames(type, fieldName),\n );\n }\n\n // Report an error, including helpful suggestions.\n context.reportError(\n new GraphQLError(\n `Cannot query field \"${fieldName}\" on type \"${type}\".` +\n suggestion,\n { nodes: node },\n ),\n );\n }\n }\n },\n };\n}\n\n/**\n * Go through all of the implementations of type, as well as the interfaces that\n * they implement. If any of those types include the provided field, suggest them,\n * sorted by how often the type is referenced.\n *\n * @internal\n */\nfunction getSuggestedTypeNames(\n schema: GraphQLSchema,\n type: GraphQLOutputType,\n fieldName: string,\n): Array {\n if (!isAbstractType(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n const suggestedTypes = new Set();\n const usageCount = Object.create(null);\n for (const possibleType of schema.getPossibleTypes(type)) {\n if (possibleType.getFields()[fieldName] == null) {\n continue;\n }\n\n // This object type defines this field.\n suggestedTypes.add(possibleType);\n usageCount[possibleType.name] = 1;\n\n for (const possibleInterface of possibleType.getInterfaces()) {\n if (possibleInterface.getFields()[fieldName] == null) {\n continue;\n }\n\n // This interface type defines this field.\n suggestedTypes.add(possibleInterface);\n usageCount[possibleInterface.name] =\n (usageCount[possibleInterface.name] ?? 0) + 1;\n }\n }\n\n return [...suggestedTypes]\n .sort((typeA, typeB) => {\n // Suggest both interface and object types based on how common they are.\n const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];\n if (usageCountDiff !== 0) {\n return usageCountDiff;\n }\n\n // Suggest super types first followed by subtypes\n if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) {\n return -1;\n }\n if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) {\n return 1;\n }\n\n return naturalCompare(typeA.name, typeB.name);\n })\n .map((x) => x.name);\n}\n\n/**\n * For the field name provided, determine if there are any similar field names\n * that may be the result of a typo.\n *\n * @internal\n */\nfunction getSuggestedFieldNames(\n type: GraphQLOutputType,\n fieldName: string,\n): Array {\n if (isObjectType(type) || isInterfaceType(type)) {\n const possibleFieldNames = Object.keys(type.getFields());\n return suggestionList(fieldName, possibleFieldNames);\n }\n // Otherwise, must be a Union type, which does not define fields.\n return [];\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.mts new file mode 100644 index 00000000..40ca82bf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.mts @@ -0,0 +1,44 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Fragments on composite type + * + * Fragments use a type condition to determine if they apply, since fragments + * can only be spread into a composite type (object, interface, or union), the + * type condition must also be a composite type. + * + * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { FragmentsOnCompositeTypesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment Bad on String { length } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * FragmentsOnCompositeTypesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment Good on Query { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * FragmentsOnCompositeTypesRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function FragmentsOnCompositeTypesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts new file mode 100644 index 00000000..fc64d8c7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts @@ -0,0 +1,44 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Fragments on composite type + * + * Fragments use a type condition to determine if they apply, since fragments + * can only be spread into a composite type (object, interface, or union), the + * type condition must also be a composite type. + * + * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { FragmentsOnCompositeTypesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment Bad on String { length } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * FragmentsOnCompositeTypesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment Good on Query { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * FragmentsOnCompositeTypesRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function FragmentsOnCompositeTypesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js new file mode 100644 index 00000000..b1520a7f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FragmentsOnCompositeTypesRule = FragmentsOnCompositeTypesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const printer_ts_1 = require("../../language/printer.js"); +const definition_ts_1 = require("../../type/definition.js"); +const typeFromAST_ts_1 = require("../../utilities/typeFromAST.js"); +function FragmentsOnCompositeTypesRule(context) { + return { + InlineFragment(node) { + const typeCondition = node.typeCondition; + if (typeCondition) { + const type = (0, typeFromAST_ts_1.typeFromAST)(context.getSchema(), typeCondition); + if (type && !(0, definition_ts_1.isCompositeType)(type)) { + const typeStr = (0, printer_ts_1.print)(typeCondition); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Fragment cannot condition on non composite type "${typeStr}".`, { nodes: typeCondition })); + } + } + }, + FragmentDefinition(node) { + const type = (0, typeFromAST_ts_1.typeFromAST)(context.getSchema(), node.typeCondition); + if (type && !(0, definition_ts_1.isCompositeType)(type)) { + const typeStr = (0, printer_ts_1.print)(node.typeCondition); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, { nodes: node.typeCondition })); + } + }, + }; +} +//# sourceMappingURL=FragmentsOnCompositeTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.map new file mode 100644 index 00000000..ffc6ae66 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FragmentsOnCompositeTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/FragmentsOnCompositeTypesRule.ts"],"names":[],"mappings":";;AAqDA,sEAgCC;AAnFD,iEAA2D;AAE3D,0DAAkD;AAGlD,4DAA2D;AAE3D,mEAA6D;AA4C7D,SAAgB,6BAA6B,CAC3C,OAA0B;IAE1B,OAAO;QACL,cAAc,CAAC,IAAI;YACjB,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;YACzC,IAAI,aAAa,EAAE,CAAC;gBAClB,MAAM,IAAI,GAAG,IAAA,4BAAW,EAAC,OAAO,CAAC,SAAS,EAAE,EAAE,aAAa,CAAC,CAAC;gBAC7D,IAAI,IAAI,IAAI,CAAC,IAAA,+BAAe,EAAC,IAAI,CAAC,EAAE,CAAC;oBACnC,MAAM,OAAO,GAAG,IAAA,kBAAK,EAAC,aAAa,CAAC,CAAC;oBACrC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,oDAAoD,OAAO,IAAI,EAC/D,EAAE,KAAK,EAAE,aAAa,EAAE,CACzB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,kBAAkB,CAAC,IAAI;YACrB,MAAM,IAAI,GAAG,IAAA,4BAAW,EAAC,OAAO,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAClE,IAAI,IAAI,IAAI,CAAC,IAAA,+BAAe,EAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,MAAM,OAAO,GAAG,IAAA,kBAAK,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAC1C,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,aAAa,IAAI,CAAC,IAAI,CAAC,KAAK,6CAA6C,OAAO,IAAI,EACpF,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,CAC9B,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isCompositeType } from '../../type/definition.ts';\n\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Fragments on composite type\n *\n * Fragments use a type condition to determine if they apply, since fragments\n * can only be spread into a composite type (object, interface, or union), the\n * type condition must also be a composite type.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { FragmentsOnCompositeTypesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment Bad on String { length }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * FragmentsOnCompositeTypesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment Good on Query { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * FragmentsOnCompositeTypesRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function FragmentsOnCompositeTypesRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n InlineFragment(node) {\n const typeCondition = node.typeCondition;\n if (typeCondition) {\n const type = typeFromAST(context.getSchema(), typeCondition);\n if (type && !isCompositeType(type)) {\n const typeStr = print(typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment cannot condition on non composite type \"${typeStr}\".`,\n { nodes: typeCondition },\n ),\n );\n }\n }\n },\n FragmentDefinition(node) {\n const type = typeFromAST(context.getSchema(), node.typeCondition);\n if (type && !isCompositeType(type)) {\n const typeStr = print(node.typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment \"${node.name.value}\" cannot condition on non composite type \"${typeStr}\".`,\n { nodes: node.typeCondition },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs new file mode 100644 index 00000000..96aa31fd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs @@ -0,0 +1,26 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { print } from "../../language/printer.mjs"; +import { isCompositeType } from "../../type/definition.mjs"; +import { typeFromAST } from "../../utilities/typeFromAST.mjs"; +export function FragmentsOnCompositeTypesRule(context) { + return { + InlineFragment(node) { + const typeCondition = node.typeCondition; + if (typeCondition) { + const type = typeFromAST(context.getSchema(), typeCondition); + if (type && !isCompositeType(type)) { + const typeStr = print(typeCondition); + context.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${typeStr}".`, { nodes: typeCondition })); + } + } + }, + FragmentDefinition(node) { + const type = typeFromAST(context.getSchema(), node.typeCondition); + if (type && !isCompositeType(type)) { + const typeStr = print(node.typeCondition); + context.reportError(new GraphQLError(`Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, { nodes: node.typeCondition })); + } + }, + }; +} +//# sourceMappingURL=FragmentsOnCompositeTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs.map new file mode 100644 index 00000000..a028cf1e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"FragmentsOnCompositeTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/FragmentsOnCompositeTypesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAE3D,OAAO,EAAE,KAAK,EAAE,mCAAkC;AAGlD,OAAO,EAAE,eAAe,EAAE,kCAAiC;AAE3D,OAAO,EAAE,WAAW,EAAE,wCAAuC;AA4C7D,MAAM,UAAU,6BAA6B,CAC3C,OAA0B;IAE1B,OAAO;QACL,cAAc,CAAC,IAAI;YACjB,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;YACzC,IAAI,aAAa,EAAE,CAAC;gBAClB,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,aAAa,CAAC,CAAC;gBAC7D,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;oBACnC,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;oBACrC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,oDAAoD,OAAO,IAAI,EAC/D,EAAE,KAAK,EAAE,aAAa,EAAE,CACzB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,kBAAkB,CAAC,IAAI;YACrB,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAClE,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAC1C,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,aAAa,IAAI,CAAC,IAAI,CAAC,KAAK,6CAA6C,OAAO,IAAI,EACpF,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,CAC9B,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isCompositeType } from '../../type/definition.ts';\n\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Fragments on composite type\n *\n * Fragments use a type condition to determine if they apply, since fragments\n * can only be spread into a composite type (object, interface, or union), the\n * type condition must also be a composite type.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { FragmentsOnCompositeTypesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment Bad on String { length }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * FragmentsOnCompositeTypesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment Good on Query { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * FragmentsOnCompositeTypesRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function FragmentsOnCompositeTypesRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n InlineFragment(node) {\n const typeCondition = node.typeCondition;\n if (typeCondition) {\n const type = typeFromAST(context.getSchema(), typeCondition);\n if (type && !isCompositeType(type)) {\n const typeStr = print(typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment cannot condition on non composite type \"${typeStr}\".`,\n { nodes: typeCondition },\n ),\n );\n }\n }\n },\n FragmentDefinition(node) {\n const type = typeFromAST(context.getSchema(), node.typeCondition);\n if (type && !isCompositeType(type)) {\n const typeStr = print(node.typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment \"${node.name.value}\" cannot condition on non composite type \"${typeStr}\".`,\n { nodes: node.typeCondition },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.mts new file mode 100644 index 00000000..c2932dd5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.mts @@ -0,0 +1,44 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.mjs"; +/** + * Known argument names + * + * A GraphQL field is only valid if all supplied arguments are defined by + * that field. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names + * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownArgumentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: String): String + * } + * `); + * + * const invalidDocument = parse(` + * { field(unknown: "1") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * KnownArgumentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { field(arg: "1") } + * `); + * const validErrors = validate(schema, validDocument, [KnownArgumentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor; +/** @internal */ +export declare function KnownArgumentNamesOnDirectivesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts new file mode 100644 index 00000000..c5635de8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts @@ -0,0 +1,44 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.js"; +/** + * Known argument names + * + * A GraphQL field is only valid if all supplied arguments are defined by + * that field. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names + * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownArgumentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: String): String + * } + * `); + * + * const invalidDocument = parse(` + * { field(unknown: "1") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * KnownArgumentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { field(arg: "1") } + * `); + * const validErrors = validate(schema, validDocument, [KnownArgumentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor; +/** @internal */ +export declare function KnownArgumentNamesOnDirectivesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js new file mode 100644 index 00000000..a0afec94 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KnownArgumentNamesRule = KnownArgumentNamesRule; +exports.KnownArgumentNamesOnDirectivesRule = KnownArgumentNamesOnDirectivesRule; +const didYouMean_ts_1 = require("../../jsutils/didYouMean.js"); +const suggestionList_ts_1 = require("../../jsutils/suggestionList.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const directives_ts_1 = require("../../type/directives.js"); +function KnownArgumentNamesRule(context) { + return { + ...KnownArgumentNamesOnDirectivesRule(context), + FragmentArgument(argNode) { + const fragmentSignature = context.getFragmentSignature(); + if (fragmentSignature) { + const varDef = fragmentSignature.variableDefinitions.get(argNode.name.value); + if (!varDef) { + const argName = argNode.name.value; + const suggestions = context.hideSuggestions + ? [] + : (0, suggestionList_ts_1.suggestionList)(argName, Array.from(fragmentSignature.variableDefinitions.values()).map((varSignature) => varSignature.variable.name.value)); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Unknown argument "${argName}" on fragment "${fragmentSignature.definition.name.value}".` + + (0, didYouMean_ts_1.didYouMean)(suggestions), { nodes: argNode })); + } + } + }, + Argument(argNode) { + const argDef = context.getArgument(); + const fieldDef = context.getFieldDef(); + if (!argDef && fieldDef) { + const argName = argNode.name.value; + const suggestions = context.hideSuggestions + ? [] + : (0, suggestionList_ts_1.suggestionList)(argName, fieldDef.args.map((arg) => arg.name)); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Unknown argument "${argName}" on field "${fieldDef}".` + + (0, didYouMean_ts_1.didYouMean)(suggestions), { nodes: argNode })); + } + }, + }; +} +function KnownArgumentNamesOnDirectivesRule(context) { + const directiveArgs = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : directives_ts_1.specifiedDirectives; + for (const directive of definedDirectives) { + directiveArgs.set(directive.name, directive.args.map((arg) => arg.name)); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === kinds_ts_1.Kind.DIRECTIVE_DEFINITION) { + const argsNodes = def.arguments ?? []; + directiveArgs.set(def.name.value, argsNodes.map((arg) => arg.name.value)); + } + } + return { + Directive(directiveNode) { + const directiveName = directiveNode.name.value; + const knownArgs = directiveArgs.get(directiveName); + if (directiveNode.arguments != null && knownArgs != null) { + for (const argNode of directiveNode.arguments) { + const argName = argNode.name.value; + if (!knownArgs.includes(argName)) { + const suggestions = (0, suggestionList_ts_1.suggestionList)(argName, knownArgs); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Unknown argument "${argName}" on directive "@${directiveName}".` + + (context.hideSuggestions ? '' : (0, didYouMean_ts_1.didYouMean)(suggestions)), { nodes: argNode })); + } + } + } + return false; + }, + }; +} +//# sourceMappingURL=KnownArgumentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.map new file mode 100644 index 00000000..959bb832 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownArgumentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownArgumentNamesRule.ts"],"names":[],"mappings":";;AAuDA,wDAoDC;AAGD,gFAoDC;AAhKD,+DAAyD;AACzD,uEAAiE;AAEjE,iEAA2D;AAE3D,sDAA+C;AAG/C,4DAA+D;AA6C/D,SAAgB,sBAAsB,CAAC,OAA0B;IAC/D,OAAO;QAEL,GAAG,kCAAkC,CAAC,OAAO,CAAC;QAC9C,gBAAgB,CAAC,OAAO;YACtB,MAAM,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;YACzD,IAAI,iBAAiB,EAAE,CAAC;gBACtB,M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,CAAC,aAAa,CAAC,CAAC;YAEnD,IAAI,aAAa,CAAC,SAAS,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;gBACzD,KAAK,MAAM,OAAO,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;oBAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;oBACnC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;wBACjC,MAAM,WAAW,GAAG,IAAA,kCAAc,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;wBACvD,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,qBAAqB,OAAO,oBAAoB,aAAa,IAAI;4BAC/D,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,0BAAU,EAAC,WAAW,CAAC,CAAC,EAC1D,EAAE,KAAK,EAAE,OAAO,EAAE,CACnB,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Known argument names\n *\n * A GraphQL field is only valid if all supplied arguments are defined by\n * that field.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownArgumentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: String): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { field(unknown: \"1\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * KnownArgumentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { field(arg: \"1\") }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownArgumentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor {\n return {\n // eslint-disable-next-line new-cap\n ...KnownArgumentNamesOnDirectivesRule(context),\n FragmentArgument(argNode) {\n const fragmentSignature = context.getFragmentSignature();\n if (fragmentSignature) {\n const varDef = fragmentSignature.variableDefinitions.get(\n argNode.name.value,\n );\n if (!varDef) {\n const argName = argNode.name.value;\n const suggestions = context.hideSuggestions\n ? []\n : suggestionList(\n argName,\n Array.from(fragmentSignature.variableDefinitions.values()).map(\n (varSignature) => varSignature.variable.name.value,\n ),\n );\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on fragment \"${fragmentSignature.definition.name.value}\".` +\n didYouMean(suggestions),\n { nodes: argNode },\n ),\n );\n }\n }\n },\n Argument(argNode) {\n const argDef = context.getArgument();\n const fieldDef = context.getFieldDef();\n\n if (!argDef && fieldDef) {\n const argName = argNode.name.value;\n const suggestions = context.hideSuggestions\n ? []\n : suggestionList(\n argName,\n fieldDef.args.map((arg) => arg.name),\n );\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on field \"${fieldDef}\".` +\n didYouMean(suggestions),\n { nodes: argNode },\n ),\n );\n }\n },\n };\n}\n\n/** @internal */\nexport function KnownArgumentNamesOnDirectivesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const directiveArgs = new Map>();\n\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n for (const directive of definedDirectives) {\n directiveArgs.set(\n directive.name,\n directive.args.map((arg) => arg.name),\n );\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n const argsNodes = def.arguments ?? [];\n\n directiveArgs.set(\n def.name.value,\n argsNodes.map((arg) => arg.name.value),\n );\n }\n }\n\n return {\n Directive(directiveNode) {\n const directiveName = directiveNode.name.value;\n const knownArgs = directiveArgs.get(directiveName);\n\n if (directiveNode.arguments != null && knownArgs != null) {\n for (const argNode of directiveNode.arguments) {\n const argName = argNode.name.value;\n if (!knownArgs.includes(argName)) {\n const suggestions = suggestionList(argName, knownArgs);\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on directive \"@${directiveName}\".` +\n (context.hideSuggestions ? '' : didYouMean(suggestions)),\n { nodes: argNode },\n ),\n );\n }\n }\n }\n\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs new file mode 100644 index 00000000..7b063a62 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs @@ -0,0 +1,71 @@ +import { didYouMean } from "../../jsutils/didYouMean.mjs"; +import { suggestionList } from "../../jsutils/suggestionList.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { specifiedDirectives } from "../../type/directives.mjs"; +export function KnownArgumentNamesRule(context) { + return { + ...KnownArgumentNamesOnDirectivesRule(context), + FragmentArgument(argNode) { + const fragmentSignature = context.getFragmentSignature(); + if (fragmentSignature) { + const varDef = fragmentSignature.variableDefinitions.get(argNode.name.value); + if (!varDef) { + const argName = argNode.name.value; + const suggestions = context.hideSuggestions + ? [] + : suggestionList(argName, Array.from(fragmentSignature.variableDefinitions.values()).map((varSignature) => varSignature.variable.name.value)); + context.reportError(new GraphQLError(`Unknown argument "${argName}" on fragment "${fragmentSignature.definition.name.value}".` + + didYouMean(suggestions), { nodes: argNode })); + } + } + }, + Argument(argNode) { + const argDef = context.getArgument(); + const fieldDef = context.getFieldDef(); + if (!argDef && fieldDef) { + const argName = argNode.name.value; + const suggestions = context.hideSuggestions + ? [] + : suggestionList(argName, fieldDef.args.map((arg) => arg.name)); + context.reportError(new GraphQLError(`Unknown argument "${argName}" on field "${fieldDef}".` + + didYouMean(suggestions), { nodes: argNode })); + } + }, + }; +} +export function KnownArgumentNamesOnDirectivesRule(context) { + const directiveArgs = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + directiveArgs.set(directive.name, directive.args.map((arg) => arg.name)); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + const argsNodes = def.arguments ?? []; + directiveArgs.set(def.name.value, argsNodes.map((arg) => arg.name.value)); + } + } + return { + Directive(directiveNode) { + const directiveName = directiveNode.name.value; + const knownArgs = directiveArgs.get(directiveName); + if (directiveNode.arguments != null && knownArgs != null) { + for (const argNode of directiveNode.arguments) { + const argName = argNode.name.value; + if (!knownArgs.includes(argName)) { + const suggestions = suggestionList(argName, knownArgs); + context.reportError(new GraphQLError(`Unknown argument "${argName}" on directive "@${directiveName}".` + + (context.hideSuggestions ? '' : didYouMean(suggestions)), { nodes: argNode })); + } + } + } + return false; + }, + }; +} +//# sourceMappingURL=KnownArgumentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs.map new file mode 100644 index 00000000..08ac207c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownArgumentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownArgumentNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,qCAAoC;AACzD,OAAO,EAAE,cAAc,EAAE,yCAAwC;AAEjE,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAE3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAG/C,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AA6C/D,MAAM,UAAU,sBAAsB,CAAC,OAA0B;IAC/D,OAAO;QAEL,GAAG,kCAAkC,CAAC,OAAO,CAAC;QAC9C,gBAAgB,CAAC,OAAO;YACtB,MAAM,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;YACzD,IAAI,iBAAiB,EAAE,CAAC;gBACtB,MAAM,MAAM,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,CACtD,OAAO,CAAC,IAAI,CAAC,KAAK,CACnB,CAAC;gBACF,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;oBACnC,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe;wBACzC,CAAC,CAAC,EAAE;wBACJ,CAAC,CAAC,cAAc,CACZ,OAAO,EACP,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAC5D,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CACnD,CACF,CAAC;oBACN,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,qBAAqB,OAAO,kBAAkB,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI;wBACvF,UAAU,CAAC,WAAW,CAAC,EACzB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AAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Known argument names\n *\n * A GraphQL field is only valid if all supplied arguments are defined by\n * that field.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownArgumentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: String): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { field(unknown: \"1\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * KnownArgumentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { field(arg: \"1\") }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownArgumentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor {\n return {\n // eslint-disable-next-line new-cap\n ...KnownArgumentNamesOnDirectivesRule(context),\n FragmentArgument(argNode) {\n const fragmentSignature = context.getFragmentSignature();\n if (fragmentSignature) {\n const varDef = fragmentSignature.variableDefinitions.get(\n argNode.name.value,\n );\n if (!varDef) {\n const argName = argNode.name.value;\n const suggestions = context.hideSuggestions\n ? []\n : suggestionList(\n argName,\n Array.from(fragmentSignature.variableDefinitions.values()).map(\n (varSignature) => varSignature.variable.name.value,\n ),\n );\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on fragment \"${fragmentSignature.definition.name.value}\".` +\n didYouMean(suggestions),\n { nodes: argNode },\n ),\n );\n }\n }\n },\n Argument(argNode) {\n const argDef = context.getArgument();\n const fieldDef = context.getFieldDef();\n\n if (!argDef && fieldDef) {\n const argName = argNode.name.value;\n const suggestions = context.hideSuggestions\n ? []\n : suggestionList(\n argName,\n fieldDef.args.map((arg) => arg.name),\n );\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on field \"${fieldDef}\".` +\n didYouMean(suggestions),\n { nodes: argNode },\n ),\n );\n }\n },\n };\n}\n\n/** @internal */\nexport function KnownArgumentNamesOnDirectivesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const directiveArgs = new Map>();\n\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n for (const directive of definedDirectives) {\n directiveArgs.set(\n directive.name,\n directive.args.map((arg) => arg.name),\n );\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n const argsNodes = def.arguments ?? [];\n\n directiveArgs.set(\n def.name.value,\n argsNodes.map((arg) => arg.name.value),\n );\n }\n }\n\n return {\n Directive(directiveNode) {\n const directiveName = directiveNode.name.value;\n const knownArgs = directiveArgs.get(directiveName);\n\n if (directiveNode.arguments != null && knownArgs != null) {\n for (const argNode of directiveNode.arguments) {\n const argName = argNode.name.value;\n if (!knownArgs.includes(argName)) {\n const suggestions = suggestionList(argName, knownArgs);\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on directive \"@${directiveName}\".` +\n (context.hideSuggestions ? '' : didYouMean(suggestions)),\n { nodes: argNode },\n ),\n );\n }\n }\n }\n\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.mts new file mode 100644 index 00000000..a8be17a3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.mts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.mjs"; +/** + * Known directives + * + * A GraphQL document is only valid if all `@directives` are known by the + * schema and legally positioned. + * + * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownDirectivesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { name @unknown } + * `); + * const invalidErrors = validate(schema, invalidDocument, [KnownDirectivesRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name @include(if: true) } + * `); + * const validErrors = validate(schema, validDocument, [KnownDirectivesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownDirectivesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts new file mode 100644 index 00000000..d2f8550f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.js"; +/** + * Known directives + * + * A GraphQL document is only valid if all `@directives` are known by the + * schema and legally positioned. + * + * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownDirectivesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { name @unknown } + * `); + * const invalidErrors = validate(schema, invalidDocument, [KnownDirectivesRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name @include(if: true) } + * `); + * const validErrors = validate(schema, validDocument, [KnownDirectivesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownDirectivesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js new file mode 100644 index 00000000..342e29c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js @@ -0,0 +1,115 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KnownDirectivesRule = KnownDirectivesRule; +const inspect_ts_1 = require("../../jsutils/inspect.js"); +const invariant_ts_1 = require("../../jsutils/invariant.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const ast_ts_1 = require("../../language/ast.js"); +const directiveLocation_ts_1 = require("../../language/directiveLocation.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const directives_ts_1 = require("../../type/directives.js"); +function KnownDirectivesRule(context) { + const locationsMap = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : directives_ts_1.specifiedDirectives; + for (const directive of definedDirectives) { + locationsMap.set(directive.name, directive.locations); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === kinds_ts_1.Kind.DIRECTIVE_DEFINITION) { + locationsMap.set(def.name.value, def.locations.map((name) => name.value)); + } + } + return { + Directive(node, _key, _parent, _path, ancestors) { + const name = node.name.value; + const locations = locationsMap.get(name); + if (locations == null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Unknown directive "@${name}".`, { nodes: node })); + return; + } + const candidateLocation = getDirectiveLocationForASTPath(ancestors); + if (candidateLocation != null && !locations.includes(candidateLocation)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Directive "@${name}" may not be used on ${candidateLocation}.`, { nodes: node })); + } + }, + }; +} +function getDirectiveLocationForASTPath(ancestors) { + const appliedTo = ancestors.at(-1); + if (!(appliedTo != null && 'kind' in appliedTo)) + (0, invariant_ts_1.invariant)(false); + switch (appliedTo.kind) { + case kinds_ts_1.Kind.OPERATION_DEFINITION: + return getDirectiveLocationForOperation(appliedTo.operation); + case kinds_ts_1.Kind.FIELD: + return directiveLocation_ts_1.DirectiveLocation.FIELD; + case kinds_ts_1.Kind.FRAGMENT_SPREAD: + return directiveLocation_ts_1.DirectiveLocation.FRAGMENT_SPREAD; + case kinds_ts_1.Kind.INLINE_FRAGMENT: + return directiveLocation_ts_1.DirectiveLocation.INLINE_FRAGMENT; + case kinds_ts_1.Kind.FRAGMENT_DEFINITION: + return directiveLocation_ts_1.DirectiveLocation.FRAGMENT_DEFINITION; + case kinds_ts_1.Kind.VARIABLE_DEFINITION: { + const parentNode = ancestors[ancestors.length - 3]; + if (!('kind' in parentNode)) + (0, invariant_ts_1.invariant)(false); + return parentNode.kind === kinds_ts_1.Kind.OPERATION_DEFINITION + ? directiveLocation_ts_1.DirectiveLocation.VARIABLE_DEFINITION + : directiveLocation_ts_1.DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION; + } + case kinds_ts_1.Kind.SCHEMA_DEFINITION: + case kinds_ts_1.Kind.SCHEMA_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.SCHEMA; + case kinds_ts_1.Kind.SCALAR_TYPE_DEFINITION: + case kinds_ts_1.Kind.SCALAR_TYPE_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.SCALAR; + case kinds_ts_1.Kind.OBJECT_TYPE_DEFINITION: + case kinds_ts_1.Kind.OBJECT_TYPE_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.OBJECT; + case kinds_ts_1.Kind.FIELD_DEFINITION: + return directiveLocation_ts_1.DirectiveLocation.FIELD_DEFINITION; + case kinds_ts_1.Kind.INTERFACE_TYPE_DEFINITION: + case kinds_ts_1.Kind.INTERFACE_TYPE_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.INTERFACE; + case kinds_ts_1.Kind.UNION_TYPE_DEFINITION: + case kinds_ts_1.Kind.UNION_TYPE_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.UNION; + case kinds_ts_1.Kind.ENUM_TYPE_DEFINITION: + case kinds_ts_1.Kind.ENUM_TYPE_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.ENUM; + case kinds_ts_1.Kind.ENUM_VALUE_DEFINITION: + return directiveLocation_ts_1.DirectiveLocation.ENUM_VALUE; + case kinds_ts_1.Kind.INPUT_OBJECT_TYPE_DEFINITION: + case kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.INPUT_OBJECT; + case kinds_ts_1.Kind.INPUT_VALUE_DEFINITION: { + const parentNode = ancestors.at(-3); + if (!(parentNode != null && 'kind' in parentNode)) + (0, invariant_ts_1.invariant)(false); + return parentNode.kind === kinds_ts_1.Kind.INPUT_OBJECT_TYPE_DEFINITION || + parentNode.kind === kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION + ? directiveLocation_ts_1.DirectiveLocation.INPUT_FIELD_DEFINITION + : directiveLocation_ts_1.DirectiveLocation.ARGUMENT_DEFINITION; + } + case kinds_ts_1.Kind.DIRECTIVE_DEFINITION: + case kinds_ts_1.Kind.DIRECTIVE_EXTENSION: + return directiveLocation_ts_1.DirectiveLocation.DIRECTIVE_DEFINITION; + default: + (0, invariant_ts_1.invariant)(false, 'Unexpected kind: ' + (0, inspect_ts_1.inspect)(appliedTo.kind)); + } +} +function getDirectiveLocationForOperation(operation) { + switch (operation) { + case ast_ts_1.OperationTypeNode.QUERY: + return directiveLocation_ts_1.DirectiveLocation.QUERY; + case ast_ts_1.OperationTypeNode.MUTATION: + return directiveLocation_ts_1.DirectiveLocation.MUTATION; + case ast_ts_1.OperationTypeNode.SUBSCRIPTION: + return directiveLocation_ts_1.DirectiveLocation.SUBSCRIPTION; + } +} +//# sourceMappingURL=KnownDirectivesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js.map new file mode 100644 index 00000000..6593d865 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownDirectivesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownDirectivesRule.ts"],"names":[],"mappings":";;AAuDA,kDA8CC;AAnGD,yDAAmD;AACnD,6DAAuD;AAEvD,iEAA2D;AAG3D,kDAA0D;AAC1D,8EAAwE;AACxE,sDAA+C;AAG/C,4DAA+D;AA0C/D,SAAgB,mBAAmB,CACjC,OAAiD;IAEjD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAiC,CAAC;IAE9D,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,iBAAiB,GAAG,MAAM;QAC9B,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE;QACxB,CAAC,CAAC,mCAAmB,CAAC;IACxB,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE,CAAC;QAC1C,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC;IACzD,KAAK,MAAM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wCAAiB,CAAC,QAAQ,CAAC;QACpC,KAAK,0BAAiB,CAAC,YAAY;YACjC,OAAO,wCAAiB,CAAC,YAAY,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\nimport { invariant } from '../../jsutils/invariant.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTNode } from '../../language/ast.ts';\nimport { OperationTypeNode } from '../../language/ast.ts';\nimport { DirectiveLocation } from '../../language/directiveLocation.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Known directives\n *\n * A GraphQL document is only valid if all `@directives` are known by the\n * schema and legally positioned.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownDirectivesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { name @unknown }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [KnownDirectivesRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name @include(if: true) }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownDirectivesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownDirectivesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const locationsMap = new Map>();\n\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n for (const directive of definedDirectives) {\n locationsMap.set(directive.name, directive.locations);\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n locationsMap.set(\n def.name.value,\n def.locations.map((name) => name.value),\n );\n }\n }\n\n return {\n Directive(node, _key, _parent, _path, ancestors) {\n const name = node.name.value;\n const locations = locationsMap.get(name);\n\n if (locations == null) {\n context.reportError(\n new GraphQLError(`Unknown directive \"@${name}\".`, { nodes: node }),\n );\n return;\n }\n\n const candidateLocation = getDirectiveLocationForASTPath(ancestors);\n if (candidateLocation != null && !locations.includes(candidateLocation)) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${name}\" may not be used on ${candidateLocation}.`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n\nfunction getDirectiveLocationForASTPath(\n ancestors: ReadonlyArray>,\n): DirectiveLocation | undefined {\n const appliedTo = ancestors.at(-1);\n invariant(appliedTo != null && 'kind' in appliedTo);\n\n switch (appliedTo.kind) {\n case Kind.OPERATION_DEFINITION:\n return getDirectiveLocationForOperation(appliedTo.operation);\n case Kind.FIELD:\n return DirectiveLocation.FIELD;\n case Kind.FRAGMENT_SPREAD:\n return DirectiveLocation.FRAGMENT_SPREAD;\n case Kind.INLINE_FRAGMENT:\n return DirectiveLocation.INLINE_FRAGMENT;\n case Kind.FRAGMENT_DEFINITION:\n return DirectiveLocation.FRAGMENT_DEFINITION;\n case Kind.VARIABLE_DEFINITION: {\n const parentNode = ancestors[ancestors.length - 3];\n invariant('kind' in parentNode);\n return parentNode.kind === Kind.OPERATION_DEFINITION\n ? DirectiveLocation.VARIABLE_DEFINITION\n : DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION;\n }\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n return DirectiveLocation.SCHEMA;\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION:\n return DirectiveLocation.SCALAR;\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.OBJECT;\n case Kind.FIELD_DEFINITION:\n return DirectiveLocation.FIELD_DEFINITION;\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_EXTENSION:\n return DirectiveLocation.INTERFACE;\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION:\n return DirectiveLocation.UNION;\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION:\n return DirectiveLocation.ENUM;\n case Kind.ENUM_VALUE_DEFINITION:\n return DirectiveLocation.ENUM_VALUE;\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.INPUT_OBJECT;\n case Kind.INPUT_VALUE_DEFINITION: {\n const parentNode = ancestors.at(-3);\n invariant(parentNode != null && 'kind' in parentNode);\n return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ||\n parentNode.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n ? DirectiveLocation.INPUT_FIELD_DEFINITION\n : DirectiveLocation.ARGUMENT_DEFINITION;\n }\n case Kind.DIRECTIVE_DEFINITION:\n case Kind.DIRECTIVE_EXTENSION:\n return DirectiveLocation.DIRECTIVE_DEFINITION;\n // Not reachable, all possible types have been considered.\n /* node:coverage ignore next 2 */\n default:\n invariant(false, 'Unexpected kind: ' + inspect(appliedTo.kind));\n }\n}\n\nfunction getDirectiveLocationForOperation(\n operation: OperationTypeNode,\n): DirectiveLocation {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return DirectiveLocation.QUERY;\n case OperationTypeNode.MUTATION:\n return DirectiveLocation.MUTATION;\n case OperationTypeNode.SUBSCRIPTION:\n return DirectiveLocation.SUBSCRIPTION;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs new file mode 100644 index 00000000..e4a7c367 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs @@ -0,0 +1,112 @@ +import { inspect } from "../../jsutils/inspect.mjs"; +import { invariant } from "../../jsutils/invariant.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { OperationTypeNode } from "../../language/ast.mjs"; +import { DirectiveLocation } from "../../language/directiveLocation.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { specifiedDirectives } from "../../type/directives.mjs"; +export function KnownDirectivesRule(context) { + const locationsMap = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + locationsMap.set(directive.name, directive.locations); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + locationsMap.set(def.name.value, def.locations.map((name) => name.value)); + } + } + return { + Directive(node, _key, _parent, _path, ancestors) { + const name = node.name.value; + const locations = locationsMap.get(name); + if (locations == null) { + context.reportError(new GraphQLError(`Unknown directive "@${name}".`, { nodes: node })); + return; + } + const candidateLocation = getDirectiveLocationForASTPath(ancestors); + if (candidateLocation != null && !locations.includes(candidateLocation)) { + context.reportError(new GraphQLError(`Directive "@${name}" may not be used on ${candidateLocation}.`, { nodes: node })); + } + }, + }; +} +function getDirectiveLocationForASTPath(ancestors) { + const appliedTo = ancestors.at(-1); + if (!(appliedTo != null && 'kind' in appliedTo)) + invariant(false); + switch (appliedTo.kind) { + case Kind.OPERATION_DEFINITION: + return getDirectiveLocationForOperation(appliedTo.operation); + case Kind.FIELD: + return DirectiveLocation.FIELD; + case Kind.FRAGMENT_SPREAD: + return DirectiveLocation.FRAGMENT_SPREAD; + case Kind.INLINE_FRAGMENT: + return DirectiveLocation.INLINE_FRAGMENT; + case Kind.FRAGMENT_DEFINITION: + return DirectiveLocation.FRAGMENT_DEFINITION; + case Kind.VARIABLE_DEFINITION: { + const parentNode = ancestors[ancestors.length - 3]; + if (!('kind' in parentNode)) + invariant(false); + return parentNode.kind === Kind.OPERATION_DEFINITION + ? DirectiveLocation.VARIABLE_DEFINITION + : DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION; + } + case Kind.SCHEMA_DEFINITION: + case Kind.SCHEMA_EXTENSION: + return DirectiveLocation.SCHEMA; + case Kind.SCALAR_TYPE_DEFINITION: + case Kind.SCALAR_TYPE_EXTENSION: + return DirectiveLocation.SCALAR; + case Kind.OBJECT_TYPE_DEFINITION: + case Kind.OBJECT_TYPE_EXTENSION: + return DirectiveLocation.OBJECT; + case Kind.FIELD_DEFINITION: + return DirectiveLocation.FIELD_DEFINITION; + case Kind.INTERFACE_TYPE_DEFINITION: + case Kind.INTERFACE_TYPE_EXTENSION: + return DirectiveLocation.INTERFACE; + case Kind.UNION_TYPE_DEFINITION: + case Kind.UNION_TYPE_EXTENSION: + return DirectiveLocation.UNION; + case Kind.ENUM_TYPE_DEFINITION: + case Kind.ENUM_TYPE_EXTENSION: + return DirectiveLocation.ENUM; + case Kind.ENUM_VALUE_DEFINITION: + return DirectiveLocation.ENUM_VALUE; + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return DirectiveLocation.INPUT_OBJECT; + case Kind.INPUT_VALUE_DEFINITION: { + const parentNode = ancestors.at(-3); + if (!(parentNode != null && 'kind' in parentNode)) + invariant(false); + return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION || + parentNode.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION + ? DirectiveLocation.INPUT_FIELD_DEFINITION + : DirectiveLocation.ARGUMENT_DEFINITION; + } + case Kind.DIRECTIVE_DEFINITION: + case Kind.DIRECTIVE_EXTENSION: + return DirectiveLocation.DIRECTIVE_DEFINITION; + default: + invariant(false, 'Unexpected kind: ' + inspect(appliedTo.kind)); + } +} +function getDirectiveLocationForOperation(operation) { + switch (operation) { + case OperationTypeNode.QUERY: + return DirectiveLocation.QUERY; + case OperationTypeNode.MUTATION: + return DirectiveLocation.MUTATION; + case OperationTypeNode.SUBSCRIPTION: + return DirectiveLocation.SUBSCRIPTION; + } +} +//# sourceMappingURL=KnownDirectivesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs.map new file mode 100644 index 00000000..d94f7c0c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownDirectivesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownDirectivesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kCAAiC;AACnD,OAAO,EAAE,SAAS,EAAE,oCAAmC;AAEvD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,+BAA8B;AAC1D,OAAO,EAAE,iBAAiB,EAAE,6CAA4C;AACxE,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAG/C,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AA0C/D,MAAM,UAAU,mBAAmB,CACjC,OAAiD;IAEjD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAiC,CAAC;IAE9D,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,iBAAiB,GAAG,MAAM;QAC9B,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE;QACxB,CAAC,CAAC,mBAAmB,CAAC;IACxB,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE,CAAC;QAC1C,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CA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AC7B,OAAO,iBAAiB,CAAC,QAAQ,CAAC;QACpC,KAAK,iBAAiB,CAAC,YAAY;YACjC,OAAO,iBAAiB,CAAC,YAAY,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\nimport { invariant } from '../../jsutils/invariant.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTNode } from '../../language/ast.ts';\nimport { OperationTypeNode } from '../../language/ast.ts';\nimport { DirectiveLocation } from '../../language/directiveLocation.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Known directives\n *\n * A GraphQL document is only valid if all `@directives` are known by the\n * schema and legally positioned.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownDirectivesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { name @unknown }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [KnownDirectivesRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name @include(if: true) }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownDirectivesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownDirectivesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const locationsMap = new Map>();\n\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n for (const directive of definedDirectives) {\n locationsMap.set(directive.name, directive.locations);\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n locationsMap.set(\n def.name.value,\n def.locations.map((name) => name.value),\n );\n }\n }\n\n return {\n Directive(node, _key, _parent, _path, ancestors) {\n const name = node.name.value;\n const locations = locationsMap.get(name);\n\n if (locations == null) {\n context.reportError(\n new GraphQLError(`Unknown directive \"@${name}\".`, { nodes: node }),\n );\n return;\n }\n\n const candidateLocation = getDirectiveLocationForASTPath(ancestors);\n if (candidateLocation != null && !locations.includes(candidateLocation)) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${name}\" may not be used on ${candidateLocation}.`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n\nfunction getDirectiveLocationForASTPath(\n ancestors: ReadonlyArray>,\n): DirectiveLocation | undefined {\n const appliedTo = ancestors.at(-1);\n invariant(appliedTo != null && 'kind' in appliedTo);\n\n switch (appliedTo.kind) {\n case Kind.OPERATION_DEFINITION:\n return getDirectiveLocationForOperation(appliedTo.operation);\n case Kind.FIELD:\n return DirectiveLocation.FIELD;\n case Kind.FRAGMENT_SPREAD:\n return DirectiveLocation.FRAGMENT_SPREAD;\n case Kind.INLINE_FRAGMENT:\n return DirectiveLocation.INLINE_FRAGMENT;\n case Kind.FRAGMENT_DEFINITION:\n return DirectiveLocation.FRAGMENT_DEFINITION;\n case Kind.VARIABLE_DEFINITION: {\n const parentNode = ancestors[ancestors.length - 3];\n invariant('kind' in parentNode);\n return parentNode.kind === Kind.OPERATION_DEFINITION\n ? DirectiveLocation.VARIABLE_DEFINITION\n : DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION;\n }\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n return DirectiveLocation.SCHEMA;\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION:\n return DirectiveLocation.SCALAR;\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.OBJECT;\n case Kind.FIELD_DEFINITION:\n return DirectiveLocation.FIELD_DEFINITION;\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_EXTENSION:\n return DirectiveLocation.INTERFACE;\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION:\n return DirectiveLocation.UNION;\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION:\n return DirectiveLocation.ENUM;\n case Kind.ENUM_VALUE_DEFINITION:\n return DirectiveLocation.ENUM_VALUE;\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.INPUT_OBJECT;\n case Kind.INPUT_VALUE_DEFINITION: {\n const parentNode = ancestors.at(-3);\n invariant(parentNode != null && 'kind' in parentNode);\n return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ||\n parentNode.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n ? DirectiveLocation.INPUT_FIELD_DEFINITION\n : DirectiveLocation.ARGUMENT_DEFINITION;\n }\n case Kind.DIRECTIVE_DEFINITION:\n case Kind.DIRECTIVE_EXTENSION:\n return DirectiveLocation.DIRECTIVE_DEFINITION;\n // Not reachable, all possible types have been considered.\n /* node:coverage ignore next 2 */\n default:\n invariant(false, 'Unexpected kind: ' + inspect(appliedTo.kind));\n }\n}\n\nfunction getDirectiveLocationForOperation(\n operation: OperationTypeNode,\n): DirectiveLocation {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return DirectiveLocation.QUERY;\n case OperationTypeNode.MUTATION:\n return DirectiveLocation.MUTATION;\n case OperationTypeNode.SUBSCRIPTION:\n return DirectiveLocation.SUBSCRIPTION;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.mts new file mode 100644 index 00000000..4d193734 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.mts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Known fragment names + * + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer + * to fragments defined in the same document. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownFragmentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { ...Missing } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * KnownFragmentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment NameFields on Query { name } query { ...NameFields } + * `); + * const validErrors = validate(schema, validDocument, [KnownFragmentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts new file mode 100644 index 00000000..6cdde99e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Known fragment names + * + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer + * to fragments defined in the same document. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownFragmentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { ...Missing } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * KnownFragmentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment NameFields on Query { name } query { ...NameFields } + * `); + * const validErrors = validate(schema, validDocument, [KnownFragmentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js new file mode 100644 index 00000000..e9381707 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KnownFragmentNamesRule = KnownFragmentNamesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function KnownFragmentNamesRule(context) { + return { + FragmentSpread(node) { + const fragmentName = node.name.value; + const fragment = context.getFragment(fragmentName); + if (!fragment) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Unknown fragment "${fragmentName}".`, { + nodes: node.name, + })); + } + }, + }; +} +//# sourceMappingURL=KnownFragmentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.map new file mode 100644 index 00000000..4a98f525 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownFragmentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownFragmentNamesRule.ts"],"names":[],"mappings":";;AA6CA,wDAcC;AAzDD,iEAA2D;AA2C3D,SAAgB,sBAAsB,CAAC,OAA0B;IAC/D,OAAO;QACL,cAAc,CAAC,IAAI;YACjB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CAAC,qBAAqB,YAAY,IAAI,EAAE;oBACtD,KAAK,EAAE,IAAI,CAAC,IAAI;iBACjB,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Known fragment names\n *\n * A GraphQL document is only valid if all `...Fragment` fragment spreads refer\n * to fragments defined in the same document.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownFragmentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { ...Missing }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * KnownFragmentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment NameFields on Query { name } query { ...NameFields }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownFragmentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor {\n return {\n FragmentSpread(node) {\n const fragmentName = node.name.value;\n const fragment = context.getFragment(fragmentName);\n if (!fragment) {\n context.reportError(\n new GraphQLError(`Unknown fragment \"${fragmentName}\".`, {\n nodes: node.name,\n }),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs new file mode 100644 index 00000000..05386511 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs @@ -0,0 +1,15 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function KnownFragmentNamesRule(context) { + return { + FragmentSpread(node) { + const fragmentName = node.name.value; + const fragment = context.getFragment(fragmentName); + if (!fragment) { + context.reportError(new GraphQLError(`Unknown fragment "${fragmentName}".`, { + nodes: node.name, + })); + } + }, + }; +} +//# sourceMappingURL=KnownFragmentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs.map new file mode 100644 index 00000000..17695877 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownFragmentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownFragmentNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA2C3D,MAAM,UAAU,sBAAsB,CAAC,OAA0B;IAC/D,OAAO;QACL,cAAc,CAAC,IAAI;YACjB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CAAC,qBAAqB,YAAY,IAAI,EAAE;oBACtD,KAAK,EAAE,IAAI,CAAC,IAAI;iBACjB,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Known fragment names\n *\n * A GraphQL document is only valid if all `...Fragment` fragment spreads refer\n * to fragments defined in the same document.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownFragmentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { ...Missing }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * KnownFragmentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment NameFields on Query { name } query { ...NameFields }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownFragmentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor {\n return {\n FragmentSpread(node) {\n const fragmentName = node.name.value;\n const fragment = context.getFragment(fragmentName);\n if (!fragment) {\n context.reportError(\n new GraphQLError(`Unknown fragment \"${fragmentName}\".`, {\n nodes: node.name,\n }),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.mts new file mode 100644 index 00000000..7133539b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.mts @@ -0,0 +1,31 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Known Operation Types + * + * A GraphQL document is only valid if when it contains an operation, + * the root type for the operation exists within the schema. + * + * See https://spec.graphql.org/draft/#sec-Operation-Type-Existence + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate, KnownOperationTypesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const invalidDocument = parse('mutation { greeting }'); + * const validDocument = parse('{ greeting }'); + * + * validate(schema, invalidDocument, [KnownOperationTypesRule])[0].message; // => 'The mutation operation is not supported by the schema.' + * validate(schema, validDocument, [KnownOperationTypesRule]); // => [] + * ``` + */ +export declare function KnownOperationTypesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.ts new file mode 100644 index 00000000..36a46f06 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.d.ts @@ -0,0 +1,31 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Known Operation Types + * + * A GraphQL document is only valid if when it contains an operation, + * the root type for the operation exists within the schema. + * + * See https://spec.graphql.org/draft/#sec-Operation-Type-Existence + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate, KnownOperationTypesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const invalidDocument = parse('mutation { greeting }'); + * const validDocument = parse('{ greeting }'); + * + * validate(schema, invalidDocument, [KnownOperationTypesRule])[0].message; // => 'The mutation operation is not supported by the schema.' + * validate(schema, validDocument, [KnownOperationTypesRule]); // => [] + * ``` + */ +export declare function KnownOperationTypesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js new file mode 100644 index 00000000..5d8c0eed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KnownOperationTypesRule = KnownOperationTypesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function KnownOperationTypesRule(context) { + const schema = context.getSchema(); + return { + OperationDefinition(node) { + const operation = node.operation; + if (!schema.getRootType(operation)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`The ${operation} operation is not supported by the schema.`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=KnownOperationTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js.map new file mode 100644 index 00000000..1dd8b095 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownOperationTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownOperationTypesRule.ts"],"names":[],"mappings":";;AAmCA,0DAiBC;AAlDD,iEAA2D;AAiC3D,SAAgB,uBAAuB,CACrC,OAA0B;IAE1B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,OAAO;QACL,mBAAmB,CAAC,IAAI;YACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;gBACnC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,OAAO,SAAS,4CAA4C,EAC5D,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Known Operation Types\n *\n * A GraphQL document is only valid if when it contains an operation,\n * the root type for the operation exists within the schema.\n *\n * See https://spec.graphql.org/draft/#sec-Operation-Type-Existence\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate, KnownOperationTypesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const invalidDocument = parse('mutation { greeting }');\n * const validDocument = parse('{ greeting }');\n *\n * validate(schema, invalidDocument, [KnownOperationTypesRule])[0].message; // => 'The mutation operation is not supported by the schema.'\n * validate(schema, validDocument, [KnownOperationTypesRule]); // => []\n * ```\n */\nexport function KnownOperationTypesRule(\n context: ValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n return {\n OperationDefinition(node) {\n const operation = node.operation;\n if (!schema.getRootType(operation)) {\n context.reportError(\n new GraphQLError(\n `The ${operation} operation is not supported by the schema.`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs new file mode 100644 index 00000000..d80fa715 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs @@ -0,0 +1,13 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function KnownOperationTypesRule(context) { + const schema = context.getSchema(); + return { + OperationDefinition(node) { + const operation = node.operation; + if (!schema.getRootType(operation)) { + context.reportError(new GraphQLError(`The ${operation} operation is not supported by the schema.`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=KnownOperationTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs.map new file mode 100644 index 00000000..a4d04f6d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownOperationTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownOperationTypesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAiC3D,MAAM,UAAU,uBAAuB,CACrC,OAA0B;IAE1B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,OAAO;QACL,mBAAmB,CAAC,IAAI;YACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;gBACnC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,OAAO,SAAS,4CAA4C,EAC5D,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Known Operation Types\n *\n * A GraphQL document is only valid if when it contains an operation,\n * the root type for the operation exists within the schema.\n *\n * See https://spec.graphql.org/draft/#sec-Operation-Type-Existence\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate, KnownOperationTypesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const invalidDocument = parse('mutation { greeting }');\n * const validDocument = parse('{ greeting }');\n *\n * validate(schema, invalidDocument, [KnownOperationTypesRule])[0].message; // => 'The mutation operation is not supported by the schema.'\n * validate(schema, validDocument, [KnownOperationTypesRule]); // => []\n * ```\n */\nexport function KnownOperationTypesRule(\n context: ValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n return {\n OperationDefinition(node) {\n const operation = node.operation;\n if (!schema.getRootType(operation)) {\n context.reportError(\n new GraphQLError(\n `The ${operation} operation is not supported by the schema.`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.mts new file mode 100644 index 00000000..39b1aba3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.mts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.mjs"; +/** + * Known type names + * + * A GraphQL document is only valid if referenced types (specifically + * variable definitions and fragment conditions) are defined by the type schema. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownTypeNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment Bad on Missing { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [KnownTypeNamesRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment Good on Query { name } + * `); + * const validErrors = validate(schema, validDocument, [KnownTypeNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownTypeNamesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts new file mode 100644 index 00000000..0aa5fc83 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.js"; +/** + * Known type names + * + * A GraphQL document is only valid if referenced types (specifically + * variable definitions and fragment conditions) are defined by the type schema. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { KnownTypeNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment Bad on Missing { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [KnownTypeNamesRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment Good on Query { name } + * `); + * const validErrors = validate(schema, validDocument, [KnownTypeNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function KnownTypeNamesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js new file mode 100644 index 00000000..61144c51 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KnownTypeNamesRule = KnownTypeNamesRule; +const didYouMean_ts_1 = require("../../jsutils/didYouMean.js"); +const suggestionList_ts_1 = require("../../jsutils/suggestionList.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const predicates_ts_1 = require("../../language/predicates.js"); +const introspection_ts_1 = require("../../type/introspection.js"); +const scalars_ts_1 = require("../../type/scalars.js"); +function KnownTypeNamesRule(context) { + const { definitions } = context.getDocument(); + const existingTypesMap = context.getSchema()?.getTypeMap() ?? {}; + const typeNames = new Set([ + ...Object.keys(existingTypesMap), + ...definitions.filter(predicates_ts_1.isTypeDefinitionNode).map((def) => def.name.value), + ]); + return { + NamedType(node, _1, parent, _2, ancestors) { + const typeName = node.name.value; + if (!typeNames.has(typeName)) { + const definitionNode = ancestors[2] ?? parent; + const isSDL = definitionNode != null && isSDLNode(definitionNode); + if (isSDL && standardTypeNames.has(typeName)) { + return; + } + const suggestedTypes = context.hideSuggestions + ? [] + : (0, suggestionList_ts_1.suggestionList)(typeName, isSDL ? [...standardTypeNames, ...typeNames] : [...typeNames]); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Unknown type "${typeName}".` + (0, didYouMean_ts_1.didYouMean)(suggestedTypes), { nodes: node })); + } + }, + }; +} +const standardTypeNames = new Set([...scalars_ts_1.specifiedScalarTypes, ...introspection_ts_1.introspectionTypes].map((type) => type.name)); +function isSDLNode(value) { + return ('kind' in value && + ((0, predicates_ts_1.isTypeSystemDefinitionNode)(value) || (0, predicates_ts_1.isTypeSystemExtensionNode)(value))); +} +//# sourceMappingURL=KnownTypeNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.map new file mode 100644 index 00000000..071959d1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownTypeNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownTypeNamesRule.ts"],"names":[],"mappings":";;AA0DA,gDAoCC;AA5FD,+DAAyD;AACzD,uEAAiE;AAEjE,iEAA2D;AAG3D,gEAIsC;AAGtC,kEAAiE;AACjE,sDAA6D;AA0C7D,SAAgB,kBAAkB,CAChC,OAAiD;IAEjD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAC9C,MAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAEjE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;QACxB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAChC,GAAG,WAAW,CAAC,MAAM,CAAC,oCAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,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AAI,IAAA,yCAAyB,EAAC,KAAK,CAAC,CAAC,CACxE,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTNode } from '../../language/ast.ts';\nimport {\n isTypeDefinitionNode,\n isTypeSystemDefinitionNode,\n isTypeSystemExtensionNode,\n} from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { introspectionTypes } from '../../type/introspection.ts';\nimport { specifiedScalarTypes } from '../../type/scalars.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Known type names\n *\n * A GraphQL document is only valid if referenced types (specifically\n * variable definitions and fragment conditions) are defined by the type schema.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownTypeNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment Bad on Missing { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [KnownTypeNamesRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment Good on Query { name }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownTypeNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownTypeNamesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const { definitions } = context.getDocument();\n const existingTypesMap = context.getSchema()?.getTypeMap() ?? {};\n\n const typeNames = new Set([\n ...Object.keys(existingTypesMap),\n ...definitions.filter(isTypeDefinitionNode).map((def) => def.name.value),\n ]);\n\n return {\n NamedType(node, _1, parent, _2, ancestors) {\n const typeName = node.name.value;\n if (!typeNames.has(typeName)) {\n const definitionNode = ancestors[2] ?? parent;\n const isSDL = definitionNode != null && isSDLNode(definitionNode);\n if (isSDL && standardTypeNames.has(typeName)) {\n return;\n }\n\n const suggestedTypes = context.hideSuggestions\n ? []\n : suggestionList(\n typeName,\n isSDL ? [...standardTypeNames, ...typeNames] : [...typeNames],\n );\n context.reportError(\n new GraphQLError(\n `Unknown type \"${typeName}\".` + didYouMean(suggestedTypes),\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n\nconst standardTypeNames = new Set(\n [...specifiedScalarTypes, ...introspectionTypes].map((type) => type.name),\n);\n\nfunction isSDLNode(value: ASTNode | ReadonlyArray): boolean {\n return (\n 'kind' in value &&\n (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value))\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs new file mode 100644 index 00000000..151f0656 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs @@ -0,0 +1,36 @@ +import { didYouMean } from "../../jsutils/didYouMean.mjs"; +import { suggestionList } from "../../jsutils/suggestionList.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { isTypeDefinitionNode, isTypeSystemDefinitionNode, isTypeSystemExtensionNode, } from "../../language/predicates.mjs"; +import { introspectionTypes } from "../../type/introspection.mjs"; +import { specifiedScalarTypes } from "../../type/scalars.mjs"; +export function KnownTypeNamesRule(context) { + const { definitions } = context.getDocument(); + const existingTypesMap = context.getSchema()?.getTypeMap() ?? {}; + const typeNames = new Set([ + ...Object.keys(existingTypesMap), + ...definitions.filter(isTypeDefinitionNode).map((def) => def.name.value), + ]); + return { + NamedType(node, _1, parent, _2, ancestors) { + const typeName = node.name.value; + if (!typeNames.has(typeName)) { + const definitionNode = ancestors[2] ?? parent; + const isSDL = definitionNode != null && isSDLNode(definitionNode); + if (isSDL && standardTypeNames.has(typeName)) { + return; + } + const suggestedTypes = context.hideSuggestions + ? [] + : suggestionList(typeName, isSDL ? [...standardTypeNames, ...typeNames] : [...typeNames]); + context.reportError(new GraphQLError(`Unknown type "${typeName}".` + didYouMean(suggestedTypes), { nodes: node })); + } + }, + }; +} +const standardTypeNames = new Set([...specifiedScalarTypes, ...introspectionTypes].map((type) => type.name)); +function isSDLNode(value) { + return ('kind' in value && + (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value))); +} +//# sourceMappingURL=KnownTypeNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs.map new file mode 100644 index 00000000..c3dc598d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KnownTypeNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/KnownTypeNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,qCAAoC;AACzD,OAAO,EAAE,cAAc,EAAE,yCAAwC;AAEjE,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,GAC1B,sCAAqC;AAGtC,OAAO,EAAE,kBAAkB,EAAE,qCAAoC;AACjE,OAAO,EAAE,oBAAoB,EAAE,+BAA8B;AA0C7D,MAAM,UAAU,kBAAkB,CAChC,OAAiD;IAEjD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAC9C,MAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,EAAE,EAAE,UAA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AoB,EAAE,GAAG,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAC1E,CAAC;AAEF,SAAS,SAAS,CAAC,KAAuC;IACxD,OAAO,CACL,MAAM,IAAI,KAAK;QACf,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,yBAAyB,CAAC,KAAK,CAAC,CAAC,CACxE,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTNode } from '../../language/ast.ts';\nimport {\n isTypeDefinitionNode,\n isTypeSystemDefinitionNode,\n isTypeSystemExtensionNode,\n} from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { introspectionTypes } from '../../type/introspection.ts';\nimport { specifiedScalarTypes } from '../../type/scalars.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Known type names\n *\n * A GraphQL document is only valid if referenced types (specifically\n * variable definitions and fragment conditions) are defined by the type schema.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { KnownTypeNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment Bad on Missing { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [KnownTypeNamesRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment Good on Query { name }\n * `);\n * const validErrors = validate(schema, validDocument, [KnownTypeNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function KnownTypeNamesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const { definitions } = context.getDocument();\n const existingTypesMap = context.getSchema()?.getTypeMap() ?? {};\n\n const typeNames = new Set([\n ...Object.keys(existingTypesMap),\n ...definitions.filter(isTypeDefinitionNode).map((def) => def.name.value),\n ]);\n\n return {\n NamedType(node, _1, parent, _2, ancestors) {\n const typeName = node.name.value;\n if (!typeNames.has(typeName)) {\n const definitionNode = ancestors[2] ?? parent;\n const isSDL = definitionNode != null && isSDLNode(definitionNode);\n if (isSDL && standardTypeNames.has(typeName)) {\n return;\n }\n\n const suggestedTypes = context.hideSuggestions\n ? []\n : suggestionList(\n typeName,\n isSDL ? [...standardTypeNames, ...typeNames] : [...typeNames],\n );\n context.reportError(\n new GraphQLError(\n `Unknown type \"${typeName}\".` + didYouMean(suggestedTypes),\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n\nconst standardTypeNames = new Set(\n [...specifiedScalarTypes, ...introspectionTypes].map((type) => type.name),\n);\n\nfunction isSDLNode(value: ASTNode | ReadonlyArray): boolean {\n return (\n 'kind' in value &&\n (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value))\n );\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.mts new file mode 100644 index 00000000..cfd5c458 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.mts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Lone anonymous operation + * + * A GraphQL document is only valid if when it contains an anonymous operation + * (the query short-hand) that it contains only that one operation definition. + * + * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { LoneAnonymousOperationRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query { name } query Other { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * LoneAnonymousOperationRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * LoneAnonymousOperationRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function LoneAnonymousOperationRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts new file mode 100644 index 00000000..3885ded2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Lone anonymous operation + * + * A GraphQL document is only valid if when it contains an anonymous operation + * (the query short-hand) that it contains only that one operation definition. + * + * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { LoneAnonymousOperationRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query { name } query Other { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * LoneAnonymousOperationRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * LoneAnonymousOperationRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function LoneAnonymousOperationRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js new file mode 100644 index 00000000..f8b58add --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LoneAnonymousOperationRule = LoneAnonymousOperationRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +function LoneAnonymousOperationRule(context) { + let operationCount = 0; + return { + Document(node) { + operationCount = node.definitions.filter((definition) => definition.kind === kinds_ts_1.Kind.OPERATION_DEFINITION).length; + }, + OperationDefinition(node) { + if (!node.name && operationCount > 1) { + context.reportError(new GraphQLError_ts_1.GraphQLError('This anonymous operation must be the only defined operation.', { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=LoneAnonymousOperationRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.map new file mode 100644 index 00000000..407c67bf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LoneAnonymousOperationRule.js","sourceRoot":"","sources":["../../../src/validation/rules/LoneAnonymousOperationRule.ts"],"names":[],"mappings":";;AAgDA,gEAqBC;AAnED,iEAA2D;AAE3D,sDAA+C;AA4C/C,SAAgB,0BAA0B,CACxC,OAA6B;IAE7B,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,OAAO;QACL,QAAQ,CAAC,IAAI;YACX,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CACtC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,eAAI,CAAC,oBAAoB,CAC9D,CAAC,MAAM,CAAC;QACX,CAAC;QACD,mBAAmB,CAAC,IAAI;YACtB,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;gBACrC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,8DAA8D,EAC9D,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Lone anonymous operation\n *\n * A GraphQL document is only valid if when it contains an anonymous operation\n * (the query short-hand) that it contains only that one operation definition.\n *\n * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { LoneAnonymousOperationRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query { name } query Other { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * LoneAnonymousOperationRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * LoneAnonymousOperationRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function LoneAnonymousOperationRule(\n context: ASTValidationContext,\n): ASTVisitor {\n let operationCount = 0;\n return {\n Document(node) {\n operationCount = node.definitions.filter(\n (definition) => definition.kind === Kind.OPERATION_DEFINITION,\n ).length;\n },\n OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(\n new GraphQLError(\n 'This anonymous operation must be the only defined operation.',\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs new file mode 100644 index 00000000..aba7b161 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs @@ -0,0 +1,16 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +export function LoneAnonymousOperationRule(context) { + let operationCount = 0; + return { + Document(node) { + operationCount = node.definitions.filter((definition) => definition.kind === Kind.OPERATION_DEFINITION).length; + }, + OperationDefinition(node) { + if (!node.name && operationCount > 1) { + context.reportError(new GraphQLError('This anonymous operation must be the only defined operation.', { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=LoneAnonymousOperationRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs.map new file mode 100644 index 00000000..0ae779b7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LoneAnonymousOperationRule.js","sourceRoot":"","sources":["../../../src/validation/rules/LoneAnonymousOperationRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAE3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AA4C/C,MAAM,UAAU,0BAA0B,CACxC,OAA6B;IAE7B,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,OAAO;QACL,QAAQ,CAAC,IAAI;YACX,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CACtC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,oBAAoB,CAC9D,CAAC,MAAM,CAAC;QACX,CAAC;QACD,mBAAmB,CAAC,IAAI;YACtB,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;gBACrC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,8DAA8D,EAC9D,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Lone anonymous operation\n *\n * A GraphQL document is only valid if when it contains an anonymous operation\n * (the query short-hand) that it contains only that one operation definition.\n *\n * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { LoneAnonymousOperationRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query { name } query Other { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * LoneAnonymousOperationRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * LoneAnonymousOperationRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function LoneAnonymousOperationRule(\n context: ASTValidationContext,\n): ASTVisitor {\n let operationCount = 0;\n return {\n Document(node) {\n operationCount = node.definitions.filter(\n (definition) => definition.kind === Kind.OPERATION_DEFINITION,\n ).length;\n },\n OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(\n new GraphQLError(\n 'This anonymous operation must be the only defined operation.',\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.mts new file mode 100644 index 00000000..8e143013 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Lone Schema definition + * + * A GraphQL document is only valid if it contains only one schema definition. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { LoneSchemaDefinitionRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * schema { query: Query } schema { query: Query } type Query { name: String } + * `; + * + * LoneSchemaDefinitionRule.name; // => 'LoneSchemaDefinitionRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * schema { query: Query } type Query { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function LoneSchemaDefinitionRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts new file mode 100644 index 00000000..5b6d4f66 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Lone Schema definition + * + * A GraphQL document is only valid if it contains only one schema definition. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { LoneSchemaDefinitionRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * schema { query: Query } schema { query: Query } type Query { name: String } + * `; + * + * LoneSchemaDefinitionRule.name; // => 'LoneSchemaDefinitionRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * schema { query: Query } type Query { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function LoneSchemaDefinitionRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js new file mode 100644 index 00000000..eb3b64d6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LoneSchemaDefinitionRule = LoneSchemaDefinitionRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function LoneSchemaDefinitionRule(context) { + const oldSchema = context.getSchema(); + const alreadyDefined = oldSchema?.astNode ?? + oldSchema?.getQueryType() ?? + oldSchema?.getMutationType() ?? + oldSchema?.getSubscriptionType(); + let schemaDefinitionsCount = 0; + return { + SchemaDefinition(node) { + if (alreadyDefined) { + context.reportError(new GraphQLError_ts_1.GraphQLError('Cannot define a new schema within a schema extension.', { nodes: node })); + return; + } + if (schemaDefinitionsCount > 0) { + context.reportError(new GraphQLError_ts_1.GraphQLError('Must provide only one schema definition.', { + nodes: node, + })); + } + ++schemaDefinitionsCount; + }, + }; +} +//# sourceMappingURL=LoneSchemaDefinitionRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.map new file mode 100644 index 00000000..45e289ac --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LoneSchemaDefinitionRule.js","sourceRoot":"","sources":["../../../src/validation/rules/LoneSchemaDefinitionRule.ts"],"names":[],"mappings":";;AAiCA,4DAiCC;AAhED,iEAA2D;AA+B3D,SAAgB,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACtC,MAAM,cAAc,GAClB,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,YAAY,EAAE;QACzB,SAAS,EAAE,eAAe,EAAE;QAC5B,SAAS,EAAE,mBAAmB,EAAE,CAAC;IAEnC,IAAI,sBAAsB,GAAG,CAAC,CAAC;IAC/B,OAAO;QACL,gBAAgB,CAAC,IAAI;YACnB,IAAI,cAAc,EAAE,CAAC;gBACnB,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,uDAAuD,EACvD,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,IAAI,sBAAsB,GAAG,CAAC,EAAE,CAAC;gBAC/B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CAAC,0CAA0C,EAAE;oBAC3D,KAAK,EAAE,IAAI;iBACZ,CAAC,CACH,CAAC;YACJ,CAAC;YACD,EAAE,sBAAsB,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Lone Schema definition\n *\n * A GraphQL document is only valid if it contains only one schema definition.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { LoneSchemaDefinitionRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * schema { query: Query } schema { query: Query } type Query { name: String }\n * `;\n *\n * LoneSchemaDefinitionRule.name; // => 'LoneSchemaDefinitionRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * schema { query: Query } type Query { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function LoneSchemaDefinitionRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const oldSchema = context.getSchema();\n const alreadyDefined =\n oldSchema?.astNode ??\n oldSchema?.getQueryType() ??\n oldSchema?.getMutationType() ??\n oldSchema?.getSubscriptionType();\n\n let schemaDefinitionsCount = 0;\n return {\n SchemaDefinition(node) {\n if (alreadyDefined) {\n context.reportError(\n new GraphQLError(\n 'Cannot define a new schema within a schema extension.',\n { nodes: node },\n ),\n );\n return;\n }\n\n if (schemaDefinitionsCount > 0) {\n context.reportError(\n new GraphQLError('Must provide only one schema definition.', {\n nodes: node,\n }),\n );\n }\n ++schemaDefinitionsCount;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs new file mode 100644 index 00000000..7203769d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs @@ -0,0 +1,24 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function LoneSchemaDefinitionRule(context) { + const oldSchema = context.getSchema(); + const alreadyDefined = oldSchema?.astNode ?? + oldSchema?.getQueryType() ?? + oldSchema?.getMutationType() ?? + oldSchema?.getSubscriptionType(); + let schemaDefinitionsCount = 0; + return { + SchemaDefinition(node) { + if (alreadyDefined) { + context.reportError(new GraphQLError('Cannot define a new schema within a schema extension.', { nodes: node })); + return; + } + if (schemaDefinitionsCount > 0) { + context.reportError(new GraphQLError('Must provide only one schema definition.', { + nodes: node, + })); + } + ++schemaDefinitionsCount; + }, + }; +} +//# sourceMappingURL=LoneSchemaDefinitionRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs.map new file mode 100644 index 00000000..10497b6b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LoneSchemaDefinitionRule.js","sourceRoot":"","sources":["../../../src/validation/rules/LoneSchemaDefinitionRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA+B3D,MAAM,UAAU,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACtC,MAAM,cAAc,GAClB,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,YAAY,EAAE;QACzB,SAAS,EAAE,eAAe,EAAE;QAC5B,SAAS,EAAE,mBAAmB,EAAE,CAAC;IAEnC,IAAI,sBAAsB,GAAG,CAAC,CAAC;IAC/B,OAAO;QACL,gBAAgB,CAAC,IAAI;YACnB,IAAI,cAAc,EAAE,CAAC;gBACnB,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,uDAAuD,EACvD,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,IAAI,sBAAsB,GAAG,CAAC,EAAE,CAAC;gBAC/B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CAAC,0CAA0C,EAAE;oBAC3D,KAAK,EAAE,IAAI;iBACZ,CAAC,CACH,CAAC;YACJ,CAAC;YACD,EAAE,sBAAsB,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Lone Schema definition\n *\n * A GraphQL document is only valid if it contains only one schema definition.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { LoneSchemaDefinitionRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * schema { query: Query } schema { query: Query } type Query { name: String }\n * `;\n *\n * LoneSchemaDefinitionRule.name; // => 'LoneSchemaDefinitionRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * schema { query: Query } type Query { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function LoneSchemaDefinitionRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const oldSchema = context.getSchema();\n const alreadyDefined =\n oldSchema?.astNode ??\n oldSchema?.getQueryType() ??\n oldSchema?.getMutationType() ??\n oldSchema?.getSubscriptionType();\n\n let schemaDefinitionsCount = 0;\n return {\n SchemaDefinition(node) {\n if (alreadyDefined) {\n context.reportError(\n new GraphQLError(\n 'Cannot define a new schema within a schema extension.',\n { nodes: node },\n ),\n );\n return;\n }\n\n if (schemaDefinitionsCount > 0) {\n context.reportError(\n new GraphQLError('Must provide only one schema definition.', {\n nodes: node,\n }),\n );\n }\n ++schemaDefinitionsCount;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.mts new file mode 100644 index 00000000..c0ec6633 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.mts @@ -0,0 +1,38 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Implements the max introspection depth validation rule. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { MaxIntrospectionDepthRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { __schema { types { fields { type { fields { type { fields { name } } } } } } } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * MaxIntrospectionDepthRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { __schema { queryType { name } } } + * `); + * const validErrors = validate(schema, validDocument, [ + * MaxIntrospectionDepthRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function MaxIntrospectionDepthRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts new file mode 100644 index 00000000..57e30517 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts @@ -0,0 +1,38 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Implements the max introspection depth validation rule. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { MaxIntrospectionDepthRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { __schema { types { fields { type { fields { type { fields { name } } } } } } } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * MaxIntrospectionDepthRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { __schema { queryType { name } } } + * `); + * const validErrors = validate(schema, validDocument, [ + * MaxIntrospectionDepthRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function MaxIntrospectionDepthRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js new file mode 100644 index 00000000..19a487c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MaxIntrospectionDepthRule = MaxIntrospectionDepthRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const MAX_LISTS_DEPTH = 3; +function MaxIntrospectionDepthRule(context) { + function checkDepth(node, visitedFragments = Object.create(null), depth = 0) { + if (node.kind === kinds_ts_1.Kind.FRAGMENT_SPREAD) { + const fragmentName = node.name.value; + if (visitedFragments[fragmentName] === true) { + return false; + } + const fragment = context.getFragment(fragmentName); + if (!fragment) { + return false; + } + try { + visitedFragments[fragmentName] = true; + return checkDepth(fragment, visitedFragments, depth); + } + finally { + visitedFragments[fragmentName] = undefined; + } + } + if (node.kind === kinds_ts_1.Kind.FIELD && + (node.name.value === 'fields' || + node.name.value === 'interfaces' || + node.name.value === 'possibleTypes' || + node.name.value === 'inputFields')) { + depth++; + if (depth >= MAX_LISTS_DEPTH) { + return true; + } + } + if ('selectionSet' in node && node.selectionSet) { + for (const child of node.selectionSet.selections) { + if (checkDepth(child, visitedFragments, depth)) { + return true; + } + } + } + return false; + } + return { + Field(node) { + if (node.name.value === '__schema' || node.name.value === '__type') { + if (checkDepth(node)) { + context.reportError(new GraphQLError_ts_1.GraphQLError('Maximum introspection depth exceeded', { + nodes: [node], + })); + return false; + } + } + }, + }; +} +//# sourceMappingURL=MaxIntrospectionDepthRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js.map new file mode 100644 index 00000000..a6f50bd0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MaxIntrospectionDepthRule.js","sourceRoot":"","sources":["../../../src/validation/rules/MaxIntrospectionDepthRule.ts"],"names":[],"mappings":";;AA8CA,8DAkFC;AA9HD,iEAA2D;AAG3D,sDAA+C;AAK/C,MAAM,eAAe,GAAG,CAAC,CAAC;AAoC1B,SAAgB,yBAAyB,CACvC,OAA6B;IAQ7B,SAAS,UAAU,CACjB,IAAa,EACb,mBAEI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EACvB,QAAgB,CAAC;QAEjB,IAAI,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,eAAe,EAAE,CAAC;YACvC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACrC,IAAI,gBAAgB,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC;gBAE5C,OAAO,KAAK,CAAC;YACf,CAAC;YACD,MAA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CAAC,IAAI,CAAC,EAAE,CAAC;oBACrB,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CAAC,sCAAsC,EAAE;wBACvD,KAAK,EAAE,CAAC,IAAI,CAAC;qBACd,CAAC,CACH,CAAC;oBACF,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\nconst MAX_LISTS_DEPTH = 3;\n\n/**\n * Implements the max introspection depth validation rule.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { MaxIntrospectionDepthRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { __schema { types { fields { type { fields { type { fields { name } } } } } } } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * MaxIntrospectionDepthRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { __schema { queryType { name } } }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * MaxIntrospectionDepthRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function MaxIntrospectionDepthRule(\n context: ASTValidationContext,\n): ASTVisitor {\n /**\n * Counts the depth of list fields in \"__Type\" recursively and\n * returns `true` if the limit has been reached.\n *\n * @internal\n */\n function checkDepth(\n node: ASTNode,\n visitedFragments: {\n [fragmentName: string]: true | undefined;\n } = Object.create(null),\n depth: number = 0,\n ): boolean {\n if (node.kind === Kind.FRAGMENT_SPREAD) {\n const fragmentName = node.name.value;\n if (visitedFragments[fragmentName] === true) {\n // Fragment cycles are handled by `NoFragmentCyclesRule`.\n return false;\n }\n const fragment = context.getFragment(fragmentName);\n if (!fragment) {\n // Missing fragments checks are handled by `KnownFragmentNamesRule`.\n return false;\n }\n\n // Rather than following an immutable programming pattern which has\n // significant memory and garbage collection overhead, we've opted to\n // take a mutable approach for efficiency's sake. Importantly visiting a\n // fragment twice is fine, so long as you don't do one visit inside the\n // other.\n try {\n visitedFragments[fragmentName] = true;\n return checkDepth(fragment, visitedFragments, depth);\n } finally {\n visitedFragments[fragmentName] = undefined;\n }\n }\n\n if (\n node.kind === Kind.FIELD &&\n // check all introspection lists\n (node.name.value === 'fields' ||\n node.name.value === 'interfaces' ||\n node.name.value === 'possibleTypes' ||\n node.name.value === 'inputFields')\n ) {\n // eslint-disable-next-line no-param-reassign\n depth++;\n if (depth >= MAX_LISTS_DEPTH) {\n return true;\n }\n }\n\n // handles fields and inline fragments\n if ('selectionSet' in node && node.selectionSet) {\n for (const child of node.selectionSet.selections) {\n if (checkDepth(child, visitedFragments, depth)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return {\n Field(node) {\n if (node.name.value === '__schema' || node.name.value === '__type') {\n if (checkDepth(node)) {\n context.reportError(\n new GraphQLError('Maximum introspection depth exceeded', {\n nodes: [node],\n }),\n );\n return false;\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs new file mode 100644 index 00000000..eb2654de --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs @@ -0,0 +1,55 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +const MAX_LISTS_DEPTH = 3; +export function MaxIntrospectionDepthRule(context) { + function checkDepth(node, visitedFragments = Object.create(null), depth = 0) { + if (node.kind === Kind.FRAGMENT_SPREAD) { + const fragmentName = node.name.value; + if (visitedFragments[fragmentName] === true) { + return false; + } + const fragment = context.getFragment(fragmentName); + if (!fragment) { + return false; + } + try { + visitedFragments[fragmentName] = true; + return checkDepth(fragment, visitedFragments, depth); + } + finally { + visitedFragments[fragmentName] = undefined; + } + } + if (node.kind === Kind.FIELD && + (node.name.value === 'fields' || + node.name.value === 'interfaces' || + node.name.value === 'possibleTypes' || + node.name.value === 'inputFields')) { + depth++; + if (depth >= MAX_LISTS_DEPTH) { + return true; + } + } + if ('selectionSet' in node && node.selectionSet) { + for (const child of node.selectionSet.selections) { + if (checkDepth(child, visitedFragments, depth)) { + return true; + } + } + } + return false; + } + return { + Field(node) { + if (node.name.value === '__schema' || node.name.value === '__type') { + if (checkDepth(node)) { + context.reportError(new GraphQLError('Maximum introspection depth exceeded', { + nodes: [node], + })); + return false; + } + } + }, + }; +} +//# sourceMappingURL=MaxIntrospectionDepthRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs.map new file mode 100644 index 00000000..ff7ecef7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"MaxIntrospectionDepthRule.js","sourceRoot":"","sources":["../../../src/validation/rules/MaxIntrospectionDepthRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAK/C,MAAM,eAAe,GAAG,CAAC,CAAC;AAoC1B,MAAM,UAAU,yBAAyB,CACvC,OAA6B;IAQ7B,SAAS,UAAU,CACjB,IAAa,EACb,mBAEI,MAAM,CAAC,MAAM,CAAC,IAAI,CA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AC/C,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO;QACL,KAAK,CAAC,IAAI;YACR,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACnE,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;oBACrB,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CAAC,sCAAsC,EAAE;wBACvD,KAAK,EAAE,CAAC,IAAI,CAAC;qBACd,CAAC,CACH,CAAC;oBACF,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\nconst MAX_LISTS_DEPTH = 3;\n\n/**\n * Implements the max introspection depth validation rule.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { MaxIntrospectionDepthRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { __schema { types { fields { type { fields { type { fields { name } } } } } } } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * MaxIntrospectionDepthRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { __schema { queryType { name } } }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * MaxIntrospectionDepthRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function MaxIntrospectionDepthRule(\n context: ASTValidationContext,\n): ASTVisitor {\n /**\n * Counts the depth of list fields in \"__Type\" recursively and\n * returns `true` if the limit has been reached.\n *\n * @internal\n */\n function checkDepth(\n node: ASTNode,\n visitedFragments: {\n [fragmentName: string]: true | undefined;\n } = Object.create(null),\n depth: number = 0,\n ): boolean {\n if (node.kind === Kind.FRAGMENT_SPREAD) {\n const fragmentName = node.name.value;\n if (visitedFragments[fragmentName] === true) {\n // Fragment cycles are handled by `NoFragmentCyclesRule`.\n return false;\n }\n const fragment = context.getFragment(fragmentName);\n if (!fragment) {\n // Missing fragments checks are handled by `KnownFragmentNamesRule`.\n return false;\n }\n\n // Rather than following an immutable programming pattern which has\n // significant memory and garbage collection overhead, we've opted to\n // take a mutable approach for efficiency's sake. Importantly visiting a\n // fragment twice is fine, so long as you don't do one visit inside the\n // other.\n try {\n visitedFragments[fragmentName] = true;\n return checkDepth(fragment, visitedFragments, depth);\n } finally {\n visitedFragments[fragmentName] = undefined;\n }\n }\n\n if (\n node.kind === Kind.FIELD &&\n // check all introspection lists\n (node.name.value === 'fields' ||\n node.name.value === 'interfaces' ||\n node.name.value === 'possibleTypes' ||\n node.name.value === 'inputFields')\n ) {\n // eslint-disable-next-line no-param-reassign\n depth++;\n if (depth >= MAX_LISTS_DEPTH) {\n return true;\n }\n }\n\n // handles fields and inline fragments\n if ('selectionSet' in node && node.selectionSet) {\n for (const child of node.selectionSet.selections) {\n if (checkDepth(child, visitedFragments, depth)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return {\n Field(node) {\n if (node.name.value === '__schema' || node.name.value === '__type') {\n if (checkDepth(node)) {\n context.reportError(\n new GraphQLError('Maximum introspection depth exceeded', {\n nodes: [node],\n }),\n );\n return false;\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.mts new file mode 100644 index 00000000..481484c2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.mts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * No fragment cycles + * + * The graph of fragment spreads must not form any cycles including spreading itself. + * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoFragmentCyclesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment A on Query { ...B } fragment B on Query { ...A } query { ...A } + * `); + * const invalidErrors = validate(schema, invalidDocument, [NoFragmentCyclesRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment A on Query { name } query { ...A } + * `); + * const validErrors = validate(schema, validDocument, [NoFragmentCyclesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoFragmentCyclesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts new file mode 100644 index 00000000..3c2c7082 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts @@ -0,0 +1,39 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * No fragment cycles + * + * The graph of fragment spreads must not form any cycles including spreading itself. + * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data. + * + * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoFragmentCyclesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment A on Query { ...B } fragment B on Query { ...A } query { ...A } + * `); + * const invalidErrors = validate(schema, invalidDocument, [NoFragmentCyclesRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment A on Query { name } query { ...A } + * `); + * const validErrors = validate(schema, validDocument, [NoFragmentCyclesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoFragmentCyclesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js new file mode 100644 index 00000000..f29ed374 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoFragmentCyclesRule = NoFragmentCyclesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function NoFragmentCyclesRule(context) { + const visitedFrags = new Set(); + const spreadPath = []; + const spreadPathIndexByName = Object.create(null); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + detectCycleRecursive(node); + return false; + }, + }; + function detectCycleRecursive(fragment) { + if (visitedFrags.has(fragment.name.value)) { + return; + } + const fragmentName = fragment.name.value; + visitedFrags.add(fragmentName); + const spreadNodes = context.getFragmentSpreads(fragment.selectionSet); + if (spreadNodes.length === 0) { + return; + } + spreadPathIndexByName[fragmentName] = spreadPath.length; + for (const spreadNode of spreadNodes) { + const spreadName = spreadNode.name.value; + const cycleIndex = spreadPathIndexByName[spreadName]; + spreadPath.push(spreadNode); + if (cycleIndex === undefined) { + const spreadFragment = context.getFragment(spreadName); + if (spreadFragment) { + detectCycleRecursive(spreadFragment); + } + } + else { + const cyclePath = spreadPath.slice(cycleIndex); + const viaPath = cyclePath + .slice(0, -1) + .map((s) => '"' + s.name.value + '"') + .join(', '); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Cannot spread fragment "${spreadName}" within itself` + + (viaPath !== '' ? ` via ${viaPath}.` : '.'), { nodes: cyclePath })); + } + spreadPath.pop(); + } + spreadPathIndexByName[fragmentName] = undefined; + } +} +//# sourceMappingURL=NoFragmentCyclesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.map new file mode 100644 index 00000000..cd7862c7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoFragmentCyclesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoFragmentCyclesRule.ts"],"names":[],"mappings":";;AAiDA,oDAqEC;AAlHD,iEAA2D;AA6C3D,SAAgB,oBAAoB,CAClC,OAA6B;IAI7B,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAGvC,MAAM,UAAU,GAA8B,EAAE,CAAC;IAGjD,MAAM,qBAAqB,GAA+B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE9E,OAAO;QACL,mBAAmB,EAAE,GAAG,EAAE,CAAC,KAAK;QAChC,kBAAkB,CAAC,IAAI;YACrB,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IAKF,SAAS,oBAAoB,CAAC,QAAgC;QAC5D,IAAI,YAAY,CAAC,GAAG,CAA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EAAE,CAAC,CAAC,CAAC,QAAQ,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAC7C,EAAE,KAAK,EAAE,SAAS,EAAE,CACrB,CACF,CAAC;YACJ,CAAC;YACD,UAAU,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC;QAED,qBAAqB,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n FragmentDefinitionNode,\n FragmentSpreadNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * No fragment cycles\n *\n * The graph of fragment spreads must not form any cycles including spreading itself.\n * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoFragmentCyclesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment A on Query { ...B } fragment B on Query { ...A } query { ...A }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [NoFragmentCyclesRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment A on Query { name } query { ...A }\n * `);\n * const validErrors = validate(schema, validDocument, [NoFragmentCyclesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoFragmentCyclesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n // Tracks already visited fragments to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n const visitedFrags = new Set();\n\n // Array of AST nodes used to produce meaningful errors\n const spreadPath: Array = [];\n\n // Position in the spread path\n const spreadPathIndexByName: ObjMap = Object.create(null);\n\n return {\n OperationDefinition: () => false,\n FragmentDefinition(node) {\n detectCycleRecursive(node);\n return false;\n },\n };\n\n // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n function detectCycleRecursive(fragment: FragmentDefinitionNode): void {\n if (visitedFrags.has(fragment.name.value)) {\n return;\n }\n\n const fragmentName = fragment.name.value;\n visitedFrags.add(fragmentName);\n\n const spreadNodes = context.getFragmentSpreads(fragment.selectionSet);\n if (spreadNodes.length === 0) {\n return;\n }\n\n spreadPathIndexByName[fragmentName] = spreadPath.length;\n\n for (const spreadNode of spreadNodes) {\n const spreadName = spreadNode.name.value;\n const cycleIndex = spreadPathIndexByName[spreadName];\n\n spreadPath.push(spreadNode);\n if (cycleIndex === undefined) {\n const spreadFragment = context.getFragment(spreadName);\n if (spreadFragment) {\n detectCycleRecursive(spreadFragment);\n }\n } else {\n const cyclePath = spreadPath.slice(cycleIndex);\n const viaPath = cyclePath\n .slice(0, -1)\n .map((s) => '\"' + s.name.value + '\"')\n .join(', ');\n\n context.reportError(\n new GraphQLError(\n `Cannot spread fragment \"${spreadName}\" within itself` +\n (viaPath !== '' ? ` via ${viaPath}.` : '.'),\n { nodes: cyclePath },\n ),\n );\n }\n spreadPath.pop();\n }\n\n spreadPathIndexByName[fragmentName] = undefined;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs new file mode 100644 index 00000000..f66fcfed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs @@ -0,0 +1,48 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function NoFragmentCyclesRule(context) { + const visitedFrags = new Set(); + const spreadPath = []; + const spreadPathIndexByName = Object.create(null); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + detectCycleRecursive(node); + return false; + }, + }; + function detectCycleRecursive(fragment) { + if (visitedFrags.has(fragment.name.value)) { + return; + } + const fragmentName = fragment.name.value; + visitedFrags.add(fragmentName); + const spreadNodes = context.getFragmentSpreads(fragment.selectionSet); + if (spreadNodes.length === 0) { + return; + } + spreadPathIndexByName[fragmentName] = spreadPath.length; + for (const spreadNode of spreadNodes) { + const spreadName = spreadNode.name.value; + const cycleIndex = spreadPathIndexByName[spreadName]; + spreadPath.push(spreadNode); + if (cycleIndex === undefined) { + const spreadFragment = context.getFragment(spreadName); + if (spreadFragment) { + detectCycleRecursive(spreadFragment); + } + } + else { + const cyclePath = spreadPath.slice(cycleIndex); + const viaPath = cyclePath + .slice(0, -1) + .map((s) => '"' + s.name.value + '"') + .join(', '); + context.reportError(new GraphQLError(`Cannot spread fragment "${spreadName}" within itself` + + (viaPath !== '' ? ` via ${viaPath}.` : '.'), { nodes: cyclePath })); + } + spreadPath.pop(); + } + spreadPathIndexByName[fragmentName] = undefined; + } +} +//# sourceMappingURL=NoFragmentCyclesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs.map new file mode 100644 index 00000000..ca41dde7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NoFragmentCyclesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoFragmentCyclesRule.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA6C3D,MAAM,UAAU,oBAAoB,CAClC,OAA6B;IAI7B,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAG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AAU,CAAC,CAAC;gBAC/C,MAAM,OAAO,GAAG,SAAS;qBACtB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;qBACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;qBACpC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAEd,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,2BAA2B,UAAU,iBAAiB;oBACpD,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAC7C,EAAE,KAAK,EAAE,SAAS,EAAE,CACrB,CACF,CAAC;YACJ,CAAC;YACD,UAAU,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC;QAED,qBAAqB,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n FragmentDefinitionNode,\n FragmentSpreadNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * No fragment cycles\n *\n * The graph of fragment spreads must not form any cycles including spreading itself.\n * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoFragmentCyclesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment A on Query { ...B } fragment B on Query { ...A } query { ...A }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [NoFragmentCyclesRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment A on Query { name } query { ...A }\n * `);\n * const validErrors = validate(schema, validDocument, [NoFragmentCyclesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoFragmentCyclesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n // Tracks already visited fragments to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n const visitedFrags = new Set();\n\n // Array of AST nodes used to produce meaningful errors\n const spreadPath: Array = [];\n\n // Position in the spread path\n const spreadPathIndexByName: ObjMap = Object.create(null);\n\n return {\n OperationDefinition: () => false,\n FragmentDefinition(node) {\n detectCycleRecursive(node);\n return false;\n },\n };\n\n // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n function detectCycleRecursive(fragment: FragmentDefinitionNode): void {\n if (visitedFrags.has(fragment.name.value)) {\n return;\n }\n\n const fragmentName = fragment.name.value;\n visitedFrags.add(fragmentName);\n\n const spreadNodes = context.getFragmentSpreads(fragment.selectionSet);\n if (spreadNodes.length === 0) {\n return;\n }\n\n spreadPathIndexByName[fragmentName] = spreadPath.length;\n\n for (const spreadNode of spreadNodes) {\n const spreadName = spreadNode.name.value;\n const cycleIndex = spreadPathIndexByName[spreadName];\n\n spreadPath.push(spreadNode);\n if (cycleIndex === undefined) {\n const spreadFragment = context.getFragment(spreadName);\n if (spreadFragment) {\n detectCycleRecursive(spreadFragment);\n }\n } else {\n const cyclePath = spreadPath.slice(cycleIndex);\n const viaPath = cyclePath\n .slice(0, -1)\n .map((s) => '\"' + s.name.value + '\"')\n .join(', ');\n\n context.reportError(\n new GraphQLError(\n `Cannot spread fragment \"${spreadName}\" within itself` +\n (viaPath !== '' ? ` via ${viaPath}.` : '.'),\n { nodes: cyclePath },\n ),\n );\n }\n spreadPath.pop();\n }\n\n spreadPathIndexByName[fragmentName] = undefined;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.mts new file mode 100644 index 00000000..96ebb5c0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.mts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * No undefined variables + * + * A GraphQL operation is only valid if all variables encountered, both directly + * and via fragment spreads, are defined by that operation. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoUndefinedVariablesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: ID) { field(arg: $missing) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoUndefinedVariablesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [NoUndefinedVariablesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoUndefinedVariablesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts new file mode 100644 index 00000000..5ab5628e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * No undefined variables + * + * A GraphQL operation is only valid if all variables encountered, both directly + * and via fragment spreads, are defined by that operation. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoUndefinedVariablesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: ID) { field(arg: $missing) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoUndefinedVariablesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [NoUndefinedVariablesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoUndefinedVariablesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js new file mode 100644 index 00000000..8fe19433 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoUndefinedVariablesRule = NoUndefinedVariablesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function NoUndefinedVariablesRule(context) { + return { + OperationDefinition(operation) { + const variableNameDefined = new Set(operation.variableDefinitions?.map((node) => node.variable.name.value)); + const usages = context.getRecursiveVariableUsages(operation); + for (const { node, fragmentVariableDefinition } of usages) { + if (fragmentVariableDefinition) { + continue; + } + const varName = node.name.value; + if (!variableNameDefined.has(varName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(operation.name + ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` + : `Variable "$${varName}" is not defined.`, { nodes: [node, operation] })); + } + } + }, + }; +} +//# sourceMappingURL=NoUndefinedVariablesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.map new file mode 100644 index 00000000..f506dd1b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoUndefinedVariablesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoUndefinedVariablesRule.ts"],"names":[],"mappings":";;AA6CA,4DA4BC;AAvED,iEAA2D;AA2C3D,SAAgB,wBAAwB,CACtC,OAA0B;IAE1B,OAAO;QACL,mBAAmB,CAAC,SAAS;YAC3B,MAAM,mBAAmB,GAAG,IAAI,GAAG,CACjC,SAAS,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CACvE,CAAC;YAEF,MAAM,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;YAC7D,KAAK,MAAM,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,MAAM,EAAE,CAAC;gBAC1D,IAAI,0BAA0B,EAAE,CAAC;oBAC/B,SAAS;gBACX,CAAC;gBACD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;gBAChC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,SAAS,CAAC,IAAI;wBACZ,CAAC,CAAC,cAAc,OAAO,kCAAkC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI;wBACjF,CAAC,CAAC,cAAc,OAAO,mBAAmB,EAC5C,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAC7B,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * No undefined variables\n *\n * A GraphQL operation is only valid if all variables encountered, both directly\n * and via fragment spreads, are defined by that operation.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoUndefinedVariablesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: ID) { field(arg: $missing) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoUndefinedVariablesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [NoUndefinedVariablesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoUndefinedVariablesRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(operation) {\n const variableNameDefined = new Set(\n operation.variableDefinitions?.map((node) => node.variable.name.value),\n );\n\n const usages = context.getRecursiveVariableUsages(operation);\n for (const { node, fragmentVariableDefinition } of usages) {\n if (fragmentVariableDefinition) {\n continue;\n }\n const varName = node.name.value;\n if (!variableNameDefined.has(varName)) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${varName}\" is not defined by operation \"${operation.name.value}\".`\n : `Variable \"$${varName}\" is not defined.`,\n { nodes: [node, operation] },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs new file mode 100644 index 00000000..edb83983 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs @@ -0,0 +1,21 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function NoUndefinedVariablesRule(context) { + return { + OperationDefinition(operation) { + const variableNameDefined = new Set(operation.variableDefinitions?.map((node) => node.variable.name.value)); + const usages = context.getRecursiveVariableUsages(operation); + for (const { node, fragmentVariableDefinition } of usages) { + if (fragmentVariableDefinition) { + continue; + } + const varName = node.name.value; + if (!variableNameDefined.has(varName)) { + context.reportError(new GraphQLError(operation.name + ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` + : `Variable "$${varName}" is not defined.`, { nodes: [node, operation] })); + } + } + }, + }; +} +//# sourceMappingURL=NoUndefinedVariablesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs.map new file mode 100644 index 00000000..ebacacf6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NoUndefinedVariablesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoUndefinedVariablesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA2C3D,MAAM,UAAU,wBAAwB,CACtC,OAA0B;IAE1B,OAAO;QACL,mBAAmB,CAAC,SAAS;YAC3B,MAAM,mBAAmB,GAAG,IAAI,GAAG,CACjC,SAAS,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CACvE,CAAC;YAEF,MAAM,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;YAC7D,KAAK,MAAM,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,MAAM,EAAE,CAAC;gBAC1D,IAAI,0BAA0B,EAAE,CAAC;oBAC/B,SAAS;gBACX,CAAC;gBACD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;gBAChC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,SAAS,CAAC,IAAI;wBACZ,CAAC,CAAC,cAAc,OAAO,kCAAkC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI;wBACjF,CAAC,CAAC,cAAc,OAAO,mBAAmB,EAC5C,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAC7B,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * No undefined variables\n *\n * A GraphQL operation is only valid if all variables encountered, both directly\n * and via fragment spreads, are defined by that operation.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoUndefinedVariablesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: ID) { field(arg: $missing) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoUndefinedVariablesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [NoUndefinedVariablesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoUndefinedVariablesRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(operation) {\n const variableNameDefined = new Set(\n operation.variableDefinitions?.map((node) => node.variable.name.value),\n );\n\n const usages = context.getRecursiveVariableUsages(operation);\n for (const { node, fragmentVariableDefinition } of usages) {\n if (fragmentVariableDefinition) {\n continue;\n }\n const varName = node.name.value;\n if (!variableNameDefined.has(varName)) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${varName}\" is not defined by operation \"${operation.name.value}\".`\n : `Variable \"$${varName}\" is not defined.`,\n { nodes: [node, operation] },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.mts new file mode 100644 index 00000000..7316d7df --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.mts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * No unused fragments + * + * A GraphQL document is only valid if all fragment definitions are spread + * within operations, or spread within other fragments spread within operations. + * + * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoUnusedFragmentsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment Unused on Query { name } query { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoUnusedFragmentsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment Used on Query { name } query { ...Used } + * `); + * const validErrors = validate(schema, validDocument, [NoUnusedFragmentsRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoUnusedFragmentsRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts new file mode 100644 index 00000000..299525d1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * No unused fragments + * + * A GraphQL document is only valid if all fragment definitions are spread + * within operations, or spread within other fragments spread within operations. + * + * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoUnusedFragmentsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment Unused on Query { name } query { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoUnusedFragmentsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment Used on Query { name } query { ...Used } + * `); + * const validErrors = validate(schema, validDocument, [NoUnusedFragmentsRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoUnusedFragmentsRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js new file mode 100644 index 00000000..6a8c692d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoUnusedFragmentsRule = NoUnusedFragmentsRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function NoUnusedFragmentsRule(context) { + const fragmentNameUsed = new Set(); + const fragmentDefs = []; + return { + OperationDefinition(operation) { + for (const fragment of context.getRecursivelyReferencedFragments(operation)) { + fragmentNameUsed.add(fragment.name.value); + } + return false; + }, + FragmentDefinition(node) { + fragmentDefs.push(node); + return false; + }, + Document: { + leave() { + for (const fragmentDef of fragmentDefs) { + const fragName = fragmentDef.name.value; + if (!fragmentNameUsed.has(fragName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Fragment "${fragName}" is never used.`, { + nodes: fragmentDef, + })); + } + } + }, + }, + }; +} +//# sourceMappingURL=NoUnusedFragmentsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.map new file mode 100644 index 00000000..9e95106f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoUnusedFragmentsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoUnusedFragmentsRule.ts"],"names":[],"mappings":";;AA8CA,sDAkCC;AA9ED,iEAA2D;AA4C3D,SAAgB,qBAAqB,CACnC,OAA6B;IAE7B,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC3C,MAAM,YAAY,GAAkC,EAAE,CAAC;IAEvD,OAAO;QACL,mBAAmB,CAAC,SAAS;YAC3B,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,iCAAiC,CAC9D,SAAS,CACV,EAAE,CAAC;gBACF,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,kBAAkB,CAAC,IAAI;YACrB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,QAAQ,EAAE;YACR,KAAK;gBACH,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;oBACvC,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;oBACxC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACpC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CAAC,aAAa,QAAQ,kBAAkB,EAAE;4BACxD,KAAK,EAAE,WAAW;yBACnB,CAAC,CACH,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FragmentDefinitionNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * No unused fragments\n *\n * A GraphQL document is only valid if all fragment definitions are spread\n * within operations, or spread within other fragments spread within operations.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoUnusedFragmentsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment Unused on Query { name } query { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoUnusedFragmentsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment Used on Query { name } query { ...Used }\n * `);\n * const validErrors = validate(schema, validDocument, [NoUnusedFragmentsRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoUnusedFragmentsRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const fragmentNameUsed = new Set();\n const fragmentDefs: Array = [];\n\n return {\n OperationDefinition(operation) {\n for (const fragment of context.getRecursivelyReferencedFragments(\n operation,\n )) {\n fragmentNameUsed.add(fragment.name.value);\n }\n return false;\n },\n FragmentDefinition(node) {\n fragmentDefs.push(node);\n return false;\n },\n Document: {\n leave() {\n for (const fragmentDef of fragmentDefs) {\n const fragName = fragmentDef.name.value;\n if (!fragmentNameUsed.has(fragName)) {\n context.reportError(\n new GraphQLError(`Fragment \"${fragName}\" is never used.`, {\n nodes: fragmentDef,\n }),\n );\n }\n }\n },\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs new file mode 100644 index 00000000..6b3dd927 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs @@ -0,0 +1,30 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function NoUnusedFragmentsRule(context) { + const fragmentNameUsed = new Set(); + const fragmentDefs = []; + return { + OperationDefinition(operation) { + for (const fragment of context.getRecursivelyReferencedFragments(operation)) { + fragmentNameUsed.add(fragment.name.value); + } + return false; + }, + FragmentDefinition(node) { + fragmentDefs.push(node); + return false; + }, + Document: { + leave() { + for (const fragmentDef of fragmentDefs) { + const fragName = fragmentDef.name.value; + if (!fragmentNameUsed.has(fragName)) { + context.reportError(new GraphQLError(`Fragment "${fragName}" is never used.`, { + nodes: fragmentDef, + })); + } + } + }, + }, + }; +} +//# sourceMappingURL=NoUnusedFragmentsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs.map new file mode 100644 index 00000000..6317b4fa --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NoUnusedFragmentsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoUnusedFragmentsRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA4C3D,MAAM,UAAU,qBAAqB,CACnC,OAA6B;IAE7B,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC3C,MAAM,YAAY,GAAkC,EAAE,CAAC;IAEvD,OAAO;QACL,mBAAmB,CAAC,SAAS;YAC3B,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,iCAAiC,CAC9D,SAAS,CACV,EAAE,CAAC;gBACF,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,kBAAkB,CAAC,IAAI;YACrB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,QAAQ,EAAE;YACR,KAAK;gBACH,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;oBACvC,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;oBACxC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACpC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CAAC,aAAa,QAAQ,kBAAkB,EAAE;4BACxD,KAAK,EAAE,WAAW;yBACnB,CAAC,CACH,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FragmentDefinitionNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * No unused fragments\n *\n * A GraphQL document is only valid if all fragment definitions are spread\n * within operations, or spread within other fragments spread within operations.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoUnusedFragmentsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment Unused on Query { name } query { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoUnusedFragmentsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment Used on Query { name } query { ...Used }\n * `);\n * const validErrors = validate(schema, validDocument, [NoUnusedFragmentsRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoUnusedFragmentsRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const fragmentNameUsed = new Set();\n const fragmentDefs: Array = [];\n\n return {\n OperationDefinition(operation) {\n for (const fragment of context.getRecursivelyReferencedFragments(\n operation,\n )) {\n fragmentNameUsed.add(fragment.name.value);\n }\n return false;\n },\n FragmentDefinition(node) {\n fragmentDefs.push(node);\n return false;\n },\n Document: {\n leave() {\n for (const fragmentDef of fragmentDefs) {\n const fragName = fragmentDef.name.value;\n if (!fragmentNameUsed.has(fragName)) {\n context.reportError(\n new GraphQLError(`Fragment \"${fragName}\" is never used.`, {\n nodes: fragmentDef,\n }),\n );\n }\n }\n },\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.mts new file mode 100644 index 00000000..023d4565 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.mts @@ -0,0 +1,42 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * No unused variables + * + * A GraphQL operation is only valid if all variables defined by an operation + * are used, either directly or within a spread fragment. + * + * See https://spec.graphql.org/draft/#sec-All-Variables-Used + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoUnusedVariablesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: ID) { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoUnusedVariablesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [NoUnusedVariablesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoUnusedVariablesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts new file mode 100644 index 00000000..eb22135c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts @@ -0,0 +1,42 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * No unused variables + * + * A GraphQL operation is only valid if all variables defined by an operation + * are used, either directly or within a spread fragment. + * + * See https://spec.graphql.org/draft/#sec-All-Variables-Used + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoUnusedVariablesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: ID) { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoUnusedVariablesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [NoUnusedVariablesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoUnusedVariablesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js new file mode 100644 index 00000000..fb3db9c9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoUnusedVariablesRule = NoUnusedVariablesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function NoUnusedVariablesRule(context) { + return { + FragmentDefinition(fragment) { + const usages = context.getVariableUsages(fragment); + const argumentNameUsed = new Set(usages.map(({ node }) => node.name.value)); + const variableDefinitions = fragment.variableDefinitions ?? []; + for (const varDef of variableDefinitions) { + const argName = varDef.variable.name.value; + if (!argumentNameUsed.has(argName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Variable "$${argName}" is never used in fragment "${fragment.name.value}".`, { nodes: varDef })); + } + } + }, + OperationDefinition(operation) { + const usages = context.getRecursiveVariableUsages(operation); + const operationVariableNameUsed = new Set(); + for (const { node, fragmentVariableDefinition } of usages) { + const varName = node.name.value; + if (!fragmentVariableDefinition) { + operationVariableNameUsed.add(varName); + } + } + const variableDefinitions = operation.variableDefinitions ?? []; + for (const variableDef of variableDefinitions) { + const variableName = variableDef.variable.name.value; + if (!operationVariableNameUsed.has(variableName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(operation.name + ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` + : `Variable "$${variableName}" is never used.`, { nodes: variableDef })); + } + } + }, + }; +} +//# sourceMappingURL=NoUnusedVariablesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.map new file mode 100644 index 00000000..189e129e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoUnusedVariablesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoUnusedVariablesRule.ts"],"names":[],"mappings":";;AA8CA,sDA8CC;AA1FD,iEAA2D;AA4C3D,SAAgB,qBAAqB,CAAC,OAA0B;IAC9D,OAAO;QACL,kBAAkB,CAAC,QAAQ;YACzB,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;YACnD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9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AC;oBACjD,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,SAAS,CAAC,IAAI;wBACZ,CAAC,CAAC,cAAc,YAAY,iCAAiC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI;wBACrF,CAAC,CAAC,cAAc,YAAY,kBAAkB,EAChD,EAAE,KAAK,EAAE,WAAW,EAAE,CACvB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * No unused variables\n *\n * A GraphQL operation is only valid if all variables defined by an operation\n * are used, either directly or within a spread fragment.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variables-Used\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoUnusedVariablesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: ID) { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoUnusedVariablesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [NoUnusedVariablesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoUnusedVariablesRule(context: ValidationContext): ASTVisitor {\n return {\n FragmentDefinition(fragment) {\n const usages = context.getVariableUsages(fragment);\n const argumentNameUsed = new Set(\n usages.map(({ node }) => node.name.value),\n );\n const variableDefinitions = fragment.variableDefinitions ?? [];\n for (const varDef of variableDefinitions) {\n const argName = varDef.variable.name.value;\n if (!argumentNameUsed.has(argName)) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${argName}\" is never used in fragment \"${fragment.name.value}\".`,\n { nodes: varDef },\n ),\n );\n }\n }\n },\n OperationDefinition(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n const operationVariableNameUsed = new Set();\n for (const { node, fragmentVariableDefinition } of usages) {\n const varName = node.name.value;\n if (!fragmentVariableDefinition) {\n operationVariableNameUsed.add(varName);\n }\n }\n\n const variableDefinitions = operation.variableDefinitions ?? [];\n for (const variableDef of variableDefinitions) {\n const variableName = variableDef.variable.name.value;\n if (!operationVariableNameUsed.has(variableName)) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${variableName}\" is never used in operation \"${operation.name.value}\".`\n : `Variable \"$${variableName}\" is never used.`,\n { nodes: variableDef },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs new file mode 100644 index 00000000..9cb11e12 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs @@ -0,0 +1,36 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function NoUnusedVariablesRule(context) { + return { + FragmentDefinition(fragment) { + const usages = context.getVariableUsages(fragment); + const argumentNameUsed = new Set(usages.map(({ node }) => node.name.value)); + const variableDefinitions = fragment.variableDefinitions ?? []; + for (const varDef of variableDefinitions) { + const argName = varDef.variable.name.value; + if (!argumentNameUsed.has(argName)) { + context.reportError(new GraphQLError(`Variable "$${argName}" is never used in fragment "${fragment.name.value}".`, { nodes: varDef })); + } + } + }, + OperationDefinition(operation) { + const usages = context.getRecursiveVariableUsages(operation); + const operationVariableNameUsed = new Set(); + for (const { node, fragmentVariableDefinition } of usages) { + const varName = node.name.value; + if (!fragmentVariableDefinition) { + operationVariableNameUsed.add(varName); + } + } + const variableDefinitions = operation.variableDefinitions ?? []; + for (const variableDef of variableDefinitions) { + const variableName = variableDef.variable.name.value; + if (!operationVariableNameUsed.has(variableName)) { + context.reportError(new GraphQLError(operation.name + ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` + : `Variable "$${variableName}" is never used.`, { nodes: variableDef })); + } + } + }, + }; +} +//# sourceMappingURL=NoUnusedVariablesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs.map new file mode 100644 index 00000000..1dc494b8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NoUnusedVariablesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/NoUnusedVariablesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA4C3D,MAAM,UAAU,qBAAqB,CAAC,OAA0B;IAC9D,OAAO;QACL,kBAAkB,CAAC,QAAQ;YACzB,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;YACnD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAC1C,CAAC;YACF,MAAM,mBAAmB,GAAG,QAAQ,CAAC,mBAAmB,IAAI,EAAE,CAAC;YAC/D,KAAK,MAAM,MAAM,IAAI,mBAAmB,EAAE,CAAC;gBACzC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC3C,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;oBACnC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,cAAc,OAAO,gCAAgC,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,EAC5E,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,mBAAmB,CAAC,SAAS;YAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;YAC7D,MAAM,yBAAyB,GAAG,IAAI,GAAG,EAAU,CAAC;YACpD,KAAK,MAAM,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,MAAM,EAAE,CAAC;gBAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;gBAChC,IAAI,CAAC,0BAA0B,EAAE,CAAC;oBAChC,yBAAyB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YAED,MAAM,mBAAmB,GAAG,SAAS,CAAC,mBAAmB,IAAI,EAAE,CAAC;YAChE,KAAK,MAAM,WAAW,IAAI,mBAAmB,EAAE,CAAC;gBAC9C,MAAM,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;gBACrD,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;oBACjD,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,SAAS,CAAC,IAAI;wBACZ,CAAC,CAAC,cAAc,YAAY,iCAAiC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI;wBACrF,CAAC,CAAC,cAAc,YAAY,kBAAkB,EAChD,EAAE,KAAK,EAAE,WAAW,EAAE,CACvB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * No unused variables\n *\n * A GraphQL operation is only valid if all variables defined by an operation\n * are used, either directly or within a spread fragment.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variables-Used\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoUnusedVariablesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: ID) { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoUnusedVariablesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [NoUnusedVariablesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoUnusedVariablesRule(context: ValidationContext): ASTVisitor {\n return {\n FragmentDefinition(fragment) {\n const usages = context.getVariableUsages(fragment);\n const argumentNameUsed = new Set(\n usages.map(({ node }) => node.name.value),\n );\n const variableDefinitions = fragment.variableDefinitions ?? [];\n for (const varDef of variableDefinitions) {\n const argName = varDef.variable.name.value;\n if (!argumentNameUsed.has(argName)) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${argName}\" is never used in fragment \"${fragment.name.value}\".`,\n { nodes: varDef },\n ),\n );\n }\n }\n },\n OperationDefinition(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n const operationVariableNameUsed = new Set();\n for (const { node, fragmentVariableDefinition } of usages) {\n const varName = node.name.value;\n if (!fragmentVariableDefinition) {\n operationVariableNameUsed.add(varName);\n }\n }\n\n const variableDefinitions = operation.variableDefinitions ?? [];\n for (const variableDef of variableDefinitions) {\n const variableName = variableDef.variable.name.value;\n if (!operationVariableNameUsed.has(variableName)) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${variableName}\" is never used in operation \"${operation.name.value}\".`\n : `Variable \"$${variableName}\" is never used.`,\n { nodes: variableDef },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts new file mode 100644 index 00000000..dde6980f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.mts @@ -0,0 +1,49 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Overlapping fields can be merged + * + * A selection set is only valid if all fields (including spreading any + * fragments) either correspond to distinct response names or can be merged + * without ambiguity. + * + * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { OverlappingFieldsCanBeMergedRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * dog: Dog + * } + * + * type Dog { + * name: String + * barkVolume: Int + * } + * `); + * + * const invalidDocument = parse(` + * { dog { value: barkVolume value: name } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * OverlappingFieldsCanBeMergedRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { dog { barkVolume name } } + * `); + * const validErrors = validate(schema, validDocument, [ + * OverlappingFieldsCanBeMergedRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function OverlappingFieldsCanBeMergedRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts new file mode 100644 index 00000000..d6bc43ed --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts @@ -0,0 +1,49 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Overlapping fields can be merged + * + * A selection set is only valid if all fields (including spreading any + * fragments) either correspond to distinct response names or can be merged + * without ambiguity. + * + * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { OverlappingFieldsCanBeMergedRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * dog: Dog + * } + * + * type Dog { + * name: String + * barkVolume: Int + * } + * `); + * + * const invalidDocument = parse(` + * { dog { value: barkVolume value: name } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * OverlappingFieldsCanBeMergedRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { dog { barkVolume name } } + * `); + * const validErrors = validate(schema, validDocument, [ + * OverlappingFieldsCanBeMergedRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function OverlappingFieldsCanBeMergedRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js new file mode 100644 index 00000000..f324e9d0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js @@ -0,0 +1,422 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OverlappingFieldsCanBeMergedRule = OverlappingFieldsCanBeMergedRule; +const inspect_ts_1 = require("../../jsutils/inspect.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const printer_ts_1 = require("../../language/printer.js"); +const definition_ts_1 = require("../../type/definition.js"); +const sortValueNode_ts_1 = require("../../utilities/sortValueNode.js"); +const typeFromAST_ts_1 = require("../../utilities/typeFromAST.js"); +function reasonMessage(reason) { + if (Array.isArray(reason)) { + return reason + .map(([responseName, subReason]) => `subfields "${responseName}" conflict because ` + + reasonMessage(subReason)) + .join(' and '); + } + return reason; +} +function OverlappingFieldsCanBeMergedRule(context) { + const comparedFieldsAndFragmentPairs = new OrderedPairSet(); + const comparedFragmentPairs = new PairSet(); + const cachedFieldsAndFragmentSpreads = new Map(); + return { + SelectionSet(selectionSet) { + const conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, context.getParentType(), selectionSet); + for (const [[responseName, reason], fields1, fields2] of conflicts) { + const reasonMsg = reasonMessage(reason); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, { nodes: fields1.concat(fields2) })); + } + }, + }; +} +function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentType, selectionSet) { + const conflicts = []; + const [fieldMap, fragmentSpreads] = getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType, selectionSet, undefined); + collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, fieldMap); + if (fragmentSpreads.length !== 0) { + for (let i = 0; i < fragmentSpreads.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, false, fieldMap, fragmentSpreads[i]); + for (let j = i + 1; j < fragmentSpreads.length; j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, false, fragmentSpreads[i], fragmentSpreads[j]); + } + } + } + return conflicts; +} +function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentSpread) { + if (comparedFieldsAndFragmentPairs.has(fieldMap, fragmentSpread.key, areMutuallyExclusive)) { + return; + } + comparedFieldsAndFragmentPairs.add(fieldMap, fragmentSpread.key, areMutuallyExclusive); + const fragment = context.getFragment(fragmentSpread.node.name.value); + if (!fragment) { + return; + } + const [fieldMap2, referencedFragmentSpreads] = getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment, fragmentSpread.varMap); + if (fieldMap === fieldMap2) { + return; + } + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap, undefined, fieldMap2, fragmentSpread.varMap); + for (const referencedFragmentSpread of referencedFragmentSpreads) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap, referencedFragmentSpread); + } +} +function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fragmentSpread1, fragmentSpread2) { + if (fragmentSpread1.key === fragmentSpread2.key) { + return; + } + if (fragmentSpread1.node.name.value === fragmentSpread2.node.name.value) { + if (!sameArguments(fragmentSpread1.node.arguments, fragmentSpread1.varMap, fragmentSpread2.node.arguments, fragmentSpread2.varMap)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Spreads "${fragmentSpread1.node.name.value}" conflict because ${fragmentSpread1.key} and ${fragmentSpread2.key} have different fragment arguments.`, { nodes: [fragmentSpread1.node, fragmentSpread2.node] })); + return; + } + } + if (comparedFragmentPairs.has(fragmentSpread1.key, fragmentSpread2.key, areMutuallyExclusive)) { + return; + } + comparedFragmentPairs.add(fragmentSpread1.key, fragmentSpread2.key, areMutuallyExclusive); + const fragment1 = context.getFragment(fragmentSpread1.node.name.value); + const fragment2 = context.getFragment(fragmentSpread2.node.name.value); + if (!fragment1 || !fragment2) { + return; + } + const [fieldMap1, referencedFragmentSpreads1] = getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment1, fragmentSpread1.varMap); + const [fieldMap2, referencedFragmentSpreads2] = getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment2, fragmentSpread2.varMap); + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentSpread1.varMap, fieldMap2, fragmentSpread2.varMap); + for (const referencedFragmentSpread2 of referencedFragmentSpreads2) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fragmentSpread1, referencedFragmentSpread2); + } + for (const referencedFragmentSpread1 of referencedFragmentSpreads1) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, referencedFragmentSpread1, fragmentSpread2); + } +} +function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, varMap1, parentType2, selectionSet2, varMap2) { + const conflicts = []; + const [fieldMap1, fragmentSpreads1] = getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType1, selectionSet1, varMap1); + const [fieldMap2, fragmentSpreads2] = getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType2, selectionSet2, varMap2); + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, varMap1, fieldMap2, varMap2); + for (const fragmentSpread2 of fragmentSpreads2) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentSpread2); + } + for (const fragmentSpread1 of fragmentSpreads1) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentSpread1); + } + for (const fragmentSpread1 of fragmentSpreads1) { + for (const fragmentSpread2 of fragmentSpreads2) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fragmentSpread1, fragmentSpread2); + } + } + return conflicts; +} +function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, fieldMap) { + for (const [responseName, fields] of fieldMap.entries()) { + if (fields.length > 1) { + for (let i = 0; i < fields.length; i++) { + for (let j = i + 1; j < fields.length; j++) { + const conflict = findConflict(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, false, responseName, fields[i], undefined, fields[j], undefined); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} +function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, varMap1, fieldMap2, varMap2) { + for (const [responseName, fields1] of fieldMap1.entries()) { + const fields2 = fieldMap2.get(responseName); + if (fields2 != null) { + for (const field1 of fields1) { + for (const field2 of fields2) { + const conflict = findConflict(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, varMap1, field2, varMap2); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} +function findConflict(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, varMap1, field2, varMap2) { + const [parentType1, node1, def1] = field1; + const [parentType2, node2, def2] = field2; + const areMutuallyExclusive = parentFieldsAreMutuallyExclusive || + (parentType1 !== parentType2 && + (0, definition_ts_1.isObjectType)(parentType1) && + (0, definition_ts_1.isObjectType)(parentType2)); + if (!areMutuallyExclusive) { + const name1 = node1.name.value; + const name2 = node2.name.value; + if (name1 !== name2) { + return [ + [responseName, `"${name1}" and "${name2}" are different fields`], + [node1], + [node2], + ]; + } + if (!sameArguments(node1.arguments, varMap1, node2.arguments, varMap2)) { + return [ + [responseName, 'they have differing arguments'], + [node1], + [node2], + ]; + } + } + const directives1 = node1.directives; + const directives2 = node2.directives; + const overlappingStreamReason = hasNoOverlappingStreams(directives1, varMap1, directives2, varMap2); + if (overlappingStreamReason !== undefined) { + return [[responseName, overlappingStreamReason], [node1], [node2]]; + } + const type1 = def1?.type; + const type2 = def2?.type; + if (type1 && type2 && doTypesConflict(type1, type2)) { + return [ + [ + responseName, + `they return conflicting types "${(0, inspect_ts_1.inspect)(type1)}" and "${(0, inspect_ts_1.inspect)(type2)}"`, + ], + [node1], + [node2], + ]; + } + const selectionSet1 = node1.selectionSet; + const selectionSet2 = node2.selectionSet; + if (selectionSet1 && selectionSet2) { + const conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, (0, definition_ts_1.getNamedType)(type1), selectionSet1, varMap1, (0, definition_ts_1.getNamedType)(type2), selectionSet2, varMap2); + return subfieldConflicts(conflicts, responseName, node1, node2); + } +} +function sameArguments(args1, varMap1, args2, varMap2) { + if (args1 === undefined || args1.length === 0) { + return args2 === undefined || args2.length === 0; + } + if (args2 === undefined || args2.length === 0) { + return false; + } + if (args1.length !== args2.length) { + return false; + } + const values2 = new Map(args2.map(({ name, value }) => [ + name.value, + varMap2 === undefined ? value : replaceFragmentVariables(value, varMap2), + ])); + return args1.every((arg1) => { + let value1 = arg1.value; + if (varMap1) { + value1 = replaceFragmentVariables(value1, varMap1); + } + const value2 = values2.get(arg1.name.value); + if (value2 === undefined) { + return false; + } + return stringifyValue(value1) === stringifyValue(value2); + }); +} +function replaceFragmentVariables(valueNode, varMap) { + switch (valueNode.kind) { + case kinds_ts_1.Kind.VARIABLE: + return varMap.get(valueNode.name.value) ?? valueNode; + case kinds_ts_1.Kind.LIST: + return { + ...valueNode, + values: valueNode.values.map((node) => replaceFragmentVariables(node, varMap)), + }; + case kinds_ts_1.Kind.OBJECT: + return { + ...valueNode, + fields: valueNode.fields.map((field) => ({ + ...field, + value: replaceFragmentVariables(field.value, varMap), + })), + }; + default: { + return valueNode; + } + } +} +function stringifyValue(value) { + return (0, printer_ts_1.print)((0, sortValueNode_ts_1.sortValueNode)(value)); +} +function getStreamDirective(directives) { + return directives?.find((directive) => directive.name.value === 'stream'); +} +function hasNoOverlappingStreams(directives1, varMap1, directives2, varMap2) { + const stream1 = getStreamDirective(directives1); + const stream2 = getStreamDirective(directives2); + if (!stream1 && !stream2) { + return; + } + else if (stream1 && stream2) { + if (sameArguments(stream1.arguments, varMap1, stream2.arguments, varMap2)) { + return 'they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100'; + } + return 'they have overlapping stream directives'; + } + return 'they have overlapping stream directives'; +} +function doTypesConflict(type1, type2) { + if ((0, definition_ts_1.isListType)(type1)) { + return (0, definition_ts_1.isListType)(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if ((0, definition_ts_1.isListType)(type2)) { + return true; + } + if ((0, definition_ts_1.isNonNullType)(type1)) { + return (0, definition_ts_1.isNonNullType)(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if ((0, definition_ts_1.isNonNullType)(type2)) { + return true; + } + if ((0, definition_ts_1.isLeafType)(type1) || (0, definition_ts_1.isLeafType)(type2)) { + return type1 !== type2; + } + return false; +} +function getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType, selectionSet, varMap) { + const cached = cachedFieldsAndFragmentSpreads.get(selectionSet); + if (cached) { + return cached; + } + const nodeAndDefs = new Map(); + const fragmentSpreads = new Map(); + _collectFieldsAndFragmentSpreads(context, parentType, selectionSet, nodeAndDefs, fragmentSpreads, varMap); + const result = [ + nodeAndDefs, + Array.from(fragmentSpreads.values()), + ]; + cachedFieldsAndFragmentSpreads.set(selectionSet, result); + return result; +} +function getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment, varMap) { + const cached = cachedFieldsAndFragmentSpreads.get(fragment.selectionSet); + if (cached) { + return cached; + } + const fragmentType = (0, typeFromAST_ts_1.typeFromAST)(context.getSchema(), fragment.typeCondition); + return getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragmentType, fragment.selectionSet, varMap); +} +function _collectFieldsAndFragmentSpreads(context, parentType, selectionSet, nodeAndDefs, fragmentSpreads, varMap) { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case kinds_ts_1.Kind.FIELD: { + const fieldName = selection.name.value; + let fieldDef; + if ((0, definition_ts_1.isObjectType)(parentType) || (0, definition_ts_1.isInterfaceType)(parentType)) { + fieldDef = parentType.getFields()[fieldName]; + } + const responseName = selection.alias + ? selection.alias.value + : fieldName; + let nodeAndDefsList = nodeAndDefs.get(responseName); + if (nodeAndDefsList == null) { + nodeAndDefsList = []; + nodeAndDefs.set(responseName, nodeAndDefsList); + } + nodeAndDefsList.push([parentType, selection, fieldDef]); + break; + } + case kinds_ts_1.Kind.FRAGMENT_SPREAD: { + const fragmentSpread = getFragmentSpread(context, selection, varMap); + fragmentSpreads.set(fragmentSpread.key, fragmentSpread); + break; + } + case kinds_ts_1.Kind.INLINE_FRAGMENT: { + const typeCondition = selection.typeCondition; + const inlineFragmentType = typeCondition + ? (0, typeFromAST_ts_1.typeFromAST)(context.getSchema(), typeCondition) + : parentType; + _collectFieldsAndFragmentSpreads(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentSpreads, varMap); + break; + } + } + } +} +function getFragmentSpread(context, fragmentSpreadNode, varMap) { + let key = ''; + const newVarMap = new Map(); + const fragmentSignature = context.getFragmentSignatureByName()(fragmentSpreadNode.name.value); + const argMap = new Map(); + if (fragmentSpreadNode.arguments) { + for (const arg of fragmentSpreadNode.arguments) { + argMap.set(arg.name.value, arg.value); + } + } + if (fragmentSignature?.variableDefinitions) { + key += fragmentSpreadNode.name.value + '('; + for (const [varName, variable] of fragmentSignature.variableDefinitions) { + const value = argMap.get(varName); + if (value) { + key += varName + ': ' + (0, printer_ts_1.print)((0, sortValueNode_ts_1.sortValueNode)(value)); + } + const arg = argMap.get(varName); + if (arg !== undefined) { + newVarMap.set(varName, varMap !== undefined ? replaceFragmentVariables(arg, varMap) : arg); + } + else if (variable.defaultValue) { + newVarMap.set(varName, variable.defaultValue); + } + } + key += ')'; + } + return { + key, + node: fragmentSpreadNode, + varMap: newVarMap.size > 0 ? newVarMap : undefined, + }; +} +function subfieldConflicts(conflicts, responseName, node1, node2) { + if (conflicts.length > 0) { + return [ + [responseName, conflicts.map(([reason]) => reason)], + [node1, ...conflicts.map(([, fields1]) => fields1).flat()], + [node2, ...conflicts.map(([, , fields2]) => fields2).flat()], + ]; + } +} +class OrderedPairSet { + constructor() { + this._data = new Map(); + } + has(a, b, weaklyPresent) { + const result = this._data.get(a)?.get(b); + if (result === undefined) { + return false; + } + return weaklyPresent ? true : weaklyPresent === result; + } + add(a, b, weaklyPresent) { + const map = this._data.get(a); + if (map === undefined) { + this._data.set(a, new Map([[b, weaklyPresent]])); + } + else { + map.set(b, weaklyPresent); + } + } +} +class PairSet { + constructor() { + this._orderedPairSet = new OrderedPairSet(); + } + has(a, b, weaklyPresent) { + return a < b + ? this._orderedPairSet.has(a, b, weaklyPresent) + : this._orderedPairSet.has(b, a, weaklyPresent); + } + add(a, b, weaklyPresent) { + if (a < b) { + this._orderedPairSet.add(a, b, weaklyPresent); + } + else { + this._orderedPairSet.add(b, a, weaklyPresent); + } + } +} +//# sourceMappingURL=OverlappingFieldsCanBeMergedRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.map new file mode 100644 index 00000000..41f24936 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"OverlappingFieldsCanBeMergedRule.js","sourceRoot":"","sources":["../../../src/validation/rules/OverlappingFieldsCanBeMergedRule.ts"],"names":[],"mappings":";;AAsGA,4EAsCC;AA1ID,yDAAmD;AAGnD,iEAA2D;AAY3D,sDAA+C;AAC/C,0DAAkD;AAQlD,4DAOkC;AAElC,uEAAiE;AACjE,mEAA6D;AAQ7D,SAAS,aAAa,CAAC,MAA6B;IAClD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,MAAM;aACV,GAAG,CACF,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,EAAE,CAC5B,cAAc,YAAY,qBAAqB;YAC/C,aAAa,CAAC,SAAS,CAAC,CAC3B;aACA,IAAI,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AA+CD,SAAgB,gCAAgC,CAC9C,OAA0B;IAK1B,MAAM,8BAA8B,GAAG,IAAI,cAAc,EAGtD,CAAC;IACJ,MAAM,qBAAqB,GAAG,IAAI,OAAO,EA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IACpD,CAAC;IAED,GAAG,CAAC,CAAI,EAAE,CAAI,EAAE,aAAsB;QACpC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACV,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n ArgumentNode,\n DirectiveNode,\n FieldNode,\n FragmentArgumentNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n SelectionSetNode,\n ValueNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type {\n GraphQLField,\n GraphQLNamedType,\n GraphQLOutputType,\n} from '../../type/definition.ts';\nimport {\n getNamedType,\n isInterfaceType,\n isLeafType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../../type/definition.ts';\n\nimport { sortValueNode } from '../../utilities/sortValueNode.ts';\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/* eslint-disable max-params */\n// This file contains a lot of such errors but we plan to refactor it anyway\n// so just disable it for entire file.\n\nfunction reasonMessage(reason: ConflictReasonMessage): string {\n if (Array.isArray(reason)) {\n return reason\n .map(\n ([responseName, subReason]) =>\n `subfields \"${responseName}\" conflict because ` +\n reasonMessage(subReason),\n )\n .join(' and ');\n }\n return reason;\n}\n\n/**\n * Overlapping fields can be merged\n *\n * A selection set is only valid if all fields (including spreading any\n * fragments) either correspond to distinct response names or can be merged\n * without ambiguity.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { OverlappingFieldsCanBeMergedRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * dog: Dog\n * }\n *\n * type Dog {\n * name: String\n * barkVolume: Int\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { dog { value: barkVolume value: name } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * OverlappingFieldsCanBeMergedRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { dog { barkVolume name } }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * OverlappingFieldsCanBeMergedRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function OverlappingFieldsCanBeMergedRule(\n context: ValidationContext,\n): ASTVisitor {\n // A memoization for when fields and a fragment or two fragments are compared\n // \"between\" each other for conflicts. Comparisons made be made many times,\n // so memoizing this can dramatically improve the performance of this validator.\n const comparedFieldsAndFragmentPairs = new OrderedPairSet<\n NodeAndDefCollection,\n string\n >();\n const comparedFragmentPairs = new PairSet();\n\n // A cache for the \"field map\" and list of fragment spreads found in any given\n // selection set. Selection sets may be asked for this information multiple\n // times, so this improves the performance of this validator.\n const cachedFieldsAndFragmentSpreads = new Map();\n\n return {\n SelectionSet(selectionSet) {\n const conflicts = findConflictsWithinSelectionSet(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n context.getParentType(),\n selectionSet,\n );\n for (const [[responseName, reason], fields1, fields2] of conflicts) {\n const reasonMsg = reasonMessage(reason);\n context.reportError(\n new GraphQLError(\n `Fields \"${responseName}\" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`,\n { nodes: fields1.concat(fields2) },\n ),\n );\n }\n },\n };\n}\n\ntype Conflict = [ConflictReason, Array, Array];\n// Field name and reason.\ntype ConflictReason = [string, ConflictReasonMessage];\n// Reason is a string, or a nested list of conflicts.\ntype ConflictReasonMessage = string | Array;\n// Tuple defining a field node in a context.\ntype NodeAndDef = [\n Maybe,\n FieldNode,\n Maybe>,\n];\n// Map of array of those.\ntype NodeAndDefCollection = Map>;\ninterface FragmentSpread {\n key: string;\n node: FragmentSpreadNode;\n varMap: Map | undefined;\n}\ntype FragmentSpreads = ReadonlyArray;\ntype FieldsAndFragmentSpreads = readonly [\n NodeAndDefCollection,\n FragmentSpreads,\n];\n\n/**\n * Find all conflicts found \"within\" a selection set, including those found\n * via spreading in fragments. Called when visiting each SelectionSet in the\n * GraphQL Document.\n *\n * Algorithm:\n *\n * Conflicts occur when two fields exist in a query which will produce the same\n * response name, but represent differing values, thus creating a conflict.\n * The algorithm below finds all conflicts via making a series of comparisons\n * between fields. In order to compare as few fields as possible, this makes\n * a series of comparisons \"within\" sets of fields and \"between\" sets of fields.\n *\n * Given any selection set, a collection produces both a set of fields by\n * also including all inline fragments, as well as a list of fragments\n * referenced by fragment spreads.\n *\n * A) Each selection set represented in the document first compares \"within\" its\n * collected set of fields, finding any conflicts between every pair of\n * overlapping fields.\n * Note: This is the *only time* that the fields \"within\" a set are compared\n * to each other. After this only fields \"between\" sets are compared.\n *\n * B) Also, if any fragment is referenced in a selection set, then a\n * comparison is made \"between\" the original set of fields and the\n * referenced fragment.\n *\n * C) Also, if multiple fragments are referenced, then comparisons\n * are made \"between\" each referenced fragment.\n *\n * D) When comparing \"between\" a set of fields and a referenced fragment, first\n * a comparison is made between each field in the original set of fields and\n * each field in the referenced set of fields.\n *\n * E) Also, if any fragment is referenced in the referenced selection set,\n * then a comparison is made \"between\" the original set of fields and the\n * referenced fragment (recursively referring to step D).\n *\n * F) When comparing \"between\" two fragments, first a comparison is made between\n * each field in the first referenced set of fields and each field in the\n * second referenced set of fields.\n *\n * G) Also, any fragments referenced by the first must be compared to the\n * second, and any fragments referenced by the second must be compared to the\n * first (recursively referring to step F).\n *\n * H) When comparing two fields, if both have selection sets, then a comparison\n * is made \"between\" both selection sets, first comparing the set of fields in\n * the first selection set with the set of fields in the second.\n *\n * I) Also, if any fragment is referenced in either selection set, then a\n * comparison is made \"between\" the other set of fields and the\n * referenced fragment.\n *\n * J) Also, if two fragments are referenced in both selection sets, then a\n * comparison is made \"between\" the two fragments.\n *\n * @internal\n */\nfunction findConflictsWithinSelectionSet(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n parentType: Maybe,\n selectionSet: SelectionSetNode,\n): Array {\n const conflicts: Array = [];\n\n const [fieldMap, fragmentSpreads] = getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n parentType,\n selectionSet,\n undefined,\n );\n\n // (A) Find find all conflicts \"within\" the fields and f of this selection set.\n // Note: this is the *only place* `collectConflictsWithin` is called.\n collectConflictsWithin(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n fieldMap,\n );\n\n if (fragmentSpreads.length !== 0) {\n // (B) Then collect conflicts between these fields and those represented by\n // each spread found.\n for (let i = 0; i < fragmentSpreads.length; i++) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fieldMap,\n fragmentSpreads[i],\n );\n // (C) Then compare this fragment with all other fragments found in this\n // selection set to collect conflicts between fragments spread together.\n // This compares each item in the list of fragment spreads to every other\n // item in that same list (except for itself).\n for (let j = i + 1; j < fragmentSpreads.length; j++) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fragmentSpreads[i],\n fragmentSpreads[j],\n );\n }\n }\n }\n return conflicts;\n}\n\n// Collect all conflicts found between a set of fields and a fragment reference\n// including via spreading in any nested fragments.\nfunction collectConflictsBetweenFieldsAndFragment(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n areMutuallyExclusive: boolean,\n fieldMap: NodeAndDefCollection,\n fragmentSpread: FragmentSpread,\n): void {\n // Memoize so the fields and fragments are not compared for conflicts more\n // than once.\n if (\n comparedFieldsAndFragmentPairs.has(\n fieldMap,\n fragmentSpread.key,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n comparedFieldsAndFragmentPairs.add(\n fieldMap,\n fragmentSpread.key,\n areMutuallyExclusive,\n );\n\n const fragment = context.getFragment(fragmentSpread.node.name.value);\n if (!fragment) {\n return;\n }\n\n const [fieldMap2, referencedFragmentSpreads] =\n getReferencedFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragment,\n fragmentSpread.varMap,\n );\n\n // Do not compare a fragment's fieldMap to itself.\n if (fieldMap === fieldMap2) {\n return;\n }\n\n // (D) First collect any conflicts between the provided collection of fields\n // and the collection of fields represented by the given fragment.\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n undefined,\n fieldMap2,\n fragmentSpread.varMap,\n );\n\n // (E) Then collect any conflicts between the provided collection of fields\n // and any fragment names found in the given fragment.\n for (const referencedFragmentSpread of referencedFragmentSpreads) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n referencedFragmentSpread,\n );\n }\n}\n\n// Collect all conflicts found between two fragments, including via spreading in\n// any nested fragments.\nfunction collectConflictsBetweenFragments(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n areMutuallyExclusive: boolean,\n fragmentSpread1: FragmentSpread,\n fragmentSpread2: FragmentSpread,\n): void {\n // No need to compare a fragment to itself.\n if (fragmentSpread1.key === fragmentSpread2.key) {\n return;\n }\n\n if (fragmentSpread1.node.name.value === fragmentSpread2.node.name.value) {\n if (\n !sameArguments(\n fragmentSpread1.node.arguments,\n fragmentSpread1.varMap,\n fragmentSpread2.node.arguments,\n fragmentSpread2.varMap,\n )\n ) {\n context.reportError(\n new GraphQLError(\n `Spreads \"${fragmentSpread1.node.name.value}\" conflict because ${fragmentSpread1.key} and ${fragmentSpread2.key} have different fragment arguments.`,\n { nodes: [fragmentSpread1.node, fragmentSpread2.node] },\n ),\n );\n return;\n }\n }\n\n // Memoize so two fragments are not compared for conflicts more than once.\n if (\n comparedFragmentPairs.has(\n fragmentSpread1.key,\n fragmentSpread2.key,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n comparedFragmentPairs.add(\n fragmentSpread1.key,\n fragmentSpread2.key,\n areMutuallyExclusive,\n );\n\n const fragment1 = context.getFragment(fragmentSpread1.node.name.value);\n const fragment2 = context.getFragment(fragmentSpread2.node.name.value);\n if (!fragment1 || !fragment2) {\n return;\n }\n\n const [fieldMap1, referencedFragmentSpreads1] =\n getReferencedFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragment1,\n fragmentSpread1.varMap,\n );\n const [fieldMap2, referencedFragmentSpreads2] =\n getReferencedFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragment2,\n fragmentSpread2.varMap,\n );\n\n // (F) First, collect all conflicts between these two collections of fields\n // (not including any nested fragments).\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fragmentSpread1.varMap,\n fieldMap2,\n fragmentSpread2.varMap,\n );\n\n // (G) Then collect conflicts between the first fragment and any nested\n // fragments spread in the second fragment.\n for (const referencedFragmentSpread2 of referencedFragmentSpreads2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentSpread1,\n referencedFragmentSpread2,\n );\n }\n\n // (G) Then collect conflicts between the second fragment and any nested\n // fragments spread in the first fragment.\n for (const referencedFragmentSpread1 of referencedFragmentSpreads1) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n referencedFragmentSpread1,\n fragmentSpread2,\n );\n }\n}\n\n// Find all conflicts found between two selection sets, including those found\n// via spreading in fragments. Called when determining if conflicts exist\n// between the sub-fields of two overlapping fields.\nfunction findConflictsBetweenSubSelectionSets(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n areMutuallyExclusive: boolean,\n parentType1: Maybe,\n selectionSet1: SelectionSetNode,\n varMap1: Map | undefined,\n parentType2: Maybe,\n selectionSet2: SelectionSetNode,\n varMap2: Map | undefined,\n): Array {\n const conflicts: Array = [];\n\n const [fieldMap1, fragmentSpreads1] = getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n parentType1,\n selectionSet1,\n varMap1,\n );\n const [fieldMap2, fragmentSpreads2] = getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n parentType2,\n selectionSet2,\n varMap2,\n );\n\n // (H) First, collect all conflicts between these two collections of field.\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n varMap1,\n fieldMap2,\n varMap2,\n );\n\n // (I) Then collect conflicts between the first collection of fields and\n // those referenced by each fragment name associated with the second.\n for (const fragmentSpread2 of fragmentSpreads2) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fragmentSpread2,\n );\n }\n\n // (I) Then collect conflicts between the second collection of fields and\n // those referenced by each fragment name associated with the first.\n for (const fragmentSpread1 of fragmentSpreads1) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap2,\n fragmentSpread1,\n );\n }\n\n // (J) Also collect conflicts between any fragment spreads by the first and\n // fragment spreads by the second. This compares each item in the first set of\n // spreads to each item in the second set of spreads.\n for (const fragmentSpread1 of fragmentSpreads1) {\n for (const fragmentSpread2 of fragmentSpreads2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentSpread1,\n fragmentSpread2,\n );\n }\n }\n return conflicts;\n}\n\n// Collect all Conflicts \"within\" one collection of fields.\nfunction collectConflictsWithin(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n fieldMap: NodeAndDefCollection,\n): void {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For every response name, if there are multiple fields, they\n // must be compared to find a potential conflict.\n for (const [responseName, fields] of fieldMap.entries()) {\n // This compares every field in the list to every other field in this list\n // (except to itself). If the list only has one item, nothing needs to\n // be compared.\n if (fields.length > 1) {\n for (let i = 0; i < fields.length; i++) {\n for (let j = i + 1; j < fields.length; j++) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false, // within one collection is never mutually exclusive\n responseName,\n fields[i],\n undefined,\n fields[j],\n undefined,\n );\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n}\n\n// Collect all Conflicts between two collections of fields. This is similar to,\n// but different from the `collectConflictsWithin` function above. This check\n// assumes that `collectConflictsWithin` has already been called on each\n// provided collection of fields. This is true because this validator traverses\n// each individual selection set.\nfunction collectConflictsBetween(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n parentFieldsAreMutuallyExclusive: boolean,\n fieldMap1: NodeAndDefCollection,\n varMap1: Map | undefined,\n fieldMap2: NodeAndDefCollection,\n varMap2: Map | undefined,\n): void {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For any response name which appears in both provided field\n // maps, each field from the first field map must be compared to every field\n // in the second field map to find potential conflicts.\n for (const [responseName, fields1] of fieldMap1.entries()) {\n const fields2 = fieldMap2.get(responseName);\n if (fields2 != null) {\n for (const field1 of fields1) {\n for (const field2 of fields2) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n responseName,\n field1,\n varMap1,\n field2,\n varMap2,\n );\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n}\n\n// Determines if there is a conflict between two particular fields, including\n// comparing their sub-fields.\nfunction findConflict(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n parentFieldsAreMutuallyExclusive: boolean,\n responseName: string,\n field1: NodeAndDef,\n varMap1: Map | undefined,\n field2: NodeAndDef,\n varMap2: Map | undefined,\n): Maybe {\n const [parentType1, node1, def1] = field1;\n const [parentType2, node2, def2] = field2;\n\n // If it is known that two fields could not possibly apply at the same\n // time, due to the parent types, then it is safe to permit them to diverge\n // in aliased field or arguments used as they will not present any ambiguity\n // by differing.\n // It is known that two parent types could never overlap if they are\n // different Object types. Interface or Union types might overlap - if not\n // in the current state of the schema, then perhaps in some future version,\n // thus may not safely diverge.\n const areMutuallyExclusive =\n parentFieldsAreMutuallyExclusive ||\n (parentType1 !== parentType2 &&\n isObjectType(parentType1) &&\n isObjectType(parentType2));\n\n if (!areMutuallyExclusive) {\n // Two aliases must refer to the same field.\n const name1 = node1.name.value;\n const name2 = node2.name.value;\n if (name1 !== name2) {\n return [\n [responseName, `\"${name1}\" and \"${name2}\" are different fields`],\n [node1],\n [node2],\n ];\n }\n\n // Two field calls must have the same arguments.\n if (!sameArguments(node1.arguments, varMap1, node2.arguments, varMap2)) {\n return [\n [responseName, 'they have differing arguments'],\n [node1],\n [node2],\n ];\n }\n }\n\n const directives1 = node1.directives;\n const directives2 = node2.directives;\n const overlappingStreamReason = hasNoOverlappingStreams(\n directives1,\n varMap1,\n directives2,\n varMap2,\n );\n if (overlappingStreamReason !== undefined) {\n return [[responseName, overlappingStreamReason], [node1], [node2]];\n }\n\n // The return type for each field.\n const type1 = def1?.type;\n const type2 = def2?.type;\n\n if (type1 && type2 && doTypesConflict(type1, type2)) {\n return [\n [\n responseName,\n `they return conflicting types \"${inspect(type1)}\" and \"${inspect(\n type2,\n )}\"`,\n ],\n [node1],\n [node2],\n ];\n }\n\n // Collect and compare sub-fields. Use the same \"visited fragment spreads\" list\n // for both collections so fields in a fragment reference are never\n // compared to themselves.\n const selectionSet1 = node1.selectionSet;\n const selectionSet2 = node2.selectionSet;\n if (selectionSet1 && selectionSet2) {\n const conflicts = findConflictsBetweenSubSelectionSets(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n getNamedType(type1),\n selectionSet1,\n varMap1,\n getNamedType(type2),\n selectionSet2,\n varMap2,\n );\n return subfieldConflicts(conflicts, responseName, node1, node2);\n }\n}\n\nfunction sameArguments(\n args1: ReadonlyArray | undefined,\n varMap1: Map | undefined,\n args2: ReadonlyArray | undefined,\n varMap2: Map | undefined,\n): boolean {\n if (args1 === undefined || args1.length === 0) {\n return args2 === undefined || args2.length === 0;\n }\n if (args2 === undefined || args2.length === 0) {\n return false;\n }\n\n if (args1.length !== args2.length) {\n return false;\n }\n\n const values2 = new Map(\n args2.map(({ name, value }) => [\n name.value,\n varMap2 === undefined ? value : replaceFragmentVariables(value, varMap2),\n ]),\n );\n return args1.every((arg1) => {\n let value1 = arg1.value;\n if (varMap1) {\n value1 = replaceFragmentVariables(value1, varMap1);\n }\n const value2 = values2.get(arg1.name.value);\n if (value2 === undefined) {\n return false;\n }\n\n return stringifyValue(value1) === stringifyValue(value2);\n });\n}\n\nfunction replaceFragmentVariables(\n valueNode: ValueNode,\n varMap: ReadonlyMap,\n): ValueNode {\n switch (valueNode.kind) {\n case Kind.VARIABLE:\n return varMap.get(valueNode.name.value) ?? valueNode;\n case Kind.LIST:\n return {\n ...valueNode,\n values: valueNode.values.map((node) =>\n replaceFragmentVariables(node, varMap),\n ),\n };\n case Kind.OBJECT:\n return {\n ...valueNode,\n fields: valueNode.fields.map((field) => ({\n ...field,\n value: replaceFragmentVariables(field.value, varMap),\n })),\n };\n default: {\n return valueNode;\n }\n }\n}\n\nfunction stringifyValue(value: ValueNode): string | null {\n return print(sortValueNode(value));\n}\n\nfunction getStreamDirective(\n directives: ReadonlyArray | undefined,\n): DirectiveNode | undefined {\n return directives?.find((directive) => directive.name.value === 'stream');\n}\n\nfunction hasNoOverlappingStreams(\n directives1: ReadonlyArray | undefined,\n varMap1: Map | undefined,\n directives2: ReadonlyArray | undefined,\n varMap2: Map | undefined,\n): string | undefined {\n const stream1 = getStreamDirective(directives1);\n const stream2 = getStreamDirective(directives2);\n if (!stream1 && !stream2) {\n // both fields do not have streams\n return;\n } else if (stream1 && stream2) {\n // check if both fields have equivalent streams\n if (sameArguments(stream1.arguments, varMap1, stream2.arguments, varMap2)) {\n // This was allowed in previous alpha versions of `graphql-js`.\n return 'they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100';\n }\n return 'they have overlapping stream directives';\n }\n // fields have a mix of stream and no stream\n return 'they have overlapping stream directives';\n}\n\n// Two types conflict if both types could not apply to a value simultaneously.\n// Composite types are ignored as their individual field types will be compared\n// later recursively. However List and Non-Null types must match.\nfunction doTypesConflict(\n type1: GraphQLOutputType,\n type2: GraphQLOutputType,\n): boolean {\n if (isListType(type1)) {\n return isListType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n if (isListType(type2)) {\n return true;\n }\n if (isNonNullType(type1)) {\n return isNonNullType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n if (isNonNullType(type2)) {\n return true;\n }\n if (isLeafType(type1) || isLeafType(type2)) {\n return type1 !== type2;\n }\n return false;\n}\n\n// Given a selection set, return the collection of fields (a mapping of response\n// name to field nodes and definitions) as well as a list of fragment spreads\n// referenced via fragment spreads.\nfunction getFieldsAndFragmentSpreads(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n parentType: Maybe,\n selectionSet: SelectionSetNode,\n varMap: Map | undefined,\n): FieldsAndFragmentSpreads {\n const cached = cachedFieldsAndFragmentSpreads.get(selectionSet);\n if (cached) {\n return cached;\n }\n const nodeAndDefs: NodeAndDefCollection = new Map();\n const fragmentSpreads = new Map();\n _collectFieldsAndFragmentSpreads(\n context,\n parentType,\n selectionSet,\n nodeAndDefs,\n fragmentSpreads,\n varMap,\n );\n const result: FieldsAndFragmentSpreads = [\n nodeAndDefs,\n Array.from(fragmentSpreads.values()),\n ];\n cachedFieldsAndFragmentSpreads.set(selectionSet, result);\n return result;\n}\n\n// Given a reference to a fragment, return the represented collection of fields\n// as well as a list of nested fragment spreads referenced via fragment spreads.\nfunction getReferencedFieldsAndFragmentSpreads(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n fragment: FragmentDefinitionNode,\n varMap: Map | undefined,\n) {\n // Short-circuit building a type from the node if possible.\n const cached = cachedFieldsAndFragmentSpreads.get(fragment.selectionSet);\n if (cached) {\n return cached;\n }\n\n const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition);\n return getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragmentType,\n fragment.selectionSet,\n varMap,\n );\n}\n\nfunction _collectFieldsAndFragmentSpreads(\n context: ValidationContext,\n parentType: Maybe,\n selectionSet: SelectionSetNode,\n nodeAndDefs: NodeAndDefCollection,\n fragmentSpreads: Map,\n varMap: Map | undefined,\n): void {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n const fieldName = selection.name.value;\n let fieldDef;\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n fieldDef = parentType.getFields()[fieldName];\n }\n const responseName = selection.alias\n ? selection.alias.value\n : fieldName;\n\n let nodeAndDefsList = nodeAndDefs.get(responseName);\n if (nodeAndDefsList == null) {\n nodeAndDefsList = [];\n nodeAndDefs.set(responseName, nodeAndDefsList);\n }\n nodeAndDefsList.push([parentType, selection, fieldDef]);\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragmentSpread = getFragmentSpread(context, selection, varMap);\n fragmentSpreads.set(fragmentSpread.key, fragmentSpread);\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n const typeCondition = selection.typeCondition;\n const inlineFragmentType = typeCondition\n ? typeFromAST(context.getSchema(), typeCondition)\n : parentType;\n _collectFieldsAndFragmentSpreads(\n context,\n inlineFragmentType,\n selection.selectionSet,\n nodeAndDefs,\n fragmentSpreads,\n varMap,\n );\n break;\n }\n }\n }\n}\n\nfunction getFragmentSpread(\n context: ValidationContext,\n fragmentSpreadNode: FragmentSpreadNode,\n varMap: Map | undefined,\n): FragmentSpread {\n let key = '';\n const newVarMap = new Map();\n const fragmentSignature = context.getFragmentSignatureByName()(\n fragmentSpreadNode.name.value,\n );\n const argMap = new Map();\n if (fragmentSpreadNode.arguments) {\n for (const arg of fragmentSpreadNode.arguments) {\n argMap.set(arg.name.value, arg.value);\n }\n }\n if (fragmentSignature?.variableDefinitions) {\n key += fragmentSpreadNode.name.value + '(';\n for (const [varName, variable] of fragmentSignature.variableDefinitions) {\n const value = argMap.get(varName);\n if (value) {\n key += varName + ': ' + print(sortValueNode(value));\n }\n const arg = argMap.get(varName);\n if (arg !== undefined) {\n newVarMap.set(\n varName,\n varMap !== undefined ? replaceFragmentVariables(arg, varMap) : arg,\n );\n } else if (variable.defaultValue) {\n newVarMap.set(varName, variable.defaultValue);\n }\n }\n key += ')';\n }\n return {\n key,\n node: fragmentSpreadNode,\n varMap: newVarMap.size > 0 ? newVarMap : undefined,\n };\n}\n\n// Given a series of Conflicts which occurred between two sub-fields, generate\n// a single Conflict.\nfunction subfieldConflicts(\n conflicts: ReadonlyArray,\n responseName: string,\n node1: FieldNode,\n node2: FieldNode,\n): Maybe {\n if (conflicts.length > 0) {\n return [\n [responseName, conflicts.map(([reason]) => reason)],\n [node1, ...conflicts.map(([, fields1]) => fields1).flat()],\n [node2, ...conflicts.map(([, , fields2]) => fields2).flat()],\n ];\n }\n}\n\n/**\n * A way to keep track of pairs of things where the ordering of the pair\n * matters.\n *\n * Provides a third argument for has/set to allow flagging the pair as\n * weakly or strongly present within the collection.\n *\n * @internal\n */\nclass OrderedPairSet {\n _data: Map>;\n\n constructor() {\n this._data = new Map();\n }\n\n has(a: T, b: U, weaklyPresent: boolean): boolean {\n const result = this._data.get(a)?.get(b);\n if (result === undefined) {\n return false;\n }\n\n return weaklyPresent ? true : weaklyPresent === result;\n }\n\n add(a: T, b: U, weaklyPresent: boolean): void {\n const map = this._data.get(a);\n if (map === undefined) {\n this._data.set(a, new Map([[b, weaklyPresent]]));\n } else {\n map.set(b, weaklyPresent);\n }\n }\n}\n\n/**\n * A way to keep track of pairs of similar things when the ordering of the pair\n * does not matter.\n *\n * @internal\n */\nclass PairSet {\n _orderedPairSet: OrderedPairSet;\n\n constructor() {\n this._orderedPairSet = new OrderedPairSet();\n }\n\n has(a: T, b: T, weaklyPresent: boolean): boolean {\n return a < b\n ? this._orderedPairSet.has(a, b, weaklyPresent)\n : this._orderedPairSet.has(b, a, weaklyPresent);\n }\n\n add(a: T, b: T, weaklyPresent: boolean): void {\n if (a < b) {\n this._orderedPairSet.add(a, b, weaklyPresent);\n } else {\n this._orderedPairSet.add(b, a, weaklyPresent);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs new file mode 100644 index 00000000..c1f92596 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs @@ -0,0 +1,419 @@ +import { inspect } from "../../jsutils/inspect.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { print } from "../../language/printer.mjs"; +import { getNamedType, isInterfaceType, isLeafType, isListType, isNonNullType, isObjectType, } from "../../type/definition.mjs"; +import { sortValueNode } from "../../utilities/sortValueNode.mjs"; +import { typeFromAST } from "../../utilities/typeFromAST.mjs"; +function reasonMessage(reason) { + if (Array.isArray(reason)) { + return reason + .map(([responseName, subReason]) => `subfields "${responseName}" conflict because ` + + reasonMessage(subReason)) + .join(' and '); + } + return reason; +} +export function OverlappingFieldsCanBeMergedRule(context) { + const comparedFieldsAndFragmentPairs = new OrderedPairSet(); + const comparedFragmentPairs = new PairSet(); + const cachedFieldsAndFragmentSpreads = new Map(); + return { + SelectionSet(selectionSet) { + const conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, context.getParentType(), selectionSet); + for (const [[responseName, reason], fields1, fields2] of conflicts) { + const reasonMsg = reasonMessage(reason); + context.reportError(new GraphQLError(`Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, { nodes: fields1.concat(fields2) })); + } + }, + }; +} +function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentType, selectionSet) { + const conflicts = []; + const [fieldMap, fragmentSpreads] = getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType, selectionSet, undefined); + collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, fieldMap); + if (fragmentSpreads.length !== 0) { + for (let i = 0; i < fragmentSpreads.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, false, fieldMap, fragmentSpreads[i]); + for (let j = i + 1; j < fragmentSpreads.length; j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, false, fragmentSpreads[i], fragmentSpreads[j]); + } + } + } + return conflicts; +} +function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentSpread) { + if (comparedFieldsAndFragmentPairs.has(fieldMap, fragmentSpread.key, areMutuallyExclusive)) { + return; + } + comparedFieldsAndFragmentPairs.add(fieldMap, fragmentSpread.key, areMutuallyExclusive); + const fragment = context.getFragment(fragmentSpread.node.name.value); + if (!fragment) { + return; + } + const [fieldMap2, referencedFragmentSpreads] = getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment, fragmentSpread.varMap); + if (fieldMap === fieldMap2) { + return; + } + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap, undefined, fieldMap2, fragmentSpread.varMap); + for (const referencedFragmentSpread of referencedFragmentSpreads) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap, referencedFragmentSpread); + } +} +function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fragmentSpread1, fragmentSpread2) { + if (fragmentSpread1.key === fragmentSpread2.key) { + return; + } + if (fragmentSpread1.node.name.value === fragmentSpread2.node.name.value) { + if (!sameArguments(fragmentSpread1.node.arguments, fragmentSpread1.varMap, fragmentSpread2.node.arguments, fragmentSpread2.varMap)) { + context.reportError(new GraphQLError(`Spreads "${fragmentSpread1.node.name.value}" conflict because ${fragmentSpread1.key} and ${fragmentSpread2.key} have different fragment arguments.`, { nodes: [fragmentSpread1.node, fragmentSpread2.node] })); + return; + } + } + if (comparedFragmentPairs.has(fragmentSpread1.key, fragmentSpread2.key, areMutuallyExclusive)) { + return; + } + comparedFragmentPairs.add(fragmentSpread1.key, fragmentSpread2.key, areMutuallyExclusive); + const fragment1 = context.getFragment(fragmentSpread1.node.name.value); + const fragment2 = context.getFragment(fragmentSpread2.node.name.value); + if (!fragment1 || !fragment2) { + return; + } + const [fieldMap1, referencedFragmentSpreads1] = getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment1, fragmentSpread1.varMap); + const [fieldMap2, referencedFragmentSpreads2] = getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment2, fragmentSpread2.varMap); + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentSpread1.varMap, fieldMap2, fragmentSpread2.varMap); + for (const referencedFragmentSpread2 of referencedFragmentSpreads2) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fragmentSpread1, referencedFragmentSpread2); + } + for (const referencedFragmentSpread1 of referencedFragmentSpreads1) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, referencedFragmentSpread1, fragmentSpread2); + } +} +function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, varMap1, parentType2, selectionSet2, varMap2) { + const conflicts = []; + const [fieldMap1, fragmentSpreads1] = getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType1, selectionSet1, varMap1); + const [fieldMap2, fragmentSpreads2] = getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType2, selectionSet2, varMap2); + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, varMap1, fieldMap2, varMap2); + for (const fragmentSpread2 of fragmentSpreads2) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentSpread2); + } + for (const fragmentSpread1 of fragmentSpreads1) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentSpread1); + } + for (const fragmentSpread1 of fragmentSpreads1) { + for (const fragmentSpread2 of fragmentSpreads2) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fragmentSpread1, fragmentSpread2); + } + } + return conflicts; +} +function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, fieldMap) { + for (const [responseName, fields] of fieldMap.entries()) { + if (fields.length > 1) { + for (let i = 0; i < fields.length; i++) { + for (let j = i + 1; j < fields.length; j++) { + const conflict = findConflict(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, false, responseName, fields[i], undefined, fields[j], undefined); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} +function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, varMap1, fieldMap2, varMap2) { + for (const [responseName, fields1] of fieldMap1.entries()) { + const fields2 = fieldMap2.get(responseName); + if (fields2 != null) { + for (const field1 of fields1) { + for (const field2 of fields2) { + const conflict = findConflict(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, varMap1, field2, varMap2); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} +function findConflict(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, varMap1, field2, varMap2) { + const [parentType1, node1, def1] = field1; + const [parentType2, node2, def2] = field2; + const areMutuallyExclusive = parentFieldsAreMutuallyExclusive || + (parentType1 !== parentType2 && + isObjectType(parentType1) && + isObjectType(parentType2)); + if (!areMutuallyExclusive) { + const name1 = node1.name.value; + const name2 = node2.name.value; + if (name1 !== name2) { + return [ + [responseName, `"${name1}" and "${name2}" are different fields`], + [node1], + [node2], + ]; + } + if (!sameArguments(node1.arguments, varMap1, node2.arguments, varMap2)) { + return [ + [responseName, 'they have differing arguments'], + [node1], + [node2], + ]; + } + } + const directives1 = node1.directives; + const directives2 = node2.directives; + const overlappingStreamReason = hasNoOverlappingStreams(directives1, varMap1, directives2, varMap2); + if (overlappingStreamReason !== undefined) { + return [[responseName, overlappingStreamReason], [node1], [node2]]; + } + const type1 = def1?.type; + const type2 = def2?.type; + if (type1 && type2 && doTypesConflict(type1, type2)) { + return [ + [ + responseName, + `they return conflicting types "${inspect(type1)}" and "${inspect(type2)}"`, + ], + [node1], + [node2], + ]; + } + const selectionSet1 = node1.selectionSet; + const selectionSet2 = node2.selectionSet; + if (selectionSet1 && selectionSet2) { + const conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentSpreads, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, getNamedType(type1), selectionSet1, varMap1, getNamedType(type2), selectionSet2, varMap2); + return subfieldConflicts(conflicts, responseName, node1, node2); + } +} +function sameArguments(args1, varMap1, args2, varMap2) { + if (args1 === undefined || args1.length === 0) { + return args2 === undefined || args2.length === 0; + } + if (args2 === undefined || args2.length === 0) { + return false; + } + if (args1.length !== args2.length) { + return false; + } + const values2 = new Map(args2.map(({ name, value }) => [ + name.value, + varMap2 === undefined ? value : replaceFragmentVariables(value, varMap2), + ])); + return args1.every((arg1) => { + let value1 = arg1.value; + if (varMap1) { + value1 = replaceFragmentVariables(value1, varMap1); + } + const value2 = values2.get(arg1.name.value); + if (value2 === undefined) { + return false; + } + return stringifyValue(value1) === stringifyValue(value2); + }); +} +function replaceFragmentVariables(valueNode, varMap) { + switch (valueNode.kind) { + case Kind.VARIABLE: + return varMap.get(valueNode.name.value) ?? valueNode; + case Kind.LIST: + return { + ...valueNode, + values: valueNode.values.map((node) => replaceFragmentVariables(node, varMap)), + }; + case Kind.OBJECT: + return { + ...valueNode, + fields: valueNode.fields.map((field) => ({ + ...field, + value: replaceFragmentVariables(field.value, varMap), + })), + }; + default: { + return valueNode; + } + } +} +function stringifyValue(value) { + return print(sortValueNode(value)); +} +function getStreamDirective(directives) { + return directives?.find((directive) => directive.name.value === 'stream'); +} +function hasNoOverlappingStreams(directives1, varMap1, directives2, varMap2) { + const stream1 = getStreamDirective(directives1); + const stream2 = getStreamDirective(directives2); + if (!stream1 && !stream2) { + return; + } + else if (stream1 && stream2) { + if (sameArguments(stream1.arguments, varMap1, stream2.arguments, varMap2)) { + return 'they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100'; + } + return 'they have overlapping stream directives'; + } + return 'they have overlapping stream directives'; +} +function doTypesConflict(type1, type2) { + if (isListType(type1)) { + return isListType(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if (isListType(type2)) { + return true; + } + if (isNonNullType(type1)) { + return isNonNullType(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if (isNonNullType(type2)) { + return true; + } + if (isLeafType(type1) || isLeafType(type2)) { + return type1 !== type2; + } + return false; +} +function getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, parentType, selectionSet, varMap) { + const cached = cachedFieldsAndFragmentSpreads.get(selectionSet); + if (cached) { + return cached; + } + const nodeAndDefs = new Map(); + const fragmentSpreads = new Map(); + _collectFieldsAndFragmentSpreads(context, parentType, selectionSet, nodeAndDefs, fragmentSpreads, varMap); + const result = [ + nodeAndDefs, + Array.from(fragmentSpreads.values()), + ]; + cachedFieldsAndFragmentSpreads.set(selectionSet, result); + return result; +} +function getReferencedFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragment, varMap) { + const cached = cachedFieldsAndFragmentSpreads.get(fragment.selectionSet); + if (cached) { + return cached; + } + const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition); + return getFieldsAndFragmentSpreads(context, cachedFieldsAndFragmentSpreads, fragmentType, fragment.selectionSet, varMap); +} +function _collectFieldsAndFragmentSpreads(context, parentType, selectionSet, nodeAndDefs, fragmentSpreads, varMap) { + for (const selection of selectionSet.selections) { + switch (selection.kind) { + case Kind.FIELD: { + const fieldName = selection.name.value; + let fieldDef; + if (isObjectType(parentType) || isInterfaceType(parentType)) { + fieldDef = parentType.getFields()[fieldName]; + } + const responseName = selection.alias + ? selection.alias.value + : fieldName; + let nodeAndDefsList = nodeAndDefs.get(responseName); + if (nodeAndDefsList == null) { + nodeAndDefsList = []; + nodeAndDefs.set(responseName, nodeAndDefsList); + } + nodeAndDefsList.push([parentType, selection, fieldDef]); + break; + } + case Kind.FRAGMENT_SPREAD: { + const fragmentSpread = getFragmentSpread(context, selection, varMap); + fragmentSpreads.set(fragmentSpread.key, fragmentSpread); + break; + } + case Kind.INLINE_FRAGMENT: { + const typeCondition = selection.typeCondition; + const inlineFragmentType = typeCondition + ? typeFromAST(context.getSchema(), typeCondition) + : parentType; + _collectFieldsAndFragmentSpreads(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentSpreads, varMap); + break; + } + } + } +} +function getFragmentSpread(context, fragmentSpreadNode, varMap) { + let key = ''; + const newVarMap = new Map(); + const fragmentSignature = context.getFragmentSignatureByName()(fragmentSpreadNode.name.value); + const argMap = new Map(); + if (fragmentSpreadNode.arguments) { + for (const arg of fragmentSpreadNode.arguments) { + argMap.set(arg.name.value, arg.value); + } + } + if (fragmentSignature?.variableDefinitions) { + key += fragmentSpreadNode.name.value + '('; + for (const [varName, variable] of fragmentSignature.variableDefinitions) { + const value = argMap.get(varName); + if (value) { + key += varName + ': ' + print(sortValueNode(value)); + } + const arg = argMap.get(varName); + if (arg !== undefined) { + newVarMap.set(varName, varMap !== undefined ? replaceFragmentVariables(arg, varMap) : arg); + } + else if (variable.defaultValue) { + newVarMap.set(varName, variable.defaultValue); + } + } + key += ')'; + } + return { + key, + node: fragmentSpreadNode, + varMap: newVarMap.size > 0 ? newVarMap : undefined, + }; +} +function subfieldConflicts(conflicts, responseName, node1, node2) { + if (conflicts.length > 0) { + return [ + [responseName, conflicts.map(([reason]) => reason)], + [node1, ...conflicts.map(([, fields1]) => fields1).flat()], + [node2, ...conflicts.map(([, , fields2]) => fields2).flat()], + ]; + } +} +class OrderedPairSet { + constructor() { + this._data = new Map(); + } + has(a, b, weaklyPresent) { + const result = this._data.get(a)?.get(b); + if (result === undefined) { + return false; + } + return weaklyPresent ? true : weaklyPresent === result; + } + add(a, b, weaklyPresent) { + const map = this._data.get(a); + if (map === undefined) { + this._data.set(a, new Map([[b, weaklyPresent]])); + } + else { + map.set(b, weaklyPresent); + } + } +} +class PairSet { + constructor() { + this._orderedPairSet = new OrderedPairSet(); + } + has(a, b, weaklyPresent) { + return a < b + ? this._orderedPairSet.has(a, b, weaklyPresent) + : this._orderedPairSet.has(b, a, weaklyPresent); + } + add(a, b, weaklyPresent) { + if (a < b) { + this._orderedPairSet.add(a, b, weaklyPresent); + } + else { + this._orderedPairSet.add(b, a, weaklyPresent); + } + } +} +//# sourceMappingURL=OverlappingFieldsCanBeMergedRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map new file mode 100644 index 00000000..9ff49e28 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"OverlappingFieldsCanBeMergedRule.js","sourceRoot":"","sources":["../../../src/validation/rules/OverlappingFieldsCanBeMergedRule.ts"],"names":[],"mappings":"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AG,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF;AAQD,MAAM,OAAO;IAGX;QACE,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,EAAE,CAAC;IAC9C,CAAC;IAED,GAAG,CAAC,CAAI,EAAE,CAAI,EAAE,aAAsB;QACpC,OAAO,CAAC,GAAG,CAAC;YACV,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC;YAC/C,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;IACpD,CAAC;IAED,GAAG,CAAC,CAAI,EAAE,CAAI,EAAE,aAAsB;QACpC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACV,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n ArgumentNode,\n DirectiveNode,\n FieldNode,\n FragmentArgumentNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n SelectionSetNode,\n ValueNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type {\n GraphQLField,\n GraphQLNamedType,\n GraphQLOutputType,\n} from '../../type/definition.ts';\nimport {\n getNamedType,\n isInterfaceType,\n isLeafType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../../type/definition.ts';\n\nimport { sortValueNode } from '../../utilities/sortValueNode.ts';\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/* eslint-disable max-params */\n// This file contains a lot of such errors but we plan to refactor it anyway\n// so just disable it for entire file.\n\nfunction reasonMessage(reason: ConflictReasonMessage): string {\n if (Array.isArray(reason)) {\n return reason\n .map(\n ([responseName, subReason]) =>\n `subfields \"${responseName}\" conflict because ` +\n reasonMessage(subReason),\n )\n .join(' and ');\n }\n return reason;\n}\n\n/**\n * Overlapping fields can be merged\n *\n * A selection set is only valid if all fields (including spreading any\n * fragments) either correspond to distinct response names or can be merged\n * without ambiguity.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { OverlappingFieldsCanBeMergedRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * dog: Dog\n * }\n *\n * type Dog {\n * name: String\n * barkVolume: Int\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { dog { value: barkVolume value: name } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * OverlappingFieldsCanBeMergedRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { dog { barkVolume name } }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * OverlappingFieldsCanBeMergedRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function OverlappingFieldsCanBeMergedRule(\n context: ValidationContext,\n): ASTVisitor {\n // A memoization for when fields and a fragment or two fragments are compared\n // \"between\" each other for conflicts. Comparisons made be made many times,\n // so memoizing this can dramatically improve the performance of this validator.\n const comparedFieldsAndFragmentPairs = new OrderedPairSet<\n NodeAndDefCollection,\n string\n >();\n const comparedFragmentPairs = new PairSet();\n\n // A cache for the \"field map\" and list of fragment spreads found in any given\n // selection set. Selection sets may be asked for this information multiple\n // times, so this improves the performance of this validator.\n const cachedFieldsAndFragmentSpreads = new Map();\n\n return {\n SelectionSet(selectionSet) {\n const conflicts = findConflictsWithinSelectionSet(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n context.getParentType(),\n selectionSet,\n );\n for (const [[responseName, reason], fields1, fields2] of conflicts) {\n const reasonMsg = reasonMessage(reason);\n context.reportError(\n new GraphQLError(\n `Fields \"${responseName}\" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`,\n { nodes: fields1.concat(fields2) },\n ),\n );\n }\n },\n };\n}\n\ntype Conflict = [ConflictReason, Array, Array];\n// Field name and reason.\ntype ConflictReason = [string, ConflictReasonMessage];\n// Reason is a string, or a nested list of conflicts.\ntype ConflictReasonMessage = string | Array;\n// Tuple defining a field node in a context.\ntype NodeAndDef = [\n Maybe,\n FieldNode,\n Maybe>,\n];\n// Map of array of those.\ntype NodeAndDefCollection = Map>;\ninterface FragmentSpread {\n key: string;\n node: FragmentSpreadNode;\n varMap: Map | undefined;\n}\ntype FragmentSpreads = ReadonlyArray;\ntype FieldsAndFragmentSpreads = readonly [\n NodeAndDefCollection,\n FragmentSpreads,\n];\n\n/**\n * Find all conflicts found \"within\" a selection set, including those found\n * via spreading in fragments. Called when visiting each SelectionSet in the\n * GraphQL Document.\n *\n * Algorithm:\n *\n * Conflicts occur when two fields exist in a query which will produce the same\n * response name, but represent differing values, thus creating a conflict.\n * The algorithm below finds all conflicts via making a series of comparisons\n * between fields. In order to compare as few fields as possible, this makes\n * a series of comparisons \"within\" sets of fields and \"between\" sets of fields.\n *\n * Given any selection set, a collection produces both a set of fields by\n * also including all inline fragments, as well as a list of fragments\n * referenced by fragment spreads.\n *\n * A) Each selection set represented in the document first compares \"within\" its\n * collected set of fields, finding any conflicts between every pair of\n * overlapping fields.\n * Note: This is the *only time* that the fields \"within\" a set are compared\n * to each other. After this only fields \"between\" sets are compared.\n *\n * B) Also, if any fragment is referenced in a selection set, then a\n * comparison is made \"between\" the original set of fields and the\n * referenced fragment.\n *\n * C) Also, if multiple fragments are referenced, then comparisons\n * are made \"between\" each referenced fragment.\n *\n * D) When comparing \"between\" a set of fields and a referenced fragment, first\n * a comparison is made between each field in the original set of fields and\n * each field in the referenced set of fields.\n *\n * E) Also, if any fragment is referenced in the referenced selection set,\n * then a comparison is made \"between\" the original set of fields and the\n * referenced fragment (recursively referring to step D).\n *\n * F) When comparing \"between\" two fragments, first a comparison is made between\n * each field in the first referenced set of fields and each field in the\n * second referenced set of fields.\n *\n * G) Also, any fragments referenced by the first must be compared to the\n * second, and any fragments referenced by the second must be compared to the\n * first (recursively referring to step F).\n *\n * H) When comparing two fields, if both have selection sets, then a comparison\n * is made \"between\" both selection sets, first comparing the set of fields in\n * the first selection set with the set of fields in the second.\n *\n * I) Also, if any fragment is referenced in either selection set, then a\n * comparison is made \"between\" the other set of fields and the\n * referenced fragment.\n *\n * J) Also, if two fragments are referenced in both selection sets, then a\n * comparison is made \"between\" the two fragments.\n *\n * @internal\n */\nfunction findConflictsWithinSelectionSet(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n parentType: Maybe,\n selectionSet: SelectionSetNode,\n): Array {\n const conflicts: Array = [];\n\n const [fieldMap, fragmentSpreads] = getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n parentType,\n selectionSet,\n undefined,\n );\n\n // (A) Find find all conflicts \"within\" the fields and f of this selection set.\n // Note: this is the *only place* `collectConflictsWithin` is called.\n collectConflictsWithin(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n fieldMap,\n );\n\n if (fragmentSpreads.length !== 0) {\n // (B) Then collect conflicts between these fields and those represented by\n // each spread found.\n for (let i = 0; i < fragmentSpreads.length; i++) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fieldMap,\n fragmentSpreads[i],\n );\n // (C) Then compare this fragment with all other fragments found in this\n // selection set to collect conflicts between fragments spread together.\n // This compares each item in the list of fragment spreads to every other\n // item in that same list (except for itself).\n for (let j = i + 1; j < fragmentSpreads.length; j++) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fragmentSpreads[i],\n fragmentSpreads[j],\n );\n }\n }\n }\n return conflicts;\n}\n\n// Collect all conflicts found between a set of fields and a fragment reference\n// including via spreading in any nested fragments.\nfunction collectConflictsBetweenFieldsAndFragment(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n areMutuallyExclusive: boolean,\n fieldMap: NodeAndDefCollection,\n fragmentSpread: FragmentSpread,\n): void {\n // Memoize so the fields and fragments are not compared for conflicts more\n // than once.\n if (\n comparedFieldsAndFragmentPairs.has(\n fieldMap,\n fragmentSpread.key,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n comparedFieldsAndFragmentPairs.add(\n fieldMap,\n fragmentSpread.key,\n areMutuallyExclusive,\n );\n\n const fragment = context.getFragment(fragmentSpread.node.name.value);\n if (!fragment) {\n return;\n }\n\n const [fieldMap2, referencedFragmentSpreads] =\n getReferencedFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragment,\n fragmentSpread.varMap,\n );\n\n // Do not compare a fragment's fieldMap to itself.\n if (fieldMap === fieldMap2) {\n return;\n }\n\n // (D) First collect any conflicts between the provided collection of fields\n // and the collection of fields represented by the given fragment.\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n undefined,\n fieldMap2,\n fragmentSpread.varMap,\n );\n\n // (E) Then collect any conflicts between the provided collection of fields\n // and any fragment names found in the given fragment.\n for (const referencedFragmentSpread of referencedFragmentSpreads) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n referencedFragmentSpread,\n );\n }\n}\n\n// Collect all conflicts found between two fragments, including via spreading in\n// any nested fragments.\nfunction collectConflictsBetweenFragments(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n areMutuallyExclusive: boolean,\n fragmentSpread1: FragmentSpread,\n fragmentSpread2: FragmentSpread,\n): void {\n // No need to compare a fragment to itself.\n if (fragmentSpread1.key === fragmentSpread2.key) {\n return;\n }\n\n if (fragmentSpread1.node.name.value === fragmentSpread2.node.name.value) {\n if (\n !sameArguments(\n fragmentSpread1.node.arguments,\n fragmentSpread1.varMap,\n fragmentSpread2.node.arguments,\n fragmentSpread2.varMap,\n )\n ) {\n context.reportError(\n new GraphQLError(\n `Spreads \"${fragmentSpread1.node.name.value}\" conflict because ${fragmentSpread1.key} and ${fragmentSpread2.key} have different fragment arguments.`,\n { nodes: [fragmentSpread1.node, fragmentSpread2.node] },\n ),\n );\n return;\n }\n }\n\n // Memoize so two fragments are not compared for conflicts more than once.\n if (\n comparedFragmentPairs.has(\n fragmentSpread1.key,\n fragmentSpread2.key,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n comparedFragmentPairs.add(\n fragmentSpread1.key,\n fragmentSpread2.key,\n areMutuallyExclusive,\n );\n\n const fragment1 = context.getFragment(fragmentSpread1.node.name.value);\n const fragment2 = context.getFragment(fragmentSpread2.node.name.value);\n if (!fragment1 || !fragment2) {\n return;\n }\n\n const [fieldMap1, referencedFragmentSpreads1] =\n getReferencedFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragment1,\n fragmentSpread1.varMap,\n );\n const [fieldMap2, referencedFragmentSpreads2] =\n getReferencedFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragment2,\n fragmentSpread2.varMap,\n );\n\n // (F) First, collect all conflicts between these two collections of fields\n // (not including any nested fragments).\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fragmentSpread1.varMap,\n fieldMap2,\n fragmentSpread2.varMap,\n );\n\n // (G) Then collect conflicts between the first fragment and any nested\n // fragments spread in the second fragment.\n for (const referencedFragmentSpread2 of referencedFragmentSpreads2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentSpread1,\n referencedFragmentSpread2,\n );\n }\n\n // (G) Then collect conflicts between the second fragment and any nested\n // fragments spread in the first fragment.\n for (const referencedFragmentSpread1 of referencedFragmentSpreads1) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n referencedFragmentSpread1,\n fragmentSpread2,\n );\n }\n}\n\n// Find all conflicts found between two selection sets, including those found\n// via spreading in fragments. Called when determining if conflicts exist\n// between the sub-fields of two overlapping fields.\nfunction findConflictsBetweenSubSelectionSets(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n areMutuallyExclusive: boolean,\n parentType1: Maybe,\n selectionSet1: SelectionSetNode,\n varMap1: Map | undefined,\n parentType2: Maybe,\n selectionSet2: SelectionSetNode,\n varMap2: Map | undefined,\n): Array {\n const conflicts: Array = [];\n\n const [fieldMap1, fragmentSpreads1] = getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n parentType1,\n selectionSet1,\n varMap1,\n );\n const [fieldMap2, fragmentSpreads2] = getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n parentType2,\n selectionSet2,\n varMap2,\n );\n\n // (H) First, collect all conflicts between these two collections of field.\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n varMap1,\n fieldMap2,\n varMap2,\n );\n\n // (I) Then collect conflicts between the first collection of fields and\n // those referenced by each fragment name associated with the second.\n for (const fragmentSpread2 of fragmentSpreads2) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fragmentSpread2,\n );\n }\n\n // (I) Then collect conflicts between the second collection of fields and\n // those referenced by each fragment name associated with the first.\n for (const fragmentSpread1 of fragmentSpreads1) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap2,\n fragmentSpread1,\n );\n }\n\n // (J) Also collect conflicts between any fragment spreads by the first and\n // fragment spreads by the second. This compares each item in the first set of\n // spreads to each item in the second set of spreads.\n for (const fragmentSpread1 of fragmentSpreads1) {\n for (const fragmentSpread2 of fragmentSpreads2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentSpread1,\n fragmentSpread2,\n );\n }\n }\n return conflicts;\n}\n\n// Collect all Conflicts \"within\" one collection of fields.\nfunction collectConflictsWithin(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n fieldMap: NodeAndDefCollection,\n): void {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For every response name, if there are multiple fields, they\n // must be compared to find a potential conflict.\n for (const [responseName, fields] of fieldMap.entries()) {\n // This compares every field in the list to every other field in this list\n // (except to itself). If the list only has one item, nothing needs to\n // be compared.\n if (fields.length > 1) {\n for (let i = 0; i < fields.length; i++) {\n for (let j = i + 1; j < fields.length; j++) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false, // within one collection is never mutually exclusive\n responseName,\n fields[i],\n undefined,\n fields[j],\n undefined,\n );\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n}\n\n// Collect all Conflicts between two collections of fields. This is similar to,\n// but different from the `collectConflictsWithin` function above. This check\n// assumes that `collectConflictsWithin` has already been called on each\n// provided collection of fields. This is true because this validator traverses\n// each individual selection set.\nfunction collectConflictsBetween(\n context: ValidationContext,\n conflicts: Array,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n parentFieldsAreMutuallyExclusive: boolean,\n fieldMap1: NodeAndDefCollection,\n varMap1: Map | undefined,\n fieldMap2: NodeAndDefCollection,\n varMap2: Map | undefined,\n): void {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For any response name which appears in both provided field\n // maps, each field from the first field map must be compared to every field\n // in the second field map to find potential conflicts.\n for (const [responseName, fields1] of fieldMap1.entries()) {\n const fields2 = fieldMap2.get(responseName);\n if (fields2 != null) {\n for (const field1 of fields1) {\n for (const field2 of fields2) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n responseName,\n field1,\n varMap1,\n field2,\n varMap2,\n );\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n}\n\n// Determines if there is a conflict between two particular fields, including\n// comparing their sub-fields.\nfunction findConflict(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n comparedFieldsAndFragmentPairs: OrderedPairSet,\n comparedFragmentPairs: PairSet,\n parentFieldsAreMutuallyExclusive: boolean,\n responseName: string,\n field1: NodeAndDef,\n varMap1: Map | undefined,\n field2: NodeAndDef,\n varMap2: Map | undefined,\n): Maybe {\n const [parentType1, node1, def1] = field1;\n const [parentType2, node2, def2] = field2;\n\n // If it is known that two fields could not possibly apply at the same\n // time, due to the parent types, then it is safe to permit them to diverge\n // in aliased field or arguments used as they will not present any ambiguity\n // by differing.\n // It is known that two parent types could never overlap if they are\n // different Object types. Interface or Union types might overlap - if not\n // in the current state of the schema, then perhaps in some future version,\n // thus may not safely diverge.\n const areMutuallyExclusive =\n parentFieldsAreMutuallyExclusive ||\n (parentType1 !== parentType2 &&\n isObjectType(parentType1) &&\n isObjectType(parentType2));\n\n if (!areMutuallyExclusive) {\n // Two aliases must refer to the same field.\n const name1 = node1.name.value;\n const name2 = node2.name.value;\n if (name1 !== name2) {\n return [\n [responseName, `\"${name1}\" and \"${name2}\" are different fields`],\n [node1],\n [node2],\n ];\n }\n\n // Two field calls must have the same arguments.\n if (!sameArguments(node1.arguments, varMap1, node2.arguments, varMap2)) {\n return [\n [responseName, 'they have differing arguments'],\n [node1],\n [node2],\n ];\n }\n }\n\n const directives1 = node1.directives;\n const directives2 = node2.directives;\n const overlappingStreamReason = hasNoOverlappingStreams(\n directives1,\n varMap1,\n directives2,\n varMap2,\n );\n if (overlappingStreamReason !== undefined) {\n return [[responseName, overlappingStreamReason], [node1], [node2]];\n }\n\n // The return type for each field.\n const type1 = def1?.type;\n const type2 = def2?.type;\n\n if (type1 && type2 && doTypesConflict(type1, type2)) {\n return [\n [\n responseName,\n `they return conflicting types \"${inspect(type1)}\" and \"${inspect(\n type2,\n )}\"`,\n ],\n [node1],\n [node2],\n ];\n }\n\n // Collect and compare sub-fields. Use the same \"visited fragment spreads\" list\n // for both collections so fields in a fragment reference are never\n // compared to themselves.\n const selectionSet1 = node1.selectionSet;\n const selectionSet2 = node2.selectionSet;\n if (selectionSet1 && selectionSet2) {\n const conflicts = findConflictsBetweenSubSelectionSets(\n context,\n cachedFieldsAndFragmentSpreads,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n getNamedType(type1),\n selectionSet1,\n varMap1,\n getNamedType(type2),\n selectionSet2,\n varMap2,\n );\n return subfieldConflicts(conflicts, responseName, node1, node2);\n }\n}\n\nfunction sameArguments(\n args1: ReadonlyArray | undefined,\n varMap1: Map | undefined,\n args2: ReadonlyArray | undefined,\n varMap2: Map | undefined,\n): boolean {\n if (args1 === undefined || args1.length === 0) {\n return args2 === undefined || args2.length === 0;\n }\n if (args2 === undefined || args2.length === 0) {\n return false;\n }\n\n if (args1.length !== args2.length) {\n return false;\n }\n\n const values2 = new Map(\n args2.map(({ name, value }) => [\n name.value,\n varMap2 === undefined ? value : replaceFragmentVariables(value, varMap2),\n ]),\n );\n return args1.every((arg1) => {\n let value1 = arg1.value;\n if (varMap1) {\n value1 = replaceFragmentVariables(value1, varMap1);\n }\n const value2 = values2.get(arg1.name.value);\n if (value2 === undefined) {\n return false;\n }\n\n return stringifyValue(value1) === stringifyValue(value2);\n });\n}\n\nfunction replaceFragmentVariables(\n valueNode: ValueNode,\n varMap: ReadonlyMap,\n): ValueNode {\n switch (valueNode.kind) {\n case Kind.VARIABLE:\n return varMap.get(valueNode.name.value) ?? valueNode;\n case Kind.LIST:\n return {\n ...valueNode,\n values: valueNode.values.map((node) =>\n replaceFragmentVariables(node, varMap),\n ),\n };\n case Kind.OBJECT:\n return {\n ...valueNode,\n fields: valueNode.fields.map((field) => ({\n ...field,\n value: replaceFragmentVariables(field.value, varMap),\n })),\n };\n default: {\n return valueNode;\n }\n }\n}\n\nfunction stringifyValue(value: ValueNode): string | null {\n return print(sortValueNode(value));\n}\n\nfunction getStreamDirective(\n directives: ReadonlyArray | undefined,\n): DirectiveNode | undefined {\n return directives?.find((directive) => directive.name.value === 'stream');\n}\n\nfunction hasNoOverlappingStreams(\n directives1: ReadonlyArray | undefined,\n varMap1: Map | undefined,\n directives2: ReadonlyArray | undefined,\n varMap2: Map | undefined,\n): string | undefined {\n const stream1 = getStreamDirective(directives1);\n const stream2 = getStreamDirective(directives2);\n if (!stream1 && !stream2) {\n // both fields do not have streams\n return;\n } else if (stream1 && stream2) {\n // check if both fields have equivalent streams\n if (sameArguments(stream1.arguments, varMap1, stream2.arguments, varMap2)) {\n // This was allowed in previous alpha versions of `graphql-js`.\n return 'they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100';\n }\n return 'they have overlapping stream directives';\n }\n // fields have a mix of stream and no stream\n return 'they have overlapping stream directives';\n}\n\n// Two types conflict if both types could not apply to a value simultaneously.\n// Composite types are ignored as their individual field types will be compared\n// later recursively. However List and Non-Null types must match.\nfunction doTypesConflict(\n type1: GraphQLOutputType,\n type2: GraphQLOutputType,\n): boolean {\n if (isListType(type1)) {\n return isListType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n if (isListType(type2)) {\n return true;\n }\n if (isNonNullType(type1)) {\n return isNonNullType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n if (isNonNullType(type2)) {\n return true;\n }\n if (isLeafType(type1) || isLeafType(type2)) {\n return type1 !== type2;\n }\n return false;\n}\n\n// Given a selection set, return the collection of fields (a mapping of response\n// name to field nodes and definitions) as well as a list of fragment spreads\n// referenced via fragment spreads.\nfunction getFieldsAndFragmentSpreads(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n parentType: Maybe,\n selectionSet: SelectionSetNode,\n varMap: Map | undefined,\n): FieldsAndFragmentSpreads {\n const cached = cachedFieldsAndFragmentSpreads.get(selectionSet);\n if (cached) {\n return cached;\n }\n const nodeAndDefs: NodeAndDefCollection = new Map();\n const fragmentSpreads = new Map();\n _collectFieldsAndFragmentSpreads(\n context,\n parentType,\n selectionSet,\n nodeAndDefs,\n fragmentSpreads,\n varMap,\n );\n const result: FieldsAndFragmentSpreads = [\n nodeAndDefs,\n Array.from(fragmentSpreads.values()),\n ];\n cachedFieldsAndFragmentSpreads.set(selectionSet, result);\n return result;\n}\n\n// Given a reference to a fragment, return the represented collection of fields\n// as well as a list of nested fragment spreads referenced via fragment spreads.\nfunction getReferencedFieldsAndFragmentSpreads(\n context: ValidationContext,\n cachedFieldsAndFragmentSpreads: Map<\n SelectionSetNode,\n FieldsAndFragmentSpreads\n >,\n fragment: FragmentDefinitionNode,\n varMap: Map | undefined,\n) {\n // Short-circuit building a type from the node if possible.\n const cached = cachedFieldsAndFragmentSpreads.get(fragment.selectionSet);\n if (cached) {\n return cached;\n }\n\n const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition);\n return getFieldsAndFragmentSpreads(\n context,\n cachedFieldsAndFragmentSpreads,\n fragmentType,\n fragment.selectionSet,\n varMap,\n );\n}\n\nfunction _collectFieldsAndFragmentSpreads(\n context: ValidationContext,\n parentType: Maybe,\n selectionSet: SelectionSetNode,\n nodeAndDefs: NodeAndDefCollection,\n fragmentSpreads: Map,\n varMap: Map | undefined,\n): void {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n const fieldName = selection.name.value;\n let fieldDef;\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n fieldDef = parentType.getFields()[fieldName];\n }\n const responseName = selection.alias\n ? selection.alias.value\n : fieldName;\n\n let nodeAndDefsList = nodeAndDefs.get(responseName);\n if (nodeAndDefsList == null) {\n nodeAndDefsList = [];\n nodeAndDefs.set(responseName, nodeAndDefsList);\n }\n nodeAndDefsList.push([parentType, selection, fieldDef]);\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragmentSpread = getFragmentSpread(context, selection, varMap);\n fragmentSpreads.set(fragmentSpread.key, fragmentSpread);\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n const typeCondition = selection.typeCondition;\n const inlineFragmentType = typeCondition\n ? typeFromAST(context.getSchema(), typeCondition)\n : parentType;\n _collectFieldsAndFragmentSpreads(\n context,\n inlineFragmentType,\n selection.selectionSet,\n nodeAndDefs,\n fragmentSpreads,\n varMap,\n );\n break;\n }\n }\n }\n}\n\nfunction getFragmentSpread(\n context: ValidationContext,\n fragmentSpreadNode: FragmentSpreadNode,\n varMap: Map | undefined,\n): FragmentSpread {\n let key = '';\n const newVarMap = new Map();\n const fragmentSignature = context.getFragmentSignatureByName()(\n fragmentSpreadNode.name.value,\n );\n const argMap = new Map();\n if (fragmentSpreadNode.arguments) {\n for (const arg of fragmentSpreadNode.arguments) {\n argMap.set(arg.name.value, arg.value);\n }\n }\n if (fragmentSignature?.variableDefinitions) {\n key += fragmentSpreadNode.name.value + '(';\n for (const [varName, variable] of fragmentSignature.variableDefinitions) {\n const value = argMap.get(varName);\n if (value) {\n key += varName + ': ' + print(sortValueNode(value));\n }\n const arg = argMap.get(varName);\n if (arg !== undefined) {\n newVarMap.set(\n varName,\n varMap !== undefined ? replaceFragmentVariables(arg, varMap) : arg,\n );\n } else if (variable.defaultValue) {\n newVarMap.set(varName, variable.defaultValue);\n }\n }\n key += ')';\n }\n return {\n key,\n node: fragmentSpreadNode,\n varMap: newVarMap.size > 0 ? newVarMap : undefined,\n };\n}\n\n// Given a series of Conflicts which occurred between two sub-fields, generate\n// a single Conflict.\nfunction subfieldConflicts(\n conflicts: ReadonlyArray,\n responseName: string,\n node1: FieldNode,\n node2: FieldNode,\n): Maybe {\n if (conflicts.length > 0) {\n return [\n [responseName, conflicts.map(([reason]) => reason)],\n [node1, ...conflicts.map(([, fields1]) => fields1).flat()],\n [node2, ...conflicts.map(([, , fields2]) => fields2).flat()],\n ];\n }\n}\n\n/**\n * A way to keep track of pairs of things where the ordering of the pair\n * matters.\n *\n * Provides a third argument for has/set to allow flagging the pair as\n * weakly or strongly present within the collection.\n *\n * @internal\n */\nclass OrderedPairSet {\n _data: Map>;\n\n constructor() {\n this._data = new Map();\n }\n\n has(a: T, b: U, weaklyPresent: boolean): boolean {\n const result = this._data.get(a)?.get(b);\n if (result === undefined) {\n return false;\n }\n\n return weaklyPresent ? true : weaklyPresent === result;\n }\n\n add(a: T, b: U, weaklyPresent: boolean): void {\n const map = this._data.get(a);\n if (map === undefined) {\n this._data.set(a, new Map([[b, weaklyPresent]]));\n } else {\n map.set(b, weaklyPresent);\n }\n }\n}\n\n/**\n * A way to keep track of pairs of similar things when the ordering of the pair\n * does not matter.\n *\n * @internal\n */\nclass PairSet {\n _orderedPairSet: OrderedPairSet;\n\n constructor() {\n this._orderedPairSet = new OrderedPairSet();\n }\n\n has(a: T, b: T, weaklyPresent: boolean): boolean {\n return a < b\n ? this._orderedPairSet.has(a, b, weaklyPresent)\n : this._orderedPairSet.has(b, a, weaklyPresent);\n }\n\n add(a: T, b: T, weaklyPresent: boolean): void {\n if (a < b) {\n this._orderedPairSet.add(a, b, weaklyPresent);\n } else {\n this._orderedPairSet.add(b, a, weaklyPresent);\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.mts new file mode 100644 index 00000000..6b60b9e4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.mts @@ -0,0 +1,50 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Possible fragment spread + * + * A fragment spread is only valid if the type condition could ever possibly + * be true: if there is a non-empty intersection of the possible parent types, + * and possible types which pass the type condition. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { PossibleFragmentSpreadsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * dog: Dog + * } + * + * type Dog { + * barkVolume: Int + * } + * + * type Cat { + * meowVolume: Int + * } + * `); + * + * const invalidDocument = parse(` + * { dog { ... on Cat { meowVolume } } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * PossibleFragmentSpreadsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { dog { ... on Dog { barkVolume } } } + * `); + * const validErrors = validate(schema, validDocument, [ + * PossibleFragmentSpreadsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function PossibleFragmentSpreadsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts new file mode 100644 index 00000000..96f39431 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts @@ -0,0 +1,50 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Possible fragment spread + * + * A fragment spread is only valid if the type condition could ever possibly + * be true: if there is a non-empty intersection of the possible parent types, + * and possible types which pass the type condition. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { PossibleFragmentSpreadsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * dog: Dog + * } + * + * type Dog { + * barkVolume: Int + * } + * + * type Cat { + * meowVolume: Int + * } + * `); + * + * const invalidDocument = parse(` + * { dog { ... on Cat { meowVolume } } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * PossibleFragmentSpreadsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { dog { ... on Dog { barkVolume } } } + * `); + * const validErrors = validate(schema, validDocument, [ + * PossibleFragmentSpreadsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function PossibleFragmentSpreadsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js new file mode 100644 index 00000000..e2b96b0e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PossibleFragmentSpreadsRule = PossibleFragmentSpreadsRule; +const inspect_ts_1 = require("../../jsutils/inspect.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const definition_ts_1 = require("../../type/definition.js"); +const typeComparators_ts_1 = require("../../utilities/typeComparators.js"); +const typeFromAST_ts_1 = require("../../utilities/typeFromAST.js"); +function PossibleFragmentSpreadsRule(context) { + return { + InlineFragment(node) { + const fragType = context.getType(); + const parentType = context.getParentType(); + if ((0, definition_ts_1.isCompositeType)(fragType) && + (0, definition_ts_1.isCompositeType)(parentType) && + !(0, typeComparators_ts_1.doTypesOverlap)(context.getSchema(), fragType, parentType)) { + const parentTypeStr = (0, inspect_ts_1.inspect)(parentType); + const fragTypeStr = (0, inspect_ts_1.inspect)(fragType); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { nodes: node })); + } + }, + FragmentSpread(node) { + const fragName = node.name.value; + const fragType = getFragmentType(context, fragName); + const parentType = context.getParentType(); + if (fragType && + parentType && + !(0, typeComparators_ts_1.doTypesOverlap)(context.getSchema(), fragType, parentType)) { + const parentTypeStr = (0, inspect_ts_1.inspect)(parentType); + const fragTypeStr = (0, inspect_ts_1.inspect)(fragType); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { nodes: node })); + } + }, + }; +} +function getFragmentType(context, name) { + const frag = context.getFragment(name); + if (frag) { + const type = (0, typeFromAST_ts_1.typeFromAST)(context.getSchema(), frag.typeCondition); + if ((0, definition_ts_1.isCompositeType)(type)) { + return type; + } + } +} +//# sourceMappingURL=PossibleFragmentSpreadsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.map new file mode 100644 index 00000000..ae704adc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PossibleFragmentSpreadsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/PossibleFragmentSpreadsRule.ts"],"names":[],"mappings":";;AA+DA,kEA0CC;AAvGD,yDAAmD;AAGnD,iEAA2D;AAK3D,4DAA2D;AAE3D,2EAAoE;AACpE,mEAA6D;AAkD7D,SAAgB,2BAA2B,CACzC,OAA0B;IAE1B,OAAO;QACL,cAAc,CAAC,IAAI;YACjB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3C,IACE,IAAA,+BAAe,EAAC,QAAQ,CAAC;gBACzB,IAAA,+BAAe,EAAC,UAAU,CAAC;gBAC3B,CAAC,IAAA,mCAAc,EAAC,OAAO,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,EAC1D,CAAC;gBACD,MAAM,aAAa,GAAG,IAAA,oBAAO,EAAC,UAAU,CAAC,CAAC;gBAC1C,MAAM,WAAW,GAAG,IAAA,oBAAO,EAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,sDAAsD,aAAa,2BAA2B,WAAW,IAAI,EAC7G,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACjC,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACpD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3C,IACE,QAAQ;gBACR,UAAU;gBACV,CAAC,IAAA,mCAAc,EAAC,OAAO,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,EAC1D,CAAC;gBACD,MAAM,aAAa,GAAG,IAAA,oBAAO,EAAC,UAAU,CAAC,CAAC;gBAC1C,MAAM,WAAW,GAAG,IAAA,oBAAO,EAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,aAAa,QAAQ,+CAA+C,aAAa,2BAA2B,WAAW,IAAI,EAC3H,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CACtB,OAA0B,EAC1B,IAAY;IAEZ,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,IAAI,GAAG,IAAA,4BAAW,EAAC,OAAO,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAClE,IAAI,IAAA,+BAAe,EAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLCompositeType } from '../../type/definition.ts';\nimport { isCompositeType } from '../../type/definition.ts';\n\nimport { doTypesOverlap } from '../../utilities/typeComparators.ts';\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Possible fragment spread\n *\n * A fragment spread is only valid if the type condition could ever possibly\n * be true: if there is a non-empty intersection of the possible parent types,\n * and possible types which pass the type condition.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { PossibleFragmentSpreadsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * dog: Dog\n * }\n *\n * type Dog {\n * barkVolume: Int\n * }\n *\n * type Cat {\n * meowVolume: Int\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { dog { ... on Cat { meowVolume } } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * PossibleFragmentSpreadsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { dog { ... on Dog { barkVolume } } }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * PossibleFragmentSpreadsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function PossibleFragmentSpreadsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n InlineFragment(node) {\n const fragType = context.getType();\n const parentType = context.getParentType();\n if (\n isCompositeType(fragType) &&\n isCompositeType(parentType) &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n { nodes: node },\n ),\n );\n }\n },\n FragmentSpread(node) {\n const fragName = node.name.value;\n const fragType = getFragmentType(context, fragName);\n const parentType = context.getParentType();\n if (\n fragType &&\n parentType &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment \"${fragName}\" cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n\nfunction getFragmentType(\n context: ValidationContext,\n name: string,\n): Maybe {\n const frag = context.getFragment(name);\n if (frag) {\n const type = typeFromAST(context.getSchema(), frag.typeCondition);\n if (isCompositeType(type)) {\n return type;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs new file mode 100644 index 00000000..5682bd66 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs @@ -0,0 +1,42 @@ +import { inspect } from "../../jsutils/inspect.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { isCompositeType } from "../../type/definition.mjs"; +import { doTypesOverlap } from "../../utilities/typeComparators.mjs"; +import { typeFromAST } from "../../utilities/typeFromAST.mjs"; +export function PossibleFragmentSpreadsRule(context) { + return { + InlineFragment(node) { + const fragType = context.getType(); + const parentType = context.getParentType(); + if (isCompositeType(fragType) && + isCompositeType(parentType) && + !doTypesOverlap(context.getSchema(), fragType, parentType)) { + const parentTypeStr = inspect(parentType); + const fragTypeStr = inspect(fragType); + context.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { nodes: node })); + } + }, + FragmentSpread(node) { + const fragName = node.name.value; + const fragType = getFragmentType(context, fragName); + const parentType = context.getParentType(); + if (fragType && + parentType && + !doTypesOverlap(context.getSchema(), fragType, parentType)) { + const parentTypeStr = inspect(parentType); + const fragTypeStr = inspect(fragType); + context.reportError(new GraphQLError(`Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { nodes: node })); + } + }, + }; +} +function getFragmentType(context, name) { + const frag = context.getFragment(name); + if (frag) { + const type = typeFromAST(context.getSchema(), frag.typeCondition); + if (isCompositeType(type)) { + return type; + } + } +} +//# sourceMappingURL=PossibleFragmentSpreadsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs.map new file mode 100644 index 00000000..e2fc9789 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PossibleFragmentSpreadsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/PossibleFragmentSpreadsRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kCAAiC;AAGnD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAK3D,OAAO,EAAE,eAAe,EAAE,kCAAiC;AAE3D,OAAO,EAAE,cAAc,EAAE,4CAA2C;AACpE,OAAO,EAAE,WAAW,EAAE,wCAAuC;AAkD7D,MAAM,UAAU,2BAA2B,CACzC,OAA0B;IAE1B,OAAO;QACL,cAAc,CAAC,IAAI;YACjB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3C,IACE,eAAe,CAAC,QAAQ,CAAC;gBACzB,eAAe,CAAC,UAAU,CAAC;gBAC3B,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,EAC1D,CAAC;gBACD,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;gBAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,sDAAsD,aAAa,2BAA2B,WAAW,IAAI,EAC7G,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACjC,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACpD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3C,IACE,QAAQ;gBACR,UAAU;gBACV,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,EAC1D,CAAC;gBACD,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;gBAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,aAAa,QAAQ,+CAA+C,aAAa,2BAA2B,WAAW,IAAI,EAC3H,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CACtB,OAA0B,EAC1B,IAAY;IAEZ,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAClE,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLCompositeType } from '../../type/definition.ts';\nimport { isCompositeType } from '../../type/definition.ts';\n\nimport { doTypesOverlap } from '../../utilities/typeComparators.ts';\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Possible fragment spread\n *\n * A fragment spread is only valid if the type condition could ever possibly\n * be true: if there is a non-empty intersection of the possible parent types,\n * and possible types which pass the type condition.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { PossibleFragmentSpreadsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * dog: Dog\n * }\n *\n * type Dog {\n * barkVolume: Int\n * }\n *\n * type Cat {\n * meowVolume: Int\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { dog { ... on Cat { meowVolume } } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * PossibleFragmentSpreadsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { dog { ... on Dog { barkVolume } } }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * PossibleFragmentSpreadsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function PossibleFragmentSpreadsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n InlineFragment(node) {\n const fragType = context.getType();\n const parentType = context.getParentType();\n if (\n isCompositeType(fragType) &&\n isCompositeType(parentType) &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n { nodes: node },\n ),\n );\n }\n },\n FragmentSpread(node) {\n const fragName = node.name.value;\n const fragType = getFragmentType(context, fragName);\n const parentType = context.getParentType();\n if (\n fragType &&\n parentType &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment \"${fragName}\" cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n\nfunction getFragmentType(\n context: ValidationContext,\n name: string,\n): Maybe {\n const frag = context.getFragment(name);\n if (frag) {\n const type = typeFromAST(context.getSchema(), frag.typeCondition);\n if (isCompositeType(type)) {\n return type;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.mts new file mode 100644 index 00000000..37d967bb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Possible type extension + * + * A type extension is only valid if the type is defined and has the same kind. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { PossibleTypeExtensionsRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * extend type Missing { name: String } type Query { name: String } + * `; + * + * PossibleTypeExtensionsRule.name; // => 'PossibleTypeExtensionsRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { name: String } extend type Query { other: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function PossibleTypeExtensionsRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts new file mode 100644 index 00000000..8903782e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Possible type extension + * + * A type extension is only valid if the type is defined and has the same kind. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { PossibleTypeExtensionsRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * extend type Missing { name: String } type Query { name: String } + * `; + * + * PossibleTypeExtensionsRule.name; // => 'PossibleTypeExtensionsRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { name: String } extend type Query { other: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function PossibleTypeExtensionsRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js new file mode 100644 index 00000000..fa9f9923 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PossibleTypeExtensionsRule = PossibleTypeExtensionsRule; +const didYouMean_ts_1 = require("../../jsutils/didYouMean.js"); +const inspect_ts_1 = require("../../jsutils/inspect.js"); +const invariant_ts_1 = require("../../jsutils/invariant.js"); +const suggestionList_ts_1 = require("../../jsutils/suggestionList.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const predicates_ts_1 = require("../../language/predicates.js"); +const definition_ts_1 = require("../../type/definition.js"); +function PossibleTypeExtensionsRule(context) { + const schema = context.getSchema(); + const definedTypes = new Map(); + for (const def of context.getDocument().definitions) { + if ((0, predicates_ts_1.isTypeDefinitionNode)(def)) { + definedTypes.set(def.name.value, def); + } + } + return { + ScalarTypeExtension: checkExtension, + ObjectTypeExtension: checkExtension, + InterfaceTypeExtension: checkExtension, + UnionTypeExtension: checkExtension, + EnumTypeExtension: checkExtension, + InputObjectTypeExtension: checkExtension, + }; + function checkExtension(node) { + const typeName = node.name.value; + const defNode = definedTypes.get(typeName); + const existingType = schema?.getType(typeName); + let expectedKind; + if (defNode != null) { + expectedKind = defKindToExtKind[defNode.kind]; + } + else if (existingType) { + expectedKind = typeToExtKind(existingType); + } + if (expectedKind != null) { + if (expectedKind !== node.kind) { + const kindStr = extensionKindToTypeName(node.kind); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Cannot extend non-${kindStr} type "${typeName}".`, { + nodes: defNode ? [defNode, node] : node, + })); + } + } + else { + const allTypeNames = [ + ...definedTypes.keys(), + ...Object.keys(schema?.getTypeMap() ?? {}), + ]; + context.reportError(new GraphQLError_ts_1.GraphQLError(`Cannot extend type "${typeName}" because it is not defined.` + + (0, didYouMean_ts_1.didYouMean)((0, suggestionList_ts_1.suggestionList)(typeName, allTypeNames)), { nodes: node.name })); + } + } +} +const defKindToExtKind = { + [kinds_ts_1.Kind.SCALAR_TYPE_DEFINITION]: kinds_ts_1.Kind.SCALAR_TYPE_EXTENSION, + [kinds_ts_1.Kind.OBJECT_TYPE_DEFINITION]: kinds_ts_1.Kind.OBJECT_TYPE_EXTENSION, + [kinds_ts_1.Kind.INTERFACE_TYPE_DEFINITION]: kinds_ts_1.Kind.INTERFACE_TYPE_EXTENSION, + [kinds_ts_1.Kind.UNION_TYPE_DEFINITION]: kinds_ts_1.Kind.UNION_TYPE_EXTENSION, + [kinds_ts_1.Kind.ENUM_TYPE_DEFINITION]: kinds_ts_1.Kind.ENUM_TYPE_EXTENSION, + [kinds_ts_1.Kind.INPUT_OBJECT_TYPE_DEFINITION]: kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION, +}; +function typeToExtKind(type) { + if ((0, definition_ts_1.isScalarType)(type)) { + return kinds_ts_1.Kind.SCALAR_TYPE_EXTENSION; + } + if ((0, definition_ts_1.isObjectType)(type)) { + return kinds_ts_1.Kind.OBJECT_TYPE_EXTENSION; + } + if ((0, definition_ts_1.isInterfaceType)(type)) { + return kinds_ts_1.Kind.INTERFACE_TYPE_EXTENSION; + } + if ((0, definition_ts_1.isUnionType)(type)) { + return kinds_ts_1.Kind.UNION_TYPE_EXTENSION; + } + if ((0, definition_ts_1.isEnumType)(type)) { + return kinds_ts_1.Kind.ENUM_TYPE_EXTENSION; + } + if ((0, definition_ts_1.isInputObjectType)(type)) { + return kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION; + } + (0, invariant_ts_1.invariant)(false, 'Unexpected type: ' + (0, inspect_ts_1.inspect)(type)); +} +function extensionKindToTypeName(kind) { + switch (kind) { + case kinds_ts_1.Kind.SCALAR_TYPE_EXTENSION: + return 'scalar'; + case kinds_ts_1.Kind.OBJECT_TYPE_EXTENSION: + return 'object'; + case kinds_ts_1.Kind.INTERFACE_TYPE_EXTENSION: + return 'interface'; + case kinds_ts_1.Kind.UNION_TYPE_EXTENSION: + return 'union'; + case kinds_ts_1.Kind.ENUM_TYPE_EXTENSION: + return 'enum'; + case kinds_ts_1.Kind.INPUT_OBJECT_TYPE_EXTENSION: + return 'input object'; + default: + (0, invariant_ts_1.invariant)(false, 'Unexpected kind: ' + (0, inspect_ts_1.inspect)(kind)); + } +} +//# sourceMappingURL=PossibleTypeExtensionsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.map new file mode 100644 index 00000000..a519cb0f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PossibleTypeExtensionsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/PossibleTypeExtensionsRule.ts"],"names":[],"mappings":";;AAsDA,gEAyDC;AA7GD,+DAAyD;AACzD,yDAAmD;AACnD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port { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { inspect } from '../../jsutils/inspect.ts';\nimport { invariant } from '../../jsutils/invariant.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n TypeDefinitionNode,\n TypeExtensionNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport { isTypeDefinitionNode } from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLNamedType } from '../../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../../type/definition.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Possible type extension\n *\n * A type extension is only valid if the type is defined and has the same kind.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { PossibleTypeExtensionsRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * extend type Missing { name: String } type Query { name: String }\n * `;\n *\n * PossibleTypeExtensionsRule.name; // => 'PossibleTypeExtensionsRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { name: String } extend type Query { other: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function PossibleTypeExtensionsRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const definedTypes = new Map();\n\n for (const def of context.getDocument().definitions) {\n if (isTypeDefinitionNode(def)) {\n definedTypes.set(def.name.value, def);\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension,\n };\n\n function checkExtension(node: TypeExtensionNode): void {\n const typeName = node.name.value;\n const defNode = definedTypes.get(typeName);\n const existingType = schema?.getType(typeName);\n\n let expectedKind: Kind | undefined;\n if (defNode != null) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind != null) {\n if (expectedKind !== node.kind) {\n const kindStr = extensionKindToTypeName(node.kind);\n context.reportError(\n new GraphQLError(`Cannot extend non-${kindStr} type \"${typeName}\".`, {\n nodes: defNode ? [defNode, node] : node,\n }),\n );\n }\n } else {\n const allTypeNames = [\n ...definedTypes.keys(),\n ...Object.keys(schema?.getTypeMap() ?? {}),\n ];\n\n context.reportError(\n new GraphQLError(\n `Cannot extend type \"${typeName}\" because it is not defined.` +\n didYouMean(suggestionList(typeName, allTypeNames)),\n { nodes: node.name },\n ),\n );\n }\n }\n}\n\nconst defKindToExtKind = {\n [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION,\n [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION,\n [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION,\n [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION,\n [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION,\n [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n} as const;\n\nfunction typeToExtKind(type: GraphQLNamedType): Kind {\n if (isScalarType(type)) {\n return Kind.SCALAR_TYPE_EXTENSION;\n }\n if (isObjectType(type)) {\n return Kind.OBJECT_TYPE_EXTENSION;\n }\n if (isInterfaceType(type)) {\n return Kind.INTERFACE_TYPE_EXTENSION;\n }\n if (isUnionType(type)) {\n return Kind.UNION_TYPE_EXTENSION;\n }\n if (isEnumType(type)) {\n return Kind.ENUM_TYPE_EXTENSION;\n }\n if (isInputObjectType(type)) {\n return Kind.INPUT_OBJECT_TYPE_EXTENSION;\n /* node:coverage ignore next 4 */\n }\n // Not reachable. All possible types have been considered\n invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction extensionKindToTypeName(kind: Kind): string {\n switch (kind) {\n case Kind.SCALAR_TYPE_EXTENSION:\n return 'scalar';\n case Kind.OBJECT_TYPE_EXTENSION:\n return 'object';\n case Kind.INTERFACE_TYPE_EXTENSION:\n return 'interface';\n case Kind.UNION_TYPE_EXTENSION:\n return 'union';\n case Kind.ENUM_TYPE_EXTENSION:\n return 'enum';\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return 'input object';\n // Not reachable. All possible types have been considered\n /* node:coverage ignore next 2 */\n default:\n invariant(false, 'Unexpected kind: ' + inspect(kind));\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs new file mode 100644 index 00000000..caa0a0a7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs @@ -0,0 +1,101 @@ +import { didYouMean } from "../../jsutils/didYouMean.mjs"; +import { inspect } from "../../jsutils/inspect.mjs"; +import { invariant } from "../../jsutils/invariant.mjs"; +import { suggestionList } from "../../jsutils/suggestionList.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { isTypeDefinitionNode } from "../../language/predicates.mjs"; +import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isUnionType, } from "../../type/definition.mjs"; +export function PossibleTypeExtensionsRule(context) { + const schema = context.getSchema(); + const definedTypes = new Map(); + for (const def of context.getDocument().definitions) { + if (isTypeDefinitionNode(def)) { + definedTypes.set(def.name.value, def); + } + } + return { + ScalarTypeExtension: checkExtension, + ObjectTypeExtension: checkExtension, + InterfaceTypeExtension: checkExtension, + UnionTypeExtension: checkExtension, + EnumTypeExtension: checkExtension, + InputObjectTypeExtension: checkExtension, + }; + function checkExtension(node) { + const typeName = node.name.value; + const defNode = definedTypes.get(typeName); + const existingType = schema?.getType(typeName); + let expectedKind; + if (defNode != null) { + expectedKind = defKindToExtKind[defNode.kind]; + } + else if (existingType) { + expectedKind = typeToExtKind(existingType); + } + if (expectedKind != null) { + if (expectedKind !== node.kind) { + const kindStr = extensionKindToTypeName(node.kind); + context.reportError(new GraphQLError(`Cannot extend non-${kindStr} type "${typeName}".`, { + nodes: defNode ? [defNode, node] : node, + })); + } + } + else { + const allTypeNames = [ + ...definedTypes.keys(), + ...Object.keys(schema?.getTypeMap() ?? {}), + ]; + context.reportError(new GraphQLError(`Cannot extend type "${typeName}" because it is not defined.` + + didYouMean(suggestionList(typeName, allTypeNames)), { nodes: node.name })); + } + } +} +const defKindToExtKind = { + [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION, + [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION, + [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION, + [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION, + [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION, + [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION, +}; +function typeToExtKind(type) { + if (isScalarType(type)) { + return Kind.SCALAR_TYPE_EXTENSION; + } + if (isObjectType(type)) { + return Kind.OBJECT_TYPE_EXTENSION; + } + if (isInterfaceType(type)) { + return Kind.INTERFACE_TYPE_EXTENSION; + } + if (isUnionType(type)) { + return Kind.UNION_TYPE_EXTENSION; + } + if (isEnumType(type)) { + return Kind.ENUM_TYPE_EXTENSION; + } + if (isInputObjectType(type)) { + return Kind.INPUT_OBJECT_TYPE_EXTENSION; + } + invariant(false, 'Unexpected type: ' + inspect(type)); +} +function extensionKindToTypeName(kind) { + switch (kind) { + case Kind.SCALAR_TYPE_EXTENSION: + return 'scalar'; + case Kind.OBJECT_TYPE_EXTENSION: + return 'object'; + case Kind.INTERFACE_TYPE_EXTENSION: + return 'interface'; + case Kind.UNION_TYPE_EXTENSION: + return 'union'; + case Kind.ENUM_TYPE_EXTENSION: + return 'enum'; + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return 'input object'; + default: + invariant(false, 'Unexpected kind: ' + inspect(kind)); + } +} +//# sourceMappingURL=PossibleTypeExtensionsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs.map new file mode 100644 index 00000000..524680bf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PossibleTypeExtensionsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/PossibleTypeExtensionsRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,qCAAoC;AACzD,OAAO,EAAE,OAAO,EAAE,kCAAiC;AACnD,OAAO,EAAE,SAAS,EAAE,oCAAmC;AACvD,OAAO,EAAE,cAAc,EAAE,yCAAwC;AAEjE,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAM3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,sCAAqC;AAIpE,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,kCAAiC;AA6BlC,MAAM,UAAU,0BAA0B,CACxC,OAA6B;IAE7B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA8B,CAAC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AI,CAAC,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACnC,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IACD,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,2BAA2B,CAAC;IAE1C,CAAC;IAED,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,uBAAuB,CAAC,IAAU;IACzC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,IAAI,CAAC,qBAAqB;YAC7B,OAAO,QAAQ,CAAC;QAClB,KAAK,IAAI,CAAC,qBAAqB;YAC7B,OAAO,QAAQ,CAAC;QAClB,KAAK,IAAI,CAAC,wBAAwB;YAChC,OAAO,WAAW,CAAC;QACrB,KAAK,IAAI,CAAC,oBAAoB;YAC5B,OAAO,OAAO,CAAC;QACjB,KAAK,IAAI,CAAC,mBAAmB;YAC3B,OAAO,MAAM,CAAC;QAChB,KAAK,IAAI,CAAC,2BAA2B;YACnC,OAAO,cAAc,CAAC;QAGxB;YACE,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { didYouMean } from '../../jsutils/didYouMean.ts';\nimport { inspect } from '../../jsutils/inspect.ts';\nimport { invariant } from '../../jsutils/invariant.ts';\nimport { suggestionList } from '../../jsutils/suggestionList.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n TypeDefinitionNode,\n TypeExtensionNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport { isTypeDefinitionNode } from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLNamedType } from '../../type/definition.ts';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../../type/definition.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Possible type extension\n *\n * A type extension is only valid if the type is defined and has the same kind.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { PossibleTypeExtensionsRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * extend type Missing { name: String } type Query { name: String }\n * `;\n *\n * PossibleTypeExtensionsRule.name; // => 'PossibleTypeExtensionsRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { name: String } extend type Query { other: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function PossibleTypeExtensionsRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const definedTypes = new Map();\n\n for (const def of context.getDocument().definitions) {\n if (isTypeDefinitionNode(def)) {\n definedTypes.set(def.name.value, def);\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension,\n };\n\n function checkExtension(node: TypeExtensionNode): void {\n const typeName = node.name.value;\n const defNode = definedTypes.get(typeName);\n const existingType = schema?.getType(typeName);\n\n let expectedKind: Kind | undefined;\n if (defNode != null) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind != null) {\n if (expectedKind !== node.kind) {\n const kindStr = extensionKindToTypeName(node.kind);\n context.reportError(\n new GraphQLError(`Cannot extend non-${kindStr} type \"${typeName}\".`, {\n nodes: defNode ? [defNode, node] : node,\n }),\n );\n }\n } else {\n const allTypeNames = [\n ...definedTypes.keys(),\n ...Object.keys(schema?.getTypeMap() ?? {}),\n ];\n\n context.reportError(\n new GraphQLError(\n `Cannot extend type \"${typeName}\" because it is not defined.` +\n didYouMean(suggestionList(typeName, allTypeNames)),\n { nodes: node.name },\n ),\n );\n }\n }\n}\n\nconst defKindToExtKind = {\n [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION,\n [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION,\n [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION,\n [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION,\n [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION,\n [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n} as const;\n\nfunction typeToExtKind(type: GraphQLNamedType): Kind {\n if (isScalarType(type)) {\n return Kind.SCALAR_TYPE_EXTENSION;\n }\n if (isObjectType(type)) {\n return Kind.OBJECT_TYPE_EXTENSION;\n }\n if (isInterfaceType(type)) {\n return Kind.INTERFACE_TYPE_EXTENSION;\n }\n if (isUnionType(type)) {\n return Kind.UNION_TYPE_EXTENSION;\n }\n if (isEnumType(type)) {\n return Kind.ENUM_TYPE_EXTENSION;\n }\n if (isInputObjectType(type)) {\n return Kind.INPUT_OBJECT_TYPE_EXTENSION;\n /* node:coverage ignore next 4 */\n }\n // Not reachable. All possible types have been considered\n invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction extensionKindToTypeName(kind: Kind): string {\n switch (kind) {\n case Kind.SCALAR_TYPE_EXTENSION:\n return 'scalar';\n case Kind.OBJECT_TYPE_EXTENSION:\n return 'object';\n case Kind.INTERFACE_TYPE_EXTENSION:\n return 'interface';\n case Kind.UNION_TYPE_EXTENSION:\n return 'union';\n case Kind.ENUM_TYPE_EXTENSION:\n return 'enum';\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return 'input object';\n // Not reachable. All possible types have been considered\n /* node:coverage ignore next 2 */\n default:\n invariant(false, 'Unexpected kind: ' + inspect(kind));\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.mts new file mode 100644 index 00000000..804a4dff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.mts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.mjs"; +/** + * Provided required arguments + * + * A field or directive is only valid if all required (non-null without a + * default value) field arguments have been provided. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ProvidedRequiredArgumentsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(required: String!): String + * } + * `); + * + * const invalidDocument = parse(` + * { field } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * ProvidedRequiredArgumentsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { field(required: "x") } + * `); + * const validErrors = validate(schema, validDocument, [ + * ProvidedRequiredArgumentsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function ProvidedRequiredArgumentsRule(context: ValidationContext): ASTVisitor; +/** @internal */ +export declare function ProvidedRequiredArgumentsOnDirectivesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts new file mode 100644 index 00000000..e97121a9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.js"; +/** + * Provided required arguments + * + * A field or directive is only valid if all required (non-null without a + * default value) field arguments have been provided. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ProvidedRequiredArgumentsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(required: String!): String + * } + * `); + * + * const invalidDocument = parse(` + * { field } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * ProvidedRequiredArgumentsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { field(required: "x") } + * `); + * const validErrors = validate(schema, validDocument, [ + * ProvidedRequiredArgumentsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function ProvidedRequiredArgumentsRule(context: ValidationContext): ASTVisitor; +/** @internal */ +export declare function ProvidedRequiredArgumentsOnDirectivesRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js new file mode 100644 index 00000000..b0a6dfa7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProvidedRequiredArgumentsRule = ProvidedRequiredArgumentsRule; +exports.ProvidedRequiredArgumentsOnDirectivesRule = ProvidedRequiredArgumentsOnDirectivesRule; +const inspect_ts_1 = require("../../jsutils/inspect.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const printer_ts_1 = require("../../language/printer.js"); +const definition_ts_1 = require("../../type/definition.js"); +const directives_ts_1 = require("../../type/directives.js"); +const typeFromAST_ts_1 = require("../../utilities/typeFromAST.js"); +function ProvidedRequiredArgumentsRule(context) { + return { + ...ProvidedRequiredArgumentsOnDirectivesRule(context), + Field: { + leave(fieldNode) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + return false; + } + const providedArgs = new Set(fieldNode.arguments?.map((arg) => arg.name.value)); + for (const argDef of fieldDef.args) { + if (!providedArgs.has(argDef.name) && (0, definition_ts_1.isRequiredArgument)(argDef)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Argument "${argDef}" of type "${argDef.type}" is required, but it was not provided.`, { nodes: fieldNode })); + } + } + }, + }, + FragmentSpread: { + leave(spreadNode) { + const fragmentSignature = context.getFragmentSignature(); + if (!fragmentSignature) { + return false; + } + const providedArgs = new Set(spreadNode.arguments?.map((arg) => arg.name.value)); + for (const [varName, variableDefinition,] of fragmentSignature.variableDefinitions) { + if (!providedArgs.has(varName) && + isRequiredArgumentNode(variableDefinition)) { + const type = (0, typeFromAST_ts_1.typeFromAST)(context.getSchema(), variableDefinition.type); + const argTypeStr = (0, inspect_ts_1.inspect)(type); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Fragment "${spreadNode.name.value}" argument "${varName}" of type "${argTypeStr}" is required, but it was not provided.`, { nodes: spreadNode })); + } + } + }, + }, + }; +} +function ProvidedRequiredArgumentsOnDirectivesRule(context) { + const requiredArgsMap = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema?.getDirectives() ?? directives_ts_1.specifiedDirectives; + for (const directive of definedDirectives) { + requiredArgsMap.set(directive.name, new Map(directive.args.filter(definition_ts_1.isRequiredArgument).map((arg) => [arg.name, arg]))); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === kinds_ts_1.Kind.DIRECTIVE_DEFINITION) { + const argNodes = def.arguments ?? []; + requiredArgsMap.set(def.name.value, new Map(argNodes + .filter(isRequiredArgumentNode) + .map((arg) => [arg.name.value, arg]))); + } + } + return { + Directive: { + leave(directiveNode) { + const directiveName = directiveNode.name.value; + const requiredArgs = requiredArgsMap.get(directiveName); + if (requiredArgs != null) { + const argNodes = directiveNode.arguments ?? []; + const argNodeMap = new Set(argNodes.map((arg) => arg.name.value)); + for (const [argName, argDef] of requiredArgs.entries()) { + if (!argNodeMap.has(argName)) { + const argType = (0, definition_ts_1.isType)(argDef.type) + ? (0, inspect_ts_1.inspect)(argDef.type) + : (0, printer_ts_1.print)(argDef.type); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Argument "@${directiveName}(${argName}:)" of type "${argType}" is required, but it was not provided.`, { nodes: directiveNode })); + } + } + } + }, + }, + }; +} +function isRequiredArgumentNode(arg) { + return arg.type.kind === kinds_ts_1.Kind.NON_NULL_TYPE && arg.defaultValue == null; +} +//# sourceMappingURL=ProvidedRequiredArgumentsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.map new file mode 100644 index 00000000..4767d73c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ProvidedRequiredArgumentsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/ProvidedRequiredArgumentsRule.ts"],"names":[],"mappings":";;AA8DA,sEAgEC;AAGD,8FA6DC;AA5LD,yDAAmD;AAEnD,iEAA2D;AAM3D,sDAA+C;AAC/C,0DAAkD;AAIlD,4DAAsE;AACtE,4DAA+D;AAE/D,mEAA6D;AA4C7D,SAAgB,6BAA6B,CAC3C,OAA0B;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SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAC7B,GAAsD;IAEtD,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,eAAI,CAAC,aAAa,IAAI,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC;AAC1E,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n InputValueDefinitionNode,\n VariableDefinitionNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLArgument } from '../../type/definition.ts';\nimport { isRequiredArgument, isType } from '../../type/definition.ts';\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Provided required arguments\n *\n * A field or directive is only valid if all required (non-null without a\n * default value) field arguments have been provided.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ProvidedRequiredArgumentsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(required: String!): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { field }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * ProvidedRequiredArgumentsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { field(required: \"x\") }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * ProvidedRequiredArgumentsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ProvidedRequiredArgumentsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n // eslint-disable-next-line new-cap\n ...ProvidedRequiredArgumentsOnDirectivesRule(context),\n Field: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(fieldNode) {\n const fieldDef = context.getFieldDef();\n if (!fieldDef) {\n return false;\n }\n\n const providedArgs = new Set(\n fieldNode.arguments?.map((arg) => arg.name.value),\n );\n for (const argDef of fieldDef.args) {\n if (!providedArgs.has(argDef.name) && isRequiredArgument(argDef)) {\n context.reportError(\n new GraphQLError(\n `Argument \"${argDef}\" of type \"${argDef.type}\" is required, but it was not provided.`,\n { nodes: fieldNode },\n ),\n );\n }\n }\n },\n },\n FragmentSpread: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(spreadNode) {\n const fragmentSignature = context.getFragmentSignature();\n if (!fragmentSignature) {\n return false;\n }\n\n const providedArgs = new Set(\n spreadNode.arguments?.map((arg) => arg.name.value),\n );\n for (const [\n varName,\n variableDefinition,\n ] of fragmentSignature.variableDefinitions) {\n if (\n !providedArgs.has(varName) &&\n isRequiredArgumentNode(variableDefinition)\n ) {\n const type = typeFromAST(\n context.getSchema(),\n variableDefinition.type,\n );\n const argTypeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Fragment \"${spreadNode.name.value}\" argument \"${varName}\" of type \"${argTypeStr}\" is required, but it was not provided.`,\n { nodes: spreadNode },\n ),\n );\n }\n }\n },\n },\n };\n}\n\n/** @internal */\nexport function ProvidedRequiredArgumentsOnDirectivesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const requiredArgsMap = new Map<\n string,\n Map\n >();\n\n const schema = context.getSchema();\n const definedDirectives = schema?.getDirectives() ?? specifiedDirectives;\n for (const directive of definedDirectives) {\n requiredArgsMap.set(\n directive.name,\n new Map(\n directive.args.filter(isRequiredArgument).map((arg) => [arg.name, arg]),\n ),\n );\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n const argNodes = def.arguments ?? [];\n\n requiredArgsMap.set(\n def.name.value,\n new Map(\n argNodes\n .filter(isRequiredArgumentNode)\n .map((arg) => [arg.name.value, arg]),\n ),\n );\n }\n }\n\n return {\n Directive: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(directiveNode) {\n const directiveName = directiveNode.name.value;\n const requiredArgs = requiredArgsMap.get(directiveName);\n if (requiredArgs != null) {\n const argNodes = directiveNode.arguments ?? [];\n const argNodeMap = new Set(argNodes.map((arg) => arg.name.value));\n for (const [argName, argDef] of requiredArgs.entries()) {\n if (!argNodeMap.has(argName)) {\n const argType = isType(argDef.type)\n ? inspect(argDef.type)\n : print(argDef.type);\n context.reportError(\n new GraphQLError(\n `Argument \"@${directiveName}(${argName}:)\" of type \"${argType}\" is required, but it was not provided.`,\n { nodes: directiveNode },\n ),\n );\n }\n }\n }\n },\n },\n };\n}\n\nfunction isRequiredArgumentNode(\n arg: InputValueDefinitionNode | VariableDefinitionNode,\n): boolean {\n return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs new file mode 100644 index 00000000..5eed792f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs @@ -0,0 +1,84 @@ +import { inspect } from "../../jsutils/inspect.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { print } from "../../language/printer.mjs"; +import { isRequiredArgument, isType } from "../../type/definition.mjs"; +import { specifiedDirectives } from "../../type/directives.mjs"; +import { typeFromAST } from "../../utilities/typeFromAST.mjs"; +export function ProvidedRequiredArgumentsRule(context) { + return { + ...ProvidedRequiredArgumentsOnDirectivesRule(context), + Field: { + leave(fieldNode) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + return false; + } + const providedArgs = new Set(fieldNode.arguments?.map((arg) => arg.name.value)); + for (const argDef of fieldDef.args) { + if (!providedArgs.has(argDef.name) && isRequiredArgument(argDef)) { + context.reportError(new GraphQLError(`Argument "${argDef}" of type "${argDef.type}" is required, but it was not provided.`, { nodes: fieldNode })); + } + } + }, + }, + FragmentSpread: { + leave(spreadNode) { + const fragmentSignature = context.getFragmentSignature(); + if (!fragmentSignature) { + return false; + } + const providedArgs = new Set(spreadNode.arguments?.map((arg) => arg.name.value)); + for (const [varName, variableDefinition,] of fragmentSignature.variableDefinitions) { + if (!providedArgs.has(varName) && + isRequiredArgumentNode(variableDefinition)) { + const type = typeFromAST(context.getSchema(), variableDefinition.type); + const argTypeStr = inspect(type); + context.reportError(new GraphQLError(`Fragment "${spreadNode.name.value}" argument "${varName}" of type "${argTypeStr}" is required, but it was not provided.`, { nodes: spreadNode })); + } + } + }, + }, + }; +} +export function ProvidedRequiredArgumentsOnDirectivesRule(context) { + const requiredArgsMap = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema?.getDirectives() ?? specifiedDirectives; + for (const directive of definedDirectives) { + requiredArgsMap.set(directive.name, new Map(directive.args.filter(isRequiredArgument).map((arg) => [arg.name, arg]))); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + const argNodes = def.arguments ?? []; + requiredArgsMap.set(def.name.value, new Map(argNodes + .filter(isRequiredArgumentNode) + .map((arg) => [arg.name.value, arg]))); + } + } + return { + Directive: { + leave(directiveNode) { + const directiveName = directiveNode.name.value; + const requiredArgs = requiredArgsMap.get(directiveName); + if (requiredArgs != null) { + const argNodes = directiveNode.arguments ?? []; + const argNodeMap = new Set(argNodes.map((arg) => arg.name.value)); + for (const [argName, argDef] of requiredArgs.entries()) { + if (!argNodeMap.has(argName)) { + const argType = isType(argDef.type) + ? inspect(argDef.type) + : print(argDef.type); + context.reportError(new GraphQLError(`Argument "@${directiveName}(${argName}:)" of type "${argType}" is required, but it was not provided.`, { nodes: directiveNode })); + } + } + } + }, + }, + }; +} +function isRequiredArgumentNode(arg) { + return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null; +} +//# sourceMappingURL=ProvidedRequiredArgumentsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs.map new file mode 100644 index 00000000..2c463b60 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ProvidedRequiredArgumentsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/ProvidedRequiredArgumentsRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kCAAiC;AAEnD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAM3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAC/C,OAAO,EAAE,KAAK,EAAE,mCAAkC;AAIlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,kCAAiC;AACtE,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAE/D,OAAO,EAAE,WAAW,EAAE,wCAAuC;AA4C7D,MAAM,UAAU,6BAA6B,CAC3C,OAA0B;IAE1B,OAAO;QAEL,GAAG,yCAAyC,CAAC,OAAO,CAAC;QACrD,KAAK,EAAE;YAEL,KAAK,CAAC,SAAS;gBACb,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,OAAO,KAAK,CAAC;gBACf,CAAC;gBAED,MAAM,YAAY,GAAG,IAAI,GAAG,CAC1B,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC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AAC,GAAG,CAAC,aAAa,CAAC,CAAC;gBACxD,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;oBACzB,MAAM,QAAQ,GAAG,aAAa,CAAC,SAAS,IAAI,EAAE,CAAC;oBAC/C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;oBAClE,KAAK,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;wBACvD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;4BAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;gCACjC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;gCACtB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;4BACvB,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,cAAc,aAAa,IAAI,OAAO,gBAAgB,OAAO,yCAAyC,EACtG,EAAE,KAAK,EAAE,aAAa,EAAE,CACzB,CACF,CAAC;wBACJ,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAC7B,GAAsD;IAEtD,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,IAAI,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC;AAC1E,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n InputValueDefinitionNode,\n VariableDefinitionNode,\n} from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLArgument } from '../../type/definition.ts';\nimport { isRequiredArgument, isType } from '../../type/definition.ts';\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Provided required arguments\n *\n * A field or directive is only valid if all required (non-null without a\n * default value) field arguments have been provided.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ProvidedRequiredArgumentsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(required: String!): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { field }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * ProvidedRequiredArgumentsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { field(required: \"x\") }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * ProvidedRequiredArgumentsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ProvidedRequiredArgumentsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n // eslint-disable-next-line new-cap\n ...ProvidedRequiredArgumentsOnDirectivesRule(context),\n Field: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(fieldNode) {\n const fieldDef = context.getFieldDef();\n if (!fieldDef) {\n return false;\n }\n\n const providedArgs = new Set(\n fieldNode.arguments?.map((arg) => arg.name.value),\n );\n for (const argDef of fieldDef.args) {\n if (!providedArgs.has(argDef.name) && isRequiredArgument(argDef)) {\n context.reportError(\n new GraphQLError(\n `Argument \"${argDef}\" of type \"${argDef.type}\" is required, but it was not provided.`,\n { nodes: fieldNode },\n ),\n );\n }\n }\n },\n },\n FragmentSpread: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(spreadNode) {\n const fragmentSignature = context.getFragmentSignature();\n if (!fragmentSignature) {\n return false;\n }\n\n const providedArgs = new Set(\n spreadNode.arguments?.map((arg) => arg.name.value),\n );\n for (const [\n varName,\n variableDefinition,\n ] of fragmentSignature.variableDefinitions) {\n if (\n !providedArgs.has(varName) &&\n isRequiredArgumentNode(variableDefinition)\n ) {\n const type = typeFromAST(\n context.getSchema(),\n variableDefinition.type,\n );\n const argTypeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Fragment \"${spreadNode.name.value}\" argument \"${varName}\" of type \"${argTypeStr}\" is required, but it was not provided.`,\n { nodes: spreadNode },\n ),\n );\n }\n }\n },\n },\n };\n}\n\n/** @internal */\nexport function ProvidedRequiredArgumentsOnDirectivesRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const requiredArgsMap = new Map<\n string,\n Map\n >();\n\n const schema = context.getSchema();\n const definedDirectives = schema?.getDirectives() ?? specifiedDirectives;\n for (const directive of definedDirectives) {\n requiredArgsMap.set(\n directive.name,\n new Map(\n directive.args.filter(isRequiredArgument).map((arg) => [arg.name, arg]),\n ),\n );\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n const argNodes = def.arguments ?? [];\n\n requiredArgsMap.set(\n def.name.value,\n new Map(\n argNodes\n .filter(isRequiredArgumentNode)\n .map((arg) => [arg.name.value, arg]),\n ),\n );\n }\n }\n\n return {\n Directive: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(directiveNode) {\n const directiveName = directiveNode.name.value;\n const requiredArgs = requiredArgsMap.get(directiveName);\n if (requiredArgs != null) {\n const argNodes = directiveNode.arguments ?? [];\n const argNodeMap = new Set(argNodes.map((arg) => arg.name.value));\n for (const [argName, argDef] of requiredArgs.entries()) {\n if (!argNodeMap.has(argName)) {\n const argType = isType(argDef.type)\n ? inspect(argDef.type)\n : print(argDef.type);\n context.reportError(\n new GraphQLError(\n `Argument \"@${directiveName}(${argName}:)\" of type \"${argType}\" is required, but it was not provided.`,\n { nodes: directiveNode },\n ),\n );\n }\n }\n }\n },\n },\n };\n}\n\nfunction isRequiredArgumentNode(\n arg: InputValueDefinitionNode | VariableDefinitionNode,\n): boolean {\n return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.mts new file mode 100644 index 00000000..d35a9d64 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.mts @@ -0,0 +1,37 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Scalar leafs + * + * A GraphQL document is valid only if all leaf fields (fields without + * sub selections) are of scalar or enum types. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ScalarLeafsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { name { length } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ScalarLeafsRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ScalarLeafsRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function ScalarLeafsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts new file mode 100644 index 00000000..1fc640a6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts @@ -0,0 +1,37 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Scalar leafs + * + * A GraphQL document is valid only if all leaf fields (fields without + * sub selections) are of scalar or enum types. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ScalarLeafsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { name { length } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ScalarLeafsRule]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ScalarLeafsRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function ScalarLeafsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js new file mode 100644 index 00000000..6ecb95a0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScalarLeafsRule = ScalarLeafsRule; +const inspect_ts_1 = require("../../jsutils/inspect.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const definition_ts_1 = require("../../type/definition.js"); +function ScalarLeafsRule(context) { + return { + Field(node) { + const type = context.getType(); + const selectionSet = node.selectionSet; + if (type) { + if ((0, definition_ts_1.isLeafType)((0, definition_ts_1.getNamedType)(type))) { + if (selectionSet) { + const fieldName = node.name.value; + const typeStr = (0, inspect_ts_1.inspect)(type); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, { nodes: selectionSet })); + } + } + else if (!selectionSet) { + const fieldName = node.name.value; + const typeStr = (0, inspect_ts_1.inspect)(type); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, { nodes: node })); + } + else if (selectionSet.selections.length === 0) { + const fieldName = node.name.value; + const typeStr = (0, inspect_ts_1.inspect)(type); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have at least one field selected.`, { nodes: node })); + } + } + }, + }; +} +//# sourceMappingURL=ScalarLeafsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js.map new file mode 100644 index 00000000..487ca16f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScalarLeafsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/ScalarLeafsRule.ts"],"names":[],"mappings":";;AA8CA,0CAuCC;AAnFD,yDAAmD;AAEnD,iEAA2D;AAK3D,4DAAoE;AAqCpE,SAAgB,eAAe,CAAC,OAA0B;IACxD,OAAO;QACL,KAAK,CAAC,IAAe;YACnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACvC,IAAI,IAAI,EAAE,CAAC;gBACT,IAAI,IAAA,0BAAU,EAAC,IAAA,4BAAY,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBACnC,IAAI,YAAY,EAAE,CAAC;wBACjB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;wBAClC,MAAM,OAAO,GAAG,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAC;wBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,UAAU,SAAS,2CAA2C,OAAO,qBAAqB,EAC1F,EAAE,KAAK,EAAE,YAAY,EAAE,CACxB,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;qBAAM,IAAI,CAAC,YAAY,EAAE,CAAC;oBACzB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;oBAClC,MAAM,OAAO,GAAG,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAC;oBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,UAAU,SAAS,cAAc,OAAO,uDAAuD,SAAS,YAAY,EACpH,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACJ,CAAC;qBAAM,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAChD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;oBAClC,MAAM,OAAO,GAAG,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAC;oBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,UAAU,SAAS,cAAc,OAAO,0CAA0C,EAClF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FieldNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { getNamedType, isLeafType } from '../../type/definition.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Scalar leafs\n *\n * A GraphQL document is valid only if all leaf fields (fields without\n * sub selections) are of scalar or enum types.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ScalarLeafsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { name { length } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [ScalarLeafsRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [ScalarLeafsRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ScalarLeafsRule(context: ValidationContext): ASTVisitor {\n return {\n Field(node: FieldNode) {\n const type = context.getType();\n const selectionSet = node.selectionSet;\n if (type) {\n if (isLeafType(getNamedType(type))) {\n if (selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" must not have a selection since type \"${typeStr}\" has no subfields.`,\n { nodes: selectionSet },\n ),\n );\n }\n } else if (!selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have a selection of subfields. Did you mean \"${fieldName} { ... }\"?`,\n { nodes: node },\n ),\n );\n } else if (selectionSet.selections.length === 0) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have at least one field selected.`,\n { nodes: node },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs new file mode 100644 index 00000000..1fb90dc0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs @@ -0,0 +1,31 @@ +import { inspect } from "../../jsutils/inspect.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { getNamedType, isLeafType } from "../../type/definition.mjs"; +export function ScalarLeafsRule(context) { + return { + Field(node) { + const type = context.getType(); + const selectionSet = node.selectionSet; + if (type) { + if (isLeafType(getNamedType(type))) { + if (selectionSet) { + const fieldName = node.name.value; + const typeStr = inspect(type); + context.reportError(new GraphQLError(`Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, { nodes: selectionSet })); + } + } + else if (!selectionSet) { + const fieldName = node.name.value; + const typeStr = inspect(type); + context.reportError(new GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, { nodes: node })); + } + else if (selectionSet.selections.length === 0) { + const fieldName = node.name.value; + const typeStr = inspect(type); + context.reportError(new GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have at least one field selected.`, { nodes: node })); + } + } + }, + }; +} +//# sourceMappingURL=ScalarLeafsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs.map new file mode 100644 index 00000000..b537911b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ScalarLeafsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/ScalarLeafsRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kCAAiC;AAEnD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAK3D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kCAAiC;AAqCpE,MAAM,UAAU,eAAe,CAAC,OAA0B;IACxD,OAAO;QACL,KAAK,CAAC,IAAe;YACnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACvC,IAAI,IAAI,EAAE,CAAC;gBACT,IAAI,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBACnC,IAAI,YAAY,EAAE,CAAC;wBACjB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;wBAClC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;wBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,UAAU,SAAS,2CAA2C,OAAO,qBAAqB,EAC1F,EAAE,KAAK,EAAE,YAAY,EAAE,CACxB,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;qBAAM,IAAI,CAAC,YAAY,EAAE,CAAC;oBACzB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;oBAClC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;oBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,UAAU,SAAS,cAAc,OAAO,uDAAuD,SAAS,YAAY,EACpH,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACJ,CAAC;qBAAM,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAChD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;oBAClC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;oBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,UAAU,SAAS,cAAc,OAAO,0CAA0C,EAClF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { inspect } from '../../jsutils/inspect.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FieldNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { getNamedType, isLeafType } from '../../type/definition.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Scalar leafs\n *\n * A GraphQL document is valid only if all leaf fields (fields without\n * sub selections) are of scalar or enum types.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ScalarLeafsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { name { length } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [ScalarLeafsRule]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [ScalarLeafsRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ScalarLeafsRule(context: ValidationContext): ASTVisitor {\n return {\n Field(node: FieldNode) {\n const type = context.getType();\n const selectionSet = node.selectionSet;\n if (type) {\n if (isLeafType(getNamedType(type))) {\n if (selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" must not have a selection since type \"${typeStr}\" has no subfields.`,\n { nodes: selectionSet },\n ),\n );\n }\n } else if (!selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have a selection of subfields. Did you mean \"${fieldName} { ... }\"?`,\n { nodes: node },\n ),\n );\n } else if (selectionSet.selections.length === 0) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have at least one field selected.`,\n { nodes: node },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.mts new file mode 100644 index 00000000..1d4aec5a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.mts @@ -0,0 +1,48 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Subscriptions must only include a non-introspection field. + * + * A GraphQL subscription is valid only if it contains a single root field and + * that root field is not an introspection field. + * + * See https://spec.graphql.org/draft/#sec-Single-root-field + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { SingleFieldSubscriptionsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * + * type Subscription { + * a: String + * b: String + * } + * `); + * + * const invalidDocument = parse(` + * subscription { a b } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * SingleFieldSubscriptionsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * subscription { a } + * `); + * const validErrors = validate(schema, validDocument, [ + * SingleFieldSubscriptionsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function SingleFieldSubscriptionsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts new file mode 100644 index 00000000..596336ce --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts @@ -0,0 +1,48 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Subscriptions must only include a non-introspection field. + * + * A GraphQL subscription is valid only if it contains a single root field and + * that root field is not an introspection field. + * + * See https://spec.graphql.org/draft/#sec-Single-root-field + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { SingleFieldSubscriptionsRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * + * type Subscription { + * a: String + * b: String + * } + * `); + * + * const invalidDocument = parse(` + * subscription { a b } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * SingleFieldSubscriptionsRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * subscription { a } + * `); + * const validErrors = validate(schema, validDocument, [ + * SingleFieldSubscriptionsRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function SingleFieldSubscriptionsRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js new file mode 100644 index 00000000..65fbaae4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SingleFieldSubscriptionsRule = SingleFieldSubscriptionsRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const collectFields_ts_1 = require("../../execution/collectFields.js"); +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +function SingleFieldSubscriptionsRule(context) { + return { + OperationDefinition(node) { + if (node.operation === 'subscription') { + const schema = context.getSchema(); + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + const operationName = node.name ? node.name.value : null; + const variableValues = Object.create(null); + const document = context.getDocument(); + const fragments = Object.create(null); + for (const definition of document.definitions) { + if (definition.kind === kinds_ts_1.Kind.FRAGMENT_DEFINITION) { + fragments[definition.name.value] = { definition }; + } + } + const { groupedFieldSet, forbiddenDirectiveInstances } = (0, collectFields_ts_1.collectFields)(schema, fragments, variableValues, subscriptionType, node.selectionSet, context.hideSuggestions, true); + if (forbiddenDirectiveInstances.length > 0) { + context.reportError(new GraphQLError_ts_1.GraphQLError(operationName != null + ? `Subscription "${operationName}" must not use \`@skip\` or \`@include\` directives in the top level selection.` + : 'Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.', { nodes: forbiddenDirectiveInstances })); + return; + } + if (groupedFieldSet.size > 1) { + const fieldDetailsLists = [...groupedFieldSet.values()]; + const extraFieldDetailsLists = fieldDetailsLists.slice(1); + const extraFieldSelections = extraFieldDetailsLists.flatMap((fieldDetailsList) => toNodes(fieldDetailsList)); + context.reportError(new GraphQLError_ts_1.GraphQLError(operationName != null + ? `Subscription "${operationName}" must select only one top level field.` + : 'Anonymous Subscription must select only one top level field.', { nodes: extraFieldSelections })); + } + for (const fieldDetailsList of groupedFieldSet.values()) { + const fieldName = toNodes(fieldDetailsList)[0].name.value; + if (fieldName.startsWith('__')) { + context.reportError(new GraphQLError_ts_1.GraphQLError(operationName != null + ? `Subscription "${operationName}" must not select an introspection top level field.` + : 'Anonymous Subscription must not select an introspection top level field.', { nodes: toNodes(fieldDetailsList) })); + } + } + } + } + }, + }; +} +//# sourceMappingURL=SingleFieldSubscriptionsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.map new file mode 100644 index 00000000..f54d70f2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SingleFieldSubsc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F,CAAC,CAAC,0EAA0E,EAC9E,EAAE,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAAE,CACrC,CACF,CAAC;wBACJ,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FieldNode, OperationDefinitionNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type {\n FieldDetailsList,\n FragmentDetails,\n} from '../../execution/collectFields.ts';\nimport { collectFields } from '../../execution/collectFields.ts';\nimport type { VariableValues } from '../../execution/values.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n\n/**\n * Subscriptions must only include a non-introspection field.\n *\n * A GraphQL subscription is valid only if it contains a single root field and\n * that root field is not an introspection field.\n *\n * See https://spec.graphql.org/draft/#sec-Single-root-field\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { SingleFieldSubscriptionsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n *\n * type Subscription {\n * a: String\n * b: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * subscription { a b }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * SingleFieldSubscriptionsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * subscription { a }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * SingleFieldSubscriptionsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function SingleFieldSubscriptionsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(node: OperationDefinitionNode) {\n if (node.operation === 'subscription') {\n const schema = context.getSchema();\n const subscriptionType = schema.getSubscriptionType();\n if (subscriptionType) {\n const operationName = node.name ? node.name.value : null;\n const variableValues: VariableValues = Object.create(null);\n const document = context.getDocument();\n const fragments: ObjMap = Object.create(null);\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[definition.name.value] = { definition };\n }\n }\n const { groupedFieldSet, forbiddenDirectiveInstances } =\n collectFields(\n schema,\n fragments,\n variableValues,\n subscriptionType,\n node.selectionSet,\n context.hideSuggestions,\n true,\n );\n if (forbiddenDirectiveInstances.length > 0) {\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must not use \\`@skip\\` or \\`@include\\` directives in the top level selection.`\n : 'Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.',\n { nodes: forbiddenDirectiveInstances },\n ),\n );\n return;\n }\n if (groupedFieldSet.size > 1) {\n const fieldDetailsLists = [...groupedFieldSet.values()];\n const extraFieldDetailsLists = fieldDetailsLists.slice(1);\n const extraFieldSelections = extraFieldDetailsLists.flatMap(\n (fieldDetailsList) => toNodes(fieldDetailsList),\n );\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must select only one top level field.`\n : 'Anonymous Subscription must select only one top level field.',\n { nodes: extraFieldSelections },\n ),\n );\n }\n for (const fieldDetailsList of groupedFieldSet.values()) {\n const fieldName = toNodes(fieldDetailsList)[0].name.value;\n if (fieldName.startsWith('__')) {\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must not select an introspection top level field.`\n : 'Anonymous Subscription must not select an introspection top level field.',\n { nodes: toNodes(fieldDetailsList) },\n ),\n );\n }\n }\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs new file mode 100644 index 00000000..b9e24f8a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs @@ -0,0 +1,51 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { collectFields } from "../../execution/collectFields.mjs"; +function toNodes(fieldDetailsList) { + return fieldDetailsList.map((fieldDetails) => fieldDetails.node); +} +export function SingleFieldSubscriptionsRule(context) { + return { + OperationDefinition(node) { + if (node.operation === 'subscription') { + const schema = context.getSchema(); + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + const operationName = node.name ? node.name.value : null; + const variableValues = Object.create(null); + const document = context.getDocument(); + const fragments = Object.create(null); + for (const definition of document.definitions) { + if (definition.kind === Kind.FRAGMENT_DEFINITION) { + fragments[definition.name.value] = { definition }; + } + } + const { groupedFieldSet, forbiddenDirectiveInstances } = collectFields(schema, fragments, variableValues, subscriptionType, node.selectionSet, context.hideSuggestions, true); + if (forbiddenDirectiveInstances.length > 0) { + context.reportError(new GraphQLError(operationName != null + ? `Subscription "${operationName}" must not use \`@skip\` or \`@include\` directives in the top level selection.` + : 'Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.', { nodes: forbiddenDirectiveInstances })); + return; + } + if (groupedFieldSet.size > 1) { + const fieldDetailsLists = [...groupedFieldSet.values()]; + const extraFieldDetailsLists = fieldDetailsLists.slice(1); + const extraFieldSelections = extraFieldDetailsLists.flatMap((fieldDetailsList) => toNodes(fieldDetailsList)); + context.reportError(new GraphQLError(operationName != null + ? `Subscription "${operationName}" must select only one top level field.` + : 'Anonymous Subscription must select only one top level field.', { nodes: extraFieldSelections })); + } + for (const fieldDetailsList of groupedFieldSet.values()) { + const fieldName = toNodes(fieldDetailsList)[0].name.value; + if (fieldName.startsWith('__')) { + context.reportError(new GraphQLError(operationName != null + ? `Subscription "${operationName}" must not select an introspection top level field.` + : 'Anonymous Subscription must not select an introspection top level field.', { nodes: toNodes(fieldDetailsList) })); + } + } + } + } + }, + }; +} +//# sourceMappingURL=SingleFieldSubscriptionsRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs.map new file mode 100644 index 00000000..a880d27b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"SingleFieldSubscriptionsRule.js","sourceRoot":"","sources":["../../../src/validation/rules/SingleFieldSubscriptionsRule.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAO/C,OAAO,EAAE,aAAa,EAAE,0CAAyC;AAKjE,SAAS,OAAO,CAAC,gBAAkC;IACjD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AA8CD,MAAM,UAAU,4BAA4B,CAC1C,OAA0B;IAE1B,OAAO;QACL,mBAAmB,CAAC,IAA6B;YAC/C,IAAI,IAAI,CAAC,SAAS,KAAK,cAAc,EAAE,CAAC;gBACtC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;gBACnC,MAAM,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;gBACtD,IAAI,gBAAgB,EAAE,CAAC;oBACrB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;oBACzD,MAAM,cAAc,GAAmB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Y,CACd,aAAa,IAAI,IAAI;4BACnB,CAAC,CAAC,iBAAiB,aAAa,yCAAyC;4BACzE,CAAC,CAAC,8DAA8D,EAClE,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAChC,CACF,CAAC;oBACJ,CAAC;oBACD,KAAK,MAAM,gBAAgB,IAAI,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;wBACxD,MAAM,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;wBAC1D,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;4BAC/B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,aAAa,IAAI,IAAI;gCACnB,CAAC,CAAC,iBAAiB,aAAa,qDAAqD;gCACrF,CAAC,CAAC,0EAA0E,EAC9E,EAAE,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAAE,CACrC,CACF,CAAC;wBACJ,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { ObjMap } from '../../jsutils/ObjMap.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { FieldNode, OperationDefinitionNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type {\n FieldDetailsList,\n FragmentDetails,\n} from '../../execution/collectFields.ts';\nimport { collectFields } from '../../execution/collectFields.ts';\nimport type { VariableValues } from '../../execution/values.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\nfunction toNodes(fieldDetailsList: FieldDetailsList): ReadonlyArray {\n return fieldDetailsList.map((fieldDetails) => fieldDetails.node);\n}\n\n/**\n * Subscriptions must only include a non-introspection field.\n *\n * A GraphQL subscription is valid only if it contains a single root field and\n * that root field is not an introspection field.\n *\n * See https://spec.graphql.org/draft/#sec-Single-root-field\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { SingleFieldSubscriptionsRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n *\n * type Subscription {\n * a: String\n * b: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * subscription { a b }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * SingleFieldSubscriptionsRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * subscription { a }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * SingleFieldSubscriptionsRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function SingleFieldSubscriptionsRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(node: OperationDefinitionNode) {\n if (node.operation === 'subscription') {\n const schema = context.getSchema();\n const subscriptionType = schema.getSubscriptionType();\n if (subscriptionType) {\n const operationName = node.name ? node.name.value : null;\n const variableValues: VariableValues = Object.create(null);\n const document = context.getDocument();\n const fragments: ObjMap = Object.create(null);\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[definition.name.value] = { definition };\n }\n }\n const { groupedFieldSet, forbiddenDirectiveInstances } =\n collectFields(\n schema,\n fragments,\n variableValues,\n subscriptionType,\n node.selectionSet,\n context.hideSuggestions,\n true,\n );\n if (forbiddenDirectiveInstances.length > 0) {\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must not use \\`@skip\\` or \\`@include\\` directives in the top level selection.`\n : 'Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.',\n { nodes: forbiddenDirectiveInstances },\n ),\n );\n return;\n }\n if (groupedFieldSet.size > 1) {\n const fieldDetailsLists = [...groupedFieldSet.values()];\n const extraFieldDetailsLists = fieldDetailsLists.slice(1);\n const extraFieldSelections = extraFieldDetailsLists.flatMap(\n (fieldDetailsList) => toNodes(fieldDetailsList),\n );\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must select only one top level field.`\n : 'Anonymous Subscription must select only one top level field.',\n { nodes: extraFieldSelections },\n ),\n );\n }\n for (const fieldDetailsList of groupedFieldSet.values()) {\n const fieldName = toNodes(fieldDetailsList)[0].name.value;\n if (fieldName.startsWith('__')) {\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must not select an introspection top level field.`\n : 'Anonymous Subscription must not select an introspection top level field.',\n { nodes: toNodes(fieldDetailsList) },\n ),\n );\n }\n }\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.mts new file mode 100644 index 00000000..2cff9695 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Stream directives are used on list fields + * + * A GraphQL document is only valid if stream directives are used on list fields. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate, StreamDirectiveOnListFieldRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * friends: [String] + * } + * `); + * const invalidDocument = parse('{ name @stream(initialCount: 0) }'); + * const validDocument = parse('{ friends @stream(initialCount: 0) }'); + * + * validate(schema, invalidDocument, [StreamDirectiveOnListFieldRule]).length; // => 1 + * validate(schema, validDocument, [StreamDirectiveOnListFieldRule]); // => [] + * ``` + */ +export declare function StreamDirectiveOnListFieldRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.ts new file mode 100644 index 00000000..cc955cb4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Stream directives are used on list fields + * + * A GraphQL document is only valid if stream directives are used on list fields. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate, StreamDirectiveOnListFieldRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * friends: [String] + * } + * `); + * const invalidDocument = parse('{ name @stream(initialCount: 0) }'); + * const validDocument = parse('{ friends @stream(initialCount: 0) }'); + * + * validate(schema, invalidDocument, [StreamDirectiveOnListFieldRule]).length; // => 1 + * validate(schema, validDocument, [StreamDirectiveOnListFieldRule]); // => [] + * ``` + */ +export declare function StreamDirectiveOnListFieldRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js new file mode 100644 index 00000000..78694723 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StreamDirectiveOnListFieldRule = StreamDirectiveOnListFieldRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const definition_ts_1 = require("../../type/definition.js"); +const directives_ts_1 = require("../../type/directives.js"); +function StreamDirectiveOnListFieldRule(context) { + return { + Directive(node) { + const fieldDef = context.getFieldDef(); + const parentType = context.getParentType(); + if (fieldDef && + parentType && + node.name.value === directives_ts_1.GraphQLStreamDirective.name && + !((0, definition_ts_1.isListType)(fieldDef.type) || + ((0, definition_ts_1.isWrappingType)(fieldDef.type) && (0, definition_ts_1.isListType)(fieldDef.type.ofType)))) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Directive "@stream" cannot be used on non-list field "${parentType}.${fieldDef.name}".`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=StreamDirectiveOnListFieldRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js.map new file mode 100644 index 00000000..9550a02a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StreamDirectiveOnListFieldRule.js","sourceRoot":"","sources":["../../../src/validation/rules/StreamDirectiveOnListFieldRule.ts"],"names":[],"mappings":";;AAqCA,wEAyBC;AA5DD,iEAA2D;AAK3D,4DAAsE;AACtE,4DAAkE;AA6BlE,SAAgB,8BAA8B,CAC5C,OAA0B;IAE1B,OAAO;QACL,SAAS,CAAC,IAAmB;YAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YACvC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3C,IACE,QAAQ;gBACR,UAAU;gBACV,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,sCAAsB,CAAC,IAAI;gBAC/C,CAAC,CACC,IAAA,0BAAU,EAAC,QAAQ,CAAC,IAAI,CAAC;oBACzB,CAAC,IAAA,8BAAc,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAA,0BAAU,EAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CACpE,EACD,CAAC;gBACD,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,yDAAyD,UAAU,IAAI,QAAQ,CAAC,IAAI,IAAI,EACxF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { DirectiveNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isListType, isWrappingType } from '../../type/definition.ts';\nimport { GraphQLStreamDirective } from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Stream directives are used on list fields\n *\n * A GraphQL document is only valid if stream directives are used on list fields.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate, StreamDirectiveOnListFieldRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * friends: [String]\n * }\n * `);\n * const invalidDocument = parse('{ name @stream(initialCount: 0) }');\n * const validDocument = parse('{ friends @stream(initialCount: 0) }');\n *\n * validate(schema, invalidDocument, [StreamDirectiveOnListFieldRule]).length; // => 1\n * validate(schema, validDocument, [StreamDirectiveOnListFieldRule]); // => []\n * ```\n */\nexport function StreamDirectiveOnListFieldRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n Directive(node: DirectiveNode) {\n const fieldDef = context.getFieldDef();\n const parentType = context.getParentType();\n if (\n fieldDef &&\n parentType &&\n node.name.value === GraphQLStreamDirective.name &&\n !(\n isListType(fieldDef.type) ||\n (isWrappingType(fieldDef.type) && isListType(fieldDef.type.ofType))\n )\n ) {\n context.reportError(\n new GraphQLError(\n `Directive \"@stream\" cannot be used on non-list field \"${parentType}.${fieldDef.name}\".`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs new file mode 100644 index 00000000..e2f3ca9e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs @@ -0,0 +1,19 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { isListType, isWrappingType } from "../../type/definition.mjs"; +import { GraphQLStreamDirective } from "../../type/directives.mjs"; +export function StreamDirectiveOnListFieldRule(context) { + return { + Directive(node) { + const fieldDef = context.getFieldDef(); + const parentType = context.getParentType(); + if (fieldDef && + parentType && + node.name.value === GraphQLStreamDirective.name && + !(isListType(fieldDef.type) || + (isWrappingType(fieldDef.type) && isListType(fieldDef.type.ofType)))) { + context.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${parentType}.${fieldDef.name}".`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=StreamDirectiveOnListFieldRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs.map new file mode 100644 index 00000000..645c5c4a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"StreamDirectiveOnListFieldRule.js","sourceRoot":"","sources":["../../../src/validation/rules/StreamDirectiveOnListFieldRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAK3D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kCAAiC;AACtE,OAAO,EAAE,sBAAsB,EAAE,kCAAiC;AA6BlE,MAAM,UAAU,8BAA8B,CAC5C,OAA0B;IAE1B,OAAO;QACL,SAAS,CAAC,IAAmB;YAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YACvC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAC3C,IACE,QAAQ;gBACR,UAAU;gBACV,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,sBAAsB,CAAC,IAAI;gBAC/C,CAAC,CACC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;oBACzB,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CACpE,EACD,CAAC;gBACD,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,yDAAyD,UAAU,IAAI,QAAQ,CAAC,IAAI,IAAI,EACxF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { DirectiveNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isListType, isWrappingType } from '../../type/definition.ts';\nimport { GraphQLStreamDirective } from '../../type/directives.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Stream directives are used on list fields\n *\n * A GraphQL document is only valid if stream directives are used on list fields.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate, StreamDirectiveOnListFieldRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * friends: [String]\n * }\n * `);\n * const invalidDocument = parse('{ name @stream(initialCount: 0) }');\n * const validDocument = parse('{ friends @stream(initialCount: 0) }');\n *\n * validate(schema, invalidDocument, [StreamDirectiveOnListFieldRule]).length; // => 1\n * validate(schema, validDocument, [StreamDirectiveOnListFieldRule]); // => []\n * ```\n */\nexport function StreamDirectiveOnListFieldRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n Directive(node: DirectiveNode) {\n const fieldDef = context.getFieldDef();\n const parentType = context.getParentType();\n if (\n fieldDef &&\n parentType &&\n node.name.value === GraphQLStreamDirective.name &&\n !(\n isListType(fieldDef.type) ||\n (isWrappingType(fieldDef.type) && isListType(fieldDef.type.ofType))\n )\n ) {\n context.reportError(\n new GraphQLError(\n `Directive \"@stream\" cannot be used on non-list field \"${parentType}.${fieldDef.name}\".`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts new file mode 100644 index 00000000..12b66190 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.mts @@ -0,0 +1,30 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Unique argument definition names + * + * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments. + * A GraphQL Directive is only valid if all its arguments are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueArgumentDefinitionNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * type Query { field(arg: String, arg: Int): String } + * `; + * + * UniqueArgumentDefinitionNamesRule.name; // => 'UniqueArgumentDefinitionNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { field(arg: String): String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueArgumentDefinitionNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts new file mode 100644 index 00000000..ad7c56e6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts @@ -0,0 +1,30 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Unique argument definition names + * + * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments. + * A GraphQL Directive is only valid if all its arguments are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueArgumentDefinitionNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * type Query { field(arg: String, arg: Int): String } + * `; + * + * UniqueArgumentDefinitionNamesRule.name; // => 'UniqueArgumentDefinitionNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { field(arg: String): String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueArgumentDefinitionNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js new file mode 100644 index 00000000..cde953c7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueArgumentDefinitionNamesRule = UniqueArgumentDefinitionNamesRule; +const groupBy_ts_1 = require("../../jsutils/groupBy.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueArgumentDefinitionNamesRule(context) { + return { + DirectiveDefinition(directiveNode) { + const argumentNodes = directiveNode.arguments ?? []; + return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes); + }, + InterfaceTypeDefinition: checkArgUniquenessPerField, + InterfaceTypeExtension: checkArgUniquenessPerField, + ObjectTypeDefinition: checkArgUniquenessPerField, + ObjectTypeExtension: checkArgUniquenessPerField, + }; + function checkArgUniquenessPerField(typeNode) { + const typeName = typeNode.name.value; + const fieldNodes = typeNode.fields ?? []; + for (const fieldDef of fieldNodes) { + const fieldName = fieldDef.name.value; + const argumentNodes = fieldDef.arguments ?? []; + checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes); + } + return false; + } + function checkArgUniqueness(parentName, argumentNodes) { + const seenArgs = (0, groupBy_ts_1.groupBy)(argumentNodes, (arg) => arg.name.value); + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Argument "${parentName}(${argName}:)" can only be defined once.`, { nodes: argNodes.map((node) => node.name) })); + } + } + return false; + } +} +//# sourceMappingURL=UniqueArgumentDefinitionNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js.map new file mode 100644 index 00000000..c963220e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueArgumentDefinitionNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueArgumentDefinitionNamesRule.ts"],"names":[],"mappings":";;AAyCA,8EAqDC;AA5FD,yDAAmD;AAEnD,iEAA2D;AAqC3D,SAAgB,iCAAiC,CAC/C,OAA6B;IAE7B,OAAO;QACL,mBAAmB,CAAC,aAAa;YAC/B,MAAM,aAAa,GAAG,aAAa,CAAC,SAAS,IAAI,EAAE,CAAC;YAEpD,OAAO,kBAAkB,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,aAAa,CAAC,CAAC;QAC3E,CAAC;QACD,uBAAuB,EAAE,0BAA0B;QACnD,sBAAsB,EAAE,0BAA0B;QAClD,oBAAoB,EAAE,0BAA0B;QAChD,mBAAmB,EAAE,0BAA0B;KAChD,CAAC;IAEF,SAAS,0BAA0B,CAAC,QAGnC;QACC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QAErC,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;QAEzC,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAClC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;YAEtC,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC;YAE/C,kBAAkB,CAAC,GAAG,QAAQ,IAAI,SAAS,EAAE,EAAE,aAAa,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,kBAAkB,CACzB,UAAkB,EAClB,aAAsD;QAEtD,MAAM,QAAQ,GAAG,IAAA,oBAAO,EAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjE,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC;YAC3C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,aAAa,UAAU,IAAI,OAAO,+BAA+B,EACjE,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7C,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { groupBy } from '../../jsutils/groupBy.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n FieldDefinitionNode,\n InputValueDefinitionNode,\n NameNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique argument definition names\n *\n * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments.\n * A GraphQL Directive is only valid if all its arguments are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueArgumentDefinitionNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * type Query { field(arg: String, arg: Int): String }\n * `;\n *\n * UniqueArgumentDefinitionNamesRule.name; // => 'UniqueArgumentDefinitionNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { field(arg: String): String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueArgumentDefinitionNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n return {\n DirectiveDefinition(directiveNode) {\n const argumentNodes = directiveNode.arguments ?? [];\n\n return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes);\n },\n InterfaceTypeDefinition: checkArgUniquenessPerField,\n InterfaceTypeExtension: checkArgUniquenessPerField,\n ObjectTypeDefinition: checkArgUniquenessPerField,\n ObjectTypeExtension: checkArgUniquenessPerField,\n };\n\n function checkArgUniquenessPerField(typeNode: {\n readonly name: NameNode;\n readonly fields?: ReadonlyArray | undefined;\n }) {\n const typeName = typeNode.name.value;\n\n const fieldNodes = typeNode.fields ?? [];\n\n for (const fieldDef of fieldNodes) {\n const fieldName = fieldDef.name.value;\n\n const argumentNodes = fieldDef.arguments ?? [];\n\n checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes);\n }\n\n return false;\n }\n\n function checkArgUniqueness(\n parentName: string,\n argumentNodes: ReadonlyArray,\n ) {\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `Argument \"${parentName}(${argName}:)\" can only be defined once.`,\n { nodes: argNodes.map((node) => node.name) },\n ),\n );\n }\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs new file mode 100644 index 00000000..cf2fba39 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs @@ -0,0 +1,34 @@ +import { groupBy } from "../../jsutils/groupBy.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueArgumentDefinitionNamesRule(context) { + return { + DirectiveDefinition(directiveNode) { + const argumentNodes = directiveNode.arguments ?? []; + return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes); + }, + InterfaceTypeDefinition: checkArgUniquenessPerField, + InterfaceTypeExtension: checkArgUniquenessPerField, + ObjectTypeDefinition: checkArgUniquenessPerField, + ObjectTypeExtension: checkArgUniquenessPerField, + }; + function checkArgUniquenessPerField(typeNode) { + const typeName = typeNode.name.value; + const fieldNodes = typeNode.fields ?? []; + for (const fieldDef of fieldNodes) { + const fieldName = fieldDef.name.value; + const argumentNodes = fieldDef.arguments ?? []; + checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes); + } + return false; + } + function checkArgUniqueness(parentName, argumentNodes) { + const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value); + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError(new GraphQLError(`Argument "${parentName}(${argName}:)" can only be defined once.`, { nodes: argNodes.map((node) => node.name) })); + } + } + return false; + } +} +//# sourceMappingURL=UniqueArgumentDefinitionNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs.map new file mode 100644 index 00000000..e4c193a9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueArgumentDefinitionNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueArgumentDefinitionNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kCAAiC;AAEnD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAqC3D,MAAM,UAAU,iCAAiC,CAC/C,OAA6B;IAE7B,OAAO;QACL,mBAAmB,CAAC,aAAa;YAC/B,MAAM,aAAa,GAAG,aAAa,CAAC,SAAS,IAAI,EAAE,CAAC;YAEpD,OAAO,kBAAkB,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,aAAa,CAAC,CAAC;QAC3E,CAAC;QACD,uBAAuB,EA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ts';\n\nimport type {\n FieldDefinitionNode,\n InputValueDefinitionNode,\n NameNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique argument definition names\n *\n * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments.\n * A GraphQL Directive is only valid if all its arguments are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueArgumentDefinitionNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * type Query { field(arg: String, arg: Int): String }\n * `;\n *\n * UniqueArgumentDefinitionNamesRule.name; // => 'UniqueArgumentDefinitionNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { field(arg: String): String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueArgumentDefinitionNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n return {\n DirectiveDefinition(directiveNode) {\n const argumentNodes = directiveNode.arguments ?? [];\n\n return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes);\n },\n InterfaceTypeDefinition: checkArgUniquenessPerField,\n InterfaceTypeExtension: checkArgUniquenessPerField,\n ObjectTypeDefinition: checkArgUniquenessPerField,\n ObjectTypeExtension: checkArgUniquenessPerField,\n };\n\n function checkArgUniquenessPerField(typeNode: {\n readonly name: NameNode;\n readonly fields?: ReadonlyArray | undefined;\n }) {\n const typeName = typeNode.name.value;\n\n const fieldNodes = typeNode.fields ?? [];\n\n for (const fieldDef of fieldNodes) {\n const fieldName = fieldDef.name.value;\n\n const argumentNodes = fieldDef.arguments ?? [];\n\n checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes);\n }\n\n return false;\n }\n\n function checkArgUniqueness(\n parentName: string,\n argumentNodes: ReadonlyArray,\n ) {\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `Argument \"${parentName}(${argName}:)\" can only be defined once.`,\n { nodes: argNodes.map((node) => node.name) },\n ),\n );\n }\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.mts new file mode 100644 index 00000000..d8dfa59c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.mts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Unique argument names + * + * A GraphQL field or directive is only valid if all supplied arguments are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueArgumentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: String): String + * } + * `); + * + * const invalidDocument = parse(` + * { field(arg: "1", arg: "2") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueArgumentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { field(arg: "1") } + * `); + * const validErrors = validate(schema, validDocument, [UniqueArgumentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueArgumentNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts new file mode 100644 index 00000000..cfdcf91d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Unique argument names + * + * A GraphQL field or directive is only valid if all supplied arguments are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Argument-Names + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueArgumentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: String): String + * } + * `); + * + * const invalidDocument = parse(` + * { field(arg: "1", arg: "2") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueArgumentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { field(arg: "1") } + * `); + * const validErrors = validate(schema, validDocument, [UniqueArgumentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueArgumentNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js new file mode 100644 index 00000000..3daa200f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueArgumentNamesRule = UniqueArgumentNamesRule; +const groupBy_ts_1 = require("../../jsutils/groupBy.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueArgumentNamesRule(context) { + return { + Field: checkArgUniqueness, + Directive: checkArgUniqueness, + }; + function checkArgUniqueness(parentNode) { + const argumentNodes = parentNode.arguments ?? []; + const seenArgs = (0, groupBy_ts_1.groupBy)(argumentNodes, (arg) => arg.name.value); + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one argument named "${argName}".`, { nodes: argNodes.map((node) => node.name) })); + } + } + } +} +//# sourceMappingURL=UniqueArgumentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.map new file mode 100644 index 00000000..e2f2189c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueArgumentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueArgumentNamesRule.ts"],"names":[],"mappings":";;AAgDA,0DA0BC;AAxED,yDAAmD;AAEnD,iEAA2D;AA4C3D,SAAgB,uBAAuB,CACrC,OAA6B;IAE7B,OAAO;QACL,KAAK,EAAE,kBAAkB;QACzB,SAAS,EAAE,kBAAkB;KAC9B,CAAC;IAEF,SAAS,kBAAkB,CAAC,UAE3B;QACC,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,IAAI,EAAE,CAAC;QAEjD,MAAM,QAAQ,GAAG,IAAA,oBAAO,EAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjE,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC;YAC3C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,yCAAyC,OAAO,IAAI,EACpD,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7C,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { groupBy } from '../../jsutils/groupBy.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ArgumentNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique argument names\n *\n * A GraphQL field or directive is only valid if all supplied arguments are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueArgumentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: String): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { field(arg: \"1\", arg: \"2\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueArgumentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { field(arg: \"1\") }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueArgumentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueArgumentNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n return {\n Field: checkArgUniqueness,\n Directive: checkArgUniqueness,\n };\n\n function checkArgUniqueness(parentNode: {\n arguments?: ReadonlyArray | undefined;\n }) {\n const argumentNodes = parentNode.arguments ?? [];\n\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one argument named \"${argName}\".`,\n { nodes: argNodes.map((node) => node.name) },\n ),\n );\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs new file mode 100644 index 00000000..9a1e61b5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs @@ -0,0 +1,18 @@ +import { groupBy } from "../../jsutils/groupBy.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueArgumentNamesRule(context) { + return { + Field: checkArgUniqueness, + Directive: checkArgUniqueness, + }; + function checkArgUniqueness(parentNode) { + const argumentNodes = parentNode.arguments ?? []; + const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value); + for (const [argName, argNodes] of seenArgs) { + if (argNodes.length > 1) { + context.reportError(new GraphQLError(`There can be only one argument named "${argName}".`, { nodes: argNodes.map((node) => node.name) })); + } + } + } +} +//# sourceMappingURL=UniqueArgumentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs.map new file mode 100644 index 00000000..4dd33ac1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueArgumentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueArgumentNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kCAAiC;AAEnD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA4C3D,MAAM,UAAU,uBAAuB,CACrC,OAA6B;IAE7B,OAAO;QACL,KAAK,EAAE,kBAAkB;QACzB,SAAS,EAAE,kBAAkB;KAC9B,CAAC;IAEF,SAAS,kBAAkB,CAAC,UAE3B;QACC,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,IAAI,EAAE,CAAC;QAEjD,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjE,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC;YAC3C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,yCAAyC,OAAO,IAAI,EACpD,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7C,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { groupBy } from '../../jsutils/groupBy.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ArgumentNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique argument names\n *\n * A GraphQL field or directive is only valid if all supplied arguments are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueArgumentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: String): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { field(arg: \"1\", arg: \"2\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueArgumentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { field(arg: \"1\") }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueArgumentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueArgumentNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n return {\n Field: checkArgUniqueness,\n Directive: checkArgUniqueness,\n };\n\n function checkArgUniqueness(parentNode: {\n arguments?: ReadonlyArray | undefined;\n }) {\n const argumentNodes = parentNode.arguments ?? [];\n\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one argument named \"${argName}\".`,\n { nodes: argNodes.map((node) => node.name) },\n ),\n );\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.mts new file mode 100644 index 00000000..1920998b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Unique directive names + * + * A GraphQL document is only valid if all defined directives have unique names. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueDirectiveNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * directive @tag on FIELD directive @tag on QUERY type Query { name: String } + * `; + * + * UniqueDirectiveNamesRule.name; // => 'UniqueDirectiveNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * directive @tag on FIELD type Query { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueDirectiveNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts new file mode 100644 index 00000000..160e8756 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Unique directive names + * + * A GraphQL document is only valid if all defined directives have unique names. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueDirectiveNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * directive @tag on FIELD directive @tag on QUERY type Query { name: String } + * `; + * + * UniqueDirectiveNamesRule.name; // => 'UniqueDirectiveNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * directive @tag on FIELD type Query { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueDirectiveNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js new file mode 100644 index 00000000..5bc1c219 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueDirectiveNamesRule = UniqueDirectiveNamesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueDirectiveNamesRule(context) { + const knownDirectiveNames = new Map(); + const schema = context.getSchema(); + return { + DirectiveDefinition(node) { + const directiveName = node.name.value; + if (schema?.getDirective(directiveName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, { nodes: node.name })); + return; + } + const knownName = knownDirectiveNames.get(directiveName); + if (knownName) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one directive named "@${directiveName}".`, { nodes: [knownName, node.name] })); + } + else { + knownDirectiveNames.set(directiveName, node.name); + } + return false; + }, + }; +} +//# sourceMappingURL=UniqueDirectiveNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.map new file mode 100644 index 00000000..f122b578 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueDirectiveNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueDirectiveNamesRule.ts"],"names":[],"mappings":";;AAkCA,4DAmCC;AAnED,iEAA2D;AAgC3D,SAAgB,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAEnC,OAAO;QACL,mBAAmB,CAAC,IAAI;YACtB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YAEtC,IAAI,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;gBACxC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,eAAe,aAAa,yDAAyD,EACrF,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CACrB,CACF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,MAAM,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YACzD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,2CAA2C,aAAa,IAAI,EAC5D,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAClC,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,mBAAmB,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique directive names\n *\n * A GraphQL document is only valid if all defined directives have unique names.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueDirectiveNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * directive @tag on FIELD directive @tag on QUERY type Query { name: String }\n * `;\n *\n * UniqueDirectiveNamesRule.name; // => 'UniqueDirectiveNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * directive @tag on FIELD type Query { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueDirectiveNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const knownDirectiveNames = new Map();\n const schema = context.getSchema();\n\n return {\n DirectiveDefinition(node) {\n const directiveName = node.name.value;\n\n if (schema?.getDirective(directiveName)) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${directiveName}\" already exists in the schema. It cannot be redefined.`,\n { nodes: node.name },\n ),\n );\n return;\n }\n\n const knownName = knownDirectiveNames.get(directiveName);\n if (knownName) {\n context.reportError(\n new GraphQLError(\n `There can be only one directive named \"@${directiveName}\".`,\n { nodes: [knownName, node.name] },\n ),\n );\n } else {\n knownDirectiveNames.set(directiveName, node.name);\n }\n\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs new file mode 100644 index 00000000..075ff610 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs @@ -0,0 +1,23 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueDirectiveNamesRule(context) { + const knownDirectiveNames = new Map(); + const schema = context.getSchema(); + return { + DirectiveDefinition(node) { + const directiveName = node.name.value; + if (schema?.getDirective(directiveName)) { + context.reportError(new GraphQLError(`Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, { nodes: node.name })); + return; + } + const knownName = knownDirectiveNames.get(directiveName); + if (knownName) { + context.reportError(new GraphQLError(`There can be only one directive named "@${directiveName}".`, { nodes: [knownName, node.name] })); + } + else { + knownDirectiveNames.set(directiveName, node.name); + } + return false; + }, + }; +} +//# sourceMappingURL=UniqueDirectiveNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs.map new file mode 100644 index 00000000..d1060adb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueDirectiveNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueDirectiveNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAgC3D,MAAM,UAAU,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAEnC,OAAO;QACL,mBAAmB,CAAC,IAAI;YACtB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YAEtC,IAAI,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;gBACxC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,eAAe,aAAa,yDAAyD,EACrF,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CACrB,CACF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,MAAM,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YACzD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,2CAA2C,aAAa,IAAI,EAC5D,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAClC,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,mBAAmB,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique directive names\n *\n * A GraphQL document is only valid if all defined directives have unique names.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueDirectiveNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * directive @tag on FIELD directive @tag on QUERY type Query { name: String }\n * `;\n *\n * UniqueDirectiveNamesRule.name; // => 'UniqueDirectiveNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * directive @tag on FIELD type Query { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueDirectiveNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const knownDirectiveNames = new Map();\n const schema = context.getSchema();\n\n return {\n DirectiveDefinition(node) {\n const directiveName = node.name.value;\n\n if (schema?.getDirective(directiveName)) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${directiveName}\" already exists in the schema. It cannot be redefined.`,\n { nodes: node.name },\n ),\n );\n return;\n }\n\n const knownName = knownDirectiveNames.get(directiveName);\n if (knownName) {\n context.reportError(\n new GraphQLError(\n `There can be only one directive named \"@${directiveName}\".`,\n { nodes: [knownName, node.name] },\n ),\n );\n } else {\n knownDirectiveNames.set(directiveName, node.name);\n }\n\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.mts new file mode 100644 index 00000000..f8048da8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.mts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.mjs"; +/** + * Unique directive names per location + * + * A GraphQL document is only valid if all non-repeatable directives at + * a given location are uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueDirectivesPerLocationRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { name @include(if: true) @include(if: false) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueDirectivesPerLocationRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name @include(if: true) } + * `); + * const validErrors = validate(schema, validDocument, [ + * UniqueDirectivesPerLocationRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueDirectivesPerLocationRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts new file mode 100644 index 00000000..328c6422 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts @@ -0,0 +1,43 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext, ValidationContext } from "../ValidationContext.js"; +/** + * Unique directive names per location + * + * A GraphQL document is only valid if all non-repeatable directives at + * a given location are uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueDirectivesPerLocationRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { name @include(if: true) @include(if: false) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueDirectivesPerLocationRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name @include(if: true) } + * `); + * const validErrors = validate(schema, validDocument, [ + * UniqueDirectivesPerLocationRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueDirectivesPerLocationRule(context: ValidationContext | SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js new file mode 100644 index 00000000..da11f6cc --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueDirectivesPerLocationRule = UniqueDirectivesPerLocationRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const predicates_ts_1 = require("../../language/predicates.js"); +const directives_ts_1 = require("../../type/directives.js"); +function UniqueDirectivesPerLocationRule(context) { + const uniqueDirectiveMap = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : directives_ts_1.specifiedDirectives; + for (const directive of definedDirectives) { + uniqueDirectiveMap.set(directive.name, !directive.isRepeatable); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === kinds_ts_1.Kind.DIRECTIVE_DEFINITION) { + uniqueDirectiveMap.set(def.name.value, !def.repeatable); + } + } + const schemaDirectives = new Map(); + const typeDirectivesMap = new Map(); + const directiveDirectivesMap = new Map(); + return { + enter(node) { + if (!('directives' in node) || !node.directives) { + return; + } + let seenDirectives; + if (node.kind === kinds_ts_1.Kind.SCHEMA_DEFINITION || + node.kind === kinds_ts_1.Kind.SCHEMA_EXTENSION) { + seenDirectives = schemaDirectives; + } + else if ((0, predicates_ts_1.isTypeDefinitionNode)(node) || (0, predicates_ts_1.isTypeExtensionNode)(node)) { + const typeName = node.name.value; + seenDirectives = typeDirectivesMap.get(typeName); + if (seenDirectives === undefined) { + seenDirectives = new Map(); + typeDirectivesMap.set(typeName, seenDirectives); + } + } + else if (node.kind === kinds_ts_1.Kind.DIRECTIVE_DEFINITION || + node.kind === kinds_ts_1.Kind.DIRECTIVE_EXTENSION) { + const directiveName = node.name.value; + seenDirectives = directiveDirectivesMap.get(directiveName); + if (seenDirectives === undefined) { + seenDirectives = new Map(); + directiveDirectivesMap.set(directiveName, seenDirectives); + } + } + else { + seenDirectives = new Map(); + } + for (const directive of node.directives) { + const directiveName = directive.name.value; + if (uniqueDirectiveMap.get(directiveName) === true) { + const seenDirective = seenDirectives.get(directiveName); + if (seenDirective != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`The directive "@${directiveName}" can only be used once at this location.`, { nodes: [seenDirective, directive] })); + } + else { + seenDirectives.set(directiveName, directive); + } + } + } + }, + }; +} +//# sourceMappingURL=UniqueDirectivesPerLocationRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.map new file mode 100644 index 00000000..6b4fddc4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueDirectivesPerLocationRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueDirectivesPerLocationRule.ts"],"names":[],"mappings":";;AA0DA,0EA+EC;AAvID,iEAA2D;AAG3D,sDAA+C;AAC/C,gEAGsC;AAGtC,4DAA+D;AA8C/D,SAAgB,+BAA+B,CAC7C,OAAiD;IAEjD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEtD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,iBAAiB,GAAG,MAAM;QAC9B,CAAC,CAAC,MAA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;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { DirectiveNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport {\n isTypeDefinitionNode,\n isTypeExtensionNode,\n} from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Unique directive names per location\n *\n * A GraphQL document is only valid if all non-repeatable directives at\n * a given location are uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueDirectivesPerLocationRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { name @include(if: true) @include(if: false) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueDirectivesPerLocationRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name @include(if: true) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * UniqueDirectivesPerLocationRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueDirectivesPerLocationRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const uniqueDirectiveMap = new Map();\n\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n for (const directive of definedDirectives) {\n uniqueDirectiveMap.set(directive.name, !directive.isRepeatable);\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap.set(def.name.value, !def.repeatable);\n }\n }\n\n const schemaDirectives = new Map();\n const typeDirectivesMap = new Map>();\n const directiveDirectivesMap = new Map>();\n\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter(node) {\n if (!('directives' in node) || !node.directives) {\n return;\n }\n\n let seenDirectives;\n if (\n node.kind === Kind.SCHEMA_DEFINITION ||\n node.kind === Kind.SCHEMA_EXTENSION\n ) {\n seenDirectives = schemaDirectives;\n } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) {\n const typeName = node.name.value;\n seenDirectives = typeDirectivesMap.get(typeName);\n if (seenDirectives === undefined) {\n seenDirectives = new Map();\n typeDirectivesMap.set(typeName, seenDirectives);\n }\n } else if (\n node.kind === Kind.DIRECTIVE_DEFINITION ||\n node.kind === Kind.DIRECTIVE_EXTENSION\n ) {\n const directiveName = node.name.value;\n seenDirectives = directiveDirectivesMap.get(directiveName);\n if (seenDirectives === undefined) {\n seenDirectives = new Map();\n directiveDirectivesMap.set(directiveName, seenDirectives);\n }\n } else {\n seenDirectives = new Map();\n }\n\n for (const directive of node.directives) {\n const directiveName = directive.name.value;\n\n if (uniqueDirectiveMap.get(directiveName) === true) {\n const seenDirective = seenDirectives.get(directiveName);\n if (seenDirective != null) {\n context.reportError(\n new GraphQLError(\n `The directive \"@${directiveName}\" can only be used once at this location.`,\n { nodes: [seenDirective, directive] },\n ),\n );\n } else {\n seenDirectives.set(directiveName, directive);\n }\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs new file mode 100644 index 00000000..5aa6f4f5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs @@ -0,0 +1,68 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { isTypeDefinitionNode, isTypeExtensionNode, } from "../../language/predicates.mjs"; +import { specifiedDirectives } from "../../type/directives.mjs"; +export function UniqueDirectivesPerLocationRule(context) { + const uniqueDirectiveMap = new Map(); + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + uniqueDirectiveMap.set(directive.name, !directive.isRepeatable); + } + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + uniqueDirectiveMap.set(def.name.value, !def.repeatable); + } + } + const schemaDirectives = new Map(); + const typeDirectivesMap = new Map(); + const directiveDirectivesMap = new Map(); + return { + enter(node) { + if (!('directives' in node) || !node.directives) { + return; + } + let seenDirectives; + if (node.kind === Kind.SCHEMA_DEFINITION || + node.kind === Kind.SCHEMA_EXTENSION) { + seenDirectives = schemaDirectives; + } + else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) { + const typeName = node.name.value; + seenDirectives = typeDirectivesMap.get(typeName); + if (seenDirectives === undefined) { + seenDirectives = new Map(); + typeDirectivesMap.set(typeName, seenDirectives); + } + } + else if (node.kind === Kind.DIRECTIVE_DEFINITION || + node.kind === Kind.DIRECTIVE_EXTENSION) { + const directiveName = node.name.value; + seenDirectives = directiveDirectivesMap.get(directiveName); + if (seenDirectives === undefined) { + seenDirectives = new Map(); + directiveDirectivesMap.set(directiveName, seenDirectives); + } + } + else { + seenDirectives = new Map(); + } + for (const directive of node.directives) { + const directiveName = directive.name.value; + if (uniqueDirectiveMap.get(directiveName) === true) { + const seenDirective = seenDirectives.get(directiveName); + if (seenDirective != null) { + context.reportError(new GraphQLError(`The directive "@${directiveName}" can only be used once at this location.`, { nodes: [seenDirective, directive] })); + } + else { + seenDirectives.set(directiveName, directive); + } + } + } + }, + }; +} +//# sourceMappingURL=UniqueDirectivesPerLocationRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs.map new file mode 100644 index 00000000..8d6aaea7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueDirectivesPerLocationRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueDirectivesPerLocationRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAC/C,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,sCAAqC;AAGtC,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AA8C/D,MAAM,UAAU,+BAA+B,CAC7C,OAAiD;IAEjD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEtD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,iBAAiB,GAAG,MAAM;QAC9B,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE;QACxB,CAAC,CAAC,mBAAmB,CAAC;IACxB,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE,CAAC;QAC1C,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC;IACzD,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QACjC,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC3C,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KA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,CAAC;oBACjC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;oBAC3B,sBAAsB,CAAC,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;YAC7B,CAAC;YAED,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACxC,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;gBAE3C,IAAI,kBAAkB,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC;oBACnD,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;oBACxD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;wBAC1B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,mBAAmB,aAAa,2CAA2C,EAC3E,EAAE,KAAK,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,CACtC,CACF,CAAC;oBACJ,CAAC;yBAAM,CAAC;wBACN,cAAc,CAAC,GAAG,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;oBAC/C,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { DirectiveNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport {\n isTypeDefinitionNode,\n isTypeExtensionNode,\n} from '../../language/predicates.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { specifiedDirectives } from '../../type/directives.ts';\n\nimport type {\n SDLValidationContext,\n ValidationContext,\n} from '../ValidationContext.ts';\n\n/**\n * Unique directive names per location\n *\n * A GraphQL document is only valid if all non-repeatable directives at\n * a given location are uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueDirectivesPerLocationRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { name @include(if: true) @include(if: false) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueDirectivesPerLocationRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name @include(if: true) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * UniqueDirectivesPerLocationRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueDirectivesPerLocationRule(\n context: ValidationContext | SDLValidationContext,\n): ASTVisitor {\n const uniqueDirectiveMap = new Map();\n\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n for (const directive of definedDirectives) {\n uniqueDirectiveMap.set(directive.name, !directive.isRepeatable);\n }\n\n const astDefinitions = context.getDocument().definitions;\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap.set(def.name.value, !def.repeatable);\n }\n }\n\n const schemaDirectives = new Map();\n const typeDirectivesMap = new Map>();\n const directiveDirectivesMap = new Map>();\n\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter(node) {\n if (!('directives' in node) || !node.directives) {\n return;\n }\n\n let seenDirectives;\n if (\n node.kind === Kind.SCHEMA_DEFINITION ||\n node.kind === Kind.SCHEMA_EXTENSION\n ) {\n seenDirectives = schemaDirectives;\n } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) {\n const typeName = node.name.value;\n seenDirectives = typeDirectivesMap.get(typeName);\n if (seenDirectives === undefined) {\n seenDirectives = new Map();\n typeDirectivesMap.set(typeName, seenDirectives);\n }\n } else if (\n node.kind === Kind.DIRECTIVE_DEFINITION ||\n node.kind === Kind.DIRECTIVE_EXTENSION\n ) {\n const directiveName = node.name.value;\n seenDirectives = directiveDirectivesMap.get(directiveName);\n if (seenDirectives === undefined) {\n seenDirectives = new Map();\n directiveDirectivesMap.set(directiveName, seenDirectives);\n }\n } else {\n seenDirectives = new Map();\n }\n\n for (const directive of node.directives) {\n const directiveName = directive.name.value;\n\n if (uniqueDirectiveMap.get(directiveName) === true) {\n const seenDirective = seenDirectives.get(directiveName);\n if (seenDirective != null) {\n context.reportError(\n new GraphQLError(\n `The directive \"@${directiveName}\" can only be used once at this location.`,\n { nodes: [seenDirective, directive] },\n ),\n );\n } else {\n seenDirectives.set(directiveName, directive);\n }\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.mts new file mode 100644 index 00000000..3a2c993b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Unique enum value names + * + * A GraphQL enum type is only valid if all its values are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueEnumValueNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * enum Status { ACTIVE ACTIVE } type Query { status: Status } + * `; + * + * UniqueEnumValueNamesRule.name; // => 'UniqueEnumValueNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * enum Status { ACTIVE INACTIVE } type Query { status: Status } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueEnumValueNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts new file mode 100644 index 00000000..d2bc489b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Unique enum value names + * + * A GraphQL enum type is only valid if all its values are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueEnumValueNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * enum Status { ACTIVE ACTIVE } type Query { status: Status } + * `; + * + * UniqueEnumValueNamesRule.name; // => 'UniqueEnumValueNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * enum Status { ACTIVE INACTIVE } type Query { status: Status } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueEnumValueNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js new file mode 100644 index 00000000..5fba760c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueEnumValueNamesRule = UniqueEnumValueNamesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const definition_ts_1 = require("../../type/definition.js"); +function UniqueEnumValueNamesRule(context) { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownValueNames = new Map(); + return { + EnumTypeDefinition: checkValueUniqueness, + EnumTypeExtension: checkValueUniqueness, + }; + function checkValueUniqueness(node) { + const typeName = node.name.value; + let valueNames = knownValueNames.get(typeName); + if (valueNames == null) { + valueNames = new Map(); + knownValueNames.set(typeName, valueNames); + } + const valueNodes = node.values ?? []; + for (const valueDef of valueNodes) { + const valueName = valueDef.name.value; + const existingType = existingTypeMap[typeName]; + if ((0, definition_ts_1.isEnumType)(existingType) && existingType.getValue(valueName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, { nodes: valueDef.name })); + continue; + } + const knownValueName = valueNames.get(valueName); + if (knownValueName != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Enum value "${typeName}.${valueName}" can only be defined once.`, { nodes: [knownValueName, valueDef.name] })); + } + else { + valueNames.set(valueName, valueDef.name); + } + } + return false; + } +} +//# sourceMappingURL=UniqueEnumValueNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.map new file mode 100644 index 00000000..e52fe651 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueEnumValueNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueEnumValueNamesRule.ts"],"names":[],"mappings":";;AAwCA,4DAsDC;AA5FD,iEAA2D;AAS3D,4DAAsD;AA6BtD,SAAgB,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,eA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eAAe,QAAQ,IAAI,SAAS,6BAA6B,EACjE,EAAE,KAAK,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAC3C,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n NameNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isEnumType } from '../../type/definition.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique enum value names\n *\n * A GraphQL enum type is only valid if all its values are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueEnumValueNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * enum Status { ACTIVE ACTIVE } type Query { status: Status }\n * `;\n *\n * UniqueEnumValueNamesRule.name; // => 'UniqueEnumValueNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * enum Status { ACTIVE INACTIVE } type Query { status: Status }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueEnumValueNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownValueNames = new Map>();\n\n return {\n EnumTypeDefinition: checkValueUniqueness,\n EnumTypeExtension: checkValueUniqueness,\n };\n\n function checkValueUniqueness(\n node: EnumTypeDefinitionNode | EnumTypeExtensionNode,\n ) {\n const typeName = node.name.value;\n\n let valueNames = knownValueNames.get(typeName);\n if (valueNames == null) {\n valueNames = new Map();\n knownValueNames.set(typeName, valueNames);\n }\n\n const valueNodes = node.values ?? [];\n\n for (const valueDef of valueNodes) {\n const valueName = valueDef.name.value;\n\n const existingType = existingTypeMap[typeName];\n if (isEnumType(existingType) && existingType.getValue(valueName)) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n { nodes: valueDef.name },\n ),\n );\n continue;\n }\n\n const knownValueName = valueNames.get(valueName);\n if (knownValueName != null) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" can only be defined once.`,\n { nodes: [knownValueName, valueDef.name] },\n ),\n );\n } else {\n valueNames.set(valueName, valueDef.name);\n }\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs new file mode 100644 index 00000000..859dfe6c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs @@ -0,0 +1,37 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { isEnumType } from "../../type/definition.mjs"; +export function UniqueEnumValueNamesRule(context) { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownValueNames = new Map(); + return { + EnumTypeDefinition: checkValueUniqueness, + EnumTypeExtension: checkValueUniqueness, + }; + function checkValueUniqueness(node) { + const typeName = node.name.value; + let valueNames = knownValueNames.get(typeName); + if (valueNames == null) { + valueNames = new Map(); + knownValueNames.set(typeName, valueNames); + } + const valueNodes = node.values ?? []; + for (const valueDef of valueNodes) { + const valueName = valueDef.name.value; + const existingType = existingTypeMap[typeName]; + if (isEnumType(existingType) && existingType.getValue(valueName)) { + context.reportError(new GraphQLError(`Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, { nodes: valueDef.name })); + continue; + } + const knownValueName = valueNames.get(valueName); + if (knownValueName != null) { + context.reportError(new GraphQLError(`Enum value "${typeName}.${valueName}" can only be defined once.`, { nodes: [knownValueName, valueDef.name] })); + } + else { + valueNames.set(valueName, valueDef.name); + } + } + return false; + } +} +//# sourceMappingURL=UniqueEnumValueNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs.map new file mode 100644 index 00000000..b8e47673 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueEnumValueNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueEnumValueNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAS3D,OAAO,EAAE,UAAU,EAAE,kCAAiC;AA6BtD,MAAM,UAAU,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,eAAe,GAAG,IAAI,GAAG,EAAiC,CAAC;IAEjE,OAAO;QACL,kBAAkB,EAAE,oBAAoB;QACxC,iBAAiB,EAAE,oBAAoB;KACxC,CAAC;IAEF,SAAS,oBAAoB,CAC3B,IAAoD;QAEpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAEjC,IAAI,UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACvB,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;YACvB,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAErC,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAClC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;YAEtC,MAAM,YAAY,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YAC/C,IAAI,UAAU,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBACjE,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,eAAe,QAAQ,IAAI,SAAS,mFAAmF,EACvH,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,CACzB,CACF,CAAC;gBACF,SAAS;YACX,CAAC;YAED,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACjD,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;gBAC3B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,eAAe,QAAQ,IAAI,SAAS,6BAA6B,EACjE,EAAE,KAAK,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAC3C,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n EnumTypeDefinitionNode,\n EnumTypeExtensionNode,\n NameNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isEnumType } from '../../type/definition.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique enum value names\n *\n * A GraphQL enum type is only valid if all its values are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueEnumValueNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * enum Status { ACTIVE ACTIVE } type Query { status: Status }\n * `;\n *\n * UniqueEnumValueNamesRule.name; // => 'UniqueEnumValueNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * enum Status { ACTIVE INACTIVE } type Query { status: Status }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueEnumValueNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownValueNames = new Map>();\n\n return {\n EnumTypeDefinition: checkValueUniqueness,\n EnumTypeExtension: checkValueUniqueness,\n };\n\n function checkValueUniqueness(\n node: EnumTypeDefinitionNode | EnumTypeExtensionNode,\n ) {\n const typeName = node.name.value;\n\n let valueNames = knownValueNames.get(typeName);\n if (valueNames == null) {\n valueNames = new Map();\n knownValueNames.set(typeName, valueNames);\n }\n\n const valueNodes = node.values ?? [];\n\n for (const valueDef of valueNodes) {\n const valueName = valueDef.name.value;\n\n const existingType = existingTypeMap[typeName];\n if (isEnumType(existingType) && existingType.getValue(valueName)) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n { nodes: valueDef.name },\n ),\n );\n continue;\n }\n\n const knownValueName = valueNames.get(valueName);\n if (knownValueName != null) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" can only be defined once.`,\n { nodes: [knownValueName, valueDef.name] },\n ),\n );\n } else {\n valueNames.set(valueName, valueDef.name);\n }\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.mts new file mode 100644 index 00000000..e253d71d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Unique field definition names + * + * A GraphQL complex type is only valid if all its fields are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * type Query { name: String name: String } + * `; + * + * UniqueFieldDefinitionNamesRule.name; // => 'UniqueFieldDefinitionNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { name: String other: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueFieldDefinitionNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts new file mode 100644 index 00000000..30631c87 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Unique field definition names + * + * A GraphQL complex type is only valid if all its fields are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * type Query { name: String name: String } + * `; + * + * UniqueFieldDefinitionNamesRule.name; // => 'UniqueFieldDefinitionNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { name: String other: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueFieldDefinitionNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js new file mode 100644 index 00000000..70d401b6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueFieldDefinitionNamesRule = UniqueFieldDefinitionNamesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const definition_ts_1 = require("../../type/definition.js"); +function UniqueFieldDefinitionNamesRule(context) { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownFieldNames = new Map(); + return { + InputObjectTypeDefinition: checkFieldUniqueness, + InputObjectTypeExtension: checkFieldUniqueness, + InterfaceTypeDefinition: checkFieldUniqueness, + InterfaceTypeExtension: checkFieldUniqueness, + ObjectTypeDefinition: checkFieldUniqueness, + ObjectTypeExtension: checkFieldUniqueness, + }; + function checkFieldUniqueness(node) { + const typeName = node.name.value; + let fieldNames = knownFieldNames.get(typeName); + if (fieldNames == null) { + fieldNames = new Map(); + knownFieldNames.set(typeName, fieldNames); + } + const fieldNodes = node.fields ?? []; + for (const fieldDef of fieldNodes) { + const fieldName = fieldDef.name.value; + if (hasField(existingTypeMap[typeName], fieldName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, { nodes: fieldDef.name })); + continue; + } + const knownFieldName = fieldNames.get(fieldName); + if (knownFieldName != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Field "${typeName}.${fieldName}" can only be defined once.`, { nodes: [knownFieldName, fieldDef.name] })); + } + else { + fieldNames.set(fieldName, fieldDef.name); + } + } + return false; + } +} +function hasField(type, fieldName) { + if ((0, definition_ts_1.isObjectType)(type) || (0, definition_ts_1.isInterfaceType)(type) || (0, definition_ts_1.isInputObjectType)(type)) { + return type.getFields()[fieldName] != null; + } + return false; +} +//# sourceMappingURL=UniqueFieldDefinitionNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.map new file mode 100644 index 00000000..93036ba4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueFieldDefinitionNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueFieldDefinitionNamesRule.ts"],"names":[],"mappings":";;AA6CA,wEA4DC;AAvGD,iEAA2D;AAU3D,4DAIkC;AA6BlC,SAAgB,8BAA8B,CAC5C,OAA6B;IAE7B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,eAAe,GAA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CAAC,EAAE,CAC3C,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,IAAsB,EAAE,SAAiB;IACzD,IAAI,IAAA,4BAAY,EAAC,IAAI,CAAC,IAAI,IAAA,+BAAe,EAAC,IAAI,CAAC,IAAI,IAAA,iCAAiB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC3E,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n FieldDefinitionNode,\n InputValueDefinitionNode,\n NameNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLNamedType } from '../../type/definition.ts';\nimport {\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique field definition names\n *\n * A GraphQL complex type is only valid if all its fields are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * type Query { name: String name: String }\n * `;\n *\n * UniqueFieldDefinitionNamesRule.name; // => 'UniqueFieldDefinitionNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { name: String other: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueFieldDefinitionNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownFieldNames = new Map>();\n\n return {\n InputObjectTypeDefinition: checkFieldUniqueness,\n InputObjectTypeExtension: checkFieldUniqueness,\n InterfaceTypeDefinition: checkFieldUniqueness,\n InterfaceTypeExtension: checkFieldUniqueness,\n ObjectTypeDefinition: checkFieldUniqueness,\n ObjectTypeExtension: checkFieldUniqueness,\n };\n\n function checkFieldUniqueness(node: {\n readonly name: NameNode;\n readonly fields?:\n | ReadonlyArray\n | undefined;\n }) {\n const typeName = node.name.value;\n\n let fieldNames = knownFieldNames.get(typeName);\n if (fieldNames == null) {\n fieldNames = new Map();\n knownFieldNames.set(typeName, fieldNames);\n }\n\n const fieldNodes = node.fields ?? [];\n\n for (const fieldDef of fieldNodes) {\n const fieldName = fieldDef.name.value;\n\n if (hasField(existingTypeMap[typeName], fieldName)) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n { nodes: fieldDef.name },\n ),\n );\n continue;\n }\n\n const knownFieldName = fieldNames.get(fieldName);\n if (knownFieldName != null) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" can only be defined once.`,\n { nodes: [knownFieldName, fieldDef.name] },\n ),\n );\n } else {\n fieldNames.set(fieldName, fieldDef.name);\n }\n }\n\n return false;\n }\n}\n\nfunction hasField(type: GraphQLNamedType, fieldName: string): boolean {\n if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) {\n return type.getFields()[fieldName] != null;\n }\n return false;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs new file mode 100644 index 00000000..6064fe3d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs @@ -0,0 +1,46 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { isInputObjectType, isInterfaceType, isObjectType, } from "../../type/definition.mjs"; +export function UniqueFieldDefinitionNamesRule(context) { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownFieldNames = new Map(); + return { + InputObjectTypeDefinition: checkFieldUniqueness, + InputObjectTypeExtension: checkFieldUniqueness, + InterfaceTypeDefinition: checkFieldUniqueness, + InterfaceTypeExtension: checkFieldUniqueness, + ObjectTypeDefinition: checkFieldUniqueness, + ObjectTypeExtension: checkFieldUniqueness, + }; + function checkFieldUniqueness(node) { + const typeName = node.name.value; + let fieldNames = knownFieldNames.get(typeName); + if (fieldNames == null) { + fieldNames = new Map(); + knownFieldNames.set(typeName, fieldNames); + } + const fieldNodes = node.fields ?? []; + for (const fieldDef of fieldNodes) { + const fieldName = fieldDef.name.value; + if (hasField(existingTypeMap[typeName], fieldName)) { + context.reportError(new GraphQLError(`Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, { nodes: fieldDef.name })); + continue; + } + const knownFieldName = fieldNames.get(fieldName); + if (knownFieldName != null) { + context.reportError(new GraphQLError(`Field "${typeName}.${fieldName}" can only be defined once.`, { nodes: [knownFieldName, fieldDef.name] })); + } + else { + fieldNames.set(fieldName, fieldDef.name); + } + } + return false; + } +} +function hasField(type, fieldName) { + if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) { + return type.getFields()[fieldName] != null; + } + return false; +} +//# sourceMappingURL=UniqueFieldDefinitionNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs.map new file mode 100644 index 00000000..2f7da61c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueFieldDefinitionNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueFieldDefinitionNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAU3D,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,GACb,kCAAiC;AA6BlC,MAAM,UAAU,8BAA8B,CAC5C,OAA6B;IAE7B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,eAAe,GAAG,IAAI,GAAG,EAAiC,CAAC;IAEjE,OAAO;QACL,yBAAyB,EAAE,oBAAoB;QAC/C,wBAAwB,EAAE,oBAAoB;QAC9C,uBAAuB,EAAE,oBAAoB;QAC7C,sBAAsB,EAAE,oBAAoB;QAC5C,oBAAoB,EAAE,oBAAoB;QAC1C,mBAAmB,EAAE,oBAAoB;KAC1C,CAAC;IAEF,SAAS,oBAAoB,CAAC,IAK7B;QACC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAEjC,IAAI,UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACvB,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;YACvB,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAErC,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAClC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;YAEtC,IAAI,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;gBACnD,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,UAAU,QAAQ,IAAI,SAAS,mFAAmF,EAClH,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,CACzB,CACF,CAAC;gBACF,SAAS;YACX,CAAC;YAED,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACjD,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;gBAC3B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,UAAU,QAAQ,IAAI,SAAS,6BAA6B,EAC5D,EAAE,KAAK,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAC3C,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,IAAsB,EAAE,SAAiB;IACzD,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3E,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n FieldDefinitionNode,\n InputValueDefinitionNode,\n NameNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLNamedType } from '../../type/definition.ts';\nimport {\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique field definition names\n *\n * A GraphQL complex type is only valid if all its fields are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * type Query { name: String name: String }\n * `;\n *\n * UniqueFieldDefinitionNamesRule.name; // => 'UniqueFieldDefinitionNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { name: String other: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueFieldDefinitionNamesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownFieldNames = new Map>();\n\n return {\n InputObjectTypeDefinition: checkFieldUniqueness,\n InputObjectTypeExtension: checkFieldUniqueness,\n InterfaceTypeDefinition: checkFieldUniqueness,\n InterfaceTypeExtension: checkFieldUniqueness,\n ObjectTypeDefinition: checkFieldUniqueness,\n ObjectTypeExtension: checkFieldUniqueness,\n };\n\n function checkFieldUniqueness(node: {\n readonly name: NameNode;\n readonly fields?:\n | ReadonlyArray\n | undefined;\n }) {\n const typeName = node.name.value;\n\n let fieldNames = knownFieldNames.get(typeName);\n if (fieldNames == null) {\n fieldNames = new Map();\n knownFieldNames.set(typeName, fieldNames);\n }\n\n const fieldNodes = node.fields ?? [];\n\n for (const fieldDef of fieldNodes) {\n const fieldName = fieldDef.name.value;\n\n if (hasField(existingTypeMap[typeName], fieldName)) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n { nodes: fieldDef.name },\n ),\n );\n continue;\n }\n\n const knownFieldName = fieldNames.get(fieldName);\n if (knownFieldName != null) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" can only be defined once.`,\n { nodes: [knownFieldName, fieldDef.name] },\n ),\n );\n } else {\n fieldNames.set(fieldName, fieldDef.name);\n }\n }\n\n return false;\n }\n}\n\nfunction hasField(type: GraphQLNamedType, fieldName: string): boolean {\n if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) {\n return type.getFields()[fieldName] != null;\n }\n return false;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.mts new file mode 100644 index 00000000..e6dcdc8f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.mts @@ -0,0 +1,40 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Unique fragment names + * + * A GraphQL document is only valid if all defined fragments have unique names. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueFragmentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment A on Query { name } fragment A on Query { name } query { ...A } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueFragmentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment A on Query { name } query { ...A } + * `); + * const validErrors = validate(schema, validDocument, [UniqueFragmentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueFragmentNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts new file mode 100644 index 00000000..5fbf8824 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts @@ -0,0 +1,40 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Unique fragment names + * + * A GraphQL document is only valid if all defined fragments have unique names. + * + * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueFragmentNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * fragment A on Query { name } fragment A on Query { name } query { ...A } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueFragmentNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * fragment A on Query { name } query { ...A } + * `); + * const validErrors = validate(schema, validDocument, [UniqueFragmentNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueFragmentNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js new file mode 100644 index 00000000..6d0dc557 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueFragmentNamesRule = UniqueFragmentNamesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueFragmentNamesRule(context) { + const knownFragmentNames = new Map(); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + const fragmentName = node.name.value; + const knownFragmentName = knownFragmentNames.get(fragmentName); + if (knownFragmentName != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one fragment named "${fragmentName}".`, { nodes: [knownFragmentName, node.name] })); + } + else { + knownFragmentNames.set(fragmentName, node.name); + } + return false; + }, + }; +} +//# sourceMappingURL=UniqueFragmentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.map new file mode 100644 index 00000000..ef8a2091 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueFragmentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueFragmentNamesRule.ts"],"names":[],"mappings":";;AA6CA,0DAsBC;AAjED,iEAA2D;AA2C3D,SAAgB,uBAAuB,CACrC,OAA6B;IAE7B,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACvD,OAAO;QACL,mBAAmB,EAAE,GAAG,EAAE,CAAC,KAAK;QAChC,kBAAkB,CAAC,IAAI;YACrB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACrC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC/D,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;gBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,yCAAyC,YAAY,IAAI,EACzD,EAAE,KAAK,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAC1C,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique fragment names\n *\n * A GraphQL document is only valid if all defined fragments have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueFragmentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment A on Query { name } fragment A on Query { name } query { ...A }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueFragmentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment A on Query { name } query { ...A }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueFragmentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueFragmentNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const knownFragmentNames = new Map();\n return {\n OperationDefinition: () => false,\n FragmentDefinition(node) {\n const fragmentName = node.name.value;\n const knownFragmentName = knownFragmentNames.get(fragmentName);\n if (knownFragmentName != null) {\n context.reportError(\n new GraphQLError(\n `There can be only one fragment named \"${fragmentName}\".`,\n { nodes: [knownFragmentName, node.name] },\n ),\n );\n } else {\n knownFragmentNames.set(fragmentName, node.name);\n }\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs new file mode 100644 index 00000000..3deff2da --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs @@ -0,0 +1,19 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueFragmentNamesRule(context) { + const knownFragmentNames = new Map(); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + const fragmentName = node.name.value; + const knownFragmentName = knownFragmentNames.get(fragmentName); + if (knownFragmentName != null) { + context.reportError(new GraphQLError(`There can be only one fragment named "${fragmentName}".`, { nodes: [knownFragmentName, node.name] })); + } + else { + knownFragmentNames.set(fragmentName, node.name); + } + return false; + }, + }; +} +//# sourceMappingURL=UniqueFragmentNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs.map new file mode 100644 index 00000000..5c450ac9 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueFragmentNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueFragmentNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA2C3D,MAAM,UAAU,uBAAuB,CACrC,OAA6B;IAE7B,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACvD,OAAO;QACL,mBAAmB,EAAE,GAAG,EAAE,CAAC,KAAK;QAChC,kBAAkB,CAAC,IAAI;YACrB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACrC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC/D,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;gBAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,yCAAyC,YAAY,IAAI,EACzD,EAAE,KAAK,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAC1C,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique fragment names\n *\n * A GraphQL document is only valid if all defined fragments have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueFragmentNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * fragment A on Query { name } fragment A on Query { name } query { ...A }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueFragmentNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * fragment A on Query { name } query { ...A }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueFragmentNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueFragmentNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const knownFragmentNames = new Map();\n return {\n OperationDefinition: () => false,\n FragmentDefinition(node) {\n const fragmentName = node.name.value;\n const knownFragmentName = knownFragmentNames.get(fragmentName);\n if (knownFragmentName != null) {\n context.reportError(\n new GraphQLError(\n `There can be only one fragment named \"${fragmentName}\".`,\n { nodes: [knownFragmentName, node.name] },\n ),\n );\n } else {\n knownFragmentNames.set(fragmentName, node.name);\n }\n return false;\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.mts new file mode 100644 index 00000000..8352107c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.mts @@ -0,0 +1,47 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Unique input field names + * + * A GraphQL input object value is only valid if all supplied fields are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueInputFieldNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * input Filter { + * name: String + * } + * + * type Query { + * search(filter: Filter): String + * } + * `); + * + * const invalidDocument = parse(` + * { search(filter: { name: "a", name: "b" }) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueInputFieldNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { search(filter: { name: "a" }) } + * `); + * const validErrors = validate(schema, validDocument, [ + * UniqueInputFieldNamesRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueInputFieldNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts new file mode 100644 index 00000000..15525313 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts @@ -0,0 +1,47 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Unique input field names + * + * A GraphQL input object value is only valid if all supplied fields are + * uniquely named. + * + * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueInputFieldNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * input Filter { + * name: String + * } + * + * type Query { + * search(filter: Filter): String + * } + * `); + * + * const invalidDocument = parse(` + * { search(filter: { name: "a", name: "b" }) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueInputFieldNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { search(filter: { name: "a" }) } + * `); + * const validErrors = validate(schema, validDocument, [ + * UniqueInputFieldNamesRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueInputFieldNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js new file mode 100644 index 00000000..1133a70c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueInputFieldNamesRule = UniqueInputFieldNamesRule; +const invariant_ts_1 = require("../../jsutils/invariant.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueInputFieldNamesRule(context) { + const knownNameStack = []; + let knownNames = new Map(); + return { + ObjectValue: { + enter() { + knownNameStack.push(knownNames); + knownNames = new Map(); + }, + leave() { + const prevKnownNames = knownNameStack.pop(); + if (!(prevKnownNames != null)) + (0, invariant_ts_1.invariant)(false); + knownNames = prevKnownNames; + }, + }, + ObjectField(node) { + const fieldName = node.name.value; + const knownName = knownNames.get(fieldName); + if (knownName != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one input field named "${fieldName}".`, { nodes: [knownName, node.name] })); + } + else { + knownNames.set(fieldName, node.name); + } + }, + }; +} +//# sourceMappingURL=UniqueInputFieldNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.map new file mode 100644 index 00000000..b0a585b2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueInputFieldNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueInputFieldNamesRule.ts"],"names":[],"mappings":";;AAsDA,8DAiCC;AArFD,6DAAuD;AAEvD,iEAA2D;AAkD3D,SAAgB,yBAAyB,CACvC,OAA6B;IAE7B,MAAM,cAAc,GAAiC,EAAE,CAAC;IACxD,IAAI,UAAU,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE7C,OAAO;QACL,WAAW,EAAE;YACX,KAAK;gBACH,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAChC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;YACzB,CAAC;YACD,KAAK;gBACH,MAAM,cAAc,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;sBAClC,cAAc,IAAI,IAAI;wBAAhC,wBAAS;gBACT,UAAU,GAAG,cAAc,CAAC;YAC9B,CAAC;SACF;QACD,WAAW,CAAC,IAAI;YACd,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YAClC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;gBACtB,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,4CAA4C,SAAS,IAAI,EACzD,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAClC,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { invariant } from '../../jsutils/invariant.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique input field names\n *\n * A GraphQL input object value is only valid if all supplied fields are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueInputFieldNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * input Filter {\n * name: String\n * }\n *\n * type Query {\n * search(filter: Filter): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { search(filter: { name: \"a\", name: \"b\" }) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueInputFieldNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { search(filter: { name: \"a\" }) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * UniqueInputFieldNamesRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueInputFieldNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const knownNameStack: Array> = [];\n let knownNames = new Map();\n\n return {\n ObjectValue: {\n enter() {\n knownNameStack.push(knownNames);\n knownNames = new Map();\n },\n leave() {\n const prevKnownNames = knownNameStack.pop();\n invariant(prevKnownNames != null);\n knownNames = prevKnownNames;\n },\n },\n ObjectField(node) {\n const fieldName = node.name.value;\n const knownName = knownNames.get(fieldName);\n if (knownName != null) {\n context.reportError(\n new GraphQLError(\n `There can be only one input field named \"${fieldName}\".`,\n { nodes: [knownName, node.name] },\n ),\n );\n } else {\n knownNames.set(fieldName, node.name);\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs new file mode 100644 index 00000000..486e1d6b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs @@ -0,0 +1,31 @@ +import { invariant } from "../../jsutils/invariant.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueInputFieldNamesRule(context) { + const knownNameStack = []; + let knownNames = new Map(); + return { + ObjectValue: { + enter() { + knownNameStack.push(knownNames); + knownNames = new Map(); + }, + leave() { + const prevKnownNames = knownNameStack.pop(); + if (!(prevKnownNames != null)) + invariant(false); + knownNames = prevKnownNames; + }, + }, + ObjectField(node) { + const fieldName = node.name.value; + const knownName = knownNames.get(fieldName); + if (knownName != null) { + context.reportError(new GraphQLError(`There can be only one input field named "${fieldName}".`, { nodes: [knownName, node.name] })); + } + else { + knownNames.set(fieldName, node.name); + } + }, + }; +} +//# sourceMappingURL=UniqueInputFieldNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs.map new file mode 100644 index 00000000..946d2aa2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueInputFieldNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueInputFieldNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,oCAAmC;AAEvD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAkD3D,MAAM,UAAU,yBAAyB,CACvC,OAA6B;IAE7B,MAAM,cAAc,GAAiC,EAAE,CAAC;IACxD,IAAI,UAAU,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE7C,OAAO;QACL,WAAW,EAAE;YACX,KAAK;gBACH,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAChC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;YACzB,CAAC;YACD,KAAK;gBACH,MAAM,cAAc,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;sBAClC,cAAc,IAAI,IAAI;oBAAhC,SAAS;gBACT,UAAU,GAAG,cAAc,CAAC;YAC9B,CAAC;SACF;QACD,WAAW,CAAC,IAAI;YACd,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YAClC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;gBACtB,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,4CAA4C,SAAS,IAAI,EACzD,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAClC,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { invariant } from '../../jsutils/invariant.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique input field names\n *\n * A GraphQL input object value is only valid if all supplied fields are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueInputFieldNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * input Filter {\n * name: String\n * }\n *\n * type Query {\n * search(filter: Filter): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { search(filter: { name: \"a\", name: \"b\" }) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueInputFieldNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { search(filter: { name: \"a\" }) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * UniqueInputFieldNamesRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueInputFieldNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const knownNameStack: Array> = [];\n let knownNames = new Map();\n\n return {\n ObjectValue: {\n enter() {\n knownNameStack.push(knownNames);\n knownNames = new Map();\n },\n leave() {\n const prevKnownNames = knownNameStack.pop();\n invariant(prevKnownNames != null);\n knownNames = prevKnownNames;\n },\n },\n ObjectField(node) {\n const fieldName = node.name.value;\n const knownName = knownNames.get(fieldName);\n if (knownName != null) {\n context.reportError(\n new GraphQLError(\n `There can be only one input field named \"${fieldName}\".`,\n { nodes: [knownName, node.name] },\n ),\n );\n } else {\n knownNames.set(fieldName, node.name);\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.mts new file mode 100644 index 00000000..c092397a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.mts @@ -0,0 +1,40 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Unique operation names + * + * A GraphQL document is only valid if all defined operations have unique names. + * + * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueOperationNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query Same { name } query Same { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueOperationNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query One { name } query Two { name } + * `); + * const validErrors = validate(schema, validDocument, [UniqueOperationNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueOperationNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts new file mode 100644 index 00000000..954f7048 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts @@ -0,0 +1,40 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Unique operation names + * + * A GraphQL document is only valid if all defined operations have unique names. + * + * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueOperationNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query Same { name } query Same { name } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueOperationNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query One { name } query Two { name } + * `); + * const validErrors = validate(schema, validDocument, [UniqueOperationNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueOperationNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js new file mode 100644 index 00000000..db27a9cb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueOperationNamesRule = UniqueOperationNamesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueOperationNamesRule(context) { + const knownOperationNames = new Map(); + return { + OperationDefinition(node) { + const operationName = node.name; + if (operationName != null) { + const knownOperationName = knownOperationNames.get(operationName.value); + if (knownOperationName != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one operation named "${operationName.value}".`, { nodes: [knownOperationName, operationName] })); + } + else { + knownOperationNames.set(operationName.value, operationName); + } + } + return false; + }, + FragmentDefinition: () => false, + }; +} +//# sourceMappingURL=UniqueOperationNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.map new file mode 100644 index 00000000..78ccb5b5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueOperationNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueOperationNamesRule.ts"],"names":[],"mappings":";;AA6CA,4DAwBC;AAnED,iEAA2D;AA2C3D,SAAgB,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxD,OAAO;QACL,mBAAmB,CAAC,IAAI;YACtB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC;YAChC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBAC1B,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBACxE,IAAI,kBAAkB,IAAI,IAAI,EAAE,CAAC;oBAC/B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,0CAA0C,aAAa,CAAC,KAAK,IAAI,EACjE,EAAE,KAAK,EAAE,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAAE,CAC/C,CACF,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK;KAChC,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique operation names\n *\n * A GraphQL document is only valid if all defined operations have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueOperationNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query Same { name } query Same { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueOperationNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query One { name } query Two { name }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueOperationNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueOperationNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const knownOperationNames = new Map();\n return {\n OperationDefinition(node) {\n const operationName = node.name;\n if (operationName != null) {\n const knownOperationName = knownOperationNames.get(operationName.value);\n if (knownOperationName != null) {\n context.reportError(\n new GraphQLError(\n `There can be only one operation named \"${operationName.value}\".`,\n { nodes: [knownOperationName, operationName] },\n ),\n );\n } else {\n knownOperationNames.set(operationName.value, operationName);\n }\n }\n return false;\n },\n FragmentDefinition: () => false,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs new file mode 100644 index 00000000..20bc66c6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs @@ -0,0 +1,21 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueOperationNamesRule(context) { + const knownOperationNames = new Map(); + return { + OperationDefinition(node) { + const operationName = node.name; + if (operationName != null) { + const knownOperationName = knownOperationNames.get(operationName.value); + if (knownOperationName != null) { + context.reportError(new GraphQLError(`There can be only one operation named "${operationName.value}".`, { nodes: [knownOperationName, operationName] })); + } + else { + knownOperationNames.set(operationName.value, operationName); + } + } + return false; + }, + FragmentDefinition: () => false, + }; +} +//# sourceMappingURL=UniqueOperationNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs.map new file mode 100644 index 00000000..6dbd628f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueOperationNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueOperationNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AA2C3D,MAAM,UAAU,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxD,OAAO;QACL,mBAAmB,CAAC,IAAI;YACtB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC;YAChC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBAC1B,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBACxE,IAAI,kBAAkB,IAAI,IAAI,EAAE,CAAC;oBAC/B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,0CAA0C,aAAa,CAAC,KAAK,IAAI,EACjE,EAAE,KAAK,EAAE,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAAE,CAC/C,CACF,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,mBAAmB,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,kBAAkB,EAAE,GAAG,EAAE,CAAC,KAAK;KAChC,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique operation names\n *\n * A GraphQL document is only valid if all defined operations have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueOperationNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query Same { name } query Same { name }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueOperationNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query One { name } query Two { name }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueOperationNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueOperationNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n const knownOperationNames = new Map();\n return {\n OperationDefinition(node) {\n const operationName = node.name;\n if (operationName != null) {\n const knownOperationName = knownOperationNames.get(operationName.value);\n if (knownOperationName != null) {\n context.reportError(\n new GraphQLError(\n `There can be only one operation named \"${operationName.value}\".`,\n { nodes: [knownOperationName, operationName] },\n ),\n );\n } else {\n knownOperationNames.set(operationName.value, operationName);\n }\n }\n return false;\n },\n FragmentDefinition: () => false,\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.mts new file mode 100644 index 00000000..26a6c044 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Unique operation types + * + * A GraphQL document is only valid if it has only one type per operation. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueOperationTypesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * schema { query: Query query: Other } type Query { name: String } type Other { name: String } + * `; + * + * UniqueOperationTypesRule.name; // => 'UniqueOperationTypesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * schema { query: Query } type Query { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueOperationTypesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts new file mode 100644 index 00000000..16b45da2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Unique operation types + * + * A GraphQL document is only valid if it has only one type per operation. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueOperationTypesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * schema { query: Query query: Other } type Query { name: String } type Other { name: String } + * `; + * + * UniqueOperationTypesRule.name; // => 'UniqueOperationTypesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * schema { query: Query } type Query { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueOperationTypesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js new file mode 100644 index 00000000..d94842b5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueOperationTypesRule = UniqueOperationTypesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueOperationTypesRule(context) { + const schema = context.getSchema(); + const definedOperationTypes = new Map(); + const existingOperationTypes = schema + ? { + query: schema.getQueryType(), + mutation: schema.getMutationType(), + subscription: schema.getSubscriptionType(), + } + : {}; + return { + SchemaDefinition: checkOperationTypes, + SchemaExtension: checkOperationTypes, + }; + function checkOperationTypes(node) { + const operationTypesNodes = node.operationTypes ?? []; + for (const operationType of operationTypesNodes) { + const operation = operationType.operation; + const alreadyDefinedOperationType = definedOperationTypes.get(operation); + if (existingOperationTypes[operation]) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Type for ${operation} already defined in the schema. It cannot be redefined.`, { nodes: operationType })); + } + else if (alreadyDefinedOperationType) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one ${operation} type in schema.`, { nodes: [alreadyDefinedOperationType, operationType] })); + } + else { + definedOperationTypes.set(operation, operationType); + } + } + return false; + } +} +//# sourceMappingURL=UniqueOperationTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.map new file mode 100644 index 00000000..a445aced --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueOperationTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueOperationTypesRule.ts"],"names":[],"mappings":";;AAsCA,4DAgDC;AApFD,iEAA2D;AAoC3D,SAAgB,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAuC,CAAC;IAC7E,MAAM,sBAAsB,GAAG,MAAM;QACnC,CAAC,CAAC;YACE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE;YAC5B,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE;YAClC,YAAY,EAAE,MAAM,CAAC,mBAAmB,EAAE;SAC3C;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;QACL,gBAAgB,EAAE,mBAAmB;QACrC,eAAe,EAAE,mBAAmB;KACrC,CAAC;IAEF,SAAS,mBAAmB,CAC1B,IAAgD;QAEhD,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC;QAEtD,KAAK,MAAM,aAAa,IAAI,mBAAmB,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;YAC1C,MAAM,2BAA2B,GAAG,qBAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAEzE,IAAI,sBAAsB,CAAC,SAAS,CAAC,EAAE,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,YAAY,SAAS,yDAAyD,EAC9E,EAAE,KAAK,EAAE,aAAa,EAAE,CACzB,CACF,CAAC;YACJ,CAAC;iBAAM,IAAI,2BAA2B,EAAE,CAAC;gBACvC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,yBAAyB,SAAS,kBAAkB,EACpD,EAAE,KAAK,EAAE,CAAC,2BAA2B,EAAE,aAAa,CAAC,EAAE,CACxD,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,qBAAqB,CAAC,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n OperationTypeDefinitionNode,\n SchemaDefinitionNode,\n SchemaExtensionNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique operation types\n *\n * A GraphQL document is only valid if it has only one type per operation.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueOperationTypesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * schema { query: Query query: Other } type Query { name: String } type Other { name: String }\n * `;\n *\n * UniqueOperationTypesRule.name; // => 'UniqueOperationTypesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * schema { query: Query } type Query { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueOperationTypesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const definedOperationTypes = new Map();\n const existingOperationTypes = schema\n ? {\n query: schema.getQueryType(),\n mutation: schema.getMutationType(),\n subscription: schema.getSubscriptionType(),\n }\n : {};\n\n return {\n SchemaDefinition: checkOperationTypes,\n SchemaExtension: checkOperationTypes,\n };\n\n function checkOperationTypes(\n node: SchemaDefinitionNode | SchemaExtensionNode,\n ) {\n const operationTypesNodes = node.operationTypes ?? [];\n\n for (const operationType of operationTypesNodes) {\n const operation = operationType.operation;\n const alreadyDefinedOperationType = definedOperationTypes.get(operation);\n\n if (existingOperationTypes[operation]) {\n context.reportError(\n new GraphQLError(\n `Type for ${operation} already defined in the schema. It cannot be redefined.`,\n { nodes: operationType },\n ),\n );\n } else if (alreadyDefinedOperationType) {\n context.reportError(\n new GraphQLError(\n `There can be only one ${operation} type in schema.`,\n { nodes: [alreadyDefinedOperationType, operationType] },\n ),\n );\n } else {\n definedOperationTypes.set(operation, operationType);\n }\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs new file mode 100644 index 00000000..321173a2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs @@ -0,0 +1,34 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueOperationTypesRule(context) { + const schema = context.getSchema(); + const definedOperationTypes = new Map(); + const existingOperationTypes = schema + ? { + query: schema.getQueryType(), + mutation: schema.getMutationType(), + subscription: schema.getSubscriptionType(), + } + : {}; + return { + SchemaDefinition: checkOperationTypes, + SchemaExtension: checkOperationTypes, + }; + function checkOperationTypes(node) { + const operationTypesNodes = node.operationTypes ?? []; + for (const operationType of operationTypesNodes) { + const operation = operationType.operation; + const alreadyDefinedOperationType = definedOperationTypes.get(operation); + if (existingOperationTypes[operation]) { + context.reportError(new GraphQLError(`Type for ${operation} already defined in the schema. It cannot be redefined.`, { nodes: operationType })); + } + else if (alreadyDefinedOperationType) { + context.reportError(new GraphQLError(`There can be only one ${operation} type in schema.`, { nodes: [alreadyDefinedOperationType, operationType] })); + } + else { + definedOperationTypes.set(operation, operationType); + } + } + return false; + } +} +//# sourceMappingURL=UniqueOperationTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs.map new file mode 100644 index 00000000..e86e7bba --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueOperationTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueOperationTypesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAoC3D,MAAM,UAAU,wBAAwB,CACtC,OAA6B;IAE7B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAuC,CAAC;IAC7E,MAAM,sBAAsB,GAAG,MAAM;QACnC,CAAC,CAAC;YACE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE;YAC5B,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE;YAClC,YAAY,EAAE,MAAM,CAAC,mBAAmB,EAAE;SAC3C;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;QACL,gBAAgB,EAAE,mBAAmB;QACrC,eAAe,EAAE,mBAAmB;KACrC,CAAC;IAEF,SAAS,mBAAmB,CAC1B,IAAgD;QAEhD,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC;QAEtD,KAAK,MAAM,aAAa,IAAI,mBAAmB,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;YAC1C,MAAM,2BAA2B,GAAG,qBAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAEzE,IAAI,sBAAsB,CAAC,SAAS,CAAC,EAAE,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,YAAY,SAAS,yDAAyD,EAC9E,EAAE,KAAK,EAAE,aAAa,EAAE,CACzB,CACF,CAAC;YACJ,CAAC;iBAAM,IAAI,2BAA2B,EAAE,CAAC;gBACvC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,yBAAyB,SAAS,kBAAkB,EACpD,EAAE,KAAK,EAAE,CAAC,2BAA2B,EAAE,aAAa,CAAC,EAAE,CACxD,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,qBAAqB,CAAC,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type {\n OperationTypeDefinitionNode,\n SchemaDefinitionNode,\n SchemaExtensionNode,\n} from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique operation types\n *\n * A GraphQL document is only valid if it has only one type per operation.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueOperationTypesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * schema { query: Query query: Other } type Query { name: String } type Other { name: String }\n * `;\n *\n * UniqueOperationTypesRule.name; // => 'UniqueOperationTypesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * schema { query: Query } type Query { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueOperationTypesRule(\n context: SDLValidationContext,\n): ASTVisitor {\n const schema = context.getSchema();\n const definedOperationTypes = new Map();\n const existingOperationTypes = schema\n ? {\n query: schema.getQueryType(),\n mutation: schema.getMutationType(),\n subscription: schema.getSubscriptionType(),\n }\n : {};\n\n return {\n SchemaDefinition: checkOperationTypes,\n SchemaExtension: checkOperationTypes,\n };\n\n function checkOperationTypes(\n node: SchemaDefinitionNode | SchemaExtensionNode,\n ) {\n const operationTypesNodes = node.operationTypes ?? [];\n\n for (const operationType of operationTypesNodes) {\n const operation = operationType.operation;\n const alreadyDefinedOperationType = definedOperationTypes.get(operation);\n\n if (existingOperationTypes[operation]) {\n context.reportError(\n new GraphQLError(\n `Type for ${operation} already defined in the schema. It cannot be redefined.`,\n { nodes: operationType },\n ),\n );\n } else if (alreadyDefinedOperationType) {\n context.reportError(\n new GraphQLError(\n `There can be only one ${operation} type in schema.`,\n { nodes: [alreadyDefinedOperationType, operationType] },\n ),\n );\n } else {\n definedOperationTypes.set(operation, operationType);\n }\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.mts new file mode 100644 index 00000000..84c7dd7a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.mts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { SDLValidationContext } from "../ValidationContext.mjs"; +/** + * Unique type names + * + * A GraphQL document is only valid if all defined types have unique names. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueTypeNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * type Query { name: String } type Query { other: String } + * `; + * + * UniqueTypeNamesRule.name; // => 'UniqueTypeNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { name: String } type Other { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueTypeNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts new file mode 100644 index 00000000..28e91861 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts @@ -0,0 +1,29 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { SDLValidationContext } from "../ValidationContext.js"; +/** + * Unique type names + * + * A GraphQL document is only valid if all defined types have unique names. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema } from 'graphql'; + * import { UniqueTypeNamesRule } from 'graphql/validation'; + * + * const invalidSDL = ` + * type Query { name: String } type Query { other: String } + * `; + * + * UniqueTypeNamesRule.name; // => 'UniqueTypeNamesRule' + * buildSchema(invalidSDL); // throws an error + * + * const validSDL = ` + * type Query { name: String } type Other { name: String } + * `; + * + * buildSchema(validSDL); // does not throw + * ``` + */ +export declare function UniqueTypeNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js new file mode 100644 index 00000000..26d9c32b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueTypeNamesRule = UniqueTypeNamesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueTypeNamesRule(context) { + const knownTypeNames = new Map(); + const schema = context.getSchema(); + return { + ScalarTypeDefinition: checkTypeName, + ObjectTypeDefinition: checkTypeName, + InterfaceTypeDefinition: checkTypeName, + UnionTypeDefinition: checkTypeName, + EnumTypeDefinition: checkTypeName, + InputObjectTypeDefinition: checkTypeName, + }; + function checkTypeName(node) { + const typeName = node.name.value; + if (schema?.getType(typeName)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, { nodes: node.name })); + return; + } + const knownNameNode = knownTypeNames.get(typeName); + if (knownNameNode != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one type named "${typeName}".`, { + nodes: [knownNameNode, node.name], + })); + } + else { + knownTypeNames.set(typeName, node.name); + } + return false; + } +} +//# sourceMappingURL=UniqueTypeNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.map new file mode 100644 index 00000000..ab3fc15b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueTypeNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueTypeNamesRule.ts"],"names":[],"mappings":";;AAkCA,kDAuCC;AAvED,iEAA2D;AAgC3D,SAAgB,mBAAmB,CAAC,OAA6B;IAC/D,MAAM,cAAc,GAAG,IAAI,GAAG,EAAoB,CAAC;IACnD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAEnC,OAAO;QACL,oBAAoB,EAAE,aAAa;QACnC,oBAAoB,EAAE,aAAa;QACnC,uBAAuB,EAAE,aAAa;QACtC,mBAAmB,EAAE,aAAa;QAClC,kBAAkB,EAAE,aAAa;QACjC,yBAAyB,EAAE,aAAa;KACzC,CAAC;IAEF,SAAS,aAAa,CAAC,IAAwB;QAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAEjC,IAAI,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,SAAS,QAAQ,oFAAoF,EACrG,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CACrB,CACF,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CAAC,qCAAqC,QAAQ,IAAI,EAAE;gBAClE,KAAK,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC;aAClC,CAAC,CACH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode, TypeDefinitionNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique type names\n *\n * A GraphQL document is only valid if all defined types have unique names.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueTypeNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * type Query { name: String } type Query { other: String }\n * `;\n *\n * UniqueTypeNamesRule.name; // => 'UniqueTypeNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { name: String } type Other { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueTypeNamesRule(context: SDLValidationContext): ASTVisitor {\n const knownTypeNames = new Map();\n const schema = context.getSchema();\n\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName,\n };\n\n function checkTypeName(node: TypeDefinitionNode) {\n const typeName = node.name.value;\n\n if (schema?.getType(typeName)) {\n context.reportError(\n new GraphQLError(\n `Type \"${typeName}\" already exists in the schema. It cannot also be defined in this type definition.`,\n { nodes: node.name },\n ),\n );\n return;\n }\n\n const knownNameNode = knownTypeNames.get(typeName);\n if (knownNameNode != null) {\n context.reportError(\n new GraphQLError(`There can be only one type named \"${typeName}\".`, {\n nodes: [knownNameNode, node.name],\n }),\n );\n } else {\n knownTypeNames.set(typeName, node.name);\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs new file mode 100644 index 00000000..12bb1b46 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs @@ -0,0 +1,31 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueTypeNamesRule(context) { + const knownTypeNames = new Map(); + const schema = context.getSchema(); + return { + ScalarTypeDefinition: checkTypeName, + ObjectTypeDefinition: checkTypeName, + InterfaceTypeDefinition: checkTypeName, + UnionTypeDefinition: checkTypeName, + EnumTypeDefinition: checkTypeName, + InputObjectTypeDefinition: checkTypeName, + }; + function checkTypeName(node) { + const typeName = node.name.value; + if (schema?.getType(typeName)) { + context.reportError(new GraphQLError(`Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, { nodes: node.name })); + return; + } + const knownNameNode = knownTypeNames.get(typeName); + if (knownNameNode != null) { + context.reportError(new GraphQLError(`There can be only one type named "${typeName}".`, { + nodes: [knownNameNode, node.name], + })); + } + else { + knownTypeNames.set(typeName, node.name); + } + return false; + } +} +//# sourceMappingURL=UniqueTypeNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs.map new file mode 100644 index 00000000..833fe418 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueTypeNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueTypeNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAgC3D,MAAM,UAAU,mBAAmB,CAAC,OAA6B;IAC/D,MAAM,cAAc,GAAG,IAAI,GAAG,EAAoB,CAAC;IACnD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAEnC,OAAO;QACL,oBAAoB,EAAE,aAAa;QACnC,oBAAoB,EAAE,aAAa;QACnC,uBAAuB,EAAE,aAAa;QACtC,mBAAmB,EAAE,aAAa;QAClC,kBAAkB,EAAE,aAAa;QACjC,yBAAyB,EAAE,aAAa;KACzC,CAAC;IAEF,SAAS,aAAa,CAAC,IAAwB;QAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAEjC,IAAI,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,SAAS,QAAQ,oFAAoF,EACrG,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CACrB,CACF,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CAAC,qCAAqC,QAAQ,IAAI,EAAE;gBAClE,KAAK,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC;aAClC,CAAC,CACH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { NameNode, TypeDefinitionNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { SDLValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique type names\n *\n * A GraphQL document is only valid if all defined types have unique names.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema } from 'graphql';\n * import { UniqueTypeNamesRule } from 'graphql/validation';\n *\n * const invalidSDL = `\n * type Query { name: String } type Query { other: String }\n * `;\n *\n * UniqueTypeNamesRule.name; // => 'UniqueTypeNamesRule'\n * buildSchema(invalidSDL); // throws an error\n *\n * const validSDL = `\n * type Query { name: String } type Other { name: String }\n * `;\n *\n * buildSchema(validSDL); // does not throw\n * ```\n */\nexport function UniqueTypeNamesRule(context: SDLValidationContext): ASTVisitor {\n const knownTypeNames = new Map();\n const schema = context.getSchema();\n\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName,\n };\n\n function checkTypeName(node: TypeDefinitionNode) {\n const typeName = node.name.value;\n\n if (schema?.getType(typeName)) {\n context.reportError(\n new GraphQLError(\n `Type \"${typeName}\" already exists in the schema. It cannot also be defined in this type definition.`,\n { nodes: node.name },\n ),\n );\n return;\n }\n\n const knownNameNode = knownTypeNames.get(typeName);\n if (knownNameNode != null) {\n context.reportError(\n new GraphQLError(`There can be only one type named \"${typeName}\".`, {\n nodes: [knownNameNode, node.name],\n }),\n );\n } else {\n knownTypeNames.set(typeName, node.name);\n }\n\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.mts new file mode 100644 index 00000000..9d3c9230 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.mts @@ -0,0 +1,38 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ASTValidationContext } from "../ValidationContext.mjs"; +/** + * Unique variable names + * + * A GraphQL operation is only valid if all its variables are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueVariableNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: ID, $id: ID) { field(arg: $id) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueVariableNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [UniqueVariableNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueVariableNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts new file mode 100644 index 00000000..5f062256 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts @@ -0,0 +1,38 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ASTValidationContext } from "../ValidationContext.js"; +/** + * Unique variable names + * + * A GraphQL operation is only valid if all its variables are uniquely named. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { UniqueVariableNamesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: ID, $id: ID) { field(arg: $id) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * UniqueVariableNamesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [UniqueVariableNamesRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function UniqueVariableNamesRule(context: ASTValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js new file mode 100644 index 00000000..4da80623 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UniqueVariableNamesRule = UniqueVariableNamesRule; +const groupBy_ts_1 = require("../../jsutils/groupBy.js"); +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +function UniqueVariableNamesRule(context) { + return { + OperationDefinition(operationNode) { + const variableDefinitions = operationNode.variableDefinitions ?? []; + const seenVariableDefinitions = (0, groupBy_ts_1.groupBy)(variableDefinitions, (node) => node.variable.name.value); + for (const [variableName, variableNodes] of seenVariableDefinitions) { + if (variableNodes.length > 1) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`There can be only one variable named "$${variableName}".`, { nodes: variableNodes.map((node) => node.variable.name) })); + } + } + }, + }; +} +//# sourceMappingURL=UniqueVariableNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.map new file mode 100644 index 00000000..97fdaf56 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueVariableNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueVariableNamesRule.ts"],"names":[],"mappings":";;AA4CA,0DAwBC;AAlED,yDAAmD;AAEnD,iEAA2D;AAwC3D,SAAgB,uBAAuB,CACrC,OAA6B;IAE7B,OAAO;QACL,mBAAmB,CAAC,aAAa;YAC/B,MAAM,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,IAAI,EAAE,CAAC;YAEpE,MAAM,uBAAuB,GAAG,IAAA,oBAAO,EACrC,mBAAmB,EACnB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CACnC,CAAC;YAEF,KAAK,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,IAAI,uBAAuB,EAAE,CAAC;gBACpE,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC7B,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,0CAA0C,YAAY,IAAI,EAC1D,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAC3D,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { groupBy } from '../../jsutils/groupBy.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique variable names\n *\n * A GraphQL operation is only valid if all its variables are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueVariableNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: ID, $id: ID) { field(arg: $id) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueVariableNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueVariableNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueVariableNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(operationNode) {\n const variableDefinitions = operationNode.variableDefinitions ?? [];\n\n const seenVariableDefinitions = groupBy(\n variableDefinitions,\n (node) => node.variable.name.value,\n );\n\n for (const [variableName, variableNodes] of seenVariableDefinitions) {\n if (variableNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one variable named \"$${variableName}\".`,\n { nodes: variableNodes.map((node) => node.variable.name) },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs new file mode 100644 index 00000000..eb08edf6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs @@ -0,0 +1,16 @@ +import { groupBy } from "../../jsutils/groupBy.mjs"; +import { GraphQLError } from "../../error/GraphQLError.mjs"; +export function UniqueVariableNamesRule(context) { + return { + OperationDefinition(operationNode) { + const variableDefinitions = operationNode.variableDefinitions ?? []; + const seenVariableDefinitions = groupBy(variableDefinitions, (node) => node.variable.name.value); + for (const [variableName, variableNodes] of seenVariableDefinitions) { + if (variableNodes.length > 1) { + context.reportError(new GraphQLError(`There can be only one variable named "$${variableName}".`, { nodes: variableNodes.map((node) => node.variable.name) })); + } + } + }, + }; +} +//# sourceMappingURL=UniqueVariableNamesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs.map new file mode 100644 index 00000000..f0d8b08c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"UniqueVariableNamesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/UniqueVariableNamesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kCAAiC;AAEnD,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAwC3D,MAAM,UAAU,uBAAuB,CACrC,OAA6B;IAE7B,OAAO;QACL,mBAAmB,CAAC,aAAa;YAC/B,MAAM,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,IAAI,EAAE,CAAC;YAEpE,MAAM,uBAAuB,GAAG,OAAO,CACrC,mBAAmB,EACnB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CACnC,CAAC;YAEF,KAAK,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,IAAI,uBAAuB,EAAE,CAAC;gBACpE,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC7B,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,0CAA0C,YAAY,IAAI,EAC1D,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAC3D,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { groupBy } from '../../jsutils/groupBy.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { ASTValidationContext } from '../ValidationContext.ts';\n\n/**\n * Unique variable names\n *\n * A GraphQL operation is only valid if all its variables are uniquely named.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { UniqueVariableNamesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: ID, $id: ID) { field(arg: $id) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * UniqueVariableNamesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [UniqueVariableNamesRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function UniqueVariableNamesRule(\n context: ASTValidationContext,\n): ASTVisitor {\n return {\n OperationDefinition(operationNode) {\n const variableDefinitions = operationNode.variableDefinitions ?? [];\n\n const seenVariableDefinitions = groupBy(\n variableDefinitions,\n (node) => node.variable.name.value,\n );\n\n for (const [variableName, variableNodes] of seenVariableDefinitions) {\n if (variableNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one variable named \"$${variableName}\".`,\n { nodes: variableNodes.map((node) => node.variable.name) },\n ),\n );\n }\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.mts new file mode 100644 index 00000000..9c8e899a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.mts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + * + * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ValuesOfCorrectTypeRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * count(limit: Int): Int + * } + * `); + * + * const invalidDocument = parse(` + * { count(limit: "many") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * ValuesOfCorrectTypeRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { count(limit: 1) } + * `); + * const validErrors = validate(schema, validDocument, [ValuesOfCorrectTypeRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function ValuesOfCorrectTypeRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts new file mode 100644 index 00000000..9d8afdc1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts @@ -0,0 +1,41 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + * + * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { ValuesOfCorrectTypeRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * count(limit: Int): Int + * } + * `); + * + * const invalidDocument = parse(` + * { count(limit: "many") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * ValuesOfCorrectTypeRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { count(limit: 1) } + * `); + * const validErrors = validate(schema, validDocument, [ValuesOfCorrectTypeRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function ValuesOfCorrectTypeRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js new file mode 100644 index 00000000..5e7b23a5 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValuesOfCorrectTypeRule = ValuesOfCorrectTypeRule; +const validateInputValue_ts_1 = require("../../utilities/validateInputValue.js"); +function ValuesOfCorrectTypeRule(context) { + return { + NullValue: (node) => isValidValueNode(context, node, context.getInputType()), + ListValue: (node) => isValidValueNode(context, node, context.getParentInputType()), + ObjectValue: (node) => isValidValueNode(context, node, context.getInputType()), + EnumValue: (node) => isValidValueNode(context, node, context.getInputType()), + IntValue: (node) => isValidValueNode(context, node, context.getInputType()), + FloatValue: (node) => isValidValueNode(context, node, context.getInputType()), + StringValue: (node) => isValidValueNode(context, node, context.getInputType()), + BooleanValue: (node) => isValidValueNode(context, node, context.getInputType()), + }; +} +function isValidValueNode(context, node, inputType) { + if (inputType) { + (0, validateInputValue_ts_1.validateInputLiteral)(node, inputType, (error) => { + context.reportError(error); + }, undefined, undefined, context.hideSuggestions); + } + return false; +} +//# sourceMappingURL=ValuesOfCorrectTypeRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.map new file mode 100644 index 00000000..6430d20f --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ValuesOfCorrectTypeRule.js","sourceRoot":"","sources":["../../../src/validation/rules/ValuesOfCorrectTypeRule.ts"],"names":[],"mappings":";;AAkDA,0DA2BC;AApED,iFAA6E;AAyC7E,SAAgB,uBAAuB,CACrC,OAA0B;IAE1B,OAAO;QACL,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAClB,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;QACzD,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAGlB,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC/D,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CACpB,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;QACzD,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAClB,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;QACzD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;QAC3E,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CACnB,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;QAMzD,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CACpB,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;QACzD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CACrB,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC;AAQD,SAAS,gBAAgB,CACvB,OAA0B,EAC1B,IAAe,EACf,SAAkC;IAElC,IAAI,SAAS,EAAE,CAAC;QACd,IAAA,4CAAoB,EAClB,IAAI,EACJ,SAAS,EACT,CAAC,KAAK,EAAE,EAAE;YACR,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,EACD,SAAS,EACT,SAAS,EACT,OAAO,CAAC,eAAe,CACxB,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport type { ValueNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLInputType } from '../../type/index.ts';\n\nimport { validateInputLiteral } from '../../utilities/validateInputValue.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Value literals of correct type\n *\n * A GraphQL document is only valid if all value literals are of the type\n * expected at their position.\n *\n * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ValuesOfCorrectTypeRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * count(limit: Int): Int\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { count(limit: \"many\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * ValuesOfCorrectTypeRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { count(limit: 1) }\n * `);\n * const validErrors = validate(schema, validDocument, [ValuesOfCorrectTypeRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ValuesOfCorrectTypeRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n NullValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n ListValue: (node) =>\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n isValidValueNode(context, node, context.getParentInputType()),\n ObjectValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n EnumValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n IntValue: (node) => isValidValueNode(context, node, context.getInputType()),\n FloatValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n // Descriptions are string values that would not validate according\n // to the below logic, but since (per the specification) descriptions must\n // not affect validation, they are ignored entirely when visiting the AST\n // and do not require special handling.\n // See https://spec.graphql.org/draft/#sec-Descriptions\n StringValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n BooleanValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n };\n}\n\n/**\n * Any value literal may be a valid representation of a Scalar, depending on\n * that scalar type.\n *\n * @internal\n */\nfunction isValidValueNode(\n context: ValidationContext,\n node: ValueNode,\n inputType: Maybe,\n): false {\n if (inputType) {\n validateInputLiteral(\n node,\n inputType,\n (error) => {\n context.reportError(error);\n },\n undefined,\n undefined,\n context.hideSuggestions,\n );\n }\n return false;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs new file mode 100644 index 00000000..34e834e0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs @@ -0,0 +1,22 @@ +import { validateInputLiteral } from "../../utilities/validateInputValue.mjs"; +export function ValuesOfCorrectTypeRule(context) { + return { + NullValue: (node) => isValidValueNode(context, node, context.getInputType()), + ListValue: (node) => isValidValueNode(context, node, context.getParentInputType()), + ObjectValue: (node) => isValidValueNode(context, node, context.getInputType()), + EnumValue: (node) => isValidValueNode(context, node, context.getInputType()), + IntValue: (node) => isValidValueNode(context, node, context.getInputType()), + FloatValue: (node) => isValidValueNode(context, node, context.getInputType()), + StringValue: (node) => isValidValueNode(context, node, context.getInputType()), + BooleanValue: (node) => isValidValueNode(context, node, context.getInputType()), + }; +} +function isValidValueNode(context, node, inputType) { + if (inputType) { + validateInputLiteral(node, inputType, (error) => { + context.reportError(error); + }, undefined, undefined, context.hideSuggestions); + } + return false; +} +//# sourceMappingURL=ValuesOfCorrectTypeRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs.map new file mode 100644 index 00000000..01ac3e6c --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs.map @@ -0,0 +1 @@ +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SAAS,EAAE,CAAC;QACd,oBAAoB,CAClB,IAAI,EACJ,SAAS,EACT,CAAC,KAAK,EAAE,EAAE;YACR,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,EACD,SAAS,EACT,SAAS,EACT,OAAO,CAAC,eAAe,CACxB,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport type { ValueNode } from '../../language/ast.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLInputType } from '../../type/index.ts';\n\nimport { validateInputLiteral } from '../../utilities/validateInputValue.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Value literals of correct type\n *\n * A GraphQL document is only valid if all value literals are of the type\n * expected at their position.\n *\n * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { ValuesOfCorrectTypeRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * count(limit: Int): Int\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { count(limit: \"many\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * ValuesOfCorrectTypeRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { count(limit: 1) }\n * `);\n * const validErrors = validate(schema, validDocument, [ValuesOfCorrectTypeRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function ValuesOfCorrectTypeRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n NullValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n ListValue: (node) =>\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n isValidValueNode(context, node, context.getParentInputType()),\n ObjectValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n EnumValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n IntValue: (node) => isValidValueNode(context, node, context.getInputType()),\n FloatValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n // Descriptions are string values that would not validate according\n // to the below logic, but since (per the specification) descriptions must\n // not affect validation, they are ignored entirely when visiting the AST\n // and do not require special handling.\n // See https://spec.graphql.org/draft/#sec-Descriptions\n StringValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n BooleanValue: (node) =>\n isValidValueNode(context, node, context.getInputType()),\n };\n}\n\n/**\n * Any value literal may be a valid representation of a Scalar, depending on\n * that scalar type.\n *\n * @internal\n */\nfunction isValidValueNode(\n context: ValidationContext,\n node: ValueNode,\n inputType: Maybe,\n): false {\n if (inputType) {\n validateInputLiteral(\n node,\n inputType,\n (error) => {\n context.reportError(error);\n },\n undefined,\n undefined,\n context.hideSuggestions,\n );\n }\n return false;\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.mts new file mode 100644 index 00000000..6e0e6d74 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.mts @@ -0,0 +1,47 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Variables are input types + * + * A GraphQL operation is only valid if all the variables it defines are of + * input types (scalar, enum, or input object). + * + * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { VariablesAreInputTypesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * } + * + * type User { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query ($user: User) { field(arg: "1") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * VariablesAreInputTypesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [ + * VariablesAreInputTypesRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function VariablesAreInputTypesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts new file mode 100644 index 00000000..d1ca8709 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts @@ -0,0 +1,47 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Variables are input types + * + * A GraphQL operation is only valid if all the variables it defines are of + * input types (scalar, enum, or input object). + * + * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { VariablesAreInputTypesRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID): String + * } + * + * type User { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * query ($user: User) { field(arg: "1") } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * VariablesAreInputTypesRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [ + * VariablesAreInputTypesRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function VariablesAreInputTypesRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js new file mode 100644 index 00000000..1f7d3a6b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariablesAreInputTypesRule = VariablesAreInputTypesRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const printer_ts_1 = require("../../language/printer.js"); +const definition_ts_1 = require("../../type/definition.js"); +const typeFromAST_ts_1 = require("../../utilities/typeFromAST.js"); +function VariablesAreInputTypesRule(context) { + return { + VariableDefinition(node) { + const type = (0, typeFromAST_ts_1.typeFromAST)(context.getSchema(), node.type); + if (type !== undefined && !(0, definition_ts_1.isInputType)(type)) { + const variableName = node.variable.name.value; + const typeName = (0, printer_ts_1.print)(node.type); + context.reportError(new GraphQLError_ts_1.GraphQLError(`Variable "$${variableName}" cannot be non-input type "${typeName}".`, { nodes: node.type })); + } + }, + }; +} +//# sourceMappingURL=VariablesAreInputTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.map new file mode 100644 index 00000000..dee50361 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"VariablesAreInputTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/VariablesAreInputTypesRule.ts"],"names":[],"mappings":";;AAyDA,gEAoBC;AA3ED,iEAA2D;AAG3D,0DAAkD;AAGlD,4DAAuD;AAEvD,mEAA6D;AA+C7D,SAAgB,0BAA0B,CACxC,OAA0B;IAE1B,OAAO;QACL,kBAAkB,CAAC,IAA4B;YAC7C,MAAM,IAAI,GAAG,IAAA,4BAAW,EAAC,OAAO,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAEzD,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,IAAA,2BAAW,EAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC9C,MAAM,QAAQ,GAAG,IAAA,kBAAK,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAElC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,cAAc,YAAY,+BAA+B,QAAQ,IAAI,EACrE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CACrB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { VariableDefinitionNode } from '../../language/ast.ts';\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isInputType } from '../../type/definition.ts';\n\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Variables are input types\n *\n * A GraphQL operation is only valid if all the variables it defines are of\n * input types (scalar, enum, or input object).\n *\n * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { VariablesAreInputTypesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * }\n *\n * type User {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($user: User) { field(arg: \"1\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * VariablesAreInputTypesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * VariablesAreInputTypesRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function VariablesAreInputTypesRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n VariableDefinition(node: VariableDefinitionNode) {\n const type = typeFromAST(context.getSchema(), node.type);\n\n if (type !== undefined && !isInputType(type)) {\n const variableName = node.variable.name.value;\n const typeName = print(node.type);\n\n context.reportError(\n new GraphQLError(\n `Variable \"$${variableName}\" cannot be non-input type \"${typeName}\".`,\n { nodes: node.type },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs new file mode 100644 index 00000000..3d0b70d7 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs @@ -0,0 +1,17 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { print } from "../../language/printer.mjs"; +import { isInputType } from "../../type/definition.mjs"; +import { typeFromAST } from "../../utilities/typeFromAST.mjs"; +export function VariablesAreInputTypesRule(context) { + return { + VariableDefinition(node) { + const type = typeFromAST(context.getSchema(), node.type); + if (type !== undefined && !isInputType(type)) { + const variableName = node.variable.name.value; + const typeName = print(node.type); + context.reportError(new GraphQLError(`Variable "$${variableName}" cannot be non-input type "${typeName}".`, { nodes: node.type })); + } + }, + }; +} +//# sourceMappingURL=VariablesAreInputTypesRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs.map new file mode 100644 index 00000000..2ac38c04 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"VariablesAreInputTypesRule.js","sourceRoot":"","sources":["../../../src/validation/rules/VariablesAreInputTypesRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,KAAK,EAAE,mCAAkC;AAGlD,OAAO,EAAE,WAAW,EAAE,kCAAiC;AAEvD,OAAO,EAAE,WAAW,EAAE,wCAAuC;AA+C7D,MAAM,UAAU,0BAA0B,CACxC,OAA0B;IAE1B,OAAO;QACL,kBAAkB,CAAC,IAA4B;YAC7C,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAEzD,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC9C,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAElC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,cAAc,YAAY,+BAA+B,QAAQ,IAAI,EACrE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CACrB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { VariableDefinitionNode } from '../../language/ast.ts';\nimport { print } from '../../language/printer.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport { isInputType } from '../../type/definition.ts';\n\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Variables are input types\n *\n * A GraphQL operation is only valid if all the variables it defines are of\n * input types (scalar, enum, or input object).\n *\n * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { VariablesAreInputTypesRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID): String\n * }\n *\n * type User {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($user: User) { field(arg: \"1\") }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * VariablesAreInputTypesRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * VariablesAreInputTypesRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function VariablesAreInputTypesRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n VariableDefinition(node: VariableDefinitionNode) {\n const type = typeFromAST(context.getSchema(), node.type);\n\n if (type !== undefined && !isInputType(type)) {\n const variableName = node.variable.name.value;\n const typeName = print(node.type);\n\n context.reportError(\n new GraphQLError(\n `Variable \"$${variableName}\" cannot be non-input type \"${typeName}\".`,\n { nodes: node.type },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.mts new file mode 100644 index 00000000..5f4f877b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.mts @@ -0,0 +1,42 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.mjs"; +import type { ValidationContext } from "../ValidationContext.mjs"; +/** + * Variables in allowed position + * + * Variable usages must be compatible with the arguments they are passed to. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { VariablesInAllowedPositionRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID!): String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: String) { field(arg: $id) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * VariablesInAllowedPositionRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID!) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [ + * VariablesInAllowedPositionRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function VariablesInAllowedPositionRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts new file mode 100644 index 00000000..51d9a8d6 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts @@ -0,0 +1,42 @@ +/** @category Validation Rules */ +import type { ASTVisitor } from "../../language/visitor.js"; +import type { ValidationContext } from "../ValidationContext.js"; +/** + * Variables in allowed position + * + * Variable usages must be compatible with the arguments they are passed to. + * + * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { VariablesInAllowedPositionRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * field(arg: ID!): String + * } + * `); + * + * const invalidDocument = parse(` + * query ($id: String) { field(arg: $id) } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * VariablesInAllowedPositionRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * query ($id: ID!) { field(arg: $id) } + * `); + * const validErrors = validate(schema, validDocument, [ + * VariablesInAllowedPositionRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function VariablesInAllowedPositionRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js new file mode 100644 index 00000000..f94ee41d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariablesInAllowedPositionRule = VariablesInAllowedPositionRule; +const GraphQLError_ts_1 = require("../../error/GraphQLError.js"); +const kinds_ts_1 = require("../../language/kinds.js"); +const definition_ts_1 = require("../../type/definition.js"); +const typeComparators_ts_1 = require("../../utilities/typeComparators.js"); +const typeFromAST_ts_1 = require("../../utilities/typeFromAST.js"); +function VariablesInAllowedPositionRule(context) { + let varDefMap; + return { + OperationDefinition: { + enter() { + varDefMap = new Map(); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + for (const { node, type, parentType, defaultValue, fragmentVariableDefinition, } of usages) { + const varName = node.name.value; + let varDef = fragmentVariableDefinition; + varDef ??= varDefMap.get(varName); + if (varDef && type) { + const schema = context.getSchema(); + const varType = (0, typeFromAST_ts_1.typeFromAST)(schema, varDef.type); + if (varType && + !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Variable "$${varName}" of type "${varType}" used in position expecting type "${type}".`, { nodes: [varDef, node] })); + } + if ((0, definition_ts_1.isInputObjectType)(parentType) && + parentType.isOneOf && + (0, definition_ts_1.isNullableType)(varType)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`Variable "$${varName}" is of type "${varType}" but must be non-nullable to be used for OneOf Input Object "${parentType}".`, { nodes: [varDef, node] })); + } + } + } + }, + }, + VariableDefinition(node) { + varDefMap.set(node.variable.name.value, node); + }, + }; +} +function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { + if ((0, definition_ts_1.isNonNullType)(locationType) && !(0, definition_ts_1.isNonNullType)(varType)) { + const hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== kinds_ts_1.Kind.NULL; + const hasLocationDefaultValue = locationDefaultValue !== undefined; + if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { + return false; + } + const nullableLocationType = locationType.ofType; + return (0, typeComparators_ts_1.isTypeSubTypeOf)(schema, varType, nullableLocationType); + } + return (0, typeComparators_ts_1.isTypeSubTypeOf)(schema, varType, locationType); +} +//# sourceMappingURL=VariablesInAllowedPositionRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.map new file mode 100644 index 00000000..988fbb52 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"VariablesInAllowedPositionRule.js","sourceRoot":"","sources":["../../../src/validation/rules/VariablesInAllowedPositionRule.ts"],"names":[],"mappings":";;AA6DA,wEAsEC;AA/HD,iEAA2D;AAG3D,sDAA+C;AAI/C,4DAIkC;AAGlC,2EAAqE;AACrE,mEAA6D;AA0C7D,SAAgB,8BAA8B,CAC5C,OAA0B;IAE1B,IAAI,SAA8C,CAAC;IAEnD,OAAO;QAC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,CAAC;wBACJ,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;SACF;QACD,kBAAkB,CAAC,IAAI;YACrB,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;KACF,CAAC;AACJ,CAAC;AAYD,SAAS,oBAAoB,CAC3B,MAAqB,EACrB,OAAoB,EACpB,eAAiC,EACjC,YAAyB,EACzB,oBAA6B;IAE7B,IAAI,IAAA,6BAAa,EAAC,YAAY,CAAC,IAAI,CAAC,IAAA,6BAAa,EAAC,OAAO,CAAC,EAAE,CAAC;QAC3D,MAAM,8BAA8B,GAClC,eAAe,IAAI,IAAI,IAAI,eAAe,CAAC,IAAI,KAAK,eAAI,CAAC,IAAI,CAAC;QAChE,MAAM,uBAAuB,GAAG,oBAAoB,KAAK,SAAS,CAAC;QACnE,IAAI,CAAC,8BAA8B,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAChE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,oBAAoB,GAAG,YAAY,CAAC,MAAM,CAAC;QACjD,OAAO,IAAA,oCAAe,EAAC,MAAM,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,IAAA,oCAAe,EAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;AACxD,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ValueNode, VariableDefinitionNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLType } from '../../type/definition.ts';\nimport {\n isInputObjectType,\n isNonNullType,\n isNullableType,\n} from '../../type/definition.ts';\nimport type { GraphQLSchema } from '../../type/schema.ts';\n\nimport { isTypeSubTypeOf } from '../../utilities/typeComparators.ts';\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Variables in allowed position\n *\n * Variable usages must be compatible with the arguments they are passed to.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { VariablesInAllowedPositionRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID!): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: String) { field(arg: $id) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * VariablesInAllowedPositionRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID!) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * VariablesInAllowedPositionRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function VariablesInAllowedPositionRule(\n context: ValidationContext,\n): ASTVisitor {\n let varDefMap: Map;\n\n return {\n OperationDefinition: {\n enter() {\n varDefMap = new Map();\n },\n leave(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const {\n node,\n type,\n parentType,\n defaultValue,\n fragmentVariableDefinition,\n } of usages) {\n const varName = node.name.value;\n\n let varDef = fragmentVariableDefinition;\n varDef ??= varDefMap.get(varName);\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n const schema = context.getSchema();\n const varType = typeFromAST(schema, varDef.type);\n if (\n varType &&\n !allowedVariableUsage(\n schema,\n varType,\n varDef.defaultValue,\n type,\n defaultValue,\n )\n ) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" of type \"${varType}\" used in position expecting type \"${type}\".`,\n { nodes: [varDef, node] },\n ),\n );\n }\n\n if (\n isInputObjectType(parentType) &&\n parentType.isOneOf &&\n isNullableType(varType)\n ) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" is of type \"${varType}\" but must be non-nullable to be used for OneOf Input Object \"${parentType}\".`,\n { nodes: [varDef, node] },\n ),\n );\n }\n }\n }\n },\n },\n VariableDefinition(node) {\n varDefMap.set(node.variable.name.value, node);\n },\n };\n}\n\n/**\n * Returns true if the variable is allowed in the location it was found,\n * including considering if default values exist for either the variable\n * or the location at which it is located.\n *\n * OneOf Input Object Type fields are considered separately above to\n * provide a more descriptive error message.\n *\n * @internal\n */\nfunction allowedVariableUsage(\n schema: GraphQLSchema,\n varType: GraphQLType,\n varDefaultValue: Maybe,\n locationType: GraphQLType,\n locationDefaultValue: unknown,\n): boolean {\n if (isNonNullType(locationType) && !isNonNullType(varType)) {\n const hasNonNullVariableDefaultValue =\n varDefaultValue != null && varDefaultValue.kind !== Kind.NULL;\n const hasLocationDefaultValue = locationDefaultValue !== undefined;\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n const nullableLocationType = locationType.ofType;\n return isTypeSubTypeOf(schema, varType, nullableLocationType);\n }\n return isTypeSubTypeOf(schema, varType, locationType);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs new file mode 100644 index 00000000..2b8a13e3 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs @@ -0,0 +1,52 @@ +import { GraphQLError } from "../../error/GraphQLError.mjs"; +import { Kind } from "../../language/kinds.mjs"; +import { isInputObjectType, isNonNullType, isNullableType, } from "../../type/definition.mjs"; +import { isTypeSubTypeOf } from "../../utilities/typeComparators.mjs"; +import { typeFromAST } from "../../utilities/typeFromAST.mjs"; +export function VariablesInAllowedPositionRule(context) { + let varDefMap; + return { + OperationDefinition: { + enter() { + varDefMap = new Map(); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + for (const { node, type, parentType, defaultValue, fragmentVariableDefinition, } of usages) { + const varName = node.name.value; + let varDef = fragmentVariableDefinition; + varDef ??= varDefMap.get(varName); + if (varDef && type) { + const schema = context.getSchema(); + const varType = typeFromAST(schema, varDef.type); + if (varType && + !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) { + context.reportError(new GraphQLError(`Variable "$${varName}" of type "${varType}" used in position expecting type "${type}".`, { nodes: [varDef, node] })); + } + if (isInputObjectType(parentType) && + parentType.isOneOf && + isNullableType(varType)) { + context.reportError(new GraphQLError(`Variable "$${varName}" is of type "${varType}" but must be non-nullable to be used for OneOf Input Object "${parentType}".`, { nodes: [varDef, node] })); + } + } + } + }, + }, + VariableDefinition(node) { + varDefMap.set(node.variable.name.value, node); + }, + }; +} +function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { + if (isNonNullType(locationType) && !isNonNullType(varType)) { + const hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== Kind.NULL; + const hasLocationDefaultValue = locationDefaultValue !== undefined; + if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { + return false; + } + const nullableLocationType = locationType.ofType; + return isTypeSubTypeOf(schema, varType, nullableLocationType); + } + return isTypeSubTypeOf(schema, varType, locationType); +} +//# sourceMappingURL=VariablesInAllowedPositionRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs.map new file mode 100644 index 00000000..5fa6a128 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"VariablesInAllowedPositionRule.js","sourceRoot":"","sources":["../../../src/validation/rules/VariablesInAllowedPositionRule.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAG3D,OAAO,EAAE,IAAI,EAAE,iCAAgC;AAI/C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,kCAAiC;AAGlC,OAAO,EAAE,eAAe,EAAE,4CAA2C;AACrE,OAAO,EAAE,WAAW,EAAE,wCAAuC;AA0C7D,MAAM,UAAU,8BAA8B,CAC5C,OAA0B;IAE1B,IAAI,SAA8C,CAAC;IAEnD,OAAO;QACL,mBAAmB,EAAE;YACnB,KAAK;gBACH,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;YACxB,CAAC;YACD,KAAK,CAAC,SAAS;gBACb,MAAM,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;gBAE7D,KAAK,MAAM,EACT,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,0BAA0B,GAC3B,IAAI,MAAM,EAAE,CAAC;oBACZ,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;oBAEhC,IAAI,MAAM,GAAG,0BAA0B,CAAC;oBACxC,MAAM,KAAK,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;oBAClC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;wBAMnB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;wBACnC,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;wBACjD,IACE,OAAO;4BACP,CAAC,oBAAoB,CACnB,MAAM,EACN,OAAO,EACP,MAAM,CAAC,YAAY,EACnB,IAAI,EACJ,YAAY,CACb,EACD,CAAC;4BACD,OAAO,CAAC,WAAW,CACjB,IAAI,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AE,YAAY,CAAC,CAAC;AACxD,CAAC","sourcesContent":["/** @category Validation Rules */\n\nimport type { Maybe } from '../../jsutils/Maybe.ts';\n\nimport { GraphQLError } from '../../error/GraphQLError.ts';\n\nimport type { ValueNode, VariableDefinitionNode } from '../../language/ast.ts';\nimport { Kind } from '../../language/kinds.ts';\nimport type { ASTVisitor } from '../../language/visitor.ts';\n\nimport type { GraphQLType } from '../../type/definition.ts';\nimport {\n isInputObjectType,\n isNonNullType,\n isNullableType,\n} from '../../type/definition.ts';\nimport type { GraphQLSchema } from '../../type/schema.ts';\n\nimport { isTypeSubTypeOf } from '../../utilities/typeComparators.ts';\nimport { typeFromAST } from '../../utilities/typeFromAST.ts';\n\nimport type { ValidationContext } from '../ValidationContext.ts';\n\n/**\n * Variables in allowed position\n *\n * Variable usages must be compatible with the arguments they are passed to.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { VariablesInAllowedPositionRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * field(arg: ID!): String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * query ($id: String) { field(arg: $id) }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * VariablesInAllowedPositionRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * query ($id: ID!) { field(arg: $id) }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * VariablesInAllowedPositionRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function VariablesInAllowedPositionRule(\n context: ValidationContext,\n): ASTVisitor {\n let varDefMap: Map;\n\n return {\n OperationDefinition: {\n enter() {\n varDefMap = new Map();\n },\n leave(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const {\n node,\n type,\n parentType,\n defaultValue,\n fragmentVariableDefinition,\n } of usages) {\n const varName = node.name.value;\n\n let varDef = fragmentVariableDefinition;\n varDef ??= varDefMap.get(varName);\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n const schema = context.getSchema();\n const varType = typeFromAST(schema, varDef.type);\n if (\n varType &&\n !allowedVariableUsage(\n schema,\n varType,\n varDef.defaultValue,\n type,\n defaultValue,\n )\n ) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" of type \"${varType}\" used in position expecting type \"${type}\".`,\n { nodes: [varDef, node] },\n ),\n );\n }\n\n if (\n isInputObjectType(parentType) &&\n parentType.isOneOf &&\n isNullableType(varType)\n ) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" is of type \"${varType}\" but must be non-nullable to be used for OneOf Input Object \"${parentType}\".`,\n { nodes: [varDef, node] },\n ),\n );\n }\n }\n }\n },\n },\n VariableDefinition(node) {\n varDefMap.set(node.variable.name.value, node);\n },\n };\n}\n\n/**\n * Returns true if the variable is allowed in the location it was found,\n * including considering if default values exist for either the variable\n * or the location at which it is located.\n *\n * OneOf Input Object Type fields are considered separately above to\n * provide a more descriptive error message.\n *\n * @internal\n */\nfunction allowedVariableUsage(\n schema: GraphQLSchema,\n varType: GraphQLType,\n varDefaultValue: Maybe,\n locationType: GraphQLType,\n locationDefaultValue: unknown,\n): boolean {\n if (isNonNullType(locationType) && !isNonNullType(varType)) {\n const hasNonNullVariableDefaultValue =\n varDefaultValue != null && varDefaultValue.kind !== Kind.NULL;\n const hasLocationDefaultValue = locationDefaultValue !== undefined;\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n const nullableLocationType = locationType.ofType;\n return isTypeSubTypeOf(schema, varType, nullableLocationType);\n }\n return isTypeSubTypeOf(schema, varType, locationType);\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.mts new file mode 100644 index 00000000..4b5c9e6b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.mts @@ -0,0 +1,56 @@ +/** @category Custom Rules */ +import type { ASTVisitor } from "../../../language/visitor.mjs"; +import type { ValidationContext } from "../../ValidationContext.mjs"; +/** + * No deprecated + * + * A GraphQL document is only valid if all selected fields and all used enum values have not been + * deprecated. + * + * Note: This rule is optional and is not part of the Validation section of the GraphQL + * Specification. The main purpose of this rule is detection of deprecated usages and not + * necessarily to forbid their use when querying a service. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { + * GraphQLObjectType, + * GraphQLSchema, + * GraphQLString, + * parse, + * validate, + * } from 'graphql'; + * import { NoDeprecatedCustomRule } from 'graphql/validation'; + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * name: { type: GraphQLString }, + * oldName: { + * type: GraphQLString, + * deprecationReason: 'Use name instead.', + * }, + * }, + * }), + * }); + * + * const invalidDocument = parse(` + * { oldName } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoDeprecatedCustomRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [NoDeprecatedCustomRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts new file mode 100644 index 00000000..08e7e45b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts @@ -0,0 +1,56 @@ +/** @category Custom Rules */ +import type { ASTVisitor } from "../../../language/visitor.js"; +import type { ValidationContext } from "../../ValidationContext.js"; +/** + * No deprecated + * + * A GraphQL document is only valid if all selected fields and all used enum values have not been + * deprecated. + * + * Note: This rule is optional and is not part of the Validation section of the GraphQL + * Specification. The main purpose of this rule is detection of deprecated usages and not + * necessarily to forbid their use when querying a service. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { + * GraphQLObjectType, + * GraphQLSchema, + * GraphQLString, + * parse, + * validate, + * } from 'graphql'; + * import { NoDeprecatedCustomRule } from 'graphql/validation'; + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * name: { type: GraphQLString }, + * oldName: { + * type: GraphQLString, + * deprecationReason: 'Use name instead.', + * }, + * }, + * }), + * }); + * + * const invalidDocument = parse(` + * { oldName } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoDeprecatedCustomRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [NoDeprecatedCustomRule]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js new file mode 100644 index 00000000..d3d5196e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoDeprecatedCustomRule = NoDeprecatedCustomRule; +const GraphQLError_ts_1 = require("../../../error/GraphQLError.js"); +const definition_ts_1 = require("../../../type/definition.js"); +function NoDeprecatedCustomRule(context) { + return { + Field(node) { + const fieldDef = context.getFieldDef(); + const deprecationReason = fieldDef?.deprecationReason; + if (fieldDef && deprecationReason != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`The field ${fieldDef} is deprecated. ${deprecationReason}`, { nodes: node })); + } + }, + Argument(node) { + const argDef = context.getArgument(); + const deprecationReason = argDef?.deprecationReason; + if (argDef && deprecationReason != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`The argument "${argDef}" is deprecated. ${deprecationReason}`, { nodes: node })); + } + }, + ObjectField(node) { + const inputObjectDef = (0, definition_ts_1.getNamedType)(context.getParentInputType()); + if ((0, definition_ts_1.isInputObjectType)(inputObjectDef)) { + const inputFieldDef = inputObjectDef.getFields()[node.name.value]; + const deprecationReason = inputFieldDef?.deprecationReason; + if (deprecationReason != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`The input field ${inputFieldDef} is deprecated. ${deprecationReason}`, { nodes: node })); + } + } + }, + EnumValue(node) { + const enumValueDef = context.getEnumValue(); + const deprecationReason = enumValueDef?.deprecationReason; + if (enumValueDef && deprecationReason != null) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`The enum value "${enumValueDef}" is deprecated. ${deprecationReason}`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=NoDeprecatedCustomRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.map new file mode 100644 index 00000000..7f9ba4ff --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoDeprecatedCustomRule.js","sourceRoot":"","sources":["../../../../src/validation/rules/custom/NoDepr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Y,CACd,mBAAmB,aAAa,mBAAmB,iBAAiB,EAAE,EACtE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,SAAS,CAAC,IAAI;YACZ,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YAC5C,MAAM,iBAAiB,GAAG,YAAY,EAAE,iBAAiB,CAAC;YAC1D,IAAI,YAAY,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;gBAC9C,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,mBAAmB,YAAY,oBAAoB,iBAAiB,EAAE,EACtE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Custom Rules */\n\nimport { GraphQLError } from '../../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../../language/visitor.ts';\n\nimport { getNamedType, isInputObjectType } from '../../../type/definition.ts';\n\nimport type { ValidationContext } from '../../ValidationContext.ts';\n\n/**\n * No deprecated\n *\n * A GraphQL document is only valid if all selected fields and all used enum values have not been\n * deprecated.\n *\n * Note: This rule is optional and is not part of the Validation section of the GraphQL\n * Specification. The main purpose of this rule is detection of deprecated usages and not\n * necessarily to forbid their use when querying a service.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import {\n * GraphQLObjectType,\n * GraphQLSchema,\n * GraphQLString,\n * parse,\n * validate,\n * } from 'graphql';\n * import { NoDeprecatedCustomRule } from 'graphql/validation';\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * name: { type: GraphQLString },\n * oldName: {\n * type: GraphQLString,\n * deprecationReason: 'Use name instead.',\n * },\n * },\n * }),\n * });\n *\n * const invalidDocument = parse(`\n * { oldName }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoDeprecatedCustomRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [NoDeprecatedCustomRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor {\n return {\n Field(node) {\n const fieldDef = context.getFieldDef();\n const deprecationReason = fieldDef?.deprecationReason;\n if (fieldDef && deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The field ${fieldDef} is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n },\n Argument(node) {\n const argDef = context.getArgument();\n const deprecationReason = argDef?.deprecationReason;\n if (argDef && deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The argument \"${argDef}\" is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n },\n ObjectField(node) {\n const inputObjectDef = getNamedType(context.getParentInputType());\n if (isInputObjectType(inputObjectDef)) {\n const inputFieldDef = inputObjectDef.getFields()[node.name.value];\n const deprecationReason = inputFieldDef?.deprecationReason;\n if (deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The input field ${inputFieldDef} is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n }\n },\n EnumValue(node) {\n const enumValueDef = context.getEnumValue();\n const deprecationReason = enumValueDef?.deprecationReason;\n if (enumValueDef && deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The enum value \"${enumValueDef}\" is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs new file mode 100644 index 00000000..37f75934 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs @@ -0,0 +1,38 @@ +import { GraphQLError } from "../../../error/GraphQLError.mjs"; +import { getNamedType, isInputObjectType } from "../../../type/definition.mjs"; +export function NoDeprecatedCustomRule(context) { + return { + Field(node) { + const fieldDef = context.getFieldDef(); + const deprecationReason = fieldDef?.deprecationReason; + if (fieldDef && deprecationReason != null) { + context.reportError(new GraphQLError(`The field ${fieldDef} is deprecated. ${deprecationReason}`, { nodes: node })); + } + }, + Argument(node) { + const argDef = context.getArgument(); + const deprecationReason = argDef?.deprecationReason; + if (argDef && deprecationReason != null) { + context.reportError(new GraphQLError(`The argument "${argDef}" is deprecated. ${deprecationReason}`, { nodes: node })); + } + }, + ObjectField(node) { + const inputObjectDef = getNamedType(context.getParentInputType()); + if (isInputObjectType(inputObjectDef)) { + const inputFieldDef = inputObjectDef.getFields()[node.name.value]; + const deprecationReason = inputFieldDef?.deprecationReason; + if (deprecationReason != null) { + context.reportError(new GraphQLError(`The input field ${inputFieldDef} is deprecated. ${deprecationReason}`, { nodes: node })); + } + } + }, + EnumValue(node) { + const enumValueDef = context.getEnumValue(); + const deprecationReason = enumValueDef?.deprecationReason; + if (enumValueDef && deprecationReason != null) { + context.reportError(new GraphQLError(`The enum value "${enumValueDef}" is deprecated. ${deprecationReason}`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=NoDeprecatedCustomRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs.map new file mode 100644 index 00000000..152ab899 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NoDeprecatedCustomRule.js","sourceRoot":"","sources":["../../../../src/validation/rules/custom/NoDeprecatedCustomRule.ts"],"names":[],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,IAAI,YAAY,CACd,mBAAmB,aAAa,mBAAmB,iBAAiB,EAAE,EACtE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,SAAS,CAAC,IAAI;YACZ,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YAC5C,MAAM,iBAAiB,GAAG,YAAY,EAAE,iBAAiB,CAAC;YAC1D,IAAI,YAAY,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;gBAC9C,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,mBAAmB,YAAY,oBAAoB,iBAAiB,EAAE,EACtE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Custom Rules */\n\nimport { GraphQLError } from '../../../error/GraphQLError.ts';\n\nimport type { ASTVisitor } from '../../../language/visitor.ts';\n\nimport { getNamedType, isInputObjectType } from '../../../type/definition.ts';\n\nimport type { ValidationContext } from '../../ValidationContext.ts';\n\n/**\n * No deprecated\n *\n * A GraphQL document is only valid if all selected fields and all used enum values have not been\n * deprecated.\n *\n * Note: This rule is optional and is not part of the Validation section of the GraphQL\n * Specification. The main purpose of this rule is detection of deprecated usages and not\n * necessarily to forbid their use when querying a service.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import {\n * GraphQLObjectType,\n * GraphQLSchema,\n * GraphQLString,\n * parse,\n * validate,\n * } from 'graphql';\n * import { NoDeprecatedCustomRule } from 'graphql/validation';\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * name: { type: GraphQLString },\n * oldName: {\n * type: GraphQLString,\n * deprecationReason: 'Use name instead.',\n * },\n * },\n * }),\n * });\n *\n * const invalidDocument = parse(`\n * { oldName }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoDeprecatedCustomRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [NoDeprecatedCustomRule]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor {\n return {\n Field(node) {\n const fieldDef = context.getFieldDef();\n const deprecationReason = fieldDef?.deprecationReason;\n if (fieldDef && deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The field ${fieldDef} is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n },\n Argument(node) {\n const argDef = context.getArgument();\n const deprecationReason = argDef?.deprecationReason;\n if (argDef && deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The argument \"${argDef}\" is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n },\n ObjectField(node) {\n const inputObjectDef = getNamedType(context.getParentInputType());\n if (isInputObjectType(inputObjectDef)) {\n const inputFieldDef = inputObjectDef.getFields()[node.name.value];\n const deprecationReason = inputFieldDef?.deprecationReason;\n if (deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The input field ${inputFieldDef} is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n }\n },\n EnumValue(node) {\n const enumValueDef = context.getEnumValue();\n const deprecationReason = enumValueDef?.deprecationReason;\n if (enumValueDef && deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The enum value \"${enumValueDef}\" is deprecated. ${deprecationReason}`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts new file mode 100644 index 00000000..a51c664e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.mts @@ -0,0 +1,45 @@ +/** @category Custom Rules */ +import type { ASTVisitor } from "../../../language/visitor.mjs"; +import type { ValidationContext } from "../../ValidationContext.mjs"; +/** + * Prohibit introspection queries + * + * A GraphQL document is only valid if all fields selected are not fields that + * return an introspection type. + * + * Note: This rule is optional and is not part of the Validation section of the + * GraphQL Specification. This rule effectively disables introspection, which + * does not reflect best practices and should only be done if absolutely necessary. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoSchemaIntrospectionCustomRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { __schema { queryType { name } } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoSchemaIntrospectionCustomRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * NoSchemaIntrospectionCustomRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoSchemaIntrospectionCustomRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts new file mode 100644 index 00000000..be1bf4e4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts @@ -0,0 +1,45 @@ +/** @category Custom Rules */ +import type { ASTVisitor } from "../../../language/visitor.js"; +import type { ValidationContext } from "../../ValidationContext.js"; +/** + * Prohibit introspection queries + * + * A GraphQL document is only valid if all fields selected are not fields that + * return an introspection type. + * + * Note: This rule is optional and is not part of the Validation section of the + * GraphQL Specification. This rule effectively disables introspection, which + * does not reflect best practices and should only be done if absolutely necessary. + * @param context - The validation context used while checking the document. + * @returns A visitor that reports validation errors for this rule. + * @example + * ```ts + * import { buildSchema, parse, validate } from 'graphql'; + * import { NoSchemaIntrospectionCustomRule } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * name: String + * } + * `); + * + * const invalidDocument = parse(` + * { __schema { queryType { name } } } + * `); + * const invalidErrors = validate(schema, invalidDocument, [ + * NoSchemaIntrospectionCustomRule, + * ]); + * + * invalidErrors.length; // => 1 + * + * const validDocument = parse(` + * { name } + * `); + * const validErrors = validate(schema, validDocument, [ + * NoSchemaIntrospectionCustomRule, + * ]); + * + * validErrors; // => [] + * ``` + */ +export declare function NoSchemaIntrospectionCustomRule(context: ValidationContext): ASTVisitor; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js new file mode 100644 index 00000000..4e2d342d --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoSchemaIntrospectionCustomRule = NoSchemaIntrospectionCustomRule; +const GraphQLError_ts_1 = require("../../../error/GraphQLError.js"); +const definition_ts_1 = require("../../../type/definition.js"); +const introspection_ts_1 = require("../../../type/introspection.js"); +function NoSchemaIntrospectionCustomRule(context) { + return { + Field(node) { + const type = (0, definition_ts_1.getNamedType)(context.getType()); + if (type && (0, introspection_ts_1.isIntrospectionType)(type)) { + context.reportError(new GraphQLError_ts_1.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=NoSchemaIntrospectionCustomRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.map new file mode 100644 index 00000000..41c23d98 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NoSchemaIntrospectionCustomRule.js","sourceRoot":"","sources":["../../../../src/validation/rules/custom/NoSchemaIntrospectionCustomRule.ts"],"names":[],"mappings":";;AAqDA,0EAgBC;AAnED,oEAA8D;AAK9D,+DAA2D;AAC3D,qEAAqE;AA6CrE,SAAgB,+BAA+B,CAC7C,OAA0B;IAE1B,OAAO;QACL,KAAK,CAAC,IAAe;YACnB,MAAM,IAAI,GAAG,IAAA,4BAAY,EAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7C,IAAI,IAAI,IAAI,IAAA,sCAAmB,EAAC,IAAI,CAAC,EAAE,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,8BAAY,CACd,yFAAyF,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAC5G,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Custom Rules */\n\nimport { GraphQLError } from '../../../error/GraphQLError.ts';\n\nimport type { FieldNode } from '../../../language/ast.ts';\nimport type { ASTVisitor } from '../../../language/visitor.ts';\n\nimport { getNamedType } from '../../../type/definition.ts';\nimport { isIntrospectionType } from '../../../type/introspection.ts';\n\nimport type { ValidationContext } from '../../ValidationContext.ts';\n\n/**\n * Prohibit introspection queries\n *\n * A GraphQL document is only valid if all fields selected are not fields that\n * return an introspection type.\n *\n * Note: This rule is optional and is not part of the Validation section of the\n * GraphQL Specification. This rule effectively disables introspection, which\n * does not reflect best practices and should only be done if absolutely necessary.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoSchemaIntrospectionCustomRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { __schema { queryType { name } } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoSchemaIntrospectionCustomRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * NoSchemaIntrospectionCustomRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoSchemaIntrospectionCustomRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n Field(node: FieldNode) {\n const type = getNamedType(context.getType());\n if (type && isIntrospectionType(type)) {\n context.reportError(\n new GraphQLError(\n `GraphQL introspection has been disabled, but the requested query contained the field \"${node.name.value}\".`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs new file mode 100644 index 00000000..443e2260 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs @@ -0,0 +1,14 @@ +import { GraphQLError } from "../../../error/GraphQLError.mjs"; +import { getNamedType } from "../../../type/definition.mjs"; +import { isIntrospectionType } from "../../../type/introspection.mjs"; +export function NoSchemaIntrospectionCustomRule(context) { + return { + Field(node) { + const type = getNamedType(context.getType()); + if (type && isIntrospectionType(type)) { + context.reportError(new GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, { nodes: node })); + } + }, + }; +} +//# sourceMappingURL=NoSchemaIntrospectionCustomRule.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs.map new file mode 100644 index 00000000..827d2dc0 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NoSchemaIntrospectionCustomRule.js","sourceRoot":"","sources":["../../../../src/validation/rules/custom/NoSchemaIntrospectionCustomRule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,wCAAuC;AAK9D,OAAO,EAAE,YAAY,EAAE,qCAAoC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,wCAAuC;AA6CrE,MAAM,UAAU,+BAA+B,CAC7C,OAA0B;IAE1B,OAAO;QACL,KAAK,CAAC,IAAe;YACnB,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7C,IAAI,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtC,OAAO,CAAC,WAAW,CACjB,IAAI,YAAY,CACd,yFAAyF,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAC5G,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @category Custom Rules */\n\nimport { GraphQLError } from '../../../error/GraphQLError.ts';\n\nimport type { FieldNode } from '../../../language/ast.ts';\nimport type { ASTVisitor } from '../../../language/visitor.ts';\n\nimport { getNamedType } from '../../../type/definition.ts';\nimport { isIntrospectionType } from '../../../type/introspection.ts';\n\nimport type { ValidationContext } from '../../ValidationContext.ts';\n\n/**\n * Prohibit introspection queries\n *\n * A GraphQL document is only valid if all fields selected are not fields that\n * return an introspection type.\n *\n * Note: This rule is optional and is not part of the Validation section of the\n * GraphQL Specification. This rule effectively disables introspection, which\n * does not reflect best practices and should only be done if absolutely necessary.\n * @param context - The validation context used while checking the document.\n * @returns A visitor that reports validation errors for this rule.\n * @example\n * ```ts\n * import { buildSchema, parse, validate } from 'graphql';\n * import { NoSchemaIntrospectionCustomRule } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * name: String\n * }\n * `);\n *\n * const invalidDocument = parse(`\n * { __schema { queryType { name } } }\n * `);\n * const invalidErrors = validate(schema, invalidDocument, [\n * NoSchemaIntrospectionCustomRule,\n * ]);\n *\n * invalidErrors.length; // => 1\n *\n * const validDocument = parse(`\n * { name }\n * `);\n * const validErrors = validate(schema, validDocument, [\n * NoSchemaIntrospectionCustomRule,\n * ]);\n *\n * validErrors; // => []\n * ```\n */\nexport function NoSchemaIntrospectionCustomRule(\n context: ValidationContext,\n): ASTVisitor {\n return {\n Field(node: FieldNode) {\n const type = getNamedType(context.getType());\n if (type && isIntrospectionType(type)) {\n context.reportError(\n new GraphQLError(\n `GraphQL introspection has been disabled, but the requested query contained the field \"${node.name.value}\".`,\n { nodes: node },\n ),\n );\n }\n },\n };\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.mts new file mode 100644 index 00000000..e4919dda --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.mts @@ -0,0 +1,16 @@ +/** @category Validation Rules */ +import type { SDLValidationRule, ValidationRule } from "./ValidationContext.mjs"; +/** + * Technically these aren't part of the spec but they are strongly encouraged + * validation rules. + */ +export declare const recommendedRules: ReadonlyArray; +/** + * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. + */ +export declare const specifiedRules: ReadonlyArray; +/** @internal */ +export declare const specifiedSDLRules: ReadonlyArray; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.ts new file mode 100644 index 00000000..be852338 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.d.ts @@ -0,0 +1,16 @@ +/** @category Validation Rules */ +import type { SDLValidationRule, ValidationRule } from "./ValidationContext.js"; +/** + * Technically these aren't part of the spec but they are strongly encouraged + * validation rules. + */ +export declare const recommendedRules: ReadonlyArray; +/** + * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. + */ +export declare const specifiedRules: ReadonlyArray; +/** @internal */ +export declare const specifiedSDLRules: ReadonlyArray; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js new file mode 100644 index 00000000..5cc7ba7a --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.specifiedSDLRules = exports.specifiedRules = exports.recommendedRules = void 0; +const DeferStreamDirectiveLabelRule_ts_1 = require("./rules/DeferStreamDirectiveLabelRule.js"); +const DeferStreamDirectiveOnRootFieldRule_ts_1 = require("./rules/DeferStreamDirectiveOnRootFieldRule.js"); +const DeferStreamDirectiveOnValidOperationsRule_ts_1 = require("./rules/DeferStreamDirectiveOnValidOperationsRule.js"); +const ExecutableDefinitionsRule_ts_1 = require("./rules/ExecutableDefinitionsRule.js"); +const FieldsOnCorrectTypeRule_ts_1 = require("./rules/FieldsOnCorrectTypeRule.js"); +const FragmentsOnCompositeTypesRule_ts_1 = require("./rules/FragmentsOnCompositeTypesRule.js"); +const KnownArgumentNamesRule_ts_1 = require("./rules/KnownArgumentNamesRule.js"); +const KnownDirectivesRule_ts_1 = require("./rules/KnownDirectivesRule.js"); +const KnownFragmentNamesRule_ts_1 = require("./rules/KnownFragmentNamesRule.js"); +const KnownOperationTypesRule_ts_1 = require("./rules/KnownOperationTypesRule.js"); +const KnownTypeNamesRule_ts_1 = require("./rules/KnownTypeNamesRule.js"); +const LoneAnonymousOperationRule_ts_1 = require("./rules/LoneAnonymousOperationRule.js"); +const LoneSchemaDefinitionRule_ts_1 = require("./rules/LoneSchemaDefinitionRule.js"); +const MaxIntrospectionDepthRule_ts_1 = require("./rules/MaxIntrospectionDepthRule.js"); +const NoFragmentCyclesRule_ts_1 = require("./rules/NoFragmentCyclesRule.js"); +const NoUndefinedVariablesRule_ts_1 = require("./rules/NoUndefinedVariablesRule.js"); +const NoUnusedFragmentsRule_ts_1 = require("./rules/NoUnusedFragmentsRule.js"); +const NoUnusedVariablesRule_ts_1 = require("./rules/NoUnusedVariablesRule.js"); +const OverlappingFieldsCanBeMergedRule_ts_1 = require("./rules/OverlappingFieldsCanBeMergedRule.js"); +const PossibleFragmentSpreadsRule_ts_1 = require("./rules/PossibleFragmentSpreadsRule.js"); +const PossibleTypeExtensionsRule_ts_1 = require("./rules/PossibleTypeExtensionsRule.js"); +const ProvidedRequiredArgumentsRule_ts_1 = require("./rules/ProvidedRequiredArgumentsRule.js"); +const ScalarLeafsRule_ts_1 = require("./rules/ScalarLeafsRule.js"); +const SingleFieldSubscriptionsRule_ts_1 = require("./rules/SingleFieldSubscriptionsRule.js"); +const StreamDirectiveOnListFieldRule_ts_1 = require("./rules/StreamDirectiveOnListFieldRule.js"); +const UniqueArgumentDefinitionNamesRule_ts_1 = require("./rules/UniqueArgumentDefinitionNamesRule.js"); +const UniqueArgumentNamesRule_ts_1 = require("./rules/UniqueArgumentNamesRule.js"); +const UniqueDirectiveNamesRule_ts_1 = require("./rules/UniqueDirectiveNamesRule.js"); +const UniqueDirectivesPerLocationRule_ts_1 = require("./rules/UniqueDirectivesPerLocationRule.js"); +const UniqueEnumValueNamesRule_ts_1 = require("./rules/UniqueEnumValueNamesRule.js"); +const UniqueFieldDefinitionNamesRule_ts_1 = require("./rules/UniqueFieldDefinitionNamesRule.js"); +const UniqueFragmentNamesRule_ts_1 = require("./rules/UniqueFragmentNamesRule.js"); +const UniqueInputFieldNamesRule_ts_1 = require("./rules/UniqueInputFieldNamesRule.js"); +const UniqueOperationNamesRule_ts_1 = require("./rules/UniqueOperationNamesRule.js"); +const UniqueOperationTypesRule_ts_1 = require("./rules/UniqueOperationTypesRule.js"); +const UniqueTypeNamesRule_ts_1 = require("./rules/UniqueTypeNamesRule.js"); +const UniqueVariableNamesRule_ts_1 = require("./rules/UniqueVariableNamesRule.js"); +const ValuesOfCorrectTypeRule_ts_1 = require("./rules/ValuesOfCorrectTypeRule.js"); +const VariablesAreInputTypesRule_ts_1 = require("./rules/VariablesAreInputTypesRule.js"); +const VariablesInAllowedPositionRule_ts_1 = require("./rules/VariablesInAllowedPositionRule.js"); +exports.recommendedRules = Object.freeze([ + MaxIntrospectionDepthRule_ts_1.MaxIntrospectionDepthRule, +]); +exports.specifiedRules = Object.freeze([ + ExecutableDefinitionsRule_ts_1.ExecutableDefinitionsRule, + KnownOperationTypesRule_ts_1.KnownOperationTypesRule, + UniqueOperationNamesRule_ts_1.UniqueOperationNamesRule, + LoneAnonymousOperationRule_ts_1.LoneAnonymousOperationRule, + SingleFieldSubscriptionsRule_ts_1.SingleFieldSubscriptionsRule, + KnownTypeNamesRule_ts_1.KnownTypeNamesRule, + FragmentsOnCompositeTypesRule_ts_1.FragmentsOnCompositeTypesRule, + VariablesAreInputTypesRule_ts_1.VariablesAreInputTypesRule, + ScalarLeafsRule_ts_1.ScalarLeafsRule, + FieldsOnCorrectTypeRule_ts_1.FieldsOnCorrectTypeRule, + UniqueFragmentNamesRule_ts_1.UniqueFragmentNamesRule, + KnownFragmentNamesRule_ts_1.KnownFragmentNamesRule, + NoUnusedFragmentsRule_ts_1.NoUnusedFragmentsRule, + PossibleFragmentSpreadsRule_ts_1.PossibleFragmentSpreadsRule, + NoFragmentCyclesRule_ts_1.NoFragmentCyclesRule, + UniqueVariableNamesRule_ts_1.UniqueVariableNamesRule, + NoUndefinedVariablesRule_ts_1.NoUndefinedVariablesRule, + NoUnusedVariablesRule_ts_1.NoUnusedVariablesRule, + KnownDirectivesRule_ts_1.KnownDirectivesRule, + UniqueDirectivesPerLocationRule_ts_1.UniqueDirectivesPerLocationRule, + DeferStreamDirectiveOnRootFieldRule_ts_1.DeferStreamDirectiveOnRootFieldRule, + DeferStreamDirectiveOnValidOperationsRule_ts_1.DeferStreamDirectiveOnValidOperationsRule, + DeferStreamDirectiveLabelRule_ts_1.DeferStreamDirectiveLabelRule, + StreamDirectiveOnListFieldRule_ts_1.StreamDirectiveOnListFieldRule, + KnownArgumentNamesRule_ts_1.KnownArgumentNamesRule, + UniqueArgumentNamesRule_ts_1.UniqueArgumentNamesRule, + ValuesOfCorrectTypeRule_ts_1.ValuesOfCorrectTypeRule, + ProvidedRequiredArgumentsRule_ts_1.ProvidedRequiredArgumentsRule, + VariablesInAllowedPositionRule_ts_1.VariablesInAllowedPositionRule, + OverlappingFieldsCanBeMergedRule_ts_1.OverlappingFieldsCanBeMergedRule, + UniqueInputFieldNamesRule_ts_1.UniqueInputFieldNamesRule, + ...exports.recommendedRules, +]); +exports.specifiedSDLRules = Object.freeze([ + LoneSchemaDefinitionRule_ts_1.LoneSchemaDefinitionRule, + UniqueOperationTypesRule_ts_1.UniqueOperationTypesRule, + UniqueTypeNamesRule_ts_1.UniqueTypeNamesRule, + UniqueEnumValueNamesRule_ts_1.UniqueEnumValueNamesRule, + UniqueFieldDefinitionNamesRule_ts_1.UniqueFieldDefinitionNamesRule, + UniqueArgumentDefinitionNamesRule_ts_1.UniqueArgumentDefinitionNamesRule, + UniqueDirectiveNamesRule_ts_1.UniqueDirectiveNamesRule, + KnownTypeNamesRule_ts_1.KnownTypeNamesRule, + KnownDirectivesRule_ts_1.KnownDirectivesRule, + UniqueDirectivesPerLocationRule_ts_1.UniqueDirectivesPerLocationRule, + PossibleTypeExtensionsRule_ts_1.PossibleTypeExtensionsRule, + KnownArgumentNamesRule_ts_1.KnownArgumentNamesOnDirectivesRule, + UniqueArgumentNamesRule_ts_1.UniqueArgumentNamesRule, + UniqueInputFieldNamesRule_ts_1.UniqueInputFieldNamesRule, + ProvidedRequiredArgumentsRule_ts_1.ProvidedRequiredArgumentsOnDirectivesRule, +]); +//# sourceMappingURL=specifiedRules.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js.map new file mode 100644 index 00000000..76cd6cb2 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.js.map @@ -0,0 +1 @@ +{"version":3,"file":"specifiedRules.js","sourceRoot":"","sources":["../../src/validation/specifiedRules.ts"],"names":[],"mappings":";;;AAGA,+FAAyF;AAEzF,2GAAqG;AAErG,uHAAiH;AAEjH,uFAAiF;AAEjF,mFAA6E;AAE7E,+FAAyF;AAEzF,iFAG2C;AAE3C,2EAAqE;AAErE,iFAA2E;AAE3E,mFAA6E;AAE7E,yEAAmE;AAEnE,yFAAmF;AAEnF,qFAA+E;AAE/E,uFAAiF;AAEjF,6EAAuE;AAEvE,qFAA+E;AAE/E,+EAAyE;AAEzE,+EAAyE;AAEzE,qGAA+F;AAE/F,2FAAqF;AACrF,yFAAmF;AAEnF,+FAGkD;AAElD,mEAA6D;AAE7D,6FAAuF;AAEvF,iGAA2F;AAC3F,uGAAiG;AAEjG,mFAA6E;AAC7E,qFAA+E;AAE/E,mGAA6F;AAC7F,qFAA+E;AAC/E,iGAA2F;AAE3F,mFAA6E;AAE7E,uFAAiF;AAEjF,qFAA+E;AAC/E,qFAA+E;AAC/E,2EAAqE;AAErE,mFAA6E;AAE7E,mFAA6E;AAE7E,yFAAmF;AAEnF,iGAA2F;AAO9E,QAAA,gBAAgB,GAAkC,MAAM,CAAC,MAAM,CAAC;IAC3E,wDAAyB;CAC1B,CAAC,CAAC;AAQU,QAAA,cAAc,GAAkC,MAAM,CAAC,MAAM,CAAC;IACzE,wDAAyB;IACzB,oDAAuB;IACvB,sDAAwB;IACxB,0DAA0B;IAC1B,8DAA4B;IAC5B,0CAAkB;IAClB,gEAA6B;IAC7B,0DAA0B;IAC1B,oCAAe;IACf,oDAAuB;IACvB,oDAAuB;IACvB,kDAAsB;IACtB,gDAAqB;IACrB,4DAA2B;IAC3B,8CAAoB;IACpB,oDAAuB;IACvB,sDAAwB;IACxB,gDAAqB;IACrB,4CAAmB;IACnB,oEAA+B;IAC/B,4EAAmC;IACnC,wFAAyC;IACzC,gEAA6B;IAC7B,kEAA8B;IAC9B,kDAAsB;IACtB,oDAAuB;IACvB,oDAAuB;IACvB,gEAA6B;IAC7B,kEAA8B;IAC9B,sEAAgC;IAChC,wDAAyB;IACzB,GAAG,wBAAgB;CACpB,CAAC,CAAC;AAGU,QAAA,iBAAiB,GAC5B,MAAM,CAAC,MAAM,CAAC;IACZ,sDAAwB;IACxB,sDAAwB;IACxB,4CAAmB;IACnB,sDAAwB;IACxB,kEAA8B;IAC9B,wEAAiC;IACjC,sDAAwB;IACxB,0CAAkB;IAClB,4CAAmB;IACnB,oEAA+B;IAC/B,0DAA0B;IAC1B,8DAAkC;IAClC,oDAAuB;IACvB,wDAAyB;IACzB,4EAAyC;CAC1C,CAAC,CAAC","sourcesContent":["/** @category Validation Rules */\n\n// Spec Section: \"Defer And Stream Directive Labels Are Unique\"\nimport { DeferStreamDirectiveLabelRule } from './rules/DeferStreamDirectiveLabelRule.ts';\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Root Field\"\nimport { DeferStreamDirectiveOnRootFieldRule } from './rules/DeferStreamDirectiveOnRootFieldRule.ts';\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Operations\"\nimport { DeferStreamDirectiveOnValidOperationsRule } from './rules/DeferStreamDirectiveOnValidOperationsRule.ts';\n// Spec Section: \"Executable Definitions\"\nimport { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule.ts';\n// Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\nimport { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule.ts';\n// Spec Section: \"Fragments on Composite Types\"\nimport { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule.ts';\n// Spec Section: \"Argument Names\"\nimport {\n KnownArgumentNamesOnDirectivesRule,\n KnownArgumentNamesRule,\n} from './rules/KnownArgumentNamesRule.ts';\n// Spec Section: \"Directives Are Defined\"\nimport { KnownDirectivesRule } from './rules/KnownDirectivesRule.ts';\n// Spec Section: \"Fragment spread target defined\"\nimport { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule.ts';\n// Spec Section: \"Operation Type Existence\"\nimport { KnownOperationTypesRule } from './rules/KnownOperationTypesRule.ts';\n// Spec Section: \"Fragment Spread Type Existence\"\nimport { KnownTypeNamesRule } from './rules/KnownTypeNamesRule.ts';\n// Spec Section: \"Lone Anonymous Operation\"\nimport { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule.ts';\n// SDL-specific validation rules\nimport { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule.ts';\n// TODO: Spec Section\nimport { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.ts';\n// Spec Section: \"Fragments must not form cycles\"\nimport { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule.ts';\n// Spec Section: \"All Variable Used Defined\"\nimport { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule.ts';\n// Spec Section: \"Fragments must be used\"\nimport { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule.ts';\n// Spec Section: \"All Variables Used\"\nimport { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule.ts';\n// Spec Section: \"Field Selection Merging\"\nimport { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule.ts';\n// Spec Section: \"Fragment spread is possible\"\nimport { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule.ts';\nimport { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule.ts';\n// Spec Section: \"Argument Optionality\"\nimport {\n ProvidedRequiredArgumentsOnDirectivesRule,\n ProvidedRequiredArgumentsRule,\n} from './rules/ProvidedRequiredArgumentsRule.ts';\n// Spec Section: \"Leaf Field Selections\"\nimport { ScalarLeafsRule } from './rules/ScalarLeafsRule.ts';\n// Spec Section: \"Subscriptions with Single Root Field\"\nimport { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule.ts';\n// Spec Section: \"Stream Directives Are Used On List Fields\"\nimport { StreamDirectiveOnListFieldRule } from './rules/StreamDirectiveOnListFieldRule.ts';\nimport { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule.ts';\n// Spec Section: \"Argument Uniqueness\"\nimport { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule.ts';\nimport { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule.ts';\n// Spec Section: \"Directives Are Unique Per Location\"\nimport { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule.ts';\nimport { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule.ts';\nimport { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule.ts';\n// Spec Section: \"Fragment Name Uniqueness\"\nimport { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule.ts';\n// Spec Section: \"Input Object Field Uniqueness\"\nimport { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule.ts';\n// Spec Section: \"Operation Name Uniqueness\"\nimport { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule.ts';\nimport { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule.ts';\nimport { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule.ts';\n// Spec Section: \"Variable Uniqueness\"\nimport { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule.ts';\n// Spec Section: \"Value Type Correctness\"\nimport { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule.ts';\n// Spec Section: \"Variables are Input Types\"\nimport { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule.ts';\n// Spec Section: \"All Variable Usages Are Allowed\"\nimport { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule.ts';\nimport type { SDLValidationRule, ValidationRule } from './ValidationContext.ts';\n\n/**\n * Technically these aren't part of the spec but they are strongly encouraged\n * validation rules.\n */\nexport const recommendedRules: ReadonlyArray = Object.freeze([\n MaxIntrospectionDepthRule,\n]);\n\n/**\n * This set includes all validation rules defined by the GraphQL spec.\n *\n * The order of the rules in this list has been adjusted to lead to the\n * most clear output when encountering multiple validation errors.\n */\nexport const specifiedRules: ReadonlyArray = Object.freeze([\n ExecutableDefinitionsRule,\n KnownOperationTypesRule,\n UniqueOperationNamesRule,\n LoneAnonymousOperationRule,\n SingleFieldSubscriptionsRule,\n KnownTypeNamesRule,\n FragmentsOnCompositeTypesRule,\n VariablesAreInputTypesRule,\n ScalarLeafsRule,\n FieldsOnCorrectTypeRule,\n UniqueFragmentNamesRule,\n KnownFragmentNamesRule,\n NoUnusedFragmentsRule,\n PossibleFragmentSpreadsRule,\n NoFragmentCyclesRule,\n UniqueVariableNamesRule,\n NoUndefinedVariablesRule,\n NoUnusedVariablesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n DeferStreamDirectiveOnRootFieldRule,\n DeferStreamDirectiveOnValidOperationsRule,\n DeferStreamDirectiveLabelRule,\n StreamDirectiveOnListFieldRule,\n KnownArgumentNamesRule,\n UniqueArgumentNamesRule,\n ValuesOfCorrectTypeRule,\n ProvidedRequiredArgumentsRule,\n VariablesInAllowedPositionRule,\n OverlappingFieldsCanBeMergedRule,\n UniqueInputFieldNamesRule,\n ...recommendedRules,\n]);\n\n/** @internal */\nexport const specifiedSDLRules: ReadonlyArray =\n Object.freeze([\n LoneSchemaDefinitionRule,\n UniqueOperationTypesRule,\n UniqueTypeNamesRule,\n UniqueEnumValueNamesRule,\n UniqueFieldDefinitionNamesRule,\n UniqueArgumentDefinitionNamesRule,\n UniqueDirectiveNamesRule,\n KnownTypeNamesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n PossibleTypeExtensionsRule,\n KnownArgumentNamesOnDirectivesRule,\n UniqueArgumentNamesRule,\n UniqueInputFieldNamesRule,\n ProvidedRequiredArgumentsOnDirectivesRule,\n ]);\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs new file mode 100644 index 00000000..3a306edf --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs @@ -0,0 +1,95 @@ +import { DeferStreamDirectiveLabelRule } from "./rules/DeferStreamDirectiveLabelRule.mjs"; +import { DeferStreamDirectiveOnRootFieldRule } from "./rules/DeferStreamDirectiveOnRootFieldRule.mjs"; +import { DeferStreamDirectiveOnValidOperationsRule } from "./rules/DeferStreamDirectiveOnValidOperationsRule.mjs"; +import { ExecutableDefinitionsRule } from "./rules/ExecutableDefinitionsRule.mjs"; +import { FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectTypeRule.mjs"; +import { FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypesRule.mjs"; +import { KnownArgumentNamesOnDirectivesRule, KnownArgumentNamesRule, } from "./rules/KnownArgumentNamesRule.mjs"; +import { KnownDirectivesRule } from "./rules/KnownDirectivesRule.mjs"; +import { KnownFragmentNamesRule } from "./rules/KnownFragmentNamesRule.mjs"; +import { KnownOperationTypesRule } from "./rules/KnownOperationTypesRule.mjs"; +import { KnownTypeNamesRule } from "./rules/KnownTypeNamesRule.mjs"; +import { LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperationRule.mjs"; +import { LoneSchemaDefinitionRule } from "./rules/LoneSchemaDefinitionRule.mjs"; +import { MaxIntrospectionDepthRule } from "./rules/MaxIntrospectionDepthRule.mjs"; +import { NoFragmentCyclesRule } from "./rules/NoFragmentCyclesRule.mjs"; +import { NoUndefinedVariablesRule } from "./rules/NoUndefinedVariablesRule.mjs"; +import { NoUnusedFragmentsRule } from "./rules/NoUnusedFragmentsRule.mjs"; +import { NoUnusedVariablesRule } from "./rules/NoUnusedVariablesRule.mjs"; +import { OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMergedRule.mjs"; +import { PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreadsRule.mjs"; +import { PossibleTypeExtensionsRule } from "./rules/PossibleTypeExtensionsRule.mjs"; +import { ProvidedRequiredArgumentsOnDirectivesRule, ProvidedRequiredArgumentsRule, } from "./rules/ProvidedRequiredArgumentsRule.mjs"; +import { ScalarLeafsRule } from "./rules/ScalarLeafsRule.mjs"; +import { SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptionsRule.mjs"; +import { StreamDirectiveOnListFieldRule } from "./rules/StreamDirectiveOnListFieldRule.mjs"; +import { UniqueArgumentDefinitionNamesRule } from "./rules/UniqueArgumentDefinitionNamesRule.mjs"; +import { UniqueArgumentNamesRule } from "./rules/UniqueArgumentNamesRule.mjs"; +import { UniqueDirectiveNamesRule } from "./rules/UniqueDirectiveNamesRule.mjs"; +import { UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocationRule.mjs"; +import { UniqueEnumValueNamesRule } from "./rules/UniqueEnumValueNamesRule.mjs"; +import { UniqueFieldDefinitionNamesRule } from "./rules/UniqueFieldDefinitionNamesRule.mjs"; +import { UniqueFragmentNamesRule } from "./rules/UniqueFragmentNamesRule.mjs"; +import { UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNamesRule.mjs"; +import { UniqueOperationNamesRule } from "./rules/UniqueOperationNamesRule.mjs"; +import { UniqueOperationTypesRule } from "./rules/UniqueOperationTypesRule.mjs"; +import { UniqueTypeNamesRule } from "./rules/UniqueTypeNamesRule.mjs"; +import { UniqueVariableNamesRule } from "./rules/UniqueVariableNamesRule.mjs"; +import { ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectTypeRule.mjs"; +import { VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypesRule.mjs"; +import { VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPositionRule.mjs"; +export const recommendedRules = Object.freeze([ + MaxIntrospectionDepthRule, +]); +export const specifiedRules = Object.freeze([ + ExecutableDefinitionsRule, + KnownOperationTypesRule, + UniqueOperationNamesRule, + LoneAnonymousOperationRule, + SingleFieldSubscriptionsRule, + KnownTypeNamesRule, + FragmentsOnCompositeTypesRule, + VariablesAreInputTypesRule, + ScalarLeafsRule, + FieldsOnCorrectTypeRule, + UniqueFragmentNamesRule, + KnownFragmentNamesRule, + NoUnusedFragmentsRule, + PossibleFragmentSpreadsRule, + NoFragmentCyclesRule, + UniqueVariableNamesRule, + NoUndefinedVariablesRule, + NoUnusedVariablesRule, + KnownDirectivesRule, + UniqueDirectivesPerLocationRule, + DeferStreamDirectiveOnRootFieldRule, + DeferStreamDirectiveOnValidOperationsRule, + DeferStreamDirectiveLabelRule, + StreamDirectiveOnListFieldRule, + KnownArgumentNamesRule, + UniqueArgumentNamesRule, + ValuesOfCorrectTypeRule, + ProvidedRequiredArgumentsRule, + VariablesInAllowedPositionRule, + OverlappingFieldsCanBeMergedRule, + UniqueInputFieldNamesRule, + ...recommendedRules, +]); +export const specifiedSDLRules = Object.freeze([ + LoneSchemaDefinitionRule, + UniqueOperationTypesRule, + UniqueTypeNamesRule, + UniqueEnumValueNamesRule, + UniqueFieldDefinitionNamesRule, + UniqueArgumentDefinitionNamesRule, + UniqueDirectiveNamesRule, + KnownTypeNamesRule, + KnownDirectivesRule, + UniqueDirectivesPerLocationRule, + PossibleTypeExtensionsRule, + KnownArgumentNamesOnDirectivesRule, + UniqueArgumentNamesRule, + UniqueInputFieldNamesRule, + ProvidedRequiredArgumentsOnDirectivesRule, +]); +//# sourceMappingURL=specifiedRules.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs.map new file mode 100644 index 00000000..cba99227 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/specifiedRules.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"specifiedRules.js","sourceRoot":"","sources":["../../src/validation/specifiedRules.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,kDAAiD;AAEzF,OAAO,EAAE,mCAAmC,EAAE,wDAAuD;AAErG,OAAO,EAAE,yCAAyC,EAAE,8DAA6D;AAEjH,OAAO,EAAE,yBAAyB,EAAE,8CAA6C;AAEjF,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAE7E,OAAO,EAAE,6BAA6B,EAAE,kDAAiD;AAEzF,OAAO,EACL,kCAAkC,EAClC,sBAAsB,GACvB,2CAA0C;AAE3C,OAAO,EAAE,mBAAmB,EAAE,wCAAuC;AAErE,OAAO,EAAE,sBAAsB,EAAE,2CAA0C;AAE3E,OAAO,EAAE,uBAAuB,EAAE,4CAA2C;AAE7E,OAAO,EAAE,kBAAkB,EAAE,uCAAsC;AAEnE,OAAO,EAAE,0BAA0B,EAAE,+CAA8C;AAEnF,OAAO,EAAE,wBAAwB,EAAE,6CAA4C;AAE/E,OAAO,EAAE,yBAAyB,EAAE,8CAA6C;AAEjF,OAAO,EAAE,oBAAoB,EAAE,yCA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,yBAAyB;IACzB,uBAAuB;IACvB,wBAAwB;IACxB,0BAA0B;IAC1B,4BAA4B;IAC5B,kBAAkB;IAClB,6BAA6B;IAC7B,0BAA0B;IAC1B,eAAe;IACf,uBAAuB;IACvB,uBAAuB;IACvB,sBAAsB;IACtB,qBAAqB;IACrB,2BAA2B;IAC3B,oBAAoB;IACpB,uBAAuB;IACvB,wBAAwB;IACxB,qBAAqB;IACrB,mBAAmB;IACnB,+BAA+B;IAC/B,mCAAmC;IACnC,yCAAyC;IACzC,6BAA6B;IAC7B,8BAA8B;IAC9B,sBAAsB;IACtB,uBAAuB;IACvB,uBAAuB;IACvB,6BAA6B;IAC7B,8BAA8B;IAC9B,gCAAgC;IAChC,yBAAyB;IACzB,GAAG,gBAAgB;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAC5B,MAAM,CAAC,MAAM,CAAC;IACZ,wBAAwB;IACxB,wBAAwB;IACxB,mBAAmB;IACnB,wBAAwB;IACxB,8BAA8B;IAC9B,iCAAiC;IACjC,wBAAwB;IACxB,kBAAkB;IAClB,mBAAmB;IACnB,+BAA+B;IAC/B,0BAA0B;IAC1B,kCAAkC;IAClC,uBAAuB;IACvB,yBAAyB;IACzB,yCAAyC;CAC1C,CAAC,CAAC","sourcesContent":["/** @category Validation Rules */\n\n// Spec Section: \"Defer And Stream Directive Labels Are Unique\"\nimport { DeferStreamDirectiveLabelRule } from './rules/DeferStreamDirectiveLabelRule.ts';\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Root Field\"\nimport { DeferStreamDirectiveOnRootFieldRule } from './rules/DeferStreamDirectiveOnRootFieldRule.ts';\n// Spec Section: \"Defer And Stream Directives Are Used On Valid Operations\"\nimport { DeferStreamDirectiveOnValidOperationsRule } from './rules/DeferStreamDirectiveOnValidOperationsRule.ts';\n// Spec Section: \"Executable Definitions\"\nimport { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule.ts';\n// Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\nimport { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule.ts';\n// Spec Section: \"Fragments on Composite Types\"\nimport { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule.ts';\n// Spec Section: \"Argument Names\"\nimport {\n KnownArgumentNamesOnDirectivesRule,\n KnownArgumentNamesRule,\n} from './rules/KnownArgumentNamesRule.ts';\n// Spec Section: \"Directives Are Defined\"\nimport { KnownDirectivesRule } from './rules/KnownDirectivesRule.ts';\n// Spec Section: \"Fragment spread target defined\"\nimport { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule.ts';\n// Spec Section: \"Operation Type Existence\"\nimport { KnownOperationTypesRule } from './rules/KnownOperationTypesRule.ts';\n// Spec Section: \"Fragment Spread Type Existence\"\nimport { KnownTypeNamesRule } from './rules/KnownTypeNamesRule.ts';\n// Spec Section: \"Lone Anonymous Operation\"\nimport { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule.ts';\n// SDL-specific validation rules\nimport { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule.ts';\n// TODO: Spec Section\nimport { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.ts';\n// Spec Section: \"Fragments must not form cycles\"\nimport { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule.ts';\n// Spec Section: \"All Variable Used Defined\"\nimport { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule.ts';\n// Spec Section: \"Fragments must be used\"\nimport { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule.ts';\n// Spec Section: \"All Variables Used\"\nimport { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule.ts';\n// Spec Section: \"Field Selection Merging\"\nimport { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule.ts';\n// Spec Section: \"Fragment spread is possible\"\nimport { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule.ts';\nimport { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule.ts';\n// Spec Section: \"Argument Optionality\"\nimport {\n ProvidedRequiredArgumentsOnDirectivesRule,\n ProvidedRequiredArgumentsRule,\n} from './rules/ProvidedRequiredArgumentsRule.ts';\n// Spec Section: \"Leaf Field Selections\"\nimport { ScalarLeafsRule } from './rules/ScalarLeafsRule.ts';\n// Spec Section: \"Subscriptions with Single Root Field\"\nimport { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule.ts';\n// Spec Section: \"Stream Directives Are Used On List Fields\"\nimport { StreamDirectiveOnListFieldRule } from './rules/StreamDirectiveOnListFieldRule.ts';\nimport { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule.ts';\n// Spec Section: \"Argument Uniqueness\"\nimport { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule.ts';\nimport { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule.ts';\n// Spec Section: \"Directives Are Unique Per Location\"\nimport { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule.ts';\nimport { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule.ts';\nimport { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule.ts';\n// Spec Section: \"Fragment Name Uniqueness\"\nimport { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule.ts';\n// Spec Section: \"Input Object Field Uniqueness\"\nimport { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule.ts';\n// Spec Section: \"Operation Name Uniqueness\"\nimport { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule.ts';\nimport { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule.ts';\nimport { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule.ts';\n// Spec Section: \"Variable Uniqueness\"\nimport { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule.ts';\n// Spec Section: \"Value Type Correctness\"\nimport { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule.ts';\n// Spec Section: \"Variables are Input Types\"\nimport { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule.ts';\n// Spec Section: \"All Variable Usages Are Allowed\"\nimport { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule.ts';\nimport type { SDLValidationRule, ValidationRule } from './ValidationContext.ts';\n\n/**\n * Technically these aren't part of the spec but they are strongly encouraged\n * validation rules.\n */\nexport const recommendedRules: ReadonlyArray = Object.freeze([\n MaxIntrospectionDepthRule,\n]);\n\n/**\n * This set includes all validation rules defined by the GraphQL spec.\n *\n * The order of the rules in this list has been adjusted to lead to the\n * most clear output when encountering multiple validation errors.\n */\nexport const specifiedRules: ReadonlyArray = Object.freeze([\n ExecutableDefinitionsRule,\n KnownOperationTypesRule,\n UniqueOperationNamesRule,\n LoneAnonymousOperationRule,\n SingleFieldSubscriptionsRule,\n KnownTypeNamesRule,\n FragmentsOnCompositeTypesRule,\n VariablesAreInputTypesRule,\n ScalarLeafsRule,\n FieldsOnCorrectTypeRule,\n UniqueFragmentNamesRule,\n KnownFragmentNamesRule,\n NoUnusedFragmentsRule,\n PossibleFragmentSpreadsRule,\n NoFragmentCyclesRule,\n UniqueVariableNamesRule,\n NoUndefinedVariablesRule,\n NoUnusedVariablesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n DeferStreamDirectiveOnRootFieldRule,\n DeferStreamDirectiveOnValidOperationsRule,\n DeferStreamDirectiveLabelRule,\n StreamDirectiveOnListFieldRule,\n KnownArgumentNamesRule,\n UniqueArgumentNamesRule,\n ValuesOfCorrectTypeRule,\n ProvidedRequiredArgumentsRule,\n VariablesInAllowedPositionRule,\n OverlappingFieldsCanBeMergedRule,\n UniqueInputFieldNamesRule,\n ...recommendedRules,\n]);\n\n/** @internal */\nexport const specifiedSDLRules: ReadonlyArray =\n Object.freeze([\n LoneSchemaDefinitionRule,\n UniqueOperationTypesRule,\n UniqueTypeNamesRule,\n UniqueEnumValueNamesRule,\n UniqueFieldDefinitionNamesRule,\n UniqueArgumentDefinitionNamesRule,\n UniqueDirectiveNamesRule,\n KnownTypeNamesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n PossibleTypeExtensionsRule,\n KnownArgumentNamesOnDirectivesRule,\n UniqueArgumentNamesRule,\n UniqueInputFieldNamesRule,\n ProvidedRequiredArgumentsOnDirectivesRule,\n ]);\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.mts new file mode 100644 index 00000000..edc12176 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.mts @@ -0,0 +1,103 @@ +/** @category Validation */ +import type { Maybe } from "../jsutils/Maybe.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import type { DocumentNode } from "../language/ast.mjs"; +import type { GraphQLSchema } from "../type/schema.mjs"; +import type { SDLValidationRule, ValidationRule } from "./ValidationContext.mjs"; +/** + * Options used when validating a GraphQL document. + * @category Validation + */ +export interface ValidationOptions { + /** Maximum number of validation errors before validation stops. */ + maxErrors?: number; + /** Whether suggestion text should be omitted from validation errors. */ + hideSuggestions?: Maybe; +} +/** + * Implements the "Validation" section of the spec. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the document is valid. + * + * A list of specific validation rules may be provided. If not provided, the + * default list of rules defined by the GraphQL specification will be used. + * + * Each validation rule is a function that returns a visitor + * (see the language/visitor API). Visitor methods are expected to return + * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Validate will stop validation after a `maxErrors` limit has been reached. + * Attackers can send pathologically invalid queries to induce a DoS attack, + * so `maxErrors` defaults to 100 errors. + * @param schema - Schema to validate against. + * @param documentAST - Document AST to validate. + * @param rules - Validation rules to apply. + * @param options - Validation options, including error limits and suggestions. + * @returns Validation errors, or an empty array when the document is valid. + * @example + * ```ts + * // Validate with the default specified rules. + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * fullName: String + * } + * `); + * + * validate(schema, parse('{ greeting }')); // => [] + * + * const errors = validate(schema, parse('{ missing }')); + * errors[0].message; // => 'Cannot query field "missing" on type "Query".' + * ``` + * @example + * ```ts + * // This variant uses a custom rule list and validation options. + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { FieldsOnCorrectTypeRule, validate } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ missingOne missingTwo }'); + * + * const errors = validate(schema, document, [FieldsOnCorrectTypeRule], { + * maxErrors: 1, + * }); + * + * errors.length; // => 2 + * errors[1].message; // => 'Too many validation errors, error limit reached. Validation aborted.' + * + * const hiddenSuggestionErrors = validate( + * schema, + * parse('{ name }'), + * [FieldsOnCorrectTypeRule], + * { hideSuggestions: true }, + * ); + * + * hiddenSuggestionErrors[0].message; // => 'Cannot query field "name" on type "Query".' + * ``` + */ +export declare function validate(schema: GraphQLSchema, documentAST: DocumentNode, rules?: ReadonlyArray, options?: ValidationOptions): ReadonlyArray; +/** @internal */ +export declare function validateSDL(documentAST: DocumentNode, schemaToExtend?: Maybe, rules?: ReadonlyArray): ReadonlyArray; +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export declare function assertValidSDL(documentAST: DocumentNode): void; +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export declare function assertValidSDLExtension(documentAST: DocumentNode, schema: GraphQLSchema): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.ts new file mode 100644 index 00000000..3a1075ef --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.d.ts @@ -0,0 +1,103 @@ +/** @category Validation */ +import type { Maybe } from "../jsutils/Maybe.js"; +import { GraphQLError } from "../error/GraphQLError.js"; +import type { DocumentNode } from "../language/ast.js"; +import type { GraphQLSchema } from "../type/schema.js"; +import type { SDLValidationRule, ValidationRule } from "./ValidationContext.js"; +/** + * Options used when validating a GraphQL document. + * @category Validation + */ +export interface ValidationOptions { + /** Maximum number of validation errors before validation stops. */ + maxErrors?: number; + /** Whether suggestion text should be omitted from validation errors. */ + hideSuggestions?: Maybe; +} +/** + * Implements the "Validation" section of the spec. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the document is valid. + * + * A list of specific validation rules may be provided. If not provided, the + * default list of rules defined by the GraphQL specification will be used. + * + * Each validation rule is a function that returns a visitor + * (see the language/visitor API). Visitor methods are expected to return + * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Validate will stop validation after a `maxErrors` limit has been reached. + * Attackers can send pathologically invalid queries to induce a DoS attack, + * so `maxErrors` defaults to 100 errors. + * @param schema - Schema to validate against. + * @param documentAST - Document AST to validate. + * @param rules - Validation rules to apply. + * @param options - Validation options, including error limits and suggestions. + * @returns Validation errors, or an empty array when the document is valid. + * @example + * ```ts + * // Validate with the default specified rules. + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { validate } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * fullName: String + * } + * `); + * + * validate(schema, parse('{ greeting }')); // => [] + * + * const errors = validate(schema, parse('{ missing }')); + * errors[0].message; // => 'Cannot query field "missing" on type "Query".' + * ``` + * @example + * ```ts + * // This variant uses a custom rule list and validation options. + * import { parse } from 'graphql/language'; + * import { buildSchema } from 'graphql/utilities'; + * import { FieldsOnCorrectTypeRule, validate } from 'graphql/validation'; + * + * const schema = buildSchema(` + * type Query { + * greeting: String + * } + * `); + * const document = parse('{ missingOne missingTwo }'); + * + * const errors = validate(schema, document, [FieldsOnCorrectTypeRule], { + * maxErrors: 1, + * }); + * + * errors.length; // => 2 + * errors[1].message; // => 'Too many validation errors, error limit reached. Validation aborted.' + * + * const hiddenSuggestionErrors = validate( + * schema, + * parse('{ name }'), + * [FieldsOnCorrectTypeRule], + * { hideSuggestions: true }, + * ); + * + * hiddenSuggestionErrors[0].message; // => 'Cannot query field "name" on type "Query".' + * ``` + */ +export declare function validate(schema: GraphQLSchema, documentAST: DocumentNode, rules?: ReadonlyArray, options?: ValidationOptions): ReadonlyArray; +/** @internal */ +export declare function validateSDL(documentAST: DocumentNode, schemaToExtend?: Maybe, rules?: ReadonlyArray): ReadonlyArray; +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export declare function assertValidSDL(documentAST: DocumentNode): void; +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export declare function assertValidSDLExtension(documentAST: DocumentNode, schema: GraphQLSchema): void; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js new file mode 100644 index 00000000..0d84c7d8 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validate = validate; +exports.validateSDL = validateSDL; +exports.assertValidSDL = assertValidSDL; +exports.assertValidSDLExtension = assertValidSDLExtension; +const mapValue_ts_1 = require("../jsutils/mapValue.js"); +const GraphQLError_ts_1 = require("../error/GraphQLError.js"); +const ast_ts_1 = require("../language/ast.js"); +const visitor_ts_1 = require("../language/visitor.js"); +const validate_ts_1 = require("../type/validate.js"); +const TypeInfo_ts_1 = require("../utilities/TypeInfo.js"); +const diagnostics_ts_1 = require("../diagnostics.js"); +const specifiedRules_ts_1 = require("./specifiedRules.js"); +const ValidationContext_ts_1 = require("./ValidationContext.js"); +const QueryDocumentKeysToValidate = (0, mapValue_ts_1.mapValue)(ast_ts_1.QueryDocumentKeys, (keys) => keys.filter((key) => key !== 'description')); +const tooManyValidationErrorsError = new GraphQLError_ts_1.GraphQLError('Too many validation errors, error limit reached. Validation aborted.'); +function validate(schema, documentAST, rules = specifiedRules_ts_1.specifiedRules, options) { + return (0, diagnostics_ts_1.shouldTrace)(diagnostics_ts_1.validateChannel) + ? diagnostics_ts_1.validateChannel.traceSync(() => validateImpl(schema, documentAST, rules, options), { schema, document: documentAST }) + : validateImpl(schema, documentAST, rules, options); +} +function validateImpl(schema, documentAST, rules, options) { + const maxErrors = options?.maxErrors ?? 100; + const hideSuggestions = options?.hideSuggestions ?? false; + (0, validate_ts_1.assertValidSchema)(schema); + const errors = []; + const typeInfo = new TypeInfo_ts_1.TypeInfo(schema); + const context = new ValidationContext_ts_1.ValidationContext(schema, documentAST, typeInfo, (error) => { + if (errors.length >= maxErrors) { + throw tooManyValidationErrorsError; + } + errors.push(error); + }, hideSuggestions); + const visitor = (0, visitor_ts_1.visitInParallel)(rules.map((rule) => rule(context))); + try { + (0, visitor_ts_1.visit)(documentAST, (0, TypeInfo_ts_1.visitWithTypeInfo)(typeInfo, visitor), QueryDocumentKeysToValidate); + } + catch (e) { + if (e === tooManyValidationErrorsError) { + errors.push(tooManyValidationErrorsError); + } + else { + throw e; + } + } + return errors; +} +function validateSDL(documentAST, schemaToExtend, rules = specifiedRules_ts_1.specifiedSDLRules) { + const errors = []; + const context = new ValidationContext_ts_1.SDLValidationContext(documentAST, schemaToExtend, (error) => { + errors.push(error); + }); + const visitors = rules.map((rule) => rule(context)); + (0, visitor_ts_1.visit)(documentAST, (0, visitor_ts_1.visitInParallel)(visitors)); + return errors; +} +function assertValidSDL(documentAST) { + const errors = validateSDL(documentAST); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} +function assertValidSDLExtension(documentAST, schema) { + const errors = validateSDL(documentAST, schema); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} +//# sourceMappingURL=validate.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js.map new file mode 100644 index 00000000..cefd8bcb --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/validation/validate.ts"],"names":[],"mappings":";;AAqHA,4BAYC;AAmDD,kCAiBC;AAQD,wCAKC;AAQD,0DAQC;AAhOD,wDAAkD;AAGlD,8DAAwD;AAGxD,+CAAuD;AACvD,uDAAgE;AAGhE,qDAAwD;AAExD,0DAAuE;AAEvE,sDAAiE;AAEjE,2DAAwE;AAExE,iEAGgC;AAehC,MAAM,2BAA2B,GAAG,IAAA,sBAAQ,EAC1C,0BAAiB,EACjB,CAAC,IAA2B,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC,CAC7E,CAAC;AAEF,MAAM,4BAA4B,GAAG,IAAI,8BAAY,CACnD,sEAAsE,CACvE,CAAC;AAwEF,SAAgB,QAAQ,CACtB,MAAqB,EACrB,WAAyB,EACzB,QAAuC,kCAAc,EACrD,OAA2B;IAE3B,OAAO,IAAA,4BAAW,EAAC,gCAAe,CAAC;QACjC,CAAC,CAAC,gCAAe,CAAC,SAAS,CACvB,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,EACvD,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,CAClC;QACH,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,YAAY,CACnB,MAAqB,EACrB,WAAyB,E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AAW,EACX,cAAc,EACd,CAAC,KAAK,EAAE,EAAE;QACR,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CACF,CAAC;IAEF,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,IAAA,kBAAK,EAAC,WAAW,EAAE,IAAA,4BAAe,EAAC,QAAQ,CAAC,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC;AAChB,CAAC;AAQD,SAAgB,cAAc,CAAC,WAAyB;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAQD,SAAgB,uBAAuB,CACrC,WAAyB,EACzB,MAAqB;IAErB,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrE,CAAC;AACH,CAAC","sourcesContent":["/** @category Validation */\n\nimport { mapValue } from '../jsutils/mapValue.ts';\nimport type { Maybe } from '../jsutils/Maybe.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type { DocumentNode } from '../language/ast.ts';\nimport { QueryDocumentKeys } from '../language/ast.ts';\nimport { visit, visitInParallel } from '../language/visitor.ts';\n\nimport type { GraphQLSchema } from '../type/schema.ts';\nimport { assertValidSchema } from '../type/validate.ts';\n\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.ts';\n\nimport { shouldTrace, validateChannel } from '../diagnostics.ts';\n\nimport { specifiedRules, specifiedSDLRules } from './specifiedRules.ts';\nimport type { SDLValidationRule, ValidationRule } from './ValidationContext.ts';\nimport {\n SDLValidationContext,\n ValidationContext,\n} from './ValidationContext.ts';\n\n/**\n * Options used when validating a GraphQL document.\n * @category Validation\n */\nexport interface ValidationOptions {\n /** Maximum number of validation errors before validation stops. */\n maxErrors?: number;\n /** Whether suggestion text should be omitted from validation errors. */\n hideSuggestions?: Maybe;\n}\n\n// Per the specification, descriptions must not affect validation.\n// See https://spec.graphql.org/draft/#sec-Descriptions\nconst QueryDocumentKeysToValidate = mapValue(\n QueryDocumentKeys,\n (keys: ReadonlyArray) => keys.filter((key) => key !== 'description'),\n);\n\nconst tooManyValidationErrorsError = new GraphQLError(\n 'Too many validation errors, error limit reached. Validation aborted.',\n);\n\n/**\n * Implements the \"Validation\" section of the spec.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the document is valid.\n *\n * A list of specific validation rules may be provided. If not provided, the\n * default list of rules defined by the GraphQL specification will be used.\n *\n * Each validation rule is a function that returns a visitor\n * (see the language/visitor API). Visitor methods are expected to return\n * GraphQLErrors, or Arrays of GraphQLErrors when invalid.\n *\n * Validate will stop validation after a `maxErrors` limit has been reached.\n * Attackers can send pathologically invalid queries to induce a DoS attack,\n * so `maxErrors` defaults to 100 errors.\n * @param schema - Schema to validate against.\n * @param documentAST - Document AST to validate.\n * @param rules - Validation rules to apply.\n * @param options - Validation options, including error limits and suggestions.\n * @returns Validation errors, or an empty array when the document is valid.\n * @example\n * ```ts\n * // Validate with the default specified rules.\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * fullName: String\n * }\n * `);\n *\n * validate(schema, parse('{ greeting }')); // => []\n *\n * const errors = validate(schema, parse('{ missing }'));\n * errors[0].message; // => 'Cannot query field \"missing\" on type \"Query\".'\n * ```\n * @example\n * ```ts\n * // This variant uses a custom rule list and validation options.\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { FieldsOnCorrectTypeRule, validate } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ missingOne missingTwo }');\n *\n * const errors = validate(schema, document, [FieldsOnCorrectTypeRule], {\n * maxErrors: 1,\n * });\n *\n * errors.length; // => 2\n * errors[1].message; // => 'Too many validation errors, error limit reached. Validation aborted.'\n *\n * const hiddenSuggestionErrors = validate(\n * schema,\n * parse('{ name }'),\n * [FieldsOnCorrectTypeRule],\n * { hideSuggestions: true },\n * );\n *\n * hiddenSuggestionErrors[0].message; // => 'Cannot query field \"name\" on type \"Query\".'\n * ```\n */\nexport function validate(\n schema: GraphQLSchema,\n documentAST: DocumentNode,\n rules: ReadonlyArray = specifiedRules,\n options?: ValidationOptions,\n): ReadonlyArray {\n return shouldTrace(validateChannel)\n ? validateChannel.traceSync(\n () => validateImpl(schema, documentAST, rules, options),\n { schema, document: documentAST },\n )\n : validateImpl(schema, documentAST, rules, options);\n}\n\nfunction validateImpl(\n schema: GraphQLSchema,\n documentAST: DocumentNode,\n rules: ReadonlyArray,\n options: ValidationOptions | undefined,\n): ReadonlyArray {\n const maxErrors = options?.maxErrors ?? 100;\n const hideSuggestions = options?.hideSuggestions ?? false;\n\n // If the schema used for validation is invalid, throw an error.\n assertValidSchema(schema);\n\n const errors: Array = [];\n const typeInfo = new TypeInfo(schema);\n const context = new ValidationContext(\n schema,\n documentAST,\n typeInfo,\n (error) => {\n if (errors.length >= maxErrors) {\n throw tooManyValidationErrorsError;\n }\n errors.push(error);\n },\n hideSuggestions,\n );\n\n // This uses a specialized visitor which runs multiple visitors in parallel,\n // while maintaining the visitor skip and break API.\n const visitor = visitInParallel(rules.map((rule) => rule(context)));\n\n // Visit the whole document with each instance of all provided rules.\n try {\n visit(\n documentAST,\n visitWithTypeInfo(typeInfo, visitor),\n QueryDocumentKeysToValidate,\n );\n } catch (e: unknown) {\n if (e === tooManyValidationErrorsError) {\n errors.push(tooManyValidationErrorsError);\n } else {\n throw e;\n }\n }\n return errors;\n}\n\n/** @internal */\nexport function validateSDL(\n documentAST: DocumentNode,\n schemaToExtend?: Maybe,\n rules: ReadonlyArray = specifiedSDLRules,\n): ReadonlyArray {\n const errors: Array = [];\n const context = new SDLValidationContext(\n documentAST,\n schemaToExtend,\n (error) => {\n errors.push(error);\n },\n );\n\n const visitors = rules.map((rule) => rule(context));\n visit(documentAST, visitInParallel(visitors));\n return errors;\n}\n\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\nexport function assertValidSDL(documentAST: DocumentNode): void {\n const errors = validateSDL(documentAST);\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\nexport function assertValidSDLExtension(\n documentAST: DocumentNode,\n schema: GraphQLSchema,\n): void {\n const errors = validateSDL(documentAST, schema);\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs new file mode 100644 index 00000000..5ace6222 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs @@ -0,0 +1,64 @@ +import { mapValue } from "../jsutils/mapValue.mjs"; +import { GraphQLError } from "../error/GraphQLError.mjs"; +import { QueryDocumentKeys } from "../language/ast.mjs"; +import { visit, visitInParallel } from "../language/visitor.mjs"; +import { assertValidSchema } from "../type/validate.mjs"; +import { TypeInfo, visitWithTypeInfo } from "../utilities/TypeInfo.mjs"; +import { shouldTrace, validateChannel } from "../diagnostics.mjs"; +import { specifiedRules, specifiedSDLRules } from "./specifiedRules.mjs"; +import { SDLValidationContext, ValidationContext, } from "./ValidationContext.mjs"; +const QueryDocumentKeysToValidate = mapValue(QueryDocumentKeys, (keys) => keys.filter((key) => key !== 'description')); +const tooManyValidationErrorsError = new GraphQLError('Too many validation errors, error limit reached. Validation aborted.'); +export function validate(schema, documentAST, rules = specifiedRules, options) { + return shouldTrace(validateChannel) + ? validateChannel.traceSync(() => validateImpl(schema, documentAST, rules, options), { schema, document: documentAST }) + : validateImpl(schema, documentAST, rules, options); +} +function validateImpl(schema, documentAST, rules, options) { + const maxErrors = options?.maxErrors ?? 100; + const hideSuggestions = options?.hideSuggestions ?? false; + assertValidSchema(schema); + const errors = []; + const typeInfo = new TypeInfo(schema); + const context = new ValidationContext(schema, documentAST, typeInfo, (error) => { + if (errors.length >= maxErrors) { + throw tooManyValidationErrorsError; + } + errors.push(error); + }, hideSuggestions); + const visitor = visitInParallel(rules.map((rule) => rule(context))); + try { + visit(documentAST, visitWithTypeInfo(typeInfo, visitor), QueryDocumentKeysToValidate); + } + catch (e) { + if (e === tooManyValidationErrorsError) { + errors.push(tooManyValidationErrorsError); + } + else { + throw e; + } + } + return errors; +} +export function validateSDL(documentAST, schemaToExtend, rules = specifiedSDLRules) { + const errors = []; + const context = new SDLValidationContext(documentAST, schemaToExtend, (error) => { + errors.push(error); + }); + const visitors = rules.map((rule) => rule(context)); + visit(documentAST, visitInParallel(visitors)); + return errors; +} +export function assertValidSDL(documentAST) { + const errors = validateSDL(documentAST); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} +export function assertValidSDLExtension(documentAST, schema) { + const errors = validateSDL(documentAST, schema); + if (errors.length !== 0) { + throw new Error(errors.map((error) => error.message).join('\n\n')); + } +} +//# sourceMappingURL=validate.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs.map new file mode 100644 index 00000000..aca98a7e --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/validation/validate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/validation/validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,gCAA+B;AAGlD,OAAO,EAAE,YAAY,EAAE,kCAAiC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,4BAA2B;AACvD,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,gCAA+B;AAGhE,OAAO,EAAE,iBAAiB,EAAE,6BAA4B;AAExD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kCAAiC;AAEvE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,2BAA0B;AAEjE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,6BAA4B;AAExE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,GAClB,gCAA+B;AAehC,MAAM,2BAA2B,GAAG,QAAQ,CAC1C,iBAAiB,EACjB,CAAC,IAA2B,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC,CAC7E,CAAC;AAEF,MAAM,4BAA4B,GAAG,IAAI,YAAY,CACnD,sEAAsE,CACvE,CAAC;AAwEF,MAAM,UAAU,QAAQ,CACtB,MAAqB,EACrB,WAAyB,EACzB,QAAuC,cAAc,EACrD,OAA2B;IAE3B,OAAO,WAAW,CAAC,eAAe,CAAC;QACjC,CAAC,CAAC,eAAe,CAAC,SAAS,CACvB,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,EACvD,EAAE,M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ils/Maybe.ts';\n\nimport { GraphQLError } from '../error/GraphQLError.ts';\n\nimport type { DocumentNode } from '../language/ast.ts';\nimport { QueryDocumentKeys } from '../language/ast.ts';\nimport { visit, visitInParallel } from '../language/visitor.ts';\n\nimport type { GraphQLSchema } from '../type/schema.ts';\nimport { assertValidSchema } from '../type/validate.ts';\n\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.ts';\n\nimport { shouldTrace, validateChannel } from '../diagnostics.ts';\n\nimport { specifiedRules, specifiedSDLRules } from './specifiedRules.ts';\nimport type { SDLValidationRule, ValidationRule } from './ValidationContext.ts';\nimport {\n SDLValidationContext,\n ValidationContext,\n} from './ValidationContext.ts';\n\n/**\n * Options used when validating a GraphQL document.\n * @category Validation\n */\nexport interface ValidationOptions {\n /** Maximum number of validation errors before validation stops. */\n maxErrors?: number;\n /** Whether suggestion text should be omitted from validation errors. */\n hideSuggestions?: Maybe;\n}\n\n// Per the specification, descriptions must not affect validation.\n// See https://spec.graphql.org/draft/#sec-Descriptions\nconst QueryDocumentKeysToValidate = mapValue(\n QueryDocumentKeys,\n (keys: ReadonlyArray) => keys.filter((key) => key !== 'description'),\n);\n\nconst tooManyValidationErrorsError = new GraphQLError(\n 'Too many validation errors, error limit reached. Validation aborted.',\n);\n\n/**\n * Implements the \"Validation\" section of the spec.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the document is valid.\n *\n * A list of specific validation rules may be provided. If not provided, the\n * default list of rules defined by the GraphQL specification will be used.\n *\n * Each validation rule is a function that returns a visitor\n * (see the language/visitor API). Visitor methods are expected to return\n * GraphQLErrors, or Arrays of GraphQLErrors when invalid.\n *\n * Validate will stop validation after a `maxErrors` limit has been reached.\n * Attackers can send pathologically invalid queries to induce a DoS attack,\n * so `maxErrors` defaults to 100 errors.\n * @param schema - Schema to validate against.\n * @param documentAST - Document AST to validate.\n * @param rules - Validation rules to apply.\n * @param options - Validation options, including error limits and suggestions.\n * @returns Validation errors, or an empty array when the document is valid.\n * @example\n * ```ts\n * // Validate with the default specified rules.\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { validate } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * fullName: String\n * }\n * `);\n *\n * validate(schema, parse('{ greeting }')); // => []\n *\n * const errors = validate(schema, parse('{ missing }'));\n * errors[0].message; // => 'Cannot query field \"missing\" on type \"Query\".'\n * ```\n * @example\n * ```ts\n * // This variant uses a custom rule list and validation options.\n * import { parse } from 'graphql/language';\n * import { buildSchema } from 'graphql/utilities';\n * import { FieldsOnCorrectTypeRule, validate } from 'graphql/validation';\n *\n * const schema = buildSchema(`\n * type Query {\n * greeting: String\n * }\n * `);\n * const document = parse('{ missingOne missingTwo }');\n *\n * const errors = validate(schema, document, [FieldsOnCorrectTypeRule], {\n * maxErrors: 1,\n * });\n *\n * errors.length; // => 2\n * errors[1].message; // => 'Too many validation errors, error limit reached. Validation aborted.'\n *\n * const hiddenSuggestionErrors = validate(\n * schema,\n * parse('{ name }'),\n * [FieldsOnCorrectTypeRule],\n * { hideSuggestions: true },\n * );\n *\n * hiddenSuggestionErrors[0].message; // => 'Cannot query field \"name\" on type \"Query\".'\n * ```\n */\nexport function validate(\n schema: GraphQLSchema,\n documentAST: DocumentNode,\n rules: ReadonlyArray = specifiedRules,\n options?: ValidationOptions,\n): ReadonlyArray {\n return shouldTrace(validateChannel)\n ? validateChannel.traceSync(\n () => validateImpl(schema, documentAST, rules, options),\n { schema, document: documentAST },\n )\n : validateImpl(schema, documentAST, rules, options);\n}\n\nfunction validateImpl(\n schema: GraphQLSchema,\n documentAST: DocumentNode,\n rules: ReadonlyArray,\n options: ValidationOptions | undefined,\n): ReadonlyArray {\n const maxErrors = options?.maxErrors ?? 100;\n const hideSuggestions = options?.hideSuggestions ?? false;\n\n // If the schema used for validation is invalid, throw an error.\n assertValidSchema(schema);\n\n const errors: Array = [];\n const typeInfo = new TypeInfo(schema);\n const context = new ValidationContext(\n schema,\n documentAST,\n typeInfo,\n (error) => {\n if (errors.length >= maxErrors) {\n throw tooManyValidationErrorsError;\n }\n errors.push(error);\n },\n hideSuggestions,\n );\n\n // This uses a specialized visitor which runs multiple visitors in parallel,\n // while maintaining the visitor skip and break API.\n const visitor = visitInParallel(rules.map((rule) => rule(context)));\n\n // Visit the whole document with each instance of all provided rules.\n try {\n visit(\n documentAST,\n visitWithTypeInfo(typeInfo, visitor),\n QueryDocumentKeysToValidate,\n );\n } catch (e: unknown) {\n if (e === tooManyValidationErrorsError) {\n errors.push(tooManyValidationErrorsError);\n } else {\n throw e;\n }\n }\n return errors;\n}\n\n/** @internal */\nexport function validateSDL(\n documentAST: DocumentNode,\n schemaToExtend?: Maybe,\n rules: ReadonlyArray = specifiedSDLRules,\n): ReadonlyArray {\n const errors: Array = [];\n const context = new SDLValidationContext(\n documentAST,\n schemaToExtend,\n (error) => {\n errors.push(error);\n },\n );\n\n const visitors = rules.map((rule) => rule(context));\n visit(documentAST, visitInParallel(visitors));\n return errors;\n}\n\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\nexport function assertValidSDL(documentAST: DocumentNode): void {\n const errors = validateSDL(documentAST);\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\nexport function assertValidSDLExtension(\n documentAST: DocumentNode,\n schema: GraphQLSchema,\n): void {\n const errors = validateSDL(documentAST, schema);\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.mts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.mts new file mode 100644 index 00000000..df2844f4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.mts @@ -0,0 +1,10 @@ +/** @category Version */ +/** A string containing the version of the GraphQL.js library */ +export declare const version: string; +/** An object containing the components of the GraphQL.js version string */ +export declare const versionInfo: Readonly<{ + major: number; + minor: number; + patch: number; + preReleaseTag: string | null; +}>; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.ts b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.ts new file mode 100644 index 00000000..df2844f4 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.d.ts @@ -0,0 +1,10 @@ +/** @category Version */ +/** A string containing the version of the GraphQL.js library */ +export declare const version: string; +/** An object containing the components of the GraphQL.js version string */ +export declare const versionInfo: Readonly<{ + major: number; + minor: number; + patch: number; + preReleaseTag: string | null; +}>; diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js new file mode 100644 index 00000000..00698654 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.versionInfo = exports.version = void 0; +exports.version = '17.0.2'; +exports.versionInfo = Object.freeze({ + major: 17, + minor: 0, + patch: 2, + preReleaseTag: null, +}); +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js.map new file mode 100644 index 00000000..33fc46dd --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAMa,QAAA,OAAO,GAAG,QAAkB,CAAC;AAG7B,QAAA,WAAW,GAKnB,MAAM,CAAC,MAAM,CAAC;IACjB,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,aAAa,EAAE,IAAI;CACpB,CAAC,CAAC","sourcesContent":["/** @category Version */\n\n// Note: This file is autogenerated using \"resources/gen-version.js\" script and\n// automatically updated by \"npm version\" command.\n\n/** A string containing the version of the GraphQL.js library */\nexport const version = '17.0.2' as string;\n\n/** An object containing the components of the GraphQL.js version string */\nexport const versionInfo: Readonly<{\n major: number;\n minor: number;\n patch: number;\n preReleaseTag: string | null;\n}> = Object.freeze({\n major: 17,\n minor: 0,\n patch: 2,\n preReleaseTag: null,\n});\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs new file mode 100644 index 00000000..3a67e1d1 --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs @@ -0,0 +1,8 @@ +export const version = '17.0.2'; +export const versionInfo = Object.freeze({ + major: 17, + minor: 0, + patch: 2, + preReleaseTag: null, +}); +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs.map b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs.map new file mode 100644 index 00000000..4356964b --- /dev/null +++ b/backend/node_modules/.pnpm/graphql@17.0.2/node_modules/graphql/version.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAkB,CAAC;AAG1C,MAAM,CAAC,MAAM,WAAW,GAKnB,MAAM,CAAC,MAAM,CAAC;IACjB,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,aAAa,EAAE,IAAI;CACpB,CAAC,CAAC","sourcesContent":["/** @category Version */\n\n// Note: This file is autogenerated using \"resources/gen-version.js\" script and\n// automatically updated by \"npm version\" command.\n\n/** A string containing the version of the GraphQL.js library */\nexport const version = '17.0.2' as string;\n\n/** An object containing the components of the GraphQL.js version string */\nexport const versionInfo: Readonly<{\n major: number;\n minor: number;\n patch: number;\n preReleaseTag: string | null;\n}> = Object.freeze({\n major: 17,\n minor: 0,\n patch: 2,\n preReleaseTag: null,\n});\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/es-define-property b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/es-define-property new file mode 120000 index 00000000..21a4f5d0 --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/es-define-property @@ -0,0 +1 @@ +../../es-define-property@1.0.1/node_modules/es-define-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.eslintrc b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.eslintrc new file mode 100644 index 00000000..2fcc002b --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": ["GetIntrinsic"], + }], + }, +} diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.github/FUNDING.yml b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.github/FUNDING.yml new file mode 100644 index 00000000..817aacf1 --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/has-property-descriptors +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.nycrc b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/CHANGELOG.md b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/CHANGELOG.md new file mode 100644 index 00000000..19c8a959 --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/CHANGELOG.md @@ -0,0 +1,35 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.1...v1.0.2) - 2024-02-12 + +### Commits + +- [Refactor] use `es-define-property` [`f93a8c8`](https://github.com/inspect-js/has-property-descriptors/commit/f93a8c85eba70cbceab500f2619fb5cce73a1805) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`42b0c9d`](https://github.com/inspect-js/has-property-descriptors/commit/42b0c9d1c23e747755f0f2924923c418ea34a9ee) +- [Deps] update `get-intrinsic` [`35e9b46`](https://github.com/inspect-js/has-property-descriptors/commit/35e9b46a7f14331bf0de98b644dd803676746037) + +## [v1.0.1](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.0...v1.0.1) - 2023-10-20 + +### Commits + +- [meta] use `npmignore` to autogenerate an npmignore file [`5bbf4da`](https://github.com/inspect-js/has-property-descriptors/commit/5bbf4dae1b58950d87bb3af508bee7513e640868) +- [actions] update rebase action to use reusable workflow [`3a5585b`](https://github.com/inspect-js/has-property-descriptors/commit/3a5585bf74988f71a8f59e67a07d594e62c51fd8) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`e5c1212`](https://github.com/inspect-js/has-property-descriptors/commit/e5c1212048a8fda549794c47863724ca60b89cae) +- [Dev Deps] update `aud`, `tape` [`e942917`](https://github.com/inspect-js/has-property-descriptors/commit/e942917b6c2f7c090d5623048989cf20d0834ebf) +- [Deps] update `get-intrinsic` [`f4a44ec`](https://github.com/inspect-js/has-property-descriptors/commit/f4a44ec6d94146fa6c550d3c15c31a2062c83ef4) +- [Deps] update `get-intrinsic` [`eeb275b`](https://github.com/inspect-js/has-property-descriptors/commit/eeb275b473e5d72ca843b61ca25cfcb06a5d4300) + +## v1.0.0 - 2022-04-14 + +### Commits + +- Initial implementation, tests [`303559f`](https://github.com/inspect-js/has-property-descriptors/commit/303559f2a72dfe7111573a1aec475ed4a184c35a) +- Initial commit [`3a7ca2d`](https://github.com/inspect-js/has-property-descriptors/commit/3a7ca2dc49f1fff0279a28bb16265e7615e14749) +- read me [`dd73dce`](https://github.com/inspect-js/has-property-descriptors/commit/dd73dce09d89d0f7a4a6e3b1e562a506f979a767) +- npm init [`c1e6557`](https://github.com/inspect-js/has-property-descriptors/commit/c1e655779de632d68cb944c50da6b71bcb7b8c85) +- Only apps should have lockfiles [`e72f7c6`](https://github.com/inspect-js/has-property-descriptors/commit/e72f7c68de534b2d273ee665f8b18d4ecc7f70b0) diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/LICENSE b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/LICENSE new file mode 100644 index 00000000..2e7b9a3e --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Inspect JS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/README.md b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/README.md new file mode 100644 index 00000000..d81fbd99 --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/README.md @@ -0,0 +1,43 @@ +# has-property-descriptors [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD. + +## Example + +```js +var hasPropertyDescriptors = require('has-property-descriptors'); +var assert = require('assert'); + +assert.equal(hasPropertyDescriptors(), true); // will be `false` in IE 6-8, and ES5 engines + +// Arrays can not have their length `[[Defined]]` in some engines +assert.equal(hasPropertyDescriptors.hasArrayLengthDefineBug(), false); // will be `true` in Firefox 4-22, and node v0.6 +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/has-property-descriptors +[npm-version-svg]: https://versionbadg.es/inspect-js/has-property-descriptors.svg +[deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors.svg +[deps-url]: https://david-dm.org/inspect-js/has-property-descriptors +[dev-deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/has-property-descriptors#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/has-property-descriptors.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/has-property-descriptors.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/has-property-descriptors.svg +[downloads-url]: https://npm-stat.com/charts.html?package=has-property-descriptors +[codecov-image]: https://codecov.io/gh/inspect-js/has-property-descriptors/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/has-property-descriptors/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-property-descriptors +[actions-url]: https://github.com/inspect-js/has-property-descriptors/actions diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js new file mode 100644 index 00000000..04804379 --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var $defineProperty = require('es-define-property'); + +var hasPropertyDescriptors = function hasPropertyDescriptors() { + return !!$defineProperty; +}; + +hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + // node v0.6 has a bug where array lengths can be Set but not Defined + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], 'length', { value: 1 }).length !== 1; + } catch (e) { + // In Firefox 4-22, defining length on an array throws an exception. + return true; + } +}; + +module.exports = hasPropertyDescriptors; diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/package.json b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/package.json new file mode 100644 index 00000000..7e70218b --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/package.json @@ -0,0 +1,77 @@ +{ + "name": "has-property-descriptors", + "version": "1.0.2", + "description": "Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/has-property-descriptors.git" + }, + "keywords": [ + "property", + "descriptors", + "has", + "environment", + "env", + "defineProperty", + "getOwnPropertyDescriptor" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/has-property-descriptors/issues" + }, + "homepage": "https://github.com/inspect-js/has-property-descriptors#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4" + }, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/test/index.js b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/test/index.js new file mode 100644 index 00000000..7f02bd3e --- /dev/null +++ b/backend/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/test/index.js @@ -0,0 +1,57 @@ +'use strict'; + +var test = require('tape'); + +var hasPropertyDescriptors = require('../'); + +var sentinel = {}; + +test('hasPropertyDescriptors', function (t) { + t.equal(typeof hasPropertyDescriptors, 'function', 'is a function'); + t.equal(typeof hasPropertyDescriptors.hasArrayLengthDefineBug, 'function', '`hasArrayLengthDefineBug` property is a function'); + + var yes = hasPropertyDescriptors(); + t.test('property descriptors', { skip: !yes }, function (st) { + var o = { a: sentinel }; + + st.deepEqual( + Object.getOwnPropertyDescriptor(o, 'a'), + { + configurable: true, + enumerable: true, + value: sentinel, + writable: true + }, + 'has expected property descriptor' + ); + + Object.defineProperty(o, 'a', { enumerable: false, writable: false }); + + st.deepEqual( + Object.getOwnPropertyDescriptor(o, 'a'), + { + configurable: true, + enumerable: false, + value: sentinel, + writable: false + }, + 'has expected property descriptor after [[Define]]' + ); + + st.end(); + }); + + var arrayBug = hasPropertyDescriptors.hasArrayLengthDefineBug(); + t.test('defining array lengths', { skip: !yes || arrayBug }, function (st) { + var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays + st.equal(arr.length, 3, 'array starts with length 3'); + + Object.defineProperty(arr, 'length', { value: 5 }); + + st.equal(arr.length, 5, 'array ends with length 5'); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.eslintrc b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.eslintrc new file mode 100644 index 00000000..2d9a66a8 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": 0, + "multiline-comment-style": 0, + } +} diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.github/FUNDING.yml b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.github/FUNDING.yml new file mode 100644 index 00000000..04cf87e6 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/has-symbols +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.nycrc b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/CHANGELOG.md b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/CHANGELOG.md new file mode 100644 index 00000000..cc3cf839 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/CHANGELOG.md @@ -0,0 +1,91 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/inspect-js/has-symbols/compare/v1.0.3...v1.1.0) - 2024-12-02 + +### Commits + +- [actions] update workflows [`548c0bf`](https://github.com/inspect-js/has-symbols/commit/548c0bf8c9b1235458df7a1c0490b0064647a282) +- [actions] further shard; update action deps [`bec56bb`](https://github.com/inspect-js/has-symbols/commit/bec56bb0fb44b43a786686b944875a3175cf3ff3) +- [meta] use `npmignore` to autogenerate an npmignore file [`ac81032`](https://github.com/inspect-js/has-symbols/commit/ac81032809157e0a079e5264e9ce9b6f1275777e) +- [New] add types [`6469cbf`](https://github.com/inspect-js/has-symbols/commit/6469cbff1866cfe367b2b3d181d9296ec14b2a3d) +- [actions] update rebase action to use reusable workflow [`9c9d4d0`](https://github.com/inspect-js/has-symbols/commit/9c9d4d0d8938e4b267acdf8e421f4e92d1716d72) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`adb5887`](https://github.com/inspect-js/has-symbols/commit/adb5887ca9444849b08beb5caaa9e1d42320cdfb) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`13ec198`](https://github.com/inspect-js/has-symbols/commit/13ec198ec80f1993a87710af1606a1970b22c7cb) +- [Dev Deps] update `auto-changelog`, `core-js`, `tape` [`941be52`](https://github.com/inspect-js/has-symbols/commit/941be5248387cab1da72509b22acf3fdb223f057) +- [Tests] replace `aud` with `npm audit` [`74f49e9`](https://github.com/inspect-js/has-symbols/commit/74f49e9a9d17a443020784234a1c53ce765b3559) +- [Dev Deps] update `npmignore` [`9c0ac04`](https://github.com/inspect-js/has-symbols/commit/9c0ac0452a834f4c2a4b54044f2d6a89f17e9a70) +- [Dev Deps] add missing peer dep [`52337a5`](https://github.com/inspect-js/has-symbols/commit/52337a5621cced61f846f2afdab7707a8132cc12) + +## [v1.0.3](https://github.com/inspect-js/has-symbols/compare/v1.0.2...v1.0.3) - 2022-03-01 + +### Commits + +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`518b28f`](https://github.com/inspect-js/has-symbols/commit/518b28f6c5a516cbccae30794e40aa9f738b1693) +- [meta] add `bugs` and `homepage` fields; reorder package.json [`c480b13`](https://github.com/inspect-js/has-symbols/commit/c480b13fd6802b557e1cef9749872cb5fdeef744) +- [actions] reuse common workflows [`01d0ee0`](https://github.com/inspect-js/has-symbols/commit/01d0ee0a8d97c0947f5edb73eb722027a77b2b07) +- [actions] update codecov uploader [`6424ebe`](https://github.com/inspect-js/has-symbols/commit/6424ebe86b2c9c7c3d2e9bd4413a4e4f168cb275) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`dfa7e7f`](https://github.com/inspect-js/has-symbols/commit/dfa7e7ff38b594645d8c8222aab895157fa7e282) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0c8d436`](https://github.com/inspect-js/has-symbols/commit/0c8d43685c45189cea9018191d4fd7eca91c9d02) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`9026554`](https://github.com/inspect-js/has-symbols/commit/902655442a1bf88e72b42345494ef0c60f5d36ab) +- [readme] add actions and codecov badges [`eaa9682`](https://github.com/inspect-js/has-symbols/commit/eaa9682f990f481d3acf7a1c7600bec36f7b3adc) +- [Dev Deps] update `eslint`, `tape` [`bc7a3ba`](https://github.com/inspect-js/has-symbols/commit/bc7a3ba46f27b7743f8a2579732d59d1b9ac791e) +- [Dev Deps] update `eslint`, `auto-changelog` [`0ace00a`](https://github.com/inspect-js/has-symbols/commit/0ace00af08a88cdd1e6ce0d60357d941c60c2d9f) +- [meta] use `prepublishOnly` script for npm 7+ [`093f72b`](https://github.com/inspect-js/has-symbols/commit/093f72bc2b0ed00c781f444922a5034257bf561d) +- [Tests] test on all 16 minors [`9b80d3d`](https://github.com/inspect-js/has-symbols/commit/9b80d3d9102529f04c20ec5b1fcc6e38426c6b03) + +## [v1.0.2](https://github.com/inspect-js/has-symbols/compare/v1.0.1...v1.0.2) - 2021-02-27 + +### Fixed + +- [Fix] use a universal way to get the original Symbol [`#11`](https://github.com/inspect-js/has-symbols/issues/11) + +### Commits + +- [Tests] migrate tests to Github Actions [`90ae798`](https://github.com/inspect-js/has-symbols/commit/90ae79820bdfe7bc703d67f5f3c5e205f98556d3) +- [meta] do not publish github action workflow files [`29e60a1`](https://github.com/inspect-js/has-symbols/commit/29e60a1b7c25c7f1acf7acff4a9320d0d10c49b4) +- [Tests] run `nyc` on all tests [`8476b91`](https://github.com/inspect-js/has-symbols/commit/8476b915650d360915abe2522505abf4b0e8f0ae) +- [readme] fix repo URLs, remove defunct badges [`126288e`](https://github.com/inspect-js/has-symbols/commit/126288ecc1797c0a40247a6b78bcb2e0bc5d7036) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `core-js`, `get-own-property-symbols` [`d84bdfa`](https://github.com/inspect-js/has-symbols/commit/d84bdfa48ac5188abbb4904b42614cd6c030940a) +- [Tests] fix linting errors [`0df3070`](https://github.com/inspect-js/has-symbols/commit/0df3070b981b6c9f2ee530c09189a7f5c6def839) +- [actions] add "Allow Edits" workflow [`1e6bc29`](https://github.com/inspect-js/has-symbols/commit/1e6bc29b188f32b9648657b07eda08504be5aa9c) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`36cea2a`](https://github.com/inspect-js/has-symbols/commit/36cea2addd4e6ec435f35a2656b4e9ef82498e9b) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1278338`](https://github.com/inspect-js/has-symbols/commit/127833801865fbc2cc8979beb9ca869c7bfe8222) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1493254`](https://github.com/inspect-js/has-symbols/commit/1493254eda13db5fb8fc5e4a3e8324b3d196029d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js` [`b090bf2`](https://github.com/inspect-js/has-symbols/commit/b090bf214d3679a30edc1e2d729d466ab5183e1d) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`4addb7a`](https://github.com/inspect-js/has-symbols/commit/4addb7ab4dc73f927ae99928d68817554fc21dc0) +- [Dev Deps] update `auto-changelog`, `tape` [`81d0baf`](https://github.com/inspect-js/has-symbols/commit/81d0baf3816096a89a8558e8043895f7a7d10d8b) +- [Dev Deps] update `auto-changelog`; add `aud` [`1a4e561`](https://github.com/inspect-js/has-symbols/commit/1a4e5612c25d91c3a03d509721d02630bc4fe3da) +- [readme] remove unused testling URLs [`3000941`](https://github.com/inspect-js/has-symbols/commit/3000941f958046e923ed8152edb1ef4a599e6fcc) +- [Tests] only audit prod deps [`692e974`](https://github.com/inspect-js/has-symbols/commit/692e9743c912410e9440207631a643a34b4741a1) +- [Dev Deps] update `@ljharb/eslint-config` [`51c946c`](https://github.com/inspect-js/has-symbols/commit/51c946c7f6baa793ec5390bb5a45cdce16b4ba76) + +## [v1.0.1](https://github.com/inspect-js/has-symbols/compare/v1.0.0...v1.0.1) - 2019-11-16 + +### Commits + +- [Tests] use shared travis-ci configs [`ce396c9`](https://github.com/inspect-js/has-symbols/commit/ce396c9419ff11c43d0da5d05cdbb79f7fb42229) +- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v4.9`; use `nvm install-latest-npm` [`0690732`](https://github.com/inspect-js/has-symbols/commit/0690732801f47ab429f39ba1962f522d5c462d6b) +- [meta] add `auto-changelog` [`2163d0b`](https://github.com/inspect-js/has-symbols/commit/2163d0b7f36343076b8f947cd1667dd1750f26fc) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`8e0951f`](https://github.com/inspect-js/has-symbols/commit/8e0951f1a7a2e52068222b7bb73511761e6e4d9c) +- [actions] add automatic rebasing / merge commit blocking [`b09cdb7`](https://github.com/inspect-js/has-symbols/commit/b09cdb7cd7ee39e7a769878f56e2d6066f5ccd1d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `core-js`, `get-own-property-symbols`, `tape` [`1dd42cd`](https://github.com/inspect-js/has-symbols/commit/1dd42cd86183ed0c50f99b1062345c458babca91) +- [meta] create FUNDING.yml [`aa57a17`](https://github.com/inspect-js/has-symbols/commit/aa57a17b19708906d1927f821ea8e73394d84ca4) +- Only apps should have lockfiles [`a2d8bea`](https://github.com/inspect-js/has-symbols/commit/a2d8bea23a97d15c09eaf60f5b107fcf9a4d57aa) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9e96cb7`](https://github.com/inspect-js/has-symbols/commit/9e96cb783746cbed0c10ef78e599a8eaa7ebe193) +- [meta] add `funding` field [`a0b32cf`](https://github.com/inspect-js/has-symbols/commit/a0b32cf68e803f963c1639b6d47b0a9d6440bab0) +- [Dev Deps] update `safe-publish-latest` [`cb9f0a5`](https://github.com/inspect-js/has-symbols/commit/cb9f0a521a3a1790f1064d437edd33bb6c3d6af0) + +## v1.0.0 - 2016-09-19 + +### Commits + +- Tests. [`ecb6eb9`](https://github.com/inspect-js/has-symbols/commit/ecb6eb934e4883137f3f93b965ba5e0a98df430d) +- package.json [`88a337c`](https://github.com/inspect-js/has-symbols/commit/88a337cee0864a0da35f5d19e69ff0ef0150e46a) +- Initial commit [`42e1e55`](https://github.com/inspect-js/has-symbols/commit/42e1e5502536a2b8ac529c9443984acd14836b1c) +- Initial implementation. [`33f5cc6`](https://github.com/inspect-js/has-symbols/commit/33f5cc6cdff86e2194b081ee842bfdc63caf43fb) +- read me [`01f1170`](https://github.com/inspect-js/has-symbols/commit/01f1170188ff7cb1558aa297f6ba5b516c6d7b0c) diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/LICENSE b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/LICENSE new file mode 100644 index 00000000..df31cbf3 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/README.md b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/README.md new file mode 100644 index 00000000..33905f0f --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/README.md @@ -0,0 +1,46 @@ +# has-symbols [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Determine if the JS environment has Symbol support. Supports spec, or shams. + +## Example + +```js +var hasSymbols = require('has-symbols'); + +hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable. + +var hasSymbolsKinda = require('has-symbols/shams'); +hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec. +``` + +## Supported Symbol shams + - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) + - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/has-symbols +[2]: https://versionbadg.es/inspect-js/has-symbols.svg +[5]: https://david-dm.org/inspect-js/has-symbols.svg +[6]: https://david-dm.org/inspect-js/has-symbols +[7]: https://david-dm.org/inspect-js/has-symbols/dev-status.svg +[8]: https://david-dm.org/inspect-js/has-symbols#info=devDependencies +[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/has-symbols.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/has-symbols.svg +[downloads-url]: https://npm-stat.com/charts.html?package=has-symbols +[codecov-image]: https://codecov.io/gh/inspect-js/has-symbols/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/has-symbols/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-symbols +[actions-url]: https://github.com/inspect-js/has-symbols/actions diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.d.ts b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.d.ts new file mode 100644 index 00000000..9b985950 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.d.ts @@ -0,0 +1,3 @@ +declare function hasNativeSymbols(): boolean; + +export = hasNativeSymbols; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js new file mode 100644 index 00000000..fa65265a --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js @@ -0,0 +1,14 @@ +'use strict'; + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = require('./shams'); + +/** @type {import('.')} */ +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/package.json b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/package.json new file mode 100644 index 00000000..d835e20b --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/package.json @@ -0,0 +1,111 @@ +{ + "name": "has-symbols", + "version": "1.1.0", + "description": "Determine if the JS environment has Symbol support. Supports spec, or shams.", + "main": "index.js", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent lint", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "tests-only": "npm run test:stock && npm run test:shams", + "test:stock": "nyc node test", + "test:staging": "nyc node --harmony --es-staging test", + "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs", + "test:shams:corejs": "nyc node test/shams/core-js.js", + "test:shams:getownpropertysymbols": "nyc node test/shams/get-own-property-symbols.js", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/has-symbols.git" + }, + "keywords": [ + "Symbol", + "symbols", + "typeof", + "sham", + "polyfill", + "native", + "core-js", + "ES6" + ], + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/has-symbols/issues" + }, + "homepage": "https://github.com/ljharb/has-symbols#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.0", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.0", + "@types/core-js": "^2.5.8", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "core-js": "^2.6.12", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "get-own-property-symbols": "^0.9.5", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "types" + ] + } +} diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.d.ts b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.d.ts new file mode 100644 index 00000000..8d0bf243 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.d.ts @@ -0,0 +1,3 @@ +declare function hasSymbolShams(): boolean; + +export = hasSymbolShams; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js new file mode 100644 index 00000000..f97b4741 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js @@ -0,0 +1,45 @@ +'use strict'; + +/** @type {import('./shams')} */ +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + /** @type {{ [k in symbol]?: unknown }} */ + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + // eslint-disable-next-line no-extra-parens + var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/index.js b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/index.js new file mode 100644 index 00000000..352129ca --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('../'); +var runSymbolTests = require('./tests'); + +test('interface', function (t) { + t.equal(typeof hasSymbols, 'function', 'is a function'); + t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean'); + t.end(); +}); + +test('Symbols are supported', { skip: !hasSymbols() }, function (t) { + runSymbolTests(t); + t.end(); +}); + +test('Symbols are not supported', { skip: hasSymbols() }, function (t) { + t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined'); + t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist'); + t.end(); +}); diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/core-js.js b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/core-js.js new file mode 100644 index 00000000..1a29024e --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/core-js.js @@ -0,0 +1,29 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + test('has native Symbol support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol(), 'symbol'); + t.end(); + }); + // @ts-expect-error TS is stupid and doesn't know about top level return + return; +} + +var hasSymbols = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); + require('core-js/fn/symbol'); + require('core-js/fn/symbol/to-string-tag'); + + require('../tests')(t); + + var hasSymbolsAfter = hasSymbols(); + t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/get-own-property-symbols.js b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/get-own-property-symbols.js new file mode 100644 index 00000000..e0296f8e --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/shams/get-own-property-symbols.js @@ -0,0 +1,29 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + test('has native Symbol support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol(), 'symbol'); + t.end(); + }); + // @ts-expect-error TS is stupid and doesn't know about top level return + return; +} + +var hasSymbols = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); + + require('get-own-property-symbols'); + + require('../tests')(t); + + var hasSymbolsAfter = hasSymbols(); + t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/tests.js b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/tests.js new file mode 100644 index 00000000..66a2cb80 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/test/tests.js @@ -0,0 +1,58 @@ +'use strict'; + +/** @type {(t: import('tape').Test) => false | void} */ +// eslint-disable-next-line consistent-return +module.exports = function runSymbolTests(t) { + t.equal(typeof Symbol, 'function', 'global Symbol is a function'); + + if (typeof Symbol !== 'function') { return false; } + + t.notEqual(Symbol(), Symbol(), 'two symbols are not equal'); + + /* + t.equal( + Symbol.prototype.toString.call(Symbol('foo')), + Symbol.prototype.toString.call(Symbol('foo')), + 'two symbols with the same description stringify the same' + ); + */ + + /* + var foo = Symbol('foo'); + + t.notEqual( + String(foo), + String(Symbol('bar')), + 'two symbols with different descriptions do not stringify the same' + ); + */ + + t.equal(typeof Symbol.prototype.toString, 'function', 'Symbol#toString is a function'); + // t.equal(String(foo), Symbol.prototype.toString.call(foo), 'Symbol#toString equals String of the same symbol'); + + t.equal(typeof Object.getOwnPropertySymbols, 'function', 'Object.getOwnPropertySymbols is a function'); + + /** @type {{ [k in symbol]?: unknown }} */ + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + t.notEqual(typeof sym, 'string', 'Symbol is not a string'); + t.equal(Object.prototype.toString.call(sym), '[object Symbol]', 'symbol primitive Object#toStrings properly'); + t.equal(Object.prototype.toString.call(symObj), '[object Symbol]', 'symbol primitive Object#toStrings properly'); + + var symVal = 42; + obj[sym] = symVal; + // eslint-disable-next-line no-restricted-syntax, no-unused-vars + for (var _ in obj) { t.fail('symbol property key was found in for..in of object'); } + + t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object'); + t.deepEqual(Object.getOwnPropertyNames(obj), [], 'no own names on symbol-valued object'); + t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'one own symbol on symbol-valued object'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, sym), true, 'symbol is enumerable'); + t.deepEqual(Object.getOwnPropertyDescriptor(obj, sym), { + configurable: true, + enumerable: true, + value: 42, + writable: true + }, 'property descriptor is correct'); +}; diff --git a/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/tsconfig.json b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/tsconfig.json new file mode 100644 index 00000000..ba99af43 --- /dev/null +++ b/backend/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ES2021", + "maxNodeModuleJsDepth": 0, + }, + "exclude": [ + "coverage" + ] +} diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-symbols b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-symbols new file mode 120000 index 00000000..8440b139 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-symbols @@ -0,0 +1 @@ +../../has-symbols@1.1.0/node_modules/has-symbols \ No newline at end of file diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.eslintrc b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.eslintrc new file mode 100644 index 00000000..3b5d9e90 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.github/FUNDING.yml b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.github/FUNDING.yml new file mode 100644 index 00000000..7a450e70 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/has-tostringtag +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.nycrc b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/CHANGELOG.md b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/CHANGELOG.md new file mode 100644 index 00000000..eb186ec6 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/CHANGELOG.md @@ -0,0 +1,42 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/inspect-js/has-tostringtag/compare/v1.0.1...v1.0.2) - 2024-02-01 + +### Fixed + +- [Fix] move `has-symbols` back to prod deps [`#3`](https://github.com/inspect-js/has-tostringtag/issues/3) + +## [v1.0.1](https://github.com/inspect-js/has-tostringtag/compare/v1.0.0...v1.0.1) - 2024-02-01 + +### Commits + +- [patch] add types [`9276414`](https://github.com/inspect-js/has-tostringtag/commit/9276414b22fab3eeb234688841722c4be113201f) +- [meta] use `npmignore` to autogenerate an npmignore file [`5c0dcd1`](https://github.com/inspect-js/has-tostringtag/commit/5c0dcd1ff66419562a30d1fd88b966cc36bce5fc) +- [actions] reuse common workflows [`dee9509`](https://github.com/inspect-js/has-tostringtag/commit/dee950904ab5719b62cf8d73d2ac950b09093266) +- [actions] update codecov uploader [`b8cb3a0`](https://github.com/inspect-js/has-tostringtag/commit/b8cb3a0b8ffbb1593012c4c2daa45fb25642825d) +- [Tests] generate coverage [`be5b288`](https://github.com/inspect-js/has-tostringtag/commit/be5b28889e2735cdbcef387f84c2829995f2f05e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`69a0827`](https://github.com/inspect-js/has-tostringtag/commit/69a0827974e9b877b2c75b70b057555da8f25a65) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`4c9e210`](https://github.com/inspect-js/has-tostringtag/commit/4c9e210a5682f0557a3235d36b68ce809d7fb825) +- [actions] update rebase action to use reusable workflow [`ca8dcd3`](https://github.com/inspect-js/has-tostringtag/commit/ca8dcd3a6f3f5805d7e3fd461b654aedba0946e7) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`07f3eaf`](https://github.com/inspect-js/has-tostringtag/commit/07f3eafa45dd98208c94479737da77f9a69b94c4) +- [Deps] update `has-symbols` [`999e009`](https://github.com/inspect-js/has-tostringtag/commit/999e0095a7d1749a58f55472ec8bf8108cdfdcf3) +- [Tests] remove staging tests since they fail on modern node [`9d9526b`](https://github.com/inspect-js/has-tostringtag/commit/9d9526b1dc1ca7f2292b52efda4c3d857b0e39bd) + +## v1.0.0 - 2021-08-05 + +### Commits + +- Tests [`6b6f573`](https://github.com/inspect-js/has-tostringtag/commit/6b6f5734dc2058badb300ff0783efdad95fe1a65) +- Initial commit [`2f8190e`](https://github.com/inspect-js/has-tostringtag/commit/2f8190e799fac32ba9b95a076c0255e01d7ce475) +- [meta] do not publish github action workflow files [`6e08cc4`](https://github.com/inspect-js/has-tostringtag/commit/6e08cc4e0fea7ec71ef66e70734b2af2c4a8b71b) +- readme [`94bed6c`](https://github.com/inspect-js/has-tostringtag/commit/94bed6c9560cbbfda034f8d6c260bb7b0db33c1a) +- npm init [`be67840`](https://github.com/inspect-js/has-tostringtag/commit/be67840ab92ee7adb98bcc65261975543f815fa5) +- Implementation [`c4914ec`](https://github.com/inspect-js/has-tostringtag/commit/c4914ecc51ddee692c85b471ae0a5d8123030fbf) +- [meta] use `auto-changelog` [`4aaf768`](https://github.com/inspect-js/has-tostringtag/commit/4aaf76895ae01d7b739f2b19f967ef2372506cd7) +- Only apps should have lockfiles [`bc4d99e`](https://github.com/inspect-js/has-tostringtag/commit/bc4d99e4bf494afbaa235c5f098df6e642edf724) +- [meta] add `safe-publish-latest` [`6523c05`](https://github.com/inspect-js/has-tostringtag/commit/6523c05c9b87140f3ae74c9daf91633dd9ff4e1f) diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/LICENSE b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/LICENSE new file mode 100644 index 00000000..7948bc02 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Inspect JS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/README.md b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/README.md new file mode 100644 index 00000000..67a5e929 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/README.md @@ -0,0 +1,46 @@ +# has-tostringtag [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams. + +## Example + +```js +var hasSymbolToStringTag = require('has-tostringtag'); + +hasSymbolToStringTag() === true; // if the environment has native Symbol.toStringTag support. Not polyfillable, not forgeable. + +var hasSymbolToStringTagKinda = require('has-tostringtag/shams'); +hasSymbolToStringTagKinda() === true; // if the environment has a Symbol.toStringTag sham that mostly follows the spec. +``` + +## Supported Symbol shams + - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) + - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/has-tostringtag +[2]: https://versionbadg.es/inspect-js/has-tostringtag.svg +[5]: https://david-dm.org/inspect-js/has-tostringtag.svg +[6]: https://david-dm.org/inspect-js/has-tostringtag +[7]: https://david-dm.org/inspect-js/has-tostringtag/dev-status.svg +[8]: https://david-dm.org/inspect-js/has-tostringtag#info=devDependencies +[11]: https://nodei.co/npm/has-tostringtag.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/has-tostringtag.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/has-tostringtag.svg +[downloads-url]: https://npm-stat.com/charts.html?package=has-tostringtag +[codecov-image]: https://codecov.io/gh/inspect-js/has-tostringtag/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/has-tostringtag/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-tostringtag +[actions-url]: https://github.com/inspect-js/has-tostringtag/actions diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.d.ts b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.d.ts new file mode 100644 index 00000000..a61bc60a --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.d.ts @@ -0,0 +1,3 @@ +declare function hasToStringTag(): boolean; + +export = hasToStringTag; diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.js b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.js new file mode 100644 index 00000000..77bfa007 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var hasSymbols = require('has-symbols'); + +/** @type {import('.')} */ +module.exports = function hasToStringTag() { + return hasSymbols() && typeof Symbol.toStringTag === 'symbol'; +}; diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/package.json b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/package.json new file mode 100644 index 00000000..e5b03002 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/package.json @@ -0,0 +1,108 @@ +{ + "name": "has-tostringtag", + "version": "1.0.2", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "description": "Determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams.", + "license": "MIT", + "main": "index.js", + "types": "./index.d.ts", + "exports": { + ".": [ + { + "types": "./index.d.ts", + "default": "./index.js" + }, + "./index.js" + ], + "./shams": [ + { + "types": "./shams.d.ts", + "default": "./shams.js" + }, + "./shams.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent lint", + "test": "npm run tests-only", + "posttest": "aud --production", + "tests-only": "npm run test:stock && npm run test:shams", + "test:stock": "nyc node test", + "test:staging": "nyc node --harmony --es-staging test", + "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs", + "test:shams:corejs": "nyc node test/shams/core-js.js", + "test:shams:getownpropertysymbols": "nyc node test/shams/get-own-property-symbols.js", + "lint": "eslint --ext=js,mjs .", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/has-tostringtag.git" + }, + "bugs": { + "url": "https://github.com/inspect-js/has-tostringtag/issues" + }, + "homepage": "https://github.com/inspect-js/has-tostringtag#readme", + "keywords": [ + "javascript", + "ecmascript", + "symbol", + "symbols", + "tostringtag", + "Symbol.toStringTag" + ], + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/has-symbols": "^1.0.2", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "core-js": "^2.6.12", + "eslint": "=8.8.0", + "get-own-property-symbols": "^0.9.5", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "dependencies": { + "has-symbols": "^1.0.3" + } +} diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.d.ts b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.d.ts new file mode 100644 index 00000000..ea4aeecf --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.d.ts @@ -0,0 +1,3 @@ +declare function hasToStringTagShams(): boolean; + +export = hasToStringTagShams; diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js new file mode 100644 index 00000000..809580db --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js @@ -0,0 +1,8 @@ +'use strict'; + +var hasSymbols = require('has-symbols/shams'); + +/** @type {import('.')} */ +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; +}; diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/index.js b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/index.js new file mode 100644 index 00000000..0679afdf --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var test = require('tape'); +var hasSymbolToStringTag = require('../'); +var runSymbolTests = require('./tests'); + +test('interface', function (t) { + t.equal(typeof hasSymbolToStringTag, 'function', 'is a function'); + t.equal(typeof hasSymbolToStringTag(), 'boolean', 'returns a boolean'); + t.end(); +}); + +test('Symbol.toStringTag exists', { skip: !hasSymbolToStringTag() }, function (t) { + runSymbolTests(t); + t.end(); +}); + +test('Symbol.toStringTag does not exist', { skip: hasSymbolToStringTag() }, function (t) { + t.equal(typeof Symbol === 'undefined' ? 'undefined' : typeof Symbol.toStringTag, 'undefined', 'global Symbol.toStringTag is undefined'); + t.end(); +}); diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/core-js.js b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/core-js.js new file mode 100644 index 00000000..7ab214da --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/core-js.js @@ -0,0 +1,31 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol') { + test('has native Symbol.toStringTag support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol.toStringTag, 'symbol'); + t.end(); + }); + // @ts-expect-error CJS has top-level return + return; +} + +var hasSymbolToStringTag = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbolToStringTag(), false, 'hasSymbolToStringTag is false before polyfilling'); + // @ts-expect-error no types defined + require('core-js/fn/symbol'); + // @ts-expect-error no types defined + require('core-js/fn/symbol/to-string-tag'); + + require('../tests')(t); + + var hasToStringTagAfter = hasSymbolToStringTag(); + t.equal(hasToStringTagAfter, true, 'hasSymbolToStringTag is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js new file mode 100644 index 00000000..c8af44c5 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js @@ -0,0 +1,30 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + test('has native Symbol support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol(), 'symbol'); + t.end(); + }); + // @ts-expect-error CJS has top-level return + return; +} + +var hasSymbolToStringTag = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbolToStringTag(), false, 'hasSymbolToStringTag is false before polyfilling'); + + // @ts-expect-error no types defined + require('get-own-property-symbols'); + + require('../tests')(t); + + var hasToStringTagAfter = hasSymbolToStringTag(); + t.equal(hasToStringTagAfter, true, 'hasSymbolToStringTag is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/tests.js b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/tests.js new file mode 100644 index 00000000..2aa0d488 --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/test/tests.js @@ -0,0 +1,15 @@ +'use strict'; + +// eslint-disable-next-line consistent-return +module.exports = /** @type {(t: import('tape').Test) => void | false} */ function runSymbolTests(t) { + t.equal(typeof Symbol, 'function', 'global Symbol is a function'); + t.ok(Symbol.toStringTag, 'Symbol.toStringTag exists'); + + if (typeof Symbol !== 'function' || !Symbol.toStringTag) { return false; } + + /** @type {{ [Symbol.toStringTag]?: 'test'}} */ + var obj = {}; + obj[Symbol.toStringTag] = 'test'; + + t.equal(Object.prototype.toString.call(obj), '[object test]'); +}; diff --git a/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/tsconfig.json b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/tsconfig.json new file mode 100644 index 00000000..2002ce5a --- /dev/null +++ b/backend/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/tsconfig.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 0, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + + /* Completeness */ + //"skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage" + ] +} diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/function-bind b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/function-bind new file mode 120000 index 00000000..62a99de1 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/function-bind @@ -0,0 +1 @@ +../../function-bind@1.1.2/node_modules/function-bind \ No newline at end of file diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.github/FUNDING.yml b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.github/FUNDING.yml new file mode 100644 index 00000000..d68c8b71 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/hasown +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.nycrc b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/CHANGELOG.md b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/CHANGELOG.md new file mode 100644 index 00000000..90a43dc3 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/CHANGELOG.md @@ -0,0 +1,58 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.0.4](https://github.com/inspect-js/hasOwn/compare/v2.0.3...v2.0.4) - 2026-05-28 + +### Commits + +- [types] drop the dead key-narrowing overload [`fdab00e`](https://github.com/inspect-js/hasOwn/commit/fdab00e2703e65411424e19bf86a7e72a8f10da9) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `eslint` [`91f6247`](https://github.com/inspect-js/hasOwn/commit/91f624768dd0f7db0d019b89d4d86bd66e20ec30) + +## [v2.0.3](https://github.com/inspect-js/hasOwn/compare/v2.0.2...v2.0.3) - 2026-04-17 + +### Commits + +- [actions] update workflows [`fb837b8`](https://github.com/inspect-js/hasOwn/commit/fb837b849bcdb8416fdc8fd344edfacd5574696c) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `eslint`, `mock-property`, `npmignore`, `tape` [`f4b279b`](https://github.com/inspect-js/hasOwn/commit/f4b279bd682be34b3f0ede2a58d4e8acb58d6d47) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`; migrate to flat config [`7e415ce`](https://github.com/inspect-js/hasOwn/commit/7e415cee55ebf43b3c34d7fd86db73a9928b05f7) +- [Dev Deps] update `eslint` [`ef313da`](https://github.com/inspect-js/hasOwn/commit/ef313da342d33b60e23e738b9f5a86f6065f39ef) +- [meta] use `npm audit` instead of `aud` [`d5c6d4d`](https://github.com/inspect-js/hasOwn/commit/d5c6d4d7a19c6ca4f14ac173b30d8bf25abcabee) +- [types] add overload that narrows the key [`cc03a09`](https://github.com/inspect-js/hasOwn/commit/cc03a097e9402fb8b86d413050e67f790dd6c8c5) + +## [v2.0.2](https://github.com/inspect-js/hasOwn/compare/v2.0.1...v2.0.2) - 2024-03-10 + +### Commits + +- [types] use shared config [`68e9d4d`](https://github.com/inspect-js/hasOwn/commit/68e9d4dab6facb4f05f02c6baea94a3f2a4e44b2) +- [actions] remove redundant finisher; use reusable workflow [`241a68e`](https://github.com/inspect-js/hasOwn/commit/241a68e13ea1fe52bec5ba7f74144befc31fae7b) +- [Tests] increase coverage [`4125c0d`](https://github.com/inspect-js/hasOwn/commit/4125c0d6121db56ae30e38346dfb0c000b04f0a7) +- [Tests] skip `npm ls` in old node due to TS [`01b9282`](https://github.com/inspect-js/hasOwn/commit/01b92822f9971dea031eafdd14767df41d61c202) +- [types] improve predicate type [`d340f85`](https://github.com/inspect-js/hasOwn/commit/d340f85ce02e286ef61096cbbb6697081d40a12b) +- [Dev Deps] update `tape` [`70089fc`](https://github.com/inspect-js/hasOwn/commit/70089fcf544e64acc024cbe60f5a9b00acad86de) +- [Tests] use `@arethetypeswrong/cli` [`50b272c`](https://github.com/inspect-js/hasOwn/commit/50b272c829f40d053a3dd91c9796e0ac0b2af084) + +## [v2.0.1](https://github.com/inspect-js/hasOwn/compare/v2.0.0...v2.0.1) - 2024-02-10 + +### Commits + +- [types] use a handwritten d.ts file; fix exported type [`012b989`](https://github.com/inspect-js/hasOwn/commit/012b9898ccf91dc441e2ebf594ff70270a5fda58) +- [Dev Deps] update `@types/function-bind`, `@types/mock-property`, `@types/tape`, `aud`, `mock-property`, `npmignore`, `tape`, `typescript` [`977a56f`](https://github.com/inspect-js/hasOwn/commit/977a56f51a1f8b20566f3c471612137894644025) +- [meta] add `sideEffects` flag [`3a60b7b`](https://github.com/inspect-js/hasOwn/commit/3a60b7bf42fccd8c605e5f145a6fcc83b13cb46f) + +## [v2.0.0](https://github.com/inspect-js/hasOwn/compare/v1.0.1...v2.0.0) - 2023-10-19 + +### Commits + +- revamped implementation, tests, readme [`72bf8b3`](https://github.com/inspect-js/hasOwn/commit/72bf8b338e77a638f0a290c63ffaed18339c36b4) +- [meta] revamp package.json [`079775f`](https://github.com/inspect-js/hasOwn/commit/079775fb1ec72c1c6334069593617a0be3847458) +- Only apps should have lockfiles [`6640e23`](https://github.com/inspect-js/hasOwn/commit/6640e233d1bb8b65260880f90787637db157d215) + +## v1.0.1 - 2023-10-10 + +### Commits + +- Initial commit [`8dbfde6`](https://github.com/inspect-js/hasOwn/commit/8dbfde6e8fb0ebb076fab38d138f2984eb340a62) diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/LICENSE b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/LICENSE new file mode 100644 index 00000000..03149290 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Jordan Harband and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/README.md b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/README.md new file mode 100644 index 00000000..f759b8a8 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/README.md @@ -0,0 +1,40 @@ +# hasown [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A robust, ES3 compatible, "has own property" predicate. + +## Example + +```js +const assert = require('assert'); +const hasOwn = require('hasown'); + +assert.equal(hasOwn({}, 'toString'), false); +assert.equal(hasOwn([], 'length'), true); +assert.equal(hasOwn({ a: 42 }, 'a'), true); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/hasown +[npm-version-svg]: https://versionbadg.es/inspect-js/hasown.svg +[deps-svg]: https://david-dm.org/inspect-js/hasOwn.svg +[deps-url]: https://david-dm.org/inspect-js/hasOwn +[dev-deps-svg]: https://david-dm.org/inspect-js/hasOwn/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/hasOwn#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/hasown.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/hasown.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/hasown.svg +[downloads-url]: https://npm-stat.com/charts.html?package=hasown +[codecov-image]: https://codecov.io/gh/inspect-js/hasOwn/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/hasOwn/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/hasOwn +[actions-url]: https://github.com/inspect-js/hasOwn/actions diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/eslint.config.mjs b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/eslint.config.mjs new file mode 100644 index 00000000..3d634a09 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/eslint.config.mjs @@ -0,0 +1,6 @@ +import ljharbConfig from '@ljharb/eslint-config/flat'; + +export default [ + ...ljharbConfig, + { rules: { 'no-extra-parens': 'off' } }, +]; diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.d.ts b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.d.ts new file mode 100644 index 00000000..aafdf3b2 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.d.ts @@ -0,0 +1,3 @@ +declare function hasOwn(o: O, p: K): o is O & Record; + +export = hasOwn; diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js new file mode 100644 index 00000000..34e60591 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = require('function-bind'); + +/** @type {import('.')} */ +module.exports = bind.call(call, $hasOwn); diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/package.json b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/package.json new file mode 100644 index 00000000..fb86cc37 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/package.json @@ -0,0 +1,91 @@ +{ + "name": "hasown", + "version": "2.0.4", + "description": "A robust, ES3 compatible, \"has own property\" predicate.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "index.d.ts", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint .", + "postlint": "npm run tsc", + "pretest": "npm run lint", + "tsc": "tsc -p .", + "posttsc": "attw -P", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@\">= 10.2\" audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/hasOwn.git" + }, + "keywords": [ + "has", + "hasOwnProperty", + "hasOwn", + "has-own", + "own", + "has", + "property", + "in", + "javascript", + "ecmascript" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/hasOwn/issues" + }, + "homepage": "https://github.com/inspect-js/hasOwn#readme", + "dependencies": { + "function-bind": "^1.1.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.2", + "@ljharb/eslint-config": "^22.2.3", + "@ljharb/tsconfig": "^0.3.2", + "@types/function-bind": "^1.1.10", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.1", + "eslint": "^10.4.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "jiti": "^0.0.0", + "mock-property": "^1.1.0", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "test" + ] + } +} diff --git a/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/tsconfig.json b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/tsconfig.json new file mode 100644 index 00000000..0930c565 --- /dev/null +++ b/backend/node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "@ljharb/tsconfig", + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/depd b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/depd new file mode 120000 index 00000000..34f26859 --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/depd @@ -0,0 +1 @@ +../../depd@2.0.0/node_modules/depd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/HISTORY.md b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/HISTORY.md new file mode 100644 index 00000000..3d81d265 --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/HISTORY.md @@ -0,0 +1,186 @@ +2.0.1 / 2025-11-20 +================== + + * deps: use tilde notation for dependencies + * deps: update statuses to 2.0.2 + +2.0.0 / 2021-12-17 +================== + + * Drop support for Node.js 0.6 + * Remove `I'mateapot` export; use `ImATeapot` instead + * Remove support for status being non-first argument + * Rename `UnorderedCollection` constructor to `TooEarly` + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: statuses@2.0.1 + - Fix messaging casing of `418 I'm a Teapot` + - Remove code 306 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +2021-11-14 / 1.8.1 +================== + + * deps: toidentifier@1.0.1 + +2020-06-29 / 1.8.0 +================== + + * Add `isHttpError` export to determine if value is an HTTP error + * deps: setprototypeof@1.2.0 + +2019-06-24 / 1.7.3 +================== + + * deps: inherits@2.0.4 + +2019-02-18 / 1.7.2 +================== + + * deps: setprototypeof@1.1.1 + +2018-09-08 / 1.7.1 +================== + + * Fix error creating objects in some environments + +2018-07-30 / 1.7.0 +================== + + * Set constructor name when possible + * Use `toidentifier` module to make class names + * deps: statuses@'>= 1.5.0 < 2' + +2018-03-29 / 1.6.3 +================== + + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: setprototypeof@1.1.0 + * deps: statuses@'>= 1.4.0 < 2' + +2017-08-04 / 1.6.2 +================== + + * deps: depd@1.1.1 + - Remove unnecessary `Buffer` loading + +2017-02-20 / 1.6.1 +================== + + * deps: setprototypeof@1.0.3 + - Fix shim for old browsers + +2017-02-14 / 1.6.0 +================== + + * Accept custom 4xx and 5xx status codes in factory + * Add deprecation message to `"I'mateapot"` export + * Deprecate passing status code as anything except first argument in factory + * Deprecate using non-error status codes + * Make `message` property enumerable for `HttpError`s + +2016-11-16 / 1.5.1 +================== + + * deps: inherits@2.0.3 + - Fix issue loading in browser + * deps: setprototypeof@1.0.2 + * deps: statuses@'>= 1.3.1 < 2' + +2016-05-18 / 1.5.0 +================== + + * Support new code `421 Misdirected Request` + * Use `setprototypeof` module to replace `__proto__` setting + * deps: statuses@'>= 1.3.0 < 2' + - Add `421 Misdirected Request` + - perf: enable strict mode + * perf: enable strict mode + +2016-01-28 / 1.4.0 +================== + + * Add `HttpError` export, for `err instanceof createError.HttpError` + * deps: inherits@2.0.1 + * deps: statuses@'>= 1.2.1 < 2' + - Fix message for status 451 + - Remove incorrect nginx status code + +2015-02-02 / 1.3.1 +================== + + * Fix regression where status can be overwritten in `createError` `props` + +2015-02-01 / 1.3.0 +================== + + * Construct errors using defined constructors from `createError` + * Fix error names that are not identifiers + - `createError["I'mateapot"]` is now `createError.ImATeapot` + * Set a meaningful `name` property on constructed errors + +2014-12-09 / 1.2.8 +================== + + * Fix stack trace from exported function + * Remove `arguments.callee` usage + +2014-10-14 / 1.2.7 +================== + + * Remove duplicate line + +2014-10-02 / 1.2.6 +================== + + * Fix `expose` to be `true` for `ClientError` constructor + +2014-09-28 / 1.2.5 +================== + + * deps: statuses@1 + +2014-09-21 / 1.2.4 +================== + + * Fix dependency version to work with old `npm`s + +2014-09-21 / 1.2.3 +================== + + * deps: statuses@~1.1.0 + +2014-09-21 / 1.2.2 +================== + + * Fix publish error + +2014-09-21 / 1.2.1 +================== + + * Support Node.js 0.6 + * Use `inherits` instead of `util` + +2014-09-09 / 1.2.0 +================== + + * Fix the way inheriting functions + * Support `expose` being provided in properties argument + +2014-09-08 / 1.1.0 +================== + + * Default status to 500 + * Support provided `error` to extend + +2014-09-08 / 1.0.1 +================== + + * Fix accepting string message + +2014-09-08 / 1.0.0 +================== + + * Initial release diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/LICENSE b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/LICENSE new file mode 100644 index 00000000..82af4df5 --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/README.md b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/README.md new file mode 100644 index 00000000..a8b7330b --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/README.md @@ -0,0 +1,169 @@ +# http-errors + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][node-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create HTTP errors for Express, Koa, Connect, etc. with ease. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```console +$ npm install http-errors +``` + +## Example + +```js +var createError = require('http-errors') +var express = require('express') +var app = express() + +app.use(function (req, res, next) { + if (!req.user) return next(createError(401, 'Please login to view this page.')) + next() +}) +``` + +## API + +This is the current API, currently extracted from Koa and subject to change. + +### Error Properties + +- `expose` - can be used to signal if `message` should be sent to the client, + defaulting to `false` when `status` >= 500 +- `headers` - can be an object of header names to values to be sent to the + client, defaulting to `undefined`. When defined, the key names should all + be lower-cased +- `message` - the traditional error message, which should be kept short and all + single line +- `status` - the status code of the error, mirroring `statusCode` for general + compatibility +- `statusCode` - the status code of the error, defaulting to `500` + +### createError([status], [message], [properties]) + +Create a new error object with the given message `msg`. +The error object inherits from `createError.HttpError`. + +```js +var err = createError(404, 'This video does not exist!') +``` + +- `status: 500` - the status code as a number +- `message` - the message of the error, defaulting to node's text for that status code. +- `properties` - custom properties to attach to the object + +### createError([status], [error], [properties]) + +Extend the given `error` object with `createError.HttpError` +properties. This will not alter the inheritance of the given +`error` object, and the modified `error` object is the +return value. + + + +```js +fs.readFile('foo.txt', function (err, buf) { + if (err) { + if (err.code === 'ENOENT') { + var httpError = createError(404, err, { expose: false }) + } else { + var httpError = createError(500, err) + } + } +}) +``` + +- `status` - the status code as a number +- `error` - the error object to extend +- `properties` - custom properties to attach to the object + +### createError.isHttpError(val) + +Determine if the provided `val` is an `HttpError`. This will return `true` +if the error inherits from the `HttpError` constructor of this module or +matches the "duck type" for an error this module creates. All outputs from +the `createError` factory will return `true` for this function, including +if an non-`HttpError` was passed into the factory. + +### new createError\[code || name\](\[msg]\)) + +Create a new error object with the given message `msg`. +The error object inherits from `createError.HttpError`. + +```js +var err = new createError.NotFound() +``` + +- `code` - the status code as a number +- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. + +#### List of all constructors + +|Status Code|Constructor Name | +|-----------|-----------------------------| +|400 |BadRequest | +|401 |Unauthorized | +|402 |PaymentRequired | +|403 |Forbidden | +|404 |NotFound | +|405 |MethodNotAllowed | +|406 |NotAcceptable | +|407 |ProxyAuthenticationRequired | +|408 |RequestTimeout | +|409 |Conflict | +|410 |Gone | +|411 |LengthRequired | +|412 |PreconditionFailed | +|413 |PayloadTooLarge | +|414 |URITooLong | +|415 |UnsupportedMediaType | +|416 |RangeNotSatisfiable | +|417 |ExpectationFailed | +|418 |ImATeapot | +|421 |MisdirectedRequest | +|422 |UnprocessableEntity | +|423 |Locked | +|424 |FailedDependency | +|425 |TooEarly | +|426 |UpgradeRequired | +|428 |PreconditionRequired | +|429 |TooManyRequests | +|431 |RequestHeaderFieldsTooLarge | +|451 |UnavailableForLegalReasons | +|500 |InternalServerError | +|501 |NotImplemented | +|502 |BadGateway | +|503 |ServiceUnavailable | +|504 |GatewayTimeout | +|505 |HTTPVersionNotSupported | +|506 |VariantAlsoNegotiates | +|507 |InsufficientStorage | +|508 |LoopDetected | +|509 |BandwidthLimitExceeded | +|510 |NotExtended | +|511 |NetworkAuthenticationRequired| + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci +[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master +[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master +[node-image]: https://badgen.net/npm/node/http-errors +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/http-errors +[npm-url]: https://npmjs.org/package/http-errors +[npm-version-image]: https://badgen.net/npm/v/http-errors +[travis-image]: https://badgen.net/travis/jshttp/http-errors/master +[travis-url]: https://travis-ci.org/jshttp/http-errors diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js new file mode 100644 index 00000000..82271f6f --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js @@ -0,0 +1,290 @@ +/*! + * http-errors + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var deprecate = require('depd')('http-errors') +var setPrototypeOf = require('setprototypeof') +var statuses = require('statuses') +var inherits = require('inherits') +var toIdentifier = require('toidentifier') + +/** + * Module exports. + * @public + */ + +module.exports = createError +module.exports.HttpError = createHttpErrorConstructor() +module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError) + +// Populate exports for all constructors +populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) + +/** + * Get the code class of a status code. + * @private + */ + +function codeClass (status) { + return Number(String(status).charAt(0) + '00') +} + +/** + * Create a new HTTP Error. + * + * @returns {Error} + * @public + */ + +function createError () { + // so much arity going on ~_~ + var err + var msg + var status = 500 + var props = {} + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i] + var type = typeof arg + if (type === 'object' && arg instanceof Error) { + err = arg + status = err.status || err.statusCode || status + } else if (type === 'number' && i === 0) { + status = arg + } else if (type === 'string') { + msg = arg + } else if (type === 'object') { + props = arg + } else { + throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type) + } + } + + if (typeof status === 'number' && (status < 400 || status >= 600)) { + deprecate('non-error status code; use only 4xx or 5xx status codes') + } + + if (typeof status !== 'number' || + (!statuses.message[status] && (status < 400 || status >= 600))) { + status = 500 + } + + // constructor + var HttpError = createError[status] || createError[codeClass(status)] + + if (!err) { + // create error + err = HttpError + ? new HttpError(msg) + : new Error(msg || statuses.message[status]) + Error.captureStackTrace(err, createError) + } + + if (!HttpError || !(err instanceof HttpError) || err.status !== status) { + // add properties to generic error + err.expose = status < 500 + err.status = err.statusCode = status + } + + for (var key in props) { + if (key !== 'status' && key !== 'statusCode') { + err[key] = props[key] + } + } + + return err +} + +/** + * Create HTTP error abstract base class. + * @private + */ + +function createHttpErrorConstructor () { + function HttpError () { + throw new TypeError('cannot construct abstract class') + } + + inherits(HttpError, Error) + + return HttpError +} + +/** + * Create a constructor for a client error. + * @private + */ + +function createClientErrorConstructor (HttpError, name, code) { + var className = toClassName(name) + + function ClientError (message) { + // create the error object + var msg = message != null ? message : statuses.message[code] + var err = new Error(msg) + + // capture a stack trace to the construction point + Error.captureStackTrace(err, ClientError) + + // adjust the [[Prototype]] + setPrototypeOf(err, ClientError.prototype) + + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) + + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) + + return err + } + + inherits(ClientError, HttpError) + nameFunc(ClientError, className) + + ClientError.prototype.status = code + ClientError.prototype.statusCode = code + ClientError.prototype.expose = true + + return ClientError +} + +/** + * Create function to test is a value is a HttpError. + * @private + */ + +function createIsHttpErrorFunction (HttpError) { + return function isHttpError (val) { + if (!val || typeof val !== 'object') { + return false + } + + if (val instanceof HttpError) { + return true + } + + return val instanceof Error && + typeof val.expose === 'boolean' && + typeof val.statusCode === 'number' && val.status === val.statusCode + } +} + +/** + * Create a constructor for a server error. + * @private + */ + +function createServerErrorConstructor (HttpError, name, code) { + var className = toClassName(name) + + function ServerError (message) { + // create the error object + var msg = message != null ? message : statuses.message[code] + var err = new Error(msg) + + // capture a stack trace to the construction point + Error.captureStackTrace(err, ServerError) + + // adjust the [[Prototype]] + setPrototypeOf(err, ServerError.prototype) + + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) + + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) + + return err + } + + inherits(ServerError, HttpError) + nameFunc(ServerError, className) + + ServerError.prototype.status = code + ServerError.prototype.statusCode = code + ServerError.prototype.expose = false + + return ServerError +} + +/** + * Set the name of a function, if possible. + * @private + */ + +function nameFunc (func, name) { + var desc = Object.getOwnPropertyDescriptor(func, 'name') + + if (desc && desc.configurable) { + desc.value = name + Object.defineProperty(func, 'name', desc) + } +} + +/** + * Populate the exports object with constructors for every error class. + * @private + */ + +function populateConstructorExports (exports, codes, HttpError) { + codes.forEach(function forEachCode (code) { + var CodeError + var name = toIdentifier(statuses.message[code]) + + switch (codeClass(code)) { + case 400: + CodeError = createClientErrorConstructor(HttpError, name, code) + break + case 500: + CodeError = createServerErrorConstructor(HttpError, name, code) + break + } + + if (CodeError) { + // export the constructor + exports[code] = CodeError + exports[name] = CodeError + } + }) +} + +/** + * Get a class name from a name identifier. + * + * @param {string} name + * @returns {string} + * @private + */ + +function toClassName (name) { + return name.slice(-5) === 'Error' ? name : name + 'Error' +} diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/package.json b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/package.json new file mode 100644 index 00000000..4b46d62a --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/package.json @@ -0,0 +1,54 @@ +{ + "name": "http-errors", + "description": "Create HTTP error objects", + "version": "2.0.1", + "author": "Jonathan Ong (http://jongleberry.com)", + "contributors": [ + "Alan Plum ", + "Douglas Christopher Wilson " + ], + "license": "MIT", + "repository": "jshttp/http-errors", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint . && node ./scripts/lint-readme-list.js", + "test": "mocha --reporter spec", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + }, + "keywords": [ + "http", + "error" + ], + "files": [ + "index.js", + "HISTORY.md", + "LICENSE", + "README.md" + ] +} diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/inherits b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/inherits new file mode 120000 index 00000000..a2c96077 --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/inherits @@ -0,0 +1 @@ +../../inherits@2.0.4/node_modules/inherits \ No newline at end of file diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/setprototypeof b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/setprototypeof new file mode 120000 index 00000000..c8b96417 --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/setprototypeof @@ -0,0 +1 @@ +../../setprototypeof@1.2.0/node_modules/setprototypeof \ No newline at end of file diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/statuses b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/statuses new file mode 120000 index 00000000..26defda8 --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/statuses @@ -0,0 +1 @@ +../../statuses@2.0.2/node_modules/statuses \ No newline at end of file diff --git a/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/toidentifier b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/toidentifier new file mode 120000 index 00000000..eaff720f --- /dev/null +++ b/backend/node_modules/.pnpm/http-errors@2.0.1/node_modules/toidentifier @@ -0,0 +1 @@ +../../toidentifier@1.0.1/node_modules/toidentifier \ No newline at end of file diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/LICENSE b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/LICENSE new file mode 100644 index 00000000..d518d837 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/README.md b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/README.md new file mode 100644 index 00000000..78a7a5f1 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/README.md @@ -0,0 +1,138 @@ +## iconv-lite: Pure JS character encoding conversion + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-downloads-url] +[![License][license-image]][license-url] +[![NPM Install Size][npm-install-size-image]][npm-install-size-url] + +* No need for native code compilation. Quick to install, works on Windows, Web, and in sandboxed environments. +* Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. +* Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). +* Intuitive encode/decode API, including Streaming support. +* In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). +* Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. +* React Native is supported (need to install `stream` module to enable Streaming API). + +## Usage + +### Basic API + +```javascript +var iconv = require('iconv-lite'); + +// Convert from an encoded buffer to a js string. +str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); + +// Convert from a js string to an encoded buffer. +buf = iconv.encode("Sample input string", 'win1251'); + +// Check if encoding is supported +iconv.encodingExists("us-ascii") +``` + +### Streaming API + +```javascript +// Decode stream (from binary data stream to js strings) +http.createServer(function(req, res) { + var converterStream = iconv.decodeStream('win1251'); + req.pipe(converterStream); + + converterStream.on('data', function(str) { + console.log(str); // Do something with decoded strings, chunk-by-chunk. + }); +}); + +// Convert encoding streaming example +fs.createReadStream('file-in-win1251.txt') + .pipe(iconv.decodeStream('win1251')) + .pipe(iconv.encodeStream('ucs2')) + .pipe(fs.createWriteStream('file-in-ucs2.txt')); + +// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. +http.createServer(function(req, res) { + req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { + assert(typeof body == 'string'); + console.log(body); // full request body string + }); +}); +``` + +## Supported encodings + + * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. + * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. + Aliases like 'latin1', 'us-ascii' also supported. + * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. + +See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). + +Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! + +Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! + +## Encoding/decoding speed + +Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). +Note: your results may vary, so please always check on your hardware. + + operation iconv@2.1.4 iconv-lite@0.4.7 + ---------------------------------------------------------- + encode('win1251') ~96 Mb/s ~320 Mb/s + decode('win1251') ~95 Mb/s ~246 Mb/s + +## BOM handling + + * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options + (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). + A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. + * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. + * Encoding: No BOM added, unless overridden by `addBOM: true` option. + +## UTF-16 Encodings + +This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be +smart about endianness in the following ways: + * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be + overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. + +## UTF-32 Encodings + +This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. + * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) + +## Other notes + +When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see [#65](https://github.com/ashtuchkin/iconv-lite/issues/65), [#77](https://github.com/ashtuchkin/iconv-lite/issues/77)). + +## Testing + +```sh +git clone git@github.com:ashtuchkin/iconv-lite.git +cd iconv-lite +npm install +npm test + +# To view performance: +npm run test:performance + +# To view test coverage: +npm run test:cov +open coverage/index.html +``` + +[npm-downloads-image]: https://badgen.net/npm/dm/iconv-lite +[npm-downloads-url]: https://npmcharts.com/compare/iconv-lite?minimal=true +[npm-url]: https://npmjs.org/package/iconv-lite +[npm-version-image]: https://badgen.net/npm/v/iconv-lite +[npm-install-size-image]: https://badgen.net/packagephobia/install/iconv-lite +[npm-install-size-url]: https://packagephobia.com/result?p=iconv-lite +[license-image]: https://img.shields.io/npm/l/iconv-lite.svg +[license-url]: https://github.com/ashtuchkin/iconv-lite/blob/HEAD/LICENSE \ No newline at end of file diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-codec.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-codec.js new file mode 100644 index 00000000..bfec7f2e --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -0,0 +1,532 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. + +exports._dbcs = DBCSCodec + +var UNASSIGNED = -1 +var GB18030_CODE = -2 +var SEQ_START = -10 +var NODE_START = -1000 +var UNASSIGNED_NODE = new Array(0x100) +var DEF_CHAR = -1 + +for (var i = 0; i < 0x100; i++) { UNASSIGNED_NODE[i] = UNASSIGNED } + +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec (codecOptions, iconv) { + this.encodingName = codecOptions.encodingName + if (!codecOptions) { throw new Error("DBCS codec is called without the data.") } + if (!codecOptions.table) { throw new Error("Encoding '" + this.encodingName + "' has no data.") } + + // Load tables. + var mappingTable = codecOptions.table() + + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = [] + this.decodeTables[0] = UNASSIGNED_NODE.slice(0) // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = [] + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) { this._addDecodeChunk(mappingTable[i]) } + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === "function") { + this.gb18030 = codecOptions.gb18030() // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length + this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + + var commonFourthByteNodeIdx = this.decodeTables.length + this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + + // Fill out the tree + var firstByteNode = this.decodeTables[0] + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]] + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2") + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]] + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3") + } + + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]] + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) { fourthByteNode[l] = GB18030_CODE } + } + } + } + } + } + + this.defaultCharUnicode = iconv.defaultCharUnicode + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = [] + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = [] + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {} + if (codecOptions.encodeSkipVals) { + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i] + if (typeof val === "number") { skipEncodeChars[val] = true } else { + for (var j = val.from; j <= val.to; j++) { skipEncodeChars[j] = true } + } + } + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars) + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) { + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) { this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]) } + } + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)] + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"] + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0) +} + +DBCSCodec.prototype.encoder = DBCSEncoder +DBCSCodec.prototype.decoder = DBCSDecoder + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function (addr) { + var bytes = [] + for (; addr > 0; addr >>>= 8) { bytes.push(addr & 0xFF) } + if (bytes.length == 0) { bytes.push(0) } + + var node = this.decodeTables[0] + for (var i = bytes.length - 1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]] + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)) + } else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val] + } else { throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)) } + } + return node +} + +DBCSCodec.prototype._addDecodeChunk = function (chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16) + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr) + curAddr = curAddr & 0xFF + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k] + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++) + if (code >= 0xD800 && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++) + if (codeTrail >= 0xDC00 && codeTrail < 0xE000) { writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00) } else { throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]) } + } else if (code > 0x0FF0 && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2 + var seq = [] + for (var m = 0; m < len; m++) { seq.push(part.charCodeAt(l++)) } // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length + this.decodeTableSeq.push(seq) + } else { writeTable[curAddr++] = code } // Basic char + } + } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1 + for (var l = 0; l < part; l++) { writeTable[curAddr++] = charCode++ } + } else { throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]) } + } + if (curAddr > 0xFF) { throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr) } +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function (uCode) { + var high = uCode >> 8 // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) { + this.encodeTable[high] = UNASSIGNED_NODE.slice(0) + } // Create bucket on demand. + return this.encodeTable[high] +} + +DBCSCodec.prototype._setEncodeChar = function (uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode) + var low = uCode & 0xFF + if (bucket[low] <= SEQ_START) { this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode } // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) { bucket[low] = dbcsCode } +} + +DBCSCodec.prototype._setEncodeSequence = function (seq, dbcsCode) { + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0] + var bucket = this._getEncodeBucket(uCode) + var low = uCode & 0xFF + + var node + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START - bucket[low]] + } else { + // There was no sequence object - allocate a new one. + node = {} + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low] // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length + this.encodeTableSeq.push(node) + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length - 1; j++) { + var oldVal = node[uCode] + if (typeof oldVal === "object") { node = oldVal } else { + node = node[uCode] = {} + if (oldVal !== undefined) { node[DEF_CHAR] = oldVal } + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length - 1] + node[uCode] = dbcsCode +} + +DBCSCodec.prototype._fillEncodeTable = function (nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx] + var hasValues = false + var subNodeEmpty = {} + for (var i = 0; i < 0x100; i++) { + var uCode = node[i] + var mbCode = prefix + i + if (skipEncodeChars[mbCode]) { continue } + + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode) + hasValues = true + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0 // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) { hasValues = true } else { subNodeEmpty[subNodeIdx] = true } + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode) + hasValues = true + } + } + return hasValues +} + +// == Encoder ================================================================== + +function DBCSEncoder (options, codec) { + // Encoder state + this.leadSurrogate = -1 + this.seqObj = undefined + + // Static data + this.encodeTable = codec.encodeTable + this.encodeTableSeq = codec.encodeTableSeq + this.defaultCharSingleByte = codec.defCharSB + this.gb18030 = codec.gb18030 +} + +DBCSEncoder.prototype.write = function (str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)) + var leadSurrogate = this.leadSurrogate + var seqObj = this.seqObj + var nextChar = -1 + var i = 0; var j = 0 + + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break + var uCode = str.charCodeAt(i++) + } else { + var uCode = nextChar + nextChar = -1 + } + + // 1. Handle surrogates. + if (uCode >= 0xD800 && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode + continue + } else { + leadSurrogate = uCode + // Double lead surrogate found. + uCode = UNASSIGNED + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00) + leadSurrogate = -1 + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED + } + } + } else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED // Write an error, then current char. + leadSurrogate = -1 + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode] + if (typeof resCode === "object") { // Sequence continues. + seqObj = resCode + continue + } else if (typeof resCode === "number") { // Sequence finished. Write it. + dbcsCode = resCode + } else if (resCode == undefined) { // Current character is not part of the sequence. + // Try default character for this sequence + resCode = seqObj[DEF_CHAR] + if (resCode !== undefined) { + dbcsCode = resCode // Found. Write it. + nextChar = uCode // Current character will be written too in the next iteration. + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined + } else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8] + if (subtable !== undefined) { dbcsCode = subtable[uCode & 0xFF] } + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START - dbcsCode] + continue + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode) + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]) + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600 + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260 + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10 + newBuf[j++] = 0x30 + dbcsCode + continue + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) { dbcsCode = this.defaultCharSingleByte } + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode + } else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8 // high byte + newBuf[j++] = dbcsCode & 0xFF // low byte + } else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16 + newBuf[j++] = (dbcsCode >> 8) & 0xFF + newBuf[j++] = dbcsCode & 0xFF + } else { + newBuf[j++] = dbcsCode >>> 24 + newBuf[j++] = (dbcsCode >>> 16) & 0xFF + newBuf[j++] = (dbcsCode >>> 8) & 0xFF + newBuf[j++] = dbcsCode & 0xFF + } + } + + this.seqObj = seqObj + this.leadSurrogate = leadSurrogate + return newBuf.slice(0, j) +} + +DBCSEncoder.prototype.end = function () { + if (this.leadSurrogate === -1 && this.seqObj === undefined) { return } // All clean. Most often case. + + var newBuf = Buffer.alloc(10); var j = 0 + + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR] + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode + } else { + newBuf[j++] = dbcsCode >> 8 // high byte + newBuf[j++] = dbcsCode & 0xFF // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined + } + + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte + this.leadSurrogate = -1 + } + + return newBuf.slice(0, j) +} + +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx + +// == Decoder ================================================================== + +function DBCSDecoder (options, codec) { + // Decoder state + this.nodeIdx = 0 + this.prevBytes = [] + + // Static data + this.decodeTables = codec.decodeTables + this.decodeTableSeq = codec.decodeTableSeq + this.defaultCharUnicode = codec.defaultCharUnicode + this.gb18030 = codec.gb18030 +} + +DBCSDecoder.prototype.write = function (buf) { + var newBuf = Buffer.alloc(buf.length * 2) + var nodeIdx = this.nodeIdx + var prevBytes = this.prevBytes; var prevOffset = this.prevBytes.length + var seqStart = -this.prevBytes.length // idx of the start of current parsed sequence. + var uCode + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset] + + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte] + + if (uCode >= 0) { + // Normal character, just use it. + } else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0) + i = seqStart // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i - 3] - 0x81) * 12600 + (buf[i - 2] - 0x30) * 1260 + (buf[i - 1] - 0x81) * 10 + (curByte - 0x30) + } else { + var ptr = (prevBytes[i - 3 + prevOffset] - 0x81) * 12600 + + (((i - 2 >= 0) ? buf[i - 2] : prevBytes[i - 2 + prevOffset]) - 0x30) * 1260 + + (((i - 1 >= 0) ? buf[i - 1] : prevBytes[i - 1 + prevOffset]) - 0x81) * 10 + + (curByte - 0x30) + } + var idx = findIdx(this.gb18030.gbChars, ptr) + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx] + } else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode + continue + } else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode] + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k] + newBuf[j++] = uCode & 0xFF + newBuf[j++] = uCode >> 8 + } + uCode = seq[seq.length - 1] + } else { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte) } + + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000 + var uCodeLead = 0xD800 | (uCode >> 10) + newBuf[j++] = uCodeLead & 0xFF + newBuf[j++] = uCodeLead >> 8 + + uCode = 0xDC00 | (uCode & 0x3FF) + } + newBuf[j++] = uCode & 0xFF + newBuf[j++] = uCode >> 8 + + // Reset trie node. + nodeIdx = 0; seqStart = i + 1 + } + + this.nodeIdx = nodeIdx + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)) + + return newBuf.slice(0, j).toString("ucs2") +} + +DBCSDecoder.prototype.end = function () { + var ret = "" + + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode + var bytesArr = this.prevBytes.slice(1) + + // Parse remaining as usual. + this.prevBytes = [] + this.nodeIdx = 0 + if (bytesArr.length > 0) { ret += this.write(bytesArr) } + } + + this.prevBytes = [] + this.nodeIdx = 0 + return ret +} + +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx (table, val) { + if (table[0] > val) { return -1 } + + var l = 0; var r = table.length + while (l < r - 1) { // always table[l] <= val < table[r] + var mid = l + ((r - l + 1) >> 1) + if (table[mid] <= val) { l = mid } else { r = mid } + } + return l +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-data.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-data.js new file mode 100644 index 00000000..a3858d4c --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/dbcs-data.js @@ -0,0 +1,185 @@ +"use strict" + +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. + +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + + shiftjis: { + type: "_dbcs", + table: function () { return require("./tables/shiftjis.json") }, + encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E }, + encodeSkipVals: [{ from: 0xED40, to: 0xF940 }] + }, + csshiftjis: "shiftjis", + mskanji: "shiftjis", + sjis: "shiftjis", + windows31j: "shiftjis", + ms31j: "shiftjis", + xsjis: "shiftjis", + windows932: "shiftjis", + ms932: "shiftjis", + 932: "shiftjis", + cp932: "shiftjis", + + eucjp: { + type: "_dbcs", + table: function () { return require("./tables/eucjp.json") }, + encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E } + }, + + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + gb2312: "cp936", + gb231280: "cp936", + gb23121980: "cp936", + csgb2312: "cp936", + csiso58gb231280: "cp936", + euccn: "cp936", + + // Microsoft's CP936 is a subset and approximation of GBK. + windows936: "cp936", + ms936: "cp936", + 936: "cp936", + cp936: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json") } + }, + + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + gbk: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) } + }, + xgbk: "gbk", + isoir58: "gbk", + + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + gb18030: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) }, + gb18030: function () { return require("./tables/gb18030-ranges.json") }, + encodeSkipVals: [0x80], + encodeAdd: { "€": 0xA2E3 } + }, + + chinese: "gb18030", + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + windows949: "cp949", + ms949: "cp949", + 949: "cp949", + cp949: { + type: "_dbcs", + table: function () { return require("./tables/cp949.json") } + }, + + cseuckr: "cp949", + csksc56011987: "cp949", + euckr: "cp949", + isoir149: "cp949", + korean: "cp949", + ksc56011987: "cp949", + ksc56011989: "cp949", + ksc5601: "cp949", + + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + + windows950: "cp950", + ms950: "cp950", + 950: "cp950", + cp950: { + type: "_dbcs", + table: function () { return require("./tables/cp950.json") } + }, + + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + big5: "big5hkscs", + big5hkscs: { + type: "_dbcs", + table: function () { return require("./tables/cp950.json").concat(require("./tables/big5-added.json")) }, + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce + ] + }, + + cnbig5: "big5hkscs", + csbig5: "big5hkscs", + xxbig5: "big5hkscs" +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/index.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/index.js new file mode 100644 index 00000000..9d90e3ca --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/index.js @@ -0,0 +1,23 @@ +"use strict" + +var mergeModules = require("../lib/helpers/merge-exports") + +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + require("./internal"), + require("./utf32"), + require("./utf16"), + require("./utf7"), + require("./sbcs-codec"), + require("./sbcs-data"), + require("./sbcs-data-generated"), + require("./dbcs-codec"), + require("./dbcs-data") +] + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i] + mergeModules(exports, module) +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/internal.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/internal.js new file mode 100644 index 00000000..4e5c3ff2 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/internal.js @@ -0,0 +1,218 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true }, + cesu8: { type: "_internal", bomAware: true }, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true }, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec +} + +// ------------------------------------------------------------------------------ + +function InternalCodec (codecOptions, iconv) { + this.enc = codecOptions.encodingName + this.bomAware = codecOptions.bomAware + + if (this.enc === "base64") { this.encoder = InternalEncoderBase64 } else if (this.enc === "utf8") { this.encoder = InternalEncoderUtf8 } else if (this.enc === "cesu8") { + this.enc = "utf8" // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8 + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from("eda0bdedb2a9", "hex").toString() !== "💩") { + this.decoder = InternalDecoderCesu8 + this.defaultCharUnicode = iconv.defaultCharUnicode + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder +InternalCodec.prototype.decoder = InternalDecoder + +// ------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = require("string_decoder").StringDecoder + +function InternalDecoder (options, codec) { + this.decoder = new StringDecoder(codec.enc) +} + +InternalDecoder.prototype.write = function (buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf) + } + + return this.decoder.write(buf) +} + +InternalDecoder.prototype.end = function () { + return this.decoder.end() +} + +// ------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder (options, codec) { + this.enc = codec.enc +} + +InternalEncoder.prototype.write = function (str) { + return Buffer.from(str, this.enc) +} + +InternalEncoder.prototype.end = function () { +} + +// ------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64 (options, codec) { + this.prevStr = "" +} + +InternalEncoderBase64.prototype.write = function (str) { + str = this.prevStr + str + var completeQuads = str.length - (str.length % 4) + this.prevStr = str.slice(completeQuads) + str = str.slice(0, completeQuads) + + return Buffer.from(str, "base64") +} + +InternalEncoderBase64.prototype.end = function () { + return Buffer.from(this.prevStr, "base64") +} + +// ------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8 (options, codec) { +} + +InternalEncoderCesu8.prototype.write = function (str) { + var buf = Buffer.alloc(str.length * 3); var bufIdx = 0 + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i) + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) { buf[bufIdx++] = charCode } else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6) + buf[bufIdx++] = 0x80 + (charCode & 0x3f) + } else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12) + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f) + buf[bufIdx++] = 0x80 + (charCode & 0x3f) + } + } + return buf.slice(0, bufIdx) +} + +InternalEncoderCesu8.prototype.end = function () { +} + +// ------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8 (options, codec) { + this.acc = 0 + this.contBytes = 0 + this.accBytes = 0 + this.defaultCharUnicode = codec.defaultCharUnicode +} + +InternalDecoderCesu8.prototype.write = function (buf) { + var acc = this.acc; var contBytes = this.contBytes; var accBytes = this.accBytes + var res = "" + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i] + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode + contBytes = 0 + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte) + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F + contBytes = 1; accBytes = 1 + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F + contBytes = 2; accBytes = 1 + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f) + contBytes--; accBytes++ + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) { + res += this.defaultCharUnicode + } else if (accBytes === 3 && acc < 0x800) { + res += this.defaultCharUnicode + } else { + // Actually add character. + res += String.fromCharCode(acc) + } + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes + return res +} + +InternalDecoderCesu8.prototype.end = function () { + var res = 0 + if (this.contBytes > 0) { res += this.defaultCharUnicode } + return res +} + +// ------------------------------------------------------------------------------ +// check the chunk boundaries for surrogate pair + +function InternalEncoderUtf8 (options, codec) { + this.highSurrogate = "" +} + +InternalEncoderUtf8.prototype.write = function (str) { + if (this.highSurrogate) { + str = this.highSurrogate + str + this.highSurrogate = "" + } + + if (str.length > 0) { + var charCode = str.charCodeAt(str.length - 1) + if (charCode >= 0xd800 && charCode < 0xdc00) { + this.highSurrogate = str[str.length - 1] + str = str.slice(0, str.length - 1) + } + } + + return Buffer.from(str, this.enc) +} + +InternalEncoderUtf8.prototype.end = function () { + if (this.highSurrogate) { + var str = this.highSurrogate + this.highSurrogate = "" + return Buffer.from(str, this.enc) + } +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-codec.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-codec.js new file mode 100644 index 00000000..0e2fc924 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -0,0 +1,75 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). + +exports._sbcs = SBCSCodec +function SBCSCodec (codecOptions, iconv) { + if (!codecOptions) { + throw new Error("SBCS codec is called without the data.") + } + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) { + throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)") + } + + if (codecOptions.chars.length === 128) { + var asciiString = "" + for (var i = 0; i < 128; i++) { + asciiString += String.fromCharCode(i) + } + codecOptions.chars = asciiString + codecOptions.chars + } + + this.decodeBuf = Buffer.from(codecOptions.chars, "ucs2") + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)) + + for (var i = 0; i < codecOptions.chars.length; i++) { + encodeBuf[codecOptions.chars.charCodeAt(i)] = i + } + + this.encodeBuf = encodeBuf +} + +SBCSCodec.prototype.encoder = SBCSEncoder +SBCSCodec.prototype.decoder = SBCSDecoder + +function SBCSEncoder (options, codec) { + this.encodeBuf = codec.encodeBuf +} + +SBCSEncoder.prototype.write = function (str) { + var buf = Buffer.alloc(str.length) + for (var i = 0; i < str.length; i++) { + buf[i] = this.encodeBuf[str.charCodeAt(i)] + } + + return buf +} + +SBCSEncoder.prototype.end = function () { +} + +function SBCSDecoder (options, codec) { + this.decodeBuf = codec.decodeBuf +} + +SBCSDecoder.prototype.write = function (buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf + var newBuf = Buffer.alloc(buf.length * 2) + var idx1 = 0; var idx2 = 0 + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i] * 2; idx2 = i * 2 + newBuf[idx2] = decodeBuf[idx1] + newBuf[idx2 + 1] = decodeBuf[idx1 + 1] + } + return newBuf.toString("ucs2") +} + +SBCSDecoder.prototype.end = function () { +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data-generated.js new file mode 100644 index 00000000..9b482360 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data-generated.js @@ -0,0 +1,451 @@ +"use strict"; + +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data.js new file mode 100644 index 00000000..a08703c9 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/sbcs-data.js @@ -0,0 +1,180 @@ +"use strict" + +// Manually added data to be used by sbcs codec in addition to generated one. + +module.exports = { + // Not supported by iconv, not sure why. + 10029: "maccenteuro", + maccenteuro: { + type: "_sbcs", + chars: "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + + 808: "cp808", + ibm808: "cp808", + cp808: { + type: "_sbcs", + chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, + + mik: { + type: "_sbcs", + chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + + cp720: { + type: "_sbcs", + chars: "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, + + // Aliases of generated encodings. + ascii8bit: "ascii", + usascii: "ascii", + ansix34: "ascii", + ansix341968: "ascii", + ansix341986: "ascii", + csascii: "ascii", + cp367: "ascii", + ibm367: "ascii", + isoir6: "ascii", + iso646us: "ascii", + iso646irv: "ascii", + us: "ascii", + + latin1: "iso88591", + latin2: "iso88592", + latin3: "iso88593", + latin4: "iso88594", + latin5: "iso88599", + latin6: "iso885910", + latin7: "iso885913", + latin8: "iso885914", + latin9: "iso885915", + latin10: "iso885916", + + csisolatin1: "iso88591", + csisolatin2: "iso88592", + csisolatin3: "iso88593", + csisolatin4: "iso88594", + csisolatincyrillic: "iso88595", + csisolatinarabic: "iso88596", + csisolatingreek: "iso88597", + csisolatinhebrew: "iso88598", + csisolatin5: "iso88599", + csisolatin6: "iso885910", + + l1: "iso88591", + l2: "iso88592", + l3: "iso88593", + l4: "iso88594", + l5: "iso88599", + l6: "iso885910", + l7: "iso885913", + l8: "iso885914", + l9: "iso885915", + l10: "iso885916", + + isoir14: "iso646jp", + isoir57: "iso646cn", + isoir100: "iso88591", + isoir101: "iso88592", + isoir109: "iso88593", + isoir110: "iso88594", + isoir144: "iso88595", + isoir127: "iso88596", + isoir126: "iso88597", + isoir138: "iso88598", + isoir148: "iso88599", + isoir157: "iso885910", + isoir166: "tis620", + isoir179: "iso885913", + isoir199: "iso885914", + isoir203: "iso885915", + isoir226: "iso885916", + + cp819: "iso88591", + ibm819: "iso88591", + + cyrillic: "iso88595", + + arabic: "iso88596", + arabic8: "iso88596", + ecma114: "iso88596", + asmo708: "iso88596", + + greek: "iso88597", + greek8: "iso88597", + ecma118: "iso88597", + elot928: "iso88597", + + hebrew: "iso88598", + hebrew8: "iso88598", + iso88598i: "iso88598", + iso88598e: "iso88598", + + turkish: "iso88599", + turkish8: "iso88599", + + thai: "iso885911", + thai8: "iso885911", + + celtic: "iso885914", + celtic8: "iso885914", + isoceltic: "iso885914", + + tis6200: "tis620", + tis62025291: "tis620", + tis62025330: "tis620", + + 10000: "macroman", + 10006: "macgreek", + 10007: "maccyrillic", + 10079: "maciceland", + 10081: "macturkish", + + cspc8codepage437: "cp437", + cspc775baltic: "cp775", + cspc850multilingual: "cp850", + cspcp852: "cp852", + cspc862latinhebrew: "cp862", + cpgr: "cp869", + + msee: "cp1250", + mscyrl: "cp1251", + msansi: "cp1252", + msgreek: "cp1253", + msturk: "cp1254", + mshebr: "cp1255", + msarab: "cp1256", + winbaltrim: "cp1257", + + cp20866: "koi8r", + 20866: "koi8r", + ibm878: "koi8r", + cskoi8r: "koi8r", + + cp21866: "koi8u", + 21866: "koi8u", + ibm1168: "koi8u", + + strk10482002: "rk1048", + + tcvn5712: "tcvn", + tcvn57121: "tcvn", + + gb198880: "iso646cn", + cn: "iso646cn", + + csiso14jisc6220ro: "iso646jp", + jisc62201969ro: "iso646jp", + jp: "iso646jp", + + cshproman8: "hproman8", + r8: "hproman8", + roman8: "hproman8", + xroman8: "hproman8", + ibm1051: "hproman8", + + mac: "macintosh", + csmacintosh: "macintosh" +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/big5-added.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/big5-added.json new file mode 100644 index 00000000..3c3d3c2f --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/big5-added.json @@ -0,0 +1,122 @@ +[ +["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], +["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], +["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], +["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], +["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], +["8940","𪎩𡅅"], +["8943","攊"], +["8946","丽滝鵎釟"], +["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], +["89a1","琑糼緍楆竉刧"], +["89ab","醌碸酞肼"], +["89b0","贋胶𠧧"], +["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], +["89c1","溚舾甙"], +["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], +["8a40","𧶄唥"], +["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], +["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], +["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], +["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], +["8aac","䠋𠆩㿺塳𢶍"], +["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], +["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], +["8ac9","𪘁𠸉𢫏𢳉"], +["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], +["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], +["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], +["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], +["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], +["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], +["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], +["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], +["8ca1","𣏹椙橃𣱣泿"], +["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], +["8cc9","顨杫䉶圽"], +["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], +["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], +["8d40","𠮟"], +["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], +["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], +["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], +["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], +["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], +["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], +["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], +["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], +["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], +["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], +["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], +["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], +["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], +["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], +["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], +["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], +["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], +["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], +["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], +["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], +["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], +["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], +["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], +["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], +["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], +["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], +["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], +["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], +["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], +["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], +["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], +["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], +["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], +["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], +["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], +["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], +["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], +["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], +["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], +["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], +["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], +["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], +["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], +["9fae","酙隁酜"], +["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], +["9fc1","𤤙盖鮝个𠳔莾衂"], +["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], +["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], +["9fe7","毺蠘罸"], +["9feb","嘠𪙊蹷齓"], +["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], +["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], +["a055","𡠻𦸅"], +["a058","詾𢔛"], +["a05b","惽癧髗鵄鍮鮏蟵"], +["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], +["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], +["a0a1","嵗𨯂迚𨸹"], +["a0a6","僙𡵆礆匲阸𠼻䁥"], +["a0ae","矾"], +["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], +["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], +["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], +["a3c0","␀",31,"␡"], +["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], +["c740","す",58,"ァアィイ"], +["c7a1","ゥ",81,"А",5,"ЁЖ",4], +["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], +["c8a1","龰冈龱𧘇"], +["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], +["c8f5","ʃɐɛɔɵœøŋʊɪ"], +["f9fe","■"], +["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], +["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], +["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], +["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], +["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], +["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], +["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], +["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], +["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], +["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] +] diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp936.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp936.json new file mode 100644 index 00000000..49ddb9a1 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp936.json @@ -0,0 +1,264 @@ +[ +["0","\u0000",127,"€"], +["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], +["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], +["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], +["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], +["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], +["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], +["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], +["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], +["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], +["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], +["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], +["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], +["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], +["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], +["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], +["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], +["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], +["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], +["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], +["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], +["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], +["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], +["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], +["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], +["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], +["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], +["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], +["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], +["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], +["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], +["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], +["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], +["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], +["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], +["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], +["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], +["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], +["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], +["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], +["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], +["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], +["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], +["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], +["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], +["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], +["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], +["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], +["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], +["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], +["9980","檧檨檪檭",114,"欥欦欨",6], +["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], +["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], +["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], +["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], +["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], +["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], +["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], +["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], +["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], +["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], +["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], +["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], +["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], +["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], +["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], +["a2a1","ⅰ",9], +["a2b1","⒈",19,"⑴",19,"①",9], +["a2e5","㈠",9], +["a2f1","Ⅰ",11], +["a3a1","!"#¥%",88," ̄"], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], +["a6ee","︻︼︷︸︱"], +["a6f4","︳︴"], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], +["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], +["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], +["a8bd","ńň"], +["a8c0","ɡ"], +["a8c5","ㄅ",36], +["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], +["a959","℡㈱"], +["a95c","‐"], +["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], +["a980","﹢",4,"﹨﹩﹪﹫"], +["a996","〇"], +["a9a4","─",75], +["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], +["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], +["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], +["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], +["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], +["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], +["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], +["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], +["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], +["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], +["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], +["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], +["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], +["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], +["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], +["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], +["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], +["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], +["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], +["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], +["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], +["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], +["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], +["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], +["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], +["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], +["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], +["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], +["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], +["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], +["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], +["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], +["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], +["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], +["bb40","籃",9,"籎",36,"籵",5,"籾",9], +["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], +["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], +["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], +["bd40","紷",54,"絯",7], +["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], +["be40","継",12,"綧",6,"綯",42], +["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], +["bf40","緻",62], +["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], +["c040","繞",35,"纃",23,"纜纝纞"], +["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], +["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], +["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], +["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], +["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], +["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], +["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], +["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], +["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], +["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], +["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], +["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], +["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], +["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], +["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], +["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], +["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], +["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], +["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], +["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], +["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], +["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], +["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], +["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], +["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], +["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], +["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], +["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], +["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], +["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], +["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], +["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], +["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], +["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], +["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], +["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], +["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], +["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], +["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], +["d440","訞",31,"訿",8,"詉",21], +["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], +["d540","誁",7,"誋",7,"誔",46], +["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], +["d640","諤",34,"謈",27], +["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], +["d740","譆",31,"譧",4,"譭",25], +["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], +["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], +["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], +["d940","貮",62], +["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], +["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], +["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], +["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], +["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], +["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], +["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], +["dd40","軥",62], +["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], +["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], +["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], +["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], +["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], +["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], +["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], +["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], +["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], +["e240","釦",62], +["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], +["e340","鉆",45,"鉵",16], +["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], +["e440","銨",5,"銯",24,"鋉",31], +["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], +["e540","錊",51,"錿",10], +["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], +["e640","鍬",34,"鎐",27], +["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], +["e740","鏎",7,"鏗",54], +["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], +["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], +["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], +["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], +["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], +["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], +["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], +["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], +["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], +["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], +["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], +["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], +["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], +["ee40","頏",62], +["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], +["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], +["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], +["f040","餈",4,"餎餏餑",28,"餯",26], +["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], +["f140","馌馎馚",10,"馦馧馩",47], +["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], +["f240","駺",62], +["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], +["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], +["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], +["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], +["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], +["f540","魼",62], +["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], +["f640","鯜",62], +["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], +["f740","鰼",62], +["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], +["f840","鳣",62], +["f880","鴢",32], +["f940","鵃",62], +["f980","鶂",32], +["fa40","鶣",62], +["fa80","鷢",32], +["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], +["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], +["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], +["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], +["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], +["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], +["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] +] diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp949.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp949.json new file mode 100644 index 00000000..2022a007 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp949.json @@ -0,0 +1,273 @@ +[ +["0","\u0000",127], +["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], +["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], +["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], +["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], +["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], +["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], +["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], +["8361","긝",18,"긲긳긵긶긹긻긼"], +["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], +["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], +["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], +["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], +["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], +["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], +["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], +["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], +["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], +["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], +["8741","놞",9,"놩",15], +["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], +["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], +["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], +["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], +["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], +["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], +["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], +["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], +["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], +["8a61","둧",4,"둭",18,"뒁뒂"], +["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], +["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], +["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], +["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], +["8c41","똀",15,"똒똓똕똖똗똙",4], +["8c61","똞",6,"똦",5,"똭",6,"똵",5], +["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], +["8d41","뛃",16,"뛕",8], +["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], +["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], +["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], +["8e61","럂",4,"럈럊",19], +["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], +["8f41","뢅",7,"뢎",17], +["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], +["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], +["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], +["9061","륾",5,"릆릈릋릌릏",15], +["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], +["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], +["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], +["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], +["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], +["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], +["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], +["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], +["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], +["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], +["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], +["9461","봞",5,"봥",6,"봭",12], +["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], +["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], +["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], +["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], +["9641","뺸",23,"뻒뻓"], +["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], +["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], +["9741","뾃",16,"뾕",8], +["9761","뾞",17,"뾱",7], +["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], +["9841","쁀",16,"쁒",5,"쁙쁚쁛"], +["9861","쁝쁞쁟쁡",6,"쁪",15], +["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], +["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], +["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], +["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], +["9a41","숤숥숦숧숪숬숮숰숳숵",16], +["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], +["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], +["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], +["9b61","쌳",17,"썆",7], +["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], +["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], +["9c61","쏿",8,"쐉",6,"쐑",9], +["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], +["9d41","쒪",13,"쒹쒺쒻쒽",8], +["9d61","쓆",25], +["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], +["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], +["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], +["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], +["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], +["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], +["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], +["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], +["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], +["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], +["a141","좥좦좧좩",18,"좾좿죀죁"], +["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], +["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], +["a241","줐줒",5,"줙",18], +["a261","줭",6,"줵",18], +["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], +["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], +["a361","즑",6,"즚즜즞",16], +["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], +["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], +["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], +["a481","쨦쨧쨨쨪",28,"ㄱ",93], +["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], +["a561","쩫",17,"쩾",5,"쪅쪆"], +["a581","쪇",16,"쪙",14,"ⅰ",9], +["a5b0","Ⅰ",9], +["a5c1","Α",16,"Σ",6], +["a5e1","α",16,"σ",6], +["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], +["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], +["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], +["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], +["a761","쬪",22,"쭂쭃쭄"], +["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], +["a841","쭭",10,"쭺",14], +["a861","쮉",18,"쮝",6], +["a881","쮤",19,"쮹",11,"ÆÐªĦ"], +["a8a6","IJ"], +["a8a8","ĿŁØŒºÞŦŊ"], +["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], +["a941","쯅",14,"쯕",10], +["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], +["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], +["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], +["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], +["aa81","챳챴챶",29,"ぁ",82], +["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], +["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], +["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], +["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], +["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], +["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], +["acd1","а",5,"ёж",25], +["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], +["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], +["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], +["ae41","췆",5,"췍췎췏췑",16], +["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], +["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], +["af41","츬츭츮츯츲츴츶",19], +["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], +["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], +["b041","캚",5,"캢캦",5,"캮",12], +["b061","캻",5,"컂",19], +["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], +["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], +["b161","켥",6,"켮켲",5,"켹",11], +["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], +["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], +["b261","쾎",18,"쾢",5,"쾩"], +["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], +["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], +["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], +["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], +["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], +["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], +["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], +["b541","킕",14,"킦킧킩킪킫킭",5], +["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], +["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], +["b641","턅",7,"턎",17], +["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], +["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], +["b741","텮",13,"텽",6,"톅톆톇톉톊"], +["b761","톋",20,"톢톣톥톦톧"], +["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], +["b841","퇐",7,"퇙",17], +["b861","퇫",8,"퇵퇶퇷퇹",13], +["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], +["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], +["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], +["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], +["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], +["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], +["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], +["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], +["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], +["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], +["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], +["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], +["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], +["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], +["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], +["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], +["be41","퐸",7,"푁푂푃푅",14], +["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], +["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], +["bf41","풞",10,"풪",14], +["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], +["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], +["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], +["c061","픞",25], +["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], +["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], +["c161","햌햍햎햏햑",19,"햦햧"], +["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], +["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], +["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], +["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], +["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], +["c361","홢",4,"홨홪",5,"홲홳홵",11], +["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], +["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], +["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], +["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], +["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], +["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], +["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], +["c641","힍힎힏힑",6,"힚힜힞",5], +["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], +["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], +["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], +["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], +["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], +["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], +["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], +["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], +["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], +["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], +["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], +["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], +["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], +["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], +["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], +["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], +["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], +["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], +["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], +["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], +["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], +["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], +["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], +["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], +["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], +["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], +["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], +["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], +["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], +["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], +["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], +["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], +["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], +["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], +["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], +["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], +["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], +["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], +["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], +["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], +["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], +["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], +["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], +["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], +["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], +["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], +["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], +["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], +["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], +["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], +["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], +["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], +["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], +["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], +["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] +] diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp950.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp950.json new file mode 100644 index 00000000..d8bc8717 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/cp950.json @@ -0,0 +1,177 @@ +[ +["0","\u0000",127], +["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], +["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], +["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], +["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], +["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], +["a3a1","ㄐ",25,"˙ˉˊˇˋ"], +["a3e1","€"], +["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], +["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], +["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], +["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], +["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], +["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], +["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], +["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], +["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], +["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], +["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], +["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], +["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], +["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], +["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], +["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], +["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], +["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], +["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], +["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], +["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], +["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], +["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], +["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], +["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], +["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], +["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], +["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], +["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], +["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], +["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], +["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], +["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], +["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], +["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], +["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], +["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], +["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], +["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], +["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], +["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], +["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], +["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], +["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], +["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], +["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], +["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], +["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], +["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], +["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], +["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], +["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], +["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], +["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], +["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], +["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], +["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], +["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], +["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], +["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], +["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], +["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], +["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], +["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], +["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], +["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], +["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], +["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], +["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], +["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], +["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], +["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], +["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], +["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], +["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], +["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], +["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], +["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], +["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], +["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], +["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], +["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], +["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], +["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], +["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], +["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], +["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], +["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], +["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], +["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], +["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], +["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], +["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], +["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], +["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], +["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], +["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], +["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], +["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], +["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], +["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], +["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], +["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], +["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], +["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], +["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], +["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], +["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], +["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], +["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], +["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], +["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], +["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], +["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], +["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], +["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], +["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], +["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], +["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], +["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], +["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], +["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], +["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], +["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], +["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], +["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], +["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], +["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], +["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], +["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], +["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], +["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], +["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], +["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], +["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], +["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], +["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], +["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], +["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], +["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], +["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], +["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], +["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], +["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], +["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], +["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], +["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], +["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], +["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], +["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], +["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], +["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], +["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], +["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], +["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], +["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], +["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], +["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], +["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], +["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], +["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], +["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], +["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], +["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], +["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], +["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], +["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] +] diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/eucjp.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/eucjp.json new file mode 100644 index 00000000..4fa61ca1 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/eucjp.json @@ -0,0 +1,182 @@ +[ +["0","\u0000",127], +["8ea1","。",62], +["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], +["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], +["a2ba","∈∋⊆⊇⊂⊃∪∩"], +["a2ca","∧∨¬⇒⇔∀∃"], +["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["a2f2","ʼn♯♭♪†‡¶"], +["a2fe","◯"], +["a3b0","0",9], +["a3c1","A",25], +["a3e1","a",25], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["ada1","①",19,"Ⅰ",9], +["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], +["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], +["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], +["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], +["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], +["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], +["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], +["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], +["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], +["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], +["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], +["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], +["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], +["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], +["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], +["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], +["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], +["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], +["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], +["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], +["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], +["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], +["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], +["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], +["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], +["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], +["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], +["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], +["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], +["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], +["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], +["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], +["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], +["f4a1","堯槇遙瑤凜熙"], +["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], +["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], +["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["fcf1","ⅰ",9,"¬¦'""], +["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], +["8fa2c2","¡¦¿"], +["8fa2eb","ºª©®™¤№"], +["8fa6e1","ΆΈΉΊΪ"], +["8fa6e7","Ό"], +["8fa6e9","ΎΫ"], +["8fa6ec","Ώ"], +["8fa6f1","άέήίϊΐόςύϋΰώ"], +["8fa7c2","Ђ",10,"ЎЏ"], +["8fa7f2","ђ",10,"ўџ"], +["8fa9a1","ÆĐ"], +["8fa9a4","Ħ"], +["8fa9a6","IJ"], +["8fa9a8","ŁĿ"], +["8fa9ab","ŊØŒ"], +["8fa9af","ŦÞ"], +["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], +["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], +["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], +["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], +["8fabbd","ġĥíìïîǐ"], +["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], +["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], +["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], +["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], +["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], +["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], +["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], +["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], +["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], +["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], +["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], +["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], +["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], +["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], +["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], +["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], +["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], +["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], +["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], +["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], +["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], +["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], +["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], +["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], +["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], +["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], +["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], +["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], +["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], +["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], +["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], +["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], +["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], +["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], +["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], +["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], +["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], +["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], +["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], +["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], +["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], +["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], +["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], +["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], +["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], +["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], +["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], +["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], +["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], +["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], +["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], +["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], +["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], +["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], +["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], +["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], +["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], +["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], +["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], +["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], +["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], +["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], +["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] +] diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json new file mode 100644 index 00000000..85c69347 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json @@ -0,0 +1 @@ +{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gbk-added.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gbk-added.json new file mode 100644 index 00000000..b742e368 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -0,0 +1,56 @@ +[ +["a140","",62], +["a180","",32], +["a240","",62], +["a280","",32], +["a2ab","",5], +["a2e3","€"], +["a2ef",""], +["a2fd",""], +["a340","",62], +["a380","",31," "], +["a440","",62], +["a480","",32], +["a4f4","",10], +["a540","",62], +["a580","",32], +["a5f7","",7], +["a640","",62], +["a680","",32], +["a6b9","",7], +["a6d9","",6], +["a6ec",""], +["a6f3",""], +["a6f6","",8], +["a740","",62], +["a780","",32], +["a7c2","",14], +["a7f2","",12], +["a896","",10], +["a8bc","ḿ"], +["a8bf","ǹ"], +["a8c1",""], +["a8ea","",20], +["a958",""], +["a95b",""], +["a95d",""], +["a989","〾⿰",11], +["a997","",12], +["a9f0","",14], +["aaa1","",93], +["aba1","",93], +["aca1","",93], +["ada1","",93], +["aea1","",93], +["afa1","",93], +["d7fa","",4], +["f8a1","",93], +["f9a1","",93], +["faa1","",93], +["fba1","",93], +["fca1","",93], +["fda1","",93], +["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], +["8135f437",""] +] diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/shiftjis.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/shiftjis.json new file mode 100644 index 00000000..5a3a43cf --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/tables/shiftjis.json @@ -0,0 +1,125 @@ +[ +["0","\u0000",128], +["a1","。",62], +["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], +["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], +["81b8","∈∋⊆⊇⊂⊃∪∩"], +["81c8","∧∨¬⇒⇔∀∃"], +["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["81f0","ʼn♯♭♪†‡¶"], +["81fc","◯"], +["824f","0",9], +["8260","A",25], +["8281","a",25], +["829f","ぁ",82], +["8340","ァ",62], +["8380","ム",22], +["839f","Α",16,"Σ",6], +["83bf","α",16,"σ",6], +["8440","А",5,"ЁЖ",25], +["8470","а",5,"ёж",7], +["8480","о",17], +["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["8740","①",19,"Ⅰ",9], +["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["877e","㍻"], +["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], +["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], +["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], +["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], +["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], +["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], +["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], +["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], +["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], +["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], +["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], +["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], +["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], +["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], +["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], +["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], +["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], +["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], +["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], +["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], +["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], +["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], +["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], +["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], +["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], +["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], +["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], +["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], +["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], +["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], +["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], +["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], +["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], +["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], +["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], +["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], +["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["eeef","ⅰ",9,"¬¦'""], +["f040","",62], +["f080","",124], +["f140","",62], +["f180","",124], +["f240","",62], +["f280","",124], +["f340","",62], +["f380","",124], +["f440","",62], +["f480","",124], +["f540","",62], +["f580","",124], +["f640","",62], +["f680","",124], +["f740","",62], +["f780","",124], +["f840","",62], +["f880","",124], +["f940",""], +["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], +["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], +["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], +["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], +["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] +] diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf16.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf16.js new file mode 100644 index 00000000..ae60d98e --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf16.js @@ -0,0 +1,187 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js + +// == UTF16-BE codec. ========================================================== + +exports.utf16be = Utf16BECodec +function Utf16BECodec () { +} + +Utf16BECodec.prototype.encoder = Utf16BEEncoder +Utf16BECodec.prototype.decoder = Utf16BEDecoder +Utf16BECodec.prototype.bomAware = true + +// -- Encoding + +function Utf16BEEncoder () { +} + +Utf16BEEncoder.prototype.write = function (str) { + var buf = Buffer.from(str, "ucs2") + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = tmp + } + return buf +} + +Utf16BEEncoder.prototype.end = function () { +} + +// -- Decoding + +function Utf16BEDecoder () { + this.overflowByte = -1 +} + +Utf16BEDecoder.prototype.write = function (buf) { + if (buf.length == 0) { return "" } + + var buf2 = Buffer.alloc(buf.length + 1) + var i = 0; var j = 0 + + if (this.overflowByte !== -1) { + buf2[0] = buf[0] + buf2[1] = this.overflowByte + i = 1; j = 2 + } + + for (; i < buf.length - 1; i += 2, j += 2) { + buf2[j] = buf[i + 1] + buf2[j + 1] = buf[i] + } + + this.overflowByte = (i == buf.length - 1) ? buf[buf.length - 1] : -1 + + return buf2.slice(0, j).toString("ucs2") +} + +Utf16BEDecoder.prototype.end = function () { + this.overflowByte = -1 +} + +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); + +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). + +exports.utf16 = Utf16Codec +function Utf16Codec (codecOptions, iconv) { + this.iconv = iconv +} + +Utf16Codec.prototype.encoder = Utf16Encoder +Utf16Codec.prototype.decoder = Utf16Decoder + +// -- Encoding (pass-through) + +function Utf16Encoder (options, codec) { + options = options || {} + if (options.addBOM === undefined) { options.addBOM = true } + this.encoder = codec.iconv.getEncoder("utf-16le", options) +} + +Utf16Encoder.prototype.write = function (str) { + return this.encoder.write(str) +} + +Utf16Encoder.prototype.end = function () { + return this.encoder.end() +} + +// -- Decoding + +function Utf16Decoder (options, codec) { + this.decoder = null + this.initialBufs = [] + this.initialBufsLen = 0 + + this.options = options || {} + this.iconv = codec.iconv +} + +Utf16Decoder.prototype.write = function (buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf) + this.initialBufsLen += buf.length + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + { return "" } + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.write(buf) +} + +Utf16Decoder.prototype.end = function () { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + var trail = this.decoder.end() + if (trail) { resStr += trail } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + return this.decoder.end() +} + +function detectEncoding (bufs, defaultEncoding) { + var b = [] + var charsProcessed = 0 + // Number of ASCII chars when decoded as LE or BE. + var asciiCharsLE = 0 + var asciiCharsBE = 0 + + outerLoop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i] + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]) + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return "utf-16le" + if (b[0] === 0xFE && b[1] === 0xFF) return "utf-16be" + } + + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++ + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++ + + b.length = 0 + charsProcessed++ + + if (charsProcessed >= 100) { + break outerLoop + } + } + } + } + + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return "utf-16be" + if (asciiCharsBE < asciiCharsLE) return "utf-16le" + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || "utf-16le" +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf32.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf32.js new file mode 100644 index 00000000..7e49d7ad --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf32.js @@ -0,0 +1,314 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +// == UTF32-LE/BE codec. ========================================================== + +exports._utf32 = Utf32Codec + +function Utf32Codec (codecOptions, iconv) { + this.iconv = iconv + this.bomAware = true + this.isLE = codecOptions.isLE +} + +exports.utf32le = { type: "_utf32", isLE: true } +exports.utf32be = { type: "_utf32", isLE: false } + +// Aliases +exports.ucs4le = "utf32le" +exports.ucs4be = "utf32be" + +Utf32Codec.prototype.encoder = Utf32Encoder +Utf32Codec.prototype.decoder = Utf32Decoder + +// -- Encoding + +function Utf32Encoder (options, codec) { + this.isLE = codec.isLE + this.highSurrogate = 0 +} + +Utf32Encoder.prototype.write = function (str) { + var src = Buffer.from(str, "ucs2") + // src.length * 2 covers this chunk's code units (4 bytes each); the extra 4 bytes leave room for a + // high surrogate held over from a previous chunk, which is flushed ahead of this chunk's units. + var dst = Buffer.alloc(src.length * 2 + 4) + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE + var offset = 0 + + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i) + var isHighSurrogate = (code >= 0xD800 && code < 0xDC00) + var isLowSurrogate = (code >= 0xDC00 && code < 0xE000) + + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset) + offset += 4 + } else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000 + + write32.call(dst, codepoint, offset) + offset += 4 + this.highSurrogate = 0 + + continue + } + } + + if (isHighSurrogate) { this.highSurrogate = code } else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset) + offset += 4 + this.highSurrogate = 0 + } + } + + if (offset < dst.length) { dst = dst.slice(0, offset) } + + return dst +} + +Utf32Encoder.prototype.end = function () { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) { return } + + var buf = Buffer.alloc(4) + + if (this.isLE) { buf.writeUInt32LE(this.highSurrogate, 0) } else { buf.writeUInt32BE(this.highSurrogate, 0) } + + this.highSurrogate = 0 + + return buf +} + +// -- Decoding + +function Utf32Decoder (options, codec) { + this.isLE = codec.isLE + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0) + this.overflow = [] +} + +Utf32Decoder.prototype.write = function (src) { + if (src.length === 0) { return "" } + + var i = 0 + var codepoint = 0 + var dst = Buffer.alloc(src.length + 4) + var offset = 0 + var isLE = this.isLE + var overflow = this.overflow + var badChar = this.badChar + + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) { overflow.push(src[i]) } + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[0] | (overflow[1] << 8) | (overflow[2] << 16) | (overflow[3] << 24) + } else { + codepoint = overflow[3] | (overflow[2] << 8) | (overflow[1] << 16) | (overflow[0] << 24) + } + overflow.length = 0 + + offset = _writeCodepoint(dst, offset, codepoint, badChar) + } + } + + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i + 1] << 8) | (src[i + 2] << 16) | (src[i + 3] << 24) + } else { + codepoint = src[i + 3] | (src[i + 2] << 8) | (src[i + 1] << 16) | (src[i] << 24) + } + offset = _writeCodepoint(dst, offset, codepoint, badChar) + } + + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]) + } + + return dst.slice(0, offset).toString("ucs2") +} + +function _writeCodepoint (dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar + } + + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000 + + var high = 0xD800 | (codepoint >> 10) + dst[offset++] = high & 0xff + dst[offset++] = high >> 8 + + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF) + } + + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff + dst[offset++] = codepoint >> 8 + + return offset +}; + +Utf32Decoder.prototype.end = function () { + if (this.overflow.length === 0) { return } + + // A leftover, incomplete 4-byte code unit at the end of the input is ill-formed. Substitute a + // single U+FFFD (Unicode Standard conformance clause C10) instead of silently dropping the bytes. + this.overflow.length = 0 + return String.fromCharCode(this.badChar) +} + +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); + +// Encoder prepends BOM (which can be overridden with (addBOM: false}). + +exports.utf32 = Utf32AutoCodec +exports.ucs4 = "utf32" + +function Utf32AutoCodec (options, iconv) { + this.iconv = iconv +} + +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder + +// -- Encoding + +function Utf32AutoEncoder (options, codec) { + options = options || {} + + if (options.addBOM === undefined) { + options.addBOM = true + } + + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || "utf-32le", options) +} + +Utf32AutoEncoder.prototype.write = function (str) { + return this.encoder.write(str) +} + +Utf32AutoEncoder.prototype.end = function () { + return this.encoder.end() +} + +// -- Decoding + +function Utf32AutoDecoder (options, codec) { + this.decoder = null + this.initialBufs = [] + this.initialBufsLen = 0 + this.options = options || {} + this.iconv = codec.iconv +} + +Utf32AutoDecoder.prototype.write = function (buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf) + this.initialBufsLen += buf.length + + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + { return "" } + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.write(buf) +} + +Utf32AutoDecoder.prototype.end = function () { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + var trail = this.decoder.end() + if (trail) { resStr += trail } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.end() +} + +function detectEncoding (bufs, defaultEncoding) { + var b = [] + var charsProcessed = 0 + var invalidLE = 0; var invalidBE = 0 // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0; var bmpCharsBE = 0 // Number of BMP chars when decoded as LE or BE. + + outerLoop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i] + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]) + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return "utf-32le" + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return "utf-32be" + } + } + + if (b[0] !== 0 || b[1] > 0x10) invalidBE++ + if (b[3] !== 0 || b[2] > 0x10) invalidLE++ + + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++ + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++ + + b.length = 0 + charsProcessed++ + + if (charsProcessed >= 100) { + break outerLoop + } + } + } + } + + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be" + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le" + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || "utf-32le" +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf7.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf7.js new file mode 100644 index 00000000..fe72a9d9 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/encodings/utf7.js @@ -0,0 +1,283 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 + +exports.utf7 = Utf7Codec +exports.unicode11utf7 = "utf7" // Alias UNICODE-1-1-UTF-7 +function Utf7Codec (codecOptions, iconv) { + this.iconv = iconv +}; + +Utf7Codec.prototype.encoder = Utf7Encoder +Utf7Codec.prototype.decoder = Utf7Decoder +Utf7Codec.prototype.bomAware = true + +// -- Encoding + +// Why scape ()?./? +// eslint-disable-next-line no-useless-escape +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g + +function Utf7Encoder (options, codec) { + this.iconv = codec.iconv +} + +Utf7Encoder.prototype.write = function (str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function (chunk) { + return "+" + (chunk === "+" + ? "" + : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + + "-" + }.bind(this))) +} + +Utf7Encoder.prototype.end = function () { +} + +// -- Decoding + +function Utf7Decoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = "" +} + +// Why scape /? +// eslint-disable-next-line no-useless-escape +var base64Regex = /[A-Za-z0-9\/+]/ +var base64Chars = [] +for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) } + +var plusChar = "+".charCodeAt(0) +var minusChar = "-".charCodeAt(0) +var andChar = "&".charCodeAt(0) + +Utf7Decoder.prototype.write = function (buf) { + var res = ""; var lastI = 0 + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + + // The decoder is more involved as we must handle chunks in stream. + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. + lastI = i + 1 + inBase64 = true + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "+-" -> "+" + res += "+" + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii") + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + { i-- } + + lastI = i + 1 + inBase64 = false + base64Accum = "" + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii") + + var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded) + + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + this.inBase64 = inBase64 + this.base64Accum = base64Accum + + return res +} + +Utf7Decoder.prototype.end = function () { + var res = "" + if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } + + this.inBase64 = false + this.base64Accum = "" + return res +} + +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. + +exports.utf7imap = Utf7IMAPCodec +function Utf7IMAPCodec (codecOptions, iconv) { + this.iconv = iconv +}; + +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder +Utf7IMAPCodec.prototype.bomAware = true + +// -- Encoding + +function Utf7IMAPEncoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = Buffer.alloc(6) + this.base64AccumIdx = 0 +} + +Utf7IMAPEncoder.prototype.write = function (str) { + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + var base64AccumIdx = this.base64AccumIdx + var buf = Buffer.alloc(str.length * 5 + 10); var bufIdx = 0 + + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i) + if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) + base64AccumIdx = 0 + } + + buf[bufIdx++] = minusChar // Write '-', then go to direct mode. + inBase64 = false + } + + if (!inBase64) { + buf[bufIdx++] = uChar // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + { buf[bufIdx++] = minusChar } + } + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar // Write '&', then go to base64 mode. + inBase64 = true + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8 + base64Accum[base64AccumIdx++] = uChar & 0xFF + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx) + base64AccumIdx = 0 + } + } + } + } + + this.inBase64 = inBase64 + this.base64AccumIdx = base64AccumIdx + + return buf.slice(0, bufIdx) +} + +Utf7IMAPEncoder.prototype.end = function () { + var buf = Buffer.alloc(10); var bufIdx = 0 + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) + this.base64AccumIdx = 0 + } + + buf[bufIdx++] = minusChar // Write '-', then go to direct mode. + this.inBase64 = false + } + + return buf.slice(0, bufIdx) +} + +// -- Decoding + +function Utf7IMAPDecoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = "" +} + +var base64IMAPChars = base64Chars.slice() +base64IMAPChars[",".charCodeAt(0)] = true + +Utf7IMAPDecoder.prototype.write = function (buf) { + var res = ""; var lastI = 0 + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. + lastI = i + 1 + inBase64 = true + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&" + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, "/") + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + { i-- } + + lastI = i + 1 + inBase64 = false + base64Accum = "" + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/") + + var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded) + + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + this.inBase64 = inBase64 + this.base64Accum = base64Accum + + return res +} + +Utf7IMAPDecoder.prototype.end = function () { + var res = "" + if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } + + this.inBase64 = false + this.base64Accum = "" + return res +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/bom-handling.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/bom-handling.js new file mode 100644 index 00000000..a86a6b55 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/bom-handling.js @@ -0,0 +1,48 @@ +"use strict" + +var BOMChar = "\uFEFF" + +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper (encoder, options) { + this.encoder = encoder + this.addBOM = true +} + +PrependBOMWrapper.prototype.write = function (str) { + if (this.addBOM) { + str = BOMChar + str + this.addBOM = false + } + + return this.encoder.write(str) +} + +PrependBOMWrapper.prototype.end = function () { + return this.encoder.end() +} + +// ------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper +function StripBOMWrapper (decoder, options) { + this.decoder = decoder + this.pass = false + this.options = options || {} +} + +StripBOMWrapper.prototype.write = function (buf) { + var res = this.decoder.write(buf) + if (this.pass || !res) { return res } + + if (res[0] === BOMChar) { + res = res.slice(1) + if (typeof this.options.stripBOM === "function") { this.options.stripBOM() } + } + + this.pass = true + return res +} + +StripBOMWrapper.prototype.end = function () { + return this.decoder.end() +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/helpers/merge-exports.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/helpers/merge-exports.js new file mode 100644 index 00000000..e79e041d --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/helpers/merge-exports.js @@ -0,0 +1,13 @@ +"use strict" + +var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn + +function mergeModules (target, module) { + for (var key in module) { + if (hasOwn(module, key)) { + target[key] = module[key] + } + } +} + +module.exports = mergeModules diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.d.ts b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.d.ts new file mode 100644 index 00000000..b11d99e9 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.d.ts @@ -0,0 +1,129 @@ +/* --------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * REQUIREMENT: This definition is dependent on the @types/node definition. + * Install with `npm install @types/node --save-dev` + *-------------------------------------------------------------------------------------------- */ + +/* --------------------------------------------------------------------------------------------- + * This file provides detailed typings for the public API of iconv-lite + *-------------------------------------------------------------------------------------------- */ + +import type Stream = require("stream") +import type { Encoding } from "../types/encodings" + +declare namespace iconv { + export interface DecodeOptions { + /** + * Strip the Byte Order Mark (BOM) from the input, + * when decoding, if the codec is BOM-aware. @default true + */ + stripBOM?: boolean; + /** Override the default endianness for `UTF-16` and `UTF-32` decodings. */ + defaultEncoding?: "utf16be" | "utf32be"; + } + + export interface EncodeOptions { + /** + * Add a Byte Order Mark (BOM) to the output, when encoding, + * if the codec is BOM-aware. @default false + */ + addBOM?: boolean; + /** Override the default endianness for `UTF-32` encoding. */ + defaultEncoding?: "utf32be"; + } + + export interface EncoderStream { + write(str: string): Buffer; + end(): Buffer | undefined; + } + + export interface DecoderStream { + write(buf: Buffer): string; + end(): string | undefined; + } + + export interface Codec { + encoder: new (options?: EncodeOptions, codec?: Codec) => EncoderStream; + decoder: new (options?: DecodeOptions, codec?: Codec) => DecoderStream; + bomAware?: boolean; + [key: string]: any; + } + + /** Encodes a `string` into a `Buffer`, using the provided `encoding`. */ + export function encode (content: string, encoding: Encoding, options?: EncodeOptions): Buffer + + /** Decodes a `Buffer` into a `string`, using the provided `encoding`. */ + export function decode (buffer: Buffer | Uint8Array, encoding: Encoding, options?: DecodeOptions): string + + /** Checks if a given encoding is supported by `iconv-lite`. */ + export function encodingExists (encoding: string): encoding is Encoding + + /** Legacy alias for {@link iconv.encode}. */ + export const toEncoding: typeof iconv.encode + + /** Legacy alias for {@link iconv.decode}. */ + export const fromEncoding: typeof iconv.decode + + /** Creates a stream that decodes binary data from a given `encoding` into strings. */ + export function decodeStream (encoding: Encoding, options?: DecodeOptions): NodeJS.ReadWriteStream + + /** Creates a stream that encodes strings into binary data in a given `encoding`. */ + export function encodeStream (encoding: Encoding, options?: EncodeOptions): NodeJS.ReadWriteStream + + /** + * Explicitly enable Streaming API in browser environments by passing in: + * ```js + * require('stream') + * ``` + * @example iconv.enableStreamingAPI(require('stream')); + */ + export function enableStreamingAPI (stream_module: { Transform: typeof Stream.Transform }): void + + /** Creates and returns a low-level encoder stream. */ + export function getEncoder (encoding: Encoding, options?: EncodeOptions): EncoderStream + + /** Creates and returns a low-level decoder stream. */ + export function getDecoder (encoding: Encoding, options?: DecodeOptions): DecoderStream + + /** + * Returns a codec object for the given `encoding`. + * @throws If the `encoding` is not recognized. + */ + export function getCodec (encoding: Encoding): Codec + + /** Strips all non-alphanumeric characters and appended year from `encoding`. */ + export function _canonicalizeEncoding (encoding: Encoding): string + + /** A cache of all loaded encoding definitions. */ + export let encodings: Record< + Encoding, + | string + | { + type: string; + [key: string]: any; + } + > | null + + /** A cache of initialized codec objects. */ + export let _codecDataCache: Record + + /** The character used for untranslatable `Unicode` characters. @default "�" */ + export let defaultCharUnicode: string + + /** The character used for untranslatable `single-byte` characters. @default "?" */ + export let defaultCharSingleByte: string + + /** + * Skip deprecation warning when strings are used instead of Buffers during decoding. + * Note: {@link iconv.decode} converts the string to Buffer regardless. + */ + export let skipDecodeWarning: boolean + + /** @readonly Whether or not, Streaming API is enabled. */ + export const supportsStreams: boolean + + export type { iconv as Iconv, Encoding } +} + +export = iconv diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.js new file mode 100644 index 00000000..bd5d6bc0 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/index.js @@ -0,0 +1,182 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +var bomHandling = require("./bom-handling") +var mergeModules = require("./helpers/merge-exports") + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true +module.exports.encodings = null + +// Characters emitted in case of error. +module.exports.defaultCharUnicode = "�" +module.exports.defaultCharSingleByte = "?" + +// Public API. +module.exports.encode = function encode (str, encoding, options) { + str = "" + (str || "") // Ensure string. + + var encoder = module.exports.getEncoder(encoding, options) + + var res = encoder.write(str) + var trail = encoder.end() + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res +} + +module.exports.decode = function decode (buf, encoding, options) { + if (typeof buf === "string") { + if (!module.exports.skipDecodeWarning) { + console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding") + module.exports.skipDecodeWarning = true + } + + buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer. + } + + var decoder = module.exports.getDecoder(encoding, options) + + var res = decoder.write(buf) + var trail = decoder.end() + + return trail ? (res + trail) : res +} + +module.exports.encodingExists = function encodingExists (enc) { + try { + module.exports.getCodec(enc) + return true + } catch (e) { + return false + } +} + +// Legacy aliases to convert functions +module.exports.toEncoding = module.exports.encode +module.exports.fromEncoding = module.exports.decode + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +module.exports._codecDataCache = { __proto__: null } + +module.exports.getCodec = function getCodec (encoding) { + if (!module.exports.encodings) { + var raw = require("../encodings") + // TODO: In future versions when old nodejs support is removed can use object.assign + module.exports.encodings = { __proto__: null } // Initialize as empty object. + mergeModules(module.exports.encodings, raw) + } + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = module.exports._canonicalizeEncoding(encoding) + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {} + while (true) { + var codec = module.exports._codecDataCache[enc] + + if (codec) { return codec } + + var codecDef = module.exports.encodings[enc] + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef + break + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) { codecOptions[key] = codecDef[key] } + + if (!codecOptions.encodingName) { codecOptions.encodingName = enc } + + enc = codecDef.type + break + + case "function": // Codec itself. + if (!codecOptions.encodingName) { codecOptions.encodingName = enc } + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + // + codec = new codecDef(codecOptions, module.exports) + + module.exports._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later. + return codec + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')") + } + } +} + +module.exports._canonicalizeEncoding = function (encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "") +} + +module.exports.getEncoder = function getEncoder (encoding, options) { + var codec = module.exports.getCodec(encoding) + var encoder = new codec.encoder(options, codec) + + if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) } + + return encoder +} + +module.exports.getDecoder = function getDecoder (encoding, options) { + var codec = module.exports.getCodec(encoding) + var decoder = new codec.decoder(options, codec) + + if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) } + + return decoder +} + +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) { + if (module.exports.supportsStreams) { return } + + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(streamModule) + + // Not public API yet, but expose the stream classes. + module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream + module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream + + // Streaming API. + module.exports.encodeStream = function encodeStream (encoding, options) { + return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options) + } + + module.exports.decodeStream = function decodeStream (encoding, options) { + return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options) + } + + module.exports.supportsStreams = true +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var streamModule +try { + streamModule = require("stream") +} catch (e) {} + +if (streamModule && streamModule.Transform) { + module.exports.enableStreamingAPI(streamModule) +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + module.exports.encodeStream = module.exports.decodeStream = function () { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.") + } +} + +// Some environments, such as browsers, may not load JavaScript files as UTF-8 +// eslint-disable-next-line no-constant-condition +if ("Ā" !== "\u0100") { + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.") +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/streams.js b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/streams.js new file mode 100644 index 00000000..ebfed8e0 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/lib/streams.js @@ -0,0 +1,105 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function (streamModule) { + var Transform = streamModule.Transform + + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream (conv, options) { + this.conv = conv + options = options || {} + options.decodeStrings = false // We accept only strings, so we don't need to decode them. + Transform.call(this, options) + } + + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }) + + IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) { + if (typeof chunk !== "string") { + return done(new Error("Iconv encoding stream needs strings as its input.")) + } + + try { + var res = this.conv.write(chunk) + if (res && res.length) this.push(res) + done() + } catch (e) { + done(e) + } + } + + IconvLiteEncoderStream.prototype._flush = function (done) { + try { + var res = this.conv.end() + if (res && res.length) this.push(res) + done() + } catch (e) { + done(e) + } + } + + IconvLiteEncoderStream.prototype.collect = function (cb) { + var chunks = [] + this.on("error", cb) + this.on("data", function (chunk) { chunks.push(chunk) }) + this.on("end", function () { + cb(null, Buffer.concat(chunks)) + }) + return this + } + + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream (conv, options) { + this.conv = conv + options = options || {} + options.encoding = this.encoding = "utf8" // We output strings. + Transform.call(this, options) + } + + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }) + + IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) } + try { + var res = this.conv.write(chunk) + if (res && res.length) this.push(res, this.encoding) + done() + } catch (e) { + done(e) + } + } + + IconvLiteDecoderStream.prototype._flush = function (done) { + try { + var res = this.conv.end() + if (res && res.length) this.push(res, this.encoding) + done() + } catch (e) { + done(e) + } + } + + IconvLiteDecoderStream.prototype.collect = function (cb) { + var res = "" + this.on("error", cb) + this.on("data", function (chunk) { res += chunk }) + this.on("end", function () { + cb(null, res) + }) + return this + } + + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream + } +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/package.json b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/package.json new file mode 100644 index 00000000..57f8d3b2 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/package.json @@ -0,0 +1,70 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.7.3", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "author": "Alexander Shtuchkin ", + "main": "./lib/index.js", + "typings": "./lib/index.d.ts", + "homepage": "https://github.com/pillarjs/iconv-lite", + "bugs": "https://github.com/pillarjs/iconv-lite/issues", + "files": [ + "lib/", + "encodings/", + "types/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/iconv-lite.git" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "lint": "eslint", + "lint:fix": "eslint --fix", + "test": "mocha --reporter spec --check-leaks --grep .", + "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test", + "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test", + "test:performance": "node --allow-natives-syntax performance/index.js", + "test:tap": "mocha --reporter tap --check-leaks --grep .", + "test:typescript": "tsc && attw --pack", + "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz", + "typegen": "node generation/gen-typings.js" + }, + "browser": { + "stream": false + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.4", + "@stylistic/eslint-plugin": "^5.1.0", + "@stylistic/eslint-plugin-js": "^4.1.0", + "@types/node": "^24.0.12", + "async": "^3.2.0", + "bench-node": "^0.10.0", + "eslint": "^9.0.0", + "errto": "^0.2.1", + "expect-type": "^1.2.0", + "iconv": "^2.3.5", + "mocha": "^6.2.2", + "neostandard": "^0.12.0", + "nyc": "^14.1.1", + "request": "^2.88.2", + "semver": "^6.3.0", + "typescript": "~5.9.2", + "unorm": "^1.6.0" + }, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } +} diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/types/encodings.d.ts b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/types/encodings.d.ts new file mode 100644 index 00000000..610bd7cb --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/iconv-lite/types/encodings.d.ts @@ -0,0 +1,425 @@ +/* + * --------------------------------------------------------------------------------------------- + * DO NOT EDIT THIS FILE MANUALLY. + * THIS FILE IS AUTOMATICALLY GENERATED. + * TO UPDATE, RUN `npm run typegen` AND COMMIT THE CHANGES. + * --------------------------------------------------------------------------------------------- + */ + +/** A union of all supported encoding strings in `iconv-lite`. */ +export type Encoding = + | "10000" + | "10006" + | "10007" + | "10029" + | "10079" + | "10081" + | "1046" + | "1124" + | "1125" + | "1129" + | "1133" + | "1161" + | "1162" + | "1163" + | "1250" + | "1251" + | "1252" + | "1253" + | "1254" + | "1255" + | "1256" + | "1257" + | "1258" + | "20866" + | "21866" + | "28591" + | "28592" + | "28593" + | "28594" + | "28595" + | "28596" + | "28597" + | "28598" + | "28599" + | "28600" + | "28601" + | "28603" + | "28604" + | "28605" + | "28606" + | "437" + | "737" + | "775" + | "808" + | "850" + | "852" + | "855" + | "856" + | "857" + | "858" + | "860" + | "861" + | "862" + | "863" + | "864" + | "865" + | "866" + | "869" + | "874" + | "922" + | "932" + | "936" + | "949" + | "950" + | "ansix34" + | "ansix341968" + | "ansix341986" + | "arabic" + | "arabic8" + | "armscii8" + | "ascii" + | "ascii8bit" + | "asmo708" + | "base64" + | "big5" + | "big5hkscs" + | "binary" + | "celtic" + | "celtic8" + | "cesu8" + | "chinese" + | "cn" + | "cnbig5" + | "cp1046" + | "cp1124" + | "cp1125" + | "cp1129" + | "cp1133" + | "cp1161" + | "cp1162" + | "cp1163" + | "cp1250" + | "cp1251" + | "cp1252" + | "cp1253" + | "cp1254" + | "cp1255" + | "cp1256" + | "cp1257" + | "cp1258" + | "cp20866" + | "cp21866" + | "cp28591" + | "cp28592" + | "cp28593" + | "cp28594" + | "cp28595" + | "cp28596" + | "cp28597" + | "cp28598" + | "cp28599" + | "cp28600" + | "cp28601" + | "cp28603" + | "cp28604" + | "cp28605" + | "cp28606" + | "cp367" + | "cp437" + | "cp720" + | "cp737" + | "cp775" + | "cp808" + | "cp819" + | "cp850" + | "cp852" + | "cp855" + | "cp856" + | "cp857" + | "cp858" + | "cp860" + | "cp861" + | "cp862" + | "cp863" + | "cp864" + | "cp865" + | "cp866" + | "cp869" + | "cp874" + | "cp922" + | "cp932" + | "cp936" + | "cp949" + | "cp950" + | "cpgr" + | "csascii" + | "csbig5" + | "cseuckr" + | "csgb2312" + | "cshproman8" + | "csibm1046" + | "csibm1124" + | "csibm1125" + | "csibm1129" + | "csibm1133" + | "csibm1161" + | "csibm1162" + | "csibm1163" + | "csibm437" + | "csibm737" + | "csibm775" + | "csibm850" + | "csibm852" + | "csibm855" + | "csibm856" + | "csibm857" + | "csibm858" + | "csibm860" + | "csibm861" + | "csibm862" + | "csibm863" + | "csibm864" + | "csibm865" + | "csibm866" + | "csibm869" + | "csibm922" + | "csiso14jisc6220ro" + | "csiso58gb231280" + | "csisolatin1" + | "csisolatin2" + | "csisolatin3" + | "csisolatin4" + | "csisolatin5" + | "csisolatin6" + | "csisolatinarabic" + | "csisolatincyrillic" + | "csisolatingreek" + | "csisolatinhebrew" + | "cskoi8r" + | "csksc56011987" + | "csmacintosh" + | "cspc775baltic" + | "cspc850multilingual" + | "cspc862latinhebrew" + | "cspc8codepage437" + | "cspcp852" + | "csshiftjis" + | "cyrillic" + | "ecma114" + | "ecma118" + | "elot928" + | "euccn" + | "eucjp" + | "euckr" + | "gb18030" + | "gb198880" + | "gb2312" + | "gb23121980" + | "gb231280" + | "gbk" + | "georgianacademy" + | "georgianps" + | "greek" + | "greek8" + | "hebrew" + | "hebrew8" + | "hex" + | "hproman8" + | "ibm1046" + | "ibm1051" + | "ibm1124" + | "ibm1125" + | "ibm1129" + | "ibm1133" + | "ibm1161" + | "ibm1162" + | "ibm1163" + | "ibm1168" + | "ibm367" + | "ibm437" + | "ibm737" + | "ibm775" + | "ibm808" + | "ibm819" + | "ibm850" + | "ibm852" + | "ibm855" + | "ibm856" + | "ibm857" + | "ibm858" + | "ibm860" + | "ibm861" + | "ibm862" + | "ibm863" + | "ibm864" + | "ibm865" + | "ibm866" + | "ibm869" + | "ibm878" + | "ibm922" + | "iso646cn" + | "iso646irv" + | "iso646jp" + | "iso646us" + | "iso88591" + | "iso885910" + | "iso885911" + | "iso885913" + | "iso885914" + | "iso885915" + | "iso885916" + | "iso88592" + | "iso88593" + | "iso88594" + | "iso88595" + | "iso88596" + | "iso88597" + | "iso88598" + | "iso88598e" + | "iso88598i" + | "iso88599" + | "isoceltic" + | "isoir100" + | "isoir101" + | "isoir109" + | "isoir110" + | "isoir126" + | "isoir127" + | "isoir138" + | "isoir14" + | "isoir144" + | "isoir148" + | "isoir149" + | "isoir157" + | "isoir166" + | "isoir179" + | "isoir199" + | "isoir203" + | "isoir226" + | "isoir57" + | "isoir58" + | "isoir6" + | "jisc62201969ro" + | "jp" + | "koi8r" + | "koi8ru" + | "koi8t" + | "koi8u" + | "korean" + | "ksc5601" + | "ksc56011987" + | "ksc56011989" + | "l1" + | "l10" + | "l2" + | "l3" + | "l4" + | "l5" + | "l6" + | "l7" + | "l8" + | "l9" + | "latin1" + | "latin10" + | "latin2" + | "latin3" + | "latin4" + | "latin5" + | "latin6" + | "latin7" + | "latin8" + | "latin9" + | "mac" + | "maccenteuro" + | "maccroatian" + | "maccyrillic" + | "macgreek" + | "maciceland" + | "macintosh" + | "macroman" + | "macromania" + | "macthai" + | "macturkish" + | "macukraine" + | "mik" + | "ms31j" + | "ms932" + | "ms936" + | "ms949" + | "ms950" + | "msansi" + | "msarab" + | "mscyrl" + | "msee" + | "msgreek" + | "mshebr" + | "mskanji" + | "msturk" + | "pt154" + | "r8" + | "rk1048" + | "roman8" + | "shiftjis" + | "sjis" + | "strk10482002" + | "tcvn" + | "tcvn5712" + | "tcvn57121" + | "thai" + | "thai8" + | "tis620" + | "tis6200" + | "tis62025291" + | "tis62025330" + | "turkish" + | "turkish8" + | "ucs2" + | "ucs4" + | "ucs4be" + | "ucs4le" + | "unicode11utf7" + | "unicode11utf8" + | "us" + | "usascii" + | "utf16" + | "utf16be" + | "utf16le" + | "utf32" + | "utf32be" + | "utf32le" + | "utf7" + | "utf7imap" + | "utf8" + | "viscii" + | "win1250" + | "win1251" + | "win1252" + | "win1253" + | "win1254" + | "win1255" + | "win1256" + | "win1257" + | "win1258" + | "win874" + | "winbaltrim" + | "windows1250" + | "windows1251" + | "windows1252" + | "windows1253" + | "windows1254" + | "windows1255" + | "windows1256" + | "windows1257" + | "windows1258" + | "windows31j" + | "windows874" + | "windows932" + | "windows936" + | "windows949" + | "windows950" + | "xgbk" + | "xroman8" + | "xsjis" + | "xxbig5" + | (string & {}) diff --git a/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/safer-buffer b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/safer-buffer new file mode 120000 index 00000000..43139031 --- /dev/null +++ b/backend/node_modules/.pnpm/iconv-lite@0.7.3/node_modules/safer-buffer @@ -0,0 +1 @@ +../../safer-buffer@2.1.2/node_modules/safer-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/LICENSE b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/LICENSE new file mode 100644 index 00000000..dea3013d --- /dev/null +++ b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/README.md b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/README.md new file mode 100644 index 00000000..b1c56658 --- /dev/null +++ b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js new file mode 100644 index 00000000..f71f2d93 --- /dev/null +++ b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js @@ -0,0 +1,9 @@ +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = require('./inherits_browser.js'); +} diff --git a/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js new file mode 100644 index 00000000..86bbb3dc --- /dev/null +++ b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js @@ -0,0 +1,27 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} diff --git a/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/package.json b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/package.json new file mode 100644 index 00000000..37b4366b --- /dev/null +++ b/backend/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/package.json @@ -0,0 +1,29 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.4", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": "git://github.com/isaacs/inherits", + "license": "ISC", + "scripts": { + "test": "tap" + }, + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ] +} diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.editorconfig b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.editorconfig new file mode 100644 index 00000000..f5f56790 --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.editorconfig @@ -0,0 +1,31 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 +max_line_length = off + +[README.md] +indent_style = off +indent_size = off +max_line_length = off + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off + +[coverage*/**/*] +indent_style = off +indent_size = off +max_line_length = off diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.eslintrc b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.eslintrc new file mode 100644 index 00000000..ce033bfe --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.eslintrc @@ -0,0 +1,10 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-statements-per-line": [2, { "max": 2 }], + }, +} diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.github/FUNDING.yml b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.github/FUNDING.yml new file mode 100644 index 00000000..0fdebd06 --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/is-callable +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.nycrc b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/CHANGELOG.md b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/CHANGELOG.md new file mode 100644 index 00000000..32788cda --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/CHANGELOG.md @@ -0,0 +1,158 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.2.7](https://github.com/inspect-js/is-callable/compare/v1.2.6...v1.2.7) - 2022-09-23 + +### Commits + +- [Fix] recognize `document.all` in IE 6-10 [`06c1db2`](https://github.com/inspect-js/is-callable/commit/06c1db2b9b2e0f28428e1293eb572f8f93871ec7) +- [Tests] improve logic for FF 20-35 [`0f7d9b9`](https://github.com/inspect-js/is-callable/commit/0f7d9b9c7fe149ca87e71f0a125ade251a6a578c) +- [Fix] handle `document.all` in FF 27 (and +, probably) [`696c661`](https://github.com/inspect-js/is-callable/commit/696c661b8c0810c2d05ab172f1607f4e77ddf81e) +- [Tests] fix proxy tests in FF 42-63 [`985df0d`](https://github.com/inspect-js/is-callable/commit/985df0dd36f8cfe6f1993657b7c0f4cfc19dae30) +- [readme] update tested browsers [`389e919`](https://github.com/inspect-js/is-callable/commit/389e919493b1cb2010126b0411e5291bf76169bd) +- [Fix] detect `document.all` in Opera 12.16 [`b9f1022`](https://github.com/inspect-js/is-callable/commit/b9f1022b3d7e466b7f09080bd64c253caf644325) +- [Fix] HTML elements: properly report as callable in Opera 12.16 [`17391fe`](https://github.com/inspect-js/is-callable/commit/17391fe02b895777c4337be28dca3b364b743b34) +- [Tests] fix inverted logic in FF3 test [`056ebd4`](https://github.com/inspect-js/is-callable/commit/056ebd48790f46ca18ff5b12f51b44c08ccc3595) + +## [v1.2.6](https://github.com/inspect-js/is-callable/compare/v1.2.5...v1.2.6) - 2022-09-14 + +### Commits + +- [Fix] work for `document.all` in Firefox 3 and IE 6-8 [`015132a`](https://github.com/inspect-js/is-callable/commit/015132aaef886ec777b5b3593ef4ce461dd0c7d4) +- [Test] skip function toString check for nullish values [`8698116`](https://github.com/inspect-js/is-callable/commit/8698116f95eb59df8b48ec8e4585fc1cdd8cae9f) +- [readme] add "supported engines" section [`0442207`](https://github.com/inspect-js/is-callable/commit/0442207a89a1554d41ba36daf21862ef7ccbd500) +- [Tests] skip one of the fixture objects in FF 3.6 [`a501141`](https://github.com/inspect-js/is-callable/commit/a5011410bc6edb276c6ec8b47ce5c5d83c4bee15) +- [Tests] allow `class` constructor tests to fail in FF v45 - v54, which has undetectable classes [`b12e4a4`](https://github.com/inspect-js/is-callable/commit/b12e4a4d8c438678bd7710f9f896680150766b51) +- [Fix] Safari 4: regexes should not be considered callable [`4b732ff`](https://github.com/inspect-js/is-callable/commit/4b732ffa34346db3f0193ea4e46b7d4e637e6c82) +- [Fix] properly recognize `document.all` in Safari 4 [`3193735`](https://github.com/inspect-js/is-callable/commit/319373525dc4603346661641840cd9a3e0613136) + +## [v1.2.5](https://github.com/inspect-js/is-callable/compare/v1.2.4...v1.2.5) - 2022-09-11 + +### Commits + +- [actions] reuse common workflows [`5bb4b32`](https://github.com/inspect-js/is-callable/commit/5bb4b32dc93987328ab4f396601f751c4a7abd62) +- [meta] better `eccheck` command [`b9bd597`](https://github.com/inspect-js/is-callable/commit/b9bd597322b6e3a24c74c09881ca73e1d9f9f485) +- [meta] use `npmignore` to autogenerate an npmignore file [`3192d38`](https://github.com/inspect-js/is-callable/commit/3192d38527c7fc461d05d5aa93d47628e658bc45) +- [Fix] for HTML constructors, always use `tryFunctionObject` even in pre-toStringTag browsers [`3076ea2`](https://github.com/inspect-js/is-callable/commit/3076ea21d1f6ecc1cb711dcf1da08f257892c72b) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `available-typed-arrays`, `object-inspect`, `safe-publish-latest`, `tape` [`8986746`](https://github.com/inspect-js/is-callable/commit/89867464c42adc5cd375ee074a4574b0295442cb) +- [meta] add `auto-changelog` [`7dda9d0`](https://github.com/inspect-js/is-callable/commit/7dda9d04e670a69ae566c8fa596da4ff4371e615) +- [Fix] properly report `document.all` [`da90b2b`](https://github.com/inspect-js/is-callable/commit/da90b2b68dc4f33702c2e01ad07b4f89bcb60984) +- [actions] update codecov uploader [`c8f847c`](https://github.com/inspect-js/is-callable/commit/c8f847c90e04e54ff73c7cfae86e96e94990e324) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`899ae00`](https://github.com/inspect-js/is-callable/commit/899ae00b6abd10d81fc8bc7f02b345fd885d5f56) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `es-value-fixtures`, `object-inspect`, `tape` [`344e913`](https://github.com/inspect-js/is-callable/commit/344e913b149609bf741aa7345fa32dc0b90d8893) +- [meta] remove greenkeeper config [`737dce5`](https://github.com/inspect-js/is-callable/commit/737dce5590b1abb16183a63cb9d7d26920b3b394) +- [meta] npmignore coverage output [`680a883`](https://github.com/inspect-js/is-callable/commit/680a8839071bf36a419fe66e1ced7a3303c27b28) + + +1.2.4 / 2021-08-05 +================= + * [Fix] use `has-tostringtag` approach to behave correctly in the presence of symbol shams + * [readme] fix repo URLs + * [readme] add actions and codecov badges + * [readme] remove defunct badges + * [meta] ignore eclint checking coverage output + * [meta] use `prepublishOnly` script for npm 7+ + * [actions] use `node/install` instead of `node/run`; use `codecov` action + * [actions] remove unused workflow file + * [Tests] run `nyc` on all tests; use `tape` runner + * [Tests] use `available-typed-arrays`, `for-each`, `has-symbols`, `object-inspect` + * [Dev Deps] update `available-typed-arrays`, `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` + +1.2.3 / 2021-01-31 +================= + * [Fix] `document.all` is callable (do not use `document.all`!) + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` + * [Tests] migrate tests to Github Actions + * [actions] add "Allow Edits" workflow + * [actions] switch Automatic Rebase workflow to `pull_request_target` event + +1.2.2 / 2020-09-21 +================= + * [Fix] include actual fix from 579179e + * [Dev Deps] update `eslint` + +1.2.1 / 2020-09-09 +================= + * [Fix] phantomjs‘ Reflect.apply does not throw properly on a bad array-like + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [meta] fix eclint error + +1.2.0 / 2020-06-02 +================= + * [New] use `Reflect.apply`‑based callability detection + * [readme] add install instructions (#55) + * [meta] only run `aud` on prod deps + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `make-arrow-function`, `make-generator-function`; add `aud`, `safe-publish-latest`, `make-async-function` + * [Tests] add tests for function proxies (#53, #25) + +1.1.5 / 2019-12-18 +================= + * [meta] remove unused Makefile and associated utilities + * [meta] add `funding` field; add FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `tape`, `covert`, `rimraf` + * [Tests] use shared travis configs + * [Tests] use `eccheck` over `editorconfig-tools` + * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops + * [Tests] remove `jscs` + * [actions] add automatic rebasing / merge commit blocking + +1.1.4 / 2018-07-02 +================= + * [Fix] improve `class` and arrow function detection (#30, #31) + * [Tests] on all latest node minors; improve matrix + * [Dev Deps] update all dev deps + +1.1.3 / 2016-02-27 +================= + * [Fix] ensure “class “ doesn’t screw up “class” detection + * [Tests] up to `node` `v5.7`, `v4.3` + * [Dev Deps] update to `eslint` v2, `@ljharb/eslint-config`, `jscs` + +1.1.2 / 2016-01-15 +================= + * [Fix] Make sure comments don’t screw up “class” detection (#4) + * [Tests] up to `node` `v5.3` + * [Tests] Add `parallelshell`, run both `--es-staging` and stock tests at once + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Refactor] convert `isNonES6ClassFn` into `isES6ClassFn` + +1.1.1 / 2015-11-30 +================= + * [Fix] do not throw when a non-function has a function in its [[Prototype]] (#2) + * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `jscs`, `nsp`, `semver` + * [Tests] up to `node` `v5.1` + * [Tests] no longer allow node 0.8 to fail. + * [Tests] fix npm upgrades in older nodes + +1.1.0 / 2015-10-02 +================= + * [Fix] Some browsers report TypedArray constructors as `typeof object` + * [New] return false for "class" constructors, when possible. + * [Tests] up to `io.js` `v3.3`, `node` `v4.1` + * [Dev Deps] update `eslint`, `editorconfig-tools`, `nsp`, `tape`, `semver`, `jscs`, `covert`, `make-arrow-function` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + +1.0.4 / 2015-01-30 +================= + * If @@toStringTag is not present, use the old-school Object#toString test. + +1.0.3 / 2015-01-29 +================= + * Add tests to ensure arrow functions are callable. + * Refactor to aid optimization of non-try/catch code. + +1.0.2 / 2015-01-29 +================= + * Fix broken package.json + +1.0.1 / 2015-01-29 +================= + * Add early exit for typeof not "function" + +1.0.0 / 2015-01-29 +================= + * Initial release. diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/LICENSE b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/LICENSE new file mode 100644 index 00000000..b43df444 --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/README.md b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/README.md new file mode 100644 index 00000000..4f2b6d6f --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/README.md @@ -0,0 +1,83 @@ +# is-callable [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag. + +## Supported engines +Automatically tested in every minor version of node. + +Manually tested in: + - Safari: v4 - v15 (4, 5, 5.1, 6.0.5, 6.2, 7.1, 8, 9.1.3, 10.1.2, 11.1.2, 12.1, 13.1.2, 14.1.2, 15.3, 15.6.1) + - Note: Safari 9 has `class`, but `Function.prototype.toString` hides that progeny and makes them look like functions, so `class` constructors will be reported by this package as callable, when they are not in fact callable. + - Chrome: v15 - v81, v83 - v106(every integer version) + - Note: This includes Edge v80+ and Opera v15+, which matches Chrome + - Firefox: v3, v3.6, v4 - v105 (every integer version) + - Note: v45 - v54 has `class`, but `Function.prototype.toString` hides that progeny and makes them look like functions, so `class` constructors will be reported by this package as callable, when they are not in fact callable. + - Note: in v42 - v63, `Function.prototype.toString` throws on HTML element constructors, or a Proxy to a function + - Note: in v20 - v35, HTML element constructors are not callable, despite having typeof `function`. + - Note: in v19, `document.all` is not callable. + - IE: v6 - v11(every integer version + - Opera: v11.1, v11.5, v11.6, v12.1, v12.14, v12.15, v12.16, v15+ v15+ matches Chrome + +## Example + +```js +var isCallable = require('is-callable'); +var assert = require('assert'); + +assert.notOk(isCallable(undefined)); +assert.notOk(isCallable(null)); +assert.notOk(isCallable(false)); +assert.notOk(isCallable(true)); +assert.notOk(isCallable([])); +assert.notOk(isCallable({})); +assert.notOk(isCallable(/a/g)); +assert.notOk(isCallable(new RegExp('a', 'g'))); +assert.notOk(isCallable(new Date())); +assert.notOk(isCallable(42)); +assert.notOk(isCallable(NaN)); +assert.notOk(isCallable(Infinity)); +assert.notOk(isCallable(new Number(42))); +assert.notOk(isCallable('foo')); +assert.notOk(isCallable(Object('foo'))); + +assert.ok(isCallable(function () {})); +assert.ok(isCallable(function* () {})); +assert.ok(isCallable(x => x * x)); +``` + +## Install + +Install with + +``` +npm install is-callable +``` + +## Tests + +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-callable +[2]: https://versionbadg.es/inspect-js/is-callable.svg +[5]: https://david-dm.org/inspect-js/is-callable.svg +[6]: https://david-dm.org/inspect-js/is-callable +[7]: https://david-dm.org/inspect-js/is-callable/dev-status.svg +[8]: https://david-dm.org/inspect-js/is-callable#info=devDependencies +[11]: https://nodei.co/npm/is-callable.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/is-callable.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/is-callable.svg +[downloads-url]: https://npm-stat.com/charts.html?package=is-callable +[codecov-image]: https://codecov.io/gh/inspect-js/is-callable/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/is-callable/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-callable +[actions-url]: https://github.com/inspect-js/is-callable/actions diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js new file mode 100644 index 00000000..f2a89f84 --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js @@ -0,0 +1,101 @@ +'use strict'; + +var fnToStr = Function.prototype.toString; +var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; +var badArrayLike; +var isCallableMarker; +if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { + try { + badArrayLike = Object.defineProperty({}, 'length', { + get: function () { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + // eslint-disable-next-line no-throw-literal + reflectApply(function () { throw 42; }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } +} else { + reflectApply = null; +} + +var constructorRegex = /^\s*class\b/; +var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; // not a function + } +}; + +var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { return false; } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var objectClass = '[object Object]'; +var fnClass = '[object Function]'; +var genClass = '[object GeneratorFunction]'; +var ddaClass = '[object HTMLAllCollection]'; // IE 11 +var ddaClass2 = '[object HTML document.all class]'; +var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 +var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` + +var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing + +var isDDA = function isDocumentDotAll() { return false; }; +if (typeof document === 'object') { + // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly + var all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value) { + /* globals document: false */ + // in IE 6-8, typeof document.all is "object" and it's truthy + if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { + try { + var str = toStr.call(value); + return ( + str === ddaClass + || str === ddaClass2 + || str === ddaClass3 // opera 12.16 + || str === objectClass // IE 6-8 + ) && value('') == null; // eslint-disable-line eqeqeq + } catch (e) { /**/ } + } + return false; + }; + } +} + +module.exports = reflectApply + ? function isCallable(value) { + if (isDDA(value)) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { return false; } + } + return !isES6ClassFn(value) && tryFunctionObject(value); + } + : function isCallable(value) { + if (isDDA(value)) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (hasToStringTag) { return tryFunctionObject(value); } + if (isES6ClassFn(value)) { return false; } + var strClass = toStr.call(value); + if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; } + return tryFunctionObject(value); + }; diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/package.json b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/package.json new file mode 100644 index 00000000..aa3e8df0 --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/package.json @@ -0,0 +1,106 @@ +{ + "name": "is-callable", + "version": "1.2.7", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "description": "Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag.", + "license": "MIT", + "main": "index.js", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent lint", + "test": "npm run tests-only --", + "posttest": "aud --production", + "tests-only": "nyc tape 'test/**/*.js'", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs ." + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/is-callable.git" + }, + "keywords": [ + "Function", + "function", + "callable", + "generator", + "generator function", + "arrow", + "arrow function", + "ES6", + "toStringTag", + "@@toStringTag" + ], + "devDependencies": { + "@ljharb/eslint-config": "^21.0.0", + "aud": "^2.0.0", + "auto-changelog": "^2.4.0", + "available-typed-arrays": "^1.0.5", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "for-each": "^0.3.3", + "has-tostringtag": "^1.0.0", + "make-arrow-function": "^1.2.0", + "make-async-function": "^1.0.0", + "make-generator-function": "^2.0.0", + "npmignore": "^0.3.0", + "nyc": "^10.3.2", + "object-inspect": "^1.12.2", + "rimraf": "^2.7.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.6.0" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true, + "startingVersion": "v1.2.5" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/test/index.js b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/test/index.js new file mode 100644 index 00000000..bfe5db5c --- /dev/null +++ b/backend/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/test/index.js @@ -0,0 +1,244 @@ +'use strict'; + +/* eslint no-magic-numbers: 1 */ + +var test = require('tape'); +var isCallable = require('../'); +var hasToStringTag = require('has-tostringtag/shams')(); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var typedArrayNames = require('available-typed-arrays')(); +var generators = require('make-generator-function')(); +var arrows = require('make-arrow-function').list(); +var asyncs = require('make-async-function').list(); +var weirdlyCommentedArrowFn; +try { + /* eslint-disable no-new-func */ + weirdlyCommentedArrowFn = Function('return cl/*/**/=>/**/ass - 1;')(); + /* eslint-enable no-new-func */ +} catch (e) { /**/ } + +var isIE68 = !(0 in [undefined]); +var isFirefox = typeof window !== 'undefined' && ('netscape' in window) && (/ rv:/).test(navigator.userAgent); +var fnToStringCoerces; +try { + Function.prototype.toString.call(v.uncoercibleFnObject); + fnToStringCoerces = true; +} catch (e) { + fnToStringCoerces = false; +} + +var noop = function () {}; +var classFake = function classFake() { }; // eslint-disable-line func-name-matching +var returnClass = function () { return ' class '; }; +var return3 = function () { return 3; }; +/* for coverage */ +noop(); +classFake(); +returnClass(); +return3(); +/* end for coverage */ + +var proxy; +if (typeof Proxy === 'function') { + try { + proxy = new Proxy(function () {}, {}); + // for coverage + proxy(); + String(proxy); + } catch (_) { + // Older engines throw a `TypeError` when `Function.prototype.toString` is called on a Proxy object. + proxy = null; + } +} + +var invokeFunction = function invokeFunctionString(str) { + var result; + try { + /* eslint-disable no-new-func */ + var fn = Function(str); + /* eslint-enable no-new-func */ + result = fn(); + } catch (e) {} + return result; +}; + +var classConstructor = invokeFunction('"use strict"; return class Foo {}'); +var hasDetectableClasses = classConstructor && Function.prototype.toString.call(classConstructor) === 'class Foo {}'; + +var commentedClass = invokeFunction('"use strict"; return class/*kkk*/\n//blah\n Bar\n//blah\n {}'); +var commentedClassOneLine = invokeFunction('"use strict"; return class/**/A{}'); +var classAnonymous = invokeFunction('"use strict"; return class{}'); +var classAnonymousCommentedOneLine = invokeFunction('"use strict"; return class/*/*/{}'); + +test('not callables', function (t) { + t.notOk(isCallable(), 'implicit undefined is not callable'); + + forEach(v.nonFunctions.concat([ + Object(42), + Object('foo'), + NaN, + [], + /a/g, + new RegExp('a', 'g'), + new Date() + ]), function (nonFunction) { + if (fnToStringCoerces && nonFunction === v.coercibleFnObject) { + t.comment('FF 3.6 has a Function toString that coerces its receiver, so this test is skipped'); + return; + } + if (nonFunction != null) { // eslint-disable-line eqeqeq + if (isFirefox) { + // Firefox 3 throws some kind of *object* here instead of a proper error + t['throws']( + function () { Function.prototype.toString.call(nonFunction); }, + inspect(nonFunction) + ' can not be used with Function toString' + ); + } else { + t['throws']( + function () { Function.prototype.toString.call(nonFunction); }, + TypeError, + inspect(nonFunction) + ' can not be used with Function toString' + ); + } + } + t.equal(isCallable(nonFunction), false, inspect(nonFunction) + ' is not callable'); + }); + + t.test('non-function with function in its [[Prototype]] chain', function (st) { + var Foo = function Bar() {}; + Foo.prototype = noop; + st.equal(isCallable(Foo), true, 'sanity check: Foo is callable'); + st.equal(isCallable(new Foo()), false, 'instance of Foo is not callable'); + st.end(); + }); + + t.end(); +}); + +test('@@toStringTag', { skip: !hasToStringTag }, function (t) { + var fakeFunction = { + toString: function () { return String(return3); }, + valueOf: return3 + }; + fakeFunction[Symbol.toStringTag] = 'Function'; + t.equal(String(fakeFunction), String(return3)); + t.equal(Number(fakeFunction), return3()); + t.notOk(isCallable(fakeFunction), 'fake Function with @@toStringTag "Function" is not callable'); + t.end(); +}); + +test('Functions', function (t) { + t.ok(isCallable(noop), 'function is callable'); + t.ok(isCallable(classFake), 'function with name containing "class" is callable'); + t.ok(isCallable(returnClass), 'function with string " class " is callable'); + t.ok(isCallable(isCallable), 'isCallable is callable'); + t.end(); +}); + +test('Typed Arrays', { skip: typedArrayNames.length === 0 }, function (st) { + forEach(typedArrayNames, function (typedArray) { + st.ok(isCallable(global[typedArray]), typedArray + ' is callable'); + }); + st.end(); +}); + +test('Generators', { skip: generators.length === 0 }, function (t) { + forEach(generators, function (genFn) { + t.ok(isCallable(genFn), 'generator function ' + genFn + ' is callable'); + }); + t.end(); +}); + +test('Arrow functions', { skip: arrows.length === 0 }, function (t) { + forEach(arrows, function (arrowFn) { + t.ok(isCallable(arrowFn), 'arrow function ' + arrowFn + ' is callable'); + }); + t.ok(isCallable(weirdlyCommentedArrowFn), 'weirdly commented arrow functions are callable'); + t.end(); +}); + +test('"Class" constructors', { + skip: !classConstructor || !commentedClass || !commentedClassOneLine || !classAnonymous, todo: !hasDetectableClasses +}, function (t) { + if (!hasDetectableClasses) { + t.comment('WARNING: This engine does not support detectable classes'); + } + t.notOk(isCallable(classConstructor), 'class constructors are not callable'); + t.notOk(isCallable(commentedClass), 'class constructors with comments in the signature are not callable'); + t.notOk(isCallable(commentedClassOneLine), 'one-line class constructors with comments in the signature are not callable'); + t.notOk(isCallable(classAnonymous), 'anonymous class constructors are not callable'); + t.notOk(isCallable(classAnonymousCommentedOneLine), 'anonymous one-line class constructors with comments in the signature are not callable'); + t.end(); +}); + +test('`async function`s', { skip: asyncs.length === 0 }, function (t) { + forEach(asyncs, function (asyncFn) { + t.ok(isCallable(asyncFn), '`async function` ' + asyncFn + ' is callable'); + }); + t.end(); +}); + +test('proxies of functions', { skip: !proxy }, function (t) { + t.equal(isCallable(proxy), true, 'proxies of functions are callable'); + t.end(); +}); + +test('throwing functions', function (t) { + t.plan(1); + + var thrower = function (a) { return a.b; }; + t.ok(isCallable(thrower), 'a function that throws is callable'); +}); + +test('DOM', function (t) { + /* eslint-env browser */ + + t.test('document.all', { skip: typeof document !== 'object' }, function (st) { + st.notOk(isCallable(document), 'document is not callable'); + + var all = document.all; + var isFF3 = !isIE68 && Object.prototype.toString(all) === Object.prototype.toString.call(document.all); // this test is true in IE 6-8 also + var expected = false; + if (!isFF3) { + try { + expected = document.all('') == null; // eslint-disable-line eqeqeq + } catch (e) { /**/ } + } + st.equal(isCallable(document.all), expected, 'document.all is ' + (isFF3 ? 'not ' : '') + 'callable'); + + st.end(); + }); + + forEach([ + 'HTMLElement', + 'HTMLAnchorElement' + ], function (name) { + var constructor = global[name]; + + t.test(name, { skip: !constructor }, function (st) { + st.match(typeof constructor, /^(?:function|object)$/, name + ' is a function or object'); + + var callable = isCallable(constructor); + st.equal(typeof callable, 'boolean'); + + if (callable) { + st.doesNotThrow( + function () { Function.prototype.toString.call(constructor); }, + 'anything this library claims is callable should be accepted by Function toString' + ); + } else { + st['throws']( + function () { Function.prototype.toString.call(constructor); }, + TypeError, + 'anything this library claims is not callable should not be accepted by Function toString' + ); + } + + st.end(); + }); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.editorconfig b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.editorconfig new file mode 100644 index 00000000..bc228f82 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.eslintrc b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.eslintrc new file mode 100644 index 00000000..34a62620 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "globals": { + "globalThis": false + }, + + "rules": { + "max-statements-per-line": [2, { "max": 2 }] + }, +} diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.github/FUNDING.yml b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.github/FUNDING.yml new file mode 100644 index 00000000..7dd24b96 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/is-typed-array +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.nycrc b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/CHANGELOG.md b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/CHANGELOG.md new file mode 100644 index 00000000..a2f6fb35 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/CHANGELOG.md @@ -0,0 +1,166 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.15](https://github.com/inspect-js/is-typed-array/compare/v1.1.14...v1.1.15) - 2024-12-18 + +### Commits + +- [types] improve types [`d934b49`](https://github.com/inspect-js/is-typed-array/commit/d934b49f7a16d5e20ba437a795b887f1f71ef240) +- [Dev Deps] update `@types/tape` [`da26511`](https://github.com/inspect-js/is-typed-array/commit/da26511ad7515c50fdc720701d5735b0d8a40800) + +## [v1.1.14](https://github.com/inspect-js/is-typed-array/compare/v1.1.13...v1.1.14) - 2024-12-17 + +### Commits + +- [types] use shared config [`eafa7fa`](https://github.com/inspect-js/is-typed-array/commit/eafa7fad2fc8d464a68e218d39a7eab782d9ce76) +- [actions] split out node 10-20, and 20+ [`cd6d5a3`](https://github.com/inspect-js/is-typed-array/commit/cd6d5a3283a1e65cf5885e57daede65a5176fd91) +- [types] use `which-typed-array`’s `TypedArray` type; re-export it [`d7d9fcd`](https://github.com/inspect-js/is-typed-array/commit/d7d9fcd75d538b7f8146dcd9faca5142534a3d45) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/node`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `object-inspect`, `tape` [`65afb42`](https://github.com/inspect-js/is-typed-array/commit/65afb4263ff4f4ee4ee51b284dc7519ce969a666) +- [Dev Deps] update `@types/node`, `has-tostringtag`, `tape` [`9e27ddd`](https://github.com/inspect-js/is-typed-array/commit/9e27ddd62a51ebae46781de0adbd8871341c633c) +- [Tests] replace `aud` with `npm audit` [`ad4defe`](https://github.com/inspect-js/is-typed-array/commit/ad4defe211c77d42b880d13faf7737b8f1adaf13) +- [Tests] use `@arethetypeswrong/cli` [`ac4bcca`](https://github.com/inspect-js/is-typed-array/commit/ac4bcca4ee2215662e79aa21681756984bb0b6d1) +- [Deps] update `which-typed-array` [`c298129`](https://github.com/inspect-js/is-typed-array/commit/c2981299c09cd64d89bf1e496447c0379b45d03a) +- [Deps] update `which-typed-array` [`744c29a`](https://github.com/inspect-js/is-typed-array/commit/744c29aa8d4f9df360082074f7b4f2f0d42d76e5) +- [Dev Deps] add missing peer dep [`94d2f5a`](https://github.com/inspect-js/is-typed-array/commit/94d2f5a11016516823e8d943e0bfc7b29dcb146d) + +## [v1.1.13](https://github.com/inspect-js/is-typed-array/compare/v1.1.12...v1.1.13) - 2024-02-01 + +### Commits + +- [patch] add types [`8a8a679`](https://github.com/inspect-js/is-typed-array/commit/8a8a679937d1c4b970c98556460cef2b7fa0bffb) +- [Dev Deps] update `aud`, `has-tostringtag`, `npmignore`, `object-inspect`, `tape` [`8146b60`](https://github.com/inspect-js/is-typed-array/commit/8146b6019a24f502e66e2c224ce5bea8df9f39bc) +- [actions] optimize finishers [`34f875a`](https://github.com/inspect-js/is-typed-array/commit/34f875ace16c4900d6b0ef4688e9e3eb7d502715) +- [Deps] update `which-typed-array` [`19c974f`](https://github.com/inspect-js/is-typed-array/commit/19c974f4bbd93ffc45cb8638b86688bc00f1420b) +- [meta] add `sideEffects` flag [`0b68e5e`](https://github.com/inspect-js/is-typed-array/commit/0b68e5e58684b79110a82a0a51df8beb7574d6a2) + +## [v1.1.12](https://github.com/inspect-js/is-typed-array/compare/v1.1.11...v1.1.12) - 2023-07-17 + +### Commits + +- [Refactor] use `which-typed-array` for all internals [`7619405`](https://github.com/inspect-js/is-typed-array/commit/761940532de595f6721fed101b02814dcfa7fe4e) + +## [v1.1.11](https://github.com/inspect-js/is-typed-array/compare/v1.1.10...v1.1.11) - 2023-07-17 + +### Commits + +- [Fix] `node < v0.6` lacks proper Object toString behavior [`c94b90d`](https://github.com/inspect-js/is-typed-array/commit/c94b90dc6bc457783d6f8cc208415a49da0933b7) +- [Robustness] use `call-bind` [`573b00b`](https://github.com/inspect-js/is-typed-array/commit/573b00b8deec42ac1ac262415e442ea0b7e1c96b) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`c88c2d4`](https://github.com/inspect-js/is-typed-array/commit/c88c2d479976110478fa4038fe8921251c06a163) + +## [v1.1.10](https://github.com/inspect-js/is-typed-array/compare/v1.1.9...v1.1.10) - 2022-11-02 + +### Commits + +- [meta] add `auto-changelog` [`cf6d86b`](https://github.com/inspect-js/is-typed-array/commit/cf6d86bf2f693eca357439d4d12e76d641f91f92) +- [actions] update rebase action to use reusable workflow [`8da51a5`](https://github.com/inspect-js/is-typed-array/commit/8da51a5dce6d2442ae31ccbc2be136f2e04d6bef) +- [Dev Deps] update `aud`, `is-callable`, `object-inspect`, `tape` [`554e3de`](https://github.com/inspect-js/is-typed-array/commit/554e3deec59dec926d0badc628e589ab363e465b) +- [Refactor] use `gopd` instead of an `es-abstract` helper` [`cdaa465`](https://github.com/inspect-js/is-typed-array/commit/cdaa465d5f94bfc9e32475e31209e1c2458a9603) +- [Deps] update `es-abstract` [`677ae4b`](https://github.com/inspect-js/is-typed-array/commit/677ae4b3c8323b59d6650a9254ab945045c33f79) + + + +1.1.9 / 2022-05-13 +================= + * [Refactor] use `foreach` instead of `for-each` + * [readme] markdown URL cleanup + * [Deps] update `es-abstract` + * [meta] use `npmignore` to autogenerate an npmignore file + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `safe-publish-latest`, `tape` + * [actions] reuse common workflows + * [actions] update codecov uploader + +1.1.8 / 2021-08-30 +================= + * [Refactor] use `globalThis` if available (#53) + * [Deps] update `available-typed-arrays` + * [Dev Deps] update `@ljharb/eslint-config` + +1.1.7 / 2021-08-07 +================= + * [Fix] if Symbol.toStringTag exists but is not present, use Object.prototype.toString + * [Dev Deps] update `is-callable`, `tape` + +1.1.6 / 2021-08-05 +================= + * [Fix] use `has-tostringtag` to behave correctly in the presence of symbol shams + * [readme] add actions and codecov badges + * [meta] use `prepublishOnly` script for npm 7+ + * [Deps] update `available-typed-arrays`, `es-abstract` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` + * [actions] use `node/install` instead of `node/run`; use `codecov` action + +1.1.5 / 2021-02-14 +================= + * [meta] do not publish github action workflow files or nyc output + * [Deps] update `call-bind`, `es-abstract` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `is-callable`, `tape` + +1.1.4 / 2020-12-05 +================= + * [readme] fix repo URLs, remove defunct badges + * [Deps] update `available-typed-arrays`, `es-abstract`; use `call-bind` where applicable + * [meta] gitignore nyc output + * [meta] only audit prod deps + * [actions] add "Allow Edits" workflow + * [actions] switch Automatic Rebase workflow to `pull_request_target` event + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `is-callable`, `make-arrow-function`, `make-generator-function`, `object-inspect`, `tape`; add `aud` + * [Tests] migrate tests to Github Actions + * [Tests] run `nyc` on all tests + +1.1.3 / 2020-01-24 +================= + * [Refactor] use `es-abstract`’s `callBound`, `available-typed-arrays`, `has-symbols` + +1.1.2 / 2020-01-20 +================= + * [Fix] in envs without Symbol.toStringTag, dc8a8cc made arrays return `true` + * [Tests] add `evalmd` to `prelint` + +1.1.1 / 2020-01-18 +================= + * [Robustness] don’t rely on Array.prototype.indexOf existing + * [meta] remove unused Makefile and associated utilities + * [meta] add `funding` field; create FUNDING.yml + * [actions] add automatic rebasing / merge commit blocking + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `is-callable`, `replace`, `semver`, `tape`; add `safe-publish-latest` + * [Tests] use shared travis-ci configs + * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops + +1.1.0 / 2019-02-16 +================= + * [New] add `BigInt64Array` and `BigUint64Array` + * [Refactor] use an array instead of an object for storing Typed Array names + * [meta] ignore `test.html` + * [Tests] up to `node` `v11.10`, `v10.15`, `v8.15`, `v7.10`, `v6.16`, `v5.10`, `v4.9` + * [Tests] remove `jscs` + * [Tests] use `npm audit` instead of `nsp` + * [Dev Deps] update `eslint`,` @ljharb/eslint-config`, `is-callable`, `tape`, `replace`, `semver` + * [Dev Deps] remove unused eccheck script + dep + +1.0.4 / 2016-03-19 +================= + * [Fix] `Symbol.toStringTag` is on the super-`[[Prototype]]` of Float32Array, not the `[[Prototype]]` (#3) + * [Tests] up to `node` `v5.9`, `v4.4` + * [Tests] use pretest/posttest for linting/security + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `is-callable` + +1.0.3 / 2015-10-13 +================= + * [Deps] Add missing `foreach` dependency (#1) + +1.0.2 / 2015-10-05 +================= + * [Deps] Remove unneeded "isarray" dependency + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + +1.0.1 / 2015-10-02 +================= + * Rerelease: avoid instanceof and the constructor property; work cross-realm; work with Symbol.toStringTag. + +1.0.0 / 2015-05-06 +================= + * Initial release. diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/LICENSE b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/LICENSE new file mode 100644 index 00000000..b43df444 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/README.md b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/README.md new file mode 100644 index 00000000..50752572 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/README.md @@ -0,0 +1,70 @@ +# is-typed-array [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and despite ES6 Symbol.toStringTag. + +## Example + +```js +var isTypedArray = require('is-typed-array'); +var assert = require('assert'); + +assert.equal(false, isTypedArray(undefined)); +assert.equal(false, isTypedArray(null)); +assert.equal(false, isTypedArray(false)); +assert.equal(false, isTypedArray(true)); +assert.equal(false, isTypedArray([])); +assert.equal(false, isTypedArray({})); +assert.equal(false, isTypedArray(/a/g)); +assert.equal(false, isTypedArray(new RegExp('a', 'g'))); +assert.equal(false, isTypedArray(new Date())); +assert.equal(false, isTypedArray(42)); +assert.equal(false, isTypedArray(NaN)); +assert.equal(false, isTypedArray(Infinity)); +assert.equal(false, isTypedArray(new Number(42))); +assert.equal(false, isTypedArray('foo')); +assert.equal(false, isTypedArray(Object('foo'))); +assert.equal(false, isTypedArray(function () {})); +assert.equal(false, isTypedArray(function* () {})); +assert.equal(false, isTypedArray(x => x * x)); +assert.equal(false, isTypedArray([])); + +assert.ok(isTypedArray(new Int8Array())); +assert.ok(isTypedArray(new Uint8Array())); +assert.ok(isTypedArray(new Uint8ClampedArray())); +assert.ok(isTypedArray(new Int16Array())); +assert.ok(isTypedArray(new Uint16Array())); +assert.ok(isTypedArray(new Int32Array())); +assert.ok(isTypedArray(new Uint32Array())); +assert.ok(isTypedArray(new Float32Array())); +assert.ok(isTypedArray(new Float64Array())); +assert.ok(isTypedArray(new BigInt64Array())); +assert.ok(isTypedArray(new BigUint64Array())); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/is-typed-array +[npm-version-svg]: https://versionbadg.es/inspect-js/is-typed-array.svg +[deps-svg]: https://david-dm.org/inspect-js/is-typed-array.svg +[deps-url]: https://david-dm.org/inspect-js/is-typed-array +[dev-deps-svg]: https://david-dm.org/inspect-js/is-typed-array/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/is-typed-array#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/is-typed-array.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/is-typed-array.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/is-typed-array.svg +[downloads-url]: https://npm-stat.com/charts.html?package=is-typed-array +[codecov-image]: https://codecov.io/gh/inspect-js/is-typed-array/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/is-typed-array/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-typed-array +[actions-url]: https://github.com/inspect-js/is-typed-array/actions diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.d.ts b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.d.ts new file mode 100644 index 00000000..73bcf35a --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.d.ts @@ -0,0 +1,9 @@ +import type { TypedArray } from 'which-typed-array'; + +declare namespace isTypedArray { + export { TypedArray }; +} + +declare function isTypedArray(value: unknown): value is isTypedArray.TypedArray; + +export = isTypedArray; diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js new file mode 100644 index 00000000..6e38c535 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var whichTypedArray = require('which-typed-array'); + +/** @type {import('.')} */ +module.exports = function isTypedArray(value) { + return !!whichTypedArray(value); +}; diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/package.json b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/package.json new file mode 100644 index 00000000..a8b1e772 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/package.json @@ -0,0 +1,129 @@ +{ + "name": "is-typed-array", + "version": "1.1.15", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "description": "Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and despite ES6 Symbol.toStringTag.", + "license": "MIT", + "main": "index.js", + "types": "./index.d.ts", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run --silent lint", + "test": "npm run tests-only && npm run test:harmony", + "tests-only": "nyc tape test", + "test:harmony": "nyc node --harmony --es-staging test", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/is-typed-array.git" + }, + "keywords": [ + "array", + "TypedArray", + "typed array", + "is", + "typed", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "ES6", + "toStringTag", + "Symbol.toStringTag", + "@@toStringTag" + ], + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/for-each": "^0.3.3", + "@types/is-callable": "^1.1.2", + "@types/make-arrow-function": "^1.2.2", + "@types/make-generator-function": "^2.0.3", + "@types/node": "^20.17.10", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "has-tostringtag": "^1.0.2", + "in-publish": "^2.0.1", + "is-callable": "^1.2.7", + "make-arrow-function": "^1.2.0", + "make-generator-function": "^2.0.0", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true, + "startingVersion": "1.1.10" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/test/index.js b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/test/index.js new file mode 100644 index 00000000..c96e3976 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/test/index.js @@ -0,0 +1,111 @@ +'use strict'; + +var test = require('tape'); +var isTypedArray = require('../'); +var isCallable = require('is-callable'); +var hasToStringTag = require('has-tostringtag/shams')(); +var generators = require('make-generator-function')(); +var arrowFn = require('make-arrow-function')(); +var forEach = require('for-each'); +var inspect = require('object-inspect'); + +var typedArrayNames = [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' +]; + +test('not arrays', function (t) { + t.test('non-number/string primitives', function (st) { + // @ts-expect-error Expected 1 arguments, but got 0.ts(2554) + st.notOk(isTypedArray(), 'undefined is not typed array'); + st.notOk(isTypedArray(null), 'null is not typed array'); + st.notOk(isTypedArray(false), 'false is not typed array'); + st.notOk(isTypedArray(true), 'true is not typed array'); + st.end(); + }); + + t.notOk(isTypedArray({}), 'object is not typed array'); + t.notOk(isTypedArray(/a/g), 'regex literal is not typed array'); + t.notOk(isTypedArray(new RegExp('a', 'g')), 'regex object is not typed array'); + t.notOk(isTypedArray(new Date()), 'new Date() is not typed array'); + + t.test('numbers', function (st) { + st.notOk(isTypedArray(42), 'number is not typed array'); + st.notOk(isTypedArray(Object(42)), 'number object is not typed array'); + st.notOk(isTypedArray(NaN), 'NaN is not typed array'); + st.notOk(isTypedArray(Infinity), 'Infinity is not typed array'); + st.end(); + }); + + t.test('strings', function (st) { + st.notOk(isTypedArray('foo'), 'string primitive is not typed array'); + st.notOk(isTypedArray(Object('foo')), 'string object is not typed array'); + st.end(); + }); + + t.end(); +}); + +test('Functions', function (t) { + t.notOk(isTypedArray(function () {}), 'function is not typed array'); + t.end(); +}); + +test('Generators', { skip: generators.length === 0 }, function (t) { + forEach(generators, function (genFn) { + t.notOk(isTypedArray(genFn), 'generator function ' + inspect(genFn) + ' is not typed array'); + }); + t.end(); +}); + +test('Arrow functions', { skip: !arrowFn }, function (t) { + t.notOk(isTypedArray(arrowFn), 'arrow function is not typed array'); + t.end(); +}); + +test('@@toStringTag', { skip: !hasToStringTag }, function (t) { + forEach(typedArrayNames, function (typedArray) { + // @ts-expect-error + if (typeof global[typedArray] === 'function') { + // @ts-expect-error + var fakeTypedArray = []; + // @ts-expect-error + fakeTypedArray[Symbol.toStringTag] = typedArray; + // @ts-expect-error + t.notOk(isTypedArray(fakeTypedArray), 'faked ' + typedArray + ' is not typed array'); + } else { + t.comment('# SKIP ' + typedArray + ' is not supported'); + } + }); + t.end(); +}); + +test('non-Typed Arrays', function (t) { + t.notOk(isTypedArray([]), '[] is not typed array'); + t.end(); +}); + +/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor | BigUint64ArrayConstructor} TypedArrayConstructor */ + +test('Typed Arrays', function (t) { + forEach(typedArrayNames, function (typedArray) { + // @ts-expect-error + /** @type {TypedArrayConstructor} */ var TypedArray = global[typedArray]; + if (isCallable(TypedArray)) { + var arr = new TypedArray(10); + t.ok(isTypedArray(arr), 'new ' + typedArray + '(10) is typed array'); + } else { + t.comment('# SKIP ' + typedArray + ' is not supported'); + } + }); + t.end(); +}); diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/tsconfig.json b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/tsconfig.json new file mode 100644 index 00000000..ac228e22 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "@ljharb/tsconfig", + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/which-typed-array b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/which-typed-array new file mode 120000 index 00000000..dda5a241 --- /dev/null +++ b/backend/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/which-typed-array @@ -0,0 +1 @@ +../../which-typed-array@1.1.24/node_modules/which-typed-array \ No newline at end of file diff --git a/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/LICENSE b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/LICENSE new file mode 100644 index 00000000..de322667 --- /dev/null +++ b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/README.md b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/README.md new file mode 100644 index 00000000..3e160b2b --- /dev/null +++ b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/README.md @@ -0,0 +1,38 @@ + +# isarray + +`Array#isArray` for older browsers and deprecated Node.js versions. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +__Just use Array.isArray directly__, unless you need to support those older versions. + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](https://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/node-browserify). + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! diff --git a/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js new file mode 100644 index 00000000..a57f6349 --- /dev/null +++ b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/package.json b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/package.json new file mode 100644 index 00000000..fb0e89be --- /dev/null +++ b/backend/node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/package.json @@ -0,0 +1,48 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "2.0.5", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "files": [ + "index.js" + ], + "dependencies": {}, + "devDependencies": { + "tape": "~2.13.4" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "scripts": { + "test": "tape test.js" + } +} diff --git a/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/CHANGELOG.md b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/CHANGELOG.md new file mode 100644 index 00000000..c04797bf --- /dev/null +++ b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/CHANGELOG.md @@ -0,0 +1,850 @@ +# Changelog + + +## 3.4.0 (2026-08-19) + +* feat: filter hooks per call in createWrapper via getOptions #46 #44 #43 + + +## 3.3.0 (2026-04-14) + +* perf: avoid cloning args on every pre/post #45 + + +## 3.2.0 (2026-01-29) + +* feat(exec): add filter option to execPreSync and execPostSync #44 + + +## 3.1.0 (2026-01-12) + +* feat(exec): add filter option to allow executing hooks based on a filter function #43 + + +## 3.0.0 (2025-11-18) + +* BREAKING CHANGE: make execPre async and drop callback support #39 +* BREAKING CHANGE: require Node 18 +* feat: overwriteArguments support #42 + + +## 2.6.0 (2024-03-04) + +* feat: add TypeScript types + + +## 2.5.1 (2023-01-06) + +* fix: avoid passing final callback to pre hook, because calling the callback can mess up hook execution #36 Automattic/mongoose#12836 + + +## 2.5.0 (2022-12-01) + +* feat: add errorHandler option to `post()` #34 + + +## 2.4.0 (2022-06-13) + +* feat: add `overwriteResult()` and `skipWrappedFunction()` for more advanced control flow + + +## 2.3.4 (2022-02-10) + +* perf: various performance improvements #27 #24 #23 #22 #21 #20 + + +## 2.3.3 (2021-12-26) + +* fix: handle sync errors in `wrap()` + + +## 2.3.2 (2020-12-08) + +* fix: handle sync errors in pre hooks if there are multiple hooks + + +## 2.3.0 (2018-09-24) + +* chore(release): 2.2.3 ([c8f2695](https://github.com/vkarpov15/kareem/commit/c8f2695)) +* chore(release): 2.2.4 ([a377a4f](https://github.com/vkarpov15/kareem/commit/a377a4f)) +* chore(release): 2.2.5 ([5a495e3](https://github.com/vkarpov15/kareem/commit/5a495e3)) +* fix(filter): copy async pres correctly with `filter()` ([1b1ed8a](https://github.com/vkarpov15/kareem/commit/1b1ed8a)), closes [Automattic/mongoose#3054](https://github.com/Automattic/mongoose/issues/3054) +* feat: add filter() function ([1f641f4](https://github.com/vkarpov15/kareem/commit/1f641f4)) +* feat: support storing options on pre and post hooks ([59220b9](https://github.com/vkarpov15/kareem/commit/59220b9)) + + + + +## 2.2.3 (2018-09-10) + +* chore: release 2.2.3 ([af653a3](https://github.com/vkarpov15/kareem/commit/af653a3)) + + + + +## 2.2.2 (2018-09-10) + +* chore: release 2.2.2 ([3f0144d](https://github.com/vkarpov15/kareem/commit/3f0144d)) +* fix: allow merge() to not clone ([e628d65](https://github.com/vkarpov15/kareem/commit/e628d65)) + + + + +## 2.2.1 (2018-06-05) + +* chore: release 2.2.1 ([4625a64](https://github.com/vkarpov15/kareem/commit/4625a64)) +* chore: remove lockfile from git ([7f3e4e6](https://github.com/vkarpov15/kareem/commit/7f3e4e6)) +* fix: handle numAsync correctly when merging ([fef8e7e](https://github.com/vkarpov15/kareem/commit/fef8e7e)) +* test: repro issue with not copying numAsync ([952d9db](https://github.com/vkarpov15/kareem/commit/952d9db)) + + + + +## 2.2.0 (2018-06-05) + +* chore: release 2.2.0 ([ff9ad03](https://github.com/vkarpov15/kareem/commit/ff9ad03)) +* fix: use maps instead of objects for _pres and _posts so `toString()` doesn't get reported as having ([55df303](https://github.com/vkarpov15/kareem/commit/55df303)), closes [Automattic/mongoose#6538](https://github.com/Automattic/mongoose/issues/6538) + + + + +## 2.1.0 (2018-05-16) + +* chore: release 2.1.0 ([ba5f1bc](https://github.com/vkarpov15/kareem/commit/ba5f1bc)) +* feat: add option to check wrapped function return value for promises ([c9d7dd1](https://github.com/vkarpov15/kareem/commit/c9d7dd1)) +* refactor: use const in wrap() ([0fc21f9](https://github.com/vkarpov15/kareem/commit/0fc21f9)) + + + + +## 2.0.7 (2018-04-28) + +* chore: release 2.0.7 ([0bf91e6](https://github.com/vkarpov15/kareem/commit/0bf91e6)) +* feat: add `hasHooks()` ([225f18d](https://github.com/vkarpov15/kareem/commit/225f18d)), closes [Automattic/mongoose#6385](https://github.com/Automattic/mongoose/issues/6385) + + + + +## 2.0.6 (2018-03-22) + +* chore: release 2.0.6 ([f3d406b](https://github.com/vkarpov15/kareem/commit/f3d406b)) +* fix(wrap): ensure fast path still wraps function in `nextTick()` for chaining ([7000494](https://github.com/vkarpov15/kareem/commit/7000494)), closes [Automattic/mongoose#6250](https://github.com/Automattic/mongoose/issues/6250) [dsanel/mongoose-delete#36](https://github.com/dsanel/mongoose-delete/issues/36) + + + + +## 2.0.5 (2018-02-22) + +* chore: release 2.0.5 ([3286612](https://github.com/vkarpov15/kareem/commit/3286612)) +* perf(createWrapper): don't create wrapper if there are no hooks ([5afc5b9](https://github.com/vkarpov15/kareem/commit/5afc5b9)), closes [Automattic/mongoose#6126](https://github.com/Automattic/mongoose/issues/6126) + + + + +## 2.0.4 (2018-02-08) + +* chore: release 2.0.4 ([2ab0293](https://github.com/vkarpov15/kareem/commit/2ab0293)) + + + + +## 2.0.3 (2018-02-01) + +* chore: release 2.0.3 ([3c1abe5](https://github.com/vkarpov15/kareem/commit/3c1abe5)) +* fix: use process.nextTick() re: Automattic/mongoose#6074 ([e5bfe33](https://github.com/vkarpov15/kareem/commit/e5bfe33)), closes [Automattic/mongoose#6074](https://github.com/Automattic/mongoose/issues/6074) + + + + +## 2.0.2 (2018-01-24) + +* chore: fix license ([a9d755c](https://github.com/vkarpov15/kareem/commit/a9d755c)), closes [#10](https://github.com/vkarpov15/kareem/issues/10) +* chore: release 2.0.2 ([fe87ab6](https://github.com/vkarpov15/kareem/commit/fe87ab6)) + + + + +## 2.0.1 (2018-01-09) + +* chore: release 2.0.1 with lockfile bump ([09c44fb](https://github.com/vkarpov15/kareem/commit/09c44fb)) + + + + +## 2.0.0 (2018-01-09) + +* chore: bump marked re: security ([cc564a9](https://github.com/vkarpov15/kareem/commit/cc564a9)) +* chore: release 2.0.0 ([f511d1c](https://github.com/vkarpov15/kareem/commit/f511d1c)) + + + + +## 2.0.0-rc5 (2017-12-23) + +* chore: fix build on node 4+5 ([6dac5a4](https://github.com/vkarpov15/kareem/commit/6dac5a4)) +* chore: fix built on node 4 + 5 again ([434ef0a](https://github.com/vkarpov15/kareem/commit/434ef0a)) +* chore: release 2.0.0-rc5 ([25a32ee](https://github.com/vkarpov15/kareem/commit/25a32ee)) + + + + +## 2.0.0-rc4 (2017-12-22) + +* chore: release 2.0.0-rc4 ([49fc083](https://github.com/vkarpov15/kareem/commit/49fc083)) +* BREAKING CHANGE: deduplicate when merging hooks re: Automattic/mongoose#2945 ([d458573](https://github.com/vkarpov15/kareem/commit/d458573)), closes [Automattic/mongoose#2945](https://github.com/Automattic/mongoose/issues/2945) + + + + +## 2.0.0-rc3 (2017-12-22) + +* chore: release 2.0.0-rc3 ([adaaa00](https://github.com/vkarpov15/kareem/commit/adaaa00)) +* feat: support returning promises from middleware functions ([05b4480](https://github.com/vkarpov15/kareem/commit/05b4480)), closes [Automattic/mongoose#3779](https://github.com/Automattic/mongoose/issues/3779) + + + + +## 2.0.0-rc2 (2017-12-21) + +* chore: release 2.0.0-rc2 ([76325fa](https://github.com/vkarpov15/kareem/commit/76325fa)) +* fix: ensure next() and done() run in next tick ([6c20684](https://github.com/vkarpov15/kareem/commit/6c20684)) + + + + +## 2.0.0-rc1 (2017-12-21) + +* chore: improve test coverage re: Automattic/mongoose#3232 ([7b45cf0](https://github.com/vkarpov15/kareem/commit/7b45cf0)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) +* chore: release 2.0.0-rc1 ([9b83f52](https://github.com/vkarpov15/kareem/commit/9b83f52)) +* BREAKING CHANGE: report sync exceptions as errors, only allow calling next() and done() once ([674adcc](https://github.com/vkarpov15/kareem/commit/674adcc)), closes [Automattic/mongoose#3483](https://github.com/Automattic/mongoose/issues/3483) + + + + +## 2.0.0-rc0 (2017-12-17) + +* chore: release 2.0.0-rc0 ([16b44b5](https://github.com/vkarpov15/kareem/commit/16b44b5)) +* BREAKING CHANGE: drop support for node < 4 ([9cbb8c7](https://github.com/vkarpov15/kareem/commit/9cbb8c7)) +* BREAKING CHANGE: remove useLegacyPost and add several new features ([6dd8531](https://github.com/vkarpov15/kareem/commit/6dd8531)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) + + + + +## 1.5.0 (2017-07-20) + +* chore: release 1.5.0 ([9c491a0](https://github.com/vkarpov15/kareem/commit/9c491a0)) +* fix: improve post error handlers results ([9928dd5](https://github.com/vkarpov15/kareem/commit/9928dd5)), closes [Automattic/mongoose#5466](https://github.com/Automattic/mongoose/issues/5466) + + + + +## 1.4.2 (2017-07-06) + +* chore: release 1.4.2 ([8d14ac5](https://github.com/vkarpov15/kareem/commit/8d14ac5)) +* fix: correct args re: Automattic/mongoose#5405 ([3f28ae6](https://github.com/vkarpov15/kareem/commit/3f28ae6)), closes [Automattic/mongoose#5405](https://github.com/Automattic/mongoose/issues/5405) + + + + +## 1.4.1 (2017-04-25) + +* chore: release 1.4.1 ([5ecf0c2](https://github.com/vkarpov15/kareem/commit/5ecf0c2)) +* fix: handle numAsyncPres with clone() ([c72e857](https://github.com/vkarpov15/kareem/commit/c72e857)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) +* test: repro #8 ([9b4d6b2](https://github.com/vkarpov15/kareem/commit/9b4d6b2)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) + + + + +## 1.4.0 (2017-04-19) + +* chore: release 1.4.0 ([101c5f5](https://github.com/vkarpov15/kareem/commit/101c5f5)) +* feat: add merge() function ([285325e](https://github.com/vkarpov15/kareem/commit/285325e)) + + + + +## 1.3.0 (2017-03-26) + +* chore: release 1.3.0 ([f3a9e50](https://github.com/vkarpov15/kareem/commit/f3a9e50)) +* feat: pass function args to execPre ([4dd466d](https://github.com/vkarpov15/kareem/commit/4dd466d)) + + + + +## 1.2.1 (2017-02-03) + +* chore: release 1.2.1 ([d97081f](https://github.com/vkarpov15/kareem/commit/d97081f)) +* fix: filter out _kareemIgnored args for error handlers re: Automattic/mongoose#4925 ([ddc7aeb](https://github.com/vkarpov15/kareem/commit/ddc7aeb)), closes [Automattic/mongoose#4925](https://github.com/Automattic/mongoose/issues/4925) +* fix: make error handlers handle errors in pre hooks ([af38033](https://github.com/vkarpov15/kareem/commit/af38033)), closes [Automattic/mongoose#4927](https://github.com/Automattic/mongoose/issues/4927) + + + + +## 1.2.0 (2017-01-02) + +* chore: release 1.2.0 ([033225c](https://github.com/vkarpov15/kareem/commit/033225c)) +* chore: upgrade deps ([f9e9a09](https://github.com/vkarpov15/kareem/commit/f9e9a09)) +* feat: add _kareemIgnore re: Automattic/mongoose#4836 ([7957771](https://github.com/vkarpov15/kareem/commit/7957771)), closes [Automattic/mongoose#4836](https://github.com/Automattic/mongoose/issues/4836) + + + + +## 1.1.5 (2016-12-13) + +* chore: release 1.1.5 ([1a9f684](https://github.com/vkarpov15/kareem/commit/1a9f684)) +* fix: correct field name ([04a0e9d](https://github.com/vkarpov15/kareem/commit/04a0e9d)) + + + + +## 1.1.4 (2016-12-09) + +* chore: release 1.1.4 ([ece401c](https://github.com/vkarpov15/kareem/commit/ece401c)) +* chore: run tests on node 6 ([e0cb1cb](https://github.com/vkarpov15/kareem/commit/e0cb1cb)) +* fix: only copy own properties in clone() ([dfe28ce](https://github.com/vkarpov15/kareem/commit/dfe28ce)), closes [#7](https://github.com/vkarpov15/kareem/issues/7) + + + + +## 1.1.3 (2016-06-27) + +* chore: release 1.1.3 ([87171c8](https://github.com/vkarpov15/kareem/commit/87171c8)) +* fix: couple more issues with arg processing ([c65f523](https://github.com/vkarpov15/kareem/commit/c65f523)) + + + + +## 1.1.2 (2016-06-27) + +* chore: release 1.1.2 ([8e102b6](https://github.com/vkarpov15/kareem/commit/8e102b6)) +* fix: add early return ([4feda4e](https://github.com/vkarpov15/kareem/commit/4feda4e)) + + + + +## 1.1.1 (2016-06-27) + +* chore: release 1.1.1 ([8bb3050](https://github.com/vkarpov15/kareem/commit/8bb3050)) +* fix: skip error handlers if no error ([0eb3a44](https://github.com/vkarpov15/kareem/commit/0eb3a44)) + + + + +## 1.1.0 (2016-05-11) + +* chore: release 1.1.0 ([85332d9](https://github.com/vkarpov15/kareem/commit/85332d9)) +* chore: test on node 4 and node 5 ([1faefa1](https://github.com/vkarpov15/kareem/commit/1faefa1)) +* 100% coverage again ([c9aee4e](https://github.com/vkarpov15/kareem/commit/c9aee4e)) +* add support for error post hooks ([d378113](https://github.com/vkarpov15/kareem/commit/d378113)) +* basic setup for sync hooks #4 ([55aa081](https://github.com/vkarpov15/kareem/commit/55aa081)), closes [#4](https://github.com/vkarpov15/kareem/issues/4) +* proof of concept for error handlers ([e4a07d9](https://github.com/vkarpov15/kareem/commit/e4a07d9)) +* refactor out handleWrapError helper ([b19af38](https://github.com/vkarpov15/kareem/commit/b19af38)) + + + + +## 1.0.1 (2015-05-10) + +* Fix #1 ([de60dc6](https://github.com/vkarpov15/kareem/commit/de60dc6)), closes [#1](https://github.com/vkarpov15/kareem/issues/1) +* release 1.0.1 ([6971088](https://github.com/vkarpov15/kareem/commit/6971088)) +* Run tests on iojs in travis ([adcd201](https://github.com/vkarpov15/kareem/commit/adcd201)) +* support legacy post hook behavior in wrap() ([23fa74c](https://github.com/vkarpov15/kareem/commit/23fa74c)) +* Use node 0.12 in travis ([834689d](https://github.com/vkarpov15/kareem/commit/834689d)) + + + + +## 1.0.0 (2015-01-28) + +* Tag 1.0.0 ([4c5a35a](https://github.com/vkarpov15/kareem/commit/4c5a35a)) + + + + +## 0.0.8 (2015-01-27) + +* Add clone function ([688bba7](https://github.com/vkarpov15/kareem/commit/688bba7)) +* Add jscs for style checking ([5c93149](https://github.com/vkarpov15/kareem/commit/5c93149)) +* Bump 0.0.8 ([03c0d2f](https://github.com/vkarpov15/kareem/commit/03c0d2f)) +* Fix jscs config, add gulp rules ([9989abf](https://github.com/vkarpov15/kareem/commit/9989abf)) +* fix Makefile typo ([1f7e61a](https://github.com/vkarpov15/kareem/commit/1f7e61a)) + + + + +## 0.0.7 (2015-01-04) + +* Bump 0.0.7 ([98ef173](https://github.com/vkarpov15/kareem/commit/98ef173)) +* fix LearnBoost/mongoose#2553 - use null instead of undefined for err ([9157b48](https://github.com/vkarpov15/kareem/commit/9157b48)), closes [LearnBoost/mongoose#2553](https://github.com/LearnBoost/mongoose/issues/2553) +* Regenerate docs ([2331cdf](https://github.com/vkarpov15/kareem/commit/2331cdf)) + + + + +## 0.0.6 (2015-01-01) + +* Update docs and bump 0.0.6 ([92c12a7](https://github.com/vkarpov15/kareem/commit/92c12a7)) + + + + +## 0.0.5 (2015-01-01) + +* Add coverage rule to Makefile ([825a91c](https://github.com/vkarpov15/kareem/commit/825a91c)) +* Add coveralls to README ([fb52369](https://github.com/vkarpov15/kareem/commit/fb52369)) +* Add coveralls to travis ([93f6f15](https://github.com/vkarpov15/kareem/commit/93f6f15)) +* Add createWrapper() function ([ea77741](https://github.com/vkarpov15/kareem/commit/ea77741)) +* Add istanbul code coverage ([6eceeef](https://github.com/vkarpov15/kareem/commit/6eceeef)) +* Add some more comments for examples ([c5b0c6f](https://github.com/vkarpov15/kareem/commit/c5b0c6f)) +* Add travis ([e6dcb06](https://github.com/vkarpov15/kareem/commit/e6dcb06)) +* Add travis badge to docs ([ad8c9b3](https://github.com/vkarpov15/kareem/commit/ad8c9b3)) +* Add wrap() tests, 100% coverage ([6945be4](https://github.com/vkarpov15/kareem/commit/6945be4)) +* Better test coverage for execPost ([d9ad539](https://github.com/vkarpov15/kareem/commit/d9ad539)) +* Bump 0.0.5 ([69875b1](https://github.com/vkarpov15/kareem/commit/69875b1)) +* Docs fix ([15b7098](https://github.com/vkarpov15/kareem/commit/15b7098)) +* Fix silly mistake in docs generation ([50373eb](https://github.com/vkarpov15/kareem/commit/50373eb)) +* Fix typo in readme ([fec4925](https://github.com/vkarpov15/kareem/commit/fec4925)) +* Linkify travis badge ([92b25fe](https://github.com/vkarpov15/kareem/commit/92b25fe)) +* Make travis run coverage ([747157b](https://github.com/vkarpov15/kareem/commit/747157b)) +* Move travis status badge ([d52e89b](https://github.com/vkarpov15/kareem/commit/d52e89b)) +* Quick fix for coverage ([50bbddb](https://github.com/vkarpov15/kareem/commit/50bbddb)) +* Typo fix ([adea794](https://github.com/vkarpov15/kareem/commit/adea794)) + + + + +## 0.0.4 (2014-12-13) + +* Bump 0.0.4, run docs generation ([51a15fe](https://github.com/vkarpov15/kareem/commit/51a15fe)) +* Use correct post parameters in wrap() ([9bb5da3](https://github.com/vkarpov15/kareem/commit/9bb5da3)) + + + + +## 0.0.3 (2014-12-12) + +* Add npm test script, fix small bug with args not getting passed through post ([49e3e68](https://github.com/vkarpov15/kareem/commit/49e3e68)) +* Bump 0.0.3 ([65621d8](https://github.com/vkarpov15/kareem/commit/65621d8)) +* Update readme ([901388b](https://github.com/vkarpov15/kareem/commit/901388b)) + + + + +## 0.0.2 (2014-12-12) + +* Add github repo and bump 0.0.2 ([59db8be](https://github.com/vkarpov15/kareem/commit/59db8be)) + + + + +## 0.0.1 (2014-12-12) + +* Add basic docs ([ad29ea4](https://github.com/vkarpov15/kareem/commit/ad29ea4)) +* Add pre hooks ([2ffc356](https://github.com/vkarpov15/kareem/commit/2ffc356)) +* Add wrap function ([68c540c](https://github.com/vkarpov15/kareem/commit/68c540c)) +* Bump to version 0.0.1 ([a4bfd68](https://github.com/vkarpov15/kareem/commit/a4bfd68)) +* Initial commit ([4002458](https://github.com/vkarpov15/kareem/commit/4002458)) +* Initial deposit ([98fc489](https://github.com/vkarpov15/kareem/commit/98fc489)) +* Post hooks ([395b67c](https://github.com/vkarpov15/kareem/commit/395b67c)) +* Some basic setup work ([82df75e](https://github.com/vkarpov15/kareem/commit/82df75e)) +* Support sync pre hooks ([1cc1b9f](https://github.com/vkarpov15/kareem/commit/1cc1b9f)) +* Update package.json description ([978da18](https://github.com/vkarpov15/kareem/commit/978da18)) + + + + +## 2.2.5 (2018-09-24) + + + + + +## 2.2.4 (2018-09-24) + + + + + +## 2.2.3 (2018-09-24) + +* fix(filter): copy async pres correctly with `filter()` ([1b1ed8a](https://github.com/vkarpov15/kareem/commit/1b1ed8a)), closes [Automattic/mongoose#3054](https://github.com/Automattic/mongoose/issues/3054) +* feat: add filter() function ([1f641f4](https://github.com/vkarpov15/kareem/commit/1f641f4)) +* feat: support storing options on pre and post hooks ([59220b9](https://github.com/vkarpov15/kareem/commit/59220b9)) + + + + +## 2.2.3 (2018-09-10) + +* chore: release 2.2.3 ([af653a3](https://github.com/vkarpov15/kareem/commit/af653a3)) + + + + +## 2.2.2 (2018-09-10) + +* chore: release 2.2.2 ([3f0144d](https://github.com/vkarpov15/kareem/commit/3f0144d)) +* fix: allow merge() to not clone ([e628d65](https://github.com/vkarpov15/kareem/commit/e628d65)) + + + + +## 2.2.1 (2018-06-05) + +* chore: release 2.2.1 ([4625a64](https://github.com/vkarpov15/kareem/commit/4625a64)) +* chore: remove lockfile from git ([7f3e4e6](https://github.com/vkarpov15/kareem/commit/7f3e4e6)) +* fix: handle numAsync correctly when merging ([fef8e7e](https://github.com/vkarpov15/kareem/commit/fef8e7e)) +* test: repro issue with not copying numAsync ([952d9db](https://github.com/vkarpov15/kareem/commit/952d9db)) + + + + +## 2.2.0 (2018-06-05) + +* chore: release 2.2.0 ([ff9ad03](https://github.com/vkarpov15/kareem/commit/ff9ad03)) +* fix: use maps instead of objects for _pres and _posts so `toString()` doesn't get reported as having ([55df303](https://github.com/vkarpov15/kareem/commit/55df303)), closes [Automattic/mongoose#6538](https://github.com/Automattic/mongoose/issues/6538) + + + + +## 2.1.0 (2018-05-16) + +* chore: release 2.1.0 ([ba5f1bc](https://github.com/vkarpov15/kareem/commit/ba5f1bc)) +* feat: add option to check wrapped function return value for promises ([c9d7dd1](https://github.com/vkarpov15/kareem/commit/c9d7dd1)) +* refactor: use const in wrap() ([0fc21f9](https://github.com/vkarpov15/kareem/commit/0fc21f9)) + + + + +## 2.0.7 (2018-04-28) + +* chore: release 2.0.7 ([0bf91e6](https://github.com/vkarpov15/kareem/commit/0bf91e6)) +* feat: add `hasHooks()` ([225f18d](https://github.com/vkarpov15/kareem/commit/225f18d)), closes [Automattic/mongoose#6385](https://github.com/Automattic/mongoose/issues/6385) + + + + +## 2.0.6 (2018-03-22) + +* chore: release 2.0.6 ([f3d406b](https://github.com/vkarpov15/kareem/commit/f3d406b)) +* fix(wrap): ensure fast path still wraps function in `nextTick()` for chaining ([7000494](https://github.com/vkarpov15/kareem/commit/7000494)), closes [Automattic/mongoose#6250](https://github.com/Automattic/mongoose/issues/6250) [dsanel/mongoose-delete#36](https://github.com/dsanel/mongoose-delete/issues/36) + + + + +## 2.0.5 (2018-02-22) + +* chore: release 2.0.5 ([3286612](https://github.com/vkarpov15/kareem/commit/3286612)) +* perf(createWrapper): don't create wrapper if there are no hooks ([5afc5b9](https://github.com/vkarpov15/kareem/commit/5afc5b9)), closes [Automattic/mongoose#6126](https://github.com/Automattic/mongoose/issues/6126) + + + + +## 2.0.4 (2018-02-08) + +* chore: release 2.0.4 ([2ab0293](https://github.com/vkarpov15/kareem/commit/2ab0293)) + + + + +## 2.0.3 (2018-02-01) + +* chore: release 2.0.3 ([3c1abe5](https://github.com/vkarpov15/kareem/commit/3c1abe5)) +* fix: use process.nextTick() re: Automattic/mongoose#6074 ([e5bfe33](https://github.com/vkarpov15/kareem/commit/e5bfe33)), closes [Automattic/mongoose#6074](https://github.com/Automattic/mongoose/issues/6074) + + + + +## 2.0.2 (2018-01-24) + +* chore: fix license ([a9d755c](https://github.com/vkarpov15/kareem/commit/a9d755c)), closes [#10](https://github.com/vkarpov15/kareem/issues/10) +* chore: release 2.0.2 ([fe87ab6](https://github.com/vkarpov15/kareem/commit/fe87ab6)) + + + + +## 2.0.1 (2018-01-09) + +* chore: release 2.0.1 with lockfile bump ([09c44fb](https://github.com/vkarpov15/kareem/commit/09c44fb)) + + + + +## 2.0.0 (2018-01-09) + +* chore: bump marked re: security ([cc564a9](https://github.com/vkarpov15/kareem/commit/cc564a9)) +* chore: release 2.0.0 ([f511d1c](https://github.com/vkarpov15/kareem/commit/f511d1c)) + + + + +## 2.0.0-rc5 (2017-12-23) + +* chore: fix build on node 4+5 ([6dac5a4](https://github.com/vkarpov15/kareem/commit/6dac5a4)) +* chore: fix built on node 4 + 5 again ([434ef0a](https://github.com/vkarpov15/kareem/commit/434ef0a)) +* chore: release 2.0.0-rc5 ([25a32ee](https://github.com/vkarpov15/kareem/commit/25a32ee)) + + + + +## 2.0.0-rc4 (2017-12-22) + +* chore: release 2.0.0-rc4 ([49fc083](https://github.com/vkarpov15/kareem/commit/49fc083)) +* BREAKING CHANGE: deduplicate when merging hooks re: Automattic/mongoose#2945 ([d458573](https://github.com/vkarpov15/kareem/commit/d458573)), closes [Automattic/mongoose#2945](https://github.com/Automattic/mongoose/issues/2945) + + + + +## 2.0.0-rc3 (2017-12-22) + +* chore: release 2.0.0-rc3 ([adaaa00](https://github.com/vkarpov15/kareem/commit/adaaa00)) +* feat: support returning promises from middleware functions ([05b4480](https://github.com/vkarpov15/kareem/commit/05b4480)), closes [Automattic/mongoose#3779](https://github.com/Automattic/mongoose/issues/3779) + + + + +## 2.0.0-rc2 (2017-12-21) + +* chore: release 2.0.0-rc2 ([76325fa](https://github.com/vkarpov15/kareem/commit/76325fa)) +* fix: ensure next() and done() run in next tick ([6c20684](https://github.com/vkarpov15/kareem/commit/6c20684)) + + + + +## 2.0.0-rc1 (2017-12-21) + +* chore: improve test coverage re: Automattic/mongoose#3232 ([7b45cf0](https://github.com/vkarpov15/kareem/commit/7b45cf0)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) +* chore: release 2.0.0-rc1 ([9b83f52](https://github.com/vkarpov15/kareem/commit/9b83f52)) +* BREAKING CHANGE: report sync exceptions as errors, only allow calling next() and done() once ([674adcc](https://github.com/vkarpov15/kareem/commit/674adcc)), closes [Automattic/mongoose#3483](https://github.com/Automattic/mongoose/issues/3483) + + + + +## 2.0.0-rc0 (2017-12-17) + +* chore: release 2.0.0-rc0 ([16b44b5](https://github.com/vkarpov15/kareem/commit/16b44b5)) +* BREAKING CHANGE: drop support for node < 4 ([9cbb8c7](https://github.com/vkarpov15/kareem/commit/9cbb8c7)) +* BREAKING CHANGE: remove useLegacyPost and add several new features ([6dd8531](https://github.com/vkarpov15/kareem/commit/6dd8531)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) + + + + +## 1.5.0 (2017-07-20) + +* chore: release 1.5.0 ([9c491a0](https://github.com/vkarpov15/kareem/commit/9c491a0)) +* fix: improve post error handlers results ([9928dd5](https://github.com/vkarpov15/kareem/commit/9928dd5)), closes [Automattic/mongoose#5466](https://github.com/Automattic/mongoose/issues/5466) + + + + +## 1.4.2 (2017-07-06) + +* chore: release 1.4.2 ([8d14ac5](https://github.com/vkarpov15/kareem/commit/8d14ac5)) +* fix: correct args re: Automattic/mongoose#5405 ([3f28ae6](https://github.com/vkarpov15/kareem/commit/3f28ae6)), closes [Automattic/mongoose#5405](https://github.com/Automattic/mongoose/issues/5405) + + + + +## 1.4.1 (2017-04-25) + +* chore: release 1.4.1 ([5ecf0c2](https://github.com/vkarpov15/kareem/commit/5ecf0c2)) +* fix: handle numAsyncPres with clone() ([c72e857](https://github.com/vkarpov15/kareem/commit/c72e857)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) +* test: repro #8 ([9b4d6b2](https://github.com/vkarpov15/kareem/commit/9b4d6b2)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) + + + + +## 1.4.0 (2017-04-19) + +* chore: release 1.4.0 ([101c5f5](https://github.com/vkarpov15/kareem/commit/101c5f5)) +* feat: add merge() function ([285325e](https://github.com/vkarpov15/kareem/commit/285325e)) + + + + +## 1.3.0 (2017-03-26) + +* chore: release 1.3.0 ([f3a9e50](https://github.com/vkarpov15/kareem/commit/f3a9e50)) +* feat: pass function args to execPre ([4dd466d](https://github.com/vkarpov15/kareem/commit/4dd466d)) + + + + +## 1.2.1 (2017-02-03) + +* chore: release 1.2.1 ([d97081f](https://github.com/vkarpov15/kareem/commit/d97081f)) +* fix: filter out _kareemIgnored args for error handlers re: Automattic/mongoose#4925 ([ddc7aeb](https://github.com/vkarpov15/kareem/commit/ddc7aeb)), closes [Automattic/mongoose#4925](https://github.com/Automattic/mongoose/issues/4925) +* fix: make error handlers handle errors in pre hooks ([af38033](https://github.com/vkarpov15/kareem/commit/af38033)), closes [Automattic/mongoose#4927](https://github.com/Automattic/mongoose/issues/4927) + + + + +## 1.2.0 (2017-01-02) + +* chore: release 1.2.0 ([033225c](https://github.com/vkarpov15/kareem/commit/033225c)) +* chore: upgrade deps ([f9e9a09](https://github.com/vkarpov15/kareem/commit/f9e9a09)) +* feat: add _kareemIgnore re: Automattic/mongoose#4836 ([7957771](https://github.com/vkarpov15/kareem/commit/7957771)), closes [Automattic/mongoose#4836](https://github.com/Automattic/mongoose/issues/4836) + + + + +## 1.1.5 (2016-12-13) + +* chore: release 1.1.5 ([1a9f684](https://github.com/vkarpov15/kareem/commit/1a9f684)) +* fix: correct field name ([04a0e9d](https://github.com/vkarpov15/kareem/commit/04a0e9d)) + + + + +## 1.1.4 (2016-12-09) + +* chore: release 1.1.4 ([ece401c](https://github.com/vkarpov15/kareem/commit/ece401c)) +* chore: run tests on node 6 ([e0cb1cb](https://github.com/vkarpov15/kareem/commit/e0cb1cb)) +* fix: only copy own properties in clone() ([dfe28ce](https://github.com/vkarpov15/kareem/commit/dfe28ce)), closes [#7](https://github.com/vkarpov15/kareem/issues/7) + + + + +## 1.1.3 (2016-06-27) + +* chore: release 1.1.3 ([87171c8](https://github.com/vkarpov15/kareem/commit/87171c8)) +* fix: couple more issues with arg processing ([c65f523](https://github.com/vkarpov15/kareem/commit/c65f523)) + + + + +## 1.1.2 (2016-06-27) + +* chore: release 1.1.2 ([8e102b6](https://github.com/vkarpov15/kareem/commit/8e102b6)) +* fix: add early return ([4feda4e](https://github.com/vkarpov15/kareem/commit/4feda4e)) + + + + +## 1.1.1 (2016-06-27) + +* chore: release 1.1.1 ([8bb3050](https://github.com/vkarpov15/kareem/commit/8bb3050)) +* fix: skip error handlers if no error ([0eb3a44](https://github.com/vkarpov15/kareem/commit/0eb3a44)) + + + + +## 1.1.0 (2016-05-11) + +* chore: release 1.1.0 ([85332d9](https://github.com/vkarpov15/kareem/commit/85332d9)) +* chore: test on node 4 and node 5 ([1faefa1](https://github.com/vkarpov15/kareem/commit/1faefa1)) +* 100% coverage again ([c9aee4e](https://github.com/vkarpov15/kareem/commit/c9aee4e)) +* add support for error post hooks ([d378113](https://github.com/vkarpov15/kareem/commit/d378113)) +* basic setup for sync hooks #4 ([55aa081](https://github.com/vkarpov15/kareem/commit/55aa081)), closes [#4](https://github.com/vkarpov15/kareem/issues/4) +* proof of concept for error handlers ([e4a07d9](https://github.com/vkarpov15/kareem/commit/e4a07d9)) +* refactor out handleWrapError helper ([b19af38](https://github.com/vkarpov15/kareem/commit/b19af38)) + + + + +## 1.0.1 (2015-05-10) + +* Fix #1 ([de60dc6](https://github.com/vkarpov15/kareem/commit/de60dc6)), closes [#1](https://github.com/vkarpov15/kareem/issues/1) +* release 1.0.1 ([6971088](https://github.com/vkarpov15/kareem/commit/6971088)) +* Run tests on iojs in travis ([adcd201](https://github.com/vkarpov15/kareem/commit/adcd201)) +* support legacy post hook behavior in wrap() ([23fa74c](https://github.com/vkarpov15/kareem/commit/23fa74c)) +* Use node 0.12 in travis ([834689d](https://github.com/vkarpov15/kareem/commit/834689d)) + + + + +## 1.0.0 (2015-01-28) + +* Tag 1.0.0 ([4c5a35a](https://github.com/vkarpov15/kareem/commit/4c5a35a)) + + + + +## 0.0.8 (2015-01-27) + +* Add clone function ([688bba7](https://github.com/vkarpov15/kareem/commit/688bba7)) +* Add jscs for style checking ([5c93149](https://github.com/vkarpov15/kareem/commit/5c93149)) +* Bump 0.0.8 ([03c0d2f](https://github.com/vkarpov15/kareem/commit/03c0d2f)) +* Fix jscs config, add gulp rules ([9989abf](https://github.com/vkarpov15/kareem/commit/9989abf)) +* fix Makefile typo ([1f7e61a](https://github.com/vkarpov15/kareem/commit/1f7e61a)) + + + + +## 0.0.7 (2015-01-04) + +* Bump 0.0.7 ([98ef173](https://github.com/vkarpov15/kareem/commit/98ef173)) +* fix LearnBoost/mongoose#2553 - use null instead of undefined for err ([9157b48](https://github.com/vkarpov15/kareem/commit/9157b48)), closes [LearnBoost/mongoose#2553](https://github.com/LearnBoost/mongoose/issues/2553) +* Regenerate docs ([2331cdf](https://github.com/vkarpov15/kareem/commit/2331cdf)) + + + + +## 0.0.6 (2015-01-01) + +* Update docs and bump 0.0.6 ([92c12a7](https://github.com/vkarpov15/kareem/commit/92c12a7)) + + + + +## 0.0.5 (2015-01-01) + +* Add coverage rule to Makefile ([825a91c](https://github.com/vkarpov15/kareem/commit/825a91c)) +* Add coveralls to README ([fb52369](https://github.com/vkarpov15/kareem/commit/fb52369)) +* Add coveralls to travis ([93f6f15](https://github.com/vkarpov15/kareem/commit/93f6f15)) +* Add createWrapper() function ([ea77741](https://github.com/vkarpov15/kareem/commit/ea77741)) +* Add istanbul code coverage ([6eceeef](https://github.com/vkarpov15/kareem/commit/6eceeef)) +* Add some more comments for examples ([c5b0c6f](https://github.com/vkarpov15/kareem/commit/c5b0c6f)) +* Add travis ([e6dcb06](https://github.com/vkarpov15/kareem/commit/e6dcb06)) +* Add travis badge to docs ([ad8c9b3](https://github.com/vkarpov15/kareem/commit/ad8c9b3)) +* Add wrap() tests, 100% coverage ([6945be4](https://github.com/vkarpov15/kareem/commit/6945be4)) +* Better test coverage for execPost ([d9ad539](https://github.com/vkarpov15/kareem/commit/d9ad539)) +* Bump 0.0.5 ([69875b1](https://github.com/vkarpov15/kareem/commit/69875b1)) +* Docs fix ([15b7098](https://github.com/vkarpov15/kareem/commit/15b7098)) +* Fix silly mistake in docs generation ([50373eb](https://github.com/vkarpov15/kareem/commit/50373eb)) +* Fix typo in readme ([fec4925](https://github.com/vkarpov15/kareem/commit/fec4925)) +* Linkify travis badge ([92b25fe](https://github.com/vkarpov15/kareem/commit/92b25fe)) +* Make travis run coverage ([747157b](https://github.com/vkarpov15/kareem/commit/747157b)) +* Move travis status badge ([d52e89b](https://github.com/vkarpov15/kareem/commit/d52e89b)) +* Quick fix for coverage ([50bbddb](https://github.com/vkarpov15/kareem/commit/50bbddb)) +* Typo fix ([adea794](https://github.com/vkarpov15/kareem/commit/adea794)) + + + + +## 0.0.4 (2014-12-13) + +* Bump 0.0.4, run docs generation ([51a15fe](https://github.com/vkarpov15/kareem/commit/51a15fe)) +* Use correct post parameters in wrap() ([9bb5da3](https://github.com/vkarpov15/kareem/commit/9bb5da3)) + + + + +## 0.0.3 (2014-12-12) + +* Add npm test script, fix small bug with args not getting passed through post ([49e3e68](https://github.com/vkarpov15/kareem/commit/49e3e68)) +* Bump 0.0.3 ([65621d8](https://github.com/vkarpov15/kareem/commit/65621d8)) +* Update readme ([901388b](https://github.com/vkarpov15/kareem/commit/901388b)) + + + + +## 0.0.2 (2014-12-12) + +* Add github repo and bump 0.0.2 ([59db8be](https://github.com/vkarpov15/kareem/commit/59db8be)) + + + + +## 0.0.1 (2014-12-12) + +* Add basic docs ([ad29ea4](https://github.com/vkarpov15/kareem/commit/ad29ea4)) +* Add pre hooks ([2ffc356](https://github.com/vkarpov15/kareem/commit/2ffc356)) +* Add wrap function ([68c540c](https://github.com/vkarpov15/kareem/commit/68c540c)) +* Bump to version 0.0.1 ([a4bfd68](https://github.com/vkarpov15/kareem/commit/a4bfd68)) +* Initial commit ([4002458](https://github.com/vkarpov15/kareem/commit/4002458)) +* Initial deposit ([98fc489](https://github.com/vkarpov15/kareem/commit/98fc489)) +* Post hooks ([395b67c](https://github.com/vkarpov15/kareem/commit/395b67c)) +* Some basic setup work ([82df75e](https://github.com/vkarpov15/kareem/commit/82df75e)) +* Support sync pre hooks ([1cc1b9f](https://github.com/vkarpov15/kareem/commit/1cc1b9f)) +* Update package.json description ([978da18](https://github.com/vkarpov15/kareem/commit/978da18)) diff --git a/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/LICENSE b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/LICENSE new file mode 100644 index 00000000..b0d46d3c --- /dev/null +++ b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/LICENSE @@ -0,0 +1,202 @@ +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 2014-2022 mongoosejs + + 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/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/README.md b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/README.md new file mode 100644 index 00000000..945e4b33 --- /dev/null +++ b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/README.md @@ -0,0 +1,440 @@ +# kareem + + [![Build Status](https://github.com/mongoosejs/kareem/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/mongoosejs/kareem/actions/workflows/test.yml) + + +Re-imagined take on the [hooks](http://npmjs.org/package/hooks) module, meant to offer additional flexibility in allowing you to execute hooks whenever necessary, as opposed to simply wrapping a single function. + +Named for the NBA's 2nd all-time leading scorer Kareem Abdul-Jabbar, known for his mastery of the [hook shot](http://en.wikipedia.org/wiki/Kareem_Abdul-Jabbar#Skyhook) + + + + + +# API + +## pre hooks + +Much like [hooks](https://npmjs.org/package/hooks), kareem lets you define +pre and post hooks: pre hooks are called before a given function executes. +Unlike hooks, kareem stores hooks and other internal state in a separate +object, rather than relying on inheritance. Furthermore, kareem exposes +an `execPre()` function that allows you to execute your pre hooks when +appropriate, giving you more fine-grained control over your function hooks. + +### It runs without any hooks specified + +```javascript +await hooks.execPre('cook', null); +``` + +### It runs basic serial pre hooks + +pre hook functions can return a promise that resolves when finished. + +```javascript +let count = 0; + +hooks.pre('cook', function() { + ++count; + return Promise.resolve(); +}); + +await hooks.execPre('cook', null); +assert.equal(1, count); +``` + +### It can run multiple pre hooks + +```javascript +let count1 = 0; +let count2 = 0; + +hooks.pre('cook', function() { + ++count1; + return Promise.resolve(); +}); + +hooks.pre('cook', function() { + ++count2; + return Promise.resolve(); +}); + +await hooks.execPre('cook', null); +assert.equal(1, count1); +assert.equal(1, count2); +``` + +### It can run fully synchronous pre hooks + +If your pre hook function takes no parameters, its assumed to be +fully synchronous. + +```javascript +let count1 = 0; +let count2 = 0; + +hooks.pre('cook', function() { + ++count1; +}); + +hooks.pre('cook', function() { + ++count2; +}); + +await hooks.execPre('cook', null); +assert.equal(1, count1); +assert.equal(1, count2); +``` + +### It properly attaches context to pre hooks + +Pre save hook functions are bound to the second parameter to `execPre()` + +```javascript +hooks.pre('cook', function() { + this.bacon = 3; +}); + +hooks.pre('cook', function() { + this.eggs = 4; +}); + +const obj = { bacon: 0, eggs: 0 }; + +// In the pre hooks, `this` will refer to `obj` +await hooks.execPre('cook', obj); +assert.equal(3, obj.bacon); +assert.equal(4, obj.eggs); +``` + +### It supports returning a promise + +You can also return a promise from your pre hooks instead of calling +`next()`. When the returned promise resolves, kareem will kick off the +next middleware. + +```javascript +hooks.pre('cook', function() { + return new Promise(resolve => { + setTimeout(() => { + this.bacon = 3; + resolve(); + }, 100); + }); +}); + +const obj = { bacon: 0 }; + +await hooks.execPre('cook', obj); +assert.equal(3, obj.bacon); +``` + +### It supports filtering which hooks to run + +You can pass a `filter` option to `execPre()` to select which hooks +to run. The filter function receives each hook object and should return +`true` to run the hook or `false` to skip it. + +```javascript +const execed = []; + +const fn1 = function() { execed.push('first'); }; +fn1.skipMe = true; +hooks.pre('cook', fn1); + +const fn2 = function() { execed.push('second'); }; +hooks.pre('cook', fn2); + +// Only runs fn2, skips fn1 because fn1.skipMe is true +await hooks.execPre('cook', null, [], { + filter: hook => !hook.fn.skipMe +}); + +assert.deepStrictEqual(execed, ['second']); +``` + +## post hooks + +### It runs without any hooks specified + +```javascript +const [eggs] = await hooks.execPost('cook', null, [1]); +assert.equal(eggs, 1); +``` + +### It executes with parameters passed in + +```javascript +hooks.post('cook', function(eggs, bacon, callback) { + assert.equal(eggs, 1); + assert.equal(bacon, 2); + callback(); +}); + +const [eggs, bacon] = await hooks.execPost('cook', null, [1, 2]); +assert.equal(eggs, 1); +assert.equal(bacon, 2); +``` + +### It can use synchronous post hooks + +```javascript +const execed = {}; + +hooks.post('cook', function(eggs, bacon) { + execed.first = true; + assert.equal(eggs, 1); + assert.equal(bacon, 2); +}); + +hooks.post('cook', function(eggs, bacon, callback) { + execed.second = true; + assert.equal(eggs, 1); + assert.equal(bacon, 2); + callback(); +}); + +const [eggs, bacon] = await hooks.execPost('cook', null, [1, 2]); +assert.equal(Object.keys(execed).length, 2); +assert.ok(execed.first); +assert.ok(execed.second); +assert.equal(eggs, 1); +assert.equal(bacon, 2); +``` + +### It supports returning a promise + +You can also return a promise from your post hooks instead of calling +`next()`. When the returned promise resolves, kareem will kick off the +next middleware. + +```javascript +hooks.post('cook', function() { + return new Promise(resolve => { + setTimeout(() => { + this.bacon = 3; + resolve(); + }, 100); + }); +}); + +const obj = { bacon: 0 }; + +await hooks.execPost('cook', obj, [obj]); +assert.equal(obj.bacon, 3); +``` + +### It supports filtering which hooks to run + +You can pass a `filter` option to `execPost()` to select which hooks +to run. The filter function receives each hook object and should return +`true` to run the hook or `false` to skip it. + +```javascript +const execed = []; + +const fn1 = function() { execed.push('first'); }; +fn1.skipMe = true; +hooks.post('cook', fn1); + +const fn2 = function() { execed.push('second'); }; +hooks.post('cook', fn2); + +// Only runs fn2, skips fn1 because fn1.skipMe is true +await hooks.execPost('cook', null, [], { + filter: hook => !hook.fn.skipMe +}); + +assert.deepStrictEqual(execed, ['second']); +``` + +## wrap() + +### It wraps pre and post calls into one call + +```javascript +hooks.pre('cook', function() { + return new Promise(resolve => { + this.bacon = 3; + setTimeout(() => { + resolve(); + }, 5); + }); +}); + +hooks.pre('cook', function() { + this.eggs = 4; + return Promise.resolve(); +}); + +hooks.pre('cook', function() { + this.waffles = false; + return Promise.resolve(); +}); + +hooks.post('cook', function(obj) { + obj.tofu = 'no'; +}); + +const obj = { bacon: 0, eggs: 0 }; + +const args = [obj]; + +const result = await hooks.wrap( + 'cook', + function(o) { + assert.equal(obj.bacon, 3); + assert.equal(obj.eggs, 4); + assert.equal(obj.waffles, false); + assert.equal(obj.tofu, undefined); + return o; + }, + obj, + args); + +assert.equal(obj.bacon, 3); +assert.equal(obj.eggs, 4); +assert.equal(obj.waffles, false); +assert.equal(obj.tofu, 'no'); +assert.equal(result, obj); +``` + +### It supports filtering hooks per call with getOptions + +Direct `wrap()` callers can pass the same `getOptions` option that +`createWrapper()` accepts. `getOptions` receives the call arguments and +returns options for `execPre()`/`execPost()`, either a single `{ filter }` +applied to both phases or separate `{ pre, post }` options. + +```javascript +const execed = []; + +const audit = function() { execed.push('audit'); }; +audit.skipMe = true; +hooks.pre('cook', audit); + +hooks.pre('cook', function() { execed.push('validate'); }); + +const result = await hooks.wrap('cook', o => o, null, ['eggs'], { + getOptions: (args) => args[0] === 'eggs' ? { filter: hook => !hook.fn.skipMe } : {} +}); + +assert.deepStrictEqual(execed, ['validate']); +assert.equal(result, 'eggs'); +``` + +## createWrapper() + +### It wraps wrap() into a callable function + +```javascript +hooks.pre('cook', function() { + this.bacon = 3; + return Promise.resolve(); +}); + +hooks.pre('cook', function() { + return new Promise(resolve => { + this.eggs = 4; + setTimeout(function() { + resolve(); + }, 10); + }); +}); + +hooks.pre('cook', function() { + this.waffles = false; + return Promise.resolve(); +}); + +hooks.post('cook', function(obj) { + obj.tofu = 'no'; +}); + +const obj = { bacon: 0, eggs: 0 }; + +const cook = hooks.createWrapper( + 'cook', + function(o) { + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal(undefined, obj.tofu); + return o; + }, + obj); + +const result = await cook(obj); +assert.equal(obj.bacon, 3); +assert.equal(obj.eggs, 4); +assert.equal(obj.waffles, false); +assert.equal(obj.tofu, 'no'); + +assert.equal(result, obj); +``` + +### It supports filtering hooks per call with getOptions + +You can pass a `getOptions` function to `createWrapper()` to choose which +hooks run on each call. `getOptions` receives the arguments the wrapped +function was called with and returns options for `execPre()`/`execPost()`. +Return a single `{ filter }` to apply to both pre and post hooks, or +`{ pre, post }` to filter them separately. `createWrapperSync()` supports +the same option. This is how Mongoose skips user-defined middleware for a +single operation. + +```javascript +const execed = []; + +const audit = function() { execed.push('audit'); }; +audit.skipMe = true; +hooks.pre('cook', audit); + +hooks.pre('cook', function() { execed.push('validate'); }); + +const cook = hooks.createWrapper('cook', o => o, null, { + getOptions: (args) => { + const options = args[args.length - 1] || {}; + return options.skipMiddleware ? { filter: hook => !hook.fn.skipMe } : {}; + } +}); + +// Skips the `audit` hook because the call passes `skipMiddleware: true` +await cook({}, { skipMiddleware: true }); +assert.deepStrictEqual(execed, ['validate']); +``` + +## clone() + +### It clones a Kareem object + +```javascript +const k1 = new Kareem(); +k1.pre('cook', function() {}); +k1.post('cook', function() {}); + +const k2 = k1.clone(); +assert.deepEqual(Array.from(k2._pres.keys()), ['cook']); +assert.deepEqual(Array.from(k2._posts.keys()), ['cook']); +``` + +## merge() + +### It pulls hooks from another Kareem object + +```javascript +const k1 = new Kareem(); +const test1 = function() {}; +k1.pre('cook', test1); +k1.post('cook', function() {}); + +const k2 = new Kareem(); +const test2 = function() {}; +k2.pre('cook', test2); +const k3 = k2.merge(k1); +assert.equal(k3._pres.get('cook').length, 2); +assert.equal(k3._pres.get('cook')[0].fn, test2); +assert.equal(k3._pres.get('cook')[1].fn, test1); +assert.equal(k3._posts.get('cook').length, 1); +``` diff --git a/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/SECURITY.md b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/SECURITY.md new file mode 100644 index 00000000..da9c516d --- /dev/null +++ b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/SECURITY.md @@ -0,0 +1,5 @@ +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.d.ts b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.d.ts new file mode 100644 index 00000000..98a11b8d --- /dev/null +++ b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.d.ts @@ -0,0 +1,61 @@ +declare module "kareem" { + interface FilterOption { + /** Predicate that receives each registered hook and returns whether to run it. */ + filter?: (hook: any) => boolean; + } + + interface ExecPostOptions extends FilterOption { + /** Error to pass to error-handling middleware. */ + error?: Error; + /** Force a consistent number of arguments passed to each post hook. */ + numCallbackParams?: number; + } + + /** + * Result of a `getOptions` callback: either a single `{ filter }` applied to both + * pre and post hooks, or separate `{ pre, post }` options. + */ + type GetOptionsResult = FilterOption | { pre?: FilterOption; post?: FilterOption }; + + interface CreateWrapperSyncOptions { + /** Receives the wrapper arguments and returns options for execPreSync/execPostSync. */ + getOptions?: (args: any[]) => GetOptionsResult; + } + + interface CreateWrapperOptions extends Record { + /** Receives the wrapper arguments and returns options for execPre/execPost. */ + getOptions?: (args: any[]) => GetOptionsResult; + } + + export default class Kareem { + static skipWrappedFunction(...args: any[]): SkipWrappedFunction; + static overwriteResult(...args: any[]): OverwriteResult; + static overwriteArguments(...args: any[]): OverwriteArguments; + + pre(name: string | RegExp, fn: Function): this; + pre(name: string | RegExp, options: Record, fn: Function, error?: any, unshift?: boolean): this; + post(name: string | RegExp, fn: Function): this; + post(name: string | RegExp, options: Record, fn: Function, unshift?: boolean): this; + postError(name: string | RegExp, fn: Function, unshift?: boolean): this; + postError(name: string | RegExp, options: Record, fn: Function, unshift?: boolean): this; + + clone(): Kareem; + merge(other: Kareem, clone?: boolean): this; + + createWrapper any>(name: string, fn: T, context?: any, options?: CreateWrapperOptions): (...args: Parameters) => Promise>>; + createWrapperSync any>(name: string, fn: T, context?: any, options?: CreateWrapperSyncOptions): (...args: Parameters) => ReturnType; + hasHooks(name: string): boolean; + filter(fn: (hook: any) => boolean): Kareem; + + wrap(name: string, fn: Function, context: any, args: any[], options?: CreateWrapperOptions): Promise; + + execPostSync(name: string, context: any, args: any[], options?: FilterOption): any[]; + execPost(name: string, context: any, args: any[], options?: ExecPostOptions): Promise; + execPreSync(name: string, context: any, args: any[], options?: FilterOption): any[]; + execPre(name: string, context: any, args: any[], options?: FilterOption): Promise; + } + + class SkipWrappedFunction {} + class OverwriteResult {} + class OverwriteArguments {} +} diff --git a/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.js b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.js new file mode 100644 index 00000000..c3f5a9b5 --- /dev/null +++ b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/index.js @@ -0,0 +1,560 @@ +'use strict'; + +/** + * Create a new instance + */ +function Kareem() { + this._pres = new Map(); + this._posts = new Map(); +} + +Kareem.skipWrappedFunction = function skipWrappedFunction() { + if (!(this instanceof Kareem.skipWrappedFunction)) { + return new Kareem.skipWrappedFunction(...arguments); + } + + this.args = [...arguments]; +}; + +Kareem.overwriteResult = function overwriteResult() { + if (!(this instanceof Kareem.overwriteResult)) { + return new Kareem.overwriteResult(...arguments); + } + + this.args = [...arguments]; +}; + +Kareem.overwriteArguments = function overwriteArguments() { + if (!(this instanceof Kareem.overwriteArguments)) { + return new Kareem.overwriteArguments(...arguments); + } + + this.args = [...arguments]; +}; + +/** + * Execute all "pre" hooks for "name" + * @param {String} name The hook name to execute + * @param {*} context Overwrite the "this" for the hook + * @param {Array} args arguments passed to the pre hooks + * @param {Object} [options] Optional options + * @param {Function} [options.filter] Filter function to select which hooks to run + * @returns {Array} The potentially modified arguments + */ +Kareem.prototype.execPre = async function execPre(name, context, args, options) { + let pres = this._pres.get(name) || []; + if (options?.filter) { + pres = pres.filter(options.filter); + } + const numPres = pres.length; + let $args = args; + let skipWrappedFunction = null; + + if (!numPres) { + return $args; + } + + for (const pre of pres) { + try { + const maybePromiseLike = pre.fn.apply(context, $args); + if (isPromiseLike(maybePromiseLike)) { + const result = await maybePromiseLike; + if (result instanceof Kareem.overwriteArguments) { + $args = result.args; + } + } else if (maybePromiseLike instanceof Kareem.overwriteArguments) { + $args = maybePromiseLike.args; + } + } catch (error) { + if (error instanceof Kareem.skipWrappedFunction) { + skipWrappedFunction = error; + continue; + } + if (error instanceof Kareem.overwriteArguments) { + $args = error.args; + continue; + } + throw error; + } + } + + if (skipWrappedFunction) { + throw skipWrappedFunction; + } + + return $args; +}; + +/** + * Execute all "pre" hooks for "name" synchronously + * @param {String} name The hook name to execute + * @param {*} context Overwrite the "this" for the hook + * @param {Array} [args] Apply custom arguments to the hook + * @param {Object} [options] Optional options + * @param {Function} [options.filter] Filter function to select which hooks to run + * @returns {Array} The potentially modified arguments + */ +Kareem.prototype.execPreSync = function(name, context, args, options) { + let pres = this._pres.get(name) || []; + if (options?.filter) { + pres = pres.filter(options.filter); + } + const numPres = pres.length; + let $args = args || []; + + for (let i = 0; i < numPres; ++i) { + const result = pres[i].fn.apply(context, $args); + if (result instanceof Kareem.overwriteArguments) { + $args = result.args; + } + } + + return $args; +}; + +/** + * Execute all "post" hooks for "name" + * @param {String} name The hook name to execute + * @param {*} context Overwrite the "this" for the hook + * @param {Array} args Apply custom arguments to the hook + * @param {Object} [options] Optional options + * @param {Error} [options.error] Error to pass to error-handling middleware + * @param {Function} [options.filter] Filter function to select which hooks to run + * @returns {void} + */ +Kareem.prototype.execPost = async function execPost(name, context, args, options) { + let posts = this._posts.get(name) || []; + if (options?.filter) { + posts = posts.filter(options.filter); + } + const numPosts = posts.length; + + let firstError = null; + if (options && options.error) { + firstError = options.error; + } + + if (!numPosts) { + if (firstError != null) { + throw firstError; + } + return args; + } + + let cbPromise = null; + let resolve; + let reject; + const nextCallback = function nextCallback(err) { + if (err) { + reject(err); + } else { + resolve(); + } + }; + + let newArgs = args.slice(); + _handleNumCallbackParams(newArgs, options?.numCallbackParams); + let numArgs = newArgs.length; + newArgs.push(nextCallback); + let errorArgs = options?.error ? [firstError, ...newArgs] : null; + + for (const currentPost of posts) { + const post = currentPost.fn; + + cbPromise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + + if (firstError) { + if (isErrorHandlingMiddleware(currentPost, numArgs)) { + try { + const res = post.apply(context, errorArgs); + if (isPromiseLike(res)) { + await res; + } else if (post.length === numArgs + 2) { + // `numArgs + 2` because we added the error and the callback + await cbPromise; + } + } catch (error) { + if (error instanceof Kareem.overwriteResult) { + args = error.args; + newArgs = args.slice(); + _handleNumCallbackParams(newArgs, options?.numCallbackParams); + numArgs = newArgs.length; + newArgs.push(nextCallback); + continue; + } + firstError = error; + errorArgs = [firstError, ...newArgs]; + } + } else { + continue; + } + } else { + if (isErrorHandlingMiddleware(currentPost, numArgs)) { + // Skip error handlers if no error + continue; + } else { + let res = null; + try { + res = post.apply(context, newArgs); + if (isPromiseLike(res)) { + res = await res; + } else if (post.length === numArgs + 1) { + // If post function takes a callback, wait for the post function to call the callback + res = await cbPromise; + } + } catch (error) { + if (error instanceof Kareem.overwriteResult) { + args = error.args; + newArgs = args.slice(); + _handleNumCallbackParams(newArgs, options?.numCallbackParams); + numArgs = newArgs.length; + newArgs.push(nextCallback); + errorArgs = [firstError, ...newArgs]; + continue; + } + firstError = error; + errorArgs = [firstError, ...newArgs]; + continue; + } + + if (res instanceof Kareem.overwriteResult) { + args = res.args; + newArgs = args.slice(); + _handleNumCallbackParams(newArgs, options?.numCallbackParams); + numArgs = newArgs.length; + newArgs.push(nextCallback); + continue; + } + } + } + } + + if (firstError != null) { + throw firstError; + } + + return args; +}; + +/*! + * Handle the `numCallbackParams` option for `execPostSync`: fill `newArgs` with `null` until + * length is `numCallbackParams` if `numCallbackParams` is a number. + * + * @param {Array} newArgs The arguments to fill + * @param {number|null|undefined} numCallbackParams The number of callback parameters + */ + +function _handleNumCallbackParams(newArgs, numCallbackParams) { + if (typeof numCallbackParams === 'number' && numCallbackParams > newArgs.length) { + for (let i = newArgs.length; i < numCallbackParams; ++i) { + newArgs.push(null); + } + } +} + +/** + * Execute all "post" hooks for "name" synchronously + * @param {String} name The hook name to execute + * @param {*} context Overwrite the "this" for the hook + * @param {Array} args Apply custom arguments to the hook + * @param {Object} [options] Optional options + * @param {Function} [options.filter] Filter function to select which hooks to run + * @returns {Array} The used arguments + */ +Kareem.prototype.execPostSync = function(name, context, args, options) { + let posts = this._posts.get(name) || []; + if (options?.filter) { + posts = posts.filter(options.filter); + } + const numPosts = posts.length; + + for (let i = 0; i < numPosts; ++i) { + const res = posts[i].fn.apply(context, args || []); + if (res instanceof Kareem.overwriteResult) { + args = res.args; + } + } + + return args; +}; + +/** + * Create a synchronous wrapper for "fn" + * @param {String} name The name of the hook + * @param {Function} fn The function to wrap + * @param {*} context Overwrite the "this" for the hook. If null/undefined, uses the calling context. + * @param {Object} [options] Options for the wrapper + * @param {Function} [options.getOptions] Function that receives the wrapper arguments and returns options for execPreSync/execPostSync. Can return `{ filter }` for both, or `{ pre: { filter }, post: { filter } }` for separate options. + * @returns {Function} The wrapped function + */ +Kareem.prototype.createWrapperSync = function(name, fn, context, options) { + const _this = this; + const getOptions = options?.getOptions; + return function syncWrapper() { + const _context = context ?? this; + const args = Array.from(arguments); + const execOptions = typeof getOptions === 'function' ? getOptions(args) : {}; + const preOptions = execOptions.pre ?? execOptions; + const postOptions = execOptions.post ?? execOptions; + + const modifiedArgs = _this.execPreSync(name, _context, args, preOptions); + + const toReturn = fn.apply(_context, modifiedArgs); + + const result = _this.execPostSync(name, _context, [toReturn], postOptions); + + return result[0]; + }; +}; + +/** + * Executes pre hooks, followed by the wrapped function, followed by post hooks. + * @param {String} name The name of the hook + * @param {Function} fn The function for the hook + * @param {*} context Overwrite the "this" for the hook + * @param {Array} args Apply custom arguments to the hook + * @param {Object} [options] Additional options for the hook + * @param {Function} [options.getOptions] Function that receives `args` and returns options for execPre/execPost. Can return `{ filter }` for both, or `{ pre: { filter }, post: { filter } }` for separate options. + * @returns {Promise} The wrapped function's result, potentially modified by post hooks + */ +Kareem.prototype.wrap = async function wrap(name, fn, context, args, options) { + const getOptions = options?.getOptions; + const execOptions = typeof getOptions === 'function' ? getOptions(args) : {}; + const preOptions = execOptions.pre ?? execOptions; + const postOptions = execOptions.post ?? execOptions; + + let ret; + let skipWrappedFunction = false; + let modifiedArgs = args; + try { + modifiedArgs = await this.execPre(name, context, args, preOptions); + } catch (error) { + if (error instanceof Kareem.skipWrappedFunction) { + ret = error.args; + skipWrappedFunction = true; + } else { + await this.execPost(name, context, args, { ...options, ...postOptions, error }); + } + } + + if (!skipWrappedFunction) { + ret = await fn.apply(context, modifiedArgs); + } + + ret = await this.execPost(name, context, [ret], { ...options, ...postOptions }); + + return ret[0]; +}; + +/** + * Filter current instance for something specific and return the filtered clone + * @param {Function} fn The filter function + * @returns {Kareem} The cloned and filtered instance + */ +Kareem.prototype.filter = function(fn) { + const clone = this.clone(); + + const pres = Array.from(clone._pres.keys()); + for (const name of pres) { + const hooks = this._pres.get(name). + map(h => Object.assign({}, h, { name: name })). + filter(fn); + + if (hooks.length === 0) { + clone._pres.delete(name); + continue; + } + + clone._pres.set(name, hooks); + } + + const posts = Array.from(clone._posts.keys()); + for (const name of posts) { + const hooks = this._posts.get(name). + map(h => Object.assign({}, h, { name: name })). + filter(fn); + + if (hooks.length === 0) { + clone._posts.delete(name); + continue; + } + + clone._posts.set(name, hooks); + } + + return clone; +}; + +/** + * Check for a "name" to exist either in pre or post hooks + * @param {String} name The name of the hook + * @returns {Boolean} "true" if found, "false" otherwise + */ +Kareem.prototype.hasHooks = function(name) { + return this._pres.has(name) || this._posts.has(name); +}; + +/** + * Create a Wrapper for "fn" on "name" and return the wrapped function + * @param {String} name The name of the hook + * @param {Function} fn The function to wrap + * @param {*} context Overwrite the "this" for the hook. If null/undefined, uses the calling context. + * @param {Object} [options] + * @param {Function} [options.getOptions] Function that receives the wrapper arguments and returns options for execPre/execPost. Can return `{ filter }` for both, or `{ pre: { filter }, post: { filter } }` for separate options. + * @returns {Function} The wrapped function + */ +Kareem.prototype.createWrapper = function(name, fn, context, options) { + const _this = this; + if (!this.hasHooks(name)) { + // Fast path: if there's no hooks for this function, just return the function + return fn; + } + return function kareemWrappedFunction() { + const _context = context ?? this; + return _this.wrap(name, fn, _context, Array.from(arguments), options); + }; +}; + +/** + * Register a new hook for "pre" + * @param {String} name The name of the hook + * @param {Object} [options] + * @param {Function} fn The function to register for "name" + * @param {never} error Unused + * @param {Boolean} [unshift] Wheter to "push" or to "unshift" the new hook + * @returns {Kareem} + */ +Kareem.prototype.pre = function(name, options, fn, error, unshift) { + if (typeof options === 'function') { + fn = options; + options = {}; + } else if (options == null) { + options = {}; + } + + const pres = this._pres.get(name) || []; + this._pres.set(name, pres); + + if (typeof fn !== 'function') { + throw new Error('pre() requires a function, got "' + typeof fn + '"'); + } + + if (unshift) { + pres.unshift(Object.assign({}, options, { fn: fn })); + } else { + pres.push(Object.assign({}, options, { fn: fn })); + } + + return this; +}; + +/** + * Register a new hook for "post" + * @param {String} name The name of the hook + * @param {Object} [options] + * @param {Boolean} [options.errorHandler] Whether this is an error handler + * @param {Function} fn The function to register for "name" + * @param {Boolean} [unshift] Wheter to "push" or to "unshift" the new hook + * @returns {Kareem} + */ +Kareem.prototype.post = function(name, options, fn, unshift) { + const posts = this._posts.get(name) || []; + + if (typeof options === 'function') { + unshift = !!fn; + fn = options; + options = {}; + } + + if (typeof fn !== 'function') { + throw new Error('post() requires a function, got "' + typeof fn + '"'); + } + + if (unshift) { + posts.unshift(Object.assign({}, options, { fn: fn })); + } else { + posts.push(Object.assign({}, options, { fn: fn })); + } + this._posts.set(name, posts); + return this; +}; + +/** + * Register a new error handler for "name" + * @param {String} name The name of the hook + * @param {Object} [options] + * @param {Function} fn The function to register for "name" + * @param {Boolean} [unshift] Wheter to "push" or to "unshift" the new hook + * @returns {Kareem} + */ + +Kareem.prototype.postError = function postError(name, options, fn, unshift) { + if (typeof options === 'function') { + unshift = !!fn; + fn = options; + options = {}; + } + return this.post(name, { ...options, errorHandler: true }, fn, unshift); +}; + +/** + * Clone the current instance + * @returns {Kareem} The cloned instance + */ +Kareem.prototype.clone = function() { + const n = new Kareem(); + + for (const key of this._pres.keys()) { + const clone = this._pres.get(key).slice(); + n._pres.set(key, clone); + } + for (const key of this._posts.keys()) { + n._posts.set(key, this._posts.get(key).slice()); + } + + return n; +}; + +/** + * Merge "other" into self or "clone" + * @param {Kareem} other The instance to merge with + * @param {Kareem} [clone] The instance to merge onto (if not defined, using "this") + * @returns {Kareem} The merged instance + */ +Kareem.prototype.merge = function(other, clone) { + clone = arguments.length === 1 ? true : clone; + const ret = clone ? this.clone() : this; + + for (const key of other._pres.keys()) { + const sourcePres = ret._pres.get(key) || []; + const deduplicated = other._pres.get(key). + // Deduplicate based on `fn` + filter(p => sourcePres.map(_p => _p.fn).indexOf(p.fn) === -1); + const combined = sourcePres.concat(deduplicated); + ret._pres.set(key, combined); + } + for (const key of other._posts.keys()) { + const sourcePosts = ret._posts.get(key) || []; + const deduplicated = other._posts.get(key). + filter(p => sourcePosts.indexOf(p) === -1); + ret._posts.set(key, sourcePosts.concat(deduplicated)); + } + + return ret; +}; + +function isPromiseLike(v) { + return (typeof v === 'object' && v !== null && typeof v.then === 'function'); +} + +function isErrorHandlingMiddleware(post, numArgs) { + if (post.errorHandler) { + return true; + } + return post.fn.length === numArgs + 2; +} + +module.exports = Kareem; diff --git a/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/package.json b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/package.json new file mode 100644 index 00000000..121a28f7 --- /dev/null +++ b/backend/node_modules/.pnpm/kareem@3.4.0/node_modules/kareem/package.json @@ -0,0 +1,29 @@ +{ + "name": "kareem", + "version": "3.4.0", + "description": "Next-generation take on pre/post function hooks", + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "lint": "eslint .", + "test": "mocha ./test/*", + "test-coverage": "nyc --reporter lcov mocha ./test/*", + "docs": "node ./docs.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/mongoosejs/kareem.git" + }, + "devDependencies": { + "acquit": "1.x", + "acquit-ignore": "0.2.x", + "eslint": "8.20.0", + "mocha": "11.x", + "nyc": "15.1.0" + }, + "author": "Valeri Karpov ", + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + } +} diff --git a/backend/node_modules/.pnpm/lock.yaml b/backend/node_modules/.pnpm/lock.yaml new file mode 100644 index 00000000..0df37688 --- /dev/null +++ b/backend/node_modules/.pnpm/lock.yaml @@ -0,0 +1,1089 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@apollo/server': + specifier: ^5.5.1 + version: 5.5.1(graphql@17.0.2) + graphql: + specifier: ^17.0.2 + version: 17.0.2 + graphql-tag: + specifier: ^2.12.7 + version: 2.12.7(graphql@17.0.2) + mongoose: + specifier: ^9.10.2 + version: 9.10.2 + +packages: + + '@apollo/cache-control-types@1.0.3': + resolution: {integrity: sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g==} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/protobufjs@1.2.8': + resolution: {integrity: sha512-r7xNeUqZX+eBBEmyvaPw0/cSz6zgf5jdH8mjUz8ynKpNs/GU7vi2T7sNcZINk2ZID7wwjG91FCgdpCrQuJ8rzA==} + hasBin: true + + '@apollo/server-gateway-interface@2.0.0': + resolution: {integrity: sha512-3HEMD6fSantG2My3jWkb9dvfkF9vJ4BDLRjMgsnD790VINtuPaEp+h3Hg9HOHiWkML6QsOhnaRqZ+gvhp3y8Nw==} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/server@5.5.1': + resolution: {integrity: sha512-Rn3g5TJQsMSUY23CWZTghWdBWyjX7dP1eaEBPkvmM2RHi82cDcpgTIkSCbGvtTUEGjwopLv1AAooU/n7iIZ20A==} + engines: {node: '>=20'} + peerDependencies: + graphql: ^16.11.0 + + '@apollo/usage-reporting-protobuf@4.1.2': + resolution: {integrity: sha512-aTnAD41RYz0d5dawlyR5Iclkgzx0Xb0njUJmEfvZ6pS4f4HU8wCYyctPpWat/HWp2PmRwDfX5R1k4uVcDKZ4xA==} + + '@apollo/utils.createhash@3.0.1': + resolution: {integrity: sha512-CKrlySj4eQYftBE5MJ8IzKwIibQnftDT7yGfsJy5KSEEnLlPASX0UTpbKqkjlVEwPPd4mEwI7WOM7XNxEuO05A==} + engines: {node: '>=16'} + + '@apollo/utils.dropunuseddefinitions@2.0.1': + resolution: {integrity: sha512-EsPIBqsSt2BwDsv8Wu76LK5R1KtsVkNoO4b0M5aK0hx+dGg9xJXuqlr7Fo34Dl+y83jmzn+UvEW+t1/GP2melA==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.fetcher@3.1.0': + resolution: {integrity: sha512-Z3QAyrsQkvrdTuHAFwWDNd+0l50guwoQUoaDQssLOjkmnmVuvXlJykqlEJolio+4rFwBnWdoY1ByFdKaQEcm7A==} + engines: {node: '>=16'} + + '@apollo/utils.isnodelike@3.0.0': + resolution: {integrity: sha512-xrjyjfkzunZ0DeF6xkHaK5IKR8F1FBq6qV+uZ+h9worIF/2YSzA0uoBxGv6tbTeo9QoIQnRW4PVFzGix5E7n/g==} + engines: {node: '>=16'} + + '@apollo/utils.keyvaluecache@4.0.0': + resolution: {integrity: sha512-mKw1myRUkQsGPNB+9bglAuhviodJ2L2MRYLTafCMw5BIo7nbvCPNCkLnIHjZ1NOzH7SnMAr5c9LmXiqsgYqLZw==} + engines: {node: '>=20'} + + '@apollo/utils.logger@3.0.0': + resolution: {integrity: sha512-M8V8JOTH0F2qEi+ktPfw4RL7MvUycDfKp7aEap2eWXfL5SqWHN6jTLbj5f5fj1cceHpyaUSOZlvlaaryaxZAmg==} + engines: {node: '>=16'} + + '@apollo/utils.printwithreducedwhitespace@2.0.1': + resolution: {integrity: sha512-9M4LUXV/fQBh8vZWlLvb/HyyhjJ77/I5ZKu+NBWV/BmYGyRmoEP9EVAy7LCVoY3t8BDcyCAGfxJaLFCSuQkPUg==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.removealiases@2.0.1': + resolution: {integrity: sha512-0joRc2HBO4u594Op1nev+mUF6yRnxoUH64xw8x3bX7n8QBDYdeYgY4tF0vJReTy+zdn2xv6fMsquATSgC722FA==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.sortast@2.0.1': + resolution: {integrity: sha512-eciIavsWpJ09za1pn37wpsCGrQNXUhM0TktnZmHwO+Zy9O4fu/WdB4+5BvVhFiZYOXvfjzJUcc+hsIV8RUOtMw==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.stripsensitiveliterals@2.0.1': + resolution: {integrity: sha512-QJs7HtzXS/JIPMKWimFnUMK7VjkGQTzqD9bKD1h3iuPAqLsxd0mUNVbkYOPTsDhUKgcvUOfOqOJWYohAKMvcSA==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.usagereporting@2.1.0': + resolution: {integrity: sha512-LPSlBrn+S17oBy5eWkrRSGb98sWmnEzo3DPTZgp8IQc8sJe0prDgDuppGq4NeQlpoqEHz0hQeYHAOA0Z3aQsxQ==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.withrequired@3.0.0': + resolution: {integrity: sha512-aaxeavfJ+RHboh7c2ofO5HHtQobGX4AgUujXP4CXpREHp9fQ9jPi6K9T1jrAKe7HIipoP0OJ1gd6JamSkFIpvA==} + engines: {node: '>=16'} + + '@graphql-tools/merge@9.2.4': + resolution: {integrity: sha512-vV+8uWNWn0+OsqT0r22lZuoT0cTe6fBqBtpLHre2rriLjI/ZTrsOHmabLPTUOyzgFnRrS2PzFSYGL3zKL1Wj4Q==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/schema@10.1.1': + resolution: {integrity: sha512-24jJghRxEW+SG1lbJ45Zg9HEZ8ZKS923ihbFjOicspFLpryxJkWp6gZJ7D8tCVaSAhli4x1+1wDPAfhT8mLqxg==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/utils@12.0.1': + resolution: {integrity: sha512-8YC6jn4xYDS6YTY6xDAgQAs/nGgvzRaIGHS8GeSfVItQzNK7Ms24CQtE3EJY+amvR+tBnhRSX0N83aGj+V/RIg==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-typed-document-node/core@3.2.0': + resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@mongodb-js/saslprep@1.5.4': + resolution: {integrity: sha512-05UC0jQsjKAOuXQ0H9Ud9vUTJpZIg+n/FinpR30tI5I8pY2inTfPOZ5OF/cg3Ce/N9MoD1xhRCeOsJtuTbFYlw==} + + '@protobufjs/aspromise@1.1.2': + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + + '@protobufjs/base64@1.1.2': + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + + '@protobufjs/codegen@2.0.5': + resolution: {integrity: sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==} + + '@protobufjs/eventemitter@1.1.1': + resolution: {integrity: sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==} + + '@protobufjs/fetch@1.1.1': + resolution: {integrity: sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==} + + '@protobufjs/float@1.0.2': + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + + '@protobufjs/inquire@1.1.2': + resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==} + + '@protobufjs/path@1.1.2': + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + + '@protobufjs/pool@1.1.0': + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + + '@protobufjs/utf8@1.1.2': + resolution: {integrity: sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@types/long@4.0.2': + resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + + '@types/webidl-conversions@7.0.3': + resolution: {integrity: sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==} + + '@types/whatwg-url@13.0.0': + resolution: {integrity: sha512-N8WXpbE6Wgri7KUSvrmQcqrMllKZ9uxkYWMt+mCSGwNc0Hsw9VQTW7ApqI4XNrx6/SaM2QQJCzMPDEXE058s+Q==} + + '@whatwg-node/promise-helpers@1.3.2': + resolution: {integrity: sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA==} + engines: {node: '>=16.0.0'} + + async-retry@1.3.3: + resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==} + + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + + body-parser@2.3.0: + resolution: {integrity: sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==} + engines: {node: '>=18'} + + bson@7.3.3: + resolution: {integrity: sha512-oz3LwE3qGEhTCSyhzQRLY3Bj1NLOsjFMf6tcmY5J8M+3R7EVcmoBfSHWvjUK3yXCLDUsGpIuB3aQL4nDZ1EV/g==} + engines: {node: '>=20.19.0'} + + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bind@1.0.9: + resolution: {integrity: sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + content-type@2.1.0: + resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==} + engines: {node: '>=18'} + + cors@2.8.6: + resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} + engines: {node: '>= 0.10'} + + cross-inspect@1.0.1: + resolution: {integrity: sha512-Pcw1JTvZLSJH83iiGWt6fRcT+BjZlCDRVwYLbUcHzv/CRpB7r0MlSrGbIyQvVSNyGnbt7G4AXuyCiDR3POvZ1A==} + engines: {node: '>=16.0.0'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.1.2: + resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} + engines: {node: '>= 0.4'} + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + finalhandler@2.1.1: + resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} + engines: {node: '>= 18.0.0'} + + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + graphql-tag@2.12.7: + resolution: {integrity: sha512-xnE/NFzy+0eIesvAsREJZ284zTl/wYuBAvpsFSDhRGRdRHdnE90M21Q3xAWyYInb0J756c6x0pIQ62+vtvOs1Q==} + engines: {node: '>=10'} + peerDependencies: + graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + graphql@17.0.2: + resolution: {integrity: sha512-FRWbddMxfkjiB7z+aQDWIR+E34xo9I8c9mtK2RPv8PmMzKRvrdsreHL/Ui/TmwHJfhHChEtsFPyMHKI+xuarQQ==} + engines: {node: ^22.0.0 || ^24.0.0 || ^25.0.0 || >=26.0.0} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.4: + resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} + engines: {node: '>= 0.4'} + + http-errors@2.0.1: + resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} + engines: {node: '>= 0.8'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + + isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + + kareem@3.4.0: + resolution: {integrity: sha512-JAKhnR4S027v/8949QXNInRskgETCg9rFUMi1VjhGbjX+XltCAAEFcXykkSocNkom1kc66EMJfjWvhj87BDQKg==} + engines: {node: '>=18.0.0'} + + lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + + loglevel@1.9.2: + resolution: {integrity: sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==} + engines: {node: '>= 0.6.0'} + + long@4.0.0: + resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + + lru-cache@11.5.3: + resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} + engines: {node: 20 || >=22} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + media-typer@1.1.1: + resolution: {integrity: sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==} + engines: {node: '>= 0.8'} + + memory-pager@1.5.0: + resolution: {integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@3.0.2: + resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} + engines: {node: '>=18'} + + mongodb-connection-string-url@7.0.2: + resolution: {integrity: sha512-ZoS07RoFqpKYQwAk59qmrx8+jJHNHU30UjlU96QktiGn1ltvDr+vCznLX5DiUBLEpMAHatHNWV1nM/74ul66kA==} + engines: {node: '>=20.19.0'} + + mongodb@7.6.0: + resolution: {integrity: sha512-WbZ6OCjYw2c53LOjfkQa+reXr7kIiOVpXXglnASFuiMtif0BvsMwHe3ClJHLm1/r7wJFwaasfFtD6iYIktB01g==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@aws-sdk/credential-providers': ^3.806.0 + '@mongodb-js/zstd': ^7.0.0 + gcp-metadata: ^7.0.1 + kerberos: ^7.0.0 + mongodb-client-encryption: ^7.2.0 + snappy: ^7.3.2 + socks: ^2.8.6 + peerDependenciesMeta: + '@aws-sdk/credential-providers': + optional: true + '@mongodb-js/zstd': + optional: true + gcp-metadata: + optional: true + kerberos: + optional: true + mongodb-client-encryption: + optional: true + snappy: + optional: true + socks: + optional: true + + mongoose@9.10.2: + resolution: {integrity: sha512-oFcFL3dsX5tDzMwBD+GGoDqKIj6RNG3bu3oqlvcUIgPulHP14/6N7c07j3s0XgbrlT7U/lbiXOD89hmPtEXnfQ==} + engines: {node: '>=20.19.0'} + + mpath@0.9.0: + resolution: {integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==} + engines: {node: '>=4.0.0'} + + mquery@6.0.0: + resolution: {integrity: sha512-b2KQNsmgtkscfeDgkYMcWGn9vZI9YoXh802VDEwE6qc50zxBFQ0Oo8ROkawbPAsXCY1/Z1yp0MagqsZStPWJjw==} + engines: {node: '>=20.19.0'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + negotiator@1.1.0: + resolution: {integrity: sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==} + engines: {node: '>=18'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} + engines: {node: '>= 0.4'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + qs@6.16.0: + resolution: {integrity: sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==} + engines: {node: '>=0.6'} + + raw-body@3.0.2: + resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} + engines: {node: '>= 0.10'} + + retry@0.13.1: + resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} + engines: {node: '>= 4'} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + sha.js@2.4.12: + resolution: {integrity: sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==} + engines: {node: '>= 0.10'} + hasBin: true + + side-channel-list@1.0.1: + resolution: {integrity: sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.1: + resolution: {integrity: sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==} + engines: {node: '>= 0.4'} + + sift@17.1.3: + resolution: {integrity: sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==} + + sparse-bitfield@3.0.3: + resolution: {integrity: sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==} + + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + to-buffer@1.2.2: + resolution: {integrity: sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==} + engines: {node: '>= 0.4'} + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + + tr46@5.1.1: + resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} + engines: {node: '>=18'} + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + type-is@2.1.0: + resolution: {integrity: sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==} + engines: {node: '>= 18'} + + typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + + whatwg-mimetype@4.0.0: + resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} + engines: {node: '>=18'} + + whatwg-url@14.2.0: + resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} + engines: {node: '>=18'} + + which-typed-array@1.1.24: + resolution: {integrity: sha512-wk4Mf4pR5mRP7eYuuTBCIQ9d0ud2Fv2jRLQpfgnRjbOxAFHmjKFValgTpitVKzJJS8ajnYQV2Du1SZ8j6b/EUQ==} + engines: {node: '>= 0.4'} + +snapshots: + + '@apollo/cache-control-types@1.0.3(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/protobufjs@1.2.8': + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.5 + '@protobufjs/eventemitter': 1.1.1 + '@protobufjs/fetch': 1.1.1 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.2 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.2 + '@types/long': 4.0.2 + long: 4.0.0 + + '@apollo/server-gateway-interface@2.0.0(graphql@17.0.2)': + dependencies: + '@apollo/usage-reporting-protobuf': 4.1.2 + '@apollo/utils.fetcher': 3.1.0 + '@apollo/utils.keyvaluecache': 4.0.0 + '@apollo/utils.logger': 3.0.0 + graphql: 17.0.2 + + '@apollo/server@5.5.1(graphql@17.0.2)': + dependencies: + '@apollo/cache-control-types': 1.0.3(graphql@17.0.2) + '@apollo/server-gateway-interface': 2.0.0(graphql@17.0.2) + '@apollo/usage-reporting-protobuf': 4.1.2 + '@apollo/utils.createhash': 3.0.1 + '@apollo/utils.fetcher': 3.1.0 + '@apollo/utils.isnodelike': 3.0.0 + '@apollo/utils.keyvaluecache': 4.0.0 + '@apollo/utils.logger': 3.0.0 + '@apollo/utils.usagereporting': 2.1.0(graphql@17.0.2) + '@apollo/utils.withrequired': 3.0.0 + '@graphql-tools/schema': 10.1.1(graphql@17.0.2) + async-retry: 1.3.3 + body-parser: 2.3.0 + content-type: 1.0.5 + cors: 2.8.6 + finalhandler: 2.1.1 + graphql: 17.0.2 + loglevel: 1.9.2 + lru-cache: 11.5.3 + negotiator: 1.1.0 + whatwg-mimetype: 4.0.0 + transitivePeerDependencies: + - supports-color + + '@apollo/usage-reporting-protobuf@4.1.2': + dependencies: + '@apollo/protobufjs': 1.2.8 + + '@apollo/utils.createhash@3.0.1': + dependencies: + '@apollo/utils.isnodelike': 3.0.0 + sha.js: 2.4.12 + + '@apollo/utils.dropunuseddefinitions@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.fetcher@3.1.0': {} + + '@apollo/utils.isnodelike@3.0.0': {} + + '@apollo/utils.keyvaluecache@4.0.0': + dependencies: + '@apollo/utils.logger': 3.0.0 + lru-cache: 11.5.3 + + '@apollo/utils.logger@3.0.0': {} + + '@apollo/utils.printwithreducedwhitespace@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.removealiases@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.sortast@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + lodash.sortby: 4.7.0 + + '@apollo/utils.stripsensitiveliterals@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.usagereporting@2.1.0(graphql@17.0.2)': + dependencies: + '@apollo/usage-reporting-protobuf': 4.1.2 + '@apollo/utils.dropunuseddefinitions': 2.0.1(graphql@17.0.2) + '@apollo/utils.printwithreducedwhitespace': 2.0.1(graphql@17.0.2) + '@apollo/utils.removealiases': 2.0.1(graphql@17.0.2) + '@apollo/utils.sortast': 2.0.1(graphql@17.0.2) + '@apollo/utils.stripsensitiveliterals': 2.0.1(graphql@17.0.2) + graphql: 17.0.2 + + '@apollo/utils.withrequired@3.0.0': {} + + '@graphql-tools/merge@9.2.4(graphql@17.0.2)': + dependencies: + '@graphql-tools/utils': 12.0.1(graphql@17.0.2) + graphql: 17.0.2 + tslib: 2.8.1 + + '@graphql-tools/schema@10.1.1(graphql@17.0.2)': + dependencies: + '@graphql-tools/merge': 9.2.4(graphql@17.0.2) + '@graphql-tools/utils': 12.0.1(graphql@17.0.2) + graphql: 17.0.2 + tslib: 2.8.1 + + '@graphql-tools/utils@12.0.1(graphql@17.0.2)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@17.0.2) + '@whatwg-node/promise-helpers': 1.3.2 + cross-inspect: 1.0.1 + graphql: 17.0.2 + tslib: 2.8.1 + + '@graphql-typed-document-node/core@3.2.0(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@mongodb-js/saslprep@1.5.4': + dependencies: + sparse-bitfield: 3.0.3 + + '@protobufjs/aspromise@1.1.2': {} + + '@protobufjs/base64@1.1.2': {} + + '@protobufjs/codegen@2.0.5': {} + + '@protobufjs/eventemitter@1.1.1': {} + + '@protobufjs/fetch@1.1.1': + dependencies: + '@protobufjs/aspromise': 1.1.2 + + '@protobufjs/float@1.0.2': {} + + '@protobufjs/inquire@1.1.2': {} + + '@protobufjs/path@1.1.2': {} + + '@protobufjs/pool@1.1.0': {} + + '@protobufjs/utf8@1.1.2': {} + + '@standard-schema/spec@1.1.0': {} + + '@types/long@4.0.2': {} + + '@types/webidl-conversions@7.0.3': {} + + '@types/whatwg-url@13.0.0': + dependencies: + '@types/webidl-conversions': 7.0.3 + + '@whatwg-node/promise-helpers@1.3.2': + dependencies: + tslib: 2.8.1 + + async-retry@1.3.3: + dependencies: + retry: 0.13.1 + + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.1.0 + + body-parser@2.3.0: + dependencies: + bytes: 3.1.2 + content-type: 2.1.0 + debug: 4.4.3 + http-errors: 2.0.1 + iconv-lite: 0.7.3 + on-finished: 2.4.1 + qs: 6.16.0 + raw-body: 3.0.2 + type-is: 2.1.0 + transitivePeerDependencies: + - supports-color + + bson@7.3.3: {} + + bytes@3.1.2: {} + + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bind@1.0.9: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + get-intrinsic: 1.3.0 + set-function-length: 1.2.2 + + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + + content-type@1.0.5: {} + + content-type@2.1.0: {} + + cors@2.8.6: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + + cross-inspect@1.0.1: + dependencies: + tslib: 2.8.1 + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + depd@2.0.0: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + ee-first@1.1.1: {} + + encodeurl@2.0.0: {} + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.1.2: + dependencies: + es-errors: 1.3.0 + + escape-html@1.0.3: {} + + finalhandler@2.1.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + for-each@0.3.5: + dependencies: + is-callable: 1.2.7 + + function-bind@1.1.2: {} + + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.2 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.4 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.2 + + gopd@1.2.0: {} + + graphql-tag@2.12.7(graphql@17.0.2): + dependencies: + graphql: 17.0.2 + tslib: 2.8.1 + + graphql@17.0.2: {} + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.4: + dependencies: + function-bind: 1.1.2 + + http-errors@2.0.1: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.2 + toidentifier: 1.0.1 + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + inherits@2.0.4: {} + + is-callable@1.2.7: {} + + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.24 + + isarray@2.0.5: {} + + kareem@3.4.0: {} + + lodash.sortby@4.7.0: {} + + loglevel@1.9.2: {} + + long@4.0.0: {} + + lru-cache@11.5.3: {} + + math-intrinsics@1.1.0: {} + + media-typer@1.1.1: {} + + memory-pager@1.5.0: {} + + mime-db@1.54.0: {} + + mime-types@3.0.2: + dependencies: + mime-db: 1.54.0 + + mongodb-connection-string-url@7.0.2: + dependencies: + '@types/whatwg-url': 13.0.0 + whatwg-url: 14.2.0 + + mongodb@7.6.0: + dependencies: + '@mongodb-js/saslprep': 1.5.4 + bson: 7.3.3 + mongodb-connection-string-url: 7.0.2 + + mongoose@9.10.2: + dependencies: + '@standard-schema/spec': 1.1.0 + kareem: 3.4.0 + mongodb: 7.6.0 + mpath: 0.9.0 + mquery: 6.0.0 + ms: 2.1.3 + sift: 17.1.3 + transitivePeerDependencies: + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks + + mpath@0.9.0: {} + + mquery@6.0.0: {} + + ms@2.1.3: {} + + negotiator@1.1.0: + dependencies: + content-type: 2.1.0 + + object-assign@4.1.1: {} + + object-inspect@1.13.4: {} + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + parseurl@1.3.3: {} + + possible-typed-array-names@1.1.0: {} + + punycode@2.3.1: {} + + qs@6.16.0: + dependencies: + es-define-property: 1.0.1 + side-channel: 1.1.1 + + raw-body@3.0.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.7.3 + unpipe: 1.0.0 + + retry@0.13.1: {} + + safe-buffer@5.2.1: {} + + safer-buffer@2.1.2: {} + + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.3.0 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + + setprototypeof@1.2.0: {} + + sha.js@2.4.12: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + to-buffer: 1.2.2 + + side-channel-list@1.0.1: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.1: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.1 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + sift@17.1.3: {} + + sparse-bitfield@3.0.3: + dependencies: + memory-pager: 1.5.0 + + statuses@2.0.2: {} + + to-buffer@1.2.2: + dependencies: + isarray: 2.0.5 + safe-buffer: 5.2.1 + typed-array-buffer: 1.0.3 + + toidentifier@1.0.1: {} + + tr46@5.1.1: + dependencies: + punycode: 2.3.1 + + tslib@2.8.1: {} + + type-is@2.1.0: + dependencies: + content-type: 2.1.0 + media-typer: 1.1.1 + mime-types: 3.0.2 + + typed-array-buffer@1.0.3: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-typed-array: 1.1.15 + + unpipe@1.0.0: {} + + vary@1.1.2: {} + + webidl-conversions@7.0.0: {} + + whatwg-mimetype@4.0.0: {} + + whatwg-url@14.2.0: + dependencies: + tr46: 5.1.1 + webidl-conversions: 7.0.0 + + which-typed-array@1.1.24: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.9 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 + has-tostringtag: 1.0.2 diff --git a/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/LICENSE b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/README.md b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/README.md new file mode 100644 index 00000000..266738eb --- /dev/null +++ b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/README.md @@ -0,0 +1,18 @@ +# lodash.sortby v4.7.0 + +The [lodash](https://lodash.com/) method `_.sortBy` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.sortby +``` + +In Node.js: +```js +var sortBy = require('lodash.sortby'); +``` + +See the [documentation](https://lodash.com/docs#sortBy) or [package source](https://github.com/lodash/lodash/blob/4.7.0-npm-packages/lodash.sortby) for more details. diff --git a/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/index.js b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/index.js new file mode 100644 index 00000000..85dddb46 --- /dev/null +++ b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/index.js @@ -0,0 +1,2630 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; diff --git a/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/package.json b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/package.json new file mode 100644 index 00000000..bfe6985e --- /dev/null +++ b/backend/node_modules/.pnpm/lodash.sortby@4.7.0/node_modules/lodash.sortby/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.sortby", + "version": "4.7.0", + "description": "The lodash method `_.sortBy` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, sortby", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/.editorconfig b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/.editorconfig new file mode 100644 index 00000000..4403be2b --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/.editorconfig @@ -0,0 +1,27 @@ + +# EditorConfig defines and maintains consistent coding styles between different +# editors and IDEs: http://EditorConfig.org/ +# Top-most EditorConfig file +root = true + +# All files +[*.*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +max_line_length = 80 + +[*.md] +indent_size = 2 + +[*.json] +indent_size = 2 + +[*.{yaml,yml}] +indent_size = 2 + +[vendor/grunt-template-jasmine-requirejs/**/*] +indent_size = 2 diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/CONTRIBUTING.md b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/CONTRIBUTING.md new file mode 100644 index 00000000..fc461eed --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/CONTRIBUTING.md @@ -0,0 +1,98 @@ +Filing tickets against loglevel +=============================== + +If you'd like to file a bug or a feature request for loglevel, the best option is to [open an issue on Github](https://github.com/pimterry/loglevel/issues/new). + +If you're filing a feature request, please remember: + +* Feature requests significantly expanding the scope of loglevel outside the description in [the readme](https://github.com/pimterry/loglevel/blob/master/README.md) will probably be rejected. +* Features that can't be meaningfully implemented in a cross-environment compatible manner won't be implemented. +* Please check the previously opened issues to see if somebody else has suggested it first. +* Consider submitting a pull request to add the feature instead, if you're confident it fits within the above. + +If you're filing a bug, please remember: + +* To provide detailed steps to reproduce the behaviour. +* If possible, provide a Jasmine test which reproduces the behaviour. +* Please specify the exact details of the environment in which it fails: OS + Environment (i.e. Browser or Node) + version. +* Consider submitting a pull request to fix the bug instead. + +Helping develop loglevel +================================ + +If you'd like to help develop loglevel further, please submit a pull request! I'm very keen to improve loglevel further, and good pull requests will be enthusiastically merged. + +Before submitting a pull request to fix a bug or add a new feature, please check the lists above to ensure it'll be accepted. Browser compatibility is particularly important here; if you add a feature or fix a bug which breaks things on other browsers it will not be merged, no matter how awesome it may be. + +To be more specific, before submitting your pull request please ensure: + +* You haven't broken the existing test suite in any obvious browsers (at least check latest IE/FF/Chrome). +* You've added relevant tests for the bug you're fixing/the new feature you're adding/etc, which pass in all the relevant browsers. +* JSHint is happy with your new code. +* You've updated the API docs (in `README.md`) to detail any changes you've made to the public interface. +* Your change is backward-compatible (or you've explicitly said that it's not; this isn't great, but will be considered). +* You haven't changed any files in `dist/` (these are auto-generated, and should only be changed on release). + +Compatibility and JavaScript Runtimes +------------------------------------- + +loglevel aims to stay compatible with browsers, Node.js versions, and other JS runtimes that may be fairly old at this point! Please take care to match existing conventions and JavaScript language features wherever possible. For example, loglevel uses `var` instead of the newer `let` and `const` keywords to define variables, uses old-style `for` loops instead of the newer `for...of` loop, and so on. + +That said, loglevel's *test and development tools* utilize newer JavaScript and Node.js features. To run most tests or build releases, you will need a newer version of Node.js than is required at runtime (see details below in ["how to make your change…"](#how-to-make-your-change-and-submit-it)). Using newer features or making breaking changes to the *dev tools* is OK. + +Project structure +----------------- + +The core project code is all in [`lib/loglevel.js`](./lib/loglevel.js), and this should be the only file you need to touch for functional changes themselves. + +The released code is in `dist/*.js`, and should not be touched by anything except releases (pull requests should *not* update these files). + +The test suite is entirely in `test/*.js`: + +* Every file ending in `-test.js` is a unit test, is written in RequireJS, and should pass in any environment. +* `global-integration.js` and `node-integration.js` are quick integration smoke tests for node and for browser global usage. +* `test-helpers.js` contains some test utilities. +* `manual-test.html` is a test page which includes the current loglevel build, so you can manually check that it works in a given browser. + +How to make your change and submit it +------------------------------------- + +1. Ensure you have Node.js v14 or later (some tests can run on earlier versions, but the full suite requires this version). +2. Fork loglevel. +3. Clone your fork locally. +4. Create a branch from `master` for your change. +5. Write some tests in `test/` for your change, as relevant. +6. Make your code changes in `lib/loglevel.js`. +7. Check your code all passes (run `npm test`). If you have issues and need to debug the tests, see the details on ["running tests"](#running-tests) below. +8. Commit your changes. +9. Open a pull request back to `master` in loglevel. + +Running Tests +------------- + +There are several types of tests and test tools that loglevel uses to verify different types of support in different environments. When you run `npm test`, *all* of these tests are run automatically. However, you may want to run individual types of tests during development, or run some tests manually to debug them. + +Test commands (see `"scripts"` in `package.json` for a complete list of tools): +- `npm test` — Runs all the below tests. +- `npm run test-browser` — Runs detailed tests in a headless browser. There are actually 3 sub-groups here: + - `npx grunt jasmine:global` — Tests general usage of the global `log` variable. + - `npx grunt test-browser-context` — Tests usage when loglevel is injected into an anonymous function instead of included as a regular script on the page. + - `npx grunt jasmine:requirejs` — Tests the main test suite via Jasmine & RequireJS. +- `npm run test-node` — Runs tests that check loglevel in Node.js. +- `npm run test-types` — Runs tests of the TypeScript type definitions for loglevel. + +Alternatively, you might want to run tests manually in your browser in order to use debugging tools to step through the code: +1. Run `npx grunt integration-test` to start a test server on port `8000`. +2. Your default browser should open the tests automatically, but if not, open `http://127.0.0.1:8000/_SpecRunner.html` in any browser. +3. Open your browser's dev tools and place breakpoints where you'd like to debug a test. +4. Reload the page to re-run the tests and pause on breakpoints. + +You can also open a blank webpage with loglevel pre-loaded to experiment in your browser's console: +1. Run `npx grunt integration-test` to start a test server on port `8000`. +2. In whatever browser you want to test, open `http://127.0.0.1:8000/test/manual-test.html`. +3. Play around with the global `log` object in the browser's dev console. + +Reporting security issues +------------------------- + +Tidelift acts as the security contact for loglevel. Issues can be reported to security@tidelift.com, see https://tidelift.com/security for more details. diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/Gruntfile.js b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/Gruntfile.js new file mode 100644 index 00000000..5af9f546 --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/Gruntfile.js @@ -0,0 +1,165 @@ +'use strict'; + +var Jasmine = require('jasmine'); + +module.exports = function (grunt) { + var jasmineRequireJsOptions = { + specs: 'test/*-test.js', + helpers: 'test/*-helper.js', + }; + + // Project configuration. + grunt.initConfig({ + // Metadata. + pkg: grunt.file.readJSON('package.json'), + banner: '/*! <%= pkg.name %> - v<%= pkg.version %>' + + ' - <%= pkg.homepage %>' + + ' - (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' + + ' - licensed <%= pkg.license %> */\n', + // Task configuration. + concat: { + options: { + banner: '<%= banner %>', + stripBanners: true + }, + dist: { + src: ['lib/<%= pkg.name %>.js'], + dest: 'dist/<%= pkg.name %>.js' + } + }, + uglify: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: '<%= concat.dist.dest %>', + dest: 'dist/<%= pkg.name %>.min.js' + } + }, + jasmine: { + requirejs: { + src: [], + options: { + specs: jasmineRequireJsOptions.specs, + helpers: jasmineRequireJsOptions.helpers, + template: require('./vendor/grunt-template-jasmine-requirejs') + } + }, + global: { + src: 'lib/**/*.js', + options: { + specs: 'test/global-integration.js', + } + }, + context: { + src: 'test/test-context-using-apply.generated.js', + options: { + specs: 'test/global-integration-with-new-context.js', + } + } + }, + jasmine_node: { + options: { + specs: ['test/node-integration.js'] + } + }, + open: { + jasmine: { + path: 'http://127.0.0.1:8000/_SpecRunner.html' + } + }, + connect: { + test: { + port: 8000, + keepalive: true + } + }, + jshint: { + options: { + jshintrc: '.jshintrc' + }, + gruntfile: { + src: 'Gruntfile.js' + }, + lib: { + options: { + jshintrc: 'lib/.jshintrc' + }, + src: ['lib/**/*.js'] + }, + test: { + options: { + jshintrc: 'test/.jshintrc' + }, + src: ['test/*.js', '!test/*.generated.js'] + } + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + lib: { + files: '<%= jshint.lib.src %>', + tasks: ['jshint:lib', 'test'] + }, + test: { + files: '<%= jshint.test.src %>', + tasks: ['jshint:test', 'test'] + } + }, + preprocess: { + "test-context-using-apply": { + src: 'test/test-context-using-apply.js', + dest: 'test/test-context-using-apply.generated.js' + } + }, + clean:{ + test:['test/test-context-using-apply.generated.js'] + } + }); + + // These plugins provide necessary tasks. + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-jasmine'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + grunt.loadNpmTasks('grunt-contrib-connect'); + grunt.loadNpmTasks('grunt-open'); + grunt.loadNpmTasks('grunt-preprocess'); + grunt.loadNpmTasks('grunt-contrib-clean'); + + // Run Jasmine with Node.js tests (as opposed to browser tests). + // + // NOTE: This is designed for Jasmine 2.4, which matches the version used + // in `grunt-contrib-jasmine`. If that package is updated, this should also + // be updated to match. + grunt.registerTask('jasmine_node', 'Run Jasmine in Node.js', function() { + var done = this.async(); + + var jasmine = new Jasmine({ projectBaseDir: __dirname }); + jasmine.onComplete(function(success) { + done(success); + }); + + jasmine.execute(this.options().specs); + }); + + // Build a distributable release + grunt.registerTask('dist', ['test', 'dist-build']); + grunt.registerTask('dist-build', ['concat', 'uglify']); + + // Check everything is good + grunt.registerTask('test', ['jshint', 'test-browser', 'test-node']); + grunt.registerTask('test-browser', ['jasmine:global', 'test-browser-context', 'jasmine:requirejs']); + grunt.registerTask('test-browser-context', ['preprocess', 'jasmine:context', 'clean:test']); + grunt.registerTask('test-node', ['jasmine_node']); + + // Test with a live server and an actual browser + grunt.registerTask('integration-test', ['jasmine:requirejs:src:build', 'open:jasmine', 'connect:test:keepalive']); + + // Default task. + grunt.registerTask('default', 'test'); +}; diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/LICENSE-MIT b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/LICENSE-MIT new file mode 100644 index 00000000..d384208b --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Tim Perry + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/README.md b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/README.md new file mode 100644 index 00000000..f6ba988e --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/README.md @@ -0,0 +1,408 @@ + +# loglevel [![NPM version][npm-image]][npm-url] [![NPM downloads](https://img.shields.io/npm/dw/loglevel.svg)](https://www.npmjs.com/package/loglevel) [![Build Status](https://github.com/pimterry/loglevel/actions/workflows/ci.yml/badge.svg)](https://github.com/pimterry/loglevel/actions/workflows/ci.yml) + +[npm-image]: https://img.shields.io/npm/v/loglevel.svg?style=flat +[npm-url]: https://npmjs.org/package/loglevel + +> _Don't debug with logs alone - check out [HTTP Toolkit](https://httptoolkit.tech/javascript): beautiful, powerful & open-source tools for building, testing & debugging HTTP(S)_ + +Minimal lightweight simple logging for JavaScript (browsers, node.js or elsewhere). loglevel extends `console.log()` & friends with level-based logging and filtering, with none of console's downsides. + +Test it out live in your browser console at https://pimterry.github.io/loglevel/demo/index.html + +Loglevel is a barebones reliable everyday logging library. It does not do fancy things, it does not let you reconfigure appenders or add complex log filtering rules or boil tea (more's the pity), but it does have the all core functionality that you actually use: + +## Features + +### Simple + +* Log things at a given level (trace/debug/info/warn/error) to the `console` object (as seen in all modern browsers & node.js). +* Filter logging by level (all the above or 'silent'), so you can disable all but error logging in production, and then run `log.setLevel("trace")` in your console to turn it all back on for a furious debugging session. +* Single file, no dependencies, weighs in at 1.4 KB minified and gzipped. + +### Effective + +* Log methods gracefully fall back to simpler console logging methods if more specific ones aren't available: so calls to `log.debug()` go to `console.debug()` if possible, or `console.log()` if not. +* Logging calls still succeed even if there's no `console` object at all, so your site doesn't break when people visit with old browsers that don't support the `console` object (here's looking at you, IE) and similar. +* This then comes together giving a consistent reliable API that works in every JavaScript environment with a console available, and never breaks anything anywhere else. + +### Convenient + +* Log output keeps line numbers: most JS logging frameworks call `console.log` methods through wrapper functions, clobbering your stacktrace and making the extra info many browsers provide useless. We'll have none of that thanks. +* It works with all the standard JavaScript loading systems out of the box (CommonJS, AMD, or just as a global). +* Logging is filtered to "warn" level by default, to keep your live site clean in normal usage (or you can trivially re-enable everything with an initial `log.enableAll()` call). +* Magically handles situations where console logging is not initially available (IE8/9), and automatically enables logging as soon as it does become available (when developer console is opened). +* TypeScript type definitions included, so no need for extra `@types` packages. +* Extensible, to add other log redirection, filtering, or formatting functionality, while keeping all the above (except you will clobber your stacktrace, see [“Plugins”](#plugins) below). + +## Downloading loglevel + +If you're using NPM, you can just run `npm install loglevel`. + +Alternatively, loglevel is also available via [Bower](https://github.com/bower/bower) (`bower install loglevel`), as a [Webjar](http://www.webjars.org/), or an [Atmosphere package](https://atmospherejs.com/spacejamio/loglevel) (for Meteor) + +Alternatively if you just want to grab the file yourself, you can download either the current stable [production version][min] or the [development version][max] directly, or reference it remotely on unpkg at [`https://unpkg.com/loglevel/dist/loglevel.min.js`][cdn] (this will redirect to a latest version, use the resulting redirected URL if you want to pin that version). + +Finally, if you want to tweak loglevel to your own needs or you immediately need the cutting-edge version, clone this repo and see [Developing & Contributing](#developing--contributing) below for build instructions. + +[min]: https://raw.github.com/pimterry/loglevel/master/dist/loglevel.min.js +[max]: https://raw.github.com/pimterry/loglevel/master/dist/loglevel.js +[cdn]: https://unpkg.com/loglevel/dist/loglevel.min.js + +## Setting it up + +loglevel supports AMD (e.g. RequireJS), CommonJS (e.g. Node.js) and direct usage (e.g. loading globally with a ` + +``` + +### As an ES6 module + +loglevel is written as a UMD module, with a single object exported. Unfortunately, ES6 module loaders & transpilers don't all handle this the same way. Some will treat the object as the default export, while others use it as the root exported object. In addition, loglevel includes a `default` property on the root object, designed to help handle this difference. Nonetheless, there are two possible syntaxes that might work for you: + +For most tools, using the default import is the most convenient and flexible option: + +```javascript +import log from 'loglevel'; +log.warn("module-tastic"); +``` + +For some tools though, it might better to wildcard import the whole object: + +```javascript +import * as log from 'loglevel'; +log.warn("module-tastic"); +``` + +There's no major difference, unless you're using TypeScript & building a loglevel plugin (in that case, see ). In general though, just use whichever suits your environment, and everything should work out fine. + +### With noConflict() + +If you're using another JavaScript library that exposes a `log` global, you can run into conflicts with loglevel. Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded onto the page. This resets the `log` global to its value before loglevel was loaded (typically `undefined`), and returns the loglevel object, which you can then bind to another name yourself. + +For example: + +```html + + +``` + +### TypeScript + +loglevel includes its own type definitions, assuming you're using a modern module environment (e.g. Node.JS, webpack, etc), you should be able to use the ES6 syntax above, and everything will work immediately. If not, file a bug! + +If you really want to use LogLevel as a global however, but from TypeScript, you'll need to declare it as such first. To do that: + +* Create a `loglevel.d.ts` file +* Ensure that file is included in your build (e.g. add it to `include` in your tsconfig, pass it on the command line, or use `///`) +* In that file, add: + + ```typescript + import * as log from 'loglevel'; + export as namespace log; + export = log; + ``` + +## Documentation + +### Methods + +The loglevel API is extremely minimal. All methods are available on the root loglevel object, which we suggest you name `log` (this is the default if you import it globally, and is what's set up in the above examples). The API consists of: + +#### Logging Methods + +5 actual logging methods, ordered and available as: + +* `log.trace(msg)` +* `log.debug(msg)` +* `log.info(msg)` +* `log.warn(msg)` +* `log.error(msg)` + +`log.log(msg)` is also available, as an alias for `log.debug(msg)`, to improve compatibility with `console`, and make migration easier. + +Exact output formatting of these will depend on the console available in the current context of your application. For example, many environments will include a full stack trace with all `trace()` calls, and icons or similar to highlight other calls. + +These methods should never fail in any environment, even if no `console` object is currently available, and should always fall back to an available log method even if the specific method called (e.g. `warn`) isn't available. + +Be aware that this means that these methods won't always produce exactly the output you expect in every environment; loglevel only guarantees that these methods will never explode on you, and that it will call the most relevant method it can find, with your argument. For example, `log.trace(msg)` in Firefox before version 64 prints the stacktrace by itself, and doesn't include your message (see [#84](https://github.com/pimterry/loglevel/issues/84)). + +#### `log.setLevel(level, [persist])` + +This disables all logging below the given level, so that after a `log.setLevel("warn")` call `log.warn("something")` or `log.error("something")` will output messages, but `log.info("something")` will not. + +This can take either a log level name or `'silent'` (which disables everything) in one of a few forms: + +* As a log level from the internal levels list, e.g. `log.levels.SILENT` ← _for type safety_ +* As a string, like `'error'` (case-insensitive) ← _for a reasonable practical balance_ +* As a numeric index from `0` (trace) to `5` (silent) ← _deliciously terse, and more easily programmable (...although, why?)_ + +Where possible, the log level will be persisted. LocalStorage will be used if available, falling back to cookies if not. If neither is available in the current environment (e.g. in Node), or if you pass `false` as the optional 'persist' second argument, persistence will be skipped. + +If `log.setLevel()` is called when a `console` object is not available (in IE 8 or 9 before the developer tools have been opened, for example) logging will remain silent until the console becomes available, and then begin logging at the requested level. + +#### `log.setDefaultLevel(level)` + +This sets the current log level only if one has not been persisted and can’t be loaded. This is useful when initializing modules or scripts; if a developer or user has previously called `setLevel()`, this won’t alter their settings. For example, your application might use `setDefaultLevel("error")` set the log level to `error` in a production environment, but when debugging an issue, you might call `setLevel("trace")` on the console to see all the logs. If that `error` setting was set using `setDefaultLevel()`, it will still stay as `trace` on subsequent page loads and refreshes instead of resetting to `error`. + +The `level` argument takes the same values that you might pass to `setLevel()`. Levels set using `setDefaultLevel()` never persist to subsequent page loads. + +#### `log.resetLevel()` + +This resets the current log level to the logger's default level (if no explicit default was set, then it resets it to the root logger's level, or to `WARN`) and clears the persisted level if one was previously persisted. + +#### `log.enableAll()` and `log.disableAll()` + +These enable or disable all log messages, and are equivalent to `log.setLevel("trace")` and `log.setLevel("silent")`, respectively. + +#### `log.getLevel()` + +Returns the current logging level, as a number from `0` (trace) to `5` (silent) + +It's very unlikely you'll need to use this for normal application logging; it's provided partly to help plugin development, and partly to let you optimize logging code as below, where debug data is only generated if the level is set such that it'll actually be logged. This probably doesn't affect you, unless you've run profiling on your code and you have hard numbers telling you that your log data generation is a real performance problem. + +```javascript +if (log.getLevel() <= log.levels.DEBUG) { + var logData = runExpensiveDataGeneration(); + log.debug(logData); +} +``` + +This notably isn't the right solution to avoid the cost of string concatenation in your logging. Firstly, it's very unlikely that string concatenation in your logging is really an important performance problem. Even if you do genuinely have hard metrics showing that it is, though, the better solution that wrapping your log statements in this is to use multiple arguments, as below. The underlying console API will automatically concatenate these for you if logging is enabled, and if it isn't then all log methods are no-ops, and no concatenation will be done at all. + +```javascript +// Prints 'My concatenated log message' +log.debug("My", "concatenated", "log message"); +``` + +#### `log.getLogger(loggerName)` + +This gets you a new logger object that works exactly like the root `log` object, but can have its level and logging methods set independently. All loggers must have a name (which is a non-empty string, or a [Symbol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)). Calling `getLogger()` multiple times with the same name will return an identical logger object. + +In large applications, it can be incredibly useful to turn logging on and off for particular modules as you are working with them. Using the `getLogger()` method lets you create a separate logger for each part of your application with its own logging level. + +Likewise, for small, independent modules, using a named logger instead of the default root logger allows developers using your module to selectively turn on deep, trace-level logging when trying to debug problems, while logging only errors or silencing logging altogether under normal circumstances. + +Example usage _(using CommonJS modules, but you could do the same with any module system):_ + +```javascript +// In module-one.js: +var log = require("loglevel").getLogger("module-one"); +function doSomethingAmazing() { + log.debug("Amazing message from module one."); +} + +// In module-two.js: +var log = require("loglevel").getLogger("module-two"); +function doSomethingSpecial() { + log.debug("Special message from module two."); +} + +// In your main application module: +var log = require("loglevel"); +var moduleOne = require("module-one"); +var moduleTwo = require("module-two"); +log.getLogger("module-two").setLevel("TRACE"); + +moduleOne.doSomethingAmazing(); +moduleTwo.doSomethingSpecial(); +// logs "Special message from module two." +// (but nothing from module one.) +``` + +Loggers returned by `getLogger()` support all the same properties and methods as the default root logger, excepting `noConflict()` and the `getLogger()` method itself. + +Like the root logger, other loggers can have their logging level saved. If a logger’s level has not been saved, it will inherit the root logger’s level when it is first created. If the root logger’s level changes later, the new level will not affect other loggers that have already been created. Loggers with Symbol names (rather than string names) will always be considered unique instances, and will never have their logging level saved or restored. + +Likewise, loggers inherit the root logger’s `methodFactory`. After creation, each logger can have its `methodFactory` independently set. See the _plugins_ section below for more about `methodFactory`. + +#### `log.getLoggers()` + +This will return the dictionary of all loggers created with `getLogger()`, keyed by their names. + +#### `log.rebuild()` + +Ensure the various logging methods (`log.info()`, `log.warn()`, etc.) behave as expected given the currently set logging level and `methodFactory`. It will also rebuild all child loggers of the logger this was called on. + +This is mostly useful for plugin development. When you call `log.setLevel()` or `log.setDefaultLevel()`, the logger is rebuilt automatically. However, if you change the logger’s `methodFactory`, you should use this to rebuild all the logging methods with your new factory. + +It is also useful if you change the level of the root logger and want it to affect child loggers that you’ve already created (and have not called `someChildLogger.setLevel()` or `someChildLogger.setDefaultLevel()` on). For example: + +```js +var childLogger1 = log.getLogger("child1"); +childLogger1.getLevel(); // WARN (inherited from the root logger) + +var childLogger2 = log.getLogger("child2"); +childLogger2.setDefaultLevel("TRACE"); +childLogger2.getLevel(); // TRACE + +log.setLevel("ERROR"); + +// At this point, the child loggers have not changed: +childLogger1.getLevel(); // WARN +childLogger2.getLevel(); // TRACE + +// To update them: +log.rebuild(); +childLogger1.getLevel(); // ERROR (still inheriting from root logger) +childLogger2.getLevel(); // TRACE (no longer inheriting because `.setDefaultLevel() was called`) +``` + +## Plugins + +### Existing plugins + +[loglevel-plugin-prefix](https://github.com/kutuluk/loglevel-plugin-prefix) - plugin for loglevel message prefixing. + +[loglevel-plugin-remote](https://github.com/kutuluk/loglevel-plugin-remote) - plugin for sending loglevel messages to a remote log server. + +[loglevel-serverSend](https://github.com/artemyarulin/loglevel-serverSend) - Forward your log messages to a remote server. + +[loglevel-debug](https://github.com/vectrlabs/loglevel-debug) - Control logging from a DEBUG environmental variable (similar to the classic [Debug](https://github.com/visionmedia/debug) module). + +### Writing plugins + +Loglevel provides a simple, reliable, minimal base for console logging that works everywhere. This means it doesn't include lots of fancy functionality that might be useful in some cases, such as log formatting and redirection (e.g. also sending log messages to a server over AJAX) + +Including that would increase the size and complexity of the library, but more importantly would remove stacktrace information. Currently log methods are either disabled, or enabled with directly bound versions of the `console.log` methods (where possible). This means your browser shows the log message as coming from your code at the call to `log.info("message!")` not from within loglevel, since it really calls the bound console method directly, without indirection. The indirection required to dynamically format, further filter, or redirect log messages would stop this. + +There's clearly enough enthusiasm for this even at that cost that loglevel now includes a plugin API. To use it, redefine `log.methodFactory(methodName, logLevel, loggerName)` with a function of your own. This will be called for each enabled method each time the level is set (including initially), and should return a function to be used for the given log method `methodName`, at the given _configured_ (not actual) level `logLevel`, for a logger with the given name `loggerName`. If you'd like to retain all the reliability and features of loglevel, we recommended that you wrap the initially provided value of `log.methodFactory`. + +For example, a plugin to prefix all log messages with "Newsflash: " would look like: + +```javascript +var originalFactory = log.methodFactory; +log.methodFactory = function (methodName, logLevel, loggerName) { + var rawMethod = originalFactory(methodName, logLevel, loggerName); + + return function (message) { + rawMethod("Newsflash: " + message); + }; +}; +log.rebuild(); // Be sure to call the rebuild method in order to apply plugin. +``` + +*(The above supports only a single string `log.warn("...")` argument for clarity, but it's easy to extend to a [fuller variadic version](http://jsbin.com/xehoye/edit?html,console).)* + +If you develop and release a plugin, please get in contact! I'd be happy to reference it here for future users. Some consistency is helpful; naming your plugin 'loglevel-PLUGINNAME' (e.g. loglevel-newsflash) is preferred, as is giving it the 'loglevel-plugin' keyword in your `package.json`. + +## Developing & Contributing + +In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. + +Builds can be run with npm: run `npm run dist` to build a distributable version of the project (in `dist/`), or `npm test` to just run the tests and linting. During development you can run `npm run watch` and it will monitor source files, and rerun the tests and linting as appropriate when they're changed. + +_Also, please don't manually edit files in the `dist/` subdirectory as they are generated via Grunt. You'll find source code in the `lib/` subdirectory!_ + +#### Release process + +To do a release of loglevel: + +* Update the version number in `package.json` and `bower.json`. +* Run `npm run dist` to build a distributable version in `dist/`. +* Update the release history in this file (below). +* Commit the built code, tagging it with the version number and a brief message about the release. +* Push to Github. +* Run `npm publish .` to publish to NPM. + +## Release History + +v0.1.0 - First working release with apparent compatibility with everything tested + +v0.2.0 - Updated release with various tweaks and polish and real proper documentation attached + +v0.3.0 - Some bugfixes ([#12](https://github.com/pimterry/loglevel/issues/12), [#14](https://github.com/pimterry/loglevel/issues/14)), cookie-based log level persistence, doc tweaks, support for Bower and JamJS + +v0.3.1 - Fixed incorrect text in release build banner, various other minor tweaks + +v0.4.0 - Use LocalStorage for level persistence if available, compatibility improvements for IE, improved error messages, multi-environment tests + +v0.5.0 - Fix for Modernizr+IE8 issues, improved setLevel error handling, support for auto-activation of desired logging when console eventually turns up in IE8 + +v0.6.0 - Handle logging in Safari private browsing mode ([#33](https://github.com/pimterry/loglevel/issues/33)), fix `TRACE` level persistence bug ([#35](https://github.com/pimterry/loglevel/issues/35)), plus various minor tweaks + +v1.0.0 - Official stable release! Fixed a bug with localStorage in Android webviews, improved CommonJS detection, and added `noConflict()`. + +v1.1.0 - Added support for including loglevel with preprocessing and `.apply()` ([#50](https://github.com/pimterry/loglevel/issues/50)), and fixed QUnit dep version which made tests potentially unstable. + +v1.2.0 - New plugin API! Plus various bits of refactoring and tidy up, nicely simplifying things and trimming the size down. + +v1.3.0 - Make persistence optional in `setLevel()`, plus lots of documentation updates and other small tweaks + +v1.3.1 - With the new optional persistence, stop unnecessarily persisting the initially set default level (`WARN`) + +v1.4.0 - Add `getLevel()`, `setDefaultLevel()` and `getLogger()` functionality for more fine-grained log level control + +v1.4.1 - Reorder UMD ([#92](https://github.com/pimterry/loglevel/issues/92)) to improve bundling tool compatibility + +v1.5.0 - Fix `log.debug` ([#111](https://github.com/pimterry/loglevel/issues/111)) after V8 changes deprecating console.debug, check for `window` upfront ([#104](https://github.com/pimterry/loglevel/issues/104)), and add `.log` alias for `.debug` ([#64](https://github.com/pimterry/loglevel/issues/64)) + +v1.5.1 - Fix bug ([#112](https://github.com/pimterry/loglevel/issues/112)) in level-persistence cookie fallback, which failed if it wasn't the first cookie present + +v1.6.0 - Add a name property to loggers and add `log.getLoggers()` ([#114](https://github.com/pimterry/loglevel/issues/114)), and recommend unpkg as CDN instead of CDNJS. + +v1.6.1 - Various small documentation & test updates + +v1.6.2 - Include TypeScript type definitions in the package itself + +v1.6.3 - Avoid TypeScript type conflicts with other global `log` types (e.g. `core-js`) + +v1.6.4 - Ensure `package.json`'s `"main"` is a fully qualified path, to fix webpack issues + +v1.6.5 - Ensure the provided message is included when calling `trace()` in IE11 + +v1.6.6 - Fix bugs in v1.6.5, which caused issues in node.js & IE < 9 + +v1.6.7 - Fix a bug in environments with `window` defined but no `window.navigator` + +v1.6.8 - Update TypeScript type definitions to include `log.log()`. + +v1.7.0 - Add support for Symbol-named loggers, and a `.default` property to help with ES6 module usage. + +v1.7.1 - Update TypeScript types to support Symbol-named loggers. + +v1.8.0 - Add `resetLevel()` method to clear persisted levels & reset to defaults + +v1.8.1 - Fix incorrect type definitions for `MethodFactory` + +v1.9.0 - Added `rebuild()` method, overhaul dev & test setup, and fix some bugs (notably around cookies) en route + +v1.9.1 - Fix a bug introduced in 1.9.0 that broke `setLevel()` in some ESM-focused runtime environments + +v1.9.2 - Remove unnecessarily extra test & CI files from deployed package + +## `loglevel` for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `loglevel` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-loglevel?utm_source=npm-loglevel&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## License + +Copyright (c) 2013 Tim Perry +Licensed under the MIT license. See [`LICENSE-MIT`](./LICENSE-MIT) for full license text. diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/_config.yml b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/_config.yml new file mode 100644 index 00000000..2f7efbea --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-minimal \ No newline at end of file diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/bower.json b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/bower.json new file mode 100644 index 00000000..ad6d8260 --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/bower.json @@ -0,0 +1,11 @@ +{ + "name": "loglevel", + "version": "1.9.2", + "main": "dist/loglevel.min.js", + "dependencies": {}, + "ignore": [ + "**/.*", + "node_modules", + "components" + ] +} diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/index.html b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/index.html new file mode 100644 index 00000000..a6bec9c4 --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/index.html @@ -0,0 +1,139 @@ + + + + + loglevel Demo + + + + + +
+

loglevel Demo

+
+ + log. + + (" + + ") + + +
+ More information... + Choose your level of logging and enter some text to output it to the console using logLevel. + Documentation for logging methods. +
+
+
+ + log.setLevel(" + + ", + + ) + + +
+ More information... + Disable all logging below the given level. + Documentation for setLevel(). +
+
+
+ + log.setDefaultLevel(" + + ") + + +
+ More information... + Select a level and run to set the default logging level. + Documentation for setDefaultLevel(). +
+
+
+ + log.resetLevel() + + +
+ More information... + Reset the current logging level to default. + Documentation for resetLevel(). +
+
+
+ + log.enableAll() + + +
+ More information... + Enables all logs - equivalent of setLevel('trace'). + Documentation for enableAll(). +
+
+
+ + log.disableAll() + + +
+ More information... + Disables all logs - equivalent of setLevel('silent'). + Documentation for disableAll(). +
+
+

Log State

+
+ +
+ More information... + Uses the getLevel() method to display the current log level. + Documentation for disableAll(). +
+
+
+ + + diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/script.js b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/script.js new file mode 100644 index 00000000..c8c92db0 --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/script.js @@ -0,0 +1,86 @@ +document.addEventListener('DOMContentLoaded', () => { + log.setDefaultLevel(log.levels.TRACE, false); + + const demoForm = document.getElementById('LogForm'); + const setLevelForm = document.getElementById('SetLevel'); + const setDefaultLevelForm = document.getElementById('SetDefaultLevel'); + const resetLevelButton = document.getElementById('ResetLevelButton'); + const enableAllButton = document.getElementById('EnableAllButton'); + const disableAllButton = document.getElementById('DisableAllButton'); + + if (demoForm) { + demoForm.addEventListener('submit', onSubmitDemoForm); + } + + if (setLevelForm) { + setLevelForm.addEventListener('submit', onSubmitSetLevelForm); + } + + if (setDefaultLevelForm) { + setDefaultLevelForm.addEventListener('submit', onSubmitSetDefaultLevelForm); + } + + if (resetLevelButton) { + resetLevelButton.addEventListener('click', () => { + log.resetLevel(); + updateLogStateForm(); + }); + } + + if (enableAllButton) { + enableAllButton.addEventListener('click', () => { + log.enableAll(); + updateLogStateForm(); + }); + } + + if (disableAllButton) { + disableAllButton.addEventListener('click', () => { + log.disableAll(); + updateLogStateForm(); + }); + } + + updateLogStateForm(); +}); + +function onSubmitDemoForm(event) { + event.preventDefault(); + + const form = event.currentTarget; + const formData = new FormData(form) + const debugMessage = formData.get('debugMessage'); + const logLevel = formData.get('logLevel'); + + if (debugMessage && logLevel) { + log[logLevel](debugMessage); + } +} + +function onSubmitSetLevelForm(event) { + event.preventDefault(); + + const form = event.currentTarget; + const formData = new FormData(form) + log.setLevel(parseInt(formData.get('level')), formData.get('persist') === 'true'); + updateLogStateForm(); +} + +function onSubmitSetDefaultLevelForm(event) { + event.preventDefault(); + + const form = event.currentTarget; + const formData = new FormData(form) + log.setDefaultLevel(parseInt(formData.get('level'))); + updateLogStateForm(); +} + +function updateLogStateForm() { + const logState = document.getElementById('LogState'); + + if (logState) { + const currentLevel = logState.querySelector('input[name="currentLevel"]'); + const logLevel = log.getLevel(); + currentLevel.value = Object.keys(log.levels).find(key => log.levels[key] === logLevel); + } +} diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/styles.css b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/styles.css new file mode 100644 index 00000000..cc682360 --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/demo/styles.css @@ -0,0 +1,107 @@ +* { + box-sizing: border-box; + font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + color: #161230; +} + +body { + font-size: 18px; + background-color: #fafafa; +} + +main { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 1rem; +} + +form { +} + +label { + display: flex; + gap: 0.5rem; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; +} + +input, +select, +button { + /* flex-grow: 1; */ + font-size: 1rem; + padding: 0.25rem; + border: 1px solid; + border-radius: 4px; +} + +input[type="checkbox"] { + width: 1.5rem; + height: 1.5rem; +} + +button { + cursor: pointer; + align-self: center; + padding: 0.5rem 1.5rem; + background-color: #161230; + color: #fafafa; + font-size: 1.5rem; +} + +summary { + cursor: pointer; +} + +code, +code > input, +code > select { + font-family: 'Courier New', Courier, monospace; + font-size: 1.5rem; +} + +code { + display: flex; + align-items: center; +} + +code input, +code select { + border-color: #a9b7c9; +} + +code button { + margin-left: 2rem; +} + +details { + width: 100%; +} + +summary { + margin-bottom: 0.5rem; +} + +details code { + display: inline-block; + font-size: 1.1rem; + margin-left: 0.2rem; + font-weight: 600; +} + +.code-container { + width: 80vw; + max-width: 800px; + display: flex; + justify-content: space-between; + align-items: center; + gap: 1rem; + border: 1px solid; + border-radius: 4px; + background-color: #eaf3ff; + padding: 1rem; + flex-wrap: wrap; +} diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.js b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.js new file mode 100644 index 00000000..a056e996 --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.js @@ -0,0 +1,352 @@ +/*! loglevel - v1.9.2 - https://github.com/pimterry/loglevel - (c) 2024 Tim Perry - licensed MIT */ +(function (root, definition) { + "use strict"; + if (typeof define === 'function' && define.amd) { + define(definition); + } else if (typeof module === 'object' && module.exports) { + module.exports = definition(); + } else { + root.log = definition(); + } +}(this, function () { + "use strict"; + + // Slightly dubious tricks to cut down minimized file size + var noop = function() {}; + var undefinedType = "undefined"; + var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && ( + /Trident\/|MSIE /.test(window.navigator.userAgent) + ); + + var logMethods = [ + "trace", + "debug", + "info", + "warn", + "error" + ]; + + var _loggersByName = {}; + var defaultLogger = null; + + // Cross-browser bind equivalent that works at least back to IE6 + function bindMethod(obj, methodName) { + var method = obj[methodName]; + if (typeof method.bind === 'function') { + return method.bind(obj); + } else { + try { + return Function.prototype.bind.call(method, obj); + } catch (e) { + // Missing bind shim or IE8 + Modernizr, fallback to wrapping + return function() { + return Function.prototype.apply.apply(method, [obj, arguments]); + }; + } + } + } + + // Trace() doesn't print the message in IE, so for that case we need to wrap it + function traceForIE() { + if (console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + // In old IE, native console methods themselves don't have apply(). + Function.prototype.apply.apply(console.log, [console, arguments]); + } + } + if (console.trace) console.trace(); + } + + // Build the best logging method possible for this env + // Wherever possible we want to bind, not wrap, to preserve stack traces + function realMethod(methodName) { + if (methodName === 'debug') { + methodName = 'log'; + } + + if (typeof console === undefinedType) { + return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives + } else if (methodName === 'trace' && isIE) { + return traceForIE; + } else if (console[methodName] !== undefined) { + return bindMethod(console, methodName); + } else if (console.log !== undefined) { + return bindMethod(console, 'log'); + } else { + return noop; + } + } + + // These private functions always need `this` to be set properly + + function replaceLoggingMethods() { + /*jshint validthis:true */ + var level = this.getLevel(); + + // Replace the actual methods. + for (var i = 0; i < logMethods.length; i++) { + var methodName = logMethods[i]; + this[methodName] = (i < level) ? + noop : + this.methodFactory(methodName, level, this.name); + } + + // Define log.log as an alias for log.debug + this.log = this.debug; + + // Return any important warnings. + if (typeof console === undefinedType && level < this.levels.SILENT) { + return "No console available for logging"; + } + } + + // In old IE versions, the console isn't present until you first open it. + // We build realMethod() replacements here that regenerate logging methods + function enableLoggingWhenConsoleArrives(methodName) { + return function () { + if (typeof console !== undefinedType) { + replaceLoggingMethods.call(this); + this[methodName].apply(this, arguments); + } + }; + } + + // By default, we use closely bound real methods wherever possible, and + // otherwise we wait for a console to appear, and then try again. + function defaultMethodFactory(methodName, _level, _loggerName) { + /*jshint validthis:true */ + return realMethod(methodName) || + enableLoggingWhenConsoleArrives.apply(this, arguments); + } + + function Logger(name, factory) { + // Private instance variables. + var self = this; + /** + * The level inherited from a parent logger (or a global default). We + * cache this here rather than delegating to the parent so that it stays + * in sync with the actual logging methods that we have installed (the + * parent could change levels but we might not have rebuilt the loggers + * in this child yet). + * @type {number} + */ + var inheritedLevel; + /** + * The default level for this logger, if any. If set, this overrides + * `inheritedLevel`. + * @type {number|null} + */ + var defaultLevel; + /** + * A user-specific level for this logger. If set, this overrides + * `defaultLevel`. + * @type {number|null} + */ + var userLevel; + + var storageKey = "loglevel"; + if (typeof name === "string") { + storageKey += ":" + name; + } else if (typeof name === "symbol") { + storageKey = undefined; + } + + function persistLevelIfPossible(levelNum) { + var levelName = (logMethods[levelNum] || 'silent').toUpperCase(); + + if (typeof window === undefinedType || !storageKey) return; + + // Use localStorage if available + try { + window.localStorage[storageKey] = levelName; + return; + } catch (ignore) {} + + // Use session cookie as fallback + try { + window.document.cookie = + encodeURIComponent(storageKey) + "=" + levelName + ";"; + } catch (ignore) {} + } + + function getPersistedLevel() { + var storedLevel; + + if (typeof window === undefinedType || !storageKey) return; + + try { + storedLevel = window.localStorage[storageKey]; + } catch (ignore) {} + + // Fallback to cookies if local storage gives us nothing + if (typeof storedLevel === undefinedType) { + try { + var cookie = window.document.cookie; + var cookieName = encodeURIComponent(storageKey); + var location = cookie.indexOf(cookieName + "="); + if (location !== -1) { + storedLevel = /^([^;]+)/.exec( + cookie.slice(location + cookieName.length + 1) + )[1]; + } + } catch (ignore) {} + } + + // If the stored level is not valid, treat it as if nothing was stored. + if (self.levels[storedLevel] === undefined) { + storedLevel = undefined; + } + + return storedLevel; + } + + function clearPersistedLevel() { + if (typeof window === undefinedType || !storageKey) return; + + // Use localStorage if available + try { + window.localStorage.removeItem(storageKey); + } catch (ignore) {} + + // Use session cookie as fallback + try { + window.document.cookie = + encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; + } catch (ignore) {} + } + + function normalizeLevel(input) { + var level = input; + if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) { + level = self.levels[level.toUpperCase()]; + } + if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) { + return level; + } else { + throw new TypeError("log.setLevel() called with invalid level: " + input); + } + } + + /* + * + * Public logger API - see https://github.com/pimterry/loglevel for details + * + */ + + self.name = name; + + self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3, + "ERROR": 4, "SILENT": 5}; + + self.methodFactory = factory || defaultMethodFactory; + + self.getLevel = function () { + if (userLevel != null) { + return userLevel; + } else if (defaultLevel != null) { + return defaultLevel; + } else { + return inheritedLevel; + } + }; + + self.setLevel = function (level, persist) { + userLevel = normalizeLevel(level); + if (persist !== false) { // defaults to true + persistLevelIfPossible(userLevel); + } + + // NOTE: in v2, this should call rebuild(), which updates children. + return replaceLoggingMethods.call(self); + }; + + self.setDefaultLevel = function (level) { + defaultLevel = normalizeLevel(level); + if (!getPersistedLevel()) { + self.setLevel(level, false); + } + }; + + self.resetLevel = function () { + userLevel = null; + clearPersistedLevel(); + replaceLoggingMethods.call(self); + }; + + self.enableAll = function(persist) { + self.setLevel(self.levels.TRACE, persist); + }; + + self.disableAll = function(persist) { + self.setLevel(self.levels.SILENT, persist); + }; + + self.rebuild = function () { + if (defaultLogger !== self) { + inheritedLevel = normalizeLevel(defaultLogger.getLevel()); + } + replaceLoggingMethods.call(self); + + if (defaultLogger === self) { + for (var childName in _loggersByName) { + _loggersByName[childName].rebuild(); + } + } + }; + + // Initialize all the internal levels. + inheritedLevel = normalizeLevel( + defaultLogger ? defaultLogger.getLevel() : "WARN" + ); + var initialLevel = getPersistedLevel(); + if (initialLevel != null) { + userLevel = normalizeLevel(initialLevel); + } + replaceLoggingMethods.call(self); + } + + /* + * + * Top-level API + * + */ + + defaultLogger = new Logger(); + + defaultLogger.getLogger = function getLogger(name) { + if ((typeof name !== "symbol" && typeof name !== "string") || name === "") { + throw new TypeError("You must supply a name when creating a logger."); + } + + var logger = _loggersByName[name]; + if (!logger) { + logger = _loggersByName[name] = new Logger( + name, + defaultLogger.methodFactory + ); + } + return logger; + }; + + // Grab the current global log variable in case of overwrite + var _log = (typeof window !== undefinedType) ? window.log : undefined; + defaultLogger.noConflict = function() { + if (typeof window !== undefinedType && + window.log === defaultLogger) { + window.log = _log; + } + + return defaultLogger; + }; + + defaultLogger.getLoggers = function getLoggers() { + return _loggersByName; + }; + + // ES6 default export, for compatibility + defaultLogger['default'] = defaultLogger; + + return defaultLogger; +})); diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.min.js b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.min.js new file mode 100644 index 00000000..ed747a2b --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/dist/loglevel.min.js @@ -0,0 +1,3 @@ +/*! loglevel - v1.9.2 - https://github.com/pimterry/loglevel - (c) 2024 Tim Perry - licensed MIT */ + +!function(e,o){"use strict";"function"==typeof define&&define.amd?define(o):"object"==typeof module&&module.exports?module.exports=o():e.log=o()}(this,function(){"use strict";var l=function(){},f="undefined",i=typeof window!==f&&typeof window.navigator!==f&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],p={},d=null;function r(o,e){var n=o[e];if("function"==typeof n.bind)return n.bind(o);try{return Function.prototype.bind.call(n,o)}catch(e){return function(){return Function.prototype.apply.apply(n,[o,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function v(){for(var e=this.getLevel(),o=0;o +// Gabor Szmetanko +// Christian Rackerseder + +declare const log: log.RootLogger; +export = log; + +declare namespace log { + /** + * Log levels + */ + interface LogLevel { + TRACE: 0; + DEBUG: 1; + INFO: 2; + WARN: 3; + ERROR: 4; + SILENT: 5; + } + + /** + * Possible log level numbers. + */ + type LogLevelNumbers = LogLevel[keyof LogLevel]; + + /** + * Possible log level descriptors, may be string, lower or upper case, or number. + */ + type LogLevelDesc = LogLevelNumbers | LogLevelNames | 'silent' | keyof LogLevel; + + type LogLevelNames = + | 'trace' + | 'debug' + | 'info' + | 'warn' + | 'error'; + + type LoggingMethod = (...message: any[]) => void; + + type MethodFactory = (methodName: LogLevelNames, level: LogLevelNumbers, loggerName: string | symbol) => LoggingMethod; + + interface RootLogger extends Logger { + /** + * If you're using another JavaScript library that exposes a 'log' global, you can run into conflicts with loglevel. + * Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded + * onto the page. This resets to 'log' global to its value before loglevel was loaded (typically undefined), and + * returns the loglevel object, which you can then bind to another name yourself. + */ + noConflict(): any; + + /** + * This gets you a new logger object that works exactly like the root log object, but can have its level and + * logging methods set independently. All loggers must have a name (which is a non-empty string or a symbol) + * Calling * getLogger() multiple times with the same name will return an identical logger object. + * In large applications, it can be incredibly useful to turn logging on and off for particular modules as you are + * working with them. Using the getLogger() method lets you create a separate logger for each part of your + * application with its own logging level. Likewise, for small, independent modules, using a named logger instead + * of the default root logger allows developers using your module to selectively turn on deep, trace-level logging + * when trying to debug problems, while logging only errors or silencing logging altogether under normal + * circumstances. + * @param name The name of the produced logger + */ + getLogger(name: string | symbol): Logger; + + /** + * This will return you the dictionary of all loggers created with getLogger, keyed off of their names. + */ + getLoggers(): { [name: string]: Logger }; + + /** + * A .default property for ES6 default import compatibility + */ + default: RootLogger; + } + + interface Logger { + /** + * Available log levels. + */ + readonly levels: LogLevel; + + /** + * Plugin API entry point. This will be called for each enabled method each time the level is set + * (including initially), and should return a MethodFactory to be used for the given log method, at the given level, + * for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's + * recommended that this wraps the initially provided value of log.methodFactory + */ + methodFactory: MethodFactory; + + /** + * Output trace message to console. + * This will also include a full stack trace + * + * @param msg any data to log to the console + */ + trace(...msg: any[]): void; + + /** + * Output debug message to console including appropriate icons + * + * @param msg any data to log to the console + */ + debug(...msg: any[]): void; + + /** + * Output debug message to console including appropriate icons + * + * @param msg any data to log to the console + */ + log(...msg: any[]): void; + + /** + * Output info message to console including appropriate icons + * + * @param msg any data to log to the console + */ + info(...msg: any[]): void; + + /** + * Output warn message to console including appropriate icons + * + * @param msg any data to log to the console + */ + warn(...msg: any[]): void; + + /** + * Output error message to console including appropriate icons + * + * @param msg any data to log to the console + */ + error(...msg: any[]): void; + + /** + * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") + * or log.error("something") will output messages, but log.info("something") will not. + * + * @param level as a string, like 'error' (case-insensitive) or as a number from 0 to 5 (or as log.levels. values) + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling + * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + setLevel(level: LogLevelDesc, persist?: boolean): void; + + /** + * Returns the current logging level, as a value from LogLevel. + * It's very unlikely you'll need to use this for normal application logging; it's provided partly to help plugin + * development, and partly to let you optimize logging code as below, where debug data is only generated if the + * level is set such that it'll actually be logged. This probably doesn't affect you, unless you've run profiling + * on your code and you have hard numbers telling you that your log data generation is a real performance problem. + */ + getLevel(): LogLevel[keyof LogLevel]; + + /** + * This sets the current log level only if one has not been persisted and can’t be loaded. This is useful when + * initializing scripts; if a developer or user has previously called setLevel(), this won’t alter their settings. + * For example, your application might set the log level to error in a production environment, but when debugging + * an issue, you might call setLevel("trace") on the console to see all the logs. If that error setting was set + * using setDefaultLevel(), it will still say as trace on subsequent page loads and refreshes instead of resetting + * to error. + * + * The level argument takes is the same values that you might pass to setLevel(). Levels set using + * setDefaultLevel() never persist to subsequent page loads. + * + * @param level as a string, like 'error' (case-insensitive) or as a number from 0 to 5 (or as log.levels. values) + */ + setDefaultLevel(level: LogLevelDesc): void; + + /** + * This resets the current log level to the default level (or `warn` if no explicit default was set) and clears + * the persisted level if one was previously persisted. + */ + resetLevel(): void; + + /** + * This enables all log messages, and is equivalent to log.setLevel("trace"). + * + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling + * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + enableAll(persist?: boolean): void; + + /** + * This disables all log messages, and is equivalent to log.setLevel("silent"). + * + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling + * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + disableAll(persist?: boolean): void; + + /** + * Rebuild the logging methods on this logger and its child loggers. + * + * This is mostly intended for plugin developers, but can be useful if you update a logger's `methodFactory` or + * if you want to apply the root logger’s level to any *pre-existing* child loggers (this updates the level on + * any child logger that hasn't used `setLevel()` or `setDefaultLevel()`). + */ + rebuild(): void; + } +} diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/lib/loglevel.js b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/lib/loglevel.js new file mode 100644 index 00000000..307ab2fe --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/lib/loglevel.js @@ -0,0 +1,357 @@ +/* +* loglevel - https://github.com/pimterry/loglevel +* +* Copyright (c) 2013 Tim Perry +* Licensed under the MIT license. +*/ +(function (root, definition) { + "use strict"; + if (typeof define === 'function' && define.amd) { + define(definition); + } else if (typeof module === 'object' && module.exports) { + module.exports = definition(); + } else { + root.log = definition(); + } +}(this, function () { + "use strict"; + + // Slightly dubious tricks to cut down minimized file size + var noop = function() {}; + var undefinedType = "undefined"; + var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && ( + /Trident\/|MSIE /.test(window.navigator.userAgent) + ); + + var logMethods = [ + "trace", + "debug", + "info", + "warn", + "error" + ]; + + var _loggersByName = {}; + var defaultLogger = null; + + // Cross-browser bind equivalent that works at least back to IE6 + function bindMethod(obj, methodName) { + var method = obj[methodName]; + if (typeof method.bind === 'function') { + return method.bind(obj); + } else { + try { + return Function.prototype.bind.call(method, obj); + } catch (e) { + // Missing bind shim or IE8 + Modernizr, fallback to wrapping + return function() { + return Function.prototype.apply.apply(method, [obj, arguments]); + }; + } + } + } + + // Trace() doesn't print the message in IE, so for that case we need to wrap it + function traceForIE() { + if (console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + // In old IE, native console methods themselves don't have apply(). + Function.prototype.apply.apply(console.log, [console, arguments]); + } + } + if (console.trace) console.trace(); + } + + // Build the best logging method possible for this env + // Wherever possible we want to bind, not wrap, to preserve stack traces + function realMethod(methodName) { + if (methodName === 'debug') { + methodName = 'log'; + } + + if (typeof console === undefinedType) { + return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives + } else if (methodName === 'trace' && isIE) { + return traceForIE; + } else if (console[methodName] !== undefined) { + return bindMethod(console, methodName); + } else if (console.log !== undefined) { + return bindMethod(console, 'log'); + } else { + return noop; + } + } + + // These private functions always need `this` to be set properly + + function replaceLoggingMethods() { + /*jshint validthis:true */ + var level = this.getLevel(); + + // Replace the actual methods. + for (var i = 0; i < logMethods.length; i++) { + var methodName = logMethods[i]; + this[methodName] = (i < level) ? + noop : + this.methodFactory(methodName, level, this.name); + } + + // Define log.log as an alias for log.debug + this.log = this.debug; + + // Return any important warnings. + if (typeof console === undefinedType && level < this.levels.SILENT) { + return "No console available for logging"; + } + } + + // In old IE versions, the console isn't present until you first open it. + // We build realMethod() replacements here that regenerate logging methods + function enableLoggingWhenConsoleArrives(methodName) { + return function () { + if (typeof console !== undefinedType) { + replaceLoggingMethods.call(this); + this[methodName].apply(this, arguments); + } + }; + } + + // By default, we use closely bound real methods wherever possible, and + // otherwise we wait for a console to appear, and then try again. + function defaultMethodFactory(methodName, _level, _loggerName) { + /*jshint validthis:true */ + return realMethod(methodName) || + enableLoggingWhenConsoleArrives.apply(this, arguments); + } + + function Logger(name, factory) { + // Private instance variables. + var self = this; + /** + * The level inherited from a parent logger (or a global default). We + * cache this here rather than delegating to the parent so that it stays + * in sync with the actual logging methods that we have installed (the + * parent could change levels but we might not have rebuilt the loggers + * in this child yet). + * @type {number} + */ + var inheritedLevel; + /** + * The default level for this logger, if any. If set, this overrides + * `inheritedLevel`. + * @type {number|null} + */ + var defaultLevel; + /** + * A user-specific level for this logger. If set, this overrides + * `defaultLevel`. + * @type {number|null} + */ + var userLevel; + + var storageKey = "loglevel"; + if (typeof name === "string") { + storageKey += ":" + name; + } else if (typeof name === "symbol") { + storageKey = undefined; + } + + function persistLevelIfPossible(levelNum) { + var levelName = (logMethods[levelNum] || 'silent').toUpperCase(); + + if (typeof window === undefinedType || !storageKey) return; + + // Use localStorage if available + try { + window.localStorage[storageKey] = levelName; + return; + } catch (ignore) {} + + // Use session cookie as fallback + try { + window.document.cookie = + encodeURIComponent(storageKey) + "=" + levelName + ";"; + } catch (ignore) {} + } + + function getPersistedLevel() { + var storedLevel; + + if (typeof window === undefinedType || !storageKey) return; + + try { + storedLevel = window.localStorage[storageKey]; + } catch (ignore) {} + + // Fallback to cookies if local storage gives us nothing + if (typeof storedLevel === undefinedType) { + try { + var cookie = window.document.cookie; + var cookieName = encodeURIComponent(storageKey); + var location = cookie.indexOf(cookieName + "="); + if (location !== -1) { + storedLevel = /^([^;]+)/.exec( + cookie.slice(location + cookieName.length + 1) + )[1]; + } + } catch (ignore) {} + } + + // If the stored level is not valid, treat it as if nothing was stored. + if (self.levels[storedLevel] === undefined) { + storedLevel = undefined; + } + + return storedLevel; + } + + function clearPersistedLevel() { + if (typeof window === undefinedType || !storageKey) return; + + // Use localStorage if available + try { + window.localStorage.removeItem(storageKey); + } catch (ignore) {} + + // Use session cookie as fallback + try { + window.document.cookie = + encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; + } catch (ignore) {} + } + + function normalizeLevel(input) { + var level = input; + if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) { + level = self.levels[level.toUpperCase()]; + } + if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) { + return level; + } else { + throw new TypeError("log.setLevel() called with invalid level: " + input); + } + } + + /* + * + * Public logger API - see https://github.com/pimterry/loglevel for details + * + */ + + self.name = name; + + self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3, + "ERROR": 4, "SILENT": 5}; + + self.methodFactory = factory || defaultMethodFactory; + + self.getLevel = function () { + if (userLevel != null) { + return userLevel; + } else if (defaultLevel != null) { + return defaultLevel; + } else { + return inheritedLevel; + } + }; + + self.setLevel = function (level, persist) { + userLevel = normalizeLevel(level); + if (persist !== false) { // defaults to true + persistLevelIfPossible(userLevel); + } + + // NOTE: in v2, this should call rebuild(), which updates children. + return replaceLoggingMethods.call(self); + }; + + self.setDefaultLevel = function (level) { + defaultLevel = normalizeLevel(level); + if (!getPersistedLevel()) { + self.setLevel(level, false); + } + }; + + self.resetLevel = function () { + userLevel = null; + clearPersistedLevel(); + replaceLoggingMethods.call(self); + }; + + self.enableAll = function(persist) { + self.setLevel(self.levels.TRACE, persist); + }; + + self.disableAll = function(persist) { + self.setLevel(self.levels.SILENT, persist); + }; + + self.rebuild = function () { + if (defaultLogger !== self) { + inheritedLevel = normalizeLevel(defaultLogger.getLevel()); + } + replaceLoggingMethods.call(self); + + if (defaultLogger === self) { + for (var childName in _loggersByName) { + _loggersByName[childName].rebuild(); + } + } + }; + + // Initialize all the internal levels. + inheritedLevel = normalizeLevel( + defaultLogger ? defaultLogger.getLevel() : "WARN" + ); + var initialLevel = getPersistedLevel(); + if (initialLevel != null) { + userLevel = normalizeLevel(initialLevel); + } + replaceLoggingMethods.call(self); + } + + /* + * + * Top-level API + * + */ + + defaultLogger = new Logger(); + + defaultLogger.getLogger = function getLogger(name) { + if ((typeof name !== "symbol" && typeof name !== "string") || name === "") { + throw new TypeError("You must supply a name when creating a logger."); + } + + var logger = _loggersByName[name]; + if (!logger) { + logger = _loggersByName[name] = new Logger( + name, + defaultLogger.methodFactory + ); + } + return logger; + }; + + // Grab the current global log variable in case of overwrite + var _log = (typeof window !== undefinedType) ? window.log : undefined; + defaultLogger.noConflict = function() { + if (typeof window !== undefinedType && + window.log === defaultLogger) { + window.log = _log; + } + + return defaultLogger; + }; + + defaultLogger.getLoggers = function getLoggers() { + return _loggersByName; + }; + + // ES6 default export, for compatibility + defaultLogger['default'] = defaultLogger; + + return defaultLogger; +})); diff --git a/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/package.json b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/package.json new file mode 100644 index 00000000..565008cb --- /dev/null +++ b/backend/node_modules/.pnpm/loglevel@1.9.2/node_modules/loglevel/package.json @@ -0,0 +1,63 @@ +{ + "name": "loglevel", + "description": "Minimal lightweight logging for JavaScript, adding reliable log level methods to any available console.log methods", + "version": "1.9.2", + "homepage": "https://github.com/pimterry/loglevel", + "author": { + "name": "Tim Perry", + "email": "pimterry@gmail.com", + "url": "http://tim-perry.co.uk" + }, + "repository": { + "type": "git", + "url": "git://github.com/pimterry/loglevel.git" + }, + "bugs": { + "url": "https://github.com/pimterry/loglevel/issues" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + }, + "license": "MIT", + "main": "lib/loglevel.js", + "types": "./index.d.ts", + "engines": { + "node": ">= 0.6.0" + }, + "scripts": { + "lint": "grunt jshint", + "test": "grunt test && npm run test-types", + "test-browser": "grunt test-browser", + "test-node": "grunt test-node", + "test-types": "tsc --noEmit ./test/type-test.ts && ts-node ./test/type-test.ts", + "dist": "grunt dist", + "dist-build": "grunt dist-build", + "watch": "grunt watch" + }, + "dependencies": {}, + "devDependencies": { + "@types/core-js": "2.5.0", + "@types/node": "^12.0.4", + "grunt": "~1.5.3", + "grunt-cli": "^1.4.3", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-concat": "~0.5.0", + "grunt-contrib-connect": "^3.0.0", + "grunt-contrib-jasmine": "^4.0.0", + "grunt-contrib-jshint": "^3.2.0", + "grunt-contrib-uglify": "^3.4.0", + "grunt-contrib-watch": "^1.1.0", + "grunt-open": "~0.2.3", + "grunt-preprocess": "^5.1.0", + "jasmine": "^2.4.1", + "ts-node": "^10.9.2", + "typescript": "^3.5.1" + }, + "keywords": [ + "log", + "logger", + "logging", + "browser" + ] +} diff --git a/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/LICENSE b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/LICENSE new file mode 100644 index 00000000..75b52484 --- /dev/null +++ b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/LICENSE @@ -0,0 +1,202 @@ + + 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/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/README.md b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/README.md new file mode 100644 index 00000000..979517f8 --- /dev/null +++ b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/README.md @@ -0,0 +1,246 @@ +long.js +======= + +A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library) +for stand-alone use and extended with unsigned support. + +[![Build Status](https://travis-ci.org/dcodeIO/long.js.svg)](https://travis-ci.org/dcodeIO/long.js) + +Background +---------- + +As of [ECMA-262 5th Edition](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), "all the positive and negative integers +whose magnitude is no greater than 253 are representable in the Number type", which is "representing the +doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic". +The [maximum safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) +in JavaScript is 253-1. + +Example: 264-1 is 1844674407370955**1615** but in JavaScript it evaluates to 1844674407370955**2000**. + +Furthermore, bitwise operators in JavaScript "deal only with integers in the range −231 through +231−1, inclusive, or in the range 0 through 232−1, inclusive. These operators accept any value of +the Number type but first convert each such value to one of 232 integer values." + +In some use cases, however, it is required to be able to reliably work with and perform bitwise operations on the full +64 bits. This is where long.js comes into play. + +Usage +----- + +The class is compatible with CommonJS and AMD loaders and is exposed globally as `Long` if neither is available. + +```javascript +var Long = require("long"); + +var longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF); + +console.log(longVal.toString()); +... +``` + +API +--- + +### Constructor + +* new **Long**(low: `number`, high: `number`, unsigned?: `boolean`)
+ Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. See the from* functions below for more convenient ways of constructing Longs. + +### Fields + +* Long#**low**: `number`
+ The low 32 bits as a signed value. + +* Long#**high**: `number`
+ The high 32 bits as a signed value. + +* Long#**unsigned**: `boolean`
+ Whether unsigned or not. + +### Constants + +* Long.**ZERO**: `Long`
+ Signed zero. + +* Long.**ONE**: `Long`
+ Signed one. + +* Long.**NEG_ONE**: `Long`
+ Signed negative one. + +* Long.**UZERO**: `Long`
+ Unsigned zero. + +* Long.**UONE**: `Long`
+ Unsigned one. + +* Long.**MAX_VALUE**: `Long`
+ Maximum signed value. + +* Long.**MIN_VALUE**: `Long`
+ Minimum signed value. + +* Long.**MAX_UNSIGNED_VALUE**: `Long`
+ Maximum unsigned value. + +### Utility + +* Long.**isLong**(obj: `*`): `boolean`
+ Tests if the specified object is a Long. + +* Long.**fromBits**(lowBits: `number`, highBits: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + +* Long.**fromBytes**(bytes: `number[]`, unsigned?: `boolean`, le?: `boolean`): `Long`
+ Creates a Long from its byte representation. + +* Long.**fromBytesLE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
+ Creates a Long from its little endian byte representation. + +* Long.**fromBytesBE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
+ Creates a Long from its big endian byte representation. + +* Long.**fromInt**(value: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the given 32 bit integer value. + +* Long.**fromNumber**(value: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + +* Long.**fromString**(str: `string`, unsigned?: `boolean`, radix?: `number`)
+ Long.**fromString**(str: `string`, radix: `number`)
+ Returns a Long representation of the given string, written using the specified radix. + +* Long.**fromValue**(val: `*`, unsigned?: `boolean`): `Long`
+ Converts the specified value to a Long using the appropriate from* function for its type. + +### Methods + +* Long#**add**(addend: `Long | number | string`): `Long`
+ Returns the sum of this and the specified Long. + +* Long#**and**(other: `Long | number | string`): `Long`
+ Returns the bitwise AND of this Long and the specified. + +* Long#**compare**/**comp**(other: `Long | number | string`): `number`
+ Compares this Long's value with the specified's. Returns `0` if they are the same, `1` if the this is greater and `-1` if the given one is greater. + +* Long#**divide**/**div**(divisor: `Long | number | string`): `Long`
+ Returns this Long divided by the specified. + +* Long#**equals**/**eq**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value equals the specified's. + +* Long#**getHighBits**(): `number`
+ Gets the high 32 bits as a signed integer. + +* Long#**getHighBitsUnsigned**(): `number`
+ Gets the high 32 bits as an unsigned integer. + +* Long#**getLowBits**(): `number`
+ Gets the low 32 bits as a signed integer. + +* Long#**getLowBitsUnsigned**(): `number`
+ Gets the low 32 bits as an unsigned integer. + +* Long#**getNumBitsAbs**(): `number`
+ Gets the number of bits needed to represent the absolute value of this Long. + +* Long#**greaterThan**/**gt**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is greater than the specified's. + +* Long#**greaterThanOrEqual**/**gte**/**ge**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is greater than or equal the specified's. + +* Long#**isEven**(): `boolean`
+ Tests if this Long's value is even. + +* Long#**isNegative**(): `boolean`
+ Tests if this Long's value is negative. + +* Long#**isOdd**(): `boolean`
+ Tests if this Long's value is odd. + +* Long#**isPositive**(): `boolean`
+ Tests if this Long's value is positive. + +* Long#**isZero**/**eqz**(): `boolean`
+ Tests if this Long's value equals zero. + +* Long#**lessThan**/**lt**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is less than the specified's. + +* Long#**lessThanOrEqual**/**lte**/**le**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value is less than or equal the specified's. + +* Long#**modulo**/**mod**/**rem**(divisor: `Long | number | string`): `Long`
+ Returns this Long modulo the specified. + +* Long#**multiply**/**mul**(multiplier: `Long | number | string`): `Long`
+ Returns the product of this and the specified Long. + +* Long#**negate**/**neg**(): `Long`
+ Negates this Long's value. + +* Long#**not**(): `Long`
+ Returns the bitwise NOT of this Long. + +* Long#**notEquals**/**neq**/**ne**(other: `Long | number | string`): `boolean`
+ Tests if this Long's value differs from the specified's. + +* Long#**or**(other: `Long | number | string`): `Long`
+ Returns the bitwise OR of this Long and the specified. + +* Long#**shiftLeft**/**shl**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits shifted to the left by the given amount. + +* Long#**shiftRight**/**shr**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits arithmetically shifted to the right by the given amount. + +* Long#**shiftRightUnsigned**/**shru**/**shr_u**(numBits: `Long | number | string`): `Long`
+ Returns this Long with bits logically shifted to the right by the given amount. + +* Long#**subtract**/**sub**(subtrahend: `Long | number | string`): `Long`
+ Returns the difference of this and the specified Long. + +* Long#**toBytes**(le?: `boolean`): `number[]`
+ Converts this Long to its byte representation. + +* Long#**toBytesLE**(): `number[]`
+ Converts this Long to its little endian byte representation. + +* Long#**toBytesBE**(): `number[]`
+ Converts this Long to its big endian byte representation. + +* Long#**toInt**(): `number`
+ Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + +* Long#**toNumber**(): `number`
+ Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + +* Long#**toSigned**(): `Long`
+ Converts this Long to signed. + +* Long#**toString**(radix?: `number`): `string`
+ Converts the Long to a string written in the specified radix. + +* Long#**toUnsigned**(): `Long`
+ Converts this Long to unsigned. + +* Long#**xor**(other: `Long | number | string`): `Long`
+ Returns the bitwise XOR of this Long and the given one. + +Building +-------- + +To build an UMD bundle to `dist/long.js`, run: + +``` +$> npm install +$> npm run build +``` + +Running the [tests](./tests): + +``` +$> npm test +``` diff --git a/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js new file mode 100644 index 00000000..93458930 --- /dev/null +++ b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js @@ -0,0 +1,2 @@ +!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.Long=i():t.Long=i()}("undefined"!=typeof self?self:this,function(){return function(t){function i(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}var n={};return i.m=t,i.c=n,i.d=function(t,n,e){i.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:e})},i.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(n,"a",n),n},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="",i(i.s=0)}([function(t,i){function n(t,i,n){this.low=0|t,this.high=0|i,this.unsigned=!!n}function e(t){return!0===(t&&t.__isLong__)}function r(t,i){var n,e,r;return i?(t>>>=0,(r=0<=t&&t<256)&&(e=l[t])?e:(n=h(t,(0|t)<0?-1:0,!0),r&&(l[t]=n),n)):(t|=0,(r=-128<=t&&t<128)&&(e=f[t])?e:(n=h(t,t<0?-1:0,!1),r&&(f[t]=n),n))}function s(t,i){if(isNaN(t))return i?p:m;if(i){if(t<0)return p;if(t>=c)return q}else{if(t<=-v)return _;if(t+1>=v)return E}return t<0?s(-t,i).neg():h(t%d|0,t/d|0,i)}function h(t,i,e){return new n(t,i,e)}function u(t,i,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return m;if("number"==typeof i?(n=i,i=!1):i=!!i,(n=n||10)<2||360)throw Error("interior hyphen");if(0===e)return u(t.substring(1),i,n).neg();for(var r=s(a(n,8)),h=m,o=0;o>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(t){if((t=t||10)<2||36>>0,f=g.toString(t);if(h=o,h.isZero())return f+u;for(;f.length<6;)f="0"+f;u=""+f+u}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,i=31;i>0&&0==(t&1<=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.equals=function(t){return e(t)||(t=o(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},B.eq=B.equals,B.notEquals=function(t){return!this.eq(t)},B.neq=B.notEquals,B.ne=B.notEquals,B.lessThan=function(t){return this.comp(t)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(t){return this.comp(t)<=0},B.lte=B.lessThanOrEqual,B.le=B.lessThanOrEqual,B.greaterThan=function(t){return this.comp(t)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(t){return this.comp(t)>=0},B.gte=B.greaterThanOrEqual,B.ge=B.greaterThanOrEqual,B.compare=function(t){if(e(t)||(t=o(t)),this.eq(t))return 0;var i=this.isNegative(),n=t.isNegative();return i&&!n?-1:!i&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(y)},B.neg=B.negate,B.add=function(t){e(t)||(t=o(t));var i=this.high>>>16,n=65535&this.high,r=this.low>>>16,s=65535&this.low,u=t.high>>>16,g=65535&t.high,f=t.low>>>16,l=65535&t.low,a=0,d=0,c=0,v=0;return v+=s+l,c+=v>>>16,v&=65535,c+=r+f,d+=c>>>16,c&=65535,d+=n+g,a+=d>>>16,d&=65535,a+=i+u,a&=65535,h(c<<16|v,a<<16|d,this.unsigned)},B.subtract=function(t){return e(t)||(t=o(t)),this.add(t.neg())},B.sub=B.subtract,B.multiply=function(t){if(this.isZero())return m;if(e(t)||(t=o(t)),g){return h(g.mul(this.low,this.high,t.low,t.high),g.get_high(),this.unsigned)}if(t.isZero())return m;if(this.eq(_))return t.isOdd()?_:m;if(t.eq(_))return this.isOdd()?_:m;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(w)&&t.lt(w))return s(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=65535&this.high,r=this.low>>>16,u=65535&this.low,f=t.high>>>16,l=65535&t.high,a=t.low>>>16,d=65535&t.low,c=0,v=0,p=0,y=0;return y+=u*d,p+=y>>>16,y&=65535,p+=r*d,v+=p>>>16,p&=65535,p+=u*a,v+=p>>>16,p&=65535,v+=n*d,c+=v>>>16,v&=65535,v+=r*a,c+=v>>>16,v&=65535,v+=u*l,c+=v>>>16,v&=65535,c+=i*d+n*a+r*l+u*f,c&=65535,h(p<<16|y,c<<16|v,this.unsigned)},B.mul=B.multiply,B.divide=function(t){if(e(t)||(t=o(t)),t.isZero())throw Error("division by zero");if(g){if(!this.unsigned&&-2147483648===this.high&&-1===t.low&&-1===t.high)return this;return h((this.unsigned?g.div_u:g.div_s)(this.low,this.high,t.low,t.high),g.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?p:m;var i,n,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return p;if(t.gt(this.shru(1)))return b;r=p}else{if(this.eq(_)){if(t.eq(y)||t.eq(N))return _;if(t.eq(_))return y;return i=this.shr(1).div(t).shl(1),i.eq(m)?t.isNegative()?y:N:(n=this.sub(t.mul(i)),r=i.add(n.div(t)))}if(t.eq(_))return this.unsigned?p:m;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();r=m}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var u=Math.ceil(Math.log(i)/Math.LN2),f=u<=48?1:a(2,u-48),l=s(i),d=l.mul(t);d.isNegative()||d.gt(n);)i-=f,l=s(i,this.unsigned),d=l.mul(t);l.isZero()&&(l=y),r=r.add(l),n=n.sub(d)}return r},B.div=B.divide,B.modulo=function(t){if(e(t)||(t=o(t)),g){return h((this.unsigned?g.rem_u:g.rem_s)(this.low,this.high,t.low,t.high),g.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},B.mod=B.modulo,B.rem=B.modulo,B.not=function(){return h(~this.low,~this.high,this.unsigned)},B.and=function(t){return e(t)||(t=o(t)),h(this.low&t.low,this.high&t.high,this.unsigned)},B.or=function(t){return e(t)||(t=o(t)),h(this.low|t.low,this.high|t.high,this.unsigned)},B.xor=function(t){return e(t)||(t=o(t)),h(this.low^t.low,this.high^t.high,this.unsigned)},B.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?h(this.low<>>32-t,this.unsigned):h(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):h(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var i=this.high;if(t<32){return h(this.low>>>t|i<<32-t,i>>>t,this.unsigned)}return 32===t?h(i,0,this.unsigned):h(i>>>t-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.shr_u=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?h(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:h(this.low,this.high,!0)},B.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var t=this.high,i=this.low;return[255&i,i>>>8&255,i>>>16&255,i>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},B.toBytesBE=function(){var t=this.high,i=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,i>>>24,i>>>16&255,i>>>8&255,255&i]},n.fromBytes=function(t,i,e){return e?n.fromBytesLE(t,i):n.fromBytesBE(t,i)},n.fromBytesLE=function(t,i){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,i)},n.fromBytesBE=function(t,i){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],i)}}])}); +//# sourceMappingURL=long.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js.map b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js.map new file mode 100644 index 00000000..2fe279fb --- /dev/null +++ b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/dist/long.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///long.js","webpack:///webpack/bootstrap d8921b8c3ad0790b3cc1","webpack:///./src/long.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","Long","low","high","unsigned","isLong","obj","fromInt","value","cachedObj","cache","UINT_CACHE","fromBits","INT_CACHE","fromNumber","isNaN","UZERO","ZERO","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","TWO_PWR_63_DBL","MIN_VALUE","MAX_VALUE","neg","TWO_PWR_32_DBL","lowBits","highBits","fromString","str","radix","length","Error","RangeError","indexOf","substring","radixToPower","pow_dbl","result","size","Math","min","parseInt","power","mul","add","fromValue","val","wasm","WebAssembly","Instance","Module","Uint8Array","e","__isLong__","pow","TWO_PWR_16_DBL","TWO_PWR_24","ONE","UONE","NEG_ONE","LongPrototype","toInt","toNumber","toString","isZero","isNegative","eq","radixLong","div","rem1","sub","rem","remDiv","intval","digits","getHighBits","getHighBitsUnsigned","getLowBits","getLowBitsUnsigned","getNumBitsAbs","bit","eqz","isPositive","isOdd","isEven","equals","other","notEquals","neq","ne","lessThan","comp","lt","lessThanOrEqual","lte","le","greaterThan","gt","greaterThanOrEqual","gte","ge","compare","thisNeg","otherNeg","negate","not","addend","a48","a32","a16","a00","b48","b32","b16","b00","c48","c32","c16","c00","subtract","subtrahend","multiply","multiplier","get_high","divide","divisor","div_u","div_s","approx","res","toUnsigned","shru","shr","shl","max","floor","log2","ceil","log","LN2","delta","approxRes","approxRem","modulo","rem_u","rem_s","mod","and","or","xor","shiftLeft","numBits","shiftRight","shiftRightUnsigned","shr_u","toSigned","toBytes","toBytesLE","toBytesBE","hi","lo","fromBytes","bytes","fromBytesLE","fromBytesBE"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,KAAAD,IAEAD,EAAA,KAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAU,GAAA,EAGAV,EAAAD,QAvBA,GAAAS,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAA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,KAAA8B,UAEAQ,EAAAT,IAAAoJ,EAAA,KAAAjL,KAAA8B,WAUAwD,EAAAuE,KAAAvE,EAAA6F,mBAQA7F,EAAA8F,MAAA9F,EAAA6F,mBAMA7F,EAAA+F,SAAA,WACA,MAAArL,MAAA8B,SAEAQ,EAAAtC,KAAA4B,IAAA5B,KAAA6B,MAAA,GADA7B,MAQAsF,EAAAsE,WAAA,WACA,MAAA5J,MAAA8B,SACA9B,KACAsC,EAAAtC,KAAA4B,IAAA5B,KAAA6B,MAAA,IAQAyD,EAAAgG,QAAA,SAAA7D,GACA,MAAAA,GAAAzH,KAAAuL,YAAAvL,KAAAwL,aAOAlG,EAAAiG,UAAA,WACA,GAAAE,GAAAzL,KAAA6B,KACA6J,EAAA1L,KAAA4B,GACA,QACA,IAAA8J,EACAA,IAAA,MACAA,IAAA,OACAA,IAAA,GACA,IAAAD,EACAA,IAAA,MACAA,IAAA,OACAA,IAAA,KAQAnG,EAAAkG,UAAA,WACA,GAAAC,GAAAzL,KAAA6B,KACA6J,EAAA1L,KAAA4B,GACA,QACA6J,IAAA,GACAA,IAAA,OACAA,IAAA,MACA,IAAAA,EACAC,IAAA,GACAA,IAAA,OACAA,IAAA,MACA,IAAAA,IAWA/J,EAAAgK,UAAA,SAAAC,EAAA9J,EAAA2F,GACA,MAAAA,GAAA9F,EAAAkK,YAAAD,EAAA9J,GAAAH,EAAAmK,YAAAF,EAAA9J,IASAH,EAAAkK,YAAA,SAAAD,EAAA9J,GACA,UAAAH,GACAiK,EAAA,GACAA,EAAA,MACAA,EAAA,OACAA,EAAA,OACAA,EAAA,GACAA,EAAA,MACAA,EAAA,OACAA,EAAA,OACA9J,IAUAH,EAAAmK,YAAA,SAAAF,EAAA9J,GACA,UAAAH,GACAiK,EAAA,OACAA,EAAA,OACAA,EAAA,MACAA,EAAA,GACAA,EAAA,OACAA,EAAA,OACAA,EAAA,MACAA,EAAA,GACA9J","file":"long.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Long\"] = factory();\n\telse\n\t\troot[\"Long\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Long\"] = factory();\n\telse\n\t\troot[\"Long\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// long.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d8921b8c3ad0790b3cc1","module.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/long.js\n// module id = 0\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/index.js b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/index.js new file mode 100644 index 00000000..46f63416 --- /dev/null +++ b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/index.js @@ -0,0 +1 @@ +module.exports = require("./src/long"); diff --git a/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/package.json b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/package.json new file mode 100644 index 00000000..672c241d --- /dev/null +++ b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/package.json @@ -0,0 +1,34 @@ +{ + "name": "long", + "version": "4.0.0", + "author": "Daniel Wirtz ", + "description": "A Long class for representing a 64-bit two's-complement integer value.", + "main": "src/long.js", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/long.js.git" + }, + "bugs": { + "url": "https://github.com/dcodeIO/long.js/issues" + }, + "keywords": [ + "math" + ], + "dependencies": {}, + "devDependencies": { + "webpack": "^3.10.0" + }, + "license": "Apache-2.0", + "scripts": { + "build": "webpack", + "test": "node tests" + }, + "files": [ + "index.js", + "LICENSE", + "README.md", + "src/long.js", + "dist/long.js", + "dist/long.js.map" + ] +} diff --git a/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js new file mode 100644 index 00000000..1440ed62 --- /dev/null +++ b/backend/node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js @@ -0,0 +1,1323 @@ +module.exports = Long; + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = null; + +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ + 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 + ])), {}).exports; +} catch (e) { + // no wasm support :( +} + +/** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @constructor + */ +function Long(low, high, unsigned) { + + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; +} + +// The internal representation of a long is the two given signed, 32-bit values. +// We use 32-bit pieces because these are the size of integers on which +// Javascript performs bit-operations. For operations like addition and +// multiplication, we split each number into 16 bit pieces, which can easily be +// multiplied within Javascript's floating-point representation without overflow +// or change in sign. +// +// In the algorithms below, we frequently reduce the negative case to the +// positive case by negating the input(s) and then post-processing the result. +// Note that we must ALWAYS check specially whether those values are MIN_VALUE +// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as +// a positive number, it overflows back into a negative). Not handling this +// case would often result in infinite recursion. +// +// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* +// methods on which they depend. + +/** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ +Long.prototype.__isLong__; + +Object.defineProperty(Long.prototype, "__isLong__", { value: true }); + +/** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ +function isLong(obj) { + return (obj && obj["__isLong__"]) === true; +} + +/** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ +Long.isLong = isLong; + +/** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ +var INT_CACHE = {}; + +/** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ +var UINT_CACHE = {}; + +/** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = (0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = (-128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } +} + +/** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromInt = fromInt; + +/** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } + if (value < 0) + return fromNumber(-value, unsigned).neg(); + return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); +} + +/** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromNumber = fromNumber; + +/** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); +} + +/** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromBits = fromBits; + +/** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ +var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) + +/** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ +function fromString(str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + radix = unsigned, + unsigned = false; + } else { + unsigned = !! unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 8)); + + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; +} + +/** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ +Long.fromString = fromString; + +/** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromValue(val, unsigned) { + if (typeof val === 'number') + return fromNumber(val, unsigned); + if (typeof val === 'string') + return fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); +} + +/** + * Converts the specified value to a Long using the appropriate from* function for its type. + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} + */ +Long.fromValue = fromValue; + +// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be +// no runtime penalty for these. + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_16_DBL = 1 << 16; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_24_DBL = 1 << 24; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + +/** + * @type {!Long} + * @const + * @inner + */ +var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + +/** + * @type {!Long} + * @inner + */ +var ZERO = fromInt(0); + +/** + * Signed zero. + * @type {!Long} + */ +Long.ZERO = ZERO; + +/** + * @type {!Long} + * @inner + */ +var UZERO = fromInt(0, true); + +/** + * Unsigned zero. + * @type {!Long} + */ +Long.UZERO = UZERO; + +/** + * @type {!Long} + * @inner + */ +var ONE = fromInt(1); + +/** + * Signed one. + * @type {!Long} + */ +Long.ONE = ONE; + +/** + * @type {!Long} + * @inner + */ +var UONE = fromInt(1, true); + +/** + * Unsigned one. + * @type {!Long} + */ +Long.UONE = UONE; + +/** + * @type {!Long} + * @inner + */ +var NEG_ONE = fromInt(-1); + +/** + * Signed negative one. + * @type {!Long} + */ +Long.NEG_ONE = NEG_ONE; + +/** + * @type {!Long} + * @inner + */ +var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false); + +/** + * Maximum signed value. + * @type {!Long} + */ +Long.MAX_VALUE = MAX_VALUE; + +/** + * @type {!Long} + * @inner + */ +var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true); + +/** + * Maximum unsigned value. + * @type {!Long} + */ +Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + +/** + * @type {!Long} + * @inner + */ +var MIN_VALUE = fromBits(0, 0x80000000|0, false); + +/** + * Minimum signed value. + * @type {!Long} + */ +Long.MIN_VALUE = MIN_VALUE; + +/** + * @alias Long.prototype + * @inner + */ +var LongPrototype = Long.prototype; + +/** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @returns {number} + */ +LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; +}; + +/** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @returns {number} + */ +LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); +}; + +/** + * Converts the Long to a string written in the specified radix. + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ +LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { // Unsigned Longs are never negative + if (this.eq(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else + return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; + var result = ''; + while (true) { + var remDiv = rem.div(radixToPower), + intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, + digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) + return digits + result; + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } +}; + +/** + * Gets the high 32 bits as a signed integer. + * @returns {number} Signed high bits + */ +LongPrototype.getHighBits = function getHighBits() { + return this.high; +}; + +/** + * Gets the high 32 bits as an unsigned integer. + * @returns {number} Unsigned high bits + */ +LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; +}; + +/** + * Gets the low 32 bits as a signed integer. + * @returns {number} Signed low bits + */ +LongPrototype.getLowBits = function getLowBits() { + return this.low; +}; + +/** + * Gets the low 32 bits as an unsigned integer. + * @returns {number} Unsigned low bits + */ +LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; +}; + +/** + * Gets the number of bits needed to represent the absolute value of this Long. + * @returns {number} + */ +LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) // Unsigned Longs are never negative + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) != 0) + break; + return this.high != 0 ? bit + 33 : bit + 1; +}; + +/** + * Tests if this Long's value equals zero. + * @returns {boolean} + */ +LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; +}; + +/** + * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. + * @returns {boolean} + */ +LongPrototype.eqz = LongPrototype.isZero; + +/** + * Tests if this Long's value is negative. + * @returns {boolean} + */ +LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; +}; + +/** + * Tests if this Long's value is positive. + * @returns {boolean} + */ +LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; +}; + +/** + * Tests if this Long's value is odd. + * @returns {boolean} + */ +LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; +}; + +/** + * Tests if this Long's value is even. + * @returns {boolean} + */ +LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; +}; + +/** + * Tests if this Long's value equals the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.equals = function equals(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) + return false; + return this.high === other.high && this.low === other.low; +}; + +/** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.eq = LongPrototype.equals; + +/** + * Tests if this Long's value differs from the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.notEquals = function notEquals(other) { + return !this.eq(/* validates */ other); +}; + +/** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.neq = LongPrototype.notEquals; + +/** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.ne = LongPrototype.notEquals; + +/** + * Tests if this Long's value is less than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lessThan = function lessThan(other) { + return this.comp(/* validates */ other) < 0; +}; + +/** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lt = LongPrototype.lessThan; + +/** + * Tests if this Long's value is less than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(/* validates */ other) <= 0; +}; + +/** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.lte = LongPrototype.lessThanOrEqual; + +/** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.le = LongPrototype.lessThanOrEqual; + +/** + * Tests if this Long's value is greater than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(/* validates */ other) > 0; +}; + +/** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.gt = LongPrototype.greaterThan; + +/** + * Tests if this Long's value is greater than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(/* validates */ other) >= 0; +}; + +/** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.gte = LongPrototype.greaterThanOrEqual; + +/** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ +LongPrototype.ge = LongPrototype.greaterThanOrEqual; + +/** + * Compares this Long's value with the specified's. + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ +LongPrototype.compare = function compare(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; +}; + +/** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ +LongPrototype.comp = LongPrototype.compare; + +/** + * Negates this Long's value. + * @returns {!Long} Negated Long + */ +LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) + return MIN_VALUE; + return this.not().add(ONE); +}; + +/** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ +LongPrototype.neg = LongPrototype.negate; + +/** + * Returns the sum of this and the specified Long. + * @param {!Long|number|string} addend Addend + * @returns {!Long} Sum + */ +LongPrototype.add = function add(addend) { + if (!isLong(addend)) + addend = fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xFFFF; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 + b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); +}; + +/** + * Returns the difference of this and the specified Long. + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ +LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) + subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); +}; + +/** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ +LongPrototype.sub = LongPrototype.subtract; + +/** + * Returns the product of this and the specified Long. + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ +LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) + return ZERO; + if (!isLong(multiplier)) + multiplier = fromValue(multiplier); + + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, + this.high, + multiplier.low, + multiplier.high); + return fromBits(low, wasm.get_high(), this.unsigned); + } + + if (multiplier.isZero()) + return ZERO; + if (this.eq(MIN_VALUE)) + return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) + return this.isOdd() ? MIN_VALUE : ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xFFFF; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); +}; + +/** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ +LongPrototype.mul = LongPrototype.multiply; + +/** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ +LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return fromBits(low, wasm.get_high(), this.unsigned); + } + + if (this.isZero()) + return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(MIN_VALUE)) + return ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) + return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return UZERO; + if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true + return UONE; + res = UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2), + delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), + + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + approxRes = fromNumber(approx), + approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; +}; + +/** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ +LongPrototype.div = LongPrototype.divide; + +/** + * Returns this Long modulo the specified. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return fromBits(low, wasm.get_high(), this.unsigned); + } + + return this.sub(this.div(divisor).mul(divisor)); +}; + +/** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.mod = LongPrototype.modulo; + +/** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.rem = LongPrototype.modulo; + +/** + * Returns the bitwise NOT of this Long. + * @returns {!Long} + */ +LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); +}; + +/** + * Returns the bitwise AND of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ +LongPrototype.and = function and(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); +}; + +/** + * Returns the bitwise OR of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ +LongPrototype.or = function or(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); +}; + +/** + * Returns the bitwise XOR of this Long and the given one. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ +LongPrototype.xor = function xor(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); +}; + +/** + * Returns this Long with bits shifted to the left by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return fromBits(0, this.low << (numBits - 32), this.unsigned); +}; + +/** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shl = LongPrototype.shiftLeft; + +/** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); +}; + +/** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shr = LongPrototype.shiftRight; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } else if (numBits === 32) + return fromBits(high, 0, this.unsigned); + else + return fromBits(high >>> (numBits - 32), 0, this.unsigned); + } +}; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shru = LongPrototype.shiftRightUnsigned; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + +/** + * Converts this Long to signed. + * @returns {!Long} Signed long + */ +LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) + return this; + return fromBits(this.low, this.high, false); +}; + +/** + * Converts this Long to unsigned. + * @returns {!Long} Unsigned long + */ +LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) + return this; + return fromBits(this.low, this.high, true); +}; + +/** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {!Array.} Byte representation + */ +LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); +}; + +/** + * Converts this Long to its little endian byte representation. + * @returns {!Array.} Little endian byte representation + */ +LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, + lo = this.low; + return [ + lo & 0xff, + lo >>> 8 & 0xff, + lo >>> 16 & 0xff, + lo >>> 24 , + hi & 0xff, + hi >>> 8 & 0xff, + hi >>> 16 & 0xff, + hi >>> 24 + ]; +}; + +/** + * Converts this Long to its big endian byte representation. + * @returns {!Array.} Big endian byte representation + */ +LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, + lo = this.low; + return [ + hi >>> 24 , + hi >>> 16 & 0xff, + hi >>> 8 & 0xff, + hi & 0xff, + lo >>> 24 , + lo >>> 16 & 0xff, + lo >>> 8 & 0xff, + lo & 0xff + ]; +}; + +/** + * Creates a Long from its byte representation. + * @param {!Array.} bytes Byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {Long} The corresponding Long value + */ +Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); +}; + +/** + * Creates a Long from its little endian byte representation. + * @param {!Array.} bytes Little endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ +Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long( + bytes[0] | + bytes[1] << 8 | + bytes[2] << 16 | + bytes[3] << 24, + bytes[4] | + bytes[5] << 8 | + bytes[6] << 16 | + bytes[7] << 24, + unsigned + ); +}; + +/** + * Creates a Long from its big endian byte representation. + * @param {!Array.} bytes Big endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ +Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long( + bytes[4] << 24 | + bytes[5] << 16 | + bytes[6] << 8 | + bytes[7], + bytes[0] << 24 | + bytes[1] << 16 | + bytes[2] << 8 | + bytes[3], + unsigned + ); +}; diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/LICENSE.md b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/LICENSE.md new file mode 100644 index 00000000..c5402b95 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/README.md b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/README.md new file mode 100644 index 00000000..b990a379 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/README.md @@ -0,0 +1,469 @@ +# lru-cache + +A cache object that deletes the least-recently-used items. + +Specify a max number of the most recently used items that you +want to keep, and this cache will keep that many of the most +recently accessed items. + +This is not primarily a TTL cache, and does not make strong TTL +guarantees. There is no preemptive pruning of expired items by +default, but you _may_ set a TTL on the cache or on a single +`set`. If you do so, it will treat expired items as missing, and +delete them when fetched. If you are more interested in TTL +caching than LRU caching, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +As of version 7, this is one of the most performant LRU +implementations available in JavaScript, and supports a wide +diversity of use cases. However, note that using some of the +features will necessarily impact performance, by causing the +cache to have to do more work. See the "Performance" section +below. + +## Installation + +```bash +npm install lru-cache --save +``` + +## Usage + +```js +// hybrid module, either works +import { LRUCache } from 'lru-cache' +// or: +const { LRUCache } = require('lru-cache') +// or in minified form for web browsers: +import { LRUCache } from 'http://unpkg.com/lru-cache@9/dist/mjs/index.min.mjs' + +// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent +// unsafe unbounded storage. +// +// In most cases, it's best to specify a max for performance, so all +// the required memory allocation is done up-front. +// +// All the other options are optional, see the sections below for +// documentation on what each one does. Most of them can be +// overridden for specific items in get()/set() +const options = { + max: 500, + + // for use with tracking overall storage size + maxSize: 5000, + sizeCalculation: (value, key) => { + return 1 + }, + + // for use when you need to clean up something when objects + // are evicted from the cache + dispose: (value, key, reason) => { + freeFromMemoryOrWhatever(value) + }, + + // for use when you need to know that an item is being inserted + // note that this does NOT allow you to prevent the insertion, + // it just allows you to know about it. + onInsert: (value, key, reason) => { + logInsertionOrWhatever(key, value) + }, + + // how long to live in ms + ttl: 1000 * 60 * 5, + + // return stale items before removing from cache? + allowStale: false, + + updateAgeOnGet: false, + updateAgeOnHas: false, + + // async method to use for cache.fetch(), for + // stale-while-revalidate type of behavior + fetchMethod: async (key, staleValue, { options, signal, context }) => {}, +} + +const cache = new LRUCache(options) + +cache.set('key', 'value') +cache.get('key') // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.clear() // empty the cache +``` + +If you put more stuff in the cache, then less recently used items +will fall out. That's what an LRU cache is. + +For full description of the API and all options, please see [the +LRUCache typedocs](https://isaacs.github.io/node-lru-cache/) + +## Storage Bounds Safety + +This implementation aims to be as flexible as possible, within +the limits of safe memory consumption and optimal performance. + +At initial object creation, storage is allocated for `max` items. +If `max` is set to zero, then some performance is lost, and item +count is unbounded. Either `maxSize` or `ttl` _must_ be set if +`max` is not specified. + +If `maxSize` is set, then this creates a safe limit on the +maximum storage consumed, but without the performance benefits of +pre-allocation. When `maxSize` is set, every item _must_ provide +a size, either via the `sizeCalculation` method provided to the +constructor, or via a `size` or `sizeCalculation` option provided +to `cache.set()`. The size of every item _must_ be a positive +integer. + +If neither `max` nor `maxSize` are set, then `ttl` tracking must +be enabled. Note that, even when tracking item `ttl`, items are +_not_ preemptively deleted when they become stale, unless +`ttlAutopurge` is enabled. Instead, they are only purged the +next time the key is requested. Thus, if `ttlAutopurge`, `max`, +and `maxSize` are all not set, then the cache will potentially +grow unbounded. + +In this case, a warning is printed to standard error. Future +versions may require the use of `ttlAutopurge` if `max` and +`maxSize` are not specified. + +If you truly wish to use a cache that is bound _only_ by TTL +expiration, consider using a `Map` object, and calling +`setTimeout` to delete entries when they expire. It will perform +much better than an LRU cache. + +Here is an implementation you may use, under the same +[license](./LICENSE) as this package: + +```js +// a storage-unbounded ttl cache that is not an lru-cache +const cache = { + data: new Map(), + timers: new Map(), + set: (k, v, ttl) => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.set( + k, + setTimeout(() => cache.delete(k), ttl), + ) + cache.data.set(k, v) + }, + get: k => cache.data.get(k), + has: k => cache.data.has(k), + delete: k => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.delete(k) + return cache.data.delete(k) + }, + clear: () => { + cache.data.clear() + for (const v of cache.timers.values()) { + clearTimeout(v) + } + cache.timers.clear() + }, +} +``` + +If that isn't to your liking, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +## Storing Undefined Values + +This cache never stores undefined values, as `undefined` is used +internally in a few places to indicate that a key is not in the +cache. + +You may call `cache.set(key, undefined)`, but this is just +an alias for `cache.delete(key)`. Note that this has the effect +that `cache.has(key)` will return _false_ after setting it to +undefined. + +```js +cache.set(myKey, undefined) +cache.has(myKey) // false! +``` + +If you need to track `undefined` values, and still note that the +key is in the cache, an easy workaround is to use a sigil object +of your own. + +```js +import { LRUCache } from 'lru-cache' +const undefinedValue = Symbol('undefined') +const cache = new LRUCache(...) +const mySet = (key, value) => + cache.set(key, value === undefined ? undefinedValue : value) +const myGet = (key, value) => { + const v = cache.get(key) + return v === undefinedValue ? undefined : v +} +``` + +## Tracing and Observability + +Most methods can accept a `status` option, which is an +[`LRUCache.Status`](https://isaacs.github.io/node-lru-cache/interfaces/LRUCache.LRUCache.Status.html) +object that will be decorated along the operation with +indications about what was done and why. + +Additionally, this library is instrumented using the +[`node:diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html) +module on Node and other platforms that support it. In order to +get diagnostics metrics, listen on the +`channel('lru-cache:metrics')`. To get Tracing Channel traces, +subscribe to the `tracingChannel('lru-cache')`. The +[`LRUCache.Status`](https://isaacs.github.io/node-lru-cache/interfaces/LRUCache.LRUCache.Status.html) +objects will be provided as the message context to those channel +listeners. + +For example, you could do the following to get comprehensive +information about every LRUCache instance in your application: + +```ts +import { tracingChannel, subscribe } from 'node:diagnostics_channel' + +subscribe('lru-cache:metrics', (message, name) => { + // name will always be 'lru-cache:metrics' + // message will be the LRUCache.Status object for whatever + // synchronous operation was performed. + console.error('LRUCache Metrics', message) +}) + +tracingChannel('lru-cache').subscribe({ + start: status => { + // a traced operation is starting + }, + asyncStart: status => { + // an async traced operation is starting + }, + asyncEnd: status => { + // an async traced operation is ending + } + error: status => { + // a traced operation failed + }, + end: status => { + // a traced operation is complete + }, +}) +``` + +The async `cache.fetch()` and `cache.forceFetch` methods are +covered by `tracingChannels`. All the other operations are +covered by the `lru-cache:metrics` channel, because they are +strictly synchronous, and thus don't have an asynchronous +lifecycle to track. + +Note that using `status` objects or using +`node:diagnostics_channel` listeners _will_ impose a modest +performance penalty. Creating data objects is not ever free; do +not believe anyone who tells you otherwise. But it is as small as +possible. + +### Platform Compatibility Caveat + +Not all platforms support the `node:diagnostics_channel` module. +Currently, this is only available in Node, Bun, and Deno, and +some edge computing platforms that provide a Node compatibility +layer. + +To work around this, if you are loading in a non-Node +environment, the package.json exports will direct your module +loader to pull in a version that starts out with a dummy +implementation, then does a conditional dynamic `import` of the +`node:diagnostics_channel` module, and then swaps out those +dummy objects with the real thing if it succeeds. This means that +cache metrics and tracing channels started in the first load-time +tick of your application will _not_ be covered, except in +environments that load using the `require` import +condition, or both the `node` and `esm` import conditions +together. + +Top-level await _could_ be used to remove this caveat, but that +feature is dead on arrival, unfortunately. See +[#397](https://github.com/isaacs/node-lru-cache/issues/397) and +[#398](https://github.com/isaacs/node-lru-cache/issues/398) for +more details. + +## Performance + +As of April 2026, version 11 of this library is one of the most +performant LRU cache implementations in JavaScript. + +Benchmarks can be extremely difficult to get right. In +particular, the performance of set/get/delete operations on +objects will vary _wildly_ depending on the type of key used. V8 +is highly optimized for objects with keys that are short strings, +especially integer numeric strings. Thus any benchmark which +tests _solely_ using numbers as keys will tend to find that an +object-based approach performs the best. + +Note that coercing _anything_ to strings to use as object keys is +unsafe, unless you can be 100% certain that no other type of +value will be used. For example: + +```js +const myCache = {} +const set = (k, v) => (myCache[k] = v) +const get = k => myCache[k] + +set({}, 'please hang onto this for me') +set('[object Object]', 'oopsie') +``` + +Also beware of "Just So" stories regarding performance. Garbage +collection of large (especially: deep) object graphs can be +incredibly costly, with several "tipping points" where it +increases exponentially. As a result, putting that off until +later can make it much worse, and less predictable. If a library +performs well, but only in a scenario where the object graph is +kept shallow, then that won't help you if you are using large +objects as keys. + +In general, when attempting to use a library to improve +performance (such as a cache like this one), it's best to choose +an option that will perform well in the sorts of scenarios where +you'll actually use it. + +This library is optimized for repeated gets and minimizing +eviction time, since that is the expected need of a LRU. Set +operations are somewhat slower on average than a few other +options, in part because of that optimization. It is assumed +that you'll be caching some costly operation, ideally as rarely +as possible, so optimizing set over get would be unwise. + +If performance matters to you: + +1. If it's at all possible to use small integer values as keys, + and you can guarantee that no other types of values will be + used as keys, then do that, and use a cache such as + [lru-fast](https://npmjs.com/package/lru-fast), or + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) + which uses an Object as its data store. + +2. Failing that, if you can use short non-numeric strings (ie, + less than 256 characters) as your keys, and you do not need + any of the other features of this library, use [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). + +3. If the types of your keys will be anything else, especially + long strings, strings that look like floats, objects, or some + mix of types, or if you aren't sure, then this library will + work well for you. + + If you do not need the features that this library provides + (like asynchronous fetching, a variety of TTL staleness + options, and so on), then [mnemonist's + LRUMap](https://yomguithereal.github.io/mnemonist/lru-map) is + also a very good option, and just slightly faster than this + module (since it does considerably less). + +4. Do not use a `dispose` function, size tracking, or especially + ttl behavior or observability features, unless absolutely + needed. These features are convenient, and necessary in some + use cases, and every attempt has been made to make the + performance impact minimal, but it isn't nothing. + +## Testing + +When writing tests that involve TTL-related functionality, note +that this module creates an internal reference to the global +`performance` or `Date` objects at import time. If you import it +statically at the top level, those references cannot be mocked or +overridden in your test environment. + +To avoid this, dynamically import the package within your tests +so that the references are captured after your mocks are applied. +For example: + +```ts +// ❌ Not recommended +import { LRUCache } from 'lru-cache' +// mocking timers, e.g. jest.useFakeTimers() + +// ✅ Recommended for TTL tests +// mocking timers, e.g. jest.useFakeTimers() +const { LRUCache } = await import('lru-cache') +``` + +This ensures that your mocked timers or time sources are +respected when testing TTL behavior. + +Additionally, you can pass in a `perf` option when creating your +LRUCache instance. This option accepts any object with a `now` +method that returns a number. + +For example, this would be a very bare-bones time-mocking system +you could use in your tests, without any particular test +framework: + +```ts +import { LRUCache } from 'lru-cache' + +let myClockTime = 0 + +const cache = new LRUCache({ + max: 10, + ttl: 1000, + perf: { + now: () => myClockTime, + }, +}) + +// run tests, updating myClockTime as needed +``` + +## Breaking Changes in Version 7 + +This library changed to a different algorithm and internal data +structure in version 7, yielding significantly better +performance, albeit with some subtle changes as a result. + +If you were relying on the internals of LRUCache in version 6 or +before, it probably will not work in version 7 and above. + +## Breaking Changes in Version 8 + +- The `fetchContext` option was renamed to `context`, and may no + longer be set on the cache instance itself. +- Rewritten in TypeScript, so pretty much all the types moved + around a lot. +- The AbortController/AbortSignal polyfill was removed. For this + reason, **Node version 16.14.0 or higher is now required**. +- Internal properties were moved to actual private class + properties. +- Keys and values must not be `null` or `undefined`. +- Minified export available at `'lru-cache/min'`, for both CJS + and MJS builds. + +## Breaking Changes in Version 9 + +- Named export only, no default export. +- AbortController polyfill returned, albeit with a warning when + used. + +## Breaking Changes in Version 10 + +- `cache.fetch()` return type is now `Promise` + instead of `Promise`. This is an irrelevant change + practically speaking, but can require changes for TypeScript + users. + +For more info, see the [change log](CHANGELOG.md). diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map new file mode 100644 index 00000000..a457786d --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map new file mode 100644 index 00000000..bb682313 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts new file mode 100644 index 00000000..5360898f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-browser.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js new file mode 100644 index 00000000..8f6a8f12 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +const dummy = { hasSubscribers: false }; +exports.metrics = dummy; +exports.tracing = dummy; +//# sourceMappingURL=diagnostics-channel-browser.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map new file mode 100644 index 00000000..f460c6d7 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map @@ -0,0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C;IA4Bb;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,CAAC,EAAE,CAAC,EACJ,WAAW,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js new file mode 100644 index 00000000..8ea3f9e3 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js @@ -0,0 +1,1733 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js.map new file mode 100644 index 00000000..81b51b35 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC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CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAx9DD,4BAw9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js new file mode 100644 index 00000000..d20fcc5e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(u,t)=>()=>(t||u((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U={hasSubscribers:!1};O.metrics=U;O.tracing=U});var P=j(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.defaultPerf=void 0;R.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),C=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(u,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(u,t,e,i):console.error(`[${e}] ${t}: ${u}`)},B=u=>!k.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),H=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},L=class u{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];u.#o=!0;let i=new u(t,e);return u.#o=!1,i}constructor(t,e){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},M=class u{#o;#c;#m;#W;#S;#x;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#R;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#_,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#M(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#x}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:h,dispose:r,onInsert:c,disposeAfter:w,noDisposeOnSet:_,noUpdateTTL:d,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:y,fetchMethod:a,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:x=1,perf:v}=t;if(this.backgroundFetchSize=x,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=y,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=a,this.#U=!!a,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#y=L.create(e),this.#n=0,this.#b=0,typeof r=="function"&&(this.#m=r),typeof c=="function"&&(this.#W=c),typeof w=="function"?(this.#S=w,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#R=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let D="LRU_CACHE_UNBOUNDED";B(D)&&(k.add(D),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,u))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,r,c=this.#w.now())=>{e[h]=r!==0?c:0,t[h]=r,s(h,r)},this.#D=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,r)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),r&&r!==0&&i){let c=setTimeout(()=>{this.#p(h)?(this.#v(this.#i[h],"expire"),i[h]=void 0):s(h,l(h))},r+1);c.unref&&c.unref(),i[h]=c}}:()=>{};this.#E=(h,r)=>{if(t[r]){let c=t[r],w=e[r];if(!c||!w)return;h.ttl=c,h.start=w,h.now=n||o();let _=h.now-w;h.remainingTTL=c-_}};let n=0,o=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let r=setTimeout(()=>n=0,this.ttlResolution);r.unref&&r.unref()}return h};this.getRemainingTTL=h=>{let r=this.#s.get(h);return r===void 0?0:l(r)};let l=h=>{let r=t[h],c=e[h];if(!r||!c)return 1/0;let w=(n||o())-c;return r-w};this.#p=h=>{let r=e[h],c=t[h];return!!c&&!!r&&(n||o())-r>c}}#D=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#_=t,this.#C=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#C=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#L(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let o=this.#d[e],l=this.#F[e];if(o&&l){let h=o-(this.#w.now()-l);n.ttl=h,n.start=Date.now()}}return this.#_&&(n.size=this.#_[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(this.#d&&this.#F){o.ttl=this.#d[e];let l=this.#w.now()-this.#F[e];o.start=Math.floor(Date.now()-l)}this.#_&&(o.size=this.#_[e]),t.unshift([i,o])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:r}=i,c=this.#e(e);if(e===void 0)return r&&(r.set="deleted"),this.delete(t),this;let{noUpdateTTL:w=this.noUpdateTTL}=i;r&&!c&&(r.value=e);let _=this.#N(t,e,i.size||0,h,r);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#v(t,"set"),r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this;let d=this.#n===0?void 0:this.#s.get(t);if(d===void 0)d=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[d]=t,this.#t[d]=e,this.#s.set(t,d),this.#l[this.#h]=d,this.#u[d]=this.#h,this.#h=d,this.#n++,this.#I(d,_,r),r&&(r.set="add"),w=!1,this.#R&&!c&&this.#W?.(e,t,"add");else{this.#M(d);let p=this.#t[d];if(e!==p){if(!l)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#C(d),this.#I(d,_,r),this.#t[d]=e,!c){let f=p&&this.#e(p)?p.__staleWhileFetching:p,y=f===void 0?"add":e!==f?"replace":"update";r&&(r.set=y,f!==void 0&&(r.oldValue=f)),this.#R&&this.onInsert?.(e,t,y)}}else c||(r&&(r.set="update"),this.#R&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(w||this.#H(d,n,o),r&&this.#E(r,d)),!l&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let o=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&o!==void 0&&(this.#T&&this.#m?.(o,i,"evict"),this.#f&&this.#r?.push([o,i,"evict"])),this.#C(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let o=this.#t[n];if(this.#e(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=C()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let o=this.#t[n],l=this.#e(o)?o.__staleWhileFetching:o;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let o=new AbortController,{signal:l}=i;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let h={signal:o.signal,options:i,context:s},r=(f,y=!1)=>{let{aborted:a}=o.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(a&&!y?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!S&&!y)return w(o.signal.reason,F);let b=d,m=this.#t[e];return(m===d||m===void 0&&S&&y)&&(f===void 0?b.__staleWhileFetching!==void 0?this.#t[e]=b.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,h.options,b))),f},c=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),w(f,!1)),w=(f,y)=>{let{aborted:a}=o.signal,S=a&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,b=F||i.noDeleteOnFetchRejection,m=d;if(this.#t[e]===d&&(!b||!y&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},_=(f,y)=>{let a=this.#x?.(t,n,h);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>r(S,!0)))}),a&&a instanceof Promise?a.then(S=>f(S===void 0?void 0:S),y):a!==void 0&&f(a)};i.status&&(i.status.fetchDispatched=!0);let d=new Promise(_).then(r,c),p=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...h.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#B(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#B(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:h=0,sizeCalculation:r=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:a,signal:S}=e;if(a&&(a.op="fetch",a.key=t,y&&(a.forceRefresh=!0),a.cache=this),!this.#U)return a&&(a.fetch="get"),this.#L(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:l,size:h,sizeCalculation:r,noUpdateTTL:c,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:a,signal:S},b=this.#s.get(t);if(b===void 0){a&&(a.fetch="miss");let m=this.#G(t,b,F,f);return m.__returned=m}else{let m=this.#t[b];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",E&&(a.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(b);if(!y&&!A)return a&&(a.fetch="hit"),this.#M(b),s&&this.#D(b),a&&this.#E(a,b),m;let z=this.#G(t,b,F,f),v=z.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=A?"stale":"refresh",v&&A&&(a.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#B(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:o,...l}=e;n&&o&&(n.forceRefresh=!0);let h=this.#L(t,l),r=o||h===void 0;if(n&&(n.memo=r?"miss":"hit",r||(n.value=h)),!r)return h;let c=i(t,h,{options:l,context:s});return n&&(n.value=c),this.#O(t,c,l),c}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#L(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#L(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,l=this.#s.get(t);if(l===void 0){o&&(o.get="miss");return}let h=this.#t[l],r=this.#e(h);return o&&this.#E(o,l),this.#p(l)?r?(o&&(o.get="stale-fetching"),i&&h.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),h.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),h):void 0):(o&&(o.get=r?"fetching":"hit"),this.#M(l),s&&this.#D(l),r?h.__staleWhileFetching:h)}#q(t,e){this.#u[e]=t,this.#l[t]=e}#M(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#C(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let o=this.#u[s];this.#l[o]=this.#l[s];let l=this.#l[s];this.#u[l]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=M; +//# sourceMappingURL=index.min.js.map diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map new file mode 100644 index 00000000..7c8eb43a --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-browser.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxB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,GAv9DF,QAAA,SAAAxH", + "names": ["dummy", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgeTimer", "#updateItemAge", "t", "#delete", "getRemainingTTL", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js new file mode 100644 index 00000000..bd4c80f4 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js.map new file mode 100644 index 00000000..a193c90f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/browser/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map new file mode 100644 index 00000000..abdcb32e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-cjs.cjs","sourceRoot":"","sources":["../../src/diagnostics-channel-cjs.cts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in CJS environments that do NOT follow the 'node' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map new file mode 100644 index 00000000..7cfc73f1 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-cjs.d.cts","sourceRoot":"","sources":["../../src/diagnostics-channel-cjs.cts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts new file mode 100644 index 00000000..6cf41c4f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-cjs.d.cts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js new file mode 100644 index 00000000..bdd4f41f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +const dummy = { hasSubscribers: false }; +exports.metrics = dummy; +exports.tracing = dummy; +//# sourceMappingURL=diagnostics-channel-cjs.cjs.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts.map new file mode 100644 index 00000000..03163a94 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW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AW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js new file mode 100644 index 00000000..8ea3f9e3 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js @@ -0,0 +1,1733 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js.map new file mode 100644 index 00000000..632f245e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAqC;QACrC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AACD,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CA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AI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAx9DD,4BAw9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js new file mode 100644 index 00000000..d20fcc5e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(u,t)=>()=>(t||u((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U={hasSubscribers:!1};O.metrics=U;O.tracing=U});var P=j(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.defaultPerf=void 0;R.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),C=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(u,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(u,t,e,i):console.error(`[${e}] ${t}: ${u}`)},B=u=>!k.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),H=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},L=class u{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];u.#o=!0;let i=new u(t,e);return u.#o=!1,i}constructor(t,e){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},M=class u{#o;#c;#m;#W;#S;#x;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#R;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#_,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#M(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#x}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:h,dispose:r,onInsert:c,disposeAfter:w,noDisposeOnSet:_,noUpdateTTL:d,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:y,fetchMethod:a,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:x=1,perf:v}=t;if(this.backgroundFetchSize=x,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=y,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=a,this.#U=!!a,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#y=L.create(e),this.#n=0,this.#b=0,typeof r=="function"&&(this.#m=r),typeof c=="function"&&(this.#W=c),typeof w=="function"?(this.#S=w,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#R=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let D="LRU_CACHE_UNBOUNDED";B(D)&&(k.add(D),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,u))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,r,c=this.#w.now())=>{e[h]=r!==0?c:0,t[h]=r,s(h,r)},this.#D=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,r)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),r&&r!==0&&i){let c=setTimeout(()=>{this.#p(h)?(this.#v(this.#i[h],"expire"),i[h]=void 0):s(h,l(h))},r+1);c.unref&&c.unref(),i[h]=c}}:()=>{};this.#E=(h,r)=>{if(t[r]){let c=t[r],w=e[r];if(!c||!w)return;h.ttl=c,h.start=w,h.now=n||o();let _=h.now-w;h.remainingTTL=c-_}};let n=0,o=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let r=setTimeout(()=>n=0,this.ttlResolution);r.unref&&r.unref()}return h};this.getRemainingTTL=h=>{let r=this.#s.get(h);return r===void 0?0:l(r)};let l=h=>{let r=t[h],c=e[h];if(!r||!c)return 1/0;let w=(n||o())-c;return r-w};this.#p=h=>{let r=e[h],c=t[h];return!!c&&!!r&&(n||o())-r>c}}#D=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#_=t,this.#C=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#C=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#L(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let o=this.#d[e],l=this.#F[e];if(o&&l){let h=o-(this.#w.now()-l);n.ttl=h,n.start=Date.now()}}return this.#_&&(n.size=this.#_[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(this.#d&&this.#F){o.ttl=this.#d[e];let l=this.#w.now()-this.#F[e];o.start=Math.floor(Date.now()-l)}this.#_&&(o.size=this.#_[e]),t.unshift([i,o])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:r}=i,c=this.#e(e);if(e===void 0)return r&&(r.set="deleted"),this.delete(t),this;let{noUpdateTTL:w=this.noUpdateTTL}=i;r&&!c&&(r.value=e);let _=this.#N(t,e,i.size||0,h,r);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#v(t,"set"),r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this;let d=this.#n===0?void 0:this.#s.get(t);if(d===void 0)d=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[d]=t,this.#t[d]=e,this.#s.set(t,d),this.#l[this.#h]=d,this.#u[d]=this.#h,this.#h=d,this.#n++,this.#I(d,_,r),r&&(r.set="add"),w=!1,this.#R&&!c&&this.#W?.(e,t,"add");else{this.#M(d);let p=this.#t[d];if(e!==p){if(!l)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#C(d),this.#I(d,_,r),this.#t[d]=e,!c){let f=p&&this.#e(p)?p.__staleWhileFetching:p,y=f===void 0?"add":e!==f?"replace":"update";r&&(r.set=y,f!==void 0&&(r.oldValue=f)),this.#R&&this.onInsert?.(e,t,y)}}else c||(r&&(r.set="update"),this.#R&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(w||this.#H(d,n,o),r&&this.#E(r,d)),!l&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let o=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&o!==void 0&&(this.#T&&this.#m?.(o,i,"evict"),this.#f&&this.#r?.push([o,i,"evict"])),this.#C(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let o=this.#t[n];if(this.#e(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=C()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let o=this.#t[n],l=this.#e(o)?o.__staleWhileFetching:o;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let o=new AbortController,{signal:l}=i;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let h={signal:o.signal,options:i,context:s},r=(f,y=!1)=>{let{aborted:a}=o.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(a&&!y?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!S&&!y)return w(o.signal.reason,F);let b=d,m=this.#t[e];return(m===d||m===void 0&&S&&y)&&(f===void 0?b.__staleWhileFetching!==void 0?this.#t[e]=b.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,h.options,b))),f},c=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),w(f,!1)),w=(f,y)=>{let{aborted:a}=o.signal,S=a&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,b=F||i.noDeleteOnFetchRejection,m=d;if(this.#t[e]===d&&(!b||!y&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},_=(f,y)=>{let a=this.#x?.(t,n,h);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>r(S,!0)))}),a&&a instanceof Promise?a.then(S=>f(S===void 0?void 0:S),y):a!==void 0&&f(a)};i.status&&(i.status.fetchDispatched=!0);let d=new Promise(_).then(r,c),p=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...h.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#B(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#B(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:h=0,sizeCalculation:r=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:a,signal:S}=e;if(a&&(a.op="fetch",a.key=t,y&&(a.forceRefresh=!0),a.cache=this),!this.#U)return a&&(a.fetch="get"),this.#L(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:l,size:h,sizeCalculation:r,noUpdateTTL:c,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:a,signal:S},b=this.#s.get(t);if(b===void 0){a&&(a.fetch="miss");let m=this.#G(t,b,F,f);return m.__returned=m}else{let m=this.#t[b];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",E&&(a.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(b);if(!y&&!A)return a&&(a.fetch="hit"),this.#M(b),s&&this.#D(b),a&&this.#E(a,b),m;let z=this.#G(t,b,F,f),v=z.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=A?"stale":"refresh",v&&A&&(a.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#B(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:o,...l}=e;n&&o&&(n.forceRefresh=!0);let h=this.#L(t,l),r=o||h===void 0;if(n&&(n.memo=r?"miss":"hit",r||(n.value=h)),!r)return h;let c=i(t,h,{options:l,context:s});return n&&(n.value=c),this.#O(t,c,l),c}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#L(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#L(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,l=this.#s.get(t);if(l===void 0){o&&(o.get="miss");return}let h=this.#t[l],r=this.#e(h);return o&&this.#E(o,l),this.#p(l)?r?(o&&(o.get="stale-fetching"),i&&h.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),h.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),h):void 0):(o&&(o.get=r?"fetching":"hit"),this.#M(l),s&&this.#D(l),r?h.__staleWhileFetching:h)}#q(t,e){this.#u[e]=t,this.#l[t]=e}#M(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#C(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let o=this.#u[s];this.#l[o]=this.#l[s];let l=this.#l[s];this.#u[l]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=M; +//# sourceMappingURL=index.min.js.map diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js.map new file mode 100644 index 00000000..4f06288e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/diagnostics-channel-cjs.cts", "../../src/perf.ts", "../../src/index.ts"], + "sourcesContent": ["// this is used in CJS environments that do NOT follow the 'node' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAA,QAAUD,EACVC,EAAA,QAAUD,mGCFVE,EAAA,YAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,sFCZzB,IAAAC,EAAA,IACAC,EAAA,IAIMC,EAAiB,IACrBF,EAAA,QAAQ,gBAAkBA,EAAA,QAAQ,eAE9BG,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,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,KAAKvI,IACP,KAAKP,IAAW,KAAK,CAACuE,EAAQ3D,EAAQkI,CAAM,CAAC,CAEjD,CACF,CAKA,GAHA,KAAKtJ,GAAQ,MAAK,EACb,KAAKE,GAAS,KAAK,MAAS,EACjC,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW0D,KAAK,KAAKxD,IAAoB,CAAA,EACnCwD,IAAM,QAAW,aAAaA,CAAC,EAErC,KAAKxD,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMmG,EAAK,KAAKnG,GACZoG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKjH,KAAgB,GAAGkH,CAAI,CAEhC,CACF,GAv9DF,QAAA,SAAAxH", + "names": ["dummy", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgeTimer", "#updateItemAge", "t", "#delete", "getRemainingTTL", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map new file mode 100644 index 00000000..2c0f7d51 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AACvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO,CAAgC,CAAA;AACrE,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,CAA+B,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map new file mode 100644 index 00000000..47bd2c0d --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,mEAAmE;AACnE,uEAAkE;AAGrD,QAAA,OAAO,GAAqB,IAAA,kCAAO,EAAC,mBAAmB,CAAC,CAAA;AACxD,QAAA,OAAO,GAA4B,IAAA,yCAAc,EAAC,WAAW,CAAC,CAAA","sourcesContent":["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts new file mode 100644 index 00000000..3e9e25d0 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import type { TracingChannel, Channel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-node.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js new file mode 100644 index 00000000..30f39a05 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +// simple node version that imports from node builtin +// this is built to both ESM and CommonJS on the 'node' import path +const node_diagnostics_channel_1 = require("node:diagnostics_channel"); +exports.metrics = (0, node_diagnostics_channel_1.channel)('lru-cache:metrics'); +exports.tracing = (0, node_diagnostics_channel_1.tracingChannel)('lru-cache'); +//# sourceMappingURL=diagnostics-channel-node.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map new file mode 100644 index 00000000..f460c6d7 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GA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AAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js new file mode 100644 index 00000000..8ea3f9e3 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js @@ -0,0 +1,1733 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js.map new file mode 100644 index 00000000..81b51b35 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAqC;QACrC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AACD,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,I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AC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAx9DD,4BAw9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js new file mode 100644 index 00000000..122a09e5 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(u,t)=>()=>(t||u((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U=require("node:diagnostics_channel");O.metrics=(0,U.channel)("lru-cache:metrics");O.tracing=(0,U.tracingChannel)("lru-cache")});var P=j(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.defaultPerf=void 0;R.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),C=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(u,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(u,t,e,i):console.error(`[${e}] ${t}: ${u}`)},q=u=>!k.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),H=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},L=class u{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];u.#o=!0;let i=new u(t,e);return u.#o=!1,i}constructor(t,e){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},M=class u{#o;#c;#m;#W;#S;#x;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#_;#r;#y;#F;#d;#g;#T;#U;#f;#R;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#y,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#M(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#x}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:h,dispose:r,onInsert:c,disposeAfter:w,noDisposeOnSet:y,noUpdateTTL:d,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:_,fetchMethod:a,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:x=1,perf:v}=t;if(this.backgroundFetchSize=x,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=_,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=a,this.#U=!!a,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#_=L.create(e),this.#n=0,this.#b=0,typeof r=="function"&&(this.#m=r),typeof c=="function"&&(this.#W=c),typeof w=="function"?(this.#S=w,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#R=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let D="LRU_CACHE_UNBOUNDED";q(D)&&(k.add(D),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,u))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,r,c=this.#w.now())=>{e[h]=r!==0?c:0,t[h]=r,s(h,r)},this.#D=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,r)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),r&&r!==0&&i){let c=setTimeout(()=>{this.#p(h)?(this.#v(this.#i[h],"expire"),i[h]=void 0):s(h,l(h))},r+1);c.unref&&c.unref(),i[h]=c}}:()=>{};this.#E=(h,r)=>{if(t[r]){let c=t[r],w=e[r];if(!c||!w)return;h.ttl=c,h.start=w,h.now=n||o();let y=h.now-w;h.remainingTTL=c-y}};let n=0,o=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let r=setTimeout(()=>n=0,this.ttlResolution);r.unref&&r.unref()}return h};this.getRemainingTTL=h=>{let r=this.#s.get(h);return r===void 0?0:l(r)};let l=h=>{let r=t[h],c=e[h];if(!r||!c)return 1/0;let w=(n||o())-c;return r-w};this.#p=h=>{let r=e[h],c=t[h];return!!c&&!!r&&(n||o())-r>c}}#D=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#y=t,this.#C=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#C=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#L(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let o=this.#d[e],l=this.#F[e];if(o&&l){let h=o-(this.#w.now()-l);n.ttl=h,n.start=Date.now()}}return this.#y&&(n.size=this.#y[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(this.#d&&this.#F){o.ttl=this.#d[e];let l=this.#w.now()-this.#F[e];o.start=Math.floor(Date.now()-l)}this.#y&&(o.size=this.#y[e]),t.unshift([i,o])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:r}=i,c=this.#e(e);if(e===void 0)return r&&(r.set="deleted"),this.delete(t),this;let{noUpdateTTL:w=this.noUpdateTTL}=i;r&&!c&&(r.value=e);let y=this.#N(t,e,i.size||0,h,r);if(this.maxEntrySize&&y>this.maxEntrySize)return this.#v(t,"set"),r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this;let d=this.#n===0?void 0:this.#s.get(t);if(d===void 0)d=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[d]=t,this.#t[d]=e,this.#s.set(t,d),this.#l[this.#h]=d,this.#u[d]=this.#h,this.#h=d,this.#n++,this.#I(d,y,r),r&&(r.set="add"),w=!1,this.#R&&!c&&this.#W?.(e,t,"add");else{this.#M(d);let p=this.#t[d];if(e!==p){if(!l)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#C(d),this.#I(d,y,r),this.#t[d]=e,!c){let f=p&&this.#e(p)?p.__staleWhileFetching:p,_=f===void 0?"add":e!==f?"replace":"update";r&&(r.set=_,f!==void 0&&(r.oldValue=f)),this.#R&&this.onInsert?.(e,t,_)}}else c||(r&&(r.set="update"),this.#R&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(w||this.#H(d,n,o),r&&this.#E(r,d)),!l&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let o=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&o!==void 0&&(this.#T&&this.#m?.(o,i,"evict"),this.#f&&this.#r?.push([o,i,"evict"])),this.#C(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#a=this.#h=0,this.#_.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let o=this.#t[n];if(this.#e(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=C()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let o=this.#t[n],l=this.#e(o)?o.__staleWhileFetching:o;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let o=new AbortController,{signal:l}=i;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let h={signal:o.signal,options:i,context:s},r=(f,_=!1)=>{let{aborted:a}=o.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(a&&!_?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!S&&!_)return w(o.signal.reason,F);let b=d,m=this.#t[e];return(m===d||m===void 0&&S&&_)&&(f===void 0?b.__staleWhileFetching!==void 0?this.#t[e]=b.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,h.options,b))),f},c=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),w(f,!1)),w=(f,_)=>{let{aborted:a}=o.signal,S=a&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,b=F||i.noDeleteOnFetchRejection,m=d;if(this.#t[e]===d&&(!b||!_&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},y=(f,_)=>{let a=this.#x?.(t,n,h);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>r(S,!0)))}),a&&a instanceof Promise?a.then(S=>f(S===void 0?void 0:S),_):a!==void 0&&f(a)};i.status&&(i.status.fetchDispatched=!0);let d=new Promise(y).then(r,c),p=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...h.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#q(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#q(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:h=0,sizeCalculation:r=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:_=!1,status:a,signal:S}=e;if(a&&(a.op="fetch",a.key=t,_&&(a.forceRefresh=!0),a.cache=this),!this.#U)return a&&(a.fetch="get"),this.#L(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:l,size:h,sizeCalculation:r,noUpdateTTL:c,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:a,signal:S},b=this.#s.get(t);if(b===void 0){a&&(a.fetch="miss");let m=this.#G(t,b,F,f);return m.__returned=m}else{let m=this.#t[b];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",E&&(a.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(b);if(!_&&!A)return a&&(a.fetch="hit"),this.#M(b),s&&this.#D(b),a&&this.#E(a,b),m;let z=this.#G(t,b,F,f),v=z.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=A?"stale":"refresh",v&&A&&(a.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#q(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:o,...l}=e;n&&o&&(n.forceRefresh=!0);let h=this.#L(t,l),r=o||h===void 0;if(n&&(n.memo=r?"miss":"hit",r||(n.value=h)),!r)return h;let c=i(t,h,{options:l,context:s});return n&&(n.value=c),this.#O(t,c,l),c}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#L(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#L(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,l=this.#s.get(t);if(l===void 0){o&&(o.get="miss");return}let h=this.#t[l],r=this.#e(h);return o&&this.#E(o,l),this.#p(l)?r?(o&&(o.get="stale-fetching"),i&&h.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),h.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),h):void 0):(o&&(o.get=r?"fetching":"hit"),this.#M(l),s&&this.#D(l),r?h.__staleWhileFetching:h)}#B(t,e){this.#u[e]=t,this.#l[t]=e}#M(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#B(this.#u[t],this.#l[t]),this.#B(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#C(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let o=this.#u[s];this.#l[o]=this.#l[s];let l=this.#l[s];this.#u[l]=this.#u[s]}this.#n--,this.#_.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#a=0,this.#h=0,this.#_.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=M; +//# sourceMappingURL=index.min.js.map diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js.map new file mode 100644 index 00000000..22f34f72 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-node.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n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,EAAK,KAAKnG,GACZoG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKjH,KAAgB,GAAGkH,CAAI,CAEhC,CACF,GAv9DF,QAAA,SAAAxH", + "names": ["node_diagnostics_channel_1", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgeTimer", "#updateItemAge", "t", "#delete", "getRemainingTTL", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js new file mode 100644 index 00000000..bd4c80f4 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js.map new file mode 100644 index 00000000..a193c90f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/node/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/package.json b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/package.json new file mode 100644 index 00000000..5bbefffb --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts.map new file mode 100644 index 00000000..fd6eeeed --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js new file mode 100644 index 00000000..bd4c80f4 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js.map new file mode 100644 index 00000000..59bb4678 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map new file mode 100644 index 00000000..912f3b52 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-react-native.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-react-native.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map new file mode 100644 index 00000000..d26e2fa7 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-react-native.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-react-native.ts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'react-native' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts new file mode 100644 index 00000000..41f79f4f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-react-native.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js new file mode 100644 index 00000000..a8dbaa6a --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +const dummy = { hasSubscribers: false }; +exports.metrics = dummy; +exports.tracing = dummy; +//# sourceMappingURL=diagnostics-channel-react-native.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map new file mode 100644 index 00000000..f460c6d7 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAA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GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js new file mode 100644 index 00000000..8ea3f9e3 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js @@ -0,0 +1,1733 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js.map new file mode 100644 index 00000000..81b51b35 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAqC;QACrC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CA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IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAx9DD,4BAw9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js new file mode 100644 index 00000000..bd4c80f4 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map new file mode 100644 index 00000000..a193c90f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map new file mode 100644 index 00000000..a457786d --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map new file mode 100644 index 00000000..2595c398 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACvC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAyB,CAAA;AAChD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts new file mode 100644 index 00000000..5360898f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-browser.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js new file mode 100644 index 00000000..37524f35 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js @@ -0,0 +1,4 @@ +const dummy = { hasSubscribers: false }; +export const metrics = dummy; +export const tracing = dummy; +//# sourceMappingURL=diagnostics-channel-browser.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts.map new file mode 100644 index 00000000..f460c6d7 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAoB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AACvC,cAAM,KAAK;;IAET,IAA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AAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js new file mode 100644 index 00000000..8a82728c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js @@ -0,0 +1,1729 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js.map new file mode 100644 index 00000000..094d445e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,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AAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js new file mode 100644 index 00000000..f5898157 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js @@ -0,0 +1,2 @@ +var L={hasSubscribers:!1},S=L,W=L;var M=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var R=()=>S.hasSubscribers||W.hasSubscribers,j=new Set,I=typeof process=="object"&&process?process:{},P=(d,e,t,i)=>{typeof I.emitWarning=="function"?I.emitWarning(d,e,t,i):console.error(`[${t}] ${e}: ${d}`)},k=d=>!j.has(d);var T=d=>!!d&&d===Math.floor(d)&&d>0&&isFinite(d),G=d=>T(d)?d<=Math.pow(2,8)?Uint8Array:d<=Math.pow(2,16)?Uint16Array:d<=Math.pow(2,32)?Uint32Array:d<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},x=class d{heap;length;static#o=!1;static create(e){let t=G(e);if(!t)return[];d.#o=!0;let i=new d(e,t);return d.#o=!1,i}constructor(e,t){if(!d.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},U=class d{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:h,dispose:r,onInsert:c,disposeAfter:m,noDisposeOnSet:_,noUpdateTTL:u,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:y,fetchMethod:a,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:C=1,perf:E}=e;if(this.backgroundFetchSize=C,E!==void 0&&typeof E?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=E??M,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let v=t?G(t):Array;if(!v)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=y,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=a,this.#U=!!a,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new v(t),this.#u=new v(t),this.#a=0,this.#h=0,this.#y=x.create(t),this.#n=0,this.#b=0,typeof r=="function"&&(this.#S=r),typeof c=="function"&&(this.#O=c),typeof m=="function"?(this.#w=m,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#D=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let D="LRU_CACHE_UNBOUNDED";k(D)&&(j.add(D),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,d))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,r,c=this.#m.now())=>{t[h]=r!==0?c:0,e[h]=r,s(h,r)},this.#R=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,r)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),r&&r!==0&&i){let c=setTimeout(()=>{this.#p(h)?(this.#E(this.#i[h],"expire"),i[h]=void 0):s(h,l(h))},r+1);c.unref&&c.unref(),i[h]=c}}:()=>{};this.#v=(h,r)=>{if(e[r]){let c=e[r],m=t[r];if(!c||!m)return;h.ttl=c,h.start=m,h.now=n||o();let _=h.now-m;h.remainingTTL=c-_}};let n=0,o=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let r=setTimeout(()=>n=0,this.ttlResolution);r.unref&&r.unref()}return h};this.getRemainingTTL=h=>{let r=this.#s.get(h);return r===void 0?0:l(r)};let l=h=>{let r=e[h],c=t[h];if(!r||!c)return 1/0;let m=(n||o())-c;return r-m};this.#p=h=>{let r=t[h],c=e[h];return!!c&&!!r&&(n||o())-r>c}}#R=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#x=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#x=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let o=this.#d[t],l=this.#F[t];if(o&&l){let h=o-(this.#m.now()-l);n.ttl=h,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(this.#d&&this.#F){o.ttl=this.#d[t];let l=this.#m.now()-this.#F[t];o.start=Math.floor(Date.now()-l)}this.#_&&(o.size=this.#_[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:r}=i,c=this.#e(t);if(t===void 0)return r&&(r.set="deleted"),this.delete(e),this;let{noUpdateTTL:m=this.noUpdateTTL}=i;r&&!c&&(r.value=t);let _=this.#N(e,t,i.size||0,h,r);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(e);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[u]=e,this.#t[u]=t,this.#s.set(e,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#j(u,_,r),r&&(r.set="add"),m=!1,this.#D&&!c&&this.#O?.(t,e,"add");else{this.#L(u);let g=this.#t[u];if(t!==g){if(!l)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#x(u),this.#j(u,_,r),this.#t[u]=t,!c){let f=g&&this.#e(g)?g.__staleWhileFetching:g,y=f===void 0?"add":t!==f?"replace":"update";r&&(r.set=y,f!==void 0&&(r.oldValue=f)),this.#D&&this.onInsert?.(t,e,y)}}else c||(r&&(r.set="update"),this.#D&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(m||this.#H(u,n,o),r&&this.#v(r,u)),!l&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let o=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&o!==void 0&&(this.#T&&this.#S?.(o,i,"evict"),this.#f&&this.#r?.push([o,i,"evict"])),this.#x(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let o=this.#t[n];if(this.#e(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=R()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let o=this.#t[n],l=this.#e(o)?o.__staleWhileFetching:o;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let o=new AbortController,{signal:l}=i;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let h={signal:o.signal,options:i,context:s},r=(f,y=!1)=>{let{aborted:a}=o.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(a&&!y?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!w&&!y)return m(o.signal.reason,F);let b=u,p=this.#t[t];return(p===u||p===void 0&&w&&y)&&(f===void 0?b.__staleWhileFetching!==void 0?this.#t[t]=b.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,h.options,b))),f},c=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),m(f,!1)),m=(f,y)=>{let{aborted:a}=o.signal,w=a&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,b=F||i.noDeleteOnFetchRejection,p=u;if(this.#t[t]===u&&(!b||!y&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,y)=>{let a=this.#M?.(e,n,h);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>r(w,!0)))}),a&&a instanceof Promise?a.then(w=>f(w===void 0?void 0:w),y):a!==void 0&&f(a)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(r,c),g=Object.assign(u,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...h.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=W.hasSubscribers,{status:s=R()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:h=0,sizeCalculation:r=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:a,signal:w}=t;if(a&&(a.op="fetch",a.key=e,y&&(a.forceRefresh=!0),a.cache=this),!this.#U)return a&&(a.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:l,size:h,sizeCalculation:r,noUpdateTTL:c,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:u,status:a,signal:w},b=this.#s.get(e);if(b===void 0){a&&(a.fetch="miss");let p=this.#P(e,b,F,f);return p.__returned=p}else{let p=this.#t[b];if(this.#e(p)){let v=i&&p.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",v&&(a.returnedStale=!0)),v?p.__staleWhileFetching:p.__returned=p}let A=this.#p(b);if(!y&&!A)return a&&(a.fetch="hit"),this.#L(b),s&&this.#R(b),a&&this.#v(a,b),p;let z=this.#P(e,b,F,f),E=z.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=A?"stale":"refresh",E&&A&&(a.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}forceFetch(e,t={}){let i=W.hasSubscribers,{status:s=R()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:o,...l}=t;n&&o&&(n.forceRefresh=!0);let h=this.#C(e,l),r=o||h===void 0;if(n&&(n.memo=r?"miss":"hit",r||(n.value=h)),!r)return h;let c=i(e,h,{options:l,context:s});return n&&(n.value=c),this.#W(e,c,l),c}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,l=this.#s.get(e);if(l===void 0){o&&(o.get="miss");return}let h=this.#t[l],r=this.#e(h);return o&&this.#v(o,l),this.#p(l)?r?(o&&(o.get="stale-fetching"),i&&h.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),h.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),h):void 0):(o&&(o.get=r?"fetching":"hit"),this.#L(l),s&&this.#R(l),r?h.__staleWhileFetching:h)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let o=this.#u[s];this.#l[o]=this.#l[s];let l=this.#l[s];this.#u[l]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{U as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js.map new file mode 100644 index 00000000..e67832ee --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-browser.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAUD,EACVE,EAAUF,ECFhB,IAAMG,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,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,KAAKP,IAAW,KAAK,CAACuE,EAAQ3D,EAAQmI,CAAM,CAAC,CAEjD,CACF,CAKA,GAHA,KAAKvJ,GAAQ,MAAK,EACb,KAAKE,GAAS,KAAK,MAAS,EACjC,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW,KAAK,KAAKE,IAAoB,CAAA,EACnC,IAAM,QAAW,aAAa,CAAC,EAErC,KAAKA,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMmG,EAAK,KAAKnG,GACZoG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKjH,KAAgB,GAAGkH,CAAI,CAEhC,CACF", + "names": ["dummy", "metrics", "tracing", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgeTimer", "#updateItemAge", "t", "#delete", "getRemainingTTL", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js new file mode 100644 index 00000000..f21cd88c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js.map new file mode 100644 index 00000000..5dc82212 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/browser/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map new file mode 100644 index 00000000..180a381b --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-esm.d.mts","sourceRoot":"","sources":["../../src/diagnostics-channel-esm.mts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAavC,eAAO,IAAI,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9C,eAAO,IAAI,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map new file mode 100644 index 00000000..97b4b3fd --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-esm.mjs","sourceRoot":"","sources":["../../src/diagnostics-channel-esm.mts"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH,uEAAuE;AACvE,4EAA4E;AAC5E,oBAAoB;AACpB,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACvC,MAAM,CAAC,IAAI,OAAO,GAAG,KAAyB,CAAA;AAC9C,MAAM,CAAC,IAAI,OAAO,GAAG,KAAgC,CAAA;AACrD,MAAM,CAAC,0BAA0B,CAAC;KAC/B,IAAI,CAAC,EAAE,CAAC,EAAE;IACT,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACzC,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CAAC;KACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA","sourcesContent":["// This is used in ESM environments that do NOT follow the 'node' or 'browser'\n// import conditions. So, `node:diagnostics_channel` MAY be present.\n// Note that this is overridden in 'browser' conditional branch, because the\n// dynamic import can confound bundlers and cause CSP violations in browsers.\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\n/**\n * no-op polyfills for non-node environments. tries to load the actual\n * diagnostics_channel module on platforms that support it, but fails\n * gracefully if not found. This means that the first tick of metrics\n * and tracing will be missed, but that probably doesn't matter much.\n */\n\n// conditionally import from diagnostic_channel, fall back to dummyfill\n// all we actually have to mock is the hasSubscribers, since we always check\n/* v8 ignore next */\nconst dummy = { hasSubscribers: false }\nexport let metrics = dummy as Channel\nexport let tracing = dummy as TracingChannel\nimport('node:diagnostics_channel')\n .then(dc => {\n metrics = dc.channel('lru-cache:metrics')\n tracing = dc.tracingChannel('lru-cache')\n })\n .catch(() => {})\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts new file mode 100644 index 00000000..1580158b --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare let metrics: Channel; +export declare let tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-esm.d.mts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.js new file mode 100644 index 00000000..76d86f81 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/diagnostics-channel.js @@ -0,0 +1,19 @@ +/** + * no-op polyfills for non-node environments. tries to load the actual + * diagnostics_channel module on platforms that support it, but fails + * gracefully if not found. This means that the first tick of metrics + * and tracing will be missed, but that probably doesn't matter much. + */ +// conditionally import from diagnostic_channel, fall back to dummyfill +// all we actually have to mock is the hasSubscribers, since we always check +/* v8 ignore next */ +const dummy = { hasSubscribers: false }; +export let metrics = dummy; +export let tracing = dummy; +import('node:diagnostics_channel') + .then(dc => { + metrics = dc.channel('lru-cache:metrics'); + tracing = dc.tracingChannel('lru-cache'); +}) + .catch(() => { }); +//# sourceMappingURL=diagnostics-channel-esm.mjs.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts.map new file mode 100644 index 00000000..03163a94 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAA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,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js new file mode 100644 index 00000000..8a82728c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js @@ -0,0 +1,1729 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js.map new file mode 100644 index 00000000..eb81ace2 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAqC;QACrC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AACD,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAEtD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAI3B,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAe,EAAE,CAC3C,CAAC,CAAC,CAAC,I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C,IAAI,CAAC,SAAS,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACpB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,IAAI,EAAE,EAAE,CAAC;gBAC5C,IAAI,CAAC,KAAK,SAAS;oBAAE,YAAY,CAAC,CAAC,CAAC,CAAA;YACtC,CAAC;YACD,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACxC,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js new file mode 100644 index 00000000..8914cef5 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js @@ -0,0 +1,2 @@ +var L={hasSubscribers:!1},S=L,A=L;import("node:diagnostics_channel").then(u=>{S=u.channel("lru-cache:metrics"),A=u.tracingChannel("lru-cache")}).catch(()=>{});var M=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var R=()=>S.hasSubscribers||A.hasSubscribers,j=new Set,I=typeof process=="object"&&process?process:{},P=(u,e,t,i)=>{typeof I.emitWarning=="function"?I.emitWarning(u,e,t,i):console.error(`[${t}] ${e}: ${u}`)},k=u=>!j.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),G=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},x=class u{heap;length;static#o=!1;static create(e){let t=G(e);if(!t)return[];u.#o=!0;let i=new u(e,t);return u.#o=!1,i}constructor(e,t){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},U=class u{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:h,dispose:r,onInsert:c,disposeAfter:m,noDisposeOnSet:_,noUpdateTTL:d,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:y,fetchMethod:a,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:z,ignoreFetchAbort:E,backgroundFetchSize:C=1,perf:v}=e;if(this.backgroundFetchSize=C,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=v??M,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let W=t?G(t):Array;if(!W)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=y,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=a,this.#U=!!a,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new W(t),this.#u=new W(t),this.#a=0,this.#h=0,this.#y=x.create(t),this.#n=0,this.#b=0,typeof r=="function"&&(this.#S=r),typeof c=="function"&&(this.#O=c),typeof m=="function"?(this.#w=m,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#D=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let D="LRU_CACHE_UNBOUNDED";k(D)&&(j.add(D),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,u))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,r,c=this.#m.now())=>{t[h]=r!==0?c:0,e[h]=r,s(h,r)},this.#R=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,r)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),r&&r!==0&&i){let c=setTimeout(()=>{this.#p(h)?(this.#E(this.#i[h],"expire"),i[h]=void 0):s(h,l(h))},r+1);c.unref&&c.unref(),i[h]=c}}:()=>{};this.#v=(h,r)=>{if(e[r]){let c=e[r],m=t[r];if(!c||!m)return;h.ttl=c,h.start=m,h.now=n||o();let _=h.now-m;h.remainingTTL=c-_}};let n=0,o=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let r=setTimeout(()=>n=0,this.ttlResolution);r.unref&&r.unref()}return h};this.getRemainingTTL=h=>{let r=this.#s.get(h);return r===void 0?0:l(r)};let l=h=>{let r=e[h],c=t[h];if(!r||!c)return 1/0;let m=(n||o())-c;return r-m};this.#p=h=>{let r=t[h],c=e[h];return!!c&&!!r&&(n||o())-r>c}}#R=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#x=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#x=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let o=this.#d[t],l=this.#F[t];if(o&&l){let h=o-(this.#m.now()-l);n.ttl=h,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(this.#d&&this.#F){o.ttl=this.#d[t];let l=this.#m.now()-this.#F[t];o.start=Math.floor(Date.now()-l)}this.#_&&(o.size=this.#_[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:r}=i,c=this.#e(t);if(t===void 0)return r&&(r.set="deleted"),this.delete(e),this;let{noUpdateTTL:m=this.noUpdateTTL}=i;r&&!c&&(r.value=t);let _=this.#N(e,t,i.size||0,h,r);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this;let d=this.#n===0?void 0:this.#s.get(e);if(d===void 0)d=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[d]=e,this.#t[d]=t,this.#s.set(e,d),this.#l[this.#h]=d,this.#u[d]=this.#h,this.#h=d,this.#n++,this.#j(d,_,r),r&&(r.set="add"),m=!1,this.#D&&!c&&this.#O?.(t,e,"add");else{this.#L(d);let g=this.#t[d];if(t!==g){if(!l)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#x(d),this.#j(d,_,r),this.#t[d]=t,!c){let f=g&&this.#e(g)?g.__staleWhileFetching:g,y=f===void 0?"add":t!==f?"replace":"update";r&&(r.set=y,f!==void 0&&(r.oldValue=f)),this.#D&&this.onInsert?.(t,e,y)}}else c||(r&&(r.set="update"),this.#D&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(m||this.#H(d,n,o),r&&this.#v(r,d)),!l&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let o=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&o!==void 0&&(this.#T&&this.#S?.(o,i,"evict"),this.#f&&this.#r?.push([o,i,"evict"])),this.#x(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let o=this.#t[n];if(this.#e(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=R()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let o=this.#t[n],l=this.#e(o)?o.__staleWhileFetching:o;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let o=new AbortController,{signal:l}=i;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let h={signal:o.signal,options:i,context:s},r=(f,y=!1)=>{let{aborted:a}=o.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(a&&!y?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!w&&!y)return m(o.signal.reason,F);let b=d,p=this.#t[t];return(p===d||p===void 0&&w&&y)&&(f===void 0?b.__staleWhileFetching!==void 0?this.#t[t]=b.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,h.options,b))),f},c=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),m(f,!1)),m=(f,y)=>{let{aborted:a}=o.signal,w=a&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,b=F||i.noDeleteOnFetchRejection,p=d;if(this.#t[t]===d&&(!b||!y&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,y)=>{let a=this.#M?.(e,n,h);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>r(w,!0)))}),a&&a instanceof Promise?a.then(w=>f(w===void 0?void 0:w),y):a!==void 0&&f(a)};i.status&&(i.status.fetchDispatched=!0);let d=new Promise(_).then(r,c),g=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...h.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=A.hasSubscribers,{status:s=R()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,A.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:h=0,sizeCalculation:r=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:a,signal:w}=t;if(a&&(a.op="fetch",a.key=e,y&&(a.forceRefresh=!0),a.cache=this),!this.#U)return a&&(a.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:l,size:h,sizeCalculation:r,noUpdateTTL:c,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:a,signal:w},b=this.#s.get(e);if(b===void 0){a&&(a.fetch="miss");let p=this.#P(e,b,F,f);return p.__returned=p}else{let p=this.#t[b];if(this.#e(p)){let W=i&&p.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",W&&(a.returnedStale=!0)),W?p.__staleWhileFetching:p.__returned=p}let z=this.#p(b);if(!y&&!z)return a&&(a.fetch="hit"),this.#L(b),s&&this.#R(b),a&&this.#v(a,b),p;let E=this.#P(e,b,F,f),v=E.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=z?"stale":"refresh",v&&z&&(a.returnedStale=!0)),v?E.__staleWhileFetching:E.__returned=E}}forceFetch(e,t={}){let i=A.hasSubscribers,{status:s=R()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,A.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:o,...l}=t;n&&o&&(n.forceRefresh=!0);let h=this.#C(e,l),r=o||h===void 0;if(n&&(n.memo=r?"miss":"hit",r||(n.value=h)),!r)return h;let c=i(e,h,{options:l,context:s});return n&&(n.value=c),this.#W(e,c,l),c}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,l=this.#s.get(e);if(l===void 0){o&&(o.get="miss");return}let h=this.#t[l],r=this.#e(h);return o&&this.#v(o,l),this.#p(l)?r?(o&&(o.get="stale-fetching"),i&&h.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),h.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),h):void 0):(o&&(o.get=r?"fetching":"hit"),this.#L(l),s&&this.#R(l),r?h.__staleWhileFetching:h)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let o=this.#u[s];this.#l[o]=this.#l[s];let l=this.#l[s];this.#u[l]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{U as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js.map new file mode 100644 index 00000000..8e9933b6 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/diagnostics-channel-esm.mts", "../../src/perf.ts", "../../src/index.ts"], + "sourcesContent": ["// This is used in ESM environments that do NOT follow the 'node' or 'browser'\n// import conditions. So, `node:diagnostics_channel` MAY be present.\n// Note that this is overridden in 'browser' conditional branch, because the\n// dynamic import can confound bundlers and cause CSP violations in browsers.\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\n/**\n * no-op polyfills for non-node environments. tries to load the actual\n * diagnostics_channel module on platforms that support it, but fails\n * gracefully if not found. This means that the first tick of metrics\n * and tracing will be missed, but that probably doesn't matter much.\n */\n\n// conditionally import from diagnostic_channel, fall back to dummyfill\n// all we actually have to mock is the hasSubscribers, since we always check\n/* v8 ignore next */\nconst dummy = { hasSubscribers: false }\nexport let metrics = dummy as Channel\nexport let tracing = dummy as TracingChannel\nimport('node:diagnostics_channel')\n .then(dc => {\n metrics = dc.channel('lru-cache:metrics')\n tracing = dc.tracingChannel('lru-cache')\n })\n .catch(() => {})\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAoBA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EAC1BC,EAAUD,EACVE,EAAUF,EACrB,OAAO,0BAA0B,EAC9B,KAAKG,GAAK,CACTF,EAAUE,EAAG,QAAQ,mBAAmB,EACxCD,EAAUC,EAAG,eAAe,WAAW,CACzC,CAAC,EACA,MAAM,IAAK,CAAE,CAAC,ECpBV,IAAMC,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,CAAC,CAACA,GAAKA,IAAM,KAAK,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AS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW,KAAK,KAAKE,IAAoB,CAAA,EACnC,IAAM,QAAW,aAAa,CAAC,EAErC,KAAKA,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMmG,EAAK,KAAKnG,GACZoG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKjH,KAAgB,GAAGkH,CAAI,CAEhC,CACF", + "names": ["dummy", "metrics", "tracing", "dc", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgeTimer", "#updateItemAge", "t", "#delete", "getRemainingTTL", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map new file mode 100644 index 00000000..2c0f7d51 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AACvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO,CAAgC,CAAA;AACrE,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,CAA+B,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map new file mode 100644 index 00000000..83ee50aa --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mEAAmE;AACnE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAGlE,MAAM,CAAC,MAAM,OAAO,GAAqB,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACrE,MAAM,CAAC,MAAM,OAAO,GAA4B,cAAc,CAAC,WAAW,CAAC,CAAA","sourcesContent":["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts new file mode 100644 index 00000000..3e9e25d0 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import type { TracingChannel, Channel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-node.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js new file mode 100644 index 00000000..f37e0baa --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js @@ -0,0 +1,6 @@ +// simple node version that imports from node builtin +// this is built to both ESM and CommonJS on the 'node' import path +import { tracingChannel, channel } from 'node:diagnostics_channel'; +export const metrics = channel('lru-cache:metrics'); +export const tracing = tracingChannel('lru-cache'); +//# sourceMappingURL=diagnostics-channel-node.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts.map new file mode 100644 index 00000000..f460c6d7 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAoB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AACvC,cAAM,KAAK;;IAET,IAAI,EAAE,WAAW,CA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CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js new file mode 100644 index 00000000..8a82728c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js @@ -0,0 +1,1729 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js.map new file mode 100644 index 00000000..094d445e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI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AAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js new file mode 100644 index 00000000..94b9204b --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js @@ -0,0 +1,2 @@ +import{tracingChannel as G,channel as P}from"node:diagnostics_channel";var S=P("lru-cache:metrics"),W=G("lru-cache");var L=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var R=()=>S.hasSubscribers||W.hasSubscribers,U=new Set,M=typeof process=="object"&&process?process:{},k=(d,e,t,i)=>{typeof M.emitWarning=="function"?M.emitWarning(d,e,t,i):console.error(`[${t}] ${e}: ${d}`)},H=d=>!U.has(d);var T=d=>!!d&&d===Math.floor(d)&&d>0&&isFinite(d),j=d=>T(d)?d<=Math.pow(2,8)?Uint8Array:d<=Math.pow(2,16)?Uint16Array:d<=Math.pow(2,32)?Uint32Array:d<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},x=class d{heap;length;static#o=!1;static create(e){let t=j(e);if(!t)return[];d.#o=!0;let i=new d(e,t);return d.#o=!1,i}constructor(e,t){if(!d.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},I=class d{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:h,dispose:r,onInsert:c,disposeAfter:m,noDisposeOnSet:_,noUpdateTTL:u,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:y,fetchMethod:a,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:C=1,perf:E}=e;if(this.backgroundFetchSize=C,E!==void 0&&typeof E?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=E??L,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let v=t?j(t):Array;if(!v)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=y,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=a,this.#U=!!a,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new v(t),this.#u=new v(t),this.#a=0,this.#h=0,this.#y=x.create(t),this.#n=0,this.#b=0,typeof r=="function"&&(this.#S=r),typeof c=="function"&&(this.#O=c),typeof m=="function"?(this.#w=m,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#D=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let D="LRU_CACHE_UNBOUNDED";H(D)&&(U.add(D),k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,d))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,r,c=this.#m.now())=>{t[h]=r!==0?c:0,e[h]=r,s(h,r)},this.#R=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,r)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),r&&r!==0&&i){let c=setTimeout(()=>{this.#p(h)?(this.#E(this.#i[h],"expire"),i[h]=void 0):s(h,l(h))},r+1);c.unref&&c.unref(),i[h]=c}}:()=>{};this.#v=(h,r)=>{if(e[r]){let c=e[r],m=t[r];if(!c||!m)return;h.ttl=c,h.start=m,h.now=n||o();let _=h.now-m;h.remainingTTL=c-_}};let n=0,o=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let r=setTimeout(()=>n=0,this.ttlResolution);r.unref&&r.unref()}return h};this.getRemainingTTL=h=>{let r=this.#s.get(h);return r===void 0?0:l(r)};let l=h=>{let r=e[h],c=t[h];if(!r||!c)return 1/0;let m=(n||o())-c;return r-m};this.#p=h=>{let r=t[h],c=e[h];return!!c&&!!r&&(n||o())-r>c}}#R=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#x=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#x=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let o=this.#d[t],l=this.#F[t];if(o&&l){let h=o-(this.#m.now()-l);n.ttl=h,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(this.#d&&this.#F){o.ttl=this.#d[t];let l=this.#m.now()-this.#F[t];o.start=Math.floor(Date.now()-l)}this.#_&&(o.size=this.#_[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:r}=i,c=this.#e(t);if(t===void 0)return r&&(r.set="deleted"),this.delete(e),this;let{noUpdateTTL:m=this.noUpdateTTL}=i;r&&!c&&(r.value=t);let _=this.#N(e,t,i.size||0,h,r);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(e);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[u]=e,this.#t[u]=t,this.#s.set(e,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#j(u,_,r),r&&(r.set="add"),m=!1,this.#D&&!c&&this.#O?.(t,e,"add");else{this.#L(u);let g=this.#t[u];if(t!==g){if(!l)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#x(u),this.#j(u,_,r),this.#t[u]=t,!c){let f=g&&this.#e(g)?g.__staleWhileFetching:g,y=f===void 0?"add":t!==f?"replace":"update";r&&(r.set=y,f!==void 0&&(r.oldValue=f)),this.#D&&this.onInsert?.(t,e,y)}}else c||(r&&(r.set="update"),this.#D&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(m||this.#H(u,n,o),r&&this.#v(r,u)),!l&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let o=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&o!==void 0&&(this.#T&&this.#S?.(o,i,"evict"),this.#f&&this.#r?.push([o,i,"evict"])),this.#x(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let o=this.#t[n];if(this.#e(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=R()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let o=this.#t[n],l=this.#e(o)?o.__staleWhileFetching:o;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let o=new AbortController,{signal:l}=i;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let h={signal:o.signal,options:i,context:s},r=(f,y=!1)=>{let{aborted:a}=o.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(a&&!y?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!w&&!y)return m(o.signal.reason,F);let b=u,p=this.#t[t];return(p===u||p===void 0&&w&&y)&&(f===void 0?b.__staleWhileFetching!==void 0?this.#t[t]=b.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,h.options,b))),f},c=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),m(f,!1)),m=(f,y)=>{let{aborted:a}=o.signal,w=a&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,b=F||i.noDeleteOnFetchRejection,p=u;if(this.#t[t]===u&&(!b||!y&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,y)=>{let a=this.#M?.(e,n,h);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>r(w,!0)))}),a&&a instanceof Promise?a.then(w=>f(w===void 0?void 0:w),y):a!==void 0&&f(a)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(r,c),g=Object.assign(u,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...h.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=W.hasSubscribers,{status:s=R()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:h=0,sizeCalculation:r=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:a,signal:w}=t;if(a&&(a.op="fetch",a.key=e,y&&(a.forceRefresh=!0),a.cache=this),!this.#U)return a&&(a.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:l,size:h,sizeCalculation:r,noUpdateTTL:c,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:u,status:a,signal:w},b=this.#s.get(e);if(b===void 0){a&&(a.fetch="miss");let p=this.#P(e,b,F,f);return p.__returned=p}else{let p=this.#t[b];if(this.#e(p)){let v=i&&p.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",v&&(a.returnedStale=!0)),v?p.__staleWhileFetching:p.__returned=p}let A=this.#p(b);if(!y&&!A)return a&&(a.fetch="hit"),this.#L(b),s&&this.#R(b),a&&this.#v(a,b),p;let z=this.#P(e,b,F,f),E=z.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=A?"stale":"refresh",E&&A&&(a.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}forceFetch(e,t={}){let i=W.hasSubscribers,{status:s=R()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:o,...l}=t;n&&o&&(n.forceRefresh=!0);let h=this.#C(e,l),r=o||h===void 0;if(n&&(n.memo=r?"miss":"hit",r||(n.value=h)),!r)return h;let c=i(e,h,{options:l,context:s});return n&&(n.value=c),this.#W(e,c,l),c}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,l=this.#s.get(e);if(l===void 0){o&&(o.get="miss");return}let h=this.#t[l],r=this.#e(h);return o&&this.#v(o,l),this.#p(l)?r?(o&&(o.get="stale-fetching"),i&&h.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),h.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),h):void 0):(o&&(o.get=r?"fetching":"hit"),this.#L(l),s&&this.#R(l),r?h.__staleWhileFetching:h)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let o=this.#u[s];this.#l[o]=this.#l[s];let l=this.#l[s];this.#u[l]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{I as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js.map new file mode 100644 index 00000000..db2e74cd --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-node.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAEA,OAAS,kBAAAA,EAAgB,WAAAC,MAAe,2BAGjC,IAAMC,EAA4BD,EAAQ,mBAAmB,EACvDE,EAAmCH,EAAe,WAAW,ECEnE,IAAMI,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAA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IACP,KAAKrB,KAAWuF,EAAQ3D,EAAQmI,CAAM,EAEpC,KAAKxI,IACP,KAAKP,IAAW,KAAK,CAACuE,EAAQ3D,EAAQmI,CAAM,CAAC,CAEjD,CACF,CAKA,GAHA,KAAKvJ,GAAQ,MAAK,EACb,KAAKE,GAAS,KAAK,MAAS,EACjC,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW,KAAK,KAAKE,IAAoB,CAAA,EACnC,IAAM,QAAW,aAAa,CAAC,EAErC,KAAKA,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMmG,EAAK,KAAKnG,GACZoG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKjH,KAAgB,GAAGkH,CAAI,CAEhC,CACF", + "names": ["tracingChannel", "channel", "metrics", "tracing", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgeTimer", "#updateItemAge", "t", "#delete", "getRemainingTTL", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js new file mode 100644 index 00000000..f21cd88c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js.map new file mode 100644 index 00000000..5dc82212 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/package.json b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts.map new file mode 100644 index 00000000..fd6eeeed --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js new file mode 100644 index 00000000..f21cd88c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js.map new file mode 100644 index 00000000..86425c7d --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map new file mode 100644 index 00000000..912f3b52 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-react-native.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-react-native.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map new file mode 100644 index 00000000..fb2ea4ff --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-react-native.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-react-native.ts"],"names":[],"mappings":"AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACvC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAyB,CAAA;AAChD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'react-native' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts new file mode 100644 index 00000000..41f79f4f --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-react-native.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js new file mode 100644 index 00000000..50a62f96 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js @@ -0,0 +1,4 @@ +const dummy = { hasSubscribers: false }; +export const metrics = dummy; +export const tracing = dummy; +//# sourceMappingURL=diagnostics-channel-react-native.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map new file mode 100644 index 00000000..f460c6d7 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mapp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,WAAW,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js new file mode 100644 index 00000000..8a82728c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js @@ -0,0 +1,1729 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgeTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgeTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgeTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + purgeTimers[index] = undefined; + } + else { + setPurgeTimer(index, getRemainingTTL(index)); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + return getRemainingTTL(index); + }; + const getRemainingTTL = (index) => { + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js.map new file mode 100644 index 00000000..094d445e --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAqC;QACrC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,C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CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgeTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgeTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgeTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n purgeTimers[index] = undefined\n } else {\n setPurgeTimer(index, getRemainingTTL(index))\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n return getRemainingTTL(index)\n }\n const getRemainingTTL = (index: Index) => {\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js new file mode 100644 index 00000000..f21cd88c --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js.map b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js.map new file mode 100644 index 00000000..5dc82212 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/react-native/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/package.json b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/package.json new file mode 100644 index 00000000..6f543924 --- /dev/null +++ b/backend/node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/package.json @@ -0,0 +1,180 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "11.5.3", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "sideEffects": false, + "scripts": { + "build": "npm run prepare", + "prepare": "tshy && bash scripts/build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write .", + "typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts", + "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", + "prebenchmark": "npm run prepare", + "benchmark": "make -C benchmark", + "preprofile": "npm run prepare", + "profile": "make -C benchmark profile", + "lint": "oxlint --fix src test", + "postsnap": "npm run lint", + "postlint": "npm run format" + }, + "main": "./dist/commonjs/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "tshy": { + "esmDialects": [ + "browser", + "react-native", + "node" + ], + "commonjsDialects": [ + "browser", + "react-native", + "node" + ], + "exports": { + "./raw": "./src/index.ts", + ".": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "react-native": { + "types": "./dist/esm/react-native/index.d.ts", + "default": "./dist/esm/react-native/index.min.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.min.js" + }, + "react-native": { + "types": "./dist/commonjs/react-native/index.d.ts", + "default": "./dist/commonjs/react-native/index.min.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.min.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "selfLink": false + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "benchmark": "^2.1.4", + "esbuild": "^0.28.0", + "marked": "^4.2.12", + "mkdirp": "^3.0.1", + "oxlint": "^1.65.0", + "oxlint-tsgolint": "^0.22.1", + "prettier": "^3.8.3", + "tap": "^21.7.4", + "tshy": "^4.1.2", + "typedoc": "^0.28.19" + }, + "license": "BlueOak-1.0.0", + "files": [ + "dist" + ], + "engines": { + "node": "20 || >=22" + }, + "exports": { + "./raw": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.js" + }, + "react-native": { + "types": "./dist/esm/react-native/index.d.ts", + "default": "./dist/esm/react-native/index.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.js" + }, + "react-native": { + "types": "./dist/commonjs/react-native/index.d.ts", + "default": "./dist/commonjs/react-native/index.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + ".": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "react-native": { + "types": "./dist/esm/react-native/index.d.ts", + "default": "./dist/esm/react-native/index.min.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.min.js" + }, + "react-native": { + "types": "./dist/commonjs/react-native/index.d.ts", + "default": "./dist/commonjs/react-native/index.min.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.min.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "type": "module", + "module": "./dist/esm/index.min.js" +} diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.eslintrc b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.eslintrc new file mode 100644 index 00000000..d90a1bc6 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "eqeqeq": ["error", "allow-null"], + "id-length": "off", + "new-cap": ["error", { + "capIsNewExceptions": [ + "RequireObjectCoercible", + "ToObject", + ], + }], + }, +} diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.github/FUNDING.yml b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.github/FUNDING.yml new file mode 100644 index 00000000..868f4ff4 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/math-intrinsics +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/CHANGELOG.md b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/CHANGELOG.md new file mode 100644 index 00000000..9cf48f5a --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/es-shims/math-intrinsics/compare/v1.0.0...v1.1.0) - 2024-12-18 + +### Commits + +- [New] add `round` [`7cfb044`](https://github.com/es-shims/math-intrinsics/commit/7cfb04460c0fbdf1ca101eecbac3f59d11994130) +- [Tests] add attw [`e96be8f`](https://github.com/es-shims/math-intrinsics/commit/e96be8fbf58449eafe976446a0470e6ea561ad8d) +- [Dev Deps] update `@types/tape` [`30d0023`](https://github.com/es-shims/math-intrinsics/commit/30d00234ce8a3fa0094a61cd55d6686eb91e36ec) + +## v1.0.0 - 2024-12-11 + +### Commits + +- Initial implementation, tests, readme, types [`b898caa`](https://github.com/es-shims/math-intrinsics/commit/b898caae94e9994a94a42b8740f7bbcfd0a868fe) +- Initial commit [`02745b0`](https://github.com/es-shims/math-intrinsics/commit/02745b03a62255af8a332771987b55d127538d9c) +- [New] add `constants/maxArrayLength`, `mod` [`b978178`](https://github.com/es-shims/math-intrinsics/commit/b978178a57685bd23ed1c7efe2137f3784f5fcc5) +- npm init [`a39fc57`](https://github.com/es-shims/math-intrinsics/commit/a39fc57e5639a645d0bd52a0dc56202480223be2) +- Only apps should have lockfiles [`9451580`](https://github.com/es-shims/math-intrinsics/commit/94515800fb34db4f3cc7e99290042d45609ac7bd) diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/LICENSE b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/LICENSE new file mode 100644 index 00000000..34995e79 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 ECMAScript Shims + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/README.md b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/README.md new file mode 100644 index 00000000..4a66dcf2 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/README.md @@ -0,0 +1,50 @@ +# math-intrinsics [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ES Math-related intrinsics and helpers, robustly cached. + + - `abs` + - `floor` + - `isFinite` + - `isInteger` + - `isNaN` + - `isNegativeZero` + - `max` + - `min` + - `mod` + - `pow` + - `round` + - `sign` + - `constants/maxArrayLength` + - `constants/maxSafeInteger` + - `constants/maxValue` + + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/math-intrinsics +[npm-version-svg]: https://versionbadg.es/es-shims/math-intrinsics.svg +[deps-svg]: https://david-dm.org/es-shims/math-intrinsics.svg +[deps-url]: https://david-dm.org/es-shims/math-intrinsics +[dev-deps-svg]: https://david-dm.org/es-shims/math-intrinsics/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/math-intrinsics#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/math-intrinsics.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/math-intrinsics.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-object.svg +[downloads-url]: https://npm-stat.com/charts.html?package=math-intrinsics +[codecov-image]: https://codecov.io/gh/es-shims/math-intrinsics/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/es-shims/math-intrinsics/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/math-intrinsics +[actions-url]: https://github.com/es-shims/math-intrinsics/actions diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.d.ts new file mode 100644 index 00000000..14ad9c69 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.d.ts @@ -0,0 +1 @@ +export = Math.abs; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js new file mode 100644 index 00000000..a751424c --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./abs')} */ +module.exports = Math.abs; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.d.ts new file mode 100644 index 00000000..b92d46be --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.d.ts @@ -0,0 +1,3 @@ +declare const MAX_ARRAY_LENGTH: 4294967295; + +export = MAX_ARRAY_LENGTH; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.js new file mode 100644 index 00000000..cfc6affd --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxArrayLength.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./maxArrayLength')} */ +module.exports = 4294967295; // Math.pow(2, 32) - 1; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts new file mode 100644 index 00000000..fee3f621 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts @@ -0,0 +1,3 @@ +declare const MAX_SAFE_INTEGER: 9007199254740991; + +export = MAX_SAFE_INTEGER; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.js new file mode 100644 index 00000000..b568ad39 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxSafeInteger.js @@ -0,0 +1,5 @@ +'use strict'; + +/** @type {import('./maxSafeInteger')} */ +// eslint-disable-next-line no-extra-parens +module.exports = /** @type {import('./maxSafeInteger')} */ (Number.MAX_SAFE_INTEGER) || 9007199254740991; // Math.pow(2, 53) - 1; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.d.ts new file mode 100644 index 00000000..292cb827 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.d.ts @@ -0,0 +1,3 @@ +declare const MAX_VALUE: 1.7976931348623157e+308; + +export = MAX_VALUE; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.js new file mode 100644 index 00000000..a2202dc3 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/constants/maxValue.js @@ -0,0 +1,5 @@ +'use strict'; + +/** @type {import('./maxValue')} */ +// eslint-disable-next-line no-extra-parens +module.exports = /** @type {import('./maxValue')} */ (Number.MAX_VALUE) || 1.7976931348623157e+308; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.d.ts new file mode 100644 index 00000000..9265236f --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.d.ts @@ -0,0 +1 @@ +export = Math.floor; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js new file mode 100644 index 00000000..ab0e5d7d --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./floor')} */ +module.exports = Math.floor; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.d.ts new file mode 100644 index 00000000..6daae331 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.d.ts @@ -0,0 +1,3 @@ +declare function isFinite(x: unknown): x is number | bigint; + +export = isFinite; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.js new file mode 100644 index 00000000..b201a5a5 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isFinite.js @@ -0,0 +1,12 @@ +'use strict'; + +var $isNaN = require('./isNaN'); + +/** @type {import('./isFinite')} */ +module.exports = function isFinite(x) { + return (typeof x === 'number' || typeof x === 'bigint') + && !$isNaN(x) + && x !== Infinity + && x !== -Infinity; +}; + diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.d.ts new file mode 100644 index 00000000..13935a8c --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.d.ts @@ -0,0 +1,3 @@ +declare function isInteger(argument: unknown): argument is number; + +export = isInteger; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.js new file mode 100644 index 00000000..4b1b9a56 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isInteger.js @@ -0,0 +1,16 @@ +'use strict'; + +var $abs = require('./abs'); +var $floor = require('./floor'); + +var $isNaN = require('./isNaN'); +var $isFinite = require('./isFinite'); + +/** @type {import('./isInteger')} */ +module.exports = function isInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var absValue = $abs(argument); + return $floor(absValue) === absValue; +}; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.d.ts new file mode 100644 index 00000000..c1d4c552 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.d.ts @@ -0,0 +1 @@ +export = Number.isNaN; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js new file mode 100644 index 00000000..e36475cf --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isNaN')} */ +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.d.ts new file mode 100644 index 00000000..7ad88193 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.d.ts @@ -0,0 +1,3 @@ +declare function isNegativeZero(x: unknown): boolean; + +export = isNegativeZero; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.js new file mode 100644 index 00000000..b69adcc5 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNegativeZero.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isNegativeZero')} */ +module.exports = function isNegativeZero(x) { + return x === 0 && 1 / x === 1 / -0; +}; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.d.ts new file mode 100644 index 00000000..ad6f43e3 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.d.ts @@ -0,0 +1 @@ +export = Math.max; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js new file mode 100644 index 00000000..edb55dfb --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./max')} */ +module.exports = Math.max; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.d.ts new file mode 100644 index 00000000..fd90f2d5 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.d.ts @@ -0,0 +1 @@ +export = Math.min; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js new file mode 100644 index 00000000..5a4a7c71 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./min')} */ +module.exports = Math.min; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.d.ts new file mode 100644 index 00000000..549dbd46 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.d.ts @@ -0,0 +1,3 @@ +declare function mod(number: number, modulo: number): number; + +export = mod; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.js new file mode 100644 index 00000000..4a98362b --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/mod.js @@ -0,0 +1,9 @@ +'use strict'; + +var $floor = require('./floor'); + +/** @type {import('./mod')} */ +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/package.json b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/package.json new file mode 100644 index 00000000..06762735 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/package.json @@ -0,0 +1,86 @@ +{ + "name": "math-intrinsics", + "version": "1.1.0", + "description": "ES Math-related intrinsics and helpers, robustly cached.", + "main": false, + "exports": { + "./abs": "./abs.js", + "./floor": "./floor.js", + "./isFinite": "./isFinite.js", + "./isInteger": "./isInteger.js", + "./isNaN": "./isNaN.js", + "./isNegativeZero": "./isNegativeZero.js", + "./max": "./max.js", + "./min": "./min.js", + "./mod": "./mod.js", + "./pow": "./pow.js", + "./sign": "./sign.js", + "./round": "./round.js", + "./constants/maxArrayLength": "./constants/maxArrayLength.js", + "./constants/maxSafeInteger": "./constants/maxSafeInteger.js", + "./constants/maxValue": "./constants/maxValue.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>= 10.2' audit --production", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/math-intrinsics.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/es-shims/math-intrinsics/issues" + }, + "homepage": "https://github.com/es-shims/math-intrinsics#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.5.0", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.d.ts new file mode 100644 index 00000000..5873c441 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.d.ts @@ -0,0 +1 @@ +export = Math.pow; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js new file mode 100644 index 00000000..c0a41038 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./pow')} */ +module.exports = Math.pow; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.d.ts new file mode 100644 index 00000000..da1fde3f --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.d.ts @@ -0,0 +1 @@ +export = Math.round; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js new file mode 100644 index 00000000..b7921566 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./round')} */ +module.exports = Math.round; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.d.ts b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.d.ts new file mode 100644 index 00000000..c49cecaa --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.d.ts @@ -0,0 +1,3 @@ +declare function sign(x: number): number; + +export = sign; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js new file mode 100644 index 00000000..9e5173c8 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js @@ -0,0 +1,11 @@ +'use strict'; + +var $isNaN = require('./isNaN'); + +/** @type {import('./sign')} */ +module.exports = function sign(number) { + if ($isNaN(number) || number === 0) { + return number; + } + return number < 0 ? -1 : +1; +}; diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/test/index.js b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/test/index.js new file mode 100644 index 00000000..0f90a5dc --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/test/index.js @@ -0,0 +1,192 @@ +'use strict'; + +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); +var inspect = require('object-inspect'); + +var abs = require('../abs'); +var floor = require('../floor'); +var isFinite = require('../isFinite'); +var isInteger = require('../isInteger'); +var isNaN = require('../isNaN'); +var isNegativeZero = require('../isNegativeZero'); +var max = require('../max'); +var min = require('../min'); +var mod = require('../mod'); +var pow = require('../pow'); +var round = require('../round'); +var sign = require('../sign'); + +var maxArrayLength = require('../constants/maxArrayLength'); +var maxSafeInteger = require('../constants/maxSafeInteger'); +var maxValue = require('../constants/maxValue'); + +test('abs', function (t) { + t.equal(abs(-1), 1, 'abs(-1) === 1'); + t.equal(abs(+1), 1, 'abs(+1) === 1'); + t.equal(abs(+0), +0, 'abs(+0) === +0'); + t.equal(abs(-0), +0, 'abs(-0) === +0'); + + t.end(); +}); + +test('floor', function (t) { + t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); + t.equal(floor(+1.1), 1, 'floor(+1.1) === 1'); + t.equal(floor(+0), +0, 'floor(+0) === +0'); + t.equal(floor(-0), -0, 'floor(-0) === -0'); + t.equal(floor(-Infinity), -Infinity, 'floor(-Infinity) === -Infinity'); + t.equal(floor(Number(Infinity)), Number(Infinity), 'floor(+Infinity) === +Infinity'); + t.equal(floor(NaN), NaN, 'floor(NaN) === NaN'); + t.equal(floor(0), +0, 'floor(0) === +0'); + t.equal(floor(-0), -0, 'floor(-0) === -0'); + t.equal(floor(1), 1, 'floor(1) === 1'); + t.equal(floor(-1), -1, 'floor(-1) === -1'); + t.equal(floor(1.1), 1, 'floor(1.1) === 1'); + t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); + t.equal(floor(maxValue), maxValue, 'floor(maxValue) === maxValue'); + t.equal(floor(maxSafeInteger), maxSafeInteger, 'floor(maxSafeInteger) === maxSafeInteger'); + + t.end(); +}); + +test('isFinite', function (t) { + t.equal(isFinite(0), true, 'isFinite(+0) === true'); + t.equal(isFinite(-0), true, 'isFinite(-0) === true'); + t.equal(isFinite(1), true, 'isFinite(1) === true'); + t.equal(isFinite(Infinity), false, 'isFinite(Infinity) === false'); + t.equal(isFinite(-Infinity), false, 'isFinite(-Infinity) === false'); + t.equal(isFinite(NaN), false, 'isFinite(NaN) === false'); + + forEach(v.nonNumbers, function (nonNumber) { + t.equal(isFinite(nonNumber), false, 'isFinite(' + inspect(nonNumber) + ') === false'); + }); + + t.end(); +}); + +test('isInteger', function (t) { + forEach([].concat( + // @ts-expect-error TS sucks with concat + v.nonNumbers, + v.nonIntegerNumbers + ), function (nonInteger) { + t.equal(isInteger(nonInteger), false, 'isInteger(' + inspect(nonInteger) + ') === false'); + }); + + t.end(); +}); + +test('isNaN', function (t) { + forEach([].concat( + // @ts-expect-error TS sucks with concat + v.nonNumbers, + v.infinities, + v.zeroes, + v.integerNumbers + ), function (nonNaN) { + t.equal(isNaN(nonNaN), false, 'isNaN(' + inspect(nonNaN) + ') === false'); + }); + + t.equal(isNaN(NaN), true, 'isNaN(NaN) === true'); + + t.end(); +}); + +test('isNegativeZero', function (t) { + t.equal(isNegativeZero(-0), true, 'isNegativeZero(-0) === true'); + t.equal(isNegativeZero(+0), false, 'isNegativeZero(+0) === false'); + t.equal(isNegativeZero(1), false, 'isNegativeZero(1) === false'); + t.equal(isNegativeZero(-1), false, 'isNegativeZero(-1) === false'); + t.equal(isNegativeZero(NaN), false, 'isNegativeZero(NaN) === false'); + t.equal(isNegativeZero(Infinity), false, 'isNegativeZero(Infinity) === false'); + t.equal(isNegativeZero(-Infinity), false, 'isNegativeZero(-Infinity) === false'); + + forEach(v.nonNumbers, function (nonNumber) { + t.equal(isNegativeZero(nonNumber), false, 'isNegativeZero(' + inspect(nonNumber) + ') === false'); + }); + + t.end(); +}); + +test('max', function (t) { + t.equal(max(1, 2), 2, 'max(1, 2) === 2'); + t.equal(max(1, 2, 3), 3, 'max(1, 2, 3) === 3'); + t.equal(max(1, 2, 3, 4), 4, 'max(1, 2, 3, 4) === 4'); + t.equal(max(1, 2, 3, 4, 5), 5, 'max(1, 2, 3, 4, 5) === 5'); + t.equal(max(1, 2, 3, 4, 5, 6), 6, 'max(1, 2, 3, 4, 5, 6) === 6'); + t.equal(max(1, 2, 3, 4, 5, 6, 7), 7, 'max(1, 2, 3, 4, 5, 6, 7) === 7'); + + t.end(); +}); + +test('min', function (t) { + t.equal(min(1, 2), 1, 'min(1, 2) === 1'); + t.equal(min(1, 2, 3), 1, 'min(1, 2, 3) === 1'); + t.equal(min(1, 2, 3, 4), 1, 'min(1, 2, 3, 4) === 1'); + t.equal(min(1, 2, 3, 4, 5), 1, 'min(1, 2, 3, 4, 5) === 1'); + t.equal(min(1, 2, 3, 4, 5, 6), 1, 'min(1, 2, 3, 4, 5, 6) === 1'); + + t.end(); +}); + +test('mod', function (t) { + t.equal(mod(1, 2), 1, 'mod(1, 2) === 1'); + t.equal(mod(2, 2), 0, 'mod(2, 2) === 0'); + t.equal(mod(3, 2), 1, 'mod(3, 2) === 1'); + t.equal(mod(4, 2), 0, 'mod(4, 2) === 0'); + t.equal(mod(5, 2), 1, 'mod(5, 2) === 1'); + t.equal(mod(6, 2), 0, 'mod(6, 2) === 0'); + t.equal(mod(7, 2), 1, 'mod(7, 2) === 1'); + t.equal(mod(8, 2), 0, 'mod(8, 2) === 0'); + t.equal(mod(9, 2), 1, 'mod(9, 2) === 1'); + t.equal(mod(10, 2), 0, 'mod(10, 2) === 0'); + t.equal(mod(11, 2), 1, 'mod(11, 2) === 1'); + + t.end(); +}); + +test('pow', function (t) { + t.equal(pow(2, 2), 4, 'pow(2, 2) === 4'); + t.equal(pow(2, 3), 8, 'pow(2, 3) === 8'); + t.equal(pow(2, 4), 16, 'pow(2, 4) === 16'); + t.equal(pow(2, 5), 32, 'pow(2, 5) === 32'); + t.equal(pow(2, 6), 64, 'pow(2, 6) === 64'); + t.equal(pow(2, 7), 128, 'pow(2, 7) === 128'); + t.equal(pow(2, 8), 256, 'pow(2, 8) === 256'); + t.equal(pow(2, 9), 512, 'pow(2, 9) === 512'); + t.equal(pow(2, 10), 1024, 'pow(2, 10) === 1024'); + + t.end(); +}); + +test('round', function (t) { + t.equal(round(1.1), 1, 'round(1.1) === 1'); + t.equal(round(1.5), 2, 'round(1.5) === 2'); + t.equal(round(1.9), 2, 'round(1.9) === 2'); + + t.end(); +}); + +test('sign', function (t) { + t.equal(sign(-1), -1, 'sign(-1) === -1'); + t.equal(sign(+1), +1, 'sign(+1) === +1'); + t.equal(sign(+0), +0, 'sign(+0) === +0'); + t.equal(sign(-0), -0, 'sign(-0) === -0'); + t.equal(sign(NaN), NaN, 'sign(NaN) === NaN'); + t.equal(sign(Infinity), +1, 'sign(Infinity) === +1'); + t.equal(sign(-Infinity), -1, 'sign(-Infinity) === -1'); + t.equal(sign(maxValue), +1, 'sign(maxValue) === +1'); + t.equal(sign(maxSafeInteger), +1, 'sign(maxSafeInteger) === +1'); + + t.end(); +}); + +test('constants', function (t) { + t.equal(typeof maxArrayLength, 'number', 'typeof maxArrayLength === "number"'); + t.equal(typeof maxSafeInteger, 'number', 'typeof maxSafeInteger === "number"'); + t.equal(typeof maxValue, 'number', 'typeof maxValue === "number"'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/tsconfig.json b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/tsconfig.json new file mode 100644 index 00000000..b1310007 --- /dev/null +++ b/backend/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "@ljharb/tsconfig", +} diff --git a/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/HISTORY.md b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/HISTORY.md new file mode 100644 index 00000000..538ade14 --- /dev/null +++ b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/HISTORY.md @@ -0,0 +1,50 @@ +1.1.0 / 2019-04-24 +================== + + * Add `test(string)` function + +1.0.2 / 2019-04-19 +================== + + * Fix JSDoc comment for `parse` function + +1.0.1 / 2018-10-20 +================== + + * Remove left over `parameters` property from class + +1.0.0 / 2018-10-20 +================== + +This major release brings the module back to it's RFC 6838 roots. If you want +a module to parse the `Content-Type` or similar HTTP headers, use the +`content-type` module instead. + + * Drop support for Node.js below 0.8 + * Remove parameter handling, which is outside RFC 6838 scope + * Remove `parse(req)` and `parse(res)` signatures + * perf: enable strict mode + * perf: use a class for object creation + +0.3.0 / 2014-09-07 +================== + + * Support Node.js 0.6 + * Throw error when parameter format invalid on parse + +0.2.0 / 2014-06-18 +================== + + * Add `typer.format()` to format media types + +0.1.0 / 2014-06-17 +================== + + * Accept `req` as argument to `parse` + * Accept `res` as argument to `parse` + * Parse media type with extra LWS between type and first parameter + +0.0.0 / 2014-06-13 +================== + + * Initial implementation diff --git a/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/LICENSE b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/LICENSE new file mode 100644 index 00000000..84441fbb --- /dev/null +++ b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/README.md b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/README.md new file mode 100644 index 00000000..40c90725 --- /dev/null +++ b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/README.md @@ -0,0 +1,94 @@ +# media-typer + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Simple RFC 6838 media type parser. + +This module will parse a given media type into its component parts, like type, +subtype, and suffix. A formatter is also provided to put them back together and +the two can be combined to normalize media types into a canonical form. + +If you are looking to parse the string that represents a media type and its +parameters in HTTP (for example, the `Content-Type` header), use the +[content-type module](https://www.npmjs.com/package/content-type). + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install media-typer +``` + +## API + + + +```js +var typer = require('media-typer') +``` + +### typer.parse(string) + + + +```js +var obj = typer.parse('image/svg+xml') +``` + +Parse a media type string. This will return an object with the following +properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The type of the media type (always lower case). Example: `'image'` + + - `subtype`: The subtype of the media type (always lower case). Example: `'svg'` + + - `suffix`: The suffix of the media type (always lower case). Example: `'xml'` + +If the given type string is invalid, then a `TypeError` is thrown. + +### typer.format(obj) + + + +```js +var obj = typer.format({ type: 'image', subtype: 'svg', suffix: 'xml' }) +``` + +Format an object into a media type string. This will return a string of the +mime type for the given object. For the properties of the object, see the +documentation for `typer.parse(string)`. + +If any of the given object values are invalid, then a `TypeError` is thrown. + +### typer.test(string) + + + +```js +var valid = typer.test('image/svg+xml') +``` + +Validate a media type string. This will return `true` if the string is a well- +formatted media type, or `false` otherwise. + +## License + +[MIT](LICENSE) + +[ci-image]: https://img.shields.io/github/workflow/status/jshttp/media-typer/ci/master?label=ci +[ci-url]: https://github.com/jshttp/media-typer/actions/workflows/ci.yml +[npm-image]: https://img.shields.io/npm/v/media-typer.svg +[npm-url]: https://npmjs.org/package/media-typer +[node-version-image]: https://img.shields.io/node/v/media-typer.svg +[node-version-url]: https://nodejs.org/en/ +[coveralls-image]: https://img.shields.io/coveralls/jshttp/media-typer/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/media-typer?branch=master +[downloads-image]: https://img.shields.io/npm/dm/media-typer.svg +[downloads-url]: https://npmjs.org/package/media-typer diff --git a/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/index.js b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/index.js new file mode 100644 index 00000000..d273e33f --- /dev/null +++ b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/index.js @@ -0,0 +1,135 @@ +/*! + * media-typer + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to match type in RFC 6838 + * + * type-name = restricted-name + * subtype-name = restricted-name + * restricted-name = restricted-name-first *126restricted-name-chars + * restricted-name-first = ALPHA / DIGIT + * restricted-name-chars = ALPHA / DIGIT / "!" / "#" / + * "$" / "&" / "-" / "^" / "_" + * restricted-name-chars =/ "." ; Characters before first dot always + * ; specify a facet name + * restricted-name-chars =/ "+" ; Characters after last plus always + * ; specify a structured syntax suffix + * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z + * DIGIT = %x30-39 ; 0-9 + */ +var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ +var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ +var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/ + +/** + * Module exports. + */ + +exports.format = format +exports.parse = parse +exports.test = test + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format (obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var subtype = obj.subtype + var suffix = obj.suffix + var type = obj.type + + if (!type || !TYPE_NAME_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) { + throw new TypeError('invalid subtype') + } + + // format as type/subtype + var string = type + '/' + subtype + + // append +suffix + if (suffix) { + if (!TYPE_NAME_REGEXP.test(suffix)) { + throw new TypeError('invalid suffix') + } + + string += '+' + suffix + } + + return string +} + +/** + * Test media type. + * + * @param {string} string + * @return {object} + * @public + */ + +function test (string) { + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + return TYPE_REGEXP.test(string.toLowerCase()) +} + +/** + * Parse media type to object. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var match = TYPE_REGEXP.exec(string.toLowerCase()) + + if (!match) { + throw new TypeError('invalid media type') + } + + var type = match[1] + var subtype = match[2] + var suffix + + // suffix after last + + var index = subtype.lastIndexOf('+') + if (index !== -1) { + suffix = subtype.substr(index + 1) + subtype = subtype.substr(0, index) + } + + return new MediaType(type, subtype, suffix) +} + +/** + * Class for MediaType object. + * @public + */ + +function MediaType (type, subtype, suffix) { + this.type = type + this.subtype = subtype + this.suffix = suffix +} diff --git a/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/package.json b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/package.json new file mode 100644 index 00000000..afaf55f1 --- /dev/null +++ b/backend/node_modules/.pnpm/media-typer@1.1.1/node_modules/media-typer/package.json @@ -0,0 +1,37 @@ +{ + "name": "media-typer", + "description": "Simple RFC 6838 media type parser and formatter", + "version": "1.1.1", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "jshttp/media-typer", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "devDependencies": { + "eslint": "7.23.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.22.1", + "eslint-plugin-markdown": "1.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.0", + "nyc": "15.1.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/.travis.yml b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/.travis.yml new file mode 100644 index 00000000..1c4ab31e --- /dev/null +++ b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - '4' + - '6' diff --git a/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/LICENSE b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/LICENSE new file mode 100644 index 00000000..56fce089 --- /dev/null +++ b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/README.md b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/README.md new file mode 100644 index 00000000..aed17614 --- /dev/null +++ b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/README.md @@ -0,0 +1,65 @@ +# memory-pager + +Access memory using small fixed sized buffers instead of allocating a huge buffer. +Useful if you are implementing sparse data structures (such as large bitfield). + +![travis](https://travis-ci.org/mafintosh/memory-pager.svg?branch=master) + +``` +npm install memory-pager +``` + +## Usage + +``` js +var pager = require('paged-memory') + +var pages = pager(1024) // use 1kb per page + +var page = pages.get(10) // get page #10 + +console.log(page.offset) // 10240 +console.log(page.buffer) // a blank 1kb buffer +``` + +## API + +#### `var pages = pager(pageSize)` + +Create a new pager. `pageSize` defaults to `1024`. + +#### `var page = pages.get(pageNumber, [noAllocate])` + +Get a page. The page will be allocated at first access. + +Optionally you can set the `noAllocate` flag which will make the +method return undefined if no page has been allocated already + +A page looks like this + +``` js +{ + offset: byteOffset, + buffer: bufferWithPageSize +} +``` + +#### `pages.set(pageNumber, buffer)` + +Explicitly set the buffer for a page. + +#### `pages.updated(page)` + +Mark a page as updated. + +#### `pages.lastUpdate()` + +Get the last page that was updated. + +#### `var buf = pages.toBuffer()` + +Concat all pages allocated pages into a single buffer + +## License + +MIT diff --git a/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.js b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.js new file mode 100644 index 00000000..687f346f --- /dev/null +++ b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.js @@ -0,0 +1,160 @@ +module.exports = Pager + +function Pager (pageSize, opts) { + if (!(this instanceof Pager)) return new Pager(pageSize, opts) + + this.length = 0 + this.updates = [] + this.path = new Uint16Array(4) + this.pages = new Array(32768) + this.maxPages = this.pages.length + this.level = 0 + this.pageSize = pageSize || 1024 + this.deduplicate = opts ? opts.deduplicate : null + this.zeros = this.deduplicate ? alloc(this.deduplicate.length) : null +} + +Pager.prototype.updated = function (page) { + while (this.deduplicate && page.buffer[page.deduplicate] === this.deduplicate[page.deduplicate]) { + page.deduplicate++ + if (page.deduplicate === this.deduplicate.length) { + page.deduplicate = 0 + if (page.buffer.equals && page.buffer.equals(this.deduplicate)) page.buffer = this.deduplicate + break + } + } + if (page.updated || !this.updates) return + page.updated = true + this.updates.push(page) +} + +Pager.prototype.lastUpdate = function () { + if (!this.updates || !this.updates.length) return null + var page = this.updates.pop() + page.updated = false + return page +} + +Pager.prototype._array = function (i, noAllocate) { + if (i >= this.maxPages) { + if (noAllocate) return + grow(this, i) + } + + factor(i, this.path) + + var arr = this.pages + + for (var j = this.level; j > 0; j--) { + var p = this.path[j] + var next = arr[p] + + if (!next) { + if (noAllocate) return + next = arr[p] = new Array(32768) + } + + arr = next + } + + return arr +} + +Pager.prototype.get = function (i, noAllocate) { + var arr = this._array(i, noAllocate) + var first = this.path[0] + var page = arr && arr[first] + + if (!page && !noAllocate) { + page = arr[first] = new Page(i, alloc(this.pageSize)) + if (i >= this.length) this.length = i + 1 + } + + if (page && page.buffer === this.deduplicate && this.deduplicate && !noAllocate) { + page.buffer = copy(page.buffer) + page.deduplicate = 0 + } + + return page +} + +Pager.prototype.set = function (i, buf) { + var arr = this._array(i, false) + var first = this.path[0] + + if (i >= this.length) this.length = i + 1 + + if (!buf || (this.zeros && buf.equals && buf.equals(this.zeros))) { + arr[first] = undefined + return + } + + if (this.deduplicate && buf.equals && buf.equals(this.deduplicate)) { + buf = this.deduplicate + } + + var page = arr[first] + var b = truncate(buf, this.pageSize) + + if (page) page.buffer = b + else arr[first] = new Page(i, b) +} + +Pager.prototype.toBuffer = function () { + var list = new Array(this.length) + var empty = alloc(this.pageSize) + var ptr = 0 + + while (ptr < list.length) { + var arr = this._array(ptr, true) + for (var i = 0; i < 32768 && ptr < list.length; i++) { + list[ptr++] = (arr && arr[i]) ? arr[i].buffer : empty + } + } + + return Buffer.concat(list) +} + +function grow (pager, index) { + while (pager.maxPages < index) { + var old = pager.pages + pager.pages = new Array(32768) + pager.pages[0] = old + pager.level++ + pager.maxPages *= 32768 + } +} + +function truncate (buf, len) { + if (buf.length === len) return buf + if (buf.length > len) return buf.slice(0, len) + var cpy = alloc(len) + buf.copy(cpy) + return cpy +} + +function alloc (size) { + if (Buffer.alloc) return Buffer.alloc(size) + var buf = new Buffer(size) + buf.fill(0) + return buf +} + +function copy (buf) { + var cpy = Buffer.allocUnsafe ? Buffer.allocUnsafe(buf.length) : new Buffer(buf.length) + buf.copy(cpy) + return cpy +} + +function Page (i, buf) { + this.offset = i * buf.length + this.buffer = buf + this.updated = false + this.deduplicate = 0 +} + +function factor (n, out) { + n = (n - (out[0] = (n & 32767))) / 32768 + n = (n - (out[1] = (n & 32767))) / 32768 + out[3] = ((n - (out[2] = (n & 32767))) / 32768) & 32767 +} diff --git a/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/package.json b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/package.json new file mode 100644 index 00000000..f4847e8c --- /dev/null +++ b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/package.json @@ -0,0 +1,24 @@ +{ + "name": "memory-pager", + "version": "1.5.0", + "description": "Access memory using small fixed sized buffers", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "standard": "^9.0.0", + "tape": "^4.6.3" + }, + "scripts": { + "test": "standard && tape test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/mafintosh/memory-pager.git" + }, + "author": "Mathias Buus (@mafintosh)", + "license": "MIT", + "bugs": { + "url": "https://github.com/mafintosh/memory-pager/issues" + }, + "homepage": "https://github.com/mafintosh/memory-pager" +} diff --git a/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/test.js b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/test.js new file mode 100644 index 00000000..16382100 --- /dev/null +++ b/backend/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/test.js @@ -0,0 +1,80 @@ +var tape = require('tape') +var pager = require('./') + +tape('get page', function (t) { + var pages = pager(1024) + + var page = pages.get(0) + + t.same(page.offset, 0) + t.same(page.buffer, Buffer.alloc(1024)) + t.end() +}) + +tape('get page twice', function (t) { + var pages = pager(1024) + t.same(pages.length, 0) + + var page = pages.get(0) + + t.same(page.offset, 0) + t.same(page.buffer, Buffer.alloc(1024)) + t.same(pages.length, 1) + + var other = pages.get(0) + + t.same(other, page) + t.end() +}) + +tape('get no mutable page', function (t) { + var pages = pager(1024) + + t.ok(!pages.get(141, true)) + t.ok(pages.get(141)) + t.ok(pages.get(141, true)) + + t.end() +}) + +tape('get far out page', function (t) { + var pages = pager(1024) + + var page = pages.get(1000000) + + t.same(page.offset, 1000000 * 1024) + t.same(page.buffer, Buffer.alloc(1024)) + t.same(pages.length, 1000000 + 1) + + var other = pages.get(1) + + t.same(other.offset, 1024) + t.same(other.buffer, Buffer.alloc(1024)) + t.same(pages.length, 1000000 + 1) + t.ok(other !== page) + + t.end() +}) + +tape('updates', function (t) { + var pages = pager(1024) + + t.same(pages.lastUpdate(), null) + + var page = pages.get(10) + + page.buffer[42] = 1 + pages.updated(page) + + t.same(pages.lastUpdate(), page) + t.same(pages.lastUpdate(), null) + + page.buffer[42] = 2 + pages.updated(page) + pages.updated(page) + + t.same(pages.lastUpdate(), page) + t.same(pages.lastUpdate(), null) + + t.end() +}) diff --git a/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/HISTORY.md b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/HISTORY.md new file mode 100644 index 00000000..fb35becc --- /dev/null +++ b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/HISTORY.md @@ -0,0 +1,541 @@ +1.54.0 / 2025-03-17 +=================== + + * Update mime type for DCM format (#362) + * mark application/octet-stream as compressible (#163) + * Fix typo in application/x-zip-compressed mimetype (#359) + * Add mime-type for Jupyter notebooks (#282) + * Add Google Drive MIME types (#311) + * Add .blend file type (#338) + * Add support for the FBX file extension (#342) + * Add Adobe DNG file (#340) + * Add Procreate Brush and Brush Set file Types (#339) + * Add support for Procreate Dreams (#341) + * replace got with undici (#352) + * Added extensions list for model/step (#293) + * Add m4b as a type of audio/mp4 (#357) + * windows 11 application/x-zip-compressed (#346) + * add dotLottie mime type (#351) + * Add some MS-related extensions and types (#336) + +1.53.0 / 2024-07-12 +=================== + + * Add extension `.sql` to `application/sql` + * Add extensions `.aac` and `.adts` to `audio/aac` + * Add extensions `.js` and `.mjs` to `text/javascript` + * Add extensions for `application/mp4` from IANA + * Add extensions from IANA for more MIME types + * Add Microsoft app installer types and extensions + * Add new upstream MIME types + * Fix extensions for `text/markdown` to match IANA + * Remove extension `.mjs` from `application/javascript` + * Remove obsolete MIME types from IANA data + +1.52.0 / 2022-02-21 +=================== + + * Add extensions from IANA for more `image/*` types + * Add extension `.asc` to `application/pgp-keys` + * Add extensions to various XML types + * Add new upstream MIME types + +1.51.0 / 2021-11-08 +=================== + + * Add new upstream MIME types + * Mark `image/vnd.microsoft.icon` as compressible + * Mark `image/vnd.ms-dds` as compressible + +1.50.0 / 2021-09-15 +=================== + + * Add deprecated iWorks mime types and extensions + * Add new upstream MIME types + +1.49.0 / 2021-07-26 +=================== + + * Add extension `.trig` to `application/trig` + * Add new upstream MIME types + +1.48.0 / 2021-05-30 +=================== + + * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + * Add new upstream MIME types + * Mark `text/yaml` as compressible + +1.47.0 / 2021-04-01 +=================== + + * Add new upstream MIME types + * Remove ambiguous extensions from IANA for `application/*+xml` types + * Update primary extension to `.es` for `application/ecmascript` + +1.46.0 / 2021-02-13 +=================== + + * Add extension `.amr` to `audio/amr` + * Add extension `.m4s` to `video/iso.segment` + * Add extension `.opus` to `audio/ogg` + * Add new upstream MIME types + +1.45.0 / 2020-09-22 +=================== + + * Add `application/ubjson` with extension `.ubj` + * Add `image/avif` with extension `.avif` + * Add `image/ktx2` with extension `.ktx2` + * Add extension `.dbf` to `application/vnd.dbf` + * Add extension `.rar` to `application/vnd.rar` + * Add extension `.td` to `application/urc-targetdesc+xml` + * Add new upstream MIME types + * Fix extension of `application/vnd.apple.keynote` to be `.key` + +1.44.0 / 2020-04-22 +=================== + + * Add charsets from IANA + * Add extension `.cjs` to `application/node` + * Add new upstream MIME types + +1.43.0 / 2020-01-05 +=================== + + * Add `application/x-keepass2` with extension `.kdbx` + * Add extension `.mxmf` to `audio/mobile-xmf` + * Add extensions from IANA for `application/*+xml` types + * Add new upstream MIME types + +1.42.0 / 2019-09-25 +=================== + + * Add `image/vnd.ms-dds` with extension `.dds` + * Add new upstream MIME types + * Remove compressible from `multipart/mixed` + +1.41.0 / 2019-08-30 +=================== + + * Add new upstream MIME types + * Add `application/toml` with extension `.toml` + * Mark `font/ttf` as compressible + +1.40.0 / 2019-04-20 +=================== + + * Add extensions from IANA for `model/*` types + * Add `text/mdx` with extension `.mdx` + +1.39.0 / 2019-04-04 +=================== + + * Add extensions `.siv` and `.sieve` to `application/sieve` + * Add new upstream MIME types + +1.38.0 / 2019-02-04 +=================== + + * Add extension `.nq` to `application/n-quads` + * Add extension `.nt` to `application/n-triples` + * Add new upstream MIME types + * Mark `text/less` as compressible + +1.37.0 / 2018-10-19 +=================== + + * Add extensions to HEIC image types + * Add new upstream MIME types + +1.36.0 / 2018-08-20 +=================== + + * Add Apple file extensions from IANA + * Add extensions from IANA for `image/*` types + * Add new upstream MIME types + +1.35.0 / 2018-07-15 +=================== + + * Add extension `.owl` to `application/rdf+xml` + * Add new upstream MIME types + - Removes extension `.woff` from `application/font-woff` + +1.34.0 / 2018-06-03 +=================== + + * Add extension `.csl` to `application/vnd.citationstyles.style+xml` + * Add extension `.es` to `application/ecmascript` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/turtle` + * Mark all XML-derived types as compressible + +1.33.0 / 2018-02-15 +=================== + + * Add extensions from IANA for `message/*` types + * Add new upstream MIME types + * Fix some incorrect OOXML types + * Remove `application/font-woff2` + +1.32.0 / 2017-11-29 +=================== + + * Add new upstream MIME types + * Update `text/hjson` to registered `application/hjson` + * Add `text/shex` with extension `.shex` + +1.31.0 / 2017-10-25 +=================== + + * Add `application/raml+yaml` with extension `.raml` + * Add `application/wasm` with extension `.wasm` + * Add new `font` type from IANA + * Add new upstream font extensions + * Add new upstream MIME types + * Add extensions for JPEG-2000 images + +1.30.0 / 2017-08-27 +=================== + + * Add `application/vnd.ms-outlook` + * Add `application/x-arj` + * Add extension `.mjs` to `application/javascript` + * Add glTF types and extensions + * Add new upstream MIME types + * Add `text/x-org` + * Add VirtualBox MIME types + * Fix `source` records for `video/*` types that are IANA + * Update `font/opentype` to registered `font/otf` + +1.29.0 / 2017-07-10 +=================== + + * Add `application/fido.trusted-apps+json` + * Add extension `.wadl` to `application/vnd.sun.wadl+xml` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/css` + +1.28.0 / 2017-05-14 +=================== + + * Add new upstream MIME types + * Add extension `.gz` to `application/gzip` + * Update extensions `.md` and `.markdown` to be `text/markdown` + +1.27.0 / 2017-03-16 +=================== + + * Add new upstream MIME types + * Add `image/apng` with extension `.apng` + +1.26.0 / 2017-01-14 +=================== + + * Add new upstream MIME types + * Add extension `.geojson` to `application/geo+json` + +1.25.0 / 2016-11-11 +=================== + + * Add new upstream MIME types + +1.24.0 / 2016-09-18 +=================== + + * Add `audio/mp3` + * Add new upstream MIME types + +1.23.0 / 2016-05-01 +=================== + + * Add new upstream MIME types + * Add extension `.3gpp` to `audio/3gpp` + +1.22.0 / 2016-02-15 +=================== + + * Add `text/slim` + * Add extension `.rng` to `application/xml` + * Add new upstream MIME types + * Fix extension of `application/dash+xml` to be `.mpd` + * Update primary extension to `.m4a` for `audio/mp4` + +1.21.0 / 2016-01-06 +=================== + + * Add Google document types + * Add new upstream MIME types + +1.20.0 / 2015-11-10 +=================== + + * Add `text/x-suse-ymp` + * Add new upstream MIME types + +1.19.0 / 2015-09-17 +=================== + + * Add `application/vnd.apple.pkpass` + * Add new upstream MIME types + +1.18.0 / 2015-09-03 +=================== + + * Add new upstream MIME types + +1.17.0 / 2015-08-13 +=================== + + * Add `application/x-msdos-program` + * Add `audio/g711-0` + * Add `image/vnd.mozilla.apng` + * Add extension `.exe` to `application/x-msdos-program` + +1.16.0 / 2015-07-29 +=================== + + * Add `application/vnd.uri-map` + +1.15.0 / 2015-07-13 +=================== + + * Add `application/x-httpd-php` + +1.14.0 / 2015-06-25 +=================== + + * Add `application/scim+json` + * Add `application/vnd.3gpp.ussd+xml` + * Add `application/vnd.biopax.rdf+xml` + * Add `text/x-processing` + +1.13.0 / 2015-06-07 +=================== + + * Add nginx as a source + * Add `application/x-cocoa` + * Add `application/x-java-archive-diff` + * Add `application/x-makeself` + * Add `application/x-perl` + * Add `application/x-pilot` + * Add `application/x-redhat-package-manager` + * Add `application/x-sea` + * Add `audio/x-m4a` + * Add `audio/x-realaudio` + * Add `image/x-jng` + * Add `text/mathml` + +1.12.0 / 2015-06-05 +=================== + + * Add `application/bdoc` + * Add `application/vnd.hyperdrive+json` + * Add `application/x-bdoc` + * Add extension `.rtf` to `text/rtf` + +1.11.0 / 2015-05-31 +=================== + + * Add `audio/wav` + * Add `audio/wave` + * Add extension `.litcoffee` to `text/coffeescript` + * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` + * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` + +1.10.0 / 2015-05-19 +=================== + + * Add `application/vnd.balsamiq.bmpr` + * Add `application/vnd.microsoft.portable-executable` + * Add `application/x-ns-proxy-autoconfig` + +1.9.1 / 2015-04-19 +================== + + * Remove `.json` extension from `application/manifest+json` + - This is causing bugs downstream + +1.9.0 / 2015-04-19 +================== + + * Add `application/manifest+json` + * Add `application/vnd.micro+json` + * Add `image/vnd.zbrush.pcx` + * Add `image/x-ms-bmp` + +1.8.0 / 2015-03-13 +================== + + * Add `application/vnd.citationstyles.style+xml` + * Add `application/vnd.fastcopy-disk-image` + * Add `application/vnd.gov.sk.xmldatacontainer+xml` + * Add extension `.jsonld` to `application/ld+json` + +1.7.0 / 2015-02-08 +================== + + * Add `application/vnd.gerber` + * Add `application/vnd.msa-disk-image` + +1.6.1 / 2015-02-05 +================== + + * Community extensions ownership transferred from `node-mime` + +1.6.0 / 2015-01-29 +================== + + * Add `application/jose` + * Add `application/jose+json` + * Add `application/json-seq` + * Add `application/jwk+json` + * Add `application/jwk-set+json` + * Add `application/jwt` + * Add `application/rdap+json` + * Add `application/vnd.gov.sk.e-form+xml` + * Add `application/vnd.ims.imsccv1p3` + +1.5.0 / 2014-12-30 +================== + + * Add `application/vnd.oracle.resource+json` + * Fix various invalid MIME type entries + - `application/mbox+xml` + - `application/oscp-response` + - `application/vwg-multiplexed` + - `audio/g721` + +1.4.0 / 2014-12-21 +================== + + * Add `application/vnd.ims.imsccv1p2` + * Fix various invalid MIME type entries + - `application/vnd-acucobol` + - `application/vnd-curl` + - `application/vnd-dart` + - `application/vnd-dxr` + - `application/vnd-fdf` + - `application/vnd-mif` + - `application/vnd-sema` + - `application/vnd-wap-wmlc` + - `application/vnd.adobe.flash-movie` + - `application/vnd.dece-zip` + - `application/vnd.dvb_service` + - `application/vnd.micrografx-igx` + - `application/vnd.sealed-doc` + - `application/vnd.sealed-eml` + - `application/vnd.sealed-mht` + - `application/vnd.sealed-ppt` + - `application/vnd.sealed-tiff` + - `application/vnd.sealed-xls` + - `application/vnd.sealedmedia.softseal-html` + - `application/vnd.sealedmedia.softseal-pdf` + - `application/vnd.wap-slc` + - `application/vnd.wap-wbxml` + - `audio/vnd.sealedmedia.softseal-mpeg` + - `image/vnd-djvu` + - `image/vnd-svf` + - `image/vnd-wap-wbmp` + - `image/vnd.sealed-png` + - `image/vnd.sealedmedia.softseal-gif` + - `image/vnd.sealedmedia.softseal-jpg` + - `model/vnd-dwf` + - `model/vnd.parasolid.transmit-binary` + - `model/vnd.parasolid.transmit-text` + - `text/vnd-a` + - `text/vnd-curl` + - `text/vnd.wap-wml` + * Remove example template MIME types + - `application/example` + - `audio/example` + - `image/example` + - `message/example` + - `model/example` + - `multipart/example` + - `text/example` + - `video/example` + +1.3.1 / 2014-12-16 +================== + + * Fix missing extensions + - `application/json5` + - `text/hjson` + +1.3.0 / 2014-12-07 +================== + + * Add `application/a2l` + * Add `application/aml` + * Add `application/atfx` + * Add `application/atxml` + * Add `application/cdfx+xml` + * Add `application/dii` + * Add `application/json5` + * Add `application/lxf` + * Add `application/mf4` + * Add `application/vnd.apache.thrift.compact` + * Add `application/vnd.apache.thrift.json` + * Add `application/vnd.coffeescript` + * Add `application/vnd.enphase.envoy` + * Add `application/vnd.ims.imsccv1p1` + * Add `text/csv-schema` + * Add `text/hjson` + * Add `text/markdown` + * Add `text/yaml` + +1.2.0 / 2014-11-09 +================== + + * Add `application/cea` + * Add `application/dit` + * Add `application/vnd.gov.sk.e-form+zip` + * Add `application/vnd.tmd.mediaflex.api+xml` + * Type `application/epub+zip` is now IANA-registered + +1.1.2 / 2014-10-23 +================== + + * Rebuild database for `application/x-www-form-urlencoded` change + +1.1.1 / 2014-10-20 +================== + + * Mark `application/x-www-form-urlencoded` as compressible. + +1.1.0 / 2014-09-28 +================== + + * Add `application/font-woff2` + +1.0.3 / 2014-09-25 +================== + + * Fix engine requirement in package + +1.0.2 / 2014-09-25 +================== + + * Add `application/coap-group+json` + * Add `application/dcd` + * Add `application/vnd.apache.thrift.binary` + * Add `image/vnd.tencent.tap` + * Mark all JSON-derived types as compressible + * Update `text/vtt` data + +1.0.1 / 2014-08-30 +================== + + * Fix extension ordering + +1.0.0 / 2014-08-30 +================== + + * Add `application/atf` + * Add `application/merge-patch+json` + * Add `multipart/x-mixed-replace` + * Add `source: 'apache'` metadata + * Add `source: 'iana'` metadata + * Remove badly-assumed charset data diff --git a/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/LICENSE b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/LICENSE new file mode 100644 index 00000000..0751cb10 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/README.md b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/README.md new file mode 100644 index 00000000..ee93fa00 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/README.md @@ -0,0 +1,109 @@ +# mime-db + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +This is a large database of mime types and information about them. +It consists of a single, public JSON file and does not include any logic, +allowing it to remain as un-opinionated as possible with an API. +It aggregates data from the following sources: + +- https://www.iana.org/assignments/media-types/media-types.xhtml +- https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +- https://hg.nginx.org/nginx/raw-file/default/conf/mime.types + +## Installation + +```bash +npm install mime-db +``` + +### Database Download + +If you intend to use this in a web browser, you can conveniently access the JSON file via [jsDelivr](https://www.jsdelivr.com/), a popular CDN (Content Delivery Network). To ensure stability and compatibility, it is advisable to specify [a release tag](https://github.com/jshttp/mime-db/tags) instead of using the 'master' branch. This is because the JSON file's format might change in future updates, and relying on a specific release tag will prevent potential issues arising from these changes. + +``` +https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json +``` + +## Usage + +```js +var db = require('mime-db') + +// grab data on .js files +var data = db['application/javascript'] +``` + +## Data Structure + +The JSON file is a map lookup for lowercased mime types. +Each mime type has the following properties: + +- `.source` - where the mime type is defined. + If not set, it's probably a custom media type. + - `apache` - [Apache common media types](https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](https://www.iana.org/assignments/media-types/media-types.xhtml) + - `nginx` - [nginx media types](https://hg.nginx.org/nginx/raw-file/default/conf/mime.types) +- `.extensions[]` - known extensions associated with this mime type. +- `.compressible` - whether a file of this type can be gzipped. +- `.charset` - the default charset associated with this type, if any. + +If unknown, every property could be `undefined`. + +## Note on MIME Type Data and Semver + +This package considers the programmatic api as the semver compatibility. This means the MIME type resolution is *not* considered +in the semver bumps. This means that if you want to pin your `mime-db` data you will need to do it in your application. While +this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is a breaking change. + +## Contributing + +The primary way to contribute to this database is by updating the data in +one of the upstream sources. The database is updated from the upstreams +periodically and will pull in any changes. + +### Registering Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](https://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + +### Direct Inclusion + +If that is not possible / feasible, they can be added directly here as a +"custom" type. To do this, it is required to have a primary source that +definitively lists the media type. If an extension is going to be listed as +associated with this media type, the source must definitively link the +media type and extension as well. + +To edit the database, only make PRs against `src/custom-types.json` or +`src/custom-suffix.json`. + +The `src/custom-types.json` file is a JSON object with the MIME type as the +keys and the values being an object with the following keys: + +- `compressible` - leave out if you don't know, otherwise `true`/`false` to + indicate whether the data represented by the type is typically compressible. +- `extensions` - include an array of file extensions that are associated with + the type. +- `notes` - human-readable notes about the type, typically what the type is. +- `sources` - include an array of URLs of where the MIME type and the associated + extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); + links to type aggregating sites and Wikipedia are _not acceptable_. + +To update the build, run `npm run build`. + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci +[ci-url]: https://github.com/jshttp/mime-db/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://badgen.net/npm/node/mime-db +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-db +[npm-url]: https://npmjs.org/package/mime-db +[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/db.json b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/db.json new file mode 100644 index 00000000..7e747330 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/db.json @@ -0,0 +1,9342 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/3gpp-ims+xml": { + "source": "iana", + "compressible": true + }, + "application/3gpphal+json": { + "source": "iana", + "compressible": true + }, + "application/3gpphalforms+json": { + "source": "iana", + "compressible": true + }, + "application/a2l": { + "source": "iana" + }, + "application/ace+cbor": { + "source": "iana" + }, + "application/ace+json": { + "source": "iana", + "compressible": true + }, + "application/ace-groupcomm+cbor": { + "source": "iana" + }, + "application/ace-trl+cbor": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/activity+json": { + "source": "iana", + "compressible": true + }, + "application/aif+cbor": { + "source": "iana" + }, + "application/aif+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdni+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdnifilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmapparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tips+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tipsparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamcontrol+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamparams+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/appinstaller": { + "compressible": false, + "extensions": ["appinstaller"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/appx": { + "compressible": false, + "extensions": ["appx"] + }, + "application/appxbundle": { + "compressible": false, + "extensions": ["appxbundle"] + }, + "application/at+jwt": { + "source": "iana" + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomdeleted"] + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomsvc"] + }, + "application/atsc-dwd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dwd"] + }, + "application/atsc-dynamic-event-message": { + "source": "iana" + }, + "application/atsc-held+xml": { + "source": "iana", + "compressible": true, + "extensions": ["held"] + }, + "application/atsc-rdt+json": { + "source": "iana", + "compressible": true + }, + "application/atsc-rsat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsat"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana", + "compressible": true + }, + "application/automationml-aml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["aml"] + }, + "application/automationml-amlx+zip": { + "source": "iana", + "compressible": false, + "extensions": ["amlx"] + }, + "application/bacnet-xdd+zip": { + "source": "iana", + "compressible": false + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/beep+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/bufr": { + "source": "iana" + }, + "application/c2pa": { + "source": "iana" + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xcs"] + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/captive+json": { + "source": "iana", + "compressible": true + }, + "application/cbor": { + "source": "iana" + }, + "application/cbor-seq": { + "source": "iana" + }, + "application/cccex": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana", + "compressible": true + }, + "application/ccxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ccxml"] + }, + "application/cda+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/cdfx+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdfx"] + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cdni": { + "source": "iana" + }, + "application/ce+cbor": { + "source": "iana" + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana", + "compressible": true + }, + "application/cellml+xml": { + "source": "iana", + "compressible": true + }, + "application/cfw": { + "source": "iana" + }, + "application/cid-edhoc+cbor-seq": { + "source": "iana" + }, + "application/city+json": { + "source": "iana", + "compressible": true + }, + "application/city+json-seq": { + "source": "iana" + }, + "application/clr": { + "source": "iana" + }, + "application/clue+xml": { + "source": "iana", + "compressible": true + }, + "application/clue_info+xml": { + "source": "iana", + "compressible": true + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana", + "compressible": true + }, + "application/coap-eap": { + "source": "iana" + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/coap-payload": { + "source": "iana" + }, + "application/commonground": { + "source": "iana" + }, + "application/concise-problem-details+cbor": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/cose": { + "source": "iana" + }, + "application/cose-key": { + "source": "iana" + }, + "application/cose-key-set": { + "source": "iana" + }, + "application/cose-x509": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cpl"] + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana", + "compressible": true + }, + "application/cstadata+xml": { + "source": "iana", + "compressible": true + }, + "application/csvm+json": { + "source": "iana", + "compressible": true + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cwl": { + "source": "iana", + "extensions": ["cwl"] + }, + "application/cwl+json": { + "source": "iana", + "compressible": true + }, + "application/cwl+yaml": { + "source": "iana" + }, + "application/cwt": { + "source": "iana" + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpd"] + }, + "application/dash-patch+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "compressible": true, + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana", + "compressible": true + }, + "application/dicom": { + "source": "iana", + "extensions": ["dcm"] + }, + "application/dicom+json": { + "source": "iana", + "compressible": true + }, + "application/dicom+xml": { + "source": "iana", + "compressible": true + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/dns+json": { + "source": "iana", + "compressible": true + }, + "application/dns-message": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dbk"] + }, + "application/dots+cbor": { + "source": "iana" + }, + "application/dpop+jwt": { + "source": "iana" + }, + "application/dskpp+xml": { + "source": "iana", + "compressible": true + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/eat+cwt": { + "source": "iana" + }, + "application/eat+jwt": { + "source": "iana" + }, + "application/eat-bun+cbor": { + "source": "iana" + }, + "application/eat-bun+json": { + "source": "iana", + "compressible": true + }, + "application/eat-ucs+cbor": { + "source": "iana" + }, + "application/eat-ucs+json": { + "source": "iana", + "compressible": true + }, + "application/ecmascript": { + "source": "apache", + "compressible": true, + "extensions": ["ecma"] + }, + "application/edhoc+cbor-seq": { + "source": "iana" + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/efi": { + "source": "iana" + }, + "application/elm+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/elm+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.cap+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/emergencycalldata.comment+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.control+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.deviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.ecall.msd": { + "source": "iana" + }, + "application/emergencycalldata.legacyesn+json": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.providerinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.serviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.subscriberinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.veds+xml": { + "source": "iana", + "compressible": true + }, + "application/emma+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emotionml"] + }, + "application/encaprtp": { + "source": "iana" + }, + "application/entity-statement+jwt": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana", + "compressible": true + }, + "application/epub+zip": { + "source": "iana", + "compressible": false, + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/expect-ct-report+json": { + "source": "iana", + "compressible": true + }, + "application/express": { + "source": "iana", + "extensions": ["exp"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdf": { + "source": "iana", + "extensions": ["fdf"] + }, + "application/fdt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fdt"] + }, + "application/fhir+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fhir+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fido.trusted-apps+json": { + "compressible": true + }, + "application/fits": { + "source": "iana" + }, + "application/flexfec": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false + }, + "application/framework-attributes+xml": { + "source": "iana", + "compressible": true + }, + "application/geo+json": { + "source": "iana", + "compressible": true, + "extensions": ["geojson"] + }, + "application/geo+json-seq": { + "source": "iana" + }, + "application/geopackage+sqlite3": { + "source": "iana" + }, + "application/geopose+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+xml": { + "source": "iana", + "compressible": true + }, + "application/gltf-buffer": { + "source": "iana" + }, + "application/gml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["gml"] + }, + "application/gnap-binding-jws": { + "source": "iana" + }, + "application/gnap-binding-jwsd": { + "source": "iana" + }, + "application/gnap-binding-rotation-jws": { + "source": "iana" + }, + "application/gnap-binding-rotation-jwsd": { + "source": "iana" + }, + "application/gpx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["gpx"] + }, + "application/grib": { + "source": "iana" + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false, + "extensions": ["gz"] + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana", + "compressible": true + }, + "application/hjson": { + "extensions": ["hjson"] + }, + "application/hl7v2+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pkg-reply+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana", + "compressible": true, + "extensions": ["its"] + }, + "application/java-archive": { + "source": "iana", + "compressible": false, + "extensions": ["jar","war","ear"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "apache", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js"] + }, + "application/jf2feed+json": { + "source": "iana", + "compressible": true + }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/jscalendar+json": { + "source": "iana", + "compressible": true + }, + "application/jscontact+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/jsonpath": { + "source": "iana" + }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+jwt": { + "source": "iana" + }, + "application/jwt": { + "source": "iana" + }, + "application/kpml-request+xml": { + "source": "iana", + "compressible": true + }, + "application/kpml-response+xml": { + "source": "iana", + "compressible": true + }, + "application/ld+json": { + "source": "iana", + "compressible": true, + "extensions": ["jsonld"] + }, + "application/lgr+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lgr"] + }, + "application/link-format": { + "source": "iana" + }, + "application/linkset": { + "source": "iana" + }, + "application/linkset+json": { + "source": "iana", + "compressible": true + }, + "application/load-control+xml": { + "source": "iana", + "compressible": true + }, + "application/logout+jwt": { + "source": "iana" + }, + "application/lost+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana", + "compressible": true + }, + "application/lpf+zip": { + "source": "iana", + "compressible": false + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mads"] + }, + "application/manifest+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["webmanifest"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana", + "compressible": true + }, + "application/mathml-presentation+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-deregister+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-envelope+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-protection-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-reception-report+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-user-service-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbox": { + "source": "iana", + "extensions": ["mbox"] + }, + "application/media-policy-dataset+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpf"] + }, + "application/media_control+xml": { + "source": "iana", + "compressible": true + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "compressible": true, + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "compressible": true, + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mipc": { + "source": "iana" + }, + "application/missing-blocks+cbor-seq": { + "source": "iana" + }, + "application/mmt-aei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["maei"] + }, + "application/mmt-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musd"] + }, + "application/mods+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4","mpg4","mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana", + "compressible": true + }, + "application/mrb-publish+xml": { + "source": "iana", + "compressible": true + }, + "application/msc-ivr+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msc-mixer+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msix": { + "compressible": false, + "extensions": ["msix"] + }, + "application/msixbundle": { + "compressible": false, + "extensions": ["msixbundle"] + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mud+json": { + "source": "iana", + "compressible": true + }, + "application/multipart-core": { + "source": "iana" + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/n-quads": { + "source": "iana", + "extensions": ["nq"] + }, + "application/n-triples": { + "source": "iana", + "extensions": ["nt"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-groupinfo": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana", + "compressible": true + }, + "application/node": { + "source": "iana", + "extensions": ["cjs"] + }, + "application/nss": { + "source": "iana" + }, + "application/oauth-authz-req+jwt": { + "source": "iana" + }, + "application/oblivious-dns-message": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "iana" + }, + "application/octet-stream": { + "source": "iana", + "compressible": true, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odm+xml": { + "source": "iana", + "compressible": true + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/ohttp-keys": { + "source": "iana" + }, + "application/omdoc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg","one","onea"] + }, + "application/opc-nodeset+xml": { + "source": "iana", + "compressible": true + }, + "application/oscore": { + "source": "iana" + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p21": { + "source": "iana" + }, + "application/p21+zip": { + "source": "iana", + "compressible": false + }, + "application/p2p-overlay+xml": { + "source": "iana", + "compressible": true, + "extensions": ["relo"] + }, + "application/parityfec": { + "source": "iana" + }, + "application/passport": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pem-certificate-chain": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana", + "extensions": ["asc"] + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["sig","asc"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pidf-diff+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs12": { + "source": "iana" + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkcs8-encrypted": { + "source": "iana" + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/ppsp-tracker+json": { + "source": "iana", + "compressible": true + }, + "application/private-token-issuer-directory": { + "source": "iana" + }, + "application/private-token-request": { + "source": "iana" + }, + "application/private-token-response": { + "source": "iana" + }, + "application/problem+json": { + "source": "iana", + "compressible": true + }, + "application/problem+xml": { + "source": "iana", + "compressible": true + }, + "application/provenance+xml": { + "source": "iana", + "compressible": true, + "extensions": ["provx"] + }, + "application/provided-claims+jwt": { + "source": "iana" + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.cyn": { + "source": "iana", + "charset": "7-BIT" + }, + "application/prs.hpub+zip": { + "source": "iana", + "compressible": false + }, + "application/prs.implied-document+xml": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-executable": { + "source": "iana" + }, + "application/prs.implied-object+json": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-object+json-seq": { + "source": "iana" + }, + "application/prs.implied-object+yaml": { + "source": "iana" + }, + "application/prs.implied-structure": { + "source": "iana" + }, + "application/prs.mayfile": { + "source": "iana" + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.vcfbzip2": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsf"] + }, + "application/pskc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pskcxml"] + }, + "application/pvd+json": { + "source": "iana", + "compressible": true + }, + "application/qsig": { + "source": "iana" + }, + "application/raml+yaml": { + "compressible": true, + "extensions": ["raml"] + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf","owl"] + }, + "application/reginfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "apache" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resolve-response+jwt": { + "source": "iana" + }, + "application/resource-lists+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rld"] + }, + "application/rfc+xml": { + "source": "iana", + "compressible": true + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana", + "compressible": true + }, + "application/rls-services+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rs"] + }, + "application/route-apd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rapd"] + }, + "application/route-s-tsid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sls"] + }, + "application/route-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rusd"] + }, + "application/rpki-checklist": { + "source": "iana" + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-publication": { + "source": "iana" + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-signed-tal": { + "source": "iana" + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana", + "compressible": true + }, + "application/samlmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/sarif+json": { + "source": "iana", + "compressible": true + }, + "application/sarif-external-properties+json": { + "source": "iana", + "compressible": true + }, + "application/sbe": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana", + "compressible": true + }, + "application/scim+json": { + "source": "iana", + "compressible": true + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/secevent+jwt": { + "source": "iana" + }, + "application/senml+cbor": { + "source": "iana" + }, + "application/senml+json": { + "source": "iana", + "compressible": true + }, + "application/senml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["senmlx"] + }, + "application/senml-etch+cbor": { + "source": "iana" + }, + "application/senml-etch+json": { + "source": "iana", + "compressible": true + }, + "application/senml-exi": { + "source": "iana" + }, + "application/sensml+cbor": { + "source": "iana" + }, + "application/sensml+json": { + "source": "iana", + "compressible": true + }, + "application/sensml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sensmlx"] + }, + "application/sensml-exi": { + "source": "iana" + }, + "application/sep+xml": { + "source": "iana", + "compressible": true + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana", + "extensions": ["siv","sieve"] + }, + "application/simple-filter+xml": { + "source": "iana", + "compressible": true + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/sipc": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "apache" + }, + "application/smil+xml": { + "source": "iana", + "compressible": true, + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "compressible": true, + "extensions": ["srx"] + }, + "application/spdx+json": { + "source": "iana", + "compressible": true + }, + "application/spirits-event+xml": { + "source": "iana", + "compressible": true + }, + "application/sql": { + "source": "iana", + "extensions": ["sql"] + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ssdl"] + }, + "application/sslkeylogfile": { + "source": "iana" + }, + "application/ssml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ssml"] + }, + "application/st2110-41": { + "source": "iana" + }, + "application/stix+json": { + "source": "iana", + "compressible": true + }, + "application/stratum": { + "source": "iana" + }, + "application/swid+cbor": { + "source": "iana" + }, + "application/swid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["swidtag"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/taxii+json": { + "source": "iana", + "compressible": true + }, + "application/td+json": { + "source": "iana", + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tei","teicorpus"] + }, + "application/tetra_isi": { + "source": "iana" + }, + "application/thraud+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/tlsrpt+gzip": { + "source": "iana" + }, + "application/tlsrpt+json": { + "source": "iana", + "compressible": true + }, + "application/tm+json": { + "source": "iana", + "compressible": true + }, + "application/tnauthlist": { + "source": "iana" + }, + "application/toc+cbor": { + "source": "iana" + }, + "application/token-introspection+jwt": { + "source": "iana" + }, + "application/toml": { + "source": "iana", + "compressible": true, + "extensions": ["toml"] + }, + "application/trickle-ice-sdpfrag": { + "source": "iana" + }, + "application/trig": { + "source": "iana", + "extensions": ["trig"] + }, + "application/trust-chain+json": { + "source": "iana", + "compressible": true + }, + "application/trust-mark+jwt": { + "source": "iana" + }, + "application/trust-mark-delegation+jwt": { + "source": "iana" + }, + "application/ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ttml"] + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/tzif": { + "source": "iana" + }, + "application/tzif-leap": { + "source": "iana" + }, + "application/ubjson": { + "compressible": false, + "extensions": ["ubj"] + }, + "application/uccs+cbor": { + "source": "iana" + }, + "application/ujcs+json": { + "source": "iana", + "compressible": true + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/urc-ressheet+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsheet"] + }, + "application/urc-targetdesc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["td"] + }, + "application/urc-uisocketdesc+xml": { + "source": "iana", + "compressible": true + }, + "application/vc": { + "source": "iana" + }, + "application/vc+cose": { + "source": "iana" + }, + "application/vc+jwt": { + "source": "iana" + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana", + "compressible": true + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + "source": "iana", + "compressible": true, + "extensions": ["1km"] + }, + "application/vnd.1ob": { + "source": "iana" + }, + "application/vnd.3gpp-prose+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3a+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ach+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc8+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-v2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gnas": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.crs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.current-location-discovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gmop+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gtpc": { + "source": "iana" + }, + "application/vnd.3gpp.interworking-data": { + "source": "iana" + }, + "application/vnd.3gpp.lpp": { + "source": "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-payload": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-signalling": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mid-call+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ngap": { + "source": "iana" + }, + "application/vnd.3gpp.pfcp": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.pinapp-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.s1ap": { + "source": "iana" + }, + "application/vnd.3gpp.seal-group-doc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-network-qos-management-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-ue-config-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-unicast-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-user-profile-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp.sms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ussd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.v2x": { + "source": "iana" + }, + "application/vnd.3gpp.vae-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + "source": "iana" + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acm.addressxfer+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acm.chatbot+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acucobol": { + "source": "iana", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "compressible": false, + "extensions": ["air"] + }, + "application/vnd.adobe.flash.movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "apache", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + "source": "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + "source": "iana" + }, + "application/vnd.afpc.foca-charset": { + "source": "iana" + }, + "application/vnd.afpc.foca-codedfont": { + "source": "iana" + }, + "application/vnd.afpc.foca-codepage": { + "source": "iana" + }, + "application/vnd.afpc.modca": { + "source": "iana" + }, + "application/vnd.afpc.modca-cmtable": { + "source": "iana" + }, + "application/vnd.afpc.modca-formdef": { + "source": "iana" + }, + "application/vnd.afpc.modca-mediummap": { + "source": "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + "source": "iana" + }, + "application/vnd.afpc.modca-overlay": { + "source": "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + "source": "iana" + }, + "application/vnd.age": { + "source": "iana", + "extensions": ["age"] + }, + "application/vnd.ah-barcode": { + "source": "apache" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amadeus+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + "source": "iana" + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.android.ota": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anki": { + "source": "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.arrow.file": { + "source": "iana" + }, + "application/vnd.apache.arrow.stream": { + "source": "iana" + }, + "application/vnd.apache.parquet": { + "source": "iana" + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.apexlang": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.aplextor.warrp+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apothekende.reservation+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpkg"] + }, + "application/vnd.apple.keynote": { + "source": "iana", + "extensions": ["key"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.apple.numbers": { + "source": "iana", + "extensions": ["numbers"] + }, + "application/vnd.apple.pages": { + "source": "iana", + "extensions": ["pages"] + }, + "application/vnd.apple.pkpass": { + "compressible": false, + "extensions": ["pkpass"] + }, + "application/vnd.arastra.swi": { + "source": "apache" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artisan+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autodesk.fbx": { + "extensions": ["fbx"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avalon+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.avistar+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + "source": "iana" + }, + "application/vnd.banana-accounting": { + "source": "iana" + }, + "application/vnd.bbf.usp.error": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.belightsoft.lhzd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.belightsoft.lhzl+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.bint.med-content": { + "source": "iana" + }, + "application/vnd.biopax.rdf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.blink-idb-value-wrapper": { + "source": "iana" + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.bpf": { + "source": "iana" + }, + "application/vnd.bpf3": { + "source": "iana" + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.byu.uapi+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bzip3": { + "source": "iana" + }, + "application/vnd.c3voc.schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.capasystems-pg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdxml"] + }, + "application/vnd.chess-pgn": { + "source": "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.ciedi": { + "source": "iana" + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.citationstyles.style+xml": { + "source": "iana", + "compressible": true, + "extensions": ["csl"] + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { + "source": "iana" + }, + "application/vnd.cncf.helm.chart.provenance.v1.prov": { + "source": "iana" + }, + "application/vnd.cncf.helm.config.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.comicbook+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.comicbook-rar": { + "source": "iana" + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.crypto-shade-file": { + "source": "iana" + }, + "application/vnd.cryptomator.encrypted": { + "source": "iana" + }, + "application/vnd.cryptomator.vault": { + "source": "iana" + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "iana" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.cyclonedx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cyclonedx+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.d3m-dataset": { + "source": "iana" + }, + "application/vnd.d3m-problem": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "iana", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.datalog": { + "source": "iana" + }, + "application/vnd.datapackage+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dataresource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dbf": { + "source": "iana", + "extensions": ["dbf"] + }, + "application/vnd.dcmp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dcmp"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "iana", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume.movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.drive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "iana", + "extensions": ["svc"] + }, + "application/vnd.dxr": { + "source": "iana" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecip.rlp": { + "source": "iana" + }, + "application/vnd.eclipse.ditto+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.efi.img": { + "source": "iana" + }, + "application/vnd.efi.iso": { + "source": "iana" + }, + "application/vnd.eln+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.erofs": { + "source": "iana" + }, + "application/vnd.espass-espass+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "compressible": true, + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.cug+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.sci+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eu.kasparian.car+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.evolv.ecig.profile": { + "source": "iana" + }, + "application/vnd.evolv.ecig.settings": { + "source": "iana" + }, + "application/vnd.evolv.ecig.theme": { + "source": "iana" + }, + "application/vnd.exstream-empower+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.exstream-package": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.fastcopy-disk-image": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "apache", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.fdsn.stationxml+xml": { + "source": "iana", + "charset": "XML-BASED", + "compressible": true + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.ficlab.flb+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.filmit.zfc": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.freelog.comic": { + "source": "iana" + }, + "application/vnd.frogans.fnc": { + "source": "apache", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "apache", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.futoin+cbor": { + "source": "iana" + }, + "application/vnd.futoin+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.ga4gh.passport+jwt": { + "source": "iana" + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.genozip": { + "source": "iana" + }, + "application/vnd.gentics.grd+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.catmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.ebuild": { + "source": "iana" + }, + "application/vnd.gentoo.eclass": { + "source": "iana" + }, + "application/vnd.gentoo.gpkg": { + "source": "iana" + }, + "application/vnd.gentoo.manifest": { + "source": "iana" + }, + "application/vnd.gentoo.pkgmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.xpak": { + "source": "iana" + }, + "application/vnd.geo+json": { + "source": "apache", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.pinboard": { + "source": "iana" + }, + "application/vnd.geogebra.slides": { + "source": "iana", + "extensions": ["ggs"] + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.gerber": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.gnu.taler.exchange+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gnu.taler.merchant+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.google-apps.audio": {}, + "application/vnd.google-apps.document": { + "compressible": false, + "extensions": ["gdoc"] + }, + "application/vnd.google-apps.drawing": { + "compressible": false, + "extensions": ["gdraw"] + }, + "application/vnd.google-apps.drive-sdk": { + "compressible": false + }, + "application/vnd.google-apps.file": {}, + "application/vnd.google-apps.folder": { + "compressible": false + }, + "application/vnd.google-apps.form": { + "compressible": false, + "extensions": ["gform"] + }, + "application/vnd.google-apps.fusiontable": {}, + "application/vnd.google-apps.jam": { + "compressible": false, + "extensions": ["gjam"] + }, + "application/vnd.google-apps.mail-layout": {}, + "application/vnd.google-apps.map": { + "compressible": false, + "extensions": ["gmap"] + }, + "application/vnd.google-apps.photo": {}, + "application/vnd.google-apps.presentation": { + "compressible": false, + "extensions": ["gslides"] + }, + "application/vnd.google-apps.script": { + "compressible": false, + "extensions": ["gscript"] + }, + "application/vnd.google-apps.shortcut": {}, + "application/vnd.google-apps.site": { + "compressible": false, + "extensions": ["gsite"] + }, + "application/vnd.google-apps.spreadsheet": { + "compressible": false, + "extensions": ["gsheet"] + }, + "application/vnd.google-apps.unknown": {}, + "application/vnd.google-apps.video": {}, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdcf"] + }, + "application/vnd.gpxsee.map+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "compressible": true, + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.hdt": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.hsl": { + "source": "iana" + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana", + "extensions": ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyper-item+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyperdrive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "apache" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "apache", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.imagemeter.image+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.informix-visionary": { + "source": "apache" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.ipfs.ipns-record": { + "source": "iana" + }, + "application/vnd.ipld.car": { + "source": "iana" + }, + "application/vnd.ipld.dag-cbor": { + "source": "iana" + }, + "application/vnd.ipld.dag-json": { + "source": "iana" + }, + "application/vnd.ipld.raw": { + "source": "iana" + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kdl": { + "source": "iana" + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.keyman.kmp+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.keyman.kmx": { + "source": "iana" + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las": { + "source": "iana" + }, + "application/vnd.las.las+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.las.las+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lasxml"] + }, + "application/vnd.laszip": { + "source": "iana" + }, + "application/vnd.ldev.productlicensing": { + "source": "iana" + }, + "application/vnd.leap+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.liberty-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.loom": { + "source": "iana" + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + "source": "iana", + "extensions": ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxar.archive.3tz+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.mdl": { + "source": "iana" + }, + "application/vnd.mdl-mbsdf": { + "source": "iana" + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.medicalholodeck.recordxr": { + "source": "iana" + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mermaid": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micro+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "iana", + "extensions": ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + "source": "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + "source": "iana" + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "iana", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.modl": { + "source": "iana" + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-outlook": { + "compressible": false, + "extensions": ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-printschematicket+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-visio.viewer": { + "extensions": ["vdx"] + }, + "application/vnd.ms-windows.devicepairing": { + "source": "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msgpack": { + "source": "iana" + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+cbor": { + "source": "iana" + }, + "application/vnd.nato.bindingdataobject+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bdo"] + }, + "application/vnd.nato.openxmlformats-package.iepd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nearst.inv+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nebumind.line": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nimn": { + "source": "iana" + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "apache", + "extensions": ["n-gage"] + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oai.workflows": { + "source": "iana" + }, + "application/vnd.oai.workflows+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oai.workflows+yaml": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.base": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "apache", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-master-template": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.ocf+cbor": { + "source": "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+cbor": { + "source": "iana" + }, + "application/vnd.oma.lwm2m+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+tlv": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.omads-email+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-file+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-folder+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.onepager": { + "source": "iana" + }, + "application/vnd.onepagertamp": { + "source": "iana" + }, + "application/vnd.onepagertamx": { + "source": "iana" + }, + "application/vnd.onepagertat": { + "source": "iana" + }, + "application/vnd.onepagertatp": { + "source": "iana" + }, + "application/vnd.onepagertatx": { + "source": "iana" + }, + "application/vnd.onvif.metadata": { + "source": "iana" + }, + "application/vnd.openblox.game+xml": { + "source": "iana", + "compressible": true, + "extensions": ["obgx"] + }, + "application/vnd.openblox.game-binary": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osm"] + }, + "application/vnd.opentimestamps.ots": { + "source": "iana" + }, + "application/vnd.openvpi.dspx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "iana", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "iana", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "iana", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oxli.countgraph": { + "source": "iana" + }, + "application/vnd.pagerduty+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "iana" + }, + "application/vnd.patentdive": { + "source": "iana" + }, + "application/vnd.patientecommsdoc": { + "source": "iana" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.procrate.brushset": { + "extensions": ["brushset"] + }, + "application/vnd.procreate.brush": { + "extensions": ["brush"] + }, + "application/vnd.procreate.dream": { + "extensions": ["drm"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.psfs": { + "source": "iana" + }, + "application/vnd.pt.mundusmundi": { + "source": "iana" + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtm"] + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quarantainenet": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.rar": { + "source": "iana", + "extensions": ["rar"] + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musicxml"] + }, + "application/vnd.relpipe": { + "source": "iana" + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.resilient.logic": { + "source": "iana" + }, + "application/vnd.restful+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "compressible": true, + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sar": { + "source": "iana" + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "iana" + }, + "application/vnd.sealed.eml": { + "source": "iana" + }, + "application/vnd.sealed.mht": { + "source": "iana" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "iana" + }, + "application/vnd.sealed.tiff": { + "source": "iana" + }, + "application/vnd.sealed.xls": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "iana" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.seis+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sema": { + "source": "iana", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shade-save-file": { + "source": "iana" + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.shootproof+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shopkick+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shp": { + "source": "iana" + }, + "application/vnd.shx": { + "source": "iana" + }, + "application/vnd.sigrok.session": { + "source": "iana" + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sketchometry": { + "source": "iana" + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.smintio.portals.archive": { + "source": "iana" + }, + "application/vnd.snesdev-page-table": { + "source": "iana" + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sqlite3": { + "source": "iana" + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wadl"] + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.sybyl.mol2": { + "source": "iana" + }, + "application/vnd.sycle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.syft+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tableschema+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.tml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.tri.onesource": { + "source": "iana" + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uic.osdm+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uoml","uo"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.uri-map": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.vel+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veraison.tsm-report+cbor": { + "source": "iana" + }, + "application/vnd.veraison.tsm-report+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.veritone.aion+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veryant.thin": { + "source": "iana" + }, + "application/vnd.ves.encrypted": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw","vsdx","vtx"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vocalshaper.vsp4": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "iana" + }, + "application/vnd.wap.wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "iana", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.wasmflow.wafl": { + "source": "iana" + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.dpp": { + "source": "iana" + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordlift": { + "source": "iana" + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.wv.ssp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xarin.cpj": { + "source": "iana" + }, + "application/vnd.xecrets-encrypted": { + "source": "iana" + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["vxml"] + }, + "application/voucher-cms+json": { + "source": "iana", + "compressible": true + }, + "application/voucher-jws+json": { + "source": "iana", + "compressible": true + }, + "application/vp": { + "source": "iana" + }, + "application/vp+cose": { + "source": "iana" + }, + "application/vp+jwt": { + "source": "iana" + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/wasm": { + "source": "iana", + "compressible": true, + "extensions": ["wasm"] + }, + "application/watcherinfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wif"] + }, + "application/webpush-options+json": { + "source": "iana", + "compressible": true + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-arj": { + "compressible": false, + "extensions": ["arj"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blender": { + "extensions": ["blend"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-cocoa": { + "source": "nginx", + "extensions": ["cco"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-compressed": { + "extensions": ["rar"] + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "compressible": true, + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-httpd-php": { + "compressible": true, + "extensions": ["php"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-ipynb+json": { + "compressible": true, + "extensions": ["ipynb"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + "extensions": ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + "extensions": ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + "extensions": ["pages"] + }, + "application/x-java-archive-diff": { + "source": "nginx", + "extensions": ["jardiff"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-keepass2": { + "extensions": ["kdbx"] + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-makeself": { + "source": "nginx", + "extensions": ["run"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdos-program": { + "extensions": ["exe"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-ns-proxy-autoconfig": { + "compressible": true, + "extensions": ["pac"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-perl": { + "source": "nginx", + "extensions": ["pl","pm"] + }, + "application/x-pilot": { + "source": "nginx", + "extensions": ["prc","pdb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-pki-message": { + "source": "iana" + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-redhat-package-manager": { + "source": "nginx", + "extensions": ["rpm"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sea": { + "source": "nginx", + "extensions": ["sea"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl","tk"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-virtualbox-hdd": { + "compressible": true, + "extensions": ["hdd"] + }, + "application/x-virtualbox-ova": { + "compressible": true, + "extensions": ["ova"] + }, + "application/x-virtualbox-ovf": { + "compressible": true, + "extensions": ["ovf"] + }, + "application/x-virtualbox-vbox": { + "compressible": true, + "extensions": ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + "compressible": false, + "extensions": ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + "compressible": true, + "extensions": ["vdi"] + }, + "application/x-virtualbox-vhd": { + "compressible": true, + "extensions": ["vhd"] + }, + "application/x-virtualbox-vmdk": { + "compressible": true, + "extensions": ["vmdk"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "iana", + "extensions": ["der","crt","pem"] + }, + "application/x-x509-ca-ra-cert": { + "source": "iana" + }, + "application/x-x509-next-ca-cert": { + "source": "iana" + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zip-compressed": { + "extensions": ["zip"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana", + "compressible": true + }, + "application/xaml+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xav"] + }, + "application/xcap-caps+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xca"] + }, + "application/xcap-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xel"] + }, + "application/xcap-error+xml": { + "source": "iana", + "compressible": true + }, + "application/xcap-ns+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xns"] + }, + "application/xcon-conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana", + "compressible": true + }, + "application/xenc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xenc"] + }, + "application/xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "apache", + "compressible": true + }, + "application/xliff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xlf"] + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd","rng"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/xmpp+xml": { + "source": "iana", + "compressible": true + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsl","xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yaml": { + "source": "iana" + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yang-data+cbor": { + "source": "iana" + }, + "application/yang-data+json": { + "source": "iana", + "compressible": true + }, + "application/yang-data+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+json": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-sid+json": { + "source": "iana", + "compressible": true + }, + "application/yin+xml": { + "source": "iana", + "compressible": true, + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zip+dotlottie": { + "extensions": ["lottie"] + }, + "application/zlib": { + "source": "iana" + }, + "application/zstd": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana", + "compressible": false, + "extensions": ["3gpp"] + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/aac": { + "source": "iana", + "extensions": ["adts","aac"] + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana", + "extensions": ["amr"] + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/evs": { + "source": "iana" + }, + "audio/flac": { + "source": "iana" + }, + "audio/flexfec": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g711-0": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "iana" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/matroska": { + "source": "iana" + }, + "audio/melp": { + "source": "iana" + }, + "audio/melp1200": { + "source": "iana" + }, + "audio/melp2400": { + "source": "iana" + }, + "audio/melp600": { + "source": "iana" + }, + "audio/mhas": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/midi-clip": { + "source": "iana" + }, + "audio/mobile-xmf": { + "source": "iana", + "extensions": ["mxmf"] + }, + "audio/mp3": { + "compressible": false, + "extensions": ["mp3"] + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["m4a","mp4a","m4b"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx","opus"] + }, + "audio/opus": { + "source": "iana" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/scip": { + "source": "iana" + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sofa": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tetra_acelp": { + "source": "iana" + }, + "audio/tetra_acelp_bb": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/tsvcis": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/usac": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dts.uhd": { + "source": "iana" + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.presonus.multitrack": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "apache" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "iana" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/wav": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/wave": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-m4a": { + "source": "nginx", + "extensions": ["m4a"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-realaudio": { + "source": "nginx", + "extensions": ["ra"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/collection": { + "source": "iana", + "extensions": ["ttc"] + }, + "font/otf": { + "source": "iana", + "compressible": true, + "extensions": ["otf"] + }, + "font/sfnt": { + "source": "iana" + }, + "font/ttf": { + "source": "iana", + "compressible": true, + "extensions": ["ttf"] + }, + "font/woff": { + "source": "iana", + "extensions": ["woff"] + }, + "font/woff2": { + "source": "iana", + "extensions": ["woff2"] + }, + "image/aces": { + "source": "iana", + "extensions": ["exr"] + }, + "image/apng": { + "source": "iana", + "compressible": false, + "extensions": ["apng"] + }, + "image/avci": { + "source": "iana", + "extensions": ["avci"] + }, + "image/avcs": { + "source": "iana", + "extensions": ["avcs"] + }, + "image/avif": { + "source": "iana", + "compressible": false, + "extensions": ["avif"] + }, + "image/bmp": { + "source": "iana", + "compressible": true, + "extensions": ["bmp","dib"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/dicom-rle": { + "source": "iana", + "extensions": ["drle"] + }, + "image/dpx": { + "source": "iana", + "extensions": ["dpx"] + }, + "image/emf": { + "source": "iana", + "extensions": ["emf"] + }, + "image/fits": { + "source": "iana", + "extensions": ["fits"] + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/heic": { + "source": "iana", + "extensions": ["heic"] + }, + "image/heic-sequence": { + "source": "iana", + "extensions": ["heics"] + }, + "image/heif": { + "source": "iana", + "extensions": ["heif"] + }, + "image/heif-sequence": { + "source": "iana", + "extensions": ["heifs"] + }, + "image/hej2k": { + "source": "iana", + "extensions": ["hej2"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/j2c": { + "source": "iana" + }, + "image/jaii": { + "source": "iana", + "extensions": ["jaii"] + }, + "image/jais": { + "source": "iana", + "extensions": ["jais"] + }, + "image/jls": { + "source": "iana", + "extensions": ["jls"] + }, + "image/jp2": { + "source": "iana", + "compressible": false, + "extensions": ["jp2","jpg2"] + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpg","jpeg","jpe"] + }, + "image/jph": { + "source": "iana", + "extensions": ["jph"] + }, + "image/jphc": { + "source": "iana", + "extensions": ["jhc"] + }, + "image/jpm": { + "source": "iana", + "compressible": false, + "extensions": ["jpm","jpgm"] + }, + "image/jpx": { + "source": "iana", + "compressible": false, + "extensions": ["jpx","jpf"] + }, + "image/jxl": { + "source": "iana", + "extensions": ["jxl"] + }, + "image/jxr": { + "source": "iana", + "extensions": ["jxr"] + }, + "image/jxra": { + "source": "iana", + "extensions": ["jxra"] + }, + "image/jxrs": { + "source": "iana", + "extensions": ["jxrs"] + }, + "image/jxs": { + "source": "iana", + "extensions": ["jxs"] + }, + "image/jxsc": { + "source": "iana", + "extensions": ["jxsc"] + }, + "image/jxsi": { + "source": "iana", + "extensions": ["jxsi"] + }, + "image/jxss": { + "source": "iana", + "extensions": ["jxss"] + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/ktx2": { + "source": "iana", + "extensions": ["ktx2"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false, + "extensions": ["jfif"] + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif","btf"] + }, + "image/prs.pti": { + "source": "iana", + "extensions": ["pti"] + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana", + "extensions": ["t38"] + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tif","tiff"] + }, + "image/tiff-fx": { + "source": "iana", + "extensions": ["tfx"] + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana", + "extensions": ["azv"] + }, + "image/vnd.clip": { + "source": "iana" + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "iana", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana", + "compressible": true, + "extensions": ["ico"] + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.mozilla.apng": { + "source": "iana" + }, + "image/vnd.ms-dds": { + "compressible": true, + "extensions": ["dds"] + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.pco.b16": { + "source": "iana", + "extensions": ["b16"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "iana" + }, + "image/vnd.svf": { + "source": "iana" + }, + "image/vnd.tencent.tap": { + "source": "iana", + "extensions": ["tap"] + }, + "image/vnd.valve.source.texture": { + "source": "iana", + "extensions": ["vtf"] + }, + "image/vnd.wap.wbmp": { + "source": "iana", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/vnd.zbrush.pcx": { + "source": "iana", + "extensions": ["pcx"] + }, + "image/webp": { + "source": "iana", + "extensions": ["webp"] + }, + "image/wmf": { + "source": "iana", + "extensions": ["wmf"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-adobe-dng": { + "extensions": ["dng"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-emf": { + "source": "iana" + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-jng": { + "source": "nginx", + "extensions": ["jng"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-ms-bmp": { + "source": "nginx", + "compressible": true, + "extensions": ["bmp"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-wmf": { + "source": "iana" + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/bhttp": { + "source": "iana" + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana", + "extensions": [ + "disposition-notification" + ] + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana", + "extensions": ["u8msg"] + }, + "message/global-delivery-status": { + "source": "iana", + "extensions": ["u8dsn"] + }, + "message/global-disposition-notification": { + "source": "iana", + "extensions": ["u8mdn"] + }, + "message/global-headers": { + "source": "iana", + "extensions": ["u8hdr"] + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/mls": { + "source": "iana" + }, + "message/news": { + "source": "apache" + }, + "message/ohttp-req": { + "source": "iana" + }, + "message/ohttp-res": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime","mht","mhtml"] + }, + "message/s-http": { + "source": "apache" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "apache" + }, + "message/vnd.wfa.wsc": { + "source": "iana", + "extensions": ["wsc"] + }, + "model/3mf": { + "source": "iana", + "extensions": ["3mf"] + }, + "model/e57": { + "source": "iana" + }, + "model/gltf+json": { + "source": "iana", + "compressible": true, + "extensions": ["gltf"] + }, + "model/gltf-binary": { + "source": "iana", + "compressible": true, + "extensions": ["glb"] + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/jt": { + "source": "iana", + "extensions": ["jt"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/mtl": { + "source": "iana", + "extensions": ["mtl"] + }, + "model/obj": { + "source": "iana", + "extensions": ["obj"] + }, + "model/prc": { + "source": "iana", + "extensions": ["prc"] + }, + "model/step": { + "source": "iana", + "extensions": ["step","stp","stpnc","p21","210"] + }, + "model/step+xml": { + "source": "iana", + "compressible": true, + "extensions": ["stpx"] + }, + "model/step+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpz"] + }, + "model/step-xml+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpxz"] + }, + "model/stl": { + "source": "iana", + "extensions": ["stl"] + }, + "model/u3d": { + "source": "iana", + "extensions": ["u3d"] + }, + "model/vnd.bary": { + "source": "iana", + "extensions": ["bary"] + }, + "model/vnd.cld": { + "source": "iana", + "extensions": ["cld"] + }, + "model/vnd.collada+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "iana", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "apache" + }, + "model/vnd.gs.gdl": { + "source": "iana" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana", + "compressible": true + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana", + "extensions": ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + "source": "iana", + "extensions": ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + "source": "iana", + "extensions": ["x_t"] + }, + "model/vnd.pytha.pyox": { + "source": "iana", + "extensions": ["pyo","pyox"] + }, + "model/vnd.rosette.annotated-data-model": { + "source": "iana" + }, + "model/vnd.sap.vds": { + "source": "iana", + "extensions": ["vds"] + }, + "model/vnd.usda": { + "source": "iana", + "extensions": ["usda"] + }, + "model/vnd.usdz+zip": { + "source": "iana", + "compressible": false, + "extensions": ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana", + "extensions": ["bsp"] + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana", + "extensions": ["x3db"] + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana", + "extensions": ["x3dv"] + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana" + }, + "multipart/multilingual": { + "source": "iana" + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/vnd.bint.med-plus": { + "source": "iana" + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee","litcoffee"] + }, + "text/cql": { + "source": "iana" + }, + "text/cql-expression": { + "source": "iana" + }, + "text/cql-identifier": { + "source": "iana" + }, + "text/css": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "apache" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/fhirpath": { + "source": "iana" + }, + "text/flexfec": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/gff3": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/hl7v2": { + "source": "iana" + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm","shtml"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js","mjs"] + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "compressible": true, + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana", + "compressible": true, + "extensions": ["md","markdown"] + }, + "text/mathml": { + "source": "nginx", + "extensions": ["mml"] + }, + "text/mdx": { + "compressible": true, + "extensions": ["mdx"] + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana", + "charset": "UTF-8" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana", + "charset": "UTF-8" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/prs.prop.logic": { + "source": "iana" + }, + "text/prs.texi": { + "source": "iana" + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/shaclc": { + "source": "iana" + }, + "text/shex": { + "source": "iana", + "extensions": ["shex"] + }, + "text/slim": { + "extensions": ["slim","slm"] + }, + "text/spdx": { + "source": "iana", + "extensions": ["spdx"] + }, + "text/strings": { + "source": "iana" + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd.a": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.ascii-art": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "iana", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.exchangeable": { + "source": "iana" + }, + "text/vnd.familysearch.gedcom": { + "source": "iana", + "extensions": ["ged"] + }, + "text/vnd.ficlab.flt": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.gml": { + "source": "iana" + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.hans": { + "source": "iana" + }, + "text/vnd.hgl": { + "source": "iana" + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.senx.warpscript": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "apache" + }, + "text/vnd.sosi": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.vcf": { + "source": "iana" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "iana", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vnd.zoo.kcl": { + "source": "iana" + }, + "text/vtt": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/wgsl": { + "source": "iana", + "extensions": ["wgsl"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "source": "nginx", + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-org": { + "compressible": true, + "extensions": ["org"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-processing": { + "compressible": true, + "extensions": ["pde"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-suse-ymp": { + "compressible": true, + "extensions": ["ymp"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml"] + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "compressible": true, + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "iana" + }, + "video/3gpp": { + "source": "iana", + "extensions": ["3gp","3gpp"] + }, + "video/3gpp-tt": { + "source": "iana" + }, + "video/3gpp2": { + "source": "iana", + "extensions": ["3g2"] + }, + "video/av1": { + "source": "iana" + }, + "video/bmpeg": { + "source": "iana" + }, + "video/bt656": { + "source": "iana" + }, + "video/celb": { + "source": "iana" + }, + "video/dv": { + "source": "iana" + }, + "video/encaprtp": { + "source": "iana" + }, + "video/evc": { + "source": "iana" + }, + "video/ffv1": { + "source": "iana" + }, + "video/flexfec": { + "source": "iana" + }, + "video/h261": { + "source": "iana", + "extensions": ["h261"] + }, + "video/h263": { + "source": "iana", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "iana" + }, + "video/h263-2000": { + "source": "iana" + }, + "video/h264": { + "source": "iana", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "iana" + }, + "video/h264-svc": { + "source": "iana" + }, + "video/h265": { + "source": "iana" + }, + "video/h266": { + "source": "iana" + }, + "video/iso.segment": { + "source": "iana", + "extensions": ["m4s"] + }, + "video/jpeg": { + "source": "iana", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "iana" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/jxsv": { + "source": "iana" + }, + "video/lottie+json": { + "source": "iana", + "compressible": true + }, + "video/matroska": { + "source": "iana" + }, + "video/matroska-3d": { + "source": "iana" + }, + "video/mj2": { + "source": "iana", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "iana" + }, + "video/mp2p": { + "source": "iana" + }, + "video/mp2t": { + "source": "iana", + "extensions": ["ts","m2t","m2ts","mts"] + }, + "video/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "iana" + }, + "video/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "iana" + }, + "video/mpv": { + "source": "iana" + }, + "video/nv": { + "source": "iana" + }, + "video/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "iana" + }, + "video/pointer": { + "source": "iana" + }, + "video/quicktime": { + "source": "iana", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raptorfec": { + "source": "iana" + }, + "video/raw": { + "source": "iana" + }, + "video/rtp-enc-aescm128": { + "source": "iana" + }, + "video/rtploopback": { + "source": "iana" + }, + "video/rtx": { + "source": "iana" + }, + "video/scip": { + "source": "iana" + }, + "video/smpte291": { + "source": "iana" + }, + "video/smpte292m": { + "source": "iana" + }, + "video/ulpfec": { + "source": "iana" + }, + "video/vc1": { + "source": "iana" + }, + "video/vc2": { + "source": "iana" + }, + "video/vnd.cctv": { + "source": "iana" + }, + "video/vnd.dece.hd": { + "source": "iana", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "iana", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "iana" + }, + "video/vnd.dece.pd": { + "source": "iana", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "iana", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "iana", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "iana" + }, + "video/vnd.directv.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dvb.file": { + "source": "iana", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "iana", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "iana" + }, + "video/vnd.motorola.video": { + "source": "iana" + }, + "video/vnd.motorola.videop": { + "source": "iana" + }, + "video/vnd.mpegurl": { + "source": "iana", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "iana", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "iana" + }, + "video/vnd.nokia.mp4vr": { + "source": "iana" + }, + "video/vnd.nokia.videovoip": { + "source": "iana" + }, + "video/vnd.objectvideo": { + "source": "iana" + }, + "video/vnd.planar": { + "source": "iana" + }, + "video/vnd.radgamettools.bink": { + "source": "iana" + }, + "video/vnd.radgamettools.smacker": { + "source": "apache" + }, + "video/vnd.sealed.mpeg1": { + "source": "iana" + }, + "video/vnd.sealed.mpeg4": { + "source": "iana" + }, + "video/vnd.sealed.swf": { + "source": "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "iana" + }, + "video/vnd.uvvu.mp4": { + "source": "iana", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "iana", + "extensions": ["viv"] + }, + "video/vnd.youtube.yt": { + "source": "iana" + }, + "video/vp8": { + "source": "iana" + }, + "video/vp9": { + "source": "iana" + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js new file mode 100644 index 00000000..ec2be30d --- /dev/null +++ b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js @@ -0,0 +1,12 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/package.json b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/package.json new file mode 100644 index 00000000..289a370c --- /dev/null +++ b/backend/node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/package.json @@ -0,0 +1,56 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.54.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)", + "Robert Kieffer (http://github.com/broofa)" + ], + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": "jshttp/mime-db", + "devDependencies": { + "csv-parse": "4.16.3", + "eslint": "8.32.0", + "eslint-config-standard": "15.0.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-standard": "4.1.0", + "media-typer": "1.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0", + "stream-to-array": "2.3.0", + "undici": "7.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "db.json", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build", + "fetch": "node scripts/fetch-apache && node scripts/fetch-iana && node scripts/fetch-nginx", + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-db b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-db new file mode 120000 index 00000000..2afaede5 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-db @@ -0,0 +1 @@ +../../mime-db@1.54.0/node_modules/mime-db \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/HISTORY.md b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/HISTORY.md new file mode 100644 index 00000000..9ba2dc07 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/HISTORY.md @@ -0,0 +1,428 @@ +3.0.2 / 2025-11-20 +=================== + +* Fix: update JSDoc to reflect that functions return only `false` or `string`, not `boolean|string`. +* Fix: refined mime-score logic so `.mp4` resolves correctly +* Fix:reflect the current Node.js version supported to ≥ 18 (See 3.0.0 for more details). + +3.0.1 / 2025-03-26 +=================== + +* deps: mime-db@1.54.0 + +3.0.0 / 2024-08-31 +=================== + +* Drop support for node <18 +* deps: mime-db@1.53.0 +* resolve extension conflicts with mime-score (#119) + * asc -> application/pgp-signature is now application/pgp-keys + * mpp -> application/vnd.ms-project is now application/dash-patch+xml + * ac -> application/vnd.nokia.n-gage.ac+xml is now application/pkix-attr-cert + * bdoc -> application/x-bdoc is now application/bdoc + * wmz -> application/x-msmetafile is now application/x-ms-wmz + * xsl -> application/xslt+xml is now application/xml + * wav -> audio/wave is now audio/wav + * rtf -> text/rtf is now application/rtf + * xml -> text/xml is now application/xml + * mp4 -> video/mp4 is now application/mp4 + * mpg4 -> video/mp4 is now application/mp4 + + +2.1.35 / 2022-03-12 +=================== + + * deps: mime-db@1.52.0 + - Add extensions from IANA for more `image/*` types + - Add extension `.asc` to `application/pgp-keys` + - Add extensions to various XML types + - Add new upstream MIME types + +2.1.34 / 2021-11-08 +=================== + + * deps: mime-db@1.51.0 + - Add new upstream MIME types + +2.1.33 / 2021-10-01 +=================== + + * deps: mime-db@1.50.0 + - Add deprecated iWorks mime types and extensions + - Add new upstream MIME types + +2.1.32 / 2021-07-27 +=================== + + * deps: mime-db@1.49.0 + - Add extension `.trig` to `application/trig` + - Add new upstream MIME types + +2.1.31 / 2021-06-01 +=================== + + * deps: mime-db@1.48.0 + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add new upstream MIME types + +2.1.30 / 2021-04-02 +=================== + + * deps: mime-db@1.47.0 + - Add extension `.amr` to `audio/amr` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +2.1.29 / 2021-02-17 +=================== + + * deps: mime-db@1.46.0 + - Add extension `.amr` to `audio/amr` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.opus` to `audio/ogg` + - Add new upstream MIME types + +2.1.28 / 2021-01-01 +=================== + + * deps: mime-db@1.45.0 + - Add `application/ubjson` with extension `.ubj` + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + +2.1.27 / 2020-04-23 +=================== + + * deps: mime-db@1.44.0 + - Add charsets from IANA + - Add extension `.cjs` to `application/node` + - Add new upstream MIME types + +2.1.26 / 2020-01-05 +=================== + + * deps: mime-db@1.43.0 + - Add `application/x-keepass2` with extension `.kdbx` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extensions from IANA for `application/*+xml` types + - Add new upstream MIME types + +2.1.25 / 2019-11-12 +=================== + + * deps: mime-db@1.42.0 + - Add new upstream MIME types + - Add `application/toml` with extension `.toml` + - Add `image/vnd.ms-dds` with extension `.dds` + +2.1.24 / 2019-04-20 +=================== + + * deps: mime-db@1.40.0 + - Add extensions from IANA for `model/*` types + - Add `text/mdx` with extension `.mdx` + +2.1.23 / 2019-04-17 +=================== + + * deps: mime-db@~1.39.0 + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add new upstream MIME types + +2.1.22 / 2019-02-14 +=================== + + * deps: mime-db@~1.38.0 + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add new upstream MIME types + +2.1.21 / 2018-10-19 +=================== + + * deps: mime-db@~1.37.0 + - Add extensions to HEIC image types + - Add new upstream MIME types + +2.1.20 / 2018-08-26 +=================== + + * deps: mime-db@~1.36.0 + - Add Apple file extensions from IANA + - Add extensions from IANA for `image/*` types + - Add new upstream MIME types + +2.1.19 / 2018-07-17 +=================== + + * deps: mime-db@~1.35.0 + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.owl` to `application/rdf+xml` + - Add new upstream MIME types + - Add UTF-8 as default charset for `text/turtle` + +2.1.18 / 2018-02-16 +=================== + + * deps: mime-db@~1.33.0 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add new upstream MIME types + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +2.1.17 / 2017-09-01 +=================== + + * deps: mime-db@~1.30.0 + - Add `application/vnd.ms-outlook` + - Add `application/x-arj` + - Add extension `.mjs` to `application/javascript` + - Add glTF types and extensions + - Add new upstream MIME types + - Add `text/x-org` + - Add VirtualBox MIME types + - Fix `source` records for `video/*` types that are IANA + - Update `font/opentype` to registered `font/otf` + +2.1.16 / 2017-07-24 +=================== + + * deps: mime-db@~1.29.0 + - Add `application/fido.trusted-apps+json` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add new upstream MIME types + - Update extensions `.md` and `.markdown` to be `text/markdown` + +2.1.15 / 2017-03-23 +=================== + + * deps: mime-db@~1.27.0 + - Add new mime types + - Add `image/apng` + +2.1.14 / 2017-01-14 +=================== + + * deps: mime-db@~1.26.0 + - Add new mime types + +2.1.13 / 2016-11-18 +=================== + + * deps: mime-db@~1.25.0 + - Add new mime types + +2.1.12 / 2016-09-18 +=================== + + * deps: mime-db@~1.24.0 + - Add new mime types + - Add `audio/mp3` + +2.1.11 / 2016-05-01 +=================== + + * deps: mime-db@~1.23.0 + - Add new mime types + +2.1.10 / 2016-02-15 +=================== + + * deps: mime-db@~1.22.0 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +2.1.9 / 2016-01-06 +================== + + * deps: mime-db@~1.21.0 + - Add new mime types + +2.1.8 / 2015-11-30 +================== + + * deps: mime-db@~1.20.0 + - Add new mime types + +2.1.7 / 2015-09-20 +================== + + * deps: mime-db@~1.19.0 + - Add new mime types + +2.1.6 / 2015-09-03 +================== + + * deps: mime-db@~1.18.0 + - Add new mime types + +2.1.5 / 2015-08-20 +================== + + * deps: mime-db@~1.17.0 + - Add new mime types + +2.1.4 / 2015-07-30 +================== + + * deps: mime-db@~1.16.0 + - Add new mime types + +2.1.3 / 2015-07-13 +================== + + * deps: mime-db@~1.15.0 + - Add new mime types + +2.1.2 / 2015-06-25 +================== + + * deps: mime-db@~1.14.0 + - Add new mime types + +2.1.1 / 2015-06-08 +================== + + * perf: fix deopt during mapping + +2.1.0 / 2015-06-07 +================== + + * Fix incorrectly treating extension-less file name as extension + - i.e. `'path/to/json'` will no longer return `application/json` + * Fix `.charset(type)` to accept parameters + * Fix `.charset(type)` to match case-insensitive + * Improve generation of extension to MIME mapping + * Refactor internals for readability and no argument reassignment + * Prefer `application/*` MIME types from the same source + * Prefer any type over `application/octet-stream` + * deps: mime-db@~1.13.0 + - Add nginx as a source + - Add new mime types + +2.0.14 / 2015-06-06 +=================== + + * deps: mime-db@~1.12.0 + - Add new mime types + +2.0.13 / 2015-05-31 +=================== + + * deps: mime-db@~1.11.0 + - Add new mime types + +2.0.12 / 2015-05-19 +=================== + + * deps: mime-db@~1.10.0 + - Add new mime types + +2.0.11 / 2015-05-05 +=================== + + * deps: mime-db@~1.9.1 + - Add new mime types + +2.0.10 / 2015-03-13 +=================== + + * deps: mime-db@~1.8.0 + - Add new mime types + +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/LICENSE b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/LICENSE new file mode 100644 index 00000000..06166077 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/README.md b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/README.md new file mode 100644 index 00000000..222d2b58 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/README.md @@ -0,0 +1,126 @@ +# mime-types + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +The ultimate javascript content-type utility. + +Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, + `mime-types` simply returns `false`, so do + `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- No `.define()` functionality +- Bug fixes for `.lookup(path)` + +Otherwise, the API is compatible with `mime` 1.x. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install mime-types +``` + +## Note on MIME Type Data and Semver + +This package considers the programmatic api as the semver compatibility. Additionally, the package which provides the MIME data +for this package (`mime-db`) *also* considers it's programmatic api as the semver contract. This means the MIME type resolution is *not* considered +in the semver bumps. + +In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the +`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data +you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is +a breaking change. + +If you wish to pin your `mime-db` version you can do that with overrides via your package manager of choice. See their documentation for how to correctly configure that. + +## Adding Types + +All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), +so open a PR there if you'd like to add mime types. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' +mime.lookup('folder/.htaccess') // false + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. +When given an extension, `mime.lookup` is used to get the matching +content-type, otherwise the given content-type is used. Then if the +content-type does not already have a `charset` parameter, `mime.charset` +is used to get the default charset and add to the returned content-type. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' +mime.contentType('text/html') // 'text/html; charset=utf-8' +mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' + +// from a full path +mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/markdown') // 'UTF-8' +``` + +### var type = mime.types[extension] + +A map of content-types by extension. + +### [extensions...] = mime.extensions[type] + +A map of extensions by content-type. + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci +[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master +[node-version-image]: https://badgen.net/npm/node/mime-types +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-types +[npm-url]: https://npmjs.org/package/mime-types +[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js new file mode 100644 index 00000000..9725ddf3 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js @@ -0,0 +1,211 @@ +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var db = require('mime-db') +var extname = require('path').extname +var mimeScore = require('./mimeScore') + +/** + * Module variables. + * @private + */ + +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ +var TEXT_TYPE_REGEXP = /^text\//i + +/** + * Module exports. + * @public + */ + +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) +exports._extensionConflicts = [] + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {false|string} + */ + +function charset (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + var mime = match && db[match[1].toLowerCase()] + + if (mime && mime.charset) { + return mime.charset + } + + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' + } + + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {false|string} + */ + +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } + + var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str + + if (!mime) { + return false + } + + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() + } + + return mime +} + +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {false|string} + */ + +function extension (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] + + if (!exts || !exts.length) { + return false + } + + return exts[0] +} + +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {false|string} + */ + +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .slice(1) + + if (!extension) { + return false + } + + return exports.types[extension] || false +} + +/** + * Populate the extensions and types maps. + * @private + */ + +function populateMaps (extensions, types) { + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + types[extension] = _preferredType(extension, types[extension], type) + + // DELETE (eventually): Capture extension->type maps that change as a + // result of switching to mime-score. This is just to help make reviewing + // PR #119 easier, and can be removed once that PR is approved. + const legacyType = _preferredTypeLegacy( + extension, + types[extension], + type + ) + if (legacyType !== types[extension]) { + exports._extensionConflicts.push([extension, legacyType, types[extension]]) + } + } + }) +} + +// Resolve type conflict using mime-score +function _preferredType (ext, type0, type1) { + var score0 = type0 ? mimeScore(type0, db[type0].source) : 0 + var score1 = type1 ? mimeScore(type1, db[type1].source) : 0 + + return score0 > score1 ? type0 : type1 +} + +// Resolve type conflict using pre-mime-score logic +function _preferredTypeLegacy (ext, type0, type1) { + var SOURCE_RANK = ['nginx', 'apache', undefined, 'iana'] + + var score0 = type0 ? SOURCE_RANK.indexOf(db[type0].source) : 0 + var score1 = type1 ? SOURCE_RANK.indexOf(db[type1].source) : 0 + + if ( + exports.types[extension] !== 'application/octet-stream' && + (score0 > score1 || + (score0 === score1 && + exports.types[extension]?.slice(0, 12) === 'application/')) + ) { + return type0 + } + + return score0 > score1 ? type0 : type1 +} diff --git a/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/mimeScore.js b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/mimeScore.js new file mode 100644 index 00000000..fc2e6657 --- /dev/null +++ b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/mimeScore.js @@ -0,0 +1,57 @@ +// 'mime-score' back-ported to CommonJS + +// Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3) +var FACET_SCORES = { + 'prs.': 100, + 'x-': 200, + 'x.': 300, + 'vnd.': 400, + default: 900 +} + +// Score mime source (Logic originally from `jshttp/mime-types` module) +var SOURCE_SCORES = { + nginx: 10, + apache: 20, + iana: 40, + default: 30 // definitions added by `jshttp/mime-db` project? +} + +var TYPE_SCORES = { + // prefer application/xml over text/xml + // prefer application/rtf over text/rtf + application: 1, + + // prefer font/woff over application/font-woff + font: 2, + + // prefer video/mp4 over audio/mp4 over application/mp4 + // See https://www.rfc-editor.org/rfc/rfc4337.html#section-2 + audio: 2, + video: 3, + + default: 0 +} + +/** + * Get each component of the score for a mime type. The sum of these is the + * total score. The higher the score, the more "official" the type. + */ +module.exports = function mimeScore (mimeType, source = 'default') { + if (mimeType === 'application/octet-stream') { + return 0 + } + + const [type, subtype] = mimeType.split('/') + + const facet = subtype.replace(/(\.|x-).*/, '$1') + + const facetScore = FACET_SCORES[facet] || FACET_SCORES.default + const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default + const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default + + // All else being equal prefer shorter types + const lengthScore = 1 - mimeType.length / 100 + + return facetScore + sourceScore + typeScore + lengthScore +} diff --git a/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/package.json b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/package.json new file mode 100644 index 00000000..6c58c27a --- /dev/null +++ b/backend/node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/package.json @@ -0,0 +1,49 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "3.0.2", + "contributors": [ + "Douglas Christopher Wilson ", + "Jeremiah Senkpiel (https://searchbeam.jit.su)", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": "jshttp/mime-types", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "mime-db": "^1.54.0" + }, + "devDependencies": { + "eslint": "8.33.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "3.0.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.6.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "10.8.2", + "nyc": "15.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js", + "mimeScore.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec test/test.js", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/@types/whatwg-url b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/@types/whatwg-url new file mode 120000 index 00000000..17052d92 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/@types/whatwg-url @@ -0,0 +1 @@ +../../../@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs new file mode 100644 index 00000000..a0f5be52 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs @@ -0,0 +1,6 @@ +import mod from "./lib/index.js"; + +export default mod["default"]; +export const CommaAndColonSeparatedRecord = mod.CommaAndColonSeparatedRecord; +export const ConnectionString = mod.ConnectionString; +export const redactConnectionString = mod.redactConnectionString; diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/LICENSE b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/LICENSE new file mode 100644 index 00000000..d57f55f4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/LICENSE @@ -0,0 +1,192 @@ + + 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 + + Copyright 2020 MongoDB Inc. + + 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/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/README.md b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/README.md new file mode 100644 index 00000000..0eb65d00 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/README.md @@ -0,0 +1,25 @@ +# mongodb-connection-string-url + +MongoDB connection strings, based on the WhatWG URL API + +```js +import ConnectionString from 'mongodb-connection-string-url'; + +const cs = new ConnectionString('mongodb://localhost'); +cs.searchParams.set('readPreference', 'secondary'); +console.log(cs.href); // 'mongodb://localhost/?readPreference=secondary' +``` + +## Deviations from the WhatWG URL package + +- URL parameters are case-insensitive +- The `.host`, `.hostname` and `.port` properties cannot be set, and reading + them does not return meaningful results (and are typed as `never`in TypeScript) +- The `.hosts` property contains a list of all hosts in the connection string +- The `.href` property cannot be set, only read +- There is an additional `.isSRV` property, set to `true` for `mongodb+srv://` +- There is an additional `.clone()` utility method on the prototype + +## LICENSE + +Apache-2.0 diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.d.ts b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.d.ts new file mode 100644 index 00000000..5a9dcaf1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.d.ts @@ -0,0 +1,63 @@ +import { URL } from 'whatwg-url'; +import { redactConnectionString, ConnectionStringRedactionOptions } from './redact'; +export { redactConnectionString, ConnectionStringRedactionOptions }; +declare class CaseInsensitiveMap extends Map { + delete(name: K): boolean; + get(name: K): string | undefined; + has(name: K): boolean; + set(name: K, value: any): this; + _normalizeKey(name: any): K; +} +declare abstract class URLWithoutHost extends URL { + abstract get host(): never; + abstract set host(value: never); + abstract get hostname(): never; + abstract set hostname(value: never); + abstract get port(): never; + abstract set port(value: never); + abstract get href(): string; + abstract set href(value: string); +} +export interface ConnectionStringParsingOptions { + looseValidation?: boolean; +} +export declare class ConnectionString extends URLWithoutHost { + _hosts: string[]; + constructor(uri: string, options?: ConnectionStringParsingOptions); + get host(): never; + set host(_ignored: never); + get hostname(): never; + set hostname(_ignored: never); + get port(): never; + set port(_ignored: never); + get href(): string; + set href(_ignored: string); + get isSRV(): boolean; + get hosts(): string[]; + set hosts(list: string[]); + toString(): string; + clone(): ConnectionString; + redact(options?: ConnectionStringRedactionOptions): ConnectionString; + typedSearchParams(): { + append(name: keyof T & string, value: any): void; + delete(name: keyof T & string): void; + get(name: keyof T & string): string | null; + getAll(name: keyof T & string): string[]; + has(name: keyof T & string): boolean; + set(name: keyof T & string, value: any): void; + keys(): IterableIterator; + values(): IterableIterator; + entries(): IterableIterator<[keyof T & string, string]>; + _normalizeKey(name: keyof T & string): string; + [Symbol.iterator](): IterableIterator<[keyof T & string, string]>; + get size(): number; + sort(): void; + forEach(callback: (this: THIS_ARG, value: string, name: string, searchParams: any) => void, thisArg?: THIS_ARG | undefined): void; + readonly [Symbol.toStringTag]: "URLSearchParams"; + }; +} +export declare class CommaAndColonSeparatedRecord> extends CaseInsensitiveMap { + constructor(from?: string | null); + toString(): string; +} +export default ConnectionString; diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js new file mode 100644 index 00000000..9a475d9d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js @@ -0,0 +1,241 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommaAndColonSeparatedRecord = exports.ConnectionString = exports.redactConnectionString = void 0; +const whatwg_url_1 = require("whatwg-url"); +const redact_1 = require("./redact"); +Object.defineProperty(exports, "redactConnectionString", { enumerable: true, get: function () { return redact_1.redactConnectionString; } }); +const DUMMY_HOSTNAME = '__this_is_a_placeholder__'; +function connectionStringHasValidScheme(connectionString) { + return connectionString.startsWith('mongodb://') || connectionString.startsWith('mongodb+srv://'); +} +const HOSTS_REGEX = /^(?[^/]+):\/\/(?:(?[^:@]*)(?::(?[^@]*))?@)?(?(?!:)[^/?@]*)(?.*)/; +class CaseInsensitiveMap extends Map { + delete(name) { + return super.delete(this._normalizeKey(name)); + } + get(name) { + return super.get(this._normalizeKey(name)); + } + has(name) { + return super.has(this._normalizeKey(name)); + } + set(name, value) { + return super.set(this._normalizeKey(name), value); + } + _normalizeKey(name) { + name = `${name}`; + for (const key of this.keys()) { + if (key.toLowerCase() === name.toLowerCase()) { + name = key; + break; + } + } + return name; + } +} +function caseInsenstiveURLSearchParams(Ctor) { + return class CaseInsenstiveURLSearchParams extends Ctor { + append(name, value) { + return super.append(this._normalizeKey(name), value); + } + delete(name) { + return super.delete(this._normalizeKey(name)); + } + get(name) { + return super.get(this._normalizeKey(name)); + } + getAll(name) { + return super.getAll(this._normalizeKey(name)); + } + has(name) { + return super.has(this._normalizeKey(name)); + } + set(name, value) { + return super.set(this._normalizeKey(name), value); + } + keys() { + return super.keys(); + } + values() { + return super.values(); + } + entries() { + return super.entries(); + } + [Symbol.iterator]() { + return super[Symbol.iterator](); + } + _normalizeKey(name) { + return CaseInsensitiveMap.prototype._normalizeKey.call(this, name); + } + }; +} +class URLWithoutHost extends whatwg_url_1.URL { +} +class MongoParseError extends Error { + get name() { + return 'MongoParseError'; + } +} +class ConnectionString extends URLWithoutHost { + _hosts; + constructor(uri, options = {}) { + const { looseValidation } = options; + if (!looseValidation && !connectionStringHasValidScheme(uri)) { + throw new MongoParseError('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"'); + } + const match = uri.match(HOSTS_REGEX); + if (!match) { + throw new MongoParseError('Invalid connection string'); + } + const { protocol, username, password, hosts, rest } = match.groups ?? {}; + if (!looseValidation) { + if (!protocol || !hosts) { + throw new MongoParseError('Protocol and host list are required in the uri'); + } + try { + decodeURIComponent(username ?? ''); + decodeURIComponent(password ?? ''); + } + catch (err) { + throw new MongoParseError(err.message); + } + const illegalCharacters = /[:/?#[\]@]/gi; + if (username?.match(illegalCharacters)) { + throw new MongoParseError(`Username contains unescaped characters ${username}`); + } + if (!username || !password) { + const uriWithoutProtocol = uri.replace(`${protocol}://`, ''); + if (uriWithoutProtocol.startsWith('@') || uriWithoutProtocol.startsWith(':')) { + throw new MongoParseError('URI contained empty userinfo section'); + } + } + if (password?.match(illegalCharacters)) { + throw new MongoParseError('Password contains unescaped characters'); + } + if (rest?.match(/^[^/?]*@/)) { + throw new MongoParseError('Invalid connection string'); + } + } + let authString = ''; + if (typeof username === 'string') + authString += username; + if (typeof password === 'string') + authString += `:${password}`; + if (authString) + authString += '@'; + try { + super(`${protocol.toLowerCase()}://${authString}${DUMMY_HOSTNAME}${rest}`); + } + catch (err) { + if (looseValidation) { + new ConnectionString(uri, { + ...options, + looseValidation: false + }); + } + if (typeof err.message === 'string') { + err.message = err.message.replace(DUMMY_HOSTNAME, hosts); + } + throw err; + } + this._hosts = hosts.split(','); + if (!looseValidation) { + if (this.isSRV && this.hosts.length !== 1) { + throw new MongoParseError('mongodb+srv URI cannot have multiple service names'); + } + if (this.isSRV && this.hosts.some(host => host.includes(':'))) { + throw new MongoParseError('mongodb+srv URI cannot have port number'); + } + } + if (!this.pathname) { + this.pathname = '/'; + } + Object.setPrototypeOf(this.searchParams, caseInsenstiveURLSearchParams(this.searchParams.constructor).prototype); + } + get host() { + return DUMMY_HOSTNAME; + } + set host(_ignored) { + throw new Error('No single host for connection string'); + } + get hostname() { + return DUMMY_HOSTNAME; + } + set hostname(_ignored) { + throw new Error('No single host for connection string'); + } + get port() { + return ''; + } + set port(_ignored) { + throw new Error('No single host for connection string'); + } + get href() { + return this.toString(); + } + set href(_ignored) { + throw new Error('Cannot set href for connection strings'); + } + get isSRV() { + return this.protocol.includes('srv'); + } + get hosts() { + return this._hosts; + } + set hosts(list) { + this._hosts = list; + } + toString() { + return super.toString().replace(DUMMY_HOSTNAME, this.hosts.join(',')); + } + clone() { + return new ConnectionString(this.toString(), { + looseValidation: true + }); + } + redact(options) { + return (0, redact_1.redactValidConnectionString)(this, options); + } + typedSearchParams() { + return this.searchParams; + } + [Symbol.for('nodejs.util.inspect.custom')]() { + const { href, origin, protocol, username, password, hosts, pathname, search, searchParams, hash } = this; + return { + href, + origin, + protocol, + username, + password, + hosts, + pathname, + search, + searchParams, + hash + }; + } +} +exports.ConnectionString = ConnectionString; +class CommaAndColonSeparatedRecord extends CaseInsensitiveMap { + constructor(from) { + super(); + for (const entry of (from ?? '').split(',')) { + if (!entry) + continue; + const colonIndex = entry.indexOf(':'); + if (colonIndex === -1) { + this.set(entry, ''); + } + else { + this.set(entry.slice(0, colonIndex), entry.slice(colonIndex + 1)); + } + } + } + toString() { + return [...this].map(entry => entry.join(':')).join(','); + } +} +exports.CommaAndColonSeparatedRecord = CommaAndColonSeparatedRecord; +exports.default = ConnectionString; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js.map b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js.map new file mode 100644 index 00000000..ba20b9d4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,2CAAkD;AAClD,qCAIkB;AACT,uGAHP,+BAAsB,OAGO;AAE/B,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD,SAAS,8BAA8B,CAAC,gBAAwB;IAC9D,OAAO,gBAAgB,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,gBAAgB,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACpG,CAAC;AAID,MAAM,WAAW,GACf,4GAA4G,CAAC;AAE/G,MAAM,kBAA8C,SAAQ,GAAc;IACxE,MAAM,CAAC,IAAO;QACZ,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,GAAG,CAAC,IAAO;QACT,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,GAAG,CAAC,IAAO;QACT,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAA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AAC;YACxF,CAAC;QACH,CAAC;IACH,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;CACF;AArBD,oEAqBC;AAED,kBAAe,gBAAgB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.d.ts b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.d.ts new file mode 100644 index 00000000..94a64def --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.d.ts @@ -0,0 +1,7 @@ +import ConnectionString from './index'; +export interface ConnectionStringRedactionOptions { + redactUsernames?: boolean; + replacementString?: string; +} +export declare function redactValidConnectionString(inputUrl: Readonly, options?: ConnectionStringRedactionOptions): ConnectionString; +export declare function redactConnectionString(uri: string, options?: ConnectionStringRedactionOptions): string; diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js new file mode 100644 index 00000000..67f534d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js @@ -0,0 +1,97 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.redactValidConnectionString = redactValidConnectionString; +exports.redactConnectionString = redactConnectionString; +const index_1 = __importStar(require("./index")); +function redactValidConnectionString(inputUrl, options) { + const url = inputUrl.clone(); + const replacementString = options?.replacementString ?? '_credentials_'; + const redactUsernames = options?.redactUsernames ?? true; + if ((url.username || url.password) && redactUsernames) { + url.username = replacementString; + url.password = ''; + } + else if (url.password) { + url.password = replacementString; + } + if (url.searchParams.has('authMechanismProperties')) { + const props = new index_1.CommaAndColonSeparatedRecord(url.searchParams.get('authMechanismProperties')); + if (props.get('AWS_SESSION_TOKEN')) { + props.set('AWS_SESSION_TOKEN', replacementString); + url.searchParams.set('authMechanismProperties', props.toString()); + } + } + if (url.searchParams.has('tlsCertificateKeyFilePassword')) { + url.searchParams.set('tlsCertificateKeyFilePassword', replacementString); + } + if (url.searchParams.has('proxyUsername') && redactUsernames) { + url.searchParams.set('proxyUsername', replacementString); + } + if (url.searchParams.has('proxyPassword')) { + url.searchParams.set('proxyPassword', replacementString); + } + return url; +} +function redactConnectionString(uri, options) { + const replacementString = options?.replacementString ?? ''; + const redactUsernames = options?.redactUsernames ?? true; + let parsed; + try { + parsed = new index_1.default(uri); + } + catch { + } + if (parsed) { + options = { ...options, replacementString: '___credentials___' }; + return parsed + .redact(options) + .toString() + .replace(/___credentials___/g, replacementString); + } + const R = replacementString; + const replacements = [ + uri => uri.replace(redactUsernames ? /(\/\/)(.*)(@)/g : /(\/\/[^@]*:)(.*)(@)/g, `$1${R}$3`), + uri => uri.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi, `$1${R}`), + uri => uri.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi, `$1${R}`), + uri => (redactUsernames ? uri.replace(/(proxyUsername=)([^&]+)/gi, `$1${R}`) : uri), + uri => uri.replace(/(proxyPassword=)([^&]+)/gi, `$1${R}`) + ]; + for (const replacer of replacements) { + uri = replacer(uri); + } + return uri; +} +//# sourceMappingURL=redact.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js.map b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js.map new file mode 100644 index 00000000..a8cd75e2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/lib/redact.js.map @@ -0,0 +1 @@ +{"version":3,"file":"redact.js","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,kEA+BC;AAED,wDA0CC;AAlFD,iDAAyE;AAOzE,SAAgB,2BAA2B,CACzC,QAAoC,EACpC,OAA0C;IAE1C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC7B,MAAM,iBAAiB,GAAG,OAAO,EAAE,iBAAiB,IAAI,eAAe,CAAC;IACxE,MAAM,eAAe,GAAG,OAAO,EAAE,eAAe,IAAI,IAAI,CAAC;IAEzD,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,eAAe,EAAE,CAAC;QACtD,GAAG,C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O,GAAG,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/package.json b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/package.json new file mode 100644 index 00000000..0bb8735d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url/package.json @@ -0,0 +1,81 @@ +{ + "name": "mongodb-connection-string-url", + "version": "7.0.2", + "description": "MongoDB connection strings, based on the WhatWG URL API", + "keywords": [ + "password", + "prompt", + "tty" + ], + "homepage": "https://github.com/mongodb-js/mongodb-connection-string-url", + "repository": { + "type": "git", + "url": "https://github.com/mongodb-js/mongodb-connection-string-url.git" + }, + "bugs": { + "url": "https://github.com/mongodb-js/mongodb-connection-string-url/issues" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "exports": { + "require": { + "default": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "import": { + "default": "./.esm-wrapper.mjs", + "types": "./lib/index.d.ts" + } + }, + "files": [ + "LICENSE", + "lib", + "package.json", + "README.md", + ".esm-wrapper.mjs" + ], + "scripts": { + "lint": "ESLINT_USE_FLAT_CONFIG=false eslint \"{src,test}/**/*.ts\"", + "test": "npm run build && tsd && nyc mocha --colors -r ts-node/register test/*.ts", + "build": "npm run compile-ts && gen-esm-wrapper . ./.esm-wrapper.mjs", + "prepack": "npm run build", + "compile-ts": "tsc -p tsconfig.json" + }, + "license": "Apache-2.0", + "devDependencies": { + "@types/chai": "^5.0.1", + "@types/mocha": "^10.0.10", + "@types/node": "^22.9.0", + "@typescript-eslint/eslint-plugin": "^8.39.1", + "@typescript-eslint/parser": "^8.39.1", + "chai": "^4.2.0", + "eslint": "^9.33.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^5.5.4", + "eslint-plugin-promise": "^7.1.0", + "gen-esm-wrapper": "^1.1.3", + "mocha": "^11.0.1", + "nyc": "^17.1.0", + "ts-node": "^10.9.1", + "tsd": "^0.33.0", + "typescript": "^5.9.2" + }, + "dependencies": { + "@types/whatwg-url": "^13.0.0", + "whatwg-url": "^14.1.0" + }, + "engines": { + "node": ">=20.19.0" + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "strict": true, + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node" + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/whatwg-url b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/whatwg-url new file mode 120000 index 00000000..f5bb35e6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb-connection-string-url@7.0.2/node_modules/whatwg-url @@ -0,0 +1 @@ +../../whatwg-url@14.2.0/node_modules/whatwg-url \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/@mongodb-js/saslprep b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/@mongodb-js/saslprep new file mode 120000 index 00000000..af0d7066 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/@mongodb-js/saslprep @@ -0,0 +1 @@ +../../../@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/bson b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/bson new file mode 120000 index 00000000..294422c2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/bson @@ -0,0 +1 @@ +../../bson@7.3.3/node_modules/bson \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb-connection-string-url b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb-connection-string-url new file mode 120000 index 00000000..f8ad4bd4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb-connection-string-url @@ -0,0 +1 @@ +../../mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/LICENSE.md b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/LICENSE.md new file mode 100644 index 00000000..ad410e11 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/LICENSE.md @@ -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. \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/README.md b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/README.md new file mode 100644 index 00000000..4ddd9795 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/README.md @@ -0,0 +1,380 @@ +# MongoDB Node.js Driver + +The official [MongoDB](https://www.mongodb.com/) driver for Node.js. + +**Upgrading to version 7? Take a look at our [upgrade guide here](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_7.0.0.md)!** + +## Quick Links + +| Site | Link | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | +| Documentation | [www.mongodb.com/docs/drivers/node](https://www.mongodb.com/docs/drivers/node) | +| API Docs | [mongodb.github.io/node-mongodb-native](https://mongodb.github.io/node-mongodb-native) | +| `npm` package | [www.npmjs.com/package/mongodb](https://www.npmjs.com/package/mongodb) | +| MongoDB | [www.mongodb.com](https://www.mongodb.com) | +| MongoDB University | [learn.mongodb.com](https://learn.mongodb.com/catalog?labels=%5B%22Language%22%5D&values=%5B%22Node.js%22%5D) | +| MongoDB Developer Center | [www.mongodb.com/developer](https://www.mongodb.com/developer/languages/javascript/) | +| Stack Overflow | [stackoverflow.com](https://stackoverflow.com/search?q=%28%5Btypescript%5D+or+%5Bjavascript%5D+or+%5Bnode.js%5D%29+and+%5Bmongodb%5D) | +| Source Code | [github.com/mongodb/node-mongodb-native](https://github.com/mongodb/node-mongodb-native) | +| Upgrade to v7 | [etc/notes/CHANGES_7.0.0.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_7.0.0.md) | +| Contributing | [CONTRIBUTING.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/CONTRIBUTING.md) | +| Changelog | [HISTORY.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/HISTORY.md) | + +### Release Integrity + +Releases are created automatically and signed using the [Node team's GPG key](https://pgp.mongodb.com/node-driver.asc). All release packages provided as part of a GitHub release are signed. To verify the provided packages, download the key and import it using gpg: + +```shell +gpg --import node-driver.asc +``` + +The GitHub release contains a detached signature file for the NPM package (named +`mongodb-X.Y.Z.tgz.sig`). + +The following command returns the link npm package. + +```shell +npm view mongodb@vX.Y.Z dist.tarball +``` + +Using the result of the above command, a `curl` command can return the official npm package for the release. + +To verify the integrity of the downloaded package, run the following command: + +```shell +gpg --verify mongodb-X.Y.Z.tgz.sig mongodb-X.Y.Z.tgz +``` + +> [!Note] +> No GPG verification is done when using npm to install the package. The contents of the GitHub tarball and npm's tarball are identical. + +Releases published to the npm registry also include a [provenance attestation](https://docs.npmjs.com/generating-provenance-statements), which cryptographically links the package to its source repository and build workflow. To verify provenance: + +```shell +npm audit signatures +``` + +The MongoDB Node.js driver follows [semantic versioning](https://semver.org/) for its releases. + +### Bugs / Feature Requests + +Think you’ve found a bug? Want to see a new feature in `node-mongodb-native`? Please open a +case in our issue management tool, JIRA: + +- Create an account and login [jira.mongodb.org](https://jira.mongodb.org). +- Navigate to the NODE project [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE). +- Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it. + +Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the +Core Server (i.e. SERVER) project are **public**. + +### Support / Feedback + +For issues with, questions about, or feedback for the Node.js driver, please look into our [support channels](https://www.mongodb.com/docs/manual/support). Please do not email any of the driver developers directly with issues or questions - you're more likely to get an answer on the [MongoDB Community Forums](https://community.mongodb.com/tags/c/drivers-odms-connectors/7/node-js-driver). + +### Change Log + +Change history can be found in [`HISTORY.md`](https://github.com/mongodb/node-mongodb-native/blob/HEAD/HISTORY.md). + +### Compatibility + +The driver currently supports 4.4+ servers. + +For exhaustive server and runtime version compatibility matrices, please refer to the following links: + +- [MongoDB](https://www.mongodb.com/docs/drivers/node/current/compatibility/#mongodb-compatibility) +- [NodeJS](https://www.mongodb.com/docs/drivers/node/current/compatibility/#language-compatibility) + +#### Component Support Matrix + +The following table describes add-on component version compatibility for the Node.js driver. Only packages with versions in these supported ranges are stable when used in combination. + +| Component | `mongodb@3.x` | `mongodb@4.x` | `mongodb@5.x` | `mongodb@<6.12` | `mongodb@>=6.12` | `mongodb@7.x` | +| ------------------------------------------------------------------------------------ | ------------------ | ------------------ | ------------------ | --------------- | ------------------ | ------------- | +| [bson](https://www.npmjs.com/package/bson) | ^1.0.0 | ^4.0.0 | ^5.0.0 | ^6.0.0 | ^6.0.0 | ^7.0.0 | +| [bson-ext](https://www.npmjs.com/package/bson-ext) | ^1.0.0 \|\| ^2.0.0 | ^4.0.0 | N/A | N/A | N/A | N/A | +| [kerberos](https://www.npmjs.com/package/kerberos) | ^1.0.0 | ^1.0.0 \|\| ^2.0.0 | ^1.0.0 \|\| ^2.0.0 | ^2.0.1 | ^2.0.1 | ^7.0.0 | +| [mongodb-client-encryption](https://www.npmjs.com/package/mongodb-client-encryption) | ^1.0.0 | ^1.0.0 \|\| ^2.0.0 | ^2.3.0 | ^6.0.0 | ^6.0.0 | ^7.0.0 | +| [mongodb-legacy](https://www.npmjs.com/package/mongodb-legacy) | N/A | ^4.0.0 | ^5.0.0 | ^6.0.0 | ^6.0.0 | N/A | +| [@mongodb-js/zstd](https://www.npmjs.com/package/@mongodb-js/zstd) | N/A | ^1.0.0 | ^1.0.0 | ^1.1.0 | ^1.1.0 \|\| ^2.0.0 | ^7.0.0 | + +#### Typescript Version + +We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@5.6.0`. +This is the lowest typescript version guaranteed to work with our driver: older versions may or may not work - use at your own risk. +Since typescript [does not restrict breaking changes to major versions](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes), we consider this support best effort. +If you run into any unexpected compiler failures against our supported TypeScript versions, please let us know by filing an issue on our [JIRA](https://jira.mongodb.org/browse/NODE). + +Additionally, our Typescript types are compatible with the ECMAScript standard for our minimum supported Node version. Currently, our Typescript targets es2023. + +#### Running in Custom Runtimes + +We are working on removing Node.js as a dependency of the driver, so that in the future it will be possible to use the driver in non-Node environments. +This work is currently in progress, and if you're curious, this is [our first runtime adapter commit](https://github.com/mongodb/node-mongodb-native/commit/d2ad07f20903d86334da81222a6df9717f76faaa). + +Some things to keep in mind if you are using a non-Node runtime: + +1. Users of Webpack/Vite may need to prevent `crypto` polyfill injection. +2. Auth mechanism `SCRAM-SHA-1` has a hard dependency on Node.js. +3. Auth mechanism `SCRAM-SHA-1` is not supported in FIPS mode. + +## Installation + +The recommended way to get started using the Node.js driver is by using the `npm` (Node Package Manager) to install the dependency in your project. + +After you've created your own project using `npm init`, you can run: + +```bash +npm install mongodb +``` + +This will download the MongoDB driver and add a dependency entry in your `package.json` file. + +If you are a Typescript user, you will need the Node.js type definitions to use the driver's definitions: + +```sh +npm install -D @types/node +``` + +## Driver Extensions + +The MongoDB driver can optionally be enhanced by the following feature packages: + +Maintained by MongoDB: + +- Zstd network compression - [@mongodb-js/zstd](https://github.com/mongodb-js/zstd) +- MongoDB field level and queryable encryption - [mongodb-client-encryption](https://github.com/mongodb/libmongocrypt#readme) +- GSSAPI / SSPI / Kerberos authentication - [kerberos](https://github.com/mongodb-js/kerberos) + +Some of these packages include native C++ extensions. +Consult the [trouble shooting guide here](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/native-extensions.md) if you run into compilation issues. + +Third party: + +- Snappy network compression - [snappy](https://github.com/Brooooooklyn/snappy) +- AWS authentication - [@aws-sdk/credential-providers](https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-providers) + +## Quick Start + +This guide will show you how to set up a simple application using Node.js and MongoDB. Its scope is only how to set up the driver and perform the simple CRUD operations. For more in-depth coverage, see the [official documentation](https://www.mongodb.com/docs/drivers/node/). + +### Create the `package.json` file + +First, create a directory where your application will live. + +```bash +mkdir myProject +cd myProject +``` + +Enter the following command and answer the questions to create the initial structure for your new project: + +```bash +npm init -y +``` + +Next, install the driver as a dependency. + +```bash +npm install mongodb +``` + +### Start a MongoDB Server + +For complete MongoDB installation instructions, see [the manual](https://www.mongodb.com/docs/manual/installation/). + +1. Download the right MongoDB version from [MongoDB](https://www.mongodb.org/downloads) +2. Create a database directory (in this case under **/data**). +3. Install and start a `mongod` process. + +```bash +mongod --dbpath=/data +``` + +You should see the **mongod** process start up and print some status information. + +### Connect to MongoDB + +Create a new **app.js** file and add the following code to try out some basic CRUD +operations using the MongoDB driver. + +Add code to connect to the server and the database **myProject**: + +> **NOTE:** Resolving DNS Connection issues +> +> Node.js 18 changed the default DNS resolution ordering from always prioritizing IPv4 to the ordering +> returned by the DNS provider. In some environments, this can result in `localhost` resolving to +> an IPv6 address instead of IPv4 and a consequent failure to connect to the server. +> +> This can be resolved by: +> +> - specifying the IP address family using the MongoClient `family` option (`MongoClient(, { family: 4 } )`) +> - launching mongod or mongos with the ipv6 flag enabled ([--ipv6 mongod option documentation](https://www.mongodb.com/docs/manual/reference/program/mongod/#std-option-mongod.--ipv6)) +> - using a host of `127.0.0.1` in place of localhost +> - specifying the DNS resolution ordering with the `--dns-resolution-order` Node.js command line argument (e.g. `node --dns-resolution-order=ipv4first`) + +```js +const { MongoClient } = require('mongodb'); +// or as an es module: +// import { MongoClient } from 'mongodb' + +// Connection URL +const url = 'mongodb://localhost:27017'; +const client = new MongoClient(url); + +// Database Name +const dbName = 'myProject'; + +async function main() { + // Use connect method to connect to the server + await client.connect(); + console.log('Connected successfully to server'); + const db = client.db(dbName); + const collection = db.collection('documents'); + + // the following code examples can be pasted here... + + return 'done.'; +} + +main() + .then(console.log) + .catch(console.error) + .finally(() => client.close()); +``` + +Run your app from the command line with: + +```bash +node app.js +``` + +The application should print **Connected successfully to server** to the console. + +### Insert a Document + +Add to **app.js** the following function which uses the **insertMany** +method to add three documents to the **documents** collection. + +```js +const insertResult = await collection.insertMany([{ a: 1 }, { a: 2 }, { a: 3 }]); +console.log('Inserted documents =>', insertResult); +``` + +The **insertMany** command returns an object with information about the insert operations. + +### Find All Documents + +Add a query that returns all the documents. + +```js +const findResult = await collection.find({}).toArray(); +console.log('Found documents =>', findResult); +``` + +This query returns all the documents in the **documents** collection. +If you add this below the insertMany example, you'll see the documents you've inserted. + +### Find Documents with a Query Filter + +Add a query filter to find only documents which meet the query criteria. + +```js +const filteredDocs = await collection.find({ a: 3 }).toArray(); +console.log('Found documents filtered by { a: 3 } =>', filteredDocs); +``` + +Only the documents which match `'a' : 3` should be returned. + +### Update a document + +The following operation updates a document in the **documents** collection. + +```js +const updateResult = await collection.updateOne({ a: 3 }, { $set: { b: 1 } }); +console.log('Updated documents =>', updateResult); +``` + +The method updates the first document where the field **a** is equal to **3** by adding a new field **b** to the document set to **1**. `updateResult` contains information about whether there was a matching document to update or not. + +### Remove a document + +Remove the document where the field **a** is equal to **3**. + +```js +const deleteResult = await collection.deleteMany({ a: 3 }); +console.log('Deleted documents =>', deleteResult); +``` + +### Index a Collection + +[Indexes](https://www.mongodb.com/docs/manual/indexes/) can improve your application's +performance. The following function creates an index on the **a** field in the +**documents** collection. + +```js +const indexName = await collection.createIndex({ a: 1 }); +console.log('index name =', indexName); +``` + +For more detailed information, see the [indexing strategies page](https://www.mongodb.com/docs/manual/applications/indexes/). + +## Error Handling + +If you need to filter certain errors from our driver, we have a helpful tree of errors described in [etc/notes/errors.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/errors.md). + +It is our recommendation to use `instanceof` checks on errors and to avoid relying on parsing `error.message` and `error.name` strings in your code. +We guarantee `instanceof` checks will pass according to semver guidelines, but errors may be sub-classed or their messages may change at any time, even patch releases, as we see fit to increase the helpfulness of the errors. + +Any new errors we add to the driver will directly extend an existing error class and no existing error will be moved to a different parent class outside of a major release. +This means `instanceof` will always be able to accurately capture the errors that our driver throws. + +```typescript +const client = new MongoClient(url); +await client.connect(); +const collection = client.db().collection('collection'); + +try { + await collection.insertOne({ _id: 1 }); + await collection.insertOne({ _id: 1 }); // duplicate key error +} catch (error) { + if (error instanceof MongoServerError) { + console.log(`Error worth logging: ${error}`); // special case for some reason + } + throw error; // still want to crash +} +``` + +## Nightly releases + +If you need to test with a change from the latest `main` branch, our `mongodb` npm package has nightly versions released under the `nightly` tag. + +```sh +npm install mongodb@nightly +``` + +Nightly versions are published regardless of testing outcome. +This means there could be semantic breakages or partially implemented features. +The nightly build is not suitable for production use. + +## Experimental Features + +The MongoDB Node.js driver offers cutting-edge experimental features that give you early access to new capabilities and APIs. These features are marked with `@experimental` tags and are great for exploring new functionality and providing [feedback](#support--feedback). + +Experimental features are not subject to [semantic versioning](https://semver.org/) rules, so breaking changes or removal may occur in any future release. The use of these features is not recommended for production environments. + +Explore the full list of experimental features, complete with descriptions and usage examples, in [EXPERIMENTAL_FEATURES.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/EXPERIMENTAL_FEATURES.md). + +## Next Steps + +- [MongoDB Documentation](https://www.mongodb.com/docs/manual/) +- [MongoDB Node Driver Documentation](https://www.mongodb.com/docs/drivers/node/) +- [Read about Schemas](https://www.mongodb.com/docs/manual/core/data-modeling-introduction/) +- [Star us on GitHub](https://github.com/mongodb/node-mongodb-native) + +## License + +[Apache 2.0](LICENSE.md) + +© 2012-present MongoDB [Contributors](https://github.com/mongodb/node-mongodb-native/blob/HEAD/CONTRIBUTORS.md) \ +© 2009-2012 Christian Amor Kvalheim diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/etc/prepare.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/etc/prepare.js new file mode 100755 index 00000000..2039d0b3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/etc/prepare.js @@ -0,0 +1,12 @@ +#! /usr/bin/env node +var cp = require('child_process'); +var fs = require('fs'); +var os = require('os'); + +if (fs.existsSync('src')) { + cp.spawn('npm', ['run', 'build:dts'], { stdio: 'inherit', shell: os.platform() === 'win32' }); +} else { + if (!fs.existsSync('lib')) { + console.warn('MongoDB: No compiled javascript present, the driver is not installed correctly.'); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js new file mode 100644 index 00000000..06279e34 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js @@ -0,0 +1,136 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Admin = void 0; +const bson_1 = require("./bson"); +const execute_operation_1 = require("./operations/execute_operation"); +const list_databases_1 = require("./operations/list_databases"); +const remove_user_1 = require("./operations/remove_user"); +const run_command_1 = require("./operations/run_command"); +const validate_collection_1 = require("./operations/validate_collection"); +const utils_1 = require("./utils"); +/** + * The **Admin** class is an internal class that allows convenient access to + * the admin functionality and commands for MongoDB. + * + * **ADMIN Cannot directly be instantiated** + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const admin = client.db().admin(); + * const dbInfo = await admin.listDatabases(); + * for (const db of dbInfo.databases) { + * console.log(db.name); + * } + * ``` + */ +class Admin { + /** + * Create a new Admin instance + * @internal + */ + constructor(db) { + this.s = { db }; + } + /** + * Execute a command + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to execute + * @param options - Optional settings for the command + */ + async command(command, options) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace('admin'), command, { + ...(0, bson_1.resolveBSONOptions)(options), + session: options?.session, + readPreference: options?.readPreference, + timeoutMS: options?.timeoutMS ?? this.s.db.timeoutMS + })); + } + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + async buildInfo(options) { + return await this.command({ buildinfo: 1 }, options); + } + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + async serverInfo(options) { + return await this.command({ buildinfo: 1 }, options); + } + /** + * Retrieve this db's server status. + * + * @param options - Optional settings for the command + */ + async serverStatus(options) { + return await this.command({ serverStatus: 1 }, options); + } + /** + * Ping the MongoDB server and retrieve results + * + * @param options - Optional settings for the command + */ + async ping(options) { + return await this.command({ ping: 1 }, options); + } + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + async removeUser(username, options) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new remove_user_1.RemoveUserOperation(this.s.db, username, { dbName: 'admin', ...options })); + } + /** + * Validate an existing collection + * + * @param collectionName - The name of the collection to validate. + * @param options - Optional settings for the command + */ + async validateCollection(collectionName, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new validate_collection_1.ValidateCollectionOperation(this, collectionName, options)); + } + /** + * List the available databases + * + * @param options - Optional settings for the command + */ + async listDatabases(options) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new list_databases_1.ListDatabasesOperation(this.s.db, { timeoutMS: this.s.db.timeoutMS, ...options })); + } + /** + * Get ReplicaSet status + * + * @param options - Optional settings for the command + */ + async replSetGetStatus(options) { + return await this.command({ replSetGetStatus: 1 }, options); + } +} +exports.Admin = Admin; +//# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js.map new file mode 100644 index 00000000..180084d2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/admin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":";;;AAAA,iCAA2D;AAG3D,sEAAkE;AAClE,gEAIqC;AACrC,0DAAuF;AACvF,0DAAuF;AACvF,0EAG0C;AAC1C,mCAA2C;AAO3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,KAAK;IAIhB;;;OAGG;IACH,YAAY,EAAM;QAChB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,OAAO,CAAC,OAAiB,EAAE,OAA2B;QAC1D,OAAO,MAAM,IAAA,oCAAgB,EAC3B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,EAChB,IAAI,iCAAmB,CAAC,IAAI,wBAAgB,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE;YAC9D,GAAG,IAAA,yBAAkB,EAAC,OAAO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M,IAAA,oCAAgB,EAC3B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,EAChB,IAAI,iDAA2B,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,CAC/D,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,OAA8B;QAChD,OAAO,MAAM,IAAA,oCAAgB,EAC3B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,EAChB,IAAI,uCAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC,CACtF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB,CAAC,OAAiC;QACtD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AAnID,sBAmIC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js new file mode 100644 index 00000000..c92ce445 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js @@ -0,0 +1,112 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setUint32LE = exports.readUint8 = exports.readInt32LE = exports.UUID = exports.Timestamp = exports.serialize = exports.ObjectId = exports.NumberUtils = exports.MinKey = exports.MaxKey = exports.Long = exports.Int32 = exports.EJSON = exports.Double = exports.deserialize = exports.Decimal128 = exports.DBRef = exports.Code = exports.calculateObjectSize = exports.ByteUtils = exports.BSONType = exports.BSONSymbol = exports.BSONRegExp = exports.BSONError = exports.BSON = exports.Binary = void 0; +exports.parseToElementsToArray = parseToElementsToArray; +exports.pluckBSONSerializeOptions = pluckBSONSerializeOptions; +exports.resolveBSONOptions = resolveBSONOptions; +exports.parseUtf8ValidationOption = parseUtf8ValidationOption; +/* eslint-disable no-restricted-imports */ +const bson_1 = require("bson"); +var bson_2 = require("bson"); +Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return bson_2.Binary; } }); +Object.defineProperty(exports, "BSON", { enumerable: true, get: function () { return bson_2.BSON; } }); +Object.defineProperty(exports, "BSONError", { enumerable: true, get: function () { return bson_2.BSONError; } }); +Object.defineProperty(exports, "BSONRegExp", { enumerable: true, get: function () { return bson_2.BSONRegExp; } }); +Object.defineProperty(exports, "BSONSymbol", { enumerable: true, get: function () { return bson_2.BSONSymbol; } }); +Object.defineProperty(exports, "BSONType", { enumerable: true, get: function () { return bson_2.BSONType; } }); +Object.defineProperty(exports, "ByteUtils", { enumerable: true, get: function () { return bson_2.ByteUtils; } }); +Object.defineProperty(exports, "calculateObjectSize", { enumerable: true, get: function () { return bson_2.calculateObjectSize; } }); +Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return bson_2.Code; } }); +Object.defineProperty(exports, "DBRef", { enumerable: true, get: function () { return bson_2.DBRef; } }); +Object.defineProperty(exports, "Decimal128", { enumerable: true, get: function () { return bson_2.Decimal128; } }); +Object.defineProperty(exports, "deserialize", { enumerable: true, get: function () { return bson_2.deserialize; } }); +Object.defineProperty(exports, "Double", { enumerable: true, get: function () { return bson_2.Double; } }); +Object.defineProperty(exports, "EJSON", { enumerable: true, get: function () { return bson_2.EJSON; } }); +Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return bson_2.Int32; } }); +Object.defineProperty(exports, "Long", { enumerable: true, get: function () { return bson_2.Long; } }); +Object.defineProperty(exports, "MaxKey", { enumerable: true, get: function () { return bson_2.MaxKey; } }); +Object.defineProperty(exports, "MinKey", { enumerable: true, get: function () { return bson_2.MinKey; } }); +Object.defineProperty(exports, "NumberUtils", { enumerable: true, get: function () { return bson_2.NumberUtils; } }); +Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return bson_2.ObjectId; } }); +Object.defineProperty(exports, "serialize", { enumerable: true, get: function () { return bson_2.serialize; } }); +Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return bson_2.Timestamp; } }); +Object.defineProperty(exports, "UUID", { enumerable: true, get: function () { return bson_2.UUID; } }); +function parseToElementsToArray(bytes, offset) { + const res = bson_1.BSON.onDemand.parseToElements(bytes, offset); + return Array.isArray(res) ? res : [...res]; +} +// validates buffer inputs, used for read operations +const validateBufferInputs = (buffer, offset, length) => { + if (offset < 0 || offset + length > buffer.length) { + throw new RangeError(`Attempt to access memory outside buffer bounds: buffer length: ${buffer.length}, offset: ${offset}, length: ${length}`); + } +}; +// readInt32LE, reads a 32-bit integer from buffer at given offset +// throws if offset is out of bounds +const readInt32LE = (buffer, offset) => { + validateBufferInputs(buffer, offset, 4); + return bson_1.NumberUtils.getInt32LE(buffer, offset); +}; +exports.readInt32LE = readInt32LE; +// readUint8, reads a single unsigned byte from buffer at given offset +const readUint8 = (buffer, offset) => { + validateBufferInputs(buffer, offset, 1); + return buffer[offset]; +}; +exports.readUint8 = readUint8; +const setUint32LE = (destination, offset, value) => { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; +}; +exports.setUint32LE = setUint32LE; +function pluckBSONSerializeOptions(options) { + const { fieldsAsRaw, useBigInt64, promoteValues, promoteBuffers, promoteLongs, serializeFunctions, ignoreUndefined, bsonRegExp, raw, enableUtf8Validation } = options; + return { + fieldsAsRaw, + useBigInt64, + promoteValues, + promoteBuffers, + promoteLongs, + serializeFunctions, + ignoreUndefined, + bsonRegExp, + raw, + enableUtf8Validation + }; +} +/** + * Merge the given BSONSerializeOptions, preferring options over the parent's options, and + * substituting defaults for values not set. + * + * @internal + */ +function resolveBSONOptions(options, parent) { + const parentOptions = parent?.bsonOptions; + return { + raw: options?.raw ?? parentOptions?.raw ?? false, + useBigInt64: options?.useBigInt64 ?? parentOptions?.useBigInt64 ?? false, + promoteLongs: options?.promoteLongs ?? parentOptions?.promoteLongs ?? true, + promoteValues: options?.promoteValues ?? parentOptions?.promoteValues ?? true, + promoteBuffers: options?.promoteBuffers ?? parentOptions?.promoteBuffers ?? false, + ignoreUndefined: options?.ignoreUndefined ?? parentOptions?.ignoreUndefined ?? false, + bsonRegExp: options?.bsonRegExp ?? parentOptions?.bsonRegExp ?? false, + serializeFunctions: options?.serializeFunctions ?? parentOptions?.serializeFunctions ?? false, + fieldsAsRaw: options?.fieldsAsRaw ?? parentOptions?.fieldsAsRaw ?? {}, + enableUtf8Validation: options?.enableUtf8Validation ?? parentOptions?.enableUtf8Validation ?? true + }; +} +/** @internal */ +function parseUtf8ValidationOption(options) { + const enableUtf8Validation = options?.enableUtf8Validation; + if (enableUtf8Validation === false) { + return { utf8: false }; + } + return { utf8: { writeErrors: false } }; +} +//# sourceMappingURL=bson.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js.map new file mode 100644 index 00000000..b8a5007c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bson.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.js","sourceRoot":"","sources":["../src/bson.ts"],"names":[],"mappings":";;;AAoCA,wDAGC;AA4ED,8DAyBC;AAQD,gDAkBC;AAGD,8DAQC;AAjLD,0CAA0C;AAC1C,+BAAyF;AAEzF,6BA4Bc;AA3BZ,8FAAA,MAAM,OAAA;AACN,4FAAA,IAAI,OAAA;AACJ,iGAAA,SAAS,OAAA;AACT,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,gGAAA,QAAQ,OAAA;AACR,iGAAA,SAAS,OAAA;AACT,2GAAA,mBAAmB,OAAA;AACnB,4FAAA,IAAI,OAAA;AACJ,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AAK;QACxE,YAAY,EAAE,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,YAAY,IAAI,IAAI;QAC1E,aAAa,EAAE,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,aAAa,IAAI,IAAI;QAC7E,cAAc,EAAE,OAAO,EAAE,cAAc,IAAI,aAAa,EAAE,cAAc,IAAI,KAAK;QACjF,eAAe,EAAE,OAAO,EAAE,eAAe,IAAI,aAAa,EAAE,eAAe,IAAI,KAAK;QACpF,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,UAAU,IAAI,KAAK;QACrE,kBAAkB,EAAE,OAAO,EAAE,kBAAkB,IAAI,aAAa,EAAE,kBAAkB,IAAI,KAAK;QAC7F,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,WAAW,IAAI,EAAE;QACrE,oBAAoB,EAClB,OAAO,EAAE,oBAAoB,IAAI,aAAa,EAAE,oBAAoB,IAAI,IAAI;KAC/E,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,OAA4C;IAGpF,MAAM,oBAAoB,GAAG,OAAO,EAAE,oBAAoB,CAAC;IAC3D,IAAI,oBAAoB,KAAK,KAAK,EAAE,CAAC;QACnC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js new file mode 100644 index 00000000..e70d30ae --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js @@ -0,0 +1,857 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BulkOperationBase = exports.FindOperators = exports.MongoBulkWriteError = exports.WriteError = exports.WriteConcernError = exports.BulkWriteResult = exports.Batch = exports.BatchType = void 0; +exports.mergeBatchResults = mergeBatchResults; +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const delete_1 = require("../operations/delete"); +const execute_operation_1 = require("../operations/execute_operation"); +const insert_1 = require("../operations/insert"); +const update_1 = require("../operations/update"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const write_concern_1 = require("../write_concern"); +/** @public */ +exports.BatchType = Object.freeze({ + INSERT: 1, + UPDATE: 2, + DELETE: 3 +}); +/** + * Keeps the state of a unordered batch so we can rewrite the results + * correctly after command execution + * + * @public + */ +class Batch { + constructor(batchType, originalZeroIndex) { + this.originalZeroIndex = originalZeroIndex; + this.currentIndex = 0; + this.originalIndexes = []; + this.batchType = batchType; + this.operations = []; + this.serializedOperations = []; + this.size = 0; + this.sizeBytes = 0; + } +} +exports.Batch = Batch; +/** + * @public + * The result of a bulk write. + */ +class BulkWriteResult { + static generateIdMap(ids) { + const idMap = {}; + for (const doc of ids) { + idMap[doc.index] = doc._id; + } + return idMap; + } + /** + * Create a new BulkWriteResult instance + * @internal + */ + constructor(bulkResult, isOrdered) { + this.result = bulkResult; + this.insertedCount = this.result.nInserted ?? 0; + this.matchedCount = this.result.nMatched ?? 0; + this.modifiedCount = this.result.nModified ?? 0; + this.deletedCount = this.result.nRemoved ?? 0; + this.upsertedCount = this.result.upserted.length ?? 0; + this.upsertedIds = BulkWriteResult.generateIdMap(this.result.upserted); + this.insertedIds = BulkWriteResult.generateIdMap(this.getSuccessfullyInsertedIds(bulkResult, isOrdered)); + Object.defineProperty(this, 'result', { value: this.result, enumerable: false }); + } + /** Evaluates to true if the bulk operation correctly executes */ + get ok() { + return this.result.ok; + } + /** + * Returns document_ids that were actually inserted + * @internal + */ + getSuccessfullyInsertedIds(bulkResult, isOrdered) { + if (bulkResult.writeErrors.length === 0) + return bulkResult.insertedIds; + if (isOrdered) { + return bulkResult.insertedIds.slice(0, bulkResult.writeErrors[0].index); + } + return bulkResult.insertedIds.filter(({ index }) => !bulkResult.writeErrors.some(writeError => index === writeError.index)); + } + /** Returns the upserted id at the given index */ + getUpsertedIdAt(index) { + return this.result.upserted[index]; + } + /** Returns raw internal result */ + getRawResponse() { + return this.result; + } + /** Returns true if the bulk operation contains a write error */ + hasWriteErrors() { + return this.result.writeErrors.length > 0; + } + /** Returns the number of write errors from the bulk operation */ + getWriteErrorCount() { + return this.result.writeErrors.length; + } + /** Returns a specific write error object */ + getWriteErrorAt(index) { + return index < this.result.writeErrors.length ? this.result.writeErrors[index] : undefined; + } + /** Retrieve all write errors */ + getWriteErrors() { + return this.result.writeErrors; + } + /** Retrieve the write concern error if one exists */ + getWriteConcernError() { + if (this.result.writeConcernErrors.length === 0) { + return; + } + else if (this.result.writeConcernErrors.length === 1) { + // Return the error + return this.result.writeConcernErrors[0]; + } + else { + // Combine the errors + let errmsg = ''; + for (let i = 0; i < this.result.writeConcernErrors.length; i++) { + const err = this.result.writeConcernErrors[i]; + errmsg = errmsg + err.errmsg; + // TODO: Something better + if (i === 0) + errmsg = errmsg + ' and '; + } + return new WriteConcernError({ errmsg, code: error_1.MONGODB_ERROR_CODES.WriteConcernTimeout }); + } + } + toString() { + return `BulkWriteResult(${bson_1.EJSON.stringify(this.result)})`; + } + isOk() { + return this.result.ok === 1; + } +} +exports.BulkWriteResult = BulkWriteResult; +/** + * An error representing a failure by the server to apply the requested write concern to the bulk operation. + * @public + * @category Error + */ +class WriteConcernError { + constructor(error) { + this.serverError = error; + } + /** Write concern error code. */ + get code() { + return this.serverError.code; + } + /** Write concern error message. */ + get errmsg() { + return this.serverError.errmsg; + } + /** Write concern error info. */ + get errInfo() { + return this.serverError.errInfo; + } + toJSON() { + return this.serverError; + } + toString() { + return `WriteConcernError(${this.errmsg})`; + } +} +exports.WriteConcernError = WriteConcernError; +/** + * An error that occurred during a BulkWrite on the server. + * @public + * @category Error + */ +class WriteError { + constructor(err) { + this.err = err; + } + /** WriteError code. */ + get code() { + return this.err.code; + } + /** WriteError original bulk operation index. */ + get index() { + return this.err.index; + } + /** WriteError message. */ + get errmsg() { + return this.err.errmsg; + } + /** WriteError details. */ + get errInfo() { + return this.err.errInfo; + } + /** Returns the underlying operation that caused the error */ + getOperation() { + return this.err.op; + } + toJSON() { + return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op }; + } + toString() { + return `WriteError(${JSON.stringify(this.toJSON())})`; + } +} +exports.WriteError = WriteError; +/** Merges results into shared data structure */ +function mergeBatchResults(batch, bulkResult, err, result) { + // If we have an error set the result to be the err object + if (err) { + result = err; + } + else if (result && result.result) { + result = result.result; + } + if (result == null) { + return; + } + // Do we have a top level error stop processing and return + if (result.ok === 0 && bulkResult.ok === 1) { + bulkResult.ok = 0; + const writeError = { + index: 0, + code: result.code || 0, + errmsg: result.message, + errInfo: result.errInfo, + op: batch.operations[0] + }; + bulkResult.writeErrors.push(new WriteError(writeError)); + return; + } + else if (result.ok === 0 && bulkResult.ok === 0) { + return; + } + // If we have an insert Batch type + if (isInsertBatch(batch) && result.n) { + bulkResult.nInserted = bulkResult.nInserted + result.n; + } + // If we have an insert Batch type + if (isDeleteBatch(batch) && result.n) { + bulkResult.nRemoved = bulkResult.nRemoved + result.n; + } + let nUpserted = 0; + // We have an array of upserted values, we need to rewrite the indexes + if (Array.isArray(result.upserted)) { + nUpserted = result.upserted.length; + for (let i = 0; i < result.upserted.length; i++) { + bulkResult.upserted.push({ + index: result.upserted[i].index + batch.originalZeroIndex, + _id: result.upserted[i]._id + }); + } + } + else if (result.upserted) { + nUpserted = 1; + bulkResult.upserted.push({ + index: batch.originalZeroIndex, + _id: result.upserted + }); + } + // If we have an update Batch type + if (isUpdateBatch(batch) && result.n) { + const nModified = result.nModified; + bulkResult.nUpserted = bulkResult.nUpserted + nUpserted; + bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted); + if (typeof nModified === 'number') { + bulkResult.nModified = bulkResult.nModified + nModified; + } + else { + bulkResult.nModified = 0; + } + } + if (Array.isArray(result.writeErrors)) { + for (let i = 0; i < result.writeErrors.length; i++) { + const writeError = { + index: batch.originalIndexes[result.writeErrors[i].index], + code: result.writeErrors[i].code, + errmsg: result.writeErrors[i].errmsg, + errInfo: result.writeErrors[i].errInfo, + op: batch.operations[result.writeErrors[i].index] + }; + bulkResult.writeErrors.push(new WriteError(writeError)); + } + } + if (result.writeConcernError) { + bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError)); + } +} +async function executeCommands(bulkOperation, options) { + if (bulkOperation.s.batches.length === 0) { + return new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + } + for (const batch of bulkOperation.s.batches) { + const finalOptions = (0, utils_1.resolveOptions)(bulkOperation, { + ...options, + ordered: bulkOperation.isOrdered + }); + if (finalOptions.bypassDocumentValidation !== true) { + delete finalOptions.bypassDocumentValidation; + } + // Is the bypassDocumentValidation options specific + if (bulkOperation.s.bypassDocumentValidation === true) { + finalOptions.bypassDocumentValidation = true; + } + // Is the checkKeys option disabled + if (bulkOperation.s.checkKeys === false) { + finalOptions.checkKeys = false; + } + if (bulkOperation.retryWrites) { + if (isUpdateBatch(batch)) { + bulkOperation.retryWrites = + bulkOperation.retryWrites && !batch.operations.some(op => op.multi); + } + if (isDeleteBatch(batch)) { + bulkOperation.retryWrites = + bulkOperation.retryWrites && !batch.operations.some(op => op.limit === 0); + } + } + // The per-operation buffers were serialized in addToOperationsList using the + // bulk operation's BSON options. Reuse them only when the serialization + // options in effect for this execution still match, so that BSON options + // supplied to execute() (e.g. `ignoreUndefined`) are honored. Also skip reuse + // under auto-encryption, where libmongocrypt requires the plaintext command + // (document sequences are not permitted per the bulkWrite spec). + const createdBsonOptions = bulkOperation.s.bsonOptions; + const canReuseSerialized = !bulkOperation.s.usingAutoEncryption && + finalOptions.ignoreUndefined === createdBsonOptions.ignoreUndefined && + finalOptions.serializeFunctions === createdBsonOptions.serializeFunctions && + (finalOptions.checkKeys ?? false) === bulkOperation.s.checkKeys; + const serialized = canReuseSerialized ? batch.serializedOperations : undefined; + const operation = isInsertBatch(batch) + ? new insert_1.InsertOperation(bulkOperation.s.namespace, batch.operations, finalOptions, serialized) + : isUpdateBatch(batch) + ? new update_1.UpdateOperation(bulkOperation.s.namespace, batch.operations, finalOptions, serialized) + : isDeleteBatch(batch) + ? new delete_1.DeleteOperation(bulkOperation.s.namespace, batch.operations, finalOptions, serialized) + : null; + if (operation == null) + throw new error_1.MongoRuntimeError(`Unknown batchType: ${batch.batchType}`); + let thrownError = null; + let result; + try { + result = await (0, execute_operation_1.executeOperation)(bulkOperation.s.collection.client, operation, finalOptions.timeoutContext); + } + catch (error) { + thrownError = error; + } + // Release this batch's serialized buffers now that it has been sent. The + // operation keeps its own reference to the array for the duration of its + // execution and any retries, so reassigning here (rather than mutating the + // shared array) only drops the bulk operation's copy. All batches are built + // up front, so this does not lower the peak (reached before the first send); + // it frees each batch's buffers as that batch completes so they are not kept + // alive through the remaining batches' round trips. + batch.serializedOperations = []; + if (thrownError != null) { + if (thrownError instanceof error_1.MongoWriteConcernError) { + mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result); + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + throw new MongoBulkWriteError({ + message: thrownError.result.writeConcernError.errmsg, + code: thrownError.result.writeConcernError.code + }, writeResult); + } + else { + // Error is a driver related error not a bulk op error, return early + throw new MongoBulkWriteError(thrownError, new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered)); + } + } + mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result); + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + bulkOperation.handleWriteError(writeResult); + } + bulkOperation.s.batches.length = 0; + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + bulkOperation.handleWriteError(writeResult); + return writeResult; +} +/** + * An error indicating an unsuccessful Bulk Write + * @public + * @category Error + */ +class MongoBulkWriteError extends error_1.MongoServerError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(error, result) { + super(error); + this.writeErrors = []; + if (error instanceof WriteConcernError) + this.err = error; + else if (!(error instanceof Error)) { + this.message = error.message; + this.code = error.code; + this.writeErrors = error.writeErrors ?? []; + } + this.result = result; + Object.assign(this, error); + } + get name() { + return 'MongoBulkWriteError'; + } + /** Number of documents inserted. */ + get insertedCount() { + return this.result.insertedCount; + } + /** Number of documents matched for update. */ + get matchedCount() { + return this.result.matchedCount; + } + /** Number of documents modified. */ + get modifiedCount() { + return this.result.modifiedCount; + } + /** Number of documents deleted. */ + get deletedCount() { + return this.result.deletedCount; + } + /** Number of documents upserted. */ + get upsertedCount() { + return this.result.upsertedCount; + } + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds() { + return this.result.insertedIds; + } + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds() { + return this.result.upsertedIds; + } +} +exports.MongoBulkWriteError = MongoBulkWriteError; +/** + * A builder object that is returned from {@link BulkOperationBase#find}. + * Is used to build a write operation that involves a query filter. + * + * @public + */ +class FindOperators { + /** + * Creates a new FindOperators object. + * @internal + */ + constructor(bulkOperation) { + this.bulkOperation = bulkOperation; + } + /** Add a multiple update operation to the bulk operation */ + update(updateDocument) { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, { + ...currentOp, + multi: true + })); + } + /** Add a single update operation to the bulk operation */ + updateOne(updateDocument) { + if (!(0, utils_1.hasAtomicOperators)(updateDocument, this.bulkOperation.bsonOptions)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, { ...currentOp, multi: false })); + } + /** Add a replace one operation to the bulk operation */ + replaceOne(replacement) { + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, replacement, { ...currentOp, multi: false })); + } + /** Add a delete one operation to the bulk operation */ + deleteOne() { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 1 })); + } + /** Add a delete many operation to the bulk operation */ + delete() { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 0 })); + } + /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */ + upsert() { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.upsert = true; + return this; + } + /** Specifies the collation for the query condition. */ + collation(collation) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.collation = collation; + return this; + } + /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */ + arrayFilters(arrayFilters) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.arrayFilters = arrayFilters; + return this; + } + /** Specifies hint for the bulk operation. */ + hint(hint) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.hint = hint; + return this; + } +} +exports.FindOperators = FindOperators; +/** @public */ +class BulkOperationBase { + /** + * Create a new OrderedBulkOperation or UnorderedBulkOperation instance + * @internal + */ + constructor(collection, options, isOrdered) { + this.collection = collection; + this.retryWrites = collection.db.options?.retryWrites; + // determine whether bulkOperation is ordered or unordered + this.isOrdered = isOrdered; + const topology = (0, utils_1.getTopology)(collection); + options = options == null ? {} : options; + // TODO Bring from driver information in hello + // Get the namespace for the write operations + const namespace = collection.s.namespace; + // Used to mark operation as executed + const executed = false; + // Current item + const currentOp = undefined; + // Set max byte size + const hello = topology.lastHello(); + // If we have autoEncryption on, batch-splitting must be done on 2mb chunks, but single documents + // over 2mb are still allowed + const usingAutoEncryption = !!(topology.s.options && topology.s.options.autoEncrypter); + const maxBsonObjectSize = hello && hello.maxBsonObjectSize ? hello.maxBsonObjectSize : 1024 * 1024 * 16; + const maxBatchSizeBytes = usingAutoEncryption ? 1024 * 1024 * 2 : maxBsonObjectSize; + const maxWriteBatchSize = hello && hello.maxWriteBatchSize ? hello.maxWriteBatchSize : 1000; + // Calculates the largest possible size of an Array key, represented as a BSON string + // element. This calculation: + // 1 byte for BSON type + // # of bytes = length of (string representation of (maxWriteBatchSize - 1)) + // + 1 bytes for null terminator + const maxKeySize = (maxWriteBatchSize - 1).toString(10).length + 2; + // Final results + const bulkResult = { + ok: 1, + writeErrors: [], + writeConcernErrors: [], + insertedIds: [], + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [] + }; + // Internal state + this.s = { + // Final result + bulkResult, + // Current batch state + currentBatch: undefined, + currentIndex: 0, + // ordered specific + currentBatchSize: 0, + currentBatchSizeBytes: 0, + // unordered specific + currentInsertBatch: undefined, + currentUpdateBatch: undefined, + currentRemoveBatch: undefined, + batches: [], + // Write concern + writeConcern: write_concern_1.WriteConcern.fromOptions(options), + // Max batch size options + maxBsonObjectSize, + maxBatchSizeBytes, + maxWriteBatchSize, + maxKeySize, + // Namespace + namespace, + // Topology + topology, + // Options + options: options, + // BSON options + bsonOptions: (0, bson_1.resolveBSONOptions)(options), + // Current operation + currentOp, + // Executed + executed, + // Collection + collection, + // Fundamental error + err: undefined, + // check keys + checkKeys: typeof options.checkKeys === 'boolean' ? options.checkKeys : false, + usingAutoEncryption + }; + // bypass Validation + if (options.bypassDocumentValidation === true) { + this.s.bypassDocumentValidation = true; + } + } + /** + * Add a single insert document to the bulk operation + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Adds three inserts to the bulkOp. + * bulkOp + * .insert({ a: 1 }) + * .insert({ b: 2 }) + * .insert({ c: 3 }); + * await bulkOp.execute(); + * ``` + */ + insert(document) { + (0, utils_1.maybeAddIdToDocuments)(this.collection, document, { + forceServerObjectId: this.shouldForceServerObjectId() + }); + return this.addToOperationsList(exports.BatchType.INSERT, document); + } + /** + * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. + * Returns a builder object used to complete the definition of the operation. + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Add an updateOne to the bulkOp + * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } }); + * + * // Add an updateMany to the bulkOp + * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } }); + * + * // Add an upsert + * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } }); + * + * // Add a deletion + * bulkOp.find({ g: 7 }).deleteOne(); + * + * // Add a multi deletion + * bulkOp.find({ h: 8 }).delete(); + * + * // Add a replaceOne + * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }}); + * + * // Update using a pipeline + * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([ + * { $set: { total: { $sum: [ '$y', '$z' ] } } } + * ]); + * + * // All of the ops will now be executed + * await bulkOp.execute(); + * ``` + */ + find(selector) { + if (!selector) { + throw new error_1.MongoInvalidArgumentError('Bulk find operation must specify a selector'); + } + // Save a current selector + this.s.currentOp = { + selector: selector + }; + return new FindOperators(this); + } + /** Specifies a raw operation to perform in the bulk write. */ + raw(op) { + if (op == null || typeof op !== 'object') { + throw new error_1.MongoInvalidArgumentError('Operation must be an object with an operation key'); + } + if ('insertOne' in op) { + const forceServerObjectId = this.shouldForceServerObjectId(); + const document = op.insertOne && op.insertOne.document == null + ? // TODO(NODE-6003): remove support for omitting the `documents` subdocument in bulk inserts + op.insertOne + : op.insertOne.document; + (0, utils_1.maybeAddIdToDocuments)(this.collection, document, { forceServerObjectId }); + return this.addToOperationsList(exports.BatchType.INSERT, document); + } + if ('replaceOne' in op || 'updateOne' in op || 'updateMany' in op) { + if ('replaceOne' in op) { + if ('q' in op.replaceOne) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op.replaceOne.filter, op.replaceOne.replacement, { ...op.replaceOne, multi: false }); + if ((0, utils_1.hasAtomicOperators)(updateStatement.u)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement); + } + if ('updateOne' in op) { + if ('q' in op.updateOne) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op.updateOne.filter, op.updateOne.update, { + ...op.updateOne, + multi: false + }); + if (!(0, utils_1.hasAtomicOperators)(updateStatement.u, this.bsonOptions)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement); + } + if ('updateMany' in op) { + if ('q' in op.updateMany) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op.updateMany.filter, op.updateMany.update, { + ...op.updateMany, + multi: true + }); + if (!(0, utils_1.hasAtomicOperators)(updateStatement.u, this.bsonOptions)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement); + } + } + if ('deleteOne' in op) { + if ('q' in op.deleteOne) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op.deleteOne.filter, { ...op.deleteOne, limit: 1 })); + } + if ('deleteMany' in op) { + if ('q' in op.deleteMany) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op.deleteMany.filter, { ...op.deleteMany, limit: 0 })); + } + // otherwise an unknown operation was provided + throw new error_1.MongoInvalidArgumentError('bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany'); + } + get length() { + return this.s.currentIndex; + } + get bsonOptions() { + return this.s.bsonOptions; + } + get writeConcern() { + return this.s.writeConcern; + } + get batches() { + const batches = [...this.s.batches]; + if (this.isOrdered) { + if (this.s.currentBatch) + batches.push(this.s.currentBatch); + } + else { + if (this.s.currentInsertBatch) + batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) + batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) + batches.push(this.s.currentRemoveBatch); + } + return batches; + } + async execute(options = {}) { + if (this.s.executed) { + throw new error_1.MongoBatchReExecutionError(); + } + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (writeConcern) { + this.s.writeConcern = writeConcern; + } + // If we have current batch + if (this.isOrdered) { + if (this.s.currentBatch) + this.s.batches.push(this.s.currentBatch); + } + else { + if (this.s.currentInsertBatch) + this.s.batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) + this.s.batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) + this.s.batches.push(this.s.currentRemoveBatch); + } + // If we have no operations in the bulk raise an error + if (this.s.batches.length === 0) { + throw new error_1.MongoInvalidArgumentError('Invalid BulkOperation, Batch cannot be empty'); + } + this.s.executed = true; + const finalOptions = (0, utils_1.resolveOptions)(this.collection, { ...this.s.options, ...options }); + // if there is no timeoutContext provided, create a timeoutContext and use it for + // all batches in the bulk operation + finalOptions.timeoutContext ??= timeout_1.TimeoutContext.create({ + session: finalOptions.session, + timeoutMS: finalOptions.timeoutMS, + serverSelectionTimeoutMS: this.collection.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: this.collection.client.s.options.waitQueueTimeoutMS + }); + if (finalOptions.session == null) { + // if there is not an explicit session provided to `execute()`, create + // an implicit session and use that for all batches in the bulk operation + return await this.collection.client.withSession({ explicit: false }, async (session) => { + return await executeCommands(this, { ...finalOptions, session }); + }); + } + return await executeCommands(this, { ...finalOptions }); + } + /** + * Handles the write error before executing commands + * @internal + */ + handleWriteError(writeResult) { + if (this.s.bulkResult.writeErrors.length > 0) { + const msg = this.s.bulkResult.writeErrors[0].errmsg + ? this.s.bulkResult.writeErrors[0].errmsg + : 'write operation failed'; + throw new MongoBulkWriteError({ + message: msg, + code: this.s.bulkResult.writeErrors[0].code, + writeErrors: this.s.bulkResult.writeErrors + }, writeResult); + } + const writeConcernError = writeResult.getWriteConcernError(); + if (writeConcernError) { + throw new MongoBulkWriteError(writeConcernError, writeResult); + } + } + shouldForceServerObjectId() { + return (this.s.options.forceServerObjectId === true || + this.s.collection.db.options?.forceServerObjectId === true); + } +} +exports.BulkOperationBase = BulkOperationBase; +function isInsertBatch(batch) { + return batch.batchType === exports.BatchType.INSERT; +} +function isUpdateBatch(batch) { + return batch.batchType === exports.BatchType.UPDATE; +} +function isDeleteBatch(batch) { + return batch.batchType === exports.BatchType.DELETE; +} +function buildCurrentOp(bulkOp) { + let { currentOp } = bulkOp.s; + bulkOp.s.currentOp = undefined; + if (!currentOp) + currentOp = {}; + return currentOp; +} +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js.map new file mode 100644 index 00000000..3525cd9b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common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oBAAoB,EAAE,CAAC;QAC7D,IAAI,iBAAiB,EAAE,CAAC;YACtB,MAAM,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAOO,yBAAyB;QAC/B,OAAO,CACL,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,KAAK,IAAI;YAC3C,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAC3D,CAAC;IACJ,CAAC;CACF;AA1XD,8CA0XC;AAED,SAAS,aAAa,CAAC,KAAY;IACjC,OAAO,KAAK,CAAC,SAAS,KAAK,iBAAS,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED,SAAS,aAAa,CAAC,KAAY;IACjC,OAAO,KAAK,CAAC,SAAS,KAAK,iBAAS,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED,SAAS,aAAa,CAAC,KAAY;IACjC,OAAO,KAAK,CAAC,SAAS,KAAK,iBAAS,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED,SAAS,cAAc,CAAC,MAAyB;IAC/C,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;IAC7B,MAAM,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,SAAS;QAAE,SAAS,GAAG,EAAE,CAAC;IAC/B,OAAO,SAAS,CAAC;AACnB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js new file mode 100644 index 00000000..99b46e04 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OrderedBulkOperation = void 0; +const BSON = require("../bson"); +const error_1 = require("../error"); +const common_1 = require("./common"); +/** @public */ +class OrderedBulkOperation extends common_1.BulkOperationBase { + /** @internal */ + constructor(collection, options) { + super(collection, options, true); + } + addToOperationsList(batchType, document) { + // Serialize the operation once here and reuse the bytes for both the size + // check/splitting and the wire message (via a DocumentSequence). Under + // auto-encryption the command is sent as a BSON array rather than a + // document sequence, so the buffer would never be reused; there we only + // measure the size and leave `buffer` undefined so nothing is retained on + // the batch. + let buffer; + let bsonSize; + if (this.s.usingAutoEncryption) { + bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + ignoreUndefined: false + }); + } + else { + const bson = this.s.bsonOptions; + buffer = BSON.serialize(document, { + checkKeys: this.s.checkKeys, + ignoreUndefined: bson.ignoreUndefined, + serializeFunctions: bson.serializeFunctions + }); + bsonSize = buffer.length; + } + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) + // TODO(NODE-3483): Change this to MongoBSONError + throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`); + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + const maxKeySize = this.s.maxKeySize; + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatchSize + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatchSize > 0 && + this.s.currentBatchSizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + // Create a new batch + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + // Reset the current size trackers + this.s.currentBatchSize = 0; + this.s.currentBatchSizeBytes = 0; + } + if (batchType === common_1.BatchType.INSERT) { + this.s.bulkResult.insertedIds.push({ + index: this.s.currentIndex, + _id: document._id + }); + } + // We have an array of documents + if (Array.isArray(document)) { + throw new error_1.MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentBatch.operations.push(document); + if (buffer != null) + this.s.currentBatch.serializedOperations.push(buffer); + this.s.currentBatchSize += 1; + this.s.currentBatchSizeBytes += maxKeySize + bsonSize; + this.s.currentIndex += 1; + return this; + } +} +exports.OrderedBulkOperation = OrderedBulkOperation; +//# sourceMappingURL=ordered.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js.map new file mode 100644 index 00000000..999139ef --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/ordered.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ordered.js","sourceRoot":"","sources":["../../src/bulk/ordered.ts"],"names":[],"mappings":";;;AACA,gCAAgC;AAEhC,oCAAqD;AAGrD,qCAAsF;AAEtF,cAAc;AACd,MAAa,oBAAqB,SAAQ,0BAAiB;IACzD,gBAAgB;IAChB,YAAY,UAAsB,EAAE,OAAyB;QAC3D,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,mBAAmB,CACjB,SAAoB,EACpB,QAAsD;QAEtD,0EAA0E;QAC1E,uEAAuE;QACvE,oEAAoE;QACpE,wEAAwE;QACxE,0EAA0E;QAC1E,aAAa;QACb,IAAI,MAA8B,CAAC;QACnC,IAAI,QAAgB,CAAC;QACrB,IAAI,IAAI,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;YAC/B,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE;gBAC5C,SAAS,EAAE,KAAK;gBAChB,eAAe,EAAE,KAAK;aAChB,CAAC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B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzFD,oDAyFC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js new file mode 100644 index 00000000..8eda39f0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnorderedBulkOperation = void 0; +const BSON = require("../bson"); +const error_1 = require("../error"); +const common_1 = require("./common"); +/** @public */ +class UnorderedBulkOperation extends common_1.BulkOperationBase { + /** @internal */ + constructor(collection, options) { + super(collection, options, false); + } + handleWriteError(writeResult) { + if (this.s.batches.length) { + return; + } + return super.handleWriteError(writeResult); + } + addToOperationsList(batchType, document) { + // Serialize the operation once here and reuse the bytes for both the size + // check/splitting and the wire message (via a DocumentSequence). Under + // auto-encryption the command is sent as a BSON array rather than a + // document sequence, so the buffer would never be reused; there we only + // measure the size and leave `buffer` undefined so nothing is retained on + // the batch. + let buffer; + let bsonSize; + if (this.s.usingAutoEncryption) { + bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + ignoreUndefined: false + }); + } + else { + const bson = this.s.bsonOptions; + buffer = BSON.serialize(document, { + checkKeys: this.s.checkKeys, + ignoreUndefined: bson.ignoreUndefined, + serializeFunctions: bson.serializeFunctions + }); + bsonSize = buffer.length; + } + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) { + // TODO(NODE-3483): Change this to MongoBSONError + throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`); + } + // Holds the current batch + this.s.currentBatch = undefined; + // Get the right type of batch + if (batchType === common_1.BatchType.INSERT) { + this.s.currentBatch = this.s.currentInsertBatch; + } + else if (batchType === common_1.BatchType.UPDATE) { + this.s.currentBatch = this.s.currentUpdateBatch; + } + else if (batchType === common_1.BatchType.DELETE) { + this.s.currentBatch = this.s.currentRemoveBatch; + } + const maxKeySize = this.s.maxKeySize; + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatch.size + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatch.size > 0 && + this.s.currentBatch.sizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + // Create a new batch + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + // We have an array of documents + if (Array.isArray(document)) { + throw new error_1.MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + this.s.currentBatch.operations.push(document); + if (buffer != null) + this.s.currentBatch.serializedOperations.push(buffer); + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentIndex = this.s.currentIndex + 1; + // Save back the current Batch to the right type + if (batchType === common_1.BatchType.INSERT) { + this.s.currentInsertBatch = this.s.currentBatch; + this.s.bulkResult.insertedIds.push({ + index: this.s.bulkResult.insertedIds.length, + _id: document._id + }); + } + else if (batchType === common_1.BatchType.UPDATE) { + this.s.currentUpdateBatch = this.s.currentBatch; + } + else if (batchType === common_1.BatchType.DELETE) { + this.s.currentRemoveBatch = this.s.currentBatch; + } + // Update current batch size + this.s.currentBatch.size += 1; + this.s.currentBatch.sizeBytes += maxKeySize + bsonSize; + return this; + } +} +exports.UnorderedBulkOperation = UnorderedBulkOperation; +//# sourceMappingURL=unordered.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js.map new file mode 100644 index 00000000..1a58ad47 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/bulk/unordered.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unordered.js","sourceRoot":"","sources":["../../src/bulk/unordered.ts"],"names":[],"mappings":";;;AACA,gCAAgC;AAEhC,oCAAqD;AAGrD,qCAMkB;AAElB,cAAc;AACd,MAAa,sBAAuB,SAAQ,0BAAiB;IAC3D,gBAAgB;IAChB,YAAY,UAAsB,EAAE,OAAyB;QAC3D,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAEQ,gBAAgB,CAAC,WAA4B;QACpD,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED,mBAAmB,CACjB,SAAoB,EACpB,QAAsD;QAEtD,0EAA0E;QAC1E,uEAAuE;QACvE,oEAAoE;QACpE,wEAAwE;QACxE,0EAA0E;QAC1E,aAAa;QACb,IAAI,MAA8B,CAAC;QACnC,IAAI,QAAgB,CAAC;QACrB,IAAI,IAAI,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;YAC/B,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE;gBAC5C,SAAS,EAAE,KAAK;gBAChB,eAAe,EAAE,KAAK;aAChB,CAAC,CAAC;QACZ,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC;YAChC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;gBAChC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS;gBAC3B,eAAe,EAAE,IAAI,CAAC,eAAe;gBAC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I,CAAC,CAAC,CAAC,YAAY,CAAC;YAChD,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC;gBACjC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM;gBAC3C,GAAG,EAAG,QAAqB,CAAC,GAAG;aAChC,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,SAAS,KAAK,kBAAS,CAAC,MAAM,EAAE,CAAC;YAC1C,IAAI,CAAC,CAAC,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;QAClD,CAAC;aAAM,IAAI,SAAS,KAAK,kBAAS,CAAC,MAAM,EAAE,CAAC;YAC1C,IAAI,CAAC,CAAC,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;QAClD,CAAC;QAED,4BAA4B;QAC5B,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,IAAI,UAAU,GAAG,QAAQ,CAAC;QAEvD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlHD,wDAkHC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js new file mode 100644 index 00000000..8b362366 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js @@ -0,0 +1,516 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChangeStream = void 0; +exports.filterOutOptions = filterOutOptions; +const collection_1 = require("./collection"); +const constants_1 = require("./constants"); +const abstract_cursor_1 = require("./cursor/abstract_cursor"); +const change_stream_cursor_1 = require("./cursor/change_stream_cursor"); +const db_1 = require("./db"); +const error_1 = require("./error"); +const mongo_client_1 = require("./mongo_client"); +const mongo_types_1 = require("./mongo_types"); +const server_selection_1 = require("./sdam/server_selection"); +const timeout_1 = require("./timeout"); +const utils_1 = require("./utils"); +const CHANGE_DOMAIN_TYPES = { + COLLECTION: Symbol('Collection'), + DATABASE: Symbol('Database'), + CLUSTER: Symbol('Cluster') +}; +const CHANGE_STREAM_EVENTS = [constants_1.RESUME_TOKEN_CHANGED, constants_1.END, constants_1.CLOSE]; +const NO_RESUME_TOKEN_ERROR = 'A change stream document has been received that lacks a resume token (_id).'; +const CHANGESTREAM_CLOSED_ERROR = 'ChangeStream is closed'; +const INVALID_STAGE_OPTIONS = buildDisallowedChangeStreamOptions(); +function filterOutOptions(options) { + return Object.fromEntries(Object.entries(options).filter(([k, _]) => !INVALID_STAGE_OPTIONS.has(k))); +} +/** + * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}. + * @public + */ +class ChangeStream extends mongo_types_1.TypedEventEmitter { + /** + * An alias for {@link ChangeStream.close|ChangeStream.close()}. + */ + async [Symbol.asyncDispose]() { + await this.close(); + } + /** @event */ + static { this.RESPONSE = constants_1.RESPONSE; } + /** @event */ + static { this.MORE = constants_1.MORE; } + /** @event */ + static { this.INIT = constants_1.INIT; } + /** @event */ + static { this.CLOSE = constants_1.CLOSE; } + /** + * Fired for each new matching change in the specified namespace. Attaching a `change` + * event listener to a Change Stream will switch the stream into flowing mode. Data will + * then be passed as soon as it is available. + * @event + */ + static { this.CHANGE = constants_1.CHANGE; } + /** @event */ + static { this.END = constants_1.END; } + /** @event */ + static { this.ERROR = constants_1.ERROR; } + /** + * Emitted each time the change stream stores a new resume token. + * @event + */ + static { this.RESUME_TOKEN_CHANGED = constants_1.RESUME_TOKEN_CHANGED; } + /** + * @internal + * + * @param parent - The parent object that created this change stream + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents + */ + constructor(parent, pipeline = [], options = {}) { + super(); + this.pipeline = pipeline; + this.options = { ...options }; + let serverSelectionTimeoutMS; + delete this.options.writeConcern; + if (parent instanceof collection_1.Collection) { + this.type = CHANGE_DOMAIN_TYPES.COLLECTION; + serverSelectionTimeoutMS = parent.s.db.client.options.serverSelectionTimeoutMS; + } + else if (parent instanceof db_1.Db) { + this.type = CHANGE_DOMAIN_TYPES.DATABASE; + serverSelectionTimeoutMS = parent.client.options.serverSelectionTimeoutMS; + } + else if (parent instanceof mongo_client_1.MongoClient) { + this.type = CHANGE_DOMAIN_TYPES.CLUSTER; + serverSelectionTimeoutMS = parent.options.serverSelectionTimeoutMS; + } + else { + throw new error_1.MongoChangeStreamError('Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient'); + } + this.contextOwner = Symbol(); + this.parent = parent; + this.namespace = parent.s.namespace; + if (!this.options.readPreference && parent.readPreference) { + this.options.readPreference = parent.readPreference; + } + // Create contained Change Stream cursor + this.cursor = this._createChangeStreamCursor(options); + this.isClosed = false; + this.mode = false; + // Listen for any `change` listeners being added to ChangeStream + this.on('newListener', eventName => { + if (eventName === 'change' && this.cursor && this.listenerCount('change') === 0) { + this._streamEvents(this.cursor); + } + }); + this.on('removeListener', eventName => { + if (eventName === 'change' && this.listenerCount('change') === 0 && this.cursor) { + this.cursorStream?.removeAllListeners('data'); + } + }); + if (this.options.timeoutMS != null) { + this.timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS: this.options.timeoutMS, + serverSelectionTimeoutMS + }); + } + } + /** The cached resume token that is used to resume after the most recently returned change. */ + get resumeToken() { + return this.cursor?.resumeToken; + } + /** Returns the currently buffered documents length of the underlying cursor. */ + bufferedCount() { + return this.cursor?.bufferedCount() ?? 0; + } + /** Check if there is any document still available in the Change Stream */ + async hasNext() { + this._setIsIterator(); + // Change streams must resume indefinitely while each resume event succeeds. + // This loop continues until either a change event is received or until a resume attempt + // fails. + this.timeoutContext?.refresh(); + try { + while (true) { + try { + const hasNext = await this.cursor.hasNext(); + return hasNext; + } + catch (error) { + try { + await this._processErrorIteratorMode(error, this.cursor.id != null); + } + catch (error) { + if (error instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) { + throw error; + } + try { + await this.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + throw error; + } + } + } + } + finally { + this.timeoutContext?.clear(); + } + } + /** Get the next available document from the Change Stream. */ + async next() { + this._setIsIterator(); + // Change streams must resume indefinitely while each resume event succeeds. + // This loop continues until either a change event is received or until a resume attempt + // fails. + this.timeoutContext?.refresh(); + try { + while (true) { + try { + const change = await this.cursor.next(); + const processedChange = this._processChange(change ?? null); + return processedChange; + } + catch (error) { + try { + await this._processErrorIteratorMode(error, this.cursor.id != null); + } + catch (error) { + if (error instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) { + throw error; + } + try { + await this.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + throw error; + } + } + } + } + finally { + this.timeoutContext?.clear(); + } + } + /** + * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned + */ + async tryNext() { + this._setIsIterator(); + // Change streams must resume indefinitely while each resume event succeeds. + // This loop continues until either a change event is received or until a resume attempt + // fails. + this.timeoutContext?.refresh(); + try { + while (true) { + try { + const change = await this.cursor.tryNext(); + if (!change) { + return null; + } + const processedChange = this._processChange(change); + return processedChange; + } + catch (error) { + try { + await this._processErrorIteratorMode(error, this.cursor.id != null); + } + catch (error) { + if (error instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) + throw error; + try { + await this.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + throw error; + } + } + } + } + finally { + this.timeoutContext?.clear(); + } + } + async *[Symbol.asyncIterator]() { + if (this.closed) { + return; + } + try { + // Change streams run indefinitely as long as errors are resumable + // So the only loop breaking condition is if `next()` throws + while (true) { + yield await this.next(); + } + } + finally { + try { + await this.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + } + } + /** Is the cursor closed */ + get closed() { + return this.isClosed || this.cursor.closed; + } + /** + * Frees the internal resources used by the change stream. + */ + async close() { + this.timeoutContext?.clear(); + this.timeoutContext = undefined; + this.isClosed = true; + const cursor = this.cursor; + try { + await cursor.close(); + } + finally { + this._endStream(); + } + } + /** + * Return a modified Readable stream including a possible transform method. + * + * NOTE: When using a Stream to process change stream events, the stream will + * NOT automatically resume in the case a resumable error is encountered. + * + * @throws MongoChangeStreamError if the underlying cursor or the change stream is closed + */ + stream() { + if (this.closed) { + throw new error_1.MongoChangeStreamError(CHANGESTREAM_CLOSED_ERROR); + } + return this.cursor.stream(); + } + /** @internal */ + _setIsEmitter() { + if (this.mode === 'iterator') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new error_1.MongoAPIError('ChangeStream cannot be used as an EventEmitter after being used as an iterator'); + } + this.mode = 'emitter'; + } + /** @internal */ + _setIsIterator() { + if (this.mode === 'emitter') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new error_1.MongoAPIError('ChangeStream cannot be used as an iterator after being used as an EventEmitter'); + } + this.mode = 'iterator'; + } + /** + * Create a new change stream cursor based on self's configuration + * @internal + */ + _createChangeStreamCursor(options) { + const changeStreamStageOptions = filterOutOptions(options); + if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) { + changeStreamStageOptions.allChangesForCluster = true; + } + const pipeline = [{ $changeStream: changeStreamStageOptions }, ...this.pipeline]; + const client = this.type === CHANGE_DOMAIN_TYPES.CLUSTER + ? this.parent + : this.type === CHANGE_DOMAIN_TYPES.DATABASE + ? this.parent.client + : this.type === CHANGE_DOMAIN_TYPES.COLLECTION + ? this.parent.client + : null; + if (client == null) { + // This should never happen because of the assertion in the constructor + throw new error_1.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`); + } + const changeStreamCursor = new change_stream_cursor_1.ChangeStreamCursor(client, this.namespace, pipeline, { + ...options, + timeoutContext: this.timeoutContext + ? new abstract_cursor_1.CursorTimeoutContext(this.timeoutContext, this.contextOwner) + : undefined + }); + for (const event of CHANGE_STREAM_EVENTS) { + changeStreamCursor.on(event, e => this.emit(event, e)); + } + if (this.listenerCount(ChangeStream.CHANGE) > 0) { + this._streamEvents(changeStreamCursor); + } + return changeStreamCursor; + } + /** @internal */ + _closeEmitterModeWithError(error) { + this.emit(ChangeStream.ERROR, error); + this.close().then(undefined, utils_1.squashError); + } + /** @internal */ + _streamEvents(cursor) { + this._setIsEmitter(); + const stream = this.cursorStream ?? cursor.stream(); + this.cursorStream = stream; + stream.on('data', change => { + try { + const processedChange = this._processChange(change); + this.emit(ChangeStream.CHANGE, processedChange); + } + catch (error) { + this.emit(ChangeStream.ERROR, error); + } + this.timeoutContext?.refresh(); + }); + stream.on('error', error => this._processErrorStreamMode(error, this.cursor.id != null)); + } + /** @internal */ + _endStream() { + this.cursorStream?.removeAllListeners('data'); + this.cursorStream?.removeAllListeners('close'); + this.cursorStream?.removeAllListeners('end'); + this.cursorStream?.destroy(); + this.cursorStream = undefined; + } + /** @internal */ + _processChange(change) { + if (this.isClosed) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR); + } + // a null change means the cursor has been notified, implicitly closing the change stream + if (change == null) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + throw new error_1.MongoRuntimeError(CHANGESTREAM_CLOSED_ERROR); + } + if (change && !change._id) { + throw new error_1.MongoChangeStreamError(NO_RESUME_TOKEN_ERROR); + } + // cache the resume token + this.cursor.cacheResumeToken(change._id); + // wipe the startAtOperationTime if there was one so that there won't be a conflict + // between resumeToken and startAtOperationTime if we need to reconnect the cursor + this.options.startAtOperationTime = undefined; + return change; + } + /** @internal */ + _processErrorStreamMode(changeStreamError, cursorInitialized) { + // If the change stream has been closed explicitly, do not process error. + if (this.isClosed) + return; + if (cursorInitialized && + ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) || + changeStreamError instanceof error_1.MongoOperationTimeoutError)) { + this._endStream(); + this.cursor + .close() + .then(() => this._resume(changeStreamError), e => { + (0, utils_1.squashError)(e); + return this._resume(changeStreamError); + }) + .then(() => { + if (changeStreamError instanceof error_1.MongoOperationTimeoutError) + this.emit(ChangeStream.ERROR, changeStreamError); + }, () => this._closeEmitterModeWithError(changeStreamError)); + } + else { + this._closeEmitterModeWithError(changeStreamError); + } + } + /** @internal */ + async _processErrorIteratorMode(changeStreamError, cursorInitialized) { + if (this.isClosed) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR); + } + if (cursorInitialized && + ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) || + changeStreamError instanceof error_1.MongoOperationTimeoutError)) { + try { + await this.cursor.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + await this._resume(changeStreamError); + if (changeStreamError instanceof error_1.MongoOperationTimeoutError) + throw changeStreamError; + } + else { + try { + await this.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + throw changeStreamError; + } + } + async _resume(changeStreamError) { + this.timeoutContext?.refresh(); + const topology = (0, utils_1.getTopology)(this.parent); + try { + await topology.selectServer(this.cursor.readPreference, { + operationName: 'reconnect topology in change stream', + timeoutContext: this.timeoutContext, + deprioritizedServers: new server_selection_1.DeprioritizedServers() + }); + this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions); + } + catch { + // if the topology can't reconnect, close the stream + await this.close(); + throw changeStreamError; + } + } +} +exports.ChangeStream = ChangeStream; +/** + * This function returns a list of options that are *not* supported by the $changeStream + * aggregation stage. This is best-effort - it uses the options "officially supported" by the driver + * to derive a list of known, unsupported options for the $changeStream stage. + * + * Notably, at runtime, users can still provide options unknown to the driver and the driver will + * *not* filter them out of the options object (see NODE-5510). + */ +function buildDisallowedChangeStreamOptions() { + const denyList = { + allowDiskUse: '', + authdb: '', + batchSize: '', + bsonRegExp: '', + bypassDocumentValidation: '', + bypassPinningCheck: '', + checkKeys: '', + collation: '', + comment: '', + cursor: '', + dbName: '', + enableUtf8Validation: '', + explain: '', + fieldsAsRaw: '', + hint: '', + ignoreUndefined: '', + let: '', + maxAwaitTimeMS: '', + maxTimeMS: '', + omitMaxTimeMS: '', + out: '', + promoteBuffers: '', + promoteLongs: '', + promoteValues: '', + raw: '', + rawData: '', + readConcern: '', + readPreference: '', + serializeFunctions: '', + session: '', + timeoutContext: '', + timeoutMS: '', + timeoutMode: '', + useBigInt64: '', + willRetryWrite: '', + writeConcern: '' + }; + return new Set(Object.keys(denyList)); +} +//# sourceMappingURL=change_stream.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js.map new file mode 100644 index 00000000..45c97d5d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/change_stream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"change_stream.js","sourceRoot":"","sources":["../src/change_stream.ts"],"names":[],"mappings":";;;AAuCA,4CAIC;AAxCD,6CAA0C;AAC1C,2CAAoG;AACpG,8DAAgE;AAChE,wEAAmG;AACnG,6BAA0B;AAC1B,mCAOiB;AACjB,iDAA6C;AAC7C,+CAAoE;AAGpE,8DAA+D;AAE/D,uCAAoE;AACpE,mCAA2F;AAE3F,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,gCAAoB,EAAE,eAAG,EAAE,iBAAK,CAAU,CAAC;AAEzE,MAAM,qBAAqB,GACzB,6EAA6E,CAAC;AAChF,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAE3D,MAAM,qBAAqB,GAAG,kCAAkC,EAAE,CAAC;AAEnE,SAAgB,gBAAgB,CAAC,OAAmB;IAClD,OAAO,MAAM,CAAC,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AAC;YACP,oDAAoD;YACpD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,iBAAiB,CAAC;QAC1B,CAAC;IACH,CAAC;;AA1gBH,oCA2gBC;AAED;;;;;;;GAOG;AACH,SAAS,kCAAkC;IAuBzC,MAAM,QAAQ,GAAsB;QAClC,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,EAAE;QACd,wBAAwB,EAAE,EAAE;QAC5B,kBAAkB,EAAE,EAAE;QACtB,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;QACV,oBAAoB,EAAE,EAAE;QACxB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,EAAE;QACR,eAAe,EAAE,EAAE;QACnB,GAAG,EAAE,EAAE;QACP,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,EAAE;QACjB,GAAG,EAAE,EAAE;QACP,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,EAAE;QACjB,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,EAAE;QAClB,kBAAkB,EAAE,EAAE;QACtB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js new file mode 100644 index 00000000..67512e72 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js @@ -0,0 +1,287 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AutoEncrypter = exports.AutoEncryptionLoggerLevel = void 0; +const net = require("net"); +const bson_1 = require("../bson"); +const constants_1 = require("../constants"); +const deps_1 = require("../deps"); +const error_1 = require("../error"); +const mongo_client_1 = require("../mongo_client"); +const utils_1 = require("../utils"); +const client_encryption_1 = require("./client_encryption"); +const errors_1 = require("./errors"); +const mongocryptd_manager_1 = require("./mongocryptd_manager"); +const providers_1 = require("./providers"); +const state_machine_1 = require("./state_machine"); +/** @public */ +exports.AutoEncryptionLoggerLevel = Object.freeze({ + FatalError: 0, + Error: 1, + Warning: 2, + Info: 3, + Trace: 4 +}); +/** + * @internal An internal class to be used by the driver for auto encryption + * **NOTE**: Not meant to be instantiated directly, this is for internal use only. + */ +class AutoEncrypter { + static { _a = constants_1.kDecorateResult; } + /** @internal */ + static getMongoCrypt() { + const encryption = (0, deps_1.getMongoDBClientEncryption)(); + if ('kModuleError' in encryption) { + throw encryption.kModuleError; + } + return encryption.MongoCrypt; + } + /** + * Create an AutoEncrypter + * + * **Note**: Do not instantiate this class directly. Rather, supply the relevant options to a MongoClient + * + * **Note**: Supplying `options.schemaMap` provides more security than relying on JSON Schemas obtained from the server. + * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending unencrypted data that should be encrypted. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption. + * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. + * + * @example Create an AutoEncrypter that makes use of mongocryptd + * ```ts + * // Enabling autoEncryption via a MongoClient using mongocryptd + * const { MongoClient } = require('mongodb'); + * const client = new MongoClient(URL, { + * autoEncryption: { + * kmsProviders: { + * aws: { + * accessKeyId: AWS_ACCESS_KEY, + * secretAccessKey: AWS_SECRET_KEY + * } + * } + * } + * }); + * ``` + * + * await client.connect(); + * // From here on, the client will be encrypting / decrypting automatically + * @example Create an AutoEncrypter that makes use of libmongocrypt's CSFLE shared library + * ```ts + * // Enabling autoEncryption via a MongoClient using CSFLE shared library + * const { MongoClient } = require('mongodb'); + * const client = new MongoClient(URL, { + * autoEncryption: { + * kmsProviders: { + * aws: {} + * }, + * extraOptions: { + * cryptSharedLibPath: '/path/to/local/crypt/shared/lib', + * cryptSharedLibRequired: true + * } + * } + * }); + * ``` + * + * await client.connect(); + * // From here on, the client will be encrypting / decrypting automatically + */ + constructor(client, options) { + /** + * Used by devtools to enable decorating decryption results. + * + * When set and enabled, `decrypt` will automatically recursively + * traverse a decrypted document and if a field has been decrypted, + * it will mark it as decrypted. Compass uses this to determine which + * fields were decrypted. + */ + this[_a] = false; + this._client = client; + this._bypassEncryption = options.bypassAutoEncryption === true; + this._keyVaultNamespace = options.keyVaultNamespace || 'admin.datakeys'; + this._keyVaultClient = options.keyVaultClient || client; + this._metaDataClient = options.metadataClient || client; + this._proxyOptions = options.proxyOptions || {}; + if (this._proxyOptions.proxyHost && options.kmsConnectCallback) { + throw new errors_1.MongoCryptInvalidArgumentError('Cannot set both proxyOptions and kmsConnectCallback'); + } + this._tlsOptions = options.tlsOptions || {}; + this._kmsConnectCallback = options.kmsConnectCallback; + this._kmsProviders = options.kmsProviders || {}; + this._credentialProviders = options.credentialProviders; + if (options.credentialProviders?.aws && !(0, providers_1.isEmptyCredentials)('aws', this._kmsProviders)) { + throw new errors_1.MongoCryptInvalidArgumentError('Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching'); + } + const mongoCryptOptions = { + errorWrapper: errors_1.defaultErrorWrapper + }; + if (options.schemaMap) { + if (bson_1.ByteUtils.isUint8Array(options.schemaMap)) { + mongoCryptOptions.schemaMap = options.schemaMap; + } + else { + mongoCryptOptions.schemaMap = (0, bson_1.serialize)(options.schemaMap); + } + } + if (options.encryptedFieldsMap) { + if (bson_1.ByteUtils.isUint8Array(options.encryptedFieldsMap)) { + mongoCryptOptions.encryptedFieldsMap = options.encryptedFieldsMap; + } + else { + mongoCryptOptions.encryptedFieldsMap = (0, bson_1.serialize)(options.encryptedFieldsMap); + } + } + if (bson_1.ByteUtils.isUint8Array(this._kmsProviders)) { + mongoCryptOptions.kmsProviders = this._kmsProviders; + } + else { + mongoCryptOptions.kmsProviders = (0, bson_1.serialize)(this._kmsProviders); + } + if (options.options?.logger) { + mongoCryptOptions.logger = options.options.logger; + } + if (options.extraOptions && options.extraOptions.cryptSharedLibPath) { + mongoCryptOptions.cryptSharedLibPath = options.extraOptions.cryptSharedLibPath; + } + if (options.bypassQueryAnalysis) { + mongoCryptOptions.bypassQueryAnalysis = options.bypassQueryAnalysis; + } + if (options.keyExpirationMS != null) { + mongoCryptOptions.keyExpirationMS = options.keyExpirationMS; + } + this._bypassMongocryptdAndCryptShared = this._bypassEncryption || !!options.bypassQueryAnalysis; + if (options.extraOptions && options.extraOptions.cryptSharedLibSearchPaths) { + // Only for driver testing + mongoCryptOptions.cryptSharedLibSearchPaths = options.extraOptions.cryptSharedLibSearchPaths; + } + else if (!this._bypassMongocryptdAndCryptShared) { + mongoCryptOptions.cryptSharedLibSearchPaths = ['$SYSTEM']; + } + const MongoCrypt = AutoEncrypter.getMongoCrypt(); + this._mongocrypt = new MongoCrypt(mongoCryptOptions); + this._contextCounter = 0; + if (options.extraOptions && + options.extraOptions.cryptSharedLibRequired && + !this.cryptSharedLibVersionInfo) { + throw new errors_1.MongoCryptInvalidArgumentError('`cryptSharedLibRequired` set but no crypt_shared library loaded'); + } + // Only instantiate mongocryptd manager/client once we know for sure + // that we are not using the CSFLE shared library. + if (!this._bypassMongocryptdAndCryptShared && !this.cryptSharedLibVersionInfo) { + this._mongocryptdManager = new mongocryptd_manager_1.MongocryptdManager(options.extraOptions); + const clientOptions = { + serverSelectionTimeoutMS: 10000 + }; + if ((options.extraOptions == null || typeof options.extraOptions.mongocryptdURI !== 'string') && + !net.getDefaultAutoSelectFamily) { + // Only set family if autoSelectFamily options are not supported. + clientOptions.family = 4; + } + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore: TS complains as this always returns true on versions where it is present. + if (net.getDefaultAutoSelectFamily) { + // AutoEncrypter is made inside of MongoClient constructor while options are being parsed, + // we do not have access to the options that are in progress. + // TODO(NODE-6449): AutoEncrypter does not use client options for autoSelectFamily + Object.assign(clientOptions, (0, client_encryption_1.autoSelectSocketOptions)(this._client.s?.options ?? {})); + } + this._mongocryptdClient = new mongo_client_1.MongoClient(this._mongocryptdManager.uri, clientOptions); + } + } + /** + * Initializes the auto encrypter by spawning a mongocryptd and connecting to it. + * + * This function is a no-op when bypassSpawn is set or the crypt shared library is used. + */ + async init() { + if (this._bypassMongocryptdAndCryptShared || this.cryptSharedLibVersionInfo) { + return; + } + if (!this._mongocryptdManager) { + throw new error_1.MongoRuntimeError('Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.'); + } + if (!this._mongocryptdClient) { + throw new error_1.MongoRuntimeError('Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.'); + } + if (!this._mongocryptdManager.bypassSpawn) { + await this._mongocryptdManager.spawn(); + } + try { + const client = await this._mongocryptdClient.connect(); + return client; + } + catch (error) { + throw new error_1.MongoRuntimeError('Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn', { cause: error }); + } + } + /** + * Cleans up the `_mongocryptdClient`, if present. + */ + async close() { + await this._mongocryptdClient?.close(); + } + /** + * Encrypt a command for a given namespace. + */ + async encrypt(ns, cmd, options = {}) { + options.signal?.throwIfAborted(); + if (this._bypassEncryption) { + // If `bypassAutoEncryption` has been specified, don't encrypt + return cmd; + } + const commandBuffer = (0, bson_1.serialize)(cmd, options); + const context = this._mongocrypt.makeEncryptionContext(utils_1.MongoDBCollectionNamespace.fromString(ns).db, commandBuffer); + context.id = this._contextCounter++; + context.ns = ns; + context.document = cmd; + const stateMachine = new state_machine_1.StateMachine({ + promoteValues: false, + promoteLongs: false, + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + return (0, bson_1.deserialize)(await stateMachine.execute(this, context, options), { + promoteValues: false, + promoteLongs: false + }); + } + /** + * Decrypt a command response + */ + async decrypt(response, options = {}) { + options.signal?.throwIfAborted(); + const context = this._mongocrypt.makeDecryptionContext(response); + context.id = this._contextCounter++; + const stateMachine = new state_machine_1.StateMachine({ + ...options, + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + return await stateMachine.execute(this, context, options); + } + /** + * Ask the user for KMS credentials. + * + * This returns anything that looks like the kmsProviders original input + * option. It can be empty, and any provider specified here will override + * the original ones. + */ + async askForKMSCredentials() { + return await (0, providers_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders); + } + /** + * Return the current libmongocrypt's CSFLE shared library version + * as `{ version: bigint, versionStr: string }`, or `null` if no CSFLE + * shared library was loaded. + */ + get cryptSharedLibVersionInfo() { + return this._mongocrypt.cryptSharedLibVersionInfo; + } + static get libmongocryptVersion() { + return AutoEncrypter.getMongoCrypt().libmongocryptVersion; + } +} +exports.AutoEncrypter = AutoEncrypter; +//# sourceMappingURL=auto_encrypter.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js.map new file mode 100644 index 00000000..d2e329c6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auto_encrypter.js","sourceRoot":"","sources":["../../src/client-side-encryption/auto_encrypter.ts"],"names":[],"mappings":";;;;AACA,2BAA2B;AAE3B,kCAA2E;AAE3E,4CAA+C;AAC/C,kCAAqD;AACrD,oCAA6C;AAC7C,kDAAuE;AAEvE,oCAAsD;AACtD,2DAA8D;AAC9D,qCAA+E;AAE/E,+DAA2D;AAC3D,2CAKqB;AACrB,mDAA+C;AA4G/C,cAAc;AACD,QAAA,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;IACrD,UAAU,EAAE,CAAC;IACb,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;CACA,CAAC,CAAC;AAiBZ;;;GAGG;AACH,MAAa,aAAa;kBA4BvB,2BAAe;IAEhB,gBAAgB;IAChB,MAAM,CAAC,aAAa;QAClB,MAAM,UAAU,GAAG,IAAA,iCAA0B,GAAE,CAAC;QAChD,IAAI,cAAc,IAAI,UAAU,EAAE,CAAC;YACjC,MAAM,UAAU,CAAC,YAAY,CAAC;QAChC,CAAC;QACD,OAAO,UAAU,CAAC,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,YAAY,MAAmB,EAAE,OAA8B;QAnE/D;;;;;;;WAOG;QACH,QAAiB,GAAG,KAAK,CAAC;QA4DxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,KAAK,IAAI,CAAC;QAE/D,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,IAAI,gBAAgB,CAAC;QACxE,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,IAAI,MAAM,CAAC;QACxD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,IAAI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CAAC,CAAC,CAAC,OAAO,CAAC;YAC9D,kBAAkB,EAAE,IAAI,CAAC,mBAAmB;SAC7C,CAAC,CAAC;QAEH,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,oBAAoB;QACxB,OAAO,MAAM,IAAA,iCAAqB,EAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACpF,CAAC;IAED;;;;OAIG;IACH,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAAC;IACpD,CAAC;IAED,MAAM,KAAK,oBAAoB;QAC7B,OAAO,aAAa,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC;IAC5D,CAAC;CACF;AA7UD,sCA6UC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js new file mode 100644 index 00000000..1b7e6382 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js @@ -0,0 +1,616 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientEncryption = void 0; +exports.autoSelectSocketOptions = autoSelectSocketOptions; +const bson_1 = require("../bson"); +const deps_1 = require("../deps"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const errors_1 = require("./errors"); +const index_1 = require("./providers/index"); +const state_machine_1 = require("./state_machine"); +/** + * @public + * The public interface for explicit in-use encryption + */ +class ClientEncryption { + /** @internal */ + static getMongoCrypt() { + const encryption = (0, deps_1.getMongoDBClientEncryption)(); + if ('kModuleError' in encryption) { + throw encryption.kModuleError; + } + return encryption.MongoCrypt; + } + /** + * Create a new encryption instance + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * local: { + * key: masterKey // The master key used for encryption/decryption. A 96-byte long Buffer + * } + * } + * }); + * ``` + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * aws: { + * accessKeyId: AWS_ACCESS_KEY, + * secretAccessKey: AWS_SECRET_KEY + * } + * } + * }); + * ``` + */ + constructor(client, options) { + this._client = client; + this._proxyOptions = options.proxyOptions ?? {}; + if (this._proxyOptions.proxyHost && options.kmsConnectCallback) { + throw new errors_1.MongoCryptInvalidArgumentError('Cannot set both proxyOptions and kmsConnectCallback'); + } + this._tlsOptions = options.tlsOptions ?? {}; + this._kmsConnectCallback = options.kmsConnectCallback; + this._kmsProviders = options.kmsProviders || {}; + const { timeoutMS } = (0, utils_1.resolveTimeoutOptions)(client, options); + this._timeoutMS = timeoutMS; + this._credentialProviders = options.credentialProviders; + if (options.credentialProviders?.aws && !(0, index_1.isEmptyCredentials)('aws', this._kmsProviders)) { + throw new errors_1.MongoCryptInvalidArgumentError('Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching'); + } + if (options.keyVaultNamespace == null) { + throw new errors_1.MongoCryptInvalidArgumentError('Missing required option `keyVaultNamespace`'); + } + const mongoCryptOptions = { + ...options, + kmsProviders: (0, bson_1.serialize)(this._kmsProviders), + errorWrapper: errors_1.defaultErrorWrapper + }; + this._keyVaultNamespace = options.keyVaultNamespace; + this._keyVaultClient = options.keyVaultClient || client; + const MongoCrypt = ClientEncryption.getMongoCrypt(); + this._mongoCrypt = new MongoCrypt(mongoCryptOptions); + } + /** + * Creates a data key used for explicit encryption and inserts it into the key vault namespace + * + * @example + * ```ts + * // Using async/await to create a local key + * const dataKeyId = await clientEncryption.createDataKey('local'); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * } + * }); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key with a keyAltName + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * }, + * keyAltNames: [ 'mySpecialKey' ] + * }); + * ``` + */ + async createDataKey(provider, options = {}) { + if (options.keyAltNames && !Array.isArray(options.keyAltNames)) { + throw new errors_1.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof options.keyAltNames}.`); + } + let keyAltNames = undefined; + if (options.keyAltNames && options.keyAltNames.length > 0) { + keyAltNames = options.keyAltNames.map((keyAltName, i) => { + if (typeof keyAltName !== 'string') { + throw new errors_1.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${i} was of type ${typeof keyAltName}`); + } + return (0, bson_1.serialize)({ keyAltName }); + }); + } + let keyMaterial = undefined; + if (options.keyMaterial) { + keyMaterial = (0, bson_1.serialize)({ keyMaterial: options.keyMaterial }); + } + const dataKeyBson = (0, bson_1.serialize)({ + provider, + ...options.masterKey + }); + const context = this._mongoCrypt.makeDataKeyContext(dataKeyBson, { + keyAltNames, + keyMaterial + }); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + const timeoutContext = options?.timeoutContext ?? + timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })); + const dataKey = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const { insertedId } = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .insertOne(dataKey, { + writeConcern: { w: 'majority' }, + timeoutMS: timeoutContext?.csotEnabled() + ? timeoutContext?.getRemainingTimeMSOrThrow() + : undefined + }); + return insertedId; + } + /** + * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options. + * + * If no matches are found, then no bulk write is performed. + * + * @example + * ```ts + * // rewrapping all data data keys (using a filter that matches all documents) + * const filter = {}; + * + * const result = await clientEncryption.rewrapManyDataKey(filter); + * if (result.bulkWriteResult != null) { + * // keys were re-wrapped, results will be available in the bulkWrite object. + * } + * ``` + * + * @example + * ```ts + * // attempting to rewrap all data keys with no matches + * const filter = { _id: new Binary() } // assume _id matches no documents in the database + * const result = await clientEncryption.rewrapManyDataKey(filter); + * + * if (result.bulkWriteResult == null) { + * // no keys matched, `bulkWriteResult` does not exist on the result object + * } + * ``` + */ + async rewrapManyDataKey(filter, options) { + let keyEncryptionKeyBson = undefined; + if (options) { + const keyEncryptionKey = Object.assign({ provider: options.provider }, options.masterKey); + keyEncryptionKeyBson = (0, bson_1.serialize)(keyEncryptionKey); + } + const filterBson = (0, bson_1.serialize)(filter); + const context = this._mongoCrypt.makeRewrapManyDataKeyContext(filterBson, keyEncryptionKeyBson); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + const timeoutContext = timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })); + const { v: dataKeys } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + if (dataKeys.length === 0) { + return {}; + } + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const replacements = dataKeys.map((key) => ({ + updateOne: { + filter: { _id: key._id }, + update: { + $set: { + masterKey: key.masterKey, + keyMaterial: key.keyMaterial + }, + $currentDate: { + updateDate: true + } + } + } + })); + const result = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .bulkWrite(replacements, { + writeConcern: { w: 'majority' }, + timeoutMS: timeoutContext.csotEnabled() ? timeoutContext?.remainingTimeMS : undefined + }); + return { bulkWriteResult: result }; + } + /** + * Deletes the key with the provided id from the keyvault, if it exists. + * + * @example + * ```ts + * // delete a key by _id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const { deletedCount } = await clientEncryption.deleteKey(id); + * + * if (deletedCount != null && deletedCount > 0) { + * // successful deletion + * } + * ``` + * + */ + async deleteKey(_id) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .deleteOne({ _id }, { writeConcern: { w: 'majority' }, timeoutMS: this._timeoutMS }); + } + /** + * Finds all the keys currently stored in the keyvault. + * + * This method will not throw. + * + * @returns a FindCursor over all keys in the keyvault. + * @example + * ```ts + * // fetching all keys + * const keys = await clientEncryption.getKeys().toArray(); + * ``` + */ + getKeys() { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return this._keyVaultClient + .db(dbName) + .collection(collectionName) + .find({}, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS }); + } + /** + * Finds a key in the keyvault with the specified _id. + * + * Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // getting a key by id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const key = await clientEncryption.getKey(id); + * if (!key) { + * // key is null if there was no matching key + * } + * ``` + */ + async getKey(_id) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOne({ _id }, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS }); + } + /** + * Finds a key in the keyvault which has the specified keyAltName. + * + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the keyAltName. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // get a key by alt name + * const keyAltName = 'keyAltName'; + * const key = await clientEncryption.getKeyByAltName(keyAltName); + * if (!key) { + * // key is null if there is no matching key + * } + * ``` + */ + async getKeyByAltName(keyAltName) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOne({ keyAltNames: keyAltName }, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS }); + } + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to adding the new altKeyName). + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // adding an keyAltName to a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.addKeyAltName(id, keyAltName); + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + async addKeyAltName(_id, keyAltName) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const value = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOneAndUpdate({ _id }, { $addToSet: { keyAltNames: keyAltName } }, { writeConcern: { w: 'majority' }, returnDocument: 'before', timeoutMS: this._timeoutMS }); + return value; + } + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to removing the new altKeyName). + * + * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document. + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // removing a key alt name from a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.removeKeyAltName(id, keyAltName); + * + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + async removeKeyAltName(_id, keyAltName) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const pipeline = [ + { + $set: { + keyAltNames: { + $cond: [ + { + $eq: ['$keyAltNames', [keyAltName]] + }, + '$$REMOVE', + { + $filter: { + input: '$keyAltNames', + cond: { + $ne: ['$$this', keyAltName] + } + } + } + ] + } + } + } + ]; + const value = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOneAndUpdate({ _id }, pipeline, { + writeConcern: { w: 'majority' }, + returnDocument: 'before', + timeoutMS: this._timeoutMS + }); + return value; + } + /** + * A convenience method for creating an encrypted collection. + * This method will create data keys for any encryptedFields that do not have a `keyId` defined + * and then create a new collection with the full set of encryptedFields. + * + * @param db - A Node.js driver Db object with which to create the collection + * @param name - The name of the collection to be created + * @param options - Options for createDataKey and for createCollection + * @returns created collection and generated encryptedFields + * @throws MongoCryptCreateDataKeyError - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created. + * @throws MongoCryptCreateEncryptedCollectionError - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created. + */ + async createEncryptedCollection(db, name, options) { + const { provider, masterKey, createCollectionOptions: { encryptedFields: { ...encryptedFields }, ...createCollectionOptions } } = options; + const timeoutContext = this._timeoutMS != null + ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) + : undefined; + if (Array.isArray(encryptedFields.fields)) { + const createDataKeyPromises = encryptedFields.fields.map(async (field) => field == null || typeof field !== 'object' || field.keyId != null + ? field + : { + ...field, + keyId: await this.createDataKey(provider, { + masterKey, + // clone the timeoutContext + // in order to avoid sharing the same timeout for server selection and connection checkout across different concurrent operations + timeoutContext: timeoutContext?.csotEnabled() ? timeoutContext?.clone() : undefined + }) + }); + const createDataKeyResolutions = await Promise.allSettled(createDataKeyPromises); + encryptedFields.fields = createDataKeyResolutions.map((resolution, index) => resolution.status === 'fulfilled' ? resolution.value : encryptedFields.fields[index]); + const rejection = createDataKeyResolutions.find((result) => result.status === 'rejected'); + if (rejection != null) { + throw new errors_1.MongoCryptCreateDataKeyError(encryptedFields, { cause: rejection.reason }); + } + } + try { + const collection = await db.createCollection(name, { + ...createCollectionOptions, + encryptedFields, + timeoutMS: timeoutContext?.csotEnabled() + ? timeoutContext?.getRemainingTimeMSOrThrow() + : undefined + }); + return { collection, encryptedFields }; + } + catch (cause) { + throw new errors_1.MongoCryptCreateEncryptedCollectionError(encryptedFields, { cause }); + } + } + /** + * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must + * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error. + * + * @param value - The value that you wish to serialize. Must be of a type that can be serialized into BSON + * @param options - + * @returns a Promise that either resolves with the encrypted value, or rejects with an error. + * + * @example + * ```ts + * // Encryption with async/await api + * async function encryptMyData(value) { + * const keyId = await clientEncryption.createDataKey('local'); + * return clientEncryption.encrypt(value, { keyId, algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + * + * @example + * ```ts + * // Encryption using a keyAltName + * async function encryptMyData(value) { + * await clientEncryption.createDataKey('local', { keyAltNames: 'mySpecialKey' }); + * return clientEncryption.encrypt(value, { keyAltName: 'mySpecialKey', algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + */ + async encrypt(value, options) { + return await this._encrypt(value, false, options); + } + /** + * Encrypts a Match Expression or Aggregate Expression to query a range index. + * + * Only supported when queryType is "range" and algorithm is "Range". + * + * @param expression - a BSON document of one of the following forms: + * 1. A Match Expression of this form: + * `{$and: [{: {$gt: }}, {: {$lt: }}]}` + * 2. An Aggregate Expression of this form: + * `{$and: [{$gt: [, ]}, {$lt: [, ]}]}` + * + * `$gt` may also be `$gte`. `$lt` may also be `$lte`. + * + * @param options - + * @returns Returns a Promise that either resolves with the encrypted value or rejects with an error. + */ + async encryptExpression(expression, options) { + return await this._encrypt(expression, true, options); + } + /** + * Explicitly decrypt a provided encrypted value + * + * @param value - An encrypted value + * @returns a Promise that either resolves with the decrypted value, or rejects with an error + * + * @example + * ```ts + * // Decrypting value with async/await API + * async function decryptMyValue(value) { + * return clientEncryption.decrypt(value); + * } + * ``` + */ + async decrypt(value) { + const valueBuffer = (0, bson_1.serialize)({ v: value }); + const context = this._mongoCrypt.makeExplicitDecryptionContext(valueBuffer); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + const timeoutContext = this._timeoutMS != null + ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) + : undefined; + const { v } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + return v; + } + /** + * @internal + * Ask the user for KMS credentials. + * + * This returns anything that looks like the kmsProviders original input + * option. It can be empty, and any provider specified here will override + * the original ones. + */ + async askForKMSCredentials() { + return await (0, index_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders); + } + static get libmongocryptVersion() { + return ClientEncryption.getMongoCrypt().libmongocryptVersion; + } + /** + * @internal + * A helper that perform explicit encryption of values and expressions. + * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must + * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error. + * + * @param value - The value that you wish to encrypt. Must be of a type that can be serialized into BSON + * @param expressionMode - a boolean that indicates whether or not to encrypt the value as an expression + * @param options - options to pass to encrypt + * @returns the raw result of the call to stateMachine.execute(). When expressionMode is set to true, the return + * value will be a bson document. When false, the value will be a BSON Binary. + * + */ + async _encrypt(value, expressionMode, options) { + const { algorithm, keyId, keyAltName, contentionFactor, queryType, rangeOptions, stringOptions, textOptions } = options; + const contextOptions = { + expressionMode, + algorithm + }; + if (keyId) { + contextOptions.keyId = keyId.buffer; + } + if (keyAltName) { + if (keyId) { + throw new errors_1.MongoCryptInvalidArgumentError(`"options" cannot contain both "keyId" and "keyAltName"`); + } + if (typeof keyAltName !== 'string') { + throw new errors_1.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof keyAltName}`); + } + contextOptions.keyAltName = (0, bson_1.serialize)({ keyAltName }); + } + if (typeof contentionFactor === 'number' || typeof contentionFactor === 'bigint') { + contextOptions.contentionFactor = contentionFactor; + } + if (typeof queryType === 'string') { + contextOptions.queryType = queryType; + } + if (typeof rangeOptions === 'object') { + contextOptions.rangeOptions = (0, bson_1.serialize)(rangeOptions); + } + const resolvedStringOptions = stringOptions ?? textOptions; + if (typeof resolvedStringOptions === 'object') { + contextOptions.textOptions = (0, bson_1.serialize)(resolvedStringOptions); + } + const valueBuffer = (0, bson_1.serialize)({ v: value }); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + const context = this._mongoCrypt.makeExplicitEncryptionContext(valueBuffer, contextOptions); + const timeoutContext = this._timeoutMS != null + ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) + : undefined; + const { v } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + return v; + } +} +exports.ClientEncryption = ClientEncryption; +/** + * Get the socket options from the client. + * @param baseOptions - The mongo client options. + * @returns ClientEncryptionSocketOptions + */ +function autoSelectSocketOptions(baseOptions) { + const options = { autoSelectFamily: true }; + if ('autoSelectFamily' in baseOptions) { + options.autoSelectFamily = baseOptions.autoSelectFamily; + } + if ('autoSelectFamilyAttemptTimeout' in baseOptions) { + options.autoSelectFamilyAttemptTimeout = baseOptions.autoSelectFamilyAttemptTimeout; + } + return options; +} +//# sourceMappingURL=client_encryption.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js.map new file mode 100644 index 00000000..fc12ba31 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client_encryption.js","sourceRoot":"","sources":["../../src/client-side-encryption/client_encryption.ts"],"names":[],"mappings":";;;AAkqCA,0DAWC;AAvqCD,kCAQiB;AAMjB,kCAAqD;AAKrD,wCAAqE;AACrE,oCAA6E;AAC7E,qCAKkB;AAMlB,6CAM2B;AAC3B,mDAA+C;AAiB/C;;;GAGG;AACH,MAAa,gBAAgB;IAwB3B,gBAAgB;IAChB,MAAM,CAAC,aAAa;QAClB,MAAM,UAAU,GAAG,IAAA,iCAA0B,GAAE,CAAC;QAChD,IAAI,cAAc,IAAI,UAAU,EAAE,CAAC;YACjC,MAAM,UAAU,CAAC,YAAY,CAAC;QAChC,CAAC;QACD,OAAO,UAAU,CAAC,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,YAAY,MAAmB,EAAE,OAAgC;QAC/D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;QAChD,IAAI,IAAI,CAAC,aAAa,CAAC,SAAS,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;YAC/D,MAAM,IAAI,uCAA8B,CACtC,qDAAqD,CACtD,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;QAC5C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CAAC,aAAa;YAChC,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,aAAa,EAAE,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;YAC9D,kBAAkB,EAAE,IAAI,CAAC,mBAAmB;SAC7C,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAE5F,MAAM,cAAc,GAClB,IAAI,CAAC,UAAU,IAAI,IAAI;YACrB,CAAC,CAAC,wBAAc,CAAC,MAAM,CAAC,IAAA,6BAAqB,EAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;YAC5F,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,kBAAW,EAAC,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;QACzF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AArvBD,4CAqvBC;AAsWD;;;;GAIG;AACH,SAAgB,uBAAuB,CACrC,WAA+B;IAE/B,MAAM,OAAO,GAAkC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;IAC1E,IAAI,kBAAkB,IAAI,WAAW,EAAE,CAAC;QACtC,OAAO,CAAC,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAC1D,CAAC;IACD,IAAI,gCAAgC,IAAI,WAAW,EAAE,CAAC;QACpD,OAAO,CAAC,8BAA8B,GAAG,WAAW,CAAC,8BAA8B,CAAC;IACtF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js new file mode 100644 index 00000000..c6356dea --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js @@ -0,0 +1,138 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoCryptKMSRequestNetworkTimeoutError = exports.MongoCryptAzureKMSRequestError = exports.MongoCryptCreateEncryptedCollectionError = exports.MongoCryptCreateDataKeyError = exports.MongoCryptInvalidArgumentError = exports.defaultErrorWrapper = exports.MongoCryptError = void 0; +const error_1 = require("../error"); +/** + * @public + * An error indicating that something went wrong specifically with MongoDB Client Encryption + */ +class MongoCryptError extends error_1.MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options = {}) { + super(message, options); + } + get name() { + return 'MongoCryptError'; + } +} +exports.MongoCryptError = MongoCryptError; +const defaultErrorWrapper = (error) => new MongoCryptError(error.message, { cause: error }); +exports.defaultErrorWrapper = defaultErrorWrapper; +/** + * @public + * + * An error indicating an invalid argument was provided to an encryption API. + */ +class MongoCryptInvalidArgumentError extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoCryptInvalidArgumentError'; + } +} +exports.MongoCryptInvalidArgumentError = MongoCryptInvalidArgumentError; +/** + * @public + * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys + */ +class MongoCryptCreateDataKeyError extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields, { cause }) { + super(`Unable to complete creating data keys: ${cause.message}`, { cause }); + this.encryptedFields = encryptedFields; + } + get name() { + return 'MongoCryptCreateDataKeyError'; + } +} +exports.MongoCryptCreateDataKeyError = MongoCryptCreateDataKeyError; +/** + * @public + * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create a collection + */ +class MongoCryptCreateEncryptedCollectionError extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields, { cause }) { + super(`Unable to create collection: ${cause.message}`, { cause }); + this.encryptedFields = encryptedFields; + } + get name() { + return 'MongoCryptCreateEncryptedCollectionError'; + } +} +exports.MongoCryptCreateEncryptedCollectionError = MongoCryptCreateEncryptedCollectionError; +/** + * @public + * An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials. + */ +class MongoCryptAzureKMSRequestError extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, body) { + super(message); + this.body = body; + } + get name() { + return 'MongoCryptAzureKMSRequestError'; + } +} +exports.MongoCryptAzureKMSRequestError = MongoCryptAzureKMSRequestError; +/** @public */ +class MongoCryptKMSRequestNetworkTimeoutError extends MongoCryptError { + get name() { + return 'MongoCryptKMSRequestNetworkTimeoutError'; + } +} +exports.MongoCryptKMSRequestNetworkTimeoutError = MongoCryptKMSRequestNetworkTimeoutError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js.map new file mode 100644 index 00000000..ecc9233c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/errors.js.map @@ -0,0 +1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AK,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,IAAa,IAAI;QACf,OAAO,0CAA0C,CAAC;IACpD,CAAC;CACF;AArBD,4FAqBC;AAED;;;GAGG;AACH,MAAa,8BAA+B,SAAQ,eAAe;IAGjE;;;;;;;;;;QAUI;IACJ,YAAY,OAAe,EAAE,IAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAa,IAAI;QACf,OAAO,gCAAgC,CAAC;IAC1C,CAAC;CACF;AAtBD,wEAsBC;AAED,cAAc;AACd,MAAa,uCAAwC,SAAQ,eAAe;IAC1E,IAAa,IAAI;QACf,OAAO,yCAAyC,CAAC;IACnD,CAAC;CACF;AAJD,0FAIC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js new file mode 100644 index 00000000..d16cc02e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=kms_options.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js.map new file mode 100644 index 00000000..28286603 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/kms_options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kms_options.js","sourceRoot":"","sources":["../../src/client-side-encryption/kms_options.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js new file mode 100644 index 00000000..4270a328 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongocryptdManager = void 0; +const error_1 = require("../error"); +/** + * @internal + * An internal class that handles spawning a mongocryptd. + */ +class MongocryptdManager { + static { this.DEFAULT_MONGOCRYPTD_URI = 'mongodb://localhost:27020'; } + constructor(extraOptions = {}) { + this.spawnPath = ''; + this.spawnArgs = []; + this.uri = + typeof extraOptions.mongocryptdURI === 'string' && extraOptions.mongocryptdURI.length > 0 + ? extraOptions.mongocryptdURI + : MongocryptdManager.DEFAULT_MONGOCRYPTD_URI; + this.bypassSpawn = !!extraOptions.mongocryptdBypassSpawn; + if (Object.hasOwn(extraOptions, 'mongocryptdSpawnPath') && extraOptions.mongocryptdSpawnPath) { + this.spawnPath = extraOptions.mongocryptdSpawnPath; + } + if (Object.hasOwn(extraOptions, 'mongocryptdSpawnArgs') && + Array.isArray(extraOptions.mongocryptdSpawnArgs)) { + this.spawnArgs = this.spawnArgs.concat(extraOptions.mongocryptdSpawnArgs); + } + if (this.spawnArgs + .filter(arg => typeof arg === 'string') + .every(arg => arg.indexOf('--idleShutdownTimeoutSecs') < 0)) { + this.spawnArgs.push('--idleShutdownTimeoutSecs', '60'); + } + } + /** + * Will check to see if a mongocryptd is up. If it is not up, it will attempt + * to spawn a mongocryptd in a detached process, and then wait for it to be up. + */ + async spawn() { + const cmdName = this.spawnPath || 'mongocryptd'; + // eslint-disable-next-line @typescript-eslint/no-require-imports + const { spawn } = require('child_process'); + // Spawned with stdio: ignore and detached: true + // to ensure child can outlive parent. + this._child = spawn(cmdName, this.spawnArgs, { + stdio: 'ignore', + detached: true + }); + this._child.on('error', () => { + // From the FLE spec: + // "The stdout and stderr of the spawned process MUST not be exposed in the driver + // (e.g. redirect to /dev/null). Users can pass the argument --logpath to + // extraOptions.mongocryptdSpawnArgs if they need to inspect mongocryptd logs. + // If spawning is necessary, the driver MUST spawn mongocryptd whenever server + // selection on the MongoClient to mongocryptd fails. If the MongoClient fails to + // connect after spawning, the server selection error is propagated to the user." + // The AutoEncrypter and MongoCryptdManager should work together to spawn + // mongocryptd whenever necessary. Additionally, the `mongocryptd` intentionally + // shuts down after 60s and gets respawned when necessary. We rely on server + // selection timeouts when connecting to the `mongocryptd` to inform users that something + // has been configured incorrectly. For those reasons, we suppress stderr from + // the `mongocryptd` process and immediately unref the process. + }); + // unref child to remove handle from event loop + this._child.unref(); + } + /** + * @returns the result of `fn` or rejects with an error. + */ + async withRespawn(fn) { + try { + const result = await fn(); + return result; + } + catch (err) { + // If we are not bypassing spawning, then we should retry once on a MongoTimeoutError (server selection error) + const shouldSpawn = err instanceof error_1.MongoNetworkTimeoutError && !this.bypassSpawn; + if (!shouldSpawn) { + throw err; + } + } + await this.spawn(); + const result = await fn(); + return result; + } +} +exports.MongocryptdManager = MongocryptdManager; +//# sourceMappingURL=mongocryptd_manager.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js.map new file mode 100644 index 00000000..fa5da130 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongocryptd_manager.js","sourceRoot":"","sources":["../../src/client-side-encryption/mongocryptd_manager.ts"],"names":[],"mappings":";;;AAEA,oCAAoD;AAGpD;;;GAGG;AACH,MAAa,kBAAkB;aACtB,4BAAuB,GAAG,2BAA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,EAAE,GAAG,OAAO,CAAC,eAAe,CAAmC,CAAC;QAE7E,gDAAgD;QAChD,sCAAsC;QACtC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE;YAC3C,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAC3B,qBAAqB;YACrB,kFAAkF;YAClF,yEAAyE;YACzE,8EAA8E;YAC9E,8EAA8E;YAC9E,iFAAiF;YACjF,iFAAiF;YACjF,yEAAyE;YACzE,iFAAiF;YACjF,6EAA6E;YAC7E,yFAAyF;YACzF,+EAA+E;YAC/E,+DAA+D;QACjE,CAAC,CAAC,CAAC;QAEH,+CAA+C;QAC/C,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAI,EAAoB;QACvC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,8GAA8G;YAC9G,MAAM,WAAW,GAAG,GAAG,YAAY,gCAAwB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;YACjF,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;QACD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC;IAChB,CAAC;;AAzFH,gDA0FC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js new file mode 100644 index 00000000..4882003c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadAWSCredentials = loadAWSCredentials; +const aws_temporary_credentials_1 = require("../../cmap/auth/aws_temporary_credentials"); +/** + * @internal + */ +async function loadAWSCredentials(kmsProviders, provider) { + const credentialProvider = new aws_temporary_credentials_1.AWSSDKCredentialProvider(provider); + // We shouldn't ever receive a response from the AWS SDK that doesn't have a `SecretAccessKey` + // or `AccessKeyId`. However, TS says these fields are optional. We provide empty strings + // and let libmongocrypt error if we're unable to fetch the required keys. + const { SecretAccessKey = '', AccessKeyId = '', Token } = await credentialProvider.getCredentials(); + const aws = { + secretAccessKey: SecretAccessKey, + accessKeyId: AccessKeyId + }; + // the AWS session token is only required for temporary credentials so only attach it to the + // result if it's present in the response from the aws sdk + Token != null && (aws.sessionToken = Token); + return { ...kmsProviders, aws }; +} +//# sourceMappingURL=aws.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js.map new file mode 100644 index 00000000..3e466ea7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aws.js","sourceRoot":"","sources":["../../../src/client-side-encryption/providers/aws.ts"],"names":[],"mappings":";;AASA,gDAuBC;AAhCD,yFAGmD;AAGnD;;GAEG;AACI,KAAK,UAAU,kBAAkB,CACtC,YAA0B,EAC1B,QAAgC;IAEhC,MAAM,kBAAkB,GAAG,IAAI,oDAAwB,CAAC,QAAQ,CAAC,CAAC;IAElE,8FAA8F;IAC9F,2FAA2F;IAC3F,0EAA0E;IAC1E,MAAM,EACJ,eAAe,GAAG,EAAE,EACpB,WAAW,GAAG,EAAE,EAChB,KAAK,EACN,GAAG,MAAM,kBAAkB,CAAC,cAAc,EAAE,CAAC;IAC9C,MAAM,GAAG,GAAqC;QAC5C,eAAe,EAAE,eAAe;QAChC,WAAW,EAAE,WAAW;KACzB,CAAC;IACF,4FAA4F;IAC5F,0DAA0D;IAC1D,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC;IAE5C,OAAO,EAAE,GAAG,YAAY,EAAE,GAAG,EAAE,CAAC;AAClC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js new file mode 100644 index 00000000..9829f154 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js @@ -0,0 +1,132 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tokenCache = exports.AzureCredentialCache = exports.AZURE_BASE_URL = void 0; +exports.addAzureParams = addAzureParams; +exports.prepareRequest = prepareRequest; +exports.fetchAzureKMSToken = fetchAzureKMSToken; +exports.loadAzureCredentials = loadAzureCredentials; +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const errors_1 = require("../errors"); +const MINIMUM_TOKEN_REFRESH_IN_MILLISECONDS = 6000; +/** Base URL for getting Azure tokens. */ +exports.AZURE_BASE_URL = 'http://169.254.169.254/metadata/identity/oauth2/token?'; +/** + * @internal + */ +class AzureCredentialCache { + constructor() { + this.cachedToken = null; + } + async getToken() { + if (this.cachedToken == null || this.needsRefresh(this.cachedToken)) { + this.cachedToken = await this._getToken(); + } + return { accessToken: this.cachedToken.accessToken }; + } + needsRefresh(token) { + const timeUntilExpirationMS = token.expiresOnTimestamp - Date.now(); + return timeUntilExpirationMS <= MINIMUM_TOKEN_REFRESH_IN_MILLISECONDS; + } + /** + * exposed for testing + */ + resetCache() { + this.cachedToken = null; + } + /** + * exposed for testing + */ + _getToken() { + return fetchAzureKMSToken(); + } +} +exports.AzureCredentialCache = AzureCredentialCache; +/** @internal */ +exports.tokenCache = new AzureCredentialCache(); +/** @internal */ +async function parseResponse(response) { + const { status, body: rawBody } = response; + const body = (() => { + try { + return JSON.parse(rawBody); + } + catch { + throw new errors_1.MongoCryptAzureKMSRequestError('Malformed JSON body in GET request.'); + } + })(); + if (status !== 200) { + throw new errors_1.MongoCryptAzureKMSRequestError('Unable to complete request.', body); + } + if (!body.access_token) { + throw new errors_1.MongoCryptAzureKMSRequestError('Malformed response body - missing field `access_token`.'); + } + if (!body.expires_in) { + throw new errors_1.MongoCryptAzureKMSRequestError('Malformed response body - missing field `expires_in`.'); + } + const expiresInMS = Number(body.expires_in) * 1000; + if (Number.isNaN(expiresInMS)) { + throw new errors_1.MongoCryptAzureKMSRequestError('Malformed response body - unable to parse int from `expires_in` field.'); + } + return { + accessToken: body.access_token, + expiresOnTimestamp: Date.now() + expiresInMS + }; +} +/** + * @internal + * Get the Azure endpoint URL. + */ +function addAzureParams(url, resource, username) { + url.searchParams.append('api-version', '2018-02-01'); + url.searchParams.append('resource', resource); + if (username) { + url.searchParams.append('client_id', username); + } + return url; +} +/** + * @internal + * + * parses any options provided by prose tests to `fetchAzureKMSToken` and merges them with + * the default values for headers and the request url. + */ +function prepareRequest(options) { + const url = new URL(options.url?.toString() ?? exports.AZURE_BASE_URL); + addAzureParams(url, 'https://vault.azure.net'); + const headers = { ...options.headers, 'Content-Type': 'application/json', Metadata: true }; + return { headers, url }; +} +/** + * @internal + * + * `AzureKMSRequestOptions` allows prose tests to modify the http request sent to the idms + * servers. This is required to simulate different server conditions. No options are expected to + * be set outside of tests. + * + * exposed for CSFLE + * [prose test 18](https://github.com/mongodb/specifications/tree/master/source/client-side-encryption/tests#azure-imds-credentials) + */ +async function fetchAzureKMSToken(options = {}) { + const { headers, url } = prepareRequest(options); + try { + const response = await (0, utils_1.get)(url, { headers }); + return await parseResponse(response); + } + catch (error) { + if (error instanceof error_1.MongoNetworkTimeoutError) { + throw new errors_1.MongoCryptAzureKMSRequestError(`[Azure KMS] ${error.message}`); + } + throw error; + } +} +/** + * @internal + * + * @throws Will reject with a `MongoCryptError` if the http request fails or the http response is malformed. + */ +async function loadAzureCredentials(kmsProviders) { + const azure = await exports.tokenCache.getToken(); + return { ...kmsProviders, azure }; +} +//# sourceMappingURL=azure.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js.map new file mode 100644 index 00000000..1c555728 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.js.map @@ -0,0 +1 @@ +{"version":3,"file":"azure.js","sourceRoot":"","sources":["../../../src/client-side-encryption/providers/azure.ts"],"names":[],"mappings":";;;AA0HA,wCAOC;AAQD,wCAQC;AAYD,gDAaC;AAOD,oDAGC;AAnLD,uCAAuD;AACvD,uCAAkC;AAClC,sCAA2D;AAG3D,MAAM,qCAAqC,GAAG,IAAI,CAAC;AACnD,yCAAyC;AAC5B,QAAA,cAAc,GAAG,wDAAwD,CAAC;AAkBvF;;GAEG;AACH,MAAa,oBAAoB;IAAjC;QACE,gBAAW,GAAgC,IAAI,CAAC;IA4BlD,CAAC;IA1BC,KAAK,CAAC,QAAQ;QACZ,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YACpE,IAAI,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,CAAC;QAED,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,CAA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C;QAC7C,OAAO,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,gCAAwB,EAAE,CAAC;YAC9C,MAAM,IAAI,uCAA8B,CAAC,eAAe,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,oBAAoB,CAAC,YAA0B;IACnE,MAAM,KAAK,GAAG,MAAM,kBAAU,CAAC,QAAQ,EAAE,CAAC;IAC1C,OAAO,EAAE,GAAG,YAAY,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js new file mode 100644 index 00000000..7493adfb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadGCPCredentials = loadGCPCredentials; +const deps_1 = require("../../deps"); +/** @internal */ +async function loadGCPCredentials(kmsProviders) { + const gcpMetadata = (0, deps_1.getGcpMetadata)(); + if ('kModuleError' in gcpMetadata) { + return kmsProviders; + } + const { access_token: accessToken } = await gcpMetadata.instance({ + property: 'service-accounts/default/token' + }); + return { ...kmsProviders, gcp: { accessToken } }; +} +//# sourceMappingURL=gcp.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js.map new file mode 100644 index 00000000..a20cc7d2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gcp.js","sourceRoot":"","sources":["../../../src/client-side-encryption/providers/gcp.ts"],"names":[],"mappings":";;AAIA,gDAWC;AAfD,qCAA4C;AAG5C,gBAAgB;AACT,KAAK,UAAU,kBAAkB,CAAC,YAA0B;IACjE,MAAM,WAAW,GAAG,IAAA,qBAAc,GAAE,CAAC;IAErC,IAAI,cAAc,IAAI,WAAW,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,MAAM,WAAW,CAAC,QAAQ,CAA2B;QACzF,QAAQ,EAAE,gCAAgC;KAC3C,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,YAAY,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC;AACnD,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js new file mode 100644 index 00000000..504d009d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEmptyCredentials = isEmptyCredentials; +exports.refreshKMSCredentials = refreshKMSCredentials; +const aws_1 = require("./aws"); +const azure_1 = require("./azure"); +const gcp_1 = require("./gcp"); +/** + * Auto credential fetching should only occur when the provider is defined on the kmsProviders map + * and the settings are an empty object. + * + * This is distinct from a nullish provider key. + * + * @internal - exposed for testing purposes only + */ +function isEmptyCredentials(providerName, kmsProviders) { + const provider = kmsProviders[providerName]; + if (provider == null) { + return false; + } + return typeof provider === 'object' && Object.keys(provider).length === 0; +} +/** + * Load cloud provider credentials for the user provided KMS providers. + * Credentials will only attempt to get loaded if they do not exist + * and no existing credentials will get overwritten. + * + * @internal + */ +async function refreshKMSCredentials(kmsProviders, credentialProviders) { + let finalKMSProviders = kmsProviders; + if (isEmptyCredentials('aws', kmsProviders)) { + finalKMSProviders = await (0, aws_1.loadAWSCredentials)(finalKMSProviders, credentialProviders?.aws); + } + if (isEmptyCredentials('gcp', kmsProviders)) { + finalKMSProviders = await (0, gcp_1.loadGCPCredentials)(finalKMSProviders); + } + if (isEmptyCredentials('azure', kmsProviders)) { + finalKMSProviders = await (0, azure_1.loadAzureCredentials)(finalKMSProviders); + } + return finalKMSProviders; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js.map new file mode 100644 index 00000000..b5d46f3a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/providers/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client-side-encryption/providers/index.ts"],"names":[],"mappings":";;AA0KA,gDASC;AASD,sDAkBC;AA5MD,+BAA2C;AAC3C,mCAA+C;AAC/C,+BAA2C;AA8J3C;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,YAA6C,EAC7C,YAA0B;IAE1B,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC5C,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,qBAAqB,CACzC,YAA0B,EAC1B,mBAAyC;IAEzC,IAAI,iBAAiB,GAAG,YAAY,CAAC;IAErC,IAAI,kBAAkB,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,CAAC;QAC5C,iBAAiB,GAAG,MAAM,IAAA,wBAAkB,EAAC,iBAAiB,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,kBAAkB,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,CAAC;QAC5C,iBAAiB,GAAG,MAAM,IAAA,wBAAkB,EAAC,iBAAiB,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC;QAC9C,iBAAiB,GAAG,MAAM,IAAA,4BAAoB,EAAC,iBAAiB,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js new file mode 100644 index 00000000..a2586c98 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js @@ -0,0 +1,474 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StateMachine = void 0; +const fs = require("fs/promises"); +const net = require("net"); +const process = require("process"); +const tls = require("tls"); +const bson_1 = require("../bson"); +const abstract_cursor_1 = require("../cursor/abstract_cursor"); +const deps_1 = require("../deps"); +const error_1 = require("../error"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const client_encryption_1 = require("./client_encryption"); +const errors_1 = require("./errors"); +let socks = null; +function loadSocks() { + if (socks == null) { + const socksImport = (0, deps_1.getSocks)(); + if ('kModuleError' in socksImport) { + throw socksImport.kModuleError; + } + socks = socksImport; + } + return socks; +} +// libmongocrypt states +const MONGOCRYPT_CTX_ERROR = 0; +const MONGOCRYPT_CTX_NEED_MONGO_COLLINFO = 1; +const MONGOCRYPT_CTX_NEED_MONGO_MARKINGS = 2; +const MONGOCRYPT_CTX_NEED_MONGO_KEYS = 3; +const MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS = 7; +const MONGOCRYPT_CTX_NEED_KMS = 4; +const MONGOCRYPT_CTX_READY = 5; +const MONGOCRYPT_CTX_DONE = 6; +const HTTPS_PORT = 443; +const stateToString = new Map([ + [MONGOCRYPT_CTX_ERROR, 'MONGOCRYPT_CTX_ERROR'], + [MONGOCRYPT_CTX_NEED_MONGO_COLLINFO, 'MONGOCRYPT_CTX_NEED_MONGO_COLLINFO'], + [MONGOCRYPT_CTX_NEED_MONGO_MARKINGS, 'MONGOCRYPT_CTX_NEED_MONGO_MARKINGS'], + [MONGOCRYPT_CTX_NEED_MONGO_KEYS, 'MONGOCRYPT_CTX_NEED_MONGO_KEYS'], + [MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS, 'MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS'], + [MONGOCRYPT_CTX_NEED_KMS, 'MONGOCRYPT_CTX_NEED_KMS'], + [MONGOCRYPT_CTX_READY, 'MONGOCRYPT_CTX_READY'], + [MONGOCRYPT_CTX_DONE, 'MONGOCRYPT_CTX_DONE'] +]); +const INSECURE_TLS_OPTIONS = [ + 'tlsInsecure', + 'tlsAllowInvalidCertificates', + 'tlsAllowInvalidHostnames' +]; +/** + * Helper function for logging. Enabled by setting the environment flag MONGODB_CRYPT_DEBUG. + * @param msg - Anything you want to be logged. + */ +function debug(msg) { + if (process.env.MONGODB_CRYPT_DEBUG) { + // eslint-disable-next-line no-console + console.error(msg); + } +} +/** + * This is kind of a hack. For `rewrapManyDataKey`, we have tests that + * guarantee that when there are no matching keys, `rewrapManyDataKey` returns + * nothing. We also have tests for auto encryption that guarantee for `encrypt` + * we return an error when there are no matching keys. This error is generated in + * subsequent iterations of the state machine. + * Some apis (`encrypt`) throw if there are no filter matches and others (`rewrapManyDataKey`) + * do not. We set the result manually here, and let the state machine continue. `libmongocrypt` + * will inform us if we need to error by setting the state to `MONGOCRYPT_CTX_ERROR` but + * otherwise we'll return `{ v: [] }`. + */ +let EMPTY_V; +/** + * @internal + * An internal class that executes across a MongoCryptContext until either + * a finishing state or an error is reached. Do not instantiate directly. + */ +// TODO(DRIVERS-2671): clarify CSOT behavior for FLE APIs +class StateMachine { + constructor(options, bsonOptions = (0, bson_1.pluckBSONSerializeOptions)(options)) { + this.options = options; + this.bsonOptions = bsonOptions; + } + /** + * Executes the state machine according to the specification + */ + async execute(executor, context, options) { + const keyVaultNamespace = executor._keyVaultNamespace; + const keyVaultClient = executor._keyVaultClient; + const metaDataClient = executor._metaDataClient; + const mongocryptdClient = executor._mongocryptdClient; + const mongocryptdManager = executor._mongocryptdManager; + let result = null; + // Typescript treats getters just like properties: Once you've tested it for equality + // it cannot change. Which is exactly the opposite of what we use state and status for. + // Every call to at least `addMongoOperationResponse` and `finalize` can change the state. + // These wrappers let us write code more naturally and not add compiler exceptions + // to conditions checks inside the state machine. + const getStatus = () => context.status; + const getState = () => context.state; + while (getState() !== MONGOCRYPT_CTX_DONE && getState() !== MONGOCRYPT_CTX_ERROR) { + options.signal?.throwIfAborted(); + debug(`[context#${context.id}] ${stateToString.get(getState()) || getState()}`); + switch (getState()) { + case MONGOCRYPT_CTX_NEED_MONGO_COLLINFO: { + const filter = (0, bson_1.deserialize)(context.nextMongoOperation()); + if (!metaDataClient) { + throw new errors_1.MongoCryptError('unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined'); + } + const collInfoCursor = this.fetchCollectionInfo(metaDataClient, context.ns, filter, options); + for await (const collInfo of collInfoCursor) { + context.addMongoOperationResponse((0, bson_1.serialize)(collInfo)); + if (getState() === MONGOCRYPT_CTX_ERROR) + break; + } + if (getState() === MONGOCRYPT_CTX_ERROR) + break; + context.finishMongoOperation(); + break; + } + case MONGOCRYPT_CTX_NEED_MONGO_MARKINGS: { + const command = context.nextMongoOperation(); + if (getState() === MONGOCRYPT_CTX_ERROR) + break; + if (!mongocryptdClient) { + throw new errors_1.MongoCryptError('unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined'); + } + // When we are using the shared library, we don't have a mongocryptd manager. + const markedCommand = mongocryptdManager + ? await mongocryptdManager.withRespawn(this.markCommand.bind(this, mongocryptdClient, context.ns, command, options)) + : await this.markCommand(mongocryptdClient, context.ns, command, options); + context.addMongoOperationResponse(markedCommand); + context.finishMongoOperation(); + break; + } + case MONGOCRYPT_CTX_NEED_MONGO_KEYS: { + const filter = context.nextMongoOperation(); + const keys = await this.fetchKeys(keyVaultClient, keyVaultNamespace, filter, options); + if (keys.length === 0) { + // See docs on EMPTY_V + result = EMPTY_V ??= (0, bson_1.serialize)({ v: [] }); + } + for (const key of keys) { + context.addMongoOperationResponse((0, bson_1.serialize)(key)); + } + context.finishMongoOperation(); + break; + } + case MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS: { + const kmsProviders = await executor.askForKMSCredentials(); + context.provideKMSProviders((0, bson_1.serialize)(kmsProviders)); + break; + } + case MONGOCRYPT_CTX_NEED_KMS: { + await Promise.all(this.requests(context, options)); + context.finishKMSRequests(); + break; + } + case MONGOCRYPT_CTX_READY: { + const finalizedContext = context.finalize(); + if (getState() === MONGOCRYPT_CTX_ERROR) { + const message = getStatus().message || 'Finalization error'; + throw new errors_1.MongoCryptError(message); + } + result = finalizedContext; + break; + } + default: + throw new errors_1.MongoCryptError(`Unknown state: ${getState()}`); + } + } + if (getState() === MONGOCRYPT_CTX_ERROR || result == null) { + const message = getStatus().message; + if (!message) { + debug(`unidentifiable error in MongoCrypt - received an error status from \`libmongocrypt\` but received no error message.`); + } + throw new errors_1.MongoCryptError(message ?? + 'unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.'); + } + return result; + } + /** + * Handles the request to the KMS service. Exposed for testing purposes. Do not directly invoke. + * @param kmsContext - A C++ KMS context returned from the bindings + * @returns A promise that resolves when the KMS reply has be fully parsed + */ + async kmsRequest(request, options) { + const parsedUrl = request.endpoint.split(':'); + const port = parsedUrl[1] != null ? Number.parseInt(parsedUrl[1], 10) : HTTPS_PORT; + const socketOptions = { + host: parsedUrl[0], + servername: parsedUrl[0], + port, + ...(0, client_encryption_1.autoSelectSocketOptions)(this.options.socketOptions || {}) + }; + const message = request.message; + const buffer = new utils_1.BufferPool(); + let netSocket; + let socket; + function destroySockets() { + for (const sock of [socket, netSocket]) { + if (sock) { + sock.destroy(); + } + } + } + function onerror(cause) { + return new errors_1.MongoCryptError('KMS request failed', { cause }); + } + function onclose() { + return new errors_1.MongoCryptError('KMS request closed'); + } + const tlsOptions = this.options.tlsOptions; + if (tlsOptions) { + const kmsProvider = request.kmsProvider; + const providerTlsOptions = tlsOptions[kmsProvider]; + if (providerTlsOptions) { + const error = this.validateTlsOptions(kmsProvider, providerTlsOptions); + if (error) { + throw error; + } + try { + await this.setTlsOptions(providerTlsOptions, socketOptions); + } + catch (err) { + throw onerror(err); + } + } + } + let abortListener; + let kmsRequestTimeout; + try { + options?.signal?.throwIfAborted(); + if (this.options.kmsConnectCallback) { + const remainingTimeMS = options?.timeoutContext?.csotEnabled() + ? options.timeoutContext.getRemainingTimeMSOrThrow(`KMS request timed out after ${options.timeoutContext.timeoutMS}ms`) + : undefined; + // A non-finite budget (timeoutMS: 0) means no timeout; otherwise back the callback with one. + const timeoutMS = Number.isFinite(remainingTimeMS) ? remainingTimeMS : undefined; + const controller = new AbortController(); + // Forward the operation's own abort signal so aborting the operation also aborts the callback. + const forwardAbort = (0, utils_1.addAbortListener)(options?.signal, function () { + controller.abort(this.reason); + }); + const connectPromise = this.options.kmsConnectCallback({ + host: socketOptions.host, + port: socketOptions.port, + timeoutMS, + signal: controller.signal + }); + // If the callback resolves a socket after we already aborted, close it so it does not leak. + connectPromise.then(resolvedSocket => { + if (controller.signal.aborted) + resolvedSocket.destroy(); + }, () => null); + const timeout = timeoutMS ? timeout_1.Timeout.expires(timeoutMS) : undefined; + try { + socketOptions.socket = timeout + ? await Promise.race([connectPromise, timeout]) + : await connectPromise; + } + catch (err) { + if (timeout_1.TimeoutError.is(err)) { + const timeoutError = new error_1.MongoOperationTimeoutError('KMS request timed out'); + // Abort with the timeout error as the reason so the callback sees it on `signal.reason`. + controller.abort(timeoutError); + throw timeoutError; + } + throw onerror(err); + } + finally { + timeout?.clear(); + forwardAbort?.[utils_1.kDispose](); + } + } + else if (this.options.proxyOptions && this.options.proxyOptions.proxyHost) { + netSocket = new net.Socket(); + const { promise: willConnect, reject: rejectOnNetSocketError, resolve: resolveOnNetSocketConnect } = (0, utils_1.promiseWithResolvers)(); + netSocket + .once('error', err => rejectOnNetSocketError(onerror(err))) + .once('close', () => rejectOnNetSocketError(onclose())) + .once('connect', () => resolveOnNetSocketConnect()); + const netSocketOptions = { + ...socketOptions, + host: this.options.proxyOptions.proxyHost, + port: this.options.proxyOptions.proxyPort || 1080 + }; + netSocket.connect(netSocketOptions); + await willConnect; + try { + socks ??= loadSocks(); + socketOptions.socket = (await socks.SocksClient.createConnection({ + existing_socket: netSocket, + command: 'connect', + destination: { host: socketOptions.host, port: socketOptions.port }, + proxy: { + // host and port are ignored because we pass existing_socket + host: 'iLoveJavaScript', + port: 0, + type: 5, + userId: this.options.proxyOptions.proxyUsername, + password: this.options.proxyOptions.proxyPassword + } + })).socket; + } + catch (err) { + throw onerror(err); + } + } + socket = tls.connect(socketOptions, () => { + socket.write(message); + }); + const { promise: willResolveKmsRequest, reject: rejectOnTlsSocketError, resolve } = (0, utils_1.promiseWithResolvers)(); + abortListener = (0, utils_1.addAbortListener)(options?.signal, function () { + destroySockets(); + rejectOnTlsSocketError(this.reason); + }); + socket + .once('error', err => rejectOnTlsSocketError(onerror(err))) + .once('close', () => rejectOnTlsSocketError(onclose())) + .on('data', data => { + buffer.append(data); + while (request.bytesNeeded > 0 && buffer.length) { + const bytesNeeded = Math.min(request.bytesNeeded, buffer.length); + request.addResponse(buffer.read(bytesNeeded)); + } + if (request.bytesNeeded <= 0) { + resolve(); + } + }); + const remainingTimeMS = options?.timeoutContext?.csotEnabled() + ? options.timeoutContext.getRemainingTimeMSOrThrow(`KMS request timed out after ${options.timeoutContext.timeoutMS}ms`) + : undefined; + const timeoutMS = Number.isFinite(remainingTimeMS) ? remainingTimeMS : undefined; + kmsRequestTimeout = timeoutMS ? timeout_1.Timeout.expires(timeoutMS) : undefined; + await (kmsRequestTimeout + ? Promise.race([willResolveKmsRequest, kmsRequestTimeout]) + : willResolveKmsRequest); + } + catch (error) { + if (timeout_1.TimeoutError.is(error)) + throw new error_1.MongoOperationTimeoutError('KMS request timed out'); + throw error; + } + finally { + // There's no need for any more activity on this socket at this point. + destroySockets(); + abortListener?.[utils_1.kDispose](); + kmsRequestTimeout?.clear(); + } + } + *requests(context, options) { + for (let request = context.nextKMSRequest(); request != null; request = context.nextKMSRequest()) { + yield this.kmsRequest(request, options); + } + } + /** + * Validates the provided TLS options are secure. + * + * @param kmsProvider - The KMS provider name. + * @param tlsOptions - The client TLS options for the provider. + * + * @returns An error if any option is invalid. + */ + validateTlsOptions(kmsProvider, tlsOptions) { + const tlsOptionNames = Object.keys(tlsOptions); + for (const option of INSECURE_TLS_OPTIONS) { + if (tlsOptionNames.includes(option)) { + return new errors_1.MongoCryptError(`Insecure TLS options prohibited for ${kmsProvider}: ${option}`); + } + } + } + /** + * Sets only the valid secure TLS options. + * + * @param tlsOptions - The client TLS options for the provider. + * @param options - The existing connection options. + */ + async setTlsOptions(tlsOptions, options) { + // If a secureContext is provided, ensure it is set. + if (tlsOptions.secureContext) { + options.secureContext = tlsOptions.secureContext; + } + if (tlsOptions.tlsCertificateKeyFile) { + const cert = await fs.readFile(tlsOptions.tlsCertificateKeyFile); + options.cert = options.key = cert; + } + if (tlsOptions.tlsCAFile) { + options.ca = await fs.readFile(tlsOptions.tlsCAFile); + } + if (tlsOptions.tlsCertificateKeyFilePassword) { + options.passphrase = tlsOptions.tlsCertificateKeyFilePassword; + } + } + /** + * Fetches collection info for a provided namespace, when libmongocrypt + * enters the `MONGOCRYPT_CTX_NEED_MONGO_COLLINFO` state. The result is + * used to inform libmongocrypt of the schema associated with this + * namespace. Exposed for testing purposes. Do not directly invoke. + * + * @param client - A MongoClient connected to the topology + * @param ns - The namespace to list collections from + * @param filter - A filter for the listCollections command + * @param callback - Invoked with the info of the requested collection, or with an error + */ + fetchCollectionInfo(client, ns, filter, options) { + const { db } = utils_1.MongoDBCollectionNamespace.fromString(ns); + const cursor = client.db(db).listCollections(filter, { + promoteLongs: false, + promoteValues: false, + timeoutContext: options?.timeoutContext && new abstract_cursor_1.CursorTimeoutContext(options?.timeoutContext, Symbol()), + signal: options?.signal, + nameOnly: false + }); + return cursor; + } + /** + * Calls to the mongocryptd to provide markings for a command. + * Exposed for testing purposes. Do not directly invoke. + * @param client - A MongoClient connected to a mongocryptd + * @param ns - The namespace (database.collection) the command is being executed on + * @param command - The command to execute. + * @param callback - Invoked with the serialized and marked bson command, or with an error + */ + async markCommand(client, ns, command, options) { + const { db } = utils_1.MongoDBCollectionNamespace.fromString(ns); + const bsonOptions = { promoteLongs: false, promoteValues: false }; + const rawCommand = (0, bson_1.deserialize)(command, bsonOptions); + const commandOptions = { + timeoutMS: undefined, + signal: undefined + }; + if (options?.timeoutContext?.csotEnabled()) { + commandOptions.timeoutMS = options.timeoutContext.remainingTimeMS; + } + if (options?.signal) { + commandOptions.signal = options.signal; + } + const response = await client.db(db).command(rawCommand, { + ...bsonOptions, + ...commandOptions + }); + return (0, bson_1.serialize)(response, this.bsonOptions); + } + /** + * Requests keys from the keyVault collection on the topology. + * Exposed for testing purposes. Do not directly invoke. + * @param client - A MongoClient connected to the topology + * @param keyVaultNamespace - The namespace (database.collection) of the keyVault Collection + * @param filter - The filter for the find query against the keyVault Collection + * @param callback - Invoked with the found keys, or with an error + */ + fetchKeys(client, keyVaultNamespace, filter, options) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(keyVaultNamespace); + const commandOptions = { + timeoutContext: undefined, + signal: undefined + }; + if (options?.timeoutContext != null) { + commandOptions.timeoutContext = new abstract_cursor_1.CursorTimeoutContext(options.timeoutContext, Symbol()); + } + if (options?.signal != null) { + commandOptions.signal = options.signal; + } + return client + .db(dbName) + .collection(collectionName, { readConcern: { level: 'majority' } }) + .find((0, bson_1.deserialize)(filter), commandOptions) + .toArray(); + } +} +exports.StateMachine = StateMachine; +//# sourceMappingURL=state_machine.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js.map new file mode 100644 index 00000000..03ddcce8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/client-side-encryption/state_machine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"state_machine.js","sourceRoot":"","sources":["../../src/client-side-encryption/state_machine.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAElC,2BAA2B;AAC3B,mCAAmC;AACnC,2BAA2B;AAE3B,kCAMiB;AAEjB,+DAAiE;AACjE,kCAAkD;AAClD,oCAAsD;AAItD,wCAAwE;AACxE,oCAMkB;AAClB,2DAA4E;AAC5E,qCAA2C;AAU3C,IAAI,KAAK,GAAoB,IAAI,CAAC;AAClC,SAAS,SAAS;IAChB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,MAAM,WAAW,GAAG,IAAA,eAAQ,GAAE,CAAC;QAC/B,IAAI,cAAc,IAAI,WAAW,EAAE,CAAC;YAClC,MAAM,WAAW,CAAC,YAAY,CAAC;QACjC,CAAC;QACD,KAAK,GAAG,WAAW,CAAC;IACtB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,uBAAuB;AACvB,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,kC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node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/auth_provider.js new file mode 100644 index 00000000..99cbf72a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/auth_provider.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthProvider = exports.AuthContext = void 0; +const error_1 = require("../../error"); +/** + * Context used during authentication + * @internal + */ +class AuthContext { + constructor(connection, credentials, options) { + /** If the context is for reauthentication. */ + this.reauthenticating = false; + this.connection = connection; + this.credentials = credentials; + this.options = options; + } +} +exports.AuthContext = AuthContext; +/** + * Provider used during authentication. + * @internal + */ +class AuthProvider { + /** + * Prepare the handshake document before the initial handshake. + * + * @param handshakeDoc - The document used for the initial handshake on a connection + * @param authContext - Context for authentication flow + */ + async prepare(handshakeDoc, _authContext) { + return handshakeDoc; + } + /** + * Reauthenticate. + * @param context - The shared auth context. + */ + async reauth(context) { + if (context.reauthenticating) { + throw new error_1.MongoRuntimeError('Reauthentication already in progress.'); + } + try { + context.reauthenticating = true; + await this.auth(context); + } + finally { + context.reauthenticating = false; + } + } +} +exports.AuthProvider = AuthProvider; +//# sourceMappingURL=auth_provider.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map new file mode 100644 index 00000000..0542aeda --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth_provider.js","sourceRoot":"","sources":["../../../src/cmap/auth/auth_provider.ts"],"names":[],"mappings":";;;AACA,uCAAgD;AAKhD;;;GAGG;AACH,MAAa,WAAW;IAetB,YACE,UAAsB,EACtB,WAAyC,EACzC,OAA0B;QAb5B,8CAA8C;QAC9C,qBAAgB,GAAG,KAAK,CAAC;QAcvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAxBD,kCAwBC;AAED;;;GAGG;AACH,MAAsB,YAAY;IAChC;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CACX,YAA+B,EAC/B,YAAyB;QAEzB,OAAO,YAAY,CAAC;IACtB,CAAC;IASD;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,OAAoB;QAC/B,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC7B,MAAM,IAAI,yBAAiB,CAAC,uCAAuC,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,CAAC;YACH,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAChC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AApCD,oCAoCC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js new file mode 100644 index 00000000..3a03e97e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js @@ -0,0 +1,161 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.aws4Sign = aws4Sign; +const bson_1 = require("../../bson"); +/** + * Calculates the SHA-256 hash of a string. + * + * @param str - String to hash. + * @returns Hexadecimal representation of the hash. + */ +const getHexSha256 = async (str) => { + const data = stringToBuffer(str); + const hashBuffer = await crypto.subtle.digest('SHA-256', data); + const hashHex = bson_1.ByteUtils.toHex(new Uint8Array(hashBuffer)); + return hashHex; +}; +/** + * Calculates the HMAC-SHA256 of a string using the provided key. + * @param key - Key to use for HMAC calculation. Can be a string or Uint8Array. + * @param str - String to calculate HMAC for. + * @returns Uint8Array containing the HMAC-SHA256 digest. + */ +const getHmacSha256 = async (key, str) => { + let keyData; + if (typeof key === 'string') { + keyData = stringToBuffer(key); + } + else { + keyData = key; + } + const importedKey = await crypto.subtle.importKey('raw', keyData, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']); + const strData = stringToBuffer(str); + const signature = await crypto.subtle.sign('HMAC', importedKey, strData); + const digest = new Uint8Array(signature); + return digest; +}; +/** + * Converts header values according to AWS requirements, + * From https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html#create-canonical-request + * For values, you must: + - trim any leading or trailing spaces. + - convert sequential spaces to a single space. + * @param value - Header value to convert. + * @returns - Converted header value. + */ +const convertHeaderValue = (value) => { + return value.toString().trim().replace(/\s+/g, ' '); +}; +/** + * Returns a Uint8Array representation of a string, encoded in UTF-8. + * @param str - String to convert. + * @returns Uint8Array containing the UTF-8 encoded string. + */ +function stringToBuffer(str) { + const data = new Uint8Array(bson_1.ByteUtils.utf8ByteLength(str)); + bson_1.ByteUtils.encodeUTF8Into(data, str, 0); + return data; +} +/** + * This method implements AWS Signature 4 logic for a very specific request format. + * The signing logic is described here: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html + */ +async function aws4Sign(options, credentials) { + /** + * From the spec: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html + * + * Summary of signing steps + * 1. Create a canonical request + * Arrange the contents of your request (host, action, headers, etc.) into a standard canonical format. The canonical request is one of the inputs used to create the string to sign. + * 2. Create a hash of the canonical request + * Hash the canonical request using the same algorithm that you used to create the hash of the payload. The hash of the canonical request is a string of lowercase hexadecimal characters. + * 3. Create a string to sign + * Create a string to sign with the canonical request and extra information such as the algorithm, request date, credential scope, and the hash of the canonical request. + * 4. Derive a signing key + * Use the secret access key to derive the key used to sign the request. + * 5. Calculate the signature + * Perform a keyed hash operation on the string to sign using the derived signing key as the hash key. + * 6. Add the signature to the request + * Add the calculated signature to an HTTP header or to the query string of the request. + */ + // 1: Create a canonical request + // Date – The date and time used to sign the request. + const date = options.date; + // RequestDateTime – The date and time used in the credential scope. This value is the current UTC time in ISO 8601 format (for example, 20130524T000000Z). + const requestDateTime = date.toISOString().replace(/[:-]|\.\d{3}/g, ''); + // RequestDate – The date used in the credential scope. This value is the current UTC date in YYYYMMDD format (for example, 20130524). + const requestDate = requestDateTime.substring(0, 8); + // Method – The HTTP request method. For us, this is always 'POST'. + const method = options.method; + // CanonicalUri – The URI-encoded version of the absolute path component URI, starting with the / that follows the domain name and up to the end of the string + // For our requests, this is always '/' + const canonicalUri = options.path; + // CanonicalQueryString – The URI-encoded query string parameters. For our requests, there are no query string parameters, so this is always an empty string. + const canonicalQuerystring = ''; + // CanonicalHeaders – A list of request headers with their values. Individual header name and value pairs are separated by the newline character ("\n"). + // All of our known/expected headers are included here, there are no extra headers. + const headers = new Headers({ + 'content-length': convertHeaderValue(options.headers['Content-Length']), + 'content-type': convertHeaderValue(options.headers['Content-Type']), + host: convertHeaderValue(options.host), + 'x-amz-date': convertHeaderValue(requestDateTime), + 'x-mongodb-gs2-cb-flag': convertHeaderValue(options.headers['X-MongoDB-GS2-CB-Flag']), + 'x-mongodb-server-nonce': convertHeaderValue(options.headers['X-MongoDB-Server-Nonce']) + }); + // If session token is provided, include it in the headers + if ('sessionToken' in credentials && credentials.sessionToken) { + headers.append('x-amz-security-token', convertHeaderValue(credentials.sessionToken)); + } + // Canonical headers are lowercased and sorted. + const canonicalHeaders = Array.from(headers.entries()) + .map(([key, value]) => `${key.toLowerCase()}:${value}`) + .sort() + .join('\n'); + const canonicalHeaderNames = Array.from(headers.keys()).map(header => header.toLowerCase()); + // SignedHeaders – An alphabetically sorted, semicolon-separated list of lowercase request header names. + const signedHeaders = canonicalHeaderNames.sort().join(';'); + // HashedPayload – A string created using the payload in the body of the HTTP request as input to a hash function. This string uses lowercase hexadecimal characters. + const hashedPayload = await getHexSha256(options.body); + // CanonicalRequest – A string that includes the above elements, separated by newline characters. + const canonicalRequest = [ + method, + canonicalUri, + canonicalQuerystring, + canonicalHeaders + '\n', + signedHeaders, + hashedPayload + ].join('\n'); + // 2. Create a hash of the canonical request + // HashedCanonicalRequest – A string created by using the canonical request as input to a hash function. + const hashedCanonicalRequest = await getHexSha256(canonicalRequest); + // 3. Create a string to sign + // Algorithm – The algorithm used to create the hash of the canonical request. For SigV4, use AWS4-HMAC-SHA256. + const algorithm = 'AWS4-HMAC-SHA256'; + // CredentialScope – The credential scope, which restricts the resulting signature to the specified Region and service. + // Has the following format: YYYYMMDD/region/service/aws4_request. + const credentialScope = `${requestDate}/${options.region}/${options.service}/aws4_request`; + // StringToSign – A string that includes the above elements, separated by newline characters. + const stringToSign = [algorithm, requestDateTime, credentialScope, hashedCanonicalRequest].join('\n'); + // 4. Derive a signing key + // To derive a signing key for SigV4, perform a succession of keyed hash operations (HMAC) on the request date, Region, and service, with your AWS secret access key as the key for the initial hashing operation. + const dateKey = await getHmacSha256('AWS4' + credentials.secretAccessKey, requestDate); + const dateRegionKey = await getHmacSha256(dateKey, options.region); + const dateRegionServiceKey = await getHmacSha256(dateRegionKey, options.service); + const signingKey = await getHmacSha256(dateRegionServiceKey, 'aws4_request'); + // 5. Calculate the signature + const signatureBuffer = await getHmacSha256(signingKey, stringToSign); + const signature = bson_1.ByteUtils.toHex(signatureBuffer); + // 6. Add the signature to the request + // Calculate the Authorization header + const authorizationHeader = [ + 'AWS4-HMAC-SHA256 Credential=' + credentials.accessKeyId + '/' + credentialScope, + 'SignedHeaders=' + signedHeaders, + 'Signature=' + signature + ].join(', '); + // Return the calculated headers + return { + Authorization: authorizationHeader, + 'X-Amz-Date': requestDateTime + }; +} +//# sourceMappingURL=aws4.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js.map new file mode 100644 index 00000000..3ae9a1cb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws4.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aws4.js","sourceRoot":"","sources":["../../../src/cmap/auth/aws4.ts"],"names":[],"mappings":";;AA4FA,4BAkHC;AA9MD,qCAAuC;AAwBvC;;;;;GAKG;AACH,MAAM,YAAY,GAAG,KAAK,EAAE,GAAW,EAAmB,EAAE;IAC1D,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,gBAAS,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5D,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,aAAa,GAAG,KAAK,EAAE,GAAwB,EAAE,GAAW,EAAuB,EAAE;IACzF,IAAI,OAAmB,CAAC;IACxB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,GAAG,CAAC;IAChB,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,CAC/C,KAAK,EACL,OAAO,EACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAC3C,KAAK,EACL,CAAC,MAAM,CAAC,CACT,CAAC;IACF,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM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M,mBAAmB,GAAG;QAC1B,8BAA8B,GAAG,WAAW,CAAC,WAAW,GAAG,GAAG,GAAG,eAAe;QAChF,gBAAgB,GAAG,aAAa;QAChC,YAAY,GAAG,SAAS;KACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,gCAAgC;IAChC,OAAO;QACL,aAAa,EAAE,mBAAmB;QAClC,YAAY,EAAE,eAAe;KAC9B,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js new file mode 100644 index 00000000..6277461b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AWSSDKCredentialProvider = void 0; +const process = require("process"); +const deps_1 = require("../../deps"); +const error_1 = require("../../error"); +/** @internal */ +class AWSSDKCredentialProvider { + /** + * Create the SDK credentials provider. + * @param credentialsProvider - The credentials provider. + */ + constructor(credentialsProvider) { + if (credentialsProvider) { + this._provider = credentialsProvider; + } + } + static get awsSDK() { + AWSSDKCredentialProvider._awsSDK ??= (0, deps_1.getAwsCredentialProvider)(); + return AWSSDKCredentialProvider._awsSDK; + } + /** + * The AWS SDK caches credentials automatically and handles refresh when the credentials have expired. + * To ensure this occurs, we need to cache the `provider` returned by the AWS sdk and re-use it when fetching credentials. + */ + get provider() { + if ('kModuleError' in AWSSDKCredentialProvider.awsSDK) { + throw AWSSDKCredentialProvider.awsSDK.kModuleError; + } + if (this._provider) { + return this._provider; + } + let { AWS_STS_REGIONAL_ENDPOINTS = '', AWS_REGION = '' } = process.env; + AWS_STS_REGIONAL_ENDPOINTS = AWS_STS_REGIONAL_ENDPOINTS.toLowerCase(); + AWS_REGION = AWS_REGION.toLowerCase(); + /** The option setting should work only for users who have explicit settings in their environment, the driver should not encode "defaults" */ + const awsRegionSettingsExist = AWS_REGION.length !== 0 && AWS_STS_REGIONAL_ENDPOINTS.length !== 0; + /** + * The following regions use the global AWS STS endpoint, sts.amazonaws.com, by default + * https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html + */ + const LEGACY_REGIONS = new Set([ + 'ap-northeast-1', + 'ap-south-1', + 'ap-southeast-1', + 'ap-southeast-2', + 'aws-global', + 'ca-central-1', + 'eu-central-1', + 'eu-north-1', + 'eu-west-1', + 'eu-west-2', + 'eu-west-3', + 'sa-east-1', + 'us-east-1', + 'us-east-2', + 'us-west-1', + 'us-west-2' + ]); + /** + * If AWS_STS_REGIONAL_ENDPOINTS is set to regional, users are opting into the new behavior of respecting the region settings + * + * If AWS_STS_REGIONAL_ENDPOINTS is set to legacy, then "old" regions need to keep using the global setting. + * Technically the SDK gets this wrong, it reaches out to 'sts.us-east-1.amazonaws.com' when it should be 'sts.amazonaws.com'. + * That is not our bug to fix here. We leave that up to the SDK. + */ + const useRegionalSts = AWS_STS_REGIONAL_ENDPOINTS === 'regional' || + (AWS_STS_REGIONAL_ENDPOINTS === 'legacy' && !LEGACY_REGIONS.has(AWS_REGION)); + this._provider = + awsRegionSettingsExist && useRegionalSts + ? AWSSDKCredentialProvider.awsSDK.fromNodeProviderChain({ + clientConfig: { region: AWS_REGION } + }) + : AWSSDKCredentialProvider.awsSDK.fromNodeProviderChain(); + return this._provider; + } + async getCredentials() { + /* + * Creates a credential provider that will attempt to find credentials from the + * following sources (listed in order of precedence): + * + * - Environment variables exposed via process.env + * - SSO credentials from token cache + * - Web identity token credentials + * - Shared credentials and config ini files + * - The EC2/ECS Instance Metadata Service + */ + try { + const creds = await this.provider(); + return { + AccessKeyId: creds.accessKeyId, + SecretAccessKey: creds.secretAccessKey, + Token: creds.sessionToken, + Expiration: creds.expiration + }; + } + catch (error) { + throw new error_1.MongoAWSError(error.message, { cause: error }); + } + } +} +exports.AWSSDKCredentialProvider = AWSSDKCredentialProvider; +//# sourceMappingURL=aws_temporary_credentials.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js.map new file mode 100644 index 00000000..4f5191dc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aws_temporary_credentials.js","sourceRoot":"","sources":["../../../src/cmap/auth/aws_temporary_credentials.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAEnC,qCAA2E;AAC3E,uCAA4C;AAoB5C,gBAAgB;AAChB,MAAa,wBAAwB;IAInC;;;OAGG;IACH,YAAY,mBAA2C;QACrD,IAAI,mBAAmB,EAAE,CAAC;YACxB,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC;QACvC,CAAC;IACH,CAAC;IAED,MAAM,KAAK,MAAM;QACf,wBAAwB,CAAC,OAAO,KAAK,IAAA,+BAAwB,GAAE,CAAC;QAChE,OAAO,wBAAwB,CAAC,OAAO,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,IAAY,QAAQ;QAClB,IAAI,cAAc,IAAI,wBAAwB,CAAC,MAAM,EAAE,CAAC;YACtD,MAAM,wBAAwB,CAAC,MAAM,CAAC,YAAY,CAAC;QACrD,CAAC;QACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,0BAA0B,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;QACvE,0BAA0B,GAAG,0BAA0B,CAAC,WAAW,EAAE,CAAC;QACtE,UAAU,GAAG,UAAU,CAAC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AAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CACF;AAxGD,4DAwGC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js new file mode 100644 index 00000000..5144584c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js @@ -0,0 +1,153 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GSSAPI = exports.GSSAPICanonicalizationValue = void 0; +exports.performGSSAPICanonicalizeHostName = performGSSAPICanonicalizeHostName; +exports.resolveCname = resolveCname; +const dns = require("dns"); +const deps_1 = require("../../deps"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +/** @public */ +exports.GSSAPICanonicalizationValue = Object.freeze({ + on: true, + off: false, + none: 'none', + forward: 'forward', + forwardAndReverse: 'forwardAndReverse' +}); +async function externalCommand(connection, command) { + const response = await connection.command((0, utils_1.ns)('$external.$cmd'), command); + return response; +} +let krb; +class GSSAPI extends auth_provider_1.AuthProvider { + async auth(authContext) { + const { connection, credentials } = authContext; + if (credentials == null) { + throw new error_1.MongoMissingCredentialsError('Credentials required for GSSAPI authentication'); + } + const { username } = credentials; + const client = await makeKerberosClient(authContext); + const payload = await client.step(''); + const saslStartResponse = await externalCommand(connection, saslStart(payload)); + const negotiatedPayload = await negotiate(client, 10, saslStartResponse.payload); + const saslContinueResponse = await externalCommand(connection, saslContinue(negotiatedPayload, saslStartResponse.conversationId)); + const finalizePayload = await finalize(client, username, saslContinueResponse.payload); + await externalCommand(connection, { + saslContinue: 1, + conversationId: saslContinueResponse.conversationId, + payload: finalizePayload + }); + } +} +exports.GSSAPI = GSSAPI; +async function makeKerberosClient({ options: { hostAddress, runtime }, credentials }) { + if (!hostAddress || typeof hostAddress.host !== 'string' || !credentials) { + throw new error_1.MongoInvalidArgumentError('Connection must have host and port and credentials defined.'); + } + const { os } = await runtime; + loadKrb(); + if ('kModuleError' in krb) { + throw krb['kModuleError']; + } + const { initializeClient } = krb; + const { username, password } = credentials; + const mechanismProperties = credentials.mechanismProperties; + const serviceName = mechanismProperties.SERVICE_NAME ?? 'mongodb'; + const host = await performGSSAPICanonicalizeHostName(hostAddress.host, mechanismProperties); + const initOptions = {}; + if (password != null) { + // TODO(NODE-5139): These do not match the typescript options in initializeClient + Object.assign(initOptions, { user: username, password: password }); + } + const spnHost = mechanismProperties.SERVICE_HOST ?? host; + let spn = `${serviceName}${os.platform() === 'win32' ? '/' : '@'}${spnHost}`; + if ('SERVICE_REALM' in mechanismProperties) { + spn = `${spn}@${mechanismProperties.SERVICE_REALM}`; + } + return await initializeClient(spn, initOptions); +} +function saslStart(payload) { + return { + saslStart: 1, + mechanism: 'GSSAPI', + payload, + autoAuthorize: 1 + }; +} +function saslContinue(payload, conversationId) { + return { + saslContinue: 1, + conversationId, + payload + }; +} +async function negotiate(client, retries, payload) { + try { + const response = await client.step(payload); + return response || ''; + } + catch (error) { + if (retries === 0) { + // Retries exhausted, raise error + throw error; + } + // Adjust number of retries and call step again + return await negotiate(client, retries - 1, payload); + } +} +async function finalize(client, user, payload) { + // GSS Client Unwrap + const response = await client.unwrap(payload); + return await client.wrap(response || '', { user }); +} +async function performGSSAPICanonicalizeHostName(host, mechanismProperties) { + const mode = mechanismProperties.CANONICALIZE_HOST_NAME; + if (!mode || mode === exports.GSSAPICanonicalizationValue.none) { + return host; + } + // If forward and reverse or true + if (mode === exports.GSSAPICanonicalizationValue.on || + mode === exports.GSSAPICanonicalizationValue.forwardAndReverse) { + // Perform the lookup of the ip address. + const { address } = await dns.promises.lookup(host); + try { + // Perform a reverse ptr lookup on the ip address. + const results = await dns.promises.resolve(address, 'PTR'); + // If the ptr did not error but had no results, return the host. + return results.length > 0 ? results[0] : host; + } + catch { + // This can error as ptr records may not exist for all ips. In this case + // fallback to a cname lookup as dns.lookup() does not return the + // cname. + return await resolveCname(host); + } + } + else { + // The case for forward is just to resolve the cname as dns.lookup() + // will not return it. + return await resolveCname(host); + } +} +async function resolveCname(host) { + // Attempt to resolve the host name + try { + const results = await dns.promises.resolve(host, 'CNAME'); + // Get the first resolved host id + return results.length > 0 ? results[0] : host; + } + catch { + return host; + } +} +/** + * Load the Kerberos library. + */ +function loadKrb() { + if (!krb) { + krb = (0, deps_1.getKerberos)(); + } +} +//# sourceMappingURL=gssapi.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js.map new file mode 100644 index 00000000..d36502b6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/gssapi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gssapi.js","sourceRoot":"","sources":["../../../src/cmap/auth/gssapi.ts"],"names":[],"mappings":";;;AAuJA,8EAiCC;AAED,oCASC;AAnMD,2BAA2B;AAE3B,qCAA6E;AAC7E,uCAAsF;AACtF,uCAAiC;AAEjC,mDAAiE;AAEjE,cAAc;AACD,QAAA,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC,CAAC;AAaZ,KAAK,UAAU,eAAe,CAC5B,UAAsB,EACtB,OAAuE;IAEvE,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,IAAA,UAAE,EAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAC;IACzE,OAAO,QAAuD,CAAC;AACjE,CAAC;AAED,IAAI,GAAa,CA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CAAC;QACD,wCAAwC;QACxC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEpD,IAAI,CAAC;YACH,kDAAkD;YAClD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC3D,gEAAgE;YAChE,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChD,CAAC;QAAC,MAAM,CAAC;YACP,wEAAwE;YACxE,iEAAiE;YACjE,SAAS;YACT,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;SAAM,CAAC;QACN,oEAAoE;QACpE,sBAAsB;QACtB,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,YAAY,CAAC,IAAY;IAC7C,mCAAmC;IACnC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1D,iCAAiC;QACjC,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,OAAO;IACd,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,GAAG,GAAG,IAAA,kBAAW,GAAE,CAAC;IACtB,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js new file mode 100644 index 00000000..6aa95448 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js @@ -0,0 +1,168 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoCredentials = exports.DEFAULT_ALLOWED_HOSTS = void 0; +const error_1 = require("../../error"); +const gssapi_1 = require("./gssapi"); +const providers_1 = require("./providers"); +/** + * @see https://github.com/mongodb/specifications/blob/master/source/auth/auth.md + */ +function getDefaultAuthMechanism(hello) { + if (hello) { + // If hello contains saslSupportedMechs, use scram-sha-256 + // if it is available, else scram-sha-1 + if (Array.isArray(hello.saslSupportedMechs)) { + return hello.saslSupportedMechs.includes(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) + ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA256 + : providers_1.AuthMechanism.MONGODB_SCRAM_SHA1; + } + } + return providers_1.AuthMechanism.MONGODB_SCRAM_SHA256; +} +const ALLOWED_ENVIRONMENT_NAMES = [ + 'test', + 'azure', + 'gcp', + 'k8s' +]; +const ALLOWED_HOSTS_ERROR = 'Auth mechanism property ALLOWED_HOSTS must be an array of strings.'; +/** @internal */ +exports.DEFAULT_ALLOWED_HOSTS = [ + '*.mongodb.net', + '*.mongodb-qa.net', + '*.mongodb-dev.net', + '*.mongodbgov.net', + 'localhost', + '127.0.0.1', + '::1', + '*.mongo.com' +]; +/** Error for when the token audience is missing in the environment. */ +const TOKEN_RESOURCE_MISSING_ERROR = 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.'; +/** + * A representation of the credentials used by MongoDB + * @public + */ +class MongoCredentials { + constructor(options) { + this.username = options.username ?? ''; + this.password = options.password; + this.source = options.source; + if (!this.source && options.db) { + this.source = options.db; + } + this.mechanism = options.mechanism || providers_1.AuthMechanism.MONGODB_DEFAULT; + this.mechanismProperties = options.mechanismProperties || {}; + if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC && !this.mechanismProperties.ALLOWED_HOSTS) { + this.mechanismProperties = { + ...this.mechanismProperties, + ALLOWED_HOSTS: exports.DEFAULT_ALLOWED_HOSTS + }; + } + Object.freeze(this.mechanismProperties); + Object.freeze(this); + } + /** Determines if two MongoCredentials objects are equivalent */ + equals(other) { + return (this.mechanism === other.mechanism && + this.username === other.username && + this.password === other.password && + this.source === other.source); + } + /** + * If the authentication mechanism is set to "default", resolves the authMechanism + * based on the server version and server supported sasl mechanisms. + * + * @param hello - A hello response from the server + */ + resolveAuthMechanism(hello) { + // If the mechanism is not "default", then it does not need to be resolved + if (this.mechanism.match(/DEFAULT/i)) { + return new MongoCredentials({ + username: this.username, + password: this.password, + source: this.source, + mechanism: getDefaultAuthMechanism(hello), + mechanismProperties: this.mechanismProperties + }); + } + return this; + } + validate() { + if ((this.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI || + this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN || + this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 || + this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) && + !this.username) { + throw new error_1.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`); + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC) { + if (this.username && + this.mechanismProperties.ENVIRONMENT && + this.mechanismProperties.ENVIRONMENT !== 'azure') { + throw new error_1.MongoInvalidArgumentError(`username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.`); + } + if (this.username && this.password) { + throw new error_1.MongoInvalidArgumentError(`No password is allowed in ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' for '${this.mechanism}'.`); + } + if ((this.mechanismProperties.ENVIRONMENT === 'azure' || + this.mechanismProperties.ENVIRONMENT === 'gcp') && + !this.mechanismProperties.TOKEN_RESOURCE) { + throw new error_1.MongoInvalidArgumentError(TOKEN_RESOURCE_MISSING_ERROR); + } + if (this.mechanismProperties.ENVIRONMENT && + !ALLOWED_ENVIRONMENT_NAMES.includes(this.mechanismProperties.ENVIRONMENT)) { + throw new error_1.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${ALLOWED_ENVIRONMENT_NAMES.join(',')} is supported for mechanism '${this.mechanism}'.`); + } + if (!this.mechanismProperties.ENVIRONMENT && + !this.mechanismProperties.OIDC_CALLBACK && + !this.mechanismProperties.OIDC_HUMAN_CALLBACK) { + throw new error_1.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`); + } + if (this.mechanismProperties.ALLOWED_HOSTS) { + const hosts = this.mechanismProperties.ALLOWED_HOSTS; + if (!Array.isArray(hosts)) { + throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR); + } + for (const host of hosts) { + if (typeof host !== 'string') { + throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR); + } + } + } + } + if (providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)) { + if (this.source != null && this.source !== '$external') { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new error_1.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`); + } + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN && this.source == null) { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new error_1.MongoAPIError('PLAIN Authentication Mechanism needs an auth source'); + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_X509 && this.password != null) { + if (this.password === '') { + Reflect.set(this, 'password', undefined); + return; + } + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new error_1.MongoAPIError(`Password not allowed for mechanism MONGODB-X509`); + } + const canonicalization = this.mechanismProperties.CANONICALIZE_HOST_NAME ?? false; + if (!Object.values(gssapi_1.GSSAPICanonicalizationValue).includes(canonicalization)) { + throw new error_1.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${canonicalization}`); + } + } + static merge(creds, options) { + return new MongoCredentials({ + username: options.username ?? creds?.username ?? '', + password: options.password ?? creds?.password ?? '', + mechanism: options.mechanism ?? creds?.mechanism ?? providers_1.AuthMechanism.MONGODB_DEFAULT, + mechanismProperties: options.mechanismProperties ?? creds?.mechanismProperties ?? {}, + source: options.source ?? options.db ?? creds?.source ?? 'admin' + }); + } +} +exports.MongoCredentials = MongoCredentials; +//# sourceMappingURL=mongo_credentials.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map new file mode 100644 index 00000000..2ade7bc1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongo_credentials.js","sourceRoot":"","sources":["../../../src/cmap/auth/mongo_credentials.ts"],"names":[],"mappings":";;;AAGA,uCAIqB;AAErB,qCAAuD;AAEvD,2CAA0E;AAE1E;;GAEG;AACH,SAAS,uBAAuB,CAAC,KAAsB;IACrD,IAAI,KAAK,EAAE,CAAC;QACV,0DAA0D;QAC1D,uCAAuC;QACvC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,yBAAa,CAAC,oBAAoB,CAAC;gBAC1E,CAAC,CAAC,yBAAa,CAAC,oBAAoB;gBACpC,CAAC,CAAC,yBAAa,CAAC,kBAAkB,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,yBAAa,CAAC,oBAAoB,CAAC;AAC5C,CAAC;AAED,MAAM,yBAAyB,GAA6C;IAC1E,MAAM;IACN,OAAO;IACP,KAAK;IACL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CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC3E,MAAM,IAAI,qBAAa,CAAC,yCAAyC,gBAAgB,EAAE,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CACV,KAAmC,EACnC,OAAyC;QAEzC,OAAO,IAAI,gBAAgB,CAAC;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK,EAAE,QAAQ,IAAI,EAAE;YACnD,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK,EAAE,QAAQ,IAAI,EAAE;YACnD,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,KAAK,EAAE,SAAS,IAAI,yBAAa,CAAC,eAAe;YACjF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,IAAI,KAAK,EAAE,mBAAmB,IAAI,EAAE;YACpF,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,EAAE,IAAI,KAAK,EAAE,MAAM,IAAI,OAAO;SACjE,CAAC,CAAC;IACL,CAAC;CACF;AA/KD,4CA+KC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js new file mode 100644 index 00000000..95d7effe --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js @@ -0,0 +1,126 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoDBAWS = void 0; +const bson_1 = require("../../bson"); +const BSON = require("../../bson"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +const aws_temporary_credentials_1 = require("./aws_temporary_credentials"); +const aws4_1 = require("./aws4"); +const mongo_credentials_1 = require("./mongo_credentials"); +const providers_1 = require("./providers"); +const ASCII_N = 110; +const bsonOptions = { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false +}; +class MongoDBAWS extends auth_provider_1.AuthProvider { + constructor(credentialProvider) { + super(); + this.credentialFetcher = new aws_temporary_credentials_1.AWSSDKCredentialProvider(credentialProvider); + } + async auth(authContext) { + const { connection } = authContext; + if (!authContext.credentials) { + throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + authContext.credentials = await makeTempCredentials(authContext.credentials, this.credentialFetcher); + const { credentials } = authContext; + const accessKeyId = credentials.username; + const secretAccessKey = credentials.password; + // Allow the user to specify an AWS session token for authentication with temporary credentials. + const sessionToken = credentials.mechanismProperties.AWS_SESSION_TOKEN; + // If all three defined, include sessionToken, else only include username and pass + const awsCredentials = sessionToken + ? { accessKeyId, secretAccessKey, sessionToken } + : { accessKeyId, secretAccessKey }; + const db = credentials.source; + const nonce = await (0, utils_1.randomBytes)(32); + // All messages between MongoDB clients and servers are sent as BSON objects + // in the payload field of saslStart and saslContinue. + const saslStart = { + saslStart: 1, + mechanism: 'MONGODB-AWS', + payload: BSON.serialize({ r: nonce, p: ASCII_N }, bsonOptions) + }; + const saslStartResponse = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStart, undefined); + const serverResponse = BSON.deserialize(saslStartResponse.payload.buffer, bsonOptions); + const host = serverResponse.h; + const serverNonce = serverResponse.s.buffer; + if (serverNonce.length !== 64) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError(`Invalid server nonce length ${serverNonce.length}, expected 64`); + } + if (!bson_1.ByteUtils.equals(serverNonce.subarray(0, nonce.byteLength), nonce)) { + // throw because the serverNonce's leading 32 bytes must equal the client nonce's 32 bytes + // https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#conversation-5 + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError('Server nonce does not begin with client nonce'); + } + if (host.length < 1 || host.length > 255 || host.indexOf('..') !== -1) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError(`Server returned an invalid host: "${host}"`); + } + const body = 'Action=GetCallerIdentity&Version=2011-06-15'; + const headers = await (0, aws4_1.aws4Sign)({ + method: 'POST', + host, + region: deriveRegion(serverResponse.h), + service: 'sts', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': body.length, + 'X-MongoDB-Server-Nonce': bson_1.ByteUtils.toBase64(serverNonce), + 'X-MongoDB-GS2-CB-Flag': 'n' + }, + path: '/', + body, + date: new Date() + }, awsCredentials); + const payload = { + a: headers.Authorization, + d: headers['X-Amz-Date'] + }; + if (sessionToken) { + payload.t = sessionToken; + } + const saslContinue = { + saslContinue: 1, + conversationId: saslStartResponse.conversationId, + payload: BSON.serialize(payload, bsonOptions) + }; + await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinue, undefined); + } +} +exports.MongoDBAWS = MongoDBAWS; +async function makeTempCredentials(credentials, awsCredentialFetcher) { + function makeMongoCredentialsFromAWSTemp(creds) { + // The AWS session token (creds.Token) may or may not be set. + if (!creds.AccessKeyId || !creds.SecretAccessKey) { + throw new error_1.MongoMissingCredentialsError('Could not obtain temporary MONGODB-AWS credentials'); + } + return new mongo_credentials_1.MongoCredentials({ + username: creds.AccessKeyId, + password: creds.SecretAccessKey, + source: credentials.source, + mechanism: providers_1.AuthMechanism.MONGODB_AWS, + mechanismProperties: { + AWS_SESSION_TOKEN: creds.Token + } + }); + } + const temporaryCredentials = await awsCredentialFetcher.getCredentials(); + return makeMongoCredentialsFromAWSTemp(temporaryCredentials); +} +function deriveRegion(host) { + const parts = host.split('.'); + if (parts.length === 1 || parts[1] === 'amazonaws') { + return 'us-east-1'; + } + return parts[1]; +} +//# sourceMappingURL=mongodb_aws.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map new file mode 100644 index 00000000..aac64640 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongodb_aws.js","sourceRoot":"","sources":["../../../src/cmap/auth/mongodb_aws.ts"],"names":[],"mappings":";;;AAAA,qCAA+E;AAC/E,mCAAmC;AACnC,uCAA8E;AAC9E,uCAA8C;AAC9C,mDAAiE;AACjE,2EAIqC;AACrC,iCAAkC;AAClC,2DAAuD;AACvD,2CAA4C;AAE5C,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,WAAW,GAAyB;IACxC,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;CAClB,CAAC;AAQF,MAAa,UAAW,SAAQ,4BAAY;IAG1C,YAAY,kBAA0C;QACpD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,iBAAiB,GAAG,IAAI,oDAAwB,CAAC,kBAAkB,CAAC,CAAC;IAC5E,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,WAAwB;QAC1C,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YAC7B,MAAM,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC;QAClF,CAAC;QAED,WAAW,CAAC,WAAW,GAAG,MAAM,mBAAmB,CACjD,WAAW,CAAC,WAAW,EACvB,IAAI,CAAC,iBAAiB,CACvB,CAAC;QAEF,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QAEpC,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC;QACzC,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC;QAC7C,gGAAgG;QAChG,MAAM,YAAY,GAAG,WAAW,CAAC,mBAAmB,CAAC,iBAAiB,CAAC;QAEvE,kFAAkF;QAClF,MAAM,cA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AAED,KAAK,UAAU,mBAAmB,CAChC,WAA6B,EAC7B,oBAA8C;IAE9C,SAAS,+BAA+B,CAAC,KAAyB;QAChE,6DAA6D;QAC7D,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;YACjD,MAAM,IAAI,oCAA4B,CAAC,oDAAoD,CAAC,CAAC;QAC/F,CAAC;QAED,OAAO,IAAI,oCAAgB,CAAC;YAC1B,QAAQ,EAAE,KAAK,CAAC,WAAW;YAC3B,QAAQ,EAAE,KAAK,CAAC,eAAe;YAC/B,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,SAAS,EAAE,yBAAa,CAAC,WAAW;YACpC,mBAAmB,EAAE;gBACnB,iBAAiB,EAAE,KAAK,CAAC,KAAK;aAC/B;SACF,CAAC,CAAC;IACL,CAAC;IACD,MAAM,oBAAoB,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAEzE,OAAO,+BAA+B,CAAC,oBAAoB,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,WAAW,EAAE,CAAC;QACnD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js new file mode 100644 index 00000000..27cecbb7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoDBOIDC = exports.OIDC_WORKFLOWS = exports.OIDC_VERSION = void 0; +const error_1 = require("../../error"); +const auth_provider_1 = require("./auth_provider"); +const automated_callback_workflow_1 = require("./mongodb_oidc/automated_callback_workflow"); +const azure_machine_workflow_1 = require("./mongodb_oidc/azure_machine_workflow"); +const gcp_machine_workflow_1 = require("./mongodb_oidc/gcp_machine_workflow"); +const k8s_machine_workflow_1 = require("./mongodb_oidc/k8s_machine_workflow"); +const token_cache_1 = require("./mongodb_oidc/token_cache"); +const token_machine_workflow_1 = require("./mongodb_oidc/token_machine_workflow"); +/** Error when credentials are missing. */ +const MISSING_CREDENTIALS_ERROR = 'AuthContext must provide credentials.'; +/** The current version of OIDC implementation. */ +exports.OIDC_VERSION = 1; +/** @internal */ +exports.OIDC_WORKFLOWS = new Map(); +exports.OIDC_WORKFLOWS.set('test', () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), token_machine_workflow_1.tokenMachineCallback)); +exports.OIDC_WORKFLOWS.set('azure', () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), azure_machine_workflow_1.azureCallback)); +exports.OIDC_WORKFLOWS.set('gcp', () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), gcp_machine_workflow_1.gcpCallback)); +exports.OIDC_WORKFLOWS.set('k8s', () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), k8s_machine_workflow_1.k8sCallback)); +/** + * OIDC auth provider. + */ +class MongoDBOIDC extends auth_provider_1.AuthProvider { + /** + * Instantiate the auth provider. + */ + constructor(workflow) { + super(); + if (!workflow) { + throw new error_1.MongoInvalidArgumentError('No workflow provided to the OIDC auth provider.'); + } + this.workflow = workflow; + } + /** + * Authenticate using OIDC + */ + async auth(authContext) { + const { connection, reauthenticating, response } = authContext; + if (response?.speculativeAuthenticate?.done && !reauthenticating) { + return; + } + const credentials = getCredentials(authContext); + if (reauthenticating) { + await this.workflow.reauthenticate(connection, credentials); + } + else { + await this.workflow.execute(connection, credentials, response); + } + } + /** + * Add the speculative auth for the initial handshake. + */ + async prepare(handshakeDoc, authContext) { + const { connection } = authContext; + const credentials = getCredentials(authContext); + const result = await this.workflow.speculativeAuth(connection, credentials); + return { ...handshakeDoc, ...result }; + } +} +exports.MongoDBOIDC = MongoDBOIDC; +/** + * Get credentials from the auth context, throwing if they do not exist. + */ +function getCredentials(authContext) { + const { credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError(MISSING_CREDENTIALS_ERROR); + } + return credentials; +} +//# sourceMappingURL=mongodb_oidc.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js.map new file mode 100644 index 00000000..d3756c11 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongodb_oidc.js","sourceRoot":"","sources":["../../../src/cmap/auth/mongodb_oidc.ts"],"names":[],"mappings":";;;AACA,uCAAsF;AAGtF,mDAAiE;AAEjE,4FAAuF;AACvF,kFAAsE;AACtE,8EAAkE;AAClE,8EAAkE;AAClE,4DAAwD;AACxD,kFAA6F;AAE7F,0CAA0C;AAC1C,MAAM,yBAAyB,GAAG,uCAAuC,CAAC;AA6E1E,kDAAkD;AACrC,QAAA,YAAY,GAAG,CAAC,CAAC;AA6B9B,gBAAgB;AACH,QAAA,cAAc,GAAyC,IAAI,GAAG,EAAE,CAAC;AAC9E,sBAAc,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,uDAAyB,CAAC,IAAI,wBAAU,EAAE,EAAE,6CAAY,CAAC,CAAC,CAAC;AAChG,sBAAc,CA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AwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;QACnC,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC5E,OAAO,EAAE,GAAG,YAAY,EAAE,GAAG,MAAM,EAAE,CAAC;IACxC,CAAC;CACF;AA1CD,kCA0CC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,WAAwB;IAC9C,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;IACpC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,oCAA4B,CAAC,yBAAyB,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js new file mode 100644 index 00000000..8e5f4f3e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js @@ -0,0 +1,84 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AutomatedCallbackWorkflow = void 0; +const error_1 = require("../../../error"); +const timeout_1 = require("../../../timeout"); +const mongodb_oidc_1 = require("../mongodb_oidc"); +const callback_workflow_1 = require("./callback_workflow"); +/** + * Class implementing behaviour for the non human callback workflow. + * @internal + */ +class AutomatedCallbackWorkflow extends callback_workflow_1.CallbackWorkflow { + /** + * Instantiate the human callback workflow. + */ + constructor(cache, callback) { + super(cache, callback); + } + /** + * Execute the OIDC callback workflow. + */ + async execute(connection, credentials) { + // If there is a cached access token, try to authenticate with it. If + // authentication fails with an Authentication error (18), + // invalidate the access token, fetch a new access token, and try + // to authenticate again. + // If the server fails for any other reason, do not clear the cache. + if (this.cache.hasAccessToken) { + const token = this.cache.getAccessToken(); + if (!connection.accessToken) { + connection.accessToken = token; + } + try { + return await this.finishAuthentication(connection, credentials, token); + } + catch (error) { + if (error instanceof error_1.MongoError && + error.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) { + this.cache.removeAccessToken(); + return await this.execute(connection, credentials); + } + else { + throw error; + } + } + } + const response = await this.fetchAccessToken(credentials); + this.cache.put(response); + connection.accessToken = response.accessToken; + await this.finishAuthentication(connection, credentials, response.accessToken); + } + /** + * Fetches the access token using the callback. + */ + async fetchAccessToken(credentials) { + const controller = new AbortController(); + const params = { + timeoutContext: controller.signal, + version: mongodb_oidc_1.OIDC_VERSION + }; + if (credentials.username) { + params.username = credentials.username; + } + if (credentials.mechanismProperties.TOKEN_RESOURCE) { + params.tokenAudience = credentials.mechanismProperties.TOKEN_RESOURCE; + } + const timeout = timeout_1.Timeout.expires(callback_workflow_1.AUTOMATED_TIMEOUT_MS); + try { + return await Promise.race([this.executeAndValidateCallback(params), timeout]); + } + catch (error) { + if (timeout_1.TimeoutError.is(error)) { + controller.abort(); + throw new error_1.MongoOIDCError(`OIDC callback timed out after ${callback_workflow_1.AUTOMATED_TIMEOUT_MS}ms.`); + } + throw error; + } + finally { + timeout.clear(); + } + } +} +exports.AutomatedCallbackWorkflow = AutomatedCallbackWorkflow; +//# sourceMappingURL=automated_callback_workflow.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js.map new file mode 100644 index 00000000..40b3ab0f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"automated_callback_workflow.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/automated_callback_workflow.ts"],"names":[],"mappings":";;;AAAA,0CAAiF;AACjF,8CAAyD;AAGzD,kDAKyB;AACzB,2DAA6E;AAG7E;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,oCAAgB;IAC7D;;OAEG;IACH,YAAY,KAAiB,EAAE,QAA8B;QAC3D,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,UAAsB,EAAE,WAA6B;QACjE,qEAAqE;QACrE,0DAA0D;QAC1D,iEAAiE;QACjE,yBAAyB;QACzB,oEAAoE;QACpE,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YAC1C,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;gBAC5B,UAAU,CAAC,WAAW,GAAG,KAAK,CAAC;YACjC,CAAC;YACD,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;YACzE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IACE,KAAK,YAAY,kBAAU;oBAC3B,KAAK,CAAC,IAAI,KAAK,2BAAmB,CAAC,oBAAoB,EACvD,CAAC;oBACD,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;oBAC/B,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;gBACrD,CAAC;qBAAM,CAAC;oBACN,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAC1D,IAAI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/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js new file mode 100644 index 00000000..d829e6bc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.azureCallback = void 0; +const azure_1 = require("../../../client-side-encryption/providers/azure"); +const error_1 = require("../../../error"); +const utils_1 = require("../../../utils"); +/** Azure request headers. */ +const AZURE_HEADERS = Object.freeze({ Metadata: 'true', Accept: 'application/json' }); +/** Invalid endpoint result error. */ +const ENDPOINT_RESULT_ERROR = 'Azure endpoint did not return a value with only access_token and expires_in properties'; +/** Error for when the token audience is missing in the environment. */ +const TOKEN_RESOURCE_MISSING_ERROR = 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.'; +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +const azureCallback = async (params) => { + const tokenAudience = params.tokenAudience; + const username = params.username; + if (!tokenAudience) { + throw new error_1.MongoAzureError(TOKEN_RESOURCE_MISSING_ERROR); + } + const response = await getAzureTokenData(tokenAudience, username); + if (!isEndpointResultValid(response)) { + throw new error_1.MongoAzureError(ENDPOINT_RESULT_ERROR); + } + return response; +}; +exports.azureCallback = azureCallback; +/** + * Hit the Azure endpoint to get the token data. + */ +async function getAzureTokenData(tokenAudience, username) { + const url = new URL(azure_1.AZURE_BASE_URL); + (0, azure_1.addAzureParams)(url, tokenAudience, username); + const response = await (0, utils_1.get)(url, { + headers: AZURE_HEADERS + }); + if (response.status !== 200) { + throw new error_1.MongoAzureError(`Status code ${response.status} returned from the Azure endpoint. Response body: ${response.body}`); + } + const result = JSON.parse(response.body); + return { + accessToken: result.access_token, + expiresInSeconds: Number(result.expires_in) + }; +} +/** + * Determines if a result returned from the endpoint is valid. + * This means the result is not nullish, contains the access_token required field + * and the expires_in required field. + */ +function isEndpointResultValid(token) { + if (token == null || typeof token !== 'object') + return false; + return ('accessToken' in token && + typeof token.accessToken === 'string' && + 'expiresInSeconds' in token && + typeof token.expiresInSeconds === 'number'); +} +//# sourceMappingURL=azure_machine_workflow.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js.map new file mode 100644 index 00000000..bbd7f300 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"azure_machine_workflow.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/azure_machine_workflow.ts"],"names":[],"mappings":";;;AAAA,2EAAiG;AACjG,0CAAiD;AACjD,0CAAqC;AAGrC,6BAA6B;AAC7B,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAEtF,qCAAqC;AACrC,MAAM,qBAAqB,GACzB,wFAAwF,CAAC;AAE3F,uEAAuE;AACvE,MAAM,4BAA4B,GAChC,wFAAwF,CAAC;AAE3F;;;;GAIG;AACI,MAAM,aAAa,GAAyB,KAAK,EACtD,MAA0B,EACH,EAAE;IACzB,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,uBAAe,CAAC,4BAA4B,CAAC,CAAC;IAC1D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Q,CAC3C,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js new file mode 100644 index 00000000..97c3eff2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js @@ -0,0 +1,141 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallbackWorkflow = exports.AUTOMATED_TIMEOUT_MS = exports.HUMAN_TIMEOUT_MS = void 0; +const promises_1 = require("timers/promises"); +const error_1 = require("../../../error"); +const utils_1 = require("../../../utils"); +const command_builders_1 = require("./command_builders"); +/** 5 minutes in milliseconds */ +exports.HUMAN_TIMEOUT_MS = 300000; +/** 1 minute in milliseconds */ +exports.AUTOMATED_TIMEOUT_MS = 60000; +/** Properties allowed on results of callbacks. */ +const RESULT_PROPERTIES = ['accessToken', 'expiresInSeconds', 'refreshToken']; +/** Error message when the callback result is invalid. */ +const CALLBACK_RESULT_ERROR = 'User provided OIDC callbacks must return a valid object with an accessToken.'; +/** The time to throttle callback calls. */ +const THROTTLE_MS = 100; +/** + * OIDC implementation of a callback based workflow. + * @internal + */ +class CallbackWorkflow { + /** + * Instantiate the callback workflow. + */ + constructor(cache, callback) { + this.cache = cache; + this.callback = this.withLock(callback); + this.lastExecutionTime = Date.now() - THROTTLE_MS; + } + /** + * Get the document to add for speculative authentication. This also needs + * to add a db field from the credentials source. + */ + async speculativeAuth(connection, credentials) { + // Check if the Client Cache has an access token. + // If it does, cache the access token in the Connection Cache and send a JwtStepRequest + // with the cached access token in the speculative authentication SASL payload. + if (this.cache.hasAccessToken) { + const accessToken = this.cache.getAccessToken(); + connection.accessToken = accessToken; + const document = (0, command_builders_1.finishCommandDocument)(accessToken); + document.db = credentials.source; + return { speculativeAuthenticate: document }; + } + return {}; + } + /** + * Reauthenticate the callback workflow. For this we invalidated the access token + * in the cache and run the authentication steps again. No initial handshake needs + * to be sent. + */ + async reauthenticate(connection, credentials) { + if (this.cache.hasAccessToken) { + // Reauthentication implies the token has expired. + if (connection.accessToken === this.cache.getAccessToken()) { + // If connection's access token is the same as the cache's, remove + // the token from the cache and connection. + this.cache.removeAccessToken(); + delete connection.accessToken; + } + else { + // If the connection's access token is different from the cache's, set + // the cache's token on the connection and do not remove from the + // cache. + connection.accessToken = this.cache.getAccessToken(); + } + } + await this.execute(connection, credentials); + } + /** + * Starts the callback authentication process. If there is a speculative + * authentication document from the initial handshake, then we will use that + * value to get the issuer, otherwise we will send the saslStart command. + */ + async startAuthentication(connection, credentials, response) { + let result; + if (response?.speculativeAuthenticate) { + result = response.speculativeAuthenticate; + } + else { + result = await connection.command((0, utils_1.ns)(credentials.source), (0, command_builders_1.startCommandDocument)(credentials), undefined); + } + return result; + } + /** + * Finishes the callback authentication process. + */ + async finishAuthentication(connection, credentials, token, conversationId) { + await connection.command((0, utils_1.ns)(credentials.source), (0, command_builders_1.finishCommandDocument)(token, conversationId), undefined); + } + /** + * Executes the callback and validates the output. + */ + async executeAndValidateCallback(params) { + const result = await this.callback(params); + // Validate that the result returned by the callback is acceptable. If it is not + // we must clear the token result from the cache. + if (isCallbackResultInvalid(result)) { + throw new error_1.MongoMissingCredentialsError(CALLBACK_RESULT_ERROR); + } + return result; + } + /** + * Ensure the callback is only executed one at a time and throttles the calls + * to every 100ms. + */ + withLock(callback) { + let lock = Promise.resolve(); + return async (params) => { + // We do this to ensure that we would never return the result of the + // previous lock, only the current callback's value would get returned. + await lock; + lock = lock + .catch(() => null) + .then(async () => { + const difference = Date.now() - this.lastExecutionTime; + if (difference <= THROTTLE_MS) { + await (0, promises_1.setTimeout)(THROTTLE_MS - difference, { signal: params.timeoutContext }); + } + this.lastExecutionTime = Date.now(); + return await callback(params); + }); + return await lock; + }; + } +} +exports.CallbackWorkflow = CallbackWorkflow; +/** + * Determines if a result returned from a request or refresh callback + * function is invalid. This means the result is nullish, doesn't contain + * the accessToken required field, and does not contain extra fields. + */ +function isCallbackResultInvalid(tokenResult) { + if (tokenResult == null || typeof tokenResult !== 'object') + return true; + if (!('accessToken' in tokenResult)) + return true; + return !Object.getOwnPropertyNames(tokenResult).every(prop => RESULT_PROPERTIES.includes(prop)); +} +//# sourceMappingURL=callback_workflow.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map new file mode 100644 index 00000000..45013d10 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"callback_workflow.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/callback_workflow.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAG7C,0CAA8D;AAC9D,0CAAoC;AASpC,yDAAiF;AAGjF,gCAAgC;AACnB,QAAA,gBAAgB,GAAG,MAAM,CAAC;AACvC,+BAA+B;AAClB,QAAA,oBAAoB,GAAG,KAAK,CAAC;AAE1C,kDAAkD;AAClD,MAAM,iBAAiB,GAAG,CAAC,aAAa,EAAE,kBAAkB,EAAE,cAAc,CAAC,CAAC;AAE9E,yDAAyD;AACzD,MAAM,qBAAqB,GACzB,8EAA8E,CAAC;AAEjF,2CAA2C;AAC3C,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB;;;GAGG;AACH,MAAsB,gBAAgB;IAKpC;;OAEG;IACH,YAAY,KAAiB,EAAE,QAA8B;QAC3D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,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AM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC;gBACvD,IAAI,UAAU,IAAI,WAAW,EAAE,CAAC;oBAC9B,MAAM,IAAA,qBAAU,EAAC,WAAW,GAAG,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;gBAChF,CAAC;gBACD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBACpC,OAAO,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;YACL,OAAO,MAAM,IAAI,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC;CACF;AA7ID,4CA6IC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,WAAoB;IACnD,IAAI,WAAW,IAAI,IAAI,IAAI,OAAO,WAAW,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACxE,IAAI,CAAC,CAAC,aAAa,IAAI,WAAW,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js new file mode 100644 index 00000000..2ea96d2a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.finishCommandDocument = finishCommandDocument; +exports.startCommandDocument = startCommandDocument; +const bson_1 = require("../../../bson"); +const providers_1 = require("../providers"); +/** + * Generate the finishing command document for authentication. Will be a + * saslStart or saslContinue depending on the presence of a conversation id. + */ +function finishCommandDocument(token, conversationId) { + if (conversationId != null) { + return { + saslContinue: 1, + conversationId: conversationId, + payload: new bson_1.Binary(bson_1.BSON.serialize({ jwt: token })) + }; + } + // saslContinue requires a conversationId in the command to be valid so in this + // case the server allows "step two" to actually be a saslStart with the token + // as the jwt since the use of the cached value has no correlating conversating + // on the particular connection. + return { + saslStart: 1, + mechanism: providers_1.AuthMechanism.MONGODB_OIDC, + payload: new bson_1.Binary(bson_1.BSON.serialize({ jwt: token })) + }; +} +/** + * Generate the saslStart command document. + */ +function startCommandDocument(credentials) { + const payload = {}; + if (credentials.username) { + payload.n = credentials.username; + } + return { + saslStart: 1, + autoAuthorize: 1, + mechanism: providers_1.AuthMechanism.MONGODB_OIDC, + payload: new bson_1.Binary(bson_1.BSON.serialize(payload)) + }; +} +//# sourceMappingURL=command_builders.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js.map new file mode 100644 index 00000000..c2de30c9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js.map @@ -0,0 +1 @@ +{"version":3,"file":"command_builders.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/command_builders.ts"],"names":[],"mappings":";;AAmBA,sDAiBC;AAKD,oDAWC;AApDD,wCAA4D;AAE5D,4CAA6C;AAa7C;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,KAAa,EAAE,cAAuB;IAC1E,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;QAC3B,OAAO;YACL,YAAY,EAAE,CAAC;YACf,cAAc,EAAE,cAAc;YAC9B,OAAO,EAAE,IAAI,aAAM,CAAC,WAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;SACpD,CAAC;IACJ,CAAC;IACD,+EAA+E;IAC/E,8EAA8E;IAC9E,+EAA+E;IAC/E,gCAAgC;IAChC,OAAO;QACL,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,yBAAa,CAAC,YAAY;QACrC,OAAO,EAAE,IAAI,aAAM,CAAC,WAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;KACpD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,WAA6B;IAChE,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC;IACnC,CAAC;IACD,OAAO;QACL,SAAS,EAAE,CAAC;QACZ,aAAa,EAAE,CAAC;QAChB,SAAS,EAAE,yBAAa,CAAC,YAAY;QACrC,OAAO,EAAE,IAAI,aAAM,CAAC,WAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC7C,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js new file mode 100644 index 00000000..c4a90b52 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.gcpCallback = void 0; +const error_1 = require("../../../error"); +const utils_1 = require("../../../utils"); +/** GCP base URL. */ +const GCP_BASE_URL = 'http://metadata/computeMetadata/v1/instance/service-accounts/default/identity'; +/** GCP request headers. */ +const GCP_HEADERS = Object.freeze({ 'Metadata-Flavor': 'Google' }); +/** Error for when the token audience is missing in the environment. */ +const TOKEN_RESOURCE_MISSING_ERROR = 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp.'; +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +const gcpCallback = async (params) => { + const tokenAudience = params.tokenAudience; + if (!tokenAudience) { + throw new error_1.MongoGCPError(TOKEN_RESOURCE_MISSING_ERROR); + } + return await getGcpTokenData(tokenAudience); +}; +exports.gcpCallback = gcpCallback; +/** + * Hit the GCP endpoint to get the token data. + */ +async function getGcpTokenData(tokenAudience) { + const url = new URL(GCP_BASE_URL); + url.searchParams.append('audience', tokenAudience); + const response = await (0, utils_1.get)(url, { + headers: GCP_HEADERS + }); + if (response.status !== 200) { + throw new error_1.MongoGCPError(`Status code ${response.status} returned from the GCP endpoint. Response body: ${response.body}`); + } + return { accessToken: response.body }; +} +//# sourceMappingURL=gcp_machine_workflow.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js.map new file mode 100644 index 00000000..f55f8ef2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gcp_machine_workflow.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/gcp_machine_workflow.ts"],"names":[],"mappings":";;;AAAA,0CAA+C;AAC/C,0CAAqC;AAGrC,oBAAoB;AACpB,MAAM,YAAY,GAChB,+EAA+E,CAAC;AAElF,2BAA2B;AAC3B,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,CAAC;AAEnE,uEAAuE;AACvE,MAAM,4BAA4B,GAChC,sFAAsF,CAAC;AAEzF;;;;GAIG;AACI,MAAM,WAAW,GAAyB,KAAK,EACpD,MAA0B,EACH,EAAE;IACzB,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IAC3C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,qBAAa,CAAC,4BAA4B,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,MAAM,eAAe,CAAC,aAAa,CAAC,CAAC;AAC9C,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB;AAEF;;GAEG;AACH,KAAK,UAAU,eAAe,CAAC,aAAqB;IAClD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;IAClC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,MAAM,IAAA,WAAG,EAAC,GAAG,EAAE;QAC9B,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,MAAM,IAAI,qBAAa,CACrB,eAAe,QAAQ,CAAC,MAAM,mDAAmD,QAAQ,CAAC,IAAI,EAAE,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js new file mode 100644 index 00000000..dc0556e2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HumanCallbackWorkflow = void 0; +const bson_1 = require("../../../bson"); +const error_1 = require("../../../error"); +const timeout_1 = require("../../../timeout"); +const mongodb_oidc_1 = require("../mongodb_oidc"); +const callback_workflow_1 = require("./callback_workflow"); +/** + * Class implementing behaviour for the non human callback workflow. + * @internal + */ +class HumanCallbackWorkflow extends callback_workflow_1.CallbackWorkflow { + /** + * Instantiate the human callback workflow. + */ + constructor(cache, callback) { + super(cache, callback); + } + /** + * Execute the OIDC human callback workflow. + */ + async execute(connection, credentials) { + // Check if the Client Cache has an access token. + // If it does, cache the access token in the Connection Cache and perform a One-Step SASL conversation + // using the access token. If the server returns an Authentication error (18), + // invalidate the access token token from the Client Cache, clear the Connection Cache, + // and restart the authentication flow. Raise any other errors to the user. On success, exit the algorithm. + if (this.cache.hasAccessToken) { + const token = this.cache.getAccessToken(); + connection.accessToken = token; + try { + return await this.finishAuthentication(connection, credentials, token); + } + catch (error) { + if (error instanceof error_1.MongoError && + error.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) { + this.cache.removeAccessToken(); + delete connection.accessToken; + return await this.execute(connection, credentials); + } + else { + throw error; + } + } + } + // Check if the Client Cache has a refresh token. + // If it does, call the OIDC Human Callback with the cached refresh token and IdpInfo to get a + // new access token. Cache the new access token in the Client Cache and Connection Cache. + // Perform a One-Step SASL conversation using the new access token. If the the server returns + // an Authentication error (18), clear the refresh token, invalidate the access token from the + // Client Cache, clear the Connection Cache, and restart the authentication flow. Raise any other + // errors to the user. On success, exit the algorithm. + if (this.cache.hasRefreshToken) { + const refreshToken = this.cache.getRefreshToken(); + const result = await this.fetchAccessToken(this.cache.getIdpInfo(), credentials, refreshToken); + this.cache.put(result); + connection.accessToken = result.accessToken; + try { + return await this.finishAuthentication(connection, credentials, result.accessToken); + } + catch (error) { + if (error instanceof error_1.MongoError && + error.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) { + this.cache.removeRefreshToken(); + delete connection.accessToken; + return await this.execute(connection, credentials); + } + else { + throw error; + } + } + } + // Start a new Two-Step SASL conversation. + // Run a PrincipalStepRequest to get the IdpInfo. + // Call the OIDC Human Callback with the new IdpInfo to get a new access token and optional refresh + // token. Drivers MUST NOT pass a cached refresh token to the callback when performing + // a new Two-Step conversation. Cache the new IdpInfo and refresh token in the Client Cache and the + // new access token in the Client Cache and Connection Cache. + // Attempt to authenticate using a JwtStepRequest with the new access token. Raise any errors to the user. + const startResponse = await this.startAuthentication(connection, credentials); + const conversationId = startResponse.conversationId; + const idpInfo = bson_1.BSON.deserialize(startResponse.payload.buffer); + const callbackResponse = await this.fetchAccessToken(idpInfo, credentials); + this.cache.put(callbackResponse, idpInfo); + connection.accessToken = callbackResponse.accessToken; + return await this.finishAuthentication(connection, credentials, callbackResponse.accessToken, conversationId); + } + /** + * Fetches an access token using the callback. + */ + async fetchAccessToken(idpInfo, credentials, refreshToken) { + const controller = new AbortController(); + const params = { + timeoutContext: controller.signal, + version: mongodb_oidc_1.OIDC_VERSION, + idpInfo: idpInfo + }; + if (credentials.username) { + params.username = credentials.username; + } + if (refreshToken) { + params.refreshToken = refreshToken; + } + const timeout = timeout_1.Timeout.expires(callback_workflow_1.HUMAN_TIMEOUT_MS); + try { + return await Promise.race([this.executeAndValidateCallback(params), timeout]); + } + catch (error) { + if (timeout_1.TimeoutError.is(error)) { + controller.abort(); + throw new error_1.MongoOIDCError(`OIDC callback timed out after ${callback_workflow_1.HUMAN_TIMEOUT_MS}ms.`); + } + throw error; + } + finally { + timeout.clear(); + } + } +} +exports.HumanCallbackWorkflow = HumanCallbackWorkflow; +//# sourceMappingURL=human_callback_workflow.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js.map new file mode 100644 index 00000000..4e64bc67 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"human_callback_workflow.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/human_callback_workflow.ts"],"names":[],"mappings":";;;AAAA,wCAAqC;AACrC,0CAAiF;AACjF,8CAAyD;AAGzD,kDAMyB;AACzB,2DAAyE;AAGzE;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,oCAAgB;IACzD;;OAEG;IACH,YAAY,KAAiB,EAAE,QAA8B;QAC3D,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,UAAsB,EAAE,WAA6B;QACjE,iDAAiD;QACjD,sGAAsG;QACtG,8EAA8E;QAC9E,uFAAuF;QACvF,2GAA2G;QAC3G,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YAC1C,UAAU,CAAC,WAAW,GAAG,KAAK,CAAC;YAC/B,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;YACzE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IACE,KAAK,YAAY,kBAAU;oBAC3B,KAAK,CAAC,IAAI,KAAK,2BAAmB,CAAC,oBAAoB,EACvD,CAAC;oBACD,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;oBAC/B,OAAO,UAAU,CAAC,WAAW,CAAC;oBAC9B,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;gBACrD,CAAC;qBAAM,CAAC;oBACN,MAAM,KAAK,CA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AAC;gBACnB,MAAM,IAAI,sBAAc,CAAC,iCAAiC,oCAAgB,KAAK,CAAC,CAAC;YACnF,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;CACF;AAzHD,sDAyHC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js new file mode 100644 index 00000000..e0c8e63a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.k8sCallback = void 0; +const promises_1 = require("fs/promises"); +const process = require("process"); +/** The fallback file name */ +const FALLBACK_FILENAME = '/var/run/secrets/kubernetes.io/serviceaccount/token'; +/** The azure environment variable for the file name. */ +const AZURE_FILENAME = 'AZURE_FEDERATED_TOKEN_FILE'; +/** The AWS environment variable for the file name. */ +const AWS_FILENAME = 'AWS_WEB_IDENTITY_TOKEN_FILE'; +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +const k8sCallback = async () => { + let filename; + if (process.env[AZURE_FILENAME]) { + filename = process.env[AZURE_FILENAME]; + } + else if (process.env[AWS_FILENAME]) { + filename = process.env[AWS_FILENAME]; + } + else { + filename = FALLBACK_FILENAME; + } + const token = await (0, promises_1.readFile)(filename, 'utf8'); + return { accessToken: token }; +}; +exports.k8sCallback = k8sCallback; +//# sourceMappingURL=k8s_machine_workflow.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js.map new file mode 100644 index 00000000..a49bcb68 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"k8s_machine_workflow.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AACvC,mCAAmC;AAInC,6BAA6B;AAC7B,MAAM,iBAAiB,GAAG,qDAAqD,CAAC;AAEhF,wDAAwD;AACxD,MAAM,cAAc,GAAG,4BAA4B,CAAC;AAEpD,sDAAsD;AACtD,MAAM,YAAY,GAAG,6BAA6B,CAAC;AAEnD;;;;GAIG;AACI,MAAM,WAAW,GAAyB,KAAK,IAA2B,EAAE;IACjF,IAAI,QAAgB,CAAC;IACrB,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;QAChC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACzC,CAAC;SAAM,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QACrC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,iBAAiB,CAAC;IAC/B,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAChC,CAAC,CAAC;AAXW,QAAA,WAAW,eAWtB"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js new file mode 100644 index 00000000..dcf061cc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TokenCache = void 0; +const error_1 = require("../../../error"); +class MongoOIDCError extends error_1.MongoDriverError { +} +/** @internal */ +class TokenCache { + get hasAccessToken() { + return !!this.accessToken; + } + get hasRefreshToken() { + return !!this.refreshToken; + } + get hasIdpInfo() { + return !!this.idpInfo; + } + getAccessToken() { + if (!this.accessToken) { + throw new MongoOIDCError('Attempted to get an access token when none exists.'); + } + return this.accessToken; + } + getRefreshToken() { + if (!this.refreshToken) { + throw new MongoOIDCError('Attempted to get a refresh token when none exists.'); + } + return this.refreshToken; + } + getIdpInfo() { + if (!this.idpInfo) { + throw new MongoOIDCError('Attempted to get IDP information when none exists.'); + } + return this.idpInfo; + } + put(response, idpInfo) { + this.accessToken = response.accessToken; + this.refreshToken = response.refreshToken; + this.expiresInSeconds = response.expiresInSeconds; + if (idpInfo) { + this.idpInfo = idpInfo; + } + } + removeAccessToken() { + this.accessToken = undefined; + } + removeRefreshToken() { + this.refreshToken = undefined; + } +} +exports.TokenCache = TokenCache; +//# sourceMappingURL=token_cache.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js.map new file mode 100644 index 00000000..cc6e98c0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"token_cache.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/token_cache.ts"],"names":[],"mappings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,CAAC,YAAY,GAAG,SAAS,CAAC;IAChC,CAAC;CACF;AAvDD,gCAuDC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js new file mode 100644 index 00000000..ba06d04c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tokenMachineCallback = void 0; +const fs = require("fs"); +const process = require("process"); +const error_1 = require("../../../error"); +/** Error for when the token is missing in the environment. */ +const TOKEN_MISSING_ERROR = 'OIDC_TOKEN_FILE must be set in the environment.'; +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +const tokenMachineCallback = async () => { + const tokenFile = process.env.OIDC_TOKEN_FILE; + if (!tokenFile) { + throw new error_1.MongoAWSError(TOKEN_MISSING_ERROR); + } + const token = await fs.promises.readFile(tokenFile, 'utf8'); + return { accessToken: token }; +}; +exports.tokenMachineCallback = tokenMachineCallback; +//# sourceMappingURL=token_machine_workflow.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js.map new file mode 100644 index 00000000..19c7fb03 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"token_machine_workflow.js","sourceRoot":"","sources":["../../../../src/cmap/auth/mongodb_oidc/token_machine_workflow.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,mCAAmC;AAEnC,0CAA+C;AAG/C,8DAA8D;AAC9D,MAAM,mBAAmB,GAAG,iDAAiD,CAAC;AAE9E;;;;GAIG;AACI,MAAM,oBAAoB,GAAyB,KAAK,IAA2B,EAAE;IAC1F,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,qBAAa,CAAC,mBAAmB,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAChC,CAAC,CAAC;AAPW,QAAA,oBAAoB,wBAO/B"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js new file mode 100644 index 00000000..c34eab9f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Plain = void 0; +const bson_1 = require("../../bson"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +class Plain extends auth_provider_1.AuthProvider { + async auth(authContext) { + const { connection, credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + const { username, password } = credentials; + const payload = new bson_1.Binary(bson_1.ByteUtils.fromUTF8(`\x00${username}\x00${password}`)); + const command = { + saslStart: 1, + mechanism: 'PLAIN', + payload: payload, + autoAuthorize: 1 + }; + await connection.command((0, utils_1.ns)('$external.$cmd'), command, undefined); + } +} +exports.Plain = Plain; +//# sourceMappingURL=plain.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js.map new file mode 100644 index 00000000..e039d08f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/plain.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plain.js","sourceRoot":"","sources":["../../../src/cmap/auth/plain.ts"],"names":[],"mappings":";;;AAAA,qCAA+C;AAC/C,uCAA2D;AAC3D,uCAAiC;AACjC,mDAAiE;AAEjE,MAAa,KAAM,SAAQ,4BAAY;IAC5B,KAAK,CAAC,IAAI,CAAC,WAAwB;QAC1C,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QAChD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC;QAClF,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;QAE3C,MAAM,OAAO,GAAG,IAAI,aAAM,CAAC,gBAAS,CAAC,QAAQ,CAAC,OAAO,QAAQ,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC;QACjF,MAAM,OAAO,GAAG;YACd,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,CAAC;SACjB,CAAC;QAEF,MAAM,UAAU,CAAC,OAAO,CAAC,IAAA,UAAE,EAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;CACF;AAnBD,sBAmBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js new file mode 100644 index 00000000..4402e39d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AUTH_MECHS_AUTH_SRC_EXTERNAL = exports.AuthMechanism = void 0; +/** @public */ +exports.AuthMechanism = Object.freeze({ + MONGODB_AWS: 'MONGODB-AWS', + MONGODB_DEFAULT: 'DEFAULT', + MONGODB_GSSAPI: 'GSSAPI', + MONGODB_PLAIN: 'PLAIN', + MONGODB_SCRAM_SHA1: 'SCRAM-SHA-1', + MONGODB_SCRAM_SHA256: 'SCRAM-SHA-256', + MONGODB_X509: 'MONGODB-X509', + MONGODB_OIDC: 'MONGODB-OIDC' +}); +/** @internal */ +exports.AUTH_MECHS_AUTH_SRC_EXTERNAL = new Set([ + exports.AuthMechanism.MONGODB_GSSAPI, + exports.AuthMechanism.MONGODB_AWS, + exports.AuthMechanism.MONGODB_OIDC, + exports.AuthMechanism.MONGODB_X509 +]); +//# sourceMappingURL=providers.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js.map new file mode 100644 index 00000000..d697c911 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/providers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../../src/cmap/auth/providers.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,SAAS;IAC1B,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,OAAO;IACtB,kBAAkB,EAAE,aAAa;IACjC,oBAAoB,EAAE,eAAe;IACrC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;CACpB,CAAC,CAAC;AAKZ,gBAAgB;AACH,QAAA,4BAA4B,GAAG,IAAI,GAAG,CAAgB;IACjE,qBAAa,CAAC,cAAc;IAC5B,qBAAa,CAAC,WAAW;IACzB,qBAAa,CAAC,YAAY;IAC1B,qBAAa,CAAC,YAAY;CAC3B,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js new file mode 100644 index 00000000..faea4613 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js @@ -0,0 +1,266 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScramSHA256 = exports.ScramSHA1 = void 0; +const saslprep_1 = require("@mongodb-js/saslprep"); +const bson_1 = require("../../bson"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +const providers_1 = require("./providers"); +class ScramSHA extends auth_provider_1.AuthProvider { + constructor(cryptoMethod) { + super(); + this.cryptoMethod = cryptoMethod || 'sha1'; + } + async prepare(handshakeDoc, authContext) { + const cryptoMethod = this.cryptoMethod; + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + const nonce = await (0, utils_1.randomBytes)(24); + // store the nonce for later use + authContext.nonce = nonce; + const request = { + ...handshakeDoc, + speculativeAuthenticate: { + ...makeFirstMessage(cryptoMethod, credentials, nonce), + db: credentials.source + } + }; + return request; + } + async auth(authContext) { + const { reauthenticating, response } = authContext; + if (response?.speculativeAuthenticate && !reauthenticating) { + return await continueScramConversation(this.cryptoMethod, response.speculativeAuthenticate, authContext); + } + return await executeScram(this.cryptoMethod, authContext); + } +} +function cleanUsername(username) { + return username.replace('=', '=3D').replace(',', '=2C'); +} +function clientFirstMessageBare(username, nonce) { + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return bson_1.ByteUtils.concat([ + bson_1.ByteUtils.fromUTF8('n='), + bson_1.ByteUtils.fromUTF8(username), + bson_1.ByteUtils.fromUTF8(',r='), + bson_1.ByteUtils.fromUTF8(bson_1.ByteUtils.toBase64(nonce)) + ]); +} +function makeFirstMessage(cryptoMethod, credentials, nonce) { + const username = cleanUsername(credentials.username); + const mechanism = cryptoMethod === 'sha1' ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 : providers_1.AuthMechanism.MONGODB_SCRAM_SHA256; + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return { + saslStart: 1, + mechanism, + payload: new bson_1.Binary(bson_1.ByteUtils.concat([bson_1.ByteUtils.fromUTF8('n,,'), clientFirstMessageBare(username, nonce)])), + autoAuthorize: 1, + options: { skipEmptyExchange: true } + }; +} +async function executeScram(cryptoMethod, authContext) { + const { connection, credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + if (!authContext.nonce) { + throw new error_1.MongoInvalidArgumentError('AuthContext must contain a valid nonce property'); + } + const nonce = authContext.nonce; + const db = credentials.source; + const saslStartCmd = makeFirstMessage(cryptoMethod, credentials, nonce); + const response = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStartCmd, undefined); + await continueScramConversation(cryptoMethod, response, authContext); +} +async function continueScramConversation(cryptoMethod, response, authContext) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + if (!authContext.nonce) { + throw new error_1.MongoInvalidArgumentError('Unable to continue SCRAM without valid nonce'); + } + const nonce = authContext.nonce; + const db = credentials.source; + const username = cleanUsername(credentials.username); + const password = credentials.password; + const processedPassword = cryptoMethod === 'sha256' ? (0, saslprep_1.saslprep)(password) : passwordDigest(username, password); + const payload = bson_1.ByteUtils.isUint8Array(response.payload) + ? new bson_1.Binary(response.payload) + : response.payload; + const dict = parsePayload(payload); + const iterations = parseInt(dict.i, 10); + if (iterations && iterations < 4096) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError(`Server returned an invalid iteration count ${iterations}`); + } + const salt = dict.s; + const rnonce = dict.r; + if (rnonce.startsWith('nonce')) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError(`Server returned an invalid nonce: ${rnonce}`); + } + // Set up start of proof + const withoutProof = `c=biws,r=${rnonce}`; + const saltedPassword = await HI(processedPassword, bson_1.ByteUtils.fromBase64(salt), iterations, cryptoMethod); + const clientKey = await HMAC(cryptoMethod, saltedPassword, 'Client Key'); + const serverKey = await HMAC(cryptoMethod, saltedPassword, 'Server Key'); + const storedKey = await H(cryptoMethod, clientKey); + const firstMessageBytes = clientFirstMessageBare(username, nonce); + const firstMessage = bson_1.ByteUtils.toUTF8(firstMessageBytes, 0, firstMessageBytes.length, false); + const payloadString = bson_1.ByteUtils.toUTF8(payload.buffer, 0, payload.position, false); + const authMessage = [firstMessage, payloadString, withoutProof].join(','); + const clientSignature = await HMAC(cryptoMethod, storedKey, authMessage); + const clientProof = `p=${xor(clientKey, clientSignature)}`; + const clientFinal = [withoutProof, clientProof].join(','); + const serverSignature = await HMAC(cryptoMethod, serverKey, authMessage); + const saslContinueCmd = { + saslContinue: 1, + conversationId: response.conversationId, + payload: new bson_1.Binary(bson_1.ByteUtils.fromUTF8(clientFinal)) + }; + const r = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinueCmd, undefined); + const parsedResponse = parsePayload(r.payload); + if (!compareDigest(bson_1.ByteUtils.fromBase64(parsedResponse.v), serverSignature)) { + throw new error_1.MongoRuntimeError('Server returned an invalid signature'); + } + if (r.done !== false) { + // If the server sends r.done === true we can save one RTT + return; + } + const retrySaslContinueCmd = { + saslContinue: 1, + conversationId: r.conversationId, + payload: bson_1.ByteUtils.allocate(0) + }; + await connection.command((0, utils_1.ns)(`${db}.$cmd`), retrySaslContinueCmd, undefined); +} +function parsePayload(payload) { + const payloadStr = bson_1.ByteUtils.toUTF8(payload.buffer, 0, payload.position, false); + const dict = {}; + const parts = payloadStr.split(','); + for (let i = 0; i < parts.length; i++) { + const valueParts = (parts[i].match(/^([^=]*)=(.*)$/) ?? []).slice(1); + dict[valueParts[0]] = valueParts[1]; + } + return dict; +} +function passwordDigest(username, password) { + if (typeof username !== 'string') { + throw new error_1.MongoInvalidArgumentError('Username must be a string'); + } + if (typeof password !== 'string') { + throw new error_1.MongoInvalidArgumentError('Password must be a string'); + } + if (password.length === 0) { + throw new error_1.MongoInvalidArgumentError('Password cannot be empty'); + } + let nodeCrypto; + try { + // TODO: NODE-7424 - remove dependency on 'crypto' for SCRAM-SHA-1 authentication + // eslint-disable-next-line @typescript-eslint/no-require-imports + nodeCrypto = require('crypto'); + } + catch (e) { + throw new error_1.MongoRuntimeError('Node.js crypto module is required for SCRAM-SHA-1 authentication', { + cause: e + }); + } + try { + const md5 = nodeCrypto.createHash('md5'); + md5.update(`${username}:mongo:${password}`, 'utf8'); + return md5.digest('hex'); + } + catch (err) { + if (nodeCrypto.getFips()) { + // This error is (slightly) more helpful than what comes from OpenSSL directly, e.g. + // 'Error: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS' + throw new Error('Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode'); + } + throw err; + } +} +// XOR two buffers +function xor(a, b) { + const length = Math.max(a.length, b.length); + const res = []; + for (let i = 0; i < length; i += 1) { + res.push(a[i] ^ b[i]); + } + return bson_1.ByteUtils.toBase64(bson_1.ByteUtils.fromNumberArray(res)); +} +async function H(method, text) { + const buffer = await crypto.subtle.digest(method === 'sha256' ? 'SHA-256' : 'SHA-1', text); + return new Uint8Array(buffer); +} +async function HMAC(method, key, text) { + const keyBuffer = bson_1.ByteUtils.toLocalBufferType(key); + const cryptoKey = await crypto.subtle.importKey('raw', keyBuffer, { name: 'HMAC', hash: { name: method === 'sha256' ? 'SHA-256' : 'SHA-1' } }, false, ['sign', 'verify']); + const textData = typeof text === 'string' ? new TextEncoder().encode(text) : text; + const textBuffer = bson_1.ByteUtils.toLocalBufferType(textData); + const signature = await crypto.subtle.sign('HMAC', cryptoKey, textBuffer); + return new Uint8Array(signature); +} +let _hiCache = {}; +let _hiCacheCount = 0; +function _hiCachePurge() { + _hiCache = {}; + _hiCacheCount = 0; +} +const hiLengthMap = { + sha256: 32, + sha1: 20 +}; +async function HI(data, salt, iterations, cryptoMethod) { + // omit the work if already generated + const key = [data, bson_1.ByteUtils.toBase64(salt), iterations].join('_'); + if (_hiCache[key] != null) { + return _hiCache[key]; + } + const keyMaterial = await crypto.subtle.importKey('raw', new TextEncoder().encode(data), { name: 'PBKDF2' }, false, ['deriveBits']); + const params = { + name: 'PBKDF2', + salt: salt, + iterations: iterations, + hash: { name: cryptoMethod === 'sha256' ? 'SHA-256' : 'SHA-1' } + }; + const derivedBits = await crypto.subtle.deriveBits(params, keyMaterial, hiLengthMap[cryptoMethod] * 8); + const saltedData = new Uint8Array(derivedBits); + // cache a copy to speed up the next lookup, but prevent unbounded cache growth + if (_hiCacheCount >= 200) { + _hiCachePurge(); + } + _hiCache[key] = saltedData; + _hiCacheCount += 1; + return saltedData; +} +function compareDigest(lhs, rhs) { + if (lhs.length !== rhs.length) { + return false; + } + let result = 0; + for (let i = 0; i < lhs.length; i++) { + result |= lhs[i] ^ rhs[i]; + } + return result === 0; +} +class ScramSHA1 extends ScramSHA { + constructor() { + super('sha1'); + } +} +exports.ScramSHA1 = ScramSHA1; +class ScramSHA256 extends ScramSHA { + constructor() { + super('sha256'); + } +} +exports.ScramSHA256 = ScramSHA256; +//# sourceMappingURL=scram.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js.map new file mode 100644 index 00000000..5db25aea --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/scram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scram.js","sourceRoot":"","sources":["../../../src/cmap/auth/scram.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAEhD,qCAA8D;AAC9D,uCAIqB;AACrB,uCAA8C;AAE9C,mDAAiE;AAEjE,2CAA4C;AAI5C,MAAM,QAAS,SAAQ,4BAAY;IAGjC,YAAY,YAA0B;QACpC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,MAAM,CAAC;IAC7C,CAAC;IAEQ,KAAK,CAAC,OAAO,CACpB,YAA+B,EAC/B,WAAwB;QAExB,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACvC,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAC5C,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC;QAClF,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAW,EAAC,EAAE,CAAC,CAAC;QACpC,gCAAgC;QAChC,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;QAE1B,MAAM,OAAO,GAAG;YACd,GAAG,YAAY;YACf,uBAAuB,EAAE;gBACvB,GAAG,gBAAgB,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC;gBACrD,EAAE,EAAE,WAAW,CAAC,MAAM;aACvB;SACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,WAAwB;QAC1C,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;QACnD,IAAI,QAAQ,EAAE,uBAAuB,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3D,OAAO,MA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,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE;KAChE,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAChD,MAAM,EACN,WAAW,EACX,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAC9B,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IAE/C,+EAA+E;IAC/E,IAAI,aAAa,IAAI,GAAG,EAAE,CAAC;QACzB,aAAa,EAAE,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;IAC3B,aAAa,IAAI,CAAC,CAAC;IACnB,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,aAAa,CAAC,GAAe,EAAE,GAAe;IACrD,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,MAAM,KAAK,CAAC,CAAC;AACtB,CAAC;AAED,MAAa,SAAU,SAAQ,QAAQ;IACrC;QACE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF;AAJD,8BAIC;AAED,MAAa,WAAY,SAAQ,QAAQ;IACvC;QACE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;CACF;AAJD,kCAIC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js new file mode 100644 index 00000000..6f431c49 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.X509 = void 0; +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +class X509 extends auth_provider_1.AuthProvider { + async prepare(handshakeDoc, authContext) { + const { credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + return { ...handshakeDoc, speculativeAuthenticate: x509AuthenticateCommand(credentials) }; + } + async auth(authContext) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + const response = authContext.response; + if (response?.speculativeAuthenticate) { + return; + } + await connection.command((0, utils_1.ns)('$external.$cmd'), x509AuthenticateCommand(credentials), undefined); + } +} +exports.X509 = X509; +function x509AuthenticateCommand(credentials) { + const command = { authenticate: 1, mechanism: 'MONGODB-X509' }; + if (credentials.username) { + command.user = credentials.username; + } + return command; +} +//# sourceMappingURL=x509.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js.map new file mode 100644 index 00000000..bdaf1966 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/auth/x509.js.map @@ -0,0 +1 @@ +{"version":3,"file":"x509.js","sourceRoot":"","sources":["../../../src/cmap/auth/x509.ts"],"names":[],"mappings":";;;AACA,uCAA2D;AAC3D,uCAAiC;AAEjC,mDAAiE;AAGjE,MAAa,IAAK,SAAQ,4BAAY;IAC3B,KAAK,CAAC,OAAO,CACpB,YAA+B,EAC/B,WAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QACpC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC;QAClF,CAAC;QACD,OAAO,EAAE,GAAG,YAAY,EAAE,uBAAuB,EAAE,uBAAuB,CAAC,WAAW,CAAC,EAAE,CAAC;IAC5F,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,WAAwB;QAC1C,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;QAC1C,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAC5C,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC;QAClF,CAAC;QACD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;QAEtC,IAAI,QAAQ,EAAE,uBAAuB,EAAE,CAAC;YACtC,OAAO;QACT,CAAC;QAED,MAAM,UAAU,CAAC,OAAO,CAAC,IAAA,UAAE,EAAC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC;IAClG,CAAC;CACF;AA1BD,oBA0BC;AAED,SAAS,uBAAuB,CAAC,WAA6B;IAC5D,MAAM,OAAO,GAAa,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;IACzE,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js new file mode 100644 index 00000000..a99e6097 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js @@ -0,0 +1,222 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SENSITIVE_COMMANDS = exports.CommandFailedEvent = exports.CommandSucceededEvent = exports.CommandStartedEvent = void 0; +const constants_1 = require("../constants"); +const utils_1 = require("../utils"); +const commands_1 = require("./commands"); +/** + * An event indicating the start of a given command + * @public + * @category Event + */ +class CommandStartedEvent { + /** + * Create a started event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + */ + constructor(connection, command, serverConnectionId) { + /** @internal */ + this.name = constants_1.COMMAND_STARTED; + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + // TODO: remove in major revision, this is not spec behavior + if (exports.SENSITIVE_COMMANDS.has(commandName)) { + this.commandObj = {}; + this.commandObj[commandName] = true; + } + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.databaseName = command.databaseName; + this.commandName = commandName; + this.command = maybeRedact(commandName, cmd, cmd); + this.serverConnectionId = serverConnectionId; + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } +} +exports.CommandStartedEvent = CommandStartedEvent; +/** + * An event indicating the success of a given command + * @public + * @category Event + */ +class CommandSucceededEvent { + /** + * Create a succeeded event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param reply - the reply for this command from the server + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor(connection, command, reply, started, serverConnectionId) { + /** @internal */ + this.name = constants_1.COMMAND_SUCCEEDED; + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = (0, utils_1.calculateDurationInMs)(started); + this.reply = maybeRedact(commandName, cmd, extractReply(reply)); + this.serverConnectionId = serverConnectionId; + this.databaseName = command.databaseName; + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } +} +exports.CommandSucceededEvent = CommandSucceededEvent; +/** + * An event indicating the failure of a given command + * @public + * @category Event + */ +class CommandFailedEvent { + /** + * Create a failure event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param error - the generated error or a server error response + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor(connection, command, error, started, serverConnectionId) { + /** @internal */ + this.name = constants_1.COMMAND_FAILED; + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = (0, utils_1.calculateDurationInMs)(started); + this.failure = maybeRedact(commandName, cmd, error); + this.serverConnectionId = serverConnectionId; + this.databaseName = command.databaseName; + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } +} +exports.CommandFailedEvent = CommandFailedEvent; +/** + * Commands that we want to redact because of the sensitive nature of their contents + * @internal + */ +exports.SENSITIVE_COMMANDS = new Set([ + 'authenticate', + 'saslStart', + 'saslContinue', + 'getnonce', + 'createUser', + 'updateUser', + 'copydbgetnonce', + 'copydbsaslstart', + 'copydb' +]); +const HELLO_COMMANDS = new Set(['hello', constants_1.LEGACY_HELLO_COMMAND, constants_1.LEGACY_HELLO_COMMAND_CAMEL_CASE]); +// helper methods +const extractCommandName = (commandDoc) => Object.keys(commandDoc)[0]; +const collectionName = (command) => command.ns.split('.')[1]; +const maybeRedact = (commandName, commandDoc, result) => exports.SENSITIVE_COMMANDS.has(commandName) || + (HELLO_COMMANDS.has(commandName) && commandDoc.speculativeAuthenticate) + ? {} + : result; +const LEGACY_FIND_QUERY_MAP = { + $query: 'filter', + $orderby: 'sort', + $hint: 'hint', + $comment: 'comment', + $maxScan: 'maxScan', + $max: 'max', + $min: 'min', + $returnKey: 'returnKey', + $showDiskLoc: 'showRecordId', + $maxTimeMS: 'maxTimeMS', + $snapshot: 'snapshot' +}; +const LEGACY_FIND_OPTIONS_MAP = { + numberToSkip: 'skip', + numberToReturn: 'batchSize', + returnFieldSelector: 'projection' +}; +/** Extract the actual command from the query, possibly up-converting if it's a legacy format */ +function extractCommand(command) { + if (command instanceof commands_1.OpMsgRequest) { + const cmd = { ...command.command }; + // For OP_MSG payload type 1, replace any document-sequence field with its + // documents array for monitoring (ops, nsInfo, documents, updates, deletes). + for (const key of Object.keys(cmd)) { + if (cmd[key] instanceof commands_1.DocumentSequence) { + cmd[key] = cmd[key].documents; + } + } + return cmd; + } + if (command.query?.$query) { + let result; + if (command.ns === 'admin.$cmd') { + // up-convert legacy command + result = Object.assign({}, command.query.$query); + } + else { + // up-convert legacy find command + result = { find: collectionName(command) }; + Object.keys(LEGACY_FIND_QUERY_MAP).forEach(key => { + if (command.query[key] != null) { + result[LEGACY_FIND_QUERY_MAP[key]] = { ...command.query[key] }; + } + }); + } + Object.keys(LEGACY_FIND_OPTIONS_MAP).forEach(key => { + const legacyKey = key; + if (command[legacyKey] != null) { + result[LEGACY_FIND_OPTIONS_MAP[legacyKey]] = command[legacyKey]; + } + }); + return result; + } + let clonedQuery = {}; + const clonedCommand = { ...command }; + if (command.query) { + clonedQuery = { ...command.query }; + clonedCommand.query = clonedQuery; + } + return command.query ? clonedQuery : clonedCommand; +} +function extractReply(reply) { + if (!reply) { + return reply; + } + return reply.result ? reply.result : reply; +} +function extractConnectionDetails(connection) { + let connectionId; + if ('id' in connection) { + connectionId = connection.id; + } + return { + address: connection.address, + serviceId: connection.serviceId, + connectionId + }; +} +//# sourceMappingURL=command_monitoring_events.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map new file mode 100644 index 00000000..e3dee461 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"command_monitoring_events.js","sourceRoot":"","sources":["../../src/cmap/command_monitoring_events.ts"],"names":[],"mappings":";;;AACA,4CAMsB;AACtB,oCAAiD;AACjD,yCAKoB;AAGpB;;;;GAIG;AACH,MAAa,mBAAmB;IAmB9B;;;;;;OAMG;IACH,YACE,UAAsB,EACtB,OAAiC,EACjC,kBAAiC;QAbnC,gBAAgB;QAChB,SAAI,GAAG,2BAAe,CAAC;QAcrB,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;QAElF,4DAA4D;QAC5D,IAAI,0BAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;QACtC,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,eAAe;IACf,IAAI,YAAY;QACd,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;CACF;AAv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G,WAAW,CAAC;IACpC,CAAC;IAED,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC;AACrD,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB;IACpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7C,CAAC;AAED,SAAS,wBAAwB,CAAC,UAAsB;IACtD,IAAI,YAAY,CAAC;IACjB,IAAI,IAAI,IAAI,UAAU,EAAE,CAAC;QACvB,YAAY,GAAG,UAAU,CAAC,EAAE,CAAC;IAC/B,CAAC;IACD,OAAO;QACL,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,YAAY;KACb,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js new file mode 100644 index 00000000..a395260f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js @@ -0,0 +1,555 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OpCompressedRequest = exports.OpMsgResponse = exports.OpMsgRequest = exports.DocumentSequence = exports.OpReply = exports.OpQueryRequest = void 0; +exports.makeDocumentSequence = makeDocumentSequence; +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const compression_1 = require("./wire_protocol/compression"); +const constants_1 = require("./wire_protocol/constants"); +// Incrementing request id +let _requestId = 0; +// Query flags +const OPTS_TAILABLE_CURSOR = 2; +const OPTS_SECONDARY = 4; +const OPTS_OPLOG_REPLAY = 8; +const OPTS_NO_CURSOR_TIMEOUT = 16; +const OPTS_AWAIT_DATA = 32; +const OPTS_EXHAUST = 64; +const OPTS_PARTIAL = 128; +// Response flags +const CURSOR_NOT_FOUND = 1; +const QUERY_FAILURE = 2; +const SHARD_CONFIG_STALE = 4; +const AWAIT_CAPABLE = 8; +const encodeUTF8Into = bson_1.ByteUtils.encodeUTF8Into; +/** @internal */ +class OpQueryRequest { + constructor(databaseName, query, options) { + /** moreToCome is an OP_MSG only concept */ + this.moreToCome = false; + // Basic options needed to be passed in + // TODO(NODE-3483): Replace with MongoCommandError + const ns = `${databaseName}.$cmd`; + if (typeof databaseName !== 'string') { + throw new error_1.MongoRuntimeError('Database name must be a string for a query'); + } + // TODO(NODE-3483): Replace with MongoCommandError + if (query == null) + throw new error_1.MongoRuntimeError('A query document must be specified for query'); + // Validate that we are not passing 0x00 in the collection name + if (ns.indexOf('\x00') !== -1) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new error_1.MongoRuntimeError('Namespace cannot contain a null character'); + } + // Basic optionsa + this.databaseName = databaseName; + this.query = query; + this.ns = ns; + // Additional options + this.numberToSkip = options.numberToSkip || 0; + this.numberToReturn = options.numberToReturn || 0; + this.returnFieldSelector = options.returnFieldSelector || undefined; + this.requestId = options.requestId ?? OpQueryRequest.getRequestId(); + // special case for pre-3.2 find commands, delete ASAP + this.pre32Limit = options.pre32Limit; + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.batchSize = this.numberToReturn; + // Flags + this.tailable = false; + this.secondaryOk = typeof options.secondaryOk === 'boolean' ? options.secondaryOk : false; + this.oplogReplay = false; + this.noCursorTimeout = false; + this.awaitData = false; + this.exhaust = false; + this.partial = false; + } + /** Assign next request Id. */ + incRequestId() { + this.requestId = _requestId++; + } + /** Peek next request Id. */ + nextRequestId() { + return _requestId + 1; + } + /** Increment then return next request Id. */ + static getRequestId() { + return ++_requestId; + } + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin() { + const buffers = []; + let projection = null; + // Set up the flags + let flags = 0; + if (this.tailable) { + flags |= OPTS_TAILABLE_CURSOR; + } + if (this.secondaryOk) { + flags |= OPTS_SECONDARY; + } + if (this.oplogReplay) { + flags |= OPTS_OPLOG_REPLAY; + } + if (this.noCursorTimeout) { + flags |= OPTS_NO_CURSOR_TIMEOUT; + } + if (this.awaitData) { + flags |= OPTS_AWAIT_DATA; + } + if (this.exhaust) { + flags |= OPTS_EXHAUST; + } + if (this.partial) { + flags |= OPTS_PARTIAL; + } + // If batchSize is different to this.numberToReturn + if (this.batchSize !== this.numberToReturn) + this.numberToReturn = this.batchSize; + // Allocate write protocol header buffer + const header = bson_1.ByteUtils.allocate(4 * 4 + // Header + 4 + // Flags + bson_1.ByteUtils.utf8ByteLength(this.ns) + + 1 + // namespace + 4 + // numberToSkip + 4 // numberToReturn + ); + // Add header to buffers + buffers.push(header); + // Serialize the query + const query = bson_1.BSON.serialize(this.query, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + // Add query document + buffers.push(query); + if (this.returnFieldSelector && Object.keys(this.returnFieldSelector).length > 0) { + // Serialize the projection document + projection = bson_1.BSON.serialize(this.returnFieldSelector, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + // Add projection document + buffers.push(projection); + } + // Total message size + const totalLength = header.length + query.length + (projection ? projection.length : 0); + // Set up the index + let index = 4; + // Write total document length + header[3] = (totalLength >> 24) & 0xff; + header[2] = (totalLength >> 16) & 0xff; + header[1] = (totalLength >> 8) & 0xff; + header[0] = totalLength & 0xff; + // Write header information requestId + header[index + 3] = (this.requestId >> 24) & 0xff; + header[index + 2] = (this.requestId >> 16) & 0xff; + header[index + 1] = (this.requestId >> 8) & 0xff; + header[index] = this.requestId & 0xff; + index = index + 4; + // Write header information responseTo + header[index + 3] = (0 >> 24) & 0xff; + header[index + 2] = (0 >> 16) & 0xff; + header[index + 1] = (0 >> 8) & 0xff; + header[index] = 0 & 0xff; + index = index + 4; + // Write header information OP_QUERY + header[index + 3] = (constants_1.OP_QUERY >> 24) & 0xff; + header[index + 2] = (constants_1.OP_QUERY >> 16) & 0xff; + header[index + 1] = (constants_1.OP_QUERY >> 8) & 0xff; + header[index] = constants_1.OP_QUERY & 0xff; + index = index + 4; + // Write header information flags + header[index + 3] = (flags >> 24) & 0xff; + header[index + 2] = (flags >> 16) & 0xff; + header[index + 1] = (flags >> 8) & 0xff; + header[index] = flags & 0xff; + index = index + 4; + // Write collection name + index = index + encodeUTF8Into(header, this.ns, index) + 1; + header[index - 1] = 0; + // Write header information flags numberToSkip + header[index + 3] = (this.numberToSkip >> 24) & 0xff; + header[index + 2] = (this.numberToSkip >> 16) & 0xff; + header[index + 1] = (this.numberToSkip >> 8) & 0xff; + header[index] = this.numberToSkip & 0xff; + index = index + 4; + // Write header information flags numberToReturn + header[index + 3] = (this.numberToReturn >> 24) & 0xff; + header[index + 2] = (this.numberToReturn >> 16) & 0xff; + header[index + 1] = (this.numberToReturn >> 8) & 0xff; + header[index] = this.numberToReturn & 0xff; + index = index + 4; + // Return the buffers + return buffers; + } +} +exports.OpQueryRequest = OpQueryRequest; +/** @internal */ +class OpReply { + constructor(message, msgHeader, msgBody, opts) { + this.index = 0; + this.sections = []; + /** moreToCome is an OP_MSG only concept */ + this.moreToCome = false; + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts ?? { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + // Flag values + this.useBigInt64 = typeof this.opts.useBigInt64 === 'boolean' ? this.opts.useBigInt64 : false; + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + } + isParsed() { + return this.parsed; + } + parse() { + // Don't parse again if not needed + if (this.parsed) + return this.sections[0]; + // Position within OP_REPLY at which documents start + // (See https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#wire-op-reply) + this.index = 20; + // Read the message body + this.responseFlags = (0, bson_1.readInt32LE)(this.data, 0); + this.cursorId = new bson_1.BSON.Long((0, bson_1.readInt32LE)(this.data, 4), (0, bson_1.readInt32LE)(this.data, 8)); + this.startingFrom = (0, bson_1.readInt32LE)(this.data, 12); + this.numberReturned = (0, bson_1.readInt32LE)(this.data, 16); + if (this.numberReturned < 0 || this.numberReturned > 2 ** 32 - 1) { + throw new RangeError(`OP_REPLY numberReturned is an invalid array length ${this.numberReturned}`); + } + this.cursorNotFound = (this.responseFlags & CURSOR_NOT_FOUND) !== 0; + this.queryFailure = (this.responseFlags & QUERY_FAILURE) !== 0; + this.shardConfigStale = (this.responseFlags & SHARD_CONFIG_STALE) !== 0; + this.awaitCapable = (this.responseFlags & AWAIT_CAPABLE) !== 0; + // Parse Body + for (let i = 0; i < this.numberReturned; i++) { + const bsonSize = this.data[this.index] | + (this.data[this.index + 1] << 8) | + (this.data[this.index + 2] << 16) | + (this.data[this.index + 3] << 24); + const section = this.data.subarray(this.index, this.index + bsonSize); + this.sections.push(section); + // Adjust the index + this.index = this.index + bsonSize; + } + // Set parsed + this.parsed = true; + return this.sections[0]; + } +} +exports.OpReply = OpReply; +// Msg Flags +const OPTS_CHECKSUM_PRESENT = 1; +const OPTS_MORE_TO_COME = 2; +const OPTS_EXHAUST_ALLOWED = 1 << 16; +/** @internal */ +class DocumentSequence { + /** + * Create a new document sequence for the provided field. + * @param field - The field it will replace. + */ + constructor(field, documents) { + this.field = field; + this.documents = []; + this.chunks = []; + this.serializedDocumentsLength = 0; + // Document sequences starts with type 1 at the first byte. + // Field strings must always be UTF-8. + const buffer = bson_1.ByteUtils.allocateUnsafe(1 + 4 + this.field.length + 1); + buffer[0] = 1; + // Third part is the field name at offset 5 with trailing null byte. + encodeUTF8Into(buffer, `${this.field}\0`, 5); + this.chunks.push(buffer); + this.header = buffer; + if (documents) { + for (const doc of documents) { + this.push(doc, bson_1.BSON.serialize(doc)); + } + } + } + /** + * Push a document to the document sequence. Will serialize the document + * as well and return the current serialized length of all documents. + * @param document - The document to add. + * @param buffer - The serialized document in raw BSON. + * @returns The new total document sequence length. + */ + push(document, buffer) { + this.serializedDocumentsLength += buffer.length; + // Push the document. + this.documents.push(document); + // Push the document raw bson. + this.chunks.push(buffer); + // Write the new length. + if (this.header) { + bson_1.NumberUtils.setInt32LE(this.header, 1, 4 + this.field.length + 1 + this.serializedDocumentsLength); + } + return this.serializedDocumentsLength + this.header.length; + } + /** + * Get the fully serialized bytes for the document sequence section. + * @returns The section bytes. + */ + toBin() { + return bson_1.ByteUtils.concat(this.chunks); + } +} +exports.DocumentSequence = DocumentSequence; +/** + * Build a DocumentSequence from documents that have already been serialized, + * reusing the provided buffers instead of re-serializing. + * @internal + */ +function makeDocumentSequence(field, documents, serialized) { + const sequence = new DocumentSequence(field); + for (let i = 0; i < documents.length; i++) { + sequence.push(documents[i], serialized[i]); + } + return sequence; +} +/** @internal */ +class OpMsgRequest { + constructor(databaseName, command, options) { + // Basic options needed to be passed in + if (command == null) + throw new error_1.MongoInvalidArgumentError('Query document must be specified for query'); + // Basic optionsa + this.databaseName = databaseName; + this.command = command; + this.command.$db = databaseName; + // Ensure empty options + this.options = options ?? {}; + // Additional options + this.requestId = options.requestId ? options.requestId : OpMsgRequest.getRequestId(); + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + // flags + this.checksumPresent = false; + this.moreToCome = options.moreToCome ?? command.writeConcern?.w === 0; + this.exhaustAllowed = + typeof options.exhaustAllowed === 'boolean' ? options.exhaustAllowed : false; + } + toBin() { + const buffers = []; + let flags = 0; + if (this.checksumPresent) { + flags |= OPTS_CHECKSUM_PRESENT; + } + if (this.moreToCome) { + flags |= OPTS_MORE_TO_COME; + } + if (this.exhaustAllowed) { + flags |= OPTS_EXHAUST_ALLOWED; + } + const header = bson_1.ByteUtils.allocate(4 * 4 + // Header + 4 // Flags + ); + buffers.push(header); + let totalLength = header.length; + const command = this.command; + totalLength += this.makeSections(buffers, command); + bson_1.NumberUtils.setInt32LE(header, 0, totalLength); // messageLength + bson_1.NumberUtils.setInt32LE(header, 4, this.requestId); // requestID + bson_1.NumberUtils.setInt32LE(header, 8, 0); // responseTo + bson_1.NumberUtils.setInt32LE(header, 12, constants_1.OP_MSG); // opCode + // The OP_MSG spec calls out that flags is uint32: + // https://github.com/mongodb/specifications/blob/master/source/message/OP_MSG.md#op_msg-1 + (0, bson_1.setUint32LE)(header, 16, flags); // flags + return buffers; + } + /** + * Add the sections to the OP_MSG request's buffers and returns the length. + */ + makeSections(buffers, document) { + const sequencesBuffer = this.extractDocumentSequences(document); + const payloadTypeBuffer = bson_1.ByteUtils.allocateUnsafe(1); + payloadTypeBuffer[0] = 0; + const documentBuffer = this.serializeBson(document); + // First section, type 0 + buffers.push(payloadTypeBuffer); + buffers.push(documentBuffer); + // Subsequent sections, type 1 + buffers.push(sequencesBuffer); + return payloadTypeBuffer.length + documentBuffer.length + sequencesBuffer.length; + } + /** + * Extracts the document sequences from the command document and returns + * a buffer to be added as multiple sections after the initial type 0 + * section in the message. + */ + extractDocumentSequences(document) { + // Pull out any field in the command document that's value is a document sequence. + const chunks = []; + for (const [key, value] of Object.entries(document)) { + if (value instanceof DocumentSequence) { + chunks.push(value.toBin()); + // Why are we removing the field from the command? This is because it needs to be + // removed in the OP_MSG request first section, and DocumentSequence is not a + // BSON type and is specific to the MongoDB wire protocol so there's nothing + // our BSON serializer can do about this. Since DocumentSequence is not exposed + // in the public API and only used internally, we are never mutating an original + // command provided by the user, just our own, and it's cheaper to delete from + // our own command than copying it. + delete document[key]; + } + } + if (chunks.length > 0) { + return bson_1.ByteUtils.concat(chunks); + } + // If we have no document sequences we return an empty buffer for nothing to add + // to the payload. + return bson_1.ByteUtils.allocate(0); + } + serializeBson(document) { + return bson_1.BSON.serialize(document, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + } + static getRequestId() { + _requestId = (_requestId + 1) & 0x7fffffff; + return _requestId; + } +} +exports.OpMsgRequest = OpMsgRequest; +/** @internal */ +class OpMsgResponse { + constructor(message, msgHeader, msgBody, opts) { + this.index = 0; + this.sections = []; + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts ?? { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + // Read response flags + this.responseFlags = (0, bson_1.readInt32LE)(msgBody, 0); + this.checksumPresent = (this.responseFlags & OPTS_CHECKSUM_PRESENT) !== 0; + this.moreToCome = (this.responseFlags & OPTS_MORE_TO_COME) !== 0; + this.exhaustAllowed = (this.responseFlags & OPTS_EXHAUST_ALLOWED) !== 0; + this.useBigInt64 = typeof this.opts.useBigInt64 === 'boolean' ? this.opts.useBigInt64 : false; + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + } + isParsed() { + return this.parsed; + } + parse() { + // Don't parse again if not needed + if (this.parsed) + return this.sections[0]; + this.index = 4; + while (this.index < this.data.length) { + const payloadType = this.data[this.index++]; + if (payloadType === 0) { + // BSON spec specifies that this is a 32-bit signed integer: https://bsonspec.org/spec.html#:~:text=%3A%3A%3D-,int32,-e_list%20unsigned_byte(0 + // While allowing negative sizes seems odd, in practice we never expect a negative size. Also, the server's 16mb limit for BSON documents leaves plenty + // of room in an int32 to store a document of the max BSON size that the server supports + const bsonSize = (0, bson_1.readInt32LE)(this.data, this.index); + const bin = this.data.subarray(this.index, this.index + bsonSize); + this.sections.push(bin); + this.index += bsonSize; + } + else if (payloadType === 1) { + // It was decided that no driver makes use of payload type 1 + // TODO(NODE-3483): Replace with MongoDeprecationError + throw new error_1.MongoRuntimeError('OP_MSG Payload Type 1 detected unsupported protocol'); + } + } + this.parsed = true; + return this.sections[0]; + } +} +exports.OpMsgResponse = OpMsgResponse; +const MESSAGE_HEADER_SIZE = 16; +const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compressorID +/** + * @internal + * + * An OP_COMPRESSED request wraps either an OP_QUERY or OP_MSG message. + */ +class OpCompressedRequest { + constructor(command, options) { + this.command = command; + this.options = { + zlibCompressionLevel: options.zlibCompressionLevel, + agreedCompressor: options.agreedCompressor + }; + } + // Return whether a command contains an uncompressible command term + // Will return true if command contains no uncompressible command terms + static canCompress(command) { + const commandDoc = command instanceof OpMsgRequest ? command.command : command.query; + const commandName = Object.keys(commandDoc)[0]; + return !compression_1.uncompressibleCommands.has(commandName); + } + async toBin() { + const concatenatedOriginalCommandBuffer = bson_1.ByteUtils.concat(this.command.toBin()); + // otherwise, compress the message + const messageToBeCompressed = concatenatedOriginalCommandBuffer.slice(MESSAGE_HEADER_SIZE); + // Extract information needed for OP_COMPRESSED from the uncompressed message + const originalCommandOpCode = (0, bson_1.readInt32LE)(concatenatedOriginalCommandBuffer, 12); + // Compress the message body + const compressedMessage = await (0, compression_1.compress)(this.options, messageToBeCompressed); + // Create the msgHeader of OP_COMPRESSED + const msgHeader = bson_1.ByteUtils.allocate(MESSAGE_HEADER_SIZE); + bson_1.NumberUtils.setInt32LE(msgHeader, 0, MESSAGE_HEADER_SIZE + COMPRESSION_DETAILS_SIZE + compressedMessage.length); // messageLength + bson_1.NumberUtils.setInt32LE(msgHeader, 4, this.command.requestId); // requestID + bson_1.NumberUtils.setInt32LE(msgHeader, 8, 0); // responseTo (zero) + bson_1.NumberUtils.setInt32LE(msgHeader, 12, constants_1.OP_COMPRESSED); // opCode + // Create the compression details of OP_COMPRESSED + const compressionDetails = bson_1.ByteUtils.allocate(COMPRESSION_DETAILS_SIZE); + bson_1.NumberUtils.setInt32LE(compressionDetails, 0, originalCommandOpCode); // originalOpcode + bson_1.NumberUtils.setInt32LE(compressionDetails, 4, messageToBeCompressed.length); // Size of the uncompressed compressedMessage, excluding the MsgHeader + compressionDetails[8] = compression_1.Compressor[this.options.agreedCompressor]; // compressorID + return [msgHeader, compressionDetails, compressedMessage]; + } +} +exports.OpCompressedRequest = OpCompressedRequest; +//# sourceMappingURL=commands.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js.map new file mode 100644 index 00000000..2d99f794 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/commands.js.map @@ -0,0 +1 @@ +{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cmap/commands.ts"],"names":[],"mappings":";;;AA2fA,oDAUC;AArgBD,kCASiB;AACjB,oCAAwE;AAIxE,6D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/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js new file mode 100644 index 00000000..bcc4932d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js @@ -0,0 +1,398 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LEGAL_TCP_SOCKET_OPTIONS = exports.LEGAL_TLS_SOCKET_OPTIONS = exports.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS = void 0; +exports.connect = connect; +exports.makeConnection = makeConnection; +exports.performInitialHandshake = performInitialHandshake; +exports.prepareHandshakeDocument = prepareHandshakeDocument; +exports.makeSocket = makeSocket; +const net = require("net"); +const tls = require("tls"); +const constants_1 = require("../constants"); +const deps_1 = require("../deps"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const auth_provider_1 = require("./auth/auth_provider"); +const providers_1 = require("./auth/providers"); +const connection_1 = require("./connection"); +const constants_2 = require("./wire_protocol/constants"); +function applyBackpressureLabels(error) { + error.addErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError); + error.addErrorLabel(error_1.MongoErrorLabel.RetryableError); +} +async function connect(options) { + let connection = null; + try { + const socket = await makeSocket(options); + connection = makeConnection(options, socket); + await performInitialHandshake(connection, options); + return connection; + } + catch (error) { + connection?.destroy(); + throw error; + } +} +function makeConnection(options, socket) { + let ConnectionType = options.connectionType ?? connection_1.Connection; + if (options.autoEncrypter) { + ConnectionType = connection_1.CryptoConnection; + } + return new ConnectionType(socket, options); +} +function checkSupportedServer(hello, options) { + const maxWireVersion = Number(hello.maxWireVersion); + const minWireVersion = Number(hello.minWireVersion); + const serverVersionHighEnough = !Number.isNaN(maxWireVersion) && maxWireVersion >= constants_2.MIN_SUPPORTED_WIRE_VERSION; + const serverVersionLowEnough = !Number.isNaN(minWireVersion) && minWireVersion <= constants_2.MAX_SUPPORTED_WIRE_VERSION; + if (serverVersionHighEnough) { + if (serverVersionLowEnough) { + return null; + } + const message = `Server at ${options.hostAddress} reports minimum wire version ${JSON.stringify(hello.minWireVersion)}, but this version of the Node.js Driver requires at most ${constants_2.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${constants_2.MAX_SUPPORTED_SERVER_VERSION})`; + return new error_1.MongoCompatibilityError(message); + } + const message = `Server at ${options.hostAddress} reports maximum wire version ${JSON.stringify(hello.maxWireVersion) ?? 0}, but this version of the Node.js Driver requires at least ${constants_2.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${constants_2.MIN_SUPPORTED_SERVER_VERSION})`; + return new error_1.MongoCompatibilityError(message); +} +async function performInitialHandshake(conn, options) { + const credentials = options.credentials; + if (credentials) { + if (!(credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT) && + !options.authProviders.getOrCreateProvider(credentials.mechanism, credentials.mechanismProperties)) { + throw new error_1.MongoInvalidArgumentError(`AuthMechanism '${credentials.mechanism}' not supported`); + } + } + const authContext = new auth_provider_1.AuthContext(conn, credentials, options); + conn.authContext = authContext; + // If we encounter an error preparing the handshake document, do NOT apply backpressure labels. Errors + // encountered building the handshake document are all client-side, and do not indicate an overloaded server. + const handshakeDoc = await prepareHandshakeDocument(authContext); + // @ts-expect-error: TODO(NODE-5141): The options need to be filtered properly, Connection options differ from Command options + const handshakeOptions = { ...options, raw: false }; + if (typeof options.connectTimeoutMS === 'number') { + // The handshake technically is a monitoring check, so its socket timeout should be connectTimeoutMS + handshakeOptions.socketTimeoutMS = options.connectTimeoutMS; + } + const start = new Date().getTime(); + const response = await executeHandshake(handshakeDoc, handshakeOptions); + if (!('isWritablePrimary' in response)) { + // Provide hello-style response document. + response.isWritablePrimary = response[constants_1.LEGACY_HELLO_COMMAND]; + } + if (response.helloOk) { + conn.helloOk = true; + } + const supportedServerErr = checkSupportedServer(response, options); + if (supportedServerErr) { + throw supportedServerErr; + } + if (options.loadBalanced) { + if (!response.serviceId) { + throw new error_1.MongoCompatibilityError('Driver attempted to initialize in load balancing mode, ' + + 'but the server does not support this mode.'); + } + } + // NOTE: This is metadata attached to the connection while porting away from + // handshake being done in the `Server` class. Likely, it should be + // relocated, or at very least restructured. + conn.hello = response; + conn.lastHelloMS = new Date().getTime() - start; + if (!response.arbiterOnly && credentials) { + // store the response on auth context + authContext.response = response; + const resolvedCredentials = credentials.resolveAuthMechanism(response); + const provider = options.authProviders.getOrCreateProvider(resolvedCredentials.mechanism, resolvedCredentials.mechanismProperties); + if (!provider) { + throw new error_1.MongoInvalidArgumentError(`No AuthProvider for ${resolvedCredentials.mechanism} defined.`); + } + try { + await provider.auth(authContext); + } + catch (error) { + // NOTE: If we encounter an error authenticating a connection, do NOT apply backpressure labels. + if (error instanceof error_1.MongoError) { + error.addErrorLabel(error_1.MongoErrorLabel.HandshakeError); + if ((0, error_1.needsRetryableWriteLabel)(error)) { + error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + } + throw error; + } + } + // Connection establishment is socket creation (tcp handshake, tls handshake, MongoDB handshake (saslStart, saslContinue)) + // Once connection is established, command logging can log events (if enabled) + conn.established = true; + async function executeHandshake(handshakeDoc, handshakeOptions) { + try { + const handshakeResponse = await conn.command((0, utils_1.ns)('admin.$cmd'), handshakeDoc, handshakeOptions); + return handshakeResponse; + } + catch (error) { + if (error instanceof error_1.MongoError) { + error.addErrorLabel(error_1.MongoErrorLabel.HandshakeError); + } + // If we encounter a network error executing the initial handshake, apply backpressure labels. + if (error instanceof error_1.MongoNetworkError) { + applyBackpressureLabels(error); + } + throw error; + } + } +} +/** + * @internal + * + * This function is only exposed for testing purposes. + */ +async function prepareHandshakeDocument(authContext) { + const options = authContext.options; + const compressors = options.compressors ? options.compressors : []; + const { serverApi } = authContext.connection; + const clientMetadata = await options.metadata; + const handshakeDoc = { + [serverApi?.version || options.loadBalanced === true ? 'hello' : constants_1.LEGACY_HELLO_COMMAND]: 1, + backpressure: '2', + helloOk: true, + client: clientMetadata, + compression: compressors + }; + if (options.loadBalanced === true) { + handshakeDoc.loadBalanced = true; + } + const credentials = authContext.credentials; + if (credentials) { + if (credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT && credentials.username) { + handshakeDoc.saslSupportedMechs = `${credentials.source}.${credentials.username}`; + const provider = authContext.options.authProviders.getOrCreateProvider(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256, credentials.mechanismProperties); + if (!provider) { + // This auth mechanism is always present. + throw new error_1.MongoInvalidArgumentError(`No AuthProvider for ${providers_1.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`); + } + return await provider.prepare(handshakeDoc, authContext); + } + const provider = authContext.options.authProviders.getOrCreateProvider(credentials.mechanism, credentials.mechanismProperties); + if (!provider) { + throw new error_1.MongoInvalidArgumentError(`No AuthProvider for ${credentials.mechanism} defined.`); + } + return await provider.prepare(handshakeDoc, authContext); + } + return handshakeDoc; +} +/** + * @internal + * Default TCP keepAlive initial delay in milliseconds. + * Set to half the Azure load balancer idle timeout (240s) to ensure + * probes fire well before cloud LBs (Azure, AWS PrivateLink/NLB) + * drop idle connections. + */ +exports.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS = 120_000; +/** @public */ +exports.LEGAL_TLS_SOCKET_OPTIONS = [ + 'allowPartialTrustChain', + 'ALPNProtocols', + 'ca', + 'cert', + 'checkServerIdentity', + 'ciphers', + 'crl', + 'ecdhCurve', + 'key', + 'minDHSize', + 'passphrase', + 'pfx', + 'rejectUnauthorized', + 'secureContext', + 'secureProtocol', + 'servername', + 'session' +]; +/** @public */ +exports.LEGAL_TCP_SOCKET_OPTIONS = [ + 'autoSelectFamily', + 'autoSelectFamilyAttemptTimeout', + 'keepAliveInitialDelay', + 'family', + 'hints', + 'localAddress', + 'localPort', + 'lookup' +]; +function parseConnectOptions(options) { + const hostAddress = options.hostAddress; + if (!hostAddress) + throw new error_1.MongoInvalidArgumentError('Option "hostAddress" is required'); + const result = {}; + for (const name of exports.LEGAL_TCP_SOCKET_OPTIONS) { + if (options[name] != null) { + result[name] = options[name]; + } + } + result.keepAliveInitialDelay ??= exports.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS; + result.keepAlive = true; + result.noDelay = options.noDelay ?? true; + if (typeof hostAddress.socketPath === 'string') { + result.path = hostAddress.socketPath; + return result; + } + else if (typeof hostAddress.host === 'string') { + result.host = hostAddress.host; + result.port = hostAddress.port; + return result; + } + else { + // This should never happen since we set up HostAddresses + // But if we don't throw here the socket could hang until timeout + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(hostAddress)}`); + } +} +function parseSslOptions(options) { + const result = parseConnectOptions(options); + // Merge in valid SSL options + for (const name of exports.LEGAL_TLS_SOCKET_OPTIONS) { + if (options[name] != null) { + result[name] = options[name]; + } + } + if (options.existingSocket) { + result.socket = options.existingSocket; + } + // Set default sni servername to be the same as host + if (result.servername == null && result.host && !net.isIP(result.host)) { + result.servername = result.host; + } + return result; +} +async function makeSocket(options) { + const useTLS = options.tls ?? false; + const connectTimeoutMS = options.connectTimeoutMS ?? 30000; + const existingSocket = options.existingSocket; + const keepAliveInitialDelay = options.keepAliveInitialDelay ?? exports.DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS; + const noDelay = options.noDelay ?? true; + let socket; + if (options.proxyHost != null) { + // Currently, only Socks5 is supported. + return await makeSocks5Connection({ + ...options, + connectTimeoutMS // Should always be present for Socks5 + }); + } + if (useTLS) { + const tlsSocket = tls.connect(parseSslOptions(options)); + if (typeof tlsSocket.disableRenegotiation === 'function') { + tlsSocket.disableRenegotiation(); + } + socket = tlsSocket; + } + else if (existingSocket) { + // In the TLS case, parseSslOptions() sets options.socket to existingSocket, + // so we only need to handle the non-TLS case here (where existingSocket + // gives us all we need out of the box). + socket = existingSocket; + } + else { + socket = net.createConnection(parseConnectOptions(options)); + } + // Explicit setKeepAlive/setNoDelay are required because tls.connect() silently + // ignores these constructor options due to a Node.js bug. + // See: https://github.com/nodejs/node/issues/62003 + // TODO(NODE-7474): remove this fix once the underlying Node.js issue is resolved. + socket.setKeepAlive(true, keepAliveInitialDelay); + socket.setNoDelay(noDelay); + socket.setTimeout(connectTimeoutMS); + let cancellationHandler = null; + const { promise: connectedSocket, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + if (existingSocket) { + resolve(socket); + } + else { + const start = performance.now(); + const connectEvent = useTLS ? 'secureConnect' : 'connect'; + socket + .once(connectEvent, () => resolve(socket)) + .once('error', cause => reject(new error_1.MongoNetworkError(error_1.MongoError.buildErrorMessage(cause), { cause }))) + .once('timeout', () => { + reject(new error_1.MongoNetworkTimeoutError(`Socket '${connectEvent}' timed out after ${(performance.now() - start) | 0}ms (connectTimeoutMS: ${connectTimeoutMS})`)); + }) + .once('close', () => reject(new error_1.MongoNetworkError(`Socket closed after ${(performance.now() - start) | 0} during connection establishment`))); + if (options.cancellationToken != null) { + cancellationHandler = () => reject(new error_1.MongoNetworkError(`Socket connection establishment was cancelled after ${(performance.now() - start) | 0}`)); + options.cancellationToken.once('cancel', cancellationHandler); + } + } + try { + socket = await connectedSocket; + return socket; + } + catch (error) { + // If we encounter an error while establishing a socket, apply the backpressure labels to it. We cannot + // differentiate between DNS, TLS errors and network errors without refactoring our connection establishment to + // handle all three steps separately. + applyBackpressureLabels(error); + socket.destroy(); + throw error; + } + finally { + socket.setTimeout(0); + if (cancellationHandler != null) { + options.cancellationToken?.removeListener('cancel', cancellationHandler); + } + } +} +let socks = null; +function loadSocks() { + if (socks == null) { + const socksImport = (0, deps_1.getSocks)(); + if ('kModuleError' in socksImport) { + throw socksImport.kModuleError; + } + socks = socksImport; + } + return socks; +} +async function makeSocks5Connection(options) { + const hostAddress = utils_1.HostAddress.fromHostPort(options.proxyHost ?? '', // proxyHost is guaranteed to set here + options.proxyPort ?? 1080); + // First, connect to the proxy server itself: + const rawSocket = await makeSocket({ + ...options, + hostAddress, + tls: false, + proxyHost: undefined + }); + const destination = parseConnectOptions(options); + if (typeof destination.host !== 'string' || typeof destination.port !== 'number') { + throw new error_1.MongoInvalidArgumentError('Can only make Socks5 connections to TCP hosts'); + } + socks ??= loadSocks(); + let existingSocket; + try { + // Then, establish the Socks5 proxy connection: + const connection = await socks.SocksClient.createConnection({ + existing_socket: rawSocket, + timeout: options.connectTimeoutMS, + command: 'connect', + destination: { + host: destination.host, + port: destination.port + }, + proxy: { + // host and port are ignored because we pass existing_socket + host: 'iLoveJavaScript', + port: 0, + type: 5, + userId: options.proxyUsername || undefined, + password: options.proxyPassword || undefined + } + }); + existingSocket = connection.socket; + } + catch (cause) { + throw new error_1.MongoNetworkError(error_1.MongoError.buildErrorMessage(cause), { cause }); + } + // Finally, now treat the resulting duplex stream as the + // socket over which we send and receive wire protocol messages: + return await makeSocket({ ...options, existingSocket, proxyHost: undefined }); +} +//# sourceMappingURL=connect.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js.map new file mode 100644 index 00000000..0e8f8763 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/cmap/connect.ts"],"names":[],"mappings":";;;AA0CA,0BAWC;AAED,wCAOC;AA2BD,0DAwHC;AAyBD,4DA+CC;AAgGD,gCAgGC;AAxdD,2BAA2B;AAE3B,2BAA2B;AAG3B,4CAAoD;AACpD,kCAAkD;AAClD,oCASkB;AAClB,oCAAiE;AACjE,wDAAmD;AACnD,gDAAiD;AACjD,6CAKsB;AACtB,yDAKmC;AAKnC,SAAS,uBAAuB,CAAC,KAAiB;IAChD,KAAK,CAAC,aAAa,CAAC,uBAAe,CAAC,qBAAqB,CAAC,CAAC;IAC3D,KAAK,CAAC,aAAa,CAAC,uBAAe,CAAC,cAAc,CAAC,CAAC;AACtD,CAAC;AAEM,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9E,CAAC;IAED,wDAAwD;IACxD,gEAAgE;IAChE,OAAO,MAAM,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;AAChF,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js new file mode 100644 index 00000000..2d27cbdd --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js @@ -0,0 +1,576 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CryptoConnection = exports.SizedMessageTransform = exports.Connection = void 0; +exports.hasSessionSupport = hasSessionSupport; +const stream_1 = require("stream"); +const timers_1 = require("timers"); +const bson_1 = require("../bson"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_logger_1 = require("../mongo_logger"); +const mongo_types_1 = require("../mongo_types"); +const read_preference_1 = require("../read_preference"); +const common_1 = require("../sdam/common"); +const sessions_1 = require("../sessions"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const command_monitoring_events_1 = require("./command_monitoring_events"); +const commands_1 = require("./commands"); +const stream_description_1 = require("./stream_description"); +const compression_1 = require("./wire_protocol/compression"); +const on_data_1 = require("./wire_protocol/on_data"); +const responses_1 = require("./wire_protocol/responses"); +const shared_1 = require("./wire_protocol/shared"); +/** @internal */ +function hasSessionSupport(conn) { + const description = conn.description; + return description.logicalSessionTimeoutMinutes != null; +} +function streamIdentifier(stream, options) { + if (options.proxyHost) { + // If proxy options are specified, the properties of `stream` itself + // will not accurately reflect what endpoint this is connected to. + return options.hostAddress.toString(); + } + const { remoteAddress, remotePort } = stream; + if (typeof remoteAddress === 'string' && typeof remotePort === 'number') { + return utils_1.HostAddress.fromHostPort(remoteAddress, remotePort).toString(); + } + return bson_1.ByteUtils.toHex((0, utils_1.uuidV4)()); +} +/** @internal */ +class Connection extends mongo_types_1.TypedEventEmitter { + /** @event */ + static { this.COMMAND_STARTED = constants_1.COMMAND_STARTED; } + /** @event */ + static { this.COMMAND_SUCCEEDED = constants_1.COMMAND_SUCCEEDED; } + /** @event */ + static { this.COMMAND_FAILED = constants_1.COMMAND_FAILED; } + /** @event */ + static { this.CLUSTER_TIME_RECEIVED = constants_1.CLUSTER_TIME_RECEIVED; } + /** @event */ + static { this.CLOSE = constants_1.CLOSE; } + /** @event */ + static { this.PINNED = constants_1.PINNED; } + /** @event */ + static { this.UNPINNED = constants_1.UNPINNED; } + constructor(stream, options) { + super(); + this.lastHelloMS = -1; + this.helloOk = false; + this.delayedTimeoutId = null; + /** Indicates that the connection (including underlying TCP socket) has been closed. */ + this.closed = false; + this.clusterTime = null; + this.error = null; + this.dataEvents = null; + this.on('error', utils_1.noop); + this.socket = stream; + this.id = options.id; + this.address = streamIdentifier(stream, options); + this.socketTimeoutMS = options.socketTimeoutMS ?? 0; + this.monitorCommands = options.monitorCommands; + this.serverApi = options.serverApi; + this.mongoLogger = options.mongoLogger; + this.established = false; + this.description = new stream_description_1.StreamDescription(this.address, options); + this.generation = options.generation; + this.lastUseTime = (0, utils_1.processTimeMS)(); + this.messageStream = this.socket + .on('error', this.onSocketError.bind(this)) + .pipe(new SizedMessageTransform({ connection: this })) + .on('error', this.onTransformError.bind(this)); + this.socket.on('close', this.onClose.bind(this)); + this.socket.on('timeout', this.onTimeout.bind(this)); + this.messageStream.pause(); + } + get hello() { + return this.description.hello; + } + // the `connect` method stores the result of the handshake hello on the connection + set hello(response) { + this.description.receiveResponse(response); + Object.freeze(this.description); + } + get serviceId() { + return this.hello?.serviceId; + } + get loadBalanced() { + return this.description.loadBalanced; + } + get idleTime() { + return (0, utils_1.calculateDurationInMs)(this.lastUseTime); + } + get hasSessionSupport() { + return this.description.logicalSessionTimeoutMinutes != null; + } + get supportsOpMsg() { + return (this.description != null && + // OP_MSG was introduced in server 3.6 (wire version 6). This also guards + // against the pre-handshake case where maxWireVersion() returns 0. + // TODO(NODE-6672,NODE-6287): remove this helper once OP_QUERY support is dropped + (0, utils_1.maxWireVersion)(this) >= 6 && + !this.description.__nodejs_mock_server__); + } + get shouldEmitAndLogCommand() { + return ((this.monitorCommands || + (this.established && + !this.authContext?.reauthenticating && + this.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.COMMAND, mongo_logger_1.SeverityLevel.DEBUG))) ?? + false); + } + markAvailable() { + this.lastUseTime = (0, utils_1.processTimeMS)(); + } + onSocketError(cause) { + this.onError(new error_1.MongoNetworkError(cause.message, { cause })); + } + onTransformError(error) { + this.onError(error); + } + onError(error) { + this.cleanup(error); + } + onClose() { + const message = `connection ${this.id} to ${this.address} closed`; + this.cleanup(new error_1.MongoNetworkError(message)); + } + onTimeout() { + this.delayedTimeoutId = (0, timers_1.setTimeout)(() => { + const message = `connection ${this.id} to ${this.address} timed out`; + const beforeHandshake = this.hello == null; + this.cleanup(new error_1.MongoNetworkTimeoutError(message, { beforeHandshake })); + }, 1).unref(); // No need for this timer to hold the event loop open + } + destroy() { + if (this.closed) { + return; + } + // load balanced mode requires that these listeners remain on the connection + // after cleanup on timeouts, errors or close so we remove them before calling + // cleanup. + this.removeAllListeners(Connection.PINNED); + this.removeAllListeners(Connection.UNPINNED); + const message = `connection ${this.id} to ${this.address} closed`; + this.cleanup(new error_1.MongoNetworkError(message)); + } + /** + * A method that cleans up the connection. When `force` is true, this method + * forcibly destroys the socket. + * + * If an error is provided, any in-flight operations will be closed with the error. + * + * This method does nothing if the connection is already closed. + */ + cleanup(error) { + if (this.closed) { + return; + } + this.socket.destroy(); + this.error = error; + this.dataEvents?.throw(error).then(undefined, utils_1.squashError); + this.closed = true; + this.emit(Connection.CLOSE); + } + prepareCommand(db, command, options) { + let cmd = { ...command }; + const readPreference = (0, shared_1.getReadPreference)(options); + const session = options?.session; + let clusterTime = this.clusterTime; + if (this.serverApi) { + const { version, strict, deprecationErrors } = this.serverApi; + cmd.apiVersion = version; + if (strict != null) + cmd.apiStrict = strict; + if (deprecationErrors != null) + cmd.apiDeprecationErrors = deprecationErrors; + } + if (this.hasSessionSupport && session) { + if (session.clusterTime && + clusterTime && + session.clusterTime.clusterTime.greaterThan(clusterTime.clusterTime)) { + clusterTime = session.clusterTime; + } + const sessionError = (0, sessions_1.applySession)(session, cmd, options); + if (sessionError) + throw sessionError; + } + else if (session?.explicit) { + throw new error_1.MongoCompatibilityError('Current topology does not support sessions'); + } + // if we have a known cluster time, gossip it + if (clusterTime) { + cmd.$clusterTime = clusterTime; + } + // For standalone, drivers MUST NOT set $readPreference. + if (this.description.type !== common_1.ServerType.Standalone) { + if (!(0, shared_1.isSharded)(this) && + !this.description.loadBalanced && + this.supportsOpMsg && + options.directConnection === true && + readPreference?.mode === 'primary') { + // For mongos and load balancers with 'primary' mode, drivers MUST NOT set $readPreference. + // For all other types with a direct connection, if the read preference is 'primary' + // (driver sets 'primary' as default if no read preference is configured), + // the $readPreference MUST be set to 'primaryPreferred' + // to ensure that any server type can handle the request. + cmd.$readPreference = read_preference_1.ReadPreference.primaryPreferred.toJSON(); + } + else if ((0, shared_1.isSharded)(this) && !this.supportsOpMsg && readPreference?.mode !== 'primary') { + // When sending a read operation via OP_QUERY and the $readPreference modifier, + // the query MUST be provided using the $query modifier. + cmd = { + $query: cmd, + $readPreference: readPreference.toJSON() + }; + } + else if (readPreference?.mode !== 'primary') { + // For mode 'primary', drivers MUST NOT set $readPreference. + // For all other read preference modes (i.e. 'secondary', 'primaryPreferred', ...), + // drivers MUST set $readPreference + cmd.$readPreference = readPreference.toJSON(); + } + } + const commandOptions = { + numberToSkip: 0, + numberToReturn: -1, + checkKeys: false, + // This value is not overridable + secondaryOk: readPreference.secondaryOk(), + ...options + }; + options.timeoutContext?.addMaxTimeMSToCommand(cmd, options); + const message = this.supportsOpMsg + ? new commands_1.OpMsgRequest(db, cmd, commandOptions) + : new commands_1.OpQueryRequest(db, cmd, commandOptions); + return message; + } + async *sendWire(message, options, responseType) { + this.throwIfAborted(); + const timeout = options.socketTimeoutMS ?? + options?.timeoutContext?.getSocketTimeoutMS() ?? + this.socketTimeoutMS; + this.socket.setTimeout(timeout); + try { + await this.writeCommand(message, { + agreedCompressor: this.description.compressor ?? 'none', + zlibCompressionLevel: this.description.zlibCompressionLevel, + timeoutContext: options.timeoutContext, + signal: options.signal + }); + if (message.moreToCome) { + yield responses_1.MongoDBResponse.empty; + return; + } + this.throwIfAborted(); + if (options.timeoutContext?.csotEnabled() && + options.timeoutContext.minRoundTripTime != null && + options.timeoutContext.remainingTimeMS < options.timeoutContext.minRoundTripTime) { + throw new error_1.MongoOperationTimeoutError('Server roundtrip time is greater than the time remaining'); + } + for await (const response of this.readMany(options)) { + this.socket.setTimeout(0); + const bson = response.parse(); + const document = (responseType ?? responses_1.MongoDBResponse).make(bson); + yield document; + this.throwIfAborted(); + this.socket.setTimeout(timeout); + } + } + finally { + this.socket.setTimeout(0); + } + } + async *sendCommand(ns, command, options, responseType) { + options?.signal?.throwIfAborted(); + const message = this.prepareCommand(ns.db, command, options); + let started = 0; + if (this.shouldEmitAndLogCommand) { + started = (0, utils_1.processTimeMS)(); + this.emitAndLogCommand(this.monitorCommands, Connection.COMMAND_STARTED, message.databaseName, this.established, new command_monitoring_events_1.CommandStartedEvent(this, message, this.description.serverConnectionId)); + } + // If `documentsReturnedIn` not set or raw is not enabled, use input bson options + // Otherwise, support raw flag. Raw only works for cursors that hardcode firstBatch/nextBatch fields + const bsonOptions = options.documentsReturnedIn == null || !options.raw + ? options + : { + ...options, + raw: false, + fieldsAsRaw: { [options.documentsReturnedIn]: true } + }; + /** MongoDBResponse instance or subclass */ + let document = undefined; + /** Cached result of a toObject call */ + let object = undefined; + try { + this.throwIfAborted(); + for await (document of this.sendWire(message, options, responseType)) { + object = undefined; + if (options.session != null) { + (0, sessions_1.updateSessionFromResponse)(options.session, document); + } + if (document.$clusterTime) { + this.clusterTime = document.$clusterTime; + this.emit(Connection.CLUSTER_TIME_RECEIVED, document.$clusterTime); + } + if (document.ok === 0) { + if (options.timeoutContext?.csotEnabled() && document.isMaxTimeExpiredError) { + throw new error_1.MongoOperationTimeoutError('Server reported a timeout error', { + cause: new error_1.MongoServerError((object ??= document.toObject(bsonOptions))) + }); + } + throw new error_1.MongoServerError((object ??= document.toObject(bsonOptions))); + } + if (this.shouldEmitAndLogCommand) { + this.emitAndLogCommand(this.monitorCommands, Connection.COMMAND_SUCCEEDED, message.databaseName, this.established, new command_monitoring_events_1.CommandSucceededEvent(this, message, message.moreToCome ? { ok: 1 } : (object ??= document.toObject(bsonOptions)), started, this.description.serverConnectionId)); + } + if (responseType == null) { + yield (object ??= document.toObject(bsonOptions)); + } + else { + yield document; + } + this.throwIfAborted(); + } + } + catch (error) { + if (options.session != null && !(error instanceof error_1.MongoServerError)) { + (0, sessions_1.updateSessionFromResponse)(options.session, responses_1.MongoDBResponse.empty); + } + if (this.shouldEmitAndLogCommand) { + this.emitAndLogCommand(this.monitorCommands, Connection.COMMAND_FAILED, message.databaseName, this.established, new command_monitoring_events_1.CommandFailedEvent(this, message, error, started, this.description.serverConnectionId)); + } + throw error; + } + } + async command(ns, command, options = {}, responseType) { + this.throwIfAborted(); + options.signal?.throwIfAborted(); + for await (const document of this.sendCommand(ns, command, options, responseType)) { + if (options.timeoutContext?.csotEnabled()) { + if (responses_1.MongoDBResponse.is(document)) { + if (document.isMaxTimeExpiredError) { + throw new error_1.MongoOperationTimeoutError('Server reported a timeout error', { + cause: new error_1.MongoServerError(document.toObject()) + }); + } + } + else { + if ((Array.isArray(document?.writeErrors) && + document.writeErrors.some(error => error?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired)) || + document?.writeConcernError?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired) { + throw new error_1.MongoOperationTimeoutError('Server reported a timeout error', { + cause: new error_1.MongoServerError(document) + }); + } + } + } + return document; + } + throw new error_1.MongoUnexpectedServerResponseError('Unable to get response from server'); + } + exhaustCommand(ns, command, options, replyListener) { + const exhaustLoop = async () => { + this.throwIfAborted(); + for await (const reply of this.sendCommand(ns, command, options)) { + replyListener(undefined, reply); + this.throwIfAborted(); + } + throw new error_1.MongoUnexpectedServerResponseError('Server ended moreToCome unexpectedly'); + }; + exhaustLoop().then(undefined, replyListener); + } + throwIfAborted() { + if (this.error) + throw this.error; + } + /** + * @internal + * + * Writes an OP_MSG or OP_QUERY request to the socket, optionally compressing the command. This method + * waits until the socket's buffer has emptied (the Nodejs socket `drain` event has fired). + */ + async writeCommand(command, options) { + const finalCommand = options.agreedCompressor === 'none' || !commands_1.OpCompressedRequest.canCompress(command) + ? command + : new commands_1.OpCompressedRequest(command, { + agreedCompressor: options.agreedCompressor ?? 'none', + zlibCompressionLevel: options.zlibCompressionLevel ?? 0 + }); + const buffer = bson_1.ByteUtils.concat(await finalCommand.toBin()); + if (options.timeoutContext?.csotEnabled()) { + if (options.timeoutContext.minRoundTripTime != null && + options.timeoutContext.remainingTimeMS < options.timeoutContext.minRoundTripTime) { + throw new error_1.MongoOperationTimeoutError('Server roundtrip time is greater than the time remaining'); + } + } + try { + if (this.socket.write(buffer)) + return; + } + catch (writeError) { + const networkError = new error_1.MongoNetworkError('unexpected error writing to socket', { + cause: writeError + }); + this.onError(networkError); + throw networkError; + } + const drainEvent = (0, utils_1.once)(this.socket, 'drain', options); + const timeout = options?.timeoutContext?.timeoutForSocketWrite; + const drained = timeout ? Promise.race([drainEvent, timeout]) : drainEvent; + try { + return await drained; + } + catch (writeError) { + if (timeout_1.TimeoutError.is(writeError)) { + const timeoutError = new error_1.MongoOperationTimeoutError('Timed out at socket write'); + this.onError(timeoutError); + throw timeoutError; + } + else if (writeError === options.signal?.reason) { + this.onError(writeError); + } + throw writeError; + } + finally { + timeout?.clear(); + } + } + /** + * @internal + * + * Returns an async generator that yields full wire protocol messages from the underlying socket. This function + * yields messages until `moreToCome` is false or not present in a response, or the caller cancels the request + * by calling `return` on the generator. + * + * Note that `for-await` loops call `return` automatically when the loop is exited. + */ + async *readMany(options) { + try { + this.dataEvents = (0, on_data_1.onData)(this.messageStream, options); + this.messageStream.resume(); + for await (const message of this.dataEvents) { + const response = await (0, compression_1.decompressResponse)(message); + yield response; + if (!response.moreToCome) { + return; + } + } + } + catch (readError) { + if (timeout_1.TimeoutError.is(readError)) { + const timeoutError = new error_1.MongoOperationTimeoutError(`Timed out during socket read (${readError.duration}ms)`); + this.dataEvents = null; + this.onError(timeoutError); + throw timeoutError; + } + else if (readError === options.signal?.reason) { + this.onError(readError); + } + throw readError; + } + finally { + this.dataEvents = null; + this.messageStream.pause(); + } + } +} +exports.Connection = Connection; +/** @internal */ +class SizedMessageTransform extends stream_1.Transform { + constructor({ connection }) { + super({ writableObjectMode: false, readableObjectMode: true }); + this.bufferPool = new utils_1.BufferPool(); + this.connection = connection; + } + _transform(chunk, encoding, callback) { + if (this.connection.delayedTimeoutId != null) { + (0, timers_1.clearTimeout)(this.connection.delayedTimeoutId); + this.connection.delayedTimeoutId = null; + } + this.bufferPool.append(chunk); + while (this.bufferPool.length) { + // While there are any bytes in the buffer + // Try to fetch a size from the top 4 bytes + const sizeOfMessage = this.bufferPool.getInt32(); + if (sizeOfMessage == null) { + // Not even an int32 worth of data. Stop the loop, we need more chunks. + break; + } + if (sizeOfMessage < 0) { + // The size in the message has a negative value, this is probably corruption, throw: + return callback(new error_1.MongoParseError(`Message size cannot be negative: ${sizeOfMessage}`)); + } + if (sizeOfMessage > this.bufferPool.length) { + // We do not have enough bytes to make a sizeOfMessage chunk + break; + } + // Add a message to the stream + const message = this.bufferPool.read(sizeOfMessage); + if (!this.push(message)) { + // We only subscribe to data events so we should never get backpressure + // if we do, we do not have the handling for it. + return callback(new error_1.MongoRuntimeError(`SizedMessageTransform does not support backpressure`)); + } + } + callback(); + } +} +exports.SizedMessageTransform = SizedMessageTransform; +/** @internal */ +class CryptoConnection extends Connection { + constructor(stream, options) { + super(stream, options); + this.autoEncrypter = options.autoEncrypter; + } + async command(ns, cmd, options, responseType) { + const { autoEncrypter } = this; + if (!autoEncrypter) { + throw new error_1.MongoRuntimeError('No AutoEncrypter available for encryption'); + } + const serverWireVersion = (0, utils_1.maxWireVersion)(this); + if (serverWireVersion === 0) { + // This means the initial handshake hasn't happened yet + return await super.command(ns, cmd, options, responseType); + } + // Save sort or indexKeys based on the command being run + // the encrypt API serializes our JS objects to BSON to pass to the native code layer + // and then deserializes the encrypted result, the protocol level components + // of the command (ex. sort) are then converted to JS objects potentially losing + // import key order information. These fields are never encrypted so we can save the values + // from before the encryption and replace them after encryption has been performed + const sort = cmd.find || cmd.findAndModify ? cmd.sort : null; + const indexKeys = cmd.createIndexes + ? cmd.indexes.map((index) => index.key) + : null; + const encrypted = await autoEncrypter.encrypt(ns.toString(), cmd, options); + // Replace the saved values + if (sort != null && (cmd.find || cmd.findAndModify)) { + encrypted.sort = sort; + } + if (indexKeys != null && cmd.createIndexes) { + for (const [offset, index] of indexKeys.entries()) { + // @ts-expect-error `encrypted` is a generic "command", but we've narrowed for only `createIndexes` commands here + encrypted.indexes[offset].key = index; + } + } + const encryptedResponse = await super.command(ns, encrypted, options, + // Eventually we want to require `responseType` which means we would satisfy `T` as the return type. + // In the meantime, we want encryptedResponse to always be _at least_ a MongoDBResponse if not a more specific subclass + // So that we can ensure we have access to the on-demand APIs for decorate response + responseType ?? responses_1.MongoDBResponse); + const result = await autoEncrypter.decrypt(encryptedResponse.toBytes(), options); + const decryptedResponse = responseType?.make(result) ?? (0, bson_1.deserialize)(result, options); + if (autoEncrypter[constants_1.kDecorateResult]) { + if (responseType == null) { + (0, utils_1.decorateDecryptionResult)(decryptedResponse, encryptedResponse.toObject(), true); + } + else if (decryptedResponse instanceof responses_1.CursorResponse) { + decryptedResponse.encryptedResponse = encryptedResponse; + } + } + return decryptedResponse; + } +} +exports.CryptoConnection = CryptoConnection; +//# sourceMappingURL=connection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js.map new file mode 100644 index 00000000..8205c5b4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/cmap/connection.ts"],"names":[],"mappings":";;;AAmKA,8CAGC;AAtKD,mCAA0E;AAC1E,mCAAkD;AAElD,kCAOiB;AAEjB,4CASsB;AACtB,oCAUkB;AAGlB,kDAA0F;AAC1F,gDAA2F;AAC3F,wDAA6E;AAE7E,2CAA4C;AAC5C,0CAA0F;AAC1F,wCAA+D;AAC/D,oCAakB;AAIlB,2EAIqC;AACrC,yCAOoB;AAGpB,6DAAwF;AACxF,6DAAsF;AACtF,qDAAiD;AACjD,yDAImC;AACnC,mDAAsE;AAgFtE,gBAAgB;AAChB,SAAgB,iBAAiB,CAAC,IAAgB;IAChD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACrC,OAAO,WAAW,CAAC,4BAA4B,IAAI,IAAI,CAAC;AAC1D,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAE,OAA0B;IAClE,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,oEAAoE;QACpE,kEAAkE;QAClE,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAC7C,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACxE,OAAO,mBAAW,CAAC,YAAY,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;IACxE,CAAC;IAED,OAAO,gBAAS,CAAC,KAAK,CAAC,IAAA,cAAM,GAAE,CAAC,CAAC;AACnC,CAAC;AAED,gBAAgB;AAChB,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node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js new file mode 100644 index 00000000..c74af593 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js @@ -0,0 +1,558 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPool = exports.PoolState = void 0; +const timers_1 = require("timers"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const connect_1 = require("./connect"); +const connection_1 = require("./connection"); +const connection_pool_events_1 = require("./connection_pool_events"); +const errors_1 = require("./errors"); +const metrics_1 = require("./metrics"); +/** @internal */ +exports.PoolState = Object.freeze({ + paused: 'paused', + ready: 'ready', + closed: 'closed' +}); +/** + * A pool of connections which dynamically resizes, and emit events related to pool activity + * @internal + */ +class ConnectionPool extends mongo_types_1.TypedEventEmitter { + /** + * Emitted when the connection pool is created. + * @event + */ + static { this.CONNECTION_POOL_CREATED = constants_1.CONNECTION_POOL_CREATED; } + /** + * Emitted once when the connection pool is closed + * @event + */ + static { this.CONNECTION_POOL_CLOSED = constants_1.CONNECTION_POOL_CLOSED; } + /** + * Emitted each time the connection pool is cleared and it's generation incremented + * @event + */ + static { this.CONNECTION_POOL_CLEARED = constants_1.CONNECTION_POOL_CLEARED; } + /** + * Emitted each time the connection pool is marked ready + * @event + */ + static { this.CONNECTION_POOL_READY = constants_1.CONNECTION_POOL_READY; } + /** + * Emitted when a connection is created. + * @event + */ + static { this.CONNECTION_CREATED = constants_1.CONNECTION_CREATED; } + /** + * Emitted when a connection becomes established, and is ready to use + * @event + */ + static { this.CONNECTION_READY = constants_1.CONNECTION_READY; } + /** + * Emitted when a connection is closed + * @event + */ + static { this.CONNECTION_CLOSED = constants_1.CONNECTION_CLOSED; } + /** + * Emitted when an attempt to check out a connection begins + * @event + */ + static { this.CONNECTION_CHECK_OUT_STARTED = constants_1.CONNECTION_CHECK_OUT_STARTED; } + /** + * Emitted when an attempt to check out a connection fails + * @event + */ + static { this.CONNECTION_CHECK_OUT_FAILED = constants_1.CONNECTION_CHECK_OUT_FAILED; } + /** + * Emitted each time a connection is successfully checked out of the connection pool + * @event + */ + static { this.CONNECTION_CHECKED_OUT = constants_1.CONNECTION_CHECKED_OUT; } + /** + * Emitted each time a connection is successfully checked into the connection pool + * @event + */ + static { this.CONNECTION_CHECKED_IN = constants_1.CONNECTION_CHECKED_IN; } + constructor(server, options) { + super(); + this.on('error', utils_1.noop); + this.options = Object.freeze({ + connectionType: connection_1.Connection, + ...options, + maxPoolSize: options.maxPoolSize ?? 100, + minPoolSize: options.minPoolSize ?? 0, + maxConnecting: options.maxConnecting ?? 2, + maxIdleTimeMS: options.maxIdleTimeMS ?? 0, + waitQueueTimeoutMS: options.waitQueueTimeoutMS ?? 0, + minPoolSizeCheckFrequencyMS: options.minPoolSizeCheckFrequencyMS ?? 100, + autoEncrypter: options.autoEncrypter + }); + if (this.options.minPoolSize > this.options.maxPoolSize) { + throw new error_1.MongoInvalidArgumentError('Connection pool minimum size must not be greater than maximum pool size'); + } + this.poolState = exports.PoolState.paused; + this.server = server; + this.connections = new utils_1.List(); + this.pending = 0; + this.checkedOut = new Set(); + this.minPoolSizeTimer = undefined; + this.generation = 0; + this.serviceGenerations = new Map(); + this.connectionCounter = (0, utils_1.makeCounter)(1); + this.cancellationToken = new mongo_types_1.CancellationToken(); + this.cancellationToken.setMaxListeners(Infinity); + this.waitQueue = new utils_1.List(); + this.metrics = new metrics_1.ConnectionPoolMetrics(); + this.processingWaitQueue = false; + this.mongoLogger = this.server.topology.client?.mongoLogger; + this.component = 'connection'; + queueMicrotask(() => { + this.emitAndLog(ConnectionPool.CONNECTION_POOL_CREATED, new connection_pool_events_1.ConnectionPoolCreatedEvent(this)); + }); + } + /** The address of the endpoint the pool is connected to */ + get address() { + return this.options.hostAddress.toString(); + } + /** + * Check if the pool has been closed + * + * TODO(NODE-3263): We can remove this property once shell no longer needs it + */ + get closed() { + return this.poolState === exports.PoolState.closed; + } + /** An integer expressing how many total connections (available + pending + in use) the pool currently has */ + get totalConnectionCount() { + return (this.availableConnectionCount + this.pendingConnectionCount + this.currentCheckedOutCount); + } + /** An integer expressing how many connections are currently available in the pool. */ + get availableConnectionCount() { + return this.connections.length; + } + get pendingConnectionCount() { + return this.pending; + } + get currentCheckedOutCount() { + return this.checkedOut.size; + } + get waitQueueSize() { + return this.waitQueue.length; + } + get loadBalanced() { + return this.options.loadBalanced; + } + get serverError() { + return this.server.description.error; + } + /** + * This is exposed ONLY for use in mongosh, to enable + * killing all connections if a user quits the shell with + * operations in progress. + * + * This property may be removed as a part of NODE-3263. + */ + get checkedOutConnections() { + return this.checkedOut; + } + /** + * Get the metrics information for the pool when a wait queue timeout occurs. + */ + waitQueueErrorMetrics() { + return this.metrics.info(this.options.maxPoolSize); + } + /** + * Set the pool state to "ready" + */ + ready() { + if (this.poolState !== exports.PoolState.paused) { + return; + } + this.poolState = exports.PoolState.ready; + this.emitAndLog(ConnectionPool.CONNECTION_POOL_READY, new connection_pool_events_1.ConnectionPoolReadyEvent(this)); + (0, timers_1.clearTimeout)(this.minPoolSizeTimer); + this.ensureMinPoolSize(); + } + /** + * Check a connection out of this pool. The connection will continue to be tracked, but no reference to it + * will be held by the pool. This means that if a connection is checked out it MUST be checked back in or + * explicitly destroyed by the new owner. + */ + async checkOut(options) { + const checkoutTime = (0, utils_1.processTimeMS)(); + this.emitAndLog(ConnectionPool.CONNECTION_CHECK_OUT_STARTED, new connection_pool_events_1.ConnectionCheckOutStartedEvent(this)); + const { promise, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + const timeout = options.timeoutContext.connectionCheckoutTimeout; + const waitQueueMember = { + resolve, + reject, + cancelled: false, + checkoutTime + }; + const abortListener = (0, utils_1.addAbortListener)(options.signal, function () { + waitQueueMember.cancelled = true; + reject(this.reason); + }); + this.waitQueue.push(waitQueueMember); + queueMicrotask(() => this.processWaitQueue()); + try { + timeout?.throwIfExpired(); + return await (timeout ? Promise.race([promise, timeout]) : promise); + } + catch (error) { + if (timeout_1.TimeoutError.is(error)) { + timeout?.clear(); + waitQueueMember.cancelled = true; + this.emitAndLog(ConnectionPool.CONNECTION_CHECK_OUT_FAILED, new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, 'timeout', waitQueueMember.checkoutTime)); + const timeoutError = new errors_1.WaitQueueTimeoutError(this.loadBalanced + ? this.waitQueueErrorMetrics() + : 'Timed out while checking out a connection from connection pool', this.address); + if (options.timeoutContext.csotEnabled()) { + throw new error_1.MongoOperationTimeoutError('Timed out during connection checkout', { + cause: timeoutError + }); + } + throw timeoutError; + } + throw error; + } + finally { + abortListener?.[utils_1.kDispose](); + timeout?.clear(); + } + } + /** + * Check a connection into the pool. + * + * @param connection - The connection to check in + */ + checkIn(connection) { + if (!this.checkedOut.has(connection)) { + return; + } + const poolClosed = this.closed; + const stale = this.connectionIsStale(connection); + const willDestroy = !!(poolClosed || stale || connection.closed); + if (!willDestroy) { + connection.markAvailable(); + this.connections.unshift(connection); + } + this.checkedOut.delete(connection); + this.emitAndLog(ConnectionPool.CONNECTION_CHECKED_IN, new connection_pool_events_1.ConnectionCheckedInEvent(this, connection)); + if (willDestroy) { + const reason = connection.closed ? 'error' : poolClosed ? 'poolClosed' : 'stale'; + this.destroyConnection(connection, reason); + } + queueMicrotask(() => this.processWaitQueue()); + } + /** + * Clear the pool + * + * Pool reset is handled by incrementing the pool's generation count. Any existing connection of a + * previous generation will eventually be pruned during subsequent checkouts. + */ + clear(options = {}) { + if (this.closed) { + return; + } + // handle load balanced case + if (this.loadBalanced) { + const { serviceId } = options; + if (!serviceId) { + throw new error_1.MongoRuntimeError('ConnectionPool.clear() called in load balanced mode with no serviceId.'); + } + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + // Only need to worry if the generation exists, since it should + // always be there but typescript needs the check. + if (generation == null) { + throw new error_1.MongoRuntimeError('Service generations are required in load balancer mode.'); + } + else { + // Increment the generation for the service id. + this.serviceGenerations.set(sid, generation + 1); + } + this.emitAndLog(ConnectionPool.CONNECTION_POOL_CLEARED, new connection_pool_events_1.ConnectionPoolClearedEvent(this, { serviceId })); + return; + } + // handle non load-balanced case + const interruptInUseConnections = options.interruptInUseConnections ?? false; + const oldGeneration = this.generation; + this.generation += 1; + const alreadyPaused = this.poolState === exports.PoolState.paused; + this.poolState = exports.PoolState.paused; + this.clearMinPoolSizeTimer(); + if (!alreadyPaused) { + this.emitAndLog(ConnectionPool.CONNECTION_POOL_CLEARED, new connection_pool_events_1.ConnectionPoolClearedEvent(this, { + interruptInUseConnections + })); + } + if (interruptInUseConnections) { + queueMicrotask(() => this.interruptInUseConnections(oldGeneration)); + } + this.processWaitQueue(); + } + /** + * Closes all stale in-use connections in the pool with a resumable PoolClearedOnNetworkError. + * + * Only connections where `connection.generation <= minGeneration` are killed. + */ + interruptInUseConnections(minGeneration) { + for (const connection of this.checkedOut) { + if (connection.generation <= minGeneration) { + connection.onError(new errors_1.PoolClearedOnNetworkError(this)); + } + } + } + /** For MongoClient.close() procedures */ + closeCheckedOutConnections() { + for (const conn of this.checkedOut) { + conn.onError(new error_1.MongoClientClosedError()); + } + } + /** Close the pool */ + close() { + if (this.closed) { + return; + } + // immediately cancel any in-flight connections + this.cancellationToken.emit('cancel'); + // end the connection counter + if (typeof this.connectionCounter.return === 'function') { + this.connectionCounter.return(undefined); + } + this.poolState = exports.PoolState.closed; + this.clearMinPoolSizeTimer(); + this.processWaitQueue(); + for (const conn of this.connections) { + this.emitAndLog(ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent(this, conn, 'poolClosed')); + conn.destroy(); + } + this.connections.clear(); + this.emitAndLog(ConnectionPool.CONNECTION_POOL_CLOSED, new connection_pool_events_1.ConnectionPoolClosedEvent(this)); + } + /** + * @internal + * Reauthenticate a connection + */ + async reauthenticate(connection) { + const authContext = connection.authContext; + if (!authContext) { + throw new error_1.MongoRuntimeError('No auth context found on connection.'); + } + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError('Connection is missing credentials when asked to reauthenticate'); + } + const resolvedCredentials = credentials.resolveAuthMechanism(connection.hello); + const provider = this.server.topology.client.s.authProviders.getOrCreateProvider(resolvedCredentials.mechanism, resolvedCredentials.mechanismProperties); + if (!provider) { + throw new error_1.MongoMissingCredentialsError(`Reauthenticate failed due to no auth provider for ${credentials.mechanism}`); + } + await provider.reauth(authContext); + return; + } + /** Clear the min pool size timer */ + clearMinPoolSizeTimer() { + const minPoolSizeTimer = this.minPoolSizeTimer; + if (minPoolSizeTimer) { + (0, timers_1.clearTimeout)(minPoolSizeTimer); + } + } + destroyConnection(connection, reason) { + this.emitAndLog(ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent(this, connection, reason)); + // destroy the connection + connection.destroy(); + } + connectionIsStale(connection) { + const serviceId = connection.serviceId; + if (this.loadBalanced && serviceId) { + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + return connection.generation !== generation; + } + return connection.generation !== this.generation; + } + connectionIsIdle(connection) { + return !!(this.options.maxIdleTimeMS && connection.idleTime > this.options.maxIdleTimeMS); + } + /** + * Destroys a connection if the connection is perished. + * + * @returns `true` if the connection was destroyed, `false` otherwise. + */ + destroyConnectionIfPerished(connection) { + const isStale = this.connectionIsStale(connection); + const isIdle = this.connectionIsIdle(connection); + if (!isStale && !isIdle && !connection.closed) { + return false; + } + const reason = connection.closed ? 'error' : isStale ? 'stale' : 'idle'; + this.destroyConnection(connection, reason); + return true; + } + createConnection(callback) { + // Note that metadata may have changed on the client but have + // been frozen here, so we pull the metadata promise always from the client + // no matter what options were set at the construction of the pool. + const connectOptions = { + ...this.options, + id: this.connectionCounter.next().value, + generation: this.generation, + cancellationToken: this.cancellationToken, + mongoLogger: this.mongoLogger, + authProviders: this.server.topology.client.s.authProviders, + metadata: this.server.topology.client.options.metadata + }; + this.pending++; + // This is our version of a "virtual" no-I/O connection as the spec requires + const connectionCreatedTime = (0, utils_1.processTimeMS)(); + this.emitAndLog(ConnectionPool.CONNECTION_CREATED, new connection_pool_events_1.ConnectionCreatedEvent(this, { id: connectOptions.id })); + (0, connect_1.connect)(connectOptions).then(connection => { + // The pool might have closed since we started trying to create a connection + if (this.poolState !== exports.PoolState.ready) { + this.pending--; + connection.destroy(); + callback(this.closed ? new errors_1.PoolClosedError(this) : new errors_1.PoolClearedError(this)); + return; + } + // forward all events from the connection to the pool + for (const event of [...constants_1.APM_EVENTS, connection_1.Connection.CLUSTER_TIME_RECEIVED]) { + connection.on(event, (e) => this.emit(event, e)); + } + if (this.loadBalanced) { + connection.on(connection_1.Connection.PINNED, pinType => this.metrics.markPinned(pinType)); + connection.on(connection_1.Connection.UNPINNED, pinType => this.metrics.markUnpinned(pinType)); + const serviceId = connection.serviceId; + if (serviceId) { + let generation; + const sid = serviceId.toHexString(); + if ((generation = this.serviceGenerations.get(sid))) { + connection.generation = generation; + } + else { + this.serviceGenerations.set(sid, 0); + connection.generation = 0; + } + } + } + connection.markAvailable(); + this.emitAndLog(ConnectionPool.CONNECTION_READY, new connection_pool_events_1.ConnectionReadyEvent(this, connection, connectionCreatedTime)); + this.pending--; + callback(undefined, connection); + }, error => { + this.pending--; + this.server.handleError(error); + this.emitAndLog(ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent(this, { id: connectOptions.id, serviceId: undefined }, 'error', + // TODO(NODE-5192): Remove this cast + error)); + if (error instanceof error_1.MongoNetworkError || error instanceof error_1.MongoServerError) { + error.connectionGeneration = connectOptions.generation; + } + callback(error ?? new error_1.MongoRuntimeError('Connection creation failed without error')); + }); + } + ensureMinPoolSize() { + const minPoolSize = this.options.minPoolSize; + if (this.poolState !== exports.PoolState.ready) { + return; + } + this.connections.prune(connection => this.destroyConnectionIfPerished(connection)); + if (this.totalConnectionCount < minPoolSize && + this.pendingConnectionCount < this.options.maxConnecting) { + // NOTE: ensureMinPoolSize should not try to get all the pending + // connection permits because that potentially delays the availability of + // the connection to a checkout request + this.createConnection((err, connection) => { + if (!err && connection) { + this.connections.push(connection); + queueMicrotask(() => this.processWaitQueue()); + } + if (this.poolState === exports.PoolState.ready) { + (0, timers_1.clearTimeout)(this.minPoolSizeTimer); + this.minPoolSizeTimer = (0, timers_1.setTimeout)(() => this.ensureMinPoolSize(), this.options.minPoolSizeCheckFrequencyMS); + } + }); + } + else { + (0, timers_1.clearTimeout)(this.minPoolSizeTimer); + this.minPoolSizeTimer = (0, timers_1.setTimeout)(() => this.ensureMinPoolSize(), this.options.minPoolSizeCheckFrequencyMS); + } + } + processWaitQueue() { + if (this.processingWaitQueue) { + return; + } + this.processingWaitQueue = true; + while (this.waitQueueSize) { + const waitQueueMember = this.waitQueue.first(); + if (!waitQueueMember) { + this.waitQueue.shift(); + continue; + } + if (waitQueueMember.cancelled) { + this.waitQueue.shift(); + continue; + } + if (this.poolState !== exports.PoolState.ready) { + const reason = this.closed ? 'poolClosed' : 'connectionError'; + const error = this.closed ? new errors_1.PoolClosedError(this) : new errors_1.PoolClearedError(this); + this.emitAndLog(ConnectionPool.CONNECTION_CHECK_OUT_FAILED, new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, reason, waitQueueMember.checkoutTime, error)); + this.waitQueue.shift(); + waitQueueMember.reject(error); + continue; + } + if (!this.availableConnectionCount) { + break; + } + const connection = this.connections.shift(); + if (!connection) { + break; + } + if (!this.destroyConnectionIfPerished(connection)) { + this.checkedOut.add(connection); + this.emitAndLog(ConnectionPool.CONNECTION_CHECKED_OUT, new connection_pool_events_1.ConnectionCheckedOutEvent(this, connection, waitQueueMember.checkoutTime)); + this.waitQueue.shift(); + waitQueueMember.resolve(connection); + } + } + const { maxPoolSize, maxConnecting } = this.options; + while (this.waitQueueSize > 0 && + this.pendingConnectionCount < maxConnecting && + (maxPoolSize === 0 || this.totalConnectionCount < maxPoolSize)) { + const waitQueueMember = this.waitQueue.shift(); + if (!waitQueueMember || waitQueueMember.cancelled) { + continue; + } + this.createConnection((err, connection) => { + if (waitQueueMember.cancelled) { + if (!err && connection) { + this.connections.push(connection); + } + } + else { + if (err) { + this.emitAndLog(ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + // TODO(NODE-5192): Remove this cast + new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, 'connectionError', waitQueueMember.checkoutTime, err)); + waitQueueMember.reject(err); + } + else if (connection) { + this.checkedOut.add(connection); + this.emitAndLog(ConnectionPool.CONNECTION_CHECKED_OUT, new connection_pool_events_1.ConnectionCheckedOutEvent(this, connection, waitQueueMember.checkoutTime)); + waitQueueMember.resolve(connection); + } + } + queueMicrotask(() => this.processWaitQueue()); + }); + } + this.processingWaitQueue = false; + } +} +exports.ConnectionPool = ConnectionPool; +//# sourceMappingURL=connection_pool.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js.map new file mode 100644 index 00000000..0aba478d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection_pool.js","sourceRoot":"","sources":["../../src/cmap/connection_pool.ts"],"names":[],"mappings":";;;AAAA,mCAAkD;AAGlD,4CAasB;AACtB,oCAUkB;AAClB,gDAAsF;AAEtF,wCAA+D;AAC/D,oCASkB;AAClB,uCAAoC;AACpC,6CAAyF;AACzF,qEAYkC;AAClC,qCAKkB;AAClB,uCAAkD;AA4BlD,gBAAgB;AACH,QAAA,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACR,CAAC,CAAC;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BACR,IAAI,CAAC,UAAU,CACb,cAAc,CAAC,2BAA2B;wBAC1C,oCAAoC;wBACpC,IAAI,sDAA6B,CAC/B,IAAI,EACJ,iBAAiB,EACjB,eAAe,CAAC,YAAY,EAC5B,GAAiB,CAClB,CACF,CAAC;wBACF,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBAC9B,CAAC;yBAAM,IAAI,UAAU,EAAE,CAAC;wBACtB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;wBAChC,IAAI,CAAC,UAAU,CACb,cAAc,CAAC,sBAAsB,EACrC,IAAI,kDAAyB,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAC9E,CAAC;wBACF,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;oBACtC,CAAC;gBACH,CAAC;gBACD,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACnC,CAAC;;AAzrBH,wCA0rBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js new file mode 100644 index 00000000..d978d0e3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPoolClearedEvent = exports.ConnectionCheckedInEvent = exports.ConnectionCheckedOutEvent = exports.ConnectionCheckOutFailedEvent = exports.ConnectionCheckOutStartedEvent = exports.ConnectionClosedEvent = exports.ConnectionReadyEvent = exports.ConnectionCreatedEvent = exports.ConnectionPoolClosedEvent = exports.ConnectionPoolReadyEvent = exports.ConnectionPoolCreatedEvent = exports.ConnectionPoolMonitoringEvent = void 0; +const constants_1 = require("../constants"); +const utils_1 = require("../utils"); +/** + * The base export class for all monitoring events published from the connection pool + * @public + * @category Event + */ +class ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + this.time = new Date(); + this.address = pool.address; + } +} +exports.ConnectionPoolMonitoringEvent = ConnectionPoolMonitoringEvent; +/** + * An event published when a connection pool is created + * @public + * @category Event + */ +class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_POOL_CREATED; + const { maxConnecting, maxPoolSize, minPoolSize, maxIdleTimeMS, waitQueueTimeoutMS } = pool.options; + this.options = { maxConnecting, maxPoolSize, minPoolSize, maxIdleTimeMS, waitQueueTimeoutMS }; + } +} +exports.ConnectionPoolCreatedEvent = ConnectionPoolCreatedEvent; +/** + * An event published when a connection pool is ready + * @public + * @category Event + */ +class ConnectionPoolReadyEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_POOL_READY; + } +} +exports.ConnectionPoolReadyEvent = ConnectionPoolReadyEvent; +/** + * An event published when a connection pool is closed + * @public + * @category Event + */ +class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_POOL_CLOSED; + } +} +exports.ConnectionPoolClosedEvent = ConnectionPoolClosedEvent; +/** + * An event published when a connection pool creates a new connection + * @public + * @category Event + */ +class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_CREATED; + this.connectionId = connection.id; + } +} +exports.ConnectionCreatedEvent = ConnectionCreatedEvent; +/** + * An event published when a connection is ready for use + * @public + * @category Event + */ +class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection, connectionCreatedEventTime) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_READY; + this.durationMS = (0, utils_1.processTimeMS)() - connectionCreatedEventTime; + this.connectionId = connection.id; + } +} +exports.ConnectionReadyEvent = ConnectionReadyEvent; +/** + * An event published when a connection is closed + * @public + * @category Event + */ +class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection, reason, error) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_CLOSED; + this.connectionId = connection.id; + this.reason = reason; + this.serviceId = connection.serviceId; + this.error = error ?? null; + } +} +exports.ConnectionClosedEvent = ConnectionClosedEvent; +/** + * An event published when a request to check a connection out begins + * @public + * @category Event + */ +class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_CHECK_OUT_STARTED; + } +} +exports.ConnectionCheckOutStartedEvent = ConnectionCheckOutStartedEvent; +/** + * An event published when a request to check a connection out fails + * @public + * @category Event + */ +class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, reason, checkoutTime, error) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_CHECK_OUT_FAILED; + this.durationMS = (0, utils_1.processTimeMS)() - checkoutTime; + this.reason = reason; + this.error = error; + } +} +exports.ConnectionCheckOutFailedEvent = ConnectionCheckOutFailedEvent; +/** + * An event published when a connection is checked out of the connection pool + * @public + * @category Event + */ +class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection, checkoutTime) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_CHECKED_OUT; + this.durationMS = (0, utils_1.processTimeMS)() - checkoutTime; + this.connectionId = connection.id; + } +} +exports.ConnectionCheckedOutEvent = ConnectionCheckedOutEvent; +/** + * An event published when a connection is checked into the connection pool + * @public + * @category Event + */ +class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_CHECKED_IN; + this.connectionId = connection.id; + } +} +exports.ConnectionCheckedInEvent = ConnectionCheckedInEvent; +/** + * An event published when a connection pool is cleared + * @public + * @category Event + */ +class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, options = {}) { + super(pool); + /** @internal */ + this.name = constants_1.CONNECTION_POOL_CLEARED; + this.serviceId = options.serviceId; + this.interruptInUseConnections = options.interruptInUseConnections; + } +} +exports.ConnectionPoolClearedEvent = ConnectionPoolClearedEvent; +//# sourceMappingURL=connection_pool_events.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js.map new file mode 100644 index 00000000..0bb0d6c0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/connection_pool_events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection_pool_events.js","sourceRoot":"","sources":["../../src/cmap/connection_pool_events.ts"],"names":[],"mappings":";;;AACA,4CAYsB;AAEtB,oCAAyC;AAIzC;;;;GAIG;AACH,MAAsB,6BAA6B;IAmBjD,gBAAgB;IAChB,YAAY,IAAoB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;CACF;AAxBD,sEAwBC;AAED;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,6BAA6B;IAS3E,gBAAgB;IAChB,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,CAAC,CAAC;QALd,gBAAgB;QAChB,SAAI,GAAG,mCAAuB,CAAC;QAK7B,MAAM,EAAE,aAAa,E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C;QAa5B,IAAI,CAAC,UAAU,GAAG,IAAA,qBAAa,GAAE,GAAG,YAAY,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,EAAE,CAAC;IACpC,CAAC;CACF;AApBD,8DAoBC;AAED;;;;GAIG;AACH,MAAa,wBAAyB,SAAQ,6BAA6B;IAMzE,gBAAgB;IAChB,YAAY,IAAoB,EAAE,UAAsB;QACtD,KAAK,CAAC,IAAI,CAAC,CAAC;QALd,gBAAgB;QAChB,SAAI,GAAG,iCAAqB,CAAC;QAK3B,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,EAAE,CAAC;IACpC,CAAC;CACF;AAXD,4DAWC;AAED;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,6BAA6B;IAQ3E,gBAAgB;IAChB,YACE,IAAoB,EACpB,UAAyE,EAAE;QAE3E,KAAK,CAAC,IAAI,CAAC,CAAC;QARd,gBAAgB;QAChB,SAAI,GAAG,mCAAuB,CAAC;QAQ7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IACrE,CAAC;CACF;AAjBD,gEAiBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js new file mode 100644 index 00000000..59d2ef0f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js @@ -0,0 +1,108 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WaitQueueTimeoutError = exports.PoolClearedOnNetworkError = exports.PoolClearedError = exports.PoolClosedError = void 0; +const error_1 = require("../error"); +/** + * An error indicating a connection pool is closed + * @category Error + */ +class PoolClosedError extends error_1.MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool) { + super('Attempted to check out a connection from closed connection pool'); + this.address = pool.address; + } + get name() { + return 'MongoPoolClosedError'; + } +} +exports.PoolClosedError = PoolClosedError; +/** + * An error indicating a connection pool is currently paused + * @category Error + */ +class PoolClearedError extends error_1.MongoNetworkError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool, message) { + const errorMessage = message + ? message + : `Connection pool for ${pool.address} was cleared because another operation failed with: "${pool.serverError?.message}"`; + super(errorMessage, pool.serverError ? { cause: pool.serverError } : undefined); + this.address = pool.address; + this.addErrorLabel(error_1.MongoErrorLabel.PoolRequestedRetry); + } + get name() { + return 'MongoPoolClearedError'; + } +} +exports.PoolClearedError = PoolClearedError; +/** + * An error indicating that a connection pool has been cleared after the monitor for that server timed out. + * @category Error + */ +class PoolClearedOnNetworkError extends PoolClearedError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool) { + super(pool, `Connection to ${pool.address} interrupted due to server monitor timeout`); + } + get name() { + return 'PoolClearedOnNetworkError'; + } +} +exports.PoolClearedOnNetworkError = PoolClearedOnNetworkError; +/** + * An error thrown when a request to check out a connection times out + * @category Error + */ +class WaitQueueTimeoutError extends error_1.MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, address) { + super(message); + this.address = address; + } + get name() { + return 'MongoWaitQueueTimeoutError'; + } +} +exports.WaitQueueTimeoutError = WaitQueueTimeoutError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js.map new file mode 100644 index 00000000..e3f0645e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/cmap/errors.ts"],"names":[],"mappings":";;;AAAA,oCAAgF;AAGhF;;;GAGG;AACH,MAAa,eAAgB,SAAQ,wBAAgB;IAInD;;;;;;;;;;QAUI;IACJ,YAAY,IAAoB;QAC9B,KAAK,CAAC,iEAAiE,CAAC,CAAC;QACzE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,IAAa,IAAI;QACf,OAAO,sBAAsB,CAAC;IAChC,CAAC;CACF;AAvBD,0CAuBC;AAED;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,yBAAiB;IAIrD;;;;;;;;;;QAUI;IACJ,YAAY,IAAoB,EAAE,OAAgB;QAChD,MAAM,YAAY,GAAG,OAAO;YAC1B,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,uBAAuB,IAAI,CAAC,OAAO,wDAAwD,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,CAAC;QAC5H,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAChF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE5B,IAAI,CAAC,aAAa,CAAC,uBAAe,CAAC,kBAAkB,CAAC,CAAC;IACzD,CAAC;IAED,IAAa,IAAI;QACf,OAAO,uBAAuB,CAAC;IACjC,CAAC;CACF;AA5BD,4CA4BC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,gBAAgB;IAC7D;;;;;;;;;;QAUI;IACJ,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,EAAE,iBAAiB,IAAI,CAAC,OAAO,4CAA4C,CAAC,CAAC;IACzF,CAAC;IAED,IAAa,IAAI;QACf,OAAO,2BAA2B,CAAC;IACrC,CAAC;CACF;AAnBD,8DAmBC;AAED;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,wBAAgB;IAIzD;;;;;;;;;;QAUI;IACJ,YAAY,OAAe,EAAE,OAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAa,IAAI;QACf,OAAO,4BAA4B,CAAC;IACtC,CAAC;CACF;AAvBD,sDAuBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js new file mode 100644 index 00000000..aeefd3ba --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js @@ -0,0 +1,242 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LimitedSizeDocument = void 0; +exports.isDriverInfoEqual = isDriverInfoEqual; +exports.makeClientMetadata = makeClientMetadata; +exports.getFAASEnv = getFAASEnv; +const process = require("process"); +const bson_1 = require("../../bson"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +// eslint-disable-next-line @typescript-eslint/no-require-imports +const NODE_DRIVER_VERSION = require('../../../package.json').version; +/** @internal */ +function isDriverInfoEqual(info1, info2) { + /** for equality comparison, we consider "" as unset */ + const nonEmptyCmp = (s1, s2) => { + s1 ||= undefined; + s2 ||= undefined; + return s1 === s2; + }; + return (nonEmptyCmp(info1.name, info2.name) && + nonEmptyCmp(info1.platform, info2.platform) && + nonEmptyCmp(info1.version, info2.version)); +} +/** @internal */ +class LimitedSizeDocument { + constructor(maxSize) { + this.document = new Map(); + /** BSON overhead: Int32 + Null byte */ + this.documentSize = 5; + this.maxSize = maxSize; + } + /** Only adds key/value if the bsonByteLength is less than MAX_SIZE */ + ifItFitsItSits(key, value) { + // The BSON byteLength of the new element is the same as serializing it to its own document + // subtracting the document size int32 and the null terminator. + const newElementSize = bson_1.BSON.serialize(new Map().set(key, value)).byteLength - 5; + if (newElementSize + this.documentSize > this.maxSize) { + return false; + } + this.documentSize += newElementSize; + this.document.set(key, value); + return true; + } + toObject() { + return bson_1.BSON.deserialize(bson_1.BSON.serialize(this.document), { + promoteLongs: false, + promoteBuffers: false, + promoteValues: false, + useBigInt64: false + }); + } +} +exports.LimitedSizeDocument = LimitedSizeDocument; +/** + * From the specs: + * Implementors SHOULD cumulatively update fields in the following order until the document is under the size limit: + * 1. Omit fields from `env` except `env.name`. + * 2. Omit fields from `os` except `os.type`. + * 3. Omit the `env` document entirely. + * 4. Truncate `platform`. -- special we do not truncate this field + */ +async function makeClientMetadata(driverInfoList, { appName = '', runtime }) { + const { os } = await runtime; + const metadataDocument = new LimitedSizeDocument(512); + // Add app name first, it must be sent + if (appName.length > 0) { + const name = bson_1.ByteUtils.utf8ByteLength(appName) <= 128 + ? appName + : bson_1.ByteUtils.toUTF8(bson_1.ByteUtils.fromUTF8(appName), 0, 128, false); + metadataDocument.ifItFitsItSits('application', { name }); + } + const driverInfo = { + name: 'nodejs', + version: NODE_DRIVER_VERSION + }; + // This is where we handle additional driver info added after client construction. + for (const { name: n = '', version: v = '' } of driverInfoList) { + if (n.length > 0) { + driverInfo.name = `${driverInfo.name}|${n}`; + } + if (v.length > 0) { + driverInfo.version = `${driverInfo.version}|${v}`; + } + } + if (!metadataDocument.ifItFitsItSits('driver', driverInfo)) { + throw new error_1.MongoInvalidArgumentError('Unable to include driverInfo name and version, metadata cannot exceed 512 bytes'); + } + let runtimeInfo = getRuntimeInfo(); + // This is where we handle additional driver info added after client construction. + for (const { platform = '' } of driverInfoList) { + if (platform.length > 0) { + runtimeInfo = `${runtimeInfo}|${platform}`; + } + } + if (!metadataDocument.ifItFitsItSits('platform', runtimeInfo)) { + throw new error_1.MongoInvalidArgumentError('Unable to include driverInfo platform, metadata cannot exceed 512 bytes'); + } + // Note: order matters, os.type is last so it will be removed last if we're at maxSize + const osInfo = new Map() + .set('name', os.platform()) + .set('architecture', os.arch()) + .set('version', os.release()) + .set('type', os.type()); + if (!metadataDocument.ifItFitsItSits('os', osInfo)) { + for (const key of osInfo.keys()) { + osInfo.delete(key); + if (osInfo.size === 0) + break; + if (metadataDocument.ifItFitsItSits('os', osInfo)) + break; + } + } + const faasEnv = getFAASEnv(); + if (faasEnv != null) { + if (!metadataDocument.ifItFitsItSits('env', faasEnv)) { + for (const key of faasEnv.keys()) { + faasEnv.delete(key); + if (faasEnv.size === 0) + break; + if (metadataDocument.ifItFitsItSits('env', faasEnv)) + break; + } + } + } + return await addContainerMetadata(metadataDocument.toObject()); +} +let dockerPromise; +/** @internal */ +async function getContainerMetadata() { + dockerPromise ??= (0, utils_1.fileIsAccessible)('/.dockerenv'); + const isDocker = await dockerPromise; + const { KUBERNETES_SERVICE_HOST = '' } = process.env; + const isKubernetes = KUBERNETES_SERVICE_HOST.length > 0 ? true : false; + const containerMetadata = {}; + if (isDocker) + containerMetadata.runtime = 'docker'; + if (isKubernetes) + containerMetadata.orchestrator = 'kubernetes'; + return containerMetadata; +} +/** + * @internal + * Re-add each metadata value. + * Attempt to add new env container metadata, but keep old data if it does not fit. + */ +async function addContainerMetadata(originalMetadata) { + const containerMetadata = await getContainerMetadata(); + if (Object.keys(containerMetadata).length === 0) + return originalMetadata; + const extendedMetadata = new LimitedSizeDocument(512); + const extendedEnvMetadata = { + ...originalMetadata?.env, + container: containerMetadata + }; + for (const [key, val] of Object.entries(originalMetadata)) { + if (key !== 'env') { + extendedMetadata.ifItFitsItSits(key, val); + } + else { + if (!extendedMetadata.ifItFitsItSits('env', extendedEnvMetadata)) { + // add in old data if newer / extended metadata does not fit + extendedMetadata.ifItFitsItSits('env', val); + } + } + } + if (!('env' in originalMetadata)) { + extendedMetadata.ifItFitsItSits('env', extendedEnvMetadata); + } + return extendedMetadata.toObject(); +} +/** + * Collects FaaS metadata. + * - `name` MUST be the last key in the Map returned. + */ +function getFAASEnv() { + const { AWS_EXECUTION_ENV = '', AWS_LAMBDA_RUNTIME_API = '', FUNCTIONS_WORKER_RUNTIME = '', K_SERVICE = '', FUNCTION_NAME = '', VERCEL = '', AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '', AWS_REGION = '', FUNCTION_MEMORY_MB = '', FUNCTION_REGION = '', FUNCTION_TIMEOUT_SEC = '', VERCEL_REGION = '' } = process.env; + const isAWSFaaS = AWS_EXECUTION_ENV.startsWith('AWS_Lambda_') || AWS_LAMBDA_RUNTIME_API.length > 0; + const isAzureFaaS = FUNCTIONS_WORKER_RUNTIME.length > 0; + const isGCPFaaS = K_SERVICE.length > 0 || FUNCTION_NAME.length > 0; + const isVercelFaaS = VERCEL.length > 0; + // Note: order matters, name must always be the last key + const faasEnv = new Map(); + // When isVercelFaaS is true so is isAWSFaaS; Vercel inherits the AWS env + if (isVercelFaaS && !(isAzureFaaS || isGCPFaaS)) { + if (VERCEL_REGION.length > 0) { + faasEnv.set('region', VERCEL_REGION); + } + faasEnv.set('name', 'vercel'); + return faasEnv; + } + if (isAWSFaaS && !(isAzureFaaS || isGCPFaaS || isVercelFaaS)) { + if (AWS_REGION.length > 0) { + faasEnv.set('region', AWS_REGION); + } + if (AWS_LAMBDA_FUNCTION_MEMORY_SIZE.length > 0 && + Number.isInteger(+AWS_LAMBDA_FUNCTION_MEMORY_SIZE)) { + faasEnv.set('memory_mb', new bson_1.Int32(AWS_LAMBDA_FUNCTION_MEMORY_SIZE)); + } + faasEnv.set('name', 'aws.lambda'); + return faasEnv; + } + if (isAzureFaaS && !(isGCPFaaS || isAWSFaaS || isVercelFaaS)) { + faasEnv.set('name', 'azure.func'); + return faasEnv; + } + if (isGCPFaaS && !(isAzureFaaS || isAWSFaaS || isVercelFaaS)) { + if (FUNCTION_REGION.length > 0) { + faasEnv.set('region', FUNCTION_REGION); + } + if (FUNCTION_MEMORY_MB.length > 0 && Number.isInteger(+FUNCTION_MEMORY_MB)) { + faasEnv.set('memory_mb', new bson_1.Int32(FUNCTION_MEMORY_MB)); + } + if (FUNCTION_TIMEOUT_SEC.length > 0 && Number.isInteger(+FUNCTION_TIMEOUT_SEC)) { + faasEnv.set('timeout_sec', new bson_1.Int32(FUNCTION_TIMEOUT_SEC)); + } + faasEnv.set('name', 'gcp.func'); + return faasEnv; + } + return null; +} +/** + * @internal + * Get current JavaScript runtime platform + * + * NOTE: The version information fetching is intentionally written defensively + * to avoid having a released driver version that becomes incompatible + * with a future change to these global objects. + */ +function getRuntimeInfo() { + const endianness = bson_1.NumberUtils.isBigEndian ? 'BE' : 'LE'; + if ('Deno' in globalThis) { + const version = typeof Deno?.version?.deno === 'string' ? Deno?.version?.deno : '0.0.0-unknown'; + return `Deno v${version}, ${endianness}`; + } + if ('Bun' in globalThis) { + const version = typeof Bun?.version === 'string' ? Bun?.version : '0.0.0-unknown'; + return `Bun v${version}, ${endianness}`; + } + return `Node.js ${process.version}, ${endianness}`; +} +//# sourceMappingURL=client_metadata.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js.map new file mode 100644 index 00000000..1d7c4ac5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client_metadata.js","sourceRoot":"","sources":["../../../src/cmap/handshake/client_metadata.ts"],"names":[],"mappings":";;;AAWA,8CAcC;AAkFD,gDA6EC;AA0DD,gCA0EC;AA5TD,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kBAAW,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACzD,IAAI,MAAM,IAAI,UAAU,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,OAAO,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;QAEhG,OAAO,SAAS,OAAO,KAAK,UAAU,EAAE,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,IAAI,UAAU,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,OAAO,GAAG,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QAElF,OAAO,QAAQ,OAAO,KAAK,UAAU,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO,WAAW,OAAO,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;AACrD,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js new file mode 100644 index 00000000..58d2b2fe --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPoolMetrics = void 0; +/** @internal */ +class ConnectionPoolMetrics { + constructor() { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } + static { this.TXN = 'txn'; } + static { this.CURSOR = 'cursor'; } + static { this.OTHER = 'other'; } + /** + * Mark a connection as pinned for a specific operation. + */ + markPinned(pinType) { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections += 1; + } + else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections += 1; + } + else { + this.otherConnections += 1; + } + } + /** + * Unmark a connection as pinned for an operation. + */ + markUnpinned(pinType) { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections -= 1; + } + else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections -= 1; + } + else { + this.otherConnections -= 1; + } + } + /** + * Return information about the cmap metrics as a string. + */ + info(maxPoolSize) { + return ('Timed out while checking out a connection from connection pool: ' + + `maxPoolSize: ${maxPoolSize}, ` + + `connections in use by cursors: ${this.cursorConnections}, ` + + `connections in use by transactions: ${this.txnConnections}, ` + + `connections in use by other operations: ${this.otherConnections}`); + } + /** + * Reset the metrics to the initial values. + */ + reset() { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } +} +exports.ConnectionPoolMetrics = ConnectionPoolMetrics; +//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js.map new file mode 100644 index 00000000..9dfe3a98 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/metrics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/cmap/metrics.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,MAAa,qBAAqB;IAAlC;QAKE,mBAAc,GAAG,CAAC,CAAC;QACnB,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAAG,CAAC,CAAC;IAiDvB,CAAC;aAvDiB,QAAG,GAAG,KAAc,AAAjB,CAAkB;aACrB,WAAM,GAAG,QAAiB,AAApB,CAAqB;aAC3B,UAAK,GAAG,OAAgB,AAAnB,CAAoB;IAMzC;;OAEG;IACH,UAAU,CAAC,OAAe;QACxB,IAAI,OAAO,KAAK,qBAAqB,CAAC,GAAG,EAAE,CAAC;YAC1C,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;QAC3B,CAAC;aAAM,IAAI,OAAO,KAAK,qBAAqB,CAAC,MAAM,EAAE,CAAC;YACpD,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,OAAe;QAC1B,IAAI,OAAO,KAAK,qBAAqB,CAAC,GAAG,EAAE,CAAC;YAC1C,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;QAC3B,CAAC;aAAM,IAAI,OAAO,KAAK,qBAAqB,CAAC,MAAM,EAAE,CAAC;YACpD,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,WAAmB;QACtB,OAAO,CACL,kEAAkE;YAClE,gBAAgB,WAAW,IAAI;YAC/B,kCAAkC,IAAI,CAAC,iBAAiB,IAAI;YAC5D,uCAAuC,IAAI,CAAC,cAAc,IAAI;YAC9D,2CAA2C,IAAI,CAAC,gBAAgB,EAAE,CACnE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;IAC5B,CAAC;;AAvDH,sDAwDC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js new file mode 100644 index 00000000..1665c6eb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StreamDescription = void 0; +const bson_1 = require("../bson"); +const common_1 = require("../sdam/common"); +const server_description_1 = require("../sdam/server_description"); +const RESPONSE_FIELDS = [ + 'minWireVersion', + 'maxWireVersion', + 'maxBsonObjectSize', + 'maxMessageSizeBytes', + 'maxWriteBatchSize', + 'logicalSessionTimeoutMinutes' +]; +/** @public */ +class StreamDescription { + constructor(address, options) { + this.hello = null; + this.address = address; + this.type = common_1.ServerType.Unknown; + this.minWireVersion = undefined; + this.maxWireVersion = undefined; + this.maxBsonObjectSize = 16777216; + this.maxMessageSizeBytes = 48000000; + this.maxWriteBatchSize = 100000; + this.logicalSessionTimeoutMinutes = options?.logicalSessionTimeoutMinutes; + this.loadBalanced = !!options?.loadBalanced; + this.compressors = + options && options.compressors && Array.isArray(options.compressors) + ? options.compressors + : []; + this.serverConnectionId = null; + } + receiveResponse(response) { + if (response == null) { + return; + } + this.hello = response; + this.type = (0, server_description_1.parseServerType)(response); + if ('connectionId' in response) { + this.serverConnectionId = this.parseServerConnectionID(response.connectionId); + } + else { + this.serverConnectionId = null; + } + for (const field of RESPONSE_FIELDS) { + if (response[field] != null) { + this[field] = response[field]; + } + // testing case + if ('__nodejs_mock_server__' in response) { + this.__nodejs_mock_server__ = response['__nodejs_mock_server__']; + } + } + if (response.compression) { + this.compressor = this.compressors.filter(c => response.compression?.includes(c))[0]; + } + } + /* @internal */ + parseServerConnectionID(serverConnectionId) { + // Connection ids are always integral, so it's safe to coerce doubles as well as + // any integral type. + return bson_1.Long.isLong(serverConnectionId) + ? serverConnectionId.toBigInt() + : // @ts-expect-error: Doubles are coercible to number + BigInt(serverConnectionId); + } +} +exports.StreamDescription = StreamDescription; +//# sourceMappingURL=stream_description.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js.map new file mode 100644 index 00000000..09911db4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/stream_description.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stream_description.js","sourceRoot":"","sources":["../../src/cmap/stream_description.ts"],"names":[],"mappings":";;;AAAA,kCAA2D;AAC3D,2CAA4C;AAC5C,mEAA6D;AAG7D,MAAM,eAAe,GAAG;IACtB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,8BAA8B;CACtB,CAAC;AASX,cAAc;AACd,MAAa,iBAAiB;IAoB5B,YAAY,OAAe,EAAE,OAAkC;QAFxD,UAAK,GAAoB,IAAI,CAAC;QAGnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,mBAAU,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;QAClC,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC;QAChC,IAAI,CAAC,4BAA4B,GAAG,OAAO,EAAE,4BAA4B,CAAC;QAC1E,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC;QAC5C,IAAI,CAAC,WAAW;YACd,OAAO,IAAI,OAAO,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;gBAClE,CAAC,CAAC,OAAO,CAAC,WAAW;gBACrB,CAAC,CAAC,EAAE,CAAC;QACT,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,eAAe,CAAC,QAAyB;QACvC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACr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/mongodb/lib/cmap/wire_protocol/compression.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js new file mode 100644 index 00000000..a23ca509 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js @@ -0,0 +1,179 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uncompressibleCommands = exports.Compressor = void 0; +exports.compress = compress; +exports.decompress = decompress; +exports.compressCommand = compressCommand; +exports.decompressResponse = decompressResponse; +const zlib = require("zlib"); +const bson_1 = require("../../bson"); +const constants_1 = require("../../constants"); +const deps_1 = require("../../deps"); +const error_1 = require("../../error"); +const commands_1 = require("../commands"); +const constants_2 = require("./constants"); +/** @public */ +exports.Compressor = Object.freeze({ + none: 0, + snappy: 1, + zlib: 2, + zstd: 3 +}); +exports.uncompressibleCommands = new Set([ + constants_1.LEGACY_HELLO_COMMAND, + 'saslStart', + 'saslContinue', + 'getnonce', + 'authenticate', + 'createUser', + 'updateUser', + 'copydbSaslStart', + 'copydbgetnonce', + 'copydb' +]); +const ZSTD_COMPRESSION_LEVEL = 3; +const zlibInflate = (buf) => { + return new Promise((resolve, reject) => { + zlib.inflate(buf, (error, result) => { + if (error) + return reject(error); + resolve(result); + }); + }); +}; +const zlibDeflate = (buf, options) => { + return new Promise((resolve, reject) => { + zlib.deflate(buf, options, (error, result) => { + if (error) + return reject(error); + resolve(result); + }); + }); +}; +let zstd; +let Snappy = null; +function loadSnappy() { + if (Snappy == null) { + const snappyImport = (0, deps_1.getSnappy)(); + if ('kModuleError' in snappyImport) { + throw snappyImport.kModuleError; + } + Snappy = snappyImport; + } + return Snappy; +} +// Facilitate compressing a message using an agreed compressor +async function compress(options, dataToBeCompressed) { + const zlibOptions = {}; + switch (options.agreedCompressor) { + case 'snappy': { + Snappy ??= loadSnappy(); + return await Snappy.compress(dataToBeCompressed); + } + case 'zstd': { + loadZstd(); + if ('kModuleError' in zstd) { + throw zstd['kModuleError']; + } + return await zstd.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL); + } + case 'zlib': { + if (options.zlibCompressionLevel) { + zlibOptions.level = options.zlibCompressionLevel; + } + return await zlibDeflate(dataToBeCompressed, zlibOptions); + } + default: { + throw new error_1.MongoInvalidArgumentError(`Unknown compressor ${options.agreedCompressor} failed to compress`); + } + } +} +// Decompress a message using the given compressor +async function decompress(compressorID, compressedData) { + if (compressorID !== exports.Compressor.snappy && + compressorID !== exports.Compressor.zstd && + compressorID !== exports.Compressor.zlib && + compressorID !== exports.Compressor.none) { + throw new error_1.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${compressorID})`); + } + switch (compressorID) { + case exports.Compressor.snappy: { + Snappy ??= loadSnappy(); + return await Snappy.uncompress(compressedData, { asBuffer: true }); + } + case exports.Compressor.zstd: { + loadZstd(); + if ('kModuleError' in zstd) { + throw zstd['kModuleError']; + } + return await zstd.decompress(compressedData); + } + case exports.Compressor.zlib: { + return await zlibInflate(compressedData); + } + default: { + return compressedData; + } + } +} +/** + * Load ZStandard if it is not already set. + */ +function loadZstd() { + if (!zstd) { + zstd = (0, deps_1.getZstdLibrary)(); + } +} +const MESSAGE_HEADER_SIZE = 16; +/** + * @internal + * + * Compresses an OP_MSG or OP_QUERY message, if compression is configured. This method + * also serializes the command to BSON. + */ +async function compressCommand(command, description) { + const finalCommand = description.agreedCompressor === 'none' || !commands_1.OpCompressedRequest.canCompress(command) + ? command + : new commands_1.OpCompressedRequest(command, { + agreedCompressor: description.agreedCompressor ?? 'none', + zlibCompressionLevel: description.zlibCompressionLevel ?? 0 + }); + const data = await finalCommand.toBin(); + return bson_1.ByteUtils.concat(data); +} +/** + * @internal + * + * Decompresses an OP_MSG or OP_QUERY response from the server, if compression is configured. + * + * This method does not parse the response's BSON. + */ +async function decompressResponse(message) { + const messageHeader = { + length: (0, bson_1.readInt32LE)(message, 0), + requestId: (0, bson_1.readInt32LE)(message, 4), + responseTo: (0, bson_1.readInt32LE)(message, 8), + opCode: (0, bson_1.readInt32LE)(message, 12) + }; + if (messageHeader.opCode !== constants_2.OP_COMPRESSED) { + const ResponseType = messageHeader.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply; + const messageBody = message.subarray(MESSAGE_HEADER_SIZE); + return new ResponseType(message, messageHeader, messageBody); + } + const header = { + ...messageHeader, + fromCompressed: true, + opCode: (0, bson_1.readInt32LE)(message, MESSAGE_HEADER_SIZE), + length: (0, bson_1.readInt32LE)(message, MESSAGE_HEADER_SIZE + 4) + }; + const compressorID = message[MESSAGE_HEADER_SIZE + 8]; + const compressedBuffer = message.slice(MESSAGE_HEADER_SIZE + 9); + // recalculate based on wrapped opcode + const ResponseType = header.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply; + const messageBody = await decompress(compressorID, compressedBuffer); + if (messageBody.length !== header.length) { + throw new error_1.MongoDecompressionError('Message body and message header must be the same length'); + } + return new ResponseType(message, header, messageBody); +} +//# sourceMappingURL=compression.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map new file mode 100644 index 00000000..ca716c39 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compression.js","sourceRoot":"","sources":["../../../src/cmap/wire_protocol/compression.ts"],"names":[],"mappings":";;;AA6EA,4BA6BC;AAGD,gCAkCC;AAmBD,0CAaC;AASD,gDA8BC;AAtND,6BAA6B;AAE7B,qCAAoD;AACpD,+CAAuD;AACvD,qCAAuF;AACvF,uCAAiF;AACjF,0CAOqB;AACrB,2CAAoD;AAEpD,cAAc;AACD,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC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tD,MAAM,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,mBAAmB,GAAG,CAAC,CAAC,CAAC;IAEhE,sCAAsC;IACtC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,KAAK,kBAAM,CAAC,CAAC,CAAC,wBAAa,CAAC,CAAC,CAAC,kBAAO,CAAC;IACxE,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IACrE,IAAI,WAAW,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;QACzC,MAAM,IAAI,+BAAuB,CAAC,yDAAyD,CAAC,CAAC;IAC/F,CAAC;IACD,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AACxD,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js new file mode 100644 index 00000000..d7a03e10 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OP_MSG = exports.OP_COMPRESSED = exports.OP_DELETE = exports.OP_QUERY = exports.OP_INSERT = exports.OP_UPDATE = exports.OP_REPLY = exports.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = exports.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = exports.MIN_SUPPORTED_QE_SERVER_VERSION = exports.MIN_SUPPORTED_QE_WIRE_VERSION = exports.MAX_SUPPORTED_WIRE_VERSION = exports.MIN_SUPPORTED_WIRE_VERSION = exports.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION = exports.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION = exports.MAX_SUPPORTED_SERVER_VERSION = exports.MIN_SUPPORTED_SERVER_VERSION = void 0; +exports.MIN_SUPPORTED_SERVER_VERSION = '4.4'; +exports.MAX_SUPPORTED_SERVER_VERSION = '9.0'; +exports.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION = 13; +exports.MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION = '5.0'; +exports.MIN_SUPPORTED_WIRE_VERSION = 9; +exports.MAX_SUPPORTED_WIRE_VERSION = 29; +exports.MIN_SUPPORTED_QE_WIRE_VERSION = 21; +exports.MIN_SUPPORTED_QE_SERVER_VERSION = '7.0'; +exports.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = 27; +exports.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = '8.2'; +exports.OP_REPLY = 1; +exports.OP_UPDATE = 2001; +exports.OP_INSERT = 2002; +exports.OP_QUERY = 2004; +exports.OP_DELETE = 2006; +exports.OP_COMPRESSED = 2012; +exports.OP_MSG = 2013; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map new file mode 100644 index 00000000..181ec4d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/cmap/wire_protocol/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,yCAAyC,GAAG,EAAE,CAAC;AAC/C,QAAA,2CAA2C,GAAG,KAAK,CAAC;AACpD,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAC/B,QAAA,0BAA0B,GAAG,EAAE,CAAC;AAChC,QAAA,6BAA6B,GAAG,EAAE,CAAC;AACnC,QAAA,+BAA+B,GAAG,KAAK,CAAC;AACxC,QAAA,mCAAmC,GAAG,EAAE,CAAC;AACzC,QAAA,qCAAqC,GAAG,KAAK,CAAC;AAC9C,QAAA,QAAQ,GAAG,CAAC,CAAC;AACb,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,QAAQ,GAAG,IAAI,CAAC;AAChB,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,aAAa,GAAG,IAAI,CAAC;AACrB,QAAA,MAAM,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js new file mode 100644 index 00000000..fb7e8fe3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js @@ -0,0 +1,111 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.onData = onData; +const utils_1 = require("../../utils"); +/** + * onData is adapted from Node.js' events.on helper + * https://nodejs.org/api/events.html#eventsonemitter-eventname-options + * + * Returns an AsyncIterator that iterates each 'data' event emitted from emitter. + * It will reject upon an error event. + */ +function onData(emitter, { timeoutContext, signal }) { + signal?.throwIfAborted(); + // Setup pending events and pending promise lists + /** + * When the caller has not yet called .next(), we store the + * value from the event in this list. Next time they call .next() + * we pull the first value out of this list and resolve a promise with it. + */ + const unconsumedEvents = new utils_1.List(); + /** + * When there has not yet been an event, a new promise will be created + * and implicitly stored in this list. When an event occurs we take the first + * promise in this list and resolve it. + */ + const unconsumedPromises = new utils_1.List(); + /** + * Stored an error created by an error event. + * This error will turn into a rejection for the subsequent .next() call + */ + let error = null; + /** Set to true only after event listeners have been removed. */ + let finished = false; + const iterator = { + next() { + // First, we consume all unread events + const value = unconsumedEvents.shift(); + if (value != null) { + return Promise.resolve({ value, done: false }); + } + // Then we error, if an error happened + // This happens one time if at all, because after 'error' + // we stop listening + if (error != null) { + const p = Promise.reject(error); + // Only the first element errors + error = null; + return p; + } + // If the iterator is finished, resolve to done + if (finished) + return closeHandler(); + // Wait until an event happens + const { promise, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + unconsumedPromises.push({ resolve, reject }); + return promise; + }, + return() { + return closeHandler(); + }, + throw(err) { + errorHandler(err); + return Promise.resolve({ value: undefined, done: true }); + }, + [Symbol.asyncIterator]() { + return this; + }, + async [Symbol.asyncDispose]() { + await closeHandler(); + } + }; + // Adding event handlers + emitter.on('data', eventHandler); + emitter.on('error', errorHandler); + const abortListener = (0, utils_1.addAbortListener)(signal, function () { + errorHandler(this.reason); + }); + const timeoutForSocketRead = timeoutContext?.timeoutForSocketRead; + timeoutForSocketRead?.throwIfExpired(); + timeoutForSocketRead?.then(undefined, errorHandler); + return iterator; + function eventHandler(value) { + const promise = unconsumedPromises.shift(); + if (promise != null) + promise.resolve({ value, done: false }); + else + unconsumedEvents.push(value); + } + function errorHandler(err) { + const promise = unconsumedPromises.shift(); + if (promise != null) + promise.reject(err); + else + error = err; + void closeHandler(); + } + function closeHandler() { + // Adding event handlers + emitter.off('data', eventHandler); + emitter.off('error', errorHandler); + abortListener?.[utils_1.kDispose](); + finished = true; + timeoutForSocketRead?.clear(); + const doneResult = { value: undefined, done: finished }; + for (const promise of unconsumedPromises) { + promise.resolve(doneResult); + } + return Promise.resolve(doneResult); + } +} +//# sourceMappingURL=on_data.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js.map new file mode 100644 index 00000000..fc2a6f93 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol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AK,EAAE,CAAC;QAE3C,IAAI,OAAO,IAAI,IAAI;YAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;;YACpC,KAAK,GAAG,GAAG,CAAC;QACjB,KAAK,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,SAAS,YAAY;QACnB,wBAAwB;QACxB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACnC,aAAa,EAAE,CAAC,gBAAQ,CAAC,EAAE,CAAC;QAC5B,QAAQ,GAAG,IAAI,CAAC;QAChB,oBAAoB,EAAE,KAAK,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAW,CAAC;QAEjE,KAAK,MAAM,OAAO,IAAI,kBAAkB,EAAE,CAAC;YACzC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC9B,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js new file mode 100644 index 00000000..ccfb9836 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js @@ -0,0 +1,222 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OnDemandDocument = void 0; +const bson_1 = require("../../../bson"); +const BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 +}; +/** @internal */ +class OnDemandDocument { + constructor(bson, offset = 0, isArray = false, + /** If elements was already calculated */ + elements) { + /** + * Maps JS strings to elements and jsValues for speeding up subsequent lookups. + * - If `false` then name does not exist in the BSON document + * - If `CachedBSONElement` instance name exists + * - If `cache[name].value == null` jsValue has not yet been parsed + * - Null/Undefined values do not get cached because they are zero-length values. + */ + this.cache = Object.create(null); + /** Caches the index of elements that have been named */ + this.indexFound = Object.create(null); + this.bson = bson; + this.offset = offset; + this.isArray = isArray; + this.elements = elements ?? (0, bson_1.parseToElementsToArray)(this.bson, offset); + } + /** Only supports basic latin strings */ + isElementName(name, element) { + const nameLength = element[BSONElementOffset.nameLength]; + const nameOffset = element[BSONElementOffset.nameOffset]; + if (name.length !== nameLength) + return false; + const nameEnd = nameOffset + nameLength; + for (let byteIndex = nameOffset, charIndex = 0; charIndex < name.length && byteIndex < nameEnd; charIndex++, byteIndex++) { + if (this.bson[byteIndex] !== name.charCodeAt(charIndex)) + return false; + } + return true; + } + /** + * Seeks into the elements array for an element matching the given name. + * + * @remarks + * Caching: + * - Caches the existence of a property making subsequent look ups for non-existent properties return immediately + * - Caches names mapped to elements to avoid reiterating the array and comparing the name again + * - Caches the index at which an element has been found to prevent rechecking against elements already determined to belong to another name + * + * @param name - a basic latin string name of a BSON element + * @returns + */ + getElement(name) { + const cachedElement = this.cache[name]; + if (cachedElement === false) + return null; + if (cachedElement != null) { + return cachedElement; + } + if (typeof name === 'number') { + if (this.isArray) { + if (name < this.elements.length) { + const element = this.elements[name]; + const cachedElement = { element, value: undefined }; + this.cache[name] = cachedElement; + this.indexFound[name] = true; + return cachedElement; + } + else { + return null; + } + } + else { + return null; + } + } + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + // skip this element if it has already been associated with a name + if (!(index in this.indexFound) && this.isElementName(name, element)) { + const cachedElement = { element, value: undefined }; + this.cache[name] = cachedElement; + this.indexFound[index] = true; + return cachedElement; + } + } + this.cache[name] = false; + return null; + } + toJSValue(element, as) { + const type = element[BSONElementOffset.type]; + const offset = element[BSONElementOffset.offset]; + const length = element[BSONElementOffset.length]; + if (as !== type) { + return null; + } + switch (as) { + case bson_1.BSONType.null: + case bson_1.BSONType.undefined: + return null; + case bson_1.BSONType.double: + return bson_1.NumberUtils.getFloat64LE(this.bson, offset); + case bson_1.BSONType.int: + return bson_1.NumberUtils.getInt32LE(this.bson, offset); + case bson_1.BSONType.long: + return bson_1.NumberUtils.getBigInt64LE(this.bson, offset); + case bson_1.BSONType.bool: + return Boolean(this.bson[offset]); + case bson_1.BSONType.objectId: + return new bson_1.ObjectId(this.bson.subarray(offset, offset + 12)); + case bson_1.BSONType.timestamp: + return new bson_1.Timestamp(bson_1.NumberUtils.getBigInt64LE(this.bson, offset)); + case bson_1.BSONType.string: + return bson_1.ByteUtils.toUTF8(this.bson, offset + 4, offset + length - 1, false); + case bson_1.BSONType.binData: { + const totalBinarySize = bson_1.NumberUtils.getInt32LE(this.bson, offset); + const subType = this.bson[offset + 4]; + if (subType === 2) { + const subType2BinarySize = bson_1.NumberUtils.getInt32LE(this.bson, offset + 1 + 4); + if (subType2BinarySize < 0) + throw new bson_1.BSONError('Negative binary type element size found for subtype 0x02'); + if (subType2BinarySize > totalBinarySize - 4) + throw new bson_1.BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (subType2BinarySize < totalBinarySize - 4) + throw new bson_1.BSONError('Binary type with subtype 0x02 contains too short binary size'); + return new bson_1.Binary(this.bson.subarray(offset + 1 + 4 + 4, offset + 1 + 4 + 4 + subType2BinarySize), 2); + } + return new bson_1.Binary(this.bson.subarray(offset + 1 + 4, offset + 1 + 4 + totalBinarySize), subType); + } + case bson_1.BSONType.date: + // Pretend this is correct. + return new Date(Number(bson_1.NumberUtils.getBigInt64LE(this.bson, offset))); + case bson_1.BSONType.object: + return new OnDemandDocument(this.bson, offset); + case bson_1.BSONType.array: + return new OnDemandDocument(this.bson, offset, true); + default: + throw new bson_1.BSONError(`Unsupported BSON type: ${as}`); + } + } + /** + * Returns the number of elements in this BSON document + */ + size() { + return this.elements.length; + } + /** + * Checks for the existence of an element by name. + * + * @remarks + * Uses `getElement` with the expectation that will populate caches such that a `has` call + * followed by a `getElement` call will not repeat the cost paid by the first look up. + * + * @param name - element name + */ + has(name) { + const cachedElement = this.cache[name]; + if (cachedElement === false) + return false; + if (cachedElement != null) + return true; + return this.getElement(name) != null; + } + get(name, as, required) { + const element = this.getElement(name); + if (element == null) { + if (required === true) { + throw new bson_1.BSONError(`BSON element "${name}" is missing`); + } + else { + return null; + } + } + if (element.value == null) { + const value = this.toJSValue(element.element, as); + if (value == null) { + if (required === true) { + throw new bson_1.BSONError(`BSON element "${name}" is missing`); + } + else { + return null; + } + } + // It is important to never store null + element.value = value; + } + return element.value; + } + getNumber(name, required) { + const maybeBool = this.get(name, bson_1.BSONType.bool); + const bool = maybeBool == null ? null : maybeBool ? 1 : 0; + const maybeLong = this.get(name, bson_1.BSONType.long); + const long = maybeLong == null ? null : Number(maybeLong); + const result = bool ?? long ?? this.get(name, bson_1.BSONType.int) ?? this.get(name, bson_1.BSONType.double); + if (required === true && result == null) { + throw new bson_1.BSONError(`BSON element "${name}" is missing`); + } + return result; + } + /** + * Deserialize this object, DOES NOT cache result so avoid multiple invocations + * @param options - BSON deserialization options + */ + toObject(options) { + return (0, bson_1.deserialize)(this.bson, { + ...options, + index: this.offset, + allowObjectSmallerThanBufferSize: true + }); + } + /** Returns this document's bytes only */ + toBytes() { + const size = bson_1.NumberUtils.getInt32LE(this.bson, this.offset); + return this.bson.subarray(this.offset, this.offset + size); + } +} +exports.OnDemandDocument = OnDemandDocument; +//# sourceMappingURL=document.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js.map new file mode 100644 index 00000000..62bbed98 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js.map @@ -0,0 +1 @@ +{"version":3,"file":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IAAI,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAE1D,MAAM,MAAM,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,eAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,eAAQ,CAAC,MAAM,CAAC,CAAC;QAE/F,IAAI,QAAQ,KAAK,IAAI,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACxC,MAAM,IAAI,gBAAS,CAAC,iBAAiB,IAAI,cAAc,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,OAA4C;QAC1D,OAAO,IAAA,kBAAW,EAAC,IAAI,CAAC,IAAI,EAAE;YAC5B,GAAG,OAAO;YACV,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,gCAAgC,EAAE,IAAI;SACvC,CAAC,CAAC;IACL,CAAC;IAED,yCAAyC;IACzC,OAAO;QACL,MAAM,IAAI,GAAG,kBAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7D,CAAC;CACF;AAhTD,4CAgTC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js new file mode 100644 index 00000000..5a5dd188 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js @@ -0,0 +1,315 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientBulkWriteCursorResponse = exports.ExplainedCursorResponse = exports.CursorResponse = exports.MongoDBResponse = void 0; +exports.isErrorResponse = isErrorResponse; +const bson_1 = require("../../bson"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const document_1 = require("./on_demand/document"); +const BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 +}; +/** + * Accepts a BSON payload and checks for na "ok: 0" element. + * This utility is intended to prevent calling response class constructors + * that expect the result to be a success and demand certain properties to exist. + * + * For example, a cursor response always expects a cursor embedded document. + * In order to write the class such that the properties reflect that assertion (non-null) + * we cannot invoke the subclass constructor if the BSON represents an error. + * + * @param bytes - BSON document returned from the server + */ +function isErrorResponse(bson, elements) { + for (let eIdx = 0; eIdx < elements.length; eIdx++) { + const element = elements[eIdx]; + if (element[BSONElementOffset.nameLength] === 2) { + const nameOffset = element[BSONElementOffset.nameOffset]; + // 111 == "o", 107 == "k" + if (bson[nameOffset] === 111 && bson[nameOffset + 1] === 107) { + const valueOffset = element[BSONElementOffset.offset]; + const valueLength = element[BSONElementOffset.length]; + // If any byte in the length of the ok number (works for any type) is non zero, + // then it is considered "ok: 1" + for (let i = valueOffset; i < valueOffset + valueLength; i++) { + if (bson[i] !== 0x00) + return false; + } + return true; + } + } + } + return true; +} +/** @internal */ +class MongoDBResponse extends document_1.OnDemandDocument { + get(name, as, required) { + try { + return super.get(name, as, required); + } + catch (cause) { + throw new error_1.MongoUnexpectedServerResponseError(cause.message, { cause }); + } + } + static is(value) { + return value instanceof MongoDBResponse; + } + static make(bson) { + const elements = (0, bson_1.parseToElementsToArray)(bson, 0); + const isError = isErrorResponse(bson, elements); + return isError + ? new MongoDBResponse(bson, 0, false, elements) + : new this(bson, 0, false, elements); + } + // {ok:1} + static { this.empty = new MongoDBResponse(new Uint8Array([13, 0, 0, 0, 16, 111, 107, 0, 1, 0, 0, 0, 0])); } + /** + * Returns true iff: + * - ok is 0 and the top-level code === 50 + * - ok is 1 and the writeErrors array contains a code === 50 + * - ok is 1 and the writeConcern object contains a code === 50 + */ + get isMaxTimeExpiredError() { + // {ok: 0, code: 50 ... } + const isTopLevel = this.ok === 0 && this.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired; + if (isTopLevel) + return true; + if (this.ok === 0) + return false; + // {ok: 1, writeConcernError: {code: 50 ... }} + const isWriteConcern = this.get('writeConcernError', bson_1.BSONType.object)?.getNumber('code') === + error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired; + if (isWriteConcern) + return true; + const writeErrors = this.get('writeErrors', bson_1.BSONType.array); + if (writeErrors?.size()) { + for (let i = 0; i < writeErrors.size(); i++) { + const isWriteError = writeErrors.get(i, bson_1.BSONType.object)?.getNumber('code') === + error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired; + // {ok: 1, writeErrors: [{code: 50 ... }]} + if (isWriteError) + return true; + } + } + return false; + } + /** + * Drivers can safely assume that the `recoveryToken` field is always a BSON document but drivers MUST NOT modify the + * contents of the document. + */ + get recoveryToken() { + return (this.get('recoveryToken', bson_1.BSONType.object)?.toObject({ + promoteValues: false, + promoteLongs: false, + promoteBuffers: false, + validation: { utf8: true } + }) ?? null); + } + /** + * The server creates a cursor in response to a snapshot find/aggregate command and reports atClusterTime within the cursor field in the response. + * For the distinct command the server adds a top-level atClusterTime field to the response. + * The atClusterTime field represents the timestamp of the read and is guaranteed to be majority committed. + */ + get atClusterTime() { + return (this.get('cursor', bson_1.BSONType.object)?.get('atClusterTime', bson_1.BSONType.timestamp) ?? + this.get('atClusterTime', bson_1.BSONType.timestamp)); + } + get operationTime() { + return this.get('operationTime', bson_1.BSONType.timestamp); + } + /** Normalizes whatever BSON value is "ok" to a JS number 1 or 0. */ + get ok() { + return this.getNumber('ok') ? 1 : 0; + } + get $err() { + return this.get('$err', bson_1.BSONType.string); + } + get errmsg() { + return this.get('errmsg', bson_1.BSONType.string); + } + get code() { + return this.getNumber('code'); + } + get $clusterTime() { + if (!('clusterTime' in this)) { + const clusterTimeDoc = this.get('$clusterTime', bson_1.BSONType.object); + if (clusterTimeDoc == null) { + this.clusterTime = null; + return null; + } + const clusterTime = clusterTimeDoc.get('clusterTime', bson_1.BSONType.timestamp, true); + const signature = clusterTimeDoc.get('signature', bson_1.BSONType.object)?.toObject(); + // @ts-expect-error: `signature` is incorrectly typed. It is public API. + this.clusterTime = { clusterTime, signature }; + } + return this.clusterTime ?? null; + } + toObject(options) { + const exactBSONOptions = { + ...(0, bson_1.pluckBSONSerializeOptions)(options ?? {}), + validation: (0, bson_1.parseUtf8ValidationOption)(options) + }; + return super.toObject(exactBSONOptions); + } +} +exports.MongoDBResponse = MongoDBResponse; +/** @internal */ +class CursorResponse extends MongoDBResponse { + constructor() { + super(...arguments); + this._batch = null; + this.iterated = 0; + this._encryptedBatch = null; + } + /** + * This supports a feature of the FindCursor. + * It is an optimization to avoid an extra getMore when the limit has been reached + */ + static get emptyGetMore() { + return new CursorResponse((0, bson_1.serialize)({ ok: 1, cursor: { id: 0n, nextBatch: [] } })); + } + static is(value) { + return value instanceof CursorResponse || value === CursorResponse.emptyGetMore; + } + get cursor() { + return this.get('cursor', bson_1.BSONType.object, true); + } + get id() { + try { + return bson_1.Long.fromBigInt(this.cursor.get('id', bson_1.BSONType.long, true)); + } + catch (cause) { + throw new error_1.MongoUnexpectedServerResponseError(cause.message, { cause }); + } + } + get ns() { + const namespace = this.cursor.get('ns', bson_1.BSONType.string); + if (namespace != null) + return (0, utils_1.ns)(namespace); + return null; + } + get length() { + return Math.max(this.batchSize - this.iterated, 0); + } + get encryptedBatch() { + if (this.encryptedResponse == null) + return null; + if (this._encryptedBatch != null) + return this._encryptedBatch; + const cursor = this.encryptedResponse?.get('cursor', bson_1.BSONType.object); + if (cursor?.has('firstBatch')) + this._encryptedBatch = cursor.get('firstBatch', bson_1.BSONType.array, true); + else if (cursor?.has('nextBatch')) + this._encryptedBatch = cursor.get('nextBatch', bson_1.BSONType.array, true); + else + throw new error_1.MongoUnexpectedServerResponseError('Cursor document did not contain a batch'); + return this._encryptedBatch; + } + get batch() { + if (this._batch != null) + return this._batch; + const cursor = this.cursor; + if (cursor.has('firstBatch')) + this._batch = cursor.get('firstBatch', bson_1.BSONType.array, true); + else if (cursor.has('nextBatch')) + this._batch = cursor.get('nextBatch', bson_1.BSONType.array, true); + else + throw new error_1.MongoUnexpectedServerResponseError('Cursor document did not contain a batch'); + return this._batch; + } + get batchSize() { + return this.batch?.size(); + } + get postBatchResumeToken() { + return (this.cursor.get('postBatchResumeToken', bson_1.BSONType.object)?.toObject({ + promoteValues: false, + promoteLongs: false, + promoteBuffers: false, + validation: { utf8: true } + }) ?? null); + } + shift(options) { + if (this.iterated >= this.batchSize) { + return null; + } + const result = this.batch.get(this.iterated, bson_1.BSONType.object, true) ?? null; + const encryptedResult = this.encryptedBatch?.get(this.iterated, bson_1.BSONType.object, true) ?? null; + this.iterated += 1; + if (options?.raw) { + return result.toBytes(); + } + else { + const object = result.toObject(options); + if (encryptedResult) { + (0, utils_1.decorateDecryptionResult)(object, encryptedResult.toObject(options), true); + } + return object; + } + } + clear() { + this.iterated = this.batchSize; + } +} +exports.CursorResponse = CursorResponse; +/** + * Explain responses have nothing to do with cursor responses + * This class serves to temporarily avoid refactoring how cursors handle + * explain responses which is to detect that the response is not cursor-like and return the explain + * result as the "first and only" document in the "batch" and end the "cursor" + */ +class ExplainedCursorResponse extends CursorResponse { + constructor() { + super(...arguments); + this.isExplain = true; + this._length = 1; + } + get id() { + return bson_1.Long.fromBigInt(0n); + } + get batchSize() { + return 0; + } + get ns() { + return null; + } + get length() { + return this._length; + } + shift(options) { + if (this._length === 0) + return null; + this._length -= 1; + return this.toObject(options); + } +} +exports.ExplainedCursorResponse = ExplainedCursorResponse; +/** + * Client bulk writes have some extra metadata at the top level that needs to be + * included in the result returned to the user. + */ +class ClientBulkWriteCursorResponse extends CursorResponse { + get insertedCount() { + return this.get('nInserted', bson_1.BSONType.int, true); + } + get upsertedCount() { + return this.get('nUpserted', bson_1.BSONType.int, true); + } + get matchedCount() { + return this.get('nMatched', bson_1.BSONType.int, true); + } + get modifiedCount() { + return this.get('nModified', bson_1.BSONType.int, true); + } + get deletedCount() { + return this.get('nDeleted', bson_1.BSONType.int, true); + } + get writeConcernError() { + return this.get('writeConcernError', bson_1.BSONType.object, false); + } +} +exports.ClientBulkWriteCursorResponse = ClientBulkWriteCursorResponse; +//# sourceMappingURL=responses.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js.map new file mode 100644 index 00000000..a5dd903e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.js.map @@ -0,0 +1 @@ +{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/cmap/wire_protocol/responses.ts"],"names":[],"mappings":";;;AAyCA,0CAwBC;AAjED,qCAYoB;AACpB,uCAAsF;AAEtF,uCAA2D;AAC3D,mDAI8B;AAE9B,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,CAAC;IACP,UAAU,EAAE,CAAC;IACb,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;CACD,CAAC;AAEX;;;;;;;;;;GAUG;AACH,SAAgB,eAAe,CAAC,IAAgB,EAAE,QAAuB;IACvE,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAChD,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,C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G,CAAC,mBAAmB,EAAE,eAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;CACF;AAxBD,sEAwBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js new file mode 100644 index 00000000..bbe66b54 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getReadPreference = getReadPreference; +exports.isSharded = isSharded; +const error_1 = require("../../error"); +const read_preference_1 = require("../../read_preference"); +const common_1 = require("../../sdam/common"); +const topology_description_1 = require("../../sdam/topology_description"); +function getReadPreference(options) { + // Default to command version of the readPreference. + let readPreference = options?.readPreference ?? read_preference_1.ReadPreference.primary; + if (typeof readPreference === 'string') { + readPreference = read_preference_1.ReadPreference.fromString(readPreference); + } + if (!(readPreference instanceof read_preference_1.ReadPreference)) { + throw new error_1.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance'); + } + return readPreference; +} +function isSharded(topologyOrServer) { + if (topologyOrServer == null) { + return false; + } + if (topologyOrServer.description && topologyOrServer.description.type === common_1.ServerType.Mongos) { + return true; + } + // NOTE: This is incredibly inefficient, and should be removed once command construction + // happens based on `Server` not `Topology`. + if (topologyOrServer.description && topologyOrServer.description instanceof topology_description_1.TopologyDescription) { + const servers = Array.from(topologyOrServer.description.servers.values()); + return servers.some((server) => server.type === common_1.ServerType.Mongos); + } + return false; +} +//# sourceMappingURL=shared.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map new file mode 100644 index 00000000..a0cce4d4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map @@ -0,0 +1 @@ +{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/cmap/wire_protocol/shared.ts"],"names":[],"mappings":";;AAaA,8CAeC;AAED,8BAiBC;AA/CD,uCAAwD;AACxD,2DAAgF;AAChF,8CAA+C;AAI/C,0EAAsE;AAOtE,SAAgB,iBAAiB,CAAC,OAA8B;IAC9D,oDAAoD;IACpD,IAAI,cAAc,GAAG,OAAO,EAAE,cAAc,IAAI,gCAAc,CAAC,OAAO,CAAC;IAEvE,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QACvC,cAAc,GAAG,gCAAc,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,CAAC,CAAC,cAAc,YAAY,gCAAc,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,iCAAyB,CACjC,2DAA2D,CAC5D,CAAC;IACJ,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAgB,SAAS,CAAC,gBAAiD;IACzE,IAAI,gBAAgB,IAAI,IAAI,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,WAAW,CAAC,IAAI,KAAK,mBAAU,CAAC,MAAM,EAAE,CAAC;QAC5F,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wFAAwF;IACxF,4CAA4C;IAC5C,IAAI,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,WAAW,YAAY,0CAAmB,EAAE,CAAC;QAChG,MAAM,OAAO,GAAwB,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC/F,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAyB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,mBAAU,CAAC,MAAM,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js new file mode 100644 index 00000000..0d1a5ba9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js @@ -0,0 +1,751 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Collection = void 0; +const bson_1 = require("./bson"); +const ordered_1 = require("./bulk/ordered"); +const unordered_1 = require("./bulk/unordered"); +const change_stream_1 = require("./change_stream"); +const aggregation_cursor_1 = require("./cursor/aggregation_cursor"); +const find_cursor_1 = require("./cursor/find_cursor"); +const list_indexes_cursor_1 = require("./cursor/list_indexes_cursor"); +const list_search_indexes_cursor_1 = require("./cursor/list_search_indexes_cursor"); +const error_1 = require("./error"); +const count_1 = require("./operations/count"); +const delete_1 = require("./operations/delete"); +const distinct_1 = require("./operations/distinct"); +const estimated_document_count_1 = require("./operations/estimated_document_count"); +const execute_operation_1 = require("./operations/execute_operation"); +const find_and_modify_1 = require("./operations/find_and_modify"); +const indexes_1 = require("./operations/indexes"); +const insert_1 = require("./operations/insert"); +const rename_1 = require("./operations/rename"); +const create_1 = require("./operations/search_indexes/create"); +const drop_1 = require("./operations/search_indexes/drop"); +const update_1 = require("./operations/search_indexes/update"); +const update_2 = require("./operations/update"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const utils_1 = require("./utils"); +const write_concern_1 = require("./write_concern"); +/** + * The **Collection** class is an internal class that embodies a MongoDB collection + * allowing for insert/find/update/delete and other command operation on that MongoDB collection. + * + * **COLLECTION Cannot directly be instantiated** + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * interface Pet { + * name: string; + * kind: 'dog' | 'cat' | 'fish'; + * } + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const pets = client.db().collection('pets'); + * + * const petCursor = pets.find(); + * + * for await (const pet of petCursor) { + * console.log(`${pet.name} is a ${pet.kind}!`); + * } + * ``` + */ +class Collection { + /** + * Create a new Collection instance + * @internal + */ + constructor(db, name, options) { + this.db = db; + // Internal state + this.s = { + db, + options, + namespace: new utils_1.MongoDBCollectionNamespace(db.databaseName, name), + pkFactory: db.options?.pkFactory ?? utils_1.DEFAULT_PK_FACTORY, + readPreference: read_preference_1.ReadPreference.fromOptions(options), + bsonOptions: (0, bson_1.resolveBSONOptions)(options, db), + readConcern: read_concern_1.ReadConcern.fromOptions(options), + writeConcern: write_concern_1.WriteConcern.fromOptions(options) + }; + this.client = db.client; + } + /** + * The name of the database this collection belongs to + */ + get dbName() { + return this.s.namespace.db; + } + /** + * The name of this collection + */ + get collectionName() { + return this.s.namespace.collection; + } + /** + * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}` + */ + get namespace() { + return this.fullNamespace.toString(); + } + /** + * @internal + * + * The `MongoDBNamespace` for the collection. + */ + get fullNamespace() { + return this.s.namespace; + } + /** + * The current readConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readConcern() { + if (this.s.readConcern == null) { + return this.db.readConcern; + } + return this.s.readConcern; + } + /** + * The current readPreference of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readPreference() { + if (this.s.readPreference == null) { + return this.db.readPreference; + } + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + /** + * The current writeConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get writeConcern() { + if (this.s.writeConcern == null) { + return this.db.writeConcern; + } + return this.s.writeConcern; + } + /** The current index hint for the collection */ + get hint() { + return this.s.collectionHint; + } + set hint(v) { + this.s.collectionHint = (0, utils_1.normalizeHintField)(v); + } + get timeoutMS() { + return this.s.options.timeoutMS; + } + /** + * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param doc - The document to insert + * @param options - Optional settings for the command + */ + async insertOne(doc, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new insert_1.InsertOneOperation(this, doc, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param docs - The documents to insert + * @param options - Optional settings for the command + */ + async insertMany(docs, options) { + if (!Array.isArray(docs)) { + throw new error_1.MongoInvalidArgumentError('Argument "docs" must be an array of documents'); + } + options = (0, utils_1.resolveOptions)(this, options ?? {}); + const acknowledged = write_concern_1.WriteConcern.fromOptions(options)?.w !== 0; + try { + const res = await this.bulkWrite(docs.map(doc => ({ insertOne: { document: doc } })), options); + return { + acknowledged, + insertedCount: res.insertedCount, + insertedIds: res.insertedIds + }; + } + catch (err) { + if (err && err.message === 'Operation must be an object with an operation key') { + throw new error_1.MongoInvalidArgumentError('Collection.insertMany() cannot be called with an array that has null/undefined values'); + } + throw err; + } + } + /** + * Perform a bulkWrite operation without a fluent API + * + * Legal operation types are + * - `insertOne` + * - `replaceOne` + * - `updateOne` + * - `updateMany` + * - `deleteOne` + * - `deleteMany` + * + * If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param operations - Bulk operations to perform + * @param options - Optional settings for the command + * @throws MongoDriverError if operations is not an array + */ + async bulkWrite(operations, options) { + if (!Array.isArray(operations)) { + throw new error_1.MongoInvalidArgumentError('Argument "operations" must be an array of documents'); + } + options = (0, utils_1.resolveOptions)(this, options ?? {}); + // TODO(NODE-7071): remove once the client doesn't need to be connected to construct + // bulk operations + const isConnected = this.client.topology != null; + if (!isConnected) { + await (0, execute_operation_1.autoConnect)(this.client); + } + // Create the bulk operation + const bulk = options.ordered === false + ? this.initializeUnorderedBulkOp(options) + : this.initializeOrderedBulkOp(options); + // for each op go through and add to the bulk + for (const operation of operations) { + bulk.raw(operation); + } + // Execute the bulk + return await bulk.execute({ ...options }); + } + /** + * Update a single document in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + async updateOne(filter, update, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_2.UpdateOneOperation(this.s.namespace, filter, update, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Replace a document in a collection with another document + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + */ + async replaceOne(filter, replacement, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_2.ReplaceOneOperation(this.s.namespace, filter, replacement, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Update multiple documents in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + async updateMany(filter, update, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_2.UpdateManyOperation(this.s.namespace, filter, update, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Delete a document from a collection + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + */ + async deleteOne(filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new delete_1.DeleteOneOperation(this.s.namespace, filter, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Delete multiple documents from a collection + * + * @param filter - The filter used to select the documents to remove + * @param options - Optional settings for the command + */ + async deleteMany(filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new delete_1.DeleteManyOperation(this.s.namespace, filter, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Rename the collection. + * + * @remarks + * This operation does not inherit options from the Db or MongoClient. + * + * @param newName - New name of of the collection. + * @param options - Optional settings for the command + */ + async rename(newName, options) { + // Intentionally, we do not inherit options from parent for this operation. + return await (0, execute_operation_1.executeOperation)(this.client, new rename_1.RenameOperation(this, newName, (0, utils_1.resolveOptions)(undefined, { + ...options, + readPreference: read_preference_1.ReadPreference.PRIMARY + }))); + } + /** + * Drop the collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param options - Optional settings for the command + */ + async drop(options) { + return await this.db.dropCollection(this.collectionName, options); + } + async findOne(filter = {}, options = {}) { + // Explicitly set the limit to 1 and singleBatch to true for all commands, per the spec. + // noCursorTimeout must be unset as well as batchSize. + // See: https://github.com/mongodb/specifications/blob/master/source/crud/crud.md#findone-api-details + const { ...opts } = options; + opts.singleBatch = true; + const cursor = this.find(filter, opts).limit(1); + const result = await cursor.next(); + await cursor.close(); + return result; + } + find(filter = {}, options = {}) { + return new find_cursor_1.FindCursor(this.client, this.s.namespace, filter, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Returns the options of the collection. + * + * @param options - Optional settings for the command + */ + async options(options) { + options = (0, utils_1.resolveOptions)(this, options); + const [collection] = await this.db + .listCollections({ name: this.collectionName }, { ...options, nameOnly: false }) + .toArray(); + if (collection == null || collection.options == null) { + throw new error_1.MongoAPIError(`collection ${this.namespace} not found`); + } + return collection.options; + } + /** + * Returns if the collection is a capped collection + * + * @param options - Optional settings for the command + */ + async isCapped(options) { + const { capped } = await this.options(options); + return Boolean(capped); + } + /** + * Creates an index on the db and collection collection. + * + * @param indexSpec - The field name or index specification to create an index for + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * + * await collection.createIndex({ a: 1, b: -1 }); + * + * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes + * await collection.createIndex([ [c, 1], [d, -1] ]); + * + * // Equivalent to { e: 1 } + * await collection.createIndex('e'); + * + * // Equivalent to { f: 1, g: 1 } + * await collection.createIndex(['f', 'g']) + * + * // Equivalent to { h: 1, i: -1 } + * await collection.createIndex([ { h: 1 }, { i: -1 } ]); + * + * // Equivalent to { j: 1, k: -1, l: 2d } + * await collection.createIndex(['j', ['k', -1], { l: '2d' }]) + * ``` + */ + async createIndex(indexSpec, options) { + const indexes = await (0, execute_operation_1.executeOperation)(this.client, indexes_1.CreateIndexesOperation.fromIndexSpecification(this, this.collectionName, indexSpec, (0, utils_1.resolveOptions)(this, options))); + return indexes[0]; + } + /** + * Creates multiple indexes in the collection, this method is only supported for + * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported + * error. + * + * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specifications. + * Index specifications are defined {@link https://www.mongodb.com/docs/manual/reference/command/createIndexes/| here}. + * + * @param indexSpecs - An array of index specifications to be created + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * await collection.createIndexes([ + * // Simple index on field fizz + * { + * key: { fizz: 1 }, + * } + * // wildcard index + * { + * key: { '$**': 1 } + * }, + * // named index on darmok and jalad + * { + * key: { darmok: 1, jalad: -1 } + * name: 'tanagra' + * } + * ]); + * ``` + */ + async createIndexes(indexSpecs, options) { + return await (0, execute_operation_1.executeOperation)(this.client, indexes_1.CreateIndexesOperation.fromIndexDescriptionArray(this, this.collectionName, indexSpecs, (0, utils_1.resolveOptions)(this, { ...options, maxTimeMS: undefined }))); + } + /** + * Drops an index from this collection. + * + * @param indexName - Name of the index to drop. + * @param options - Optional settings for the command + */ + async dropIndex(indexName, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new indexes_1.DropIndexOperation(this, indexName, { + ...(0, utils_1.resolveOptions)(this, options), + readPreference: read_preference_1.ReadPreference.primary + })); + } + /** + * Drops all indexes from this collection. + * + * @param options - Optional settings for the command + */ + async dropIndexes(options) { + try { + await (0, execute_operation_1.executeOperation)(this.client, new indexes_1.DropIndexOperation(this, '*', (0, utils_1.resolveOptions)(this, options))); + return true; + } + catch (error) { + // TODO(NODE-6517): Driver should only filter for namespace not found error. Other errors should be thrown. + if (error instanceof error_1.MongoOperationTimeoutError) + throw error; + return false; + } + } + /** + * Get the list of all indexes information for the collection. + * + * @param options - Optional settings for the command + */ + listIndexes(options) { + return new list_indexes_cursor_1.ListIndexesCursor(this, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Checks if one or more indexes exist on the collection, fails on first non-existing index + * + * @param indexes - One or more index names to check. + * @param options - Optional settings for the command + */ + async indexExists(indexes, options) { + const indexNames = Array.isArray(indexes) ? indexes : [indexes]; + const allIndexes = new Set(await this.listIndexes(options) + .map(({ name }) => name) + .toArray()); + return indexNames.every(name => allIndexes.has(name)); + } + async indexInformation(options) { + return await this.indexes({ + ...options, + full: options?.full ?? false + }); + } + /** + * Gets an estimate of the count of documents in a collection using collection metadata. + * This will always run a count command on all server versions. + * + * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, + * which estimatedDocumentCount uses in its implementation, was not included in v1 of + * the Stable API, and so users of the Stable API with estimatedDocumentCount are + * recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid + * encountering errors. + * + * @see {@link https://www.mongodb.com/docs/manual/reference/command/count/#behavior|Count: Behavior} + * @param options - Optional settings for the command + */ + async estimatedDocumentCount(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new estimated_document_count_1.EstimatedDocumentCountOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Gets the number of documents matching the filter. + * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * Due to countDocuments using the $match aggregation pipeline stage, certain query operators cannot be used in countDocuments. This includes the $where and $near query operators, among others. Details can be found in the documentation for the $match aggregation pipeline stage. + * + * **Note**: When migrating from {@link Collection#count| count} to {@link Collection#countDocuments| countDocuments} + * the following query operators must be replaced: + * + * | Operator | Replacement | + * | -------- | ----------- | + * | `$where` | [`$expr`][1] | + * | `$near` | [`$geoWithin`][2] with [`$center`][3] | + * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] | + * + * [1]: https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * [2]: https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * [3]: https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * [4]: https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + * + * @param filter - The filter for the count + * @param options - Optional settings for the command + * + * @see https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * @see https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + */ + async countDocuments(filter = {}, options = {}) { + const pipeline = []; + pipeline.push({ $match: filter }); + if (typeof options.skip === 'number') { + pipeline.push({ $skip: options.skip }); + } + if (typeof options.limit === 'number') { + pipeline.push({ $limit: options.limit }); + } + pipeline.push({ $group: { _id: 1, n: { $sum: 1 } } }); + const cursor = this.aggregate(pipeline, options); + const doc = await cursor.next(); + await cursor.close(); + return doc?.n ?? 0; + } + async distinct(key, filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new distinct_1.DistinctOperation(this, key, filter, (0, utils_1.resolveOptions)(this, options))); + } + async indexes(options) { + const indexes = await this.listIndexes(options).toArray(); + const full = options?.full ?? true; + if (full) { + return indexes; + } + const object = Object.fromEntries(indexes.map(({ name, key }) => [name, Object.entries(key)])); + return object; + } + async findOneAndDelete(filter, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new find_and_modify_1.FindOneAndDeleteOperation(this, filter, (0, utils_1.resolveOptions)(this, options))); + } + async findOneAndReplace(filter, replacement, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new find_and_modify_1.FindOneAndReplaceOperation(this, filter, replacement, (0, utils_1.resolveOptions)(this, options))); + } + async findOneAndUpdate(filter, update, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new find_and_modify_1.FindOneAndUpdateOperation(this, filter, update, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2 + * + * @param pipeline - An array of aggregation pipelines to execute + * @param options - Optional settings for the command + */ + aggregate(pipeline = [], options) { + if (!Array.isArray(pipeline)) { + throw new error_1.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages'); + } + return new aggregation_cursor_1.AggregationCursor(this.client, this.s.namespace, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to override the schema that may be defined for this specific collection + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * @example + * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>` + * ```ts + * collection.watch<{ _id: number }>() + * .on('change', change => console.log(change._id.toFixed(4))); + * ``` + * + * @example + * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline. + * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment. + * No need start from scratch on the ChangeStreamInsertDocument type! + * By using an intersection we can save time and ensure defaults remain the same type! + * ```ts + * collection + * .watch & { comment: string }>([ + * { $addFields: { comment: 'big changes' } }, + * { $match: { operationType: 'insert' } } + * ]) + * .on('change', change => { + * change.comment.startsWith('big'); + * change.operationType === 'insert'; + * // No need to narrow in code because the generics did that for us! + * expectType(change.fullDocument); + * }); + * ``` + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TLocal - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeUnorderedBulkOp(options) { + return new unordered_1.UnorderedBulkOperation(this, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeOrderedBulkOp(options) { + return new ordered_1.OrderedBulkOperation(this, (0, utils_1.resolveOptions)(this, options)); + } + /** + * An estimated count of matching documents in the db to a filter. + * + * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents + * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}. + * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead + * + * @param filter - The filter for the count. + * @param options - Optional settings for the command + */ + async count(filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new count_1.CountOperation(this.fullNamespace, filter, (0, utils_1.resolveOptions)(this, options))); + } + listSearchIndexes(indexNameOrOptions, options) { + options = + typeof indexNameOrOptions === 'object' ? indexNameOrOptions : options == null ? {} : options; + const indexName = indexNameOrOptions == null + ? null + : typeof indexNameOrOptions === 'object' + ? null + : indexNameOrOptions; + return new list_search_indexes_cursor_1.ListSearchIndexesCursor(this, indexName, options); + } + /** + * Creates a single search index for the collection. + * + * @param description - The index description for the new search index. + * @returns A promise that resolves to the name of the new search index. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async createSearchIndex(description) { + const [index] = await this.createSearchIndexes([description]); + return index; + } + /** + * Creates multiple search indexes for the current collection. + * + * @param descriptions - An array of `SearchIndexDescription`s for the new search indexes. + * @returns A promise that resolves to an array of the newly created search index names. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + * @returns + */ + async createSearchIndexes(descriptions) { + return await (0, execute_operation_1.executeOperation)(this.client, new create_1.CreateSearchIndexesOperation(this, descriptions)); + } + /** + * Deletes a search index by index name. + * + * @param name - The name of the search index to be deleted. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async dropSearchIndex(name) { + return await (0, execute_operation_1.executeOperation)(this.client, new drop_1.DropSearchIndexOperation(this, name)); + } + /** + * Updates a search index by replacing the existing index definition with the provided definition. + * + * @param name - The name of the search index to update. + * @param definition - The new search index definition. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async updateSearchIndex(name, definition) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_1.UpdateSearchIndexOperation(this, name, definition)); + } +} +exports.Collection = Collection; +//# sourceMappingURL=collection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js.map new file mode 100644 index 00000000..8a3a4b31 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collection.js","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":";;;AAAA,iCAAsF;AAOtF,4CAAsD;AACtD,gDAA0D;AAC1D,mDAAoG;AACpG,oEAAgE;AAChE,sDAAkD;AAClD,sEAAiE;AACjE,oFAG6C;AAE7C,mCAA+F;AAc/F,8CAAuE;AACvE,gDAK6B;AAC7B,oDAAgF;AAEhF,oFAG+C;AAC/C,sEAA+E;AAE/E,kEAOsC;AACtC,kDAW8B;AAC9B,gDAK6B;AAE7B,gDAA0E;AAC1E,+DAG4C;AAC5C,2DAA4E;AAC5E,+DAAgF;AAChF,gDAO6B;AAC7B,iDAAmE;AACnE,uDAA4E;AAE5E,mCAKiB;AACjB,mDAAyE;AA2CzE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,UAAU;IAYrB;;;OAGG;IACH,YAAY,EAAM,EAAE,IAAY,EAAE,O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CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,iBAAiB,CAAC,IAAY,EAAE,UAAoB;QACxD,OAAO,MAAM,IAAA,oCAAgB,EAC3B,IAAI,CAAC,MAAM,EACX,IAAI,mCAA0B,CAAC,IAAsB,EAAE,IAAI,EAAE,UAAU,CAAC,CACzE,CAAC;IACJ,CAAC;CACF;AA1nCD,gCA0nCC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js new file mode 100644 index 00000000..033a5b85 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js @@ -0,0 +1,1110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_OPTIONS = exports.OPTIONS = void 0; +exports.resolveSRVRecord = resolveSRVRecord; +exports.parseOptions = parseOptions; +const dns = require("dns"); +const mongodb_connection_string_url_1 = require("mongodb-connection-string-url"); +const process = require("process"); +const url_1 = require("url"); +const mongo_credentials_1 = require("./cmap/auth/mongo_credentials"); +const providers_1 = require("./cmap/auth/providers"); +const compression_1 = require("./cmap/wire_protocol/compression"); +const encrypter_1 = require("./encrypter"); +const error_1 = require("./error"); +const mongo_client_1 = require("./mongo_client"); +const mongo_logger_1 = require("./mongo_logger"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const runtime_adapters_1 = require("./runtime_adapters"); +const monitor_1 = require("./sdam/monitor"); +const utils_1 = require("./utils"); +const write_concern_1 = require("./write_concern"); +const VALID_TXT_RECORDS = ['authSource', 'replicaSet', 'loadBalanced']; +const LB_SINGLE_HOST_ERROR = 'loadBalanced option only supported with a single host in the URI'; +const LB_REPLICA_SET_ERROR = 'loadBalanced option not supported with a replicaSet option'; +const LB_DIRECT_CONNECTION_ERROR = 'loadBalanced option not supported when directConnection is provided'; +function retryDNSTimeoutFor(rrtype) { + const resolve = rrtype === 'SRV' + ? (address) => dns.promises.resolve(address, 'SRV') + : (address) => dns.promises.resolve(address, 'TXT'); + return async function dnsReqRetryTimeout(lookupAddress) { + try { + return await resolve(lookupAddress); + } + catch (firstDNSError) { + if (firstDNSError.code === dns.TIMEOUT) { + return await resolve(lookupAddress); + } + else { + throw firstDNSError; + } + } + }; +} +const resolveSrv = retryDNSTimeoutFor('SRV'); +const resolveTxt = retryDNSTimeoutFor('TXT'); +/** + * Lookup a `mongodb+srv` connection string, combine the parts and reparse it as a normal + * connection string. + * + * @param uri - The connection string to parse + * @param options - Optional user provided connection string options + */ +async function resolveSRVRecord(options) { + if (typeof options.srvHost !== 'string') { + throw new error_1.MongoAPIError('Option "srvHost" must not be empty'); + } + // Asynchronously start TXT resolution so that we do not have to wait until + // the SRV record is resolved before starting a second DNS query. + const lookupAddress = options.srvHost; + const txtResolutionPromise = resolveTxt(lookupAddress); + txtResolutionPromise.then(undefined, utils_1.squashError); // rejections will be handled later + const hostname = `_${options.srvServiceName}._tcp.${lookupAddress}`; + // Resolve the SRV record and use the result as the list of hosts to connect to. + const addresses = await resolveSrv(hostname); + if (addresses.length === 0) { + throw new error_1.MongoAPIError('No addresses found at host'); + } + for (const { name } of addresses) { + (0, utils_1.checkParentDomainMatch)(name, lookupAddress); + } + const hostAddresses = addresses.map(r => utils_1.HostAddress.fromString(`${r.name}:${r.port ?? 27017}`)); + validateLoadBalancedOptions(hostAddresses, options, true); + // Use the result of resolving the TXT record and add options from there if they exist. + let record; + try { + record = await txtResolutionPromise; + } + catch (error) { + if (error.code !== 'ENODATA' && error.code !== 'ENOTFOUND') { + throw error; + } + return hostAddresses; + } + if (record.length > 1) { + throw new error_1.MongoParseError('Multiple text records not allowed'); + } + const txtRecordOptions = new url_1.URLSearchParams(record[0].join('')); + const txtRecordOptionKeys = [...txtRecordOptions.keys()]; + if (txtRecordOptionKeys.some(key => !VALID_TXT_RECORDS.includes(key))) { + throw new error_1.MongoParseError(`Text record may only set any of: ${VALID_TXT_RECORDS.join(', ')}`); + } + if (VALID_TXT_RECORDS.some(option => txtRecordOptions.get(option) === '')) { + throw new error_1.MongoParseError('Cannot have empty URI params in DNS TXT Record'); + } + const source = txtRecordOptions.get('authSource') ?? undefined; + const replicaSet = txtRecordOptions.get('replicaSet') ?? undefined; + const loadBalanced = txtRecordOptions.get('loadBalanced') ?? undefined; + if (!options.userSpecifiedAuthSource && + source && + options.credentials && + !providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(options.credentials.mechanism)) { + options.credentials = mongo_credentials_1.MongoCredentials.merge(options.credentials, { source }); + } + if (!options.userSpecifiedReplicaSet && replicaSet) { + options.replicaSet = replicaSet; + } + if (loadBalanced === 'true') { + options.loadBalanced = true; + } + if (options.replicaSet && options.srvMaxHosts > 0) { + throw new error_1.MongoParseError('Cannot combine replicaSet option with srvMaxHosts'); + } + validateLoadBalancedOptions(hostAddresses, options, true); + return hostAddresses; +} +/** + * Checks if TLS options are valid + * + * @param allOptions - All options provided by user or included in default options map + * @throws MongoAPIError if TLS options are invalid + */ +function checkTLSOptions(allOptions) { + if (!allOptions) + return; + const check = (a, b) => { + if (allOptions.has(a) && allOptions.has(b)) { + throw new error_1.MongoAPIError(`The '${a}' option cannot be used with the '${b}' option`); + } + }; + check('tlsInsecure', 'tlsAllowInvalidCertificates'); + check('tlsInsecure', 'tlsAllowInvalidHostnames'); +} +function getBoolean(name, value) { + if (typeof value === 'boolean') + return value; + switch (value) { + case 'true': + return true; + case 'false': + return false; + default: + throw new error_1.MongoParseError(`${name} must be either "true" or "false"`); + } +} +function getIntFromOptions(name, value) { + const parsedInt = (0, utils_1.parseInteger)(value); + if (parsedInt != null) { + return parsedInt; + } + throw new error_1.MongoParseError(`Expected ${name} to be stringified int value, got: ${value}`); +} +function getUIntFromOptions(name, value) { + const parsedValue = getIntFromOptions(name, value); + if (parsedValue < 0) { + throw new error_1.MongoParseError(`${name} can only be a positive int value, got: ${value}`); + } + return parsedValue; +} +function* entriesFromString(value) { + if (value === '') { + return; + } + const keyValuePairs = value.split(','); + for (const keyValue of keyValuePairs) { + const [key, value] = keyValue.split(/:(.*)/); + if (value == null) { + throw new error_1.MongoParseError('Cannot have undefined values in key value pairs'); + } + yield [key, value]; + } +} +class CaseInsensitiveMap extends Map { + constructor(entries = []) { + super(entries.map(([k, v]) => [k.toLowerCase(), v])); + } + has(k) { + return super.has(k.toLowerCase()); + } + get(k) { + return super.get(k.toLowerCase()); + } + set(k, v) { + return super.set(k.toLowerCase(), v); + } + delete(k) { + return super.delete(k.toLowerCase()); + } +} +function parseOptions(uri, mongoClient = undefined, options = {}) { + if (mongoClient != null && !(mongoClient instanceof mongo_client_1.MongoClient)) { + options = mongoClient; + mongoClient = undefined; + } + // validate BSONOptions + if (options.useBigInt64 && typeof options.promoteLongs === 'boolean' && !options.promoteLongs) { + throw new error_1.MongoAPIError('Must request either bigint or Long for int64 deserialization'); + } + if (options.useBigInt64 && typeof options.promoteValues === 'boolean' && !options.promoteValues) { + throw new error_1.MongoAPIError('Must request either bigint or Long for int64 deserialization'); + } + const url = new mongodb_connection_string_url_1.default(uri); + const { hosts, isSRV } = url; + const mongoOptions = Object.create(null); + mongoOptions.hosts = isSRV ? [] : hosts.map(utils_1.HostAddress.fromString); + const urlOptions = new CaseInsensitiveMap(); + if (url.pathname !== '/' && url.pathname !== '') { + const dbName = decodeURIComponent(url.pathname[0] === '/' ? url.pathname.slice(1) : url.pathname); + if (dbName) { + urlOptions.set('dbName', [dbName]); + } + } + if (url.username !== '') { + const auth = { + username: decodeURIComponent(url.username) + }; + if (typeof url.password === 'string') { + auth.password = decodeURIComponent(url.password); + } + urlOptions.set('auth', [auth]); + } + for (const key of url.searchParams.keys()) { + const values = url.searchParams.getAll(key); + const isReadPreferenceTags = /readPreferenceTags/i.test(key); + if (!isReadPreferenceTags && values.length > 1) { + throw new error_1.MongoInvalidArgumentError(`URI option "${key}" cannot appear more than once in the connection string`); + } + if (!isReadPreferenceTags && values.includes('')) { + throw new error_1.MongoAPIError(`URI option "${key}" cannot be specified with no value`); + } + if (!urlOptions.has(key)) { + urlOptions.set(key, values); + } + } + const objectOptions = new CaseInsensitiveMap(Object.entries(options).filter(([, v]) => v != null)); + // Validate options that can only be provided by one of uri or object + if (urlOptions.has('serverApi')) { + throw new error_1.MongoParseError('URI cannot contain `serverApi`, it can only be passed to the client'); + } + const uriMechanismProperties = urlOptions.get('authMechanismProperties'); + if (uriMechanismProperties) { + for (const property of uriMechanismProperties) { + if (/(^|,)ALLOWED_HOSTS:/.test(property)) { + throw new error_1.MongoParseError('Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string.'); + } + } + } + if (objectOptions.has('loadBalanced')) { + throw new error_1.MongoParseError('loadBalanced is only a valid option in the URI'); + } + // All option collection + const allProvidedOptions = new CaseInsensitiveMap(); + const allProvidedKeys = new Set([...urlOptions.keys(), ...objectOptions.keys()]); + for (const key of allProvidedKeys) { + const values = []; + const objectOptionValue = objectOptions.get(key); + if (objectOptionValue != null) { + values.push(objectOptionValue); + } + const urlValues = urlOptions.get(key) ?? []; + values.push(...urlValues); + allProvidedOptions.set(key, values); + } + if (allProvidedOptions.has('tls') || allProvidedOptions.has('ssl')) { + const tlsAndSslOpts = (allProvidedOptions.get('tls') || []) + .concat(allProvidedOptions.get('ssl') || []) + .map(getBoolean.bind(null, 'tls/ssl')); + if (new Set(tlsAndSslOpts).size !== 1) { + throw new error_1.MongoParseError('All values of tls/ssl must be the same.'); + } + } + checkTLSOptions(allProvidedOptions); + const unsupportedOptions = (0, utils_1.setDifference)(allProvidedKeys, Array.from(Object.keys(exports.OPTIONS)).map(s => s.toLowerCase())); + if (unsupportedOptions.size !== 0) { + const optionWord = unsupportedOptions.size > 1 ? 'options' : 'option'; + const isOrAre = unsupportedOptions.size > 1 ? 'are' : 'is'; + throw new error_1.MongoParseError(`${optionWord} ${Array.from(unsupportedOptions).join(', ')} ${isOrAre} not supported`); + } + // Option parsing and setting + for (const [key, descriptor] of Object.entries(exports.OPTIONS)) { + const values = allProvidedOptions.get(key); + if (!values || values.length === 0) { + if (exports.DEFAULT_OPTIONS.has(key)) { + setOption(mongoOptions, key, descriptor, [exports.DEFAULT_OPTIONS.get(key)]); + } + } + else { + const { deprecated } = descriptor; + if (deprecated) { + const deprecatedMsg = typeof deprecated === 'string' ? `: ${deprecated}` : ''; + (0, utils_1.emitWarning)(`${key} is a deprecated option${deprecatedMsg}`); + } + setOption(mongoOptions, key, descriptor, values); + } + } + if (mongoOptions.credentials) { + const isGssapi = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI; + const isX509 = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_X509; + const isAws = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_AWS; + const isOidc = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_OIDC; + if ((isGssapi || isX509) && + allProvidedOptions.has('authSource') && + mongoOptions.credentials.source !== '$external') { + // If authSource was explicitly given and its incorrect, we error + throw new error_1.MongoParseError(`authMechanism ${mongoOptions.credentials.mechanism} requires an authSource of '$external'`); + } + if (!(isGssapi || isX509 || isAws || isOidc) && + mongoOptions.dbName && + !allProvidedOptions.has('authSource')) { + // inherit the dbName unless GSSAPI or X509, then silently ignore dbName + // and there was no specific authSource given + mongoOptions.credentials = mongo_credentials_1.MongoCredentials.merge(mongoOptions.credentials, { + source: mongoOptions.dbName + }); + } + if (isAws) { + const { username, password } = mongoOptions.credentials; + if (username || password) { + throw new error_1.MongoAPIError('username and password cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.'); + } + if (mongoOptions.credentials.mechanismProperties.AWS_SESSION_TOKEN) { + throw new error_1.MongoAPIError('AWS_SESSION_TOKEN cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.'); + } + } + mongoOptions.credentials.validate(); + // Check if the only auth related option provided was authSource, if so we can remove credentials + if (mongoOptions.credentials.password === '' && + mongoOptions.credentials.username === '' && + mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT && + Object.keys(mongoOptions.credentials.mechanismProperties).length === 0) { + delete mongoOptions.credentials; + } + } + if (!mongoOptions.dbName) { + // dbName default is applied here because of the credential validation above + mongoOptions.dbName = 'test'; + } + validateLoadBalancedOptions(hosts, mongoOptions, isSRV); + if (mongoClient && mongoOptions.autoEncryption) { + encrypter_1.Encrypter.checkForMongoCrypt(); + mongoOptions.encrypter = new encrypter_1.Encrypter(mongoClient, uri, options); + mongoOptions.autoEncrypter = mongoOptions.encrypter.autoEncrypter; + } + // Potential SRV Overrides and SRV connection string validations + mongoOptions.userSpecifiedAuthSource = + objectOptions.has('authSource') || urlOptions.has('authSource'); + mongoOptions.userSpecifiedReplicaSet = + objectOptions.has('replicaSet') || urlOptions.has('replicaSet'); + if (isSRV) { + // SRV Record is resolved upon connecting + mongoOptions.srvHost = hosts[0]; + if (mongoOptions.directConnection) { + throw new error_1.MongoAPIError('SRV URI does not support directConnection'); + } + if (mongoOptions.srvMaxHosts > 0 && typeof mongoOptions.replicaSet === 'string') { + throw new error_1.MongoParseError('Cannot use srvMaxHosts option with replicaSet'); + } + // SRV turns on TLS by default, but users can override and turn it off + const noUserSpecifiedTLS = !objectOptions.has('tls') && !urlOptions.has('tls'); + const noUserSpecifiedSSL = !objectOptions.has('ssl') && !urlOptions.has('ssl'); + if (noUserSpecifiedTLS && noUserSpecifiedSSL) { + mongoOptions.tls = true; + } + } + else { + const userSpecifiedSrvOptions = urlOptions.has('srvMaxHosts') || + objectOptions.has('srvMaxHosts') || + urlOptions.has('srvServiceName') || + objectOptions.has('srvServiceName'); + if (userSpecifiedSrvOptions) { + throw new error_1.MongoParseError('Cannot use srvMaxHosts or srvServiceName with a non-srv connection string'); + } + } + if (mongoOptions.directConnection && mongoOptions.hosts.length !== 1) { + throw new error_1.MongoParseError('directConnection option requires exactly one host'); + } + if (!mongoOptions.proxyHost && + (mongoOptions.proxyPort || mongoOptions.proxyUsername || mongoOptions.proxyPassword)) { + throw new error_1.MongoParseError('Must specify proxyHost if other proxy options are passed'); + } + if ((mongoOptions.proxyUsername && !mongoOptions.proxyPassword) || + (!mongoOptions.proxyUsername && mongoOptions.proxyPassword)) { + throw new error_1.MongoParseError('Can only specify both of proxy username/password or neither'); + } + const proxyOptions = ['proxyHost', 'proxyPort', 'proxyUsername', 'proxyPassword'].map(key => urlOptions.get(key) ?? []); + if (proxyOptions.some(options => options.length > 1)) { + throw new error_1.MongoParseError('Proxy options cannot be specified multiple times in the connection string'); + } + mongoOptions.mongoLoggerOptions = mongo_logger_1.MongoLogger.resolveOptions({ + MONGODB_LOG_COMMAND: process.env.MONGODB_LOG_COMMAND, + MONGODB_LOG_TOPOLOGY: process.env.MONGODB_LOG_TOPOLOGY, + MONGODB_LOG_SERVER_SELECTION: process.env.MONGODB_LOG_SERVER_SELECTION, + MONGODB_LOG_CONNECTION: process.env.MONGODB_LOG_CONNECTION, + MONGODB_LOG_CLIENT: process.env.MONGODB_LOG_CLIENT, + MONGODB_LOG_ALL: process.env.MONGODB_LOG_ALL, + MONGODB_LOG_MAX_DOCUMENT_LENGTH: process.env.MONGODB_LOG_MAX_DOCUMENT_LENGTH, + MONGODB_LOG_PATH: process.env.MONGODB_LOG_PATH + }, { + mongodbLogPath: mongoOptions.mongodbLogPath, + mongodbLogComponentSeverities: mongoOptions.mongodbLogComponentSeverities, + mongodbLogMaxDocumentLength: mongoOptions.mongodbLogMaxDocumentLength + }); + mongoOptions.runtime = (0, runtime_adapters_1.resolveRuntimeAdapters)(options); + // Mark the promise as handled so a rejection before any consumer awaits it (possible only in + // runtimes where the dynamic import of the default os adapter fails) cannot crash the process + // as an unhandled rejection; consumers awaiting `runtime` still observe the rejection. + mongoOptions.runtime.then(undefined, utils_1.squashError); + return mongoOptions; +} +/** + * #### Throws if LB mode is true: + * - hosts contains more than one host + * - there is a replicaSet name set + * - directConnection is set + * - if srvMaxHosts is used when an srv connection string is passed in + * + * @throws MongoParseError + */ +function validateLoadBalancedOptions(hosts, mongoOptions, isSrv) { + if (mongoOptions.loadBalanced) { + if (hosts.length > 1) { + throw new error_1.MongoParseError(LB_SINGLE_HOST_ERROR); + } + if (mongoOptions.replicaSet) { + throw new error_1.MongoParseError(LB_REPLICA_SET_ERROR); + } + if (mongoOptions.directConnection) { + throw new error_1.MongoParseError(LB_DIRECT_CONNECTION_ERROR); + } + if (isSrv && mongoOptions.srvMaxHosts > 0) { + throw new error_1.MongoParseError('Cannot limit srv hosts with loadBalanced enabled'); + } + } + return; +} +function setOption(mongoOptions, key, descriptor, values) { + const { target, type, transform } = descriptor; + const name = target ?? key; + switch (type) { + case 'boolean': + mongoOptions[name] = getBoolean(name, values[0]); + break; + case 'int': + mongoOptions[name] = getIntFromOptions(name, values[0]); + break; + case 'uint': + mongoOptions[name] = getUIntFromOptions(name, values[0]); + break; + case 'string': + if (values[0] == null) { + break; + } + // The value should always be a string here, but since the array is typed as unknown + // there still needs to be an explicit cast. + // eslint-disable-next-line @typescript-eslint/no-base-to-string + mongoOptions[name] = String(values[0]); + break; + case 'record': + if (!(0, utils_1.isRecord)(values[0])) { + throw new error_1.MongoParseError(`${name} must be an object`); + } + mongoOptions[name] = values[0]; + break; + case 'any': + mongoOptions[name] = values[0]; + break; + default: { + if (!transform) { + throw new error_1.MongoParseError('Descriptors missing a type must define a transform'); + } + const transformValue = transform({ name, options: mongoOptions, values }); + mongoOptions[name] = transformValue; + break; + } + } +} +exports.OPTIONS = { + enableOverloadRetargeting: { + default: false, + type: 'boolean' + }, + appName: { + type: 'string' + }, + auth: { + target: 'credentials', + transform({ name, options, values: [value] }) { + if (!(0, utils_1.isRecord)(value, ['username', 'password'])) { + throw new error_1.MongoParseError(`${name} must be an object with 'username' and 'password' properties`); + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + username: value.username, + password: value.password + }); + } + }, + authMechanism: { + target: 'credentials', + transform({ options, values: [value] }) { + const mechanisms = Object.values(providers_1.AuthMechanism); + const [mechanism] = mechanisms.filter(m => m.match(RegExp(String.raw `\b${value}\b`, 'i'))); + if (!mechanism) { + throw new error_1.MongoParseError(`authMechanism one of ${mechanisms}, got ${value}`); + } + let source = options.credentials?.source; + if (mechanism === providers_1.AuthMechanism.MONGODB_PLAIN || + providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(mechanism)) { + // some mechanisms have '$external' as the Auth Source + source = '$external'; + } + let password = options.credentials?.password; + if (mechanism === providers_1.AuthMechanism.MONGODB_X509 && password === '') { + password = undefined; + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + mechanism, + source, + password + }); + } + }, + // Note that if the authMechanismProperties contain a TOKEN_RESOURCE that has a + // comma in it, it MUST be supplied as a MongoClient option instead of in the + // connection string. + authMechanismProperties: { + target: 'credentials', + transform({ options, values }) { + // We can have a combination of options passed in the URI and options passed + // as an object to the MongoClient. So we must transform the string options + // as well as merge them together with a potentially provided object. + let mechanismProperties = Object.create(null); + for (const optionValue of values) { + if (typeof optionValue === 'string') { + for (const [key, value] of entriesFromString(optionValue)) { + try { + mechanismProperties[key] = getBoolean(key, value); + } + catch { + mechanismProperties[key] = value; + } + } + } + else { + if (!(0, utils_1.isRecord)(optionValue)) { + throw new error_1.MongoParseError('AuthMechanismProperties must be an object'); + } + mechanismProperties = { ...optionValue }; + } + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + mechanismProperties + }); + } + }, + authSource: { + target: 'credentials', + transform({ options, values: [value] }) { + const source = String(value); + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { source }); + } + }, + autoEncryption: { + type: 'record' + }, + autoSelectFamily: { + type: 'boolean', + default: true + }, + autoSelectFamilyAttemptTimeout: { + type: 'uint' + }, + bsonRegExp: { + type: 'boolean' + }, + serverApi: { + target: 'serverApi', + transform({ values: [version] }) { + const serverApiToValidate = typeof version === 'string' ? { version } : version; + const versionToValidate = serverApiToValidate && serverApiToValidate.version; + if (!versionToValidate) { + throw new error_1.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(mongo_client_1.ServerApiVersion).join('", "')}"]`); + } + if (!Object.values(mongo_client_1.ServerApiVersion).some(v => v === versionToValidate)) { + throw new error_1.MongoParseError(`Invalid server API version=${versionToValidate}; must be in the following enum: ["${Object.values(mongo_client_1.ServerApiVersion).join('", "')}"]`); + } + return serverApiToValidate; + } + }, + checkKeys: { + type: 'boolean' + }, + compressors: { + default: 'none', + target: 'compressors', + transform({ values }) { + const compressionList = new Set(); + for (const compVal of values) { + const compValArray = typeof compVal === 'string' ? compVal.split(',') : compVal; + if (!Array.isArray(compValArray)) { + throw new error_1.MongoInvalidArgumentError('compressors must be an array or a comma-delimited list of strings'); + } + for (const c of compValArray) { + if (Object.keys(compression_1.Compressor).includes(String(c))) { + compressionList.add(String(c)); + } + else { + throw new error_1.MongoInvalidArgumentError(`${c} is not a valid compression mechanism. Must be one of: ${Object.keys(compression_1.Compressor)}.`); + } + } + } + return [...compressionList]; + } + }, + connectTimeoutMS: { + default: 30000, + type: 'uint' + }, + dbName: { + type: 'string' + }, + directConnection: { + default: false, + type: 'boolean' + }, + driverInfo: { + default: {}, + type: 'record' + }, + enableUtf8Validation: { type: 'boolean', default: true }, + family: { + transform({ name, values: [value] }) { + const transformValue = getIntFromOptions(name, value); + if (transformValue === 4 || transformValue === 6) { + return transformValue; + } + throw new error_1.MongoParseError(`Option 'family' must be 4 or 6 got ${transformValue}.`); + } + }, + fieldsAsRaw: { + type: 'record' + }, + forceServerObjectId: { + default: false, + type: 'boolean' + }, + fsync: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + fsync: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from fsync=${value}`); + return wc; + } + }, + heartbeatFrequencyMS: { + default: 10000, + type: 'uint' + }, + ignoreUndefined: { + type: 'boolean' + }, + j: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + journal: { + target: 'writeConcern', + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + loadBalanced: { + default: false, + type: 'boolean' + }, + localThresholdMS: { + default: 15, + type: 'uint' + }, + maxAdaptiveRetries: { + default: 2, + type: 'uint' + }, + maxConnecting: { + default: 2, + transform({ name, values: [value] }) { + const maxConnecting = getUIntFromOptions(name, value); + if (maxConnecting === 0) { + throw new error_1.MongoInvalidArgumentError('maxConnecting must be > 0 if specified'); + } + return maxConnecting; + } + }, + maxIdleTimeMS: { + default: 0, + type: 'uint' + }, + maxPoolSize: { + default: 100, + type: 'uint' + }, + maxStalenessSeconds: { + target: 'readPreference', + transform({ name, options, values: [value] }) { + const maxStalenessSeconds = getUIntFromOptions(name, value); + if (options.readPreference) { + return read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, maxStalenessSeconds } + }); + } + else { + return new read_preference_1.ReadPreference('secondary', undefined, { maxStalenessSeconds }); + } + } + }, + minInternalBufferSize: { + type: 'uint' + }, + minPoolSize: { + default: 0, + type: 'uint' + }, + minHeartbeatFrequencyMS: { + default: 500, + type: 'uint' + }, + monitorCommands: { + default: false, + type: 'boolean' + }, + name: { + target: 'driverInfo', + transform({ values: [value], options }) { + return { ...options.driverInfo, name: String(value) }; + } + }, + noDelay: { + default: true, + type: 'boolean' + }, + pkFactory: { + default: utils_1.DEFAULT_PK_FACTORY, + transform({ values: [value] }) { + if ((0, utils_1.isRecord)(value, ['createPk']) && typeof value.createPk === 'function') { + return value; + } + throw new error_1.MongoParseError(`Option pkFactory must be an object with a createPk function, got ${value}`); + } + }, + promoteBuffers: { + type: 'boolean' + }, + promoteLongs: { + type: 'boolean' + }, + promoteValues: { + type: 'boolean' + }, + useBigInt64: { + type: 'boolean' + }, + proxyHost: { + type: 'string' + }, + proxyPassword: { + type: 'string' + }, + proxyPort: { + type: 'uint' + }, + proxyUsername: { + type: 'string' + }, + raw: { + default: false, + type: 'boolean' + }, + readConcern: { + transform({ values: [value], options }) { + if (value instanceof read_concern_1.ReadConcern || (0, utils_1.isRecord)(value, ['level'])) { + return read_concern_1.ReadConcern.fromOptions({ ...options.readConcern, ...value }); + } + throw new error_1.MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(value)}`); + } + }, + readConcernLevel: { + target: 'readConcern', + transform({ values: [level], options }) { + return read_concern_1.ReadConcern.fromOptions({ + ...options.readConcern, + level: level + }); + } + }, + readPreference: { + default: read_preference_1.ReadPreference.primary, + transform({ values: [value], options }) { + if (value instanceof read_preference_1.ReadPreference) { + return read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + } + if ((0, utils_1.isRecord)(value, ['mode'])) { + const rp = read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + if (rp) + return rp; + else + throw new error_1.MongoParseError(`Cannot make read preference from ${JSON.stringify(value)}`); + } + if (typeof value === 'string') { + const rpOpts = { + hedge: options.readPreference?.hedge, + maxStalenessSeconds: options.readPreference?.maxStalenessSeconds + }; + return new read_preference_1.ReadPreference(value, options.readPreference?.tags, rpOpts); + } + throw new error_1.MongoParseError(`Unknown ReadPreference value: ${value}`); + } + }, + readPreferenceTags: { + target: 'readPreference', + transform({ values, options }) { + const tags = Array.isArray(values[0]) + ? values[0] + : values; + const readPreferenceTags = []; + for (const tag of tags) { + const readPreferenceTag = Object.create(null); + if (typeof tag === 'string') { + for (const [k, v] of entriesFromString(tag)) { + readPreferenceTag[k] = v; + } + } + if ((0, utils_1.isRecord)(tag)) { + for (const [k, v] of Object.entries(tag)) { + readPreferenceTag[k] = v; + } + } + readPreferenceTags.push(readPreferenceTag); + } + return read_preference_1.ReadPreference.fromOptions({ + readPreference: options.readPreference, + readPreferenceTags + }); + } + }, + replicaSet: { + type: 'string' + }, + retryReads: { + default: true, + type: 'boolean' + }, + retryWrites: { + default: true, + type: 'boolean' + }, + runtimeAdapters: { + type: 'record' + }, + serializeFunctions: { + type: 'boolean' + }, + serverMonitoringMode: { + default: 'auto', + transform({ values: [value] }) { + if (!Object.values(monitor_1.ServerMonitoringMode).includes(value)) { + throw new error_1.MongoParseError('serverMonitoringMode must be one of `auto`, `poll`, or `stream`'); + } + return value; + } + }, + serverSelectionTimeoutMS: { + default: 30000, + type: 'uint' + }, + servername: { + type: 'string' + }, + socketTimeoutMS: { + // TODO(NODE-6491): deprecated: 'Please use timeoutMS instead', + default: 0, + type: 'uint' + }, + srvMaxHosts: { + type: 'uint', + default: 0 + }, + srvServiceName: { + type: 'string', + default: 'mongodb' + }, + ssl: { + target: 'tls', + type: 'boolean' + }, + timeoutMS: { + type: 'uint' + }, + tls: { + type: 'boolean' + }, + tlsAllowInvalidCertificates: { + target: 'rejectUnauthorized', + transform({ name, values: [value] }) { + // allowInvalidCertificates is the inverse of rejectUnauthorized + return !getBoolean(name, value); + } + }, + tlsAllowInvalidHostnames: { + target: 'checkServerIdentity', + transform({ name, values: [value] }) { + // tlsAllowInvalidHostnames means setting the checkServerIdentity function to a noop + return getBoolean(name, value) ? () => undefined : undefined; + } + }, + tlsCAFile: { + type: 'string' + }, + tlsCRLFile: { + type: 'string' + }, + tlsCertificateKeyFile: { + type: 'string' + }, + tlsCertificateKeyFilePassword: { + target: 'passphrase', + type: 'any' + }, + tlsInsecure: { + transform({ name, options, values: [value] }) { + const tlsInsecure = getBoolean(name, value); + if (tlsInsecure) { + options.checkServerIdentity = () => undefined; + options.rejectUnauthorized = false; + } + else { + options.checkServerIdentity = options.tlsAllowInvalidHostnames + ? () => undefined + : undefined; + options.rejectUnauthorized = options.tlsAllowInvalidCertificates ? false : true; + } + return tlsInsecure; + } + }, + w: { + target: 'writeConcern', + transform({ values: [value], options }) { + return write_concern_1.WriteConcern.fromOptions({ writeConcern: { ...options.writeConcern, w: value } }); + } + }, + waitQueueTimeoutMS: { + // TODO(NODE-6491): deprecated: 'Please use timeoutMS instead', + default: 0, + type: 'uint' + }, + writeConcern: { + target: 'writeConcern', + transform({ values: [value], options }) { + if ((0, utils_1.isRecord)(value) || value instanceof write_concern_1.WriteConcern) { + return write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + ...value + } + }); + } + else if (value === 'majority' || typeof value === 'number') { + return write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + w: value + } + }); + } + throw new error_1.MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(value)}`); + } + }, + wtimeout: { + deprecated: 'Please use wtimeoutMS instead', + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeout: getUIntFromOptions('wtimeout', value) + } + }); + if (wc) + return wc; + throw new error_1.MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + wtimeoutMS: { + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeoutMS: getUIntFromOptions('wtimeoutMS', value) + } + }); + if (wc) + return wc; + throw new error_1.MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + zlibCompressionLevel: { + default: 0, + type: 'int' + }, + mongodbLogPath: { + transform({ values: [value] }) { + if (!((typeof value === 'string' && ['stderr', 'stdout'].includes(value)) || + (value && + typeof value === 'object' && + 'write' in value && + typeof value.write === 'function'))) { + throw new error_1.MongoAPIError(`Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable`); + } + return value; + } + }, + mongodbLogComponentSeverities: { + transform({ values: [value] }) { + if (typeof value !== 'object' || !value) { + throw new error_1.MongoAPIError(`Option 'mongodbLogComponentSeverities' must be a non-null object`); + } + for (const [k, v] of Object.entries(value)) { + if (typeof v !== 'string' || typeof k !== 'string') { + throw new error_1.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value`); + } + if (!Object.values(mongo_logger_1.MongoLoggableComponent).some(val => val === k) && k !== 'default') { + throw new error_1.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' contains invalid key: ${k}`); + } + if (!Object.values(mongo_logger_1.SeverityLevel).some(val => val === v)) { + throw new error_1.MongoAPIError(`Option 'mongodbLogComponentSeverities' does not support ${v} as a value for ${k}`); + } + } + return value; + } + }, + mongodbLogMaxDocumentLength: { type: 'uint' }, + // Custom types for modifying core behavior + connectionType: { type: 'any' }, + srvPoller: { type: 'any' }, + // Accepted Node.js Options + allowPartialTrustChain: { type: 'any' }, + minDHSize: { type: 'any' }, + pskCallback: { type: 'any' }, + secureContext: { type: 'any' }, + enableTrace: { type: 'any' }, + requestCert: { type: 'any' }, + rejectUnauthorized: { type: 'any' }, + checkServerIdentity: { type: 'any' }, + keepAliveInitialDelay: { type: 'any' }, + ALPNProtocols: { type: 'any' }, + SNICallback: { type: 'any' }, + session: { type: 'any' }, + requestOCSP: { type: 'any' }, + localAddress: { type: 'any' }, + localPort: { type: 'any' }, + hints: { type: 'any' }, + lookup: { type: 'any' }, + ca: { type: 'any' }, + cert: { type: 'any' }, + ciphers: { type: 'any' }, + crl: { type: 'any' }, + ecdhCurve: { type: 'any' }, + key: { type: 'any' }, + passphrase: { type: 'any' }, + pfx: { type: 'any' }, + secureProtocol: { type: 'any' }, + index: { type: 'any' }, + // Legacy options from v3 era + __skipPingOnConnect: { type: 'boolean' } +}; +exports.DEFAULT_OPTIONS = new CaseInsensitiveMap(Object.entries(exports.OPTIONS) + .filter(([, descriptor]) => descriptor.default != null) + .map(([k, d]) => [k, d.default])); +//# sourceMappingURL=connection_string.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js.map new file mode 100644 index 00000000..36cb92f1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/connection_string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection_string.js","sourceRoot":"","sources":["../src/connection_string.ts"],"names":[],"mappings":";;;AA4EA,4CAiFC;AA+ED,oCA4TC;AAxiBD,2BAA2B;AAC3B,iFAA6D;AAC7D,mCAAmC;AACnC,6BAAsC;AAGtC,qEAAiE;AACjE,qDAAoF;AACpF,kEAAmF;AACnF,2CAAwC;AACxC,mCAAoF;AACpF,iDAOwB;AACxB,iDAAoF;AACpF,iDAAoE;AACpE,uDAA4E;AAC5E,yDAA4D;AAC5D,4CAAsD;AAEtD,mCASiB;AACjB,mDAAuD;AAEvD,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;AAEvE,MAAM,oBAAoB,GAAG,kEAAkE,CAAC;AAChG,MAAM,oBAAoB,GAAG,4DAA4D,CAAC;AAC1F,MAAM,0BAA0B,GAC9B,qEAAqE,CAAC;AAIxE,SAAS,kBAAkB,CACzB,MAAqB;IAErB,MAAM,OAAO,GACX,MAAM,KAAK,KAAK;QACd,CAAC,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC;QAC3D,CAAC,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAChE,OAAO,KAAK,UAAU,kBAAkB,CAAC,aAAqB;QAC5D,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,aAAa,CAAC,C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AC,CAAC,OAAO,CAAC,CAAC,CACnC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js new file mode 100644 index 00000000..e1021b72 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js @@ -0,0 +1,170 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.END = exports.CHANGE = exports.INIT = exports.MORE = exports.RESPONSE = exports.SERVER_HEARTBEAT_FAILED = exports.SERVER_HEARTBEAT_SUCCEEDED = exports.SERVER_HEARTBEAT_STARTED = exports.COMMAND_FAILED = exports.COMMAND_SUCCEEDED = exports.COMMAND_STARTED = exports.CLUSTER_TIME_RECEIVED = exports.CONNECTION_CHECKED_IN = exports.CONNECTION_CHECKED_OUT = exports.CONNECTION_CHECK_OUT_FAILED = exports.CONNECTION_CHECK_OUT_STARTED = exports.CONNECTION_CLOSED = exports.CONNECTION_READY = exports.CONNECTION_CREATED = exports.CONNECTION_POOL_READY = exports.CONNECTION_POOL_CLEARED = exports.CONNECTION_POOL_CLOSED = exports.CONNECTION_POOL_CREATED = exports.WAITING_FOR_SUITABLE_SERVER = exports.SERVER_SELECTION_SUCCEEDED = exports.SERVER_SELECTION_FAILED = exports.SERVER_SELECTION_STARTED = exports.TOPOLOGY_DESCRIPTION_CHANGED = exports.TOPOLOGY_CLOSED = exports.TOPOLOGY_OPENING = exports.SERVER_DESCRIPTION_CHANGED = exports.SERVER_CLOSED = exports.SERVER_OPENING = exports.DESCRIPTION_RECEIVED = exports.UNPINNED = exports.PINNED = exports.MESSAGE = exports.ENDED = exports.CLOSED = exports.CONNECT = exports.OPEN = exports.CLOSE = exports.TIMEOUT = exports.ERROR = exports.SYSTEM_JS_COLLECTION = exports.SYSTEM_COMMAND_COLLECTION = exports.SYSTEM_USER_COLLECTION = exports.SYSTEM_PROFILE_COLLECTION = exports.SYSTEM_INDEX_COLLECTION = exports.SYSTEM_NAMESPACE_COLLECTION = void 0; +exports.kDecoratedKeys = exports.kDecorateResult = exports.LEGACY_HELLO_COMMAND_CAMEL_CASE = exports.LEGACY_HELLO_COMMAND = exports.MONGO_CLIENT_EVENTS = exports.LOCAL_SERVER_EVENTS = exports.SERVER_RELAY_EVENTS = exports.APM_EVENTS = exports.TOPOLOGY_EVENTS = exports.CMAP_EVENTS = exports.HEARTBEAT_EVENTS = exports.RESUME_TOKEN_CHANGED = void 0; +exports.SYSTEM_NAMESPACE_COLLECTION = 'system.namespaces'; +exports.SYSTEM_INDEX_COLLECTION = 'system.indexes'; +exports.SYSTEM_PROFILE_COLLECTION = 'system.profile'; +exports.SYSTEM_USER_COLLECTION = 'system.users'; +exports.SYSTEM_COMMAND_COLLECTION = '$cmd'; +exports.SYSTEM_JS_COLLECTION = 'system.js'; +// events +exports.ERROR = 'error'; +exports.TIMEOUT = 'timeout'; +exports.CLOSE = 'close'; +exports.OPEN = 'open'; +exports.CONNECT = 'connect'; +exports.CLOSED = 'closed'; +exports.ENDED = 'ended'; +exports.MESSAGE = 'message'; +exports.PINNED = 'pinned'; +exports.UNPINNED = 'unpinned'; +exports.DESCRIPTION_RECEIVED = 'descriptionReceived'; +/** @internal */ +exports.SERVER_OPENING = 'serverOpening'; +/** @internal */ +exports.SERVER_CLOSED = 'serverClosed'; +/** @internal */ +exports.SERVER_DESCRIPTION_CHANGED = 'serverDescriptionChanged'; +/** @internal */ +exports.TOPOLOGY_OPENING = 'topologyOpening'; +/** @internal */ +exports.TOPOLOGY_CLOSED = 'topologyClosed'; +/** @internal */ +exports.TOPOLOGY_DESCRIPTION_CHANGED = 'topologyDescriptionChanged'; +/** @internal */ +exports.SERVER_SELECTION_STARTED = 'serverSelectionStarted'; +/** @internal */ +exports.SERVER_SELECTION_FAILED = 'serverSelectionFailed'; +/** @internal */ +exports.SERVER_SELECTION_SUCCEEDED = 'serverSelectionSucceeded'; +/** @internal */ +exports.WAITING_FOR_SUITABLE_SERVER = 'waitingForSuitableServer'; +/** @internal */ +exports.CONNECTION_POOL_CREATED = 'connectionPoolCreated'; +/** @internal */ +exports.CONNECTION_POOL_CLOSED = 'connectionPoolClosed'; +/** @internal */ +exports.CONNECTION_POOL_CLEARED = 'connectionPoolCleared'; +/** @internal */ +exports.CONNECTION_POOL_READY = 'connectionPoolReady'; +/** @internal */ +exports.CONNECTION_CREATED = 'connectionCreated'; +/** @internal */ +exports.CONNECTION_READY = 'connectionReady'; +/** @internal */ +exports.CONNECTION_CLOSED = 'connectionClosed'; +/** @internal */ +exports.CONNECTION_CHECK_OUT_STARTED = 'connectionCheckOutStarted'; +/** @internal */ +exports.CONNECTION_CHECK_OUT_FAILED = 'connectionCheckOutFailed'; +/** @internal */ +exports.CONNECTION_CHECKED_OUT = 'connectionCheckedOut'; +/** @internal */ +exports.CONNECTION_CHECKED_IN = 'connectionCheckedIn'; +exports.CLUSTER_TIME_RECEIVED = 'clusterTimeReceived'; +/** @internal */ +exports.COMMAND_STARTED = 'commandStarted'; +/** @internal */ +exports.COMMAND_SUCCEEDED = 'commandSucceeded'; +/** @internal */ +exports.COMMAND_FAILED = 'commandFailed'; +/** @internal */ +exports.SERVER_HEARTBEAT_STARTED = 'serverHeartbeatStarted'; +/** @internal */ +exports.SERVER_HEARTBEAT_SUCCEEDED = 'serverHeartbeatSucceeded'; +/** @internal */ +exports.SERVER_HEARTBEAT_FAILED = 'serverHeartbeatFailed'; +exports.RESPONSE = 'response'; +exports.MORE = 'more'; +exports.INIT = 'init'; +exports.CHANGE = 'change'; +exports.END = 'end'; +exports.RESUME_TOKEN_CHANGED = 'resumeTokenChanged'; +/** @public */ +exports.HEARTBEAT_EVENTS = Object.freeze([ + exports.SERVER_HEARTBEAT_STARTED, + exports.SERVER_HEARTBEAT_SUCCEEDED, + exports.SERVER_HEARTBEAT_FAILED +]); +/** @public */ +exports.CMAP_EVENTS = Object.freeze([ + exports.CONNECTION_POOL_CREATED, + exports.CONNECTION_POOL_READY, + exports.CONNECTION_POOL_CLEARED, + exports.CONNECTION_POOL_CLOSED, + exports.CONNECTION_CREATED, + exports.CONNECTION_READY, + exports.CONNECTION_CLOSED, + exports.CONNECTION_CHECK_OUT_STARTED, + exports.CONNECTION_CHECK_OUT_FAILED, + exports.CONNECTION_CHECKED_OUT, + exports.CONNECTION_CHECKED_IN +]); +/** @public */ +exports.TOPOLOGY_EVENTS = Object.freeze([ + exports.SERVER_OPENING, + exports.SERVER_CLOSED, + exports.SERVER_DESCRIPTION_CHANGED, + exports.TOPOLOGY_OPENING, + exports.TOPOLOGY_CLOSED, + exports.TOPOLOGY_DESCRIPTION_CHANGED, + exports.ERROR, + exports.TIMEOUT, + exports.CLOSE +]); +/** @public */ +exports.APM_EVENTS = Object.freeze([ + exports.COMMAND_STARTED, + exports.COMMAND_SUCCEEDED, + exports.COMMAND_FAILED +]); +/** + * All events that we relay to the `Topology` + * @internal + */ +exports.SERVER_RELAY_EVENTS = Object.freeze([ + exports.SERVER_HEARTBEAT_STARTED, + exports.SERVER_HEARTBEAT_SUCCEEDED, + exports.SERVER_HEARTBEAT_FAILED, + exports.COMMAND_STARTED, + exports.COMMAND_SUCCEEDED, + exports.COMMAND_FAILED, + ...exports.CMAP_EVENTS +]); +/** + * All events we listen to from `Server` instances, but do not forward to the client + * @internal + */ +exports.LOCAL_SERVER_EVENTS = Object.freeze([ + exports.CONNECT, + exports.DESCRIPTION_RECEIVED, + exports.CLOSED, + exports.ENDED +]); +/** @public */ +exports.MONGO_CLIENT_EVENTS = Object.freeze([ + ...exports.CMAP_EVENTS, + ...exports.APM_EVENTS, + ...exports.TOPOLOGY_EVENTS, + ...exports.HEARTBEAT_EVENTS +]); +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +exports.LEGACY_HELLO_COMMAND = 'ismaster'; +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +exports.LEGACY_HELLO_COMMAND_CAMEL_CASE = 'isMaster'; +// Typescript errors if we index objects with `Symbol.for(...)`, so +// to avoid TS errors we pull them out into variables. Then we can type +// the objects (and class) that we expect to see them on and prevent TS +// errors. +/** @internal */ +exports.kDecorateResult = Symbol.for('@@mdb.decorateDecryptionResult'); +/** @internal */ +exports.kDecoratedKeys = Symbol.for('@@mdb.decryptedKeys'); +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js.map new file mode 100644 index 00000000..809a6bde --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;;AAAa,QAAA,2BAA2B,GAAG,mBAAmB,CAAC;AAClD,QAAA,uBAAuB,GAAG,gBAAgB,CAAC;AAC3C,QAAA,yBAAyB,GAAG,gBAAgB,CAAC;AAC7C,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,yBAAyB,GAAG,MAAM,CAAC;AACnC,QAAA,oBAAoB,GAAG,WAAW,CAAC;AAEhD,SAAS;AACI,QAAA,KAAK,GAAG,OAAgB,CAAC;AACzB,QAAA,OAAO,GAAG,SAAkB,CAAC;AAC7B,QAAA,KAAK,GAAG,OAAgB,CAAC;AACzB,QAAA,IAAI,GAAG,MAAe,CAAC;AACvB,QAAA,OAAO,GAAG,SAAkB,CAAC;AAC7B,QAAA,MAAM,GAAG,QAAiB,CAAC;AAC3B,QAAA,KAAK,GAAG,OAAgB,CAAC;AACzB,QAAA,OAAO,GAAG,SAAkB,CAAC;AAC7B,QAAA,MAAM,GAAG,QAAiB,CAAC;AAC3B,QAAA,QAAQ,GAAG,UAAmB,CAAC;AAC/B,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,gBAAgB;AACH,QAAA,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kCAA0B;IAC1B,+BAAuB;IACvB,uBAAe;IACf,yBAAiB;IACjB,sBAAc;IACd,GAAG,mBAAW;CACN,CAAC,CAAC;AAEZ;;;GAGG;AACU,QAAA,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,eAAO;IACP,4BAAoB;IACpB,cAAM;IACN,aAAK;CACG,CAAC,CAAC;AAEZ,cAAc;AACD,QAAA,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,GAAG,mBAAW;IACd,GAAG,kBAAU;IACb,GAAG,uBAAe;IAClB,GAAG,wBAAgB;CACX,CAAC,CAAC;AAEZ;;;GAGG;AACU,QAAA,oBAAoB,GAAG,UAAU,CAAC;AAE/C;;;GAGG;AACU,QAAA,+BAA+B,GAAG,UAAU,CAAC;AAE1D,mEAAmE;AACnE,wEAAwE;AACxE,uEAAuE;AACvE,UAAU;AACV,gBAAgB;AACH,QAAA,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAC5E,gBAAgB;AACH,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js new file mode 100644 index 00000000..4f89e8ac --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js @@ -0,0 +1,923 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CursorTimeoutContext = exports.AbstractCursor = exports.CursorTimeoutMode = exports.CURSOR_FLAGS = void 0; +const stream_1 = require("stream"); +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const execute_operation_1 = require("../operations/execute_operation"); +const get_more_1 = require("../operations/get_more"); +const kill_cursors_1 = require("../operations/kill_cursors"); +const read_concern_1 = require("../read_concern"); +const read_preference_1 = require("../read_preference"); +const sessions_1 = require("../sessions"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +/** @public */ +exports.CURSOR_FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +]; +function removeActiveCursor() { + this.client.s.activeCursors.delete(this); +} +/** + * @public + * @experimental + * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'` + * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of + * `cursor.next()`. + * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor. + * + * Depending on the type of cursor being used, this option has different default values. + * For non-tailable cursors, this value defaults to `'cursorLifetime'` + * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by + * definition can have an arbitrarily long lifetime. + * + * @example + * ```ts + * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'}); + * for await (const doc of cursor) { + * // process doc + * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but + * // will continue to iterate successfully otherwise, regardless of the number of batches. + * } + * ``` + * + * @example + * ```ts + * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' }); + * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms. + * ``` + */ +exports.CursorTimeoutMode = Object.freeze({ + ITERATION: 'iteration', + LIFETIME: 'cursorLifetime' +}); +/** @public */ +class AbstractCursor extends mongo_types_1.TypedEventEmitter { + /** @event */ + static { this.CLOSE = 'close'; } + /** @internal */ + constructor(client, namespace, options = {}) { + super(); + /** @internal */ + this.documents = null; + /** @internal */ + this.hasEmittedClose = false; + this.on('error', utils_1.noop); + if (!client.s.isMongoClient) { + throw new error_1.MongoRuntimeError('Cursor must be constructed with MongoClient'); + } + this.cursorClient = client; + this.cursorNamespace = namespace; + this.cursorId = null; + this.initialized = false; + this.isClosed = false; + this.isKilled = false; + this.cursorOptions = { + readPreference: options.readPreference && options.readPreference instanceof read_preference_1.ReadPreference + ? options.readPreference + : read_preference_1.ReadPreference.primary, + ...(0, bson_1.pluckBSONSerializeOptions)(options), + timeoutMS: options?.timeoutContext?.csotEnabled() + ? options.timeoutContext.timeoutMS + : options.timeoutMS, + tailable: options.tailable, + awaitData: options.awaitData + }; + if (this.cursorOptions.timeoutMS != null) { + if (options.timeoutMode == null) { + if (options.tailable) { + if (options.awaitData) { + if (options.maxAwaitTimeMS != null && + options.maxAwaitTimeMS >= this.cursorOptions.timeoutMS) + throw new error_1.MongoInvalidArgumentError('Cannot specify maxAwaitTimeMS >= timeoutMS for a tailable awaitData cursor'); + } + this.cursorOptions.timeoutMode = exports.CursorTimeoutMode.ITERATION; + } + else { + this.cursorOptions.timeoutMode = exports.CursorTimeoutMode.LIFETIME; + } + } + else { + if (options.tailable && options.timeoutMode === exports.CursorTimeoutMode.LIFETIME) { + throw new error_1.MongoInvalidArgumentError("Cannot set tailable cursor's timeoutMode to LIFETIME"); + } + this.cursorOptions.timeoutMode = options.timeoutMode; + } + } + else { + if (options.timeoutMode != null) + throw new error_1.MongoInvalidArgumentError('Cannot set timeoutMode without setting timeoutMS'); + } + // Set for initial command + this.cursorOptions.omitMaxTimeMS = + this.cursorOptions.timeoutMS != null && + ((this.cursorOptions.timeoutMode === exports.CursorTimeoutMode.ITERATION && + !this.cursorOptions.tailable) || + (this.cursorOptions.tailable && !this.cursorOptions.awaitData)); + const readConcern = read_concern_1.ReadConcern.fromOptions(options); + if (readConcern) { + this.cursorOptions.readConcern = readConcern; + } + if (typeof options.batchSize === 'number') { + this.cursorOptions.batchSize = options.batchSize; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + this.cursorOptions.comment = options.comment; + } + if (typeof options.maxTimeMS === 'number') { + this.cursorOptions.maxTimeMS = options.maxTimeMS; + } + if (typeof options.maxAwaitTimeMS === 'number') { + this.cursorOptions.maxAwaitTimeMS = options.maxAwaitTimeMS; + } + this.cursorSession = options.session ?? null; + this.deserializationOptions = { + ...this.cursorOptions, + validation: { + utf8: options?.enableUtf8Validation === false ? false : true + } + }; + this.timeoutContext = options.timeoutContext; + this.signal = options.signal; + this.abortListener = (0, utils_1.addAbortListener)(this.signal, () => void this.close().then(undefined, utils_1.squashError)); + this.trackCursor(); + } + /** + * The cursor has no id until it receives a response from the initial cursor creating command. + * + * It is non-zero for as long as the database has an open cursor. + * + * The initiating command may receive a zero id if the entire result is in the `firstBatch`. + */ + get id() { + return this.cursorId ?? undefined; + } + /** @internal */ + get isDead() { + return (this.cursorId?.isZero() ?? false) || this.isClosed || this.isKilled; + } + /** @internal */ + get client() { + return this.cursorClient; + } + /** @internal */ + get server() { + return this.selectedServer; + } + get namespace() { + return this.cursorNamespace; + } + get readPreference() { + return this.cursorOptions.readPreference; + } + get readConcern() { + return this.cursorOptions.readConcern; + } + /** @internal */ + get session() { + return this.cursorSession; + } + set session(clientSession) { + this.cursorSession = clientSession; + } + /** + * The cursor is closed and all remaining locally buffered documents have been iterated. + */ + get closed() { + return this.isClosed && (this.documents?.length ?? 0) === 0; + } + /** + * A `killCursors` command was attempted on this cursor. + * This is performed if the cursor id is non zero. + */ + get killed() { + return this.isKilled; + } + get loadBalanced() { + return !!this.cursorClient.topology?.loadBalanced; + } + /** + * An alias for {@link AbstractCursor.close|AbstractCursor.close()}. + */ + async [Symbol.asyncDispose]() { + await this.close(); + } + /** Adds cursor to client's tracking so it will be closed by MongoClient.close() */ + trackCursor() { + this.cursorClient.s.activeCursors.add(this); + if (!this.listeners('close').includes(removeActiveCursor)) { + this.once('close', removeActiveCursor); + } + } + /** Returns current buffered documents length */ + bufferedCount() { + return this.documents?.length ?? 0; + } + /** Returns current buffered documents */ + readBufferedDocuments(number) { + const bufferedDocs = []; + const documentsToRead = Math.min(number ?? this.documents?.length ?? 0, this.documents?.length ?? 0); + for (let count = 0; count < documentsToRead; count++) { + const document = this.documents?.shift(this.deserializationOptions); + if (document != null) { + bufferedDocs.push(document); + } + } + return bufferedDocs; + } + async *[Symbol.asyncIterator]() { + this.signal?.throwIfAborted(); + if (this.closed) { + return; + } + try { + while (true) { + if (this.isKilled) { + return; + } + if (this.closed) { + return; + } + if (this.cursorId != null && this.isDead && (this.documents?.length ?? 0) === 0) { + return; + } + const document = await this.next(); + // eslint-disable-next-line no-restricted-syntax + if (document === null) { + return; + } + yield document; + this.signal?.throwIfAborted(); + } + } + finally { + // Only close the cursor if it has not already been closed. This finally clause handles + // the case when a user would break out of a for await of loop early. + if (!this.isClosed) { + try { + await this.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + } + } + } + stream() { + const readable = new ReadableCursorStream(this); + const abortListener = (0, utils_1.addAbortListener)(this.signal, function () { + readable.destroy(this.reason); + }); + readable.once('end', () => { + abortListener?.[utils_1.kDispose](); + }); + return readable; + } + async hasNext() { + this.signal?.throwIfAborted(); + if (this.cursorId === bson_1.Long.ZERO) { + return false; + } + if (this.cursorOptions.timeoutMode === exports.CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + do { + if ((this.documents?.length ?? 0) !== 0) { + return true; + } + await this.fetchBatch(); + } while (!this.isDead || (this.documents?.length ?? 0) !== 0); + } + finally { + if (this.cursorOptions.timeoutMode === exports.CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + return false; + } + /** Get the next available document from the cursor, returns null if no more documents are available. */ + async next() { + this.signal?.throwIfAborted(); + if (this.cursorId === bson_1.Long.ZERO) { + throw new error_1.MongoCursorExhaustedError(); + } + if (this.cursorOptions.timeoutMode === exports.CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + do { + const doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) + return await this.transformDocument(doc); + return doc; + } + await this.fetchBatch(); + } while (!this.isDead || (this.documents?.length ?? 0) !== 0); + } + finally { + if (this.cursorOptions.timeoutMode === exports.CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + return null; + } + /** + * Try to get the next available document from the cursor or `null` if an empty batch is returned + */ + async tryNext() { + this.signal?.throwIfAborted(); + if (this.cursorId === bson_1.Long.ZERO) { + throw new error_1.MongoCursorExhaustedError(); + } + if (this.cursorOptions.timeoutMode === exports.CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + let doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) + return await this.transformDocument(doc); + return doc; + } + await this.fetchBatch(); + doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) + return await this.transformDocument(doc); + return doc; + } + } + finally { + if (this.cursorOptions.timeoutMode === exports.CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + return null; + } + /** + * Iterates over all the documents for this cursor using the iterator, callback pattern. + * + * If the iterator returns `false`, iteration will stop. + * + * @param iterator - The iteration callback. + * @deprecated - Will be removed in a future release. Use for await...of instead. + */ + async forEach(iterator) { + this.signal?.throwIfAborted(); + if (typeof iterator !== 'function') { + throw new error_1.MongoInvalidArgumentError('Argument "iterator" must be a function'); + } + for await (const document of this) { + const result = iterator(document); + if (result === false) { + break; + } + } + } + /** + * Frees any client-side resources used by the cursor. + */ + async close(options) { + await this.cleanup(options?.timeoutMS); + } + /** + * Returns an array of documents. The caller is responsible for making sure that there + * is enough memory to store the results. Note that the array only contains partial + * results when this cursor had been previously accessed. In that case, + * cursor.rewind() can be used to reset the cursor. + */ + async toArray() { + this.signal?.throwIfAborted(); + const array = []; + // at the end of the loop (since readBufferedDocuments is called) the buffer will be empty + // then, the 'await of' syntax will run a getMore call + for await (const document of this) { + array.push(document); + const docs = this.readBufferedDocuments(); + if (this.transform != null) { + for (const doc of docs) { + array.push(await this.transformDocument(doc)); + } + } + else { + // Note: previous versions of this logic used `array.push(...)`, which adds each item + // to the callstack. For large arrays, this can exceed the maximum call size. + for (const doc of docs) { + array.push(doc); + } + } + } + return array; + } + /** + * Add a cursor flag to the cursor + * + * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -. + * @param value - The flag boolean value. + */ + addCursorFlag(flag, value) { + this.throwIfInitialized(); + if (!exports.CURSOR_FLAGS.includes(flag)) { + throw new error_1.MongoInvalidArgumentError(`Flag ${flag} is not one of ${exports.CURSOR_FLAGS}`); + } + if (typeof value !== 'boolean') { + throw new error_1.MongoInvalidArgumentError(`Flag ${flag} must be a boolean value`); + } + this.cursorOptions[flag] = value; + return this; + } + /** + * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. + * + * @remarks + * + * **Note** Cursors use `null` internally to indicate that there are no more documents in the cursor. Providing a mapping + * function that maps values to `null` will result in the cursor closing itself before it has finished iterating + * all documents. This will **not** result in a memory leak, just surprising behavior. For example: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => null); + * + * const documents = await cursor.toArray(); + * // documents is always [], regardless of how many documents are in the collection. + * ``` + * + * Other falsey values are allowed: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => ''); + * + * const documents = await cursor.toArray(); + * // documents is now an array of empty strings + * ``` + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling map, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor = coll.find(); + * const mappedCursor: FindCursor = cursor.map(doc => Object.keys(doc).length); + * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[] + * ``` + * @param transform - The mapping transformation method. + */ + map(transform) { + this.throwIfInitialized(); + const oldTransform = this.transform; + if (oldTransform) { + this.transform = doc => { + return transform(oldTransform(doc)); + }; + } + else { + this.transform = transform; + } + return this; + } + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadPreference(readPreference) { + this.throwIfInitialized(); + if (readPreference instanceof read_preference_1.ReadPreference) { + this.cursorOptions.readPreference = readPreference; + } + else if (typeof readPreference === 'string') { + this.cursorOptions.readPreference = read_preference_1.ReadPreference.fromString(readPreference); + } + else { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference: ${readPreference}`); + } + return this; + } + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadConcern(readConcern) { + this.throwIfInitialized(); + const resolvedReadConcern = read_concern_1.ReadConcern.fromOptions({ readConcern }); + if (resolvedReadConcern) { + this.cursorOptions.readConcern = resolvedReadConcern; + } + return this; + } + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value) { + this.throwIfInitialized(); + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + this.cursorOptions.maxTimeMS = value; + return this; + } + /** + * Set the batch size for the cursor. + * + * @param value - The number of documents to return per batch. See {@link https://www.mongodb.com/docs/manual/reference/command/find/|find command documentation}. + */ + batchSize(value) { + this.throwIfInitialized(); + if (this.cursorOptions.tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support batchSize'); + } + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Operation "batchSize" requires an integer'); + } + this.cursorOptions.batchSize = value; + return this; + } + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind() { + if (this.timeoutContext && this.timeoutContext.owner !== this) { + throw new error_1.MongoAPIError(`Cannot rewind cursor that does not own its timeout context.`); + } + if (!this.initialized) { + return; + } + this.cursorId = null; + this.documents?.clear(); + this.timeoutContext?.clear(); + this.timeoutContext = undefined; + this.isClosed = false; + this.isKilled = false; + this.initialized = false; + this.hasEmittedClose = false; + this.trackCursor(); + // We only want to end this session if we created it, and it hasn't ended yet + if (this.cursorSession?.explicit === false) { + if (!this.cursorSession.hasEnded) { + this.cursorSession.endSession().then(undefined, utils_1.squashError); + } + this.cursorSession = null; + } + } + /** @internal */ + async getMore() { + if (this.cursorId == null) { + throw new error_1.MongoRuntimeError('Unexpected null cursor id. A cursor creating command should have set this'); + } + if (this.selectedServer == null) { + throw new error_1.MongoRuntimeError('Unexpected null selectedServer. A cursor creating command should have set this'); + } + if (this.cursorSession == null) { + throw new error_1.MongoRuntimeError('Unexpected null session. A cursor creating command should have set this'); + } + const getMoreOptions = { + ...this.cursorOptions, + session: this.cursorSession, + batchSize: this.cursorOptions.batchSize + }; + const getMoreOperation = new get_more_1.GetMoreOperation(this.cursorNamespace, this.cursorId, this.selectedServer, getMoreOptions); + return await (0, execute_operation_1.executeOperation)(this.cursorClient, getMoreOperation, this.timeoutContext); + } + /** + * @internal + * + * This function is exposed for the unified test runner's createChangeStream + * operation. We cannot refactor to use the abstract _initialize method without + * a significant refactor. + */ + async cursorInit() { + if (this.cursorOptions.timeoutMS != null) { + this.timeoutContext ??= new CursorTimeoutContext(timeout_1.TimeoutContext.create({ + serverSelectionTimeoutMS: this.client.s.options.serverSelectionTimeoutMS, + timeoutMS: this.cursorOptions.timeoutMS + }), this); + } + try { + this.cursorSession ??= this.cursorClient.startSession({ owner: this, explicit: false }); + const state = await this._initialize(this.cursorSession); + // Set omitMaxTimeMS to the value needed for subsequent getMore calls + this.cursorOptions.omitMaxTimeMS = this.cursorOptions.timeoutMS != null; + const response = state.response; + this.selectedServer = state.server; + this.cursorId = response.id; + this.cursorNamespace = response.ns ?? this.namespace; + this.documents = response; + this.initialized = true; // the cursor is now initialized, even if it is dead + } + catch (error) { + // the cursor is now initialized, even if an error occurred + this.initialized = true; + await this.cleanup(undefined, error); + throw error; + } + if (this.isDead) { + await this.cleanup(); + } + return; + } + /** @internal Attempt to obtain more documents */ + async fetchBatch() { + if (this.isClosed) { + return; + } + if (this.isDead) { + // if the cursor is dead, we clean it up + // cleanupCursor should never throw, but if it does it indicates a bug in the driver + // and we should surface the error + await this.cleanup(); + return; + } + if (this.cursorId == null) { + await this.cursorInit(); + // If the cursor died or returned documents, return + if ((this.documents?.length ?? 0) !== 0 || this.isDead) + return; + } + // Otherwise, run a getMore + try { + const response = await this.getMore(); + this.cursorId = response.id; + this.documents = response; + } + catch (error) { + try { + await this.cleanup(undefined, error); + } + catch (cleanupError) { + // `cleanupCursor` should never throw, squash and throw the original error + (0, utils_1.squashError)(cleanupError); + } + throw error; + } + if (this.isDead) { + // If we successfully received a response from a cursor BUT the cursor indicates that it is exhausted, + // we intentionally clean up the cursor to release its session back into the pool before the cursor + // is iterated. This prevents a cursor that is exhausted on the server from holding + // onto a session indefinitely until the AbstractCursor is iterated. + // + // cleanupCursorAsync should never throw, but if it does it indicates a bug in the driver + // and we should surface the error + await this.cleanup(); + } + } + /** @internal */ + async cleanup(timeoutMS, error) { + this.abortListener?.[utils_1.kDispose](); + this.isClosed = true; + const timeoutContextForKillCursors = () => { + if (timeoutMS != null) { + this.timeoutContext?.clear(); + return new CursorTimeoutContext(timeout_1.TimeoutContext.create({ + serverSelectionTimeoutMS: this.client.s.options.serverSelectionTimeoutMS, + timeoutMS + }), this); + } + else { + return this.timeoutContext?.refreshed(); + } + }; + const withEmitClose = async (fn) => { + try { + await fn(); + } + finally { + this.emitClose(); + } + }; + const close = async () => { + // if no session has been defined on the cursor, the cursor was never initialized + // or the cursor was re-wound and never re-iterated. In either case, we + // 1. do not need to end the session (there is no session after all) + // 2. do not need to kill the cursor server-side + const session = this.cursorSession; + if (!session) + return; + try { + if (!this.isKilled && + this.cursorId && + !this.cursorId.isZero() && + this.cursorNamespace && + this.selectedServer && + !session.hasEnded) { + this.isKilled = true; + const cursorId = this.cursorId; + this.cursorId = bson_1.Long.ZERO; + await (0, execute_operation_1.executeOperation)(this.cursorClient, new kill_cursors_1.KillCursorsOperation(cursorId, this.cursorNamespace, this.selectedServer, { + session + }), timeoutContextForKillCursors()); + } + } + catch (error) { + (0, utils_1.squashError)(error); + } + finally { + if (session.owner === this) { + await session.endSession({ error }); + } + if (!session.inTransaction()) { + (0, sessions_1.maybeClearPinnedConnection)(session, { error }); + } + } + }; + await withEmitClose(close); + } + /** @internal */ + emitClose() { + try { + if (!this.hasEmittedClose && ((this.documents?.length ?? 0) === 0 || this.isClosed)) { + // @ts-expect-error: CursorEvents is generic so Parameters may not be assignable to `[]`. Not sure how to require extenders do not add parameters. + this.emit('close'); + } + } + finally { + this.hasEmittedClose = true; + } + } + /** @internal */ + async transformDocument(document) { + if (this.transform == null) + return document; + try { + const transformedDocument = this.transform(document); + // eslint-disable-next-line no-restricted-syntax + if (transformedDocument === null) { + const TRANSFORM_TO_NULL_ERROR = 'Cursor returned a `null` document, but the cursor is not exhausted. Mapping documents to `null` is not supported in the cursor transform.'; + throw new error_1.MongoAPIError(TRANSFORM_TO_NULL_ERROR); + } + return transformedDocument; + } + catch (transformError) { + try { + await this.close(); + } + catch (closeError) { + (0, utils_1.squashError)(closeError); + } + throw transformError; + } + } + /** @internal */ + throwIfInitialized() { + if (this.initialized) + throw new error_1.MongoCursorInUseError(); + } +} +exports.AbstractCursor = AbstractCursor; +class ReadableCursorStream extends stream_1.Readable { + constructor(cursor) { + super({ + objectMode: true, + autoDestroy: false, + highWaterMark: 1 + }); + this._readInProgress = false; + this._cursor = cursor; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _read(size) { + if (!this._readInProgress) { + this._readInProgress = true; + this._readNext(); + } + } + _destroy(error, callback) { + this._cursor.close().then(() => callback(error), closeError => callback(closeError)); + } + _readNext() { + if (this._cursor.id === bson_1.Long.ZERO) { + this.push(null); + return; + } + this._cursor + .next() + .then( + // result from next() + result => { + if (result == null) { + this.push(null); + } + else if (this.destroyed) { + this._cursor.close().then(undefined, utils_1.squashError); + } + else { + if (this.push(result)) { + return this._readNext(); + } + this._readInProgress = false; + } + }, + // error from next() + err => { + // NOTE: This is questionable, but we have a test backing the behavior. It seems the + // desired behavior is that a stream ends cleanly when a user explicitly closes + // a client during iteration. Alternatively, we could do the "right" thing and + // propagate the error message by removing this special case. + if (err.message.match(/server is closed/)) { + this._cursor.close().then(undefined, utils_1.squashError); + return this.push(null); + } + // NOTE: This is also perhaps questionable. The rationale here is that these errors tend + // to be "operation was interrupted", where a cursor has been closed but there is an + // active getMore in-flight. This used to check if the cursor was killed but once + // that changed to happen in cleanup legitimate errors would not destroy the + // stream. There are change streams test specifically test these cases. + if (err.message.match(/operation was interrupted/)) { + return this.push(null); + } + // NOTE: The two above checks on the message of the error will cause a null to be pushed + // to the stream, thus closing the stream before the destroy call happens. This means + // that either of those error messages on a change stream will not get a proper + // 'error' event to be emitted (the error passed to destroy). Change stream resumability + // relies on that error event to be emitted to create its new cursor and thus was not + // working on 4.4 servers because the error emitted on failover was "interrupted at + // shutdown" while on 5.0+ it is "The server is in quiesce mode and will shut down". + // See NODE-4475. + return this.destroy(err); + }) + // if either of the above handlers throw + .catch(error => { + this._readInProgress = false; + this.destroy(error); + }); + } +} +/** + * @internal + * The cursor timeout context is a wrapper around a timeout context + * that keeps track of the "owner" of the cursor. For timeout contexts + * instantiated inside a cursor, the owner will be the cursor. + * + * All timeout behavior is exactly the same as the wrapped timeout context's. + */ +class CursorTimeoutContext extends timeout_1.TimeoutContext { + constructor(timeoutContext, owner) { + super(); + this.timeoutContext = timeoutContext; + this.owner = owner; + } + get serverSelectionTimeout() { + return this.timeoutContext.serverSelectionTimeout; + } + get connectionCheckoutTimeout() { + return this.timeoutContext.connectionCheckoutTimeout; + } + get clearServerSelectionTimeout() { + return this.timeoutContext.clearServerSelectionTimeout; + } + get timeoutForSocketWrite() { + return this.timeoutContext.timeoutForSocketWrite; + } + get timeoutForSocketRead() { + return this.timeoutContext.timeoutForSocketRead; + } + csotEnabled() { + return this.timeoutContext.csotEnabled(); + } + refresh() { + if (typeof this.owner !== 'symbol') + return this.timeoutContext.refresh(); + } + clear() { + if (typeof this.owner !== 'symbol') + return this.timeoutContext.clear(); + } + get maxTimeMS() { + return this.timeoutContext.maxTimeMS; + } + get timeoutMS() { + return this.timeoutContext.csotEnabled() ? this.timeoutContext.timeoutMS : null; + } + refreshed() { + return new CursorTimeoutContext(this.timeoutContext.refreshed(), this.owner); + } + addMaxTimeMSToCommand(command, options) { + this.timeoutContext.addMaxTimeMSToCommand(command, options); + } + getSocketTimeoutMS() { + return this.timeoutContext.getSocketTimeoutMS(); + } +} +exports.CursorTimeoutContext = CursorTimeoutContext; +//# sourceMappingURL=abstract_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js.map new file mode 100644 index 00000000..ae75a8f5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/abstract_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"abstract_cursor.js","sourceRoot":"","sources":["../../src/cursor/abstract_cursor.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAElC,kCAAoG;AAGpG,oCAOkB;AAElB,gDAAmE;AACnE,uEAAmE;AACnE,qDAA0D;AAC1D,6DAAkE;AAClE,kDAAoE;AACpE,wDAA6E;AAE7E,0CAA6E;AAC7E,wCAAmF;AACnF,oCAOkB;AAoBlB,cAAc;AACD,QAAA,YAAY,GAAG;IAC1B,UAAU;IACV,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,SAAS;IACT,SAAS;CACD,CAAC;AAKX,SAAS,kBAAkB;IACzB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACU,QAAA,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,WAAW;IACtB,Q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AAa,oBAAoB;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC;IAClD,CAAC;IACQ,WAAW;QAClB,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;IAC3C,CAAC;IACQ,OAAO;QACd,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;IAC3E,CAAC;IACQ,KAAK;QACZ,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IACzE,CAAC;IACD,IAAa,SAAS;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;IACvC,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IAClF,CAAC;IACQ,SAAS;QAChB,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;IACQ,qBAAqB,CAAC,OAAiB,EAAE,OAAoC;QACpF,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IACQ,kBAAkB;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;IAClD,CAAC;CACF;AAhDD,oDAgDC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js new file mode 100644 index 00000000..bfea310d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js @@ -0,0 +1,164 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AggregationCursor = void 0; +const error_1 = require("../error"); +const explain_1 = require("../explain"); +const aggregate_1 = require("../operations/aggregate"); +const execute_operation_1 = require("../operations/execute_operation"); +const utils_1 = require("../utils"); +const abstract_cursor_1 = require("./abstract_cursor"); +const explainable_cursor_1 = require("./explainable_cursor"); +/** + * The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB + * allowing for iteration over the results returned from the underlying query. It supports + * one by one document iteration, conversion to an array or can be iterated as a Node 4.X + * or higher stream + * @public + */ +class AggregationCursor extends explainable_cursor_1.ExplainableCursor { + /** @internal */ + constructor(client, namespace, pipeline = [], options = {}) { + super(client, namespace, options); + this.pipeline = pipeline; + this.aggregateOptions = options; + const lastStage = this.pipeline[this.pipeline.length - 1]; + if (this.cursorOptions.timeoutMS != null && + this.cursorOptions.timeoutMode === abstract_cursor_1.CursorTimeoutMode.ITERATION && + (lastStage?.$merge != null || lastStage?.$out != null)) + throw new error_1.MongoAPIError('Cannot use $out or $merge stage with ITERATION timeoutMode'); + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this.aggregateOptions); + delete clonedOptions.session; + return new AggregationCursor(this.client, this.namespace, this.pipeline, { + ...clonedOptions + }); + } + map(transform) { + return super.map(transform); + } + /** @internal */ + async _initialize(session) { + const options = { + ...this.aggregateOptions, + ...this.cursorOptions, + session, + signal: this.signal + }; + if (options.explain) { + try { + (0, explain_1.validateExplainTimeoutOptions)(options, explain_1.Explain.fromOptions(options)); + } + catch { + throw new error_1.MongoAPIError('timeoutMS cannot be used with explain when explain is specified in aggregateOptions'); + } + } + const aggregateOperation = new aggregate_1.AggregateOperation(this.namespace, this.pipeline, options); + const response = await (0, execute_operation_1.executeOperation)(this.client, aggregateOperation, this.timeoutContext); + return { server: aggregateOperation.server, session, response }; + } + async explain(verbosity, options) { + const { explain, timeout } = this.resolveExplainTimeoutOptions(verbosity, options); + return (await (0, execute_operation_1.executeOperation)(this.client, new aggregate_1.AggregateOperation(this.namespace, this.pipeline, { + ...this.aggregateOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...timeout, + explain: explain ?? true + }))).shift(this.deserializationOptions); + } + addStage(stage) { + this.throwIfInitialized(); + if (this.cursorOptions.timeoutMS != null && + this.cursorOptions.timeoutMode === abstract_cursor_1.CursorTimeoutMode.ITERATION && + (stage.$out != null || stage.$merge != null)) { + throw new error_1.MongoAPIError('Cannot use $out or $merge stage with ITERATION timeoutMode'); + } + this.pipeline.push(stage); + return this; + } + group($group) { + return this.addStage({ $group }); + } + /** Add a limit stage to the aggregation pipeline */ + limit($limit) { + return this.addStage({ $limit }); + } + /** Add a match stage to the aggregation pipeline */ + match($match) { + return this.addStage({ $match }); + } + /** Add an out stage to the aggregation pipeline */ + out($out) { + return this.addStage({ $out }); + } + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: AggregationCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.aggregate().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project($project) { + return this.addStage({ $project }); + } + /** Add a lookup stage to the aggregation pipeline */ + lookup($lookup) { + return this.addStage({ $lookup }); + } + /** Add a redact stage to the aggregation pipeline */ + redact($redact) { + return this.addStage({ $redact }); + } + /** Add a skip stage to the aggregation pipeline */ + skip($skip) { + return this.addStage({ $skip }); + } + /** Add a sort stage to the aggregation pipeline */ + sort($sort) { + return this.addStage({ $sort }); + } + /** Add a unwind stage to the aggregation pipeline */ + unwind($unwind) { + return this.addStage({ $unwind }); + } + /** Add a geoNear stage to the aggregation pipeline */ + geoNear($geoNear) { + return this.addStage({ $geoNear }); + } +} +exports.AggregationCursor = AggregationCursor; +//# sourceMappingURL=aggregation_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map new file mode 100644 index 00000000..55b1cffc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregation_cursor.js","sourceRoot":"","sources":["../../src/cursor/aggregation_cursor.ts"],"names":[],"mappings":";;;AACA,oCAAyC;AACzC,wCAKoB;AAGpB,uDAAoF;AACpF,uEAAmE;AAGnE,oCAA+D;AAC/D,uDAI2B;AAC3B,6DAAyD;AAKzD;;;;;;GAMG;AACH,MAAa,iBAAiC,SAAQ,sCAA0B;IAK9E,gBAAgB;IAChB,YACE,MAAmB,EACnB,SAA2B,EAC3B,WAAuB,EAAE,EACzB,UAAwC,EAAE;QAE1C,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAEhC,MAAM,S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IACtD,OAAO,CAAC,QAAkB;QACxB,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrC,CAAC;CACF;AApND,8CAoNC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js new file mode 100644 index 00000000..ca2a28cc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChangeStreamCursor = void 0; +const change_stream_1 = require("../change_stream"); +const constants_1 = require("../constants"); +const aggregate_1 = require("../operations/aggregate"); +const execute_operation_1 = require("../operations/execute_operation"); +const utils_1 = require("../utils"); +const abstract_cursor_1 = require("./abstract_cursor"); +/** @internal */ +class ChangeStreamCursor extends abstract_cursor_1.AbstractCursor { + constructor(client, namespace, pipeline = [], options = {}) { + super(client, namespace, { ...options, tailable: true, awaitData: true }); + this.pipeline = pipeline; + this.changeStreamCursorOptions = options; + this._resumeToken = null; + this.startAtOperationTime = options.startAtOperationTime ?? null; + if (options.startAfter) { + this.resumeToken = options.startAfter; + } + else if (options.resumeAfter) { + this.resumeToken = options.resumeAfter; + } + } + set resumeToken(token) { + this._resumeToken = token; + this.emit(change_stream_1.ChangeStream.RESUME_TOKEN_CHANGED, token); + } + get resumeToken() { + return this._resumeToken; + } + get resumeOptions() { + const options = { + ...this.changeStreamCursorOptions + }; + for (const key of ['resumeAfter', 'startAfter', 'startAtOperationTime']) { + delete options[key]; + } + if (this.resumeToken != null) { + if (this.changeStreamCursorOptions.startAfter && !this.hasReceived) { + options.startAfter = this.resumeToken; + } + else { + options.resumeAfter = this.resumeToken; + } + } + else if (this.startAtOperationTime != null) { + options.startAtOperationTime = this.startAtOperationTime; + } + return options; + } + cacheResumeToken(resumeToken) { + if (this.bufferedCount() === 0 && this.postBatchResumeToken) { + this.resumeToken = this.postBatchResumeToken; + } + else { + this.resumeToken = resumeToken; + } + this.hasReceived = true; + } + _processBatch(response) { + const { postBatchResumeToken } = response; + if (postBatchResumeToken) { + this.postBatchResumeToken = postBatchResumeToken; + if (response.batchSize === 0) { + this.resumeToken = postBatchResumeToken; + } + } + } + clone() { + return new ChangeStreamCursor(this.client, this.namespace, this.pipeline, { + ...this.cursorOptions + }); + } + async _initialize(session) { + const aggregateOperation = new aggregate_1.AggregateOperation(this.namespace, this.pipeline, { + ...this.cursorOptions, + ...this.changeStreamCursorOptions, + session + }); + const response = await (0, execute_operation_1.executeOperation)(session.client, aggregateOperation, this.timeoutContext); + const server = aggregateOperation.server; + this.maxWireVersion = (0, utils_1.maxWireVersion)(server); + if (this.startAtOperationTime == null && + this.changeStreamCursorOptions.resumeAfter == null && + this.changeStreamCursorOptions.startAfter == null) { + this.startAtOperationTime = response.operationTime; + } + this._processBatch(response); + this.emit(constants_1.INIT, response); + this.emit(constants_1.RESPONSE); + return { server, session, response }; + } + async getMore() { + const response = await super.getMore(); + this.maxWireVersion = (0, utils_1.maxWireVersion)(this.server); + this._processBatch(response); + this.emit(change_stream_1.ChangeStream.MORE, response); + this.emit(change_stream_1.ChangeStream.RESPONSE); + return response; + } +} +exports.ChangeStreamCursor = ChangeStreamCursor; +//# sourceMappingURL=change_stream_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js.map new file mode 100644 index 00000000..b7e8cc63 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/change_stream_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"change_stream_cursor.js","sourceRoot":"","sources":["../../src/cursor/change_stream_cursor.ts"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;QACvC,IAAI,CAAC,IAAI,CAAC,4BAAY,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAzID,gDAyIC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js new file mode 100644 index 00000000..6abd4ec4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientBulkWriteCursor = void 0; +const client_bulk_write_1 = require("../operations/client_bulk_write/client_bulk_write"); +const execute_operation_1 = require("../operations/execute_operation"); +const utils_1 = require("../utils"); +const abstract_cursor_1 = require("./abstract_cursor"); +/** + * This is the cursor that handles client bulk write operations. Note this is never + * exposed directly to the user and is always immediately exhausted. + * @internal + */ +class ClientBulkWriteCursor extends abstract_cursor_1.AbstractCursor { + /** @internal */ + constructor(client, commandBuilder, options = {}) { + super(client, new utils_1.MongoDBNamespace('admin', '$cmd'), options); + this.commandBuilder = commandBuilder; + this.clientBulkWriteOptions = options; + } + /** + * We need a way to get the top level cursor response fields for + * generating the bulk write result, so we expose this here. + */ + get response() { + if (this.cursorResponse) + return this.cursorResponse; + return null; + } + get operations() { + return this.commandBuilder.lastOperations; + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this.clientBulkWriteOptions); + delete clonedOptions.session; + return new ClientBulkWriteCursor(this.client, this.commandBuilder, { + ...clonedOptions + }); + } + /** @internal */ + async _initialize(session) { + const clientBulkWriteOperation = new client_bulk_write_1.ClientBulkWriteOperation(this.commandBuilder, { + ...this.clientBulkWriteOptions, + ...this.cursorOptions, + session + }); + const response = await (0, execute_operation_1.executeOperation)(this.client, clientBulkWriteOperation, this.timeoutContext); + this.cursorResponse = response; + return { server: clientBulkWriteOperation.server, session, response }; + } +} +exports.ClientBulkWriteCursor = ClientBulkWriteCursor; +//# sourceMappingURL=client_bulk_write_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js.map new file mode 100644 index 00000000..ad28ab4b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client_bulk_write_cursor.js","sourceRoot":"","sources":["../../src/cursor/client_bulk_write_cursor.ts"],"names":[],"mappings":";;;AAGA,yFAA6F;AAG7F,uEAAmE;AAEnE,oCAA0D;AAC1D,uDAI2B;AAO3B;;;;GAIG;AACH,MAAa,qBAAsB,SAAQ,gCAAc;IAOvD,gBAAgB;IAChB,YACE,MAAmB,EACnB,cAA6C,EAC7C,UAAwC,EAAE;QAE1C,KAAK,CAAC,MAAM,EAAE,IAAI,wBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;QAE9D,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,IAAI,QAAQ;QACV,IAAI,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,CAAC,cAAc,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,CAAC;IAED,KAAK;QACH,MAAM,aAAa,GAAG,IAAA,oBAAY,EAAC,EAAE,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACpE,OAAO,aAAa,CAAC,OAAO,CAAC;QAC7B,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE;YACjE,GAAG,aAAa;SACjB,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,WAAW,CAAC,OAAsB;QACtC,MAAM,wBAAwB,GAAG,IAAI,4CAAwB,CAAC,IAAI,CAAC,cAAc,EAAE;YACjF,GAAG,IAAI,CAAC,sBAAsB;YAC9B,GAAG,IAAI,CAAC,aAAa;YACrB,OAAO;SACR,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,IAAA,oCAAgB,EACrC,IAAI,CAAC,MAAM,EACX,wBAAwB,EACxB,IAAI,CAAC,cAAc,CACpB,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC;QAE/B,OAAO,EAAE,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACxE,CAAC;CACF;AAzDD,sDAyDC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js new file mode 100644 index 00000000..d4717b6e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExplainableCursor = void 0; +const abstract_cursor_1 = require("./abstract_cursor"); +/** + * @public + * + * A base class for any cursors that have `explain()` methods. + */ +class ExplainableCursor extends abstract_cursor_1.AbstractCursor { + resolveExplainTimeoutOptions(verbosity, options) { + let explain; + let timeout; + if (verbosity == null && options == null) { + explain = undefined; + timeout = undefined; + } + else if (verbosity != null && options == null) { + explain = + typeof verbosity !== 'object' + ? verbosity + : 'verbosity' in verbosity + ? verbosity + : undefined; + timeout = typeof verbosity === 'object' && 'timeoutMS' in verbosity ? verbosity : undefined; + } + else { + // @ts-expect-error TS isn't smart enough to determine that if both options are provided, the first is explain options + explain = verbosity; + timeout = options; + } + return { timeout, explain }; + } +} +exports.ExplainableCursor = ExplainableCursor; +//# sourceMappingURL=explainable_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js.map new file mode 100644 index 00000000..c0a14cc0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/explainable_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"explainable_cursor.js","sourceRoot":"","sources":["../../src/cursor/explainable_cursor.ts"],"names":[],"mappings":";;;AAEA,uDAAmD;AAEnD;;;;GAIG;AACH,MAAsB,iBAA2B,SAAQ,gCAAuB;IAcpE,4BAA4B,CACpC,SAAiF,EACjF,OAAgC;QAEhC,IAAI,OAAiE,CAAC;QACtE,IAAI,OAA2C,CAAC;QAEhD,IAAI,SAAS,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACzC,OAAO,GAAG,SAAS,CAAC;YACpB,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;aAAM,IAAI,SAAS,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YAChD,OAAO;gBACL,OAAO,SAAS,KAAK,QAAQ;oBAC3B,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,WAAW,IAAI,SAAS;wBACxB,CAAC,CAAC,SAAS;wBACX,CAAC,CAAC,SAAS,CAAC;YAElB,OAAO,GAAG,OAAO,SAAS,KAAK,QAAQ,IAAI,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9F,CAAC;aAAM,CAAC;YACN,sHAAsH;YACtH,OAAO,GAAG,SAAS,CAAC;YACpB,OAAO,GAAG,OAAO,CAAC;QACpB,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC9B,CAAC;CACF;AAzCD,8CAyCC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js new file mode 100644 index 00000000..c10ba25c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js @@ -0,0 +1,399 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FindCursor = exports.FLAGS = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const explain_1 = require("../explain"); +const count_1 = require("../operations/count"); +const execute_operation_1 = require("../operations/execute_operation"); +const find_1 = require("../operations/find"); +const sort_1 = require("../sort"); +const utils_1 = require("../utils"); +const explainable_cursor_1 = require("./explainable_cursor"); +/** @public Flags allowed for cursor */ +exports.FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +]; +/** @public */ +class FindCursor extends explainable_cursor_1.ExplainableCursor { + /** @internal */ + constructor(client, namespace, filter = {}, options = {}) { + super(client, namespace, options); + /** @internal */ + this.numReturned = 0; + this.cursorFilter = filter; + this.findOptions = options; + if (options.sort != null) { + this.findOptions.sort = (0, sort_1.formatSort)(options.sort); + } + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this.findOptions); + delete clonedOptions.session; + return new FindCursor(this.client, this.namespace, this.cursorFilter, { + ...clonedOptions + }); + } + map(transform) { + return super.map(transform); + } + /** @internal */ + async _initialize(session) { + const options = { + ...this.findOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + session, + signal: this.signal + }; + if (options.explain) { + try { + (0, explain_1.validateExplainTimeoutOptions)(options, explain_1.Explain.fromOptions(options)); + } + catch { + throw new error_1.MongoAPIError('timeoutMS cannot be used with explain when explain is specified in findOptions'); + } + } + const findOperation = new find_1.FindOperation(this.namespace, this.cursorFilter, options); + const response = await (0, execute_operation_1.executeOperation)(this.client, findOperation, this.timeoutContext); + // the response is not a cursor when `explain` is enabled + this.numReturned = response.batchSize; + return { server: findOperation.server, session, response }; + } + /** @internal */ + async getMore() { + const numReturned = this.numReturned; + const limit = this.findOptions.limit ?? Infinity; + const remaining = limit - numReturned; + if (numReturned === limit && !this.id?.isZero()) { + // this is an optimization for the special case of a limit for a find command to avoid an + // extra getMore when the limit has been reached and the limit is a multiple of the batchSize. + // This is a consequence of the new query engine in 5.0 having no knowledge of the limit as it + // produces results for the find command. Once a batch is filled up, it is returned and only + // on the subsequent getMore will the query framework consider the limit, determine the cursor + // is exhausted and return a cursorId of zero. + // instead, if we determine there are no more documents to request from the server, we preemptively + // close the cursor + try { + await this.close(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + return responses_1.CursorResponse.emptyGetMore; + } + // TODO(DRIVERS-1448): Remove logic to enforce `limit` in the driver + let cleanup = utils_1.noop; + const { batchSize } = this.cursorOptions; + if (batchSize != null && batchSize > remaining) { + this.cursorOptions.batchSize = remaining; + // After executing the final getMore, re-assign the batchSize back to its original value so that + // if the cursor is rewound and executed, the batchSize is still correct. + cleanup = () => { + this.cursorOptions.batchSize = batchSize; + }; + } + try { + const response = await super.getMore(); + this.numReturned = this.numReturned + response.batchSize; + return response; + } + finally { + cleanup?.(); + } + } + /** + * Get the count of documents for this cursor + * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead + */ + async count(options) { + (0, utils_1.emitWarningOnce)('cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead '); + if (typeof options === 'boolean') { + throw new error_1.MongoInvalidArgumentError('Invalid first parameter to count'); + } + return await (0, execute_operation_1.executeOperation)(this.client, new count_1.CountOperation(this.namespace, this.cursorFilter, { + ...this.findOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...options + })); + } + async explain(verbosity, options) { + const { explain, timeout } = this.resolveExplainTimeoutOptions(verbosity, options); + return (await (0, execute_operation_1.executeOperation)(this.client, new find_1.FindOperation(this.namespace, this.cursorFilter, { + ...this.findOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...timeout, + explain: explain ?? true + }))).shift(this.deserializationOptions); + } + /** Set the cursor query */ + filter(filter) { + this.throwIfInitialized(); + this.cursorFilter = filter; + return this; + } + /** + * Set the cursor hint + * + * @param hint - If specified, then the query system will only consider plans using the hinted index. + */ + hint(hint) { + this.throwIfInitialized(); + this.findOptions.hint = hint; + return this; + } + /** + * Set the cursor min + * + * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order. + */ + min(min) { + this.throwIfInitialized(); + this.findOptions.min = min; + return this; + } + /** + * Set the cursor max + * + * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order. + */ + max(max) { + this.throwIfInitialized(); + this.findOptions.max = max; + return this; + } + /** + * Set the cursor returnKey. + * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. + * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. + * + * @param value - the returnKey value. + */ + returnKey(value) { + this.throwIfInitialized(); + this.findOptions.returnKey = value; + return this; + } + /** + * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection. + * + * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find. + */ + showRecordId(value) { + this.throwIfInitialized(); + this.findOptions.showRecordId = value; + return this; + } + /** + * Add a query modifier to the cursor query + * + * @param name - The query modifier (must start with $, such as $orderby etc) + * @param value - The modifier value. + */ + addQueryModifier(name, value) { + this.throwIfInitialized(); + if (name[0] !== '$') { + throw new error_1.MongoInvalidArgumentError(`${name} is not a valid query modifier`); + } + // Strip of the $ + const field = name.substr(1); + // NOTE: consider some TS magic for this + switch (field) { + case 'comment': + this.findOptions.comment = value; + break; + case 'explain': + this.findOptions.explain = value; + break; + case 'hint': + this.findOptions.hint = value; + break; + case 'max': + this.findOptions.max = value; + break; + case 'maxTimeMS': + this.findOptions.maxTimeMS = value; + break; + case 'min': + this.findOptions.min = value; + break; + case 'orderby': + this.findOptions.sort = (0, sort_1.formatSort)(value); + break; + case 'query': + this.cursorFilter = value; + break; + case 'returnKey': + this.findOptions.returnKey = value; + break; + case 'showDiskLoc': + this.findOptions.showRecordId = value; + break; + default: + throw new error_1.MongoInvalidArgumentError(`Invalid query modifier: ${name}`); + } + return this; + } + /** + * Add a comment to the cursor query allowing for tracking the comment in the log. + * + * @param value - The comment attached to this query. + */ + comment(value) { + this.throwIfInitialized(); + this.findOptions.comment = value; + return this; + } + /** + * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise) + * + * @param value - Number of milliseconds to wait before aborting the tailed query. + */ + maxAwaitTimeMS(value) { + this.throwIfInitialized(); + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Argument for maxAwaitTimeMS must be a number'); + } + this.findOptions.maxAwaitTimeMS = value; + return this; + } + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value) { + this.throwIfInitialized(); + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + this.findOptions.maxTimeMS = value; + return this; + } + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic + * {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: FindCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor<{ a: number; b: string }> = coll.find(); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.find().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project(value) { + this.throwIfInitialized(); + this.findOptions.projection = value; + return this; + } + /** + * Sets the sort order of the cursor query. + * + * @param sort - The key or keys set for the sort. + * @param direction - The direction of the sorting (1 or -1). + */ + sort(sort, direction) { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support sorting'); + } + this.findOptions.sort = (0, sort_1.formatSort)(sort, direction); + return this; + } + /** + * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) + * + * @remarks + * {@link https://www.mongodb.com/docs/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation} + */ + allowDiskUse(allow = true) { + this.throwIfInitialized(); + if (!this.findOptions.sort) { + throw new error_1.MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification'); + } + // As of 6.0 the default is true. This allows users to get back to the old behavior. + if (!allow) { + this.findOptions.allowDiskUse = false; + return this; + } + this.findOptions.allowDiskUse = true; + return this; + } + /** + * Set the collation options for the cursor. + * + * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + */ + collation(value) { + this.throwIfInitialized(); + this.findOptions.collation = value; + return this; + } + /** + * Set the limit for the cursor. + * + * @param value - The limit for the cursor query. + */ + limit(value) { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support limit'); + } + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Operation "limit" requires an integer'); + } + this.findOptions.limit = value; + return this; + } + /** + * Set the skip for the cursor. + * + * @param value - The skip for the cursor query. + */ + skip(value) { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support skip'); + } + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Operation "skip" requires an integer'); + } + this.findOptions.skip = value; + return this; + } +} +exports.FindCursor = FindCursor; +//# sourceMappingURL=find_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js.map new file mode 100644 index 00000000..09a83eb5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/find_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"find_cursor.js","sourceRoot":"","sources":["../../src/cursor/find_cursor.ts"],"names":[],"mappings":";;;AACA,+DAAiE;AACjE,oCAA8F;AAC9F,wCAKoB;AAIpB,+CAAwE;AACxE,uEAAmE;AACnE,6CAAqE;AAGrE,kCAAoE;AACpE,oCAAmG;AAEnG,6DAAyD;AAEzD,uCAAuC;AAC1B,QAAA,KAAK,GAAG;IACnB,UAAU;IACV,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,SAAS;IACT,SAAS;CACD,CAAC;AAEX,cAAc;AACd,MAAa,UAA0B,SAAQ,sCAA0B;IAQvE,gBAAgB;IAChB,YACE,MAAmB,EACnB,SAA2B,EAC3B,SAAmB,EAAE,EACrB,UAAmC,EAAE;QAErC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAZpC,gBA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AQ,EAAE,CAAC;YAC9B,MAAM,IAAI,iCAAyB,CAAC,sCAAsC,CAAC,CAAC;QAC9E,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,KAAK,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/cD,gCA+cC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js new file mode 100644 index 00000000..e0804057 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListCollectionsCursor = void 0; +const execute_operation_1 = require("../operations/execute_operation"); +const list_collections_1 = require("../operations/list_collections"); +const abstract_cursor_1 = require("./abstract_cursor"); +/** @public */ +class ListCollectionsCursor extends abstract_cursor_1.AbstractCursor { + constructor(db, filter, options) { + super(db.client, db.s.namespace, options); + this.parent = db; + this.filter = filter; + this.options = options; + } + clone() { + return new ListCollectionsCursor(this.parent, this.filter, { + ...this.options, + ...this.cursorOptions + }); + } + /** @internal */ + async _initialize(session) { + const operation = new list_collections_1.ListCollectionsOperation(this.parent, this.filter, { + ...this.cursorOptions, + ...this.options, + session, + signal: this.signal + }); + const response = await (0, execute_operation_1.executeOperation)(this.parent.client, operation, this.timeoutContext); + return { server: operation.server, session, response }; + } +} +exports.ListCollectionsCursor = ListCollectionsCursor; +//# sourceMappingURL=list_collections_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js.map new file mode 100644 index 00000000..a02a42da --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_collections_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list_collections_cursor.js","sourceRoot":"","sources":["../../src/cursor/list_collections_cursor.ts"],"names":[],"mappings":";;;AAGA,uEAAmE;AACnE,qEAIwC;AAExC,uDAA+E;AAE/E,cAAc;AACd,MAAa,qBAIX,SAAQ,gCAAiB;IAKzB,YAAY,EAAM,EAAE,MAAgB,EAAE,OAA4C;QAChF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;YACzD,GAAG,IAAI,CAAC,OAAO;YACf,GAAG,IAAI,CAAC,aAAa;SACtB,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,WAAW,CAAC,OAAkC;QAClD,MAAM,SAAS,GAAG,IAAI,2CAAwB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;YACvE,GAAG,IAAI,CAAC,aAAa;YACrB,GAAG,IAAI,CAAC,OAAO;YACf,OAAO;YACP,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,IAAA,oCAAgB,EAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAE5F,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACzD,CAAC;CACF;AApCD,sDAoCC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js new file mode 100644 index 00000000..a78a7fd2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListIndexesCursor = void 0; +const execute_operation_1 = require("../operations/execute_operation"); +const indexes_1 = require("../operations/indexes"); +const abstract_cursor_1 = require("./abstract_cursor"); +/** @public */ +class ListIndexesCursor extends abstract_cursor_1.AbstractCursor { + constructor(collection, options) { + super(collection.client, collection.s.namespace, options); + this.parent = collection; + this.options = options; + } + clone() { + return new ListIndexesCursor(this.parent, { + ...this.options, + ...this.cursorOptions + }); + } + /** @internal */ + async _initialize(session) { + const operation = new indexes_1.ListIndexesOperation(this.parent, { + ...this.cursorOptions, + ...this.options, + session + }); + const response = await (0, execute_operation_1.executeOperation)(this.parent.client, operation, this.timeoutContext); + return { server: operation.server, session, response }; + } +} +exports.ListIndexesCursor = ListIndexesCursor; +//# sourceMappingURL=list_indexes_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js.map new file mode 100644 index 00000000..3962b584 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list_indexes_cursor.js","sourceRoot":"","sources":["../../src/cursor/list_indexes_cursor.ts"],"names":[],"mappings":";;;AACA,uEAAmE;AACnE,mDAAsF;AAEtF,uDAA+E;AAE/E,cAAc;AACd,MAAa,iBAAkB,SAAQ,gCAAc;IAInD,YAAY,UAAsB,EAAE,OAA4B;QAC9D,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE;YACxC,GAAG,IAAI,CAAC,OAAO;YACf,GAAG,IAAI,CAAC,aAAa;SACtB,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,WAAW,CAAC,OAAkC;QAClD,MAAM,SAAS,GAAG,IAAI,8BAAoB,CAAC,IAAI,CAAC,MAAM,EAAE;YACtD,GAAG,IAAI,CAAC,aAAa;YACrB,GAAG,IAAI,CAAC,OAAO;YACf,OAAO;SACR,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,IAAA,oCAAgB,EAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAE5F,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACzD,CAAC;CACF;AA7BD,8CA6BC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js new file mode 100644 index 00000000..d9c39c70 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListSearchIndexesCursor = void 0; +const aggregation_cursor_1 = require("./aggregation_cursor"); +/** @public */ +class ListSearchIndexesCursor extends aggregation_cursor_1.AggregationCursor { + /** @internal */ + constructor({ fullNamespace: ns, client }, name, options = {}) { + const pipeline = name == null ? [{ $listSearchIndexes: {} }] : [{ $listSearchIndexes: { name } }]; + super(client, ns, pipeline, options); + } +} +exports.ListSearchIndexesCursor = ListSearchIndexesCursor; +//# sourceMappingURL=list_search_indexes_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js.map new file mode 100644 index 00000000..6353a21a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list_search_indexes_cursor.js","sourceRoot":"","sources":["../../src/cursor/list_search_indexes_cursor.ts"],"names":[],"mappings":";;;AAEA,6DAAyD;AAKzD,cAAc;AACd,MAAa,uBAAwB,SAAQ,sCAAmC;IAC9E,gBAAgB;IAChB,YACE,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,EAAc,EACzC,IAAmB,EACnB,UAAoC,EAAE;QAEtC,MAAM,QAAQ,GACZ,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACnF,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAXD,0DAWC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js new file mode 100644 index 00000000..41a85959 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RunCommandCursor = void 0; +const error_1 = require("../error"); +const execute_operation_1 = require("../operations/execute_operation"); +const get_more_1 = require("../operations/get_more"); +const run_command_1 = require("../operations/run_command"); +const utils_1 = require("../utils"); +const abstract_cursor_1 = require("./abstract_cursor"); +/** @public */ +class RunCommandCursor extends abstract_cursor_1.AbstractCursor { + /** + * Controls the `getMore.comment` field + * @param comment - any BSON value + */ + setComment(comment) { + this.getMoreOptions.comment = comment; + return this; + } + /** + * Controls the `getMore.maxTimeMS` field. Only valid when cursor is tailable await + * @param maxTimeMS - the number of milliseconds to wait for new data + */ + setMaxTimeMS(maxTimeMS) { + this.getMoreOptions.maxAwaitTimeMS = maxTimeMS; + return this; + } + /** + * Controls the `getMore.batchSize` field + * @param batchSize - the number documents to return in the `nextBatch` + */ + setBatchSize(batchSize) { + this.getMoreOptions.batchSize = batchSize; + return this; + } + /** Unsupported for RunCommandCursor */ + clone() { + throw new error_1.MongoAPIError('Clone not supported, create a new cursor with db.runCursorCommand'); + } + /** Unsupported for RunCommandCursor: readConcern must be configured directly on command document */ + withReadConcern(_) { + throw new error_1.MongoAPIError('RunCommandCursor does not support readConcern it must be attached to the command being run'); + } + /** Unsupported for RunCommandCursor: various cursor flags must be configured directly on command document */ + addCursorFlag(_, __) { + throw new error_1.MongoAPIError('RunCommandCursor does not support cursor flags, they must be attached to the command being run'); + } + /** + * Unsupported for RunCommandCursor: maxTimeMS must be configured directly on command document + */ + maxTimeMS(_) { + throw new error_1.MongoAPIError('maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()'); + } + /** Unsupported for RunCommandCursor: batchSize must be configured directly on command document */ + batchSize(_) { + throw new error_1.MongoAPIError('batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()'); + } + /** @internal */ + constructor(db, command, options = {}) { + super(db.client, (0, utils_1.ns)(db.namespace), options); + this.getMoreOptions = {}; + this.db = db; + this.command = Object.freeze({ ...command }); + } + /** @internal */ + async _initialize(session) { + const operation = new run_command_1.RunCursorCommandOperation(this.db.s.namespace, this.command, { + ...this.cursorOptions, + session: session, + readPreference: this.cursorOptions.readPreference + }); + const response = await (0, execute_operation_1.executeOperation)(this.client, operation, this.timeoutContext); + return { + server: operation.server, + session, + response + }; + } + /** @internal */ + async getMore() { + if (!this.session) { + throw new error_1.MongoRuntimeError('Unexpected null session. A cursor creating command should have set this'); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const getMoreOperation = new get_more_1.GetMoreOperation(this.namespace, this.id, this.server, { + ...this.cursorOptions, + session: this.session, + ...this.getMoreOptions + }); + return await (0, execute_operation_1.executeOperation)(this.client, getMoreOperation, this.timeoutContext); + } +} +exports.RunCommandCursor = RunCommandCursor; +//# sourceMappingURL=run_command_cursor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js.map new file mode 100644 index 00000000..7840979f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/cursor/run_command_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"run_command_cursor.js","sourceRoot":"","sources":["../../src/cursor/run_command_cursor.ts"],"names":[],"mappings":";;;AAGA,oCAA4D;AAC5D,uEAAmE;AACnE,qDAA0D;AAC1D,2DAAsE;AAItE,oCAA8B;AAC9B,uDAI2B;AA+C3B,cAAc;AACd,MAAa,gBAAiB,SAAQ,gCAAc;IAQlD;;;OAGG;IACI,UAAU,CAAC,OAAY;QAC5B,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,SAAi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,CAAC,OAAO,EAAE;YACjF,GAAG,IAAI,CAAC,aAAa;YACrB,OAAO,EAAE,OAAO;YAChB,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc;SAClD,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,IAAA,oCAAgB,EAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAErF,OAAO;YACL,MAAM,EAAE,SAAS,CAAC,MAAM;YACxB,OAAO;YACP,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,gBAAgB;IACP,KAAK,CAAC,OAAO;QACpB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,yBAAiB,CACzB,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QAED,oEAAoE;QACpE,MAAM,gBAAgB,GAAG,IAAI,2BAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAG,EAAE,IAAI,CAAC,MAAO,EAAE;YACpF,GAAG,IAAI,CAAC,aAAa;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,IAAI,CAAC,cAAc;SACvB,CAAC,CAAC;QAEH,OAAO,MAAM,IAAA,oCAAgB,EAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACpF,CAAC;CACF;AAlHD,4CAkHC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js new file mode 100644 index 00000000..06a53d6a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js @@ -0,0 +1,419 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Db = void 0; +const admin_1 = require("./admin"); +const bson_1 = require("./bson"); +const change_stream_1 = require("./change_stream"); +const collection_1 = require("./collection"); +const CONSTANTS = require("./constants"); +const aggregation_cursor_1 = require("./cursor/aggregation_cursor"); +const list_collections_cursor_1 = require("./cursor/list_collections_cursor"); +const run_command_cursor_1 = require("./cursor/run_command_cursor"); +const error_1 = require("./error"); +const create_collection_1 = require("./operations/create_collection"); +const drop_1 = require("./operations/drop"); +const execute_operation_1 = require("./operations/execute_operation"); +const indexes_1 = require("./operations/indexes"); +const profiling_level_1 = require("./operations/profiling_level"); +const remove_user_1 = require("./operations/remove_user"); +const rename_1 = require("./operations/rename"); +const run_command_1 = require("./operations/run_command"); +const set_profiling_level_1 = require("./operations/set_profiling_level"); +const stats_1 = require("./operations/stats"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const utils_1 = require("./utils"); +const write_concern_1 = require("./write_concern"); +// Allowed parameters +const DB_OPTIONS_ALLOW_LIST = [ + 'writeConcern', + 'readPreference', + 'readPreferenceTags', + 'native_parser', + 'forceServerObjectId', + 'pkFactory', + 'serializeFunctions', + 'raw', + 'authSource', + 'ignoreUndefined', + 'readConcern', + 'retryMiliSeconds', + 'numberOfRetries', + 'useBigInt64', + 'promoteBuffers', + 'promoteLongs', + 'bsonRegExp', + 'enableUtf8Validation', + 'promoteValues', + 'compression', + 'retryWrites', + 'timeoutMS' +]; +/** + * The **Db** class is a class that represents a MongoDB Database. + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * interface Pet { + * name: string; + * kind: 'dog' | 'cat' | 'fish'; + * } + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const db = client.db(); + * + * // Create a collection that validates our union + * await db.createCollection('pets', { + * validator: { $expr: { $in: ['$kind', ['dog', 'cat', 'fish']] } } + * }) + * ``` + */ +class Db { + static { this.SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION; } + static { this.SYSTEM_INDEX_COLLECTION = CONSTANTS.SYSTEM_INDEX_COLLECTION; } + static { this.SYSTEM_PROFILE_COLLECTION = CONSTANTS.SYSTEM_PROFILE_COLLECTION; } + static { this.SYSTEM_USER_COLLECTION = CONSTANTS.SYSTEM_USER_COLLECTION; } + static { this.SYSTEM_COMMAND_COLLECTION = CONSTANTS.SYSTEM_COMMAND_COLLECTION; } + static { this.SYSTEM_JS_COLLECTION = CONSTANTS.SYSTEM_JS_COLLECTION; } + /** + * Creates a new Db instance. + * + * Db name cannot contain a dot, the server may apply more restrictions when an operation is run. + * + * @param client - The MongoClient for the database. + * @param databaseName - The name of the database this instance represents. + * @param options - Optional settings for Db construction. + */ + constructor(client, databaseName, options) { + options = options ?? {}; + // Filter the options + options = (0, utils_1.filterOptions)(options, DB_OPTIONS_ALLOW_LIST); + // Ensure there are no dots in database name + if (typeof databaseName === 'string' && databaseName.includes('.')) { + throw new error_1.MongoInvalidArgumentError(`Database names cannot contain the character '.'`); + } + // Internal state of the db object + this.s = { + // Options + options, + // Unpack read preference + readPreference: read_preference_1.ReadPreference.fromOptions(options), + // Merge bson options + bsonOptions: (0, bson_1.resolveBSONOptions)(options, client), + // Set up the primary key factory or fallback to ObjectId + pkFactory: options?.pkFactory ?? utils_1.DEFAULT_PK_FACTORY, + // ReadConcern + readConcern: read_concern_1.ReadConcern.fromOptions(options), + writeConcern: write_concern_1.WriteConcern.fromOptions(options), + // Namespace + namespace: new utils_1.MongoDBNamespace(databaseName) + }; + this.client = client; + } + get databaseName() { + return this.s.namespace.db; + } + // Options + get options() { + return this.s.options; + } + /** + * Check if a secondary can be used (because the read preference is *not* set to primary) + */ + get secondaryOk() { + return this.s.readPreference?.preference !== 'primary' || false; + } + get readConcern() { + return this.s.readConcern; + } + /** + * The current readPreference of the Db. If not explicitly defined for + * this Db, will be inherited from the parent MongoClient + */ + get readPreference() { + if (this.s.readPreference == null) { + return this.client.readPreference; + } + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + // get the write Concern + get writeConcern() { + return this.s.writeConcern; + } + get namespace() { + return this.s.namespace.toString(); + } + get timeoutMS() { + return this.s.options?.timeoutMS; + } + /** + * Create a new collection on a server with the specified options. Use this to create capped collections. + * More information about command options available at https://www.mongodb.com/docs/manual/reference/command/create/ + * + * Collection namespace validation is performed server-side. + * + * @param name - The name of the collection to create + * @param options - Optional settings for the command + */ + async createCollection(name, options) { + options = (0, utils_1.resolveOptions)(this, options); + return await (0, create_collection_1.createCollections)(this, name, options); + } + /** + * Execute a command + * + * @remarks + * This command does not inherit options from the MongoClient. + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to run + * @param options - Optional settings for the command + */ + async command(command, options) { + // Intentionally, we do not inherit options from parent for this operation. + return await (0, execute_operation_1.executeOperation)(this.client, new run_command_1.RunCommandOperation(this.s.namespace, command, (0, utils_1.resolveOptions)(undefined, { + ...(0, bson_1.resolveBSONOptions)(options), + timeoutMS: options?.timeoutMS ?? this.timeoutMS, + session: options?.session, + readPreference: options?.readPreference, + signal: options?.signal + }))); + } + /** + * Execute an aggregation framework pipeline against the database. + * + * @param pipeline - An array of aggregation stages to be executed + * @param options - Optional settings for the command + */ + aggregate(pipeline = [], options) { + return new aggregation_cursor_1.AggregationCursor(this.client, this.s.namespace, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** Return the Admin db instance */ + admin() { + return new admin_1.Admin(this); + } + /** + * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly. + * + * Collection namespace validation is performed server-side. + * + * @param name - the collection name we wish to access. + * @returns return the new Collection instance + */ + collection(name, options = {}) { + if (typeof options === 'function') { + throw new error_1.MongoInvalidArgumentError('The callback form of this helper has been removed.'); + } + return new collection_1.Collection(this, name, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Get all the db statistics. + * + * @param options - Optional settings for the command + */ + async stats(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new stats_1.DbStatsOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + listCollections(filter = {}, options = {}) { + return new list_collections_cursor_1.ListCollectionsCursor(this, filter, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Rename a collection. + * + * @remarks + * This operation does not inherit options from the MongoClient. + * + * @param fromCollection - Name of current collection to rename + * @param toCollection - New name of of the collection + * @param options - Optional settings for the command + */ + async renameCollection(fromCollection, toCollection, options) { + // Intentionally, we do not inherit options from parent for this operation. + return await (0, execute_operation_1.executeOperation)(this.client, new rename_1.RenameOperation(this.collection(fromCollection), toCollection, (0, utils_1.resolveOptions)(undefined, { + ...options, + readPreference: read_preference_1.ReadPreference.primary + }))); + } + /** + * Drop a collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param name - Name of collection to drop + * @param options - Optional settings for the command + */ + async dropCollection(name, options) { + options = (0, utils_1.resolveOptions)(this, options); + return await (0, drop_1.dropCollections)(this, name, options); + } + /** + * Drop a database, removing it permanently from the server. + * + * @param options - Optional settings for the command + */ + async dropDatabase(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new drop_1.DropDatabaseOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Fetch all collections for the current db. + * + * @param options - Optional settings for the command + */ + async collections(options) { + options = (0, utils_1.resolveOptions)(this, options); + const collections = await this.listCollections({}, { ...options, nameOnly: true }).toArray(); + return collections + .filter( + // Filter collections removing any illegal ones + ({ name }) => !name.includes('$')) + .map(({ name }) => new collection_1.Collection(this, name, this.s.options)); + } + /** + * Creates an index on the db and collection. + * + * @param name - Name of the collection to create the index on. + * @param indexSpec - Specify the field to index, or an index specification + * @param options - Optional settings for the command + */ + async createIndex(name, indexSpec, options) { + const indexes = await (0, execute_operation_1.executeOperation)(this.client, indexes_1.CreateIndexesOperation.fromIndexSpecification(this, name, indexSpec, options)); + return indexes[0]; + } + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + async removeUser(username, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new remove_user_1.RemoveUserOperation(this, username, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Set the current profiling level of MongoDB + * + * @param level - The new profiling level (off, slow_only, all). + * @param options - Optional settings for the command + */ + async setProfilingLevel(level, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new set_profiling_level_1.SetProfilingLevelOperation(this, level, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Retrieve the current profiling Level for MongoDB + * + * @param options - Optional settings for the command + */ + async profilingLevel(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new profiling_level_1.ProfilingLevelOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + async indexInformation(name, options) { + return await this.collection(name).indexInformation((0, utils_1.resolveOptions)(this, options)); + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this database. Will ignore all + * changes to system collections. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the collections within this database + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** + * A low level cursor API providing basic driver functionality: + * - ClientSession management + * - ReadPreference for server selection + * - Running getMores automatically when a local batch is exhausted + * + * @param command - The command that will start a cursor on the server. + * @param options - Configurations for running the command, bson options will apply to getMores + */ + runCursorCommand(command, options) { + return new run_command_cursor_1.RunCommandCursor(this, command, options); + } +} +exports.Db = Db; +//# sourceMappingURL=db.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js.map new file mode 100644 index 00000000..115b2f6b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/db.js.map @@ -0,0 +1 @@ +{"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,iCAAsF;AACtF,mDAAoG;AACpG,6CAAkE;AAClE,yCAAyC;AACzC,oEAAgE;AAChE,8EAAyE;AACzE,oEAA6F;AAC7F,mCAAoD;AAIpD,sEAAiG;AACjG,4CAK2B;AAC3B,sEAAkE;AAClE,kDAO8B;AAE9B,kEAAmG;AACnG,0DAAuF;AACvF,gDAA0E;AAC1E,0DAAuF;AACvF,0EAI0C;AAC1C,8CAA2E;AAC3E,iDAA6C;AAC7C,uDAA4E;AAC5E,mCAA8F;AAC9F,mDAAyE;AAEzE,qBAAqB;AACrB,MAAM,qBAAqB,GAAG;IAC5B,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,eAAe;IACf,qBAAqB;IACrB,WAAW;IACX,oBAAoB;IACpB,KAAK;IACL,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,kBAAkB;IAClB,iBAAiB;IACjB,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,YAAY;IACZ,sBAAsB;IACtB,eAAe;IACf,aAAa;IACb,aAAa;IACb,WAAW;CACZ,CAAC;AAkCF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,EAAE;aAUC,gCAA2B,GAAG,SAAS,CAAC,2BAA2B,CAAC;aACpE,4BAAuB,GAAG,SAAS,CAAC,uBAAuB,CAAC;aAC5D,8BAAyB,GAAG,SAAS,CAAC,yBAAyB,CAAC;aAChE,2BAAsB,GAAG,SAAS,CAAC,sBAAsB,CAAC;aAC1D,8BAAyB,GAAG,SAAS,CAAC,yBAAyB,CAAC;aAChE,yBAAoB,GAAG,SAAS,CAAC,oBAAoB,CAAC;IAEpE;;;;;;;;OAQG;IACH,YAAY,MAAmB,EAAE,YAAoB,EAAE,OAAmB;QACxE,OAAO,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;OAkEG;IACH,KAAK,CAGH,WAAuB,EAAE,EAAE,UAA+B,EAAE;QAC5D,6CAA6C;QAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,QAAQ,CAAC;YACnB,QAAQ,GAAG,EAAE,CAAC;QAChB,CAAC;QAED,OAAO,IAAI,4BAAY,CAAmB,IAAI,EAAE,QAAQ,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;OAQG;IACH,gBAAgB,CAAC,OAAiB,EAAE,OAAiC;QACnE,OAAO,IAAI,qCAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;;AA/eH,gBAgfC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js new file mode 100644 index 00000000..61fad657 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js @@ -0,0 +1,112 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getKerberos = getKerberos; +exports.getZstdLibrary = getZstdLibrary; +exports.getAwsCredentialProvider = getAwsCredentialProvider; +exports.getGcpMetadata = getGcpMetadata; +exports.getSnappy = getSnappy; +exports.getSocks = getSocks; +exports.getMongoDBClientEncryption = getMongoDBClientEncryption; +const error_1 = require("./error"); +function makeErrorModule(error) { + const props = error ? { kModuleError: error } : {}; + return new Proxy(props, { + get: (_, key) => { + if (key === 'kModuleError') { + return error; + } + throw error; + }, + set: () => { + throw error; + } + }); +} +function getKerberos() { + let kerberos; + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + kerberos = require('kerberos'); + } + catch (error) { + kerberos = makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `kerberos` not found. Please install it to enable kerberos authentication', { cause: error, dependencyName: 'kerberos' })); + } + return kerberos; +} +function getZstdLibrary() { + let ZStandard; + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + ZStandard = require('@mongodb-js/zstd'); + } + catch (error) { + ZStandard = makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression', { cause: error, dependencyName: 'zstd' })); + } + return ZStandard; +} +function getAwsCredentialProvider() { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const credentialProvider = require('@aws-sdk/credential-providers'); + return credentialProvider; + } + catch (error) { + return makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `@aws-sdk/credential-providers` not found.' + + ' Please install it to enable getting aws credentials via the official sdk.', { cause: error, dependencyName: '@aws-sdk/credential-providers' })); + } +} +function getGcpMetadata() { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const credentialProvider = require('gcp-metadata'); + return credentialProvider; + } + catch (error) { + return makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `gcp-metadata` not found.' + + ' Please install it to enable getting gcp credentials via the official sdk.', { cause: error, dependencyName: 'gcp-metadata' })); + } +} +function getSnappy() { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const value = require('snappy'); + return value; + } + catch (error) { + const kModuleError = new error_1.MongoMissingDependencyError('Optional module `snappy` not found. Please install it to enable snappy compression', { cause: error, dependencyName: 'snappy' }); + return { kModuleError }; + } +} +function getSocks() { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const value = require('socks'); + return value; + } + catch (error) { + const kModuleError = new error_1.MongoMissingDependencyError('Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy', { cause: error, dependencyName: 'socks' }); + return { kModuleError }; + } +} +/** A utility function to get the instance of mongodb-client-encryption, if it exists. */ +function getMongoDBClientEncryption() { + let mongodbClientEncryption = null; + try { + // NOTE(NODE-3199): Ensure you always wrap an optional require literally in the try block + // Cannot be moved to helper utility function, bundlers search and replace the actual require call + // in a way that makes this line throw at bundle time, not runtime, catching here will make bundling succeed + // eslint-disable-next-line @typescript-eslint/no-require-imports + mongodbClientEncryption = require('mongodb-client-encryption'); + } + catch (error) { + const kModuleError = new error_1.MongoMissingDependencyError('Optional module `mongodb-client-encryption` not found. Please install it to use auto encryption or ClientEncryption.', { cause: error, dependencyName: 'mongodb-client-encryption' }); + return { kModuleError }; + } + return mongodbClientEncryption; +} +//# sourceMappingURL=deps.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js.map new file mode 100644 index 00000000..d8a5fc75 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/deps.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":";;AAqBA,kCAeC;AA0BD,wCAeC;AAsBD,4DAiBC;AAOD,wCAeC;AAiBD,8BAaC;AAsBD,4BAaC;AAGD,gEAoBC;AAjOD,mCAAsD;AAGtD,SAAS,eAAe,CAAC,KAAU;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnD,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE;QACtB,GAAG,EAAE,CAAC,CAAM,EAAE,GAAQ,EAAE,EAAE;YACxB,IAAI,GAAG,KAAK,cAAc,EAAE,CAAC;gBAC3B,OAAO,KAAK,CAAC;YACf,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,G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AAC,2BAA2B,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,IAAI,mCAA2B,CAClD,sHAAsH,EACtH,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,2BAA2B,EAAE,CAC9D,CAAC;QACF,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js new file mode 100644 index 00000000..132b669b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js @@ -0,0 +1,106 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Encrypter = void 0; +const auto_encrypter_1 = require("./client-side-encryption/auto_encrypter"); +const constants_1 = require("./constants"); +const deps_1 = require("./deps"); +const error_1 = require("./error"); +const mongo_client_1 = require("./mongo_client"); +/** @internal */ +class Encrypter { + constructor(client, uri, options) { + if (typeof options.autoEncryption !== 'object') { + throw new error_1.MongoInvalidArgumentError('Option "autoEncryption" must be specified'); + } + // initialize to null, if we call getInternalClient, we may set this it is important to not overwrite those function calls. + this.internalClient = null; + this.bypassAutoEncryption = !!options.autoEncryption.bypassAutoEncryption; + this.needsConnecting = false; + if (options.maxPoolSize === 0 && options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = client; + } + else if (options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = this.getInternalClient(client, uri, options); + } + if (this.bypassAutoEncryption) { + options.autoEncryption.metadataClient = undefined; + } + else if (options.maxPoolSize === 0) { + options.autoEncryption.metadataClient = client; + } + else { + options.autoEncryption.metadataClient = this.getInternalClient(client, uri, options); + } + if (options.proxyHost) { + options.autoEncryption.proxyOptions = { + proxyHost: options.proxyHost, + proxyPort: options.proxyPort, + proxyUsername: options.proxyUsername, + proxyPassword: options.proxyPassword + }; + } + this.autoEncrypter = new auto_encrypter_1.AutoEncrypter(client, options.autoEncryption); + } + getInternalClient(client, uri, options) { + let internalClient = this.internalClient; + if (internalClient == null) { + const clonedOptions = {}; + for (const key of [ + ...Object.getOwnPropertyNames(options), + ...Object.getOwnPropertySymbols(options) + ]) { + if (['autoEncryption', 'minPoolSize', 'servers', 'caseTranslate', 'dbName'].includes(key)) + continue; + Reflect.set(clonedOptions, key, Reflect.get(options, key)); + } + clonedOptions.minPoolSize = 0; + internalClient = new mongo_client_1.MongoClient(uri, clonedOptions); + this.internalClient = internalClient; + for (const eventName of constants_1.MONGO_CLIENT_EVENTS) { + for (const listener of client.listeners(eventName)) { + internalClient.on(eventName, listener); + } + } + client.on('newListener', (eventName, listener) => { + internalClient?.on(eventName, listener); + }); + this.needsConnecting = true; + } + return internalClient; + } + async connectInternalClient() { + const internalClient = this.internalClient; + if (this.needsConnecting && internalClient != null) { + this.needsConnecting = false; + await internalClient.connect(); + } + } + async close(client) { + let error; + try { + await this.autoEncrypter.close(); + } + catch (autoEncrypterError) { + error = autoEncrypterError; + } + const internalClient = this.internalClient; + if (internalClient != null && client !== internalClient) { + return await internalClient.close(); + } + if (error != null) { + throw error; + } + } + static checkForMongoCrypt() { + const mongodbClientEncryption = (0, deps_1.getMongoDBClientEncryption)(); + if ('kModuleError' in mongodbClientEncryption) { + throw new error_1.MongoMissingDependencyError('Auto-encryption requested, but the module is not installed. ' + + 'Please add `mongodb-client-encryption` as a dependency of your project', { + cause: mongodbClientEncryption['kModuleError'], + dependencyName: 'mongodb-client-encryption' + }); + } + } +} +exports.Encrypter = Encrypter; +//# sourceMappingURL=encrypter.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js.map new file mode 100644 index 00000000..b80f9d62 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/encrypter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"encrypter.js","sourceRoot":"","sources":["../src/encrypter.ts"],"names":[],"mappings":";;;AAAA,4EAAoG;AACpG,2CAAkD;AAClD,iCAAoD;AACpD,mCAAiF;AACjF,iDAAsE;AAQtE,gBAAgB;AAChB,MAAa,SAAS;IAMpB,YAAY,MAAmB,EAAE,GAAW,EAAE,OAA2B;QACvE,IAAI,OAAO,OAAO,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC/C,MAAM,IAAI,iCAAyB,CAAC,2CAA2C,CAAC,CAAC;QACnF,CAAC;QACD,2HAA2H;QAC3H,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAE3B,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC;QAC1E,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAE7B,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,IAAI,OAAO,CAAC,cAAc,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC;YAC/E,OAAO,CAAC,cAAc,CAAC,cAAc,GAAG,MAAM,CAAC;QACjD,CAAC;aAAM,IAAI,OAAO,CAAC,cAAc,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC;YACzD,OAAO,CAAC,cAAc,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACvF,CAAC;QAED,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,OAAO,CAAC,cAAc,CAAC,cAAc,GAAG,SAAS,CAAC;QACpD,CAAC;aAAM,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO,CAAC,cAAc,CAAC,cAAc,GAAG,MAAM,CAAC;QACjD,CAAC;aAAM,C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ACvB,MAAM,uBAAuB,GAAG,IAAA,iCAA0B,GAAE,CAAC;QAC7D,IAAI,cAAc,IAAI,uBAAuB,EAAE,CAAC;YAC9C,MAAM,IAAI,mCAA2B,CACnC,8DAA8D;gBAC5D,wEAAwE,EAC1E;gBACE,KAAK,EAAE,uBAAuB,CAAC,cAAc,CAAC;gBAC9C,cAAc,EAAE,2BAA2B;aAC5C,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAjHD,8BAiHC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js new file mode 100644 index 00000000..6749769a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js @@ -0,0 +1,1376 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoWriteConcernError = exports.MongoServerSelectionError = exports.MongoSystemError = exports.MongoMissingDependencyError = exports.MongoMissingCredentialsError = exports.MongoCompatibilityError = exports.MongoInvalidArgumentError = exports.MongoParseError = exports.MongoNetworkTimeoutError = exports.MongoNetworkError = exports.MongoClientClosedError = exports.MongoTopologyClosedError = exports.MongoCursorExhaustedError = exports.MongoServerClosedError = exports.MongoCursorInUseError = exports.MongoOperationTimeoutError = exports.MongoUnexpectedServerResponseError = exports.MongoGridFSChunkError = exports.MongoGridFSStreamError = exports.MongoTailableCursorError = exports.MongoChangeStreamError = exports.MongoClientBulkWriteExecutionError = exports.MongoClientBulkWriteCursorError = exports.MongoClientBulkWriteError = exports.MongoGCPError = exports.MongoAzureError = exports.MongoOIDCError = exports.MongoAWSError = exports.MongoKerberosError = exports.MongoExpiredSessionError = exports.MongoTransactionError = exports.MongoNotConnectedError = exports.MongoDecompressionError = exports.MongoBatchReExecutionError = exports.MongoStalePrimaryError = exports.MongoRuntimeError = exports.MongoAPIError = exports.MongoDriverError = exports.MongoServerError = exports.MongoError = exports.MongoErrorLabel = exports.GET_MORE_RESUMABLE_CODES = exports.MONGODB_ERROR_CODES = exports.NODE_IS_RECOVERING_ERROR_MESSAGE = exports.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = void 0; +exports.needsRetryableWriteLabel = needsRetryableWriteLabel; +exports.isRetryableWriteError = isRetryableWriteError; +exports.isRetryableReadError = isRetryableReadError; +exports.isNodeShuttingDownError = isNodeShuttingDownError; +exports.isStateChangeError = isStateChangeError; +exports.isNetworkTimeoutError = isNetworkTimeoutError; +exports.isResumableError = isResumableError; +/** + * @internal + * The legacy error message from the server that indicates the node is not a writable primary + * https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = new RegExp('not master', 'i'); +/** + * @internal + * The legacy error message from the server that indicates the node is not a primary or secondary + * https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +exports.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = new RegExp('not master or secondary', 'i'); +/** + * @internal + * The error message from the server that indicates the node is recovering + * https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +exports.NODE_IS_RECOVERING_ERROR_MESSAGE = new RegExp('node is recovering', 'i'); +/** @internal MongoDB Error Codes */ +exports.MONGODB_ERROR_CODES = Object.freeze({ + HostUnreachable: 6, + HostNotFound: 7, + AuthenticationFailed: 18, + NetworkTimeout: 89, + ShutdownInProgress: 91, + PrimarySteppedDown: 189, + ExceededTimeLimit: 262, + SocketException: 9001, + NotWritablePrimary: 10107, + InterruptedAtShutdown: 11600, + InterruptedDueToReplStateChange: 11602, + NotPrimaryNoSecondaryOk: 13435, + NotPrimaryOrSecondary: 13436, + StaleShardVersion: 63, + StaleEpoch: 150, + StaleConfig: 13388, + RetryChangeStream: 234, + FailedToSatisfyReadPreference: 133, + CursorNotFound: 43, + LegacyNotPrimary: 10058, + // WriteConcernTimeout is WriteConcernFailed on pre-8.1 servers + WriteConcernTimeout: 64, + NamespaceNotFound: 26, + IllegalOperation: 20, + MaxTimeMSExpired: 50, + UnknownReplWriteConcern: 79, + UnsatisfiableWriteConcern: 100, + Reauthenticate: 391, + ReadConcernMajorityNotAvailableYet: 134 +}); +// From spec https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/change-streams/change-streams.md#resumable-error +exports.GET_MORE_RESUMABLE_CODES = new Set([ + exports.MONGODB_ERROR_CODES.HostUnreachable, + exports.MONGODB_ERROR_CODES.HostNotFound, + exports.MONGODB_ERROR_CODES.NetworkTimeout, + exports.MONGODB_ERROR_CODES.ShutdownInProgress, + exports.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports.MONGODB_ERROR_CODES.ExceededTimeLimit, + exports.MONGODB_ERROR_CODES.SocketException, + exports.MONGODB_ERROR_CODES.NotWritablePrimary, + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports.MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + exports.MONGODB_ERROR_CODES.StaleShardVersion, + exports.MONGODB_ERROR_CODES.StaleEpoch, + exports.MONGODB_ERROR_CODES.StaleConfig, + exports.MONGODB_ERROR_CODES.RetryChangeStream, + exports.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference, + exports.MONGODB_ERROR_CODES.CursorNotFound +]); +/** @public */ +exports.MongoErrorLabel = Object.freeze({ + RetryableWriteError: 'RetryableWriteError', + TransientTransactionError: 'TransientTransactionError', + UnknownTransactionCommitResult: 'UnknownTransactionCommitResult', + ResumableChangeStreamError: 'ResumableChangeStreamError', + HandshakeError: 'HandshakeError', + ResetPool: 'ResetPool', + PoolRequestedRetry: 'PoolRequestedRetry', + InterruptInUseConnections: 'InterruptInUseConnections', + NoWritesPerformed: 'NoWritesPerformed', + RetryableError: 'RetryableError', + SystemOverloadedError: 'SystemOverloadedError' +}); +function isAggregateError(e) { + return e != null && typeof e === 'object' && 'errors' in e && Array.isArray(e.errors); +} +/** + * @public + * @category Error + * + * @privateRemarks + * mongodb-client-encryption has a dependency on this error, it uses the constructor with a string argument + */ +class MongoError extends Error { + get errorLabels() { + return Array.from(this.errorLabelSet); + } + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + /** @internal */ + this.errorLabelSet = new Set(); + } + /** @internal */ + static buildErrorMessage(e) { + if (typeof e === 'string') { + return e; + } + if (isAggregateError(e) && e.message.length === 0) { + return e.errors.length === 0 + ? 'AggregateError has an empty errors array. Please check the `cause` property for more information.' + : e.errors.map(({ message }) => message).join(', '); + } + return e != null && typeof e === 'object' && 'message' in e && typeof e.message === 'string' + ? e.message + : 'empty error message'; + } + get name() { + return 'MongoError'; + } + /** Legacy name for server error responses */ + get errmsg() { + return this.message; + } + /** + * Checks the error to see if it has an error label + * + * @param label - The error label to check for + * @returns returns true if the error has the provided error label + */ + hasErrorLabel(label) { + return this.errorLabelSet.has(label); + } + addErrorLabel(label) { + this.errorLabelSet.add(label); + } +} +exports.MongoError = MongoError; +/** + * An error coming from the mongo server + * + * @public + * @category Error + */ +class MongoServerError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message.message || message.errmsg || message.$err || 'n/a'); + if (message.errorLabels) { + for (const label of message.errorLabels) + this.addErrorLabel(label); + } + this.errorResponse = message; + for (const name in message) { + if (name !== 'errorLabels' && + name !== 'errmsg' && + name !== 'message' && + name !== 'errorResponse') { + this[name] = message[name]; + } + } + } + get name() { + return 'MongoServerError'; + } +} +exports.MongoServerError = MongoServerError; +/** + * An error generated by the driver + * + * @public + * @category Error + */ +class MongoDriverError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoDriverError'; + } +} +exports.MongoDriverError = MongoDriverError; +/** + * An error generated when the driver API is used incorrectly + * + * @privateRemarks + * Should **never** be directly instantiated + * + * @public + * @category Error + */ +class MongoAPIError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoAPIError'; + } +} +exports.MongoAPIError = MongoAPIError; +/** + * An error generated when the driver encounters unexpected input + * or reaches an unexpected/invalid internal state. + * + * @privateRemarks + * Should **never** be directly instantiated. + * + * @public + * @category Error + */ +class MongoRuntimeError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoRuntimeError'; + } +} +exports.MongoRuntimeError = MongoRuntimeError; +/** + * An error generated when a primary server is marked stale, never directly thrown + * + * @public + * @category Error + */ +class MongoStalePrimaryError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoStalePrimaryError'; + } +} +exports.MongoStalePrimaryError = MongoStalePrimaryError; +/** + * An error generated when a batch command is re-executed after one of the commands in the batch + * has failed + * + * @public + * @category Error + */ +class MongoBatchReExecutionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'This batch has already been executed, create new batch to execute') { + super(message); + } + get name() { + return 'MongoBatchReExecutionError'; + } +} +exports.MongoBatchReExecutionError = MongoBatchReExecutionError; +/** + * An error generated when the driver fails to decompress + * data received from the server. + * + * @public + * @category Error + */ +class MongoDecompressionError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoDecompressionError'; + } +} +exports.MongoDecompressionError = MongoDecompressionError; +/** + * An error thrown when the user attempts to operate on a database or collection through a MongoClient + * that has not yet successfully called the "connect" method + * + * @public + * @category Error + */ +class MongoNotConnectedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoNotConnectedError'; + } +} +exports.MongoNotConnectedError = MongoNotConnectedError; +/** + * An error generated when the user makes a mistake in the usage of transactions. + * (e.g. attempting to commit a transaction with a readPreference other than primary) + * + * @public + * @category Error + */ +class MongoTransactionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoTransactionError'; + } +} +exports.MongoTransactionError = MongoTransactionError; +/** + * An error generated when the user attempts to operate + * on a session that has expired or has been closed. + * + * @public + * @category Error + */ +class MongoExpiredSessionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Cannot use a session that has ended') { + super(message); + } + get name() { + return 'MongoExpiredSessionError'; + } +} +exports.MongoExpiredSessionError = MongoExpiredSessionError; +/** + * A error generated when the user attempts to authenticate + * via Kerberos, but fails to connect to the Kerberos client. + * + * @public + * @category Error + */ +class MongoKerberosError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoKerberosError'; + } +} +exports.MongoKerberosError = MongoKerberosError; +/** + * A error generated when the user attempts to authenticate + * via AWS, but fails + * + * @public + * @category Error + */ +class MongoAWSError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoAWSError'; + } +} +exports.MongoAWSError = MongoAWSError; +/** + * A error generated when the user attempts to authenticate + * via OIDC callbacks, but fails. + * + * @public + * @category Error + */ +class MongoOIDCError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoOIDCError'; + } +} +exports.MongoOIDCError = MongoOIDCError; +/** + * A error generated when the user attempts to authenticate + * via Azure, but fails. + * + * @public + * @category Error + */ +class MongoAzureError extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoAzureError'; + } +} +exports.MongoAzureError = MongoAzureError; +/** + * A error generated when the user attempts to authenticate + * via GCP, but fails. + * + * @public + * @category Error + */ +class MongoGCPError extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoGCPError'; + } +} +exports.MongoGCPError = MongoGCPError; +/** + * An error indicating that an error occurred when executing the bulk write. + * + * @public + * @category Error + */ +class MongoClientBulkWriteError extends MongoServerError { + /** + * Initialize the client bulk write error. + * @param message - The error message. + */ + constructor(message) { + super(message); + this.writeConcernErrors = []; + this.writeErrors = new Map(); + } + get name() { + return 'MongoClientBulkWriteError'; + } +} +exports.MongoClientBulkWriteError = MongoClientBulkWriteError; +/** + * An error indicating that an error occurred when processing bulk write results. + * + * @public + * @category Error + */ +class MongoClientBulkWriteCursorError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoClientBulkWriteCursorError'; + } +} +exports.MongoClientBulkWriteCursorError = MongoClientBulkWriteCursorError; +/** + * An error indicating that an error occurred on the client when executing a client bulk write. + * + * @public + * @category Error + */ +class MongoClientBulkWriteExecutionError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoClientBulkWriteExecutionError'; + } +} +exports.MongoClientBulkWriteExecutionError = MongoClientBulkWriteExecutionError; +/** + * An error generated when a ChangeStream operation fails to execute. + * + * @public + * @category Error + */ +class MongoChangeStreamError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoChangeStreamError'; + } +} +exports.MongoChangeStreamError = MongoChangeStreamError; +/** + * An error thrown when the user calls a function or method not supported on a tailable cursor + * + * @public + * @category Error + */ +class MongoTailableCursorError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Tailable cursor does not support this operation') { + super(message); + } + get name() { + return 'MongoTailableCursorError'; + } +} +exports.MongoTailableCursorError = MongoTailableCursorError; +/** An error generated when a GridFSStream operation fails to execute. + * + * @public + * @category Error + */ +class MongoGridFSStreamError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoGridFSStreamError'; + } +} +exports.MongoGridFSStreamError = MongoGridFSStreamError; +/** + * An error generated when a malformed or invalid chunk is + * encountered when reading from a GridFSStream. + * + * @public + * @category Error + */ +class MongoGridFSChunkError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoGridFSChunkError'; + } +} +exports.MongoGridFSChunkError = MongoGridFSChunkError; +/** + * An error generated when a **parsable** unexpected response comes from the server. + * This is generally an error where the driver in a state expecting a certain behavior to occur in + * the next message from MongoDB but it receives something else. + * This error **does not** represent an issue with wire message formatting. + * + * #### Example + * When an operation fails, it is the driver's job to retry it. It must perform serverSelection + * again to make sure that it attempts the operation against a server in a good state. If server + * selection returns a server that does not support retryable operations, this error is used. + * This scenario is unlikely as retryable support would also have been determined on the first attempt + * but it is possible the state change could report a selectable server that does not support retries. + * + * @public + * @category Error + */ +class MongoUnexpectedServerResponseError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoUnexpectedServerResponseError'; + } +} +exports.MongoUnexpectedServerResponseError = MongoUnexpectedServerResponseError; +/** + * @public + * @category Error + * + * The `MongoOperationTimeoutError` class represents an error that occurs when an operation could not be completed within the specified `timeoutMS`. + * It is generated by the driver in support of the "client side operation timeout" feature so inherits from `MongoDriverError`. + * When `timeoutMS` is enabled `MongoServerError`s relating to `MaxTimeExpired` errors will be converted to `MongoOperationTimeoutError` + * + * @example + * ```ts + * try { + * await blogs.insertOne(blogPost, { timeoutMS: 60_000 }) + * } catch (error) { + * if (error instanceof MongoOperationTimeoutError) { + * console.log(`Oh no! writer's block!`, error); + * } + * } + * ``` + */ +class MongoOperationTimeoutError extends MongoDriverError { + get name() { + return 'MongoOperationTimeoutError'; + } +} +exports.MongoOperationTimeoutError = MongoOperationTimeoutError; +/** + * An error thrown when the user attempts to add options to a cursor that has already been + * initialized + * + * @public + * @category Error + */ +class MongoCursorInUseError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Cursor is already initialized') { + super(message); + } + get name() { + return 'MongoCursorInUseError'; + } +} +exports.MongoCursorInUseError = MongoCursorInUseError; +/** + * An error generated when an attempt is made to operate + * on a closed/closing server. + * + * @public + * @category Error + */ +class MongoServerClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Server is closed') { + super(message); + } + get name() { + return 'MongoServerClosedError'; + } +} +exports.MongoServerClosedError = MongoServerClosedError; +/** + * An error thrown when an attempt is made to read from a cursor that has been exhausted + * + * @public + * @category Error + */ +class MongoCursorExhaustedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message || 'Cursor is exhausted'); + } + get name() { + return 'MongoCursorExhaustedError'; + } +} +exports.MongoCursorExhaustedError = MongoCursorExhaustedError; +/** + * An error generated when an attempt is made to operate on a + * dropped, or otherwise unavailable, database. + * + * @public + * @category Error + */ +class MongoTopologyClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Topology is closed') { + super(message); + } + get name() { + return 'MongoTopologyClosedError'; + } +} +exports.MongoTopologyClosedError = MongoTopologyClosedError; +/** + * An error generated when the MongoClient is closed and async + * operations are interrupted. + * + * @public + * @category Error + */ +class MongoClientClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor() { + super('Operation interrupted because client was closed'); + } + get name() { + return 'MongoClientClosedError'; + } +} +exports.MongoClientClosedError = MongoClientClosedError; +/** + * An error indicating an issue with the network, including TCP errors and timeouts. + * @public + * @category Error + */ +class MongoNetworkError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, { cause: options?.cause }); + this.beforeHandshake = !!options?.beforeHandshake; + } + get name() { + return 'MongoNetworkError'; + } +} +exports.MongoNetworkError = MongoNetworkError; +/** + * An error indicating a network timeout occurred + * @public + * @category Error + * + * @privateRemarks + * mongodb-client-encryption has a dependency on this error with an instanceof check + */ +class MongoNetworkTimeoutError extends MongoNetworkError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoNetworkTimeoutError'; + } +} +exports.MongoNetworkTimeoutError = MongoNetworkTimeoutError; +/** + * An error used when attempting to parse a value (like a connection string) + * @public + * @category Error + */ +class MongoParseError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoParseError'; + } +} +exports.MongoParseError = MongoParseError; +/** + * An error generated when the user supplies malformed or unexpected arguments + * or when a required argument or field is not provided. + * + * + * @public + * @category Error + */ +class MongoInvalidArgumentError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoInvalidArgumentError'; + } +} +exports.MongoInvalidArgumentError = MongoInvalidArgumentError; +/** + * An error generated when a feature that is not enabled or allowed for the current server + * configuration is used + * + * + * @public + * @category Error + */ +class MongoCompatibilityError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoCompatibilityError'; + } +} +exports.MongoCompatibilityError = MongoCompatibilityError; +/** + * An error generated when the user fails to provide authentication credentials before attempting + * to connect to a mongo server instance. + * + * + * @public + * @category Error + */ +class MongoMissingCredentialsError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message) { + super(message); + } + get name() { + return 'MongoMissingCredentialsError'; + } +} +exports.MongoMissingCredentialsError = MongoMissingCredentialsError; +/** + * An error generated when a required module or dependency is not present in the local environment + * + * @public + * @category Error + */ +class MongoMissingDependencyError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, options) { + super(message, options); + this.dependencyName = options.dependencyName; + } + get name() { + return 'MongoMissingDependencyError'; + } +} +exports.MongoMissingDependencyError = MongoMissingDependencyError; +/** + * An error signifying a general system issue + * @public + * @category Error + */ +class MongoSystemError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, reason) { + if (reason && reason.error) { + super(MongoError.buildErrorMessage(reason.error.message || reason.error), { + cause: reason.error + }); + } + else { + super(message); + } + if (reason) { + this.reason = reason; + } + this.code = reason.error?.code; + } + get name() { + return 'MongoSystemError'; + } +} +exports.MongoSystemError = MongoSystemError; +/** + * An error signifying a client-side server selection error + * @public + * @category Error + */ +class MongoServerSelectionError extends MongoSystemError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message, reason) { + super(message, reason); + } + get name() { + return 'MongoServerSelectionError'; + } +} +exports.MongoServerSelectionError = MongoServerSelectionError; +/** + * An error thrown when the server reports a writeConcernError + * @public + * @category Error + */ +class MongoWriteConcernError extends MongoServerError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(result) { + super({ ...result.writeConcernError, ...result }); + this.errInfo = result.writeConcernError.errInfo; + this.result = result; + } + get name() { + return 'MongoWriteConcernError'; + } +} +exports.MongoWriteConcernError = MongoWriteConcernError; +// https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.md#retryable-error +const RETRYABLE_READ_ERROR_CODES = new Set([ + exports.MONGODB_ERROR_CODES.HostUnreachable, + exports.MONGODB_ERROR_CODES.HostNotFound, + exports.MONGODB_ERROR_CODES.NetworkTimeout, + exports.MONGODB_ERROR_CODES.ShutdownInProgress, + exports.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports.MONGODB_ERROR_CODES.SocketException, + exports.MONGODB_ERROR_CODES.NotWritablePrimary, + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports.MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + exports.MONGODB_ERROR_CODES.ExceededTimeLimit, + exports.MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet +]); +// see: https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.md#terms +const RETRYABLE_WRITE_ERROR_CODES = RETRYABLE_READ_ERROR_CODES; +function needsRetryableWriteLabel(error) { + if (error instanceof MongoNetworkError) { + return true; + } + if (error instanceof MongoError) { + if (!error.hasErrorLabel(exports.MongoErrorLabel.HandshakeError)) { + // If we already have the error label no need to add it again. servers add the label. + // In the case where we have a handshake error, need to fall down to the logic checking + // the codes. + return false; + } + } + if (error instanceof MongoWriteConcernError) { + const code = error.result.writeConcernError.code ?? Number(error.code); + return RETRYABLE_WRITE_ERROR_CODES.has(Number.isNaN(code) ? 0 : code); + } + if (error instanceof MongoError) { + return RETRYABLE_WRITE_ERROR_CODES.has(Number(error.code)); + } + const isNotWritablePrimaryError = exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + const isNodeIsRecoveringError = exports.NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + return false; +} +function isRetryableWriteError(error) { + return (error.hasErrorLabel(exports.MongoErrorLabel.RetryableWriteError) || + error.hasErrorLabel(exports.MongoErrorLabel.PoolRequestedRetry)); +} +/** Determines whether an error is something the driver should attempt to retry */ +function isRetryableReadError(error) { + const hasRetryableErrorCode = typeof error.code === 'number' ? RETRYABLE_READ_ERROR_CODES.has(error.code) : false; + if (hasRetryableErrorCode) { + return true; + } + if (error instanceof MongoNetworkError) { + return true; + } + const isNotWritablePrimaryError = exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + const isNodeIsRecoveringError = exports.NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + return false; +} +const SDAM_RECOVERING_CODES = new Set([ + exports.MONGODB_ERROR_CODES.ShutdownInProgress, + exports.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports.MONGODB_ERROR_CODES.NotPrimaryOrSecondary +]); +const SDAM_NOT_PRIMARY_CODES = new Set([ + exports.MONGODB_ERROR_CODES.NotWritablePrimary, + exports.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports.MONGODB_ERROR_CODES.LegacyNotPrimary +]); +const SDAM_NODE_SHUTTING_DOWN_ERROR_CODES = new Set([ + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.ShutdownInProgress +]); +function isRecoveringError(err) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_RECOVERING_CODES.has(err.code); + } + return (exports.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(err.message) || + exports.NODE_IS_RECOVERING_ERROR_MESSAGE.test(err.message)); +} +function isNotWritablePrimaryError(err) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_NOT_PRIMARY_CODES.has(err.code); + } + if (isRecoveringError(err)) { + return false; + } + return exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(err.message); +} +function isNodeShuttingDownError(err) { + return !!(typeof err.code === 'number' && SDAM_NODE_SHUTTING_DOWN_ERROR_CODES.has(err.code)); +} +/** + * Determines whether SDAM can recover from a given error. If it cannot + * then the pool will be cleared, and server state will completely reset + * locally. + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +function isStateChangeError(error) { + return isRecoveringError(error) || isNotWritablePrimaryError(error); +} +function isNetworkTimeoutError(err) { + return !!(err instanceof MongoNetworkError && err.message.match(/timed out/)); +} +function isResumableError(error, wireVersion) { + if (error == null || !(error instanceof MongoError)) { + return false; + } + if (error instanceof MongoNetworkError) { + return true; + } + if (error instanceof MongoServerSelectionError) { + return true; + } + // wireVersion of 0 is possible when the server version is unknown (e.g heartbeat failure), so despite + // all supported servers being wire version 9+, the >= 9 bound must stay to route "unknown" to the + // code-list fallback below to maintain parity. + if (wireVersion != null && wireVersion >= 9) { + // DRIVERS-1308: Drivers will add a special case to treat the CursorNotFound error code as resumable + if (error.code === exports.MONGODB_ERROR_CODES.CursorNotFound) { + return true; + } + return error.hasErrorLabel(exports.MongoErrorLabel.ResumableChangeStreamError); + } + if (typeof error.code === 'number') { + return exports.GET_MORE_RESUMABLE_CODES.has(error.code); + } + return false; +} +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js.map new file mode 100644 index 00000000..acddb446 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAm3CA,4DAiCC;AAED,sDAKC;AAGD,oDAsBC;AA8CD,0DAEC;AASD,gDAEC;AAED,sDAEC;AAED,4CA6BC;AAvgDD;;;;GAIG;AACU,QAAA,yCAAyC,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAEvF;;;;GAIG;AACU,QAAA,6CAA6C,GAAG,IAAI,MAAM,CACrE,yBAAyB,EACzB,GAAG,CACJ,CAAC;AAEF;;;;GAIG;AACU,QAAA,gCAAgC,GAAG,IAAI,MAAM,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;AAEtF,oCAAoC;AACvB,QAAA,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;IACf,oBAAoB,EAAE,EAAE;IACxB,cAAc,EAAE,EAAE;IAClB,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,GAAG;IACvB,iBAAiB,EAAE,GAAG;IACtB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,KAAK;IACzB,qBAAqB,EAAE,KAAK;IAC5B,+B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IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,KAAK,YAAY,yBAAyB,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sGAAsG;IACtG,kGAAkG;IAClG,+CAA+C;IAC/C,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;QAC5C,oGAAoG;QACpG,IAAI,KAAK,CAAC,IAAI,KAAK,2BAAmB,CAAC,cAAc,EAAE,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC,aAAa,CAAC,uBAAe,CAAC,0BAA0B,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,gCAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js new file mode 100644 index 00000000..e9a6dbdb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Explain = exports.ExplainVerbosity = void 0; +exports.validateExplainTimeoutOptions = validateExplainTimeoutOptions; +exports.decorateWithExplain = decorateWithExplain; +const error_1 = require("./error"); +/** @public */ +exports.ExplainVerbosity = Object.freeze({ + queryPlanner: 'queryPlanner', + queryPlannerExtended: 'queryPlannerExtended', + executionStats: 'executionStats', + allPlansExecution: 'allPlansExecution' +}); +/** @internal */ +class Explain { + constructor(verbosity, maxTimeMS) { + if (typeof verbosity === 'boolean') { + this.verbosity = verbosity + ? exports.ExplainVerbosity.allPlansExecution + : exports.ExplainVerbosity.queryPlanner; + } + else { + this.verbosity = verbosity; + } + this.maxTimeMS = maxTimeMS; + } + static fromOptions({ explain } = {}) { + if (explain == null) + return; + if (typeof explain === 'boolean' || typeof explain === 'string') { + return new Explain(explain); + } + const { verbosity, maxTimeMS } = explain; + return new Explain(verbosity, maxTimeMS); + } +} +exports.Explain = Explain; +function validateExplainTimeoutOptions(options, explain) { + const { maxTimeMS, timeoutMS } = options; + if (timeoutMS != null && (maxTimeMS != null || explain?.maxTimeMS != null)) { + throw new error_1.MongoAPIError('Cannot use maxTimeMS with timeoutMS for explain commands.'); + } +} +/** + * Applies an explain to a given command. + * @internal + * + * @param command - the command on which to apply the explain + * @param options - the options containing the explain verbosity + */ +function decorateWithExplain(command, explain) { + const { verbosity, maxTimeMS } = explain; + const baseCommand = { explain: command, verbosity }; + if (typeof maxTimeMS === 'number') { + baseCommand.maxTimeMS = maxTimeMS; + } + return baseCommand; +} +//# sourceMappingURL=explain.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js.map new file mode 100644 index 00000000..adc2e47e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/explain.js.map @@ -0,0 +1 @@ +{"version":3,"file":"explain.js","sourceRoot":"","sources":["../src/explain.ts"],"names":[],"mappings":";;;AA4FA,sEAKC;AASD,kDAiBC;AA1HD,mCAAwC;AAExC,cAAc;AACD,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,YAAY,EAAE,cAAc;IAC5B,oBAAoB,EAAE,sBAAsB;IAC5C,cAAc,EAAE,gBAAgB;IAChC,iB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,MAAM,WAAW,GAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAEpE,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC;IACpC,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js new file mode 100644 index 00000000..def0a2a2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js @@ -0,0 +1,306 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GridFSBucketReadStream = void 0; +const stream_1 = require("stream"); +const bson_1 = require("../bson"); +const abstract_cursor_1 = require("../cursor/abstract_cursor"); +const error_1 = require("../error"); +const timeout_1 = require("../timeout"); +/** + * A readable stream that enables you to read buffers from GridFS. + * + * Do not instantiate this class directly. Use `openDownloadStream()` instead. + * @public + */ +class GridFSBucketReadStream extends stream_1.Readable { + /** + * Fires when the stream loaded the file document corresponding to the provided id. + * @event + */ + static { this.FILE = 'file'; } + /** + * @param chunks - Handle for chunks collection + * @param files - Handle for files collection + * @param readPreference - The read preference to use + * @param filter - The filter to use to find the file document + * @internal + */ + constructor(chunks, files, readPreference, filter, options) { + super({ emitClose: true }); + this.s = { + bytesToTrim: 0, + bytesToSkip: 0, + bytesRead: 0, + chunks, + expected: 0, + files, + filter, + init: false, + expectedEnd: 0, + options: { + start: 0, + end: 0, + ...options + }, + readPreference, + timeoutContext: options?.timeoutMS != null + ? new timeout_1.CSOTTimeoutContext({ timeoutMS: options.timeoutMS, serverSelectionTimeoutMS: 0 }) + : undefined + }; + } + /** + * Reads from the cursor and pushes to the stream. + * Private Impl, do not call directly + * @internal + */ + _read() { + if (this.destroyed) + return; + waitForFile(this, () => doRead(this)); + } + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param start - 0-based offset in bytes to start streaming from + */ + start(start = 0) { + throwIfInitialized(this); + this.s.options.start = start; + return this; + } + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param end - Offset in bytes to stop reading at + */ + end(end = 0) { + throwIfInitialized(this); + this.s.options.end = end; + return this; + } + /** + * Marks this stream as aborted (will never push another `data` event) + * and kills the underlying cursor. Will emit the 'end' event, and then + * the 'close' event once the cursor is successfully killed. + */ + async abort() { + this.push(null); + this.destroy(); + const remainingTimeMS = this.s.timeoutContext?.getRemainingTimeMSOrThrow(); + await this.s.cursor?.close({ timeoutMS: remainingTimeMS }); + } +} +exports.GridFSBucketReadStream = GridFSBucketReadStream; +function throwIfInitialized(stream) { + if (stream.s.init) { + throw new error_1.MongoGridFSStreamError('Options cannot be changed after the stream is initialized'); + } +} +function doRead(stream) { + if (stream.destroyed) + return; + if (!stream.s.cursor) + return; + if (!stream.s.file) + return; + const handleReadResult = (doc) => { + if (stream.destroyed) + return; + if (!doc) { + stream.push(null); + stream.s.cursor?.close().then(undefined, error => stream.destroy(error)); + return; + } + if (!stream.s.file) + return; + const bytesRemaining = stream.s.file.length - stream.s.bytesRead; + const expectedN = stream.s.expected++; + const expectedLength = Math.min(stream.s.file.chunkSize, bytesRemaining); + if (doc.n > expectedN) { + return stream.destroy(new error_1.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${doc.n}, expected: ${expectedN}`)); + } + if (doc.n < expectedN) { + return stream.destroy(new error_1.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected: ${expectedN}`)); + } + let buf = bson_1.ByteUtils.isUint8Array(doc.data) ? doc.data : doc.data.buffer; + if (buf.byteLength !== expectedLength) { + if (bytesRemaining <= 0) { + return stream.destroy(new error_1.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected file length ${stream.s.file.length} bytes but already read ${stream.s.bytesRead} bytes`)); + } + return stream.destroy(new error_1.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${buf.byteLength}, expected: ${expectedLength}`)); + } + stream.s.bytesRead += buf.byteLength; + if (buf.byteLength === 0) { + return stream.push(null); + } + let sliceStart = null; + let sliceEnd = null; + if (stream.s.bytesToSkip != null) { + sliceStart = stream.s.bytesToSkip; + stream.s.bytesToSkip = 0; + } + const atEndOfStream = expectedN === stream.s.expectedEnd - 1; + const bytesLeftToRead = stream.s.options.end - stream.s.bytesToSkip; + if (atEndOfStream && stream.s.bytesToTrim != null) { + sliceEnd = stream.s.file.chunkSize - stream.s.bytesToTrim; + } + else if (stream.s.options.end && bytesLeftToRead < doc.data.byteLength) { + sliceEnd = bytesLeftToRead; + } + if (sliceStart != null || sliceEnd != null) { + buf = buf.slice(sliceStart || 0, sliceEnd || buf.byteLength); + } + stream.push(buf); + return; + }; + stream.s.cursor.next().then(handleReadResult, error => { + if (stream.destroyed) + return; + stream.destroy(error); + }); +} +function init(stream) { + const findOneOptions = {}; + if (stream.s.readPreference) { + findOneOptions.readPreference = stream.s.readPreference; + } + if (stream.s.options && stream.s.options.sort) { + findOneOptions.sort = stream.s.options.sort; + } + if (stream.s.options && stream.s.options.skip) { + findOneOptions.skip = stream.s.options.skip; + } + const handleReadResult = (doc) => { + if (stream.destroyed) + return; + if (!doc) { + const identifier = stream.s.filter._id + ? stream.s.filter._id.toString() + : stream.s.filter.filename; + const errmsg = `FileNotFound: file ${identifier} was not found`; + // TODO(NODE-3483) + const err = new error_1.MongoRuntimeError(errmsg); + err.code = 'ENOENT'; // TODO: NODE-3338 set property as part of constructor + return stream.destroy(err); + } + // If document is empty, kill the stream immediately and don't + // execute any reads + if (doc.length <= 0) { + stream.push(null); + return; + } + if (stream.destroyed) { + // If user destroys the stream before we have a cursor, wait + // until the query is done to say we're 'closed' because we can't + // cancel a query. + stream.destroy(); + return; + } + try { + stream.s.bytesToSkip = handleStartOption(stream, doc, stream.s.options); + } + catch (error) { + return stream.destroy(error); + } + const filter = { files_id: doc._id }; + // Currently the skip function does not support the index, + // it needs to retrieve all the documents first and then skip them. (CS-25811) + // As work around we use $gte on the "n" field. + if (stream.s.options && stream.s.options.start != null) { + const skip = Math.floor(stream.s.options.start / doc.chunkSize); + if (skip > 0) { + filter['n'] = { $gte: skip }; + } + } + let remainingTimeMS; + try { + remainingTimeMS = stream.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${stream.s.timeoutContext?.timeoutMS}ms`); + } + catch (error) { + return stream.destroy(error); + } + stream.s.cursor = stream.s.chunks + .find(filter, { + timeoutMode: stream.s.options.timeoutMS != null ? abstract_cursor_1.CursorTimeoutMode.LIFETIME : undefined, + timeoutMS: remainingTimeMS + }) + .sort({ n: 1 }); + if (stream.s.readPreference) { + stream.s.cursor.withReadPreference(stream.s.readPreference); + } + stream.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize); + stream.s.file = doc; + try { + stream.s.bytesToTrim = handleEndOption(stream, doc, stream.s.cursor, stream.s.options); + } + catch (error) { + return stream.destroy(error); + } + stream.emit(GridFSBucketReadStream.FILE, doc); + return; + }; + let remainingTimeMS; + try { + remainingTimeMS = stream.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${stream.s.timeoutContext?.timeoutMS}ms`); + } + catch (error) { + if (!stream.destroyed) + stream.destroy(error); + return; + } + findOneOptions.timeoutMS = remainingTimeMS; + stream.s.files.findOne(stream.s.filter, findOneOptions).then(handleReadResult, error => { + if (stream.destroyed) + return; + stream.destroy(error); + }); +} +function waitForFile(stream, callback) { + if (stream.s.file) { + return callback(); + } + if (!stream.s.init) { + init(stream); + stream.s.init = true; + } + stream.once('file', () => { + callback(); + }); +} +function handleStartOption(stream, doc, options) { + if (options && options.start != null) { + if (options.start > doc.length) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be more than the length of the file (${doc.length})`); + } + if (options.start < 0) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be negative`); + } + if (options.end != null && options.end < options.start) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be greater than stream end (${options.end})`); + } + stream.s.bytesRead = Math.floor(options.start / doc.chunkSize) * doc.chunkSize; + stream.s.expected = Math.floor(options.start / doc.chunkSize); + return options.start - stream.s.bytesRead; + } + throw new error_1.MongoInvalidArgumentError('Start option must be defined'); +} +function handleEndOption(stream, doc, cursor, options) { + if (options && options.end != null) { + if (options.end > doc.length) { + throw new error_1.MongoInvalidArgumentError(`Stream end (${options.end}) must not be more than the length of the file (${doc.length})`); + } + if (options.start == null || options.start < 0) { + throw new error_1.MongoInvalidArgumentError(`Stream end (${options.end}) must not be negative`); + } + const start = options.start != null ? Math.floor(options.start / doc.chunkSize) : 0; + cursor.limit(Math.ceil(options.end / doc.chunkSize) - start); + stream.s.expectedEnd = Math.ceil(options.end / doc.chunkSize); + return Math.ceil(options.end / doc.chunkSize) * doc.chunkSize - options.end; + } + throw new error_1.MongoInvalidArgumentError('End option must be defined'); +} +//# sourceMappingURL=download.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js.map new file mode 100644 index 00000000..6bfad1ec --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/download.js.map @@ -0,0 +1 @@ +{"version":3,"file":"download.js","sourceRoot":"","sources":["../../src/gridfs/download.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAElC,kCAAkE;AAElE,+DAA8D;AAE9D,oCAKkB;AAIlB,wCAAgD;AA4FhD;;;;;GAKG;AACH,MAAa,sBAAuB,SAAQ,iBAAQ;IAIlD;;;OAGG;aACa,SAAI,GAAG,MAAe,CAAC;IAEvC;;;;;;O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,CAC3F,CAAC;QACJ,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,iCAAyB,CAAC,eAAe,OAAO,CAAC,GAAG,wBAAwB,CAAC,CAAC;QAC1F,CAAC;QAED,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEpF,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,CAAC;QAE7D,MAAM,CAAC,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAC9E,CAAC;IACD,MAAM,IAAI,iCAAyB,CAAC,4BAA4B,CAAC,CAAC;AACpE,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js new file mode 100644 index 00000000..c9184cbe --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js @@ -0,0 +1,164 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GridFSBucket = void 0; +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const write_concern_1 = require("../write_concern"); +const download_1 = require("./download"); +const upload_1 = require("./upload"); +const DEFAULT_GRIDFS_BUCKET_OPTIONS = { + bucketName: 'fs', + chunkSizeBytes: 255 * 1024 +}; +/** + * Constructor for a streaming GridFS interface + * @public + */ +class GridFSBucket extends mongo_types_1.TypedEventEmitter { + /** + * When the first call to openUploadStream is made, the upload stream will + * check to see if it needs to create the proper indexes on the chunks and + * files collections. This event is fired either when 1) it determines that + * no index creation is necessary, 2) when it successfully creates the + * necessary indexes. + * @event + */ + static { this.INDEX = 'index'; } + constructor(db, options) { + super(); + this.on('error', utils_1.noop); + this.setMaxListeners(0); + const privateOptions = (0, utils_1.resolveOptions)(db, { + ...DEFAULT_GRIDFS_BUCKET_OPTIONS, + ...options, + writeConcern: write_concern_1.WriteConcern.fromOptions(options) + }); + this.s = { + db, + options: privateOptions, + _chunksCollection: db.collection(privateOptions.bucketName + '.chunks'), + _filesCollection: db.collection(privateOptions.bucketName + '.files'), + checkedIndexes: false, + calledOpenUploadStream: false + }; + } + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS. The stream's 'id' property contains the resulting + * file's id. + * + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + openUploadStream(filename, options) { + return new upload_1.GridFSBucketWriteStream(this, filename, { + timeoutMS: this.s.options.timeoutMS, + ...options + }); + } + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting + * file's id. + */ + openUploadStreamWithId(id, filename, options) { + return new upload_1.GridFSBucketWriteStream(this, filename, { + timeoutMS: this.s.options.timeoutMS, + ...options, + id + }); + } + /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ + openDownloadStream(id, options) { + return new download_1.GridFSBucketReadStream(this.s._chunksCollection, this.s._filesCollection, this.s.options.readPreference, { _id: id }, { timeoutMS: this.s.options.timeoutMS, ...options }); + } + /** + * Deletes a file with the given id + * + * @param id - The id of the file doc + */ + async delete(id, options) { + const { timeoutMS } = (0, utils_1.resolveOptions)(this.s.db, options); + let timeoutContext = undefined; + if (timeoutMS) { + timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS, + serverSelectionTimeoutMS: this.s.db.client.s.options.serverSelectionTimeoutMS + }); + } + const { deletedCount } = await this.s._filesCollection.deleteOne({ _id: id }, { timeoutMS: timeoutContext?.remainingTimeMS }); + const remainingTimeMS = timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) + throw new error_1.MongoOperationTimeoutError(`Timed out after ${timeoutMS}ms`); + // Delete orphaned chunks before returning FileNotFound + await this.s._chunksCollection.deleteMany({ files_id: id }, { timeoutMS: remainingTimeMS }); + if (deletedCount === 0) { + // TODO(NODE-3483): Replace with more appropriate error + // Consider creating new error MongoGridFSFileNotFoundError + throw new error_1.MongoRuntimeError(`File not found for id ${id}`); + } + } + /** Convenience wrapper around find on the files collection */ + find(filter = {}, options = {}) { + return this.s._filesCollection.find(filter, options); + } + /** + * Returns a readable stream (GridFSBucketReadStream) for streaming the + * file with the given name from GridFS. If there are multiple files with + * the same name, this will stream the most recent file with the given name + * (as determined by the `uploadDate` field). You can set the `revision` + * option to change this behavior. + */ + openDownloadStreamByName(filename, options) { + let sort = { uploadDate: -1 }; + let skip = undefined; + if (options && options.revision != null) { + if (options.revision >= 0) { + sort = { uploadDate: 1 }; + skip = options.revision; + } + else { + skip = -options.revision - 1; + } + } + return new download_1.GridFSBucketReadStream(this.s._chunksCollection, this.s._filesCollection, this.s.options.readPreference, { filename }, { timeoutMS: this.s.options.timeoutMS, ...options, sort, skip }); + } + /** + * Renames the file with the given _id to the given string + * + * @param id - the id of the file to rename + * @param filename - new name for the file + */ + async rename(id, filename, options) { + const filter = { _id: id }; + const update = { $set: { filename } }; + const { matchedCount } = await this.s._filesCollection.updateOne(filter, update, options); + if (matchedCount === 0) { + throw new error_1.MongoRuntimeError(`File with id ${id} not found`); + } + } + /** Removes this bucket's files collection, followed by its chunks collection. */ + async drop(options) { + const { timeoutMS } = (0, utils_1.resolveOptions)(this.s.db, options); + let timeoutContext = undefined; + if (timeoutMS) { + timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS, + serverSelectionTimeoutMS: this.s.db.client.s.options.serverSelectionTimeoutMS + }); + } + if (timeoutContext) { + await this.s._filesCollection.drop({ timeoutMS: timeoutContext.remainingTimeMS }); + const remainingTimeMS = timeoutContext.getRemainingTimeMSOrThrow(`Timed out after ${timeoutMS}ms`); + await this.s._chunksCollection.drop({ timeoutMS: remainingTimeMS }); + } + else { + await this.s._filesCollection.drop(); + await this.s._chunksCollection.drop(); + } + } +} +exports.GridFSBucket = GridFSBucket; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js.map new file mode 100644 index 00000000..9b5676b7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gridfs/index.ts"],"names":[],"mappings":";;;AAIA,oCAAyE;AACzE,gDAAgE;AAGhE,wCAAgD;AAChD,oCAAgD;AAChD,oDAA0E;AAE1E,yCAKoB;AACpB,qCAIkB;AAElB,MAAM,6BAA6B,GAG/B;IACF,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,GAAG,GAAG,IAAI;CAC3B,CAAC;AAuCF;;;GAGG;AACH,MAAa,YAAa,SAAQ,+BAAqC;IAIrE;;;;;;;OAOG;aACa,UAAK,GAAG,OAAgB,CAAC;IAEzC,YAAY,EAAM,EAAE,OAA6B;QAC/C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,YAAI,CAAC,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CA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AAO,CAAC,CAAC;QAC1F,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,yBAAiB,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,IAAI,CAAC,OAA+B;QACxC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,sBAAc,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACzD,IAAI,cAAc,GAAmC,SAAS,CAAC;QAE/D,IAAI,SAAS,EAAE,CAAC;YACd,cAAc,GAAG,IAAI,4BAAkB,CAAC;gBACtC,SAAS;gBACT,wBAAwB,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,wBAAwB;aAC9E,CAAC,CAAC;QACL,CAAC;QAED,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,cAAc,CAAC,eAAe,EAAE,CAAC,CAAC;YAClF,MAAM,eAAe,GAAG,cAAc,CAAC,yBAAyB,CAC9D,mBAAmB,SAAS,IAAI,CACjC,CAAC;YACF,MAAM,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YACrC,MAAM,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;QACxC,CAAC;IACH,CAAC;;AA7LH,oCA8LC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js new file mode 100644 index 00000000..7b8b163a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js @@ -0,0 +1,358 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GridFSBucketWriteStream = void 0; +const stream_1 = require("stream"); +const bson_1 = require("../bson"); +const abstract_cursor_1 = require("../cursor/abstract_cursor"); +const error_1 = require("../error"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const write_concern_1 = require("./../write_concern"); +/** + * A writable stream that enables you to write buffers to GridFS. + * + * Do not instantiate this class directly. Use `openUploadStream()` instead. + * @public + */ +class GridFSBucketWriteStream extends stream_1.Writable { + /** + * @param bucket - Handle for this stream's corresponding bucket + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + * @internal + */ + constructor(bucket, filename, options) { + super(); + /** + * The document containing information about the inserted file. + * This property is defined _after_ the finish event has been emitted. + * It will remain `null` if an error occurs. + * + * @example + * ```ts + * fs.createReadStream('file.txt') + * .pipe(bucket.openUploadStream('file.txt')) + * .on('finish', function () { + * console.log(this.gridFSFile) + * }) + * ``` + */ + this.gridFSFile = null; + options = options ?? {}; + this.bucket = bucket; + this.chunks = bucket.s._chunksCollection; + this.filename = filename; + this.files = bucket.s._filesCollection; + this.options = options; + this.writeConcern = write_concern_1.WriteConcern.fromOptions(options) || bucket.s.options.writeConcern; + // Signals the write is all done + this.done = false; + this.id = options.id ? options.id : new bson_1.ObjectId(); + // properly inherit the default chunksize from parent + this.chunkSizeBytes = options.chunkSizeBytes || this.bucket.s.options.chunkSizeBytes; + this.bufToStore = bson_1.ByteUtils.allocate(this.chunkSizeBytes); + this.length = 0; + this.n = 0; + this.pos = 0; + this.state = { + streamEnd: false, + outstandingRequests: 0, + errored: false, + aborted: false + }; + if (options.timeoutMS != null) + this.timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS: options.timeoutMS, + serverSelectionTimeoutMS: (0, utils_1.resolveTimeoutOptions)(this.bucket.s.db.client, {}) + .serverSelectionTimeoutMS + }); + } + /** + * @internal + * + * The stream is considered constructed when the indexes are done being created + */ + _construct(callback) { + if (!this.bucket.s.calledOpenUploadStream) { + this.bucket.s.calledOpenUploadStream = true; + checkIndexes(this).then(() => { + this.bucket.s.checkedIndexes = true; + this.bucket.emit('index'); + callback(); + }, error => { + if (error instanceof error_1.MongoOperationTimeoutError) { + return handleError(this, error, callback); + } + (0, utils_1.squashError)(error); + callback(); + }); + } + else { + return queueMicrotask(callback); + } + } + /** + * @internal + * Write a buffer to the stream. + * + * @param chunk - Buffer to write + * @param encoding - Optional encoding for the buffer + * @param callback - Function to call when the chunk was added to the buffer, or if the entire chunk was persisted to MongoDB if this chunk caused a flush. + */ + _write(chunk, encoding, callback) { + doWrite(this, chunk, encoding, callback); + } + /** @internal */ + _final(callback) { + if (this.state.streamEnd) { + return queueMicrotask(callback); + } + this.state.streamEnd = true; + writeRemnant(this, callback); + } + /** + * Places this write stream into an aborted state (all future writes fail) + * and deletes all chunks that have already been written. + */ + async abort() { + if (this.state.streamEnd) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + throw new error_1.MongoAPIError('Cannot abort a stream that has already completed'); + } + if (this.state.aborted) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + throw new error_1.MongoAPIError('Cannot call abort() on a stream twice'); + } + this.state.aborted = true; + const remainingTimeMS = this.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${this.timeoutContext?.timeoutMS}ms`); + await this.chunks.deleteMany({ files_id: this.id }, { timeoutMS: remainingTimeMS }); + } +} +exports.GridFSBucketWriteStream = GridFSBucketWriteStream; +function handleError(stream, error, callback) { + if (stream.state.errored) { + queueMicrotask(callback); + return; + } + stream.state.errored = true; + queueMicrotask(() => callback(error)); +} +function createChunkDoc(filesId, n, data) { + return { + _id: new bson_1.ObjectId(), + files_id: filesId, + n, + data + }; +} +async function checkChunksIndex(stream) { + const index = { files_id: 1, n: 1 }; + let remainingTimeMS; + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + let indexes; + try { + indexes = await stream.chunks + .listIndexes({ + timeoutMode: remainingTimeMS != null ? abstract_cursor_1.CursorTimeoutMode.LIFETIME : undefined, + timeoutMS: remainingTimeMS + }) + .toArray(); + } + catch (error) { + if (error instanceof error_1.MongoError && error.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + indexes = []; + } + else { + throw error; + } + } + const hasChunksIndex = !!indexes.find(index => { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.files_id === 1 && index.key.n === 1) { + return true; + } + return false; + }); + if (!hasChunksIndex) { + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + await stream.chunks.createIndex(index, { + ...stream.writeConcern, + background: true, + unique: true, + timeoutMS: remainingTimeMS + }); + } +} +function checkDone(stream, callback) { + if (stream.done) { + return queueMicrotask(callback); + } + if (stream.state.streamEnd && stream.state.outstandingRequests === 0 && !stream.state.errored) { + // Set done so we do not trigger duplicate createFilesDoc + stream.done = true; + // Create a new files doc + const gridFSFile = createFilesDoc(stream.id, stream.length, stream.chunkSizeBytes, stream.filename, stream.options.metadata); + if (isAborted(stream, callback)) { + return; + } + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError(stream, new error_1.MongoOperationTimeoutError(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`), callback); + } + stream.files + .insertOne(gridFSFile, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }) + .then(() => { + stream.gridFSFile = gridFSFile; + callback(); + }, error => { + return handleError(stream, error, callback); + }); + return; + } + queueMicrotask(callback); +} +async function checkIndexes(stream) { + let remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + const doc = await stream.files.findOne({}, { + projection: { _id: 1 }, + timeoutMS: remainingTimeMS + }); + if (doc != null) { + // If at least one document exists assume the collection has the required index + return; + } + const index = { filename: 1, uploadDate: 1 }; + let indexes; + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + const listIndexesOptions = { + timeoutMode: remainingTimeMS != null ? abstract_cursor_1.CursorTimeoutMode.LIFETIME : undefined, + timeoutMS: remainingTimeMS + }; + try { + indexes = await stream.files.listIndexes(listIndexesOptions).toArray(); + } + catch (error) { + if (error instanceof error_1.MongoError && error.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + indexes = []; + } + else { + throw error; + } + } + const hasFileIndex = !!indexes.find(index => { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.filename === 1 && index.key.uploadDate === 1) { + return true; + } + return false; + }); + if (!hasFileIndex) { + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + await stream.files.createIndex(index, { background: false, timeoutMS: remainingTimeMS }); + } + await checkChunksIndex(stream); +} +function createFilesDoc(_id, length, chunkSize, filename, metadata) { + const ret = { + _id, + length, + chunkSize, + uploadDate: new Date(), + filename + }; + if (metadata) { + ret.metadata = metadata; + } + return ret; +} +function doWrite(stream, chunk, encoding, callback) { + if (isAborted(stream, callback)) { + return; + } + const inputBuf = typeof chunk === 'string' ? bson_1.ByteUtils.fromUTF8(chunk) : bson_1.ByteUtils.toLocalBufferType(chunk); + stream.length += inputBuf.length; + // Input is small enough to fit in our buffer + if (stream.pos + inputBuf.length < stream.chunkSizeBytes) { + bson_1.ByteUtils.copy(inputBuf, stream.bufToStore, stream.pos); + stream.pos += inputBuf.length; + queueMicrotask(callback); + return; + } + // Otherwise, buffer is too big for current chunk, so we need to flush + // to MongoDB. + let inputBufRemaining = inputBuf.length; + let spaceRemaining = stream.chunkSizeBytes - stream.pos; + let numToCopy = Math.min(spaceRemaining, inputBuf.length); + let outstandingRequests = 0; + while (inputBufRemaining > 0) { + const inputBufPos = inputBuf.length - inputBufRemaining; + bson_1.ByteUtils.copy(inputBuf, stream.bufToStore, stream.pos, inputBufPos, inputBufPos + numToCopy); + stream.pos += numToCopy; + spaceRemaining -= numToCopy; + let doc; + if (spaceRemaining === 0) { + doc = createChunkDoc(stream.id, stream.n, new Uint8Array(stream.bufToStore)); + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError(stream, new error_1.MongoOperationTimeoutError(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`), callback); + } + ++stream.state.outstandingRequests; + ++outstandingRequests; + if (isAborted(stream, callback)) { + return; + } + stream.chunks + .insertOne(doc, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }) + .then(() => { + --stream.state.outstandingRequests; + --outstandingRequests; + if (!outstandingRequests) { + checkDone(stream, callback); + } + }, error => { + return handleError(stream, error, callback); + }); + spaceRemaining = stream.chunkSizeBytes; + stream.pos = 0; + ++stream.n; + } + inputBufRemaining -= numToCopy; + numToCopy = Math.min(spaceRemaining, inputBufRemaining); + } +} +function writeRemnant(stream, callback) { + // Buffer is empty, so don't bother to insert + if (stream.pos === 0) { + return checkDone(stream, callback); + } + // Create a new buffer to make sure the buffer isn't bigger than it needs + // to be. + const remnant = bson_1.ByteUtils.allocate(stream.pos); + bson_1.ByteUtils.copy(stream.bufToStore, remnant, 0, 0, stream.pos); + const doc = createChunkDoc(stream.id, stream.n, remnant); + // If the stream was aborted, do not write remnant + if (isAborted(stream, callback)) { + return; + } + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError(stream, new error_1.MongoOperationTimeoutError(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`), callback); + } + ++stream.state.outstandingRequests; + stream.chunks + .insertOne(doc, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }) + .then(() => { + --stream.state.outstandingRequests; + checkDone(stream, callback); + }, error => { + return handleError(stream, error, callback); + }); +} +function isAborted(stream, callback) { + if (stream.state.aborted) { + queueMicrotask(() => callback(new error_1.MongoAPIError('Stream has been aborted'))); + return true; + } + return false; +} +//# sourceMappingURL=upload.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js.map new file mode 100644 index 00000000..7dac992f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/gridfs/upload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/gridfs/upload.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAElC,kCAA6D;AAE7D,+DAA8D;AAC9D,oCAKkB;AAClB,wCAAgD;AAChD,oCAA6E;AAE7E,sDAAkD;AA2BlD;;;;;GAKG;AACH,MAAa,uBAAwB,SAAQ,iBAAQ;IAuDnD;;;;;OAKG;IACH,YAAY,MAAoB,EAAE,QAAgB,EAAE,OAAwC;QAC1F,KAAK,EAAE,CAAC;QAzBV;;;;;;;;;;;;;WAaG;QACH,eAAU,GAAsB,IAAI,CAAC;QAanC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,4BAAY,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,OAAO,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AAC,OAAO,EAAE,CAAC;QACzB,cAAc,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,qBAAa,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js new file mode 100644 index 00000000..3f4f7344 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js @@ -0,0 +1,193 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoRuntimeError = exports.MongoParseError = exports.MongoOperationTimeoutError = exports.MongoOIDCError = exports.MongoNotConnectedError = exports.MongoNetworkTimeoutError = exports.MongoNetworkError = exports.MongoMissingDependencyError = exports.MongoMissingCredentialsError = exports.MongoKerberosError = exports.MongoInvalidArgumentError = exports.MongoGridFSStreamError = exports.MongoGridFSChunkError = exports.MongoGCPError = exports.MongoExpiredSessionError = exports.MongoError = exports.MongoDriverError = exports.MongoDecompressionError = exports.MongoCursorInUseError = exports.MongoCursorExhaustedError = exports.MongoCompatibilityError = exports.MongoClientClosedError = exports.MongoClientBulkWriteExecutionError = exports.MongoClientBulkWriteError = exports.MongoClientBulkWriteCursorError = exports.MongoChangeStreamError = exports.MongoBatchReExecutionError = exports.MongoAzureError = exports.MongoAWSError = exports.MongoAPIError = exports.ExplainableCursor = exports.ChangeStreamCursor = exports.ClientEncryption = exports.MongoBulkWriteError = exports.UUID = exports.Timestamp = exports.ObjectId = exports.MinKey = exports.MaxKey = exports.Long = exports.Int32 = exports.Double = exports.Decimal128 = exports.DBRef = exports.Code = exports.BSONType = exports.BSONSymbol = exports.BSONRegExp = exports.Binary = exports.BSON = void 0; +exports.CommandStartedEvent = exports.CommandFailedEvent = exports.WriteConcern = exports.ReadPreference = exports.ReadConcern = exports.TopologyType = exports.ServerType = exports.ReadPreferenceMode = exports.ReadConcernLevel = exports.ProfilingLevel = exports.ReturnDocument = exports.SeverityLevel = exports.MongoLoggableComponent = exports.ServerApiVersion = exports.ExplainVerbosity = exports.MongoErrorLabel = exports.CursorTimeoutMode = exports.CURSOR_FLAGS = exports.Compressor = exports.AuthMechanism = exports.GSSAPICanonicalizationValue = exports.AutoEncryptionLoggerLevel = exports.BatchType = exports.UnorderedBulkOperation = exports.OrderedBulkOperation = exports.MongoClient = exports.ListIndexesCursor = exports.ListCollectionsCursor = exports.GridFSBucketWriteStream = exports.GridFSBucketReadStream = exports.GridFSBucket = exports.FindCursor = exports.Db = exports.Collection = exports.ClientSession = exports.ChangeStream = exports.CancellationToken = exports.AggregationCursor = exports.Admin = exports.AbstractCursor = exports.MongoWriteConcernError = exports.MongoUnexpectedServerResponseError = exports.MongoTransactionError = exports.MongoTopologyClosedError = exports.MongoTailableCursorError = exports.MongoSystemError = exports.MongoStalePrimaryError = exports.MongoServerSelectionError = exports.MongoServerError = exports.MongoServerClosedError = void 0; +exports.MongoClientAuthProviders = exports.MongoCryptKMSRequestNetworkTimeoutError = exports.MongoCryptInvalidArgumentError = exports.MongoCryptError = exports.MongoCryptCreateEncryptedCollectionError = exports.MongoCryptCreateDataKeyError = exports.MongoCryptAzureKMSRequestError = exports.SrvPollingEvent = exports.WaitingForSuitableServerEvent = exports.ServerSelectionSucceededEvent = exports.ServerSelectionStartedEvent = exports.ServerSelectionFailedEvent = exports.ServerSelectionEvent = exports.TopologyOpeningEvent = exports.TopologyDescriptionChangedEvent = exports.TopologyClosedEvent = exports.ServerOpeningEvent = exports.ServerHeartbeatSucceededEvent = exports.ServerHeartbeatStartedEvent = exports.ServerHeartbeatFailedEvent = exports.ServerDescriptionChangedEvent = exports.ServerClosedEvent = exports.ConnectionReadyEvent = exports.ConnectionPoolReadyEvent = exports.ConnectionPoolMonitoringEvent = exports.ConnectionPoolCreatedEvent = exports.ConnectionPoolClosedEvent = exports.ConnectionPoolClearedEvent = exports.ConnectionCreatedEvent = exports.ConnectionClosedEvent = exports.ConnectionCheckOutStartedEvent = exports.ConnectionCheckOutFailedEvent = exports.ConnectionCheckedOutEvent = exports.ConnectionCheckedInEvent = exports.CommandSucceededEvent = void 0; +const admin_1 = require("./admin"); +Object.defineProperty(exports, "Admin", { enumerable: true, get: function () { return admin_1.Admin; } }); +const ordered_1 = require("./bulk/ordered"); +Object.defineProperty(exports, "OrderedBulkOperation", { enumerable: true, get: function () { return ordered_1.OrderedBulkOperation; } }); +const unordered_1 = require("./bulk/unordered"); +Object.defineProperty(exports, "UnorderedBulkOperation", { enumerable: true, get: function () { return unordered_1.UnorderedBulkOperation; } }); +const change_stream_1 = require("./change_stream"); +Object.defineProperty(exports, "ChangeStream", { enumerable: true, get: function () { return change_stream_1.ChangeStream; } }); +const collection_1 = require("./collection"); +Object.defineProperty(exports, "Collection", { enumerable: true, get: function () { return collection_1.Collection; } }); +const abstract_cursor_1 = require("./cursor/abstract_cursor"); +Object.defineProperty(exports, "AbstractCursor", { enumerable: true, get: function () { return abstract_cursor_1.AbstractCursor; } }); +const aggregation_cursor_1 = require("./cursor/aggregation_cursor"); +Object.defineProperty(exports, "AggregationCursor", { enumerable: true, get: function () { return aggregation_cursor_1.AggregationCursor; } }); +const find_cursor_1 = require("./cursor/find_cursor"); +Object.defineProperty(exports, "FindCursor", { enumerable: true, get: function () { return find_cursor_1.FindCursor; } }); +const list_collections_cursor_1 = require("./cursor/list_collections_cursor"); +Object.defineProperty(exports, "ListCollectionsCursor", { enumerable: true, get: function () { return list_collections_cursor_1.ListCollectionsCursor; } }); +const list_indexes_cursor_1 = require("./cursor/list_indexes_cursor"); +Object.defineProperty(exports, "ListIndexesCursor", { enumerable: true, get: function () { return list_indexes_cursor_1.ListIndexesCursor; } }); +const db_1 = require("./db"); +Object.defineProperty(exports, "Db", { enumerable: true, get: function () { return db_1.Db; } }); +const gridfs_1 = require("./gridfs"); +Object.defineProperty(exports, "GridFSBucket", { enumerable: true, get: function () { return gridfs_1.GridFSBucket; } }); +const download_1 = require("./gridfs/download"); +Object.defineProperty(exports, "GridFSBucketReadStream", { enumerable: true, get: function () { return download_1.GridFSBucketReadStream; } }); +const upload_1 = require("./gridfs/upload"); +Object.defineProperty(exports, "GridFSBucketWriteStream", { enumerable: true, get: function () { return upload_1.GridFSBucketWriteStream; } }); +const mongo_client_1 = require("./mongo_client"); +Object.defineProperty(exports, "MongoClient", { enumerable: true, get: function () { return mongo_client_1.MongoClient; } }); +const mongo_types_1 = require("./mongo_types"); +Object.defineProperty(exports, "CancellationToken", { enumerable: true, get: function () { return mongo_types_1.CancellationToken; } }); +const sessions_1 = require("./sessions"); +Object.defineProperty(exports, "ClientSession", { enumerable: true, get: function () { return sessions_1.ClientSession; } }); +/** @public */ +var bson_1 = require("./bson"); +Object.defineProperty(exports, "BSON", { enumerable: true, get: function () { return bson_1.BSON; } }); +var bson_2 = require("./bson"); +Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return bson_2.Binary; } }); +Object.defineProperty(exports, "BSONRegExp", { enumerable: true, get: function () { return bson_2.BSONRegExp; } }); +Object.defineProperty(exports, "BSONSymbol", { enumerable: true, get: function () { return bson_2.BSONSymbol; } }); +Object.defineProperty(exports, "BSONType", { enumerable: true, get: function () { return bson_2.BSONType; } }); +Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return bson_2.Code; } }); +Object.defineProperty(exports, "DBRef", { enumerable: true, get: function () { return bson_2.DBRef; } }); +Object.defineProperty(exports, "Decimal128", { enumerable: true, get: function () { return bson_2.Decimal128; } }); +Object.defineProperty(exports, "Double", { enumerable: true, get: function () { return bson_2.Double; } }); +Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return bson_2.Int32; } }); +Object.defineProperty(exports, "Long", { enumerable: true, get: function () { return bson_2.Long; } }); +Object.defineProperty(exports, "MaxKey", { enumerable: true, get: function () { return bson_2.MaxKey; } }); +Object.defineProperty(exports, "MinKey", { enumerable: true, get: function () { return bson_2.MinKey; } }); +Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return bson_2.ObjectId; } }); +Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return bson_2.Timestamp; } }); +Object.defineProperty(exports, "UUID", { enumerable: true, get: function () { return bson_2.UUID; } }); +var common_1 = require("./bulk/common"); +Object.defineProperty(exports, "MongoBulkWriteError", { enumerable: true, get: function () { return common_1.MongoBulkWriteError; } }); +var client_encryption_1 = require("./client-side-encryption/client_encryption"); +Object.defineProperty(exports, "ClientEncryption", { enumerable: true, get: function () { return client_encryption_1.ClientEncryption; } }); +var change_stream_cursor_1 = require("./cursor/change_stream_cursor"); +Object.defineProperty(exports, "ChangeStreamCursor", { enumerable: true, get: function () { return change_stream_cursor_1.ChangeStreamCursor; } }); +var explainable_cursor_1 = require("./cursor/explainable_cursor"); +Object.defineProperty(exports, "ExplainableCursor", { enumerable: true, get: function () { return explainable_cursor_1.ExplainableCursor; } }); +var error_1 = require("./error"); +Object.defineProperty(exports, "MongoAPIError", { enumerable: true, get: function () { return error_1.MongoAPIError; } }); +Object.defineProperty(exports, "MongoAWSError", { enumerable: true, get: function () { return error_1.MongoAWSError; } }); +Object.defineProperty(exports, "MongoAzureError", { enumerable: true, get: function () { return error_1.MongoAzureError; } }); +Object.defineProperty(exports, "MongoBatchReExecutionError", { enumerable: true, get: function () { return error_1.MongoBatchReExecutionError; } }); +Object.defineProperty(exports, "MongoChangeStreamError", { enumerable: true, get: function () { return error_1.MongoChangeStreamError; } }); +Object.defineProperty(exports, "MongoClientBulkWriteCursorError", { enumerable: true, get: function () { return error_1.MongoClientBulkWriteCursorError; } }); +Object.defineProperty(exports, "MongoClientBulkWriteError", { enumerable: true, get: function () { return error_1.MongoClientBulkWriteError; } }); +Object.defineProperty(exports, "MongoClientBulkWriteExecutionError", { enumerable: true, get: function () { return error_1.MongoClientBulkWriteExecutionError; } }); +Object.defineProperty(exports, "MongoClientClosedError", { enumerable: true, get: function () { return error_1.MongoClientClosedError; } }); +Object.defineProperty(exports, "MongoCompatibilityError", { enumerable: true, get: function () { return error_1.MongoCompatibilityError; } }); +Object.defineProperty(exports, "MongoCursorExhaustedError", { enumerable: true, get: function () { return error_1.MongoCursorExhaustedError; } }); +Object.defineProperty(exports, "MongoCursorInUseError", { enumerable: true, get: function () { return error_1.MongoCursorInUseError; } }); +Object.defineProperty(exports, "MongoDecompressionError", { enumerable: true, get: function () { return error_1.MongoDecompressionError; } }); +Object.defineProperty(exports, "MongoDriverError", { enumerable: true, get: function () { return error_1.MongoDriverError; } }); +Object.defineProperty(exports, "MongoError", { enumerable: true, get: function () { return error_1.MongoError; } }); +Object.defineProperty(exports, "MongoExpiredSessionError", { enumerable: true, get: function () { return error_1.MongoExpiredSessionError; } }); +Object.defineProperty(exports, "MongoGCPError", { enumerable: true, get: function () { return error_1.MongoGCPError; } }); +Object.defineProperty(exports, "MongoGridFSChunkError", { enumerable: true, get: function () { return error_1.MongoGridFSChunkError; } }); +Object.defineProperty(exports, "MongoGridFSStreamError", { enumerable: true, get: function () { return error_1.MongoGridFSStreamError; } }); +Object.defineProperty(exports, "MongoInvalidArgumentError", { enumerable: true, get: function () { return error_1.MongoInvalidArgumentError; } }); +Object.defineProperty(exports, "MongoKerberosError", { enumerable: true, get: function () { return error_1.MongoKerberosError; } }); +Object.defineProperty(exports, "MongoMissingCredentialsError", { enumerable: true, get: function () { return error_1.MongoMissingCredentialsError; } }); +Object.defineProperty(exports, "MongoMissingDependencyError", { enumerable: true, get: function () { return error_1.MongoMissingDependencyError; } }); +Object.defineProperty(exports, "MongoNetworkError", { enumerable: true, get: function () { return error_1.MongoNetworkError; } }); +Object.defineProperty(exports, "MongoNetworkTimeoutError", { enumerable: true, get: function () { return error_1.MongoNetworkTimeoutError; } }); +Object.defineProperty(exports, "MongoNotConnectedError", { enumerable: true, get: function () { return error_1.MongoNotConnectedError; } }); +Object.defineProperty(exports, "MongoOIDCError", { enumerable: true, get: function () { return error_1.MongoOIDCError; } }); +Object.defineProperty(exports, "MongoOperationTimeoutError", { enumerable: true, get: function () { return error_1.MongoOperationTimeoutError; } }); +Object.defineProperty(exports, "MongoParseError", { enumerable: true, get: function () { return error_1.MongoParseError; } }); +Object.defineProperty(exports, "MongoRuntimeError", { enumerable: true, get: function () { return error_1.MongoRuntimeError; } }); +Object.defineProperty(exports, "MongoServerClosedError", { enumerable: true, get: function () { return error_1.MongoServerClosedError; } }); +Object.defineProperty(exports, "MongoServerError", { enumerable: true, get: function () { return error_1.MongoServerError; } }); +Object.defineProperty(exports, "MongoServerSelectionError", { enumerable: true, get: function () { return error_1.MongoServerSelectionError; } }); +Object.defineProperty(exports, "MongoStalePrimaryError", { enumerable: true, get: function () { return error_1.MongoStalePrimaryError; } }); +Object.defineProperty(exports, "MongoSystemError", { enumerable: true, get: function () { return error_1.MongoSystemError; } }); +Object.defineProperty(exports, "MongoTailableCursorError", { enumerable: true, get: function () { return error_1.MongoTailableCursorError; } }); +Object.defineProperty(exports, "MongoTopologyClosedError", { enumerable: true, get: function () { return error_1.MongoTopologyClosedError; } }); +Object.defineProperty(exports, "MongoTransactionError", { enumerable: true, get: function () { return error_1.MongoTransactionError; } }); +Object.defineProperty(exports, "MongoUnexpectedServerResponseError", { enumerable: true, get: function () { return error_1.MongoUnexpectedServerResponseError; } }); +Object.defineProperty(exports, "MongoWriteConcernError", { enumerable: true, get: function () { return error_1.MongoWriteConcernError; } }); +// enums +var common_2 = require("./bulk/common"); +Object.defineProperty(exports, "BatchType", { enumerable: true, get: function () { return common_2.BatchType; } }); +var auto_encrypter_1 = require("./client-side-encryption/auto_encrypter"); +Object.defineProperty(exports, "AutoEncryptionLoggerLevel", { enumerable: true, get: function () { return auto_encrypter_1.AutoEncryptionLoggerLevel; } }); +var gssapi_1 = require("./cmap/auth/gssapi"); +Object.defineProperty(exports, "GSSAPICanonicalizationValue", { enumerable: true, get: function () { return gssapi_1.GSSAPICanonicalizationValue; } }); +var providers_1 = require("./cmap/auth/providers"); +Object.defineProperty(exports, "AuthMechanism", { enumerable: true, get: function () { return providers_1.AuthMechanism; } }); +var compression_1 = require("./cmap/wire_protocol/compression"); +Object.defineProperty(exports, "Compressor", { enumerable: true, get: function () { return compression_1.Compressor; } }); +var abstract_cursor_2 = require("./cursor/abstract_cursor"); +Object.defineProperty(exports, "CURSOR_FLAGS", { enumerable: true, get: function () { return abstract_cursor_2.CURSOR_FLAGS; } }); +Object.defineProperty(exports, "CursorTimeoutMode", { enumerable: true, get: function () { return abstract_cursor_2.CursorTimeoutMode; } }); +var error_2 = require("./error"); +Object.defineProperty(exports, "MongoErrorLabel", { enumerable: true, get: function () { return error_2.MongoErrorLabel; } }); +var explain_1 = require("./explain"); +Object.defineProperty(exports, "ExplainVerbosity", { enumerable: true, get: function () { return explain_1.ExplainVerbosity; } }); +var mongo_client_2 = require("./mongo_client"); +Object.defineProperty(exports, "ServerApiVersion", { enumerable: true, get: function () { return mongo_client_2.ServerApiVersion; } }); +var mongo_logger_1 = require("./mongo_logger"); +Object.defineProperty(exports, "MongoLoggableComponent", { enumerable: true, get: function () { return mongo_logger_1.MongoLoggableComponent; } }); +Object.defineProperty(exports, "SeverityLevel", { enumerable: true, get: function () { return mongo_logger_1.SeverityLevel; } }); +var find_and_modify_1 = require("./operations/find_and_modify"); +Object.defineProperty(exports, "ReturnDocument", { enumerable: true, get: function () { return find_and_modify_1.ReturnDocument; } }); +var set_profiling_level_1 = require("./operations/set_profiling_level"); +Object.defineProperty(exports, "ProfilingLevel", { enumerable: true, get: function () { return set_profiling_level_1.ProfilingLevel; } }); +var read_concern_1 = require("./read_concern"); +Object.defineProperty(exports, "ReadConcernLevel", { enumerable: true, get: function () { return read_concern_1.ReadConcernLevel; } }); +var read_preference_1 = require("./read_preference"); +Object.defineProperty(exports, "ReadPreferenceMode", { enumerable: true, get: function () { return read_preference_1.ReadPreferenceMode; } }); +var common_3 = require("./sdam/common"); +Object.defineProperty(exports, "ServerType", { enumerable: true, get: function () { return common_3.ServerType; } }); +Object.defineProperty(exports, "TopologyType", { enumerable: true, get: function () { return common_3.TopologyType; } }); +var read_concern_2 = require("./read_concern"); +Object.defineProperty(exports, "ReadConcern", { enumerable: true, get: function () { return read_concern_2.ReadConcern; } }); +var read_preference_2 = require("./read_preference"); +Object.defineProperty(exports, "ReadPreference", { enumerable: true, get: function () { return read_preference_2.ReadPreference; } }); +var write_concern_1 = require("./write_concern"); +Object.defineProperty(exports, "WriteConcern", { enumerable: true, get: function () { return write_concern_1.WriteConcern; } }); +// events +var command_monitoring_events_1 = require("./cmap/command_monitoring_events"); +Object.defineProperty(exports, "CommandFailedEvent", { enumerable: true, get: function () { return command_monitoring_events_1.CommandFailedEvent; } }); +Object.defineProperty(exports, "CommandStartedEvent", { enumerable: true, get: function () { return command_monitoring_events_1.CommandStartedEvent; } }); +Object.defineProperty(exports, "CommandSucceededEvent", { enumerable: true, get: function () { return command_monitoring_events_1.CommandSucceededEvent; } }); +var connection_pool_events_1 = require("./cmap/connection_pool_events"); +Object.defineProperty(exports, "ConnectionCheckedInEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckedInEvent; } }); +Object.defineProperty(exports, "ConnectionCheckedOutEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckedOutEvent; } }); +Object.defineProperty(exports, "ConnectionCheckOutFailedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckOutFailedEvent; } }); +Object.defineProperty(exports, "ConnectionCheckOutStartedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckOutStartedEvent; } }); +Object.defineProperty(exports, "ConnectionClosedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionClosedEvent; } }); +Object.defineProperty(exports, "ConnectionCreatedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCreatedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolClearedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolClearedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolClosedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolClosedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolCreatedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolCreatedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolMonitoringEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolMonitoringEvent; } }); +Object.defineProperty(exports, "ConnectionPoolReadyEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolReadyEvent; } }); +Object.defineProperty(exports, "ConnectionReadyEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionReadyEvent; } }); +var events_1 = require("./sdam/events"); +Object.defineProperty(exports, "ServerClosedEvent", { enumerable: true, get: function () { return events_1.ServerClosedEvent; } }); +Object.defineProperty(exports, "ServerDescriptionChangedEvent", { enumerable: true, get: function () { return events_1.ServerDescriptionChangedEvent; } }); +Object.defineProperty(exports, "ServerHeartbeatFailedEvent", { enumerable: true, get: function () { return events_1.ServerHeartbeatFailedEvent; } }); +Object.defineProperty(exports, "ServerHeartbeatStartedEvent", { enumerable: true, get: function () { return events_1.ServerHeartbeatStartedEvent; } }); +Object.defineProperty(exports, "ServerHeartbeatSucceededEvent", { enumerable: true, get: function () { return events_1.ServerHeartbeatSucceededEvent; } }); +Object.defineProperty(exports, "ServerOpeningEvent", { enumerable: true, get: function () { return events_1.ServerOpeningEvent; } }); +Object.defineProperty(exports, "TopologyClosedEvent", { enumerable: true, get: function () { return events_1.TopologyClosedEvent; } }); +Object.defineProperty(exports, "TopologyDescriptionChangedEvent", { enumerable: true, get: function () { return events_1.TopologyDescriptionChangedEvent; } }); +Object.defineProperty(exports, "TopologyOpeningEvent", { enumerable: true, get: function () { return events_1.TopologyOpeningEvent; } }); +var server_selection_events_1 = require("./sdam/server_selection_events"); +Object.defineProperty(exports, "ServerSelectionEvent", { enumerable: true, get: function () { return server_selection_events_1.ServerSelectionEvent; } }); +Object.defineProperty(exports, "ServerSelectionFailedEvent", { enumerable: true, get: function () { return server_selection_events_1.ServerSelectionFailedEvent; } }); +Object.defineProperty(exports, "ServerSelectionStartedEvent", { enumerable: true, get: function () { return server_selection_events_1.ServerSelectionStartedEvent; } }); +Object.defineProperty(exports, "ServerSelectionSucceededEvent", { enumerable: true, get: function () { return server_selection_events_1.ServerSelectionSucceededEvent; } }); +Object.defineProperty(exports, "WaitingForSuitableServerEvent", { enumerable: true, get: function () { return server_selection_events_1.WaitingForSuitableServerEvent; } }); +var srv_polling_1 = require("./sdam/srv_polling"); +Object.defineProperty(exports, "SrvPollingEvent", { enumerable: true, get: function () { return srv_polling_1.SrvPollingEvent; } }); +var errors_1 = require("./client-side-encryption/errors"); +Object.defineProperty(exports, "MongoCryptAzureKMSRequestError", { enumerable: true, get: function () { return errors_1.MongoCryptAzureKMSRequestError; } }); +Object.defineProperty(exports, "MongoCryptCreateDataKeyError", { enumerable: true, get: function () { return errors_1.MongoCryptCreateDataKeyError; } }); +Object.defineProperty(exports, "MongoCryptCreateEncryptedCollectionError", { enumerable: true, get: function () { return errors_1.MongoCryptCreateEncryptedCollectionError; } }); +Object.defineProperty(exports, "MongoCryptError", { enumerable: true, get: function () { return errors_1.MongoCryptError; } }); +Object.defineProperty(exports, "MongoCryptInvalidArgumentError", { enumerable: true, get: function () { return errors_1.MongoCryptInvalidArgumentError; } }); +Object.defineProperty(exports, "MongoCryptKMSRequestNetworkTimeoutError", { enumerable: true, get: function () { return errors_1.MongoCryptKMSRequestNetworkTimeoutError; } }); +var mongo_client_auth_providers_1 = require("./mongo_client_auth_providers"); +Object.defineProperty(exports, "MongoClientAuthProviders", { enumerable: true, get: function () { return mongo_client_auth_providers_1.MongoClientAuthProviders; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js.map new file mode 100644 index 00000000..46e3b90d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AA4F9B,sFA5FO,aAAK,OA4FP;AA3FP,4CAAsD;AAyGpD,qGAzGO,8BAAoB,OAyGP;AAxGtB,gDAA0D;AA0GxD,uGA1GO,kCAAsB,OA0GP;AAzGxB,mDAA+C;AA4F7C,6FA5FO,4BAAY,OA4FP;AA3Fd,6CAA0C;AA6FxC,2FA7FO,uBAAU,OA6FP;AA5FZ,8DAA0D;AAqFxD,+FArFO,gCAAc,OAqFP;AApFhB,oEAAgE;AAuF9D,kGAvFO,sCAAiB,OAuFP;AAtFnB,sDAAkD;AA4FhD,2FA5FO,wBAAU,OA4FP;AA3FZ,8EAAyE;AA+FvE,sGA/FO,+CAAqB,OA+FP;AA9FvB,sEAAiE;AA+F/D,kGA/FO,uCAAiB,OA+FP;AA7FnB,6BAA0B;AAuFxB,mFAvFO,OAAE,OAuFP;AAtFJ,qCAAwC;AAwFtC,6FAxFO,qBAAY,OAwFP;AAvFd,gDAA2D;AAwFzD,uGAxFO,iCAAsB,OAwFP;AAvFxB,4CAA0D;AAwFxD,wGAxFO,gCAAuB,OAwFP;AAvFzB,iDAA6C;AA0F3C,4FA1FO,0BAAW,OA0FP;AAzFb,+CAAkD;AA8EhD,kGA9EO,+BAAiB,OA8EP;AA7EnB,yCAA2C;AA+EzC,8FA/EO,wBAAa,OA+EP;AA7Ef,cAAc;AACd,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,+BAgBgB;AAfd,8FAAA,MAAM,OAAA;AACN,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,gGAAA,QAAQ,OAAA;AACR,4FAAA,IAAI,OAAA;AACJ,6FAAA,KAAK,OAAA;AACL,kGAAA,UAAU,OAAA;AACV,8FAAA,MAAM,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,yBAAyB,OAAA;AACzB,uIAAA,6BAA6B,OAAA;AAC7B,wIAAA,8BAA8B,OAAA;AAC9B,+HAAA,qBAAqB,OAAA;AACrB,gIAAA,sBAAsB,OAAA;AACtB,oIAAA,0BAA0B,OAAA;AAC1B,mIAAA,yBAAyB,OAAA;AACzB,oIAAA,0BAA0B,OAAA;AAC1B,uIAAA,6BAA6B,OAAA;AAC7B,kIAAA,wBAAwB,OAAA;AACxB,8HAAA,oBAAoB,OAAA;AAEtB,wCAUuB;AATrB,2GAAA,iBAAiB,OAAA;AACjB,uHAAA,6BAA6B,OAAA;AAC7B,oHAAA,0BAA0B,OAAA;AAC1B,qHAAA,2BAA2B,OAAA;AAC3B,uHAAA,6BAA6B,OAAA;AAC7B,4GAAA,kBAAkB,OAAA;AAClB,6GAAA,mBAAmB,OAAA;AACnB,yHAAA,+BAA+B,OAAA;AAC/B,8GAAA,oBAAoB,OAAA;AAEtB,0EAMwC;AALtC,+HAAA,oBAAoB,OAAA;AACpB,qIAAA,0BAA0B,OAAA;AAC1B,sIAAA,2BAA2B,OAAA;AAC3B,wIAAA,6BAA6B,OAAA;AAC7B,wIAAA,6BAA6B,OAAA;AAE/B,kDAAqD;AAA5C,8GAAA,eAAe,OAAA;AA0ExB,0DAOyC;AANvC,wHAAA,8BAA8B,OAAA;AAC9B,sHAAA,4BAA4B,OAAA;AAC5B,kIAAA,wCAAwC,OAAA;AACxC,yGAAA,eAAe,OAAA;AACf,wHAAA,8BAA8B,OAAA;AAC9B,iIAAA,uCAAuC,OAAA;AAmKzC,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js new file mode 100644 index 00000000..f3dc8da7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js @@ -0,0 +1,556 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoClient = exports.ServerApiVersion = void 0; +const fs_1 = require("fs"); +const _1 = require("."); +const bson_1 = require("./bson"); +const change_stream_1 = require("./change_stream"); +const mongo_credentials_1 = require("./cmap/auth/mongo_credentials"); +const providers_1 = require("./cmap/auth/providers"); +const client_metadata_1 = require("./cmap/handshake/client_metadata"); +const connection_string_1 = require("./connection_string"); +const constants_1 = require("./constants"); +const db_1 = require("./db"); +const error_1 = require("./error"); +const mongo_client_auth_providers_1 = require("./mongo_client_auth_providers"); +const mongo_logger_1 = require("./mongo_logger"); +const mongo_types_1 = require("./mongo_types"); +const executor_1 = require("./operations/client_bulk_write/executor"); +const end_sessions_1 = require("./operations/end_sessions"); +const execute_operation_1 = require("./operations/execute_operation"); +const read_preference_1 = require("./read_preference"); +const server_selection_1 = require("./sdam/server_selection"); +const topology_1 = require("./sdam/topology"); +const sessions_1 = require("./sessions"); +const utils_1 = require("./utils"); +/** @public */ +exports.ServerApiVersion = Object.freeze({ + v1: '1' +}); +/** + * @public + * + * The **MongoClient** class is a class that allows for making Connections to MongoDB. + * + * **NOTE:** The programmatically provided options take precedence over the URI options. + * + * @remarks + * + * A MongoClient is the entry point to connecting to a MongoDB server. + * + * It handles a multitude of features on your application's behalf: + * - **Server Host Connection Configuration**: A MongoClient is responsible for reading TLS cert, ca, and crl files if provided. + * - **SRV Record Polling**: A "`mongodb+srv`" style connection string is used to have the MongoClient resolve DNS SRV records of all server hostnames which the driver periodically monitors for changes and adjusts its current view of hosts correspondingly. + * - **Server Monitoring**: The MongoClient automatically keeps monitoring the health of server nodes in your cluster to reach out to the correct and lowest latency one available. + * - **Connection Pooling**: To avoid paying the cost of rebuilding a connection to the server on every operation the MongoClient keeps idle connections preserved for reuse. + * - **Session Pooling**: The MongoClient creates logical sessions that enable retryable writes, causal consistency, and transactions. It handles pooling these sessions for reuse in subsequent operations. + * - **Cursor Operations**: A MongoClient's cursors use the health monitoring system to send the request for more documents to the same server the query began on. + * - **Mongocryptd process**: When using auto encryption, a MongoClient will launch a `mongocryptd` instance for handling encryption if the mongocrypt shared library isn't in use. + * + * There are many more features of a MongoClient that are not listed above. + * + * In order to enable these features, a number of asynchronous Node.js resources are established by the driver: Timers, FS Requests, Sockets, etc. + * For details on cleanup, please refer to the MongoClient `close()` documentation. + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * // Enable command monitoring for debugging + * const client = new MongoClient('mongodb://localhost:27017?appName=mflix', { monitorCommands: true }); + * ``` + */ +class MongoClient extends mongo_types_1.TypedEventEmitter { + constructor(url, options) { + super(); + this.driverInfoList = []; + this.on('error', utils_1.noop); + this.options = (0, connection_string_1.parseOptions)(url, this, options); + this.appendMetadata(this.options.driverInfo); + const shouldSetLogger = Object.values(this.options.mongoLoggerOptions.componentSeverities).some(value => value !== mongo_logger_1.SeverityLevel.OFF); + this.mongoLogger = shouldSetLogger + ? new mongo_logger_1.MongoLogger(this.options.mongoLoggerOptions) + : undefined; + // eslint-disable-next-line @typescript-eslint/no-this-alias + const client = this; + // The internal state + this.s = { + url, + bsonOptions: (0, bson_1.resolveBSONOptions)(this.options), + namespace: (0, utils_1.ns)('admin'), + hasBeenClosed: false, + sessionPool: new sessions_1.ServerSessionPool(this), + activeSessions: new Set(), + activeCursors: new Set(), + authProviders: new mongo_client_auth_providers_1.MongoClientAuthProviders(), + get options() { + return client.options; + }, + get readConcern() { + return client.options.readConcern; + }, + get writeConcern() { + return client.options.writeConcern; + }, + get readPreference() { + return client.options.readPreference; + }, + get isMongoClient() { + return true; + } + }; + this.checkForNonGenuineHosts(); + } + /** + * An alias for {@link MongoClient.close|MongoClient.close()}. + */ + async [Symbol.asyncDispose]() { + await this.close(); + } + /** + * Append metadata to the client metadata after instantiation. + * @param driverInfo - Information about the application or library. + */ + appendMetadata(driverInfo) { + const isDuplicateDriverInfo = this.driverInfoList.some(info => (0, client_metadata_1.isDriverInfoEqual)(info, driverInfo)); + if (isDuplicateDriverInfo) + return; + this.driverInfoList.push(driverInfo); + this.options.metadata = (0, client_metadata_1.makeClientMetadata)(this.driverInfoList, this.options) + .then(undefined, utils_1.squashError) + .then(result => result ?? {}); // ensure Promise + } + /** @internal */ + checkForNonGenuineHosts() { + const documentDBHostnames = this.options.hosts.filter((hostAddress) => (0, utils_1.isHostMatch)(utils_1.DOCUMENT_DB_CHECK, hostAddress.host)); + const srvHostIsDocumentDB = (0, utils_1.isHostMatch)(utils_1.DOCUMENT_DB_CHECK, this.options.srvHost); + const cosmosDBHostnames = this.options.hosts.filter((hostAddress) => (0, utils_1.isHostMatch)(utils_1.COSMOS_DB_CHECK, hostAddress.host)); + const srvHostIsCosmosDB = (0, utils_1.isHostMatch)(utils_1.COSMOS_DB_CHECK, this.options.srvHost); + if (documentDBHostnames.length !== 0 || srvHostIsDocumentDB) { + this.mongoLogger?.info('client', utils_1.DOCUMENT_DB_MSG); + } + else if (cosmosDBHostnames.length !== 0 || srvHostIsCosmosDB) { + this.mongoLogger?.info('client', utils_1.COSMOS_DB_MSG); + } + } + get serverApi() { + return this.options.serverApi && Object.freeze({ ...this.options.serverApi }); + } + /** + * Intended for APM use only + * @internal + */ + get monitorCommands() { + return this.options.monitorCommands; + } + set monitorCommands(value) { + this.options.monitorCommands = value; + } + /** @internal */ + get autoEncrypter() { + return this.options.autoEncrypter; + } + get readConcern() { + return this.s.readConcern; + } + get writeConcern() { + return this.s.writeConcern; + } + get readPreference() { + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + get timeoutMS() { + return this.s.options.timeoutMS; + } + /** + * Executes a client bulk write operation, available on server 8.0+. + * @param models - The client bulk write models. + * @param options - The client bulk write options. + * @returns A ClientBulkWriteResult for acknowledged writes and ok: 1 for unacknowledged writes. + */ + async bulkWrite(models, options) { + if (this.autoEncrypter) { + throw new error_1.MongoInvalidArgumentError('MongoClient bulkWrite does not currently support automatic encryption.'); + } + // We do not need schema type information past this point ("as any" is fine) + return await new executor_1.ClientBulkWriteExecutor(this, models, (0, utils_1.resolveOptions)(this, options)).execute(); + } + /** + * An optional method to verify a handful of assumptions that are generally useful at application boot-time before using a MongoClient. + * For detailed information about the connect process see the MongoClient.connect static method documentation. + * + * @param url - The MongoDB connection string (supports `mongodb://` and `mongodb+srv://` schemes) + * @param options - Optional configuration options for the client + * + * @see https://www.mongodb.com/docs/manual/reference/connection-string/ + */ + async connect() { + if (this.connectionLock) { + return await this.connectionLock; + } + try { + this.connectionLock = this._connect(); + await this.connectionLock; + } + finally { + // release + this.connectionLock = undefined; + } + return this; + } + /** + * Create a topology to open the connection, must be locked to avoid topology leaks in concurrency scenario. + * Locking is enforced by the connect method. + * + * @internal + */ + async _connect() { + if (this.topology && this.topology.isConnected()) { + return this; + } + const options = this.options; + if (options.tls) { + if (typeof options.tlsCAFile === 'string') { + options.ca ??= await fs_1.promises.readFile(options.tlsCAFile); + } + if (typeof options.tlsCRLFile === 'string') { + options.crl ??= await fs_1.promises.readFile(options.tlsCRLFile); + } + if (typeof options.tlsCertificateKeyFile === 'string') { + if (!options.key || !options.cert) { + const contents = await fs_1.promises.readFile(options.tlsCertificateKeyFile); + options.key ??= contents; + options.cert ??= contents; + } + } + } + if (typeof options.srvHost === 'string') { + const hosts = await (0, connection_string_1.resolveSRVRecord)(options); + for (const [index, host] of hosts.entries()) { + options.hosts[index] = host; + } + } + // It is important to perform validation of hosts AFTER SRV resolution, to check the real hostname, + // but BEFORE we even attempt connecting with a potentially not allowed hostname + if (options.credentials?.mechanism === providers_1.AuthMechanism.MONGODB_OIDC) { + const allowedHosts = options.credentials?.mechanismProperties?.ALLOWED_HOSTS || mongo_credentials_1.DEFAULT_ALLOWED_HOSTS; + const isServiceAuth = !!options.credentials?.mechanismProperties?.ENVIRONMENT; + if (!isServiceAuth) { + for (const host of options.hosts) { + if (!(0, utils_1.hostMatchesWildcards)(host.toHostPort().host, allowedHosts)) { + throw new error_1.MongoInvalidArgumentError(`Host '${host}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${allowedHosts.join(',')}'`); + } + } + } + } + this.topology = new topology_1.Topology(this, options.hosts, options); + // Events can be emitted before initialization is complete so we have to + // save the reference to the topology on the client ASAP if the event handlers need to access it + this.topology.once(topology_1.Topology.OPEN, () => this.emit('open', this)); + for (const event of constants_1.MONGO_CLIENT_EVENTS) { + this.topology.on(event, (...args) => this.emit(event, ...args)); + } + const topologyConnect = async () => { + try { + await this.topology?.connect(options); + } + catch (error) { + this.topology?.close(); + throw error; + } + }; + if (this.autoEncrypter) { + await this.autoEncrypter?.init(); + await topologyConnect(); + await options.encrypter.connectInternalClient(); + } + else { + await topologyConnect(); + } + return this; + } + /** + * Cleans up resources managed by the MongoClient. + * + * The close method clears and closes all resources whose lifetimes are managed by the MongoClient. + * Please refer to the `MongoClient` class documentation for a high level overview of the client's key features and responsibilities. + * + * **However,** the close method does not handle the cleanup of resources explicitly created by the user. + * Any user-created driver resource with its own `close()` method should be explicitly closed by the user before calling MongoClient.close(). + * This method is written as a "best effort" attempt to leave behind the least amount of resources server-side when possible. + * + * The following list defines ideal preconditions and consequent pitfalls if they are not met. + * The MongoClient, ClientSession, Cursors and ChangeStreams all support [explicit resource management](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html). + * By using explicit resource management to manage the lifetime of driver resources instead of manually managing their lifetimes, the pitfalls outlined below can be avoided. + * + * The close method performs the following in the order listed: + * - Client-side: + * - **Close in-use connections**: Any connections that are currently waiting on a response from the server will be closed. + * This is performed _first_ to avoid reaching the next step (server-side clean up) and having no available connections to check out. + * - _Ideal_: All operations have been awaited or cancelled, and the outcomes, regardless of success or failure, have been processed before closing the client servicing the operation. + * - _Pitfall_: When `client.close()` is called and all connections are in use, after closing them, the client must create new connections for cleanup operations, which comes at the cost of new TLS/TCP handshakes and authentication steps. + * - Server-side: + * - **Close active cursors**: All cursors that haven't been completed will have a `killCursor` operation sent to the server they were initialized on, freeing the server-side resource. + * - _Ideal_: Cursors are explicitly closed or completed before `client.close()` is called. + * - _Pitfall_: `killCursors` may have to build a new connection if the in-use closure ended all pooled connections. + * - **End active sessions**: In-use sessions created with `client.startSession()` or `client.withSession()` or implicitly by the driver will have their `.endSession()` method called. + * Contrary to the name of the method, `endSession()` returns the session to the client's pool of sessions rather than end them on the server. + * - _Ideal_: Transaction outcomes are awaited and their corresponding explicit sessions are ended before `client.close()` is called. + * - _Pitfall_: **This step aborts in-progress transactions**. It is advisable to observe the outcome of a transaction before closing your client. + * - **End all pooled sessions**: The `endSessions` command with all session IDs the client has pooled is sent to the server to inform the cluster it can clean them up. + * - _Ideal_: No user intervention is expected. + * - _Pitfall_: None. + * + * The remaining shutdown is of the MongoClient resources that are intended to be entirely internal but is documented here as their existence relates to the JS event loop. + * + * - Client-side (again): + * - **Stop all server monitoring**: Connections kept live for detecting cluster changes and roundtrip time measurements are shutdown. + * - **Close all pooled connections**: Each server node in the cluster has a corresponding connection pool and all connections in the pool are closed. Any operations waiting to check out a connection will have an error thrown instead of a connection returned. + * - **Clear out server selection queue**: Any operations that are in the process of waiting for a server to be selected will have an error thrown instead of a server returned. + * - **Close encryption-related resources**: An internal MongoClient created for communicating with `mongocryptd` or other encryption purposes is closed. (Using this same method of course!) + * + * After the close method completes there should be no MongoClient related resources [ref-ed in Node.js' event loop](https://docs.libuv.org/en/v1.x/handle.html#reference-counting). + * This should allow Node.js to exit gracefully if MongoClient resources were the only active handles in the event loop. + * + * @param _force - currently an unused flag that has no effect. Defaults to `false`. + */ + async close(_force = false) { + if (this.closeLock) { + return await this.closeLock; + } + try { + this.closeLock = this._close(); + await this.closeLock; + } + finally { + // release + this.closeLock = undefined; + } + } + /* @internal */ + async _close() { + // There's no way to set hasBeenClosed back to false + Object.defineProperty(this.s, 'hasBeenClosed', { + value: true, + enumerable: true, + configurable: false, + writable: false + }); + this.topology?.closeCheckedOutConnections(); + const activeCursorCloses = Array.from(this.s.activeCursors, cursor => cursor.close()); + this.s.activeCursors.clear(); + await Promise.all(activeCursorCloses); + const activeSessionEnds = Array.from(this.s.activeSessions, session => session.endSession()); + this.s.activeSessions.clear(); + await Promise.all(activeSessionEnds); + if (this.topology == null) { + return; + } + const supportsSessions = this.topology.description.type === _1.TopologyType.LoadBalanced || + this.topology.description.logicalSessionTimeoutMinutes != null; + if (supportsSessions) { + await endSessions(this, this.topology); + } + // clear out references to old topology + const topology = this.topology; + this.topology = undefined; + topology.close(); + const { encrypter } = this.options; + if (encrypter) { + await encrypter.close(this); + } + async function endSessions(client, { description: topologyDescription }) { + // If we would attempt to select a server and get nothing back we short circuit + // to avoid the server selection timeout. + const selector = (0, server_selection_1.readPreferenceServerSelector)(read_preference_1.ReadPreference.primaryPreferred); + const serverDescriptions = Array.from(topologyDescription.servers.values()); + const servers = selector(topologyDescription, serverDescriptions, new server_selection_1.DeprioritizedServers()); + if (servers.length !== 0) { + const endSessions = Array.from(client.s.sessionPool.sessions, ({ id }) => id); + if (endSessions.length !== 0) { + try { + await (0, execute_operation_1.executeOperation)(client, new end_sessions_1.EndSessionsOperation(endSessions)); + } + catch (error) { + (0, utils_1.squashError)(error); + } + } + } + } + } + /** + * Create a new Db instance sharing the current socket connections. + * + * @param dbName - The name of the database we want to use. If not provided, use database name from connection string. + * @param options - Optional settings for Db construction + */ + db(dbName, options) { + options = options ?? {}; + // Default to db from connection string if not provided + if (!dbName) { + dbName = this.s.options.dbName; + } + // Copy the options and add out internal override of the not shared flag + const finalOptions = Object.assign({}, this.options, options); + // Return the db object + const db = new db_1.Db(this, dbName, finalOptions); + // Return the database + return db; + } + /** + * Creates a new MongoClient instance and immediately connects it to MongoDB. + * This convenience method combines `new MongoClient(url, options)` and `client.connect()` in a single step. + * + * Connect can be helpful to detect configuration issues early by validating: + * - **DNS Resolution**: Verifies that SRV records and hostnames in the connection string resolve DNS entries + * - **Network Connectivity**: Confirms that host addresses are reachable and ports are open + * - **TLS Configuration**: Validates SSL/TLS certificates, CA files, and encryption settings are correct + * - **Authentication**: Verifies that provided credentials are valid + * - **Server Compatibility**: Ensures the MongoDB server version is supported by this driver version + * - **Load Balancer Setup**: For load-balanced deployments, confirms the service is properly configured + * + * @returns A promise that resolves to the same MongoClient instance once connected + * + * @remarks + * **Connection is Optional:** Calling `connect` is optional since any operation method (`find`, `insertOne`, etc.) + * will automatically perform these same validation steps if the client is not already connected. + * However, explicitly calling `connect` can make sense for: + * - **Fail-fast Error Detection**: Non-transient connection issues (hostname unresolved, port refused connection) are discovered immediately rather than during your first operation + * - **Predictable Performance**: Eliminates first connection overhead from your first database operation + * + * @remarks + * **Connection Pooling Impact:** Calling `connect` will populate the connection pool with one connection + * to a server selected by the client's configured `readPreference` (defaults to primary). + * + * @remarks + * **Timeout Behavior:** When using `timeoutMS`, the connection establishment time does not count against + * the timeout for subsequent operations. This means `connect` runs without a `timeoutMS` limit, while + * your database operations will still respect the configured timeout. If you need predictable operation + * timing with `timeoutMS`, call `connect` explicitly before performing operations. + * + * @see https://www.mongodb.com/docs/manual/reference/connection-string/ + */ + static async connect(url, options) { + const client = new this(url, options); + return await client.connect(); + } + /** + * Creates a new ClientSession. When using the returned session in an operation + * a corresponding ServerSession will be created. + * + * @remarks + * A ClientSession instance may only be passed to operations being performed on the same + * MongoClient it was started from. + */ + startSession(options) { + const session = new sessions_1.ClientSession(this, this.s.sessionPool, { explicit: true, ...options }, this.options); + this.s.activeSessions.add(session); + session.once('ended', () => { + this.s.activeSessions.delete(session); + }); + return session; + } + async withSession(optionsOrExecutor, executor) { + const options = { + // Always define an owner + owner: Symbol(), + // If it's an object inherit the options + ...(typeof optionsOrExecutor === 'object' ? optionsOrExecutor : {}) + }; + const withSessionCallback = typeof optionsOrExecutor === 'function' ? optionsOrExecutor : executor; + if (withSessionCallback == null) { + throw new error_1.MongoInvalidArgumentError('Missing required callback parameter'); + } + const session = this.startSession(options); + try { + return await withSessionCallback(session); + } + finally { + try { + await session.endSession(); + } + catch (error) { + (0, utils_1.squashError)(error); + } + } + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this cluster. Will ignore all + * changes to system collections, as well as the local, admin, and config databases. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the data within the current cluster + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } +} +exports.MongoClient = MongoClient; +//# sourceMappingURL=mongo_client.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js.map new file mode 100644 index 00000000..0c1cd2c8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongo_client.js","sourceRoot":"","sources":["../src/mongo_client.ts"],"names":[],"mappings":";;;AAAA,2BAAoC;AAIpC,wBAAiC;AACjC,iCAAsF;AACtF,mDAAoG;AAEpG,qEAIuC;AAEvC,qDAAsD;AAGtD,sEAI0C;AAE1C,2DAAqE;AACrE,2CAAkD;AAElD,6BAA0C;AAE1C,mCAAoD;AACpD,+EAAyE;AACzE,iDAMwB;AACxB,+CAAkD;AAMlD,sEAAkF;AAClF,4DAAiE;AACjE,sEAAkE;AAElE,uDAA4E;AAI5E,8DAA6F;AAE7F,8CAAgE;AAChE,yCAAyF;AACzF,mCAaiB;AAGjB,cAAc;AACD,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,GAAG;CACC,CAAC,CAAC;AAoTZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAa,WAAY,SAAQ,+BAAoC;IAyBnE,YAAY,GAAW,EAAE,OAA4B;QACnD,KAAK,EAAE,CAAC;QAHF,mBAAc,GAAiB,EAAE,CAAC;QAIxC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,YAAI,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AE,UAA+B,EAAE;QAC5D,6CAA6C;QAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,QAAQ,CAAC;YACnB,QAAQ,GAAG,EAAE,CAAC;QAChB,CAAC;QAED,OAAO,IAAI,4BAAY,CAAmB,IAAI,EAAE,QAAQ,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3F,CAAC;CACF;AA3mBD,kCA2mBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js new file mode 100644 index 00000000..55b3cb6b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoClientAuthProviders = void 0; +const gssapi_1 = require("./cmap/auth/gssapi"); +const mongodb_aws_1 = require("./cmap/auth/mongodb_aws"); +const mongodb_oidc_1 = require("./cmap/auth/mongodb_oidc"); +const automated_callback_workflow_1 = require("./cmap/auth/mongodb_oidc/automated_callback_workflow"); +const human_callback_workflow_1 = require("./cmap/auth/mongodb_oidc/human_callback_workflow"); +const token_cache_1 = require("./cmap/auth/mongodb_oidc/token_cache"); +const plain_1 = require("./cmap/auth/plain"); +const providers_1 = require("./cmap/auth/providers"); +const scram_1 = require("./cmap/auth/scram"); +const x509_1 = require("./cmap/auth/x509"); +const error_1 = require("./error"); +/** @internal */ +const AUTH_PROVIDERS = new Map([ + [ + providers_1.AuthMechanism.MONGODB_AWS, + ({ AWS_CREDENTIAL_PROVIDER }) => new mongodb_aws_1.MongoDBAWS(AWS_CREDENTIAL_PROVIDER) + ], + [providers_1.AuthMechanism.MONGODB_GSSAPI, () => new gssapi_1.GSSAPI()], + [providers_1.AuthMechanism.MONGODB_OIDC, properties => new mongodb_oidc_1.MongoDBOIDC(getWorkflow(properties))], + [providers_1.AuthMechanism.MONGODB_PLAIN, () => new plain_1.Plain()], + [providers_1.AuthMechanism.MONGODB_SCRAM_SHA1, () => new scram_1.ScramSHA1()], + [providers_1.AuthMechanism.MONGODB_SCRAM_SHA256, () => new scram_1.ScramSHA256()], + [providers_1.AuthMechanism.MONGODB_X509, () => new x509_1.X509()] +]); +/** + * Create a set of providers per client + * to avoid sharing the provider's cache between different clients. + * @internal + */ +class MongoClientAuthProviders { + constructor() { + this.existingProviders = new Map(); + } + /** + * Get or create an authentication provider based on the provided mechanism. + * We don't want to create all providers at once, as some providers may not be used. + * @param name - The name of the provider to get or create. + * @param credentials - The credentials. + * @returns The provider. + * @throws MongoInvalidArgumentError if the mechanism is not supported. + * @internal + */ + getOrCreateProvider(name, authMechanismProperties) { + const authProvider = this.existingProviders.get(name); + if (authProvider) { + return authProvider; + } + const providerFunction = AUTH_PROVIDERS.get(name); + if (!providerFunction) { + throw new error_1.MongoInvalidArgumentError(`authMechanism ${name} not supported`); + } + const provider = providerFunction(authMechanismProperties); + this.existingProviders.set(name, provider); + return provider; + } +} +exports.MongoClientAuthProviders = MongoClientAuthProviders; +/** + * Gets either a device workflow or callback workflow. + */ +function getWorkflow(authMechanismProperties) { + if (authMechanismProperties.OIDC_HUMAN_CALLBACK) { + return new human_callback_workflow_1.HumanCallbackWorkflow(new token_cache_1.TokenCache(), authMechanismProperties.OIDC_HUMAN_CALLBACK); + } + else if (authMechanismProperties.OIDC_CALLBACK) { + return new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), authMechanismProperties.OIDC_CALLBACK); + } + else { + const environment = authMechanismProperties.ENVIRONMENT; + const workflow = mongodb_oidc_1.OIDC_WORKFLOWS.get(environment)?.(); + if (!workflow) { + throw new error_1.MongoInvalidArgumentError(`Could not load workflow for environment ${authMechanismProperties.ENVIRONMENT}`); + } + return workflow; + } +} +//# sourceMappingURL=mongo_client_auth_providers.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js.map new file mode 100644 index 00000000..2b43927f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_client_auth_providers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongo_client_auth_providers.js","sourceRoot":"","sources":["../src/mongo_client_auth_providers.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C,yDAAqD;AACrD,2DAAsF;AACtF,sGAAiG;AACjG,8FAAyF;AACzF,sEAAkE;AAClE,6CAA0C;AAC1C,qDAAsD;AACtD,6CAA2D;AAC3D,2CAAwC;AACxC,mCAAoD;AAEpD,gBAAgB;AAChB,MAAM,cAAc,GAAG,IAAI,GAAG,CAG5B;IACA;QACE,yBAAa,CAAC,WAAW;QACzB,CAAC,EAAE,uBAAuB,EAAE,EAAE,EAAE,CAAC,IAAI,wBAAU,CAAC,uBAAuB,CAAC;KACzE;IACD,CAAC,yBAAa,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,eAAM,EAAE,CAAC;IAClD,CAAC,yBAAa,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,0BAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;IACpF,CAAC,yBAAa,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,aAAK,EAAE,CAAC;IAChD,CAAC,yBAAa,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI,iBAAS,EAAE,CAAC;IACzD,CAAC,yBAAa,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,IAAI,mBAAW,EAAE,CAAC;IAC7D,CAAC,yBAAa,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,IA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AC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,iCAAyB,CACjC,2CAA2C,uBAAuB,CAAC,WAAW,EAAE,CACjF,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js new file mode 100644 index 00000000..dd20d0dc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js @@ -0,0 +1,655 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoLogger = exports.MongoLoggableComponent = exports.SEVERITY_LEVEL_MAP = exports.DEFAULT_MAX_DOCUMENT_LENGTH = exports.SeverityLevel = void 0; +exports.parseSeverityFromString = parseSeverityFromString; +exports.createStdioLogger = createStdioLogger; +exports.stringifyWithMaxLen = stringifyWithMaxLen; +exports.defaultLogTransform = defaultLogTransform; +const process = require("process"); +const util_1 = require("util"); +const bson_1 = require("./bson"); +const constants_1 = require("./constants"); +const utils_1 = require("./utils"); +/** + * @public + * Severity levels align with unix syslog. + * Most typical driver functions will log to debug. + */ +exports.SeverityLevel = Object.freeze({ + EMERGENCY: 'emergency', + ALERT: 'alert', + CRITICAL: 'critical', + ERROR: 'error', + WARNING: 'warn', + NOTICE: 'notice', + INFORMATIONAL: 'info', + DEBUG: 'debug', + TRACE: 'trace', + OFF: 'off' +}); +/** @internal */ +exports.DEFAULT_MAX_DOCUMENT_LENGTH = 1000; +/** @internal */ +class SeverityLevelMap extends Map { + constructor(entries) { + const newEntries = []; + for (const [level, value] of entries) { + newEntries.push([value, level]); + } + newEntries.push(...entries); + super(newEntries); + } + getNumericSeverityLevel(severity) { + return this.get(severity); + } + getSeverityLevelName(level) { + return this.get(level); + } +} +/** @internal */ +exports.SEVERITY_LEVEL_MAP = new SeverityLevelMap([ + [exports.SeverityLevel.OFF, -Infinity], + [exports.SeverityLevel.EMERGENCY, 0], + [exports.SeverityLevel.ALERT, 1], + [exports.SeverityLevel.CRITICAL, 2], + [exports.SeverityLevel.ERROR, 3], + [exports.SeverityLevel.WARNING, 4], + [exports.SeverityLevel.NOTICE, 5], + [exports.SeverityLevel.INFORMATIONAL, 6], + [exports.SeverityLevel.DEBUG, 7], + [exports.SeverityLevel.TRACE, 8] +]); +/** @public */ +exports.MongoLoggableComponent = Object.freeze({ + COMMAND: 'command', + TOPOLOGY: 'topology', + SERVER_SELECTION: 'serverSelection', + CONNECTION: 'connection', + CLIENT: 'client' +}); +/** + * Parses a string as one of SeverityLevel + * @internal + * + * @param s - the value to be parsed + * @returns one of SeverityLevel if value can be parsed as such, otherwise null + */ +function parseSeverityFromString(s) { + const validSeverities = Object.values(exports.SeverityLevel); + const lowerSeverity = s?.toLowerCase(); + if (lowerSeverity != null && validSeverities.includes(lowerSeverity)) { + return lowerSeverity; + } + return null; +} +/** @internal */ +function createStdioLogger(stream) { + return { + write: (log) => { + return new Promise((resolve, reject) => { + const logLine = (0, util_1.inspect)(log, { compact: true, breakLength: Infinity }); + stream.write(`${logLine}\n`, 'utf-8', error => { + if (error) + return reject(error); + resolve(true); + }); + }); + } + }; +} +/** + * resolves the MONGODB_LOG_PATH and mongodbLogPath options from the environment and the + * mongo client options respectively. The mongodbLogPath can be either 'stdout', 'stderr', a NodeJS + * Writable or an object which has a `write` method with the signature: + * ```ts + * write(log: Log): void + * ``` + * + * @returns the MongoDBLogWritable object to write logs to + */ +function resolveLogPath({ MONGODB_LOG_PATH }, { mongodbLogPath }) { + if (typeof mongodbLogPath === 'string' && /^stderr$/i.test(mongodbLogPath)) { + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; + } + if (typeof mongodbLogPath === 'string' && /^stdout$/i.test(mongodbLogPath)) { + return { mongodbLogPath: createStdioLogger(process.stdout), mongodbLogPathIsStdErr: false }; + } + if (typeof mongodbLogPath === 'object' && typeof mongodbLogPath?.write === 'function') { + return { mongodbLogPath: mongodbLogPath, mongodbLogPathIsStdErr: false }; + } + if (MONGODB_LOG_PATH && /^stderr$/i.test(MONGODB_LOG_PATH)) { + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; + } + if (MONGODB_LOG_PATH && /^stdout$/i.test(MONGODB_LOG_PATH)) { + return { mongodbLogPath: createStdioLogger(process.stdout), mongodbLogPathIsStdErr: false }; + } + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; +} +function resolveSeverityConfiguration(clientOption, environmentOption, defaultSeverity) { + return (parseSeverityFromString(clientOption) ?? + parseSeverityFromString(environmentOption) ?? + defaultSeverity); +} +function compareSeverity(s0, s1) { + const s0Num = exports.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(s0); + const s1Num = exports.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(s1); + return s0Num < s1Num ? -1 : s0Num > s1Num ? 1 : 0; +} +/** @internal */ +function stringifyWithMaxLen(value, maxDocumentLength, options = {}) { + let strToTruncate = ''; + let currentLength = 0; + const maxDocumentLengthEnsurer = function maxDocumentLengthEnsurer(key, value) { + if (currentLength >= maxDocumentLength) { + return undefined; + } + // Account for root document + if (key === '') { + // Account for starting brace + currentLength += 1; + return value; + } + // +4 accounts for 2 quotation marks, colon and comma after value + // Note that this potentially undercounts since it does not account for escape sequences which + // will have an additional backslash added to them once passed through JSON.stringify. + currentLength += key.length + 4; + if (value == null) + return value; + switch (typeof value) { + case 'string': + // +2 accounts for quotes + // Note that this potentially undercounts similarly to the key length calculation + currentLength += value.length + 2; + break; + case 'number': + case 'bigint': + currentLength += String(value).length; + break; + case 'boolean': + currentLength += value ? 4 : 5; + break; + case 'object': + if ((0, utils_1.isUint8Array)(value)) { + // '{"$binary":{"base64":"","subType":"XX"}}' + // This is an estimate based on the fact that the base64 is approximately 1.33x the length of + // the actual binary sequence https://en.wikipedia.org/wiki/Base64 + currentLength += (22 + value.byteLength + value.byteLength * 0.33 + 18) | 0; + } + else if ('_bsontype' in value) { + const v = value; + switch (v._bsontype) { + case 'Int32': + currentLength += String(v.value).length; + break; + case 'Double': + // Account for representing integers as .0 + currentLength += + (v.value | 0) === v.value ? String(v.value).length + 2 : String(v.value).length; + break; + case 'Long': + currentLength += v.toString().length; + break; + case 'ObjectId': + // '{"$oid":"XXXXXXXXXXXXXXXXXXXXXXXX"}' + currentLength += 35; + break; + case 'MaxKey': + case 'MinKey': + // '{"$maxKey":1}' or '{"$minKey":1}' + currentLength += 13; + break; + case 'Binary': + // '{"$binary":{"base64":"","subType":"XX"}}' + // This is an estimate based on the fact that the base64 is approximately 1.33x the length of + // the actual binary sequence https://en.wikipedia.org/wiki/Base64 + currentLength += (22 + value.position + value.position * 0.33 + 18) | 0; + break; + case 'Timestamp': + // '{"$timestamp":{"t":,"i":}}' + currentLength += 19 + String(v.t).length + 5 + String(v.i).length + 2; + break; + case 'Code': + // '{"$code":""}' or '{"$code":"","$scope":}' + if (v.scope == null) { + currentLength += v.code.length + 10 + 2; + } + else { + // Ignoring actual scope object, so this undercounts by a significant amount + currentLength += v.code.length + 10 + 11; + } + break; + case 'BSONRegExp': + // '{"$regularExpression":{"pattern":"","options":""}}' + currentLength += 34 + v.pattern.length + 13 + v.options.length + 3; + break; + } + } + } + return value; + }; + if (typeof value === 'string') { + strToTruncate = value; + } + else if (typeof value === 'function') { + strToTruncate = value.name; + } + else { + try { + if (maxDocumentLength !== 0) { + strToTruncate = bson_1.EJSON.stringify(value, maxDocumentLengthEnsurer, 0, options); + } + else { + strToTruncate = bson_1.EJSON.stringify(value, options); + } + } + catch (e) { + strToTruncate = `Extended JSON serialization failed with: ${e.message}`; + } + } + // handle truncation that occurs in the middle of multi-byte codepoints + if (maxDocumentLength !== 0 && + strToTruncate.length > maxDocumentLength && + strToTruncate.charCodeAt(maxDocumentLength - 1) !== + strToTruncate.codePointAt(maxDocumentLength - 1)) { + maxDocumentLength--; + if (maxDocumentLength === 0) { + return ''; + } + } + return maxDocumentLength !== 0 && strToTruncate.length > maxDocumentLength + ? `${strToTruncate.slice(0, maxDocumentLength)}...` + : strToTruncate; +} +function isLogConvertible(obj) { + const objAsLogConvertible = obj; + // eslint-disable-next-line no-restricted-syntax + return objAsLogConvertible.toLog !== undefined && typeof objAsLogConvertible.toLog === 'function'; +} +function attachServerSelectionFields(log, serverSelectionEvent, maxDocumentLength = exports.DEFAULT_MAX_DOCUMENT_LENGTH) { + const { selector, operation, topologyDescription, message } = serverSelectionEvent; + log.selector = stringifyWithMaxLen(selector, maxDocumentLength); + log.operation = operation; + log.topologyDescription = stringifyWithMaxLen(topologyDescription, maxDocumentLength); + log.message = message; + return log; +} +function attachCommandFields(log, commandEvent) { + log.commandName = commandEvent.commandName; + log.requestId = commandEvent.requestId; + log.driverConnectionId = commandEvent.connectionId; + const { host, port } = utils_1.HostAddress.fromString(commandEvent.address).toHostPort(); + log.serverHost = host; + log.serverPort = port; + if (commandEvent?.serviceId) { + log.serviceId = commandEvent.serviceId.toHexString(); + } + log.databaseName = commandEvent.databaseName; + log.serverConnectionId = commandEvent.serverConnectionId; + return log; +} +function attachConnectionFields(log, event) { + const { host, port } = utils_1.HostAddress.fromString(event.address).toHostPort(); + log.serverHost = host; + log.serverPort = port; + return log; +} +function attachSDAMFields(log, sdamEvent) { + log.topologyId = sdamEvent.topologyId; + return log; +} +function attachServerHeartbeatFields(log, serverHeartbeatEvent) { + const { awaited, connectionId } = serverHeartbeatEvent; + log.awaited = awaited; + log.driverConnectionId = serverHeartbeatEvent.connectionId; + const { host, port } = utils_1.HostAddress.fromString(connectionId).toHostPort(); + log.serverHost = host; + log.serverPort = port; + return log; +} +/** @internal */ +function defaultLogTransform(logObject, maxDocumentLength = exports.DEFAULT_MAX_DOCUMENT_LENGTH) { + let log = Object.create(null); + switch (logObject.name) { + case constants_1.SERVER_SELECTION_STARTED: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + return log; + case constants_1.SERVER_SELECTION_FAILED: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + log.failure = logObject.failure?.message; + return log; + case constants_1.SERVER_SELECTION_SUCCEEDED: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + log.serverHost = logObject.serverHost; + log.serverPort = logObject.serverPort; + return log; + case constants_1.WAITING_FOR_SUITABLE_SERVER: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + log.remainingTimeMS = logObject.remainingTimeMS; + return log; + case constants_1.COMMAND_STARTED: + log = attachCommandFields(log, logObject); + log.message = 'Command started'; + log.command = stringifyWithMaxLen(logObject.command, maxDocumentLength, { relaxed: true }); + log.databaseName = logObject.databaseName; + return log; + case constants_1.COMMAND_SUCCEEDED: + log = attachCommandFields(log, logObject); + log.message = 'Command succeeded'; + log.durationMS = logObject.duration; + log.reply = stringifyWithMaxLen(logObject.reply, maxDocumentLength, { relaxed: true }); + return log; + case constants_1.COMMAND_FAILED: + log = attachCommandFields(log, logObject); + log.message = 'Command failed'; + log.durationMS = logObject.duration; + log.failure = logObject.failure?.message ?? '(redacted)'; + return log; + case constants_1.CONNECTION_POOL_CREATED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool created'; + if (logObject.options) { + const { maxIdleTimeMS, minPoolSize, maxPoolSize, maxConnecting, waitQueueTimeoutMS } = logObject.options; + log = { + ...log, + maxIdleTimeMS, + minPoolSize, + maxPoolSize, + maxConnecting, + waitQueueTimeoutMS + }; + } + return log; + case constants_1.CONNECTION_POOL_READY: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool ready'; + return log; + case constants_1.CONNECTION_POOL_CLEARED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool cleared'; + if (logObject.serviceId?._bsontype === 'ObjectId') { + log.serviceId = logObject.serviceId?.toHexString(); + } + return log; + case constants_1.CONNECTION_POOL_CLOSED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool closed'; + return log; + case constants_1.CONNECTION_CREATED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection created'; + log.driverConnectionId = logObject.connectionId; + return log; + case constants_1.CONNECTION_READY: + log = attachConnectionFields(log, logObject); + log.message = 'Connection ready'; + log.driverConnectionId = logObject.connectionId; + log.durationMS = logObject.durationMS; + return log; + case constants_1.CONNECTION_CLOSED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection closed'; + log.driverConnectionId = logObject.connectionId; + switch (logObject.reason) { + case 'stale': + log.reason = 'Connection became stale because the pool was cleared'; + break; + case 'idle': + log.reason = + 'Connection has been available but unused for longer than the configured max idle time'; + break; + case 'error': + log.reason = 'An error occurred while using the connection'; + if (logObject.error) { + log.error = logObject.error; + } + break; + case 'poolClosed': + log.reason = 'Connection pool was closed'; + break; + default: + log.reason = `Unknown close reason: ${logObject.reason}`; + } + return log; + case constants_1.CONNECTION_CHECK_OUT_STARTED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checkout started'; + return log; + case constants_1.CONNECTION_CHECK_OUT_FAILED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checkout failed'; + switch (logObject.reason) { + case 'poolClosed': + log.reason = 'Connection pool was closed'; + break; + case 'timeout': + log.reason = 'Wait queue timeout elapsed without a connection becoming available'; + break; + case 'connectionError': + log.reason = 'An error occurred while trying to establish a new connection'; + if (logObject.error) { + log.error = logObject.error; + } + break; + default: + log.reason = `Unknown close reason: ${logObject.reason}`; + } + log.durationMS = logObject.durationMS; + return log; + case constants_1.CONNECTION_CHECKED_OUT: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checked out'; + log.driverConnectionId = logObject.connectionId; + log.durationMS = logObject.durationMS; + return log; + case constants_1.CONNECTION_CHECKED_IN: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checked in'; + log.driverConnectionId = logObject.connectionId; + return log; + case constants_1.SERVER_OPENING: + log = attachSDAMFields(log, logObject); + log = attachConnectionFields(log, logObject); + log.message = 'Starting server monitoring'; + return log; + case constants_1.SERVER_CLOSED: + log = attachSDAMFields(log, logObject); + log = attachConnectionFields(log, logObject); + log.message = 'Stopped server monitoring'; + return log; + case constants_1.SERVER_HEARTBEAT_STARTED: + log = attachSDAMFields(log, logObject); + log = attachServerHeartbeatFields(log, logObject); + log.message = 'Server heartbeat started'; + return log; + case constants_1.SERVER_HEARTBEAT_SUCCEEDED: + log = attachSDAMFields(log, logObject); + log = attachServerHeartbeatFields(log, logObject); + log.message = 'Server heartbeat succeeded'; + log.durationMS = logObject.duration; + log.serverConnectionId = logObject.serverConnectionId; + log.reply = stringifyWithMaxLen(logObject.reply, maxDocumentLength, { relaxed: true }); + return log; + case constants_1.SERVER_HEARTBEAT_FAILED: + log = attachSDAMFields(log, logObject); + log = attachServerHeartbeatFields(log, logObject); + log.message = 'Server heartbeat failed'; + log.durationMS = logObject.duration; + log.failure = logObject.failure?.message; + return log; + case constants_1.TOPOLOGY_OPENING: + log = attachSDAMFields(log, logObject); + log.message = 'Starting topology monitoring'; + return log; + case constants_1.TOPOLOGY_CLOSED: + log = attachSDAMFields(log, logObject); + log.message = 'Stopped topology monitoring'; + return log; + case constants_1.TOPOLOGY_DESCRIPTION_CHANGED: + log = attachSDAMFields(log, logObject); + log.message = 'Topology description changed'; + log.previousDescription = log.reply = stringifyWithMaxLen(logObject.previousDescription, maxDocumentLength); + log.newDescription = log.reply = stringifyWithMaxLen(logObject.newDescription, maxDocumentLength); + return log; + default: + for (const [key, value] of Object.entries(logObject)) { + if (value != null) + log[key] = value; + } + } + return log; +} +/** @internal */ +class MongoLogger { + constructor(options) { + this.pendingLog = null; + /** + * This method should be used when logging errors that do not have a public driver API for + * reporting errors. + */ + this.error = this.log.bind(this, 'error'); + /** + * This method should be used to log situations where undesirable application behaviour might + * occur. For example, failing to end sessions on `MongoClient.close`. + */ + this.warn = this.log.bind(this, 'warn'); + /** + * This method should be used to report high-level information about normal driver behaviour. + * For example, the creation of a `MongoClient`. + */ + this.info = this.log.bind(this, 'info'); + /** + * This method should be used to report information that would be helpful when debugging an + * application. For example, a command starting, succeeding or failing. + */ + this.debug = this.log.bind(this, 'debug'); + /** + * This method should be used to report fine-grained details related to logic flow. For example, + * entering and exiting a function body. + */ + this.trace = this.log.bind(this, 'trace'); + this.componentSeverities = options.componentSeverities; + this.maxDocumentLength = options.maxDocumentLength; + this.logDestination = options.logDestination; + this.logDestinationIsStdErr = options.logDestinationIsStdErr; + this.severities = this.createLoggingSeverities(); + } + createLoggingSeverities() { + const severities = Object(); + for (const component of Object.values(exports.MongoLoggableComponent)) { + severities[component] = {}; + for (const severityLevel of Object.values(exports.SeverityLevel)) { + severities[component][severityLevel] = + compareSeverity(severityLevel, this.componentSeverities[component]) <= 0; + } + } + return severities; + } + turnOffSeverities() { + for (const component of Object.values(exports.MongoLoggableComponent)) { + this.componentSeverities[component] = exports.SeverityLevel.OFF; + for (const severityLevel of Object.values(exports.SeverityLevel)) { + this.severities[component][severityLevel] = false; + } + } + } + logWriteFailureHandler(error) { + if (this.logDestinationIsStdErr) { + this.turnOffSeverities(); + this.clearPendingLog(); + return; + } + this.logDestination = createStdioLogger(process.stderr); + this.logDestinationIsStdErr = true; + this.clearPendingLog(); + this.error(exports.MongoLoggableComponent.CLIENT, { + toLog: function () { + return { + message: 'User input for mongodbLogPath is now invalid. Logging is halted.', + error: error.message + }; + } + }); + this.turnOffSeverities(); + this.clearPendingLog(); + } + clearPendingLog() { + this.pendingLog = null; + } + willLog(component, severity) { + if (severity === exports.SeverityLevel.OFF) + return false; + return this.severities[component][severity]; + } + log(severity, component, message) { + if (!this.willLog(component, severity)) + return; + let logMessage = { t: new Date(), c: component, s: severity }; + if (typeof message === 'string') { + logMessage.message = message; + } + else if (typeof message === 'object') { + if (isLogConvertible(message)) { + logMessage = { ...logMessage, ...message.toLog() }; + } + else { + logMessage = { ...logMessage, ...defaultLogTransform(message, this.maxDocumentLength) }; + } + } + if ((0, utils_1.isPromiseLike)(this.pendingLog)) { + this.pendingLog = this.pendingLog + .then(() => this.logDestination.write(logMessage)) + .then(this.clearPendingLog.bind(this), this.logWriteFailureHandler.bind(this)); + return; + } + try { + const logResult = this.logDestination.write(logMessage); + if ((0, utils_1.isPromiseLike)(logResult)) { + this.pendingLog = logResult.then(this.clearPendingLog.bind(this), this.logWriteFailureHandler.bind(this)); + } + } + catch (error) { + this.logWriteFailureHandler(error); + } + } + /** + * Merges options set through environment variables and the MongoClient, preferring environment + * variables when both are set, and substituting defaults for values not set. Options set in + * constructor take precedence over both environment variables and MongoClient options. + * + * @remarks + * When parsing component severity levels, invalid values are treated as unset and replaced with + * the default severity. + * + * @param envOptions - options set for the logger from the environment + * @param clientOptions - options set for the logger in the MongoClient options + * @returns a MongoLoggerOptions object to be used when instantiating a new MongoLogger + */ + static resolveOptions(envOptions, clientOptions) { + // client options take precedence over env options + const resolvedLogPath = resolveLogPath(envOptions, clientOptions); + const combinedOptions = { + ...envOptions, + ...clientOptions, + mongodbLogPath: resolvedLogPath.mongodbLogPath, + mongodbLogPathIsStdErr: resolvedLogPath.mongodbLogPathIsStdErr + }; + const defaultSeverity = resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.default, combinedOptions.MONGODB_LOG_ALL, exports.SeverityLevel.OFF); + return { + componentSeverities: { + command: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.command, combinedOptions.MONGODB_LOG_COMMAND, defaultSeverity), + topology: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.topology, combinedOptions.MONGODB_LOG_TOPOLOGY, defaultSeverity), + serverSelection: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.serverSelection, combinedOptions.MONGODB_LOG_SERVER_SELECTION, defaultSeverity), + connection: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.connection, combinedOptions.MONGODB_LOG_CONNECTION, defaultSeverity), + client: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.client, combinedOptions.MONGODB_LOG_CLIENT, defaultSeverity), + default: defaultSeverity + }, + maxDocumentLength: combinedOptions.mongodbLogMaxDocumentLength ?? + (0, utils_1.parseUnsignedInteger)(combinedOptions.MONGODB_LOG_MAX_DOCUMENT_LENGTH) ?? + 1000, + logDestination: combinedOptions.mongodbLogPath, + logDestinationIsStdErr: combinedOptions.mongodbLogPathIsStdErr + }; + } +} +exports.MongoLogger = MongoLogger; +//# sourceMappingURL=mongo_logger.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js.map new file mode 100644 index 00000000..b3c3f2dc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_logger.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongo_logger.js","sourceRoot":"","sources":["../src/mongo_logger.ts"],"names":[],"mappings":";;;AAmOA,0DASC;AAGD,8CAcC;AA4ND,kDAiIC;AA0ED,kDAwMC;AA52BD,mCAAmC;AACnC,+BAA+B;AAE/B,iCAiBgB;AAehB,2CA2BqB;AAerB,mCAAyF;AAEzF;;;;GAIG;AACU,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,MAAM;IACrB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACF,CAAC,CAAC;AAEZ,gBAAgB;AACH,QAAA,2BAA2B,GAAG,IAAI,CAAC;AAIhD,gBAAgB;AAChB,MAAM,gBAAiB,SAAQ,GAAmD;IAChF,YAAY,OAA2D;QACrE,MAAM,UAAU,GAAuD,EAAE,CAAC;QAC1E,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;YACrC,UAAU,CA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,GAAG;YACtB,GAAG,UAAU;YACb,GAAG,aAAa;YAChB,cAAc,EAAE,eAAe,CAAC,cAAc;YAC9C,sBAAsB,EAAE,eAAe,CAAC,sBAAsB;SAC/D,CAAC;QACF,MAAM,eAAe,GAAG,4BAA4B,CAClD,eAAe,CAAC,6BAA6B,EAAE,OAAO,EACtD,eAAe,CAAC,eAAe,EAC/B,qBAAa,CAAC,GAAG,CAClB,CAAC;QAEF,OAAO;YACL,mBAAmB,EAAE;gBACnB,OAAO,EAAE,4BAA4B,CACnC,eAAe,CAAC,6BAA6B,EAAE,OAAO,EACtD,eAAe,CAAC,mBAAmB,EACnC,eAAe,CAChB;gBACD,QAAQ,EAAE,4BAA4B,CACpC,eAAe,CAAC,6BAA6B,EAAE,QAAQ,EACvD,eAAe,CAAC,oBAAoB,EACpC,eAAe,CAChB;gBACD,eAAe,EAAE,4BAA4B,CAC3C,eAAe,CAAC,6BAA6B,EAAE,eAAe,EAC9D,eAAe,CAAC,4BAA4B,EAC5C,eAAe,CAChB;gBACD,UAAU,EAAE,4BAA4B,CACtC,eAAe,CAAC,6BAA6B,EAAE,UAAU,EACzD,eAAe,CAAC,sBAAsB,EACtC,eAAe,CAChB;gBACD,MAAM,EAAE,4BAA4B,CAClC,eAAe,CAAC,6BAA6B,EAAE,MAAM,EACrD,eAAe,CAAC,kBAAkB,EAClC,eAAe,CAChB;gBACD,OAAO,EAAE,eAAe;aACzB;YACD,iBAAiB,EACf,eAAe,CAAC,2BAA2B;gBAC3C,IAAA,4BAAoB,EAAC,eAAe,CAAC,+BAA+B,CAAC;gBACrE,IAAI;YACN,cAAc,EAAE,eAAe,CAAC,cAAc;YAC9C,sBAAsB,EAAE,eAAe,CAAC,sBAAsB;SAC/D,CAAC;IACJ,CAAC;CACF;AAzMD,kCAyMC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js new file mode 100644 index 00000000..779a7a0a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CancellationToken = exports.TypedEventEmitter = void 0; +const events_1 = require("events"); +const mongo_logger_1 = require("./mongo_logger"); +const utils_1 = require("./utils"); +/** + * Typescript type safe event emitter + * @public + */ +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +class TypedEventEmitter extends events_1.EventEmitter { + /** @internal */ + emitAndLog(event, ...args) { + this.emit(event, ...args); + if (this.component) + this.mongoLogger?.debug(this.component, args[0]); + } + /** @internal */ + emitAndLogHeartbeat(event, topologyId, serverConnectionId, ...args) { + this.emit(event, ...args); + if (this.component) { + const loggableHeartbeatEvent = { + topologyId: topologyId, + serverConnectionId: serverConnectionId ?? null, + ...args[0] + }; + this.mongoLogger?.debug(this.component, loggableHeartbeatEvent); + } + } + /** @internal */ + emitAndLogCommand(monitorCommands, event, databaseName, connectionEstablished, ...args) { + if (monitorCommands) { + this.emit(event, ...args); + } + if (connectionEstablished) { + const loggableCommandEvent = { + databaseName: databaseName, + ...args[0] + }; + this.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.COMMAND, loggableCommandEvent); + } + } +} +exports.TypedEventEmitter = TypedEventEmitter; +/** + * @internal + */ +class CancellationToken extends TypedEventEmitter { + constructor(...args) { + super(...args); + this.on('error', utils_1.noop); + } +} +exports.CancellationToken = CancellationToken; +//# sourceMappingURL=mongo_types.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js.map new file mode 100644 index 00000000..b807f5b3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/mongo_types.js.map @@ -0,0 +1 @@ +{"version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ACX,CAAC;YACF,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,qCAAsB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;CACF;AAvDD,8CAuDC;AAED;;GAEG;AACH,MAAa,iBAAkB,SAAQ,iBAAqC;IAC1E,YAAY,GAAG,IAAW;QACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QACf,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,YAAI,CAAC,CAAC;IACzB,CAAC;CACF;AALD,8CAKC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js new file mode 100644 index 00000000..8093b742 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AggregateOperation = exports.DB_AGGREGATE_COLLECTION = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const write_concern_1 = require("../write_concern"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +exports.DB_AGGREGATE_COLLECTION = 1; +/** @internal */ +class AggregateOperation extends command_1.CommandOperation { + constructor(ns, pipeline, options) { + super(undefined, { ...options, dbName: ns.db }); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + // Covers when ns.collection is null, undefined or the empty string, use DB_AGGREGATE_COLLECTION + this.target = ns.collection || exports.DB_AGGREGATE_COLLECTION; + this.pipeline = pipeline; + // determine if we have a write stage, override read preference if so + this.hasWriteStage = false; + if (typeof options?.out === 'string') { + this.pipeline = this.pipeline.concat({ $out: options.out }); + this.hasWriteStage = true; + } + else if (pipeline.length > 0) { + const finalStage = pipeline[pipeline.length - 1]; + if (finalStage.$out || finalStage.$merge) { + this.hasWriteStage = true; + } + } + if (!this.hasWriteStage) { + delete this.options.writeConcern; + } + if (options?.cursor != null && typeof options.cursor !== 'object') { + throw new error_1.MongoInvalidArgumentError('Cursor options must be an object'); + } + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? responses_1.ExplainedCursorResponse : responses_1.CursorResponse; + } + get commandName() { + return 'aggregate'; + } + get canRetryRead() { + return !this.hasWriteStage; + } + addToPipeline(stage) { + this.pipeline.push(stage); + } + buildCommandDocument() { + const options = this.options; + const command = { aggregate: this.target, pipeline: this.pipeline }; + if (this.hasWriteStage && this.writeConcern) { + write_concern_1.WriteConcern.apply(command, this.writeConcern); + } + if (options.bypassDocumentValidation === true) { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + if (typeof options.allowDiskUse === 'boolean') { + command.allowDiskUse = options.allowDiskUse; + } + if (options.hint) { + command.hint = options.hint; + } + if (options.let) { + command.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + command.cursor = options.cursor || {}; + if (options.batchSize && !this.hasWriteStage) { + command.cursor.batchSize = options.batchSize; + } + return command; + } + handleOk(response) { + return response; + } +} +exports.AggregateOperation = AggregateOperation; +(0, operation_1.defineAspects)(AggregateOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=aggregate.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js.map new file mode 100644 index 00000000..b71557f7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/aggregate.js.map @@ -0,0 +1 @@ +{"version":3,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,CAAC,IAAI,CAAC;QAC9B,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QAC5B,CAAC;QAED,iEAAiE;QACjE,gDAAgD;QAChD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAClC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACpC,CAAC;QAED,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;QACtC,IAAI,OAAO,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YAC7C,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAC/C,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEQ,QAAQ,CACf,QAAgE;QAEhE,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA/FD,gDA+FC;AAED,IAAA,yBAAa,EAAC,kBAAkB,EAAE;IAChC,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js new file mode 100644 index 00000000..4f59d936 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientBulkWriteOperation = void 0; +const responses_1 = require("../../cmap/wire_protocol/responses"); +const utils_1 = require("../../utils"); +const command_1 = require("../command"); +const operation_1 = require("../operation"); +/** + * Executes a single client bulk write operation within a potential batch. + * @internal + */ +class ClientBulkWriteOperation extends command_1.CommandOperation { + get commandName() { + return 'bulkWrite'; + } + constructor(commandBuilder, options) { + super(undefined, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.ClientBulkWriteCursorResponse; + this.commandBuilder = commandBuilder; + this.options = options; + this.ns = new utils_1.MongoDBNamespace('admin', '$cmd'); + } + resetBatch() { + return this.commandBuilder.resetBatch(); + } + get canRetryWrite() { + return this.commandBuilder.isBatchRetryable; + } + handleOk(response) { + return response; + } + buildCommandDocument(connection, _session) { + const command = this.commandBuilder.buildBatch(connection.description.maxMessageSizeBytes, connection.description.maxWriteBatchSize, connection.description.maxBsonObjectSize); + // Check _after_ the batch is built if we cannot retry it and override the option. + if (!this.canRetryWrite) { + this.options.willRetryWrite = false; + } + return command; + } +} +exports.ClientBulkWriteOperation = ClientBulkWriteOperation; +// Skipping the collation as it goes on the individual ops. +(0, operation_1.defineAspects)(ClientBulkWriteOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.COMMAND_BATCHING, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=client_bulk_write.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js.map new file mode 100644 index 00000000..aba016e8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client_bulk_write.js","sourceRoot":"","sources":["../../../src/operations/client_bulk_write/client_bulk_write.ts"],"names":[],"mappings":";;;AACA,kEAAmF;AAE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SAAS;IAChB,kBAAM,CAAC,gBAAgB;IACvB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js new file mode 100644 index 00000000..287f7c66 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js @@ -0,0 +1,340 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildReplaceOneOperation = exports.buildUpdateManyOperation = exports.buildUpdateOneOperation = exports.buildDeleteManyOperation = exports.buildDeleteOneOperation = exports.buildInsertOneOperation = exports.ClientBulkWriteCommandBuilder = void 0; +exports.buildOperation = buildOperation; +const bson_1 = require("../../bson"); +const commands_1 = require("../../cmap/commands"); +const error_1 = require("../../error"); +const sort_1 = require("../../sort"); +const utils_1 = require("../../utils"); +/** + * The bytes overhead for the extra fields added post command generation. + */ +const MESSAGE_OVERHEAD_BYTES = 1000; +/** @internal */ +class ClientBulkWriteCommandBuilder { + /** + * Create the command builder. + * @param models - The client write models. + */ + constructor(models, options, pkFactory) { + this.models = models; + this.options = options; + this.pkFactory = pkFactory ?? utils_1.DEFAULT_PK_FACTORY; + this.currentModelIndex = 0; + this.previousModelIndex = 0; + this.lastOperations = []; + this.isBatchRetryable = true; + } + /** + * Gets the errorsOnly value for the command, which is the inverse of the + * user provided verboseResults option. Defaults to true. + */ + get errorsOnly() { + if ('verboseResults' in this.options) { + return !this.options.verboseResults; + } + return true; + } + /** + * Determines if there is another batch to process. + * @returns True if not all batches have been built. + */ + hasNextBatch() { + return this.currentModelIndex < this.models.length; + } + /** + * When we need to retry a command we need to set the current + * model index back to its previous value. + */ + resetBatch() { + this.currentModelIndex = this.previousModelIndex; + return true; + } + /** + * Build a single batch of a client bulk write command. + * @param maxMessageSizeBytes - The max message size in bytes. + * @param maxWriteBatchSize - The max write batch size. + * @returns The client bulk write command. + */ + buildBatch(maxMessageSizeBytes, maxWriteBatchSize, maxBsonObjectSize) { + // We start by assuming the batch has no multi-updates, so it is retryable + // until we find them. + this.isBatchRetryable = true; + let commandLength = 0; + let currentNamespaceIndex = 0; + const command = this.baseCommand(); + const namespaces = new Map(); + // In the case of retries we need to mark where we started this batch. + this.previousModelIndex = this.currentModelIndex; + while (this.currentModelIndex < this.models.length) { + const model = this.models[this.currentModelIndex]; + const ns = model.namespace; + const nsIndex = namespaces.get(ns); + // Multi updates are not retryable. + if (model.name === 'deleteMany' || model.name === 'updateMany') { + this.isBatchRetryable = false; + } + if (nsIndex != null) { + // Build the operation and serialize it to get the bytes buffer. + const operation = buildOperation(model, nsIndex, this.pkFactory, this.options); + let operationBuffer; + try { + operationBuffer = bson_1.BSON.serialize(operation); + } + catch (cause) { + throw new error_1.MongoInvalidArgumentError(`Could not serialize operation to BSON`, { cause }); + } + validateBufferSize('ops', operationBuffer, maxBsonObjectSize); + // Check if the operation buffer can fit in the command. If it can, + // then add the operation to the document sequence and increment the + // current length as long as the ops don't exceed the maxWriteBatchSize. + if (commandLength + operationBuffer.length < maxMessageSizeBytes && + command.ops.documents.length < maxWriteBatchSize) { + // Pushing to the ops document sequence returns the total byte length of the document sequence. + commandLength = MESSAGE_OVERHEAD_BYTES + command.ops.push(operation, operationBuffer); + // Increment the builder's current model index. + this.currentModelIndex++; + } + else { + // The operation cannot fit in the current command and will need to + // go in the next batch. Exit the loop. + break; + } + } + else { + // The namespace is not already in the nsInfo so we will set it in the map, and + // construct our nsInfo and ops documents and buffers. + namespaces.set(ns, currentNamespaceIndex); + const nsInfo = { ns: ns }; + const operation = buildOperation(model, currentNamespaceIndex, this.pkFactory, this.options); + let nsInfoBuffer; + let operationBuffer; + try { + nsInfoBuffer = bson_1.BSON.serialize(nsInfo); + operationBuffer = bson_1.BSON.serialize(operation); + } + catch (cause) { + throw new error_1.MongoInvalidArgumentError(`Could not serialize ns info to BSON`, { cause }); + } + validateBufferSize('nsInfo', nsInfoBuffer, maxBsonObjectSize); + validateBufferSize('ops', operationBuffer, maxBsonObjectSize); + // Check if the operation and nsInfo buffers can fit in the command. If they + // can, then add the operation and nsInfo to their respective document + // sequences and increment the current length as long as the ops don't exceed + // the maxWriteBatchSize. + if (commandLength + nsInfoBuffer.length + operationBuffer.length < maxMessageSizeBytes && + command.ops.documents.length < maxWriteBatchSize) { + // Pushing to the ops document sequence returns the total byte length of the document sequence. + commandLength = + MESSAGE_OVERHEAD_BYTES + + command.nsInfo.push(nsInfo, nsInfoBuffer) + + command.ops.push(operation, operationBuffer); + // We've added a new namespace, increment the namespace index. + currentNamespaceIndex++; + // Increment the builder's current model index. + this.currentModelIndex++; + } + else { + // The operation cannot fit in the current command and will need to + // go in the next batch. Exit the loop. + break; + } + } + } + // Set the last operations and return the command. + this.lastOperations = command.ops.documents; + return command; + } + baseCommand() { + const command = { + bulkWrite: 1, + errorsOnly: this.errorsOnly, + ordered: this.options.ordered ?? true, + ops: new commands_1.DocumentSequence('ops'), + nsInfo: new commands_1.DocumentSequence('nsInfo') + }; + // Add bypassDocumentValidation if it was present in the options. + if (this.options.bypassDocumentValidation != null) { + command.bypassDocumentValidation = this.options.bypassDocumentValidation; + } + // Add let if it was present in the options. + if (this.options.let) { + command.let = this.options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + return command; + } +} +exports.ClientBulkWriteCommandBuilder = ClientBulkWriteCommandBuilder; +function validateBufferSize(name, buffer, maxBsonObjectSize) { + if (buffer.length > maxBsonObjectSize) { + throw new error_1.MongoInvalidArgumentError(`Client bulk write operation ${name} of length ${buffer.length} exceeds the max bson object size of ${maxBsonObjectSize}`); + } +} +/** + * Build the insert one operation. + * @param model - The insert one model. + * @param index - The namespace index. + * @returns the operation. + */ +const buildInsertOneOperation = (model, index, pkFactory) => { + const document = { + insert: index, + document: model.document + }; + document.document._id = model.document._id ?? pkFactory.createPk(); + return document; +}; +exports.buildInsertOneOperation = buildInsertOneOperation; +/** + * Build the delete one operation. + * @param model - The insert many model. + * @param index - The namespace index. + * @returns the operation. + */ +const buildDeleteOneOperation = (model, index) => { + return createDeleteOperation(model, index, false); +}; +exports.buildDeleteOneOperation = buildDeleteOneOperation; +/** + * Build the delete many operation. + * @param model - The delete many model. + * @param index - The namespace index. + * @returns the operation. + */ +const buildDeleteManyOperation = (model, index) => { + return createDeleteOperation(model, index, true); +}; +exports.buildDeleteManyOperation = buildDeleteManyOperation; +/** + * Creates a delete operation based on the parameters. + */ +function createDeleteOperation(model, index, multi) { + const document = { + delete: index, + multi: multi, + filter: model.filter + }; + if (model.hint) { + document.hint = model.hint; + } + if (model.collation) { + document.collation = model.collation; + } + return document; +} +/** + * Build the update one operation. + * @param model - The update one model. + * @param index - The namespace index. + * @returns the operation. + */ +const buildUpdateOneOperation = (model, index, options) => { + return createUpdateOperation(model, index, false, options); +}; +exports.buildUpdateOneOperation = buildUpdateOneOperation; +/** + * Build the update many operation. + * @param model - The update many model. + * @param index - The namespace index. + * @returns the operation. + */ +const buildUpdateManyOperation = (model, index, options) => { + return createUpdateOperation(model, index, true, options); +}; +exports.buildUpdateManyOperation = buildUpdateManyOperation; +/** + * Validate the update document. + * @param update - The update document. + */ +function validateUpdate(update, options) { + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoAPIError('Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty.'); + } +} +/** + * Creates a delete operation based on the parameters. + */ +function createUpdateOperation(model, index, multi, options) { + // Update documents provided in UpdateOne and UpdateMany write models are + // required only to contain atomic modifiers (i.e. keys that start with "$"). + // Drivers MUST throw an error if an update document is empty or if the + // document's first key does not start with "$". + validateUpdate(model.update, options); + const document = { + update: index, + multi: multi, + filter: model.filter, + updateMods: model.update + }; + if (model.hint) { + document.hint = model.hint; + } + if (model.upsert) { + document.upsert = model.upsert; + } + if (model.arrayFilters) { + document.arrayFilters = model.arrayFilters; + } + if (model.collation) { + document.collation = model.collation; + } + if (!multi && 'sort' in model && model.sort != null) { + document.sort = (0, sort_1.formatSort)(model.sort); + } + return document; +} +/** + * Build the replace one operation. + * @param model - The replace one model. + * @param index - The namespace index. + * @returns the operation. + */ +const buildReplaceOneOperation = (model, index) => { + if ((0, utils_1.hasAtomicOperators)(model.replacement)) { + throw new error_1.MongoAPIError('Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty.'); + } + const document = { + update: index, + multi: false, + filter: model.filter, + updateMods: model.replacement + }; + if (model.hint) { + document.hint = model.hint; + } + if (model.upsert) { + document.upsert = model.upsert; + } + if (model.collation) { + document.collation = model.collation; + } + if (model.sort != null) { + document.sort = (0, sort_1.formatSort)(model.sort); + } + return document; +}; +exports.buildReplaceOneOperation = buildReplaceOneOperation; +/** @internal */ +function buildOperation(model, index, pkFactory, options) { + switch (model.name) { + case 'insertOne': + return (0, exports.buildInsertOneOperation)(model, index, pkFactory); + case 'deleteOne': + return (0, exports.buildDeleteOneOperation)(model, index); + case 'deleteMany': + return (0, exports.buildDeleteManyOperation)(model, index); + case 'updateOne': + return (0, exports.buildUpdateOneOperation)(model, index, options); + case 'updateMany': + return (0, exports.buildUpdateManyOperation)(model, index, options); + case 'replaceOne': + return (0, exports.buildReplaceOneOperation)(model, index); + } +} +//# sourceMappingURL=command_builder.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js.map new file mode 100644 index 00000000..16036ccf --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"command_builder.js","sourceRoot":"","sources":["../../../src/operations/client_bulk_write/command_builder.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K,CAAC,IAAI,CAAC;IAC7B,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,CAAC;IACD,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,GAAG,IAAA,iBAAU,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AA7BW,QAAA,wBAAwB,4BA6BnC;AAEF,gBAAgB;AAChB,SAAgB,cAAc,CAC5B,KAAwC,EACxC,KAAa,EACb,SAAoB,EACpB,OAA6B;IAE7B,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,IAAA,+BAAuB,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC1D,KAAK,WAAW;YACd,OAAO,IAAA,+BAAuB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/C,KAAK,YAAY;YACf,OAAO,IAAA,gCAAwB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAChD,KAAK,WAAW;YACd,OAAO,IAAA,+BAAuB,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACxD,KAAK,YAAY;YACf,OAAO,IAAA,gCAAwB,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACzD,KAAK,YAAY;YACf,OAAO,IAAA,gCAAwB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js new file mode 100644 index 00000000..023264ff --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js.map new file mode 100644 index 00000000..cb325964 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/operations/client_bulk_write/common.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js new file mode 100644 index 00000000..cab6fe0d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientBulkWriteExecutor = void 0; +const abstract_cursor_1 = require("../../cursor/abstract_cursor"); +const client_bulk_write_cursor_1 = require("../../cursor/client_bulk_write_cursor"); +const error_1 = require("../../error"); +const timeout_1 = require("../../timeout"); +const utils_1 = require("../../utils"); +const write_concern_1 = require("../../write_concern"); +const execute_operation_1 = require("../execute_operation"); +const client_bulk_write_1 = require("./client_bulk_write"); +const command_builder_1 = require("./command_builder"); +const results_merger_1 = require("./results_merger"); +/** + * Responsible for executing a client bulk write. + * @internal + */ +class ClientBulkWriteExecutor { + /** + * Instantiate the executor. + * @param client - The mongo client. + * @param operations - The user supplied bulk write models. + * @param options - The bulk write options. + */ + constructor(client, operations, options) { + if (operations.length === 0) { + throw new error_1.MongoClientBulkWriteExecutionError('No client bulk write models were provided.'); + } + this.client = client; + this.operations = operations; + this.options = { + ordered: true, + bypassDocumentValidation: false, + verboseResults: false, + ...options + }; + // If no write concern was provided, we inherit one from the client. + if (!this.options.writeConcern) { + this.options.writeConcern = write_concern_1.WriteConcern.fromOptions(this.client.s.options); + } + if (this.options.writeConcern?.w === 0) { + if (this.options.verboseResults) { + throw new error_1.MongoInvalidArgumentError('Cannot request unacknowledged write concern and verbose results'); + } + if (this.options.ordered) { + throw new error_1.MongoInvalidArgumentError('Cannot request unacknowledged write concern and ordered writes'); + } + } + } + /** + * Execute the client bulk write. Will split commands into batches and exhaust the cursors + * for each, then merge the results into one. + * @returns The result. + */ + async execute() { + // The command builder will take the user provided models and potential split the batch + // into multiple commands due to size. + const pkFactory = this.client.s.options.pkFactory; + const commandBuilder = new command_builder_1.ClientBulkWriteCommandBuilder(this.operations, this.options, pkFactory); + // Unacknowledged writes need to execute all batches and return { ok: 1} + const resolvedOptions = (0, utils_1.resolveTimeoutOptions)(this.client, this.options); + const context = timeout_1.TimeoutContext.create(resolvedOptions); + if (this.options.writeConcern?.w === 0) { + while (commandBuilder.hasNextBatch()) { + const operation = new client_bulk_write_1.ClientBulkWriteOperation(commandBuilder, this.options); + await (0, execute_operation_1.executeOperation)(this.client, operation, context); + } + return results_merger_1.ClientBulkWriteResultsMerger.unacknowledged(); + } + else { + const resultsMerger = new results_merger_1.ClientBulkWriteResultsMerger(this.options); + // For each command will will create and exhaust a cursor for the results. + while (commandBuilder.hasNextBatch()) { + const cursorContext = new abstract_cursor_1.CursorTimeoutContext(context, Symbol()); + const options = { + ...this.options, + timeoutContext: cursorContext, + ...(resolvedOptions.timeoutMS != null && { timeoutMode: abstract_cursor_1.CursorTimeoutMode.LIFETIME }) + }; + const cursor = new client_bulk_write_cursor_1.ClientBulkWriteCursor(this.client, commandBuilder, options); + try { + await resultsMerger.merge(cursor); + } + catch (error) { + // Write concern errors are recorded in the writeConcernErrors field on MongoClientBulkWriteError. + // When a write concern error is encountered, it should not terminate execution of the bulk write + // for either ordered or unordered bulk writes. However, drivers MUST throw an exception at the end + // of execution if any write concern errors were observed. + if (error instanceof error_1.MongoServerError && !(error instanceof error_1.MongoClientBulkWriteError)) { + // Server side errors need to be wrapped inside a MongoClientBulkWriteError, where the root + // cause is the error property and a partial result is to be included. + const bulkWriteError = new error_1.MongoClientBulkWriteError({ + message: 'Mongo client bulk write encountered an error during execution' + }); + bulkWriteError.cause = error; + bulkWriteError.partialResult = resultsMerger.bulkWriteResult; + throw bulkWriteError; + } + else { + // Client side errors are just thrown. + throw error; + } + } + } + // If we have write concern errors or unordered write errors at the end we throw. + if (resultsMerger.writeConcernErrors.length > 0 || resultsMerger.writeErrors.size > 0) { + const error = new error_1.MongoClientBulkWriteError({ + message: 'Mongo client bulk write encountered errors during execution.' + }); + error.writeConcernErrors = resultsMerger.writeConcernErrors; + error.writeErrors = resultsMerger.writeErrors; + error.partialResult = resultsMerger.bulkWriteResult; + throw error; + } + return resultsMerger.bulkWriteResult; + } + } +} +exports.ClientBulkWriteExecutor = ClientBulkWriteExecutor; +//# sourceMappingURL=executor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js.map new file mode 100644 index 00000000..bce5db91 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/operations/client_bulk_write/executor.ts"],"names":[],"mappings":";;;AACA,kEAAuF;AACvF,oFAA8E;AAC9E,uCAKqB;AAErB,2CAA+C;AAC/C,u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MAAM,CAAC,CAAC;gBACpC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,kGAAkG;oBAClG,iGAAiG;oBACjG,mGAAmG;oBACnG,0DAA0D;oBAC1D,IAAI,KAAK,YAAY,wBAAgB,IAAI,CAAC,CAAC,KAAK,YAAY,iCAAyB,CAAC,EAAE,CAAC;wBACvF,2FAA2F;wBAC3F,sEAAsE;wBACtE,MAAM,cAAc,GAAG,IAAI,iCAAyB,CAAC;4BACnD,OAAO,EAAE,+DAA+D;yBACzE,CAAC,CAAC;wBACH,cAAc,CAAC,KAAK,GAAG,KAAK,CAAC;wBAC7B,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC,eAAe,CAAC;wBAC7D,MAAM,cAAc,CAAC;oBACvB,CAAC;yBAAM,CAAC;wBACN,sCAAsC;wBACtC,MAAM,KAAK,CAAC;oBACd,CAAC;gBACH,CAAC;YACH,CAAC;YAED,iFAAiF;YACjF,IAAI,aAAa,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBACtF,MAAM,KAAK,GAAG,IAAI,iCAAyB,CAAC;oBAC1C,OAAO,EAAE,8DAA8D;iBACxE,CAAC,CAAC;gBACH,KAAK,CAAC,kBAAkB,GAAG,aAAa,CAAC,kBAAkB,CAAC;gBAC5D,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;gBAC9C,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC,eAAe,CAAC;gBACpD,MAAM,KAAK,CAAC;YACd,CAAC;YAED,OAAO,aAAa,CAAC,eAAe,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAzHD,0DAyHC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js new file mode 100644 index 00000000..3d3b5dcb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js @@ -0,0 +1,204 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientBulkWriteResultsMerger = void 0; +const __1 = require("../.."); +const error_1 = require("../../error"); +/** + * Unacknowledged bulk writes are always the same. + */ +const UNACKNOWLEDGED = { + acknowledged: false, + insertedCount: 0, + upsertedCount: 0, + matchedCount: 0, + modifiedCount: 0, + deletedCount: 0, + insertResults: undefined, + updateResults: undefined, + deleteResults: undefined +}; +/** + * Merges client bulk write cursor responses together into a single result. + * @internal + */ +class ClientBulkWriteResultsMerger { + /** + * @returns The standard unacknowledged bulk write result. + */ + static unacknowledged() { + return UNACKNOWLEDGED; + } + /** + * Instantiate the merger. + * @param options - The options. + */ + constructor(options) { + this.options = options; + this.currentBatchOffset = 0; + this.writeConcernErrors = []; + this.writeErrors = new Map(); + this.result = { + acknowledged: true, + insertedCount: 0, + upsertedCount: 0, + matchedCount: 0, + modifiedCount: 0, + deletedCount: 0, + insertResults: undefined, + updateResults: undefined, + deleteResults: undefined + }; + if (options.verboseResults) { + this.result.insertResults = new Map(); + this.result.updateResults = new Map(); + this.result.deleteResults = new Map(); + } + } + /** + * Get the bulk write result object. + */ + get bulkWriteResult() { + return { + acknowledged: this.result.acknowledged, + insertedCount: this.result.insertedCount, + upsertedCount: this.result.upsertedCount, + matchedCount: this.result.matchedCount, + modifiedCount: this.result.modifiedCount, + deletedCount: this.result.deletedCount, + insertResults: this.result.insertResults, + updateResults: this.result.updateResults, + deleteResults: this.result.deleteResults + }; + } + /** + * Merge the results in the cursor to the existing result. + * @param currentBatchOffset - The offset index to the original models. + * @param response - The cursor response. + * @param documents - The documents in the cursor. + * @returns The current result. + */ + async merge(cursor) { + let writeConcernErrorResult; + try { + for await (const document of cursor) { + // Only add to maps if ok: 1 + if (document.ok === 1) { + if (this.options.verboseResults) { + this.processDocument(cursor, document); + } + } + else { + // If an individual write error is encountered during an ordered bulk write, drivers MUST + // record the error in writeErrors and immediately throw the exception. Otherwise, drivers + // MUST continue to iterate the results cursor and execute any further bulkWrite batches. + if (this.options.ordered) { + const error = new error_1.MongoClientBulkWriteError({ + message: 'Mongo client ordered bulk write encountered a write error.' + }); + error.writeErrors.set(document.idx + this.currentBatchOffset, { + code: document.code, + message: document.errmsg + }); + error.partialResult = this.result; + throw error; + } + else { + this.writeErrors.set(document.idx + this.currentBatchOffset, { + code: document.code, + message: document.errmsg + }); + } + } + } + } + catch (error) { + if (error instanceof __1.MongoWriteConcernError) { + const result = error.result; + writeConcernErrorResult = { + insertedCount: result.nInserted, + upsertedCount: result.nUpserted, + matchedCount: result.nMatched, + modifiedCount: result.nModified, + deletedCount: result.nDeleted, + writeConcernError: result.writeConcernError + }; + if (this.options.verboseResults && result.cursor.firstBatch) { + for (const document of result.cursor.firstBatch) { + if (document.ok === 1) { + this.processDocument(cursor, document); + } + } + } + } + else { + throw error; + } + } + finally { + // Update the counts from the cursor response. + if (cursor.response) { + const response = cursor.response; + this.incrementCounts(response); + } + // Increment the batch offset. + this.currentBatchOffset += cursor.operations.length; + } + // If we have write concern errors ensure they are added. + if (writeConcernErrorResult) { + const writeConcernError = writeConcernErrorResult.writeConcernError; + this.incrementCounts(writeConcernErrorResult); + this.writeConcernErrors.push({ + code: writeConcernError.code, + message: writeConcernError.errmsg + }); + } + return this.result; + } + /** + * Process an individual document in the results. + * @param cursor - The cursor. + * @param document - The document to process. + */ + processDocument(cursor, document) { + // Get the corresponding operation from the command. + const operation = cursor.operations[document.idx]; + // Handle insert results. + if ('insert' in operation) { + this.result.insertResults?.set(document.idx + this.currentBatchOffset, { + insertedId: operation.document._id + }); + } + // Handle update results. + if ('update' in operation) { + const result = { + matchedCount: document.n, + modifiedCount: document.nModified ?? 0, + // Check if the bulk did actually upsert. + didUpsert: document.upserted != null + }; + if (document.upserted) { + result.upsertedId = document.upserted._id; + } + this.result.updateResults?.set(document.idx + this.currentBatchOffset, result); + } + // Handle delete results. + if ('delete' in operation) { + this.result.deleteResults?.set(document.idx + this.currentBatchOffset, { + deletedCount: document.n + }); + } + } + /** + * Increment the result counts. + * @param document - The document with the results. + */ + incrementCounts(document) { + this.result.insertedCount += document.insertedCount; + this.result.upsertedCount += document.upsertedCount; + this.result.matchedCount += document.matchedCount; + this.result.modifiedCount += document.modifiedCount; + this.result.deletedCount += document.deletedCount; + } +} +exports.ClientBulkWriteResultsMerger = ClientBulkWriteResultsMerger; +//# sourceMappingURL=results_merger.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js.map new file mode 100644 index 00000000..61ccda75 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js.map @@ -0,0 +1 @@ +{"version":3,"file":"results_merger.js","sourceRoot":"","sources":["../../../src/operations/client_bulk_write/results_merger.ts"],"names":[],"mappings":";;;AAAA,6BAA+C;AAG/C,uCAAwD;AAUxD;;GAEG;AACH,MAAM,cAAc,GAAG;IACrB,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;CACzB,CAAC;AAyCF;;;GAGG;AACH,MAAa,4BAA4B;IAOvC;;OAEG;IACH,MAAM,CAAC,cAAc;QACnB,OAAO,cAAc,CAAC;IACxB,CAAC;IAED;;;OAGG;IACH,YAAY,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,CAA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pD,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,QAAQ,CAAC,aAAa,CAAC;QACpD,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,QAAQ,CAAC,aAAa,CAAC;QACpD,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC;IACpD,CAAC;CACF;AA5LD,oEA4LC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js new file mode 100644 index 00000000..6196dd92 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommandOperation = void 0; +const constants_1 = require("../cmap/wire_protocol/constants"); +const error_1 = require("../error"); +const explain_1 = require("../explain"); +const read_concern_1 = require("../read_concern"); +const utils_1 = require("../utils"); +const write_concern_1 = require("../write_concern"); +const operation_1 = require("./operation"); +/** @internal */ +class CommandOperation extends operation_1.AbstractOperation { + constructor(parent, options) { + super(options); + this.options = options ?? {}; + // NOTE: this was explicitly added for the add/remove user operations, it's likely + // something we'd want to reconsider. Perhaps those commands can use `Admin` + // as a parent? + const dbNameOverride = options?.dbName || options?.authdb; + if (dbNameOverride) { + this.ns = new utils_1.MongoDBNamespace(dbNameOverride, '$cmd'); + } + else { + this.ns = parent + ? parent.s.namespace.withCollection('$cmd') + : new utils_1.MongoDBNamespace('admin', '$cmd'); + } + this.readConcern = read_concern_1.ReadConcern.fromOptions(options); + this.writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE)) { + this.explain = explain_1.Explain.fromOptions(options); + if (this.explain) + (0, explain_1.validateExplainTimeoutOptions)(this.options, this.explain); + } + else if (options?.explain != null) { + throw new error_1.MongoInvalidArgumentError(`Option "explain" is not supported on this command`); + } + } + get canRetryWrite() { + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE)) { + return this.explain == null; + } + return super.canRetryWrite; + } + buildOptions(timeoutContext) { + return { + ...this.options, + ...this.bsonOptions, + timeoutContext, + readPreference: this.readPreference, + session: this.session + }; + } + buildCommand(connection, session) { + const command = this.buildCommandDocument(connection, session); + const inTransaction = this.session && this.session.inTransaction(); + if (this.readConcern && (0, utils_1.commandSupportsReadConcern)(command) && !inTransaction) { + Object.assign(command, { readConcern: this.readConcern }); + } + if (this.writeConcern && this.hasAspect(operation_1.Aspect.WRITE_OPERATION) && !inTransaction) { + write_concern_1.WriteConcern.apply(command, this.writeConcern); + } + if (this.options.collation && + typeof this.options.collation === 'object' && + !this.hasAspect(operation_1.Aspect.SKIP_COLLATION)) { + Object.assign(command, { collation: this.options.collation }); + } + if (typeof this.options.maxTimeMS === 'number') { + command.maxTimeMS = this.options.maxTimeMS; + } + if (this.options.rawData != null && + this.hasAspect(operation_1.Aspect.SUPPORTS_RAW_DATA) && + (0, utils_1.maxWireVersion)(connection) >= constants_1.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION) { + command.rawData = this.options.rawData; + } + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE) && this.explain) { + return (0, explain_1.decorateWithExplain)(command, this.explain); + } + return command; + } +} +exports.CommandOperation = CommandOperation; +//# sourceMappingURL=command.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js.map new file mode 100644 index 00000000..f997b18f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/command.js.map @@ -0,0 +1 @@ +{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/operations/command.ts"],"names":[],"mappings":";;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,EACtC,CAAC;YACD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC/C,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7C,CAAC;QAED,IACE,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI;YAC5B,IAAI,CAAC,SAAS,CAAC,kBAAM,CAAC,iBAAiB,CAAC;YACxC,IAAA,sBAAc,EAAC,UAAU,CAAC,IAAI,+CAAmC,EACjE,CAAC;YACD,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACzC,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAM,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACvD,OAAO,IAAA,6BAAmB,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA3FD,4CA2FC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js new file mode 100644 index 00000000..774e6d7e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class CountOperation extends command_1.CommandOperation { + constructor(namespace, filter, options) { + super({ s: { namespace: namespace } }, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.collectionName = namespace.collection; + this.query = filter; + } + get commandName() { + return 'count'; + } + buildCommandDocument(_connection, _session) { + const options = this.options; + const cmd = { + count: this.collectionName, + query: this.query + }; + if (typeof options.limit === 'number') { + cmd.limit = options.limit; + } + if (typeof options.skip === 'number') { + cmd.skip = options.skip; + } + if (options.hint != null) { + cmd.hint = options.hint; + } + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + return cmd; + } + handleOk(response) { + return response.getNumber('n') ?? 0; + } +} +exports.CountOperation = CountOperation; +(0, operation_1.defineAspects)(CountOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.RETRYABLE, operation_1.Aspect.SUPPORTS_RAW_DATA]); +//# sourceMappingURL=count.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js.map new file mode 100644 index 00000000..cfb7c95d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/count.js.map @@ -0,0 +1 @@ +{"version":3,"file":"count.js","sourceRoot":"","sources":["../../src/operations/count.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAGlE,uCAA2E;AAC3E,2CAAoD;AAgBpD,gBAAgB;AAChB,MAAa,cAAe,SAAQ,0BAAwB;IAM1D,YAAY,SAA2B,EAAE,MAAgB,EAAE,OAAqB;QAC9E,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QANzC,iCAA4B,GAAG,2BAAe,CAAC;QAQtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;IACtB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,OAAgB,CAAC;IAC1B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,GAAG,GAAa;YACpB,KAAK,EAAE,IAAI,CAAC,cAAc;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;QAEF,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACtC,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,CAAC;QAED,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACzB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,CAAC;QAED,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC1C,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAEQ,QAAQ,CAAC,QAAgE;QAChF,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CACF;AA/CD,wCA+CC;AAED,IAAA,yBAAa,EAAC,cAAc,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,SAAS,EAAE,kBAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js new file mode 100644 index 00000000..3d0e431d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js @@ -0,0 +1,109 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CreateCollectionOperation = void 0; +exports.createCollections = createCollections; +const constants_1 = require("../cmap/wire_protocol/constants"); +const responses_1 = require("../cmap/wire_protocol/responses"); +const collection_1 = require("../collection"); +const error_1 = require("../error"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const execute_operation_1 = require("./execute_operation"); +const indexes_1 = require("./indexes"); +const operation_1 = require("./operation"); +const ILLEGAL_COMMAND_FIELDS = new Set([ + 'w', + 'wtimeout', + 'timeoutMS', + 'j', + 'fsync', + 'pkFactory', + 'raw', + 'readPreference', + 'session', + 'readConcern', + 'writeConcern', + 'raw', + 'fieldsAsRaw', + 'useBigInt64', + 'promoteLongs', + 'promoteValues', + 'promoteBuffers', + 'bsonRegExp', + 'serializeFunctions', + 'ignoreUndefined', + 'enableUtf8Validation' +]); +/* @internal */ +const INVALID_QE_VERSION = 'Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption.'; +/** @internal */ +class CreateCollectionOperation extends command_1.CommandOperation { + constructor(db, name, options = {}) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.db = db; + this.name = name; + } + get commandName() { + return 'create'; + } + buildCommandDocument(_connection, _session) { + const isOptionValid = ([k, v]) => v != null && typeof v !== 'function' && !ILLEGAL_COMMAND_FIELDS.has(k); + return { + create: this.name, + ...Object.fromEntries(Object.entries(this.options).filter(isOptionValid)) + }; + } + handleOk(_response) { + return new collection_1.Collection(this.db, this.name, this.options); + } +} +exports.CreateCollectionOperation = CreateCollectionOperation; +async function createCollections(db, name, options) { + const timeoutContext = timeout_1.TimeoutContext.create({ + session: options.session, + serverSelectionTimeoutMS: db.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: db.client.s.options.waitQueueTimeoutMS, + timeoutMS: options.timeoutMS + }); + const encryptedFields = options.encryptedFields ?? + db.client.s.options.autoEncryption?.encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + if (encryptedFields) { + class CreateSupportingFLEv2CollectionOperation extends CreateCollectionOperation { + buildCommandDocument(connection, session) { + if (!connection.description.loadBalanced && + (0, utils_1.maxWireVersion)(connection) < constants_1.MIN_SUPPORTED_QE_WIRE_VERSION) { + throw new error_1.MongoCompatibilityError(`${INVALID_QE_VERSION} The minimum server version required is ${constants_1.MIN_SUPPORTED_QE_SERVER_VERSION}`); + } + return super.buildCommandDocument(connection, session); + } + } + // Create auxilliary collections for queryable encryption support. + const escCollection = encryptedFields.escCollection ?? `enxcol_.${name}.esc`; + const ecocCollection = encryptedFields.ecocCollection ?? `enxcol_.${name}.ecoc`; + for (const collectionName of [escCollection, ecocCollection]) { + const createOp = new CreateSupportingFLEv2CollectionOperation(db, collectionName, { + clusteredIndex: { + key: { _id: 1 }, + unique: true + }, + session: options.session + }); + await (0, execute_operation_1.executeOperation)(db.client, createOp, timeoutContext); + } + if (!options.encryptedFields) { + options = { ...options, encryptedFields }; + } + } + const coll = await (0, execute_operation_1.executeOperation)(db.client, new CreateCollectionOperation(db, name, options), timeoutContext); + if (encryptedFields) { + // Create the required index for queryable encryption support. + const createIndexOp = indexes_1.CreateIndexesOperation.fromIndexSpecification(db, name, { __safeContent__: 1 }, { session: options.session }); + await (0, execute_operation_1.executeOperation)(db.client, createIndexOp, timeoutContext); + } + return coll; +} +(0, operation_1.defineAspects)(CreateCollectionOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=create_collection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js.map new file mode 100644 index 00000000..7b0a0367 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/create_collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"create_collection.js","sourceRoot":"","sources":["../../src/operations/create_collection.ts"],"names":[],"mappings":";;;AAiJA,8CAsEC;AArND,+DAGyC;AACzC,+DAAkE;AAClE,8CAA2C;AAE3C,oCAAmD;AAGnD,wCAA4C;AAC5C,oCAA0C;AAC1C,uCAA2E;AAC3E,2DAAuD;AACvD,uCAAmD;AACnD,2CAAoD;AAEpD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,GAAG;IACH,UAAU;IACV,WAAW;IACX,GAAG;IACH,OAAO;IACP,WAAW;IACX,KAAK;IACL,gBAAgB;IAChB,SAAS;IACT,aAAa;IACb,cAAc;IACd,KAAK;IACL,aAAa;IACb,aAAa;IACb,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,YAAY;IACZ,oBAAoB;IACpB,iBAAiB;IACjB,sBAAsB;CACvB,CAAC,CAAC;AAiEH,eAAe;AACf,MAAM,kBAAkB,GACtB,iHAAiH,CAAC;AAEpH,gBAAgB;AAChB,MAAa,yBAA0B,SAAQ,0BAA4B;IAMzE,YAAY,EAAM,EAAE,IAAY,EAAE,UAAmC,EAAE;QACrE,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QANZ,iCAA4B,GAAG,2BAAe,CAAC;QAQtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,QAAiB,CAAC;IAC3B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAA0B,EAAE,EAAE,CACxD,CAAC,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC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AAC;IAED,OAAO,IAAsC,CAAC;AAChD,CAAC;AAED,IAAA,yBAAa,EAAC,yBAAyB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js new file mode 100644 index 00000000..82eac4a6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeleteManyOperation = exports.DeleteOneOperation = exports.DeleteOperation = void 0; +exports.makeDeleteStatement = makeDeleteStatement; +const commands_1 = require("../cmap/commands"); +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class DeleteOperation extends command_1.CommandOperation { + constructor(ns, statements, options, serializedOperations) { + super(undefined, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.ns = ns; + this.statements = statements; + this.serializedOperations = serializedOperations; + } + get commandName() { + return 'delete'; + } + get canRetryWrite() { + if (super.canRetryWrite === false) { + return false; + } + return this.statements.every(op => (op.limit != null ? op.limit > 0 : true)); + } + buildCommandDocument(_connection, _session) { + const options = this.options; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command = { + delete: this.ns.collection, + deletes: this.serializedOperations + ? (0, commands_1.makeDocumentSequence)('deletes', this.statements, this.serializedOperations) + : this.statements, + ordered + }; + if (options.let) { + command.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + return command; + } +} +exports.DeleteOperation = DeleteOperation; +class DeleteOneOperation extends DeleteOperation { + constructor(ns, filter, options) { + super(ns, [makeDeleteStatement(filter, { ...options, limit: 1 })], options); + } + handleOk(response) { + const res = super.handleOk(response); + // @ts-expect-error Explain commands have broken TS + if (this.explain) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + deletedCount: res.n + }; + } +} +exports.DeleteOneOperation = DeleteOneOperation; +class DeleteManyOperation extends DeleteOperation { + constructor(ns, filter, options) { + super(ns, [makeDeleteStatement(filter, options)], options); + } + handleOk(response) { + const res = super.handleOk(response); + // @ts-expect-error Explain commands have broken TS + if (this.explain) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + deletedCount: res.n + }; + } +} +exports.DeleteManyOperation = DeleteManyOperation; +function makeDeleteStatement(filter, options) { + const op = { + q: filter, + limit: typeof options.limit === 'number' ? options.limit : 0 + }; + if (options.collation) { + op.collation = options.collation; + } + if (options.hint) { + op.hint = options.hint; + } + return op; +} +(0, operation_1.defineAspects)(DeleteOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +(0, operation_1.defineAspects)(DeleteOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +(0, operation_1.defineAspects)(DeleteManyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=delete.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js.map new file mode 100644 index 00000000..52e2366a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/delete.js.map @@ -0,0 +1 @@ +{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../src/operations/delete.ts"],"names":[],"mappings":";;;AAmJA,kDAkBC;AApKD,+CAAwD;AAExD,+DAAkE;AAClE,oCAA4C;AAI5C,uCAAkG;AAClG,2CAA+D;AAkC/D,gBAAgB;AAChB,MAAa,eAAgB,SAAQ,0BAA0B;IAO7D,YACE,EAAoB,EACpB,UAA6B,EAC7B,OAAsB,EACtB,oBAAmC;QAEnC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAZnB,iCAA4B,GAAG,2BAAe,CAAC;QAatD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,QAAiB,CAAC;IAC3B,CAAC;IAED,IAAa,aAAa;QACxB,IAAI,KAAK,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/E,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAA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IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,IAAA,yBAAa,EAAC,eAAe,EAAE;IAC7B,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,kBAAkB,EAAE;IAChC,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,mBAAmB,EAAE;IACjC,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js new file mode 100644 index 00000000..cfd4e79f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DistinctOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** + * Return a list of distinct values for the given key across a collection. + * @internal + */ +class DistinctOperation extends command_1.CommandOperation { + /** + * Construct a Distinct operation. + * + * @param collection - Collection instance. + * @param key - Field of the document to find distinct values for. + * @param query - The query for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings. See Collection.prototype.distinct for a list of options. + */ + constructor(collection, key, query, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + this.collection = collection; + this.key = key; + this.query = query; + } + get commandName() { + return 'distinct'; + } + buildCommandDocument(_connection) { + const command = { + distinct: this.collection.collectionName, + key: this.key, + query: this.query + }; + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + if (this.options.hint != null) { + command.hint = this.options.hint; + } + return command; + } + handleOk(response) { + if (this.explain) { + return response.toObject(this.bsonOptions); + } + return response.toObject(this.bsonOptions).values; + } +} +exports.DistinctOperation = DistinctOperation; +(0, operation_1.defineAspects)(DistinctOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=distinct.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js.map new file mode 100644 index 00000000..b8373bdc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/distinct.js.map @@ -0,0 +1 @@ +{"version":3,"file":"distinct.js","sourceRoot":"","sources":["../../src/operations/distinct.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAElE,uCAA2E;AAC3E,2CAAoD;AAkBpD;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,0BAAkC;IASvE;;;;;;;OAOG;IACH,YAAY,UAAsB,EAAE,GAAW,EAAE,KAAe,EAAE,OAAyB;QACzF,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAjBpB,iCAA4B,GAAG,2BAAe,CAAC;QAmBtD,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,UAAmB,CAAC;IAC7B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,MAAM,OAAO,GAAa;YACxB,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc;YACxC,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;QACF,iEAAiE;QACjE,gDAAgD;QAChD,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACzC,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YAC9B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QACnC,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEQ,QAAQ,CACf,QAAgE;QAEhE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;IACpD,CAAC;CACF;AAzDD,8CAyDC;AAED,IAAA,yBAAa,EAAC,iBAAiB,EAAE;IAC/B,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js new file mode 100644 index 00000000..2a00a34d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DropDatabaseOperation = exports.DropCollectionOperation = void 0; +exports.dropCollections = dropCollections; +const __1 = require(".."); +const responses_1 = require("../cmap/wire_protocol/responses"); +const abstract_cursor_1 = require("../cursor/abstract_cursor"); +const error_1 = require("../error"); +const timeout_1 = require("../timeout"); +const command_1 = require("./command"); +const execute_operation_1 = require("./execute_operation"); +const operation_1 = require("./operation"); +/** @internal */ +class DropCollectionOperation extends command_1.CommandOperation { + constructor(db, name, options = {}) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.name = name; + } + get commandName() { + return 'drop'; + } + buildCommandDocument(_connection, _session) { + return { drop: this.name }; + } + handleOk(_response) { + return true; + } + handleError(error) { + if (!(error instanceof __1.MongoServerError)) + throw error; + if (Number(error.code) !== error_1.MONGODB_ERROR_CODES.NamespaceNotFound) + throw error; + return false; + } +} +exports.DropCollectionOperation = DropCollectionOperation; +async function dropCollections(db, name, options) { + const timeoutContext = timeout_1.TimeoutContext.create({ + session: options.session, + serverSelectionTimeoutMS: db.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: db.client.s.options.waitQueueTimeoutMS, + timeoutMS: options.timeoutMS + }); + const encryptedFieldsMap = db.client.s.options.autoEncryption?.encryptedFieldsMap; + let encryptedFields = options.encryptedFields ?? encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + if (!encryptedFields && encryptedFieldsMap) { + // If the MongoClient was configured with an encryptedFieldsMap, + // and no encryptedFields config was available in it or explicitly + // passed as an argument, the spec tells us to look one up using + // listCollections(). + const listCollectionsResult = await db + .listCollections({ name }, { + nameOnly: false, + session: options.session, + timeoutContext: new abstract_cursor_1.CursorTimeoutContext(timeoutContext, Symbol()) + }) + .toArray(); + encryptedFields = listCollectionsResult?.[0]?.options?.encryptedFields; + } + if (encryptedFields) { + const escCollection = encryptedFields.escCollection || `enxcol_.${name}.esc`; + const ecocCollection = encryptedFields.ecocCollection || `enxcol_.${name}.ecoc`; + for (const collectionName of [escCollection, ecocCollection]) { + // Drop auxilliary collections, ignoring potential NamespaceNotFound errors. + const dropOp = new DropCollectionOperation(db, collectionName, options); + await (0, execute_operation_1.executeOperation)(db.client, dropOp, timeoutContext); + } + } + return await (0, execute_operation_1.executeOperation)(db.client, new DropCollectionOperation(db, name, options), timeoutContext); +} +/** @internal */ +class DropDatabaseOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + } + get commandName() { + return 'dropDatabase'; + } + buildCommandDocument(_connection, _session) { + return { dropDatabase: 1 }; + } + handleOk(_response) { + return true; + } +} +exports.DropDatabaseOperation = DropDatabaseOperation; +(0, operation_1.defineAspects)(DropCollectionOperation, [operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(DropDatabaseOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=drop.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js.map new file mode 100644 index 00000000..31738a4f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/drop.js.map @@ -0,0 +1 @@ +{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../src/operations/drop.ts"],"names":[],"mappings":";;;AAmDA,0CAkDC;AArGD,0BAAwE;AAExE,+DAAkE;AAClE,+DAAiE;AAEjE,oCAA+C;AAE/C,wCAA4C;AAC5C,uCAA2E;AAC3E,2DAAuD;AACvD,2CAAoD;AAQpD,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,0BAAyB;IAMpE,YAAY,EAAM,EAAE,IAAY,EAAE,UAAiC,EAAE;QACnE,KAAK,C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QAKtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,IAAa,WAAW;QACtB,OAAO,cAAuB,CAAC;IACjC,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;IAC7B,CAAC;IAEQ,QAAQ,CAAC,SAAiE;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAnBD,sDAmBC;AAED,IAAA,yBAAa,EAAC,uBAAuB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AACjE,IAAA,yBAAa,EAAC,qBAAqB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js new file mode 100644 index 00000000..0f6e605c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndSessionsOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const command_1 = require("../operations/command"); +const read_preference_1 = require("../read_preference"); +const utils_1 = require("../utils"); +const operation_1 = require("./operation"); +class EndSessionsOperation extends command_1.CommandOperation { + constructor(sessions) { + super(); + this.writeConcern = { w: 0 }; + this.ns = utils_1.MongoDBNamespace.fromString('admin.$cmd'); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.sessions = sessions; + } + buildCommandDocument(_connection, _session) { + return { + endSessions: this.sessions + }; + } + buildOptions(timeoutContext) { + return { + timeoutContext, + readPreference: read_preference_1.ReadPreference.primaryPreferred + }; + } + get commandName() { + return 'endSessions'; + } +} +exports.EndSessionsOperation = EndSessionsOperation; +(0, operation_1.defineAspects)(EndSessionsOperation, operation_1.Aspect.WRITE_OPERATION); +//# sourceMappingURL=end_sessions.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js.map new file mode 100644 index 00000000..2744f1e9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/end_sessions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"end_sessions.js","sourceRoot":"","sources":["../../src/operations/end_sessions.ts"],"names":[],"mappings":";;;AASA,+DAAkE;AAClE,mDAAyD;AACzD,wDAAoD;AACpD,oCAA4C;AAC5C,2CAAoD;AAEpD,MAAa,oBAAqB,SAAQ,0BAAsB;IAO9D,YAAY,QAAgC;QAC1C,KAAK,EAAE,CAAC;QAPD,iBAAY,GAAiB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACtC,OAAE,GAAG,wBAAgB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC/C,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,QAAQ;SAC3B,CAAC;IACJ,CAAC;IACQ,YAAY,CAAC,cAA8B;QAClD,OAAO;YACL,cAAc;YACd,cAAc,EAAE,gCAAc,CAAC,gBAAgB;SAChD,CAAC;IACJ,CAAC;IACD,IAAa,WAAW;QACtB,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AA1BD,oDA0BC;AAED,IAAA,yBAAa,EAAC,oBAAoB,EAAE,kBAAM,CAAC,eAAe,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js new file mode 100644 index 00000000..d41ad505 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EstimatedDocumentCountOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class EstimatedDocumentCountOperation extends command_1.CommandOperation { + constructor(collection, options = {}) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.collectionName = collection.collectionName; + } + get commandName() { + return 'count'; + } + buildCommandDocument(_connection, _session) { + const cmd = { count: this.collectionName }; + if (typeof this.options.maxTimeMS === 'number') { + cmd.maxTimeMS = this.options.maxTimeMS; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + cmd.comment = this.options.comment; + } + return cmd; + } + handleOk(response) { + return response.getNumber('n') ?? 0; + } +} +exports.EstimatedDocumentCountOperation = EstimatedDocumentCountOperation; +(0, operation_1.defineAspects)(EstimatedDocumentCountOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=estimated_document_count.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js.map new file mode 100644 index 00000000..b17cfad7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/estimated_document_count.js.map @@ -0,0 +1 @@ +{"version":3,"file":"estimated_document_count.js","sourceRoot":"","sources":["../../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/node_modules/mongodb/lib/operations/execute_operation.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/execute_operation.js new file mode 100644 index 00000000..45b8299a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/execute_operation.js @@ -0,0 +1,339 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BASE_BACKOFF_MS = void 0; +exports.executeOperation = executeOperation; +exports.autoConnect = autoConnect; +exports.calculateBaseBackoffMS = calculateBaseBackoffMS; +const promises_1 = require("timers/promises"); +const constants_1 = require("../cmap/wire_protocol/constants"); +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const common_1 = require("../sdam/common"); +const server_selection_1 = require("../sdam/server_selection"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const aggregate_1 = require("./aggregate"); +const operation_1 = require("./operation"); +const run_command_1 = require("./run_command"); +const MMAPv1_RETRY_WRITES_ERROR_CODE = error_1.MONGODB_ERROR_CODES.IllegalOperation; +const MMAPv1_RETRY_WRITES_ERROR_MESSAGE = 'This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.'; +/** + * Executes the given operation with provided arguments. + * @internal + * + * @remarks + * Allows for a single point of entry to provide features such as implicit sessions, which + * are required by the Driver Sessions specification in the event that a ClientSession is + * not provided. + * + * The expectation is that this function: + * - Connects the MongoClient if it has not already been connected, see {@link autoConnect} + * - Creates a session if none is provided and cleans up the session it creates + * - Tries an operation and retries under certain conditions, see {@link executeOperationWithRetries} + * + * @typeParam T - The operation's type + * @typeParam TResult - The type of the operation's result, calculated from T + * + * @param client - The MongoClient to execute this operation with + * @param operation - The operation to execute + */ +async function executeOperation(client, operation, timeoutContext) { + if (!(operation instanceof operation_1.AbstractOperation)) { + // TODO(NODE-3483): Extend MongoRuntimeError + throw new error_1.MongoRuntimeError('This method requires a valid operation instance'); + } + const topology = client.topology == null + ? await (0, utils_1.abortable)(autoConnect(client), operation.options) + : client.topology; + // The driver sessions spec mandates that we implicitly create sessions for operations + // that are not explicitly provided with a session. + let session = operation.session; + let owner; + if (session == null) { + owner = Symbol(); + session = client.startSession({ owner, explicit: false }); + } + else if (session.hasEnded) { + throw new error_1.MongoExpiredSessionError('Use of expired sessions is not permitted'); + } + else if (session.snapshotEnabled && + (0, utils_1.maxWireVersion)(topology) < constants_1.MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION) { + throw new error_1.MongoCompatibilityError('Snapshot reads require MongoDB 5.0 or later'); + } + else if (session.client !== client) { + throw new error_1.MongoInvalidArgumentError('ClientSession must be from the same MongoClient'); + } + operation.session ??= session; + const readPreference = operation.readPreference ?? read_preference_1.ReadPreference.primary; + const inTransaction = !!session?.inTransaction(); + const hasReadAspect = operation.hasAspect(operation_1.Aspect.READ_OPERATION); + if (inTransaction && + !readPreference.equals(read_preference_1.ReadPreference.primary) && + (hasReadAspect || operation.commandName === 'runCommand')) { + throw new error_1.MongoTransactionError(`Read preference in a transaction must be primary, not: ${readPreference.mode}`); + } + if (session?.isPinned && session.transaction.isCommitted && !operation.bypassPinningCheck) { + session.unpin(); + } + timeoutContext ??= timeout_1.TimeoutContext.create({ + session, + serverSelectionTimeoutMS: client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: client.s.options.waitQueueTimeoutMS, + timeoutMS: operation.options.timeoutMS + }); + try { + return await executeOperationWithRetries(operation, { + topology, + timeoutContext, + session, + readPreference + }); + } + finally { + if (session?.owner != null && session.owner === owner) { + await session.endSession(); + } + } +} +/** + * Connects a client if it has not yet been connected + * @internal + */ +async function autoConnect(client) { + if (client.topology == null) { + if (client.s.hasBeenClosed) { + throw new error_1.MongoNotConnectedError('Client must be connected before running operations'); + } + client.s.options.__skipPingOnConnect = true; + try { + await client.connect(); + if (client.topology == null) { + throw new error_1.MongoRuntimeError('client.connect did not create a topology but also did not throw'); + } + return client.topology; + } + finally { + delete client.s.options.__skipPingOnConnect; + } + } + return client.topology; +} +/** @internal The base backoff duration in milliseconds */ +exports.BASE_BACKOFF_MS = 100; +/** @internal The maximum backoff duration in milliseconds */ +const MAX_BACKOFF_MS = 10_000; +/** + * @internal + * The server-supplied base backoff duration in milliseconds, if the error carries a usable one. + * + * The server may attach `baseBackoffMS` to an overload error to indicate how long clients should + * back off in place of the driver's default. Only a positive value is honoured: the server disables + * the behaviour by reporting `0`, in which case we fall back to `BASE_BACKOFF_MS`. + */ +function calculateBaseBackoffMS(error) { + if (!(error instanceof error_1.MongoServerError)) + return exports.BASE_BACKOFF_MS; + // The server sends baseBackoffMS as an int64, so its runtime type depends on the client's BSON + // options: a number by default, a Long under `promoteLongs: false`, a bigint under + // `useBigInt64: true`. `Number()` handles all three, so coerce rather than check for `number`. + // `errorResponse` is indexed as `any`; narrow to `unknown` so the checks below are real. + const raw = error.errorResponse.baseBackoffMS; + const isNumeric = typeof raw === 'number' || typeof raw === 'bigint' || typeof raw === 'object'; + const baseBackoffMS = isNumeric ? Number(raw) : NaN; + const useServerValue = Number.isFinite(baseBackoffMS) && baseBackoffMS > 0; + const result = useServerValue ? baseBackoffMS : exports.BASE_BACKOFF_MS; + return result; +} +/** + * Executes an operation and retries as appropriate + * @internal + * + * @remarks + * Implements behaviour described in [Retryable Reads](https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.md) and [Retryable + * Writes](https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.md) specification + * + * This function: + * - performs initial server selection + * - attempts to execute an operation + * - retries the operation if it meets the criteria for a retryable read or a retryable write + * + * @typeParam T - The operation's type + * @typeParam TResult - The type of the operation's result, calculated from T + * + * @param operation - The operation to execute + */ +async function executeOperationWithRetries(operation, { topology, timeoutContext, session, readPreference }) { + let selector; + if (operation.hasAspect(operation_1.Aspect.MUST_SELECT_SAME_SERVER)) { + // GetMore and KillCursor operations must always select the same server, but run through + // server selection to potentially force monitor checks if the server is + // in an unknown state. + selector = (0, server_selection_1.sameServerSelector)(operation.server?.description); + } + else if (operation instanceof aggregate_1.AggregateOperation && operation.hasWriteStage) { + // If operation should try to write to secondary use the custom server selector + // otherwise provide the read preference. + selector = (0, server_selection_1.secondaryWritableServerSelector)(topology.commonWireVersion, readPreference); + } + else { + selector = readPreference; + } + let server = await topology.selectServer(selector, { + session, + operationName: operation.commandName, + timeoutContext, + signal: operation.options.signal, + deprioritizedServers: new server_selection_1.DeprioritizedServers() + }); + const hasReadAspect = operation.hasAspect(operation_1.Aspect.READ_OPERATION); + const hasWriteAspect = operation.hasAspect(operation_1.Aspect.WRITE_OPERATION); + const inTransaction = session?.inTransaction() ?? false; + const willRetryRead = topology.s.options.retryReads && !inTransaction && operation.canRetryRead; + const willRetryWrite = topology.s.options.retryWrites && + !inTransaction && + (0, utils_1.supportsRetryableWrites)(server) && + operation.canRetryWrite; + const willRetry = operation.hasAspect(operation_1.Aspect.RETRYABLE) && + session != null && + ((hasReadAspect && willRetryRead) || (hasWriteAspect && willRetryWrite)); + if (hasWriteAspect && willRetryWrite && session != null) { + operation.options.willRetryWrite = true; + session.incrementTransactionNumber(); + } + const deprioritizedServers = new server_selection_1.DeprioritizedServers(); + let maxAttempts = typeof operation.maxAttempts === 'number' + ? operation.maxAttempts + : willRetry + ? timeoutContext.csotEnabled() + ? Infinity + : 2 + : 1; + let error = null; + for (let attempt = 0; attempt < maxAttempts; attempt++) { + operation.attemptsMade = attempt + 1; + operation.server = server; + try { + try { + const result = await server.command(operation, timeoutContext); + return operation.handleOk(result); + } + catch (error) { + return operation.handleError(error); + } + } + catch (operationError) { + // Should never happen but if it does - propagate the error. + if (!(operationError instanceof error_1.MongoError)) + throw operationError; + // Preserve the original error once a write has been performed. + // Only update to the latest error if no writes were performed. + if (error == null) { + error = operationError; + } + else { + if (!operationError.hasErrorLabel(error_1.MongoErrorLabel.NoWritesPerformed)) { + error = operationError; + } + } + // Reset timeouts + timeoutContext.clear(); + if (hasWriteAspect && operationError.code === MMAPv1_RETRY_WRITES_ERROR_CODE) { + throw new error_1.MongoServerError({ + message: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + errmsg: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + originalError: operationError + }); + } + if (!canRetry(operation, operationError)) { + throw error; + } + if (operationError.hasErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError)) { + const maxOverloadAttempts = topology.s.options.maxAdaptiveRetries + 1; + maxAttempts = Math.min(maxOverloadAttempts, operation.maxAttempts ?? maxOverloadAttempts); + } + if (attempt + 1 >= maxAttempts) { + throw error; + } + if (operationError instanceof error_1.MongoNetworkError && + operation.hasAspect(operation_1.Aspect.CURSOR_CREATING) && + session != null && + session.isPinned && + !session.inTransaction()) { + session.unpin({ force: true, forceClear: true }); + } + if (operationError.hasErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError) && + operation.hasAspect(operation_1.Aspect.CURSOR_CREATING) && + session != null && + session.isPinned && + !session.inTransaction()) { + session.unpin({ force: true }); + } + if (operationError.hasErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError)) { + const baseBackoffMS = calculateBaseBackoffMS(operationError); + // The spec numbers the first retry as attempt 1, while `attempt` here is the zero-based + // index of the attempt that just failed -- hence the `+ 1`. + const backoffMS = Math.random() * Math.min(MAX_BACKOFF_MS, baseBackoffMS * 2 ** (attempt + 1)); + // if the backoff would exhaust the CSOT timeout, short-circuit. + if (timeoutContext.csotEnabled() && backoffMS > timeoutContext.remainingTimeMS) { + throw error; + } + await (0, promises_1.setTimeout)(backoffMS); + } + if (topology.description.type === common_1.TopologyType.Sharded || + (operationError.hasErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError) && + topology.s.options.enableOverloadRetargeting)) { + deprioritizedServers.add(server.description); + } + server = await topology.selectServer(selector, { + session, + operationName: operation.commandName, + deprioritizedServers, + signal: operation.options.signal + }); + if (hasWriteAspect && + !(0, utils_1.supportsRetryableWrites)(server) && + !operationError.hasErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError)) { + throw new error_1.MongoUnexpectedServerResponseError('Selected server does not support retryable writes'); + } + // Batched operations must reset the batch before retry, + // otherwise building a command will build the _next_ batch, not the current batch. + if (operation.hasAspect(operation_1.Aspect.COMMAND_BATCHING)) { + operation.resetBatch(); + } + } + } + throw (error ?? + new error_1.MongoRuntimeError('Should never happen: operation execution loop terminated but no error was recorded.')); + function canRetry(operation, error) { + // SystemOverloadedError is retryable, but must respect retryReads/retryWrites settings + // Check topology options directly (not operation.canRetryRead/Write) because backpressure + // expands retry support beyond traditional retryable reads/writes + // NOTE: Unlike traditional retries, backpressure retries ARE allowed inside transactions + if (error.hasErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError) && + error.hasErrorLabel(error_1.MongoErrorLabel.RetryableError)) { + // runCommand requires BOTH retryReads and retryWrites to be enabled (per spec step 2.4) + if (operation instanceof run_command_1.RunCommandOperation) { + return topology.s.options.retryReads && topology.s.options.retryWrites; + } + // Write-stage aggregates ($out/$merge) require retryWrites + if (operation instanceof aggregate_1.AggregateOperation && operation.hasWriteStage) { + return topology.s.options.retryWrites; + } + // For other operations, check if retries are enabled based on operation type + const canRetryAsRead = hasReadAspect && topology.s.options.retryReads; + const canRetryAsWrite = hasWriteAspect && topology.s.options.retryWrites; + return canRetryAsRead || canRetryAsWrite; + } + // run command is only retryable if we get retryable overload errors + if (operation instanceof run_command_1.RunCommandOperation) { + return false; + } + // batch operations are only retryable if the batch is retryable + if (operation.hasAspect(operation_1.Aspect.COMMAND_BATCHING)) { + return operation.canRetryWrite && (0, error_1.isRetryableWriteError)(error); + } + return ((hasWriteAspect && willRetryWrite && (0, error_1.isRetryableWriteError)(error)) || + (hasReadAspect && willRetryRead && (0, error_1.isRetryableReadError)(error))); + } +} +//# sourceMappingURL=execute_operation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/execute_operation.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/execute_operation.js.map new file mode 100644 index 00000000..b43df78b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/execute_operation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"execute_operation.js","sourceRoot":"","sources":["../../src/operations/execute_operation.ts"],"names":[],"mappings":";;;AAgEA,4CAyEC;AAMD,kCAmBC;AAsBD,wDAaC;AArMD,8CAA6C;AAE7C,+DAA4F;AAC5F,oCAekB;AAElB,wDAAoD;AACpD,2CAA8C;AAC9C,+DAKkC;AAGlC,wCAA4C;AAC5C,oCAA8E;AAC9E,2CAAiD;AACjD,2CAAwD;AACxD,+CAAoD;AAEpD,MAAM,8BAA8B,GAAG,2BAAmB,CAAC,gBAAgB,CAAC;AAC5E,MAAM,iCAAiC,GACrC,oHAAoH,CAAC;AAMvH;;;;;;;;;;;;;;;;;;;GAmBG;AACI,KAAK,UAAU,gBAAgB,CAGpC,MAAmB,EAAE,SAAY,EAAE,cAAsC;IACzE,IAAI,CAAC,CAAC,SAAS,YAAY,6BAAiB,CAAC,EAAE,CAAC;QAC9C,4CAA4C;QAC5C,MAAM,IAAI,yBAAiB,CAAC,iDAAiD,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,QAAQ,GACZ,MAAM,CAAC,QAAQ,IAAI,IAAI;QACrB,CAAC,CAAC,MAAM,IAAA,iBAAS,EAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC;QACzD,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;IAEtB,sFAAsF;IACtF,mDAAmD;IACnD,IAAI,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;IAChC,IAAI,KAAyB,CAAC;IAE9B,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,KAAK,GAAG,MAAM,EAAE,CAAC;QACjB,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5D,CAAC;SAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CA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I,cAAc,IAAI,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC;YAClE,CAAC,aAAa,IAAI,aAAa,IAAI,IAAA,4BAAoB,EAAC,KAAK,CAAC,CAAC,CAChE,CAAC;IACJ,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js new file mode 100644 index 00000000..6c1b2bb6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js @@ -0,0 +1,148 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FindOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const sort_1 = require("../sort"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class FindOperation extends command_1.CommandOperation { + constructor(ns, filter = {}, options = {}) { + super(undefined, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + delete this.options.writeConcern; + this.ns = ns; + if (typeof filter !== 'object' || Array.isArray(filter)) { + throw new error_1.MongoInvalidArgumentError('Query filter must be a plain object or ObjectId'); + } + // special case passing in an ObjectId as a filter + this.filter = filter != null && filter._bsontype === 'ObjectId' ? { _id: filter } : filter; + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? responses_1.ExplainedCursorResponse : responses_1.CursorResponse; + } + get commandName() { + return 'find'; + } + buildOptions(timeoutContext) { + return { + ...this.options, + ...this.bsonOptions, + documentsReturnedIn: 'firstBatch', + session: this.session, + timeoutContext + }; + } + handleOk(response) { + return response; + } + buildCommandDocument() { + return makeFindCommand(this.ns, this.filter, this.options); + } +} +exports.FindOperation = FindOperation; +function makeFindCommand(ns, filter, options) { + const findCommand = { + find: ns.collection, + filter + }; + if (options.sort) { + findCommand.sort = (0, sort_1.formatSort)(options.sort); + } + if (options.projection) { + let projection = options.projection; + if (projection && Array.isArray(projection)) { + projection = projection.length + ? projection.reduce((result, field) => { + result[field] = 1; + return result; + }, {}) + : { _id: 1 }; + } + findCommand.projection = projection; + } + if (options.hint) { + findCommand.hint = (0, utils_1.normalizeHintField)(options.hint); + } + if (typeof options.skip === 'number') { + findCommand.skip = options.skip; + } + if (typeof options.limit === 'number') { + if (options.limit < 0) { + findCommand.limit = -options.limit; + findCommand.singleBatch = true; + } + else { + findCommand.limit = options.limit; + } + } + if (typeof options.batchSize === 'number') { + if (options.batchSize < 0) { + findCommand.limit = -options.batchSize; + } + else { + if (options.batchSize === options.limit) { + // Spec dictates that if these are equal the batchSize should be one more than the + // limit to avoid leaving the cursor open. + findCommand.batchSize = options.batchSize + 1; + } + else { + findCommand.batchSize = options.batchSize; + } + } + } + if (typeof options.singleBatch === 'boolean') { + findCommand.singleBatch = options.singleBatch; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + findCommand.comment = options.comment; + } + if (options.max) { + findCommand.max = options.max; + } + if (options.min) { + findCommand.min = options.min; + } + if (typeof options.returnKey === 'boolean') { + findCommand.returnKey = options.returnKey; + } + if (typeof options.showRecordId === 'boolean') { + findCommand.showRecordId = options.showRecordId; + } + if (typeof options.tailable === 'boolean') { + findCommand.tailable = options.tailable; + } + if (typeof options.oplogReplay === 'boolean') { + findCommand.oplogReplay = options.oplogReplay; + } + if (typeof options.timeout === 'boolean') { + findCommand.noCursorTimeout = !options.timeout; + } + else if (typeof options.noCursorTimeout === 'boolean') { + findCommand.noCursorTimeout = options.noCursorTimeout; + } + if (typeof options.awaitData === 'boolean') { + findCommand.awaitData = options.awaitData; + } + if (typeof options.allowPartialResults === 'boolean') { + findCommand.allowPartialResults = options.allowPartialResults; + } + if (typeof options.allowDiskUse === 'boolean') { + findCommand.allowDiskUse = options.allowDiskUse; + } + if (options.let) { + findCommand.let = options.let; + } + return findCommand; +} +(0, operation_1.defineAspects)(FindOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=find.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js.map new file mode 100644 index 00000000..df9b5b9d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find.js.map @@ -0,0 +1 @@ +{"version":3,"file":"find.js","sourceRoot":"","sources":["../../src/operations/find.ts"],"names":[],"mappings":";;;AACA,+DAA0F;AAE1F,oCAAqD;AAGrD,kCAAgD;AAEhD,oCAAqE;AACrE,uCAAkG;AAClG,2CAA+D;AAoE/D,gBAAgB;AAChB,MAAa,aAAc,SAAQ,0BAAgC;IAajE,YAAY,EAAoB,EAAE,SAAmB,EAAE,EAAE,UAAuB,EAAE;QAChF,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAbnB,iCAA4B,GAAG,0BAAc,CAAC;QAerD,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QACjC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,iCAAyB,CAAC,iDAAiD,CAAC,CAAC;QACzF,CAAC;QAED,kDAAkD;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,C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CAAC;IAED,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC3C,WAAW,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAC5C,CAAC;IAED,IAAI,OAAO,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACrD,WAAW,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAChE,CAAC;IACD,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QAC9C,WAAW,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAClD,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAChC,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,IAAA,yBAAa,EAAC,aAAa,EAAE;IAC3B,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js new file mode 100644 index 00000000..15d1c62c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js @@ -0,0 +1,154 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FindOneAndUpdateOperation = exports.FindOneAndReplaceOperation = exports.FindOneAndDeleteOperation = exports.FindAndModifyOperation = exports.ReturnDocument = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const sort_1 = require("../sort"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @public */ +exports.ReturnDocument = Object.freeze({ + BEFORE: 'before', + AFTER: 'after' +}); +function configureFindAndModifyCmdBaseUpdateOpts(cmdBase, options) { + cmdBase.new = options.returnDocument === exports.ReturnDocument.AFTER; + cmdBase.upsert = options.upsert === true; + if (options.bypassDocumentValidation === true) { + cmdBase.bypassDocumentValidation = options.bypassDocumentValidation; + } + return cmdBase; +} +/** @internal */ +class FindAndModifyOperation extends command_1.CommandOperation { + constructor(collection, query, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + // force primary read preference + this.readPreference = read_preference_1.ReadPreference.primary; + this.collection = collection; + this.query = query; + } + get commandName() { + return 'findAndModify'; + } + buildCommandDocument(_connection, _session) { + const options = this.options; + const command = { + findAndModify: this.collection.collectionName, + query: this.query, + remove: false, + new: false, + upsert: false + }; + options.includeResultMetadata ??= false; + const sort = (0, sort_1.formatSort)(options.sort); + if (sort) { + command.sort = sort; + } + if (options.projection) { + command.fields = options.projection; + } + if (options.maxTimeMS) { + command.maxTimeMS = options.maxTimeMS; + } + // Decorate the findAndModify command with the write Concern + if (options.writeConcern) { + command.writeConcern = options.writeConcern; + } + if (options.let) { + command.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + (0, utils_1.decorateWithCollation)(command, options); + if (options.hint) { + command.hint = options.hint; + } + return command; + } + handleOk(response) { + const result = super.handleOk(response); + return this.options.includeResultMetadata ? result : (result.value ?? null); + } +} +exports.FindAndModifyOperation = FindAndModifyOperation; +/** @internal */ +class FindOneAndDeleteOperation extends FindAndModifyOperation { + constructor(collection, filter, options) { + // Basic validation + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + super(collection, filter, options); + } + buildCommandDocument(connection, session) { + const document = super.buildCommandDocument(connection, session); + document.remove = true; + return document; + } +} +exports.FindOneAndDeleteOperation = FindOneAndDeleteOperation; +/** @internal */ +class FindOneAndReplaceOperation extends FindAndModifyOperation { + constructor(collection, filter, replacement, options) { + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + if (replacement == null || typeof replacement !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "replacement" must be an object'); + } + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + super(collection, filter, options); + this.replacement = replacement; + } + buildCommandDocument(connection, session) { + const document = super.buildCommandDocument(connection, session); + document.update = this.replacement; + configureFindAndModifyCmdBaseUpdateOpts(document, this.options); + return document; + } +} +exports.FindOneAndReplaceOperation = FindOneAndReplaceOperation; +/** @internal */ +class FindOneAndUpdateOperation extends FindAndModifyOperation { + constructor(collection, filter, update, options) { + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + if (update == null || typeof update !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "update" must be an object'); + } + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + super(collection, filter, options); + this.update = update; + this.options = options; + } + buildCommandDocument(connection, session) { + const document = super.buildCommandDocument(connection, session); + document.update = this.update; + configureFindAndModifyCmdBaseUpdateOpts(document, this.options); + if (this.options.arrayFilters) { + document.arrayFilters = this.options.arrayFilters; + } + return document; + } +} +exports.FindOneAndUpdateOperation = FindOneAndUpdateOperation; +(0, operation_1.defineAspects)(FindAndModifyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=find_and_modify.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js.map new file mode 100644 index 00000000..6b40c2c0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/find_and_modify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"find_and_modify.js","sourceRoot":"","sources":["../../src/operations/find_and_modify.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAElE,oCAAqD;AACrD,wDAAoD;AAEpD,kCAAiE;AACjE,oCAAqE;AAErE,uCAA2E;AAC3E,2CAAoD;AAEpD,cAAc;AACD,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC,CAAC;AAsFZ,SAAS,uCAAuC,CAC9C,OAA6B,EAC7B,OAA2D;IAE3D,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,KAAK,sBAAc,CAAC,KAAK,CAAC;IAC9D,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC;IAEzC,IAAI,OAAO,CAAC,wBAAwB,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IACtE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,MAAa,sBAAuB,SAAQ,0BAA0B;IAOpE,YACE,UAAsB,EACtB,KAAe,EACf,OAAqF;QAErF,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAXpB,iCAA4B,GAAG,2BAAe,CAAC;QAYtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,gCAAgC;QAChC,IAAI,CAAC,cAAc,GAAG,gCAAc,CAAC,OAAO,CAAC;QAE7C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,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CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEQ,oBAAoB,CAC3B,UAAsB,EACtB,OAAuB;QAEvB,MAAM,QAAQ,GAAG,KAAK,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACjE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC9B,uCAAuC,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAEhE,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC9B,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QACpD,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAzCD,8DAyCC;AAED,IAAA,yBAAa,EAAC,sBAAsB,EAAE;IACpC,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js new file mode 100644 index 00000000..cc4bccd9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetMoreOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const operation_1 = require("./operation"); +/** @internal */ +class GetMoreOperation extends operation_1.AbstractOperation { + constructor(ns, cursorId, server, options) { + super(options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = options; + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + get commandName() { + return 'getMore'; + } + buildCommand(_connection) { + if (this.cursorId == null || this.cursorId.isZero()) { + throw new error_1.MongoRuntimeError('Unable to iterate cursor with no id'); + } + const collection = this.ns.collection; + if (collection == null) { + // Cursors should have adopted the namespace returned by MongoDB + // which should always defined a collection name (even a pseudo one, ex. db.aggregate()) + throw new error_1.MongoRuntimeError('A collection name must be determined before getMore'); + } + const getMoreCmd = { + getMore: this.cursorId, + collection + }; + if (typeof this.options.batchSize === 'number') { + getMoreCmd.batchSize = Math.abs(this.options.batchSize); + } + if (typeof this.options.maxAwaitTimeMS === 'number') { + getMoreCmd.maxTimeMS = this.options.maxAwaitTimeMS; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + getMoreCmd.comment = this.options.comment; + } + return getMoreCmd; + } + buildOptions(timeoutContext) { + return { + returnFieldSelector: null, + documentsReturnedIn: 'nextBatch', + timeoutContext, + ...this.options + }; + } + handleOk(response) { + return response; + } +} +exports.GetMoreOperation = GetMoreOperation; +(0, operation_1.defineAspects)(GetMoreOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.MUST_SELECT_SAME_SERVER]); +//# sourceMappingURL=get_more.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js.map new file mode 100644 index 00000000..9c4739e4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/get_more.js.map @@ -0,0 +1 @@ +{"version":3,"file":"get_more.js","sourceRoot":"","sources":["../../src/operations/get_more.ts"],"names":[],"mappings":";;;AAEA,+DAAiE;AACjE,oCAA6C;AAI7C,2CAA8F;AA6B9F,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,6BAAiC;IAKrE,YAAY,EAAoB,EAAE,QAAc,EAAE,MAAc,EAAE,OAAuB;QACvF,KAAK,CAAC,OAAO,CAAC,CAAC;QALR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QAC5C,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO;YACL,mBAAmB,EAAE,IAAI;YACzB,mBAAmB,EAAE,WAAW;YAChC,cAAc;YACd,GAAG,IAAI,CAAC,OAAO;SAChB,CAAC;IACJ,CAAC;IAEQ,QAAQ,CACf,QAAgE;QAEhE,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAlED,4CAkEC;AAED,IAAA,yBAAa,EAAC,gBAAgB,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js new file mode 100644 index 00000000..e6a03ea1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js @@ -0,0 +1,180 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListIndexesOperation = exports.DropIndexOperation = exports.CreateIndexesOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +const VALID_INDEX_OPTIONS = new Set([ + 'background', + 'unique', + 'name', + 'partialFilterExpression', + 'sparse', + 'hidden', + 'expireAfterSeconds', + 'storageEngine', + 'collation', + 'version', + // text indexes + 'weights', + 'default_language', + 'language_override', + 'textIndexVersion', + // 2d-sphere indexes + '2dsphereIndexVersion', + // 2d indexes + 'bits', + 'min', + 'max', + // geoHaystack Indexes + 'bucketSize', + // wildcard indexes + 'wildcardProjection' +]); +function isIndexDirection(x) { + return (typeof x === 'number' || x === '2d' || x === '2dsphere' || x === 'text' || x === 'geoHaystack'); +} +function isSingleIndexTuple(t) { + return Array.isArray(t) && t.length === 2 && isIndexDirection(t[1]); +} +/** + * Converts an `IndexSpecification`, which can be specified in multiple formats, into a + * valid `key` for the createIndexes command. + */ +function constructIndexDescriptionMap(indexSpec) { + const key = new Map(); + const indexSpecs = !Array.isArray(indexSpec) || isSingleIndexTuple(indexSpec) ? [indexSpec] : indexSpec; + // Iterate through array and handle different types + for (const spec of indexSpecs) { + if (typeof spec === 'string') { + key.set(spec, 1); + } + else if (Array.isArray(spec)) { + key.set(spec[0], spec[1] ?? 1); + } + else if (spec instanceof Map) { + for (const [property, value] of spec) { + key.set(property, value); + } + } + else if ((0, utils_1.isObject)(spec)) { + for (const [property, value] of Object.entries(spec)) { + key.set(property, value); + } + } + } + return key; +} +/** + * Receives an index description and returns a modified index description which has had invalid options removed + * from the description and has mapped the `version` option to the `v` option. + */ +function resolveIndexDescription(description) { + const validProvidedOptions = Object.entries(description).filter(([optionName]) => VALID_INDEX_OPTIONS.has(optionName)); + return Object.fromEntries( + // we support the `version` option, but the `createIndexes` command expects it to be the `v` + validProvidedOptions.map(([name, value]) => (name === 'version' ? ['v', value] : [name, value]))); +} +/** @internal */ +class CreateIndexesOperation extends command_1.CommandOperation { + constructor(parent, collectionName, indexes, options) { + super(parent, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + // collation is set on each index, it should not be defined at the root + this.options.collation = undefined; + this.collectionName = collectionName; + this.indexes = indexes.map((userIndex) => { + // Ensure the key is a Map to preserve index key ordering + const key = userIndex.key instanceof Map ? userIndex.key : new Map(Object.entries(userIndex.key)); + const name = userIndex.name ?? Array.from(key).flat().join('_'); + const validIndexOptions = resolveIndexDescription(userIndex); + return { + ...validIndexOptions, + name, + key + }; + }); + this.ns = parent.s.namespace; + } + static fromIndexDescriptionArray(parent, collectionName, indexes, options) { + return new CreateIndexesOperation(parent, collectionName, indexes, options); + } + static fromIndexSpecification(parent, collectionName, indexSpec, options = {}) { + const key = constructIndexDescriptionMap(indexSpec); + const description = { ...options, key }; + return new CreateIndexesOperation(parent, collectionName, [description], options); + } + get commandName() { + return 'createIndexes'; + } + buildCommandDocument(_connection) { + const options = this.options; + const indexes = this.indexes; + const cmd = { createIndexes: this.collectionName, indexes }; + if (options.commitQuorum != null) { + cmd.commitQuorum = options.commitQuorum; + } + return cmd; + } + handleOk(_response) { + const indexNames = this.indexes.map(index => index.name || ''); + return indexNames; + } +} +exports.CreateIndexesOperation = CreateIndexesOperation; +/** @internal */ +class DropIndexOperation extends command_1.CommandOperation { + constructor(collection, indexName, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + this.collection = collection; + this.indexName = indexName; + this.ns = collection.fullNamespace; + } + get commandName() { + return 'dropIndexes'; + } + buildCommandDocument(_connection) { + return { dropIndexes: this.collection.collectionName, index: this.indexName }; + } +} +exports.DropIndexOperation = DropIndexOperation; +/** @internal */ +class ListIndexesOperation extends command_1.CommandOperation { + constructor(collection, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + delete this.options.writeConcern; + this.collectionNamespace = collection.s.namespace; + } + get commandName() { + return 'listIndexes'; + } + buildCommandDocument(_connection) { + const cursor = this.options.batchSize ? { batchSize: this.options.batchSize } : {}; + const command = { listIndexes: this.collectionNamespace.collection, cursor }; + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + return command; + } + handleOk(response) { + return response; + } +} +exports.ListIndexesOperation = ListIndexesOperation; +(0, operation_1.defineAspects)(ListIndexesOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +(0, operation_1.defineAspects)(CreateIndexesOperation, [operation_1.Aspect.WRITE_OPERATION, operation_1.Aspect.SUPPORTS_RAW_DATA]); +(0, operation_1.defineAspects)(DropIndexOperation, [operation_1.Aspect.WRITE_OPERATION, operation_1.Aspect.SUPPORTS_RAW_DATA]); +//# sourceMappingURL=indexes.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js.map new file mode 100644 index 00000000..7d438f13 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/indexes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indexes.js","sourceRoot":"","sources":["../../src/operations/indexes.ts"],"names":[],"mappings":";;;AAEA,+DAAkF;AAIlF,oCAA2D;AAC3D,uCAKmB;AACnB,2CAAoD;AAEpD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,yBAAyB;IACzB,QAAQ;IACR,QAAQ;IACR,oBAAoB;IACpB,eAAe;IACf,WAAW;IACX,SAAS;IAET,eAAe;IACf,SAAS;IACT,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAElB,oBAAoB;IACpB,sBAAsB;IAEtB,aAAa;IACb,MAAM;IACN,KAAK;IACL,KAAK;IAEL,sBAAsB;IACtB,YAAY;IAEZ,mBAAmB;IACnB,oBAAoB;CACrB,CAAC,CAAC;AAaH,SAAS,gBAAgB,CAAC,CAAU;IAClC,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,aAAa,CAC/F,CAAC;AACJ,CAAC;AAqGD,SAAS,kBAAkB,CAAC,CAAU;IACpC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,S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O,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnF,MAAM,OAAO,GAAa,EAAE,WAAW,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAEvF,iEAAiE;QACjE,gDAAgD;QAChD,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACzC,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEQ,QAAQ,CACf,QAAgE;QAEhE,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA3CD,oDA2CC;AAED,IAAA,yBAAa,EAAC,oBAAoB,EAAE;IAClC,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,sBAAsB,EAAE,CAAC,kBAAM,CAAC,eAAe,EAAE,kBAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAC1F,IAAA,yBAAa,EAAC,kBAAkB,EAAE,CAAC,kBAAM,CAAC,eAAe,EAAE,kBAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js new file mode 100644 index 00000000..c92d17f5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsertOneOperation = exports.InsertOperation = void 0; +const commands_1 = require("../cmap/commands"); +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class InsertOperation extends command_1.CommandOperation { + constructor(ns, documents, options, serializedOperations) { + super(undefined, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = { ...options, checkKeys: options.checkKeys ?? false }; + this.ns = ns; + this.documents = documents; + this.serializedOperations = serializedOperations; + } + get commandName() { + return 'insert'; + } + buildCommandDocument(_connection, _session) { + const options = this.options ?? {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command = { + insert: this.ns.collection, + documents: this.serializedOperations + ? (0, commands_1.makeDocumentSequence)('documents', this.documents, this.serializedOperations) + : this.documents, + ordered + }; + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + return command; + } +} +exports.InsertOperation = InsertOperation; +class InsertOneOperation extends InsertOperation { + constructor(collection, doc, options) { + super(collection.s.namespace, [(0, utils_1.maybeAddIdToDocuments)(collection, doc, options)], options); + } + handleOk(response) { + const res = super.handleOk(response); + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) { + // This should be a WriteError but we can't change it now because of error hierarchy + throw new error_1.MongoServerError(res.writeErrors[0]); + } + return { + acknowledged: this.writeConcern?.w !== 0, + insertedId: this.documents[0]._id + }; + } +} +exports.InsertOneOperation = InsertOneOperation; +(0, operation_1.defineAspects)(InsertOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +(0, operation_1.defineAspects)(InsertOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=insert.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js.map new file mode 100644 index 00000000..26982dac --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/insert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"insert.js","sourceRoot":"","sources":["../../src/operations/insert.ts"],"names":[],"mappings":";;;AAGA,+CAAwD;AACxD,+DAAkE;AAElE,oCAA4C;AAG5C,oCAAwE;AACxE,uCAA2E;AAC3E,2CAAoD;AACpD,gBAAgB;AAChB,MAAa,eAAgB,SAAQ,0BAA0B;IAQ7D,YACE,EAAoB,EACpB,SAAqB,EACrB,OAAyB,EACzB,oBAAmC;QAEnC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAbnB,iCAA4B,GAAG,2BAAe,CAAC;QActD,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,KAAK,EAAE,CAAC;QACrE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,QAAiB,CAAC;IAC3B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9E,MAAM,OAAO,GAAa;YACxB,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,UAAU;YAC1B,SAAS,EAAE,IAAI,CAAC,oBAAoB;gBAClC,CAAC,CAAC,IAAA,+BAAoB,EAAC,WAAW,EAAE,IA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;IAC7B,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,kBAAkB,EAAE;IAChC,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js new file mode 100644 index 00000000..6b883705 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KillCursorsOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const operation_1 = require("./operation"); +class KillCursorsOperation extends operation_1.AbstractOperation { + constructor(cursorId, ns, server, options) { + super(options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + get commandName() { + return 'killCursors'; + } + buildCommand(_connection, _session) { + const killCursors = this.ns.collection; + if (killCursors == null) { + // Cursors should have adopted the namespace returned by MongoDB + // which should always defined a collection name (even a pseudo one, ex. db.aggregate()) + throw new error_1.MongoRuntimeError('A collection name must be determined before killCursors'); + } + const killCursorsCommand = { + killCursors, + cursors: [this.cursorId] + }; + return killCursorsCommand; + } + buildOptions(timeoutContext) { + return { + session: this.session, + timeoutContext + }; + } + handleError(_error) { + // The driver should never emit errors from killCursors, this is spec-ed behavior + } +} +exports.KillCursorsOperation = KillCursorsOperation; +(0, operation_1.defineAspects)(KillCursorsOperation, [operation_1.Aspect.MUST_SELECT_SAME_SERVER]); +//# sourceMappingURL=kill_cursors.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js.map new file mode 100644 index 00000000..093ce1f6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/kill_cursors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kill_cursors.js","sourceRoot":"","sources":["../../src/operations/kill_cursors.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAClE,oCAA8D;AAK9D,2CAA8F;AAY9F,MAAa,oBAAqB,SAAQ,6BAAuB;IAI/D,YAAY,QAAc,EAAE,EAAoB,EAAE,MAAc,EAAE,OAAyB;QACzF,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,iCAA4B,GAAG,2BAAe,CAAC;QAKtD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,aAAsB,CAAC;IAChC,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC;QACvC,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YACxB,gEAAgE;YAChE,wFAAwF;YACxF,MAAM,IAAI,yBAAiB,CAAC,yDAAyD,CAAC,CAAC;QACzF,CAAC;QAED,MAAM,kBAAkB,GAAuB;YAC7C,WAAW;YACX,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;SACzB,CAAC;QAEF,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,cAAc;SACf,CAAC;IACJ,CAAC;IAEQ,WAAW,CAAC,MAAkB;QACrC,iFAAiF;IACnF,CAAC;CACF;AAzCD,oDAyCC;AAED,IAAA,yBAAa,EAAC,oBAAoB,EAAE,CAAC,kBAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js new file mode 100644 index 00000000..cda022b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListCollectionsOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class ListCollectionsOperation extends command_1.CommandOperation { + constructor(db, filter, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + delete this.options.writeConcern; + this.db = db; + this.filter = filter; + this.nameOnly = !!this.options.nameOnly; + this.authorizedCollections = !!this.options.authorizedCollections; + if (typeof this.options.batchSize === 'number') { + this.batchSize = this.options.batchSize; + } + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? responses_1.ExplainedCursorResponse : responses_1.CursorResponse; + } + get commandName() { + return 'listCollections'; + } + buildCommandDocument(_connection) { + const command = { + listCollections: 1, + filter: this.filter, + cursor: this.batchSize ? { batchSize: this.batchSize } : {}, + nameOnly: this.nameOnly, + authorizedCollections: this.authorizedCollections + }; + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + return command; + } + handleOk(response) { + return response; + } +} +exports.ListCollectionsOperation = ListCollectionsOperation; +(0, operation_1.defineAspects)(ListCollectionsOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=list_collections.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js.map new file mode 100644 index 00000000..040054b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_collections.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list_collections.js","sourceRoot":"","sources":["../../src/operations/list_collections.ts"],"names":[],"mappings":";;;AAEA,+DAA0F;AAI1F,uCAA2E;AAC3E,2CAAoD;AAmBpD,gBAAgB;AAChB,MAAa,wBAAyB,SAAQ,0BAAgC;IAgB5E,YAAY,EAAM,EAAE,MAAgB,EAAE,OAAgC;QACpE,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAhBZ,iCAA4B,GAAG,0BAAc,CAAC;QAkBrD,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QACjC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACxC,IAAI,CAAC,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAElE,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC/C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QAC1C,CAAC;QAED,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,mCAAuB,CAAC,CAAC,CAAC,0BAAc,CAAC;IAC9F,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,iBAA0B,CAAC;IACpC,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,MAAM,OAAO,GAAa;YACxB,eAAe,EAAE,CAAC;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE;YAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;SAClD,CAAC;QAEF,iEAAiE;QACjE,gDAAgD;QAChD,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACzC,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEQ,QAAQ,CACf,QAAgE;QAEhE,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA5DD,4DA4DC;AAcD,IAAA,yBAAa,EAAC,wBAAwB,EAAE;IACtC,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js new file mode 100644 index 00000000..4c60b1de --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListDatabasesOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class ListDatabasesOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + this.ns = new utils_1.MongoDBNamespace('admin', '$cmd'); + } + get commandName() { + return 'listDatabases'; + } + buildCommandDocument(_connection, _session) { + const cmd = { listDatabases: 1 }; + if (typeof this.options.nameOnly === 'boolean') { + cmd.nameOnly = this.options.nameOnly; + } + if (this.options.filter) { + cmd.filter = this.options.filter; + } + if (typeof this.options.authorizedDatabases === 'boolean') { + cmd.authorizedDatabases = this.options.authorizedDatabases; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + cmd.comment = this.options.comment; + } + return cmd; + } +} +exports.ListDatabasesOperation = ListDatabasesOperation; +(0, operation_1.defineAspects)(ListDatabasesOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.RETRYABLE]); +//# sourceMappingURL=list_databases.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js.map new file mode 100644 index 00000000..41a9b85e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/list_databases.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list_databases.js","sourceRoot":"","sources":["../../src/operations/list_databases.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAGlE,oCAA4C;AAC5C,uCAA2E;AAC3E,2CAAoD;AAoBpD,gBAAgB;AAChB,MAAa,sBAAuB,SAAQ,0BAAqC;IAI/E,YAAY,EAAM,EAAE,OAA8B;QAChD,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAJZ,iCAA4B,GAAG,2BAAe,CAAC;QAKtD,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,EAAE,GAAG,IAAI,wBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,eAAwB,CAAC;IAClC,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,MAAM,GAAG,GAAa,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;QAE3C,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC/C,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACvC,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACxB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QACnC,CAAC;QAED,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAC1D,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC;QAC7D,CAAC;QAED,iEAAiE;QACjE,gDAAgD;QAChD,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACvC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACrC,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AArCD,wDAqCC;AAED,IAAA,yBAAa,EAAC,sBAAsB,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,SAAS,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js new file mode 100644 index 00000000..028cd87f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbstractOperation = exports.Aspect = void 0; +exports.defineAspects = defineAspects; +const bson_1 = require("../bson"); +const read_preference_1 = require("../read_preference"); +exports.Aspect = { + READ_OPERATION: Symbol('READ_OPERATION'), + WRITE_OPERATION: Symbol('WRITE_OPERATION'), + RETRYABLE: Symbol('RETRYABLE'), + EXPLAINABLE: Symbol('EXPLAINABLE'), + SKIP_COLLATION: Symbol('SKIP_COLLATION'), + CURSOR_CREATING: Symbol('CURSOR_CREATING'), + MUST_SELECT_SAME_SERVER: Symbol('MUST_SELECT_SAME_SERVER'), + COMMAND_BATCHING: Symbol('COMMAND_BATCHING'), + SUPPORTS_RAW_DATA: Symbol('SUPPORTS_RAW_DATA') +}; +/** + * This class acts as a parent class for any operation and is responsible for setting this.options, + * as well as setting and getting a session. + * Additionally, this class implements `hasAspect`, which determines whether an operation has + * a specific aspect. + * @internal + */ +class AbstractOperation { + constructor(options = {}) { + this.readPreference = this.hasAspect(exports.Aspect.WRITE_OPERATION) + ? read_preference_1.ReadPreference.primary + : (read_preference_1.ReadPreference.fromOptions(options) ?? read_preference_1.ReadPreference.primary); + // Pull the BSON serialize options from the already-resolved options + this.bsonOptions = (0, bson_1.resolveBSONOptions)(options); + this._session = options.session != null ? options.session : undefined; + this.options = options; + this.bypassPinningCheck = !!options.bypassPinningCheck; + this.attemptsMade = 0; + } + hasAspect(aspect) { + const ctor = this.constructor; + if (ctor.aspects == null) { + return false; + } + return ctor.aspects.has(aspect); + } + // Make sure the session is not writable from outside this class. + get session() { + return this._session; + } + set session(session) { + this._session = session; + } + clearSession() { + this._session = undefined; + } + resetBatch() { + return true; + } + get canRetryRead() { + return this.hasAspect(exports.Aspect.RETRYABLE) && this.hasAspect(exports.Aspect.READ_OPERATION); + } + get canRetryWrite() { + return this.hasAspect(exports.Aspect.RETRYABLE) && this.hasAspect(exports.Aspect.WRITE_OPERATION); + } + /** + * Given an instance of a MongoDBResponse, map the response to the correct result type. For + * example, a `CountOperation` might map the response as follows: + * + * ```typescript + * override handleOk(response: InstanceType): TResult { + * return response.toObject(this.bsonOptions).n ?? 0; + * } + * + * // or, with type safety: + * override handleOk(response: InstanceType): TResult { + * return response.getNumber('n') ?? 0; + * } + * ``` + */ + handleOk(response) { + return response.toObject(this.bsonOptions); + } + /** + * Optional. + * + * If the operation performs error handling, such as wrapping, renaming the error, or squashing errors + * this method can be overridden. + */ + handleError(error) { + throw error; + } +} +exports.AbstractOperation = AbstractOperation; +function defineAspects(operation, aspects) { + if (!Array.isArray(aspects) && !(aspects instanceof Set)) { + aspects = [aspects]; + } + aspects = new Set(aspects); + Object.defineProperty(operation, 'aspects', { + value: aspects, + writable: false + }); + return aspects; +} +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js.map new file mode 100644 index 00000000..78a6c91b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/operation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/operations/operation.ts"],"names":[],"mappings":";;;AA6KA,sCAeC;AA3LD,kCAAuF;AAGvF,wDAA6E;AAMhE,QAAA,MAAM,GAAG;IACpB,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAC1C,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D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B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,cAAM,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,cAAM,CAAC,cAAc,CAAC,CAAC;IACnF,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,SAAS,CAAC,cAAM,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,cAAM,CAAC,eAAe,CAAC,CAAC;IACpF,CAAC;IAaD;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,QAAgE;QACvE,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAY,CAAC;IACxD,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,KAAiB;QAC3B,MAAM,KAAK,CAAC;IACd,CAAC;CACF;AArHD,8CAqHC;AAED,SAAgB,aAAa,CAC3B,SAAoC,EACpC,OAAwC;IAExC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,YAAY,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE;QAC1C,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js new file mode 100644 index 00000000..f2d97d45 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProfilingLevelOperation = void 0; +const bson_1 = require("../bson"); +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const command_1 = require("./command"); +class ProfilingLevelResponse extends responses_1.MongoDBResponse { + get was() { + return this.get('was', bson_1.BSONType.int, true); + } +} +/** @internal */ +class ProfilingLevelOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = ProfilingLevelResponse; + this.options = options; + } + get commandName() { + return 'profile'; + } + buildCommandDocument(_connection) { + return { profile: -1 }; + } + handleOk(response) { + if (response.ok === 1) { + const was = response.was; + if (was === 0) + return 'off'; + if (was === 1) + return 'slow_only'; + if (was === 2) + return 'all'; + throw new error_1.MongoUnexpectedServerResponseError(`Illegal profiling level value ${was}`); + } + else { + throw new error_1.MongoUnexpectedServerResponseError('Error with profile command'); + } + } +} +exports.ProfilingLevelOperation = ProfilingLevelOperation; +//# sourceMappingURL=profiling_level.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js.map new file mode 100644 index 00000000..9e3f982c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/profiling_level.js.map @@ -0,0 +1 @@ +{"version":3,"file":"profiling_level.js","sourceRoot":"","sources":["../../src/operations/profiling_level.ts"],"names":[],"mappings":";;;AAAA,kCAAkD;AAElD,+DAAkE;AAElE,oCAA8D;AAC9D,uCAA2E;AAK3E,MAAM,sBAAuB,SAAQ,2BAAe;IAClD,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,eAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,0BAAwB;IAInE,YAAY,EAAM,EAAE,OAA8B;QAChD,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAJZ,iCAA4B,GAAG,sBAAsB,CAAC;QAK7D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,SAAkB,CAAC;IAC5B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC;IACzB,CAAC;IAEQ,QAAQ,CAAC,QAAgE;QAChF,IAAI,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;YACzB,IAAI,GAAG,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC5B,IAAI,GAAG,KAAK,CAAC;gBAAE,OAAO,WAAW,CAAC;YAClC,IAAI,GAAG,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC5B,MAAM,IAAI,0CAAkC,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;QACvF,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,0CAAkC,CAAC,4BAA4B,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;CACF;AA5BD,0DA4BC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js new file mode 100644 index 00000000..b45c3bd6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RemoveUserOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class RemoveUserOperation extends command_1.CommandOperation { + constructor(db, username, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.username = username; + } + get commandName() { + return 'dropUser'; + } + buildCommandDocument(_connection) { + return { dropUser: this.username }; + } + handleOk(_response) { + return true; + } +} +exports.RemoveUserOperation = RemoveUserOperation; +(0, operation_1.defineAspects)(RemoveUserOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=remove_user.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js.map new file mode 100644 index 00000000..ff572dcf --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/remove_user.js.map @@ -0,0 +1 @@ +{"version":3,"file":"remove_user.js","sourceRoot":"","sources":["../../src/operations/remove_user.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAElE,uCAA2E;AAC3E,2CAAoD;AAKpD,gBAAgB;AAChB,MAAa,mBAAoB,SAAQ,0BAAyB;IAKhE,YAAY,EAAM,EAAE,QAAgB,EAAE,OAA0B;QAC9D,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QALZ,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,UAAmB,CAAC;IAC7B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IACrC,CAAC;IAEQ,QAAQ,CAAC,SAAiE;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtBD,kDAsBC;AAED,IAAA,yBAAa,EAAC,mBAAmB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js new file mode 100644 index 00000000..05b2fe41 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RenameOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const collection_1 = require("../collection"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class RenameOperation extends command_1.CommandOperation { + constructor(collection, newName, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.newName = newName; + this.options = options; + this.ns = new utils_1.MongoDBNamespace('admin', '$cmd'); + } + get commandName() { + return 'renameCollection'; + } + buildCommandDocument(_connection, _session) { + const renameCollection = this.collection.namespace; + const to = this.collection.s.namespace.withCollection(this.newName).toString(); + const dropTarget = typeof this.options.dropTarget === 'boolean' ? this.options.dropTarget : false; + return { + renameCollection, + to, + dropTarget + }; + } + handleOk(_response) { + return new collection_1.Collection(this.collection.db, this.newName, this.collection.s.options); + } +} +exports.RenameOperation = RenameOperation; +(0, operation_1.defineAspects)(RenameOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=rename.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js.map new file mode 100644 index 00000000..866b66e1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/rename.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rename.js","sourceRoot":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kCC;AAED,IAAA,yBAAa,EAAC,eAAe,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js new file mode 100644 index 00000000..67301d1f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RunCursorCommandOperation = exports.RunCommandOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const operation_1 = require("../operations/operation"); +/** @internal */ +class RunCommandOperation extends operation_1.AbstractOperation { + constructor(namespace, command, options) { + super(options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.command = command; + this.options = options; + this.ns = namespace.withCollection('$cmd'); + } + get commandName() { + return 'runCommand'; + } + buildCommand(_connection, _session) { + return this.command; + } + buildOptions(timeoutContext) { + return { + ...this.options, + session: this.session, + timeoutContext, + signal: this.options.signal, + readPreference: this.options.readPreference + }; + } +} +exports.RunCommandOperation = RunCommandOperation; +/** + * @internal + * + * A specialized subclass of RunCommandOperation for cursor-creating commands. + */ +class RunCursorCommandOperation extends RunCommandOperation { + constructor() { + super(...arguments); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + } + handleOk(response) { + return response; + } +} +exports.RunCursorCommandOperation = RunCursorCommandOperation; +//# sourceMappingURL=run_command.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js.map new file mode 100644 index 00000000..a86ee7c5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/run_command.js.map @@ -0,0 +1 @@ +{"version":3,"file":"run_command.js","sourceRoot":"","sources":["../../src/operations/run_command.ts"],"names":[],"mappings":";;;AAGA,+DAAkF;AAClF,uDAA4D;AA6B5D,gBAAgB;AAChB,MAAa,mBAAkC,SAAQ,6BAAoB;IAKzE,YAAY,SAA2B,EAAE,OAAiB,EAAE,OAA0B;QACpF,KAAK,CAAC,OAAO,CAAC,CAAC;QALR,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,YAAqB,CAAC;IAC/B,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO;YACL,GAAG,IAAI,CAAC,OAAO;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,cAAc;YACd,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc;SAC5C,CAAC;IACJ,CAAC;CACF;AA7BD,kDA6BC;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,mBAAmB;IAAlE;;QACW,iCAA4B,GAAG,0BAAc,CAAC;IAOzD,CAAC;IALU,QAAQ,CACf,QAAgE;QAEhE,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AARD,8DAQC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js new file mode 100644 index 00000000..83fb086e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CreateSearchIndexesOperation = void 0; +const responses_1 = require("../../cmap/wire_protocol/responses"); +const operation_1 = require("../operation"); +/** @internal */ +class CreateSearchIndexesOperation extends operation_1.AbstractOperation { + constructor(collection, descriptions) { + super(); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.descriptions = descriptions; + this.ns = collection.fullNamespace; + } + get commandName() { + return 'createSearchIndexes'; + } + buildCommand(_connection, _session) { + const namespace = this.collection.fullNamespace; + return { + createSearchIndexes: namespace.collection, + indexes: this.descriptions + }; + } + handleOk(response) { + return super.handleOk(response).indexesCreated.map((val) => val.name); + } + buildOptions(timeoutContext) { + return { session: this.session, timeoutContext }; + } +} +exports.CreateSearchIndexesOperation = CreateSearchIndexesOperation; +//# sourceMappingURL=create.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js.map new file mode 100644 index 00000000..78a9826e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/create.js.map @@ -0,0 +1 @@ +{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/create.ts"],"names":[],"mappings":";;;AAEA,kEAAqE;AAKrE,4CAAiD;AAgBjD,gBAAgB;AAChB,MAAa,4BAA6B,SAAQ,6BAA2B;IAK3E,YAAY,UAAsB,EAAE,YAAmD;QACrF,KAAK,EAAE,CAAC;QALD,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;IACrC,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,qBAA8B,CAAC;IACxC,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAChD,OAAO;YACL,mBAAmB,EAAE,SAAS,CAAC,UAAU;YACzC,OAAO,EAAE,IAAI,CAAC,YAAY;SAC3B,CAAC;IACJ,CAAC;IAEQ,QAAQ,CAAC,QAAgE;QAChF,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAqB,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1F,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC;CACF;AA/BD,oEA+BC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js new file mode 100644 index 00000000..8d9d3f71 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DropSearchIndexOperation = void 0; +const responses_1 = require("../../cmap/wire_protocol/responses"); +const error_1 = require("../../error"); +const operation_1 = require("../operation"); +/** @internal */ +class DropSearchIndexOperation extends operation_1.AbstractOperation { + constructor(collection, name) { + super(); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.name = name; + this.ns = collection.fullNamespace; + } + get commandName() { + return 'dropSearchIndex'; + } + buildCommand(_connection, _session) { + const namespace = this.collection.fullNamespace; + const command = { + dropSearchIndex: namespace.collection + }; + if (typeof this.name === 'string') { + command.name = this.name; + } + return command; + } + handleOk(_response) { + // do nothing + } + buildOptions(timeoutContext) { + return { session: this.session, timeoutContext }; + } + handleError(error) { + const isNamespaceNotFoundError = error instanceof error_1.MongoServerError && error.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound; + if (!isNamespaceNotFoundError) { + throw error; + } + } +} +exports.DropSearchIndexOperation = DropSearchIndexOperation; +//# sourceMappingURL=drop.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js.map new file mode 100644 index 00000000..948598da --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/drop.js.map @@ -0,0 +1 @@ +{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/drop.ts"],"names":[],"mappings":";;;AAEA,kEAAqE;AAErE,uCAAoE;AAIpE,4CAAiD;AAEjD,gBAAgB;AAChB,MAAa,wBAAyB,SAAQ,6BAAuB;IAMnE,YAAY,UAAsB,EAAE,IAAY;QAC9C,KAAK,EAAE,CAAC;QAND,iCAA4B,GAAG,2BAAe,CAAC;QAOtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;IACrC,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,iBAA0B,CAAC;IACpC,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAEhD,MAAM,OAAO,GAAa;YACxB,eAAe,EAAE,SAAS,CAAC,UAAU;SACtC,CAAC;QAEF,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEQ,QAAQ,CAAC,SAA0B;QAC1C,aAAa;IACf,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC;IAEQ,WAAW,CAAC,KAAiB;QACpC,MAAM,wBAAwB,GAC5B,KAAK,YAAY,wBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,2BAAmB,CAAC,iBAAiB,CAAC;QAC5F,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA9CD,4DA8CC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js new file mode 100644 index 00000000..7cc00ceb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UpdateSearchIndexOperation = void 0; +const responses_1 = require("../../cmap/wire_protocol/responses"); +const operation_1 = require("../operation"); +/** @internal */ +class UpdateSearchIndexOperation extends operation_1.AbstractOperation { + constructor(collection, name, definition) { + super(); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.name = name; + this.definition = definition; + this.ns = collection.fullNamespace; + } + get commandName() { + return 'updateSearchIndex'; + } + buildCommand(_connection, _session) { + const namespace = this.collection.fullNamespace; + return { + updateSearchIndex: namespace.collection, + name: this.name, + definition: this.definition + }; + } + handleOk(_response) { + // no response. + } + buildOptions(timeoutContext) { + return { session: this.session, timeoutContext }; + } +} +exports.UpdateSearchIndexOperation = UpdateSearchIndexOperation; +//# sourceMappingURL=update.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js.map new file mode 100644 index 00000000..905e563e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/search_indexes/update.js.map @@ -0,0 +1 @@ +{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/update.ts"],"names":[],"mappings":";;;AAEA,kEAAqE;AAKrE,4CAAiD;AAEjD,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,6BAAuB;IAMrE,YAAY,UAAsB,EAAE,IAAY,EAAE,UAAoB;QACpE,KAAK,EAAE,CAAC;QAND,iCAA4B,GAAG,2BAAe,CAAC;QAOtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;IACrC,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,mBAA4B,CAAC;IACtC,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAChD,OAAO;YACL,iBAAiB,EAAE,SAAS,CAAC,UAAU;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;IAEQ,QAAQ,CAAC,SAA0B;QAC1C,eAAe;IACjB,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC;CACF;AAlCD,gEAkCC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js new file mode 100644 index 00000000..22d697e7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SetProfilingLevelOperation = exports.ProfilingLevel = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const levelValues = new Set(['off', 'slow_only', 'all']); +/** @public */ +exports.ProfilingLevel = Object.freeze({ + off: 'off', + slowOnly: 'slow_only', + all: 'all' +}); +/** @internal */ +class SetProfilingLevelOperation extends command_1.CommandOperation { + constructor(db, level, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + switch (level) { + case exports.ProfilingLevel.off: + this.profile = 0; + break; + case exports.ProfilingLevel.slowOnly: + this.profile = 1; + break; + case exports.ProfilingLevel.all: + this.profile = 2; + break; + default: + this.profile = 0; + break; + } + this.level = level; + } + get commandName() { + return 'profile'; + } + buildCommandDocument(_connection) { + const level = this.level; + if (!levelValues.has(level)) { + // TODO(NODE-3483): Determine error to put here + throw new error_1.MongoInvalidArgumentError(`Profiling level must be one of "${(0, utils_1.enumToString)(exports.ProfilingLevel)}"`); + } + return { profile: this.profile }; + } + handleOk(_response) { + return this.level; + } +} +exports.SetProfilingLevelOperation = SetProfilingLevelOperation; +//# sourceMappingURL=set_profiling_level.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js.map new file mode 100644 index 00000000..9dad8733 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/set_profiling_level.js.map @@ -0,0 +1 @@ +{"version":3,"file":"set_profiling_level.js","sourceRoot":"","sources":["../../src/operations/set_profiling_level.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAElE,oCAAqD;AACrD,oCAAwC;AACxC,uCAA2E;AAE3E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;AAEzD,cAAc;AACD,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,WAAW;IACrB,GAAG,EAAE,KAAK;CACF,CAAC,CAAC;AAQZ,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,0BAAgC;IAM9E,YAAY,EAAM,EAAE,KAAqB,EAAE,OAAiC;QAC1E,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QANZ,iCAA4B,GAAG,2BAAe,CAAC;QAOtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,sBAAc,CAAC,GAAG;gBACrB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;YACR,KAAK,sBAAc,CAAC,QAAQ;gBAC1B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;YACR,KAAK,sBAAc,CAAC,GAAG;gBACrB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;YACR;gBACE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;QACV,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,SAAkB,CAAC;IAC5B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,+CAA+C;YAC/C,MAAM,IAAI,iCAAyB,CACjC,mCAAmC,IAAA,oBAAY,EAAC,sBAAc,CAAC,GAAG,CACnE,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAEQ,QAAQ,CACf,SAAiE;QAEjE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAjDD,gEAiDC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js new file mode 100644 index 00000000..bd844772 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DbStatsOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class DbStatsOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + } + get commandName() { + return 'dbStats'; + } + buildCommandDocument(_connection) { + const command = { dbStats: true }; + if (this.options.scale != null) { + command.scale = this.options.scale; + } + return command; + } +} +exports.DbStatsOperation = DbStatsOperation; +(0, operation_1.defineAspects)(DbStatsOperation, [operation_1.Aspect.READ_OPERATION]); +//# sourceMappingURL=stats.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js.map new file mode 100644 index 00000000..b3b586f9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/stats.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/operations/stats.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAElE,uCAA2E;AAC3E,2CAAoD;AAQpD,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,0BAA0B;IAI9D,YAAY,EAAM,EAAE,OAAuB;QACzC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAJZ,iCAA4B,GAAG,2BAAe,CAAC;QAKtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,SAAkB,CAAC;IAC5B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,MAAM,OAAO,GAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC5C,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YAC/B,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QACrC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AApBD,4CAoBC;AAED,IAAA,yBAAa,EAAC,gBAAgB,EAAE,CAAC,kBAAM,CAAC,cAAc,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js new file mode 100644 index 00000000..71a5251f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js @@ -0,0 +1,192 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReplaceOneOperation = exports.UpdateManyOperation = exports.UpdateOneOperation = exports.UpdateOperation = void 0; +exports.makeUpdateStatement = makeUpdateStatement; +const commands_1 = require("../cmap/commands"); +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const sort_1 = require("../sort"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** + * @internal + * UpdateOperation is used in bulk write, while UpdateOneOperation and UpdateManyOperation are only used in the collections API + */ +class UpdateOperation extends command_1.CommandOperation { + constructor(ns, statements, options, serializedOperations) { + super(undefined, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.ns = ns; + this.statements = statements; + this.serializedOperations = serializedOperations; + } + get commandName() { + return 'update'; + } + get canRetryWrite() { + if (super.canRetryWrite === false) { + return false; + } + return this.statements.every(op => op.multi == null || op.multi === false); + } + buildCommandDocument(_connection, _session) { + const options = this.options; + const command = { + update: this.ns.collection, + updates: this.serializedOperations + ? (0, commands_1.makeDocumentSequence)('updates', this.statements, this.serializedOperations) + : this.statements, + ordered: options.ordered ?? true + }; + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + if (options.let) { + command.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + return command; + } +} +exports.UpdateOperation = UpdateOperation; +/** @internal */ +class UpdateOneOperation extends UpdateOperation { + constructor(ns, filter, update, options) { + super(ns, [makeUpdateStatement(filter, update, { ...options, multi: false })], options); + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + handleOk(response) { + const res = super.handleOk(response); + // @ts-expect-error Explain typing is broken + if (this.explain != null) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } +} +exports.UpdateOneOperation = UpdateOneOperation; +/** @internal */ +class UpdateManyOperation extends UpdateOperation { + constructor(ns, filter, update, options) { + super(ns, [makeUpdateStatement(filter, update, { ...options, multi: true })], options); + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + handleOk(response) { + const res = super.handleOk(response); + // @ts-expect-error Explain typing is broken + if (this.explain != null) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } +} +exports.UpdateManyOperation = UpdateManyOperation; +/** @internal */ +class ReplaceOneOperation extends UpdateOperation { + constructor(ns, filter, replacement, options) { + super(ns, [makeUpdateStatement(filter, replacement, { ...options, multi: false })], options); + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + } + handleOk(response) { + const res = super.handleOk(response); + // @ts-expect-error Explain typing is broken + if (this.explain != null) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } +} +exports.ReplaceOneOperation = ReplaceOneOperation; +function makeUpdateStatement(filter, update, options) { + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Selector must be a valid JavaScript object'); + } + if (update == null || typeof update !== 'object') { + throw new error_1.MongoInvalidArgumentError('Document must be a valid JavaScript object'); + } + const op = { q: filter, u: update }; + if (typeof options.upsert === 'boolean') { + op.upsert = options.upsert; + } + if (options.multi) { + op.multi = options.multi; + } + if (options.hint) { + op.hint = options.hint; + } + if (options.arrayFilters) { + op.arrayFilters = options.arrayFilters; + } + if (options.collation) { + op.collation = options.collation; + } + if (!options.multi && options.sort != null) { + op.sort = (0, sort_1.formatSort)(options.sort); + } + return op; +} +(0, operation_1.defineAspects)(UpdateOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +(0, operation_1.defineAspects)(UpdateOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +(0, operation_1.defineAspects)(UpdateManyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +(0, operation_1.defineAspects)(ReplaceOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA +]); +//# sourceMappingURL=update.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js.map new file mode 100644 index 00000000..116901db --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/update.js.map @@ -0,0 +1 @@ +{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/operations/update.ts"],"names":[],"mappings":";;;AAmQA,kDAuCC;AAzSD,+CAAwD;AAExD,+DAAkE;AAClE,oCAAuE;AAGvE,kCAAiE;AACjE,oCAIkB;AAClB,uCAAkG;AAClG,2CAA+D;AAuD/D;;;GAGG;AACH,MAAa,eAAgB,SAAQ,0BAA0B;IAO7D,YACE,EAAoB,EACpB,UAA6B,EAC7B,OAA8C,EAC9C,oBAAmC;QAEnC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAZnB,iCAA4B,GAAG,2BAAe,CAAC;QAatD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,QAAiB,CAAC;IAC3B,CAAC;IAED,IAAa,aAAa;QACxB,IAAI,KAAK,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAC7E,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,OAAO,GAAa;YACxB,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,UAAU;YAC1B,OAAO,EAAE,IAAI,CAAC,oBAAoB;gBAChC,CAAC,CAAC,IAAA,+BAA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AC;IAED,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QAC3C,EAAE,CAAC,IAAI,GAAG,IAAA,iBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,IAAA,yBAAa,EAAC,eAAe,EAAE;IAC7B,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,kBAAkB,EAAE;IAChC,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,mBAAmB,EAAE;IACjC,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,mBAAmB,EAAE;IACjC,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,iBAAiB;CACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js new file mode 100644 index 00000000..374f1c84 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValidateCollectionOperation = void 0; +const responses_1 = require("../cmap/wire_protocol/responses"); +const error_1 = require("../error"); +const command_1 = require("./command"); +/** @internal */ +class ValidateCollectionOperation extends command_1.CommandOperation { + constructor(admin, collectionName, options) { + super(admin.s.db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.collectionName = collectionName; + } + get commandName() { + return 'validate'; + } + buildCommandDocument(_connection, _session) { + // Decorate command with extra options + return { + validate: this.collectionName, + ...Object.fromEntries(Object.entries(this.options).filter(entry => entry[0] !== 'session')) + }; + } + handleOk(response) { + const result = super.handleOk(response); + if (result.result != null && typeof result.result !== 'string') + throw new error_1.MongoUnexpectedServerResponseError('Error with validation data'); + if (result.result != null && result.result.match(/exception|corrupt/) != null) + throw new error_1.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`); + if (result.valid != null && !result.valid) + throw new error_1.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`); + return response; + } +} +exports.ValidateCollectionOperation = ValidateCollectionOperation; +//# sourceMappingURL=validate_collection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js.map new file mode 100644 index 00000000..19a9a8d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/operations/validate_collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate_collection.js","sourceRoot":"","sources":["../../src/operations/validate_collection.ts"],"names":[],"mappings":";;;AAGA,+DAAkE;AAClE,oCAA8D;AAE9D,uCAA2E;AAQ3E,gBAAgB;AAChB,MAAa,2BAA4B,SAAQ,0BAA0B;IAKzE,YAAY,KAAY,EAAE,cAAsB,EAAE,OAAkC;QAClF,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QALpB,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,UAAmB,CAAC;IAC7B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB,EAAE,QAAwB;QAC7E,sCAAsC;QACtC,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,cAAc;YAC7B,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;SAC5F,CAAC;IACJ,CAAC;IAEQ,QAAQ,CAAC,QAAgE;QAChF,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;YAC5D,MAAM,IAAI,0CAAkC,CAAC,4BAA4B,CAAC,CAAC;QAC7E,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,IAAI;YAC3E,MAAM,IAAI,0CAAkC,CAAC,sBAAsB,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC5F,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK;YACvC,MAAM,IAAI,0CAAkC,CAAC,sBAAsB,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAE5F,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAlCD,kEAkCC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js new file mode 100644 index 00000000..a345e711 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadConcern = exports.ReadConcernLevel = void 0; +/** @public */ +exports.ReadConcernLevel = Object.freeze({ + local: 'local', + majority: 'majority', + linearizable: 'linearizable', + available: 'available', + snapshot: 'snapshot' +}); +/** + * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties + * of the data read from replica sets and replica set shards. + * @public + * + * @see https://www.mongodb.com/docs/manual/reference/read-concern/index.html + */ +class ReadConcern { + /** Constructs a ReadConcern from the read concern level.*/ + constructor(level) { + /** + * A spec test exists that allows level to be any string. + * "invalid readConcern with out stage" + * @see ./test/spec/crud/v2/aggregate-out-readConcern.json + * @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.md#unknown-levels-and-additional-options-for-string-based-readconcerns + */ + this.level = exports.ReadConcernLevel[level] ?? level; + } + /** + * Construct a ReadConcern given an options object. + * + * @param options - The options object from which to extract the write concern. + */ + static fromOptions(options) { + if (options == null) { + return; + } + if (options.readConcern) { + const { readConcern } = options; + if (readConcern instanceof ReadConcern) { + return readConcern; + } + else if (typeof readConcern === 'string') { + return new ReadConcern(readConcern); + } + else if ('level' in readConcern && readConcern.level) { + return new ReadConcern(readConcern.level); + } + } + if (options.level) { + return new ReadConcern(options.level); + } + return; + } + static get MAJORITY() { + return exports.ReadConcernLevel.majority; + } + static get AVAILABLE() { + return exports.ReadConcernLevel.available; + } + static get LINEARIZABLE() { + return exports.ReadConcernLevel.linearizable; + } + static get SNAPSHOT() { + return exports.ReadConcernLevel.snapshot; + } + toJSON() { + return { level: this.level }; + } +} +exports.ReadConcern = ReadConcern; +//# sourceMappingURL=read_concern.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js.map new file mode 100644 index 00000000..8a31c552 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_concern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"read_concern.js","sourceRoot":"","sources":["../src/read_concern.ts"],"names":[],"mappings":";;;AAEA,cAAc;AACD,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;CACZ,CAAC,CAAC;AAQZ;;;;;;GAMG;AACH,MAAa,WAAW;IAGtB,2DAA2D;IAC3D,YAAY,KAAuB;QACjC;;;;;WAKG;QACH,IAAI,CAAC,KAAK,GAAG,wBAAgB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,OAGlB;QACC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;YAChC,IAAI,WAAW,YAAY,WAAW,EAAE,CAAC;gBACvC,OAAO,WAAW,CAAC;YACrB,CAAC;iBAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBAC3C,OAAO,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;YACtC,CAAC;iBAAM,IAAI,OAAO,IAAI,WAAW,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;gBACvD,OAAO,IAAI,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,OAAO;IACT,CAAC;IAED,MAAM,KAAK,QAAQ;QACjB,OAAO,wBAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,MAAM,KAAK,SAAS;QAClB,OAAO,wBAAgB,CAAC,SAAS,CAAC;IACpC,CAAC;IAED,MAAM,KAAK,YAAY;QACrB,OAAO,wBAAgB,CAAC,YAAY,CAAC;IACvC,CAAC;IAED,MAAM,KAAK,QAAQ;QACjB,OAAO,wBAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,MAAM;QACJ,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACF;AA/DD,kCA+DC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js new file mode 100644 index 00000000..ad514ed4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js @@ -0,0 +1,191 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadPreference = exports.ReadPreferenceMode = void 0; +const error_1 = require("./error"); +/** @public */ +exports.ReadPreferenceMode = Object.freeze({ + primary: 'primary', + primaryPreferred: 'primaryPreferred', + secondary: 'secondary', + secondaryPreferred: 'secondaryPreferred', + nearest: 'nearest' +}); +/** + * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is + * used to construct connections. + * @public + * + * @see https://www.mongodb.com/docs/manual/core/read-preference/ + */ +class ReadPreference { + static { this.PRIMARY = exports.ReadPreferenceMode.primary; } + static { this.PRIMARY_PREFERRED = exports.ReadPreferenceMode.primaryPreferred; } + static { this.SECONDARY = exports.ReadPreferenceMode.secondary; } + static { this.SECONDARY_PREFERRED = exports.ReadPreferenceMode.secondaryPreferred; } + static { this.NEAREST = exports.ReadPreferenceMode.nearest; } + static { this.primary = new ReadPreference(exports.ReadPreferenceMode.primary); } + static { this.primaryPreferred = new ReadPreference(exports.ReadPreferenceMode.primaryPreferred); } + static { this.secondary = new ReadPreference(exports.ReadPreferenceMode.secondary); } + static { this.secondaryPreferred = new ReadPreference(exports.ReadPreferenceMode.secondaryPreferred); } + static { this.nearest = new ReadPreference(exports.ReadPreferenceMode.nearest); } + /** + * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest) + * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary. + * @param options - Additional read preference options + */ + constructor(mode, tags, options) { + if (!ReadPreference.isValid(mode)) { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(mode)}`); + } + if (options == null && typeof tags === 'object' && !Array.isArray(tags)) { + options = tags; + tags = undefined; + } + else if (tags && !Array.isArray(tags)) { + throw new error_1.MongoInvalidArgumentError('ReadPreference tags must be an array'); + } + this.mode = mode; + this.tags = tags; + this.hedge = options?.hedge; + this.maxStalenessSeconds = undefined; + options = options ?? {}; + if (options.maxStalenessSeconds != null) { + if (options.maxStalenessSeconds <= 0) { + throw new error_1.MongoInvalidArgumentError('maxStalenessSeconds must be a positive integer'); + } + this.maxStalenessSeconds = options.maxStalenessSeconds; + } + if (this.mode === ReadPreference.PRIMARY) { + if (this.tags && Array.isArray(this.tags) && this.tags.length > 0) { + throw new error_1.MongoInvalidArgumentError('Primary read preference cannot be combined with tags'); + } + if (this.maxStalenessSeconds) { + throw new error_1.MongoInvalidArgumentError('Primary read preference cannot be combined with maxStalenessSeconds'); + } + if (this.hedge) { + throw new error_1.MongoInvalidArgumentError('Primary read preference cannot be combined with hedge'); + } + } + } + // Support the deprecated `preference` property introduced in the porcelain layer + get preference() { + return this.mode; + } + static fromString(mode) { + return new ReadPreference(mode); + } + /** + * Construct a ReadPreference given an options object. + * + * @param options - The options object from which to extract the read preference. + */ + static fromOptions(options) { + if (!options) + return; + const readPreference = options.readPreference ?? options.session?.transaction.options.readPreference; + const readPreferenceTags = options.readPreferenceTags; + if (readPreference == null) { + return; + } + if (typeof readPreference === 'string') { + return new ReadPreference(readPreference, readPreferenceTags, { + maxStalenessSeconds: options.maxStalenessSeconds, + hedge: options.hedge + }); + } + else if (!(readPreference instanceof ReadPreference) && typeof readPreference === 'object') { + const mode = readPreference.mode || readPreference.preference; + if (mode && typeof mode === 'string') { + return new ReadPreference(mode, readPreference.tags ?? readPreferenceTags, { + maxStalenessSeconds: readPreference.maxStalenessSeconds, + hedge: options.hedge + }); + } + } + if (readPreferenceTags) { + readPreference.tags = readPreferenceTags; + } + return readPreference; + } + /** + * Replaces options.readPreference with a ReadPreference instance + */ + static translate(options) { + if (options.readPreference == null) + return options; + const r = options.readPreference; + if (typeof r === 'string') { + options.readPreference = new ReadPreference(r); + } + else if (r && !(r instanceof ReadPreference) && typeof r === 'object') { + const mode = r.mode || r.preference; + if (mode && typeof mode === 'string') { + options.readPreference = new ReadPreference(mode, r.tags, { + maxStalenessSeconds: r.maxStalenessSeconds + }); + } + } + else if (!(r instanceof ReadPreference)) { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference: ${r}`); + } + return options; + } + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + static isValid(mode) { + const VALID_MODES = new Set([ + ReadPreference.PRIMARY, + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST, + null + ]); + return VALID_MODES.has(mode); + } + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + isValid(mode) { + return ReadPreference.isValid(typeof mode === 'string' ? mode : this.mode); + } + /** + * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire + * @see https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op-query + */ + secondaryOk() { + const NEEDS_SECONDARYOK = new Set([ + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST + ]); + return NEEDS_SECONDARYOK.has(this.mode); + } + /** + * Check if the two ReadPreferences are equivalent + * + * @param readPreference - The read preference with which to check equality + */ + equals(readPreference) { + return readPreference.mode === this.mode; + } + /** Return JSON representation */ + toJSON() { + const readPreference = { mode: this.mode }; + if (Array.isArray(this.tags)) + readPreference.tags = this.tags; + if (this.maxStalenessSeconds) + readPreference.maxStalenessSeconds = this.maxStalenessSeconds; + if (this.hedge) + readPreference.hedge = this.hedge; + return readPreference; + } +} +exports.ReadPreference = ReadPreference; +//# sourceMappingURL=read_preference.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js.map new file mode 100644 index 00000000..ce950605 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/read_preference.js.map @@ -0,0 +1 @@ +{"version":3,"file":"read_preference.js","sourceRoot":"","sources":["../src/read_preference.ts"],"names":[],"mappings":";;;AACA,mCAAoD;AAOpD,cAAc;AACD,QAAA,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,kBAAkB;IACpC,SAAS,EAAE,WAAW;IACtB,kBAAkB,EAAE,oBAAoB;IACxC,OAAO,EAAE,SAAS;CACV,CAAC,CAAC;AAsCZ;;;;;;GAMG;AACH,MAAa,cAAc;aAMX,YAAO,GAAG,0BAAkB,CAAC,OAAO,CAAC;aACrC,sBAAiB,GAAG,0BAAkB,CAAC,gBAAgB,CAAC;aACxD,cAAS,GAAG,0BAAkB,CAAC,SAAS,CAAC;aACzC,wBAAmB,GAAG,0BAAkB,CAAC,kBAAkB,CAAC;aAC5D,YAAO,GAAG,0BAAkB,CAAC,OAAO,CAAC;aAErC,YAAO,GAAG,IAAI,cAAc,CAAC,0BAAkB,CAAC,OAAO,CAAC,CAAC;aACzD,qBAAgB,GAAG,IAAI,cAAc,CAAC,0BAAkB,CA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AC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9D,IAAI,IAAI,CAAC,mBAAmB;YAAE,cAAc,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QAC5F,IAAI,IAAI,CAAC,KAAK;YAAE,cAAc,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAClD,OAAO,cAAc,CAAC;IACxB,CAAC;;AAlMH,wCAmMC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js new file mode 100644 index 00000000..3bedd25b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js @@ -0,0 +1,31 @@ +"use strict"; +/* eslint-disable no-restricted-imports*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ALLOWED_DRIVER_REQUIRE_PROPERTY_NAME = void 0; +exports.resolveRuntimeAdapters = resolveRuntimeAdapters; +/** + * @internal + * + * Legacy escape hatch for the test sandbox's restricted `require`: the driver no longer sets this + * property (the os adapter loads via dynamic `import()`), but the vm test harness + * still checks it. Kept until the sandbox contract is revisited in a follow-up. + */ +exports.ALLOWED_DRIVER_REQUIRE_PROPERTY_NAME = 'allowedDriverRequire'; +/** + * @internal + * + * Given a MongoClientOptions, this function resolves the set of runtime options, providing Nodejs + * implementations if not provided in `options`, and returns a `Runtime`. + * + * Resolution is asynchronous because the default `os` adapter is loaded via a dynamic `import()`. + * Unlike `require`, dynamic import exists in every module system the driver ships into or is + * bundled into (CJS, ESM, and bundled ESM output), and the literal specifier keeps it + * statically analyzable for bundlers. The promise is created during synchronous + * options parsing and awaited later by consumers, so the public constructor stays synchronous. + */ +async function resolveRuntimeAdapters(options) { + return { + os: options.runtimeAdapters?.os ?? (await import('os')) + }; +} +//# sourceMappingURL=runtime_adapters.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js.map new file mode 100644 index 00000000..06dbf1c5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/runtime_adapters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runtime_adapters.js","sourceRoot":"","sources":["../src/runtime_adapters.ts"],"names":[],"mappings":";AAAA,yCAAyC;;;AA4DzC,wDAIC;AArDD;;;;;;GAMG;AACU,QAAA,oCAAoC,GAAG,sBAAsB,CAAC;AA8B3E;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,sBAAsB,CAAC,OAA2B;IACtE,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,eAAe,EAAE,EAAE,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;KACxD,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js new file mode 100644 index 00000000..c378293e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServerType = exports.TopologyType = exports.STATE_CONNECTED = exports.STATE_CONNECTING = exports.STATE_CLOSED = exports.STATE_CLOSING = void 0; +exports._advanceClusterTime = _advanceClusterTime; +// shared state names +exports.STATE_CLOSING = 'closing'; +exports.STATE_CLOSED = 'closed'; +exports.STATE_CONNECTING = 'connecting'; +exports.STATE_CONNECTED = 'connected'; +/** + * An enumeration of topology types we know about + * @public + */ +exports.TopologyType = Object.freeze({ + Single: 'Single', + ReplicaSetNoPrimary: 'ReplicaSetNoPrimary', + ReplicaSetWithPrimary: 'ReplicaSetWithPrimary', + Sharded: 'Sharded', + Unknown: 'Unknown', + LoadBalanced: 'LoadBalanced' +}); +/** + * An enumeration of server types we know about + * @public + */ +exports.ServerType = Object.freeze({ + Standalone: 'Standalone', + Mongos: 'Mongos', + PossiblePrimary: 'PossiblePrimary', + RSPrimary: 'RSPrimary', + RSSecondary: 'RSSecondary', + RSArbiter: 'RSArbiter', + RSOther: 'RSOther', + RSGhost: 'RSGhost', + Unknown: 'Unknown', + LoadBalancer: 'LoadBalancer' +}); +/** Shared function to determine clusterTime for a given topology or session */ +function _advanceClusterTime(entity, $clusterTime) { + if (entity.clusterTime == null) { + entity.clusterTime = $clusterTime; + } + else { + if ($clusterTime.clusterTime.greaterThan(entity.clusterTime.clusterTime)) { + entity.clusterTime = $clusterTime; + } + } +} +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js.map new file mode 100644 index 00000000..d9297ef8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sdam/common.ts"],"names":[],"mappings":";;;AA8DA,kDAWC;AArED,qBAAqB;AACR,QAAA,aAAa,GAAG,SAAS,CAAC;AAC1B,QAAA,YAAY,GAAG,QAAQ,CAAC;AACxB,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAChC,QAAA,eAAe,GAAG,WAAW,CAAC;AAE3C;;;GAGG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,QAAQ;IAChB,mBAAmB,EAAE,qBAAqB;IAC1C,qBAAqB,EAAE,uBAAuB;IAC9C,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;CACpB,CAAC,CAAC;AAKZ;;;GAGG;AACU,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;CACpB,CAAC,CAAC;AAoBZ,+EAA+E;AAC/E,SAAgB,mBAAmB,CACjC,MAAgC,EAChC,YAAyB;IAEzB,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC;IACpC,CAAC;SAAM,CAAC;QACN,IAAI,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;YACzE,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC;QACpC,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js new file mode 100644 index 00000000..69dfe9f3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js @@ -0,0 +1,146 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServerHeartbeatFailedEvent = exports.ServerHeartbeatSucceededEvent = exports.ServerHeartbeatStartedEvent = exports.TopologyClosedEvent = exports.TopologyOpeningEvent = exports.TopologyDescriptionChangedEvent = exports.ServerClosedEvent = exports.ServerOpeningEvent = exports.ServerDescriptionChangedEvent = void 0; +const constants_1 = require("../constants"); +/** + * Emitted when server description changes, but does NOT include changes to the RTT. + * @public + * @category Event + */ +class ServerDescriptionChangedEvent { + /** @internal */ + constructor(topologyId, address, previousDescription, newDescription) { + this.name = constants_1.SERVER_DESCRIPTION_CHANGED; + this.topologyId = topologyId; + this.address = address; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} +exports.ServerDescriptionChangedEvent = ServerDescriptionChangedEvent; +/** + * Emitted when server is initialized. + * @public + * @category Event + */ +class ServerOpeningEvent { + /** @internal */ + constructor(topologyId, address) { + /** @internal */ + this.name = constants_1.SERVER_OPENING; + this.topologyId = topologyId; + this.address = address; + } +} +exports.ServerOpeningEvent = ServerOpeningEvent; +/** + * Emitted when server is closed. + * @public + * @category Event + */ +class ServerClosedEvent { + /** @internal */ + constructor(topologyId, address) { + /** @internal */ + this.name = constants_1.SERVER_CLOSED; + this.topologyId = topologyId; + this.address = address; + } +} +exports.ServerClosedEvent = ServerClosedEvent; +/** + * Emitted when topology description changes. + * @public + * @category Event + */ +class TopologyDescriptionChangedEvent { + /** @internal */ + constructor(topologyId, previousDescription, newDescription) { + /** @internal */ + this.name = constants_1.TOPOLOGY_DESCRIPTION_CHANGED; + this.topologyId = topologyId; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} +exports.TopologyDescriptionChangedEvent = TopologyDescriptionChangedEvent; +/** + * Emitted when topology is initialized. + * @public + * @category Event + */ +class TopologyOpeningEvent { + /** @internal */ + constructor(topologyId) { + /** @internal */ + this.name = constants_1.TOPOLOGY_OPENING; + this.topologyId = topologyId; + } +} +exports.TopologyOpeningEvent = TopologyOpeningEvent; +/** + * Emitted when topology is closed. + * @public + * @category Event + */ +class TopologyClosedEvent { + /** @internal */ + constructor(topologyId) { + /** @internal */ + this.name = constants_1.TOPOLOGY_CLOSED; + this.topologyId = topologyId; + } +} +exports.TopologyClosedEvent = TopologyClosedEvent; +/** + * Emitted when the server monitor’s hello command is started - immediately before + * the hello command is serialized into raw BSON and written to the socket. + * + * @public + * @category Event + */ +class ServerHeartbeatStartedEvent { + /** @internal */ + constructor(connectionId, awaited) { + /** @internal */ + this.name = constants_1.SERVER_HEARTBEAT_STARTED; + this.connectionId = connectionId; + this.awaited = awaited; + } +} +exports.ServerHeartbeatStartedEvent = ServerHeartbeatStartedEvent; +/** + * Emitted when the server monitor’s hello succeeds. + * @public + * @category Event + */ +class ServerHeartbeatSucceededEvent { + /** @internal */ + constructor(connectionId, duration, reply, awaited) { + /** @internal */ + this.name = constants_1.SERVER_HEARTBEAT_SUCCEEDED; + this.connectionId = connectionId; + this.duration = duration; + this.reply = reply ?? {}; + this.awaited = awaited; + } +} +exports.ServerHeartbeatSucceededEvent = ServerHeartbeatSucceededEvent; +/** + * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception. + * @public + * @category Event + */ +class ServerHeartbeatFailedEvent { + /** @internal */ + constructor(connectionId, duration, failure, awaited) { + /** @internal */ + this.name = constants_1.SERVER_HEARTBEAT_FAILED; + this.connectionId = connectionId; + this.duration = duration; + this.failure = failure; + this.awaited = awaited; + } +} +exports.ServerHeartbeatFailedEvent = ServerHeartbeatFailedEvent; +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js.map new file mode 100644 index 00000000..0ddeb049 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/sdam/events.ts"],"names":[],"mappings":";;;AACA,4CAUsB;AAItB;;;;GAIG;AACH,MAAa,6BAA6B;IAWxC,gBAAgB;IAChB,YACE,UAAkB,EAClB,OAAe,EACf,mBAAsC,EACtC,cAAiC;QAPnC,SAAI,GAAG,sCAA0B,CAAC;QAShC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CA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B,SAAI,GAAG,2BAAe,CAAC;QAIrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAVD,kDAUC;AAED;;;;;;GAMG;AACH,MAAa,2BAA2B;IAQtC,gBAAgB;IAChB,YAAY,YAAoB,EAAE,OAAgB;QAJlD,gBAAgB;QAChB,SAAI,GAAG,oCAAwB,CAAC;QAI9B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAbD,kEAaC;AAED;;;;GAIG;AACH,MAAa,6BAA6B;IAYxC,gBAAgB;IAChB,YAAY,YAAoB,EAAE,QAAgB,EAAE,KAAsB,EAAE,OAAgB;QAJ5F,gBAAgB;QAChB,SAAI,GAAG,sCAA0B,CAAC;QAIhC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAnBD,sEAmBC;AAED;;;;GAIG;AACH,MAAa,0BAA0B;IAYrC,gBAAgB;IAChB,YAAY,YAAoB,EAAE,QAAgB,EAAE,OAAc,EAAE,OAAgB;QAJpF,gBAAgB;QAChB,SAAI,GAAG,mCAAuB,CAAC;QAI7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAnBD,gEAmBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js new file mode 100644 index 00000000..ee8e085b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js @@ -0,0 +1,544 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RTTSampler = exports.MonitorInterval = exports.RTTPinger = exports.Monitor = exports.ServerMonitoringMode = void 0; +const timers_1 = require("timers"); +const bson_1 = require("../bson"); +const connect_1 = require("../cmap/connect"); +const client_metadata_1 = require("../cmap/handshake/client_metadata"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_logger_1 = require("../mongo_logger"); +const mongo_types_1 = require("../mongo_types"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const events_1 = require("./events"); +const server_1 = require("./server"); +const STATE_IDLE = 'idle'; +const STATE_MONITORING = 'monitoring'; +const stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, STATE_IDLE, common_1.STATE_CLOSED], + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, STATE_MONITORING], + [STATE_IDLE]: [STATE_IDLE, STATE_MONITORING, common_1.STATE_CLOSING], + [STATE_MONITORING]: [STATE_MONITORING, STATE_IDLE, common_1.STATE_CLOSING] +}); +const INVALID_REQUEST_CHECK_STATES = new Set([common_1.STATE_CLOSING, common_1.STATE_CLOSED, STATE_MONITORING]); +function isInCloseState(monitor) { + return monitor.s.state === common_1.STATE_CLOSED || monitor.s.state === common_1.STATE_CLOSING; +} +/** @public */ +exports.ServerMonitoringMode = Object.freeze({ + auto: 'auto', + poll: 'poll', + stream: 'stream' +}); +/** @internal */ +class Monitor extends mongo_types_1.TypedEventEmitter { + constructor(server, options) { + super(); + /** @internal */ + this.component = mongo_logger_1.MongoLoggableComponent.TOPOLOGY; + this.on('error', utils_1.noop); + this.server = server; + this.connection = null; + this.cancellationToken = new mongo_types_1.CancellationToken(); + this.cancellationToken.setMaxListeners(Infinity); + this.monitorId = undefined; + this.s = { + state: common_1.STATE_CLOSED + }; + this.address = server.description.address; + this.options = Object.freeze({ + connectTimeoutMS: options.connectTimeoutMS ?? 10000, + heartbeatFrequencyMS: options.heartbeatFrequencyMS ?? 10000, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS ?? 500, + serverMonitoringMode: options.serverMonitoringMode + }); + this.isRunningInFaasEnv = (0, client_metadata_1.getFAASEnv)() != null; + this.mongoLogger = this.server.topology.client?.mongoLogger; + this.rttSampler = new RTTSampler(10); + const cancellationToken = this.cancellationToken; + // TODO: refactor this to pull it directly from the pool, requires new ConnectionPool integration + const connectOptions = { + id: '', + generation: server.pool.generation, + cancellationToken, + hostAddress: server.description.hostAddress, + ...options, + // force BSON serialization options + raw: false, + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: true + }; + // ensure no authentication is used for monitoring + delete connectOptions.credentials; + if (connectOptions.autoEncrypter) { + delete connectOptions.autoEncrypter; + } + this.connectOptions = Object.freeze(connectOptions); + } + connect() { + if (this.s.state !== common_1.STATE_CLOSED) { + return; + } + // start + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this.monitorId = new MonitorInterval(monitorServer(this), { + heartbeatFrequencyMS: heartbeatFrequencyMS, + minHeartbeatFrequencyMS: minHeartbeatFrequencyMS, + immediate: true + }); + } + requestCheck() { + if (INVALID_REQUEST_CHECK_STATES.has(this.s.state)) { + return; + } + this.monitorId?.wake(); + } + reset() { + const topologyVersion = this.server.description.topologyVersion; + if (isInCloseState(this) || topologyVersion == null) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + resetMonitorState(this); + // restart monitor + stateTransition(this, STATE_IDLE); + // restart monitoring + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this.monitorId = new MonitorInterval(monitorServer(this), { + heartbeatFrequencyMS: heartbeatFrequencyMS, + minHeartbeatFrequencyMS: minHeartbeatFrequencyMS + }); + } + close() { + if (isInCloseState(this)) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + resetMonitorState(this); + // close monitor + this.emit('close'); + stateTransition(this, common_1.STATE_CLOSED); + } + get roundTripTime() { + return this.rttSampler.average(); + } + get minRoundTripTime() { + return this.rttSampler.min(); + } + get latestRtt() { + return this.rttSampler.last; + } + addRttSample(rtt) { + this.rttSampler.addSample(rtt); + } + clearRttSamples() { + this.rttSampler.clear(); + } +} +exports.Monitor = Monitor; +function resetMonitorState(monitor) { + monitor.monitorId?.stop(); + monitor.monitorId = undefined; + monitor.rttPinger?.close(); + monitor.rttPinger = undefined; + monitor.cancellationToken.emit('cancel'); + monitor.connection?.destroy(); + monitor.connection = null; + monitor.clearRttSamples(); +} +function useStreamingProtocol(monitor, topologyVersion) { + // If we have no topology version we always poll no matter + // what the user provided, since the server does not support + // the streaming protocol. + if (topologyVersion == null) + return false; + const serverMonitoringMode = monitor.options.serverMonitoringMode; + if (serverMonitoringMode === exports.ServerMonitoringMode.poll) + return false; + if (serverMonitoringMode === exports.ServerMonitoringMode.stream) + return true; + // If we are in auto mode, we need to figure out if we're in a FaaS + // environment or not and choose the appropriate mode. + if (monitor.isRunningInFaasEnv) + return false; + return true; +} +function checkServer(monitor, callback) { + let start; + let awaited; + const topologyVersion = monitor.server.description.topologyVersion; + const isAwaitable = useStreamingProtocol(monitor, topologyVersion); + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_STARTED, monitor.server.topology.s.id, undefined, new events_1.ServerHeartbeatStartedEvent(monitor.address, isAwaitable)); + function onHeartbeatFailed(err) { + monitor.connection?.destroy(); + monitor.connection = null; + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_FAILED, monitor.server.topology.s.id, undefined, new events_1.ServerHeartbeatFailedEvent(monitor.address, (0, utils_1.calculateDurationInMs)(start), err, awaited)); + const error = !(err instanceof error_1.MongoError) + ? new error_1.MongoError(error_1.MongoError.buildErrorMessage(err), { cause: err }) + : err; + error.addErrorLabel(error_1.MongoErrorLabel.ResetPool); + if (error instanceof error_1.MongoNetworkTimeoutError) { + error.addErrorLabel(error_1.MongoErrorLabel.InterruptInUseConnections); + } + monitor.emit('resetServer', error); + callback(err); + } + function onHeartbeatSucceeded(hello) { + if (!('isWritablePrimary' in hello)) { + // Provide hello-style response document. + hello.isWritablePrimary = hello[constants_1.LEGACY_HELLO_COMMAND]; + } + // NOTE: here we use the latestRtt as this measurement corresponds with the value + // obtained for this successful heartbeat, if there is no latestRtt, then we calculate the + // duration + const duration = isAwaitable && monitor.rttPinger + ? (monitor.rttPinger.latestRtt ?? (0, utils_1.calculateDurationInMs)(start)) + : (0, utils_1.calculateDurationInMs)(start); + monitor.addRttSample(duration); + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_SUCCEEDED, monitor.server.topology.s.id, hello.connectionId, new events_1.ServerHeartbeatSucceededEvent(monitor.address, duration, hello, isAwaitable)); + if (isAwaitable) { + // If we are using the streaming protocol then we immediately issue another 'started' + // event, otherwise the "check" is complete and return to the main monitor loop + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_STARTED, monitor.server.topology.s.id, undefined, new events_1.ServerHeartbeatStartedEvent(monitor.address, true)); + // We have not actually sent an outgoing handshake, but when we get the next response we + // want the duration to reflect the time since we last heard from the server + start = (0, utils_1.processTimeMS)(); + } + else { + monitor.rttPinger?.close(); + monitor.rttPinger = undefined; + callback(undefined, hello); + } + } + const { connection } = monitor; + if (connection && !connection.closed) { + const { serverApi, helloOk } = connection; + const connectTimeoutMS = monitor.options.connectTimeoutMS; + const maxAwaitTimeMS = monitor.options.heartbeatFrequencyMS; + const cmd = { + [serverApi?.version || helloOk ? 'hello' : constants_1.LEGACY_HELLO_COMMAND]: 1, + ...(isAwaitable && topologyVersion + ? { maxAwaitTimeMS, topologyVersion: makeTopologyVersion(topologyVersion) } + : {}) + }; + const options = isAwaitable + ? { + socketTimeoutMS: connectTimeoutMS ? connectTimeoutMS + maxAwaitTimeMS : 0, + exhaustAllowed: true + } + : { socketTimeoutMS: connectTimeoutMS }; + if (isAwaitable && monitor.rttPinger == null) { + monitor.rttPinger = new RTTPinger(monitor); + } + // Record new start time before sending handshake + start = (0, utils_1.processTimeMS)(); + if (isAwaitable) { + awaited = true; + return connection.exhaustCommand((0, utils_1.ns)('admin.$cmd'), cmd, options, (error, hello) => { + if (error) + return onHeartbeatFailed(error); + return onHeartbeatSucceeded(hello); + }); + } + awaited = false; + connection + .command((0, utils_1.ns)('admin.$cmd'), cmd, options) + .then(onHeartbeatSucceeded, onHeartbeatFailed); + return; + } + // connecting does an implicit `hello` + (async () => { + const socket = await (0, connect_1.makeSocket)(monitor.connectOptions); + const connection = (0, connect_1.makeConnection)(monitor.connectOptions, socket); + // The start time is after socket creation but before the handshake + start = (0, utils_1.processTimeMS)(); + try { + await (0, connect_1.performInitialHandshake)(connection, monitor.connectOptions); + return connection; + } + catch (error) { + connection.destroy(); + throw error; + } + })().then(connection => { + if (isInCloseState(monitor)) { + connection.destroy(); + return; + } + const duration = (0, utils_1.calculateDurationInMs)(start); + monitor.addRttSample(duration); + monitor.connection = connection; + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_SUCCEEDED, monitor.server.topology.s.id, connection.hello?.connectionId, new events_1.ServerHeartbeatSucceededEvent(monitor.address, duration, connection.hello, useStreamingProtocol(monitor, connection.hello?.topologyVersion))); + callback(undefined, connection.hello); + }, error => { + monitor.connection = null; + awaited = false; + onHeartbeatFailed(error); + }); +} +function monitorServer(monitor) { + return (callback) => { + if (monitor.s.state === STATE_MONITORING) { + queueMicrotask(callback); + return; + } + stateTransition(monitor, STATE_MONITORING); + function done() { + if (!isInCloseState(monitor)) { + stateTransition(monitor, STATE_IDLE); + } + callback(); + } + checkServer(monitor, (err, hello) => { + if (err) { + // otherwise an error occurred on initial discovery, also bail + if (monitor.server.description.type === common_1.ServerType.Unknown) { + return done(); + } + } + // if the check indicates streaming is supported, immediately reschedule monitoring + if (useStreamingProtocol(monitor, hello?.topologyVersion)) { + (0, timers_1.setTimeout)(() => { + if (!isInCloseState(monitor)) { + monitor.monitorId?.wake(); + } + }, 0); + } + done(); + }); + }; +} +function makeTopologyVersion(tv) { + return { + processId: tv.processId, + // tests mock counter as just number, but in a real situation counter should always be a Long + // TODO(NODE-2674): Preserve int64 sent from MongoDB + counter: bson_1.Long.isLong(tv.counter) ? tv.counter : bson_1.Long.fromNumber(tv.counter) + }; +} +/** @internal */ +class RTTPinger { + constructor(monitor) { + this.connection = undefined; + this.cancellationToken = monitor.cancellationToken; + this.closed = false; + this.monitor = monitor; + this.latestRtt = monitor.latestRtt ?? undefined; + const heartbeatFrequencyMS = monitor.options.heartbeatFrequencyMS; + this.monitorId = (0, timers_1.setTimeout)(() => this.measureRoundTripTime(), heartbeatFrequencyMS); + } + get roundTripTime() { + return this.monitor.roundTripTime; + } + get minRoundTripTime() { + return this.monitor.minRoundTripTime; + } + close() { + this.closed = true; + (0, timers_1.clearTimeout)(this.monitorId); + this.connection?.destroy(); + this.connection = undefined; + } + measureAndReschedule(start, conn) { + if (this.closed) { + conn?.destroy(); + return; + } + if (this.connection == null) { + this.connection = conn; + } + this.latestRtt = (0, utils_1.calculateDurationInMs)(start); + this.monitorId = (0, timers_1.setTimeout)(() => this.measureRoundTripTime(), this.monitor.options.heartbeatFrequencyMS); + } + measureRoundTripTime() { + const start = (0, utils_1.processTimeMS)(); + if (this.closed) { + return; + } + const connection = this.connection; + if (connection == null) { + (0, connect_1.connect)(this.monitor.connectOptions).then(connection => { + this.measureAndReschedule(start, connection); + }, () => { + this.connection = undefined; + }); + return; + } + const commandName = connection.serverApi?.version || connection.helloOk ? 'hello' : constants_1.LEGACY_HELLO_COMMAND; + connection.command((0, utils_1.ns)('admin.$cmd'), { [commandName]: 1 }, undefined).then(() => this.measureAndReschedule(start), () => { + this.connection?.destroy(); + this.connection = undefined; + return; + }); + } +} +exports.RTTPinger = RTTPinger; +/** + * @internal + */ +class MonitorInterval { + constructor(fn, options = {}) { + this.isExpeditedCallToFnScheduled = false; + this.stopped = false; + this.isExecutionInProgress = false; + this.hasExecutedOnce = false; + this._executeAndReschedule = () => { + if (this.stopped) + return; + if (this.timerId) { + (0, timers_1.clearTimeout)(this.timerId); + } + this.isExpeditedCallToFnScheduled = false; + this.isExecutionInProgress = true; + this.fn(() => { + this.lastExecutionEnded = (0, utils_1.processTimeMS)(); + this.isExecutionInProgress = false; + this._reschedule(this.heartbeatFrequencyMS); + }); + }; + this.fn = fn; + this.lastExecutionEnded = -Infinity; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 1000; + this.minHeartbeatFrequencyMS = options.minHeartbeatFrequencyMS ?? 500; + if (options.immediate) { + this._executeAndReschedule(); + } + else { + this._reschedule(undefined); + } + } + wake() { + const currentTime = (0, utils_1.processTimeMS)(); + const timeSinceLastCall = currentTime - this.lastExecutionEnded; + // TODO(NODE-4674): Add error handling and logging to the monitor + if (timeSinceLastCall < 0) { + return this._executeAndReschedule(); + } + if (this.isExecutionInProgress) { + return; + } + // debounce multiple calls to wake within the `minInterval` + if (this.isExpeditedCallToFnScheduled) { + return; + } + // reschedule a call as soon as possible, ensuring the call never happens + // faster than the `minInterval` + if (timeSinceLastCall < this.minHeartbeatFrequencyMS) { + this.isExpeditedCallToFnScheduled = true; + this._reschedule(this.minHeartbeatFrequencyMS - timeSinceLastCall); + return; + } + this._executeAndReschedule(); + } + stop() { + this.stopped = true; + if (this.timerId) { + (0, timers_1.clearTimeout)(this.timerId); + this.timerId = undefined; + } + this.lastExecutionEnded = -Infinity; + this.isExpeditedCallToFnScheduled = false; + } + toString() { + return JSON.stringify(this); + } + toJSON() { + const currentTime = (0, utils_1.processTimeMS)(); + const timeSinceLastCall = currentTime - this.lastExecutionEnded; + return { + timerId: this.timerId != null ? 'set' : 'cleared', + lastCallTime: this.lastExecutionEnded, + isExpeditedCheckScheduled: this.isExpeditedCallToFnScheduled, + stopped: this.stopped, + heartbeatFrequencyMS: this.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: this.minHeartbeatFrequencyMS, + currentTime, + timeSinceLastCall + }; + } + _reschedule(ms) { + if (this.stopped) + return; + if (this.timerId) { + (0, timers_1.clearTimeout)(this.timerId); + } + this.timerId = (0, timers_1.setTimeout)(this._executeAndReschedule, ms || this.heartbeatFrequencyMS); + } +} +exports.MonitorInterval = MonitorInterval; +/** @internal + * This class implements the RTT sampling logic specified for [CSOT](https://github.com/mongodb/specifications/blob/bbb335e60cd7ea1e0f7cd9a9443cb95fc9d3b64d/source/client-side-operations-timeout/client-side-operations-timeout.md#drivers-use-minimum-rtt-to-short-circuit-operations) + * + * This is implemented as a [circular buffer](https://en.wikipedia.org/wiki/Circular_buffer) keeping + * the most recent `windowSize` samples + * */ +class RTTSampler { + constructor(windowSize = 10) { + this.rttSamples = new Float64Array(windowSize); + this.length = 0; + this.writeIndex = 0; + } + /** + * Adds an rtt sample to the end of the circular buffer + * When `windowSize` samples have been collected, `addSample` overwrites the least recently added + * sample + */ + addSample(sample) { + this.rttSamples[this.writeIndex++] = sample; + if (this.length < this.rttSamples.length) { + this.length++; + } + this.writeIndex %= this.rttSamples.length; + } + /** + * When \< 2 samples have been collected, returns 0 + * Otherwise computes the minimum value samples contained in the buffer + */ + min() { + if (this.length < 2) + return 0; + let min = this.rttSamples[0]; + for (let i = 1; i < this.length; i++) { + if (this.rttSamples[i] < min) + min = this.rttSamples[i]; + } + return min; + } + /** + * Returns mean of samples contained in the buffer + */ + average() { + if (this.length === 0) + return 0; + let sum = 0; + for (let i = 0; i < this.length; i++) { + sum += this.rttSamples[i]; + } + return sum / this.length; + } + /** + * Returns most recently inserted element in the buffer + * Returns null if the buffer is empty + * */ + get last() { + if (this.length === 0) + return null; + return this.rttSamples[this.writeIndex === 0 ? this.length - 1 : this.writeIndex - 1]; + } + /** + * Clear the buffer + * NOTE: this does not overwrite the data held in the internal array, just the pointers into + * this array + */ + clear() { + this.length = 0; + this.writeIndex = 0; + } +} +exports.RTTSampler = RTTSampler; +//# sourceMappingURL=monitor.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js.map new file mode 100644 index 00000000..a587d019 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/monitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"monitor.js","sourceRoot":"","sources":["../../src/sdam/monitor.ts"],"names":[],"mappings":";;;AAAA,mCAAkD;AAElD,kCAA8C;AAC9C,6CAA+F;AAE/F,uEAA+D;AAC/D,4CAAoD;AACpD,oCAAiF;AACjF,kDAAyD;AACzD,gDAAsE;AACtE,oCAQkB;AAClB,qCAAmE;AACnE,qCAIkB;AAClB,qCAAkC;AAGlC,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,gBAAgB,GAAG,YAAY,CAAC;AACtC,MAAM,eAAe,GAAG,IAAA,wBAAgB,EAAC;IACvC,CAAC,sBAAa,CAAC,EAAE,CAAC,sBAAa,EAAE,UAAU,EAAE,qBAAY,CAAC;IAC1D,CAAC,qBAAY,CAAC,EAAE,CAAC,qBAAY,EAAE,gBAAgB,CAAC;IAChD,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,sBAAa,CAAC;IAC3D,CAAC,gBAAgB,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAU,EAAE,sBAAa,CAAC;CAClE,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC,CAAC,sBAAa,EAAE,qBAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC9F,SAAS,cAAc,CAAC,OAAgB;IACtC,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,qBAAY,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,sBAAa,CAAC;A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,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;CACF;AAvED,gCAuEC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js new file mode 100644 index 00000000..79515e0e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js @@ -0,0 +1,404 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Server = void 0; +const connection_1 = require("../cmap/connection"); +const connection_pool_1 = require("../cmap/connection_pool"); +const errors_1 = require("../cmap/errors"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const aggregate_1 = require("../operations/aggregate"); +const transactions_1 = require("../transactions"); +const utils_1 = require("../utils"); +const write_concern_1 = require("../write_concern"); +const common_1 = require("./common"); +const monitor_1 = require("./monitor"); +const server_description_1 = require("./server_description"); +const server_selection_1 = require("./server_selection"); +const stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING], + [common_1.STATE_CONNECTING]: [common_1.STATE_CONNECTING, common_1.STATE_CLOSING, common_1.STATE_CONNECTED, common_1.STATE_CLOSED], + [common_1.STATE_CONNECTED]: [common_1.STATE_CONNECTED, common_1.STATE_CLOSING, common_1.STATE_CLOSED], + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED] +}); +/** @internal */ +class Server extends mongo_types_1.TypedEventEmitter { + /** @event */ + static { this.SERVER_HEARTBEAT_STARTED = constants_1.SERVER_HEARTBEAT_STARTED; } + /** @event */ + static { this.SERVER_HEARTBEAT_SUCCEEDED = constants_1.SERVER_HEARTBEAT_SUCCEEDED; } + /** @event */ + static { this.SERVER_HEARTBEAT_FAILED = constants_1.SERVER_HEARTBEAT_FAILED; } + /** @event */ + static { this.CONNECT = constants_1.CONNECT; } + /** @event */ + static { this.DESCRIPTION_RECEIVED = constants_1.DESCRIPTION_RECEIVED; } + /** @event */ + static { this.CLOSED = constants_1.CLOSED; } + /** @event */ + static { this.ENDED = constants_1.ENDED; } + /** + * Create a server + */ + constructor(topology, description, options) { + super(); + this.on('error', utils_1.noop); + this.serverApi = options.serverApi; + const poolOptions = { hostAddress: description.hostAddress, ...options }; + this.topology = topology; + this.pool = new connection_pool_1.ConnectionPool(this, poolOptions); + this.s = { + description, + options, + state: common_1.STATE_CLOSED, + operationCount: 0 + }; + for (const event of [...constants_1.CMAP_EVENTS, ...constants_1.APM_EVENTS]) { + this.pool.on(event, (e) => this.emit(event, e)); + } + this.pool.on(connection_1.Connection.CLUSTER_TIME_RECEIVED, (clusterTime) => { + this.clusterTime = clusterTime; + }); + if (this.loadBalanced) { + this.monitor = null; + // monitoring is disabled in load balancing mode + return; + } + // create the monitor + this.monitor = new monitor_1.Monitor(this, this.s.options); + for (const event of constants_1.HEARTBEAT_EVENTS) { + this.monitor.on(event, (e) => this.emit(event, e)); + } + this.monitor.on('resetServer', (error) => markServerUnknown(this, error)); + this.monitor.on(Server.SERVER_HEARTBEAT_SUCCEEDED, (event) => { + this.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(this.description.hostAddress, event.reply, { + roundTripTime: this.monitor?.roundTripTime, + minRoundTripTime: this.monitor?.minRoundTripTime + })); + if (this.s.state === common_1.STATE_CONNECTING) { + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + }); + } + get clusterTime() { + return this.topology.clusterTime; + } + set clusterTime(clusterTime) { + this.topology.clusterTime = clusterTime; + } + get description() { + return this.s.description; + } + get name() { + return this.s.description.address; + } + get autoEncrypter() { + if (this.s.options && this.s.options.autoEncrypter) { + return this.s.options.autoEncrypter; + } + return; + } + get loadBalanced() { + return this.topology.description.type === common_1.TopologyType.LoadBalanced; + } + /** + * Initiate server connect + */ + connect() { + if (this.s.state !== common_1.STATE_CLOSED) { + return; + } + stateTransition(this, common_1.STATE_CONNECTING); + // If in load balancer mode we automatically set the server to + // a load balancer. It never transitions out of this state and + // has no monitor. + if (!this.loadBalanced) { + this.monitor?.connect(); + } + else { + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + } + closeCheckedOutConnections() { + return this.pool.closeCheckedOutConnections(); + } + /** Destroy the server connection */ + close() { + if (this.s.state === common_1.STATE_CLOSED) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + if (!this.loadBalanced) { + this.monitor?.close(); + } + this.pool.close(); + stateTransition(this, common_1.STATE_CLOSED); + this.emit('closed'); + } + /** + * Immediately schedule monitoring of this server. If there already an attempt being made + * this will be a no-op. + */ + requestCheck() { + if (!this.loadBalanced) { + this.monitor?.requestCheck(); + } + } + async command(operation, timeoutContext) { + if (this.s.state === common_1.STATE_CLOSING || this.s.state === common_1.STATE_CLOSED) { + throw new error_1.MongoServerClosedError(); + } + const session = operation.session; + let conn = session?.pinnedConnection; + this.incrementOperationCount(); + if (conn == null) { + try { + conn = await this.pool.checkOut({ timeoutContext, signal: operation.options.signal }); + } + catch (checkoutError) { + this.decrementOperationCount(); + if (!(checkoutError instanceof errors_1.PoolClearedError)) + this.handleError(checkoutError); + throw checkoutError; + } + } + let reauthPromise = null; + const cleanup = () => { + this.decrementOperationCount(); + if (session?.pinnedConnection !== conn) { + if (reauthPromise != null) { + // The reauth promise only exists if it hasn't thrown. + const checkBackIn = () => { + this.pool.checkIn(conn); + }; + void reauthPromise.then(checkBackIn, checkBackIn); + } + else { + this.pool.checkIn(conn); + } + } + }; + let cmd; + try { + cmd = operation.buildCommand(conn, session); + } + catch (e) { + cleanup(); + throw e; + } + const options = operation.buildOptions(timeoutContext); + const ns = operation.ns; + if (this.loadBalanced && isPinnableCommand(cmd, session) && !session?.pinnedConnection) { + session?.pin(conn); + } + options.directConnection = this.topology.s.options.directConnection; + const omitReadPreference = operation instanceof aggregate_1.AggregateOperation && + operation.hasWriteStage && + (0, utils_1.maxWireVersion)(conn) < server_selection_1.MIN_SECONDARY_WRITE_WIRE_VERSION; + if (omitReadPreference) { + delete options.readPreference; + } + if (this.description.iscryptd) { + options.omitMaxTimeMS = true; + } + try { + try { + const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE); + (0, write_concern_1.throwIfWriteConcernError)(res); + return res; + } + catch (commandError) { + throw this.decorateCommandError(conn, cmd, options, commandError); + } + } + catch (operationError) { + if (operationError instanceof error_1.MongoError && + operationError.code?.valueOf() === error_1.MONGODB_ERROR_CODES.Reauthenticate) { + reauthPromise = this.pool.reauthenticate(conn); + reauthPromise.then(undefined, error => { + reauthPromise = null; + (0, utils_1.squashError)(error); + }); + await (0, utils_1.abortable)(reauthPromise, options); + reauthPromise = null; // only reachable if reauth succeeds + try { + const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE); + (0, write_concern_1.throwIfWriteConcernError)(res); + return res; + } + catch (commandError) { + throw this.decorateCommandError(conn, cmd, options, commandError); + } + } + else { + throw operationError; + } + } + finally { + cleanup(); + } + } + /** + * Handle SDAM error + * @internal + */ + handleError(error, connection) { + if (!(error instanceof error_1.MongoError)) { + return; + } + if (isStaleError(this, error)) { + return; + } + const isNetworkNonTimeoutError = error instanceof error_1.MongoNetworkError && !(error instanceof error_1.MongoNetworkTimeoutError); + const isNetworkTimeoutBeforeHandshakeError = error instanceof error_1.MongoNetworkError && error.beforeHandshake; + const isAuthOrEstablishmentHandshakeError = error.hasErrorLabel(error_1.MongoErrorLabel.HandshakeError); + const isSystemOverloadError = error.hasErrorLabel(error_1.MongoErrorLabel.SystemOverloadedError); + // Perhaps questionable and divergent from the spec, but considering MongoParseErrors like state change errors was legacy behavior. + if ((0, error_1.isStateChangeError)(error) || error instanceof error_1.MongoParseError) { + const shouldClearPool = (0, error_1.isNodeShuttingDownError)(error); + // from the SDAM spec: The driver MUST synchronize clearing the pool with updating the topology. + // In load balanced mode: there is no monitoring, so there is no topology to update. We simply clear the pool. + // For other topologies: the `ResetPool` label instructs the topology to clear the server's pool in `updateServer()`. + if (!this.loadBalanced) { + if (shouldClearPool) { + error.addErrorLabel(error_1.MongoErrorLabel.ResetPool); + } + markServerUnknown(this, error); + queueMicrotask(() => this.requestCheck()); + return; + } + if (connection && shouldClearPool) { + this.pool.clear({ serviceId: connection.serviceId }); + } + } + else if (isNetworkNonTimeoutError || + isNetworkTimeoutBeforeHandshakeError || + isAuthOrEstablishmentHandshakeError) { + // Do NOT clear the pool if we encounter a system overloaded error. + if (isSystemOverloadError) { + return; + } + // from the SDAM spec: The driver MUST synchronize clearing the pool with updating the topology. + // In load balanced mode: there is no monitoring, so there is no topology to update. We simply clear the pool. + // For other topologies: the `ResetPool` label instructs the topology to clear the server's pool in `updateServer()`. + if (!this.loadBalanced) { + error.addErrorLabel(error_1.MongoErrorLabel.ResetPool); + markServerUnknown(this, error); + } + else if (connection) { + this.pool.clear({ serviceId: connection.serviceId }); + } + } + } + /** + * Ensure that error is properly decorated and internal state is updated before throwing + * @internal + */ + decorateCommandError(connection, cmd, options, error) { + if (typeof error !== 'object' || error == null || !('name' in error)) { + throw new error_1.MongoRuntimeError('An unexpected error type: ' + typeof error); + } + if (error.name === 'AbortError' && 'cause' in error && error.cause instanceof error_1.MongoError) { + error = error.cause; + } + if (!(error instanceof error_1.MongoError)) { + // Node.js or some other error we have not special handling for + return error; + } + if (connectionIsStale(this.pool, connection)) { + return error; + } + const session = options?.session; + if (error instanceof error_1.MongoNetworkError) { + if (session && !session.hasEnded && session.serverSession) { + session.serverSession.isDirty = true; + } + // inActiveTransaction check handles commit and abort. + if (inActiveTransaction(session, cmd) && + !error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + error.addErrorLabel(error_1.MongoErrorLabel.TransientTransactionError); + } + if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && + (0, utils_1.supportsRetryableWrites)(this) && + !inActiveTransaction(session, cmd)) { + error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + } + else { + if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && + (0, error_1.needsRetryableWriteLabel)(error) && + !inActiveTransaction(session, cmd)) { + error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + } + if (session && + session.isPinned && + error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + session.unpin({ force: true }); + } + this.handleError(error, connection); + return error; + } + /** + * Decrement the operation count, returning the new count. + */ + decrementOperationCount() { + return (this.s.operationCount -= 1); + } + /** + * Increment the operation count, returning the new count. + */ + incrementOperationCount() { + return (this.s.operationCount += 1); + } +} +exports.Server = Server; +function markServerUnknown(server, error) { + // Load balancer servers can never be marked unknown. + if (server.loadBalanced) { + return; + } + if (error instanceof error_1.MongoNetworkError && !(error instanceof error_1.MongoNetworkTimeoutError)) { + server.monitor?.reset(); + } + server.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(server.description.hostAddress, undefined, { error })); +} +function isPinnableCommand(cmd, session) { + if (session) { + return (session.inTransaction() || + (session.transaction.isCommitted && 'commitTransaction' in cmd) || + 'aggregate' in cmd || + 'find' in cmd || + 'getMore' in cmd || + 'listCollections' in cmd || + 'listIndexes' in cmd || + 'bulkWrite' in cmd); + } + return false; +} +function connectionIsStale(pool, connection) { + if (connection.serviceId) { + return (connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString())); + } + return connection.generation !== pool.generation; +} +function inActiveTransaction(session, cmd) { + return session && session.inTransaction() && !(0, transactions_1.isTransactionCommand)(cmd); +} +/** this checks the retryWrites option passed down from the client options, it + * does not check if the server supports retryable writes */ +function isRetryableWritesEnabled(topology) { + return topology.s.options.retryWrites !== false; +} +function isStaleError(server, error) { + const currentGeneration = server.pool.generation; + const generation = error.connectionGeneration; + if (generation && generation < currentGeneration) { + return true; + } + const currentTopologyVersion = server.description.topologyVersion; + return (0, server_description_1.compareTopologyVersion)(currentTopologyVersion, error.topologyVersion) >= 0; +} +//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js.map new file mode 100644 index 00000000..a5060428 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server.js.map @@ -0,0 +1 @@ +{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/sdam/server.ts"],"names":[],"mappings":";;;AAEA,mDAAqE;AACrE,6DAIiC;AACjC,2CAAkD;AAClD,4CAWsB;AACtB,oCAckB;AAElB,gDAAmE;AACnE,uDAA6D;AAK7D,kDAAuD;AACvD,oCAQkB;AAClB,oDAA4D;AAC5D,qCAOkB;AAMlB,uCAAyD;AACzD,6DAAiF;AACjF,yDAAsE;AAGtE,MAAM,eAAe,GAAG,IAAA,wBAAgB,EAAC;IACvC,CAAC,qBAAY,CAAC,EAAE,CAAC,qBAAY,EAAE,yBAAgB,CAAC;IAChD,CAAC,yBAAgB,CAAC,EAAE,CAAC,yBAAgB,EAAE,sBAAa,EAAE,wBAAe,EAAE,qBAAY,CAAC;IACpF,CAAC,wBAAe,CAAC,EAAE,CAAC,wBAAe,EAAE,sBAAa,EAAE,qBAAY,CAAC;IACjE,CAAC,sBAAa,CAAC,EAAE,CAAC,sBAAa,EAAE,qBAAY,CAAC;CAC/C,CAAC,CAAC;AAuCH,gBAAgB;AAChB,MAAa,MAAO,SAAQ,+BAA+B;IAWzD,a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WAAW,CAAC,eAAe,CAAC;IAClE,OAAO,IAAA,2CAAsB,EAAC,sBAAsB,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACpF,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js new file mode 100644 index 00000000..654253d1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js @@ -0,0 +1,204 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServerDescription = void 0; +exports.parseServerType = parseServerType; +exports.compareTopologyVersion = compareTopologyVersion; +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const WRITABLE_SERVER_TYPES = new Set([ + common_1.ServerType.RSPrimary, + common_1.ServerType.Standalone, + common_1.ServerType.Mongos, + common_1.ServerType.LoadBalancer +]); +const DATA_BEARING_SERVER_TYPES = new Set([ + common_1.ServerType.RSPrimary, + common_1.ServerType.RSSecondary, + common_1.ServerType.Mongos, + common_1.ServerType.Standalone, + common_1.ServerType.LoadBalancer +]); +/** + * The client's view of a single server, based on the most recent hello outcome. + * + * Internal type, not meant to be directly instantiated + * @public + */ +class ServerDescription { + /** + * Create a ServerDescription + * @internal + * + * @param address - The address of the server + * @param hello - An optional hello response for this server + */ + constructor(address, hello, options = {}) { + if (address == null || address === '') { + throw new error_1.MongoRuntimeError('ServerDescription must be provided with a non-empty address'); + } + this.address = + typeof address === 'string' + ? utils_1.HostAddress.fromString(address).toString() // Use HostAddress to normalize + : address.toString(); + this.type = parseServerType(hello, options); + this.hosts = hello?.hosts?.map((host) => host.toLowerCase()) ?? []; + this.passives = hello?.passives?.map((host) => host.toLowerCase()) ?? []; + this.arbiters = hello?.arbiters?.map((host) => host.toLowerCase()) ?? []; + this.tags = hello?.tags ?? {}; + this.minWireVersion = hello?.minWireVersion ?? 0; + this.maxWireVersion = hello?.maxWireVersion ?? 0; + this.roundTripTime = options?.roundTripTime ?? -1; + this.minRoundTripTime = options?.minRoundTripTime ?? 0; + this.lastUpdateTime = (0, utils_1.processTimeMS)(); + this.lastWriteDate = hello?.lastWrite?.lastWriteDate ?? 0; + // NOTE: This actually builds the stack string instead of holding onto the getter and all its + // associated references. This is done to prevent a memory leak. + this.error = options.error ?? null; + this.error?.stack; + // TODO(NODE-2674): Preserve int64 sent from MongoDB + this.topologyVersion = this.error?.topologyVersion ?? hello?.topologyVersion ?? null; + this.setName = hello?.setName ?? null; + this.setVersion = hello?.setVersion ?? null; + this.electionId = hello?.electionId ?? null; + this.logicalSessionTimeoutMinutes = hello?.logicalSessionTimeoutMinutes ?? null; + this.maxMessageSizeBytes = hello?.maxMessageSizeBytes ?? null; + this.maxWriteBatchSize = hello?.maxWriteBatchSize ?? null; + this.maxBsonObjectSize = hello?.maxBsonObjectSize ?? null; + this.primary = hello?.primary ?? null; + this.me = hello?.me?.toLowerCase() ?? null; + this.$clusterTime = hello?.$clusterTime ?? null; + this.iscryptd = Boolean(hello?.iscryptd); + } + get hostAddress() { + return utils_1.HostAddress.fromString(this.address); + } + get allHosts() { + return this.hosts.concat(this.arbiters).concat(this.passives); + } + /** Is this server available for reads*/ + get isReadable() { + return this.type === common_1.ServerType.RSSecondary || this.isWritable; + } + /** Is this server data bearing */ + get isDataBearing() { + return DATA_BEARING_SERVER_TYPES.has(this.type); + } + /** Is this server available for writes */ + get isWritable() { + return WRITABLE_SERVER_TYPES.has(this.type); + } + get host() { + const chopLength = `:${this.port}`.length; + return this.address.slice(0, -chopLength); + } + get port() { + const port = this.address.split(':').pop(); + return port ? Number.parseInt(port, 10) : 27017; + } + /** + * Determines if another `ServerDescription` is equal to this one per the rules defined in the SDAM specification. + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md + */ + equals(other) { + // Despite using the comparator that would determine a nullish topologyVersion as greater than + // for equality we should only always perform direct equality comparison + const topologyVersionsEqual = this.topologyVersion === other?.topologyVersion || + compareTopologyVersion(this.topologyVersion, other?.topologyVersion) === 0; + const electionIdsEqual = this.electionId != null && other?.electionId != null + ? (0, utils_1.compareObjectId)(this.electionId, other.electionId) === 0 + : this.electionId === other?.electionId; + return (other != null && + other.iscryptd === this.iscryptd && + (0, utils_1.errorStrictEqual)(this.error, other.error) && + this.type === other.type && + this.minWireVersion === other.minWireVersion && + (0, utils_1.arrayStrictEqual)(this.hosts, other.hosts) && + tagsStrictEqual(this.tags, other.tags) && + this.setName === other.setName && + this.setVersion === other.setVersion && + electionIdsEqual && + this.primary === other.primary && + this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes && + topologyVersionsEqual); + } +} +exports.ServerDescription = ServerDescription; +// Parses a `hello` message and determines the server type +function parseServerType(hello, options) { + if (options?.loadBalanced) { + return common_1.ServerType.LoadBalancer; + } + if (!hello || !hello.ok) { + return common_1.ServerType.Unknown; + } + if (hello.isreplicaset) { + return common_1.ServerType.RSGhost; + } + if (hello.msg && hello.msg === 'isdbgrid') { + return common_1.ServerType.Mongos; + } + if (hello.setName) { + if (hello.hidden) { + return common_1.ServerType.RSOther; + } + else if (hello.isWritablePrimary) { + return common_1.ServerType.RSPrimary; + } + else if (hello.secondary) { + return common_1.ServerType.RSSecondary; + } + else if (hello.arbiterOnly) { + return common_1.ServerType.RSArbiter; + } + else { + return common_1.ServerType.RSOther; + } + } + return common_1.ServerType.Standalone; +} +function tagsStrictEqual(tags, tags2) { + const tagsKeys = Object.keys(tags); + const tags2Keys = Object.keys(tags2); + return (tagsKeys.length === tags2Keys.length && + tagsKeys.every((key) => tags2[key] === tags[key])); +} +/** + * Compares two topology versions. + * + * 1. If the response topologyVersion is unset or the ServerDescription's + * topologyVersion is null, the client MUST assume the response is more recent. + * 1. If the response's topologyVersion.processId is not equal to the + * ServerDescription's, the client MUST assume the response is more recent. + * 1. If the response's topologyVersion.processId is equal to the + * ServerDescription's, the client MUST use the counter field to determine + * which topologyVersion is more recent. + * + * ```ts + * currentTv < newTv === -1 + * currentTv === newTv === 0 + * currentTv > newTv === 1 + * ``` + */ +function compareTopologyVersion(currentTv, newTv) { + if (currentTv == null || newTv == null) { + return -1; + } + if (!currentTv.processId.equals(newTv.processId)) { + return -1; + } + // TODO(NODE-2674): Preserve int64 sent from MongoDB + const currentCounter = typeof currentTv.counter === 'bigint' + ? bson_1.Long.fromBigInt(currentTv.counter) + : bson_1.Long.isLong(currentTv.counter) + ? currentTv.counter + : bson_1.Long.fromNumber(currentTv.counter); + const newCounter = typeof newTv.counter === 'bigint' + ? bson_1.Long.fromBigInt(newTv.counter) + : bson_1.Long.isLong(newTv.counter) + ? newTv.counter + : bson_1.Long.fromNumber(newTv.counter); + return currentCounter.compare(newCounter); +} +//# sourceMappingURL=server_description.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js.map new file mode 100644 index 00000000..09d6e2e0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_description.js.map @@ -0,0 +1 @@ +{"version":3,"file":"server_description.js","sourceRoot":"","sources":["../../src/sdam/server_description.ts"],"names":[],"mappings":";;;AA+MA,0CAgCC;AA6BD,wDA4BC;AAxSD,kCAA6D;AAC7D,oCAA8D;AAC9D,oCAMkB;AAClB,qCAAwD;AAExD,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAa;IAChD,mBAAU,CAAC,SAAS;IACpB,mBAAU,CAAC,UAAU;IACrB,mBAAU,CAAC,MAAM;IACjB,mBAAU,CAAC,YAAY;CACxB,CAAC,CAAC;AAEH,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAa;IACpD,mBAAU,CAAC,SAAS;IACpB,mBAAU,CAAC,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AC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,sBAAsB,CACpC,SAAkC,EAClC,KAA8B;IAE9B,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACvC,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;IAED,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACjD,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;IAED,oDAAoD;IACpD,MAAM,cAAc,GAClB,OAAO,SAAS,CAAC,OAAO,KAAK,QAAQ;QACnC,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC;QACpC,CAAC,CAAC,WAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;YAC9B,CAAC,CAAC,SAAS,CAAC,OAAO;YACnB,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAE3C,MAAM,UAAU,GACd,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QAC/B,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,WAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;YAC1B,CAAC,CAAC,KAAK,CAAC,OAAO;YACf,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEvC,OAAO,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js new file mode 100644 index 00000000..838506b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js @@ -0,0 +1,294 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeprioritizedServers = exports.MIN_SECONDARY_WRITE_WIRE_VERSION = void 0; +exports.writableServerSelector = writableServerSelector; +exports.sameServerSelector = sameServerSelector; +exports.secondaryWritableServerSelector = secondaryWritableServerSelector; +exports.readPreferenceServerSelector = readPreferenceServerSelector; +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const common_1 = require("./common"); +// max staleness constants +const IDLE_WRITE_PERIOD = 10000; +const SMALLEST_MAX_STALENESS_SECONDS = 90; +// Minimum version to try writes on secondaries. +exports.MIN_SECONDARY_WRITE_WIRE_VERSION = 13; +/** @internal */ +class DeprioritizedServers { + constructor(descriptions) { + this.deprioritized = new Set(); + for (const description of descriptions ?? []) { + this.add(description); + } + } + add({ address }) { + this.deprioritized.add(address); + } + has({ address }) { + return this.deprioritized.has(address); + } +} +exports.DeprioritizedServers = DeprioritizedServers; +function filterDeprioritized(candidates, deprioritized) { + const filtered = candidates.filter(candidate => !deprioritized.has(candidate)); + return filtered.length ? filtered : candidates; +} +/** + * Returns a server selector that selects for writable servers + */ +function writableServerSelector() { + return function writableServer(topologyDescription, servers, deprioritized) { + const eligibleServers = filterDeprioritized(servers.filter(({ isWritable }) => isWritable), deprioritized); + return latencyWindowReducer(topologyDescription, eligibleServers); + }; +} +/** + * The purpose of this selector is to select the same server, only + * if it is in a state that it can have commands sent to it. + */ +function sameServerSelector(description) { + return function sameServerSelector(_topologyDescription, servers, _deprioritized) { + if (!description) + return []; + // Filter the servers to match the provided description only if + // the type is not unknown. + return servers.filter(sd => { + return sd.address === description.address && sd.type !== common_1.ServerType.Unknown; + }); + }; +} +/** + * Returns a server selector that uses a read preference to select a + * server potentially for a write on a secondary. + */ +function secondaryWritableServerSelector(wireVersion, readPreference) { + // If server version < 5.0, read preference always primary. + // If server version >= 5.0... + // - If read preference is supplied, use that. + // - If no read preference is supplied, use primary. + if (!readPreference || + !wireVersion || + (wireVersion && wireVersion < exports.MIN_SECONDARY_WRITE_WIRE_VERSION)) { + return readPreferenceServerSelector(read_preference_1.ReadPreference.primary); + } + return readPreferenceServerSelector(readPreference); +} +/** + * Reduces the passed in array of servers by the rules of the "Max Staleness" specification + * found here: + * + * @see https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness.md + * + * @param readPreference - The read preference providing max staleness guidance + * @param topologyDescription - The topology description + * @param servers - The list of server descriptions to be reduced + * @returns The list of servers that satisfy the requirements of max staleness + */ +function maxStalenessReducer(readPreference, topologyDescription, servers) { + if (readPreference.maxStalenessSeconds == null || readPreference.maxStalenessSeconds < 0) { + return servers; + } + const maxStaleness = readPreference.maxStalenessSeconds; + const maxStalenessVariance = (topologyDescription.heartbeatFrequencyMS + IDLE_WRITE_PERIOD) / 1000; + if (maxStaleness < maxStalenessVariance) { + throw new error_1.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${maxStalenessVariance} seconds`); + } + if (maxStaleness < SMALLEST_MAX_STALENESS_SECONDS) { + throw new error_1.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${SMALLEST_MAX_STALENESS_SECONDS} seconds`); + } + if (topologyDescription.type === common_1.TopologyType.ReplicaSetWithPrimary) { + const primary = Array.from(topologyDescription.servers.values()).filter(primaryFilter)[0]; + return servers.filter((server) => { + const stalenessMS = server.lastUpdateTime - + server.lastWriteDate - + (primary.lastUpdateTime - primary.lastWriteDate) + + topologyDescription.heartbeatFrequencyMS; + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + return staleness <= maxStalenessSeconds; + }); + } + if (topologyDescription.type === common_1.TopologyType.ReplicaSetNoPrimary) { + if (servers.length === 0) { + return servers; + } + const sMax = servers.reduce((max, s) => s.lastWriteDate > max.lastWriteDate ? s : max); + return servers.filter((server) => { + const stalenessMS = sMax.lastWriteDate - server.lastWriteDate + topologyDescription.heartbeatFrequencyMS; + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + return staleness <= maxStalenessSeconds; + }); + } + return servers; +} +/** + * Determines whether a server's tags match a given set of tags. + * + * A tagset matches the server's tags if every k-v pair in the tagset + * is also in the server's tagset. + * + * Note that this does not requires that every k-v pair in the server's tagset is also + * in the client's tagset. The server's tagset is required only to be a superset of the + * client's tags. + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.md#tag_sets + * + * @param tagSet - The requested tag set to match + * @param serverTags - The server's tags + */ +function tagSetMatch(tagSet, serverTags) { + return Object.entries(tagSet).every(([key, value]) => serverTags[key] != null && serverTags[key] === value); +} +/** + * Reduces a set of server descriptions based on tags requested by the read preference + * + * @param readPreference - The read preference providing the requested tags + * @param servers - The list of server descriptions to reduce + * @returns The list of servers matching the requested tags + */ +function tagSetReducer({ tags }, servers) { + if (tags == null || tags.length === 0) { + // empty tag sets match all servers + return servers; + } + for (const tagSet of tags) { + const serversMatchingTagset = servers.filter((s) => tagSetMatch(tagSet, s.tags)); + if (serversMatchingTagset.length) { + return serversMatchingTagset; + } + } + return []; +} +/** + * Reduces a list of servers to ensure they fall within an acceptable latency window. This is + * further specified in the "Server Selection" specification, found here: + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.md + * + * @param topologyDescription - The topology description + * @param servers - The list of servers to reduce + * @returns The servers which fall within an acceptable latency window + */ +function latencyWindowReducer(topologyDescription, servers) { + const low = servers.reduce((min, server) => Math.min(server.roundTripTime, min), Infinity); + const high = low + topologyDescription.localThresholdMS; + return servers.filter(server => server.roundTripTime <= high && server.roundTripTime >= low); +} +// filters +function primaryFilter(server) { + return server.type === common_1.ServerType.RSPrimary; +} +function secondaryFilter(server) { + return server.type === common_1.ServerType.RSSecondary; +} +function nearestFilter(server) { + return server.type === common_1.ServerType.RSSecondary || server.type === common_1.ServerType.RSPrimary; +} +function knownFilter(server) { + return server.type !== common_1.ServerType.Unknown; +} +function loadBalancerFilter(server) { + return server.type === common_1.ServerType.LoadBalancer; +} +function isDeprioritizedFactory(deprioritized) { + return server => + // if any deprioritized servers equal the server, here we are. + !deprioritized.has(server); +} +function secondarySelector(readPreference, topologyDescription, servers, deprioritized) { + const mode = readPreference.mode; + switch (mode) { + case 'primary': + // Note: no need to filter for deprioritized servers. A replica set has only one primary; that means that + // we are in one of two scenarios: + // 1. deprioritized servers is empty - return the primary. + // 2. deprioritized servers contains the primary - return the primary. + return servers.filter(primaryFilter); + case 'primaryPreferred': { + const primary = servers.filter(primaryFilter); + // If there is a primary and it is not deprioritized, use the primary. Otherwise, + // check for secondaries. + const eligiblePrimary = primary.filter(isDeprioritizedFactory(deprioritized)); + if (eligiblePrimary.length) { + return eligiblePrimary; + } + // If we make it here, we either have: + // 1. a deprioritized primary + // 2. no eligible primary + // secondaries take precedence of deprioritized primaries. + const secondaries = tagSetReducer(readPreference, maxStalenessReducer(readPreference, topologyDescription, servers.filter(secondaryFilter))); + const eligibleSecondaries = secondaries.filter(isDeprioritizedFactory(deprioritized)); + if (eligibleSecondaries.length) { + return latencyWindowReducer(topologyDescription, eligibleSecondaries); + } + // if we make it here, we have no primaries or secondaries that not deprioritized. + // prefer the primary (which may not exist, if the topology has no primary). + // otherwise, return the secondaries (which also may not exist, but there is nothing else to check here). + return primary.length ? primary : latencyWindowReducer(topologyDescription, secondaries); + } + case 'nearest': { + const eligible = filterDeprioritized(tagSetReducer(readPreference, maxStalenessReducer(readPreference, topologyDescription, servers.filter(nearestFilter))), deprioritized); + return latencyWindowReducer(topologyDescription, eligible); + } + case 'secondary': + case 'secondaryPreferred': { + const secondaries = tagSetReducer(readPreference, maxStalenessReducer(readPreference, topologyDescription, servers.filter(secondaryFilter))); + const eligibleSecondaries = secondaries.filter(isDeprioritizedFactory(deprioritized)); + if (eligibleSecondaries.length) { + return latencyWindowReducer(topologyDescription, eligibleSecondaries); + } + // we have no eligible secondaries, try for a primary if we can. + if (mode === read_preference_1.ReadPreference.SECONDARY_PREFERRED) { + const primary = servers.filter(primaryFilter); + // unlike readPreference=primary, here we do filter for deprioritized servers. + // if the primary is deprioritized, deprioritized secondaries take precedence. + const eligiblePrimary = primary.filter(isDeprioritizedFactory(deprioritized)); + if (eligiblePrimary.length) + return eligiblePrimary; + // we have no eligible primary nor secondaries that have not been deprioritized + return secondaries.length + ? latencyWindowReducer(topologyDescription, secondaries) + : primary; + } + // return all secondaries in the latency window. + return latencyWindowReducer(topologyDescription, secondaries); + } + default: { + const _exhaustiveCheck = mode; + throw new error_1.MongoRuntimeError(`unexpected readPreference=${mode} (should never happen). Please report a bug in the Node driver Jira project.`); + } + } +} +/** + * Returns a function which selects servers based on a provided read preference + * + * @param readPreference - The read preference to select with + */ +function readPreferenceServerSelector(readPreference) { + if (!readPreference.isValid()) { + throw new error_1.MongoInvalidArgumentError('Invalid read preference specified'); + } + return function readPreferenceServers(topologyDescription, servers, deprioritized) { + switch (topologyDescription.type) { + case 'Single': + return latencyWindowReducer(topologyDescription, servers.filter(knownFilter)); + case 'ReplicaSetNoPrimary': + case 'ReplicaSetWithPrimary': + return secondarySelector(readPreference, topologyDescription, servers, deprioritized); + case 'Sharded': { + const selectable = filterDeprioritized(servers, deprioritized); + return latencyWindowReducer(topologyDescription, selectable.filter(knownFilter)); + } + case 'Unknown': + return []; + case 'LoadBalanced': + return servers.filter(loadBalancerFilter); + default: { + const _exhaustiveCheck = topologyDescription.type; + throw new error_1.MongoRuntimeError(`unexpected topology type: ${topologyDescription.type} (this should never happen). Please file a bug in the Node driver Jira project.`); + } + } + }; +} +//# sourceMappingURL=server_selection.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js.map new file mode 100644 index 00000000..cbb635a4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection.js.map @@ -0,0 +1 @@ +{"version":3,"file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pm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js new file mode 100644 index 00000000..20bc95b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WaitingForSuitableServerEvent = exports.ServerSelectionSucceededEvent = exports.ServerSelectionFailedEvent = exports.ServerSelectionStartedEvent = exports.ServerSelectionEvent = void 0; +const utils_1 = require(".././utils"); +const constants_1 = require("../constants"); +/** + * The base export class for all logs published from server selection + * @internal + * @category Log Type + */ +class ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, operation) { + this.selector = selector; + this.operation = operation; + this.topologyDescription = topologyDescription; + } +} +exports.ServerSelectionEvent = ServerSelectionEvent; +/** + * An event published when server selection starts + * @internal + * @category Event + */ +class ServerSelectionStartedEvent extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, operation) { + super(selector, topologyDescription, operation); + /** @internal */ + this.name = constants_1.SERVER_SELECTION_STARTED; + this.message = 'Server selection started'; + } +} +exports.ServerSelectionStartedEvent = ServerSelectionStartedEvent; +/** + * An event published when a server selection fails + * @internal + * @category Event + */ +class ServerSelectionFailedEvent extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, error, operation) { + super(selector, topologyDescription, operation); + /** @internal */ + this.name = constants_1.SERVER_SELECTION_FAILED; + this.message = 'Server selection failed'; + this.failure = error; + } +} +exports.ServerSelectionFailedEvent = ServerSelectionFailedEvent; +/** + * An event published when server selection succeeds + * @internal + * @category Event + */ +class ServerSelectionSucceededEvent extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, address, operation) { + super(selector, topologyDescription, operation); + /** @internal */ + this.name = constants_1.SERVER_SELECTION_SUCCEEDED; + this.message = 'Server selection succeeded'; + const { host, port } = utils_1.HostAddress.fromString(address).toHostPort(); + this.serverHost = host; + this.serverPort = port; + } +} +exports.ServerSelectionSucceededEvent = ServerSelectionSucceededEvent; +/** + * An event published when server selection is waiting for a suitable server to become available + * @internal + * @category Event + */ +class WaitingForSuitableServerEvent extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, remainingTimeMS, operation) { + super(selector, topologyDescription, operation); + /** @internal */ + this.name = constants_1.WAITING_FOR_SUITABLE_SERVER; + this.message = 'Waiting for suitable server to become available'; + this.remainingTimeMS = remainingTimeMS; + } +} +exports.WaitingForSuitableServerEvent = WaitingForSuitableServerEvent; +//# sourceMappingURL=server_selection_events.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js.map new file mode 100644 index 00000000..b6c719ed --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/server_selection_events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"server_selection_events.js","sourceRoot":"","sources":["../../src/sdam/server_selection_events.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AACzC,4CAKsB;AAKtB;;;;GAIG;AACH,MAAsB,oBAAoB;IAmBxC,gBAAgB;IAChB,YACE,QAAkD,EAClD,mBAAwC,EACxC,SAAiB;QAEjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;CACF;AA7BD,oDA6BC;AAED;;;;GAIG;AACH,MAAa,2BAA4B,SAAQ,oBAAoB;IAKnE,gBAAgB;IAChB,YACE,QAAkD,EAClD,mBAAwC,EACxC,SAAiB;QAEjB,KAAK,CAAC,QAAQ,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC;QA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AAe,GAAG,eAAe,CAAC;IACzC,CAAC;CACF;AAjBD,sEAiBC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js new file mode 100644 index 00000000..33863388 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js @@ -0,0 +1,108 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SrvPoller = exports.SrvPollingEvent = void 0; +const dns = require("dns"); +const timers_1 = require("timers"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const utils_1 = require("../utils"); +/** + * @internal + * @category Event + */ +class SrvPollingEvent { + constructor(srvRecords) { + this.srvRecords = srvRecords; + } + hostnames() { + return new Set(this.srvRecords.map(r => utils_1.HostAddress.fromSrvRecord(r).toString())); + } +} +exports.SrvPollingEvent = SrvPollingEvent; +/** @internal */ +class SrvPoller extends mongo_types_1.TypedEventEmitter { + /** @event */ + static { this.SRV_RECORD_DISCOVERY = 'srvRecordDiscovery'; } + constructor(options) { + super(); + this.on('error', utils_1.noop); + if (!options || !options.srvHost) { + throw new error_1.MongoRuntimeError('Options for SrvPoller must exist and include srvHost'); + } + this.srvHost = options.srvHost; + this.srvMaxHosts = options.srvMaxHosts ?? 0; + this.srvServiceName = options.srvServiceName ?? 'mongodb'; + this.rescanSrvIntervalMS = 60000; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 10000; + this.haMode = false; + this.generation = 0; + this._timeout = undefined; + } + get srvAddress() { + return `_${this.srvServiceName}._tcp.${this.srvHost}`; + } + get intervalMS() { + return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMS; + } + start() { + if (!this._timeout) { + this.schedule(); + } + } + stop() { + if (this._timeout) { + (0, timers_1.clearTimeout)(this._timeout); + this.generation += 1; + this._timeout = undefined; + } + } + // TODO(NODE-4994): implement new logging logic for SrvPoller failures + schedule() { + if (this._timeout) { + (0, timers_1.clearTimeout)(this._timeout); + } + this._timeout = (0, timers_1.setTimeout)(() => { + this._poll().then(undefined, utils_1.squashError); + }, this.intervalMS); + } + success(srvRecords) { + this.haMode = false; + this.schedule(); + this.emit(SrvPoller.SRV_RECORD_DISCOVERY, new SrvPollingEvent(srvRecords)); + } + failure() { + this.haMode = true; + this.schedule(); + } + async _poll() { + const generation = this.generation; + let srvRecords; + try { + srvRecords = await dns.promises.resolve(this.srvAddress, 'SRV'); + } + catch { + this.failure(); + return; + } + if (generation !== this.generation) { + return; + } + const finalAddresses = []; + for (const record of srvRecords) { + try { + (0, utils_1.checkParentDomainMatch)(record.name, this.srvHost); + finalAddresses.push(record); + } + catch (error) { + (0, utils_1.squashError)(error); + } + } + if (!finalAddresses.length) { + this.failure(); + return; + } + this.success(finalAddresses); + } +} +exports.SrvPoller = SrvPoller; +//# sourceMappingURL=srv_polling.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js.map new file mode 100644 index 00000000..d041ef14 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/srv_polling.js.map @@ -0,0 +1 @@ +{"version":3,"file":"srv_polling.js","sourceRoot":"","sources":["../../src/sdam/srv_polling.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,mCAAkD;AAElD,oCAA6C;AAC7C,gDAAmD;AACnD,oCAAkF;AAElF;;;GAGG;AACH,MAAa,eAAe;IAE1B,YAAY,UAA2B;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,SAAS;QACP,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAA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EAAE,CAAC;YACnC,OAAO;QACT,CAAC;QAED,MAAM,cAAc,GAAoB,EAAE,CAAC;QAC3C,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;YAChC,IAAI,CAAC;gBACH,IAAA,8BAAsB,EAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAClD,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC9B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAA,mBAAW,EAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/B,CAAC;;AA5GH,8BA6GC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js new file mode 100644 index 00000000..b34f9931 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js @@ -0,0 +1,654 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Topology = void 0; +const connection_string_1 = require("../connection_string"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_logger_1 = require("../mongo_logger"); +const mongo_types_1 = require("../mongo_types"); +const read_preference_1 = require("../read_preference"); +const timeout_1 = require("../timeout"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const events_1 = require("./events"); +const server_1 = require("./server"); +const server_description_1 = require("./server_description"); +const server_selection_1 = require("./server_selection"); +const server_selection_events_1 = require("./server_selection_events"); +const srv_polling_1 = require("./srv_polling"); +const topology_description_1 = require("./topology_description"); +// Global state +let globalTopologyCounter = 0; +const stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING], + [common_1.STATE_CONNECTING]: [common_1.STATE_CONNECTING, common_1.STATE_CLOSING, common_1.STATE_CONNECTED, common_1.STATE_CLOSED], + [common_1.STATE_CONNECTED]: [common_1.STATE_CONNECTED, common_1.STATE_CLOSING, common_1.STATE_CLOSED], + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED] +}); +/** + * A container of server instances representing a connection to a MongoDB topology. + * @internal + */ +class Topology extends mongo_types_1.TypedEventEmitter { + /** @event */ + static { this.SERVER_OPENING = constants_1.SERVER_OPENING; } + /** @event */ + static { this.SERVER_CLOSED = constants_1.SERVER_CLOSED; } + /** @event */ + static { this.SERVER_DESCRIPTION_CHANGED = constants_1.SERVER_DESCRIPTION_CHANGED; } + /** @event */ + static { this.TOPOLOGY_OPENING = constants_1.TOPOLOGY_OPENING; } + /** @event */ + static { this.TOPOLOGY_CLOSED = constants_1.TOPOLOGY_CLOSED; } + /** @event */ + static { this.TOPOLOGY_DESCRIPTION_CHANGED = constants_1.TOPOLOGY_DESCRIPTION_CHANGED; } + /** @event */ + static { this.ERROR = constants_1.ERROR; } + /** @event */ + static { this.OPEN = constants_1.OPEN; } + /** @event */ + static { this.CONNECT = constants_1.CONNECT; } + /** @event */ + static { this.CLOSE = constants_1.CLOSE; } + /** @event */ + static { this.TIMEOUT = constants_1.TIMEOUT; } + /** + * @param seedlist - a list of HostAddress instances to connect to + */ + constructor(client, seeds, options) { + super(); + this.on('error', utils_1.noop); + this.client = client; + // Options should only be undefined in tests, MongoClient will always have defined options + options = options ?? { + hosts: [utils_1.HostAddress.fromString('localhost:27017')], + ...Object.fromEntries(connection_string_1.DEFAULT_OPTIONS.entries()) + }; + if (typeof seeds === 'string') { + seeds = [utils_1.HostAddress.fromString(seeds)]; + } + else if (!Array.isArray(seeds)) { + seeds = [seeds]; + } + const seedlist = []; + for (const seed of seeds) { + if (typeof seed === 'string') { + seedlist.push(utils_1.HostAddress.fromString(seed)); + } + else if (seed instanceof utils_1.HostAddress) { + seedlist.push(seed); + } + else { + // FIXME(NODE-3483): May need to be a MongoParseError + throw new error_1.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(seed)}`); + } + } + const topologyType = topologyTypeFromOptions(options); + const topologyId = globalTopologyCounter++; + const selectedHosts = options.srvMaxHosts == null || + options.srvMaxHosts === 0 || + options.srvMaxHosts >= seedlist.length + ? seedlist + : (0, utils_1.shuffle)(seedlist, options.srvMaxHosts); + const serverDescriptions = new Map(); + for (const hostAddress of selectedHosts) { + serverDescriptions.set(hostAddress.toString(), new server_description_1.ServerDescription(hostAddress)); + } + this.waitQueue = new utils_1.List(); + this.s = { + // the id of this topology + id: topologyId, + // passed in options + options, + // initial seedlist of servers to connect to + seedlist, + // initial state + state: common_1.STATE_CLOSED, + // the topology description + description: new topology_description_1.TopologyDescription(topologyType, serverDescriptions, options.replicaSet, undefined, undefined, undefined, options), + serverSelectionTimeoutMS: options.serverSelectionTimeoutMS, + heartbeatFrequencyMS: options.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS, + // a map of server instances to normalized addresses + servers: new Map(), + credentials: options?.credentials, + clusterTime: undefined, + detectShardedTopology: ev => this.detectShardedTopology(ev), + detectSrvRecords: ev => this.detectSrvRecords(ev) + }; + this.mongoLogger = client.mongoLogger; + this.component = 'topology'; + if (options.srvHost && !options.loadBalanced) { + this.s.srvPoller = + options.srvPoller ?? + new srv_polling_1.SrvPoller({ + heartbeatFrequencyMS: this.s.heartbeatFrequencyMS, + srvHost: options.srvHost, + srvMaxHosts: options.srvMaxHosts, + srvServiceName: options.srvServiceName + }); + this.on(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + } + this.connectionLock = undefined; + } + detectShardedTopology(event) { + const previousType = event.previousDescription.type; + const newType = event.newDescription.type; + const transitionToSharded = previousType !== common_1.TopologyType.Sharded && newType === common_1.TopologyType.Sharded; + const srvListeners = this.s.srvPoller?.listeners(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY); + const listeningToSrvPolling = !!srvListeners?.includes(this.s.detectSrvRecords); + if (transitionToSharded && !listeningToSrvPolling) { + this.s.srvPoller?.on(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + this.s.srvPoller?.start(); + } + } + detectSrvRecords(ev) { + const previousTopologyDescription = this.s.description; + this.s.description = this.s.description.updateFromSrvPollingEvent(ev, this.s.options.srvMaxHosts); + if (this.s.description === previousTopologyDescription) { + // Nothing changed, so return + return; + } + updateServers(this); + this.emitAndLog(Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, previousTopologyDescription, this.s.description)); + } + /** + * @returns A `TopologyDescription` for this topology + */ + get description() { + return this.s.description; + } + get loadBalanced() { + return this.s.options.loadBalanced; + } + get serverApi() { + return this.s.options.serverApi; + } + /** Initiate server connect */ + async connect(options) { + this.connectionLock ??= this._connect(options); + try { + await this.connectionLock; + return this; + } + finally { + this.connectionLock = undefined; + } + } + async _connect(options) { + options = options ?? {}; + if (this.s.state === common_1.STATE_CONNECTED) { + return this; + } + stateTransition(this, common_1.STATE_CONNECTING); + // emit SDAM monitoring events + this.emitAndLog(Topology.TOPOLOGY_OPENING, new events_1.TopologyOpeningEvent(this.s.id)); + // emit an event for the topology change + this.emitAndLog(Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, new topology_description_1.TopologyDescription(common_1.TopologyType.Unknown), // initial is always Unknown + this.s.description)); + // connect all known servers, then attempt server selection to connect + const serverDescriptions = Array.from(this.s.description.servers.values()); + this.s.servers = new Map(serverDescriptions.map(serverDescription => [ + serverDescription.address, + createAndConnectServer(this, serverDescription) + ])); + // In load balancer mode we need to fake a server description getting + // emitted from the monitor, since the monitor doesn't exist. + if (this.s.options.loadBalanced) { + for (const description of serverDescriptions) { + const newDescription = new server_description_1.ServerDescription(description.hostAddress, undefined, { + loadBalanced: this.s.options.loadBalanced + }); + this.serverUpdateHandler(newDescription); + } + } + const serverSelectionTimeoutMS = this.client.s.options.serverSelectionTimeoutMS; + const readPreference = options.readPreference ?? read_preference_1.ReadPreference.primary; + const timeoutContext = timeout_1.TimeoutContext.create({ + // TODO(NODE-6448): auto-connect ignores timeoutMS; potential future feature + timeoutMS: undefined, + serverSelectionTimeoutMS, + waitQueueTimeoutMS: this.client.s.options.waitQueueTimeoutMS + }); + const selectServerOptions = { + operationName: 'handshake', + ...options, + timeoutContext, + deprioritizedServers: new server_selection_1.DeprioritizedServers() + }; + try { + const server = await this.selectServer((0, server_selection_1.readPreferenceServerSelector)(readPreference), selectServerOptions); + const skipPingOnConnect = this.s.options.__skipPingOnConnect === true; + if (!skipPingOnConnect) { + const connection = await server.pool.checkOut({ timeoutContext: timeoutContext }); + server.pool.checkIn(connection); + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + return this; + } + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + return this; + } + catch (error) { + this.close(); + throw error; + } + } + closeCheckedOutConnections() { + for (const server of this.s.servers.values()) { + server.closeCheckedOutConnections(); + } + } + /** Close this topology */ + close() { + if (this.s.state === common_1.STATE_CLOSED || this.s.state === common_1.STATE_CLOSING) { + return; + } + for (const server of this.s.servers.values()) { + closeServer(server, this); + } + this.s.servers.clear(); + stateTransition(this, common_1.STATE_CLOSING); + drainWaitQueue(this.waitQueue, new error_1.MongoTopologyClosedError()); + if (this.s.srvPoller) { + this.s.srvPoller.stop(); + this.s.srvPoller.removeListener(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + } + this.removeListener(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + stateTransition(this, common_1.STATE_CLOSED); + // emit an event for close + this.emitAndLog(Topology.TOPOLOGY_CLOSED, new events_1.TopologyClosedEvent(this.s.id)); + } + /** + * Selects a server according to the selection predicate provided + * + * @param selector - An optional selector to select servers by, defaults to a random selection within a latency window + * @param options - Optional settings related to server selection + * @param callback - The callback used to indicate success or failure + * @returns An instance of a `Server` meeting the criteria of the predicate provided + */ + async selectServer(selector, options) { + let serverSelector; + if (typeof selector !== 'function') { + if (typeof selector === 'string') { + serverSelector = (0, server_selection_1.readPreferenceServerSelector)(read_preference_1.ReadPreference.fromString(selector)); + } + else { + let readPreference; + if (selector instanceof read_preference_1.ReadPreference) { + readPreference = selector; + } + else { + read_preference_1.ReadPreference.translate(options); + readPreference = options.readPreference || read_preference_1.ReadPreference.primary; + } + serverSelector = (0, server_selection_1.readPreferenceServerSelector)(readPreference); + } + } + else { + serverSelector = selector; + } + options = { serverSelectionTimeoutMS: this.s.serverSelectionTimeoutMS, ...options }; + if (this.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + this.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionStartedEvent(selector, this.description, options.operationName)); + } + let timeout; + if (options.timeoutContext) + timeout = options.timeoutContext.serverSelectionTimeout; + else { + timeout = timeout_1.Timeout.expires(options.serverSelectionTimeoutMS ?? 0); + } + const isSharded = this.description.type === common_1.TopologyType.Sharded; + const session = options.session; + const transaction = session && session.transaction; + if (isSharded && transaction && transaction.server) { + if (this.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + this.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionSucceededEvent(selector, this.description, transaction.server.pool.address, options.operationName)); + } + if (!options.timeoutContext || options.timeoutContext.clearServerSelectionTimeout) { + timeout?.clear(); + } + return transaction.server; + } + const { promise: serverPromise, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + const waitQueueMember = { + serverSelector, + topologyDescription: this.description, + mongoLogger: this.client.mongoLogger, + transaction, + resolve, + reject, + cancelled: false, + startTime: (0, utils_1.processTimeMS)(), + operationName: options.operationName, + waitingLogged: false, + deprioritizedServers: options.deprioritizedServers + }; + const abortListener = (0, utils_1.addAbortListener)(options.signal, function () { + waitQueueMember.cancelled = true; + reject(this.reason); + }); + this.waitQueue.push(waitQueueMember); + processWaitQueue(this); + try { + timeout?.throwIfExpired(); + const server = await (timeout ? Promise.race([serverPromise, timeout]) : serverPromise); + if (options.timeoutContext?.csotEnabled() && server.description.minRoundTripTime !== 0) { + options.timeoutContext.minRoundTripTime = server.description.minRoundTripTime; + } + return server; + } + catch (error) { + if (timeout_1.TimeoutError.is(error)) { + // Timeout + waitQueueMember.cancelled = true; + const timeoutError = new error_1.MongoServerSelectionError(`Server selection timed out after ${timeout?.duration} ms`, this.description); + if (this.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + this.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(selector, this.description, timeoutError, options.operationName)); + } + if (options.timeoutContext?.csotEnabled()) { + throw new error_1.MongoOperationTimeoutError('Timed out during server selection', { + cause: timeoutError + }); + } + throw timeoutError; + } + // Other server selection error + throw error; + } + finally { + abortListener?.[utils_1.kDispose](); + if (!options.timeoutContext || options.timeoutContext.clearServerSelectionTimeout) { + timeout?.clear(); + } + } + } + /** + * Update the internal TopologyDescription with a ServerDescription + * + * @param serverDescription - The server to update in the internal list of server descriptions + */ + serverUpdateHandler(serverDescription) { + if (!this.s.description.hasServer(serverDescription.address)) { + return; + } + // ignore this server update if its from an outdated topologyVersion + if (isStaleServerDescription(this.s.description, serverDescription)) { + return; + } + // these will be used for monitoring events later + const previousTopologyDescription = this.s.description; + const previousServerDescription = this.s.description.servers.get(serverDescription.address); + if (!previousServerDescription) { + return; + } + // Driver Sessions Spec: "Whenever a driver receives a cluster time from + // a server it MUST compare it to the current highest seen cluster time + // for the deployment. If the new cluster time is higher than the + // highest seen cluster time it MUST become the new highest seen cluster + // time. Two cluster times are compared using only the BsonTimestamp + // value of the clusterTime embedded field." + const clusterTime = serverDescription.$clusterTime; + if (clusterTime) { + (0, common_1._advanceClusterTime)(this, clusterTime); + } + // If we already know all the information contained in this updated description, then + // we don't need to emit SDAM events, but still need to update the description, in order + // to keep client-tracked attributes like last update time and round trip time up to date + const equalDescriptions = previousServerDescription && previousServerDescription.equals(serverDescription); + // first update the TopologyDescription + this.s.description = this.s.description.update(serverDescription); + if (this.s.description.compatibilityError) { + this.emit(Topology.ERROR, new error_1.MongoCompatibilityError(this.s.description.compatibilityError)); + return; + } + // emit monitoring events for this change + if (!equalDescriptions) { + const newDescription = this.s.description.servers.get(serverDescription.address); + if (newDescription) { + this.emit(Topology.SERVER_DESCRIPTION_CHANGED, new events_1.ServerDescriptionChangedEvent(this.s.id, serverDescription.address, previousServerDescription, newDescription)); + } + } + // update server list from updated descriptions + updateServers(this, serverDescription); + // attempt to resolve any outstanding server selection attempts + if (this.waitQueue.length > 0) { + processWaitQueue(this); + } + if (!equalDescriptions) { + this.emitAndLog(Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, previousTopologyDescription, this.s.description)); + } + } + auth(credentials, callback) { + if (typeof credentials === 'function') + ((callback = credentials), (credentials = undefined)); + if (typeof callback === 'function') + callback(undefined, true); + } + isConnected() { + return this.s.state === common_1.STATE_CONNECTED; + } + isDestroyed() { + return this.s.state === common_1.STATE_CLOSED; + } + // NOTE: There are many places in code where we explicitly check the last hello + // to do feature support detection. This should be done any other way, but for + // now we will just return the first hello seen, which should suffice. + lastHello() { + const serverDescriptions = Array.from(this.description.servers.values()); + if (serverDescriptions.length === 0) + return {}; + const sd = serverDescriptions.filter((sd) => sd.type !== common_1.ServerType.Unknown)[0]; + const result = sd || { maxWireVersion: this.description.commonWireVersion }; + return result; + } + get commonWireVersion() { + return this.description.commonWireVersion; + } + get logicalSessionTimeoutMinutes() { + return this.description.logicalSessionTimeoutMinutes; + } + get clusterTime() { + return this.s.clusterTime; + } + set clusterTime(clusterTime) { + this.s.clusterTime = clusterTime; + } +} +exports.Topology = Topology; +/** Destroys a server, and removes all event listeners from the instance */ +function closeServer(server, topology) { + for (const event of constants_1.LOCAL_SERVER_EVENTS) { + server.removeAllListeners(event); + } + server.close(); + topology.emitAndLog(Topology.SERVER_CLOSED, new events_1.ServerClosedEvent(topology.s.id, server.description.address)); + for (const event of constants_1.SERVER_RELAY_EVENTS) { + server.removeAllListeners(event); + } +} +/** Predicts the TopologyType from options */ +function topologyTypeFromOptions(options) { + if (options?.directConnection) { + return common_1.TopologyType.Single; + } + if (options?.replicaSet) { + return common_1.TopologyType.ReplicaSetNoPrimary; + } + if (options?.loadBalanced) { + return common_1.TopologyType.LoadBalanced; + } + return common_1.TopologyType.Unknown; +} +/** + * Creates new server instances and attempts to connect them + * + * @param topology - The topology that this server belongs to + * @param serverDescription - The description for the server to initialize and connect to + */ +function createAndConnectServer(topology, serverDescription) { + topology.emitAndLog(Topology.SERVER_OPENING, new events_1.ServerOpeningEvent(topology.s.id, serverDescription.address)); + const server = new server_1.Server(topology, serverDescription, topology.s.options); + for (const event of constants_1.SERVER_RELAY_EVENTS) { + server.on(event, (e) => topology.emit(event, e)); + } + server.on(server_1.Server.DESCRIPTION_RECEIVED, description => topology.serverUpdateHandler(description)); + server.connect(); + return server; +} +/** + * @param topology - Topology to update. + * @param incomingServerDescription - New server description. + */ +function updateServers(topology, incomingServerDescription) { + // update the internal server's description + if (incomingServerDescription && topology.s.servers.has(incomingServerDescription.address)) { + const server = topology.s.servers.get(incomingServerDescription.address); + if (server) { + server.s.description = incomingServerDescription; + if (incomingServerDescription.error instanceof error_1.MongoError && + incomingServerDescription.error.hasErrorLabel(error_1.MongoErrorLabel.ResetPool)) { + const interruptInUseConnections = incomingServerDescription.error.hasErrorLabel(error_1.MongoErrorLabel.InterruptInUseConnections); + server.pool.clear({ interruptInUseConnections }); + } + else if (incomingServerDescription.error == null) { + const newTopologyType = topology.s.description.type; + const shouldMarkPoolReady = incomingServerDescription.isDataBearing || + (incomingServerDescription.type !== common_1.ServerType.Unknown && + newTopologyType === common_1.TopologyType.Single); + if (shouldMarkPoolReady) { + server.pool.ready(); + } + } + } + } + // add new servers for all descriptions we currently don't know about locally + for (const serverDescription of topology.description.servers.values()) { + if (!topology.s.servers.has(serverDescription.address)) { + const server = createAndConnectServer(topology, serverDescription); + topology.s.servers.set(serverDescription.address, server); + } + } + // for all servers no longer known, remove their descriptions and destroy their instances + for (const entry of topology.s.servers) { + const serverAddress = entry[0]; + if (topology.description.hasServer(serverAddress)) { + continue; + } + if (!topology.s.servers.has(serverAddress)) { + continue; + } + const server = topology.s.servers.get(serverAddress); + topology.s.servers.delete(serverAddress); + // prepare server for garbage collection + if (server) { + closeServer(server, topology); + } + } +} +function drainWaitQueue(queue, drainError) { + while (queue.length) { + const waitQueueMember = queue.shift(); + if (!waitQueueMember) { + continue; + } + if (!waitQueueMember.cancelled) { + if (waitQueueMember.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + waitQueueMember.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(waitQueueMember.serverSelector, waitQueueMember.topologyDescription, drainError, waitQueueMember.operationName)); + } + waitQueueMember.reject(drainError); + } + } +} +function processWaitQueue(topology) { + if (topology.s.state === common_1.STATE_CLOSED) { + drainWaitQueue(topology.waitQueue, new error_1.MongoTopologyClosedError()); + return; + } + const isSharded = topology.description.type === common_1.TopologyType.Sharded; + const serverDescriptions = Array.from(topology.description.servers.values()); + const membersToProcess = topology.waitQueue.length; + for (let i = 0; i < membersToProcess; ++i) { + const waitQueueMember = topology.waitQueue.shift(); + if (!waitQueueMember) { + continue; + } + if (waitQueueMember.cancelled) { + continue; + } + let selectedDescriptions; + try { + const serverSelector = waitQueueMember.serverSelector; + const deprioritizedServers = waitQueueMember.deprioritizedServers; + selectedDescriptions = serverSelector + ? serverSelector(topology.description, serverDescriptions, deprioritizedServers) + : serverDescriptions; + } + catch (selectorError) { + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + topology.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(waitQueueMember.serverSelector, topology.description, selectorError, waitQueueMember.operationName)); + } + waitQueueMember.reject(selectorError); + continue; + } + let selectedServer; + if (selectedDescriptions.length === 0) { + if (!waitQueueMember.waitingLogged) { + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.INFORMATIONAL)) { + topology.client.mongoLogger?.info(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.WaitingForSuitableServerEvent(waitQueueMember.serverSelector, topology.description, topology.s.serverSelectionTimeoutMS !== 0 + ? topology.s.serverSelectionTimeoutMS - + ((0, utils_1.processTimeMS)() - waitQueueMember.startTime) + : -1, waitQueueMember.operationName)); + } + waitQueueMember.waitingLogged = true; + } + topology.waitQueue.push(waitQueueMember); + continue; + } + else if (selectedDescriptions.length === 1) { + selectedServer = topology.s.servers.get(selectedDescriptions[0].address); + } + else { + const descriptions = (0, utils_1.shuffle)(selectedDescriptions, 2); + const server1 = topology.s.servers.get(descriptions[0].address); + const server2 = topology.s.servers.get(descriptions[1].address); + selectedServer = + server1 && server2 && server1.s.operationCount < server2.s.operationCount + ? server1 + : server2; + } + if (!selectedServer) { + const serverSelectionError = new error_1.MongoServerSelectionError('server selection returned a server description but the server was not found in the topology', topology.description); + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + topology.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(waitQueueMember.serverSelector, topology.description, serverSelectionError, waitQueueMember.operationName)); + } + waitQueueMember.reject(serverSelectionError); + return; + } + const transaction = waitQueueMember.transaction; + if (isSharded && transaction && transaction.isActive && selectedServer) { + transaction.pinServer(selectedServer); + } + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + topology.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionSucceededEvent(waitQueueMember.serverSelector, waitQueueMember.topologyDescription, selectedServer.pool.address, waitQueueMember.operationName)); + } + waitQueueMember.resolve(selectedServer); + } + if (topology.waitQueue.length > 0) { + // ensure all server monitors attempt monitoring soon + for (const [, server] of topology.s.servers) { + queueMicrotask(function scheduleServerCheck() { + return server.requestCheck(); + }); + } + } +} +function isStaleServerDescription(topologyDescription, incomingServerDescription) { + const currentServerDescription = topologyDescription.servers.get(incomingServerDescription.address); + const currentTopologyVersion = currentServerDescription?.topologyVersion; + return ((0, server_description_1.compareTopologyVersion)(currentTopologyVersion, incomingServerDescription.topologyVersion) > 0); +} +//# sourceMappingURL=topology.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js.map new file mode 100644 index 00000000..68053ceb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topology.js","sourceRoot":"","sources":["../../src/sdam/topology.ts"],"names":[],"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AA,2CAAsB,EAAC,sBAAsB,EAAE,yBAAyB,CAAC,eAAe,CAAC,GAAG,CAAC,CAC9F,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js new file mode 100644 index 00000000..287b4d77 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js @@ -0,0 +1,383 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TopologyDescription = void 0; +const bson_1 = require("../bson"); +const WIRE_CONSTANTS = require("../cmap/wire_protocol/constants"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const server_description_1 = require("./server_description"); +// constants related to compatibility checks +const MIN_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_SERVER_VERSION; +const MAX_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_SERVER_VERSION; +const MIN_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_WIRE_VERSION; +const MAX_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_WIRE_VERSION; +const MONGOS_OR_UNKNOWN = new Set([common_1.ServerType.Mongos, common_1.ServerType.Unknown]); +const MONGOS_OR_STANDALONE = new Set([common_1.ServerType.Mongos, common_1.ServerType.Standalone]); +const NON_PRIMARY_RS_MEMBERS = new Set([ + common_1.ServerType.RSSecondary, + common_1.ServerType.RSArbiter, + common_1.ServerType.RSOther +]); +/** + * Representation of a deployment of servers + * @public + */ +class TopologyDescription { + /** + * Create a TopologyDescription + */ + constructor(topologyType, serverDescriptions = null, setName = null, maxSetVersion = null, maxElectionId = null, commonWireVersion = null, options = null) { + options = options ?? {}; + this.type = topologyType ?? common_1.TopologyType.Unknown; + this.servers = serverDescriptions ?? new Map(); + this.stale = false; + this.compatible = true; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 0; + this.localThresholdMS = options.localThresholdMS ?? 15; + this.setName = setName ?? null; + this.maxElectionId = maxElectionId ?? null; + this.maxSetVersion = maxSetVersion ?? null; + this.commonWireVersion = commonWireVersion ?? 0; + // determine server compatibility + for (const serverDescription of this.servers.values()) { + // Load balancer mode is always compatible. + if (serverDescription.type === common_1.ServerType.Unknown || + serverDescription.type === common_1.ServerType.LoadBalancer) { + continue; + } + if (serverDescription.minWireVersion > MAX_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} requires wire version ${serverDescription.minWireVersion}, but this version of the driver only supports up to ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`; + } + if (serverDescription.maxWireVersion < MIN_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} reports wire version ${serverDescription.maxWireVersion}, but this version of the driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION}).`; + break; + } + } + // Whenever a client updates the TopologyDescription from a hello response, it MUST set + // TopologyDescription.logicalSessionTimeoutMinutes to the smallest logicalSessionTimeoutMinutes + // value among ServerDescriptions of all data-bearing server types. If any have a null + // logicalSessionTimeoutMinutes, then TopologyDescription.logicalSessionTimeoutMinutes MUST be + // set to null. + this.logicalSessionTimeoutMinutes = null; + for (const [, server] of this.servers) { + if (server.isReadable) { + if (server.logicalSessionTimeoutMinutes == null) { + // If any of the servers have a null logicalSessionsTimeout, then the whole topology does + this.logicalSessionTimeoutMinutes = null; + break; + } + if (this.logicalSessionTimeoutMinutes == null) { + // First server with a non null logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = server.logicalSessionTimeoutMinutes; + continue; + } + // Always select the smaller of the: + // current server logicalSessionsTimeout and the topologies logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = Math.min(this.logicalSessionTimeoutMinutes, server.logicalSessionTimeoutMinutes); + } + } + } + /** + * Returns a new TopologyDescription based on the SrvPollingEvent + * @internal + */ + updateFromSrvPollingEvent(ev, srvMaxHosts = 0) { + /** The SRV addresses defines the set of addresses we should be using */ + const incomingHostnames = ev.hostnames(); + const currentHostnames = new Set(this.servers.keys()); + const hostnamesToAdd = new Set(incomingHostnames); + const hostnamesToRemove = new Set(); + for (const hostname of currentHostnames) { + // filter hostnamesToAdd (made from incomingHostnames) down to what is *not* present in currentHostnames + hostnamesToAdd.delete(hostname); + if (!incomingHostnames.has(hostname)) { + // If the SRV Records no longer include this hostname + // we have to stop using it + hostnamesToRemove.add(hostname); + } + } + if (hostnamesToAdd.size === 0 && hostnamesToRemove.size === 0) { + // No new hosts to add and none to remove + return this; + } + const serverDescriptions = new Map(this.servers); + for (const removedHost of hostnamesToRemove) { + serverDescriptions.delete(removedHost); + } + if (hostnamesToAdd.size > 0) { + if (srvMaxHosts === 0) { + // Add all! + for (const hostToAdd of hostnamesToAdd) { + serverDescriptions.set(hostToAdd, new server_description_1.ServerDescription(hostToAdd)); + } + } + else if (serverDescriptions.size < srvMaxHosts) { + // Add only the amount needed to get us back to srvMaxHosts + const selectedHosts = (0, utils_1.shuffle)(hostnamesToAdd, srvMaxHosts - serverDescriptions.size); + for (const selectedHostToAdd of selectedHosts) { + serverDescriptions.set(selectedHostToAdd, new server_description_1.ServerDescription(selectedHostToAdd)); + } + } + } + return new TopologyDescription(this.type, serverDescriptions, this.setName, this.maxSetVersion, this.maxElectionId, this.commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + /** + * Returns a copy of this description updated with a given ServerDescription + * @internal + */ + update(serverDescription) { + const address = serverDescription.address; + // potentially mutated values + let { type: topologyType, setName, maxSetVersion, maxElectionId, commonWireVersion } = this; + const serverType = serverDescription.type; + const serverDescriptions = new Map(this.servers); + // update common wire version + if (serverDescription.maxWireVersion !== 0) { + if (commonWireVersion === 0) { + commonWireVersion = serverDescription.maxWireVersion; + } + else { + commonWireVersion = Math.min(commonWireVersion, serverDescription.maxWireVersion); + } + } + if (typeof serverDescription.setName === 'string' && + typeof setName === 'string' && + serverDescription.setName !== setName) { + if (topologyType === common_1.TopologyType.Single) { + // "Single" Topology with setName mismatch is direct connection usage, mark unknown do not remove + serverDescription = new server_description_1.ServerDescription(address); + } + else { + serverDescriptions.delete(address); + } + } + // update the actual server description + serverDescriptions.set(address, serverDescription); + if (topologyType === common_1.TopologyType.Single) { + // once we are defined as single, that never changes + return new TopologyDescription(common_1.TopologyType.Single, serverDescriptions, setName, maxSetVersion, maxElectionId, commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + if (topologyType === common_1.TopologyType.Unknown) { + if (serverType === common_1.ServerType.Standalone && this.servers.size !== 1) { + serverDescriptions.delete(address); + } + else { + topologyType = topologyTypeForServerType(serverType); + } + } + if (topologyType === common_1.TopologyType.Sharded) { + if (!MONGOS_OR_UNKNOWN.has(serverType)) { + serverDescriptions.delete(address); + } + } + if (topologyType === common_1.TopologyType.ReplicaSetNoPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + } + if (serverType === common_1.ServerType.RSPrimary) { + const result = updateRsFromPrimary(serverDescriptions, serverDescription, setName, maxSetVersion, maxElectionId); + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } + else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + const result = updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName); + topologyType = result[0]; + setName = result[1]; + } + } + if (topologyType === common_1.TopologyType.ReplicaSetWithPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + topologyType = checkHasPrimary(serverDescriptions); + } + else if (serverType === common_1.ServerType.RSPrimary) { + const result = updateRsFromPrimary(serverDescriptions, serverDescription, setName, maxSetVersion, maxElectionId); + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } + else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + topologyType = updateRsWithPrimaryFromMember(serverDescriptions, serverDescription, setName); + } + else { + topologyType = checkHasPrimary(serverDescriptions); + } + } + return new TopologyDescription(topologyType, serverDescriptions, setName, maxSetVersion, maxElectionId, commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + get error() { + const descriptionsWithError = Array.from(this.servers.values()).filter((sd) => sd.error); + if (descriptionsWithError.length > 0) { + return descriptionsWithError[0].error; + } + return null; + } + /** + * Determines if the topology description has any known servers + */ + get hasKnownServers() { + return Array.from(this.servers.values()).some((sd) => sd.type !== common_1.ServerType.Unknown); + } + /** + * Determines if this topology description has a data-bearing server available. + */ + get hasDataBearingServers() { + return Array.from(this.servers.values()).some((sd) => sd.isDataBearing); + } + /** + * Determines if the topology has a definition for the provided address + * @internal + */ + hasServer(address) { + return this.servers.has(address); + } + /** + * Returns a JSON-serializable representation of the TopologyDescription. This is primarily + * intended for use with JSON.stringify(). + * + * This method will not throw. + */ + toJSON() { + return bson_1.EJSON.serialize(this); + } +} +exports.TopologyDescription = TopologyDescription; +function topologyTypeForServerType(serverType) { + switch (serverType) { + case common_1.ServerType.Standalone: + return common_1.TopologyType.Single; + case common_1.ServerType.Mongos: + return common_1.TopologyType.Sharded; + case common_1.ServerType.RSPrimary: + return common_1.TopologyType.ReplicaSetWithPrimary; + case common_1.ServerType.RSOther: + case common_1.ServerType.RSSecondary: + return common_1.TopologyType.ReplicaSetNoPrimary; + default: + return common_1.TopologyType.Unknown; + } +} +function updateRsFromPrimary(serverDescriptions, serverDescription, setName = null, maxSetVersion = null, maxElectionId = null) { + const setVersionElectionIdMismatch = (serverDescription, maxSetVersion, maxElectionId) => { + return (`primary marked stale due to electionId/setVersion mismatch:` + + ` server setVersion: ${serverDescription.setVersion},` + + ` server electionId: ${serverDescription.electionId},` + + ` topology setVersion: ${maxSetVersion},` + + ` topology electionId: ${maxElectionId}`); + }; + setName = setName || serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + if (serverDescription.maxWireVersion >= 17) { + const electionIdComparison = (0, utils_1.compareObjectId)(maxElectionId, serverDescription.electionId); + const maxElectionIdIsEqual = electionIdComparison === 0; + const maxElectionIdIsLess = electionIdComparison === -1; + const maxSetVersionIsLessOrEqual = (maxSetVersion ?? -1) <= (serverDescription.setVersion ?? -1); + if (maxElectionIdIsLess || (maxElectionIdIsEqual && maxSetVersionIsLessOrEqual)) { + // The reported electionId was greater + // or the electionId was equal and reported setVersion was greater + // Always update both values, they are a tuple + maxElectionId = serverDescription.electionId; + maxSetVersion = serverDescription.setVersion; + } + else { + // Stale primary + // replace serverDescription with a default ServerDescription of type "Unknown" + serverDescriptions.set(serverDescription.address, new server_description_1.ServerDescription(serverDescription.address, undefined, { + error: new error_1.MongoStalePrimaryError(setVersionElectionIdMismatch(serverDescription, maxSetVersion, maxElectionId)) + })); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } + else { + const electionId = serverDescription.electionId ? serverDescription.electionId : null; + if (serverDescription.setVersion && electionId) { + if (maxSetVersion && maxElectionId) { + if (maxSetVersion > serverDescription.setVersion || + (0, utils_1.compareObjectId)(maxElectionId, electionId) > 0) { + // this primary is stale, we must remove it + serverDescriptions.set(serverDescription.address, new server_description_1.ServerDescription(serverDescription.address, undefined, { + error: new error_1.MongoStalePrimaryError(setVersionElectionIdMismatch(serverDescription, maxSetVersion, maxElectionId)) + })); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } + maxElectionId = serverDescription.electionId; + } + if (serverDescription.setVersion != null && + (maxSetVersion == null || serverDescription.setVersion > maxSetVersion)) { + maxSetVersion = serverDescription.setVersion; + } + } + // We've heard from the primary. Is it the same primary as before? + for (const [address, server] of serverDescriptions) { + if (server.type === common_1.ServerType.RSPrimary && server.address !== serverDescription.address) { + // Reset old primary's type to Unknown. + serverDescriptions.set(address, new server_description_1.ServerDescription(server.address, undefined, { + error: new error_1.MongoStalePrimaryError('primary marked stale due to discovery of newer primary') + })); + // There can only be one primary + break; + } + } + // Discover new hosts from this primary's response. + serverDescription.allHosts.forEach((address) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new server_description_1.ServerDescription(address)); + } + }); + // Remove hosts not in the response. + const currentAddresses = Array.from(serverDescriptions.keys()); + const responseAddresses = serverDescription.allHosts; + currentAddresses + .filter((addr) => responseAddresses.indexOf(addr) === -1) + .forEach((address) => { + serverDescriptions.delete(address); + }); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; +} +function updateRsWithPrimaryFromMember(serverDescriptions, serverDescription, setName = null) { + if (setName == null) { + // TODO(NODE-3483): should be an appropriate runtime error + throw new error_1.MongoRuntimeError('Argument "setName" is required if connected to a replica set'); + } + if (setName !== serverDescription.setName || + (serverDescription.me && serverDescription.address !== serverDescription.me)) { + serverDescriptions.delete(serverDescription.address); + } + return checkHasPrimary(serverDescriptions); +} +function updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName = null) { + const topologyType = common_1.TopologyType.ReplicaSetNoPrimary; + setName = setName ?? serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [topologyType, setName]; + } + serverDescription.allHosts.forEach((address) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new server_description_1.ServerDescription(address)); + } + }); + if (serverDescription.me && serverDescription.address !== serverDescription.me) { + serverDescriptions.delete(serverDescription.address); + } + return [topologyType, setName]; +} +function checkHasPrimary(serverDescriptions) { + for (const serverDescription of serverDescriptions.values()) { + if (serverDescription.type === common_1.ServerType.RSPrimary) { + return common_1.TopologyType.ReplicaSetWithPrimary; + } + } + return common_1.TopologyType.ReplicaSetNoPrimary; +} +//# sourceMappingURL=topology_description.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js.map new file mode 100644 index 00000000..e6c189f3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sdam/topology_description.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topology_description.js","sourceRoot":"","sources":["../../src/sdam/topology_description.ts"],"names":[],"mappings":";;;AAAA,kCAA+C;AAC/C,kEAAkE;AAClE,oCAAsF;AACtF,oCAAoD;AACpD,qCAAoD;AACpD,6DAAyD;AAGzD,4CAA4C;AAC5C,MAAM,4BAA4B,GAAG,cAAc,CAAC,4BAA4B,CAAC;AACjF,MAAM,4BAA4B,GAAG,cAAc,CAAC,4BAA4B,CAAC;AACjF,MAAM,0BAA0B,GAAG,cAAc,CAAC,0BAA0B,CAAC;AAC7E,MAAM,0BAA0B,GAAG,cAAc,CAAC,0BAA0B,CAAC;AAE7E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAa,CAAC,mBAAU,CAAC,MAAM,EAAE,mBAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AACvF,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAa,CAAC,mBAAU,CAAC,MAAM,EAAE,mBAAU,CAAC,UAAU,CAAC,CAAC,CAAC;AAC7F,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAa;IACjD,mBAAU,CAAC,WAAW;IACtB,mBAAU,CAAC,SAAS;IACpB,mBAAU,CAAC,OAAO;CACnB,CAAC,CAAC;AAQH;;;GAGG;AACH,MAAa,mBAAmB;IAa9B;;OAEG;IACH,YACE,YAA0B,EAC1B,qBAA4D,IAAI,EAChE,UAAyB,IAAI,EAC7B,gBAA+B,IAAI,EACnC,gBAAiC,IAAI,EACrC,oBAAmC,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 No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js new file mode 100644 index 00000000..474b3879 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js @@ -0,0 +1,936 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServerSessionPool = exports.ServerSession = exports.ClientSession = void 0; +exports.maybeClearPinnedConnection = maybeClearPinnedConnection; +exports.applySession = applySession; +exports.updateSessionFromResponse = updateSessionFromResponse; +const promises_1 = require("timers/promises"); +const bson_1 = require("./bson"); +const metrics_1 = require("./cmap/metrics"); +const constants_1 = require("./constants"); +const error_1 = require("./error"); +const mongo_types_1 = require("./mongo_types"); +const execute_operation_1 = require("./operations/execute_operation"); +const run_command_1 = require("./operations/run_command"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const common_1 = require("./sdam/common"); +const timeout_1 = require("./timeout"); +const transactions_1 = require("./transactions"); +const utils_1 = require("./utils"); +const write_concern_1 = require("./write_concern"); +/** + * A class representing a client session on the server + * + * NOTE: not meant to be instantiated directly. + * @public + */ +class ClientSession extends mongo_types_1.TypedEventEmitter { + /** + * Create a client session. + * @internal + * @param client - The current client + * @param sessionPool - The server session pool (Internal Class) + * @param options - Optional settings + * @param clientOptions - Optional settings provided when creating a MongoClient + */ + constructor(client, sessionPool, options, clientOptions) { + super(); + /** @internal */ + this.timeoutContext = null; + this.on('error', utils_1.noop); + if (client == null) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError('ClientSession requires a MongoClient'); + } + if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError('ClientSession requires a ServerSessionPool'); + } + options = options ?? {}; + this.snapshotEnabled = options.snapshot === true; + if (options.causalConsistency === true && this.snapshotEnabled) { + throw new error_1.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive'); + } + this.client = client; + this.sessionPool = sessionPool; + this.hasEnded = false; + this.clientOptions = clientOptions; + this.timeoutMS = options.defaultTimeoutMS ?? client.s.options?.timeoutMS; + this.explicit = !!options.explicit; + this._serverSession = this.explicit ? this.sessionPool.acquire() : null; + this.txnNumberIncrement = 0; + const defaultCausalConsistencyValue = this.explicit && options.snapshot !== true; + this.supports = { + // if we can enable causal consistency, do so by default + causalConsistency: options.causalConsistency ?? defaultCausalConsistencyValue + }; + this.clusterTime = options.initialClusterTime; + this.operationTime = undefined; + this.owner = options.owner; + this.defaultTransactionOptions = { ...options.defaultTransactionOptions }; + this.transaction = new transactions_1.Transaction(); + } + /** The server id associated with this session */ + get id() { + return this.serverSession?.id; + } + get serverSession() { + let serverSession = this._serverSession; + if (serverSession == null) { + if (this.explicit) { + throw new error_1.MongoRuntimeError('Unexpected null serverSession for an explicit session'); + } + if (this.hasEnded) { + throw new error_1.MongoRuntimeError('Unexpected null serverSession for an ended implicit session'); + } + serverSession = this.sessionPool.acquire(); + this._serverSession = serverSession; + } + return serverSession; + } + get loadBalanced() { + return this.client.topology?.description.type === common_1.TopologyType.LoadBalanced; + } + /** @internal */ + pin(conn) { + if (this.pinnedConnection) { + throw TypeError('Cannot pin multiple connections to the same session'); + } + this.pinnedConnection = conn; + conn.emit(constants_1.PINNED, this.inTransaction() ? metrics_1.ConnectionPoolMetrics.TXN : metrics_1.ConnectionPoolMetrics.CURSOR); + } + /** @internal */ + unpin(options) { + if (this.loadBalanced) { + return maybeClearPinnedConnection(this, options); + } + this.transaction.unpinServer(); + } + get isPinned() { + return this.loadBalanced ? !!this.pinnedConnection : this.transaction.isPinned; + } + /** + * Frees any client-side resources held by the current session. If a session is in a transaction, + * the transaction is aborted. + * + * Does not end the session on the server. + * + * @param options - Optional settings. Currently reserved for future use + */ + async endSession(options) { + try { + if (this.inTransaction()) { + await this.abortTransaction({ ...options, throwTimeout: true }); + } + } + catch (error) { + // spec indicates that we should ignore all errors for `endSessions` + if (error.name === 'MongoOperationTimeoutError') + throw error; + (0, utils_1.squashError)(error); + } + finally { + if (!this.hasEnded) { + const serverSession = this.serverSession; + if (serverSession != null) { + // release the server session back to the pool + this.sessionPool.release(serverSession); + // Store a clone of the server session for reference (debugging) + this._serverSession = new ServerSession(serverSession); + } + // mark the session as ended, and emit a signal + this.hasEnded = true; + this.emit('ended', this); + } + maybeClearPinnedConnection(this, { force: true, ...options }); + } + } + /** + * An alias for {@link ClientSession.endSession|ClientSession.endSession()}. + */ + async [Symbol.asyncDispose]() { + await this.endSession({ force: true }); + } + /** + * Advances the operationTime for a ClientSession. + * + * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to + */ + advanceOperationTime(operationTime) { + if (this.operationTime == null) { + this.operationTime = operationTime; + return; + } + if (operationTime.greaterThan(this.operationTime)) { + this.operationTime = operationTime; + } + } + /** + * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession + * + * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature + */ + advanceClusterTime(clusterTime) { + if (!clusterTime || typeof clusterTime !== 'object') { + throw new error_1.MongoInvalidArgumentError('input cluster time must be an object'); + } + if (!clusterTime.clusterTime || clusterTime.clusterTime._bsontype !== 'Timestamp') { + throw new error_1.MongoInvalidArgumentError('input cluster time "clusterTime" property must be a valid BSON Timestamp'); + } + if (!clusterTime.signature || + clusterTime.signature.hash?._bsontype !== 'Binary' || + (typeof clusterTime.signature.keyId !== 'bigint' && + typeof clusterTime.signature.keyId !== 'number' && + clusterTime.signature.keyId?._bsontype !== 'Long') // apparently we decode the key to number? + ) { + throw new error_1.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId'); + } + (0, common_1._advanceClusterTime)(this, clusterTime); + } + /** + * Used to determine if this session equals another + * + * @param session - The session to compare to + */ + equals(session) { + if (!(session instanceof ClientSession)) { + return false; + } + if (this.id == null || session.id == null) { + return false; + } + return bson_1.ByteUtils.equals(this.id.id.buffer, session.id.id.buffer); + } + /** + * Increment the transaction number on the internal ServerSession + * + * @privateRemarks + * This helper increments a value stored on the client session that will be + * added to the serverSession's txnNumber upon applying it to a command. + * This is because the serverSession is lazily acquired after a connection is obtained + */ + incrementTransactionNumber() { + this.txnNumberIncrement += 1; + } + /** @returns whether this session is currently in a transaction or not */ + inTransaction() { + return this.transaction.isActive; + } + /** + * Starts a new transaction with the given options. + * + * @remarks + * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * @param options - Options for the transaction + */ + startTransaction(options) { + if (this.snapshotEnabled) { + throw new error_1.MongoCompatibilityError('Transactions are not supported in snapshot sessions'); + } + if (this.inTransaction()) { + throw new error_1.MongoTransactionError('Transaction already in progress'); + } + if (this.isPinned && this.transaction.isCommitted) { + this.unpin(); + } + this.commitAttempted = false; + // increment txnNumber + this.incrementTransactionNumber(); + // create transaction state + this.transaction = new transactions_1.Transaction({ + readConcern: options?.readConcern ?? + this.defaultTransactionOptions.readConcern ?? + this.clientOptions?.readConcern, + writeConcern: options?.writeConcern ?? + this.defaultTransactionOptions.writeConcern ?? + this.clientOptions?.writeConcern, + readPreference: options?.readPreference ?? + this.defaultTransactionOptions.readPreference ?? + this.clientOptions?.readPreference, + maxCommitTimeMS: options?.maxCommitTimeMS ?? this.defaultTransactionOptions.maxCommitTimeMS + }); + this.transaction.transition(transactions_1.TxnState.STARTING_TRANSACTION); + } + /** + * Commits the currently active transaction in this session. + * + * @param options - Optional options, can be used to override `defaultTimeoutMS`. + */ + async commitTransaction(options) { + if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) { + throw new error_1.MongoTransactionError('No transaction started'); + } + if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION || + this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) { + // the transaction was never started, we can safely exit here + this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY); + return; + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) { + throw new error_1.MongoTransactionError('Cannot call commitTransaction after calling abortTransaction'); + } + const command = { commitTransaction: 1 }; + const timeoutMS = typeof options?.timeoutMS === 'number' + ? options.timeoutMS + : typeof this.timeoutMS === 'number' + ? this.timeoutMS + : null; + const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern; + if (wc != null) { + if (timeoutMS == null && this.timeoutContext == null) { + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, w: 'majority', ...wc }); + } + else { + const wcKeys = Object.keys(wc); + if (wcKeys.length > 2 || (!wcKeys.includes('wtimeoutMS') && !wcKeys.includes('wTimeoutMS'))) + // if the write concern was specified with wTimeoutMS, then we set both wtimeoutMS + // and wTimeoutMS, guaranteeing at least two keys, so if we have more than two keys, + // then we can automatically assume that we should add the write concern to the command. + // If it has 2 or fewer keys, we need to check that those keys aren't the wtimeoutMS + // or wTimeoutMS options before we add the write concern to the command + write_concern_1.WriteConcern.apply(command, { ...wc, wtimeoutMS: undefined }); + } + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.commitAttempted) { + if (timeoutMS == null && this.timeoutContext == null) { + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, ...wc, w: 'majority' }); + } + else { + write_concern_1.WriteConcern.apply(command, { w: 'majority', ...wc, wtimeoutMS: undefined }); + } + } + if (typeof this.transaction.options.maxTimeMS === 'number') { + command.maxTimeMS = this.transaction.options.maxTimeMS; + } + if (this.transaction.recoveryToken) { + command.recoveryToken = this.transaction.recoveryToken; + } + const operation = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace('admin'), command, { + session: this, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }); + operation.maxAttempts = this.clientOptions.maxAdaptiveRetries + 1; + const timeoutContext = this.timeoutContext ?? + (typeof timeoutMS === 'number' + ? timeout_1.TimeoutContext.create({ + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS, + timeoutMS + }) + : null); + try { + await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext); + this.commitAttempted = undefined; + return; + } + catch (firstCommitError) { + this.commitAttempted = true; + const remainingAttempts = this.clientOptions.maxAdaptiveRetries + 1 - operation.attemptsMade; + if (remainingAttempts <= 0) { + throw firstCommitError; + } + if (firstCommitError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstCommitError)) { + // SPEC-1185: apply majority write concern when retrying commitTransaction + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, ...wc, w: 'majority' }); + // per txns spec, must unpin session in this case + this.unpin({ force: true }); + try { + const op = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace('admin'), command, { + session: this, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }); + op.maxAttempts = remainingAttempts; + await (0, execute_operation_1.executeOperation)(this.client, op, timeoutContext); + return; + } + catch (retryCommitError) { + // If the retry failed, we process that error instead of the original + if (shouldAddUnknownTransactionCommitResultLabel(retryCommitError)) { + retryCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult); + } + if (shouldUnpinAfterCommitError(retryCommitError)) { + this.unpin({ error: retryCommitError }); + } + throw retryCommitError; + } + } + if (shouldAddUnknownTransactionCommitResultLabel(firstCommitError)) { + firstCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult); + } + if (shouldUnpinAfterCommitError(firstCommitError)) { + this.unpin({ error: firstCommitError }); + } + throw firstCommitError; + } + finally { + this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED); + } + } + async abortTransaction(options) { + if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) { + throw new error_1.MongoTransactionError('No transaction started'); + } + if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) { + // the transaction was never started, we can safely exit here + this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED); + return; + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) { + throw new error_1.MongoTransactionError('Cannot call abortTransaction twice'); + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || + this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) { + throw new error_1.MongoTransactionError('Cannot call abortTransaction after calling commitTransaction'); + } + const command = { abortTransaction: 1 }; + const timeoutMS = typeof options?.timeoutMS === 'number' + ? options.timeoutMS + : this.timeoutContext?.csotEnabled() + ? this.timeoutContext.timeoutMS // refresh timeoutMS for abort operation + : typeof this.timeoutMS === 'number' + ? this.timeoutMS + : null; + const timeoutContext = timeoutMS != null + ? timeout_1.TimeoutContext.create({ + timeoutMS, + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS + }) + : null; + const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern; + if (wc != null && timeoutMS == null) { + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, w: 'majority', ...wc }); + } + if (this.transaction.recoveryToken) { + command.recoveryToken = this.transaction.recoveryToken; + } + const operation = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace('admin'), command, { + session: this, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }); + try { + await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext); + this.unpin(); + return; + } + catch (firstAbortError) { + this.unpin(); + if (firstAbortError.name === 'MongoRuntimeError') + throw firstAbortError; + if (options?.throwTimeout && firstAbortError.name === 'MongoOperationTimeoutError') { + throw firstAbortError; + } + if (firstAbortError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstAbortError)) { + try { + await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext); + return; + } + catch (secondAbortError) { + if (secondAbortError.name === 'MongoRuntimeError') + throw secondAbortError; + if (options?.throwTimeout && secondAbortError.name === 'MongoOperationTimeoutError') { + throw secondAbortError; + } + // we do not retry the retry + } + } + // The spec indicates that if the operation times out or fails with a non-retryable error, we should ignore all errors on `abortTransaction` + } + finally { + this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED); + if (this.loadBalanced) { + maybeClearPinnedConnection(this, { force: false }); + } + } + } + /** + * This is here to ensure that ClientSession is never serialized to BSON. + */ + toBSON() { + throw new error_1.MongoRuntimeError('ClientSession cannot be serialized to BSON.'); + } + /** + * Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed. + * + * **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise. + * + * **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * **IMPORTANT:** When running an operation inside a `withTransaction` callback, if it is not + * provided the explicit session in its options, it will not be part of the transaction and it will not respect timeoutMS. + * + * + * @remarks + * - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function. + * - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error. + * - If the transaction is manually aborted within the provided function it will not throw. + * - If the driver needs to attempt to retry the operations, the provided function may be called multiple times. + * + * Checkout a descriptive example here: + * @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions + * + * If a command inside withTransaction fails: + * - It may cause the transaction on the server to be aborted. + * - This situation is normally handled transparently by the driver. + * - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not. + * - The driver will then retry the transaction indefinitely. + * + * To avoid this situation, the application must not silently handle errors within the provided function. + * If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction. + * + * @param fn - callback to run within a transaction + * @param options - optional settings for the transaction + * @returns A raw command response or undefined + */ + async withTransaction(fn, options) { + const MAX_TIMEOUT = 120_000; + const timeoutMS = options?.timeoutMS ?? this.timeoutMS ?? null; + this.timeoutContext = + timeoutMS != null + ? timeout_1.TimeoutContext.create({ + timeoutMS, + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS + }) + : null; + // 1. Define the following: + // 1.1 Record the current monotonic time, which will be used to enforce the 120-second / CSOT timeout before later retry attempts. + // 1.2 Set `transactionAttempt` to `0`. + // 1.3 Set `TIMEOUT_MS` to be `timeoutMS` if given, otherwise MAX_TIMEOUT (120-seconds). + // Timeout Error propagation + // When the previously encountered error needs to be propagated because there is no more time for another attempt, + // and it is not already a timeout error, then: + // - A timeout error MUST be propagated instead. It MUST expose the previously encountered error as specified in + // the "Errors" section of the CSOT specification. + // - If exposing the previously encountered error from a timeout error is impossible in a driver, then the driver + // is exempt from the requirement and MUST propagate the previously encountered error as is. The timeout error + // MUST copy all error labels from the previously encountered error. + // The spec describes timeout checks as "elapsed time < TIMEOUT_MS" (where elapsed = now - start). + // We precompute `deadline = now + remainingTimeMS` so each check becomes simply `now < deadline`. + const csotEnabled = !!this.timeoutContext?.csotEnabled(); + const remainingTimeMS = this.timeoutContext?.csotEnabled() + ? this.timeoutContext.remainingTimeMS + : MAX_TIMEOUT; + const deadline = (0, utils_1.processTimeMS)() + remainingTimeMS; + let committed = false; + let result; + let lastError = null; + try { + retryTransaction: for (let transactionAttempt = 0, isRetry = false; !committed; ++transactionAttempt, isRetry = transactionAttempt > 0) { + // 2. If `transactionAttempt` > 0: + if (isRetry) { + // 2.1 Calculate backoffMS to be jitter * min(BACKOFF_INITIAL * 1.5 ** (transactionAttempt), BACKOFF_MAX). + // If elapsed time + backoffMS > TIMEOUT_MS, then propagate the previously encountered error to the caller of + // withTransaction as per timeout error propagation and return immediately. Otherwise, sleep for backoffMS. + // 2.1.1 jitter is a random float between [0, 1), optionally including 1, depending on what is most natural + // for the given driver language. + // 2.1.2 transactionAttempt is the variable defined in step 1. + // 2.1.3 BACKOFF_INITIAL is 5ms + // 2.1.4 BACKOFF_MAX is 500ms + const BACKOFF_INITIAL_MS = 5; + const BACKOFF_MAX_MS = 500; + const BACKOFF_GROWTH = 1.5; + const jitter = Math.random(); + const backoffMS = jitter * + Math.min(BACKOFF_INITIAL_MS * BACKOFF_GROWTH ** transactionAttempt, BACKOFF_MAX_MS); + if ((0, utils_1.processTimeMS)() + backoffMS >= deadline) { + throw makeTimeoutError(lastError ?? + new error_1.MongoRuntimeError(`Transaction retry did not record an error: should never occur. Please file a bug.`), csotEnabled); + } + await (0, promises_1.setTimeout)(backoffMS); + } + // 3. Invoke startTransaction on the session and increment transactionAttempt. If TransactionOptions were + // specified in the call to withTransaction, those MUST be used for startTransaction. Note that + // ClientSession.defaultTransactionOptions will be used in the absence of any explicit TransactionOptions. + // 4. If startTransaction reported an error, propagate that error to the caller of withTransaction as is and + // return immediately. + this.startTransaction(options); + try { + // 5. Invoke the callback. Drivers MUST ensure that the ClientSession can be accessed within the callback + // (e.g. pass ClientSession as the first parameter, rely on lexical scoping). Drivers MAY pass additional + // parameters as needed (e.g. user data solicited by withTransaction). + const promise = fn(this); + if (!(0, utils_1.isPromiseLike)(promise)) { + throw new error_1.MongoInvalidArgumentError('Function provided to `withTransaction` must return a Promise'); + } + // 6. Control returns to withTransaction. Determine the current state of the ClientSession and whether the + // callback reported an error (e.g. thrown exception, error output parameter). + result = await promise; + // 8. If the ClientSession is in the "no transaction", "transaction aborted", or "transaction committed" + // state, assume the callback intentionally aborted or committed the transaction and return immediately. + if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION || + this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || + this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) { + return result; + } + } + catch (fnError) { + // 7. If the callback reported an error + if (!(fnError instanceof error_1.MongoError) || fnError instanceof error_1.MongoInvalidArgumentError) { + // This first preemptive abort regardless of TxnState isn't spec, + // and it's unclear whether it's serving a practical purpose, but this logic is OLD + await this.abortTransaction(); + throw fnError; + } + lastError = fnError; + // 7.1 If the ClientSession is in the "starting transaction" or "transaction in progress" + // state, invoke abortTransaction on the session. + if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION || + this.transaction.state === transactions_1.TxnState.TRANSACTION_IN_PROGRESS) { + await this.abortTransaction(); + } + // 7.2 If the callback's error includes a "TransientTransactionError" label, jump back to step two. + if (fnError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + if ((0, utils_1.processTimeMS)() >= deadline) { + throw makeTimeoutError(lastError, csotEnabled); + } + continue retryTransaction; + } + // 7.3 If the callback's error includes a "UnknownTransactionCommitResult" label, the callback must + // have manually committed a transaction, propagate the callback's error to the caller of withTransaction + // as is and return immediately. + // 7.4 Otherwise, propagate the callback's error to the caller of withTransaction as is and return immediately. + throw fnError; + } + retryCommit: while (!committed) { + try { + // 9. Invoke commitTransaction on the session. + await this.commitTransaction(); + committed = true; + } + catch (commitError) { + // 10. If commitTransaction reported an error: + lastError = commitError; + // 10.1 If the commitTransaction error includes a UnknownTransactionCommitResult label and the error is + // not MaxTimeMSExpired + if (commitError.hasErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult) && + !isMaxTimeMSExpiredError(commitError)) { + // 10.1.1 If the elapsed time of withTransaction exceeded TIMEOUT_MS, propagate the commitTransaction + // error to the caller of withTransaction as per timeout error propagation and return immediately. + if ((0, utils_1.processTimeMS)() >= deadline) { + throw makeTimeoutError(commitError, csotEnabled); + } + // 10.1.2 Otherwise, jump back to step nine. We will trust commitTransaction to apply a majority write + // concern on retry attempts (see: Majority write concern is used when retrying commitTransaction). + continue retryCommit; + } + // 10.2 If the commitTransaction error includes a TransientTransactionError label, jump back to step two. + if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + continue retryTransaction; + } + // 10.3 Otherwise, propagate the commitTransaction error to the caller of withTransaction as is and return + // immediately. + throw commitError; + } + } + } + // 11. The transaction was committed successfully. Return immediately. + // @ts-expect-error Result is always defined if we reach here, the for-loop above convinces TS it is not. + return result; + } + finally { + this.timeoutContext = null; + } + } +} +exports.ClientSession = ClientSession; +function makeTimeoutError(cause, csotEnabled) { + // Async APIs know how to cancel themselves and might return CSOT error + if (cause instanceof error_1.MongoOperationTimeoutError) { + return cause; + } + if (csotEnabled) { + const timeoutError = new error_1.MongoOperationTimeoutError('Timed out during withTransaction', { + cause + }); + if (cause instanceof error_1.MongoError) { + for (const label of cause.errorLabels) { + timeoutError.addErrorLabel(label); + } + } + return timeoutError; + } + return cause; +} +const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([ + 'CannotSatisfyWriteConcern', + 'UnknownReplWriteConcern', + 'UnsatisfiableWriteConcern' +]); +function shouldUnpinAfterCommitError(commitError) { + if (commitError instanceof error_1.MongoError) { + if ((0, error_1.isRetryableWriteError)(commitError) || + commitError instanceof error_1.MongoWriteConcernError || + isMaxTimeMSExpiredError(commitError)) { + if (isUnknownTransactionCommitResult(commitError)) { + // per txns spec, must unpin session in this case + return true; + } + } + else if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + return true; + } + } + return false; +} +function shouldAddUnknownTransactionCommitResultLabel(commitError) { + let ok = (0, error_1.isRetryableWriteError)(commitError); + ok ||= commitError instanceof error_1.MongoWriteConcernError; + ok ||= isMaxTimeMSExpiredError(commitError); + ok &&= isUnknownTransactionCommitResult(commitError); + return ok; +} +function isUnknownTransactionCommitResult(err) { + const isNonDeterministicWriteConcernError = err instanceof error_1.MongoServerError && + err.codeName && + NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName); + return (isMaxTimeMSExpiredError(err) || + (!isNonDeterministicWriteConcernError && + err.code !== error_1.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern && + err.code !== error_1.MONGODB_ERROR_CODES.UnknownReplWriteConcern)); +} +function maybeClearPinnedConnection(session, options) { + // unpin a connection if it has been pinned + const conn = session.pinnedConnection; + const error = options?.error; + if (session.inTransaction() && + error && + error instanceof error_1.MongoError && + error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + return; + } + const topology = session.client.topology; + // NOTE: the spec talks about what to do on a network error only, but the tests seem to + // to validate that we don't unpin on _all_ errors? + if (conn && topology != null) { + const servers = Array.from(topology.s.servers.values()); + const loadBalancer = servers[0]; + if (options?.error == null || options?.force) { + loadBalancer.pool.checkIn(conn); + session.pinnedConnection = undefined; + conn.emit(constants_1.UNPINNED, session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION + ? metrics_1.ConnectionPoolMetrics.TXN + : metrics_1.ConnectionPoolMetrics.CURSOR); + if (options?.forceClear) { + loadBalancer.pool.clear({ serviceId: conn.serviceId }); + } + } + } +} +function isMaxTimeMSExpiredError(err) { + if (err == null || !(err instanceof error_1.MongoServerError)) { + return false; + } + return (err.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired || + err.writeConcernError?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired); +} +/** + * Reflects the existence of a session on the server. Can be reused by the session pool. + * WARNING: not meant to be instantiated directly. For internal use only. + * @public + */ +class ServerSession { + /** @internal */ + constructor(cloned) { + if (cloned != null) { + const idBytes = bson_1.ByteUtils.allocateUnsafe(16); + idBytes.set(cloned.id.id.buffer); + this.id = { id: new bson_1.Binary(idBytes, cloned.id.id.sub_type) }; + this.lastUse = cloned.lastUse; + this.txnNumber = cloned.txnNumber; + this.isDirty = cloned.isDirty; + return; + } + this.id = { id: new bson_1.Binary((0, utils_1.uuidV4)(), bson_1.Binary.SUBTYPE_UUID) }; + this.lastUse = (0, utils_1.processTimeMS)(); + this.txnNumber = 0; + this.isDirty = false; + } + /** + * Determines if the server session has timed out. + * + * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes" + */ + hasTimedOut(sessionTimeoutMinutes) { + // Take the difference of the lastUse timestamp and now, which will result in a value in + // milliseconds, and then convert milliseconds to minutes to compare to `sessionTimeoutMinutes` + const idleTimeMinutes = Math.round((((0, utils_1.calculateDurationInMs)(this.lastUse) % 86400000) % 3600000) / 60000); + return idleTimeMinutes > sessionTimeoutMinutes - 1; + } +} +exports.ServerSession = ServerSession; +/** + * Maintains a pool of Server Sessions. + * For internal use only + * @internal + */ +class ServerSessionPool { + constructor(client) { + if (client == null) { + throw new error_1.MongoRuntimeError('ServerSessionPool requires a MongoClient'); + } + this.client = client; + this.sessions = new utils_1.List(); + } + /** + * Acquire a Server Session from the pool. + * Iterates through each session in the pool, removing any stale sessions + * along the way. The first non-stale session found is removed from the + * pool and returned. If no non-stale session is found, a new ServerSession is created. + */ + acquire() { + const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10; + let session = null; + // Try to obtain from session pool + while (this.sessions.length > 0) { + const potentialSession = this.sessions.shift(); + if (potentialSession != null && + (!!this.client.topology?.loadBalanced || + !potentialSession.hasTimedOut(sessionTimeoutMinutes))) { + session = potentialSession; + break; + } + } + // If nothing valid came from the pool make a new one + if (session == null) { + session = new ServerSession(); + } + return session; + } + /** + * Release a session to the session pool + * Adds the session back to the session pool if the session has not timed out yet. + * This method also removes any stale sessions from the pool. + * + * @param session - The session to release to the pool + */ + release(session) { + const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10; + if (this.client.topology?.loadBalanced && !sessionTimeoutMinutes) { + this.sessions.unshift(session); + } + if (!sessionTimeoutMinutes) { + return; + } + this.sessions.prune(session => session.hasTimedOut(sessionTimeoutMinutes)); + if (!session.hasTimedOut(sessionTimeoutMinutes)) { + if (session.isDirty) { + return; + } + // otherwise, readd this session to the session pool + this.sessions.unshift(session); + } + } +} +exports.ServerSessionPool = ServerSessionPool; +/** + * Optionally decorate a command with sessions specific keys + * + * @param session - the session tracking transaction state + * @param command - the command to decorate + * @param options - Optional settings passed to calling operation + * + * @internal + */ +function applySession(session, command, options) { + if (session.hasEnded) { + return new error_1.MongoExpiredSessionError(); + } + // May acquire serverSession here + const serverSession = session.serverSession; + if (serverSession == null) { + return new error_1.MongoRuntimeError('Unable to acquire server session'); + } + if (options.writeConcern?.w === 0) { + if (session && session.explicit) { + // Error if user provided an explicit session to an unacknowledged write (SPEC-1019) + return new error_1.MongoAPIError('Cannot have explicit session with unacknowledged writes'); + } + return; + } + // mark the last use of this session, and apply the `lsid` + serverSession.lastUse = (0, utils_1.processTimeMS)(); + command.lsid = serverSession.id; + const inTxnOrTxnCommand = session.inTransaction() || (0, transactions_1.isTransactionCommand)(command); + const isRetryableWrite = !!options.willRetryWrite; + if (isRetryableWrite || inTxnOrTxnCommand) { + serverSession.txnNumber += session.txnNumberIncrement; + session.txnNumberIncrement = 0; + // TODO(NODE-2674): Preserve int64 sent from MongoDB + command.txnNumber = bson_1.Long.fromNumber(serverSession.txnNumber); + } + if (!inTxnOrTxnCommand) { + if (session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION) { + session.transaction.transition(transactions_1.TxnState.NO_TRANSACTION); + } + if (session.supports.causalConsistency && + session.operationTime && + (0, utils_1.commandSupportsAfterClusterTime)(command)) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } + else if (session.snapshotEnabled) { + command.readConcern = command.readConcern || { level: read_concern_1.ReadConcernLevel.snapshot }; + if (session.snapshotTime != null) { + Object.assign(command.readConcern, { atClusterTime: session.snapshotTime }); + } + } + return; + } + // now attempt to apply transaction-specific sessions data + // `autocommit` must always be false to differentiate from retryable writes + command.autocommit = false; + if (session.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) { + command.startTransaction = true; + const readConcern = session.transaction.options.readConcern || session?.clientOptions?.readConcern; + if (readConcern) { + command.readConcern = readConcern; + } + if (session.supports.causalConsistency && session.operationTime) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } + } + return; +} +function updateSessionFromResponse(session, document) { + if (document.$clusterTime) { + (0, common_1._advanceClusterTime)(session, document.$clusterTime); + } + if (document.operationTime && session && session.supports.causalConsistency) { + session.advanceOperationTime(document.operationTime); + } + if (document.recoveryToken && session && session.inTransaction()) { + session.transaction._recoveryToken = document.recoveryToken; + } + if (session?.snapshotEnabled && session.snapshotTime == null) { + // find and aggregate commands return atClusterTime on the cursor + // distinct includes it in the response body + const atClusterTime = document.atClusterTime; + if (atClusterTime) { + session.snapshotTime = atClusterTime; + } + } + if (session.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) { + if (document.ok === 1) { + session.transaction.transition(transactions_1.TxnState.TRANSACTION_IN_PROGRESS); + } + else { + const error = new error_1.MongoServerError(document.toObject()); + const isRetryableError = error.hasErrorLabel(error_1.MongoErrorLabel.RetryableError); + if (!isRetryableError) { + session.transaction.transition(transactions_1.TxnState.TRANSACTION_IN_PROGRESS); + } + } + } +} +//# sourceMappingURL=sessions.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js.map new file mode 100644 index 00000000..a8ad529c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sessions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":";;;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AW,CAAC,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC;IAC9D,CAAC;IAED,IAAI,OAAO,EAAE,eAAe,IAAI,OAAO,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC7D,iEAAiE;QACjE,4CAA4C;QAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;QAC7C,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,CAAC,YAAY,GAAG,aAAa,CAAC;QACvC,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,CAAC,KAAK,KAAK,uBAAQ,CAAC,oBAAoB,EAAE,CAAC;QAChE,IAAI,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,uBAAQ,CAAC,uBAAuB,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GAAG,IAAI,wBAAgB,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;YACxD,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC,uBAAe,CAAC,cAAc,CAAC,CAAC;YAE7E,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACtB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,uBAAQ,CAAC,uBAAuB,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js new file mode 100644 index 00000000..b795fcdc --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatSort = formatSort; +const error_1 = require("./error"); +/** @internal */ +function prepareDirection(direction = 1) { + const value = `${direction}`.toLowerCase(); + if (isMeta(direction)) + return direction; + switch (value) { + case 'ascending': + case 'asc': + case '1': + return 1; + case 'descending': + case 'desc': + case '-1': + return -1; + default: + throw new error_1.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(direction)}`); + } +} +/** @internal */ +function isMeta(t) { + return typeof t === 'object' && t != null && '$meta' in t && typeof t.$meta === 'string'; +} +/** @internal */ +function isPair(t) { + if (Array.isArray(t) && t.length === 2) { + try { + prepareDirection(t[1]); + return true; + } + catch { + return false; + } + } + return false; +} +function isDeep(t) { + return Array.isArray(t) && Array.isArray(t[0]); +} +function isMap(t) { + return t instanceof Map && t.size > 0; +} +function isReadonlyArray(value) { + return Array.isArray(value); +} +/** @internal */ +function pairToMap(v) { + return new Map([[`${v[0]}`, prepareDirection([v[1]])]]); +} +/** @internal */ +function deepToMap(t) { + const sortEntries = t.map(([k, v]) => [`${k}`, prepareDirection(v)]); + return new Map(sortEntries); +} +/** @internal */ +function stringsToMap(t) { + const sortEntries = t.map(key => [`${key}`, 1]); + return new Map(sortEntries); +} +/** @internal */ +function objectToMap(t) { + const sortEntries = Object.entries(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} +/** @internal */ +function mapToMap(t) { + const sortEntries = Array.from(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} +/** converts a Sort type into a type that is valid for the server (SortForCmd) */ +function formatSort(sort, direction) { + if (sort == null) + return undefined; + if (typeof sort === 'string') + return new Map([[sort, prepareDirection(direction)]]); // 'fieldName' + if (typeof sort !== 'object') { + throw new error_1.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(sort)} Sort must be a valid object`); + } + if (!isReadonlyArray(sort)) { + if (isMap(sort)) + return mapToMap(sort); // Map + if (Object.keys(sort).length) + return objectToMap(sort); // { [fieldName: string]: SortDirection } + return undefined; + } + if (!sort.length) + return undefined; + if (isDeep(sort)) + return deepToMap(sort); // [ [fieldName, sortDir], [fieldName, sortDir] ... ] + if (isPair(sort)) + return pairToMap(sort); // [ fieldName, sortDir ] + return stringsToMap(sort); // [ fieldName, fieldName ] +} +//# sourceMappingURL=sort.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js.map new file mode 100644 index 00000000..e1997c96 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/sort.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.js","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":";;AAqHA,gCAuBC;AA5ID,mCAAoD;AAiCpD,gBAAgB;AAChB,SAAS,gBAAgB,CAAC,YAAiB,CAAC;IAC1C,MAAM,KAAK,GAAG,GAAG,SAAS,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,MAAM,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,WAAW,CAAC;QACjB,KAAK,KAAK,CAAC;QACX,KAAK,GAAG;YACN,OAAO,CAAC,CAAC;QACX,KAAK,YAAY,CAAC;QAClB,KAAK,MAAM,CAAC;QACZ,KAAK,IAAI;YACP,OAAO,CAAC,CAAC,CAAC;QACZ;YACE,MAAM,IAAI,iCAAyB,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;AACH,CAAC;AAED,gBAAgB;AAChB,SAAS,MAAM,CAAC,CAAgB;IAC9B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC;AAC3F,CAAC;AAED,gBAAgB;AAChB,SAAS,MAAM,CAAC,CAAO;IACrB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC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EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,gCAAgC;QACxE,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM;YAAE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,yCAAyC;QACjG,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IACnC,IAAI,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,qDAAqD;IAC/F,IAAI,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB;IACnE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,2BAA2B;AACxD,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js new file mode 100644 index 00000000..fbd23125 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js @@ -0,0 +1,296 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LegacyTimeoutContext = exports.CSOTTimeoutContext = exports.TimeoutContext = exports.Timeout = exports.TimeoutError = void 0; +const timers_1 = require("timers"); +const error_1 = require("./error"); +const utils_1 = require("./utils"); +/** @internal */ +class TimeoutError extends Error { + get name() { + return 'TimeoutError'; + } + constructor(message, options) { + super(message, options); + this.duration = options.duration; + } + static is(error) { + return (error != null && typeof error === 'object' && 'name' in error && error.name === 'TimeoutError'); + } +} +exports.TimeoutError = TimeoutError; +/** + * @internal + * This class is an abstraction over timeouts + * The Timeout class can only be in the pending or rejected states. It is guaranteed not to resolve + * if interacted with exclusively through its public API + * */ +class Timeout extends Promise { + get remainingTime() { + if (this.timedOut) + return 0; + if (this.duration === 0) + return Infinity; + return this.start + this.duration - Math.trunc(performance.now()); + } + get timeElapsed() { + return Math.trunc(performance.now()) - this.start; + } + /** Create a new timeout that expires in `duration` ms */ + constructor(executor = () => null, options) { + const duration = options?.duration ?? 0; + const unref = !!options?.unref; + const rejection = options?.rejection; + if (duration < 0) { + throw new error_1.MongoInvalidArgumentError('Cannot create a Timeout with a negative duration'); + } + let reject; + super((_, promiseReject) => { + reject = promiseReject; + executor(utils_1.noop, promiseReject); + }); + this.ended = null; + this.timedOut = false; + this.cleared = false; + this.duration = duration; + this.start = Math.trunc(performance.now()); + if (rejection == null && this.duration > 0) { + this.id = (0, timers_1.setTimeout)(() => { + this.ended = Math.trunc(performance.now()); + this.timedOut = true; + reject(new TimeoutError(`Expired after ${duration}ms`, { duration })); + }, this.duration); + if (typeof this.id.unref === 'function' && unref) { + // Ensure we do not keep the Node.js event loop running + this.id.unref(); + } + } + else if (rejection != null) { + this.ended = Math.trunc(performance.now()); + this.timedOut = true; + reject(rejection); + } + } + /** + * Clears the underlying timeout. This method is idempotent + */ + clear() { + (0, timers_1.clearTimeout)(this.id); + this.id = undefined; + this.timedOut = false; + this.cleared = true; + } + throwIfExpired() { + if (this.timedOut) { + // This method is invoked when someone wants to throw immediately instead of await the result of this promise + // Since they won't be handling the rejection from the promise (because we're about to throw here) + // attach handling to prevent this from bubbling up to Node.js + this.then(undefined, utils_1.squashError); + throw new TimeoutError('Timed out', { duration: this.duration }); + } + } + static expires(duration, unref) { + return new Timeout(undefined, { duration, unref }); + } + static reject(rejection) { + return new Timeout(undefined, { duration: 0, unref: true, rejection }); + } +} +exports.Timeout = Timeout; +function isLegacyTimeoutContextOptions(v) { + return (v != null && + typeof v === 'object' && + 'serverSelectionTimeoutMS' in v && + typeof v.serverSelectionTimeoutMS === 'number' && + 'waitQueueTimeoutMS' in v && + typeof v.waitQueueTimeoutMS === 'number'); +} +function isCSOTTimeoutContextOptions(v) { + return (v != null && + typeof v === 'object' && + 'serverSelectionTimeoutMS' in v && + typeof v.serverSelectionTimeoutMS === 'number' && + 'timeoutMS' in v && + typeof v.timeoutMS === 'number'); +} +/** @internal */ +class TimeoutContext { + static create(options) { + if (options.session?.timeoutContext != null) + return options.session?.timeoutContext; + if (isCSOTTimeoutContextOptions(options)) + return new CSOTTimeoutContext(options); + else if (isLegacyTimeoutContextOptions(options)) + return new LegacyTimeoutContext(options); + else + throw new error_1.MongoRuntimeError('Unrecognized options'); + } +} +exports.TimeoutContext = TimeoutContext; +/** @internal */ +class CSOTTimeoutContext extends TimeoutContext { + constructor(options) { + super(); + this.minRoundTripTime = 0; + this.start = Math.trunc(performance.now()); + this.timeoutMS = options.timeoutMS; + this.serverSelectionTimeoutMS = options.serverSelectionTimeoutMS; + this.socketTimeoutMS = options.socketTimeoutMS; + this.clearServerSelectionTimeout = false; + } + get maxTimeMS() { + return this.remainingTimeMS - this.minRoundTripTime; + } + get remainingTimeMS() { + const timePassed = Math.trunc(performance.now()) - this.start; + return this.timeoutMS <= 0 ? Infinity : this.timeoutMS - timePassed; + } + csotEnabled() { + return true; + } + get serverSelectionTimeout() { + // check for undefined + if (typeof this._serverSelectionTimeout !== 'object' || this._serverSelectionTimeout?.cleared) { + const { remainingTimeMS, serverSelectionTimeoutMS } = this; + if (remainingTimeMS <= 0) + return Timeout.reject(new error_1.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`)); + const usingServerSelectionTimeoutMS = serverSelectionTimeoutMS !== 0 && + (0, utils_1.csotMin)(remainingTimeMS, serverSelectionTimeoutMS) === serverSelectionTimeoutMS; + if (usingServerSelectionTimeoutMS) { + this._serverSelectionTimeout = Timeout.expires(serverSelectionTimeoutMS); + } + else { + if (remainingTimeMS > 0 && Number.isFinite(remainingTimeMS)) { + this._serverSelectionTimeout = Timeout.expires(remainingTimeMS); + } + else { + this._serverSelectionTimeout = null; + } + } + } + return this._serverSelectionTimeout; + } + get connectionCheckoutTimeout() { + if (typeof this._connectionCheckoutTimeout !== 'object' || + this._connectionCheckoutTimeout?.cleared) { + if (typeof this._serverSelectionTimeout === 'object') { + // null or Timeout + this._connectionCheckoutTimeout = this._serverSelectionTimeout; + } + else { + throw new error_1.MongoRuntimeError('Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira'); + } + } + return this._connectionCheckoutTimeout; + } + get timeoutForSocketWrite() { + const { remainingTimeMS } = this; + if (!Number.isFinite(remainingTimeMS)) + return null; + if (remainingTimeMS > 0) + return Timeout.expires(remainingTimeMS); + return Timeout.reject(new error_1.MongoOperationTimeoutError('Timed out before socket write')); + } + get timeoutForSocketRead() { + const { remainingTimeMS } = this; + if (!Number.isFinite(remainingTimeMS)) + return null; + if (remainingTimeMS > 0) + return Timeout.expires(remainingTimeMS); + return Timeout.reject(new error_1.MongoOperationTimeoutError('Timed out before socket read')); + } + refresh() { + this.start = Math.trunc(performance.now()); + this.minRoundTripTime = 0; + this._serverSelectionTimeout?.clear(); + this._connectionCheckoutTimeout?.clear(); + } + clear() { + this._serverSelectionTimeout?.clear(); + this._connectionCheckoutTimeout?.clear(); + } + /** + * @internal + * Throws a MongoOperationTimeoutError if the context has expired. + * If the context has not expired, returns the `remainingTimeMS` + **/ + getRemainingTimeMSOrThrow(message) { + const { remainingTimeMS } = this; + if (remainingTimeMS <= 0) + throw new error_1.MongoOperationTimeoutError(message ?? `Expired after ${this.timeoutMS}ms`); + return remainingTimeMS; + } + /** + * @internal + * This method is intended to be used in situations where concurrent operation are on the same deadline, but cannot share a single `TimeoutContext` instance. + * Returns a new instance of `CSOTTimeoutContext` constructed with identical options, but setting the `start` property to `this.start`. + */ + clone() { + const timeoutContext = new CSOTTimeoutContext({ + timeoutMS: this.timeoutMS, + serverSelectionTimeoutMS: this.serverSelectionTimeoutMS + }); + timeoutContext.start = this.start; + return timeoutContext; + } + refreshed() { + return new CSOTTimeoutContext(this); + } + addMaxTimeMSToCommand(command, options) { + if (options.omitMaxTimeMS) + return; + const maxTimeMS = this.remainingTimeMS - this.minRoundTripTime; + if (maxTimeMS > 0 && Number.isFinite(maxTimeMS)) + command.maxTimeMS = maxTimeMS; + } + getSocketTimeoutMS() { + return 0; + } +} +exports.CSOTTimeoutContext = CSOTTimeoutContext; +/** @internal */ +class LegacyTimeoutContext extends TimeoutContext { + constructor(options) { + super(); + this.options = options; + this.clearServerSelectionTimeout = true; + } + csotEnabled() { + return false; + } + get serverSelectionTimeout() { + if (this.options.serverSelectionTimeoutMS != null && this.options.serverSelectionTimeoutMS > 0) + return Timeout.expires(this.options.serverSelectionTimeoutMS); + return null; + } + get connectionCheckoutTimeout() { + if (this.options.waitQueueTimeoutMS != null && this.options.waitQueueTimeoutMS > 0) + return Timeout.expires(this.options.waitQueueTimeoutMS); + return null; + } + get timeoutForSocketWrite() { + return null; + } + get timeoutForSocketRead() { + return null; + } + refresh() { + return; + } + clear() { + return; + } + get maxTimeMS() { + return null; + } + refreshed() { + return new LegacyTimeoutContext(this.options); + } + addMaxTimeMSToCommand(_command, _options) { + // No max timeMS is added to commands in legacy timeout mode. + } + getSocketTimeoutMS() { + return this.options.socketTimeoutMS; + } +} +exports.LegacyTimeoutContext = LegacyTimeoutContext; +//# sourceMappingURL=timeout.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js.map new file mode 100644 index 00000000..314ab7ac --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/timeout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"timeout.js","sourceRoot":"","sources":["../src/timeout.ts"],"names":[],"mappings":";;;AAAA,mCAAkD;AAGlD,mCAAmG;AAEnG,mCAAqD;AAErD,gBAAgB;AAChB,MAAa,YAAa,SAAQ,KAAK;IAErC,IAAa,IAAI;QACf,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,YAAY,OA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AO,CAAC,wBAAwB,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,wBAAwB,GAAG,CAAC;YAC5F,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,yBAAyB;QAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,GAAG,CAAC;YAChF,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO;IACT,CAAC;IAED,KAAK;QACH,OAAO;IACT,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,SAAS;QAChB,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAEQ,qBAAqB,CAAC,QAAkB,EAAE,QAAqC;QACtF,6DAA6D;IAC/D,CAAC;IAEQ,kBAAkB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IACtC,CAAC;CACF;AAzDD,oDAyDC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js new file mode 100644 index 00000000..2a79877c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js @@ -0,0 +1,135 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Transaction = exports.TxnState = void 0; +exports.isTransactionCommand = isTransactionCommand; +const error_1 = require("./error"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const write_concern_1 = require("./write_concern"); +/** @internal */ +exports.TxnState = Object.freeze({ + NO_TRANSACTION: 'NO_TRANSACTION', + STARTING_TRANSACTION: 'STARTING_TRANSACTION', + TRANSACTION_IN_PROGRESS: 'TRANSACTION_IN_PROGRESS', + TRANSACTION_COMMITTED: 'TRANSACTION_COMMITTED', + TRANSACTION_COMMITTED_EMPTY: 'TRANSACTION_COMMITTED_EMPTY', + TRANSACTION_ABORTED: 'TRANSACTION_ABORTED' +}); +const stateMachine = { + [exports.TxnState.NO_TRANSACTION]: [exports.TxnState.NO_TRANSACTION, exports.TxnState.STARTING_TRANSACTION], + [exports.TxnState.STARTING_TRANSACTION]: [ + exports.TxnState.TRANSACTION_IN_PROGRESS, + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.TRANSACTION_ABORTED + ], + [exports.TxnState.TRANSACTION_IN_PROGRESS]: [ + exports.TxnState.TRANSACTION_IN_PROGRESS, + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_ABORTED + ], + [exports.TxnState.TRANSACTION_COMMITTED]: [ + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.STARTING_TRANSACTION, + exports.TxnState.NO_TRANSACTION + ], + [exports.TxnState.TRANSACTION_ABORTED]: [exports.TxnState.STARTING_TRANSACTION, exports.TxnState.NO_TRANSACTION], + [exports.TxnState.TRANSACTION_COMMITTED_EMPTY]: [ + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.NO_TRANSACTION + ] +}; +const ACTIVE_STATES = new Set([ + exports.TxnState.STARTING_TRANSACTION, + exports.TxnState.TRANSACTION_IN_PROGRESS +]); +const COMMITTED_STATES = new Set([ + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.TRANSACTION_ABORTED +]); +/** + * @internal + */ +class Transaction { + /** Create a transaction */ + constructor(options) { + options = options ?? {}; + this.state = exports.TxnState.NO_TRANSACTION; + this.options = {}; + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (writeConcern) { + if (writeConcern.w === 0) { + throw new error_1.MongoTransactionError('Transactions do not support unacknowledged write concern'); + } + this.options.writeConcern = writeConcern; + } + if (options.readConcern) { + this.options.readConcern = read_concern_1.ReadConcern.fromOptions(options); + } + if (options.readPreference) { + this.options.readPreference = read_preference_1.ReadPreference.fromOptions(options); + } + if (options.maxCommitTimeMS) { + this.options.maxTimeMS = options.maxCommitTimeMS; + } + // TODO: This isn't technically necessary + this._pinnedServer = undefined; + this._recoveryToken = undefined; + } + get server() { + return this._pinnedServer; + } + get recoveryToken() { + return this._recoveryToken; + } + get isPinned() { + return !!this.server; + } + /** + * @returns Whether the transaction has started + */ + get isStarting() { + return this.state === exports.TxnState.STARTING_TRANSACTION; + } + /** + * @returns Whether this session is presently in a transaction + */ + get isActive() { + return ACTIVE_STATES.has(this.state); + } + get isCommitted() { + return COMMITTED_STATES.has(this.state); + } + /** + * Transition the transaction in the state machine + * @param nextState - The new state to transition to + */ + transition(nextState) { + const nextStates = stateMachine[this.state]; + if (nextStates && nextStates.includes(nextState)) { + this.state = nextState; + if (this.state === exports.TxnState.NO_TRANSACTION || + this.state === exports.TxnState.STARTING_TRANSACTION || + this.state === exports.TxnState.TRANSACTION_ABORTED) { + this.unpinServer(); + } + return; + } + throw new error_1.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${nextState}]`); + } + pinServer(server) { + if (this.isActive) { + this._pinnedServer = server; + } + } + unpinServer() { + this._pinnedServer = undefined; + } +} +exports.Transaction = Transaction; +function isTransactionCommand(command) { + return !!(command.commitTransaction || command.abortTransaction); +} +//# sourceMappingURL=transactions.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js.map new file mode 100644 index 00000000..4e92ed10 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/transactions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mappings":";;;AAkLA,oDAEC;AAnLD,mCAAmE;AAEnE,iDAAmE;AACnE,uDAA4E;AAE5E,mDAA+C;AAE/C,gBAAgB;AACH,QAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,uBAAuB,EAAE,yBAAyB;IAClD,qBAAqB,EAAE,uBAAuB;IAC9C,2BAA2B,EAAE,6BAA6B;IAC1D,mBAAmB,EAAE,qBAAqB;CAClC,CAAC,CAAC;AAKZ,MAAM,YAAY,GAAwC;IACxD,CAAC,gBAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,gBAAQ,CAAC,cAAc,EAAE,gBAAQ,CAAC,oBAAoB,CAAC;IACnF,CAAC,gBAAQ,CAAC,oBAAoB,CAAC,EAAE;QAC/B,gBAAQ,CAAC,uBAAuB;QAChC,gBAAQ,CAAC,qBAAqB;QAC9B,gBAAQ,CAAC,2BAA2B;QACpC,gBAAQ,CAAC,mBAAmB;KAC7B;IACD,CAAC,gBAAQ,CAAC,uBAAuB,CAAC,EAAE;QAClC,gBAAQ,CAAC,uBAAuB;QAChC,gBAAQ,CAAC,qBAAqB;QAC9B,gBAAQ,CAAC,mBAAmB;KAC7B;IACD,CAAC,gBAAQ,CAAC,qBAAqB,CAAC,EAAE;QAChC,gBAAQ,CAAC,qBAAqB;QAC9B,gBAAQ,CAAC,2BAA2B;QACpC,gBAAQ,CAAC,oBAAoB;QAC7B,gBAAQ,CAAC,cAAc;KACxB;IACD,CAAC,gBAAQ,CAAC,mBAAmB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MAAM,IAAI,yBAAiB,CACzB,4CAA4C,IAAI,CAAC,KAAK,SAAS,SAAS,GAAG,CAC5E,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,WAAW;QACT,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;IACjC,CAAC;CACF;AAnGD,kCAmGC;AAED,SAAgB,oBAAoB,CAAC,OAAiB;IACpD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnE,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js new file mode 100644 index 00000000..b016727a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js @@ -0,0 +1,1177 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.kDispose = exports.randomBytes = exports.COSMOS_DB_MSG = exports.DOCUMENT_DB_MSG = exports.COSMOS_DB_CHECK = exports.DOCUMENT_DB_CHECK = exports.MONGODB_WARNING_CODE = exports.DEFAULT_PK_FACTORY = exports.HostAddress = exports.BufferPool = exports.List = exports.MongoDBCollectionNamespace = exports.MongoDBNamespace = void 0; +exports.isUint8Array = isUint8Array; +exports.hostMatchesWildcards = hostMatchesWildcards; +exports.normalizeHintField = normalizeHintField; +exports.isObject = isObject; +exports.mergeOptions = mergeOptions; +exports.filterOptions = filterOptions; +exports.isPromiseLike = isPromiseLike; +exports.decorateWithCollation = decorateWithCollation; +exports.decorateWithReadConcern = decorateWithReadConcern; +exports.getTopology = getTopology; +exports.ns = ns; +exports.makeCounter = makeCounter; +exports.uuidV4 = uuidV4; +exports.maxWireVersion = maxWireVersion; +exports.arrayStrictEqual = arrayStrictEqual; +exports.errorStrictEqual = errorStrictEqual; +exports.makeStateMachine = makeStateMachine; +exports.processTimeMS = processTimeMS; +exports.calculateDurationInMs = calculateDurationInMs; +exports.hasAtomicOperators = hasAtomicOperators; +exports.resolveTimeoutOptions = resolveTimeoutOptions; +exports.resolveOptions = resolveOptions; +exports.isSuperset = isSuperset; +exports.isHello = isHello; +exports.setDifference = setDifference; +exports.isRecord = isRecord; +exports.emitWarning = emitWarning; +exports.emitWarningOnce = emitWarningOnce; +exports.enumToString = enumToString; +exports.supportsRetryableWrites = supportsRetryableWrites; +exports.shuffle = shuffle; +exports.commandSupportsReadConcern = commandSupportsReadConcern; +exports.commandSupportsAfterClusterTime = commandSupportsAfterClusterTime; +exports.compareObjectId = compareObjectId; +exports.parseInteger = parseInteger; +exports.parseUnsignedInteger = parseUnsignedInteger; +exports.checkParentDomainMatch = checkParentDomainMatch; +exports.get = get; +exports.isHostMatch = isHostMatch; +exports.promiseWithResolvers = promiseWithResolvers; +exports.squashError = squashError; +exports.once = once; +exports.maybeAddIdToDocuments = maybeAddIdToDocuments; +exports.fileIsAccessible = fileIsAccessible; +exports.csotMin = csotMin; +exports.noop = noop; +exports.decorateDecryptionResult = decorateDecryptionResult; +exports.addAbortListener = addAbortListener; +exports.abortable = abortable; +const fs_1 = require("fs"); +const http = require("http"); +const process = require("process"); +const timers_1 = require("timers"); +const bson_1 = require("./bson"); +const constants_1 = require("./cmap/wire_protocol/constants"); +const constants_2 = require("./constants"); +const error_1 = require("./error"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const common_1 = require("./sdam/common"); +const write_concern_1 = require("./write_concern"); +/** + * Returns true if value is a Uint8Array or a Buffer + * @param value - any value that may be a Uint8Array + */ +function isUint8Array(value) { + return (value != null && + typeof value === 'object' && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Uint8Array'); +} +/** + * Determines if a connection's address matches a user provided list + * of domain wildcards. + */ +function hostMatchesWildcards(host, wildcards) { + for (const wildcard of wildcards) { + // Exact match always wins + if (host === wildcard) { + return true; + } + // Wildcard match with leading *. + if (wildcard.startsWith('*.')) { + const suffix = wildcard.substring(2); + // Exact match or strict subdomain match + if (host === suffix || host.endsWith(`.${suffix}`)) { + return true; + } + } + // Wildcard match with leading */ + if (wildcard.startsWith('*/')) { + const suffix = wildcard.substring(2); + // Exact match or strict subpath match + if (host === suffix || host.endsWith(`/${suffix}`)) { + return true; + } + } + } + return false; +} +/** + * Ensure Hint field is in a shape we expect: + * - object of index names mapping to 1 or -1 + * - just an index name + * @internal + */ +function normalizeHintField(hint) { + let finalHint = undefined; + if (typeof hint === 'string') { + finalHint = hint; + } + else if (Array.isArray(hint)) { + finalHint = {}; + hint.forEach(param => { + finalHint[param] = 1; + }); + } + else if (hint != null && typeof hint === 'object') { + finalHint = {}; + for (const name in hint) { + finalHint[name] = hint[name]; + } + } + return finalHint; +} +const TO_STRING = (object) => Object.prototype.toString.call(object); +/** + * Checks if arg is an Object: + * - **NOTE**: the check is based on the `[Symbol.toStringTag]() === 'Object'` + * @internal + */ +function isObject(arg) { + return '[object Object]' === TO_STRING(arg); +} +/** @internal */ +function mergeOptions(target, source) { + return { ...target, ...source }; +} +/** @internal */ +function filterOptions(options, names) { + const filterOptions = {}; + for (const name in options) { + if (names.includes(name)) { + filterOptions[name] = options[name]; + } + } + // Filtered options + return filterOptions; +} +/** + * Applies a write concern to a command based on well defined inheritance rules, optionally + * detecting support for the write concern in the first place. + * @internal + * + * @param target - the target command we will be applying the write concern to + * @param sources - sources where we can inherit default write concerns from + * @param options - optional settings passed into a command for write concern overrides + */ +/** + * Checks if a given value is a Promise + * + * @typeParam T - The resolution type of the possible promise + * @param value - An object that could be a promise + * @returns true if the provided value is a Promise + */ +function isPromiseLike(value) { + return (value != null && + typeof value === 'object' && + 'then' in value && + typeof value.then === 'function'); +} +/** + * Applies collation to a given command. + * @internal + * + * @param command - the command on which to apply collation + * @param target - target of command + * @param options - options containing collation settings + */ +function decorateWithCollation(command, options) { + if (options.collation && typeof options.collation === 'object') { + command.collation = options.collation; + } +} +/** + * Applies a read concern to a given command. + * @internal + * + * @param command - the command on which to apply the read concern + * @param coll - the parent collection of the operation calling this method + */ +function decorateWithReadConcern(command, coll, options) { + if (options && options.session && options.session.inTransaction()) { + return; + } + const readConcern = Object.assign({}, command.readConcern || {}); + if (coll.s.readConcern) { + Object.assign(readConcern, coll.s.readConcern); + } + if (Object.keys(readConcern).length > 0) { + Object.assign(command, { readConcern: readConcern }); + } +} +/** + * A helper function to get the topology from a given provider. Throws + * if the topology cannot be found. + * @throws MongoNotConnectedError + * @internal + */ +function getTopology(provider) { + // MongoClient or ClientSession or AbstractCursor + if ('topology' in provider && provider.topology) { + return provider.topology; + } + else if ('client' in provider && provider.client.topology) { + return provider.client.topology; + } + throw new error_1.MongoNotConnectedError('MongoClient must be connected to perform this operation'); +} +/** @internal */ +function ns(ns) { + return MongoDBNamespace.fromString(ns); +} +/** @public */ +class MongoDBNamespace { + /** + * Create a namespace object + * + * @param db - database name + * @param collection - collection name + */ + constructor(db, collection) { + this.db = db; + this.collection = collection === '' ? undefined : collection; + } + toString() { + return this.collection ? `${this.db}.${this.collection}` : this.db; + } + withCollection(collection) { + return new MongoDBCollectionNamespace(this.db, collection); + } + static fromString(namespace) { + if (typeof namespace !== 'string' || namespace === '') { + // TODO(NODE-3483): Replace with MongoNamespaceError + throw new error_1.MongoRuntimeError(`Cannot parse namespace from "${namespace}"`); + } + const [db, ...collectionParts] = namespace.split('.'); + const collection = collectionParts.join('.'); + return new MongoDBNamespace(db, collection === '' ? undefined : collection); + } +} +exports.MongoDBNamespace = MongoDBNamespace; +/** + * @public + * + * A class representing a collection's namespace. This class enforces (through Typescript) that + * the `collection` portion of the namespace is defined and should only be + * used in scenarios where this can be guaranteed. + */ +class MongoDBCollectionNamespace extends MongoDBNamespace { + constructor(db, collection) { + super(db, collection); + this.collection = collection; + } + static fromString(namespace) { + return super.fromString(namespace); + } +} +exports.MongoDBCollectionNamespace = MongoDBCollectionNamespace; +/** @internal */ +function* makeCounter(seed = 0) { + let count = seed; + while (true) { + const newCount = count; + count += 1; + yield newCount; + } +} +/** + * Synchronously Generate a UUIDv4 + * @internal + */ +function uuidV4() { + const result = crypto.getRandomValues(new Uint8Array(16)); + result[6] = (result[6] & 0x0f) | 0x40; + result[8] = (result[8] & 0x3f) | 0x80; + return result; +} +/** + * A helper function for determining `maxWireVersion` between legacy and new topology instances + * @internal + */ +function maxWireVersion(handshakeAware) { + if (handshakeAware) { + if (handshakeAware.hello) { + return handshakeAware.hello.maxWireVersion; + } + if (handshakeAware.serverApi?.version) { + // We return the max supported wire version for serverAPI. + return constants_1.MAX_SUPPORTED_WIRE_VERSION; + } + // This is the fallback case for load balanced mode. If we are building commands the + // object being checked will be a connection, and we will have a hello response on + // it. For other cases, such as retryable writes, the object will be a server or + // topology, and there will be no hello response on those objects, so we return + // the max wire version so we support retryability. + if (handshakeAware.loadBalanced) { + return constants_1.MAX_SUPPORTED_WIRE_VERSION; + } + if ('lastHello' in handshakeAware && typeof handshakeAware.lastHello === 'function') { + const lastHello = handshakeAware.lastHello(); + if (lastHello) { + return lastHello.maxWireVersion; + } + } + if (handshakeAware.description && + 'maxWireVersion' in handshakeAware.description && + handshakeAware.description.maxWireVersion != null) { + return handshakeAware.description.maxWireVersion; + } + } + return 0; +} +/** @internal */ +function arrayStrictEqual(arr, arr2) { + if (!Array.isArray(arr) || !Array.isArray(arr2)) { + return false; + } + return arr.length === arr2.length && arr.every((elt, idx) => elt === arr2[idx]); +} +/** @internal */ +function errorStrictEqual(lhs, rhs) { + if (lhs === rhs) { + return true; + } + if (!lhs || !rhs) { + return lhs === rhs; + } + if ((lhs == null && rhs != null) || (lhs != null && rhs == null)) { + return false; + } + if (lhs.constructor.name !== rhs.constructor.name) { + return false; + } + if (lhs.message !== rhs.message) { + return false; + } + return true; +} +/** @internal */ +function makeStateMachine(stateTable) { + return function stateTransition(target, newState) { + const legalStates = stateTable[target.s.state]; + if (legalStates && legalStates.indexOf(newState) < 0) { + throw new error_1.MongoRuntimeError(`illegal state transition from [${target.s.state}] => [${newState}], allowed: [${legalStates}]`); + } + target.emit('stateChanged', target.s.state, newState); + target.s.state = newState; + }; +} +/** + * This function returns the number of milliseconds since an arbitrary point in time. + * This function should only be used to measure time intervals. + * @internal + * */ +function processTimeMS() { + return Math.floor(performance.now()); +} +/** @internal */ +function calculateDurationInMs(started) { + if (typeof started !== 'number') { + return -1; + } + const elapsed = processTimeMS() - started; + return elapsed < 0 ? 0 : elapsed; +} +/** @internal */ +function hasAtomicOperators(doc, options) { + if (Array.isArray(doc)) { + for (const document of doc) { + if (hasAtomicOperators(document)) { + return true; + } + } + return false; + } + const keys = Object.keys(doc); + // In this case we need to throw if all the atomic operators are undefined. + if (options?.ignoreUndefined) { + let allUndefined = true; + for (const key of keys) { + // eslint-disable-next-line no-restricted-syntax + if (doc[key] !== undefined) { + allUndefined = false; + break; + } + } + if (allUndefined) { + throw new error_1.MongoInvalidArgumentError('Update operations require that all atomic operators have defined values, but none were provided.'); + } + } + return keys.length > 0 && keys[0][0] === '$'; +} +function resolveTimeoutOptions(client, options) { + const { socketTimeoutMS, serverSelectionTimeoutMS, waitQueueTimeoutMS, timeoutMS } = client.s.options; + return { socketTimeoutMS, serverSelectionTimeoutMS, waitQueueTimeoutMS, timeoutMS, ...options }; +} +/** + * Merge inherited properties from parent into options, prioritizing values from options, + * then values from parent. + * + * @param parent - An optional owning class of the operation being run. ex. Db/Collection/MongoClient. + * @param options - The options passed to the operation method. + * + * @internal + */ +function resolveOptions(parent, options) { + const result = Object.assign({}, options, (0, bson_1.resolveBSONOptions)(options, parent)); + const timeoutMS = options?.timeoutMS ?? parent?.timeoutMS; + // Users cannot pass a readConcern/writeConcern to operations in a transaction + const session = options?.session; + if (!session?.inTransaction()) { + const readConcern = read_concern_1.ReadConcern.fromOptions(options) ?? parent?.readConcern; + if (readConcern) { + result.readConcern = readConcern; + } + let writeConcern = write_concern_1.WriteConcern.fromOptions(options) ?? parent?.writeConcern; + if (writeConcern) { + if (timeoutMS != null) { + writeConcern = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...writeConcern, + wtimeout: undefined, + wtimeoutMS: undefined + } + }); + } + result.writeConcern = writeConcern; + } + } + result.timeoutMS = timeoutMS; + const readPreference = read_preference_1.ReadPreference.fromOptions(options) ?? parent?.readPreference; + if (readPreference) { + result.readPreference = readPreference; + } + const isConvenientTransaction = session?.explicit && session?.timeoutContext != null; + if (isConvenientTransaction && options?.timeoutMS != null) { + throw new error_1.MongoInvalidArgumentError('An operation cannot be given a timeoutMS setting when inside a withTransaction call that has a timeoutMS setting'); + } + return result; +} +function isSuperset(set, subset) { + set = Array.isArray(set) ? new Set(set) : set; + subset = Array.isArray(subset) ? new Set(subset) : subset; + for (const elem of subset) { + if (!set.has(elem)) { + return false; + } + } + return true; +} +/** + * Checks if the document is a Hello request + * @internal + */ +function isHello(doc) { + return doc[constants_2.LEGACY_HELLO_COMMAND] || doc.hello ? true : false; +} +/** Returns the items that are uniquely in setA */ +function setDifference(setA, setB) { + const difference = new Set(setA); + for (const elem of setB) { + difference.delete(elem); + } + return difference; +} +const HAS_OWN = (object, prop) => Object.prototype.hasOwnProperty.call(object, prop); +function isRecord(value, requiredKeys = undefined) { + if (!isObject(value)) { + return false; + } + const ctor = value.constructor; + if (ctor && ctor.prototype) { + if (!isObject(ctor.prototype)) { + return false; + } + // Check to see if some method exists from the Object exists + if (!HAS_OWN(ctor.prototype, 'isPrototypeOf')) { + return false; + } + } + if (requiredKeys) { + const keys = Object.keys(value); + return isSuperset(keys, requiredKeys); + } + return true; +} +/** + * A sequential list of items in a circularly linked list + * @remarks + * The head node is special, it is always defined and has a value of null. + * It is never "included" in the list, in that, it is not returned by pop/shift or yielded by the iterator. + * The circular linkage and always defined head node are to reduce checks for null next/prev references to zero. + * New nodes are declared as object literals with keys always in the same order: next, prev, value. + * @internal + */ +class List { + get length() { + return this.count; + } + get [Symbol.toStringTag]() { + return 'List'; + } + constructor() { + this.count = 0; + // this is carefully crafted: + // declaring a complete and consistently key ordered + // object is beneficial to the runtime optimizations + this.head = { + next: null, + prev: null, + value: null + }; + this.head.next = this.head; + this.head.prev = this.head; + } + toArray() { + return Array.from(this); + } + toString() { + return `head <=> ${this.toArray().join(' <=> ')} <=> head`; + } + *[Symbol.iterator]() { + for (const node of this.nodes()) { + yield node.value; + } + } + *nodes() { + let ptr = this.head.next; + while (ptr !== this.head) { + // Save next before yielding so that we make removing within iteration safe + const { next } = ptr; + yield ptr; + ptr = next; + } + } + /** Insert at end of list */ + push(value) { + this.count += 1; + const newNode = { + next: this.head, + prev: this.head.prev, + value + }; + this.head.prev.next = newNode; + this.head.prev = newNode; + } + /** Inserts every item inside an iterable instead of the iterable itself */ + pushMany(iterable) { + for (const value of iterable) { + this.push(value); + } + } + /** Insert at front of list */ + unshift(value) { + this.count += 1; + const newNode = { + next: this.head.next, + prev: this.head, + value + }; + this.head.next.prev = newNode; + this.head.next = newNode; + } + remove(node) { + if (node === this.head || this.length === 0) { + return null; + } + this.count -= 1; + const prevNode = node.prev; + const nextNode = node.next; + prevNode.next = nextNode; + nextNode.prev = prevNode; + return node.value; + } + /** Removes the first node at the front of the list */ + shift() { + return this.remove(this.head.next); + } + /** Removes the last node at the end of the list */ + pop() { + return this.remove(this.head.prev); + } + /** Iterates through the list and removes nodes where filter returns true */ + prune(filter) { + for (const node of this.nodes()) { + if (filter(node.value)) { + this.remove(node); + } + } + } + clear() { + this.count = 0; + this.head.next = this.head; + this.head.prev = this.head; + } + /** Returns the first item in the list, does not remove */ + first() { + // If the list is empty, value will be the head's null + return this.head.next.value; + } + /** Returns the last item in the list, does not remove */ + last() { + // If the list is empty, value will be the head's null + return this.head.prev.value; + } +} +exports.List = List; +/** + * A pool of Buffers which allow you to read them as if they were one + * @internal + */ +class BufferPool { + constructor() { + this.buffers = new List(); + this.totalByteLength = 0; + } + get length() { + return this.totalByteLength; + } + /** Adds a buffer to the internal buffer pool list */ + append(buffer) { + this.buffers.push(buffer); + this.totalByteLength += buffer.length; + } + /** + * If BufferPool contains 4 bytes or more construct an int32 from the leading bytes, + * otherwise return null. Size can be negative, caller should error check. + */ + getInt32() { + if (this.totalByteLength < 4) { + return null; + } + const firstBuffer = this.buffers.first(); + if (firstBuffer != null && firstBuffer.byteLength >= 4) { + return bson_1.NumberUtils.getInt32LE(firstBuffer, 0); + } + // Unlikely case: an int32 is split across buffers. + // Use read and put the returned buffer back on top + const top4Bytes = this.read(4); + const value = bson_1.NumberUtils.getInt32LE(top4Bytes, 0); + // Put it back. + this.totalByteLength += 4; + this.buffers.unshift(top4Bytes); + return value; + } + /** Reads the requested number of bytes, optionally consuming them */ + read(size) { + if (typeof size !== 'number' || size < 0) { + throw new error_1.MongoInvalidArgumentError('Argument "size" must be a non-negative number'); + } + // oversized request returns empty buffer + if (size > this.totalByteLength) { + return bson_1.ByteUtils.allocate(0); + } + // We know we have enough, we just don't know how it is spread across chunks + // TODO(NODE-4732): alloc API should change based on raw option + const result = bson_1.ByteUtils.allocateUnsafe(size); + for (let bytesRead = 0; bytesRead < size;) { + const buffer = this.buffers.shift(); + if (buffer == null) { + break; + } + const bytesRemaining = size - bytesRead; + const bytesReadable = Math.min(bytesRemaining, buffer.byteLength); + const bytes = buffer.subarray(0, bytesReadable); + result.set(bytes, bytesRead); + bytesRead += bytesReadable; + this.totalByteLength -= bytesReadable; + if (bytesReadable < buffer.byteLength) { + this.buffers.unshift(buffer.subarray(bytesReadable)); + } + } + return result; + } +} +exports.BufferPool = BufferPool; +/** @public */ +class HostAddress { + constructor(hostString) { + this.host = undefined; + this.port = undefined; + this.socketPath = undefined; + this.isIPv6 = false; + const escapedHost = hostString.split(' ').join('%20'); // escape spaces, for socket path hosts + if (escapedHost.endsWith('.sock')) { + // heuristically determine if we're working with a domain socket + this.socketPath = decodeURIComponent(escapedHost); + return; + } + const urlString = `iLoveJS://${escapedHost}`; + let url; + try { + url = new URL(urlString); + } + catch (urlError) { + const runtimeError = new error_1.MongoRuntimeError(`Unable to parse ${escapedHost} with URL`); + runtimeError.cause = urlError; + throw runtimeError; + } + const hostname = url.hostname; + const port = url.port; + let normalized = decodeURIComponent(hostname).toLowerCase(); + if (normalized.startsWith('[') && normalized.endsWith(']')) { + this.isIPv6 = true; + normalized = normalized.substring(1, hostname.length - 1); + } + this.host = normalized.toLowerCase(); + if (typeof port === 'number') { + this.port = port; + } + else if (typeof port === 'string' && port !== '') { + this.port = Number.parseInt(port, 10); + } + else { + this.port = 27017; + } + if (this.port === 0) { + throw new error_1.MongoParseError('Invalid port (zero) with hostname'); + } + Object.freeze(this); + } + [Symbol.for('nodejs.util.inspect.custom')]() { + return this.inspect(); + } + inspect() { + return `new HostAddress('${this.toString()}')`; + } + toString() { + if (typeof this.host === 'string') { + if (this.isIPv6) { + return `[${this.host}]:${this.port}`; + } + return `${this.host}:${this.port}`; + } + return `${this.socketPath}`; + } + static fromString(s) { + return new HostAddress(s); + } + static fromHostPort(host, port) { + if (host.includes(':')) { + host = `[${host}]`; // IPv6 address + } + return HostAddress.fromString(`${host}:${port}`); + } + static fromSrvRecord({ name, port }) { + return HostAddress.fromHostPort(name, port); + } + toHostPort() { + if (this.socketPath) { + return { host: this.socketPath, port: 0 }; + } + const host = this.host ?? ''; + const port = this.port ?? 0; + return { host, port }; + } +} +exports.HostAddress = HostAddress; +exports.DEFAULT_PK_FACTORY = { + // We prefer not to rely on ObjectId having a createPk method + createPk() { + return new bson_1.ObjectId(); + } +}; +/** + * When the driver used emitWarning the code will be equal to this. + * @public + * + * @example + * ```ts + * process.on('warning', (warning) => { + * if (warning.code === MONGODB_WARNING_CODE) console.error('Ah an important warning! :)') + * }) + * ``` + */ +exports.MONGODB_WARNING_CODE = 'MONGODB DRIVER'; +/** @internal */ +function emitWarning(message) { + return process.emitWarning(message, { code: exports.MONGODB_WARNING_CODE }); +} +const emittedWarnings = new Set(); +/** + * Will emit a warning once for the duration of the application. + * Uses the message to identify if it has already been emitted + * so using string interpolation can cause multiple emits + * @internal + */ +function emitWarningOnce(message) { + if (!emittedWarnings.has(message)) { + emittedWarnings.add(message); + return emitWarning(message); + } +} +/** + * Takes a JS object and joins the values into a string separated by ', ' + */ +function enumToString(en) { + return Object.values(en).join(', '); +} +/** + * Determine if a server supports retryable writes. + * + * @internal + */ +function supportsRetryableWrites(server) { + if (!server) { + return false; + } + if (server.loadBalanced) { + // Loadbalanced topologies will always support retry writes + return true; + } + if (server.description.logicalSessionTimeoutMinutes != null) { + // that supports sessions + if (server.description.type !== common_1.ServerType.Standalone) { + // and that is not a standalone + return true; + } + } + return false; +} +/** + * Fisher–Yates Shuffle + * + * Reference: https://bost.ocks.org/mike/shuffle/ + * @param sequence - items to be shuffled + * @param limit - Defaults to `0`. If nonzero shuffle will slice the randomized array e.g, `.slice(0, limit)` otherwise will return the entire randomized array. + */ +function shuffle(sequence, limit = 0) { + const items = Array.from(sequence); // shallow copy in order to never shuffle the input + if (limit > items.length) { + throw new error_1.MongoRuntimeError('Limit must be less than the number of items'); + } + let remainingItemsToShuffle = items.length; + const lowerBound = limit % items.length === 0 ? 1 : items.length - limit; + while (remainingItemsToShuffle > lowerBound) { + // Pick a remaining element + const randomIndex = Math.floor(Math.random() * remainingItemsToShuffle); + remainingItemsToShuffle -= 1; + // And swap it with the current element + const swapHold = items[remainingItemsToShuffle]; + items[remainingItemsToShuffle] = items[randomIndex]; + items[randomIndex] = swapHold; + } + return limit % items.length === 0 ? items : items.slice(lowerBound); +} +/** + * TODO(NODE-4936): read concern eligibility for commands should be codified in command construction + * @internal + * @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.md#read-concern + */ +function commandSupportsReadConcern(command) { + if (command.aggregate || command.count || command.distinct || command.find || command.geoNear) { + return true; + } + return false; +} +/** + * @internal + */ +function commandSupportsAfterClusterTime(command) { + // READ operations + if (command.aggregate || command.count || command.distinct || command.find || command.geoNear) { + return true; + } + // WRITE operations + if (command.bulkWrite || + command.create || + command.createIndexes || + command.delete || + command.drop || + command.dropDatabase || + command.dropIndexes || + command.findAndModify || + command.insert || + command.update) { + return true; + } + return false; +} +/** + * Compare objectIds. `null` is always less + * - `+1 = oid1 is greater than oid2` + * - `-1 = oid1 is less than oid2` + * - `+0 = oid1 is equal oid2` + */ +function compareObjectId(oid1, oid2) { + if (oid1 == null && oid2 == null) { + return 0; + } + if (oid1 == null) { + return -1; + } + if (oid2 == null) { + return 1; + } + return bson_1.ByteUtils.compare(oid1.id, oid2.id); +} +function parseInteger(value) { + if (typeof value === 'number') + return Math.trunc(value); + const parsedValue = Number.parseInt(String(value), 10); + return Number.isNaN(parsedValue) ? null : parsedValue; +} +function parseUnsignedInteger(value) { + const parsedInt = parseInteger(value); + return parsedInt != null && parsedInt >= 0 ? parsedInt : null; +} +/** + * This function throws a MongoAPIError in the event that either of the following is true: + * * If the provided address domain does not match the provided parent domain + * * If the parent domain contains less than three `.` separated parts and the provided address does not contain at least one more domain level than its parent + * + * If a DNS server were to become compromised SRV records would still need to + * advertise addresses that are under the same domain as the srvHost. + * + * @param address - The address to check against a domain + * @param srvHost - The domain to check the provided address against + * @returns void + */ +function checkParentDomainMatch(address, srvHost) { + // Remove trailing dot if exists on either the resolved address or the srv hostname + const normalizedAddress = address.endsWith('.') ? address.slice(0, address.length - 1) : address; + const normalizedSrvHost = srvHost.endsWith('.') ? srvHost.slice(0, srvHost.length - 1) : srvHost; + const allCharacterBeforeFirstDot = /^.*?\./; + const srvIsLessThanThreeParts = normalizedSrvHost.split('.').length < 3; + // Remove all characters before first dot + // Add leading dot back to string so + // an srvHostDomain = '.trusted.site' + // will not satisfy an addressDomain that endsWith '.fake-trusted.site' + const addressDomain = `.${normalizedAddress.replace(allCharacterBeforeFirstDot, '')}`; + let srvHostDomain = srvIsLessThanThreeParts + ? normalizedSrvHost + : `.${normalizedSrvHost.replace(allCharacterBeforeFirstDot, '')}`; + if (!srvHostDomain.startsWith('.')) { + srvHostDomain = '.' + srvHostDomain; + } + if (srvIsLessThanThreeParts && + normalizedAddress.split('.').length <= normalizedSrvHost.split('.').length) { + throw new error_1.MongoAPIError('Server record does not have at least one more domain level than parent URI'); + } + if (!addressDomain.endsWith(srvHostDomain)) { + throw new error_1.MongoAPIError('Server record does not share hostname with parent URI'); + } +} +/** + * Perform a get request that returns status and body. + * @internal + */ +function get(url, options = {}) { + return new Promise((resolve, reject) => { + /* eslint-disable prefer-const */ + let timeoutId; + const request = http + .get(url, options, response => { + response.setEncoding('utf8'); + let body = ''; + response.on('data', chunk => (body += chunk)); + response.on('end', () => { + (0, timers_1.clearTimeout)(timeoutId); + resolve({ status: response.statusCode, body }); + }); + }) + .on('error', error => { + (0, timers_1.clearTimeout)(timeoutId); + reject(error); + }) + .end(); + timeoutId = (0, timers_1.setTimeout)(() => { + request.destroy(new error_1.MongoNetworkTimeoutError(`request timed out after 10 seconds`)); + }, 10000); + }); +} +/** @internal */ +exports.DOCUMENT_DB_CHECK = /(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/; +/** @internal */ +exports.COSMOS_DB_CHECK = /\.cosmos\.azure\.com$/; +/** @internal */ +exports.DOCUMENT_DB_MSG = 'You appear to be connected to a DocumentDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/documentdb'; +/** @internal */ +exports.COSMOS_DB_MSG = 'You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb'; +/** @internal */ +function isHostMatch(match, host) { + return host && match.test(host.toLowerCase()) ? true : false; +} +function promiseWithResolvers() { + let resolve; + let reject; + const promise = new Promise(function withResolversExecutor(promiseResolve, promiseReject) { + resolve = promiseResolve; + reject = promiseReject; + }); + return { promise, resolve, reject }; +} +/** + * A noop function intended for use in preventing unhandled rejections. + * + * @example + * ```js + * const promise = myAsyncTask(); + * // eslint-disable-next-line github/no-then + * promise.then(undefined, squashError); + * ``` + */ +function squashError(_error) { + return; +} +const randomBytes = (size) => { + return Promise.resolve(crypto.getRandomValues(new Uint8Array(size))); +}; +exports.randomBytes = randomBytes; +/** + * Replicates the events.once helper. + * + * Removes unused signal logic and It **only** supports 0 or 1 argument events. + * + * @param ee - An event emitter that may emit `ev` + * @param name - An event name to wait for + */ +async function once(ee, name, options) { + options?.signal?.throwIfAborted(); + const { promise, resolve, reject } = promiseWithResolvers(); + const onEvent = (data) => resolve(data); + const onError = (error) => reject(error); + const abortListener = addAbortListener(options?.signal, function () { + reject(this.reason); + }); + ee.once(name, onEvent).once('error', onError); + try { + return await promise; + } + finally { + ee.off(name, onEvent); + ee.off('error', onError); + abortListener?.[exports.kDispose](); + } +} +function maybeAddIdToDocuments(collection, document, options) { + const forceServerObjectId = options.forceServerObjectId ?? collection.db.options?.forceServerObjectId ?? false; + // no need to modify the docs if server sets the ObjectId + if (forceServerObjectId) { + return document; + } + if (document._id == null) { + document._id = collection.s.pkFactory.createPk(); + } + return document; +} +async function fileIsAccessible(fileName, mode) { + try { + await fs_1.promises.access(fileName, mode); + return true; + } + catch { + return false; + } +} +function csotMin(duration1, duration2) { + if (duration1 === 0) + return duration2; + if (duration2 === 0) + return duration1; + return Math.min(duration1, duration2); +} +function noop() { + return; +} +/** + * Recurse through the (identically-shaped) `decrypted` and `original` + * objects and attach a `decryptedKeys` property on each sub-object that + * contained encrypted fields. Because we only call this on BSON responses, + * we do not need to worry about circular references. + * + * @internal + */ +function decorateDecryptionResult(decrypted, original, isTopLevelDecorateCall = true) { + if (isTopLevelDecorateCall) { + // The original value could have been either a JS object or a BSON buffer + if (bson_1.ByteUtils.isUint8Array(original)) { + original = (0, bson_1.deserialize)(original); + } + if (bson_1.ByteUtils.isUint8Array(decrypted)) { + throw new error_1.MongoRuntimeError('Expected result of decryption to be deserialized BSON object'); + } + } + if (!decrypted || typeof decrypted !== 'object') + return; + for (const k of Object.keys(decrypted)) { + const originalValue = original[k]; + // An object was decrypted by libmongocrypt if and only if it was + // a BSON Binary object with subtype 6. + if (originalValue && originalValue._bsontype === 'Binary' && originalValue.sub_type === 6) { + if (!decrypted[constants_2.kDecoratedKeys]) { + Object.defineProperty(decrypted, constants_2.kDecoratedKeys, { + value: [], + configurable: true, + enumerable: false, + writable: false + }); + } + // this is defined in the preceding if-statement + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + decrypted[constants_2.kDecoratedKeys].push(k); + // Do not recurse into this decrypted value. It could be a sub-document/array, + // in which case there is no original value associated with its subfields. + continue; + } + decorateDecryptionResult(decrypted[k], originalValue, false); + } +} +/** @internal */ +exports.kDispose = Symbol.dispose ?? Symbol('dispose'); +/** + * A utility that helps with writing listener code idiomatically + * + * @example + * ```js + * using listener = addAbortListener(signal, function () { + * console.log('aborted', this.reason); + * }); + * ``` + * + * @param signal - if exists adds an abort listener + * @param listener - the listener to be added to signal + * @returns A disposable that will remove the abort listener + */ +function addAbortListener(signal, listener) { + if (signal == null) + return; + signal.addEventListener('abort', listener, { once: true }); + return { [exports.kDispose]: () => signal.removeEventListener('abort', listener) }; +} +/** + * Takes a promise and races it with a promise wrapping the abort event of the optionally provided signal. + * The given promise is _always_ ordered before the signal's abort promise. + * When given an already rejected promise and an already aborted signal, the promise's rejection takes precedence. + * + * Any asynchronous processing in `promise` will continue even after the abort signal has fired, + * but control will be returned to the caller + * + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race + * + * @param promise - A promise to discard if the signal aborts + * @param options - An options object carrying an optional signal + */ +async function abortable(promise, { signal }) { + if (signal == null) { + return await promise; + } + const { promise: aborted, reject } = promiseWithResolvers(); + const abortListener = signal.aborted + ? reject(signal.reason) + : addAbortListener(signal, function () { + reject(this.reason); + }); + try { + return await Promise.race([promise, aborted]); + } + finally { + abortListener?.[exports.kDispose](); + } +} +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js.map new file mode 100644 index 00000000..6aa2c05c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAwDA,oCAOC;AAMD,oDAyBC;AAQD,gDAmBC;AASD,4BAEC;AAGD,oCAEC;AAGD,sCAWC;AAmBD,sCAOC;AAUD,sDAIC;AASD,0DAgBC;AAmBD,kCASC;AAGD,gBAEC;AA0DD,kCAOC;AAMD,wBAKC;AAMD,wCAoCC;AAGD,4CAMC;AAGD,4CAsBC;AAoBD,4CAYC;AAOD,sCAEC;AAGD,sDAOC;AAGD,gDAgCC;AAED,sDAWC;AAUD,wCA8CC;AAED,gCASC;AAMD,0BAEC;AAGD,sCAMC;AAUD,4BA0BC;AAiXD,kCAEC;AASD,0CAKC;AAKD,oCAEC;AAOD,0DAmBC;AASD,0BAqBC;AAOD,gEAKC;AAKD,0EAuBC;AAQD,0CAcC;AAED,oCAKC;AAED,oDAIC;AAcD,wDA8BC;AAMD,kBA0BC;AAeD,kCAEC;AAED,oDAYC;AAYD,kCAEC;AAcD,oBAmBC;AAED,sDAkBC;AAED,4CAOC;AAED,0BAIC;AAED,oBAEC;AAUD,4DAwCC;AAwBD,4CAOC;AAeD,8BAqBC;AA36CD,2BAAoC;AACpC,6BAA6B;AAC7B,mCAAmC;AACnC,mCAAkD;AAElD,iCAOgB;AAEhB,8DAA4E;AAE5E,2CAAmE;AAInE,mCAQiB;AAKjB,iDAA6C;AAC7C,uDAAmD;AACnD,0CAA2C;AAK3C,mDAA+C;AAU/C;;;GAGG;AACH,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,CACL,KAAK,IAAI,IAAI;QACb,OAAO,KAAK,KAAK,QAAQ;QACzB,MAAM,CAAC,WAAW,IAAI,KAAK;QAC3B,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,YAAY,CAC3C,CAAC;A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,MAAM,EAAE;YACvB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IAEP,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,CAAC;YAAS,CAAC;QACT,aAAa,EAAE,CAAC,gBAAQ,CAAC,EAAE,CAAC;IAC9B,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js new file mode 100644 index 00000000..9499c4e0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WriteConcern = exports.WRITE_CONCERN_KEYS = void 0; +exports.throwIfWriteConcernError = throwIfWriteConcernError; +const responses_1 = require("./cmap/wire_protocol/responses"); +const error_1 = require("./error"); +exports.WRITE_CONCERN_KEYS = ['w', 'wtimeout', 'j', 'journal', 'fsync']; +/** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * @public + * + * @see https://www.mongodb.com/docs/manual/reference/write-concern/ + */ +class WriteConcern { + /** + * Constructs a WriteConcern from the write concern properties. + * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * @param wtimeoutMS - specify a time limit to prevent write operations from blocking indefinitely + * @param journal - request acknowledgment that the write operation has been written to the on-disk journal + * @param fsync - equivalent to the j option. Is deprecated and will be removed in the next major version. + */ + constructor(w, wtimeoutMS, journal, fsync) { + if (w != null) { + if (!Number.isNaN(Number(w))) { + this.w = Number(w); + } + else { + this.w = w; + } + } + if (wtimeoutMS != null) { + this.wtimeoutMS = this.wtimeout = wtimeoutMS; + } + if (journal != null) { + this.journal = this.j = journal; + } + if (fsync != null) { + this.journal = this.j = fsync ? true : false; + } + } + /** + * Apply a write concern to a command document. Will modify and return the command. + */ + static apply(command, writeConcern) { + const wc = {}; + // The write concern document sent to the server has w/wtimeout/j fields. + if (writeConcern.w != null) + wc.w = writeConcern.w; + if (writeConcern.wtimeoutMS != null) + wc.wtimeout = writeConcern.wtimeoutMS; + if (writeConcern.journal != null) + wc.j = writeConcern.j; + command.writeConcern = wc; + return command; + } + /** Construct a WriteConcern given an options object. */ + static fromOptions(options, inherit) { + if (options == null) + return undefined; + inherit = inherit ?? {}; + let opts; + if (typeof options === 'string' || typeof options === 'number') { + opts = { w: options }; + } + else if (options instanceof WriteConcern) { + opts = options; + } + else { + opts = options.writeConcern; + } + const parentOpts = inherit instanceof WriteConcern ? inherit : inherit.writeConcern; + const mergedOpts = { ...parentOpts, ...opts }; + const { w = undefined, wtimeout = undefined, j = undefined, fsync = undefined, journal = undefined, wtimeoutMS = undefined } = mergedOpts; + if (w != null || + wtimeout != null || + wtimeoutMS != null || + j != null || + journal != null || + fsync != null) { + return new WriteConcern(w, wtimeout ?? wtimeoutMS, j ?? journal, fsync); + } + return undefined; + } +} +exports.WriteConcern = WriteConcern; +/** Called with either a plain object or MongoDBResponse */ +function throwIfWriteConcernError(response) { + if (typeof response === 'object' && response != null) { + const writeConcernError = responses_1.MongoDBResponse.is(response) && response.has('writeConcernError') + ? response.toObject() + : !responses_1.MongoDBResponse.is(response) && 'writeConcernError' in response + ? response + : null; + if (writeConcernError != null) { + throw new error_1.MongoWriteConcernError(writeConcernError); + } + } +} +//# sourceMappingURL=write_concern.js.map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js.map b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js.map new file mode 100644 index 00000000..4666cec3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/lib/write_concern.js.map @@ -0,0 +1 @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AO,IAAI,IAAI;YACf,KAAK,IAAI,IAAI,EACb,CAAC;YACD,OAAO,IAAI,YAAY,CAAC,CAAC,EAAE,QAAQ,IAAI,UAAU,EAAE,CAAC,IAAI,OAAO,EAAE,KAAK,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1GD,oCA0GC;AAED,2DAA2D;AAC3D,SAAgB,wBAAwB,CAAC,QAAiB;IACxD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrD,MAAM,iBAAiB,GACrB,2BAAe,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC;YAC/D,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACrB,CAAC,CAAC,CAAC,2BAAe,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,mBAAmB,IAAI,QAAQ;gBAChE,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,IAAI,CAAC;QAEb,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;YAC9B,MAAM,IAAI,8BAAsB,CAAC,iBAAwB,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/mongodb.d.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/mongodb.d.ts new file mode 100644 index 00000000..cd5cf6d5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/mongodb.d.ts @@ -0,0 +1,9133 @@ +import type { DeserializeOptions } from 'bson'; +import type { ObjectIdLike } from 'bson'; +import type { SerializeOptions } from 'bson'; +import { Binary } from 'bson'; +import { BSON } from 'bson'; +import { BSONRegExp } from 'bson'; +import { BSONSymbol } from 'bson'; +import { BSONType } from 'bson'; +import { Code } from 'bson'; +import { DBRef } from 'bson'; +import { Decimal128 } from 'bson'; +import { deserialize } from 'bson'; +import { Document } from 'bson'; +import { Double } from 'bson'; +import { Int32 } from 'bson'; +import { Long } from 'bson'; +import { MaxKey } from 'bson'; +import { MinKey } from 'bson'; +import { ObjectId } from 'bson'; +import { serialize } from 'bson'; +import { Timestamp } from 'bson'; +import { UUID } from 'bson'; +import type { SrvRecord } from 'dns'; +import { EventEmitter } from 'events'; +import type { Socket } from 'net'; +import type { TcpNetConnectOpts } from 'net'; +import type * as os from 'os'; +import type { Duplex } from 'stream'; +import { Readable } from 'stream'; +import { Writable } from 'stream'; +import type { ConnectionOptions as ConnectionOptions_2 } from 'tls'; +import type { TLSSocket } from 'tls'; +import type { TLSSocketOptions } from 'tls'; + +/** @public */ +export declare type Abortable = { + /** + * @experimental + * When provided, the corresponding `AbortController` can be used to abort an asynchronous action. + * + * The `signal.reason` value is used as the error thrown. + * + * @remarks + * **NOTE:** If an abort signal aborts an operation while the driver is writing to the underlying + * socket or reading the response from the server, the socket will be closed. + * If signals are aborted at a high rate during socket read/writes this can lead to a high rate of connection reestablishment. + * + * We plan to mitigate this in a future release, please follow NODE-6062 (`timeoutMS` expiration suffers the same limitation). + * + * AbortSignals are likely a best fit for human interactive interruption (ex. ctrl-C) where the frequency + * of cancellation is reasonably low. If a signal is programmatically aborted for 100s of operations you can empty + * the driver's connection pool. + * + * @example + * ```js + * const controller = new AbortController(); + * const { signal } = controller; + * process.on('SIGINT', () => controller.abort(new Error('^C pressed'))); + * + * try { + * const res = await fetch('...', { signal }); + * await collection.findOne(await res.json(), { signal }); + * catch (error) { + * if (error === signal.reason) { + * // signal abort error handling + * } + * } + * ``` + */ + signal?: AbortSignal | undefined; +}; + +/** @public */ +export declare abstract class AbstractCursor extends TypedEventEmitter implements AsyncDisposable { + /* Excluded from this release type: cursorId */ + /* Excluded from this release type: cursorSession */ + /* Excluded from this release type: selectedServer */ + /* Excluded from this release type: cursorNamespace */ + /* Excluded from this release type: documents */ + /* Excluded from this release type: cursorClient */ + /* Excluded from this release type: transform */ + /* Excluded from this release type: initialized */ + /* Excluded from this release type: isClosed */ + /* Excluded from this release type: isKilled */ + /* Excluded from this release type: cursorOptions */ + /* Excluded from this release type: timeoutContext */ + /** @event */ + static readonly CLOSE: "close"; + /* Excluded from this release type: deserializationOptions */ + protected signal: AbortSignal | undefined; + private abortListener; + /* Excluded from this release type: __constructor */ + /** + * The cursor has no id until it receives a response from the initial cursor creating command. + * + * It is non-zero for as long as the database has an open cursor. + * + * The initiating command may receive a zero id if the entire result is in the `firstBatch`. + */ + get id(): Long | undefined; + /* Excluded from this release type: isDead */ + /* Excluded from this release type: client */ + /* Excluded from this release type: server */ + get namespace(): MongoDBNamespace; + get readPreference(): ReadPreference; + get readConcern(): ReadConcern | undefined; + /* Excluded from this release type: session */ + /* Excluded from this release type: session */ + /** + * The cursor is closed and all remaining locally buffered documents have been iterated. + */ + get closed(): boolean; + /** + * A `killCursors` command was attempted on this cursor. + * This is performed if the cursor id is non zero. + */ + get killed(): boolean; + get loadBalanced(): boolean; + /** + * An alias for {@link AbstractCursor.close|AbstractCursor.close()}. + */ + [Symbol.asyncDispose](): Promise; + /** Adds cursor to client's tracking so it will be closed by MongoClient.close() */ + private trackCursor; + /** Returns current buffered documents length */ + bufferedCount(): number; + /** Returns current buffered documents */ + readBufferedDocuments(number?: number): NonNullable[]; + [Symbol.asyncIterator](): AsyncGenerator; + stream(): Readable & AsyncIterable; + hasNext(): Promise; + /** Get the next available document from the cursor, returns null if no more documents are available. */ + next(): Promise; + /** + * Try to get the next available document from the cursor or `null` if an empty batch is returned + */ + tryNext(): Promise; + /** + * Iterates over all the documents for this cursor using the iterator, callback pattern. + * + * If the iterator returns `false`, iteration will stop. + * + * @param iterator - The iteration callback. + * @deprecated - Will be removed in a future release. Use for await...of instead. + */ + forEach(iterator: (doc: TSchema) => boolean | void): Promise; + /** + * Frees any client-side resources used by the cursor. + */ + close(options?: { + timeoutMS?: number; + }): Promise; + /** + * Returns an array of documents. The caller is responsible for making sure that there + * is enough memory to store the results. Note that the array only contains partial + * results when this cursor had been previously accessed. In that case, + * cursor.rewind() can be used to reset the cursor. + */ + toArray(): Promise; + /** + * Add a cursor flag to the cursor + * + * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -. + * @param value - The flag boolean value. + */ + addCursorFlag(flag: CursorFlag, value: boolean): this; + /** + * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. + * + * @remarks + * + * **Note** Cursors use `null` internally to indicate that there are no more documents in the cursor. Providing a mapping + * function that maps values to `null` will result in the cursor closing itself before it has finished iterating + * all documents. This will **not** result in a memory leak, just surprising behavior. For example: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => null); + * + * const documents = await cursor.toArray(); + * // documents is always [], regardless of how many documents are in the collection. + * ``` + * + * Other falsey values are allowed: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => ''); + * + * const documents = await cursor.toArray(); + * // documents is now an array of empty strings + * ``` + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling map, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor = coll.find(); + * const mappedCursor: FindCursor = cursor.map(doc => Object.keys(doc).length); + * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[] + * ``` + * @param transform - The mapping transformation method. + */ + map(transform: (doc: TSchema) => T): AbstractCursor; + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadPreference(readPreference: ReadPreferenceLike): this; + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadConcern(readConcern: ReadConcernLike): this; + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value: number): this; + /** + * Set the batch size for the cursor. + * + * @param value - The number of documents to return per batch. See {@link https://www.mongodb.com/docs/manual/reference/command/find/|find command documentation}. + */ + batchSize(value: number): this; + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind(): void; + /** + * Returns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance + */ + abstract clone(): AbstractCursor; + /* Excluded from this release type: _initialize */ + /* Excluded from this release type: getMore */ + /* Excluded from this release type: cursorInit */ + /* Excluded from this release type: fetchBatch */ + /* Excluded from this release type: cleanup */ + /* Excluded from this release type: hasEmittedClose */ + /* Excluded from this release type: emitClose */ + /* Excluded from this release type: transformDocument */ + /* Excluded from this release type: throwIfInitialized */ +} + +/** @public */ +export declare type AbstractCursorEvents = { + [AbstractCursor.CLOSE](): void; +}; + +/** @public */ +export declare interface AbstractCursorOptions extends BSONSerializeOptions { + session?: ClientSession; + readPreference?: ReadPreferenceLike; + readConcern?: ReadConcernLike; + /** + * Specifies the number of documents to return in each response from MongoDB + */ + batchSize?: number; + /** + * When applicable `maxTimeMS` controls the amount of time the initial command + * that constructs a cursor should take. (ex. find, aggregate, listCollections) + */ + maxTimeMS?: number; + /** + * When applicable `maxAwaitTimeMS` controls the amount of time subsequent getMores + * that a cursor uses to fetch more data should take. (ex. cursor.next()) + */ + maxAwaitTimeMS?: number; + /** + * Comment to apply to the operation. + */ + comment?: unknown; + /** + * By default, MongoDB will automatically close a cursor when the + * client has exhausted all results in the cursor. However, for [capped collections](https://www.mongodb.com/docs/manual/core/capped-collections) + * you may use a Tailable Cursor that remains open after the client exhausts + * the results in the initial cursor. + */ + tailable?: boolean; + /** + * If awaitData is set to true, when the cursor reaches the end of the capped collection, + * MongoDB blocks the query thread for a period of time waiting for new data to arrive. + * When new data is inserted into the capped collection, the blocked thread is signaled + * to wake up and return the next batch to the client. + */ + awaitData?: boolean; + noCursorTimeout?: boolean; + /** Specifies the time an operation will run until it throws a timeout error. See {@link AbstractCursorOptions.timeoutMode} for more details on how this option applies to cursors. */ + timeoutMS?: number; + /** + * @public + * @experimental + * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'` + * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of + * `cursor.next()`. + * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor. + * + * Depending on the type of cursor being used, this option has different default values. + * For non-tailable cursors, this value defaults to `'cursorLifetime'` + * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by + * definition can have an arbitrarily long lifetime. + * + * @example + * ```ts + * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'}); + * for await (const doc of cursor) { + * // process doc + * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but + * // will continue to iterate successfully otherwise, regardless of the number of batches. + * } + * ``` + * + * @example + * ```ts + * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' }); + * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms. + * ``` + */ + timeoutMode?: CursorTimeoutMode; + /* Excluded from this release type: timeoutContext */ +} + +/* Excluded from this release type: AbstractOperation */ + +/** @public */ +export declare type AcceptedFields = { + readonly [key in KeysOfAType]?: AssignableType; +}; + +/** @public */ +export declare type AddToSetOperators = { + $each?: Array>; +}; + +/** + * The **Admin** class is an internal class that allows convenient access to + * the admin functionality and commands for MongoDB. + * + * **ADMIN Cannot directly be instantiated** + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const admin = client.db().admin(); + * const dbInfo = await admin.listDatabases(); + * for (const db of dbInfo.databases) { + * console.log(db.name); + * } + * ``` + */ +export declare class Admin { + /* Excluded from this release type: s */ + /* Excluded from this release type: __constructor */ + /** + * Execute a command + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to execute + * @param options - Optional settings for the command + */ + command(command: Document, options?: RunCommandOptions): Promise; + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + buildInfo(options?: CommandOperationOptions): Promise; + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + serverInfo(options?: CommandOperationOptions): Promise; + /** + * Retrieve this db's server status. + * + * @param options - Optional settings for the command + */ + serverStatus(options?: CommandOperationOptions): Promise; + /** + * Ping the MongoDB server and retrieve results + * + * @param options - Optional settings for the command + */ + ping(options?: CommandOperationOptions): Promise; + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + removeUser(username: string, options?: RemoveUserOptions): Promise; + /** + * Validate an existing collection + * + * @param collectionName - The name of the collection to validate. + * @param options - Optional settings for the command + */ + validateCollection(collectionName: string, options?: ValidateCollectionOptions): Promise; + /** + * List the available databases + * + * @param options - Optional settings for the command + */ + listDatabases(options?: ListDatabasesOptions): Promise; + /** + * Get ReplicaSet status + * + * @param options - Optional settings for the command + */ + replSetGetStatus(options?: CommandOperationOptions): Promise; +} + +/* Excluded from this release type: AdminPrivate */ + +/* Excluded from this release type: AggregateOperation */ + +/** @public */ +export declare interface AggregateOptions extends Omit { + /** allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 \>). */ + allowDiskUse?: boolean; + /** The number of documents to return per batch. See [aggregation documentation](https://www.mongodb.com/docs/manual/reference/command/aggregate). */ + batchSize?: number; + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** Return the query as cursor, on 2.6 \> it returns as a real cursor on pre 2.6 it returns as an emulated cursor. */ + cursor?: Document; + /** + * Specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point. + */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. */ + maxAwaitTimeMS?: number; + /** Specify collation. */ + collation?: CollationOptions; + /** Add an index selection hint to an aggregation command */ + hint?: Hint; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + out?: string; + /** + * Specifies the verbosity mode for the explain output. + * @deprecated This API is deprecated in favor of `collection.aggregate().explain()` + * or `db.aggregate().explain()`. + */ + explain?: ExplainOptions['explain']; + /* Excluded from this release type: timeoutMode */ +} + +/** + * The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB + * allowing for iteration over the results returned from the underlying query. It supports + * one by one document iteration, conversion to an array or can be iterated as a Node 4.X + * or higher stream + * @public + */ +export declare class AggregationCursor extends ExplainableCursor { + readonly pipeline: Document[]; + /* Excluded from this release type: aggregateOptions */ + /* Excluded from this release type: __constructor */ + clone(): AggregationCursor; + map(transform: (doc: TSchema) => T): AggregationCursor; + /* Excluded from this release type: _initialize */ + /** Execute the explain for the cursor */ + explain(): Promise; + explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise; + explain(options: { + timeoutMS?: number; + }): Promise; + explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions, options: { + timeoutMS?: number; + }): Promise; + /** Add a stage to the aggregation pipeline + * @example + * ``` + * const documents = await users.aggregate().addStage({ $match: { name: /Mike/ } }).toArray(); + * ``` + * @example + * ``` + * const documents = await users.aggregate() + * .addStage<{ name: string }>({ $project: { name: true } }) + * .toArray(); // type of documents is { name: string }[] + * ``` + */ + addStage(stage: Document): this; + addStage(stage: Document): AggregationCursor; + /** Add a group stage to the aggregation pipeline */ + group($group: Document): AggregationCursor; + /** Add a limit stage to the aggregation pipeline */ + limit($limit: number): this; + /** Add a match stage to the aggregation pipeline */ + match($match: Document): this; + /** Add an out stage to the aggregation pipeline */ + out($out: { + db: string; + coll: string; + } | string): this; + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: AggregationCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.aggregate().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project($project: Document): AggregationCursor; + /** Add a lookup stage to the aggregation pipeline */ + lookup($lookup: Document): this; + /** Add a redact stage to the aggregation pipeline */ + redact($redact: Document): this; + /** Add a skip stage to the aggregation pipeline */ + skip($skip: number): this; + /** Add a sort stage to the aggregation pipeline */ + sort($sort: Sort): this; + /** Add a unwind stage to the aggregation pipeline */ + unwind($unwind: Document | string): this; + /** Add a geoNear stage to the aggregation pipeline */ + geoNear($geoNear: Document): this; +} + +/** @public */ +export declare interface AggregationCursorOptions extends AbstractCursorOptions, AggregateOptions { +} + +/** + * It is possible to search using alternative types in mongodb e.g. + * string types can be searched using a regex in mongo + * array types can be searched using their element type + * @public + */ +export declare type AlternativeType = T extends ReadonlyArray ? T | RegExpOrString : RegExpOrString; + +/** @public */ +export declare type AnyBulkWriteOperation = { + insertOne: InsertOneModel; +} | { + replaceOne: ReplaceOneModel; +} | { + updateOne: UpdateOneModel; +} | { + updateMany: UpdateManyModel; +} | { + deleteOne: DeleteOneModel; +} | { + deleteMany: DeleteManyModel; +}; + +/** + * Used to represent any of the client bulk write models that can be passed as an array + * to MongoClient#bulkWrite. + * @public + */ +export declare type AnyClientBulkWriteModel = ClientInsertOneModel | ClientReplaceOneModel | ClientUpdateOneModel | ClientUpdateManyModel | ClientDeleteOneModel | ClientDeleteManyModel; + +/** @public */ +export declare type AnyError = MongoError | Error; + +/** @public */ +export declare type ArrayElement = Type extends ReadonlyArray ? Item : never; + +/** @public */ +export declare type ArrayOperator = { + $each?: Array>; + $slice?: number; + $position?: number; + $sort?: Sort; +}; + +/** @public */ +export declare interface Auth { + /** The username for auth */ + username?: string; + /** The password for auth */ + password?: string; +} + +/* Excluded from this release type: AuthContext */ + +/** @public */ +export declare const AuthMechanism: Readonly<{ + readonly MONGODB_AWS: "MONGODB-AWS"; + readonly MONGODB_DEFAULT: "DEFAULT"; + readonly MONGODB_GSSAPI: "GSSAPI"; + readonly MONGODB_PLAIN: "PLAIN"; + readonly MONGODB_SCRAM_SHA1: "SCRAM-SHA-1"; + readonly MONGODB_SCRAM_SHA256: "SCRAM-SHA-256"; + readonly MONGODB_X509: "MONGODB-X509"; + readonly MONGODB_OIDC: "MONGODB-OIDC"; +}>; + +/** @public */ +export declare type AuthMechanism = (typeof AuthMechanism)[keyof typeof AuthMechanism]; + +/** @public */ +export declare interface AuthMechanismProperties extends Document { + SERVICE_HOST?: string; + SERVICE_NAME?: string; + SERVICE_REALM?: string; + CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue; + /* Excluded from this release type: AWS_SESSION_TOKEN */ + /** A user provided OIDC machine callback function. */ + OIDC_CALLBACK?: OIDCCallbackFunction; + /** A user provided OIDC human interacted callback function. */ + OIDC_HUMAN_CALLBACK?: OIDCCallbackFunction; + /** The OIDC environment. Note that 'test' is for internal use only. */ + ENVIRONMENT?: 'test' | 'azure' | 'gcp' | 'k8s'; + /** Allowed hosts that OIDC auth can connect to. */ + ALLOWED_HOSTS?: string[]; + /** The resource token for OIDC auth in Azure and GCP. */ + TOKEN_RESOURCE?: string; + /** + * A custom AWS credential provider to use. An example using the AWS SDK default provider chain: + * + * ```ts + * const client = new MongoClient(process.env.MONGODB_URI, { + * authMechanismProperties: { + * AWS_CREDENTIAL_PROVIDER: fromNodeProviderChain() + * } + * }); + * ``` + * + * Using a custom function that returns AWS credentials: + * + * ```ts + * const client = new MongoClient(process.env.MONGODB_URI, { + * authMechanismProperties: { + * AWS_CREDENTIAL_PROVIDER: async () => { + * return { + * accessKeyId: process.env.ACCESS_KEY_ID, + * secretAccessKey: process.env.SECRET_ACCESS_KEY + * } + * } + * } + * }); + * ``` + */ + AWS_CREDENTIAL_PROVIDER?: AWSCredentialProvider; +} + +/* Excluded from this release type: AuthProvider */ + +/* Excluded from this release type: AutoEncrypter */ + +/** + * @public + * + * Extra options related to the mongocryptd process + * \* _Available in MongoDB 6.0 or higher._ + */ +export declare type AutoEncryptionExtraOptions = NonNullable; + +/** @public */ +export declare const AutoEncryptionLoggerLevel: Readonly<{ + readonly FatalError: 0; + readonly Error: 1; + readonly Warning: 2; + readonly Info: 3; + readonly Trace: 4; +}>; + +/** + * @public + * The level of severity of the log message + * + * | Value | Level | + * |-------|-------| + * | 0 | Fatal Error | + * | 1 | Error | + * | 2 | Warning | + * | 3 | Info | + * | 4 | Trace | + */ +export declare type AutoEncryptionLoggerLevel = (typeof AutoEncryptionLoggerLevel)[keyof typeof AutoEncryptionLoggerLevel]; + +/** @public */ +export declare interface AutoEncryptionOptions { + /* Excluded from this release type: metadataClient */ + /** A `MongoClient` used to fetch keys from a key vault */ + keyVaultClient?: MongoClient; + /** The namespace where keys are stored in the key vault */ + keyVaultNamespace?: string; + /** Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. */ + kmsProviders?: KMSProviders; + /** Configuration options for custom credential providers. */ + credentialProviders?: CredentialProviders; + /** + * A map of namespaces to a local JSON schema for encryption + * + * **NOTE**: Supplying options.schemaMap provides more security than relying on JSON Schemas obtained from the server. + * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending decrypted data that should be encrypted. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption. + * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. + */ + schemaMap?: Document; + /** Supply a schema for the encrypted fields in the document */ + encryptedFieldsMap?: Document; + /** Allows the user to bypass auto encryption, maintaining implicit decryption */ + bypassAutoEncryption?: boolean; + /** Allows users to bypass query analysis */ + bypassQueryAnalysis?: boolean; + /** + * Sets the expiration time for the DEK in the cache in milliseconds. Defaults to 60000. 0 means no timeout. + */ + keyExpirationMS?: number; + options?: { + /** An optional hook to catch logging messages from the underlying encryption engine */ + logger?: (level: AutoEncryptionLoggerLevel, message: string) => void; + }; + extraOptions?: { + /** + * A local process the driver communicates with to determine how to encrypt values in a command. + * Defaults to "mongodb://%2Fvar%2Fmongocryptd.sock" if domain sockets are available or "mongodb://localhost:27020" otherwise + */ + mongocryptdURI?: string; + /** If true, autoEncryption will not attempt to spawn a mongocryptd before connecting */ + mongocryptdBypassSpawn?: boolean; + /** The path to the mongocryptd executable on the system */ + mongocryptdSpawnPath?: `${string}mongocryptd${'.exe' | ''}`; + /** Command line arguments to use when auto-spawning a mongocryptd */ + mongocryptdSpawnArgs?: string[]; + /** + * Full path to a MongoDB Crypt shared library to be used (instead of mongocryptd). + * + * This needs to be the path to the file itself, not a directory. + * It can be an absolute or relative path. If the path is relative and + * its first component is `$ORIGIN`, it will be replaced by the directory + * containing the mongodb-client-encryption native addon file. Otherwise, + * the path will be interpreted relative to the current working directory. + * + * Currently, loading different MongoDB Crypt shared library files from different + * MongoClients in the same process is not supported. + * + * If this option is provided and no MongoDB Crypt shared library could be loaded + * from the specified location, creating the MongoClient will fail. + * + * If this option is not provided and `cryptSharedLibRequired` is not specified, + * the AutoEncrypter will attempt to spawn and/or use mongocryptd according + * to the mongocryptd-specific `extraOptions` options. + * + * Specifying a path prevents mongocryptd from being used as a fallback. + * + * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibPath?: `${string}mongo_crypt_v${number}.${'so' | 'dll' | 'dylib'}`; + /** + * If specified, never use mongocryptd and instead fail when the MongoDB Crypt + * shared library could not be loaded. + * + * This is always true when `cryptSharedLibPath` is specified. + * + * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibRequired?: boolean; + /* Excluded from this release type: cryptSharedLibSearchPaths */ + }; + proxyOptions?: ProxyOptions; + /** The TLS options to use connecting to the KMS provider */ + tlsOptions?: CSFLEKMSTlsOptions; + /** + * A callback that establishes the socket used to connect to a KMS host, e.g. to route KMS + * requests through an HTTP proxy via the HTTP CONNECT method. Mutually exclusive with `proxyOptions`. + * See {@link KMSConnectCallback} for a usage example. + */ + kmsConnectCallback?: KMSConnectCallback; +} + +/** @public **/ +export declare type AWSCredentialProvider = () => Promise; + +/** + * @public + * Copy of the AwsCredentialIdentityProvider interface from [`smithy/types`](https://socket.dev/npm/package/\@smithy/types/files/1.1.1/dist-types/identity/awsCredentialIdentity.d.ts), + * the return type of the aws-sdk's `fromNodeProviderChain().provider()`. + */ +export declare interface AWSCredentials { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; +} + +/** + * @public + * Configuration options for making an AWS encryption key + */ +export declare interface AWSEncryptionKeyOptions { + /** + * The AWS region of the KMS + */ + region: string; + /** + * The Amazon Resource Name (ARN) to the AWS customer master key (CMK) + */ + key: string; + /** + * An alternate host to send KMS requests to. May include port number. + */ + endpoint?: string | undefined; +} + +/** @public */ +export declare interface AWSKMSProviderConfiguration { + /** + * The access key used for the AWS KMS provider + */ + accessKeyId: string; + /** + * The secret access key used for the AWS KMS provider + */ + secretAccessKey: string; + /** + * An optional AWS session token that will be used as the + * X-Amz-Security-Token header for AWS requests. + */ + sessionToken?: string; +} + +/** + * @public + * Configuration options for making an Azure encryption key + */ +export declare interface AzureEncryptionKeyOptions { + /** + * Key name + */ + keyName: string; + /** + * Key vault URL, typically `.vault.azure.net` + */ + keyVaultEndpoint: string; + /** + * Key version + */ + keyVersion?: string | undefined; +} + +/** @public */ +export declare type AzureKMSProviderConfiguration = { + /** + * The tenant ID identifies the organization for the account + */ + tenantId: string; + /** + * The client ID to authenticate a registered application + */ + clientId: string; + /** + * The client secret to authenticate a registered application + */ + clientSecret: string; + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * This is optional, and only needed if customer is using a non-commercial Azure instance + * (e.g. a government or China account, which use different URLs). + * Defaults to "login.microsoftonline.com" + */ + identityPlatformEndpoint?: string | undefined; +} | { + /** + * If present, an access token to authenticate with Azure. + */ + accessToken: string; +}; + +/** + * Keeps the state of a unordered batch so we can rewrite the results + * correctly after command execution + * + * @public + */ +export declare class Batch { + originalZeroIndex: number; + currentIndex: number; + originalIndexes: number[]; + batchType: BatchType; + operations: T[]; + serializedOperations: Uint8Array[]; + size: number; + sizeBytes: number; + constructor(batchType: BatchType, originalZeroIndex: number); +} + +/** @public */ +export declare const BatchType: Readonly<{ + readonly INSERT: 1; + readonly UPDATE: 2; + readonly DELETE: 3; +}>; + +/** @public */ +export declare type BatchType = (typeof BatchType)[keyof typeof BatchType]; + +export { Binary } + +/** @public */ +export declare type BitwiseFilter = number /** numeric bit mask */ | Binary /** BinData bit mask */ | ReadonlyArray; + +export { BSON } + +/* Excluded from this release type: BSONElement */ +export { BSONRegExp } + +/** + * BSON Serialization options. + * @public + */ +export declare interface BSONSerializeOptions extends Omit, Omit { + /** + * Enabling the raw option will return a [Node.js Buffer](https://nodejs.org/api/buffer.html) + * which is allocated using [allocUnsafe API](https://nodejs.org/api/buffer.html#static-method-bufferallocunsafesize). + * See this section from the [Node.js Docs here](https://nodejs.org/api/buffer.html#what-makes-bufferallocunsafe-and-bufferallocunsafeslow-unsafe) + * for more detail about what "unsafe" refers to in this context. + * If you need to maintain your own editable clone of the bytes returned for an extended life time of the process, it is recommended you allocate + * your own buffer and clone the contents: + * + * @example + * ```ts + * const raw = await collection.findOne({}, { raw: true }); + * const myBuffer = Buffer.alloc(raw.byteLength); + * myBuffer.set(raw, 0); + * // Only save and use `myBuffer` beyond this point + * ``` + * + * @remarks + * Please note there is a known limitation where this option cannot be used at the MongoClient level (see [NODE-3946](https://jira.mongodb.org/browse/NODE-3946)). + * It does correctly work at `Db`, `Collection`, and per operation the same as other BSON options work. + */ + raw?: boolean; + /** Enable utf8 validation when deserializing BSON documents. Defaults to true. */ + enableUtf8Validation?: boolean; +} + +export { BSONSymbol } + +export { BSONType } + +/** @public */ +export declare type BSONTypeAlias = keyof typeof BSONType; + +/* Excluded from this release type: BufferPool */ + +/** @public */ +export declare abstract class BulkOperationBase { + isOrdered: boolean; + /* Excluded from this release type: s */ + operationId?: number; + private collection; + /* Excluded from this release type: retryWrites */ + /* Excluded from this release type: __constructor */ + /** + * Add a single insert document to the bulk operation + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Adds three inserts to the bulkOp. + * bulkOp + * .insert({ a: 1 }) + * .insert({ b: 2 }) + * .insert({ c: 3 }); + * await bulkOp.execute(); + * ``` + */ + insert(document: Document): BulkOperationBase; + /** + * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. + * Returns a builder object used to complete the definition of the operation. + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Add an updateOne to the bulkOp + * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } }); + * + * // Add an updateMany to the bulkOp + * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } }); + * + * // Add an upsert + * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } }); + * + * // Add a deletion + * bulkOp.find({ g: 7 }).deleteOne(); + * + * // Add a multi deletion + * bulkOp.find({ h: 8 }).delete(); + * + * // Add a replaceOne + * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }}); + * + * // Update using a pipeline + * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([ + * { $set: { total: { $sum: [ '$y', '$z' ] } } } + * ]); + * + * // All of the ops will now be executed + * await bulkOp.execute(); + * ``` + */ + find(selector: Document): FindOperators; + /** Specifies a raw operation to perform in the bulk write. */ + raw(op: AnyBulkWriteOperation): this; + get length(): number; + get bsonOptions(): BSONSerializeOptions; + get writeConcern(): WriteConcern | undefined; + get batches(): Batch[]; + execute(options?: BulkWriteOptions): Promise; + /* Excluded from this release type: handleWriteError */ + abstract addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this; + private shouldForceServerObjectId; +} + +/* Excluded from this release type: BulkOperationPrivate */ + +/* Excluded from this release type: BulkResult */ + +/** @public */ +export declare interface BulkWriteOperationError { + index: number; + code: number; + errmsg: string; + errInfo: Document; + op: Document | UpdateStatement | DeleteStatement; +} + +/** @public */ +export declare interface BulkWriteOptions extends CommandOperationOptions { + /** + * Allow driver to bypass schema validation. + * @defaultValue `false` - documents will be validated by default + **/ + bypassDocumentValidation?: boolean; + /** + * If true, when an insert fails, don't execute the remaining writes. + * If false, continue with remaining inserts when one fails. + * @defaultValue `true` - inserts are ordered by default + */ + ordered?: boolean; + /** + * Force server to assign _id values instead of driver. + * @defaultValue `false` - the driver generates `_id` fields by default + **/ + forceServerObjectId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /* Excluded from this release type: timeoutContext */ +} + +/** + * @public + * The result of a bulk write. + */ +export declare class BulkWriteResult { + private readonly result; + /** Number of documents inserted. */ + readonly insertedCount: number; + /** Number of documents matched for update. */ + readonly matchedCount: number; + /** Number of documents modified. */ + readonly modifiedCount: number; + /** Number of documents deleted. */ + readonly deletedCount: number; + /** Number of documents upserted. */ + readonly upsertedCount: number; + /** Upserted document generated Id's, hash key is the index of the originating operation */ + readonly upsertedIds: { + [key: number]: any; + }; + /** Inserted document generated Id's, hash key is the index of the originating operation */ + readonly insertedIds: { + [key: number]: any; + }; + private static generateIdMap; + /* Excluded from this release type: __constructor */ + /** Evaluates to true if the bulk operation correctly executes */ + get ok(): number; + /* Excluded from this release type: getSuccessfullyInsertedIds */ + /** Returns the upserted id at the given index */ + getUpsertedIdAt(index: number): Document | undefined; + /** Returns raw internal result */ + getRawResponse(): Document; + /** Returns true if the bulk operation contains a write error */ + hasWriteErrors(): boolean; + /** Returns the number of write errors from the bulk operation */ + getWriteErrorCount(): number; + /** Returns a specific write error object */ + getWriteErrorAt(index: number): WriteError | undefined; + /** Retrieve all write errors */ + getWriteErrors(): WriteError[]; + /** Retrieve the write concern error if one exists */ + getWriteConcernError(): WriteConcernError | undefined; + toString(): string; + isOk(): boolean; +} + +/** + * MongoDB Driver style callback + * @public + */ +export declare type Callback = (error?: AnyError, result?: T) => void; + +/* Excluded from this release type: CancellationToken */ + +/** + * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}. + * @public + */ +export declare class ChangeStream> extends TypedEventEmitter> implements AsyncDisposable { + /** + * An alias for {@link ChangeStream.close|ChangeStream.close()}. + */ + [Symbol.asyncDispose](): Promise; + pipeline: Document[]; + /** + * @remarks WriteConcern can still be present on the options because + * we inherit options from the client/db/collection. The + * key must be present on the options in order to delete it. + * This allows typescript to delete the key but will + * not allow a writeConcern to be assigned as a property on options. + */ + options: ChangeStreamOptions & { + writeConcern?: never; + }; + parent: MongoClient | Db | Collection; + namespace: MongoDBNamespace; + type: symbol; + /* Excluded from this release type: cursor */ + /* Excluded from this release type: cursorStream */ + /* Excluded from this release type: isClosed */ + /* Excluded from this release type: mode */ + /** @event */ + static readonly RESPONSE: "response"; + /** @event */ + static readonly MORE: "more"; + /** @event */ + static readonly INIT: "init"; + /** @event */ + static readonly CLOSE: "close"; + /** + * Fired for each new matching change in the specified namespace. Attaching a `change` + * event listener to a Change Stream will switch the stream into flowing mode. Data will + * then be passed as soon as it is available. + * @event + */ + static readonly CHANGE: "change"; + /** @event */ + static readonly END: "end"; + /** @event */ + static readonly ERROR: "error"; + /** + * Emitted each time the change stream stores a new resume token. + * @event + */ + static readonly RESUME_TOKEN_CHANGED: "resumeTokenChanged"; + private timeoutContext?; + /** + * Note that this property is here to uniquely identify a ChangeStream instance as the owner of + * the {@link CursorTimeoutContext} instance (see {@link ChangeStream._createChangeStreamCursor}) to ensure + * that {@link AbstractCursor.close} does not mutate the timeoutContext. + */ + private contextOwner; + /* Excluded from this release type: __constructor */ + /** The cached resume token that is used to resume after the most recently returned change. */ + get resumeToken(): ResumeToken; + /** Returns the currently buffered documents length of the underlying cursor. */ + bufferedCount(): number; + /** Check if there is any document still available in the Change Stream */ + hasNext(): Promise; + /** Get the next available document from the Change Stream. */ + next(): Promise; + /** + * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned + */ + tryNext(): Promise; + [Symbol.asyncIterator](): AsyncGenerator; + /** Is the cursor closed */ + get closed(): boolean; + /** + * Frees the internal resources used by the change stream. + */ + close(): Promise; + /** + * Return a modified Readable stream including a possible transform method. + * + * NOTE: When using a Stream to process change stream events, the stream will + * NOT automatically resume in the case a resumable error is encountered. + * + * @throws MongoChangeStreamError if the underlying cursor or the change stream is closed + */ + stream(): Readable & AsyncIterable; + /* Excluded from this release type: _setIsEmitter */ + /* Excluded from this release type: _setIsIterator */ + /* Excluded from this release type: _createChangeStreamCursor */ + /* Excluded from this release type: _closeEmitterModeWithError */ + /* Excluded from this release type: _streamEvents */ + /* Excluded from this release type: _endStream */ + /* Excluded from this release type: _processChange */ + /* Excluded from this release type: _processErrorStreamMode */ + /* Excluded from this release type: _processErrorIteratorMode */ + private _resume; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/modify/#mongodb-data-modify + */ +export declare interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'modify'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/create/#mongodb-data-create + */ +export declare interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'create'; + /** + * The type of the newly created object. + * + * @sinceServerVersion 8.1.0 + */ + nsType?: 'collection' | 'timeseries' | 'view'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/createIndexes/#mongodb-data-createIndexes + */ +export declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'createIndexes'; +} + +/* Excluded from this release type: ChangeStreamCursor */ + +/* Excluded from this release type: ChangeStreamCursorOptions */ + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#delete-event + */ +export declare interface ChangeStreamDeleteDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'delete'; + /** Namespace the delete event occurred on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** @public */ +export declare type ChangeStreamDocument = ChangeStreamInsertDocument | ChangeStreamUpdateDocument | ChangeStreamReplaceDocument | ChangeStreamDeleteDocument | ChangeStreamDropDocument | ChangeStreamRenameDocument | ChangeStreamDropDatabaseDocument | ChangeStreamInvalidateDocument | ChangeStreamCreateIndexDocument | ChangeStreamCreateDocument | ChangeStreamCollModDocument | ChangeStreamDropIndexDocument | ChangeStreamShardCollectionDocument | ChangeStreamReshardCollectionDocument | ChangeStreamRefineCollectionShardKeyDocument; + +/** @public */ +export declare interface ChangeStreamDocumentCollectionUUID { + /** + * The UUID (Binary subtype 4) of the collection that the operation was performed on. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * **NOTE:** collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers + * flag is enabled. + * + * @sinceServerVersion 6.1.0 + */ + collectionUUID: Binary; +} + +/** @public */ +export declare interface ChangeStreamDocumentCommon { + /** + * The id functions as an opaque token for use when resuming an interrupted + * change stream. + */ + _id: ResumeToken; + /** + * The timestamp from the oplog entry associated with the event. + * For events that happened as part of a multi-document transaction, the associated change stream + * notifications will have the same clusterTime value, namely the time when the transaction was committed. + * On a sharded cluster, events that occur on different shards can have the same clusterTime but be + * associated with different transactions or even not be associated with any transaction. + * To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document. + */ + clusterTime?: Timestamp; + /** + * The transaction number. + * Only present if the operation is part of a multi-document transaction. + * + * **NOTE:** txnNumber can be a Long if promoteLongs is set to false + */ + txnNumber?: number; + /** + * The identifier for the session associated with the transaction. + * Only present if the operation is part of a multi-document transaction. + */ + lsid?: ServerSessionId; + /** + * When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent + * stage, events larger than 16MB will be split into multiple events and contain the + * following information about which fragment the current event is. + */ + splitEvent?: ChangeStreamSplitEvent; +} + +/** @public */ +export declare interface ChangeStreamDocumentKey { + /** + * For unsharded collections this contains a single field `_id`. + * For sharded collections, this will contain all the components of the shard key + */ + documentKey: { + _id: InferIdType; + [shardKey: string]: any; + }; +} + +/** @public */ +export declare interface ChangeStreamDocumentOperationDescription { + /** + * An description of the operation. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * @sinceServerVersion 6.1.0 + */ + operationDescription?: Document; +} + +/** @public */ +export declare interface ChangeStreamDocumentWallTime { + /** + * The server date and time of the database operation. + * wallTime differs from clusterTime in that clusterTime is a timestamp taken from the oplog entry associated with the database operation event. + * @sinceServerVersion 6.0.0 + */ + wallTime?: Date; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event + */ +export declare interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropDatabase'; + /** The database dropped */ + ns: { + db: string; + }; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#drop-event + */ +export declare interface ChangeStreamDropDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'drop'; + /** Namespace the drop event occurred on */ + ns: ChangeStreamNameSpace; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/dropIndexes/#mongodb-data-dropIndexes + */ +export declare interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropIndexes'; +} + +/** @public */ +export declare type ChangeStreamEvents> = { + resumeTokenChanged(token: ResumeToken): void; + init(response: any): void; + more(response?: any): void; + response(): void; + end(): void; + error(error: Error): void; + change(change: TChange): void; + /** + * @remarks Note that the `close` event is currently emitted whenever the internal `ChangeStreamCursor` + * instance is closed, which can occur multiple times for a given `ChangeStream` instance. + * + * TODO(NODE-6434): address this issue in NODE-6434 + */ + close(): void; +}; + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#insert-event + */ +export declare interface ChangeStreamInsertDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'insert'; + /** This key will contain the document being inserted */ + fullDocument: TSchema; + /** Namespace the insert event occurred on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event + */ +export declare interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'invalidate'; +} + +/** @public */ +export declare interface ChangeStreamNameSpace { + db: string; + coll: string; +} + +/** + * Options that can be passed to a ChangeStream. Note that startAfter, resumeAfter, and startAtOperationTime are all mutually exclusive, and the server will error if more than one is specified. + * @public + */ +export declare interface ChangeStreamOptions extends Omit { + /** + * Allowed values: 'updateLookup', 'whenAvailable', 'required'. + * + * When set to 'updateLookup', the change notification for partial updates + * will include both a delta describing the changes to the document as well + * as a copy of the entire document that was changed from some time after + * the change occurred. + * + * When set to 'whenAvailable', configures the change stream to return the + * post-image of the modified document for replace and update change events + * if the post-image for this event is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the post-image is not available. + */ + fullDocument?: string; + /** + * Allowed values: 'whenAvailable', 'required', 'off'. + * + * The default is to not send a value, which is equivalent to 'off'. + * + * When set to 'whenAvailable', configures the change stream to return the + * pre-image of the modified document for replace, update, and delete change + * events if it is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the pre-image is not available. + */ + fullDocumentBeforeChange?: string; + /** The maximum amount of time for the server to wait on new documents to satisfy a change stream query. */ + maxAwaitTimeMS?: number; + /** + * Allows you to start a changeStream after a specified event. + * @see https://www.mongodb.com/docs/manual/changeStreams/#resumeafter-for-change-streams + */ + resumeAfter?: ResumeToken; + /** + * Similar to resumeAfter, but will allow you to start after an invalidated event. + * @see https://www.mongodb.com/docs/manual/changeStreams/#startafter-for-change-streams + */ + startAfter?: ResumeToken; + /** Will start the changeStream after the specified operationTime. */ + startAtOperationTime?: OperationTime; + /** + * The number of documents to return per batch. + * @see https://www.mongodb.com/docs/manual/reference/command/aggregate + */ + batchSize?: number; + /** + * When enabled, configures the change stream to include extra change events. + * + * - createIndexes + * - dropIndexes + * - modify + * - create + * - shardCollection + * - reshardCollection + * - refineCollectionShardKey + */ + showExpandedEvents?: boolean; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/refineCollectionShardKey/#mongodb-data-refineCollectionShardKey + */ +export declare interface ChangeStreamRefineCollectionShardKeyDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'refineCollectionShardKey'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#rename-event + */ +export declare interface ChangeStreamRenameDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'rename'; + /** The new name for the `ns.coll` collection */ + to: { + db: string; + coll: string; + }; + /** The "from" namespace that the rename occurred on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#replace-event + */ +export declare interface ChangeStreamReplaceDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'replace'; + /** The fullDocument of a replace event represents the document after the insert of the replacement document */ + fullDocument: TSchema; + /** Namespace the replace event occurred on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/reshardCollection/#mongodb-data-reshardCollection + */ +export declare interface ChangeStreamReshardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'reshardCollection'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/shardCollection/#mongodb-data-shardCollection + */ +export declare interface ChangeStreamShardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'shardCollection'; +} + +/** @public */ +export declare interface ChangeStreamSplitEvent { + /** Which fragment of the change this is. */ + fragment: number; + /** The total number of fragments. */ + of: number; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#update-event + */ +export declare interface ChangeStreamUpdateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'update'; + /** + * This is only set if `fullDocument` is set to `'updateLookup'` + * Contains the point-in-time post-image of the modified document if the + * post-image is available and either 'required' or 'whenAvailable' was + * specified for the 'fullDocument' option when creating the change stream. + */ + fullDocument?: TSchema; + /** Contains a description of updated and removed fields in this operation */ + updateDescription: UpdateDescription; + /** Namespace the update event occurred on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** @public */ +export declare interface ClientBulkWriteError { + code: number; + message: string; +} + +/** + * A mapping of namespace strings to collections schemas. + * @public + * + * @example + * ```ts + * type MongoDBSchemas = { + * 'db.books': Book; + * 'db.authors': Author; + * } + * + * const model: ClientBulkWriteModel = { + * namespace: 'db.books' + * name: 'insertOne', + * document: { title: 'Practical MongoDB Aggregations', authorName: 3 } // error `authorName` cannot be number + * }; + * ``` + * + * The type of the `namespace` field narrows other parts of the BulkWriteModel to use the correct schema for type assertions. + * + */ +export declare type ClientBulkWriteModel = Record> = { + [Namespace in keyof SchemaMap]: AnyClientBulkWriteModel & { + namespace: Namespace; + }; +}[keyof SchemaMap]; + +/** @public */ +export declare interface ClientBulkWriteOptions extends CommandOperationOptions { + /** + * If true, when an insert fails, don't execute the remaining writes. + * If false, continue with remaining inserts when one fails. + * @defaultValue `true` - inserts are ordered by default + */ + ordered?: boolean; + /** + * Allow driver to bypass schema validation. + * @defaultValue `false` - documents will be validated by default + **/ + bypassDocumentValidation?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Whether detailed results for each successful operation should be included in the returned + * BulkWriteResult. + */ + verboseResults?: boolean; +} + +/** @public */ +export declare interface ClientBulkWriteResult { + /** + * Whether the bulk write was acknowledged. + */ + readonly acknowledged: boolean; + /** + * The total number of documents inserted across all insert operations. + */ + readonly insertedCount: number; + /** + * The total number of documents upserted across all update operations. + */ + readonly upsertedCount: number; + /** + * The total number of documents matched across all update operations. + */ + readonly matchedCount: number; + /** + * The total number of documents modified across all update operations. + */ + readonly modifiedCount: number; + /** + * The total number of documents deleted across all delete operations. + */ + readonly deletedCount: number; + /** + * The results of each individual insert operation that was successfully performed. + */ + readonly insertResults?: ReadonlyMap; + /** + * The results of each individual update operation that was successfully performed. + */ + readonly updateResults?: ReadonlyMap; + /** + * The results of each individual delete operation that was successfully performed. + */ + readonly deleteResults?: ReadonlyMap; +} + +/** @public */ +export declare interface ClientDeleteManyModel extends ClientWriteModel { + name: 'deleteMany'; + /** + * The filter used to determine if a document should be deleted. + * For a deleteMany operation, all matches are removed. + */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export declare interface ClientDeleteOneModel extends ClientWriteModel { + name: 'deleteOne'; + /** + * The filter used to determine if a document should be deleted. + * For a deleteOne operation, the first match is removed. + */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export declare interface ClientDeleteResult { + /** + * The number of documents that were deleted. + */ + deletedCount: number; +} + +/** + * @public + * The public interface for explicit in-use encryption + */ +export declare class ClientEncryption { + /* Excluded from this release type: _client */ + /* Excluded from this release type: _keyVaultNamespace */ + /* Excluded from this release type: _keyVaultClient */ + /* Excluded from this release type: _proxyOptions */ + /* Excluded from this release type: _tlsOptions */ + /* Excluded from this release type: _kmsConnectCallback */ + /* Excluded from this release type: _kmsProviders */ + /* Excluded from this release type: _timeoutMS */ + /* Excluded from this release type: _mongoCrypt */ + /* Excluded from this release type: _credentialProviders */ + /* Excluded from this release type: getMongoCrypt */ + /** + * Create a new encryption instance + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * local: { + * key: masterKey // The master key used for encryption/decryption. A 96-byte long Buffer + * } + * } + * }); + * ``` + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * aws: { + * accessKeyId: AWS_ACCESS_KEY, + * secretAccessKey: AWS_SECRET_KEY + * } + * } + * }); + * ``` + */ + constructor(client: MongoClient, options: ClientEncryptionOptions); + /** + * Creates a data key used for explicit encryption and inserts it into the key vault namespace + * + * @example + * ```ts + * // Using async/await to create a local key + * const dataKeyId = await clientEncryption.createDataKey('local'); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * } + * }); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key with a keyAltName + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * }, + * keyAltNames: [ 'mySpecialKey' ] + * }); + * ``` + */ + createDataKey(provider: ClientEncryptionDataKeyProvider, options?: ClientEncryptionCreateDataKeyProviderOptions): Promise; + /** + * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options. + * + * If no matches are found, then no bulk write is performed. + * + * @example + * ```ts + * // rewrapping all data data keys (using a filter that matches all documents) + * const filter = {}; + * + * const result = await clientEncryption.rewrapManyDataKey(filter); + * if (result.bulkWriteResult != null) { + * // keys were re-wrapped, results will be available in the bulkWrite object. + * } + * ``` + * + * @example + * ```ts + * // attempting to rewrap all data keys with no matches + * const filter = { _id: new Binary() } // assume _id matches no documents in the database + * const result = await clientEncryption.rewrapManyDataKey(filter); + * + * if (result.bulkWriteResult == null) { + * // no keys matched, `bulkWriteResult` does not exist on the result object + * } + * ``` + */ + rewrapManyDataKey(filter: Filter, options?: ClientEncryptionRewrapManyDataKeyProviderOptions): Promise<{ + bulkWriteResult?: BulkWriteResult; + }>; + /** + * Deletes the key with the provided id from the keyvault, if it exists. + * + * @example + * ```ts + * // delete a key by _id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const { deletedCount } = await clientEncryption.deleteKey(id); + * + * if (deletedCount != null && deletedCount > 0) { + * // successful deletion + * } + * ``` + * + */ + deleteKey(_id: Binary): Promise; + /** + * Finds all the keys currently stored in the keyvault. + * + * This method will not throw. + * + * @returns a FindCursor over all keys in the keyvault. + * @example + * ```ts + * // fetching all keys + * const keys = await clientEncryption.getKeys().toArray(); + * ``` + */ + getKeys(): FindCursor; + /** + * Finds a key in the keyvault with the specified _id. + * + * Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // getting a key by id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const key = await clientEncryption.getKey(id); + * if (!key) { + * // key is null if there was no matching key + * } + * ``` + */ + getKey(_id: Binary): Promise; + /** + * Finds a key in the keyvault which has the specified keyAltName. + * + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the keyAltName. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // get a key by alt name + * const keyAltName = 'keyAltName'; + * const key = await clientEncryption.getKeyByAltName(keyAltName); + * if (!key) { + * // key is null if there is no matching key + * } + * ``` + */ + getKeyByAltName(keyAltName: string): Promise | null>; + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to adding the new altKeyName). + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // adding an keyAltName to a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.addKeyAltName(id, keyAltName); + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + addKeyAltName(_id: Binary, keyAltName: string): Promise | null>; + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to removing the new altKeyName). + * + * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document. + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // removing a key alt name from a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.removeKeyAltName(id, keyAltName); + * + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + removeKeyAltName(_id: Binary, keyAltName: string): Promise | null>; + /** + * A convenience method for creating an encrypted collection. + * This method will create data keys for any encryptedFields that do not have a `keyId` defined + * and then create a new collection with the full set of encryptedFields. + * + * @param db - A Node.js driver Db object with which to create the collection + * @param name - The name of the collection to be created + * @param options - Options for createDataKey and for createCollection + * @returns created collection and generated encryptedFields + * @throws MongoCryptCreateDataKeyError - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created. + * @throws MongoCryptCreateEncryptedCollectionError - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created. + */ + createEncryptedCollection(db: Db, name: string, options: { + provider: ClientEncryptionDataKeyProvider; + createCollectionOptions: Omit & { + encryptedFields: Document; + }; + masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions; + }): Promise<{ + collection: Collection; + encryptedFields: Document; + }>; + /** + * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must + * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error. + * + * @param value - The value that you wish to serialize. Must be of a type that can be serialized into BSON + * @param options - + * @returns a Promise that either resolves with the encrypted value, or rejects with an error. + * + * @example + * ```ts + * // Encryption with async/await api + * async function encryptMyData(value) { + * const keyId = await clientEncryption.createDataKey('local'); + * return clientEncryption.encrypt(value, { keyId, algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + * + * @example + * ```ts + * // Encryption using a keyAltName + * async function encryptMyData(value) { + * await clientEncryption.createDataKey('local', { keyAltNames: 'mySpecialKey' }); + * return clientEncryption.encrypt(value, { keyAltName: 'mySpecialKey', algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + */ + encrypt(value: unknown, options: ClientEncryptionEncryptOptions): Promise; + /** + * Encrypts a Match Expression or Aggregate Expression to query a range index. + * + * Only supported when queryType is "range" and algorithm is "Range". + * + * @param expression - a BSON document of one of the following forms: + * 1. A Match Expression of this form: + * `{$and: [{: {$gt: }}, {: {$lt: }}]}` + * 2. An Aggregate Expression of this form: + * `{$and: [{$gt: [, ]}, {$lt: [, ]}]}` + * + * `$gt` may also be `$gte`. `$lt` may also be `$lte`. + * + * @param options - + * @returns Returns a Promise that either resolves with the encrypted value or rejects with an error. + */ + encryptExpression(expression: Document, options: ClientEncryptionEncryptOptions): Promise; + /** + * Explicitly decrypt a provided encrypted value + * + * @param value - An encrypted value + * @returns a Promise that either resolves with the decrypted value, or rejects with an error + * + * @example + * ```ts + * // Decrypting value with async/await API + * async function decryptMyValue(value) { + * return clientEncryption.decrypt(value); + * } + * ``` + */ + decrypt(value: Binary): Promise; + /* Excluded from this release type: askForKMSCredentials */ + static get libmongocryptVersion(): string; + /* Excluded from this release type: _encrypt */ +} + +/** + * @public + * Options to provide when creating a new data key. + */ +export declare interface ClientEncryptionCreateDataKeyProviderOptions { + /** + * Identifies a new KMS-specific key used to encrypt the new data key + */ + masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | KMIPEncryptionKeyOptions | undefined; + /** + * An optional list of string alternate names used to reference a key. + * If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id. + */ + keyAltNames?: string[] | undefined; + /** @experimental */ + keyMaterial?: Buffer | Binary; + /* Excluded from this release type: timeoutContext */ +} + +/** + * @public + * + * A data key provider. Allowed values: + * + * - aws, gcp, local, kmip or azure + * - (`mongodb-client-encryption>=6.0.1` only) a named key, in the form of: + * `aws:`, `gcp:`, `local:`, `kmip:`, `azure:` + * where `name` is an alphanumeric string, underscores allowed. + */ +export declare type ClientEncryptionDataKeyProvider = keyof KMSProviders; + +/** + * @public + * Options to provide when encrypting data. + */ +export declare interface ClientEncryptionEncryptOptions { + /** + * The algorithm to use for encryption. + */ + algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range' | 'String' + /** @deprecated Use `'String'` instead. */ + | 'TextPreview'; + /** + * The id of the Binary dataKey to use for encryption + */ + keyId?: Binary; + /** + * A unique string name corresponding to an already existing dataKey. + */ + keyAltName?: string; + /** The contention factor. */ + contentionFactor?: bigint | number; + /** + * The query type. + */ + queryType?: 'equality' | 'range' | 'prefix' | 'suffix' | 'substring' + /** @deprecated Use `'prefix'` instead. */ + | 'prefixPreview' + /** @deprecated Use `'suffix'` instead. */ + | 'suffixPreview' + /** @deprecated Use `'substring'` instead. */ + | 'substringPreview'; + /** The index options for a Queryable Encryption field supporting "range" queries.*/ + rangeOptions?: RangeOptions; + /** Options for a Queryable Encryption field supporting string queries. Only valid when `algorithm` is `'String'` or the deprecated `'TextPreview'`. */ + stringOptions?: StringQueryOptions; + /** + * Options for a Queryable Encryption field supporting text queries. Only valid when `algorithm` is `'String'` or the deprecated `'TextPreview'`. + * + * @deprecated Use `stringOptions` instead. + */ + textOptions?: StringQueryOptions; +} + +/** + * @public + * Additional settings to provide when creating a new `ClientEncryption` instance. + */ +export declare interface ClientEncryptionOptions { + /** + * The namespace of the key vault, used to store encryption keys + */ + keyVaultNamespace: string; + /** + * A MongoClient used to fetch keys from a key vault. Defaults to client. + */ + keyVaultClient?: MongoClient | undefined; + /** + * Options for specific KMS providers to use + */ + kmsProviders?: KMSProviders; + /** + * Options for user provided custom credential providers. + */ + credentialProviders?: CredentialProviders; + /** + * Options for specifying a Socks5 proxy to use for connecting to the KMS. + */ + proxyOptions?: ProxyOptions; + /** + * TLS options for kms providers to use. + */ + tlsOptions?: CSFLEKMSTlsOptions; + /** + * A callback that establishes the socket used to connect to a KMS host, e.g. to route KMS + * requests through an HTTP proxy via the HTTP CONNECT method. Mutually exclusive with `proxyOptions`. + * See {@link KMSConnectCallback} for a usage example. + */ + kmsConnectCallback?: KMSConnectCallback; + /** + * Sets the expiration time for the DEK in the cache in milliseconds. Defaults to 60000. 0 means no timeout. + */ + keyExpirationMS?: number; + /** + * @experimental + * + * The timeout setting to be used for all the operations on ClientEncryption. + * + * When provided, `timeoutMS` is used as the timeout for each operation executed on + * the ClientEncryption object. For example: + * + * ```typescript + * const clientEncryption = new ClientEncryption(client, { + * timeoutMS: 1_000 + * kmsProviders: { local: { key: '' } } + * }); + * + * // `1_000` is used as the timeout for createDataKey call + * await clientEncryption.createDataKey('local'); + * ``` + * + * If `timeoutMS` is configured on the provided client, the client's `timeoutMS` value + * will be used unless `timeoutMS` is also provided as a client encryption option. + * + * ```typescript + * const client = new MongoClient('', { timeoutMS: 2_000 }); + * + * // timeoutMS is set to 1_000 on clientEncryption + * const clientEncryption = new ClientEncryption(client, { + * timeoutMS: 1_000 + * kmsProviders: { local: { key: '' } } + * }); + * ``` + */ + timeoutMS?: number; +} + +/** + * @public + * @experimental + */ +export declare interface ClientEncryptionRewrapManyDataKeyProviderOptions { + provider: ClientEncryptionDataKeyProvider; + masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | KMIPEncryptionKeyOptions | undefined; +} + +/** + * @public + * @experimental + */ +export declare interface ClientEncryptionRewrapManyDataKeyResult { + /** The result of rewrapping data keys. If unset, no keys matched the filter. */ + bulkWriteResult?: BulkWriteResult; +} + +/** + * @public + * + * Socket options to use for KMS requests. + */ +export declare type ClientEncryptionSocketOptions = Pick; + +/** + * @public + * + * TLS options to use when connecting. The spec specifically calls out which insecure + * tls options are not allowed: + * + * - tlsAllowInvalidCertificates + * - tlsAllowInvalidHostnames + * - tlsInsecure + * + * These options are not included in the type, and are ignored if provided. + */ +export declare type ClientEncryptionTlsOptions = Pick; + +/** @public */ +export declare interface ClientInsertOneModel extends ClientWriteModel { + name: 'insertOne'; + /** The document to insert. */ + document: OptionalId; +} + +/** @public */ +export declare interface ClientInsertOneResult { + /** + * The _id of the inserted document. + */ + insertedId: any; +} + +/* Excluded from this release type: ClientMetadata */ + +/** @public */ +export declare interface ClientReplaceOneModel extends ClientWriteModel { + name: 'replaceOne'; + /** + * The filter used to determine if a document should be replaced. + * For a replaceOne operation, the first match is replaced. + */ + filter: Filter; + /** The document with which to replace the matched document. */ + replacement: WithoutId; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** + * A class representing a client session on the server + * + * NOTE: not meant to be instantiated directly. + * @public + */ +export declare class ClientSession extends TypedEventEmitter implements AsyncDisposable { + /* Excluded from this release type: client */ + /* Excluded from this release type: sessionPool */ + hasEnded: boolean; + clientOptions: MongoOptions; + supports: { + causalConsistency: boolean; + }; + clusterTime?: ClusterTime; + operationTime?: Timestamp; + explicit: boolean; + /* Excluded from this release type: owner */ + defaultTransactionOptions: TransactionOptions; + /* Excluded from this release type: transaction */ + /* Excluded from this release type: commitAttempted */ + readonly snapshotEnabled: boolean; + /* Excluded from this release type: _serverSession */ + /* Excluded from this release type: snapshotTime */ + /* Excluded from this release type: pinnedConnection */ + /* Excluded from this release type: txnNumberIncrement */ + /** + * @experimental + * Specifies the time an operation in a given `ClientSession` will run until it throws a timeout error + */ + timeoutMS?: number; + /* Excluded from this release type: timeoutContext */ + /* Excluded from this release type: __constructor */ + /** The server id associated with this session */ + get id(): ServerSessionId | undefined; + get serverSession(): ServerSession; + get loadBalanced(): boolean; + /* Excluded from this release type: pin */ + /* Excluded from this release type: unpin */ + get isPinned(): boolean; + /** + * Frees any client-side resources held by the current session. If a session is in a transaction, + * the transaction is aborted. + * + * Does not end the session on the server. + * + * @param options - Optional settings. Currently reserved for future use + */ + endSession(options?: EndSessionOptions): Promise; + /** + * An alias for {@link ClientSession.endSession|ClientSession.endSession()}. + */ + [Symbol.asyncDispose](): Promise; + /** + * Advances the operationTime for a ClientSession. + * + * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to + */ + advanceOperationTime(operationTime: Timestamp): void; + /** + * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession + * + * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature + */ + advanceClusterTime(clusterTime: ClusterTime): void; + /** + * Used to determine if this session equals another + * + * @param session - The session to compare to + */ + equals(session: ClientSession): boolean; + /** + * Increment the transaction number on the internal ServerSession + * + * @privateRemarks + * This helper increments a value stored on the client session that will be + * added to the serverSession's txnNumber upon applying it to a command. + * This is because the serverSession is lazily acquired after a connection is obtained + */ + incrementTransactionNumber(): void; + /** @returns whether this session is currently in a transaction or not */ + inTransaction(): boolean; + /** + * Starts a new transaction with the given options. + * + * @remarks + * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * @param options - Options for the transaction + */ + startTransaction(options?: TransactionOptions): void; + /** + * Commits the currently active transaction in this session. + * + * @param options - Optional options, can be used to override `defaultTimeoutMS`. + */ + commitTransaction(options?: { + timeoutMS?: number; + }): Promise; + /** + * Aborts the currently active transaction in this session. + * + * @param options - Optional options, can be used to override `defaultTimeoutMS`. + */ + abortTransaction(options?: { + timeoutMS?: number; + }): Promise; + /* Excluded from this release type: abortTransaction */ + /** + * This is here to ensure that ClientSession is never serialized to BSON. + */ + toBSON(): never; + /** + * Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed. + * + * **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise. + * + * **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * **IMPORTANT:** When running an operation inside a `withTransaction` callback, if it is not + * provided the explicit session in its options, it will not be part of the transaction and it will not respect timeoutMS. + * + * + * @remarks + * - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function. + * - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error. + * - If the transaction is manually aborted within the provided function it will not throw. + * - If the driver needs to attempt to retry the operations, the provided function may be called multiple times. + * + * Checkout a descriptive example here: + * @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions + * + * If a command inside withTransaction fails: + * - It may cause the transaction on the server to be aborted. + * - This situation is normally handled transparently by the driver. + * - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not. + * - The driver will then retry the transaction indefinitely. + * + * To avoid this situation, the application must not silently handle errors within the provided function. + * If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction. + * + * @param fn - callback to run within a transaction + * @param options - optional settings for the transaction + * @returns A raw command response or undefined + */ + withTransaction(fn: WithTransactionCallback, options?: TransactionOptions & { + /** + * Configures a timeoutMS expiry for the entire withTransactionCallback. + * + * @remarks + * - The remaining timeout will not be applied to callback operations that do not use the ClientSession. + * - Overriding timeoutMS for operations executed using the explicit session inside the provided callback will result in a client-side error. + */ + timeoutMS?: number; + }): Promise; +} + +/** @public */ +export declare type ClientSessionEvents = { + ended(session: ClientSession): void; +}; + +/** @public */ +export declare interface ClientSessionOptions { + /** Whether causal consistency should be enabled on this session */ + causalConsistency?: boolean; + /** Whether all read operations should be read from the same snapshot for this session (NOTE: not compatible with `causalConsistency=true`) */ + snapshot?: boolean; + /** The default TransactionOptions to use for transactions started on this session. */ + defaultTransactionOptions?: TransactionOptions; + /** + * @public + * @experimental + * An overriding timeoutMS value to use for a client-side timeout. + * If not provided the session uses the timeoutMS specified on the MongoClient. + */ + defaultTimeoutMS?: number; + /* Excluded from this release type: owner */ + /* Excluded from this release type: explicit */ + /* Excluded from this release type: initialClusterTime */ +} + +/** @public */ +export declare interface ClientUpdateManyModel extends ClientWriteModel { + name: 'updateMany'; + /** + * The filter used to determine if a document should be updated. + * For an updateMany operation, all matches are updated. + */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export declare interface ClientUpdateOneModel extends ClientWriteModel { + name: 'updateOne'; + /** + * The filter used to determine if a document should be updated. + * For an updateOne operation, the first match is updated. + */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @public */ +export declare interface ClientUpdateResult { + /** + * The number of documents that matched the filter. + */ + matchedCount: number; + /** + * The number of documents that were modified. + */ + modifiedCount: number; + /** + * The _id field of the upserted document if an upsert occurred. + * + * It MUST be possible to discern between a BSON Null upserted ID value and this field being + * unset. If necessary, drivers MAY add a didUpsert boolean field to differentiate between + * these two cases. + */ + upsertedId?: any; + /** + * Determines if the upsert did include an _id, which includes the case of the _id being null. + */ + didUpsert: boolean; +} + +/** @public */ +export declare interface ClientWriteModel { + /** + * The namespace for the write. + * + * A namespace is a combination of the database name and the name of the collection: `.`. + * All documents belong to a namespace. + * + * @see https://www.mongodb.com/docs/manual/reference/limits/#std-label-faq-dev-namespace + */ + namespace: string; +} + +/** @public + * Configuration options for clustered collections + * @see https://www.mongodb.com/docs/manual/core/clustered-collections/ + */ +export declare interface ClusteredCollectionOptions extends Document { + name?: string; + key: Document; + unique: boolean; +} + +/** + * @public + * Gossiped in component for the cluster time tracking the state of user databases + * across the cluster. It may optionally include a signature identifying the process that + * generated such a value. + */ +export declare interface ClusterTime { + clusterTime: Timestamp; + /** Used to validate the identity of a request or response's ClusterTime. */ + signature?: { + hash: Binary; + keyId: Long; + }; +} + +export { Code } + +/** @public */ +export declare interface CollationOptions { + locale: string; + caseLevel?: boolean; + caseFirst?: string; + strength?: number; + numericOrdering?: boolean; + alternate?: string; + maxVariable?: string; + backwards?: boolean; + normalization?: boolean; +} + +/** + * The **Collection** class is an internal class that embodies a MongoDB collection + * allowing for insert/find/update/delete and other command operation on that MongoDB collection. + * + * **COLLECTION Cannot directly be instantiated** + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * interface Pet { + * name: string; + * kind: 'dog' | 'cat' | 'fish'; + * } + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const pets = client.db().collection('pets'); + * + * const petCursor = pets.find(); + * + * for await (const pet of petCursor) { + * console.log(`${pet.name} is a ${pet.kind}!`); + * } + * ``` + */ +export declare class Collection { + /* Excluded from this release type: s */ + /* Excluded from this release type: client */ + /** + * Get the database object for the collection. + */ + readonly db: Db; + /* Excluded from this release type: __constructor */ + /** + * The name of the database this collection belongs to + */ + get dbName(): string; + /** + * The name of this collection + */ + get collectionName(): string; + /** + * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}` + */ + get namespace(): string; + /* Excluded from this release type: fullNamespace */ + /** + * The current readConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readConcern(): ReadConcern | undefined; + /** + * The current readPreference of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readPreference(): ReadPreference | undefined; + get bsonOptions(): BSONSerializeOptions; + /** + * The current writeConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get writeConcern(): WriteConcern | undefined; + /** The current index hint for the collection */ + get hint(): Hint | undefined; + set hint(v: Hint | undefined); + get timeoutMS(): number | undefined; + /** + * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param doc - The document to insert + * @param options - Optional settings for the command + */ + insertOne(doc: OptionalUnlessRequiredId, options?: InsertOneOptions): Promise>; + /** + * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param docs - The documents to insert + * @param options - Optional settings for the command + */ + insertMany(docs: ReadonlyArray>, options?: BulkWriteOptions): Promise>; + /** + * Perform a bulkWrite operation without a fluent API + * + * Legal operation types are + * - `insertOne` + * - `replaceOne` + * - `updateOne` + * - `updateMany` + * - `deleteOne` + * - `deleteMany` + * + * If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param operations - Bulk operations to perform + * @param options - Optional settings for the command + * @throws MongoDriverError if operations is not an array + */ + bulkWrite(operations: ReadonlyArray>, options?: BulkWriteOptions): Promise; + /** + * Update a single document in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + updateOne(filter: Filter, update: UpdateFilter | Document[], options?: UpdateOptions & { + sort?: Sort; + }): Promise>; + /** + * Replace a document in a collection with another document + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + */ + replaceOne(filter: Filter, replacement: WithoutId, options?: ReplaceOptions): Promise>; + /** + * Update multiple documents in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + updateMany(filter: Filter, update: UpdateFilter | Document[], options?: UpdateOptions): Promise>; + /** + * Delete a document from a collection + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + */ + deleteOne(filter?: Filter, options?: DeleteOptions): Promise; + /** + * Delete multiple documents from a collection + * + * @param filter - The filter used to select the documents to remove + * @param options - Optional settings for the command + */ + deleteMany(filter?: Filter, options?: DeleteOptions): Promise; + /** + * Rename the collection. + * + * @remarks + * This operation does not inherit options from the Db or MongoClient. + * + * @param newName - New name of of the collection. + * @param options - Optional settings for the command + */ + rename(newName: string, options?: RenameOptions): Promise; + /** + * Drop the collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param options - Optional settings for the command + */ + drop(options?: DropCollectionOptions): Promise; + /** + * Fetches the first document that matches the filter + * + * @param filter - Query for find Operation + * @param options - Optional settings for the command + */ + findOne(): Promise | null>; + findOne(filter: Filter): Promise | null>; + findOne(filter: Filter, options: Omit & Abortable): Promise | null>; + findOne(): Promise; + findOne(filter: Filter): Promise; + findOne(filter: Filter, options?: Omit & Abortable): Promise; + /** + * Creates a cursor for a filter that can be used to iterate over results from MongoDB + * + * @param filter - The filter predicate. If unspecified, then all documents in the collection will match the predicate + */ + find(): FindCursor>; + find(filter: Filter, options?: FindOptions & Abortable): FindCursor>; + find(filter: Filter, options?: FindOptions & Abortable): FindCursor; + /** + * Returns the options of the collection. + * + * @param options - Optional settings for the command + */ + options(options?: OperationOptions): Promise; + /** + * Returns if the collection is a capped collection + * + * @param options - Optional settings for the command + */ + isCapped(options?: OperationOptions): Promise; + /** + * Creates an index on the db and collection collection. + * + * @param indexSpec - The field name or index specification to create an index for + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * + * await collection.createIndex({ a: 1, b: -1 }); + * + * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes + * await collection.createIndex([ [c, 1], [d, -1] ]); + * + * // Equivalent to { e: 1 } + * await collection.createIndex('e'); + * + * // Equivalent to { f: 1, g: 1 } + * await collection.createIndex(['f', 'g']) + * + * // Equivalent to { h: 1, i: -1 } + * await collection.createIndex([ { h: 1 }, { i: -1 } ]); + * + * // Equivalent to { j: 1, k: -1, l: 2d } + * await collection.createIndex(['j', ['k', -1], { l: '2d' }]) + * ``` + */ + createIndex(indexSpec: IndexSpecification, options?: CreateIndexesOptions): Promise; + /** + * Creates multiple indexes in the collection, this method is only supported for + * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported + * error. + * + * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specifications. + * Index specifications are defined {@link https://www.mongodb.com/docs/manual/reference/command/createIndexes/| here}. + * + * @param indexSpecs - An array of index specifications to be created + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * await collection.createIndexes([ + * // Simple index on field fizz + * { + * key: { fizz: 1 }, + * } + * // wildcard index + * { + * key: { '$**': 1 } + * }, + * // named index on darmok and jalad + * { + * key: { darmok: 1, jalad: -1 } + * name: 'tanagra' + * } + * ]); + * ``` + */ + createIndexes(indexSpecs: IndexDescription[], options?: CreateIndexesOptions): Promise; + /** + * Drops an index from this collection. + * + * @param indexName - Name of the index to drop. + * @param options - Optional settings for the command + */ + dropIndex(indexName: string, options?: DropIndexesOptions): Promise; + /** + * Drops all indexes from this collection. + * + * @param options - Optional settings for the command + */ + dropIndexes(options?: DropIndexesOptions): Promise; + /** + * Get the list of all indexes information for the collection. + * + * @param options - Optional settings for the command + */ + listIndexes(options?: ListIndexesOptions): ListIndexesCursor; + /** + * Checks if one or more indexes exist on the collection, fails on first non-existing index + * + * @param indexes - One or more index names to check. + * @param options - Optional settings for the command + */ + indexExists(indexes: string | string[], options?: ListIndexesOptions): Promise; + /** + * Retrieves this collections index info. + * + * @param options - Optional settings for the command + */ + indexInformation(options: IndexInformationOptions & { + full: true; + }): Promise; + indexInformation(options: IndexInformationOptions & { + full?: false; + }): Promise; + indexInformation(options: IndexInformationOptions): Promise; + indexInformation(): Promise; + /** + * Gets an estimate of the count of documents in a collection using collection metadata. + * This will always run a count command on all server versions. + * + * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, + * which estimatedDocumentCount uses in its implementation, was not included in v1 of + * the Stable API, and so users of the Stable API with estimatedDocumentCount are + * recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid + * encountering errors. + * + * @see {@link https://www.mongodb.com/docs/manual/reference/command/count/#behavior|Count: Behavior} + * @param options - Optional settings for the command + */ + estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise; + /** + * Gets the number of documents matching the filter. + * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * Due to countDocuments using the $match aggregation pipeline stage, certain query operators cannot be used in countDocuments. This includes the $where and $near query operators, among others. Details can be found in the documentation for the $match aggregation pipeline stage. + * + * **Note**: When migrating from {@link Collection#count| count} to {@link Collection#countDocuments| countDocuments} + * the following query operators must be replaced: + * + * | Operator | Replacement | + * | -------- | ----------- | + * | `$where` | [`$expr`][1] | + * | `$near` | [`$geoWithin`][2] with [`$center`][3] | + * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] | + * + * [1]: https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * [2]: https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * [3]: https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * [4]: https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + * + * @param filter - The filter for the count + * @param options - Optional settings for the command + * + * @see https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * @see https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + */ + countDocuments(filter?: Filter, options?: CountDocumentsOptions & Abortable): Promise; + /** + * The distinct command returns a list of distinct values for the given key across a collection. + * + * @param key - Field of the document to find distinct values for + * @param filter - The filter for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings for the command + */ + distinct>(key: Key): Promise[Key]>>>; + distinct>(key: Key, filter: Filter): Promise[Key]>>>; + distinct>(key: Key, filter: Filter, options: DistinctOptions): Promise[Key]>>>; + distinct>(key: Key, filter: Filter, options: DistinctOptions & { + explain: ExplainVerbosityLike | ExplainCommandOptions; + }): Promise; + distinct(key: string): Promise; + distinct(key: string, filter: Filter): Promise; + distinct(key: string, filter: Filter, options: DistinctOptions): Promise; + /** + * Retrieve all the indexes on the collection. + * + * @param options - Optional settings for the command + */ + indexes(options: IndexInformationOptions & { + full?: true; + }): Promise; + indexes(options: IndexInformationOptions & { + full: false; + }): Promise; + indexes(options: IndexInformationOptions): Promise; + indexes(options?: ListIndexesOptions): Promise; + /** + * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + */ + findOneAndDelete(filter: Filter, options: FindOneAndDeleteOptions & { + includeResultMetadata: true; + }): Promise>; + findOneAndDelete(filter: Filter, options: FindOneAndDeleteOptions & { + includeResultMetadata: false; + }): Promise | null>; + findOneAndDelete(filter: Filter, options: FindOneAndDeleteOptions): Promise | null>; + findOneAndDelete(filter: Filter): Promise | null>; + /** + * Find a document and replace it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + */ + findOneAndReplace(filter: Filter, replacement: WithoutId, options: FindOneAndReplaceOptions & { + includeResultMetadata: true; + }): Promise>; + findOneAndReplace(filter: Filter, replacement: WithoutId, options: FindOneAndReplaceOptions & { + includeResultMetadata: false; + }): Promise | null>; + findOneAndReplace(filter: Filter, replacement: WithoutId, options: FindOneAndReplaceOptions): Promise | null>; + findOneAndReplace(filter: Filter, replacement: WithoutId): Promise | null>; + /** + * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation. + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline consisting of the following stages: + * - $addFields and its alias $set + * - $project and its alias $unset + * - $replaceRoot and its alias $replaceWith. + * See the [findAndModify command documentation](https://www.mongodb.com/docs/manual/reference/command/findAndModify) for details. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + findOneAndUpdate(filter: Filter, update: UpdateFilter | Document[], options: FindOneAndUpdateOptions & { + includeResultMetadata: true; + }): Promise>; + findOneAndUpdate(filter: Filter, update: UpdateFilter | Document[], options: FindOneAndUpdateOptions & { + includeResultMetadata: false; + }): Promise | null>; + findOneAndUpdate(filter: Filter, update: UpdateFilter | Document[], options: FindOneAndUpdateOptions): Promise | null>; + findOneAndUpdate(filter: Filter, update: UpdateFilter | Document[]): Promise | null>; + /** + * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2 + * + * @param pipeline - An array of aggregation pipelines to execute + * @param options - Optional settings for the command + */ + aggregate(pipeline?: Document[], options?: AggregateOptions & Abortable): AggregationCursor; + /** + * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to override the schema that may be defined for this specific collection + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * @example + * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>` + * ```ts + * collection.watch<{ _id: number }>() + * .on('change', change => console.log(change._id.toFixed(4))); + * ``` + * + * @example + * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline. + * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment. + * No need start from scratch on the ChangeStreamInsertDocument type! + * By using an intersection we can save time and ensure defaults remain the same type! + * ```ts + * collection + * .watch & { comment: string }>([ + * { $addFields: { comment: 'big changes' } }, + * { $match: { operationType: 'insert' } } + * ]) + * .on('change', change => { + * change.comment.startsWith('big'); + * change.operationType === 'insert'; + * // No need to narrow in code because the generics did that for us! + * expectType(change.fullDocument); + * }); + * ``` + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TLocal - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream; + /** + * Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeUnorderedBulkOp(options?: BulkWriteOptions): UnorderedBulkOperation; + /** + * Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation; + /** + * An estimated count of matching documents in the db to a filter. + * + * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents + * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}. + * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead + * + * @param filter - The filter for the count. + * @param options - Optional settings for the command + */ + count(filter?: Filter, options?: CountOptions): Promise; + /** + * Returns all search indexes for the current collection. + * + * @param options - The options for the list indexes operation. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + listSearchIndexes(options?: ListSearchIndexesOptions): ListSearchIndexesCursor; + /** + * Returns all search indexes for the current collection. + * + * @param name - The name of the index to search for. Only indexes with matching index names will be returned. + * @param options - The options for the list indexes operation. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + listSearchIndexes(name: string, options?: ListSearchIndexesOptions): ListSearchIndexesCursor; + /** + * Creates a single search index for the collection. + * + * @param description - The index description for the new search index. + * @returns A promise that resolves to the name of the new search index. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + createSearchIndex(description: SearchIndexDescription): Promise; + /** + * Creates multiple search indexes for the current collection. + * + * @param descriptions - An array of `SearchIndexDescription`s for the new search indexes. + * @returns A promise that resolves to an array of the newly created search index names. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + * @returns + */ + createSearchIndexes(descriptions: SearchIndexDescription[]): Promise; + /** + * Deletes a search index by index name. + * + * @param name - The name of the search index to be deleted. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + dropSearchIndex(name: string): Promise; + /** + * Updates a search index by replacing the existing index definition with the provided definition. + * + * @param name - The name of the search index to update. + * @param definition - The new search index definition. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + updateSearchIndex(name: string, definition: Document): Promise; +} + +/** @public */ +export declare interface CollectionInfo extends Document { + name: string; + type?: string; + options?: Document; + info?: { + readOnly?: false; + uuid?: Binary; + }; + idIndex?: Document; +} + +/** @public */ +export declare interface CollectionOptions extends BSONSerializeOptions, WriteConcernOptions { + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/* Excluded from this release type: CollectionPrivate */ + +/* Excluded from this release type: COMMAND_FAILED */ + +/* Excluded from this release type: COMMAND_STARTED */ + +/* Excluded from this release type: COMMAND_SUCCEEDED */ + +/** + * An event indicating the failure of a given command + * @public + * @category Event + */ +export declare class CommandFailedEvent { + address: string; + /** Driver generated connection id */ + connectionId?: string | number; + /** + * Server generated connection id + * Distinct from the connection id and is returned by the hello or legacy hello response as "connectionId" from the server. + */ + serverConnectionId: bigint | null; + requestId: number; + duration: number; + commandName: string; + failure: Error; + serviceId?: ObjectId; + databaseName: string; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ + get hasServiceId(): boolean; +} + +/* Excluded from this release type: CommandOperation */ + +/** @public */ +export declare interface CommandOperationOptions extends OperationOptions, WriteConcernOptions, ExplainOptions { + /** Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** Collation */ + collation?: CollationOptions; + /** + * maxTimeMS is a server-side time limit in milliseconds for processing an operation. + */ + maxTimeMS?: number; + /** + * Comment to apply to the operation. + */ + comment?: unknown; + dbName?: string; + authdb?: string; + /* Excluded from this release type: rawData */ +} + +/* Excluded from this release type: CommandOptions */ + +/** + * An event indicating the start of a given command + * @public + * @category Event + */ +export declare class CommandStartedEvent { + commandObj?: Document; + requestId: number; + databaseName: string; + commandName: string; + command: Document; + address: string; + /** Driver generated connection id */ + connectionId?: string | number; + /** + * Server generated connection id + * Distinct from the connection id and is returned by the hello or legacy hello response as "connectionId" + * from the server. + */ + serverConnectionId: bigint | null; + serviceId?: ObjectId; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ + get hasServiceId(): boolean; +} + +/** + * An event indicating the success of a given command + * @public + * @category Event + */ +export declare class CommandSucceededEvent { + address: string; + /** Driver generated connection id */ + connectionId?: string | number; + /** + * Server generated connection id + * Distinct from the connection id and is returned by the hello or legacy hello response as "connectionId" from the server. + */ + serverConnectionId: bigint | null; + requestId: number; + duration: number; + commandName: string; + reply: unknown; + serviceId?: ObjectId; + databaseName: string; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ + get hasServiceId(): boolean; +} + +/** @public */ +export declare type CommonEvents = 'newListener' | 'removeListener'; + +/** @public */ +export declare const Compressor: Readonly<{ + readonly none: 0; + readonly snappy: 1; + readonly zlib: 2; + readonly zstd: 3; +}>; + +/** @public */ +export declare type Compressor = (typeof Compressor)[CompressorName]; + +/** @public */ +export declare type CompressorName = keyof typeof Compressor; + +/** @public */ +export declare type Condition = AlternativeType | FilterOperators>; + +/* Excluded from this release type: Connection */ + +/* Excluded from this release type: CONNECTION_CHECK_OUT_FAILED */ + +/* Excluded from this release type: CONNECTION_CHECK_OUT_STARTED */ + +/* Excluded from this release type: CONNECTION_CHECKED_IN */ + +/* Excluded from this release type: CONNECTION_CHECKED_OUT */ + +/* Excluded from this release type: CONNECTION_CLOSED */ + +/* Excluded from this release type: CONNECTION_CREATED */ + +/* Excluded from this release type: CONNECTION_POOL_CLEARED */ + +/* Excluded from this release type: CONNECTION_POOL_CLOSED */ + +/* Excluded from this release type: CONNECTION_POOL_CREATED */ + +/* Excluded from this release type: CONNECTION_POOL_READY */ + +/* Excluded from this release type: CONNECTION_READY */ + +/** + * An event published when a connection is checked into the connection pool + * @public + * @category Event + */ +export declare class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection is checked out of the connection pool + * @public + * @category Event + */ +export declare class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /* Excluded from this release type: name */ + /** + * The time it took to check out the connection. + * More specifically, the time elapsed between + * emitting a `ConnectionCheckOutStartedEvent` + * and emitting this event as part of the same checking out. + * + */ + durationMS: number; + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a request to check a connection out fails + * @public + * @category Event + */ +export declare class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent { + /** The reason the attempt to check out failed */ + reason: string; + /* Excluded from this release type: error */ + /* Excluded from this release type: name */ + /** + * The time it took to check out the connection. + * More specifically, the time elapsed between + * emitting a `ConnectionCheckOutStartedEvent` + * and emitting this event as part of the same check out. + */ + durationMS: number; + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a request to check a connection out begins + * @public + * @category Event + */ +export declare class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent { + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection is closed + * @public + * @category Event + */ +export declare class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** The reason the connection was closed */ + reason: string; + serviceId?: ObjectId; + /* Excluded from this release type: name */ + /* Excluded from this release type: error */ + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection pool creates a new connection + * @public + * @category Event + */ +export declare class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent { + /** A monotonically increasing, per-pool id for the newly created connection */ + connectionId: number | ''; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare type ConnectionEvents = { + commandStarted(event: CommandStartedEvent): void; + commandSucceeded(event: CommandSucceededEvent): void; + commandFailed(event: CommandFailedEvent): void; + clusterTimeReceived(clusterTime: Document): void; + close(): void; + pinned(pinType: string): void; + unpinned(pinType: string): void; +}; + +/** @public */ +export declare interface ConnectionOptions extends SupportedNodeConnectionOptions, StreamDescriptionOptions, ProxyOptions { + id: number | ''; + generation: number; + hostAddress: HostAddress; + /* Excluded from this release type: autoEncrypter */ + serverApi?: ServerApi; + monitorCommands: boolean; + /* Excluded from this release type: connectionType */ + credentials?: MongoCredentials; + /* Excluded from this release type: authProviders */ + connectTimeoutMS?: number; + tls: boolean; + noDelay?: boolean; + socketTimeoutMS?: number; + /* Excluded from this release type: cancellationToken */ + /* Excluded from this release type: metadata */ + /* Excluded from this release type: mongoLogger */ + /* Excluded from this release type: runtime */ +} + +/* Excluded from this release type: ConnectionPool */ + +/** + * An event published when a connection pool is cleared + * @public + * @category Event + */ +export declare class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent { + /* Excluded from this release type: serviceId */ + interruptInUseConnections?: boolean; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection pool is closed + * @public + * @category Event + */ +export declare class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent { + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection pool is created + * @public + * @category Event + */ +export declare class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent { + /** The options used to create this connection pool */ + options: Pick; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare type ConnectionPoolEvents = { + connectionPoolCreated(event: ConnectionPoolCreatedEvent): void; + connectionPoolReady(event: ConnectionPoolReadyEvent): void; + connectionPoolClosed(event: ConnectionPoolClosedEvent): void; + connectionPoolCleared(event: ConnectionPoolClearedEvent): void; + connectionCreated(event: ConnectionCreatedEvent): void; + connectionReady(event: ConnectionReadyEvent): void; + connectionClosed(event: ConnectionClosedEvent): void; + connectionCheckOutStarted(event: ConnectionCheckOutStartedEvent): void; + connectionCheckOutFailed(event: ConnectionCheckOutFailedEvent): void; + connectionCheckedOut(event: ConnectionCheckedOutEvent): void; + connectionCheckedIn(event: ConnectionCheckedInEvent): void; +} & Omit; + +/* Excluded from this release type: ConnectionPoolMetrics */ + +/** + * The base export class for all monitoring events published from the connection pool + * @public + * @category Event + */ +export declare abstract class ConnectionPoolMonitoringEvent { + /** A timestamp when the event was created */ + time: Date; + /** The address (host/port pair) of the pool */ + address: string; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare interface ConnectionPoolOptions extends Omit { + /** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. */ + maxPoolSize: number; + /** The minimum number of connections that MUST exist at any moment in a single connection pool. */ + minPoolSize: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting: number; + /** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. */ + maxIdleTimeMS: number; + /** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. */ + waitQueueTimeoutMS: number; + /** If we are in load balancer mode. */ + loadBalanced: boolean; + /* Excluded from this release type: minPoolSizeCheckFrequencyMS */ +} + +/** + * An event published when a connection pool is ready + * @public + * @category Event + */ +export declare class ConnectionPoolReadyEvent extends ConnectionPoolMonitoringEvent { + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection is ready for use + * @public + * @category Event + */ +export declare class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** + * The time it took to establish the connection. + * In accordance with the definition of establishment of a connection + * specified by `ConnectionPoolOptions.maxConnecting`, + * it is the time elapsed between emitting a `ConnectionCreatedEvent` + * and emitting this event as part of the same checking out. + * + * Naturally, when establishing a connection is part of checking out, + * this duration is not greater than + * `ConnectionCheckedOutEvent.duration`. + */ + durationMS: number; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare interface ConnectOptions { + readPreference?: ReadPreference; +} + +/** @public */ +export declare interface CountDocumentsOptions extends AggregateOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amount of documents to consider. */ + limit?: number; +} + +/** @public */ +export declare interface CountOptions extends CommandOperationOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amounts to count before aborting. */ + limit?: number; + /** + * Number of milliseconds to wait before aborting the query. + */ + maxTimeMS?: number; + /** An index name hint for the query. */ + hint?: string | Document; +} + +/** @public */ +export declare interface CreateCollectionOptions extends Omit { + /** Create a capped collection */ + capped?: boolean; + /** The size of the capped collection in bytes */ + size?: number; + /** The maximum number of documents in the capped collection */ + max?: number; + /** Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag */ + flags?: number; + /** Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection */ + storageEngine?: Document; + /** Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation */ + validator?: Document; + /** Determines how strictly MongoDB applies the validation rules to existing documents during an update */ + validationLevel?: string; + /** Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted */ + validationAction?: string; + /** Allows users to specify a default configuration for indexes when creating a collection */ + indexOptionDefaults?: Document; + /** The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view (i.e., does not include the database name and implies the same database as the view to create) */ + viewOn?: string; + /** An array that consists of the aggregation pipeline stage. Creates the view by applying the specified pipeline to the viewOn collection or view */ + pipeline?: Document[]; + /** A primary key factory function for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** A document specifying configuration options for timeseries collections. */ + timeseries?: TimeSeriesCollectionOptions; + /** A document specifying configuration options for clustered collections. For MongoDB 5.3 and above. */ + clusteredIndex?: ClusteredCollectionOptions; + /** The number of seconds after which a document in a timeseries or clustered collection expires. */ + expireAfterSeconds?: number; + /** @experimental */ + encryptedFields?: Document; + /** + * If set, enables pre-update and post-update document events to be included for any + * change streams that listen on this collection. + */ + changeStreamPreAndPostImages?: { + enabled: boolean; + }; +} + +/** @public */ +export declare interface CreateIndexesOptions extends Omit { + /** Creates the index in the background, yielding whenever possible. */ + background?: boolean; + /** Creates an unique index. */ + unique?: boolean; + /** Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) */ + name?: string; + /** Creates a partial index based on the given filter object (MongoDB 3.2 or higher) */ + partialFilterExpression?: Document; + /** Creates a sparse index. */ + sparse?: boolean; + /** Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) */ + expireAfterSeconds?: number; + /** Allows users to configure the storage engine on a per-index basis when creating an index. (MongoDB 3.0 or higher) */ + storageEngine?: Document; + /** Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes. */ + commitQuorum?: number | string; + /** Specifies the index version number, either 0 or 1. */ + version?: number; + weights?: Document; + default_language?: string; + language_override?: string; + textIndexVersion?: number; + '2dsphereIndexVersion'?: number; + bits?: number; + /** For geospatial indexes set the lower bound for the co-ordinates. */ + min?: number; + /** For geospatial indexes set the high bound for the co-ordinates. */ + max?: number; + bucketSize?: number; + wildcardProjection?: Document; + /** Specifies that the index should exist on the target collection but should not be used by the query planner when executing operations. */ + hidden?: boolean; +} + +/** + * @public + * Configuration options for custom credential providers for KMS requests. + */ +export declare interface CredentialProviders { + aws?: AWSCredentialProvider; +} + +/** @public */ +export declare type CSFLEKMSTlsOptions = { + aws?: ClientEncryptionTlsOptions; + gcp?: ClientEncryptionTlsOptions; + kmip?: ClientEncryptionTlsOptions; + local?: ClientEncryptionTlsOptions; + azure?: ClientEncryptionTlsOptions; + [key: string]: ClientEncryptionTlsOptions | undefined; +}; + +/* Excluded from this release type: CSOTTimeoutContext */ + +/* Excluded from this release type: CSOTTimeoutContextOptions */ + +/** @public */ +export declare const CURSOR_FLAGS: readonly ["tailable", "oplogReplay", "noCursorTimeout", "awaitData", "exhaust", "partial"]; + +/** @public */ +export declare type CursorFlag = (typeof CURSOR_FLAGS)[number]; + +/* Excluded from this release type: CursorResponse */ + +/* Excluded from this release type: CursorTimeoutContext */ + +/** + * @public + * @experimental + * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'` + * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of + * `cursor.next()`. + * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor. + * + * Depending on the type of cursor being used, this option has different default values. + * For non-tailable cursors, this value defaults to `'cursorLifetime'` + * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by + * definition can have an arbitrarily long lifetime. + * + * @example + * ```ts + * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'}); + * for await (const doc of cursor) { + * // process doc + * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but + * // will continue to iterate successfully otherwise, regardless of the number of batches. + * } + * ``` + * + * @example + * ```ts + * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' }); + * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms. + * ``` + */ +export declare const CursorTimeoutMode: Readonly<{ + readonly ITERATION: "iteration"; + readonly LIFETIME: "cursorLifetime"; +}>; + +/** + * @public + * @experimental + */ +export declare type CursorTimeoutMode = (typeof CursorTimeoutMode)[keyof typeof CursorTimeoutMode]; + +/** + * @public + * The schema for a DataKey in the key vault collection. + */ +export declare interface DataKey { + _id: UUID; + version?: number; + keyAltNames?: string[]; + keyMaterial: Binary; + creationDate: Date; + updateDate: Date; + status: number; + masterKey: Document; +} + +/** + * The **Db** class is a class that represents a MongoDB Database. + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * interface Pet { + * name: string; + * kind: 'dog' | 'cat' | 'fish'; + * } + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const db = client.db(); + * + * // Create a collection that validates our union + * await db.createCollection('pets', { + * validator: { $expr: { $in: ['$kind', ['dog', 'cat', 'fish']] } } + * }) + * ``` + */ +export declare class Db { + /* Excluded from this release type: s */ + /** + * Gets the MongoClient associated with the Db. + * @public + */ + readonly client: MongoClient; + static SYSTEM_NAMESPACE_COLLECTION: string; + static SYSTEM_INDEX_COLLECTION: string; + static SYSTEM_PROFILE_COLLECTION: string; + static SYSTEM_USER_COLLECTION: string; + static SYSTEM_COMMAND_COLLECTION: string; + static SYSTEM_JS_COLLECTION: string; + /** + * Creates a new Db instance. + * + * Db name cannot contain a dot, the server may apply more restrictions when an operation is run. + * + * @param client - The MongoClient for the database. + * @param databaseName - The name of the database this instance represents. + * @param options - Optional settings for Db construction. + */ + constructor(client: MongoClient, databaseName: string, options?: DbOptions); + get databaseName(): string; + get options(): DbOptions | undefined; + /** + * Check if a secondary can be used (because the read preference is *not* set to primary) + */ + get secondaryOk(): boolean; + get readConcern(): ReadConcern | undefined; + /** + * The current readPreference of the Db. If not explicitly defined for + * this Db, will be inherited from the parent MongoClient + */ + get readPreference(): ReadPreference; + get bsonOptions(): BSONSerializeOptions; + get writeConcern(): WriteConcern | undefined; + get namespace(): string; + get timeoutMS(): number | undefined; + /** + * Create a new collection on a server with the specified options. Use this to create capped collections. + * More information about command options available at https://www.mongodb.com/docs/manual/reference/command/create/ + * + * Collection namespace validation is performed server-side. + * + * @param name - The name of the collection to create + * @param options - Optional settings for the command + */ + createCollection(name: string, options?: CreateCollectionOptions): Promise>; + /** + * Execute a command + * + * @remarks + * This command does not inherit options from the MongoClient. + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to run + * @param options - Optional settings for the command + */ + command(command: Document, options?: RunCommandOptions & Abortable): Promise; + /** + * Execute an aggregation framework pipeline against the database. + * + * @param pipeline - An array of aggregation stages to be executed + * @param options - Optional settings for the command + */ + aggregate(pipeline?: Document[], options?: AggregateOptions): AggregationCursor; + /** Return the Admin db instance */ + admin(): Admin; + /** + * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly. + * + * Collection namespace validation is performed server-side. + * + * @param name - the collection name we wish to access. + * @returns return the new Collection instance + */ + collection(name: string, options?: CollectionOptions): Collection; + /** + * Get all the db statistics. + * + * @param options - Optional settings for the command + */ + stats(options?: DbStatsOptions): Promise; + /** + * List all collections of this database with optional filter + * + * @param filter - Query to filter collections by + * @param options - Optional settings for the command + */ + listCollections(filter: Document, options: Exclude & { + nameOnly: true; + } & Abortable): ListCollectionsCursor>; + listCollections(filter: Document, options: Exclude & { + nameOnly: false; + } & Abortable): ListCollectionsCursor; + listCollections | CollectionInfo = Pick | CollectionInfo>(filter?: Document, options?: ListCollectionsOptions & Abortable): ListCollectionsCursor; + /** + * Rename a collection. + * + * @remarks + * This operation does not inherit options from the MongoClient. + * + * @param fromCollection - Name of current collection to rename + * @param toCollection - New name of of the collection + * @param options - Optional settings for the command + */ + renameCollection(fromCollection: string, toCollection: string, options?: RenameOptions): Promise>; + /** + * Drop a collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param name - Name of collection to drop + * @param options - Optional settings for the command + */ + dropCollection(name: string, options?: DropCollectionOptions): Promise; + /** + * Drop a database, removing it permanently from the server. + * + * @param options - Optional settings for the command + */ + dropDatabase(options?: DropDatabaseOptions): Promise; + /** + * Fetch all collections for the current db. + * + * @param options - Optional settings for the command + */ + collections(options?: ListCollectionsOptions): Promise; + /** + * Creates an index on the db and collection. + * + * @param name - Name of the collection to create the index on. + * @param indexSpec - Specify the field to index, or an index specification + * @param options - Optional settings for the command + */ + createIndex(name: string, indexSpec: IndexSpecification, options?: CreateIndexesOptions): Promise; + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + removeUser(username: string, options?: RemoveUserOptions): Promise; + /** + * Set the current profiling level of MongoDB + * + * @param level - The new profiling level (off, slow_only, all). + * @param options - Optional settings for the command + */ + setProfilingLevel(level: ProfilingLevel, options?: SetProfilingLevelOptions): Promise; + /** + * Retrieve the current profiling Level for MongoDB + * + * @param options - Optional settings for the command + */ + profilingLevel(options?: ProfilingLevelOptions): Promise; + /** + * Retrieves this collections index info. + * + * @param name - The name of the collection. + * @param options - Optional settings for the command + */ + indexInformation(name: string, options: IndexInformationOptions & { + full: true; + }): Promise; + indexInformation(name: string, options: IndexInformationOptions & { + full?: false; + }): Promise; + indexInformation(name: string, options: IndexInformationOptions): Promise; + indexInformation(name: string): Promise; + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this database. Will ignore all + * changes to system collections. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the collections within this database + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream; + /** + * A low level cursor API providing basic driver functionality: + * - ClientSession management + * - ReadPreference for server selection + * - Running getMores automatically when a local batch is exhausted + * + * @param command - The command that will start a cursor on the server. + * @param options - Configurations for running the command, bson options will apply to getMores + */ + runCursorCommand(command: Document, options?: RunCursorCommandOptions): RunCommandCursor; +} + +/* Excluded from this release type: DB_AGGREGATE_COLLECTION */ + +/** @public */ +export declare interface DbOptions extends BSONSerializeOptions, WriteConcernOptions { + /** If the database authentication is dependent on another databaseName. */ + authSource?: string; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; + /** A primary key factory object for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcern; + /** Should retry failed writes */ + retryWrites?: boolean; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/* Excluded from this release type: DbPrivate */ +export { DBRef } + +/** @public */ +export declare interface DbStatsOptions extends Omit { + /** Divide the returned sizes by scale value. */ + scale?: number; +} + +export { Decimal128 } + +/** @public */ +export declare interface DeleteManyModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export declare interface DeleteOneModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export declare interface DeleteOptions extends CommandOperationOptions, WriteConcernOptions { + /** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */ + ordered?: boolean; + /** Specifies the collation to use for the operation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export declare interface DeleteResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined. */ + acknowledged: boolean; + /** The number of documents that were deleted */ + deletedCount: number; +} + +/** @public */ +export declare interface DeleteStatement { + /** The query that matches documents to delete. */ + q: Document; + /** The number of matching documents to delete. */ + limit: number; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; +} + +/* Excluded from this release type: DeprioritizedServers */ +export { deserialize } + +/** @public */ +export declare type DistinctOptions = CommandOperationOptions & { + /** + * @sinceServerVersion 7.1 + * + * The index to use. Specify either the index name as a string or the index key pattern. + * If specified, then the query system will only consider plans using the hinted index. + * + * If provided as a string, `hint` must be index name for an index on the collection. + * If provided as an object, `hint` must be an index description for an index defined on the collection. + * + * See https://www.mongodb.com/docs/manual/reference/command/distinct/#command-fields. + */ + hint?: Document | string; +}; + +export { Document } + +export { Double } + +/** @public */ +export declare interface DriverInfo { + name?: string; + version?: string; + platform?: string; +} + +/** @public */ +export declare interface DropCollectionOptions extends Omit { + /** @experimental */ + encryptedFields?: Document; +} + +/** @public */ +export declare type DropDatabaseOptions = CommandOperationOptions; + +/** @public */ +export declare type DropIndexesOptions = CommandOperationOptions; + +/* Excluded from this release type: Encrypter */ + +/* Excluded from this release type: EncrypterOptions */ + +/** @public */ +export declare interface EndSessionOptions { + /* Excluded from this release type: error */ + force?: boolean; + forceClear?: boolean; + /** Specifies the time an operation will run until it throws a timeout error */ + timeoutMS?: number; +} + +/** TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions @public */ +export declare type EnhancedOmit = string extends keyof TRecordOrUnion ? TRecordOrUnion : TRecordOrUnion extends any ? Pick> : never; + +/** @public */ +export declare interface ErrorDescription extends Document { + message?: string; + errmsg?: string; + $err?: string; + errorLabels?: string[]; + errInfo?: Document; +} + +/** @public */ +export declare interface EstimatedDocumentCountOptions extends CommandOperationOptions { + /** + * The maximum amount of time to allow the operation to run. + * + * This option is sent only if the caller explicitly provides a value. The default is to not send a value. + */ + maxTimeMS?: number; +} + +/** @public */ +export declare type EventEmitterWithState = { + /* Excluded from this release type: stateChanged */ +}; + +/** + * Event description type + * @public + */ +export declare type EventsDescription = Record; + +/* Excluded from this release type: Explain */ + +/** + * @public + * + * A base class for any cursors that have `explain()` methods. + */ +export declare abstract class ExplainableCursor extends AbstractCursor { + /** Execute the explain for the cursor */ + abstract explain(): Promise; + abstract explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise; + abstract explain(options: { + timeoutMS?: number; + }): Promise; + abstract explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions, options: { + timeoutMS?: number; + }): Promise; + abstract explain(verbosity?: ExplainVerbosityLike | ExplainCommandOptions | { + timeoutMS?: number; + }, options?: { + timeoutMS?: number; + }): Promise; + protected resolveExplainTimeoutOptions(verbosity?: ExplainVerbosityLike | ExplainCommandOptions | { + timeoutMS?: number; + }, options?: { + timeoutMS?: number; + }): { + timeout?: { + timeoutMS?: number; + }; + explain?: ExplainVerbosityLike | ExplainCommandOptions; + }; +} + +/** @public */ +export declare interface ExplainCommandOptions { + /** The explain verbosity for the command. */ + verbosity: ExplainVerbosity; + /** The maxTimeMS setting for the command. */ + maxTimeMS?: number; +} + +/** + * @public + * + * When set, this configures an explain command. Valid values are boolean (for legacy compatibility, + * see {@link ExplainVerbosityLike}), a string containing the explain verbosity, or an object containing the verbosity and + * an optional maxTimeMS. + * + * Examples of valid usage: + * + * ```typescript + * collection.find({ name: 'john doe' }, { explain: true }); + * collection.find({ name: 'john doe' }, { explain: false }); + * collection.find({ name: 'john doe' }, { explain: 'queryPlanner' }); + * collection.find({ name: 'john doe' }, { explain: { verbosity: 'queryPlanner' } }); + * ``` + * + * maxTimeMS can be configured to limit the amount of time the server + * spends executing an explain by providing an object: + * + * ```typescript + * // limits the `explain` command to no more than 2 seconds + * collection.find({ name: 'john doe' }, { + * explain: { + * verbosity: 'queryPlanner', + * maxTimeMS: 2000 + * } + * }); + * ``` + */ +export declare interface ExplainOptions { + /** Specifies the verbosity mode for the explain output. */ + explain?: ExplainVerbosityLike | ExplainCommandOptions; +} + +/** @public */ +export declare const ExplainVerbosity: Readonly<{ + readonly queryPlanner: "queryPlanner"; + readonly queryPlannerExtended: "queryPlannerExtended"; + readonly executionStats: "executionStats"; + readonly allPlansExecution: "allPlansExecution"; +}>; + +/** @public */ +export declare type ExplainVerbosity = string; + +/** + * For backwards compatibility, true is interpreted as "allPlansExecution" + * and false as "queryPlanner". + * @public + */ +export declare type ExplainVerbosityLike = ExplainVerbosity | boolean; + +/** A MongoDB filter can be some portion of the schema or a set of operators @public */ +export declare type Filter = { + [P in keyof WithId]?: Condition[P]>; +} & RootFilterOperators>; + +/** @public */ +export declare type FilterOperations = T extends Record ? { + [key in keyof T]?: FilterOperators; +} : FilterOperators; + +/** @public */ +export declare interface FilterOperators extends NonObjectIdLikeDocument { + $eq?: TValue; + $gt?: TValue; + $gte?: TValue; + $in?: ReadonlyArray; + $lt?: TValue; + $lte?: TValue; + $ne?: TValue; + $nin?: ReadonlyArray; + $not?: TValue extends string ? FilterOperators | RegExp : FilterOperators; + /** + * When `true`, `$exists` matches the documents that contain the field, + * including documents where the field value is null. + */ + $exists?: boolean; + $type?: BSONType | BSONTypeAlias; + $expr?: Record; + $jsonSchema?: Record; + $mod?: TValue extends number ? [number, number] : never; + $regex?: TValue extends string ? RegExp | BSONRegExp | string : never; + $options?: TValue extends string ? string : never; + $geoIntersects?: { + $geometry: Document; + }; + $geoWithin?: Document; + $near?: Document; + $nearSphere?: Document; + $maxDistance?: number; + $all?: ReadonlyArray; + $elemMatch?: Document; + $size?: TValue extends ReadonlyArray ? number : never; + $bitsAllClear?: BitwiseFilter; + $bitsAllSet?: BitwiseFilter; + $bitsAnyClear?: BitwiseFilter; + $bitsAnySet?: BitwiseFilter; + $rand?: Record; +} + +/** @public */ +export declare class FindCursor extends ExplainableCursor { + /* Excluded from this release type: cursorFilter */ + /* Excluded from this release type: numReturned */ + /* Excluded from this release type: findOptions */ + /* Excluded from this release type: __constructor */ + clone(): FindCursor; + map(transform: (doc: TSchema) => T): FindCursor; + /* Excluded from this release type: _initialize */ + /* Excluded from this release type: getMore */ + /** + * Get the count of documents for this cursor + * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead + */ + count(options?: CountOptions): Promise; + /** Execute the explain for the cursor */ + explain(): Promise; + explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise; + explain(options: { + timeoutMS?: number; + }): Promise; + explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions, options: { + timeoutMS?: number; + }): Promise; + /** Set the cursor query */ + filter(filter: Document): this; + /** + * Set the cursor hint + * + * @param hint - If specified, then the query system will only consider plans using the hinted index. + */ + hint(hint: Hint): this; + /** + * Set the cursor min + * + * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order. + */ + min(min: Document): this; + /** + * Set the cursor max + * + * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order. + */ + max(max: Document): this; + /** + * Set the cursor returnKey. + * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. + * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. + * + * @param value - the returnKey value. + */ + returnKey(value: boolean): this; + /** + * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection. + * + * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find. + */ + showRecordId(value: boolean): this; + /** + * Add a query modifier to the cursor query + * + * @param name - The query modifier (must start with $, such as $orderby etc) + * @param value - The modifier value. + */ + addQueryModifier(name: string, value: string | boolean | number | Document): this; + /** + * Add a comment to the cursor query allowing for tracking the comment in the log. + * + * @param value - The comment attached to this query. + */ + comment(value: string): this; + /** + * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise) + * + * @param value - Number of milliseconds to wait before aborting the tailed query. + */ + maxAwaitTimeMS(value: number): this; + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value: number): this; + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic + * {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: FindCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor<{ a: number; b: string }> = coll.find(); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.find().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project(value: Document): FindCursor; + /** + * Sets the sort order of the cursor query. + * + * @param sort - The key or keys set for the sort. + * @param direction - The direction of the sorting (1 or -1). + */ + sort(sort: Sort | string, direction?: SortDirection): this; + /** + * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) + * + * @remarks + * {@link https://www.mongodb.com/docs/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation} + */ + allowDiskUse(allow?: boolean): this; + /** + * Set the collation options for the cursor. + * + * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + */ + collation(value: CollationOptions): this; + /** + * Set the limit for the cursor. + * + * @param value - The limit for the cursor query. + */ + limit(value: number): this; + /** + * Set the skip for the cursor. + * + * @param value - The skip for the cursor query. + */ + skip(value: number): this; +} + +/** @public */ +export declare interface FindOneAndDeleteOptions extends CommandOperationOptions { + /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Return the ModifyResult instead of the modified document. Defaults to false + */ + includeResultMetadata?: boolean; +} + +/** @public */ +export declare interface FindOneAndReplaceOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Return the ModifyResult instead of the modified document. Defaults to false + */ + includeResultMetadata?: boolean; +} + +/** @public */ +export declare interface FindOneAndUpdateOptions extends CommandOperationOptions { + /** Optional list of array filters referenced in filtered positional operators */ + arrayFilters?: Document[]; + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Return the ModifyResult instead of the modified document. Defaults to false + */ + includeResultMetadata?: boolean; +} + +/** @public */ +export declare type FindOneOptions = Omit; + +/** + * A builder object that is returned from {@link BulkOperationBase#find}. + * Is used to build a write operation that involves a query filter. + * + * @public + */ +export declare class FindOperators { + bulkOperation: BulkOperationBase; + /* Excluded from this release type: __constructor */ + /** Add a multiple update operation to the bulk operation */ + update(updateDocument: Document | Document[]): BulkOperationBase; + /** Add a single update operation to the bulk operation */ + updateOne(updateDocument: Document | Document[]): BulkOperationBase; + /** Add a replace one operation to the bulk operation */ + replaceOne(replacement: Document): BulkOperationBase; + /** Add a delete one operation to the bulk operation */ + deleteOne(): BulkOperationBase; + /** Add a delete many operation to the bulk operation */ + delete(): BulkOperationBase; + /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */ + upsert(): this; + /** Specifies the collation for the query condition. */ + collation(collation: CollationOptions): this; + /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */ + arrayFilters(arrayFilters: Document[]): this; + /** Specifies hint for the bulk operation. */ + hint(hint: Hint): this; +} + +/** + * @public + */ +export declare interface FindOptions extends Omit, AbstractCursorOptions { + /** Sets the limit of documents returned in the query. */ + limit?: number; + /** Set to sort the documents coming back from the query. Array of indexes, `[['a', 1]]` etc. */ + sort?: Sort; + /** The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` **or** `{'a': 0, 'b': 0}` */ + projection?: Document; + /** Set to skip N documents ahead in your query (useful for pagination). */ + skip?: number; + /** Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}` */ + hint?: Hint; + /** Specify if the cursor can timeout. */ + timeout?: boolean; + /** Specify if the cursor is tailable. */ + tailable?: boolean; + /** Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true */ + awaitData?: boolean; + /** Set the batchSize for the getMoreCommand when iterating over the query results. */ + batchSize?: number; + /** If true, returns only the index keys in the resulting documents. */ + returnKey?: boolean; + /** The inclusive lower bound for a specific index */ + min?: Document; + /** The exclusive upper bound for a specific index */ + max?: Document; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true */ + maxAwaitTimeMS?: number; + /** The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that. */ + noCursorTimeout?: boolean; + /** Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). */ + collation?: CollationOptions; + /** Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) */ + allowDiskUse?: boolean; + /** Determines whether to close the cursor after the first batch. Defaults to false. */ + singleBatch?: boolean; + /** For queries against a sharded collection, allows the command (or subsequent getMore commands) to return partial results, rather than an error, if one or more queried shards are unavailable. */ + allowPartialResults?: boolean; + /** Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents. */ + showRecordId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Option to enable an optimized code path for queries looking for a particular range of `ts` values in the oplog. Requires `tailable` to be true. + * @deprecated Starting from MongoDB 4.4 this flag is not needed and will be ignored. + */ + oplogReplay?: boolean; + /** + * Specifies the verbosity mode for the explain output. + * @deprecated This API is deprecated in favor of `collection.find().explain()`. + */ + explain?: ExplainOptions['explain']; + /* Excluded from this release type: timeoutMode */ +} + +/** @public */ +export declare type Flatten = Type extends ReadonlyArray ? Item : Type; + +/** + * @public + * Configuration options for making an AWS encryption key + */ +export declare interface GCPEncryptionKeyOptions { + /** + * GCP project ID + */ + projectId: string; + /** + * Location name (e.g. "global") + */ + location: string; + /** + * Key ring name + */ + keyRing: string; + /** + * Key name + */ + keyName: string; + /** + * Key version + */ + keyVersion?: string | undefined; + /** + * KMS URL, defaults to `https://www.googleapis.com/auth/cloudkms` + */ + endpoint?: string | undefined; +} + +/** @public */ +export declare type GCPKMSProviderConfiguration = { + /** + * The service account email to authenticate + */ + email: string; + /** + * A PKCS#8 encrypted key. This can either be a base64 string or a binary representation + */ + privateKey: string | Buffer; + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * Defaults to "oauth2.googleapis.com" + */ + endpoint?: string | undefined; +} | { + /** + * If present, an access token to authenticate with GCP. + */ + accessToken: string; +}; + +/** @public */ +export declare type GenericListener = (...args: any[]) => void; + +/** + * Constructor for a streaming GridFS interface + * @public + */ +export declare class GridFSBucket extends TypedEventEmitter { + /* Excluded from this release type: s */ + /** + * When the first call to openUploadStream is made, the upload stream will + * check to see if it needs to create the proper indexes on the chunks and + * files collections. This event is fired either when 1) it determines that + * no index creation is necessary, 2) when it successfully creates the + * necessary indexes. + * @event + */ + static readonly INDEX: "index"; + constructor(db: Db, options?: GridFSBucketOptions); + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS. The stream's 'id' property contains the resulting + * file's id. + * + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + openUploadStream(filename: string, options?: GridFSBucketWriteStreamOptions): GridFSBucketWriteStream; + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting + * file's id. + */ + openUploadStreamWithId(id: ObjectId, filename: string, options?: GridFSBucketWriteStreamOptions): GridFSBucketWriteStream; + /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ + openDownloadStream(id: ObjectId, options?: GridFSBucketReadStreamOptions): GridFSBucketReadStream; + /** + * Deletes a file with the given id + * + * @param id - The id of the file doc + */ + delete(id: ObjectId, options?: { + timeoutMS: number; + }): Promise; + /** Convenience wrapper around find on the files collection */ + find(filter?: Filter, options?: FindOptions): FindCursor; + /** + * Returns a readable stream (GridFSBucketReadStream) for streaming the + * file with the given name from GridFS. If there are multiple files with + * the same name, this will stream the most recent file with the given name + * (as determined by the `uploadDate` field). You can set the `revision` + * option to change this behavior. + */ + openDownloadStreamByName(filename: string, options?: GridFSBucketReadStreamOptionsWithRevision): GridFSBucketReadStream; + /** + * Renames the file with the given _id to the given string + * + * @param id - the id of the file to rename + * @param filename - new name for the file + */ + rename(id: ObjectId, filename: string, options?: { + timeoutMS: number; + }): Promise; + /** Removes this bucket's files collection, followed by its chunks collection. */ + drop(options?: { + timeoutMS: number; + }): Promise; +} + +/** @public */ +export declare type GridFSBucketEvents = { + index(): void; +}; + +/** @public */ +export declare interface GridFSBucketOptions extends WriteConcernOptions { + /** The 'files' and 'chunks' collections will be prefixed with the bucket name followed by a dot. */ + bucketName?: string; + /** Number of bytes stored in each chunk. Defaults to 255KB */ + chunkSizeBytes?: number; + /** Read preference to be passed to read operations */ + readPreference?: ReadPreference; + /** + * @experimental + * Specifies the lifetime duration of a gridFS stream. If any async operations are in progress + * when this timeout expires, the stream will throw a timeout error. + */ + timeoutMS?: number; +} + +/* Excluded from this release type: GridFSBucketPrivate */ + +/** + * A readable stream that enables you to read buffers from GridFS. + * + * Do not instantiate this class directly. Use `openDownloadStream()` instead. + * @public + */ +export declare class GridFSBucketReadStream extends Readable { + /* Excluded from this release type: s */ + /** + * Fires when the stream loaded the file document corresponding to the provided id. + * @event + */ + static readonly FILE: "file"; + /* Excluded from this release type: __constructor */ + /* Excluded from this release type: _read */ + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param start - 0-based offset in bytes to start streaming from + */ + start(start?: number): this; + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param end - Offset in bytes to stop reading at + */ + end(end?: number): this; + /** + * Marks this stream as aborted (will never push another `data` event) + * and kills the underlying cursor. Will emit the 'end' event, and then + * the 'close' event once the cursor is successfully killed. + */ + abort(): Promise; +} + +/** @public */ +export declare interface GridFSBucketReadStreamOptions { + sort?: Sort; + skip?: number; + /** + * 0-indexed non-negative byte offset from the beginning of the file + */ + start?: number; + /** + * 0-indexed non-negative byte offset to the end of the file contents + * to be returned by the stream. `end` is non-inclusive + */ + end?: number; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/** @public */ +export declare interface GridFSBucketReadStreamOptionsWithRevision extends GridFSBucketReadStreamOptions { + /** The revision number relative to the oldest file with the given filename. 0 + * gets you the oldest file, 1 gets you the 2nd oldest, -1 gets you the + * newest. */ + revision?: number; +} + +/* Excluded from this release type: GridFSBucketReadStreamPrivate */ + +/** + * A writable stream that enables you to write buffers to GridFS. + * + * Do not instantiate this class directly. Use `openUploadStream()` instead. + * @public + */ +export declare class GridFSBucketWriteStream extends Writable { + bucket: GridFSBucket; + /** A Collection instance where the file's chunks are stored */ + chunks: Collection; + /** A Collection instance where the file's GridFSFile document is stored */ + files: Collection; + /** The name of the file */ + filename: string; + /** Options controlling the metadata inserted along with the file */ + options: GridFSBucketWriteStreamOptions; + /** Indicates the stream is finished uploading */ + done: boolean; + /** The ObjectId used for the `_id` field on the GridFSFile document */ + id: ObjectId; + /** The number of bytes that each chunk will be limited to */ + chunkSizeBytes: number; + /** Space used to store a chunk currently being inserted */ + bufToStore: Uint8Array; + /** Accumulates the number of bytes inserted as the stream uploads chunks */ + length: number; + /** Accumulates the number of chunks inserted as the stream uploads file contents */ + n: number; + /** Tracks the current offset into the buffered bytes being uploaded */ + pos: number; + /** Contains a number of properties indicating the current state of the stream */ + state: { + /** If set the stream has ended */ + streamEnd: boolean; + /** Indicates the number of chunks that still need to be inserted to exhaust the current buffered data */ + outstandingRequests: number; + /** If set an error occurred during insertion */ + errored: boolean; + /** If set the stream was intentionally aborted */ + aborted: boolean; + }; + /** The write concern setting to be used with every insert operation */ + writeConcern?: WriteConcern; + /** + * The document containing information about the inserted file. + * This property is defined _after_ the finish event has been emitted. + * It will remain `null` if an error occurs. + * + * @example + * ```ts + * fs.createReadStream('file.txt') + * .pipe(bucket.openUploadStream('file.txt')) + * .on('finish', function () { + * console.log(this.gridFSFile) + * }) + * ``` + */ + gridFSFile: GridFSFile | null; + /* Excluded from this release type: timeoutContext */ + /* Excluded from this release type: __constructor */ + /* Excluded from this release type: _construct */ + /* Excluded from this release type: _write */ + /* Excluded from this release type: _final */ + /** + * Places this write stream into an aborted state (all future writes fail) + * and deletes all chunks that have already been written. + */ + abort(): Promise; +} + +/** @public */ +export declare interface GridFSBucketWriteStreamOptions extends WriteConcernOptions { + /** Overwrite this bucket's chunkSizeBytes for this file */ + chunkSizeBytes?: number; + /** Custom file id for the GridFS file. */ + id?: ObjectId; + /** Object to store in the file document's `metadata` field */ + metadata?: Document; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/** @public */ +export declare interface GridFSChunk { + _id: ObjectId; + files_id: ObjectId; + n: number; + data: Buffer | Uint8Array; +} + +/** @public */ +export declare interface GridFSFile { + _id: ObjectId; + length: number; + chunkSize: number; + filename: string; + metadata?: Document; + uploadDate: Date; +} + +/** @public */ +export declare const GSSAPICanonicalizationValue: Readonly<{ + readonly on: true; + readonly off: false; + readonly none: "none"; + readonly forward: "forward"; + readonly forwardAndReverse: "forwardAndReverse"; +}>; + +/** @public */ +export declare type GSSAPICanonicalizationValue = (typeof GSSAPICanonicalizationValue)[keyof typeof GSSAPICanonicalizationValue]; + +/* Excluded from this release type: HandshakeDocument */ + +/** @public */ +export declare interface HedgeOptions { + /** Explicitly enable or disable hedged reads. */ + enabled?: boolean; +} + +/** @public */ +export declare type Hint = string | Document; + +/** @public */ +export declare class HostAddress { + host: string | undefined; + port: number | undefined; + socketPath: string | undefined; + isIPv6: boolean; + constructor(hostString: string); + inspect(): string; + toString(): string; + static fromString(this: void, s: string): HostAddress; + static fromHostPort(host: string, port: number): HostAddress; + static fromSrvRecord({ name, port }: SrvRecord): HostAddress; + toHostPort(): { + host: string; + port: number; + }; +} + +/** + * The information returned by the server on the IDP server. + * @public + */ +export declare interface IdPInfo { + /** + * A URL which describes the Authentication Server. This identifier should + * be the iss of provided access tokens, and be viable for RFC8414 metadata + * discovery and RFC9207 identification. + */ + issuer: string; + /** A unique client ID for this OIDC client. */ + clientId: string; + /** A list of additional scopes to request from IdP. */ + requestScopes?: string[]; +} + +/** + * The response from the IdP server with the access token and + * optional expiration time and refresh token. + * @public + */ +export declare interface IdPServerResponse { + /** The OIDC access token. */ + accessToken: string; + /** The time when the access token expires. For future use. */ + expiresInSeconds?: number; + /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */ + refreshToken?: string; +} + +/** @public */ +export declare interface IndexDescription extends Pick { + collation?: CollationOptions; + name?: string; + key: { + [key: string]: IndexDirection; + } | Map; +} + +/** @public */ +export declare type IndexDescriptionCompact = Record; + +/** + * @public + * The index information returned by the listIndexes command. https://www.mongodb.com/docs/manual/reference/command/listIndexes/#mongodb-dbcommand-dbcmd.listIndexes + */ +export declare type IndexDescriptionInfo = Omit & { + key: { + [key: string]: IndexDirection; + }; + v?: IndexDescription['version']; +} & Document; + +/** @public */ +export declare type IndexDirection = -1 | 1 | '2d' | '2dsphere' | 'text' | 'geoHaystack' | 'hashed' | number; + +/** @public */ +export declare interface IndexInformationOptions extends ListIndexesOptions { + /** + * When `true`, an array of index descriptions is returned. + * When `false`, the driver returns an object that with keys corresponding to index names with values + * corresponding to the entries of the indexes' key. + * + * For example, the given the following indexes: + * ``` + * [ { name: 'a_1', key: { a: 1 } }, { name: 'b_1_c_1' , key: { b: 1, c: 1 } }] + * ``` + * + * When `full` is `true`, the above array is returned. When `full` is `false`, the following is returned: + * ``` + * { + * 'a_1': [['a', 1]], + * 'b_1_c_1': [['b', 1], ['c', 1]], + * } + * ``` + */ + full?: boolean; +} + +/** @public */ +export declare type IndexSpecification = OneOrMore>; + +/** Given an object shaped type, return the type of the _id field or default to ObjectId @public */ +export declare type InferIdType = TSchema extends { + _id: infer IdType; +} ? Record extends IdType ? never : IdType : TSchema extends { + _id?: infer IdType; +} ? unknown extends IdType ? ObjectId : IdType : ObjectId; + +/* Excluded from this release type: InitialCursorResponse */ + +/** @public */ +export declare interface InsertManyResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of inserted documents for this operations */ + insertedCount: number; + /** Map of the index of the inserted document to the id of the inserted document */ + insertedIds: { + [key: number]: InferIdType; + }; +} + +/** @public */ +export declare interface InsertOneModel { + /** The document to insert. */ + document: OptionalId; +} + +/** @public */ +export declare interface InsertOneOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; +} + +/** @public */ +export declare interface InsertOneResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The identifier that was inserted. If the server generated the identifier, this value will be null as the driver does not have access to that data */ + insertedId: InferIdType; +} + +export { Int32 } + +/** @public */ +export declare type IntegerType = number | Int32 | Long | bigint; + +/* Excluded from this release type: InternalAbstractCursorOptions */ + +/** @public */ +export declare type IsAny = true extends false & Type ? ResultIfAny : ResultIfNotAny; + +/** + * Helper types for dot-notation filter attributes + */ +/** @public */ +export declare type Join = T extends [] ? '' : T extends [string | number] ? `${T[0]}` : T extends [string | number, ...infer R] ? `${T[0]}${D}${Join}` : string; + +/* Excluded from this release type: JSTypeOf */ + +/* Excluded from this release type: kDecorateResult */ + +/** @public */ +export declare type KeysOfAType = { + [key in keyof TSchema]: NonNullable extends Type ? key : never; +}[keyof TSchema]; + +/** @public */ +export declare type KeysOfOtherType = { + [key in keyof TSchema]: NonNullable extends Type ? never : key; +}[keyof TSchema]; + +/** + * @public + * Configuration options for making a KMIP encryption key + */ +export declare interface KMIPEncryptionKeyOptions { + /** + * keyId is the KMIP Unique Identifier to a 96 byte KMIP Secret Data managed object. + * + * If keyId is omitted, a random 96 byte KMIP Secret Data managed object will be created. + */ + keyId?: string; + /** + * Host with optional port. + */ + endpoint?: string; + /** + * If true, this key should be decrypted by the KMIP server. + * + * Requires `mongodb-client-encryption>=6.0.1`. + */ + delegated?: boolean; +} + +/** @public */ +export declare interface KMIPKMSProviderConfiguration { + /** + * The output endpoint string. + * The endpoint consists of a hostname and port separated by a colon. + * E.g. "example.com:123". A port is always present. + */ + endpoint?: string; +} + +/** + * @public + * + * A callback that establishes the connection to a KMS host. + * + * When provided on `AutoEncryptionOptions` or `ClientEncryptionOptions`, the driver invokes this + * callback instead of connecting to the KMS host itself, passing the target `host` and `port`. The + * callback MUST return a `Duplex` stream connected to the KMS host, either directly or tunneled + * through a proxy; a `net.Socket` satisfies this, as does any other `Duplex`. The returned stream is + * passed to Node.js' `tls.connect()` as its `socket`, and the driver performs the KMS host's TLS + * handshake over it using the KMS provider's configured TLS options. The callback therefore MUST NOT + * perform the KMS host's TLS handshake itself, though it MAY use TLS for its own transport, e.g. when + * connecting to an HTTPS proxy. This enables routing KMS requests through an HTTP proxy via the HTTP + * CONNECT method. + * + * When the operation has a client-side operation timeout (CSOT) configured, `timeoutMS` is the + * remaining time budget in milliseconds; it is `undefined` otherwise. The `signal` aborts when the + * connection attempt exceeds that budget; the callback should stop connecting and reject when it fires. + * + * @example Route KMS requests through an HTTP proxy using the HTTP CONNECT method + * ```ts + * import * as net from 'net'; + * + * const kmsConnectCallback: KMSConnectCallback = ({ host, port, signal }) => + * new Promise((resolve, reject) => { + * // Open a plain connection to the proxy, not to the KMS host. + * const socket = net.connect({ host: 'proxy.example.com', port: 8080, signal }); + * socket.once('error', reject); + * socket.once('connect', () => { + * // Ask the proxy to tunnel to the KMS host, then hand the socket back for the driver's TLS. + * socket.write(`CONNECT ${host}:${port} HTTP/1.1\r\nHost: ${host}:${port}\r\n\r\n`); + * socket.once('data', chunk => { + * if (chunk.toString('utf8').startsWith('HTTP/1.1 200')) resolve(socket); + * else reject(new Error('Proxy refused the CONNECT request')); + * }); + * }); + * }); + * + * const clientEncryption = new ClientEncryption(keyVaultClient, { + * keyVaultNamespace, + * kmsProviders, + * kmsConnectCallback + * }); + * ``` + */ +export declare type KMSConnectCallback = (options: { + host: string; + port: number; + timeoutMS?: number; + signal: AbortSignal; +}) => Promise; + +/** + * @public + * Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. + * + * Named KMS providers _are not supported_ for automatic KMS credential fetching. + */ +export declare interface KMSProviders { + /** + * Configuration options for using 'aws' as your KMS provider + */ + aws?: AWSKMSProviderConfiguration | Record; + [key: `aws:${string}`]: AWSKMSProviderConfiguration; + /** + * Configuration options for using 'local' as your KMS provider + */ + local?: LocalKMSProviderConfiguration; + [key: `local:${string}`]: LocalKMSProviderConfiguration; + /** + * Configuration options for using 'kmip' as your KMS provider + */ + kmip?: KMIPKMSProviderConfiguration; + [key: `kmip:${string}`]: KMIPKMSProviderConfiguration; + /** + * Configuration options for using 'azure' as your KMS provider + */ + azure?: AzureKMSProviderConfiguration | Record; + [key: `azure:${string}`]: AzureKMSProviderConfiguration; + /** + * Configuration options for using 'gcp' as your KMS provider + */ + gcp?: GCPKMSProviderConfiguration | Record; + [key: `gcp:${string}`]: GCPKMSProviderConfiguration; +} + +/* Excluded from this release type: LegacyTimeoutContext */ + +/* Excluded from this release type: LegacyTimeoutContextOptions */ + +/** @public */ +export declare const LEGAL_TCP_SOCKET_OPTIONS: readonly ["autoSelectFamily", "autoSelectFamilyAttemptTimeout", "keepAliveInitialDelay", "family", "hints", "localAddress", "localPort", "lookup"]; + +/** @public */ +export declare const LEGAL_TLS_SOCKET_OPTIONS: readonly ["allowPartialTrustChain", "ALPNProtocols", "ca", "cert", "checkServerIdentity", "ciphers", "crl", "ecdhCurve", "key", "minDHSize", "passphrase", "pfx", "rejectUnauthorized", "secureContext", "secureProtocol", "servername", "session"]; + +/* Excluded from this release type: List */ + +/** @public */ +export declare class ListCollectionsCursor | CollectionInfo = Pick | CollectionInfo> extends AbstractCursor { + parent: Db; + filter: Document; + options?: ListCollectionsOptions & Abortable; + constructor(db: Db, filter: Document, options?: ListCollectionsOptions & Abortable); + clone(): ListCollectionsCursor; + /* Excluded from this release type: _initialize */ +} + +/** @public */ +export declare interface ListCollectionsOptions extends Omit, Abortable { + /** If true, will only return the collection name in the response, and will omit additional info */ + nameOnly?: boolean; + /** If true and nameOnly is true, allows a user without the required privilege (i.e. listCollections action on the database) to run the command when access control is enforced. */ + authorizedCollections?: boolean; + /** The batchSize for the returned command cursor */ + batchSize?: number; + /* Excluded from this release type: timeoutMode */ + /* Excluded from this release type: timeoutContext */ +} + +/** @public */ +export declare interface ListDatabasesOptions extends Omit { + /** A query predicate that determines which databases are listed */ + filter?: Document; + /** A flag to indicate whether the command should return just the database names, or return both database names and size information */ + nameOnly?: boolean; + /** A flag that determines which databases are returned based on the user privileges when access control is enabled */ + authorizedDatabases?: boolean; +} + +/** @public */ +export declare interface ListDatabasesResult { + databases: ({ + name: string; + sizeOnDisk?: number; + empty?: boolean; + } & Document)[]; + totalSize?: number; + totalSizeMb?: number; + ok: 1 | 0; +} + +/** @public */ +export declare class ListIndexesCursor extends AbstractCursor { + parent: Collection; + options?: ListIndexesOptions; + constructor(collection: Collection, options?: ListIndexesOptions); + clone(): ListIndexesCursor; + /* Excluded from this release type: _initialize */ +} + +/** @public */ +export declare type ListIndexesOptions = AbstractCursorOptions & { + /* Excluded from this release type: omitMaxTimeMS */ + /* Excluded from this release type: rawData */ +}; + +/** @public */ +export declare class ListSearchIndexesCursor extends AggregationCursor<{ + name: string; +}> { + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare type ListSearchIndexesOptions = Omit; + +/** @public */ +export declare interface LocalKMSProviderConfiguration { + /** + * The master key used to encrypt/decrypt data keys. + * A 96-byte long Buffer or base64 encoded string. + */ + key: Binary | Uint8Array | string; +} + +/** @public */ +export declare interface Log extends Record { + t: Date; + c: MongoLoggableComponent; + s: SeverityLevel; + message?: string; +} + +/** @public */ +export declare interface LogComponentSeveritiesClientOptions { + /** Optional severity level for command component */ + command?: SeverityLevel; + /** Optional severity level for topology component */ + topology?: SeverityLevel; + /** Optional severity level for server selection component */ + serverSelection?: SeverityLevel; + /** Optional severity level for connection component */ + connection?: SeverityLevel; + /** Optional severity level for client component */ + client?: SeverityLevel; + /** Optional default severity level to be used if any of the above are unset */ + default?: SeverityLevel; +} + +/* Excluded from this release type: LogConvertible */ + +/* Excluded from this release type: Loggable */ + +/* Excluded from this release type: LoggableCommandFailedEvent */ + +/* Excluded from this release type: LoggableCommandSucceededEvent */ + +/* Excluded from this release type: LoggableEvent */ + +/* Excluded from this release type: LoggableServerHeartbeatFailedEvent */ + +/* Excluded from this release type: LoggableServerHeartbeatStartedEvent */ + +/* Excluded from this release type: LoggableServerHeartbeatSucceededEvent */ +export { Long } + +/** @public */ +export declare type MatchKeysAndValues = Readonly> & Record; + +export { MaxKey } + +/* Excluded from this release type: MessageHeader */ +export { MinKey } + +/** @public */ +export declare interface ModifyResult { + value: WithId | null; + lastErrorObject?: Document; + ok: 0 | 1; +} + +/** @public */ +export declare const MONGO_CLIENT_EVENTS: readonly ["connectionPoolCreated", "connectionPoolReady", "connectionPoolCleared", "connectionPoolClosed", "connectionCreated", "connectionReady", "connectionClosed", "connectionCheckOutStarted", "connectionCheckOutFailed", "connectionCheckedOut", "connectionCheckedIn", "commandStarted", "commandSucceeded", "commandFailed", "serverOpening", "serverClosed", "serverDescriptionChanged", "topologyOpening", "topologyClosed", "topologyDescriptionChanged", "error", "timeout", "close", "serverHeartbeatStarted", "serverHeartbeatSucceeded", "serverHeartbeatFailed"]; + +/** + * An error generated when the driver API is used incorrectly + * + * @privateRemarks + * Should **never** be directly instantiated + * + * @public + * @category Error + */ +export declare class MongoAPIError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * A error generated when the user attempts to authenticate + * via AWS, but fails + * + * @public + * @category Error + */ +export declare class MongoAWSError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * A error generated when the user attempts to authenticate + * via Azure, but fails. + * + * @public + * @category Error + */ +export declare class MongoAzureError extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated when a batch command is re-executed after one of the commands in the batch + * has failed + * + * @public + * @category Error + */ +export declare class MongoBatchReExecutionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string); + get name(): string; +} + +/** + * An error indicating an unsuccessful Bulk Write + * @public + * @category Error + */ +export declare class MongoBulkWriteError extends MongoServerError { + result: BulkWriteResult; + writeErrors: OneOrMore; + err?: WriteConcernError; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(error: { + message: string; + code: number; + writeErrors?: WriteError[]; + } | WriteConcernError | AnyError, result: BulkWriteResult); + get name(): string; + /** Number of documents inserted. */ + get insertedCount(): number; + /** Number of documents matched for update. */ + get matchedCount(): number; + /** Number of documents modified. */ + get modifiedCount(): number; + /** Number of documents deleted. */ + get deletedCount(): number; + /** Number of documents upserted. */ + get upsertedCount(): number; + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds(): { + [key: number]: any; + }; + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds(): { + [key: number]: any; + }; +} + +/** + * An error generated when a ChangeStream operation fails to execute. + * + * @public + * @category Error + */ +export declare class MongoChangeStreamError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * @public + * + * The **MongoClient** class is a class that allows for making Connections to MongoDB. + * + * **NOTE:** The programmatically provided options take precedence over the URI options. + * + * @remarks + * + * A MongoClient is the entry point to connecting to a MongoDB server. + * + * It handles a multitude of features on your application's behalf: + * - **Server Host Connection Configuration**: A MongoClient is responsible for reading TLS cert, ca, and crl files if provided. + * - **SRV Record Polling**: A "`mongodb+srv`" style connection string is used to have the MongoClient resolve DNS SRV records of all server hostnames which the driver periodically monitors for changes and adjusts its current view of hosts correspondingly. + * - **Server Monitoring**: The MongoClient automatically keeps monitoring the health of server nodes in your cluster to reach out to the correct and lowest latency one available. + * - **Connection Pooling**: To avoid paying the cost of rebuilding a connection to the server on every operation the MongoClient keeps idle connections preserved for reuse. + * - **Session Pooling**: The MongoClient creates logical sessions that enable retryable writes, causal consistency, and transactions. It handles pooling these sessions for reuse in subsequent operations. + * - **Cursor Operations**: A MongoClient's cursors use the health monitoring system to send the request for more documents to the same server the query began on. + * - **Mongocryptd process**: When using auto encryption, a MongoClient will launch a `mongocryptd` instance for handling encryption if the mongocrypt shared library isn't in use. + * + * There are many more features of a MongoClient that are not listed above. + * + * In order to enable these features, a number of asynchronous Node.js resources are established by the driver: Timers, FS Requests, Sockets, etc. + * For details on cleanup, please refer to the MongoClient `close()` documentation. + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * // Enable command monitoring for debugging + * const client = new MongoClient('mongodb://localhost:27017?appName=mflix', { monitorCommands: true }); + * ``` + */ +export declare class MongoClient extends TypedEventEmitter implements AsyncDisposable { + /* Excluded from this release type: s */ + /* Excluded from this release type: topology */ + /* Excluded from this release type: mongoLogger */ + /* Excluded from this release type: connectionLock */ + /* Excluded from this release type: closeLock */ + /** + * The consolidate, parsed, transformed and merged options. + */ + readonly options: Readonly> & Pick & { + /* Excluded from this release type: metadata */ + }; + private driverInfoList; + constructor(url: string, options?: MongoClientOptions); + /** + * An alias for {@link MongoClient.close|MongoClient.close()}. + */ + [Symbol.asyncDispose](): Promise; + /** + * Append metadata to the client metadata after instantiation. + * @param driverInfo - Information about the application or library. + */ + appendMetadata(driverInfo: DriverInfo): void; + /* Excluded from this release type: checkForNonGenuineHosts */ + get serverApi(): Readonly; + /* Excluded from this release type: monitorCommands */ + /* Excluded from this release type: monitorCommands */ + /* Excluded from this release type: autoEncrypter */ + get readConcern(): ReadConcern | undefined; + get writeConcern(): WriteConcern | undefined; + get readPreference(): ReadPreference; + get bsonOptions(): BSONSerializeOptions; + get timeoutMS(): number | undefined; + /** + * Executes a client bulk write operation, available on server 8.0+. + * @param models - The client bulk write models. + * @param options - The client bulk write options. + * @returns A ClientBulkWriteResult for acknowledged writes and ok: 1 for unacknowledged writes. + */ + bulkWrite = Record>(models: ReadonlyArray>, options?: ClientBulkWriteOptions): Promise; + /** + * An optional method to verify a handful of assumptions that are generally useful at application boot-time before using a MongoClient. + * For detailed information about the connect process see the MongoClient.connect static method documentation. + * + * @param url - The MongoDB connection string (supports `mongodb://` and `mongodb+srv://` schemes) + * @param options - Optional configuration options for the client + * + * @see https://www.mongodb.com/docs/manual/reference/connection-string/ + */ + connect(): Promise; + /* Excluded from this release type: _connect */ + /** + * Cleans up resources managed by the MongoClient. + * + * The close method clears and closes all resources whose lifetimes are managed by the MongoClient. + * Please refer to the `MongoClient` class documentation for a high level overview of the client's key features and responsibilities. + * + * **However,** the close method does not handle the cleanup of resources explicitly created by the user. + * Any user-created driver resource with its own `close()` method should be explicitly closed by the user before calling MongoClient.close(). + * This method is written as a "best effort" attempt to leave behind the least amount of resources server-side when possible. + * + * The following list defines ideal preconditions and consequent pitfalls if they are not met. + * The MongoClient, ClientSession, Cursors and ChangeStreams all support [explicit resource management](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html). + * By using explicit resource management to manage the lifetime of driver resources instead of manually managing their lifetimes, the pitfalls outlined below can be avoided. + * + * The close method performs the following in the order listed: + * - Client-side: + * - **Close in-use connections**: Any connections that are currently waiting on a response from the server will be closed. + * This is performed _first_ to avoid reaching the next step (server-side clean up) and having no available connections to check out. + * - _Ideal_: All operations have been awaited or cancelled, and the outcomes, regardless of success or failure, have been processed before closing the client servicing the operation. + * - _Pitfall_: When `client.close()` is called and all connections are in use, after closing them, the client must create new connections for cleanup operations, which comes at the cost of new TLS/TCP handshakes and authentication steps. + * - Server-side: + * - **Close active cursors**: All cursors that haven't been completed will have a `killCursor` operation sent to the server they were initialized on, freeing the server-side resource. + * - _Ideal_: Cursors are explicitly closed or completed before `client.close()` is called. + * - _Pitfall_: `killCursors` may have to build a new connection if the in-use closure ended all pooled connections. + * - **End active sessions**: In-use sessions created with `client.startSession()` or `client.withSession()` or implicitly by the driver will have their `.endSession()` method called. + * Contrary to the name of the method, `endSession()` returns the session to the client's pool of sessions rather than end them on the server. + * - _Ideal_: Transaction outcomes are awaited and their corresponding explicit sessions are ended before `client.close()` is called. + * - _Pitfall_: **This step aborts in-progress transactions**. It is advisable to observe the outcome of a transaction before closing your client. + * - **End all pooled sessions**: The `endSessions` command with all session IDs the client has pooled is sent to the server to inform the cluster it can clean them up. + * - _Ideal_: No user intervention is expected. + * - _Pitfall_: None. + * + * The remaining shutdown is of the MongoClient resources that are intended to be entirely internal but is documented here as their existence relates to the JS event loop. + * + * - Client-side (again): + * - **Stop all server monitoring**: Connections kept live for detecting cluster changes and roundtrip time measurements are shutdown. + * - **Close all pooled connections**: Each server node in the cluster has a corresponding connection pool and all connections in the pool are closed. Any operations waiting to check out a connection will have an error thrown instead of a connection returned. + * - **Clear out server selection queue**: Any operations that are in the process of waiting for a server to be selected will have an error thrown instead of a server returned. + * - **Close encryption-related resources**: An internal MongoClient created for communicating with `mongocryptd` or other encryption purposes is closed. (Using this same method of course!) + * + * After the close method completes there should be no MongoClient related resources [ref-ed in Node.js' event loop](https://docs.libuv.org/en/v1.x/handle.html#reference-counting). + * This should allow Node.js to exit gracefully if MongoClient resources were the only active handles in the event loop. + * + * @param _force - currently an unused flag that has no effect. Defaults to `false`. + */ + close(_force?: boolean): Promise; + private _close; + /** + * Create a new Db instance sharing the current socket connections. + * + * @param dbName - The name of the database we want to use. If not provided, use database name from connection string. + * @param options - Optional settings for Db construction + */ + db(dbName?: string, options?: DbOptions): Db; + /** + * Creates a new MongoClient instance and immediately connects it to MongoDB. + * This convenience method combines `new MongoClient(url, options)` and `client.connect()` in a single step. + * + * Connect can be helpful to detect configuration issues early by validating: + * - **DNS Resolution**: Verifies that SRV records and hostnames in the connection string resolve DNS entries + * - **Network Connectivity**: Confirms that host addresses are reachable and ports are open + * - **TLS Configuration**: Validates SSL/TLS certificates, CA files, and encryption settings are correct + * - **Authentication**: Verifies that provided credentials are valid + * - **Server Compatibility**: Ensures the MongoDB server version is supported by this driver version + * - **Load Balancer Setup**: For load-balanced deployments, confirms the service is properly configured + * + * @returns A promise that resolves to the same MongoClient instance once connected + * + * @remarks + * **Connection is Optional:** Calling `connect` is optional since any operation method (`find`, `insertOne`, etc.) + * will automatically perform these same validation steps if the client is not already connected. + * However, explicitly calling `connect` can make sense for: + * - **Fail-fast Error Detection**: Non-transient connection issues (hostname unresolved, port refused connection) are discovered immediately rather than during your first operation + * - **Predictable Performance**: Eliminates first connection overhead from your first database operation + * + * @remarks + * **Connection Pooling Impact:** Calling `connect` will populate the connection pool with one connection + * to a server selected by the client's configured `readPreference` (defaults to primary). + * + * @remarks + * **Timeout Behavior:** When using `timeoutMS`, the connection establishment time does not count against + * the timeout for subsequent operations. This means `connect` runs without a `timeoutMS` limit, while + * your database operations will still respect the configured timeout. If you need predictable operation + * timing with `timeoutMS`, call `connect` explicitly before performing operations. + * + * @see https://www.mongodb.com/docs/manual/reference/connection-string/ + */ + static connect(url: string, options?: MongoClientOptions): Promise; + /** + * Creates a new ClientSession. When using the returned session in an operation + * a corresponding ServerSession will be created. + * + * @remarks + * A ClientSession instance may only be passed to operations being performed on the same + * MongoClient it was started from. + */ + startSession(options?: ClientSessionOptions): ClientSession; + /** + * A convenience method for creating and handling the clean up of a ClientSession. + * The session will always be ended when the executor finishes. + * + * @param executor - An executor function that all operations using the provided session must be invoked in + * @param options - optional settings for the session + */ + withSession(executor: WithSessionCallback): Promise; + withSession(options: ClientSessionOptions, executor: WithSessionCallback): Promise; + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this cluster. Will ignore all + * changes to system collections, as well as the local, admin, and config databases. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the data within the current cluster + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream; +} + +/* Excluded from this release type: MongoClientAuthProviders */ + +/** + * An error indicating that an error occurred when processing bulk write results. + * + * @public + * @category Error + */ +export declare class MongoClientBulkWriteCursorError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error indicating that an error occurred when executing the bulk write. + * + * @public + * @category Error + */ +export declare class MongoClientBulkWriteError extends MongoServerError { + /** + * Write concern errors that occurred while executing the bulk write. This list may have + * multiple items if more than one server command was required to execute the bulk write. + */ + writeConcernErrors: Document[]; + /** + * Errors that occurred during the execution of individual write operations. This map will + * contain at most one entry if the bulk write was ordered. + */ + writeErrors: Map; + /** + * The results of any successful operations that were performed before the error was + * encountered. + */ + partialResult?: ClientBulkWriteResult; + /** + * Initialize the client bulk write error. + * @param message - The error message. + */ + constructor(message: ErrorDescription); + get name(): string; +} + +/** + * An error indicating that an error occurred on the client when executing a client bulk write. + * + * @public + * @category Error + */ +export declare class MongoClientBulkWriteExecutionError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated when the MongoClient is closed and async + * operations are interrupted. + * + * @public + * @category Error + */ +export declare class MongoClientClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(); + get name(): string; +} + +/** @public */ +export declare type MongoClientEvents = Pick & { + open(mongoClient: MongoClient): void; +}; + +/** + * Describes all possible URI query options for the mongo client + * @public + * @see https://www.mongodb.com/docs/manual/reference/connection-string + */ +export declare interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeConnectionOptions { + /** Specifies the name of the replica set, if the mongod is a member of a replica set. */ + replicaSet?: string; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; + /** Enables or disables TLS/SSL for the connection. */ + tls?: boolean; + /** A boolean to enable or disables TLS/SSL for the connection. (The ssl option is equivalent to the tls option.) */ + ssl?: boolean; + /** Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key. */ + tlsCertificateKeyFile?: string; + /** Specifies the password to de-crypt the tlsCertificateKeyFile. */ + tlsCertificateKeyFilePassword?: string; + /** Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. This file is used to validate the certificate presented by the mongod/mongos instance. */ + tlsCAFile?: string; + /** Specifies the location of a local CRL .pem file that contains the client revokation list. */ + tlsCRLFile?: string; + /** Bypasses validation of the certificates presented by the mongod/mongos instance */ + tlsAllowInvalidCertificates?: boolean; + /** Disables hostname validation of the certificate presented by the mongod/mongos instance. */ + tlsAllowInvalidHostnames?: boolean; + /** Disables various certificate validations. */ + tlsInsecure?: boolean; + /** The time in milliseconds to attempt a connection before timing out. */ + connectTimeoutMS?: number; + /** The time in milliseconds to attempt a send or receive on a socket before the attempt times out. */ + socketTimeoutMS?: number; + /** An array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */ + compressors?: CompressorName[] | string; + /** An integer that specifies the compression level if using zlib for network compression. */ + zlibCompressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; + /** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */ + srvMaxHosts?: number; + /** + * Modifies the srv URI to look like: + * + * `_{srvServiceName}._tcp.{hostname}.{domainname}` + * + * Querying this DNS URI is expected to respond with SRV records + */ + srvServiceName?: string; + /** The maximum number of connections in the connection pool. */ + maxPoolSize?: number; + /** The minimum number of connections in the connection pool. */ + minPoolSize?: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting?: number; + /** + * The maximum amount of time a connection should remain idle in the connection pool before being marked idle, in milliseconds. + * If specified, this must be a number greater than or equal to 0, where 0 means there is no limit. Defaults to 0. After this + * time passes, the idle collection can be automatically cleaned up in the background. + */ + maxIdleTimeMS?: number; + /** The maximum time in milliseconds that a thread can wait for a connection to become available. */ + waitQueueTimeoutMS?: number; + /** Specify a read concern for the collection (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The level of isolation */ + readConcernLevel?: ReadConcernLevel; + /** Specifies the read preferences for this connection */ + readPreference?: ReadPreferenceMode | ReadPreference; + /** Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. */ + maxStalenessSeconds?: number; + /** Specifies the tags document as a comma-separated list of colon-separated key-value pairs. */ + readPreferenceTags?: TagSet[]; + /** The auth settings for when connection to server. */ + auth?: Auth; + /** Specify the database name associated with the user’s credentials. */ + authSource?: string; + /** Specify the authentication mechanism that MongoDB will use to authenticate the connection. */ + authMechanism?: AuthMechanism; + /** Specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */ + authMechanismProperties?: AuthMechanismProperties; + /** The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */ + localThresholdMS?: number; + /** Specifies how long (in milliseconds) to block for server selection before throwing an exception. */ + serverSelectionTimeoutMS?: number; + /** heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment. Specify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one. */ + heartbeatFrequencyMS?: number; + /** Sets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. */ + minHeartbeatFrequencyMS?: number; + /** The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections */ + appName?: string; + /** Enables retryable reads. */ + retryReads?: boolean; + /** Enable retryable writes. */ + retryWrites?: boolean; + /** + * The maximum number of retries during server overload. Set to 0 to disable overload retries. Defaults to 2. + * @see https://www.mongodb.com/docs/atlas/overload-errors + * + * This option works with MongoDB Atlas Server Version 9.0 and above. + * */ + maxAdaptiveRetries?: number; + /** + * Whether or not to enable overload retargeting. Defaults to false. + * @see https://www.mongodb.com/docs/atlas/overload-errors + * More information about the overload policy in drivers: + * @see https://github.com/mongodb/specifications/blob/master/source/client-backpressure/client-backpressure.md#overload-retry-policy + * + * This option works with MongoDB Atlas Server Version 9.0 and above. + * */ + enableOverloadRetargeting?: boolean; + /** Allow a driver to force a Single topology type with a connection string containing one host */ + directConnection?: boolean; + /** Instruct the driver it is connecting to a load balancer fronting a mongos like service */ + loadBalanced?: boolean; + /** + * The write concern w value + * @deprecated Please use the `writeConcern` option instead + */ + w?: W; + /** + * The write concern timeout + * @deprecated Please use the `writeConcern` option instead + */ + wtimeoutMS?: number; + /** + * The journal write concern + * @deprecated Please use the `writeConcern` option instead + */ + journal?: boolean; + /** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * + * @see https://www.mongodb.com/docs/manual/reference/write-concern/ + */ + writeConcern?: WriteConcern | WriteConcernSettings; + /** TCP Connection no delay */ + noDelay?: boolean; + /** Force server to assign `_id` values instead of driver */ + forceServerObjectId?: boolean; + /** A primary key factory function for generation of custom `_id` keys */ + pkFactory?: PkFactory; + /** Enable command monitoring for this client */ + monitorCommands?: boolean; + /** Server API version */ + serverApi?: ServerApi | ServerApiVersion; + /** + * Optionally enable in-use auto encryption + * + * @remarks + * Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error + * (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.md#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts. + * + * Automatic encryption requires the authenticated user to have the [listCollections privilege action](https://www.mongodb.com/docs/manual/reference/command/listCollections/#dbcmd.listCollections). + * + * If a MongoClient with a limited connection pool size (i.e a non-zero maxPoolSize) is configured with AutoEncryptionOptions, a separate internal MongoClient is created if any of the following are true: + * - AutoEncryptionOptions.keyVaultClient is not passed. + * - AutoEncryptionOptions.bypassAutomaticEncryption is false. + * + * If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted. + */ + autoEncryption?: AutoEncryptionOptions; + /** + * Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver + /* @deprecated - Will be made internal in a future major release. + */ + driverInfo?: DriverInfo; + /** Configures a Socks5 proxy host used for creating TCP connections. */ + proxyHost?: string; + /** Configures a Socks5 proxy port used for creating TCP connections. */ + proxyPort?: number; + /** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */ + proxyUsername?: string; + /** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */ + proxyPassword?: string; + /** Instructs the driver monitors to use a specific monitoring mode */ + serverMonitoringMode?: ServerMonitoringMode; + /** + * @public + * Specifies the destination of the driver's logging. The default is stderr. + */ + mongodbLogPath?: 'stderr' | 'stdout' | MongoDBLogWritable; + /** + * @public + * Enable logging level per component or use `default` to control any unset components. + */ + mongodbLogComponentSeverities?: LogComponentSeveritiesClientOptions; + /** + * @public + * All BSON documents are stringified to EJSON. This controls the maximum length of those strings. + * It is defaulted to 1000. + */ + mongodbLogMaxDocumentLength?: number; + /* Excluded from this release type: srvPoller */ + /* Excluded from this release type: connectionType */ + /* Excluded from this release type: __skipPingOnConnect */ + /** + * @experimental + * + * If provided, any adapters provided will be used in place of the corresponding Node.js module. + */ + runtimeAdapters?: RuntimeAdapters; +} + +/* Excluded from this release type: MongoClientPrivate */ + +/** + * An error generated when a feature that is not enabled or allowed for the current server + * configuration is used + * + * + * @public + * @category Error + */ +export declare class MongoCompatibilityError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * A representation of the credentials used by MongoDB + * @public + */ +export declare class MongoCredentials { + /** The username used for authentication */ + readonly username: string; + /** The password used for authentication */ + readonly password: string; + /** The database that the user should authenticate against */ + readonly source: string; + /** The method used to authenticate */ + readonly mechanism: AuthMechanism; + /** Special properties used by some types of auth mechanisms */ + readonly mechanismProperties: AuthMechanismProperties; + constructor(options: MongoCredentialsOptions); + /** Determines if two MongoCredentials objects are equivalent */ + equals(other: MongoCredentials): boolean; + /** + * If the authentication mechanism is set to "default", resolves the authMechanism + * based on the server version and server supported sasl mechanisms. + * + * @param hello - A hello response from the server + */ + resolveAuthMechanism(hello: Document | null): MongoCredentials; + validate(): void; + static merge(creds: MongoCredentials | undefined, options: Partial): MongoCredentials; +} + +/** @public */ +export declare interface MongoCredentialsOptions { + username?: string; + password: string; + source: string; + db?: string; + mechanism?: AuthMechanism; + mechanismProperties: AuthMechanismProperties; +} + +/** + * @public + * An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials. + */ +export declare class MongoCryptAzureKMSRequestError extends MongoCryptError { + /** The body of the http response that failed, if present. */ + body?: Document; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, body?: Document); + get name(): string; +} + +/** + * @public + * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys + */ +export declare class MongoCryptCreateDataKeyError extends MongoCryptError { + encryptedFields: Document; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields: Document, { cause }: { + cause: Error; + }); + get name(): string; +} + +/** + * @public + * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create a collection + */ +export declare class MongoCryptCreateEncryptedCollectionError extends MongoCryptError { + encryptedFields: Document; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields: Document, { cause }: { + cause: Error; + }); + get name(): string; +} + +/* Excluded from this release type: MongocryptdManager */ + +/** + * @public + * An error indicating that something went wrong specifically with MongoDB Client Encryption + */ +export declare class MongoCryptError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * @public + * + * An error indicating an invalid argument was provided to an encryption API. + */ +export declare class MongoCryptInvalidArgumentError extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** @public */ +export declare class MongoCryptKMSRequestNetworkTimeoutError extends MongoCryptError { + get name(): string; +} + +/** + * An error thrown when an attempt is made to read from a cursor that has been exhausted + * + * @public + * @category Error + */ +export declare class MongoCursorExhaustedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string); + get name(): string; +} + +/** + * An error thrown when the user attempts to add options to a cursor that has already been + * initialized + * + * @public + * @category Error + */ +export declare class MongoCursorInUseError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string); + get name(): string; +} + +/** + * @public + * + * A class representing a collection's namespace. This class enforces (through Typescript) that + * the `collection` portion of the namespace is defined and should only be + * used in scenarios where this can be guaranteed. + */ +export declare class MongoDBCollectionNamespace extends MongoDBNamespace { + collection: string; + constructor(db: string, collection: string); + static fromString(namespace?: string): MongoDBCollectionNamespace; +} + +/** + * @public + * + * A custom destination for structured logging messages. + */ +export declare interface MongoDBLogWritable { + /** + * This function will be called for every enabled log message. + * + * It can be sync or async: + * - If it is synchronous it will block the driver from proceeding until this method returns. + * - If it is asynchronous the driver will not await the returned promise. It will attach fulfillment handling (`.then`). + * If the promise rejects the logger will write an error message to stderr and stop functioning. + * If the promise resolves the driver proceeds to the next log message (or waits for new ones to occur). + * + * Tips: + * - We recommend writing an async `write` function that _never_ rejects. + * Instead handle logging errors as necessary to your use case and make the write function a noop, until it can be recovered. + * - The Log messages are structured but **subject to change** since the intended purpose is informational. + * Program against this defensively and err on the side of stringifying whatever is passed in to write in some form or another. + * + */ + write(log: Log): PromiseLike | unknown; +} + +/** @public */ +export declare class MongoDBNamespace { + db: string; + collection?: string; + /** + * Create a namespace object + * + * @param db - database name + * @param collection - collection name + */ + constructor(db: string, collection?: string); + toString(): string; + withCollection(collection: string): MongoDBCollectionNamespace; + static fromString(namespace?: string): MongoDBNamespace; +} + +/* Excluded from this release type: MongoDBResponse */ + +/* Excluded from this release type: MongoDBResponseConstructor */ + +/** + * An error generated when the driver fails to decompress + * data received from the server. + * + * @public + * @category Error + */ +export declare class MongoDecompressionError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated by the driver + * + * @public + * @category Error + */ +export declare class MongoDriverError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * @public + * @category Error + * + * @privateRemarks + * mongodb-client-encryption has a dependency on this error, it uses the constructor with a string argument + */ +export declare class MongoError extends Error { + /* Excluded from this release type: errorLabelSet */ + get errorLabels(): string[]; + /** + * This is a number in MongoServerError and a string in MongoDriverError + * @privateRemarks + * Define the type override on the subclasses when we can use the override keyword + */ + code?: number | string; + topologyVersion?: TopologyVersion; + connectionGeneration?: number; + cause?: Error; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + /* Excluded from this release type: buildErrorMessage */ + get name(): string; + /** Legacy name for server error responses */ + get errmsg(): string; + /** + * Checks the error to see if it has an error label + * + * @param label - The error label to check for + * @returns returns true if the error has the provided error label + */ + hasErrorLabel(label: string): boolean; + addErrorLabel(label: string): void; +} + +/** @public */ +export declare const MongoErrorLabel: Readonly<{ + readonly RetryableWriteError: "RetryableWriteError"; + readonly TransientTransactionError: "TransientTransactionError"; + readonly UnknownTransactionCommitResult: "UnknownTransactionCommitResult"; + readonly ResumableChangeStreamError: "ResumableChangeStreamError"; + readonly HandshakeError: "HandshakeError"; + readonly ResetPool: "ResetPool"; + readonly PoolRequestedRetry: "PoolRequestedRetry"; + readonly InterruptInUseConnections: "InterruptInUseConnections"; + readonly NoWritesPerformed: "NoWritesPerformed"; + readonly RetryableError: "RetryableError"; + readonly SystemOverloadedError: "SystemOverloadedError"; +}>; + +/** @public */ +export declare type MongoErrorLabel = (typeof MongoErrorLabel)[keyof typeof MongoErrorLabel]; + +/** + * An error generated when the user attempts to operate + * on a session that has expired or has been closed. + * + * @public + * @category Error + */ +export declare class MongoExpiredSessionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string); + get name(): string; +} + +/** + * A error generated when the user attempts to authenticate + * via GCP, but fails. + * + * @public + * @category Error + */ +export declare class MongoGCPError extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated when a malformed or invalid chunk is + * encountered when reading from a GridFSStream. + * + * @public + * @category Error + */ +export declare class MongoGridFSChunkError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** An error generated when a GridFSStream operation fails to execute. + * + * @public + * @category Error + */ +export declare class MongoGridFSStreamError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated when the user supplies malformed or unexpected arguments + * or when a required argument or field is not provided. + * + * + * @public + * @category Error + */ +export declare class MongoInvalidArgumentError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * A error generated when the user attempts to authenticate + * via Kerberos, but fails to connect to the Kerberos client. + * + * @public + * @category Error + */ +export declare class MongoKerberosError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** @public */ +export declare const MongoLoggableComponent: Readonly<{ + readonly COMMAND: "command"; + readonly TOPOLOGY: "topology"; + readonly SERVER_SELECTION: "serverSelection"; + readonly CONNECTION: "connection"; + readonly CLIENT: "client"; +}>; + +/** @public */ +export declare type MongoLoggableComponent = (typeof MongoLoggableComponent)[keyof typeof MongoLoggableComponent]; + +/* Excluded from this release type: MongoLogger */ + +/* Excluded from this release type: MongoLoggerEnvOptions */ + +/* Excluded from this release type: MongoLoggerMongoClientOptions */ + +/* Excluded from this release type: MongoLoggerOptions */ + +/** + * An error generated when the user fails to provide authentication credentials before attempting + * to connect to a mongo server instance. + * + * + * @public + * @category Error + */ +export declare class MongoMissingCredentialsError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated when a required module or dependency is not present in the local environment + * + * @public + * @category Error + */ +export declare class MongoMissingDependencyError extends MongoAPIError { + dependencyName: string; + /** @remarks This property is assigned in the `Error` constructor. */ + cause: Error; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options: { + cause: Error; + dependencyName: string; + }); + get name(): string; +} + +/** + * An error indicating an issue with the network, including TCP errors and timeouts. + * @public + * @category Error + */ +export declare class MongoNetworkError extends MongoError { + /* Excluded from this release type: beforeHandshake */ + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: MongoNetworkErrorOptions); + get name(): string; +} + +/** @public */ +export declare interface MongoNetworkErrorOptions { + /** Indicates the timeout happened before a connection handshake completed */ + beforeHandshake?: boolean; + cause?: Error; +} + +/** + * An error indicating a network timeout occurred + * @public + * @category Error + * + * @privateRemarks + * mongodb-client-encryption has a dependency on this error with an instanceof check + */ +export declare class MongoNetworkTimeoutError extends MongoNetworkError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: MongoNetworkErrorOptions); + get name(): string; +} + +/** + * An error thrown when the user attempts to operate on a database or collection through a MongoClient + * that has not yet successfully called the "connect" method + * + * @public + * @category Error + */ +export declare class MongoNotConnectedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * A error generated when the user attempts to authenticate + * via OIDC callbacks, but fails. + * + * @public + * @category Error + */ +export declare class MongoOIDCError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * @public + * @category Error + * + * The `MongoOperationTimeoutError` class represents an error that occurs when an operation could not be completed within the specified `timeoutMS`. + * It is generated by the driver in support of the "client side operation timeout" feature so inherits from `MongoDriverError`. + * When `timeoutMS` is enabled `MongoServerError`s relating to `MaxTimeExpired` errors will be converted to `MongoOperationTimeoutError` + * + * @example + * ```ts + * try { + * await blogs.insertOne(blogPost, { timeoutMS: 60_000 }) + * } catch (error) { + * if (error instanceof MongoOperationTimeoutError) { + * console.log(`Oh no! writer's block!`, error); + * } + * } + * ``` + */ +export declare class MongoOperationTimeoutError extends MongoDriverError { + get name(): string; +} + +/** + * Parsed Mongo Client Options. + * + * User supplied options are documented by `MongoClientOptions`. + * + * **NOTE:** The client's options parsing is subject to change to support new features. + * This type is provided to aid with inspection of options after parsing, it should not be relied upon programmatically. + * + * Options are sourced from: + * - connection string + * - options object passed to the MongoClient constructor + * - file system (ex. tls settings) + * - environment variables + * - DNS SRV records and TXT records + * + * Not all options may be present after client construction as some are obtained from asynchronous operations. + * + * @public + */ +export declare interface MongoOptions extends Required>, SupportedNodeConnectionOptions { + appName?: string; + hosts: HostAddress[]; + srvHost?: string; + credentials?: MongoCredentials; + readPreference: ReadPreference; + readConcern: ReadConcern; + loadBalanced: boolean; + directConnection: boolean; + serverApi: ServerApi; + compressors: CompressorName[]; + writeConcern: WriteConcern; + dbName: string; + /* Excluded from this release type: metadata */ + /* Excluded from this release type: autoEncrypter */ + /* Excluded from this release type: tokenCache */ + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; + serverMonitoringMode: ServerMonitoringMode; + /* Excluded from this release type: connectionType */ + /* Excluded from this release type: authProviders */ + /* Excluded from this release type: encrypter */ + /* Excluded from this release type: userSpecifiedAuthSource */ + /* Excluded from this release type: userSpecifiedReplicaSet */ + /** + * # NOTE ABOUT TLS Options + * + * If `tls` is provided as an option, it is equivalent to setting the `ssl` option. + * + * NodeJS native TLS options are passed through to the socket and retain their original types. + * + * ### Additional options: + * + * | nodejs native option | driver spec equivalent option name | driver option type | + * |:----------------------|:----------------------------------------------|:-------------------| + * | `ca` | `tlsCAFile` | `string` | + * | `crl` | `tlsCRLFile` | `string` | + * | `cert` | `tlsCertificateKeyFile` | `string` | + * | `key` | `tlsCertificateKeyFile` | `string` | + * | `passphrase` | `tlsCertificateKeyFilePassword` | `string` | + * | `rejectUnauthorized` | `tlsAllowInvalidCertificates` | `boolean` | + * | `checkServerIdentity` | `tlsAllowInvalidHostnames` | `boolean` | + * | see note below | `tlsInsecure` | `boolean` | + * + * If `tlsInsecure` is set to `true`, then it will set the node native options `checkServerIdentity` + * to a no-op and `rejectUnauthorized` to `false`. + * + * If `tlsInsecure` is set to `false`, then it will set the node native options `checkServerIdentity` + * to a no-op and `rejectUnauthorized` to the inverse value of `tlsAllowInvalidCertificates`. If + * `tlsAllowInvalidCertificates` is not set, then `rejectUnauthorized` will be set to `true`. + * + * ### Note on `tlsCAFile`, `tlsCertificateKeyFile` and `tlsCRLFile` + * + * The files specified by the paths passed in to the `tlsCAFile`, `tlsCertificateKeyFile` and `tlsCRLFile` + * fields are read lazily on the first call to `MongoClient.connect`. Once these files have been read and + * the `ca`, `cert`, `crl` and `key` fields are populated, they will not be read again on subsequent calls to + * `MongoClient.connect`. As a result, until the first call to `MongoClient.connect`, the `ca`, + * `cert`, `crl` and `key` fields will be undefined. + */ + tls: boolean; + tlsCAFile?: string; + tlsCRLFile?: string; + tlsCertificateKeyFile?: string; + /* Excluded from this release type: mongoLoggerOptions */ + /* Excluded from this release type: mongodbLogPath */ + timeoutMS?: number; + /* Excluded from this release type: __skipPingOnConnect */ + /* Excluded from this release type: runtime */ +} + +/** + * An error used when attempting to parse a value (like a connection string) + * @public + * @category Error + */ +export declare class MongoParseError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated when the driver encounters unexpected input + * or reaches an unexpected/invalid internal state. + * + * @privateRemarks + * Should **never** be directly instantiated. + * + * @public + * @category Error + */ +export declare class MongoRuntimeError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * An error generated when an attempt is made to operate + * on a closed/closing server. + * + * @public + * @category Error + */ +export declare class MongoServerClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string); + get name(): string; +} + +/** + * An error coming from the mongo server + * + * @public + * @category Error + */ +export declare class MongoServerError extends MongoError { + /** Raw error result document returned by server. */ + errorResponse: ErrorDescription; + codeName?: string; + writeConcernError?: Document; + errInfo?: Document; + ok?: number; + [key: string]: any; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: ErrorDescription); + get name(): string; +} + +/** + * An error signifying a client-side server selection error + * @public + * @category Error + */ +export declare class MongoServerSelectionError extends MongoSystemError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, reason: TopologyDescription); + get name(): string; +} + +/** + * An error generated when a primary server is marked stale, never directly thrown + * + * @public + * @category Error + */ +export declare class MongoStalePrimaryError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * An error signifying a general system issue + * @public + * @category Error + */ +export declare class MongoSystemError extends MongoError { + /** An optional reason context, such as an error saved during flow of monitoring and selecting servers */ + reason?: TopologyDescription; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, reason: TopologyDescription); + get name(): string; +} + +/** + * An error thrown when the user calls a function or method not supported on a tailable cursor + * + * @public + * @category Error + */ +export declare class MongoTailableCursorError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string); + get name(): string; +} + +/** + * An error generated when an attempt is made to operate on a + * dropped, or otherwise unavailable, database. + * + * @public + * @category Error + */ +export declare class MongoTopologyClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string); + get name(): string; +} + +/** + * An error generated when the user makes a mistake in the usage of transactions. + * (e.g. attempting to commit a transaction with a readPreference other than primary) + * + * @public + * @category Error + */ +export declare class MongoTransactionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string); + get name(): string; +} + +/** + * An error generated when a **parsable** unexpected response comes from the server. + * This is generally an error where the driver in a state expecting a certain behavior to occur in + * the next message from MongoDB but it receives something else. + * This error **does not** represent an issue with wire message formatting. + * + * #### Example + * When an operation fails, it is the driver's job to retry it. It must perform serverSelection + * again to make sure that it attempts the operation against a server in a good state. If server + * selection returns a server that does not support retryable operations, this error is used. + * This scenario is unlikely as retryable support would also have been determined on the first attempt + * but it is possible the state change could report a selectable server that does not support retries. + * + * @public + * @category Error + */ +export declare class MongoUnexpectedServerResponseError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { + cause?: Error; + }); + get name(): string; +} + +/** + * An error thrown when the server reports a writeConcernError + * @public + * @category Error + */ +export declare class MongoWriteConcernError extends MongoServerError { + /** The result document */ + result: Document; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(result: WriteConcernErrorResult); + get name(): string; +} + +/* Excluded from this release type: Monitor */ + +/** @public */ +export declare type MonitorEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + resetServer(error?: MongoError): void; + resetConnectionPool(): void; + close(): void; +} & EventEmitterWithState; + +/* Excluded from this release type: MonitorInterval */ + +/* Excluded from this release type: MonitorIntervalOptions */ + +/** @public */ +export declare interface MonitorOptions extends Omit { + connectTimeoutMS: number; + heartbeatFrequencyMS: number; + minHeartbeatFrequencyMS: number; + serverMonitoringMode: ServerMonitoringMode; +} + +/* Excluded from this release type: MonitorPrivate */ + +/** + * @public + * returns tuple of strings (keys to be joined on '.') that represent every path into a schema + * https://www.mongodb.com/docs/manual/tutorial/query-embedded-documents/ + * + * @remarks + * Through testing we determined that a depth of 8 is safe for the typescript compiler + * and provides reasonable compilation times. This number is otherwise not special and + * should be changed if issues are found with this level of checking. Beyond this + * depth any helpers that make use of NestedPaths should devolve to not asserting any + * type safety on the input. + */ +export declare type NestedPaths = Depth['length'] extends 8 ? [] : Type extends string | number | bigint | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { + _bsontype: string; +} ? [] : Type extends ReadonlyArray ? [] | [number, ...NestedPaths] : Type extends Map ? [string] : Type extends object ? { + [Key in Extract]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [ + Key, + ...NestedPaths + ] : // child is not structured the same as the parent + [ + Key, + ...NestedPaths + ] | [Key]; +}[Extract] : []; + +/** + * @public + * returns keys (strings) for every path into a schema with a value of type + * https://www.mongodb.com/docs/manual/tutorial/query-embedded-documents/ + */ +export declare type NestedPathsOfType = KeysOfAType<{ + [Property in Join, '.'>]: PropertyType; +}, Type>; + +/** + * @public + * A type that extends Document but forbids anything that "looks like" an object id. + */ +export declare type NonObjectIdLikeDocument = { + [key in keyof ObjectIdLike]?: never; +} & Document; + +/** It avoids using fields with not acceptable types @public */ +export declare type NotAcceptedFields = { + readonly [key in KeysOfOtherType]?: never; +}; + +/** @public */ +export declare type NumericType = IntegerType | Decimal128 | Double; + +export { ObjectId } + +/** + * The signature of the human or machine callback functions. + * @public + */ +export declare type OIDCCallbackFunction = (params: OIDCCallbackParams) => Promise; + +/** + * The parameters that the driver provides to the user supplied + * human or machine callback. + * + * The version number is used to communicate callback API changes that are not breaking but that + * users may want to know about and review their implementation. Users may wish to check the version + * number and throw an error if their expected version number and the one provided do not match. + * @public + */ +export declare interface OIDCCallbackParams { + /** Optional username. */ + username?: string; + /** The context in which to timeout the OIDC callback. */ + timeoutContext: AbortSignal; + /** The current OIDC API version. */ + version: 1; + /** The IdP information returned from the server. */ + idpInfo?: IdPInfo; + /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */ + refreshToken?: string; + /** The token audience for GCP and Azure. */ + tokenAudience?: string; +} + +/** + * The response required to be returned from the machine or + * human callback workflows' callback. + * @public + */ +export declare interface OIDCResponse { + /** The OIDC access token. */ + accessToken: string; + /** The time when the access token expires. For future use. */ + expiresInSeconds?: number; + /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */ + refreshToken?: string; +} + +/* Excluded from this release type: OnDemandDocument */ + +/* Excluded from this release type: OnDemandDocumentDeserializeOptions */ + +/** @public */ +export declare type OneOrMore = T | ReadonlyArray; + +/** @public */ +export declare type OnlyFieldsOfType = IsAny : Record, AcceptedFields & NotAcceptedFields & Record>; + +/* Excluded from this release type: OpCompressedRequest */ + +/* Excluded from this release type: OpCompressesRequestOptions */ + +/** @public */ +export declare interface OperationOptions extends BSONSerializeOptions { + /** Specify ClientSession for this command */ + session?: ClientSession; + willRetryWrite?: boolean; + /** The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest). */ + readPreference?: ReadPreferenceLike; + /* Excluded from this release type: bypassPinningCheck */ + /* Excluded from this release type: omitMaxTimeMS */ + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/* Excluded from this release type: OperationParent */ + +/** + * Represents a specific point in time on a server. Can be retrieved by using `db.command()` + * @public + * @see https://www.mongodb.com/docs/manual/reference/method/db.runCommand/#response + */ +export declare type OperationTime = Timestamp; + +/* Excluded from this release type: OpMsgOptions */ + +/* Excluded from this release type: OpMsgRequest */ + +/* Excluded from this release type: OpMsgResponse */ + +/* Excluded from this release type: OpQueryOptions */ + +/* Excluded from this release type: OpQueryRequest */ + +/* Excluded from this release type: OpReply */ + +/** + * Add an optional _id field to an object shaped type + * @public + */ +export declare type OptionalId = EnhancedOmit & { + _id?: InferIdType; +}; + +/** + * Adds an optional _id field to an object shaped type, unless the _id field is required on that type. + * In the case _id is required, this method continues to require_id. + * + * @public + * + * @privateRemarks + * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask + * `TSchema['_id'] extends ObjectId` which translated to "Is the _id property ObjectId?" + * we instead ask "Does ObjectId look like (have the same shape) as the _id?" + */ +export declare type OptionalUnlessRequiredId = TSchema extends { + _id: any; +} ? TSchema : OptionalId; + +/** @public */ +export declare class OrderedBulkOperation extends BulkOperationBase { + /* Excluded from this release type: __constructor */ + addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this; +} + +/** + * @public + * @experimental + * + * Represents the set of dependencies that the driver uses from the [Node.js OS module](https://nodejs.org/api/os.html). + */ +export declare type OsAdapter = Pick; + +/** @public */ +export declare interface PkFactory { + createPk(): any; +} + +/* Excluded from this release type: PoolState */ + +/** @public */ +export declare const ProfilingLevel: Readonly<{ + readonly off: "off"; + readonly slowOnly: "slow_only"; + readonly all: "all"; +}>; + +/** @public */ +export declare type ProfilingLevel = (typeof ProfilingLevel)[keyof typeof ProfilingLevel]; + +/** @public */ +export declare type ProfilingLevelOptions = Omit; + +/** @public */ +export declare type PropertyType = string extends Property ? unknown : Property extends keyof Type ? Type[Property] : Property extends `${number}` ? Type extends ReadonlyArray ? ArrayType : unknown : Property extends `${infer Key}.${infer Rest}` ? Key extends `${number}` ? Type extends ReadonlyArray ? PropertyType : unknown : Key extends keyof Type ? Type[Key] extends Map ? MapType : PropertyType : unknown : unknown; + +/** @public */ +export declare interface ProxyOptions { + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; +} + +/** @public */ +export declare type PullAllOperator = ({ + readonly [key in KeysOfAType>]?: TSchema[key]; +} & NotAcceptedFields>) & { + readonly [key: string]: ReadonlyArray; +}; + +/** @public */ +export declare type PullOperator = ({ + readonly [key in KeysOfAType>]?: Partial> | FilterOperations>; +} & NotAcceptedFields>) & { + readonly [key: string]: FilterOperators | any; +}; + +/** @public */ +export declare type PushOperator = ({ + readonly [key in KeysOfAType>]?: Flatten | ArrayOperator>>; +} & NotAcceptedFields>) & { + readonly [key: string]: ArrayOperator | any; +}; + +/** + * @public + * RangeOptions specifies index options for a Queryable Encryption field supporting "range" queries. + * min, max, sparsity, trimFactor and range must match the values set in the encryptedFields of the destination collection. + * For double and decimal128, min/max/precision must all be set, or all be unset. + */ +export declare interface RangeOptions { + /** min is the minimum value for the encrypted index. Required if precision is set. */ + min?: any; + /** max is the minimum value for the encrypted index. Required if precision is set. */ + max?: any; + /** sparsity may be used to tune performance. must be non-negative. When omitted, a default value is used. */ + sparsity?: Long | bigint; + /** trimFactor may be used to tune performance. must be non-negative. When omitted, a default value is used. */ + trimFactor?: Int32 | number; + precision?: number; +} + +/** + * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties + * of the data read from replica sets and replica set shards. + * @public + * + * @see https://www.mongodb.com/docs/manual/reference/read-concern/index.html + */ +export declare class ReadConcern { + level: ReadConcernLevel | string; + /** Constructs a ReadConcern from the read concern level.*/ + constructor(level: ReadConcernLevel); + /** + * Construct a ReadConcern given an options object. + * + * @param options - The options object from which to extract the write concern. + */ + static fromOptions(options?: { + readConcern?: ReadConcernLike; + level?: ReadConcernLevel; + }): ReadConcern | undefined; + static get MAJORITY(): 'majority'; + static get AVAILABLE(): 'available'; + static get LINEARIZABLE(): 'linearizable'; + static get SNAPSHOT(): 'snapshot'; + toJSON(): Document; +} + +/** @public */ +export declare const ReadConcernLevel: Readonly<{ + readonly local: "local"; + readonly majority: "majority"; + readonly linearizable: "linearizable"; + readonly available: "available"; + readonly snapshot: "snapshot"; +}>; + +/** @public */ +export declare type ReadConcernLevel = (typeof ReadConcernLevel)[keyof typeof ReadConcernLevel]; + +/** @public */ +export declare type ReadConcernLike = ReadConcern | { + level: ReadConcernLevel; +} | ReadConcernLevel; + +/** + * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is + * used to construct connections. + * @public + * + * @see https://www.mongodb.com/docs/manual/core/read-preference/ + */ +export declare class ReadPreference { + mode: ReadPreferenceMode; + tags?: TagSet[]; + hedge?: HedgeOptions; + maxStalenessSeconds?: number; + static PRIMARY: "primary"; + static PRIMARY_PREFERRED: "primaryPreferred"; + static SECONDARY: "secondary"; + static SECONDARY_PREFERRED: "secondaryPreferred"; + static NEAREST: "nearest"; + static primary: ReadPreference; + static primaryPreferred: ReadPreference; + static secondary: ReadPreference; + static secondaryPreferred: ReadPreference; + static nearest: ReadPreference; + /** + * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest) + * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary. + * @param options - Additional read preference options + */ + constructor(mode: ReadPreferenceMode, tags?: TagSet[], options?: ReadPreferenceOptions); + get preference(): ReadPreferenceMode; + static fromString(mode: string): ReadPreference; + /** + * Construct a ReadPreference given an options object. + * + * @param options - The options object from which to extract the read preference. + */ + static fromOptions(options?: ReadPreferenceFromOptions): ReadPreference | undefined; + /** + * Replaces options.readPreference with a ReadPreference instance + */ + static translate(options: ReadPreferenceLikeOptions): ReadPreferenceLikeOptions; + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + static isValid(mode: string): boolean; + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + isValid(mode?: string): boolean; + /** + * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire + * @see https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op-query + */ + secondaryOk(): boolean; + /** + * Check if the two ReadPreferences are equivalent + * + * @param readPreference - The read preference with which to check equality + */ + equals(readPreference: ReadPreference): boolean; + /** Return JSON representation */ + toJSON(): Document; +} + +/** @public */ +export declare interface ReadPreferenceFromOptions extends ReadPreferenceLikeOptions { + session?: ClientSession; + readPreferenceTags?: TagSet[]; + hedge?: HedgeOptions; +} + +/** @public */ +export declare type ReadPreferenceLike = ReadPreference | ReadPreferenceMode; + +/** @public */ +export declare interface ReadPreferenceLikeOptions extends ReadPreferenceOptions { + readPreference?: ReadPreferenceLike | { + mode?: ReadPreferenceMode; + preference?: ReadPreferenceMode; + tags?: TagSet[]; + maxStalenessSeconds?: number; + }; +} + +/** @public */ +export declare const ReadPreferenceMode: Readonly<{ + readonly primary: "primary"; + readonly primaryPreferred: "primaryPreferred"; + readonly secondary: "secondary"; + readonly secondaryPreferred: "secondaryPreferred"; + readonly nearest: "nearest"; +}>; + +/** @public */ +export declare type ReadPreferenceMode = (typeof ReadPreferenceMode)[keyof typeof ReadPreferenceMode]; + +/** @public */ +export declare interface ReadPreferenceOptions { + /** Max secondary read staleness in seconds, Minimum value is 90 seconds.*/ + maxStalenessSeconds?: number; + /** Server mode in which the same query is dispatched in parallel to multiple replica set members. */ + hedge?: HedgeOptions; +} + +/** @public */ +export declare type RegExpOrString = T extends string ? BSONRegExp | RegExp | T : T; + +/** @public */ +export declare type RemoveUserOptions = Omit; + +/** @public */ +export declare interface RenameOptions extends Omit { + /** Drop the target name collection if it previously exists. */ + dropTarget?: boolean; + /** + * @deprecated + * + * This option has been dead code since at least Node driver version 4.x. It will + * be removed in a future major release. + */ + new_collection?: boolean; +} + +/** @public */ +export declare interface ReplaceOneModel { + /** The filter that specifies which document to replace. In the case of multiple matches, the first document matched is replaced. */ + filter: Filter; + /** The document with which to replace the matched document. */ + replacement: WithoutId; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @public */ +export declare interface ReplaceOptions extends CommandOperationOptions { + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** + * Represents the logical starting point for a new ChangeStream or resuming a ChangeStream on the server. + * @see https://www.mongodb.com/docs/manual/changeStreams/#std-label-change-stream-resume + * @public + */ +export declare type ResumeToken = unknown; + +/** @public */ +export declare const ReturnDocument: Readonly<{ + readonly BEFORE: "before"; + readonly AFTER: "after"; +}>; + +/** @public */ +export declare type ReturnDocument = (typeof ReturnDocument)[keyof typeof ReturnDocument]; + +/** @public */ +export declare interface RootFilterOperators extends Document { + $and?: Filter[]; + $nor?: Filter[]; + $or?: Filter[]; + $text?: { + $search: string; + $language?: string; + $caseSensitive?: boolean; + $diacriticSensitive?: boolean; + }; + $where?: string | ((this: TSchema) => boolean); + $comment?: string | Document; +} + +/* Excluded from this release type: RTTPinger */ + +/* Excluded from this release type: RTTPingerOptions */ + +/* Excluded from this release type: RTTSampler */ + +/** @public */ +export declare class RunCommandCursor extends AbstractCursor { + readonly command: Readonly>; + readonly getMoreOptions: { + comment?: any; + maxAwaitTimeMS?: number; + batchSize?: number; + }; + /** + * Controls the `getMore.comment` field + * @param comment - any BSON value + */ + setComment(comment: any): this; + /** + * Controls the `getMore.maxTimeMS` field. Only valid when cursor is tailable await + * @param maxTimeMS - the number of milliseconds to wait for new data + */ + setMaxTimeMS(maxTimeMS: number): this; + /** + * Controls the `getMore.batchSize` field + * @param batchSize - the number documents to return in the `nextBatch` + */ + setBatchSize(batchSize: number): this; + /** Unsupported for RunCommandCursor */ + clone(): never; + /** Unsupported for RunCommandCursor: readConcern must be configured directly on command document */ + withReadConcern(_: ReadConcernLike): never; + /** Unsupported for RunCommandCursor: various cursor flags must be configured directly on command document */ + addCursorFlag(_: string, __: boolean): never; + /** + * Unsupported for RunCommandCursor: maxTimeMS must be configured directly on command document + */ + maxTimeMS(_: number): never; + /** Unsupported for RunCommandCursor: batchSize must be configured directly on command document */ + batchSize(_: number): never; + /* Excluded from this release type: db */ + /* Excluded from this release type: __constructor */ + /* Excluded from this release type: _initialize */ + /* Excluded from this release type: getMore */ +} + +/** @public */ +export declare type RunCommandOptions = { + /** Specify ClientSession for this command */ + session?: ClientSession; + /** The read preference */ + readPreference?: ReadPreferenceLike; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; + /* Excluded from this release type: omitMaxTimeMS */ + /* Excluded from this release type: bypassPinningCheck */ +} & BSONSerializeOptions & Abortable; + +/** @public */ +export declare type RunCursorCommandOptions = { + readPreference?: ReadPreferenceLike; + session?: ClientSession; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error. Note that if + * `maxTimeMS` is provided in the command in addition to setting `timeoutMS` in the options, then + * the original value of `maxTimeMS` will be overwritten. + */ + timeoutMS?: number; + /** + * @public + * @experimental + * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'` + * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of + * `cursor.next()`. + * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor. + * + * Depending on the type of cursor being used, this option has different default values. + * For non-tailable cursors, this value defaults to `'cursorLifetime'` + * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by + * definition can have an arbitrarily long lifetime. + * + * @example + * ```ts + * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'}); + * for await (const doc of cursor) { + * // process doc + * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but + * // will continue to iterate successfully otherwise, regardless of the number of batches. + * } + * ``` + * + * @example + * ```ts + * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' }); + * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms. + * ``` + */ + timeoutMode?: CursorTimeoutMode; + tailable?: boolean; + awaitData?: boolean; +} & BSONSerializeOptions; + +/* Excluded from this release type: Runtime */ + +/** + * @public + * @experimental + * + * This type represents the set of dependencies that the driver needs from the Javascript runtime in order to function. + */ +export declare interface RuntimeAdapters { + os?: OsAdapter; +} + +/** @public */ +export declare type SchemaMember = { + [P in keyof T]?: V; +} | { + [key: string]: V; +}; + +/** + * @public + */ +export declare interface SearchIndexDescription extends Document { + /** The name of the index. */ + name?: string; + /** The index definition. */ + definition: Document; + /** The type of the index. Currently `search` or `vectorSearch` are supported. */ + type?: string; +} + +/** @public */ +export declare interface SelectServerOptions { + readPreference?: ReadPreferenceLike; + /** How long to block for server selection before throwing an error */ + serverSelectionTimeoutMS?: number; + session?: ClientSession; + operationName: string; + /* Excluded from this release type: deprioritizedServers */ + /* Excluded from this release type: timeoutContext */ +} + +export { serialize } + +/* Excluded from this release type: Server */ + +/* Excluded from this release type: SERVER_CLOSED */ + +/* Excluded from this release type: SERVER_DESCRIPTION_CHANGED */ + +/* Excluded from this release type: SERVER_HEARTBEAT_FAILED */ + +/* Excluded from this release type: SERVER_HEARTBEAT_STARTED */ + +/* Excluded from this release type: SERVER_HEARTBEAT_SUCCEEDED */ + +/* Excluded from this release type: SERVER_OPENING */ + +/* Excluded from this release type: SERVER_SELECTION_FAILED */ + +/* Excluded from this release type: SERVER_SELECTION_STARTED */ + +/* Excluded from this release type: SERVER_SELECTION_SUCCEEDED */ + +/** @public */ +export declare interface ServerApi { + version: ServerApiVersion; + strict?: boolean; + deprecationErrors?: boolean; +} + +/** @public */ +export declare const ServerApiVersion: Readonly<{ + readonly v1: "1"; +}>; + +/** @public */ +export declare type ServerApiVersion = (typeof ServerApiVersion)[keyof typeof ServerApiVersion]; + +/** + * Emitted when server is closed. + * @public + * @category Event + */ +export declare class ServerClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/* Excluded from this release type: ServerCommandOptions */ + +/** + * The client's view of a single server, based on the most recent hello outcome. + * + * Internal type, not meant to be directly instantiated + * @public + */ +export declare class ServerDescription { + address: string; + type: ServerType; + hosts: string[]; + passives: string[]; + arbiters: string[]; + tags: TagSet; + error: MongoError | null; + topologyVersion: TopologyVersion | null; + minWireVersion: number; + maxWireVersion: number; + roundTripTime: number; + /** The minimum measurement of the last 10 measurements of roundTripTime that have been collected */ + minRoundTripTime: number; + lastUpdateTime: number; + lastWriteDate: number; + me: string | null; + primary: string | null; + setName: string | null; + setVersion: number | null; + electionId: ObjectId | null; + logicalSessionTimeoutMinutes: number | null; + /** The max message size in bytes for the server. */ + maxMessageSizeBytes: number | null; + /** The max number of writes in a bulk write command. */ + maxWriteBatchSize: number | null; + /** The max bson object size. */ + maxBsonObjectSize: number | null; + /** Indicates server is a mongocryptd instance. */ + iscryptd: boolean; + $clusterTime?: ClusterTime; + /* Excluded from this release type: __constructor */ + get hostAddress(): HostAddress; + get allHosts(): string[]; + /** Is this server available for reads*/ + get isReadable(): boolean; + /** Is this server data bearing */ + get isDataBearing(): boolean; + /** Is this server available for writes */ + get isWritable(): boolean; + get host(): string; + get port(): number; + /** + * Determines if another `ServerDescription` is equal to this one per the rules defined in the SDAM specification. + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md + */ + equals(other?: ServerDescription | null): boolean; +} + +/** + * Emitted when server description changes, but does NOT include changes to the RTT. + * @public + * @category Event + */ +export declare class ServerDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /** The previous server description */ + previousDescription: ServerDescription; + /** The new server description */ + newDescription: ServerDescription; + name: "serverDescriptionChanged"; + /* Excluded from this release type: __constructor */ +} + +/* Excluded from this release type: ServerDescriptionOptions */ + +/** @public */ +export declare type ServerEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + /* Excluded from this release type: connect */ + descriptionReceived(description: ServerDescription): void; + closed(): void; + ended(): void; +} & ConnectionPoolEvents & EventEmitterWithState; + +/** + * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception. + * @public + * @category Event + */ +export declare class ServerHeartbeatFailedEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command failure */ + failure: Error; + /** Is true when using the streaming protocol */ + awaited: boolean; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * Emitted when the server monitor’s hello command is started - immediately before + * the hello command is serialized into raw BSON and written to the socket. + * + * @public + * @category Event + */ +export declare class ServerHeartbeatStartedEvent { + /** The connection id for the command */ + connectionId: string; + /** Is true when using the streaming protocol */ + awaited: boolean; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * Emitted when the server monitor’s hello succeeds. + * @public + * @category Event + */ +export declare class ServerHeartbeatSucceededEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command reply */ + reply: Document; + /** Is true when using the streaming protocol */ + awaited: boolean; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare const ServerMonitoringMode: Readonly<{ + readonly auto: "auto"; + readonly poll: "poll"; + readonly stream: "stream"; +}>; + +/** @public */ +export declare type ServerMonitoringMode = (typeof ServerMonitoringMode)[keyof typeof ServerMonitoringMode]; + +/** + * Emitted when server is initialized. + * @public + * @category Event + */ +export declare class ServerOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/* Excluded from this release type: ServerOptions */ + +/* Excluded from this release type: ServerPrivate */ + +/* Excluded from this release type: ServerSelectionCallback */ + +/* Excluded from this release type: ServerSelectionEvent */ + +/* Excluded from this release type: ServerSelectionFailedEvent */ + +/* Excluded from this release type: ServerSelectionRequest */ + +/* Excluded from this release type: ServerSelectionStartedEvent */ + +/* Excluded from this release type: ServerSelectionSucceededEvent */ + +/* Excluded from this release type: ServerSelector */ + +/** + * Reflects the existence of a session on the server. Can be reused by the session pool. + * WARNING: not meant to be instantiated directly. For internal use only. + * @public + */ +export declare class ServerSession { + id: ServerSessionId; + lastUse: number; + txnNumber: number; + isDirty: boolean; + /* Excluded from this release type: __constructor */ + /** + * Determines if the server session has timed out. + * + * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes" + */ + hasTimedOut(sessionTimeoutMinutes: number): boolean; +} + +/** @public */ +export declare type ServerSessionId = { + id: Binary; +}; + +/* Excluded from this release type: ServerSessionPool */ + +/** + * An enumeration of server types we know about + * @public + */ +export declare const ServerType: Readonly<{ + readonly Standalone: "Standalone"; + readonly Mongos: "Mongos"; + readonly PossiblePrimary: "PossiblePrimary"; + readonly RSPrimary: "RSPrimary"; + readonly RSSecondary: "RSSecondary"; + readonly RSArbiter: "RSArbiter"; + readonly RSOther: "RSOther"; + readonly RSGhost: "RSGhost"; + readonly Unknown: "Unknown"; + readonly LoadBalancer: "LoadBalancer"; +}>; + +/** @public */ +export declare type ServerType = (typeof ServerType)[keyof typeof ServerType]; + +/** @public */ +export declare type SetFields = ({ + readonly [key in KeysOfAType | undefined>]?: OptionalId> | AddToSetOperators>>>; +} & IsAny | undefined>>) & { + readonly [key: string]: AddToSetOperators | any; +}; + +/** @public */ +export declare type SetProfilingLevelOptions = Omit; + +/** + * @public + * Severity levels align with unix syslog. + * Most typical driver functions will log to debug. + */ +export declare const SeverityLevel: Readonly<{ + readonly EMERGENCY: "emergency"; + readonly ALERT: "alert"; + readonly CRITICAL: "critical"; + readonly ERROR: "error"; + readonly WARNING: "warn"; + readonly NOTICE: "notice"; + readonly INFORMATIONAL: "info"; + readonly DEBUG: "debug"; + readonly TRACE: "trace"; + readonly OFF: "off"; +}>; + +/** @public */ +export declare type SeverityLevel = (typeof SeverityLevel)[keyof typeof SeverityLevel]; + +/** @public */ +export declare type Sort = string | Exclude | ReadonlyArray | { + readonly [key: string]: SortDirection; +} | ReadonlyMap | ReadonlyArray | readonly [string, SortDirection]; + +/** @public */ +export declare type SortDirection = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending' | { + readonly $meta: string; +}; + +/** Below stricter types were created for sort that correspond with type that the cmd takes */ +/** @public */ +export declare type SortDirectionForCmd = 1 | -1 | { + $meta: string; +}; + +/** @public */ +export declare type SortForCmd = Map; + +/* Excluded from this release type: SrvPoller */ + +/* Excluded from this release type: SrvPollerEvents */ + +/* Excluded from this release type: SrvPollerOptions */ + +/* Excluded from this release type: SrvPollingEvent */ + +/* Excluded from this release type: StateMachineExecutable */ + +/** @public */ +export declare type Stream = Socket | TLSSocket; + +/** @public */ +export declare class StreamDescription { + address: string; + type: ServerType; + minWireVersion?: number; + maxWireVersion?: number; + maxBsonObjectSize: number; + maxMessageSizeBytes: number; + maxWriteBatchSize: number; + compressors: CompressorName[]; + compressor?: CompressorName; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; + __nodejs_mock_server__?: boolean; + zlibCompressionLevel?: number; + serverConnectionId: bigint | null; + hello: Document | null; + constructor(address: string, options?: StreamDescriptionOptions); + receiveResponse(response: Document | null): void; + parseServerConnectionID(serverConnectionId: number | Double | bigint | Long): bigint; +} + +/** @public */ +export declare interface StreamDescriptionOptions { + compressors?: CompressorName[]; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; +} + +/** + * @public + * @experimental + */ +export declare type StrictFilter = Partial | ({ + [Property in Join, []>, '.'>]?: Condition, Property>>; +} & RootFilterOperators>); + +/** + * @public + * @experimental + */ +export declare type StrictMatchKeysAndValues = Readonly<{ + [Property in Join, '.'>]?: PropertyType; +} & { + [Property in `${NestedPathsOfType}.$${`[${string}]` | ''}`]?: ArrayElement>; +} & { + [Property in `${NestedPathsOfType[]>}.$${`[${string}]` | ''}.${string}`]?: any; +} & Document>; + +/** + * @public + * @experimental + */ +export declare type StrictUpdateFilter = { + $currentDate?: OnlyFieldsOfType; + $inc?: OnlyFieldsOfType; + $min?: StrictMatchKeysAndValues; + $max?: StrictMatchKeysAndValues; + $mul?: OnlyFieldsOfType; + $rename?: Record; + $set?: StrictMatchKeysAndValues; + $setOnInsert?: StrictMatchKeysAndValues; + $unset?: OnlyFieldsOfType; + $addToSet?: SetFields; + $pop?: OnlyFieldsOfType, 1 | -1>; + $pull?: PullOperator; + $push?: PushOperator; + $pullAll?: PullAllOperator; + $bit?: OnlyFieldsOfType; +} & Document; + +/** + * Options for a Queryable Encryption field supporting string queries. + * + * @public + */ +export declare interface StringQueryOptions { + /** Indicates that text indexes for this field are case sensitive */ + caseSensitive: boolean; + /** Indicates that text indexes for this field are diacritic sensitive. */ + diacriticSensitive: boolean; + prefix?: { + /** The maximum allowed query length. */ + strMaxQueryLength: Int32 | number; + /** The minimum allowed query length. */ + strMinQueryLength: Int32 | number; + }; + suffix?: { + /** The maximum allowed query length. */ + strMaxQueryLength: Int32 | number; + /** The minimum allowed query length. */ + strMinQueryLength: Int32 | number; + }; + substring?: { + /** The maximum allowed length to insert. */ + strMaxLength: Int32 | number; + /** The maximum allowed query length. */ + strMaxQueryLength: Int32 | number; + /** The minimum allowed query length. */ + strMinQueryLength: Int32 | number; + }; +} + +/** @public */ +export declare type SupportedNodeConnectionOptions = SupportedTLSConnectionOptions & SupportedTLSSocketOptions & SupportedSocketOptions; + +/** @public */ +export declare type SupportedSocketOptions = Pick; + +/** @public */ +export declare type SupportedTLSConnectionOptions = Pick; + +/** @public */ +export declare type SupportedTLSSocketOptions = Pick>; + +/** @public */ +export declare type TagSet = { + [key: string]: string; +}; + +/** + * @public + * @deprecated Use {@link StringQueryOptions} instead. + */ +export declare type TextQueryOptions = StringQueryOptions; + +/* Excluded from this release type: Timeout */ + +/* Excluded from this release type: TimeoutContext */ + +/* Excluded from this release type: TimeoutContextOptions */ + +/** @public + * Configuration options for timeseries collections + * @see https://www.mongodb.com/docs/manual/core/timeseries-collections/ + */ +export declare interface TimeSeriesCollectionOptions extends Document { + timeField: string; + metaField?: string; + granularity?: 'seconds' | 'minutes' | 'hours' | string; + bucketMaxSpanSeconds?: number; + bucketRoundingSeconds?: number; +} + +export { Timestamp } + +/* Excluded from this release type: TokenCache */ + +/* Excluded from this release type: Topology */ + +/* Excluded from this release type: TOPOLOGY_CLOSED */ + +/* Excluded from this release type: TOPOLOGY_DESCRIPTION_CHANGED */ + +/* Excluded from this release type: TOPOLOGY_OPENING */ + +/** + * Emitted when topology is closed. + * @public + * @category Event + */ +export declare class TopologyClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** + * Representation of a deployment of servers + * @public + */ +export declare class TopologyDescription { + type: TopologyType; + setName: string | null; + maxSetVersion: number | null; + maxElectionId: ObjectId | null; + servers: Map; + stale: boolean; + compatible: boolean; + compatibilityError?: string; + logicalSessionTimeoutMinutes: number | null; + heartbeatFrequencyMS: number; + localThresholdMS: number; + commonWireVersion: number; + /** + * Create a TopologyDescription + */ + constructor(topologyType: TopologyType, serverDescriptions?: Map | null, setName?: string | null, maxSetVersion?: number | null, maxElectionId?: ObjectId | null, commonWireVersion?: number | null, options?: TopologyDescriptionOptions | null); + /* Excluded from this release type: updateFromSrvPollingEvent */ + /* Excluded from this release type: update */ + get error(): MongoError | null; + /** + * Determines if the topology description has any known servers + */ + get hasKnownServers(): boolean; + /** + * Determines if this topology description has a data-bearing server available. + */ + get hasDataBearingServers(): boolean; + /* Excluded from this release type: hasServer */ + /** + * Returns a JSON-serializable representation of the TopologyDescription. This is primarily + * intended for use with JSON.stringify(). + * + * This method will not throw. + */ + toJSON(): Document; +} + +/** + * Emitted when topology description changes. + * @public + * @category Event + */ +export declare class TopologyDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The old topology description */ + previousDescription: TopologyDescription; + /** The new topology description */ + newDescription: TopologyDescription; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare interface TopologyDescriptionOptions { + heartbeatFrequencyMS?: number; + localThresholdMS?: number; +} + +/** @public */ +export declare type TopologyEvents = { + /* Excluded from this release type: connect */ + serverOpening(event: ServerOpeningEvent): void; + serverClosed(event: ServerClosedEvent): void; + serverDescriptionChanged(event: ServerDescriptionChangedEvent): void; + topologyClosed(event: TopologyClosedEvent): void; + topologyOpening(event: TopologyOpeningEvent): void; + topologyDescriptionChanged(event: TopologyDescriptionChangedEvent): void; + error(error: Error): void; + /* Excluded from this release type: open */ + close(): void; + timeout(): void; +} & Omit & ConnectionPoolEvents & ConnectionEvents & EventEmitterWithState; + +/** + * Emitted when topology is initialized. + * @public + * @category Event + */ +export declare class TopologyOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + /* Excluded from this release type: name */ + /* Excluded from this release type: __constructor */ +} + +/* Excluded from this release type: TopologyOptions */ + +/* Excluded from this release type: TopologyPrivate */ + +/** + * An enumeration of topology types we know about + * @public + */ +export declare const TopologyType: Readonly<{ + readonly Single: "Single"; + readonly ReplicaSetNoPrimary: "ReplicaSetNoPrimary"; + readonly ReplicaSetWithPrimary: "ReplicaSetWithPrimary"; + readonly Sharded: "Sharded"; + readonly Unknown: "Unknown"; + readonly LoadBalanced: "LoadBalanced"; +}>; + +/** @public */ +export declare type TopologyType = (typeof TopologyType)[keyof typeof TopologyType]; + +/** @public */ +export declare interface TopologyVersion { + processId: ObjectId; + counter: Long; +} + +/* Excluded from this release type: Transaction */ + +/** + * Configuration options for a transaction. + * @public + */ +export declare interface TransactionOptions extends Omit { + /** A default read concern for commands in this transaction */ + readConcern?: ReadConcernLike; + /** A default writeConcern for commands in this transaction */ + writeConcern?: WriteConcern; + /** A default read preference for commands in this transaction */ + readPreference?: ReadPreferenceLike; + /** Specifies the maximum amount of time to allow a commit action on a transaction to run in milliseconds */ + maxCommitTimeMS?: number; +} + +/* Excluded from this release type: TxnState */ + +/** + * Typescript type safe event emitter + * @public + */ +export declare interface TypedEventEmitter extends EventEmitter { + addListener(event: EventKey, listener: Events[EventKey]): this; + addListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + addListener(event: string | symbol, listener: GenericListener): this; + on(event: EventKey, listener: Events[EventKey]): this; + on(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + on(event: string | symbol, listener: GenericListener): this; + once(event: EventKey, listener: Events[EventKey]): this; + once(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + once(event: string | symbol, listener: GenericListener): this; + removeListener(event: EventKey, listener: Events[EventKey]): this; + removeListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + removeListener(event: string | symbol, listener: GenericListener): this; + off(event: EventKey, listener: Events[EventKey]): this; + off(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + off(event: string | symbol, listener: GenericListener): this; + removeAllListeners(event?: EventKey | CommonEvents | symbol | string): this; + listeners(event: EventKey | CommonEvents | symbol | string): Events[EventKey][]; + rawListeners(event: EventKey | CommonEvents | symbol | string): Events[EventKey][]; + emit(event: EventKey | symbol, ...args: Parameters): boolean; + listenerCount(type: EventKey | CommonEvents | symbol | string): number; + prependListener(event: EventKey, listener: Events[EventKey]): this; + prependListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + prependListener(event: string | symbol, listener: GenericListener): this; + prependOnceListener(event: EventKey, listener: Events[EventKey]): this; + prependOnceListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + prependOnceListener(event: string | symbol, listener: GenericListener): this; + eventNames(): string[]; + getMaxListeners(): number; + setMaxListeners(n: number): this; +} + +/** + * Typescript type safe event emitter + * @public + */ +export declare class TypedEventEmitter extends EventEmitter { + /* Excluded from this release type: mongoLogger */ + /* Excluded from this release type: component */ + /* Excluded from this release type: emitAndLog */ + /* Excluded from this release type: emitAndLogHeartbeat */ + /* Excluded from this release type: emitAndLogCommand */ +} + +/** @public */ +export declare class UnorderedBulkOperation extends BulkOperationBase { + /* Excluded from this release type: __constructor */ + handleWriteError(writeResult: BulkWriteResult): void; + addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this; +} + +/** @public */ +export declare interface UpdateDescription { + /** + * A document containing key:value pairs of names of the fields that were + * changed, and the new value for those fields. + */ + updatedFields?: Partial; + /** + * An array of field names that were removed from the document. + */ + removedFields?: string[]; + /** + * An array of documents which record array truncations performed with pipeline-based updates using one or more of the following stages: + * - $addFields + * - $set + * - $replaceRoot + * - $replaceWith + */ + truncatedArrays?: Array<{ + /** The name of the truncated field. */ + field: string; + /** The number of elements in the truncated array. */ + newSize: number; + }>; + /** + * A document containing additional information about any ambiguous update paths from the update event. The document + * maps the full ambiguous update path to an array containing the actual resolved components of the path. For example, + * given a document shaped like `{ a: { '0': 0 } }`, and an update of `{ $inc: 'a.0' }`, disambiguated paths would look like + * the following: + * + * ``` + * { + * 'a.0': ['a', '0'] + * } + * ``` + * + * This field is only present when there are ambiguous paths that are updated as a part of the update event. + * + * On \<8.2.0 servers, this field is only present when `showExpandedEvents` is set to true. + * is enabled for the change stream. + * + * On 8.2.0+ servers, this field is present for update events regardless of whether `showExpandedEvents` is enabled. + * @sinceServerVersion 6.1.0 + */ + disambiguatedPaths?: Document; +} + +/** @public */ +export declare type UpdateFilter = { + $currentDate?: OnlyFieldsOfType; + $inc?: OnlyFieldsOfType; + $min?: MatchKeysAndValues; + $max?: MatchKeysAndValues; + $mul?: OnlyFieldsOfType; + $rename?: Record; + $set?: MatchKeysAndValues; + $setOnInsert?: MatchKeysAndValues; + $unset?: OnlyFieldsOfType; + $addToSet?: SetFields; + $pop?: OnlyFieldsOfType, 1 | -1>; + $pull?: PullOperator; + $push?: PushOperator; + $pullAll?: PullAllOperator; + $bit?: OnlyFieldsOfType; +} & Document; + +/** @public */ +export declare interface UpdateManyModel { + /** The filter to limit the updated documents. */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export declare interface UpdateOneModel { + /** The filter that specifies which document to update. In the case of multiple matches, the first document matched is updated. */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @public */ +export declare interface UpdateOptions extends CommandOperationOptions { + /** A set of filters specifying to which array elements an update should apply */ + arrayFilters?: Document[]; + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: Hint; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** + * @public + * `TSchema` is the schema of the collection + */ +export declare interface UpdateResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of documents that matched the filter */ + matchedCount: number; + /** The number of documents that were modified */ + modifiedCount: number; + /** The number of documents that were upserted */ + upsertedCount: number; + /** The identifier of the inserted document if an upsert took place */ + upsertedId: InferIdType | null; +} + +/** @public */ +export declare interface UpdateStatement { + /** The query that matches documents to update. */ + q: Document; + /** The modifications to apply. */ + u: Document | Document[]; + /** If true, perform an insert if no documents match the query. */ + upsert?: boolean; + /** If true, updates all documents that meet the query criteria. */ + multi?: boolean; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** An array of filter documents that determines which array elements to modify for an update operation on an array field. */ + arrayFilters?: Document[]; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: SortForCmd; +} + +export { UUID } + +/** @public */ +export declare interface ValidateCollectionOptions extends Omit { + /** Validates a collection in the background, without interrupting read or write traffic */ + background?: boolean; +} + +/** @public */ +export declare type W = number | 'majority'; + +/* Excluded from this release type: WAITING_FOR_SUITABLE_SERVER */ + +/* Excluded from this release type: WaitingForSuitableServerEvent */ + +/* Excluded from this release type: WaitQueueMember */ + +/* Excluded from this release type: WithConnectionCallback */ + +/** Add an _id field to an object shaped type @public */ +export declare type WithId = EnhancedOmit & { + _id: InferIdType; +}; + +/** Remove the _id field from an object shaped type @public */ +export declare type WithoutId = Omit; + +/** @public */ +export declare type WithSessionCallback = (session: ClientSession) => Promise; + +/** @public */ +export declare type WithTransactionCallback = (session: ClientSession) => Promise; + +/* Excluded from this release type: Workflow */ + +/** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * @public + * + * @see https://www.mongodb.com/docs/manual/reference/write-concern/ + */ +export declare class WriteConcern { + /** + * Request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * If w is 0 and is set on a write operation, the server will not send a response. + */ + readonly w?: W; + /** Request acknowledgment that the write operation has been written to the on-disk journal */ + readonly journal?: boolean; + /** + * Specify a time limit to prevent write operations from blocking indefinitely. + */ + readonly wtimeoutMS?: number; + /** + * Specify a time limit to prevent write operations from blocking indefinitely. + * @deprecated Will be removed in the next major version. Please use wtimeoutMS. + */ + wtimeout?: number; + /** + * Request acknowledgment that the write operation has been written to the on-disk journal. + * @deprecated Will be removed in the next major version. Please use journal. + */ + j?: boolean; + /** + * Equivalent to the j option. + * @deprecated Will be removed in the next major version. Please use journal. + */ + fsync?: boolean | 1; + /** + * Constructs a WriteConcern from the write concern properties. + * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * @param wtimeoutMS - specify a time limit to prevent write operations from blocking indefinitely + * @param journal - request acknowledgment that the write operation has been written to the on-disk journal + * @param fsync - equivalent to the j option. Is deprecated and will be removed in the next major version. + */ + constructor(w?: W, wtimeoutMS?: number, journal?: boolean, fsync?: boolean | 1); + /** + * Apply a write concern to a command document. Will modify and return the command. + */ + static apply(command: Document, writeConcern: WriteConcern): Document; + /** Construct a WriteConcern given an options object. */ + static fromOptions(options?: WriteConcernOptions | WriteConcern | W, inherit?: WriteConcernOptions | WriteConcern): WriteConcern | undefined; +} + +/** + * An error representing a failure by the server to apply the requested write concern to the bulk operation. + * @public + * @category Error + */ +export declare class WriteConcernError { + /* Excluded from this release type: serverError */ + constructor(error: WriteConcernErrorData); + /** Write concern error code. */ + get code(): number | undefined; + /** Write concern error message. */ + get errmsg(): string | undefined; + /** Write concern error info. */ + get errInfo(): Document | undefined; + toJSON(): WriteConcernErrorData; + toString(): string; +} + +/** @public */ +export declare interface WriteConcernErrorData { + code: number; + errmsg: string; + errInfo?: Document; +} + +/** + * The type of the result property of MongoWriteConcernError + * @public + */ +export declare interface WriteConcernErrorResult { + writeConcernError: { + code: number; + errmsg: string; + codeName?: string; + errInfo?: Document; + }; + ok: number; + code?: number; + errorLabels?: string[]; + [x: string | number]: unknown; +} + +/** @public */ +export declare interface WriteConcernOptions { + /** Write Concern as an object */ + writeConcern?: WriteConcern | WriteConcernSettings; +} + +/** @public */ +export declare interface WriteConcernSettings { + /** The write concern */ + w?: W; + /** + * The write concern timeout. + */ + wtimeoutMS?: number; + /** The journal write concern */ + journal?: boolean; + /** + * The journal write concern. + * @deprecated Will be removed in the next major version. Please use the journal option. + */ + j?: boolean; + /** + * The write concern timeout. + */ + wtimeout?: number; + /** + * The file sync write concern. + * @deprecated Will be removed in the next major version. Please use the journal option. + */ + fsync?: boolean | 1; +} + +/** + * An error that occurred during a BulkWrite on the server. + * @public + * @category Error + */ +export declare class WriteError { + err: BulkWriteOperationError; + constructor(err: BulkWriteOperationError); + /** WriteError code. */ + get code(): number; + /** WriteError original bulk operation index. */ + get index(): number; + /** WriteError message. */ + get errmsg(): string | undefined; + /** WriteError details. */ + get errInfo(): Document | undefined; + /** Returns the underlying operation that caused the error */ + getOperation(): Document; + toJSON(): { + code: number; + index: number; + errmsg?: string; + op: Document; + }; + toString(): string; +} + +/* Excluded from this release type: WriteProtocolMessageType */ + +export { } diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/package.json b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/package.json new file mode 100644 index 00000000..e78347df --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/package.json @@ -0,0 +1,184 @@ +{ + "name": "mongodb", + "version": "7.6.0", + "description": "The official MongoDB driver for Node.js", + "main": "lib/index.js", + "files": [ + "lib", + "src", + "etc/prepare.js", + "mongodb.d.ts", + "tsconfig.json" + ], + "types": "mongodb.d.ts", + "repository": { + "type": "git", + "url": "git@github.com:mongodb/node-mongodb-native.git" + }, + "keywords": [ + "mongodb", + "driver", + "official" + ], + "author": { + "name": "The MongoDB NodeJS Team", + "email": "dbx-node@mongodb.com" + }, + "dependencies": { + "@mongodb-js/saslprep": "^1.4.11", + "bson": "^7.2.0", + "mongodb-connection-string-url": "^7.0.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.806.0", + "@mongodb-js/zstd": "^7.0.0", + "gcp-metadata": "^7.0.1", + "kerberos": "^7.0.0", + "mongodb-client-encryption": "^7.2.0", + "snappy": "^7.3.2", + "socks": "^2.8.6" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "snappy": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "socks": { + "optional": true + } + }, + "devDependencies": { + "@aws-sdk/credential-providers": "^3.876.0", + "@iarna/toml": "^2.2.5", + "@istanbuljs/nyc-config-typescript": "^1.0.2", + "@microsoft/api-extractor": "^7.58.7", + "@microsoft/tsdoc-config": "^0.18.1", + "@mongodb-js/zstd": "^7.0.0", + "@types/chai-subset": "^1.3.5", + "@types/express": "^5.0.6", + "@types/kerberos": "^1.1.5", + "@types/mocha": "^10.0.9", + "@types/node": "^22.15.3", + "@types/saslprep": "^1.0.3", + "@types/semver": "^7.7.0", + "@types/sinon": "^17.0.4", + "@types/whatwg-url": "^13.0.0", + "@typescript-eslint/eslint-plugin": "^8.60.1", + "@typescript-eslint/parser": "^8.31.1", + "aws4": "^1.13.2", + "chai": "^5.3.3", + "chai-subset": "^1.6.0", + "chalk": "^4.1.2", + "esbuild": "^0.28.0", + "eslint": "^9.39.1", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-mocha": "^10.4.1", + "eslint-plugin-prettier": "^5.5.6", + "eslint-plugin-simple-import-sort": "^12.1.1", + "eslint-plugin-tsdoc": "^0.5.2", + "eslint-plugin-unused-imports": "^4.4.1", + "express": "^5.2.1", + "gcp-metadata": "^7.0.1", + "js-yaml": "^4.2.0", + "mocha": "^11.7.6", + "mocha-sinon": "^2.1.2", + "mongodb-client-encryption": "^7.2.0", + "nyc": "^17.1.0", + "prettier": "^3.6.2", + "semver": "^7.7.2", + "sinon": "^18.0.1", + "sinon-chai": "^4.0.1", + "snappy": "7.3.3", + "socks": "^2.8.7", + "source-map-support": "^0.5.21", + "ts-node": "^10.9.2", + "tsd": "^0.33.0", + "typescript": "5.8.3", + "typescript-cached-transpile": "^0.0.6", + "v8-heapsnapshot": "^1.3.1", + "yargs": "^18.0.0" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=20.19.0" + }, + "bugs": { + "url": "https://jira.mongodb.org/projects/NODE/issues/" + }, + "homepage": "https://github.com/mongodb/node-mongodb-native", + "scripts": { + "build:evergreen": "node .evergreen/generate_evergreen_tasks.js", + "build:ts": "node ./node_modules/typescript/bin/tsc", + "build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts", + "build:docs": "./etc/docs/build.ts", + "build:typedoc": "typedoc", + "build:nightly": "node ./.github/scripts/nightly.mjs", + "check:bench": "npm --prefix test/benchmarks/driver_bench start", + "check:coverage": "nyc npm run test:all", + "check:integration-coverage": "nyc npm run check:test", + "check:lambda": "npm run build:bundle && nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js", + "check:lambda:aws": "npm run build:bundle && nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js", + "check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd", + "check:eslint": "npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test", + "check:tsd": "tsd --version && tsd", + "check:dependencies": "npm run build:bundle && mocha test/action/dependency.test.ts", + "check:dts": "npm run build:bundle && node ./node_modules/typescript/bin/tsc --target es2023 --module commonjs --noEmit mongodb.d.ts && tsd", + "check:search-indexes": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts", + "check:test": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration", + "check:test:debug": "npm run mocha:debug -- --config test/mocha_mongodb.js test/integration", + "check:test-bundled": "MONGODB_BUNDLED=true npm run check:test", + "check:unit": "npm run build:bundle && nyc mocha test/unit", + "check:unit:debug": "npm run mocha:debug -- test/unit", + "check:unit-bundled": "MONGODB_BUNDLED=true npm run check:unit", + "check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit", + "check:atlas": "npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts", + "check:drivers-atlas-testing": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts", + "check:aws": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts test/integration/auth/mongodb_aws.prose.test.ts", + "check:oidc-auth": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts", + "check:oidc-test": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts", + "check:kerberos": "npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts", + "check:tls": "npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts", + "check:ldap": "npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts", + "check:socks5": "npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/socks5.test.ts", + "check:csfle": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/client-side-encryption", + "check:snappy": "npm run build:bundle && nyc mocha test/unit/assorted/snappy.test.js", + "check:x509": "npm run build:bundle && nyc mocha test/manual/x509_auth.test.ts", + "check:sfp": "npm run build:bundle && nyc mocha test/manual/sfp.test.ts", + "mocha:debug": "npm run build:bundle && node --inspect --enable-source-maps --no-experimental-strip-types ./node_modules/mocha/bin/mocha.js", + "build:bundle": "npm run bundle:driver && npm run bundle:types && npm run build:runtime-barrel", + "build:runtime-barrel": "node etc/build-runtime-barrel.mjs", + "bundle:driver": "node etc/bundle-driver.mjs", + "bundle:types": "npx tsc --project ./tsconfig.json --declaration --emitDeclarationOnly --declarationDir test/tools/runner/bundle/types", + "fix:eslint": "npm run check:eslint -- --fix", + "prepare": "node etc/prepare.js", + "preview:docs": "ts-node etc/docs/preview.ts", + "switch:to-bundled": "MONGODB_BUNDLED=true npm run build:runtime-barrel", + "switch:to-unbundled": "MONGODB_BUNDLED=false npm run build:runtime-barrel", + "test": "npm run check:lint && npm run test:all", + "test:all": "npm run check:unit && npm run check:test", + "update:docs": "npm run build:docs -- --yes" + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "strict": true, + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node" + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/admin.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/admin.ts new file mode 100644 index 00000000..c75a51fa --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/admin.ts @@ -0,0 +1,173 @@ +import { type Document, resolveBSONOptions } from './bson'; +import type { Db } from './db'; +import type { CommandOperationOptions } from './operations/command'; +import { executeOperation } from './operations/execute_operation'; +import { + ListDatabasesOperation, + type ListDatabasesOptions, + type ListDatabasesResult +} from './operations/list_databases'; +import { RemoveUserOperation, type RemoveUserOptions } from './operations/remove_user'; +import { RunCommandOperation, type RunCommandOptions } from './operations/run_command'; +import { + ValidateCollectionOperation, + type ValidateCollectionOptions +} from './operations/validate_collection'; +import { MongoDBNamespace } from './utils'; + +/** @internal */ +export interface AdminPrivate { + db: Db; +} + +/** + * The **Admin** class is an internal class that allows convenient access to + * the admin functionality and commands for MongoDB. + * + * **ADMIN Cannot directly be instantiated** + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const admin = client.db().admin(); + * const dbInfo = await admin.listDatabases(); + * for (const db of dbInfo.databases) { + * console.log(db.name); + * } + * ``` + */ +export class Admin { + /** @internal */ + s: AdminPrivate; + + /** + * Create a new Admin instance + * @internal + */ + constructor(db: Db) { + this.s = { db }; + } + + /** + * Execute a command + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to execute + * @param options - Optional settings for the command + */ + async command(command: Document, options?: RunCommandOptions): Promise { + return await executeOperation( + this.s.db.client, + new RunCommandOperation(new MongoDBNamespace('admin'), command, { + ...resolveBSONOptions(options), + session: options?.session, + readPreference: options?.readPreference, + timeoutMS: options?.timeoutMS ?? this.s.db.timeoutMS + }) + ); + } + + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + async buildInfo(options?: CommandOperationOptions): Promise { + return await this.command({ buildinfo: 1 }, options); + } + + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + async serverInfo(options?: CommandOperationOptions): Promise { + return await this.command({ buildinfo: 1 }, options); + } + + /** + * Retrieve this db's server status. + * + * @param options - Optional settings for the command + */ + async serverStatus(options?: CommandOperationOptions): Promise { + return await this.command({ serverStatus: 1 }, options); + } + + /** + * Ping the MongoDB server and retrieve results + * + * @param options - Optional settings for the command + */ + async ping(options?: CommandOperationOptions): Promise { + return await this.command({ ping: 1 }, options); + } + + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + async removeUser(username: string, options?: RemoveUserOptions): Promise { + return await executeOperation( + this.s.db.client, + new RemoveUserOperation(this.s.db, username, { dbName: 'admin', ...options }) + ); + } + + /** + * Validate an existing collection + * + * @param collectionName - The name of the collection to validate. + * @param options - Optional settings for the command + */ + async validateCollection( + collectionName: string, + options: ValidateCollectionOptions = {} + ): Promise { + return await executeOperation( + this.s.db.client, + new ValidateCollectionOperation(this, collectionName, options) + ); + } + + /** + * List the available databases + * + * @param options - Optional settings for the command + */ + async listDatabases(options?: ListDatabasesOptions): Promise { + return await executeOperation( + this.s.db.client, + new ListDatabasesOperation(this.s.db, { timeoutMS: this.s.db.timeoutMS, ...options }) + ); + } + + /** + * Get ReplicaSet status + * + * @param options - Optional settings for the command + */ + async replSetGetStatus(options?: CommandOperationOptions): Promise { + return await this.command({ replSetGetStatus: 1 }, options); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bson.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bson.ts new file mode 100644 index 00000000..62391315 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bson.ts @@ -0,0 +1,178 @@ +/* eslint-disable no-restricted-imports */ +import { BSON, type DeserializeOptions, NumberUtils, type SerializeOptions } from 'bson'; + +export { + Binary, + BSON, + BSONError, + BSONRegExp, + BSONSymbol, + BSONType, + ByteUtils, + calculateObjectSize, + Code, + DBRef, + Decimal128, + deserialize, + type DeserializeOptions, + Document, + Double, + EJSON, + EJSONOptions, + Int32, + Long, + MaxKey, + MinKey, + NumberUtils, + ObjectId, + type ObjectIdLike, + serialize, + Timestamp, + UUID +} from 'bson'; + +/** @internal */ +export type BSONElement = BSON.OnDemand['BSONElement']; + +export function parseToElementsToArray(bytes: Uint8Array, offset?: number): BSONElement[] { + const res = BSON.onDemand.parseToElements(bytes, offset); + return Array.isArray(res) ? res : [...res]; +} + +// validates buffer inputs, used for read operations +const validateBufferInputs = (buffer: Uint8Array, offset: number, length: number) => { + if (offset < 0 || offset + length > buffer.length) { + throw new RangeError( + `Attempt to access memory outside buffer bounds: buffer length: ${buffer.length}, offset: ${offset}, length: ${length}` + ); + } +}; + +// readInt32LE, reads a 32-bit integer from buffer at given offset +// throws if offset is out of bounds +export const readInt32LE = (buffer: Uint8Array, offset: number): number => { + validateBufferInputs(buffer, offset, 4); + return NumberUtils.getInt32LE(buffer, offset); +}; + +// readUint8, reads a single unsigned byte from buffer at given offset +export const readUint8 = (buffer: Uint8Array, offset: number): number => { + validateBufferInputs(buffer, offset, 1); + return buffer[offset]; +}; + +export const setUint32LE = (destination: Uint8Array, offset: number, value: number): 4 => { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; +}; + +/** + * BSON Serialization options. + * @public + */ +export interface BSONSerializeOptions + extends Omit, + Omit< + DeserializeOptions, + | 'evalFunctions' + | 'cacheFunctions' + | 'cacheFunctionsCrc32' + | 'allowObjectSmallerThanBufferSize' + | 'index' + | 'validation' + > { + /** + * Enabling the raw option will return a [Node.js Buffer](https://nodejs.org/api/buffer.html) + * which is allocated using [allocUnsafe API](https://nodejs.org/api/buffer.html#static-method-bufferallocunsafesize). + * See this section from the [Node.js Docs here](https://nodejs.org/api/buffer.html#what-makes-bufferallocunsafe-and-bufferallocunsafeslow-unsafe) + * for more detail about what "unsafe" refers to in this context. + * If you need to maintain your own editable clone of the bytes returned for an extended life time of the process, it is recommended you allocate + * your own buffer and clone the contents: + * + * @example + * ```ts + * const raw = await collection.findOne({}, { raw: true }); + * const myBuffer = Buffer.alloc(raw.byteLength); + * myBuffer.set(raw, 0); + * // Only save and use `myBuffer` beyond this point + * ``` + * + * @remarks + * Please note there is a known limitation where this option cannot be used at the MongoClient level (see [NODE-3946](https://jira.mongodb.org/browse/NODE-3946)). + * It does correctly work at `Db`, `Collection`, and per operation the same as other BSON options work. + */ + raw?: boolean; + + /** Enable utf8 validation when deserializing BSON documents. Defaults to true. */ + enableUtf8Validation?: boolean; +} + +export function pluckBSONSerializeOptions(options: BSONSerializeOptions): BSONSerializeOptions { + const { + fieldsAsRaw, + useBigInt64, + promoteValues, + promoteBuffers, + promoteLongs, + serializeFunctions, + ignoreUndefined, + bsonRegExp, + raw, + enableUtf8Validation + } = options; + return { + fieldsAsRaw, + useBigInt64, + promoteValues, + promoteBuffers, + promoteLongs, + serializeFunctions, + ignoreUndefined, + bsonRegExp, + raw, + enableUtf8Validation + }; +} + +/** + * Merge the given BSONSerializeOptions, preferring options over the parent's options, and + * substituting defaults for values not set. + * + * @internal + */ +export function resolveBSONOptions( + options?: BSONSerializeOptions, + parent?: { bsonOptions?: BSONSerializeOptions } +): BSONSerializeOptions { + const parentOptions = parent?.bsonOptions; + return { + raw: options?.raw ?? parentOptions?.raw ?? false, + useBigInt64: options?.useBigInt64 ?? parentOptions?.useBigInt64 ?? false, + promoteLongs: options?.promoteLongs ?? parentOptions?.promoteLongs ?? true, + promoteValues: options?.promoteValues ?? parentOptions?.promoteValues ?? true, + promoteBuffers: options?.promoteBuffers ?? parentOptions?.promoteBuffers ?? false, + ignoreUndefined: options?.ignoreUndefined ?? parentOptions?.ignoreUndefined ?? false, + bsonRegExp: options?.bsonRegExp ?? parentOptions?.bsonRegExp ?? false, + serializeFunctions: options?.serializeFunctions ?? parentOptions?.serializeFunctions ?? false, + fieldsAsRaw: options?.fieldsAsRaw ?? parentOptions?.fieldsAsRaw ?? {}, + enableUtf8Validation: + options?.enableUtf8Validation ?? parentOptions?.enableUtf8Validation ?? true + }; +} + +/** @internal */ +export function parseUtf8ValidationOption(options?: { enableUtf8Validation?: boolean }): { + utf8: { writeErrors: false } | false; +} { + const enableUtf8Validation = options?.enableUtf8Validation; + if (enableUtf8Validation === false) { + return { utf8: false }; + } + return { utf8: { writeErrors: false } }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/common.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/common.ts new file mode 100644 index 00000000..e1a7308d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/common.ts @@ -0,0 +1,1283 @@ +import { type BSONSerializeOptions, type Document, EJSON, resolveBSONOptions } from '../bson'; +import type { Collection } from '../collection'; +import { + type AnyError, + MongoBatchReExecutionError, + MONGODB_ERROR_CODES, + MongoInvalidArgumentError, + MongoRuntimeError, + MongoServerError, + MongoWriteConcernError +} from '../error'; +import type { Filter, OneOrMore, OptionalId, UpdateFilter, WithoutId } from '../mongo_types'; +import type { CollationOptions, CommandOperationOptions } from '../operations/command'; +import { DeleteOperation, type DeleteStatement, makeDeleteStatement } from '../operations/delete'; +import { executeOperation } from '../operations/execute_operation'; +import { InsertOperation } from '../operations/insert'; +import { type Hint } from '../operations/operation'; +import { makeUpdateStatement, UpdateOperation, type UpdateStatement } from '../operations/update'; +import type { Topology } from '../sdam/topology'; +import { type Sort } from '../sort'; +import { TimeoutContext } from '../timeout'; +import { + getTopology, + hasAtomicOperators, + maybeAddIdToDocuments, + type MongoDBNamespace, + resolveOptions +} from '../utils'; +import { WriteConcern } from '../write_concern'; + +/** @public */ +export const BatchType = Object.freeze({ + INSERT: 1, + UPDATE: 2, + DELETE: 3 +} as const); + +/** @public */ +export type BatchType = (typeof BatchType)[keyof typeof BatchType]; + +/** @public */ +export interface InsertOneModel { + /** The document to insert. */ + document: OptionalId; +} + +/** @public */ +export interface DeleteOneModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export interface DeleteManyModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export interface ReplaceOneModel { + /** The filter that specifies which document to replace. In the case of multiple matches, the first document matched is replaced. */ + filter: Filter; + /** The document with which to replace the matched document. */ + replacement: WithoutId; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @public */ +export interface UpdateOneModel { + /** The filter that specifies which document to update. In the case of multiple matches, the first document matched is updated. */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @public */ +export interface UpdateManyModel { + /** The filter to limit the updated documents. */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export type AnyBulkWriteOperation = + | { insertOne: InsertOneModel } + | { replaceOne: ReplaceOneModel } + | { updateOne: UpdateOneModel } + | { updateMany: UpdateManyModel } + | { deleteOne: DeleteOneModel } + | { deleteMany: DeleteManyModel }; + +/** @internal */ +export interface BulkResult { + ok: number; + writeErrors: WriteError[]; + writeConcernErrors: WriteConcernError[]; + insertedIds: Document[]; + nInserted: number; + nUpserted: number; + nMatched: number; + nModified: number; + nRemoved: number; + upserted: Document[]; +} + +/** + * Keeps the state of a unordered batch so we can rewrite the results + * correctly after command execution + * + * @public + */ +export class Batch { + originalZeroIndex: number; + currentIndex: number; + originalIndexes: number[]; + batchType: BatchType; + operations: T[]; + serializedOperations: Uint8Array[]; + size: number; + sizeBytes: number; + + constructor(batchType: BatchType, originalZeroIndex: number) { + this.originalZeroIndex = originalZeroIndex; + this.currentIndex = 0; + this.originalIndexes = []; + this.batchType = batchType; + this.operations = []; + this.serializedOperations = []; + this.size = 0; + this.sizeBytes = 0; + } +} + +/** + * @public + * The result of a bulk write. + */ +export class BulkWriteResult { + private readonly result: BulkResult; + /** Number of documents inserted. */ + readonly insertedCount: number; + /** Number of documents matched for update. */ + readonly matchedCount: number; + /** Number of documents modified. */ + readonly modifiedCount: number; + /** Number of documents deleted. */ + readonly deletedCount: number; + /** Number of documents upserted. */ + readonly upsertedCount: number; + /** Upserted document generated Id's, hash key is the index of the originating operation */ + readonly upsertedIds: { [key: number]: any }; + /** Inserted document generated Id's, hash key is the index of the originating operation */ + readonly insertedIds: { [key: number]: any }; + + private static generateIdMap(ids: Document[]): { [key: number]: any } { + const idMap: { [index: number]: any } = {}; + for (const doc of ids) { + idMap[doc.index] = doc._id; + } + return idMap; + } + + /** + * Create a new BulkWriteResult instance + * @internal + */ + constructor(bulkResult: BulkResult, isOrdered: boolean) { + this.result = bulkResult; + this.insertedCount = this.result.nInserted ?? 0; + this.matchedCount = this.result.nMatched ?? 0; + this.modifiedCount = this.result.nModified ?? 0; + this.deletedCount = this.result.nRemoved ?? 0; + this.upsertedCount = this.result.upserted.length ?? 0; + this.upsertedIds = BulkWriteResult.generateIdMap(this.result.upserted); + this.insertedIds = BulkWriteResult.generateIdMap( + this.getSuccessfullyInsertedIds(bulkResult, isOrdered) + ); + Object.defineProperty(this, 'result', { value: this.result, enumerable: false }); + } + + /** Evaluates to true if the bulk operation correctly executes */ + get ok(): number { + return this.result.ok; + } + + /** + * Returns document_ids that were actually inserted + * @internal + */ + private getSuccessfullyInsertedIds(bulkResult: BulkResult, isOrdered: boolean): Document[] { + if (bulkResult.writeErrors.length === 0) return bulkResult.insertedIds; + + if (isOrdered) { + return bulkResult.insertedIds.slice(0, bulkResult.writeErrors[0].index); + } + + return bulkResult.insertedIds.filter( + ({ index }) => !bulkResult.writeErrors.some(writeError => index === writeError.index) + ); + } + + /** Returns the upserted id at the given index */ + getUpsertedIdAt(index: number): Document | undefined { + return this.result.upserted[index]; + } + + /** Returns raw internal result */ + getRawResponse(): Document { + return this.result; + } + + /** Returns true if the bulk operation contains a write error */ + hasWriteErrors(): boolean { + return this.result.writeErrors.length > 0; + } + + /** Returns the number of write errors from the bulk operation */ + getWriteErrorCount(): number { + return this.result.writeErrors.length; + } + + /** Returns a specific write error object */ + getWriteErrorAt(index: number): WriteError | undefined { + return index < this.result.writeErrors.length ? this.result.writeErrors[index] : undefined; + } + + /** Retrieve all write errors */ + getWriteErrors(): WriteError[] { + return this.result.writeErrors; + } + + /** Retrieve the write concern error if one exists */ + getWriteConcernError(): WriteConcernError | undefined { + if (this.result.writeConcernErrors.length === 0) { + return; + } else if (this.result.writeConcernErrors.length === 1) { + // Return the error + return this.result.writeConcernErrors[0]; + } else { + // Combine the errors + let errmsg = ''; + for (let i = 0; i < this.result.writeConcernErrors.length; i++) { + const err = this.result.writeConcernErrors[i]; + errmsg = errmsg + err.errmsg; + + // TODO: Something better + if (i === 0) errmsg = errmsg + ' and '; + } + + return new WriteConcernError({ errmsg, code: MONGODB_ERROR_CODES.WriteConcernTimeout }); + } + } + + toString(): string { + return `BulkWriteResult(${EJSON.stringify(this.result)})`; + } + + isOk(): boolean { + return this.result.ok === 1; + } +} + +/** @public */ +export interface WriteConcernErrorData { + code: number; + errmsg: string; + errInfo?: Document; +} + +/** + * An error representing a failure by the server to apply the requested write concern to the bulk operation. + * @public + * @category Error + */ +export class WriteConcernError { + /** @internal */ + private serverError: WriteConcernErrorData; + + constructor(error: WriteConcernErrorData) { + this.serverError = error; + } + + /** Write concern error code. */ + get code(): number | undefined { + return this.serverError.code; + } + + /** Write concern error message. */ + get errmsg(): string | undefined { + return this.serverError.errmsg; + } + + /** Write concern error info. */ + get errInfo(): Document | undefined { + return this.serverError.errInfo; + } + + toJSON(): WriteConcernErrorData { + return this.serverError; + } + + toString(): string { + return `WriteConcernError(${this.errmsg})`; + } +} + +/** @public */ +export interface BulkWriteOperationError { + index: number; + code: number; + errmsg: string; + errInfo: Document; + op: Document | UpdateStatement | DeleteStatement; +} + +/** + * An error that occurred during a BulkWrite on the server. + * @public + * @category Error + */ +export class WriteError { + err: BulkWriteOperationError; + + constructor(err: BulkWriteOperationError) { + this.err = err; + } + + /** WriteError code. */ + get code(): number { + return this.err.code; + } + + /** WriteError original bulk operation index. */ + get index(): number { + return this.err.index; + } + + /** WriteError message. */ + get errmsg(): string | undefined { + return this.err.errmsg; + } + + /** WriteError details. */ + get errInfo(): Document | undefined { + return this.err.errInfo; + } + + /** Returns the underlying operation that caused the error */ + getOperation(): Document { + return this.err.op; + } + + toJSON(): { code: number; index: number; errmsg?: string; op: Document } { + return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op }; + } + + toString(): string { + return `WriteError(${JSON.stringify(this.toJSON())})`; + } +} + +/** Merges results into shared data structure */ +export function mergeBatchResults( + batch: Batch, + bulkResult: BulkResult, + err?: AnyError, + result?: Document +): void { + // If we have an error set the result to be the err object + if (err) { + result = err; + } else if (result && result.result) { + result = result.result; + } + + if (result == null) { + return; + } + + // Do we have a top level error stop processing and return + if (result.ok === 0 && bulkResult.ok === 1) { + bulkResult.ok = 0; + + const writeError = { + index: 0, + code: result.code || 0, + errmsg: result.message, + errInfo: result.errInfo, + op: batch.operations[0] + }; + + bulkResult.writeErrors.push(new WriteError(writeError)); + return; + } else if (result.ok === 0 && bulkResult.ok === 0) { + return; + } + + // If we have an insert Batch type + if (isInsertBatch(batch) && result.n) { + bulkResult.nInserted = bulkResult.nInserted + result.n; + } + + // If we have an insert Batch type + if (isDeleteBatch(batch) && result.n) { + bulkResult.nRemoved = bulkResult.nRemoved + result.n; + } + + let nUpserted = 0; + + // We have an array of upserted values, we need to rewrite the indexes + if (Array.isArray(result.upserted)) { + nUpserted = result.upserted.length; + + for (let i = 0; i < result.upserted.length; i++) { + bulkResult.upserted.push({ + index: result.upserted[i].index + batch.originalZeroIndex, + _id: result.upserted[i]._id + }); + } + } else if (result.upserted) { + nUpserted = 1; + + bulkResult.upserted.push({ + index: batch.originalZeroIndex, + _id: result.upserted + }); + } + + // If we have an update Batch type + if (isUpdateBatch(batch) && result.n) { + const nModified = result.nModified; + bulkResult.nUpserted = bulkResult.nUpserted + nUpserted; + bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted); + + if (typeof nModified === 'number') { + bulkResult.nModified = bulkResult.nModified + nModified; + } else { + bulkResult.nModified = 0; + } + } + + if (Array.isArray(result.writeErrors)) { + for (let i = 0; i < result.writeErrors.length; i++) { + const writeError = { + index: batch.originalIndexes[result.writeErrors[i].index], + code: result.writeErrors[i].code, + errmsg: result.writeErrors[i].errmsg, + errInfo: result.writeErrors[i].errInfo, + op: batch.operations[result.writeErrors[i].index] + }; + + bulkResult.writeErrors.push(new WriteError(writeError)); + } + } + + if (result.writeConcernError) { + bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError)); + } +} + +async function executeCommands( + bulkOperation: BulkOperationBase, + options: BulkWriteOptions & { timeoutContext?: TimeoutContext | null } +): Promise { + if (bulkOperation.s.batches.length === 0) { + return new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + } + + for (const batch of bulkOperation.s.batches) { + const finalOptions = resolveOptions(bulkOperation, { + ...options, + ordered: bulkOperation.isOrdered + }); + + if (finalOptions.bypassDocumentValidation !== true) { + delete finalOptions.bypassDocumentValidation; + } + + // Is the bypassDocumentValidation options specific + if (bulkOperation.s.bypassDocumentValidation === true) { + finalOptions.bypassDocumentValidation = true; + } + + // Is the checkKeys option disabled + if (bulkOperation.s.checkKeys === false) { + finalOptions.checkKeys = false; + } + + if (bulkOperation.retryWrites) { + if (isUpdateBatch(batch)) { + bulkOperation.retryWrites = + bulkOperation.retryWrites && !batch.operations.some(op => op.multi); + } + + if (isDeleteBatch(batch)) { + bulkOperation.retryWrites = + bulkOperation.retryWrites && !batch.operations.some(op => op.limit === 0); + } + } + + // The per-operation buffers were serialized in addToOperationsList using the + // bulk operation's BSON options. Reuse them only when the serialization + // options in effect for this execution still match, so that BSON options + // supplied to execute() (e.g. `ignoreUndefined`) are honored. Also skip reuse + // under auto-encryption, where libmongocrypt requires the plaintext command + // (document sequences are not permitted per the bulkWrite spec). + const createdBsonOptions = bulkOperation.s.bsonOptions; + const canReuseSerialized = + !bulkOperation.s.usingAutoEncryption && + finalOptions.ignoreUndefined === createdBsonOptions.ignoreUndefined && + finalOptions.serializeFunctions === createdBsonOptions.serializeFunctions && + (finalOptions.checkKeys ?? false) === bulkOperation.s.checkKeys; + const serialized = canReuseSerialized ? batch.serializedOperations : undefined; + + const operation = isInsertBatch(batch) + ? new InsertOperation(bulkOperation.s.namespace, batch.operations, finalOptions, serialized) + : isUpdateBatch(batch) + ? new UpdateOperation(bulkOperation.s.namespace, batch.operations, finalOptions, serialized) + : isDeleteBatch(batch) + ? new DeleteOperation( + bulkOperation.s.namespace, + batch.operations, + finalOptions, + serialized + ) + : null; + + if (operation == null) throw new MongoRuntimeError(`Unknown batchType: ${batch.batchType}`); + + let thrownError = null; + let result; + try { + result = await executeOperation( + bulkOperation.s.collection.client, + operation, + finalOptions.timeoutContext + ); + } catch (error) { + thrownError = error; + } + + // Release this batch's serialized buffers now that it has been sent. The + // operation keeps its own reference to the array for the duration of its + // execution and any retries, so reassigning here (rather than mutating the + // shared array) only drops the bulk operation's copy. All batches are built + // up front, so this does not lower the peak (reached before the first send); + // it frees each batch's buffers as that batch completes so they are not kept + // alive through the remaining batches' round trips. + batch.serializedOperations = []; + + if (thrownError != null) { + if (thrownError instanceof MongoWriteConcernError) { + mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result); + const writeResult = new BulkWriteResult( + bulkOperation.s.bulkResult, + bulkOperation.isOrdered + ); + + throw new MongoBulkWriteError( + { + message: thrownError.result.writeConcernError.errmsg, + code: thrownError.result.writeConcernError.code + }, + writeResult + ); + } else { + // Error is a driver related error not a bulk op error, return early + throw new MongoBulkWriteError( + thrownError, + new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered) + ); + } + } + + mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result); + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + bulkOperation.handleWriteError(writeResult); + } + + bulkOperation.s.batches.length = 0; + + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + bulkOperation.handleWriteError(writeResult); + return writeResult; +} + +/** + * An error indicating an unsuccessful Bulk Write + * @public + * @category Error + */ +export class MongoBulkWriteError extends MongoServerError { + result: BulkWriteResult; + writeErrors: OneOrMore = []; + err?: WriteConcernError; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor( + error: + | { message: string; code: number; writeErrors?: WriteError[] } + | WriteConcernError + | AnyError, + result: BulkWriteResult + ) { + super(error); + + if (error instanceof WriteConcernError) this.err = error; + else if (!(error instanceof Error)) { + this.message = error.message; + this.code = error.code; + this.writeErrors = error.writeErrors ?? []; + } + + this.result = result; + Object.assign(this, error); + } + + override get name(): string { + return 'MongoBulkWriteError'; + } + + /** Number of documents inserted. */ + get insertedCount(): number { + return this.result.insertedCount; + } + /** Number of documents matched for update. */ + get matchedCount(): number { + return this.result.matchedCount; + } + /** Number of documents modified. */ + get modifiedCount(): number { + return this.result.modifiedCount; + } + /** Number of documents deleted. */ + get deletedCount(): number { + return this.result.deletedCount; + } + /** Number of documents upserted. */ + get upsertedCount(): number { + return this.result.upsertedCount; + } + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds(): { [key: number]: any } { + return this.result.insertedIds; + } + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds(): { [key: number]: any } { + return this.result.upsertedIds; + } +} + +/** + * A builder object that is returned from {@link BulkOperationBase#find}. + * Is used to build a write operation that involves a query filter. + * + * @public + */ +export class FindOperators { + bulkOperation: BulkOperationBase; + + /** + * Creates a new FindOperators object. + * @internal + */ + constructor(bulkOperation: BulkOperationBase) { + this.bulkOperation = bulkOperation; + } + + /** Add a multiple update operation to the bulk operation */ + update(updateDocument: Document | Document[]): BulkOperationBase { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.UPDATE, + makeUpdateStatement(currentOp.selector, updateDocument, { + ...currentOp, + multi: true + }) + ); + } + + /** Add a single update operation to the bulk operation */ + updateOne(updateDocument: Document | Document[]): BulkOperationBase { + if (!hasAtomicOperators(updateDocument, this.bulkOperation.bsonOptions)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.UPDATE, + makeUpdateStatement(currentOp.selector, updateDocument, { ...currentOp, multi: false }) + ); + } + + /** Add a replace one operation to the bulk operation */ + replaceOne(replacement: Document): BulkOperationBase { + if (hasAtomicOperators(replacement)) { + throw new MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.UPDATE, + makeUpdateStatement(currentOp.selector, replacement, { ...currentOp, multi: false }) + ); + } + + /** Add a delete one operation to the bulk operation */ + deleteOne(): BulkOperationBase { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(currentOp.selector, { ...currentOp, limit: 1 }) + ); + } + + /** Add a delete many operation to the bulk operation */ + delete(): BulkOperationBase { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(currentOp.selector, { ...currentOp, limit: 0 }) + ); + } + + /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */ + upsert(): this { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + + this.bulkOperation.s.currentOp.upsert = true; + return this; + } + + /** Specifies the collation for the query condition. */ + collation(collation: CollationOptions): this { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + + this.bulkOperation.s.currentOp.collation = collation; + return this; + } + + /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */ + arrayFilters(arrayFilters: Document[]): this { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + + this.bulkOperation.s.currentOp.arrayFilters = arrayFilters; + return this; + } + + /** Specifies hint for the bulk operation. */ + hint(hint: Hint): this { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + + this.bulkOperation.s.currentOp.hint = hint; + return this; + } +} + +/** @internal */ +export interface BulkOperationPrivate { + bulkResult: BulkResult; + currentBatch?: Batch; + currentIndex: number; + // ordered specific + currentBatchSize: number; + currentBatchSizeBytes: number; + // unordered specific + currentInsertBatch?: Batch; + currentUpdateBatch?: Batch; + currentRemoveBatch?: Batch; + batches: Batch[]; + // Write concern + writeConcern?: WriteConcern; + // Max batch size options + maxBsonObjectSize: number; + maxBatchSizeBytes: number; + maxWriteBatchSize: number; + maxKeySize: number; + // Namespace + namespace: MongoDBNamespace; + // Topology + topology: Topology; + // Options + options: BulkWriteOptions; + // BSON options + bsonOptions: BSONSerializeOptions; + // Document used to build a bulk operation + currentOp?: Document; + // Executed + executed: boolean; + // Collection + collection: Collection; + // Fundamental error + err?: AnyError; + // check keys + checkKeys: boolean; + bypassDocumentValidation?: boolean; + usingAutoEncryption: boolean; +} + +/** @public */ +export interface BulkWriteOptions extends CommandOperationOptions { + /** + * Allow driver to bypass schema validation. + * @defaultValue `false` - documents will be validated by default + **/ + bypassDocumentValidation?: boolean; + /** + * If true, when an insert fails, don't execute the remaining writes. + * If false, continue with remaining inserts when one fails. + * @defaultValue `true` - inserts are ordered by default + */ + ordered?: boolean; + /** + * Force server to assign _id values instead of driver. + * @defaultValue `false` - the driver generates `_id` fields by default + **/ + forceServerObjectId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + + /** @internal */ + timeoutContext?: TimeoutContext; +} + +/** @public */ +export abstract class BulkOperationBase { + isOrdered: boolean; + /** @internal */ + s: BulkOperationPrivate; + operationId?: number; + private collection: Collection; + /** @internal */ + retryWrites?: boolean; + + /** + * Create a new OrderedBulkOperation or UnorderedBulkOperation instance + * @internal + */ + constructor(collection: Collection, options: BulkWriteOptions, isOrdered: boolean) { + this.collection = collection; + this.retryWrites = collection.db.options?.retryWrites; + // determine whether bulkOperation is ordered or unordered + this.isOrdered = isOrdered; + + const topology = getTopology(collection); + options = options == null ? {} : options; + // TODO Bring from driver information in hello + // Get the namespace for the write operations + const namespace = collection.s.namespace; + // Used to mark operation as executed + const executed = false; + + // Current item + const currentOp = undefined; + + // Set max byte size + const hello = topology.lastHello(); + + // If we have autoEncryption on, batch-splitting must be done on 2mb chunks, but single documents + // over 2mb are still allowed + const usingAutoEncryption = !!(topology.s.options && topology.s.options.autoEncrypter); + const maxBsonObjectSize = + hello && hello.maxBsonObjectSize ? hello.maxBsonObjectSize : 1024 * 1024 * 16; + const maxBatchSizeBytes = usingAutoEncryption ? 1024 * 1024 * 2 : maxBsonObjectSize; + const maxWriteBatchSize = hello && hello.maxWriteBatchSize ? hello.maxWriteBatchSize : 1000; + + // Calculates the largest possible size of an Array key, represented as a BSON string + // element. This calculation: + // 1 byte for BSON type + // # of bytes = length of (string representation of (maxWriteBatchSize - 1)) + // + 1 bytes for null terminator + const maxKeySize = (maxWriteBatchSize - 1).toString(10).length + 2; + + // Final results + const bulkResult: BulkResult = { + ok: 1, + writeErrors: [], + writeConcernErrors: [], + insertedIds: [], + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [] + }; + + // Internal state + this.s = { + // Final result + bulkResult, + // Current batch state + currentBatch: undefined, + currentIndex: 0, + // ordered specific + currentBatchSize: 0, + currentBatchSizeBytes: 0, + // unordered specific + currentInsertBatch: undefined, + currentUpdateBatch: undefined, + currentRemoveBatch: undefined, + batches: [], + // Write concern + writeConcern: WriteConcern.fromOptions(options), + // Max batch size options + maxBsonObjectSize, + maxBatchSizeBytes, + maxWriteBatchSize, + maxKeySize, + // Namespace + namespace, + // Topology + topology, + // Options + options: options, + // BSON options + bsonOptions: resolveBSONOptions(options), + // Current operation + currentOp, + // Executed + executed, + // Collection + collection, + // Fundamental error + err: undefined, + // check keys + checkKeys: typeof options.checkKeys === 'boolean' ? options.checkKeys : false, + usingAutoEncryption + }; + + // bypass Validation + if (options.bypassDocumentValidation === true) { + this.s.bypassDocumentValidation = true; + } + } + + /** + * Add a single insert document to the bulk operation + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Adds three inserts to the bulkOp. + * bulkOp + * .insert({ a: 1 }) + * .insert({ b: 2 }) + * .insert({ c: 3 }); + * await bulkOp.execute(); + * ``` + */ + insert(document: Document): BulkOperationBase { + maybeAddIdToDocuments(this.collection, document, { + forceServerObjectId: this.shouldForceServerObjectId() + }); + + return this.addToOperationsList(BatchType.INSERT, document); + } + + /** + * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. + * Returns a builder object used to complete the definition of the operation. + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Add an updateOne to the bulkOp + * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } }); + * + * // Add an updateMany to the bulkOp + * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } }); + * + * // Add an upsert + * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } }); + * + * // Add a deletion + * bulkOp.find({ g: 7 }).deleteOne(); + * + * // Add a multi deletion + * bulkOp.find({ h: 8 }).delete(); + * + * // Add a replaceOne + * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }}); + * + * // Update using a pipeline + * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([ + * { $set: { total: { $sum: [ '$y', '$z' ] } } } + * ]); + * + * // All of the ops will now be executed + * await bulkOp.execute(); + * ``` + */ + find(selector: Document): FindOperators { + if (!selector) { + throw new MongoInvalidArgumentError('Bulk find operation must specify a selector'); + } + + // Save a current selector + this.s.currentOp = { + selector: selector + }; + + return new FindOperators(this); + } + + /** Specifies a raw operation to perform in the bulk write. */ + raw(op: AnyBulkWriteOperation): this { + if (op == null || typeof op !== 'object') { + throw new MongoInvalidArgumentError('Operation must be an object with an operation key'); + } + if ('insertOne' in op) { + const forceServerObjectId = this.shouldForceServerObjectId(); + const document = + op.insertOne && op.insertOne.document == null + ? // TODO(NODE-6003): remove support for omitting the `documents` subdocument in bulk inserts + (op.insertOne as Document) + : op.insertOne.document; + + maybeAddIdToDocuments(this.collection, document, { forceServerObjectId }); + + return this.addToOperationsList(BatchType.INSERT, document); + } + + if ('replaceOne' in op || 'updateOne' in op || 'updateMany' in op) { + if ('replaceOne' in op) { + if ('q' in op.replaceOne) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = makeUpdateStatement( + op.replaceOne.filter, + op.replaceOne.replacement, + { ...op.replaceOne, multi: false } + ); + if (hasAtomicOperators(updateStatement.u)) { + throw new MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + return this.addToOperationsList(BatchType.UPDATE, updateStatement); + } + + if ('updateOne' in op) { + if ('q' in op.updateOne) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = makeUpdateStatement(op.updateOne.filter, op.updateOne.update, { + ...op.updateOne, + multi: false + }); + if (!hasAtomicOperators(updateStatement.u, this.bsonOptions)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(BatchType.UPDATE, updateStatement); + } + + if ('updateMany' in op) { + if ('q' in op.updateMany) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = makeUpdateStatement(op.updateMany.filter, op.updateMany.update, { + ...op.updateMany, + multi: true + }); + if (!hasAtomicOperators(updateStatement.u, this.bsonOptions)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(BatchType.UPDATE, updateStatement); + } + } + + if ('deleteOne' in op) { + if ('q' in op.deleteOne) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(op.deleteOne.filter, { ...op.deleteOne, limit: 1 }) + ); + } + + if ('deleteMany' in op) { + if ('q' in op.deleteMany) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(op.deleteMany.filter, { ...op.deleteMany, limit: 0 }) + ); + } + + // otherwise an unknown operation was provided + throw new MongoInvalidArgumentError( + 'bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany' + ); + } + + get length(): number { + return this.s.currentIndex; + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + get writeConcern(): WriteConcern | undefined { + return this.s.writeConcern; + } + + get batches(): Batch[] { + const batches = [...this.s.batches]; + if (this.isOrdered) { + if (this.s.currentBatch) batches.push(this.s.currentBatch); + } else { + if (this.s.currentInsertBatch) batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) batches.push(this.s.currentRemoveBatch); + } + return batches; + } + + async execute(options: BulkWriteOptions = {}): Promise { + if (this.s.executed) { + throw new MongoBatchReExecutionError(); + } + + const writeConcern = WriteConcern.fromOptions(options); + if (writeConcern) { + this.s.writeConcern = writeConcern; + } + + // If we have current batch + if (this.isOrdered) { + if (this.s.currentBatch) this.s.batches.push(this.s.currentBatch); + } else { + if (this.s.currentInsertBatch) this.s.batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) this.s.batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) this.s.batches.push(this.s.currentRemoveBatch); + } + // If we have no operations in the bulk raise an error + if (this.s.batches.length === 0) { + throw new MongoInvalidArgumentError('Invalid BulkOperation, Batch cannot be empty'); + } + + this.s.executed = true; + const finalOptions = resolveOptions(this.collection, { ...this.s.options, ...options }); + + // if there is no timeoutContext provided, create a timeoutContext and use it for + // all batches in the bulk operation + finalOptions.timeoutContext ??= TimeoutContext.create({ + session: finalOptions.session, + timeoutMS: finalOptions.timeoutMS, + serverSelectionTimeoutMS: this.collection.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: this.collection.client.s.options.waitQueueTimeoutMS + }); + + if (finalOptions.session == null) { + // if there is not an explicit session provided to `execute()`, create + // an implicit session and use that for all batches in the bulk operation + return await this.collection.client.withSession({ explicit: false }, async session => { + return await executeCommands(this, { ...finalOptions, session }); + }); + } + + return await executeCommands(this, { ...finalOptions }); + } + + /** + * Handles the write error before executing commands + * @internal + */ + handleWriteError(writeResult: BulkWriteResult): void { + if (this.s.bulkResult.writeErrors.length > 0) { + const msg = this.s.bulkResult.writeErrors[0].errmsg + ? this.s.bulkResult.writeErrors[0].errmsg + : 'write operation failed'; + + throw new MongoBulkWriteError( + { + message: msg, + code: this.s.bulkResult.writeErrors[0].code, + writeErrors: this.s.bulkResult.writeErrors + }, + writeResult + ); + } + + const writeConcernError = writeResult.getWriteConcernError(); + if (writeConcernError) { + throw new MongoBulkWriteError(writeConcernError, writeResult); + } + } + + abstract addToOperationsList( + batchType: BatchType, + document: Document | UpdateStatement | DeleteStatement + ): this; + + private shouldForceServerObjectId(): boolean { + return ( + this.s.options.forceServerObjectId === true || + this.s.collection.db.options?.forceServerObjectId === true + ); + } +} + +function isInsertBatch(batch: Batch): boolean { + return batch.batchType === BatchType.INSERT; +} + +function isUpdateBatch(batch: Batch): batch is Batch { + return batch.batchType === BatchType.UPDATE; +} + +function isDeleteBatch(batch: Batch): batch is Batch { + return batch.batchType === BatchType.DELETE; +} + +function buildCurrentOp(bulkOp: BulkOperationBase): Document { + let { currentOp } = bulkOp.s; + bulkOp.s.currentOp = undefined; + if (!currentOp) currentOp = {}; + return currentOp; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/ordered.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/ordered.ts new file mode 100644 index 00000000..4aa0acb5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/ordered.ts @@ -0,0 +1,99 @@ +import type { Document } from '../bson'; +import * as BSON from '../bson'; +import type { Collection } from '../collection'; +import { MongoInvalidArgumentError } from '../error'; +import type { DeleteStatement } from '../operations/delete'; +import type { UpdateStatement } from '../operations/update'; +import { Batch, BatchType, BulkOperationBase, type BulkWriteOptions } from './common'; + +/** @public */ +export class OrderedBulkOperation extends BulkOperationBase { + /** @internal */ + constructor(collection: Collection, options: BulkWriteOptions) { + super(collection, options, true); + } + + addToOperationsList( + batchType: BatchType, + document: Document | UpdateStatement | DeleteStatement + ): this { + // Serialize the operation once here and reuse the bytes for both the size + // check/splitting and the wire message (via a DocumentSequence). Under + // auto-encryption the command is sent as a BSON array rather than a + // document sequence, so the buffer would never be reused; there we only + // measure the size and leave `buffer` undefined so nothing is retained on + // the batch. + let buffer: Uint8Array | undefined; + let bsonSize: number; + if (this.s.usingAutoEncryption) { + bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + ignoreUndefined: false + } as any); + } else { + const bson = this.s.bsonOptions; + buffer = BSON.serialize(document, { + checkKeys: this.s.checkKeys, + ignoreUndefined: bson.ignoreUndefined, + serializeFunctions: bson.serializeFunctions + }); + bsonSize = buffer.length; + } + + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) + // TODO(NODE-3483): Change this to MongoBSONError + throw new MongoInvalidArgumentError( + `Document is larger than the maximum size ${this.s.maxBsonObjectSize}` + ); + + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + } + + const maxKeySize = this.s.maxKeySize; + + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatchSize + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatchSize > 0 && + this.s.currentBatchSizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType + ) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + + // Create a new batch + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + + // Reset the current size trackers + this.s.currentBatchSize = 0; + this.s.currentBatchSizeBytes = 0; + } + + if (batchType === BatchType.INSERT) { + this.s.bulkResult.insertedIds.push({ + index: this.s.currentIndex, + _id: (document as Document)._id + }); + } + + // We have an array of documents + if (Array.isArray(document)) { + throw new MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentBatch.operations.push(document); + if (buffer != null) this.s.currentBatch.serializedOperations.push(buffer); + this.s.currentBatchSize += 1; + this.s.currentBatchSizeBytes += maxKeySize + bsonSize; + this.s.currentIndex += 1; + return this; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/unordered.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/unordered.ts new file mode 100644 index 00000000..c7183777 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/bulk/unordered.ts @@ -0,0 +1,130 @@ +import type { Document } from '../bson'; +import * as BSON from '../bson'; +import type { Collection } from '../collection'; +import { MongoInvalidArgumentError } from '../error'; +import type { DeleteStatement } from '../operations/delete'; +import type { UpdateStatement } from '../operations/update'; +import { + Batch, + BatchType, + BulkOperationBase, + type BulkWriteOptions, + type BulkWriteResult +} from './common'; + +/** @public */ +export class UnorderedBulkOperation extends BulkOperationBase { + /** @internal */ + constructor(collection: Collection, options: BulkWriteOptions) { + super(collection, options, false); + } + + override handleWriteError(writeResult: BulkWriteResult): void { + if (this.s.batches.length) { + return; + } + + return super.handleWriteError(writeResult); + } + + addToOperationsList( + batchType: BatchType, + document: Document | UpdateStatement | DeleteStatement + ): this { + // Serialize the operation once here and reuse the bytes for both the size + // check/splitting and the wire message (via a DocumentSequence). Under + // auto-encryption the command is sent as a BSON array rather than a + // document sequence, so the buffer would never be reused; there we only + // measure the size and leave `buffer` undefined so nothing is retained on + // the batch. + let buffer: Uint8Array | undefined; + let bsonSize: number; + if (this.s.usingAutoEncryption) { + bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + ignoreUndefined: false + } as any); + } else { + const bson = this.s.bsonOptions; + buffer = BSON.serialize(document, { + checkKeys: this.s.checkKeys, + ignoreUndefined: bson.ignoreUndefined, + serializeFunctions: bson.serializeFunctions + }); + bsonSize = buffer.length; + } + + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) { + // TODO(NODE-3483): Change this to MongoBSONError + throw new MongoInvalidArgumentError( + `Document is larger than the maximum size ${this.s.maxBsonObjectSize}` + ); + } + + // Holds the current batch + this.s.currentBatch = undefined; + // Get the right type of batch + if (batchType === BatchType.INSERT) { + this.s.currentBatch = this.s.currentInsertBatch; + } else if (batchType === BatchType.UPDATE) { + this.s.currentBatch = this.s.currentUpdateBatch; + } else if (batchType === BatchType.DELETE) { + this.s.currentBatch = this.s.currentRemoveBatch; + } + + const maxKeySize = this.s.maxKeySize; + + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + } + + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatch.size + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatch.size > 0 && + this.s.currentBatch.sizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType + ) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + + // Create a new batch + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + } + + // We have an array of documents + if (Array.isArray(document)) { + throw new MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + + this.s.currentBatch.operations.push(document); + if (buffer != null) this.s.currentBatch.serializedOperations.push(buffer); + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentIndex = this.s.currentIndex + 1; + + // Save back the current Batch to the right type + if (batchType === BatchType.INSERT) { + this.s.currentInsertBatch = this.s.currentBatch; + this.s.bulkResult.insertedIds.push({ + index: this.s.bulkResult.insertedIds.length, + _id: (document as Document)._id + }); + } else if (batchType === BatchType.UPDATE) { + this.s.currentUpdateBatch = this.s.currentBatch; + } else if (batchType === BatchType.DELETE) { + this.s.currentRemoveBatch = this.s.currentBatch; + } + + // Update current batch size + this.s.currentBatch.size += 1; + this.s.currentBatch.sizeBytes += maxKeySize + bsonSize; + + return this; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/change_stream.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/change_stream.ts new file mode 100644 index 00000000..189fe3ee --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/change_stream.ts @@ -0,0 +1,1164 @@ +import type { Readable } from 'stream'; + +import type { Binary, Document, Timestamp } from './bson'; +import { Collection } from './collection'; +import { CHANGE, CLOSE, END, ERROR, INIT, MORE, RESPONSE, RESUME_TOKEN_CHANGED } from './constants'; +import { CursorTimeoutContext } from './cursor/abstract_cursor'; +import { ChangeStreamCursor, type ChangeStreamCursorOptions } from './cursor/change_stream_cursor'; +import { Db } from './db'; +import { + type AnyError, + isResumableError, + MongoAPIError, + MongoChangeStreamError, + MongoOperationTimeoutError, + MongoRuntimeError +} from './error'; +import { MongoClient } from './mongo_client'; +import { type InferIdType, TypedEventEmitter } from './mongo_types'; +import type { AggregateOptions } from './operations/aggregate'; +import type { OperationParent } from './operations/command'; +import { DeprioritizedServers } from './sdam/server_selection'; +import type { ServerSessionId } from './sessions'; +import { CSOTTimeoutContext, type TimeoutContext } from './timeout'; +import { type AnyOptions, getTopology, type MongoDBNamespace, squashError } from './utils'; + +const CHANGE_DOMAIN_TYPES = { + COLLECTION: Symbol('Collection'), + DATABASE: Symbol('Database'), + CLUSTER: Symbol('Cluster') +}; + +const CHANGE_STREAM_EVENTS = [RESUME_TOKEN_CHANGED, END, CLOSE] as const; + +const NO_RESUME_TOKEN_ERROR = + 'A change stream document has been received that lacks a resume token (_id).'; +const CHANGESTREAM_CLOSED_ERROR = 'ChangeStream is closed'; + +const INVALID_STAGE_OPTIONS = buildDisallowedChangeStreamOptions(); + +export function filterOutOptions(options: AnyOptions): AnyOptions { + return Object.fromEntries( + Object.entries(options).filter(([k, _]) => !INVALID_STAGE_OPTIONS.has(k)) + ); +} + +/** + * Represents the logical starting point for a new ChangeStream or resuming a ChangeStream on the server. + * @see https://www.mongodb.com/docs/manual/changeStreams/#std-label-change-stream-resume + * @public + */ +export type ResumeToken = unknown; + +/** + * Represents a specific point in time on a server. Can be retrieved by using `db.command()` + * @public + * @see https://www.mongodb.com/docs/manual/reference/method/db.runCommand/#response + */ +export type OperationTime = Timestamp; + +/** + * Options that can be passed to a ChangeStream. Note that startAfter, resumeAfter, and startAtOperationTime are all mutually exclusive, and the server will error if more than one is specified. + * @public + */ +export interface ChangeStreamOptions extends Omit { + /** + * Allowed values: 'updateLookup', 'whenAvailable', 'required'. + * + * When set to 'updateLookup', the change notification for partial updates + * will include both a delta describing the changes to the document as well + * as a copy of the entire document that was changed from some time after + * the change occurred. + * + * When set to 'whenAvailable', configures the change stream to return the + * post-image of the modified document for replace and update change events + * if the post-image for this event is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the post-image is not available. + */ + fullDocument?: string; + + /** + * Allowed values: 'whenAvailable', 'required', 'off'. + * + * The default is to not send a value, which is equivalent to 'off'. + * + * When set to 'whenAvailable', configures the change stream to return the + * pre-image of the modified document for replace, update, and delete change + * events if it is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the pre-image is not available. + */ + fullDocumentBeforeChange?: string; + /** The maximum amount of time for the server to wait on new documents to satisfy a change stream query. */ + maxAwaitTimeMS?: number; + /** + * Allows you to start a changeStream after a specified event. + * @see https://www.mongodb.com/docs/manual/changeStreams/#resumeafter-for-change-streams + */ + resumeAfter?: ResumeToken; + /** + * Similar to resumeAfter, but will allow you to start after an invalidated event. + * @see https://www.mongodb.com/docs/manual/changeStreams/#startafter-for-change-streams + */ + startAfter?: ResumeToken; + /** Will start the changeStream after the specified operationTime. */ + startAtOperationTime?: OperationTime; + /** + * The number of documents to return per batch. + * @see https://www.mongodb.com/docs/manual/reference/command/aggregate + */ + batchSize?: number; + + /** + * When enabled, configures the change stream to include extra change events. + * + * - createIndexes + * - dropIndexes + * - modify + * - create + * - shardCollection + * - reshardCollection + * - refineCollectionShardKey + */ + showExpandedEvents?: boolean; +} + +/** @public */ +export interface ChangeStreamNameSpace { + db: string; + coll: string; +} + +/** @public */ +export interface ChangeStreamDocumentKey { + /** + * For unsharded collections this contains a single field `_id`. + * For sharded collections, this will contain all the components of the shard key + */ + documentKey: { _id: InferIdType; [shardKey: string]: any }; +} + +/** @public */ +export interface ChangeStreamSplitEvent { + /** Which fragment of the change this is. */ + fragment: number; + /** The total number of fragments. */ + of: number; +} + +/** @public */ +export interface ChangeStreamDocumentCommon { + /** + * The id functions as an opaque token for use when resuming an interrupted + * change stream. + */ + _id: ResumeToken; + /** + * The timestamp from the oplog entry associated with the event. + * For events that happened as part of a multi-document transaction, the associated change stream + * notifications will have the same clusterTime value, namely the time when the transaction was committed. + * On a sharded cluster, events that occur on different shards can have the same clusterTime but be + * associated with different transactions or even not be associated with any transaction. + * To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document. + */ + clusterTime?: Timestamp; + + /** + * The transaction number. + * Only present if the operation is part of a multi-document transaction. + * + * **NOTE:** txnNumber can be a Long if promoteLongs is set to false + */ + txnNumber?: number; + + /** + * The identifier for the session associated with the transaction. + * Only present if the operation is part of a multi-document transaction. + */ + lsid?: ServerSessionId; + + /** + * When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent + * stage, events larger than 16MB will be split into multiple events and contain the + * following information about which fragment the current event is. + */ + splitEvent?: ChangeStreamSplitEvent; +} + +/** @public */ +export interface ChangeStreamDocumentWallTime { + /** + * The server date and time of the database operation. + * wallTime differs from clusterTime in that clusterTime is a timestamp taken from the oplog entry associated with the database operation event. + * @sinceServerVersion 6.0.0 + */ + wallTime?: Date; +} + +/** @public */ +export interface ChangeStreamDocumentCollectionUUID { + /** + * The UUID (Binary subtype 4) of the collection that the operation was performed on. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * **NOTE:** collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers + * flag is enabled. + * + * @sinceServerVersion 6.1.0 + */ + collectionUUID: Binary; +} + +/** @public */ +export interface ChangeStreamDocumentOperationDescription { + /** + * An description of the operation. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * @sinceServerVersion 6.1.0 + */ + operationDescription?: Document; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#insert-event + */ +export interface ChangeStreamInsertDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'insert'; + /** This key will contain the document being inserted */ + fullDocument: TSchema; + /** Namespace the insert event occurred on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#update-event + */ +export interface ChangeStreamUpdateDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'update'; + /** + * This is only set if `fullDocument` is set to `'updateLookup'` + * Contains the point-in-time post-image of the modified document if the + * post-image is available and either 'required' or 'whenAvailable' was + * specified for the 'fullDocument' option when creating the change stream. + */ + fullDocument?: TSchema; + /** Contains a description of updated and removed fields in this operation */ + updateDescription: UpdateDescription; + /** Namespace the update event occurred on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#replace-event + */ +export interface ChangeStreamReplaceDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'replace'; + /** The fullDocument of a replace event represents the document after the insert of the replacement document */ + fullDocument: TSchema; + /** Namespace the replace event occurred on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#delete-event + */ +export interface ChangeStreamDeleteDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'delete'; + /** Namespace the delete event occurred on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#drop-event + */ +export interface ChangeStreamDropDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'drop'; + /** Namespace the drop event occurred on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#rename-event + */ +export interface ChangeStreamRenameDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'rename'; + /** The new name for the `ns.coll` collection */ + to: { db: string; coll: string }; + /** The "from" namespace that the rename occurred on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event + */ +export interface ChangeStreamDropDatabaseDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropDatabase'; + /** The database dropped */ + ns: { db: string }; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event + */ +export interface ChangeStreamInvalidateDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'invalidate'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/createIndexes/#mongodb-data-createIndexes + */ +export interface ChangeStreamCreateIndexDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'createIndexes'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/dropIndexes/#mongodb-data-dropIndexes + */ +export interface ChangeStreamDropIndexDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropIndexes'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/modify/#mongodb-data-modify + */ +export interface ChangeStreamCollModDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'modify'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/create/#mongodb-data-create + */ +export interface ChangeStreamCreateDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'create'; + + /** + * The type of the newly created object. + * + * @sinceServerVersion 8.1.0 + */ + nsType?: 'collection' | 'timeseries' | 'view'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/shardCollection/#mongodb-data-shardCollection + */ +export interface ChangeStreamShardCollectionDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription, + ChangeStreamDocumentWallTime { + /** Describes the type of operation represented in this change notification */ + operationType: 'shardCollection'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/reshardCollection/#mongodb-data-reshardCollection + */ +export interface ChangeStreamReshardCollectionDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'reshardCollection'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/refineCollectionShardKey/#mongodb-data-refineCollectionShardKey + */ +export interface ChangeStreamRefineCollectionShardKeyDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'refineCollectionShardKey'; +} + +/** @public */ +export type ChangeStreamDocument = + | ChangeStreamInsertDocument + | ChangeStreamUpdateDocument + | ChangeStreamReplaceDocument + | ChangeStreamDeleteDocument + | ChangeStreamDropDocument + | ChangeStreamRenameDocument + | ChangeStreamDropDatabaseDocument + | ChangeStreamInvalidateDocument + | ChangeStreamCreateIndexDocument + | ChangeStreamCreateDocument + | ChangeStreamCollModDocument + | ChangeStreamDropIndexDocument + | ChangeStreamShardCollectionDocument + | ChangeStreamReshardCollectionDocument + | ChangeStreamRefineCollectionShardKeyDocument; + +/** @public */ +export interface UpdateDescription { + /** + * A document containing key:value pairs of names of the fields that were + * changed, and the new value for those fields. + */ + updatedFields?: Partial; + + /** + * An array of field names that were removed from the document. + */ + removedFields?: string[]; + + /** + * An array of documents which record array truncations performed with pipeline-based updates using one or more of the following stages: + * - $addFields + * - $set + * - $replaceRoot + * - $replaceWith + */ + truncatedArrays?: Array<{ + /** The name of the truncated field. */ + field: string; + /** The number of elements in the truncated array. */ + newSize: number; + }>; + + /** + * A document containing additional information about any ambiguous update paths from the update event. The document + * maps the full ambiguous update path to an array containing the actual resolved components of the path. For example, + * given a document shaped like `{ a: { '0': 0 } }`, and an update of `{ $inc: 'a.0' }`, disambiguated paths would look like + * the following: + * + * ``` + * { + * 'a.0': ['a', '0'] + * } + * ``` + * + * This field is only present when there are ambiguous paths that are updated as a part of the update event. + * + * On \<8.2.0 servers, this field is only present when `showExpandedEvents` is set to true. + * is enabled for the change stream. + * + * On 8.2.0+ servers, this field is present for update events regardless of whether `showExpandedEvents` is enabled. + * @sinceServerVersion 6.1.0 + */ + disambiguatedPaths?: Document; +} + +/** @public */ +export type ChangeStreamEvents< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument +> = { + resumeTokenChanged(token: ResumeToken): void; + init(response: any): void; + more(response?: any): void; + response(): void; + end(): void; + error(error: Error): void; + change(change: TChange): void; + /** + * @remarks Note that the `close` event is currently emitted whenever the internal `ChangeStreamCursor` + * instance is closed, which can occur multiple times for a given `ChangeStream` instance. + * + * TODO(NODE-6434): address this issue in NODE-6434 + */ + close(): void; +}; + +/** + * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}. + * @public + */ +export class ChangeStream< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument + > + extends TypedEventEmitter> + implements AsyncDisposable +{ + /** + * An alias for {@link ChangeStream.close|ChangeStream.close()}. + */ + async [Symbol.asyncDispose]() { + await this.close(); + } + + pipeline: Document[]; + /** + * @remarks WriteConcern can still be present on the options because + * we inherit options from the client/db/collection. The + * key must be present on the options in order to delete it. + * This allows typescript to delete the key but will + * not allow a writeConcern to be assigned as a property on options. + */ + options: ChangeStreamOptions & { writeConcern?: never }; + parent: MongoClient | Db | Collection; + namespace: MongoDBNamespace; + type: symbol; + /** @internal */ + private cursor: ChangeStreamCursor; + /** @internal */ + private cursorStream?: Readable & AsyncIterable; + /** @internal */ + private isClosed: boolean; + /** @internal */ + private mode: false | 'iterator' | 'emitter'; + + /** @event */ + static readonly RESPONSE = RESPONSE; + /** @event */ + static readonly MORE = MORE; + /** @event */ + static readonly INIT = INIT; + /** @event */ + static readonly CLOSE = CLOSE; + /** + * Fired for each new matching change in the specified namespace. Attaching a `change` + * event listener to a Change Stream will switch the stream into flowing mode. Data will + * then be passed as soon as it is available. + * @event + */ + static readonly CHANGE = CHANGE; + /** @event */ + static readonly END = END; + /** @event */ + static readonly ERROR = ERROR; + /** + * Emitted each time the change stream stores a new resume token. + * @event + */ + static readonly RESUME_TOKEN_CHANGED = RESUME_TOKEN_CHANGED; + + private timeoutContext?: TimeoutContext; + /** + * Note that this property is here to uniquely identify a ChangeStream instance as the owner of + * the {@link CursorTimeoutContext} instance (see {@link ChangeStream._createChangeStreamCursor}) to ensure + * that {@link AbstractCursor.close} does not mutate the timeoutContext. + */ + private contextOwner: symbol; + /** + * @internal + * + * @param parent - The parent object that created this change stream + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents + */ + constructor( + parent: OperationParent, + pipeline: Document[] = [], + options: ChangeStreamOptions = {} + ) { + super(); + + this.pipeline = pipeline; + this.options = { ...options }; + let serverSelectionTimeoutMS: number; + delete this.options.writeConcern; + + if (parent instanceof Collection) { + this.type = CHANGE_DOMAIN_TYPES.COLLECTION; + serverSelectionTimeoutMS = parent.s.db.client.options.serverSelectionTimeoutMS; + } else if (parent instanceof Db) { + this.type = CHANGE_DOMAIN_TYPES.DATABASE; + serverSelectionTimeoutMS = parent.client.options.serverSelectionTimeoutMS; + } else if (parent instanceof MongoClient) { + this.type = CHANGE_DOMAIN_TYPES.CLUSTER; + serverSelectionTimeoutMS = parent.options.serverSelectionTimeoutMS; + } else { + throw new MongoChangeStreamError( + 'Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient' + ); + } + + this.contextOwner = Symbol(); + this.parent = parent; + this.namespace = parent.s.namespace; + if (!this.options.readPreference && parent.readPreference) { + this.options.readPreference = parent.readPreference; + } + + // Create contained Change Stream cursor + this.cursor = this._createChangeStreamCursor(options); + + this.isClosed = false; + this.mode = false; + + // Listen for any `change` listeners being added to ChangeStream + this.on('newListener', eventName => { + if (eventName === 'change' && this.cursor && this.listenerCount('change') === 0) { + this._streamEvents(this.cursor); + } + }); + + this.on('removeListener', eventName => { + if (eventName === 'change' && this.listenerCount('change') === 0 && this.cursor) { + this.cursorStream?.removeAllListeners('data'); + } + }); + + if (this.options.timeoutMS != null) { + this.timeoutContext = new CSOTTimeoutContext({ + timeoutMS: this.options.timeoutMS, + serverSelectionTimeoutMS + }); + } + } + + /** The cached resume token that is used to resume after the most recently returned change. */ + get resumeToken(): ResumeToken { + return this.cursor?.resumeToken; + } + + /** Returns the currently buffered documents length of the underlying cursor. */ + bufferedCount(): number { + return this.cursor?.bufferedCount() ?? 0; + } + + /** Check if there is any document still available in the Change Stream */ + async hasNext(): Promise { + this._setIsIterator(); + // Change streams must resume indefinitely while each resume event succeeds. + // This loop continues until either a change event is received or until a resume attempt + // fails. + + this.timeoutContext?.refresh(); + try { + while (true) { + try { + const hasNext = await this.cursor.hasNext(); + return hasNext; + } catch (error) { + try { + await this._processErrorIteratorMode(error, this.cursor.id != null); + } catch (error) { + if (error instanceof MongoOperationTimeoutError && this.cursor.id == null) { + throw error; + } + try { + await this.close(); + } catch (error) { + squashError(error); + } + throw error; + } + } + } + } finally { + this.timeoutContext?.clear(); + } + } + + /** Get the next available document from the Change Stream. */ + async next(): Promise { + this._setIsIterator(); + // Change streams must resume indefinitely while each resume event succeeds. + // This loop continues until either a change event is received or until a resume attempt + // fails. + this.timeoutContext?.refresh(); + + try { + while (true) { + try { + const change = await this.cursor.next(); + const processedChange = this._processChange(change ?? null); + return processedChange; + } catch (error) { + try { + await this._processErrorIteratorMode(error, this.cursor.id != null); + } catch (error) { + if (error instanceof MongoOperationTimeoutError && this.cursor.id == null) { + throw error; + } + try { + await this.close(); + } catch (error) { + squashError(error); + } + throw error; + } + } + } + } finally { + this.timeoutContext?.clear(); + } + } + + /** + * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned + */ + async tryNext(): Promise { + this._setIsIterator(); + // Change streams must resume indefinitely while each resume event succeeds. + // This loop continues until either a change event is received or until a resume attempt + // fails. + this.timeoutContext?.refresh(); + + try { + while (true) { + try { + const change = await this.cursor.tryNext(); + if (!change) { + return null; + } + const processedChange = this._processChange(change); + return processedChange; + } catch (error) { + try { + await this._processErrorIteratorMode(error, this.cursor.id != null); + } catch (error) { + if (error instanceof MongoOperationTimeoutError && this.cursor.id == null) throw error; + try { + await this.close(); + } catch (error) { + squashError(error); + } + throw error; + } + } + } + } finally { + this.timeoutContext?.clear(); + } + } + + async *[Symbol.asyncIterator](): AsyncGenerator { + if (this.closed) { + return; + } + + try { + // Change streams run indefinitely as long as errors are resumable + // So the only loop breaking condition is if `next()` throws + while (true) { + yield await this.next(); + } + } finally { + try { + await this.close(); + } catch (error) { + squashError(error); + } + } + } + + /** Is the cursor closed */ + public get closed(): boolean { + return this.isClosed || this.cursor.closed; + } + + /** + * Frees the internal resources used by the change stream. + */ + async close(): Promise { + this.timeoutContext?.clear(); + this.timeoutContext = undefined; + this.isClosed = true; + + const cursor = this.cursor; + try { + await cursor.close(); + } finally { + this._endStream(); + } + } + + /** + * Return a modified Readable stream including a possible transform method. + * + * NOTE: When using a Stream to process change stream events, the stream will + * NOT automatically resume in the case a resumable error is encountered. + * + * @throws MongoChangeStreamError if the underlying cursor or the change stream is closed + */ + stream(): Readable & AsyncIterable { + if (this.closed) { + throw new MongoChangeStreamError(CHANGESTREAM_CLOSED_ERROR); + } + + return this.cursor.stream(); + } + + /** @internal */ + private _setIsEmitter(): void { + if (this.mode === 'iterator') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new MongoAPIError( + 'ChangeStream cannot be used as an EventEmitter after being used as an iterator' + ); + } + this.mode = 'emitter'; + } + + /** @internal */ + private _setIsIterator(): void { + if (this.mode === 'emitter') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new MongoAPIError( + 'ChangeStream cannot be used as an iterator after being used as an EventEmitter' + ); + } + this.mode = 'iterator'; + } + + /** + * Create a new change stream cursor based on self's configuration + * @internal + */ + private _createChangeStreamCursor( + options: ChangeStreamOptions | ChangeStreamCursorOptions + ): ChangeStreamCursor { + const changeStreamStageOptions: Document = filterOutOptions(options); + if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) { + changeStreamStageOptions.allChangesForCluster = true; + } + const pipeline = [{ $changeStream: changeStreamStageOptions }, ...this.pipeline]; + + const client: MongoClient | null = + this.type === CHANGE_DOMAIN_TYPES.CLUSTER + ? (this.parent as MongoClient) + : this.type === CHANGE_DOMAIN_TYPES.DATABASE + ? (this.parent as Db).client + : this.type === CHANGE_DOMAIN_TYPES.COLLECTION + ? (this.parent as Collection).client + : null; + + if (client == null) { + // This should never happen because of the assertion in the constructor + throw new MongoRuntimeError( + `Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}` + ); + } + + const changeStreamCursor = new ChangeStreamCursor( + client, + this.namespace, + pipeline, + { + ...options, + timeoutContext: this.timeoutContext + ? new CursorTimeoutContext(this.timeoutContext, this.contextOwner) + : undefined + } + ); + + for (const event of CHANGE_STREAM_EVENTS) { + changeStreamCursor.on(event, e => this.emit(event, e)); + } + + if (this.listenerCount(ChangeStream.CHANGE) > 0) { + this._streamEvents(changeStreamCursor); + } + + return changeStreamCursor; + } + + /** @internal */ + private _closeEmitterModeWithError(error: AnyError): void { + this.emit(ChangeStream.ERROR, error); + + this.close().then(undefined, squashError); + } + + /** @internal */ + private _streamEvents(cursor: ChangeStreamCursor): void { + this._setIsEmitter(); + const stream = this.cursorStream ?? cursor.stream(); + this.cursorStream = stream; + stream.on('data', change => { + try { + const processedChange = this._processChange(change); + this.emit(ChangeStream.CHANGE, processedChange); + } catch (error) { + this.emit(ChangeStream.ERROR, error); + } + this.timeoutContext?.refresh(); + }); + stream.on('error', error => this._processErrorStreamMode(error, this.cursor.id != null)); + } + + /** @internal */ + private _endStream(): void { + this.cursorStream?.removeAllListeners('data'); + this.cursorStream?.removeAllListeners('close'); + this.cursorStream?.removeAllListeners('end'); + this.cursorStream?.destroy(); + this.cursorStream = undefined; + } + + /** @internal */ + private _processChange(change: TChange | null): TChange { + if (this.isClosed) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + throw new MongoAPIError(CHANGESTREAM_CLOSED_ERROR); + } + + // a null change means the cursor has been notified, implicitly closing the change stream + if (change == null) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + throw new MongoRuntimeError(CHANGESTREAM_CLOSED_ERROR); + } + + if (change && !change._id) { + throw new MongoChangeStreamError(NO_RESUME_TOKEN_ERROR); + } + + // cache the resume token + this.cursor.cacheResumeToken(change._id); + + // wipe the startAtOperationTime if there was one so that there won't be a conflict + // between resumeToken and startAtOperationTime if we need to reconnect the cursor + this.options.startAtOperationTime = undefined; + + return change; + } + + /** @internal */ + private _processErrorStreamMode(changeStreamError: AnyError, cursorInitialized: boolean) { + // If the change stream has been closed explicitly, do not process error. + if (this.isClosed) return; + + if ( + cursorInitialized && + (isResumableError(changeStreamError, this.cursor.maxWireVersion) || + changeStreamError instanceof MongoOperationTimeoutError) + ) { + this._endStream(); + + this.cursor + .close() + .then( + () => this._resume(changeStreamError), + e => { + squashError(e); + return this._resume(changeStreamError); + } + ) + .then( + () => { + if (changeStreamError instanceof MongoOperationTimeoutError) + this.emit(ChangeStream.ERROR, changeStreamError); + }, + () => this._closeEmitterModeWithError(changeStreamError) + ); + } else { + this._closeEmitterModeWithError(changeStreamError); + } + } + + /** @internal */ + private async _processErrorIteratorMode(changeStreamError: AnyError, cursorInitialized: boolean) { + if (this.isClosed) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + throw new MongoAPIError(CHANGESTREAM_CLOSED_ERROR); + } + + if ( + cursorInitialized && + (isResumableError(changeStreamError, this.cursor.maxWireVersion) || + changeStreamError instanceof MongoOperationTimeoutError) + ) { + try { + await this.cursor.close(); + } catch (error) { + squashError(error); + } + + await this._resume(changeStreamError); + + if (changeStreamError instanceof MongoOperationTimeoutError) throw changeStreamError; + } else { + try { + await this.close(); + } catch (error) { + squashError(error); + } + + throw changeStreamError; + } + } + + private async _resume(changeStreamError: AnyError) { + this.timeoutContext?.refresh(); + const topology = getTopology(this.parent); + try { + await topology.selectServer(this.cursor.readPreference, { + operationName: 'reconnect topology in change stream', + timeoutContext: this.timeoutContext, + deprioritizedServers: new DeprioritizedServers() + }); + this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions); + } catch { + // if the topology can't reconnect, close the stream + await this.close(); + throw changeStreamError; + } + } +} + +/** + * This function returns a list of options that are *not* supported by the $changeStream + * aggregation stage. This is best-effort - it uses the options "officially supported" by the driver + * to derive a list of known, unsupported options for the $changeStream stage. + * + * Notably, at runtime, users can still provide options unknown to the driver and the driver will + * *not* filter them out of the options object (see NODE-5510). + */ +function buildDisallowedChangeStreamOptions(): Set { + /** hard-coded list of allowed ChangeStream options */ + type CSOptions = + | 'resumeAfter' + | 'startAfter' + | 'startAtOperationTime' + | 'fullDocument' + | 'fullDocumentBeforeChange' + | 'showExpandedEvents'; + + /** + * a type representing all known options that the driver supports that are *not* change stream stage options. + * + * each known key is mapped to a non-optional string, so that if new driver-specific options are added, the + * instantiation of `denyList` below results in a TS error. + */ + type DisallowedOptions = { + [k in Exclude< + keyof ChangeStreamOptions & { timeoutContext: TimeoutContext }, + CSOptions + >]: string; + }; + + const denyList: DisallowedOptions = { + allowDiskUse: '', + authdb: '', + batchSize: '', + bsonRegExp: '', + bypassDocumentValidation: '', + bypassPinningCheck: '', + checkKeys: '', + collation: '', + comment: '', + cursor: '', + dbName: '', + enableUtf8Validation: '', + explain: '', + fieldsAsRaw: '', + hint: '', + ignoreUndefined: '', + let: '', + maxAwaitTimeMS: '', + maxTimeMS: '', + omitMaxTimeMS: '', + out: '', + promoteBuffers: '', + promoteLongs: '', + promoteValues: '', + raw: '', + rawData: '', + readConcern: '', + readPreference: '', + serializeFunctions: '', + session: '', + timeoutContext: '', + timeoutMS: '', + timeoutMode: '', + useBigInt64: '', + willRetryWrite: '', + writeConcern: '' + }; + + return new Set(Object.keys(denyList)); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/auto_encrypter.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/auto_encrypter.ts new file mode 100644 index 00000000..d10bd6ba --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/auto_encrypter.ts @@ -0,0 +1,491 @@ +import { type MongoCrypt, type MongoCryptOptions } from 'mongodb-client-encryption'; +import * as net from 'net'; + +import { ByteUtils, deserialize, type Document, serialize } from '../bson'; +import { type CommandOptions, type ProxyOptions } from '../cmap/connection'; +import { kDecorateResult } from '../constants'; +import { getMongoDBClientEncryption } from '../deps'; +import { MongoRuntimeError } from '../error'; +import { MongoClient, type MongoClientOptions } from '../mongo_client'; +import { type Abortable } from '../mongo_types'; +import { MongoDBCollectionNamespace } from '../utils'; +import { autoSelectSocketOptions } from './client_encryption'; +import { defaultErrorWrapper, MongoCryptInvalidArgumentError } from './errors'; +import { type CSFLEKMSTlsOptions, type KMSConnectCallback } from './kms_options'; +import { MongocryptdManager } from './mongocryptd_manager'; +import { + type CredentialProviders, + isEmptyCredentials, + type KMSProviders, + refreshKMSCredentials +} from './providers'; +import { StateMachine } from './state_machine'; + +/** @public */ +export interface AutoEncryptionOptions { + /** @internal client for metadata lookups */ + metadataClient?: MongoClient; + /** A `MongoClient` used to fetch keys from a key vault */ + keyVaultClient?: MongoClient; + /** The namespace where keys are stored in the key vault */ + keyVaultNamespace?: string; + /** Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. */ + kmsProviders?: KMSProviders; + /** Configuration options for custom credential providers. */ + credentialProviders?: CredentialProviders; + /** + * A map of namespaces to a local JSON schema for encryption + * + * **NOTE**: Supplying options.schemaMap provides more security than relying on JSON Schemas obtained from the server. + * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending decrypted data that should be encrypted. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption. + * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. + */ + schemaMap?: Document; + /** Supply a schema for the encrypted fields in the document */ + encryptedFieldsMap?: Document; + /** Allows the user to bypass auto encryption, maintaining implicit decryption */ + bypassAutoEncryption?: boolean; + /** Allows users to bypass query analysis */ + bypassQueryAnalysis?: boolean; + /** + * Sets the expiration time for the DEK in the cache in milliseconds. Defaults to 60000. 0 means no timeout. + */ + keyExpirationMS?: number; + options?: { + /** An optional hook to catch logging messages from the underlying encryption engine */ + logger?: (level: AutoEncryptionLoggerLevel, message: string) => void; + }; + extraOptions?: { + /** + * A local process the driver communicates with to determine how to encrypt values in a command. + * Defaults to "mongodb://%2Fvar%2Fmongocryptd.sock" if domain sockets are available or "mongodb://localhost:27020" otherwise + */ + mongocryptdURI?: string; + /** If true, autoEncryption will not attempt to spawn a mongocryptd before connecting */ + mongocryptdBypassSpawn?: boolean; + /** The path to the mongocryptd executable on the system */ + mongocryptdSpawnPath?: `${string}mongocryptd${'.exe' | ''}`; + /** Command line arguments to use when auto-spawning a mongocryptd */ + mongocryptdSpawnArgs?: string[]; + /** + * Full path to a MongoDB Crypt shared library to be used (instead of mongocryptd). + * + * This needs to be the path to the file itself, not a directory. + * It can be an absolute or relative path. If the path is relative and + * its first component is `$ORIGIN`, it will be replaced by the directory + * containing the mongodb-client-encryption native addon file. Otherwise, + * the path will be interpreted relative to the current working directory. + * + * Currently, loading different MongoDB Crypt shared library files from different + * MongoClients in the same process is not supported. + * + * If this option is provided and no MongoDB Crypt shared library could be loaded + * from the specified location, creating the MongoClient will fail. + * + * If this option is not provided and `cryptSharedLibRequired` is not specified, + * the AutoEncrypter will attempt to spawn and/or use mongocryptd according + * to the mongocryptd-specific `extraOptions` options. + * + * Specifying a path prevents mongocryptd from being used as a fallback. + * + * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibPath?: `${string}mongo_crypt_v${number}.${'so' | 'dll' | 'dylib'}`; + /** + * If specified, never use mongocryptd and instead fail when the MongoDB Crypt + * shared library could not be loaded. + * + * This is always true when `cryptSharedLibPath` is specified. + * + * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibRequired?: boolean; + /** + * Search paths for a MongoDB Crypt shared library to be used (instead of mongocryptd) + * Only for driver testing! + * @internal + */ + cryptSharedLibSearchPaths?: string[]; + }; + proxyOptions?: ProxyOptions; + /** The TLS options to use connecting to the KMS provider */ + tlsOptions?: CSFLEKMSTlsOptions; + /** + * A callback that establishes the socket used to connect to a KMS host, e.g. to route KMS + * requests through an HTTP proxy via the HTTP CONNECT method. Mutually exclusive with `proxyOptions`. + * See {@link KMSConnectCallback} for a usage example. + */ + kmsConnectCallback?: KMSConnectCallback; +} + +/** + * @public + * + * Extra options related to the mongocryptd process + * \* _Available in MongoDB 6.0 or higher._ + */ +export type AutoEncryptionExtraOptions = NonNullable; + +/** @public */ +export const AutoEncryptionLoggerLevel = Object.freeze({ + FatalError: 0, + Error: 1, + Warning: 2, + Info: 3, + Trace: 4 +} as const); + +/** + * @public + * The level of severity of the log message + * + * | Value | Level | + * |-------|-------| + * | 0 | Fatal Error | + * | 1 | Error | + * | 2 | Warning | + * | 3 | Info | + * | 4 | Trace | + */ +export type AutoEncryptionLoggerLevel = + (typeof AutoEncryptionLoggerLevel)[keyof typeof AutoEncryptionLoggerLevel]; + +/** + * @internal An internal class to be used by the driver for auto encryption + * **NOTE**: Not meant to be instantiated directly, this is for internal use only. + */ +export class AutoEncrypter { + _client: MongoClient; + _bypassEncryption: boolean; + _keyVaultNamespace: string; + _keyVaultClient: MongoClient; + _metaDataClient: MongoClient; + _proxyOptions: ProxyOptions; + _tlsOptions: CSFLEKMSTlsOptions; + _kmsConnectCallback?: KMSConnectCallback; + _kmsProviders: KMSProviders; + _bypassMongocryptdAndCryptShared: boolean; + _contextCounter: number; + _credentialProviders?: CredentialProviders; + + _mongocryptdManager?: MongocryptdManager; + _mongocryptdClient?: MongoClient; + + /** @internal */ + _mongocrypt: MongoCrypt; + + /** + * Used by devtools to enable decorating decryption results. + * + * When set and enabled, `decrypt` will automatically recursively + * traverse a decrypted document and if a field has been decrypted, + * it will mark it as decrypted. Compass uses this to determine which + * fields were decrypted. + */ + [kDecorateResult] = false; + + /** @internal */ + static getMongoCrypt(): typeof MongoCrypt { + const encryption = getMongoDBClientEncryption(); + if ('kModuleError' in encryption) { + throw encryption.kModuleError; + } + return encryption.MongoCrypt; + } + + /** + * Create an AutoEncrypter + * + * **Note**: Do not instantiate this class directly. Rather, supply the relevant options to a MongoClient + * + * **Note**: Supplying `options.schemaMap` provides more security than relying on JSON Schemas obtained from the server. + * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending unencrypted data that should be encrypted. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption. + * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. + * + * @example Create an AutoEncrypter that makes use of mongocryptd + * ```ts + * // Enabling autoEncryption via a MongoClient using mongocryptd + * const { MongoClient } = require('mongodb'); + * const client = new MongoClient(URL, { + * autoEncryption: { + * kmsProviders: { + * aws: { + * accessKeyId: AWS_ACCESS_KEY, + * secretAccessKey: AWS_SECRET_KEY + * } + * } + * } + * }); + * ``` + * + * await client.connect(); + * // From here on, the client will be encrypting / decrypting automatically + * @example Create an AutoEncrypter that makes use of libmongocrypt's CSFLE shared library + * ```ts + * // Enabling autoEncryption via a MongoClient using CSFLE shared library + * const { MongoClient } = require('mongodb'); + * const client = new MongoClient(URL, { + * autoEncryption: { + * kmsProviders: { + * aws: {} + * }, + * extraOptions: { + * cryptSharedLibPath: '/path/to/local/crypt/shared/lib', + * cryptSharedLibRequired: true + * } + * } + * }); + * ``` + * + * await client.connect(); + * // From here on, the client will be encrypting / decrypting automatically + */ + constructor(client: MongoClient, options: AutoEncryptionOptions) { + this._client = client; + this._bypassEncryption = options.bypassAutoEncryption === true; + + this._keyVaultNamespace = options.keyVaultNamespace || 'admin.datakeys'; + this._keyVaultClient = options.keyVaultClient || client; + this._metaDataClient = options.metadataClient || client; + this._proxyOptions = options.proxyOptions || {}; + if (this._proxyOptions.proxyHost && options.kmsConnectCallback) { + throw new MongoCryptInvalidArgumentError( + 'Cannot set both proxyOptions and kmsConnectCallback' + ); + } + this._tlsOptions = options.tlsOptions || {}; + this._kmsConnectCallback = options.kmsConnectCallback; + this._kmsProviders = options.kmsProviders || {}; + this._credentialProviders = options.credentialProviders; + + if (options.credentialProviders?.aws && !isEmptyCredentials('aws', this._kmsProviders)) { + throw new MongoCryptInvalidArgumentError( + 'Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching' + ); + } + + const mongoCryptOptions: MongoCryptOptions = { + errorWrapper: defaultErrorWrapper + }; + if (options.schemaMap) { + if (ByteUtils.isUint8Array(options.schemaMap)) { + mongoCryptOptions.schemaMap = options.schemaMap; + } else { + mongoCryptOptions.schemaMap = serialize(options.schemaMap); + } + } + + if (options.encryptedFieldsMap) { + if (ByteUtils.isUint8Array(options.encryptedFieldsMap)) { + mongoCryptOptions.encryptedFieldsMap = options.encryptedFieldsMap; + } else { + mongoCryptOptions.encryptedFieldsMap = serialize(options.encryptedFieldsMap); + } + } + + if (ByteUtils.isUint8Array(this._kmsProviders)) { + mongoCryptOptions.kmsProviders = this._kmsProviders; + } else { + mongoCryptOptions.kmsProviders = serialize(this._kmsProviders); + } + + if (options.options?.logger) { + mongoCryptOptions.logger = options.options.logger; + } + + if (options.extraOptions && options.extraOptions.cryptSharedLibPath) { + mongoCryptOptions.cryptSharedLibPath = options.extraOptions.cryptSharedLibPath; + } + + if (options.bypassQueryAnalysis) { + mongoCryptOptions.bypassQueryAnalysis = options.bypassQueryAnalysis; + } + + if (options.keyExpirationMS != null) { + mongoCryptOptions.keyExpirationMS = options.keyExpirationMS; + } + + this._bypassMongocryptdAndCryptShared = this._bypassEncryption || !!options.bypassQueryAnalysis; + + if (options.extraOptions && options.extraOptions.cryptSharedLibSearchPaths) { + // Only for driver testing + mongoCryptOptions.cryptSharedLibSearchPaths = options.extraOptions.cryptSharedLibSearchPaths; + } else if (!this._bypassMongocryptdAndCryptShared) { + mongoCryptOptions.cryptSharedLibSearchPaths = ['$SYSTEM']; + } + + const MongoCrypt = AutoEncrypter.getMongoCrypt(); + this._mongocrypt = new MongoCrypt(mongoCryptOptions); + this._contextCounter = 0; + + if ( + options.extraOptions && + options.extraOptions.cryptSharedLibRequired && + !this.cryptSharedLibVersionInfo + ) { + throw new MongoCryptInvalidArgumentError( + '`cryptSharedLibRequired` set but no crypt_shared library loaded' + ); + } + + // Only instantiate mongocryptd manager/client once we know for sure + // that we are not using the CSFLE shared library. + if (!this._bypassMongocryptdAndCryptShared && !this.cryptSharedLibVersionInfo) { + this._mongocryptdManager = new MongocryptdManager(options.extraOptions); + const clientOptions: MongoClientOptions = { + serverSelectionTimeoutMS: 10000 + }; + + if ( + (options.extraOptions == null || typeof options.extraOptions.mongocryptdURI !== 'string') && + !net.getDefaultAutoSelectFamily + ) { + // Only set family if autoSelectFamily options are not supported. + clientOptions.family = 4; + } + + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore: TS complains as this always returns true on versions where it is present. + if (net.getDefaultAutoSelectFamily) { + // AutoEncrypter is made inside of MongoClient constructor while options are being parsed, + // we do not have access to the options that are in progress. + // TODO(NODE-6449): AutoEncrypter does not use client options for autoSelectFamily + Object.assign(clientOptions, autoSelectSocketOptions(this._client.s?.options ?? {})); + } + + this._mongocryptdClient = new MongoClient(this._mongocryptdManager.uri, clientOptions); + } + } + + /** + * Initializes the auto encrypter by spawning a mongocryptd and connecting to it. + * + * This function is a no-op when bypassSpawn is set or the crypt shared library is used. + */ + async init(): Promise { + if (this._bypassMongocryptdAndCryptShared || this.cryptSharedLibVersionInfo) { + return; + } + if (!this._mongocryptdManager) { + throw new MongoRuntimeError( + 'Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.' + ); + } + if (!this._mongocryptdClient) { + throw new MongoRuntimeError( + 'Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.' + ); + } + + if (!this._mongocryptdManager.bypassSpawn) { + await this._mongocryptdManager.spawn(); + } + + try { + const client = await this._mongocryptdClient.connect(); + return client; + } catch (error) { + throw new MongoRuntimeError( + 'Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn', + { cause: error } + ); + } + } + + /** + * Cleans up the `_mongocryptdClient`, if present. + */ + async close(): Promise { + await this._mongocryptdClient?.close(); + } + + /** + * Encrypt a command for a given namespace. + */ + async encrypt( + ns: string, + cmd: Document, + options: CommandOptions & Abortable = {} + ): Promise { + options.signal?.throwIfAborted(); + + if (this._bypassEncryption) { + // If `bypassAutoEncryption` has been specified, don't encrypt + return cmd; + } + + const commandBuffer: Uint8Array = serialize(cmd, options); + const context = this._mongocrypt.makeEncryptionContext( + MongoDBCollectionNamespace.fromString(ns).db, + commandBuffer + ); + + context.id = this._contextCounter++; + context.ns = ns; + context.document = cmd; + + const stateMachine = new StateMachine({ + promoteValues: false, + promoteLongs: false, + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + + return deserialize(await stateMachine.execute(this, context, options), { + promoteValues: false, + promoteLongs: false + }); + } + + /** + * Decrypt a command response + */ + async decrypt( + response: Uint8Array, + options: CommandOptions & Abortable = {} + ): Promise { + options.signal?.throwIfAborted(); + + const context = this._mongocrypt.makeDecryptionContext(response); + + context.id = this._contextCounter++; + + const stateMachine = new StateMachine({ + ...options, + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + + return await stateMachine.execute(this, context, options); + } + + /** + * Ask the user for KMS credentials. + * + * This returns anything that looks like the kmsProviders original input + * option. It can be empty, and any provider specified here will override + * the original ones. + */ + async askForKMSCredentials(): Promise { + return await refreshKMSCredentials(this._kmsProviders, this._credentialProviders); + } + + /** + * Return the current libmongocrypt's CSFLE shared library version + * as `{ version: bigint, versionStr: string }`, or `null` if no CSFLE + * shared library was loaded. + */ + get cryptSharedLibVersionInfo(): { version: bigint; versionStr: string } | null { + return this._mongocrypt.cryptSharedLibVersionInfo; + } + + static get libmongocryptVersion(): string { + return AutoEncrypter.getMongoCrypt().libmongocryptVersion; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/client_encryption.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/client_encryption.ts new file mode 100644 index 00000000..10058969 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/client_encryption.ts @@ -0,0 +1,1198 @@ +import type { + ExplicitEncryptionContextOptions, + MongoCrypt, + MongoCryptOptions +} from 'mongodb-client-encryption'; + +import { + type Binary, + deserialize, + type Document, + type Int32, + type Long, + serialize, + type UUID +} from '../bson'; +import { type AnyBulkWriteOperation, type BulkWriteResult } from '../bulk/common'; +import { type ProxyOptions } from '../cmap/connection'; +import { type Collection } from '../collection'; +import { type FindCursor } from '../cursor/find_cursor'; +import { type Db } from '../db'; +import { getMongoDBClientEncryption } from '../deps'; +import { type MongoClient, type MongoClientOptions } from '../mongo_client'; +import { type Filter, type WithId } from '../mongo_types'; +import { type CreateCollectionOptions } from '../operations/create_collection'; +import { type DeleteResult } from '../operations/delete'; +import { type CSOTTimeoutContext, TimeoutContext } from '../timeout'; +import { MongoDBCollectionNamespace, resolveTimeoutOptions } from '../utils'; +import { + defaultErrorWrapper, + MongoCryptCreateDataKeyError, + MongoCryptCreateEncryptedCollectionError, + MongoCryptInvalidArgumentError +} from './errors'; +import { + type ClientEncryptionSocketOptions, + type CSFLEKMSTlsOptions, + type KMSConnectCallback +} from './kms_options'; +import { + type ClientEncryptionDataKeyProvider, + type CredentialProviders, + isEmptyCredentials, + type KMSProviders, + refreshKMSCredentials +} from './providers/index'; +import { StateMachine } from './state_machine'; + +/** + * @public + * The schema for a DataKey in the key vault collection. + */ +export interface DataKey { + _id: UUID; + version?: number; + keyAltNames?: string[]; + keyMaterial: Binary; + creationDate: Date; + updateDate: Date; + status: number; + masterKey: Document; +} + +/** + * @public + * The public interface for explicit in-use encryption + */ +export class ClientEncryption { + /** @internal */ + _client: MongoClient; + /** @internal */ + _keyVaultNamespace: string; + /** @internal */ + _keyVaultClient: MongoClient; + /** @internal */ + _proxyOptions: ProxyOptions; + /** @internal */ + _tlsOptions: CSFLEKMSTlsOptions; + /** @internal */ + _kmsConnectCallback?: KMSConnectCallback; + /** @internal */ + _kmsProviders: KMSProviders; + /** @internal */ + _timeoutMS?: number; + + /** @internal */ + _mongoCrypt: MongoCrypt; + + /** @internal */ + _credentialProviders?: CredentialProviders; + + /** @internal */ + static getMongoCrypt(): typeof MongoCrypt { + const encryption = getMongoDBClientEncryption(); + if ('kModuleError' in encryption) { + throw encryption.kModuleError; + } + return encryption.MongoCrypt; + } + + /** + * Create a new encryption instance + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * local: { + * key: masterKey // The master key used for encryption/decryption. A 96-byte long Buffer + * } + * } + * }); + * ``` + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * aws: { + * accessKeyId: AWS_ACCESS_KEY, + * secretAccessKey: AWS_SECRET_KEY + * } + * } + * }); + * ``` + */ + constructor(client: MongoClient, options: ClientEncryptionOptions) { + this._client = client; + this._proxyOptions = options.proxyOptions ?? {}; + if (this._proxyOptions.proxyHost && options.kmsConnectCallback) { + throw new MongoCryptInvalidArgumentError( + 'Cannot set both proxyOptions and kmsConnectCallback' + ); + } + this._tlsOptions = options.tlsOptions ?? {}; + this._kmsConnectCallback = options.kmsConnectCallback; + this._kmsProviders = options.kmsProviders || {}; + const { timeoutMS } = resolveTimeoutOptions(client, options); + this._timeoutMS = timeoutMS; + this._credentialProviders = options.credentialProviders; + + if (options.credentialProviders?.aws && !isEmptyCredentials('aws', this._kmsProviders)) { + throw new MongoCryptInvalidArgumentError( + 'Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching' + ); + } + + if (options.keyVaultNamespace == null) { + throw new MongoCryptInvalidArgumentError('Missing required option `keyVaultNamespace`'); + } + + const mongoCryptOptions: MongoCryptOptions = { + ...options, + kmsProviders: serialize(this._kmsProviders), + errorWrapper: defaultErrorWrapper + }; + + this._keyVaultNamespace = options.keyVaultNamespace; + this._keyVaultClient = options.keyVaultClient || client; + const MongoCrypt = ClientEncryption.getMongoCrypt(); + this._mongoCrypt = new MongoCrypt(mongoCryptOptions); + } + + /** + * Creates a data key used for explicit encryption and inserts it into the key vault namespace + * + * @example + * ```ts + * // Using async/await to create a local key + * const dataKeyId = await clientEncryption.createDataKey('local'); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * } + * }); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key with a keyAltName + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * }, + * keyAltNames: [ 'mySpecialKey' ] + * }); + * ``` + */ + async createDataKey( + provider: ClientEncryptionDataKeyProvider, + options: ClientEncryptionCreateDataKeyProviderOptions = {} + ): Promise { + if (options.keyAltNames && !Array.isArray(options.keyAltNames)) { + throw new MongoCryptInvalidArgumentError( + `Option "keyAltNames" must be an array of strings, but was of type ${typeof options.keyAltNames}.` + ); + } + + let keyAltNames = undefined; + if (options.keyAltNames && options.keyAltNames.length > 0) { + keyAltNames = options.keyAltNames.map((keyAltName, i) => { + if (typeof keyAltName !== 'string') { + throw new MongoCryptInvalidArgumentError( + `Option "keyAltNames" must be an array of strings, but item at index ${i} was of type ${typeof keyAltName}` + ); + } + + return serialize({ keyAltName }); + }); + } + + let keyMaterial = undefined; + if (options.keyMaterial) { + keyMaterial = serialize({ keyMaterial: options.keyMaterial }); + } + + const dataKeyBson = serialize({ + provider, + ...options.masterKey + }); + + const context = this._mongoCrypt.makeDataKeyContext(dataKeyBson, { + keyAltNames, + keyMaterial + }); + + const stateMachine = new StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + + const timeoutContext = + options?.timeoutContext ?? + TimeoutContext.create(resolveTimeoutOptions(this._client, { timeoutMS: this._timeoutMS })); + + const dataKey = deserialize( + await stateMachine.execute(this, context, { timeoutContext }) + ) as DataKey; + + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + const { insertedId } = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .insertOne(dataKey, { + writeConcern: { w: 'majority' }, + timeoutMS: timeoutContext?.csotEnabled() + ? timeoutContext?.getRemainingTimeMSOrThrow() + : undefined + }); + + return insertedId; + } + + /** + * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options. + * + * If no matches are found, then no bulk write is performed. + * + * @example + * ```ts + * // rewrapping all data data keys (using a filter that matches all documents) + * const filter = {}; + * + * const result = await clientEncryption.rewrapManyDataKey(filter); + * if (result.bulkWriteResult != null) { + * // keys were re-wrapped, results will be available in the bulkWrite object. + * } + * ``` + * + * @example + * ```ts + * // attempting to rewrap all data keys with no matches + * const filter = { _id: new Binary() } // assume _id matches no documents in the database + * const result = await clientEncryption.rewrapManyDataKey(filter); + * + * if (result.bulkWriteResult == null) { + * // no keys matched, `bulkWriteResult` does not exist on the result object + * } + * ``` + */ + async rewrapManyDataKey( + filter: Filter, + options?: ClientEncryptionRewrapManyDataKeyProviderOptions + ): Promise<{ bulkWriteResult?: BulkWriteResult }> { + let keyEncryptionKeyBson = undefined; + if (options) { + const keyEncryptionKey = Object.assign({ provider: options.provider }, options.masterKey); + keyEncryptionKeyBson = serialize(keyEncryptionKey); + } + const filterBson = serialize(filter); + const context = this._mongoCrypt.makeRewrapManyDataKeyContext(filterBson, keyEncryptionKeyBson); + const stateMachine = new StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + + const timeoutContext = TimeoutContext.create( + resolveTimeoutOptions(this._client, { timeoutMS: this._timeoutMS }) + ); + + const { v: dataKeys } = deserialize( + await stateMachine.execute(this, context, { timeoutContext }) + ); + if (dataKeys.length === 0) { + return {}; + } + + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + const replacements = dataKeys.map( + (key: DataKey): AnyBulkWriteOperation => ({ + updateOne: { + filter: { _id: key._id }, + update: { + $set: { + masterKey: key.masterKey, + keyMaterial: key.keyMaterial + }, + $currentDate: { + updateDate: true + } + } + } + }) + ); + + const result = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .bulkWrite(replacements, { + writeConcern: { w: 'majority' }, + timeoutMS: timeoutContext.csotEnabled() ? timeoutContext?.remainingTimeMS : undefined + }); + + return { bulkWriteResult: result }; + } + + /** + * Deletes the key with the provided id from the keyvault, if it exists. + * + * @example + * ```ts + * // delete a key by _id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const { deletedCount } = await clientEncryption.deleteKey(id); + * + * if (deletedCount != null && deletedCount > 0) { + * // successful deletion + * } + * ``` + * + */ + async deleteKey(_id: Binary): Promise { + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + return await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .deleteOne({ _id }, { writeConcern: { w: 'majority' }, timeoutMS: this._timeoutMS }); + } + + /** + * Finds all the keys currently stored in the keyvault. + * + * This method will not throw. + * + * @returns a FindCursor over all keys in the keyvault. + * @example + * ```ts + * // fetching all keys + * const keys = await clientEncryption.getKeys().toArray(); + * ``` + */ + getKeys(): FindCursor { + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + return this._keyVaultClient + .db(dbName) + .collection(collectionName) + .find({}, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS }); + } + + /** + * Finds a key in the keyvault with the specified _id. + * + * Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // getting a key by id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const key = await clientEncryption.getKey(id); + * if (!key) { + * // key is null if there was no matching key + * } + * ``` + */ + async getKey(_id: Binary): Promise { + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + return await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOne({ _id }, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS }); + } + + /** + * Finds a key in the keyvault which has the specified keyAltName. + * + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the keyAltName. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // get a key by alt name + * const keyAltName = 'keyAltName'; + * const key = await clientEncryption.getKeyByAltName(keyAltName); + * if (!key) { + * // key is null if there is no matching key + * } + * ``` + */ + async getKeyByAltName(keyAltName: string): Promise | null> { + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + return await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOne( + { keyAltNames: keyAltName }, + { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS } + ); + } + + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to adding the new altKeyName). + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // adding an keyAltName to a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.addKeyAltName(id, keyAltName); + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + async addKeyAltName(_id: Binary, keyAltName: string): Promise | null> { + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + const value = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOneAndUpdate( + { _id }, + { $addToSet: { keyAltNames: keyAltName } }, + { writeConcern: { w: 'majority' }, returnDocument: 'before', timeoutMS: this._timeoutMS } + ); + + return value; + } + + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to removing the new altKeyName). + * + * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document. + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // removing a key alt name from a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.removeKeyAltName(id, keyAltName); + * + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + async removeKeyAltName(_id: Binary, keyAltName: string): Promise | null> { + const { db: dbName, collection: collectionName } = MongoDBCollectionNamespace.fromString( + this._keyVaultNamespace + ); + + const pipeline = [ + { + $set: { + keyAltNames: { + $cond: [ + { + $eq: ['$keyAltNames', [keyAltName]] + }, + '$$REMOVE', + { + $filter: { + input: '$keyAltNames', + cond: { + $ne: ['$$this', keyAltName] + } + } + } + ] + } + } + } + ]; + + const value = await this._keyVaultClient + .db(dbName) + .collection(collectionName) + .findOneAndUpdate({ _id }, pipeline, { + writeConcern: { w: 'majority' }, + returnDocument: 'before', + timeoutMS: this._timeoutMS + }); + + return value; + } + + /** + * A convenience method for creating an encrypted collection. + * This method will create data keys for any encryptedFields that do not have a `keyId` defined + * and then create a new collection with the full set of encryptedFields. + * + * @param db - A Node.js driver Db object with which to create the collection + * @param name - The name of the collection to be created + * @param options - Options for createDataKey and for createCollection + * @returns created collection and generated encryptedFields + * @throws MongoCryptCreateDataKeyError - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created. + * @throws MongoCryptCreateEncryptedCollectionError - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created. + */ + async createEncryptedCollection( + db: Db, + name: string, + options: { + provider: ClientEncryptionDataKeyProvider; + createCollectionOptions: Omit & { + encryptedFields: Document; + }; + masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions; + } + ): Promise<{ collection: Collection; encryptedFields: Document }> { + const { + provider, + masterKey, + createCollectionOptions: { + encryptedFields: { ...encryptedFields }, + ...createCollectionOptions + } + } = options; + + const timeoutContext = + this._timeoutMS != null + ? TimeoutContext.create(resolveTimeoutOptions(this._client, { timeoutMS: this._timeoutMS })) + : undefined; + + if (Array.isArray(encryptedFields.fields)) { + const createDataKeyPromises = encryptedFields.fields.map(async field => + field == null || typeof field !== 'object' || field.keyId != null + ? field + : { + ...field, + keyId: await this.createDataKey(provider, { + masterKey, + // clone the timeoutContext + // in order to avoid sharing the same timeout for server selection and connection checkout across different concurrent operations + timeoutContext: timeoutContext?.csotEnabled() ? timeoutContext?.clone() : undefined + }) + } + ); + const createDataKeyResolutions = await Promise.allSettled(createDataKeyPromises); + + encryptedFields.fields = createDataKeyResolutions.map((resolution, index) => + resolution.status === 'fulfilled' ? resolution.value : encryptedFields.fields[index] + ); + + const rejection = createDataKeyResolutions.find( + (result): result is PromiseRejectedResult => result.status === 'rejected' + ); + if (rejection != null) { + throw new MongoCryptCreateDataKeyError(encryptedFields, { cause: rejection.reason }); + } + } + + try { + const collection = await db.createCollection(name, { + ...createCollectionOptions, + encryptedFields, + timeoutMS: timeoutContext?.csotEnabled() + ? timeoutContext?.getRemainingTimeMSOrThrow() + : undefined + }); + return { collection, encryptedFields }; + } catch (cause) { + throw new MongoCryptCreateEncryptedCollectionError(encryptedFields, { cause }); + } + } + + /** + * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must + * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error. + * + * @param value - The value that you wish to serialize. Must be of a type that can be serialized into BSON + * @param options - + * @returns a Promise that either resolves with the encrypted value, or rejects with an error. + * + * @example + * ```ts + * // Encryption with async/await api + * async function encryptMyData(value) { + * const keyId = await clientEncryption.createDataKey('local'); + * return clientEncryption.encrypt(value, { keyId, algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + * + * @example + * ```ts + * // Encryption using a keyAltName + * async function encryptMyData(value) { + * await clientEncryption.createDataKey('local', { keyAltNames: 'mySpecialKey' }); + * return clientEncryption.encrypt(value, { keyAltName: 'mySpecialKey', algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + */ + async encrypt(value: unknown, options: ClientEncryptionEncryptOptions): Promise { + return await this._encrypt(value, false, options); + } + + /** + * Encrypts a Match Expression or Aggregate Expression to query a range index. + * + * Only supported when queryType is "range" and algorithm is "Range". + * + * @param expression - a BSON document of one of the following forms: + * 1. A Match Expression of this form: + * `{$and: [{: {$gt: }}, {: {$lt: }}]}` + * 2. An Aggregate Expression of this form: + * `{$and: [{$gt: [, ]}, {$lt: [, ]}]}` + * + * `$gt` may also be `$gte`. `$lt` may also be `$lte`. + * + * @param options - + * @returns Returns a Promise that either resolves with the encrypted value or rejects with an error. + */ + async encryptExpression( + expression: Document, + options: ClientEncryptionEncryptOptions + ): Promise { + return await this._encrypt(expression, true, options); + } + + /** + * Explicitly decrypt a provided encrypted value + * + * @param value - An encrypted value + * @returns a Promise that either resolves with the decrypted value, or rejects with an error + * + * @example + * ```ts + * // Decrypting value with async/await API + * async function decryptMyValue(value) { + * return clientEncryption.decrypt(value); + * } + * ``` + */ + async decrypt(value: Binary): Promise { + const valueBuffer = serialize({ v: value }); + const context = this._mongoCrypt.makeExplicitDecryptionContext(valueBuffer); + + const stateMachine = new StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + + const timeoutContext = + this._timeoutMS != null + ? TimeoutContext.create(resolveTimeoutOptions(this._client, { timeoutMS: this._timeoutMS })) + : undefined; + + const { v } = deserialize(await stateMachine.execute(this, context, { timeoutContext })); + + return v; + } + + /** + * @internal + * Ask the user for KMS credentials. + * + * This returns anything that looks like the kmsProviders original input + * option. It can be empty, and any provider specified here will override + * the original ones. + */ + async askForKMSCredentials(): Promise { + return await refreshKMSCredentials(this._kmsProviders, this._credentialProviders); + } + + static get libmongocryptVersion() { + return ClientEncryption.getMongoCrypt().libmongocryptVersion; + } + + /** + * @internal + * A helper that perform explicit encryption of values and expressions. + * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must + * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error. + * + * @param value - The value that you wish to encrypt. Must be of a type that can be serialized into BSON + * @param expressionMode - a boolean that indicates whether or not to encrypt the value as an expression + * @param options - options to pass to encrypt + * @returns the raw result of the call to stateMachine.execute(). When expressionMode is set to true, the return + * value will be a bson document. When false, the value will be a BSON Binary. + * + */ + private async _encrypt( + value: unknown, + expressionMode: boolean, + options: ClientEncryptionEncryptOptions + ): Promise { + const { + algorithm, + keyId, + keyAltName, + contentionFactor, + queryType, + rangeOptions, + stringOptions, + textOptions + } = options; + const contextOptions: ExplicitEncryptionContextOptions = { + expressionMode, + algorithm + }; + if (keyId) { + contextOptions.keyId = keyId.buffer; + } + if (keyAltName) { + if (keyId) { + throw new MongoCryptInvalidArgumentError( + `"options" cannot contain both "keyId" and "keyAltName"` + ); + } + if (typeof keyAltName !== 'string') { + throw new MongoCryptInvalidArgumentError( + `"options.keyAltName" must be of type string, but was of type ${typeof keyAltName}` + ); + } + + contextOptions.keyAltName = serialize({ keyAltName }); + } + if (typeof contentionFactor === 'number' || typeof contentionFactor === 'bigint') { + contextOptions.contentionFactor = contentionFactor; + } + if (typeof queryType === 'string') { + contextOptions.queryType = queryType; + } + + if (typeof rangeOptions === 'object') { + contextOptions.rangeOptions = serialize(rangeOptions); + } + + const resolvedStringOptions = stringOptions ?? textOptions; + if (typeof resolvedStringOptions === 'object') { + contextOptions.textOptions = serialize(resolvedStringOptions); + } + + const valueBuffer = serialize({ v: value }); + const stateMachine = new StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options), + kmsConnectCallback: this._kmsConnectCallback + }); + const context = this._mongoCrypt.makeExplicitEncryptionContext(valueBuffer, contextOptions); + + const timeoutContext = + this._timeoutMS != null + ? TimeoutContext.create(resolveTimeoutOptions(this._client, { timeoutMS: this._timeoutMS })) + : undefined; + const { v } = deserialize(await stateMachine.execute(this, context, { timeoutContext })); + return v; + } +} + +/** + * @public + * Options to provide when encrypting data. + */ +export interface ClientEncryptionEncryptOptions { + /** + * The algorithm to use for encryption. + */ + algorithm: + | 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' + | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' + | 'Indexed' + | 'Unindexed' + | 'Range' + | 'String' + /** @deprecated Use `'String'` instead. */ + | 'TextPreview'; + + /** + * The id of the Binary dataKey to use for encryption + */ + keyId?: Binary; + + /** + * A unique string name corresponding to an already existing dataKey. + */ + keyAltName?: string; + + /** The contention factor. */ + contentionFactor?: bigint | number; + + /** + * The query type. + */ + queryType?: + | 'equality' + | 'range' + | 'prefix' + | 'suffix' + | 'substring' + /** @deprecated Use `'prefix'` instead. */ + | 'prefixPreview' + /** @deprecated Use `'suffix'` instead. */ + | 'suffixPreview' + /** @deprecated Use `'substring'` instead. */ + | 'substringPreview'; + + /** The index options for a Queryable Encryption field supporting "range" queries.*/ + rangeOptions?: RangeOptions; + + /** Options for a Queryable Encryption field supporting string queries. Only valid when `algorithm` is `'String'` or the deprecated `'TextPreview'`. */ + stringOptions?: StringQueryOptions; + + /** + * Options for a Queryable Encryption field supporting text queries. Only valid when `algorithm` is `'String'` or the deprecated `'TextPreview'`. + * + * @deprecated Use `stringOptions` instead. + */ + textOptions?: StringQueryOptions; +} + +/** + * Options for a Queryable Encryption field supporting string queries. + * + * @public + */ +export interface StringQueryOptions { + /** Indicates that text indexes for this field are case sensitive */ + caseSensitive: boolean; + /** Indicates that text indexes for this field are diacritic sensitive. */ + diacriticSensitive: boolean; + + prefix?: { + /** The maximum allowed query length. */ + strMaxQueryLength: Int32 | number; + /** The minimum allowed query length. */ + strMinQueryLength: Int32 | number; + }; + + suffix?: { + /** The maximum allowed query length. */ + strMaxQueryLength: Int32 | number; + /** The minimum allowed query length. */ + strMinQueryLength: Int32 | number; + }; + + substring?: { + /** The maximum allowed length to insert. */ + strMaxLength: Int32 | number; + /** The maximum allowed query length. */ + strMaxQueryLength: Int32 | number; + /** The minimum allowed query length. */ + strMinQueryLength: Int32 | number; + }; +} + +/** + * @public + * @deprecated Use {@link StringQueryOptions} instead. + */ +export type TextQueryOptions = StringQueryOptions; + +/** + * @public + * @experimental + */ +export interface ClientEncryptionRewrapManyDataKeyProviderOptions { + provider: ClientEncryptionDataKeyProvider; + masterKey?: + | AWSEncryptionKeyOptions + | AzureEncryptionKeyOptions + | GCPEncryptionKeyOptions + | KMIPEncryptionKeyOptions + | undefined; +} + +/** + * @public + * Additional settings to provide when creating a new `ClientEncryption` instance. + */ +export interface ClientEncryptionOptions { + /** + * The namespace of the key vault, used to store encryption keys + */ + keyVaultNamespace: string; + + /** + * A MongoClient used to fetch keys from a key vault. Defaults to client. + */ + keyVaultClient?: MongoClient | undefined; + + /** + * Options for specific KMS providers to use + */ + kmsProviders?: KMSProviders; + + /** + * Options for user provided custom credential providers. + */ + credentialProviders?: CredentialProviders; + + /** + * Options for specifying a Socks5 proxy to use for connecting to the KMS. + */ + proxyOptions?: ProxyOptions; + + /** + * TLS options for kms providers to use. + */ + tlsOptions?: CSFLEKMSTlsOptions; + + /** + * A callback that establishes the socket used to connect to a KMS host, e.g. to route KMS + * requests through an HTTP proxy via the HTTP CONNECT method. Mutually exclusive with `proxyOptions`. + * See {@link KMSConnectCallback} for a usage example. + */ + kmsConnectCallback?: KMSConnectCallback; + + /** + * Sets the expiration time for the DEK in the cache in milliseconds. Defaults to 60000. 0 means no timeout. + */ + keyExpirationMS?: number; + + /** + * @experimental + * + * The timeout setting to be used for all the operations on ClientEncryption. + * + * When provided, `timeoutMS` is used as the timeout for each operation executed on + * the ClientEncryption object. For example: + * + * ```typescript + * const clientEncryption = new ClientEncryption(client, { + * timeoutMS: 1_000 + * kmsProviders: { local: { key: '' } } + * }); + * + * // `1_000` is used as the timeout for createDataKey call + * await clientEncryption.createDataKey('local'); + * ``` + * + * If `timeoutMS` is configured on the provided client, the client's `timeoutMS` value + * will be used unless `timeoutMS` is also provided as a client encryption option. + * + * ```typescript + * const client = new MongoClient('', { timeoutMS: 2_000 }); + * + * // timeoutMS is set to 1_000 on clientEncryption + * const clientEncryption = new ClientEncryption(client, { + * timeoutMS: 1_000 + * kmsProviders: { local: { key: '' } } + * }); + * ``` + */ + timeoutMS?: number; +} + +/** + * @public + * Configuration options for making an AWS encryption key + */ +export interface AWSEncryptionKeyOptions { + /** + * The AWS region of the KMS + */ + region: string; + + /** + * The Amazon Resource Name (ARN) to the AWS customer master key (CMK) + */ + key: string; + + /** + * An alternate host to send KMS requests to. May include port number. + */ + endpoint?: string | undefined; +} + +/** + * @public + * Configuration options for making an AWS encryption key + */ +export interface GCPEncryptionKeyOptions { + /** + * GCP project ID + */ + projectId: string; + + /** + * Location name (e.g. "global") + */ + location: string; + + /** + * Key ring name + */ + keyRing: string; + + /** + * Key name + */ + keyName: string; + + /** + * Key version + */ + keyVersion?: string | undefined; + + /** + * KMS URL, defaults to `https://www.googleapis.com/auth/cloudkms` + */ + endpoint?: string | undefined; +} + +/** + * @public + * Configuration options for making an Azure encryption key + */ +export interface AzureEncryptionKeyOptions { + /** + * Key name + */ + keyName: string; + + /** + * Key vault URL, typically `.vault.azure.net` + */ + keyVaultEndpoint: string; + + /** + * Key version + */ + keyVersion?: string | undefined; +} + +/** + * @public + * Configuration options for making a KMIP encryption key + */ +export interface KMIPEncryptionKeyOptions { + /** + * keyId is the KMIP Unique Identifier to a 96 byte KMIP Secret Data managed object. + * + * If keyId is omitted, a random 96 byte KMIP Secret Data managed object will be created. + */ + keyId?: string; + + /** + * Host with optional port. + */ + endpoint?: string; + + /** + * If true, this key should be decrypted by the KMIP server. + * + * Requires `mongodb-client-encryption>=6.0.1`. + */ + delegated?: boolean; +} + +/** + * @public + * Options to provide when creating a new data key. + */ +export interface ClientEncryptionCreateDataKeyProviderOptions { + /** + * Identifies a new KMS-specific key used to encrypt the new data key + */ + masterKey?: + | AWSEncryptionKeyOptions + | AzureEncryptionKeyOptions + | GCPEncryptionKeyOptions + | KMIPEncryptionKeyOptions + | undefined; + + /** + * An optional list of string alternate names used to reference a key. + * If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id. + */ + keyAltNames?: string[] | undefined; + + /** @experimental */ + keyMaterial?: Buffer | Binary; + + /** @internal */ + timeoutContext?: CSOTTimeoutContext; +} + +/** + * @public + * @experimental + */ +export interface ClientEncryptionRewrapManyDataKeyResult { + /** The result of rewrapping data keys. If unset, no keys matched the filter. */ + bulkWriteResult?: BulkWriteResult; +} + +/** + * @public + * RangeOptions specifies index options for a Queryable Encryption field supporting "range" queries. + * min, max, sparsity, trimFactor and range must match the values set in the encryptedFields of the destination collection. + * For double and decimal128, min/max/precision must all be set, or all be unset. + */ +export interface RangeOptions { + /** min is the minimum value for the encrypted index. Required if precision is set. */ + min?: any; + /** max is the minimum value for the encrypted index. Required if precision is set. */ + max?: any; + /** sparsity may be used to tune performance. must be non-negative. When omitted, a default value is used. */ + sparsity?: Long | bigint; + /** trimFactor may be used to tune performance. must be non-negative. When omitted, a default value is used. */ + trimFactor?: Int32 | number; + /* precision determines the number of significant digits after the decimal point. May only be set for double or decimal128. */ + precision?: number; +} + +/** + * Get the socket options from the client. + * @param baseOptions - The mongo client options. + * @returns ClientEncryptionSocketOptions + */ +export function autoSelectSocketOptions( + baseOptions: MongoClientOptions +): ClientEncryptionSocketOptions { + const options: ClientEncryptionSocketOptions = { autoSelectFamily: true }; + if ('autoSelectFamily' in baseOptions) { + options.autoSelectFamily = baseOptions.autoSelectFamily; + } + if ('autoSelectFamilyAttemptTimeout' in baseOptions) { + options.autoSelectFamilyAttemptTimeout = baseOptions.autoSelectFamilyAttemptTimeout; + } + return options; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/errors.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/errors.ts new file mode 100644 index 00000000..08a31e9d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/errors.ts @@ -0,0 +1,144 @@ +import { type Document } from '../bson'; +import { MongoError } from '../error'; + +/** + * @public + * An error indicating that something went wrong specifically with MongoDB Client Encryption + */ +export class MongoCryptError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options: { cause?: Error } = {}) { + super(message, options); + } + + override get name() { + return 'MongoCryptError'; + } +} + +export const defaultErrorWrapper = (error: Error) => + new MongoCryptError(error.message, { cause: error }); + +/** + * @public + * + * An error indicating an invalid argument was provided to an encryption API. + */ +export class MongoCryptInvalidArgumentError extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name() { + return 'MongoCryptInvalidArgumentError'; + } +} +/** + * @public + * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys + */ +export class MongoCryptCreateDataKeyError extends MongoCryptError { + encryptedFields: Document; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields: Document, { cause }: { cause: Error }) { + super(`Unable to complete creating data keys: ${cause.message}`, { cause }); + this.encryptedFields = encryptedFields; + } + + override get name() { + return 'MongoCryptCreateDataKeyError'; + } +} + +/** + * @public + * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create a collection + */ +export class MongoCryptCreateEncryptedCollectionError extends MongoCryptError { + encryptedFields: Document; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields: Document, { cause }: { cause: Error }) { + super(`Unable to create collection: ${cause.message}`, { cause }); + this.encryptedFields = encryptedFields; + } + + override get name() { + return 'MongoCryptCreateEncryptedCollectionError'; + } +} + +/** + * @public + * An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials. + */ +export class MongoCryptAzureKMSRequestError extends MongoCryptError { + /** The body of the http response that failed, if present. */ + body?: Document; + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, body?: Document) { + super(message); + this.body = body; + } + + override get name(): string { + return 'MongoCryptAzureKMSRequestError'; + } +} + +/** @public */ +export class MongoCryptKMSRequestNetworkTimeoutError extends MongoCryptError { + override get name(): string { + return 'MongoCryptKMSRequestNetworkTimeoutError'; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/kms_options.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/kms_options.ts new file mode 100644 index 00000000..005d1154 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/kms_options.ts @@ -0,0 +1,93 @@ +import { type Duplex } from 'stream'; + +import { type MongoClientOptions } from '../mongo_client'; + +/** + * @public + * + * TLS options to use when connecting. The spec specifically calls out which insecure + * tls options are not allowed: + * + * - tlsAllowInvalidCertificates + * - tlsAllowInvalidHostnames + * - tlsInsecure + * + * These options are not included in the type, and are ignored if provided. + */ +export type ClientEncryptionTlsOptions = Pick< + MongoClientOptions, + 'tlsCAFile' | 'tlsCertificateKeyFile' | 'tlsCertificateKeyFilePassword' | 'secureContext' +>; + +/** @public */ +export type CSFLEKMSTlsOptions = { + aws?: ClientEncryptionTlsOptions; + gcp?: ClientEncryptionTlsOptions; + kmip?: ClientEncryptionTlsOptions; + local?: ClientEncryptionTlsOptions; + azure?: ClientEncryptionTlsOptions; + + [key: string]: ClientEncryptionTlsOptions | undefined; +}; + +/** + * @public + * + * Socket options to use for KMS requests. + */ +export type ClientEncryptionSocketOptions = Pick< + MongoClientOptions, + 'autoSelectFamily' | 'autoSelectFamilyAttemptTimeout' +>; + +/** + * @public + * + * A callback that establishes the connection to a KMS host. + * + * When provided on `AutoEncryptionOptions` or `ClientEncryptionOptions`, the driver invokes this + * callback instead of connecting to the KMS host itself, passing the target `host` and `port`. The + * callback MUST return a `Duplex` stream connected to the KMS host, either directly or tunneled + * through a proxy; a `net.Socket` satisfies this, as does any other `Duplex`. The returned stream is + * passed to Node.js' `tls.connect()` as its `socket`, and the driver performs the KMS host's TLS + * handshake over it using the KMS provider's configured TLS options. The callback therefore MUST NOT + * perform the KMS host's TLS handshake itself, though it MAY use TLS for its own transport, e.g. when + * connecting to an HTTPS proxy. This enables routing KMS requests through an HTTP proxy via the HTTP + * CONNECT method. + * + * When the operation has a client-side operation timeout (CSOT) configured, `timeoutMS` is the + * remaining time budget in milliseconds; it is `undefined` otherwise. The `signal` aborts when the + * connection attempt exceeds that budget; the callback should stop connecting and reject when it fires. + * + * @example Route KMS requests through an HTTP proxy using the HTTP CONNECT method + * ```ts + * import * as net from 'net'; + * + * const kmsConnectCallback: KMSConnectCallback = ({ host, port, signal }) => + * new Promise((resolve, reject) => { + * // Open a plain connection to the proxy, not to the KMS host. + * const socket = net.connect({ host: 'proxy.example.com', port: 8080, signal }); + * socket.once('error', reject); + * socket.once('connect', () => { + * // Ask the proxy to tunnel to the KMS host, then hand the socket back for the driver's TLS. + * socket.write(`CONNECT ${host}:${port} HTTP/1.1\r\nHost: ${host}:${port}\r\n\r\n`); + * socket.once('data', chunk => { + * if (chunk.toString('utf8').startsWith('HTTP/1.1 200')) resolve(socket); + * else reject(new Error('Proxy refused the CONNECT request')); + * }); + * }); + * }); + * + * const clientEncryption = new ClientEncryption(keyVaultClient, { + * keyVaultNamespace, + * kmsProviders, + * kmsConnectCallback + * }); + * ``` + */ +export type KMSConnectCallback = (options: { + host: string; + port: number; + timeoutMS?: number; + signal: AbortSignal; +}) => Promise; diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/mongocryptd_manager.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/mongocryptd_manager.ts new file mode 100644 index 00000000..24c0abdd --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/mongocryptd_manager.ts @@ -0,0 +1,100 @@ +import type { ChildProcess } from 'child_process'; + +import { MongoNetworkTimeoutError } from '../error'; +import { type AutoEncryptionExtraOptions } from './auto_encrypter'; + +/** + * @internal + * An internal class that handles spawning a mongocryptd. + */ +export class MongocryptdManager { + static DEFAULT_MONGOCRYPTD_URI = 'mongodb://localhost:27020'; + + uri: string; + bypassSpawn: boolean; + spawnPath = ''; + spawnArgs: Array = []; + _child?: ChildProcess; + + constructor(extraOptions: AutoEncryptionExtraOptions = {}) { + this.uri = + typeof extraOptions.mongocryptdURI === 'string' && extraOptions.mongocryptdURI.length > 0 + ? extraOptions.mongocryptdURI + : MongocryptdManager.DEFAULT_MONGOCRYPTD_URI; + + this.bypassSpawn = !!extraOptions.mongocryptdBypassSpawn; + + if (Object.hasOwn(extraOptions, 'mongocryptdSpawnPath') && extraOptions.mongocryptdSpawnPath) { + this.spawnPath = extraOptions.mongocryptdSpawnPath; + } + if ( + Object.hasOwn(extraOptions, 'mongocryptdSpawnArgs') && + Array.isArray(extraOptions.mongocryptdSpawnArgs) + ) { + this.spawnArgs = this.spawnArgs.concat(extraOptions.mongocryptdSpawnArgs); + } + if ( + this.spawnArgs + .filter(arg => typeof arg === 'string') + .every(arg => arg.indexOf('--idleShutdownTimeoutSecs') < 0) + ) { + this.spawnArgs.push('--idleShutdownTimeoutSecs', '60'); + } + } + + /** + * Will check to see if a mongocryptd is up. If it is not up, it will attempt + * to spawn a mongocryptd in a detached process, and then wait for it to be up. + */ + async spawn(): Promise { + const cmdName = this.spawnPath || 'mongocryptd'; + + // eslint-disable-next-line @typescript-eslint/no-require-imports + const { spawn } = require('child_process') as typeof import('child_process'); + + // Spawned with stdio: ignore and detached: true + // to ensure child can outlive parent. + this._child = spawn(cmdName, this.spawnArgs, { + stdio: 'ignore', + detached: true + }); + + this._child.on('error', () => { + // From the FLE spec: + // "The stdout and stderr of the spawned process MUST not be exposed in the driver + // (e.g. redirect to /dev/null). Users can pass the argument --logpath to + // extraOptions.mongocryptdSpawnArgs if they need to inspect mongocryptd logs. + // If spawning is necessary, the driver MUST spawn mongocryptd whenever server + // selection on the MongoClient to mongocryptd fails. If the MongoClient fails to + // connect after spawning, the server selection error is propagated to the user." + // The AutoEncrypter and MongoCryptdManager should work together to spawn + // mongocryptd whenever necessary. Additionally, the `mongocryptd` intentionally + // shuts down after 60s and gets respawned when necessary. We rely on server + // selection timeouts when connecting to the `mongocryptd` to inform users that something + // has been configured incorrectly. For those reasons, we suppress stderr from + // the `mongocryptd` process and immediately unref the process. + }); + + // unref child to remove handle from event loop + this._child.unref(); + } + + /** + * @returns the result of `fn` or rejects with an error. + */ + async withRespawn(fn: () => Promise): ReturnType { + try { + const result = await fn(); + return result; + } catch (err) { + // If we are not bypassing spawning, then we should retry once on a MongoTimeoutError (server selection error) + const shouldSpawn = err instanceof MongoNetworkTimeoutError && !this.bypassSpawn; + if (!shouldSpawn) { + throw err; + } + } + await this.spawn(); + const result = await fn(); + return result; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/aws.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/aws.ts new file mode 100644 index 00000000..e50bb4d2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/aws.ts @@ -0,0 +1,33 @@ +import { + type AWSCredentialProvider, + AWSSDKCredentialProvider +} from '../../cmap/auth/aws_temporary_credentials'; +import { type KMSProviders } from '.'; + +/** + * @internal + */ +export async function loadAWSCredentials( + kmsProviders: KMSProviders, + provider?: AWSCredentialProvider +): Promise { + const credentialProvider = new AWSSDKCredentialProvider(provider); + + // We shouldn't ever receive a response from the AWS SDK that doesn't have a `SecretAccessKey` + // or `AccessKeyId`. However, TS says these fields are optional. We provide empty strings + // and let libmongocrypt error if we're unable to fetch the required keys. + const { + SecretAccessKey = '', + AccessKeyId = '', + Token + } = await credentialProvider.getCredentials(); + const aws: NonNullable = { + secretAccessKey: SecretAccessKey, + accessKeyId: AccessKeyId + }; + // the AWS session token is only required for temporary credentials so only attach it to the + // result if it's present in the response from the aws sdk + Token != null && (aws.sessionToken = Token); + + return { ...kmsProviders, aws }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/azure.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/azure.ts new file mode 100644 index 00000000..97a2665e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/azure.ts @@ -0,0 +1,181 @@ +import { type Document } from '../../bson'; +import { MongoNetworkTimeoutError } from '../../error'; +import { get } from '../../utils'; +import { MongoCryptAzureKMSRequestError } from '../errors'; +import { type KMSProviders } from './index'; + +const MINIMUM_TOKEN_REFRESH_IN_MILLISECONDS = 6000; +/** Base URL for getting Azure tokens. */ +export const AZURE_BASE_URL = 'http://169.254.169.254/metadata/identity/oauth2/token?'; + +/** + * The access token that libmongocrypt expects for Azure kms. + */ +interface AccessToken { + accessToken: string; +} + +/** + * The response from the azure idms endpoint, including the `expiresOnTimestamp`. + * `expiresOnTimestamp` is needed for caching. + */ +interface AzureTokenCacheEntry extends AccessToken { + accessToken: string; + expiresOnTimestamp: number; +} + +/** + * @internal + */ +export class AzureCredentialCache { + cachedToken: AzureTokenCacheEntry | null = null; + + async getToken(): Promise { + if (this.cachedToken == null || this.needsRefresh(this.cachedToken)) { + this.cachedToken = await this._getToken(); + } + + return { accessToken: this.cachedToken.accessToken }; + } + + needsRefresh(token: AzureTokenCacheEntry): boolean { + const timeUntilExpirationMS = token.expiresOnTimestamp - Date.now(); + return timeUntilExpirationMS <= MINIMUM_TOKEN_REFRESH_IN_MILLISECONDS; + } + + /** + * exposed for testing + */ + resetCache() { + this.cachedToken = null; + } + + /** + * exposed for testing + */ + _getToken(): Promise { + return fetchAzureKMSToken(); + } +} + +/** @internal */ +export const tokenCache = new AzureCredentialCache(); + +/** @internal */ +async function parseResponse(response: { + body: string; + status?: number; +}): Promise { + const { status, body: rawBody } = response; + + const body: { expires_in?: number; access_token?: string } = (() => { + try { + return JSON.parse(rawBody); + } catch { + throw new MongoCryptAzureKMSRequestError('Malformed JSON body in GET request.'); + } + })(); + + if (status !== 200) { + throw new MongoCryptAzureKMSRequestError('Unable to complete request.', body); + } + + if (!body.access_token) { + throw new MongoCryptAzureKMSRequestError( + 'Malformed response body - missing field `access_token`.' + ); + } + + if (!body.expires_in) { + throw new MongoCryptAzureKMSRequestError( + 'Malformed response body - missing field `expires_in`.' + ); + } + + const expiresInMS = Number(body.expires_in) * 1000; + if (Number.isNaN(expiresInMS)) { + throw new MongoCryptAzureKMSRequestError( + 'Malformed response body - unable to parse int from `expires_in` field.' + ); + } + + return { + accessToken: body.access_token, + expiresOnTimestamp: Date.now() + expiresInMS + }; +} + +/** + * @internal + * + * exposed for CSFLE + * [prose test 18](https://github.com/mongodb/specifications/tree/master/source/client-side-encryption/tests#azure-imds-credentials) + */ +export interface AzureKMSRequestOptions { + headers?: Document; + url?: URL | string; +} + +/** + * @internal + * Get the Azure endpoint URL. + */ +export function addAzureParams(url: URL, resource: string, username?: string): URL { + url.searchParams.append('api-version', '2018-02-01'); + url.searchParams.append('resource', resource); + if (username) { + url.searchParams.append('client_id', username); + } + return url; +} + +/** + * @internal + * + * parses any options provided by prose tests to `fetchAzureKMSToken` and merges them with + * the default values for headers and the request url. + */ +export function prepareRequest(options: AzureKMSRequestOptions): { + headers: Document; + url: URL; +} { + const url = new URL(options.url?.toString() ?? AZURE_BASE_URL); + addAzureParams(url, 'https://vault.azure.net'); + const headers = { ...options.headers, 'Content-Type': 'application/json', Metadata: true }; + return { headers, url }; +} + +/** + * @internal + * + * `AzureKMSRequestOptions` allows prose tests to modify the http request sent to the idms + * servers. This is required to simulate different server conditions. No options are expected to + * be set outside of tests. + * + * exposed for CSFLE + * [prose test 18](https://github.com/mongodb/specifications/tree/master/source/client-side-encryption/tests#azure-imds-credentials) + */ +export async function fetchAzureKMSToken( + options: AzureKMSRequestOptions = {} +): Promise { + const { headers, url } = prepareRequest(options); + try { + const response = await get(url, { headers }); + return await parseResponse(response); + } catch (error) { + if (error instanceof MongoNetworkTimeoutError) { + throw new MongoCryptAzureKMSRequestError(`[Azure KMS] ${error.message}`); + } + throw error; + } +} + +/** + * @internal + * + * @throws Will reject with a `MongoCryptError` if the http request fails or the http response is malformed. + */ +export async function loadAzureCredentials(kmsProviders: KMSProviders): Promise { + const azure = await tokenCache.getToken(); + return { ...kmsProviders, azure }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts new file mode 100644 index 00000000..1415d216 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts @@ -0,0 +1,16 @@ +import { getGcpMetadata } from '../../deps'; +import { type KMSProviders } from '.'; + +/** @internal */ +export async function loadGCPCredentials(kmsProviders: KMSProviders): Promise { + const gcpMetadata = getGcpMetadata(); + + if ('kModuleError' in gcpMetadata) { + return kmsProviders; + } + + const { access_token: accessToken } = await gcpMetadata.instance<{ access_token: string }>({ + property: 'service-accounts/default/token' + }); + return { ...kmsProviders, gcp: { accessToken } }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/index.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/index.ts new file mode 100644 index 00000000..63108c7e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/providers/index.ts @@ -0,0 +1,207 @@ +import type { Binary } from '../../bson'; +import { type AWSCredentialProvider } from '../../cmap/auth/aws_temporary_credentials'; +import { loadAWSCredentials } from './aws'; +import { loadAzureCredentials } from './azure'; +import { loadGCPCredentials } from './gcp'; + +/** + * @public + * + * A data key provider. Allowed values: + * + * - aws, gcp, local, kmip or azure + * - (`mongodb-client-encryption>=6.0.1` only) a named key, in the form of: + * `aws:`, `gcp:`, `local:`, `kmip:`, `azure:` + * where `name` is an alphanumeric string, underscores allowed. + */ +export type ClientEncryptionDataKeyProvider = keyof KMSProviders; + +/** @public */ +export interface AWSKMSProviderConfiguration { + /** + * The access key used for the AWS KMS provider + */ + accessKeyId: string; + + /** + * The secret access key used for the AWS KMS provider + */ + secretAccessKey: string; + + /** + * An optional AWS session token that will be used as the + * X-Amz-Security-Token header for AWS requests. + */ + sessionToken?: string; +} + +/** @public */ +export interface LocalKMSProviderConfiguration { + /** + * The master key used to encrypt/decrypt data keys. + * A 96-byte long Buffer or base64 encoded string. + */ + key: Binary | Uint8Array | string; +} + +/** @public */ +export interface KMIPKMSProviderConfiguration { + /** + * The output endpoint string. + * The endpoint consists of a hostname and port separated by a colon. + * E.g. "example.com:123". A port is always present. + */ + endpoint?: string; +} + +/** @public */ +export type AzureKMSProviderConfiguration = + | { + /** + * The tenant ID identifies the organization for the account + */ + tenantId: string; + + /** + * The client ID to authenticate a registered application + */ + clientId: string; + + /** + * The client secret to authenticate a registered application + */ + clientSecret: string; + + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * This is optional, and only needed if customer is using a non-commercial Azure instance + * (e.g. a government or China account, which use different URLs). + * Defaults to "login.microsoftonline.com" + */ + identityPlatformEndpoint?: string | undefined; + } + | { + /** + * If present, an access token to authenticate with Azure. + */ + accessToken: string; + }; + +/** @public */ +export type GCPKMSProviderConfiguration = + | { + /** + * The service account email to authenticate + */ + email: string; + + /** + * A PKCS#8 encrypted key. This can either be a base64 string or a binary representation + */ + privateKey: string | Buffer; + + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * Defaults to "oauth2.googleapis.com" + */ + endpoint?: string | undefined; + } + | { + /** + * If present, an access token to authenticate with GCP. + */ + accessToken: string; + }; + +/** + * @public + * Configuration options for custom credential providers for KMS requests. + */ +export interface CredentialProviders { + /* A custom AWS credential provider */ + aws?: AWSCredentialProvider; +} + +/** + * @public + * Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. + * + * Named KMS providers _are not supported_ for automatic KMS credential fetching. + */ +export interface KMSProviders { + /** + * Configuration options for using 'aws' as your KMS provider + */ + aws?: AWSKMSProviderConfiguration | Record; + [key: `aws:${string}`]: AWSKMSProviderConfiguration; + + /** + * Configuration options for using 'local' as your KMS provider + */ + local?: LocalKMSProviderConfiguration; + [key: `local:${string}`]: LocalKMSProviderConfiguration; + + /** + * Configuration options for using 'kmip' as your KMS provider + */ + kmip?: KMIPKMSProviderConfiguration; + [key: `kmip:${string}`]: KMIPKMSProviderConfiguration; + + /** + * Configuration options for using 'azure' as your KMS provider + */ + azure?: AzureKMSProviderConfiguration | Record; + [key: `azure:${string}`]: AzureKMSProviderConfiguration; + + /** + * Configuration options for using 'gcp' as your KMS provider + */ + gcp?: GCPKMSProviderConfiguration | Record; + [key: `gcp:${string}`]: GCPKMSProviderConfiguration; +} + +/** + * Auto credential fetching should only occur when the provider is defined on the kmsProviders map + * and the settings are an empty object. + * + * This is distinct from a nullish provider key. + * + * @internal - exposed for testing purposes only + */ +export function isEmptyCredentials( + providerName: ClientEncryptionDataKeyProvider, + kmsProviders: KMSProviders +): boolean { + const provider = kmsProviders[providerName]; + if (provider == null) { + return false; + } + return typeof provider === 'object' && Object.keys(provider).length === 0; +} + +/** + * Load cloud provider credentials for the user provided KMS providers. + * Credentials will only attempt to get loaded if they do not exist + * and no existing credentials will get overwritten. + * + * @internal + */ +export async function refreshKMSCredentials( + kmsProviders: KMSProviders, + credentialProviders?: CredentialProviders +): Promise { + let finalKMSProviders = kmsProviders; + + if (isEmptyCredentials('aws', kmsProviders)) { + finalKMSProviders = await loadAWSCredentials(finalKMSProviders, credentialProviders?.aws); + } + + if (isEmptyCredentials('gcp', kmsProviders)) { + finalKMSProviders = await loadGCPCredentials(finalKMSProviders); + } + + if (isEmptyCredentials('azure', kmsProviders)) { + finalKMSProviders = await loadAzureCredentials(finalKMSProviders); + } + return finalKMSProviders; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/state_machine.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/state_machine.ts new file mode 100644 index 00000000..47df2067 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/client-side-encryption/state_machine.ts @@ -0,0 +1,672 @@ +import * as fs from 'fs/promises'; +import { type MongoCryptContext, type MongoCryptKMSRequest } from 'mongodb-client-encryption'; +import * as net from 'net'; +import * as process from 'process'; +import * as tls from 'tls'; + +import { + type BSONSerializeOptions, + deserialize, + type Document, + pluckBSONSerializeOptions, + serialize +} from '../bson'; +import { type ProxyOptions } from '../cmap/connection'; +import { CursorTimeoutContext } from '../cursor/abstract_cursor'; +import { getSocks, type SocksLib } from '../deps'; +import { MongoOperationTimeoutError } from '../error'; +import { type MongoClient } from '../mongo_client'; +import { type Abortable } from '../mongo_types'; +import { type CollectionInfo } from '../operations/list_collections'; +import { Timeout, type TimeoutContext, TimeoutError } from '../timeout'; +import { + addAbortListener, + BufferPool, + kDispose, + MongoDBCollectionNamespace, + promiseWithResolvers +} from '../utils'; +import { autoSelectSocketOptions, type DataKey } from './client_encryption'; +import { MongoCryptError } from './errors'; +import { + type ClientEncryptionSocketOptions, + type ClientEncryptionTlsOptions, + type CSFLEKMSTlsOptions, + type KMSConnectCallback +} from './kms_options'; +import { type MongocryptdManager } from './mongocryptd_manager'; +import { type KMSProviders } from './providers'; + +let socks: SocksLib | null = null; +function loadSocks(): SocksLib { + if (socks == null) { + const socksImport = getSocks(); + if ('kModuleError' in socksImport) { + throw socksImport.kModuleError; + } + socks = socksImport; + } + return socks; +} + +// libmongocrypt states +const MONGOCRYPT_CTX_ERROR = 0; +const MONGOCRYPT_CTX_NEED_MONGO_COLLINFO = 1; +const MONGOCRYPT_CTX_NEED_MONGO_MARKINGS = 2; +const MONGOCRYPT_CTX_NEED_MONGO_KEYS = 3; +const MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS = 7; +const MONGOCRYPT_CTX_NEED_KMS = 4; +const MONGOCRYPT_CTX_READY = 5; +const MONGOCRYPT_CTX_DONE = 6; + +const HTTPS_PORT = 443; + +const stateToString = new Map([ + [MONGOCRYPT_CTX_ERROR, 'MONGOCRYPT_CTX_ERROR'], + [MONGOCRYPT_CTX_NEED_MONGO_COLLINFO, 'MONGOCRYPT_CTX_NEED_MONGO_COLLINFO'], + [MONGOCRYPT_CTX_NEED_MONGO_MARKINGS, 'MONGOCRYPT_CTX_NEED_MONGO_MARKINGS'], + [MONGOCRYPT_CTX_NEED_MONGO_KEYS, 'MONGOCRYPT_CTX_NEED_MONGO_KEYS'], + [MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS, 'MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS'], + [MONGOCRYPT_CTX_NEED_KMS, 'MONGOCRYPT_CTX_NEED_KMS'], + [MONGOCRYPT_CTX_READY, 'MONGOCRYPT_CTX_READY'], + [MONGOCRYPT_CTX_DONE, 'MONGOCRYPT_CTX_DONE'] +]); + +const INSECURE_TLS_OPTIONS = [ + 'tlsInsecure', + 'tlsAllowInvalidCertificates', + 'tlsAllowInvalidHostnames' +]; + +/** + * Helper function for logging. Enabled by setting the environment flag MONGODB_CRYPT_DEBUG. + * @param msg - Anything you want to be logged. + */ +function debug(msg: unknown) { + if (process.env.MONGODB_CRYPT_DEBUG) { + // eslint-disable-next-line no-console + console.error(msg); + } +} + +declare module 'mongodb-client-encryption' { + // the properties added to `MongoCryptContext` here are only used for the `StateMachine`'s + // execute method and are not part of the C++ bindings. + interface MongoCryptContext { + id: number; + document: Document; + ns: string; + } +} + +/** + * This is kind of a hack. For `rewrapManyDataKey`, we have tests that + * guarantee that when there are no matching keys, `rewrapManyDataKey` returns + * nothing. We also have tests for auto encryption that guarantee for `encrypt` + * we return an error when there are no matching keys. This error is generated in + * subsequent iterations of the state machine. + * Some apis (`encrypt`) throw if there are no filter matches and others (`rewrapManyDataKey`) + * do not. We set the result manually here, and let the state machine continue. `libmongocrypt` + * will inform us if we need to error by setting the state to `MONGOCRYPT_CTX_ERROR` but + * otherwise we'll return `{ v: [] }`. + */ +let EMPTY_V; + +/** + * @internal + * + * An interface representing an object that can be passed to the `StateMachine.execute` method. + * + * Not all properties are required for all operations. + */ +export interface StateMachineExecutable { + _keyVaultNamespace: string; + _keyVaultClient: MongoClient; + askForKMSCredentials: () => Promise; + + /** only used for auto encryption */ + _metaDataClient?: MongoClient; + /** only used for auto encryption */ + _mongocryptdClient?: MongoClient; + /** only used for auto encryption */ + _mongocryptdManager?: MongocryptdManager; +} + +export type StateMachineOptions = { + /** socks5 proxy options, if set. */ + proxyOptions: ProxyOptions; + + /** TLS options for KMS requests, if set. */ + tlsOptions: CSFLEKMSTlsOptions; + + /** Socket specific options we support. */ + socketOptions: ClientEncryptionSocketOptions; + + /** Optional callback that establishes the KMS socket, if set. */ + kmsConnectCallback?: KMSConnectCallback; +} & Pick; + +/** + * @internal + * An internal class that executes across a MongoCryptContext until either + * a finishing state or an error is reached. Do not instantiate directly. + */ +// TODO(DRIVERS-2671): clarify CSOT behavior for FLE APIs +export class StateMachine { + private options: StateMachineOptions; + private bsonOptions: BSONSerializeOptions; + + constructor(options: StateMachineOptions, bsonOptions = pluckBSONSerializeOptions(options)) { + this.options = options; + this.bsonOptions = bsonOptions; + } + + /** + * Executes the state machine according to the specification + */ + async execute( + executor: StateMachineExecutable, + context: MongoCryptContext, + options: { timeoutContext?: TimeoutContext } & Abortable + ): Promise { + const keyVaultNamespace = executor._keyVaultNamespace; + const keyVaultClient = executor._keyVaultClient; + const metaDataClient = executor._metaDataClient; + const mongocryptdClient = executor._mongocryptdClient; + const mongocryptdManager = executor._mongocryptdManager; + let result: Uint8Array | null = null; + + // Typescript treats getters just like properties: Once you've tested it for equality + // it cannot change. Which is exactly the opposite of what we use state and status for. + // Every call to at least `addMongoOperationResponse` and `finalize` can change the state. + // These wrappers let us write code more naturally and not add compiler exceptions + // to conditions checks inside the state machine. + const getStatus = () => context.status; + const getState = () => context.state; + + while (getState() !== MONGOCRYPT_CTX_DONE && getState() !== MONGOCRYPT_CTX_ERROR) { + options.signal?.throwIfAborted(); + debug(`[context#${context.id}] ${stateToString.get(getState()) || getState()}`); + + switch (getState()) { + case MONGOCRYPT_CTX_NEED_MONGO_COLLINFO: { + const filter = deserialize(context.nextMongoOperation()); + if (!metaDataClient) { + throw new MongoCryptError( + 'unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined' + ); + } + + const collInfoCursor = this.fetchCollectionInfo( + metaDataClient, + context.ns, + filter, + options + ); + + for await (const collInfo of collInfoCursor) { + context.addMongoOperationResponse(serialize(collInfo)); + if (getState() === MONGOCRYPT_CTX_ERROR) break; + } + + if (getState() === MONGOCRYPT_CTX_ERROR) break; + + context.finishMongoOperation(); + break; + } + + case MONGOCRYPT_CTX_NEED_MONGO_MARKINGS: { + const command = context.nextMongoOperation(); + if (getState() === MONGOCRYPT_CTX_ERROR) break; + + if (!mongocryptdClient) { + throw new MongoCryptError( + 'unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined' + ); + } + + // When we are using the shared library, we don't have a mongocryptd manager. + const markedCommand: Uint8Array = mongocryptdManager + ? await mongocryptdManager.withRespawn( + this.markCommand.bind(this, mongocryptdClient, context.ns, command, options) + ) + : await this.markCommand(mongocryptdClient, context.ns, command, options); + + context.addMongoOperationResponse(markedCommand); + context.finishMongoOperation(); + break; + } + + case MONGOCRYPT_CTX_NEED_MONGO_KEYS: { + const filter = context.nextMongoOperation(); + const keys = await this.fetchKeys(keyVaultClient, keyVaultNamespace, filter, options); + + if (keys.length === 0) { + // See docs on EMPTY_V + result = EMPTY_V ??= serialize({ v: [] }); + } + for (const key of keys) { + context.addMongoOperationResponse(serialize(key)); + } + + context.finishMongoOperation(); + + break; + } + + case MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS: { + const kmsProviders = await executor.askForKMSCredentials(); + context.provideKMSProviders(serialize(kmsProviders)); + break; + } + + case MONGOCRYPT_CTX_NEED_KMS: { + await Promise.all(this.requests(context, options)); + context.finishKMSRequests(); + break; + } + + case MONGOCRYPT_CTX_READY: { + const finalizedContext = context.finalize(); + if (getState() === MONGOCRYPT_CTX_ERROR) { + const message = getStatus().message || 'Finalization error'; + throw new MongoCryptError(message); + } + result = finalizedContext; + break; + } + + default: + throw new MongoCryptError(`Unknown state: ${getState()}`); + } + } + + if (getState() === MONGOCRYPT_CTX_ERROR || result == null) { + const message = getStatus().message; + if (!message) { + debug( + `unidentifiable error in MongoCrypt - received an error status from \`libmongocrypt\` but received no error message.` + ); + } + throw new MongoCryptError( + message ?? + 'unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message.' + ); + } + + return result; + } + + /** + * Handles the request to the KMS service. Exposed for testing purposes. Do not directly invoke. + * @param kmsContext - A C++ KMS context returned from the bindings + * @returns A promise that resolves when the KMS reply has be fully parsed + */ + async kmsRequest( + request: MongoCryptKMSRequest, + options?: { timeoutContext?: TimeoutContext } & Abortable + ): Promise { + const parsedUrl = request.endpoint.split(':'); + const port = parsedUrl[1] != null ? Number.parseInt(parsedUrl[1], 10) : HTTPS_PORT; + const socketOptions: tls.ConnectionOptions & { + host: string; + port: number; + autoSelectFamily?: boolean; + autoSelectFamilyAttemptTimeout?: number; + } = { + host: parsedUrl[0], + servername: parsedUrl[0], + port, + ...autoSelectSocketOptions(this.options.socketOptions || {}) + }; + const message = request.message; + const buffer = new BufferPool(); + + let netSocket: net.Socket; + let socket: tls.TLSSocket; + + function destroySockets() { + for (const sock of [socket, netSocket]) { + if (sock) { + sock.destroy(); + } + } + } + + function onerror(cause: Error) { + return new MongoCryptError('KMS request failed', { cause }); + } + + function onclose() { + return new MongoCryptError('KMS request closed'); + } + + const tlsOptions = this.options.tlsOptions; + if (tlsOptions) { + const kmsProvider = request.kmsProvider; + const providerTlsOptions = tlsOptions[kmsProvider]; + if (providerTlsOptions) { + const error = this.validateTlsOptions(kmsProvider, providerTlsOptions); + if (error) { + throw error; + } + try { + await this.setTlsOptions(providerTlsOptions, socketOptions); + } catch (err) { + throw onerror(err); + } + } + } + + let abortListener; + let kmsRequestTimeout: Timeout | undefined; + + try { + options?.signal?.throwIfAborted(); + + if (this.options.kmsConnectCallback) { + const remainingTimeMS = options?.timeoutContext?.csotEnabled() + ? options.timeoutContext.getRemainingTimeMSOrThrow( + `KMS request timed out after ${options.timeoutContext.timeoutMS}ms` + ) + : undefined; + // A non-finite budget (timeoutMS: 0) means no timeout; otherwise back the callback with one. + const timeoutMS = Number.isFinite(remainingTimeMS) ? remainingTimeMS : undefined; + const controller = new AbortController(); + // Forward the operation's own abort signal so aborting the operation also aborts the callback. + const forwardAbort = addAbortListener(options?.signal, function () { + controller.abort(this.reason); + }); + const connectPromise = this.options.kmsConnectCallback({ + host: socketOptions.host, + port: socketOptions.port, + timeoutMS, + signal: controller.signal + }); + // If the callback resolves a socket after we already aborted, close it so it does not leak. + connectPromise.then( + resolvedSocket => { + if (controller.signal.aborted) resolvedSocket.destroy(); + }, + () => null + ); + const timeout = timeoutMS ? Timeout.expires(timeoutMS) : undefined; + try { + socketOptions.socket = timeout + ? await Promise.race([connectPromise, timeout]) + : await connectPromise; + } catch (err) { + if (TimeoutError.is(err)) { + const timeoutError = new MongoOperationTimeoutError('KMS request timed out'); + // Abort with the timeout error as the reason so the callback sees it on `signal.reason`. + controller.abort(timeoutError); + throw timeoutError; + } + throw onerror(err); + } finally { + timeout?.clear(); + forwardAbort?.[kDispose](); + } + } else if (this.options.proxyOptions && this.options.proxyOptions.proxyHost) { + netSocket = new net.Socket(); + + const { + promise: willConnect, + reject: rejectOnNetSocketError, + resolve: resolveOnNetSocketConnect + } = promiseWithResolvers(); + + netSocket + .once('error', err => rejectOnNetSocketError(onerror(err))) + .once('close', () => rejectOnNetSocketError(onclose())) + .once('connect', () => resolveOnNetSocketConnect()); + + const netSocketOptions = { + ...socketOptions, + host: this.options.proxyOptions.proxyHost, + port: this.options.proxyOptions.proxyPort || 1080 + }; + + netSocket.connect(netSocketOptions); + + await willConnect; + + try { + socks ??= loadSocks(); + socketOptions.socket = ( + await socks.SocksClient.createConnection({ + existing_socket: netSocket, + command: 'connect', + destination: { host: socketOptions.host, port: socketOptions.port }, + proxy: { + // host and port are ignored because we pass existing_socket + host: 'iLoveJavaScript', + port: 0, + type: 5, + userId: this.options.proxyOptions.proxyUsername, + password: this.options.proxyOptions.proxyPassword + } + }) + ).socket; + } catch (err) { + throw onerror(err); + } + } + + socket = tls.connect(socketOptions, () => { + socket.write(message); + }); + + const { + promise: willResolveKmsRequest, + reject: rejectOnTlsSocketError, + resolve + } = promiseWithResolvers(); + + abortListener = addAbortListener(options?.signal, function () { + destroySockets(); + rejectOnTlsSocketError(this.reason); + }); + + socket + .once('error', err => rejectOnTlsSocketError(onerror(err))) + .once('close', () => rejectOnTlsSocketError(onclose())) + .on('data', data => { + buffer.append(data); + while (request.bytesNeeded > 0 && buffer.length) { + const bytesNeeded = Math.min(request.bytesNeeded, buffer.length); + request.addResponse(buffer.read(bytesNeeded)); + } + + if (request.bytesNeeded <= 0) { + resolve(); + } + }); + const remainingTimeMS = options?.timeoutContext?.csotEnabled() + ? options.timeoutContext.getRemainingTimeMSOrThrow( + `KMS request timed out after ${options.timeoutContext.timeoutMS}ms` + ) + : undefined; + const timeoutMS = Number.isFinite(remainingTimeMS) ? remainingTimeMS : undefined; + kmsRequestTimeout = timeoutMS ? Timeout.expires(timeoutMS) : undefined; + await (kmsRequestTimeout + ? Promise.race([willResolveKmsRequest, kmsRequestTimeout]) + : willResolveKmsRequest); + } catch (error) { + if (TimeoutError.is(error)) throw new MongoOperationTimeoutError('KMS request timed out'); + throw error; + } finally { + // There's no need for any more activity on this socket at this point. + destroySockets(); + abortListener?.[kDispose](); + kmsRequestTimeout?.clear(); + } + } + + *requests(context: MongoCryptContext, options?: { timeoutContext?: TimeoutContext } & Abortable) { + for ( + let request = context.nextKMSRequest(); + request != null; + request = context.nextKMSRequest() + ) { + yield this.kmsRequest(request, options); + } + } + + /** + * Validates the provided TLS options are secure. + * + * @param kmsProvider - The KMS provider name. + * @param tlsOptions - The client TLS options for the provider. + * + * @returns An error if any option is invalid. + */ + validateTlsOptions( + kmsProvider: string, + tlsOptions: ClientEncryptionTlsOptions + ): MongoCryptError | void { + const tlsOptionNames = Object.keys(tlsOptions); + for (const option of INSECURE_TLS_OPTIONS) { + if (tlsOptionNames.includes(option)) { + return new MongoCryptError(`Insecure TLS options prohibited for ${kmsProvider}: ${option}`); + } + } + } + + /** + * Sets only the valid secure TLS options. + * + * @param tlsOptions - The client TLS options for the provider. + * @param options - The existing connection options. + */ + async setTlsOptions( + tlsOptions: ClientEncryptionTlsOptions, + options: tls.ConnectionOptions + ): Promise { + // If a secureContext is provided, ensure it is set. + if (tlsOptions.secureContext) { + options.secureContext = tlsOptions.secureContext; + } + if (tlsOptions.tlsCertificateKeyFile) { + const cert = await fs.readFile(tlsOptions.tlsCertificateKeyFile); + options.cert = options.key = cert; + } + if (tlsOptions.tlsCAFile) { + options.ca = await fs.readFile(tlsOptions.tlsCAFile); + } + if (tlsOptions.tlsCertificateKeyFilePassword) { + options.passphrase = tlsOptions.tlsCertificateKeyFilePassword; + } + } + + /** + * Fetches collection info for a provided namespace, when libmongocrypt + * enters the `MONGOCRYPT_CTX_NEED_MONGO_COLLINFO` state. The result is + * used to inform libmongocrypt of the schema associated with this + * namespace. Exposed for testing purposes. Do not directly invoke. + * + * @param client - A MongoClient connected to the topology + * @param ns - The namespace to list collections from + * @param filter - A filter for the listCollections command + * @param callback - Invoked with the info of the requested collection, or with an error + */ + fetchCollectionInfo( + client: MongoClient, + ns: string, + filter: Document, + options?: { timeoutContext?: TimeoutContext } & Abortable + ): AsyncIterable { + const { db } = MongoDBCollectionNamespace.fromString(ns); + + const cursor = client.db(db).listCollections(filter, { + promoteLongs: false, + promoteValues: false, + timeoutContext: + options?.timeoutContext && new CursorTimeoutContext(options?.timeoutContext, Symbol()), + signal: options?.signal, + nameOnly: false + }); + + return cursor; + } + + /** + * Calls to the mongocryptd to provide markings for a command. + * Exposed for testing purposes. Do not directly invoke. + * @param client - A MongoClient connected to a mongocryptd + * @param ns - The namespace (database.collection) the command is being executed on + * @param command - The command to execute. + * @param callback - Invoked with the serialized and marked bson command, or with an error + */ + async markCommand( + client: MongoClient, + ns: string, + command: Uint8Array, + options?: { timeoutContext?: TimeoutContext } & Abortable + ): Promise { + const { db } = MongoDBCollectionNamespace.fromString(ns); + const bsonOptions = { promoteLongs: false, promoteValues: false }; + const rawCommand = deserialize(command, bsonOptions); + + const commandOptions: { + timeoutMS?: number; + signal?: AbortSignal; + } = { + timeoutMS: undefined, + signal: undefined + }; + + if (options?.timeoutContext?.csotEnabled()) { + commandOptions.timeoutMS = options.timeoutContext.remainingTimeMS; + } + if (options?.signal) { + commandOptions.signal = options.signal; + } + + const response = await client.db(db).command(rawCommand, { + ...bsonOptions, + ...commandOptions + }); + + return serialize(response, this.bsonOptions); + } + + /** + * Requests keys from the keyVault collection on the topology. + * Exposed for testing purposes. Do not directly invoke. + * @param client - A MongoClient connected to the topology + * @param keyVaultNamespace - The namespace (database.collection) of the keyVault Collection + * @param filter - The filter for the find query against the keyVault Collection + * @param callback - Invoked with the found keys, or with an error + */ + fetchKeys( + client: MongoClient, + keyVaultNamespace: string, + filter: Uint8Array, + options?: { timeoutContext?: TimeoutContext } & Abortable + ): Promise> { + const { db: dbName, collection: collectionName } = + MongoDBCollectionNamespace.fromString(keyVaultNamespace); + + const commandOptions: { + timeoutContext?: CursorTimeoutContext; + signal?: AbortSignal; + } = { + timeoutContext: undefined, + signal: undefined + }; + + if (options?.timeoutContext != null) { + commandOptions.timeoutContext = new CursorTimeoutContext(options.timeoutContext, Symbol()); + } + if (options?.signal != null) { + commandOptions.signal = options.signal; + } + + return client + .db(dbName) + .collection(collectionName, { readConcern: { level: 'majority' } }) + .find(deserialize(filter), commandOptions) + .toArray(); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/auth_provider.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/auth_provider.ts new file mode 100644 index 00000000..d39de650 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/auth_provider.ts @@ -0,0 +1,77 @@ +import type { Document } from '../../bson'; +import { MongoRuntimeError } from '../../error'; +import type { HandshakeDocument } from '../connect'; +import type { Connection, ConnectionOptions } from '../connection'; +import type { MongoCredentials } from './mongo_credentials'; + +/** + * Context used during authentication + * @internal + */ +export class AuthContext { + /** The connection to authenticate */ + connection: Connection; + /** The credentials to use for authentication */ + credentials?: MongoCredentials; + /** If the context is for reauthentication. */ + reauthenticating = false; + /** The options passed to the `connect` method */ + options: ConnectionOptions; + + /** A response from an initial auth attempt, only some mechanisms use this (e.g, SCRAM) */ + response?: Document; + /** A random nonce generated for use in an authentication conversation */ + nonce?: Uint8Array; + + constructor( + connection: Connection, + credentials: MongoCredentials | undefined, + options: ConnectionOptions + ) { + this.connection = connection; + this.credentials = credentials; + this.options = options; + } +} + +/** + * Provider used during authentication. + * @internal + */ +export abstract class AuthProvider { + /** + * Prepare the handshake document before the initial handshake. + * + * @param handshakeDoc - The document used for the initial handshake on a connection + * @param authContext - Context for authentication flow + */ + async prepare( + handshakeDoc: HandshakeDocument, + _authContext: AuthContext + ): Promise { + return handshakeDoc; + } + + /** + * Authenticate + * + * @param context - A shared context for authentication flow + */ + abstract auth(context: AuthContext): Promise; + + /** + * Reauthenticate. + * @param context - The shared auth context. + */ + async reauth(context: AuthContext): Promise { + if (context.reauthenticating) { + throw new MongoRuntimeError('Reauthentication already in progress.'); + } + try { + context.reauthenticating = true; + await this.auth(context); + } finally { + context.reauthenticating = false; + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws4.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws4.ts new file mode 100644 index 00000000..522fbe2b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws4.ts @@ -0,0 +1,207 @@ +import { ByteUtils } from '../../bson'; +import { type AWSCredentials } from '../../deps'; + +export type AwsSigv4Options = { + path: '/'; + body: string; + host: string; + method: 'POST'; + headers: { + 'Content-Type': 'application/x-www-form-urlencoded'; + 'Content-Length': number; + 'X-MongoDB-Server-Nonce': string; + 'X-MongoDB-GS2-CB-Flag': 'n'; + }; + service: string; + region: string; + date: Date; +}; + +export type SignedHeaders = { + Authorization: string; + 'X-Amz-Date': string; +}; + +/** + * Calculates the SHA-256 hash of a string. + * + * @param str - String to hash. + * @returns Hexadecimal representation of the hash. + */ +const getHexSha256 = async (str: string): Promise => { + const data = stringToBuffer(str); + const hashBuffer = await crypto.subtle.digest('SHA-256', data); + const hashHex = ByteUtils.toHex(new Uint8Array(hashBuffer)); + return hashHex; +}; + +/** + * Calculates the HMAC-SHA256 of a string using the provided key. + * @param key - Key to use for HMAC calculation. Can be a string or Uint8Array. + * @param str - String to calculate HMAC for. + * @returns Uint8Array containing the HMAC-SHA256 digest. + */ +const getHmacSha256 = async (key: string | Uint8Array, str: string): Promise => { + let keyData: Uint8Array; + if (typeof key === 'string') { + keyData = stringToBuffer(key); + } else { + keyData = key; + } + + const importedKey = await crypto.subtle.importKey( + 'raw', + keyData, + { name: 'HMAC', hash: { name: 'SHA-256' } }, + false, + ['sign'] + ); + const strData = stringToBuffer(str); + const signature = await crypto.subtle.sign('HMAC', importedKey, strData); + const digest = new Uint8Array(signature); + return digest; +}; + +/** + * Converts header values according to AWS requirements, + * From https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html#create-canonical-request + * For values, you must: + - trim any leading or trailing spaces. + - convert sequential spaces to a single space. + * @param value - Header value to convert. + * @returns - Converted header value. + */ +const convertHeaderValue = (value: string | number) => { + return value.toString().trim().replace(/\s+/g, ' '); +}; + +/** + * Returns a Uint8Array representation of a string, encoded in UTF-8. + * @param str - String to convert. + * @returns Uint8Array containing the UTF-8 encoded string. + */ +function stringToBuffer(str: string): Uint8Array { + const data = new Uint8Array(ByteUtils.utf8ByteLength(str)); + ByteUtils.encodeUTF8Into(data, str, 0); + return data; +} + +/** + * This method implements AWS Signature 4 logic for a very specific request format. + * The signing logic is described here: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html + */ +export async function aws4Sign( + options: AwsSigv4Options, + credentials: AWSCredentials +): Promise { + /** + * From the spec: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html + * + * Summary of signing steps + * 1. Create a canonical request + * Arrange the contents of your request (host, action, headers, etc.) into a standard canonical format. The canonical request is one of the inputs used to create the string to sign. + * 2. Create a hash of the canonical request + * Hash the canonical request using the same algorithm that you used to create the hash of the payload. The hash of the canonical request is a string of lowercase hexadecimal characters. + * 3. Create a string to sign + * Create a string to sign with the canonical request and extra information such as the algorithm, request date, credential scope, and the hash of the canonical request. + * 4. Derive a signing key + * Use the secret access key to derive the key used to sign the request. + * 5. Calculate the signature + * Perform a keyed hash operation on the string to sign using the derived signing key as the hash key. + * 6. Add the signature to the request + * Add the calculated signature to an HTTP header or to the query string of the request. + */ + + // 1: Create a canonical request + + // Date – The date and time used to sign the request. + const date = options.date; + // RequestDateTime – The date and time used in the credential scope. This value is the current UTC time in ISO 8601 format (for example, 20130524T000000Z). + const requestDateTime = date.toISOString().replace(/[:-]|\.\d{3}/g, ''); + // RequestDate – The date used in the credential scope. This value is the current UTC date in YYYYMMDD format (for example, 20130524). + const requestDate = requestDateTime.substring(0, 8); + // Method – The HTTP request method. For us, this is always 'POST'. + const method = options.method; + // CanonicalUri – The URI-encoded version of the absolute path component URI, starting with the / that follows the domain name and up to the end of the string + // For our requests, this is always '/' + const canonicalUri = options.path; + // CanonicalQueryString – The URI-encoded query string parameters. For our requests, there are no query string parameters, so this is always an empty string. + const canonicalQuerystring = ''; + + // CanonicalHeaders – A list of request headers with their values. Individual header name and value pairs are separated by the newline character ("\n"). + // All of our known/expected headers are included here, there are no extra headers. + const headers = new Headers({ + 'content-length': convertHeaderValue(options.headers['Content-Length']), + 'content-type': convertHeaderValue(options.headers['Content-Type']), + host: convertHeaderValue(options.host), + 'x-amz-date': convertHeaderValue(requestDateTime), + 'x-mongodb-gs2-cb-flag': convertHeaderValue(options.headers['X-MongoDB-GS2-CB-Flag']), + 'x-mongodb-server-nonce': convertHeaderValue(options.headers['X-MongoDB-Server-Nonce']) + }); + // If session token is provided, include it in the headers + if ('sessionToken' in credentials && credentials.sessionToken) { + headers.append('x-amz-security-token', convertHeaderValue(credentials.sessionToken)); + } + + // Canonical headers are lowercased and sorted. + const canonicalHeaders = Array.from(headers.entries()) + .map(([key, value]) => `${key.toLowerCase()}:${value}`) + .sort() + .join('\n'); + const canonicalHeaderNames = Array.from(headers.keys()).map(header => header.toLowerCase()); + // SignedHeaders – An alphabetically sorted, semicolon-separated list of lowercase request header names. + const signedHeaders = canonicalHeaderNames.sort().join(';'); + + // HashedPayload – A string created using the payload in the body of the HTTP request as input to a hash function. This string uses lowercase hexadecimal characters. + const hashedPayload = await getHexSha256(options.body); + + // CanonicalRequest – A string that includes the above elements, separated by newline characters. + const canonicalRequest = [ + method, + canonicalUri, + canonicalQuerystring, + canonicalHeaders + '\n', + signedHeaders, + hashedPayload + ].join('\n'); + + // 2. Create a hash of the canonical request + // HashedCanonicalRequest – A string created by using the canonical request as input to a hash function. + const hashedCanonicalRequest = await getHexSha256(canonicalRequest); + + // 3. Create a string to sign + // Algorithm – The algorithm used to create the hash of the canonical request. For SigV4, use AWS4-HMAC-SHA256. + const algorithm = 'AWS4-HMAC-SHA256'; + // CredentialScope – The credential scope, which restricts the resulting signature to the specified Region and service. + // Has the following format: YYYYMMDD/region/service/aws4_request. + const credentialScope = `${requestDate}/${options.region}/${options.service}/aws4_request`; + // StringToSign – A string that includes the above elements, separated by newline characters. + const stringToSign = [algorithm, requestDateTime, credentialScope, hashedCanonicalRequest].join( + '\n' + ); + + // 4. Derive a signing key + // To derive a signing key for SigV4, perform a succession of keyed hash operations (HMAC) on the request date, Region, and service, with your AWS secret access key as the key for the initial hashing operation. + const dateKey = await getHmacSha256('AWS4' + credentials.secretAccessKey, requestDate); + const dateRegionKey = await getHmacSha256(dateKey, options.region); + const dateRegionServiceKey = await getHmacSha256(dateRegionKey, options.service); + const signingKey = await getHmacSha256(dateRegionServiceKey, 'aws4_request'); + + // 5. Calculate the signature + const signatureBuffer = await getHmacSha256(signingKey, stringToSign); + const signature = ByteUtils.toHex(signatureBuffer); + + // 6. Add the signature to the request + // Calculate the Authorization header + const authorizationHeader = [ + 'AWS4-HMAC-SHA256 Credential=' + credentials.accessKeyId + '/' + credentialScope, + 'SignedHeaders=' + signedHeaders, + 'Signature=' + signature + ].join(', '); + + // Return the calculated headers + return { + Authorization: authorizationHeader, + 'X-Amz-Date': requestDateTime + }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws_temporary_credentials.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws_temporary_credentials.ts new file mode 100644 index 00000000..13d23a5a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/aws_temporary_credentials.ts @@ -0,0 +1,129 @@ +import * as process from 'process'; + +import { type AWSCredentials, getAwsCredentialProvider } from '../../deps'; +import { MongoAWSError } from '../../error'; + +/** + * @internal + * This interface matches the final result of fetching temporary credentials manually, outlined + * in the spec [here](https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#ec2-endpoint). + * + * When we use the AWS SDK, we map the response from the SDK to conform to this interface. + */ +export interface AWSTempCredentials { + AccessKeyId?: string; + SecretAccessKey?: string; + Token?: string; + RoleArn?: string; + Expiration?: Date; +} + +/** @public **/ +export type AWSCredentialProvider = () => Promise; + +/** @internal */ +export class AWSSDKCredentialProvider { + private static _awsSDK: ReturnType; + private _provider?: AWSCredentialProvider; + + /** + * Create the SDK credentials provider. + * @param credentialsProvider - The credentials provider. + */ + constructor(credentialsProvider?: AWSCredentialProvider) { + if (credentialsProvider) { + this._provider = credentialsProvider; + } + } + + static get awsSDK() { + AWSSDKCredentialProvider._awsSDK ??= getAwsCredentialProvider(); + return AWSSDKCredentialProvider._awsSDK; + } + + /** + * The AWS SDK caches credentials automatically and handles refresh when the credentials have expired. + * To ensure this occurs, we need to cache the `provider` returned by the AWS sdk and re-use it when fetching credentials. + */ + private get provider(): () => Promise { + if ('kModuleError' in AWSSDKCredentialProvider.awsSDK) { + throw AWSSDKCredentialProvider.awsSDK.kModuleError; + } + if (this._provider) { + return this._provider; + } + let { AWS_STS_REGIONAL_ENDPOINTS = '', AWS_REGION = '' } = process.env; + AWS_STS_REGIONAL_ENDPOINTS = AWS_STS_REGIONAL_ENDPOINTS.toLowerCase(); + AWS_REGION = AWS_REGION.toLowerCase(); + + /** The option setting should work only for users who have explicit settings in their environment, the driver should not encode "defaults" */ + const awsRegionSettingsExist = + AWS_REGION.length !== 0 && AWS_STS_REGIONAL_ENDPOINTS.length !== 0; + + /** + * The following regions use the global AWS STS endpoint, sts.amazonaws.com, by default + * https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html + */ + const LEGACY_REGIONS = new Set([ + 'ap-northeast-1', + 'ap-south-1', + 'ap-southeast-1', + 'ap-southeast-2', + 'aws-global', + 'ca-central-1', + 'eu-central-1', + 'eu-north-1', + 'eu-west-1', + 'eu-west-2', + 'eu-west-3', + 'sa-east-1', + 'us-east-1', + 'us-east-2', + 'us-west-1', + 'us-west-2' + ]); + /** + * If AWS_STS_REGIONAL_ENDPOINTS is set to regional, users are opting into the new behavior of respecting the region settings + * + * If AWS_STS_REGIONAL_ENDPOINTS is set to legacy, then "old" regions need to keep using the global setting. + * Technically the SDK gets this wrong, it reaches out to 'sts.us-east-1.amazonaws.com' when it should be 'sts.amazonaws.com'. + * That is not our bug to fix here. We leave that up to the SDK. + */ + const useRegionalSts = + AWS_STS_REGIONAL_ENDPOINTS === 'regional' || + (AWS_STS_REGIONAL_ENDPOINTS === 'legacy' && !LEGACY_REGIONS.has(AWS_REGION)); + + this._provider = + awsRegionSettingsExist && useRegionalSts + ? AWSSDKCredentialProvider.awsSDK.fromNodeProviderChain({ + clientConfig: { region: AWS_REGION } + }) + : AWSSDKCredentialProvider.awsSDK.fromNodeProviderChain(); + + return this._provider; + } + + async getCredentials(): Promise { + /* + * Creates a credential provider that will attempt to find credentials from the + * following sources (listed in order of precedence): + * + * - Environment variables exposed via process.env + * - SSO credentials from token cache + * - Web identity token credentials + * - Shared credentials and config ini files + * - The EC2/ECS Instance Metadata Service + */ + try { + const creds = await this.provider(); + return { + AccessKeyId: creds.accessKeyId, + SecretAccessKey: creds.secretAccessKey, + Token: creds.sessionToken, + Expiration: creds.expiration + }; + } catch (error) { + throw new MongoAWSError(error.message, { cause: error }); + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/gssapi.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/gssapi.ts new file mode 100644 index 00000000..99892a33 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/gssapi.ts @@ -0,0 +1,205 @@ +import * as dns from 'dns'; + +import { getKerberos, type Kerberos, type KerberosClient } from '../../deps'; +import { MongoInvalidArgumentError, MongoMissingCredentialsError } from '../../error'; +import { ns } from '../../utils'; +import type { Connection } from '../connection'; +import { type AuthContext, AuthProvider } from './auth_provider'; + +/** @public */ +export const GSSAPICanonicalizationValue = Object.freeze({ + on: true, + off: false, + none: 'none', + forward: 'forward', + forwardAndReverse: 'forwardAndReverse' +} as const); + +/** @public */ +export type GSSAPICanonicalizationValue = + (typeof GSSAPICanonicalizationValue)[keyof typeof GSSAPICanonicalizationValue]; + +type MechanismProperties = { + CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue; + SERVICE_HOST?: string; + SERVICE_NAME?: string; + SERVICE_REALM?: string; +}; + +async function externalCommand( + connection: Connection, + command: ReturnType | ReturnType +): Promise<{ payload: string; conversationId: number }> { + const response = await connection.command(ns('$external.$cmd'), command); + return response as { payload: string; conversationId: number }; +} + +let krb: Kerberos; + +export class GSSAPI extends AuthProvider { + override async auth(authContext: AuthContext): Promise { + const { connection, credentials } = authContext; + if (credentials == null) { + throw new MongoMissingCredentialsError('Credentials required for GSSAPI authentication'); + } + + const { username } = credentials; + + const client = await makeKerberosClient(authContext); + + const payload = await client.step(''); + + const saslStartResponse = await externalCommand(connection, saslStart(payload)); + + const negotiatedPayload = await negotiate(client, 10, saslStartResponse.payload); + + const saslContinueResponse = await externalCommand( + connection, + saslContinue(negotiatedPayload, saslStartResponse.conversationId) + ); + + const finalizePayload = await finalize(client, username, saslContinueResponse.payload); + + await externalCommand(connection, { + saslContinue: 1, + conversationId: saslContinueResponse.conversationId, + payload: finalizePayload + }); + } +} + +async function makeKerberosClient({ + options: { hostAddress, runtime }, + credentials +}: AuthContext): Promise { + if (!hostAddress || typeof hostAddress.host !== 'string' || !credentials) { + throw new MongoInvalidArgumentError( + 'Connection must have host and port and credentials defined.' + ); + } + + const { os } = await runtime; + + loadKrb(); + if ('kModuleError' in krb) { + throw krb['kModuleError']; + } + const { initializeClient } = krb; + + const { username, password } = credentials; + const mechanismProperties = credentials.mechanismProperties as MechanismProperties; + + const serviceName = mechanismProperties.SERVICE_NAME ?? 'mongodb'; + + const host = await performGSSAPICanonicalizeHostName(hostAddress.host, mechanismProperties); + + const initOptions = {}; + if (password != null) { + // TODO(NODE-5139): These do not match the typescript options in initializeClient + Object.assign(initOptions, { user: username, password: password }); + } + + const spnHost = mechanismProperties.SERVICE_HOST ?? host; + let spn = `${serviceName}${os.platform() === 'win32' ? '/' : '@'}${spnHost}`; + if ('SERVICE_REALM' in mechanismProperties) { + spn = `${spn}@${mechanismProperties.SERVICE_REALM}`; + } + + return await initializeClient(spn, initOptions); +} + +function saslStart(payload: string) { + return { + saslStart: 1, + mechanism: 'GSSAPI', + payload, + autoAuthorize: 1 + } as const; +} + +function saslContinue(payload: string, conversationId: number) { + return { + saslContinue: 1, + conversationId, + payload + } as const; +} + +async function negotiate( + client: KerberosClient, + retries: number, + payload: string +): Promise { + try { + const response = await client.step(payload); + return response || ''; + } catch (error) { + if (retries === 0) { + // Retries exhausted, raise error + throw error; + } + // Adjust number of retries and call step again + return await negotiate(client, retries - 1, payload); + } +} + +async function finalize(client: KerberosClient, user: string, payload: string): Promise { + // GSS Client Unwrap + const response = await client.unwrap(payload); + return await client.wrap(response || '', { user }); +} + +export async function performGSSAPICanonicalizeHostName( + host: string, + mechanismProperties: MechanismProperties +): Promise { + const mode = mechanismProperties.CANONICALIZE_HOST_NAME; + if (!mode || mode === GSSAPICanonicalizationValue.none) { + return host; + } + + // If forward and reverse or true + if ( + mode === GSSAPICanonicalizationValue.on || + mode === GSSAPICanonicalizationValue.forwardAndReverse + ) { + // Perform the lookup of the ip address. + const { address } = await dns.promises.lookup(host); + + try { + // Perform a reverse ptr lookup on the ip address. + const results = await dns.promises.resolve(address, 'PTR'); + // If the ptr did not error but had no results, return the host. + return results.length > 0 ? results[0] : host; + } catch { + // This can error as ptr records may not exist for all ips. In this case + // fallback to a cname lookup as dns.lookup() does not return the + // cname. + return await resolveCname(host); + } + } else { + // The case for forward is just to resolve the cname as dns.lookup() + // will not return it. + return await resolveCname(host); + } +} + +export async function resolveCname(host: string): Promise { + // Attempt to resolve the host name + try { + const results = await dns.promises.resolve(host, 'CNAME'); + // Get the first resolved host id + return results.length > 0 ? results[0] : host; + } catch { + return host; + } +} + +/** + * Load the Kerberos library. + */ +function loadKrb() { + if (!krb) { + krb = getKerberos(); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts new file mode 100644 index 00000000..6889414e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts @@ -0,0 +1,291 @@ +// Resolves the default auth mechanism according to +// Resolves the default auth mechanism according to +import type { Document } from '../../bson'; +import { + MongoAPIError, + MongoInvalidArgumentError, + MongoMissingCredentialsError +} from '../../error'; +import type { AWSCredentialProvider } from './aws_temporary_credentials'; +import { GSSAPICanonicalizationValue } from './gssapi'; +import type { OIDCCallbackFunction } from './mongodb_oidc'; +import { AUTH_MECHS_AUTH_SRC_EXTERNAL, AuthMechanism } from './providers'; + +/** + * @see https://github.com/mongodb/specifications/blob/master/source/auth/auth.md + */ +function getDefaultAuthMechanism(hello: Document | null): AuthMechanism { + if (hello) { + // If hello contains saslSupportedMechs, use scram-sha-256 + // if it is available, else scram-sha-1 + if (Array.isArray(hello.saslSupportedMechs)) { + return hello.saslSupportedMechs.includes(AuthMechanism.MONGODB_SCRAM_SHA256) + ? AuthMechanism.MONGODB_SCRAM_SHA256 + : AuthMechanism.MONGODB_SCRAM_SHA1; + } + } + + return AuthMechanism.MONGODB_SCRAM_SHA256; +} + +const ALLOWED_ENVIRONMENT_NAMES: AuthMechanismProperties['ENVIRONMENT'][] = [ + 'test', + 'azure', + 'gcp', + 'k8s' +]; +const ALLOWED_HOSTS_ERROR = 'Auth mechanism property ALLOWED_HOSTS must be an array of strings.'; + +/** @internal */ +export const DEFAULT_ALLOWED_HOSTS = [ + '*.mongodb.net', + '*.mongodb-qa.net', + '*.mongodb-dev.net', + '*.mongodbgov.net', + 'localhost', + '127.0.0.1', + '::1', + '*.mongo.com' +]; + +/** Error for when the token audience is missing in the environment. */ +const TOKEN_RESOURCE_MISSING_ERROR = + 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.'; + +/** @public */ +export interface AuthMechanismProperties extends Document { + SERVICE_HOST?: string; + SERVICE_NAME?: string; + SERVICE_REALM?: string; + CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue; + /** @internal */ + AWS_SESSION_TOKEN?: string; + /** A user provided OIDC machine callback function. */ + OIDC_CALLBACK?: OIDCCallbackFunction; + /** A user provided OIDC human interacted callback function. */ + OIDC_HUMAN_CALLBACK?: OIDCCallbackFunction; + /** The OIDC environment. Note that 'test' is for internal use only. */ + ENVIRONMENT?: 'test' | 'azure' | 'gcp' | 'k8s'; + /** Allowed hosts that OIDC auth can connect to. */ + ALLOWED_HOSTS?: string[]; + /** The resource token for OIDC auth in Azure and GCP. */ + TOKEN_RESOURCE?: string; + /** + * A custom AWS credential provider to use. An example using the AWS SDK default provider chain: + * + * ```ts + * const client = new MongoClient(process.env.MONGODB_URI, { + * authMechanismProperties: { + * AWS_CREDENTIAL_PROVIDER: fromNodeProviderChain() + * } + * }); + * ``` + * + * Using a custom function that returns AWS credentials: + * + * ```ts + * const client = new MongoClient(process.env.MONGODB_URI, { + * authMechanismProperties: { + * AWS_CREDENTIAL_PROVIDER: async () => { + * return { + * accessKeyId: process.env.ACCESS_KEY_ID, + * secretAccessKey: process.env.SECRET_ACCESS_KEY + * } + * } + * } + * }); + * ``` + */ + AWS_CREDENTIAL_PROVIDER?: AWSCredentialProvider; +} + +/** @public */ +export interface MongoCredentialsOptions { + username?: string; + password: string; + source: string; + db?: string; + mechanism?: AuthMechanism; + mechanismProperties: AuthMechanismProperties; +} + +/** + * A representation of the credentials used by MongoDB + * @public + */ +export class MongoCredentials { + /** The username used for authentication */ + readonly username: string; + /** The password used for authentication */ + readonly password: string; + /** The database that the user should authenticate against */ + readonly source: string; + /** The method used to authenticate */ + readonly mechanism: AuthMechanism; + /** Special properties used by some types of auth mechanisms */ + readonly mechanismProperties: AuthMechanismProperties; + + constructor(options: MongoCredentialsOptions) { + this.username = options.username ?? ''; + this.password = options.password; + this.source = options.source; + if (!this.source && options.db) { + this.source = options.db; + } + this.mechanism = options.mechanism || AuthMechanism.MONGODB_DEFAULT; + this.mechanismProperties = options.mechanismProperties || {}; + + if (this.mechanism === AuthMechanism.MONGODB_OIDC && !this.mechanismProperties.ALLOWED_HOSTS) { + this.mechanismProperties = { + ...this.mechanismProperties, + ALLOWED_HOSTS: DEFAULT_ALLOWED_HOSTS + }; + } + + Object.freeze(this.mechanismProperties); + Object.freeze(this); + } + + /** Determines if two MongoCredentials objects are equivalent */ + equals(other: MongoCredentials): boolean { + return ( + this.mechanism === other.mechanism && + this.username === other.username && + this.password === other.password && + this.source === other.source + ); + } + + /** + * If the authentication mechanism is set to "default", resolves the authMechanism + * based on the server version and server supported sasl mechanisms. + * + * @param hello - A hello response from the server + */ + resolveAuthMechanism(hello: Document | null): MongoCredentials { + // If the mechanism is not "default", then it does not need to be resolved + if (this.mechanism.match(/DEFAULT/i)) { + return new MongoCredentials({ + username: this.username, + password: this.password, + source: this.source, + mechanism: getDefaultAuthMechanism(hello), + mechanismProperties: this.mechanismProperties + }); + } + + return this; + } + + validate(): void { + if ( + (this.mechanism === AuthMechanism.MONGODB_GSSAPI || + this.mechanism === AuthMechanism.MONGODB_PLAIN || + this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA1 || + this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA256) && + !this.username + ) { + throw new MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`); + } + + if (this.mechanism === AuthMechanism.MONGODB_OIDC) { + if ( + this.username && + this.mechanismProperties.ENVIRONMENT && + this.mechanismProperties.ENVIRONMENT !== 'azure' + ) { + throw new MongoInvalidArgumentError( + `username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.` + ); + } + + if (this.username && this.password) { + throw new MongoInvalidArgumentError( + `No password is allowed in ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' for '${this.mechanism}'.` + ); + } + + if ( + (this.mechanismProperties.ENVIRONMENT === 'azure' || + this.mechanismProperties.ENVIRONMENT === 'gcp') && + !this.mechanismProperties.TOKEN_RESOURCE + ) { + throw new MongoInvalidArgumentError(TOKEN_RESOURCE_MISSING_ERROR); + } + + if ( + this.mechanismProperties.ENVIRONMENT && + !ALLOWED_ENVIRONMENT_NAMES.includes(this.mechanismProperties.ENVIRONMENT) + ) { + throw new MongoInvalidArgumentError( + `Currently only a ENVIRONMENT in ${ALLOWED_ENVIRONMENT_NAMES.join( + ',' + )} is supported for mechanism '${this.mechanism}'.` + ); + } + + if ( + !this.mechanismProperties.ENVIRONMENT && + !this.mechanismProperties.OIDC_CALLBACK && + !this.mechanismProperties.OIDC_HUMAN_CALLBACK + ) { + throw new MongoInvalidArgumentError( + `Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.` + ); + } + + if (this.mechanismProperties.ALLOWED_HOSTS) { + const hosts = this.mechanismProperties.ALLOWED_HOSTS; + if (!Array.isArray(hosts)) { + throw new MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR); + } + for (const host of hosts) { + if (typeof host !== 'string') { + throw new MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR); + } + } + } + } + + if (AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)) { + if (this.source != null && this.source !== '$external') { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new MongoAPIError( + `Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.` + ); + } + } + + if (this.mechanism === AuthMechanism.MONGODB_PLAIN && this.source == null) { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new MongoAPIError('PLAIN Authentication Mechanism needs an auth source'); + } + + if (this.mechanism === AuthMechanism.MONGODB_X509 && this.password != null) { + if (this.password === '') { + Reflect.set(this, 'password', undefined); + return; + } + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new MongoAPIError(`Password not allowed for mechanism MONGODB-X509`); + } + + const canonicalization = this.mechanismProperties.CANONICALIZE_HOST_NAME ?? false; + if (!Object.values(GSSAPICanonicalizationValue).includes(canonicalization)) { + throw new MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${canonicalization}`); + } + } + + static merge( + creds: MongoCredentials | undefined, + options: Partial + ): MongoCredentials { + return new MongoCredentials({ + username: options.username ?? creds?.username ?? '', + password: options.password ?? creds?.password ?? '', + mechanism: options.mechanism ?? creds?.mechanism ?? AuthMechanism.MONGODB_DEFAULT, + mechanismProperties: options.mechanismProperties ?? creds?.mechanismProperties ?? {}, + source: options.source ?? options.db ?? creds?.source ?? 'admin' + }); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts new file mode 100644 index 00000000..56c1fca7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts @@ -0,0 +1,169 @@ +import { type Binary, type BSONSerializeOptions, ByteUtils } from '../../bson'; +import * as BSON from '../../bson'; +import { MongoMissingCredentialsError, MongoRuntimeError } from '../../error'; +import { ns, randomBytes } from '../../utils'; +import { type AuthContext, AuthProvider } from './auth_provider'; +import { + type AWSCredentialProvider, + AWSSDKCredentialProvider, + type AWSTempCredentials +} from './aws_temporary_credentials'; +import { aws4Sign } from './aws4'; +import { MongoCredentials } from './mongo_credentials'; +import { AuthMechanism } from './providers'; + +const ASCII_N = 110; +const bsonOptions: BSONSerializeOptions = { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false +}; + +interface AWSSaslContinuePayload { + a: string; + d: string; + t?: string; +} + +export class MongoDBAWS extends AuthProvider { + private credentialFetcher: AWSSDKCredentialProvider; + + constructor(credentialProvider?: AWSCredentialProvider) { + super(); + this.credentialFetcher = new AWSSDKCredentialProvider(credentialProvider); + } + + override async auth(authContext: AuthContext): Promise { + const { connection } = authContext; + if (!authContext.credentials) { + throw new MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + + authContext.credentials = await makeTempCredentials( + authContext.credentials, + this.credentialFetcher + ); + + const { credentials } = authContext; + + const accessKeyId = credentials.username; + const secretAccessKey = credentials.password; + // Allow the user to specify an AWS session token for authentication with temporary credentials. + const sessionToken = credentials.mechanismProperties.AWS_SESSION_TOKEN; + + // If all three defined, include sessionToken, else only include username and pass + const awsCredentials = sessionToken + ? { accessKeyId, secretAccessKey, sessionToken } + : { accessKeyId, secretAccessKey }; + + const db = credentials.source; + const nonce = await randomBytes(32); + + // All messages between MongoDB clients and servers are sent as BSON objects + // in the payload field of saslStart and saslContinue. + const saslStart = { + saslStart: 1, + mechanism: 'MONGODB-AWS', + payload: BSON.serialize({ r: nonce, p: ASCII_N }, bsonOptions) + }; + + const saslStartResponse = await connection.command(ns(`${db}.$cmd`), saslStart, undefined); + + const serverResponse = BSON.deserialize(saslStartResponse.payload.buffer, bsonOptions) as { + s: Binary; + h: string; + }; + const host = serverResponse.h; + const serverNonce = serverResponse.s.buffer; + if (serverNonce.length !== 64) { + // TODO(NODE-3483) + throw new MongoRuntimeError(`Invalid server nonce length ${serverNonce.length}, expected 64`); + } + + if (!ByteUtils.equals(serverNonce.subarray(0, nonce.byteLength), nonce)) { + // throw because the serverNonce's leading 32 bytes must equal the client nonce's 32 bytes + // https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#conversation-5 + + // TODO(NODE-3483) + throw new MongoRuntimeError('Server nonce does not begin with client nonce'); + } + + if (host.length < 1 || host.length > 255 || host.indexOf('..') !== -1) { + // TODO(NODE-3483) + throw new MongoRuntimeError(`Server returned an invalid host: "${host}"`); + } + + const body = 'Action=GetCallerIdentity&Version=2011-06-15'; + const headers = await aws4Sign( + { + method: 'POST', + host, + region: deriveRegion(serverResponse.h), + service: 'sts', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': body.length, + 'X-MongoDB-Server-Nonce': ByteUtils.toBase64(serverNonce), + 'X-MongoDB-GS2-CB-Flag': 'n' + }, + path: '/', + body, + date: new Date() + }, + awsCredentials + ); + + const payload: AWSSaslContinuePayload = { + a: headers.Authorization, + d: headers['X-Amz-Date'] + }; + + if (sessionToken) { + payload.t = sessionToken; + } + + const saslContinue = { + saslContinue: 1, + conversationId: saslStartResponse.conversationId, + payload: BSON.serialize(payload, bsonOptions) + }; + + await connection.command(ns(`${db}.$cmd`), saslContinue, undefined); + } +} + +async function makeTempCredentials( + credentials: MongoCredentials, + awsCredentialFetcher: AWSSDKCredentialProvider +): Promise { + function makeMongoCredentialsFromAWSTemp(creds: AWSTempCredentials) { + // The AWS session token (creds.Token) may or may not be set. + if (!creds.AccessKeyId || !creds.SecretAccessKey) { + throw new MongoMissingCredentialsError('Could not obtain temporary MONGODB-AWS credentials'); + } + + return new MongoCredentials({ + username: creds.AccessKeyId, + password: creds.SecretAccessKey, + source: credentials.source, + mechanism: AuthMechanism.MONGODB_AWS, + mechanismProperties: { + AWS_SESSION_TOKEN: creds.Token + } + }); + } + const temporaryCredentials = await awsCredentialFetcher.getCredentials(); + + return makeMongoCredentialsFromAWSTemp(temporaryCredentials); +} + +function deriveRegion(host: string) { + const parts = host.split('.'); + if (parts.length === 1 || parts[1] === 'amazonaws') { + return 'us-east-1'; + } + + return parts[1]; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc.ts new file mode 100644 index 00000000..474f49a8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc.ts @@ -0,0 +1,185 @@ +import type { Document } from '../../bson'; +import { MongoInvalidArgumentError, MongoMissingCredentialsError } from '../../error'; +import type { HandshakeDocument } from '../connect'; +import type { Connection } from '../connection'; +import { type AuthContext, AuthProvider } from './auth_provider'; +import type { MongoCredentials } from './mongo_credentials'; +import { AutomatedCallbackWorkflow } from './mongodb_oidc/automated_callback_workflow'; +import { azureCallback } from './mongodb_oidc/azure_machine_workflow'; +import { gcpCallback } from './mongodb_oidc/gcp_machine_workflow'; +import { k8sCallback } from './mongodb_oidc/k8s_machine_workflow'; +import { TokenCache } from './mongodb_oidc/token_cache'; +import { tokenMachineCallback as testCallback } from './mongodb_oidc/token_machine_workflow'; + +/** Error when credentials are missing. */ +const MISSING_CREDENTIALS_ERROR = 'AuthContext must provide credentials.'; + +/** + * The information returned by the server on the IDP server. + * @public + */ +export interface IdPInfo { + /** + * A URL which describes the Authentication Server. This identifier should + * be the iss of provided access tokens, and be viable for RFC8414 metadata + * discovery and RFC9207 identification. + */ + issuer: string; + /** A unique client ID for this OIDC client. */ + clientId: string; + /** A list of additional scopes to request from IdP. */ + requestScopes?: string[]; +} + +/** + * The response from the IdP server with the access token and + * optional expiration time and refresh token. + * @public + */ +export interface IdPServerResponse { + /** The OIDC access token. */ + accessToken: string; + /** The time when the access token expires. For future use. */ + expiresInSeconds?: number; + /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */ + refreshToken?: string; +} + +/** + * The response required to be returned from the machine or + * human callback workflows' callback. + * @public + */ +export interface OIDCResponse { + /** The OIDC access token. */ + accessToken: string; + /** The time when the access token expires. For future use. */ + expiresInSeconds?: number; + /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */ + refreshToken?: string; +} + +/** + * The parameters that the driver provides to the user supplied + * human or machine callback. + * + * The version number is used to communicate callback API changes that are not breaking but that + * users may want to know about and review their implementation. Users may wish to check the version + * number and throw an error if their expected version number and the one provided do not match. + * @public + */ +export interface OIDCCallbackParams { + /** Optional username. */ + username?: string; + /** The context in which to timeout the OIDC callback. */ + timeoutContext: AbortSignal; + /** The current OIDC API version. */ + version: 1; + /** The IdP information returned from the server. */ + idpInfo?: IdPInfo; + /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */ + refreshToken?: string; + /** The token audience for GCP and Azure. */ + tokenAudience?: string; +} + +/** + * The signature of the human or machine callback functions. + * @public + */ +export type OIDCCallbackFunction = (params: OIDCCallbackParams) => Promise; + +/** The current version of OIDC implementation. */ +export const OIDC_VERSION = 1; + +type EnvironmentName = 'test' | 'azure' | 'gcp' | 'k8s' | undefined; + +/** @internal */ +export interface Workflow { + cache: TokenCache; + + /** + * All device workflows must implement this method in order to get the access + * token and then call authenticate with it. + */ + execute( + connection: Connection, + credentials: MongoCredentials, + response?: Document + ): Promise; + + /** + * Each workflow should specify the correct custom behaviour for reauthentication. + */ + reauthenticate(connection: Connection, credentials: MongoCredentials): Promise; + + /** + * Get the document to add for speculative authentication. + */ + speculativeAuth(connection: Connection, credentials: MongoCredentials): Promise; +} + +/** @internal */ +export const OIDC_WORKFLOWS: Map Workflow> = new Map(); +OIDC_WORKFLOWS.set('test', () => new AutomatedCallbackWorkflow(new TokenCache(), testCallback)); +OIDC_WORKFLOWS.set('azure', () => new AutomatedCallbackWorkflow(new TokenCache(), azureCallback)); +OIDC_WORKFLOWS.set('gcp', () => new AutomatedCallbackWorkflow(new TokenCache(), gcpCallback)); +OIDC_WORKFLOWS.set('k8s', () => new AutomatedCallbackWorkflow(new TokenCache(), k8sCallback)); + +/** + * OIDC auth provider. + */ +export class MongoDBOIDC extends AuthProvider { + workflow: Workflow; + + /** + * Instantiate the auth provider. + */ + constructor(workflow?: Workflow) { + super(); + if (!workflow) { + throw new MongoInvalidArgumentError('No workflow provided to the OIDC auth provider.'); + } + this.workflow = workflow; + } + + /** + * Authenticate using OIDC + */ + override async auth(authContext: AuthContext): Promise { + const { connection, reauthenticating, response } = authContext; + if (response?.speculativeAuthenticate?.done && !reauthenticating) { + return; + } + const credentials = getCredentials(authContext); + if (reauthenticating) { + await this.workflow.reauthenticate(connection, credentials); + } else { + await this.workflow.execute(connection, credentials, response); + } + } + + /** + * Add the speculative auth for the initial handshake. + */ + override async prepare( + handshakeDoc: HandshakeDocument, + authContext: AuthContext + ): Promise { + const { connection } = authContext; + const credentials = getCredentials(authContext); + const result = await this.workflow.speculativeAuth(connection, credentials); + return { ...handshakeDoc, ...result }; + } +} + +/** + * Get credentials from the auth context, throwing if they do not exist. + */ +function getCredentials(authContext: AuthContext): MongoCredentials { + const { credentials } = authContext; + if (!credentials) { + throw new MongoMissingCredentialsError(MISSING_CREDENTIALS_ERROR); + } + return credentials; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/automated_callback_workflow.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/automated_callback_workflow.ts new file mode 100644 index 00000000..1f4947d8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/automated_callback_workflow.ts @@ -0,0 +1,88 @@ +import { MONGODB_ERROR_CODES, MongoError, MongoOIDCError } from '../../../error'; +import { Timeout, TimeoutError } from '../../../timeout'; +import { type Connection } from '../../connection'; +import { type MongoCredentials } from '../mongo_credentials'; +import { + OIDC_VERSION, + type OIDCCallbackFunction, + type OIDCCallbackParams, + type OIDCResponse +} from '../mongodb_oidc'; +import { AUTOMATED_TIMEOUT_MS, CallbackWorkflow } from './callback_workflow'; +import { type TokenCache } from './token_cache'; + +/** + * Class implementing behaviour for the non human callback workflow. + * @internal + */ +export class AutomatedCallbackWorkflow extends CallbackWorkflow { + /** + * Instantiate the human callback workflow. + */ + constructor(cache: TokenCache, callback: OIDCCallbackFunction) { + super(cache, callback); + } + + /** + * Execute the OIDC callback workflow. + */ + async execute(connection: Connection, credentials: MongoCredentials): Promise { + // If there is a cached access token, try to authenticate with it. If + // authentication fails with an Authentication error (18), + // invalidate the access token, fetch a new access token, and try + // to authenticate again. + // If the server fails for any other reason, do not clear the cache. + if (this.cache.hasAccessToken) { + const token = this.cache.getAccessToken(); + if (!connection.accessToken) { + connection.accessToken = token; + } + try { + return await this.finishAuthentication(connection, credentials, token); + } catch (error) { + if ( + error instanceof MongoError && + error.code === MONGODB_ERROR_CODES.AuthenticationFailed + ) { + this.cache.removeAccessToken(); + return await this.execute(connection, credentials); + } else { + throw error; + } + } + } + const response = await this.fetchAccessToken(credentials); + this.cache.put(response); + connection.accessToken = response.accessToken; + await this.finishAuthentication(connection, credentials, response.accessToken); + } + + /** + * Fetches the access token using the callback. + */ + protected async fetchAccessToken(credentials: MongoCredentials): Promise { + const controller = new AbortController(); + const params: OIDCCallbackParams = { + timeoutContext: controller.signal, + version: OIDC_VERSION + }; + if (credentials.username) { + params.username = credentials.username; + } + if (credentials.mechanismProperties.TOKEN_RESOURCE) { + params.tokenAudience = credentials.mechanismProperties.TOKEN_RESOURCE; + } + const timeout = Timeout.expires(AUTOMATED_TIMEOUT_MS); + try { + return await Promise.race([this.executeAndValidateCallback(params), timeout]); + } catch (error) { + if (TimeoutError.is(error)) { + controller.abort(); + throw new MongoOIDCError(`OIDC callback timed out after ${AUTOMATED_TIMEOUT_MS}ms.`); + } + throw error; + } finally { + timeout.clear(); + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_machine_workflow.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_machine_workflow.ts new file mode 100644 index 00000000..5b3cbde1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_machine_workflow.ts @@ -0,0 +1,73 @@ +import { addAzureParams, AZURE_BASE_URL } from '../../../client-side-encryption/providers/azure'; +import { MongoAzureError } from '../../../error'; +import { get } from '../../../utils'; +import type { OIDCCallbackFunction, OIDCCallbackParams, OIDCResponse } from '../mongodb_oidc'; + +/** Azure request headers. */ +const AZURE_HEADERS = Object.freeze({ Metadata: 'true', Accept: 'application/json' }); + +/** Invalid endpoint result error. */ +const ENDPOINT_RESULT_ERROR = + 'Azure endpoint did not return a value with only access_token and expires_in properties'; + +/** Error for when the token audience is missing in the environment. */ +const TOKEN_RESOURCE_MISSING_ERROR = + 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.'; + +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +export const azureCallback: OIDCCallbackFunction = async ( + params: OIDCCallbackParams +): Promise => { + const tokenAudience = params.tokenAudience; + const username = params.username; + if (!tokenAudience) { + throw new MongoAzureError(TOKEN_RESOURCE_MISSING_ERROR); + } + const response = await getAzureTokenData(tokenAudience, username); + if (!isEndpointResultValid(response)) { + throw new MongoAzureError(ENDPOINT_RESULT_ERROR); + } + return response; +}; + +/** + * Hit the Azure endpoint to get the token data. + */ +async function getAzureTokenData(tokenAudience: string, username?: string): Promise { + const url = new URL(AZURE_BASE_URL); + addAzureParams(url, tokenAudience, username); + const response = await get(url, { + headers: AZURE_HEADERS + }); + if (response.status !== 200) { + throw new MongoAzureError( + `Status code ${response.status} returned from the Azure endpoint. Response body: ${response.body}` + ); + } + const result = JSON.parse(response.body); + return { + accessToken: result.access_token, + expiresInSeconds: Number(result.expires_in) + }; +} + +/** + * Determines if a result returned from the endpoint is valid. + * This means the result is not nullish, contains the access_token required field + * and the expires_in required field. + */ +function isEndpointResultValid( + token: unknown +): token is { access_token: unknown; expires_in: unknown } { + if (token == null || typeof token !== 'object') return false; + return ( + 'accessToken' in token && + typeof token.accessToken === 'string' && + 'expiresInSeconds' in token && + typeof token.expiresInSeconds === 'number' + ); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_workflow.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_workflow.ts new file mode 100644 index 00000000..afa1b96c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_workflow.ts @@ -0,0 +1,188 @@ +import { setTimeout } from 'timers/promises'; + +import { type Document } from '../../../bson'; +import { MongoMissingCredentialsError } from '../../../error'; +import { ns } from '../../../utils'; +import type { Connection } from '../../connection'; +import type { MongoCredentials } from '../mongo_credentials'; +import { + type OIDCCallbackFunction, + type OIDCCallbackParams, + type OIDCResponse, + type Workflow +} from '../mongodb_oidc'; +import { finishCommandDocument, startCommandDocument } from './command_builders'; +import { type TokenCache } from './token_cache'; + +/** 5 minutes in milliseconds */ +export const HUMAN_TIMEOUT_MS = 300000; +/** 1 minute in milliseconds */ +export const AUTOMATED_TIMEOUT_MS = 60000; + +/** Properties allowed on results of callbacks. */ +const RESULT_PROPERTIES = ['accessToken', 'expiresInSeconds', 'refreshToken']; + +/** Error message when the callback result is invalid. */ +const CALLBACK_RESULT_ERROR = + 'User provided OIDC callbacks must return a valid object with an accessToken.'; + +/** The time to throttle callback calls. */ +const THROTTLE_MS = 100; + +/** + * OIDC implementation of a callback based workflow. + * @internal + */ +export abstract class CallbackWorkflow implements Workflow { + cache: TokenCache; + callback: OIDCCallbackFunction; + lastExecutionTime: number; + + /** + * Instantiate the callback workflow. + */ + constructor(cache: TokenCache, callback: OIDCCallbackFunction) { + this.cache = cache; + this.callback = this.withLock(callback); + this.lastExecutionTime = Date.now() - THROTTLE_MS; + } + + /** + * Get the document to add for speculative authentication. This also needs + * to add a db field from the credentials source. + */ + async speculativeAuth(connection: Connection, credentials: MongoCredentials): Promise { + // Check if the Client Cache has an access token. + // If it does, cache the access token in the Connection Cache and send a JwtStepRequest + // with the cached access token in the speculative authentication SASL payload. + if (this.cache.hasAccessToken) { + const accessToken = this.cache.getAccessToken(); + connection.accessToken = accessToken; + const document = finishCommandDocument(accessToken); + document.db = credentials.source; + return { speculativeAuthenticate: document }; + } + return {}; + } + + /** + * Reauthenticate the callback workflow. For this we invalidated the access token + * in the cache and run the authentication steps again. No initial handshake needs + * to be sent. + */ + async reauthenticate(connection: Connection, credentials: MongoCredentials): Promise { + if (this.cache.hasAccessToken) { + // Reauthentication implies the token has expired. + if (connection.accessToken === this.cache.getAccessToken()) { + // If connection's access token is the same as the cache's, remove + // the token from the cache and connection. + this.cache.removeAccessToken(); + delete connection.accessToken; + } else { + // If the connection's access token is different from the cache's, set + // the cache's token on the connection and do not remove from the + // cache. + connection.accessToken = this.cache.getAccessToken(); + } + } + await this.execute(connection, credentials); + } + + /** + * Execute the OIDC callback workflow. + */ + abstract execute( + connection: Connection, + credentials: MongoCredentials, + response?: Document + ): Promise; + + /** + * Starts the callback authentication process. If there is a speculative + * authentication document from the initial handshake, then we will use that + * value to get the issuer, otherwise we will send the saslStart command. + */ + protected async startAuthentication( + connection: Connection, + credentials: MongoCredentials, + response?: Document + ): Promise { + let result; + if (response?.speculativeAuthenticate) { + result = response.speculativeAuthenticate; + } else { + result = await connection.command( + ns(credentials.source), + startCommandDocument(credentials), + undefined + ); + } + return result; + } + + /** + * Finishes the callback authentication process. + */ + protected async finishAuthentication( + connection: Connection, + credentials: MongoCredentials, + token: string, + conversationId?: number + ): Promise { + await connection.command( + ns(credentials.source), + finishCommandDocument(token, conversationId), + undefined + ); + } + + /** + * Executes the callback and validates the output. + */ + protected async executeAndValidateCallback(params: OIDCCallbackParams): Promise { + const result = await this.callback(params); + // Validate that the result returned by the callback is acceptable. If it is not + // we must clear the token result from the cache. + if (isCallbackResultInvalid(result)) { + throw new MongoMissingCredentialsError(CALLBACK_RESULT_ERROR); + } + return result; + } + + /** + * Ensure the callback is only executed one at a time and throttles the calls + * to every 100ms. + */ + protected withLock(callback: OIDCCallbackFunction): OIDCCallbackFunction { + let lock: Promise = Promise.resolve(); + return async (params: OIDCCallbackParams): Promise => { + // We do this to ensure that we would never return the result of the + // previous lock, only the current callback's value would get returned. + await lock; + lock = lock + + .catch(() => null) + + .then(async () => { + const difference = Date.now() - this.lastExecutionTime; + if (difference <= THROTTLE_MS) { + await setTimeout(THROTTLE_MS - difference, { signal: params.timeoutContext }); + } + this.lastExecutionTime = Date.now(); + return await callback(params); + }); + return await lock; + }; + } +} + +/** + * Determines if a result returned from a request or refresh callback + * function is invalid. This means the result is nullish, doesn't contain + * the accessToken required field, and does not contain extra fields. + */ +function isCallbackResultInvalid(tokenResult: unknown): boolean { + if (tokenResult == null || typeof tokenResult !== 'object') return true; + if (!('accessToken' in tokenResult)) return true; + return !Object.getOwnPropertyNames(tokenResult).every(prop => RESULT_PROPERTIES.includes(prop)); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/command_builders.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/command_builders.ts new file mode 100644 index 00000000..da0c09c4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/command_builders.ts @@ -0,0 +1,53 @@ +import { Binary, BSON, type Document } from '../../../bson'; +import { type MongoCredentials } from '../mongo_credentials'; +import { AuthMechanism } from '../providers'; + +/** @internal */ +export interface OIDCCommand { + saslStart?: number; + saslContinue?: number; + conversationId?: number; + mechanism?: string; + autoAuthorize?: number; + db?: string; + payload: Binary; +} + +/** + * Generate the finishing command document for authentication. Will be a + * saslStart or saslContinue depending on the presence of a conversation id. + */ +export function finishCommandDocument(token: string, conversationId?: number): OIDCCommand { + if (conversationId != null) { + return { + saslContinue: 1, + conversationId: conversationId, + payload: new Binary(BSON.serialize({ jwt: token })) + }; + } + // saslContinue requires a conversationId in the command to be valid so in this + // case the server allows "step two" to actually be a saslStart with the token + // as the jwt since the use of the cached value has no correlating conversating + // on the particular connection. + return { + saslStart: 1, + mechanism: AuthMechanism.MONGODB_OIDC, + payload: new Binary(BSON.serialize({ jwt: token })) + }; +} + +/** + * Generate the saslStart command document. + */ +export function startCommandDocument(credentials: MongoCredentials): OIDCCommand { + const payload: Document = {}; + if (credentials.username) { + payload.n = credentials.username; + } + return { + saslStart: 1, + autoAuthorize: 1, + mechanism: AuthMechanism.MONGODB_OIDC, + payload: new Binary(BSON.serialize(payload)) + }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/gcp_machine_workflow.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/gcp_machine_workflow.ts new file mode 100644 index 00000000..f72655e4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/gcp_machine_workflow.ts @@ -0,0 +1,46 @@ +import { MongoGCPError } from '../../../error'; +import { get } from '../../../utils'; +import type { OIDCCallbackFunction, OIDCCallbackParams, OIDCResponse } from '../mongodb_oidc'; + +/** GCP base URL. */ +const GCP_BASE_URL = + 'http://metadata/computeMetadata/v1/instance/service-accounts/default/identity'; + +/** GCP request headers. */ +const GCP_HEADERS = Object.freeze({ 'Metadata-Flavor': 'Google' }); + +/** Error for when the token audience is missing in the environment. */ +const TOKEN_RESOURCE_MISSING_ERROR = + 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp.'; + +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +export const gcpCallback: OIDCCallbackFunction = async ( + params: OIDCCallbackParams +): Promise => { + const tokenAudience = params.tokenAudience; + if (!tokenAudience) { + throw new MongoGCPError(TOKEN_RESOURCE_MISSING_ERROR); + } + return await getGcpTokenData(tokenAudience); +}; + +/** + * Hit the GCP endpoint to get the token data. + */ +async function getGcpTokenData(tokenAudience: string): Promise { + const url = new URL(GCP_BASE_URL); + url.searchParams.append('audience', tokenAudience); + const response = await get(url, { + headers: GCP_HEADERS + }); + if (response.status !== 200) { + throw new MongoGCPError( + `Status code ${response.status} returned from the GCP endpoint. Response body: ${response.body}` + ); + } + return { accessToken: response.body }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/human_callback_workflow.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/human_callback_workflow.ts new file mode 100644 index 00000000..a162ce06 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/human_callback_workflow.ts @@ -0,0 +1,141 @@ +import { BSON } from '../../../bson'; +import { MONGODB_ERROR_CODES, MongoError, MongoOIDCError } from '../../../error'; +import { Timeout, TimeoutError } from '../../../timeout'; +import { type Connection } from '../../connection'; +import { type MongoCredentials } from '../mongo_credentials'; +import { + type IdPInfo, + OIDC_VERSION, + type OIDCCallbackFunction, + type OIDCCallbackParams, + type OIDCResponse +} from '../mongodb_oidc'; +import { CallbackWorkflow, HUMAN_TIMEOUT_MS } from './callback_workflow'; +import { type TokenCache } from './token_cache'; + +/** + * Class implementing behaviour for the non human callback workflow. + * @internal + */ +export class HumanCallbackWorkflow extends CallbackWorkflow { + /** + * Instantiate the human callback workflow. + */ + constructor(cache: TokenCache, callback: OIDCCallbackFunction) { + super(cache, callback); + } + + /** + * Execute the OIDC human callback workflow. + */ + async execute(connection: Connection, credentials: MongoCredentials): Promise { + // Check if the Client Cache has an access token. + // If it does, cache the access token in the Connection Cache and perform a One-Step SASL conversation + // using the access token. If the server returns an Authentication error (18), + // invalidate the access token token from the Client Cache, clear the Connection Cache, + // and restart the authentication flow. Raise any other errors to the user. On success, exit the algorithm. + if (this.cache.hasAccessToken) { + const token = this.cache.getAccessToken(); + connection.accessToken = token; + try { + return await this.finishAuthentication(connection, credentials, token); + } catch (error) { + if ( + error instanceof MongoError && + error.code === MONGODB_ERROR_CODES.AuthenticationFailed + ) { + this.cache.removeAccessToken(); + delete connection.accessToken; + return await this.execute(connection, credentials); + } else { + throw error; + } + } + } + // Check if the Client Cache has a refresh token. + // If it does, call the OIDC Human Callback with the cached refresh token and IdpInfo to get a + // new access token. Cache the new access token in the Client Cache and Connection Cache. + // Perform a One-Step SASL conversation using the new access token. If the the server returns + // an Authentication error (18), clear the refresh token, invalidate the access token from the + // Client Cache, clear the Connection Cache, and restart the authentication flow. Raise any other + // errors to the user. On success, exit the algorithm. + if (this.cache.hasRefreshToken) { + const refreshToken = this.cache.getRefreshToken(); + const result = await this.fetchAccessToken( + this.cache.getIdpInfo(), + credentials, + refreshToken + ); + this.cache.put(result); + connection.accessToken = result.accessToken; + try { + return await this.finishAuthentication(connection, credentials, result.accessToken); + } catch (error) { + if ( + error instanceof MongoError && + error.code === MONGODB_ERROR_CODES.AuthenticationFailed + ) { + this.cache.removeRefreshToken(); + delete connection.accessToken; + return await this.execute(connection, credentials); + } else { + throw error; + } + } + } + + // Start a new Two-Step SASL conversation. + // Run a PrincipalStepRequest to get the IdpInfo. + // Call the OIDC Human Callback with the new IdpInfo to get a new access token and optional refresh + // token. Drivers MUST NOT pass a cached refresh token to the callback when performing + // a new Two-Step conversation. Cache the new IdpInfo and refresh token in the Client Cache and the + // new access token in the Client Cache and Connection Cache. + // Attempt to authenticate using a JwtStepRequest with the new access token. Raise any errors to the user. + const startResponse = await this.startAuthentication(connection, credentials); + const conversationId = startResponse.conversationId; + const idpInfo = BSON.deserialize(startResponse.payload.buffer) as IdPInfo; + const callbackResponse = await this.fetchAccessToken(idpInfo, credentials); + this.cache.put(callbackResponse, idpInfo); + connection.accessToken = callbackResponse.accessToken; + return await this.finishAuthentication( + connection, + credentials, + callbackResponse.accessToken, + conversationId + ); + } + + /** + * Fetches an access token using the callback. + */ + private async fetchAccessToken( + idpInfo: IdPInfo, + credentials: MongoCredentials, + refreshToken?: string + ): Promise { + const controller = new AbortController(); + const params: OIDCCallbackParams = { + timeoutContext: controller.signal, + version: OIDC_VERSION, + idpInfo: idpInfo + }; + if (credentials.username) { + params.username = credentials.username; + } + if (refreshToken) { + params.refreshToken = refreshToken; + } + const timeout = Timeout.expires(HUMAN_TIMEOUT_MS); + try { + return await Promise.race([this.executeAndValidateCallback(params), timeout]); + } catch (error) { + if (TimeoutError.is(error)) { + controller.abort(); + throw new MongoOIDCError(`OIDC callback timed out after ${HUMAN_TIMEOUT_MS}ms.`); + } + throw error; + } finally { + timeout.clear(); + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts new file mode 100644 index 00000000..95b83f02 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts @@ -0,0 +1,31 @@ +import { readFile } from 'fs/promises'; +import * as process from 'process'; + +import type { OIDCCallbackFunction, OIDCResponse } from '../mongodb_oidc'; + +/** The fallback file name */ +const FALLBACK_FILENAME = '/var/run/secrets/kubernetes.io/serviceaccount/token'; + +/** The azure environment variable for the file name. */ +const AZURE_FILENAME = 'AZURE_FEDERATED_TOKEN_FILE'; + +/** The AWS environment variable for the file name. */ +const AWS_FILENAME = 'AWS_WEB_IDENTITY_TOKEN_FILE'; + +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +export const k8sCallback: OIDCCallbackFunction = async (): Promise => { + let filename: string; + if (process.env[AZURE_FILENAME]) { + filename = process.env[AZURE_FILENAME]; + } else if (process.env[AWS_FILENAME]) { + filename = process.env[AWS_FILENAME]; + } else { + filename = FALLBACK_FILENAME; + } + const token = await readFile(filename, 'utf8'); + return { accessToken: token }; +}; diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_cache.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_cache.ts new file mode 100644 index 00000000..e2f7ad49 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_cache.ts @@ -0,0 +1,62 @@ +import { MongoDriverError } from '../../../error'; +import type { IdPInfo, OIDCResponse } from '../mongodb_oidc'; + +class MongoOIDCError extends MongoDriverError {} + +/** @internal */ +export class TokenCache { + private accessToken?: string; + private refreshToken?: string; + private idpInfo?: IdPInfo; + private expiresInSeconds?: number; + + get hasAccessToken(): boolean { + return !!this.accessToken; + } + + get hasRefreshToken(): boolean { + return !!this.refreshToken; + } + + get hasIdpInfo(): boolean { + return !!this.idpInfo; + } + + getAccessToken(): string { + if (!this.accessToken) { + throw new MongoOIDCError('Attempted to get an access token when none exists.'); + } + return this.accessToken; + } + + getRefreshToken(): string { + if (!this.refreshToken) { + throw new MongoOIDCError('Attempted to get a refresh token when none exists.'); + } + return this.refreshToken; + } + + getIdpInfo(): IdPInfo { + if (!this.idpInfo) { + throw new MongoOIDCError('Attempted to get IDP information when none exists.'); + } + return this.idpInfo; + } + + put(response: OIDCResponse, idpInfo?: IdPInfo) { + this.accessToken = response.accessToken; + this.refreshToken = response.refreshToken; + this.expiresInSeconds = response.expiresInSeconds; + if (idpInfo) { + this.idpInfo = idpInfo; + } + } + + removeAccessToken() { + this.accessToken = undefined; + } + + removeRefreshToken() { + this.refreshToken = undefined; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts new file mode 100644 index 00000000..4362b57b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts @@ -0,0 +1,22 @@ +import * as fs from 'fs'; +import * as process from 'process'; + +import { MongoAWSError } from '../../../error'; +import type { OIDCCallbackFunction, OIDCResponse } from '../mongodb_oidc'; + +/** Error for when the token is missing in the environment. */ +const TOKEN_MISSING_ERROR = 'OIDC_TOKEN_FILE must be set in the environment.'; + +/** + * The callback function to be used in the automated callback workflow. + * @param params - The OIDC callback parameters. + * @returns The OIDC response. + */ +export const tokenMachineCallback: OIDCCallbackFunction = async (): Promise => { + const tokenFile = process.env.OIDC_TOKEN_FILE; + if (!tokenFile) { + throw new MongoAWSError(TOKEN_MISSING_ERROR); + } + const token = await fs.promises.readFile(tokenFile, 'utf8'); + return { accessToken: token }; +}; diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/plain.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/plain.ts new file mode 100644 index 00000000..00cb711d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/plain.ts @@ -0,0 +1,25 @@ +import { Binary, ByteUtils } from '../../bson'; +import { MongoMissingCredentialsError } from '../../error'; +import { ns } from '../../utils'; +import { type AuthContext, AuthProvider } from './auth_provider'; + +export class Plain extends AuthProvider { + override async auth(authContext: AuthContext): Promise { + const { connection, credentials } = authContext; + if (!credentials) { + throw new MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + + const { username, password } = credentials; + + const payload = new Binary(ByteUtils.fromUTF8(`\x00${username}\x00${password}`)); + const command = { + saslStart: 1, + mechanism: 'PLAIN', + payload: payload, + autoAuthorize: 1 + }; + + await connection.command(ns('$external.$cmd'), command, undefined); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/providers.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/providers.ts new file mode 100644 index 00000000..fe6a57ce --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/providers.ts @@ -0,0 +1,22 @@ +/** @public */ +export const AuthMechanism = Object.freeze({ + MONGODB_AWS: 'MONGODB-AWS', + MONGODB_DEFAULT: 'DEFAULT', + MONGODB_GSSAPI: 'GSSAPI', + MONGODB_PLAIN: 'PLAIN', + MONGODB_SCRAM_SHA1: 'SCRAM-SHA-1', + MONGODB_SCRAM_SHA256: 'SCRAM-SHA-256', + MONGODB_X509: 'MONGODB-X509', + MONGODB_OIDC: 'MONGODB-OIDC' +} as const); + +/** @public */ +export type AuthMechanism = (typeof AuthMechanism)[keyof typeof AuthMechanism]; + +/** @internal */ +export const AUTH_MECHS_AUTH_SRC_EXTERNAL = new Set([ + AuthMechanism.MONGODB_GSSAPI, + AuthMechanism.MONGODB_AWS, + AuthMechanism.MONGODB_OIDC, + AuthMechanism.MONGODB_X509 +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/scram.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/scram.ts new file mode 100644 index 00000000..675571ee --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/scram.ts @@ -0,0 +1,370 @@ +import { saslprep } from '@mongodb-js/saslprep'; + +import { Binary, ByteUtils, type Document } from '../../bson'; +import { + MongoInvalidArgumentError, + MongoMissingCredentialsError, + MongoRuntimeError +} from '../../error'; +import { ns, randomBytes } from '../../utils'; +import type { HandshakeDocument } from '../connect'; +import { type AuthContext, AuthProvider } from './auth_provider'; +import type { MongoCredentials } from './mongo_credentials'; +import { AuthMechanism } from './providers'; + +type CryptoMethod = 'sha1' | 'sha256'; + +class ScramSHA extends AuthProvider { + cryptoMethod: CryptoMethod; + + constructor(cryptoMethod: CryptoMethod) { + super(); + this.cryptoMethod = cryptoMethod || 'sha1'; + } + + override async prepare( + handshakeDoc: HandshakeDocument, + authContext: AuthContext + ): Promise { + const cryptoMethod = this.cryptoMethod; + const credentials = authContext.credentials; + if (!credentials) { + throw new MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + + const nonce = await randomBytes(24); + // store the nonce for later use + authContext.nonce = nonce; + + const request = { + ...handshakeDoc, + speculativeAuthenticate: { + ...makeFirstMessage(cryptoMethod, credentials, nonce), + db: credentials.source + } + }; + + return request; + } + + override async auth(authContext: AuthContext) { + const { reauthenticating, response } = authContext; + if (response?.speculativeAuthenticate && !reauthenticating) { + return await continueScramConversation( + this.cryptoMethod, + response.speculativeAuthenticate, + authContext + ); + } + return await executeScram(this.cryptoMethod, authContext); + } +} + +function cleanUsername(username: string) { + return username.replace('=', '=3D').replace(',', '=2C'); +} + +function clientFirstMessageBare(username: string, nonce: Uint8Array) { + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return ByteUtils.concat([ + ByteUtils.fromUTF8('n='), + ByteUtils.fromUTF8(username), + ByteUtils.fromUTF8(',r='), + ByteUtils.fromUTF8(ByteUtils.toBase64(nonce)) + ]); +} + +function makeFirstMessage( + cryptoMethod: CryptoMethod, + credentials: MongoCredentials, + nonce: Uint8Array +) { + const username = cleanUsername(credentials.username); + const mechanism = + cryptoMethod === 'sha1' ? AuthMechanism.MONGODB_SCRAM_SHA1 : AuthMechanism.MONGODB_SCRAM_SHA256; + + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return { + saslStart: 1, + mechanism, + payload: new Binary( + ByteUtils.concat([ByteUtils.fromUTF8('n,,'), clientFirstMessageBare(username, nonce)]) + ), + autoAuthorize: 1, + options: { skipEmptyExchange: true } + }; +} + +async function executeScram(cryptoMethod: CryptoMethod, authContext: AuthContext): Promise { + const { connection, credentials } = authContext; + if (!credentials) { + throw new MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + if (!authContext.nonce) { + throw new MongoInvalidArgumentError('AuthContext must contain a valid nonce property'); + } + const nonce = authContext.nonce; + const db = credentials.source; + + const saslStartCmd = makeFirstMessage(cryptoMethod, credentials, nonce); + const response = await connection.command(ns(`${db}.$cmd`), saslStartCmd, undefined); + await continueScramConversation(cryptoMethod, response, authContext); +} + +async function continueScramConversation( + cryptoMethod: CryptoMethod, + response: Document, + authContext: AuthContext +): Promise { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + throw new MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + if (!authContext.nonce) { + throw new MongoInvalidArgumentError('Unable to continue SCRAM without valid nonce'); + } + const nonce = authContext.nonce; + + const db = credentials.source; + const username = cleanUsername(credentials.username); + const password = credentials.password; + + const processedPassword = + cryptoMethod === 'sha256' ? saslprep(password) : passwordDigest(username, password); + + const payload: Binary = ByteUtils.isUint8Array(response.payload) + ? new Binary(response.payload) + : response.payload; + + const dict = parsePayload(payload); + + const iterations = parseInt(dict.i, 10); + if (iterations && iterations < 4096) { + // TODO(NODE-3483) + throw new MongoRuntimeError(`Server returned an invalid iteration count ${iterations}`); + } + + const salt = dict.s; + const rnonce = dict.r; + if (rnonce.startsWith('nonce')) { + // TODO(NODE-3483) + throw new MongoRuntimeError(`Server returned an invalid nonce: ${rnonce}`); + } + + // Set up start of proof + const withoutProof = `c=biws,r=${rnonce}`; + const saltedPassword = await HI( + processedPassword, + ByteUtils.fromBase64(salt), + iterations, + cryptoMethod + ); + + const clientKey = await HMAC(cryptoMethod, saltedPassword, 'Client Key'); + const serverKey = await HMAC(cryptoMethod, saltedPassword, 'Server Key'); + const storedKey = await H(cryptoMethod, clientKey); + const firstMessageBytes = clientFirstMessageBare(username, nonce); + const firstMessage = ByteUtils.toUTF8(firstMessageBytes, 0, firstMessageBytes.length, false); + const payloadString = ByteUtils.toUTF8(payload.buffer, 0, payload.position, false); + const authMessage = [firstMessage, payloadString, withoutProof].join(','); + + const clientSignature = await HMAC(cryptoMethod, storedKey, authMessage); + const clientProof = `p=${xor(clientKey, clientSignature)}`; + const clientFinal = [withoutProof, clientProof].join(','); + + const serverSignature = await HMAC(cryptoMethod, serverKey, authMessage); + const saslContinueCmd = { + saslContinue: 1, + conversationId: response.conversationId, + payload: new Binary(ByteUtils.fromUTF8(clientFinal)) + }; + + const r = await connection.command(ns(`${db}.$cmd`), saslContinueCmd, undefined); + const parsedResponse = parsePayload(r.payload); + + if (!compareDigest(ByteUtils.fromBase64(parsedResponse.v), serverSignature)) { + throw new MongoRuntimeError('Server returned an invalid signature'); + } + + if (r.done !== false) { + // If the server sends r.done === true we can save one RTT + return; + } + + const retrySaslContinueCmd = { + saslContinue: 1, + conversationId: r.conversationId, + payload: ByteUtils.allocate(0) + }; + + await connection.command(ns(`${db}.$cmd`), retrySaslContinueCmd, undefined); +} + +function parsePayload(payload: Binary) { + const payloadStr = ByteUtils.toUTF8(payload.buffer, 0, payload.position, false); + const dict: Document = {}; + const parts = payloadStr.split(','); + for (let i = 0; i < parts.length; i++) { + const valueParts = (parts[i].match(/^([^=]*)=(.*)$/) ?? []).slice(1); + dict[valueParts[0]] = valueParts[1]; + } + return dict; +} + +function passwordDigest(username: string, password: string) { + if (typeof username !== 'string') { + throw new MongoInvalidArgumentError('Username must be a string'); + } + + if (typeof password !== 'string') { + throw new MongoInvalidArgumentError('Password must be a string'); + } + + if (password.length === 0) { + throw new MongoInvalidArgumentError('Password cannot be empty'); + } + + let nodeCrypto; + try { + // TODO: NODE-7424 - remove dependency on 'crypto' for SCRAM-SHA-1 authentication + // eslint-disable-next-line @typescript-eslint/no-require-imports + nodeCrypto = require('crypto'); + } catch (e) { + throw new MongoRuntimeError( + 'Node.js crypto module is required for SCRAM-SHA-1 authentication', + { + cause: e + } + ); + } + + try { + const md5 = nodeCrypto.createHash('md5'); + md5.update(`${username}:mongo:${password}`, 'utf8'); + return md5.digest('hex'); + } catch (err) { + if (nodeCrypto.getFips()) { + // This error is (slightly) more helpful than what comes from OpenSSL directly, e.g. + // 'Error: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS' + throw new Error('Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode'); + } + throw err; + } +} + +// XOR two buffers +function xor(a: Uint8Array, b: Uint8Array) { + const length = Math.max(a.length, b.length); + const res = []; + + for (let i = 0; i < length; i += 1) { + res.push(a[i] ^ b[i]); + } + + return ByteUtils.toBase64(ByteUtils.fromNumberArray(res)); +} + +async function H(method: CryptoMethod, text: Uint8Array): Promise { + const buffer = await crypto.subtle.digest(method === 'sha256' ? 'SHA-256' : 'SHA-1', text); + return new Uint8Array(buffer); +} + +async function HMAC( + method: CryptoMethod, + key: Uint8Array, + text: Uint8Array | string +): Promise { + const keyBuffer = ByteUtils.toLocalBufferType(key); + const cryptoKey = await crypto.subtle.importKey( + 'raw', + keyBuffer, + { name: 'HMAC', hash: { name: method === 'sha256' ? 'SHA-256' : 'SHA-1' } }, + false, + ['sign', 'verify'] + ); + const textData: Uint8Array = typeof text === 'string' ? new TextEncoder().encode(text) : text; + const textBuffer = ByteUtils.toLocalBufferType(textData); + const signature = await crypto.subtle.sign('HMAC', cryptoKey, textBuffer); + return new Uint8Array(signature); +} + +interface HICache { + [key: string]: Uint8Array; +} + +let _hiCache: HICache = {}; +let _hiCacheCount = 0; +function _hiCachePurge() { + _hiCache = {}; + _hiCacheCount = 0; +} + +const hiLengthMap = { + sha256: 32, + sha1: 20 +}; + +async function HI(data: string, salt: Uint8Array, iterations: number, cryptoMethod: CryptoMethod) { + // omit the work if already generated + const key = [data, ByteUtils.toBase64(salt), iterations].join('_'); + if (_hiCache[key] != null) { + return _hiCache[key]; + } + + const keyMaterial = await crypto.subtle.importKey( + 'raw', + new TextEncoder().encode(data), + { name: 'PBKDF2' }, + false, + ['deriveBits'] + ); + const params = { + name: 'PBKDF2', + salt: salt, + iterations: iterations, + hash: { name: cryptoMethod === 'sha256' ? 'SHA-256' : 'SHA-1' } + }; + const derivedBits = await crypto.subtle.deriveBits( + params, + keyMaterial, + hiLengthMap[cryptoMethod] * 8 + ); + const saltedData = new Uint8Array(derivedBits); + + // cache a copy to speed up the next lookup, but prevent unbounded cache growth + if (_hiCacheCount >= 200) { + _hiCachePurge(); + } + + _hiCache[key] = saltedData; + _hiCacheCount += 1; + return saltedData; +} + +function compareDigest(lhs: Uint8Array, rhs: Uint8Array) { + if (lhs.length !== rhs.length) { + return false; + } + + let result = 0; + for (let i = 0; i < lhs.length; i++) { + result |= lhs[i] ^ rhs[i]; + } + + return result === 0; +} + +export class ScramSHA1 extends ScramSHA { + constructor() { + super('sha1'); + } +} + +export class ScramSHA256 extends ScramSHA { + constructor() { + super('sha256'); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/x509.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/x509.ts new file mode 100644 index 00000000..ec4c0007 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/auth/x509.ts @@ -0,0 +1,43 @@ +import type { Document } from '../../bson'; +import { MongoMissingCredentialsError } from '../../error'; +import { ns } from '../../utils'; +import type { HandshakeDocument } from '../connect'; +import { type AuthContext, AuthProvider } from './auth_provider'; +import type { MongoCredentials } from './mongo_credentials'; + +export class X509 extends AuthProvider { + override async prepare( + handshakeDoc: HandshakeDocument, + authContext: AuthContext + ): Promise { + const { credentials } = authContext; + if (!credentials) { + throw new MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + return { ...handshakeDoc, speculativeAuthenticate: x509AuthenticateCommand(credentials) }; + } + + override async auth(authContext: AuthContext) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + throw new MongoMissingCredentialsError('AuthContext must provide credentials.'); + } + const response = authContext.response; + + if (response?.speculativeAuthenticate) { + return; + } + + await connection.command(ns('$external.$cmd'), x509AuthenticateCommand(credentials), undefined); + } +} + +function x509AuthenticateCommand(credentials: MongoCredentials) { + const command: Document = { authenticate: 1, mechanism: 'MONGODB-X509' }; + if (credentials.username) { + command.user = credentials.username; + } + + return command; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/command_monitoring_events.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/command_monitoring_events.ts new file mode 100644 index 00000000..a8372b52 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/command_monitoring_events.ts @@ -0,0 +1,315 @@ +import { type Document, type ObjectId } from '../bson'; +import { + COMMAND_FAILED, + COMMAND_STARTED, + COMMAND_SUCCEEDED, + LEGACY_HELLO_COMMAND, + LEGACY_HELLO_COMMAND_CAMEL_CASE +} from '../constants'; +import { calculateDurationInMs } from '../utils'; +import { + DocumentSequence, + OpMsgRequest, + type OpQueryRequest, + type WriteProtocolMessageType +} from './commands'; +import type { Connection } from './connection'; + +/** + * An event indicating the start of a given command + * @public + * @category Event + */ +export class CommandStartedEvent { + commandObj?: Document; + requestId: number; + databaseName: string; + commandName: string; + command: Document; + address: string; + /** Driver generated connection id */ + connectionId?: string | number; + /** + * Server generated connection id + * Distinct from the connection id and is returned by the hello or legacy hello response as "connectionId" + * from the server. + */ + serverConnectionId: bigint | null; + serviceId?: ObjectId; + /** @internal */ + name = COMMAND_STARTED; + + /** + * Create a started event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + */ + constructor( + connection: Connection, + command: WriteProtocolMessageType, + serverConnectionId: bigint | null + ) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + + // TODO: remove in major revision, this is not spec behavior + if (SENSITIVE_COMMANDS.has(commandName)) { + this.commandObj = {}; + this.commandObj[commandName] = true; + } + + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.databaseName = command.databaseName; + this.commandName = commandName; + this.command = maybeRedact(commandName, cmd, cmd); + this.serverConnectionId = serverConnectionId; + } + + /* @internal */ + get hasServiceId(): boolean { + return !!this.serviceId; + } +} + +/** + * An event indicating the success of a given command + * @public + * @category Event + */ +export class CommandSucceededEvent { + address: string; + /** Driver generated connection id */ + connectionId?: string | number; + /** + * Server generated connection id + * Distinct from the connection id and is returned by the hello or legacy hello response as "connectionId" from the server. + */ + serverConnectionId: bigint | null; + requestId: number; + duration: number; + commandName: string; + reply: unknown; + serviceId?: ObjectId; + databaseName: string; + /** @internal */ + name = COMMAND_SUCCEEDED; + + /** + * Create a succeeded event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param reply - the reply for this command from the server + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor( + connection: Connection, + command: WriteProtocolMessageType, + reply: Document | undefined, + started: number, + serverConnectionId: bigint | null + ) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = calculateDurationInMs(started); + this.reply = maybeRedact(commandName, cmd, extractReply(reply)); + this.serverConnectionId = serverConnectionId; + this.databaseName = command.databaseName; + } + + /* @internal */ + get hasServiceId(): boolean { + return !!this.serviceId; + } +} + +/** + * An event indicating the failure of a given command + * @public + * @category Event + */ +export class CommandFailedEvent { + address: string; + /** Driver generated connection id */ + connectionId?: string | number; + /** + * Server generated connection id + * Distinct from the connection id and is returned by the hello or legacy hello response as "connectionId" from the server. + */ + serverConnectionId: bigint | null; + requestId: number; + duration: number; + commandName: string; + failure: Error; + serviceId?: ObjectId; + databaseName: string; + /** @internal */ + name = COMMAND_FAILED; + + /** + * Create a failure event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param error - the generated error or a server error response + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor( + connection: Connection, + command: WriteProtocolMessageType, + error: Error | Document, + started: number, + serverConnectionId: bigint | null + ) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = calculateDurationInMs(started); + this.failure = maybeRedact(commandName, cmd, error) as Error; + this.serverConnectionId = serverConnectionId; + this.databaseName = command.databaseName; + } + + /* @internal */ + get hasServiceId(): boolean { + return !!this.serviceId; + } +} + +/** + * Commands that we want to redact because of the sensitive nature of their contents + * @internal + */ +export const SENSITIVE_COMMANDS = new Set([ + 'authenticate', + 'saslStart', + 'saslContinue', + 'getnonce', + 'createUser', + 'updateUser', + 'copydbgetnonce', + 'copydbsaslstart', + 'copydb' +]); + +const HELLO_COMMANDS = new Set(['hello', LEGACY_HELLO_COMMAND, LEGACY_HELLO_COMMAND_CAMEL_CASE]); + +// helper methods +const extractCommandName = (commandDoc: Document) => Object.keys(commandDoc)[0]; +const collectionName = (command: OpQueryRequest) => command.ns.split('.')[1]; +const maybeRedact = (commandName: string, commandDoc: Document, result: Error | Document) => + SENSITIVE_COMMANDS.has(commandName) || + (HELLO_COMMANDS.has(commandName) && commandDoc.speculativeAuthenticate) + ? {} + : result; + +const LEGACY_FIND_QUERY_MAP: { [key: string]: string } = { + $query: 'filter', + $orderby: 'sort', + $hint: 'hint', + $comment: 'comment', + $maxScan: 'maxScan', + $max: 'max', + $min: 'min', + $returnKey: 'returnKey', + $showDiskLoc: 'showRecordId', + $maxTimeMS: 'maxTimeMS', + $snapshot: 'snapshot' +}; + +const LEGACY_FIND_OPTIONS_MAP = { + numberToSkip: 'skip', + numberToReturn: 'batchSize', + returnFieldSelector: 'projection' +} as const; + +/** Extract the actual command from the query, possibly up-converting if it's a legacy format */ +function extractCommand(command: WriteProtocolMessageType): Document { + if (command instanceof OpMsgRequest) { + const cmd = { ...command.command }; + // For OP_MSG payload type 1, replace any document-sequence field with its + // documents array for monitoring (ops, nsInfo, documents, updates, deletes). + for (const key of Object.keys(cmd)) { + if (cmd[key] instanceof DocumentSequence) { + cmd[key] = cmd[key].documents; + } + } + return cmd; + } + + if (command.query?.$query) { + let result: Document; + if (command.ns === 'admin.$cmd') { + // up-convert legacy command + result = Object.assign({}, command.query.$query); + } else { + // up-convert legacy find command + result = { find: collectionName(command) }; + Object.keys(LEGACY_FIND_QUERY_MAP).forEach(key => { + if (command.query[key] != null) { + result[LEGACY_FIND_QUERY_MAP[key]] = { ...command.query[key] }; + } + }); + } + + Object.keys(LEGACY_FIND_OPTIONS_MAP).forEach(key => { + const legacyKey = key as keyof typeof LEGACY_FIND_OPTIONS_MAP; + if (command[legacyKey] != null) { + result[LEGACY_FIND_OPTIONS_MAP[legacyKey]] = command[legacyKey]; + } + }); + + return result; + } + + let clonedQuery: Record = {}; + const clonedCommand: Record = { ...command }; + if (command.query) { + clonedQuery = { ...command.query }; + clonedCommand.query = clonedQuery; + } + + return command.query ? clonedQuery : clonedCommand; +} + +function extractReply(reply?: Document) { + if (!reply) { + return reply; + } + + return reply.result ? reply.result : reply; +} + +function extractConnectionDetails(connection: Connection) { + let connectionId; + if ('id' in connection) { + connectionId = connection.id; + } + return { + address: connection.address, + serviceId: connection.serviceId, + connectionId + }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/commands.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/commands.ts new file mode 100644 index 00000000..1a5c9b7f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/commands.ts @@ -0,0 +1,824 @@ +import { + BSON, + type BSONSerializeOptions, + ByteUtils, + type Document, + type Long, + NumberUtils, + readInt32LE, + setUint32LE +} from '../bson'; +import { MongoInvalidArgumentError, MongoRuntimeError } from '../error'; +import { type ReadPreference } from '../read_preference'; +import type { ClientSession } from '../sessions'; +import type { CommandOptions } from './connection'; +import { + compress, + Compressor, + type CompressorName, + uncompressibleCommands +} from './wire_protocol/compression'; +import { OP_COMPRESSED, OP_MSG, OP_QUERY } from './wire_protocol/constants'; + +// Incrementing request id +let _requestId = 0; + +// Query flags +const OPTS_TAILABLE_CURSOR = 2; +const OPTS_SECONDARY = 4; +const OPTS_OPLOG_REPLAY = 8; +const OPTS_NO_CURSOR_TIMEOUT = 16; +const OPTS_AWAIT_DATA = 32; +const OPTS_EXHAUST = 64; +const OPTS_PARTIAL = 128; + +// Response flags +const CURSOR_NOT_FOUND = 1; +const QUERY_FAILURE = 2; +const SHARD_CONFIG_STALE = 4; +const AWAIT_CAPABLE = 8; + +const encodeUTF8Into = ByteUtils.encodeUTF8Into; + +/** @internal */ +export type WriteProtocolMessageType = OpQueryRequest | OpMsgRequest; + +/** @internal */ +export interface OpQueryOptions extends CommandOptions { + socketTimeoutMS?: number; + session?: ClientSession; + numberToSkip?: number; + numberToReturn?: number; + returnFieldSelector?: Document; + pre32Limit?: number; + serializeFunctions?: boolean; + ignoreUndefined?: boolean; + maxBsonSize?: number; + checkKeys?: boolean; + secondaryOk?: boolean; + + requestId?: number; + moreToCome?: boolean; + exhaustAllowed?: boolean; +} + +/** @internal */ +export class OpQueryRequest { + ns: string; + numberToSkip: number; + numberToReturn: number; + returnFieldSelector?: Document; + requestId: number; + pre32Limit?: number; + serializeFunctions: boolean; + ignoreUndefined: boolean; + maxBsonSize: number; + checkKeys: boolean; + batchSize: number; + tailable: boolean; + secondaryOk: boolean; + oplogReplay: boolean; + noCursorTimeout: boolean; + awaitData: boolean; + exhaust: boolean; + partial: boolean; + /** moreToCome is an OP_MSG only concept */ + moreToCome = false; + databaseName: string; + query: Document; + + constructor(databaseName: string, query: Document, options: OpQueryOptions) { + // Basic options needed to be passed in + // TODO(NODE-3483): Replace with MongoCommandError + const ns = `${databaseName}.$cmd`; + if (typeof databaseName !== 'string') { + throw new MongoRuntimeError('Database name must be a string for a query'); + } + // TODO(NODE-3483): Replace with MongoCommandError + if (query == null) throw new MongoRuntimeError('A query document must be specified for query'); + + // Validate that we are not passing 0x00 in the collection name + if (ns.indexOf('\x00') !== -1) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new MongoRuntimeError('Namespace cannot contain a null character'); + } + + // Basic optionsa + this.databaseName = databaseName; + this.query = query; + this.ns = ns; + + // Additional options + this.numberToSkip = options.numberToSkip || 0; + this.numberToReturn = options.numberToReturn || 0; + this.returnFieldSelector = options.returnFieldSelector || undefined; + this.requestId = options.requestId ?? OpQueryRequest.getRequestId(); + + // special case for pre-3.2 find commands, delete ASAP + this.pre32Limit = options.pre32Limit; + + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.batchSize = this.numberToReturn; + + // Flags + this.tailable = false; + this.secondaryOk = typeof options.secondaryOk === 'boolean' ? options.secondaryOk : false; + this.oplogReplay = false; + this.noCursorTimeout = false; + this.awaitData = false; + this.exhaust = false; + this.partial = false; + } + + /** Assign next request Id. */ + incRequestId(): void { + this.requestId = _requestId++; + } + + /** Peek next request Id. */ + nextRequestId(): number { + return _requestId + 1; + } + + /** Increment then return next request Id. */ + static getRequestId(): number { + return ++_requestId; + } + + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin(): Uint8Array[] { + const buffers = []; + let projection = null; + + // Set up the flags + let flags = 0; + if (this.tailable) { + flags |= OPTS_TAILABLE_CURSOR; + } + + if (this.secondaryOk) { + flags |= OPTS_SECONDARY; + } + + if (this.oplogReplay) { + flags |= OPTS_OPLOG_REPLAY; + } + + if (this.noCursorTimeout) { + flags |= OPTS_NO_CURSOR_TIMEOUT; + } + + if (this.awaitData) { + flags |= OPTS_AWAIT_DATA; + } + + if (this.exhaust) { + flags |= OPTS_EXHAUST; + } + + if (this.partial) { + flags |= OPTS_PARTIAL; + } + + // If batchSize is different to this.numberToReturn + if (this.batchSize !== this.numberToReturn) this.numberToReturn = this.batchSize; + + // Allocate write protocol header buffer + const header = ByteUtils.allocate( + 4 * 4 + // Header + 4 + // Flags + ByteUtils.utf8ByteLength(this.ns) + + 1 + // namespace + 4 + // numberToSkip + 4 // numberToReturn + ); + + // Add header to buffers + buffers.push(header); + + // Serialize the query + const query = BSON.serialize(this.query, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + + // Add query document + buffers.push(query); + + if (this.returnFieldSelector && Object.keys(this.returnFieldSelector).length > 0) { + // Serialize the projection document + projection = BSON.serialize(this.returnFieldSelector, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + // Add projection document + buffers.push(projection); + } + + // Total message size + const totalLength = header.length + query.length + (projection ? projection.length : 0); + + // Set up the index + let index = 4; + + // Write total document length + header[3] = (totalLength >> 24) & 0xff; + header[2] = (totalLength >> 16) & 0xff; + header[1] = (totalLength >> 8) & 0xff; + header[0] = totalLength & 0xff; + + // Write header information requestId + header[index + 3] = (this.requestId >> 24) & 0xff; + header[index + 2] = (this.requestId >> 16) & 0xff; + header[index + 1] = (this.requestId >> 8) & 0xff; + header[index] = this.requestId & 0xff; + index = index + 4; + + // Write header information responseTo + header[index + 3] = (0 >> 24) & 0xff; + header[index + 2] = (0 >> 16) & 0xff; + header[index + 1] = (0 >> 8) & 0xff; + header[index] = 0 & 0xff; + index = index + 4; + + // Write header information OP_QUERY + header[index + 3] = (OP_QUERY >> 24) & 0xff; + header[index + 2] = (OP_QUERY >> 16) & 0xff; + header[index + 1] = (OP_QUERY >> 8) & 0xff; + header[index] = OP_QUERY & 0xff; + index = index + 4; + + // Write header information flags + header[index + 3] = (flags >> 24) & 0xff; + header[index + 2] = (flags >> 16) & 0xff; + header[index + 1] = (flags >> 8) & 0xff; + header[index] = flags & 0xff; + index = index + 4; + + // Write collection name + index = index + encodeUTF8Into(header, this.ns, index) + 1; + header[index - 1] = 0; + + // Write header information flags numberToSkip + header[index + 3] = (this.numberToSkip >> 24) & 0xff; + header[index + 2] = (this.numberToSkip >> 16) & 0xff; + header[index + 1] = (this.numberToSkip >> 8) & 0xff; + header[index] = this.numberToSkip & 0xff; + index = index + 4; + + // Write header information flags numberToReturn + header[index + 3] = (this.numberToReturn >> 24) & 0xff; + header[index + 2] = (this.numberToReturn >> 16) & 0xff; + header[index + 1] = (this.numberToReturn >> 8) & 0xff; + header[index] = this.numberToReturn & 0xff; + index = index + 4; + + // Return the buffers + return buffers; + } +} + +/** @internal */ +export interface MessageHeader { + length: number; + requestId: number; + responseTo: number; + opCode: number; + fromCompressed?: boolean; +} + +/** @internal */ +export class OpReply { + parsed: boolean; + raw: Uint8Array; + data: Uint8Array; + opts: BSONSerializeOptions; + length: number; + requestId: number; + responseTo: number; + opCode: number; + fromCompressed?: boolean; + responseFlags?: number; + cursorId?: Long; + startingFrom?: number; + numberReturned?: number; + cursorNotFound?: boolean; + queryFailure?: boolean; + shardConfigStale?: boolean; + awaitCapable?: boolean; + useBigInt64: boolean; + promoteLongs: boolean; + promoteValues: boolean; + promoteBuffers: boolean; + bsonRegExp?: boolean; + index = 0; + sections: Uint8Array[] = []; + + /** moreToCome is an OP_MSG only concept */ + moreToCome = false; + + constructor( + message: Uint8Array, + msgHeader: MessageHeader, + msgBody: Uint8Array, + opts?: BSONSerializeOptions + ) { + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts ?? { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + + // Flag values + this.useBigInt64 = typeof this.opts.useBigInt64 === 'boolean' ? this.opts.useBigInt64 : false; + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + } + + isParsed(): boolean { + return this.parsed; + } + + parse(): Uint8Array { + // Don't parse again if not needed + if (this.parsed) return this.sections[0]; + + // Position within OP_REPLY at which documents start + // (See https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#wire-op-reply) + this.index = 20; + + // Read the message body + this.responseFlags = readInt32LE(this.data, 0); + this.cursorId = new BSON.Long(readInt32LE(this.data, 4), readInt32LE(this.data, 8)); + this.startingFrom = readInt32LE(this.data, 12); + this.numberReturned = readInt32LE(this.data, 16); + + if (this.numberReturned < 0 || this.numberReturned > 2 ** 32 - 1) { + throw new RangeError( + `OP_REPLY numberReturned is an invalid array length ${this.numberReturned}` + ); + } + + this.cursorNotFound = (this.responseFlags & CURSOR_NOT_FOUND) !== 0; + this.queryFailure = (this.responseFlags & QUERY_FAILURE) !== 0; + this.shardConfigStale = (this.responseFlags & SHARD_CONFIG_STALE) !== 0; + this.awaitCapable = (this.responseFlags & AWAIT_CAPABLE) !== 0; + + // Parse Body + for (let i = 0; i < this.numberReturned; i++) { + const bsonSize = + this.data[this.index] | + (this.data[this.index + 1] << 8) | + (this.data[this.index + 2] << 16) | + (this.data[this.index + 3] << 24); + + const section = this.data.subarray(this.index, this.index + bsonSize); + this.sections.push(section); + + // Adjust the index + this.index = this.index + bsonSize; + } + + // Set parsed + this.parsed = true; + + return this.sections[0]; + } +} + +// Msg Flags +const OPTS_CHECKSUM_PRESENT = 1; +const OPTS_MORE_TO_COME = 2; +const OPTS_EXHAUST_ALLOWED = 1 << 16; + +/** @internal */ +export interface OpMsgOptions { + socketTimeoutMS?: number; + session?: ClientSession; + numberToSkip?: number; + numberToReturn?: number; + returnFieldSelector?: Document; + pre32Limit?: number; + serializeFunctions?: boolean; + ignoreUndefined?: boolean; + maxBsonSize?: number; + checkKeys?: boolean; + secondaryOk?: boolean; + + requestId?: number; + moreToCome?: boolean; + exhaustAllowed?: boolean; + readPreference: ReadPreference; +} + +/** @internal */ +export class DocumentSequence { + field: string; + documents: Document[]; + serializedDocumentsLength: number; + private chunks: Uint8Array[]; + private header: Uint8Array; + + /** + * Create a new document sequence for the provided field. + * @param field - The field it will replace. + */ + constructor(field: string, documents?: Document[]) { + this.field = field; + this.documents = []; + this.chunks = []; + this.serializedDocumentsLength = 0; + // Document sequences starts with type 1 at the first byte. + // Field strings must always be UTF-8. + const buffer = ByteUtils.allocateUnsafe(1 + 4 + this.field.length + 1); + buffer[0] = 1; + // Third part is the field name at offset 5 with trailing null byte. + encodeUTF8Into(buffer, `${this.field}\0`, 5); + this.chunks.push(buffer); + this.header = buffer; + if (documents) { + for (const doc of documents) { + this.push(doc, BSON.serialize(doc)); + } + } + } + + /** + * Push a document to the document sequence. Will serialize the document + * as well and return the current serialized length of all documents. + * @param document - The document to add. + * @param buffer - The serialized document in raw BSON. + * @returns The new total document sequence length. + */ + push(document: Document, buffer: Uint8Array): number { + this.serializedDocumentsLength += buffer.length; + // Push the document. + this.documents.push(document); + // Push the document raw bson. + this.chunks.push(buffer); + // Write the new length. + if (this.header) { + NumberUtils.setInt32LE( + this.header, + 1, + 4 + this.field.length + 1 + this.serializedDocumentsLength + ); + } + return this.serializedDocumentsLength + this.header.length; + } + + /** + * Get the fully serialized bytes for the document sequence section. + * @returns The section bytes. + */ + toBin(): Uint8Array { + return ByteUtils.concat(this.chunks); + } +} + +/** + * Build a DocumentSequence from documents that have already been serialized, + * reusing the provided buffers instead of re-serializing. + * @internal + */ +export function makeDocumentSequence( + field: string, + documents: Document[], + serialized: Uint8Array[] +): DocumentSequence { + const sequence = new DocumentSequence(field); + for (let i = 0; i < documents.length; i++) { + sequence.push(documents[i], serialized[i]); + } + return sequence; +} + +/** @internal */ +export class OpMsgRequest { + requestId: number; + serializeFunctions: boolean; + ignoreUndefined: boolean; + checkKeys: boolean; + maxBsonSize: number; + checksumPresent: boolean; + moreToCome: boolean; + exhaustAllowed: boolean; + databaseName: string; + command: Document; + options: OpQueryOptions; + + constructor(databaseName: string, command: Document, options: OpQueryOptions) { + // Basic options needed to be passed in + if (command == null) + throw new MongoInvalidArgumentError('Query document must be specified for query'); + + // Basic optionsa + this.databaseName = databaseName; + this.command = command; + this.command.$db = databaseName; + + // Ensure empty options + this.options = options ?? {}; + + // Additional options + this.requestId = options.requestId ? options.requestId : OpMsgRequest.getRequestId(); + + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + + // flags + this.checksumPresent = false; + this.moreToCome = options.moreToCome ?? command.writeConcern?.w === 0; + this.exhaustAllowed = + typeof options.exhaustAllowed === 'boolean' ? options.exhaustAllowed : false; + } + + toBin(): Uint8Array[] { + const buffers: Uint8Array[] = []; + let flags = 0; + + if (this.checksumPresent) { + flags |= OPTS_CHECKSUM_PRESENT; + } + + if (this.moreToCome) { + flags |= OPTS_MORE_TO_COME; + } + + if (this.exhaustAllowed) { + flags |= OPTS_EXHAUST_ALLOWED; + } + + const header = ByteUtils.allocate( + 4 * 4 + // Header + 4 // Flags + ); + + buffers.push(header); + + let totalLength = header.length; + const command = this.command; + totalLength += this.makeSections(buffers, command); + + NumberUtils.setInt32LE(header, 0, totalLength); // messageLength + NumberUtils.setInt32LE(header, 4, this.requestId); // requestID + NumberUtils.setInt32LE(header, 8, 0); // responseTo + NumberUtils.setInt32LE(header, 12, OP_MSG); // opCode + // The OP_MSG spec calls out that flags is uint32: + // https://github.com/mongodb/specifications/blob/master/source/message/OP_MSG.md#op_msg-1 + setUint32LE(header, 16, flags); // flags + return buffers; + } + + /** + * Add the sections to the OP_MSG request's buffers and returns the length. + */ + makeSections(buffers: Uint8Array[], document: Document): number { + const sequencesBuffer = this.extractDocumentSequences(document); + const payloadTypeBuffer = ByteUtils.allocateUnsafe(1); + payloadTypeBuffer[0] = 0; + + const documentBuffer = this.serializeBson(document); + // First section, type 0 + buffers.push(payloadTypeBuffer); + buffers.push(documentBuffer); + // Subsequent sections, type 1 + buffers.push(sequencesBuffer); + + return payloadTypeBuffer.length + documentBuffer.length + sequencesBuffer.length; + } + + /** + * Extracts the document sequences from the command document and returns + * a buffer to be added as multiple sections after the initial type 0 + * section in the message. + */ + extractDocumentSequences(document: Document): Uint8Array { + // Pull out any field in the command document that's value is a document sequence. + const chunks = []; + for (const [key, value] of Object.entries(document)) { + if (value instanceof DocumentSequence) { + chunks.push(value.toBin()); + // Why are we removing the field from the command? This is because it needs to be + // removed in the OP_MSG request first section, and DocumentSequence is not a + // BSON type and is specific to the MongoDB wire protocol so there's nothing + // our BSON serializer can do about this. Since DocumentSequence is not exposed + // in the public API and only used internally, we are never mutating an original + // command provided by the user, just our own, and it's cheaper to delete from + // our own command than copying it. + delete document[key]; + } + } + if (chunks.length > 0) { + return ByteUtils.concat(chunks); + } + // If we have no document sequences we return an empty buffer for nothing to add + // to the payload. + return ByteUtils.allocate(0); + } + + serializeBson(document: Document): Uint8Array { + return BSON.serialize(document, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + } + + static getRequestId(): number { + _requestId = (_requestId + 1) & 0x7fffffff; + return _requestId; + } +} + +/** @internal */ +export class OpMsgResponse { + parsed: boolean; + raw: Uint8Array; + data: Uint8Array; + opts: BSONSerializeOptions; + length: number; + requestId: number; + responseTo: number; + opCode: number; + fromCompressed?: boolean; + responseFlags: number; + checksumPresent: boolean; + /** Indicates the server will be sending more responses on this connection */ + moreToCome: boolean; + exhaustAllowed: boolean; + useBigInt64: boolean; + promoteLongs: boolean; + promoteValues: boolean; + promoteBuffers: boolean; + bsonRegExp: boolean; + index = 0; + sections: Uint8Array[] = []; + + constructor( + message: Uint8Array, + msgHeader: MessageHeader, + msgBody: Uint8Array, + opts?: BSONSerializeOptions + ) { + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts ?? { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + + // Read response flags + this.responseFlags = readInt32LE(msgBody, 0); + this.checksumPresent = (this.responseFlags & OPTS_CHECKSUM_PRESENT) !== 0; + this.moreToCome = (this.responseFlags & OPTS_MORE_TO_COME) !== 0; + this.exhaustAllowed = (this.responseFlags & OPTS_EXHAUST_ALLOWED) !== 0; + this.useBigInt64 = typeof this.opts.useBigInt64 === 'boolean' ? this.opts.useBigInt64 : false; + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + } + + isParsed(): boolean { + return this.parsed; + } + + parse(): Uint8Array { + // Don't parse again if not needed + if (this.parsed) return this.sections[0]; + + this.index = 4; + + while (this.index < this.data.length) { + const payloadType = this.data[this.index++]; + if (payloadType === 0) { + // BSON spec specifies that this is a 32-bit signed integer: https://bsonspec.org/spec.html#:~:text=%3A%3A%3D-,int32,-e_list%20unsigned_byte(0 + // While allowing negative sizes seems odd, in practice we never expect a negative size. Also, the server's 16mb limit for BSON documents leaves plenty + // of room in an int32 to store a document of the max BSON size that the server supports + const bsonSize = readInt32LE(this.data, this.index); + const bin = this.data.subarray(this.index, this.index + bsonSize); + + this.sections.push(bin); + + this.index += bsonSize; + } else if (payloadType === 1) { + // It was decided that no driver makes use of payload type 1 + + // TODO(NODE-3483): Replace with MongoDeprecationError + throw new MongoRuntimeError('OP_MSG Payload Type 1 detected unsupported protocol'); + } + } + + this.parsed = true; + + return this.sections[0]; + } +} + +const MESSAGE_HEADER_SIZE = 16; +const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compressorID + +/** + * @internal + */ +export interface OpCompressesRequestOptions { + zlibCompressionLevel: number; + agreedCompressor: CompressorName; +} + +/** + * @internal + * + * An OP_COMPRESSED request wraps either an OP_QUERY or OP_MSG message. + */ +export class OpCompressedRequest { + private command: WriteProtocolMessageType; + private options: OpCompressesRequestOptions; + + constructor(command: WriteProtocolMessageType, options: OpCompressesRequestOptions) { + this.command = command; + this.options = { + zlibCompressionLevel: options.zlibCompressionLevel, + agreedCompressor: options.agreedCompressor + }; + } + + // Return whether a command contains an uncompressible command term + // Will return true if command contains no uncompressible command terms + static canCompress(command: WriteProtocolMessageType) { + const commandDoc = command instanceof OpMsgRequest ? command.command : command.query; + const commandName = Object.keys(commandDoc)[0]; + return !uncompressibleCommands.has(commandName); + } + + async toBin(): Promise { + const concatenatedOriginalCommandBuffer = ByteUtils.concat(this.command.toBin()); + // otherwise, compress the message + const messageToBeCompressed = concatenatedOriginalCommandBuffer.slice(MESSAGE_HEADER_SIZE); + + // Extract information needed for OP_COMPRESSED from the uncompressed message + const originalCommandOpCode = readInt32LE(concatenatedOriginalCommandBuffer, 12); + + // Compress the message body + const compressedMessage = await compress(this.options, messageToBeCompressed); + // Create the msgHeader of OP_COMPRESSED + const msgHeader = ByteUtils.allocate(MESSAGE_HEADER_SIZE); + NumberUtils.setInt32LE( + msgHeader, + 0, + MESSAGE_HEADER_SIZE + COMPRESSION_DETAILS_SIZE + compressedMessage.length + ); // messageLength + NumberUtils.setInt32LE(msgHeader, 4, this.command.requestId); // requestID + NumberUtils.setInt32LE(msgHeader, 8, 0); // responseTo (zero) + NumberUtils.setInt32LE(msgHeader, 12, OP_COMPRESSED); // opCode + // Create the compression details of OP_COMPRESSED + const compressionDetails = ByteUtils.allocate(COMPRESSION_DETAILS_SIZE); + NumberUtils.setInt32LE(compressionDetails, 0, originalCommandOpCode); // originalOpcode + NumberUtils.setInt32LE(compressionDetails, 4, messageToBeCompressed.length); // Size of the uncompressed compressedMessage, excluding the MsgHeader + compressionDetails[8] = Compressor[this.options.agreedCompressor]; // compressorID + return [msgHeader, compressionDetails, compressedMessage]; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connect.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connect.ts new file mode 100644 index 00000000..0c77c278 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connect.ts @@ -0,0 +1,538 @@ +import type { Socket, SocketConnectOpts } from 'net'; +import * as net from 'net'; +import type { ConnectionOptions as TLSConnectionOpts, TLSSocket } from 'tls'; +import * as tls from 'tls'; + +import type { Document } from '../bson'; +import { LEGACY_HELLO_COMMAND } from '../constants'; +import { getSocks, type SocksLib } from '../deps'; +import { + MongoCompatibilityError, + MongoError, + MongoErrorLabel, + MongoInvalidArgumentError, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoRuntimeError, + needsRetryableWriteLabel +} from '../error'; +import { HostAddress, ns, promiseWithResolvers } from '../utils'; +import { AuthContext } from './auth/auth_provider'; +import { AuthMechanism } from './auth/providers'; +import { + type CommandOptions, + Connection, + type ConnectionOptions, + CryptoConnection +} from './connection'; +import { + MAX_SUPPORTED_SERVER_VERSION, + MAX_SUPPORTED_WIRE_VERSION, + MIN_SUPPORTED_SERVER_VERSION, + MIN_SUPPORTED_WIRE_VERSION +} from './wire_protocol/constants'; + +/** @public */ +export type Stream = Socket | TLSSocket; + +function applyBackpressureLabels(error: MongoError) { + error.addErrorLabel(MongoErrorLabel.SystemOverloadedError); + error.addErrorLabel(MongoErrorLabel.RetryableError); +} + +export async function connect(options: ConnectionOptions): Promise { + let connection: Connection | null = null; + try { + const socket = await makeSocket(options); + connection = makeConnection(options, socket); + await performInitialHandshake(connection, options); + return connection; + } catch (error) { + connection?.destroy(); + throw error; + } +} + +export function makeConnection(options: ConnectionOptions, socket: Stream): Connection { + let ConnectionType = options.connectionType ?? Connection; + if (options.autoEncrypter) { + ConnectionType = CryptoConnection; + } + + return new ConnectionType(socket, options); +} + +function checkSupportedServer(hello: Document, options: ConnectionOptions) { + const maxWireVersion = Number(hello.maxWireVersion); + const minWireVersion = Number(hello.minWireVersion); + const serverVersionHighEnough = + !Number.isNaN(maxWireVersion) && maxWireVersion >= MIN_SUPPORTED_WIRE_VERSION; + const serverVersionLowEnough = + !Number.isNaN(minWireVersion) && minWireVersion <= MAX_SUPPORTED_WIRE_VERSION; + + if (serverVersionHighEnough) { + if (serverVersionLowEnough) { + return null; + } + + const message = `Server at ${options.hostAddress} reports minimum wire version ${JSON.stringify( + hello.minWireVersion + )}, but this version of the Node.js Driver requires at most ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`; + return new MongoCompatibilityError(message); + } + + const message = `Server at ${options.hostAddress} reports maximum wire version ${ + JSON.stringify(hello.maxWireVersion) ?? 0 + }, but this version of the Node.js Driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION})`; + return new MongoCompatibilityError(message); +} + +export async function performInitialHandshake( + conn: Connection, + options: ConnectionOptions +): Promise { + const credentials = options.credentials; + + if (credentials) { + if ( + !(credentials.mechanism === AuthMechanism.MONGODB_DEFAULT) && + !options.authProviders.getOrCreateProvider( + credentials.mechanism, + credentials.mechanismProperties + ) + ) { + throw new MongoInvalidArgumentError(`AuthMechanism '${credentials.mechanism}' not supported`); + } + } + + const authContext = new AuthContext(conn, credentials, options); + conn.authContext = authContext; + + // If we encounter an error preparing the handshake document, do NOT apply backpressure labels. Errors + // encountered building the handshake document are all client-side, and do not indicate an overloaded server. + const handshakeDoc = await prepareHandshakeDocument(authContext); + + // @ts-expect-error: TODO(NODE-5141): The options need to be filtered properly, Connection options differ from Command options + const handshakeOptions: CommandOptions = { ...options, raw: false }; + if (typeof options.connectTimeoutMS === 'number') { + // The handshake technically is a monitoring check, so its socket timeout should be connectTimeoutMS + handshakeOptions.socketTimeoutMS = options.connectTimeoutMS; + } + + const start = new Date().getTime(); + + const response = await executeHandshake(handshakeDoc, handshakeOptions); + + if (!('isWritablePrimary' in response)) { + // Provide hello-style response document. + response.isWritablePrimary = response[LEGACY_HELLO_COMMAND]; + } + + if (response.helloOk) { + conn.helloOk = true; + } + + const supportedServerErr = checkSupportedServer(response, options); + if (supportedServerErr) { + throw supportedServerErr; + } + + if (options.loadBalanced) { + if (!response.serviceId) { + throw new MongoCompatibilityError( + 'Driver attempted to initialize in load balancing mode, ' + + 'but the server does not support this mode.' + ); + } + } + + // NOTE: This is metadata attached to the connection while porting away from + // handshake being done in the `Server` class. Likely, it should be + // relocated, or at very least restructured. + conn.hello = response; + conn.lastHelloMS = new Date().getTime() - start; + + if (!response.arbiterOnly && credentials) { + // store the response on auth context + authContext.response = response; + + const resolvedCredentials = credentials.resolveAuthMechanism(response); + const provider = options.authProviders.getOrCreateProvider( + resolvedCredentials.mechanism, + resolvedCredentials.mechanismProperties + ); + if (!provider) { + throw new MongoInvalidArgumentError( + `No AuthProvider for ${resolvedCredentials.mechanism} defined.` + ); + } + + try { + await provider.auth(authContext); + } catch (error) { + // NOTE: If we encounter an error authenticating a connection, do NOT apply backpressure labels. + + if (error instanceof MongoError) { + error.addErrorLabel(MongoErrorLabel.HandshakeError); + if (needsRetryableWriteLabel(error)) { + error.addErrorLabel(MongoErrorLabel.RetryableWriteError); + } + } + + throw error; + } + } + + // Connection establishment is socket creation (tcp handshake, tls handshake, MongoDB handshake (saslStart, saslContinue)) + // Once connection is established, command logging can log events (if enabled) + conn.established = true; + + async function executeHandshake(handshakeDoc: Document, handshakeOptions: CommandOptions) { + try { + const handshakeResponse = await conn.command( + ns('admin.$cmd'), + handshakeDoc, + handshakeOptions + ); + return handshakeResponse; + } catch (error) { + if (error instanceof MongoError) { + error.addErrorLabel(MongoErrorLabel.HandshakeError); + } + // If we encounter a network error executing the initial handshake, apply backpressure labels. + if (error instanceof MongoNetworkError) { + applyBackpressureLabels(error); + } + + throw error; + } + } +} + +/** + * HandshakeDocument used during authentication. + * @internal + */ +export interface HandshakeDocument extends Document { + /** + * @deprecated Use hello instead + */ + ismaster?: boolean; + hello?: boolean; + helloOk?: boolean; + client: Document; + compression: string[]; + saslSupportedMechs?: string; + loadBalanced?: boolean; + backpressure: '2'; +} + +/** + * @internal + * + * This function is only exposed for testing purposes. + */ +export async function prepareHandshakeDocument( + authContext: AuthContext +): Promise { + const options = authContext.options; + const compressors = options.compressors ? options.compressors : []; + const { serverApi } = authContext.connection; + const clientMetadata: Document = await options.metadata; + + const handshakeDoc: HandshakeDocument = { + [serverApi?.version || options.loadBalanced === true ? 'hello' : LEGACY_HELLO_COMMAND]: 1, + backpressure: '2', + helloOk: true, + client: clientMetadata, + compression: compressors + }; + + if (options.loadBalanced === true) { + handshakeDoc.loadBalanced = true; + } + + const credentials = authContext.credentials; + if (credentials) { + if (credentials.mechanism === AuthMechanism.MONGODB_DEFAULT && credentials.username) { + handshakeDoc.saslSupportedMechs = `${credentials.source}.${credentials.username}`; + + const provider = authContext.options.authProviders.getOrCreateProvider( + AuthMechanism.MONGODB_SCRAM_SHA256, + credentials.mechanismProperties + ); + if (!provider) { + // This auth mechanism is always present. + throw new MongoInvalidArgumentError( + `No AuthProvider for ${AuthMechanism.MONGODB_SCRAM_SHA256} defined.` + ); + } + return await provider.prepare(handshakeDoc, authContext); + } + const provider = authContext.options.authProviders.getOrCreateProvider( + credentials.mechanism, + credentials.mechanismProperties + ); + if (!provider) { + throw new MongoInvalidArgumentError(`No AuthProvider for ${credentials.mechanism} defined.`); + } + return await provider.prepare(handshakeDoc, authContext); + } + return handshakeDoc; +} + +/** + * @internal + * Default TCP keepAlive initial delay in milliseconds. + * Set to half the Azure load balancer idle timeout (240s) to ensure + * probes fire well before cloud LBs (Azure, AWS PrivateLink/NLB) + * drop idle connections. + */ +export const DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS = 120_000; + +/** @public */ +export const LEGAL_TLS_SOCKET_OPTIONS = [ + 'allowPartialTrustChain', + 'ALPNProtocols', + 'ca', + 'cert', + 'checkServerIdentity', + 'ciphers', + 'crl', + 'ecdhCurve', + 'key', + 'minDHSize', + 'passphrase', + 'pfx', + 'rejectUnauthorized', + 'secureContext', + 'secureProtocol', + 'servername', + 'session' +] as const; + +/** @public */ +export const LEGAL_TCP_SOCKET_OPTIONS = [ + 'autoSelectFamily', + 'autoSelectFamilyAttemptTimeout', + 'keepAliveInitialDelay', + 'family', + 'hints', + 'localAddress', + 'localPort', + 'lookup' +] as const; + +function parseConnectOptions(options: ConnectionOptions): SocketConnectOpts { + const hostAddress = options.hostAddress; + if (!hostAddress) throw new MongoInvalidArgumentError('Option "hostAddress" is required'); + + const result: Partial = {}; + for (const name of LEGAL_TCP_SOCKET_OPTIONS) { + if (options[name] != null) { + (result as Document)[name] = options[name]; + } + } + result.keepAliveInitialDelay ??= DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS; + result.keepAlive = true; + result.noDelay = options.noDelay ?? true; + + if (typeof hostAddress.socketPath === 'string') { + result.path = hostAddress.socketPath; + return result as net.IpcNetConnectOpts; + } else if (typeof hostAddress.host === 'string') { + result.host = hostAddress.host; + result.port = hostAddress.port; + return result as net.TcpNetConnectOpts; + } else { + // This should never happen since we set up HostAddresses + // But if we don't throw here the socket could hang until timeout + // TODO(NODE-3483) + throw new MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(hostAddress)}`); + } +} + +type MakeConnectionOptions = ConnectionOptions & { existingSocket?: Stream }; + +function parseSslOptions(options: MakeConnectionOptions): TLSConnectionOpts { + const result: TLSConnectionOpts = parseConnectOptions(options); + // Merge in valid SSL options + for (const name of LEGAL_TLS_SOCKET_OPTIONS) { + if (options[name] != null) { + (result as Document)[name] = options[name]; + } + } + + if (options.existingSocket) { + result.socket = options.existingSocket; + } + + // Set default sni servername to be the same as host + if (result.servername == null && result.host && !net.isIP(result.host)) { + result.servername = result.host; + } + + return result; +} + +export async function makeSocket(options: MakeConnectionOptions): Promise { + const useTLS = options.tls ?? false; + const connectTimeoutMS = options.connectTimeoutMS ?? 30000; + const existingSocket = options.existingSocket; + const keepAliveInitialDelay = + options.keepAliveInitialDelay ?? DEFAULT_KEEP_ALIVE_INITIAL_DELAY_MS; + const noDelay = options.noDelay ?? true; + + let socket: Stream; + + if (options.proxyHost != null) { + // Currently, only Socks5 is supported. + return await makeSocks5Connection({ + ...options, + connectTimeoutMS // Should always be present for Socks5 + }); + } + + if (useTLS) { + const tlsSocket = tls.connect(parseSslOptions(options)); + if (typeof tlsSocket.disableRenegotiation === 'function') { + tlsSocket.disableRenegotiation(); + } + socket = tlsSocket; + } else if (existingSocket) { + // In the TLS case, parseSslOptions() sets options.socket to existingSocket, + // so we only need to handle the non-TLS case here (where existingSocket + // gives us all we need out of the box). + socket = existingSocket; + } else { + socket = net.createConnection(parseConnectOptions(options)); + } + + // Explicit setKeepAlive/setNoDelay are required because tls.connect() silently + // ignores these constructor options due to a Node.js bug. + // See: https://github.com/nodejs/node/issues/62003 + // TODO(NODE-7474): remove this fix once the underlying Node.js issue is resolved. + socket.setKeepAlive(true, keepAliveInitialDelay); + socket.setNoDelay(noDelay); + socket.setTimeout(connectTimeoutMS); + + let cancellationHandler: ((err: Error) => void) | null = null; + + const { promise: connectedSocket, resolve, reject } = promiseWithResolvers(); + if (existingSocket) { + resolve(socket); + } else { + const start = performance.now(); + const connectEvent = useTLS ? 'secureConnect' : 'connect'; + socket + .once(connectEvent, () => resolve(socket)) + .once('error', cause => + reject(new MongoNetworkError(MongoError.buildErrorMessage(cause), { cause })) + ) + .once('timeout', () => { + reject( + new MongoNetworkTimeoutError( + `Socket '${connectEvent}' timed out after ${(performance.now() - start) | 0}ms (connectTimeoutMS: ${connectTimeoutMS})` + ) + ); + }) + .once('close', () => + reject( + new MongoNetworkError( + `Socket closed after ${(performance.now() - start) | 0} during connection establishment` + ) + ) + ); + + if (options.cancellationToken != null) { + cancellationHandler = () => + reject( + new MongoNetworkError( + `Socket connection establishment was cancelled after ${(performance.now() - start) | 0}` + ) + ); + options.cancellationToken.once('cancel', cancellationHandler); + } + } + + try { + socket = await connectedSocket; + return socket; + } catch (error) { + // If we encounter an error while establishing a socket, apply the backpressure labels to it. We cannot + // differentiate between DNS, TLS errors and network errors without refactoring our connection establishment to + // handle all three steps separately. + applyBackpressureLabels(error); + socket.destroy(); + throw error; + } finally { + socket.setTimeout(0); + if (cancellationHandler != null) { + options.cancellationToken?.removeListener('cancel', cancellationHandler); + } + } +} + +let socks: SocksLib | null = null; +function loadSocks() { + if (socks == null) { + const socksImport = getSocks(); + if ('kModuleError' in socksImport) { + throw socksImport.kModuleError; + } + socks = socksImport; + } + return socks; +} + +async function makeSocks5Connection(options: MakeConnectionOptions): Promise { + const hostAddress = HostAddress.fromHostPort( + options.proxyHost ?? '', // proxyHost is guaranteed to set here + options.proxyPort ?? 1080 + ); + + // First, connect to the proxy server itself: + const rawSocket = await makeSocket({ + ...options, + hostAddress, + tls: false, + proxyHost: undefined + }); + + const destination = parseConnectOptions(options) as net.TcpNetConnectOpts; + if (typeof destination.host !== 'string' || typeof destination.port !== 'number') { + throw new MongoInvalidArgumentError('Can only make Socks5 connections to TCP hosts'); + } + + socks ??= loadSocks(); + + let existingSocket: Stream; + + try { + // Then, establish the Socks5 proxy connection: + const connection = await socks.SocksClient.createConnection({ + existing_socket: rawSocket, + timeout: options.connectTimeoutMS, + command: 'connect', + destination: { + host: destination.host, + port: destination.port + }, + proxy: { + // host and port are ignored because we pass existing_socket + host: 'iLoveJavaScript', + port: 0, + type: 5, + userId: options.proxyUsername || undefined, + password: options.proxyPassword || undefined + } + }); + existingSocket = connection.socket; + } catch (cause) { + throw new MongoNetworkError(MongoError.buildErrorMessage(cause), { cause }); + } + + // Finally, now treat the resulting duplex stream as the + // socket over which we send and receive wire protocol messages: + return await makeSocket({ ...options, existingSocket, proxyHost: undefined }); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection.ts new file mode 100644 index 00000000..7823e312 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection.ts @@ -0,0 +1,940 @@ +import { type Readable, Transform, type TransformCallback } from 'stream'; +import { clearTimeout, setTimeout } from 'timers'; + +import { + type BSONSerializeOptions, + ByteUtils, + deserialize, + type DeserializeOptions, + type Document, + type ObjectId +} from '../bson'; +import { type AutoEncrypter } from '../client-side-encryption/auto_encrypter'; +import { + CLOSE, + CLUSTER_TIME_RECEIVED, + COMMAND_FAILED, + COMMAND_STARTED, + COMMAND_SUCCEEDED, + kDecorateResult, + PINNED, + UNPINNED +} from '../constants'; +import { + MongoCompatibilityError, + MONGODB_ERROR_CODES, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoOperationTimeoutError, + MongoParseError, + MongoRuntimeError, + MongoServerError, + MongoUnexpectedServerResponseError +} from '../error'; +import type { ServerApi, SupportedNodeConnectionOptions } from '../mongo_client'; +import { type MongoClientAuthProviders } from '../mongo_client_auth_providers'; +import { MongoLoggableComponent, type MongoLogger, SeverityLevel } from '../mongo_logger'; +import { type Abortable, type CancellationToken, TypedEventEmitter } from '../mongo_types'; +import { ReadPreference, type ReadPreferenceLike } from '../read_preference'; +import { type Runtime } from '../runtime_adapters'; +import { ServerType } from '../sdam/common'; +import { applySession, type ClientSession, updateSessionFromResponse } from '../sessions'; +import { type TimeoutContext, TimeoutError } from '../timeout'; +import { + BufferPool, + calculateDurationInMs, + type Callback, + decorateDecryptionResult, + HostAddress, + maxWireVersion, + type MongoDBNamespace, + noop, + once, + processTimeMS, + squashError, + uuidV4 +} from '../utils'; +import type { WriteConcern } from '../write_concern'; +import type { AuthContext } from './auth/auth_provider'; +import type { MongoCredentials } from './auth/mongo_credentials'; +import { + CommandFailedEvent, + CommandStartedEvent, + CommandSucceededEvent +} from './command_monitoring_events'; +import { + OpCompressedRequest, + OpMsgRequest, + type OpMsgResponse, + OpQueryRequest, + type OpReply, + type WriteProtocolMessageType +} from './commands'; +import type { Stream } from './connect'; +import type { ClientMetadata } from './handshake/client_metadata'; +import { StreamDescription, type StreamDescriptionOptions } from './stream_description'; +import { type CompressorName, decompressResponse } from './wire_protocol/compression'; +import { onData } from './wire_protocol/on_data'; +import { + CursorResponse, + MongoDBResponse, + type MongoDBResponseConstructor +} from './wire_protocol/responses'; +import { getReadPreference, isSharded } from './wire_protocol/shared'; + +/** @internal */ +export interface CommandOptions extends BSONSerializeOptions { + secondaryOk?: boolean; + /** Specify read preference if command supports it */ + readPreference?: ReadPreferenceLike; + monitoring?: boolean; + socketTimeoutMS?: number; + /** Session to use for the operation */ + session?: ClientSession; + documentsReturnedIn?: string; + omitMaxTimeMS?: boolean; + + // TODO(NODE-2802): Currently the CommandOptions take a property willRetryWrite which is a hint + // from executeOperation that the txnNum should be applied to this command. + // Applying a session to a command should happen as part of command construction, + // most likely in the CommandOperation#executeCommand method, where we have access to + // the details we need to determine if a txnNum should also be applied. + willRetryWrite?: boolean; + + writeConcern?: WriteConcern; + + directConnection?: boolean; + + /** @internal */ + timeoutContext?: TimeoutContext; +} + +/** @public */ +export interface ProxyOptions { + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; +} + +/** @public */ +export interface ConnectionOptions + extends SupportedNodeConnectionOptions, + StreamDescriptionOptions, + ProxyOptions { + // Internal creation info + id: number | ''; + generation: number; + hostAddress: HostAddress; + /** @internal */ + autoEncrypter?: AutoEncrypter; + serverApi?: ServerApi; + monitorCommands: boolean; + /** @internal */ + connectionType?: any; + credentials?: MongoCredentials; + /** @internal */ + authProviders: MongoClientAuthProviders; + connectTimeoutMS?: number; + tls: boolean; + noDelay?: boolean; + socketTimeoutMS?: number; + /** @internal */ + cancellationToken?: CancellationToken; + /** @internal */ + metadata: Promise; + /** @internal */ + mongoLogger?: MongoLogger | undefined; + /** @internal */ + runtime: Promise; +} + +/** @public */ +export type ConnectionEvents = { + commandStarted(event: CommandStartedEvent): void; + commandSucceeded(event: CommandSucceededEvent): void; + commandFailed(event: CommandFailedEvent): void; + clusterTimeReceived(clusterTime: Document): void; + close(): void; + pinned(pinType: string): void; + unpinned(pinType: string): void; +}; + +/** @internal */ +export function hasSessionSupport(conn: Connection): boolean { + const description = conn.description; + return description.logicalSessionTimeoutMinutes != null; +} + +function streamIdentifier(stream: Stream, options: ConnectionOptions): string { + if (options.proxyHost) { + // If proxy options are specified, the properties of `stream` itself + // will not accurately reflect what endpoint this is connected to. + return options.hostAddress.toString(); + } + + const { remoteAddress, remotePort } = stream; + if (typeof remoteAddress === 'string' && typeof remotePort === 'number') { + return HostAddress.fromHostPort(remoteAddress, remotePort).toString(); + } + + return ByteUtils.toHex(uuidV4()); +} + +/** @internal */ +export class Connection extends TypedEventEmitter { + public id: number | ''; + public address: string; + public lastHelloMS = -1; + public serverApi?: ServerApi; + public helloOk = false; + public authContext?: AuthContext; + public delayedTimeoutId: NodeJS.Timeout | null = null; + public generation: number; + public accessToken?: string; + public readonly description: Readonly; + /** + * Represents if the connection has been established: + * - TCP handshake + * - TLS negotiated + * - mongodb handshake (saslStart, saslContinue), includes authentication + * + * Once connection is established, command logging can log events (if enabled) + */ + public established: boolean; + /** Indicates that the connection (including underlying TCP socket) has been closed. */ + public closed = false; + + private lastUseTime: number; + private clusterTime: Document | null = null; + private error: Error | null = null; + private dataEvents: AsyncGenerator | null = null; + + private readonly socketTimeoutMS: number; + private readonly monitorCommands: boolean; + private readonly socket: Stream; + private readonly messageStream: Readable; + + /** @event */ + static readonly COMMAND_STARTED = COMMAND_STARTED; + /** @event */ + static readonly COMMAND_SUCCEEDED = COMMAND_SUCCEEDED; + /** @event */ + static readonly COMMAND_FAILED = COMMAND_FAILED; + /** @event */ + static readonly CLUSTER_TIME_RECEIVED = CLUSTER_TIME_RECEIVED; + /** @event */ + static readonly CLOSE = CLOSE; + /** @event */ + static readonly PINNED = PINNED; + /** @event */ + static readonly UNPINNED = UNPINNED; + + constructor(stream: Stream, options: ConnectionOptions) { + super(); + this.on('error', noop); + + this.socket = stream; + this.id = options.id; + this.address = streamIdentifier(stream, options); + this.socketTimeoutMS = options.socketTimeoutMS ?? 0; + this.monitorCommands = options.monitorCommands; + this.serverApi = options.serverApi; + this.mongoLogger = options.mongoLogger; + this.established = false; + + this.description = new StreamDescription(this.address, options); + this.generation = options.generation; + this.lastUseTime = processTimeMS(); + + this.messageStream = this.socket + .on('error', this.onSocketError.bind(this)) + .pipe(new SizedMessageTransform({ connection: this })) + .on('error', this.onTransformError.bind(this)); + this.socket.on('close', this.onClose.bind(this)); + this.socket.on('timeout', this.onTimeout.bind(this)); + + this.messageStream.pause(); + } + + public get hello() { + return this.description.hello; + } + + // the `connect` method stores the result of the handshake hello on the connection + public set hello(response: Document | null) { + this.description.receiveResponse(response); + Object.freeze(this.description); + } + + public get serviceId(): ObjectId | undefined { + return this.hello?.serviceId; + } + + public get loadBalanced(): boolean { + return this.description.loadBalanced; + } + + public get idleTime(): number { + return calculateDurationInMs(this.lastUseTime); + } + + private get hasSessionSupport(): boolean { + return this.description.logicalSessionTimeoutMinutes != null; + } + + private get supportsOpMsg(): boolean { + return ( + this.description != null && + // OP_MSG was introduced in server 3.6 (wire version 6). This also guards + // against the pre-handshake case where maxWireVersion() returns 0. + // TODO(NODE-6672,NODE-6287): remove this helper once OP_QUERY support is dropped + maxWireVersion(this) >= 6 && + !this.description.__nodejs_mock_server__ + ); + } + + private get shouldEmitAndLogCommand(): boolean { + return ( + (this.monitorCommands || + (this.established && + !this.authContext?.reauthenticating && + this.mongoLogger?.willLog(MongoLoggableComponent.COMMAND, SeverityLevel.DEBUG))) ?? + false + ); + } + + public markAvailable(): void { + this.lastUseTime = processTimeMS(); + } + + private onSocketError(cause: Error) { + this.onError(new MongoNetworkError(cause.message, { cause })); + } + + private onTransformError(error: Error) { + this.onError(error); + } + + public onError(error: Error) { + this.cleanup(error); + } + + private onClose() { + const message = `connection ${this.id} to ${this.address} closed`; + this.cleanup(new MongoNetworkError(message)); + } + + private onTimeout() { + this.delayedTimeoutId = setTimeout(() => { + const message = `connection ${this.id} to ${this.address} timed out`; + const beforeHandshake = this.hello == null; + this.cleanup(new MongoNetworkTimeoutError(message, { beforeHandshake })); + }, 1).unref(); // No need for this timer to hold the event loop open + } + + public destroy(): void { + if (this.closed) { + return; + } + + // load balanced mode requires that these listeners remain on the connection + // after cleanup on timeouts, errors or close so we remove them before calling + // cleanup. + this.removeAllListeners(Connection.PINNED); + this.removeAllListeners(Connection.UNPINNED); + const message = `connection ${this.id} to ${this.address} closed`; + this.cleanup(new MongoNetworkError(message)); + } + + /** + * A method that cleans up the connection. When `force` is true, this method + * forcibly destroys the socket. + * + * If an error is provided, any in-flight operations will be closed with the error. + * + * This method does nothing if the connection is already closed. + */ + private cleanup(error: Error): void { + if (this.closed) { + return; + } + + this.socket.destroy(); + this.error = error; + + this.dataEvents?.throw(error).then(undefined, squashError); + this.closed = true; + this.emit(Connection.CLOSE); + } + + private prepareCommand(db: string, command: Document, options: CommandOptions) { + let cmd = { ...command }; + + const readPreference = getReadPreference(options); + const session = options?.session; + + let clusterTime = this.clusterTime; + + if (this.serverApi) { + const { version, strict, deprecationErrors } = this.serverApi; + cmd.apiVersion = version; + if (strict != null) cmd.apiStrict = strict; + if (deprecationErrors != null) cmd.apiDeprecationErrors = deprecationErrors; + } + + if (this.hasSessionSupport && session) { + if ( + session.clusterTime && + clusterTime && + session.clusterTime.clusterTime.greaterThan(clusterTime.clusterTime) + ) { + clusterTime = session.clusterTime; + } + + const sessionError = applySession(session, cmd, options); + if (sessionError) throw sessionError; + } else if (session?.explicit) { + throw new MongoCompatibilityError('Current topology does not support sessions'); + } + + // if we have a known cluster time, gossip it + if (clusterTime) { + cmd.$clusterTime = clusterTime; + } + + // For standalone, drivers MUST NOT set $readPreference. + if (this.description.type !== ServerType.Standalone) { + if ( + !isSharded(this) && + !this.description.loadBalanced && + this.supportsOpMsg && + options.directConnection === true && + readPreference?.mode === 'primary' + ) { + // For mongos and load balancers with 'primary' mode, drivers MUST NOT set $readPreference. + // For all other types with a direct connection, if the read preference is 'primary' + // (driver sets 'primary' as default if no read preference is configured), + // the $readPreference MUST be set to 'primaryPreferred' + // to ensure that any server type can handle the request. + cmd.$readPreference = ReadPreference.primaryPreferred.toJSON(); + } else if (isSharded(this) && !this.supportsOpMsg && readPreference?.mode !== 'primary') { + // When sending a read operation via OP_QUERY and the $readPreference modifier, + // the query MUST be provided using the $query modifier. + cmd = { + $query: cmd, + $readPreference: readPreference.toJSON() + }; + } else if (readPreference?.mode !== 'primary') { + // For mode 'primary', drivers MUST NOT set $readPreference. + // For all other read preference modes (i.e. 'secondary', 'primaryPreferred', ...), + // drivers MUST set $readPreference + cmd.$readPreference = readPreference.toJSON(); + } + } + + const commandOptions = { + numberToSkip: 0, + numberToReturn: -1, + checkKeys: false, + // This value is not overridable + secondaryOk: readPreference.secondaryOk(), + ...options + }; + + options.timeoutContext?.addMaxTimeMSToCommand(cmd, options); + + const message = this.supportsOpMsg + ? new OpMsgRequest(db, cmd, commandOptions) + : new OpQueryRequest(db, cmd, commandOptions); + + return message; + } + + private async *sendWire( + message: WriteProtocolMessageType, + options: CommandOptions & Abortable, + responseType?: MongoDBResponseConstructor + ): AsyncGenerator { + this.throwIfAborted(); + + const timeout = + options.socketTimeoutMS ?? + options?.timeoutContext?.getSocketTimeoutMS() ?? + this.socketTimeoutMS; + this.socket.setTimeout(timeout); + + try { + await this.writeCommand(message, { + agreedCompressor: this.description.compressor ?? 'none', + zlibCompressionLevel: this.description.zlibCompressionLevel, + timeoutContext: options.timeoutContext, + signal: options.signal + }); + + if (message.moreToCome) { + yield MongoDBResponse.empty; + return; + } + + this.throwIfAborted(); + + if ( + options.timeoutContext?.csotEnabled() && + options.timeoutContext.minRoundTripTime != null && + options.timeoutContext.remainingTimeMS < options.timeoutContext.minRoundTripTime + ) { + throw new MongoOperationTimeoutError( + 'Server roundtrip time is greater than the time remaining' + ); + } + + for await (const response of this.readMany(options)) { + this.socket.setTimeout(0); + const bson = response.parse(); + + const document = (responseType ?? MongoDBResponse).make(bson); + + yield document; + this.throwIfAborted(); + + this.socket.setTimeout(timeout); + } + } finally { + this.socket.setTimeout(0); + } + } + + private async *sendCommand( + ns: MongoDBNamespace, + command: Document, + options: CommandOptions & Abortable, + responseType?: MongoDBResponseConstructor + ) { + options?.signal?.throwIfAborted(); + + const message = this.prepareCommand(ns.db, command, options); + let started = 0; + if (this.shouldEmitAndLogCommand) { + started = processTimeMS(); + this.emitAndLogCommand( + this.monitorCommands, + Connection.COMMAND_STARTED, + message.databaseName, + this.established, + new CommandStartedEvent(this, message, this.description.serverConnectionId) + ); + } + + // If `documentsReturnedIn` not set or raw is not enabled, use input bson options + // Otherwise, support raw flag. Raw only works for cursors that hardcode firstBatch/nextBatch fields + const bsonOptions: DeserializeOptions = + options.documentsReturnedIn == null || !options.raw + ? options + : { + ...options, + raw: false, + fieldsAsRaw: { [options.documentsReturnedIn]: true } + }; + + /** MongoDBResponse instance or subclass */ + let document: MongoDBResponse | undefined = undefined; + /** Cached result of a toObject call */ + let object: Document | undefined = undefined; + try { + this.throwIfAborted(); + for await (document of this.sendWire(message, options, responseType)) { + object = undefined; + if (options.session != null) { + updateSessionFromResponse(options.session, document); + } + + if (document.$clusterTime) { + this.clusterTime = document.$clusterTime; + this.emit(Connection.CLUSTER_TIME_RECEIVED, document.$clusterTime); + } + + if (document.ok === 0) { + if (options.timeoutContext?.csotEnabled() && document.isMaxTimeExpiredError) { + throw new MongoOperationTimeoutError('Server reported a timeout error', { + cause: new MongoServerError((object ??= document.toObject(bsonOptions))) + }); + } + throw new MongoServerError((object ??= document.toObject(bsonOptions))); + } + + if (this.shouldEmitAndLogCommand) { + this.emitAndLogCommand( + this.monitorCommands, + Connection.COMMAND_SUCCEEDED, + message.databaseName, + this.established, + new CommandSucceededEvent( + this, + message, + message.moreToCome ? { ok: 1 } : (object ??= document.toObject(bsonOptions)), + started, + this.description.serverConnectionId + ) + ); + } + + if (responseType == null) { + yield (object ??= document.toObject(bsonOptions)); + } else { + yield document; + } + + this.throwIfAborted(); + } + } catch (error) { + if (options.session != null && !(error instanceof MongoServerError)) { + updateSessionFromResponse(options.session, MongoDBResponse.empty); + } + if (this.shouldEmitAndLogCommand) { + this.emitAndLogCommand( + this.monitorCommands, + Connection.COMMAND_FAILED, + message.databaseName, + this.established, + new CommandFailedEvent(this, message, error, started, this.description.serverConnectionId) + ); + } + throw error; + } + } + + public async command( + ns: MongoDBNamespace, + command: Document, + options: CommandOptions | undefined, + responseType: T + ): Promise>; + + public async command( + ns: MongoDBNamespace, + command: Document, + options: CommandOptions | undefined, + responseType: T | undefined + ): Promise>; + + public async command( + ns: MongoDBNamespace, + command: Document, + options?: CommandOptions + ): Promise; + + public async command( + ns: MongoDBNamespace, + command: Document, + options: CommandOptions & Abortable = {}, + responseType?: MongoDBResponseConstructor + ): Promise { + this.throwIfAborted(); + options.signal?.throwIfAborted(); + + for await (const document of this.sendCommand(ns, command, options, responseType)) { + if (options.timeoutContext?.csotEnabled()) { + if (MongoDBResponse.is(document)) { + if (document.isMaxTimeExpiredError) { + throw new MongoOperationTimeoutError('Server reported a timeout error', { + cause: new MongoServerError(document.toObject()) + }); + } + } else { + if ( + (Array.isArray(document?.writeErrors) && + document.writeErrors.some( + error => error?.code === MONGODB_ERROR_CODES.MaxTimeMSExpired + )) || + document?.writeConcernError?.code === MONGODB_ERROR_CODES.MaxTimeMSExpired + ) { + throw new MongoOperationTimeoutError('Server reported a timeout error', { + cause: new MongoServerError(document) + }); + } + } + } + + return document; + } + throw new MongoUnexpectedServerResponseError('Unable to get response from server'); + } + + public exhaustCommand( + ns: MongoDBNamespace, + command: Document, + options: CommandOptions, + replyListener: Callback + ) { + const exhaustLoop = async () => { + this.throwIfAborted(); + for await (const reply of this.sendCommand(ns, command, options)) { + replyListener(undefined, reply); + this.throwIfAborted(); + } + throw new MongoUnexpectedServerResponseError('Server ended moreToCome unexpectedly'); + }; + + exhaustLoop().then(undefined, replyListener); + } + + private throwIfAborted() { + if (this.error) throw this.error; + } + + /** + * @internal + * + * Writes an OP_MSG or OP_QUERY request to the socket, optionally compressing the command. This method + * waits until the socket's buffer has emptied (the Nodejs socket `drain` event has fired). + */ + private async writeCommand( + command: WriteProtocolMessageType, + options: { + agreedCompressor?: CompressorName; + zlibCompressionLevel?: number; + timeoutContext?: TimeoutContext; + } & Abortable + ): Promise { + const finalCommand = + options.agreedCompressor === 'none' || !OpCompressedRequest.canCompress(command) + ? command + : new OpCompressedRequest(command, { + agreedCompressor: options.agreedCompressor ?? 'none', + zlibCompressionLevel: options.zlibCompressionLevel ?? 0 + }); + + const buffer = ByteUtils.concat(await finalCommand.toBin()); + + if (options.timeoutContext?.csotEnabled()) { + if ( + options.timeoutContext.minRoundTripTime != null && + options.timeoutContext.remainingTimeMS < options.timeoutContext.minRoundTripTime + ) { + throw new MongoOperationTimeoutError( + 'Server roundtrip time is greater than the time remaining' + ); + } + } + + try { + if (this.socket.write(buffer)) return; + } catch (writeError) { + const networkError = new MongoNetworkError('unexpected error writing to socket', { + cause: writeError + }); + this.onError(networkError); + throw networkError; + } + + const drainEvent = once(this.socket, 'drain', options); + const timeout = options?.timeoutContext?.timeoutForSocketWrite; + const drained = timeout ? Promise.race([drainEvent, timeout]) : drainEvent; + try { + return await drained; + } catch (writeError) { + if (TimeoutError.is(writeError)) { + const timeoutError = new MongoOperationTimeoutError('Timed out at socket write'); + this.onError(timeoutError); + throw timeoutError; + } else if (writeError === options.signal?.reason) { + this.onError(writeError); + } + throw writeError; + } finally { + timeout?.clear(); + } + } + + /** + * @internal + * + * Returns an async generator that yields full wire protocol messages from the underlying socket. This function + * yields messages until `moreToCome` is false or not present in a response, or the caller cancels the request + * by calling `return` on the generator. + * + * Note that `for-await` loops call `return` automatically when the loop is exited. + */ + private async *readMany( + options: { + timeoutContext?: TimeoutContext; + } & Abortable + ): AsyncGenerator { + try { + this.dataEvents = onData(this.messageStream, options); + this.messageStream.resume(); + + for await (const message of this.dataEvents) { + const response = await decompressResponse(message); + yield response; + + if (!response.moreToCome) { + return; + } + } + } catch (readError) { + if (TimeoutError.is(readError)) { + const timeoutError = new MongoOperationTimeoutError( + `Timed out during socket read (${readError.duration}ms)` + ); + this.dataEvents = null; + this.onError(timeoutError); + throw timeoutError; + } else if (readError === options.signal?.reason) { + this.onError(readError); + } + throw readError; + } finally { + this.dataEvents = null; + this.messageStream.pause(); + } + } +} + +/** @internal */ +export class SizedMessageTransform extends Transform { + bufferPool: BufferPool; + connection: Connection; + + constructor({ connection }: { connection: Connection }) { + super({ writableObjectMode: false, readableObjectMode: true }); + this.bufferPool = new BufferPool(); + this.connection = connection; + } + + override _transform(chunk: Uint8Array, encoding: unknown, callback: TransformCallback): void { + if (this.connection.delayedTimeoutId != null) { + clearTimeout(this.connection.delayedTimeoutId); + this.connection.delayedTimeoutId = null; + } + + this.bufferPool.append(chunk); + + while (this.bufferPool.length) { + // While there are any bytes in the buffer + + // Try to fetch a size from the top 4 bytes + const sizeOfMessage = this.bufferPool.getInt32(); + + if (sizeOfMessage == null) { + // Not even an int32 worth of data. Stop the loop, we need more chunks. + break; + } + + if (sizeOfMessage < 0) { + // The size in the message has a negative value, this is probably corruption, throw: + return callback(new MongoParseError(`Message size cannot be negative: ${sizeOfMessage}`)); + } + + if (sizeOfMessage > this.bufferPool.length) { + // We do not have enough bytes to make a sizeOfMessage chunk + break; + } + + // Add a message to the stream + const message = this.bufferPool.read(sizeOfMessage); + + if (!this.push(message)) { + // We only subscribe to data events so we should never get backpressure + // if we do, we do not have the handling for it. + return callback( + new MongoRuntimeError(`SizedMessageTransform does not support backpressure`) + ); + } + } + + callback(); + } +} + +/** @internal */ +export class CryptoConnection extends Connection { + /** @internal */ + autoEncrypter?: AutoEncrypter; + + constructor(stream: Stream, options: ConnectionOptions) { + super(stream, options); + this.autoEncrypter = options.autoEncrypter; + } + + public override async command( + ns: MongoDBNamespace, + command: Document, + options: CommandOptions | undefined, + responseType: T + ): Promise>; + + public override async command( + ns: MongoDBNamespace, + command: Document, + options?: CommandOptions + ): Promise; + + override async command( + ns: MongoDBNamespace, + cmd: Document, + options?: CommandOptions, + responseType?: T + ): Promise { + const { autoEncrypter } = this; + if (!autoEncrypter) { + throw new MongoRuntimeError('No AutoEncrypter available for encryption'); + } + + const serverWireVersion = maxWireVersion(this); + if (serverWireVersion === 0) { + // This means the initial handshake hasn't happened yet + return await super.command(ns, cmd, options, responseType); + } + + // Save sort or indexKeys based on the command being run + // the encrypt API serializes our JS objects to BSON to pass to the native code layer + // and then deserializes the encrypted result, the protocol level components + // of the command (ex. sort) are then converted to JS objects potentially losing + // import key order information. These fields are never encrypted so we can save the values + // from before the encryption and replace them after encryption has been performed + const sort: Map | null = cmd.find || cmd.findAndModify ? cmd.sort : null; + const indexKeys: Map[] | null = cmd.createIndexes + ? cmd.indexes.map((index: { key: Map }) => index.key) + : null; + + const encrypted = await autoEncrypter.encrypt(ns.toString(), cmd, options); + + // Replace the saved values + if (sort != null && (cmd.find || cmd.findAndModify)) { + encrypted.sort = sort; + } + + if (indexKeys != null && cmd.createIndexes) { + for (const [offset, index] of indexKeys.entries()) { + // @ts-expect-error `encrypted` is a generic "command", but we've narrowed for only `createIndexes` commands here + encrypted.indexes[offset].key = index; + } + } + + const encryptedResponse = await super.command( + ns, + encrypted, + options, + // Eventually we want to require `responseType` which means we would satisfy `T` as the return type. + // In the meantime, we want encryptedResponse to always be _at least_ a MongoDBResponse if not a more specific subclass + // So that we can ensure we have access to the on-demand APIs for decorate response + responseType ?? MongoDBResponse + ); + + const result = await autoEncrypter.decrypt(encryptedResponse.toBytes(), options); + + const decryptedResponse = responseType?.make(result) ?? deserialize(result, options); + + if (autoEncrypter[kDecorateResult]) { + if (responseType == null) { + decorateDecryptionResult(decryptedResponse, encryptedResponse.toObject(), true); + } else if (decryptedResponse instanceof CursorResponse) { + decryptedResponse.encryptedResponse = encryptedResponse; + } + } + + return decryptedResponse; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool.ts new file mode 100644 index 00000000..0df9f5d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool.ts @@ -0,0 +1,831 @@ +import { clearTimeout, setTimeout } from 'timers'; + +import type { ObjectId } from '../bson'; +import { + APM_EVENTS, + CONNECTION_CHECK_OUT_FAILED, + CONNECTION_CHECK_OUT_STARTED, + CONNECTION_CHECKED_IN, + CONNECTION_CHECKED_OUT, + CONNECTION_CLOSED, + CONNECTION_CREATED, + CONNECTION_POOL_CLEARED, + CONNECTION_POOL_CLOSED, + CONNECTION_POOL_CREATED, + CONNECTION_POOL_READY, + CONNECTION_READY +} from '../constants'; +import { + type AnyError, + MongoClientClosedError, + type MongoError, + MongoInvalidArgumentError, + MongoMissingCredentialsError, + MongoNetworkError, + MongoOperationTimeoutError, + MongoRuntimeError, + MongoServerError +} from '../error'; +import { type Abortable, CancellationToken, TypedEventEmitter } from '../mongo_types'; +import type { Server } from '../sdam/server'; +import { type TimeoutContext, TimeoutError } from '../timeout'; +import { + addAbortListener, + type Callback, + kDispose, + List, + makeCounter, + noop, + processTimeMS, + promiseWithResolvers +} from '../utils'; +import { connect } from './connect'; +import { Connection, type ConnectionEvents, type ConnectionOptions } from './connection'; +import { + ConnectionCheckedInEvent, + ConnectionCheckedOutEvent, + ConnectionCheckOutFailedEvent, + ConnectionCheckOutStartedEvent, + ConnectionClosedEvent, + ConnectionCreatedEvent, + ConnectionPoolClearedEvent, + ConnectionPoolClosedEvent, + ConnectionPoolCreatedEvent, + ConnectionPoolReadyEvent, + ConnectionReadyEvent +} from './connection_pool_events'; +import { + PoolClearedError, + PoolClearedOnNetworkError, + PoolClosedError, + WaitQueueTimeoutError +} from './errors'; +import { ConnectionPoolMetrics } from './metrics'; + +/** @public */ +export interface ConnectionPoolOptions extends Omit { + /** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. */ + maxPoolSize: number; + /** The minimum number of connections that MUST exist at any moment in a single connection pool. */ + minPoolSize: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting: number; + /** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. */ + maxIdleTimeMS: number; + /** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. */ + waitQueueTimeoutMS: number; + /** If we are in load balancer mode. */ + loadBalanced: boolean; + /** @internal */ + minPoolSizeCheckFrequencyMS?: number; +} + +/** @internal */ +export interface WaitQueueMember { + resolve: (conn: Connection) => void; + reject: (err: AnyError) => void; + cancelled: boolean; + checkoutTime: number; +} + +/** @internal */ +export const PoolState = Object.freeze({ + paused: 'paused', + ready: 'ready', + closed: 'closed' +} as const); + +type PoolState = (typeof PoolState)[keyof typeof PoolState]; + +/** @public */ +export type ConnectionPoolEvents = { + connectionPoolCreated(event: ConnectionPoolCreatedEvent): void; + connectionPoolReady(event: ConnectionPoolReadyEvent): void; + connectionPoolClosed(event: ConnectionPoolClosedEvent): void; + connectionPoolCleared(event: ConnectionPoolClearedEvent): void; + connectionCreated(event: ConnectionCreatedEvent): void; + connectionReady(event: ConnectionReadyEvent): void; + connectionClosed(event: ConnectionClosedEvent): void; + connectionCheckOutStarted(event: ConnectionCheckOutStartedEvent): void; + connectionCheckOutFailed(event: ConnectionCheckOutFailedEvent): void; + connectionCheckedOut(event: ConnectionCheckedOutEvent): void; + connectionCheckedIn(event: ConnectionCheckedInEvent): void; +} & Omit; + +/** + * A pool of connections which dynamically resizes, and emit events related to pool activity + * @internal + */ +export class ConnectionPool extends TypedEventEmitter { + public options: Readonly; + /** An integer representing the SDAM generation of the pool */ + public generation: number; + /** A map of generations to service ids */ + public serviceGenerations: Map; + + private poolState: PoolState; + private server: Server; + private connections: List; + private pending: number; + private checkedOut: Set; + private minPoolSizeTimer?: NodeJS.Timeout; + private connectionCounter: Generator; + private cancellationToken: CancellationToken; + private waitQueue: List; + private metrics: ConnectionPoolMetrics; + private processingWaitQueue: boolean; + + /** + * Emitted when the connection pool is created. + * @event + */ + static readonly CONNECTION_POOL_CREATED = CONNECTION_POOL_CREATED; + /** + * Emitted once when the connection pool is closed + * @event + */ + static readonly CONNECTION_POOL_CLOSED = CONNECTION_POOL_CLOSED; + /** + * Emitted each time the connection pool is cleared and it's generation incremented + * @event + */ + static readonly CONNECTION_POOL_CLEARED = CONNECTION_POOL_CLEARED; + /** + * Emitted each time the connection pool is marked ready + * @event + */ + static readonly CONNECTION_POOL_READY = CONNECTION_POOL_READY; + /** + * Emitted when a connection is created. + * @event + */ + static readonly CONNECTION_CREATED = CONNECTION_CREATED; + /** + * Emitted when a connection becomes established, and is ready to use + * @event + */ + static readonly CONNECTION_READY = CONNECTION_READY; + /** + * Emitted when a connection is closed + * @event + */ + static readonly CONNECTION_CLOSED = CONNECTION_CLOSED; + /** + * Emitted when an attempt to check out a connection begins + * @event + */ + static readonly CONNECTION_CHECK_OUT_STARTED = CONNECTION_CHECK_OUT_STARTED; + /** + * Emitted when an attempt to check out a connection fails + * @event + */ + static readonly CONNECTION_CHECK_OUT_FAILED = CONNECTION_CHECK_OUT_FAILED; + /** + * Emitted each time a connection is successfully checked out of the connection pool + * @event + */ + static readonly CONNECTION_CHECKED_OUT = CONNECTION_CHECKED_OUT; + /** + * Emitted each time a connection is successfully checked into the connection pool + * @event + */ + static readonly CONNECTION_CHECKED_IN = CONNECTION_CHECKED_IN; + + constructor(server: Server, options: ConnectionPoolOptions) { + super(); + this.on('error', noop); + + this.options = Object.freeze({ + connectionType: Connection, + ...options, + maxPoolSize: options.maxPoolSize ?? 100, + minPoolSize: options.minPoolSize ?? 0, + maxConnecting: options.maxConnecting ?? 2, + maxIdleTimeMS: options.maxIdleTimeMS ?? 0, + waitQueueTimeoutMS: options.waitQueueTimeoutMS ?? 0, + minPoolSizeCheckFrequencyMS: options.minPoolSizeCheckFrequencyMS ?? 100, + autoEncrypter: options.autoEncrypter + }); + + if (this.options.minPoolSize > this.options.maxPoolSize) { + throw new MongoInvalidArgumentError( + 'Connection pool minimum size must not be greater than maximum pool size' + ); + } + + this.poolState = PoolState.paused; + this.server = server; + this.connections = new List(); + this.pending = 0; + this.checkedOut = new Set(); + this.minPoolSizeTimer = undefined; + this.generation = 0; + this.serviceGenerations = new Map(); + this.connectionCounter = makeCounter(1); + this.cancellationToken = new CancellationToken(); + this.cancellationToken.setMaxListeners(Infinity); + this.waitQueue = new List(); + this.metrics = new ConnectionPoolMetrics(); + this.processingWaitQueue = false; + + this.mongoLogger = this.server.topology.client?.mongoLogger; + this.component = 'connection'; + + queueMicrotask(() => { + this.emitAndLog(ConnectionPool.CONNECTION_POOL_CREATED, new ConnectionPoolCreatedEvent(this)); + }); + } + + /** The address of the endpoint the pool is connected to */ + get address(): string { + return this.options.hostAddress.toString(); + } + + /** + * Check if the pool has been closed + * + * TODO(NODE-3263): We can remove this property once shell no longer needs it + */ + get closed(): boolean { + return this.poolState === PoolState.closed; + } + + /** An integer expressing how many total connections (available + pending + in use) the pool currently has */ + get totalConnectionCount(): number { + return ( + this.availableConnectionCount + this.pendingConnectionCount + this.currentCheckedOutCount + ); + } + + /** An integer expressing how many connections are currently available in the pool. */ + get availableConnectionCount(): number { + return this.connections.length; + } + + get pendingConnectionCount(): number { + return this.pending; + } + + get currentCheckedOutCount(): number { + return this.checkedOut.size; + } + + get waitQueueSize(): number { + return this.waitQueue.length; + } + + get loadBalanced(): boolean { + return this.options.loadBalanced; + } + + get serverError() { + return this.server.description.error; + } + + /** + * This is exposed ONLY for use in mongosh, to enable + * killing all connections if a user quits the shell with + * operations in progress. + * + * This property may be removed as a part of NODE-3263. + */ + get checkedOutConnections() { + return this.checkedOut; + } + + /** + * Get the metrics information for the pool when a wait queue timeout occurs. + */ + private waitQueueErrorMetrics(): string { + return this.metrics.info(this.options.maxPoolSize); + } + + /** + * Set the pool state to "ready" + */ + ready(): void { + if (this.poolState !== PoolState.paused) { + return; + } + this.poolState = PoolState.ready; + this.emitAndLog(ConnectionPool.CONNECTION_POOL_READY, new ConnectionPoolReadyEvent(this)); + clearTimeout(this.minPoolSizeTimer); + this.ensureMinPoolSize(); + } + + /** + * Check a connection out of this pool. The connection will continue to be tracked, but no reference to it + * will be held by the pool. This means that if a connection is checked out it MUST be checked back in or + * explicitly destroyed by the new owner. + */ + async checkOut(options: { timeoutContext: TimeoutContext } & Abortable): Promise { + const checkoutTime = processTimeMS(); + this.emitAndLog( + ConnectionPool.CONNECTION_CHECK_OUT_STARTED, + new ConnectionCheckOutStartedEvent(this) + ); + + const { promise, resolve, reject } = promiseWithResolvers(); + + const timeout = options.timeoutContext.connectionCheckoutTimeout; + + const waitQueueMember: WaitQueueMember = { + resolve, + reject, + cancelled: false, + checkoutTime + }; + + const abortListener = addAbortListener(options.signal, function () { + waitQueueMember.cancelled = true; + reject(this.reason); + }); + + this.waitQueue.push(waitQueueMember); + queueMicrotask(() => this.processWaitQueue()); + + try { + timeout?.throwIfExpired(); + return await (timeout ? Promise.race([promise, timeout]) : promise); + } catch (error) { + if (TimeoutError.is(error)) { + timeout?.clear(); + waitQueueMember.cancelled = true; + + this.emitAndLog( + ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + new ConnectionCheckOutFailedEvent(this, 'timeout', waitQueueMember.checkoutTime) + ); + const timeoutError = new WaitQueueTimeoutError( + this.loadBalanced + ? this.waitQueueErrorMetrics() + : 'Timed out while checking out a connection from connection pool', + this.address + ); + if (options.timeoutContext.csotEnabled()) { + throw new MongoOperationTimeoutError('Timed out during connection checkout', { + cause: timeoutError + }); + } + throw timeoutError; + } + throw error; + } finally { + abortListener?.[kDispose](); + timeout?.clear(); + } + } + + /** + * Check a connection into the pool. + * + * @param connection - The connection to check in + */ + checkIn(connection: Connection): void { + if (!this.checkedOut.has(connection)) { + return; + } + const poolClosed = this.closed; + const stale = this.connectionIsStale(connection); + const willDestroy = !!(poolClosed || stale || connection.closed); + + if (!willDestroy) { + connection.markAvailable(); + this.connections.unshift(connection); + } + + this.checkedOut.delete(connection); + this.emitAndLog( + ConnectionPool.CONNECTION_CHECKED_IN, + new ConnectionCheckedInEvent(this, connection) + ); + + if (willDestroy) { + const reason = connection.closed ? 'error' : poolClosed ? 'poolClosed' : 'stale'; + this.destroyConnection(connection, reason); + } + + queueMicrotask(() => this.processWaitQueue()); + } + + /** + * Clear the pool + * + * Pool reset is handled by incrementing the pool's generation count. Any existing connection of a + * previous generation will eventually be pruned during subsequent checkouts. + */ + clear(options: { serviceId?: ObjectId; interruptInUseConnections?: boolean } = {}): void { + if (this.closed) { + return; + } + + // handle load balanced case + if (this.loadBalanced) { + const { serviceId } = options; + if (!serviceId) { + throw new MongoRuntimeError( + 'ConnectionPool.clear() called in load balanced mode with no serviceId.' + ); + } + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + // Only need to worry if the generation exists, since it should + // always be there but typescript needs the check. + if (generation == null) { + throw new MongoRuntimeError('Service generations are required in load balancer mode.'); + } else { + // Increment the generation for the service id. + this.serviceGenerations.set(sid, generation + 1); + } + this.emitAndLog( + ConnectionPool.CONNECTION_POOL_CLEARED, + new ConnectionPoolClearedEvent(this, { serviceId }) + ); + return; + } + // handle non load-balanced case + const interruptInUseConnections = options.interruptInUseConnections ?? false; + const oldGeneration = this.generation; + this.generation += 1; + const alreadyPaused = this.poolState === PoolState.paused; + this.poolState = PoolState.paused; + + this.clearMinPoolSizeTimer(); + if (!alreadyPaused) { + this.emitAndLog( + ConnectionPool.CONNECTION_POOL_CLEARED, + new ConnectionPoolClearedEvent(this, { + interruptInUseConnections + }) + ); + } + + if (interruptInUseConnections) { + queueMicrotask(() => this.interruptInUseConnections(oldGeneration)); + } + + this.processWaitQueue(); + } + + /** + * Closes all stale in-use connections in the pool with a resumable PoolClearedOnNetworkError. + * + * Only connections where `connection.generation <= minGeneration` are killed. + */ + private interruptInUseConnections(minGeneration: number) { + for (const connection of this.checkedOut) { + if (connection.generation <= minGeneration) { + connection.onError(new PoolClearedOnNetworkError(this)); + } + } + } + + /** For MongoClient.close() procedures */ + public closeCheckedOutConnections() { + for (const conn of this.checkedOut) { + conn.onError(new MongoClientClosedError()); + } + } + + /** Close the pool */ + close(): void { + if (this.closed) { + return; + } + + // immediately cancel any in-flight connections + this.cancellationToken.emit('cancel'); + + // end the connection counter + if (typeof this.connectionCounter.return === 'function') { + this.connectionCounter.return(undefined); + } + + this.poolState = PoolState.closed; + this.clearMinPoolSizeTimer(); + this.processWaitQueue(); + + for (const conn of this.connections) { + this.emitAndLog( + ConnectionPool.CONNECTION_CLOSED, + new ConnectionClosedEvent(this, conn, 'poolClosed') + ); + conn.destroy(); + } + this.connections.clear(); + this.emitAndLog(ConnectionPool.CONNECTION_POOL_CLOSED, new ConnectionPoolClosedEvent(this)); + } + + /** + * @internal + * Reauthenticate a connection + */ + async reauthenticate(connection: Connection): Promise { + const authContext = connection.authContext; + if (!authContext) { + throw new MongoRuntimeError('No auth context found on connection.'); + } + const credentials = authContext.credentials; + if (!credentials) { + throw new MongoMissingCredentialsError( + 'Connection is missing credentials when asked to reauthenticate' + ); + } + + const resolvedCredentials = credentials.resolveAuthMechanism(connection.hello); + const provider = this.server.topology.client.s.authProviders.getOrCreateProvider( + resolvedCredentials.mechanism, + resolvedCredentials.mechanismProperties + ); + + if (!provider) { + throw new MongoMissingCredentialsError( + `Reauthenticate failed due to no auth provider for ${credentials.mechanism}` + ); + } + + await provider.reauth(authContext); + + return; + } + + /** Clear the min pool size timer */ + private clearMinPoolSizeTimer(): void { + const minPoolSizeTimer = this.minPoolSizeTimer; + if (minPoolSizeTimer) { + clearTimeout(minPoolSizeTimer); + } + } + + private destroyConnection( + connection: Connection, + reason: 'error' | 'idle' | 'stale' | 'poolClosed' + ) { + this.emitAndLog( + ConnectionPool.CONNECTION_CLOSED, + new ConnectionClosedEvent(this, connection, reason) + ); + // destroy the connection + connection.destroy(); + } + + private connectionIsStale(connection: Connection) { + const serviceId = connection.serviceId; + if (this.loadBalanced && serviceId) { + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + return connection.generation !== generation; + } + + return connection.generation !== this.generation; + } + + private connectionIsIdle(connection: Connection) { + return !!(this.options.maxIdleTimeMS && connection.idleTime > this.options.maxIdleTimeMS); + } + + /** + * Destroys a connection if the connection is perished. + * + * @returns `true` if the connection was destroyed, `false` otherwise. + */ + private destroyConnectionIfPerished(connection: Connection): boolean { + const isStale = this.connectionIsStale(connection); + const isIdle = this.connectionIsIdle(connection); + if (!isStale && !isIdle && !connection.closed) { + return false; + } + const reason = connection.closed ? 'error' : isStale ? 'stale' : 'idle'; + this.destroyConnection(connection, reason); + return true; + } + + private createConnection(callback: Callback) { + // Note that metadata may have changed on the client but have + // been frozen here, so we pull the metadata promise always from the client + // no matter what options were set at the construction of the pool. + const connectOptions: ConnectionOptions = { + ...this.options, + id: this.connectionCounter.next().value, + generation: this.generation, + cancellationToken: this.cancellationToken, + mongoLogger: this.mongoLogger, + authProviders: this.server.topology.client.s.authProviders, + metadata: this.server.topology.client.options.metadata + }; + + this.pending++; + // This is our version of a "virtual" no-I/O connection as the spec requires + const connectionCreatedTime = processTimeMS(); + this.emitAndLog( + ConnectionPool.CONNECTION_CREATED, + new ConnectionCreatedEvent(this, { id: connectOptions.id }) + ); + + connect(connectOptions).then( + connection => { + // The pool might have closed since we started trying to create a connection + if (this.poolState !== PoolState.ready) { + this.pending--; + connection.destroy(); + callback(this.closed ? new PoolClosedError(this) : new PoolClearedError(this)); + return; + } + + // forward all events from the connection to the pool + for (const event of [...APM_EVENTS, Connection.CLUSTER_TIME_RECEIVED]) { + connection.on(event, (e: any) => this.emit(event, e)); + } + + if (this.loadBalanced) { + connection.on(Connection.PINNED, pinType => this.metrics.markPinned(pinType)); + connection.on(Connection.UNPINNED, pinType => this.metrics.markUnpinned(pinType)); + + const serviceId = connection.serviceId; + if (serviceId) { + let generation; + const sid = serviceId.toHexString(); + if ((generation = this.serviceGenerations.get(sid))) { + connection.generation = generation; + } else { + this.serviceGenerations.set(sid, 0); + connection.generation = 0; + } + } + } + + connection.markAvailable(); + this.emitAndLog( + ConnectionPool.CONNECTION_READY, + new ConnectionReadyEvent(this, connection, connectionCreatedTime) + ); + + this.pending--; + callback(undefined, connection); + }, + error => { + this.pending--; + this.server.handleError(error); + this.emitAndLog( + ConnectionPool.CONNECTION_CLOSED, + new ConnectionClosedEvent( + this, + { id: connectOptions.id, serviceId: undefined }, + 'error', + // TODO(NODE-5192): Remove this cast + error as MongoError + ) + ); + if (error instanceof MongoNetworkError || error instanceof MongoServerError) { + error.connectionGeneration = connectOptions.generation; + } + callback(error ?? new MongoRuntimeError('Connection creation failed without error')); + } + ); + } + + private ensureMinPoolSize() { + const minPoolSize = this.options.minPoolSize; + if (this.poolState !== PoolState.ready) { + return; + } + + this.connections.prune(connection => this.destroyConnectionIfPerished(connection)); + + if ( + this.totalConnectionCount < minPoolSize && + this.pendingConnectionCount < this.options.maxConnecting + ) { + // NOTE: ensureMinPoolSize should not try to get all the pending + // connection permits because that potentially delays the availability of + // the connection to a checkout request + this.createConnection((err, connection) => { + if (!err && connection) { + this.connections.push(connection); + queueMicrotask(() => this.processWaitQueue()); + } + if (this.poolState === PoolState.ready) { + clearTimeout(this.minPoolSizeTimer); + this.minPoolSizeTimer = setTimeout( + () => this.ensureMinPoolSize(), + this.options.minPoolSizeCheckFrequencyMS + ); + } + }); + } else { + clearTimeout(this.minPoolSizeTimer); + this.minPoolSizeTimer = setTimeout( + () => this.ensureMinPoolSize(), + this.options.minPoolSizeCheckFrequencyMS + ); + } + } + + private processWaitQueue() { + if (this.processingWaitQueue) { + return; + } + this.processingWaitQueue = true; + + while (this.waitQueueSize) { + const waitQueueMember = this.waitQueue.first(); + if (!waitQueueMember) { + this.waitQueue.shift(); + continue; + } + + if (waitQueueMember.cancelled) { + this.waitQueue.shift(); + continue; + } + + if (this.poolState !== PoolState.ready) { + const reason = this.closed ? 'poolClosed' : 'connectionError'; + const error = this.closed ? new PoolClosedError(this) : new PoolClearedError(this); + this.emitAndLog( + ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + new ConnectionCheckOutFailedEvent(this, reason, waitQueueMember.checkoutTime, error) + ); + this.waitQueue.shift(); + waitQueueMember.reject(error); + continue; + } + + if (!this.availableConnectionCount) { + break; + } + + const connection = this.connections.shift(); + if (!connection) { + break; + } + + if (!this.destroyConnectionIfPerished(connection)) { + this.checkedOut.add(connection); + this.emitAndLog( + ConnectionPool.CONNECTION_CHECKED_OUT, + new ConnectionCheckedOutEvent(this, connection, waitQueueMember.checkoutTime) + ); + + this.waitQueue.shift(); + waitQueueMember.resolve(connection); + } + } + + const { maxPoolSize, maxConnecting } = this.options; + while ( + this.waitQueueSize > 0 && + this.pendingConnectionCount < maxConnecting && + (maxPoolSize === 0 || this.totalConnectionCount < maxPoolSize) + ) { + const waitQueueMember = this.waitQueue.shift(); + if (!waitQueueMember || waitQueueMember.cancelled) { + continue; + } + this.createConnection((err, connection) => { + if (waitQueueMember.cancelled) { + if (!err && connection) { + this.connections.push(connection); + } + } else { + if (err) { + this.emitAndLog( + ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + // TODO(NODE-5192): Remove this cast + new ConnectionCheckOutFailedEvent( + this, + 'connectionError', + waitQueueMember.checkoutTime, + err as MongoError + ) + ); + waitQueueMember.reject(err); + } else if (connection) { + this.checkedOut.add(connection); + this.emitAndLog( + ConnectionPool.CONNECTION_CHECKED_OUT, + new ConnectionCheckedOutEvent(this, connection, waitQueueMember.checkoutTime) + ); + waitQueueMember.resolve(connection); + } + } + queueMicrotask(() => this.processWaitQueue()); + }); + } + this.processingWaitQueue = false; + } +} + +/** + * A callback provided to `withConnection` + * @internal + * + * @param error - An error instance representing the error during the execution. + * @param connection - The managed connection which was checked out of the pool. + * @param callback - A function to call back after connection management is complete + */ +export type WithConnectionCallback = ( + error: MongoError | undefined, + connection: Connection | undefined, + callback: Callback +) => void; diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool_events.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool_events.ts new file mode 100644 index 00000000..fe07536a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/connection_pool_events.ts @@ -0,0 +1,300 @@ +import type { ObjectId } from '../bson'; +import { + CONNECTION_CHECK_OUT_FAILED, + CONNECTION_CHECK_OUT_STARTED, + CONNECTION_CHECKED_IN, + CONNECTION_CHECKED_OUT, + CONNECTION_CLOSED, + CONNECTION_CREATED, + CONNECTION_POOL_CLEARED, + CONNECTION_POOL_CLOSED, + CONNECTION_POOL_CREATED, + CONNECTION_POOL_READY, + CONNECTION_READY +} from '../constants'; +import type { MongoError } from '../error'; +import { processTimeMS } from '../utils'; +import type { Connection } from './connection'; +import type { ConnectionPool, ConnectionPoolOptions } from './connection_pool'; + +/** + * The base export class for all monitoring events published from the connection pool + * @public + * @category Event + */ +export abstract class ConnectionPoolMonitoringEvent { + /** A timestamp when the event was created */ + time: Date; + /** The address (host/port pair) of the pool */ + address: string; + /** @internal */ + abstract name: + | typeof CONNECTION_CHECK_OUT_FAILED + | typeof CONNECTION_CHECK_OUT_STARTED + | typeof CONNECTION_CHECKED_IN + | typeof CONNECTION_CHECKED_OUT + | typeof CONNECTION_CLOSED + | typeof CONNECTION_CREATED + | typeof CONNECTION_POOL_CLEARED + | typeof CONNECTION_POOL_CLOSED + | typeof CONNECTION_POOL_CREATED + | typeof CONNECTION_POOL_READY + | typeof CONNECTION_READY; + + /** @internal */ + constructor(pool: ConnectionPool) { + this.time = new Date(); + this.address = pool.address; + } +} + +/** + * An event published when a connection pool is created + * @public + * @category Event + */ +export class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent { + /** The options used to create this connection pool */ + options: Pick< + ConnectionPoolOptions, + 'maxPoolSize' | 'minPoolSize' | 'maxConnecting' | 'maxIdleTimeMS' | 'waitQueueTimeoutMS' + >; + /** @internal */ + name = CONNECTION_POOL_CREATED; + + /** @internal */ + constructor(pool: ConnectionPool) { + super(pool); + const { maxConnecting, maxPoolSize, minPoolSize, maxIdleTimeMS, waitQueueTimeoutMS } = + pool.options; + this.options = { maxConnecting, maxPoolSize, minPoolSize, maxIdleTimeMS, waitQueueTimeoutMS }; + } +} + +/** + * An event published when a connection pool is ready + * @public + * @category Event + */ +export class ConnectionPoolReadyEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + name = CONNECTION_POOL_READY; + + /** @internal */ + constructor(pool: ConnectionPool) { + super(pool); + } +} + +/** + * An event published when a connection pool is closed + * @public + * @category Event + */ +export class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + name = CONNECTION_POOL_CLOSED; + + /** @internal */ + constructor(pool: ConnectionPool) { + super(pool); + } +} + +/** + * An event published when a connection pool creates a new connection + * @public + * @category Event + */ +export class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent { + /** A monotonically increasing, per-pool id for the newly created connection */ + connectionId: number | ''; + /** @internal */ + name = CONNECTION_CREATED; + + /** @internal */ + constructor(pool: ConnectionPool, connection: { id: number | '' }) { + super(pool); + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection is ready for use + * @public + * @category Event + */ +export class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** + * The time it took to establish the connection. + * In accordance with the definition of establishment of a connection + * specified by `ConnectionPoolOptions.maxConnecting`, + * it is the time elapsed between emitting a `ConnectionCreatedEvent` + * and emitting this event as part of the same checking out. + * + * Naturally, when establishing a connection is part of checking out, + * this duration is not greater than + * `ConnectionCheckedOutEvent.duration`. + */ + durationMS: number; + /** @internal */ + name = CONNECTION_READY; + + /** @internal */ + constructor(pool: ConnectionPool, connection: Connection, connectionCreatedEventTime: number) { + super(pool); + this.durationMS = processTimeMS() - connectionCreatedEventTime; + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection is closed + * @public + * @category Event + */ +export class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** The reason the connection was closed */ + reason: string; + serviceId?: ObjectId; + /** @internal */ + name = CONNECTION_CLOSED; + /** @internal */ + error: MongoError | null; + + /** @internal */ + constructor( + pool: ConnectionPool, + connection: Pick, + reason: 'idle' | 'stale' | 'poolClosed' | 'error', + error?: MongoError + ) { + super(pool); + this.connectionId = connection.id; + this.reason = reason; + this.serviceId = connection.serviceId; + this.error = error ?? null; + } +} + +/** + * An event published when a request to check a connection out begins + * @public + * @category Event + */ +export class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + name = CONNECTION_CHECK_OUT_STARTED; + + /** @internal */ + constructor(pool: ConnectionPool) { + super(pool); + } +} + +/** + * An event published when a request to check a connection out fails + * @public + * @category Event + */ +export class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent { + /** The reason the attempt to check out failed */ + reason: string; + /** @internal */ + error?: MongoError; + /** @internal */ + name = CONNECTION_CHECK_OUT_FAILED; + /** + * The time it took to check out the connection. + * More specifically, the time elapsed between + * emitting a `ConnectionCheckOutStartedEvent` + * and emitting this event as part of the same check out. + */ + durationMS: number; + + /** @internal */ + constructor( + pool: ConnectionPool, + reason: 'poolClosed' | 'timeout' | 'connectionError', + checkoutTime: number, + error?: MongoError + ) { + super(pool); + this.durationMS = processTimeMS() - checkoutTime; + this.reason = reason; + this.error = error; + } +} + +/** + * An event published when a connection is checked out of the connection pool + * @public + * @category Event + */ +export class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** @internal */ + name = CONNECTION_CHECKED_OUT; + /** + * The time it took to check out the connection. + * More specifically, the time elapsed between + * emitting a `ConnectionCheckOutStartedEvent` + * and emitting this event as part of the same checking out. + * + */ + durationMS: number; + + /** @internal */ + constructor(pool: ConnectionPool, connection: Connection, checkoutTime: number) { + super(pool); + this.durationMS = processTimeMS() - checkoutTime; + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection is checked into the connection pool + * @public + * @category Event + */ +export class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** @internal */ + name = CONNECTION_CHECKED_IN; + + /** @internal */ + constructor(pool: ConnectionPool, connection: Connection) { + super(pool); + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection pool is cleared + * @public + * @category Event + */ +export class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + serviceId?: ObjectId; + + interruptInUseConnections?: boolean; + /** @internal */ + name = CONNECTION_POOL_CLEARED; + + /** @internal */ + constructor( + pool: ConnectionPool, + options: { serviceId?: ObjectId; interruptInUseConnections?: boolean } = {} + ) { + super(pool); + this.serviceId = options.serviceId; + this.interruptInUseConnections = options.interruptInUseConnections; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/errors.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/errors.ts new file mode 100644 index 00000000..4481fd69 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/errors.ts @@ -0,0 +1,119 @@ +import { MongoDriverError, MongoErrorLabel, MongoNetworkError } from '../error'; +import type { ConnectionPool } from './connection_pool'; + +/** + * An error indicating a connection pool is closed + * @category Error + */ +export class PoolClosedError extends MongoDriverError { + /** The address of the connection pool */ + address: string; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool: ConnectionPool) { + super('Attempted to check out a connection from closed connection pool'); + this.address = pool.address; + } + + override get name(): string { + return 'MongoPoolClosedError'; + } +} + +/** + * An error indicating a connection pool is currently paused + * @category Error + */ +export class PoolClearedError extends MongoNetworkError { + /** The address of the connection pool */ + address: string; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool: ConnectionPool, message?: string) { + const errorMessage = message + ? message + : `Connection pool for ${pool.address} was cleared because another operation failed with: "${pool.serverError?.message}"`; + super(errorMessage, pool.serverError ? { cause: pool.serverError } : undefined); + this.address = pool.address; + + this.addErrorLabel(MongoErrorLabel.PoolRequestedRetry); + } + + override get name(): string { + return 'MongoPoolClearedError'; + } +} + +/** + * An error indicating that a connection pool has been cleared after the monitor for that server timed out. + * @category Error + */ +export class PoolClearedOnNetworkError extends PoolClearedError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool: ConnectionPool) { + super(pool, `Connection to ${pool.address} interrupted due to server monitor timeout`); + } + + override get name(): string { + return 'PoolClearedOnNetworkError'; + } +} + +/** + * An error thrown when a request to check out a connection times out + * @category Error + */ +export class WaitQueueTimeoutError extends MongoDriverError { + /** The address of the connection pool */ + address: string; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, address: string) { + super(message); + this.address = address; + } + + override get name(): string { + return 'MongoWaitQueueTimeoutError'; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/handshake/client_metadata.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/handshake/client_metadata.ts new file mode 100644 index 00000000..587d3420 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/handshake/client_metadata.ts @@ -0,0 +1,354 @@ +import * as process from 'process'; + +import { BSON, ByteUtils, type Document, Int32, NumberUtils } from '../../bson'; +import { MongoInvalidArgumentError } from '../../error'; +import type { DriverInfo, MongoOptions } from '../../mongo_client'; +import { fileIsAccessible } from '../../utils'; + +// eslint-disable-next-line @typescript-eslint/no-require-imports +const NODE_DRIVER_VERSION = require('../../../package.json').version; + +/** @internal */ +export function isDriverInfoEqual(info1: DriverInfo, info2: DriverInfo): boolean { + /** for equality comparison, we consider "" as unset */ + const nonEmptyCmp = (s1: string | undefined, s2: string | undefined): boolean => { + s1 ||= undefined; + s2 ||= undefined; + + return s1 === s2; + }; + + return ( + nonEmptyCmp(info1.name, info2.name) && + nonEmptyCmp(info1.platform, info2.platform) && + nonEmptyCmp(info1.version, info2.version) + ); +} + +/** + * @internal + * @see https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.md#hello-command + */ +export interface ClientMetadata { + driver: { + name: string; + version: string; + }; + os: { + type: string; + name?: NodeJS.Platform; + architecture?: string; + version?: string; + }; + platform: string; + application?: { + name: string; + }; + /** FaaS environment information */ + env?: { + name?: 'aws.lambda' | 'gcp.func' | 'azure.func' | 'vercel'; + timeout_sec?: Int32; + memory_mb?: Int32; + region?: string; + container?: { + runtime?: string; + orchestrator?: string; + }; + }; +} + +/** @internal */ +export class LimitedSizeDocument { + private document = new Map(); + /** BSON overhead: Int32 + Null byte */ + private documentSize = 5; + private maxSize: number; + + constructor(maxSize: number) { + this.maxSize = maxSize; + } + + /** Only adds key/value if the bsonByteLength is less than MAX_SIZE */ + public ifItFitsItSits(key: string, value: Record | string): boolean { + // The BSON byteLength of the new element is the same as serializing it to its own document + // subtracting the document size int32 and the null terminator. + const newElementSize = BSON.serialize(new Map().set(key, value)).byteLength - 5; + + if (newElementSize + this.documentSize > this.maxSize) { + return false; + } + + this.documentSize += newElementSize; + + this.document.set(key, value); + + return true; + } + + toObject(): Document { + return BSON.deserialize(BSON.serialize(this.document), { + promoteLongs: false, + promoteBuffers: false, + promoteValues: false, + useBigInt64: false + }); + } +} + +type MakeClientMetadataOptions = Pick; + +/** + * From the specs: + * Implementors SHOULD cumulatively update fields in the following order until the document is under the size limit: + * 1. Omit fields from `env` except `env.name`. + * 2. Omit fields from `os` except `os.type`. + * 3. Omit the `env` document entirely. + * 4. Truncate `platform`. -- special we do not truncate this field + */ +export async function makeClientMetadata( + driverInfoList: DriverInfo[], + { appName = '', runtime }: MakeClientMetadataOptions +): Promise { + const { os } = await runtime; + const metadataDocument = new LimitedSizeDocument(512); + + // Add app name first, it must be sent + if (appName.length > 0) { + const name = + ByteUtils.utf8ByteLength(appName) <= 128 + ? appName + : ByteUtils.toUTF8(ByteUtils.fromUTF8(appName), 0, 128, false); + metadataDocument.ifItFitsItSits('application', { name }); + } + + const driverInfo = { + name: 'nodejs', + version: NODE_DRIVER_VERSION + }; + + // This is where we handle additional driver info added after client construction. + for (const { name: n = '', version: v = '' } of driverInfoList) { + if (n.length > 0) { + driverInfo.name = `${driverInfo.name}|${n}`; + } + if (v.length > 0) { + driverInfo.version = `${driverInfo.version}|${v}`; + } + } + + if (!metadataDocument.ifItFitsItSits('driver', driverInfo)) { + throw new MongoInvalidArgumentError( + 'Unable to include driverInfo name and version, metadata cannot exceed 512 bytes' + ); + } + + let runtimeInfo = getRuntimeInfo(); + // This is where we handle additional driver info added after client construction. + for (const { platform = '' } of driverInfoList) { + if (platform.length > 0) { + runtimeInfo = `${runtimeInfo}|${platform}`; + } + } + + if (!metadataDocument.ifItFitsItSits('platform', runtimeInfo)) { + throw new MongoInvalidArgumentError( + 'Unable to include driverInfo platform, metadata cannot exceed 512 bytes' + ); + } + + // Note: order matters, os.type is last so it will be removed last if we're at maxSize + const osInfo = new Map() + .set('name', os.platform()) + .set('architecture', os.arch()) + .set('version', os.release()) + .set('type', os.type()); + + if (!metadataDocument.ifItFitsItSits('os', osInfo)) { + for (const key of osInfo.keys()) { + osInfo.delete(key); + if (osInfo.size === 0) break; + if (metadataDocument.ifItFitsItSits('os', osInfo)) break; + } + } + + const faasEnv = getFAASEnv(); + if (faasEnv != null) { + if (!metadataDocument.ifItFitsItSits('env', faasEnv)) { + for (const key of faasEnv.keys()) { + faasEnv.delete(key); + if (faasEnv.size === 0) break; + if (metadataDocument.ifItFitsItSits('env', faasEnv)) break; + } + } + } + return await addContainerMetadata(metadataDocument.toObject() as ClientMetadata); +} + +let dockerPromise: Promise; +type ContainerMetadata = NonNullable['container']>; +/** @internal */ +async function getContainerMetadata(): Promise { + dockerPromise ??= fileIsAccessible('/.dockerenv'); + const isDocker = await dockerPromise; + + const { KUBERNETES_SERVICE_HOST = '' } = process.env; + const isKubernetes = KUBERNETES_SERVICE_HOST.length > 0 ? true : false; + + const containerMetadata: ContainerMetadata = {}; + + if (isDocker) containerMetadata.runtime = 'docker'; + if (isKubernetes) containerMetadata.orchestrator = 'kubernetes'; + + return containerMetadata; +} + +/** + * @internal + * Re-add each metadata value. + * Attempt to add new env container metadata, but keep old data if it does not fit. + */ +async function addContainerMetadata(originalMetadata: ClientMetadata): Promise { + const containerMetadata = await getContainerMetadata(); + if (Object.keys(containerMetadata).length === 0) return originalMetadata; + + const extendedMetadata = new LimitedSizeDocument(512); + + const extendedEnvMetadata: NonNullable = { + ...originalMetadata?.env, + container: containerMetadata + }; + + for (const [key, val] of Object.entries(originalMetadata)) { + if (key !== 'env') { + extendedMetadata.ifItFitsItSits(key, val); + } else { + if (!extendedMetadata.ifItFitsItSits('env', extendedEnvMetadata)) { + // add in old data if newer / extended metadata does not fit + extendedMetadata.ifItFitsItSits('env', val); + } + } + } + + if (!('env' in originalMetadata)) { + extendedMetadata.ifItFitsItSits('env', extendedEnvMetadata); + } + + return extendedMetadata.toObject() as ClientMetadata; +} + +/** + * Collects FaaS metadata. + * - `name` MUST be the last key in the Map returned. + */ +export function getFAASEnv(): Map | null { + const { + AWS_EXECUTION_ENV = '', + AWS_LAMBDA_RUNTIME_API = '', + FUNCTIONS_WORKER_RUNTIME = '', + K_SERVICE = '', + FUNCTION_NAME = '', + VERCEL = '', + AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '', + AWS_REGION = '', + FUNCTION_MEMORY_MB = '', + FUNCTION_REGION = '', + FUNCTION_TIMEOUT_SEC = '', + VERCEL_REGION = '' + } = process.env; + + const isAWSFaaS = + AWS_EXECUTION_ENV.startsWith('AWS_Lambda_') || AWS_LAMBDA_RUNTIME_API.length > 0; + const isAzureFaaS = FUNCTIONS_WORKER_RUNTIME.length > 0; + const isGCPFaaS = K_SERVICE.length > 0 || FUNCTION_NAME.length > 0; + const isVercelFaaS = VERCEL.length > 0; + + // Note: order matters, name must always be the last key + const faasEnv = new Map(); + + // When isVercelFaaS is true so is isAWSFaaS; Vercel inherits the AWS env + if (isVercelFaaS && !(isAzureFaaS || isGCPFaaS)) { + if (VERCEL_REGION.length > 0) { + faasEnv.set('region', VERCEL_REGION); + } + + faasEnv.set('name', 'vercel'); + return faasEnv; + } + + if (isAWSFaaS && !(isAzureFaaS || isGCPFaaS || isVercelFaaS)) { + if (AWS_REGION.length > 0) { + faasEnv.set('region', AWS_REGION); + } + + if ( + AWS_LAMBDA_FUNCTION_MEMORY_SIZE.length > 0 && + Number.isInteger(+AWS_LAMBDA_FUNCTION_MEMORY_SIZE) + ) { + faasEnv.set('memory_mb', new Int32(AWS_LAMBDA_FUNCTION_MEMORY_SIZE)); + } + + faasEnv.set('name', 'aws.lambda'); + return faasEnv; + } + + if (isAzureFaaS && !(isGCPFaaS || isAWSFaaS || isVercelFaaS)) { + faasEnv.set('name', 'azure.func'); + return faasEnv; + } + + if (isGCPFaaS && !(isAzureFaaS || isAWSFaaS || isVercelFaaS)) { + if (FUNCTION_REGION.length > 0) { + faasEnv.set('region', FUNCTION_REGION); + } + + if (FUNCTION_MEMORY_MB.length > 0 && Number.isInteger(+FUNCTION_MEMORY_MB)) { + faasEnv.set('memory_mb', new Int32(FUNCTION_MEMORY_MB)); + } + + if (FUNCTION_TIMEOUT_SEC.length > 0 && Number.isInteger(+FUNCTION_TIMEOUT_SEC)) { + faasEnv.set('timeout_sec', new Int32(FUNCTION_TIMEOUT_SEC)); + } + + faasEnv.set('name', 'gcp.func'); + return faasEnv; + } + + return null; +} + +/** + * @internal + * This type represents the global Deno object and the minimal type contract we expect it to satisfy. + */ +declare const Deno: { version?: { deno?: string } } | undefined; + +/** + * @internal + * This type represents the global Bun object and the minimal type contract we expect it to satisfy. + */ +declare const Bun: { (): void; version?: string } | undefined; + +/** + * @internal + * Get current JavaScript runtime platform + * + * NOTE: The version information fetching is intentionally written defensively + * to avoid having a released driver version that becomes incompatible + * with a future change to these global objects. + */ +function getRuntimeInfo(): string { + const endianness = NumberUtils.isBigEndian ? 'BE' : 'LE'; + if ('Deno' in globalThis) { + const version = typeof Deno?.version?.deno === 'string' ? Deno?.version?.deno : '0.0.0-unknown'; + + return `Deno v${version}, ${endianness}`; + } + + if ('Bun' in globalThis) { + const version = typeof Bun?.version === 'string' ? Bun?.version : '0.0.0-unknown'; + + return `Bun v${version}, ${endianness}`; + } + + return `Node.js ${process.version}, ${endianness}`; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/metrics.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/metrics.ts new file mode 100644 index 00000000..b825b539 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/metrics.ts @@ -0,0 +1,58 @@ +/** @internal */ +export class ConnectionPoolMetrics { + static readonly TXN = 'txn' as const; + static readonly CURSOR = 'cursor' as const; + static readonly OTHER = 'other' as const; + + txnConnections = 0; + cursorConnections = 0; + otherConnections = 0; + + /** + * Mark a connection as pinned for a specific operation. + */ + markPinned(pinType: string): void { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections += 1; + } else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections += 1; + } else { + this.otherConnections += 1; + } + } + + /** + * Unmark a connection as pinned for an operation. + */ + markUnpinned(pinType: string): void { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections -= 1; + } else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections -= 1; + } else { + this.otherConnections -= 1; + } + } + + /** + * Return information about the cmap metrics as a string. + */ + info(maxPoolSize: number): string { + return ( + 'Timed out while checking out a connection from connection pool: ' + + `maxPoolSize: ${maxPoolSize}, ` + + `connections in use by cursors: ${this.cursorConnections}, ` + + `connections in use by transactions: ${this.txnConnections}, ` + + `connections in use by other operations: ${this.otherConnections}` + ); + } + + /** + * Reset the metrics to the initial values. + */ + reset(): void { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/stream_description.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/stream_description.ts new file mode 100644 index 00000000..88411c92 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/stream_description.ts @@ -0,0 +1,96 @@ +import { type Document, type Double, Long } from '../bson'; +import { ServerType } from '../sdam/common'; +import { parseServerType } from '../sdam/server_description'; +import type { CompressorName } from './wire_protocol/compression'; + +const RESPONSE_FIELDS = [ + 'minWireVersion', + 'maxWireVersion', + 'maxBsonObjectSize', + 'maxMessageSizeBytes', + 'maxWriteBatchSize', + 'logicalSessionTimeoutMinutes' +] as const; + +/** @public */ +export interface StreamDescriptionOptions { + compressors?: CompressorName[]; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; +} + +/** @public */ +export class StreamDescription { + address: string; + type: ServerType; + minWireVersion?: number; + maxWireVersion?: number; + maxBsonObjectSize: number; + maxMessageSizeBytes: number; + maxWriteBatchSize: number; + compressors: CompressorName[]; + compressor?: CompressorName; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; + + __nodejs_mock_server__?: boolean; + + zlibCompressionLevel?: number; + serverConnectionId: bigint | null; + + public hello: Document | null = null; + + constructor(address: string, options?: StreamDescriptionOptions) { + this.address = address; + this.type = ServerType.Unknown; + this.minWireVersion = undefined; + this.maxWireVersion = undefined; + this.maxBsonObjectSize = 16777216; + this.maxMessageSizeBytes = 48000000; + this.maxWriteBatchSize = 100000; + this.logicalSessionTimeoutMinutes = options?.logicalSessionTimeoutMinutes; + this.loadBalanced = !!options?.loadBalanced; + this.compressors = + options && options.compressors && Array.isArray(options.compressors) + ? options.compressors + : []; + this.serverConnectionId = null; + } + + receiveResponse(response: Document | null): void { + if (response == null) { + return; + } + this.hello = response; + this.type = parseServerType(response); + if ('connectionId' in response) { + this.serverConnectionId = this.parseServerConnectionID(response.connectionId); + } else { + this.serverConnectionId = null; + } + for (const field of RESPONSE_FIELDS) { + if (response[field] != null) { + this[field] = response[field]; + } + + // testing case + if ('__nodejs_mock_server__' in response) { + this.__nodejs_mock_server__ = response['__nodejs_mock_server__']; + } + } + + if (response.compression) { + this.compressor = this.compressors.filter(c => response.compression?.includes(c))[0]; + } + } + + /* @internal */ + parseServerConnectionID(serverConnectionId: number | Double | bigint | Long): bigint { + // Connection ids are always integral, so it's safe to coerce doubles as well as + // any integral type. + return Long.isLong(serverConnectionId) + ? serverConnectionId.toBigInt() + : // @ts-expect-error: Doubles are coercible to number + BigInt(serverConnectionId); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/compression.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/compression.ts new file mode 100644 index 00000000..e5e46d27 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/compression.ts @@ -0,0 +1,215 @@ +import * as zlib from 'zlib'; + +import { ByteUtils, readInt32LE } from '../../bson'; +import { LEGACY_HELLO_COMMAND } from '../../constants'; +import { getSnappy, getZstdLibrary, type SnappyLib, type ZStandard } from '../../deps'; +import { MongoDecompressionError, MongoInvalidArgumentError } from '../../error'; +import { + type MessageHeader, + OpCompressedRequest, + type OpCompressesRequestOptions, + OpMsgResponse, + OpReply, + type WriteProtocolMessageType +} from '../commands'; +import { OP_COMPRESSED, OP_MSG } from './constants'; + +/** @public */ +export const Compressor = Object.freeze({ + none: 0, + snappy: 1, + zlib: 2, + zstd: 3 +} as const); + +/** @public */ +export type Compressor = (typeof Compressor)[CompressorName]; + +/** @public */ +export type CompressorName = keyof typeof Compressor; + +export const uncompressibleCommands = new Set([ + LEGACY_HELLO_COMMAND, + 'saslStart', + 'saslContinue', + 'getnonce', + 'authenticate', + 'createUser', + 'updateUser', + 'copydbSaslStart', + 'copydbgetnonce', + 'copydb' +]); + +const ZSTD_COMPRESSION_LEVEL = 3; + +const zlibInflate = (buf: zlib.InputType) => { + return new Promise((resolve, reject) => { + zlib.inflate(buf, (error, result) => { + if (error) return reject(error); + resolve(result); + }); + }); +}; + +const zlibDeflate = (buf: zlib.InputType, options: zlib.ZlibOptions) => { + return new Promise((resolve, reject) => { + zlib.deflate(buf, options, (error, result) => { + if (error) return reject(error); + resolve(result); + }); + }); +}; + +let zstd: ZStandard; +let Snappy: SnappyLib | null = null; +function loadSnappy() { + if (Snappy == null) { + const snappyImport = getSnappy(); + if ('kModuleError' in snappyImport) { + throw snappyImport.kModuleError; + } + Snappy = snappyImport; + } + return Snappy; +} + +// Facilitate compressing a message using an agreed compressor +export async function compress( + options: OpCompressesRequestOptions, + dataToBeCompressed: Uint8Array +): Promise { + const zlibOptions = {} as zlib.ZlibOptions; + switch (options.agreedCompressor) { + case 'snappy': { + Snappy ??= loadSnappy(); + return await Snappy.compress(dataToBeCompressed); + } + case 'zstd': { + loadZstd(); + if ('kModuleError' in zstd) { + throw zstd['kModuleError']; + } + return await zstd.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL); + } + case 'zlib': { + if (options.zlibCompressionLevel) { + zlibOptions.level = options.zlibCompressionLevel; + } + return await zlibDeflate(dataToBeCompressed, zlibOptions); + } + default: { + throw new MongoInvalidArgumentError( + `Unknown compressor ${options.agreedCompressor} failed to compress` + ); + } + } +} + +// Decompress a message using the given compressor +export async function decompress( + compressorID: number, + compressedData: Uint8Array +): Promise { + if ( + compressorID !== Compressor.snappy && + compressorID !== Compressor.zstd && + compressorID !== Compressor.zlib && + compressorID !== Compressor.none + ) { + throw new MongoDecompressionError( + `Server sent message compressed using an unsupported compressor. (Received compressor ID ${compressorID})` + ); + } + + switch (compressorID) { + case Compressor.snappy: { + Snappy ??= loadSnappy(); + return await Snappy.uncompress(compressedData, { asBuffer: true }); + } + case Compressor.zstd: { + loadZstd(); + if ('kModuleError' in zstd) { + throw zstd['kModuleError']; + } + return await zstd.decompress(compressedData); + } + case Compressor.zlib: { + return await zlibInflate(compressedData); + } + default: { + return compressedData; + } + } +} + +/** + * Load ZStandard if it is not already set. + */ +function loadZstd() { + if (!zstd) { + zstd = getZstdLibrary(); + } +} + +const MESSAGE_HEADER_SIZE = 16; + +/** + * @internal + * + * Compresses an OP_MSG or OP_QUERY message, if compression is configured. This method + * also serializes the command to BSON. + */ +export async function compressCommand( + command: WriteProtocolMessageType, + description: { agreedCompressor?: CompressorName; zlibCompressionLevel?: number } +): Promise { + const finalCommand = + description.agreedCompressor === 'none' || !OpCompressedRequest.canCompress(command) + ? command + : new OpCompressedRequest(command, { + agreedCompressor: description.agreedCompressor ?? 'none', + zlibCompressionLevel: description.zlibCompressionLevel ?? 0 + }); + const data = await finalCommand.toBin(); + return ByteUtils.concat(data); +} + +/** + * @internal + * + * Decompresses an OP_MSG or OP_QUERY response from the server, if compression is configured. + * + * This method does not parse the response's BSON. + */ +export async function decompressResponse(message: Uint8Array): Promise { + const messageHeader: MessageHeader = { + length: readInt32LE(message, 0), + requestId: readInt32LE(message, 4), + responseTo: readInt32LE(message, 8), + opCode: readInt32LE(message, 12) + }; + + if (messageHeader.opCode !== OP_COMPRESSED) { + const ResponseType = messageHeader.opCode === OP_MSG ? OpMsgResponse : OpReply; + const messageBody = message.subarray(MESSAGE_HEADER_SIZE); + return new ResponseType(message, messageHeader, messageBody); + } + + const header: MessageHeader = { + ...messageHeader, + fromCompressed: true, + opCode: readInt32LE(message, MESSAGE_HEADER_SIZE), + length: readInt32LE(message, MESSAGE_HEADER_SIZE + 4) + }; + const compressorID = message[MESSAGE_HEADER_SIZE + 8]; + const compressedBuffer = message.slice(MESSAGE_HEADER_SIZE + 9); + + // recalculate based on wrapped opcode + const ResponseType = header.opCode === OP_MSG ? OpMsgResponse : OpReply; + const messageBody = await decompress(compressorID, compressedBuffer); + if (messageBody.length !== header.length) { + throw new MongoDecompressionError('Message body and message header must be the same length'); + } + return new ResponseType(message, header, messageBody); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/constants.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/constants.ts new file mode 100644 index 00000000..108b9fe4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/constants.ts @@ -0,0 +1,17 @@ +export const MIN_SUPPORTED_SERVER_VERSION = '4.4'; +export const MAX_SUPPORTED_SERVER_VERSION = '9.0'; +export const MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION = 13; +export const MIN_SUPPORTED_SNAPSHOT_READS_SERVER_VERSION = '5.0'; +export const MIN_SUPPORTED_WIRE_VERSION = 9; +export const MAX_SUPPORTED_WIRE_VERSION = 29; +export const MIN_SUPPORTED_QE_WIRE_VERSION = 21; +export const MIN_SUPPORTED_QE_SERVER_VERSION = '7.0'; +export const MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = 27; +export const MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = '8.2'; +export const OP_REPLY = 1; +export const OP_UPDATE = 2001; +export const OP_INSERT = 2002; +export const OP_QUERY = 2004; +export const OP_DELETE = 2006; +export const OP_COMPRESSED = 2012; +export const OP_MSG = 2013; diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_data.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_data.ts new file mode 100644 index 00000000..cf42f7b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_data.ts @@ -0,0 +1,139 @@ +import { type EventEmitter } from 'events'; + +import { type Abortable } from '../../mongo_types'; +import { type TimeoutContext } from '../../timeout'; +import { addAbortListener, kDispose, List, promiseWithResolvers } from '../../utils'; + +/** + * @internal + * An object holding references to a promise's resolve and reject functions. + */ +type PendingPromises = Omit< + ReturnType>>, + 'promise' +>; + +/** + * onData is adapted from Node.js' events.on helper + * https://nodejs.org/api/events.html#eventsonemitter-eventname-options + * + * Returns an AsyncIterator that iterates each 'data' event emitted from emitter. + * It will reject upon an error event. + */ +export function onData( + emitter: EventEmitter, + { timeoutContext, signal }: { timeoutContext?: TimeoutContext } & Abortable +) { + signal?.throwIfAborted(); + + // Setup pending events and pending promise lists + /** + * When the caller has not yet called .next(), we store the + * value from the event in this list. Next time they call .next() + * we pull the first value out of this list and resolve a promise with it. + */ + const unconsumedEvents = new List(); + /** + * When there has not yet been an event, a new promise will be created + * and implicitly stored in this list. When an event occurs we take the first + * promise in this list and resolve it. + */ + const unconsumedPromises = new List(); + + /** + * Stored an error created by an error event. + * This error will turn into a rejection for the subsequent .next() call + */ + let error: Error | null = null; + + /** Set to true only after event listeners have been removed. */ + let finished = false; + + const iterator: AsyncGenerator & AsyncDisposable = { + next() { + // First, we consume all unread events + const value = unconsumedEvents.shift(); + if (value != null) { + return Promise.resolve({ value, done: false }); + } + + // Then we error, if an error happened + // This happens one time if at all, because after 'error' + // we stop listening + if (error != null) { + const p = Promise.reject(error); + // Only the first element errors + error = null; + return p; + } + + // If the iterator is finished, resolve to done + if (finished) return closeHandler(); + + // Wait until an event happens + const { promise, resolve, reject } = promiseWithResolvers>(); + unconsumedPromises.push({ resolve, reject }); + return promise; + }, + + return() { + return closeHandler(); + }, + + throw(err: Error) { + errorHandler(err); + return Promise.resolve({ value: undefined, done: true }); + }, + + [Symbol.asyncIterator]() { + return this; + }, + + async [Symbol.asyncDispose]() { + await closeHandler(); + } + }; + + // Adding event handlers + emitter.on('data', eventHandler); + emitter.on('error', errorHandler); + const abortListener = addAbortListener(signal, function () { + errorHandler(this.reason); + }); + + const timeoutForSocketRead = timeoutContext?.timeoutForSocketRead; + timeoutForSocketRead?.throwIfExpired(); + timeoutForSocketRead?.then(undefined, errorHandler); + + return iterator; + + function eventHandler(value: Uint8Array) { + const promise = unconsumedPromises.shift(); + if (promise != null) promise.resolve({ value, done: false }); + else unconsumedEvents.push(value); + } + + function errorHandler(err: Error) { + const promise = unconsumedPromises.shift(); + + if (promise != null) promise.reject(err); + else error = err; + void closeHandler(); + } + + function closeHandler() { + // Adding event handlers + emitter.off('data', eventHandler); + emitter.off('error', errorHandler); + abortListener?.[kDispose](); + finished = true; + timeoutForSocketRead?.clear(); + const doneResult = { value: undefined, done: finished } as const; + + for (const promise of unconsumedPromises) { + promise.resolve(doneResult); + } + + return Promise.resolve(doneResult); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_demand/document.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_demand/document.ts new file mode 100644 index 00000000..133c9e78 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/on_demand/document.ts @@ -0,0 +1,356 @@ +import { + Binary, + type BSONElement, + BSONError, + BSONType, + ByteUtils, + deserialize, + type DeserializeOptions, + NumberUtils, + ObjectId, + parseToElementsToArray, + Timestamp +} from '../../../bson'; + +const BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 +} as const; + +/** @internal */ +export type JSTypeOf = { + [BSONType.null]: null; + [BSONType.undefined]: null; + [BSONType.double]: number; + [BSONType.int]: number; + [BSONType.long]: bigint; + [BSONType.timestamp]: Timestamp; + [BSONType.binData]: Binary; + [BSONType.bool]: boolean; + [BSONType.objectId]: ObjectId; + [BSONType.string]: string; + [BSONType.date]: Date; + [BSONType.object]: OnDemandDocument; + [BSONType.array]: OnDemandDocument; +}; + +/** @internal */ +type CachedBSONElement = { element: BSONElement; value: any | undefined }; + +/** + * @internal + * + * Options for `OnDemandDocument.toObject()`. Validation is required to ensure + * that callers provide utf8 validation options. */ +export type OnDemandDocumentDeserializeOptions = Omit & + Required>; + +/** @internal */ +export class OnDemandDocument { + /** + * Maps JS strings to elements and jsValues for speeding up subsequent lookups. + * - If `false` then name does not exist in the BSON document + * - If `CachedBSONElement` instance name exists + * - If `cache[name].value == null` jsValue has not yet been parsed + * - Null/Undefined values do not get cached because they are zero-length values. + */ + private readonly cache: Record = + Object.create(null); + /** Caches the index of elements that have been named */ + private readonly indexFound: Record = Object.create(null); + + /** All bson elements in this document */ + private readonly elements: ReadonlyArray; + /** BSON bytes, this document begins at offset */ + protected readonly bson: Uint8Array; + /** The start of the document */ + private readonly offset: number; + /** If this is an embedded document, indicates if this was a BSON array */ + public readonly isArray: boolean; + + constructor( + bson: Uint8Array, + offset = 0, + isArray = false, + /** If elements was already calculated */ + elements?: BSONElement[] + ) { + this.bson = bson; + this.offset = offset; + this.isArray = isArray; + this.elements = elements ?? parseToElementsToArray(this.bson, offset); + } + + /** Only supports basic latin strings */ + private isElementName(name: string, element: BSONElement): boolean { + const nameLength = element[BSONElementOffset.nameLength]; + const nameOffset = element[BSONElementOffset.nameOffset]; + + if (name.length !== nameLength) return false; + + const nameEnd = nameOffset + nameLength; + for ( + let byteIndex = nameOffset, charIndex = 0; + charIndex < name.length && byteIndex < nameEnd; + charIndex++, byteIndex++ + ) { + if (this.bson[byteIndex] !== name.charCodeAt(charIndex)) return false; + } + + return true; + } + + /** + * Seeks into the elements array for an element matching the given name. + * + * @remarks + * Caching: + * - Caches the existence of a property making subsequent look ups for non-existent properties return immediately + * - Caches names mapped to elements to avoid reiterating the array and comparing the name again + * - Caches the index at which an element has been found to prevent rechecking against elements already determined to belong to another name + * + * @param name - a basic latin string name of a BSON element + * @returns + */ + private getElement(name: string | number): CachedBSONElement | null { + const cachedElement = this.cache[name]; + if (cachedElement === false) return null; + + if (cachedElement != null) { + return cachedElement; + } + + if (typeof name === 'number') { + if (this.isArray) { + if (name < this.elements.length) { + const element = this.elements[name]; + const cachedElement = { element, value: undefined }; + this.cache[name] = cachedElement; + this.indexFound[name] = true; + return cachedElement; + } else { + return null; + } + } else { + return null; + } + } + + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + + // skip this element if it has already been associated with a name + if (!(index in this.indexFound) && this.isElementName(name, element)) { + const cachedElement = { element, value: undefined }; + this.cache[name] = cachedElement; + this.indexFound[index] = true; + return cachedElement; + } + } + + this.cache[name] = false; + return null; + } + + /** + * Translates BSON bytes into a javascript value. Checking `as` against the BSON element's type + * this methods returns the small subset of BSON types that the driver needs to function. + * + * @remarks + * - BSONType.null and BSONType.undefined always return null + * - If the type requested does not match this returns null + * + * @param element - The element to revive to a javascript value + * @param as - A type byte expected to be returned + */ + private toJSValue(element: BSONElement, as: T): JSTypeOf[T]; + private toJSValue(element: BSONElement, as: keyof JSTypeOf): any { + const type = element[BSONElementOffset.type]; + const offset = element[BSONElementOffset.offset]; + const length = element[BSONElementOffset.length]; + + if (as !== type) { + return null; + } + + switch (as) { + case BSONType.null: + case BSONType.undefined: + return null; + case BSONType.double: + return NumberUtils.getFloat64LE(this.bson, offset); + case BSONType.int: + return NumberUtils.getInt32LE(this.bson, offset); + case BSONType.long: + return NumberUtils.getBigInt64LE(this.bson, offset); + case BSONType.bool: + return Boolean(this.bson[offset]); + case BSONType.objectId: + return new ObjectId(this.bson.subarray(offset, offset + 12)); + case BSONType.timestamp: + return new Timestamp(NumberUtils.getBigInt64LE(this.bson, offset)); + case BSONType.string: + return ByteUtils.toUTF8(this.bson, offset + 4, offset + length - 1, false); + case BSONType.binData: { + const totalBinarySize = NumberUtils.getInt32LE(this.bson, offset); + const subType = this.bson[offset + 4]; + + if (subType === 2) { + const subType2BinarySize = NumberUtils.getInt32LE(this.bson, offset + 1 + 4); + if (subType2BinarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (subType2BinarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (subType2BinarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + return new Binary( + this.bson.subarray(offset + 1 + 4 + 4, offset + 1 + 4 + 4 + subType2BinarySize), + 2 + ); + } + + return new Binary( + this.bson.subarray(offset + 1 + 4, offset + 1 + 4 + totalBinarySize), + subType + ); + } + case BSONType.date: + // Pretend this is correct. + return new Date(Number(NumberUtils.getBigInt64LE(this.bson, offset))); + + case BSONType.object: + return new OnDemandDocument(this.bson, offset); + case BSONType.array: + return new OnDemandDocument(this.bson, offset, true); + + default: + throw new BSONError(`Unsupported BSON type: ${as}`); + } + } + + /** + * Returns the number of elements in this BSON document + */ + public size() { + return this.elements.length; + } + + /** + * Checks for the existence of an element by name. + * + * @remarks + * Uses `getElement` with the expectation that will populate caches such that a `has` call + * followed by a `getElement` call will not repeat the cost paid by the first look up. + * + * @param name - element name + */ + public has(name: string): boolean { + const cachedElement = this.cache[name]; + if (cachedElement === false) return false; + if (cachedElement != null) return true; + return this.getElement(name) != null; + } + + /** + * Turns BSON element with `name` into a javascript value. + * + * @typeParam T - must be one of the supported BSON types determined by `JSTypeOf` this will determine the return type of this function. + * @param name - the element name + * @param as - the bson type expected + * @param required - whether or not the element is expected to exist, if true this function will throw if it is not present + */ + public get( + name: string | number, + as: T, + required?: boolean + ): JSTypeOf[T] | null; + + /** `required` will make `get` throw if name does not exist or is null/undefined */ + public get( + name: string | number, + as: T, + required: true + ): JSTypeOf[T]; + + public get( + name: string | number, + as: T, + required?: boolean + ): JSTypeOf[T] | null { + const element = this.getElement(name); + if (element == null) { + if (required === true) { + throw new BSONError(`BSON element "${name}" is missing`); + } else { + return null; + } + } + + if (element.value == null) { + const value = this.toJSValue(element.element, as); + if (value == null) { + if (required === true) { + throw new BSONError(`BSON element "${name}" is missing`); + } else { + return null; + } + } + // It is important to never store null + element.value = value; + } + + return element.value; + } + + /** + * Supports returning int, double, long, and bool as javascript numbers + * + * @remarks + * **NOTE:** + * - Use this _only_ when you believe the potential precision loss of an int64 is acceptable + * - This method does not cache the result as Longs or booleans would be stored incorrectly + * + * @param name - element name + * @param required - throws if name does not exist + */ + public getNumber( + name: string, + required?: Req + ): Req extends true ? number : number | null; + public getNumber(name: string, required: boolean): number | null { + const maybeBool = this.get(name, BSONType.bool); + const bool = maybeBool == null ? null : maybeBool ? 1 : 0; + + const maybeLong = this.get(name, BSONType.long); + const long = maybeLong == null ? null : Number(maybeLong); + + const result = bool ?? long ?? this.get(name, BSONType.int) ?? this.get(name, BSONType.double); + + if (required === true && result == null) { + throw new BSONError(`BSON element "${name}" is missing`); + } + + return result; + } + + /** + * Deserialize this object, DOES NOT cache result so avoid multiple invocations + * @param options - BSON deserialization options + */ + public toObject(options?: OnDemandDocumentDeserializeOptions): Record { + return deserialize(this.bson, { + ...options, + index: this.offset, + allowObjectSmallerThanBufferSize: true + }); + } + + /** Returns this document's bytes only */ + toBytes() { + const size = NumberUtils.getInt32LE(this.bson, this.offset); + return this.bson.subarray(this.offset, this.offset + size); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/responses.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/responses.ts new file mode 100644 index 00000000..d5549aea --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/responses.ts @@ -0,0 +1,393 @@ +import { + type BSONElement, + type BSONSerializeOptions, + BSONType, + type DeserializeOptions, + type Document, + Long, + parseToElementsToArray, + parseUtf8ValidationOption, + pluckBSONSerializeOptions, + serialize, + type Timestamp +} from '../../bson'; +import { MONGODB_ERROR_CODES, MongoUnexpectedServerResponseError } from '../../error'; +import { type ClusterTime } from '../../sdam/common'; +import { decorateDecryptionResult, ns } from '../../utils'; +import { + type JSTypeOf, + OnDemandDocument, + type OnDemandDocumentDeserializeOptions +} from './on_demand/document'; + +const BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 +} as const; + +/** + * Accepts a BSON payload and checks for na "ok: 0" element. + * This utility is intended to prevent calling response class constructors + * that expect the result to be a success and demand certain properties to exist. + * + * For example, a cursor response always expects a cursor embedded document. + * In order to write the class such that the properties reflect that assertion (non-null) + * we cannot invoke the subclass constructor if the BSON represents an error. + * + * @param bytes - BSON document returned from the server + */ +export function isErrorResponse(bson: Uint8Array, elements: BSONElement[]): boolean { + for (let eIdx = 0; eIdx < elements.length; eIdx++) { + const element = elements[eIdx]; + + if (element[BSONElementOffset.nameLength] === 2) { + const nameOffset = element[BSONElementOffset.nameOffset]; + + // 111 == "o", 107 == "k" + if (bson[nameOffset] === 111 && bson[nameOffset + 1] === 107) { + const valueOffset = element[BSONElementOffset.offset]; + const valueLength = element[BSONElementOffset.length]; + + // If any byte in the length of the ok number (works for any type) is non zero, + // then it is considered "ok: 1" + for (let i = valueOffset; i < valueOffset + valueLength; i++) { + if (bson[i] !== 0x00) return false; + } + + return true; + } + } + } + + return true; +} + +/** @internal */ +export type MongoDBResponseConstructor = { + new (bson: Uint8Array, offset?: number, isArray?: boolean): MongoDBResponse; + make(bson: Uint8Array): MongoDBResponse; +}; + +/** @internal */ +export class MongoDBResponse extends OnDemandDocument { + // Wrap error thrown from BSON + public override get( + name: string | number, + as: T, + required?: false + ): JSTypeOf[T] | null; + public override get( + name: string | number, + as: T, + required: true + ): JSTypeOf[T]; + public override get( + name: string | number, + as: T, + required?: boolean + ): JSTypeOf[T] | null { + try { + return super.get(name, as, required); + } catch (cause) { + throw new MongoUnexpectedServerResponseError(cause.message, { cause }); + } + } + + static is(value: unknown): value is MongoDBResponse { + return value instanceof MongoDBResponse; + } + + static make(bson: Uint8Array) { + const elements = parseToElementsToArray(bson, 0); + const isError = isErrorResponse(bson, elements); + return isError + ? new MongoDBResponse(bson, 0, false, elements) + : new this(bson, 0, false, elements); + } + + // {ok:1} + static empty = new MongoDBResponse(new Uint8Array([13, 0, 0, 0, 16, 111, 107, 0, 1, 0, 0, 0, 0])); + + /** + * Returns true iff: + * - ok is 0 and the top-level code === 50 + * - ok is 1 and the writeErrors array contains a code === 50 + * - ok is 1 and the writeConcern object contains a code === 50 + */ + get isMaxTimeExpiredError() { + // {ok: 0, code: 50 ... } + const isTopLevel = this.ok === 0 && this.code === MONGODB_ERROR_CODES.MaxTimeMSExpired; + if (isTopLevel) return true; + + if (this.ok === 0) return false; + + // {ok: 1, writeConcernError: {code: 50 ... }} + const isWriteConcern = + this.get('writeConcernError', BSONType.object)?.getNumber('code') === + MONGODB_ERROR_CODES.MaxTimeMSExpired; + if (isWriteConcern) return true; + + const writeErrors = this.get('writeErrors', BSONType.array); + if (writeErrors?.size()) { + for (let i = 0; i < writeErrors.size(); i++) { + const isWriteError = + writeErrors.get(i, BSONType.object)?.getNumber('code') === + MONGODB_ERROR_CODES.MaxTimeMSExpired; + + // {ok: 1, writeErrors: [{code: 50 ... }]} + if (isWriteError) return true; + } + } + + return false; + } + + /** + * Drivers can safely assume that the `recoveryToken` field is always a BSON document but drivers MUST NOT modify the + * contents of the document. + */ + get recoveryToken(): Document | null { + return ( + this.get('recoveryToken', BSONType.object)?.toObject({ + promoteValues: false, + promoteLongs: false, + promoteBuffers: false, + validation: { utf8: true } + }) ?? null + ); + } + + /** + * The server creates a cursor in response to a snapshot find/aggregate command and reports atClusterTime within the cursor field in the response. + * For the distinct command the server adds a top-level atClusterTime field to the response. + * The atClusterTime field represents the timestamp of the read and is guaranteed to be majority committed. + */ + public get atClusterTime(): Timestamp | null { + return ( + this.get('cursor', BSONType.object)?.get('atClusterTime', BSONType.timestamp) ?? + this.get('atClusterTime', BSONType.timestamp) + ); + } + + public get operationTime(): Timestamp | null { + return this.get('operationTime', BSONType.timestamp); + } + + /** Normalizes whatever BSON value is "ok" to a JS number 1 or 0. */ + public get ok(): 0 | 1 { + return this.getNumber('ok') ? 1 : 0; + } + + public get $err(): string | null { + return this.get('$err', BSONType.string); + } + + public get errmsg(): string | null { + return this.get('errmsg', BSONType.string); + } + + public get code(): number | null { + return this.getNumber('code'); + } + + private clusterTime?: ClusterTime | null; + public get $clusterTime(): ClusterTime | null { + if (!('clusterTime' in this)) { + const clusterTimeDoc = this.get('$clusterTime', BSONType.object); + if (clusterTimeDoc == null) { + this.clusterTime = null; + return null; + } + const clusterTime = clusterTimeDoc.get('clusterTime', BSONType.timestamp, true); + const signature = clusterTimeDoc.get('signature', BSONType.object)?.toObject(); + // @ts-expect-error: `signature` is incorrectly typed. It is public API. + this.clusterTime = { clusterTime, signature }; + } + return this.clusterTime ?? null; + } + + public override toObject(options?: BSONSerializeOptions): Record { + const exactBSONOptions = { + ...pluckBSONSerializeOptions(options ?? {}), + validation: parseUtf8ValidationOption(options) + }; + return super.toObject(exactBSONOptions); + } +} + +/** @internal */ +export class CursorResponse extends MongoDBResponse { + /** + * Devtools need to know which keys were encrypted before the driver automatically decrypted them. + * If decorating is enabled (`Symbol.for('@@mdb.decorateDecryptionResult')`), this field will be set, + * storing the original encrypted response from the server, so that we can build an object that has + * the list of BSON keys that were encrypted stored at a well known symbol: `Symbol.for('@@mdb.decryptedKeys')`. + */ + encryptedResponse?: MongoDBResponse; + /** + * This supports a feature of the FindCursor. + * It is an optimization to avoid an extra getMore when the limit has been reached + */ + static get emptyGetMore(): CursorResponse { + return new CursorResponse(serialize({ ok: 1, cursor: { id: 0n, nextBatch: [] } })); + } + + static override is(value: unknown): value is CursorResponse { + return value instanceof CursorResponse || value === CursorResponse.emptyGetMore; + } + + private _batch: OnDemandDocument | null = null; + private iterated = 0; + + get cursor() { + return this.get('cursor', BSONType.object, true); + } + + public get id(): Long { + try { + return Long.fromBigInt(this.cursor.get('id', BSONType.long, true)); + } catch (cause) { + throw new MongoUnexpectedServerResponseError(cause.message, { cause }); + } + } + + public get ns() { + const namespace = this.cursor.get('ns', BSONType.string); + if (namespace != null) return ns(namespace); + return null; + } + + public get length() { + return Math.max(this.batchSize - this.iterated, 0); + } + + private _encryptedBatch: OnDemandDocument | null = null; + get encryptedBatch() { + if (this.encryptedResponse == null) return null; + if (this._encryptedBatch != null) return this._encryptedBatch; + + const cursor = this.encryptedResponse?.get('cursor', BSONType.object); + if (cursor?.has('firstBatch')) + this._encryptedBatch = cursor.get('firstBatch', BSONType.array, true); + else if (cursor?.has('nextBatch')) + this._encryptedBatch = cursor.get('nextBatch', BSONType.array, true); + else throw new MongoUnexpectedServerResponseError('Cursor document did not contain a batch'); + + return this._encryptedBatch; + } + + private get batch() { + if (this._batch != null) return this._batch; + const cursor = this.cursor; + if (cursor.has('firstBatch')) this._batch = cursor.get('firstBatch', BSONType.array, true); + else if (cursor.has('nextBatch')) this._batch = cursor.get('nextBatch', BSONType.array, true); + else throw new MongoUnexpectedServerResponseError('Cursor document did not contain a batch'); + return this._batch; + } + + public get batchSize() { + return this.batch?.size(); + } + + public get postBatchResumeToken() { + return ( + this.cursor.get('postBatchResumeToken', BSONType.object)?.toObject({ + promoteValues: false, + promoteLongs: false, + promoteBuffers: false, + validation: { utf8: true } + }) ?? null + ); + } + + public shift(options: OnDemandDocumentDeserializeOptions): any { + if (this.iterated >= this.batchSize) { + return null; + } + + const result = this.batch.get(this.iterated, BSONType.object, true) ?? null; + const encryptedResult = this.encryptedBatch?.get(this.iterated, BSONType.object, true) ?? null; + + this.iterated += 1; + + if (options?.raw) { + return result.toBytes(); + } else { + const object = result.toObject(options); + if (encryptedResult) { + decorateDecryptionResult(object, encryptedResult.toObject(options), true); + } + return object; + } + } + + public clear() { + this.iterated = this.batchSize; + } +} + +/** + * Explain responses have nothing to do with cursor responses + * This class serves to temporarily avoid refactoring how cursors handle + * explain responses which is to detect that the response is not cursor-like and return the explain + * result as the "first and only" document in the "batch" and end the "cursor" + */ +export class ExplainedCursorResponse extends CursorResponse { + isExplain = true; + + override get id(): Long { + return Long.fromBigInt(0n); + } + + override get batchSize() { + return 0; + } + + override get ns() { + return null; + } + + _length = 1; + override get length(): number { + return this._length; + } + + override shift(options?: DeserializeOptions) { + if (this._length === 0) return null; + this._length -= 1; + return this.toObject(options); + } +} + +/** + * Client bulk writes have some extra metadata at the top level that needs to be + * included in the result returned to the user. + */ +export class ClientBulkWriteCursorResponse extends CursorResponse { + get insertedCount() { + return this.get('nInserted', BSONType.int, true); + } + + get upsertedCount() { + return this.get('nUpserted', BSONType.int, true); + } + + get matchedCount() { + return this.get('nMatched', BSONType.int, true); + } + + get modifiedCount() { + return this.get('nModified', BSONType.int, true); + } + + get deletedCount() { + return this.get('nDeleted', BSONType.int, true); + } + + get writeConcernError() { + return this.get('writeConcernError', BSONType.object, false); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/shared.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/shared.ts new file mode 100644 index 00000000..30757da1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cmap/wire_protocol/shared.ts @@ -0,0 +1,48 @@ +import { MongoInvalidArgumentError } from '../../error'; +import { ReadPreference, type ReadPreferenceLike } from '../../read_preference'; +import { ServerType } from '../../sdam/common'; +import type { Server } from '../../sdam/server'; +import type { ServerDescription } from '../../sdam/server_description'; +import type { Topology } from '../../sdam/topology'; +import { TopologyDescription } from '../../sdam/topology_description'; +import type { Connection } from '../connection'; + +export interface ReadPreferenceOption { + readPreference?: ReadPreferenceLike; +} + +export function getReadPreference(options?: ReadPreferenceOption): ReadPreference { + // Default to command version of the readPreference. + let readPreference = options?.readPreference ?? ReadPreference.primary; + + if (typeof readPreference === 'string') { + readPreference = ReadPreference.fromString(readPreference); + } + + if (!(readPreference instanceof ReadPreference)) { + throw new MongoInvalidArgumentError( + 'Option "readPreference" must be a ReadPreference instance' + ); + } + + return readPreference; +} + +export function isSharded(topologyOrServer?: Topology | Server | Connection): boolean { + if (topologyOrServer == null) { + return false; + } + + if (topologyOrServer.description && topologyOrServer.description.type === ServerType.Mongos) { + return true; + } + + // NOTE: This is incredibly inefficient, and should be removed once command construction + // happens based on `Server` not `Topology`. + if (topologyOrServer.description && topologyOrServer.description instanceof TopologyDescription) { + const servers: ServerDescription[] = Array.from(topologyOrServer.description.servers.values()); + return servers.some((server: ServerDescription) => server.type === ServerType.Mongos); + } + + return false; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/collection.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/collection.ts new file mode 100644 index 00000000..e3a52057 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/collection.ts @@ -0,0 +1,1314 @@ +import { type BSONSerializeOptions, type Document, resolveBSONOptions } from './bson'; +import type { + AnyBulkWriteOperation, + BulkOperationBase, + BulkWriteOptions, + BulkWriteResult +} from './bulk/common'; +import { OrderedBulkOperation } from './bulk/ordered'; +import { UnorderedBulkOperation } from './bulk/unordered'; +import { ChangeStream, type ChangeStreamDocument, type ChangeStreamOptions } from './change_stream'; +import { AggregationCursor } from './cursor/aggregation_cursor'; +import { FindCursor } from './cursor/find_cursor'; +import { ListIndexesCursor } from './cursor/list_indexes_cursor'; +import { + ListSearchIndexesCursor, + type ListSearchIndexesOptions +} from './cursor/list_search_indexes_cursor'; +import type { Db } from './db'; +import { MongoAPIError, MongoInvalidArgumentError, MongoOperationTimeoutError } from './error'; +import { type ExplainCommandOptions, type ExplainVerbosityLike } from './explain'; +import type { MongoClient, PkFactory } from './mongo_client'; +import type { + Abortable, + Filter, + Flatten, + OptionalUnlessRequiredId, + TODO_NODE_3286, + UpdateFilter, + WithId, + WithoutId +} from './mongo_types'; +import type { AggregateOptions } from './operations/aggregate'; +import { CountOperation, type CountOptions } from './operations/count'; +import { + DeleteManyOperation, + DeleteOneOperation, + type DeleteOptions, + type DeleteResult +} from './operations/delete'; +import { DistinctOperation, type DistinctOptions } from './operations/distinct'; +import { type DropCollectionOptions } from './operations/drop'; +import { + EstimatedDocumentCountOperation, + type EstimatedDocumentCountOptions +} from './operations/estimated_document_count'; +import { autoConnect, executeOperation } from './operations/execute_operation'; +import { type FindOneOptions, type FindOptions } from './operations/find'; +import { + FindOneAndDeleteOperation, + type FindOneAndDeleteOptions, + FindOneAndReplaceOperation, + type FindOneAndReplaceOptions, + FindOneAndUpdateOperation, + type FindOneAndUpdateOptions +} from './operations/find_and_modify'; +import { + CreateIndexesOperation, + type CreateIndexesOptions, + type DropIndexesOptions, + DropIndexOperation, + type IndexDescription, + type IndexDescriptionCompact, + type IndexDescriptionInfo, + type IndexInformationOptions, + type IndexSpecification, + type ListIndexesOptions +} from './operations/indexes'; +import { + type InsertManyResult, + InsertOneOperation, + type InsertOneOptions, + type InsertOneResult +} from './operations/insert'; +import type { Hint, OperationOptions } from './operations/operation'; +import { RenameOperation, type RenameOptions } from './operations/rename'; +import { + CreateSearchIndexesOperation, + type SearchIndexDescription +} from './operations/search_indexes/create'; +import { DropSearchIndexOperation } from './operations/search_indexes/drop'; +import { UpdateSearchIndexOperation } from './operations/search_indexes/update'; +import { + ReplaceOneOperation, + type ReplaceOptions, + UpdateManyOperation, + UpdateOneOperation, + type UpdateOptions, + type UpdateResult +} from './operations/update'; +import { ReadConcern, type ReadConcernLike } from './read_concern'; +import { ReadPreference, type ReadPreferenceLike } from './read_preference'; +import { type Sort } from './sort'; +import { + DEFAULT_PK_FACTORY, + MongoDBCollectionNamespace, + normalizeHintField, + resolveOptions +} from './utils'; +import { WriteConcern, type WriteConcernOptions } from './write_concern'; + +/** @public */ +export interface ModifyResult { + value: WithId | null; + lastErrorObject?: Document; + ok: 0 | 1; +} + +/** @public */ +export interface CountDocumentsOptions extends AggregateOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amount of documents to consider. */ + limit?: number; +} + +/** @public */ +export interface CollectionOptions extends BSONSerializeOptions, WriteConcernOptions { + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/** @internal */ +export interface CollectionPrivate { + pkFactory: PkFactory; + db: Db; + options: any; + namespace: MongoDBCollectionNamespace; + readPreference?: ReadPreference; + bsonOptions: BSONSerializeOptions; + collectionHint?: Hint; + readConcern?: ReadConcern; + writeConcern?: WriteConcern; +} + +/** + * The **Collection** class is an internal class that embodies a MongoDB collection + * allowing for insert/find/update/delete and other command operation on that MongoDB collection. + * + * **COLLECTION Cannot directly be instantiated** + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * interface Pet { + * name: string; + * kind: 'dog' | 'cat' | 'fish'; + * } + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const pets = client.db().collection('pets'); + * + * const petCursor = pets.find(); + * + * for await (const pet of petCursor) { + * console.log(`${pet.name} is a ${pet.kind}!`); + * } + * ``` + */ +export class Collection { + /** @internal */ + s: CollectionPrivate; + + /** @internal */ + client: MongoClient; + + /** + * Get the database object for the collection. + */ + readonly db: Db; + + /** + * Create a new Collection instance + * @internal + */ + constructor(db: Db, name: string, options?: CollectionOptions) { + this.db = db; + // Internal state + this.s = { + db, + options, + namespace: new MongoDBCollectionNamespace(db.databaseName, name), + pkFactory: db.options?.pkFactory ?? DEFAULT_PK_FACTORY, + readPreference: ReadPreference.fromOptions(options), + bsonOptions: resolveBSONOptions(options, db), + readConcern: ReadConcern.fromOptions(options), + writeConcern: WriteConcern.fromOptions(options) + }; + + this.client = db.client; + } + + /** + * The name of the database this collection belongs to + */ + get dbName(): string { + return this.s.namespace.db; + } + + /** + * The name of this collection + */ + get collectionName(): string { + return this.s.namespace.collection; + } + + /** + * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}` + */ + get namespace(): string { + return this.fullNamespace.toString(); + } + + /** + * @internal + * + * The `MongoDBNamespace` for the collection. + */ + get fullNamespace(): MongoDBCollectionNamespace { + return this.s.namespace; + } + + /** + * The current readConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readConcern(): ReadConcern | undefined { + if (this.s.readConcern == null) { + return this.db.readConcern; + } + return this.s.readConcern; + } + + /** + * The current readPreference of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readPreference(): ReadPreference | undefined { + if (this.s.readPreference == null) { + return this.db.readPreference; + } + + return this.s.readPreference; + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + /** + * The current writeConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get writeConcern(): WriteConcern | undefined { + if (this.s.writeConcern == null) { + return this.db.writeConcern; + } + return this.s.writeConcern; + } + + /** The current index hint for the collection */ + get hint(): Hint | undefined { + return this.s.collectionHint; + } + + set hint(v: Hint | undefined) { + this.s.collectionHint = normalizeHintField(v); + } + + public get timeoutMS(): number | undefined { + return this.s.options.timeoutMS; + } + + /** + * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param doc - The document to insert + * @param options - Optional settings for the command + */ + async insertOne( + doc: OptionalUnlessRequiredId, + options?: InsertOneOptions + ): Promise> { + return await executeOperation( + this.client, + new InsertOneOperation( + this as TODO_NODE_3286, + doc, + resolveOptions(this, options) + ) as TODO_NODE_3286 + ); + } + + /** + * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param docs - The documents to insert + * @param options - Optional settings for the command + */ + async insertMany( + docs: ReadonlyArray>, + options?: BulkWriteOptions + ): Promise> { + if (!Array.isArray(docs)) { + throw new MongoInvalidArgumentError('Argument "docs" must be an array of documents'); + } + options = resolveOptions(this, options ?? {}); + + const acknowledged = WriteConcern.fromOptions(options)?.w !== 0; + + try { + const res = await this.bulkWrite( + docs.map(doc => ({ insertOne: { document: doc } })), + options + ); + return { + acknowledged, + insertedCount: res.insertedCount, + insertedIds: res.insertedIds + }; + } catch (err) { + if (err && err.message === 'Operation must be an object with an operation key') { + throw new MongoInvalidArgumentError( + 'Collection.insertMany() cannot be called with an array that has null/undefined values' + ); + } + throw err; + } + } + + /** + * Perform a bulkWrite operation without a fluent API + * + * Legal operation types are + * - `insertOne` + * - `replaceOne` + * - `updateOne` + * - `updateMany` + * - `deleteOne` + * - `deleteMany` + * + * If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param operations - Bulk operations to perform + * @param options - Optional settings for the command + * @throws MongoDriverError if operations is not an array + */ + async bulkWrite( + operations: ReadonlyArray>, + options?: BulkWriteOptions + ): Promise { + if (!Array.isArray(operations)) { + throw new MongoInvalidArgumentError('Argument "operations" must be an array of documents'); + } + + options = resolveOptions(this, options ?? {}); + + // TODO(NODE-7071): remove once the client doesn't need to be connected to construct + // bulk operations + const isConnected = this.client.topology != null; + if (!isConnected) { + await autoConnect(this.client); + } + + // Create the bulk operation + const bulk: BulkOperationBase = + options.ordered === false + ? this.initializeUnorderedBulkOp(options) + : this.initializeOrderedBulkOp(options); + + // for each op go through and add to the bulk + for (const operation of operations) { + bulk.raw(operation); + } + + // Execute the bulk + return await bulk.execute({ ...options }); + } + + /** + * Update a single document in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + async updateOne( + filter: Filter, + update: UpdateFilter | Document[], + options?: UpdateOptions & { sort?: Sort } + ): Promise> { + return await executeOperation( + this.client, + new UpdateOneOperation(this.s.namespace, filter, update, resolveOptions(this, options)) + ); + } + + /** + * Replace a document in a collection with another document + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + */ + async replaceOne( + filter: Filter, + replacement: WithoutId, + options?: ReplaceOptions + ): Promise> { + return await executeOperation( + this.client, + new ReplaceOneOperation(this.s.namespace, filter, replacement, resolveOptions(this, options)) + ); + } + + /** + * Update multiple documents in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + async updateMany( + filter: Filter, + update: UpdateFilter | Document[], + options?: UpdateOptions + ): Promise> { + return await executeOperation( + this.client, + new UpdateManyOperation(this.s.namespace, filter, update, resolveOptions(this, options)) + ); + } + + /** + * Delete a document from a collection + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + */ + async deleteOne( + filter: Filter = {}, + options: DeleteOptions = {} + ): Promise { + return await executeOperation( + this.client, + new DeleteOneOperation(this.s.namespace, filter, resolveOptions(this, options)) + ); + } + + /** + * Delete multiple documents from a collection + * + * @param filter - The filter used to select the documents to remove + * @param options - Optional settings for the command + */ + async deleteMany( + filter: Filter = {}, + options: DeleteOptions = {} + ): Promise { + return await executeOperation( + this.client, + new DeleteManyOperation(this.s.namespace, filter, resolveOptions(this, options)) + ); + } + + /** + * Rename the collection. + * + * @remarks + * This operation does not inherit options from the Db or MongoClient. + * + * @param newName - New name of of the collection. + * @param options - Optional settings for the command + */ + async rename(newName: string, options?: RenameOptions): Promise { + // Intentionally, we do not inherit options from parent for this operation. + return await executeOperation( + this.client, + new RenameOperation( + this as TODO_NODE_3286, + newName, + resolveOptions(undefined, { + ...options, + readPreference: ReadPreference.PRIMARY + }) + ) + ); + } + + /** + * Drop the collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param options - Optional settings for the command + */ + async drop(options?: DropCollectionOptions): Promise { + return await this.db.dropCollection(this.collectionName, options); + } + + /** + * Fetches the first document that matches the filter + * + * @param filter - Query for find Operation + * @param options - Optional settings for the command + */ + async findOne(): Promise | null>; + async findOne(filter: Filter): Promise | null>; + async findOne( + filter: Filter, + options: Omit & Abortable + ): Promise | null>; + + // allow an override of the schema. + async findOne(): Promise; + async findOne(filter: Filter): Promise; + async findOne( + filter: Filter, + options?: Omit & Abortable + ): Promise; + + async findOne( + filter: Filter = {}, + options: Omit & Abortable = {} + ): Promise | null> { + // Explicitly set the limit to 1 and singleBatch to true for all commands, per the spec. + // noCursorTimeout must be unset as well as batchSize. + // See: https://github.com/mongodb/specifications/blob/master/source/crud/crud.md#findone-api-details + const { ...opts } = options; + opts.singleBatch = true; + const cursor = this.find(filter, opts).limit(1); + const result = await cursor.next(); + await cursor.close(); + return result; + } + + /** + * Creates a cursor for a filter that can be used to iterate over results from MongoDB + * + * @param filter - The filter predicate. If unspecified, then all documents in the collection will match the predicate + */ + find(): FindCursor>; + find(filter: Filter, options?: FindOptions & Abortable): FindCursor>; + find( + filter: Filter, + options?: FindOptions & Abortable + ): FindCursor; + find( + filter: Filter = {}, + options: FindOptions & Abortable = {} + ): FindCursor> { + return new FindCursor>( + this.client, + this.s.namespace, + filter, + resolveOptions(this, options) + ); + } + + /** + * Returns the options of the collection. + * + * @param options - Optional settings for the command + */ + async options(options?: OperationOptions): Promise { + options = resolveOptions(this, options); + const [collection] = await this.db + .listCollections({ name: this.collectionName }, { ...options, nameOnly: false }) + .toArray(); + + if (collection == null || collection.options == null) { + throw new MongoAPIError(`collection ${this.namespace} not found`); + } + + return collection.options; + } + + /** + * Returns if the collection is a capped collection + * + * @param options - Optional settings for the command + */ + async isCapped(options?: OperationOptions): Promise { + const { capped } = await this.options(options); + return Boolean(capped); + } + + /** + * Creates an index on the db and collection collection. + * + * @param indexSpec - The field name or index specification to create an index for + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * + * await collection.createIndex({ a: 1, b: -1 }); + * + * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes + * await collection.createIndex([ [c, 1], [d, -1] ]); + * + * // Equivalent to { e: 1 } + * await collection.createIndex('e'); + * + * // Equivalent to { f: 1, g: 1 } + * await collection.createIndex(['f', 'g']) + * + * // Equivalent to { h: 1, i: -1 } + * await collection.createIndex([ { h: 1 }, { i: -1 } ]); + * + * // Equivalent to { j: 1, k: -1, l: 2d } + * await collection.createIndex(['j', ['k', -1], { l: '2d' }]) + * ``` + */ + async createIndex( + indexSpec: IndexSpecification, + options?: CreateIndexesOptions + ): Promise { + const indexes = await executeOperation( + this.client, + CreateIndexesOperation.fromIndexSpecification( + this, + this.collectionName, + indexSpec, + resolveOptions(this, options) + ) + ); + + return indexes[0]; + } + + /** + * Creates multiple indexes in the collection, this method is only supported for + * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported + * error. + * + * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specifications. + * Index specifications are defined {@link https://www.mongodb.com/docs/manual/reference/command/createIndexes/| here}. + * + * @param indexSpecs - An array of index specifications to be created + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * await collection.createIndexes([ + * // Simple index on field fizz + * { + * key: { fizz: 1 }, + * } + * // wildcard index + * { + * key: { '$**': 1 } + * }, + * // named index on darmok and jalad + * { + * key: { darmok: 1, jalad: -1 } + * name: 'tanagra' + * } + * ]); + * ``` + */ + async createIndexes( + indexSpecs: IndexDescription[], + options?: CreateIndexesOptions + ): Promise { + return await executeOperation( + this.client, + CreateIndexesOperation.fromIndexDescriptionArray( + this, + this.collectionName, + indexSpecs, + resolveOptions(this, { ...options, maxTimeMS: undefined }) + ) + ); + } + + /** + * Drops an index from this collection. + * + * @param indexName - Name of the index to drop. + * @param options - Optional settings for the command + */ + async dropIndex(indexName: string, options?: DropIndexesOptions): Promise { + return await executeOperation( + this.client, + new DropIndexOperation(this as TODO_NODE_3286, indexName, { + ...resolveOptions(this, options), + readPreference: ReadPreference.primary + }) + ); + } + + /** + * Drops all indexes from this collection. + * + * @param options - Optional settings for the command + */ + async dropIndexes(options?: DropIndexesOptions): Promise { + try { + await executeOperation( + this.client, + new DropIndexOperation(this as TODO_NODE_3286, '*', resolveOptions(this, options)) + ); + return true; + } catch (error) { + // TODO(NODE-6517): Driver should only filter for namespace not found error. Other errors should be thrown. + if (error instanceof MongoOperationTimeoutError) throw error; + return false; + } + } + + /** + * Get the list of all indexes information for the collection. + * + * @param options - Optional settings for the command + */ + listIndexes(options?: ListIndexesOptions): ListIndexesCursor { + return new ListIndexesCursor(this as TODO_NODE_3286, resolveOptions(this, options)); + } + + /** + * Checks if one or more indexes exist on the collection, fails on first non-existing index + * + * @param indexes - One or more index names to check. + * @param options - Optional settings for the command + */ + async indexExists(indexes: string | string[], options?: ListIndexesOptions): Promise { + const indexNames: string[] = Array.isArray(indexes) ? indexes : [indexes]; + const allIndexes: Set = new Set( + await this.listIndexes(options) + .map(({ name }) => name) + .toArray() + ); + return indexNames.every(name => allIndexes.has(name)); + } + + /** + * Retrieves this collections index info. + * + * @param options - Optional settings for the command + */ + indexInformation( + options: IndexInformationOptions & { full: true } + ): Promise; + indexInformation( + options: IndexInformationOptions & { full?: false } + ): Promise; + indexInformation( + options: IndexInformationOptions + ): Promise; + indexInformation(): Promise; + async indexInformation( + options?: IndexInformationOptions + ): Promise { + return await this.indexes({ + ...options, + full: options?.full ?? false + }); + } + + /** + * Gets an estimate of the count of documents in a collection using collection metadata. + * This will always run a count command on all server versions. + * + * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, + * which estimatedDocumentCount uses in its implementation, was not included in v1 of + * the Stable API, and so users of the Stable API with estimatedDocumentCount are + * recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid + * encountering errors. + * + * @see {@link https://www.mongodb.com/docs/manual/reference/command/count/#behavior|Count: Behavior} + * @param options - Optional settings for the command + */ + async estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise { + return await executeOperation( + this.client, + new EstimatedDocumentCountOperation(this as TODO_NODE_3286, resolveOptions(this, options)) + ); + } + + /** + * Gets the number of documents matching the filter. + * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * Due to countDocuments using the $match aggregation pipeline stage, certain query operators cannot be used in countDocuments. This includes the $where and $near query operators, among others. Details can be found in the documentation for the $match aggregation pipeline stage. + * + * **Note**: When migrating from {@link Collection#count| count} to {@link Collection#countDocuments| countDocuments} + * the following query operators must be replaced: + * + * | Operator | Replacement | + * | -------- | ----------- | + * | `$where` | [`$expr`][1] | + * | `$near` | [`$geoWithin`][2] with [`$center`][3] | + * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] | + * + * [1]: https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * [2]: https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * [3]: https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * [4]: https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + * + * @param filter - The filter for the count + * @param options - Optional settings for the command + * + * @see https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * @see https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + */ + async countDocuments( + filter: Filter = {}, + options: CountDocumentsOptions & Abortable = {} + ): Promise { + const pipeline = []; + pipeline.push({ $match: filter }); + + if (typeof options.skip === 'number') { + pipeline.push({ $skip: options.skip }); + } + + if (typeof options.limit === 'number') { + pipeline.push({ $limit: options.limit }); + } + + pipeline.push({ $group: { _id: 1, n: { $sum: 1 } } }); + + const cursor = this.aggregate<{ n: number }>(pipeline, options); + const doc = await cursor.next(); + await cursor.close(); + return doc?.n ?? 0; + } + + /** + * The distinct command returns a list of distinct values for the given key across a collection. + * + * @param key - Field of the document to find distinct values for + * @param filter - The filter for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings for the command + */ + distinct>( + key: Key + ): Promise[Key]>>>; + distinct>( + key: Key, + filter: Filter + ): Promise[Key]>>>; + distinct>( + key: Key, + filter: Filter, + options: DistinctOptions + ): Promise[Key]>>>; + distinct>( + key: Key, + filter: Filter, + options: DistinctOptions & { explain: ExplainVerbosityLike | ExplainCommandOptions } + ): Promise; + + // Embedded documents overload + distinct(key: string): Promise; + distinct(key: string, filter: Filter): Promise; + distinct(key: string, filter: Filter, options: DistinctOptions): Promise; + + async distinct>( + key: Key, + filter: Filter = {}, + options: DistinctOptions = {} + ): Promise { + return await executeOperation( + this.client, + new DistinctOperation( + this as TODO_NODE_3286, + key as TODO_NODE_3286, + filter, + resolveOptions(this, options) + ) + ); + } + + /** + * Retrieve all the indexes on the collection. + * + * @param options - Optional settings for the command + */ + indexes(options: IndexInformationOptions & { full?: true }): Promise; + indexes(options: IndexInformationOptions & { full: false }): Promise; + indexes( + options: IndexInformationOptions + ): Promise; + indexes(options?: ListIndexesOptions): Promise; + async indexes( + options?: IndexInformationOptions + ): Promise { + const indexes: IndexDescriptionInfo[] = await this.listIndexes(options).toArray(); + const full = options?.full ?? true; + if (full) { + return indexes; + } + + const object: IndexDescriptionCompact = Object.fromEntries( + indexes.map(({ name, key }) => [name, Object.entries(key)]) + ); + + return object; + } + + /** + * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + */ + async findOneAndDelete( + filter: Filter, + options: FindOneAndDeleteOptions & { includeResultMetadata: true } + ): Promise>; + async findOneAndDelete( + filter: Filter, + options: FindOneAndDeleteOptions & { includeResultMetadata: false } + ): Promise | null>; + async findOneAndDelete( + filter: Filter, + options: FindOneAndDeleteOptions + ): Promise | null>; + async findOneAndDelete(filter: Filter): Promise | null>; + async findOneAndDelete( + filter: Filter, + options?: FindOneAndDeleteOptions + ): Promise | ModifyResult | null> { + return await executeOperation( + this.client, + new FindOneAndDeleteOperation( + this as TODO_NODE_3286, + filter, + resolveOptions(this, options) + ) as TODO_NODE_3286 + ); + } + + /** + * Find a document and replace it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + */ + async findOneAndReplace( + filter: Filter, + replacement: WithoutId, + options: FindOneAndReplaceOptions & { includeResultMetadata: true } + ): Promise>; + async findOneAndReplace( + filter: Filter, + replacement: WithoutId, + options: FindOneAndReplaceOptions & { includeResultMetadata: false } + ): Promise | null>; + async findOneAndReplace( + filter: Filter, + replacement: WithoutId, + options: FindOneAndReplaceOptions + ): Promise | null>; + async findOneAndReplace( + filter: Filter, + replacement: WithoutId + ): Promise | null>; + async findOneAndReplace( + filter: Filter, + replacement: WithoutId, + options?: FindOneAndReplaceOptions + ): Promise | ModifyResult | null> { + return await executeOperation( + this.client, + new FindOneAndReplaceOperation( + this as TODO_NODE_3286, + filter, + replacement, + resolveOptions(this, options) + ) as TODO_NODE_3286 + ); + } + + /** + * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation. + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline consisting of the following stages: + * - $addFields and its alias $set + * - $project and its alias $unset + * - $replaceRoot and its alias $replaceWith. + * See the [findAndModify command documentation](https://www.mongodb.com/docs/manual/reference/command/findAndModify) for details. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + async findOneAndUpdate( + filter: Filter, + update: UpdateFilter | Document[], + options: FindOneAndUpdateOptions & { includeResultMetadata: true } + ): Promise>; + async findOneAndUpdate( + filter: Filter, + update: UpdateFilter | Document[], + options: FindOneAndUpdateOptions & { includeResultMetadata: false } + ): Promise | null>; + async findOneAndUpdate( + filter: Filter, + update: UpdateFilter | Document[], + options: FindOneAndUpdateOptions + ): Promise | null>; + async findOneAndUpdate( + filter: Filter, + update: UpdateFilter | Document[] + ): Promise | null>; + async findOneAndUpdate( + filter: Filter, + update: UpdateFilter | Document[], + options?: FindOneAndUpdateOptions + ): Promise | ModifyResult | null> { + return await executeOperation( + this.client, + new FindOneAndUpdateOperation( + this as TODO_NODE_3286, + filter, + update, + resolveOptions(this, options) + ) as TODO_NODE_3286 + ); + } + + /** + * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2 + * + * @param pipeline - An array of aggregation pipelines to execute + * @param options - Optional settings for the command + */ + aggregate( + pipeline: Document[] = [], + options?: AggregateOptions & Abortable + ): AggregationCursor { + if (!Array.isArray(pipeline)) { + throw new MongoInvalidArgumentError( + 'Argument "pipeline" must be an array of aggregation stages' + ); + } + + return new AggregationCursor( + this.client, + this.s.namespace, + pipeline, + resolveOptions(this, options) + ); + } + + /** + * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to override the schema that may be defined for this specific collection + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * @example + * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>` + * ```ts + * collection.watch<{ _id: number }>() + * .on('change', change => console.log(change._id.toFixed(4))); + * ``` + * + * @example + * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline. + * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment. + * No need start from scratch on the ChangeStreamInsertDocument type! + * By using an intersection we can save time and ensure defaults remain the same type! + * ```ts + * collection + * .watch & { comment: string }>([ + * { $addFields: { comment: 'big changes' } }, + * { $match: { operationType: 'insert' } } + * ]) + * .on('change', change => { + * change.comment.startsWith('big'); + * change.operationType === 'insert'; + * // No need to narrow in code because the generics did that for us! + * expectType(change.fullDocument); + * }); + * ``` + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TLocal - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>( + pipeline: Document[] = [], + options: ChangeStreamOptions = {} + ): ChangeStream { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + + return new ChangeStream(this, pipeline, resolveOptions(this, options)); + } + + /** + * Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeUnorderedBulkOp(options?: BulkWriteOptions): UnorderedBulkOperation { + return new UnorderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options)); + } + + /** + * Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation { + return new OrderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options)); + } + + /** + * An estimated count of matching documents in the db to a filter. + * + * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents + * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}. + * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead + * + * @param filter - The filter for the count. + * @param options - Optional settings for the command + */ + async count(filter: Filter = {}, options: CountOptions = {}): Promise { + return await executeOperation( + this.client, + new CountOperation(this.fullNamespace, filter, resolveOptions(this, options)) + ); + } + + /** + * Returns all search indexes for the current collection. + * + * @param options - The options for the list indexes operation. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + listSearchIndexes(options?: ListSearchIndexesOptions): ListSearchIndexesCursor; + /** + * Returns all search indexes for the current collection. + * + * @param name - The name of the index to search for. Only indexes with matching index names will be returned. + * @param options - The options for the list indexes operation. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + listSearchIndexes(name: string, options?: ListSearchIndexesOptions): ListSearchIndexesCursor; + listSearchIndexes( + indexNameOrOptions?: string | ListSearchIndexesOptions, + options?: ListSearchIndexesOptions + ): ListSearchIndexesCursor { + options = + typeof indexNameOrOptions === 'object' ? indexNameOrOptions : options == null ? {} : options; + + const indexName = + indexNameOrOptions == null + ? null + : typeof indexNameOrOptions === 'object' + ? null + : indexNameOrOptions; + + return new ListSearchIndexesCursor(this as TODO_NODE_3286, indexName, options); + } + + /** + * Creates a single search index for the collection. + * + * @param description - The index description for the new search index. + * @returns A promise that resolves to the name of the new search index. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async createSearchIndex(description: SearchIndexDescription): Promise { + const [index] = await this.createSearchIndexes([description]); + return index; + } + + /** + * Creates multiple search indexes for the current collection. + * + * @param descriptions - An array of `SearchIndexDescription`s for the new search indexes. + * @returns A promise that resolves to an array of the newly created search index names. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + * @returns + */ + async createSearchIndexes(descriptions: SearchIndexDescription[]): Promise { + return await executeOperation( + this.client, + new CreateSearchIndexesOperation(this as TODO_NODE_3286, descriptions) + ); + } + + /** + * Deletes a search index by index name. + * + * @param name - The name of the search index to be deleted. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async dropSearchIndex(name: string): Promise { + return await executeOperation( + this.client, + new DropSearchIndexOperation(this as TODO_NODE_3286, name) + ); + } + + /** + * Updates a search index by replacing the existing index definition with the provided definition. + * + * @param name - The name of the search index to update. + * @param definition - The new search index definition. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async updateSearchIndex(name: string, definition: Document): Promise { + return await executeOperation( + this.client, + new UpdateSearchIndexOperation(this as TODO_NODE_3286, name, definition) + ); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/connection_string.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/connection_string.ts new file mode 100644 index 00000000..e1c74927 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/connection_string.ts @@ -0,0 +1,1319 @@ +import * as dns from 'dns'; +import ConnectionString from 'mongodb-connection-string-url'; +import * as process from 'process'; +import { URLSearchParams } from 'url'; + +import type { Document } from './bson'; +import { MongoCredentials } from './cmap/auth/mongo_credentials'; +import { AUTH_MECHS_AUTH_SRC_EXTERNAL, AuthMechanism } from './cmap/auth/providers'; +import { Compressor, type CompressorName } from './cmap/wire_protocol/compression'; +import { Encrypter } from './encrypter'; +import { MongoAPIError, MongoInvalidArgumentError, MongoParseError } from './error'; +import { + MongoClient, + type MongoClientOptions, + type MongoOptions, + type PkFactory, + type ServerApi, + ServerApiVersion +} from './mongo_client'; +import { MongoLoggableComponent, MongoLogger, SeverityLevel } from './mongo_logger'; +import { ReadConcern, type ReadConcernLevel } from './read_concern'; +import { ReadPreference, type ReadPreferenceMode } from './read_preference'; +import { resolveRuntimeAdapters } from './runtime_adapters'; +import { ServerMonitoringMode } from './sdam/monitor'; +import type { TagSet } from './sdam/server_description'; +import { + checkParentDomainMatch, + DEFAULT_PK_FACTORY, + emitWarning, + HostAddress, + isRecord, + parseInteger, + setDifference, + squashError +} from './utils'; +import { type W, WriteConcern } from './write_concern'; + +const VALID_TXT_RECORDS = ['authSource', 'replicaSet', 'loadBalanced']; + +const LB_SINGLE_HOST_ERROR = 'loadBalanced option only supported with a single host in the URI'; +const LB_REPLICA_SET_ERROR = 'loadBalanced option not supported with a replicaSet option'; +const LB_DIRECT_CONNECTION_ERROR = + 'loadBalanced option not supported when directConnection is provided'; + +function retryDNSTimeoutFor(rrtype: 'SRV'): (lookupAddress: string) => Promise; +function retryDNSTimeoutFor(rrtype: 'TXT'): (lookupAddress: string) => Promise; +function retryDNSTimeoutFor( + rrtype: 'SRV' | 'TXT' +): (lookupAddress: string) => Promise { + const resolve = + rrtype === 'SRV' + ? (address: string) => dns.promises.resolve(address, 'SRV') + : (address: string) => dns.promises.resolve(address, 'TXT'); + return async function dnsReqRetryTimeout(lookupAddress: string) { + try { + return await resolve(lookupAddress); + } catch (firstDNSError) { + if (firstDNSError.code === dns.TIMEOUT) { + return await resolve(lookupAddress); + } else { + throw firstDNSError; + } + } + }; +} + +const resolveSrv = retryDNSTimeoutFor('SRV'); +const resolveTxt = retryDNSTimeoutFor('TXT'); + +/** + * Lookup a `mongodb+srv` connection string, combine the parts and reparse it as a normal + * connection string. + * + * @param uri - The connection string to parse + * @param options - Optional user provided connection string options + */ +export async function resolveSRVRecord(options: MongoOptions): Promise { + if (typeof options.srvHost !== 'string') { + throw new MongoAPIError('Option "srvHost" must not be empty'); + } + + // Asynchronously start TXT resolution so that we do not have to wait until + // the SRV record is resolved before starting a second DNS query. + const lookupAddress = options.srvHost; + const txtResolutionPromise = resolveTxt(lookupAddress); + + txtResolutionPromise.then(undefined, squashError); // rejections will be handled later + + const hostname = `_${options.srvServiceName}._tcp.${lookupAddress}`; + // Resolve the SRV record and use the result as the list of hosts to connect to. + const addresses = await resolveSrv(hostname); + + if (addresses.length === 0) { + throw new MongoAPIError('No addresses found at host'); + } + + for (const { name } of addresses) { + checkParentDomainMatch(name, lookupAddress); + } + + const hostAddresses = addresses.map(r => HostAddress.fromString(`${r.name}:${r.port ?? 27017}`)); + + validateLoadBalancedOptions(hostAddresses, options, true); + + // Use the result of resolving the TXT record and add options from there if they exist. + let record; + try { + record = await txtResolutionPromise; + } catch (error) { + if (error.code !== 'ENODATA' && error.code !== 'ENOTFOUND') { + throw error; + } + return hostAddresses; + } + + if (record.length > 1) { + throw new MongoParseError('Multiple text records not allowed'); + } + + const txtRecordOptions = new URLSearchParams(record[0].join('')); + const txtRecordOptionKeys = [...txtRecordOptions.keys()]; + if (txtRecordOptionKeys.some(key => !VALID_TXT_RECORDS.includes(key))) { + throw new MongoParseError(`Text record may only set any of: ${VALID_TXT_RECORDS.join(', ')}`); + } + + if (VALID_TXT_RECORDS.some(option => txtRecordOptions.get(option) === '')) { + throw new MongoParseError('Cannot have empty URI params in DNS TXT Record'); + } + + const source = txtRecordOptions.get('authSource') ?? undefined; + const replicaSet = txtRecordOptions.get('replicaSet') ?? undefined; + const loadBalanced = txtRecordOptions.get('loadBalanced') ?? undefined; + + if ( + !options.userSpecifiedAuthSource && + source && + options.credentials && + !AUTH_MECHS_AUTH_SRC_EXTERNAL.has(options.credentials.mechanism) + ) { + options.credentials = MongoCredentials.merge(options.credentials, { source }); + } + + if (!options.userSpecifiedReplicaSet && replicaSet) { + options.replicaSet = replicaSet; + } + + if (loadBalanced === 'true') { + options.loadBalanced = true; + } + + if (options.replicaSet && options.srvMaxHosts > 0) { + throw new MongoParseError('Cannot combine replicaSet option with srvMaxHosts'); + } + + validateLoadBalancedOptions(hostAddresses, options, true); + + return hostAddresses; +} + +/** + * Checks if TLS options are valid + * + * @param allOptions - All options provided by user or included in default options map + * @throws MongoAPIError if TLS options are invalid + */ +function checkTLSOptions(allOptions: CaseInsensitiveMap): void { + if (!allOptions) return; + const check = (a: string, b: string) => { + if (allOptions.has(a) && allOptions.has(b)) { + throw new MongoAPIError(`The '${a}' option cannot be used with the '${b}' option`); + } + }; + check('tlsInsecure', 'tlsAllowInvalidCertificates'); + check('tlsInsecure', 'tlsAllowInvalidHostnames'); +} +function getBoolean(name: string, value: unknown): boolean { + if (typeof value === 'boolean') return value; + switch (value) { + case 'true': + return true; + case 'false': + return false; + default: + throw new MongoParseError(`${name} must be either "true" or "false"`); + } +} + +function getIntFromOptions(name: string, value: unknown): number { + const parsedInt = parseInteger(value); + if (parsedInt != null) { + return parsedInt; + } + throw new MongoParseError(`Expected ${name} to be stringified int value, got: ${value}`); +} + +function getUIntFromOptions(name: string, value: unknown): number { + const parsedValue = getIntFromOptions(name, value); + if (parsedValue < 0) { + throw new MongoParseError(`${name} can only be a positive int value, got: ${value}`); + } + return parsedValue; +} + +function* entriesFromString(value: string): Generator<[string, string]> { + if (value === '') { + return; + } + const keyValuePairs = value.split(','); + for (const keyValue of keyValuePairs) { + const [key, value] = keyValue.split(/:(.*)/); + if (value == null) { + throw new MongoParseError('Cannot have undefined values in key value pairs'); + } + + yield [key, value]; + } +} + +class CaseInsensitiveMap extends Map { + constructor(entries: Array<[string, any]> = []) { + super(entries.map(([k, v]) => [k.toLowerCase(), v])); + } + override has(k: string) { + return super.has(k.toLowerCase()); + } + override get(k: string) { + return super.get(k.toLowerCase()); + } + override set(k: string, v: any) { + return super.set(k.toLowerCase(), v); + } + override delete(k: string): boolean { + return super.delete(k.toLowerCase()); + } +} + +export function parseOptions( + uri: string, + mongoClient: MongoClient | MongoClientOptions | undefined = undefined, + options: MongoClientOptions = {} +): MongoOptions { + if (mongoClient != null && !(mongoClient instanceof MongoClient)) { + options = mongoClient; + mongoClient = undefined; + } + + // validate BSONOptions + if (options.useBigInt64 && typeof options.promoteLongs === 'boolean' && !options.promoteLongs) { + throw new MongoAPIError('Must request either bigint or Long for int64 deserialization'); + } + + if (options.useBigInt64 && typeof options.promoteValues === 'boolean' && !options.promoteValues) { + throw new MongoAPIError('Must request either bigint or Long for int64 deserialization'); + } + + const url = new ConnectionString(uri); + const { hosts, isSRV } = url; + + const mongoOptions = Object.create(null); + + mongoOptions.hosts = isSRV ? [] : hosts.map(HostAddress.fromString); + + const urlOptions = new CaseInsensitiveMap(); + + if (url.pathname !== '/' && url.pathname !== '') { + const dbName = decodeURIComponent( + url.pathname[0] === '/' ? url.pathname.slice(1) : url.pathname + ); + if (dbName) { + urlOptions.set('dbName', [dbName]); + } + } + + if (url.username !== '') { + const auth: Document = { + username: decodeURIComponent(url.username) + }; + + if (typeof url.password === 'string') { + auth.password = decodeURIComponent(url.password); + } + + urlOptions.set('auth', [auth]); + } + + for (const key of url.searchParams.keys()) { + const values = url.searchParams.getAll(key); + + const isReadPreferenceTags = /readPreferenceTags/i.test(key); + + if (!isReadPreferenceTags && values.length > 1) { + throw new MongoInvalidArgumentError( + `URI option "${key}" cannot appear more than once in the connection string` + ); + } + + if (!isReadPreferenceTags && values.includes('')) { + throw new MongoAPIError(`URI option "${key}" cannot be specified with no value`); + } + + if (!urlOptions.has(key)) { + urlOptions.set(key, values); + } + } + + const objectOptions = new CaseInsensitiveMap( + Object.entries(options).filter(([, v]) => v != null) + ); + + // Validate options that can only be provided by one of uri or object + + if (urlOptions.has('serverApi')) { + throw new MongoParseError( + 'URI cannot contain `serverApi`, it can only be passed to the client' + ); + } + + const uriMechanismProperties = urlOptions.get('authMechanismProperties'); + if (uriMechanismProperties) { + for (const property of uriMechanismProperties) { + if (/(^|,)ALLOWED_HOSTS:/.test(property as string)) { + throw new MongoParseError( + 'Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string.' + ); + } + } + } + + if (objectOptions.has('loadBalanced')) { + throw new MongoParseError('loadBalanced is only a valid option in the URI'); + } + + // All option collection + + const allProvidedOptions = new CaseInsensitiveMap(); + + const allProvidedKeys = new Set([...urlOptions.keys(), ...objectOptions.keys()]); + + for (const key of allProvidedKeys) { + const values = []; + const objectOptionValue = objectOptions.get(key); + if (objectOptionValue != null) { + values.push(objectOptionValue); + } + + const urlValues = urlOptions.get(key) ?? []; + values.push(...urlValues); + allProvidedOptions.set(key, values); + } + + if (allProvidedOptions.has('tls') || allProvidedOptions.has('ssl')) { + const tlsAndSslOpts = (allProvidedOptions.get('tls') || []) + .concat(allProvidedOptions.get('ssl') || []) + .map(getBoolean.bind(null, 'tls/ssl')); + if (new Set(tlsAndSslOpts).size !== 1) { + throw new MongoParseError('All values of tls/ssl must be the same.'); + } + } + + checkTLSOptions(allProvidedOptions); + + const unsupportedOptions = setDifference( + allProvidedKeys, + Array.from(Object.keys(OPTIONS)).map(s => s.toLowerCase()) + ); + if (unsupportedOptions.size !== 0) { + const optionWord = unsupportedOptions.size > 1 ? 'options' : 'option'; + const isOrAre = unsupportedOptions.size > 1 ? 'are' : 'is'; + throw new MongoParseError( + `${optionWord} ${Array.from(unsupportedOptions).join(', ')} ${isOrAre} not supported` + ); + } + + // Option parsing and setting + + for (const [key, descriptor] of Object.entries(OPTIONS)) { + const values = allProvidedOptions.get(key); + if (!values || values.length === 0) { + if (DEFAULT_OPTIONS.has(key)) { + setOption(mongoOptions, key, descriptor, [DEFAULT_OPTIONS.get(key)]); + } + } else { + const { deprecated } = descriptor; + if (deprecated) { + const deprecatedMsg = typeof deprecated === 'string' ? `: ${deprecated}` : ''; + emitWarning(`${key} is a deprecated option${deprecatedMsg}`); + } + + setOption(mongoOptions, key, descriptor, values); + } + } + + if (mongoOptions.credentials) { + const isGssapi = mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_GSSAPI; + const isX509 = mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_X509; + const isAws = mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_AWS; + const isOidc = mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_OIDC; + if ( + (isGssapi || isX509) && + allProvidedOptions.has('authSource') && + mongoOptions.credentials.source !== '$external' + ) { + // If authSource was explicitly given and its incorrect, we error + throw new MongoParseError( + `authMechanism ${mongoOptions.credentials.mechanism} requires an authSource of '$external'` + ); + } + + if ( + !(isGssapi || isX509 || isAws || isOidc) && + mongoOptions.dbName && + !allProvidedOptions.has('authSource') + ) { + // inherit the dbName unless GSSAPI or X509, then silently ignore dbName + // and there was no specific authSource given + mongoOptions.credentials = MongoCredentials.merge(mongoOptions.credentials, { + source: mongoOptions.dbName + }); + } + + if (isAws) { + const { username, password } = mongoOptions.credentials; + if (username || password) { + throw new MongoAPIError( + 'username and password cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.' + ); + } + if (mongoOptions.credentials.mechanismProperties.AWS_SESSION_TOKEN) { + throw new MongoAPIError( + 'AWS_SESSION_TOKEN cannot be provided when using MONGODB-AWS. Credentials must be provided in a manner that can be read by the AWS SDK.' + ); + } + } + + mongoOptions.credentials.validate(); + + // Check if the only auth related option provided was authSource, if so we can remove credentials + if ( + mongoOptions.credentials.password === '' && + mongoOptions.credentials.username === '' && + mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_DEFAULT && + Object.keys(mongoOptions.credentials.mechanismProperties).length === 0 + ) { + delete mongoOptions.credentials; + } + } + + if (!mongoOptions.dbName) { + // dbName default is applied here because of the credential validation above + mongoOptions.dbName = 'test'; + } + + validateLoadBalancedOptions(hosts, mongoOptions, isSRV); + + if (mongoClient && mongoOptions.autoEncryption) { + Encrypter.checkForMongoCrypt(); + mongoOptions.encrypter = new Encrypter(mongoClient, uri, options); + mongoOptions.autoEncrypter = mongoOptions.encrypter.autoEncrypter; + } + + // Potential SRV Overrides and SRV connection string validations + + mongoOptions.userSpecifiedAuthSource = + objectOptions.has('authSource') || urlOptions.has('authSource'); + mongoOptions.userSpecifiedReplicaSet = + objectOptions.has('replicaSet') || urlOptions.has('replicaSet'); + + if (isSRV) { + // SRV Record is resolved upon connecting + mongoOptions.srvHost = hosts[0]; + + if (mongoOptions.directConnection) { + throw new MongoAPIError('SRV URI does not support directConnection'); + } + + if (mongoOptions.srvMaxHosts > 0 && typeof mongoOptions.replicaSet === 'string') { + throw new MongoParseError('Cannot use srvMaxHosts option with replicaSet'); + } + + // SRV turns on TLS by default, but users can override and turn it off + const noUserSpecifiedTLS = !objectOptions.has('tls') && !urlOptions.has('tls'); + const noUserSpecifiedSSL = !objectOptions.has('ssl') && !urlOptions.has('ssl'); + if (noUserSpecifiedTLS && noUserSpecifiedSSL) { + mongoOptions.tls = true; + } + } else { + const userSpecifiedSrvOptions = + urlOptions.has('srvMaxHosts') || + objectOptions.has('srvMaxHosts') || + urlOptions.has('srvServiceName') || + objectOptions.has('srvServiceName'); + + if (userSpecifiedSrvOptions) { + throw new MongoParseError( + 'Cannot use srvMaxHosts or srvServiceName with a non-srv connection string' + ); + } + } + + if (mongoOptions.directConnection && mongoOptions.hosts.length !== 1) { + throw new MongoParseError('directConnection option requires exactly one host'); + } + + if ( + !mongoOptions.proxyHost && + (mongoOptions.proxyPort || mongoOptions.proxyUsername || mongoOptions.proxyPassword) + ) { + throw new MongoParseError('Must specify proxyHost if other proxy options are passed'); + } + + if ( + (mongoOptions.proxyUsername && !mongoOptions.proxyPassword) || + (!mongoOptions.proxyUsername && mongoOptions.proxyPassword) + ) { + throw new MongoParseError('Can only specify both of proxy username/password or neither'); + } + + const proxyOptions = ['proxyHost', 'proxyPort', 'proxyUsername', 'proxyPassword'].map( + key => urlOptions.get(key) ?? [] + ); + + if (proxyOptions.some(options => options.length > 1)) { + throw new MongoParseError( + 'Proxy options cannot be specified multiple times in the connection string' + ); + } + + mongoOptions.mongoLoggerOptions = MongoLogger.resolveOptions( + { + MONGODB_LOG_COMMAND: process.env.MONGODB_LOG_COMMAND, + MONGODB_LOG_TOPOLOGY: process.env.MONGODB_LOG_TOPOLOGY, + MONGODB_LOG_SERVER_SELECTION: process.env.MONGODB_LOG_SERVER_SELECTION, + MONGODB_LOG_CONNECTION: process.env.MONGODB_LOG_CONNECTION, + MONGODB_LOG_CLIENT: process.env.MONGODB_LOG_CLIENT, + MONGODB_LOG_ALL: process.env.MONGODB_LOG_ALL, + MONGODB_LOG_MAX_DOCUMENT_LENGTH: process.env.MONGODB_LOG_MAX_DOCUMENT_LENGTH, + MONGODB_LOG_PATH: process.env.MONGODB_LOG_PATH + }, + { + mongodbLogPath: mongoOptions.mongodbLogPath, + mongodbLogComponentSeverities: mongoOptions.mongodbLogComponentSeverities, + mongodbLogMaxDocumentLength: mongoOptions.mongodbLogMaxDocumentLength + } + ); + + mongoOptions.runtime = resolveRuntimeAdapters(options); + // Mark the promise as handled so a rejection before any consumer awaits it (possible only in + // runtimes where the dynamic import of the default os adapter fails) cannot crash the process + // as an unhandled rejection; consumers awaiting `runtime` still observe the rejection. + mongoOptions.runtime.then(undefined, squashError); + + return mongoOptions; +} + +/** + * #### Throws if LB mode is true: + * - hosts contains more than one host + * - there is a replicaSet name set + * - directConnection is set + * - if srvMaxHosts is used when an srv connection string is passed in + * + * @throws MongoParseError + */ +function validateLoadBalancedOptions( + hosts: HostAddress[] | string[], + mongoOptions: MongoOptions, + isSrv: boolean +): void { + if (mongoOptions.loadBalanced) { + if (hosts.length > 1) { + throw new MongoParseError(LB_SINGLE_HOST_ERROR); + } + if (mongoOptions.replicaSet) { + throw new MongoParseError(LB_REPLICA_SET_ERROR); + } + if (mongoOptions.directConnection) { + throw new MongoParseError(LB_DIRECT_CONNECTION_ERROR); + } + + if (isSrv && mongoOptions.srvMaxHosts > 0) { + throw new MongoParseError('Cannot limit srv hosts with loadBalanced enabled'); + } + } + return; +} + +function setOption( + mongoOptions: any, + key: string, + descriptor: OptionDescriptor, + values: unknown[] +) { + const { target, type, transform } = descriptor; + const name = target ?? key; + + switch (type) { + case 'boolean': + mongoOptions[name] = getBoolean(name, values[0]); + break; + case 'int': + mongoOptions[name] = getIntFromOptions(name, values[0]); + break; + case 'uint': + mongoOptions[name] = getUIntFromOptions(name, values[0]); + break; + case 'string': + if (values[0] == null) { + break; + } + // The value should always be a string here, but since the array is typed as unknown + // there still needs to be an explicit cast. + // eslint-disable-next-line @typescript-eslint/no-base-to-string + mongoOptions[name] = String(values[0]); + break; + case 'record': + if (!isRecord(values[0])) { + throw new MongoParseError(`${name} must be an object`); + } + mongoOptions[name] = values[0]; + break; + case 'any': + mongoOptions[name] = values[0]; + break; + default: { + if (!transform) { + throw new MongoParseError('Descriptors missing a type must define a transform'); + } + const transformValue = transform({ name, options: mongoOptions, values }); + mongoOptions[name] = transformValue; + break; + } + } +} + +interface OptionDescriptor { + target?: string; + type?: 'boolean' | 'int' | 'uint' | 'record' | 'string' | 'any'; + default?: any; + + deprecated?: boolean | string; + /** + * @param name - the original option name + * @param options - the options so far for resolution + * @param values - the possible values in precedence order + */ + transform?: (args: { name: string; options: MongoOptions; values: unknown[] }) => unknown; +} + +export const OPTIONS = { + enableOverloadRetargeting: { + default: false, + type: 'boolean' + }, + appName: { + type: 'string' + }, + auth: { + target: 'credentials', + transform({ name, options, values: [value] }): MongoCredentials { + if (!isRecord(value, ['username', 'password'] as const)) { + throw new MongoParseError( + `${name} must be an object with 'username' and 'password' properties` + ); + } + return MongoCredentials.merge(options.credentials, { + username: value.username, + password: value.password + }); + } + }, + authMechanism: { + target: 'credentials', + transform({ options, values: [value] }): MongoCredentials { + const mechanisms = Object.values(AuthMechanism); + const [mechanism] = mechanisms.filter(m => m.match(RegExp(String.raw`\b${value}\b`, 'i'))); + if (!mechanism) { + throw new MongoParseError(`authMechanism one of ${mechanisms}, got ${value}`); + } + let source = options.credentials?.source; + if ( + mechanism === AuthMechanism.MONGODB_PLAIN || + AUTH_MECHS_AUTH_SRC_EXTERNAL.has(mechanism) + ) { + // some mechanisms have '$external' as the Auth Source + source = '$external'; + } + + let password = options.credentials?.password; + if (mechanism === AuthMechanism.MONGODB_X509 && password === '') { + password = undefined; + } + return MongoCredentials.merge(options.credentials, { + mechanism, + source, + password + }); + } + }, + // Note that if the authMechanismProperties contain a TOKEN_RESOURCE that has a + // comma in it, it MUST be supplied as a MongoClient option instead of in the + // connection string. + authMechanismProperties: { + target: 'credentials', + transform({ options, values }): MongoCredentials { + // We can have a combination of options passed in the URI and options passed + // as an object to the MongoClient. So we must transform the string options + // as well as merge them together with a potentially provided object. + let mechanismProperties = Object.create(null); + + for (const optionValue of values) { + if (typeof optionValue === 'string') { + for (const [key, value] of entriesFromString(optionValue)) { + try { + mechanismProperties[key] = getBoolean(key, value); + } catch { + mechanismProperties[key] = value; + } + } + } else { + if (!isRecord(optionValue)) { + throw new MongoParseError('AuthMechanismProperties must be an object'); + } + mechanismProperties = { ...optionValue }; + } + } + return MongoCredentials.merge(options.credentials, { + mechanismProperties + }); + } + }, + authSource: { + target: 'credentials', + transform({ options, values: [value] }): MongoCredentials { + const source = String(value); + return MongoCredentials.merge(options.credentials, { source }); + } + }, + autoEncryption: { + type: 'record' + }, + autoSelectFamily: { + type: 'boolean', + default: true + }, + autoSelectFamilyAttemptTimeout: { + type: 'uint' + }, + bsonRegExp: { + type: 'boolean' + }, + serverApi: { + target: 'serverApi', + transform({ values: [version] }): ServerApi { + const serverApiToValidate = + typeof version === 'string' ? ({ version } as ServerApi) : (version as ServerApi); + const versionToValidate = serverApiToValidate && serverApiToValidate.version; + if (!versionToValidate) { + throw new MongoParseError( + `Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values( + ServerApiVersion + ).join('", "')}"]` + ); + } + if (!Object.values(ServerApiVersion).some(v => v === versionToValidate)) { + throw new MongoParseError( + `Invalid server API version=${versionToValidate}; must be in the following enum: ["${Object.values( + ServerApiVersion + ).join('", "')}"]` + ); + } + return serverApiToValidate; + } + }, + checkKeys: { + type: 'boolean' + }, + compressors: { + default: 'none', + target: 'compressors', + transform({ values }) { + const compressionList = new Set(); + for (const compVal of values as (CompressorName[] | string)[]) { + const compValArray = typeof compVal === 'string' ? compVal.split(',') : compVal; + if (!Array.isArray(compValArray)) { + throw new MongoInvalidArgumentError( + 'compressors must be an array or a comma-delimited list of strings' + ); + } + for (const c of compValArray) { + if (Object.keys(Compressor).includes(String(c))) { + compressionList.add(String(c)); + } else { + throw new MongoInvalidArgumentError( + `${c} is not a valid compression mechanism. Must be one of: ${Object.keys( + Compressor + )}.` + ); + } + } + } + return [...compressionList]; + } + }, + connectTimeoutMS: { + default: 30000, + type: 'uint' + }, + dbName: { + type: 'string' + }, + directConnection: { + default: false, + type: 'boolean' + }, + driverInfo: { + default: {}, + type: 'record' + }, + enableUtf8Validation: { type: 'boolean', default: true }, + family: { + transform({ name, values: [value] }): 4 | 6 { + const transformValue = getIntFromOptions(name, value); + if (transformValue === 4 || transformValue === 6) { + return transformValue; + } + throw new MongoParseError(`Option 'family' must be 4 or 6 got ${transformValue}.`); + } + }, + fieldsAsRaw: { + type: 'record' + }, + forceServerObjectId: { + default: false, + type: 'boolean' + }, + fsync: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }): WriteConcern { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + fsync: getBoolean(name, value) + } + }); + if (!wc) throw new MongoParseError(`Unable to make a writeConcern from fsync=${value}`); + return wc; + } + } as OptionDescriptor, + heartbeatFrequencyMS: { + default: 10000, + type: 'uint' + }, + ignoreUndefined: { + type: 'boolean' + }, + j: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }): WriteConcern { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + } as OptionDescriptor, + journal: { + target: 'writeConcern', + transform({ name, options, values: [value] }): WriteConcern { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + loadBalanced: { + default: false, + type: 'boolean' + }, + localThresholdMS: { + default: 15, + type: 'uint' + }, + maxAdaptiveRetries: { + default: 2, + type: 'uint' + }, + maxConnecting: { + default: 2, + transform({ name, values: [value] }): number { + const maxConnecting = getUIntFromOptions(name, value); + if (maxConnecting === 0) { + throw new MongoInvalidArgumentError('maxConnecting must be > 0 if specified'); + } + return maxConnecting; + } + }, + maxIdleTimeMS: { + default: 0, + type: 'uint' + }, + maxPoolSize: { + default: 100, + type: 'uint' + }, + maxStalenessSeconds: { + target: 'readPreference', + transform({ name, options, values: [value] }) { + const maxStalenessSeconds = getUIntFromOptions(name, value); + if (options.readPreference) { + return ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, maxStalenessSeconds } + }); + } else { + return new ReadPreference('secondary', undefined, { maxStalenessSeconds }); + } + } + }, + minInternalBufferSize: { + type: 'uint' + }, + minPoolSize: { + default: 0, + type: 'uint' + }, + minHeartbeatFrequencyMS: { + default: 500, + type: 'uint' + }, + monitorCommands: { + default: false, + type: 'boolean' + }, + name: { + target: 'driverInfo', + transform({ values: [value], options }) { + return { ...options.driverInfo, name: String(value) }; + } + } as OptionDescriptor, + noDelay: { + default: true, + type: 'boolean' + }, + pkFactory: { + default: DEFAULT_PK_FACTORY, + transform({ values: [value] }): PkFactory { + if (isRecord(value, ['createPk'] as const) && typeof value.createPk === 'function') { + return value as PkFactory; + } + throw new MongoParseError( + `Option pkFactory must be an object with a createPk function, got ${value}` + ); + } + }, + promoteBuffers: { + type: 'boolean' + }, + promoteLongs: { + type: 'boolean' + }, + promoteValues: { + type: 'boolean' + }, + useBigInt64: { + type: 'boolean' + }, + proxyHost: { + type: 'string' + }, + proxyPassword: { + type: 'string' + }, + proxyPort: { + type: 'uint' + }, + proxyUsername: { + type: 'string' + }, + raw: { + default: false, + type: 'boolean' + }, + readConcern: { + transform({ values: [value], options }) { + if (value instanceof ReadConcern || isRecord(value, ['level'] as const)) { + return ReadConcern.fromOptions({ ...options.readConcern, ...value }); + } + throw new MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(value)}`); + } + }, + readConcernLevel: { + target: 'readConcern', + transform({ values: [level], options }) { + return ReadConcern.fromOptions({ + ...options.readConcern, + level: level as ReadConcernLevel + }); + } + }, + readPreference: { + default: ReadPreference.primary, + transform({ values: [value], options }) { + if (value instanceof ReadPreference) { + return ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + } + if (isRecord(value, ['mode'] as const)) { + const rp = ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + if (rp) return rp; + else throw new MongoParseError(`Cannot make read preference from ${JSON.stringify(value)}`); + } + if (typeof value === 'string') { + const rpOpts = { + hedge: options.readPreference?.hedge, + maxStalenessSeconds: options.readPreference?.maxStalenessSeconds + }; + return new ReadPreference( + value as ReadPreferenceMode, + options.readPreference?.tags, + rpOpts + ); + } + throw new MongoParseError(`Unknown ReadPreference value: ${value}`); + } + }, + readPreferenceTags: { + target: 'readPreference', + transform({ + values, + options + }: { + values: Array[]>; + options: MongoClientOptions; + }) { + const tags: Array> = Array.isArray(values[0]) + ? values[0] + : (values as Array); + const readPreferenceTags = []; + for (const tag of tags) { + const readPreferenceTag: TagSet = Object.create(null); + if (typeof tag === 'string') { + for (const [k, v] of entriesFromString(tag)) { + readPreferenceTag[k] = v; + } + } + if (isRecord(tag)) { + for (const [k, v] of Object.entries(tag)) { + readPreferenceTag[k] = v; + } + } + readPreferenceTags.push(readPreferenceTag); + } + return ReadPreference.fromOptions({ + readPreference: options.readPreference, + readPreferenceTags + }); + } + }, + replicaSet: { + type: 'string' + }, + retryReads: { + default: true, + type: 'boolean' + }, + retryWrites: { + default: true, + type: 'boolean' + }, + runtimeAdapters: { + type: 'record' + }, + serializeFunctions: { + type: 'boolean' + }, + serverMonitoringMode: { + default: 'auto', + transform({ values: [value] }) { + if (!Object.values(ServerMonitoringMode).includes(value as any)) { + throw new MongoParseError( + 'serverMonitoringMode must be one of `auto`, `poll`, or `stream`' + ); + } + return value; + } + }, + serverSelectionTimeoutMS: { + default: 30000, + type: 'uint' + }, + servername: { + type: 'string' + }, + socketTimeoutMS: { + // TODO(NODE-6491): deprecated: 'Please use timeoutMS instead', + default: 0, + type: 'uint' + }, + srvMaxHosts: { + type: 'uint', + default: 0 + }, + srvServiceName: { + type: 'string', + default: 'mongodb' + }, + ssl: { + target: 'tls', + type: 'boolean' + }, + timeoutMS: { + type: 'uint' + }, + tls: { + type: 'boolean' + }, + tlsAllowInvalidCertificates: { + target: 'rejectUnauthorized', + transform({ name, values: [value] }) { + // allowInvalidCertificates is the inverse of rejectUnauthorized + return !getBoolean(name, value); + } + }, + tlsAllowInvalidHostnames: { + target: 'checkServerIdentity', + transform({ name, values: [value] }) { + // tlsAllowInvalidHostnames means setting the checkServerIdentity function to a noop + return getBoolean(name, value) ? () => undefined : undefined; + } + }, + tlsCAFile: { + type: 'string' + }, + tlsCRLFile: { + type: 'string' + }, + tlsCertificateKeyFile: { + type: 'string' + }, + tlsCertificateKeyFilePassword: { + target: 'passphrase', + type: 'any' + }, + tlsInsecure: { + transform({ name, options, values: [value] }) { + const tlsInsecure = getBoolean(name, value); + if (tlsInsecure) { + options.checkServerIdentity = () => undefined; + options.rejectUnauthorized = false; + } else { + options.checkServerIdentity = options.tlsAllowInvalidHostnames + ? () => undefined + : undefined; + options.rejectUnauthorized = options.tlsAllowInvalidCertificates ? false : true; + } + return tlsInsecure; + } + }, + w: { + target: 'writeConcern', + transform({ values: [value], options }) { + return WriteConcern.fromOptions({ writeConcern: { ...options.writeConcern, w: value as W } }); + } + }, + waitQueueTimeoutMS: { + // TODO(NODE-6491): deprecated: 'Please use timeoutMS instead', + default: 0, + type: 'uint' + }, + writeConcern: { + target: 'writeConcern', + transform({ values: [value], options }) { + if (isRecord(value) || value instanceof WriteConcern) { + return WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + ...value + } + }); + } else if (value === 'majority' || typeof value === 'number') { + return WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + w: value + } + }); + } + + throw new MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(value)}`); + } + }, + wtimeout: { + deprecated: 'Please use wtimeoutMS instead', + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeout: getUIntFromOptions('wtimeout', value) + } + }); + if (wc) return wc; + throw new MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + } as OptionDescriptor, + wtimeoutMS: { + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeoutMS: getUIntFromOptions('wtimeoutMS', value) + } + }); + if (wc) return wc; + throw new MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + zlibCompressionLevel: { + default: 0, + type: 'int' + }, + mongodbLogPath: { + transform({ values: [value] }) { + if ( + !( + (typeof value === 'string' && ['stderr', 'stdout'].includes(value)) || + (value && + typeof value === 'object' && + 'write' in value && + typeof value.write === 'function') + ) + ) { + throw new MongoAPIError( + `Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable` + ); + } + return value; + } + }, + mongodbLogComponentSeverities: { + transform({ values: [value] }) { + if (typeof value !== 'object' || !value) { + throw new MongoAPIError(`Option 'mongodbLogComponentSeverities' must be a non-null object`); + } + for (const [k, v] of Object.entries(value)) { + if (typeof v !== 'string' || typeof k !== 'string') { + throw new MongoAPIError( + `User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value` + ); + } + if (!Object.values(MongoLoggableComponent).some(val => val === k) && k !== 'default') { + throw new MongoAPIError( + `User input for option 'mongodbLogComponentSeverities' contains invalid key: ${k}` + ); + } + if (!Object.values(SeverityLevel).some(val => val === v)) { + throw new MongoAPIError( + `Option 'mongodbLogComponentSeverities' does not support ${v} as a value for ${k}` + ); + } + } + return value; + } + }, + mongodbLogMaxDocumentLength: { type: 'uint' }, + // Custom types for modifying core behavior + connectionType: { type: 'any' }, + srvPoller: { type: 'any' }, + // Accepted Node.js Options + allowPartialTrustChain: { type: 'any' }, + minDHSize: { type: 'any' }, + pskCallback: { type: 'any' }, + secureContext: { type: 'any' }, + enableTrace: { type: 'any' }, + requestCert: { type: 'any' }, + rejectUnauthorized: { type: 'any' }, + checkServerIdentity: { type: 'any' }, + keepAliveInitialDelay: { type: 'any' }, + ALPNProtocols: { type: 'any' }, + SNICallback: { type: 'any' }, + session: { type: 'any' }, + requestOCSP: { type: 'any' }, + localAddress: { type: 'any' }, + localPort: { type: 'any' }, + hints: { type: 'any' }, + lookup: { type: 'any' }, + ca: { type: 'any' }, + cert: { type: 'any' }, + ciphers: { type: 'any' }, + crl: { type: 'any' }, + ecdhCurve: { type: 'any' }, + key: { type: 'any' }, + passphrase: { type: 'any' }, + pfx: { type: 'any' }, + secureProtocol: { type: 'any' }, + index: { type: 'any' }, + // Legacy options from v3 era + __skipPingOnConnect: { type: 'boolean' } +} as Record; + +export const DEFAULT_OPTIONS = new CaseInsensitiveMap( + Object.entries(OPTIONS) + .filter(([, descriptor]) => descriptor.default != null) + .map(([k, d]) => [k, d.default]) +); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/constants.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/constants.ts new file mode 100644 index 00000000..abb69509 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/constants.ts @@ -0,0 +1,176 @@ +export const SYSTEM_NAMESPACE_COLLECTION = 'system.namespaces'; +export const SYSTEM_INDEX_COLLECTION = 'system.indexes'; +export const SYSTEM_PROFILE_COLLECTION = 'system.profile'; +export const SYSTEM_USER_COLLECTION = 'system.users'; +export const SYSTEM_COMMAND_COLLECTION = '$cmd'; +export const SYSTEM_JS_COLLECTION = 'system.js'; + +// events +export const ERROR = 'error' as const; +export const TIMEOUT = 'timeout' as const; +export const CLOSE = 'close' as const; +export const OPEN = 'open' as const; +export const CONNECT = 'connect' as const; +export const CLOSED = 'closed' as const; +export const ENDED = 'ended' as const; +export const MESSAGE = 'message' as const; +export const PINNED = 'pinned' as const; +export const UNPINNED = 'unpinned' as const; +export const DESCRIPTION_RECEIVED = 'descriptionReceived'; +/** @internal */ +export const SERVER_OPENING = 'serverOpening' as const; +/** @internal */ +export const SERVER_CLOSED = 'serverClosed' as const; +/** @internal */ +export const SERVER_DESCRIPTION_CHANGED = 'serverDescriptionChanged' as const; +/** @internal */ +export const TOPOLOGY_OPENING = 'topologyOpening' as const; +/** @internal */ +export const TOPOLOGY_CLOSED = 'topologyClosed' as const; +/** @internal */ +export const TOPOLOGY_DESCRIPTION_CHANGED = 'topologyDescriptionChanged' as const; +/** @internal */ +export const SERVER_SELECTION_STARTED = 'serverSelectionStarted' as const; +/** @internal */ +export const SERVER_SELECTION_FAILED = 'serverSelectionFailed' as const; +/** @internal */ +export const SERVER_SELECTION_SUCCEEDED = 'serverSelectionSucceeded' as const; +/** @internal */ +export const WAITING_FOR_SUITABLE_SERVER = 'waitingForSuitableServer' as const; +/** @internal */ +export const CONNECTION_POOL_CREATED = 'connectionPoolCreated' as const; +/** @internal */ +export const CONNECTION_POOL_CLOSED = 'connectionPoolClosed' as const; +/** @internal */ +export const CONNECTION_POOL_CLEARED = 'connectionPoolCleared' as const; +/** @internal */ +export const CONNECTION_POOL_READY = 'connectionPoolReady' as const; +/** @internal */ +export const CONNECTION_CREATED = 'connectionCreated' as const; +/** @internal */ +export const CONNECTION_READY = 'connectionReady' as const; +/** @internal */ +export const CONNECTION_CLOSED = 'connectionClosed' as const; +/** @internal */ +export const CONNECTION_CHECK_OUT_STARTED = 'connectionCheckOutStarted' as const; +/** @internal */ +export const CONNECTION_CHECK_OUT_FAILED = 'connectionCheckOutFailed' as const; +/** @internal */ +export const CONNECTION_CHECKED_OUT = 'connectionCheckedOut' as const; +/** @internal */ +export const CONNECTION_CHECKED_IN = 'connectionCheckedIn' as const; +export const CLUSTER_TIME_RECEIVED = 'clusterTimeReceived' as const; +/** @internal */ +export const COMMAND_STARTED = 'commandStarted' as const; +/** @internal */ +export const COMMAND_SUCCEEDED = 'commandSucceeded' as const; +/** @internal */ +export const COMMAND_FAILED = 'commandFailed' as const; +/** @internal */ +export const SERVER_HEARTBEAT_STARTED = 'serverHeartbeatStarted' as const; +/** @internal */ +export const SERVER_HEARTBEAT_SUCCEEDED = 'serverHeartbeatSucceeded' as const; +/** @internal */ +export const SERVER_HEARTBEAT_FAILED = 'serverHeartbeatFailed' as const; +export const RESPONSE = 'response' as const; +export const MORE = 'more' as const; +export const INIT = 'init' as const; +export const CHANGE = 'change' as const; +export const END = 'end' as const; +export const RESUME_TOKEN_CHANGED = 'resumeTokenChanged' as const; + +/** @public */ +export const HEARTBEAT_EVENTS = Object.freeze([ + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED, + SERVER_HEARTBEAT_FAILED +] as const); + +/** @public */ +export const CMAP_EVENTS = Object.freeze([ + CONNECTION_POOL_CREATED, + CONNECTION_POOL_READY, + CONNECTION_POOL_CLEARED, + CONNECTION_POOL_CLOSED, + CONNECTION_CREATED, + CONNECTION_READY, + CONNECTION_CLOSED, + CONNECTION_CHECK_OUT_STARTED, + CONNECTION_CHECK_OUT_FAILED, + CONNECTION_CHECKED_OUT, + CONNECTION_CHECKED_IN +] as const); + +/** @public */ +export const TOPOLOGY_EVENTS = Object.freeze([ + SERVER_OPENING, + SERVER_CLOSED, + SERVER_DESCRIPTION_CHANGED, + TOPOLOGY_OPENING, + TOPOLOGY_CLOSED, + TOPOLOGY_DESCRIPTION_CHANGED, + ERROR, + TIMEOUT, + CLOSE +] as const); + +/** @public */ +export const APM_EVENTS = Object.freeze([ + COMMAND_STARTED, + COMMAND_SUCCEEDED, + COMMAND_FAILED +] as const); + +/** + * All events that we relay to the `Topology` + * @internal + */ +export const SERVER_RELAY_EVENTS = Object.freeze([ + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED, + SERVER_HEARTBEAT_FAILED, + COMMAND_STARTED, + COMMAND_SUCCEEDED, + COMMAND_FAILED, + ...CMAP_EVENTS +] as const); + +/** + * All events we listen to from `Server` instances, but do not forward to the client + * @internal + */ +export const LOCAL_SERVER_EVENTS = Object.freeze([ + CONNECT, + DESCRIPTION_RECEIVED, + CLOSED, + ENDED +] as const); + +/** @public */ +export const MONGO_CLIENT_EVENTS = Object.freeze([ + ...CMAP_EVENTS, + ...APM_EVENTS, + ...TOPOLOGY_EVENTS, + ...HEARTBEAT_EVENTS +] as const); + +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +export const LEGACY_HELLO_COMMAND = 'ismaster'; + +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +export const LEGACY_HELLO_COMMAND_CAMEL_CASE = 'isMaster'; + +// Typescript errors if we index objects with `Symbol.for(...)`, so +// to avoid TS errors we pull them out into variables. Then we can type +// the objects (and class) that we expect to see them on and prevent TS +// errors. +/** @internal */ +export const kDecorateResult = Symbol.for('@@mdb.decorateDecryptionResult'); +/** @internal */ +export const kDecoratedKeys = Symbol.for('@@mdb.decryptedKeys'); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/abstract_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/abstract_cursor.ts new file mode 100644 index 00000000..f5f0b14d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/abstract_cursor.ts @@ -0,0 +1,1241 @@ +import { Readable } from 'stream'; + +import { type BSONSerializeOptions, type Document, Long, pluckBSONSerializeOptions } from '../bson'; +import { type OnDemandDocumentDeserializeOptions } from '../cmap/wire_protocol/on_demand/document'; +import { type CursorResponse } from '../cmap/wire_protocol/responses'; +import { + MongoAPIError, + MongoCursorExhaustedError, + MongoCursorInUseError, + MongoInvalidArgumentError, + MongoRuntimeError, + MongoTailableCursorError +} from '../error'; +import type { MongoClient } from '../mongo_client'; +import { type Abortable, TypedEventEmitter } from '../mongo_types'; +import { executeOperation } from '../operations/execute_operation'; +import { GetMoreOperation } from '../operations/get_more'; +import { KillCursorsOperation } from '../operations/kill_cursors'; +import { ReadConcern, type ReadConcernLike } from '../read_concern'; +import { ReadPreference, type ReadPreferenceLike } from '../read_preference'; +import type { Server } from '../sdam/server'; +import { type ClientSession, maybeClearPinnedConnection } from '../sessions'; +import { type CSOTTimeoutContext, type Timeout, TimeoutContext } from '../timeout'; +import { + addAbortListener, + type Disposable, + kDispose, + type MongoDBNamespace, + noop, + squashError +} from '../utils'; + +/** + * @internal + * TODO(NODE-2882): A cursor's getMore commands must be run on the same server it was started on + * and the same session must be used for the lifetime of the cursor. This object serves to get the + * server and session (along with the response) out of executeOperation back to the AbstractCursor. + * + * There may be a better design for communicating these values back to the cursor, currently an operation + * MUST store the selected server on itself so it can be read after executeOperation has returned. + */ +export interface InitialCursorResponse { + /** The server selected for the operation */ + server: Server; + /** The session used for this operation, may be implicitly created */ + session?: ClientSession; + /** The raw server response for the operation */ + response: CursorResponse; +} + +/** @public */ +export const CURSOR_FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +] as const; + +/** @public */ +export type CursorFlag = (typeof CURSOR_FLAGS)[number]; + +function removeActiveCursor(this: AbstractCursor) { + this.client.s.activeCursors.delete(this); +} + +/** + * @public + * @experimental + * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'` + * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of + * `cursor.next()`. + * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor. + * + * Depending on the type of cursor being used, this option has different default values. + * For non-tailable cursors, this value defaults to `'cursorLifetime'` + * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by + * definition can have an arbitrarily long lifetime. + * + * @example + * ```ts + * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'}); + * for await (const doc of cursor) { + * // process doc + * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but + * // will continue to iterate successfully otherwise, regardless of the number of batches. + * } + * ``` + * + * @example + * ```ts + * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' }); + * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms. + * ``` + */ +export const CursorTimeoutMode = Object.freeze({ + ITERATION: 'iteration', + LIFETIME: 'cursorLifetime' +} as const); + +/** + * @public + * @experimental + */ +export type CursorTimeoutMode = (typeof CursorTimeoutMode)[keyof typeof CursorTimeoutMode]; + +/** @public */ +export interface AbstractCursorOptions extends BSONSerializeOptions { + session?: ClientSession; + readPreference?: ReadPreferenceLike; + readConcern?: ReadConcernLike; + /** + * Specifies the number of documents to return in each response from MongoDB + */ + batchSize?: number; + /** + * When applicable `maxTimeMS` controls the amount of time the initial command + * that constructs a cursor should take. (ex. find, aggregate, listCollections) + */ + maxTimeMS?: number; + /** + * When applicable `maxAwaitTimeMS` controls the amount of time subsequent getMores + * that a cursor uses to fetch more data should take. (ex. cursor.next()) + */ + maxAwaitTimeMS?: number; + /** + * Comment to apply to the operation. + */ + comment?: unknown; + /** + * By default, MongoDB will automatically close a cursor when the + * client has exhausted all results in the cursor. However, for [capped collections](https://www.mongodb.com/docs/manual/core/capped-collections) + * you may use a Tailable Cursor that remains open after the client exhausts + * the results in the initial cursor. + */ + tailable?: boolean; + /** + * If awaitData is set to true, when the cursor reaches the end of the capped collection, + * MongoDB blocks the query thread for a period of time waiting for new data to arrive. + * When new data is inserted into the capped collection, the blocked thread is signaled + * to wake up and return the next batch to the client. + */ + awaitData?: boolean; + noCursorTimeout?: boolean; + /** Specifies the time an operation will run until it throws a timeout error. See {@link AbstractCursorOptions.timeoutMode} for more details on how this option applies to cursors. */ + timeoutMS?: number; + /** + * @public + * @experimental + * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'` + * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of + * `cursor.next()`. + * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor. + * + * Depending on the type of cursor being used, this option has different default values. + * For non-tailable cursors, this value defaults to `'cursorLifetime'` + * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by + * definition can have an arbitrarily long lifetime. + * + * @example + * ```ts + * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'}); + * for await (const doc of cursor) { + * // process doc + * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but + * // will continue to iterate successfully otherwise, regardless of the number of batches. + * } + * ``` + * + * @example + * ```ts + * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' }); + * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms. + * ``` + */ + timeoutMode?: CursorTimeoutMode; + + /** + * @internal + * + * A timeout context to govern the total time the cursor can live. If provided, the cursor + * cannot be used in ITERATION mode. + */ + timeoutContext?: CursorTimeoutContext; +} + +/** @internal */ +export type InternalAbstractCursorOptions = Omit & { + // resolved + readPreference: ReadPreference; + readConcern?: ReadConcern; + + // cursor flags, some are deprecated + oplogReplay?: boolean; + exhaust?: boolean; + partial?: boolean; + + omitMaxTimeMS?: boolean; +}; + +/** @public */ +export type AbstractCursorEvents = { + [AbstractCursor.CLOSE](): void; +}; + +/** @public */ +export abstract class AbstractCursor< + TSchema = any, + CursorEvents extends AbstractCursorEvents = AbstractCursorEvents + > + extends TypedEventEmitter + implements AsyncDisposable +{ + /** @internal */ + private cursorId: Long | null; + /** @internal */ + private cursorSession: ClientSession | null; + /** @internal */ + private selectedServer?: Server; + /** @internal */ + private cursorNamespace: MongoDBNamespace; + /** @internal */ + private documents: CursorResponse | null = null; + /** @internal */ + private cursorClient: MongoClient; + /** @internal */ + private transform?: (doc: TSchema) => any; + /** + * @internal + * This is true whether or not the first command fails. It only indicates whether or not the first + * command has been run. + */ + private initialized: boolean; + /** @internal */ + private isClosed: boolean; + /** @internal */ + private isKilled: boolean; + /** @internal */ + protected readonly cursorOptions: InternalAbstractCursorOptions; + /** @internal */ + protected timeoutContext?: CursorTimeoutContext; + + /** @event */ + static readonly CLOSE = 'close' as const; + + /** @internal */ + protected deserializationOptions: OnDemandDocumentDeserializeOptions; + protected signal: AbortSignal | undefined; + private abortListener: Disposable | undefined; + + /** @internal */ + protected constructor( + client: MongoClient, + namespace: MongoDBNamespace, + options: AbstractCursorOptions & Abortable = {} + ) { + super(); + this.on('error', noop); + + if (!client.s.isMongoClient) { + throw new MongoRuntimeError('Cursor must be constructed with MongoClient'); + } + this.cursorClient = client; + this.cursorNamespace = namespace; + this.cursorId = null; + this.initialized = false; + this.isClosed = false; + this.isKilled = false; + this.cursorOptions = { + readPreference: + options.readPreference && options.readPreference instanceof ReadPreference + ? options.readPreference + : ReadPreference.primary, + ...pluckBSONSerializeOptions(options), + timeoutMS: options?.timeoutContext?.csotEnabled() + ? options.timeoutContext.timeoutMS + : options.timeoutMS, + tailable: options.tailable, + awaitData: options.awaitData + }; + + if (this.cursorOptions.timeoutMS != null) { + if (options.timeoutMode == null) { + if (options.tailable) { + if (options.awaitData) { + if ( + options.maxAwaitTimeMS != null && + options.maxAwaitTimeMS >= this.cursorOptions.timeoutMS + ) + throw new MongoInvalidArgumentError( + 'Cannot specify maxAwaitTimeMS >= timeoutMS for a tailable awaitData cursor' + ); + } + + this.cursorOptions.timeoutMode = CursorTimeoutMode.ITERATION; + } else { + this.cursorOptions.timeoutMode = CursorTimeoutMode.LIFETIME; + } + } else { + if (options.tailable && options.timeoutMode === CursorTimeoutMode.LIFETIME) { + throw new MongoInvalidArgumentError( + "Cannot set tailable cursor's timeoutMode to LIFETIME" + ); + } + this.cursorOptions.timeoutMode = options.timeoutMode; + } + } else { + if (options.timeoutMode != null) + throw new MongoInvalidArgumentError('Cannot set timeoutMode without setting timeoutMS'); + } + + // Set for initial command + this.cursorOptions.omitMaxTimeMS = + this.cursorOptions.timeoutMS != null && + ((this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION && + !this.cursorOptions.tailable) || + (this.cursorOptions.tailable && !this.cursorOptions.awaitData)); + + const readConcern = ReadConcern.fromOptions(options); + if (readConcern) { + this.cursorOptions.readConcern = readConcern; + } + + if (typeof options.batchSize === 'number') { + this.cursorOptions.batchSize = options.batchSize; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + this.cursorOptions.comment = options.comment; + } + + if (typeof options.maxTimeMS === 'number') { + this.cursorOptions.maxTimeMS = options.maxTimeMS; + } + + if (typeof options.maxAwaitTimeMS === 'number') { + this.cursorOptions.maxAwaitTimeMS = options.maxAwaitTimeMS; + } + + this.cursorSession = options.session ?? null; + + this.deserializationOptions = { + ...this.cursorOptions, + validation: { + utf8: options?.enableUtf8Validation === false ? false : true + } + }; + + this.timeoutContext = options.timeoutContext; + this.signal = options.signal; + this.abortListener = addAbortListener( + this.signal, + () => void this.close().then(undefined, squashError) + ); + this.trackCursor(); + } + + /** + * The cursor has no id until it receives a response from the initial cursor creating command. + * + * It is non-zero for as long as the database has an open cursor. + * + * The initiating command may receive a zero id if the entire result is in the `firstBatch`. + */ + get id(): Long | undefined { + return this.cursorId ?? undefined; + } + + /** @internal */ + get isDead() { + return (this.cursorId?.isZero() ?? false) || this.isClosed || this.isKilled; + } + + /** @internal */ + get client(): MongoClient { + return this.cursorClient; + } + + /** @internal */ + get server(): Server | undefined { + return this.selectedServer; + } + + get namespace(): MongoDBNamespace { + return this.cursorNamespace; + } + + get readPreference(): ReadPreference { + return this.cursorOptions.readPreference; + } + + get readConcern(): ReadConcern | undefined { + return this.cursorOptions.readConcern; + } + + /** @internal */ + get session(): ClientSession | null { + return this.cursorSession; + } + + set session(clientSession: ClientSession) { + this.cursorSession = clientSession; + } + + /** + * The cursor is closed and all remaining locally buffered documents have been iterated. + */ + get closed(): boolean { + return this.isClosed && (this.documents?.length ?? 0) === 0; + } + + /** + * A `killCursors` command was attempted on this cursor. + * This is performed if the cursor id is non zero. + */ + get killed(): boolean { + return this.isKilled; + } + + get loadBalanced(): boolean { + return !!this.cursorClient.topology?.loadBalanced; + } + + /** + * An alias for {@link AbstractCursor.close|AbstractCursor.close()}. + */ + async [Symbol.asyncDispose]() { + await this.close(); + } + + /** Adds cursor to client's tracking so it will be closed by MongoClient.close() */ + private trackCursor() { + this.cursorClient.s.activeCursors.add(this); + if (!this.listeners('close').includes(removeActiveCursor)) { + this.once('close', removeActiveCursor); + } + } + + /** Returns current buffered documents length */ + bufferedCount(): number { + return this.documents?.length ?? 0; + } + + /** Returns current buffered documents */ + readBufferedDocuments(number?: number): NonNullable[] { + const bufferedDocs: NonNullable[] = []; + const documentsToRead = Math.min( + number ?? this.documents?.length ?? 0, + this.documents?.length ?? 0 + ); + + for (let count = 0; count < documentsToRead; count++) { + const document = this.documents?.shift(this.deserializationOptions); + if (document != null) { + bufferedDocs.push(document); + } + } + + return bufferedDocs; + } + + async *[Symbol.asyncIterator](): AsyncGenerator { + this.signal?.throwIfAborted(); + + if (this.closed) { + return; + } + + try { + while (true) { + if (this.isKilled) { + return; + } + + if (this.closed) { + return; + } + + if (this.cursorId != null && this.isDead && (this.documents?.length ?? 0) === 0) { + return; + } + + const document = await this.next(); + + // eslint-disable-next-line no-restricted-syntax + if (document === null) { + return; + } + + yield document; + + this.signal?.throwIfAborted(); + } + } finally { + // Only close the cursor if it has not already been closed. This finally clause handles + // the case when a user would break out of a for await of loop early. + if (!this.isClosed) { + try { + await this.close(); + } catch (error) { + squashError(error); + } + } + } + } + + stream(): Readable & AsyncIterable { + const readable = new ReadableCursorStream(this); + const abortListener = addAbortListener(this.signal, function () { + readable.destroy(this.reason); + }); + readable.once('end', () => { + abortListener?.[kDispose](); + }); + + return readable; + } + + async hasNext(): Promise { + this.signal?.throwIfAborted(); + + if (this.cursorId === Long.ZERO) { + return false; + } + + if (this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + do { + if ((this.documents?.length ?? 0) !== 0) { + return true; + } + await this.fetchBatch(); + } while (!this.isDead || (this.documents?.length ?? 0) !== 0); + } finally { + if (this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + + return false; + } + + /** Get the next available document from the cursor, returns null if no more documents are available. */ + async next(): Promise { + this.signal?.throwIfAborted(); + + if (this.cursorId === Long.ZERO) { + throw new MongoCursorExhaustedError(); + } + + if (this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + + try { + do { + const doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) return await this.transformDocument(doc); + return doc; + } + await this.fetchBatch(); + } while (!this.isDead || (this.documents?.length ?? 0) !== 0); + } finally { + if (this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + + return null; + } + + /** + * Try to get the next available document from the cursor or `null` if an empty batch is returned + */ + async tryNext(): Promise { + this.signal?.throwIfAborted(); + + if (this.cursorId === Long.ZERO) { + throw new MongoCursorExhaustedError(); + } + + if (this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + let doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) return await this.transformDocument(doc); + return doc; + } + + await this.fetchBatch(); + + doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) return await this.transformDocument(doc); + return doc; + } + } finally { + if (this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + + return null; + } + + /** + * Iterates over all the documents for this cursor using the iterator, callback pattern. + * + * If the iterator returns `false`, iteration will stop. + * + * @param iterator - The iteration callback. + * @deprecated - Will be removed in a future release. Use for await...of instead. + */ + async forEach(iterator: (doc: TSchema) => boolean | void): Promise { + this.signal?.throwIfAborted(); + + if (typeof iterator !== 'function') { + throw new MongoInvalidArgumentError('Argument "iterator" must be a function'); + } + for await (const document of this) { + const result = iterator(document); + if (result === false) { + break; + } + } + } + + /** + * Frees any client-side resources used by the cursor. + */ + async close(options?: { timeoutMS?: number }): Promise { + await this.cleanup(options?.timeoutMS); + } + + /** + * Returns an array of documents. The caller is responsible for making sure that there + * is enough memory to store the results. Note that the array only contains partial + * results when this cursor had been previously accessed. In that case, + * cursor.rewind() can be used to reset the cursor. + */ + async toArray(): Promise { + this.signal?.throwIfAborted(); + + const array: TSchema[] = []; + // at the end of the loop (since readBufferedDocuments is called) the buffer will be empty + // then, the 'await of' syntax will run a getMore call + for await (const document of this) { + array.push(document); + const docs = this.readBufferedDocuments(); + if (this.transform != null) { + for (const doc of docs) { + array.push(await this.transformDocument(doc)); + } + } else { + // Note: previous versions of this logic used `array.push(...)`, which adds each item + // to the callstack. For large arrays, this can exceed the maximum call size. + for (const doc of docs) { + array.push(doc); + } + } + } + return array; + } + /** + * Add a cursor flag to the cursor + * + * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -. + * @param value - The flag boolean value. + */ + addCursorFlag(flag: CursorFlag, value: boolean): this { + this.throwIfInitialized(); + if (!CURSOR_FLAGS.includes(flag)) { + throw new MongoInvalidArgumentError(`Flag ${flag} is not one of ${CURSOR_FLAGS}`); + } + + if (typeof value !== 'boolean') { + throw new MongoInvalidArgumentError(`Flag ${flag} must be a boolean value`); + } + + this.cursorOptions[flag] = value; + return this; + } + + /** + * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. + * + * @remarks + * + * **Note** Cursors use `null` internally to indicate that there are no more documents in the cursor. Providing a mapping + * function that maps values to `null` will result in the cursor closing itself before it has finished iterating + * all documents. This will **not** result in a memory leak, just surprising behavior. For example: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => null); + * + * const documents = await cursor.toArray(); + * // documents is always [], regardless of how many documents are in the collection. + * ``` + * + * Other falsey values are allowed: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => ''); + * + * const documents = await cursor.toArray(); + * // documents is now an array of empty strings + * ``` + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling map, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor = coll.find(); + * const mappedCursor: FindCursor = cursor.map(doc => Object.keys(doc).length); + * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[] + * ``` + * @param transform - The mapping transformation method. + */ + map(transform: (doc: TSchema) => T): AbstractCursor { + this.throwIfInitialized(); + const oldTransform = this.transform; + if (oldTransform) { + this.transform = doc => { + return transform(oldTransform(doc)); + }; + } else { + this.transform = transform; + } + + return this as unknown as AbstractCursor; + } + + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadPreference(readPreference: ReadPreferenceLike): this { + this.throwIfInitialized(); + if (readPreference instanceof ReadPreference) { + this.cursorOptions.readPreference = readPreference; + } else if (typeof readPreference === 'string') { + this.cursorOptions.readPreference = ReadPreference.fromString(readPreference); + } else { + throw new MongoInvalidArgumentError(`Invalid read preference: ${readPreference}`); + } + + return this; + } + + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadConcern(readConcern: ReadConcernLike): this { + this.throwIfInitialized(); + const resolvedReadConcern = ReadConcern.fromOptions({ readConcern }); + if (resolvedReadConcern) { + this.cursorOptions.readConcern = resolvedReadConcern; + } + + return this; + } + + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value: number): this { + this.throwIfInitialized(); + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + + this.cursorOptions.maxTimeMS = value; + return this; + } + + /** + * Set the batch size for the cursor. + * + * @param value - The number of documents to return per batch. See {@link https://www.mongodb.com/docs/manual/reference/command/find/|find command documentation}. + */ + batchSize(value: number): this { + this.throwIfInitialized(); + if (this.cursorOptions.tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support batchSize'); + } + + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Operation "batchSize" requires an integer'); + } + + this.cursorOptions.batchSize = value; + return this; + } + + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind(): void { + if (this.timeoutContext && this.timeoutContext.owner !== this) { + throw new MongoAPIError(`Cannot rewind cursor that does not own its timeout context.`); + } + if (!this.initialized) { + return; + } + + this.cursorId = null; + this.documents?.clear(); + this.timeoutContext?.clear(); + this.timeoutContext = undefined; + this.isClosed = false; + this.isKilled = false; + this.initialized = false; + this.hasEmittedClose = false; + this.trackCursor(); + + // We only want to end this session if we created it, and it hasn't ended yet + if (this.cursorSession?.explicit === false) { + if (!this.cursorSession.hasEnded) { + this.cursorSession.endSession().then(undefined, squashError); + } + + this.cursorSession = null; + } + } + + /** + * Returns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance + */ + abstract clone(): AbstractCursor; + + /** @internal */ + protected abstract _initialize( + session: ClientSession | undefined + ): Promise; + + /** @internal */ + async getMore(): Promise { + if (this.cursorId == null) { + throw new MongoRuntimeError( + 'Unexpected null cursor id. A cursor creating command should have set this' + ); + } + if (this.selectedServer == null) { + throw new MongoRuntimeError( + 'Unexpected null selectedServer. A cursor creating command should have set this' + ); + } + + if (this.cursorSession == null) { + throw new MongoRuntimeError( + 'Unexpected null session. A cursor creating command should have set this' + ); + } + const getMoreOptions = { + ...this.cursorOptions, + session: this.cursorSession, + batchSize: this.cursorOptions.batchSize + }; + + const getMoreOperation = new GetMoreOperation( + this.cursorNamespace, + this.cursorId, + this.selectedServer, + getMoreOptions + ); + + return await executeOperation(this.cursorClient, getMoreOperation, this.timeoutContext); + } + + /** + * @internal + * + * This function is exposed for the unified test runner's createChangeStream + * operation. We cannot refactor to use the abstract _initialize method without + * a significant refactor. + */ + private async cursorInit(): Promise { + if (this.cursorOptions.timeoutMS != null) { + this.timeoutContext ??= new CursorTimeoutContext( + TimeoutContext.create({ + serverSelectionTimeoutMS: this.client.s.options.serverSelectionTimeoutMS, + timeoutMS: this.cursorOptions.timeoutMS + }), + this + ); + } + try { + this.cursorSession ??= this.cursorClient.startSession({ owner: this, explicit: false }); + const state = await this._initialize(this.cursorSession); + // Set omitMaxTimeMS to the value needed for subsequent getMore calls + this.cursorOptions.omitMaxTimeMS = this.cursorOptions.timeoutMS != null; + const response = state.response; + this.selectedServer = state.server; + this.cursorId = response.id; + this.cursorNamespace = response.ns ?? this.namespace; + this.documents = response; + this.initialized = true; // the cursor is now initialized, even if it is dead + } catch (error) { + // the cursor is now initialized, even if an error occurred + this.initialized = true; + await this.cleanup(undefined, error); + throw error; + } + + if (this.isDead) { + await this.cleanup(); + } + + return; + } + + /** @internal Attempt to obtain more documents */ + private async fetchBatch(): Promise { + if (this.isClosed) { + return; + } + + if (this.isDead) { + // if the cursor is dead, we clean it up + // cleanupCursor should never throw, but if it does it indicates a bug in the driver + // and we should surface the error + await this.cleanup(); + return; + } + + if (this.cursorId == null) { + await this.cursorInit(); + // If the cursor died or returned documents, return + if ((this.documents?.length ?? 0) !== 0 || this.isDead) return; + } + + // Otherwise, run a getMore + try { + const response = await this.getMore(); + this.cursorId = response.id; + this.documents = response; + } catch (error) { + try { + await this.cleanup(undefined, error); + } catch (cleanupError) { + // `cleanupCursor` should never throw, squash and throw the original error + squashError(cleanupError); + } + throw error; + } + + if (this.isDead) { + // If we successfully received a response from a cursor BUT the cursor indicates that it is exhausted, + // we intentionally clean up the cursor to release its session back into the pool before the cursor + // is iterated. This prevents a cursor that is exhausted on the server from holding + // onto a session indefinitely until the AbstractCursor is iterated. + // + // cleanupCursorAsync should never throw, but if it does it indicates a bug in the driver + // and we should surface the error + await this.cleanup(); + } + } + + /** @internal */ + private async cleanup(timeoutMS?: number, error?: Error) { + this.abortListener?.[kDispose](); + this.isClosed = true; + const timeoutContextForKillCursors = (): CursorTimeoutContext | undefined => { + if (timeoutMS != null) { + this.timeoutContext?.clear(); + return new CursorTimeoutContext( + TimeoutContext.create({ + serverSelectionTimeoutMS: this.client.s.options.serverSelectionTimeoutMS, + timeoutMS + }), + this + ); + } else { + return this.timeoutContext?.refreshed(); + } + }; + + const withEmitClose = async (fn: () => Promise) => { + try { + await fn(); + } finally { + this.emitClose(); + } + }; + + const close = async () => { + // if no session has been defined on the cursor, the cursor was never initialized + // or the cursor was re-wound and never re-iterated. In either case, we + // 1. do not need to end the session (there is no session after all) + // 2. do not need to kill the cursor server-side + const session = this.cursorSession; + if (!session) return; + + try { + if ( + !this.isKilled && + this.cursorId && + !this.cursorId.isZero() && + this.cursorNamespace && + this.selectedServer && + !session.hasEnded + ) { + this.isKilled = true; + const cursorId = this.cursorId; + this.cursorId = Long.ZERO; + + await executeOperation( + this.cursorClient, + new KillCursorsOperation(cursorId, this.cursorNamespace, this.selectedServer, { + session + }), + timeoutContextForKillCursors() + ); + } + } catch (error) { + squashError(error); + } finally { + if (session.owner === this) { + await session.endSession({ error }); + } + if (!session.inTransaction()) { + maybeClearPinnedConnection(session, { error }); + } + } + }; + + await withEmitClose(close); + } + + /** @internal */ + private hasEmittedClose = false; + /** @internal */ + private emitClose() { + try { + if (!this.hasEmittedClose && ((this.documents?.length ?? 0) === 0 || this.isClosed)) { + // @ts-expect-error: CursorEvents is generic so Parameters may not be assignable to `[]`. Not sure how to require extenders do not add parameters. + this.emit('close'); + } + } finally { + this.hasEmittedClose = true; + } + } + + /** @internal */ + private async transformDocument(document: NonNullable): Promise> { + if (this.transform == null) return document; + + try { + const transformedDocument = this.transform(document); + // eslint-disable-next-line no-restricted-syntax + if (transformedDocument === null) { + const TRANSFORM_TO_NULL_ERROR = + 'Cursor returned a `null` document, but the cursor is not exhausted. Mapping documents to `null` is not supported in the cursor transform.'; + throw new MongoAPIError(TRANSFORM_TO_NULL_ERROR); + } + return transformedDocument; + } catch (transformError) { + try { + await this.close(); + } catch (closeError) { + squashError(closeError); + } + throw transformError; + } + } + + /** @internal */ + protected throwIfInitialized() { + if (this.initialized) throw new MongoCursorInUseError(); + } +} + +class ReadableCursorStream extends Readable { + private _cursor: AbstractCursor; + private _readInProgress = false; + + constructor(cursor: AbstractCursor) { + super({ + objectMode: true, + autoDestroy: false, + highWaterMark: 1 + }); + this._cursor = cursor; + } + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + override _read(size: number): void { + if (!this._readInProgress) { + this._readInProgress = true; + this._readNext(); + } + } + + override _destroy(error: Error | null, callback: (error?: Error | null) => void): void { + this._cursor.close().then( + () => callback(error), + closeError => callback(closeError) + ); + } + + private _readNext() { + if (this._cursor.id === Long.ZERO) { + this.push(null); + return; + } + + this._cursor + .next() + .then( + // result from next() + result => { + if (result == null) { + this.push(null); + } else if (this.destroyed) { + this._cursor.close().then(undefined, squashError); + } else { + if (this.push(result)) { + return this._readNext(); + } + + this._readInProgress = false; + } + }, + // error from next() + err => { + // NOTE: This is questionable, but we have a test backing the behavior. It seems the + // desired behavior is that a stream ends cleanly when a user explicitly closes + // a client during iteration. Alternatively, we could do the "right" thing and + // propagate the error message by removing this special case. + if (err.message.match(/server is closed/)) { + this._cursor.close().then(undefined, squashError); + return this.push(null); + } + + // NOTE: This is also perhaps questionable. The rationale here is that these errors tend + // to be "operation was interrupted", where a cursor has been closed but there is an + // active getMore in-flight. This used to check if the cursor was killed but once + // that changed to happen in cleanup legitimate errors would not destroy the + // stream. There are change streams test specifically test these cases. + if (err.message.match(/operation was interrupted/)) { + return this.push(null); + } + + // NOTE: The two above checks on the message of the error will cause a null to be pushed + // to the stream, thus closing the stream before the destroy call happens. This means + // that either of those error messages on a change stream will not get a proper + // 'error' event to be emitted (the error passed to destroy). Change stream resumability + // relies on that error event to be emitted to create its new cursor and thus was not + // working on 4.4 servers because the error emitted on failover was "interrupted at + // shutdown" while on 5.0+ it is "The server is in quiesce mode and will shut down". + // See NODE-4475. + return this.destroy(err); + } + ) + // if either of the above handlers throw + .catch(error => { + this._readInProgress = false; + this.destroy(error); + }); + } +} + +/** + * @internal + * The cursor timeout context is a wrapper around a timeout context + * that keeps track of the "owner" of the cursor. For timeout contexts + * instantiated inside a cursor, the owner will be the cursor. + * + * All timeout behavior is exactly the same as the wrapped timeout context's. + */ +export class CursorTimeoutContext extends TimeoutContext { + timeoutContext: TimeoutContext; + owner: symbol | AbstractCursor; + + constructor(timeoutContext: TimeoutContext, owner: symbol | AbstractCursor) { + super(); + this.timeoutContext = timeoutContext; + this.owner = owner; + } + override get serverSelectionTimeout(): Timeout | null { + return this.timeoutContext.serverSelectionTimeout; + } + override get connectionCheckoutTimeout(): Timeout | null { + return this.timeoutContext.connectionCheckoutTimeout; + } + override get clearServerSelectionTimeout(): boolean { + return this.timeoutContext.clearServerSelectionTimeout; + } + override get timeoutForSocketWrite(): Timeout | null { + return this.timeoutContext.timeoutForSocketWrite; + } + override get timeoutForSocketRead(): Timeout | null { + return this.timeoutContext.timeoutForSocketRead; + } + override csotEnabled(): this is CSOTTimeoutContext { + return this.timeoutContext.csotEnabled(); + } + override refresh(): void { + if (typeof this.owner !== 'symbol') return this.timeoutContext.refresh(); + } + override clear(): void { + if (typeof this.owner !== 'symbol') return this.timeoutContext.clear(); + } + override get maxTimeMS(): number | null { + return this.timeoutContext.maxTimeMS; + } + get timeoutMS(): number | null { + return this.timeoutContext.csotEnabled() ? this.timeoutContext.timeoutMS : null; + } + override refreshed(): CursorTimeoutContext { + return new CursorTimeoutContext(this.timeoutContext.refreshed(), this.owner); + } + override addMaxTimeMSToCommand(command: Document, options: { omitMaxTimeMS?: boolean }): void { + this.timeoutContext.addMaxTimeMSToCommand(command, options); + } + override getSocketTimeoutMS(): number | undefined { + return this.timeoutContext.getSocketTimeoutMS(); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/aggregation_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/aggregation_cursor.ts new file mode 100644 index 00000000..07201e1c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/aggregation_cursor.ts @@ -0,0 +1,245 @@ +import type { Document } from '../bson'; +import { MongoAPIError } from '../error'; +import { + Explain, + type ExplainCommandOptions, + type ExplainVerbosityLike, + validateExplainTimeoutOptions +} from '../explain'; +import type { MongoClient } from '../mongo_client'; +import { type Abortable } from '../mongo_types'; +import { AggregateOperation, type AggregateOptions } from '../operations/aggregate'; +import { executeOperation } from '../operations/execute_operation'; +import type { ClientSession } from '../sessions'; +import type { Sort } from '../sort'; +import { mergeOptions, type MongoDBNamespace } from '../utils'; +import { + type AbstractCursorOptions, + CursorTimeoutMode, + type InitialCursorResponse +} from './abstract_cursor'; +import { ExplainableCursor } from './explainable_cursor'; + +/** @public */ +export interface AggregationCursorOptions extends AbstractCursorOptions, AggregateOptions {} + +/** + * The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB + * allowing for iteration over the results returned from the underlying query. It supports + * one by one document iteration, conversion to an array or can be iterated as a Node 4.X + * or higher stream + * @public + */ +export class AggregationCursor extends ExplainableCursor { + public readonly pipeline: Document[]; + /** @internal */ + private aggregateOptions: AggregateOptions & Abortable; + + /** @internal */ + constructor( + client: MongoClient, + namespace: MongoDBNamespace, + pipeline: Document[] = [], + options: AggregateOptions & Abortable = {} + ) { + super(client, namespace, options); + + this.pipeline = pipeline; + this.aggregateOptions = options; + + const lastStage: Document | undefined = this.pipeline[this.pipeline.length - 1]; + + if ( + this.cursorOptions.timeoutMS != null && + this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION && + (lastStage?.$merge != null || lastStage?.$out != null) + ) + throw new MongoAPIError('Cannot use $out or $merge stage with ITERATION timeoutMode'); + } + + clone(): AggregationCursor { + const clonedOptions = mergeOptions({}, this.aggregateOptions); + delete clonedOptions.session; + return new AggregationCursor(this.client, this.namespace, this.pipeline, { + ...clonedOptions + }); + } + + override map(transform: (doc: TSchema) => T): AggregationCursor { + return super.map(transform) as AggregationCursor; + } + + /** @internal */ + async _initialize(session: ClientSession): Promise { + const options = { + ...this.aggregateOptions, + ...this.cursorOptions, + session, + signal: this.signal + }; + if (options.explain) { + try { + validateExplainTimeoutOptions(options, Explain.fromOptions(options)); + } catch { + throw new MongoAPIError( + 'timeoutMS cannot be used with explain when explain is specified in aggregateOptions' + ); + } + } + + const aggregateOperation = new AggregateOperation(this.namespace, this.pipeline, options); + + const response = await executeOperation(this.client, aggregateOperation, this.timeoutContext); + + return { server: aggregateOperation.server, session, response }; + } + + /** Execute the explain for the cursor */ + async explain(): Promise; + async explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise; + async explain(options: { timeoutMS?: number }): Promise; + async explain( + verbosity: ExplainVerbosityLike | ExplainCommandOptions, + options: { timeoutMS?: number } + ): Promise; + async explain( + verbosity?: ExplainVerbosityLike | ExplainCommandOptions | { timeoutMS?: number }, + options?: { timeoutMS?: number } + ): Promise { + const { explain, timeout } = this.resolveExplainTimeoutOptions(verbosity, options); + return ( + await executeOperation( + this.client, + new AggregateOperation(this.namespace, this.pipeline, { + ...this.aggregateOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...timeout, + explain: explain ?? true + }) + ) + ).shift(this.deserializationOptions); + } + + /** Add a stage to the aggregation pipeline + * @example + * ``` + * const documents = await users.aggregate().addStage({ $match: { name: /Mike/ } }).toArray(); + * ``` + * @example + * ``` + * const documents = await users.aggregate() + * .addStage<{ name: string }>({ $project: { name: true } }) + * .toArray(); // type of documents is { name: string }[] + * ``` + */ + addStage(stage: Document): this; + addStage(stage: Document): AggregationCursor; + addStage(stage: Document): AggregationCursor { + this.throwIfInitialized(); + if ( + this.cursorOptions.timeoutMS != null && + this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION && + (stage.$out != null || stage.$merge != null) + ) { + throw new MongoAPIError('Cannot use $out or $merge stage with ITERATION timeoutMode'); + } + this.pipeline.push(stage); + return this as unknown as AggregationCursor; + } + + /** Add a group stage to the aggregation pipeline */ + group($group: Document): AggregationCursor; + group($group: Document): this { + return this.addStage({ $group }); + } + + /** Add a limit stage to the aggregation pipeline */ + limit($limit: number): this { + return this.addStage({ $limit }); + } + + /** Add a match stage to the aggregation pipeline */ + match($match: Document): this { + return this.addStage({ $match }); + } + + /** Add an out stage to the aggregation pipeline */ + out($out: { db: string; coll: string } | string): this { + return this.addStage({ $out }); + } + + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: AggregationCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.aggregate().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project($project: Document): AggregationCursor { + return this.addStage({ $project }); + } + + /** Add a lookup stage to the aggregation pipeline */ + lookup($lookup: Document): this { + return this.addStage({ $lookup }); + } + + /** Add a redact stage to the aggregation pipeline */ + redact($redact: Document): this { + return this.addStage({ $redact }); + } + + /** Add a skip stage to the aggregation pipeline */ + skip($skip: number): this { + return this.addStage({ $skip }); + } + + /** Add a sort stage to the aggregation pipeline */ + sort($sort: Sort): this { + return this.addStage({ $sort }); + } + + /** Add a unwind stage to the aggregation pipeline */ + unwind($unwind: Document | string): this { + return this.addStage({ $unwind }); + } + + /** Add a geoNear stage to the aggregation pipeline */ + geoNear($geoNear: Document): this { + return this.addStage({ $geoNear }); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/change_stream_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/change_stream_cursor.ts new file mode 100644 index 00000000..7b4db301 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/change_stream_cursor.ts @@ -0,0 +1,171 @@ +import type { Document } from '../bson'; +import { + ChangeStream, + type ChangeStreamDocument, + type ChangeStreamEvents, + type OperationTime, + type ResumeToken +} from '../change_stream'; +import { type CursorResponse } from '../cmap/wire_protocol/responses'; +import { INIT, RESPONSE } from '../constants'; +import type { MongoClient } from '../mongo_client'; +import { AggregateOperation } from '../operations/aggregate'; +import type { CollationOptions } from '../operations/command'; +import { executeOperation } from '../operations/execute_operation'; +import type { ClientSession } from '../sessions'; +import { maxWireVersion, type MongoDBNamespace } from '../utils'; +import { + AbstractCursor, + type AbstractCursorOptions, + type InitialCursorResponse +} from './abstract_cursor'; + +/** @internal */ +export interface ChangeStreamCursorOptions extends AbstractCursorOptions { + startAtOperationTime?: OperationTime; + resumeAfter?: ResumeToken; + startAfter?: ResumeToken; + maxAwaitTimeMS?: number; + collation?: CollationOptions; + fullDocument?: string; +} + +/** @internal */ +export class ChangeStreamCursor< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument +> extends AbstractCursor { + private _resumeToken: ResumeToken; + private startAtOperationTime: OperationTime | null; + private hasReceived?: boolean; + private readonly changeStreamCursorOptions: ChangeStreamCursorOptions; + private postBatchResumeToken?: ResumeToken; + private readonly pipeline: Document[]; + + /** + * @internal + * + * used to determine change stream resumability + */ + maxWireVersion: number | undefined; + + constructor( + client: MongoClient, + namespace: MongoDBNamespace, + pipeline: Document[] = [], + options: ChangeStreamCursorOptions = {} + ) { + super(client, namespace, { ...options, tailable: true, awaitData: true }); + + this.pipeline = pipeline; + this.changeStreamCursorOptions = options; + this._resumeToken = null; + this.startAtOperationTime = options.startAtOperationTime ?? null; + + if (options.startAfter) { + this.resumeToken = options.startAfter; + } else if (options.resumeAfter) { + this.resumeToken = options.resumeAfter; + } + } + + set resumeToken(token: ResumeToken) { + this._resumeToken = token; + this.emit(ChangeStream.RESUME_TOKEN_CHANGED, token); + } + + get resumeToken(): ResumeToken { + return this._resumeToken; + } + + get resumeOptions(): ChangeStreamCursorOptions { + const options: ChangeStreamCursorOptions = { + ...this.changeStreamCursorOptions + }; + + for (const key of ['resumeAfter', 'startAfter', 'startAtOperationTime'] as const) { + delete options[key]; + } + + if (this.resumeToken != null) { + if (this.changeStreamCursorOptions.startAfter && !this.hasReceived) { + options.startAfter = this.resumeToken; + } else { + options.resumeAfter = this.resumeToken; + } + } else if (this.startAtOperationTime != null) { + options.startAtOperationTime = this.startAtOperationTime; + } + + return options; + } + + cacheResumeToken(resumeToken: ResumeToken): void { + if (this.bufferedCount() === 0 && this.postBatchResumeToken) { + this.resumeToken = this.postBatchResumeToken; + } else { + this.resumeToken = resumeToken; + } + this.hasReceived = true; + } + + _processBatch(response: CursorResponse): void { + const { postBatchResumeToken } = response; + if (postBatchResumeToken) { + this.postBatchResumeToken = postBatchResumeToken; + + if (response.batchSize === 0) { + this.resumeToken = postBatchResumeToken; + } + } + } + + clone(): AbstractCursor { + return new ChangeStreamCursor(this.client, this.namespace, this.pipeline, { + ...this.cursorOptions + }); + } + + async _initialize(session: ClientSession): Promise { + const aggregateOperation = new AggregateOperation(this.namespace, this.pipeline, { + ...this.cursorOptions, + ...this.changeStreamCursorOptions, + session + }); + + const response = await executeOperation( + session.client, + aggregateOperation, + this.timeoutContext + ); + + const server = aggregateOperation.server; + this.maxWireVersion = maxWireVersion(server); + + if ( + this.startAtOperationTime == null && + this.changeStreamCursorOptions.resumeAfter == null && + this.changeStreamCursorOptions.startAfter == null + ) { + this.startAtOperationTime = response.operationTime; + } + + this._processBatch(response); + + this.emit(INIT, response); + this.emit(RESPONSE); + + return { server, session, response }; + } + + override async getMore(): Promise { + const response = await super.getMore(); + + this.maxWireVersion = maxWireVersion(this.server); + this._processBatch(response); + + this.emit(ChangeStream.MORE, response); + this.emit(ChangeStream.RESPONSE); + return response; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/client_bulk_write_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/client_bulk_write_cursor.ts new file mode 100644 index 00000000..d9da82d3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/client_bulk_write_cursor.ts @@ -0,0 +1,83 @@ +import { type Document } from '../bson'; +import { type ClientBulkWriteCursorResponse } from '../cmap/wire_protocol/responses'; +import type { MongoClient } from '../mongo_client'; +import { ClientBulkWriteOperation } from '../operations/client_bulk_write/client_bulk_write'; +import { type ClientBulkWriteCommandBuilder } from '../operations/client_bulk_write/command_builder'; +import { type ClientBulkWriteOptions } from '../operations/client_bulk_write/common'; +import { executeOperation } from '../operations/execute_operation'; +import type { ClientSession } from '../sessions'; +import { mergeOptions, MongoDBNamespace } from '../utils'; +import { + AbstractCursor, + type AbstractCursorOptions, + type InitialCursorResponse +} from './abstract_cursor'; + +/** @public */ +export interface ClientBulkWriteCursorOptions + extends Omit, + ClientBulkWriteOptions {} + +/** + * This is the cursor that handles client bulk write operations. Note this is never + * exposed directly to the user and is always immediately exhausted. + * @internal + */ +export class ClientBulkWriteCursor extends AbstractCursor { + commandBuilder: ClientBulkWriteCommandBuilder; + /** @internal */ + private cursorResponse?: ClientBulkWriteCursorResponse; + /** @internal */ + private clientBulkWriteOptions: ClientBulkWriteOptions; + + /** @internal */ + constructor( + client: MongoClient, + commandBuilder: ClientBulkWriteCommandBuilder, + options: ClientBulkWriteCursorOptions = {} + ) { + super(client, new MongoDBNamespace('admin', '$cmd'), options); + + this.commandBuilder = commandBuilder; + this.clientBulkWriteOptions = options; + } + + /** + * We need a way to get the top level cursor response fields for + * generating the bulk write result, so we expose this here. + */ + get response(): ClientBulkWriteCursorResponse | null { + if (this.cursorResponse) return this.cursorResponse; + return null; + } + + get operations(): Document[] { + return this.commandBuilder.lastOperations; + } + + clone(): ClientBulkWriteCursor { + const clonedOptions = mergeOptions({}, this.clientBulkWriteOptions); + delete clonedOptions.session; + return new ClientBulkWriteCursor(this.client, this.commandBuilder, { + ...clonedOptions + }); + } + + /** @internal */ + async _initialize(session: ClientSession): Promise { + const clientBulkWriteOperation = new ClientBulkWriteOperation(this.commandBuilder, { + ...this.clientBulkWriteOptions, + ...this.cursorOptions, + session + }); + + const response = await executeOperation( + this.client, + clientBulkWriteOperation, + this.timeoutContext + ); + this.cursorResponse = response; + + return { server: clientBulkWriteOperation.server, session, response }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/explainable_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/explainable_cursor.ts new file mode 100644 index 00000000..6becb0bb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/explainable_cursor.ts @@ -0,0 +1,51 @@ +import { type Document } from '../bson'; +import { type ExplainCommandOptions, type ExplainVerbosityLike } from '../explain'; +import { AbstractCursor } from './abstract_cursor'; + +/** + * @public + * + * A base class for any cursors that have `explain()` methods. + */ +export abstract class ExplainableCursor extends AbstractCursor { + /** Execute the explain for the cursor */ + abstract explain(): Promise; + abstract explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise; + abstract explain(options: { timeoutMS?: number }): Promise; + abstract explain( + verbosity: ExplainVerbosityLike | ExplainCommandOptions, + options: { timeoutMS?: number } + ): Promise; + abstract explain( + verbosity?: ExplainVerbosityLike | ExplainCommandOptions | { timeoutMS?: number }, + options?: { timeoutMS?: number } + ): Promise; + + protected resolveExplainTimeoutOptions( + verbosity?: ExplainVerbosityLike | ExplainCommandOptions | { timeoutMS?: number }, + options?: { timeoutMS?: number } + ): { timeout?: { timeoutMS?: number }; explain?: ExplainVerbosityLike | ExplainCommandOptions } { + let explain: ExplainVerbosityLike | ExplainCommandOptions | undefined; + let timeout: { timeoutMS?: number } | undefined; + + if (verbosity == null && options == null) { + explain = undefined; + timeout = undefined; + } else if (verbosity != null && options == null) { + explain = + typeof verbosity !== 'object' + ? verbosity + : 'verbosity' in verbosity + ? verbosity + : undefined; + + timeout = typeof verbosity === 'object' && 'timeoutMS' in verbosity ? verbosity : undefined; + } else { + // @ts-expect-error TS isn't smart enough to determine that if both options are provided, the first is explain options + explain = verbosity; + timeout = options; + } + + return { timeout, explain }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/find_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/find_cursor.ts new file mode 100644 index 00000000..c66a2a3e --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/find_cursor.ts @@ -0,0 +1,497 @@ +import { type Document } from '../bson'; +import { CursorResponse } from '../cmap/wire_protocol/responses'; +import { MongoAPIError, MongoInvalidArgumentError, MongoTailableCursorError } from '../error'; +import { + Explain, + type ExplainCommandOptions, + type ExplainVerbosityLike, + validateExplainTimeoutOptions +} from '../explain'; +import type { MongoClient } from '../mongo_client'; +import { type Abortable } from '../mongo_types'; +import type { CollationOptions } from '../operations/command'; +import { CountOperation, type CountOptions } from '../operations/count'; +import { executeOperation } from '../operations/execute_operation'; +import { FindOperation, type FindOptions } from '../operations/find'; +import type { Hint } from '../operations/operation'; +import type { ClientSession } from '../sessions'; +import { formatSort, type Sort, type SortDirection } from '../sort'; +import { emitWarningOnce, mergeOptions, type MongoDBNamespace, noop, squashError } from '../utils'; +import { type InitialCursorResponse } from './abstract_cursor'; +import { ExplainableCursor } from './explainable_cursor'; + +/** @public Flags allowed for cursor */ +export const FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +] as const; + +/** @public */ +export class FindCursor extends ExplainableCursor { + /** @internal */ + private cursorFilter: Document; + /** @internal */ + private numReturned = 0; + /** @internal */ + private readonly findOptions: FindOptions & Abortable; + + /** @internal */ + constructor( + client: MongoClient, + namespace: MongoDBNamespace, + filter: Document = {}, + options: FindOptions & Abortable = {} + ) { + super(client, namespace, options); + + this.cursorFilter = filter; + this.findOptions = options; + + if (options.sort != null) { + this.findOptions.sort = formatSort(options.sort); + } + } + + clone(): FindCursor { + const clonedOptions = mergeOptions({}, this.findOptions); + delete clonedOptions.session; + return new FindCursor(this.client, this.namespace, this.cursorFilter, { + ...clonedOptions + }); + } + + override map(transform: (doc: TSchema) => T): FindCursor { + return super.map(transform) as FindCursor; + } + + /** @internal */ + async _initialize(session: ClientSession): Promise { + const options = { + ...this.findOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + session, + signal: this.signal + }; + + if (options.explain) { + try { + validateExplainTimeoutOptions(options, Explain.fromOptions(options)); + } catch { + throw new MongoAPIError( + 'timeoutMS cannot be used with explain when explain is specified in findOptions' + ); + } + } + + const findOperation = new FindOperation(this.namespace, this.cursorFilter, options); + + const response = await executeOperation(this.client, findOperation, this.timeoutContext); + + // the response is not a cursor when `explain` is enabled + this.numReturned = response.batchSize; + + return { server: findOperation.server, session, response }; + } + + /** @internal */ + override async getMore(): Promise { + const numReturned = this.numReturned; + const limit = this.findOptions.limit ?? Infinity; + const remaining = limit - numReturned; + + if (numReturned === limit && !this.id?.isZero()) { + // this is an optimization for the special case of a limit for a find command to avoid an + // extra getMore when the limit has been reached and the limit is a multiple of the batchSize. + // This is a consequence of the new query engine in 5.0 having no knowledge of the limit as it + // produces results for the find command. Once a batch is filled up, it is returned and only + // on the subsequent getMore will the query framework consider the limit, determine the cursor + // is exhausted and return a cursorId of zero. + // instead, if we determine there are no more documents to request from the server, we preemptively + // close the cursor + try { + await this.close(); + } catch (error) { + squashError(error); + } + return CursorResponse.emptyGetMore; + } + + // TODO(DRIVERS-1448): Remove logic to enforce `limit` in the driver + let cleanup: () => void = noop; + const { batchSize } = this.cursorOptions; + if (batchSize != null && batchSize > remaining) { + this.cursorOptions.batchSize = remaining; + + // After executing the final getMore, re-assign the batchSize back to its original value so that + // if the cursor is rewound and executed, the batchSize is still correct. + cleanup = () => { + this.cursorOptions.batchSize = batchSize; + }; + } + + try { + const response = await super.getMore(); + + this.numReturned = this.numReturned + response.batchSize; + + return response; + } finally { + cleanup?.(); + } + } + + /** + * Get the count of documents for this cursor + * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead + */ + async count(options?: CountOptions): Promise { + emitWarningOnce( + 'cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead ' + ); + if (typeof options === 'boolean') { + throw new MongoInvalidArgumentError('Invalid first parameter to count'); + } + return await executeOperation( + this.client, + new CountOperation(this.namespace, this.cursorFilter, { + ...this.findOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...options + }) + ); + } + + /** Execute the explain for the cursor */ + async explain(): Promise; + async explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise; + async explain(options: { timeoutMS?: number }): Promise; + async explain( + verbosity: ExplainVerbosityLike | ExplainCommandOptions, + options: { timeoutMS?: number } + ): Promise; + async explain( + verbosity?: ExplainVerbosityLike | ExplainCommandOptions | { timeoutMS?: number }, + options?: { timeoutMS?: number } + ): Promise { + const { explain, timeout } = this.resolveExplainTimeoutOptions(verbosity, options); + + return ( + await executeOperation( + this.client, + new FindOperation(this.namespace, this.cursorFilter, { + ...this.findOptions, // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...timeout, + explain: explain ?? true + }) + ) + ).shift(this.deserializationOptions); + } + + /** Set the cursor query */ + filter(filter: Document): this { + this.throwIfInitialized(); + this.cursorFilter = filter; + return this; + } + + /** + * Set the cursor hint + * + * @param hint - If specified, then the query system will only consider plans using the hinted index. + */ + hint(hint: Hint): this { + this.throwIfInitialized(); + this.findOptions.hint = hint; + return this; + } + + /** + * Set the cursor min + * + * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order. + */ + min(min: Document): this { + this.throwIfInitialized(); + this.findOptions.min = min; + return this; + } + + /** + * Set the cursor max + * + * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order. + */ + max(max: Document): this { + this.throwIfInitialized(); + this.findOptions.max = max; + return this; + } + + /** + * Set the cursor returnKey. + * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. + * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. + * + * @param value - the returnKey value. + */ + returnKey(value: boolean): this { + this.throwIfInitialized(); + this.findOptions.returnKey = value; + return this; + } + + /** + * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection. + * + * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find. + */ + showRecordId(value: boolean): this { + this.throwIfInitialized(); + this.findOptions.showRecordId = value; + return this; + } + + /** + * Add a query modifier to the cursor query + * + * @param name - The query modifier (must start with $, such as $orderby etc) + * @param value - The modifier value. + */ + addQueryModifier(name: string, value: string | boolean | number | Document): this { + this.throwIfInitialized(); + if (name[0] !== '$') { + throw new MongoInvalidArgumentError(`${name} is not a valid query modifier`); + } + + // Strip of the $ + const field = name.substr(1); + + // NOTE: consider some TS magic for this + switch (field) { + case 'comment': + this.findOptions.comment = value; + break; + + case 'explain': + this.findOptions.explain = value as boolean; + break; + + case 'hint': + this.findOptions.hint = value as string | Document; + break; + + case 'max': + this.findOptions.max = value as Document; + break; + + case 'maxTimeMS': + this.findOptions.maxTimeMS = value as number; + break; + + case 'min': + this.findOptions.min = value as Document; + break; + + case 'orderby': + this.findOptions.sort = formatSort(value as string | Document); + break; + + case 'query': + this.cursorFilter = value as Document; + break; + + case 'returnKey': + this.findOptions.returnKey = value as boolean; + break; + + case 'showDiskLoc': + this.findOptions.showRecordId = value as boolean; + break; + + default: + throw new MongoInvalidArgumentError(`Invalid query modifier: ${name}`); + } + + return this; + } + + /** + * Add a comment to the cursor query allowing for tracking the comment in the log. + * + * @param value - The comment attached to this query. + */ + comment(value: string): this { + this.throwIfInitialized(); + this.findOptions.comment = value; + return this; + } + + /** + * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise) + * + * @param value - Number of milliseconds to wait before aborting the tailed query. + */ + maxAwaitTimeMS(value: number): this { + this.throwIfInitialized(); + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Argument for maxAwaitTimeMS must be a number'); + } + + this.findOptions.maxAwaitTimeMS = value; + return this; + } + + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + override maxTimeMS(value: number): this { + this.throwIfInitialized(); + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + + this.findOptions.maxTimeMS = value; + return this; + } + + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic + * {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: FindCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor<{ a: number; b: string }> = coll.find(); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.find().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project(value: Document): FindCursor { + this.throwIfInitialized(); + this.findOptions.projection = value; + return this as unknown as FindCursor; + } + + /** + * Sets the sort order of the cursor query. + * + * @param sort - The key or keys set for the sort. + * @param direction - The direction of the sorting (1 or -1). + */ + sort(sort: Sort | string, direction?: SortDirection): this { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support sorting'); + } + + this.findOptions.sort = formatSort(sort, direction); + return this; + } + + /** + * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) + * + * @remarks + * {@link https://www.mongodb.com/docs/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation} + */ + allowDiskUse(allow = true): this { + this.throwIfInitialized(); + + if (!this.findOptions.sort) { + throw new MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification'); + } + + // As of 6.0 the default is true. This allows users to get back to the old behavior. + if (!allow) { + this.findOptions.allowDiskUse = false; + return this; + } + + this.findOptions.allowDiskUse = true; + return this; + } + + /** + * Set the collation options for the cursor. + * + * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + */ + collation(value: CollationOptions): this { + this.throwIfInitialized(); + this.findOptions.collation = value; + return this; + } + + /** + * Set the limit for the cursor. + * + * @param value - The limit for the cursor query. + */ + limit(value: number): this { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support limit'); + } + + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Operation "limit" requires an integer'); + } + + this.findOptions.limit = value; + return this; + } + + /** + * Set the skip for the cursor. + * + * @param value - The skip for the cursor query. + */ + skip(value: number): this { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support skip'); + } + + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Operation "skip" requires an integer'); + } + + this.findOptions.skip = value; + return this; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_collections_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_collections_cursor.ts new file mode 100644 index 00000000..bbe0a253 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_collections_cursor.ts @@ -0,0 +1,50 @@ +import type { Document } from '../bson'; +import type { Db } from '../db'; +import { type Abortable } from '../mongo_types'; +import { executeOperation } from '../operations/execute_operation'; +import { + type CollectionInfo, + ListCollectionsOperation, + type ListCollectionsOptions +} from '../operations/list_collections'; +import type { ClientSession } from '../sessions'; +import { AbstractCursor, type InitialCursorResponse } from './abstract_cursor'; + +/** @public */ +export class ListCollectionsCursor< + T extends Pick | CollectionInfo = + | Pick + | CollectionInfo +> extends AbstractCursor { + parent: Db; + filter: Document; + options?: ListCollectionsOptions & Abortable; + + constructor(db: Db, filter: Document, options?: ListCollectionsOptions & Abortable) { + super(db.client, db.s.namespace, options); + this.parent = db; + this.filter = filter; + this.options = options; + } + + clone(): ListCollectionsCursor { + return new ListCollectionsCursor(this.parent, this.filter, { + ...this.options, + ...this.cursorOptions + }); + } + + /** @internal */ + async _initialize(session: ClientSession | undefined): Promise { + const operation = new ListCollectionsOperation(this.parent, this.filter, { + ...this.cursorOptions, + ...this.options, + session, + signal: this.signal + }); + + const response = await executeOperation(this.parent.client, operation, this.timeoutContext); + + return { server: operation.server, session, response }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_indexes_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_indexes_cursor.ts new file mode 100644 index 00000000..0f768f3b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_indexes_cursor.ts @@ -0,0 +1,37 @@ +import type { Collection } from '../collection'; +import { executeOperation } from '../operations/execute_operation'; +import { ListIndexesOperation, type ListIndexesOptions } from '../operations/indexes'; +import type { ClientSession } from '../sessions'; +import { AbstractCursor, type InitialCursorResponse } from './abstract_cursor'; + +/** @public */ +export class ListIndexesCursor extends AbstractCursor { + parent: Collection; + options?: ListIndexesOptions; + + constructor(collection: Collection, options?: ListIndexesOptions) { + super(collection.client, collection.s.namespace, options); + this.parent = collection; + this.options = options; + } + + clone(): ListIndexesCursor { + return new ListIndexesCursor(this.parent, { + ...this.options, + ...this.cursorOptions + }); + } + + /** @internal */ + async _initialize(session: ClientSession | undefined): Promise { + const operation = new ListIndexesOperation(this.parent, { + ...this.cursorOptions, + ...this.options, + session + }); + + const response = await executeOperation(this.parent.client, operation, this.timeoutContext); + + return { server: operation.server, session, response }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_search_indexes_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_search_indexes_cursor.ts new file mode 100644 index 00000000..cfe1358f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/list_search_indexes_cursor.ts @@ -0,0 +1,20 @@ +import type { Collection } from '../collection'; +import type { AggregateOptions } from '../operations/aggregate'; +import { AggregationCursor } from './aggregation_cursor'; + +/** @public */ +export type ListSearchIndexesOptions = Omit; + +/** @public */ +export class ListSearchIndexesCursor extends AggregationCursor<{ name: string }> { + /** @internal */ + constructor( + { fullNamespace: ns, client }: Collection, + name: string | null, + options: ListSearchIndexesOptions = {} + ) { + const pipeline = + name == null ? [{ $listSearchIndexes: {} }] : [{ $listSearchIndexes: { name } }]; + super(client, ns, pipeline, options); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/run_command_cursor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/run_command_cursor.ts new file mode 100644 index 00000000..997fe1ff --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/cursor/run_command_cursor.ts @@ -0,0 +1,178 @@ +import type { BSONSerializeOptions, Document } from '../bson'; +import { type CursorResponse } from '../cmap/wire_protocol/responses'; +import type { Db } from '../db'; +import { MongoAPIError, MongoRuntimeError } from '../error'; +import { executeOperation } from '../operations/execute_operation'; +import { GetMoreOperation } from '../operations/get_more'; +import { RunCursorCommandOperation } from '../operations/run_command'; +import type { ReadConcernLike } from '../read_concern'; +import type { ReadPreferenceLike } from '../read_preference'; +import type { ClientSession } from '../sessions'; +import { ns } from '../utils'; +import { + AbstractCursor, + type CursorTimeoutMode, + type InitialCursorResponse +} from './abstract_cursor'; + +/** @public */ +export type RunCursorCommandOptions = { + readPreference?: ReadPreferenceLike; + session?: ClientSession; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error. Note that if + * `maxTimeMS` is provided in the command in addition to setting `timeoutMS` in the options, then + * the original value of `maxTimeMS` will be overwritten. + */ + timeoutMS?: number; + /** + * @public + * @experimental + * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'` + * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of + * `cursor.next()`. + * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor. + * + * Depending on the type of cursor being used, this option has different default values. + * For non-tailable cursors, this value defaults to `'cursorLifetime'` + * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by + * definition can have an arbitrarily long lifetime. + * + * @example + * ```ts + * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'}); + * for await (const doc of cursor) { + * // process doc + * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but + * // will continue to iterate successfully otherwise, regardless of the number of batches. + * } + * ``` + * + * @example + * ```ts + * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' }); + * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms. + * ``` + */ + timeoutMode?: CursorTimeoutMode; + tailable?: boolean; + awaitData?: boolean; +} & BSONSerializeOptions; + +/** @public */ +export class RunCommandCursor extends AbstractCursor { + public readonly command: Readonly>; + public readonly getMoreOptions: { + comment?: any; + maxAwaitTimeMS?: number; + batchSize?: number; + } = {}; + + /** + * Controls the `getMore.comment` field + * @param comment - any BSON value + */ + public setComment(comment: any): this { + this.getMoreOptions.comment = comment; + return this; + } + + /** + * Controls the `getMore.maxTimeMS` field. Only valid when cursor is tailable await + * @param maxTimeMS - the number of milliseconds to wait for new data + */ + public setMaxTimeMS(maxTimeMS: number): this { + this.getMoreOptions.maxAwaitTimeMS = maxTimeMS; + return this; + } + + /** + * Controls the `getMore.batchSize` field + * @param batchSize - the number documents to return in the `nextBatch` + */ + public setBatchSize(batchSize: number): this { + this.getMoreOptions.batchSize = batchSize; + return this; + } + + /** Unsupported for RunCommandCursor */ + public override clone(): never { + throw new MongoAPIError('Clone not supported, create a new cursor with db.runCursorCommand'); + } + + /** Unsupported for RunCommandCursor: readConcern must be configured directly on command document */ + public override withReadConcern(_: ReadConcernLike): never { + throw new MongoAPIError( + 'RunCommandCursor does not support readConcern it must be attached to the command being run' + ); + } + + /** Unsupported for RunCommandCursor: various cursor flags must be configured directly on command document */ + public override addCursorFlag(_: string, __: boolean): never { + throw new MongoAPIError( + 'RunCommandCursor does not support cursor flags, they must be attached to the command being run' + ); + } + + /** + * Unsupported for RunCommandCursor: maxTimeMS must be configured directly on command document + */ + public override maxTimeMS(_: number): never { + throw new MongoAPIError( + 'maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()' + ); + } + + /** Unsupported for RunCommandCursor: batchSize must be configured directly on command document */ + public override batchSize(_: number): never { + throw new MongoAPIError( + 'batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()' + ); + } + + /** @internal */ + private db: Db; + + /** @internal */ + constructor(db: Db, command: Document, options: RunCursorCommandOptions = {}) { + super(db.client, ns(db.namespace), options); + this.db = db; + this.command = Object.freeze({ ...command }); + } + + /** @internal */ + protected async _initialize(session: ClientSession): Promise { + const operation = new RunCursorCommandOperation(this.db.s.namespace, this.command, { + ...this.cursorOptions, + session: session, + readPreference: this.cursorOptions.readPreference + }); + + const response = await executeOperation(this.client, operation, this.timeoutContext); + + return { + server: operation.server, + session, + response + }; + } + + /** @internal */ + override async getMore(): Promise { + if (!this.session) { + throw new MongoRuntimeError( + 'Unexpected null session. A cursor creating command should have set this' + ); + } + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const getMoreOperation = new GetMoreOperation(this.namespace, this.id!, this.server!, { + ...this.cursorOptions, + session: this.session, + ...this.getMoreOptions + }); + + return await executeOperation(this.client, getMoreOperation, this.timeoutContext); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/db.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/db.ts new file mode 100644 index 00000000..0907b6f0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/db.ts @@ -0,0 +1,621 @@ +import { Admin } from './admin'; +import { type BSONSerializeOptions, type Document, resolveBSONOptions } from './bson'; +import { ChangeStream, type ChangeStreamDocument, type ChangeStreamOptions } from './change_stream'; +import { Collection, type CollectionOptions } from './collection'; +import * as CONSTANTS from './constants'; +import { AggregationCursor } from './cursor/aggregation_cursor'; +import { ListCollectionsCursor } from './cursor/list_collections_cursor'; +import { RunCommandCursor, type RunCursorCommandOptions } from './cursor/run_command_cursor'; +import { MongoInvalidArgumentError } from './error'; +import type { MongoClient, PkFactory } from './mongo_client'; +import type { Abortable, TODO_NODE_3286 } from './mongo_types'; +import type { AggregateOptions } from './operations/aggregate'; +import { type CreateCollectionOptions, createCollections } from './operations/create_collection'; +import { + type DropCollectionOptions, + dropCollections, + DropDatabaseOperation, + type DropDatabaseOptions +} from './operations/drop'; +import { executeOperation } from './operations/execute_operation'; +import { + CreateIndexesOperation, + type CreateIndexesOptions, + type IndexDescriptionCompact, + type IndexDescriptionInfo, + type IndexInformationOptions, + type IndexSpecification +} from './operations/indexes'; +import type { CollectionInfo, ListCollectionsOptions } from './operations/list_collections'; +import { ProfilingLevelOperation, type ProfilingLevelOptions } from './operations/profiling_level'; +import { RemoveUserOperation, type RemoveUserOptions } from './operations/remove_user'; +import { RenameOperation, type RenameOptions } from './operations/rename'; +import { RunCommandOperation, type RunCommandOptions } from './operations/run_command'; +import { + type ProfilingLevel, + SetProfilingLevelOperation, + type SetProfilingLevelOptions +} from './operations/set_profiling_level'; +import { DbStatsOperation, type DbStatsOptions } from './operations/stats'; +import { ReadConcern } from './read_concern'; +import { ReadPreference, type ReadPreferenceLike } from './read_preference'; +import { DEFAULT_PK_FACTORY, filterOptions, MongoDBNamespace, resolveOptions } from './utils'; +import { WriteConcern, type WriteConcernOptions } from './write_concern'; + +// Allowed parameters +const DB_OPTIONS_ALLOW_LIST = [ + 'writeConcern', + 'readPreference', + 'readPreferenceTags', + 'native_parser', + 'forceServerObjectId', + 'pkFactory', + 'serializeFunctions', + 'raw', + 'authSource', + 'ignoreUndefined', + 'readConcern', + 'retryMiliSeconds', + 'numberOfRetries', + 'useBigInt64', + 'promoteBuffers', + 'promoteLongs', + 'bsonRegExp', + 'enableUtf8Validation', + 'promoteValues', + 'compression', + 'retryWrites', + 'timeoutMS' +]; + +/** @internal */ +export interface DbPrivate { + options?: DbOptions; + readPreference?: ReadPreference; + pkFactory: PkFactory; + readConcern?: ReadConcern; + bsonOptions: BSONSerializeOptions; + writeConcern?: WriteConcern; + namespace: MongoDBNamespace; +} + +/** @public */ +export interface DbOptions extends BSONSerializeOptions, WriteConcernOptions { + /** If the database authentication is dependent on another databaseName. */ + authSource?: string; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; + /** A primary key factory object for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcern; + /** Should retry failed writes */ + retryWrites?: boolean; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/** + * The **Db** class is a class that represents a MongoDB Database. + * @public + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * + * interface Pet { + * name: string; + * kind: 'dog' | 'cat' | 'fish'; + * } + * + * const client = new MongoClient('mongodb://localhost:27017'); + * const db = client.db(); + * + * // Create a collection that validates our union + * await db.createCollection('pets', { + * validator: { $expr: { $in: ['$kind', ['dog', 'cat', 'fish']] } } + * }) + * ``` + */ +export class Db { + /** @internal */ + s: DbPrivate; + + /** + * Gets the MongoClient associated with the Db. + * @public + */ + readonly client: MongoClient; + + public static SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION; + public static SYSTEM_INDEX_COLLECTION = CONSTANTS.SYSTEM_INDEX_COLLECTION; + public static SYSTEM_PROFILE_COLLECTION = CONSTANTS.SYSTEM_PROFILE_COLLECTION; + public static SYSTEM_USER_COLLECTION = CONSTANTS.SYSTEM_USER_COLLECTION; + public static SYSTEM_COMMAND_COLLECTION = CONSTANTS.SYSTEM_COMMAND_COLLECTION; + public static SYSTEM_JS_COLLECTION = CONSTANTS.SYSTEM_JS_COLLECTION; + + /** + * Creates a new Db instance. + * + * Db name cannot contain a dot, the server may apply more restrictions when an operation is run. + * + * @param client - The MongoClient for the database. + * @param databaseName - The name of the database this instance represents. + * @param options - Optional settings for Db construction. + */ + constructor(client: MongoClient, databaseName: string, options?: DbOptions) { + options = options ?? {}; + + // Filter the options + options = filterOptions(options, DB_OPTIONS_ALLOW_LIST); + + // Ensure there are no dots in database name + if (typeof databaseName === 'string' && databaseName.includes('.')) { + throw new MongoInvalidArgumentError(`Database names cannot contain the character '.'`); + } + + // Internal state of the db object + this.s = { + // Options + options, + // Unpack read preference + readPreference: ReadPreference.fromOptions(options), + // Merge bson options + bsonOptions: resolveBSONOptions(options, client), + // Set up the primary key factory or fallback to ObjectId + pkFactory: options?.pkFactory ?? DEFAULT_PK_FACTORY, + // ReadConcern + readConcern: ReadConcern.fromOptions(options), + writeConcern: WriteConcern.fromOptions(options), + // Namespace + namespace: new MongoDBNamespace(databaseName) + }; + + this.client = client; + } + + get databaseName(): string { + return this.s.namespace.db; + } + + // Options + get options(): DbOptions | undefined { + return this.s.options; + } + + /** + * Check if a secondary can be used (because the read preference is *not* set to primary) + */ + get secondaryOk(): boolean { + return this.s.readPreference?.preference !== 'primary' || false; + } + + get readConcern(): ReadConcern | undefined { + return this.s.readConcern; + } + + /** + * The current readPreference of the Db. If not explicitly defined for + * this Db, will be inherited from the parent MongoClient + */ + get readPreference(): ReadPreference { + if (this.s.readPreference == null) { + return this.client.readPreference; + } + + return this.s.readPreference; + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + // get the write Concern + get writeConcern(): WriteConcern | undefined { + return this.s.writeConcern; + } + + get namespace(): string { + return this.s.namespace.toString(); + } + + public get timeoutMS(): number | undefined { + return this.s.options?.timeoutMS; + } + + /** + * Create a new collection on a server with the specified options. Use this to create capped collections. + * More information about command options available at https://www.mongodb.com/docs/manual/reference/command/create/ + * + * Collection namespace validation is performed server-side. + * + * @param name - The name of the collection to create + * @param options - Optional settings for the command + */ + async createCollection( + name: string, + options?: CreateCollectionOptions + ): Promise> { + options = resolveOptions(this, options); + return await createCollections(this, name, options); + } + + /** + * Execute a command + * + * @remarks + * This command does not inherit options from the MongoClient. + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to run + * @param options - Optional settings for the command + */ + async command(command: Document, options?: RunCommandOptions & Abortable): Promise { + // Intentionally, we do not inherit options from parent for this operation. + return await executeOperation( + this.client, + new RunCommandOperation( + this.s.namespace, + command, + resolveOptions(undefined, { + ...resolveBSONOptions(options), + timeoutMS: options?.timeoutMS ?? this.timeoutMS, + session: options?.session, + readPreference: options?.readPreference, + signal: options?.signal + }) + ) + ); + } + + /** + * Execute an aggregation framework pipeline against the database. + * + * @param pipeline - An array of aggregation stages to be executed + * @param options - Optional settings for the command + */ + aggregate( + pipeline: Document[] = [], + options?: AggregateOptions + ): AggregationCursor { + return new AggregationCursor( + this.client, + this.s.namespace, + pipeline, + resolveOptions(this, options) + ); + } + + /** Return the Admin db instance */ + admin(): Admin { + return new Admin(this); + } + + /** + * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly. + * + * Collection namespace validation is performed server-side. + * + * @param name - the collection name we wish to access. + * @returns return the new Collection instance + */ + collection( + name: string, + options: CollectionOptions = {} + ): Collection { + if (typeof options === 'function') { + throw new MongoInvalidArgumentError('The callback form of this helper has been removed.'); + } + return new Collection(this, name, resolveOptions(this, options)); + } + + /** + * Get all the db statistics. + * + * @param options - Optional settings for the command + */ + async stats(options?: DbStatsOptions): Promise { + return await executeOperation( + this.client, + new DbStatsOperation(this, resolveOptions(this, options)) + ); + } + + /** + * List all collections of this database with optional filter + * + * @param filter - Query to filter collections by + * @param options - Optional settings for the command + */ + listCollections( + filter: Document, + options: Exclude & { nameOnly: true } & Abortable + ): ListCollectionsCursor>; + listCollections( + filter: Document, + options: Exclude & { nameOnly: false } & Abortable + ): ListCollectionsCursor; + listCollections< + T extends Pick | CollectionInfo = + | Pick + | CollectionInfo + >(filter?: Document, options?: ListCollectionsOptions & Abortable): ListCollectionsCursor; + listCollections< + T extends Pick | CollectionInfo = + | Pick + | CollectionInfo + >( + filter: Document = {}, + options: ListCollectionsOptions & Abortable = {} + ): ListCollectionsCursor { + return new ListCollectionsCursor(this, filter, resolveOptions(this, options)); + } + + /** + * Rename a collection. + * + * @remarks + * This operation does not inherit options from the MongoClient. + * + * @param fromCollection - Name of current collection to rename + * @param toCollection - New name of of the collection + * @param options - Optional settings for the command + */ + async renameCollection( + fromCollection: string, + toCollection: string, + options?: RenameOptions + ): Promise> { + // Intentionally, we do not inherit options from parent for this operation. + return await executeOperation( + this.client, + new RenameOperation( + this.collection(fromCollection) as TODO_NODE_3286, + toCollection, + resolveOptions(undefined, { + ...options, + readPreference: ReadPreference.primary + }) + ) as TODO_NODE_3286 + ); + } + + /** + * Drop a collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param name - Name of collection to drop + * @param options - Optional settings for the command + */ + async dropCollection(name: string, options?: DropCollectionOptions): Promise { + options = resolveOptions(this, options); + return await dropCollections(this, name, options); + } + + /** + * Drop a database, removing it permanently from the server. + * + * @param options - Optional settings for the command + */ + async dropDatabase(options?: DropDatabaseOptions): Promise { + return await executeOperation( + this.client, + new DropDatabaseOperation(this, resolveOptions(this, options)) + ); + } + + /** + * Fetch all collections for the current db. + * + * @param options - Optional settings for the command + */ + async collections(options?: ListCollectionsOptions): Promise { + options = resolveOptions(this, options); + const collections = await this.listCollections({}, { ...options, nameOnly: true }).toArray(); + + return collections + .filter( + // Filter collections removing any illegal ones + ({ name }) => !name.includes('$') + ) + .map(({ name }) => new Collection(this, name, this.s.options)); + } + + /** + * Creates an index on the db and collection. + * + * @param name - Name of the collection to create the index on. + * @param indexSpec - Specify the field to index, or an index specification + * @param options - Optional settings for the command + */ + async createIndex( + name: string, + indexSpec: IndexSpecification, + options?: CreateIndexesOptions + ): Promise { + const indexes = await executeOperation( + this.client, + CreateIndexesOperation.fromIndexSpecification(this, name, indexSpec, options) + ); + return indexes[0]; + } + + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + async removeUser(username: string, options?: RemoveUserOptions): Promise { + return await executeOperation( + this.client, + new RemoveUserOperation(this, username, resolveOptions(this, options)) + ); + } + + /** + * Set the current profiling level of MongoDB + * + * @param level - The new profiling level (off, slow_only, all). + * @param options - Optional settings for the command + */ + async setProfilingLevel( + level: ProfilingLevel, + options?: SetProfilingLevelOptions + ): Promise { + return await executeOperation( + this.client, + new SetProfilingLevelOperation(this, level, resolveOptions(this, options)) + ); + } + + /** + * Retrieve the current profiling Level for MongoDB + * + * @param options - Optional settings for the command + */ + async profilingLevel(options?: ProfilingLevelOptions): Promise { + return await executeOperation( + this.client, + new ProfilingLevelOperation(this, resolveOptions(this, options)) + ); + } + + /** + * Retrieves this collections index info. + * + * @param name - The name of the collection. + * @param options - Optional settings for the command + */ + indexInformation( + name: string, + options: IndexInformationOptions & { full: true } + ): Promise; + indexInformation( + name: string, + options: IndexInformationOptions & { full?: false } + ): Promise; + indexInformation( + name: string, + options: IndexInformationOptions + ): Promise; + indexInformation(name: string): Promise; + async indexInformation( + name: string, + options?: IndexInformationOptions + ): Promise { + return await this.collection(name).indexInformation(resolveOptions(this, options)); + } + + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this database. Will ignore all + * changes to system collections. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the collections within this database + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument + >(pipeline: Document[] = [], options: ChangeStreamOptions = {}): ChangeStream { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + + return new ChangeStream(this, pipeline, resolveOptions(this, options)); + } + + /** + * A low level cursor API providing basic driver functionality: + * - ClientSession management + * - ReadPreference for server selection + * - Running getMores automatically when a local batch is exhausted + * + * @param command - The command that will start a cursor on the server. + * @param options - Configurations for running the command, bson options will apply to getMores + */ + runCursorCommand(command: Document, options?: RunCursorCommandOptions): RunCommandCursor { + return new RunCommandCursor(this, command, options); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/deps.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/deps.ts new file mode 100644 index 00000000..fc92beda --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/deps.ts @@ -0,0 +1,227 @@ +import { type Stream } from './cmap/connect'; +import { MongoMissingDependencyError } from './error'; +import type { Callback } from './utils'; + +function makeErrorModule(error: any) { + const props = error ? { kModuleError: error } : {}; + return new Proxy(props, { + get: (_: any, key: any) => { + if (key === 'kModuleError') { + return error; + } + throw error; + }, + set: () => { + throw error; + } + }); +} + +export type Kerberos = typeof import('kerberos') | { kModuleError: MongoMissingDependencyError }; + +export function getKerberos(): Kerberos { + let kerberos: Kerberos; + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + kerberos = require('kerberos'); + } catch (error) { + kerberos = makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `kerberos` not found. Please install it to enable kerberos authentication', + { cause: error, dependencyName: 'kerberos' } + ) + ); + } + return kerberos; +} + +export interface KerberosClient { + step(challenge: string): Promise; + step(challenge: string, callback: Callback): void; + wrap(challenge: string, options: { user: string }): Promise; + wrap(challenge: string, options: { user: string }, callback: Callback): void; + unwrap(challenge: string): Promise; + unwrap(challenge: string, callback: Callback): void; +} + +type ZStandardLib = { + /** + * Compress using zstd. + * @param buf - Buffer to be compressed. + */ + compress(buf: Uint8Array, level?: number): Promise; + + /** + * Decompress using zstd. + */ + decompress(buf: Uint8Array): Promise; +}; + +export type ZStandard = ZStandardLib | { kModuleError: MongoMissingDependencyError }; + +export function getZstdLibrary(): ZStandardLib | { kModuleError: MongoMissingDependencyError } { + let ZStandard: ZStandardLib | { kModuleError: MongoMissingDependencyError }; + try { + // eslint-disable-next-line @typescript-eslint/no-require-imports + ZStandard = require('@mongodb-js/zstd'); + } catch (error) { + ZStandard = makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression', + { cause: error, dependencyName: 'zstd' } + ) + ); + } + + return ZStandard; +} + +/** + * @public + * Copy of the AwsCredentialIdentityProvider interface from [`smithy/types`](https://socket.dev/npm/package/\@smithy/types/files/1.1.1/dist-types/identity/awsCredentialIdentity.d.ts), + * the return type of the aws-sdk's `fromNodeProviderChain().provider()`. + */ +export interface AWSCredentials { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; + expiration?: Date; +} + +type CredentialProvider = { + fromNodeProviderChain( + this: void, + options: { clientConfig: { region: string } } + ): () => Promise; + fromNodeProviderChain(this: void): () => Promise; +}; + +export function getAwsCredentialProvider(): + | CredentialProvider + | { kModuleError: MongoMissingDependencyError } { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const credentialProvider = require('@aws-sdk/credential-providers'); + return credentialProvider; + } catch (error) { + return makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `@aws-sdk/credential-providers` not found.' + + ' Please install it to enable getting aws credentials via the official sdk.', + { cause: error, dependencyName: '@aws-sdk/credential-providers' } + ) + ); + } +} + +/** @internal */ +export type GcpMetadata = + | typeof import('gcp-metadata') + | { kModuleError: MongoMissingDependencyError }; + +export function getGcpMetadata(): GcpMetadata { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const credentialProvider = require('gcp-metadata'); + return credentialProvider; + } catch (error) { + return makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `gcp-metadata` not found.' + + ' Please install it to enable getting gcp credentials via the official sdk.', + { cause: error, dependencyName: 'gcp-metadata' } + ) + ); + } +} + +/** @internal */ +export type SnappyLib = { + /** + * In order to support both we must check the return value of the function + * @param buf - Buffer to be compressed + */ + compress(buf: Uint8Array): Promise; + + /** + * In order to support both we must check the return value of the function + * @param buf - Buffer to be compressed + */ + uncompress(buf: Uint8Array, opt: { asBuffer: true }): Promise; +}; + +export function getSnappy(): SnappyLib | { kModuleError: MongoMissingDependencyError } { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const value = require('snappy'); + return value; + } catch (error) { + const kModuleError = new MongoMissingDependencyError( + 'Optional module `snappy` not found. Please install it to enable snappy compression', + { cause: error, dependencyName: 'snappy' } + ); + return { kModuleError }; + } +} + +export type SocksLib = { + SocksClient: { + createConnection(options: { + command: 'connect'; + destination: { host: string; port: number }; + proxy: { + /** host and port are ignored because we pass existing_socket */ + host: 'iLoveJavaScript'; + port: 0; + type: 5; + userId?: string; + password?: string; + }; + timeout?: number; + /** We always create our own socket, and pass it to this API for proxy negotiation */ + existing_socket: Stream; + }): Promise<{ socket: Stream }>; + }; +}; + +export function getSocks(): SocksLib | { kModuleError: MongoMissingDependencyError } { + try { + // Ensure you always wrap an optional require in the try block NODE-3199 + // eslint-disable-next-line @typescript-eslint/no-require-imports + const value = require('socks'); + return value; + } catch (error) { + const kModuleError = new MongoMissingDependencyError( + 'Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy', + { cause: error, dependencyName: 'socks' } + ); + return { kModuleError }; + } +} + +/** A utility function to get the instance of mongodb-client-encryption, if it exists. */ +export function getMongoDBClientEncryption(): + | typeof import('mongodb-client-encryption') + | { kModuleError: MongoMissingDependencyError } { + let mongodbClientEncryption = null; + + try { + // NOTE(NODE-3199): Ensure you always wrap an optional require literally in the try block + // Cannot be moved to helper utility function, bundlers search and replace the actual require call + // in a way that makes this line throw at bundle time, not runtime, catching here will make bundling succeed + // eslint-disable-next-line @typescript-eslint/no-require-imports + mongodbClientEncryption = require('mongodb-client-encryption'); + } catch (error) { + const kModuleError = new MongoMissingDependencyError( + 'Optional module `mongodb-client-encryption` not found. Please install it to use auto encryption or ClientEncryption.', + { cause: error, dependencyName: 'mongodb-client-encryption' } + ); + return { kModuleError }; + } + + return mongodbClientEncryption; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/encrypter.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/encrypter.ts new file mode 100644 index 00000000..5a627ea6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/encrypter.ts @@ -0,0 +1,127 @@ +import { AutoEncrypter, type AutoEncryptionOptions } from './client-side-encryption/auto_encrypter'; +import { MONGO_CLIENT_EVENTS } from './constants'; +import { getMongoDBClientEncryption } from './deps'; +import { MongoInvalidArgumentError, MongoMissingDependencyError } from './error'; +import { MongoClient, type MongoClientOptions } from './mongo_client'; + +/** @internal */ +export interface EncrypterOptions { + autoEncryption: AutoEncryptionOptions; + maxPoolSize?: number; +} + +/** @internal */ +export class Encrypter { + private internalClient: MongoClient | null; + bypassAutoEncryption: boolean; + needsConnecting: boolean; + autoEncrypter: AutoEncrypter; + + constructor(client: MongoClient, uri: string, options: MongoClientOptions) { + if (typeof options.autoEncryption !== 'object') { + throw new MongoInvalidArgumentError('Option "autoEncryption" must be specified'); + } + // initialize to null, if we call getInternalClient, we may set this it is important to not overwrite those function calls. + this.internalClient = null; + + this.bypassAutoEncryption = !!options.autoEncryption.bypassAutoEncryption; + this.needsConnecting = false; + + if (options.maxPoolSize === 0 && options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = client; + } else if (options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = this.getInternalClient(client, uri, options); + } + + if (this.bypassAutoEncryption) { + options.autoEncryption.metadataClient = undefined; + } else if (options.maxPoolSize === 0) { + options.autoEncryption.metadataClient = client; + } else { + options.autoEncryption.metadataClient = this.getInternalClient(client, uri, options); + } + + if (options.proxyHost) { + options.autoEncryption.proxyOptions = { + proxyHost: options.proxyHost, + proxyPort: options.proxyPort, + proxyUsername: options.proxyUsername, + proxyPassword: options.proxyPassword + }; + } + + this.autoEncrypter = new AutoEncrypter(client, options.autoEncryption); + } + + getInternalClient(client: MongoClient, uri: string, options: MongoClientOptions): MongoClient { + let internalClient = this.internalClient; + if (internalClient == null) { + const clonedOptions: MongoClientOptions = {}; + + for (const key of [ + ...Object.getOwnPropertyNames(options), + ...Object.getOwnPropertySymbols(options) + ] as string[]) { + if (['autoEncryption', 'minPoolSize', 'servers', 'caseTranslate', 'dbName'].includes(key)) + continue; + Reflect.set(clonedOptions, key, Reflect.get(options, key)); + } + + clonedOptions.minPoolSize = 0; + + internalClient = new MongoClient(uri, clonedOptions); + this.internalClient = internalClient; + + for (const eventName of MONGO_CLIENT_EVENTS) { + for (const listener of client.listeners(eventName)) { + internalClient.on(eventName, listener); + } + } + + client.on('newListener', (eventName, listener) => { + internalClient?.on(eventName, listener); + }); + + this.needsConnecting = true; + } + return internalClient; + } + + async connectInternalClient(): Promise { + const internalClient = this.internalClient; + if (this.needsConnecting && internalClient != null) { + this.needsConnecting = false; + await internalClient.connect(); + } + } + + async close(client: MongoClient): Promise { + let error; + try { + await this.autoEncrypter.close(); + } catch (autoEncrypterError) { + error = autoEncrypterError; + } + const internalClient = this.internalClient; + if (internalClient != null && client !== internalClient) { + return await internalClient.close(); + } + if (error != null) { + throw error; + } + } + + static checkForMongoCrypt(): void { + const mongodbClientEncryption = getMongoDBClientEncryption(); + if ('kModuleError' in mongodbClientEncryption) { + throw new MongoMissingDependencyError( + 'Auto-encryption requested, but the module is not installed. ' + + 'Please add `mongodb-client-encryption` as a dependency of your project', + { + cause: mongodbClientEncryption['kModuleError'], + dependencyName: 'mongodb-client-encryption' + } + ); + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/error.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/error.ts new file mode 100644 index 00000000..37979e87 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/error.ts @@ -0,0 +1,1555 @@ +import type { Document } from './bson'; +import { + type ClientBulkWriteError, + type ClientBulkWriteResult +} from './operations/client_bulk_write/common'; +import type { TopologyVersion } from './sdam/server_description'; +import type { TopologyDescription } from './sdam/topology_description'; + +/** @public */ +export type AnyError = MongoError | Error; + +/** + * @internal + * The legacy error message from the server that indicates the node is not a writable primary + * https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +export const LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = new RegExp('not master', 'i'); + +/** + * @internal + * The legacy error message from the server that indicates the node is not a primary or secondary + * https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +export const LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = new RegExp( + 'not master or secondary', + 'i' +); + +/** + * @internal + * The error message from the server that indicates the node is recovering + * https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +export const NODE_IS_RECOVERING_ERROR_MESSAGE = new RegExp('node is recovering', 'i'); + +/** @internal MongoDB Error Codes */ +export const MONGODB_ERROR_CODES = Object.freeze({ + HostUnreachable: 6, + HostNotFound: 7, + AuthenticationFailed: 18, + NetworkTimeout: 89, + ShutdownInProgress: 91, + PrimarySteppedDown: 189, + ExceededTimeLimit: 262, + SocketException: 9001, + NotWritablePrimary: 10107, + InterruptedAtShutdown: 11600, + InterruptedDueToReplStateChange: 11602, + NotPrimaryNoSecondaryOk: 13435, + NotPrimaryOrSecondary: 13436, + StaleShardVersion: 63, + StaleEpoch: 150, + StaleConfig: 13388, + RetryChangeStream: 234, + FailedToSatisfyReadPreference: 133, + CursorNotFound: 43, + LegacyNotPrimary: 10058, + // WriteConcernTimeout is WriteConcernFailed on pre-8.1 servers + WriteConcernTimeout: 64, + NamespaceNotFound: 26, + IllegalOperation: 20, + MaxTimeMSExpired: 50, + UnknownReplWriteConcern: 79, + UnsatisfiableWriteConcern: 100, + Reauthenticate: 391, + ReadConcernMajorityNotAvailableYet: 134 +} as const); + +// From spec https://github.com/mongodb/specifications/blob/921232976f9913cf17415b5ef937ee772e45e6ae/source/change-streams/change-streams.md#resumable-error +export const GET_MORE_RESUMABLE_CODES = new Set([ + MONGODB_ERROR_CODES.HostUnreachable, + MONGODB_ERROR_CODES.HostNotFound, + MONGODB_ERROR_CODES.NetworkTimeout, + MONGODB_ERROR_CODES.ShutdownInProgress, + MONGODB_ERROR_CODES.PrimarySteppedDown, + MONGODB_ERROR_CODES.ExceededTimeLimit, + MONGODB_ERROR_CODES.SocketException, + MONGODB_ERROR_CODES.NotWritablePrimary, + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + MONGODB_ERROR_CODES.StaleShardVersion, + MONGODB_ERROR_CODES.StaleEpoch, + MONGODB_ERROR_CODES.StaleConfig, + MONGODB_ERROR_CODES.RetryChangeStream, + MONGODB_ERROR_CODES.FailedToSatisfyReadPreference, + MONGODB_ERROR_CODES.CursorNotFound +]); + +/** @public */ +export const MongoErrorLabel = Object.freeze({ + RetryableWriteError: 'RetryableWriteError', + TransientTransactionError: 'TransientTransactionError', + UnknownTransactionCommitResult: 'UnknownTransactionCommitResult', + ResumableChangeStreamError: 'ResumableChangeStreamError', + HandshakeError: 'HandshakeError', + ResetPool: 'ResetPool', + PoolRequestedRetry: 'PoolRequestedRetry', + InterruptInUseConnections: 'InterruptInUseConnections', + NoWritesPerformed: 'NoWritesPerformed', + RetryableError: 'RetryableError', + SystemOverloadedError: 'SystemOverloadedError' +} as const); + +/** @public */ +export type MongoErrorLabel = (typeof MongoErrorLabel)[keyof typeof MongoErrorLabel]; + +/** @public */ +export interface ErrorDescription extends Document { + message?: string; + errmsg?: string; + $err?: string; + errorLabels?: string[]; + errInfo?: Document; +} + +function isAggregateError(e: unknown): e is Error & { errors: Error[] } { + return e != null && typeof e === 'object' && 'errors' in e && Array.isArray(e.errors); +} + +/** + * @public + * @category Error + * + * @privateRemarks + * mongodb-client-encryption has a dependency on this error, it uses the constructor with a string argument + */ +export class MongoError extends Error { + /** @internal */ + private readonly errorLabelSet: Set = new Set(); + public get errorLabels(): string[] { + return Array.from(this.errorLabelSet); + } + + /** + * This is a number in MongoServerError and a string in MongoDriverError + * @privateRemarks + * Define the type override on the subclasses when we can use the override keyword + */ + code?: number | string; + topologyVersion?: TopologyVersion; + connectionGeneration?: number; + override cause?: Error; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + /** @internal */ + static buildErrorMessage(e: unknown): string { + if (typeof e === 'string') { + return e; + } + if (isAggregateError(e) && e.message.length === 0) { + return e.errors.length === 0 + ? 'AggregateError has an empty errors array. Please check the `cause` property for more information.' + : e.errors.map(({ message }) => message).join(', '); + } + + return e != null && typeof e === 'object' && 'message' in e && typeof e.message === 'string' + ? e.message + : 'empty error message'; + } + + override get name(): string { + return 'MongoError'; + } + + /** Legacy name for server error responses */ + get errmsg(): string { + return this.message; + } + + /** + * Checks the error to see if it has an error label + * + * @param label - The error label to check for + * @returns returns true if the error has the provided error label + */ + hasErrorLabel(label: string): boolean { + return this.errorLabelSet.has(label); + } + + addErrorLabel(label: string): void { + this.errorLabelSet.add(label); + } +} + +/** + * An error coming from the mongo server + * + * @public + * @category Error + */ +export class MongoServerError extends MongoError { + /** Raw error result document returned by server. */ + errorResponse: ErrorDescription; + codeName?: string; + writeConcernError?: Document; + errInfo?: Document; + ok?: number; + [key: string]: any; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: ErrorDescription) { + super(message.message || message.errmsg || message.$err || 'n/a'); + + if (message.errorLabels) { + for (const label of message.errorLabels) this.addErrorLabel(label); + } + + this.errorResponse = message; + + for (const name in message) { + if ( + name !== 'errorLabels' && + name !== 'errmsg' && + name !== 'message' && + name !== 'errorResponse' + ) { + this[name] = message[name]; + } + } + } + + override get name(): string { + return 'MongoServerError'; + } +} + +/** + * An error generated by the driver + * + * @public + * @category Error + */ +export class MongoDriverError extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + override get name(): string { + return 'MongoDriverError'; + } +} + +/** + * An error generated when the driver API is used incorrectly + * + * @privateRemarks + * Should **never** be directly instantiated + * + * @public + * @category Error + */ + +export class MongoAPIError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + override get name(): string { + return 'MongoAPIError'; + } +} + +/** + * An error generated when the driver encounters unexpected input + * or reaches an unexpected/invalid internal state. + * + * @privateRemarks + * Should **never** be directly instantiated. + * + * @public + * @category Error + */ +export class MongoRuntimeError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + override get name(): string { + return 'MongoRuntimeError'; + } +} + +/** + * An error generated when a primary server is marked stale, never directly thrown + * + * @public + * @category Error + */ +export class MongoStalePrimaryError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + override get name(): string { + return 'MongoStalePrimaryError'; + } +} + +/** + * An error generated when a batch command is re-executed after one of the commands in the batch + * has failed + * + * @public + * @category Error + */ +export class MongoBatchReExecutionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'This batch has already been executed, create new batch to execute') { + super(message); + } + + override get name(): string { + return 'MongoBatchReExecutionError'; + } +} + +/** + * An error generated when the driver fails to decompress + * data received from the server. + * + * @public + * @category Error + */ +export class MongoDecompressionError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoDecompressionError'; + } +} + +/** + * An error thrown when the user attempts to operate on a database or collection through a MongoClient + * that has not yet successfully called the "connect" method + * + * @public + * @category Error + */ +export class MongoNotConnectedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoNotConnectedError'; + } +} + +/** + * An error generated when the user makes a mistake in the usage of transactions. + * (e.g. attempting to commit a transaction with a readPreference other than primary) + * + * @public + * @category Error + */ +export class MongoTransactionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoTransactionError'; + } +} + +/** + * An error generated when the user attempts to operate + * on a session that has expired or has been closed. + * + * @public + * @category Error + */ +export class MongoExpiredSessionError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Cannot use a session that has ended') { + super(message); + } + + override get name(): string { + return 'MongoExpiredSessionError'; + } +} + +/** + * A error generated when the user attempts to authenticate + * via Kerberos, but fails to connect to the Kerberos client. + * + * @public + * @category Error + */ +export class MongoKerberosError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoKerberosError'; + } +} + +/** + * A error generated when the user attempts to authenticate + * via AWS, but fails + * + * @public + * @category Error + */ +export class MongoAWSError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + override get name(): string { + return 'MongoAWSError'; + } +} + +/** + * A error generated when the user attempts to authenticate + * via OIDC callbacks, but fails. + * + * @public + * @category Error + */ +export class MongoOIDCError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoOIDCError'; + } +} + +/** + * A error generated when the user attempts to authenticate + * via Azure, but fails. + * + * @public + * @category Error + */ +export class MongoAzureError extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoAzureError'; + } +} + +/** + * A error generated when the user attempts to authenticate + * via GCP, but fails. + * + * @public + * @category Error + */ +export class MongoGCPError extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoGCPError'; + } +} + +/** + * An error indicating that an error occurred when executing the bulk write. + * + * @public + * @category Error + */ +export class MongoClientBulkWriteError extends MongoServerError { + /** + * Write concern errors that occurred while executing the bulk write. This list may have + * multiple items if more than one server command was required to execute the bulk write. + */ + writeConcernErrors: Document[]; + /** + * Errors that occurred during the execution of individual write operations. This map will + * contain at most one entry if the bulk write was ordered. + */ + writeErrors: Map; + /** + * The results of any successful operations that were performed before the error was + * encountered. + */ + partialResult?: ClientBulkWriteResult; + + /** + * Initialize the client bulk write error. + * @param message - The error message. + */ + constructor(message: ErrorDescription) { + super(message); + this.writeConcernErrors = []; + this.writeErrors = new Map(); + } + + override get name(): string { + return 'MongoClientBulkWriteError'; + } +} + +/** + * An error indicating that an error occurred when processing bulk write results. + * + * @public + * @category Error + */ +export class MongoClientBulkWriteCursorError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoClientBulkWriteCursorError'; + } +} + +/** + * An error indicating that an error occurred on the client when executing a client bulk write. + * + * @public + * @category Error + */ +export class MongoClientBulkWriteExecutionError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoClientBulkWriteExecutionError'; + } +} + +/** + * An error generated when a ChangeStream operation fails to execute. + * + * @public + * @category Error + */ +export class MongoChangeStreamError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoChangeStreamError'; + } +} + +/** + * An error thrown when the user calls a function or method not supported on a tailable cursor + * + * @public + * @category Error + */ +export class MongoTailableCursorError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Tailable cursor does not support this operation') { + super(message); + } + + override get name(): string { + return 'MongoTailableCursorError'; + } +} + +/** An error generated when a GridFSStream operation fails to execute. + * + * @public + * @category Error + */ +export class MongoGridFSStreamError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoGridFSStreamError'; + } +} + +/** + * An error generated when a malformed or invalid chunk is + * encountered when reading from a GridFSStream. + * + * @public + * @category Error + */ +export class MongoGridFSChunkError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoGridFSChunkError'; + } +} + +/** + * An error generated when a **parsable** unexpected response comes from the server. + * This is generally an error where the driver in a state expecting a certain behavior to occur in + * the next message from MongoDB but it receives something else. + * This error **does not** represent an issue with wire message formatting. + * + * #### Example + * When an operation fails, it is the driver's job to retry it. It must perform serverSelection + * again to make sure that it attempts the operation against a server in a good state. If server + * selection returns a server that does not support retryable operations, this error is used. + * This scenario is unlikely as retryable support would also have been determined on the first attempt + * but it is possible the state change could report a selectable server that does not support retries. + * + * @public + * @category Error + */ +export class MongoUnexpectedServerResponseError extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + override get name(): string { + return 'MongoUnexpectedServerResponseError'; + } +} + +/** + * @public + * @category Error + * + * The `MongoOperationTimeoutError` class represents an error that occurs when an operation could not be completed within the specified `timeoutMS`. + * It is generated by the driver in support of the "client side operation timeout" feature so inherits from `MongoDriverError`. + * When `timeoutMS` is enabled `MongoServerError`s relating to `MaxTimeExpired` errors will be converted to `MongoOperationTimeoutError` + * + * @example + * ```ts + * try { + * await blogs.insertOne(blogPost, { timeoutMS: 60_000 }) + * } catch (error) { + * if (error instanceof MongoOperationTimeoutError) { + * console.log(`Oh no! writer's block!`, error); + * } + * } + * ``` + */ +export class MongoOperationTimeoutError extends MongoDriverError { + override get name(): string { + return 'MongoOperationTimeoutError'; + } +} + +/** + * An error thrown when the user attempts to add options to a cursor that has already been + * initialized + * + * @public + * @category Error + */ +export class MongoCursorInUseError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Cursor is already initialized') { + super(message); + } + + override get name(): string { + return 'MongoCursorInUseError'; + } +} + +/** + * An error generated when an attempt is made to operate + * on a closed/closing server. + * + * @public + * @category Error + */ +export class MongoServerClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Server is closed') { + super(message); + } + + override get name(): string { + return 'MongoServerClosedError'; + } +} + +/** + * An error thrown when an attempt is made to read from a cursor that has been exhausted + * + * @public + * @category Error + */ +export class MongoCursorExhaustedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message?: string) { + super(message || 'Cursor is exhausted'); + } + + override get name(): string { + return 'MongoCursorExhaustedError'; + } +} + +/** + * An error generated when an attempt is made to operate on a + * dropped, or otherwise unavailable, database. + * + * @public + * @category Error + */ +export class MongoTopologyClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message = 'Topology is closed') { + super(message); + } + + override get name(): string { + return 'MongoTopologyClosedError'; + } +} + +/** + * An error generated when the MongoClient is closed and async + * operations are interrupted. + * + * @public + * @category Error + */ +export class MongoClientClosedError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor() { + super('Operation interrupted because client was closed'); + } + + override get name(): string { + return 'MongoClientClosedError'; + } +} + +/** @public */ +export interface MongoNetworkErrorOptions { + /** Indicates the timeout happened before a connection handshake completed */ + beforeHandshake?: boolean; + cause?: Error; +} + +/** + * An error indicating an issue with the network, including TCP errors and timeouts. + * @public + * @category Error + */ +export class MongoNetworkError extends MongoError { + /** @internal */ + public readonly beforeHandshake: boolean; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: MongoNetworkErrorOptions) { + super(message, { cause: options?.cause }); + this.beforeHandshake = !!options?.beforeHandshake; + } + + override get name(): string { + return 'MongoNetworkError'; + } +} + +/** + * An error indicating a network timeout occurred + * @public + * @category Error + * + * @privateRemarks + * mongodb-client-encryption has a dependency on this error with an instanceof check + */ +export class MongoNetworkTimeoutError extends MongoNetworkError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: MongoNetworkErrorOptions) { + super(message, options); + } + + override get name(): string { + return 'MongoNetworkTimeoutError'; + } +} + +/** + * An error used when attempting to parse a value (like a connection string) + * @public + * @category Error + */ +export class MongoParseError extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoParseError'; + } +} + +/** + * An error generated when the user supplies malformed or unexpected arguments + * or when a required argument or field is not provided. + * + * + * @public + * @category Error + */ +export class MongoInvalidArgumentError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options?: { cause?: Error }) { + super(message, options); + } + + override get name(): string { + return 'MongoInvalidArgumentError'; + } +} + +/** + * An error generated when a feature that is not enabled or allowed for the current server + * configuration is used + * + * + * @public + * @category Error + */ +export class MongoCompatibilityError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoCompatibilityError'; + } +} + +/** + * An error generated when the user fails to provide authentication credentials before attempting + * to connect to a mongo server instance. + * + * + * @public + * @category Error + */ +export class MongoMissingCredentialsError extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoMissingCredentialsError'; + } +} + +/** + * An error generated when a required module or dependency is not present in the local environment + * + * @public + * @category Error + */ +export class MongoMissingDependencyError extends MongoAPIError { + dependencyName: string; + + /** @remarks This property is assigned in the `Error` constructor. */ + declare cause: Error; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, options: { cause: Error; dependencyName: string }) { + super(message, options); + this.dependencyName = options.dependencyName; + } + + override get name(): string { + return 'MongoMissingDependencyError'; + } +} +/** + * An error signifying a general system issue + * @public + * @category Error + */ +export class MongoSystemError extends MongoError { + /** An optional reason context, such as an error saved during flow of monitoring and selecting servers */ + reason?: TopologyDescription; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, reason: TopologyDescription) { + if (reason && reason.error) { + super(MongoError.buildErrorMessage(reason.error.message || reason.error), { + cause: reason.error + }); + } else { + super(message); + } + + if (reason) { + this.reason = reason; + } + + this.code = reason.error?.code; + } + + override get name(): string { + return 'MongoSystemError'; + } +} + +/** + * An error signifying a client-side server selection error + * @public + * @category Error + */ +export class MongoServerSelectionError extends MongoSystemError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message: string, reason: TopologyDescription) { + super(message, reason); + } + + override get name(): string { + return 'MongoServerSelectionError'; + } +} + +/** + * The type of the result property of MongoWriteConcernError + * @public + */ +export interface WriteConcernErrorResult { + writeConcernError: { + code: number; + errmsg: string; + codeName?: string; + errInfo?: Document; + }; + ok: number; + code?: number; + errorLabels?: string[]; + [x: string | number]: unknown; +} + +/** + * An error thrown when the server reports a writeConcernError + * @public + * @category Error + */ +export class MongoWriteConcernError extends MongoServerError { + /** The result document */ + result: Document; + + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(result: WriteConcernErrorResult) { + super({ ...result.writeConcernError, ...result }); + this.errInfo = result.writeConcernError.errInfo; + this.result = result; + } + + override get name(): string { + return 'MongoWriteConcernError'; + } +} + +// https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.md#retryable-error +const RETRYABLE_READ_ERROR_CODES = new Set([ + MONGODB_ERROR_CODES.HostUnreachable, + MONGODB_ERROR_CODES.HostNotFound, + MONGODB_ERROR_CODES.NetworkTimeout, + MONGODB_ERROR_CODES.ShutdownInProgress, + MONGODB_ERROR_CODES.PrimarySteppedDown, + MONGODB_ERROR_CODES.SocketException, + MONGODB_ERROR_CODES.NotWritablePrimary, + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + MONGODB_ERROR_CODES.ExceededTimeLimit, + MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet +]); + +// see: https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.md#terms +const RETRYABLE_WRITE_ERROR_CODES = RETRYABLE_READ_ERROR_CODES; + +export function needsRetryableWriteLabel(error: Error): boolean { + if (error instanceof MongoNetworkError) { + return true; + } + if (error instanceof MongoError) { + if (!error.hasErrorLabel(MongoErrorLabel.HandshakeError)) { + // If we already have the error label no need to add it again. servers add the label. + // In the case where we have a handshake error, need to fall down to the logic checking + // the codes. + return false; + } + } + + if (error instanceof MongoWriteConcernError) { + const code = error.result.writeConcernError.code ?? Number(error.code); + return RETRYABLE_WRITE_ERROR_CODES.has(Number.isNaN(code) ? 0 : code); + } + + if (error instanceof MongoError) { + return RETRYABLE_WRITE_ERROR_CODES.has(Number(error.code)); + } + + const isNotWritablePrimaryError = LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + + const isNodeIsRecoveringError = NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + + return false; +} + +export function isRetryableWriteError(error: MongoError): boolean { + return ( + error.hasErrorLabel(MongoErrorLabel.RetryableWriteError) || + error.hasErrorLabel(MongoErrorLabel.PoolRequestedRetry) + ); +} + +/** Determines whether an error is something the driver should attempt to retry */ +export function isRetryableReadError(error: MongoError): boolean { + const hasRetryableErrorCode = + typeof error.code === 'number' ? RETRYABLE_READ_ERROR_CODES.has(error.code) : false; + if (hasRetryableErrorCode) { + return true; + } + + if (error instanceof MongoNetworkError) { + return true; + } + + const isNotWritablePrimaryError = LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + + const isNodeIsRecoveringError = NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + + return false; +} + +const SDAM_RECOVERING_CODES = new Set([ + MONGODB_ERROR_CODES.ShutdownInProgress, + MONGODB_ERROR_CODES.PrimarySteppedDown, + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + MONGODB_ERROR_CODES.NotPrimaryOrSecondary +]); + +const SDAM_NOT_PRIMARY_CODES = new Set([ + MONGODB_ERROR_CODES.NotWritablePrimary, + MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + MONGODB_ERROR_CODES.LegacyNotPrimary +]); + +const SDAM_NODE_SHUTTING_DOWN_ERROR_CODES = new Set([ + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.ShutdownInProgress +]); + +function isRecoveringError(err: MongoError) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_RECOVERING_CODES.has(err.code); + } + + return ( + LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(err.message) || + NODE_IS_RECOVERING_ERROR_MESSAGE.test(err.message) + ); +} + +function isNotWritablePrimaryError(err: MongoError) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_NOT_PRIMARY_CODES.has(err.code); + } + + if (isRecoveringError(err)) { + return false; + } + + return LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(err.message); +} + +export function isNodeShuttingDownError(err: MongoError): boolean { + return !!(typeof err.code === 'number' && SDAM_NODE_SHUTTING_DOWN_ERROR_CODES.has(err.code)); +} + +/** + * Determines whether SDAM can recover from a given error. If it cannot + * then the pool will be cleared, and server state will completely reset + * locally. + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md#not-writable-primary-and-node-is-recovering + */ +export function isStateChangeError(error: MongoError): boolean { + return isRecoveringError(error) || isNotWritablePrimaryError(error); +} + +export function isNetworkTimeoutError(err: MongoError): err is MongoNetworkError { + return !!(err instanceof MongoNetworkError && err.message.match(/timed out/)); +} + +export function isResumableError(error?: Error, wireVersion?: number): boolean { + if (error == null || !(error instanceof MongoError)) { + return false; + } + + if (error instanceof MongoNetworkError) { + return true; + } + + if (error instanceof MongoServerSelectionError) { + return true; + } + + // wireVersion of 0 is possible when the server version is unknown (e.g heartbeat failure), so despite + // all supported servers being wire version 9+, the >= 9 bound must stay to route "unknown" to the + // code-list fallback below to maintain parity. + if (wireVersion != null && wireVersion >= 9) { + // DRIVERS-1308: Drivers will add a special case to treat the CursorNotFound error code as resumable + if (error.code === MONGODB_ERROR_CODES.CursorNotFound) { + return true; + } + return error.hasErrorLabel(MongoErrorLabel.ResumableChangeStreamError); + } + + if (typeof error.code === 'number') { + return GET_MORE_RESUMABLE_CODES.has(error.code); + } + + return false; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/explain.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/explain.ts new file mode 100644 index 00000000..6100e1ae --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/explain.ts @@ -0,0 +1,124 @@ +import { type Document } from './bson'; +import { MongoAPIError } from './error'; + +/** @public */ +export const ExplainVerbosity = Object.freeze({ + queryPlanner: 'queryPlanner', + queryPlannerExtended: 'queryPlannerExtended', + executionStats: 'executionStats', + allPlansExecution: 'allPlansExecution' +} as const); + +/** @public */ +export type ExplainVerbosity = string; + +/** + * For backwards compatibility, true is interpreted as "allPlansExecution" + * and false as "queryPlanner". + * @public + */ +export type ExplainVerbosityLike = ExplainVerbosity | boolean; + +/** @public */ +export interface ExplainCommandOptions { + /** The explain verbosity for the command. */ + verbosity: ExplainVerbosity; + /** The maxTimeMS setting for the command. */ + maxTimeMS?: number; +} + +/** + * @public + * + * When set, this configures an explain command. Valid values are boolean (for legacy compatibility, + * see {@link ExplainVerbosityLike}), a string containing the explain verbosity, or an object containing the verbosity and + * an optional maxTimeMS. + * + * Examples of valid usage: + * + * ```typescript + * collection.find({ name: 'john doe' }, { explain: true }); + * collection.find({ name: 'john doe' }, { explain: false }); + * collection.find({ name: 'john doe' }, { explain: 'queryPlanner' }); + * collection.find({ name: 'john doe' }, { explain: { verbosity: 'queryPlanner' } }); + * ``` + * + * maxTimeMS can be configured to limit the amount of time the server + * spends executing an explain by providing an object: + * + * ```typescript + * // limits the `explain` command to no more than 2 seconds + * collection.find({ name: 'john doe' }, { + * explain: { + * verbosity: 'queryPlanner', + * maxTimeMS: 2000 + * } + * }); + * ``` + */ +export interface ExplainOptions { + /** Specifies the verbosity mode for the explain output. */ + explain?: ExplainVerbosityLike | ExplainCommandOptions; +} + +/** @internal */ +export class Explain { + readonly verbosity: ExplainVerbosity; + readonly maxTimeMS?: number; + + private constructor(verbosity: ExplainVerbosityLike, maxTimeMS?: number) { + if (typeof verbosity === 'boolean') { + this.verbosity = verbosity + ? ExplainVerbosity.allPlansExecution + : ExplainVerbosity.queryPlanner; + } else { + this.verbosity = verbosity; + } + + this.maxTimeMS = maxTimeMS; + } + + static fromOptions({ explain }: ExplainOptions = {}): Explain | undefined { + if (explain == null) return; + + if (typeof explain === 'boolean' || typeof explain === 'string') { + return new Explain(explain); + } + + const { verbosity, maxTimeMS } = explain; + return new Explain(verbosity, maxTimeMS); + } +} + +export function validateExplainTimeoutOptions(options: Document, explain?: Explain) { + const { maxTimeMS, timeoutMS } = options; + if (timeoutMS != null && (maxTimeMS != null || explain?.maxTimeMS != null)) { + throw new MongoAPIError('Cannot use maxTimeMS with timeoutMS for explain commands.'); + } +} + +/** + * Applies an explain to a given command. + * @internal + * + * @param command - the command on which to apply the explain + * @param options - the options containing the explain verbosity + */ +export function decorateWithExplain( + command: Document, + explain: Explain +): { + explain: Document; + verbosity: ExplainVerbosity; + maxTimeMS?: number; +} { + type ExplainCommand = ReturnType; + const { verbosity, maxTimeMS } = explain; + const baseCommand: ExplainCommand = { explain: command, verbosity }; + + if (typeof maxTimeMS === 'number') { + baseCommand.maxTimeMS = maxTimeMS; + } + + return baseCommand; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/download.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/download.ts new file mode 100644 index 00000000..b391aa1c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/download.ts @@ -0,0 +1,483 @@ +import { Readable } from 'stream'; + +import { ByteUtils, type Document, type ObjectId } from '../bson'; +import type { Collection } from '../collection'; +import { CursorTimeoutMode } from '../cursor/abstract_cursor'; +import type { FindCursor } from '../cursor/find_cursor'; +import { + MongoGridFSChunkError, + MongoGridFSStreamError, + MongoInvalidArgumentError, + MongoRuntimeError +} from '../error'; +import type { FindOptions } from '../operations/find'; +import type { ReadPreference } from '../read_preference'; +import type { Sort } from '../sort'; +import { CSOTTimeoutContext } from '../timeout'; +import type { Callback } from '../utils'; +import type { GridFSChunk } from './upload'; + +/** @public */ +export interface GridFSBucketReadStreamOptions { + sort?: Sort; + skip?: number; + /** + * 0-indexed non-negative byte offset from the beginning of the file + */ + start?: number; + /** + * 0-indexed non-negative byte offset to the end of the file contents + * to be returned by the stream. `end` is non-inclusive + */ + end?: number; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/** @public */ +export interface GridFSBucketReadStreamOptionsWithRevision extends GridFSBucketReadStreamOptions { + /** The revision number relative to the oldest file with the given filename. 0 + * gets you the oldest file, 1 gets you the 2nd oldest, -1 gets you the + * newest. */ + revision?: number; +} + +/** @public */ +export interface GridFSFile { + _id: ObjectId; + length: number; + chunkSize: number; + filename: string; + metadata?: Document; + uploadDate: Date; +} + +/** @internal */ +export interface GridFSBucketReadStreamPrivate { + /** + * The running total number of bytes read from the chunks collection. + */ + bytesRead: number; + /** + * The number of bytes to remove from the last chunk read in the file. This is non-zero + * if `end` is not equal to the length of the document and `end` is not a multiple + * of the chunkSize. + */ + bytesToTrim: number; + + /** + * The number of bytes to remove from the first chunk read in the file. This is non-zero + * if `start` is not equal to the 0 and `start` is not a multiple + * of the chunkSize. + */ + bytesToSkip: number; + + files: Collection; + chunks: Collection; + cursor?: FindCursor; + + /** The running total number of chunks read from the chunks collection. */ + expected: number; + + /** + * The filter used to search in the _files_ collection (i.e., `{ _id: <> }`) + * This is not the same filter used when reading chunks from the chunks collection. + */ + filter: Document; + + /** Indicates whether or not download has started. */ + init: boolean; + + /** The expected number of chunks to read, calculated from start, end, chunkSize and file length. */ + expectedEnd: number; + file?: GridFSFile; + options: { + sort?: Sort; + skip?: number; + start: number; + end: number; + timeoutMS?: number; + }; + readPreference?: ReadPreference; + timeoutContext?: CSOTTimeoutContext; +} + +/** + * A readable stream that enables you to read buffers from GridFS. + * + * Do not instantiate this class directly. Use `openDownloadStream()` instead. + * @public + */ +export class GridFSBucketReadStream extends Readable { + /** @internal */ + s: GridFSBucketReadStreamPrivate; + + /** + * Fires when the stream loaded the file document corresponding to the provided id. + * @event + */ + static readonly FILE = 'file' as const; + + /** + * @param chunks - Handle for chunks collection + * @param files - Handle for files collection + * @param readPreference - The read preference to use + * @param filter - The filter to use to find the file document + * @internal + */ + constructor( + chunks: Collection, + files: Collection, + readPreference: ReadPreference | undefined, + filter: Document, + options?: GridFSBucketReadStreamOptions + ) { + super({ emitClose: true }); + this.s = { + bytesToTrim: 0, + bytesToSkip: 0, + bytesRead: 0, + chunks, + expected: 0, + files, + filter, + init: false, + expectedEnd: 0, + options: { + start: 0, + end: 0, + ...options + }, + readPreference, + timeoutContext: + options?.timeoutMS != null + ? new CSOTTimeoutContext({ timeoutMS: options.timeoutMS, serverSelectionTimeoutMS: 0 }) + : undefined + }; + } + + /** + * Reads from the cursor and pushes to the stream. + * Private Impl, do not call directly + * @internal + */ + override _read(): void { + if (this.destroyed) return; + waitForFile(this, () => doRead(this)); + } + + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param start - 0-based offset in bytes to start streaming from + */ + start(start = 0): this { + throwIfInitialized(this); + this.s.options.start = start; + return this; + } + + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param end - Offset in bytes to stop reading at + */ + end(end = 0): this { + throwIfInitialized(this); + this.s.options.end = end; + return this; + } + + /** + * Marks this stream as aborted (will never push another `data` event) + * and kills the underlying cursor. Will emit the 'end' event, and then + * the 'close' event once the cursor is successfully killed. + */ + async abort(): Promise { + this.push(null); + this.destroy(); + const remainingTimeMS = this.s.timeoutContext?.getRemainingTimeMSOrThrow(); + await this.s.cursor?.close({ timeoutMS: remainingTimeMS }); + } +} + +function throwIfInitialized(stream: GridFSBucketReadStream): void { + if (stream.s.init) { + throw new MongoGridFSStreamError('Options cannot be changed after the stream is initialized'); + } +} + +function doRead(stream: GridFSBucketReadStream): void { + if (stream.destroyed) return; + if (!stream.s.cursor) return; + if (!stream.s.file) return; + + const handleReadResult = (doc: Document | null) => { + if (stream.destroyed) return; + + if (!doc) { + stream.push(null); + + stream.s.cursor?.close().then(undefined, error => stream.destroy(error)); + return; + } + + if (!stream.s.file) return; + + const bytesRemaining = stream.s.file.length - stream.s.bytesRead; + const expectedN = stream.s.expected++; + const expectedLength = Math.min(stream.s.file.chunkSize, bytesRemaining); + if (doc.n > expectedN) { + return stream.destroy( + new MongoGridFSChunkError( + `ChunkIsMissing: Got unexpected n: ${doc.n}, expected: ${expectedN}` + ) + ); + } + + if (doc.n < expectedN) { + return stream.destroy( + new MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected: ${expectedN}`) + ); + } + + let buf = ByteUtils.isUint8Array(doc.data) ? doc.data : doc.data.buffer; + + if (buf.byteLength !== expectedLength) { + if (bytesRemaining <= 0) { + return stream.destroy( + new MongoGridFSChunkError( + `ExtraChunk: Got unexpected n: ${doc.n}, expected file length ${stream.s.file.length} bytes but already read ${stream.s.bytesRead} bytes` + ) + ); + } + + return stream.destroy( + new MongoGridFSChunkError( + `ChunkIsWrongSize: Got unexpected length: ${buf.byteLength}, expected: ${expectedLength}` + ) + ); + } + + stream.s.bytesRead += buf.byteLength; + + if (buf.byteLength === 0) { + return stream.push(null); + } + + let sliceStart = null; + let sliceEnd = null; + + if (stream.s.bytesToSkip != null) { + sliceStart = stream.s.bytesToSkip; + stream.s.bytesToSkip = 0; + } + + const atEndOfStream = expectedN === stream.s.expectedEnd - 1; + const bytesLeftToRead = stream.s.options.end - stream.s.bytesToSkip; + if (atEndOfStream && stream.s.bytesToTrim != null) { + sliceEnd = stream.s.file.chunkSize - stream.s.bytesToTrim; + } else if (stream.s.options.end && bytesLeftToRead < doc.data.byteLength) { + sliceEnd = bytesLeftToRead; + } + + if (sliceStart != null || sliceEnd != null) { + buf = buf.slice(sliceStart || 0, sliceEnd || buf.byteLength); + } + + stream.push(buf); + return; + }; + + stream.s.cursor.next().then(handleReadResult, error => { + if (stream.destroyed) return; + stream.destroy(error); + }); +} + +function init(stream: GridFSBucketReadStream): void { + const findOneOptions: FindOptions = {}; + if (stream.s.readPreference) { + findOneOptions.readPreference = stream.s.readPreference; + } + if (stream.s.options && stream.s.options.sort) { + findOneOptions.sort = stream.s.options.sort; + } + if (stream.s.options && stream.s.options.skip) { + findOneOptions.skip = stream.s.options.skip; + } + + const handleReadResult = (doc: Document | null) => { + if (stream.destroyed) return; + + if (!doc) { + const identifier = stream.s.filter._id + ? stream.s.filter._id.toString() + : stream.s.filter.filename; + const errmsg = `FileNotFound: file ${identifier} was not found`; + // TODO(NODE-3483) + const err = new MongoRuntimeError(errmsg); + err.code = 'ENOENT'; // TODO: NODE-3338 set property as part of constructor + return stream.destroy(err); + } + + // If document is empty, kill the stream immediately and don't + // execute any reads + if (doc.length <= 0) { + stream.push(null); + return; + } + + if (stream.destroyed) { + // If user destroys the stream before we have a cursor, wait + // until the query is done to say we're 'closed' because we can't + // cancel a query. + stream.destroy(); + return; + } + + try { + stream.s.bytesToSkip = handleStartOption(stream, doc, stream.s.options); + } catch (error) { + return stream.destroy(error); + } + + const filter: Document = { files_id: doc._id }; + + // Currently the skip function does not support the index, + // it needs to retrieve all the documents first and then skip them. (CS-25811) + // As work around we use $gte on the "n" field. + if (stream.s.options && stream.s.options.start != null) { + const skip = Math.floor(stream.s.options.start / doc.chunkSize); + if (skip > 0) { + filter['n'] = { $gte: skip }; + } + } + + let remainingTimeMS: number | undefined; + try { + remainingTimeMS = stream.s.timeoutContext?.getRemainingTimeMSOrThrow( + `Download timed out after ${stream.s.timeoutContext?.timeoutMS}ms` + ); + } catch (error) { + return stream.destroy(error); + } + + stream.s.cursor = stream.s.chunks + .find(filter, { + timeoutMode: stream.s.options.timeoutMS != null ? CursorTimeoutMode.LIFETIME : undefined, + timeoutMS: remainingTimeMS + }) + .sort({ n: 1 }); + + if (stream.s.readPreference) { + stream.s.cursor.withReadPreference(stream.s.readPreference); + } + + stream.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize); + stream.s.file = doc as GridFSFile; + + try { + stream.s.bytesToTrim = handleEndOption(stream, doc, stream.s.cursor, stream.s.options); + } catch (error) { + return stream.destroy(error); + } + + stream.emit(GridFSBucketReadStream.FILE, doc); + return; + }; + + let remainingTimeMS: number | undefined; + try { + remainingTimeMS = stream.s.timeoutContext?.getRemainingTimeMSOrThrow( + `Download timed out after ${stream.s.timeoutContext?.timeoutMS}ms` + ); + } catch (error) { + if (!stream.destroyed) stream.destroy(error); + return; + } + + findOneOptions.timeoutMS = remainingTimeMS; + + stream.s.files.findOne(stream.s.filter, findOneOptions).then(handleReadResult, error => { + if (stream.destroyed) return; + stream.destroy(error); + }); +} + +function waitForFile(stream: GridFSBucketReadStream, callback: Callback): void { + if (stream.s.file) { + return callback(); + } + + if (!stream.s.init) { + init(stream); + stream.s.init = true; + } + + stream.once('file', () => { + callback(); + }); +} + +function handleStartOption( + stream: GridFSBucketReadStream, + doc: Document, + options: GridFSBucketReadStreamOptions +): number { + if (options && options.start != null) { + if (options.start > doc.length) { + throw new MongoInvalidArgumentError( + `Stream start (${options.start}) must not be more than the length of the file (${doc.length})` + ); + } + if (options.start < 0) { + throw new MongoInvalidArgumentError(`Stream start (${options.start}) must not be negative`); + } + if (options.end != null && options.end < options.start) { + throw new MongoInvalidArgumentError( + `Stream start (${options.start}) must not be greater than stream end (${options.end})` + ); + } + + stream.s.bytesRead = Math.floor(options.start / doc.chunkSize) * doc.chunkSize; + stream.s.expected = Math.floor(options.start / doc.chunkSize); + + return options.start - stream.s.bytesRead; + } + throw new MongoInvalidArgumentError('Start option must be defined'); +} + +function handleEndOption( + stream: GridFSBucketReadStream, + doc: Document, + cursor: FindCursor, + options: GridFSBucketReadStreamOptions +) { + if (options && options.end != null) { + if (options.end > doc.length) { + throw new MongoInvalidArgumentError( + `Stream end (${options.end}) must not be more than the length of the file (${doc.length})` + ); + } + if (options.start == null || options.start < 0) { + throw new MongoInvalidArgumentError(`Stream end (${options.end}) must not be negative`); + } + + const start = options.start != null ? Math.floor(options.start / doc.chunkSize) : 0; + + cursor.limit(Math.ceil(options.end / doc.chunkSize) - start); + + stream.s.expectedEnd = Math.ceil(options.end / doc.chunkSize); + + return Math.ceil(options.end / doc.chunkSize) * doc.chunkSize - options.end; + } + throw new MongoInvalidArgumentError('End option must be defined'); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/index.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/index.ts new file mode 100644 index 00000000..f62267b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/index.ts @@ -0,0 +1,264 @@ +import type { ObjectId } from '../bson'; +import type { Collection } from '../collection'; +import type { FindCursor } from '../cursor/find_cursor'; +import type { Db } from '../db'; +import { MongoOperationTimeoutError, MongoRuntimeError } from '../error'; +import { type Filter, TypedEventEmitter } from '../mongo_types'; +import type { ReadPreference } from '../read_preference'; +import type { Sort } from '../sort'; +import { CSOTTimeoutContext } from '../timeout'; +import { noop, resolveOptions } from '../utils'; +import { WriteConcern, type WriteConcernOptions } from '../write_concern'; +import type { FindOptions } from './../operations/find'; +import { + GridFSBucketReadStream, + type GridFSBucketReadStreamOptions, + type GridFSBucketReadStreamOptionsWithRevision, + type GridFSFile +} from './download'; +import { + GridFSBucketWriteStream, + type GridFSBucketWriteStreamOptions, + type GridFSChunk +} from './upload'; + +const DEFAULT_GRIDFS_BUCKET_OPTIONS: { + bucketName: string; + chunkSizeBytes: number; +} = { + bucketName: 'fs', + chunkSizeBytes: 255 * 1024 +}; + +/** @public */ +export interface GridFSBucketOptions extends WriteConcernOptions { + /** The 'files' and 'chunks' collections will be prefixed with the bucket name followed by a dot. */ + bucketName?: string; + /** Number of bytes stored in each chunk. Defaults to 255KB */ + chunkSizeBytes?: number; + /** Read preference to be passed to read operations */ + readPreference?: ReadPreference; + /** + * @experimental + * Specifies the lifetime duration of a gridFS stream. If any async operations are in progress + * when this timeout expires, the stream will throw a timeout error. + */ + timeoutMS?: number; +} + +/** @internal */ +export interface GridFSBucketPrivate { + db: Db; + options: { + bucketName: string; + chunkSizeBytes: number; + readPreference?: ReadPreference; + writeConcern: WriteConcern | undefined; + timeoutMS?: number; + }; + _chunksCollection: Collection; + _filesCollection: Collection; + checkedIndexes: boolean; + calledOpenUploadStream: boolean; +} + +/** @public */ +export type GridFSBucketEvents = { + index(): void; +}; + +/** + * Constructor for a streaming GridFS interface + * @public + */ +export class GridFSBucket extends TypedEventEmitter { + /** @internal */ + s: GridFSBucketPrivate; + + /** + * When the first call to openUploadStream is made, the upload stream will + * check to see if it needs to create the proper indexes on the chunks and + * files collections. This event is fired either when 1) it determines that + * no index creation is necessary, 2) when it successfully creates the + * necessary indexes. + * @event + */ + static readonly INDEX = 'index' as const; + + constructor(db: Db, options?: GridFSBucketOptions) { + super(); + this.on('error', noop); + this.setMaxListeners(0); + const privateOptions = resolveOptions(db, { + ...DEFAULT_GRIDFS_BUCKET_OPTIONS, + ...options, + writeConcern: WriteConcern.fromOptions(options) + }); + this.s = { + db, + options: privateOptions, + _chunksCollection: db.collection(privateOptions.bucketName + '.chunks'), + _filesCollection: db.collection(privateOptions.bucketName + '.files'), + checkedIndexes: false, + calledOpenUploadStream: false + }; + } + + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS. The stream's 'id' property contains the resulting + * file's id. + * + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + + openUploadStream( + filename: string, + options?: GridFSBucketWriteStreamOptions + ): GridFSBucketWriteStream { + return new GridFSBucketWriteStream(this, filename, { + timeoutMS: this.s.options.timeoutMS, + ...options + }); + } + + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting + * file's id. + */ + openUploadStreamWithId( + id: ObjectId, + filename: string, + options?: GridFSBucketWriteStreamOptions + ): GridFSBucketWriteStream { + return new GridFSBucketWriteStream(this, filename, { + timeoutMS: this.s.options.timeoutMS, + ...options, + id + }); + } + + /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ + openDownloadStream( + id: ObjectId, + options?: GridFSBucketReadStreamOptions + ): GridFSBucketReadStream { + return new GridFSBucketReadStream( + this.s._chunksCollection, + this.s._filesCollection, + this.s.options.readPreference, + { _id: id }, + { timeoutMS: this.s.options.timeoutMS, ...options } + ); + } + + /** + * Deletes a file with the given id + * + * @param id - The id of the file doc + */ + async delete(id: ObjectId, options?: { timeoutMS: number }): Promise { + const { timeoutMS } = resolveOptions(this.s.db, options); + let timeoutContext: CSOTTimeoutContext | undefined = undefined; + + if (timeoutMS) { + timeoutContext = new CSOTTimeoutContext({ + timeoutMS, + serverSelectionTimeoutMS: this.s.db.client.s.options.serverSelectionTimeoutMS + }); + } + + const { deletedCount } = await this.s._filesCollection.deleteOne( + { _id: id }, + { timeoutMS: timeoutContext?.remainingTimeMS } + ); + + const remainingTimeMS = timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) + throw new MongoOperationTimeoutError(`Timed out after ${timeoutMS}ms`); + // Delete orphaned chunks before returning FileNotFound + await this.s._chunksCollection.deleteMany({ files_id: id }, { timeoutMS: remainingTimeMS }); + + if (deletedCount === 0) { + // TODO(NODE-3483): Replace with more appropriate error + // Consider creating new error MongoGridFSFileNotFoundError + throw new MongoRuntimeError(`File not found for id ${id}`); + } + } + + /** Convenience wrapper around find on the files collection */ + find(filter: Filter = {}, options: FindOptions = {}): FindCursor { + return this.s._filesCollection.find(filter, options); + } + + /** + * Returns a readable stream (GridFSBucketReadStream) for streaming the + * file with the given name from GridFS. If there are multiple files with + * the same name, this will stream the most recent file with the given name + * (as determined by the `uploadDate` field). You can set the `revision` + * option to change this behavior. + */ + openDownloadStreamByName( + filename: string, + options?: GridFSBucketReadStreamOptionsWithRevision + ): GridFSBucketReadStream { + let sort: Sort = { uploadDate: -1 }; + let skip = undefined; + if (options && options.revision != null) { + if (options.revision >= 0) { + sort = { uploadDate: 1 }; + skip = options.revision; + } else { + skip = -options.revision - 1; + } + } + return new GridFSBucketReadStream( + this.s._chunksCollection, + this.s._filesCollection, + this.s.options.readPreference, + { filename }, + { timeoutMS: this.s.options.timeoutMS, ...options, sort, skip } + ); + } + + /** + * Renames the file with the given _id to the given string + * + * @param id - the id of the file to rename + * @param filename - new name for the file + */ + async rename(id: ObjectId, filename: string, options?: { timeoutMS: number }): Promise { + const filter = { _id: id }; + const update = { $set: { filename } }; + const { matchedCount } = await this.s._filesCollection.updateOne(filter, update, options); + if (matchedCount === 0) { + throw new MongoRuntimeError(`File with id ${id} not found`); + } + } + + /** Removes this bucket's files collection, followed by its chunks collection. */ + async drop(options?: { timeoutMS: number }): Promise { + const { timeoutMS } = resolveOptions(this.s.db, options); + let timeoutContext: CSOTTimeoutContext | undefined = undefined; + + if (timeoutMS) { + timeoutContext = new CSOTTimeoutContext({ + timeoutMS, + serverSelectionTimeoutMS: this.s.db.client.s.options.serverSelectionTimeoutMS + }); + } + + if (timeoutContext) { + await this.s._filesCollection.drop({ timeoutMS: timeoutContext.remainingTimeMS }); + const remainingTimeMS = timeoutContext.getRemainingTimeMSOrThrow( + `Timed out after ${timeoutMS}ms` + ); + await this.s._chunksCollection.drop({ timeoutMS: remainingTimeMS }); + } else { + await this.s._filesCollection.drop(); + await this.s._chunksCollection.drop(); + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/upload.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/upload.ts new file mode 100644 index 00000000..13359cad --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/gridfs/upload.ts @@ -0,0 +1,538 @@ +import { Writable } from 'stream'; + +import { ByteUtils, type Document, ObjectId } from '../bson'; +import type { Collection } from '../collection'; +import { CursorTimeoutMode } from '../cursor/abstract_cursor'; +import { + MongoAPIError, + MONGODB_ERROR_CODES, + MongoError, + MongoOperationTimeoutError +} from '../error'; +import { CSOTTimeoutContext } from '../timeout'; +import { type Callback, resolveTimeoutOptions, squashError } from '../utils'; +import type { WriteConcernOptions } from '../write_concern'; +import { WriteConcern } from './../write_concern'; +import type { GridFSFile } from './download'; +import type { GridFSBucket } from './index'; + +/** @public */ +export interface GridFSChunk { + _id: ObjectId; + files_id: ObjectId; + n: number; + data: Buffer | Uint8Array; +} + +/** @public */ +export interface GridFSBucketWriteStreamOptions extends WriteConcernOptions { + /** Overwrite this bucket's chunkSizeBytes for this file */ + chunkSizeBytes?: number; + /** Custom file id for the GridFS file. */ + id?: ObjectId; + /** Object to store in the file document's `metadata` field */ + metadata?: Document; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/** + * A writable stream that enables you to write buffers to GridFS. + * + * Do not instantiate this class directly. Use `openUploadStream()` instead. + * @public + */ +export class GridFSBucketWriteStream extends Writable { + bucket: GridFSBucket; + /** A Collection instance where the file's chunks are stored */ + chunks: Collection; + /** A Collection instance where the file's GridFSFile document is stored */ + files: Collection; + /** The name of the file */ + filename: string; + /** Options controlling the metadata inserted along with the file */ + options: GridFSBucketWriteStreamOptions; + /** Indicates the stream is finished uploading */ + done: boolean; + /** The ObjectId used for the `_id` field on the GridFSFile document */ + id: ObjectId; + /** The number of bytes that each chunk will be limited to */ + chunkSizeBytes: number; + /** Space used to store a chunk currently being inserted */ + bufToStore: Uint8Array; + /** Accumulates the number of bytes inserted as the stream uploads chunks */ + length: number; + /** Accumulates the number of chunks inserted as the stream uploads file contents */ + n: number; + /** Tracks the current offset into the buffered bytes being uploaded */ + pos: number; + /** Contains a number of properties indicating the current state of the stream */ + state: { + /** If set the stream has ended */ + streamEnd: boolean; + /** Indicates the number of chunks that still need to be inserted to exhaust the current buffered data */ + outstandingRequests: number; + /** If set an error occurred during insertion */ + errored: boolean; + /** If set the stream was intentionally aborted */ + aborted: boolean; + }; + /** The write concern setting to be used with every insert operation */ + writeConcern?: WriteConcern; + /** + * The document containing information about the inserted file. + * This property is defined _after_ the finish event has been emitted. + * It will remain `null` if an error occurs. + * + * @example + * ```ts + * fs.createReadStream('file.txt') + * .pipe(bucket.openUploadStream('file.txt')) + * .on('finish', function () { + * console.log(this.gridFSFile) + * }) + * ``` + */ + gridFSFile: GridFSFile | null = null; + /** @internal */ + timeoutContext?: CSOTTimeoutContext; + + /** + * @param bucket - Handle for this stream's corresponding bucket + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + * @internal + */ + constructor(bucket: GridFSBucket, filename: string, options?: GridFSBucketWriteStreamOptions) { + super(); + + options = options ?? {}; + this.bucket = bucket; + this.chunks = bucket.s._chunksCollection; + this.filename = filename; + this.files = bucket.s._filesCollection; + this.options = options; + this.writeConcern = WriteConcern.fromOptions(options) || bucket.s.options.writeConcern; + // Signals the write is all done + this.done = false; + + this.id = options.id ? options.id : new ObjectId(); + // properly inherit the default chunksize from parent + this.chunkSizeBytes = options.chunkSizeBytes || this.bucket.s.options.chunkSizeBytes; + this.bufToStore = ByteUtils.allocate(this.chunkSizeBytes); + this.length = 0; + this.n = 0; + this.pos = 0; + this.state = { + streamEnd: false, + outstandingRequests: 0, + errored: false, + aborted: false + }; + + if (options.timeoutMS != null) + this.timeoutContext = new CSOTTimeoutContext({ + timeoutMS: options.timeoutMS, + serverSelectionTimeoutMS: resolveTimeoutOptions(this.bucket.s.db.client, {}) + .serverSelectionTimeoutMS + }); + } + + /** + * @internal + * + * The stream is considered constructed when the indexes are done being created + */ + override _construct(callback: (error?: Error | null) => void): void { + if (!this.bucket.s.calledOpenUploadStream) { + this.bucket.s.calledOpenUploadStream = true; + + checkIndexes(this).then( + () => { + this.bucket.s.checkedIndexes = true; + this.bucket.emit('index'); + callback(); + }, + error => { + if (error instanceof MongoOperationTimeoutError) { + return handleError(this, error, callback); + } + squashError(error); + callback(); + } + ); + } else { + return queueMicrotask(callback); + } + } + + /** + * @internal + * Write a buffer to the stream. + * + * @param chunk - Buffer to write + * @param encoding - Optional encoding for the buffer + * @param callback - Function to call when the chunk was added to the buffer, or if the entire chunk was persisted to MongoDB if this chunk caused a flush. + */ + override _write( + chunk: Uint8Array | string, + encoding: BufferEncoding, + callback: Callback + ): void { + doWrite(this, chunk, encoding, callback); + } + + /** @internal */ + override _final(callback: (error?: Error | null) => void): void { + if (this.state.streamEnd) { + return queueMicrotask(callback); + } + this.state.streamEnd = true; + writeRemnant(this, callback); + } + + /** + * Places this write stream into an aborted state (all future writes fail) + * and deletes all chunks that have already been written. + */ + async abort(): Promise { + if (this.state.streamEnd) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + throw new MongoAPIError('Cannot abort a stream that has already completed'); + } + + if (this.state.aborted) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + throw new MongoAPIError('Cannot call abort() on a stream twice'); + } + + this.state.aborted = true; + const remainingTimeMS = this.timeoutContext?.getRemainingTimeMSOrThrow( + `Upload timed out after ${this.timeoutContext?.timeoutMS}ms` + ); + + await this.chunks.deleteMany({ files_id: this.id }, { timeoutMS: remainingTimeMS }); + } +} + +function handleError(stream: GridFSBucketWriteStream, error: Error, callback: Callback): void { + if (stream.state.errored) { + queueMicrotask(callback); + return; + } + stream.state.errored = true; + queueMicrotask(() => callback(error)); +} + +function createChunkDoc(filesId: ObjectId, n: number, data: Uint8Array): GridFSChunk { + return { + _id: new ObjectId(), + files_id: filesId, + n, + data + }; +} + +async function checkChunksIndex(stream: GridFSBucketWriteStream): Promise { + const index = { files_id: 1, n: 1 }; + + let remainingTimeMS; + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ); + + let indexes; + try { + indexes = await stream.chunks + .listIndexes({ + timeoutMode: remainingTimeMS != null ? CursorTimeoutMode.LIFETIME : undefined, + timeoutMS: remainingTimeMS + }) + .toArray(); + } catch (error) { + if (error instanceof MongoError && error.code === MONGODB_ERROR_CODES.NamespaceNotFound) { + indexes = []; + } else { + throw error; + } + } + + const hasChunksIndex = !!indexes.find(index => { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.files_id === 1 && index.key.n === 1) { + return true; + } + return false; + }); + + if (!hasChunksIndex) { + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ); + await stream.chunks.createIndex(index, { + ...stream.writeConcern, + background: true, + unique: true, + timeoutMS: remainingTimeMS + }); + } +} + +function checkDone(stream: GridFSBucketWriteStream, callback: Callback): void { + if (stream.done) { + return queueMicrotask(callback); + } + + if (stream.state.streamEnd && stream.state.outstandingRequests === 0 && !stream.state.errored) { + // Set done so we do not trigger duplicate createFilesDoc + stream.done = true; + // Create a new files doc + const gridFSFile = createFilesDoc( + stream.id, + stream.length, + stream.chunkSizeBytes, + stream.filename, + stream.options.metadata + ); + + if (isAborted(stream, callback)) { + return; + } + + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError( + stream, + new MongoOperationTimeoutError( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ), + callback + ); + } + + stream.files + .insertOne(gridFSFile, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }) + .then( + () => { + stream.gridFSFile = gridFSFile; + callback(); + }, + error => { + return handleError(stream, error, callback); + } + ); + return; + } + + queueMicrotask(callback); +} + +async function checkIndexes(stream: GridFSBucketWriteStream): Promise { + let remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ); + const doc = await stream.files.findOne( + {}, + { + projection: { _id: 1 }, + timeoutMS: remainingTimeMS + } + ); + if (doc != null) { + // If at least one document exists assume the collection has the required index + return; + } + + const index = { filename: 1, uploadDate: 1 }; + + let indexes; + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ); + const listIndexesOptions = { + timeoutMode: remainingTimeMS != null ? CursorTimeoutMode.LIFETIME : undefined, + timeoutMS: remainingTimeMS + }; + try { + indexes = await stream.files.listIndexes(listIndexesOptions).toArray(); + } catch (error) { + if (error instanceof MongoError && error.code === MONGODB_ERROR_CODES.NamespaceNotFound) { + indexes = []; + } else { + throw error; + } + } + + const hasFileIndex = !!indexes.find(index => { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.filename === 1 && index.key.uploadDate === 1) { + return true; + } + return false; + }); + + if (!hasFileIndex) { + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ); + + await stream.files.createIndex(index, { background: false, timeoutMS: remainingTimeMS }); + } + + await checkChunksIndex(stream); +} + +function createFilesDoc( + _id: ObjectId, + length: number, + chunkSize: number, + filename: string, + metadata?: Document +): GridFSFile { + const ret: GridFSFile = { + _id, + length, + chunkSize, + uploadDate: new Date(), + filename + }; + + if (metadata) { + ret.metadata = metadata; + } + + return ret; +} + +function doWrite( + stream: GridFSBucketWriteStream, + chunk: Uint8Array | string, + encoding: BufferEncoding, + callback: Callback +): void { + if (isAborted(stream, callback)) { + return; + } + + const inputBuf = + typeof chunk === 'string' ? ByteUtils.fromUTF8(chunk) : ByteUtils.toLocalBufferType(chunk); + + stream.length += inputBuf.length; + + // Input is small enough to fit in our buffer + if (stream.pos + inputBuf.length < stream.chunkSizeBytes) { + ByteUtils.copy(inputBuf, stream.bufToStore, stream.pos); + stream.pos += inputBuf.length; + queueMicrotask(callback); + return; + } + + // Otherwise, buffer is too big for current chunk, so we need to flush + // to MongoDB. + let inputBufRemaining = inputBuf.length; + let spaceRemaining: number = stream.chunkSizeBytes - stream.pos; + let numToCopy = Math.min(spaceRemaining, inputBuf.length); + let outstandingRequests = 0; + while (inputBufRemaining > 0) { + const inputBufPos = inputBuf.length - inputBufRemaining; + ByteUtils.copy(inputBuf, stream.bufToStore, stream.pos, inputBufPos, inputBufPos + numToCopy); + stream.pos += numToCopy; + spaceRemaining -= numToCopy; + let doc: GridFSChunk; + if (spaceRemaining === 0) { + doc = createChunkDoc(stream.id, stream.n, new Uint8Array(stream.bufToStore)); + + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError( + stream, + new MongoOperationTimeoutError( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ), + callback + ); + } + + ++stream.state.outstandingRequests; + ++outstandingRequests; + + if (isAborted(stream, callback)) { + return; + } + + stream.chunks + .insertOne(doc, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }) + .then( + () => { + --stream.state.outstandingRequests; + --outstandingRequests; + + if (!outstandingRequests) { + checkDone(stream, callback); + } + }, + error => { + return handleError(stream, error, callback); + } + ); + + spaceRemaining = stream.chunkSizeBytes; + stream.pos = 0; + ++stream.n; + } + inputBufRemaining -= numToCopy; + numToCopy = Math.min(spaceRemaining, inputBufRemaining); + } +} + +function writeRemnant(stream: GridFSBucketWriteStream, callback: Callback): void { + // Buffer is empty, so don't bother to insert + if (stream.pos === 0) { + return checkDone(stream, callback); + } + + // Create a new buffer to make sure the buffer isn't bigger than it needs + // to be. + const remnant = ByteUtils.allocate(stream.pos); + ByteUtils.copy(stream.bufToStore, remnant, 0, 0, stream.pos); + const doc = createChunkDoc(stream.id, stream.n, remnant); + + // If the stream was aborted, do not write remnant + if (isAborted(stream, callback)) { + return; + } + + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError( + stream, + new MongoOperationTimeoutError( + `Upload timed out after ${stream.timeoutContext?.timeoutMS}ms` + ), + callback + ); + } + ++stream.state.outstandingRequests; + stream.chunks + .insertOne(doc, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }) + .then( + () => { + --stream.state.outstandingRequests; + checkDone(stream, callback); + }, + error => { + return handleError(stream, error, callback); + } + ); +} + +function isAborted(stream: GridFSBucketWriteStream, callback: Callback): boolean { + if (stream.state.aborted) { + queueMicrotask(() => callback(new MongoAPIError('Stream has been aborted'))); + return true; + } + return false; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/index.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/index.ts new file mode 100644 index 00000000..ef151a64 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/index.ts @@ -0,0 +1,636 @@ +import { Admin } from './admin'; +import { OrderedBulkOperation } from './bulk/ordered'; +import { UnorderedBulkOperation } from './bulk/unordered'; +import { ChangeStream } from './change_stream'; +import { Collection } from './collection'; +import { AbstractCursor } from './cursor/abstract_cursor'; +import { AggregationCursor } from './cursor/aggregation_cursor'; +import { FindCursor } from './cursor/find_cursor'; +import { ListCollectionsCursor } from './cursor/list_collections_cursor'; +import { ListIndexesCursor } from './cursor/list_indexes_cursor'; +import type { RunCommandCursor } from './cursor/run_command_cursor'; +import { Db } from './db'; +import { GridFSBucket } from './gridfs'; +import { GridFSBucketReadStream } from './gridfs/download'; +import { GridFSBucketWriteStream } from './gridfs/upload'; +import { MongoClient } from './mongo_client'; +import { CancellationToken } from './mongo_types'; +import { ClientSession } from './sessions'; + +/** @public */ +export { BSON } from './bson'; +export { + Binary, + BSONRegExp, + BSONSymbol, + BSONType, + Code, + DBRef, + Decimal128, + Double, + Int32, + Long, + MaxKey, + MinKey, + ObjectId, + Timestamp, + UUID +} from './bson'; +export { + type AnyBulkWriteOperation, + type BulkWriteOptions, + MongoBulkWriteError +} from './bulk/common'; +export { ClientEncryption } from './client-side-encryption/client_encryption'; +export { ChangeStreamCursor } from './cursor/change_stream_cursor'; +export { ExplainableCursor } from './cursor/explainable_cursor'; +export { + MongoAPIError, + MongoAWSError, + MongoAzureError, + MongoBatchReExecutionError, + MongoChangeStreamError, + MongoClientBulkWriteCursorError, + MongoClientBulkWriteError, + MongoClientBulkWriteExecutionError, + MongoClientClosedError, + MongoCompatibilityError, + MongoCursorExhaustedError, + MongoCursorInUseError, + MongoDecompressionError, + MongoDriverError, + MongoError, + MongoExpiredSessionError, + MongoGCPError, + MongoGridFSChunkError, + MongoGridFSStreamError, + MongoInvalidArgumentError, + MongoKerberosError, + MongoMissingCredentialsError, + MongoMissingDependencyError, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoNotConnectedError, + MongoOIDCError, + MongoOperationTimeoutError, + MongoParseError, + MongoRuntimeError, + MongoServerClosedError, + MongoServerError, + MongoServerSelectionError, + MongoStalePrimaryError, + MongoSystemError, + MongoTailableCursorError, + MongoTopologyClosedError, + MongoTransactionError, + MongoUnexpectedServerResponseError, + MongoWriteConcernError, + WriteConcernErrorResult +} from './error'; +export { + AbstractCursor, + // Actual driver classes exported + Admin, + AggregationCursor, + CancellationToken, + ChangeStream, + ClientSession, + Collection, + Db, + FindCursor, + GridFSBucket, + GridFSBucketReadStream, + GridFSBucketWriteStream, + ListCollectionsCursor, + ListIndexesCursor, + MongoClient, + OrderedBulkOperation, + RunCommandCursor, + UnorderedBulkOperation +}; + +// enums +export { BatchType } from './bulk/common'; +export { AutoEncryptionLoggerLevel } from './client-side-encryption/auto_encrypter'; +export { GSSAPICanonicalizationValue } from './cmap/auth/gssapi'; +export { AuthMechanism } from './cmap/auth/providers'; +export { Compressor } from './cmap/wire_protocol/compression'; +export { CURSOR_FLAGS, CursorTimeoutMode } from './cursor/abstract_cursor'; +export { MongoErrorLabel } from './error'; +export { ExplainVerbosity } from './explain'; +export { ServerApiVersion } from './mongo_client'; +export { MongoLoggableComponent, SeverityLevel } from './mongo_logger'; +export { ReturnDocument } from './operations/find_and_modify'; +export { ProfilingLevel } from './operations/set_profiling_level'; +export { ReadConcernLevel } from './read_concern'; +export { ReadPreferenceMode } from './read_preference'; +export { ServerType, TopologyType } from './sdam/common'; + +// Helper classes +export type { AWSCredentialProvider } from './cmap/auth/aws_temporary_credentials'; +export type { AWSCredentials } from './deps'; +export { ReadConcern } from './read_concern'; +export { ReadPreference } from './read_preference'; +export { WriteConcern } from './write_concern'; +// events +export { + CommandFailedEvent, + CommandStartedEvent, + CommandSucceededEvent +} from './cmap/command_monitoring_events'; +export { + ConnectionCheckedInEvent, + ConnectionCheckedOutEvent, + ConnectionCheckOutFailedEvent, + ConnectionCheckOutStartedEvent, + ConnectionClosedEvent, + ConnectionCreatedEvent, + ConnectionPoolClearedEvent, + ConnectionPoolClosedEvent, + ConnectionPoolCreatedEvent, + ConnectionPoolMonitoringEvent, + ConnectionPoolReadyEvent, + ConnectionReadyEvent +} from './cmap/connection_pool_events'; +export { + ServerClosedEvent, + ServerDescriptionChangedEvent, + ServerHeartbeatFailedEvent, + ServerHeartbeatStartedEvent, + ServerHeartbeatSucceededEvent, + ServerOpeningEvent, + TopologyClosedEvent, + TopologyDescriptionChangedEvent, + TopologyOpeningEvent +} from './sdam/events'; +export { + ServerSelectionEvent, + ServerSelectionFailedEvent, + ServerSelectionStartedEvent, + ServerSelectionSucceededEvent, + WaitingForSuitableServerEvent +} from './sdam/server_selection_events'; +export { SrvPollingEvent } from './sdam/srv_polling'; + +// type only exports below, these are removed from emitted JS +export type { AdminPrivate } from './admin'; +export type { BSONElement, BSONSerializeOptions, Document } from './bson'; +export type { deserialize, serialize } from './bson'; +export type { + BulkResult, + BulkWriteOperationError, + BulkWriteResult, + DeleteManyModel, + DeleteOneModel, + InsertOneModel, + ReplaceOneModel, + UpdateManyModel, + UpdateOneModel, + WriteConcernError, + WriteError +} from './bulk/common'; +export type { + Batch, + BulkOperationBase, + BulkOperationPrivate, + FindOperators, + WriteConcernErrorData +} from './bulk/common'; +export type { + ChangeStreamCollModDocument, + ChangeStreamCreateDocument, + ChangeStreamCreateIndexDocument, + ChangeStreamDeleteDocument, + ChangeStreamDocument, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentOperationDescription, + ChangeStreamDocumentWallTime, + ChangeStreamDropDatabaseDocument, + ChangeStreamDropDocument, + ChangeStreamDropIndexDocument, + ChangeStreamEvents, + ChangeStreamInsertDocument, + ChangeStreamInvalidateDocument, + ChangeStreamNameSpace, + ChangeStreamOptions, + ChangeStreamRefineCollectionShardKeyDocument, + ChangeStreamRenameDocument, + ChangeStreamReplaceDocument, + ChangeStreamReshardCollectionDocument, + ChangeStreamShardCollectionDocument, + ChangeStreamSplitEvent, + ChangeStreamUpdateDocument, + OperationTime, + ResumeToken, + UpdateDescription +} from './change_stream'; +export type { AutoEncrypter } from './client-side-encryption/auto_encrypter'; +export type { AutoEncryptionOptions } from './client-side-encryption/auto_encrypter'; +export type { AutoEncryptionExtraOptions } from './client-side-encryption/auto_encrypter'; +export type { + AWSEncryptionKeyOptions, + AzureEncryptionKeyOptions, + ClientEncryptionCreateDataKeyProviderOptions, + ClientEncryptionEncryptOptions, + ClientEncryptionOptions, + ClientEncryptionRewrapManyDataKeyProviderOptions, + ClientEncryptionRewrapManyDataKeyResult, + DataKey, + GCPEncryptionKeyOptions, + KMIPEncryptionKeyOptions, + RangeOptions, + StringQueryOptions, + TextQueryOptions +} from './client-side-encryption/client_encryption'; +export { + MongoCryptAzureKMSRequestError, + MongoCryptCreateDataKeyError, + MongoCryptCreateEncryptedCollectionError, + MongoCryptError, + MongoCryptInvalidArgumentError, + MongoCryptKMSRequestNetworkTimeoutError +} from './client-side-encryption/errors'; +export type { + ClientEncryptionSocketOptions, + ClientEncryptionTlsOptions, + CSFLEKMSTlsOptions, + KMSConnectCallback +} from './client-side-encryption/kms_options'; +export type { MongocryptdManager } from './client-side-encryption/mongocryptd_manager'; +export type { + AWSKMSProviderConfiguration, + AzureKMSProviderConfiguration, + ClientEncryptionDataKeyProvider, + CredentialProviders, + GCPKMSProviderConfiguration, + KMIPKMSProviderConfiguration, + KMSProviders, + LocalKMSProviderConfiguration +} from './client-side-encryption/providers/index'; +export type { StateMachineExecutable } from './client-side-encryption/state_machine'; +export type { AuthContext, AuthProvider } from './cmap/auth/auth_provider'; +export type { + AuthMechanismProperties, + MongoCredentials, + MongoCredentialsOptions +} from './cmap/auth/mongo_credentials'; +export type { + IdPInfo, + IdPServerResponse, + OIDCCallbackFunction, + OIDCCallbackParams, + OIDCResponse +} from './cmap/auth/mongodb_oidc'; +export type { Workflow } from './cmap/auth/mongodb_oidc'; +export type { TokenCache } from './cmap/auth/mongodb_oidc/token_cache'; +export type { + MessageHeader, + OpCompressedRequest, + OpCompressesRequestOptions, + OpMsgOptions, + OpMsgRequest, + OpMsgResponse, + OpQueryOptions, + OpQueryRequest, + OpReply, + WriteProtocolMessageType +} from './cmap/commands'; +export type { HandshakeDocument } from './cmap/connect'; +export type { LEGAL_TCP_SOCKET_OPTIONS, LEGAL_TLS_SOCKET_OPTIONS, Stream } from './cmap/connect'; +export type { + CommandOptions, + Connection, + ConnectionEvents, + ConnectionOptions, + ProxyOptions +} from './cmap/connection'; +export type { + ConnectionPool, + ConnectionPoolEvents, + ConnectionPoolOptions, + PoolState, + WaitQueueMember, + WithConnectionCallback +} from './cmap/connection_pool'; +export type { ClientMetadata } from './cmap/handshake/client_metadata'; +export type { ConnectionPoolMetrics } from './cmap/metrics'; +export type { StreamDescription, StreamDescriptionOptions } from './cmap/stream_description'; +export type { CompressorName } from './cmap/wire_protocol/compression'; +export type { + JSTypeOf, + OnDemandDocument, + OnDemandDocumentDeserializeOptions +} from './cmap/wire_protocol/on_demand/document'; +export type { + CursorResponse, + MongoDBResponse, + MongoDBResponseConstructor +} from './cmap/wire_protocol/responses'; +export type { + CollectionOptions, + CollectionPrivate, + CountDocumentsOptions, + ModifyResult +} from './collection'; +export type { + COMMAND_FAILED, + COMMAND_STARTED, + COMMAND_SUCCEEDED, + CONNECTION_CHECK_OUT_FAILED, + CONNECTION_CHECK_OUT_STARTED, + CONNECTION_CHECKED_IN, + CONNECTION_CHECKED_OUT, + CONNECTION_CLOSED, + CONNECTION_CREATED, + CONNECTION_POOL_CLEARED, + CONNECTION_POOL_CLOSED, + CONNECTION_POOL_CREATED, + CONNECTION_POOL_READY, + CONNECTION_READY, + MONGO_CLIENT_EVENTS, + SERVER_CLOSED, + SERVER_DESCRIPTION_CHANGED, + SERVER_HEARTBEAT_FAILED, + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED, + SERVER_OPENING, + SERVER_SELECTION_FAILED, + SERVER_SELECTION_STARTED, + SERVER_SELECTION_SUCCEEDED, + TOPOLOGY_CLOSED, + TOPOLOGY_DESCRIPTION_CHANGED, + TOPOLOGY_OPENING, + WAITING_FOR_SUITABLE_SERVER +} from './constants'; +export type { + AbstractCursorEvents, + AbstractCursorOptions, + CursorFlag +} from './cursor/abstract_cursor'; +export type { + CursorTimeoutContext, + InitialCursorResponse, + InternalAbstractCursorOptions +} from './cursor/abstract_cursor'; +export type { AggregationCursorOptions } from './cursor/aggregation_cursor'; +export type { ChangeStreamCursorOptions } from './cursor/change_stream_cursor'; +export type { + ListSearchIndexesCursor, + ListSearchIndexesOptions +} from './cursor/list_search_indexes_cursor'; +export type { RunCursorCommandOptions } from './cursor/run_command_cursor'; +export type { DbOptions, DbPrivate } from './db'; +export type { Encrypter, EncrypterOptions } from './encrypter'; +export type { AnyError, ErrorDescription, MongoNetworkErrorOptions } from './error'; +export type { + Explain, + ExplainCommandOptions, + ExplainOptions, + ExplainVerbosityLike +} from './explain'; +export type { + GridFSBucketReadStreamOptions, + GridFSBucketReadStreamOptionsWithRevision, + GridFSBucketReadStreamPrivate, + GridFSFile +} from './gridfs/download'; +export type { GridFSBucketEvents, GridFSBucketOptions, GridFSBucketPrivate } from './gridfs/index'; +export type { GridFSBucketWriteStreamOptions, GridFSChunk } from './gridfs/upload'; +export type { + Auth, + DriverInfo, + MongoClientEvents, + MongoClientOptions, + MongoClientPrivate, + MongoOptions, + PkFactory, + ServerApi, + SupportedNodeConnectionOptions, + SupportedSocketOptions, + SupportedTLSConnectionOptions, + SupportedTLSSocketOptions, + WithSessionCallback +} from './mongo_client'; +export { MongoClientAuthProviders } from './mongo_client_auth_providers'; +export type { + Log, + LogComponentSeveritiesClientOptions, + LogConvertible, + Loggable, + LoggableCommandFailedEvent, + LoggableCommandSucceededEvent, + LoggableEvent, + LoggableServerHeartbeatFailedEvent, + LoggableServerHeartbeatStartedEvent, + LoggableServerHeartbeatSucceededEvent, + MongoDBLogWritable, + MongoLogger, + MongoLoggerEnvOptions, + MongoLoggerMongoClientOptions, + MongoLoggerOptions +} from './mongo_logger'; +export type { + Abortable, + CommonEvents, + EventsDescription, + GenericListener, + TypedEventEmitter +} from './mongo_types'; +export type { + AcceptedFields, + AddToSetOperators, + AlternativeType, + ArrayElement, + ArrayOperator, + BitwiseFilter, + BSONTypeAlias, + Condition, + EnhancedOmit, + Filter, + FilterOperations, + FilterOperators, + Flatten, + InferIdType, + IntegerType, + IsAny, + Join, + KeysOfAType, + KeysOfOtherType, + MatchKeysAndValues, + NestedPaths, + NestedPathsOfType, + NonObjectIdLikeDocument, + NotAcceptedFields, + NumericType, + OneOrMore, + OnlyFieldsOfType, + OptionalId, + OptionalUnlessRequiredId, + PropertyType, + PullAllOperator, + PullOperator, + PushOperator, + RegExpOrString, + RootFilterOperators, + SchemaMember, + SetFields, + StrictFilter, + StrictMatchKeysAndValues, + StrictUpdateFilter, + UpdateFilter, + WithId, + WithoutId +} from './mongo_types'; +export type { + AggregateOperation, + AggregateOptions, + DB_AGGREGATE_COLLECTION +} from './operations/aggregate'; +export type { + AnyClientBulkWriteModel, + ClientBulkWriteError, + ClientBulkWriteModel, + ClientBulkWriteOptions, + ClientBulkWriteResult, + ClientDeleteManyModel, + ClientDeleteOneModel, + ClientDeleteResult, + ClientInsertOneModel, + ClientInsertOneResult, + ClientReplaceOneModel, + ClientUpdateManyModel, + ClientUpdateOneModel, + ClientUpdateResult, + ClientWriteModel +} from './operations/client_bulk_write/common'; +export type { + CollationOptions, + CommandOperation, + CommandOperationOptions, + OperationParent +} from './operations/command'; +export type { CountOptions } from './operations/count'; +export type { + ClusteredCollectionOptions, + CreateCollectionOptions, + TimeSeriesCollectionOptions +} from './operations/create_collection'; +export type { DeleteOptions, DeleteResult, DeleteStatement } from './operations/delete'; +export type { DistinctOptions } from './operations/distinct'; +export type { DropCollectionOptions, DropDatabaseOptions } from './operations/drop'; +export type { EstimatedDocumentCountOptions } from './operations/estimated_document_count'; +export type { FindOneOptions, FindOptions } from './operations/find'; +export type { + FindOneAndDeleteOptions, + FindOneAndReplaceOptions, + FindOneAndUpdateOptions +} from './operations/find_and_modify'; +export type { IndexInformationOptions } from './operations/indexes'; +export type { + CreateIndexesOptions, + DropIndexesOptions, + IndexDescription, + IndexDescriptionCompact, + IndexDescriptionInfo, + IndexDirection, + IndexSpecification, + ListIndexesOptions +} from './operations/indexes'; +export type { InsertManyResult, InsertOneOptions, InsertOneResult } from './operations/insert'; +export type { CollectionInfo, ListCollectionsOptions } from './operations/list_collections'; +export type { ListDatabasesOptions, ListDatabasesResult } from './operations/list_databases'; +export type { AbstractOperation, Hint, OperationOptions } from './operations/operation'; +export type { ProfilingLevelOptions } from './operations/profiling_level'; +export type { RemoveUserOptions } from './operations/remove_user'; +export type { RenameOptions } from './operations/rename'; +export type { RunCommandOptions } from './operations/run_command'; +export type { SearchIndexDescription } from './operations/search_indexes/create'; +export type { SetProfilingLevelOptions } from './operations/set_profiling_level'; +export type { DbStatsOptions } from './operations/stats'; +export type { + ReplaceOptions, + UpdateOptions, + UpdateResult, + UpdateStatement +} from './operations/update'; +export type { ValidateCollectionOptions } from './operations/validate_collection'; +export type { ReadConcernLike } from './read_concern'; +export type { + HedgeOptions, + ReadPreferenceFromOptions, + ReadPreferenceLike, + ReadPreferenceLikeOptions, + ReadPreferenceOptions +} from './read_preference'; +export type { OsAdapter, Runtime, RuntimeAdapters } from './runtime_adapters'; +export type { ClusterTime } from './sdam/common'; +export type { + Monitor, + MonitorEvents, + MonitorInterval, + MonitorIntervalOptions, + MonitorOptions, + MonitorPrivate, + RTTPinger, + RTTPingerOptions, + RTTSampler, + ServerMonitoringMode +} from './sdam/monitor'; +export type { + Server, + ServerCommandOptions, + ServerEvents, + ServerOptions, + ServerPrivate +} from './sdam/server'; +export type { + ServerDescription, + ServerDescriptionOptions, + TagSet, + TopologyVersion +} from './sdam/server_description'; +export type { DeprioritizedServers, ServerSelector } from './sdam/server_selection'; +export type { SrvPoller, SrvPollerEvents, SrvPollerOptions } from './sdam/srv_polling'; +export type { + ConnectOptions, + SelectServerOptions, + ServerSelectionCallback, + ServerSelectionRequest, + Topology, + TopologyEvents, + TopologyOptions, + TopologyPrivate +} from './sdam/topology'; +export type { TopologyDescription, TopologyDescriptionOptions } from './sdam/topology_description'; +export type { + ClientSessionEvents, + ClientSessionOptions, + EndSessionOptions, + ServerSession, + ServerSessionId, + ServerSessionPool, + WithTransactionCallback +} from './sessions'; +export type { Sort, SortDirection, SortDirectionForCmd, SortForCmd } from './sort'; +export type { + CSOTTimeoutContext, + CSOTTimeoutContextOptions, + LegacyTimeoutContext, + LegacyTimeoutContextOptions, + Timeout, + TimeoutContext, + TimeoutContextOptions +} from './timeout'; +export type { Transaction, TransactionOptions, TxnState } from './transactions'; +export type { + BufferPool, + Callback, + EventEmitterWithState, + HostAddress, + List, + MongoDBCollectionNamespace, + MongoDBNamespace +} from './utils'; +export type { W, WriteConcernOptions, WriteConcernSettings } from './write_concern'; diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client.ts new file mode 100644 index 00000000..f4c0cde2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client.ts @@ -0,0 +1,1182 @@ +import { promises as fs } from 'fs'; +import type { TcpNetConnectOpts } from 'net'; +import type { ConnectionOptions as TLSConnectionOptions, TLSSocketOptions } from 'tls'; + +import { TopologyType } from '.'; +import { type BSONSerializeOptions, type Document, resolveBSONOptions } from './bson'; +import { ChangeStream, type ChangeStreamDocument, type ChangeStreamOptions } from './change_stream'; +import type { AutoEncrypter, AutoEncryptionOptions } from './client-side-encryption/auto_encrypter'; +import { + type AuthMechanismProperties, + DEFAULT_ALLOWED_HOSTS, + type MongoCredentials +} from './cmap/auth/mongo_credentials'; +import { type TokenCache } from './cmap/auth/mongodb_oidc/token_cache'; +import { AuthMechanism } from './cmap/auth/providers'; +import type { LEGAL_TCP_SOCKET_OPTIONS, LEGAL_TLS_SOCKET_OPTIONS } from './cmap/connect'; +import type { Connection } from './cmap/connection'; +import { + type ClientMetadata, + isDriverInfoEqual, + makeClientMetadata +} from './cmap/handshake/client_metadata'; +import type { CompressorName } from './cmap/wire_protocol/compression'; +import { parseOptions, resolveSRVRecord } from './connection_string'; +import { MONGO_CLIENT_EVENTS } from './constants'; +import { type AbstractCursor } from './cursor/abstract_cursor'; +import { Db, type DbOptions } from './db'; +import type { Encrypter } from './encrypter'; +import { MongoInvalidArgumentError } from './error'; +import { MongoClientAuthProviders } from './mongo_client_auth_providers'; +import { + type LogComponentSeveritiesClientOptions, + type MongoDBLogWritable, + MongoLogger, + type MongoLoggerOptions, + SeverityLevel +} from './mongo_logger'; +import { TypedEventEmitter } from './mongo_types'; +import { + type ClientBulkWriteModel, + type ClientBulkWriteOptions, + type ClientBulkWriteResult +} from './operations/client_bulk_write/common'; +import { ClientBulkWriteExecutor } from './operations/client_bulk_write/executor'; +import { EndSessionsOperation } from './operations/end_sessions'; +import { executeOperation } from './operations/execute_operation'; +import type { ReadConcern, ReadConcernLevel, ReadConcernLike } from './read_concern'; +import { ReadPreference, type ReadPreferenceMode } from './read_preference'; +import { type Runtime, type RuntimeAdapters } from './runtime_adapters'; +import type { ServerMonitoringMode } from './sdam/monitor'; +import type { TagSet } from './sdam/server_description'; +import { DeprioritizedServers, readPreferenceServerSelector } from './sdam/server_selection'; +import type { SrvPoller } from './sdam/srv_polling'; +import { Topology, type TopologyEvents } from './sdam/topology'; +import { ClientSession, type ClientSessionOptions, ServerSessionPool } from './sessions'; +import { + COSMOS_DB_CHECK, + COSMOS_DB_MSG, + DOCUMENT_DB_CHECK, + DOCUMENT_DB_MSG, + type HostAddress, + hostMatchesWildcards, + isHostMatch, + type MongoDBNamespace, + noop, + ns, + resolveOptions, + squashError +} from './utils'; +import type { W, WriteConcern, WriteConcernSettings } from './write_concern'; + +/** @public */ +export const ServerApiVersion = Object.freeze({ + v1: '1' +} as const); + +/** @public */ +export type ServerApiVersion = (typeof ServerApiVersion)[keyof typeof ServerApiVersion]; + +/** @public */ +export interface ServerApi { + version: ServerApiVersion; + strict?: boolean; + deprecationErrors?: boolean; +} + +/** @public */ +export interface DriverInfo { + name?: string; + version?: string; + platform?: string; +} + +/** @public */ +export interface Auth { + /** The username for auth */ + username?: string; + /** The password for auth */ + password?: string; +} + +/** @public */ +export interface PkFactory { + createPk(): any; +} + +/** @public */ +export type SupportedTLSConnectionOptions = Pick< + TLSConnectionOptions & { + allowPartialTrustChain?: boolean; + }, + (typeof LEGAL_TLS_SOCKET_OPTIONS)[number] +>; + +/** @public */ +export type SupportedTLSSocketOptions = Pick< + TLSSocketOptions, + Extract +>; + +/** @public */ +export type SupportedSocketOptions = Pick< + TcpNetConnectOpts & { + autoSelectFamily?: boolean; + autoSelectFamilyAttemptTimeout?: number; + /** Node.JS socket option to set the time the first keepalive probe is sent on an idle socket. Defaults to 120000ms */ + keepAliveInitialDelay?: number; + }, + (typeof LEGAL_TCP_SOCKET_OPTIONS)[number] +>; + +/** @public */ +export type SupportedNodeConnectionOptions = SupportedTLSConnectionOptions & + SupportedTLSSocketOptions & + SupportedSocketOptions; + +/** + * Describes all possible URI query options for the mongo client + * @public + * @see https://www.mongodb.com/docs/manual/reference/connection-string + */ +export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeConnectionOptions { + /** Specifies the name of the replica set, if the mongod is a member of a replica set. */ + replicaSet?: string; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; + /** Enables or disables TLS/SSL for the connection. */ + tls?: boolean; + /** A boolean to enable or disables TLS/SSL for the connection. (The ssl option is equivalent to the tls option.) */ + ssl?: boolean; + /** Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key. */ + tlsCertificateKeyFile?: string; + /** Specifies the password to de-crypt the tlsCertificateKeyFile. */ + tlsCertificateKeyFilePassword?: string; + /** Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. This file is used to validate the certificate presented by the mongod/mongos instance. */ + tlsCAFile?: string; + /** Specifies the location of a local CRL .pem file that contains the client revokation list. */ + tlsCRLFile?: string; + /** Bypasses validation of the certificates presented by the mongod/mongos instance */ + tlsAllowInvalidCertificates?: boolean; + /** Disables hostname validation of the certificate presented by the mongod/mongos instance. */ + tlsAllowInvalidHostnames?: boolean; + /** Disables various certificate validations. */ + tlsInsecure?: boolean; + /** The time in milliseconds to attempt a connection before timing out. */ + connectTimeoutMS?: number; + /** The time in milliseconds to attempt a send or receive on a socket before the attempt times out. */ + socketTimeoutMS?: number; + /** An array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */ + compressors?: CompressorName[] | string; + /** An integer that specifies the compression level if using zlib for network compression. */ + zlibCompressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; + /** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */ + srvMaxHosts?: number; + /** + * Modifies the srv URI to look like: + * + * `_{srvServiceName}._tcp.{hostname}.{domainname}` + * + * Querying this DNS URI is expected to respond with SRV records + */ + srvServiceName?: string; + /** The maximum number of connections in the connection pool. */ + maxPoolSize?: number; + /** The minimum number of connections in the connection pool. */ + minPoolSize?: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting?: number; + /** + * The maximum amount of time a connection should remain idle in the connection pool before being marked idle, in milliseconds. + * If specified, this must be a number greater than or equal to 0, where 0 means there is no limit. Defaults to 0. After this + * time passes, the idle collection can be automatically cleaned up in the background. + */ + maxIdleTimeMS?: number; + /** The maximum time in milliseconds that a thread can wait for a connection to become available. */ + waitQueueTimeoutMS?: number; + /** Specify a read concern for the collection (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The level of isolation */ + readConcernLevel?: ReadConcernLevel; + /** Specifies the read preferences for this connection */ + readPreference?: ReadPreferenceMode | ReadPreference; + /** Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. */ + maxStalenessSeconds?: number; + /** Specifies the tags document as a comma-separated list of colon-separated key-value pairs. */ + readPreferenceTags?: TagSet[]; + /** The auth settings for when connection to server. */ + auth?: Auth; + /** Specify the database name associated with the user’s credentials. */ + authSource?: string; + /** Specify the authentication mechanism that MongoDB will use to authenticate the connection. */ + authMechanism?: AuthMechanism; + /** Specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */ + authMechanismProperties?: AuthMechanismProperties; + /** The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */ + localThresholdMS?: number; + /** Specifies how long (in milliseconds) to block for server selection before throwing an exception. */ + serverSelectionTimeoutMS?: number; + /** heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment. Specify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one. */ + heartbeatFrequencyMS?: number; + /** Sets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. */ + minHeartbeatFrequencyMS?: number; + /** The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections */ + appName?: string; + /** Enables retryable reads. */ + retryReads?: boolean; + /** Enable retryable writes. */ + retryWrites?: boolean; + /** + * The maximum number of retries during server overload. Set to 0 to disable overload retries. Defaults to 2. + * @see https://www.mongodb.com/docs/atlas/overload-errors + * + * This option works with MongoDB Atlas Server Version 9.0 and above. + * */ + maxAdaptiveRetries?: number; + /** + * Whether or not to enable overload retargeting. Defaults to false. + * @see https://www.mongodb.com/docs/atlas/overload-errors + * More information about the overload policy in drivers: + * @see https://github.com/mongodb/specifications/blob/master/source/client-backpressure/client-backpressure.md#overload-retry-policy + * + * This option works with MongoDB Atlas Server Version 9.0 and above. + * */ + enableOverloadRetargeting?: boolean; + /** Allow a driver to force a Single topology type with a connection string containing one host */ + directConnection?: boolean; + /** Instruct the driver it is connecting to a load balancer fronting a mongos like service */ + loadBalanced?: boolean; + /** + * The write concern w value + * @deprecated Please use the `writeConcern` option instead + */ + w?: W; + /** + * The write concern timeout + * @deprecated Please use the `writeConcern` option instead + */ + wtimeoutMS?: number; + /** + * The journal write concern + * @deprecated Please use the `writeConcern` option instead + */ + journal?: boolean; + /** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * + * @see https://www.mongodb.com/docs/manual/reference/write-concern/ + */ + writeConcern?: WriteConcern | WriteConcernSettings; + /** TCP Connection no delay */ + noDelay?: boolean; + /** Force server to assign `_id` values instead of driver */ + forceServerObjectId?: boolean; + /** A primary key factory function for generation of custom `_id` keys */ + pkFactory?: PkFactory; + /** Enable command monitoring for this client */ + monitorCommands?: boolean; + /** Server API version */ + serverApi?: ServerApi | ServerApiVersion; + /** + * Optionally enable in-use auto encryption + * + * @remarks + * Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error + * (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.md#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts. + * + * Automatic encryption requires the authenticated user to have the [listCollections privilege action](https://www.mongodb.com/docs/manual/reference/command/listCollections/#dbcmd.listCollections). + * + * If a MongoClient with a limited connection pool size (i.e a non-zero maxPoolSize) is configured with AutoEncryptionOptions, a separate internal MongoClient is created if any of the following are true: + * - AutoEncryptionOptions.keyVaultClient is not passed. + * - AutoEncryptionOptions.bypassAutomaticEncryption is false. + * + * If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted. + */ + autoEncryption?: AutoEncryptionOptions; + /** + * Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver + /* @deprecated - Will be made internal in a future major release. + */ + driverInfo?: DriverInfo; + /** Configures a Socks5 proxy host used for creating TCP connections. */ + proxyHost?: string; + /** Configures a Socks5 proxy port used for creating TCP connections. */ + proxyPort?: number; + /** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */ + proxyUsername?: string; + /** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */ + proxyPassword?: string; + /** Instructs the driver monitors to use a specific monitoring mode */ + serverMonitoringMode?: ServerMonitoringMode; + /** + * @public + * Specifies the destination of the driver's logging. The default is stderr. + */ + mongodbLogPath?: 'stderr' | 'stdout' | MongoDBLogWritable; + /** + * @public + * Enable logging level per component or use `default` to control any unset components. + */ + mongodbLogComponentSeverities?: LogComponentSeveritiesClientOptions; + /** + * @public + * All BSON documents are stringified to EJSON. This controls the maximum length of those strings. + * It is defaulted to 1000. + */ + mongodbLogMaxDocumentLength?: number; + + /** @internal */ + srvPoller?: SrvPoller; + /** @internal */ + connectionType?: typeof Connection; + /** @internal */ + __skipPingOnConnect?: boolean; + /** + * @experimental + * + * If provided, any adapters provided will be used in place of the corresponding Node.js module. + */ + runtimeAdapters?: RuntimeAdapters; +} + +/** @public */ +export type WithSessionCallback = (session: ClientSession) => Promise; + +/** @internal */ +export interface MongoClientPrivate { + url: string; + bsonOptions: BSONSerializeOptions; + namespace: MongoDBNamespace; + hasBeenClosed: boolean; + authProviders: MongoClientAuthProviders; + /** + * We keep a reference to the sessions that are acquired from the pool. + * - used to track and close all sessions in client.close() (which is non-standard behavior) + * - used to notify the leak checker in our tests if test author forgot to clean up explicit sessions + */ + readonly activeSessions: Set; + /** + * We keep a reference to the cursors that are created from this client. + * - used to track and close all cursors in client.close(). + * Cursors in this set are ones that still need to have their close method invoked (no other conditions are considered) + */ + readonly activeCursors: Set; + readonly sessionPool: ServerSessionPool; + readonly options: MongoOptions; + readonly readConcern?: ReadConcern; + readonly writeConcern?: WriteConcern; + readonly readPreference: ReadPreference; + readonly isMongoClient: true; +} + +/** @public */ +export type MongoClientEvents = Pick & { + // In previous versions the open event emitted a topology, in an effort to no longer + // expose internals but continue to expose this useful event API, it now emits a mongoClient + open(mongoClient: MongoClient): void; +}; + +/** + * @public + * + * The **MongoClient** class is a class that allows for making Connections to MongoDB. + * + * **NOTE:** The programmatically provided options take precedence over the URI options. + * + * @remarks + * + * A MongoClient is the entry point to connecting to a MongoDB server. + * + * It handles a multitude of features on your application's behalf: + * - **Server Host Connection Configuration**: A MongoClient is responsible for reading TLS cert, ca, and crl files if provided. + * - **SRV Record Polling**: A "`mongodb+srv`" style connection string is used to have the MongoClient resolve DNS SRV records of all server hostnames which the driver periodically monitors for changes and adjusts its current view of hosts correspondingly. + * - **Server Monitoring**: The MongoClient automatically keeps monitoring the health of server nodes in your cluster to reach out to the correct and lowest latency one available. + * - **Connection Pooling**: To avoid paying the cost of rebuilding a connection to the server on every operation the MongoClient keeps idle connections preserved for reuse. + * - **Session Pooling**: The MongoClient creates logical sessions that enable retryable writes, causal consistency, and transactions. It handles pooling these sessions for reuse in subsequent operations. + * - **Cursor Operations**: A MongoClient's cursors use the health monitoring system to send the request for more documents to the same server the query began on. + * - **Mongocryptd process**: When using auto encryption, a MongoClient will launch a `mongocryptd` instance for handling encryption if the mongocrypt shared library isn't in use. + * + * There are many more features of a MongoClient that are not listed above. + * + * In order to enable these features, a number of asynchronous Node.js resources are established by the driver: Timers, FS Requests, Sockets, etc. + * For details on cleanup, please refer to the MongoClient `close()` documentation. + * + * @example + * ```ts + * import { MongoClient } from 'mongodb'; + * // Enable command monitoring for debugging + * const client = new MongoClient('mongodb://localhost:27017?appName=mflix', { monitorCommands: true }); + * ``` + */ +export class MongoClient extends TypedEventEmitter implements AsyncDisposable { + /** @internal */ + s: MongoClientPrivate; + /** @internal */ + topology?: Topology; + /** @internal */ + override readonly mongoLogger: MongoLogger | undefined; + /** @internal */ + private connectionLock?: Promise; + /** @internal */ + private closeLock?: Promise; + + /** + * The consolidate, parsed, transformed and merged options. + */ + public readonly options: Readonly< + Omit + > & + Pick & { + /** @internal */ + metadata: Promise; + }; + + private driverInfoList: DriverInfo[] = []; + + constructor(url: string, options?: MongoClientOptions) { + super(); + this.on('error', noop); + + this.options = parseOptions(url, this, options); + + this.appendMetadata(this.options.driverInfo); + + const shouldSetLogger = Object.values(this.options.mongoLoggerOptions.componentSeverities).some( + value => value !== SeverityLevel.OFF + ); + this.mongoLogger = shouldSetLogger + ? new MongoLogger(this.options.mongoLoggerOptions) + : undefined; + + // eslint-disable-next-line @typescript-eslint/no-this-alias + const client = this; + + // The internal state + this.s = { + url, + bsonOptions: resolveBSONOptions(this.options), + namespace: ns('admin'), + hasBeenClosed: false, + sessionPool: new ServerSessionPool(this), + activeSessions: new Set(), + activeCursors: new Set(), + authProviders: new MongoClientAuthProviders(), + + get options() { + return client.options; + }, + get readConcern() { + return client.options.readConcern; + }, + get writeConcern() { + return client.options.writeConcern; + }, + get readPreference() { + return client.options.readPreference; + }, + get isMongoClient(): true { + return true; + } + }; + this.checkForNonGenuineHosts(); + } + + /** + * An alias for {@link MongoClient.close|MongoClient.close()}. + */ + async [Symbol.asyncDispose]() { + await this.close(); + } + + /** + * Append metadata to the client metadata after instantiation. + * @param driverInfo - Information about the application or library. + */ + appendMetadata(driverInfo: DriverInfo) { + const isDuplicateDriverInfo = this.driverInfoList.some(info => + isDriverInfoEqual(info, driverInfo) + ); + if (isDuplicateDriverInfo) return; + + this.driverInfoList.push(driverInfo); + this.options.metadata = makeClientMetadata(this.driverInfoList, this.options) + .then(undefined, squashError) + .then(result => result ?? ({} as ClientMetadata)); // ensure Promise + } + + /** @internal */ + private checkForNonGenuineHosts() { + const documentDBHostnames = this.options.hosts.filter((hostAddress: HostAddress) => + isHostMatch(DOCUMENT_DB_CHECK, hostAddress.host) + ); + const srvHostIsDocumentDB = isHostMatch(DOCUMENT_DB_CHECK, this.options.srvHost); + + const cosmosDBHostnames = this.options.hosts.filter((hostAddress: HostAddress) => + isHostMatch(COSMOS_DB_CHECK, hostAddress.host) + ); + const srvHostIsCosmosDB = isHostMatch(COSMOS_DB_CHECK, this.options.srvHost); + + if (documentDBHostnames.length !== 0 || srvHostIsDocumentDB) { + this.mongoLogger?.info('client', DOCUMENT_DB_MSG); + } else if (cosmosDBHostnames.length !== 0 || srvHostIsCosmosDB) { + this.mongoLogger?.info('client', COSMOS_DB_MSG); + } + } + + get serverApi(): Readonly { + return this.options.serverApi && Object.freeze({ ...this.options.serverApi }); + } + /** + * Intended for APM use only + * @internal + */ + get monitorCommands(): boolean { + return this.options.monitorCommands; + } + set monitorCommands(value: boolean) { + this.options.monitorCommands = value; + } + + /** @internal */ + get autoEncrypter(): AutoEncrypter | undefined { + return this.options.autoEncrypter; + } + + get readConcern(): ReadConcern | undefined { + return this.s.readConcern; + } + + get writeConcern(): WriteConcern | undefined { + return this.s.writeConcern; + } + + get readPreference(): ReadPreference { + return this.s.readPreference; + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + get timeoutMS(): number | undefined { + return this.s.options.timeoutMS; + } + + /** + * Executes a client bulk write operation, available on server 8.0+. + * @param models - The client bulk write models. + * @param options - The client bulk write options. + * @returns A ClientBulkWriteResult for acknowledged writes and ok: 1 for unacknowledged writes. + */ + async bulkWrite = Record>( + models: ReadonlyArray>, + options?: ClientBulkWriteOptions + ): Promise { + if (this.autoEncrypter) { + throw new MongoInvalidArgumentError( + 'MongoClient bulkWrite does not currently support automatic encryption.' + ); + } + // We do not need schema type information past this point ("as any" is fine) + return await new ClientBulkWriteExecutor( + this, + models as any, + resolveOptions(this, options) + ).execute(); + } + + /** + * An optional method to verify a handful of assumptions that are generally useful at application boot-time before using a MongoClient. + * For detailed information about the connect process see the MongoClient.connect static method documentation. + * + * @param url - The MongoDB connection string (supports `mongodb://` and `mongodb+srv://` schemes) + * @param options - Optional configuration options for the client + * + * @see https://www.mongodb.com/docs/manual/reference/connection-string/ + */ + async connect(): Promise { + if (this.connectionLock) { + return await this.connectionLock; + } + + try { + this.connectionLock = this._connect(); + await this.connectionLock; + } finally { + // release + this.connectionLock = undefined; + } + + return this; + } + + /** + * Create a topology to open the connection, must be locked to avoid topology leaks in concurrency scenario. + * Locking is enforced by the connect method. + * + * @internal + */ + private async _connect(): Promise { + if (this.topology && this.topology.isConnected()) { + return this; + } + + const options = this.options; + + if (options.tls) { + if (typeof options.tlsCAFile === 'string') { + options.ca ??= await fs.readFile(options.tlsCAFile); + } + if (typeof options.tlsCRLFile === 'string') { + options.crl ??= await fs.readFile(options.tlsCRLFile); + } + if (typeof options.tlsCertificateKeyFile === 'string') { + if (!options.key || !options.cert) { + const contents = await fs.readFile(options.tlsCertificateKeyFile); + options.key ??= contents; + options.cert ??= contents; + } + } + } + if (typeof options.srvHost === 'string') { + const hosts = await resolveSRVRecord(options); + + for (const [index, host] of hosts.entries()) { + options.hosts[index] = host; + } + } + + // It is important to perform validation of hosts AFTER SRV resolution, to check the real hostname, + // but BEFORE we even attempt connecting with a potentially not allowed hostname + if (options.credentials?.mechanism === AuthMechanism.MONGODB_OIDC) { + const allowedHosts = + options.credentials?.mechanismProperties?.ALLOWED_HOSTS || DEFAULT_ALLOWED_HOSTS; + const isServiceAuth = !!options.credentials?.mechanismProperties?.ENVIRONMENT; + if (!isServiceAuth) { + for (const host of options.hosts) { + if (!hostMatchesWildcards(host.toHostPort().host, allowedHosts)) { + throw new MongoInvalidArgumentError( + `Host '${host}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${allowedHosts.join( + ',' + )}'` + ); + } + } + } + } + + this.topology = new Topology(this, options.hosts, options); + // Events can be emitted before initialization is complete so we have to + // save the reference to the topology on the client ASAP if the event handlers need to access it + + this.topology.once(Topology.OPEN, () => this.emit('open', this)); + + for (const event of MONGO_CLIENT_EVENTS) { + this.topology.on(event, (...args: any[]) => this.emit(event, ...(args as any))); + } + + const topologyConnect = async () => { + try { + await this.topology?.connect(options); + } catch (error) { + this.topology?.close(); + throw error; + } + }; + + if (this.autoEncrypter) { + await this.autoEncrypter?.init(); + await topologyConnect(); + await options.encrypter.connectInternalClient(); + } else { + await topologyConnect(); + } + + return this; + } + + /** + * Cleans up resources managed by the MongoClient. + * + * The close method clears and closes all resources whose lifetimes are managed by the MongoClient. + * Please refer to the `MongoClient` class documentation for a high level overview of the client's key features and responsibilities. + * + * **However,** the close method does not handle the cleanup of resources explicitly created by the user. + * Any user-created driver resource with its own `close()` method should be explicitly closed by the user before calling MongoClient.close(). + * This method is written as a "best effort" attempt to leave behind the least amount of resources server-side when possible. + * + * The following list defines ideal preconditions and consequent pitfalls if they are not met. + * The MongoClient, ClientSession, Cursors and ChangeStreams all support [explicit resource management](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html). + * By using explicit resource management to manage the lifetime of driver resources instead of manually managing their lifetimes, the pitfalls outlined below can be avoided. + * + * The close method performs the following in the order listed: + * - Client-side: + * - **Close in-use connections**: Any connections that are currently waiting on a response from the server will be closed. + * This is performed _first_ to avoid reaching the next step (server-side clean up) and having no available connections to check out. + * - _Ideal_: All operations have been awaited or cancelled, and the outcomes, regardless of success or failure, have been processed before closing the client servicing the operation. + * - _Pitfall_: When `client.close()` is called and all connections are in use, after closing them, the client must create new connections for cleanup operations, which comes at the cost of new TLS/TCP handshakes and authentication steps. + * - Server-side: + * - **Close active cursors**: All cursors that haven't been completed will have a `killCursor` operation sent to the server they were initialized on, freeing the server-side resource. + * - _Ideal_: Cursors are explicitly closed or completed before `client.close()` is called. + * - _Pitfall_: `killCursors` may have to build a new connection if the in-use closure ended all pooled connections. + * - **End active sessions**: In-use sessions created with `client.startSession()` or `client.withSession()` or implicitly by the driver will have their `.endSession()` method called. + * Contrary to the name of the method, `endSession()` returns the session to the client's pool of sessions rather than end them on the server. + * - _Ideal_: Transaction outcomes are awaited and their corresponding explicit sessions are ended before `client.close()` is called. + * - _Pitfall_: **This step aborts in-progress transactions**. It is advisable to observe the outcome of a transaction before closing your client. + * - **End all pooled sessions**: The `endSessions` command with all session IDs the client has pooled is sent to the server to inform the cluster it can clean them up. + * - _Ideal_: No user intervention is expected. + * - _Pitfall_: None. + * + * The remaining shutdown is of the MongoClient resources that are intended to be entirely internal but is documented here as their existence relates to the JS event loop. + * + * - Client-side (again): + * - **Stop all server monitoring**: Connections kept live for detecting cluster changes and roundtrip time measurements are shutdown. + * - **Close all pooled connections**: Each server node in the cluster has a corresponding connection pool and all connections in the pool are closed. Any operations waiting to check out a connection will have an error thrown instead of a connection returned. + * - **Clear out server selection queue**: Any operations that are in the process of waiting for a server to be selected will have an error thrown instead of a server returned. + * - **Close encryption-related resources**: An internal MongoClient created for communicating with `mongocryptd` or other encryption purposes is closed. (Using this same method of course!) + * + * After the close method completes there should be no MongoClient related resources [ref-ed in Node.js' event loop](https://docs.libuv.org/en/v1.x/handle.html#reference-counting). + * This should allow Node.js to exit gracefully if MongoClient resources were the only active handles in the event loop. + * + * @param _force - currently an unused flag that has no effect. Defaults to `false`. + */ + async close(_force = false): Promise { + if (this.closeLock) { + return await this.closeLock; + } + + try { + this.closeLock = this._close(); + await this.closeLock; + } finally { + // release + this.closeLock = undefined; + } + } + + /* @internal */ + private async _close(): Promise { + // There's no way to set hasBeenClosed back to false + Object.defineProperty(this.s, 'hasBeenClosed', { + value: true, + enumerable: true, + configurable: false, + writable: false + }); + + this.topology?.closeCheckedOutConnections(); + + const activeCursorCloses = Array.from(this.s.activeCursors, cursor => cursor.close()); + this.s.activeCursors.clear(); + + await Promise.all(activeCursorCloses); + + const activeSessionEnds = Array.from(this.s.activeSessions, session => session.endSession()); + this.s.activeSessions.clear(); + + await Promise.all(activeSessionEnds); + + if (this.topology == null) { + return; + } + + const supportsSessions = + this.topology.description.type === TopologyType.LoadBalanced || + this.topology.description.logicalSessionTimeoutMinutes != null; + + if (supportsSessions) { + await endSessions(this, this.topology); + } + + // clear out references to old topology + const topology = this.topology; + this.topology = undefined; + + topology.close(); + + const { encrypter } = this.options; + if (encrypter) { + await encrypter.close(this); + } + + async function endSessions( + client: MongoClient, + { description: topologyDescription }: Topology + ) { + // If we would attempt to select a server and get nothing back we short circuit + // to avoid the server selection timeout. + const selector = readPreferenceServerSelector(ReadPreference.primaryPreferred); + const serverDescriptions = Array.from(topologyDescription.servers.values()); + const servers = selector(topologyDescription, serverDescriptions, new DeprioritizedServers()); + if (servers.length !== 0) { + const endSessions = Array.from(client.s.sessionPool.sessions, ({ id }) => id); + if (endSessions.length !== 0) { + try { + await executeOperation(client, new EndSessionsOperation(endSessions)); + } catch (error) { + squashError(error); + } + } + } + } + } + + /** + * Create a new Db instance sharing the current socket connections. + * + * @param dbName - The name of the database we want to use. If not provided, use database name from connection string. + * @param options - Optional settings for Db construction + */ + db(dbName?: string, options?: DbOptions): Db { + options = options ?? {}; + + // Default to db from connection string if not provided + if (!dbName) { + dbName = this.s.options.dbName; + } + + // Copy the options and add out internal override of the not shared flag + const finalOptions = Object.assign({}, this.options, options); + + // Return the db object + const db = new Db(this, dbName, finalOptions); + + // Return the database + return db; + } + + /** + * Creates a new MongoClient instance and immediately connects it to MongoDB. + * This convenience method combines `new MongoClient(url, options)` and `client.connect()` in a single step. + * + * Connect can be helpful to detect configuration issues early by validating: + * - **DNS Resolution**: Verifies that SRV records and hostnames in the connection string resolve DNS entries + * - **Network Connectivity**: Confirms that host addresses are reachable and ports are open + * - **TLS Configuration**: Validates SSL/TLS certificates, CA files, and encryption settings are correct + * - **Authentication**: Verifies that provided credentials are valid + * - **Server Compatibility**: Ensures the MongoDB server version is supported by this driver version + * - **Load Balancer Setup**: For load-balanced deployments, confirms the service is properly configured + * + * @returns A promise that resolves to the same MongoClient instance once connected + * + * @remarks + * **Connection is Optional:** Calling `connect` is optional since any operation method (`find`, `insertOne`, etc.) + * will automatically perform these same validation steps if the client is not already connected. + * However, explicitly calling `connect` can make sense for: + * - **Fail-fast Error Detection**: Non-transient connection issues (hostname unresolved, port refused connection) are discovered immediately rather than during your first operation + * - **Predictable Performance**: Eliminates first connection overhead from your first database operation + * + * @remarks + * **Connection Pooling Impact:** Calling `connect` will populate the connection pool with one connection + * to a server selected by the client's configured `readPreference` (defaults to primary). + * + * @remarks + * **Timeout Behavior:** When using `timeoutMS`, the connection establishment time does not count against + * the timeout for subsequent operations. This means `connect` runs without a `timeoutMS` limit, while + * your database operations will still respect the configured timeout. If you need predictable operation + * timing with `timeoutMS`, call `connect` explicitly before performing operations. + * + * @see https://www.mongodb.com/docs/manual/reference/connection-string/ + */ + static async connect(url: string, options?: MongoClientOptions): Promise { + const client = new this(url, options); + return await client.connect(); + } + + /** + * Creates a new ClientSession. When using the returned session in an operation + * a corresponding ServerSession will be created. + * + * @remarks + * A ClientSession instance may only be passed to operations being performed on the same + * MongoClient it was started from. + */ + startSession(options?: ClientSessionOptions): ClientSession { + const session = new ClientSession( + this, + this.s.sessionPool, + { explicit: true, ...options }, + this.options + ); + this.s.activeSessions.add(session); + session.once('ended', () => { + this.s.activeSessions.delete(session); + }); + return session; + } + + /** + * A convenience method for creating and handling the clean up of a ClientSession. + * The session will always be ended when the executor finishes. + * + * @param executor - An executor function that all operations using the provided session must be invoked in + * @param options - optional settings for the session + */ + async withSession(executor: WithSessionCallback): Promise; + async withSession( + options: ClientSessionOptions, + executor: WithSessionCallback + ): Promise; + async withSession( + optionsOrExecutor: ClientSessionOptions | WithSessionCallback, + executor?: WithSessionCallback + ): Promise { + const options = { + // Always define an owner + owner: Symbol(), + // If it's an object inherit the options + ...(typeof optionsOrExecutor === 'object' ? optionsOrExecutor : {}) + }; + + const withSessionCallback = + typeof optionsOrExecutor === 'function' ? optionsOrExecutor : executor; + + if (withSessionCallback == null) { + throw new MongoInvalidArgumentError('Missing required callback parameter'); + } + + const session = this.startSession(options); + + try { + return await withSessionCallback(session); + } finally { + try { + await session.endSession(); + } catch (error) { + squashError(error); + } + } + } + + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this cluster. Will ignore all + * changes to system collections, as well as the local, admin, and config databases. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the data within the current cluster + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument + >(pipeline: Document[] = [], options: ChangeStreamOptions = {}): ChangeStream { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + + return new ChangeStream(this, pipeline, resolveOptions(this, options)); + } +} + +/** + * Parsed Mongo Client Options. + * + * User supplied options are documented by `MongoClientOptions`. + * + * **NOTE:** The client's options parsing is subject to change to support new features. + * This type is provided to aid with inspection of options after parsing, it should not be relied upon programmatically. + * + * Options are sourced from: + * - connection string + * - options object passed to the MongoClient constructor + * - file system (ex. tls settings) + * - environment variables + * - DNS SRV records and TXT records + * + * Not all options may be present after client construction as some are obtained from asynchronous operations. + * + * @public + */ +export interface MongoOptions + extends Required< + Pick< + MongoClientOptions, + | 'maxAdaptiveRetries' + | 'enableOverloadRetargeting' + | 'autoEncryption' + | 'connectTimeoutMS' + | 'directConnection' + | 'driverInfo' + | 'forceServerObjectId' + | 'minHeartbeatFrequencyMS' + | 'heartbeatFrequencyMS' + | 'localThresholdMS' + | 'maxConnecting' + | 'maxIdleTimeMS' + | 'maxPoolSize' + | 'minPoolSize' + | 'monitorCommands' + | 'noDelay' + | 'pkFactory' + | 'raw' + | 'replicaSet' + | 'retryReads' + | 'retryWrites' + | 'serverSelectionTimeoutMS' + | 'socketTimeoutMS' + | 'srvMaxHosts' + | 'srvServiceName' + | 'tlsAllowInvalidCertificates' + | 'tlsAllowInvalidHostnames' + | 'tlsInsecure' + | 'waitQueueTimeoutMS' + | 'zlibCompressionLevel' + > + >, + SupportedNodeConnectionOptions { + appName?: string; + hosts: HostAddress[]; + srvHost?: string; + credentials?: MongoCredentials; + readPreference: ReadPreference; + readConcern: ReadConcern; + loadBalanced: boolean; + directConnection: boolean; + serverApi: ServerApi; + compressors: CompressorName[]; + writeConcern: WriteConcern; + dbName: string; + /** @internal */ + metadata: Promise; + /** @internal */ + autoEncrypter?: AutoEncrypter; + /** @internal */ + tokenCache?: TokenCache; + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; + serverMonitoringMode: ServerMonitoringMode; + /** @internal */ + connectionType?: typeof Connection; + /** @internal */ + authProviders: MongoClientAuthProviders; + /** @internal */ + encrypter: Encrypter; + /** @internal */ + userSpecifiedAuthSource: boolean; + /** @internal */ + userSpecifiedReplicaSet: boolean; + + /** + * # NOTE ABOUT TLS Options + * + * If `tls` is provided as an option, it is equivalent to setting the `ssl` option. + * + * NodeJS native TLS options are passed through to the socket and retain their original types. + * + * ### Additional options: + * + * | nodejs native option | driver spec equivalent option name | driver option type | + * |:----------------------|:----------------------------------------------|:-------------------| + * | `ca` | `tlsCAFile` | `string` | + * | `crl` | `tlsCRLFile` | `string` | + * | `cert` | `tlsCertificateKeyFile` | `string` | + * | `key` | `tlsCertificateKeyFile` | `string` | + * | `passphrase` | `tlsCertificateKeyFilePassword` | `string` | + * | `rejectUnauthorized` | `tlsAllowInvalidCertificates` | `boolean` | + * | `checkServerIdentity` | `tlsAllowInvalidHostnames` | `boolean` | + * | see note below | `tlsInsecure` | `boolean` | + * + * If `tlsInsecure` is set to `true`, then it will set the node native options `checkServerIdentity` + * to a no-op and `rejectUnauthorized` to `false`. + * + * If `tlsInsecure` is set to `false`, then it will set the node native options `checkServerIdentity` + * to a no-op and `rejectUnauthorized` to the inverse value of `tlsAllowInvalidCertificates`. If + * `tlsAllowInvalidCertificates` is not set, then `rejectUnauthorized` will be set to `true`. + * + * ### Note on `tlsCAFile`, `tlsCertificateKeyFile` and `tlsCRLFile` + * + * The files specified by the paths passed in to the `tlsCAFile`, `tlsCertificateKeyFile` and `tlsCRLFile` + * fields are read lazily on the first call to `MongoClient.connect`. Once these files have been read and + * the `ca`, `cert`, `crl` and `key` fields are populated, they will not be read again on subsequent calls to + * `MongoClient.connect`. As a result, until the first call to `MongoClient.connect`, the `ca`, + * `cert`, `crl` and `key` fields will be undefined. + */ + tls: boolean; + tlsCAFile?: string; + tlsCRLFile?: string; + tlsCertificateKeyFile?: string; + + /** + * @internal + * TODO: NODE-5671 - remove internal flag + */ + mongoLoggerOptions: MongoLoggerOptions; + /** + * @internal + * TODO: NODE-5671 - remove internal flag + */ + mongodbLogPath?: 'stderr' | 'stdout' | MongoDBLogWritable; + timeoutMS?: number; + /** @internal */ + __skipPingOnConnect?: boolean; + + /** @internal */ + runtime: Promise; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client_auth_providers.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client_auth_providers.ts new file mode 100644 index 00000000..f458726d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_client_auth_providers.ts @@ -0,0 +1,87 @@ +import { type AuthProvider } from './cmap/auth/auth_provider'; +import { GSSAPI } from './cmap/auth/gssapi'; +import { type AuthMechanismProperties } from './cmap/auth/mongo_credentials'; +import { MongoDBAWS } from './cmap/auth/mongodb_aws'; +import { MongoDBOIDC, OIDC_WORKFLOWS, type Workflow } from './cmap/auth/mongodb_oidc'; +import { AutomatedCallbackWorkflow } from './cmap/auth/mongodb_oidc/automated_callback_workflow'; +import { HumanCallbackWorkflow } from './cmap/auth/mongodb_oidc/human_callback_workflow'; +import { TokenCache } from './cmap/auth/mongodb_oidc/token_cache'; +import { Plain } from './cmap/auth/plain'; +import { AuthMechanism } from './cmap/auth/providers'; +import { ScramSHA1, ScramSHA256 } from './cmap/auth/scram'; +import { X509 } from './cmap/auth/x509'; +import { MongoInvalidArgumentError } from './error'; + +/** @internal */ +const AUTH_PROVIDERS = new Map< + AuthMechanism | string, + (authMechanismProperties: AuthMechanismProperties) => AuthProvider +>([ + [ + AuthMechanism.MONGODB_AWS, + ({ AWS_CREDENTIAL_PROVIDER }) => new MongoDBAWS(AWS_CREDENTIAL_PROVIDER) + ], + [AuthMechanism.MONGODB_GSSAPI, () => new GSSAPI()], + [AuthMechanism.MONGODB_OIDC, properties => new MongoDBOIDC(getWorkflow(properties))], + [AuthMechanism.MONGODB_PLAIN, () => new Plain()], + [AuthMechanism.MONGODB_SCRAM_SHA1, () => new ScramSHA1()], + [AuthMechanism.MONGODB_SCRAM_SHA256, () => new ScramSHA256()], + [AuthMechanism.MONGODB_X509, () => new X509()] +]); + +/** + * Create a set of providers per client + * to avoid sharing the provider's cache between different clients. + * @internal + */ +export class MongoClientAuthProviders { + private existingProviders: Map = new Map(); + + /** + * Get or create an authentication provider based on the provided mechanism. + * We don't want to create all providers at once, as some providers may not be used. + * @param name - The name of the provider to get or create. + * @param credentials - The credentials. + * @returns The provider. + * @throws MongoInvalidArgumentError if the mechanism is not supported. + * @internal + */ + getOrCreateProvider( + name: AuthMechanism | string, + authMechanismProperties: AuthMechanismProperties + ): AuthProvider { + const authProvider = this.existingProviders.get(name); + if (authProvider) { + return authProvider; + } + + const providerFunction = AUTH_PROVIDERS.get(name); + if (!providerFunction) { + throw new MongoInvalidArgumentError(`authMechanism ${name} not supported`); + } + + const provider = providerFunction(authMechanismProperties); + this.existingProviders.set(name, provider); + return provider; + } +} + +/** + * Gets either a device workflow or callback workflow. + */ +function getWorkflow(authMechanismProperties: AuthMechanismProperties): Workflow { + if (authMechanismProperties.OIDC_HUMAN_CALLBACK) { + return new HumanCallbackWorkflow(new TokenCache(), authMechanismProperties.OIDC_HUMAN_CALLBACK); + } else if (authMechanismProperties.OIDC_CALLBACK) { + return new AutomatedCallbackWorkflow(new TokenCache(), authMechanismProperties.OIDC_CALLBACK); + } else { + const environment = authMechanismProperties.ENVIRONMENT; + const workflow = OIDC_WORKFLOWS.get(environment)?.(); + if (!workflow) { + throw new MongoInvalidArgumentError( + `Could not load workflow for environment ${authMechanismProperties.ENVIRONMENT}` + ); + } + return workflow; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_logger.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_logger.ts new file mode 100644 index 00000000..bb54896d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_logger.ts @@ -0,0 +1,1081 @@ +import * as process from 'process'; +import { inspect } from 'util'; + +import { + type Binary, + type BSONRegExp, + type BSONSymbol, + type Code, + type DBRef, + type Decimal128, + type Document, + type Double, + EJSON, + type EJSONOptions, + type Int32, + type Long, + type MaxKey, + type MinKey, + type ObjectId, + type Timestamp +} from './bson'; +import type { CommandStartedEvent } from './cmap/command_monitoring_events'; +import type { + ConnectionCheckedInEvent, + ConnectionCheckedOutEvent, + ConnectionCheckOutFailedEvent, + ConnectionCheckOutStartedEvent, + ConnectionClosedEvent, + ConnectionCreatedEvent, + ConnectionPoolClearedEvent, + ConnectionPoolClosedEvent, + ConnectionPoolCreatedEvent, + ConnectionPoolReadyEvent, + ConnectionReadyEvent +} from './cmap/connection_pool_events'; +import { + COMMAND_FAILED, + COMMAND_STARTED, + COMMAND_SUCCEEDED, + CONNECTION_CHECK_OUT_FAILED, + CONNECTION_CHECK_OUT_STARTED, + CONNECTION_CHECKED_IN, + CONNECTION_CHECKED_OUT, + CONNECTION_CLOSED, + CONNECTION_CREATED, + CONNECTION_POOL_CLEARED, + CONNECTION_POOL_CLOSED, + CONNECTION_POOL_CREATED, + CONNECTION_POOL_READY, + CONNECTION_READY, + SERVER_CLOSED, + SERVER_HEARTBEAT_FAILED, + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED, + SERVER_OPENING, + SERVER_SELECTION_FAILED, + SERVER_SELECTION_STARTED, + SERVER_SELECTION_SUCCEEDED, + TOPOLOGY_CLOSED, + TOPOLOGY_DESCRIPTION_CHANGED, + TOPOLOGY_OPENING, + WAITING_FOR_SUITABLE_SERVER +} from './constants'; +import type { + ServerClosedEvent, + ServerOpeningEvent, + TopologyClosedEvent, + TopologyDescriptionChangedEvent, + TopologyOpeningEvent +} from './sdam/events'; +import type { + ServerSelectionEvent, + ServerSelectionFailedEvent, + ServerSelectionStartedEvent, + ServerSelectionSucceededEvent, + WaitingForSuitableServerEvent +} from './sdam/server_selection_events'; +import { HostAddress, isPromiseLike, isUint8Array, parseUnsignedInteger } from './utils'; + +/** + * @public + * Severity levels align with unix syslog. + * Most typical driver functions will log to debug. + */ +export const SeverityLevel = Object.freeze({ + EMERGENCY: 'emergency', + ALERT: 'alert', + CRITICAL: 'critical', + ERROR: 'error', + WARNING: 'warn', + NOTICE: 'notice', + INFORMATIONAL: 'info', + DEBUG: 'debug', + TRACE: 'trace', + OFF: 'off' +} as const); + +/** @internal */ +export const DEFAULT_MAX_DOCUMENT_LENGTH = 1000; +/** @public */ +export type SeverityLevel = (typeof SeverityLevel)[keyof typeof SeverityLevel]; + +/** @internal */ +class SeverityLevelMap extends Map { + constructor(entries: [SeverityLevel | number, SeverityLevel | number][]) { + const newEntries: [number | SeverityLevel, SeverityLevel | number][] = []; + for (const [level, value] of entries) { + newEntries.push([value, level]); + } + + newEntries.push(...entries); + super(newEntries); + } + + getNumericSeverityLevel(severity: SeverityLevel): number { + return this.get(severity) as number; + } + + getSeverityLevelName(level: number): SeverityLevel | undefined { + return this.get(level) as SeverityLevel | undefined; + } +} + +/** @internal */ +export const SEVERITY_LEVEL_MAP = new SeverityLevelMap([ + [SeverityLevel.OFF, -Infinity], + [SeverityLevel.EMERGENCY, 0], + [SeverityLevel.ALERT, 1], + [SeverityLevel.CRITICAL, 2], + [SeverityLevel.ERROR, 3], + [SeverityLevel.WARNING, 4], + [SeverityLevel.NOTICE, 5], + [SeverityLevel.INFORMATIONAL, 6], + [SeverityLevel.DEBUG, 7], + [SeverityLevel.TRACE, 8] +]); + +/** @public */ +export const MongoLoggableComponent = Object.freeze({ + COMMAND: 'command', + TOPOLOGY: 'topology', + SERVER_SELECTION: 'serverSelection', + CONNECTION: 'connection', + CLIENT: 'client' +} as const); + +/** @public */ +export type MongoLoggableComponent = + (typeof MongoLoggableComponent)[keyof typeof MongoLoggableComponent]; + +/** @internal */ +export interface MongoLoggerEnvOptions { + /** Severity level for command component */ + MONGODB_LOG_COMMAND?: string; + /** Severity level for topology component */ + MONGODB_LOG_TOPOLOGY?: string; + /** Severity level for server selection component */ + MONGODB_LOG_SERVER_SELECTION?: string; + /** Severity level for CMAP */ + MONGODB_LOG_CONNECTION?: string; + /** Severity level for client */ + MONGODB_LOG_CLIENT?: string; + /** Default severity level to be if any of the above are unset */ + MONGODB_LOG_ALL?: string; + /** Max length of embedded EJSON docs. Setting to 0 disables truncation. Defaults to 1000. */ + MONGODB_LOG_MAX_DOCUMENT_LENGTH?: string; + /** Destination for log messages. Must be 'stderr', 'stdout'. Defaults to 'stderr'. */ + MONGODB_LOG_PATH?: string; +} + +/** @public */ +export interface LogComponentSeveritiesClientOptions { + /** Optional severity level for command component */ + command?: SeverityLevel; + /** Optional severity level for topology component */ + topology?: SeverityLevel; + /** Optional severity level for server selection component */ + serverSelection?: SeverityLevel; + /** Optional severity level for connection component */ + connection?: SeverityLevel; + /** Optional severity level for client component */ + client?: SeverityLevel; + /** Optional default severity level to be used if any of the above are unset */ + default?: SeverityLevel; +} + +/** @internal */ +export interface MongoLoggerMongoClientOptions { + /** Destination for log messages */ + mongodbLogPath?: 'stdout' | 'stderr' | MongoDBLogWritable; + /** Severity levels for logger components */ + mongodbLogComponentSeverities?: LogComponentSeveritiesClientOptions; + /** Max length of embedded EJSON docs. Setting to 0 disables truncation. Defaults to 1000. */ + mongodbLogMaxDocumentLength?: number; +} + +/** @internal */ +export interface MongoLoggerOptions { + componentSeverities: { + /** Severity level for command component */ + command: SeverityLevel; + /** Severity level for topology component */ + topology: SeverityLevel; + /** Severity level for server selection component */ + serverSelection: SeverityLevel; + /** Severity level for connection component */ + connection: SeverityLevel; + /** Severity level for client component */ + client: SeverityLevel; + /** Default severity level to be used if any of the above are unset */ + default: SeverityLevel; + }; + /** Max length of embedded EJSON docs. Setting to 0 disables truncation. Defaults to 1000. */ + maxDocumentLength: number; + /** Destination for log messages. */ + logDestination: MongoDBLogWritable; + /** For internal check to see if error should stop logging. */ + logDestinationIsStdErr: boolean; +} + +/** + * Parses a string as one of SeverityLevel + * @internal + * + * @param s - the value to be parsed + * @returns one of SeverityLevel if value can be parsed as such, otherwise null + */ +export function parseSeverityFromString(s?: string): SeverityLevel | null { + const validSeverities: string[] = Object.values(SeverityLevel); + const lowerSeverity = s?.toLowerCase(); + + if (lowerSeverity != null && validSeverities.includes(lowerSeverity)) { + return lowerSeverity as SeverityLevel; + } + + return null; +} + +/** @internal */ +export function createStdioLogger(stream: { + write: NodeJS.WriteStream['write']; +}): MongoDBLogWritable { + return { + write: (log: Log): Promise => { + return new Promise((resolve, reject) => { + const logLine = inspect(log, { compact: true, breakLength: Infinity }); + stream.write(`${logLine}\n`, 'utf-8', error => { + if (error) return reject(error); + resolve(true); + }); + }); + } + }; +} + +/** + * resolves the MONGODB_LOG_PATH and mongodbLogPath options from the environment and the + * mongo client options respectively. The mongodbLogPath can be either 'stdout', 'stderr', a NodeJS + * Writable or an object which has a `write` method with the signature: + * ```ts + * write(log: Log): void + * ``` + * + * @returns the MongoDBLogWritable object to write logs to + */ +function resolveLogPath( + { MONGODB_LOG_PATH }: MongoLoggerEnvOptions, + { mongodbLogPath }: MongoLoggerMongoClientOptions +): { mongodbLogPath: MongoDBLogWritable; mongodbLogPathIsStdErr: boolean } { + if (typeof mongodbLogPath === 'string' && /^stderr$/i.test(mongodbLogPath)) { + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; + } + if (typeof mongodbLogPath === 'string' && /^stdout$/i.test(mongodbLogPath)) { + return { mongodbLogPath: createStdioLogger(process.stdout), mongodbLogPathIsStdErr: false }; + } + + if (typeof mongodbLogPath === 'object' && typeof mongodbLogPath?.write === 'function') { + return { mongodbLogPath: mongodbLogPath, mongodbLogPathIsStdErr: false }; + } + + if (MONGODB_LOG_PATH && /^stderr$/i.test(MONGODB_LOG_PATH)) { + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; + } + if (MONGODB_LOG_PATH && /^stdout$/i.test(MONGODB_LOG_PATH)) { + return { mongodbLogPath: createStdioLogger(process.stdout), mongodbLogPathIsStdErr: false }; + } + + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; +} + +function resolveSeverityConfiguration( + clientOption: string | undefined, + environmentOption: string | undefined, + defaultSeverity: SeverityLevel +): SeverityLevel { + return ( + parseSeverityFromString(clientOption) ?? + parseSeverityFromString(environmentOption) ?? + defaultSeverity + ); +} + +/** @public */ +export interface Log extends Record { + t: Date; + c: MongoLoggableComponent; + s: SeverityLevel; + message?: string; +} + +/** + * @public + * + * A custom destination for structured logging messages. + */ +export interface MongoDBLogWritable { + /** + * This function will be called for every enabled log message. + * + * It can be sync or async: + * - If it is synchronous it will block the driver from proceeding until this method returns. + * - If it is asynchronous the driver will not await the returned promise. It will attach fulfillment handling (`.then`). + * If the promise rejects the logger will write an error message to stderr and stop functioning. + * If the promise resolves the driver proceeds to the next log message (or waits for new ones to occur). + * + * Tips: + * - We recommend writing an async `write` function that _never_ rejects. + * Instead handle logging errors as necessary to your use case and make the write function a noop, until it can be recovered. + * - The Log messages are structured but **subject to change** since the intended purpose is informational. + * Program against this defensively and err on the side of stringifying whatever is passed in to write in some form or another. + * + */ + write(log: Log): PromiseLike | unknown; +} + +function compareSeverity(s0: SeverityLevel, s1: SeverityLevel): 1 | 0 | -1 { + const s0Num = SEVERITY_LEVEL_MAP.getNumericSeverityLevel(s0); + const s1Num = SEVERITY_LEVEL_MAP.getNumericSeverityLevel(s1); + + return s0Num < s1Num ? -1 : s0Num > s1Num ? 1 : 0; +} + +/** + * @internal + * Must be separate from Events API due to differences in spec requirements for logging a command success + */ +export type LoggableCommandSucceededEvent = { + address: string; + connectionId?: string | number; + requestId: number; + duration: number; + commandName: string; + reply: Document | undefined; + serviceId?: ObjectId; + name: typeof COMMAND_SUCCEEDED; + serverConnectionId: bigint | null; + databaseName: string; +}; + +/** + * @internal + * Must be separate from Events API due to differences in spec requirements for logging a command failure + */ +export type LoggableCommandFailedEvent = { + address: string; + connectionId?: string | number; + requestId: number; + duration: number; + commandName: string; + failure: Error; + serviceId?: ObjectId; + name: typeof COMMAND_FAILED; + serverConnectionId: bigint | null; + databaseName: string; +}; + +/** + * @internal + * Must be separate from Events API due to differences in spec requirements for logging server heartbeat beginning + */ +export type LoggableServerHeartbeatStartedEvent = { + topologyId: number; + awaited: boolean; + connectionId: string; + name: typeof SERVER_HEARTBEAT_STARTED; +}; + +/** + * @internal + * Must be separate from Events API due to differences in spec requirements for logging server heartbeat success + */ +export type LoggableServerHeartbeatSucceededEvent = { + topologyId: number; + awaited: boolean; + connectionId: string; + reply: Document; + serverConnectionId: number | ''; + duration: number; + name: typeof SERVER_HEARTBEAT_SUCCEEDED; +}; + +/** + * @internal + * Must be separate from Events API due to differences in spec requirements for logging server heartbeat failure + */ +export type LoggableServerHeartbeatFailedEvent = { + topologyId: number; + awaited: boolean; + connectionId: string; + failure: Error; + duration: number; + name: typeof SERVER_HEARTBEAT_FAILED; +}; + +type SDAMLoggableEvent = + | ServerClosedEvent + | LoggableServerHeartbeatFailedEvent + | LoggableServerHeartbeatStartedEvent + | LoggableServerHeartbeatSucceededEvent + | ServerOpeningEvent + | TopologyClosedEvent + | TopologyDescriptionChangedEvent + | TopologyOpeningEvent; + +/** @internal */ +export type LoggableEvent = + | ServerSelectionStartedEvent + | ServerSelectionFailedEvent + | ServerSelectionSucceededEvent + | WaitingForSuitableServerEvent + | CommandStartedEvent + | LoggableCommandSucceededEvent + | LoggableCommandFailedEvent + | ConnectionPoolCreatedEvent + | ConnectionPoolReadyEvent + | ConnectionPoolClosedEvent + | ConnectionPoolClearedEvent + | ConnectionCreatedEvent + | ConnectionReadyEvent + | ConnectionClosedEvent + | ConnectionCheckedInEvent + | ConnectionCheckedOutEvent + | ConnectionCheckOutStartedEvent + | ConnectionCheckOutFailedEvent + | ServerClosedEvent + | LoggableServerHeartbeatFailedEvent + | LoggableServerHeartbeatStartedEvent + | LoggableServerHeartbeatSucceededEvent + | ServerOpeningEvent + | TopologyClosedEvent + | TopologyDescriptionChangedEvent + | TopologyOpeningEvent; + +/** @internal */ +export interface LogConvertible extends Record { + toLog(): Record; +} + +type BSONObject = + | BSONRegExp + | BSONSymbol + | Code + | DBRef + | Decimal128 + | Double + | Int32 + | Long + | MaxKey + | MinKey + | ObjectId + | Timestamp + | Binary; +/** @internal */ +export function stringifyWithMaxLen( + value: any, + maxDocumentLength: number, + options: EJSONOptions = {} +): string { + let strToTruncate = ''; + + let currentLength = 0; + const maxDocumentLengthEnsurer = function maxDocumentLengthEnsurer(key: string, value: any) { + if (currentLength >= maxDocumentLength) { + return undefined; + } + // Account for root document + if (key === '') { + // Account for starting brace + currentLength += 1; + return value; + } + + // +4 accounts for 2 quotation marks, colon and comma after value + // Note that this potentially undercounts since it does not account for escape sequences which + // will have an additional backslash added to them once passed through JSON.stringify. + currentLength += key.length + 4; + + if (value == null) return value; + + switch (typeof value) { + case 'string': + // +2 accounts for quotes + // Note that this potentially undercounts similarly to the key length calculation + currentLength += value.length + 2; + break; + case 'number': + case 'bigint': + currentLength += String(value).length; + break; + case 'boolean': + currentLength += value ? 4 : 5; + break; + case 'object': + if (isUint8Array(value)) { + // '{"$binary":{"base64":"","subType":"XX"}}' + // This is an estimate based on the fact that the base64 is approximately 1.33x the length of + // the actual binary sequence https://en.wikipedia.org/wiki/Base64 + currentLength += (22 + value.byteLength + value.byteLength * 0.33 + 18) | 0; + } else if ('_bsontype' in value) { + const v = value as BSONObject; + switch (v._bsontype) { + case 'Int32': + currentLength += String(v.value).length; + break; + case 'Double': + // Account for representing integers as .0 + currentLength += + (v.value | 0) === v.value ? String(v.value).length + 2 : String(v.value).length; + break; + case 'Long': + currentLength += v.toString().length; + break; + case 'ObjectId': + // '{"$oid":"XXXXXXXXXXXXXXXXXXXXXXXX"}' + currentLength += 35; + break; + case 'MaxKey': + case 'MinKey': + // '{"$maxKey":1}' or '{"$minKey":1}' + currentLength += 13; + break; + case 'Binary': + // '{"$binary":{"base64":"","subType":"XX"}}' + // This is an estimate based on the fact that the base64 is approximately 1.33x the length of + // the actual binary sequence https://en.wikipedia.org/wiki/Base64 + currentLength += (22 + value.position + value.position * 0.33 + 18) | 0; + break; + case 'Timestamp': + // '{"$timestamp":{"t":,"i":}}' + currentLength += 19 + String(v.t).length + 5 + String(v.i).length + 2; + break; + case 'Code': + // '{"$code":""}' or '{"$code":"","$scope":}' + if (v.scope == null) { + currentLength += v.code.length + 10 + 2; + } else { + // Ignoring actual scope object, so this undercounts by a significant amount + currentLength += v.code.length + 10 + 11; + } + break; + case 'BSONRegExp': + // '{"$regularExpression":{"pattern":"","options":""}}' + currentLength += 34 + v.pattern.length + 13 + v.options.length + 3; + break; + } + } + } + return value; + }; + + if (typeof value === 'string') { + strToTruncate = value; + } else if (typeof value === 'function') { + strToTruncate = value.name; + } else { + try { + if (maxDocumentLength !== 0) { + strToTruncate = EJSON.stringify(value, maxDocumentLengthEnsurer, 0, options); + } else { + strToTruncate = EJSON.stringify(value, options); + } + } catch (e) { + strToTruncate = `Extended JSON serialization failed with: ${e.message}`; + } + } + + // handle truncation that occurs in the middle of multi-byte codepoints + if ( + maxDocumentLength !== 0 && + strToTruncate.length > maxDocumentLength && + strToTruncate.charCodeAt(maxDocumentLength - 1) !== + strToTruncate.codePointAt(maxDocumentLength - 1) + ) { + maxDocumentLength--; + if (maxDocumentLength === 0) { + return ''; + } + } + + return maxDocumentLength !== 0 && strToTruncate.length > maxDocumentLength + ? `${strToTruncate.slice(0, maxDocumentLength)}...` + : strToTruncate; +} + +/** @internal */ +export type Loggable = LoggableEvent | LogConvertible; + +function isLogConvertible(obj: Loggable): obj is LogConvertible { + const objAsLogConvertible = obj as LogConvertible; + // eslint-disable-next-line no-restricted-syntax + return objAsLogConvertible.toLog !== undefined && typeof objAsLogConvertible.toLog === 'function'; +} + +function attachServerSelectionFields( + log: Record, + serverSelectionEvent: ServerSelectionEvent, + maxDocumentLength: number = DEFAULT_MAX_DOCUMENT_LENGTH +) { + const { selector, operation, topologyDescription, message } = serverSelectionEvent; + log.selector = stringifyWithMaxLen(selector, maxDocumentLength); + log.operation = operation; + log.topologyDescription = stringifyWithMaxLen(topologyDescription, maxDocumentLength); + log.message = message; + + return log; +} + +function attachCommandFields( + log: Record, + commandEvent: CommandStartedEvent | LoggableCommandSucceededEvent | LoggableCommandFailedEvent +) { + log.commandName = commandEvent.commandName; + log.requestId = commandEvent.requestId; + log.driverConnectionId = commandEvent.connectionId; + const { host, port } = HostAddress.fromString(commandEvent.address).toHostPort(); + log.serverHost = host; + log.serverPort = port; + if (commandEvent?.serviceId) { + log.serviceId = commandEvent.serviceId.toHexString(); + } + log.databaseName = commandEvent.databaseName; + log.serverConnectionId = commandEvent.serverConnectionId; + + return log; +} + +function attachConnectionFields(log: Record, event: any) { + const { host, port } = HostAddress.fromString(event.address).toHostPort(); + log.serverHost = host; + log.serverPort = port; + + return log; +} + +function attachSDAMFields(log: Record, sdamEvent: SDAMLoggableEvent) { + log.topologyId = sdamEvent.topologyId; + return log; +} + +function attachServerHeartbeatFields( + log: Record, + serverHeartbeatEvent: + | LoggableServerHeartbeatFailedEvent + | LoggableServerHeartbeatStartedEvent + | LoggableServerHeartbeatSucceededEvent +) { + const { awaited, connectionId } = serverHeartbeatEvent; + log.awaited = awaited; + log.driverConnectionId = serverHeartbeatEvent.connectionId; + const { host, port } = HostAddress.fromString(connectionId).toHostPort(); + log.serverHost = host; + log.serverPort = port; + return log; +} + +/** @internal */ +export function defaultLogTransform( + logObject: LoggableEvent | Record, + maxDocumentLength: number = DEFAULT_MAX_DOCUMENT_LENGTH +): Omit { + let log: Omit = Object.create(null); + + switch (logObject.name) { + case SERVER_SELECTION_STARTED: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + return log; + case SERVER_SELECTION_FAILED: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + log.failure = logObject.failure?.message; + return log; + case SERVER_SELECTION_SUCCEEDED: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + log.serverHost = logObject.serverHost; + log.serverPort = logObject.serverPort; + return log; + case WAITING_FOR_SUITABLE_SERVER: + log = attachServerSelectionFields(log, logObject, maxDocumentLength); + log.remainingTimeMS = logObject.remainingTimeMS; + return log; + case COMMAND_STARTED: + log = attachCommandFields(log, logObject); + log.message = 'Command started'; + log.command = stringifyWithMaxLen(logObject.command, maxDocumentLength, { relaxed: true }); + log.databaseName = logObject.databaseName; + return log; + case COMMAND_SUCCEEDED: + log = attachCommandFields(log, logObject); + log.message = 'Command succeeded'; + log.durationMS = logObject.duration; + log.reply = stringifyWithMaxLen(logObject.reply, maxDocumentLength, { relaxed: true }); + return log; + case COMMAND_FAILED: + log = attachCommandFields(log, logObject); + log.message = 'Command failed'; + log.durationMS = logObject.duration; + log.failure = logObject.failure?.message ?? '(redacted)'; + return log; + case CONNECTION_POOL_CREATED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool created'; + if (logObject.options) { + const { maxIdleTimeMS, minPoolSize, maxPoolSize, maxConnecting, waitQueueTimeoutMS } = + logObject.options; + log = { + ...log, + maxIdleTimeMS, + minPoolSize, + maxPoolSize, + maxConnecting, + waitQueueTimeoutMS + }; + } + return log; + case CONNECTION_POOL_READY: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool ready'; + return log; + case CONNECTION_POOL_CLEARED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool cleared'; + if (logObject.serviceId?._bsontype === 'ObjectId') { + log.serviceId = logObject.serviceId?.toHexString(); + } + return log; + case CONNECTION_POOL_CLOSED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection pool closed'; + return log; + case CONNECTION_CREATED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection created'; + log.driverConnectionId = logObject.connectionId; + return log; + case CONNECTION_READY: + log = attachConnectionFields(log, logObject); + log.message = 'Connection ready'; + log.driverConnectionId = logObject.connectionId; + log.durationMS = logObject.durationMS; + return log; + case CONNECTION_CLOSED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection closed'; + log.driverConnectionId = logObject.connectionId; + switch (logObject.reason) { + case 'stale': + log.reason = 'Connection became stale because the pool was cleared'; + break; + case 'idle': + log.reason = + 'Connection has been available but unused for longer than the configured max idle time'; + break; + case 'error': + log.reason = 'An error occurred while using the connection'; + if (logObject.error) { + log.error = logObject.error; + } + break; + case 'poolClosed': + log.reason = 'Connection pool was closed'; + break; + default: + log.reason = `Unknown close reason: ${logObject.reason}`; + } + return log; + case CONNECTION_CHECK_OUT_STARTED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checkout started'; + return log; + case CONNECTION_CHECK_OUT_FAILED: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checkout failed'; + switch (logObject.reason) { + case 'poolClosed': + log.reason = 'Connection pool was closed'; + break; + case 'timeout': + log.reason = 'Wait queue timeout elapsed without a connection becoming available'; + break; + case 'connectionError': + log.reason = 'An error occurred while trying to establish a new connection'; + if (logObject.error) { + log.error = logObject.error; + } + break; + default: + log.reason = `Unknown close reason: ${logObject.reason}`; + } + log.durationMS = logObject.durationMS; + return log; + case CONNECTION_CHECKED_OUT: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checked out'; + log.driverConnectionId = logObject.connectionId; + log.durationMS = logObject.durationMS; + return log; + case CONNECTION_CHECKED_IN: + log = attachConnectionFields(log, logObject); + log.message = 'Connection checked in'; + log.driverConnectionId = logObject.connectionId; + return log; + case SERVER_OPENING: + log = attachSDAMFields(log, logObject); + log = attachConnectionFields(log, logObject); + log.message = 'Starting server monitoring'; + return log; + case SERVER_CLOSED: + log = attachSDAMFields(log, logObject); + log = attachConnectionFields(log, logObject); + log.message = 'Stopped server monitoring'; + return log; + case SERVER_HEARTBEAT_STARTED: + log = attachSDAMFields(log, logObject); + log = attachServerHeartbeatFields(log, logObject); + log.message = 'Server heartbeat started'; + return log; + case SERVER_HEARTBEAT_SUCCEEDED: + log = attachSDAMFields(log, logObject); + log = attachServerHeartbeatFields(log, logObject); + log.message = 'Server heartbeat succeeded'; + log.durationMS = logObject.duration; + log.serverConnectionId = logObject.serverConnectionId; + log.reply = stringifyWithMaxLen(logObject.reply, maxDocumentLength, { relaxed: true }); + return log; + case SERVER_HEARTBEAT_FAILED: + log = attachSDAMFields(log, logObject); + log = attachServerHeartbeatFields(log, logObject); + log.message = 'Server heartbeat failed'; + log.durationMS = logObject.duration; + log.failure = logObject.failure?.message; + return log; + case TOPOLOGY_OPENING: + log = attachSDAMFields(log, logObject); + log.message = 'Starting topology monitoring'; + return log; + case TOPOLOGY_CLOSED: + log = attachSDAMFields(log, logObject); + log.message = 'Stopped topology monitoring'; + return log; + case TOPOLOGY_DESCRIPTION_CHANGED: + log = attachSDAMFields(log, logObject); + log.message = 'Topology description changed'; + log.previousDescription = log.reply = stringifyWithMaxLen( + logObject.previousDescription, + maxDocumentLength + ); + log.newDescription = log.reply = stringifyWithMaxLen( + logObject.newDescription, + maxDocumentLength + ); + return log; + default: + for (const [key, value] of Object.entries(logObject)) { + if (value != null) log[key] = value; + } + } + return log; +} + +/** @internal */ +export class MongoLogger { + componentSeverities: Record; + maxDocumentLength: number; + logDestination: MongoDBLogWritable; + logDestinationIsStdErr: boolean; + pendingLog: PromiseLike | unknown = null; + private severities: Record>; + + /** + * This method should be used when logging errors that do not have a public driver API for + * reporting errors. + */ + error = this.log.bind(this, 'error'); + /** + * This method should be used to log situations where undesirable application behaviour might + * occur. For example, failing to end sessions on `MongoClient.close`. + */ + warn = this.log.bind(this, 'warn'); + /** + * This method should be used to report high-level information about normal driver behaviour. + * For example, the creation of a `MongoClient`. + */ + info = this.log.bind(this, 'info'); + /** + * This method should be used to report information that would be helpful when debugging an + * application. For example, a command starting, succeeding or failing. + */ + debug = this.log.bind(this, 'debug'); + /** + * This method should be used to report fine-grained details related to logic flow. For example, + * entering and exiting a function body. + */ + trace = this.log.bind(this, 'trace'); + + constructor(options: MongoLoggerOptions) { + this.componentSeverities = options.componentSeverities; + this.maxDocumentLength = options.maxDocumentLength; + this.logDestination = options.logDestination; + this.logDestinationIsStdErr = options.logDestinationIsStdErr; + this.severities = this.createLoggingSeverities(); + } + + createLoggingSeverities(): Record> { + const severities = Object(); + for (const component of Object.values(MongoLoggableComponent)) { + severities[component] = {}; + for (const severityLevel of Object.values(SeverityLevel)) { + severities[component][severityLevel] = + compareSeverity(severityLevel, this.componentSeverities[component]) <= 0; + } + } + return severities; + } + + turnOffSeverities() { + for (const component of Object.values(MongoLoggableComponent)) { + this.componentSeverities[component] = SeverityLevel.OFF; + for (const severityLevel of Object.values(SeverityLevel)) { + this.severities[component][severityLevel] = false; + } + } + } + + private logWriteFailureHandler(error: Error) { + if (this.logDestinationIsStdErr) { + this.turnOffSeverities(); + this.clearPendingLog(); + return; + } + this.logDestination = createStdioLogger(process.stderr); + this.logDestinationIsStdErr = true; + this.clearPendingLog(); + this.error(MongoLoggableComponent.CLIENT, { + toLog: function () { + return { + message: 'User input for mongodbLogPath is now invalid. Logging is halted.', + error: error.message + }; + } + }); + this.turnOffSeverities(); + this.clearPendingLog(); + } + + private clearPendingLog() { + this.pendingLog = null; + } + + willLog(component: MongoLoggableComponent, severity: SeverityLevel): boolean { + if (severity === SeverityLevel.OFF) return false; + return this.severities[component][severity]; + } + + private log( + severity: SeverityLevel, + component: MongoLoggableComponent, + message: Loggable | string + ): void { + if (!this.willLog(component, severity)) return; + + let logMessage: Log = { t: new Date(), c: component, s: severity }; + if (typeof message === 'string') { + logMessage.message = message; + } else if (typeof message === 'object') { + if (isLogConvertible(message)) { + logMessage = { ...logMessage, ...message.toLog() }; + } else { + logMessage = { ...logMessage, ...defaultLogTransform(message, this.maxDocumentLength) }; + } + } + + if (isPromiseLike(this.pendingLog)) { + this.pendingLog = this.pendingLog + + .then(() => this.logDestination.write(logMessage)) + + .then(this.clearPendingLog.bind(this), this.logWriteFailureHandler.bind(this)); + return; + } + + try { + const logResult = this.logDestination.write(logMessage); + if (isPromiseLike(logResult)) { + this.pendingLog = logResult.then( + this.clearPendingLog.bind(this), + this.logWriteFailureHandler.bind(this) + ); + } + } catch (error) { + this.logWriteFailureHandler(error); + } + } + + /** + * Merges options set through environment variables and the MongoClient, preferring environment + * variables when both are set, and substituting defaults for values not set. Options set in + * constructor take precedence over both environment variables and MongoClient options. + * + * @remarks + * When parsing component severity levels, invalid values are treated as unset and replaced with + * the default severity. + * + * @param envOptions - options set for the logger from the environment + * @param clientOptions - options set for the logger in the MongoClient options + * @returns a MongoLoggerOptions object to be used when instantiating a new MongoLogger + */ + static resolveOptions( + envOptions: MongoLoggerEnvOptions, + clientOptions: MongoLoggerMongoClientOptions + ): MongoLoggerOptions { + // client options take precedence over env options + const resolvedLogPath = resolveLogPath(envOptions, clientOptions); + const combinedOptions = { + ...envOptions, + ...clientOptions, + mongodbLogPath: resolvedLogPath.mongodbLogPath, + mongodbLogPathIsStdErr: resolvedLogPath.mongodbLogPathIsStdErr + }; + const defaultSeverity = resolveSeverityConfiguration( + combinedOptions.mongodbLogComponentSeverities?.default, + combinedOptions.MONGODB_LOG_ALL, + SeverityLevel.OFF + ); + + return { + componentSeverities: { + command: resolveSeverityConfiguration( + combinedOptions.mongodbLogComponentSeverities?.command, + combinedOptions.MONGODB_LOG_COMMAND, + defaultSeverity + ), + topology: resolveSeverityConfiguration( + combinedOptions.mongodbLogComponentSeverities?.topology, + combinedOptions.MONGODB_LOG_TOPOLOGY, + defaultSeverity + ), + serverSelection: resolveSeverityConfiguration( + combinedOptions.mongodbLogComponentSeverities?.serverSelection, + combinedOptions.MONGODB_LOG_SERVER_SELECTION, + defaultSeverity + ), + connection: resolveSeverityConfiguration( + combinedOptions.mongodbLogComponentSeverities?.connection, + combinedOptions.MONGODB_LOG_CONNECTION, + defaultSeverity + ), + client: resolveSeverityConfiguration( + combinedOptions.mongodbLogComponentSeverities?.client, + combinedOptions.MONGODB_LOG_CLIENT, + defaultSeverity + ), + default: defaultSeverity + }, + maxDocumentLength: + combinedOptions.mongodbLogMaxDocumentLength ?? + parseUnsignedInteger(combinedOptions.MONGODB_LOG_MAX_DOCUMENT_LENGTH) ?? + 1000, + logDestination: combinedOptions.mongodbLogPath, + logDestinationIsStdErr: combinedOptions.mongodbLogPathIsStdErr + }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_types.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_types.ts new file mode 100644 index 00000000..3c56585a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/mongo_types.ts @@ -0,0 +1,678 @@ +import { EventEmitter } from 'events'; + +import type { + Binary, + BSONRegExp, + BSONType, + Decimal128, + Document, + Double, + Int32, + Long, + ObjectId, + ObjectIdLike, + Timestamp +} from './bson'; +import { type CommandStartedEvent } from './cmap/command_monitoring_events'; +import { + type LoggableCommandFailedEvent, + type LoggableCommandSucceededEvent, + type LoggableServerHeartbeatFailedEvent, + type LoggableServerHeartbeatStartedEvent, + type LoggableServerHeartbeatSucceededEvent, + MongoLoggableComponent, + type MongoLogger +} from './mongo_logger'; +import type { Sort } from './sort'; +import { noop } from './utils'; + +/** @internal */ +export type TODO_NODE_3286 = any; + +/** Given an object shaped type, return the type of the _id field or default to ObjectId @public */ +export type InferIdType = TSchema extends { _id: infer IdType } + ? // user has defined a type for _id + Record extends IdType + ? never // explicitly forbid empty objects as the type of _id + : IdType + : TSchema extends { _id?: infer IdType } + ? // optional _id defined - return ObjectId | IdType + unknown extends IdType + ? ObjectId // infer the _id type as ObjectId if the type of _id is unknown + : IdType + : ObjectId; // user has not defined _id on schema + +/** Add an _id field to an object shaped type @public */ +export type WithId = EnhancedOmit & { _id: InferIdType }; + +/** + * Add an optional _id field to an object shaped type + * @public + */ +export type OptionalId = EnhancedOmit & { _id?: InferIdType }; + +/** + * Adds an optional _id field to an object shaped type, unless the _id field is required on that type. + * In the case _id is required, this method continues to require_id. + * + * @public + * + * @privateRemarks + * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask + * `TSchema['_id'] extends ObjectId` which translated to "Is the _id property ObjectId?" + * we instead ask "Does ObjectId look like (have the same shape) as the _id?" + */ +export type OptionalUnlessRequiredId = TSchema extends { _id: any } + ? TSchema + : OptionalId; + +/** TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions @public */ +export type EnhancedOmit = string extends keyof TRecordOrUnion + ? TRecordOrUnion // TRecordOrUnion has indexed type e.g. { _id: string; [k: string]: any; } or it is "any" + : TRecordOrUnion extends any + ? Pick> // discriminated unions + : never; + +/** Remove the _id field from an object shaped type @public */ +export type WithoutId = Omit; + +/** A MongoDB filter can be some portion of the schema or a set of operators @public */ +export type Filter = { + [P in keyof WithId]?: Condition[P]>; +} & RootFilterOperators>; + +/** @public */ +export type Condition = AlternativeType | FilterOperators>; + +/** + * It is possible to search using alternative types in mongodb e.g. + * string types can be searched using a regex in mongo + * array types can be searched using their element type + * @public + */ +export type AlternativeType = + T extends ReadonlyArray ? T | RegExpOrString : RegExpOrString; + +/** @public */ +export type RegExpOrString = T extends string ? BSONRegExp | RegExp | T : T; + +/** @public */ +export interface RootFilterOperators extends Document { + $and?: Filter[]; + $nor?: Filter[]; + $or?: Filter[]; + $text?: { + $search: string; + $language?: string; + $caseSensitive?: boolean; + $diacriticSensitive?: boolean; + }; + $where?: string | ((this: TSchema) => boolean); + $comment?: string | Document; +} + +/** + * @public + * A type that extends Document but forbids anything that "looks like" an object id. + */ +export type NonObjectIdLikeDocument = { + [key in keyof ObjectIdLike]?: never; +} & Document; + +/** @public */ +export interface FilterOperators extends NonObjectIdLikeDocument { + // Comparison + $eq?: TValue; + $gt?: TValue; + $gte?: TValue; + $in?: ReadonlyArray; + $lt?: TValue; + $lte?: TValue; + $ne?: TValue; + $nin?: ReadonlyArray; + // Logical + $not?: TValue extends string ? FilterOperators | RegExp : FilterOperators; + // Element + /** + * When `true`, `$exists` matches the documents that contain the field, + * including documents where the field value is null. + */ + $exists?: boolean; + $type?: BSONType | BSONTypeAlias; + // Evaluation + $expr?: Record; + $jsonSchema?: Record; + $mod?: TValue extends number ? [number, number] : never; + $regex?: TValue extends string ? RegExp | BSONRegExp | string : never; + $options?: TValue extends string ? string : never; + // Geospatial + $geoIntersects?: { $geometry: Document }; + $geoWithin?: Document; + $near?: Document; + $nearSphere?: Document; + $maxDistance?: number; + // Array + $all?: ReadonlyArray; + $elemMatch?: Document; + $size?: TValue extends ReadonlyArray ? number : never; + // Bitwise + $bitsAllClear?: BitwiseFilter; + $bitsAllSet?: BitwiseFilter; + $bitsAnyClear?: BitwiseFilter; + $bitsAnySet?: BitwiseFilter; + $rand?: Record; +} + +/** @public */ +export type BitwiseFilter = + | number /** numeric bit mask */ + | Binary /** BinData bit mask */ + | ReadonlyArray; /** `[ , , ... ]` */ + +/** @public */ +export type BSONTypeAlias = keyof typeof BSONType; + +/** @public */ +export type IsAny = true extends false & Type + ? ResultIfAny + : ResultIfNotAny; + +/** @public */ +export type Flatten = Type extends ReadonlyArray ? Item : Type; + +/** @public */ +export type ArrayElement = Type extends ReadonlyArray ? Item : never; + +/** @public */ +export type SchemaMember = { [P in keyof T]?: V } | { [key: string]: V }; + +/** @public */ +export type IntegerType = number | Int32 | Long | bigint; + +/** @public */ +export type NumericType = IntegerType | Decimal128 | Double; + +/** @public */ +export type FilterOperations = + T extends Record + ? { [key in keyof T]?: FilterOperators } + : FilterOperators; + +/** @public */ +export type KeysOfAType = { + [key in keyof TSchema]: NonNullable extends Type ? key : never; +}[keyof TSchema]; + +/** @public */ +export type KeysOfOtherType = { + [key in keyof TSchema]: NonNullable extends Type ? never : key; +}[keyof TSchema]; + +/** @public */ +export type AcceptedFields = { + readonly [key in KeysOfAType]?: AssignableType; +}; + +/** It avoids using fields with not acceptable types @public */ +export type NotAcceptedFields = { + readonly [key in KeysOfOtherType]?: never; +}; + +/** @public */ +export type OnlyFieldsOfType = IsAny< + TSchema[keyof TSchema], + AssignableType extends FieldType ? Record : Record, + AcceptedFields & + NotAcceptedFields & + Record +>; + +/** @public */ +export type MatchKeysAndValues = Readonly> & Record; + +/** @public */ +export type AddToSetOperators = { + $each?: Array>; +}; + +/** @public */ +export type ArrayOperator = { + $each?: Array>; + $slice?: number; + $position?: number; + $sort?: Sort; +}; + +/** @public */ +export type SetFields = ({ + readonly [key in KeysOfAType | undefined>]?: + | OptionalId> + | AddToSetOperators>>>; +} & IsAny< + TSchema[keyof TSchema], + object, + NotAcceptedFields | undefined> +>) & { + readonly [key: string]: AddToSetOperators | any; +}; + +/** @public */ +export type PushOperator = ({ + readonly [key in KeysOfAType>]?: + | Flatten + | ArrayOperator>>; +} & NotAcceptedFields>) & { + readonly [key: string]: ArrayOperator | any; +}; + +/** @public */ +export type PullOperator = ({ + readonly [key in KeysOfAType>]?: + | Partial> + | FilterOperations>; +} & NotAcceptedFields>) & { + readonly [key: string]: FilterOperators | any; +}; + +/** @public */ +export type PullAllOperator = ({ + readonly [key in KeysOfAType>]?: TSchema[key]; +} & NotAcceptedFields>) & { + readonly [key: string]: ReadonlyArray; +}; + +/** @public */ +export type UpdateFilter = { + $currentDate?: OnlyFieldsOfType< + TSchema, + Date | Timestamp, + true | { $type: 'date' | 'timestamp' } + >; + $inc?: OnlyFieldsOfType; + $min?: MatchKeysAndValues; + $max?: MatchKeysAndValues; + $mul?: OnlyFieldsOfType; + $rename?: Record; + $set?: MatchKeysAndValues; + $setOnInsert?: MatchKeysAndValues; + $unset?: OnlyFieldsOfType; + $addToSet?: SetFields; + $pop?: OnlyFieldsOfType, 1 | -1>; + $pull?: PullOperator; + $push?: PushOperator; + $pullAll?: PullAllOperator; + $bit?: OnlyFieldsOfType< + TSchema, + NumericType | undefined, + { and: IntegerType } | { or: IntegerType } | { xor: IntegerType } + >; +} & Document; + +/** @public */ +export type Nullable = AnyType | null | undefined; + +/** @public */ +export type OneOrMore = T | ReadonlyArray; + +/** @public */ +export type GenericListener = (...args: any[]) => void; + +/** + * Event description type + * @public + */ +export type EventsDescription = Record; + +/** @public */ +export type CommonEvents = 'newListener' | 'removeListener'; + +/** + * Typescript type safe event emitter + * @public + */ +export declare interface TypedEventEmitter extends EventEmitter { + addListener(event: EventKey, listener: Events[EventKey]): this; + addListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + addListener(event: string | symbol, listener: GenericListener): this; + + on(event: EventKey, listener: Events[EventKey]): this; + on( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + on(event: string | symbol, listener: GenericListener): this; + + once(event: EventKey, listener: Events[EventKey]): this; + once( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + once(event: string | symbol, listener: GenericListener): this; + + removeListener(event: EventKey, listener: Events[EventKey]): this; + removeListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + removeListener(event: string | symbol, listener: GenericListener): this; + + off(event: EventKey, listener: Events[EventKey]): this; + off( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + off(event: string | symbol, listener: GenericListener): this; + + removeAllListeners( + event?: EventKey | CommonEvents | symbol | string + ): this; + + listeners( + event: EventKey | CommonEvents | symbol | string + ): Events[EventKey][]; + + rawListeners( + event: EventKey | CommonEvents | symbol | string + ): Events[EventKey][]; + + emit( + event: EventKey | symbol, + ...args: Parameters + ): boolean; + + listenerCount( + type: EventKey | CommonEvents | symbol | string + ): number; + + prependListener(event: EventKey, listener: Events[EventKey]): this; + prependListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + prependListener(event: string | symbol, listener: GenericListener): this; + + prependOnceListener( + event: EventKey, + listener: Events[EventKey] + ): this; + prependOnceListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + prependOnceListener(event: string | symbol, listener: GenericListener): this; + + eventNames(): string[]; + getMaxListeners(): number; + setMaxListeners(n: number): this; +} + +/** + * Typescript type safe event emitter + * @public + */ + +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +export class TypedEventEmitter extends EventEmitter { + /** @internal */ + protected mongoLogger?: MongoLogger; + /** @internal */ + protected component?: MongoLoggableComponent; + /** @internal */ + emitAndLog( + event: EventKey | symbol, + ...args: Parameters + ): void { + this.emit(event, ...args); + if (this.component) this.mongoLogger?.debug(this.component, args[0]); + } + /** @internal */ + emitAndLogHeartbeat( + event: EventKey | symbol, + topologyId: number, + serverConnectionId?: number | '', + ...args: Parameters + ): void { + this.emit(event, ...args); + if (this.component) { + const loggableHeartbeatEvent: + | LoggableServerHeartbeatFailedEvent + | LoggableServerHeartbeatSucceededEvent + | LoggableServerHeartbeatStartedEvent = { + topologyId: topologyId, + serverConnectionId: serverConnectionId ?? null, + ...args[0] + }; + this.mongoLogger?.debug(this.component, loggableHeartbeatEvent); + } + } + /** @internal */ + emitAndLogCommand( + monitorCommands: boolean, + event: EventKey | symbol, + databaseName: string, + connectionEstablished: boolean, + ...args: Parameters + ): void { + if (monitorCommands) { + this.emit(event, ...args); + } + if (connectionEstablished) { + const loggableCommandEvent: + | CommandStartedEvent + | LoggableCommandFailedEvent + | LoggableCommandSucceededEvent = { + databaseName: databaseName, + ...args[0] + }; + this.mongoLogger?.debug(MongoLoggableComponent.COMMAND, loggableCommandEvent); + } + } +} + +/** + * @internal + */ +export class CancellationToken extends TypedEventEmitter<{ cancel(): void }> { + constructor(...args: any[]) { + super(...args); + this.on('error', noop); + } +} + +/** @public */ +export type Abortable = { + /** + * @experimental + * When provided, the corresponding `AbortController` can be used to abort an asynchronous action. + * + * The `signal.reason` value is used as the error thrown. + * + * @remarks + * **NOTE:** If an abort signal aborts an operation while the driver is writing to the underlying + * socket or reading the response from the server, the socket will be closed. + * If signals are aborted at a high rate during socket read/writes this can lead to a high rate of connection reestablishment. + * + * We plan to mitigate this in a future release, please follow NODE-6062 (`timeoutMS` expiration suffers the same limitation). + * + * AbortSignals are likely a best fit for human interactive interruption (ex. ctrl-C) where the frequency + * of cancellation is reasonably low. If a signal is programmatically aborted for 100s of operations you can empty + * the driver's connection pool. + * + * @example + * ```js + * const controller = new AbortController(); + * const { signal } = controller; + * process.on('SIGINT', () => controller.abort(new Error('^C pressed'))); + * + * try { + * const res = await fetch('...', { signal }); + * await collection.findOne(await res.json(), { signal }); + * catch (error) { + * if (error === signal.reason) { + * // signal abort error handling + * } + * } + * ``` + */ + signal?: AbortSignal | undefined; +}; + +/** + * Helper types for dot-notation filter attributes + */ + +/** @public */ +export type Join = T extends [] + ? '' + : T extends [string | number] + ? `${T[0]}` + : T extends [string | number, ...infer R] + ? `${T[0]}${D}${Join}` + : string; + +/** @public */ +export type PropertyType = string extends Property + ? unknown + : Property extends keyof Type + ? Type[Property] + : Property extends `${number}` + ? Type extends ReadonlyArray + ? ArrayType + : unknown + : Property extends `${infer Key}.${infer Rest}` + ? Key extends `${number}` + ? Type extends ReadonlyArray + ? PropertyType + : unknown + : Key extends keyof Type + ? Type[Key] extends Map + ? MapType + : PropertyType + : unknown + : unknown; + +/** + * @public + * returns tuple of strings (keys to be joined on '.') that represent every path into a schema + * https://www.mongodb.com/docs/manual/tutorial/query-embedded-documents/ + * + * @remarks + * Through testing we determined that a depth of 8 is safe for the typescript compiler + * and provides reasonable compilation times. This number is otherwise not special and + * should be changed if issues are found with this level of checking. Beyond this + * depth any helpers that make use of NestedPaths should devolve to not asserting any + * type safety on the input. + */ +export type NestedPaths = Depth['length'] extends 8 + ? [] + : Type extends + | string + | number + | bigint + | boolean + | Date + | RegExp + | Buffer + | Uint8Array + | ((...args: any[]) => any) + | { _bsontype: string } + ? [] + : Type extends ReadonlyArray + ? [] | [number, ...NestedPaths] + : Type extends Map + ? [string] + : Type extends object + ? { + [Key in Extract]: Type[Key] extends Type // type of value extends the parent + ? [Key] + : // for a recursive union type, the child will never extend the parent type. + // but the parent will still extend the child + Type extends Type[Key] + ? [Key] + : Type[Key] extends ReadonlyArray // handling recursive types with arrays + ? Type extends ArrayType // is the type of the parent the same as the type of the array? + ? [Key] // yes, it's a recursive array type + : // for unions, the child type extends the parent + ArrayType extends Type + ? [Key] // we have a recursive array union + : // child is an array, but it's not a recursive array + [Key, ...NestedPaths] + : // child is not structured the same as the parent + [Key, ...NestedPaths] | [Key]; + }[Extract] + : []; + +/** + * @public + * returns keys (strings) for every path into a schema with a value of type + * https://www.mongodb.com/docs/manual/tutorial/query-embedded-documents/ + */ +export type NestedPathsOfType = KeysOfAType< + { + [Property in Join, '.'>]: PropertyType; + }, + Type +>; + +/** + * @public + * @experimental + */ +export type StrictFilter = + | Partial + | ({ + [Property in Join, []>, '.'>]?: Condition< + PropertyType, Property> + >; + } & RootFilterOperators>); + +/** + * @public + * @experimental + */ +export type StrictUpdateFilter = { + $currentDate?: OnlyFieldsOfType< + TSchema, + Date | Timestamp, + true | { $type: 'date' | 'timestamp' } + >; + $inc?: OnlyFieldsOfType; + $min?: StrictMatchKeysAndValues; + $max?: StrictMatchKeysAndValues; + $mul?: OnlyFieldsOfType; + $rename?: Record; + $set?: StrictMatchKeysAndValues; + $setOnInsert?: StrictMatchKeysAndValues; + $unset?: OnlyFieldsOfType; + $addToSet?: SetFields; + $pop?: OnlyFieldsOfType, 1 | -1>; + $pull?: PullOperator; + $push?: PushOperator; + $pullAll?: PullAllOperator; + $bit?: OnlyFieldsOfType< + TSchema, + NumericType | undefined, + { and: IntegerType } | { or: IntegerType } | { xor: IntegerType } + >; +} & Document; + +/** + * @public + * @experimental + */ +export type StrictMatchKeysAndValues = Readonly< + { + [Property in Join, '.'>]?: PropertyType; + } & { + [Property in `${NestedPathsOfType}.$${`[${string}]` | ''}`]?: ArrayElement< + PropertyType + >; + } & { + [Property in `${NestedPathsOfType[]>}.$${ + | `[${string}]` + | ''}.${string}`]?: any; // Could be further narrowed + } & Document +>; diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/aggregate.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/aggregate.ts new file mode 100644 index 00000000..e1ae2bbf --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/aggregate.ts @@ -0,0 +1,153 @@ +import type { Document } from '../bson'; +import { CursorResponse, ExplainedCursorResponse } from '../cmap/wire_protocol/responses'; +import { type CursorTimeoutMode } from '../cursor/abstract_cursor'; +import { MongoInvalidArgumentError } from '../error'; +import { type ExplainOptions } from '../explain'; +import { type MongoDBNamespace } from '../utils'; +import { WriteConcern } from '../write_concern'; +import { type CollationOptions, CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects, type Hint } from './operation'; + +/** @internal */ +export const DB_AGGREGATE_COLLECTION = 1 as const; + +/** @public */ +export interface AggregateOptions extends Omit { + /** allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 \>). */ + allowDiskUse?: boolean; + /** The number of documents to return per batch. See [aggregation documentation](https://www.mongodb.com/docs/manual/reference/command/aggregate). */ + batchSize?: number; + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** Return the query as cursor, on 2.6 \> it returns as a real cursor on pre 2.6 it returns as an emulated cursor. */ + cursor?: Document; + /** + * Specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point. + */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. */ + maxAwaitTimeMS?: number; + /** Specify collation. */ + collation?: CollationOptions; + /** Add an index selection hint to an aggregation command */ + hint?: Hint; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + + out?: string; + + /** + * Specifies the verbosity mode for the explain output. + * @deprecated This API is deprecated in favor of `collection.aggregate().explain()` + * or `db.aggregate().explain()`. + */ + explain?: ExplainOptions['explain']; + /** @internal */ + timeoutMode?: CursorTimeoutMode; +} + +/** @internal */ +export class AggregateOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = CursorResponse; + override options: AggregateOptions; + target: string | typeof DB_AGGREGATE_COLLECTION; + pipeline: Document[]; + hasWriteStage: boolean; + + constructor(ns: MongoDBNamespace, pipeline: Document[], options?: AggregateOptions) { + super(undefined, { ...options, dbName: ns.db }); + + this.options = { ...options }; + + // Covers when ns.collection is null, undefined or the empty string, use DB_AGGREGATE_COLLECTION + this.target = ns.collection || DB_AGGREGATE_COLLECTION; + + this.pipeline = pipeline; + + // determine if we have a write stage, override read preference if so + this.hasWriteStage = false; + if (typeof options?.out === 'string') { + this.pipeline = this.pipeline.concat({ $out: options.out }); + this.hasWriteStage = true; + } else if (pipeline.length > 0) { + const finalStage = pipeline[pipeline.length - 1]; + if (finalStage.$out || finalStage.$merge) { + this.hasWriteStage = true; + } + } + + if (!this.hasWriteStage) { + delete this.options.writeConcern; + } + + if (options?.cursor != null && typeof options.cursor !== 'object') { + throw new MongoInvalidArgumentError('Cursor options must be an object'); + } + + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? ExplainedCursorResponse : CursorResponse; + } + + override get commandName() { + return 'aggregate' as const; + } + + override get canRetryRead(): boolean { + return !this.hasWriteStage; + } + + addToPipeline(stage: Document): void { + this.pipeline.push(stage); + } + + override buildCommandDocument(): Document { + const options = this.options; + const command: Document = { aggregate: this.target, pipeline: this.pipeline }; + + if (this.hasWriteStage && this.writeConcern) { + WriteConcern.apply(command, this.writeConcern); + } + + if (options.bypassDocumentValidation === true) { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + + if (typeof options.allowDiskUse === 'boolean') { + command.allowDiskUse = options.allowDiskUse; + } + + if (options.hint) { + command.hint = options.hint; + } + + if (options.let) { + command.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + command.cursor = options.cursor || {}; + if (options.batchSize && !this.hasWriteStage) { + command.cursor.batchSize = options.batchSize; + } + + return command; + } + + override handleOk( + response: InstanceType + ): CursorResponse { + return response; + } +} + +defineAspects(AggregateOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.EXPLAINABLE, + Aspect.CURSOR_CREATING, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/client_bulk_write.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/client_bulk_write.ts new file mode 100644 index 00000000..0c78cb7c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/client_bulk_write.ts @@ -0,0 +1,72 @@ +import { type Connection } from '../../cmap/connection'; +import { ClientBulkWriteCursorResponse } from '../../cmap/wire_protocol/responses'; +import type { ClientSession } from '../../sessions'; +import { MongoDBNamespace } from '../../utils'; +import { CommandOperation } from '../command'; +import { Aspect, defineAspects } from '../operation'; +import { type ClientBulkWriteCommand, type ClientBulkWriteCommandBuilder } from './command_builder'; +import { type ClientBulkWriteOptions } from './common'; + +/** + * Executes a single client bulk write operation within a potential batch. + * @internal + */ +export class ClientBulkWriteOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = ClientBulkWriteCursorResponse; + + commandBuilder: ClientBulkWriteCommandBuilder; + override options: ClientBulkWriteOptions; + + override get commandName() { + return 'bulkWrite' as const; + } + + constructor(commandBuilder: ClientBulkWriteCommandBuilder, options: ClientBulkWriteOptions) { + super(undefined, options); + this.commandBuilder = commandBuilder; + this.options = options; + this.ns = new MongoDBNamespace('admin', '$cmd'); + } + + override resetBatch(): boolean { + return this.commandBuilder.resetBatch(); + } + + override get canRetryWrite(): boolean { + return this.commandBuilder.isBatchRetryable; + } + + override handleOk( + response: InstanceType + ): ClientBulkWriteCursorResponse { + return response; + } + + override buildCommandDocument( + connection: Connection, + _session?: ClientSession + ): ClientBulkWriteCommand { + const command = this.commandBuilder.buildBatch( + connection.description.maxMessageSizeBytes, + connection.description.maxWriteBatchSize, + connection.description.maxBsonObjectSize + ); + + // Check _after_ the batch is built if we cannot retry it and override the option. + if (!this.canRetryWrite) { + this.options.willRetryWrite = false; + } + + return command; + } +} + +// Skipping the collation as it goes on the individual ops. +defineAspects(ClientBulkWriteOperation, [ + Aspect.WRITE_OPERATION, + Aspect.SKIP_COLLATION, + Aspect.CURSOR_CREATING, + Aspect.RETRYABLE, + Aspect.COMMAND_BATCHING, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/command_builder.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/command_builder.ts new file mode 100644 index 00000000..dee80fac --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/command_builder.ts @@ -0,0 +1,487 @@ +import { BSON, type BSONSerializeOptions, type Document } from '../../bson'; +import { DocumentSequence } from '../../cmap/commands'; +import { MongoAPIError, MongoInvalidArgumentError } from '../../error'; +import { type PkFactory } from '../../mongo_client'; +import type { Filter, OptionalId, UpdateFilter, WithoutId } from '../../mongo_types'; +import { formatSort, type SortForCmd } from '../../sort'; +import { DEFAULT_PK_FACTORY, hasAtomicOperators } from '../../utils'; +import { type CollationOptions } from '../command'; +import { type Hint } from '../operation'; +import type { + AnyClientBulkWriteModel, + ClientBulkWriteOptions, + ClientDeleteManyModel, + ClientDeleteOneModel, + ClientInsertOneModel, + ClientReplaceOneModel, + ClientUpdateManyModel, + ClientUpdateOneModel +} from './common'; + +/** @internal */ +export interface ClientBulkWriteCommand { + bulkWrite: 1; + errorsOnly: boolean; + ordered: boolean; + ops: DocumentSequence; + nsInfo: DocumentSequence; + bypassDocumentValidation?: boolean; + let?: Document; + comment?: any; +} + +/** + * The bytes overhead for the extra fields added post command generation. + */ +const MESSAGE_OVERHEAD_BYTES = 1000; + +/** @internal */ +export class ClientBulkWriteCommandBuilder { + models: ReadonlyArray>; + options: ClientBulkWriteOptions; + pkFactory: PkFactory; + /** The current index in the models array that is being processed. */ + currentModelIndex: number; + /** The model index that the builder was on when it finished the previous batch. Used for resets when retrying. */ + previousModelIndex: number; + /** The last array of operations that were created. Used by the results merger for indexing results. */ + lastOperations: Document[]; + /** Returns true if the current batch being created has no multi-updates. */ + isBatchRetryable: boolean; + + /** + * Create the command builder. + * @param models - The client write models. + */ + constructor( + models: ReadonlyArray>, + options: ClientBulkWriteOptions, + pkFactory?: PkFactory + ) { + this.models = models; + this.options = options; + this.pkFactory = pkFactory ?? DEFAULT_PK_FACTORY; + this.currentModelIndex = 0; + this.previousModelIndex = 0; + this.lastOperations = []; + this.isBatchRetryable = true; + } + + /** + * Gets the errorsOnly value for the command, which is the inverse of the + * user provided verboseResults option. Defaults to true. + */ + get errorsOnly(): boolean { + if ('verboseResults' in this.options) { + return !this.options.verboseResults; + } + return true; + } + + /** + * Determines if there is another batch to process. + * @returns True if not all batches have been built. + */ + hasNextBatch(): boolean { + return this.currentModelIndex < this.models.length; + } + + /** + * When we need to retry a command we need to set the current + * model index back to its previous value. + */ + resetBatch(): boolean { + this.currentModelIndex = this.previousModelIndex; + return true; + } + + /** + * Build a single batch of a client bulk write command. + * @param maxMessageSizeBytes - The max message size in bytes. + * @param maxWriteBatchSize - The max write batch size. + * @returns The client bulk write command. + */ + buildBatch( + maxMessageSizeBytes: number, + maxWriteBatchSize: number, + maxBsonObjectSize: number + ): ClientBulkWriteCommand { + // We start by assuming the batch has no multi-updates, so it is retryable + // until we find them. + this.isBatchRetryable = true; + let commandLength = 0; + let currentNamespaceIndex = 0; + const command: ClientBulkWriteCommand = this.baseCommand(); + const namespaces = new Map(); + // In the case of retries we need to mark where we started this batch. + this.previousModelIndex = this.currentModelIndex; + + while (this.currentModelIndex < this.models.length) { + const model = this.models[this.currentModelIndex]; + const ns = model.namespace; + const nsIndex = namespaces.get(ns); + + // Multi updates are not retryable. + if (model.name === 'deleteMany' || model.name === 'updateMany') { + this.isBatchRetryable = false; + } + + if (nsIndex != null) { + // Build the operation and serialize it to get the bytes buffer. + const operation = buildOperation(model, nsIndex, this.pkFactory, this.options); + let operationBuffer; + try { + operationBuffer = BSON.serialize(operation); + } catch (cause) { + throw new MongoInvalidArgumentError(`Could not serialize operation to BSON`, { cause }); + } + + validateBufferSize('ops', operationBuffer, maxBsonObjectSize); + + // Check if the operation buffer can fit in the command. If it can, + // then add the operation to the document sequence and increment the + // current length as long as the ops don't exceed the maxWriteBatchSize. + if ( + commandLength + operationBuffer.length < maxMessageSizeBytes && + command.ops.documents.length < maxWriteBatchSize + ) { + // Pushing to the ops document sequence returns the total byte length of the document sequence. + commandLength = MESSAGE_OVERHEAD_BYTES + command.ops.push(operation, operationBuffer); + // Increment the builder's current model index. + this.currentModelIndex++; + } else { + // The operation cannot fit in the current command and will need to + // go in the next batch. Exit the loop. + break; + } + } else { + // The namespace is not already in the nsInfo so we will set it in the map, and + // construct our nsInfo and ops documents and buffers. + namespaces.set(ns, currentNamespaceIndex); + const nsInfo = { ns: ns }; + const operation = buildOperation( + model, + currentNamespaceIndex, + this.pkFactory, + this.options + ); + let nsInfoBuffer; + let operationBuffer; + try { + nsInfoBuffer = BSON.serialize(nsInfo); + operationBuffer = BSON.serialize(operation); + } catch (cause) { + throw new MongoInvalidArgumentError(`Could not serialize ns info to BSON`, { cause }); + } + + validateBufferSize('nsInfo', nsInfoBuffer, maxBsonObjectSize); + validateBufferSize('ops', operationBuffer, maxBsonObjectSize); + + // Check if the operation and nsInfo buffers can fit in the command. If they + // can, then add the operation and nsInfo to their respective document + // sequences and increment the current length as long as the ops don't exceed + // the maxWriteBatchSize. + if ( + commandLength + nsInfoBuffer.length + operationBuffer.length < maxMessageSizeBytes && + command.ops.documents.length < maxWriteBatchSize + ) { + // Pushing to the ops document sequence returns the total byte length of the document sequence. + commandLength = + MESSAGE_OVERHEAD_BYTES + + command.nsInfo.push(nsInfo, nsInfoBuffer) + + command.ops.push(operation, operationBuffer); + // We've added a new namespace, increment the namespace index. + currentNamespaceIndex++; + // Increment the builder's current model index. + this.currentModelIndex++; + } else { + // The operation cannot fit in the current command and will need to + // go in the next batch. Exit the loop. + break; + } + } + } + // Set the last operations and return the command. + this.lastOperations = command.ops.documents; + return command; + } + + private baseCommand(): ClientBulkWriteCommand { + const command: ClientBulkWriteCommand = { + bulkWrite: 1, + errorsOnly: this.errorsOnly, + ordered: this.options.ordered ?? true, + ops: new DocumentSequence('ops'), + nsInfo: new DocumentSequence('nsInfo') + }; + // Add bypassDocumentValidation if it was present in the options. + if (this.options.bypassDocumentValidation != null) { + command.bypassDocumentValidation = this.options.bypassDocumentValidation; + } + // Add let if it was present in the options. + if (this.options.let) { + command.let = this.options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + + return command; + } +} + +function validateBufferSize(name: string, buffer: Uint8Array, maxBsonObjectSize: number) { + if (buffer.length > maxBsonObjectSize) { + throw new MongoInvalidArgumentError( + `Client bulk write operation ${name} of length ${buffer.length} exceeds the max bson object size of ${maxBsonObjectSize}` + ); + } +} + +/** @internal */ +export interface ClientInsertOperation { + insert: number; + document: OptionalId; +} + +/** + * Build the insert one operation. + * @param model - The insert one model. + * @param index - The namespace index. + * @returns the operation. + */ +export const buildInsertOneOperation = ( + model: ClientInsertOneModel, + index: number, + pkFactory: PkFactory +): ClientInsertOperation => { + const document: ClientInsertOperation = { + insert: index, + document: model.document + }; + document.document._id = model.document._id ?? pkFactory.createPk(); + return document; +}; + +/** @internal */ +export interface ClientDeleteOperation { + delete: number; + multi: boolean; + filter: Filter; + hint?: Hint; + collation?: CollationOptions; +} + +/** + * Build the delete one operation. + * @param model - The insert many model. + * @param index - The namespace index. + * @returns the operation. + */ +export const buildDeleteOneOperation = ( + model: ClientDeleteOneModel, + index: number +): Document => { + return createDeleteOperation(model, index, false); +}; + +/** + * Build the delete many operation. + * @param model - The delete many model. + * @param index - The namespace index. + * @returns the operation. + */ +export const buildDeleteManyOperation = ( + model: ClientDeleteManyModel, + index: number +): Document => { + return createDeleteOperation(model, index, true); +}; + +/** + * Creates a delete operation based on the parameters. + */ +function createDeleteOperation( + model: ClientDeleteOneModel | ClientDeleteManyModel, + index: number, + multi: boolean +): ClientDeleteOperation { + const document: ClientDeleteOperation = { + delete: index, + multi: multi, + filter: model.filter + }; + if (model.hint) { + document.hint = model.hint; + } + if (model.collation) { + document.collation = model.collation; + } + return document; +} + +/** @internal */ +export interface ClientUpdateOperation { + update: number; + multi: boolean; + filter: Filter; + updateMods: UpdateFilter | Document[]; + hint?: Hint; + upsert?: boolean; + arrayFilters?: Document[]; + collation?: CollationOptions; + sort?: SortForCmd; +} + +/** + * Build the update one operation. + * @param model - The update one model. + * @param index - The namespace index. + * @returns the operation. + */ +export const buildUpdateOneOperation = ( + model: ClientUpdateOneModel, + index: number, + options: BSONSerializeOptions +): ClientUpdateOperation => { + return createUpdateOperation(model, index, false, options); +}; + +/** + * Build the update many operation. + * @param model - The update many model. + * @param index - The namespace index. + * @returns the operation. + */ +export const buildUpdateManyOperation = ( + model: ClientUpdateManyModel, + index: number, + options: BSONSerializeOptions +): ClientUpdateOperation => { + return createUpdateOperation(model, index, true, options); +}; + +/** + * Validate the update document. + * @param update - The update document. + */ +function validateUpdate(update: Document, options: BSONSerializeOptions) { + if (!hasAtomicOperators(update, options)) { + throw new MongoAPIError( + 'Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty.' + ); + } +} + +/** + * Creates a delete operation based on the parameters. + */ +function createUpdateOperation( + model: ClientUpdateOneModel | ClientUpdateManyModel, + index: number, + multi: boolean, + options: BSONSerializeOptions +): ClientUpdateOperation { + // Update documents provided in UpdateOne and UpdateMany write models are + // required only to contain atomic modifiers (i.e. keys that start with "$"). + // Drivers MUST throw an error if an update document is empty or if the + // document's first key does not start with "$". + validateUpdate(model.update, options); + const document: ClientUpdateOperation = { + update: index, + multi: multi, + filter: model.filter, + updateMods: model.update + }; + if (model.hint) { + document.hint = model.hint; + } + if (model.upsert) { + document.upsert = model.upsert; + } + if (model.arrayFilters) { + document.arrayFilters = model.arrayFilters; + } + if (model.collation) { + document.collation = model.collation; + } + if (!multi && 'sort' in model && model.sort != null) { + document.sort = formatSort(model.sort); + } + return document; +} + +/** @internal */ +export interface ClientReplaceOneOperation { + update: number; + multi: boolean; + filter: Filter; + updateMods: WithoutId; + hint?: Hint; + upsert?: boolean; + collation?: CollationOptions; + sort?: SortForCmd; +} + +/** + * Build the replace one operation. + * @param model - The replace one model. + * @param index - The namespace index. + * @returns the operation. + */ +export const buildReplaceOneOperation = ( + model: ClientReplaceOneModel, + index: number +): ClientReplaceOneOperation => { + if (hasAtomicOperators(model.replacement)) { + throw new MongoAPIError( + 'Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty.' + ); + } + + const document: ClientReplaceOneOperation = { + update: index, + multi: false, + filter: model.filter, + updateMods: model.replacement + }; + if (model.hint) { + document.hint = model.hint; + } + if (model.upsert) { + document.upsert = model.upsert; + } + if (model.collation) { + document.collation = model.collation; + } + if (model.sort != null) { + document.sort = formatSort(model.sort); + } + return document; +}; + +/** @internal */ +export function buildOperation( + model: AnyClientBulkWriteModel, + index: number, + pkFactory: PkFactory, + options: BSONSerializeOptions +): Document { + switch (model.name) { + case 'insertOne': + return buildInsertOneOperation(model, index, pkFactory); + case 'deleteOne': + return buildDeleteOneOperation(model, index); + case 'deleteMany': + return buildDeleteManyOperation(model, index); + case 'updateOne': + return buildUpdateOneOperation(model, index, options); + case 'updateMany': + return buildUpdateManyOperation(model, index, options); + case 'replaceOne': + return buildReplaceOneOperation(model, index); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/common.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/common.ts new file mode 100644 index 00000000..b08725be --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/common.ts @@ -0,0 +1,276 @@ +import { type Document } from '../../bson'; +import type { Filter, OptionalId, UpdateFilter, WithoutId } from '../../mongo_types'; +import type { CollationOptions, CommandOperationOptions } from '../../operations/command'; +import type { Hint } from '../../operations/operation'; +import { type Sort } from '../../sort'; + +/** @public */ +export interface ClientBulkWriteOptions extends CommandOperationOptions { + /** + * If true, when an insert fails, don't execute the remaining writes. + * If false, continue with remaining inserts when one fails. + * @defaultValue `true` - inserts are ordered by default + */ + ordered?: boolean; + /** + * Allow driver to bypass schema validation. + * @defaultValue `false` - documents will be validated by default + **/ + bypassDocumentValidation?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Whether detailed results for each successful operation should be included in the returned + * BulkWriteResult. + */ + verboseResults?: boolean; +} + +/** @public */ +export interface ClientWriteModel { + /** + * The namespace for the write. + * + * A namespace is a combination of the database name and the name of the collection: `.`. + * All documents belong to a namespace. + * + * @see https://www.mongodb.com/docs/manual/reference/limits/#std-label-faq-dev-namespace + */ + namespace: string; +} + +/** @public */ +export interface ClientInsertOneModel extends ClientWriteModel { + name: 'insertOne'; + /** The document to insert. */ + document: OptionalId; +} + +/** @public */ +export interface ClientDeleteOneModel extends ClientWriteModel { + name: 'deleteOne'; + /** + * The filter used to determine if a document should be deleted. + * For a deleteOne operation, the first match is removed. + */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export interface ClientDeleteManyModel extends ClientWriteModel { + name: 'deleteMany'; + /** + * The filter used to determine if a document should be deleted. + * For a deleteMany operation, all matches are removed. + */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export interface ClientReplaceOneModel extends ClientWriteModel { + name: 'replaceOne'; + /** + * The filter used to determine if a document should be replaced. + * For a replaceOne operation, the first match is replaced. + */ + filter: Filter; + /** The document with which to replace the matched document. */ + replacement: WithoutId; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @public */ +export interface ClientUpdateOneModel extends ClientWriteModel { + name: 'updateOne'; + /** + * The filter used to determine if a document should be updated. + * For an updateOne operation, the first match is updated. + */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @public */ +export interface ClientUpdateManyModel extends ClientWriteModel { + name: 'updateMany'; + /** + * The filter used to determine if a document should be updated. + * For an updateMany operation, all matches are updated. + */ + filter: Filter; + /** + * The modifications to apply. The value can be either: + * UpdateFilter - A document that contains update operator expressions, + * Document[] - an aggregation pipeline. + */ + update: UpdateFilter | Document[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** + * Used to represent any of the client bulk write models that can be passed as an array + * to MongoClient#bulkWrite. + * @public + */ +export type AnyClientBulkWriteModel = + | ClientInsertOneModel + | ClientReplaceOneModel + | ClientUpdateOneModel + | ClientUpdateManyModel + | ClientDeleteOneModel + | ClientDeleteManyModel; + +/** + * A mapping of namespace strings to collections schemas. + * @public + * + * @example + * ```ts + * type MongoDBSchemas = { + * 'db.books': Book; + * 'db.authors': Author; + * } + * + * const model: ClientBulkWriteModel = { + * namespace: 'db.books' + * name: 'insertOne', + * document: { title: 'Practical MongoDB Aggregations', authorName: 3 } // error `authorName` cannot be number + * }; + * ``` + * + * The type of the `namespace` field narrows other parts of the BulkWriteModel to use the correct schema for type assertions. + * + */ +export type ClientBulkWriteModel< + SchemaMap extends Record = Record +> = { + [Namespace in keyof SchemaMap]: AnyClientBulkWriteModel & { + namespace: Namespace; + }; +}[keyof SchemaMap]; + +/** @public */ +export interface ClientBulkWriteResult { + /** + * Whether the bulk write was acknowledged. + */ + readonly acknowledged: boolean; + /** + * The total number of documents inserted across all insert operations. + */ + readonly insertedCount: number; + /** + * The total number of documents upserted across all update operations. + */ + readonly upsertedCount: number; + /** + * The total number of documents matched across all update operations. + */ + readonly matchedCount: number; + /** + * The total number of documents modified across all update operations. + */ + readonly modifiedCount: number; + /** + * The total number of documents deleted across all delete operations. + */ + readonly deletedCount: number; + /** + * The results of each individual insert operation that was successfully performed. + */ + readonly insertResults?: ReadonlyMap; + /** + * The results of each individual update operation that was successfully performed. + */ + readonly updateResults?: ReadonlyMap; + /** + * The results of each individual delete operation that was successfully performed. + */ + readonly deleteResults?: ReadonlyMap; +} + +/** @public */ +export interface ClientBulkWriteError { + code: number; + message: string; +} + +/** @public */ +export interface ClientInsertOneResult { + /** + * The _id of the inserted document. + */ + insertedId: any; +} + +/** @public */ +export interface ClientUpdateResult { + /** + * The number of documents that matched the filter. + */ + matchedCount: number; + + /** + * The number of documents that were modified. + */ + modifiedCount: number; + + /** + * The _id field of the upserted document if an upsert occurred. + * + * It MUST be possible to discern between a BSON Null upserted ID value and this field being + * unset. If necessary, drivers MAY add a didUpsert boolean field to differentiate between + * these two cases. + */ + upsertedId?: any; + + /** + * Determines if the upsert did include an _id, which includes the case of the _id being null. + */ + didUpsert: boolean; +} + +/** @public */ +export interface ClientDeleteResult { + /** + * The number of documents that were deleted. + */ + deletedCount: number; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/executor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/executor.ts new file mode 100644 index 00000000..6d12c79c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/executor.ts @@ -0,0 +1,149 @@ +import { type Document } from '../../bson'; +import { CursorTimeoutContext, CursorTimeoutMode } from '../../cursor/abstract_cursor'; +import { ClientBulkWriteCursor } from '../../cursor/client_bulk_write_cursor'; +import { + MongoClientBulkWriteError, + MongoClientBulkWriteExecutionError, + MongoInvalidArgumentError, + MongoServerError +} from '../../error'; +import { type MongoClient } from '../../mongo_client'; +import { TimeoutContext } from '../../timeout'; +import { resolveTimeoutOptions } from '../../utils'; +import { WriteConcern } from '../../write_concern'; +import { executeOperation } from '../execute_operation'; +import { ClientBulkWriteOperation } from './client_bulk_write'; +import { ClientBulkWriteCommandBuilder } from './command_builder'; +import { + type AnyClientBulkWriteModel, + type ClientBulkWriteOptions, + type ClientBulkWriteResult +} from './common'; +import { ClientBulkWriteResultsMerger } from './results_merger'; + +/** + * Responsible for executing a client bulk write. + * @internal + */ +export class ClientBulkWriteExecutor { + private readonly client: MongoClient; + private readonly options: ClientBulkWriteOptions; + private readonly operations: ReadonlyArray>; + + /** + * Instantiate the executor. + * @param client - The mongo client. + * @param operations - The user supplied bulk write models. + * @param options - The bulk write options. + */ + constructor( + client: MongoClient, + operations: ReadonlyArray>, + options?: ClientBulkWriteOptions + ) { + if (operations.length === 0) { + throw new MongoClientBulkWriteExecutionError('No client bulk write models were provided.'); + } + + this.client = client; + this.operations = operations; + this.options = { + ordered: true, + bypassDocumentValidation: false, + verboseResults: false, + ...options + }; + + // If no write concern was provided, we inherit one from the client. + if (!this.options.writeConcern) { + this.options.writeConcern = WriteConcern.fromOptions(this.client.s.options); + } + + if (this.options.writeConcern?.w === 0) { + if (this.options.verboseResults) { + throw new MongoInvalidArgumentError( + 'Cannot request unacknowledged write concern and verbose results' + ); + } + + if (this.options.ordered) { + throw new MongoInvalidArgumentError( + 'Cannot request unacknowledged write concern and ordered writes' + ); + } + } + } + + /** + * Execute the client bulk write. Will split commands into batches and exhaust the cursors + * for each, then merge the results into one. + * @returns The result. + */ + async execute(): Promise { + // The command builder will take the user provided models and potential split the batch + // into multiple commands due to size. + const pkFactory = this.client.s.options.pkFactory; + const commandBuilder = new ClientBulkWriteCommandBuilder( + this.operations, + this.options, + pkFactory + ); + // Unacknowledged writes need to execute all batches and return { ok: 1} + const resolvedOptions = resolveTimeoutOptions(this.client, this.options); + const context = TimeoutContext.create(resolvedOptions); + + if (this.options.writeConcern?.w === 0) { + while (commandBuilder.hasNextBatch()) { + const operation = new ClientBulkWriteOperation(commandBuilder, this.options); + await executeOperation(this.client, operation, context); + } + return ClientBulkWriteResultsMerger.unacknowledged(); + } else { + const resultsMerger = new ClientBulkWriteResultsMerger(this.options); + // For each command will will create and exhaust a cursor for the results. + while (commandBuilder.hasNextBatch()) { + const cursorContext = new CursorTimeoutContext(context, Symbol()); + const options = { + ...this.options, + timeoutContext: cursorContext, + ...(resolvedOptions.timeoutMS != null && { timeoutMode: CursorTimeoutMode.LIFETIME }) + }; + const cursor = new ClientBulkWriteCursor(this.client, commandBuilder, options); + try { + await resultsMerger.merge(cursor); + } catch (error) { + // Write concern errors are recorded in the writeConcernErrors field on MongoClientBulkWriteError. + // When a write concern error is encountered, it should not terminate execution of the bulk write + // for either ordered or unordered bulk writes. However, drivers MUST throw an exception at the end + // of execution if any write concern errors were observed. + if (error instanceof MongoServerError && !(error instanceof MongoClientBulkWriteError)) { + // Server side errors need to be wrapped inside a MongoClientBulkWriteError, where the root + // cause is the error property and a partial result is to be included. + const bulkWriteError = new MongoClientBulkWriteError({ + message: 'Mongo client bulk write encountered an error during execution' + }); + bulkWriteError.cause = error; + bulkWriteError.partialResult = resultsMerger.bulkWriteResult; + throw bulkWriteError; + } else { + // Client side errors are just thrown. + throw error; + } + } + } + + // If we have write concern errors or unordered write errors at the end we throw. + if (resultsMerger.writeConcernErrors.length > 0 || resultsMerger.writeErrors.size > 0) { + const error = new MongoClientBulkWriteError({ + message: 'Mongo client bulk write encountered errors during execution.' + }); + error.writeConcernErrors = resultsMerger.writeConcernErrors; + error.writeErrors = resultsMerger.writeErrors; + error.partialResult = resultsMerger.bulkWriteResult; + throw error; + } + + return resultsMerger.bulkWriteResult; + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/results_merger.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/results_merger.ts new file mode 100644 index 00000000..1a0f0a9f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/client_bulk_write/results_merger.ts @@ -0,0 +1,260 @@ +import { MongoWriteConcernError } from '../..'; +import { type Document } from '../../bson'; +import { type ClientBulkWriteCursor } from '../../cursor/client_bulk_write_cursor'; +import { MongoClientBulkWriteError } from '../../error'; +import { + type ClientBulkWriteError, + type ClientBulkWriteOptions, + type ClientBulkWriteResult, + type ClientDeleteResult, + type ClientInsertOneResult, + type ClientUpdateResult +} from './common'; + +/** + * Unacknowledged bulk writes are always the same. + */ +const UNACKNOWLEDGED = { + acknowledged: false, + insertedCount: 0, + upsertedCount: 0, + matchedCount: 0, + modifiedCount: 0, + deletedCount: 0, + insertResults: undefined, + updateResults: undefined, + deleteResults: undefined +}; + +interface ClientBulkWriteResultAccumulation { + /** + * Whether the bulk write was acknowledged. + */ + acknowledged: boolean; + /** + * The total number of documents inserted across all insert operations. + */ + insertedCount: number; + /** + * The total number of documents upserted across all update operations. + */ + upsertedCount: number; + /** + * The total number of documents matched across all update operations. + */ + matchedCount: number; + /** + * The total number of documents modified across all update operations. + */ + modifiedCount: number; + /** + * The total number of documents deleted across all delete operations. + */ + deletedCount: number; + /** + * The results of each individual insert operation that was successfully performed. + */ + insertResults?: Map; + /** + * The results of each individual update operation that was successfully performed. + */ + updateResults?: Map; + /** + * The results of each individual delete operation that was successfully performed. + */ + deleteResults?: Map; +} + +/** + * Merges client bulk write cursor responses together into a single result. + * @internal + */ +export class ClientBulkWriteResultsMerger { + private result: ClientBulkWriteResultAccumulation; + private options: ClientBulkWriteOptions; + private currentBatchOffset: number; + writeConcernErrors: Document[]; + writeErrors: Map; + + /** + * @returns The standard unacknowledged bulk write result. + */ + static unacknowledged(): ClientBulkWriteResult { + return UNACKNOWLEDGED; + } + + /** + * Instantiate the merger. + * @param options - The options. + */ + constructor(options: ClientBulkWriteOptions) { + this.options = options; + this.currentBatchOffset = 0; + this.writeConcernErrors = []; + this.writeErrors = new Map(); + this.result = { + acknowledged: true, + insertedCount: 0, + upsertedCount: 0, + matchedCount: 0, + modifiedCount: 0, + deletedCount: 0, + insertResults: undefined, + updateResults: undefined, + deleteResults: undefined + }; + + if (options.verboseResults) { + this.result.insertResults = new Map(); + this.result.updateResults = new Map(); + this.result.deleteResults = new Map(); + } + } + + /** + * Get the bulk write result object. + */ + get bulkWriteResult(): ClientBulkWriteResult { + return { + acknowledged: this.result.acknowledged, + insertedCount: this.result.insertedCount, + upsertedCount: this.result.upsertedCount, + matchedCount: this.result.matchedCount, + modifiedCount: this.result.modifiedCount, + deletedCount: this.result.deletedCount, + insertResults: this.result.insertResults, + updateResults: this.result.updateResults, + deleteResults: this.result.deleteResults + }; + } + + /** + * Merge the results in the cursor to the existing result. + * @param currentBatchOffset - The offset index to the original models. + * @param response - The cursor response. + * @param documents - The documents in the cursor. + * @returns The current result. + */ + async merge(cursor: ClientBulkWriteCursor): Promise { + let writeConcernErrorResult; + try { + for await (const document of cursor) { + // Only add to maps if ok: 1 + if (document.ok === 1) { + if (this.options.verboseResults) { + this.processDocument(cursor, document); + } + } else { + // If an individual write error is encountered during an ordered bulk write, drivers MUST + // record the error in writeErrors and immediately throw the exception. Otherwise, drivers + // MUST continue to iterate the results cursor and execute any further bulkWrite batches. + if (this.options.ordered) { + const error = new MongoClientBulkWriteError({ + message: 'Mongo client ordered bulk write encountered a write error.' + }); + error.writeErrors.set(document.idx + this.currentBatchOffset, { + code: document.code, + message: document.errmsg + }); + error.partialResult = this.result; + throw error; + } else { + this.writeErrors.set(document.idx + this.currentBatchOffset, { + code: document.code, + message: document.errmsg + }); + } + } + } + } catch (error) { + if (error instanceof MongoWriteConcernError) { + const result = error.result; + writeConcernErrorResult = { + insertedCount: result.nInserted, + upsertedCount: result.nUpserted, + matchedCount: result.nMatched, + modifiedCount: result.nModified, + deletedCount: result.nDeleted, + writeConcernError: result.writeConcernError + }; + if (this.options.verboseResults && result.cursor.firstBatch) { + for (const document of result.cursor.firstBatch) { + if (document.ok === 1) { + this.processDocument(cursor, document); + } + } + } + } else { + throw error; + } + } finally { + // Update the counts from the cursor response. + if (cursor.response) { + const response = cursor.response; + this.incrementCounts(response); + } + + // Increment the batch offset. + this.currentBatchOffset += cursor.operations.length; + } + + // If we have write concern errors ensure they are added. + if (writeConcernErrorResult) { + const writeConcernError = writeConcernErrorResult.writeConcernError as Document; + this.incrementCounts(writeConcernErrorResult); + this.writeConcernErrors.push({ + code: writeConcernError.code, + message: writeConcernError.errmsg + }); + } + + return this.result; + } + + /** + * Process an individual document in the results. + * @param cursor - The cursor. + * @param document - The document to process. + */ + private processDocument(cursor: ClientBulkWriteCursor, document: Document) { + // Get the corresponding operation from the command. + const operation = cursor.operations[document.idx]; + // Handle insert results. + if ('insert' in operation) { + this.result.insertResults?.set(document.idx + this.currentBatchOffset, { + insertedId: operation.document._id + }); + } + // Handle update results. + if ('update' in operation) { + const result: ClientUpdateResult = { + matchedCount: document.n, + modifiedCount: document.nModified ?? 0, + // Check if the bulk did actually upsert. + didUpsert: document.upserted != null + }; + if (document.upserted) { + result.upsertedId = document.upserted._id; + } + this.result.updateResults?.set(document.idx + this.currentBatchOffset, result); + } + // Handle delete results. + if ('delete' in operation) { + this.result.deleteResults?.set(document.idx + this.currentBatchOffset, { + deletedCount: document.n + }); + } + } + + /** + * Increment the result counts. + * @param document - The document with the results. + */ + private incrementCounts(document: Document) { + this.result.insertedCount += document.insertedCount; + this.result.upsertedCount += document.upsertedCount; + this.result.matchedCount += document.matchedCount; + this.result.modifiedCount += document.modifiedCount; + this.result.deletedCount += document.deletedCount; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/command.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/command.ts new file mode 100644 index 00000000..ebaba860 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/command.ts @@ -0,0 +1,166 @@ +import { type Connection } from '..'; +import type { BSONSerializeOptions, Document } from '../bson'; +import { MIN_SUPPORTED_RAW_DATA_WIRE_VERSION } from '../cmap/wire_protocol/constants'; +import { MongoInvalidArgumentError } from '../error'; +import { + decorateWithExplain, + Explain, + type ExplainOptions, + validateExplainTimeoutOptions +} from '../explain'; +import { ReadConcern } from '../read_concern'; +import type { ReadPreference } from '../read_preference'; +import type { ServerCommandOptions } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { type TimeoutContext } from '../timeout'; +import { commandSupportsReadConcern, maxWireVersion, MongoDBNamespace } from '../utils'; +import { WriteConcern, type WriteConcernOptions } from '../write_concern'; +import type { ReadConcernLike } from './../read_concern'; +import { AbstractOperation, Aspect, type OperationOptions } from './operation'; + +/** @public */ +export interface CollationOptions { + locale: string; + caseLevel?: boolean; + caseFirst?: string; + strength?: number; + numericOrdering?: boolean; + alternate?: string; + maxVariable?: string; + backwards?: boolean; + normalization?: boolean; +} + +/** @public */ +export interface CommandOperationOptions + extends OperationOptions, + WriteConcernOptions, + ExplainOptions { + /** Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** Collation */ + collation?: CollationOptions; + /** + * maxTimeMS is a server-side time limit in milliseconds for processing an operation. + */ + maxTimeMS?: number; + /** + * Comment to apply to the operation. + */ + comment?: unknown; + // Admin command overrides. + dbName?: string; + authdb?: string; + + /** + * Used when the command needs to grant access to the underlying namespaces for time series collections. + * Only available on server versions 8.2 and above and is not meant for public use. + * @internal + * @sinceServerVersion 8.2 + **/ + rawData?: boolean; +} + +/** @internal */ +export interface OperationParent { + s: { namespace: MongoDBNamespace }; + readConcern?: ReadConcern; + writeConcern?: WriteConcern; + readPreference?: ReadPreference; + bsonOptions?: BSONSerializeOptions; + timeoutMS?: number; +} + +/** @internal */ +export abstract class CommandOperation extends AbstractOperation { + override options: CommandOperationOptions; + readConcern?: ReadConcern; + writeConcern?: WriteConcern; + explain?: Explain; + + constructor(parent?: OperationParent, options?: CommandOperationOptions) { + super(options); + this.options = options ?? {}; + + // NOTE: this was explicitly added for the add/remove user operations, it's likely + // something we'd want to reconsider. Perhaps those commands can use `Admin` + // as a parent? + const dbNameOverride = options?.dbName || options?.authdb; + if (dbNameOverride) { + this.ns = new MongoDBNamespace(dbNameOverride, '$cmd'); + } else { + this.ns = parent + ? parent.s.namespace.withCollection('$cmd') + : new MongoDBNamespace('admin', '$cmd'); + } + + this.readConcern = ReadConcern.fromOptions(options); + this.writeConcern = WriteConcern.fromOptions(options); + + if (this.hasAspect(Aspect.EXPLAINABLE)) { + this.explain = Explain.fromOptions(options); + if (this.explain) validateExplainTimeoutOptions(this.options, this.explain); + } else if (options?.explain != null) { + throw new MongoInvalidArgumentError(`Option "explain" is not supported on this command`); + } + } + + override get canRetryWrite(): boolean { + if (this.hasAspect(Aspect.EXPLAINABLE)) { + return this.explain == null; + } + return super.canRetryWrite; + } + + abstract buildCommandDocument(connection: Connection, session?: ClientSession): Document; + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { + ...this.options, + ...this.bsonOptions, + timeoutContext, + readPreference: this.readPreference, + session: this.session + }; + } + + override buildCommand(connection: Connection, session?: ClientSession): Document { + const command = this.buildCommandDocument(connection, session); + + const inTransaction = this.session && this.session.inTransaction(); + + if (this.readConcern && commandSupportsReadConcern(command) && !inTransaction) { + Object.assign(command, { readConcern: this.readConcern }); + } + + if (this.writeConcern && this.hasAspect(Aspect.WRITE_OPERATION) && !inTransaction) { + WriteConcern.apply(command, this.writeConcern); + } + + if ( + this.options.collation && + typeof this.options.collation === 'object' && + !this.hasAspect(Aspect.SKIP_COLLATION) + ) { + Object.assign(command, { collation: this.options.collation }); + } + + if (typeof this.options.maxTimeMS === 'number') { + command.maxTimeMS = this.options.maxTimeMS; + } + + if ( + this.options.rawData != null && + this.hasAspect(Aspect.SUPPORTS_RAW_DATA) && + maxWireVersion(connection) >= MIN_SUPPORTED_RAW_DATA_WIRE_VERSION + ) { + command.rawData = this.options.rawData; + } + + if (this.hasAspect(Aspect.EXPLAINABLE) && this.explain) { + return decorateWithExplain(command, this.explain); + } + + return command; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/count.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/count.ts new file mode 100644 index 00000000..500588e1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/count.ts @@ -0,0 +1,73 @@ +import { type Connection } from '..'; +import type { Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { ClientSession } from '../sessions'; +import type { MongoDBNamespace } from '../utils'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface CountOptions extends CommandOperationOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amounts to count before aborting. */ + limit?: number; + /** + * Number of milliseconds to wait before aborting the query. + */ + maxTimeMS?: number; + /** An index name hint for the query. */ + hint?: string | Document; +} + +/** @internal */ +export class CountOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: CountOptions; + collectionName?: string; + query: Document; + + constructor(namespace: MongoDBNamespace, filter: Document, options: CountOptions) { + super({ s: { namespace: namespace } }, options); + + this.options = options; + this.collectionName = namespace.collection; + this.query = filter; + } + + override get commandName() { + return 'count' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const options = this.options; + const cmd: Document = { + count: this.collectionName, + query: this.query + }; + + if (typeof options.limit === 'number') { + cmd.limit = options.limit; + } + + if (typeof options.skip === 'number') { + cmd.skip = options.skip; + } + + if (options.hint != null) { + cmd.hint = options.hint; + } + + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + + return cmd; + } + + override handleOk(response: InstanceType): number { + return response.getNumber('n') ?? 0; + } +} + +defineAspects(CountOperation, [Aspect.READ_OPERATION, Aspect.RETRYABLE, Aspect.SUPPORTS_RAW_DATA]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/create_collection.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/create_collection.ts new file mode 100644 index 00000000..15733c91 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/create_collection.ts @@ -0,0 +1,218 @@ +import { type Connection } from '..'; +import type { Document } from '../bson'; +import { + MIN_SUPPORTED_QE_SERVER_VERSION, + MIN_SUPPORTED_QE_WIRE_VERSION +} from '../cmap/wire_protocol/constants'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { Collection } from '../collection'; +import type { Db } from '../db'; +import { MongoCompatibilityError } from '../error'; +import type { PkFactory } from '../mongo_client'; +import type { ClientSession } from '../sessions'; +import { TimeoutContext } from '../timeout'; +import { maxWireVersion } from '../utils'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { executeOperation } from './execute_operation'; +import { CreateIndexesOperation } from './indexes'; +import { Aspect, defineAspects } from './operation'; + +const ILLEGAL_COMMAND_FIELDS = new Set([ + 'w', + 'wtimeout', + 'timeoutMS', + 'j', + 'fsync', + 'pkFactory', + 'raw', + 'readPreference', + 'session', + 'readConcern', + 'writeConcern', + 'raw', + 'fieldsAsRaw', + 'useBigInt64', + 'promoteLongs', + 'promoteValues', + 'promoteBuffers', + 'bsonRegExp', + 'serializeFunctions', + 'ignoreUndefined', + 'enableUtf8Validation' +]); + +/** @public + * Configuration options for timeseries collections + * @see https://www.mongodb.com/docs/manual/core/timeseries-collections/ + */ +export interface TimeSeriesCollectionOptions extends Document { + timeField: string; + metaField?: string; + granularity?: 'seconds' | 'minutes' | 'hours' | string; + bucketMaxSpanSeconds?: number; + bucketRoundingSeconds?: number; +} + +/** @public + * Configuration options for clustered collections + * @see https://www.mongodb.com/docs/manual/core/clustered-collections/ + */ +export interface ClusteredCollectionOptions extends Document { + name?: string; + key: Document; + unique: boolean; +} + +/** @public */ +export interface CreateCollectionOptions extends Omit { + /** Create a capped collection */ + capped?: boolean; + /** The size of the capped collection in bytes */ + size?: number; + /** The maximum number of documents in the capped collection */ + max?: number; + /** Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag */ + flags?: number; + /** Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection */ + storageEngine?: Document; + /** Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation */ + validator?: Document; + /** Determines how strictly MongoDB applies the validation rules to existing documents during an update */ + validationLevel?: string; + /** Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted */ + validationAction?: string; + /** Allows users to specify a default configuration for indexes when creating a collection */ + indexOptionDefaults?: Document; + /** The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view (i.e., does not include the database name and implies the same database as the view to create) */ + viewOn?: string; + /** An array that consists of the aggregation pipeline stage. Creates the view by applying the specified pipeline to the viewOn collection or view */ + pipeline?: Document[]; + /** A primary key factory function for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** A document specifying configuration options for timeseries collections. */ + timeseries?: TimeSeriesCollectionOptions; + /** A document specifying configuration options for clustered collections. For MongoDB 5.3 and above. */ + clusteredIndex?: ClusteredCollectionOptions; + /** The number of seconds after which a document in a timeseries or clustered collection expires. */ + expireAfterSeconds?: number; + /** @experimental */ + encryptedFields?: Document; + /** + * If set, enables pre-update and post-update document events to be included for any + * change streams that listen on this collection. + */ + changeStreamPreAndPostImages?: { enabled: boolean }; +} + +/* @internal */ +const INVALID_QE_VERSION = + 'Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption.'; + +/** @internal */ +export class CreateCollectionOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: CreateCollectionOptions; + db: Db; + name: string; + + constructor(db: Db, name: string, options: CreateCollectionOptions = {}) { + super(db, options); + + this.options = options; + this.db = db; + this.name = name; + } + + override get commandName() { + return 'create' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const isOptionValid = ([k, v]: [k: string, v: unknown]) => + v != null && typeof v !== 'function' && !ILLEGAL_COMMAND_FIELDS.has(k); + return { + create: this.name, + ...Object.fromEntries(Object.entries(this.options).filter(isOptionValid)) + }; + } + + override handleOk( + _response: InstanceType + ): Collection { + return new Collection(this.db, this.name, this.options); + } +} + +export async function createCollections( + db: Db, + name: string, + options: CreateCollectionOptions +): Promise> { + const timeoutContext = TimeoutContext.create({ + session: options.session, + serverSelectionTimeoutMS: db.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: db.client.s.options.waitQueueTimeoutMS, + timeoutMS: options.timeoutMS + }); + + const encryptedFields: Document | undefined = + options.encryptedFields ?? + db.client.s.options.autoEncryption?.encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + + if (encryptedFields) { + class CreateSupportingFLEv2CollectionOperation extends CreateCollectionOperation { + override buildCommandDocument(connection: Connection, session?: ClientSession): Document { + if ( + !connection.description.loadBalanced && + maxWireVersion(connection) < MIN_SUPPORTED_QE_WIRE_VERSION + ) { + throw new MongoCompatibilityError( + `${INVALID_QE_VERSION} The minimum server version required is ${MIN_SUPPORTED_QE_SERVER_VERSION}` + ); + } + + return super.buildCommandDocument(connection, session); + } + } + + // Create auxilliary collections for queryable encryption support. + const escCollection = encryptedFields.escCollection ?? `enxcol_.${name}.esc`; + const ecocCollection = encryptedFields.ecocCollection ?? `enxcol_.${name}.ecoc`; + + for (const collectionName of [escCollection, ecocCollection]) { + const createOp = new CreateSupportingFLEv2CollectionOperation(db, collectionName, { + clusteredIndex: { + key: { _id: 1 }, + unique: true + }, + session: options.session + }); + await executeOperation(db.client, createOp, timeoutContext); + } + + if (!options.encryptedFields) { + options = { ...options, encryptedFields }; + } + } + + const coll = await executeOperation( + db.client, + new CreateCollectionOperation(db, name, options), + timeoutContext + ); + + if (encryptedFields) { + // Create the required index for queryable encryption support. + const createIndexOp = CreateIndexesOperation.fromIndexSpecification( + db, + name, + { __safeContent__: 1 }, + { session: options.session } + ); + await executeOperation(db.client, createIndexOp, timeoutContext); + } + + return coll as unknown as Collection; +} + +defineAspects(CreateCollectionOperation, [Aspect.WRITE_OPERATION]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/delete.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/delete.ts new file mode 100644 index 00000000..78a71291 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/delete.ts @@ -0,0 +1,185 @@ +import type { Document } from '../bson'; +import { makeDocumentSequence } from '../cmap/commands'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { MongoServerError } from '../error'; +import type { ClientSession } from '../sessions'; +import { type MongoDBCollectionNamespace, type MongoDBNamespace } from '../utils'; +import { type WriteConcernOptions } from '../write_concern'; +import { type CollationOptions, CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects, type Hint } from './operation'; + +/** @public */ +export interface DeleteOptions extends CommandOperationOptions, WriteConcernOptions { + /** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */ + ordered?: boolean; + /** Specifies the collation to use for the operation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export interface DeleteResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined. */ + acknowledged: boolean; + /** The number of documents that were deleted */ + deletedCount: number; +} + +/** @public */ +export interface DeleteStatement { + /** The query that matches documents to delete. */ + q: Document; + /** The number of matching documents to delete. */ + limit: number; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; +} + +/** @internal */ +export class DeleteOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: DeleteOptions; + statements: DeleteStatement[]; + /** @internal */ + serializedOperations?: Uint8Array[]; + + constructor( + ns: MongoDBNamespace, + statements: DeleteStatement[], + options: DeleteOptions, + serializedOperations?: Uint8Array[] + ) { + super(undefined, options); + this.options = options; + this.ns = ns; + this.statements = statements; + this.serializedOperations = serializedOperations; + } + + override get commandName() { + return 'delete' as const; + } + + override get canRetryWrite(): boolean { + if (super.canRetryWrite === false) { + return false; + } + + return this.statements.every(op => (op.limit != null ? op.limit > 0 : true)); + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const options = this.options; + + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command: Document = { + delete: this.ns.collection, + deletes: this.serializedOperations + ? makeDocumentSequence('deletes', this.statements, this.serializedOperations) + : this.statements, + ordered + }; + + if (options.let) { + command.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + return command; + } +} + +export class DeleteOneOperation extends DeleteOperation { + constructor(ns: MongoDBCollectionNamespace, filter: Document, options: DeleteOptions) { + super(ns, [makeDeleteStatement(filter, { ...options, limit: 1 })], options); + } + + override handleOk( + response: InstanceType + ): DeleteResult { + const res = super.handleOk(response); + + // @ts-expect-error Explain commands have broken TS + if (this.explain) return res; + + if (res.code) throw new MongoServerError(res); + if (res.writeErrors) throw new MongoServerError(res.writeErrors[0]); + + return { + acknowledged: this.writeConcern?.w !== 0, + deletedCount: res.n + }; + } +} +export class DeleteManyOperation extends DeleteOperation { + constructor(ns: MongoDBCollectionNamespace, filter: Document, options: DeleteOptions) { + super(ns, [makeDeleteStatement(filter, options)], options); + } + + override handleOk( + response: InstanceType + ): DeleteResult { + const res = super.handleOk(response); + + // @ts-expect-error Explain commands have broken TS + if (this.explain) return res; + + if (res.code) throw new MongoServerError(res); + if (res.writeErrors) throw new MongoServerError(res.writeErrors[0]); + + return { + acknowledged: this.writeConcern?.w !== 0, + deletedCount: res.n + }; + } +} + +export function makeDeleteStatement( + filter: Document, + options: DeleteOptions & { limit?: number } +): DeleteStatement { + const op: DeleteStatement = { + q: filter, + limit: typeof options.limit === 'number' ? options.limit : 0 + }; + + if (options.collation) { + op.collation = options.collation; + } + + if (options.hint) { + op.hint = options.hint; + } + + return op; +} + +defineAspects(DeleteOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.SUPPORTS_RAW_DATA +]); +defineAspects(DeleteOneOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION, + Aspect.SUPPORTS_RAW_DATA +]); +defineAspects(DeleteManyOperation, [ + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/distinct.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/distinct.ts new file mode 100644 index 00000000..1ed3f80d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/distinct.ts @@ -0,0 +1,92 @@ +import { type Document } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Collection } from '../collection'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export type DistinctOptions = CommandOperationOptions & { + /** + * @sinceServerVersion 7.1 + * + * The index to use. Specify either the index name as a string or the index key pattern. + * If specified, then the query system will only consider plans using the hinted index. + * + * If provided as a string, `hint` must be index name for an index on the collection. + * If provided as an object, `hint` must be an index description for an index defined on the collection. + * + * See https://www.mongodb.com/docs/manual/reference/command/distinct/#command-fields. + */ + hint?: Document | string; +}; + +/** + * Return a list of distinct values for the given key across a collection. + * @internal + */ +export class DistinctOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: DistinctOptions; + collection: Collection; + /** Field of the document to find distinct values for. */ + key: string; + /** The query for filtering the set of documents to which we apply the distinct filter. */ + query: Document; + + /** + * Construct a Distinct operation. + * + * @param collection - Collection instance. + * @param key - Field of the document to find distinct values for. + * @param query - The query for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings. See Collection.prototype.distinct for a list of options. + */ + constructor(collection: Collection, key: string, query: Document, options?: DistinctOptions) { + super(collection, options); + + this.options = options ?? {}; + this.collection = collection; + this.key = key; + this.query = query; + } + + override get commandName() { + return 'distinct' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + const command: Document = { + distinct: this.collection.collectionName, + key: this.key, + query: this.query + }; + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + + if (this.options.hint != null) { + command.hint = this.options.hint; + } + + return command; + } + + override handleOk( + response: InstanceType + ): any[] | Document { + if (this.explain) { + return response.toObject(this.bsonOptions); + } + return response.toObject(this.bsonOptions).values; + } +} + +defineAspects(DistinctOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.EXPLAINABLE, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/drop.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/drop.ts new file mode 100644 index 00000000..5733b6b9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/drop.ts @@ -0,0 +1,130 @@ +import { type Connection, type MongoError, MongoServerError } from '..'; +import type { Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { CursorTimeoutContext } from '../cursor/abstract_cursor'; +import type { Db } from '../db'; +import { MONGODB_ERROR_CODES } from '../error'; +import type { ClientSession } from '../sessions'; +import { TimeoutContext } from '../timeout'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { executeOperation } from './execute_operation'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface DropCollectionOptions extends Omit { + /** @experimental */ + encryptedFields?: Document; +} + +/** @internal */ +export class DropCollectionOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + + override options: DropCollectionOptions; + name: string; + + constructor(db: Db, name: string, options: DropCollectionOptions = {}) { + super(db, options); + this.options = options; + this.name = name; + } + + override get commandName() { + return 'drop' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + return { drop: this.name }; + } + + override handleOk(_response: InstanceType): boolean { + return true; + } + + override handleError(error: MongoError): boolean { + if (!(error instanceof MongoServerError)) throw error; + if (Number(error.code) !== MONGODB_ERROR_CODES.NamespaceNotFound) throw error; + + return false; + } +} + +export async function dropCollections( + db: Db, + name: string, + options: DropCollectionOptions +): Promise { + const timeoutContext = TimeoutContext.create({ + session: options.session, + serverSelectionTimeoutMS: db.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: db.client.s.options.waitQueueTimeoutMS, + timeoutMS: options.timeoutMS + }); + + const encryptedFieldsMap = db.client.s.options.autoEncryption?.encryptedFieldsMap; + let encryptedFields: Document | undefined = + options.encryptedFields ?? encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + + if (!encryptedFields && encryptedFieldsMap) { + // If the MongoClient was configured with an encryptedFieldsMap, + // and no encryptedFields config was available in it or explicitly + // passed as an argument, the spec tells us to look one up using + // listCollections(). + const listCollectionsResult = await db + .listCollections( + { name }, + { + nameOnly: false, + session: options.session, + timeoutContext: new CursorTimeoutContext(timeoutContext, Symbol()) + } + ) + .toArray(); + encryptedFields = listCollectionsResult?.[0]?.options?.encryptedFields; + } + + if (encryptedFields) { + const escCollection = encryptedFields.escCollection || `enxcol_.${name}.esc`; + const ecocCollection = encryptedFields.ecocCollection || `enxcol_.${name}.ecoc`; + + for (const collectionName of [escCollection, ecocCollection]) { + // Drop auxilliary collections, ignoring potential NamespaceNotFound errors. + const dropOp = new DropCollectionOperation(db, collectionName, options); + await executeOperation(db.client, dropOp, timeoutContext); + } + } + + return await executeOperation( + db.client, + new DropCollectionOperation(db, name, options), + timeoutContext + ); +} + +/** @public */ +export type DropDatabaseOptions = CommandOperationOptions; + +/** @internal */ +export class DropDatabaseOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: DropDatabaseOptions; + + constructor(db: Db, options: DropDatabaseOptions) { + super(db, options); + this.options = options; + } + override get commandName() { + return 'dropDatabase' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + return { dropDatabase: 1 }; + } + + override handleOk(_response: InstanceType): boolean { + return true; + } +} + +defineAspects(DropCollectionOperation, [Aspect.WRITE_OPERATION]); +defineAspects(DropDatabaseOperation, [Aspect.WRITE_OPERATION]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/end_sessions.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/end_sessions.ts new file mode 100644 index 00000000..564dd596 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/end_sessions.ts @@ -0,0 +1,44 @@ +import { + type ClientSession, + type Connection, + type ServerCommandOptions, + type ServerSessionId, + type TimeoutContext, + type WriteConcern +} from '..'; +import { type Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { CommandOperation } from '../operations/command'; +import { ReadPreference } from '../read_preference'; +import { MongoDBNamespace } from '../utils'; +import { Aspect, defineAspects } from './operation'; + +export class EndSessionsOperation extends CommandOperation { + override writeConcern: WriteConcern = { w: 0 }; + override ns = MongoDBNamespace.fromString('admin.$cmd'); + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + + private sessions: Array; + + constructor(sessions: Array) { + super(); + this.sessions = sessions; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + return { + endSessions: this.sessions + }; + } + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { + timeoutContext, + readPreference: ReadPreference.primaryPreferred + }; + } + override get commandName(): string { + return 'endSessions'; + } +} + +defineAspects(EndSessionsOperation, Aspect.WRITE_OPERATION); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/estimated_document_count.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/estimated_document_count.ts new file mode 100644 index 00000000..2541b69b --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/estimated_document_count.ts @@ -0,0 +1,61 @@ +import { type Connection } from '..'; +import type { Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Collection } from '../collection'; +import type { ClientSession } from '../sessions'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface EstimatedDocumentCountOptions extends CommandOperationOptions { + /** + * The maximum amount of time to allow the operation to run. + * + * This option is sent only if the caller explicitly provides a value. The default is to not send a value. + */ + maxTimeMS?: number; +} + +/** @internal */ +export class EstimatedDocumentCountOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: EstimatedDocumentCountOptions; + collectionName: string; + + constructor(collection: Collection, options: EstimatedDocumentCountOptions = {}) { + super(collection, options); + this.options = options; + this.collectionName = collection.collectionName; + } + + override get commandName() { + return 'count' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const cmd: Document = { count: this.collectionName }; + + if (typeof this.options.maxTimeMS === 'number') { + cmd.maxTimeMS = this.options.maxTimeMS; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + cmd.comment = this.options.comment; + } + + return cmd; + } + + override handleOk(response: InstanceType): number { + return response.getNumber('n') ?? 0; + } +} + +defineAspects(EstimatedDocumentCountOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.CURSOR_CREATING, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/execute_operation.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/execute_operation.ts new file mode 100644 index 00000000..f3a23b3d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/execute_operation.ts @@ -0,0 +1,447 @@ +import { setTimeout } from 'timers/promises'; + +import { MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION } from '../cmap/wire_protocol/constants'; +import { + isRetryableReadError, + isRetryableWriteError, + MongoCompatibilityError, + MONGODB_ERROR_CODES, + MongoError, + MongoErrorLabel, + MongoExpiredSessionError, + MongoInvalidArgumentError, + MongoNetworkError, + MongoNotConnectedError, + MongoRuntimeError, + MongoServerError, + MongoTransactionError, + MongoUnexpectedServerResponseError +} from '../error'; +import type { MongoClient } from '../mongo_client'; +import { ReadPreference } from '../read_preference'; +import { TopologyType } from '../sdam/common'; +import { + DeprioritizedServers, + sameServerSelector, + secondaryWritableServerSelector, + type ServerSelector +} from '../sdam/server_selection'; +import type { Topology } from '../sdam/topology'; +import type { ClientSession } from '../sessions'; +import { TimeoutContext } from '../timeout'; +import { abortable, maxWireVersion, supportsRetryableWrites } from '../utils'; +import { AggregateOperation } from './aggregate'; +import { AbstractOperation, Aspect } from './operation'; +import { RunCommandOperation } from './run_command'; + +const MMAPv1_RETRY_WRITES_ERROR_CODE = MONGODB_ERROR_CODES.IllegalOperation; +const MMAPv1_RETRY_WRITES_ERROR_MESSAGE = + 'This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.'; + +type ResultTypeFromOperation = ReturnType< + TOperation['handleOk'] +>; + +/** + * Executes the given operation with provided arguments. + * @internal + * + * @remarks + * Allows for a single point of entry to provide features such as implicit sessions, which + * are required by the Driver Sessions specification in the event that a ClientSession is + * not provided. + * + * The expectation is that this function: + * - Connects the MongoClient if it has not already been connected, see {@link autoConnect} + * - Creates a session if none is provided and cleans up the session it creates + * - Tries an operation and retries under certain conditions, see {@link executeOperationWithRetries} + * + * @typeParam T - The operation's type + * @typeParam TResult - The type of the operation's result, calculated from T + * + * @param client - The MongoClient to execute this operation with + * @param operation - The operation to execute + */ +export async function executeOperation< + T extends AbstractOperation, + TResult = ResultTypeFromOperation +>(client: MongoClient, operation: T, timeoutContext?: TimeoutContext | null): Promise { + if (!(operation instanceof AbstractOperation)) { + // TODO(NODE-3483): Extend MongoRuntimeError + throw new MongoRuntimeError('This method requires a valid operation instance'); + } + + const topology = + client.topology == null + ? await abortable(autoConnect(client), operation.options) + : client.topology; + + // The driver sessions spec mandates that we implicitly create sessions for operations + // that are not explicitly provided with a session. + let session = operation.session; + let owner: symbol | undefined; + + if (session == null) { + owner = Symbol(); + session = client.startSession({ owner, explicit: false }); + } else if (session.hasEnded) { + throw new MongoExpiredSessionError('Use of expired sessions is not permitted'); + } else if ( + session.snapshotEnabled && + maxWireVersion(topology) < MIN_SUPPORTED_SNAPSHOT_READS_WIRE_VERSION + ) { + throw new MongoCompatibilityError('Snapshot reads require MongoDB 5.0 or later'); + } else if (session.client !== client) { + throw new MongoInvalidArgumentError('ClientSession must be from the same MongoClient'); + } + + operation.session ??= session; + + const readPreference = operation.readPreference ?? ReadPreference.primary; + const inTransaction = !!session?.inTransaction(); + + const hasReadAspect = operation.hasAspect(Aspect.READ_OPERATION); + + if ( + inTransaction && + !readPreference.equals(ReadPreference.primary) && + (hasReadAspect || operation.commandName === 'runCommand') + ) { + throw new MongoTransactionError( + `Read preference in a transaction must be primary, not: ${readPreference.mode}` + ); + } + + if (session?.isPinned && session.transaction.isCommitted && !operation.bypassPinningCheck) { + session.unpin(); + } + + timeoutContext ??= TimeoutContext.create({ + session, + serverSelectionTimeoutMS: client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: client.s.options.waitQueueTimeoutMS, + timeoutMS: operation.options.timeoutMS + }); + + try { + return await executeOperationWithRetries(operation, { + topology, + timeoutContext, + session, + readPreference + }); + } finally { + if (session?.owner != null && session.owner === owner) { + await session.endSession(); + } + } +} + +/** + * Connects a client if it has not yet been connected + * @internal + */ +export async function autoConnect(client: MongoClient): Promise { + if (client.topology == null) { + if (client.s.hasBeenClosed) { + throw new MongoNotConnectedError('Client must be connected before running operations'); + } + client.s.options.__skipPingOnConnect = true; + try { + await client.connect(); + if (client.topology == null) { + throw new MongoRuntimeError( + 'client.connect did not create a topology but also did not throw' + ); + } + return client.topology; + } finally { + delete client.s.options.__skipPingOnConnect; + } + } + return client.topology; +} + +/** @internal */ +type RetryOptions = { + session: ClientSession | undefined; + readPreference: ReadPreference; + topology: Topology; + timeoutContext: TimeoutContext; +}; +/** @internal The base backoff duration in milliseconds */ +export const BASE_BACKOFF_MS = 100; +/** @internal The maximum backoff duration in milliseconds */ +const MAX_BACKOFF_MS = 10_000; + +/** + * @internal + * The server-supplied base backoff duration in milliseconds, if the error carries a usable one. + * + * The server may attach `baseBackoffMS` to an overload error to indicate how long clients should + * back off in place of the driver's default. Only a positive value is honoured: the server disables + * the behaviour by reporting `0`, in which case we fall back to `BASE_BACKOFF_MS`. + */ +export function calculateBaseBackoffMS(error: MongoError): number { + if (!(error instanceof MongoServerError)) return BASE_BACKOFF_MS; + + // The server sends baseBackoffMS as an int64, so its runtime type depends on the client's BSON + // options: a number by default, a Long under `promoteLongs: false`, a bigint under + // `useBigInt64: true`. `Number()` handles all three, so coerce rather than check for `number`. + // `errorResponse` is indexed as `any`; narrow to `unknown` so the checks below are real. + const raw: unknown = error.errorResponse.baseBackoffMS; + const isNumeric = typeof raw === 'number' || typeof raw === 'bigint' || typeof raw === 'object'; + const baseBackoffMS = isNumeric ? Number(raw) : NaN; + const useServerValue = Number.isFinite(baseBackoffMS) && baseBackoffMS > 0; + const result = useServerValue ? baseBackoffMS : BASE_BACKOFF_MS; + return result; +} + +/** + * Executes an operation and retries as appropriate + * @internal + * + * @remarks + * Implements behaviour described in [Retryable Reads](https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.md) and [Retryable + * Writes](https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.md) specification + * + * This function: + * - performs initial server selection + * - attempts to execute an operation + * - retries the operation if it meets the criteria for a retryable read or a retryable write + * + * @typeParam T - The operation's type + * @typeParam TResult - The type of the operation's result, calculated from T + * + * @param operation - The operation to execute + */ +async function executeOperationWithRetries< + T extends AbstractOperation, + TResult = ResultTypeFromOperation +>( + operation: T, + { topology, timeoutContext, session, readPreference }: RetryOptions +): Promise { + let selector: ReadPreference | ServerSelector; + + if (operation.hasAspect(Aspect.MUST_SELECT_SAME_SERVER)) { + // GetMore and KillCursor operations must always select the same server, but run through + // server selection to potentially force monitor checks if the server is + // in an unknown state. + selector = sameServerSelector(operation.server?.description); + } else if (operation instanceof AggregateOperation && operation.hasWriteStage) { + // If operation should try to write to secondary use the custom server selector + // otherwise provide the read preference. + selector = secondaryWritableServerSelector(topology.commonWireVersion, readPreference); + } else { + selector = readPreference; + } + + let server = await topology.selectServer(selector, { + session, + operationName: operation.commandName, + timeoutContext, + signal: operation.options.signal, + deprioritizedServers: new DeprioritizedServers() + }); + + const hasReadAspect = operation.hasAspect(Aspect.READ_OPERATION); + const hasWriteAspect = operation.hasAspect(Aspect.WRITE_OPERATION); + const inTransaction = session?.inTransaction() ?? false; + + const willRetryRead = topology.s.options.retryReads && !inTransaction && operation.canRetryRead; + + const willRetryWrite = + topology.s.options.retryWrites && + !inTransaction && + supportsRetryableWrites(server) && + operation.canRetryWrite; + + const willRetry = + operation.hasAspect(Aspect.RETRYABLE) && + session != null && + ((hasReadAspect && willRetryRead) || (hasWriteAspect && willRetryWrite)); + + if (hasWriteAspect && willRetryWrite && session != null) { + operation.options.willRetryWrite = true; + session.incrementTransactionNumber(); + } + + const deprioritizedServers = new DeprioritizedServers(); + + let maxAttempts = + typeof operation.maxAttempts === 'number' + ? operation.maxAttempts + : willRetry + ? timeoutContext.csotEnabled() + ? Infinity + : 2 + : 1; + + let error: MongoError | null = null; + + for (let attempt = 0; attempt < maxAttempts; attempt++) { + operation.attemptsMade = attempt + 1; + operation.server = server; + + try { + try { + const result = await server.command(operation, timeoutContext); + return operation.handleOk(result); + } catch (error) { + return operation.handleError(error); + } + } catch (operationError) { + // Should never happen but if it does - propagate the error. + if (!(operationError instanceof MongoError)) throw operationError; + + // Preserve the original error once a write has been performed. + // Only update to the latest error if no writes were performed. + if (error == null) { + error = operationError; + } else { + if (!operationError.hasErrorLabel(MongoErrorLabel.NoWritesPerformed)) { + error = operationError; + } + } + + // Reset timeouts + timeoutContext.clear(); + + if (hasWriteAspect && operationError.code === MMAPv1_RETRY_WRITES_ERROR_CODE) { + throw new MongoServerError({ + message: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + errmsg: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + originalError: operationError + }); + } + + if (!canRetry(operation, operationError)) { + throw error; + } + + if (operationError.hasErrorLabel(MongoErrorLabel.SystemOverloadedError)) { + const maxOverloadAttempts = topology.s.options.maxAdaptiveRetries + 1; + maxAttempts = Math.min(maxOverloadAttempts, operation.maxAttempts ?? maxOverloadAttempts); + } + + if (attempt + 1 >= maxAttempts) { + throw error; + } + + if ( + operationError instanceof MongoNetworkError && + operation.hasAspect(Aspect.CURSOR_CREATING) && + session != null && + session.isPinned && + !session.inTransaction() + ) { + session.unpin({ force: true, forceClear: true }); + } + + if ( + operationError.hasErrorLabel(MongoErrorLabel.SystemOverloadedError) && + operation.hasAspect(Aspect.CURSOR_CREATING) && + session != null && + session.isPinned && + !session.inTransaction() + ) { + session.unpin({ force: true }); + } + + if (operationError.hasErrorLabel(MongoErrorLabel.SystemOverloadedError)) { + const baseBackoffMS = calculateBaseBackoffMS(operationError); + // The spec numbers the first retry as attempt 1, while `attempt` here is the zero-based + // index of the attempt that just failed -- hence the `+ 1`. + const backoffMS = + Math.random() * Math.min(MAX_BACKOFF_MS, baseBackoffMS * 2 ** (attempt + 1)); + + // if the backoff would exhaust the CSOT timeout, short-circuit. + if (timeoutContext.csotEnabled() && backoffMS > timeoutContext.remainingTimeMS) { + throw error; + } + + await setTimeout(backoffMS); + } + + if ( + topology.description.type === TopologyType.Sharded || + (operationError.hasErrorLabel(MongoErrorLabel.SystemOverloadedError) && + topology.s.options.enableOverloadRetargeting) + ) { + deprioritizedServers.add(server.description); + } + + server = await topology.selectServer(selector, { + session, + operationName: operation.commandName, + deprioritizedServers, + signal: operation.options.signal + }); + + if ( + hasWriteAspect && + !supportsRetryableWrites(server) && + !operationError.hasErrorLabel(MongoErrorLabel.SystemOverloadedError) + ) { + throw new MongoUnexpectedServerResponseError( + 'Selected server does not support retryable writes' + ); + } + + // Batched operations must reset the batch before retry, + // otherwise building a command will build the _next_ batch, not the current batch. + if (operation.hasAspect(Aspect.COMMAND_BATCHING)) { + operation.resetBatch(); + } + } + } + + throw ( + error ?? + new MongoRuntimeError( + 'Should never happen: operation execution loop terminated but no error was recorded.' + ) + ); + + function canRetry(operation: AbstractOperation, error: MongoError) { + // SystemOverloadedError is retryable, but must respect retryReads/retryWrites settings + // Check topology options directly (not operation.canRetryRead/Write) because backpressure + // expands retry support beyond traditional retryable reads/writes + // NOTE: Unlike traditional retries, backpressure retries ARE allowed inside transactions + if ( + error.hasErrorLabel(MongoErrorLabel.SystemOverloadedError) && + error.hasErrorLabel(MongoErrorLabel.RetryableError) + ) { + // runCommand requires BOTH retryReads and retryWrites to be enabled (per spec step 2.4) + if (operation instanceof RunCommandOperation) { + return topology.s.options.retryReads && topology.s.options.retryWrites; + } + + // Write-stage aggregates ($out/$merge) require retryWrites + if (operation instanceof AggregateOperation && operation.hasWriteStage) { + return topology.s.options.retryWrites; + } + + // For other operations, check if retries are enabled based on operation type + const canRetryAsRead = hasReadAspect && topology.s.options.retryReads; + const canRetryAsWrite = hasWriteAspect && topology.s.options.retryWrites; + return canRetryAsRead || canRetryAsWrite; + } + + // run command is only retryable if we get retryable overload errors + if (operation instanceof RunCommandOperation) { + return false; + } + + // batch operations are only retryable if the batch is retryable + if (operation.hasAspect(Aspect.COMMAND_BATCHING)) { + return operation.canRetryWrite && isRetryableWriteError(error); + } + + return ( + (hasWriteAspect && willRetryWrite && isRetryableWriteError(error)) || + (hasReadAspect && willRetryRead && isRetryableReadError(error)) + ); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find.ts new file mode 100644 index 00000000..6c9f8daf --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find.ts @@ -0,0 +1,254 @@ +import type { Document } from '../bson'; +import { CursorResponse, ExplainedCursorResponse } from '../cmap/wire_protocol/responses'; +import { type AbstractCursorOptions, type CursorTimeoutMode } from '../cursor/abstract_cursor'; +import { MongoInvalidArgumentError } from '../error'; +import { type ExplainOptions } from '../explain'; +import type { ServerCommandOptions } from '../sdam/server'; +import { formatSort, type Sort } from '../sort'; +import { type TimeoutContext } from '../timeout'; +import { type MongoDBNamespace, normalizeHintField } from '../utils'; +import { type CollationOptions, CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects, type Hint } from './operation'; + +/** + * @public + */ +export interface FindOptions + extends Omit, + AbstractCursorOptions { + /** Sets the limit of documents returned in the query. */ + limit?: number; + /** Set to sort the documents coming back from the query. Array of indexes, `[['a', 1]]` etc. */ + sort?: Sort; + /** The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` **or** `{'a': 0, 'b': 0}` */ + projection?: Document; + /** Set to skip N documents ahead in your query (useful for pagination). */ + skip?: number; + /** Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}` */ + hint?: Hint; + /** Specify if the cursor can timeout. */ + timeout?: boolean; + /** Specify if the cursor is tailable. */ + tailable?: boolean; + /** Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true */ + awaitData?: boolean; + /** Set the batchSize for the getMoreCommand when iterating over the query results. */ + batchSize?: number; + /** If true, returns only the index keys in the resulting documents. */ + returnKey?: boolean; + /** The inclusive lower bound for a specific index */ + min?: Document; + /** The exclusive upper bound for a specific index */ + max?: Document; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true */ + maxAwaitTimeMS?: number; + /** The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that. */ + noCursorTimeout?: boolean; + /** Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). */ + collation?: CollationOptions; + /** Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) */ + allowDiskUse?: boolean; + /** Determines whether to close the cursor after the first batch. Defaults to false. */ + singleBatch?: boolean; + /** For queries against a sharded collection, allows the command (or subsequent getMore commands) to return partial results, rather than an error, if one or more queried shards are unavailable. */ + allowPartialResults?: boolean; + /** Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents. */ + showRecordId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Option to enable an optimized code path for queries looking for a particular range of `ts` values in the oplog. Requires `tailable` to be true. + * @deprecated Starting from MongoDB 4.4 this flag is not needed and will be ignored. + */ + oplogReplay?: boolean; + + /** + * Specifies the verbosity mode for the explain output. + * @deprecated This API is deprecated in favor of `collection.find().explain()`. + */ + explain?: ExplainOptions['explain']; + /** @internal*/ + timeoutMode?: CursorTimeoutMode; +} + +/** @public */ +export type FindOneOptions = Omit; + +/** @internal */ +export class FindOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = CursorResponse; + + /** + * @remarks WriteConcern can still be present on the options because + * we inherit options from the client/db/collection. The + * key must be present on the options in order to delete it. + * This allows typescript to delete the key but will + * not allow a writeConcern to be assigned as a property on options. + */ + override options: FindOptions & { writeConcern?: never }; + filter: Document; + + constructor(ns: MongoDBNamespace, filter: Document = {}, options: FindOptions = {}) { + super(undefined, options); + + this.options = { ...options }; + delete this.options.writeConcern; + this.ns = ns; + + if (typeof filter !== 'object' || Array.isArray(filter)) { + throw new MongoInvalidArgumentError('Query filter must be a plain object or ObjectId'); + } + + // special case passing in an ObjectId as a filter + this.filter = filter != null && filter._bsontype === 'ObjectId' ? { _id: filter } : filter; + + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? ExplainedCursorResponse : CursorResponse; + } + + override get commandName() { + return 'find' as const; + } + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { + ...this.options, + ...this.bsonOptions, + documentsReturnedIn: 'firstBatch', + session: this.session, + timeoutContext + }; + } + + override handleOk( + response: InstanceType + ): CursorResponse { + return response; + } + + override buildCommandDocument(): Document { + return makeFindCommand(this.ns, this.filter, this.options); + } +} + +function makeFindCommand(ns: MongoDBNamespace, filter: Document, options: FindOptions): Document { + const findCommand: Document = { + find: ns.collection, + filter + }; + + if (options.sort) { + findCommand.sort = formatSort(options.sort); + } + + if (options.projection) { + let projection = options.projection; + if (projection && Array.isArray(projection)) { + projection = projection.length + ? projection.reduce((result, field) => { + result[field] = 1; + return result; + }, {}) + : { _id: 1 }; + } + + findCommand.projection = projection; + } + + if (options.hint) { + findCommand.hint = normalizeHintField(options.hint); + } + + if (typeof options.skip === 'number') { + findCommand.skip = options.skip; + } + + if (typeof options.limit === 'number') { + if (options.limit < 0) { + findCommand.limit = -options.limit; + findCommand.singleBatch = true; + } else { + findCommand.limit = options.limit; + } + } + + if (typeof options.batchSize === 'number') { + if (options.batchSize < 0) { + findCommand.limit = -options.batchSize; + } else { + if (options.batchSize === options.limit) { + // Spec dictates that if these are equal the batchSize should be one more than the + // limit to avoid leaving the cursor open. + findCommand.batchSize = options.batchSize + 1; + } else { + findCommand.batchSize = options.batchSize; + } + } + } + + if (typeof options.singleBatch === 'boolean') { + findCommand.singleBatch = options.singleBatch; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + findCommand.comment = options.comment; + } + + if (options.max) { + findCommand.max = options.max; + } + + if (options.min) { + findCommand.min = options.min; + } + + if (typeof options.returnKey === 'boolean') { + findCommand.returnKey = options.returnKey; + } + + if (typeof options.showRecordId === 'boolean') { + findCommand.showRecordId = options.showRecordId; + } + + if (typeof options.tailable === 'boolean') { + findCommand.tailable = options.tailable; + } + + if (typeof options.oplogReplay === 'boolean') { + findCommand.oplogReplay = options.oplogReplay; + } + + if (typeof options.timeout === 'boolean') { + findCommand.noCursorTimeout = !options.timeout; + } else if (typeof options.noCursorTimeout === 'boolean') { + findCommand.noCursorTimeout = options.noCursorTimeout; + } + + if (typeof options.awaitData === 'boolean') { + findCommand.awaitData = options.awaitData; + } + + if (typeof options.allowPartialResults === 'boolean') { + findCommand.allowPartialResults = options.allowPartialResults; + } + if (typeof options.allowDiskUse === 'boolean') { + findCommand.allowDiskUse = options.allowDiskUse; + } + + if (options.let) { + findCommand.let = options.let; + } + + return findCommand; +} + +defineAspects(FindOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.EXPLAINABLE, + Aspect.CURSOR_CREATING, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find_and_modify.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find_and_modify.ts new file mode 100644 index 00000000..8ed9a6a0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/find_and_modify.ts @@ -0,0 +1,307 @@ +import { type Connection } from '..'; +import type { Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Collection } from '../collection'; +import { MongoInvalidArgumentError } from '../error'; +import { ReadPreference } from '../read_preference'; +import type { ClientSession } from '../sessions'; +import { formatSort, type Sort, type SortForCmd } from '../sort'; +import { decorateWithCollation, hasAtomicOperators } from '../utils'; +import { type WriteConcern, type WriteConcernSettings } from '../write_concern'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export const ReturnDocument = Object.freeze({ + BEFORE: 'before', + AFTER: 'after' +} as const); + +/** @public */ +export type ReturnDocument = (typeof ReturnDocument)[keyof typeof ReturnDocument]; + +/** @public */ +export interface FindOneAndDeleteOptions extends CommandOperationOptions { + /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Return the ModifyResult instead of the modified document. Defaults to false + */ + includeResultMetadata?: boolean; +} + +/** @public */ +export interface FindOneAndReplaceOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Return the ModifyResult instead of the modified document. Defaults to false + */ + includeResultMetadata?: boolean; +} + +/** @public */ +export interface FindOneAndUpdateOptions extends CommandOperationOptions { + /** Optional list of array filters referenced in filtered positional operators */ + arrayFilters?: Document[]; + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** + * Return the ModifyResult instead of the modified document. Defaults to false + */ + includeResultMetadata?: boolean; +} + +/** @internal */ +interface FindAndModifyCmdBase { + remove: boolean; + new: boolean; + upsert: boolean; + update?: Document; + sort?: SortForCmd; + fields?: Document; + bypassDocumentValidation?: boolean; + arrayFilters?: Document[]; + maxTimeMS?: number; + let?: Document; + writeConcern?: WriteConcern | WriteConcernSettings; + /** + * Comment to apply to the operation. + */ + comment?: unknown; +} + +function configureFindAndModifyCmdBaseUpdateOpts( + cmdBase: FindAndModifyCmdBase, + options: FindOneAndReplaceOptions | FindOneAndUpdateOptions +): FindAndModifyCmdBase { + cmdBase.new = options.returnDocument === ReturnDocument.AFTER; + cmdBase.upsert = options.upsert === true; + + if (options.bypassDocumentValidation === true) { + cmdBase.bypassDocumentValidation = options.bypassDocumentValidation; + } + return cmdBase; +} + +/** @internal */ +export class FindAndModifyOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: FindOneAndReplaceOptions | FindOneAndUpdateOptions | FindOneAndDeleteOptions; + collection: Collection; + query: Document; + doc?: Document; + + constructor( + collection: Collection, + query: Document, + options: FindOneAndReplaceOptions | FindOneAndUpdateOptions | FindOneAndDeleteOptions + ) { + super(collection, options); + this.options = options; + // force primary read preference + this.readPreference = ReadPreference.primary; + + this.collection = collection; + this.query = query; + } + + override get commandName() { + return 'findAndModify' as const; + } + + override buildCommandDocument( + _connection: Connection, + _session?: ClientSession + ): Document & FindAndModifyCmdBase { + const options = this.options; + const command: Document & FindAndModifyCmdBase = { + findAndModify: this.collection.collectionName, + query: this.query, + remove: false, + new: false, + upsert: false + }; + + options.includeResultMetadata ??= false; + + const sort = formatSort(options.sort); + if (sort) { + command.sort = sort; + } + + if (options.projection) { + command.fields = options.projection; + } + + if (options.maxTimeMS) { + command.maxTimeMS = options.maxTimeMS; + } + + // Decorate the findAndModify command with the write Concern + if (options.writeConcern) { + command.writeConcern = options.writeConcern; + } + + if (options.let) { + command.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + decorateWithCollation(command, options); + + if (options.hint) { + command.hint = options.hint; + } + + return command; + } + + override handleOk(response: InstanceType): Document { + const result = super.handleOk(response); + return this.options.includeResultMetadata ? result : (result.value ?? null); + } +} + +/** @internal */ +export class FindOneAndDeleteOperation extends FindAndModifyOperation { + constructor(collection: Collection, filter: Document, options: FindOneAndDeleteOptions) { + // Basic validation + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Argument "filter" must be an object'); + } + + super(collection, filter, options); + } + + override buildCommandDocument( + connection: Connection, + session?: ClientSession + ): Document & FindAndModifyCmdBase { + const document = super.buildCommandDocument(connection, session); + document.remove = true; + return document; + } +} + +/** @internal */ +export class FindOneAndReplaceOperation extends FindAndModifyOperation { + private replacement: Document; + constructor( + collection: Collection, + filter: Document, + replacement: Document, + options: FindOneAndReplaceOptions + ) { + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Argument "filter" must be an object'); + } + + if (replacement == null || typeof replacement !== 'object') { + throw new MongoInvalidArgumentError('Argument "replacement" must be an object'); + } + + if (hasAtomicOperators(replacement)) { + throw new MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + + super(collection, filter, options); + this.replacement = replacement; + } + + override buildCommandDocument( + connection: Connection, + session?: ClientSession + ): Document & FindAndModifyCmdBase { + const document = super.buildCommandDocument(connection, session); + document.update = this.replacement; + configureFindAndModifyCmdBaseUpdateOpts(document, this.options); + return document; + } +} + +/** @internal */ +export class FindOneAndUpdateOperation extends FindAndModifyOperation { + override options: FindOneAndUpdateOptions; + + private update: Document; + constructor( + collection: Collection, + filter: Document, + update: Document, + options: FindOneAndUpdateOptions + ) { + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Argument "filter" must be an object'); + } + + if (update == null || typeof update !== 'object') { + throw new MongoInvalidArgumentError('Argument "update" must be an object'); + } + + if (!hasAtomicOperators(update, options)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + + super(collection, filter, options); + this.update = update; + this.options = options; + } + + override buildCommandDocument( + connection: Connection, + session?: ClientSession + ): Document & FindAndModifyCmdBase { + const document = super.buildCommandDocument(connection, session); + document.update = this.update; + configureFindAndModifyCmdBaseUpdateOpts(document, this.options); + + if (this.options.arrayFilters) { + document.arrayFilters = this.options.arrayFilters; + } + + return document; + } +} + +defineAspects(FindAndModifyOperation, [ + Aspect.WRITE_OPERATION, + Aspect.RETRYABLE, + Aspect.EXPLAINABLE, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/get_more.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/get_more.ts new file mode 100644 index 00000000..064a1cb0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/get_more.ts @@ -0,0 +1,106 @@ +import type { Document, Long } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { CursorResponse } from '../cmap/wire_protocol/responses'; +import { MongoRuntimeError } from '../error'; +import type { Server, ServerCommandOptions } from '../sdam/server'; +import { type TimeoutContext } from '../timeout'; +import { type MongoDBNamespace } from '../utils'; +import { AbstractOperation, Aspect, defineAspects, type OperationOptions } from './operation'; + +/** @internal */ +export interface GetMoreOptions extends OperationOptions { + /** Set the batchSize for the getMoreCommand when iterating over the query results. */ + batchSize?: number; + /** + * Comment to apply to the operation. + */ + comment?: unknown; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; + /** TODO(NODE-4413): Address bug with maxAwaitTimeMS not being passed in from the cursor correctly */ + maxAwaitTimeMS?: number; +} + +/** + * GetMore command: https://www.mongodb.com/docs/manual/reference/command/getMore/ + * @internal + */ +export interface GetMoreCommand { + getMore: Long; + collection: string; + batchSize?: number; + maxTimeMS?: number; + /** Only supported on wire versions 10 or greater */ + comment?: unknown; +} + +/** @internal */ +export class GetMoreOperation extends AbstractOperation { + override SERVER_COMMAND_RESPONSE_TYPE = CursorResponse; + cursorId: Long; + override options: GetMoreOptions; + + constructor(ns: MongoDBNamespace, cursorId: Long, server: Server, options: GetMoreOptions) { + super(options); + + this.options = options; + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + + override get commandName() { + return 'getMore' as const; + } + + override buildCommand(_connection: Connection): Document { + if (this.cursorId == null || this.cursorId.isZero()) { + throw new MongoRuntimeError('Unable to iterate cursor with no id'); + } + + const collection = this.ns.collection; + if (collection == null) { + // Cursors should have adopted the namespace returned by MongoDB + // which should always defined a collection name (even a pseudo one, ex. db.aggregate()) + throw new MongoRuntimeError('A collection name must be determined before getMore'); + } + + const getMoreCmd: GetMoreCommand = { + getMore: this.cursorId, + collection + }; + + if (typeof this.options.batchSize === 'number') { + getMoreCmd.batchSize = Math.abs(this.options.batchSize); + } + + if (typeof this.options.maxAwaitTimeMS === 'number') { + getMoreCmd.maxTimeMS = this.options.maxAwaitTimeMS; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + getMoreCmd.comment = this.options.comment; + } + + return getMoreCmd; + } + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { + returnFieldSelector: null, + documentsReturnedIn: 'nextBatch', + timeoutContext, + ...this.options + }; + } + + override handleOk( + response: InstanceType + ): CursorResponse { + return response; + } +} + +defineAspects(GetMoreOperation, [Aspect.READ_OPERATION, Aspect.MUST_SELECT_SAME_SERVER]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/indexes.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/indexes.ts new file mode 100644 index 00000000..d6ae371f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/indexes.ts @@ -0,0 +1,408 @@ +import type { Document } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { CursorResponse, MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Collection } from '../collection'; +import { type AbstractCursorOptions } from '../cursor/abstract_cursor'; +import { type OneOrMore } from '../mongo_types'; +import { isObject, type MongoDBNamespace } from '../utils'; +import { + type CollationOptions, + CommandOperation, + type CommandOperationOptions, + type OperationParent +} from './command'; +import { Aspect, defineAspects } from './operation'; + +const VALID_INDEX_OPTIONS = new Set([ + 'background', + 'unique', + 'name', + 'partialFilterExpression', + 'sparse', + 'hidden', + 'expireAfterSeconds', + 'storageEngine', + 'collation', + 'version', + + // text indexes + 'weights', + 'default_language', + 'language_override', + 'textIndexVersion', + + // 2d-sphere indexes + '2dsphereIndexVersion', + + // 2d indexes + 'bits', + 'min', + 'max', + + // geoHaystack Indexes + 'bucketSize', + + // wildcard indexes + 'wildcardProjection' +]); + +/** @public */ +export type IndexDirection = + | -1 + | 1 + | '2d' + | '2dsphere' + | 'text' + | 'geoHaystack' + | 'hashed' + | number; + +function isIndexDirection(x: unknown): x is IndexDirection { + return ( + typeof x === 'number' || x === '2d' || x === '2dsphere' || x === 'text' || x === 'geoHaystack' + ); +} +/** @public */ +export type IndexSpecification = OneOrMore< + | string + | [string, IndexDirection] + | { [key: string]: IndexDirection } + | Map +>; + +/** @public */ +export interface IndexInformationOptions extends ListIndexesOptions { + /** + * When `true`, an array of index descriptions is returned. + * When `false`, the driver returns an object that with keys corresponding to index names with values + * corresponding to the entries of the indexes' key. + * + * For example, the given the following indexes: + * ``` + * [ { name: 'a_1', key: { a: 1 } }, { name: 'b_1_c_1' , key: { b: 1, c: 1 } }] + * ``` + * + * When `full` is `true`, the above array is returned. When `full` is `false`, the following is returned: + * ``` + * { + * 'a_1': [['a', 1]], + * 'b_1_c_1': [['b', 1], ['c', 1]], + * } + * ``` + */ + full?: boolean; +} + +/** @public */ +export interface IndexDescription + extends Pick< + CreateIndexesOptions, + | 'background' + | 'unique' + | 'partialFilterExpression' + | 'sparse' + | 'hidden' + | 'expireAfterSeconds' + | 'storageEngine' + | 'version' + | 'weights' + | 'default_language' + | 'language_override' + | 'textIndexVersion' + | '2dsphereIndexVersion' + | 'bits' + | 'min' + | 'max' + | 'bucketSize' + | 'wildcardProjection' + > { + collation?: CollationOptions; + name?: string; + key: { [key: string]: IndexDirection } | Map; +} + +/** @public */ +export interface CreateIndexesOptions extends Omit { + /** Creates the index in the background, yielding whenever possible. */ + background?: boolean; + /** Creates an unique index. */ + unique?: boolean; + /** Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) */ + name?: string; + /** Creates a partial index based on the given filter object (MongoDB 3.2 or higher) */ + partialFilterExpression?: Document; + /** Creates a sparse index. */ + sparse?: boolean; + /** Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) */ + expireAfterSeconds?: number; + /** Allows users to configure the storage engine on a per-index basis when creating an index. (MongoDB 3.0 or higher) */ + storageEngine?: Document; + /** Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes. */ + commitQuorum?: number | string; + /** Specifies the index version number, either 0 or 1. */ + version?: number; + // text indexes + weights?: Document; + default_language?: string; + language_override?: string; + textIndexVersion?: number; + // 2d-sphere indexes + '2dsphereIndexVersion'?: number; + // 2d indexes + bits?: number; + /** For geospatial indexes set the lower bound for the co-ordinates. */ + min?: number; + /** For geospatial indexes set the high bound for the co-ordinates. */ + max?: number; + // geoHaystack Indexes + bucketSize?: number; + // wildcard indexes + wildcardProjection?: Document; + /** Specifies that the index should exist on the target collection but should not be used by the query planner when executing operations. */ + hidden?: boolean; +} + +function isSingleIndexTuple(t: unknown): t is [string, IndexDirection] { + return Array.isArray(t) && t.length === 2 && isIndexDirection(t[1]); +} + +/** + * Converts an `IndexSpecification`, which can be specified in multiple formats, into a + * valid `key` for the createIndexes command. + */ +function constructIndexDescriptionMap(indexSpec: IndexSpecification): Map { + const key: Map = new Map(); + + const indexSpecs = + !Array.isArray(indexSpec) || isSingleIndexTuple(indexSpec) ? [indexSpec] : indexSpec; + + // Iterate through array and handle different types + for (const spec of indexSpecs) { + if (typeof spec === 'string') { + key.set(spec, 1); + } else if (Array.isArray(spec)) { + key.set(spec[0], spec[1] ?? 1); + } else if (spec instanceof Map) { + for (const [property, value] of spec) { + key.set(property, value); + } + } else if (isObject(spec)) { + for (const [property, value] of Object.entries(spec)) { + key.set(property, value); + } + } + } + + return key; +} + +/** + * Receives an index description and returns a modified index description which has had invalid options removed + * from the description and has mapped the `version` option to the `v` option. + */ +function resolveIndexDescription( + description: IndexDescription +): Omit { + const validProvidedOptions = Object.entries(description).filter(([optionName]) => + VALID_INDEX_OPTIONS.has(optionName) + ); + + return Object.fromEntries( + // we support the `version` option, but the `createIndexes` command expects it to be the `v` + validProvidedOptions.map(([name, value]) => (name === 'version' ? ['v', value] : [name, value])) + ); +} + +/** + * @public + * The index information returned by the listIndexes command. https://www.mongodb.com/docs/manual/reference/command/listIndexes/#mongodb-dbcommand-dbcmd.listIndexes + */ +export type IndexDescriptionInfo = Omit & { + key: { [key: string]: IndexDirection }; + v?: IndexDescription['version']; +} & Document; + +/** @public */ +export type IndexDescriptionCompact = Record; + +/** + * @internal + * + * Internally, the driver represents index description keys with `Map`s to preserve key ordering. + * We don't require users to specify maps, so we transform user provided descriptions into + * "resolved" by converting the `key` into a JS `Map`, if it isn't already a map. + * + * Additionally, we support the `version` option, but the `createIndexes` command uses the field `v` + * to specify the index version so we map the value of `version` to `v`, if provided. + */ +type ResolvedIndexDescription = Omit & { + key: Map; + v?: IndexDescription['version']; +}; + +/** @internal */ +export class CreateIndexesOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: CreateIndexesOptions; + collectionName: string; + indexes: ReadonlyArray; + + private constructor( + parent: OperationParent, + collectionName: string, + indexes: IndexDescription[], + options?: CreateIndexesOptions + ) { + super(parent, options); + + this.options = options ?? {}; + // collation is set on each index, it should not be defined at the root + this.options.collation = undefined; + this.collectionName = collectionName; + this.indexes = indexes.map((userIndex: IndexDescription): ResolvedIndexDescription => { + // Ensure the key is a Map to preserve index key ordering + const key = + userIndex.key instanceof Map ? userIndex.key : new Map(Object.entries(userIndex.key)); + const name = userIndex.name ?? Array.from(key).flat().join('_'); + const validIndexOptions = resolveIndexDescription(userIndex); + return { + ...validIndexOptions, + name, + key + }; + }); + this.ns = parent.s.namespace; + } + + static fromIndexDescriptionArray( + parent: OperationParent, + collectionName: string, + indexes: IndexDescription[], + options?: CreateIndexesOptions + ): CreateIndexesOperation { + return new CreateIndexesOperation(parent, collectionName, indexes, options); + } + + static fromIndexSpecification( + parent: OperationParent, + collectionName: string, + indexSpec: IndexSpecification, + options: CreateIndexesOptions = {} + ): CreateIndexesOperation { + const key = constructIndexDescriptionMap(indexSpec); + const description: IndexDescription = { ...options, key }; + return new CreateIndexesOperation(parent, collectionName, [description], options); + } + + override get commandName() { + return 'createIndexes'; + } + + override buildCommandDocument(_connection: Connection): Document { + const options = this.options; + const indexes = this.indexes; + + const cmd: Document = { createIndexes: this.collectionName, indexes }; + + if (options.commitQuorum != null) { + cmd.commitQuorum = options.commitQuorum; + } + return cmd; + } + + override handleOk(_response: InstanceType): string[] { + const indexNames = this.indexes.map(index => index.name || ''); + return indexNames; + } +} + +/** @public */ +export type DropIndexesOptions = CommandOperationOptions; + +/** @internal */ +export class DropIndexOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: DropIndexesOptions; + collection: Collection; + indexName: string; + + constructor(collection: Collection, indexName: string, options?: DropIndexesOptions) { + super(collection, options); + + this.options = options ?? {}; + this.collection = collection; + this.indexName = indexName; + this.ns = collection.fullNamespace; + } + + override get commandName() { + return 'dropIndexes' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + return { dropIndexes: this.collection.collectionName, index: this.indexName }; + } +} + +/** @public */ +export type ListIndexesOptions = AbstractCursorOptions & { + /** @internal */ + omitMaxTimeMS?: boolean; + /** @internal */ + rawData?: boolean; +}; + +/** @internal */ +export class ListIndexesOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = CursorResponse; + /** + * @remarks WriteConcern can still be present on the options because + * we inherit options from the client/db/collection. The + * key must be present on the options in order to delete it. + * This allows typescript to delete the key but will + * not allow a writeConcern to be assigned as a property on options. + */ + override options: ListIndexesOptions & { writeConcern?: never }; + collectionNamespace: MongoDBNamespace; + + constructor(collection: Collection, options?: ListIndexesOptions) { + super(collection, options); + + this.options = { ...options }; + delete this.options.writeConcern; + this.collectionNamespace = collection.s.namespace; + } + + override get commandName() { + return 'listIndexes' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + const cursor = this.options.batchSize ? { batchSize: this.options.batchSize } : {}; + + const command: Document = { listIndexes: this.collectionNamespace.collection, cursor }; + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + + return command; + } + + override handleOk( + response: InstanceType + ): CursorResponse { + return response; + } +} + +defineAspects(ListIndexesOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.CURSOR_CREATING, + Aspect.SUPPORTS_RAW_DATA +]); +defineAspects(CreateIndexesOperation, [Aspect.WRITE_OPERATION, Aspect.SUPPORTS_RAW_DATA]); +defineAspects(DropIndexOperation, [Aspect.WRITE_OPERATION, Aspect.SUPPORTS_RAW_DATA]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/insert.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/insert.ts new file mode 100644 index 00000000..c7c4b77f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/insert.ts @@ -0,0 +1,119 @@ +import { type Connection } from '..'; +import type { Document } from '../bson'; +import type { BulkWriteOptions } from '../bulk/common'; +import { makeDocumentSequence } from '../cmap/commands'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Collection } from '../collection'; +import { MongoServerError } from '../error'; +import type { InferIdType } from '../mongo_types'; +import type { ClientSession } from '../sessions'; +import { maybeAddIdToDocuments, type MongoDBNamespace } from '../utils'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; +/** @internal */ +export class InsertOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: BulkWriteOptions; + + documents: Document[]; + /** @internal Per-operation pre-serialized BSON, reused to build a DocumentSequence. */ + serializedOperations?: Uint8Array[]; + + constructor( + ns: MongoDBNamespace, + documents: Document[], + options: BulkWriteOptions, + serializedOperations?: Uint8Array[] + ) { + super(undefined, options); + this.options = { ...options, checkKeys: options.checkKeys ?? false }; + this.ns = ns; + this.documents = documents; + this.serializedOperations = serializedOperations; + } + + override get commandName() { + return 'insert' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const options = this.options ?? {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command: Document = { + insert: this.ns.collection, + documents: this.serializedOperations + ? makeDocumentSequence('documents', this.documents, this.serializedOperations) + : this.documents, + ordered + }; + + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + return command; + } +} + +/** @public */ +export interface InsertOneOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation. */ + bypassDocumentValidation?: boolean; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; +} + +/** @public */ +export interface InsertOneResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The identifier that was inserted. If the server generated the identifier, this value will be null as the driver does not have access to that data */ + insertedId: InferIdType; +} + +export class InsertOneOperation extends InsertOperation { + constructor(collection: Collection, doc: Document, options: InsertOneOptions) { + super(collection.s.namespace, [maybeAddIdToDocuments(collection, doc, options)], options); + } + + override handleOk(response: InstanceType): Document { + const res = super.handleOk(response); + if (res.code) throw new MongoServerError(res); + if (res.writeErrors) { + // This should be a WriteError but we can't change it now because of error hierarchy + throw new MongoServerError(res.writeErrors[0]); + } + + return { + acknowledged: this.writeConcern?.w !== 0, + insertedId: this.documents[0]._id + }; + } +} + +/** @public */ +export interface InsertManyResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of inserted documents for this operations */ + insertedCount: number; + /** Map of the index of the inserted document to the id of the inserted document */ + insertedIds: { [key: number]: InferIdType }; +} + +defineAspects(InsertOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.SUPPORTS_RAW_DATA +]); +defineAspects(InsertOneOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/kill_cursors.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/kill_cursors.ts new file mode 100644 index 00000000..87184e4d --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/kill_cursors.ts @@ -0,0 +1,64 @@ +import type { Long } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { type MongoError, MongoRuntimeError } from '../error'; +import type { Server, ServerCommandOptions } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { type TimeoutContext } from '../timeout'; +import { type MongoDBNamespace } from '../utils'; +import { AbstractOperation, Aspect, defineAspects, type OperationOptions } from './operation'; + +/** + * https://www.mongodb.com/docs/manual/reference/command/killCursors/ + * @internal + */ +interface KillCursorsCommand { + killCursors: string; + cursors: Long[]; + comment?: unknown; +} + +export class KillCursorsOperation extends AbstractOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + cursorId: Long; + + constructor(cursorId: Long, ns: MongoDBNamespace, server: Server, options: OperationOptions) { + super(options); + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + + override get commandName() { + return 'killCursors' as const; + } + + override buildCommand(_connection: Connection, _session?: ClientSession): KillCursorsCommand { + const killCursors = this.ns.collection; + if (killCursors == null) { + // Cursors should have adopted the namespace returned by MongoDB + // which should always defined a collection name (even a pseudo one, ex. db.aggregate()) + throw new MongoRuntimeError('A collection name must be determined before killCursors'); + } + + const killCursorsCommand: KillCursorsCommand = { + killCursors, + cursors: [this.cursorId] + }; + + return killCursorsCommand; + } + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { + session: this.session, + timeoutContext + }; + } + + override handleError(_error: MongoError): void { + // The driver should never emit errors from killCursors, this is spec-ed behavior + } +} + +defineAspects(KillCursorsOperation, [Aspect.MUST_SELECT_SAME_SERVER]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_collections.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_collections.ts new file mode 100644 index 00000000..ff1bc6a9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_collections.ts @@ -0,0 +1,107 @@ +import { type Connection } from '..'; +import type { Binary, Document } from '../bson'; +import { CursorResponse, ExplainedCursorResponse } from '../cmap/wire_protocol/responses'; +import { type CursorTimeoutContext, type CursorTimeoutMode } from '../cursor/abstract_cursor'; +import type { Db } from '../db'; +import { type Abortable } from '../mongo_types'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface ListCollectionsOptions + extends Omit, + Abortable { + /** If true, will only return the collection name in the response, and will omit additional info */ + nameOnly?: boolean; + /** If true and nameOnly is true, allows a user without the required privilege (i.e. listCollections action on the database) to run the command when access control is enforced. */ + authorizedCollections?: boolean; + /** The batchSize for the returned command cursor */ + batchSize?: number; + /** @internal */ + timeoutMode?: CursorTimeoutMode; + + /** @internal */ + timeoutContext?: CursorTimeoutContext; +} + +/** @internal */ +export class ListCollectionsOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = CursorResponse; + /** + * @remarks WriteConcern can still be present on the options because + * we inherit options from the client/db/collection. The + * key must be present on the options in order to delete it. + * This allows typescript to delete the key but will + * not allow a writeConcern to be assigned as a property on options. + */ + override options: ListCollectionsOptions & { writeConcern?: never }; + db: Db; + filter: Document; + nameOnly: boolean; + authorizedCollections: boolean; + batchSize?: number; + + constructor(db: Db, filter: Document, options?: ListCollectionsOptions) { + super(db, options); + + this.options = { ...options }; + delete this.options.writeConcern; + this.db = db; + this.filter = filter; + this.nameOnly = !!this.options.nameOnly; + this.authorizedCollections = !!this.options.authorizedCollections; + + if (typeof this.options.batchSize === 'number') { + this.batchSize = this.options.batchSize; + } + + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? ExplainedCursorResponse : CursorResponse; + } + + override get commandName() { + return 'listCollections' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + const command: Document = { + listCollections: 1, + filter: this.filter, + cursor: this.batchSize ? { batchSize: this.batchSize } : {}, + nameOnly: this.nameOnly, + authorizedCollections: this.authorizedCollections + }; + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + command.comment = this.options.comment; + } + + return command; + } + + override handleOk( + response: InstanceType + ): CursorResponse { + return response; + } +} + +/** @public */ +export interface CollectionInfo extends Document { + name: string; + type?: string; + options?: Document; + info?: { + readOnly?: false; + uuid?: Binary; + }; + idIndex?: Document; +} + +defineAspects(ListCollectionsOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.CURSOR_CREATING, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_databases.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_databases.ts new file mode 100644 index 00000000..1867471a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/list_databases.ts @@ -0,0 +1,68 @@ +import { type Connection } from '..'; +import type { Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Db } from '../db'; +import type { ClientSession } from '../sessions'; +import { MongoDBNamespace } from '../utils'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface ListDatabasesResult { + databases: ({ name: string; sizeOnDisk?: number; empty?: boolean } & Document)[]; + totalSize?: number; + totalSizeMb?: number; + ok: 1 | 0; +} + +/** @public */ +export interface ListDatabasesOptions extends Omit { + /** A query predicate that determines which databases are listed */ + filter?: Document; + /** A flag to indicate whether the command should return just the database names, or return both database names and size information */ + nameOnly?: boolean; + /** A flag that determines which databases are returned based on the user privileges when access control is enabled */ + authorizedDatabases?: boolean; +} + +/** @internal */ +export class ListDatabasesOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: ListDatabasesOptions; + + constructor(db: Db, options?: ListDatabasesOptions) { + super(db, options); + this.options = options ?? {}; + this.ns = new MongoDBNamespace('admin', '$cmd'); + } + + override get commandName() { + return 'listDatabases' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const cmd: Document = { listDatabases: 1 }; + + if (typeof this.options.nameOnly === 'boolean') { + cmd.nameOnly = this.options.nameOnly; + } + + if (this.options.filter) { + cmd.filter = this.options.filter; + } + + if (typeof this.options.authorizedDatabases === 'boolean') { + cmd.authorizedDatabases = this.options.authorizedDatabases; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (this.options.comment !== undefined) { + cmd.comment = this.options.comment; + } + + return cmd; + } +} + +defineAspects(ListDatabasesOperation, [Aspect.READ_OPERATION, Aspect.RETRYABLE]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/operation.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/operation.ts new file mode 100644 index 00000000..488afc96 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/operation.ts @@ -0,0 +1,189 @@ +import { type Connection, type MongoError } from '..'; +import { type BSONSerializeOptions, type Document, resolveBSONOptions } from '../bson'; +import { type MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { type Abortable } from '../mongo_types'; +import { ReadPreference, type ReadPreferenceLike } from '../read_preference'; +import type { Server, ServerCommandOptions } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { type TimeoutContext } from '../timeout'; +import type { MongoDBNamespace } from '../utils'; + +export const Aspect = { + READ_OPERATION: Symbol('READ_OPERATION'), + WRITE_OPERATION: Symbol('WRITE_OPERATION'), + RETRYABLE: Symbol('RETRYABLE'), + EXPLAINABLE: Symbol('EXPLAINABLE'), + SKIP_COLLATION: Symbol('SKIP_COLLATION'), + CURSOR_CREATING: Symbol('CURSOR_CREATING'), + MUST_SELECT_SAME_SERVER: Symbol('MUST_SELECT_SAME_SERVER'), + COMMAND_BATCHING: Symbol('COMMAND_BATCHING'), + SUPPORTS_RAW_DATA: Symbol('SUPPORTS_RAW_DATA') +} as const; + +/** @public */ +export type Hint = string | Document; + +/** @public */ +export interface OperationOptions extends BSONSerializeOptions { + /** Specify ClientSession for this command */ + session?: ClientSession; + willRetryWrite?: boolean; + + /** The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest). */ + readPreference?: ReadPreferenceLike; + + /** @internal Hints to `executeOperation` that this operation should not unpin on an ended transaction */ + bypassPinningCheck?: boolean; + + /** @internal Hint to `executeOperation` to omit maxTimeMS */ + omitMaxTimeMS?: boolean; + + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; +} + +/** + * This class acts as a parent class for any operation and is responsible for setting this.options, + * as well as setting and getting a session. + * Additionally, this class implements `hasAspect`, which determines whether an operation has + * a specific aspect. + * @internal + */ +export abstract class AbstractOperation { + ns!: MongoDBNamespace; + readPreference: ReadPreference; + server!: Server; + bypassPinningCheck: boolean; + + // BSON serialization options + bsonOptions?: BSONSerializeOptions; + + options: OperationOptions & Abortable; + + /** Specifies the time an operation will run until it throws a timeout error. */ + timeoutMS?: number; + + /** Used by commitTransaction to share the retry budget across two executeOperation calls. */ + maxAttempts?: number; + + /** Tracks how many attempts were made in the last executeOperation call. */ + attemptsMade: number; + + private _session: ClientSession | undefined; + + static aspects?: Set; + + constructor(options: OperationOptions & Abortable = {}) { + this.readPreference = this.hasAspect(Aspect.WRITE_OPERATION) + ? ReadPreference.primary + : (ReadPreference.fromOptions(options) ?? ReadPreference.primary); + + // Pull the BSON serialize options from the already-resolved options + this.bsonOptions = resolveBSONOptions(options); + + this._session = options.session != null ? options.session : undefined; + + this.options = options; + this.bypassPinningCheck = !!options.bypassPinningCheck; + + this.attemptsMade = 0; + } + + /** Must match the first key of the command object sent to the server. + Command name should be stateless (should not use 'this' keyword) */ + abstract get commandName(): string; + + hasAspect(aspect: symbol): boolean { + const ctor = this.constructor as { aspects?: Set }; + if (ctor.aspects == null) { + return false; + } + + return ctor.aspects.has(aspect); + } + + // Make sure the session is not writable from outside this class. + get session(): ClientSession | undefined { + return this._session; + } + + set session(session: ClientSession) { + this._session = session; + } + + clearSession() { + this._session = undefined; + } + + resetBatch(): boolean { + return true; + } + + get canRetryRead(): boolean { + return this.hasAspect(Aspect.RETRYABLE) && this.hasAspect(Aspect.READ_OPERATION); + } + + get canRetryWrite(): boolean { + return this.hasAspect(Aspect.RETRYABLE) && this.hasAspect(Aspect.WRITE_OPERATION); + } + abstract SERVER_COMMAND_RESPONSE_TYPE: typeof MongoDBResponse; + + /** + * Build a raw command document. + */ + abstract buildCommand(connection: Connection, session?: ClientSession): Document; + + /** + * Builds an instance of `ServerCommandOptions` to be used for operation execution. + */ + abstract buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions; + + /** + * Given an instance of a MongoDBResponse, map the response to the correct result type. For + * example, a `CountOperation` might map the response as follows: + * + * ```typescript + * override handleOk(response: InstanceType): TResult { + * return response.toObject(this.bsonOptions).n ?? 0; + * } + * + * // or, with type safety: + * override handleOk(response: InstanceType): TResult { + * return response.getNumber('n') ?? 0; + * } + * ``` + */ + handleOk(response: InstanceType): TResult { + return response.toObject(this.bsonOptions) as TResult; + } + + /** + * Optional. + * + * If the operation performs error handling, such as wrapping, renaming the error, or squashing errors + * this method can be overridden. + */ + handleError(error: MongoError): TResult | never { + throw error; + } +} + +export function defineAspects( + operation: { aspects?: Set }, + aspects: symbol | symbol[] | Set +): Set { + if (!Array.isArray(aspects) && !(aspects instanceof Set)) { + aspects = [aspects]; + } + + aspects = new Set(aspects); + Object.defineProperty(operation, 'aspects', { + value: aspects, + writable: false + }); + + return aspects; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/profiling_level.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/profiling_level.ts new file mode 100644 index 00000000..8308db81 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/profiling_level.ts @@ -0,0 +1,46 @@ +import { BSONType, type Document } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Db } from '../db'; +import { MongoUnexpectedServerResponseError } from '../error'; +import { CommandOperation, type CommandOperationOptions } from './command'; + +/** @public */ +export type ProfilingLevelOptions = Omit; + +class ProfilingLevelResponse extends MongoDBResponse { + get was() { + return this.get('was', BSONType.int, true); + } +} + +/** @internal */ +export class ProfilingLevelOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = ProfilingLevelResponse; + override options: ProfilingLevelOptions; + + constructor(db: Db, options: ProfilingLevelOptions) { + super(db, options); + this.options = options; + } + + override get commandName() { + return 'profile' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + return { profile: -1 }; + } + + override handleOk(response: InstanceType): string { + if (response.ok === 1) { + const was = response.was; + if (was === 0) return 'off'; + if (was === 1) return 'slow_only'; + if (was === 2) return 'all'; + throw new MongoUnexpectedServerResponseError(`Illegal profiling level value ${was}`); + } else { + throw new MongoUnexpectedServerResponseError('Error with profile command'); + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/remove_user.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/remove_user.ts new file mode 100644 index 00000000..20e92ad0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/remove_user.ts @@ -0,0 +1,36 @@ +import { type Document } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Db } from '../db'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export type RemoveUserOptions = Omit; + +/** @internal */ +export class RemoveUserOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: RemoveUserOptions; + username: string; + + constructor(db: Db, username: string, options: RemoveUserOptions) { + super(db, options); + this.options = options; + this.username = username; + } + + override get commandName() { + return 'dropUser' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + return { dropUser: this.username }; + } + + override handleOk(_response: InstanceType): boolean { + return true; + } +} + +defineAspects(RemoveUserOperation, [Aspect.WRITE_OPERATION]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/rename.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/rename.ts new file mode 100644 index 00000000..9def9852 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/rename.ts @@ -0,0 +1,60 @@ +import { type Connection } from '..'; +import type { Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { Collection } from '../collection'; +import type { ClientSession } from '../sessions'; +import { MongoDBNamespace } from '../utils'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface RenameOptions extends Omit { + /** Drop the target name collection if it previously exists. */ + dropTarget?: boolean; + /** + * @deprecated + * + * This option has been dead code since at least Node driver version 4.x. It will + * be removed in a future major release. + */ + new_collection?: boolean; +} + +/** @internal */ +export class RenameOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + collection: Collection; + newName: string; + override options: RenameOptions; + + constructor(collection: Collection, newName: string, options: RenameOptions) { + super(collection, options); + this.collection = collection; + this.newName = newName; + this.options = options; + this.ns = new MongoDBNamespace('admin', '$cmd'); + } + + override get commandName(): string { + return 'renameCollection' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const renameCollection = this.collection.namespace; + const to = this.collection.s.namespace.withCollection(this.newName).toString(); + const dropTarget = + typeof this.options.dropTarget === 'boolean' ? this.options.dropTarget : false; + + return { + renameCollection, + to, + dropTarget + }; + } + + override handleOk(_response: InstanceType): Document { + return new Collection(this.collection.db, this.newName, this.collection.s.options); + } +} + +defineAspects(RenameOperation, [Aspect.WRITE_OPERATION]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/run_command.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/run_command.ts new file mode 100644 index 00000000..9f3e505f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/run_command.ts @@ -0,0 +1,79 @@ +import { type Abortable } from '..'; +import type { BSONSerializeOptions, Document } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { CursorResponse, MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { AbstractOperation } from '../operations/operation'; +import type { ReadPreferenceLike } from '../read_preference'; +import type { ServerCommandOptions } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { type TimeoutContext } from '../timeout'; +import { type MongoDBNamespace } from '../utils'; + +/** @public */ +export type RunCommandOptions = { + /** Specify ClientSession for this command */ + session?: ClientSession; + /** The read preference */ + readPreference?: ReadPreferenceLike; + /** + * @experimental + * Specifies the time an operation will run until it throws a timeout error + */ + timeoutMS?: number; + /** @internal */ + omitMaxTimeMS?: boolean; + + /** + * @internal Hints to `executeOperation` that this operation should not unpin on an ended transaction + * This is only used by the driver for transaction commands + */ + bypassPinningCheck?: boolean; +} & BSONSerializeOptions & + Abortable; + +/** @internal */ +export class RunCommandOperation extends AbstractOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + command: Document; + override options: RunCommandOptions; + + constructor(namespace: MongoDBNamespace, command: Document, options: RunCommandOptions) { + super(options); + this.command = command; + this.options = options; + this.ns = namespace.withCollection('$cmd'); + } + + override get commandName() { + return 'runCommand' as const; + } + + override buildCommand(_connection: Connection, _session?: ClientSession): Document { + return this.command; + } + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { + ...this.options, + session: this.session, + timeoutContext, + signal: this.options.signal, + readPreference: this.options.readPreference + }; + } +} + +/** + * @internal + * + * A specialized subclass of RunCommandOperation for cursor-creating commands. + */ +export class RunCursorCommandOperation extends RunCommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = CursorResponse; + + override handleOk( + response: InstanceType + ): CursorResponse { + return response; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/create.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/create.ts new file mode 100644 index 00000000..6d91ec3f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/create.ts @@ -0,0 +1,56 @@ +import { type Document } from '../../bson'; +import { type Connection } from '../../cmap/connection'; +import { MongoDBResponse } from '../../cmap/wire_protocol/responses'; +import type { Collection } from '../../collection'; +import type { ServerCommandOptions } from '../../sdam/server'; +import type { ClientSession } from '../../sessions'; +import { type TimeoutContext } from '../../timeout'; +import { AbstractOperation } from '../operation'; + +/** + * @public + */ +export interface SearchIndexDescription extends Document { + /** The name of the index. */ + name?: string; + + /** The index definition. */ + definition: Document; + + /** The type of the index. Currently `search` or `vectorSearch` are supported. */ + type?: string; +} + +/** @internal */ +export class CreateSearchIndexesOperation extends AbstractOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + private readonly collection: Collection; + private readonly descriptions: ReadonlyArray; + + constructor(collection: Collection, descriptions: ReadonlyArray) { + super(); + this.collection = collection; + this.descriptions = descriptions; + this.ns = collection.fullNamespace; + } + + override get commandName() { + return 'createSearchIndexes' as const; + } + + override buildCommand(_connection: Connection, _session?: ClientSession): Document { + const namespace = this.collection.fullNamespace; + return { + createSearchIndexes: namespace.collection, + indexes: this.descriptions + }; + } + + override handleOk(response: InstanceType): string[] { + return super.handleOk(response).indexesCreated.map((val: { name: string }) => val.name); + } + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { session: this.session, timeoutContext }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/drop.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/drop.ts new file mode 100644 index 00000000..e9132a7a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/drop.ts @@ -0,0 +1,58 @@ +import { type Connection, type MongoError } from '../..'; +import type { Document } from '../../bson'; +import { MongoDBResponse } from '../../cmap/wire_protocol/responses'; +import type { Collection } from '../../collection'; +import { MONGODB_ERROR_CODES, MongoServerError } from '../../error'; +import type { ServerCommandOptions } from '../../sdam/server'; +import type { ClientSession } from '../../sessions'; +import { type TimeoutContext } from '../../timeout'; +import { AbstractOperation } from '../operation'; + +/** @internal */ +export class DropSearchIndexOperation extends AbstractOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + + private readonly collection: Collection; + private readonly name: string; + + constructor(collection: Collection, name: string) { + super(); + this.collection = collection; + this.name = name; + this.ns = collection.fullNamespace; + } + + override get commandName() { + return 'dropSearchIndex' as const; + } + + override buildCommand(_connection: Connection, _session?: ClientSession): Document { + const namespace = this.collection.fullNamespace; + + const command: Document = { + dropSearchIndex: namespace.collection + }; + + if (typeof this.name === 'string') { + command.name = this.name; + } + + return command; + } + + override handleOk(_response: MongoDBResponse): void { + // do nothing + } + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { session: this.session, timeoutContext }; + } + + override handleError(error: MongoError): void { + const isNamespaceNotFoundError = + error instanceof MongoServerError && error.code === MONGODB_ERROR_CODES.NamespaceNotFound; + if (!isNamespaceNotFoundError) { + throw error; + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/update.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/update.ts new file mode 100644 index 00000000..af9d8810 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/search_indexes/update.ts @@ -0,0 +1,45 @@ +import type { Document } from '../../bson'; +import { type Connection } from '../../cmap/connection'; +import { MongoDBResponse } from '../../cmap/wire_protocol/responses'; +import type { Collection } from '../../collection'; +import type { ServerCommandOptions } from '../../sdam/server'; +import type { ClientSession } from '../../sessions'; +import { type TimeoutContext } from '../../timeout'; +import { AbstractOperation } from '../operation'; + +/** @internal */ +export class UpdateSearchIndexOperation extends AbstractOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + private readonly collection: Collection; + private readonly name: string; + private readonly definition: Document; + + constructor(collection: Collection, name: string, definition: Document) { + super(); + this.collection = collection; + this.name = name; + this.definition = definition; + this.ns = collection.fullNamespace; + } + + override get commandName() { + return 'updateSearchIndex' as const; + } + + override buildCommand(_connection: Connection, _session?: ClientSession): Document { + const namespace = this.collection.fullNamespace; + return { + updateSearchIndex: namespace.collection, + name: this.name, + definition: this.definition + }; + } + + override handleOk(_response: MongoDBResponse): void { + // no response. + } + + override buildOptions(timeoutContext: TimeoutContext): ServerCommandOptions { + return { session: this.session, timeoutContext }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/set_profiling_level.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/set_profiling_level.ts new file mode 100644 index 00000000..bf97747c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/set_profiling_level.ts @@ -0,0 +1,74 @@ +import { type Document } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Db } from '../db'; +import { MongoInvalidArgumentError } from '../error'; +import { enumToString } from '../utils'; +import { CommandOperation, type CommandOperationOptions } from './command'; + +const levelValues = new Set(['off', 'slow_only', 'all']); + +/** @public */ +export const ProfilingLevel = Object.freeze({ + off: 'off', + slowOnly: 'slow_only', + all: 'all' +} as const); + +/** @public */ +export type ProfilingLevel = (typeof ProfilingLevel)[keyof typeof ProfilingLevel]; + +/** @public */ +export type SetProfilingLevelOptions = Omit; + +/** @internal */ +export class SetProfilingLevelOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: SetProfilingLevelOptions; + level: ProfilingLevel; + profile: 0 | 1 | 2; + + constructor(db: Db, level: ProfilingLevel, options: SetProfilingLevelOptions) { + super(db, options); + this.options = options; + switch (level) { + case ProfilingLevel.off: + this.profile = 0; + break; + case ProfilingLevel.slowOnly: + this.profile = 1; + break; + case ProfilingLevel.all: + this.profile = 2; + break; + default: + this.profile = 0; + break; + } + + this.level = level; + } + + override get commandName() { + return 'profile' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + const level = this.level; + + if (!levelValues.has(level)) { + // TODO(NODE-3483): Determine error to put here + throw new MongoInvalidArgumentError( + `Profiling level must be one of "${enumToString(ProfilingLevel)}"` + ); + } + + return { profile: this.profile }; + } + + override handleOk( + _response: InstanceType + ): ProfilingLevel { + return this.level; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/stats.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/stats.ts new file mode 100644 index 00000000..e5f91501 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/stats.ts @@ -0,0 +1,37 @@ +import type { Document } from '../bson'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import type { Db } from '../db'; +import { CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface DbStatsOptions extends Omit { + /** Divide the returned sizes by scale value. */ + scale?: number; +} + +/** @internal */ +export class DbStatsOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: DbStatsOptions; + + constructor(db: Db, options: DbStatsOptions) { + super(db, options); + this.options = options; + } + + override get commandName() { + return 'dbStats' as const; + } + + override buildCommandDocument(_connection: Connection): Document { + const command: Document = { dbStats: true }; + if (this.options.scale != null) { + command.scale = this.options.scale; + } + return command; + } +} + +defineAspects(DbStatsOperation, [Aspect.READ_OPERATION]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/update.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/update.ts new file mode 100644 index 00000000..96623f32 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/update.ts @@ -0,0 +1,325 @@ +import type { Document } from '../bson'; +import { makeDocumentSequence } from '../cmap/commands'; +import { type Connection } from '../cmap/connection'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { MongoInvalidArgumentError, MongoServerError } from '../error'; +import type { InferIdType } from '../mongo_types'; +import type { ClientSession } from '../sessions'; +import { formatSort, type Sort, type SortForCmd } from '../sort'; +import { + hasAtomicOperators, + type MongoDBCollectionNamespace, + type MongoDBNamespace +} from '../utils'; +import { type CollationOptions, CommandOperation, type CommandOperationOptions } from './command'; +import { Aspect, defineAspects, type Hint } from './operation'; + +/** @public */ +export interface UpdateOptions extends CommandOperationOptions { + /** A set of filters specifying to which array elements an update should apply */ + arrayFilters?: Document[]; + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: Hint; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** + * @public + * `TSchema` is the schema of the collection + */ +export interface UpdateResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of documents that matched the filter */ + matchedCount: number; + /** The number of documents that were modified */ + modifiedCount: number; + /** The number of documents that were upserted */ + upsertedCount: number; + /** The identifier of the inserted document if an upsert took place */ + upsertedId: InferIdType | null; +} + +/** @public */ +export interface UpdateStatement { + /** The query that matches documents to update. */ + q: Document; + /** The modifications to apply. */ + u: Document | Document[]; + /** If true, perform an insert if no documents match the query. */ + upsert?: boolean; + /** If true, updates all documents that meet the query criteria. */ + multi?: boolean; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** An array of filter documents that determines which array elements to modify for an update operation on an array field. */ + arrayFilters?: Document[]; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: SortForCmd; +} + +/** + * @internal + * UpdateOperation is used in bulk write, while UpdateOneOperation and UpdateManyOperation are only used in the collections API + */ +export class UpdateOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: UpdateOptions & { ordered?: boolean }; + statements: UpdateStatement[]; + /** @internal */ + serializedOperations?: Uint8Array[]; + + constructor( + ns: MongoDBNamespace, + statements: UpdateStatement[], + options: UpdateOptions & { ordered?: boolean }, + serializedOperations?: Uint8Array[] + ) { + super(undefined, options); + this.options = options; + this.ns = ns; + + this.statements = statements; + this.serializedOperations = serializedOperations; + } + + override get commandName() { + return 'update' as const; + } + + override get canRetryWrite(): boolean { + if (super.canRetryWrite === false) { + return false; + } + + return this.statements.every(op => op.multi == null || op.multi === false); + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + const options = this.options; + const command: Document = { + update: this.ns.collection, + updates: this.serializedOperations + ? makeDocumentSequence('updates', this.statements, this.serializedOperations) + : this.statements, + ordered: options.ordered ?? true + }; + + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + + if (options.let) { + command.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + return command; + } +} + +/** @internal */ +export class UpdateOneOperation extends UpdateOperation { + constructor( + ns: MongoDBCollectionNamespace, + filter: Document, + update: Document, + options: UpdateOptions + ) { + super(ns, [makeUpdateStatement(filter, update, { ...options, multi: false })], options); + + if (!hasAtomicOperators(update, options)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + + override handleOk( + response: InstanceType + ): UpdateResult { + const res = super.handleOk(response); + + // @ts-expect-error Explain typing is broken + if (this.explain != null) return res; + + if (res.code) throw new MongoServerError(res); + if (res.writeErrors) throw new MongoServerError(res.writeErrors[0]); + + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: + Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } +} + +/** @internal */ +export class UpdateManyOperation extends UpdateOperation { + constructor( + ns: MongoDBCollectionNamespace, + filter: Document, + update: Document, + options: UpdateOptions + ) { + super(ns, [makeUpdateStatement(filter, update, { ...options, multi: true })], options); + + if (!hasAtomicOperators(update, options)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + + override handleOk( + response: InstanceType + ): UpdateResult { + const res = super.handleOk(response); + + // @ts-expect-error Explain typing is broken + if (this.explain != null) return res; + if (res.code) throw new MongoServerError(res); + if (res.writeErrors) throw new MongoServerError(res.writeErrors[0]); + + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: + Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } +} + +/** @public */ +export interface ReplaceOptions extends CommandOperationOptions { + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** Specifies the sort order for the documents matched by the filter. */ + sort?: Sort; +} + +/** @internal */ +export class ReplaceOneOperation extends UpdateOperation { + constructor( + ns: MongoDBCollectionNamespace, + filter: Document, + replacement: Document, + options: ReplaceOptions + ) { + super(ns, [makeUpdateStatement(filter, replacement, { ...options, multi: false })], options); + + if (hasAtomicOperators(replacement)) { + throw new MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + } + + override handleOk( + response: InstanceType + ): UpdateResult { + const res = super.handleOk(response); + + // @ts-expect-error Explain typing is broken + if (this.explain != null) return res; + if (res.code) throw new MongoServerError(res); + if (res.writeErrors) throw new MongoServerError(res.writeErrors[0]); + + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: + Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } +} + +export function makeUpdateStatement( + filter: Document, + update: Document | Document[], + options: UpdateOptions & { multi?: boolean } & { sort?: Sort } +): UpdateStatement { + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Selector must be a valid JavaScript object'); + } + + if (update == null || typeof update !== 'object') { + throw new MongoInvalidArgumentError('Document must be a valid JavaScript object'); + } + + const op: UpdateStatement = { q: filter, u: update }; + if (typeof options.upsert === 'boolean') { + op.upsert = options.upsert; + } + + if (options.multi) { + op.multi = options.multi; + } + + if (options.hint) { + op.hint = options.hint; + } + + if (options.arrayFilters) { + op.arrayFilters = options.arrayFilters; + } + + if (options.collation) { + op.collation = options.collation; + } + + if (!options.multi && options.sort != null) { + op.sort = formatSort(options.sort); + } + + return op; +} + +defineAspects(UpdateOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.SKIP_COLLATION, + Aspect.SUPPORTS_RAW_DATA +]); +defineAspects(UpdateOneOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION, + Aspect.SUPPORTS_RAW_DATA +]); +defineAspects(UpdateManyOperation, [ + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION, + Aspect.SUPPORTS_RAW_DATA +]); +defineAspects(ReplaceOneOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.SKIP_COLLATION, + Aspect.SUPPORTS_RAW_DATA +]); diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/validate_collection.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/validate_collection.ts new file mode 100644 index 00000000..1db92a3f --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/operations/validate_collection.ts @@ -0,0 +1,50 @@ +import { type Connection } from '..'; +import type { Admin } from '../admin'; +import { type Document } from '../bson'; +import { MongoDBResponse } from '../cmap/wire_protocol/responses'; +import { MongoUnexpectedServerResponseError } from '../error'; +import type { ClientSession } from '../sessions'; +import { CommandOperation, type CommandOperationOptions } from './command'; + +/** @public */ +export interface ValidateCollectionOptions extends Omit { + /** Validates a collection in the background, without interrupting read or write traffic */ + background?: boolean; +} + +/** @internal */ +export class ValidateCollectionOperation extends CommandOperation { + override SERVER_COMMAND_RESPONSE_TYPE = MongoDBResponse; + override options: ValidateCollectionOptions; + collectionName: string; + + constructor(admin: Admin, collectionName: string, options: ValidateCollectionOptions) { + super(admin.s.db, options); + this.options = options; + this.collectionName = collectionName; + } + + override get commandName() { + return 'validate' as const; + } + + override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document { + // Decorate command with extra options + return { + validate: this.collectionName, + ...Object.fromEntries(Object.entries(this.options).filter(entry => entry[0] !== 'session')) + }; + } + + override handleOk(response: InstanceType): Document { + const result = super.handleOk(response); + if (result.result != null && typeof result.result !== 'string') + throw new MongoUnexpectedServerResponseError('Error with validation data'); + if (result.result != null && result.result.match(/exception|corrupt/) != null) + throw new MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`); + if (result.valid != null && !result.valid) + throw new MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`); + + return response; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_concern.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_concern.ts new file mode 100644 index 00000000..1118c377 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_concern.ts @@ -0,0 +1,88 @@ +import type { Document } from './bson'; + +/** @public */ +export const ReadConcernLevel = Object.freeze({ + local: 'local', + majority: 'majority', + linearizable: 'linearizable', + available: 'available', + snapshot: 'snapshot' +} as const); + +/** @public */ +export type ReadConcernLevel = (typeof ReadConcernLevel)[keyof typeof ReadConcernLevel]; + +/** @public */ +export type ReadConcernLike = ReadConcern | { level: ReadConcernLevel } | ReadConcernLevel; + +/** + * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties + * of the data read from replica sets and replica set shards. + * @public + * + * @see https://www.mongodb.com/docs/manual/reference/read-concern/index.html + */ +export class ReadConcern { + level: ReadConcernLevel | string; + + /** Constructs a ReadConcern from the read concern level.*/ + constructor(level: ReadConcernLevel) { + /** + * A spec test exists that allows level to be any string. + * "invalid readConcern with out stage" + * @see ./test/spec/crud/v2/aggregate-out-readConcern.json + * @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.md#unknown-levels-and-additional-options-for-string-based-readconcerns + */ + this.level = ReadConcernLevel[level] ?? level; + } + + /** + * Construct a ReadConcern given an options object. + * + * @param options - The options object from which to extract the write concern. + */ + static fromOptions(options?: { + readConcern?: ReadConcernLike; + level?: ReadConcernLevel; + }): ReadConcern | undefined { + if (options == null) { + return; + } + + if (options.readConcern) { + const { readConcern } = options; + if (readConcern instanceof ReadConcern) { + return readConcern; + } else if (typeof readConcern === 'string') { + return new ReadConcern(readConcern); + } else if ('level' in readConcern && readConcern.level) { + return new ReadConcern(readConcern.level); + } + } + + if (options.level) { + return new ReadConcern(options.level); + } + return; + } + + static get MAJORITY(): 'majority' { + return ReadConcernLevel.majority; + } + + static get AVAILABLE(): 'available' { + return ReadConcernLevel.available; + } + + static get LINEARIZABLE(): 'linearizable' { + return ReadConcernLevel.linearizable; + } + + static get SNAPSHOT(): 'snapshot' { + return ReadConcernLevel.snapshot; + } + + toJSON(): Document { + return { level: this.level }; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_preference.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_preference.ts new file mode 100644 index 00000000..0ca9c675 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/read_preference.ts @@ -0,0 +1,256 @@ +import type { Document } from './bson'; +import { MongoInvalidArgumentError } from './error'; +import type { TagSet } from './sdam/server_description'; +import type { ClientSession } from './sessions'; + +/** @public */ +export type ReadPreferenceLike = ReadPreference | ReadPreferenceMode; + +/** @public */ +export const ReadPreferenceMode = Object.freeze({ + primary: 'primary', + primaryPreferred: 'primaryPreferred', + secondary: 'secondary', + secondaryPreferred: 'secondaryPreferred', + nearest: 'nearest' +} as const); + +/** @public */ +export type ReadPreferenceMode = (typeof ReadPreferenceMode)[keyof typeof ReadPreferenceMode]; + +/** @public */ +export interface HedgeOptions { + /** Explicitly enable or disable hedged reads. */ + enabled?: boolean; +} + +/** @public */ +export interface ReadPreferenceOptions { + /** Max secondary read staleness in seconds, Minimum value is 90 seconds.*/ + maxStalenessSeconds?: number; + /** Server mode in which the same query is dispatched in parallel to multiple replica set members. */ + hedge?: HedgeOptions; +} + +/** @public */ +export interface ReadPreferenceLikeOptions extends ReadPreferenceOptions { + readPreference?: + | ReadPreferenceLike + | { + mode?: ReadPreferenceMode; + preference?: ReadPreferenceMode; + tags?: TagSet[]; + maxStalenessSeconds?: number; + }; +} + +/** @public */ +export interface ReadPreferenceFromOptions extends ReadPreferenceLikeOptions { + session?: ClientSession; + readPreferenceTags?: TagSet[]; + hedge?: HedgeOptions; +} + +/** + * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is + * used to construct connections. + * @public + * + * @see https://www.mongodb.com/docs/manual/core/read-preference/ + */ +export class ReadPreference { + mode: ReadPreferenceMode; + tags?: TagSet[]; + hedge?: HedgeOptions; + maxStalenessSeconds?: number; + + public static PRIMARY = ReadPreferenceMode.primary; + public static PRIMARY_PREFERRED = ReadPreferenceMode.primaryPreferred; + public static SECONDARY = ReadPreferenceMode.secondary; + public static SECONDARY_PREFERRED = ReadPreferenceMode.secondaryPreferred; + public static NEAREST = ReadPreferenceMode.nearest; + + public static primary = new ReadPreference(ReadPreferenceMode.primary); + public static primaryPreferred = new ReadPreference(ReadPreferenceMode.primaryPreferred); + public static secondary = new ReadPreference(ReadPreferenceMode.secondary); + public static secondaryPreferred = new ReadPreference(ReadPreferenceMode.secondaryPreferred); + public static nearest = new ReadPreference(ReadPreferenceMode.nearest); + + /** + * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest) + * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary. + * @param options - Additional read preference options + */ + constructor(mode: ReadPreferenceMode, tags?: TagSet[], options?: ReadPreferenceOptions) { + if (!ReadPreference.isValid(mode)) { + throw new MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(mode)}`); + } + if (options == null && typeof tags === 'object' && !Array.isArray(tags)) { + options = tags; + tags = undefined; + } else if (tags && !Array.isArray(tags)) { + throw new MongoInvalidArgumentError('ReadPreference tags must be an array'); + } + + this.mode = mode; + this.tags = tags; + this.hedge = options?.hedge; + this.maxStalenessSeconds = undefined; + + options = options ?? {}; + if (options.maxStalenessSeconds != null) { + if (options.maxStalenessSeconds <= 0) { + throw new MongoInvalidArgumentError('maxStalenessSeconds must be a positive integer'); + } + + this.maxStalenessSeconds = options.maxStalenessSeconds; + } + + if (this.mode === ReadPreference.PRIMARY) { + if (this.tags && Array.isArray(this.tags) && this.tags.length > 0) { + throw new MongoInvalidArgumentError('Primary read preference cannot be combined with tags'); + } + + if (this.maxStalenessSeconds) { + throw new MongoInvalidArgumentError( + 'Primary read preference cannot be combined with maxStalenessSeconds' + ); + } + + if (this.hedge) { + throw new MongoInvalidArgumentError( + 'Primary read preference cannot be combined with hedge' + ); + } + } + } + + // Support the deprecated `preference` property introduced in the porcelain layer + get preference(): ReadPreferenceMode { + return this.mode; + } + + static fromString(mode: string): ReadPreference { + return new ReadPreference(mode as ReadPreferenceMode); + } + + /** + * Construct a ReadPreference given an options object. + * + * @param options - The options object from which to extract the read preference. + */ + static fromOptions(options?: ReadPreferenceFromOptions): ReadPreference | undefined { + if (!options) return; + const readPreference = + options.readPreference ?? options.session?.transaction.options.readPreference; + const readPreferenceTags = options.readPreferenceTags; + + if (readPreference == null) { + return; + } + + if (typeof readPreference === 'string') { + return new ReadPreference(readPreference, readPreferenceTags, { + maxStalenessSeconds: options.maxStalenessSeconds, + hedge: options.hedge + }); + } else if (!(readPreference instanceof ReadPreference) && typeof readPreference === 'object') { + const mode = readPreference.mode || readPreference.preference; + if (mode && typeof mode === 'string') { + return new ReadPreference(mode, readPreference.tags ?? readPreferenceTags, { + maxStalenessSeconds: readPreference.maxStalenessSeconds, + hedge: options.hedge + }); + } + } + + if (readPreferenceTags) { + readPreference.tags = readPreferenceTags; + } + + return readPreference as ReadPreference; + } + + /** + * Replaces options.readPreference with a ReadPreference instance + */ + static translate(options: ReadPreferenceLikeOptions): ReadPreferenceLikeOptions { + if (options.readPreference == null) return options; + const r = options.readPreference; + + if (typeof r === 'string') { + options.readPreference = new ReadPreference(r); + } else if (r && !(r instanceof ReadPreference) && typeof r === 'object') { + const mode = r.mode || r.preference; + if (mode && typeof mode === 'string') { + options.readPreference = new ReadPreference(mode, r.tags, { + maxStalenessSeconds: r.maxStalenessSeconds + }); + } + } else if (!(r instanceof ReadPreference)) { + throw new MongoInvalidArgumentError(`Invalid read preference: ${r}`); + } + + return options; + } + + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + static isValid(mode: string): boolean { + const VALID_MODES = new Set([ + ReadPreference.PRIMARY, + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST, + null + ]); + + return VALID_MODES.has(mode as ReadPreferenceMode); + } + + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + isValid(mode?: string): boolean { + return ReadPreference.isValid(typeof mode === 'string' ? mode : this.mode); + } + + /** + * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire + * @see https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op-query + */ + secondaryOk(): boolean { + const NEEDS_SECONDARYOK = new Set([ + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST + ]); + + return NEEDS_SECONDARYOK.has(this.mode); + } + + /** + * Check if the two ReadPreferences are equivalent + * + * @param readPreference - The read preference with which to check equality + */ + equals(readPreference: ReadPreference): boolean { + return readPreference.mode === this.mode; + } + + /** Return JSON representation */ + toJSON(): Document { + const readPreference = { mode: this.mode } as Document; + if (Array.isArray(this.tags)) readPreference.tags = this.tags; + if (this.maxStalenessSeconds) readPreference.maxStalenessSeconds = this.maxStalenessSeconds; + if (this.hedge) readPreference.hedge = this.hedge; + return readPreference; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/runtime_adapters.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/runtime_adapters.ts new file mode 100644 index 00000000..9bd03254 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/runtime_adapters.ts @@ -0,0 +1,65 @@ +/* eslint-disable no-restricted-imports*/ + +// We squash the restricted import errors here: the module-scope imports are type-only, and the +// one runtime dependency this file takes — the dynamic `import('os')` fallback in +// resolveRuntimeAdapters — is deliberate: this file is expected to be the only place that loads +// restricted Node APIs at runtime. + +import type * as os from 'os'; + +import { type MongoClientOptions } from './mongo_client'; + +/** + * @internal + * + * Legacy escape hatch for the test sandbox's restricted `require`: the driver no longer sets this + * property (the os adapter loads via dynamic `import()`), but the vm test harness + * still checks it. Kept until the sandbox contract is revisited in a follow-up. + */ +export const ALLOWED_DRIVER_REQUIRE_PROPERTY_NAME = 'allowedDriverRequire'; + +/** + * @public + * @experimental + * + * Represents the set of dependencies that the driver uses from the [Node.js OS module](https://nodejs.org/api/os.html). + */ +export type OsAdapter = Pick; + +/** + * @public + * @experimental + * + * This type represents the set of dependencies that the driver needs from the Javascript runtime in order to function. + */ +export interface RuntimeAdapters { + os?: OsAdapter; +} + +/** + * @internal + * + * Represents a complete, parsed set of runtime adapters. After options parsing, all adapters + * are always present (either using the user's provided adapter, or defaulting to the Node.js module). + */ +export interface Runtime { + os: OsAdapter; +} + +/** + * @internal + * + * Given a MongoClientOptions, this function resolves the set of runtime options, providing Nodejs + * implementations if not provided in `options`, and returns a `Runtime`. + * + * Resolution is asynchronous because the default `os` adapter is loaded via a dynamic `import()`. + * Unlike `require`, dynamic import exists in every module system the driver ships into or is + * bundled into (CJS, ESM, and bundled ESM output), and the literal specifier keeps it + * statically analyzable for bundlers. The promise is created during synchronous + * options parsing and awaited later by consumers, so the public constructor stays synchronous. + */ +export async function resolveRuntimeAdapters(options: MongoClientOptions): Promise { + return { + os: options.runtimeAdapters?.os ?? (await import('os')) + }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/common.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/common.ts new file mode 100644 index 00000000..97411485 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/common.ts @@ -0,0 +1,74 @@ +import type { Binary, Long, Timestamp } from '../bson'; +import type { ClientSession } from '../sessions'; +import type { Topology } from './topology'; + +// shared state names +export const STATE_CLOSING = 'closing'; +export const STATE_CLOSED = 'closed'; +export const STATE_CONNECTING = 'connecting'; +export const STATE_CONNECTED = 'connected'; + +/** + * An enumeration of topology types we know about + * @public + */ +export const TopologyType = Object.freeze({ + Single: 'Single', + ReplicaSetNoPrimary: 'ReplicaSetNoPrimary', + ReplicaSetWithPrimary: 'ReplicaSetWithPrimary', + Sharded: 'Sharded', + Unknown: 'Unknown', + LoadBalanced: 'LoadBalanced' +} as const); + +/** @public */ +export type TopologyType = (typeof TopologyType)[keyof typeof TopologyType]; + +/** + * An enumeration of server types we know about + * @public + */ +export const ServerType = Object.freeze({ + Standalone: 'Standalone', + Mongos: 'Mongos', + PossiblePrimary: 'PossiblePrimary', + RSPrimary: 'RSPrimary', + RSSecondary: 'RSSecondary', + RSArbiter: 'RSArbiter', + RSOther: 'RSOther', + RSGhost: 'RSGhost', + Unknown: 'Unknown', + LoadBalancer: 'LoadBalancer' +} as const); + +/** @public */ +export type ServerType = (typeof ServerType)[keyof typeof ServerType]; + +/** + * @public + * Gossiped in component for the cluster time tracking the state of user databases + * across the cluster. It may optionally include a signature identifying the process that + * generated such a value. + */ +export interface ClusterTime { + clusterTime: Timestamp; + /** Used to validate the identity of a request or response's ClusterTime. */ + signature?: { + hash: Binary; + keyId: Long; + }; +} + +/** Shared function to determine clusterTime for a given topology or session */ +export function _advanceClusterTime( + entity: Topology | ClientSession, + $clusterTime: ClusterTime +): void { + if (entity.clusterTime == null) { + entity.clusterTime = $clusterTime; + } else { + if ($clusterTime.clusterTime.greaterThan(entity.clusterTime.clusterTime)) { + entity.clusterTime = $clusterTime; + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/events.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/events.ts new file mode 100644 index 00000000..64cb6ffb --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/events.ts @@ -0,0 +1,219 @@ +import type { Document } from '../bson'; +import { + SERVER_CLOSED, + SERVER_DESCRIPTION_CHANGED, + SERVER_HEARTBEAT_FAILED, + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED, + SERVER_OPENING, + TOPOLOGY_CLOSED, + TOPOLOGY_DESCRIPTION_CHANGED, + TOPOLOGY_OPENING +} from '../constants'; +import type { ServerDescription } from './server_description'; +import type { TopologyDescription } from './topology_description'; + +/** + * Emitted when server description changes, but does NOT include changes to the RTT. + * @public + * @category Event + */ +export class ServerDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /** The previous server description */ + previousDescription: ServerDescription; + /** The new server description */ + newDescription: ServerDescription; + name = SERVER_DESCRIPTION_CHANGED; + + /** @internal */ + constructor( + topologyId: number, + address: string, + previousDescription: ServerDescription, + newDescription: ServerDescription + ) { + this.topologyId = topologyId; + this.address = address; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} + +/** + * Emitted when server is initialized. + * @public + * @category Event + */ +export class ServerOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /** @internal */ + name = SERVER_OPENING; + + /** @internal */ + constructor(topologyId: number, address: string) { + this.topologyId = topologyId; + this.address = address; + } +} + +/** + * Emitted when server is closed. + * @public + * @category Event + */ +export class ServerClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /** @internal */ + name = SERVER_CLOSED; + + /** @internal */ + constructor(topologyId: number, address: string) { + this.topologyId = topologyId; + this.address = address; + } +} + +/** + * Emitted when topology description changes. + * @public + * @category Event + */ +export class TopologyDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The old topology description */ + previousDescription: TopologyDescription; + /** The new topology description */ + newDescription: TopologyDescription; + /** @internal */ + name = TOPOLOGY_DESCRIPTION_CHANGED; + + /** @internal */ + constructor( + topologyId: number, + previousDescription: TopologyDescription, + newDescription: TopologyDescription + ) { + this.topologyId = topologyId; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} + +/** + * Emitted when topology is initialized. + * @public + * @category Event + */ +export class TopologyOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** @internal */ + name = TOPOLOGY_OPENING; + + /** @internal */ + constructor(topologyId: number) { + this.topologyId = topologyId; + } +} + +/** + * Emitted when topology is closed. + * @public + * @category Event + */ +export class TopologyClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** @internal */ + name = TOPOLOGY_CLOSED; + + /** @internal */ + constructor(topologyId: number) { + this.topologyId = topologyId; + } +} + +/** + * Emitted when the server monitor’s hello command is started - immediately before + * the hello command is serialized into raw BSON and written to the socket. + * + * @public + * @category Event + */ +export class ServerHeartbeatStartedEvent { + /** The connection id for the command */ + connectionId: string; + /** Is true when using the streaming protocol */ + awaited: boolean; + /** @internal */ + name = SERVER_HEARTBEAT_STARTED; + + /** @internal */ + constructor(connectionId: string, awaited: boolean) { + this.connectionId = connectionId; + this.awaited = awaited; + } +} + +/** + * Emitted when the server monitor’s hello succeeds. + * @public + * @category Event + */ +export class ServerHeartbeatSucceededEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command reply */ + reply: Document; + /** Is true when using the streaming protocol */ + awaited: boolean; + /** @internal */ + name = SERVER_HEARTBEAT_SUCCEEDED; + + /** @internal */ + constructor(connectionId: string, duration: number, reply: Document | null, awaited: boolean) { + this.connectionId = connectionId; + this.duration = duration; + this.reply = reply ?? {}; + this.awaited = awaited; + } +} + +/** + * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception. + * @public + * @category Event + */ +export class ServerHeartbeatFailedEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command failure */ + failure: Error; + /** Is true when using the streaming protocol */ + awaited: boolean; + /** @internal */ + name = SERVER_HEARTBEAT_FAILED; + + /** @internal */ + constructor(connectionId: string, duration: number, failure: Error, awaited: boolean) { + this.connectionId = connectionId; + this.duration = duration; + this.failure = failure; + this.awaited = awaited; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/monitor.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/monitor.ts new file mode 100644 index 00000000..e5b4a32a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/monitor.ts @@ -0,0 +1,771 @@ +import { clearTimeout, setTimeout } from 'timers'; + +import { type Document, Long } from '../bson'; +import { connect, makeConnection, makeSocket, performInitialHandshake } from '../cmap/connect'; +import type { Connection, ConnectionOptions } from '../cmap/connection'; +import { getFAASEnv } from '../cmap/handshake/client_metadata'; +import { LEGACY_HELLO_COMMAND } from '../constants'; +import { MongoError, MongoErrorLabel, MongoNetworkTimeoutError } from '../error'; +import { MongoLoggableComponent } from '../mongo_logger'; +import { CancellationToken, TypedEventEmitter } from '../mongo_types'; +import { + calculateDurationInMs, + type Callback, + type EventEmitterWithState, + makeStateMachine, + noop, + ns, + processTimeMS +} from '../utils'; +import { ServerType, STATE_CLOSED, STATE_CLOSING } from './common'; +import { + ServerHeartbeatFailedEvent, + ServerHeartbeatStartedEvent, + ServerHeartbeatSucceededEvent +} from './events'; +import { Server } from './server'; +import type { TopologyVersion } from './server_description'; + +const STATE_IDLE = 'idle'; +const STATE_MONITORING = 'monitoring'; +const stateTransition = makeStateMachine({ + [STATE_CLOSING]: [STATE_CLOSING, STATE_IDLE, STATE_CLOSED], + [STATE_CLOSED]: [STATE_CLOSED, STATE_MONITORING], + [STATE_IDLE]: [STATE_IDLE, STATE_MONITORING, STATE_CLOSING], + [STATE_MONITORING]: [STATE_MONITORING, STATE_IDLE, STATE_CLOSING] +}); + +const INVALID_REQUEST_CHECK_STATES = new Set([STATE_CLOSING, STATE_CLOSED, STATE_MONITORING]); +function isInCloseState(monitor: Monitor) { + return monitor.s.state === STATE_CLOSED || monitor.s.state === STATE_CLOSING; +} + +/** @public */ +export const ServerMonitoringMode = Object.freeze({ + auto: 'auto', + poll: 'poll', + stream: 'stream' +} as const); + +/** @public */ +export type ServerMonitoringMode = (typeof ServerMonitoringMode)[keyof typeof ServerMonitoringMode]; + +/** @internal */ +export interface MonitorPrivate { + state: string; +} + +/** @public */ +export interface MonitorOptions + extends Omit { + connectTimeoutMS: number; + heartbeatFrequencyMS: number; + minHeartbeatFrequencyMS: number; + serverMonitoringMode: ServerMonitoringMode; +} + +/** @public */ +export type MonitorEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + resetServer(error?: MongoError): void; + resetConnectionPool(): void; + close(): void; +} & EventEmitterWithState; + +/** @internal */ +export class Monitor extends TypedEventEmitter { + /** @internal */ + s: MonitorPrivate; + address: string; + options: Readonly< + Pick< + MonitorOptions, + | 'connectTimeoutMS' + | 'heartbeatFrequencyMS' + | 'minHeartbeatFrequencyMS' + | 'serverMonitoringMode' + > + >; + connectOptions: ConnectionOptions; + isRunningInFaasEnv: boolean; + server: Server; + connection: Connection | null; + cancellationToken: CancellationToken; + /** @internal */ + monitorId?: MonitorInterval; + rttPinger?: RTTPinger; + /** @internal */ + override component = MongoLoggableComponent.TOPOLOGY; + /** @internal */ + private rttSampler: RTTSampler; + + constructor(server: Server, options: MonitorOptions) { + super(); + this.on('error', noop); + + this.server = server; + this.connection = null; + this.cancellationToken = new CancellationToken(); + this.cancellationToken.setMaxListeners(Infinity); + this.monitorId = undefined; + this.s = { + state: STATE_CLOSED + }; + this.address = server.description.address; + this.options = Object.freeze({ + connectTimeoutMS: options.connectTimeoutMS ?? 10000, + heartbeatFrequencyMS: options.heartbeatFrequencyMS ?? 10000, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS ?? 500, + serverMonitoringMode: options.serverMonitoringMode + }); + this.isRunningInFaasEnv = getFAASEnv() != null; + this.mongoLogger = this.server.topology.client?.mongoLogger; + this.rttSampler = new RTTSampler(10); + + const cancellationToken = this.cancellationToken; + // TODO: refactor this to pull it directly from the pool, requires new ConnectionPool integration + const connectOptions = { + id: '' as const, + generation: server.pool.generation, + cancellationToken, + hostAddress: server.description.hostAddress, + ...options, + // force BSON serialization options + raw: false, + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: true + }; + + // ensure no authentication is used for monitoring + delete connectOptions.credentials; + if (connectOptions.autoEncrypter) { + delete connectOptions.autoEncrypter; + } + + this.connectOptions = Object.freeze(connectOptions); + } + + connect(): void { + if (this.s.state !== STATE_CLOSED) { + return; + } + + // start + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this.monitorId = new MonitorInterval(monitorServer(this), { + heartbeatFrequencyMS: heartbeatFrequencyMS, + minHeartbeatFrequencyMS: minHeartbeatFrequencyMS, + immediate: true + }); + } + + requestCheck(): void { + if (INVALID_REQUEST_CHECK_STATES.has(this.s.state)) { + return; + } + + this.monitorId?.wake(); + } + + reset(): void { + const topologyVersion = this.server.description.topologyVersion; + if (isInCloseState(this) || topologyVersion == null) { + return; + } + + stateTransition(this, STATE_CLOSING); + resetMonitorState(this); + + // restart monitor + stateTransition(this, STATE_IDLE); + + // restart monitoring + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this.monitorId = new MonitorInterval(monitorServer(this), { + heartbeatFrequencyMS: heartbeatFrequencyMS, + minHeartbeatFrequencyMS: minHeartbeatFrequencyMS + }); + } + + close(): void { + if (isInCloseState(this)) { + return; + } + + stateTransition(this, STATE_CLOSING); + resetMonitorState(this); + + // close monitor + this.emit('close'); + stateTransition(this, STATE_CLOSED); + } + + get roundTripTime(): number { + return this.rttSampler.average(); + } + + get minRoundTripTime(): number { + return this.rttSampler.min(); + } + + get latestRtt(): number | null { + return this.rttSampler.last; + } + + addRttSample(rtt: number) { + this.rttSampler.addSample(rtt); + } + + clearRttSamples() { + this.rttSampler.clear(); + } +} + +function resetMonitorState(monitor: Monitor) { + monitor.monitorId?.stop(); + monitor.monitorId = undefined; + + monitor.rttPinger?.close(); + monitor.rttPinger = undefined; + + monitor.cancellationToken.emit('cancel'); + + monitor.connection?.destroy(); + monitor.connection = null; + + monitor.clearRttSamples(); +} + +function useStreamingProtocol(monitor: Monitor, topologyVersion: TopologyVersion | null): boolean { + // If we have no topology version we always poll no matter + // what the user provided, since the server does not support + // the streaming protocol. + if (topologyVersion == null) return false; + + const serverMonitoringMode = monitor.options.serverMonitoringMode; + if (serverMonitoringMode === ServerMonitoringMode.poll) return false; + if (serverMonitoringMode === ServerMonitoringMode.stream) return true; + + // If we are in auto mode, we need to figure out if we're in a FaaS + // environment or not and choose the appropriate mode. + if (monitor.isRunningInFaasEnv) return false; + return true; +} + +function checkServer(monitor: Monitor, callback: Callback) { + let start: number; + let awaited: boolean; + const topologyVersion = monitor.server.description.topologyVersion; + const isAwaitable = useStreamingProtocol(monitor, topologyVersion); + monitor.emitAndLogHeartbeat( + Server.SERVER_HEARTBEAT_STARTED, + monitor.server.topology.s.id, + undefined, + new ServerHeartbeatStartedEvent(monitor.address, isAwaitable) + ); + + function onHeartbeatFailed(err: Error) { + monitor.connection?.destroy(); + monitor.connection = null; + monitor.emitAndLogHeartbeat( + Server.SERVER_HEARTBEAT_FAILED, + monitor.server.topology.s.id, + undefined, + new ServerHeartbeatFailedEvent(monitor.address, calculateDurationInMs(start), err, awaited) + ); + + const error = !(err instanceof MongoError) + ? new MongoError(MongoError.buildErrorMessage(err), { cause: err }) + : err; + error.addErrorLabel(MongoErrorLabel.ResetPool); + if (error instanceof MongoNetworkTimeoutError) { + error.addErrorLabel(MongoErrorLabel.InterruptInUseConnections); + } + + monitor.emit('resetServer', error); + callback(err); + } + + function onHeartbeatSucceeded(hello: Document) { + if (!('isWritablePrimary' in hello)) { + // Provide hello-style response document. + hello.isWritablePrimary = hello[LEGACY_HELLO_COMMAND]; + } + + // NOTE: here we use the latestRtt as this measurement corresponds with the value + // obtained for this successful heartbeat, if there is no latestRtt, then we calculate the + // duration + const duration = + isAwaitable && monitor.rttPinger + ? (monitor.rttPinger.latestRtt ?? calculateDurationInMs(start)) + : calculateDurationInMs(start); + + monitor.addRttSample(duration); + + monitor.emitAndLogHeartbeat( + Server.SERVER_HEARTBEAT_SUCCEEDED, + monitor.server.topology.s.id, + hello.connectionId, + new ServerHeartbeatSucceededEvent(monitor.address, duration, hello, isAwaitable) + ); + + if (isAwaitable) { + // If we are using the streaming protocol then we immediately issue another 'started' + // event, otherwise the "check" is complete and return to the main monitor loop + monitor.emitAndLogHeartbeat( + Server.SERVER_HEARTBEAT_STARTED, + monitor.server.topology.s.id, + undefined, + new ServerHeartbeatStartedEvent(monitor.address, true) + ); + // We have not actually sent an outgoing handshake, but when we get the next response we + // want the duration to reflect the time since we last heard from the server + start = processTimeMS(); + } else { + monitor.rttPinger?.close(); + monitor.rttPinger = undefined; + + callback(undefined, hello); + } + } + + const { connection } = monitor; + if (connection && !connection.closed) { + const { serverApi, helloOk } = connection; + const connectTimeoutMS = monitor.options.connectTimeoutMS; + const maxAwaitTimeMS = monitor.options.heartbeatFrequencyMS; + + const cmd = { + [serverApi?.version || helloOk ? 'hello' : LEGACY_HELLO_COMMAND]: 1, + ...(isAwaitable && topologyVersion + ? { maxAwaitTimeMS, topologyVersion: makeTopologyVersion(topologyVersion) } + : {}) + }; + + const options = isAwaitable + ? { + socketTimeoutMS: connectTimeoutMS ? connectTimeoutMS + maxAwaitTimeMS : 0, + exhaustAllowed: true + } + : { socketTimeoutMS: connectTimeoutMS }; + + if (isAwaitable && monitor.rttPinger == null) { + monitor.rttPinger = new RTTPinger(monitor); + } + + // Record new start time before sending handshake + start = processTimeMS(); + + if (isAwaitable) { + awaited = true; + return connection.exhaustCommand(ns('admin.$cmd'), cmd, options, (error, hello) => { + if (error) return onHeartbeatFailed(error); + return onHeartbeatSucceeded(hello); + }); + } + + awaited = false; + connection + .command(ns('admin.$cmd'), cmd, options) + .then(onHeartbeatSucceeded, onHeartbeatFailed); + + return; + } + + // connecting does an implicit `hello` + (async () => { + const socket = await makeSocket(monitor.connectOptions); + const connection = makeConnection(monitor.connectOptions, socket); + // The start time is after socket creation but before the handshake + start = processTimeMS(); + try { + await performInitialHandshake(connection, monitor.connectOptions); + return connection; + } catch (error) { + connection.destroy(); + throw error; + } + })().then( + connection => { + if (isInCloseState(monitor)) { + connection.destroy(); + return; + } + const duration = calculateDurationInMs(start); + monitor.addRttSample(duration); + + monitor.connection = connection; + monitor.emitAndLogHeartbeat( + Server.SERVER_HEARTBEAT_SUCCEEDED, + monitor.server.topology.s.id, + connection.hello?.connectionId, + new ServerHeartbeatSucceededEvent( + monitor.address, + duration, + connection.hello, + useStreamingProtocol(monitor, connection.hello?.topologyVersion) + ) + ); + + callback(undefined, connection.hello); + }, + error => { + monitor.connection = null; + awaited = false; + onHeartbeatFailed(error); + } + ); +} + +function monitorServer(monitor: Monitor) { + return (callback: Callback) => { + if (monitor.s.state === STATE_MONITORING) { + queueMicrotask(callback); + return; + } + stateTransition(monitor, STATE_MONITORING); + function done() { + if (!isInCloseState(monitor)) { + stateTransition(monitor, STATE_IDLE); + } + + callback(); + } + + checkServer(monitor, (err, hello) => { + if (err) { + // otherwise an error occurred on initial discovery, also bail + if (monitor.server.description.type === ServerType.Unknown) { + return done(); + } + } + + // if the check indicates streaming is supported, immediately reschedule monitoring + if (useStreamingProtocol(monitor, hello?.topologyVersion)) { + setTimeout(() => { + if (!isInCloseState(monitor)) { + monitor.monitorId?.wake(); + } + }, 0); + } + + done(); + }); + }; +} + +function makeTopologyVersion(tv: TopologyVersion) { + return { + processId: tv.processId, + // tests mock counter as just number, but in a real situation counter should always be a Long + // TODO(NODE-2674): Preserve int64 sent from MongoDB + counter: Long.isLong(tv.counter) ? tv.counter : Long.fromNumber(tv.counter) + }; +} + +/** @internal */ +export interface RTTPingerOptions extends ConnectionOptions { + heartbeatFrequencyMS: number; +} + +/** @internal */ +export class RTTPinger { + connection?: Connection; + /** @internal */ + cancellationToken: CancellationToken; + /** @internal */ + monitorId: NodeJS.Timeout; + /** @internal */ + monitor: Monitor; + closed: boolean; + /** @internal */ + latestRtt?: number; + + constructor(monitor: Monitor) { + this.connection = undefined; + this.cancellationToken = monitor.cancellationToken; + this.closed = false; + this.monitor = monitor; + this.latestRtt = monitor.latestRtt ?? undefined; + + const heartbeatFrequencyMS = monitor.options.heartbeatFrequencyMS; + this.monitorId = setTimeout(() => this.measureRoundTripTime(), heartbeatFrequencyMS); + } + + get roundTripTime(): number { + return this.monitor.roundTripTime; + } + + get minRoundTripTime(): number { + return this.monitor.minRoundTripTime; + } + + close(): void { + this.closed = true; + clearTimeout(this.monitorId); + + this.connection?.destroy(); + this.connection = undefined; + } + + private measureAndReschedule(start: number, conn?: Connection) { + if (this.closed) { + conn?.destroy(); + return; + } + + if (this.connection == null) { + this.connection = conn; + } + + this.latestRtt = calculateDurationInMs(start); + this.monitorId = setTimeout( + () => this.measureRoundTripTime(), + this.monitor.options.heartbeatFrequencyMS + ); + } + + private measureRoundTripTime() { + const start = processTimeMS(); + + if (this.closed) { + return; + } + + const connection = this.connection; + if (connection == null) { + connect(this.monitor.connectOptions).then( + connection => { + this.measureAndReschedule(start, connection); + }, + () => { + this.connection = undefined; + } + ); + return; + } + + const commandName = + connection.serverApi?.version || connection.helloOk ? 'hello' : LEGACY_HELLO_COMMAND; + + connection.command(ns('admin.$cmd'), { [commandName]: 1 }, undefined).then( + () => this.measureAndReschedule(start), + () => { + this.connection?.destroy(); + this.connection = undefined; + return; + } + ); + } +} + +/** + * @internal + */ +export interface MonitorIntervalOptions { + /** The interval to execute a method on */ + heartbeatFrequencyMS: number; + /** A minimum interval that must elapse before the method is called */ + minHeartbeatFrequencyMS: number; + /** Whether the method should be called immediately when the interval is started */ + immediate: boolean; +} + +/** + * @internal + */ +export class MonitorInterval { + fn: (callback: Callback) => void; + timerId: NodeJS.Timeout | undefined; + lastExecutionEnded: number; + isExpeditedCallToFnScheduled = false; + stopped = false; + isExecutionInProgress = false; + hasExecutedOnce = false; + + heartbeatFrequencyMS: number; + minHeartbeatFrequencyMS: number; + + constructor(fn: (callback: Callback) => void, options: Partial = {}) { + this.fn = fn; + this.lastExecutionEnded = -Infinity; + + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 1000; + this.minHeartbeatFrequencyMS = options.minHeartbeatFrequencyMS ?? 500; + + if (options.immediate) { + this._executeAndReschedule(); + } else { + this._reschedule(undefined); + } + } + + wake() { + const currentTime = processTimeMS(); + const timeSinceLastCall = currentTime - this.lastExecutionEnded; + + // TODO(NODE-4674): Add error handling and logging to the monitor + if (timeSinceLastCall < 0) { + return this._executeAndReschedule(); + } + + if (this.isExecutionInProgress) { + return; + } + + // debounce multiple calls to wake within the `minInterval` + if (this.isExpeditedCallToFnScheduled) { + return; + } + + // reschedule a call as soon as possible, ensuring the call never happens + // faster than the `minInterval` + if (timeSinceLastCall < this.minHeartbeatFrequencyMS) { + this.isExpeditedCallToFnScheduled = true; + this._reschedule(this.minHeartbeatFrequencyMS - timeSinceLastCall); + return; + } + + this._executeAndReschedule(); + } + + stop() { + this.stopped = true; + if (this.timerId) { + clearTimeout(this.timerId); + this.timerId = undefined; + } + + this.lastExecutionEnded = -Infinity; + this.isExpeditedCallToFnScheduled = false; + } + + toString() { + return JSON.stringify(this); + } + + toJSON() { + const currentTime = processTimeMS(); + const timeSinceLastCall = currentTime - this.lastExecutionEnded; + return { + timerId: this.timerId != null ? 'set' : 'cleared', + lastCallTime: this.lastExecutionEnded, + isExpeditedCheckScheduled: this.isExpeditedCallToFnScheduled, + stopped: this.stopped, + heartbeatFrequencyMS: this.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: this.minHeartbeatFrequencyMS, + currentTime, + timeSinceLastCall + }; + } + + private _reschedule(ms?: number) { + if (this.stopped) return; + if (this.timerId) { + clearTimeout(this.timerId); + } + + this.timerId = setTimeout(this._executeAndReschedule, ms || this.heartbeatFrequencyMS); + } + + private _executeAndReschedule = () => { + if (this.stopped) return; + if (this.timerId) { + clearTimeout(this.timerId); + } + + this.isExpeditedCallToFnScheduled = false; + this.isExecutionInProgress = true; + + this.fn(() => { + this.lastExecutionEnded = processTimeMS(); + this.isExecutionInProgress = false; + this._reschedule(this.heartbeatFrequencyMS); + }); + }; +} + +/** @internal + * This class implements the RTT sampling logic specified for [CSOT](https://github.com/mongodb/specifications/blob/bbb335e60cd7ea1e0f7cd9a9443cb95fc9d3b64d/source/client-side-operations-timeout/client-side-operations-timeout.md#drivers-use-minimum-rtt-to-short-circuit-operations) + * + * This is implemented as a [circular buffer](https://en.wikipedia.org/wiki/Circular_buffer) keeping + * the most recent `windowSize` samples + * */ +export class RTTSampler { + /** Index of the next slot to be overwritten */ + private writeIndex: number; + private length: number; + private rttSamples: Float64Array; + + constructor(windowSize = 10) { + this.rttSamples = new Float64Array(windowSize); + this.length = 0; + this.writeIndex = 0; + } + + /** + * Adds an rtt sample to the end of the circular buffer + * When `windowSize` samples have been collected, `addSample` overwrites the least recently added + * sample + */ + addSample(sample: number) { + this.rttSamples[this.writeIndex++] = sample; + if (this.length < this.rttSamples.length) { + this.length++; + } + + this.writeIndex %= this.rttSamples.length; + } + + /** + * When \< 2 samples have been collected, returns 0 + * Otherwise computes the minimum value samples contained in the buffer + */ + min(): number { + if (this.length < 2) return 0; + let min = this.rttSamples[0]; + for (let i = 1; i < this.length; i++) { + if (this.rttSamples[i] < min) min = this.rttSamples[i]; + } + + return min; + } + + /** + * Returns mean of samples contained in the buffer + */ + average(): number { + if (this.length === 0) return 0; + let sum = 0; + for (let i = 0; i < this.length; i++) { + sum += this.rttSamples[i]; + } + + return sum / this.length; + } + + /** + * Returns most recently inserted element in the buffer + * Returns null if the buffer is empty + * */ + get last(): number | null { + if (this.length === 0) return null; + return this.rttSamples[this.writeIndex === 0 ? this.length - 1 : this.writeIndex - 1]; + } + + /** + * Clear the buffer + * NOTE: this does not overwrite the data held in the internal array, just the pointers into + * this array + */ + clear() { + this.length = 0; + this.writeIndex = 0; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server.ts new file mode 100644 index 00000000..45c1c412 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server.ts @@ -0,0 +1,595 @@ +import type { Document } from '../bson'; +import { type AutoEncrypter } from '../client-side-encryption/auto_encrypter'; +import { type CommandOptions, Connection } from '../cmap/connection'; +import { + ConnectionPool, + type ConnectionPoolEvents, + type ConnectionPoolOptions +} from '../cmap/connection_pool'; +import { PoolClearedError } from '../cmap/errors'; +import { + APM_EVENTS, + CLOSED, + CMAP_EVENTS, + CONNECT, + DESCRIPTION_RECEIVED, + ENDED, + HEARTBEAT_EVENTS, + SERVER_HEARTBEAT_FAILED, + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED +} from '../constants'; +import { + type AnyError, + isNodeShuttingDownError, + isStateChangeError, + MONGODB_ERROR_CODES, + MongoError, + MongoErrorLabel, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoParseError, + MongoRuntimeError, + MongoServerClosedError, + type MongoServerError, + needsRetryableWriteLabel +} from '../error'; +import type { ServerApi } from '../mongo_client'; +import { type Abortable, TypedEventEmitter } from '../mongo_types'; +import { AggregateOperation } from '../operations/aggregate'; +import type { GetMoreOptions } from '../operations/get_more'; +import { type AbstractOperation } from '../operations/operation'; +import type { ClientSession } from '../sessions'; +import { type TimeoutContext } from '../timeout'; +import { isTransactionCommand } from '../transactions'; +import { + abortable, + type EventEmitterWithState, + makeStateMachine, + maxWireVersion, + noop, + squashError, + supportsRetryableWrites +} from '../utils'; +import { throwIfWriteConcernError } from '../write_concern'; +import { + type ClusterTime, + STATE_CLOSED, + STATE_CLOSING, + STATE_CONNECTED, + STATE_CONNECTING, + TopologyType +} from './common'; +import type { + ServerHeartbeatFailedEvent, + ServerHeartbeatStartedEvent, + ServerHeartbeatSucceededEvent +} from './events'; +import { Monitor, type MonitorOptions } from './monitor'; +import { compareTopologyVersion, ServerDescription } from './server_description'; +import { MIN_SECONDARY_WRITE_WIRE_VERSION } from './server_selection'; +import type { Topology } from './topology'; + +const stateTransition = makeStateMachine({ + [STATE_CLOSED]: [STATE_CLOSED, STATE_CONNECTING], + [STATE_CONNECTING]: [STATE_CONNECTING, STATE_CLOSING, STATE_CONNECTED, STATE_CLOSED], + [STATE_CONNECTED]: [STATE_CONNECTED, STATE_CLOSING, STATE_CLOSED], + [STATE_CLOSING]: [STATE_CLOSING, STATE_CLOSED] +}); + +/** @internal */ +export type ServerOptions = Omit & + MonitorOptions; + +/** @internal */ +export interface ServerPrivate { + /** The server description for this server */ + description: ServerDescription; + /** A copy of the options used to construct this instance */ + options: ServerOptions; + /** The current state of the Server */ + state: string; + /** MongoDB server API version */ + serverApi?: ServerApi; + /** A count of the operations currently running against the server. */ + operationCount: number; +} + +/** @public */ +export type ServerEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + /** Top level MongoClient doesn't emit this so it is marked: @internal */ + connect(server: Server): void; + descriptionReceived(description: ServerDescription): void; + closed(): void; + ended(): void; +} & ConnectionPoolEvents & + EventEmitterWithState; + +/** @internal */ +export type ServerCommandOptions = Omit & { + timeoutContext: TimeoutContext; + returnFieldSelector?: Document | null; +} & Abortable; + +/** @internal */ +export class Server extends TypedEventEmitter { + /** @internal */ + s: ServerPrivate; + /** @internal */ + topology: Topology; + /** @internal */ + pool: ConnectionPool; + serverApi?: ServerApi; + hello?: Document; + monitor: Monitor | null; + + /** @event */ + static readonly SERVER_HEARTBEAT_STARTED = SERVER_HEARTBEAT_STARTED; + /** @event */ + static readonly SERVER_HEARTBEAT_SUCCEEDED = SERVER_HEARTBEAT_SUCCEEDED; + /** @event */ + static readonly SERVER_HEARTBEAT_FAILED = SERVER_HEARTBEAT_FAILED; + /** @event */ + static readonly CONNECT = CONNECT; + /** @event */ + static readonly DESCRIPTION_RECEIVED = DESCRIPTION_RECEIVED; + /** @event */ + static readonly CLOSED = CLOSED; + /** @event */ + static readonly ENDED = ENDED; + + /** + * Create a server + */ + constructor(topology: Topology, description: ServerDescription, options: ServerOptions) { + super(); + this.on('error', noop); + + this.serverApi = options.serverApi; + + const poolOptions = { hostAddress: description.hostAddress, ...options }; + + this.topology = topology; + this.pool = new ConnectionPool(this, poolOptions); + + this.s = { + description, + options, + state: STATE_CLOSED, + operationCount: 0 + }; + + for (const event of [...CMAP_EVENTS, ...APM_EVENTS]) { + this.pool.on(event, (e: any) => this.emit(event, e)); + } + + this.pool.on(Connection.CLUSTER_TIME_RECEIVED, (clusterTime: ClusterTime) => { + this.clusterTime = clusterTime; + }); + + if (this.loadBalanced) { + this.monitor = null; + // monitoring is disabled in load balancing mode + return; + } + + // create the monitor + this.monitor = new Monitor(this, this.s.options); + + for (const event of HEARTBEAT_EVENTS) { + this.monitor.on(event, (e: any) => this.emit(event, e)); + } + + this.monitor.on('resetServer', (error: MongoServerError) => markServerUnknown(this, error)); + this.monitor.on(Server.SERVER_HEARTBEAT_SUCCEEDED, (event: ServerHeartbeatSucceededEvent) => { + this.emit( + Server.DESCRIPTION_RECEIVED, + new ServerDescription(this.description.hostAddress, event.reply, { + roundTripTime: this.monitor?.roundTripTime, + minRoundTripTime: this.monitor?.minRoundTripTime + }) + ); + + if (this.s.state === STATE_CONNECTING) { + stateTransition(this, STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + }); + } + + get clusterTime(): ClusterTime | undefined { + return this.topology.clusterTime; + } + + set clusterTime(clusterTime: ClusterTime | undefined) { + this.topology.clusterTime = clusterTime; + } + + get description(): ServerDescription { + return this.s.description; + } + + get name(): string { + return this.s.description.address; + } + + get autoEncrypter(): AutoEncrypter | undefined { + if (this.s.options && this.s.options.autoEncrypter) { + return this.s.options.autoEncrypter; + } + return; + } + + get loadBalanced(): boolean { + return this.topology.description.type === TopologyType.LoadBalanced; + } + + /** + * Initiate server connect + */ + connect(): void { + if (this.s.state !== STATE_CLOSED) { + return; + } + + stateTransition(this, STATE_CONNECTING); + + // If in load balancer mode we automatically set the server to + // a load balancer. It never transitions out of this state and + // has no monitor. + if (!this.loadBalanced) { + this.monitor?.connect(); + } else { + stateTransition(this, STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + } + + closeCheckedOutConnections() { + return this.pool.closeCheckedOutConnections(); + } + + /** Destroy the server connection */ + close(): void { + if (this.s.state === STATE_CLOSED) { + return; + } + + stateTransition(this, STATE_CLOSING); + + if (!this.loadBalanced) { + this.monitor?.close(); + } + + this.pool.close(); + stateTransition(this, STATE_CLOSED); + this.emit('closed'); + } + + /** + * Immediately schedule monitoring of this server. If there already an attempt being made + * this will be a no-op. + */ + requestCheck(): void { + if (!this.loadBalanced) { + this.monitor?.requestCheck(); + } + } + + public async command( + operation: AbstractOperation, + timeoutContext: TimeoutContext + ): Promise> { + if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) { + throw new MongoServerClosedError(); + } + const session = operation.session; + + let conn = session?.pinnedConnection; + + this.incrementOperationCount(); + if (conn == null) { + try { + conn = await this.pool.checkOut({ timeoutContext, signal: operation.options.signal }); + } catch (checkoutError) { + this.decrementOperationCount(); + if (!(checkoutError instanceof PoolClearedError)) this.handleError(checkoutError); + throw checkoutError; + } + } + + let reauthPromise: Promise | null = null; + const cleanup = () => { + this.decrementOperationCount(); + if (session?.pinnedConnection !== conn) { + if (reauthPromise != null) { + // The reauth promise only exists if it hasn't thrown. + const checkBackIn = () => { + this.pool.checkIn(conn); + }; + void reauthPromise.then(checkBackIn, checkBackIn); + } else { + this.pool.checkIn(conn); + } + } + }; + + let cmd; + try { + cmd = operation.buildCommand(conn, session); + } catch (e) { + cleanup(); + throw e; + } + + const options = operation.buildOptions(timeoutContext); + const ns = operation.ns; + + if (this.loadBalanced && isPinnableCommand(cmd, session) && !session?.pinnedConnection) { + session?.pin(conn); + } + + options.directConnection = this.topology.s.options.directConnection; + + const omitReadPreference = + operation instanceof AggregateOperation && + operation.hasWriteStage && + maxWireVersion(conn) < MIN_SECONDARY_WRITE_WIRE_VERSION; + if (omitReadPreference) { + delete options.readPreference; + } + + if (this.description.iscryptd) { + options.omitMaxTimeMS = true; + } + + try { + try { + const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE); + throwIfWriteConcernError(res); + return res; + } catch (commandError) { + throw this.decorateCommandError(conn, cmd, options, commandError); + } + } catch (operationError) { + if ( + operationError instanceof MongoError && + operationError.code?.valueOf() === MONGODB_ERROR_CODES.Reauthenticate + ) { + reauthPromise = this.pool.reauthenticate(conn); + reauthPromise.then(undefined, error => { + reauthPromise = null; + squashError(error); + }); + + await abortable(reauthPromise, options); + reauthPromise = null; // only reachable if reauth succeeds + + try { + const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE); + throwIfWriteConcernError(res); + return res; + } catch (commandError) { + throw this.decorateCommandError(conn, cmd, options, commandError); + } + } else { + throw operationError; + } + } finally { + cleanup(); + } + } + + /** + * Handle SDAM error + * @internal + */ + handleError(error: AnyError, connection?: Connection) { + if (!(error instanceof MongoError)) { + return; + } + + if (isStaleError(this, error)) { + return; + } + + const isNetworkNonTimeoutError = + error instanceof MongoNetworkError && !(error instanceof MongoNetworkTimeoutError); + const isNetworkTimeoutBeforeHandshakeError = + error instanceof MongoNetworkError && error.beforeHandshake; + const isAuthOrEstablishmentHandshakeError = error.hasErrorLabel(MongoErrorLabel.HandshakeError); + const isSystemOverloadError = error.hasErrorLabel(MongoErrorLabel.SystemOverloadedError); + + // Perhaps questionable and divergent from the spec, but considering MongoParseErrors like state change errors was legacy behavior. + if (isStateChangeError(error) || error instanceof MongoParseError) { + const shouldClearPool = isNodeShuttingDownError(error); + + // from the SDAM spec: The driver MUST synchronize clearing the pool with updating the topology. + // In load balanced mode: there is no monitoring, so there is no topology to update. We simply clear the pool. + // For other topologies: the `ResetPool` label instructs the topology to clear the server's pool in `updateServer()`. + if (!this.loadBalanced) { + if (shouldClearPool) { + error.addErrorLabel(MongoErrorLabel.ResetPool); + } + markServerUnknown(this, error); + queueMicrotask(() => this.requestCheck()); + return; + } + + if (connection && shouldClearPool) { + this.pool.clear({ serviceId: connection.serviceId }); + } + } else if ( + isNetworkNonTimeoutError || + isNetworkTimeoutBeforeHandshakeError || + isAuthOrEstablishmentHandshakeError + ) { + // Do NOT clear the pool if we encounter a system overloaded error. + if (isSystemOverloadError) { + return; + } + // from the SDAM spec: The driver MUST synchronize clearing the pool with updating the topology. + // In load balanced mode: there is no monitoring, so there is no topology to update. We simply clear the pool. + // For other topologies: the `ResetPool` label instructs the topology to clear the server's pool in `updateServer()`. + if (!this.loadBalanced) { + error.addErrorLabel(MongoErrorLabel.ResetPool); + markServerUnknown(this, error); + } else if (connection) { + this.pool.clear({ serviceId: connection.serviceId }); + } + } + } + + /** + * Ensure that error is properly decorated and internal state is updated before throwing + * @internal + */ + private decorateCommandError( + connection: Connection, + cmd: Document, + options: CommandOptions | GetMoreOptions | undefined, + error: unknown + ): Error { + if (typeof error !== 'object' || error == null || !('name' in error)) { + throw new MongoRuntimeError('An unexpected error type: ' + typeof error); + } + + if (error.name === 'AbortError' && 'cause' in error && error.cause instanceof MongoError) { + error = error.cause; + } + + if (!(error instanceof MongoError)) { + // Node.js or some other error we have not special handling for + return error as Error; + } + + if (connectionIsStale(this.pool, connection)) { + return error; + } + + const session = options?.session; + if (error instanceof MongoNetworkError) { + if (session && !session.hasEnded && session.serverSession) { + session.serverSession.isDirty = true; + } + + // inActiveTransaction check handles commit and abort. + if ( + inActiveTransaction(session, cmd) && + !error.hasErrorLabel(MongoErrorLabel.TransientTransactionError) + ) { + error.addErrorLabel(MongoErrorLabel.TransientTransactionError); + } + + if ( + (isRetryableWritesEnabled(this.topology) || isTransactionCommand(cmd)) && + supportsRetryableWrites(this) && + !inActiveTransaction(session, cmd) + ) { + error.addErrorLabel(MongoErrorLabel.RetryableWriteError); + } + } else { + if ( + (isRetryableWritesEnabled(this.topology) || isTransactionCommand(cmd)) && + needsRetryableWriteLabel(error) && + !inActiveTransaction(session, cmd) + ) { + error.addErrorLabel(MongoErrorLabel.RetryableWriteError); + } + } + + if ( + session && + session.isPinned && + error.hasErrorLabel(MongoErrorLabel.TransientTransactionError) + ) { + session.unpin({ force: true }); + } + + this.handleError(error, connection); + + return error; + } + + /** + * Decrement the operation count, returning the new count. + */ + private decrementOperationCount(): number { + return (this.s.operationCount -= 1); + } + + /** + * Increment the operation count, returning the new count. + */ + private incrementOperationCount(): number { + return (this.s.operationCount += 1); + } +} + +function markServerUnknown(server: Server, error?: MongoError) { + // Load balancer servers can never be marked unknown. + if (server.loadBalanced) { + return; + } + + if (error instanceof MongoNetworkError && !(error instanceof MongoNetworkTimeoutError)) { + server.monitor?.reset(); + } + + server.emit( + Server.DESCRIPTION_RECEIVED, + new ServerDescription(server.description.hostAddress, undefined, { error }) + ); +} + +function isPinnableCommand(cmd: Document, session?: ClientSession): boolean { + if (session) { + return ( + session.inTransaction() || + (session.transaction.isCommitted && 'commitTransaction' in cmd) || + 'aggregate' in cmd || + 'find' in cmd || + 'getMore' in cmd || + 'listCollections' in cmd || + 'listIndexes' in cmd || + 'bulkWrite' in cmd + ); + } + + return false; +} + +function connectionIsStale(pool: ConnectionPool, connection: Connection) { + if (connection.serviceId) { + return ( + connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString()) + ); + } + + return connection.generation !== pool.generation; +} + +function inActiveTransaction(session: ClientSession | undefined, cmd: Document) { + return session && session.inTransaction() && !isTransactionCommand(cmd); +} + +/** this checks the retryWrites option passed down from the client options, it + * does not check if the server supports retryable writes */ +function isRetryableWritesEnabled(topology: Topology) { + return topology.s.options.retryWrites !== false; +} + +function isStaleError(server: Server, error: MongoError): boolean { + const currentGeneration = server.pool.generation; + const generation = error.connectionGeneration; + + if (generation && generation < currentGeneration) { + return true; + } + + const currentTopologyVersion = server.description.topologyVersion; + return compareTopologyVersion(currentTopologyVersion, error.topologyVersion) >= 0; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_description.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_description.ts new file mode 100644 index 00000000..d7f16fe2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_description.ts @@ -0,0 +1,297 @@ +import { type Document, Long, type ObjectId } from '../bson'; +import { type MongoError, MongoRuntimeError } from '../error'; +import { + arrayStrictEqual, + compareObjectId, + errorStrictEqual, + HostAddress, + processTimeMS +} from '../utils'; +import { type ClusterTime, ServerType } from './common'; + +const WRITABLE_SERVER_TYPES = new Set([ + ServerType.RSPrimary, + ServerType.Standalone, + ServerType.Mongos, + ServerType.LoadBalancer +]); + +const DATA_BEARING_SERVER_TYPES = new Set([ + ServerType.RSPrimary, + ServerType.RSSecondary, + ServerType.Mongos, + ServerType.Standalone, + ServerType.LoadBalancer +]); + +/** @public */ +export interface TopologyVersion { + processId: ObjectId; + counter: Long; +} + +/** @public */ +export type TagSet = { [key: string]: string }; + +/** @internal */ +export interface ServerDescriptionOptions { + /** An Error used for better reporting debugging */ + error?: MongoError; + + /** The average round trip time to ping this server (in ms) */ + roundTripTime?: number; + /** The minimum round trip time to ping this server over the past 10 samples(in ms) */ + minRoundTripTime?: number; + + /** If the client is in load balancing mode. */ + loadBalanced?: boolean; +} + +/** + * The client's view of a single server, based on the most recent hello outcome. + * + * Internal type, not meant to be directly instantiated + * @public + */ +export class ServerDescription { + address: string; + type: ServerType; + hosts: string[]; + passives: string[]; + arbiters: string[]; + tags: TagSet; + error: MongoError | null; + topologyVersion: TopologyVersion | null; + minWireVersion: number; + maxWireVersion: number; + roundTripTime: number; + /** The minimum measurement of the last 10 measurements of roundTripTime that have been collected */ + minRoundTripTime: number; + lastUpdateTime: number; + lastWriteDate: number; + me: string | null; + primary: string | null; + setName: string | null; + setVersion: number | null; + electionId: ObjectId | null; + logicalSessionTimeoutMinutes: number | null; + /** The max message size in bytes for the server. */ + maxMessageSizeBytes: number | null; + /** The max number of writes in a bulk write command. */ + maxWriteBatchSize: number | null; + /** The max bson object size. */ + maxBsonObjectSize: number | null; + /** Indicates server is a mongocryptd instance. */ + iscryptd: boolean; + + // NOTE: does this belong here? It seems we should gossip the cluster time at the CMAP level + $clusterTime?: ClusterTime; + + /** + * Create a ServerDescription + * @internal + * + * @param address - The address of the server + * @param hello - An optional hello response for this server + */ + constructor( + address: HostAddress | string, + hello?: Document, + options: ServerDescriptionOptions = {} + ) { + if (address == null || address === '') { + throw new MongoRuntimeError('ServerDescription must be provided with a non-empty address'); + } + + this.address = + typeof address === 'string' + ? HostAddress.fromString(address).toString() // Use HostAddress to normalize + : address.toString(); + this.type = parseServerType(hello, options); + this.hosts = hello?.hosts?.map((host: string) => host.toLowerCase()) ?? []; + this.passives = hello?.passives?.map((host: string) => host.toLowerCase()) ?? []; + this.arbiters = hello?.arbiters?.map((host: string) => host.toLowerCase()) ?? []; + this.tags = hello?.tags ?? {}; + this.minWireVersion = hello?.minWireVersion ?? 0; + this.maxWireVersion = hello?.maxWireVersion ?? 0; + this.roundTripTime = options?.roundTripTime ?? -1; + this.minRoundTripTime = options?.minRoundTripTime ?? 0; + this.lastUpdateTime = processTimeMS(); + this.lastWriteDate = hello?.lastWrite?.lastWriteDate ?? 0; + // NOTE: This actually builds the stack string instead of holding onto the getter and all its + // associated references. This is done to prevent a memory leak. + this.error = options.error ?? null; + this.error?.stack; + // TODO(NODE-2674): Preserve int64 sent from MongoDB + this.topologyVersion = this.error?.topologyVersion ?? hello?.topologyVersion ?? null; + this.setName = hello?.setName ?? null; + this.setVersion = hello?.setVersion ?? null; + this.electionId = hello?.electionId ?? null; + this.logicalSessionTimeoutMinutes = hello?.logicalSessionTimeoutMinutes ?? null; + this.maxMessageSizeBytes = hello?.maxMessageSizeBytes ?? null; + this.maxWriteBatchSize = hello?.maxWriteBatchSize ?? null; + this.maxBsonObjectSize = hello?.maxBsonObjectSize ?? null; + this.primary = hello?.primary ?? null; + this.me = hello?.me?.toLowerCase() ?? null; + this.$clusterTime = hello?.$clusterTime ?? null; + this.iscryptd = Boolean(hello?.iscryptd); + } + + get hostAddress(): HostAddress { + return HostAddress.fromString(this.address); + } + + get allHosts(): string[] { + return this.hosts.concat(this.arbiters).concat(this.passives); + } + + /** Is this server available for reads*/ + get isReadable(): boolean { + return this.type === ServerType.RSSecondary || this.isWritable; + } + + /** Is this server data bearing */ + get isDataBearing(): boolean { + return DATA_BEARING_SERVER_TYPES.has(this.type); + } + + /** Is this server available for writes */ + get isWritable(): boolean { + return WRITABLE_SERVER_TYPES.has(this.type); + } + + get host(): string { + const chopLength = `:${this.port}`.length; + return this.address.slice(0, -chopLength); + } + + get port(): number { + const port = this.address.split(':').pop(); + return port ? Number.parseInt(port, 10) : 27017; + } + + /** + * Determines if another `ServerDescription` is equal to this one per the rules defined in the SDAM specification. + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md + */ + equals(other?: ServerDescription | null): boolean { + // Despite using the comparator that would determine a nullish topologyVersion as greater than + // for equality we should only always perform direct equality comparison + const topologyVersionsEqual = + this.topologyVersion === other?.topologyVersion || + compareTopologyVersion(this.topologyVersion, other?.topologyVersion) === 0; + + const electionIdsEqual = + this.electionId != null && other?.electionId != null + ? compareObjectId(this.electionId, other.electionId) === 0 + : this.electionId === other?.electionId; + + return ( + other != null && + other.iscryptd === this.iscryptd && + errorStrictEqual(this.error, other.error) && + this.type === other.type && + this.minWireVersion === other.minWireVersion && + arrayStrictEqual(this.hosts, other.hosts) && + tagsStrictEqual(this.tags, other.tags) && + this.setName === other.setName && + this.setVersion === other.setVersion && + electionIdsEqual && + this.primary === other.primary && + this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes && + topologyVersionsEqual + ); + } +} + +// Parses a `hello` message and determines the server type +export function parseServerType(hello?: Document, options?: ServerDescriptionOptions): ServerType { + if (options?.loadBalanced) { + return ServerType.LoadBalancer; + } + + if (!hello || !hello.ok) { + return ServerType.Unknown; + } + + if (hello.isreplicaset) { + return ServerType.RSGhost; + } + + if (hello.msg && hello.msg === 'isdbgrid') { + return ServerType.Mongos; + } + + if (hello.setName) { + if (hello.hidden) { + return ServerType.RSOther; + } else if (hello.isWritablePrimary) { + return ServerType.RSPrimary; + } else if (hello.secondary) { + return ServerType.RSSecondary; + } else if (hello.arbiterOnly) { + return ServerType.RSArbiter; + } else { + return ServerType.RSOther; + } + } + + return ServerType.Standalone; +} + +function tagsStrictEqual(tags: TagSet, tags2: TagSet): boolean { + const tagsKeys = Object.keys(tags); + const tags2Keys = Object.keys(tags2); + + return ( + tagsKeys.length === tags2Keys.length && + tagsKeys.every((key: string) => tags2[key] === tags[key]) + ); +} + +/** + * Compares two topology versions. + * + * 1. If the response topologyVersion is unset or the ServerDescription's + * topologyVersion is null, the client MUST assume the response is more recent. + * 1. If the response's topologyVersion.processId is not equal to the + * ServerDescription's, the client MUST assume the response is more recent. + * 1. If the response's topologyVersion.processId is equal to the + * ServerDescription's, the client MUST use the counter field to determine + * which topologyVersion is more recent. + * + * ```ts + * currentTv < newTv === -1 + * currentTv === newTv === 0 + * currentTv > newTv === 1 + * ``` + */ +export function compareTopologyVersion( + currentTv?: TopologyVersion | null, + newTv?: TopologyVersion | null +): 0 | -1 | 1 { + if (currentTv == null || newTv == null) { + return -1; + } + + if (!currentTv.processId.equals(newTv.processId)) { + return -1; + } + + // TODO(NODE-2674): Preserve int64 sent from MongoDB + const currentCounter = + typeof currentTv.counter === 'bigint' + ? Long.fromBigInt(currentTv.counter) + : Long.isLong(currentTv.counter) + ? currentTv.counter + : Long.fromNumber(currentTv.counter); + + const newCounter = + typeof newTv.counter === 'bigint' + ? Long.fromBigInt(newTv.counter) + : Long.isLong(newTv.counter) + ? newTv.counter + : Long.fromNumber(newTv.counter); + + return currentCounter.compare(newCounter); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection.ts new file mode 100644 index 00000000..8f01beaa --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection.ts @@ -0,0 +1,415 @@ +import { MongoInvalidArgumentError, MongoRuntimeError } from '../error'; +import { ReadPreference } from '../read_preference'; +import { ServerType, TopologyType } from './common'; +import type { ServerDescription, TagSet } from './server_description'; +import type { TopologyDescription } from './topology_description'; + +// max staleness constants +const IDLE_WRITE_PERIOD = 10000; +const SMALLEST_MAX_STALENESS_SECONDS = 90; + +// Minimum version to try writes on secondaries. +export const MIN_SECONDARY_WRITE_WIRE_VERSION = 13; + +/** @internal */ +export type ServerSelector = ( + topologyDescription: TopologyDescription, + servers: ServerDescription[], + deprioritized: DeprioritizedServers +) => ServerDescription[]; + +/** @internal */ +export class DeprioritizedServers { + private deprioritized: Set = new Set(); + + constructor(descriptions?: Iterable) { + for (const description of descriptions ?? []) { + this.add(description); + } + } + + add({ address }: ServerDescription) { + this.deprioritized.add(address); + } + + has({ address }: ServerDescription): boolean { + return this.deprioritized.has(address); + } +} + +function filterDeprioritized( + candidates: ServerDescription[], + deprioritized: DeprioritizedServers +): ServerDescription[] { + const filtered = candidates.filter(candidate => !deprioritized.has(candidate)); + + return filtered.length ? filtered : candidates; +} + +/** + * Returns a server selector that selects for writable servers + */ +export function writableServerSelector(): ServerSelector { + return function writableServer( + topologyDescription: TopologyDescription, + servers: ServerDescription[], + deprioritized: DeprioritizedServers + ): ServerDescription[] { + const eligibleServers = filterDeprioritized( + servers.filter(({ isWritable }) => isWritable), + deprioritized + ); + + return latencyWindowReducer(topologyDescription, eligibleServers); + }; +} + +/** + * The purpose of this selector is to select the same server, only + * if it is in a state that it can have commands sent to it. + */ +export function sameServerSelector(description?: ServerDescription): ServerSelector { + return function sameServerSelector( + _topologyDescription: TopologyDescription, + servers: ServerDescription[], + _deprioritized: DeprioritizedServers + ): ServerDescription[] { + if (!description) return []; + // Filter the servers to match the provided description only if + // the type is not unknown. + return servers.filter(sd => { + return sd.address === description.address && sd.type !== ServerType.Unknown; + }); + }; +} + +/** + * Returns a server selector that uses a read preference to select a + * server potentially for a write on a secondary. + */ +export function secondaryWritableServerSelector( + wireVersion: number, + readPreference?: ReadPreference +): ServerSelector { + // If server version < 5.0, read preference always primary. + // If server version >= 5.0... + // - If read preference is supplied, use that. + // - If no read preference is supplied, use primary. + if ( + !readPreference || + !wireVersion || + (wireVersion && wireVersion < MIN_SECONDARY_WRITE_WIRE_VERSION) + ) { + return readPreferenceServerSelector(ReadPreference.primary); + } + return readPreferenceServerSelector(readPreference); +} + +/** + * Reduces the passed in array of servers by the rules of the "Max Staleness" specification + * found here: + * + * @see https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness.md + * + * @param readPreference - The read preference providing max staleness guidance + * @param topologyDescription - The topology description + * @param servers - The list of server descriptions to be reduced + * @returns The list of servers that satisfy the requirements of max staleness + */ +function maxStalenessReducer( + readPreference: ReadPreference, + topologyDescription: TopologyDescription, + servers: ServerDescription[] +): ServerDescription[] { + if (readPreference.maxStalenessSeconds == null || readPreference.maxStalenessSeconds < 0) { + return servers; + } + + const maxStaleness = readPreference.maxStalenessSeconds; + const maxStalenessVariance = + (topologyDescription.heartbeatFrequencyMS + IDLE_WRITE_PERIOD) / 1000; + if (maxStaleness < maxStalenessVariance) { + throw new MongoInvalidArgumentError( + `Option "maxStalenessSeconds" must be at least ${maxStalenessVariance} seconds` + ); + } + + if (maxStaleness < SMALLEST_MAX_STALENESS_SECONDS) { + throw new MongoInvalidArgumentError( + `Option "maxStalenessSeconds" must be at least ${SMALLEST_MAX_STALENESS_SECONDS} seconds` + ); + } + + if (topologyDescription.type === TopologyType.ReplicaSetWithPrimary) { + const primary: ServerDescription = Array.from(topologyDescription.servers.values()).filter( + primaryFilter + )[0]; + + return servers.filter((server: ServerDescription) => { + const stalenessMS = + server.lastUpdateTime - + server.lastWriteDate - + (primary.lastUpdateTime - primary.lastWriteDate) + + topologyDescription.heartbeatFrequencyMS; + + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + return staleness <= maxStalenessSeconds; + }); + } + + if (topologyDescription.type === TopologyType.ReplicaSetNoPrimary) { + if (servers.length === 0) { + return servers; + } + + const sMax = servers.reduce((max: ServerDescription, s: ServerDescription) => + s.lastWriteDate > max.lastWriteDate ? s : max + ); + + return servers.filter((server: ServerDescription) => { + const stalenessMS = + sMax.lastWriteDate - server.lastWriteDate + topologyDescription.heartbeatFrequencyMS; + + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + return staleness <= maxStalenessSeconds; + }); + } + + return servers; +} + +/** + * Determines whether a server's tags match a given set of tags. + * + * A tagset matches the server's tags if every k-v pair in the tagset + * is also in the server's tagset. + * + * Note that this does not requires that every k-v pair in the server's tagset is also + * in the client's tagset. The server's tagset is required only to be a superset of the + * client's tags. + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.md#tag_sets + * + * @param tagSet - The requested tag set to match + * @param serverTags - The server's tags + */ +function tagSetMatch(tagSet: TagSet, serverTags: TagSet) { + return Object.entries(tagSet).every( + ([key, value]) => serverTags[key] != null && serverTags[key] === value + ); +} + +/** + * Reduces a set of server descriptions based on tags requested by the read preference + * + * @param readPreference - The read preference providing the requested tags + * @param servers - The list of server descriptions to reduce + * @returns The list of servers matching the requested tags + */ +function tagSetReducer( + { tags }: ReadPreference, + servers: ServerDescription[] +): ServerDescription[] { + if (tags == null || tags.length === 0) { + // empty tag sets match all servers + return servers; + } + + for (const tagSet of tags) { + const serversMatchingTagset = servers.filter((s: ServerDescription) => + tagSetMatch(tagSet, s.tags) + ); + + if (serversMatchingTagset.length) { + return serversMatchingTagset; + } + } + + return []; +} + +/** + * Reduces a list of servers to ensure they fall within an acceptable latency window. This is + * further specified in the "Server Selection" specification, found here: + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.md + * + * @param topologyDescription - The topology description + * @param servers - The list of servers to reduce + * @returns The servers which fall within an acceptable latency window + */ +function latencyWindowReducer( + topologyDescription: TopologyDescription, + servers: ServerDescription[] +): ServerDescription[] { + const low = servers.reduce( + (min: number, server: ServerDescription) => Math.min(server.roundTripTime, min), + Infinity + ); + + const high = low + topologyDescription.localThresholdMS; + return servers.filter(server => server.roundTripTime <= high && server.roundTripTime >= low); +} + +// filters +function primaryFilter(server: ServerDescription): boolean { + return server.type === ServerType.RSPrimary; +} + +function secondaryFilter(server: ServerDescription): boolean { + return server.type === ServerType.RSSecondary; +} + +function nearestFilter(server: ServerDescription): boolean { + return server.type === ServerType.RSSecondary || server.type === ServerType.RSPrimary; +} + +function knownFilter(server: ServerDescription): boolean { + return server.type !== ServerType.Unknown; +} + +function loadBalancerFilter(server: ServerDescription): boolean { + return server.type === ServerType.LoadBalancer; +} + +function isDeprioritizedFactory( + deprioritized: DeprioritizedServers +): (server: ServerDescription) => boolean { + return server => + // if any deprioritized servers equal the server, here we are. + !deprioritized.has(server); +} + +function secondarySelector( + readPreference: ReadPreference, + topologyDescription: TopologyDescription, + servers: ServerDescription[], + deprioritized: DeprioritizedServers +) { + const mode = readPreference.mode; + switch (mode) { + case 'primary': + // Note: no need to filter for deprioritized servers. A replica set has only one primary; that means that + // we are in one of two scenarios: + // 1. deprioritized servers is empty - return the primary. + // 2. deprioritized servers contains the primary - return the primary. + return servers.filter(primaryFilter); + case 'primaryPreferred': { + const primary = servers.filter(primaryFilter); + + // If there is a primary and it is not deprioritized, use the primary. Otherwise, + // check for secondaries. + const eligiblePrimary = primary.filter(isDeprioritizedFactory(deprioritized)); + if (eligiblePrimary.length) { + return eligiblePrimary; + } + + // If we make it here, we either have: + // 1. a deprioritized primary + // 2. no eligible primary + // secondaries take precedence of deprioritized primaries. + const secondaries = tagSetReducer( + readPreference, + maxStalenessReducer(readPreference, topologyDescription, servers.filter(secondaryFilter)) + ); + + const eligibleSecondaries = secondaries.filter(isDeprioritizedFactory(deprioritized)); + if (eligibleSecondaries.length) { + return latencyWindowReducer(topologyDescription, eligibleSecondaries); + } + + // if we make it here, we have no primaries or secondaries that not deprioritized. + // prefer the primary (which may not exist, if the topology has no primary). + // otherwise, return the secondaries (which also may not exist, but there is nothing else to check here). + return primary.length ? primary : latencyWindowReducer(topologyDescription, secondaries); + } + case 'nearest': { + const eligible = filterDeprioritized( + tagSetReducer( + readPreference, + maxStalenessReducer(readPreference, topologyDescription, servers.filter(nearestFilter)) + ), + deprioritized + ); + return latencyWindowReducer(topologyDescription, eligible); + } + case 'secondary': + case 'secondaryPreferred': { + const secondaries = tagSetReducer( + readPreference, + maxStalenessReducer(readPreference, topologyDescription, servers.filter(secondaryFilter)) + ); + const eligibleSecondaries = secondaries.filter(isDeprioritizedFactory(deprioritized)); + + if (eligibleSecondaries.length) { + return latencyWindowReducer(topologyDescription, eligibleSecondaries); + } + + // we have no eligible secondaries, try for a primary if we can. + if (mode === ReadPreference.SECONDARY_PREFERRED) { + const primary = servers.filter(primaryFilter); + + // unlike readPreference=primary, here we do filter for deprioritized servers. + // if the primary is deprioritized, deprioritized secondaries take precedence. + const eligiblePrimary = primary.filter(isDeprioritizedFactory(deprioritized)); + if (eligiblePrimary.length) return eligiblePrimary; + + // we have no eligible primary nor secondaries that have not been deprioritized + return secondaries.length + ? latencyWindowReducer(topologyDescription, secondaries) + : primary; + } + + // return all secondaries in the latency window. + return latencyWindowReducer(topologyDescription, secondaries); + } + + default: { + const _exhaustiveCheck: never = mode; + throw new MongoRuntimeError( + `unexpected readPreference=${mode} (should never happen). Please report a bug in the Node driver Jira project.` + ); + } + } +} + +/** + * Returns a function which selects servers based on a provided read preference + * + * @param readPreference - The read preference to select with + */ +export function readPreferenceServerSelector(readPreference: ReadPreference): ServerSelector { + if (!readPreference.isValid()) { + throw new MongoInvalidArgumentError('Invalid read preference specified'); + } + + return function readPreferenceServers( + topologyDescription: TopologyDescription, + servers: ServerDescription[], + deprioritized: DeprioritizedServers + ): ServerDescription[] { + switch (topologyDescription.type) { + case 'Single': + return latencyWindowReducer(topologyDescription, servers.filter(knownFilter)); + case 'ReplicaSetNoPrimary': + case 'ReplicaSetWithPrimary': + return secondarySelector(readPreference, topologyDescription, servers, deprioritized); + case 'Sharded': { + const selectable = filterDeprioritized(servers, deprioritized); + return latencyWindowReducer(topologyDescription, selectable.filter(knownFilter)); + } + case 'Unknown': + return []; + case 'LoadBalanced': + return servers.filter(loadBalancerFilter); + default: { + const _exhaustiveCheck: never = topologyDescription.type; + throw new MongoRuntimeError( + `unexpected topology type: ${topologyDescription.type} (this should never happen). Please file a bug in the Node driver Jira project.` + ); + } + } + }; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection_events.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection_events.ts new file mode 100644 index 00000000..9b171661 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/server_selection_events.ts @@ -0,0 +1,142 @@ +import { HostAddress } from '.././utils'; +import { + SERVER_SELECTION_FAILED, + SERVER_SELECTION_STARTED, + SERVER_SELECTION_SUCCEEDED, + WAITING_FOR_SUITABLE_SERVER +} from '../constants'; +import { type ReadPreference } from '../read_preference'; +import { type ServerSelector } from './server_selection'; +import type { TopologyDescription } from './topology_description'; + +/** + * The base export class for all logs published from server selection + * @internal + * @category Log Type + */ +export abstract class ServerSelectionEvent { + /** String representation of the selector being used to select the server. + * Defaults to 'custom selector' for application-provided custom selector case. + */ + selector: string | ReadPreference | ServerSelector; + /** The name of the operation for which a server is being selected. */ + operation: string; + /** The current topology description. */ + topologyDescription: TopologyDescription; + + /** @internal */ + abstract name: + | typeof SERVER_SELECTION_STARTED + | typeof SERVER_SELECTION_SUCCEEDED + | typeof SERVER_SELECTION_FAILED + | typeof WAITING_FOR_SUITABLE_SERVER; + + abstract message: string; + + /** @internal */ + constructor( + selector: string | ReadPreference | ServerSelector, + topologyDescription: TopologyDescription, + operation: string + ) { + this.selector = selector; + this.operation = operation; + this.topologyDescription = topologyDescription; + } +} + +/** + * An event published when server selection starts + * @internal + * @category Event + */ +export class ServerSelectionStartedEvent extends ServerSelectionEvent { + /** @internal */ + name = SERVER_SELECTION_STARTED; + message = 'Server selection started'; + + /** @internal */ + constructor( + selector: string | ReadPreference | ServerSelector, + topologyDescription: TopologyDescription, + operation: string + ) { + super(selector, topologyDescription, operation); + } +} + +/** + * An event published when a server selection fails + * @internal + * @category Event + */ +export class ServerSelectionFailedEvent extends ServerSelectionEvent { + /** @internal */ + name = SERVER_SELECTION_FAILED; + message = 'Server selection failed'; + /** Representation of the error the driver will throw regarding server selection failing. */ + failure: Error; + + /** @internal */ + constructor( + selector: string | ReadPreference | ServerSelector, + topologyDescription: TopologyDescription, + error: Error, + operation: string + ) { + super(selector, topologyDescription, operation); + this.failure = error; + } +} + +/** + * An event published when server selection succeeds + * @internal + * @category Event + */ +export class ServerSelectionSucceededEvent extends ServerSelectionEvent { + /** @internal */ + name = SERVER_SELECTION_SUCCEEDED; + message = 'Server selection succeeded'; + /** The hostname, IP address, or Unix domain socket path for the selected server. */ + serverHost: string; + /** The port for the selected server. Optional; not present for Unix domain sockets. When the user does not specify a port and the default (27017) is used, the driver SHOULD include it here. */ + serverPort: number | undefined; + + /** @internal */ + constructor( + selector: string | ReadPreference | ServerSelector, + topologyDescription: TopologyDescription, + address: string, + operation: string + ) { + super(selector, topologyDescription, operation); + const { host, port } = HostAddress.fromString(address).toHostPort(); + this.serverHost = host; + this.serverPort = port; + } +} + +/** + * An event published when server selection is waiting for a suitable server to become available + * @internal + * @category Event + */ +export class WaitingForSuitableServerEvent extends ServerSelectionEvent { + /** @internal */ + name = WAITING_FOR_SUITABLE_SERVER; + message = 'Waiting for suitable server to become available'; + /** The remaining time left until server selection will time out. */ + remainingTimeMS: number; + + /** @internal */ + constructor( + selector: string | ReadPreference | ServerSelector, + topologyDescription: TopologyDescription, + remainingTimeMS: number, + operation: string + ) { + super(selector, topologyDescription, operation); + this.remainingTimeMS = remainingTimeMS; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/srv_polling.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/srv_polling.ts new file mode 100644 index 00000000..cfc4779c --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/srv_polling.ts @@ -0,0 +1,146 @@ +import * as dns from 'dns'; +import { clearTimeout, setTimeout } from 'timers'; + +import { MongoRuntimeError } from '../error'; +import { TypedEventEmitter } from '../mongo_types'; +import { checkParentDomainMatch, HostAddress, noop, squashError } from '../utils'; + +/** + * @internal + * @category Event + */ +export class SrvPollingEvent { + srvRecords: dns.SrvRecord[]; + constructor(srvRecords: dns.SrvRecord[]) { + this.srvRecords = srvRecords; + } + + hostnames(): Set { + return new Set(this.srvRecords.map(r => HostAddress.fromSrvRecord(r).toString())); + } +} + +/** @internal */ +export interface SrvPollerOptions { + srvServiceName: string; + srvMaxHosts: number; + srvHost: string; + heartbeatFrequencyMS: number; +} + +/** @internal */ +export type SrvPollerEvents = { + srvRecordDiscovery(event: SrvPollingEvent): void; +}; + +/** @internal */ +export class SrvPoller extends TypedEventEmitter { + srvHost: string; + rescanSrvIntervalMS: number; + heartbeatFrequencyMS: number; + haMode: boolean; + generation: number; + srvMaxHosts: number; + srvServiceName: string; + _timeout?: NodeJS.Timeout; + + /** @event */ + static readonly SRV_RECORD_DISCOVERY = 'srvRecordDiscovery' as const; + + constructor(options: SrvPollerOptions) { + super(); + this.on('error', noop); + + if (!options || !options.srvHost) { + throw new MongoRuntimeError('Options for SrvPoller must exist and include srvHost'); + } + + this.srvHost = options.srvHost; + this.srvMaxHosts = options.srvMaxHosts ?? 0; + this.srvServiceName = options.srvServiceName ?? 'mongodb'; + this.rescanSrvIntervalMS = 60000; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 10000; + + this.haMode = false; + this.generation = 0; + + this._timeout = undefined; + } + + get srvAddress(): string { + return `_${this.srvServiceName}._tcp.${this.srvHost}`; + } + + get intervalMS(): number { + return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMS; + } + + start(): void { + if (!this._timeout) { + this.schedule(); + } + } + + stop(): void { + if (this._timeout) { + clearTimeout(this._timeout); + this.generation += 1; + this._timeout = undefined; + } + } + + // TODO(NODE-4994): implement new logging logic for SrvPoller failures + schedule(): void { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeout = setTimeout(() => { + this._poll().then(undefined, squashError); + }, this.intervalMS); + } + + success(srvRecords: dns.SrvRecord[]): void { + this.haMode = false; + this.schedule(); + this.emit(SrvPoller.SRV_RECORD_DISCOVERY, new SrvPollingEvent(srvRecords)); + } + + failure(): void { + this.haMode = true; + this.schedule(); + } + + async _poll(): Promise { + const generation = this.generation; + let srvRecords; + + try { + srvRecords = await dns.promises.resolve(this.srvAddress, 'SRV'); + } catch { + this.failure(); + return; + } + + if (generation !== this.generation) { + return; + } + + const finalAddresses: dns.SrvRecord[] = []; + for (const record of srvRecords) { + try { + checkParentDomainMatch(record.name, this.srvHost); + finalAddresses.push(record); + } catch (error) { + squashError(error); + } + } + + if (!finalAddresses.length) { + this.failure(); + return; + } + + this.success(finalAddresses); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology.ts new file mode 100644 index 00000000..36228f75 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology.ts @@ -0,0 +1,1103 @@ +import type { BSONSerializeOptions, Document } from '../bson'; +import type { MongoCredentials } from '../cmap/auth/mongo_credentials'; +import type { ConnectionEvents } from '../cmap/connection'; +import type { ConnectionPoolEvents } from '../cmap/connection_pool'; +import type { ClientMetadata } from '../cmap/handshake/client_metadata'; +import { DEFAULT_OPTIONS } from '../connection_string'; +import { + CLOSE, + CONNECT, + ERROR, + LOCAL_SERVER_EVENTS, + OPEN, + SERVER_CLOSED, + SERVER_DESCRIPTION_CHANGED, + SERVER_OPENING, + SERVER_RELAY_EVENTS, + TIMEOUT, + TOPOLOGY_CLOSED, + TOPOLOGY_DESCRIPTION_CHANGED, + TOPOLOGY_OPENING +} from '../constants'; +import { + MongoCompatibilityError, + type MongoDriverError, + MongoError, + MongoErrorLabel, + MongoOperationTimeoutError, + MongoRuntimeError, + MongoServerSelectionError, + MongoTopologyClosedError +} from '../error'; +import type { MongoClient, ServerApi } from '../mongo_client'; +import { MongoLoggableComponent, type MongoLogger, SeverityLevel } from '../mongo_logger'; +import { type Abortable, TypedEventEmitter } from '../mongo_types'; +import { ReadPreference, type ReadPreferenceLike } from '../read_preference'; +import type { ClientSession } from '../sessions'; +import { Timeout, TimeoutContext, TimeoutError } from '../timeout'; +import type { Transaction } from '../transactions'; +import { + addAbortListener, + type Callback, + type EventEmitterWithState, + HostAddress, + kDispose, + List, + makeStateMachine, + noop, + processTimeMS, + promiseWithResolvers, + shuffle +} from '../utils'; +import { + _advanceClusterTime, + type ClusterTime, + ServerType, + STATE_CLOSED, + STATE_CLOSING, + STATE_CONNECTED, + STATE_CONNECTING, + TopologyType +} from './common'; +import { + ServerClosedEvent, + ServerDescriptionChangedEvent, + ServerOpeningEvent, + TopologyClosedEvent, + TopologyDescriptionChangedEvent, + TopologyOpeningEvent +} from './events'; +import type { ServerMonitoringMode } from './monitor'; +import { Server, type ServerEvents, type ServerOptions } from './server'; +import { compareTopologyVersion, ServerDescription } from './server_description'; +import { + DeprioritizedServers, + readPreferenceServerSelector, + type ServerSelector +} from './server_selection'; +import { + ServerSelectionFailedEvent, + ServerSelectionStartedEvent, + ServerSelectionSucceededEvent, + WaitingForSuitableServerEvent +} from './server_selection_events'; +import { SrvPoller, type SrvPollingEvent } from './srv_polling'; +import { TopologyDescription } from './topology_description'; + +// Global state +let globalTopologyCounter = 0; + +const stateTransition = makeStateMachine({ + [STATE_CLOSED]: [STATE_CLOSED, STATE_CONNECTING], + [STATE_CONNECTING]: [STATE_CONNECTING, STATE_CLOSING, STATE_CONNECTED, STATE_CLOSED], + [STATE_CONNECTED]: [STATE_CONNECTED, STATE_CLOSING, STATE_CLOSED], + [STATE_CLOSING]: [STATE_CLOSING, STATE_CLOSED] +}); + +/** @internal */ +export type ServerSelectionCallback = Callback; + +/** @internal */ +export interface ServerSelectionRequest { + serverSelector: ServerSelector; + topologyDescription: TopologyDescription; + mongoLogger: MongoLogger | undefined; + transaction?: Transaction; + startTime: number; + resolve: (server: Server) => void; + reject: (error: MongoError) => void; + cancelled: boolean; + operationName: string; + waitingLogged: boolean; + deprioritizedServers: DeprioritizedServers; +} + +/** @internal */ +export interface TopologyPrivate { + /** the id of this topology */ + id: number; + /** passed in options */ + options: TopologyOptions; + /** initial seedlist of servers to connect to */ + seedlist: HostAddress[]; + /** initial state */ + state: string; + /** the topology description */ + description: TopologyDescription; + serverSelectionTimeoutMS: number; + heartbeatFrequencyMS: number; + minHeartbeatFrequencyMS: number; + /** A map of server instances to normalized addresses */ + servers: Map; + credentials?: MongoCredentials; + clusterTime?: ClusterTime; + + /** related to srv polling */ + srvPoller?: SrvPoller; + detectShardedTopology: (event: TopologyDescriptionChangedEvent) => void; + detectSrvRecords: (event: SrvPollingEvent) => void; +} + +/** @internal */ +export interface TopologyOptions extends BSONSerializeOptions, ServerOptions { + srvMaxHosts: number; + srvServiceName: string; + hosts: HostAddress[]; + retryWrites: boolean; + retryReads: boolean; + maxAdaptiveRetries: number; + enableOverloadRetargeting: boolean; + /** How long to block for server selection before throwing an error */ + serverSelectionTimeoutMS: number; + /** The name of the replica set to connect to */ + replicaSet?: string; + srvHost?: string; + srvPoller?: SrvPoller; + /** Indicates that a client should directly connect to a node without attempting to discover its topology type */ + directConnection: boolean; + loadBalanced: boolean; + metadata: Promise; + serverMonitoringMode: ServerMonitoringMode; + /** MongoDB server API version */ + serverApi?: ServerApi; + __skipPingOnConnect?: boolean; +} + +/** @public */ +export interface ConnectOptions { + readPreference?: ReadPreference; +} + +/** @public */ +export interface SelectServerOptions { + readPreference?: ReadPreferenceLike; + /** How long to block for server selection before throwing an error */ + serverSelectionTimeoutMS?: number; + session?: ClientSession; + operationName: string; + + /** @internal */ + deprioritizedServers: DeprioritizedServers; + /** + * @internal + * TODO(NODE-6496): Make this required by making ChangeStream use LegacyTimeoutContext + * */ + timeoutContext?: TimeoutContext; +} + +/** @public */ +export type TopologyEvents = { + /** Top level MongoClient doesn't emit this so it is marked: @internal */ + connect(topology: Topology): void; + serverOpening(event: ServerOpeningEvent): void; + serverClosed(event: ServerClosedEvent): void; + serverDescriptionChanged(event: ServerDescriptionChangedEvent): void; + topologyClosed(event: TopologyClosedEvent): void; + topologyOpening(event: TopologyOpeningEvent): void; + topologyDescriptionChanged(event: TopologyDescriptionChangedEvent): void; + error(error: Error): void; + /** @internal */ + open(topology: Topology): void; + close(): void; + timeout(): void; +} & Omit & + ConnectionPoolEvents & + ConnectionEvents & + EventEmitterWithState; +/** + * A container of server instances representing a connection to a MongoDB topology. + * @internal + */ +export class Topology extends TypedEventEmitter { + s: TopologyPrivate; + waitQueue: List; + hello?: Document; + _type?: string; + + client!: MongoClient; + + private connectionLock?: Promise; + + /** @event */ + static readonly SERVER_OPENING = SERVER_OPENING; + /** @event */ + static readonly SERVER_CLOSED = SERVER_CLOSED; + /** @event */ + static readonly SERVER_DESCRIPTION_CHANGED = SERVER_DESCRIPTION_CHANGED; + /** @event */ + static readonly TOPOLOGY_OPENING = TOPOLOGY_OPENING; + /** @event */ + static readonly TOPOLOGY_CLOSED = TOPOLOGY_CLOSED; + /** @event */ + static readonly TOPOLOGY_DESCRIPTION_CHANGED = TOPOLOGY_DESCRIPTION_CHANGED; + /** @event */ + static readonly ERROR = ERROR; + /** @event */ + static readonly OPEN = OPEN; + /** @event */ + static readonly CONNECT = CONNECT; + /** @event */ + static readonly CLOSE = CLOSE; + /** @event */ + static readonly TIMEOUT = TIMEOUT; + + /** + * @param seedlist - a list of HostAddress instances to connect to + */ + constructor( + client: MongoClient, + seeds: string | string[] | HostAddress | HostAddress[], + options: TopologyOptions + ) { + super(); + this.on('error', noop); + + this.client = client; + // Options should only be undefined in tests, MongoClient will always have defined options + options = options ?? { + hosts: [HostAddress.fromString('localhost:27017')], + ...Object.fromEntries(DEFAULT_OPTIONS.entries()) + }; + + if (typeof seeds === 'string') { + seeds = [HostAddress.fromString(seeds)]; + } else if (!Array.isArray(seeds)) { + seeds = [seeds]; + } + + const seedlist: HostAddress[] = []; + for (const seed of seeds) { + if (typeof seed === 'string') { + seedlist.push(HostAddress.fromString(seed)); + } else if (seed instanceof HostAddress) { + seedlist.push(seed); + } else { + // FIXME(NODE-3483): May need to be a MongoParseError + throw new MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(seed)}`); + } + } + + const topologyType = topologyTypeFromOptions(options); + const topologyId = globalTopologyCounter++; + + const selectedHosts = + options.srvMaxHosts == null || + options.srvMaxHosts === 0 || + options.srvMaxHosts >= seedlist.length + ? seedlist + : shuffle(seedlist, options.srvMaxHosts); + + const serverDescriptions = new Map(); + for (const hostAddress of selectedHosts) { + serverDescriptions.set(hostAddress.toString(), new ServerDescription(hostAddress)); + } + + this.waitQueue = new List(); + this.s = { + // the id of this topology + id: topologyId, + // passed in options + options, + // initial seedlist of servers to connect to + seedlist, + // initial state + state: STATE_CLOSED, + // the topology description + description: new TopologyDescription( + topologyType, + serverDescriptions, + options.replicaSet, + undefined, + undefined, + undefined, + options + ), + serverSelectionTimeoutMS: options.serverSelectionTimeoutMS, + heartbeatFrequencyMS: options.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS, + // a map of server instances to normalized addresses + servers: new Map(), + credentials: options?.credentials, + clusterTime: undefined, + + detectShardedTopology: ev => this.detectShardedTopology(ev), + detectSrvRecords: ev => this.detectSrvRecords(ev) + }; + + this.mongoLogger = client.mongoLogger; + this.component = 'topology'; + + if (options.srvHost && !options.loadBalanced) { + this.s.srvPoller = + options.srvPoller ?? + new SrvPoller({ + heartbeatFrequencyMS: this.s.heartbeatFrequencyMS, + srvHost: options.srvHost, + srvMaxHosts: options.srvMaxHosts, + srvServiceName: options.srvServiceName + }); + + this.on(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + } + this.connectionLock = undefined; + } + + private detectShardedTopology(event: TopologyDescriptionChangedEvent) { + const previousType = event.previousDescription.type; + const newType = event.newDescription.type; + + const transitionToSharded = + previousType !== TopologyType.Sharded && newType === TopologyType.Sharded; + const srvListeners = this.s.srvPoller?.listeners(SrvPoller.SRV_RECORD_DISCOVERY); + const listeningToSrvPolling = !!srvListeners?.includes(this.s.detectSrvRecords); + + if (transitionToSharded && !listeningToSrvPolling) { + this.s.srvPoller?.on(SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + this.s.srvPoller?.start(); + } + } + + private detectSrvRecords(ev: SrvPollingEvent) { + const previousTopologyDescription = this.s.description; + this.s.description = this.s.description.updateFromSrvPollingEvent( + ev, + this.s.options.srvMaxHosts + ); + if (this.s.description === previousTopologyDescription) { + // Nothing changed, so return + return; + } + + updateServers(this); + + this.emitAndLog( + Topology.TOPOLOGY_DESCRIPTION_CHANGED, + new TopologyDescriptionChangedEvent( + this.s.id, + previousTopologyDescription, + this.s.description + ) + ); + } + + /** + * @returns A `TopologyDescription` for this topology + */ + get description(): TopologyDescription { + return this.s.description; + } + + get loadBalanced(): boolean { + return this.s.options.loadBalanced; + } + + get serverApi(): ServerApi | undefined { + return this.s.options.serverApi; + } + + /** Initiate server connect */ + async connect(options?: ConnectOptions): Promise { + this.connectionLock ??= this._connect(options); + try { + await this.connectionLock; + return this; + } finally { + this.connectionLock = undefined; + } + } + + private async _connect(options?: ConnectOptions): Promise { + options = options ?? {}; + if (this.s.state === STATE_CONNECTED) { + return this; + } + + stateTransition(this, STATE_CONNECTING); + + // emit SDAM monitoring events + this.emitAndLog(Topology.TOPOLOGY_OPENING, new TopologyOpeningEvent(this.s.id)); + + // emit an event for the topology change + this.emitAndLog( + Topology.TOPOLOGY_DESCRIPTION_CHANGED, + new TopologyDescriptionChangedEvent( + this.s.id, + new TopologyDescription(TopologyType.Unknown), // initial is always Unknown + this.s.description + ) + ); + + // connect all known servers, then attempt server selection to connect + const serverDescriptions = Array.from(this.s.description.servers.values()); + this.s.servers = new Map( + serverDescriptions.map(serverDescription => [ + serverDescription.address, + createAndConnectServer(this, serverDescription) + ]) + ); + + // In load balancer mode we need to fake a server description getting + // emitted from the monitor, since the monitor doesn't exist. + if (this.s.options.loadBalanced) { + for (const description of serverDescriptions) { + const newDescription = new ServerDescription(description.hostAddress, undefined, { + loadBalanced: this.s.options.loadBalanced + }); + this.serverUpdateHandler(newDescription); + } + } + + const serverSelectionTimeoutMS = this.client.s.options.serverSelectionTimeoutMS; + const readPreference = options.readPreference ?? ReadPreference.primary; + const timeoutContext = TimeoutContext.create({ + // TODO(NODE-6448): auto-connect ignores timeoutMS; potential future feature + timeoutMS: undefined, + serverSelectionTimeoutMS, + waitQueueTimeoutMS: this.client.s.options.waitQueueTimeoutMS + }); + const selectServerOptions = { + operationName: 'handshake', + ...options, + timeoutContext, + deprioritizedServers: new DeprioritizedServers() + }; + + try { + const server = await this.selectServer( + readPreferenceServerSelector(readPreference), + selectServerOptions + ); + + const skipPingOnConnect = this.s.options.__skipPingOnConnect === true; + if (!skipPingOnConnect) { + const connection = await server.pool.checkOut({ timeoutContext: timeoutContext }); + server.pool.checkIn(connection); + stateTransition(this, STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + + return this; + } + + stateTransition(this, STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + + return this; + } catch (error) { + this.close(); + throw error; + } + } + + closeCheckedOutConnections() { + for (const server of this.s.servers.values()) { + server.closeCheckedOutConnections(); + } + } + + /** Close this topology */ + close(): void { + if (this.s.state === STATE_CLOSED || this.s.state === STATE_CLOSING) { + return; + } + + for (const server of this.s.servers.values()) { + closeServer(server, this); + } + + this.s.servers.clear(); + + stateTransition(this, STATE_CLOSING); + + drainWaitQueue(this.waitQueue, new MongoTopologyClosedError()); + + if (this.s.srvPoller) { + this.s.srvPoller.stop(); + this.s.srvPoller.removeListener(SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + } + + this.removeListener(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + + stateTransition(this, STATE_CLOSED); + + // emit an event for close + this.emitAndLog(Topology.TOPOLOGY_CLOSED, new TopologyClosedEvent(this.s.id)); + } + + /** + * Selects a server according to the selection predicate provided + * + * @param selector - An optional selector to select servers by, defaults to a random selection within a latency window + * @param options - Optional settings related to server selection + * @param callback - The callback used to indicate success or failure + * @returns An instance of a `Server` meeting the criteria of the predicate provided + */ + async selectServer( + selector: string | ReadPreference | ServerSelector, + options: SelectServerOptions & Abortable + ): Promise { + let serverSelector; + if (typeof selector !== 'function') { + if (typeof selector === 'string') { + serverSelector = readPreferenceServerSelector(ReadPreference.fromString(selector)); + } else { + let readPreference; + if (selector instanceof ReadPreference) { + readPreference = selector; + } else { + ReadPreference.translate(options); + readPreference = options.readPreference || ReadPreference.primary; + } + + serverSelector = readPreferenceServerSelector(readPreference as ReadPreference); + } + } else { + serverSelector = selector; + } + + options = { serverSelectionTimeoutMS: this.s.serverSelectionTimeoutMS, ...options }; + if ( + this.client.mongoLogger?.willLog(MongoLoggableComponent.SERVER_SELECTION, SeverityLevel.DEBUG) + ) { + this.client.mongoLogger?.debug( + MongoLoggableComponent.SERVER_SELECTION, + new ServerSelectionStartedEvent(selector, this.description, options.operationName) + ); + } + let timeout; + if (options.timeoutContext) timeout = options.timeoutContext.serverSelectionTimeout; + else { + timeout = Timeout.expires(options.serverSelectionTimeoutMS ?? 0); + } + + const isSharded = this.description.type === TopologyType.Sharded; + const session = options.session; + const transaction = session && session.transaction; + + if (isSharded && transaction && transaction.server) { + if ( + this.client.mongoLogger?.willLog( + MongoLoggableComponent.SERVER_SELECTION, + SeverityLevel.DEBUG + ) + ) { + this.client.mongoLogger?.debug( + MongoLoggableComponent.SERVER_SELECTION, + new ServerSelectionSucceededEvent( + selector, + this.description, + transaction.server.pool.address, + options.operationName + ) + ); + } + + if (!options.timeoutContext || options.timeoutContext.clearServerSelectionTimeout) { + timeout?.clear(); + } + + return transaction.server; + } + + const { promise: serverPromise, resolve, reject } = promiseWithResolvers(); + + const waitQueueMember: ServerSelectionRequest = { + serverSelector, + topologyDescription: this.description, + mongoLogger: this.client.mongoLogger, + transaction, + resolve, + reject, + cancelled: false, + startTime: processTimeMS(), + operationName: options.operationName, + waitingLogged: false, + deprioritizedServers: options.deprioritizedServers + }; + + const abortListener = addAbortListener(options.signal, function () { + waitQueueMember.cancelled = true; + reject(this.reason); + }); + + this.waitQueue.push(waitQueueMember); + processWaitQueue(this); + + try { + timeout?.throwIfExpired(); + const server = await (timeout ? Promise.race([serverPromise, timeout]) : serverPromise); + if (options.timeoutContext?.csotEnabled() && server.description.minRoundTripTime !== 0) { + options.timeoutContext.minRoundTripTime = server.description.minRoundTripTime; + } + return server; + } catch (error) { + if (TimeoutError.is(error)) { + // Timeout + waitQueueMember.cancelled = true; + const timeoutError = new MongoServerSelectionError( + `Server selection timed out after ${timeout?.duration} ms`, + this.description + ); + if ( + this.client.mongoLogger?.willLog( + MongoLoggableComponent.SERVER_SELECTION, + SeverityLevel.DEBUG + ) + ) { + this.client.mongoLogger?.debug( + MongoLoggableComponent.SERVER_SELECTION, + new ServerSelectionFailedEvent( + selector, + this.description, + timeoutError, + options.operationName + ) + ); + } + + if (options.timeoutContext?.csotEnabled()) { + throw new MongoOperationTimeoutError('Timed out during server selection', { + cause: timeoutError + }); + } + throw timeoutError; + } + // Other server selection error + throw error; + } finally { + abortListener?.[kDispose](); + if (!options.timeoutContext || options.timeoutContext.clearServerSelectionTimeout) { + timeout?.clear(); + } + } + } + /** + * Update the internal TopologyDescription with a ServerDescription + * + * @param serverDescription - The server to update in the internal list of server descriptions + */ + serverUpdateHandler(serverDescription: ServerDescription): void { + if (!this.s.description.hasServer(serverDescription.address)) { + return; + } + + // ignore this server update if its from an outdated topologyVersion + if (isStaleServerDescription(this.s.description, serverDescription)) { + return; + } + + // these will be used for monitoring events later + const previousTopologyDescription = this.s.description; + const previousServerDescription = this.s.description.servers.get(serverDescription.address); + if (!previousServerDescription) { + return; + } + + // Driver Sessions Spec: "Whenever a driver receives a cluster time from + // a server it MUST compare it to the current highest seen cluster time + // for the deployment. If the new cluster time is higher than the + // highest seen cluster time it MUST become the new highest seen cluster + // time. Two cluster times are compared using only the BsonTimestamp + // value of the clusterTime embedded field." + const clusterTime = serverDescription.$clusterTime; + if (clusterTime) { + _advanceClusterTime(this, clusterTime); + } + + // If we already know all the information contained in this updated description, then + // we don't need to emit SDAM events, but still need to update the description, in order + // to keep client-tracked attributes like last update time and round trip time up to date + const equalDescriptions = + previousServerDescription && previousServerDescription.equals(serverDescription); + + // first update the TopologyDescription + this.s.description = this.s.description.update(serverDescription); + if (this.s.description.compatibilityError) { + this.emit(Topology.ERROR, new MongoCompatibilityError(this.s.description.compatibilityError)); + return; + } + + // emit monitoring events for this change + if (!equalDescriptions) { + const newDescription = this.s.description.servers.get(serverDescription.address); + if (newDescription) { + this.emit( + Topology.SERVER_DESCRIPTION_CHANGED, + new ServerDescriptionChangedEvent( + this.s.id, + serverDescription.address, + previousServerDescription, + newDescription + ) + ); + } + } + + // update server list from updated descriptions + updateServers(this, serverDescription); + + // attempt to resolve any outstanding server selection attempts + if (this.waitQueue.length > 0) { + processWaitQueue(this); + } + + if (!equalDescriptions) { + this.emitAndLog( + Topology.TOPOLOGY_DESCRIPTION_CHANGED, + new TopologyDescriptionChangedEvent( + this.s.id, + previousTopologyDescription, + this.s.description + ) + ); + } + } + + auth(credentials?: MongoCredentials, callback?: Callback): void { + if (typeof credentials === 'function') ((callback = credentials), (credentials = undefined)); + if (typeof callback === 'function') callback(undefined, true); + } + + isConnected(): boolean { + return this.s.state === STATE_CONNECTED; + } + + isDestroyed(): boolean { + return this.s.state === STATE_CLOSED; + } + + // NOTE: There are many places in code where we explicitly check the last hello + // to do feature support detection. This should be done any other way, but for + // now we will just return the first hello seen, which should suffice. + lastHello(): Document { + const serverDescriptions = Array.from(this.description.servers.values()); + if (serverDescriptions.length === 0) return {}; + const sd = serverDescriptions.filter( + (sd: ServerDescription) => sd.type !== ServerType.Unknown + )[0]; + + const result = sd || { maxWireVersion: this.description.commonWireVersion }; + return result; + } + + get commonWireVersion(): number { + return this.description.commonWireVersion; + } + + get logicalSessionTimeoutMinutes(): number | null { + return this.description.logicalSessionTimeoutMinutes; + } + + get clusterTime(): ClusterTime | undefined { + return this.s.clusterTime; + } + + set clusterTime(clusterTime: ClusterTime | undefined) { + this.s.clusterTime = clusterTime; + } +} + +/** Destroys a server, and removes all event listeners from the instance */ +function closeServer(server: Server, topology: Topology) { + for (const event of LOCAL_SERVER_EVENTS) { + server.removeAllListeners(event); + } + + server.close(); + topology.emitAndLog( + Topology.SERVER_CLOSED, + new ServerClosedEvent(topology.s.id, server.description.address) + ); + + for (const event of SERVER_RELAY_EVENTS) { + server.removeAllListeners(event); + } +} + +/** Predicts the TopologyType from options */ +function topologyTypeFromOptions(options?: TopologyOptions) { + if (options?.directConnection) { + return TopologyType.Single; + } + + if (options?.replicaSet) { + return TopologyType.ReplicaSetNoPrimary; + } + + if (options?.loadBalanced) { + return TopologyType.LoadBalanced; + } + + return TopologyType.Unknown; +} + +/** + * Creates new server instances and attempts to connect them + * + * @param topology - The topology that this server belongs to + * @param serverDescription - The description for the server to initialize and connect to + */ +function createAndConnectServer(topology: Topology, serverDescription: ServerDescription) { + topology.emitAndLog( + Topology.SERVER_OPENING, + new ServerOpeningEvent(topology.s.id, serverDescription.address) + ); + + const server = new Server(topology, serverDescription, topology.s.options); + for (const event of SERVER_RELAY_EVENTS) { + server.on(event, (e: any) => topology.emit(event, e)); + } + + server.on(Server.DESCRIPTION_RECEIVED, description => topology.serverUpdateHandler(description)); + + server.connect(); + return server; +} + +/** + * @param topology - Topology to update. + * @param incomingServerDescription - New server description. + */ +function updateServers(topology: Topology, incomingServerDescription?: ServerDescription) { + // update the internal server's description + if (incomingServerDescription && topology.s.servers.has(incomingServerDescription.address)) { + const server = topology.s.servers.get(incomingServerDescription.address); + if (server) { + server.s.description = incomingServerDescription; + if ( + incomingServerDescription.error instanceof MongoError && + incomingServerDescription.error.hasErrorLabel(MongoErrorLabel.ResetPool) + ) { + const interruptInUseConnections = incomingServerDescription.error.hasErrorLabel( + MongoErrorLabel.InterruptInUseConnections + ); + + server.pool.clear({ interruptInUseConnections }); + } else if (incomingServerDescription.error == null) { + const newTopologyType = topology.s.description.type; + const shouldMarkPoolReady = + incomingServerDescription.isDataBearing || + (incomingServerDescription.type !== ServerType.Unknown && + newTopologyType === TopologyType.Single); + if (shouldMarkPoolReady) { + server.pool.ready(); + } + } + } + } + + // add new servers for all descriptions we currently don't know about locally + for (const serverDescription of topology.description.servers.values()) { + if (!topology.s.servers.has(serverDescription.address)) { + const server = createAndConnectServer(topology, serverDescription); + topology.s.servers.set(serverDescription.address, server); + } + } + + // for all servers no longer known, remove their descriptions and destroy their instances + for (const entry of topology.s.servers) { + const serverAddress = entry[0]; + if (topology.description.hasServer(serverAddress)) { + continue; + } + + if (!topology.s.servers.has(serverAddress)) { + continue; + } + + const server = topology.s.servers.get(serverAddress); + topology.s.servers.delete(serverAddress); + + // prepare server for garbage collection + if (server) { + closeServer(server, topology); + } + } +} + +function drainWaitQueue(queue: List, drainError: MongoDriverError) { + while (queue.length) { + const waitQueueMember = queue.shift(); + if (!waitQueueMember) { + continue; + } + + if (!waitQueueMember.cancelled) { + if ( + waitQueueMember.mongoLogger?.willLog( + MongoLoggableComponent.SERVER_SELECTION, + SeverityLevel.DEBUG + ) + ) { + waitQueueMember.mongoLogger?.debug( + MongoLoggableComponent.SERVER_SELECTION, + new ServerSelectionFailedEvent( + waitQueueMember.serverSelector, + waitQueueMember.topologyDescription, + drainError, + waitQueueMember.operationName + ) + ); + } + waitQueueMember.reject(drainError); + } + } +} + +function processWaitQueue(topology: Topology) { + if (topology.s.state === STATE_CLOSED) { + drainWaitQueue(topology.waitQueue, new MongoTopologyClosedError()); + return; + } + + const isSharded = topology.description.type === TopologyType.Sharded; + const serverDescriptions = Array.from(topology.description.servers.values()); + const membersToProcess = topology.waitQueue.length; + for (let i = 0; i < membersToProcess; ++i) { + const waitQueueMember = topology.waitQueue.shift(); + if (!waitQueueMember) { + continue; + } + + if (waitQueueMember.cancelled) { + continue; + } + + let selectedDescriptions; + try { + const serverSelector = waitQueueMember.serverSelector; + const deprioritizedServers = waitQueueMember.deprioritizedServers; + selectedDescriptions = serverSelector + ? serverSelector(topology.description, serverDescriptions, deprioritizedServers) + : serverDescriptions; + } catch (selectorError) { + if ( + topology.client.mongoLogger?.willLog( + MongoLoggableComponent.SERVER_SELECTION, + SeverityLevel.DEBUG + ) + ) { + topology.client.mongoLogger?.debug( + MongoLoggableComponent.SERVER_SELECTION, + new ServerSelectionFailedEvent( + waitQueueMember.serverSelector, + topology.description, + selectorError, + waitQueueMember.operationName + ) + ); + } + waitQueueMember.reject(selectorError); + continue; + } + + let selectedServer: Server | undefined; + if (selectedDescriptions.length === 0) { + if (!waitQueueMember.waitingLogged) { + if ( + topology.client.mongoLogger?.willLog( + MongoLoggableComponent.SERVER_SELECTION, + SeverityLevel.INFORMATIONAL + ) + ) { + topology.client.mongoLogger?.info( + MongoLoggableComponent.SERVER_SELECTION, + new WaitingForSuitableServerEvent( + waitQueueMember.serverSelector, + topology.description, + topology.s.serverSelectionTimeoutMS !== 0 + ? topology.s.serverSelectionTimeoutMS - + (processTimeMS() - waitQueueMember.startTime) + : -1, + waitQueueMember.operationName + ) + ); + } + waitQueueMember.waitingLogged = true; + } + topology.waitQueue.push(waitQueueMember); + continue; + } else if (selectedDescriptions.length === 1) { + selectedServer = topology.s.servers.get(selectedDescriptions[0].address); + } else { + const descriptions = shuffle(selectedDescriptions, 2); + const server1 = topology.s.servers.get(descriptions[0].address); + const server2 = topology.s.servers.get(descriptions[1].address); + + selectedServer = + server1 && server2 && server1.s.operationCount < server2.s.operationCount + ? server1 + : server2; + } + + if (!selectedServer) { + const serverSelectionError = new MongoServerSelectionError( + 'server selection returned a server description but the server was not found in the topology', + topology.description + ); + if ( + topology.client.mongoLogger?.willLog( + MongoLoggableComponent.SERVER_SELECTION, + SeverityLevel.DEBUG + ) + ) { + topology.client.mongoLogger?.debug( + MongoLoggableComponent.SERVER_SELECTION, + new ServerSelectionFailedEvent( + waitQueueMember.serverSelector, + topology.description, + serverSelectionError, + waitQueueMember.operationName + ) + ); + } + waitQueueMember.reject(serverSelectionError); + return; + } + const transaction = waitQueueMember.transaction; + if (isSharded && transaction && transaction.isActive && selectedServer) { + transaction.pinServer(selectedServer); + } + + if ( + topology.client.mongoLogger?.willLog( + MongoLoggableComponent.SERVER_SELECTION, + SeverityLevel.DEBUG + ) + ) { + topology.client.mongoLogger?.debug( + MongoLoggableComponent.SERVER_SELECTION, + new ServerSelectionSucceededEvent( + waitQueueMember.serverSelector, + waitQueueMember.topologyDescription, + selectedServer.pool.address, + waitQueueMember.operationName + ) + ); + } + waitQueueMember.resolve(selectedServer); + } + + if (topology.waitQueue.length > 0) { + // ensure all server monitors attempt monitoring soon + for (const [, server] of topology.s.servers) { + queueMicrotask(function scheduleServerCheck() { + return server.requestCheck(); + }); + } + } +} + +function isStaleServerDescription( + topologyDescription: TopologyDescription, + incomingServerDescription: ServerDescription +) { + const currentServerDescription = topologyDescription.servers.get( + incomingServerDescription.address + ); + const currentTopologyVersion = currentServerDescription?.topologyVersion; + return ( + compareTopologyVersion(currentTopologyVersion, incomingServerDescription.topologyVersion) > 0 + ); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology_description.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology_description.ts new file mode 100644 index 00000000..a1c301db --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sdam/topology_description.ts @@ -0,0 +1,548 @@ +import { EJSON, type ObjectId } from '../bson'; +import * as WIRE_CONSTANTS from '../cmap/wire_protocol/constants'; +import { type MongoError, MongoRuntimeError, MongoStalePrimaryError } from '../error'; +import { compareObjectId, shuffle } from '../utils'; +import { ServerType, TopologyType } from './common'; +import { ServerDescription } from './server_description'; +import type { SrvPollingEvent } from './srv_polling'; + +// constants related to compatibility checks +const MIN_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_SERVER_VERSION; +const MAX_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_SERVER_VERSION; +const MIN_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_WIRE_VERSION; +const MAX_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_WIRE_VERSION; + +const MONGOS_OR_UNKNOWN = new Set([ServerType.Mongos, ServerType.Unknown]); +const MONGOS_OR_STANDALONE = new Set([ServerType.Mongos, ServerType.Standalone]); +const NON_PRIMARY_RS_MEMBERS = new Set([ + ServerType.RSSecondary, + ServerType.RSArbiter, + ServerType.RSOther +]); + +/** @public */ +export interface TopologyDescriptionOptions { + heartbeatFrequencyMS?: number; + localThresholdMS?: number; +} + +/** + * Representation of a deployment of servers + * @public + */ +export class TopologyDescription { + type: TopologyType; + setName: string | null; + maxSetVersion: number | null; + maxElectionId: ObjectId | null; + servers: Map; + stale: boolean; + compatible: boolean; + compatibilityError?: string; + logicalSessionTimeoutMinutes: number | null; + heartbeatFrequencyMS: number; + localThresholdMS: number; + commonWireVersion: number; + /** + * Create a TopologyDescription + */ + constructor( + topologyType: TopologyType, + serverDescriptions: Map | null = null, + setName: string | null = null, + maxSetVersion: number | null = null, + maxElectionId: ObjectId | null = null, + commonWireVersion: number | null = null, + options: TopologyDescriptionOptions | null = null + ) { + options = options ?? {}; + + this.type = topologyType ?? TopologyType.Unknown; + this.servers = serverDescriptions ?? new Map(); + this.stale = false; + this.compatible = true; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 0; + this.localThresholdMS = options.localThresholdMS ?? 15; + this.setName = setName ?? null; + this.maxElectionId = maxElectionId ?? null; + this.maxSetVersion = maxSetVersion ?? null; + this.commonWireVersion = commonWireVersion ?? 0; + + // determine server compatibility + for (const serverDescription of this.servers.values()) { + // Load balancer mode is always compatible. + if ( + serverDescription.type === ServerType.Unknown || + serverDescription.type === ServerType.LoadBalancer + ) { + continue; + } + + if (serverDescription.minWireVersion > MAX_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} requires wire version ${serverDescription.minWireVersion}, but this version of the driver only supports up to ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`; + } + + if (serverDescription.maxWireVersion < MIN_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} reports wire version ${serverDescription.maxWireVersion}, but this version of the driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION}).`; + break; + } + } + + // Whenever a client updates the TopologyDescription from a hello response, it MUST set + // TopologyDescription.logicalSessionTimeoutMinutes to the smallest logicalSessionTimeoutMinutes + // value among ServerDescriptions of all data-bearing server types. If any have a null + // logicalSessionTimeoutMinutes, then TopologyDescription.logicalSessionTimeoutMinutes MUST be + // set to null. + this.logicalSessionTimeoutMinutes = null; + for (const [, server] of this.servers) { + if (server.isReadable) { + if (server.logicalSessionTimeoutMinutes == null) { + // If any of the servers have a null logicalSessionsTimeout, then the whole topology does + this.logicalSessionTimeoutMinutes = null; + break; + } + + if (this.logicalSessionTimeoutMinutes == null) { + // First server with a non null logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = server.logicalSessionTimeoutMinutes; + continue; + } + + // Always select the smaller of the: + // current server logicalSessionsTimeout and the topologies logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = Math.min( + this.logicalSessionTimeoutMinutes, + server.logicalSessionTimeoutMinutes + ); + } + } + } + + /** + * Returns a new TopologyDescription based on the SrvPollingEvent + * @internal + */ + updateFromSrvPollingEvent(ev: SrvPollingEvent, srvMaxHosts = 0): TopologyDescription { + /** The SRV addresses defines the set of addresses we should be using */ + const incomingHostnames = ev.hostnames(); + const currentHostnames = new Set(this.servers.keys()); + + const hostnamesToAdd = new Set(incomingHostnames); + const hostnamesToRemove = new Set(); + for (const hostname of currentHostnames) { + // filter hostnamesToAdd (made from incomingHostnames) down to what is *not* present in currentHostnames + hostnamesToAdd.delete(hostname); + if (!incomingHostnames.has(hostname)) { + // If the SRV Records no longer include this hostname + // we have to stop using it + hostnamesToRemove.add(hostname); + } + } + + if (hostnamesToAdd.size === 0 && hostnamesToRemove.size === 0) { + // No new hosts to add and none to remove + return this; + } + + const serverDescriptions = new Map(this.servers); + for (const removedHost of hostnamesToRemove) { + serverDescriptions.delete(removedHost); + } + + if (hostnamesToAdd.size > 0) { + if (srvMaxHosts === 0) { + // Add all! + for (const hostToAdd of hostnamesToAdd) { + serverDescriptions.set(hostToAdd, new ServerDescription(hostToAdd)); + } + } else if (serverDescriptions.size < srvMaxHosts) { + // Add only the amount needed to get us back to srvMaxHosts + const selectedHosts = shuffle(hostnamesToAdd, srvMaxHosts - serverDescriptions.size); + for (const selectedHostToAdd of selectedHosts) { + serverDescriptions.set(selectedHostToAdd, new ServerDescription(selectedHostToAdd)); + } + } + } + + return new TopologyDescription( + this.type, + serverDescriptions, + this.setName, + this.maxSetVersion, + this.maxElectionId, + this.commonWireVersion, + { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS } + ); + } + + /** + * Returns a copy of this description updated with a given ServerDescription + * @internal + */ + update(serverDescription: ServerDescription): TopologyDescription { + const address = serverDescription.address; + + // potentially mutated values + let { type: topologyType, setName, maxSetVersion, maxElectionId, commonWireVersion } = this; + + const serverType = serverDescription.type; + const serverDescriptions = new Map(this.servers); + + // update common wire version + if (serverDescription.maxWireVersion !== 0) { + if (commonWireVersion === 0) { + commonWireVersion = serverDescription.maxWireVersion; + } else { + commonWireVersion = Math.min(commonWireVersion, serverDescription.maxWireVersion); + } + } + + if ( + typeof serverDescription.setName === 'string' && + typeof setName === 'string' && + serverDescription.setName !== setName + ) { + if (topologyType === TopologyType.Single) { + // "Single" Topology with setName mismatch is direct connection usage, mark unknown do not remove + serverDescription = new ServerDescription(address); + } else { + serverDescriptions.delete(address); + } + } + + // update the actual server description + serverDescriptions.set(address, serverDescription); + + if (topologyType === TopologyType.Single) { + // once we are defined as single, that never changes + return new TopologyDescription( + TopologyType.Single, + serverDescriptions, + setName, + maxSetVersion, + maxElectionId, + commonWireVersion, + { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS } + ); + } + + if (topologyType === TopologyType.Unknown) { + if (serverType === ServerType.Standalone && this.servers.size !== 1) { + serverDescriptions.delete(address); + } else { + topologyType = topologyTypeForServerType(serverType); + } + } + + if (topologyType === TopologyType.Sharded) { + if (!MONGOS_OR_UNKNOWN.has(serverType)) { + serverDescriptions.delete(address); + } + } + + if (topologyType === TopologyType.ReplicaSetNoPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + } + + if (serverType === ServerType.RSPrimary) { + const result = updateRsFromPrimary( + serverDescriptions, + serverDescription, + setName, + maxSetVersion, + maxElectionId + ); + + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + const result = updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName); + topologyType = result[0]; + setName = result[1]; + } + } + + if (topologyType === TopologyType.ReplicaSetWithPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + topologyType = checkHasPrimary(serverDescriptions); + } else if (serverType === ServerType.RSPrimary) { + const result = updateRsFromPrimary( + serverDescriptions, + serverDescription, + setName, + maxSetVersion, + maxElectionId + ); + + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + topologyType = updateRsWithPrimaryFromMember( + serverDescriptions, + serverDescription, + setName + ); + } else { + topologyType = checkHasPrimary(serverDescriptions); + } + } + + return new TopologyDescription( + topologyType, + serverDescriptions, + setName, + maxSetVersion, + maxElectionId, + commonWireVersion, + { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS } + ); + } + + get error(): MongoError | null { + const descriptionsWithError = Array.from(this.servers.values()).filter( + (sd: ServerDescription) => sd.error + ); + + if (descriptionsWithError.length > 0) { + return descriptionsWithError[0].error; + } + + return null; + } + + /** + * Determines if the topology description has any known servers + */ + get hasKnownServers(): boolean { + return Array.from(this.servers.values()).some( + (sd: ServerDescription) => sd.type !== ServerType.Unknown + ); + } + + /** + * Determines if this topology description has a data-bearing server available. + */ + get hasDataBearingServers(): boolean { + return Array.from(this.servers.values()).some((sd: ServerDescription) => sd.isDataBearing); + } + + /** + * Determines if the topology has a definition for the provided address + * @internal + */ + hasServer(address: string): boolean { + return this.servers.has(address); + } + + /** + * Returns a JSON-serializable representation of the TopologyDescription. This is primarily + * intended for use with JSON.stringify(). + * + * This method will not throw. + */ + toJSON() { + return EJSON.serialize(this); + } +} + +function topologyTypeForServerType(serverType: ServerType): TopologyType { + switch (serverType) { + case ServerType.Standalone: + return TopologyType.Single; + case ServerType.Mongos: + return TopologyType.Sharded; + case ServerType.RSPrimary: + return TopologyType.ReplicaSetWithPrimary; + case ServerType.RSOther: + case ServerType.RSSecondary: + return TopologyType.ReplicaSetNoPrimary; + default: + return TopologyType.Unknown; + } +} + +function updateRsFromPrimary( + serverDescriptions: Map, + serverDescription: ServerDescription, + setName: string | null = null, + maxSetVersion: number | null = null, + maxElectionId: ObjectId | null = null +): [TopologyType, string | null, number | null, ObjectId | null] { + const setVersionElectionIdMismatch = ( + serverDescription: ServerDescription, + maxSetVersion: number | null, + maxElectionId: ObjectId | null + ) => { + return ( + `primary marked stale due to electionId/setVersion mismatch:` + + ` server setVersion: ${serverDescription.setVersion},` + + ` server electionId: ${serverDescription.electionId},` + + ` topology setVersion: ${maxSetVersion},` + + ` topology electionId: ${maxElectionId}` + ); + }; + setName = setName || serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + + if (serverDescription.maxWireVersion >= 17) { + const electionIdComparison = compareObjectId(maxElectionId, serverDescription.electionId); + const maxElectionIdIsEqual = electionIdComparison === 0; + const maxElectionIdIsLess = electionIdComparison === -1; + const maxSetVersionIsLessOrEqual = + (maxSetVersion ?? -1) <= (serverDescription.setVersion ?? -1); + + if (maxElectionIdIsLess || (maxElectionIdIsEqual && maxSetVersionIsLessOrEqual)) { + // The reported electionId was greater + // or the electionId was equal and reported setVersion was greater + // Always update both values, they are a tuple + maxElectionId = serverDescription.electionId; + maxSetVersion = serverDescription.setVersion; + } else { + // Stale primary + // replace serverDescription with a default ServerDescription of type "Unknown" + serverDescriptions.set( + serverDescription.address, + new ServerDescription(serverDescription.address, undefined, { + error: new MongoStalePrimaryError( + setVersionElectionIdMismatch(serverDescription, maxSetVersion, maxElectionId) + ) + }) + ); + + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } else { + const electionId = serverDescription.electionId ? serverDescription.electionId : null; + if (serverDescription.setVersion && electionId) { + if (maxSetVersion && maxElectionId) { + if ( + maxSetVersion > serverDescription.setVersion || + compareObjectId(maxElectionId, electionId) > 0 + ) { + // this primary is stale, we must remove it + serverDescriptions.set( + serverDescription.address, + new ServerDescription(serverDescription.address, undefined, { + error: new MongoStalePrimaryError( + setVersionElectionIdMismatch(serverDescription, maxSetVersion, maxElectionId) + ) + }) + ); + + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } + + maxElectionId = serverDescription.electionId; + } + + if ( + serverDescription.setVersion != null && + (maxSetVersion == null || serverDescription.setVersion > maxSetVersion) + ) { + maxSetVersion = serverDescription.setVersion; + } + } + + // We've heard from the primary. Is it the same primary as before? + for (const [address, server] of serverDescriptions) { + if (server.type === ServerType.RSPrimary && server.address !== serverDescription.address) { + // Reset old primary's type to Unknown. + serverDescriptions.set( + address, + new ServerDescription(server.address, undefined, { + error: new MongoStalePrimaryError( + 'primary marked stale due to discovery of newer primary' + ) + }) + ); + + // There can only be one primary + break; + } + } + + // Discover new hosts from this primary's response. + serverDescription.allHosts.forEach((address: string) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new ServerDescription(address)); + } + }); + + // Remove hosts not in the response. + const currentAddresses = Array.from(serverDescriptions.keys()); + const responseAddresses = serverDescription.allHosts; + currentAddresses + .filter((addr: string) => responseAddresses.indexOf(addr) === -1) + .forEach((address: string) => { + serverDescriptions.delete(address); + }); + + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; +} + +function updateRsWithPrimaryFromMember( + serverDescriptions: Map, + serverDescription: ServerDescription, + setName: string | null = null +): TopologyType { + if (setName == null) { + // TODO(NODE-3483): should be an appropriate runtime error + throw new MongoRuntimeError('Argument "setName" is required if connected to a replica set'); + } + + if ( + setName !== serverDescription.setName || + (serverDescription.me && serverDescription.address !== serverDescription.me) + ) { + serverDescriptions.delete(serverDescription.address); + } + + return checkHasPrimary(serverDescriptions); +} + +function updateRsNoPrimaryFromMember( + serverDescriptions: Map, + serverDescription: ServerDescription, + setName: string | null = null +): [TopologyType, string | null] { + const topologyType = TopologyType.ReplicaSetNoPrimary; + setName = setName ?? serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [topologyType, setName]; + } + + serverDescription.allHosts.forEach((address: string) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new ServerDescription(address)); + } + }); + + if (serverDescription.me && serverDescription.address !== serverDescription.me) { + serverDescriptions.delete(serverDescription.address); + } + + return [topologyType, setName]; +} + +function checkHasPrimary(serverDescriptions: Map): TopologyType { + for (const serverDescription of serverDescriptions.values()) { + if (serverDescription.type === ServerType.RSPrimary) { + return TopologyType.ReplicaSetWithPrimary; + } + } + + return TopologyType.ReplicaSetNoPrimary; +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sessions.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sessions.ts new file mode 100644 index 00000000..72c35257 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sessions.ts @@ -0,0 +1,1284 @@ +import { setTimeout } from 'timers/promises'; + +import { Binary, ByteUtils, type Document, Long, type Timestamp } from './bson'; +import type { CommandOptions, Connection } from './cmap/connection'; +import { ConnectionPoolMetrics } from './cmap/metrics'; +import { type MongoDBResponse } from './cmap/wire_protocol/responses'; +import { PINNED, UNPINNED } from './constants'; +import type { AbstractCursor } from './cursor/abstract_cursor'; +import { + type AnyError, + isRetryableWriteError, + MongoAPIError, + MongoCompatibilityError, + MONGODB_ERROR_CODES, + type MongoDriverError, + MongoError, + MongoErrorLabel, + MongoExpiredSessionError, + MongoInvalidArgumentError, + MongoOperationTimeoutError, + MongoRuntimeError, + MongoServerError, + MongoTransactionError, + MongoWriteConcernError +} from './error'; +import type { MongoClient, MongoOptions } from './mongo_client'; +import { TypedEventEmitter } from './mongo_types'; +import { executeOperation } from './operations/execute_operation'; +import { RunCommandOperation } from './operations/run_command'; +import { ReadConcernLevel } from './read_concern'; +import { ReadPreference } from './read_preference'; +import { _advanceClusterTime, type ClusterTime, TopologyType } from './sdam/common'; +import { TimeoutContext } from './timeout'; +import { + isTransactionCommand, + Transaction, + type TransactionOptions, + TxnState +} from './transactions'; +import { + calculateDurationInMs, + commandSupportsAfterClusterTime, + isPromiseLike, + List, + MongoDBNamespace, + noop, + processTimeMS, + squashError, + uuidV4 +} from './utils'; +import { WriteConcern, type WriteConcernOptions, type WriteConcernSettings } from './write_concern'; + +/** @public */ +export interface ClientSessionOptions { + /** Whether causal consistency should be enabled on this session */ + causalConsistency?: boolean; + /** Whether all read operations should be read from the same snapshot for this session (NOTE: not compatible with `causalConsistency=true`) */ + snapshot?: boolean; + /** The default TransactionOptions to use for transactions started on this session. */ + defaultTransactionOptions?: TransactionOptions; + /** + * @public + * @experimental + * An overriding timeoutMS value to use for a client-side timeout. + * If not provided the session uses the timeoutMS specified on the MongoClient. + */ + defaultTimeoutMS?: number; + + /** @internal */ + owner?: symbol | AbstractCursor; + /** @internal */ + explicit?: boolean; + /** @internal */ + initialClusterTime?: ClusterTime; +} + +/** @public */ +export type WithTransactionCallback = (session: ClientSession) => Promise; + +/** @public */ +export type ClientSessionEvents = { + ended(session: ClientSession): void; +}; + +/** @public */ +export interface EndSessionOptions { + /** + * An optional error which caused the call to end this session + * @internal + */ + error?: AnyError; + force?: boolean; + forceClear?: boolean; + + /** Specifies the time an operation will run until it throws a timeout error */ + timeoutMS?: number; +} + +/** + * A class representing a client session on the server + * + * NOTE: not meant to be instantiated directly. + * @public + */ +export class ClientSession + extends TypedEventEmitter + implements AsyncDisposable +{ + /** @internal */ + client: MongoClient; + /** @internal */ + sessionPool: ServerSessionPool; + hasEnded: boolean; + clientOptions: MongoOptions; + supports: { causalConsistency: boolean }; + clusterTime?: ClusterTime; + operationTime?: Timestamp; + explicit: boolean; + /** @internal */ + owner?: symbol | AbstractCursor; + defaultTransactionOptions: TransactionOptions; + /** @internal */ + transaction: Transaction; + /** + * @internal + * Keeps track of whether or not the current transaction has attempted to be committed. Is + * initially undefined. Gets set to false when startTransaction is called. When commitTransaction is sent to server, if the commitTransaction succeeds, it is then set to undefined, otherwise, set to true + */ + private commitAttempted?: boolean; + public readonly snapshotEnabled: boolean; + + /** @internal */ + private _serverSession: ServerSession | null; + /** @internal */ + public snapshotTime?: Timestamp; + /** @internal */ + public pinnedConnection?: Connection; + /** @internal */ + public txnNumberIncrement: number; + /** + * @experimental + * Specifies the time an operation in a given `ClientSession` will run until it throws a timeout error + */ + timeoutMS?: number; + + /** @internal */ + public timeoutContext: TimeoutContext | null = null; + + /** + * Create a client session. + * @internal + * @param client - The current client + * @param sessionPool - The server session pool (Internal Class) + * @param options - Optional settings + * @param clientOptions - Optional settings provided when creating a MongoClient + */ + constructor( + client: MongoClient, + sessionPool: ServerSessionPool, + options: ClientSessionOptions, + clientOptions: MongoOptions + ) { + super(); + this.on('error', noop); + + if (client == null) { + // TODO(NODE-3483) + throw new MongoRuntimeError('ClientSession requires a MongoClient'); + } + + if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) { + // TODO(NODE-3483) + throw new MongoRuntimeError('ClientSession requires a ServerSessionPool'); + } + + options = options ?? {}; + + this.snapshotEnabled = options.snapshot === true; + if (options.causalConsistency === true && this.snapshotEnabled) { + throw new MongoInvalidArgumentError( + 'Properties "causalConsistency" and "snapshot" are mutually exclusive' + ); + } + + this.client = client; + this.sessionPool = sessionPool; + this.hasEnded = false; + this.clientOptions = clientOptions; + this.timeoutMS = options.defaultTimeoutMS ?? client.s.options?.timeoutMS; + + this.explicit = !!options.explicit; + this._serverSession = this.explicit ? this.sessionPool.acquire() : null; + this.txnNumberIncrement = 0; + + const defaultCausalConsistencyValue = this.explicit && options.snapshot !== true; + this.supports = { + // if we can enable causal consistency, do so by default + causalConsistency: options.causalConsistency ?? defaultCausalConsistencyValue + }; + + this.clusterTime = options.initialClusterTime; + + this.operationTime = undefined; + this.owner = options.owner; + this.defaultTransactionOptions = { ...options.defaultTransactionOptions }; + this.transaction = new Transaction(); + } + + /** The server id associated with this session */ + get id(): ServerSessionId | undefined { + return this.serverSession?.id; + } + + get serverSession(): ServerSession { + let serverSession = this._serverSession; + if (serverSession == null) { + if (this.explicit) { + throw new MongoRuntimeError('Unexpected null serverSession for an explicit session'); + } + if (this.hasEnded) { + throw new MongoRuntimeError('Unexpected null serverSession for an ended implicit session'); + } + serverSession = this.sessionPool.acquire(); + this._serverSession = serverSession; + } + return serverSession; + } + + get loadBalanced(): boolean { + return this.client.topology?.description.type === TopologyType.LoadBalanced; + } + + /** @internal */ + pin(conn: Connection): void { + if (this.pinnedConnection) { + throw TypeError('Cannot pin multiple connections to the same session'); + } + + this.pinnedConnection = conn; + conn.emit( + PINNED, + this.inTransaction() ? ConnectionPoolMetrics.TXN : ConnectionPoolMetrics.CURSOR + ); + } + + /** @internal */ + unpin(options?: { force?: boolean; forceClear?: boolean; error?: AnyError }): void { + if (this.loadBalanced) { + return maybeClearPinnedConnection(this, options); + } + + this.transaction.unpinServer(); + } + + get isPinned(): boolean { + return this.loadBalanced ? !!this.pinnedConnection : this.transaction.isPinned; + } + + /** + * Frees any client-side resources held by the current session. If a session is in a transaction, + * the transaction is aborted. + * + * Does not end the session on the server. + * + * @param options - Optional settings. Currently reserved for future use + */ + async endSession(options?: EndSessionOptions): Promise { + try { + if (this.inTransaction()) { + await this.abortTransaction({ ...options, throwTimeout: true }); + } + } catch (error) { + // spec indicates that we should ignore all errors for `endSessions` + if (error.name === 'MongoOperationTimeoutError') throw error; + squashError(error); + } finally { + if (!this.hasEnded) { + const serverSession = this.serverSession; + if (serverSession != null) { + // release the server session back to the pool + this.sessionPool.release(serverSession); + // Store a clone of the server session for reference (debugging) + this._serverSession = new ServerSession(serverSession); + } + // mark the session as ended, and emit a signal + this.hasEnded = true; + this.emit('ended', this); + } + maybeClearPinnedConnection(this, { force: true, ...options }); + } + } + /** + * An alias for {@link ClientSession.endSession|ClientSession.endSession()}. + */ + async [Symbol.asyncDispose]() { + await this.endSession({ force: true }); + } + + /** + * Advances the operationTime for a ClientSession. + * + * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to + */ + advanceOperationTime(operationTime: Timestamp): void { + if (this.operationTime == null) { + this.operationTime = operationTime; + return; + } + + if (operationTime.greaterThan(this.operationTime)) { + this.operationTime = operationTime; + } + } + + /** + * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession + * + * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature + */ + advanceClusterTime(clusterTime: ClusterTime): void { + if (!clusterTime || typeof clusterTime !== 'object') { + throw new MongoInvalidArgumentError('input cluster time must be an object'); + } + if (!clusterTime.clusterTime || clusterTime.clusterTime._bsontype !== 'Timestamp') { + throw new MongoInvalidArgumentError( + 'input cluster time "clusterTime" property must be a valid BSON Timestamp' + ); + } + if ( + !clusterTime.signature || + clusterTime.signature.hash?._bsontype !== 'Binary' || + (typeof clusterTime.signature.keyId !== 'bigint' && + typeof clusterTime.signature.keyId !== 'number' && + clusterTime.signature.keyId?._bsontype !== 'Long') // apparently we decode the key to number? + ) { + throw new MongoInvalidArgumentError( + 'input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId' + ); + } + + _advanceClusterTime(this, clusterTime); + } + + /** + * Used to determine if this session equals another + * + * @param session - The session to compare to + */ + equals(session: ClientSession): boolean { + if (!(session instanceof ClientSession)) { + return false; + } + + if (this.id == null || session.id == null) { + return false; + } + + return ByteUtils.equals(this.id.id.buffer, session.id.id.buffer); + } + + /** + * Increment the transaction number on the internal ServerSession + * + * @privateRemarks + * This helper increments a value stored on the client session that will be + * added to the serverSession's txnNumber upon applying it to a command. + * This is because the serverSession is lazily acquired after a connection is obtained + */ + incrementTransactionNumber(): void { + this.txnNumberIncrement += 1; + } + + /** @returns whether this session is currently in a transaction or not */ + inTransaction(): boolean { + return this.transaction.isActive; + } + + /** + * Starts a new transaction with the given options. + * + * @remarks + * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * @param options - Options for the transaction + */ + startTransaction(options?: TransactionOptions): void { + if (this.snapshotEnabled) { + throw new MongoCompatibilityError('Transactions are not supported in snapshot sessions'); + } + + if (this.inTransaction()) { + throw new MongoTransactionError('Transaction already in progress'); + } + + if (this.isPinned && this.transaction.isCommitted) { + this.unpin(); + } + + this.commitAttempted = false; + // increment txnNumber + this.incrementTransactionNumber(); + // create transaction state + this.transaction = new Transaction({ + readConcern: + options?.readConcern ?? + this.defaultTransactionOptions.readConcern ?? + this.clientOptions?.readConcern, + writeConcern: + options?.writeConcern ?? + this.defaultTransactionOptions.writeConcern ?? + this.clientOptions?.writeConcern, + readPreference: + options?.readPreference ?? + this.defaultTransactionOptions.readPreference ?? + this.clientOptions?.readPreference, + maxCommitTimeMS: options?.maxCommitTimeMS ?? this.defaultTransactionOptions.maxCommitTimeMS + }); + + this.transaction.transition(TxnState.STARTING_TRANSACTION); + } + + /** + * Commits the currently active transaction in this session. + * + * @param options - Optional options, can be used to override `defaultTimeoutMS`. + */ + async commitTransaction(options?: { timeoutMS?: number }): Promise { + if (this.transaction.state === TxnState.NO_TRANSACTION) { + throw new MongoTransactionError('No transaction started'); + } + + if ( + this.transaction.state === TxnState.STARTING_TRANSACTION || + this.transaction.state === TxnState.TRANSACTION_COMMITTED_EMPTY + ) { + // the transaction was never started, we can safely exit here + this.transaction.transition(TxnState.TRANSACTION_COMMITTED_EMPTY); + return; + } + + if (this.transaction.state === TxnState.TRANSACTION_ABORTED) { + throw new MongoTransactionError( + 'Cannot call commitTransaction after calling abortTransaction' + ); + } + + const command: { + commitTransaction: 1; + writeConcern?: WriteConcernSettings; + recoveryToken?: Document; + maxTimeMS?: number; + } = { commitTransaction: 1 }; + + const timeoutMS = + typeof options?.timeoutMS === 'number' + ? options.timeoutMS + : typeof this.timeoutMS === 'number' + ? this.timeoutMS + : null; + + const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern; + if (wc != null) { + if (timeoutMS == null && this.timeoutContext == null) { + WriteConcern.apply(command, { wtimeoutMS: 10000, w: 'majority', ...wc }); + } else { + const wcKeys = Object.keys(wc); + if (wcKeys.length > 2 || (!wcKeys.includes('wtimeoutMS') && !wcKeys.includes('wTimeoutMS'))) + // if the write concern was specified with wTimeoutMS, then we set both wtimeoutMS + // and wTimeoutMS, guaranteeing at least two keys, so if we have more than two keys, + // then we can automatically assume that we should add the write concern to the command. + // If it has 2 or fewer keys, we need to check that those keys aren't the wtimeoutMS + // or wTimeoutMS options before we add the write concern to the command + WriteConcern.apply(command, { ...wc, wtimeoutMS: undefined }); + } + } + + if (this.transaction.state === TxnState.TRANSACTION_COMMITTED || this.commitAttempted) { + if (timeoutMS == null && this.timeoutContext == null) { + WriteConcern.apply(command, { wtimeoutMS: 10000, ...wc, w: 'majority' }); + } else { + WriteConcern.apply(command, { w: 'majority', ...wc, wtimeoutMS: undefined }); + } + } + + if (typeof this.transaction.options.maxTimeMS === 'number') { + command.maxTimeMS = this.transaction.options.maxTimeMS; + } + + if (this.transaction.recoveryToken) { + command.recoveryToken = this.transaction.recoveryToken; + } + + const operation = new RunCommandOperation(new MongoDBNamespace('admin'), command, { + session: this, + readPreference: ReadPreference.primary, + bypassPinningCheck: true + }); + operation.maxAttempts = this.clientOptions.maxAdaptiveRetries + 1; + + const timeoutContext = + this.timeoutContext ?? + (typeof timeoutMS === 'number' + ? TimeoutContext.create({ + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS, + timeoutMS + }) + : null); + + try { + await executeOperation(this.client, operation, timeoutContext); + this.commitAttempted = undefined; + return; + } catch (firstCommitError) { + this.commitAttempted = true; + + const remainingAttempts = this.clientOptions.maxAdaptiveRetries + 1 - operation.attemptsMade; + if (remainingAttempts <= 0) { + throw firstCommitError; + } + + if (firstCommitError instanceof MongoError && isRetryableWriteError(firstCommitError)) { + // SPEC-1185: apply majority write concern when retrying commitTransaction + WriteConcern.apply(command, { wtimeoutMS: 10000, ...wc, w: 'majority' }); + // per txns spec, must unpin session in this case + this.unpin({ force: true }); + + try { + const op = new RunCommandOperation(new MongoDBNamespace('admin'), command, { + session: this, + readPreference: ReadPreference.primary, + bypassPinningCheck: true + }); + op.maxAttempts = remainingAttempts; + await executeOperation(this.client, op, timeoutContext); + return; + } catch (retryCommitError) { + // If the retry failed, we process that error instead of the original + if (shouldAddUnknownTransactionCommitResultLabel(retryCommitError)) { + retryCommitError.addErrorLabel(MongoErrorLabel.UnknownTransactionCommitResult); + } + + if (shouldUnpinAfterCommitError(retryCommitError)) { + this.unpin({ error: retryCommitError }); + } + + throw retryCommitError; + } + } + + if (shouldAddUnknownTransactionCommitResultLabel(firstCommitError)) { + firstCommitError.addErrorLabel(MongoErrorLabel.UnknownTransactionCommitResult); + } + + if (shouldUnpinAfterCommitError(firstCommitError)) { + this.unpin({ error: firstCommitError }); + } + + throw firstCommitError; + } finally { + this.transaction.transition(TxnState.TRANSACTION_COMMITTED); + } + } + + /** + * Aborts the currently active transaction in this session. + * + * @param options - Optional options, can be used to override `defaultTimeoutMS`. + */ + async abortTransaction(options?: { timeoutMS?: number }): Promise; + /** @internal */ + async abortTransaction(options?: { timeoutMS?: number; throwTimeout?: true }): Promise; + async abortTransaction(options?: { timeoutMS?: number; throwTimeout?: true }): Promise { + if (this.transaction.state === TxnState.NO_TRANSACTION) { + throw new MongoTransactionError('No transaction started'); + } + + if (this.transaction.state === TxnState.STARTING_TRANSACTION) { + // the transaction was never started, we can safely exit here + this.transaction.transition(TxnState.TRANSACTION_ABORTED); + return; + } + + if (this.transaction.state === TxnState.TRANSACTION_ABORTED) { + throw new MongoTransactionError('Cannot call abortTransaction twice'); + } + + if ( + this.transaction.state === TxnState.TRANSACTION_COMMITTED || + this.transaction.state === TxnState.TRANSACTION_COMMITTED_EMPTY + ) { + throw new MongoTransactionError( + 'Cannot call abortTransaction after calling commitTransaction' + ); + } + + const command: { + abortTransaction: 1; + writeConcern?: WriteConcernOptions; + recoveryToken?: Document; + } = { abortTransaction: 1 }; + + const timeoutMS = + typeof options?.timeoutMS === 'number' + ? options.timeoutMS + : this.timeoutContext?.csotEnabled() + ? this.timeoutContext.timeoutMS // refresh timeoutMS for abort operation + : typeof this.timeoutMS === 'number' + ? this.timeoutMS + : null; + + const timeoutContext = + timeoutMS != null + ? TimeoutContext.create({ + timeoutMS, + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS + }) + : null; + + const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern; + if (wc != null && timeoutMS == null) { + WriteConcern.apply(command, { wtimeoutMS: 10000, w: 'majority', ...wc }); + } + + if (this.transaction.recoveryToken) { + command.recoveryToken = this.transaction.recoveryToken; + } + + const operation = new RunCommandOperation(new MongoDBNamespace('admin'), command, { + session: this, + readPreference: ReadPreference.primary, + bypassPinningCheck: true + }); + + try { + await executeOperation(this.client, operation, timeoutContext); + this.unpin(); + return; + } catch (firstAbortError) { + this.unpin(); + + if (firstAbortError.name === 'MongoRuntimeError') throw firstAbortError; + if (options?.throwTimeout && firstAbortError.name === 'MongoOperationTimeoutError') { + throw firstAbortError; + } + + if (firstAbortError instanceof MongoError && isRetryableWriteError(firstAbortError)) { + try { + await executeOperation(this.client, operation, timeoutContext); + return; + } catch (secondAbortError) { + if (secondAbortError.name === 'MongoRuntimeError') throw secondAbortError; + if (options?.throwTimeout && secondAbortError.name === 'MongoOperationTimeoutError') { + throw secondAbortError; + } + // we do not retry the retry + } + } + + // The spec indicates that if the operation times out or fails with a non-retryable error, we should ignore all errors on `abortTransaction` + } finally { + this.transaction.transition(TxnState.TRANSACTION_ABORTED); + if (this.loadBalanced) { + maybeClearPinnedConnection(this, { force: false }); + } + } + } + + /** + * This is here to ensure that ClientSession is never serialized to BSON. + */ + toBSON(): never { + throw new MongoRuntimeError('ClientSession cannot be serialized to BSON.'); + } + + /** + * Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed. + * + * **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise. + * + * **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * **IMPORTANT:** When running an operation inside a `withTransaction` callback, if it is not + * provided the explicit session in its options, it will not be part of the transaction and it will not respect timeoutMS. + * + * + * @remarks + * - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function. + * - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error. + * - If the transaction is manually aborted within the provided function it will not throw. + * - If the driver needs to attempt to retry the operations, the provided function may be called multiple times. + * + * Checkout a descriptive example here: + * @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions + * + * If a command inside withTransaction fails: + * - It may cause the transaction on the server to be aborted. + * - This situation is normally handled transparently by the driver. + * - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not. + * - The driver will then retry the transaction indefinitely. + * + * To avoid this situation, the application must not silently handle errors within the provided function. + * If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction. + * + * @param fn - callback to run within a transaction + * @param options - optional settings for the transaction + * @returns A raw command response or undefined + */ + async withTransaction( + fn: WithTransactionCallback, + options?: TransactionOptions & { + /** + * Configures a timeoutMS expiry for the entire withTransactionCallback. + * + * @remarks + * - The remaining timeout will not be applied to callback operations that do not use the ClientSession. + * - Overriding timeoutMS for operations executed using the explicit session inside the provided callback will result in a client-side error. + */ + timeoutMS?: number; + } + ): Promise { + const MAX_TIMEOUT = 120_000; + + const timeoutMS = options?.timeoutMS ?? this.timeoutMS ?? null; + this.timeoutContext = + timeoutMS != null + ? TimeoutContext.create({ + timeoutMS, + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS + }) + : null; + + // 1. Define the following: + // 1.1 Record the current monotonic time, which will be used to enforce the 120-second / CSOT timeout before later retry attempts. + // 1.2 Set `transactionAttempt` to `0`. + // 1.3 Set `TIMEOUT_MS` to be `timeoutMS` if given, otherwise MAX_TIMEOUT (120-seconds). + + // Timeout Error propagation + // When the previously encountered error needs to be propagated because there is no more time for another attempt, + // and it is not already a timeout error, then: + // - A timeout error MUST be propagated instead. It MUST expose the previously encountered error as specified in + // the "Errors" section of the CSOT specification. + // - If exposing the previously encountered error from a timeout error is impossible in a driver, then the driver + // is exempt from the requirement and MUST propagate the previously encountered error as is. The timeout error + // MUST copy all error labels from the previously encountered error. + + // The spec describes timeout checks as "elapsed time < TIMEOUT_MS" (where elapsed = now - start). + // We precompute `deadline = now + remainingTimeMS` so each check becomes simply `now < deadline`. + const csotEnabled = !!this.timeoutContext?.csotEnabled(); + const remainingTimeMS = this.timeoutContext?.csotEnabled() + ? this.timeoutContext.remainingTimeMS + : MAX_TIMEOUT; + const deadline = processTimeMS() + remainingTimeMS; + + let committed = false; + let result: T; + + let lastError: Error | null = null; + + try { + retryTransaction: for ( + let transactionAttempt = 0, isRetry = false; + !committed; + ++transactionAttempt, isRetry = transactionAttempt > 0 + ) { + // 2. If `transactionAttempt` > 0: + if (isRetry) { + // 2.1 Calculate backoffMS to be jitter * min(BACKOFF_INITIAL * 1.5 ** (transactionAttempt), BACKOFF_MAX). + // If elapsed time + backoffMS > TIMEOUT_MS, then propagate the previously encountered error to the caller of + // withTransaction as per timeout error propagation and return immediately. Otherwise, sleep for backoffMS. + // 2.1.1 jitter is a random float between [0, 1), optionally including 1, depending on what is most natural + // for the given driver language. + // 2.1.2 transactionAttempt is the variable defined in step 1. + // 2.1.3 BACKOFF_INITIAL is 5ms + // 2.1.4 BACKOFF_MAX is 500ms + const BACKOFF_INITIAL_MS = 5; + const BACKOFF_MAX_MS = 500; + const BACKOFF_GROWTH = 1.5; + const jitter = Math.random(); + const backoffMS = + jitter * + Math.min(BACKOFF_INITIAL_MS * BACKOFF_GROWTH ** transactionAttempt, BACKOFF_MAX_MS); + + if (processTimeMS() + backoffMS >= deadline) { + throw makeTimeoutError( + lastError ?? + new MongoRuntimeError( + `Transaction retry did not record an error: should never occur. Please file a bug.` + ), + csotEnabled + ); + } + + await setTimeout(backoffMS); + } + + // 3. Invoke startTransaction on the session and increment transactionAttempt. If TransactionOptions were + // specified in the call to withTransaction, those MUST be used for startTransaction. Note that + // ClientSession.defaultTransactionOptions will be used in the absence of any explicit TransactionOptions. + // 4. If startTransaction reported an error, propagate that error to the caller of withTransaction as is and + // return immediately. + this.startTransaction(options); + + try { + // 5. Invoke the callback. Drivers MUST ensure that the ClientSession can be accessed within the callback + // (e.g. pass ClientSession as the first parameter, rely on lexical scoping). Drivers MAY pass additional + // parameters as needed (e.g. user data solicited by withTransaction). + const promise = fn(this); + if (!isPromiseLike(promise)) { + throw new MongoInvalidArgumentError( + 'Function provided to `withTransaction` must return a Promise' + ); + } + + // 6. Control returns to withTransaction. Determine the current state of the ClientSession and whether the + // callback reported an error (e.g. thrown exception, error output parameter). + result = await promise; + + // 8. If the ClientSession is in the "no transaction", "transaction aborted", or "transaction committed" + // state, assume the callback intentionally aborted or committed the transaction and return immediately. + if ( + this.transaction.state === TxnState.NO_TRANSACTION || + this.transaction.state === TxnState.TRANSACTION_COMMITTED || + this.transaction.state === TxnState.TRANSACTION_ABORTED + ) { + return result; + } + } catch (fnError) { + // 7. If the callback reported an error + if (!(fnError instanceof MongoError) || fnError instanceof MongoInvalidArgumentError) { + // This first preemptive abort regardless of TxnState isn't spec, + // and it's unclear whether it's serving a practical purpose, but this logic is OLD + await this.abortTransaction(); + throw fnError; + } + + lastError = fnError; + + // 7.1 If the ClientSession is in the "starting transaction" or "transaction in progress" + // state, invoke abortTransaction on the session. + if ( + this.transaction.state === TxnState.STARTING_TRANSACTION || + this.transaction.state === TxnState.TRANSACTION_IN_PROGRESS + ) { + await this.abortTransaction(); + } + + // 7.2 If the callback's error includes a "TransientTransactionError" label, jump back to step two. + if (fnError.hasErrorLabel(MongoErrorLabel.TransientTransactionError)) { + if (processTimeMS() >= deadline) { + throw makeTimeoutError(lastError, csotEnabled); + } + continue retryTransaction; + } + + // 7.3 If the callback's error includes a "UnknownTransactionCommitResult" label, the callback must + // have manually committed a transaction, propagate the callback's error to the caller of withTransaction + // as is and return immediately. + // 7.4 Otherwise, propagate the callback's error to the caller of withTransaction as is and return immediately. + throw fnError; + } + + retryCommit: while (!committed) { + try { + // 9. Invoke commitTransaction on the session. + await this.commitTransaction(); + committed = true; + } catch (commitError) { + // 10. If commitTransaction reported an error: + lastError = commitError; + + // 10.1 If the commitTransaction error includes a UnknownTransactionCommitResult label and the error is + // not MaxTimeMSExpired + if ( + commitError.hasErrorLabel(MongoErrorLabel.UnknownTransactionCommitResult) && + !isMaxTimeMSExpiredError(commitError) + ) { + // 10.1.1 If the elapsed time of withTransaction exceeded TIMEOUT_MS, propagate the commitTransaction + // error to the caller of withTransaction as per timeout error propagation and return immediately. + if (processTimeMS() >= deadline) { + throw makeTimeoutError(commitError, csotEnabled); + } + // 10.1.2 Otherwise, jump back to step nine. We will trust commitTransaction to apply a majority write + // concern on retry attempts (see: Majority write concern is used when retrying commitTransaction). + continue retryCommit; + } + + // 10.2 If the commitTransaction error includes a TransientTransactionError label, jump back to step two. + if (commitError.hasErrorLabel(MongoErrorLabel.TransientTransactionError)) { + continue retryTransaction; + } + + // 10.3 Otherwise, propagate the commitTransaction error to the caller of withTransaction as is and return + // immediately. + throw commitError; + } + } + } + + // 11. The transaction was committed successfully. Return immediately. + // @ts-expect-error Result is always defined if we reach here, the for-loop above convinces TS it is not. + return result; + } finally { + this.timeoutContext = null; + } + } +} + +function makeTimeoutError(cause: Error, csotEnabled: boolean): Error { + // Async APIs know how to cancel themselves and might return CSOT error + if (cause instanceof MongoOperationTimeoutError) { + return cause; + } + if (csotEnabled) { + const timeoutError = new MongoOperationTimeoutError('Timed out during withTransaction', { + cause + }); + if (cause instanceof MongoError) { + for (const label of cause.errorLabels) { + timeoutError.addErrorLabel(label); + } + } + return timeoutError; + } + return cause; +} + +const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([ + 'CannotSatisfyWriteConcern', + 'UnknownReplWriteConcern', + 'UnsatisfiableWriteConcern' +]); + +function shouldUnpinAfterCommitError(commitError: Error) { + if (commitError instanceof MongoError) { + if ( + isRetryableWriteError(commitError) || + commitError instanceof MongoWriteConcernError || + isMaxTimeMSExpiredError(commitError) + ) { + if (isUnknownTransactionCommitResult(commitError)) { + // per txns spec, must unpin session in this case + return true; + } + } else if (commitError.hasErrorLabel(MongoErrorLabel.TransientTransactionError)) { + return true; + } + } + return false; +} + +function shouldAddUnknownTransactionCommitResultLabel(commitError: MongoError) { + let ok = isRetryableWriteError(commitError); + ok ||= commitError instanceof MongoWriteConcernError; + ok ||= isMaxTimeMSExpiredError(commitError); + ok &&= isUnknownTransactionCommitResult(commitError); + return ok; +} + +function isUnknownTransactionCommitResult(err: MongoError): err is MongoError { + const isNonDeterministicWriteConcernError = + err instanceof MongoServerError && + err.codeName && + NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName); + + return ( + isMaxTimeMSExpiredError(err) || + (!isNonDeterministicWriteConcernError && + err.code !== MONGODB_ERROR_CODES.UnsatisfiableWriteConcern && + err.code !== MONGODB_ERROR_CODES.UnknownReplWriteConcern) + ); +} + +export function maybeClearPinnedConnection( + session: ClientSession, + options?: EndSessionOptions +): void { + // unpin a connection if it has been pinned + const conn = session.pinnedConnection; + const error = options?.error; + + if ( + session.inTransaction() && + error && + error instanceof MongoError && + error.hasErrorLabel(MongoErrorLabel.TransientTransactionError) + ) { + return; + } + + const topology = session.client.topology; + // NOTE: the spec talks about what to do on a network error only, but the tests seem to + // to validate that we don't unpin on _all_ errors? + if (conn && topology != null) { + const servers = Array.from(topology.s.servers.values()); + const loadBalancer = servers[0]; + + if (options?.error == null || options?.force) { + loadBalancer.pool.checkIn(conn); + session.pinnedConnection = undefined; + conn.emit( + UNPINNED, + session.transaction.state !== TxnState.NO_TRANSACTION + ? ConnectionPoolMetrics.TXN + : ConnectionPoolMetrics.CURSOR + ); + + if (options?.forceClear) { + loadBalancer.pool.clear({ serviceId: conn.serviceId }); + } + } + } +} + +function isMaxTimeMSExpiredError(err: MongoError): boolean { + if (err == null || !(err instanceof MongoServerError)) { + return false; + } + + return ( + err.code === MONGODB_ERROR_CODES.MaxTimeMSExpired || + err.writeConcernError?.code === MONGODB_ERROR_CODES.MaxTimeMSExpired + ); +} + +/** @public */ +export type ServerSessionId = { id: Binary }; + +/** + * Reflects the existence of a session on the server. Can be reused by the session pool. + * WARNING: not meant to be instantiated directly. For internal use only. + * @public + */ +export class ServerSession { + id: ServerSessionId; + lastUse: number; + txnNumber: number; + isDirty: boolean; + + /** @internal */ + constructor(cloned?: ServerSession | null) { + if (cloned != null) { + const idBytes = ByteUtils.allocateUnsafe(16); + idBytes.set(cloned.id.id.buffer); + this.id = { id: new Binary(idBytes, cloned.id.id.sub_type) }; + this.lastUse = cloned.lastUse; + this.txnNumber = cloned.txnNumber; + this.isDirty = cloned.isDirty; + return; + } + this.id = { id: new Binary(uuidV4(), Binary.SUBTYPE_UUID) }; + this.lastUse = processTimeMS(); + this.txnNumber = 0; + this.isDirty = false; + } + + /** + * Determines if the server session has timed out. + * + * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes" + */ + hasTimedOut(sessionTimeoutMinutes: number): boolean { + // Take the difference of the lastUse timestamp and now, which will result in a value in + // milliseconds, and then convert milliseconds to minutes to compare to `sessionTimeoutMinutes` + const idleTimeMinutes = Math.round( + ((calculateDurationInMs(this.lastUse) % 86400000) % 3600000) / 60000 + ); + + return idleTimeMinutes > sessionTimeoutMinutes - 1; + } +} + +/** + * Maintains a pool of Server Sessions. + * For internal use only + * @internal + */ +export class ServerSessionPool { + client: MongoClient; + sessions: List; + + constructor(client: MongoClient) { + if (client == null) { + throw new MongoRuntimeError('ServerSessionPool requires a MongoClient'); + } + + this.client = client; + this.sessions = new List(); + } + + /** + * Acquire a Server Session from the pool. + * Iterates through each session in the pool, removing any stale sessions + * along the way. The first non-stale session found is removed from the + * pool and returned. If no non-stale session is found, a new ServerSession is created. + */ + acquire(): ServerSession { + const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10; + + let session: ServerSession | null = null; + + // Try to obtain from session pool + while (this.sessions.length > 0) { + const potentialSession = this.sessions.shift(); + if ( + potentialSession != null && + (!!this.client.topology?.loadBalanced || + !potentialSession.hasTimedOut(sessionTimeoutMinutes)) + ) { + session = potentialSession; + break; + } + } + + // If nothing valid came from the pool make a new one + if (session == null) { + session = new ServerSession(); + } + + return session; + } + + /** + * Release a session to the session pool + * Adds the session back to the session pool if the session has not timed out yet. + * This method also removes any stale sessions from the pool. + * + * @param session - The session to release to the pool + */ + release(session: ServerSession): void { + const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10; + + if (this.client.topology?.loadBalanced && !sessionTimeoutMinutes) { + this.sessions.unshift(session); + } + + if (!sessionTimeoutMinutes) { + return; + } + + this.sessions.prune(session => session.hasTimedOut(sessionTimeoutMinutes)); + + if (!session.hasTimedOut(sessionTimeoutMinutes)) { + if (session.isDirty) { + return; + } + + // otherwise, readd this session to the session pool + this.sessions.unshift(session); + } + } +} + +/** + * Optionally decorate a command with sessions specific keys + * + * @param session - the session tracking transaction state + * @param command - the command to decorate + * @param options - Optional settings passed to calling operation + * + * @internal + */ +export function applySession( + session: ClientSession, + command: Document, + options: CommandOptions +): MongoDriverError | undefined { + if (session.hasEnded) { + return new MongoExpiredSessionError(); + } + + // May acquire serverSession here + const serverSession = session.serverSession; + if (serverSession == null) { + return new MongoRuntimeError('Unable to acquire server session'); + } + + if (options.writeConcern?.w === 0) { + if (session && session.explicit) { + // Error if user provided an explicit session to an unacknowledged write (SPEC-1019) + return new MongoAPIError('Cannot have explicit session with unacknowledged writes'); + } + return; + } + + // mark the last use of this session, and apply the `lsid` + serverSession.lastUse = processTimeMS(); + command.lsid = serverSession.id; + + const inTxnOrTxnCommand = session.inTransaction() || isTransactionCommand(command); + const isRetryableWrite = !!options.willRetryWrite; + + if (isRetryableWrite || inTxnOrTxnCommand) { + serverSession.txnNumber += session.txnNumberIncrement; + session.txnNumberIncrement = 0; + // TODO(NODE-2674): Preserve int64 sent from MongoDB + command.txnNumber = Long.fromNumber(serverSession.txnNumber); + } + + if (!inTxnOrTxnCommand) { + if (session.transaction.state !== TxnState.NO_TRANSACTION) { + session.transaction.transition(TxnState.NO_TRANSACTION); + } + + if ( + session.supports.causalConsistency && + session.operationTime && + commandSupportsAfterClusterTime(command) + ) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } else if (session.snapshotEnabled) { + command.readConcern = command.readConcern || { level: ReadConcernLevel.snapshot }; + if (session.snapshotTime != null) { + Object.assign(command.readConcern, { atClusterTime: session.snapshotTime }); + } + } + + return; + } + + // now attempt to apply transaction-specific sessions data + + // `autocommit` must always be false to differentiate from retryable writes + command.autocommit = false; + + if (session.transaction.state === TxnState.STARTING_TRANSACTION) { + command.startTransaction = true; + + const readConcern = + session.transaction.options.readConcern || session?.clientOptions?.readConcern; + if (readConcern) { + command.readConcern = readConcern; + } + + if (session.supports.causalConsistency && session.operationTime) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } + } + return; +} + +export function updateSessionFromResponse(session: ClientSession, document: MongoDBResponse): void { + if (document.$clusterTime) { + _advanceClusterTime(session, document.$clusterTime); + } + + if (document.operationTime && session && session.supports.causalConsistency) { + session.advanceOperationTime(document.operationTime); + } + + if (document.recoveryToken && session && session.inTransaction()) { + session.transaction._recoveryToken = document.recoveryToken; + } + + if (session?.snapshotEnabled && session.snapshotTime == null) { + // find and aggregate commands return atClusterTime on the cursor + // distinct includes it in the response body + const atClusterTime = document.atClusterTime; + if (atClusterTime) { + session.snapshotTime = atClusterTime; + } + } + + if (session.transaction.state === TxnState.STARTING_TRANSACTION) { + if (document.ok === 1) { + session.transaction.transition(TxnState.TRANSACTION_IN_PROGRESS); + } else { + const error = new MongoServerError(document.toObject()); + const isRetryableError = error.hasErrorLabel(MongoErrorLabel.RetryableError); + + if (!isRetryableError) { + session.transaction.transition(TxnState.TRANSACTION_IN_PROGRESS); + } + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sort.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sort.ts new file mode 100644 index 00000000..0b239ddd --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/sort.ts @@ -0,0 +1,141 @@ +import { MongoInvalidArgumentError } from './error'; + +/** @public */ +export type SortDirection = + | 1 + | -1 + | 'asc' + | 'desc' + | 'ascending' + | 'descending' + | { readonly $meta: string }; + +/** @public */ +export type Sort = + | string + | Exclude + | ReadonlyArray + | { readonly [key: string]: SortDirection } + | ReadonlyMap + | ReadonlyArray + | readonly [string, SortDirection]; + +/** Below stricter types were created for sort that correspond with type that the cmd takes */ + +/** @public */ +export type SortDirectionForCmd = 1 | -1 | { $meta: string }; + +/** @public */ +export type SortForCmd = Map; + +/** @internal */ +type SortPairForCmd = [string, SortDirectionForCmd]; + +/** @internal */ +function prepareDirection(direction: any = 1): SortDirectionForCmd { + const value = `${direction}`.toLowerCase(); + if (isMeta(direction)) return direction; + switch (value) { + case 'ascending': + case 'asc': + case '1': + return 1; + case 'descending': + case 'desc': + case '-1': + return -1; + default: + throw new MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(direction)}`); + } +} + +/** @internal */ +function isMeta(t: SortDirection): t is { $meta: string } { + return typeof t === 'object' && t != null && '$meta' in t && typeof t.$meta === 'string'; +} + +/** @internal */ +function isPair(t: Sort): t is readonly [string, SortDirection] { + if (Array.isArray(t) && t.length === 2) { + try { + prepareDirection(t[1]); + return true; + } catch { + return false; + } + } + return false; +} + +function isDeep(t: Sort): t is ReadonlyArray { + return Array.isArray(t) && Array.isArray(t[0]); +} + +function isMap(t: Sort): t is ReadonlyMap { + return t instanceof Map && t.size > 0; +} + +function isReadonlyArray(value: any): value is readonly T[] { + return Array.isArray(value); +} + +/** @internal */ +function pairToMap(v: readonly [string, SortDirection]): SortForCmd { + return new Map([[`${v[0]}`, prepareDirection([v[1]])]]); +} + +/** @internal */ +function deepToMap(t: ReadonlyArray): SortForCmd { + const sortEntries: SortPairForCmd[] = t.map(([k, v]) => [`${k}`, prepareDirection(v)]); + return new Map(sortEntries); +} + +/** @internal */ +function stringsToMap(t: ReadonlyArray): SortForCmd { + const sortEntries: SortPairForCmd[] = t.map(key => [`${key}`, 1]); + return new Map(sortEntries); +} + +/** @internal */ +function objectToMap(t: { readonly [key: string]: SortDirection }): SortForCmd { + const sortEntries: SortPairForCmd[] = Object.entries(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} + +/** @internal */ +function mapToMap(t: ReadonlyMap): SortForCmd { + const sortEntries: SortPairForCmd[] = Array.from(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} + +/** converts a Sort type into a type that is valid for the server (SortForCmd) */ +export function formatSort( + sort: Sort | undefined, + direction?: SortDirection +): SortForCmd | undefined { + if (sort == null) return undefined; + + if (typeof sort === 'string') return new Map([[sort, prepareDirection(direction)]]); // 'fieldName' + + if (typeof sort !== 'object') { + throw new MongoInvalidArgumentError( + `Invalid sort format: ${JSON.stringify(sort)} Sort must be a valid object` + ); + } + + if (!isReadonlyArray(sort)) { + if (isMap(sort)) return mapToMap(sort); // Map + if (Object.keys(sort).length) return objectToMap(sort); // { [fieldName: string]: SortDirection } + return undefined; + } + if (!sort.length) return undefined; + if (isDeep(sort)) return deepToMap(sort); // [ [fieldName, sortDir], [fieldName, sortDir] ... ] + if (isPair(sort)) return pairToMap(sort); // [ fieldName, sortDir ] + return stringsToMap(sort); // [ fieldName, fieldName ] +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/timeout.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/timeout.ts new file mode 100644 index 00000000..26e04943 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/timeout.ts @@ -0,0 +1,405 @@ +import { clearTimeout, setTimeout } from 'timers'; + +import { type Document } from './bson'; +import { MongoInvalidArgumentError, MongoOperationTimeoutError, MongoRuntimeError } from './error'; +import { type ClientSession } from './sessions'; +import { csotMin, noop, squashError } from './utils'; + +/** @internal */ +export class TimeoutError extends Error { + duration: number; + override get name(): 'TimeoutError' { + return 'TimeoutError'; + } + + constructor(message: string, options: { cause?: Error; duration: number }) { + super(message, options); + this.duration = options.duration; + } + + static is(error: unknown): error is TimeoutError { + return ( + error != null && typeof error === 'object' && 'name' in error && error.name === 'TimeoutError' + ); + } +} + +type Executor = ConstructorParameters>[0]; +type Reject = Parameters>[0]>[1]; +/** + * @internal + * This class is an abstraction over timeouts + * The Timeout class can only be in the pending or rejected states. It is guaranteed not to resolve + * if interacted with exclusively through its public API + * */ +export class Timeout extends Promise { + private id?: NodeJS.Timeout; + + public readonly start: number; + public ended: number | null = null; + public duration: number; + private timedOut = false; + public cleared = false; + + get remainingTime(): number { + if (this.timedOut) return 0; + if (this.duration === 0) return Infinity; + return this.start + this.duration - Math.trunc(performance.now()); + } + + get timeElapsed(): number { + return Math.trunc(performance.now()) - this.start; + } + + /** Create a new timeout that expires in `duration` ms */ + private constructor( + executor: Executor = () => null, + options?: { duration: number; unref?: true; rejection?: Error } + ) { + const duration = options?.duration ?? 0; + const unref = !!options?.unref; + const rejection = options?.rejection; + + if (duration < 0) { + throw new MongoInvalidArgumentError('Cannot create a Timeout with a negative duration'); + } + + let reject!: Reject; + super((_, promiseReject) => { + reject = promiseReject; + + executor(noop, promiseReject); + }); + + this.duration = duration; + this.start = Math.trunc(performance.now()); + + if (rejection == null && this.duration > 0) { + this.id = setTimeout(() => { + this.ended = Math.trunc(performance.now()); + this.timedOut = true; + reject(new TimeoutError(`Expired after ${duration}ms`, { duration })); + }, this.duration); + if (typeof this.id.unref === 'function' && unref) { + // Ensure we do not keep the Node.js event loop running + this.id.unref(); + } + } else if (rejection != null) { + this.ended = Math.trunc(performance.now()); + this.timedOut = true; + reject(rejection); + } + } + + /** + * Clears the underlying timeout. This method is idempotent + */ + clear(): void { + clearTimeout(this.id); + this.id = undefined; + this.timedOut = false; + this.cleared = true; + } + + throwIfExpired(): void { + if (this.timedOut) { + // This method is invoked when someone wants to throw immediately instead of await the result of this promise + // Since they won't be handling the rejection from the promise (because we're about to throw here) + // attach handling to prevent this from bubbling up to Node.js + this.then(undefined, squashError); + throw new TimeoutError('Timed out', { duration: this.duration }); + } + } + + public static expires(duration: number, unref?: true): Timeout { + return new Timeout(undefined, { duration, unref }); + } + + static override reject(rejection?: Error): Timeout { + return new Timeout(undefined, { duration: 0, unref: true, rejection }); + } +} + +/** @internal */ +export type TimeoutContextOptions = (LegacyTimeoutContextOptions | CSOTTimeoutContextOptions) & { + session?: ClientSession; +}; + +/** @internal */ +export type LegacyTimeoutContextOptions = { + serverSelectionTimeoutMS: number; + waitQueueTimeoutMS: number; + socketTimeoutMS?: number; +}; + +/** @internal */ +export type CSOTTimeoutContextOptions = { + timeoutMS: number; + serverSelectionTimeoutMS: number; + socketTimeoutMS?: number; +}; + +function isLegacyTimeoutContextOptions(v: unknown): v is LegacyTimeoutContextOptions { + return ( + v != null && + typeof v === 'object' && + 'serverSelectionTimeoutMS' in v && + typeof v.serverSelectionTimeoutMS === 'number' && + 'waitQueueTimeoutMS' in v && + typeof v.waitQueueTimeoutMS === 'number' + ); +} + +function isCSOTTimeoutContextOptions(v: unknown): v is CSOTTimeoutContextOptions { + return ( + v != null && + typeof v === 'object' && + 'serverSelectionTimeoutMS' in v && + typeof v.serverSelectionTimeoutMS === 'number' && + 'timeoutMS' in v && + typeof v.timeoutMS === 'number' + ); +} + +/** @internal */ +export abstract class TimeoutContext { + static create(options: TimeoutContextOptions): TimeoutContext { + if (options.session?.timeoutContext != null) return options.session?.timeoutContext; + if (isCSOTTimeoutContextOptions(options)) return new CSOTTimeoutContext(options); + else if (isLegacyTimeoutContextOptions(options)) return new LegacyTimeoutContext(options); + else throw new MongoRuntimeError('Unrecognized options'); + } + + abstract get maxTimeMS(): number | null; + + abstract get serverSelectionTimeout(): Timeout | null; + + abstract get connectionCheckoutTimeout(): Timeout | null; + + abstract get clearServerSelectionTimeout(): boolean; + + abstract get timeoutForSocketWrite(): Timeout | null; + + abstract get timeoutForSocketRead(): Timeout | null; + + abstract csotEnabled(): this is CSOTTimeoutContext; + + abstract refresh(): void; + + abstract clear(): void; + + /** Returns a new instance of the TimeoutContext, with all timeouts refreshed and restarted. */ + abstract refreshed(): TimeoutContext; + + abstract addMaxTimeMSToCommand(command: Document, options: { omitMaxTimeMS?: boolean }): void; + + abstract getSocketTimeoutMS(): number | undefined; +} + +/** @internal */ +export class CSOTTimeoutContext extends TimeoutContext { + timeoutMS: number; + serverSelectionTimeoutMS: number; + socketTimeoutMS?: number; + + clearServerSelectionTimeout: boolean; + + private _serverSelectionTimeout?: Timeout | null; + private _connectionCheckoutTimeout?: Timeout | null; + public minRoundTripTime = 0; + public start: number; + + constructor(options: CSOTTimeoutContextOptions) { + super(); + this.start = Math.trunc(performance.now()); + + this.timeoutMS = options.timeoutMS; + + this.serverSelectionTimeoutMS = options.serverSelectionTimeoutMS; + + this.socketTimeoutMS = options.socketTimeoutMS; + + this.clearServerSelectionTimeout = false; + } + + get maxTimeMS(): number { + return this.remainingTimeMS - this.minRoundTripTime; + } + + get remainingTimeMS() { + const timePassed = Math.trunc(performance.now()) - this.start; + return this.timeoutMS <= 0 ? Infinity : this.timeoutMS - timePassed; + } + + csotEnabled(): this is CSOTTimeoutContext { + return true; + } + + get serverSelectionTimeout(): Timeout | null { + // check for undefined + if (typeof this._serverSelectionTimeout !== 'object' || this._serverSelectionTimeout?.cleared) { + const { remainingTimeMS, serverSelectionTimeoutMS } = this; + if (remainingTimeMS <= 0) + return Timeout.reject( + new MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`) + ); + const usingServerSelectionTimeoutMS = + serverSelectionTimeoutMS !== 0 && + csotMin(remainingTimeMS, serverSelectionTimeoutMS) === serverSelectionTimeoutMS; + if (usingServerSelectionTimeoutMS) { + this._serverSelectionTimeout = Timeout.expires(serverSelectionTimeoutMS); + } else { + if (remainingTimeMS > 0 && Number.isFinite(remainingTimeMS)) { + this._serverSelectionTimeout = Timeout.expires(remainingTimeMS); + } else { + this._serverSelectionTimeout = null; + } + } + } + + return this._serverSelectionTimeout; + } + + get connectionCheckoutTimeout(): Timeout | null { + if ( + typeof this._connectionCheckoutTimeout !== 'object' || + this._connectionCheckoutTimeout?.cleared + ) { + if (typeof this._serverSelectionTimeout === 'object') { + // null or Timeout + this._connectionCheckoutTimeout = this._serverSelectionTimeout; + } else { + throw new MongoRuntimeError( + 'Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira' + ); + } + } + return this._connectionCheckoutTimeout; + } + + get timeoutForSocketWrite(): Timeout | null { + const { remainingTimeMS } = this; + if (!Number.isFinite(remainingTimeMS)) return null; + if (remainingTimeMS > 0) return Timeout.expires(remainingTimeMS); + return Timeout.reject(new MongoOperationTimeoutError('Timed out before socket write')); + } + + get timeoutForSocketRead(): Timeout | null { + const { remainingTimeMS } = this; + if (!Number.isFinite(remainingTimeMS)) return null; + if (remainingTimeMS > 0) return Timeout.expires(remainingTimeMS); + return Timeout.reject(new MongoOperationTimeoutError('Timed out before socket read')); + } + + refresh(): void { + this.start = Math.trunc(performance.now()); + this.minRoundTripTime = 0; + this._serverSelectionTimeout?.clear(); + this._connectionCheckoutTimeout?.clear(); + } + + clear(): void { + this._serverSelectionTimeout?.clear(); + this._connectionCheckoutTimeout?.clear(); + } + + /** + * @internal + * Throws a MongoOperationTimeoutError if the context has expired. + * If the context has not expired, returns the `remainingTimeMS` + **/ + getRemainingTimeMSOrThrow(message?: string): number { + const { remainingTimeMS } = this; + if (remainingTimeMS <= 0) + throw new MongoOperationTimeoutError(message ?? `Expired after ${this.timeoutMS}ms`); + return remainingTimeMS; + } + + /** + * @internal + * This method is intended to be used in situations where concurrent operation are on the same deadline, but cannot share a single `TimeoutContext` instance. + * Returns a new instance of `CSOTTimeoutContext` constructed with identical options, but setting the `start` property to `this.start`. + */ + clone(): CSOTTimeoutContext { + const timeoutContext = new CSOTTimeoutContext({ + timeoutMS: this.timeoutMS, + serverSelectionTimeoutMS: this.serverSelectionTimeoutMS + }); + timeoutContext.start = this.start; + return timeoutContext; + } + + override refreshed(): CSOTTimeoutContext { + return new CSOTTimeoutContext(this); + } + + override addMaxTimeMSToCommand(command: Document, options: { omitMaxTimeMS?: boolean }): void { + if (options.omitMaxTimeMS) return; + const maxTimeMS = this.remainingTimeMS - this.minRoundTripTime; + if (maxTimeMS > 0 && Number.isFinite(maxTimeMS)) command.maxTimeMS = maxTimeMS; + } + + override getSocketTimeoutMS(): number | undefined { + return 0; + } +} + +/** @internal */ +export class LegacyTimeoutContext extends TimeoutContext { + options: LegacyTimeoutContextOptions; + clearServerSelectionTimeout: boolean; + + constructor(options: LegacyTimeoutContextOptions) { + super(); + this.options = options; + this.clearServerSelectionTimeout = true; + } + + csotEnabled(): this is CSOTTimeoutContext { + return false; + } + + get serverSelectionTimeout(): Timeout | null { + if (this.options.serverSelectionTimeoutMS != null && this.options.serverSelectionTimeoutMS > 0) + return Timeout.expires(this.options.serverSelectionTimeoutMS); + return null; + } + + get connectionCheckoutTimeout(): Timeout | null { + if (this.options.waitQueueTimeoutMS != null && this.options.waitQueueTimeoutMS > 0) + return Timeout.expires(this.options.waitQueueTimeoutMS); + return null; + } + + get timeoutForSocketWrite(): Timeout | null { + return null; + } + + get timeoutForSocketRead(): Timeout | null { + return null; + } + + refresh(): void { + return; + } + + clear(): void { + return; + } + + get maxTimeMS() { + return null; + } + + override refreshed(): LegacyTimeoutContext { + return new LegacyTimeoutContext(this.options); + } + + override addMaxTimeMSToCommand(_command: Document, _options: { omitMaxTimeMS?: boolean }): void { + // No max timeMS is added to commands in legacy timeout mode. + } + + override getSocketTimeoutMS(): number | undefined { + return this.options.socketTimeoutMS; + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/transactions.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/transactions.ts new file mode 100644 index 00000000..a9cfd9cf --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/transactions.ts @@ -0,0 +1,181 @@ +import type { Document } from './bson'; +import { MongoRuntimeError, MongoTransactionError } from './error'; +import type { CommandOperationOptions } from './operations/command'; +import { ReadConcern, type ReadConcernLike } from './read_concern'; +import { ReadPreference, type ReadPreferenceLike } from './read_preference'; +import type { Server } from './sdam/server'; +import { WriteConcern } from './write_concern'; + +/** @internal */ +export const TxnState = Object.freeze({ + NO_TRANSACTION: 'NO_TRANSACTION', + STARTING_TRANSACTION: 'STARTING_TRANSACTION', + TRANSACTION_IN_PROGRESS: 'TRANSACTION_IN_PROGRESS', + TRANSACTION_COMMITTED: 'TRANSACTION_COMMITTED', + TRANSACTION_COMMITTED_EMPTY: 'TRANSACTION_COMMITTED_EMPTY', + TRANSACTION_ABORTED: 'TRANSACTION_ABORTED' +} as const); + +/** @internal */ +export type TxnState = (typeof TxnState)[keyof typeof TxnState]; + +const stateMachine: { [state in TxnState]: TxnState[] } = { + [TxnState.NO_TRANSACTION]: [TxnState.NO_TRANSACTION, TxnState.STARTING_TRANSACTION], + [TxnState.STARTING_TRANSACTION]: [ + TxnState.TRANSACTION_IN_PROGRESS, + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.TRANSACTION_ABORTED + ], + [TxnState.TRANSACTION_IN_PROGRESS]: [ + TxnState.TRANSACTION_IN_PROGRESS, + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_ABORTED + ], + [TxnState.TRANSACTION_COMMITTED]: [ + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.STARTING_TRANSACTION, + TxnState.NO_TRANSACTION + ], + [TxnState.TRANSACTION_ABORTED]: [TxnState.STARTING_TRANSACTION, TxnState.NO_TRANSACTION], + [TxnState.TRANSACTION_COMMITTED_EMPTY]: [ + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.NO_TRANSACTION + ] +}; + +const ACTIVE_STATES: Set = new Set([ + TxnState.STARTING_TRANSACTION, + TxnState.TRANSACTION_IN_PROGRESS +]); + +const COMMITTED_STATES: Set = new Set([ + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.TRANSACTION_ABORTED +]); + +/** + * Configuration options for a transaction. + * @public + */ +export interface TransactionOptions extends Omit { + // TODO(NODE-3344): These options use the proper class forms of these settings, it should accept the basic enum values too + /** A default read concern for commands in this transaction */ + readConcern?: ReadConcernLike; + /** A default writeConcern for commands in this transaction */ + writeConcern?: WriteConcern; + /** A default read preference for commands in this transaction */ + readPreference?: ReadPreferenceLike; + /** Specifies the maximum amount of time to allow a commit action on a transaction to run in milliseconds */ + maxCommitTimeMS?: number; +} + +/** + * @internal + */ +export class Transaction { + state: TxnState; + options: TransactionOptions; + _pinnedServer?: Server; + _recoveryToken?: Document; + + /** Create a transaction */ + constructor(options?: TransactionOptions) { + options = options ?? {}; + this.state = TxnState.NO_TRANSACTION; + this.options = {}; + + const writeConcern = WriteConcern.fromOptions(options); + if (writeConcern) { + if (writeConcern.w === 0) { + throw new MongoTransactionError('Transactions do not support unacknowledged write concern'); + } + + this.options.writeConcern = writeConcern; + } + + if (options.readConcern) { + this.options.readConcern = ReadConcern.fromOptions(options); + } + + if (options.readPreference) { + this.options.readPreference = ReadPreference.fromOptions(options); + } + + if (options.maxCommitTimeMS) { + this.options.maxTimeMS = options.maxCommitTimeMS; + } + + // TODO: This isn't technically necessary + this._pinnedServer = undefined; + this._recoveryToken = undefined; + } + + get server(): Server | undefined { + return this._pinnedServer; + } + + get recoveryToken(): Document | undefined { + return this._recoveryToken; + } + + get isPinned(): boolean { + return !!this.server; + } + + /** + * @returns Whether the transaction has started + */ + get isStarting(): boolean { + return this.state === TxnState.STARTING_TRANSACTION; + } + + /** + * @returns Whether this session is presently in a transaction + */ + get isActive(): boolean { + return ACTIVE_STATES.has(this.state); + } + + get isCommitted(): boolean { + return COMMITTED_STATES.has(this.state); + } + /** + * Transition the transaction in the state machine + * @param nextState - The new state to transition to + */ + transition(nextState: TxnState): void { + const nextStates = stateMachine[this.state]; + if (nextStates && nextStates.includes(nextState)) { + this.state = nextState; + if ( + this.state === TxnState.NO_TRANSACTION || + this.state === TxnState.STARTING_TRANSACTION || + this.state === TxnState.TRANSACTION_ABORTED + ) { + this.unpinServer(); + } + return; + } + + throw new MongoRuntimeError( + `Attempted illegal state transition from [${this.state}] to [${nextState}]` + ); + } + + pinServer(server: Server): void { + if (this.isActive) { + this._pinnedServer = server; + } + } + + unpinServer(): void { + this._pinnedServer = undefined; + } +} + +export function isTransactionCommand(command: Document): boolean { + return !!(command.commitTransaction || command.abortTransaction); +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/utils.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/utils.ts new file mode 100644 index 00000000..d9a96115 --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/utils.ts @@ -0,0 +1,1454 @@ +import type { SrvRecord } from 'dns'; +import { type EventEmitter } from 'events'; +import { promises as fs } from 'fs'; +import * as http from 'http'; +import * as process from 'process'; +import { clearTimeout, setTimeout } from 'timers'; + +import { + ByteUtils, + deserialize, + type Document, + NumberUtils, + ObjectId, + resolveBSONOptions +} from './bson'; +import type { Connection } from './cmap/connection'; +import { MAX_SUPPORTED_WIRE_VERSION } from './cmap/wire_protocol/constants'; +import type { Collection } from './collection'; +import { kDecoratedKeys, LEGACY_HELLO_COMMAND } from './constants'; +import type { AbstractCursor } from './cursor/abstract_cursor'; +import type { FindCursor } from './cursor/find_cursor'; +import type { Db } from './db'; +import { + type AnyError, + MongoAPIError, + MongoInvalidArgumentError, + MongoNetworkTimeoutError, + MongoNotConnectedError, + MongoParseError, + MongoRuntimeError +} from './error'; +import type { MongoClient } from './mongo_client'; +import { type Abortable } from './mongo_types'; +import type { CommandOperationOptions, OperationParent } from './operations/command'; +import type { Hint, OperationOptions } from './operations/operation'; +import { ReadConcern } from './read_concern'; +import { ReadPreference } from './read_preference'; +import { ServerType } from './sdam/common'; +import type { Server } from './sdam/server'; +import type { Topology } from './sdam/topology'; +import type { ClientSession } from './sessions'; +import { type TimeoutContextOptions } from './timeout'; +import { WriteConcern } from './write_concern'; + +/** + * MongoDB Driver style callback + * @public + */ +export type Callback = (error?: AnyError, result?: T) => void; + +export type AnyOptions = Document; + +/** + * Returns true if value is a Uint8Array or a Buffer + * @param value - any value that may be a Uint8Array + */ +export function isUint8Array(value: unknown): value is Uint8Array { + return ( + value != null && + typeof value === 'object' && + Symbol.toStringTag in value && + value[Symbol.toStringTag] === 'Uint8Array' + ); +} + +/** + * Determines if a connection's address matches a user provided list + * of domain wildcards. + */ +export function hostMatchesWildcards(host: string, wildcards: string[]): boolean { + for (const wildcard of wildcards) { + // Exact match always wins + if (host === wildcard) { + return true; + } + + // Wildcard match with leading *. + if (wildcard.startsWith('*.')) { + const suffix = wildcard.substring(2); + // Exact match or strict subdomain match + if (host === suffix || host.endsWith(`.${suffix}`)) { + return true; + } + } + // Wildcard match with leading */ + if (wildcard.startsWith('*/')) { + const suffix = wildcard.substring(2); + // Exact match or strict subpath match + if (host === suffix || host.endsWith(`/${suffix}`)) { + return true; + } + } + } + return false; +} + +/** + * Ensure Hint field is in a shape we expect: + * - object of index names mapping to 1 or -1 + * - just an index name + * @internal + */ +export function normalizeHintField(hint?: Hint): Hint | undefined { + let finalHint = undefined; + + if (typeof hint === 'string') { + finalHint = hint; + } else if (Array.isArray(hint)) { + finalHint = {}; + + hint.forEach(param => { + finalHint[param] = 1; + }); + } else if (hint != null && typeof hint === 'object') { + finalHint = {} as Document; + for (const name in hint) { + finalHint[name] = hint[name]; + } + } + + return finalHint; +} + +const TO_STRING = (object: unknown) => Object.prototype.toString.call(object); +/** + * Checks if arg is an Object: + * - **NOTE**: the check is based on the `[Symbol.toStringTag]() === 'Object'` + * @internal + */ + +export function isObject(arg: unknown): arg is object { + return '[object Object]' === TO_STRING(arg); +} + +/** @internal */ +export function mergeOptions(target: T, source: S): T & S { + return { ...target, ...source }; +} + +/** @internal */ +export function filterOptions(options: AnyOptions, names: ReadonlyArray): AnyOptions { + const filterOptions: AnyOptions = {}; + + for (const name in options) { + if (names.includes(name)) { + filterOptions[name] = options[name]; + } + } + + // Filtered options + return filterOptions; +} + +/** + * Applies a write concern to a command based on well defined inheritance rules, optionally + * detecting support for the write concern in the first place. + * @internal + * + * @param target - the target command we will be applying the write concern to + * @param sources - sources where we can inherit default write concerns from + * @param options - optional settings passed into a command for write concern overrides + */ + +/** + * Checks if a given value is a Promise + * + * @typeParam T - The resolution type of the possible promise + * @param value - An object that could be a promise + * @returns true if the provided value is a Promise + */ +export function isPromiseLike(value?: unknown): value is PromiseLike { + return ( + value != null && + typeof value === 'object' && + 'then' in value && + typeof value.then === 'function' + ); +} + +/** + * Applies collation to a given command. + * @internal + * + * @param command - the command on which to apply collation + * @param target - target of command + * @param options - options containing collation settings + */ +export function decorateWithCollation(command: Document, options: AnyOptions): void { + if (options.collation && typeof options.collation === 'object') { + command.collation = options.collation; + } +} + +/** + * Applies a read concern to a given command. + * @internal + * + * @param command - the command on which to apply the read concern + * @param coll - the parent collection of the operation calling this method + */ +export function decorateWithReadConcern( + command: Document, + coll: { s: { readConcern?: ReadConcern } }, + options?: OperationOptions +): void { + if (options && options.session && options.session.inTransaction()) { + return; + } + const readConcern = Object.assign({}, command.readConcern || {}); + if (coll.s.readConcern) { + Object.assign(readConcern, coll.s.readConcern); + } + + if (Object.keys(readConcern).length > 0) { + Object.assign(command, { readConcern: readConcern }); + } +} + +/** + * @internal + */ +export type TopologyProvider = + | MongoClient + | ClientSession + | FindCursor + | AbstractCursor + | Collection + | Db; + +/** + * A helper function to get the topology from a given provider. Throws + * if the topology cannot be found. + * @throws MongoNotConnectedError + * @internal + */ +export function getTopology(provider: TopologyProvider): Topology { + // MongoClient or ClientSession or AbstractCursor + if ('topology' in provider && provider.topology) { + return provider.topology; + } else if ('client' in provider && provider.client.topology) { + return provider.client.topology; + } + + throw new MongoNotConnectedError('MongoClient must be connected to perform this operation'); +} + +/** @internal */ +export function ns(ns: string): MongoDBNamespace { + return MongoDBNamespace.fromString(ns); +} + +/** @public */ +export class MongoDBNamespace { + db: string; + collection?: string; + /** + * Create a namespace object + * + * @param db - database name + * @param collection - collection name + */ + constructor(db: string, collection?: string) { + this.db = db; + this.collection = collection === '' ? undefined : collection; + } + + toString(): string { + return this.collection ? `${this.db}.${this.collection}` : this.db; + } + + withCollection(collection: string): MongoDBCollectionNamespace { + return new MongoDBCollectionNamespace(this.db, collection); + } + + static fromString(namespace?: string): MongoDBNamespace { + if (typeof namespace !== 'string' || namespace === '') { + // TODO(NODE-3483): Replace with MongoNamespaceError + throw new MongoRuntimeError(`Cannot parse namespace from "${namespace}"`); + } + + const [db, ...collectionParts] = namespace.split('.'); + const collection = collectionParts.join('.'); + return new MongoDBNamespace(db, collection === '' ? undefined : collection); + } +} + +/** + * @public + * + * A class representing a collection's namespace. This class enforces (through Typescript) that + * the `collection` portion of the namespace is defined and should only be + * used in scenarios where this can be guaranteed. + */ +export class MongoDBCollectionNamespace extends MongoDBNamespace { + override collection: string; + + constructor(db: string, collection: string) { + super(db, collection); + this.collection = collection; + } + + static override fromString(namespace?: string): MongoDBCollectionNamespace { + return super.fromString(namespace) as MongoDBCollectionNamespace; + } +} + +/** @internal */ +export function* makeCounter(seed = 0): Generator { + let count = seed; + while (true) { + const newCount = count; + count += 1; + yield newCount; + } +} + +/** + * Synchronously Generate a UUIDv4 + * @internal + */ +export function uuidV4(): Uint8Array { + const result = crypto.getRandomValues(new Uint8Array(16)); + result[6] = (result[6] & 0x0f) | 0x40; + result[8] = (result[8] & 0x3f) | 0x80; + return result; +} + +/** + * A helper function for determining `maxWireVersion` between legacy and new topology instances + * @internal + */ +export function maxWireVersion(handshakeAware?: Connection | Topology | Server): number { + if (handshakeAware) { + if (handshakeAware.hello) { + return handshakeAware.hello.maxWireVersion; + } + + if (handshakeAware.serverApi?.version) { + // We return the max supported wire version for serverAPI. + return MAX_SUPPORTED_WIRE_VERSION; + } + // This is the fallback case for load balanced mode. If we are building commands the + // object being checked will be a connection, and we will have a hello response on + // it. For other cases, such as retryable writes, the object will be a server or + // topology, and there will be no hello response on those objects, so we return + // the max wire version so we support retryability. + if (handshakeAware.loadBalanced) { + return MAX_SUPPORTED_WIRE_VERSION; + } + + if ('lastHello' in handshakeAware && typeof handshakeAware.lastHello === 'function') { + const lastHello = handshakeAware.lastHello(); + if (lastHello) { + return lastHello.maxWireVersion; + } + } + + if ( + handshakeAware.description && + 'maxWireVersion' in handshakeAware.description && + handshakeAware.description.maxWireVersion != null + ) { + return handshakeAware.description.maxWireVersion; + } + } + + return 0; +} + +/** @internal */ +export function arrayStrictEqual(arr: unknown[], arr2: unknown[]): boolean { + if (!Array.isArray(arr) || !Array.isArray(arr2)) { + return false; + } + + return arr.length === arr2.length && arr.every((elt, idx) => elt === arr2[idx]); +} + +/** @internal */ +export function errorStrictEqual(lhs?: AnyError | null, rhs?: AnyError | null): boolean { + if (lhs === rhs) { + return true; + } + + if (!lhs || !rhs) { + return lhs === rhs; + } + + if ((lhs == null && rhs != null) || (lhs != null && rhs == null)) { + return false; + } + + if (lhs.constructor.name !== rhs.constructor.name) { + return false; + } + + if (lhs.message !== rhs.message) { + return false; + } + + return true; +} + +interface StateTable { + [key: string]: string[]; +} +interface ObjectWithState { + s: { state: string }; + emit(event: 'stateChanged', state: string, newState: string): void; +} +interface StateTransitionFunction { + (target: ObjectWithState, newState: string): void; +} + +/** @public */ +export type EventEmitterWithState = { + /** @internal */ + stateChanged(previous: string, current: string): void; +}; + +/** @internal */ +export function makeStateMachine(stateTable: StateTable): StateTransitionFunction { + return function stateTransition(target, newState) { + const legalStates = stateTable[target.s.state]; + if (legalStates && legalStates.indexOf(newState) < 0) { + throw new MongoRuntimeError( + `illegal state transition from [${target.s.state}] => [${newState}], allowed: [${legalStates}]` + ); + } + + target.emit('stateChanged', target.s.state, newState); + target.s.state = newState; + }; +} + +/** + * This function returns the number of milliseconds since an arbitrary point in time. + * This function should only be used to measure time intervals. + * @internal + * */ +export function processTimeMS(): number { + return Math.floor(performance.now()); +} + +/** @internal */ +export function calculateDurationInMs(started: number | undefined): number { + if (typeof started !== 'number') { + return -1; + } + + const elapsed = processTimeMS() - started; + return elapsed < 0 ? 0 : elapsed; +} + +/** @internal */ +export function hasAtomicOperators( + doc: Document | Document[], + options?: CommandOperationOptions +): boolean { + if (Array.isArray(doc)) { + for (const document of doc) { + if (hasAtomicOperators(document)) { + return true; + } + } + return false; + } + + const keys = Object.keys(doc); + // In this case we need to throw if all the atomic operators are undefined. + if (options?.ignoreUndefined) { + let allUndefined = true; + for (const key of keys) { + // eslint-disable-next-line no-restricted-syntax + if (doc[key] !== undefined) { + allUndefined = false; + break; + } + } + if (allUndefined) { + throw new MongoInvalidArgumentError( + 'Update operations require that all atomic operators have defined values, but none were provided.' + ); + } + } + + return keys.length > 0 && keys[0][0] === '$'; +} + +export function resolveTimeoutOptions>( + client: MongoClient, + options: T +): T & + Pick< + MongoClient['s']['options'], + 'timeoutMS' | 'serverSelectionTimeoutMS' | 'waitQueueTimeoutMS' | 'socketTimeoutMS' + > { + const { socketTimeoutMS, serverSelectionTimeoutMS, waitQueueTimeoutMS, timeoutMS } = + client.s.options; + return { socketTimeoutMS, serverSelectionTimeoutMS, waitQueueTimeoutMS, timeoutMS, ...options }; +} +/** + * Merge inherited properties from parent into options, prioritizing values from options, + * then values from parent. + * + * @param parent - An optional owning class of the operation being run. ex. Db/Collection/MongoClient. + * @param options - The options passed to the operation method. + * + * @internal + */ +export function resolveOptions( + parent: OperationParent | undefined, + options?: T +): T { + const result: T = Object.assign({}, options, resolveBSONOptions(options, parent)); + + const timeoutMS = options?.timeoutMS ?? parent?.timeoutMS; + // Users cannot pass a readConcern/writeConcern to operations in a transaction + const session = options?.session; + + if (!session?.inTransaction()) { + const readConcern = ReadConcern.fromOptions(options) ?? parent?.readConcern; + if (readConcern) { + result.readConcern = readConcern; + } + + let writeConcern = WriteConcern.fromOptions(options) ?? parent?.writeConcern; + if (writeConcern) { + if (timeoutMS != null) { + writeConcern = WriteConcern.fromOptions({ + writeConcern: { + ...writeConcern, + wtimeout: undefined, + wtimeoutMS: undefined + } + }); + } + result.writeConcern = writeConcern; + } + } + + result.timeoutMS = timeoutMS; + + const readPreference = ReadPreference.fromOptions(options) ?? parent?.readPreference; + if (readPreference) { + result.readPreference = readPreference; + } + + const isConvenientTransaction = session?.explicit && session?.timeoutContext != null; + if (isConvenientTransaction && options?.timeoutMS != null) { + throw new MongoInvalidArgumentError( + 'An operation cannot be given a timeoutMS setting when inside a withTransaction call that has a timeoutMS setting' + ); + } + + return result; +} + +export function isSuperset(set: Set | any[], subset: Set | any[]): boolean { + set = Array.isArray(set) ? new Set(set) : set; + subset = Array.isArray(subset) ? new Set(subset) : subset; + for (const elem of subset) { + if (!set.has(elem)) { + return false; + } + } + return true; +} + +/** + * Checks if the document is a Hello request + * @internal + */ +export function isHello(doc: Document): boolean { + return doc[LEGACY_HELLO_COMMAND] || doc.hello ? true : false; +} + +/** Returns the items that are uniquely in setA */ +export function setDifference(setA: Iterable, setB: Iterable): Set { + const difference = new Set(setA); + for (const elem of setB) { + difference.delete(elem); + } + return difference; +} + +const HAS_OWN = (object: unknown, prop: string) => + Object.prototype.hasOwnProperty.call(object, prop); + +export function isRecord( + value: unknown, + requiredKeys: T +): value is Record; +export function isRecord(value: unknown): value is Record; +export function isRecord( + value: unknown, + requiredKeys: string[] | undefined = undefined +): value is Record { + if (!isObject(value)) { + return false; + } + + const ctor = (value as any).constructor; + if (ctor && ctor.prototype) { + if (!isObject(ctor.prototype)) { + return false; + } + + // Check to see if some method exists from the Object exists + if (!HAS_OWN(ctor.prototype, 'isPrototypeOf')) { + return false; + } + } + + if (requiredKeys) { + const keys = Object.keys(value); + return isSuperset(keys, requiredKeys); + } + + return true; +} + +type ListNode = { + value: T; + next: ListNode | HeadNode; + prev: ListNode | HeadNode; +}; + +type HeadNode = { + value: null; + next: ListNode; + prev: ListNode; +}; + +/** + * When a list is empty the head is a reference with pointers to itself + * So this type represents that self referential state + */ +type EmptyNode = { + value: null; + next: EmptyNode; + prev: EmptyNode; +}; + +/** + * A sequential list of items in a circularly linked list + * @remarks + * The head node is special, it is always defined and has a value of null. + * It is never "included" in the list, in that, it is not returned by pop/shift or yielded by the iterator. + * The circular linkage and always defined head node are to reduce checks for null next/prev references to zero. + * New nodes are declared as object literals with keys always in the same order: next, prev, value. + * @internal + */ +export class List { + private readonly head: HeadNode | EmptyNode; + private count: number; + + get length() { + return this.count; + } + + get [Symbol.toStringTag]() { + return 'List' as const; + } + + constructor() { + this.count = 0; + + // this is carefully crafted: + // declaring a complete and consistently key ordered + // object is beneficial to the runtime optimizations + this.head = { + next: null, + prev: null, + value: null + } as unknown as EmptyNode; + this.head.next = this.head; + this.head.prev = this.head; + } + + toArray() { + return Array.from(this); + } + + toString() { + return `head <=> ${this.toArray().join(' <=> ')} <=> head`; + } + + *[Symbol.iterator](): Generator { + for (const node of this.nodes()) { + yield node.value; + } + } + + private *nodes(): Generator, void, void> { + let ptr: HeadNode | ListNode | EmptyNode = this.head.next; + while (ptr !== this.head) { + // Save next before yielding so that we make removing within iteration safe + const { next } = ptr as ListNode; + yield ptr as ListNode; + ptr = next; + } + } + + /** Insert at end of list */ + push(value: T) { + this.count += 1; + const newNode: ListNode = { + next: this.head as HeadNode, + prev: this.head.prev as ListNode, + value + }; + this.head.prev.next = newNode; + this.head.prev = newNode; + } + + /** Inserts every item inside an iterable instead of the iterable itself */ + pushMany(iterable: Iterable) { + for (const value of iterable) { + this.push(value); + } + } + + /** Insert at front of list */ + unshift(value: T) { + this.count += 1; + const newNode: ListNode = { + next: this.head.next as ListNode, + prev: this.head as HeadNode, + value + }; + this.head.next.prev = newNode; + this.head.next = newNode; + } + + private remove(node: ListNode | EmptyNode): T | null { + if (node === this.head || this.length === 0) { + return null; + } + + this.count -= 1; + + const prevNode = node.prev; + const nextNode = node.next; + prevNode.next = nextNode; + nextNode.prev = prevNode; + + return node.value; + } + + /** Removes the first node at the front of the list */ + shift(): T | null { + return this.remove(this.head.next); + } + + /** Removes the last node at the end of the list */ + pop(): T | null { + return this.remove(this.head.prev); + } + + /** Iterates through the list and removes nodes where filter returns true */ + prune(filter: (value: T) => boolean) { + for (const node of this.nodes()) { + if (filter(node.value)) { + this.remove(node); + } + } + } + + clear() { + this.count = 0; + this.head.next = this.head as EmptyNode; + this.head.prev = this.head as EmptyNode; + } + + /** Returns the first item in the list, does not remove */ + first(): T | null { + // If the list is empty, value will be the head's null + return this.head.next.value; + } + + /** Returns the last item in the list, does not remove */ + last(): T | null { + // If the list is empty, value will be the head's null + return this.head.prev.value; + } +} + +/** + * A pool of Buffers which allow you to read them as if they were one + * @internal + */ +export class BufferPool { + private buffers: List; + private totalByteLength: number; + + constructor() { + this.buffers = new List(); + this.totalByteLength = 0; + } + + get length(): number { + return this.totalByteLength; + } + + /** Adds a buffer to the internal buffer pool list */ + append(buffer: Uint8Array): void { + this.buffers.push(buffer); + this.totalByteLength += buffer.length; + } + + /** + * If BufferPool contains 4 bytes or more construct an int32 from the leading bytes, + * otherwise return null. Size can be negative, caller should error check. + */ + getInt32(): number | null { + if (this.totalByteLength < 4) { + return null; + } + const firstBuffer = this.buffers.first(); + if (firstBuffer != null && firstBuffer.byteLength >= 4) { + return NumberUtils.getInt32LE(firstBuffer, 0); + } + + // Unlikely case: an int32 is split across buffers. + // Use read and put the returned buffer back on top + const top4Bytes = this.read(4); + const value = NumberUtils.getInt32LE(top4Bytes, 0); + + // Put it back. + this.totalByteLength += 4; + this.buffers.unshift(top4Bytes); + + return value; + } + + /** Reads the requested number of bytes, optionally consuming them */ + read(size: number): Uint8Array { + if (typeof size !== 'number' || size < 0) { + throw new MongoInvalidArgumentError('Argument "size" must be a non-negative number'); + } + + // oversized request returns empty buffer + if (size > this.totalByteLength) { + return ByteUtils.allocate(0); + } + + // We know we have enough, we just don't know how it is spread across chunks + // TODO(NODE-4732): alloc API should change based on raw option + const result = ByteUtils.allocateUnsafe(size); + + for (let bytesRead = 0; bytesRead < size; ) { + const buffer = this.buffers.shift(); + if (buffer == null) { + break; + } + const bytesRemaining = size - bytesRead; + const bytesReadable = Math.min(bytesRemaining, buffer.byteLength); + const bytes = buffer.subarray(0, bytesReadable); + + result.set(bytes, bytesRead); + + bytesRead += bytesReadable; + this.totalByteLength -= bytesReadable; + if (bytesReadable < buffer.byteLength) { + this.buffers.unshift(buffer.subarray(bytesReadable)); + } + } + + return result; + } +} + +/** @public */ +export class HostAddress { + host: string | undefined = undefined; + port: number | undefined = undefined; + socketPath: string | undefined = undefined; + isIPv6 = false; + + constructor(hostString: string) { + const escapedHost = hostString.split(' ').join('%20'); // escape spaces, for socket path hosts + + if (escapedHost.endsWith('.sock')) { + // heuristically determine if we're working with a domain socket + this.socketPath = decodeURIComponent(escapedHost); + return; + } + + const urlString = `iLoveJS://${escapedHost}`; + let url; + try { + url = new URL(urlString); + } catch (urlError) { + const runtimeError = new MongoRuntimeError(`Unable to parse ${escapedHost} with URL`); + runtimeError.cause = urlError; + throw runtimeError; + } + + const hostname = url.hostname; + const port = url.port; + + let normalized = decodeURIComponent(hostname).toLowerCase(); + if (normalized.startsWith('[') && normalized.endsWith(']')) { + this.isIPv6 = true; + normalized = normalized.substring(1, hostname.length - 1); + } + + this.host = normalized.toLowerCase(); + + if (typeof port === 'number') { + this.port = port; + } else if (typeof port === 'string' && port !== '') { + this.port = Number.parseInt(port, 10); + } else { + this.port = 27017; + } + + if (this.port === 0) { + throw new MongoParseError('Invalid port (zero) with hostname'); + } + Object.freeze(this); + } + + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new HostAddress('${this.toString()}')`; + } + + toString(): string { + if (typeof this.host === 'string') { + if (this.isIPv6) { + return `[${this.host}]:${this.port}`; + } + return `${this.host}:${this.port}`; + } + return `${this.socketPath}`; + } + + static fromString(this: void, s: string): HostAddress { + return new HostAddress(s); + } + + static fromHostPort(host: string, port: number): HostAddress { + if (host.includes(':')) { + host = `[${host}]`; // IPv6 address + } + return HostAddress.fromString(`${host}:${port}`); + } + + static fromSrvRecord({ name, port }: SrvRecord): HostAddress { + return HostAddress.fromHostPort(name, port); + } + + toHostPort(): { host: string; port: number } { + if (this.socketPath) { + return { host: this.socketPath, port: 0 }; + } + + const host = this.host ?? ''; + const port = this.port ?? 0; + return { host, port }; + } +} + +export const DEFAULT_PK_FACTORY = { + // We prefer not to rely on ObjectId having a createPk method + createPk(): ObjectId { + return new ObjectId(); + } +}; + +/** + * When the driver used emitWarning the code will be equal to this. + * @public + * + * @example + * ```ts + * process.on('warning', (warning) => { + * if (warning.code === MONGODB_WARNING_CODE) console.error('Ah an important warning! :)') + * }) + * ``` + */ +export const MONGODB_WARNING_CODE = 'MONGODB DRIVER'; + +/** @internal */ +export function emitWarning(message: string): void { + return process.emitWarning(message, { code: MONGODB_WARNING_CODE } as any); +} + +const emittedWarnings = new Set(); +/** + * Will emit a warning once for the duration of the application. + * Uses the message to identify if it has already been emitted + * so using string interpolation can cause multiple emits + * @internal + */ +export function emitWarningOnce(message: string): void { + if (!emittedWarnings.has(message)) { + emittedWarnings.add(message); + return emitWarning(message); + } +} + +/** + * Takes a JS object and joins the values into a string separated by ', ' + */ +export function enumToString(en: Record): string { + return Object.values(en).join(', '); +} + +/** + * Determine if a server supports retryable writes. + * + * @internal + */ +export function supportsRetryableWrites(server?: Server): boolean { + if (!server) { + return false; + } + + if (server.loadBalanced) { + // Loadbalanced topologies will always support retry writes + return true; + } + + if (server.description.logicalSessionTimeoutMinutes != null) { + // that supports sessions + if (server.description.type !== ServerType.Standalone) { + // and that is not a standalone + return true; + } + } + + return false; +} + +/** + * Fisher–Yates Shuffle + * + * Reference: https://bost.ocks.org/mike/shuffle/ + * @param sequence - items to be shuffled + * @param limit - Defaults to `0`. If nonzero shuffle will slice the randomized array e.g, `.slice(0, limit)` otherwise will return the entire randomized array. + */ +export function shuffle(sequence: Iterable, limit = 0): Array { + const items = Array.from(sequence); // shallow copy in order to never shuffle the input + + if (limit > items.length) { + throw new MongoRuntimeError('Limit must be less than the number of items'); + } + + let remainingItemsToShuffle = items.length; + const lowerBound = limit % items.length === 0 ? 1 : items.length - limit; + while (remainingItemsToShuffle > lowerBound) { + // Pick a remaining element + const randomIndex = Math.floor(Math.random() * remainingItemsToShuffle); + remainingItemsToShuffle -= 1; + + // And swap it with the current element + const swapHold = items[remainingItemsToShuffle]; + items[remainingItemsToShuffle] = items[randomIndex]; + items[randomIndex] = swapHold; + } + + return limit % items.length === 0 ? items : items.slice(lowerBound); +} + +/** + * TODO(NODE-4936): read concern eligibility for commands should be codified in command construction + * @internal + * @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.md#read-concern + */ +export function commandSupportsReadConcern(command: Document): boolean { + if (command.aggregate || command.count || command.distinct || command.find || command.geoNear) { + return true; + } + return false; +} + +/** + * @internal + */ +export function commandSupportsAfterClusterTime(command: Document): boolean { + // READ operations + if (command.aggregate || command.count || command.distinct || command.find || command.geoNear) { + return true; + } + + // WRITE operations + if ( + command.bulkWrite || + command.create || + command.createIndexes || + command.delete || + command.drop || + command.dropDatabase || + command.dropIndexes || + command.findAndModify || + command.insert || + command.update + ) { + return true; + } + + return false; +} + +/** + * Compare objectIds. `null` is always less + * - `+1 = oid1 is greater than oid2` + * - `-1 = oid1 is less than oid2` + * - `+0 = oid1 is equal oid2` + */ +export function compareObjectId(oid1?: ObjectId | null, oid2?: ObjectId | null): 0 | 1 | -1 { + if (oid1 == null && oid2 == null) { + return 0; + } + + if (oid1 == null) { + return -1; + } + + if (oid2 == null) { + return 1; + } + + return ByteUtils.compare(oid1.id, oid2.id); +} + +export function parseInteger(value: unknown): number | null { + if (typeof value === 'number') return Math.trunc(value); + const parsedValue = Number.parseInt(String(value), 10); + + return Number.isNaN(parsedValue) ? null : parsedValue; +} + +export function parseUnsignedInteger(value: unknown): number | null { + const parsedInt = parseInteger(value); + + return parsedInt != null && parsedInt >= 0 ? parsedInt : null; +} + +/** + * This function throws a MongoAPIError in the event that either of the following is true: + * * If the provided address domain does not match the provided parent domain + * * If the parent domain contains less than three `.` separated parts and the provided address does not contain at least one more domain level than its parent + * + * If a DNS server were to become compromised SRV records would still need to + * advertise addresses that are under the same domain as the srvHost. + * + * @param address - The address to check against a domain + * @param srvHost - The domain to check the provided address against + * @returns void + */ +export function checkParentDomainMatch(address: string, srvHost: string): void { + // Remove trailing dot if exists on either the resolved address or the srv hostname + const normalizedAddress = address.endsWith('.') ? address.slice(0, address.length - 1) : address; + const normalizedSrvHost = srvHost.endsWith('.') ? srvHost.slice(0, srvHost.length - 1) : srvHost; + + const allCharacterBeforeFirstDot = /^.*?\./; + const srvIsLessThanThreeParts = normalizedSrvHost.split('.').length < 3; + // Remove all characters before first dot + // Add leading dot back to string so + // an srvHostDomain = '.trusted.site' + // will not satisfy an addressDomain that endsWith '.fake-trusted.site' + const addressDomain = `.${normalizedAddress.replace(allCharacterBeforeFirstDot, '')}`; + let srvHostDomain = srvIsLessThanThreeParts + ? normalizedSrvHost + : `.${normalizedSrvHost.replace(allCharacterBeforeFirstDot, '')}`; + + if (!srvHostDomain.startsWith('.')) { + srvHostDomain = '.' + srvHostDomain; + } + if ( + srvIsLessThanThreeParts && + normalizedAddress.split('.').length <= normalizedSrvHost.split('.').length + ) { + throw new MongoAPIError( + 'Server record does not have at least one more domain level than parent URI' + ); + } + if (!addressDomain.endsWith(srvHostDomain)) { + throw new MongoAPIError('Server record does not share hostname with parent URI'); + } +} + +/** + * Perform a get request that returns status and body. + * @internal + */ +export function get( + url: URL | string, + options: http.RequestOptions = {} +): Promise<{ body: string; status: number | undefined }> { + return new Promise((resolve, reject) => { + /* eslint-disable prefer-const */ + let timeoutId: NodeJS.Timeout; + const request = http + .get(url, options, response => { + response.setEncoding('utf8'); + let body = ''; + response.on('data', chunk => (body += chunk)); + response.on('end', () => { + clearTimeout(timeoutId); + resolve({ status: response.statusCode, body }); + }); + }) + .on('error', error => { + clearTimeout(timeoutId); + reject(error); + }) + .end(); + timeoutId = setTimeout(() => { + request.destroy(new MongoNetworkTimeoutError(`request timed out after 10 seconds`)); + }, 10000); + }); +} + +/** @internal */ +export const DOCUMENT_DB_CHECK = /(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/; +/** @internal */ +export const COSMOS_DB_CHECK = /\.cosmos\.azure\.com$/; + +/** @internal */ +export const DOCUMENT_DB_MSG = + 'You appear to be connected to a DocumentDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/documentdb'; +/** @internal */ +export const COSMOS_DB_MSG = + 'You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb'; + +/** @internal */ +export function isHostMatch(match: RegExp, host?: string): boolean { + return host && match.test(host.toLowerCase()) ? true : false; +} + +export function promiseWithResolvers(): { + promise: Promise; + resolve: (value: T) => void; + reject: (error: Error) => void; +} { + let resolve!: (value: T) => void; + let reject!: (error: Error) => void; + const promise = new Promise(function withResolversExecutor(promiseResolve, promiseReject) { + resolve = promiseResolve; + reject = promiseReject; + }); + return { promise, resolve, reject } as const; +} + +/** + * A noop function intended for use in preventing unhandled rejections. + * + * @example + * ```js + * const promise = myAsyncTask(); + * // eslint-disable-next-line github/no-then + * promise.then(undefined, squashError); + * ``` + */ +export function squashError(_error: unknown) { + return; +} + +export const randomBytes = (size: number): Promise => { + return Promise.resolve(crypto.getRandomValues(new Uint8Array(size))); +}; + +/** + * Replicates the events.once helper. + * + * Removes unused signal logic and It **only** supports 0 or 1 argument events. + * + * @param ee - An event emitter that may emit `ev` + * @param name - An event name to wait for + */ +export async function once(ee: EventEmitter, name: string, options?: Abortable): Promise { + options?.signal?.throwIfAborted(); + + const { promise, resolve, reject } = promiseWithResolvers(); + const onEvent = (data: T) => resolve(data); + const onError = (error: Error) => reject(error); + const abortListener = addAbortListener(options?.signal, function () { + reject(this.reason); + }); + + ee.once(name, onEvent).once('error', onError); + + try { + return await promise; + } finally { + ee.off(name, onEvent); + ee.off('error', onError); + abortListener?.[kDispose](); + } +} + +export function maybeAddIdToDocuments( + collection: Collection, + document: Document, + options: { forceServerObjectId?: boolean } +): Document { + const forceServerObjectId = + options.forceServerObjectId ?? collection.db.options?.forceServerObjectId ?? false; + + // no need to modify the docs if server sets the ObjectId + if (forceServerObjectId) { + return document; + } + + if (document._id == null) { + document._id = collection.s.pkFactory.createPk(); + } + + return document; +} + +export async function fileIsAccessible(fileName: string, mode?: number) { + try { + await fs.access(fileName, mode); + return true; + } catch { + return false; + } +} + +export function csotMin(duration1: number, duration2: number): number { + if (duration1 === 0) return duration2; + if (duration2 === 0) return duration1; + return Math.min(duration1, duration2); +} + +export function noop() { + return; +} + +/** + * Recurse through the (identically-shaped) `decrypted` and `original` + * objects and attach a `decryptedKeys` property on each sub-object that + * contained encrypted fields. Because we only call this on BSON responses, + * we do not need to worry about circular references. + * + * @internal + */ +export function decorateDecryptionResult( + decrypted: Document & { [kDecoratedKeys]?: Array }, + original: Document, + isTopLevelDecorateCall = true +): void { + if (isTopLevelDecorateCall) { + // The original value could have been either a JS object or a BSON buffer + if (ByteUtils.isUint8Array(original)) { + original = deserialize(original); + } + if (ByteUtils.isUint8Array(decrypted)) { + throw new MongoRuntimeError('Expected result of decryption to be deserialized BSON object'); + } + } + + if (!decrypted || typeof decrypted !== 'object') return; + for (const k of Object.keys(decrypted)) { + const originalValue = original[k]; + + // An object was decrypted by libmongocrypt if and only if it was + // a BSON Binary object with subtype 6. + if (originalValue && originalValue._bsontype === 'Binary' && originalValue.sub_type === 6) { + if (!decrypted[kDecoratedKeys]) { + Object.defineProperty(decrypted, kDecoratedKeys, { + value: [], + configurable: true, + enumerable: false, + writable: false + }); + } + // this is defined in the preceding if-statement + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + decrypted[kDecoratedKeys]!.push(k); + // Do not recurse into this decrypted value. It could be a sub-document/array, + // in which case there is no original value associated with its subfields. + continue; + } + + decorateDecryptionResult(decrypted[k], originalValue, false); + } +} + +/** @internal */ +export const kDispose: unique symbol = (Symbol.dispose as any) ?? Symbol('dispose'); + +/** @internal */ +export interface Disposable { + [kDispose](): void; +} + +/** + * A utility that helps with writing listener code idiomatically + * + * @example + * ```js + * using listener = addAbortListener(signal, function () { + * console.log('aborted', this.reason); + * }); + * ``` + * + * @param signal - if exists adds an abort listener + * @param listener - the listener to be added to signal + * @returns A disposable that will remove the abort listener + */ +export function addAbortListener( + signal: AbortSignal | undefined | null, + listener: (this: AbortSignal, event: Event) => void +): Disposable | undefined { + if (signal == null) return; + signal.addEventListener('abort', listener, { once: true }); + return { [kDispose]: () => signal.removeEventListener('abort', listener) }; +} + +/** + * Takes a promise and races it with a promise wrapping the abort event of the optionally provided signal. + * The given promise is _always_ ordered before the signal's abort promise. + * When given an already rejected promise and an already aborted signal, the promise's rejection takes precedence. + * + * Any asynchronous processing in `promise` will continue even after the abort signal has fired, + * but control will be returned to the caller + * + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race + * + * @param promise - A promise to discard if the signal aborts + * @param options - An options object carrying an optional signal + */ +export async function abortable( + promise: Promise, + { signal }: { signal?: AbortSignal } +): Promise { + if (signal == null) { + return await promise; + } + + const { promise: aborted, reject } = promiseWithResolvers(); + + const abortListener = signal.aborted + ? reject(signal.reason) + : addAbortListener(signal, function () { + reject(this.reason); + }); + + try { + return await Promise.race([promise, aborted]); + } finally { + abortListener?.[kDispose](); + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/write_concern.ts b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/write_concern.ts new file mode 100644 index 00000000..622460fa --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/src/write_concern.ts @@ -0,0 +1,183 @@ +import { type Document } from './bson'; +import { MongoDBResponse } from './cmap/wire_protocol/responses'; +import { MongoWriteConcernError } from './error'; + +/** @public */ +export type W = number | 'majority'; + +/** @public */ +export interface WriteConcernOptions { + /** Write Concern as an object */ + writeConcern?: WriteConcern | WriteConcernSettings; +} + +/** @public */ +export interface WriteConcernSettings { + /** The write concern */ + w?: W; + /** + * The write concern timeout. + */ + wtimeoutMS?: number; + /** The journal write concern */ + journal?: boolean; + + // legacy options + /** + * The journal write concern. + * @deprecated Will be removed in the next major version. Please use the journal option. + */ + j?: boolean; + /** + * The write concern timeout. + */ + wtimeout?: number; + /** + * The file sync write concern. + * @deprecated Will be removed in the next major version. Please use the journal option. + */ + fsync?: boolean | 1; +} + +export const WRITE_CONCERN_KEYS = ['w', 'wtimeout', 'j', 'journal', 'fsync']; + +/** The write concern options that decorate the server command. */ +interface CommandWriteConcernOptions { + /** The write concern */ + w?: W; + /** The journal write concern. */ + j?: boolean; + /** The write concern timeout. */ + wtimeout?: number; +} + +/** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * @public + * + * @see https://www.mongodb.com/docs/manual/reference/write-concern/ + */ +export class WriteConcern { + /** + * Request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * If w is 0 and is set on a write operation, the server will not send a response. + */ + readonly w?: W; + /** Request acknowledgment that the write operation has been written to the on-disk journal */ + readonly journal?: boolean; + /** + * Specify a time limit to prevent write operations from blocking indefinitely. + */ + readonly wtimeoutMS?: number; + /** + * Specify a time limit to prevent write operations from blocking indefinitely. + * @deprecated Will be removed in the next major version. Please use wtimeoutMS. + */ + wtimeout?: number; + /** + * Request acknowledgment that the write operation has been written to the on-disk journal. + * @deprecated Will be removed in the next major version. Please use journal. + */ + j?: boolean; + /** + * Equivalent to the j option. + * @deprecated Will be removed in the next major version. Please use journal. + */ + fsync?: boolean | 1; + + /** + * Constructs a WriteConcern from the write concern properties. + * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * @param wtimeoutMS - specify a time limit to prevent write operations from blocking indefinitely + * @param journal - request acknowledgment that the write operation has been written to the on-disk journal + * @param fsync - equivalent to the j option. Is deprecated and will be removed in the next major version. + */ + constructor(w?: W, wtimeoutMS?: number, journal?: boolean, fsync?: boolean | 1) { + if (w != null) { + if (!Number.isNaN(Number(w))) { + this.w = Number(w); + } else { + this.w = w; + } + } + if (wtimeoutMS != null) { + this.wtimeoutMS = this.wtimeout = wtimeoutMS; + } + if (journal != null) { + this.journal = this.j = journal; + } + if (fsync != null) { + this.journal = this.j = fsync ? true : false; + } + } + + /** + * Apply a write concern to a command document. Will modify and return the command. + */ + static apply(command: Document, writeConcern: WriteConcern): Document { + const wc: CommandWriteConcernOptions = {}; + // The write concern document sent to the server has w/wtimeout/j fields. + if (writeConcern.w != null) wc.w = writeConcern.w; + if (writeConcern.wtimeoutMS != null) wc.wtimeout = writeConcern.wtimeoutMS; + if (writeConcern.journal != null) wc.j = writeConcern.j; + command.writeConcern = wc; + return command; + } + + /** Construct a WriteConcern given an options object. */ + static fromOptions( + options?: WriteConcernOptions | WriteConcern | W, + inherit?: WriteConcernOptions | WriteConcern + ): WriteConcern | undefined { + if (options == null) return undefined; + inherit = inherit ?? {}; + let opts: WriteConcernSettings | WriteConcern | undefined; + if (typeof options === 'string' || typeof options === 'number') { + opts = { w: options }; + } else if (options instanceof WriteConcern) { + opts = options; + } else { + opts = options.writeConcern; + } + const parentOpts: WriteConcern | WriteConcernSettings | undefined = + inherit instanceof WriteConcern ? inherit : inherit.writeConcern; + + const mergedOpts = { ...parentOpts, ...opts } as WriteConcernSettings; + const { + w = undefined, + wtimeout = undefined, + j = undefined, + fsync = undefined, + journal = undefined, + wtimeoutMS = undefined + } = mergedOpts; + if ( + w != null || + wtimeout != null || + wtimeoutMS != null || + j != null || + journal != null || + fsync != null + ) { + return new WriteConcern(w, wtimeout ?? wtimeoutMS, j ?? journal, fsync); + } + return undefined; + } +} + +/** Called with either a plain object or MongoDBResponse */ +export function throwIfWriteConcernError(response: unknown): void { + if (typeof response === 'object' && response != null) { + const writeConcernError: object | null = + MongoDBResponse.is(response) && response.has('writeConcernError') + ? response.toObject() + : !MongoDBResponse.is(response) && 'writeConcernError' in response + ? response + : null; + + if (writeConcernError != null) { + throw new MongoWriteConcernError(writeConcernError as any); + } + } +} diff --git a/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/tsconfig.json b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/tsconfig.json new file mode 100644 index 00000000..fe3cdb4a --- /dev/null +++ b/backend/node_modules/.pnpm/mongodb@7.6.0/node_modules/mongodb/tsconfig.json @@ -0,0 +1,53 @@ +{ + "compilerOptions": { + "allowJs": true, + "checkJs": false, + "strict": true, + "alwaysStrict": true, + "target": "ES2023", + // node16 still emits CommonJS for this package (no "type": "module") but, unlike + // `module: commonjs`, models Node's real semantics: dynamic `import()` is legal inside CJS + // and is preserved verbatim instead of being downleveled to `require()` (NODE-7603). + "module": "node16", + "moduleResolution": "node16", + // node16 defaults esModuleInterop on; keep it off to preserve this package's historical + // emit exactly (`import * as x` stays `const x = require(...)`, no __importStar wrappers — + // which sinon-based module stubbing in the test suite also relies on). + "esModuleInterop": false, + "skipLibCheck": true, + "lib": [ + "es2023" + ], + // We don't make use of tslib helpers, all syntax used is supported by target engine + "importHelpers": false, + "noEmitHelpers": true, + // Never emit error filled code + "noEmitOnError": true, + "outDir": "lib", + // We want the sourcemaps in a separate file + "inlineSourceMap": false, + "sourceMap": true, + // API-Extractor uses declaration maps to report problems in source, no need to distribute + "declaration": true, + "declarationMap": true, + // we include sources in the release + "inlineSources": false, + // Prevents web types from being suggested by vscode. + "types": [ + "node" + ], + "forceConsistentCasingInFileNames": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + // TODO(NODE-3659): Enable useUnknownInCatchVariables and add type assertions or remove unnecessary catch blocks + "useUnknownInCatchVariables": false, + "useDefineForClassFields": false + }, + "ts-node": { + "transpileOnly": true, + "compiler": "typescript-cached-transpile" + }, + "include": [ + "src/**/*" + ] +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/@standard-schema/spec b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/@standard-schema/spec new file mode 120000 index 00000000..f2c558c0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/@standard-schema/spec @@ -0,0 +1 @@ +../../../@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/kareem b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/kareem new file mode 120000 index 00000000..fe894229 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/kareem @@ -0,0 +1 @@ +../../kareem@3.4.0/node_modules/kareem \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongodb b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongodb new file mode 120000 index 00000000..75831146 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongodb @@ -0,0 +1 @@ +../../mongodb@7.6.0/node_modules/mongodb \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/LICENSE.md b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/LICENSE.md new file mode 100644 index 00000000..54b4a4c6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/LICENSE.md @@ -0,0 +1,22 @@ +# MIT License + +Copyright (c) 2010-2013 LearnBoost +Copyright (c) 2013-2021 Automattic + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/README.md b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/README.md new file mode 100644 index 00000000..7a7fd362 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/README.md @@ -0,0 +1,397 @@ +# Mongoose + +Mongoose is a [MongoDB](https://www.mongodb.org/) object modeling tool designed to work in an asynchronous environment. Mongoose supports [Node.js](https://nodejs.org/en/) and [Deno](https://deno.land/) (alpha). + +[![Build Status](https://github.com/Automattic/mongoose/workflows/Test/badge.svg)](https://github.com/Automattic/mongoose) +[![NPM version](https://badge.fury.io/js/mongoose.svg)](http://badge.fury.io/js/mongoose) +[![Deno version](https://deno.land/badge/mongoose/version)](https://deno.land/x/mongoose) +[![Deno popularity](https://deno.land/badge/mongoose/popularity)](https://deno.land/x/mongoose) + +[![npm](https://nodei.co/npm/mongoose.png)](https://www.npmjs.com/package/mongoose) + +## Documentation + +The official documentation website is [mongoosejs.com](https://mongoosejs.com/). + +Mongoose 9.0.0 was released on November 21, 2025. You can find more details on [backwards breaking changes in 9.0.0 on our docs site](https://mongoosejs.com/docs/migrating_to_9.html). + +## Support + +* [Stack Overflow](http://stackoverflow.com/questions/tagged/mongoose) +* [Bug Reports](https://github.com/Automattic/mongoose/issues/) +* [Mongoose Slack Channel](http://slack.mongoosejs.io/) +* [Help Forum](http://groups.google.com/group/mongoose-orm) +* [MongoDB Support](https://www.mongodb.com/docs/manual/support/) + +## Plugins + +Check out the [plugins search site](https://plugins.mongoosejs.io/) to see hundreds of related modules from the community. Next, learn how to write your own plugin from the [docs](https://mongoosejs.com/docs/plugins.html) or [this blog post](http://thecodebarbarian.com/2015/03/06/guide-to-mongoose-plugins). + +## Contributors + +Pull requests are always welcome! Please base pull requests against the `master` +branch and follow the [contributing guide](https://github.com/Automattic/mongoose/blob/master/CONTRIBUTING.md). + +If your pull request makes documentation changes, please do **not** +modify any `.html` files. The `.html` files are compiled code, so please make +your changes in `docs/*.pug`, `lib/*.js`, or `test/docs/*.js`. + +View all 400+ [contributors](https://github.com/Automattic/mongoose/graphs/contributors). + +## Installation + +First install [Node.js](https://nodejs.org/) and [MongoDB](https://www.mongodb.org/downloads), then install the `mongoose` package using your preferred package manager: + +### Using npm + +```sh +npm install mongoose +``` + +### Using pnpm + +```sh +pnpm add mongoose +``` + +### Using Yarn + +```sh +yarn add mongoose +``` + +### Using Bun + +```sh +bun add mongoose +``` + +Mongoose 6.8.0 also includes alpha support for [Deno](https://deno.land/). + +## Importing + +```javascript +// Using Node.js `require()` +const mongoose = require('mongoose'); + +// Using ES6 imports +import mongoose from 'mongoose'; +``` + +Or, using [Deno's `createRequire()` for CommonJS support](https://deno.land/std@0.113.0/node/README.md?source=#commonjs-modules-loading) as follows. + +```javascript +import { createRequire } from 'https://deno.land/std@0.177.0/node/module.ts'; +const require = createRequire(import.meta.url); + +const mongoose = require('mongoose'); + +mongoose.connect('mongodb://127.0.0.1:27017/test') + .then(() => console.log('Connected!')); +``` + +You can then run the above script using the following. + +```sh +deno run --allow-net --allow-read --allow-sys --allow-env mongoose-test.js +``` + +## Mongoose Studio + +[Mongoose Studio](https://mongoosestudio.app?utm_source=mongoose&utm_medium=referral&utm_campaign=readme) is a free, fully open-source, browser-based MongoDB GUI built by the Mongoose team for apps that already use Mongoose. Install `@mongoosejs/studio` from npm and run it alongside your app as Express middleware, or deploy it on Vercel or Netlify, to browse and edit documents, query with your existing models and schemas with autocomplete, build dashboards, visualize and edit GeoJSON, and use AI-assisted MongoDB workflows without moving data into a hosted third-party workspace or sharing raw MongoDB connection strings. + +## Mongoose for Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of mongoose and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-mongoose?utm_source=npm-mongoose&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Overview + +### Connecting to MongoDB + +First, we need to define a connection. If your app uses only one database, you should use `mongoose.connect`. If you need to create additional connections, use `mongoose.createConnection`. + +Both `connect` and `createConnection` take a `mongodb://` URI, or the parameters `host, database, port, options`. + +```js +await mongoose.connect('mongodb://127.0.0.1/my_database'); +``` + +Once connected, the `open` event is fired on the `Connection` instance. If you're using `mongoose.connect`, the `Connection` is `mongoose.connection`. Otherwise, `mongoose.createConnection` return value is a `Connection`. + +**Note:** *If the local connection fails then try using 127.0.0.1 instead of localhost. Sometimes issues may arise when the local hostname has been changed.* + +**Important!** Mongoose buffers all the commands until it's connected to the database. This means that you don't have to wait until it connects to MongoDB in order to define models, run queries, etc. + +### Defining a Model + +Models are defined through the `Schema` interface. + +```js +const Schema = mongoose.Schema; +const ObjectId = Schema.ObjectId; + +const BlogPost = new Schema({ + author: ObjectId, + title: String, + body: String, + date: Date +}); +``` + +Aside from defining the structure of your documents and the types of data you're storing, a Schema handles the definition of: + +* [Validators](https://mongoosejs.com/docs/validation.html) (async and sync) +* [Defaults](https://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-default) +* [Getters](https://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-get) +* [Setters](https://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-set) +* [Indexes](https://mongoosejs.com/docs/guide.html#indexes) +* [Middleware](https://mongoosejs.com/docs/middleware.html) +* [Methods](https://mongoosejs.com/docs/guide.html#methods) definition +* [Statics](https://mongoosejs.com/docs/guide.html#statics) definition +* [Plugins](https://mongoosejs.com/docs/plugins.html) +* [pseudo-JOINs](https://mongoosejs.com/docs/populate.html) + +The following example shows some of these features: + +```js +const Comment = new Schema({ + name: { type: String, default: 'hahaha' }, + age: { type: Number, min: 18, index: true }, + bio: { type: String, match: /[a-z]/ }, + date: { type: Date, default: Date.now }, + buff: Buffer +}); + +// a setter +Comment.path('name').set(function(v) { + return capitalize(v); +}); + +// middleware +Comment.pre('save', function(next) { + notify(this.get('email')); + next(); +}); +``` + +### Accessing a Model + +Once we define a model through `mongoose.model('ModelName', mySchema)`, we can access it through the same function + +```js +const MyModel = mongoose.model('ModelName'); +``` + +Or just do it all at once + +```js +const MyModel = mongoose.model('ModelName', mySchema); +``` + +The first argument is the *singular* name of the collection your model is for. **Mongoose automatically looks for the *plural* version of your model name.** For example, if you use + +```js +const MyModel = mongoose.model('Ticket', mySchema); +``` + +Then `MyModel` will use the **tickets** collection, not the **ticket** collection. For more details read the [model docs](https://mongoosejs.com/docs/api/mongoose.html#mongoose_Mongoose-model). + +Once we have our model, we can then instantiate it, and save it: + +```js +const instance = new MyModel(); +instance.my.key = 'hello'; +await instance.save(); +``` + +Or we can find documents from the same collection + +```js +await MyModel.find({}); +``` + +You can also `findOne`, `findById`, `update`, etc. + +```js +const instance = await MyModel.findOne({ /* ... */ }); +console.log(instance.my.key); // 'hello' +``` + +For more details check out [the docs](https://mongoosejs.com/docs/queries.html). + +**Important!** If you opened a separate connection using `mongoose.createConnection()` but attempt to access the model through `mongoose.model('ModelName')` it will not work as expected since it is not hooked up to an active db connection. In this case access your model through the connection you created: + +```js +const conn = mongoose.createConnection('your connection string'); +const MyModel = conn.model('ModelName', schema); +const m = new MyModel(); +await m.save(); // works +``` + +vs + +```js +const conn = mongoose.createConnection('your connection string'); +const MyModel = mongoose.model('ModelName', schema); +const m = new MyModel(); +await m.save(); // does not work b/c the default connection object was never connected +``` + +### Embedded Documents + +In the first example snippet, we defined a key in the Schema that looks like: + +```txt +comments: [Comment] +``` + +Where `Comment` is a `Schema` we created. This means that creating embedded documents is as simple as: + +```js +// retrieve my model +const BlogPost = mongoose.model('BlogPost'); + +// create a blog post +const post = new BlogPost(); + +// create a comment +post.comments.push({ title: 'My comment' }); + +await post.save(); +``` + +The same goes for removing them: + +```js +const post = await BlogPost.findById(myId); +post.comments[0].deleteOne(); +await post.save(); +``` + +Embedded documents enjoy all the same features as your models. Defaults, validators, middleware. + +### Middleware + +See the [docs](https://mongoosejs.com/docs/middleware.html) page. + +#### Intercepting and mutating method arguments + +You can intercept method arguments via middleware. + +For example, this would allow you to broadcast changes about your Documents every time someone `set`s a path in your Document to a new value: + +```js +schema.pre('set', function(next, path, val, typel) { + // `this` is the current Document + this.emit('set', path, val); + + // Pass control to the next pre + next(); +}); +``` + +Moreover, you can mutate the incoming `method` arguments so that subsequent middleware see different values for those arguments. To do so, just pass the new values to `next`: + +```js +schema.pre(method, function firstPre(next, methodArg1, methodArg2) { + // Mutate methodArg1 + next('altered-' + methodArg1.toString(), methodArg2); +}); + +// pre declaration is chainable +schema.pre(method, function secondPre(next, methodArg1, methodArg2) { + console.log(methodArg1); + // => 'altered-originalValOfMethodArg1' + + console.log(methodArg2); + // => 'originalValOfMethodArg2' + + // Passing no arguments to `next` automatically passes along the current argument values + // i.e., the following `next()` is equivalent to `next(methodArg1, methodArg2)` + // and also equivalent to, with the example method arg + // values, `next('altered-originalValOfMethodArg1', 'originalValOfMethodArg2')` + next(); +}); +``` + +#### Schema gotcha + +`type`, when used in a schema has special meaning within Mongoose. If your schema requires using `type` as a nested property you must use object notation: + +```js +new Schema({ + broken: { type: Boolean }, + asset: { + name: String, + type: String // uh oh, it broke. asset will be interpreted as String + } +}); + +new Schema({ + works: { type: Boolean }, + asset: { + name: String, + type: { type: String } // works. asset is an object with a type property + } +}); +``` + +### Driver Access + +Mongoose is built on top of the [official MongoDB Node.js driver](https://github.com/mongodb/node-mongodb-native). Each mongoose model keeps a reference to a [native MongoDB driver collection](https://mongodb.github.io/node-mongodb-native/7.5/classes/Collection.html). The collection object can be accessed using `YourModel.collection`. However, using the collection object directly bypasses all mongoose features, including hooks, validation, etc. The one +notable exception is that `YourModel.collection` still buffers +commands. As such, `YourModel.collection.find()` will **not** +return a cursor. + +## API Docs + +[Mongoose API documentation](https://mongoosejs.com/docs/api/mongoose.html), generated using [dox](https://github.com/tj/dox) +and [acquit](https://github.com/vkarpov15/acquit). + +## Related Projects + +### MongoDB Runners + +* [run-rs](https://www.npmjs.com/package/run-rs) +* [mongodb-memory-server](https://www.npmjs.com/package/mongodb-memory-server) +* [mongodb-topology-manager](https://www.npmjs.com/package/mongodb-topology-manager) + +### Unofficial CLIs + +* [mongoosejs-cli](https://www.npmjs.com/package/mongoosejs-cli) + +### Data Seeding + +* [dookie](https://www.npmjs.com/package/dookie) +* [seedgoose](https://www.npmjs.com/package/seedgoose) +* [mongoose-data-seed](https://www.npmjs.com/package/mongoose-data-seed) + +### Express Session Stores + +* [connect-mongodb-session](https://www.npmjs.com/package/connect-mongodb-session) +* [connect-mongo](https://www.npmjs.com/package/connect-mongo) + +## License + +Copyright (c) 2010 LearnBoost <dev@learnboost.com> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/SECURITY.md b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/SECURITY.md new file mode 100644 index 00000000..41b89d83 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/SECURITY.md @@ -0,0 +1 @@ +Please follow the instructions on [Tidelift's security page](https://tidelift.com/docs/security) to report a security issue. diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/eslint.config.mjs b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/eslint.config.mjs new file mode 100644 index 00000000..34488310 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/eslint.config.mjs @@ -0,0 +1,202 @@ +import { defineConfig, globalIgnores } from 'eslint/config'; +import mochaNoOnly from 'eslint-plugin-mocha-no-only'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; +import js from '@eslint/js'; + +export default defineConfig([ + globalIgnores([ + '**/tools', + '**/dist', + 'test/files/*', + '**/benchmarks', + '**/*.min.js', + '**/docs/js/native.js', + '!**/.*', + '**/node_modules', + '**/.git', + '**/data', + '**/docs/3.*/**', + '**/docs/5.*/**', + '**/docs/vendor/*' + ]), + js.configs.recommended, + // general options + { + languageOptions: { + globals: globals.node, + ecmaVersion: 2022, // nodejs 18.0.0, + sourceType: 'commonjs' + }, + rules: { + 'comma-style': 'error', + + indent: ['error', 2, { + SwitchCase: 1, + VariableDeclarator: 2 + }], + + 'keyword-spacing': 'error', + 'no-whitespace-before-property': 'error', + 'no-buffer-constructor': 'warn', + 'no-console': 'off', + 'no-constant-condition': 'off', + 'no-multi-spaces': 'error', + 'func-call-spacing': 'error', + 'no-unused-vars': ['error', { ignoreRestSiblings: true }], + 'no-trailing-spaces': 'error', + 'no-undef': 'error', + 'no-unneeded-ternary': 'error', + 'no-const-assign': 'error', + 'no-useless-rename': 'error', + 'no-dupe-keys': 'error', + 'space-in-parens': ['error', 'never'], + + 'spaced-comment': ['error', 'always', { + block: { + markers: ['!'], + balanced: true + } + }], + + 'key-spacing': ['error', { + beforeColon: false, + afterColon: true + }], + + 'comma-spacing': ['error', { + before: false, + after: true + }], + + 'array-bracket-spacing': 1, + + 'arrow-spacing': ['error', { + before: true, + after: true + }], + + 'object-curly-spacing': ['error', 'always'], + 'comma-dangle': ['error', 'never'], + 'no-unreachable': 'error', + quotes: ['error', 'single'], + 'quote-props': ['error', 'as-needed'], + semi: 'error', + 'no-extra-semi': 'error', + 'semi-spacing': 'error', + 'no-spaced-func': 'error', + 'no-throw-literal': 'error', + 'space-before-blocks': 'error', + 'space-before-function-paren': ['error', 'never'], + 'space-infix-ops': 'error', + 'space-unary-ops': 'error', + 'no-var': 'warn', + 'prefer-const': 'warn', + strict: ['error', 'global'], + + 'no-restricted-globals': ['error', { + name: 'context', + message: 'Don\'t use Mocha\'s global context' + }], + + 'no-prototype-builtins': 'off', + 'no-empty': 'off', + 'eol-last': 'warn', + + 'no-multiple-empty-lines': ['warn', { + max: 2 + }] + } + }, + // general typescript options + { + files: ['**/*.{ts,tsx}', '**/*.md/*.ts', '**/*.md/*.typescript'], + extends: [ + tseslint.configs.recommended + ], + languageOptions: { + parserOptions: { + projectService: { + allowDefaultProject: [], + defaultProject: 'tsconfig.json' + } + } + }, + rules: { + '@typescript-eslint/triple-slash-reference': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-empty-function': 'off', + + 'spaced-comment': ['error', 'always', { + block: { + markers: ['!'], + balanced: true + }, + + markers: ['/'] + }], + + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/no-dupe-class-members': 'error', + '@typescript-eslint/no-redeclare': 'error', + '@typescript-eslint/space-infix-ops': 'off', + '@typescript-eslint/no-require-imports': 'off', + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-wrapper-object-types': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off' + } + }, + // type test specific options + { + files: ['test/types/**/*.ts'], + rules: { + '@typescript-eslint/no-empty-interface': 'off' + } + }, + // test specific options (including type tests) + { + files: ['test/**/*.js', 'test/**/*.ts'], + ignores: ['deno*.mjs'], + plugins: { + 'mocha-no-only': mochaNoOnly + }, + languageOptions: { + globals: globals.mocha + }, + rules: { + 'no-self-assign': 'off', + 'mocha-no-only/mocha-no-only': ['error'] + } + }, + // deno specific options + { + files: ['**/deno*.mjs'], + languageOptions: { + globals: { + // "globals" currently has no definition for deno + Deno: 'readonly' + } + } + }, + // general options for module files + { + files: ['**/*.mjs'], + languageOptions: { + sourceType: 'module' + } + }, + // doc script specific options + { + files: ['**/docs/js/**/*.js'], + languageOptions: { + globals: { + ...Object.fromEntries(Object.entries(globals.node).map(([key]) => [key, 'off'])), + ...globals.browser } + } + } +]); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/index.js new file mode 100644 index 00000000..6ebbd5fd --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/index.js @@ -0,0 +1,64 @@ +/** + * Export lib/mongoose + * + */ + +'use strict'; + +const mongoose = require('./lib/'); + +module.exports = mongoose; +module.exports.default = mongoose; +module.exports.mongoose = mongoose; + +// Re-export for ESM support +module.exports.cast = mongoose.cast; +module.exports.STATES = mongoose.STATES; +module.exports.setDriver = mongoose.setDriver; +module.exports.set = mongoose.set; +module.exports.get = mongoose.get; +module.exports.createConnection = mongoose.createConnection; +module.exports.connect = mongoose.connect; +module.exports.disconnect = mongoose.disconnect; +module.exports.startSession = mongoose.startSession; +module.exports.pluralize = mongoose.pluralize; +module.exports.model = mongoose.model; +module.exports.deleteModel = mongoose.deleteModel; +module.exports.modelNames = mongoose.modelNames; +module.exports.plugin = mongoose.plugin; +module.exports.connections = mongoose.connections; +module.exports.version = mongoose.version; +module.exports.Aggregate = mongoose.Aggregate; +module.exports.Mongoose = mongoose.Mongoose; +module.exports.Schema = mongoose.Schema; +module.exports.SchemaType = mongoose.SchemaType; +module.exports.SchemaTypes = mongoose.SchemaTypes; +module.exports.VirtualType = mongoose.VirtualType; +module.exports.Types = mongoose.Types; +module.exports.Query = mongoose.Query; +module.exports.Model = mongoose.Model; +module.exports.Document = mongoose.Document; +module.exports.ObjectId = mongoose.ObjectId; +module.exports.isValidObjectId = mongoose.isValidObjectId; +module.exports.isObjectIdOrHexString = mongoose.isObjectIdOrHexString; +module.exports.syncIndexes = mongoose.syncIndexes; +module.exports.Decimal128 = mongoose.Decimal128; +module.exports.Mixed = mongoose.Mixed; +module.exports.Date = mongoose.Date; +module.exports.Number = mongoose.Number; +module.exports.Error = mongoose.Error; +module.exports.MongooseError = mongoose.MongooseError; +module.exports.now = mongoose.now; +module.exports.CastError = mongoose.CastError; +module.exports.SchemaTypeOptions = mongoose.SchemaTypeOptions; +module.exports.mongo = mongoose.mongo; +module.exports.mquery = mongoose.mquery; +module.exports.sanitizeFilter = mongoose.sanitizeFilter; +module.exports.trusted = mongoose.trusted; +module.exports.skipMiddlewareFunction = mongoose.skipMiddlewareFunction; +module.exports.overwriteMiddlewareResult = mongoose.overwriteMiddlewareResult; + +// The following properties are not exported using ESM because `setDriver()` can mutate these +// module.exports.connection = mongoose.connection; +// module.exports.Collection = mongoose.Collection; +// module.exports.Connection = mongoose.Connection; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/aggregate.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/aggregate.js new file mode 100644 index 00000000..57ed5cee --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/aggregate.js @@ -0,0 +1,1263 @@ +'use strict'; + +/*! + * Module dependencies + */ + +const AggregationCursor = require('./cursor/aggregationCursor'); +const MongooseError = require('./error/mongooseError'); +const Query = require('./query'); +const { applyGlobalMaxTimeMS, applyGlobalDiskUse } = require('./helpers/query/applyGlobalOption'); +const clone = require('./helpers/clone'); +const getConstructorName = require('./helpers/getConstructorName'); +const prepareDiscriminatorPipeline = require('./helpers/aggregate/prepareDiscriminatorPipeline'); +const { buildMiddlewareFilter } = require('./helpers/buildMiddlewareFilter'); +const stringifyFunctionOperators = require('./helpers/aggregate/stringifyFunctionOperators'); +const utils = require('./utils'); +const { modelSymbol } = require('./helpers/symbols'); +const { createTracedChannel } = require('./tracing'); +const { trace: traceAggregate } = createTracedChannel('mongoose:aggregate'); +const read = Query.prototype.read; +const readConcern = Query.prototype.readConcern; + +const validRedactStringValues = new Set(['$$DESCEND', '$$PRUNE', '$$KEEP']); + +/** + * Aggregate constructor used for building aggregation pipelines. Do not + * instantiate this class directly, use [Model.aggregate()](https://mongoosejs.com/docs/api/model.html#Model.aggregate()) instead. + * + * #### Example: + * + * const aggregate = Model.aggregate([ + * { $project: { a: 1, b: 1 } }, + * { $skip: 5 } + * ]); + * + * Model. + * aggregate([{ $match: { age: { $gte: 21 }}}]). + * unwind('tags'). + * exec(); + * + * #### Note: + * + * - The documents returned are plain javascript objects, not mongoose documents (since any shape of document can be returned). + * - Mongoose does **not** cast pipeline stages. The below will **not** work unless `_id` is a string in the database + * + * new Aggregate([{ $match: { _id: '00000000000000000000000a' } }]); + * // Do this instead to cast to an ObjectId + * new Aggregate([{ $match: { _id: new mongoose.Types.ObjectId('00000000000000000000000a') } }]); + * + * @see MongoDB https://www.mongodb.com/docs/manual/applications/aggregation/ + * @see driver https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#aggregate + * @param {Array} [pipeline] aggregation pipeline as an array of objects + * @param {Model|Connection} [modelOrConn] the model or connection to use with this aggregate. + * @api public + */ + +function Aggregate(pipeline, modelOrConn) { + this._pipeline = []; + if (modelOrConn == null || modelOrConn[modelSymbol]) { + this._model = modelOrConn; + } else { + this._connection = modelOrConn; + } + this.options = {}; + + if (arguments.length === 1 && Array.isArray(pipeline)) { + this.append.apply(this, pipeline); + } +} + +/** + * Contains options passed down to the [aggregate command](https://www.mongodb.com/docs/manual/reference/command/aggregate/). + * Supported options are: + * + * - [`allowDiskUse`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.allowDiskUse()) + * - `bypassDocumentValidation` + * - [`collation`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.collation()) + * - `comment` + * - [`cursor`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.cursor()) + * - [`explain`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.explain()) + * - `fieldsAsRaw` + * - [`hint`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.hint()) + * - `let` + * - `maxTimeMS` + * - `raw` + * - [`readConcern`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.readConcern()) + * - `readPreference` + * - [`session`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.session()) + * - `writeConcern` + * + * @property options + * @memberOf Aggregate + * @api public + */ + +Aggregate.prototype.options; + +/** + * Returns default options for this aggregate. + * + * @param {Model} model + * @api private + */ + +Aggregate.prototype._optionsForExec = function() { + const options = this.options || {}; + + const asyncLocalStorage = this.model()?.db?.base.transactionAsyncLocalStorage?.getStore(); + if (!Object.hasOwn(options, 'session') && asyncLocalStorage?.session != null) { + options.session = asyncLocalStorage.session; + } + + return options; +}; + +/** + * Get/set the model that this aggregation will execute on. + * + * #### Example: + * + * const aggregate = MyModel.aggregate([{ $match: { answer: 42 } }]); + * aggregate.model() === MyModel; // true + * + * // Change the model. There's rarely any reason to do this. + * aggregate.model(SomeOtherModel); + * aggregate.model() === SomeOtherModel; // true + * + * @param {Model} [model] Set the model associated with this aggregate. If not provided, returns the already stored model. + * @return {Model} + * @api public + */ + +Aggregate.prototype.model = function(model) { + if (arguments.length === 0) { + return this._model; + } + + this._model = model; + if (model.schema != null) { + if (this.options.readPreference == null && + model.schema.options.read != null) { + this.options.readPreference = model.schema.options.read; + } + if (this.options.collation == null && + model.schema.options.collation != null) { + this.options.collation = model.schema.options.collation; + } + } + + return model; +}; + +/** + * Appends new operators to this aggregate pipeline + * + * #### Example: + * + * aggregate.append({ $project: { field: 1 }}, { $limit: 2 }); + * + * // or pass an array + * const pipeline = [{ $match: { daw: 'Logic Audio X' }} ]; + * aggregate.append(pipeline); + * + * @param {...object|object[]} ops operator(s) to append. Can either be a spread of objects or a single parameter of an object array. + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.append = function() { + const args = (arguments.length === 1 && Array.isArray(arguments[0])) + ? arguments[0] + : [...arguments]; + + if (!args.every(isOperator)) { + throw new MongooseError('Arguments must be aggregate pipeline operators'); + } + + this._pipeline = this._pipeline.concat(args); + + return this; +}; + +/** + * Appends a new $addFields operator to this aggregate pipeline. + * Requires MongoDB v3.4+ to work + * + * #### Example: + * + * // adding new fields based on existing fields + * aggregate.addFields({ + * newField: '$b.nested' + * , plusTen: { $add: ['$val', 10]} + * , sub: { + * name: '$a' + * } + * }) + * + * // etc + * aggregate.addFields({ salary_k: { $divide: [ "$salary", 1000 ] } }); + * + * @param {object} arg field specification + * @see $addFields https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/ + * @return {Aggregate} + * @api public + */ +Aggregate.prototype.addFields = function(arg) { + if (typeof arg !== 'object' || arg === null || Array.isArray(arg)) { + throw new MongooseError('Invalid addFields() argument. Must be an object'); + } + return this.append({ $addFields: Object.assign({}, arg) }); +}; + +/** + * Appends a new $project operator to this aggregate pipeline. + * + * Mongoose query [selection syntax](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()) is also supported. + * + * #### Example: + * + * // include a, include b, exclude _id + * aggregate.project("a b -_id"); + * + * // or you may use object notation, useful when + * // you have keys already prefixed with a "-" + * aggregate.project({a: 1, b: 1, _id: 0}); + * + * // reshaping documents + * aggregate.project({ + * newField: '$b.nested' + * , plusTen: { $add: ['$val', 10]} + * , sub: { + * name: '$a' + * } + * }) + * + * // etc + * aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ] } }); + * + * @param {object|string} arg field specification + * @see projection https://www.mongodb.com/docs/manual/reference/aggregation/project/ + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.project = function(arg) { + const fields = {}; + + if (typeof arg === 'object' && !Array.isArray(arg)) { + Object.keys(arg).forEach(function(field) { + fields[field] = arg[field]; + }); + } else if (arguments.length === 1 && typeof arg === 'string') { + arg.split(/\s+/).forEach(function(field) { + if (!field) { + return; + } + const include = field[0] === '-' ? 0 : 1; + if (include === 0) { + field = field.substring(1); + } + fields[field] = include; + }); + } else { + throw new MongooseError('Invalid project() argument. Must be string or object'); + } + + return this.append({ $project: fields }); +}; + +/** + * Appends a new custom $group operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.group({ _id: "$department" }); + * + * @see $group https://www.mongodb.com/docs/manual/reference/aggregation/group/ + * @method group + * @memberOf Aggregate + * @instance + * @param {object} arg $group operator contents + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new custom $match operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.match({ department: { $in: [ "sales", "engineering" ] } }); + * + * @see $match https://www.mongodb.com/docs/manual/reference/aggregation/match/ + * @method match + * @memberOf Aggregate + * @instance + * @param {object} arg $match operator contents + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new $skip operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.skip(10); + * + * @see $skip https://www.mongodb.com/docs/manual/reference/aggregation/skip/ + * @method skip + * @memberOf Aggregate + * @instance + * @param {number} num number of records to skip before next stage + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new $limit operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.limit(10); + * + * @see $limit https://www.mongodb.com/docs/manual/reference/aggregation/limit/ + * @method limit + * @memberOf Aggregate + * @instance + * @param {number} num maximum number of records to pass to the next stage + * @return {Aggregate} + * @api public + */ + + +/** + * Appends a new $densify operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.densify({ + * field: 'timestamp', + * range: { + * step: 1, + * unit: 'hour', + * bounds: [new Date('2021-05-18T00:00:00.000Z'), new Date('2021-05-18T08:00:00.000Z')] + * } + * }); + * + * @see $densify https://www.mongodb.com/docs/manual/reference/operator/aggregation/densify/ + * @method densify + * @memberOf Aggregate + * @instance + * @param {object} arg $densify operator contents + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new $fill operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.fill({ + * output: { + * bootsSold: { value: 0 }, + * sandalsSold: { value: 0 }, + * sneakersSold: { value: 0 } + * } + * }); + * + * @see $fill https://www.mongodb.com/docs/manual/reference/operator/aggregation/fill/ + * @method fill + * @memberOf Aggregate + * @instance + * @param {object} arg $fill operator contents + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new $geoNear operator to this aggregate pipeline. + * + * #### Note: + * + * **MUST** be used as the first operator in the pipeline. + * + * #### Example: + * + * aggregate.near({ + * near: { type: 'Point', coordinates: [40.724, -73.997] }, + * distanceField: "dist.calculated", // required + * maxDistance: 0.008, + * query: { type: "public" }, + * includeLocs: "dist.location", + * spherical: true, + * }); + * + * @see $geoNear https://www.mongodb.com/docs/manual/reference/aggregation/geoNear/ + * @method near + * @memberOf Aggregate + * @instance + * @param {object} arg + * @param {object|number[]} arg.near GeoJSON point or coordinates array + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.near = function(arg) { + if (arg == null) { + throw new MongooseError('Aggregate `near()` must be called with non-nullish argument'); + } + if (arg.near == null) { + throw new MongooseError('Aggregate `near()` argument must have a `near` property'); + } + const coordinates = Array.isArray(arg.near) ? arg.near : arg.near.coordinates; + if (typeof arg.near === 'object' && (!Array.isArray(coordinates) || coordinates.length < 2 || coordinates.find(c => typeof c !== 'number'))) { + throw new MongooseError(`Aggregate \`near()\` argument has invalid coordinates, got "${coordinates}"`); + } + + const op = {}; + op.$geoNear = arg; + return this.append(op); +}; + +/*! + * define methods + */ + +'group match skip limit out densify fill'.split(' ').forEach(function($operator) { + Aggregate.prototype[$operator] = function(arg) { + const op = {}; + op['$' + $operator] = arg; + return this.append(op); + }; +}); + +/** + * Appends new custom $unwind operator(s) to this aggregate pipeline. + * + * Note that the `$unwind` operator requires the path name to start with '$'. + * Mongoose will prepend '$' if the specified field doesn't start '$'. + * + * #### Example: + * + * aggregate.unwind("tags"); + * aggregate.unwind("a", "b", "c"); + * aggregate.unwind({ path: '$tags', preserveNullAndEmptyArrays: true }); + * + * @see $unwind https://www.mongodb.com/docs/manual/reference/aggregation/unwind/ + * @param {string|object|string[]|object[]} fields the field(s) to unwind, either as field names or as [objects with options](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/#document-operand-with-options). If passing a string, prefixing the field name with '$' is optional. If passing an object, `path` must start with '$'. + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.unwind = function() { + const args = [...arguments]; + + const res = []; + for (const arg of args) { + if (arg && typeof arg === 'object') { + res.push({ $unwind: arg }); + } else if (typeof arg === 'string') { + res.push({ + $unwind: (arg[0] === '$') ? arg : '$' + arg + }); + } else { + throw new MongooseError('Invalid arg "' + arg + '" to unwind(), ' + + 'must be string or object'); + } + } + + return this.append.apply(this, res); +}; + +/** + * Appends a new $replaceRoot operator to this aggregate pipeline. + * + * Note that the `$replaceRoot` operator requires field strings to start with '$'. + * If you are passing in a string Mongoose will prepend '$' if the specified field doesn't start '$'. + * If you are passing in an object the strings in your expression will not be altered. + * + * #### Example: + * + * aggregate.replaceRoot("user"); + * + * aggregate.replaceRoot({ x: { $concat: ['$this', '$that'] } }); + * + * @see $replaceRoot https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceRoot + * @param {string|object} newRoot the field or document which will become the new root document + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.replaceRoot = function(newRoot) { + let ret; + + if (typeof newRoot === 'string') { + ret = newRoot.startsWith('$') ? newRoot : '$' + newRoot; + } else { + ret = newRoot; + } + + return this.append({ + $replaceRoot: { + newRoot: ret + } + }); +}; + +/** + * Appends a new $count operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.count("userCount"); + * + * @see $count https://www.mongodb.com/docs/manual/reference/operator/aggregation/count + * @param {string} fieldName The name of the output field which has the count as its value. It must be a non-empty string, must not start with $ and must not contain the . character. + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.count = function(fieldName) { + return this.append({ $count: fieldName }); +}; + +/** + * Appends a new $sortByCount operator to this aggregate pipeline. Accepts either a string field name + * or a pipeline object. + * + * Note that the `$sortByCount` operator requires the new root to start with '$'. + * Mongoose will prepend '$' if the specified field name doesn't start with '$'. + * + * #### Example: + * + * aggregate.sortByCount('users'); + * aggregate.sortByCount({ $mergeObjects: [ "$employee", "$business" ] }) + * + * @see $sortByCount https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortByCount/ + * @param {object|string} arg + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.sortByCount = function(arg) { + if (arg && typeof arg === 'object') { + return this.append({ $sortByCount: arg }); + } else if (typeof arg === 'string') { + return this.append({ + $sortByCount: (arg[0] === '$') ? arg : '$' + arg + }); + } else { + throw new TypeError('Invalid arg "' + arg + '" to sortByCount(), ' + + 'must be string or object'); + } +}; + +/** + * Appends new custom $lookup operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.lookup({ from: 'users', localField: 'userId', foreignField: '_id', as: 'users' }); + * + * @see $lookup https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/#pipe._S_lookup + * @param {object} options to $lookup as described in the above link + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.lookup = function(options) { + return this.append({ $lookup: options }); +}; + +/** + * Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection. + * + * Note that graphLookup can only consume at most 100MB of memory, and does not allow disk use even if `{ allowDiskUse: true }` is specified. + * + * #### Example: + * + * // Suppose we have a collection of courses, where a document might look like `{ _id: 0, name: 'Calculus', prerequisite: 'Trigonometry'}` and `{ _id: 0, name: 'Trigonometry', prerequisite: 'Algebra' }` + * aggregate.graphLookup({ from: 'courses', startWith: '$prerequisite', connectFromField: 'prerequisite', connectToField: 'name', as: 'prerequisites', maxDepth: 3 }) // this will recursively search the 'courses' collection up to 3 prerequisites + * + * @see $graphLookup https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/#pipe._S_graphLookup + * @param {object} options to $graphLookup as described in the above link + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.graphLookup = function(options) { + const cloneOptions = {}; + if (options) { + if (!utils.isObject(options)) { + throw new TypeError('Invalid graphLookup() argument. Must be an object.'); + } + + utils.mergeClone(cloneOptions, options); + const startWith = cloneOptions.startWith; + + if (startWith && typeof startWith === 'string') { + cloneOptions.startWith = cloneOptions.startWith.startsWith('$') ? + cloneOptions.startWith : + '$' + cloneOptions.startWith; + } + + } + return this.append({ $graphLookup: cloneOptions }); +}; + +/** + * Appends new custom $sample operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.sample(3); // Add a pipeline that picks 3 random documents + * + * // `$match` before `$sample` samples from the filtered subset + * aggregate.match({ difficulty: 'easy' }).sample(3); + * + * @see $sample https://www.mongodb.com/docs/manual/reference/operator/aggregation/sample/#pipe._S_sample + * @param {number} size number of random documents to pick + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.sample = function(size) { + return this.append({ $sample: { size: size } }); +}; + +/** + * Appends a new $sort operator to this aggregate pipeline. + * + * If an object is passed, values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. + * + * If a string is passed, it must be a space delimited list of path names. The sort order of each path is ascending unless the path name is prefixed with `-` which will be treated as descending. + * + * #### Example: + * + * // these are equivalent + * aggregate.sort({ field: 'asc', test: -1 }); + * aggregate.sort('field -test'); + * + * @see $sort https://www.mongodb.com/docs/manual/reference/aggregation/sort/ + * @param {object|string} arg + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.sort = function(arg) { + // TODO refactor to reuse the query builder logic + + const sort = {}; + + if (getConstructorName(arg) === 'Object') { + const desc = ['desc', 'descending', -1]; + Object.keys(arg).forEach(function(field) { + // If sorting by text score, skip coercing into 1/-1 + if (arg[field] instanceof Object && arg[field].$meta) { + sort[field] = arg[field]; + return; + } + sort[field] = desc.indexOf(arg[field]) === -1 ? 1 : -1; + }); + } else if (arguments.length === 1 && typeof arg === 'string') { + arg.split(/\s+/).forEach(function(field) { + if (!field) { + return; + } + const ascend = field[0] === '-' ? -1 : 1; + if (ascend === -1) { + field = field.substring(1); + } + sort[field] = ascend; + }); + } else { + throw new TypeError('Invalid sort() argument. Must be a string or object.'); + } + + return this.append({ $sort: sort }); +}; + +/** + * Appends new $unionWith operator to this aggregate pipeline. + * + * #### Example: + * + * aggregate.unionWith({ coll: 'users', pipeline: [ { $match: { _id: 1 } } ] }); + * + * @see $unionWith https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith + * @param {object} options to $unionWith query as described in the above link + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.unionWith = function(options) { + return this.append({ $unionWith: options }); +}; + + +/** + * Sets the readPreference option for the aggregation query. + * + * #### Example: + * + * await Model.aggregate(pipeline).read('primaryPreferred'); + * + * @param {string|ReadPreference} pref one of the listed preference options or their aliases + * @param {Array} [tags] optional tags for this query. + * @return {Aggregate} this + * @api public + * @see mongodb https://www.mongodb.com/docs/manual/applications/replication/#read-preference + */ + +Aggregate.prototype.read = function(pref, tags) { + read.call(this, pref, tags); + return this; +}; + +/** + * Sets the readConcern level for the aggregation query. + * + * #### Example: + * + * await Model.aggregate(pipeline).readConcern('majority'); + * + * @param {'local'|'available'|'majority'|'snapshot'|'linearizable'|'l'|'a'|'m'|'s'|'lz'} level one of the listed read concern level or their aliases + * @see mongodb https://www.mongodb.com/docs/manual/reference/read-concern/ + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.readConcern = function(level) { + readConcern.call(this, level); + return this; +}; + +/** + * Appends a new $redact operator to this aggregate pipeline. + * + * If 3 arguments are supplied, Mongoose will wrap them with if-then-else of $cond operator respectively + * If `thenExpr` or `elseExpr` is string, make sure it starts with $$, like `$$DESCEND`, `$$PRUNE` or `$$KEEP`. + * + * #### Example: + * + * await Model.aggregate(pipeline).redact({ + * $cond: { + * if: { $eq: [ '$level', 5 ] }, + * then: '$$PRUNE', + * else: '$$DESCEND' + * } + * }); + * + * // $redact often comes with $cond operator, you can also use the following syntax provided by mongoose + * await Model.aggregate(pipeline).redact({ $eq: [ '$level', 5 ] }, '$$PRUNE', '$$DESCEND'); + * + * @param {object} expression redact options or conditional expression + * @param {string|object} [thenExpr] true case for the condition + * @param {string|object} [elseExpr] false case for the condition + * @return {Aggregate} this + * @see $redact https://www.mongodb.com/docs/manual/reference/operator/aggregation/redact/ + * @api public + */ + +Aggregate.prototype.redact = function(expression, thenExpr, elseExpr) { + if (arguments.length === 3) { + if ((typeof thenExpr === 'string' && !validRedactStringValues.has(thenExpr)) || + (typeof elseExpr === 'string' && !validRedactStringValues.has(elseExpr))) { + throw new MongooseError('If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP'); + } + + expression = { + $cond: { + if: expression, + then: thenExpr, + else: elseExpr + } + }; + } else if (arguments.length !== 1) { + throw new TypeError('Invalid arguments'); + } + + return this.append({ $redact: expression }); +}; + +/** + * Execute the aggregation with explain + * + * #### Example: + * + * Model.aggregate(..).explain() + * + * @param {'queryPlanner'|'executionStats'|'allPlansExecution'} [verbosity] + * @return {Promise} + */ + +Aggregate.prototype.explain = async function explain(verbosity) { + if (typeof verbosity === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Aggregate.prototype.explain() no longer accepts a callback'); + } + const model = this._model; + + if (!this._pipeline.length) { + throw new MongooseError('Aggregate has empty pipeline'); + } + + prepareDiscriminatorPipeline(this._pipeline, this._model.schema); + + const preFilter = buildMiddlewareFilter(this.options, 'pre'); + const postFilter = buildMiddlewareFilter(this.options, 'post'); + + // Remove middleware option before passing to MongoDB + const { middleware, ...options } = this.options ?? {}; + + try { + await model.hooks.execPre('aggregate', this, [], { filter: preFilter }); + } catch (error) { + return await model.hooks.execPost('aggregate', this, [null], { error, filter: postFilter }); + } + + const cursor = await model.collection.aggregate(this._pipeline, options); + + if (verbosity == null) { + verbosity = true; + } + + let result = null; + try { + result = await cursor.explain(verbosity); + } catch (error) { + return await model.hooks.execPost('aggregate', this, [null], { error, filter: postFilter }); + } + + await model.hooks.execPost('aggregate', this, [result], { error: null, filter: postFilter }); + + return result; +}; + +/** + * Sets the allowDiskUse option for the aggregation query + * + * #### Example: + * + * await Model.aggregate([{ $match: { foo: 'bar' } }]).allowDiskUse(true); + * + * @param {boolean} value Should tell server it can use hard drive to store data during aggregation. + * @return {Aggregate} this + * @see mongodb https://www.mongodb.com/docs/manual/reference/command/aggregate/ + */ + +Aggregate.prototype.allowDiskUse = function(value) { + this.options.allowDiskUse = value; + return this; +}; + +/** + * Sets the hint option for the aggregation query + * + * #### Example: + * + * Model.aggregate(..).hint({ qty: 1, category: 1 }).exec(); + * + * @param {object|string} value a hint object or the index name + * @return {Aggregate} this + * @see mongodb https://www.mongodb.com/docs/manual/reference/command/aggregate/ + */ + +Aggregate.prototype.hint = function(value) { + this.options.hint = value; + return this; +}; + +/** + * Sets the session for this aggregation. Useful for [transactions](https://mongoosejs.com/docs/transactions.html). + * + * #### Example: + * + * const session = await Model.startSession(); + * await Model.aggregate(..).session(session); + * + * @param {ClientSession} session + * @return {Aggregate} this + * @see mongodb https://www.mongodb.com/docs/manual/reference/command/aggregate/ + */ + +Aggregate.prototype.session = function(session) { + if (session == null) { + delete this.options.session; + } else { + this.options.session = session; + } + return this; +}; + +/** + * Lets you set arbitrary options, for middleware or plugins. + * + * #### Example: + * + * const agg = Model.aggregate(..).option({ allowDiskUse: true }); // Set the `allowDiskUse` option + * agg.options; // `{ allowDiskUse: true }` + * + * @param {object} options keys to merge into current options + * @param {number} [options.maxTimeMS] number limits the time this aggregation will run, see [MongoDB docs on `maxTimeMS`](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) + * @param {boolean} [options.allowDiskUse] boolean if true, the MongoDB server will use the hard drive to store data during this aggregation + * @param {object} [options.collation] object see [`Aggregate.prototype.collation()`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.collation()) + * @param {ClientSession} [options.session] ClientSession see [`Aggregate.prototype.session()`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.session()) + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @see mongodb https://www.mongodb.com/docs/manual/reference/command/aggregate/ + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.option = function(value) { + for (const key in value) { + this.options[key] = value[key]; + } + return this; +}; + +/** + * Sets the `cursor` option and executes this aggregation, returning an aggregation cursor. + * Cursors are useful if you want to process the results of the aggregation one-at-a-time + * because the aggregation result is too big to fit into memory. + * Creating an aggregation cursor runs pre aggregate hooks, but not post aggregate hooks. + * To skip pre aggregate hooks, pass `middleware: false` to `.cursor()`. + * + * #### Example: + * + * const cursor = Model.aggregate(..).cursor({ batchSize: 1000 }); + * cursor.eachAsync(function(doc, i) { + * // use doc + * }); + * + * @param {object} options + * @param {number} [options.batchSize] set the cursor batch size + * @param {boolean|object} [options.middleware=true] set to `false` to skip user-defined pre aggregate middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip pre aggregate middleware + * @param {boolean} [options.useMongooseAggCursor] use experimental mongoose-specific aggregation cursor (for `eachAsync()` and other query cursor semantics) + * @return {AggregationCursor} cursor representing this aggregation + * @api public + * @see mongodb https://mongodb.github.io/node-mongodb-native/7.0/classes/AggregationCursor.html + */ + +Aggregate.prototype.cursor = function(options) { + this._optionsForExec(); + if (utils.hasUserDefinedProperty(options, 'middleware')) { + const { middleware, ...cursorOptions } = options; + this.options.middleware = middleware; + options = cursorOptions; + } + this.options.cursor = options || {}; + return new AggregationCursor(this); // return this; +}; + +/** + * Adds a collation + * + * #### Example: + * + * const res = await Model.aggregate(pipeline).collation({ locale: 'en_US', strength: 1 }); + * + * @param {object} collation options + * @return {Aggregate} this + * @api public + * @see mongodb https://mongodb.github.io/node-mongodb-native/7.0/interfaces/CollationOptions.html + */ + +Aggregate.prototype.collation = function(collation) { + this.options.collation = collation; + return this; +}; + +/** + * Combines multiple aggregation pipelines. + * + * #### Example: + * + * const res = await Model.aggregate().facet({ + * books: [{ groupBy: '$author' }], + * price: [{ $bucketAuto: { groupBy: '$price', buckets: 2 } }] + * }); + * + * // Output: { books: [...], price: [{...}, {...}] } + * + * @param {object} facet options + * @return {Aggregate} this + * @see $facet https://www.mongodb.com/docs/manual/reference/operator/aggregation/facet/ + * @api public + */ + +Aggregate.prototype.facet = function(options) { + return this.append({ $facet: options }); +}; + +/** + * Helper for [Atlas Text Search](https://www.mongodb.com/docs/atlas/atlas-search/tutorial/)'s + * `$search` stage. + * + * #### Example: + * + * const res = await Model.aggregate(). + * search({ + * text: { + * query: 'baseball', + * path: 'plot' + * } + * }); + * + * // Output: [{ plot: '...', title: '...' }] + * + * @param {object} $search options + * @return {Aggregate} this + * @see $search https://www.mongodb.com/docs/atlas/atlas-search/tutorial/ + * @api public + */ + +Aggregate.prototype.search = function(options) { + return this.append({ $search: options }); +}; + +/** + * Returns the current pipeline + * + * #### Example: + * + * MyModel.aggregate().match({ test: 1 }).pipeline(); // [{ $match: { test: 1 } }] + * + * @return {PipelineStage[]} The current pipeline similar to the operation that will be executed + * @api public + */ + +Aggregate.prototype.pipeline = function() { + return this._pipeline; +}; + +/** + * Returns the current pipeline as a `$unionWith`-safe pipeline. + * Throws if this pipeline contains `$out` or `$merge`. + * + * #### Example: + * + * const base = MyModel.aggregate().match({ test: 1 }); + * base.pipelineForUnionWith(); // [{ $match: { test: 1 } }] + * + * @return {PipelineStage[]} The current pipeline with `$unionWith` stage restrictions + * @api public + */ + +Aggregate.prototype.pipelineForUnionWith = function pipelineForUnionWith() { + for (const stage of this._pipeline) { + if (stage?.$out != null || stage?.$merge != null) { + throw new MongooseError('Aggregate pipeline for $unionWith cannot include `$out` or `$merge` stages'); + } + } + + return this._pipeline; +}; + +/** + * Executes the aggregate pipeline on the currently bound Model. + * + * #### Example: + * const result = await aggregate.exec(); + * + * @return {Promise} + * @api public + */ + +Aggregate.prototype.exec = async function exec() { + if (!this._model && !this._connection) { + throw new MongooseError('Aggregate not bound to any Model'); + } + if (typeof arguments[0] === 'function') { + throw new MongooseError('Aggregate.prototype.exec() no longer accepts a callback'); + } + + if (this._connection) { + if (!this._pipeline.length) { + throw new MongooseError('Aggregate has empty pipeline'); + } + + this._optionsForExec(); + + const _this = this; + return traceAggregate(async function maybeTracedConnectionAggregate() { + const cursor = await _this._connection.client.db().aggregate(_this._pipeline, _this.options); + return await cursor.toArray(); + }, () => ({ + operation: 'aggregate', + database: _this._connection.name, + serverAddress: _this._connection.host, + serverPort: _this._connection.port, + args: { + pipeline: _this._pipeline, + options: _this.options + } + })); + } + + const model = this._model; + const collection = this._model.collection; + + applyGlobalMaxTimeMS(this.options, model.db.options, model.base.options); + applyGlobalDiskUse(this.options, model.db.options, model.base.options); + + this._optionsForExec(); + + if (this.options?.cursor) { + return new AggregationCursor(this); + } + + prepareDiscriminatorPipeline(this._pipeline, this._model.schema); + stringifyFunctionOperators(this._pipeline); + + const _this = this; + return traceAggregate(async function maybeTracedAggregateExec() { + const preFilter = buildMiddlewareFilter(_this.options, 'pre'); + const postFilter = buildMiddlewareFilter(_this.options, 'post'); + + try { + await model.hooks.execPre('aggregate', _this, [], { filter: preFilter }); + } catch (error) { + return await model.hooks.execPost('aggregate', _this, [null], { error, filter: postFilter }); + } + + if (!_this._pipeline.length) { + throw new MongooseError('Aggregate has empty pipeline'); + } + + const { middleware, ...options } = clone(_this.options || {}); + + let result; + try { + const cursor = await collection.aggregate(_this._pipeline, options); + result = await cursor.toArray(); + } catch (error) { + return await model.hooks.execPost('aggregate', _this, [null], { error, filter: postFilter }); + } + + await model.hooks.execPost('aggregate', _this, [result], { error: null, filter: postFilter }); + return result; + }, () => ({ + operation: 'aggregate', + collection: collection.name, + database: model.db?.name, + serverAddress: model.db?.host, + serverPort: model.db?.port, + args: { + pipeline: _this._pipeline, + options: _this.options + } + })); +}; + +/** + * Provides a Promise-like `then` function, which will call `.exec` without a callback + * Compatible with `await`. + * + * #### Example: + * + * Model.aggregate(..).then(successCallback, errorCallback); + * + * @param {Function} [resolve] successCallback + * @param {Function} [reject] errorCallback + * @return {Promise} + */ +Aggregate.prototype.then = function(resolve, reject) { + return this.exec().then(resolve, reject); +}; + +/** + * Executes the aggregation returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like [`.then()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.then), but only takes a rejection handler. + * Compatible with `await`. + * + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Aggregate.prototype.catch = function(reject) { + return this.exec().then(null, reject); +}; + +/** + * Executes the aggregate returning a `Promise` which will be + * resolved with `.finally()` chained. + * + * More about [Promise `finally()` in JavaScript](https://thecodebarbarian.com/using-promise-finally-in-node-js.html). + * + * @param {Function} [onFinally] + * @return {Promise} + * @api public + */ + +Aggregate.prototype.finally = function(onFinally) { + return this.exec().finally(onFinally); +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js) + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example: + * + * const agg = Model.aggregate([{ $match: { age: { $gte: 25 } } }]); + * for await (const doc of agg) { + * console.log(doc.name); + * } + * + * @method [Symbol.asyncIterator] + * @memberOf Aggregate + * @instance + * @api public + */ + +Aggregate.prototype[Symbol.asyncIterator] = function() { + return this.cursor({ useMongooseAggCursor: true }).transformNull()._transformForAsyncIterator(); +}; + +/*! + * Helpers + */ + +/** + * Checks whether an object is likely a pipeline operator + * + * @param {object} obj object to check + * @return {boolean} + * @api private + */ + +function isOperator(obj) { + if (typeof obj !== 'object' || obj === null) { + return false; + } + + const k = Object.keys(obj); + + return k.length === 1 && k[0][0] === '$'; +} + +/** + * Adds the appropriate `$match` pipeline step to the top of an aggregate's + * pipeline, should it's model is a non-root discriminator type. This is + * analogous to the `prepareDiscriminatorCriteria` function in `lib/query.js`. + * + * @param {Aggregate} aggregate Aggregate to prepare + * @api private + */ + +Aggregate._prepareDiscriminatorPipeline = prepareDiscriminatorPipeline; + +/*! + * Exports + */ + +module.exports = Aggregate; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast.js new file mode 100644 index 00000000..aad9eac9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast.js @@ -0,0 +1,436 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('./error/cast'); +const StrictModeError = require('./error/strict'); +const Types = require('./schema/index'); +const cast$expr = require('./helpers/query/cast$expr'); +const castString = require('./cast/string'); +const castTextSearch = require('./schema/operators/text'); +const get = require('./helpers/get'); +const getSchemaDiscriminatorByValue = require('./helpers/discriminator/getSchemaDiscriminatorByValue'); +const isOperator = require('./helpers/query/isOperator'); +const util = require('util'); +const isObject = require('./helpers/isObject'); +const isMongooseObject = require('./helpers/isMongooseObject'); +const utils = require('./utils'); + +const ALLOWED_GEOWITHIN_GEOJSON_TYPES = ['Polygon', 'MultiPolygon']; + +/** + * Handles internal casting for query filters. + * + * @param {Schema} schema + * @param {object} obj Object to cast + * @param {object} [options] the query options + * @param {boolean|"throw"} [options.strict] Whether to enable all strict options + * @param {boolean|"throw"} [options.strictQuery] Enable strict Queries + * @param {boolean} [options.sanitizeFilter] avoid adding implicit query selectors ($in) + * @param {boolean} [options.upsert] + * @param {Query} [context] passed to setters + * @api private + */ +module.exports = function cast(schema, obj, options, context) { + if (Array.isArray(obj)) { + throw new Error('Query filter must be an object, got an array ' + util.inspect(obj)); + } + + if (obj == null) { + return obj; + } + + if (schema?.discriminators != null && obj[schema.options.discriminatorKey] != null) { + schema = getSchemaDiscriminatorByValue(schema, obj[schema.options.discriminatorKey]) || schema; + } + + const paths = Object.keys(obj); + let i = paths.length; + let _keys; + let any$conditionals; + let schematype; + let nested; + let path; + let type; + let val; + + options = options || {}; + + while (i--) { + path = paths[i]; + val = obj[path]; + + if (path === '$or' || path === '$nor' || path === '$and') { + if (!Array.isArray(val)) { + throw new CastError('Array', val, path); + } + for (let k = val.length - 1; k >= 0; k--) { + if (val[k] == null || typeof val[k] !== 'object') { + throw new CastError('Object', val[k], path + '.' + k); + } + const beforeCastKeysLength = Object.keys(val[k]).length; + const discriminatorValue = val[k][schema.options.discriminatorKey]; + if (discriminatorValue == null) { + val[k] = cast(schema, val[k], options, context); + } else { + const discriminatorSchema = getSchemaDiscriminatorByValue(context.schema, discriminatorValue); + val[k] = cast(discriminatorSchema ? discriminatorSchema : schema, val[k], options, context); + } + + if (utils.hasOwnKeys(val[k]) === false && beforeCastKeysLength !== 0) { + val.splice(k, 1); + } + } + + // delete empty: {$or: []} -> {} + if (val.length === 0) { + delete obj[path]; + } + } else if (path === '$where') { + type = typeof val; + + if (type !== 'string' && type !== 'function') { + throw new Error('Must have a string or function for $where'); + } + + if (type === 'function') { + obj[path] = val.toString(); + } + + continue; + } else if (path === '$expr') { + val = cast$expr(val, schema); + continue; + } else if (path === '$elemMatch') { + val = cast(schema, val, options, context); + } else if (path === '$text') { + val = castTextSearch(val, path); + } else if (path === '$comment' && !Object.hasOwn(schema.paths, '$comment')) { + val = castString(val, path); + obj[path] = val; + } else { + if (!schema) { + // no casting for Mixed types + continue; + } + + schematype = schema.path(path); + + // Check for embedded discriminator paths + if (!schematype) { + const split = path.split('.'); + let j = split.length; + while (j--) { + const pathFirstHalf = split.slice(0, j).join('.'); + const pathLastHalf = split.slice(j).join('.'); + const _schematype = schema.path(pathFirstHalf); + const discriminatorKey = _schematype?.schema?.options?.discriminatorKey; + + // gh-6027: if we haven't found the schematype but this path is + // underneath an embedded discriminator and the embedded discriminator + // key is in the query, use the embedded discriminator schema + if (_schematype?.schema?.discriminators != null && + discriminatorKey != null && + pathLastHalf !== discriminatorKey) { + const discriminatorVal = get(obj, pathFirstHalf + '.' + discriminatorKey); + const discriminators = _schematype.schema.discriminators; + if (typeof discriminatorVal === 'string' && discriminators[discriminatorVal] != null) { + + schematype = discriminators[discriminatorVal].path(pathLastHalf); + } else if (discriminatorVal != null && + Object.keys(discriminatorVal).length === 1 && + Array.isArray(discriminatorVal.$in) && + discriminatorVal.$in.length === 1 && + typeof discriminatorVal.$in[0] === 'string' && + discriminators[discriminatorVal.$in[0]] != null) { + schematype = discriminators[discriminatorVal.$in[0]].path(pathLastHalf); + } + } + } + } + + if (!schematype) { + // Handle potential embedded array queries + const split = path.split('.'); + let j = split.length; + let pathFirstHalf; + let pathLastHalf; + let remainingConds; + + // Find the part of the var path that is a path of the Schema + while (j--) { + pathFirstHalf = split.slice(0, j).join('.'); + schematype = schema.path(pathFirstHalf); + if (schematype) { + break; + } + } + + // If a substring of the input path resolves to an actual real path... + if (schematype) { + // Apply the casting; similar code for $elemMatch in schema/array.js + if (schematype.schema) { + remainingConds = {}; + pathLastHalf = split.slice(j).join('.'); + remainingConds[pathLastHalf] = val; + + const ret = cast(schematype.schema, remainingConds, options, context)[pathLastHalf]; + if (ret === void 0) { + delete obj[path]; + } else { + obj[path] = ret; + } + } else { + obj[path] = val; + } + continue; + } + + if (isObject(val)) { + // handle geo schemas that use object notation + // { loc: { long: Number, lat: Number } + + let geo = ''; + if (val.$near) { + geo = '$near'; + } else if (val.$nearSphere) { + geo = '$nearSphere'; + } else if (val.$within) { + geo = '$within'; + } else if (val.$geoIntersects) { + geo = '$geoIntersects'; + } else if (val.$geoWithin) { + geo = '$geoWithin'; + } + + if (geo) { + const numbertype = new Types.Number('__QueryCasting__', null, null, schema); + let value = val[geo]; + + if (val.$maxDistance != null) { + val.$maxDistance = numbertype.castForQuery( + null, + val.$maxDistance, + context + ); + } + if (val.$minDistance != null) { + val.$minDistance = numbertype.castForQuery( + null, + val.$minDistance, + context + ); + } + + if (geo === '$within') { + const withinType = value.$center + || value.$centerSphere + || value.$box + || value.$polygon; + + if (!withinType) { + throw new Error('Bad $within parameter: ' + JSON.stringify(val)); + } + + value = withinType; + } else if (geo === '$near' && + typeof value.type === 'string' && Array.isArray(value.coordinates)) { + // geojson; cast the coordinates + value = value.coordinates; + } else if ((geo === '$near' || geo === '$nearSphere' || geo === '$geoIntersects') && + value.$geometry && typeof value.$geometry.type === 'string' && + Array.isArray(value.$geometry.coordinates)) { + if (value.$maxDistance != null) { + value.$maxDistance = numbertype.castForQuery( + null, + value.$maxDistance, + context + ); + } + if (value.$minDistance != null) { + value.$minDistance = numbertype.castForQuery( + null, + value.$minDistance, + context + ); + } + if (isMongooseObject(value.$geometry)) { + value.$geometry = value.$geometry.toObject({ + transform: false, + virtuals: false + }); + } + value = value.$geometry.coordinates; + } else if (geo === '$geoWithin') { + if (value.$geometry) { + if (isMongooseObject(value.$geometry)) { + value.$geometry = value.$geometry.toObject({ virtuals: false }); + } + const geoWithinType = value.$geometry.type; + if (ALLOWED_GEOWITHIN_GEOJSON_TYPES.indexOf(geoWithinType) === -1) { + throw new Error('Invalid geoJSON type for $geoWithin "' + + geoWithinType + '", must be "Polygon" or "MultiPolygon"'); + } + value = value.$geometry.coordinates; + } else { + value = value.$box || value.$polygon || value.$center || + value.$centerSphere; + if (isMongooseObject(value)) { + value = value.toObject({ virtuals: false }); + } + } + } + + _cast(value, numbertype, context); + continue; + } + } + + if (schema.nested[path]) { + continue; + } + + const strict = 'strict' in options ? options.strict : schema.options.strict; + const strictQuery = getStrictQuery(options, schema._userProvidedOptions, schema.options, context); + if (options.upsert && strict) { + if (strict === 'throw') { + throw new StrictModeError(path); + } + throw new StrictModeError(path, 'Path "' + path + '" is not in ' + + 'schema, strict mode is `true`, and upsert is `true`.'); + } if (strictQuery === 'throw') { + throw new StrictModeError(path, 'Path "' + path + '" is not in ' + + 'schema and strictQuery is \'throw\'.'); + } else if (strictQuery) { + delete obj[path]; + } + } else if (val == null) { + continue; + } else if (utils.isPOJO(val)) { + any$conditionals = Object.keys(val).some(isOperator); + + if (!any$conditionals) { + obj[path] = schematype.castForQuery( + null, + val, + context + ); + } else { + const ks = Object.keys(val); + let $cond; + let k = ks.length; + + while (k--) { + $cond = ks[k]; + nested = val[$cond]; + if ($cond === '$elemMatch') { + if (nested && schematype?.schema != null) { + cast(schematype.schema, nested, options, context); + } else if (nested && schematype?.$isMongooseArray) { + if (utils.isPOJO(nested) && nested.$not != null) { + cast(schema, nested, options, context); + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + context + ); + } + } + } else if ($cond === '$not') { + if (nested && schematype) { + _keys = Object.keys(nested); + if (_keys.length && isOperator(_keys[0])) { + for (const key in nested) { + nested[key] = schematype.castForQuery( + key, + nested[key], + context + ); + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + context + ); + } + continue; + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + context + ); + } + + } + } + } else if (Array.isArray(val) && ['Buffer', 'Array'].indexOf(schematype.instance) === -1 && !options.sanitizeFilter) { + const casted = []; + const valuesArray = val; + + for (const _val of valuesArray) { + casted.push(schematype.castForQuery( + null, + _val, + context + )); + } + + obj[path] = { $in: casted }; + } else { + obj[path] = schematype.castForQuery( + null, + val, + context + ); + } + } + } + + return obj; +}; + +function _cast(val, numbertype, context) { + if (Array.isArray(val)) { + val.forEach(function(item, i) { + if (Array.isArray(item) || isObject(item)) { + return _cast(item, numbertype, context); + } + val[i] = numbertype.castForQuery(null, item, context); + }); + } else { + const nearKeys = Object.keys(val); + let nearLen = nearKeys.length; + while (nearLen--) { + const nkey = nearKeys[nearLen]; + const item = val[nkey]; + if (Array.isArray(item) || isObject(item)) { + _cast(item, numbertype, context); + val[nkey] = item; + } else { + val[nkey] = numbertype.castForQuery(null, item, context); + } + } + } +} + +function getStrictQuery(queryOptions, schemaUserProvidedOptions, schemaOptions, context) { + if ('strictQuery' in queryOptions) { + return queryOptions.strictQuery; + } + if ('strictQuery' in schemaUserProvidedOptions) { + return schemaUserProvidedOptions.strictQuery; + } + const mongooseOptions = context?.mongooseCollection?.conn?.base?.options; + if (mongooseOptions) { + if ('strictQuery' in mongooseOptions) { + return mongooseOptions.strictQuery; + } + } + return schemaOptions.strictQuery; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/bigint.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/bigint.js new file mode 100644 index 00000000..f0649d11 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/bigint.js @@ -0,0 +1,46 @@ +'use strict'; + +const { Long } = require('mongodb/lib/bson'); + +/** + * Given a value, cast it to a BigInt, or throw an `Error` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {any} value + * @return {bigint|null|undefined} + * @throws {Error} if `value` is not one of the allowed values + * @api private + */ + +const MAX_BIGINT = 9223372036854775807n; +const MIN_BIGINT = -9223372036854775808n; +const ERROR_MESSAGE = `Mongoose only supports BigInts between ${MIN_BIGINT} and ${MAX_BIGINT} because MongoDB does not support arbitrary precision integers`; + +module.exports = function castBigInt(val) { + if (val == null) { + return val; + } + if (val === '') { + return null; + } + if (typeof val === 'bigint') { + if (val > MAX_BIGINT || val < MIN_BIGINT) { + throw new Error(ERROR_MESSAGE); + } + return val; + } + + if (val instanceof Long) { + return val.toBigInt(); + } + + if (typeof val === 'string' || typeof val === 'number') { + val = BigInt(val); + if (val > MAX_BIGINT || val < MIN_BIGINT) { + throw new Error(ERROR_MESSAGE); + } + return val; + } + + throw new Error(`Cannot convert value to BigInt: "${val}"`); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/boolean.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/boolean.js new file mode 100644 index 00000000..557d5a97 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/boolean.js @@ -0,0 +1,32 @@ +'use strict'; + +const CastError = require('../error/cast'); + +/** + * Given a value, cast it to a boolean, or throw a `CastError` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {any} value + * @param {string} [path] optional the path to set on the CastError + * @return {boolean|null|undefined} + * @throws {CastError} if `value` is not one of the allowed values + * @api private + */ + +module.exports = function castBoolean(value, path) { + if (module.exports.convertToTrue.has(value)) { + return true; + } + if (module.exports.convertToFalse.has(value)) { + return false; + } + + if (value == null) { + return value; + } + + throw new CastError('boolean', value, path); +}; + +module.exports.convertToTrue = new Set([true, 'true', 1, '1', 'yes']); +module.exports.convertToFalse = new Set([false, 'false', 0, '0', 'no']); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/date.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/date.js new file mode 100644 index 00000000..c7f9b048 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/date.js @@ -0,0 +1,41 @@ +'use strict'; + +const assert = require('assert'); + +module.exports = function castDate(value) { + // Support empty string because of empty form values. Originally introduced + // in https://github.com/Automattic/mongoose/commit/efc72a1898fc3c33a319d915b8c5463a22938dfe + if (value == null || value === '') { + return null; + } + + if (value instanceof Date) { + assert.ok(!isNaN(value.valueOf())); + + return value; + } + + let date; + + assert.ok(typeof value !== 'boolean'); + + if (value instanceof Number || typeof value === 'number') { + date = new Date(value); + } else if (typeof value === 'string' && !isNaN(Number(value)) && (Number(value) >= 275761 || Number(value) < -271820)) { + // string representation of milliseconds take this path + date = new Date(Number(value)); + } else if (typeof value.valueOf === 'function') { + // support for moment.js. This is also the path strings will take because + // strings have a `valueOf()` + date = new Date(value.valueOf()); + } else { + // fallback + date = new Date(value); + } + + if (!isNaN(date.valueOf())) { + return date; + } + + assert.ok(false); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/decimal128.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/decimal128.js new file mode 100644 index 00000000..2bec9975 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/decimal128.js @@ -0,0 +1,39 @@ +'use strict'; + +const Decimal128Type = require('../types/decimal128'); +const assert = require('assert'); + +module.exports = function castDecimal128(value) { + if (value == null) { + return value; + } + + if (typeof value === 'object' && typeof value.$numberDecimal === 'string') { + return Decimal128Type.fromString(value.$numberDecimal); + } + + if (value instanceof Decimal128Type) { + return value; + } + + if (typeof value === 'string') { + return Decimal128Type.fromString(value); + } + + if (typeof Buffer === 'function' && Buffer.isBuffer(value)) { + return new Decimal128Type(value); + } + if (typeof Uint8Array === 'function' && value instanceof Uint8Array) { + return new Decimal128Type(value); + } + + if (typeof value === 'number') { + return Decimal128Type.fromString(String(value)); + } + + if (typeof value.valueOf === 'function' && typeof value.valueOf() === 'string') { + return Decimal128Type.fromString(value.valueOf()); + } + + assert.ok(false); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/double.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/double.js new file mode 100644 index 00000000..00f83faa --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/double.js @@ -0,0 +1,56 @@ +'use strict'; + +const assert = require('assert'); +const BSON = require('mongodb/lib/bson'); +const isBsonType = require('../helpers/isBsonType'); + +/** + * Given a value, cast it to a IEEE 754-2008 floating point, or throw an `Error` if the value + * cannot be casted. `null`, `undefined`, and `NaN` are considered valid inputs. + * + * @param {any} value + * @return {number} + * @throws {Error} if `value` does not represent a IEEE 754-2008 floating point. If casting from a string, see [BSON Double.fromString API documentation](https://mongodb.github.io/node-mongodb-native/Next/classes/BSON.Double.html#fromString) + * @api private + */ + +module.exports = function castDouble(val) { + if (val == null || val === '') { + return null; + } + + let coercedVal; + if (isBsonType(val, 'Long')) { + coercedVal = val.toNumber(); + } else if (typeof val === 'string') { + try { + coercedVal = BSON.Double.fromString(val); + return coercedVal; + } catch { + assert.ok(false); + } + } else if (typeof val === 'object') { + if (Array.isArray(val)) { + // `[5].valueOf()` returns the array itself, so without this guard a + // single-element or empty array would fall through to `Number(tempVal)` + // below and silently coerce instead of throwing. + assert.ok(false); + } + const tempVal = val.valueOf() ?? val.toString(); + // ex: { a: 'im an object, valueOf: () => 'helloworld' } // throw an error + if (typeof tempVal === 'string') { + try { + coercedVal = BSON.Double.fromString(tempVal); + return coercedVal; + } catch { + assert.ok(false); + } + } else { + coercedVal = Number(tempVal); + } + } else { + coercedVal = Number(val); + } + + return new BSON.Double(coercedVal); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/int32.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/int32.js new file mode 100644 index 00000000..f06c0ad3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/int32.js @@ -0,0 +1,42 @@ +'use strict'; + +const isBsonType = require('../helpers/isBsonType'); +const assert = require('assert'); + +/** + * Given a value, cast it to a Int32, or throw an `Error` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {any} value + * @return {number} + * @throws {Error} if `value` does not represent an integer, or is outside the bounds of an 32-bit integer. + * @api private + */ + +module.exports = function castInt32(val) { + if (val == null) { + return val; + } + if (val === '') { + return null; + } + if (Array.isArray(val)) { + // `Number([5])` is `5` and `Number([])` is `0`, so without this guard a + // single-element or empty array would silently coerce instead of throwing, + // unlike every other array input and unlike `castNumber()`'s own guard. + assert.ok(false); + } + + const coercedVal = isBsonType(val, 'Long') ? val.toNumber() : Number(val); + + const INT32_MAX = 0x7FFFFFFF; + const INT32_MIN = -0x80000000; + + if (coercedVal === (coercedVal | 0) && + coercedVal >= INT32_MIN && + coercedVal <= INT32_MAX + ) { + return coercedVal; + } + assert.ok(false); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/number.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/number.js new file mode 100644 index 00000000..2c1e3f34 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/number.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * Given a value, cast it to a number, or throw an `Error` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {any} value + * @return {number} + * @throws {Error} if `value` is not one of the allowed values + * @api private + */ + +module.exports = function castNumber(val) { + if (val == null) { + return val; + } + if (val === '') { + return null; + } + + if (typeof val === 'string' || typeof val === 'boolean') { + val = Number(val); + } + + if (isNaN(val)) { + throw new Error('Cast to Number failed: value is not a valid number'); + } + if (val instanceof Number) { + return val.valueOf(); + } + if (typeof val === 'number') { + return val; + } + if (!Array.isArray(val) && typeof val.valueOf === 'function') { + return Number(val.valueOf()); + } + if (val.toString && !Array.isArray(val) && val.toString() == Number(val)) { + return Number(val); + } + + throw new Error('Cast to Number failed: value is not a valid number'); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/objectid.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/objectid.js new file mode 100644 index 00000000..095a0a10 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/objectid.js @@ -0,0 +1,29 @@ +'use strict'; + +const isBsonType = require('../helpers/isBsonType'); +const ObjectId = require('../types/objectid'); + +module.exports = function castObjectId(value) { + if (value == null) { + return value; + } + + if (isBsonType(value, 'ObjectId')) { + return value; + } + + if (value._id) { + if (isBsonType(value._id, 'ObjectId')) { + return value._id; + } + if (value._id.toString instanceof Function) { + return new ObjectId(value._id.toString()); + } + } + + if (value.toString instanceof Function) { + return new ObjectId(value.toString()); + } + + return new ObjectId(value); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/string.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/string.js new file mode 100644 index 00000000..e5198b91 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/string.js @@ -0,0 +1,37 @@ +'use strict'; + +const CastError = require('../error/cast'); + +/** + * Given a value, cast it to a string, or throw a `CastError` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {any} value + * @param {string} [path] optional the path to set on the CastError + * @return {string|null|undefined} + * @throws {CastError} + * @api private + */ + +module.exports = function castString(value, path) { + // If null or undefined + if (value == null) { + return value; + } + + // handle documents being passed + if (typeof value?._id === 'string') { + return value._id; + } + + // Re: gh-647 and gh-3030, we're ok with casting using `toString()` + // **unless** its the default Object.toString, because "[object Object]" + // doesn't really qualify as useful data + if (value.toString && + value.toString !== Object.prototype.toString && + !Array.isArray(value)) { + return value.toString(); + } + + throw new CastError('string', value, path); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/uuid.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/uuid.js new file mode 100644 index 00000000..05b867c9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cast/uuid.js @@ -0,0 +1,35 @@ +'use strict'; + +const UUID = require('mongodb/lib/bson').UUID; + +const UUID_FORMAT = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i; + +module.exports = function castUUID(value) { + if (value == null) { + return value; + } + + if (value instanceof UUID) { + return value; + } + if (typeof value === 'string') { + if (UUID_FORMAT.test(value)) { + return new UUID(value); + } else { + throw new Error(`"${value}" is not a valid UUID string`); + } + } + + // Re: gh-647 and gh-3030, we're ok with casting using `toString()` + // **unless** its the default Object.toString, because "[object Object]" + // doesn't really qualify as useful data + if (value.toString && value.toString !== Object.prototype.toString) { + if (UUID_FORMAT.test(value.toString())) { + return new UUID(value.toString()); + } + } + + throw new Error(`"${value}" cannot be casted to a UUID`); +}; + +module.exports.UUID_FORMAT = UUID_FORMAT; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/collection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/collection.js new file mode 100644 index 00000000..2506e14e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/collection.js @@ -0,0 +1,321 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EventEmitter = require('events').EventEmitter; +const STATES = require('./connectionState'); +const immediate = require('./helpers/immediate'); + +/** + * Abstract Collection constructor + * + * This is the base class that drivers inherit from and implement. + * + * @param {string} name name of the collection + * @param {Connection} conn A MongooseConnection instance + * @param {object} [opts] optional collection options + * @api public + */ + +function Collection(name, conn, opts) { + if (opts === void 0) { + opts = {}; + } + + this.opts = opts; + this.name = name; + this.collectionName = name; + this.conn = conn; + this.queue = []; + this.buffer = !conn?._hasOpened; + this.emitter = new EventEmitter(); + + if (STATES.connected === this.conn.readyState) { + this.onOpen(); + } +} + +/** + * The collection name + * + * @api public + * @property name + */ + +Collection.prototype.name; + +/** + * The collection name + * + * @api public + * @property collectionName + */ + +Collection.prototype.collectionName; + +/** + * The Connection instance + * + * @api public + * @property conn + */ + +Collection.prototype.conn; + +/** + * Called when the database connects + * + * @api private + */ + +Collection.prototype.onOpen = function() { + this.buffer = false; + immediate(() => this.doQueue()); +}; + +/** + * Called when the database disconnects + * + * @api private + */ + +Collection.prototype.onClose = function() {}; + +/** + * Queues a method for later execution when its + * database connection opens. + * + * @param {string} name name of the method to queue + * @param {Array} args arguments to pass to the method when executed + * @api private + */ + +Collection.prototype.addQueue = function(name, args) { + this.queue.push([name, args]); + return this; +}; + +/** + * Removes a queued method + * + * @param {string} name name of the method to queue + * @param {Array} args arguments to pass to the method when executed + * @api private + */ + +Collection.prototype.removeQueue = function(name, args) { + const index = this.queue.findIndex(v => v[0] === name && v[1] === args); + if (index === -1) { + return false; + } + this.queue.splice(index, 1); + return true; +}; + +/** + * Executes all queued methods and clears the queue. + * + * @api private + */ + +Collection.prototype.doQueue = function() { + for (const method of this.queue) { + if (typeof method[0] === 'function') { + method[0].apply(this, method[1]); + } else { + this[method[0]].apply(this, method[1]); + } + } + this.queue = []; + const _this = this; + immediate(function() { + _this.emitter.emit('queue'); + }); + return this; +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.ensureIndex = function() { + throw new Error('Collection#ensureIndex unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.createIndex = function() { + throw new Error('Collection#createIndex unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findAndModify = function() { + throw new Error('Collection#findAndModify unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOneAndUpdate = function() { + throw new Error('Collection#findOneAndUpdate unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOneAndDelete = function() { + throw new Error('Collection#findOneAndDelete unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOneAndReplace = function() { + throw new Error('Collection#findOneAndReplace unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOne = function() { + throw new Error('Collection#findOne unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.find = function() { + throw new Error('Collection#find unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.insert = function() { + throw new Error('Collection#insert unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.insertOne = function() { + throw new Error('Collection#insertOne unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.insertMany = function() { + throw new Error('Collection#insertMany unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.save = function() { + throw new Error('Collection#save unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.updateOne = function() { + throw new Error('Collection#updateOne unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.updateMany = function() { + throw new Error('Collection#updateMany unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.deleteOne = function() { + throw new Error('Collection#deleteOne unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.deleteMany = function() { + throw new Error('Collection#deleteMany unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.getIndexes = function() { + throw new Error('Collection#getIndexes unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.watch = function() { + throw new Error('Collection#watch unimplemented by driver'); +}; + +/*! + * ignore + */ + +Collection.prototype._shouldBufferCommands = function _shouldBufferCommands() { + const opts = this.opts; + + if (opts.bufferCommands != null) { + return opts.bufferCommands; + } + if (opts?.schemaUserProvidedOptions?.bufferCommands != null) { + return opts.schemaUserProvidedOptions.bufferCommands; + } + + return this.conn._shouldBufferCommands(); +}; + +/*! + * ignore + */ + +Collection.prototype._getBufferTimeoutMS = function _getBufferTimeoutMS() { + const conn = this.conn; + const opts = this.opts; + + if (opts.bufferTimeoutMS != null) { + return opts.bufferTimeoutMS; + } + if (opts?.schemaUserProvidedOptions?.bufferTimeoutMS != null) { + return opts.schemaUserProvidedOptions.bufferTimeoutMS; + } + return conn._getBufferTimeoutMS(); +}; + +/*! + * Module exports. + */ + +module.exports = Collection; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connection.js new file mode 100644 index 00000000..47158e3d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connection.js @@ -0,0 +1,1848 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ChangeStream = require('./cursor/changeStream'); +const EventEmitter = require('events').EventEmitter; +const Schema = require('./schema'); +const STATES = require('./connectionState'); +const MongooseBulkWriteError = require('./error/bulkWriteError'); +const MongooseError = require('./error/index'); +const ServerSelectionError = require('./error/serverSelection'); +const SyncIndexesError = require('./error/syncIndexes'); +const applyPlugins = require('./helpers/schema/applyPlugins'); +const clone = require('./helpers/clone'); +const driver = require('./driver'); +const get = require('./helpers/get'); +const getDefaultBulkwriteResult = require('./helpers/getDefaultBulkwriteResult'); +const immediate = require('./helpers/immediate'); +const utils = require('./utils'); +const CreateCollectionsError = require('./error/createCollectionsError'); +const castBulkWrite = require('./helpers/model/castBulkWrite'); +const { modelSymbol } = require('./helpers/symbols'); +const isPromise = require('./helpers/isPromise'); +const decorateBulkWriteResult = require('./helpers/model/decorateBulkWriteResult'); + +const arrayAtomicsSymbol = require('./helpers/symbols').arrayAtomicsSymbol; +const sessionNewDocuments = require('./helpers/symbols').sessionNewDocuments; + +// Snapshot the native Date constructor to ensure both Date.now() and new Date() (and other Date methods) +// bypass timer mocks such as those set up by useFakeTimers(). +const Date = globalThis.Date; + +/** + * A list of authentication mechanisms that don't require a password for authentication. + * This is used by the authMechanismDoesNotRequirePassword method. + * + * @api private + */ +const noPasswordAuthMechanisms = [ + 'MONGODB-X509' +]; + +/** + * Connection constructor + * + * For practical reasons, a Connection equals a Db. + * + * @param {Mongoose} base a mongoose instance + * @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#class-eventemitter + * @event `connecting`: Emitted when `connection.openUri()` is executed on this connection. + * @event `connected`: Emitted when this connection successfully connects to the db. May be emitted _multiple_ times in `reconnected` scenarios. + * @event `open`: Emitted after we `connected` and `onOpen` is executed on all of this connection's models. + * @event `disconnecting`: Emitted when `connection.close()` was executed. + * @event `disconnected`: Emitted after getting disconnected from the db. + * @event `close`: Emitted after we `disconnected` and `onClose` executed on all of this connection's models. + * @event `reconnected`: Emitted after we `connected` and subsequently `disconnected`, followed by successfully another successful connection. + * @event `error`: Emitted when an error occurs on this connection. + * @event `operation-start`: Emitted when a call to the MongoDB Node.js driver, like a `find()` or `insertOne()`, happens on any collection tied to this connection. + * @event `operation-end`: Emitted when a call to the MongoDB Node.js driver, like a `find()` or `insertOne()`, either succeeds or errors. + * @api public + */ + +function Connection(base) { + this.base = base; + this.collections = {}; + this.models = {}; + this.config = {}; + this.replica = false; + this.options = null; + this.otherDbs = []; // FIXME: To be replaced with relatedDbs + this.relatedDbs = {}; // Hashmap of other dbs that share underlying connection + this.states = STATES; + this._readyState = STATES.disconnected; + this._closeCalled = false; + this._hasOpened = false; + this.plugins = []; + if (typeof base === 'undefined' || !base.connections.length) { + this.id = 0; + } else { + this.id = base.nextConnectionId; + } + + // Internal queue of objects `{ fn, ctx, args }` that Mongoose calls when this connection is successfully + // opened. In `onOpen()`, Mongoose calls every entry in `_queue` and empties the queue. + this._queue = []; +} + +/*! + * Inherit from EventEmitter + */ + +Object.setPrototypeOf(Connection.prototype, EventEmitter.prototype); + +/** + * Connection ready state + * + * - 0 = disconnected + * - 1 = connected + * - 2 = connecting + * - 3 = disconnecting + * + * Each state change emits its associated event name. + * + * #### Example: + * + * conn.on('connected', callback); + * conn.on('disconnected', callback); + * + * @property readyState + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'readyState', { + get: function() { + // If connection thinks it is connected, but we haven't received a heartbeat in 2 heartbeat intervals, + // that likely means the connection is stale (potentially due to frozen AWS Lambda container) + if ( + this._readyState === STATES.connected && + this._lastHeartbeatAt != null && + // LoadBalanced topology (behind haproxy, including Atlas serverless instances) don't use heartbeats, + // so we can't use this check in that case. + this.client?.topology?.s?.description?.type !== 'LoadBalanced' && + typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS === 'number' && + Date.now() - this._lastHeartbeatAt >= this.client.topology.s.description.heartbeatFrequencyMS * 2) { + return STATES.disconnected; + } + return this._readyState; + }, + set: function(val) { + if (!(val in STATES)) { + throw new MongooseError('Invalid connection state: ' + val); + } + + if (this._readyState !== val) { + this._readyState = val; + // [legacy] loop over the otherDbs on this connection and change their state + for (const db of this.otherDbs) { + db.readyState = val; + } + + if (STATES.connected === val) { + this._hasOpened = true; + } + + this.emit(STATES[val]); + } + } +}); + +/** + * Gets the value of the option `key`. Equivalent to `conn.options[key]` + * + * #### Example: + * + * conn.get('test'); // returns the 'test' value + * + * @param {string} key + * @method get + * @api public + */ + +Connection.prototype.get = function getOption(key) { + if (Object.hasOwn(this.config, key)) { + return this.config[key]; + } + + return get(this.options, key); +}; + +/** + * Sets the value of the option `key`. Equivalent to `conn.options[key] = val` + * + * Supported options include: + * + * - `maxTimeMS`: Set [`maxTimeMS`](https://mongoosejs.com/docs/api/query.html#Query.prototype.maxTimeMS()) for all queries on this connection. + * - 'debug': If `true`, prints the operations mongoose sends to MongoDB to the console. If a writable stream is passed, it will log to that stream, without colorization. If a callback function is passed, it will receive the collection name, the method name, then all arguments passed to the method. For example, if you wanted to replicate the default logging, you could output from the callback `Mongoose: ${collectionName}.${methodName}(${methodArgs.join(', ')})`. + * + * #### Example: + * + * conn.set('test', 'foo'); + * conn.get('test'); // 'foo' + * conn.options.test; // 'foo' + * + * @param {string} key + * @param {any} val + * @method set + * @api public + */ + +Connection.prototype.set = function setOption(key, val) { + if (Object.hasOwn(this.config, key)) { + this.config[key] = val; + return val; + } + + this.options = this.options || {}; + this.options[key] = val; + return val; +}; + +/** + * A hash of the collections associated with this connection + * + * @property collections + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.collections; + +/** + * The name of the database this connection points to. + * + * #### Example: + * + * mongoose.createConnection('mongodb://127.0.0.1:27017/mydb').name; // "mydb" + * + * @property name + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.name; + +/** + * A [POJO](https://masteringjs.io/tutorials/fundamentals/pojo) containing + * a map from model names to models. Contains all models that have been + * added to this connection using [`Connection#model()`](https://mongoosejs.com/docs/api/connection.html#Connection.prototype.model()). + * + * #### Example: + * + * const conn = mongoose.createConnection(); + * const Test = conn.model('Test', mongoose.Schema({ name: String })); + * + * Object.keys(conn.models).length; // 1 + * conn.models.Test === Test; // true + * + * @property models + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.models; + +/** + * A number identifier for this connection. Used for debugging when + * you have [multiple connections](https://mongoosejs.com/docs/connections.html#multiple_connections). + * + * #### Example: + * + * // The default connection has `id = 0` + * mongoose.connection.id; // 0 + * + * // If you create a new connection, Mongoose increments id + * const conn = mongoose.createConnection(); + * conn.id; // 1 + * + * @property id + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.id; + +/** + * The plugins that will be applied to all models created on this connection. + * + * #### Example: + * + * const db = mongoose.createConnection('mongodb://127.0.0.1:27017/mydb'); + * db.plugin(() => console.log('Applied')); + * db.plugins.length; // 1 + * + * db.model('Test', new Schema({})); // Prints "Applied" + * + * @property plugins + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'plugins', { + configurable: false, + enumerable: true, + writable: true +}); + +/** + * The host name portion of the URI. If multiple hosts, such as a replica set, + * this will contain the first host name in the URI + * + * #### Example: + * + * mongoose.createConnection('mongodb://127.0.0.1:27017/mydb').host; // "127.0.0.1" + * + * @property host + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'host', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The port portion of the URI. If multiple hosts, such as a replica set, + * this will contain the port from the first host name in the URI. + * + * #### Example: + * + * mongoose.createConnection('mongodb://127.0.0.1:27017/mydb').port; // 27017 + * + * @property port + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'port', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The username specified in the URI + * + * #### Example: + * + * mongoose.createConnection('mongodb://val:psw@127.0.0.1:27017/mydb').user; // "val" + * + * @property user + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'user', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The password specified in the URI + * + * #### Example: + * + * mongoose.createConnection('mongodb://val:psw@127.0.0.1:27017/mydb').pass; // "psw" + * + * @property pass + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'pass', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The mongodb.Db instance, set when the connection is opened + * + * @property db + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.db; + +/** + * The MongoClient instance this connection uses to talk to MongoDB. Mongoose automatically sets this property + * when the connection is opened. + * + * @property client + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.client; + +/** + * A hash of the global options that are associated with this connection + * + * @property config + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.config; + +/** + * Helper for `createCollection()`. Will explicitly create the given collection + * with specified options. Used to create [capped collections](https://www.mongodb.com/docs/manual/core/capped-collections/) + * and [views](https://www.mongodb.com/docs/manual/core/views/) from mongoose. + * + * Options are passed down without modification to the [MongoDB driver's `createCollection()` function](https://mongodb.github.io/node-mongodb-native/7.0/classes/Db.html#createCollection) + * + * @method createCollection + * @param {string} collection The collection to create + * @param {object} [options] see [MongoDB driver docs](https://mongodb.github.io/node-mongodb-native/7.0/classes/Db.html#createCollection) + * @return {Promise} + * @api public + */ + +Connection.prototype.createCollection = async function createCollection(collection, options) { + if (typeof options === 'function' || (arguments.length >= 3 && typeof arguments[2] === 'function')) { + throw new MongooseError('Connection.prototype.createCollection() no longer accepts a callback'); + } + + await this._waitForConnect(); + + return this.db.createCollection(collection, options); +}; + +/** + * _Requires MongoDB Server 8.0 or greater_. Executes bulk write operations across multiple models in a single operation. + * You must specify the `model` for each operation: Mongoose will use `model` for casting and validation, as well as + * determining which collection to apply the operation to. + * + * #### Example: + * const Test = mongoose.model('Test', new Schema({ name: String })); + * + * await db.bulkWrite([ + * { model: Test, name: 'insertOne', document: { name: 'test1' } }, // Can specify model as a Model class... + * { model: 'Test', name: 'insertOne', document: { name: 'test2' } } // or as a model name + * ], { ordered: false }); + * + * @method bulkWrite + * @param {Array} ops + * @param {object} [options] + * @param {boolean} [options.ordered] If false, perform unordered operations. If true, perform ordered operations. + * @param {Session} [options.session] The session to use for the operation. + * @return {Promise} + * @see MongoDB https://www.mongodb.com/docs/manual/reference/command/bulkWrite/#mongodb-dbcommand-dbcmd.bulkWrite + * @api public + */ + + +Connection.prototype.bulkWrite = async function bulkWrite(ops, options) { + await this._waitForConnect(); + options = options || {}; + + const ordered = options.ordered == null ? true : options.ordered; + const asyncLocalStorage = this.base.transactionAsyncLocalStorage?.getStore(); + if ((!options || !Object.hasOwn(options, 'session')) && asyncLocalStorage?.session != null) { + options = { ...options, session: asyncLocalStorage.session }; + } + + const now = this.base.now(); + + let res = null; + if (ordered) { + const opsToSend = []; + for (const op of ops) { + if (typeof op.model !== 'string' && !op.model?.[modelSymbol]) { + throw new MongooseError('Must specify model in Connection.prototype.bulkWrite() operations'); + } + const Model = op.model[modelSymbol] ? op.model : this.model(op.model); + + if (op.name == null) { + throw new MongooseError('Must specify operation name in Connection.prototype.bulkWrite()'); + } + if (!Object.hasOwn(castBulkWrite.cast, op.name)) { + throw new MongooseError(`Unrecognized bulkWrite() operation name ${op.name}`); + } + + await castBulkWrite.cast[op.name](Model, op, options, now); + opsToSend.push({ ...op, namespace: Model.namespace() }); + } + + res = await this.client.bulkWrite(opsToSend, options); + } else { + const validOps = []; + const validOpIndexes = []; + let validationErrors = []; + const asyncValidations = []; + const results = []; + for (let i = 0; i < ops.length; ++i) { + const op = ops[i]; + if (typeof op.model !== 'string' && !op.model?.[modelSymbol]) { + const error = new MongooseError('Must specify model in Connection.prototype.bulkWrite() operations'); + validationErrors.push({ index: i, error: error }); + results[i] = error; + continue; + } + let Model; + try { + Model = op.model[modelSymbol] ? op.model : this.model(op.model); + } catch (error) { + validationErrors.push({ index: i, error: error }); + continue; + } + if (op.name == null) { + const error = new MongooseError('Must specify operation name in Connection.prototype.bulkWrite()'); + validationErrors.push({ index: i, error: error }); + results[i] = error; + continue; + } + if (!Object.hasOwn(castBulkWrite.cast, op.name)) { + const error = new MongooseError(`Unrecognized bulkWrite() operation name ${op.name}`); + validationErrors.push({ index: i, error: error }); + results[i] = error; + continue; + } + + let maybePromise = null; + try { + maybePromise = castBulkWrite.cast[op.name](Model, op, options, now); + } catch (error) { + validationErrors.push({ index: i, error: error }); + results[i] = error; + continue; + } + if (isPromise(maybePromise)) { + asyncValidations.push( + maybePromise.then( + () => { + validOps.push({ ...op, namespace: Model.namespace() }); + validOpIndexes.push(i); + }, + error => { + validationErrors.push({ index: i, error: error }); + results[i] = error; + } + ) + ); + } else { + validOps.push({ ...op, namespace: Model.namespace() }); + validOpIndexes.push(i); + } + } + + if (asyncValidations.length > 0) { + await Promise.all(asyncValidations); + } + + validationErrors = validationErrors. + sort((v1, v2) => v1.index - v2.index). + map(v => v.error); + + if (validOps.length === 0) { + if (options.throwOnValidationError && validationErrors.length) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + 'bulkWrite' + ); + } + const BulkWriteResult = this.base.driver.get().BulkWriteResult; + const res = new BulkWriteResult(getDefaultBulkwriteResult(), false); + return decorateBulkWriteResult(res, validationErrors, results); + } + + let error; + [res, error] = await this.client.bulkWrite(validOps, options). + then(res => ([res, null])). + catch(err => ([null, err])); + + for (let i = 0; i < validOpIndexes.length; ++i) { + results[validOpIndexes[i]] = null; + } + if (error) { + if (validationErrors.length > 0) { + decorateBulkWriteResult(error, validationErrors, results); + error.mongoose = error.mongoose || {}; + error.mongoose.validationErrors = validationErrors; + } + } + + if (validationErrors.length > 0) { + if (options.throwOnValidationError) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + 'bulkWrite' + ); + } else { + decorateBulkWriteResult(res, validationErrors, results); + } + } + } + + return res; +}; + +/** + * Calls `createCollection()` on a models in a series. + * + * @method createCollections + * @param {boolean} continueOnError When true, will continue to create collections and create a new error class for the collections that errored. + * @returns {Promise} + * @api public + */ + +Connection.prototype.createCollections = async function createCollections(options = {}) { + const result = {}; + const errorsMap = { }; + + const { continueOnError } = options; + delete options.continueOnError; + for (const model of Object.values(this.models)) { + try { + result[model.modelName] = await model.createCollection({}); + } catch (err) { + if (!continueOnError) { + errorsMap[model.modelName] = err; + break; + } else { + result[model.modelName] = err; + } + } + } + + if (!continueOnError && utils.hasOwnKeys(errorsMap)) { + const message = Object.entries(errorsMap).map(([modelName, err]) => `${modelName}: ${err.message}`).join(', '); + const createCollectionsError = new CreateCollectionsError(message, errorsMap); + throw createCollectionsError; + } + return result; +}; + +/** + * A convenience wrapper for `connection.client.withSession()`. + * + * #### Example: + * + * await conn.withSession(async session => { + * const doc = await TestModel.findOne().session(session); + * }); + * + * @method withSession + * @param {Function} executor called with 1 argument: a `ClientSession` instance + * @return {Promise} resolves to the return value of the executor function + * @api public + */ + +Connection.prototype.withSession = async function withSession(executor) { + if (arguments.length === 0) { + throw new MongooseError('Please provide an executor function'); + } + return await this.client.withSession(executor); +}; + +/** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://www.mongodb.com/docs/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://www.mongodb.com/docs/manual/core/retryable-writes/), + * and [transactions](https://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + * + * #### Example: + * + * const session = await conn.startSession(); + * let doc = await Person.findOne({ name: 'Ned Stark' }, null, { session }); + * await doc.deleteOne(); + * // `doc` will always be null, even if reading from a replica set + * // secondary. Without causal consistency, it is possible to + * // get a doc back from the below query if the query reads from a + * // secondary that is experiencing replication lag. + * doc = await Person.findOne({ name: 'Ned Stark' }, null, { session, readPreference: 'secondary' }); + * + * + * @method startSession + * @param {object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html#startSession) + * @param {boolean} [options.causalConsistency=true] set to false to disable causal consistency + * @return {Promise} promise that resolves to a MongoDB driver `ClientSession` + * @api public + */ + +Connection.prototype.startSession = async function startSession(options) { + if (arguments.length >= 2 && typeof arguments[1] === 'function') { + throw new MongooseError('Connection.prototype.startSession() no longer accepts a callback'); + } + + await this._waitForConnect(); + + const session = this.client.startSession(options); + return session; +}; + +/** + * _Requires MongoDB >= 3.6.0._ Executes the wrapped async function + * in a transaction. Mongoose will commit the transaction if the + * async function executes successfully and attempt to retry if + * there was a retriable error. + * + * Calls the MongoDB driver's [`session.withTransaction()`](https://mongodb.github.io/node-mongodb-native/7.0/classes/ClientSession.html#withTransaction), + * but also handles resetting Mongoose document state as shown below. + * + * #### Example: + * + * const doc = new Person({ name: 'Will Riker' }); + * await db.transaction(async function setRank(session) { + * doc.rank = 'Captain'; + * await doc.save({ session }); + * doc.isNew; // false + * + * // Throw an error to abort the transaction + * throw new MongooseError('Oops!'); + * },{ readPreference: 'primary' }).catch(() => {}); + * + * // true, `transaction()` reset the document's state because the + * // transaction was aborted. + * doc.isNew; + * + * @method transaction + * @param {Function} fn Function to execute in a transaction + * @param {mongodb.TransactionOptions} [options] Optional settings for the transaction + * @return {Promise} promise that is fulfilled if Mongoose successfully committed the transaction, or rejects if the transaction was aborted or if Mongoose failed to commit the transaction. If fulfilled, the promise resolves to a MongoDB command result. + * @api public + */ + +Connection.prototype.transaction = function transaction(fn, options) { + return this.startSession().then(session => { + session[sessionNewDocuments] = new Map(); + return session.withTransaction(() => _wrapUserTransaction(fn, session, this.base), options). + then(res => { + delete session[sessionNewDocuments]; + return res; + }). + catch(err => { + delete session[sessionNewDocuments]; + throw err; + }). + finally(() => { + session.endSession().catch(() => {}); + }); + }); +}; + +/*! + * Reset document state in between transaction retries re: gh-13698 + */ + +async function _wrapUserTransaction(fn, session, mongoose) { + try { + const res = mongoose.transactionAsyncLocalStorage == null + ? await fn(session) + : await new Promise(resolve => { + mongoose.transactionAsyncLocalStorage.run( + { session }, + () => resolve(fn(session)) + ); + }); + return res; + } catch (err) { + _resetSessionDocuments(session); + throw err; + } +} + +/*! + * If transaction was aborted, we need to reset newly inserted documents' `isNew`. + */ +function _resetSessionDocuments(session) { + for (const doc of session[sessionNewDocuments].keys()) { + const state = session[sessionNewDocuments].get(doc); + if (Object.hasOwn(state, 'isNew')) { + doc.$isNew = state.isNew; + } + if (Object.hasOwn(state, 'versionKey')) { + doc.set(doc.schema.options.versionKey, state.versionKey); + } + if (Object.hasOwn(state, 'isDeleted')) { + doc.$isDeleted(state.isDeleted); + } + + for (const path of state.modifiedPaths) { + doc.$__.activePaths.modify(path); + } + + for (const path of state.atomics.keys()) { + const val = doc.$__getValue(path); + if (val == null) { + continue; + } + val[arrayAtomicsSymbol] = state.atomics.get(path); + } + } +} + +/** + * Helper for `dropCollection()`. Will delete the given collection, including + * all documents and indexes. + * + * @method dropCollection + * @param {string} collection The collection to delete + * @return {Promise} + * @api public + */ + +Connection.prototype.dropCollection = async function dropCollection(collection) { + if (arguments.length >= 2 && typeof arguments[1] === 'function') { + throw new MongooseError('Connection.prototype.dropCollection() no longer accepts a callback'); + } + + await this._waitForConnect(); + + return this.db.dropCollection(collection); +}; + +/** + * Waits for connection to be established, so the connection has a `client` + * + * @param {boolean} [noTimeout=false] if set, don't put a timeout on the operation. Used internally so `mongoose.model()` doesn't leave open handles. + * @return {Promise} + * @api private + */ + +Connection.prototype._waitForConnect = async function _waitForConnect(noTimeout) { + if ((this.readyState === STATES.connecting || this.readyState === STATES.disconnected) && this._shouldBufferCommands()) { + const bufferTimeoutMS = this._getBufferTimeoutMS(); + let timeout = null; + let timedOut = false; + // The element that this function pushes onto `_queue`, stored to make it easy to remove later + const queueElement = {}; + + // Mongoose executes all elements in `_queue` when initial connection succeeds in `onOpen()`. + const waitForConnectPromise = new Promise(resolve => { + queueElement.fn = resolve; + this._queue.push(queueElement); + }); + + if (noTimeout) { + await waitForConnectPromise; + } else { + await Promise.race([ + waitForConnectPromise, + new Promise(resolve => { + timeout = setTimeout( + () => { + timedOut = true; + resolve(); + }, + bufferTimeoutMS + ); + }) + ]); + } + + if (timedOut) { + const index = this._queue.indexOf(queueElement); + if (index !== -1) { + this._queue.splice(index, 1); + } + const message = 'Connection operation buffering timed out after ' + bufferTimeoutMS + 'ms'; + throw new MongooseError(message); + } else if (timeout != null) { + // Not strictly necessary, but avoid the extra overhead of creating a new MongooseError + // in case of success + clearTimeout(timeout); + } + } +}; + +/*! + * Get the default buffer timeout for this connection + */ + +Connection.prototype._getBufferTimeoutMS = function _getBufferTimeoutMS() { + if (this.config.bufferTimeoutMS != null) { + return this.config.bufferTimeoutMS; + } + if (this.base?.get('bufferTimeoutMS') != null) { + return this.base.get('bufferTimeoutMS'); + } + return 10000; +}; + +/** + * Helper for MongoDB Node driver's `listCollections()`. + * Returns an array of collection objects. + * + * @method listCollections + * @return {Promise>} + * @api public + */ + +Connection.prototype.listCollections = async function listCollections() { + await this._waitForConnect(); + + const cursor = this.db.listCollections(); + return await cursor.toArray(); +}; + +/** + * Helper for MongoDB Node driver's `listDatabases()`. + * Returns an object with a `databases` property that contains an + * array of database objects. + * + * #### Example: + * const { databases } = await mongoose.connection.listDatabases(); + * databases; // [{ name: 'mongoose_test', sizeOnDisk: 0, empty: false }] + * + * @method listCollections + * @return {Promise>} + * @api public + */ + +Connection.prototype.listDatabases = async function listDatabases() { + // Implemented in `lib/drivers/node-mongodb-native/connection.js` + throw new MongooseError('listDatabases() not implemented by driver'); +}; + +/** + * Helper for `dropDatabase()`. Deletes the given database, including all + * collections, documents, and indexes. + * + * #### Example: + * + * const conn = mongoose.createConnection('mongodb://127.0.0.1:27017/mydb'); + * // Deletes the entire 'mydb' database + * await conn.dropDatabase(); + * + * @method dropDatabase + * @return {Promise} + * @api public + */ + +Connection.prototype.dropDatabase = async function dropDatabase() { + if (arguments.length >= 1 && typeof arguments[0] === 'function') { + throw new MongooseError('Connection.prototype.dropDatabase() no longer accepts a callback'); + } + + await this._waitForConnect(); + + // If `dropDatabase()` is called, this model's collection will not be + // init-ed. It is sufficiently common to call `dropDatabase()` after + // `mongoose.connect()` but before creating models that we want to + // support this. See gh-6796 + for (const model of Object.values(this.models)) { + delete model.$init; + } + + return this.db.dropDatabase(); +}; + +/*! + * ignore + */ + +Connection.prototype._shouldBufferCommands = function _shouldBufferCommands() { + if (this.config.bufferCommands != null) { + return this.config.bufferCommands; + } + if (this.base.get('bufferCommands') != null) { + return this.base.get('bufferCommands'); + } + return true; +}; + +/** + * error + * + * Graceful error handling, passes error to callback + * if available, else emits error on the connection. + * + * @param {Error} err + * @param {Function} callback optional + * @emits "error" Emits the `error` event with the given `err`, unless a callback is specified + * @returns {Promise|null} Returns a rejected Promise if no `callback` is given. + * @api private + */ + +Connection.prototype.error = function error(err, callback) { + if (callback) { + callback(err); + return null; + } + if (this.listeners('error').length > 0) { + this.emit('error', err); + } + return Promise.reject(err); +}; + +/** + * Called when the connection is opened + * + * @emits "open" + * @api private + */ + +Connection.prototype.onOpen = function() { + this.readyState = STATES.connected; + + this._flushQueue(); + + // avoid having the collection subscribe to our event emitter + // to prevent 0.3 warning + for (const i in this.collections) { + if (Object.hasOwn(this.collections, i)) { + this.collections[i].onOpen(); + } + } + + this.emit('open'); +}; + +/** + * Flush all buffered operations in `_queue`. Called by `onOpen()` and + * by the heartbeat handler when a previously-stale connection recovers. + * + * @api private + */ + +Connection.prototype._flushQueue = function _flushQueue() { + const queue = this._queue; + this._queue = []; + for (const d of queue) { + d.fn.apply(d.ctx, d.args); + } +}; + +/** + * Opens the connection with a URI using `MongoClient.connect()`. + * + * @param {string} uri The URI to connect with. + * @param {object} [options] Passed on to [`MongoClient.connect`](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html#connect) + * @param {boolean} [options.bufferCommands=true] Mongoose specific option. Set to false to [disable buffering](https://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. + * @param {number} [options.bufferTimeoutMS=10000] Mongoose specific option. If `bufferCommands` is true, Mongoose will throw an error after `bufferTimeoutMS` if the operation is still buffered. + * @param {string} [options.dbName] The name of the database we want to use. If not provided, use database name from connection string. + * @param {string} [options.user] username for authentication, equivalent to `options.auth.username`. Maintained for backwards compatibility. + * @param {string} [options.pass] password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. + * @param {number} [options.maxPoolSize=100] The maximum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {number} [options.minPoolSize=0] The minimum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {number} [options.serverSelectionTimeoutMS] The MongoDB driver will try to find a server to send any given operation to, and keep retrying for `serverSelectionTimeoutMS` milliseconds before erroring out. If not set, the MongoDB driver defaults to using `30000` (30 seconds). + * @param {number} [options.heartbeatFrequencyMS] The MongoDB driver sends a heartbeat every `heartbeatFrequencyMS` to check on the status of the connection. A heartbeat is subject to `serverSelectionTimeoutMS`, so the MongoDB driver will retry failed heartbeats for up to 30 seconds by default. Mongoose only emits a `'disconnected'` event after a heartbeat has failed, so you may want to decrease this setting to reduce the time between when your server goes down and when Mongoose emits `'disconnected'`. We recommend you do **not** set this setting below 1000, too many heartbeats can lead to performance degradation. + * @param {boolean} [options.autoIndex=true] Mongoose-specific option. Set to false to disable automatic index creation for all models associated with this connection. + * @param {number} [options.socketTimeoutMS=0] How long the MongoDB driver will wait before killing a socket due to inactivity _after initial connection_. A socket may be inactive because of either no activity or a long-running operation. `socketTimeoutMS` defaults to 0, which means Node.js will not time out the socket due to inactivity. This option is passed to [Node.js `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) after the MongoDB driver successfully completes. + * @param {number} [options.family=0] Passed transparently to [Node.js' `dns.lookup()`](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback) function. May be either `0`, `4`, or `6`. `4` means use IPv4 only, `6` means use IPv6 only, `0` means try both. + * @param {boolean} [options.autoCreate=false] Set to `true` to make Mongoose automatically call `createCollection()` on every model created on this connection. + * @returns {Promise} + * @api public + */ + +Connection.prototype.openUri = async function openUri(uri, options) { + if (this.readyState === STATES.connecting || this.readyState === STATES.connected) { + if (this._connectionString === uri) { + return this; + } + } + + this._closeCalled = false; + + // Internal option to skip `await this.$initialConnection` in + // this function for `createConnection()`. Because otherwise + // `createConnection()` would have an uncatchable error. + let _fireAndForget = false; + if (options && '_fireAndForget' in options) { + _fireAndForget = options._fireAndForget; + delete options._fireAndForget; + } + + try { + _validateArgs.apply(arguments); + } catch (err) { + if (_fireAndForget) { + throw err; + } + this.$initialConnection = Promise.reject(err); + throw err; + } + + this.$initialConnection = this.createClient(uri, options). + then(() => this). + catch(err => { + this.readyState = STATES.disconnected; + if (this.listeners('error').length > 0) { + immediate(() => this.emit('error', err)); + } + throw err; + }); + + for (const model of Object.values(this.models)) { + // Errors handled internally, so safe to ignore error + model.init().catch(function $modelInitNoop() {}); + } + + // `createConnection()` calls this `openUri()` function without + // awaiting on the result, so we set this option to rely on + // `asPromise()` to handle any errors. + if (_fireAndForget) { + return this; + } + + try { + await this.$initialConnection; + } catch (err) { + throw _handleConnectionErrors(err); + } + + return this; +}; + +/** + * Listen to events in the Connection + * + * @param {string} event The event to listen on + * @param {Function} callback + * @see Connection#readyState https://mongoosejs.com/docs/api/connection.html#Connection.prototype.readyState + * + * @method on + * @instance + * @memberOf Connection + * @api public + */ + +// Treat `on('error')` handlers as handling the initialConnection promise +// to avoid uncaught exceptions when using `on('error')`. See gh-14377. +Connection.prototype.on = function on(event, callback) { + if (event === 'error' && this.$initialConnection) { + this.$initialConnection.catch(() => {}); + } + return EventEmitter.prototype.on.call(this, event, callback); +}; + +/** + * Listen to a event once in the Connection + * + * @param {string} event The event to listen on + * @param {Function} callback + * @see Connection#readyState https://mongoosejs.com/docs/api/connection.html#Connection.prototype.readyState + * + * @method once + * @instance + * @memberOf Connection + * @api public + */ + +// Treat `on('error')` handlers as handling the initialConnection promise +// to avoid uncaught exceptions when using `on('error')`. See gh-14377. +Connection.prototype.once = function on(event, callback) { + if (event === 'error' && this.$initialConnection) { + this.$initialConnection.catch(() => {}); + } + return EventEmitter.prototype.once.call(this, event, callback); +}; + +/*! + * ignore + */ + +function _validateArgs(uri, options, callback) { + if (typeof options === 'function' && callback == null) { + throw new MongooseError('Connection.prototype.openUri() no longer accepts a callback'); + } else if (typeof callback === 'function') { + throw new MongooseError('Connection.prototype.openUri() no longer accepts a callback'); + } +} + +/*! + * ignore + */ + +function _handleConnectionErrors(err) { + if (err?.name === 'MongoServerSelectionError') { + const originalError = err; + err = new ServerSelectionError(); + err.assimilateError(originalError); + } + + return err; +} + +/** + * Destroy the connection. Similar to [`.close`](https://mongoosejs.com/docs/api/connection.html#Connection.prototype.close()), + * but also removes the connection from Mongoose's `connections` list and prevents the + * connection from ever being re-opened. + * + * @param {boolean} [force] + * @returns {Promise} + */ + +Connection.prototype.destroy = async function destroy(force) { + if (typeof force === 'function' || (arguments.length === 2 && typeof arguments[1] === 'function')) { + throw new MongooseError('Connection.prototype.destroy() no longer accepts a callback'); + } + + if (force != null && typeof force === 'object') { + this.$wasForceClosed = !!force.force; + } else { + this.$wasForceClosed = !!force; + } + + return this._close(force, true); +}; + +/** + * Closes the connection + * + * @param {boolean} [force] optional + * @return {Promise} + * @api public + */ + +Connection.prototype.close = async function close(force) { + if (typeof force === 'function' || (arguments.length === 2 && typeof arguments[1] === 'function')) { + throw new MongooseError('Connection.prototype.close() no longer accepts a callback'); + } + + if (force != null && typeof force === 'object') { + this.$wasForceClosed = !!force.force; + } else { + this.$wasForceClosed = !!force; + } + + if (this._lastHeartbeatAt != null) { + this._lastHeartbeatAt = null; + } + + for (const model of Object.values(this.models)) { + // If manually disconnecting, make sure to clear each model's `$init` + // promise, so Mongoose knows to re-run `init()` in case the + // connection is re-opened. See gh-12047. + delete model.$init; + } + + return this._close(force, false); +}; + +/** + * Handles closing the connection + * + * @param {boolean} force + * @param {boolean} destroy + * @returns {Connection} this + * @api private + */ +Connection.prototype._close = async function _close(force, destroy) { + const _this = this; + const closeCalled = this._closeCalled; + this._closeCalled = true; + this._destroyCalled = destroy; + if (this.client != null) { + this.client._closeCalled = true; + this.client._destroyCalled = destroy; + } + + const conn = this; + switch (this.readyState) { + case STATES.disconnected: + if (destroy) { + const index = this.base.connections.indexOf(conn); + if (index !== -1) { + this.base.connections.splice(index, 1); + } + } + if (!closeCalled) { + await this.doClose(force); + this.onClose(force); + } + break; + + case STATES.connected: + this.readyState = STATES.disconnecting; + await this.doClose(force); + if (destroy) { + const index = _this.base.connections.indexOf(conn); + if (index !== -1) { + this.base.connections.splice(index, 1); + } + } + this.onClose(force); + + break; + case STATES.connecting: + return new Promise((resolve, reject) => { + const _rerunClose = () => { + this.removeListener('open', _rerunClose); + this.removeListener('error', _rerunClose); + if (destroy) { + this.destroy(force).then(resolve, reject); + } else { + this.close(force).then(resolve, reject); + } + }; + + this.once('open', _rerunClose); + this.once('error', _rerunClose); + }); + + case STATES.disconnecting: + return new Promise(resolve => { + this.once('close', () => { + if (destroy && this.base.connections.indexOf(conn) !== -1) { + this.base.connections.splice(this.base.connections.indexOf(conn), 1); + } + resolve(); + }); + }); + } + + return this; +}; + +/** + * Abstract method that drivers must implement. + * + * @api private + */ + +Connection.prototype.doClose = function doClose() { + throw new MongooseError('Connection#doClose unimplemented by driver'); +}; + +/** + * Called when the connection closes + * + * @emits "close" + * @api private + */ + +Connection.prototype.onClose = function onClose(force) { + this.readyState = STATES.disconnected; + + // avoid having the collection subscribe to our event emitter + // to prevent 0.3 warning + for (const i in this.collections) { + if (Object.hasOwn(this.collections, i)) { + this.collections[i].onClose(force); + } + } + + this.emit('close', force); + + const wasForceClosed = typeof force === 'object' && force !== null ? force.force : force; + + for (const db of this.otherDbs) { + this._destroyCalled ? db.destroy({ force: wasForceClosed, skipCloseClient: true }) : db.close({ force: wasForceClosed, skipCloseClient: true }); + } +}; + +/** + * Retrieves a raw collection instance, creating it if not cached. + * This method returns a thin wrapper around a [MongoDB Node.js driver collection](https://mongodb.github.io/node-mongodb-native/Next/classes/Collection.html). + * Using a Collection bypasses Mongoose middleware, validation, and casting, + * letting you use [MongoDB Node.js driver](https://mongodb.github.io/node-mongodb-native/) functionality directly. + * + * @param {string} name of the collection + * @param {object} [options] optional collection options + * @return {Collection} collection instance + * @api public + */ + +Connection.prototype.collection = function(name, options) { + const defaultOptions = { + autoIndex: this.config.autoIndex ?? this.base.options.autoIndex, + autoCreate: this.config.autoCreate ?? this.base.options.autoCreate, + autoSearchIndex: this.config.autoSearchIndex ?? this.base.options.autoSearchIndex + }; + options = Object.assign({}, defaultOptions, options ? clone(options) : {}); + options.$wasForceClosed = this.$wasForceClosed; + const Collection = this.base?.__driver?.Collection || driver.get().Collection; + if (!(name in this.collections)) { + this.collections[name] = new Collection(name, this, options); + } + return this.collections[name]; +}; + +/** + * Declares a plugin executed on all schemas you pass to `conn.model()` + * + * Equivalent to calling `.plugin(fn)` on each schema you create. + * + * #### Example: + * + * const db = mongoose.createConnection('mongodb://127.0.0.1:27017/mydb'); + * db.plugin(() => console.log('Applied')); + * db.plugins.length; // 1 + * + * db.model('Test', new Schema({})); // Prints "Applied" + * + * @param {Function} fn plugin callback + * @param {object} [opts] optional options + * @return {Connection} this + * @see plugins https://mongoosejs.com/docs/plugins.html + * @api public + */ + +Connection.prototype.plugin = function(fn, opts) { + this.plugins.push([fn, opts]); + return this; +}; + +/** + * Defines or retrieves a model. + * + * const mongoose = require('mongoose'); + * const db = mongoose.createConnection(..); + * db.model('Venue', new Schema(..)); + * const Ticket = db.model('Ticket', new Schema(..)); + * const Venue = db.model('Venue'); + * + * _When no `collection` argument is passed, Mongoose produces a collection name by passing the model `name` to the `utils.toCollectionName` method. This method pluralizes the name. If you don't like this behavior, either pass a collection name or set your schemas collection name option._ + * + * #### Example: + * + * const schema = new Schema({ name: String }, { collection: 'actor' }); + * + * // or + * + * schema.set('collection', 'actor'); + * + * // or + * + * const collectionName = 'actor' + * const M = conn.model('Actor', schema, collectionName) + * + * @param {string|Function} name the model name or class extending Model + * @param {Schema} [schema] a schema. necessary when defining a model + * @param {string} [collection] name of mongodb collection (optional) if not given it will be induced from model name + * @param {object} [options] + * @param {boolean} [options.overwriteModels=false] If true, overwrite existing models with the same name to avoid `OverwriteModelError` + * @see Mongoose#model https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.model() + * @return {Model} The compiled model + * @api public + */ + +Connection.prototype.model = function model(name, schema, collection, options) { + if (!(this instanceof Connection)) { + throw new MongooseError('`connection.model()` should not be run with ' + + '`new`. If you are doing `new db.model(foo)(bar)`, use ' + + '`db.model(foo)(bar)` instead'); + } + + let fn; + if (typeof name === 'function') { + fn = name; + name = fn.name; + } + + // collection name discovery + if (typeof schema === 'string') { + collection = schema; + schema = false; + } + + if (utils.isObject(schema)) { + if (!schema.instanceOfSchema) { + schema = new Schema(schema); + } else if (!(schema instanceof this.base.Schema)) { + schema = schema._clone(this.base.Schema); + } + } + if (schema && !schema.instanceOfSchema) { + throw new MongooseError('The 2nd parameter to `mongoose.model()` should be a ' + + 'schema or a POJO'); + } + + const defaultOptions = { cache: false, overwriteModels: this.base.options.overwriteModels }; + const opts = Object.assign(defaultOptions, options, { connection: this }); + if (this.models[name] && !collection && opts.overwriteModels !== true) { + // model exists but we are not subclassing with custom collection + if (schema?.instanceOfSchema && schema !== this.models[name].schema) { + throw new MongooseError.OverwriteModelError(name); + } + return this.models[name]; + } + + let model; + + if (schema?.instanceOfSchema) { + applyPlugins(schema, this.plugins, null, '$connectionPluginsApplied'); + + // compile a model + model = this.base._model(fn || name, schema, collection, opts); + + // only the first model with this name is cached to allow + // for one-offs with custom collection names etc. + if (!this.models[name]) { + this.models[name] = model; + } + + // Errors handled internally, so safe to ignore error + model.init().catch(function $modelInitNoop() {}); + + return model; + } + + if (this.models[name] && collection) { + // subclassing current model with alternate collection + model = this.models[name]; + schema = model.prototype.schema; + const sub = model.__subclass(this, schema, collection); + // do not cache the sub model + return sub; + } + + if (arguments.length === 1) { + model = this.models[name]; + if (!model) { + throw new MongooseError.MissingSchemaError(name); + } + return model; + } + + if (!model) { + throw new MongooseError.MissingSchemaError(name); + } + + if (this === model.prototype.db + && (!collection || collection === model.collection.name)) { + // model already uses this connection. + + // only the first model with this name is cached to allow + // for one-offs with custom collection names etc. + if (!this.models[name]) { + this.models[name] = model; + } + + return model; + } + this.models[name] = model.__subclass(this, schema, collection); + return this.models[name]; +}; + +/** + * Removes the model named `name` from this connection, if it exists. You can + * use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + * + * #### Example: + * + * conn.model('User', new Schema({ name: String })); + * console.log(conn.model('User')); // Model object + * conn.deleteModel('User'); + * console.log(conn.model('User')); // undefined + * + * // Usually useful in a Mocha `afterEach()` hook + * afterEach(function() { + * conn.deleteModel(/.+/); // Delete every model + * }); + * + * @api public + * @param {string|RegExp} name if string, the name of the model to remove. If regexp, removes all models whose name matches the regexp. + * @return {Connection} this + */ + +Connection.prototype.deleteModel = function deleteModel(name) { + if (typeof name === 'string') { + const model = this.model(name); + if (model == null) { + return this; + } + const collectionName = model.collection.name; + delete this.models[name]; + delete this.collections[collectionName]; + + this.emit('deleteModel', model); + } else if (name instanceof RegExp) { + const pattern = name; + const names = this.modelNames(); + for (const name of names) { + if (pattern.test(name)) { + this.deleteModel(name); + } + } + } else { + throw new MongooseError('First parameter to `deleteModel()` must be a string ' + + 'or regexp, got "' + name + '"'); + } + + return this; +}; + +/** + * Watches the entire underlying database for changes. Similar to + * [`Model.watch()`](https://mongoosejs.com/docs/api/model.html#Model.watch()). + * + * This function does **not** trigger any middleware. In particular, it + * does **not** trigger aggregate middleware. + * + * The ChangeStream object is an event emitter that emits the following events: + * + * - 'change': A change occurred, see below example + * - 'error': An unrecoverable error occurred. In particular, change streams currently error out if they lose connection to the replica set primary. Follow [this GitHub issue](https://github.com/Automattic/mongoose/issues/6799) for updates. + * - 'end': Emitted if the underlying stream is closed + * - 'close': Emitted if the underlying stream is closed + * + * #### Example: + * + * const User = conn.model('User', new Schema({ name: String })); + * + * const changeStream = conn.watch().on('change', data => console.log(data)); + * + * // Triggers a 'change' event on the change stream. + * await User.create({ name: 'test' }); + * + * @api public + * @param {Array} [pipeline] + * @param {object} [options] passed without changes to [the MongoDB driver's `Db#watch()` function](https://mongodb.github.io/node-mongodb-native/7.0/classes/Db.html#watch) + * @return {ChangeStream} mongoose-specific change stream wrapper, inherits from EventEmitter + */ + +Connection.prototype.watch = function watch(pipeline, options) { + const changeStreamPromise = this._waitForConnect().then(() => this.db.watch(pipeline, options)); + + return new ChangeStream(changeStreamPromise, pipeline, options); +}; + +/** + * Returns a promise that resolves when this connection + * successfully connects to MongoDB, or rejects if this connection failed + * to connect. + * + * #### Example: + * + * const conn = await mongoose.createConnection('mongodb://127.0.0.1:27017/test'). + * asPromise(); + * conn.readyState; // 1, means Mongoose is connected + * + * @api public + * @return {Promise} + */ + +Connection.prototype.asPromise = async function asPromise() { + try { + await this.$initialConnection; + return this; + } catch (err) { + throw _handleConnectionErrors(err); + } +}; + +/** + * Returns an array of model names created on this connection. + * @api public + * @return {Array} + */ + +Connection.prototype.modelNames = function modelNames() { + return Object.keys(this.models); +}; + +/** + * Returns if the connection requires authentication after it is opened. Generally if a + * username and password are both provided than authentication is needed, but in some cases a + * password is not required. + * + * @api private + * @return {boolean} true if the connection should be authenticated after it is opened, otherwise false. + */ +Connection.prototype.shouldAuthenticate = function shouldAuthenticate() { + return this.user != null && + (this.pass != null || this.authMechanismDoesNotRequirePassword()); +}; + +/** + * Returns a boolean value that specifies if the current authentication mechanism needs a + * password to authenticate according to the auth objects passed into the openUri methods. + * + * @api private + * @return {boolean} true if the authentication mechanism specified in the options object requires + * a password, otherwise false. + */ +Connection.prototype.authMechanismDoesNotRequirePassword = function authMechanismDoesNotRequirePassword() { + if (this.options?.auth) { + return noPasswordAuthMechanisms.indexOf(this.options.auth.authMechanism) >= 0; + } + return true; +}; + +/** + * Returns a boolean value that specifies if the provided objects object provides enough + * data to authenticate with. Generally this is true if the username and password are both specified + * but in some authentication methods, a password is not required for authentication so only a username + * is required. + * + * @param {object} [options] the options object passed into the openUri methods. + * @api private + * @return {boolean} true if the provided options object provides enough data to authenticate with, + * otherwise false. + */ +Connection.prototype.optionsProvideAuthenticationData = function optionsProvideAuthenticationData(options) { + return (options) && + (options.user) && + ((options.pass) || this.authMechanismDoesNotRequirePassword()); +}; + +/** + * Returns the [MongoDB driver `MongoClient`](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html) instance + * that this connection uses to talk to MongoDB. + * + * #### Example: + * + * const conn = await mongoose.createConnection('mongodb://127.0.0.1:27017/test'). + * asPromise(); + * + * conn.getClient(); // MongoClient { ... } + * + * @api public + * @return {MongoClient} + */ + +Connection.prototype.getClient = function getClient() { + return this.client; +}; + +/** + * Set the [MongoDB driver `MongoClient`](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html) instance + * that this connection uses to talk to MongoDB. This is useful if you already have a MongoClient instance, and want to + * reuse it. + * + * #### Example: + * + * const client = await mongodb.MongoClient.connect('mongodb://127.0.0.1:27017/test'); + * + * const conn = mongoose.createConnection().setClient(client); + * + * conn.getClient(); // MongoClient { ... } + * conn.readyState; // 1, means 'CONNECTED' + * + * @api public + * @param {MongClient} client The Client to set to be used. + * @return {Connection} this + */ + +Connection.prototype.setClient = function setClient() { + throw new MongooseError('Connection#setClient not implemented by driver'); +}; + +/*! + * Called internally by `openUri()` to create a MongoClient instance. + */ + +Connection.prototype.createClient = function createClient() { + throw new MongooseError('Connection#createClient not implemented by driver'); +}; + +/** + * Syncs all the indexes for the models registered with this connection. + * + * @param {object} [options] + * @param {boolean} [options.continueOnError] `false` by default. If set to `true`, mongoose will not throw an error if one model syncing failed, and will return an object where the keys are the names of the models, and the values are the results/errors for each model. + * @return {Promise} Returns a Promise, when the Promise resolves the value is a list of the dropped indexes. + */ +Connection.prototype.syncIndexes = async function syncIndexes(options = {}) { + const result = {}; + const errorsMap = { }; + + const { continueOnError } = options; + delete options.continueOnError; + + for (const model of Object.values(this.models)) { + try { + result[model.modelName] = await model.syncIndexes(options); + } catch (err) { + if (!continueOnError) { + errorsMap[model.modelName] = err; + break; + } else { + result[model.modelName] = err; + } + } + } + + if (!continueOnError && utils.hasOwnKeys(errorsMap)) { + const message = Object.entries(errorsMap).map(([modelName, err]) => `${modelName}: ${err.message}`).join(', '); + const syncIndexesError = new SyncIndexesError(message, errorsMap); + throw syncIndexesError; + } + + return result; +}; + +/** + * Switches to a different database using the same [connection pool](https://mongoosejs.com/docs/connections.html#connection_pools). + * + * Returns a new connection object, with the new db. + * + * #### Example: + * + * // Connect to `initialdb` first + * const conn = await mongoose.createConnection('mongodb://127.0.0.1:27017/initialdb').asPromise(); + * + * // Creates an un-cached connection to `mydb` + * const db = conn.useDb('mydb'); + * // Creates a cached connection to `mydb2`. All calls to `conn.useDb('mydb2', { useCache: true })` will return the same + * // connection instance as opposed to creating a new connection instance + * const db2 = conn.useDb('mydb2', { useCache: true }); + * + * @method useDb + * @memberOf Connection + * @param {string} name The database name + * @param {object} [options] + * @param {boolean} [options.useCache=false] If true, cache results so calling `useDb()` multiple times with the same name only creates 1 connection object. + * @return {Connection} New Connection Object + * @api public + */ + +/** + * Runs a [db-level aggregate()](https://www.mongodb.com/docs/manual/reference/method/db.aggregate/) on this connection's underlying `db` + * + * @method aggregate + * @memberOf Connection + * @param {Array} pipeline + * @param {object} [options] + * @param {boolean} [options.cursor=false] If true, make the Aggregate resolve to a Mongoose AggregationCursor rather than an array + * @return {Aggregate} Aggregation wrapper + * @api public + */ + +/** + * Removes the database connection with the given name created with with `useDb()`. + * + * Throws an error if the database connection was not found. + * + * #### Example: + * + * // Connect to `initialdb` first + * const conn = await mongoose.createConnection('mongodb://127.0.0.1:27017/initialdb').asPromise(); + * + * // Creates an un-cached connection to `mydb` + * const db = conn.useDb('mydb'); + * + * // Closes `db`, and removes `db` from `conn.relatedDbs` and `conn.otherDbs` + * await conn.removeDb('mydb'); + * + * @method removeDb + * @memberOf Connection + * @param {string} name The database name + * @return {Connection} this + * @api public + */ + +/*! + * Module exports. + */ + +Connection.STATES = STATES; +module.exports = Connection; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connectionState.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connectionState.js new file mode 100644 index 00000000..920f45be --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/connectionState.js @@ -0,0 +1,26 @@ + +/*! + * Connection states + */ + +'use strict'; + +const STATES = module.exports = exports = Object.create(null); + +const disconnected = 'disconnected'; +const connected = 'connected'; +const connecting = 'connecting'; +const disconnecting = 'disconnecting'; +const uninitialized = 'uninitialized'; + +STATES[0] = disconnected; +STATES[1] = connected; +STATES[2] = connecting; +STATES[3] = disconnecting; +STATES[99] = uninitialized; + +STATES[disconnected] = 0; +STATES[connected] = 1; +STATES[connecting] = 2; +STATES[disconnecting] = 3; +STATES[uninitialized] = 99; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/constants.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/constants.js new file mode 100644 index 00000000..3a03bd50 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/constants.js @@ -0,0 +1,73 @@ +'use strict'; + +/*! + * ignore + */ + +const queryOperations = Object.freeze([ + // Read + 'countDocuments', + 'distinct', + 'estimatedDocumentCount', + 'find', + 'findOne', + // Update + 'findOneAndReplace', + 'findOneAndUpdate', + 'replaceOne', + 'updateMany', + 'updateOne', + // Delete + 'deleteMany', + 'deleteOne', + 'findOneAndDelete' +]); + +exports.queryOperations = queryOperations; + +/*! + * ignore + */ + +const queryMiddlewareFunctions = queryOperations.concat([ + 'validate' +]); + +exports.queryMiddlewareFunctions = queryMiddlewareFunctions; + +/*! + * ignore + */ + +const aggregateMiddlewareFunctions = [ + 'aggregate' +]; + +exports.aggregateMiddlewareFunctions = aggregateMiddlewareFunctions; + +/*! + * ignore + */ + +const modelMiddlewareFunctions = [ + 'bulkWrite', + 'createCollection', + 'insertMany' +]; + +exports.modelMiddlewareFunctions = modelMiddlewareFunctions; + +/*! + * ignore + */ + +const documentMiddlewareFunctions = [ + 'validate', + 'save', + 'remove', + 'updateOne', + 'deleteOne', + 'init' +]; + +exports.documentMiddlewareFunctions = documentMiddlewareFunctions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/aggregationCursor.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/aggregationCursor.js new file mode 100644 index 00000000..fb4df3ac --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/aggregationCursor.js @@ -0,0 +1,513 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('../error/mongooseError'); +const Readable = require('stream').Readable; +const eachAsync = require('../helpers/cursor/eachAsync'); +const immediate = require('../helpers/immediate'); +const kareem = require('kareem'); +const util = require('util'); +const { cursorNextChannel } = require('../tracing'); +const { buildMiddlewareFilter } = require('../helpers/buildMiddlewareFilter'); + +/** + * An AggregationCursor is a concurrency primitive for processing aggregation + * results one document at a time. It is analogous to QueryCursor. + * + * An AggregationCursor fulfills the Node.js streams3 API, + * in addition to several other mechanisms for loading documents from MongoDB + * one at a time. + * + * Creating an AggregationCursor executes the model's pre aggregate hooks, + * but **not** the model's post aggregate hooks. + * + * Unless you're an advanced user, do **not** instantiate this class directly. + * Use [`Aggregate#cursor()`](https://mongoosejs.com/docs/api/aggregate.html#Aggregate.prototype.cursor()) instead. + * + * @param {Aggregate} agg + * @inherits Readable https://nodejs.org/api/stream.html#class-streamreadable + * @event `cursor`: Emitted when the cursor is created + * @event `error`: Emitted when an error occurred + * @event `data`: Emitted when the stream is flowing and the next doc is ready + * @event `end`: Emitted when the stream is exhausted + * @api public + */ + +function AggregationCursor(agg) { + // set autoDestroy=true because on node 12 it's by default false + // gh-10902 need autoDestroy to destroy correctly and emit 'close' event + Readable.call(this, { autoDestroy: true, objectMode: true }); + + this.cursor = null; + this.agg = agg; + this._transforms = []; + const connection = agg._connection; + const model = agg._model; + delete agg.options.cursor.useMongooseAggCursor; + this._mongooseOptions = {}; + + if (connection) { + let options = agg.options || {}; + if (Object.hasOwn(options, 'middleware')) { + // `middleware` is a Mongoose-only option used to skip user hooks; strip + // it from the clone passed through to the MongoDB driver. + const { middleware, ...driverOptions } = options; + options = driverOptions; + } + this.cursor = connection.db.aggregate(agg._pipeline, options); + setImmediate(() => this.emit('cursor', this.cursor)); + } else { + _init(model, this, agg); + } +} + +util.inherits(AggregationCursor, Readable); + +/*! + * ignore + */ + +function _init(model, c, agg) { + const preFilter = buildMiddlewareFilter(agg.options, 'pre'); + model.hooks.execPre('aggregate', agg, [], { filter: preFilter }).then(() => onPreComplete(null), err => onPreComplete(err)); + + function onPreComplete(err) { + if (err != null) { + _handlePreHookError(c, err); + return; + } + if (typeof agg.options?.cursor?.transform === 'function') { + c._transforms.push(agg.options.cursor.transform); + } + + if (model.collection._shouldBufferCommands() && model.collection.buffer) { + model.collection.queue.push([ + () => _getRawCursor(model, c, agg) + ]); + } else { + _getRawCursor(model, c, agg); + } + } +} + +/*! + * ignore + */ + +function _getRawCursor(model, aggregationCursor, agg) { + try { + let options = agg.options; + if (Object.hasOwn(options, 'middleware')) { + // `middleware` is a Mongoose-only option used to skip user hooks; strip + // it from the clone passed through to the MongoDB driver. + const { middleware, ...driverOptions } = options; + options = driverOptions; + } + const cursor = model.collection.aggregate(agg._pipeline, options); + aggregationCursor.cursor = cursor; + aggregationCursor.emit('cursor', cursor); + } catch (err) { + aggregationCursor._markError(err); + aggregationCursor.listeners('error').length > 0 && aggregationCursor.emit('error', aggregationCursor._error); + } +} + +/** +* Handles error emitted from pre middleware. In particular, checks for `skipWrappedFunction`, which allows skipping +* the actual aggregation and overwriting the function's return value. Because aggregation cursors don't return a value, +* we need to make sure the user doesn't accidentally set a value in skipWrappedFunction. +* +* @param {QueryCursor} queryCursor +* @param {Error} err +* @returns +*/ + +function _handlePreHookError(queryCursor, err) { + if (err instanceof kareem.skipWrappedFunction) { + const resultValue = err.args[0]; + if (resultValue != null && (!Array.isArray(resultValue) || resultValue.length)) { + const err = new MongooseError( + 'Cannot `skipMiddlewareFunction()` with a value when using ' + + '`.aggregate().cursor()`, value must be nullish or empty array, got "' + + util.inspect(resultValue) + + '".' + ); + queryCursor._markError(err); + queryCursor.listeners('error').length > 0 && queryCursor.emit('error', err); + return; + } + queryCursor.emit('cursor', null); + return; + } + queryCursor._markError(err); + queryCursor.listeners('error').length > 0 && queryCursor.emit('error', err); +} + + +/** + * Necessary to satisfy the Readable API + * @method _read + * @memberOf AggregationCursor + * @instance + * @api private + */ + +AggregationCursor.prototype._read = function() { + const _this = this; + _next(this, function(error, doc) { + if (error) { + return _this.emit('error', error); + } + if (!doc) { + _this.push(null); + _this.cursor.close(function(error) { + if (error) { + return _this.emit('error', error); + } + }); + return; + } + _this.push(doc); + }); +}; + +if (Symbol.asyncIterator != null) { + const msg = 'Mongoose does not support using async iterators with an ' + + 'existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation'; + + AggregationCursor.prototype[Symbol.asyncIterator] = function() { + throw new MongooseError(msg); + }; +} + +/** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or `.next()` + * + * #### Example: + * + * // Map documents returned by `data` events + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }) + * on('data', function(doc) { console.log(doc.foo); }); + * + * // Or map documents returned by `.next()` + * const cursor = Thing.find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }); + * cursor.next(function(error, doc) { + * console.log(doc.foo); + * }); + * + * @param {Function} fn + * @return {AggregationCursor} + * @memberOf AggregationCursor + * @api public + * @method map + */ + +Object.defineProperty(AggregationCursor.prototype, 'map', { + value: function(fn) { + this._transforms.push(fn); + return this; + }, + enumerable: true, + configurable: true, + writable: true +}); + +/** + * Marks this cursor as errored + * @method _markError + * @instance + * @memberOf AggregationCursor + * @api private + */ + +AggregationCursor.prototype._markError = function(error) { + this._error = error; + return this; +}; + +/** + * Marks this cursor as closed. Will stop streaming and subsequent calls to + * `next()` will error. + * + * @return {Promise} + * @api public + * @method close + * @emits "close" + * @see AggregationCursor.close https://mongodb.github.io/node-mongodb-native/7.0/classes/AggregationCursor.html#close + */ + +AggregationCursor.prototype.close = async function close() { + if (typeof arguments[0] === 'function') { + throw new MongooseError('AggregationCursor.prototype.close() no longer accepts a callback'); + } + try { + await this.cursor.close(); + } catch (error) { + this.listeners('error').length > 0 && this.emit('error', error); + throw error; + } + this.emit('close'); +}; + +/** + * Marks this cursor as destroyed. Will stop streaming and subsequent calls to + * `next()` will error. + * + * @return {this} + * @api private + * @method _destroy + */ + +AggregationCursor.prototype._destroy = function _destroy(_err, callback) { + let waitForCursor = null; + if (!this.cursor) { + waitForCursor = new Promise((resolve) => { + this.once('cursor', resolve); + }); + } else { + waitForCursor = Promise.resolve(); + } + + waitForCursor + .then(() => this.cursor.close()) + .then(() => { + this._closed = true; + callback(); + }) + .catch(error => { + callback(error); + }); + return this; +}; + +/** + * Get the next document from this cursor. Will return `null` when there are + * no documents left. + * + * @return {Promise} + * @api public + * @method next + */ + +AggregationCursor.prototype.next = async function next() { + if (typeof arguments[0] === 'function') { + throw new MongooseError('AggregationCursor.prototype.next() no longer accepts a callback'); + } + const _this = this; + const model = this.agg._model; + return cursorNextChannel.trace(function maybeTracedAggCursorNext() { + return new Promise((resolve, reject) => { + _next(_this, (err, res) => { + if (err != null) { + return reject(err); + } + resolve(res); + }); + }); + }, () => ({ + operation: 'aggregate', + collection: model?.collection?.name, + database: model?.db?.name, + serverAddress: model?.db?.host, + serverPort: model?.db?.port, + batchSize: _this.agg.options?.cursor?.batchSize, + tailable: false, + args: { + pipeline: _this.agg._pipeline, + options: _this.agg.options + } + })); +}; + +/** + * Execute `fn` for every document in the cursor. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * + * @param {Function} fn + * @param {object} [options] + * @param {number} [options.parallel] the number of promises to execute in parallel. Defaults to 1. + * @param {number} [options.batchSize=null] if set, Mongoose will call `fn` with an array of at most `batchSize` documents, instead of a single document + * @param {boolean} [options.continueOnError=false] if true, `eachAsync()` iterates through all docs even if `fn` throws an error. If false, `eachAsync()` throws an error immediately if the given function `fn()` throws an error. + * @return {Promise} + * @api public + * @method eachAsync + */ + +AggregationCursor.prototype.eachAsync = function(fn, opts) { + if (typeof arguments[2] === 'function') { + throw new MongooseError('AggregationCursor.prototype.eachAsync() no longer accepts a callback'); + } + const _this = this; + if (typeof opts === 'function') { + opts = {}; + } + opts = opts || {}; + + return eachAsync(function(cb) { return _next(_this, cb); }, fn, opts); +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js) + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example: + * + * // Async iterator without explicitly calling `cursor()`. Mongoose still + * // creates an AggregationCursor instance internally. + * const agg = Model.aggregate([{ $match: { age: { $gte: 25 } } }]); + * for await (const doc of agg) { + * console.log(doc.name); + * } + * + * // You can also use an AggregationCursor instance for async iteration + * const cursor = Model.aggregate([{ $match: { age: { $gte: 25 } } }]).cursor(); + * for await (const doc of cursor) { + * console.log(doc.name); + * } + * + * Node.js 10.x supports async iterators natively without any flags. You can + * enable async iterators in Node.js 8.x using the [`--harmony_async_iteration` flag](https://github.com/tc39/proposal-async-iteration/issues/117#issuecomment-346695187). + * + * **Note:** This function is not set if `Symbol.asyncIterator` is undefined. If + * `Symbol.asyncIterator` is undefined, that means your Node.js version does not + * support async iterators. + * + * @method [Symbol.asyncIterator] + * @memberOf AggregationCursor + * @instance + * @api public + */ + +if (Symbol.asyncIterator != null) { + AggregationCursor.prototype[Symbol.asyncIterator] = function() { + return this.transformNull()._transformForAsyncIterator(); + }; +} + +/*! + * ignore + */ + +AggregationCursor.prototype._transformForAsyncIterator = function() { + if (this._transforms.indexOf(_transformForAsyncIterator) === -1) { + this.map(_transformForAsyncIterator); + } + return this; +}; + +/*! + * ignore + */ + +AggregationCursor.prototype.transformNull = function(val) { + if (arguments.length === 0) { + val = true; + } + this._mongooseOptions.transformNull = val; + return this; +}; + +/*! + * ignore + */ + +function _transformForAsyncIterator(doc) { + return doc == null ? { done: true } : { value: doc, done: false }; +} + +/** + * Adds a [cursor flag](https://mongodb.github.io/node-mongodb-native/7.0/classes/AggregationCursor.html#addCursorFlag). + * Useful for setting the `noCursorTimeout` and `tailable` flags. + * + * @param {'tailable'|'oplogReplay'|'noCursorTimeout'|'awaitData'|'partial'} flag + * @param {boolean} value + * @return {AggregationCursor} this + * @api public + * @method addCursorFlag + */ + +AggregationCursor.prototype.addCursorFlag = function(flag, value) { + const _this = this; + _waitForCursor(this, function() { + _this.cursor.addCursorFlag(flag, value); + }); + return this; +}; + +/*! + * ignore + */ + +function _waitForCursor(ctx, cb) { + if (ctx.cursor) { + return cb(); + } + ctx.once('cursor', function() { + cb(); + }); +} + +/** + * Get the next doc from the underlying cursor and mongooseify it + * (populate, etc.) + * @param {any} ctx + * @param {Function} cb + * @api private + */ + +function _next(ctx, cb) { + let callback = cb; + if (ctx._transforms.length) { + callback = function(err, doc) { + if (err || (doc === null && !ctx._mongooseOptions.transformNull)) { + return cb(err, doc); + } + cb(err, ctx._transforms.reduce(function(doc, fn) { + return fn(doc); + }, doc)); + }; + } + + if (ctx._error) { + return immediate(function() { + callback(ctx._error); + }); + } + + if (ctx.cursor) { + return ctx.cursor.next().then( + doc => { + if (!doc) { + return callback(null, null); + } + + callback(null, doc); + }, + err => callback(err) + ); + } else { + ctx.once('error', cb); + ctx.once('cursor', function() { + _next(ctx, cb); + }); + } +} + +module.exports = AggregationCursor; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/changeStream.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/changeStream.js new file mode 100644 index 00000000..af0514dd --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/changeStream.js @@ -0,0 +1,218 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EventEmitter = require('events').EventEmitter; +const MongooseError = require('../error/mongooseError'); + +/*! + * ignore + */ + +const driverChangeStreamEvents = ['close', 'change', 'end', 'error', 'resumeTokenChanged']; + +/*! + * ignore + */ + +class ChangeStream extends EventEmitter { + constructor(changeStreamPromise, pipeline, options) { + super(); + + this.driverChangeStream = null; + this.closed = false; + this.bindedEvents = false; + this.pipeline = pipeline; + this.options = options; + this.errored = false; + + if (options?.hydrate && !options.model) { + throw new Error( + 'Cannot create change stream with `hydrate: true` ' + + 'unless calling `Model.watch()`' + ); + } + + this.$driverChangeStreamPromise = changeStreamPromise.then( + driverChangeStream => { + this.driverChangeStream = driverChangeStream; + // Use setImmediate so the stream pump (_read) has a chance to run and + // the driver cursor initializes before 'ready' resolves. Without this, + // changes emitted immediately after 'ready' can be missed because the + // underlying cursor hasn't sent its initial aggregate to MongoDB yet. + setImmediate(() => this.emit('ready')); + return this; + }, + err => { + this.errored = true; + this.emit('error', err); + throw err; + } + ); + } + + _bindEvents() { + if (this.bindedEvents) { + return; + } + + this.bindedEvents = true; + + if (this.driverChangeStream == null) { + this.$driverChangeStreamPromise.then( + () => { + this.driverChangeStream.on('close', () => { + this.closed = true; + }); + + driverChangeStreamEvents.forEach(ev => { + this.driverChangeStream.on(ev, data => { + if (data?.fullDocument != null && this.options?.hydrate) { + data.fullDocument = this.options.model.hydrate(data.fullDocument); + } + this.emit(ev, data); + }); + }); + }, + () => {} // No need to register events if opening change stream failed + ); + + return; + } + + this.driverChangeStream.on('close', () => { + this.closed = true; + }); + + driverChangeStreamEvents.forEach(ev => { + this.driverChangeStream.on(ev, data => { + if (data?.fullDocument != null && this.options?.hydrate) { + data.fullDocument = this.options.model.hydrate(data.fullDocument); + } + this.emit(ev, data); + }); + }); + } + + hasNext(cb) { + if (this.errored) { + throw new MongooseError('Cannot call hasNext() on errored ChangeStream'); + } + + if (this.driverChangeStream != null) { + return this.driverChangeStream.hasNext(cb); + } + + return this.$driverChangeStreamPromise.then( + () => this.driverChangeStream.hasNext(cb), + err => { + if (cb != null) { + return cb(err); + } + throw err; + } + ); + } + + next(cb) { + if (this.errored) { + throw new MongooseError('Cannot call next() on errored ChangeStream'); + } + if (this.options?.hydrate) { + if (cb != null) { + const originalCb = cb; + cb = (err, data) => { + if (err != null) { + return originalCb(err); + } + if (data.fullDocument != null) { + data.fullDocument = this.options.model.hydrate(data.fullDocument); + } + return originalCb(null, data); + }; + } + + let maybePromise; + if (this.driverChangeStream != null) { + maybePromise = this.driverChangeStream.next(cb); + } else { + maybePromise = this.$driverChangeStreamPromise.then( + () => this.driverChangeStream.next(cb), + err => { + if (cb != null) { + return cb(err); + } + throw err; + } + ); + } + if (typeof maybePromise?.then === 'function') { + maybePromise = maybePromise.then(data => { + if (data.fullDocument != null) { + data.fullDocument = this.options.model.hydrate(data.fullDocument); + } + return data; + }); + } + return maybePromise; + } + + if (this.driverChangeStream != null) { + return this.driverChangeStream.next(cb); + } + + return this.$driverChangeStreamPromise.then( + () => this.driverChangeStream.next(cb), + err => { + if (cb != null) { + return cb(err); + } + throw err; + } + ); + } + + addListener(event, handler) { + if (this.errored) { + throw new MongooseError('Cannot call addListener() on errored ChangeStream'); + } + this._bindEvents(); + return super.addListener(event, handler); + } + + on(event, handler) { + if (this.errored) { + throw new MongooseError('Cannot call on() on errored ChangeStream'); + } + this._bindEvents(); + return super.on(event, handler); + } + + once(event, handler) { + if (this.errored) { + throw new MongooseError('Cannot call once() on errored ChangeStream'); + } + this._bindEvents(); + return super.once(event, handler); + } + + close() { + this.closed = true; + if (this.driverChangeStream) { + return this.driverChangeStream.close(); + } else { + return this.$driverChangeStreamPromise.then( + () => this.driverChangeStream.close(), + () => {} // No need to close if opening the change stream failed + ); + } + } +} + +/*! + * ignore + */ + +module.exports = ChangeStream; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/queryCursor.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/queryCursor.js new file mode 100644 index 00000000..e1657e8b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/cursor/queryCursor.js @@ -0,0 +1,653 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('../error/mongooseError'); +const Readable = require('stream').Readable; +const eachAsync = require('../helpers/cursor/eachAsync'); +const helpers = require('../queryHelpers'); +const kareem = require('kareem'); +const immediate = require('../helpers/immediate'); +const { once } = require('events'); +const util = require('util'); +const { cursorNextChannel } = require('../tracing'); +const { buildMiddlewareFilter } = require('../helpers/buildMiddlewareFilter'); + +/** + * A QueryCursor is a concurrency primitive for processing query results + * one document at a time. A QueryCursor fulfills the Node.js streams3 API, + * in addition to several other mechanisms for loading documents from MongoDB + * one at a time. + * + * QueryCursors execute the model's pre `find` hooks before loading any documents + * from MongoDB, and the model's post `find` hooks once per document, + * with an array containing that document. + * + * Unless you're an advanced user, do **not** instantiate this class directly. + * Use [`Query#cursor()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.cursor()) instead. + * + * @param {Query} query + * @param {object} options query options passed to `.find()` + * @inherits Readable https://nodejs.org/api/stream.html#class-streamreadable + * @event `cursor`: Emitted when the cursor is created + * @event `error`: Emitted when an error occurred + * @event `data`: Emitted when the stream is flowing and the next doc is ready + * @event `end`: Emitted when the stream is exhausted + * @api public + */ + +function QueryCursor(query) { + // set autoDestroy=true because on node 12 it's by default false + // gh-10902 need autoDestroy to destroy correctly and emit 'close' event + Readable.call(this, { autoDestroy: true, objectMode: true }); + + this.cursor = null; + this.skipped = false; + this.query = query; + this._closed = false; + const model = query.model; + this._mongooseOptions = {}; + this._transforms = []; + this.model = model; + this.options = {}; + this._postMiddlewareFilter = null; + + const onPreComplete = (err) => { + if (err != null) { + if (err instanceof kareem.skipWrappedFunction) { + const resultValue = err.args[0]; + if (resultValue != null && (!Array.isArray(resultValue) || resultValue.length)) { + const err = new MongooseError( + 'Cannot `skipMiddlewareFunction()` with a value when using ' + + '`.find().cursor()`, value must be nullish or empty array, got "' + + util.inspect(resultValue) + + '".' + ); + this._markError(err); + this.listeners('error').length > 0 && this.emit('error', err); + return; + } + this.skipped = true; + this.emit('cursor', null); + return; + } + this._markError(err); + this.listeners('error').length > 0 && this.emit('error', err); + return; + } + const { middleware, ...options } = query._optionsForExec(); + Object.assign(this.options, options); + // `middleware` is a Mongoose-only option used to skip user hooks; strip it + // so it isn't passed through to the MongoDB driver. `this.options` is public + // and may be modified while pre hooks run, so check the target after assign. + if (Object.hasOwn(this.options, 'middleware')) { + delete this.options.middleware; + } + this._postMiddlewareFilter = buildMiddlewareFilter(query.options, 'post'); + this._transforms = this._transforms.concat(query._transforms.slice()); + if (this.options.transform) { + this._transforms.push(this.options.transform); + } + // Re: gh-8039, you need to set the `cursor.batchSize` option, top-level + // `batchSize` option doesn't work. + if (this.options.batchSize) { + // Max out the number of documents we'll populate in parallel at 5000. + this.options._populateBatchSize = Math.min(this.options.batchSize, 5000); + } + if (query._mongooseOptions._asyncIterator) { + this._mongooseOptions._asyncIterator = true; + } + + if (model.collection._shouldBufferCommands() && model.collection.buffer) { + model.collection.queue.push([ + () => _getRawCursor(query, this) + ]); + } else { + _getRawCursor(query, this); + } + }; + + const preFilter = buildMiddlewareFilter(query.options, 'pre'); + model.hooks.execPre('find', query, [], { filter: preFilter }).then(() => onPreComplete(null), err => onPreComplete(err)); +} + +util.inherits(QueryCursor, Readable); + +/*! + * ignore + */ + +function _getRawCursor(query, queryCursor) { + try { + const cursor = query.model.collection.find(query._conditions, queryCursor.options); + queryCursor.cursor = cursor; + queryCursor.emit('cursor', cursor); + } catch (err) { + queryCursor._markError(err); + queryCursor.listeners('error').length > 0 && queryCursor.emit('error', queryCursor._error); + } +} + +/** + * Necessary to satisfy the Readable API + * @method _read + * @memberOf QueryCursor + * @instance + * @api private + */ + +QueryCursor.prototype._read = function() { + _next(this, (error, doc) => { + if (error) { + return this.emit('error', error); + } + if (!doc) { + this.push(null); + this.cursor.close((error) => { + if (error) { + return this.emit('error', error); + } + }); + return; + } + this.push(doc); + }); +}; + +/** + * Returns the underlying cursor from the MongoDB Node driver that this cursor uses. + * + * @method getDriverCursor + * @memberOf QueryCursor + * @returns {Cursor} MongoDB Node driver cursor instance + * @instance + * @api public + */ + +QueryCursor.prototype.getDriverCursor = async function getDriverCursor() { + if (this.cursor) { + return this.cursor; + } + + await once(this, 'cursor'); + return this.cursor; +}; + +/** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or `.next()` + * + * #### Example: + * + * // Map documents returned by `data` events + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }) + * on('data', function(doc) { console.log(doc.foo); }); + * + * // Or map documents returned by `.next()` + * const cursor = Thing.find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }); + * cursor.next(function(error, doc) { + * console.log(doc.foo); + * }); + * + * @param {Function} fn + * @return {QueryCursor} + * @memberOf QueryCursor + * @api public + * @method map + */ + +Object.defineProperty(QueryCursor.prototype, 'map', { + value: function(fn) { + this._transforms.push(fn); + return this; + }, + enumerable: true, + configurable: true, + writable: true +}); + +/** + * Marks this cursor as errored + * @method _markError + * @memberOf QueryCursor + * @instance + * @api private + */ + +QueryCursor.prototype._markError = function(error) { + this._error = error; + return this; +}; + +/** + * Marks this cursor as closed. Will stop streaming and subsequent calls to + * `next()` will error. + * + * @return {Promise} + * @api public + * @method close + * @emits close + * @see AggregationCursor.close https://mongodb.github.io/node-mongodb-native/7.0/classes/AggregationCursor.html#close + */ + +QueryCursor.prototype.close = async function close() { + if (typeof arguments[0] === 'function') { + throw new MongooseError('QueryCursor.prototype.close() no longer accepts a callback'); + } + try { + await this.cursor.close(); + this._closed = true; + this.emit('close'); + } catch (error) { + this.listeners('error').length > 0 && this.emit('error', error); + throw error; + } +}; + +/** + * Marks this cursor as destroyed. Will stop streaming and subsequent calls to + * `next()` will error. + * + * @return {this} + * @api private + * @method _destroy + */ + +QueryCursor.prototype._destroy = function _destroy(_err, callback) { + let waitForCursor = null; + if (!this.cursor) { + waitForCursor = new Promise((resolve) => { + this.once('cursor', resolve); + }); + } else { + waitForCursor = Promise.resolve(); + } + + waitForCursor + .then(() => { + this.cursor.close(); + }) + .then(() => { + this._closed = true; + callback(); + }) + .catch(error => { + callback(error); + }); + return this; +}; + +/** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + * + * @return {AggregationCursor} this + * @api public + * @method rewind + */ + +QueryCursor.prototype.rewind = function() { + _waitForCursor(this, () => { + this.cursor.rewind(); + }); + return this; +}; + +/** + * Get the next document from this cursor. Will return `null` when there are + * no documents left. + * + * @return {Promise} + * @api public + * @method next + */ + +QueryCursor.prototype.next = async function next() { + if (typeof arguments[0] === 'function') { + throw new MongooseError('QueryCursor.prototype.next() no longer accepts a callback'); + } + if (this._closed) { + throw new MongooseError('Cannot call `next()` on a closed cursor'); + } + const _this = this; + return cursorNextChannel.trace(function maybeTracedQueryCursorNext() { + return new Promise((resolve, reject) => { + _next(_this, function(error, doc) { + if (error) { + return reject(error); + } + resolve(doc); + }); + }); + }, () => ({ + operation: _this.query.op || 'find', + collection: _this.query.mongooseCollection.name, + database: _this.model.db?.name, + serverAddress: _this.model.db?.host, + serverPort: _this.model.db?.port, + batchSize: _this.options.batchSize || _this.query.options?.batchSize, + tailable: _this.options.tailable || _this.query.options?.tailable || false, + args: { + filter: _this.query.getFilter(), + options: _this.query._mongooseOptions + } + })); +}; + +/** + * Execute `fn` for every document in the cursor. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * + * #### Example: + * + * // Iterate over documents asynchronously + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * eachAsync(async function (doc, i) { + * doc.foo = doc.bar + i; + * await doc.save(); + * }) + * + * @param {Function} fn + * @param {object} [options] + * @param {number} [options.parallel] the number of promises to execute in parallel. Defaults to 1. + * @param {number} [options.batchSize] if set, will call `fn()` with arrays of documents with length at most `batchSize` + * @param {boolean} [options.continueOnError=false] if true, `eachAsync()` iterates through all docs even if `fn` throws an error. If false, `eachAsync()` throws an error immediately if the given function `fn()` throws an error. + * @return {Promise} + * @api public + * @method eachAsync + */ + +QueryCursor.prototype.eachAsync = function(fn, opts) { + if (typeof arguments[2] === 'function') { + throw new MongooseError('QueryCursor.prototype.eachAsync() no longer accepts a callback'); + } + if (typeof opts === 'function') { + opts = {}; + } + opts = opts || {}; + + return eachAsync((cb) => _next(this, cb), fn, opts); +}; + +/** + * The `options` passed in to the `QueryCursor` constructor. + * + * @api public + * @property options + */ + +QueryCursor.prototype.options; + +/** + * Adds a [cursor flag](https://mongodb.github.io/node-mongodb-native/7.0/classes/FindCursor.html#addCursorFlag). + * Useful for setting the `noCursorTimeout` and `tailable` flags. + * + * @param {'tailable'|'oplogReplay'|'noCursorTimeout'|'awaitData'|'partial'} flag + * @param {boolean} value + * @return {AggregationCursor} this + * @api public + * @method addCursorFlag + */ + +QueryCursor.prototype.addCursorFlag = function(flag, value) { + _waitForCursor(this, () => { + this.cursor.addCursorFlag(flag, value); + }); + return this; +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js). + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example: + * + * // Works without using `cursor()` + * for await (const doc of Model.find([{ $sort: { name: 1 } }])) { + * console.log(doc.name); + * } + * + * // Can also use `cursor()` + * for await (const doc of Model.find([{ $sort: { name: 1 } }]).cursor()) { + * console.log(doc.name); + * } + * + * Node.js 10.x supports async iterators natively without any flags. You can + * enable async iterators in Node.js 8.x using the [`--harmony_async_iteration` flag](https://github.com/tc39/proposal-async-iteration/issues/117#issuecomment-346695187). + * + * **Note:** This function is not if `Symbol.asyncIterator` is undefined. If + * `Symbol.asyncIterator` is undefined, that means your Node.js version does not + * support async iterators. + * + * @method [Symbol.asyncIterator] + * @memberOf QueryCursor + * @instance + * @api public + */ + +if (Symbol.asyncIterator != null) { + QueryCursor.prototype[Symbol.asyncIterator] = function queryCursorAsyncIterator() { + // Set so QueryCursor knows it should transform results for async iterators into `{ value, done }` syntax + this._mongooseOptions._asyncIterator = true; + return this; + }; +} + +/** + * Get the next doc from the underlying cursor and mongooseify it + * (populate, etc.) + * @param {any} ctx + * @param {Function} cb + * @api private + */ + +function _next(ctx, cb) { + let callback = cb; + + // Create a custom callback to handle transforms, async iterator, and transformNull + callback = function(err, doc) { + if (err) { + return cb(err); + } + + // Handle null documents - if asyncIterator, we need to return `done: true`, otherwise just + // skip. In either case, avoid transforms. + if (doc === null) { + if (ctx._mongooseOptions._asyncIterator) { + return cb(null, { done: true }); + } else { + return cb(null, null); + } + } + + // Apply transforms + if (ctx._transforms.length && doc !== null) { + doc = ctx._transforms.reduce(function(doc, fn) { + return fn.call(ctx, doc); + }, doc); + } + + // This option is set in `Symbol.asyncIterator` code paths. + // For async iterator, we need to convert to {value, done} format + if (ctx._mongooseOptions._asyncIterator) { + return cb(null, { value: doc, done: false }); + } + + return cb(null, doc); + }; + + if (ctx._error) { + return immediate(function() { + callback(ctx._error); + }); + } + if (ctx.skipped) { + return immediate(() => callback(null, null)); + } + + if (ctx.cursor) { + if (ctx.query._mongooseOptions.populate && !ctx._pop) { + ctx._pop = helpers.preparePopulationOptionsMQ(ctx.query, + ctx.query._mongooseOptions); + ctx._pop.__noPromise = true; + } + if (ctx.query._mongooseOptions.populate && ctx.options._populateBatchSize > 1) { + if (ctx._batchDocs && ctx._batchDocs.length) { + // Return a cached populated doc + return _nextDoc(ctx, ctx._batchDocs.shift(), ctx._pop, callback); + } else if (ctx._batchExhausted) { + // Internal cursor reported no more docs. Act the same here + return callback(null, null); + } else { + // Request as many docs as batchSize, to populate them also in batch + ctx._batchDocs = []; + ctx.cursor.next().then( + res => { _onNext.call({ ctx, callback }, null, res); }, + err => { _onNext.call({ ctx, callback }, err); } + ); + return; + } + } else { + return ctx.cursor.next().then( + doc => { + if (!doc) { + callback(null, null); + return; + } + + if (!ctx.query._mongooseOptions.populate) { + return _nextDoc(ctx, doc, null, callback); + } + + _nextDoc(ctx, doc, ctx._pop, (err, doc) => { + if (err != null) { + return callback(err); + } + ctx.query.model.populate(doc, ctx._pop).then( + doc => callback(null, doc), + err => callback(err) + ); + }); + }, + error => { + callback(error); + } + ); + } + } else { + ctx.once('error', cb); + + ctx.once('cursor', function(cursor) { + ctx.removeListener('error', cb); + if (cursor == null) { + if (ctx.skipped) { + return cb(null, null); + } + return; + } + _next(ctx, cb); + }); + } +} + +/*! + * ignore + */ + +function _onNext(error, doc) { + if (error) { + return this.callback(error); + } + if (!doc) { + this.ctx._batchExhausted = true; + return _populateBatch.call(this); + } + + this.ctx._batchDocs.push(doc); + + if (this.ctx._batchDocs.length < this.ctx.options._populateBatchSize) { + // If both `batchSize` and `_populateBatchSize` are huge, calling `next()` repeatedly may + // cause a stack overflow. So make sure we clear the stack. + immediate(() => this.ctx.cursor.next().then( + res => { _onNext.call(this, null, res); }, + err => { _onNext.call(this, err); } + )); + } else { + _populateBatch.call(this); + } +} + +/*! + * ignore + */ + +function _populateBatch() { + if (!this.ctx._batchDocs.length) { + return this.callback(null, null); + } + this.ctx.query.model.populate(this.ctx._batchDocs, this.ctx._pop).then( + () => { + _nextDoc(this.ctx, this.ctx._batchDocs.shift(), this.ctx._pop, this.callback); + }, + err => { + this.callback(err); + } + ); +} + +/*! + * ignore + */ + +function _nextDoc(ctx, doc, pop, callback) { + if (ctx.query._mongooseOptions.lean) { + return ctx.model.hooks.execPost('find', ctx.query, [[doc]], { filter: ctx._postMiddlewareFilter }).then(() => callback(null, doc), err => callback(err)); + } + + const { model, _fields, _userProvidedFields, options } = ctx.query; + helpers.createModelAndInit(model, doc, _fields, _userProvidedFields, options, pop, (err, doc) => { + if (err != null) { + return callback(err); + } + if (options.session != null) { + doc.$session(options.session); + } + ctx.model.hooks.execPost('find', ctx.query, [[doc]], { filter: ctx._postMiddlewareFilter }).then(() => callback(null, doc), err => callback(err)); + }); +} + +/*! + * ignore + */ + +function _waitForCursor(ctx, cb) { + if (ctx.cursor) { + return cb(); + } + ctx.once('cursor', function(cursor) { + if (cursor == null) { + return; + } + cb(); + }); +} + +module.exports = QueryCursor; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/document.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/document.js new file mode 100644 index 00000000..83d2e605 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/document.js @@ -0,0 +1,5848 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const DivergentArrayError = require('./error/divergentArray'); +const EventEmitter = require('events').EventEmitter; +const InternalCache = require('./internal'); +const MongooseBuffer = require('./types/buffer'); +const MongooseError = require('./error/index'); +const MixedSchema = require('./schema/mixed'); +const ModifiedPathsSnapshot = require('./modifiedPathsSnapshot'); +const ObjectExpectedError = require('./error/objectExpected'); +const ObjectParameterError = require('./error/objectParameter'); +const ParallelValidateError = require('./error/parallelValidate'); +const PathTrie = require('./helpers/pathTrie'); +const Schema = require('./schema'); +const StrictModeError = require('./error/strict'); +const ValidationError = require('./error/validation'); +const ValidatorError = require('./error/validator'); +const $__hasIncludedChildren = require('./helpers/projection/hasIncludedChildren'); +const applyDefaults = require('./helpers/document/applyDefaults'); +const cleanModifiedSubpaths = require('./helpers/document/cleanModifiedSubpaths'); +const clone = require('./helpers/clone'); +const isInPathsToSave = require('./helpers/document/isInPathsToSave'); +const compile = require('./helpers/document/compile').compile; +const defineKey = require('./helpers/document/compile').defineKey; +const firstKey = require('./helpers/firstKey'); +const flatten = require('./helpers/common').flatten; +const getConstructorName = require('./helpers/getConstructorName'); +const getEmbeddedDiscriminatorPath = require('./helpers/document/getEmbeddedDiscriminatorPath'); +const getKeysInSchemaOrder = require('./helpers/schema/getKeysInSchemaOrder'); +const getSubdocumentStrictValue = require('./helpers/schema/getSubdocumentStrictValue'); +const handleSpreadDoc = require('./helpers/document/handleSpreadDoc'); +const isDefiningProjection = require('./helpers/projection/isDefiningProjection'); +const isExclusive = require('./helpers/projection/isExclusive'); +const isPathExcluded = require('./helpers/projection/isPathExcluded'); +const inspect = require('util').inspect; +const internalToObjectOptions = require('./options').internalToObjectOptions; +const markArraySubdocsPopulated = require('./helpers/populate/markArraySubdocsPopulated'); +const minimize = require('./helpers/minimize'); +const mpath = require('mpath'); +const parentPaths = require('./helpers/path/parentPaths'); +const queryhelpers = require('./queryHelpers'); +const { buildMiddlewareFilter } = require('./helpers/buildMiddlewareFilter'); +const utils = require('./utils'); +const isPromise = require('./helpers/isPromise'); + +const deepEqual = utils.deepEqual; +const isMongooseObject = utils.isMongooseObject; + +const applyDefaultsBeforeSettersOptions = Object.freeze({ skipParentChangeTracking: true }); + +const arrayAtomicsBackupSymbol = require('./helpers/symbols').arrayAtomicsBackupSymbol; +const arrayAtomicsSymbol = require('./helpers/symbols').arrayAtomicsSymbol; +const documentArrayParent = require('./helpers/symbols').documentArrayParent; +const documentIsModified = require('./helpers/symbols').documentIsModified; +const documentModifiedPaths = require('./helpers/symbols').documentModifiedPaths; +const documentSchemaSymbol = require('./helpers/symbols').documentSchemaSymbol; +const getSymbol = require('./helpers/symbols').getSymbol; +const modelSymbol = require('./helpers/symbols').modelSymbol; +const populateModelSymbol = require('./helpers/symbols').populateModelSymbol; +const scopeSymbol = require('./helpers/symbols').scopeSymbol; +const schemaMixedSymbol = require('./schema/symbols').schemaMixedSymbol; +const getDeepestSubdocumentForPath = require('./helpers/document/getDeepestSubdocumentForPath'); +const sessionNewDocuments = require('./helpers/symbols').sessionNewDocuments; + +let DocumentArray; +let Embedded; + +const specialProperties = utils.specialProperties; + +const VERSION_WHERE = 1; +const VERSION_INC = 2; +const VERSION_ALL = VERSION_WHERE | VERSION_INC; + +/** + * The core Mongoose document constructor. You should not call this directly, + * the Mongoose [Model constructor](./api/model.html#Model) calls this for you. + * + * @param {object} obj the values to set + * @param {object} [fields] optional object containing the fields which were selected in the query returning this document and any populated paths data + * @param {object} [options] various configuration options for the document + * @param {boolean} [options.defaults=true] if `false`, skip applying default values to this document. + * @param {boolean} [options.skipId=false] By default, Mongoose document if one is not provided and the document's schema does not override Mongoose's default `_id`. Set `skipId` to `true` to skip this generation step. + * @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#class-eventemitter + * @event `init`: Emitted on a document after it has been retrieved from the db and fully hydrated by Mongoose. + * @event `save`: Emitted when the document is successfully saved + * @api private + */ + +function Document(obj, fields, options) { + if (typeof options === 'boolean') { + throw new Error('The skipId parameter has been removed. Use { skipId: true } in the options parameter instead.'); + } + options = options == null ? {} : Object.assign({}, options); + let skipId = options.skipId; + + this.$__ = new InternalCache(); + + // Support `browserDocument.js` syntax + if (this.$__schema == null) { + const _schema = utils.isObject(fields) && !fields.instanceOfSchema ? + new Schema(fields) : + fields; + + this.$__setSchema(_schema); + fields = options; + skipId = options.skipId; + } + + // Avoid setting `isNew` to `true`, because it is `true` by default + if (options.isNew != null && options.isNew !== true) { + this.$isNew = options.isNew; + } + + if (options.priorDoc != null) { + this.$__.priorDoc = options.priorDoc; + } + + if (skipId) { + this.$__.skipId = skipId; + } + + if (obj != null && typeof obj !== 'object') { + throw new ObjectParameterError(obj, 'obj', 'Document'); + } + + let defaults = true; + if (options.defaults !== undefined) { + this.$__.defaults = options.defaults; + defaults = options.defaults; + } + + const schema = this.$__schema; + + if (typeof fields === 'boolean' || fields === 'throw') { + if (fields !== true) { + this.$__.strictMode = fields; + } + fields = undefined; + } else if (options.strict !== undefined) { + this.$__.strictMode = options.strict; + } else if (schema.options.strict !== true) { + this.$__.strictMode = schema.options.strict; + } + + const requiredPaths = schema.requiredPaths(); + for (const path of requiredPaths) { + this.$__.activePaths.require(path); + } + + let exclude = null; + + // determine if this doc is a result of a query with + // excluded fields + if (utils.isPOJO(fields) && utils.hasOwnKeys(fields)) { + exclude = isExclusive(fields); + this.$__.selected = fields; + this.$__.exclude = exclude; + } + + const hasIncludedChildren = exclude === false && fields ? + $__hasIncludedChildren(fields) : + null; + + let hasPostSetterDefaults = true; + if (this._doc == null) { + this.$__buildDoc(obj, fields, skipId, exclude, hasIncludedChildren, false); + + // By default, defaults get applied **before** setting initial values + // Re: gh-6155 + if (defaults) { + hasPostSetterDefaults = applyDefaults(this, fields, exclude, hasIncludedChildren, true, null, applyDefaultsBeforeSettersOptions); + } + } + if (obj) { + // Skip set hooks + if (this.$__original_set) { + this.$__original_set(obj, undefined, true, options); + } else { + this.$set(obj, undefined, true, options); + } + + if (obj.$__ != null && obj instanceof Document) { + this.$isNew = obj.$isNew; + } + } + + // Function defaults get applied **after** setting initial values so they + // see the full doc rather than an empty one, unless they opt out. + // Re: gh-3781, gh-6155 + if (options.willInit && defaults) { + if (options.skipDefaults) { + this.$__.skipDefaults = options.skipDefaults; + } + } else if (defaults && hasPostSetterDefaults) { + applyDefaults(this, fields, exclude, hasIncludedChildren, false, options.skipDefaults); + } + + if (!this.$__.strictMode && obj) { + const _this = this; + const keys = Object.keys(this._doc); + + keys.forEach(function(key) { + // Avoid methods, virtuals, existing fields, and `$` keys. The latter is to avoid overwriting + // Mongoose internals. + if (!(key in schema.tree) && !(key in schema.methods) && !(key in schema.virtuals) && !key.startsWith('$')) { + defineKey({ prop: key, subprops: null, prototype: _this }); + } + }); + } + + applyQueue(this); +} + +Document.prototype.$isMongooseDocumentPrototype = true; + +/** + * Boolean flag specifying if the document is new. If you create a document + * using `new`, this document will be considered "new". `$isNew` is how + * Mongoose determines whether `save()` should use `insertOne()` to create + * a new document or `updateOne()` to update an existing document. + * + * #### Example: + * + * const user = new User({ name: 'John Smith' }); + * user.$isNew; // true + * + * await user.save(); // Sends an `insertOne` to MongoDB + * + * On the other hand, if you load an existing document from the database + * using `findOne()` or another [query operation](https://mongoosejs.com/docs/queries.html), + * `$isNew` will be false. + * + * #### Example: + * + * const user = await User.findOne({ name: 'John Smith' }); + * user.$isNew; // false + * + * Mongoose sets `$isNew` to `false` immediately after `save()` succeeds. + * That means Mongoose sets `$isNew` to false **before** `post('save')` hooks run. + * In `post('save')` hooks, `$isNew` will be `false` if `save()` succeeded. + * + * #### Example: + * + * userSchema.post('save', function() { + * this.$isNew; // false + * }); + * await User.create({ name: 'John Smith' }); + * + * For subdocuments, `$isNew` is true if either the parent has `$isNew` set, + * or if you create a new subdocument. + * + * #### Example: + * + * // Assume `Group` has a document array `users` + * const group = await Group.findOne(); + * group.users[0].$isNew; // false + * + * group.users.push({ name: 'John Smith' }); + * group.users[1].$isNew; // true + * + * @api public + * @property $isNew + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, 'isNew', { + get: function() { + return this.$isNew; + }, + set: function(value) { + this.$isNew = value; + } +}); + +/** + * Hash containing current validation errors. + * + * @api public + * @property errors + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, 'errors', { + get: function() { + return this.$errors; + }, + set: function(value) { + this.$errors = value; + } +}); + +/*! + * ignore + */ + +Document.prototype.$isNew = true; + +/*! + * Document exposes the NodeJS event emitter API, so you can use + * `on`, `once`, etc. + */ +utils.each( + ['on', 'once', 'emit', 'listeners', 'removeListener', 'setMaxListeners', + 'removeAllListeners', 'addListener'], + function(emitterFn) { + Document.prototype[emitterFn] = function() { + // Delay creating emitter until necessary because emitters take up a lot of memory, + // especially for subdocuments. + if (!this.$__.emitter) { + if (emitterFn === 'emit') { + return; + } + this.$__.emitter = new EventEmitter(); + this.$__.emitter.setMaxListeners(0); + } + return this.$__.emitter[emitterFn].apply(this.$__.emitter, arguments); + }; + Document.prototype[`$${emitterFn}`] = Document.prototype[emitterFn]; + }); + +Document.prototype.constructor = Document; + +for (const i in EventEmitter.prototype) { + Document[i] = EventEmitter.prototype[i]; +} + +/** + * The document's internal schema. + * + * @api private + * @property schema + * @memberOf Document + * @instance + */ + +Document.prototype.$__schema; + +/** + * The document's schema. + * + * @api public + * @property schema + * @memberOf Document + * @instance + */ + +Document.prototype.schema; + +/** + * Empty object that you can use for storing properties on the document. This + * is handy for passing data to middleware without conflicting with Mongoose + * internals. + * + * #### Example: + * + * schema.pre('save', function() { + * // Mongoose will set `isNew` to `false` if `save()` succeeds + * this.$locals.wasNew = this.isNew; + * }); + * + * schema.post('save', function() { + * // Prints true if `isNew` was set before `save()` + * console.log(this.$locals.wasNew); + * }); + * + * @api public + * @property $locals + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, '$locals', { + configurable: false, + enumerable: false, + get: function() { + if (this.$__.locals == null) { + this.$__.locals = {}; + } + return this.$__.locals; + }, + set: function(v) { + this.$__.locals = v; + } +}); + +/** + * Legacy alias for `$isNew`. + * + * @api public + * @property isNew + * @memberOf Document + * @see $isNew https://mongoosejs.com/docs/api/document.html#Document.prototype.$isNew + * @instance + */ + +Document.prototype.isNew; + +/** + * Set this property to add additional query filters when Mongoose saves this document and `isNew` is false. + * + * #### Example: + * + * // Make sure `save()` never updates a soft deleted document. + * schema.pre('save', function() { + * this.$where = { isDeleted: false }; + * }); + * + * @api public + * @property $where + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, '$where', { + configurable: false, + enumerable: false, + writable: true +}); + +/** + * The string version of this documents _id. + * + * #### Note: + * + * This getter exists on all documents by default. The getter can be disabled by setting the `id` [option](https://mongoosejs.com/docs/guide.html#id) of its `Schema` to false at construction time. + * + * new Schema({ name: String }, { id: false }); + * + * @api public + * @see Schema options https://mongoosejs.com/docs/guide.html#options + * @property id + * @memberOf Document + * @instance + */ + +Document.prototype.id; + +/** + * Hash containing current validation $errors. + * + * @api public + * @property $errors + * @memberOf Document + * @instance + */ + +Document.prototype.$errors; + +/** + * A string containing the current operation that Mongoose is executing + * on this document. May be `null`, `'save'`, `'validate'`, or `'remove'`. + * + * #### Example: + * + * const doc = new Model({ name: 'test' }); + * doc.$op; // null + * + * const promise = doc.save(); + * doc.$op; // 'save' + * + * await promise; + * doc.$op; // null + * + * @api public + * @property $op + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, '$op', { + get: function() { + return this.$__.op || null; + }, + set: function(value) { + this.$__.op = value; + } +}); + +/*! + * ignore + */ + +function $applyDefaultsToNested(val, path, doc) { + if (val == null) { + return; + } + + const paths = Object.keys(doc.$__schema.paths); + const plen = paths.length; + + const pathPieces = path.indexOf('.') === -1 ? [path] : path.split('.'); + + for (let i = 0; i < plen; ++i) { + let curPath = ''; + const p = paths[i]; + + if (!p.startsWith(path + '.')) { + continue; + } + + const type = doc.$__schema.paths[p]; + const pieces = type.splitPath().slice(pathPieces.length); + const len = pieces.length; + + if (type.defaultValue === void 0) { + continue; + } + + let cur = val; + + for (let j = 0; j < len; ++j) { + if (cur == null) { + break; + } + + const piece = pieces[j]; + + if (j === len - 1) { + if (cur[piece] !== void 0) { + break; + } + + try { + const def = type.getDefault(doc, false); + if (def !== void 0) { + cur[piece] = def; + } + } catch (err) { + doc.invalidate(path + '.' + curPath, err); + break; + } + + break; + } + + curPath += (!curPath.length ? '' : '.') + piece; + + cur[piece] = cur[piece] || {}; + cur = cur[piece]; + } + } +} + +/** + * Builds the default doc structure + * + * @param {object} obj + * @param {object} [fields] + * @param {boolean} [skipId] + * @param {boolean} [exclude] + * @param {object} [hasIncludedChildren] + * @api private + * @method $__buildDoc + * @memberOf Document + * @instance + */ + +Document.prototype.$__buildDoc = function(obj, fields, skipId, exclude, hasIncludedChildren) { + // This function only creates intermediate objects for nested paths (e.g. + // `{ nested: {} }` for path `nested.name`), so if the schema has no nested + // paths then `_doc` starts out empty. + if (!utils.hasOwnKeys(this.$__schema.nested)) { + this._doc = {}; + return; + } + + const doc = {}; + + const paths = Object.keys(this.$__schema.paths); + const plen = paths.length; + let ii = 0; + + for (; ii < plen; ++ii) { + const p = paths[ii]; + + // Don't build up any paths that are underneath a map, we don't know + // what the keys will be + if (p.includes('$*')) { + continue; + } + + const path = this.$__schema.paths[p].splitPath(); + const len = path.length; + // This loop only creates intermediate objects for nested paths: it never + // sets any leaf values, so single-segment paths are no-ops. + if (len === 1) { + continue; + } + const last = len - 1; + let curPath = ''; + let doc_ = doc; + let included = false; + + for (let i = 0; i < len; ++i) { + const piece = path[i]; + + if (!curPath.length) { + curPath = piece; + } else { + curPath += '.' + piece; + } + + // support excluding intermediary levels + if (exclude === true) { + if (curPath in fields) { + break; + } + } else if (exclude === false && fields && !included) { + if (curPath in fields) { + included = true; + } else if (!hasIncludedChildren[curPath]) { + break; + } + } + + if (i < last) { + doc_ = doc_[piece] || (doc_[piece] = {}); + } + } + } + + this._doc = doc; +}; + +/*! + * Converts to POJO when you use the document for querying + */ + +Document.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); +}; + +/** + * Hydrates this document with the data in `doc`. Does not run setters or mark any paths modified. + * + * Called internally after a document is returned from MongoDB. Normally, + * you do **not** need to call this function on your own. + * + * This function triggers `init` [middleware](https://mongoosejs.com/docs/middleware.html). + * Note that `init` hooks are [synchronous](https://mongoosejs.com/docs/middleware.html#synchronous). + * + * @param {object} doc raw document returned by mongo + * @param {object} [opts] + * @param {boolean} [opts.hydratedPopulatedDocs=false] If true, hydrate and mark as populated any paths that are populated in the raw document + * @param {Function} [fn] + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.init = function(doc, opts, fn) { + if (typeof opts === 'function') { + fn = opts; + opts = null; + } + + if (doc == null) { + throw new ObjectParameterError(doc, 'doc', 'init'); + } + + this.$__init(doc, opts); + + if (fn) { + fn(null, this); + } + + return this; +}; + +/** + * Alias for [`.init`](https://mongoosejs.com/docs/api/document.html#Document.prototype.init()) + * + * @api public + */ + +Document.prototype.$init = function() { + return this.constructor.prototype.init.apply(this, arguments); +}; + +/** + * Internal "init" function + * + * @param {Document} doc + * @param {object} [opts] + * @returns {Document} this + * @api private + */ + +Document.prototype.$__init = function(doc, opts) { + if (doc == null) { + throw new ObjectParameterError(doc, 'doc', 'init'); + } + this.$isNew = false; + opts = opts || {}; + + // handle docs with populated paths + // If doc._id is not null or undefined + if (doc._id != null && opts.populated && opts.populated.length) { + const id = String(doc._id); + for (const item of opts.populated) { + if (item.isVirtual) { + this.$populated(item.path, utils.getValue(item.path, doc), item); + } else { + this.$populated(item.path, item._docs[id], item); + } + + if (item._childDocs == null) { + continue; + } + for (const child of item._childDocs) { + if (child?.$__ == null) { + continue; + } + child.$__.parent = this; + } + item._childDocs = []; + } + } + + init(this, doc, this._doc, opts); + + markArraySubdocsPopulated(this, opts.populated); + this.$emit('init', this); + this.constructor.emit('init', this); + + const hasIncludedChildren = this.$__.exclude === false && this.$__.selected ? + $__hasIncludedChildren(this.$__.selected) : + null; + + applyDefaults(this, this.$__.selected, this.$__.exclude, hasIncludedChildren, false, this.$__.skipDefaults); + return this; +}; + +/** + * Init helper. + * + * @param {object} self document instance + * @param {object} obj raw mongodb doc + * @param {object} doc object we are initializing + * @param {object} [opts] Optional Options + * @param {boolean} [opts.setters] Call `applySetters` instead of `cast` + * @param {string} [prefix] Prefix to add to each path + * @api private + */ + +function init(self, obj, doc, opts, prefix) { + prefix = prefix || ''; + + if (typeof obj !== 'object' || Array.isArray(obj)) { + throw new ObjectExpectedError(self.$basePath, obj); + } + + if (obj.$__ != null) { + obj = obj._doc; + } + const keys = Object.keys(obj); + const len = keys.length; + let schemaType; + let path; + let i; + const strict = self.$__.strictMode; + const docSchema = self.$__schema; + const strictRead = docSchema.options.strictRead; + + for (let index = 0; index < len; ++index) { + i = keys[index]; + // avoid prototype pollution + if (specialProperties.has(i)) { + continue; + } + path = prefix ? prefix + i : i; + schemaType = docSchema.path(path); + // Should still work if not a model-level discriminator, but should not be + // necessary. This is *only* to catch the case where we queried using the + // base model and the discriminated model has a projection + if (docSchema.$isRootDiscriminator && !self.$__isSelected(path)) { + continue; + } + + const value = obj[i]; + if (!schemaType && strictRead && docSchema.pathType(path) === 'adhocOrUndefined') { + if (strictRead === 'throw') { + throw new StrictModeError(path, 'Field `' + path + '` is not in schema and strictRead is set to throw.'); + } else if (strictRead === true) { + continue; + } + } + + if (!schemaType && utils.isPOJO(value)) { + // assume nested object + if (!doc[i]) { + doc[i] = {}; + if (!strict && !(i in docSchema.tree) && !(i in docSchema.methods) && !(i in docSchema.virtuals)) { + self[i] = doc[i]; + } else if (opts?.virtuals && (i in docSchema.virtuals)) { + self[i] = doc[i]; + } + } + init(self, value, doc[i], opts, path + '.'); + } else if (!schemaType) { + // Handle strictRead: filter unknown fields during document hydration from DB + if (strictRead === 'throw') { + throw new StrictModeError(path, 'Field `' + path + '` is not in schema and strictRead is set to throw.'); + } else if (strictRead === true) { + // Skip this field - do not store in _doc + continue; + } + doc[i] = value; + if (!strict && !prefix) { + self[i] = value; + } else if (opts?.virtuals && (i in docSchema.virtuals)) { + self[i] = value; + } else if (opts?.strict === 'throw') { + // Only use strict: 'throw' semantics if explicit `strict: 'throw'` option + // passed in, like via `MyModel.hydrate(obj, null, { strict: 'throw' })` + // This is for backwards compatibility - strict: 'throw' at the schema level + // does not apply to documents loaded from the db. + throw new StrictModeError(i); + } + } else { + // Retain order when overwriting defaults + if (Object.hasOwn(doc, i) && value !== void 0 && !opts.hydratedPopulatedDocs) { + delete doc[i]; + } + if (value === null) { + doc[i] = schemaType._castNullish(null); + } else if (value !== undefined) { + const wasPopulated = value.$__ == null ? null : value.$__.wasPopulated; + + if (schemaType && !wasPopulated && !opts.hydratedPopulatedDocs) { + try { + if (opts?.setters) { + // Call applySetters with `init = false` because otherwise setters are a noop + const overrideInit = false; + doc[i] = schemaType.applySetters(value, self, overrideInit, null, opts); + } else { + doc[i] = schemaType.cast(value, self, true, undefined, opts); + } + } catch (e) { + self.invalidate(e.path, new ValidatorError({ + path: e.path, + message: e.message, + type: 'cast', + value: e.value, + reason: e + })); + } + } else if (schemaType && opts.hydratedPopulatedDocs) { + doc[i] = schemaType.cast(value, self, true, undefined, { hydratedPopulatedDocs: true }); + + if (doc[i]?.$__?.wasPopulated) { + self.$populated(path, doc[i].$__.wasPopulated.value, doc[i].$__.wasPopulated.options); + } else if (Array.isArray(doc[i]) && doc[i].length && doc[i][0]?.$__?.wasPopulated) { + self.$populated(path, doc[i].map(populatedDoc => populatedDoc?.$__?.wasPopulated?.value).filter(val => val != null), doc[i][0].$__.wasPopulated.options); + } + } else { + doc[i] = value; + } + } + // mark as hydrated + if (!self.$isModified(path)) { + self.$__.activePaths.init(path); + } + } + } +} + +/** + * Sends an updateOne command with this document `_id` as the query selector. + * + * #### Example: + * + * weirdCar.updateOne({$inc: {wheels:1}}, { w: 1 }); + * + * #### Valid options: + * + * - same as in [Model.updateOne](https://mongoosejs.com/docs/api/model.html#Model.updateOne) + * + * @see Model.updateOne https://mongoosejs.com/docs/api/model.html#Model.updateOne + * @param {object} update + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and the [Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @return {Query} + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.updateOne = function updateOne(update, options) { + const query = this.constructor.updateOne(); + const self = this; + query.pre(async function queryPreUpdateOne() { + const res = await self._execDocumentPreHooks('updateOne', options, [self, update, options]); + // `self` is passed to pre hooks as argument for backwards compatibility, but that + // isn't the actual arguments passed to the wrapped function. + if (res[0] !== self || res[1] !== update || res[2] !== options) { + throw new Error('Document updateOne pre hooks cannot overwrite arguments'); + } + query.updateOne({ _id: self._doc._id }, update, options); + // Apply custom where conditions _after_ document updateOne middleware for + // consistency with save() - sharding plugin needs to set $where + if (self.$where != null) { + this.where(self.$where); + } + if (self.$session() != null) { + if (!('session' in query.options)) { + query.options.session = self.$session(); + } + } + return res; + }); + query.post(function queryPostUpdateOne() { + return self._execDocumentPostHooks('updateOne', options); + }); + + return query; +}; + +/** + * Sends a replaceOne command with this document `_id` as the query selector. + * + * #### Valid options: + * + * - same as in [Model.replaceOne](https://mongoosejs.com/docs/api/model.html#Model.replaceOne()) + * + * @see Model.replaceOne https://mongoosejs.com/docs/api/model.html#Model.replaceOne() + * @param {object} doc + * @param {object} [options] + * @param {Function} [callback] + * @return {Query} + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.replaceOne = function replaceOne() { + const args = [...arguments]; + args.unshift({ _id: this._doc._id }); + return this.constructor.replaceOne.apply(this.constructor, args); +}; + +/** + * Getter/setter around the session associated with this document. Used to + * automatically set `session` if you `save()` a doc that you got from a + * query with an associated session. + * + * #### Example: + * + * const session = MyModel.startSession(); + * const doc = await MyModel.findOne().session(session); + * doc.$session() === session; // true + * doc.$session(null); + * doc.$session() === null; // true + * + * If this is a top-level document, setting the session propagates to all child + * docs. + * + * @param {ClientSession} [session] overwrite the current session + * @return {ClientSession} + * @method $session + * @api public + * @memberOf Document + */ + +Document.prototype.$session = function $session(session) { + if (arguments.length === 0) { + if (this.$__.session?.hasEnded) { + this.$__.session = null; + return null; + } + return this.$__.session; + } + + if (session?.hasEnded) { + throw new MongooseError('Cannot set a document\'s session to a session that has ended. Make sure you haven\'t ' + + 'called `endSession()` on the session you are passing to `$session()`.'); + } + + if (session == null && this.$__.session == null) { + return; + } + + this.$__.session = session; + + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + child.$session(session); + } + } + + return session; +}; + +/** + * Getter/setter around whether this document will apply timestamps by + * default when using `save()` and `bulkSave()`. + * + * #### Example: + * + * const TestModel = mongoose.model('Test', new Schema({ name: String }, { timestamps: true })); + * const doc = new TestModel({ name: 'John Smith' }); + * + * doc.$timestamps(); // true + * + * doc.$timestamps(false); + * await doc.save(); // Does **not** apply timestamps + * + * @param {boolean} [value] overwrite the current session + * @return {Document|boolean|undefined} When used as a getter (no argument), a boolean will be returned indicating the timestamps option state or if unset "undefined" will be used, otherwise will return "this" + * @method $timestamps + * @api public + * @memberOf Document + */ + +Document.prototype.$timestamps = function $timestamps(value) { + if (arguments.length === 0) { + if (this.$__.timestamps != null) { + return this.$__.timestamps; + } + + if (this.$__schema) { + return this.$__schema.options.timestamps; + } + + return undefined; + } + + const currentValue = this.$timestamps(); + if (value !== currentValue) { + this.$__.timestamps = value; + } + + return this; +}; + +/** + * Overwrite all values in this document with the values of `obj`, except + * for immutable properties. Behaves similarly to `set()`, except for it + * unsets all properties that aren't in `obj`. + * + * @param {object} obj the object to overwrite this document with + * @method overwrite + * @memberOf Document + * @instance + * @api public + * @return {Document} this + */ + +Document.prototype.overwrite = function overwrite(obj) { + const keys = new Set(Object.keys(this._doc)); + for (const key of Object.keys(obj)) { + keys.add(key); + } + + const schemaOptions = this.$__schema.options; + for (const key of keys) { + if (key === '_id') { + continue; + } + // Explicitly skip version key + if (schemaOptions.versionKey && key === schemaOptions.versionKey) { + continue; + } + if (schemaOptions.discriminatorKey && key === schemaOptions.discriminatorKey) { + continue; + } + this.$set(key, obj[key]); + } + + return this; +}; + +/** + * Alias for `set()`, used internally to avoid conflicts + * + * @param {string|object} path path or object of key/vals to set + * @param {any} val the value to set + * @param {Schema|string|number|Buffer|any} [type] optionally specify a type for "on-the-fly" attributes + * @param {object} [options] optionally specify options that modify the behavior of the set + * @param {boolean} [options.merge=false] if true, setting a [nested path](https://mongoosejs.com/docs/subdocs.html#subdocuments-versus-nested-paths) will merge existing values rather than overwrite the whole object. So `doc.set('nested', { a: 1, b: 2 })` becomes `doc.set('nested.a', 1); doc.set('nested.b', 2);` + * @return {Document} this + * @method $set + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.$set = function $set(path, val, type, options) { + if (utils.isPOJO(type)) { + options = type; + type = undefined; + } + + const merge = options?.merge; + const adhoc = type && type !== true; + const constructing = type === true; + let adhocs; + let keys; + let i = 0; + let pathtype; + let key; + let prefix; + + const userSpecifiedStrict = options && 'strict' in options; + let strict = userSpecifiedStrict + ? options.strict + : this.$__.strictMode; + + if (adhoc) { + adhocs = this.$__.adhocPaths || (this.$__.adhocPaths = {}); + adhocs[path] = this.$__schema.interpretAsType(path, type, this.$__schema.options); + } + + if (path == null) { + [path, val] = [val, path]; + } else if (typeof path !== 'string') { + // new Document({ key: val }) + if (path instanceof Document) { + if (path.$__isNested) { + path = path.toObject(); + } else { + // This ternary is to support gh-7898 (copying virtuals if same schema) + // while not breaking gh-10819, which for some reason breaks if we use toObject() + path = path.$__schema === this.$__schema + ? applyVirtuals(path, { ...path._doc }) + : path._doc; + } + } + if (path == null) { + [path, val] = [val, path]; + } + + prefix = val ? val + '.' : ''; + keys = getKeysInSchemaOrder(this.$__schema, path); + + const len = keys.length; + + // `_skipMinimizeTopLevel` is because we may have deleted the top-level + // nested key to ensure key order. + const _skipMinimizeTopLevel = options?._skipMinimizeTopLevel || false; + if (len === 0 && _skipMinimizeTopLevel) { + delete options._skipMinimizeTopLevel; + if (val) { + this.$set(val, {}); + } + return this; + } + + // Only need to clone if we're overwriting `_skipMinimizeTopLevel`, recursive + // calls treat a missing `_skipMinimizeTopLevel` as `false` + if (_skipMinimizeTopLevel) { + options = Object.assign({}, options, { _skipMinimizeTopLevel: false }); + } + + for (let i = 0; i < len; ++i) { + key = keys[i]; + const pathName = prefix ? prefix + key : key; + pathtype = this.$__schema.pathType(pathName); + const valForKey = path[key]; + + // On initial set, delete any nested keys if we're going to overwrite + // them to ensure we keep the user's key order. + if (type === true && + !prefix && + valForKey != null && + pathtype === 'nested' && + this._doc[key] != null) { + delete this._doc[key]; + } + + if (utils.isNonBuiltinObject(valForKey) && pathtype === 'nested') { + this.$set(pathName, valForKey, constructing, options); + $applyDefaultsToNested(this.$get(pathName), pathName, this); + continue; + } else if (strict) { + // Don't overwrite defaults with undefined keys (gh-3981) (gh-9039) + if (constructing && valForKey === void 0 && + this.$get(pathName) !== void 0) { + continue; + } + + if (pathtype === 'adhocOrUndefined') { + pathtype = getEmbeddedDiscriminatorPath(this, pathName, { typeOnly: true }); + } + + if (pathtype === 'real' || pathtype === 'virtual') { + this.$set(pathName, valForKey, constructing, options); + } else if (pathtype === 'nested' && valForKey instanceof Document) { + this.$set(pathName, + valForKey.toObject({ transform: false }), constructing, options); + } else if (strict === 'throw') { + if (pathtype === 'nested') { + throw new ObjectExpectedError(key, valForKey); + } else { + throw new StrictModeError(key); + } + } else if (pathtype === 'nested' && valForKey == null) { + this.$set(pathName, valForKey, constructing, options); + } + } else { + this.$set(pathName, valForKey, constructing, options); + } + } + + // Ensure all properties are in correct order + const orderedDoc = {}; + const orderedKeys = Object.keys(this.$__schema.tree); + for (let i = 0, len = orderedKeys.length; i < len; ++i) { + (key = orderedKeys[i]) && + (Object.hasOwn(this._doc, key)) && + (orderedDoc[key] = undefined); + } + this._doc = Object.assign(orderedDoc, this._doc); + + return this; + } + + let pathType = this.$__schema.pathType(path); + let parts = null; + if (pathType === 'adhocOrUndefined') { + parts = path.indexOf('.') === -1 ? [path] : path.split('.'); + pathType = getEmbeddedDiscriminatorPath(this, parts, { typeOnly: true }); + } + if (pathType === 'adhocOrUndefined' && !userSpecifiedStrict) { + // May be path underneath non-strict schema + if (parts == null) { + parts = path.indexOf('.') === -1 ? [path] : path.split('.'); + } + const subdocStrict = getSubdocumentStrictValue(this.$__schema, parts); + if (subdocStrict !== undefined) { + strict = subdocStrict; + } + } + + // Assume this is a Mongoose document that was copied into a POJO using + // `Object.assign()` or `{...doc}` + val = handleSpreadDoc(val, true); + + // if this doc is being constructed we should not trigger getters + const priorVal = this.$__.priorDoc != null ? + this.$__.priorDoc.$__getValue(path) : + (constructing ? void 0 : this.$__getValue(path)); + + if (pathType === 'nested' && val) { + if (typeof val === 'object' && val != null) { + if (val.$__ != null) { + val = val.toObject(internalToObjectOptions); + } + if (val == null) { + this.invalidate(path, new MongooseError.CastError('Object', val, path)); + return this; + } + const wasModified = this.$isModified(path); + const hasInitialVal = this.$__.savedState != null && Object.hasOwn(this.$__.savedState, path); + if (this.$__.savedState != null && !this.$isNew && !Object.hasOwn(this.$__.savedState, path)) { + const initialVal = this.$__getValue(path); + this.$__.savedState[path] = initialVal; + + const keys = Object.keys(initialVal || {}); + for (const key of keys) { + this.$__.savedState[path + '.' + key] = initialVal[key]; + } + } + + if (!merge) { + this.$__setValue(path, null); + cleanModifiedSubpaths(this, path); + } else { + return this.$set(val, path, constructing, options); + } + + const keys = getKeysInSchemaOrder(this.$__schema, val, path); + + this.$__setValue(path, {}); + for (const key of keys) { + this.$set(path + '.' + key, val[key], constructing, { ...options, _skipMarkModified: true }); + } + if (priorVal != null && + (!wasModified || hasInitialVal) && + utils.deepEqual(hasInitialVal ? this.$__.savedState[path] : priorVal, val)) { + this.unmarkModified(path); + } else { + this.markModified(path); + } + return this; + } + this.invalidate(path, new MongooseError.CastError('Object', val, path)); + return this; + } + + let schema; + if (parts == null) { + parts = path.indexOf('.') === -1 ? [path] : path.split('.'); + } + + // Might need to change path for top-level alias + if (typeof this.$__schema.aliases[parts[0]] === 'string') { + parts[0] = this.$__schema.aliases[parts[0]]; + } + + if (pathType === 'adhocOrUndefined' && strict) { + // check for roots that are Mixed types + let mixed; + + for (i = 0; i < parts.length; ++i) { + const subpath = parts.slice(0, i + 1).join('.'); + + // If path is underneath a virtual, bypass everything and just set it. + if (i + 1 < parts.length && this.$__schema.pathType(subpath) === 'virtual') { + mpath.set(path, val, this); + return this; + } + + schema = this.$__schema.path(subpath); + if (schema == null) { + continue; + } + + if (schema instanceof MixedSchema) { + // allow changes to sub paths of mixed types + mixed = true; + break; + } else if (schema.$isSchemaMap && schema.$__schemaType instanceof MixedSchema && i < parts.length - 1) { + // Map of mixed and not the last element in the path resolves to mixed + mixed = true; + schema = schema.$__schemaType; + break; + } + } + + if (schema == null) { + // Check for embedded discriminators + schema = getEmbeddedDiscriminatorPath(this, path); + } + + if (!mixed && !schema) { + if (strict === 'throw') { + throw new StrictModeError(path); + } + return this; + } + } else if (pathType === 'virtual') { + schema = this.$__schema.virtualpath(path); + schema.applySetters(val, this); + return this; + } else { + schema = this.$__path(path); + } + + // gh-4578, if setting a deeply nested path that doesn't exist yet, create it + let cur = this._doc; + let curPath = ''; + for (i = 0; i < parts.length - 1; ++i) { + cur = cur instanceof Map ? cur.get(parts[i]) : cur[parts[i]]; + curPath += (curPath.length !== 0 ? '.' : '') + parts[i]; + if (!cur) { + this.$set(curPath, {}); + // Hack re: gh-5800. If nested field is not selected, it probably exists + // so `MongoServerError: cannot use the part (nested of nested.num) to + // traverse the element ({nested: null})` is not likely. If user gets + // that error, its their fault for now. We should reconsider disallowing + // modifying not selected paths for 6.x + if (!this.$__isSelected(curPath)) { + this.unmarkModified(curPath); + } + cur = this.$__getValue(curPath); + } + } + + let pathToMark; + + // When using the $set operator the path to the field must already exist. + // Else mongodb throws: "LEFT_SUBFIELD only supports Object" + + if (parts.length <= 1) { + pathToMark = path; + } else { + const len = parts.length; + for (i = 0; i < len; ++i) { + const subpath = parts.slice(0, i + 1).join('.'); + if (this.$get(subpath, null, { getters: false }) === null) { + pathToMark = subpath; + break; + } + } + + if (!pathToMark) { + pathToMark = path; + } + } + + if (!schema) { + this.$__set(pathToMark, path, options, constructing, parts, schema, val, priorVal); + + if (pathType === 'nested' && val == null) { + cleanModifiedSubpaths(this, path); + } + return this; + } + + // If overwriting a subdocument path, make sure to clear out + // any errors _before_ setting, so new errors that happen + // get persisted. Re: #9080 + if (schema.$isSingleNested || schema.$isMongooseArray) { + _markValidSubpaths(this, path); + } + + if (val != null && merge && schema.$isSingleNested) { + if (val instanceof Document) { + val = val.toObject({ virtuals: false, transform: false }); + } + const keys = Object.keys(val); + for (const key of keys) { + this.$set(path + '.' + key, val[key], constructing, options); + } + + return this; + } + + let shouldSet = true; + try { + // If the user is trying to set a ref path to a document with + // the correct model name, treat it as populated + const refMatches = !(val instanceof Document) ? false : (() => { + if (schema.options == null) { + return false; + } + const model = val.constructor; + + // Check ref + const refOpt = typeof schema.options.ref === 'function' && !schema.options.ref[modelSymbol] ? schema.options.ref.call(this, this) : schema.options.ref; + + const ref = refOpt?.modelName || refOpt; + if (ref != null && (ref === model.modelName || ref === model.baseModelName)) { + return true; + } + + // Check refPath + let refPath = schema.options.refPath; + if (refPath == null) { + return false; + } + + if (typeof refPath === 'function' && !refPath[modelSymbol]) { + let fullPath = path; + const fullPathWithIndexes = this.$__fullPathWithIndexes?.(); + if (fullPathWithIndexes?.length) { + fullPath = fullPathWithIndexes + '.' + path; + } + refPath = refPath.call(this, this, fullPath); + } + + if (typeof refPath !== 'string') { + throw new MongooseError('`refPath` must be a string or a function that returns a string, got ' + inspect(refPath)); + } + + const modelName = this.ownerDocument().get(refPath); + return modelName === model.modelName || modelName === model.baseModelName; + })(); + + let didPopulate = false; + if (refMatches && val instanceof Document && (!val.$__.wasPopulated || utils.deepEqual(val.$__.wasPopulated.value, val._doc._id))) { + const unpopulatedValue = schema?.$isSingleNested ? schema.cast(val, this) : val._doc._id; + this.$populated(path, unpopulatedValue, { [populateModelSymbol]: val.constructor }); + val.$__.wasPopulated = { value: unpopulatedValue }; + didPopulate = true; + } + + let popOpts; + const typeKey = this.$__schema.options.typeKey; + if (schema.options && + Array.isArray(schema.options[typeKey]) && + schema.options[typeKey].length && + schema.options[typeKey][0] && + schema.options[typeKey][0].ref && + _isManuallyPopulatedArray(val, schema.options[typeKey][0].ref)) { + popOpts = { [populateModelSymbol]: val[0].constructor }; + this.$populated(path, val.map(function(v) { return v._doc._id; }), popOpts); + + for (const doc of val) { + doc.$__.wasPopulated = { value: doc._doc._id }; + } + didPopulate = true; + } + + if (!refMatches || !schema.$isSingleNested || !val.$__) { + // If this path is underneath a single nested schema, we'll call the setter + // later in `$__set()` because we don't take `_doc` when we iterate through + // a single nested doc. That's to make sure we get the correct context. + // Otherwise we would double-call the setter, see gh-7196. + let setterContext = this; + if (this.$__schema.singleNestedPaths[path] != null && parts.length > 1) { + setterContext = getDeepestSubdocumentForPath(this, parts, this.schema); + } + if (options?.overwriteImmutable) { + val = schema.applySetters(val, setterContext, false, priorVal, { path, overwriteImmutable: true }); + } else { + val = schema.applySetters(val, setterContext, false, priorVal, { path }); + } + } + + if (Array.isArray(val) && + !Array.isArray(schema) && + schema.$isMongooseDocumentArray && + val.length !== 0 && + val[0]?.$__?.populated != null) { + const populatedPaths = Object.keys(val[0].$__.populated); + for (const populatedPath of populatedPaths) { + this.$populated(path + '.' + populatedPath, + val.map(v => v.$populated(populatedPath)), + val[0].$__.populated[populatedPath].options); + } + didPopulate = true; + } + + if (!didPopulate && this.$__.populated) { + // If this array partially contains populated documents, convert them + // all to ObjectIds re: #8443 + if (Array.isArray(val) && this.$__.populated[path]) { + for (let i = 0; i < val.length; ++i) { + if (val[i] instanceof Document) { + val.set(i, val[i]._doc._id, true); + } + } + } + delete this.$__.populated[path]; + } + + if (val != null && schema.$isSingleNested) { + _checkImmutableSubpaths(val, schema, priorVal); + } + + this.$markValid(path); + } catch (e) { + if (e instanceof MongooseError.StrictModeError && e.isImmutableError) { + this.invalidate(path, e); + } else if (e instanceof MongooseError.CastError) { + this.invalidate(e.path, e); + if (e.$originalErrorPath) { + this.invalidate(path, + new MongooseError.CastError(schema.instance, val, path, e.$originalErrorPath)); + } + } else { + this.invalidate(path, + new MongooseError.CastError(schema.instance, val, path, e)); + } + shouldSet = false; + } + + if (shouldSet) { + let savedState = null; + let savedStatePath = null; + if (!constructing) { + const doc = this.$isSubdocument ? this.ownerDocument() : this; + savedState = doc.$__.savedState; + savedStatePath = this.$isSubdocument ? this.$__.fullPath + '.' + path : path; + doc.$__saveInitialState(savedStatePath); + } + + this.$__set(pathToMark, path, options, constructing, parts, schema, val, priorVal); + + const isInTransaction = !!this.$__.session?.transaction; + const isModifiedWithinTransaction = this.$__.session && + this.$__.session[sessionNewDocuments] && + this.$__.session[sessionNewDocuments].has(this) && + this.$__.session[sessionNewDocuments].get(this).modifiedPaths && + !this.$__.session[sessionNewDocuments].get(this).modifiedPaths.has(savedStatePath); + if (savedState != null && + Object.hasOwn(savedState, savedStatePath) && + (!isInTransaction || isModifiedWithinTransaction) && + utils.deepEqual(val, savedState[savedStatePath])) { + this.unmarkModified(path); + } + } + + if (schema.$isSingleNested && (this.isDirectModified(path) || val == null)) { + cleanModifiedSubpaths(this, path); + } else if (schema.$isSchemaMap && val == null) { + cleanModifiedSubpaths(this, path); + } + + return this; +}; + +/*! + * ignore + */ + +function _isManuallyPopulatedArray(val, ref) { + if (!Array.isArray(val)) { + return false; + } + if (val.length === 0) { + return false; + } + + for (const el of val) { + if (!(el instanceof Document)) { + return false; + } + const modelName = el.constructor.modelName; + if (modelName == null) { + return false; + } + if (el.constructor.modelName != ref && el.constructor.baseModelName != ref) { + return false; + } + } + + return true; +} + +/** + * Sets the value of a path, or many paths. + * Alias for [`.$set`](https://mongoosejs.com/docs/api/document.html#Document.prototype.$set()). + * + * #### Example: + * + * // path, value + * doc.set(path, value) + * + * // object + * doc.set({ + * path : value + * , path2 : { + * path : value + * } + * }) + * + * // on-the-fly cast to number + * doc.set(path, value, Number) + * + * // on-the-fly cast to string + * doc.set(path, value, String) + * + * // changing strict mode behavior + * doc.set(path, value, { strict: false }); + * + * @param {string|object} path path or object of key/vals to set + * @param {any} val the value to set + * @param {Schema|string|number|Buffer|any} [type] optionally specify a type for "on-the-fly" attributes + * @param {object} [options] optionally specify options that modify the behavior of the set + * @return {Document} this + * @api public + * @method set + * @memberOf Document + * @instance + */ + +Document.prototype.set = Document.prototype.$set; + +/** + * Determine if we should mark this change as modified. + * + * @param {never} pathToMark UNUSED + * @param {string|symbol} path + * @param {object} options + * @param {any} constructing + * @param {never} parts UNUSED + * @param {Schema} schema + * @param {any} val + * @param {any} priorVal + * @return {boolean} + * @api private + * @method $__shouldModify + * @memberOf Document + * @instance + */ + +Document.prototype.$__shouldModify = function(pathToMark, path, options, constructing, parts, schema, val, priorVal) { + if (options?._skipMarkModified) { + return false; + } + if (this.$isNew) { + return true; + } + // Is path already modified? If so, always modify. We may unmark modified later. + if (path in this.$__.activePaths.getStatePaths('modify')) { + return true; + } + + if (val === void 0 && !this.$__isSelected(path)) { + // when a path is not selected in a query, its initial + // value will be undefined. + return true; + } + + if (val === void 0 && path in this.$__.activePaths.getStatePaths('default')) { + // we're just unsetting the default value which was never saved + return false; + } + + // gh-3992: if setting a populated field to a doc, don't mark modified + // if they have the same _id + if (this.$populated(path) && + val instanceof Document && + deepEqual(val._doc._id, priorVal)) { + return false; + } + + if (!deepEqual(val, priorVal !== undefined ? priorVal : utils.getValue(path, this))) { + return true; + } + + if (!constructing && + val !== null && + val !== undefined && + path in this.$__.activePaths.getStatePaths('default') && + deepEqual(val, schema.getDefault(this, constructing))) { + // a path with a default was $unset on the server + // and the user is setting it to the same value again + return true; + } + return false; +}; + +/** + * Handles the actual setting of the value and marking the path modified if appropriate. + * + * @param {string} pathToMark + * @param {string|symbol} path + * @param {object} options + * @param {any} constructing + * @param {Array} parts + * @param {Schema} schema + * @param {any} val + * @param {any} priorVal + * @api private + * @method $__set + * @memberOf Document + * @instance + */ + +Document.prototype.$__set = function(pathToMark, path, options, constructing, parts, schema, val, priorVal) { + Embedded = Embedded || require('./types/arraySubdocument'); + + const shouldModify = this.$isNew && !options?._skipMarkModified ? + true : + this.$__shouldModify(pathToMark, path, options, constructing, parts, schema, val, priorVal); + + if (shouldModify) { + if (this.$__.primitiveAtomics?.[path]) { + delete this.$__.primitiveAtomics[path]; + if (utils.hasOwnKeys(this.$__.primitiveAtomics) === false) { + delete this.$__.primitiveAtomics; + } + } + this.markModified(pathToMark); + + // handle directly setting arrays (gh-1126) + if (val && utils.isMongooseArray(val)) { + val._registerAtomic('$set', val); + + // Update embedded document parent references (gh-5189) + if (utils.isMongooseDocumentArray(val)) { + val.forEach(function(item) { + item && item.__parentArray && (item.__parentArray = val); + }); + } + } + } else if (Array.isArray(val) && Array.isArray(priorVal) && utils.isMongooseArray(val) && utils.isMongooseArray(priorVal)) { + val[arrayAtomicsSymbol] = priorVal[arrayAtomicsSymbol]; + val[arrayAtomicsBackupSymbol] = priorVal[arrayAtomicsBackupSymbol]; + if (utils.isMongooseDocumentArray(val)) { + val.forEach(doc => { + if (doc != null) { + doc.$isNew = false; + } + }); + } + } + + let obj = this._doc; + let i = 0; + const l = parts.length; + let cur = ''; + + for (; i < l; i++) { + const next = i + 1; + const last = next === l; + cur += (cur ? '.' + parts[i] : parts[i]); + if (specialProperties.has(parts[i])) { + continue; + } + + if (last) { + if (obj instanceof Map) { + obj.set(parts[i], val); + } else if (obj.$isSingleNested) { + if (!(parts[i] in obj)) { + obj[parts[i]] = val; + obj._doc[parts[i]] = val; + } else { + obj._doc[parts[i]] = val; + } + if (shouldModify) { + obj.markModified(parts[i]); + } + } else { + obj[parts[i]] = val; + } + } else { + const isMap = obj instanceof Map; + let value = isMap ? obj.get(parts[i]) : obj[parts[i]]; + if (utils.isPOJO(value)) { + obj = value; + } else if (value && value instanceof Embedded) { + obj = value; + } else if (value && !Array.isArray(value) && value.$isSingleNested) { + obj = value; + } else if (value && Array.isArray(value)) { + obj = value; + } else if (value == null) { + value = {}; + if (isMap) { + obj.set(parts[i], value); + } else { + obj[parts[i]] = value; + } + obj = value; + } else { + obj = value; + } + } + } +}; + +/** + * Gets a raw value from a path (no getters) + * + * @param {string} path + * @return {any} Returns the value from the given `path`. + * @api private + */ + +Document.prototype.$__getValue = function(path) { + if (typeof path !== 'string' && !Array.isArray(path)) { + throw new TypeError( + `Invalid \`path\`. Must be either string or array. Got "${path}" (type ${typeof path})` + ); + } + return utils.getValue(path, this._doc); +}; + +/** + * Increments the numeric value at `path` by the given `val`. + * When you call `save()` on this document, Mongoose will send a + * [`$inc`](https://www.mongodb.com/docs/manual/reference/operator/update/inc/) + * as opposed to a `$set`. + * + * #### Example: + * + * const schema = new Schema({ counter: Number }); + * const Test = db.model('Test', schema); + * + * const doc = await Test.create({ counter: 0 }); + * doc.$inc('counter', 2); + * await doc.save(); // Sends a `{ $inc: { counter: 2 } }` to MongoDB + * doc.counter; // 2 + * + * doc.counter += 2; + * await doc.save(); // Sends a `{ $set: { counter: 2 } }` to MongoDB + * + * @param {string|Array} path path or paths to update + * @param {number} val increment `path` by this value + * @return {Document} this + */ + +Document.prototype.$inc = function $inc(path, val) { + if (val == null) { + val = 1; + } + + if (Array.isArray(path)) { + path.forEach((p) => this.$inc(p, val)); + return this; + } + + const schemaType = this.$__path(path); + if (schemaType == null) { + if (this.$__.strictMode === 'throw') { + throw new StrictModeError(path); + } else if (this.$__.strictMode === true) { + return this; + } + } else if (schemaType.instance !== 'Number') { + this.invalidate(path, new MongooseError.CastError(schemaType.instance, val, path)); + return this; + } + + const currentValue = this.$__getValue(path) || 0; + let shouldSet = false; + let valToSet = null; + let valToInc = val; + + try { + val = schemaType.cast(val); + valToSet = schemaType.applySetters(currentValue + val, this); + valToInc = valToSet - currentValue; + shouldSet = true; + } catch (err) { + this.invalidate(path, new MongooseError.CastError('number', val, path, err)); + } + + if (shouldSet) { + this.$__.primitiveAtomics = this.$__.primitiveAtomics || {}; + if (this.$__.primitiveAtomics[path] == null) { + this.$__.primitiveAtomics[path] = { $inc: valToInc }; + } else { + this.$__.primitiveAtomics[path].$inc += valToInc; + } + this.markModified(path); + this.$__setValue(path, valToSet); + } + + return this; +}; + +/** + * Sets a raw value for a path (no casting, setters, transformations) + * + * @param {string} path + * @param {object} value + * @return {Document} this + * @api private + */ + +Document.prototype.$__setValue = function $__setValue(path, val) { + if (Array.isArray(path) && path.length === 1) { + // Fast path: if pre-split paths array of length 1, avoid all + // setValue overhead and just set the value directly. + this._doc[path[0]] = val; + return this; + } + utils.setValue(path, val, this._doc); + return this; +}; + +/** + * Returns the value of a path. + * + * #### Example: + * + * // path + * doc.get('age') // 47 + * + * // dynamic casting to a string + * doc.get('age', String) // "47" + * + * @param {string} path + * @param {Schema|string|number|Buffer|any} [type] optionally specify a type for on-the-fly attributes + * @param {object} [options] + * @param {boolean} [options.virtuals=false] Apply virtuals before getting this path + * @param {boolean} [options.getters=true] If false, skip applying getters and just get the raw value + * @return {any} + * @api public + */ + +Document.prototype.get = function(path, type, options) { + let adhoc; + if (options == null) { + options = {}; + } + if (type) { + adhoc = this.$__schema.interpretAsType(path, type, this.$__schema.options); + } + const noDottedPath = options.noDottedPath; + + // Fast path if we know we're just accessing top-level path on the document: + // just get the schema path, avoid `$__path()` because that does string manipulation + let schema = noDottedPath ? + Object.hasOwn(this.$__schema.paths, path) ? this.$__schema.paths[path] : undefined : + this.$__path(path); + if (schema == null) { + schema = this.$__schema.virtualpath(path); + + if (schema != null) { + return schema.applyGetters(void 0, this); + } + } + + if (noDottedPath) { + let obj = Object.hasOwn(this._doc, path) ? this._doc[path] : undefined; + if (adhoc) { + obj = adhoc.cast(obj); + } + if (schema != null && options.getters !== false) { + return schema.applyGetters(obj, this); + } + return obj; + } + + if (schema?.instance === 'Mixed') { + const virtual = this.$__schema.virtualpath(path); + if (virtual != null) { + schema = virtual; + } + } + + const hasDot = path.indexOf('.') !== -1; + let obj = this._doc; + + const pieces = hasDot ? path.split('.') : [path]; + // Might need to change path for top-level alias + if (typeof this.$__schema.aliases[pieces[0]] === 'string') { + pieces[0] = this.$__schema.aliases[pieces[0]]; + } + + for (let i = 0, l = pieces.length; i < l; i++) { + if (specialProperties.has(pieces[i])) { + return undefined; + } + + if (obj && obj._doc) { + obj = obj._doc; + } + + if (obj == null) { + obj = void 0; + } else if (obj instanceof Map) { + obj = obj.get(pieces[i], { getters: false }); + } else if (i === l - 1) { + obj = utils.getValue(pieces[i], obj); + } else { + obj = obj[pieces[i]]; + } + } + + if (adhoc) { + obj = adhoc.cast(obj); + } + + if (schema != null && options.getters !== false) { + obj = schema.applyGetters(obj, this); + } else if (Object.hasOwn(this.$__schema.nested, path) && options.virtuals) { + // Might need to apply virtuals if this is a nested path + return applyVirtuals(this, clone(obj) || {}, { path: path }); + } + + return obj; +}; + +/*! + * ignore + */ + +Document.prototype[getSymbol] = Document.prototype.get; +Document.prototype.$get = Document.prototype.get; + +/** + * Returns the schematype for the given `path`. + * + * @param {string} path + * @return {SchemaPath} + * @api private + * @method $__path + * @memberOf Document + * @instance + */ + +Document.prototype.$__path = function(path) { + const adhocs = this.$__.adhocPaths; + const adhocType = adhocs && Object.hasOwn(adhocs, path) ? adhocs[path] : null; + + if (adhocType) { + return adhocType; + } + return this.$__schema.path(path); +}; + +/** + * Marks the path as having pending changes to write to the db. + * + * _Very helpful when using [Mixed](https://mongoosejs.com/docs/schematypes.html#mixed) types._ + * + * #### Example: + * + * doc.mixed.type = 'changed'; + * doc.markModified('mixed.type'); + * doc.save() // changes to mixed.type are now persisted + * + * @param {string} path the path to mark modified + * @param {Document} [scope] the scope to run validators with + * @api public + */ + +Document.prototype.markModified = function(path, scope) { + this.$__saveInitialState(path); + + this.$__.activePaths.modify(path); + if (scope != null && !this.$isSubdocument) { + this.$__.pathsToScopes = this.$__pathsToScopes || {}; + this.$__.pathsToScopes[path] = scope; + } +}; + +/*! + * ignore + */ + +Document.prototype.$__saveInitialState = function $__saveInitialState(path) { + const savedState = this.$__.savedState; + const savedStatePath = path; + if (savedState != null) { + const firstDot = savedStatePath.indexOf('.'); + const topLevelPath = firstDot === -1 ? savedStatePath : savedStatePath.slice(0, firstDot); + if (!Object.hasOwn(savedState, topLevelPath)) { + savedState[topLevelPath] = clone(this.$__getValue(topLevelPath)); + } + } +}; + +/** + * Clears the modified state on the specified path. + * + * #### Example: + * + * doc.foo = 'bar'; + * doc.unmarkModified('foo'); + * doc.save(); // changes to foo will not be persisted + * + * @param {string} path the path to unmark modified + * @api public + */ + +Document.prototype.unmarkModified = function(path) { + this.$__.activePaths.init(path); + if (this.$__.pathsToScopes != null) { + delete this.$__.pathsToScopes[path]; + } +}; + +/** + * Don't run validation on this path or persist changes to this path. + * + * #### Example: + * + * doc.foo = null; + * doc.$ignore('foo'); + * doc.save(); // changes to foo will not be persisted and validators won't be run + * + * @memberOf Document + * @instance + * @method $ignore + * @param {string} path the path to ignore + * @api public + */ + +Document.prototype.$ignore = function(path) { + this.$__.activePaths.ignore(path); +}; + +/** + * Returns the list of paths that have been directly modified. A direct + * modified path is a path that you explicitly set, whether via `doc.foo = 'bar'`, + * `Object.assign(doc, { foo: 'bar' })`, or `doc.set('foo', 'bar')`. + * + * A path `a` may be in `modifiedPaths()` but not in `directModifiedPaths()` + * because a child of `a` was directly modified. + * + * #### Example: + * + * const schema = new Schema({ foo: String, nested: { bar: String } }); + * const Model = mongoose.model('Test', schema); + * await Model.create({ foo: 'original', nested: { bar: 'original' } }); + * + * const doc = await Model.findOne(); + * doc.nested.bar = 'modified'; + * doc.directModifiedPaths(); // ['nested.bar'] + * doc.modifiedPaths(); // ['nested', 'nested.bar'] + * + * @return {string[]} + * @api public + */ + +Document.prototype.directModifiedPaths = function() { + return Object.keys(this.$__.activePaths.getStatePaths('modify')); +}; + +/** + * Returns true if the given path is nullish or only contains empty objects. + * Useful for determining whether this subdoc will get stripped out by the + * [minimize option](https://mongoosejs.com/docs/guide.html#minimize). + * + * #### Example: + * + * const schema = new Schema({ nested: { foo: String } }); + * const Model = mongoose.model('Test', schema); + * const doc = new Model({}); + * doc.$isEmpty('nested'); // true + * doc.nested.$isEmpty(); // true + * + * doc.nested.foo = 'bar'; + * doc.$isEmpty('nested'); // false + * doc.nested.$isEmpty(); // false + * + * @param {string} [path] + * @memberOf Document + * @instance + * @api public + * @method $isEmpty + * @return {boolean} + */ + +Document.prototype.$isEmpty = function(path) { + const isEmptyOptions = { + minimize: true, + virtuals: false, + getters: false, + transform: false + }; + + if (arguments.length !== 0) { + const v = this.$get(path); + if (v == null) { + return true; + } + if (typeof v !== 'object') { + return false; + } + if (utils.isPOJO(v)) { + return _isEmpty(v); + } + return Object.keys(v.toObject(isEmptyOptions)).length === 0; + } + + return Object.keys(this.toObject(isEmptyOptions)).length === 0; +}; + +/*! + * ignore + */ + +function _isEmpty(v) { + if (v == null) { + return true; + } + if (typeof v !== 'object' || Array.isArray(v)) { + return false; + } + for (const key of Object.keys(v)) { + if (!_isEmpty(v[key])) { + return false; + } + } + return true; +} + +/** + * Returns the list of paths that have been modified. + * + * @param {object} [options] + * @param {boolean} [options.includeChildren=false] if true, returns children of modified paths as well. For example, if false, the list of modified paths for `doc.colors = { primary: 'blue' };` will **not** contain `colors.primary`. If true, `modifiedPaths()` will return an array that contains `colors.primary`. + * @return {string[]} + * @api public + */ + +Document.prototype.modifiedPaths = function(options) { + options = options || {}; + + const directModifiedPaths = Object.keys(this.$__.activePaths.getStatePaths('modify')); + const result = new Set(); + + let i = 0; + let j = 0; + const len = directModifiedPaths.length; + + for (i = 0; i < len; ++i) { + const path = directModifiedPaths[i]; + const parts = parentPaths(path); + const pLen = parts.length; + + for (j = 0; j < pLen; ++j) { + result.add(parts[j]); + } + + if (!options.includeChildren) { + continue; + } + + let ii = 0; + let cur = this.$get(path); + if (typeof cur === 'object' && cur !== null) { + if (cur._doc) { + cur = cur._doc; + } + const len = cur.length; + if (Array.isArray(cur)) { + for (ii = 0; ii < len; ++ii) { + const subPath = path + '.' + ii; + if (!result.has(subPath)) { + result.add(subPath); + if (cur[ii] != null && cur[ii].$__) { + const modified = cur[ii].modifiedPaths(); + let iii = 0; + const iiiLen = modified.length; + for (iii = 0; iii < iiiLen; ++iii) { + result.add(subPath + '.' + modified[iii]); + } + } + } + } + } else { + const keys = Object.keys(cur); + let ii = 0; + const len = keys.length; + for (ii = 0; ii < len; ++ii) { + result.add(path + '.' + keys[ii]); + } + } + } + } + return Array.from(result); +}; + +Document.prototype[documentModifiedPaths] = Document.prototype.modifiedPaths; + +/** + * Returns true if any of the given paths is modified, else false. If no arguments, returns `true` if any path + * in this document is modified. + * + * If `path` is given, checks if a path or any full path containing `path` as part of its path chain has been modified. + * + * #### Example: + * + * doc.set('documents.0.title', 'changed'); + * doc.isModified() // true + * doc.isModified('documents') // true + * doc.isModified('documents.0.title') // true + * doc.isModified('documents otherProp') // true + * doc.isDirectModified('documents') // false + * + * @param {string} [path] optional + * @param {object} [options] + * @param {boolean} [options.ignoreAtomics=false] If true, doesn't return true if path is underneath an array that was modified with atomic operations like `push()` + * @return {boolean} + * @api public + */ + +Document.prototype.isModified = function(paths, options, modifiedPaths) { + if (paths) { + const ignoreAtomics = options?.ignoreAtomics; + const directModifiedPathsObj = this.$__.activePaths.states.modify; + if (directModifiedPathsObj == null) { + return false; + } + + if (typeof paths === 'string') { + paths = paths.indexOf(' ') === -1 ? [paths] : paths.split(' '); + } + + for (const path of paths) { + if (directModifiedPathsObj[path] != null) { + return true; + } + } + + const modified = modifiedPaths || this[documentModifiedPaths](); + const isModifiedChild = paths.some(function(path) { + return !!~modified.indexOf(path); + }); + + let directModifiedPaths = Object.keys(directModifiedPathsObj); + if (ignoreAtomics) { + directModifiedPaths = directModifiedPaths.filter(path => { + const value = this.$__getValue(path); + if (value?.[arrayAtomicsSymbol] != null && value[arrayAtomicsSymbol].$set === undefined) { + return false; + } + return true; + }); + } + return isModifiedChild || paths.some(function(path) { + return directModifiedPaths.some(function(mod) { + return mod === path || path.startsWith(mod + '.'); + }); + }); + } + + return this.$__.activePaths.some('modify'); +}; + +/** + * Alias of [`.isModified`](https://mongoosejs.com/docs/api/document.html#Document.prototype.isModified()) + * + * @method $isModified + * @memberOf Document + * @api public + */ + +Document.prototype.$isModified = Document.prototype.isModified; + +Document.prototype[documentIsModified] = Document.prototype.isModified; + +/** + * Checks if a path is set to its default. + * + * #### Example: + * + * MyModel = mongoose.model('test', { name: { type: String, default: 'Val '} }); + * const m = new MyModel(); + * m.$isDefault('name'); // true + * + * @memberOf Document + * @instance + * @method $isDefault + * @param {string} [path] + * @return {boolean} + * @api public + */ + +Document.prototype.$isDefault = function(path) { + if (path == null) { + return this.$__.activePaths.some('default'); + } + + if (typeof path === 'string' && path.indexOf(' ') === -1) { + return Object.hasOwn(this.$__.activePaths.getStatePaths('default'), path); + } + + let paths = path; + if (!Array.isArray(paths)) { + paths = paths.split(' '); + } + + return paths.some(path => Object.hasOwn(this.$__.activePaths.getStatePaths('default'), path)); +}; + +/** + * Getter/setter, determines whether the document was deleted. The `Model.prototype.deleteOne()` method sets `$isDeleted` if the delete operation succeeded. + * + * #### Example: + * + * const product = await product.deleteOne(); + * product.$isDeleted(); // true + * product.deleteOne(); // no-op, doesn't send anything to the db + * + * product.$isDeleted(false); + * product.$isDeleted(); // false + * product.deleteOne(); // will execute a remove against the db + * + * + * @param {boolean} [val] optional, overrides whether mongoose thinks the doc is deleted + * @return {boolean|Document} whether mongoose thinks this doc is deleted. + * @method $isDeleted + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.$isDeleted = function(val) { + if (arguments.length === 0) { + return !!this.$__.isDeleted; + } + + this.$__.isDeleted = !!val; + return this; +}; + +/** + * Returns true if `path` was directly set and modified, else false. + * + * #### Example: + * + * doc.set('documents.0.title', 'changed'); + * doc.isDirectModified('documents.0.title') // true + * doc.isDirectModified('documents') // false + * + * @param {string|string[]} [path] + * @return {boolean} + * @api public + */ + +Document.prototype.isDirectModified = function(path) { + if (path == null) { + return this.$__.activePaths.some('modify'); + } + + if (typeof path === 'string' && path.indexOf(' ') === -1) { + const res = Object.hasOwn(this.$__.activePaths.getStatePaths('modify'), path); + if (res || path.indexOf('.') === -1) { + return res; + } + + const pieces = path.split('.'); + for (let i = 0; i < pieces.length - 1; ++i) { + const subpath = pieces.slice(0, i + 1).join('.'); + const subdoc = this.$get(subpath); + if (subdoc?.$__ != null && subdoc.isDirectModified(pieces.slice(i + 1).join('.'))) { + return true; + } + } + + return false; + } + + let paths = path; + if (typeof paths === 'string') { + paths = paths.split(' '); + } + + return paths.some(path => this.isDirectModified(path)); +}; + +/** + * Checks if `path` is in the `init` state, that is, it was set by `Document#init()` and not modified since. + * + * @param {string} [path] + * @return {boolean} + * @api public + */ + +Document.prototype.isInit = function(path) { + if (path == null) { + return this.$__.activePaths.some('init'); + } + + if (typeof path === 'string' && path.indexOf(' ') === -1) { + return Object.hasOwn(this.$__.activePaths.getStatePaths('init'), path); + } + + let paths = path; + if (!Array.isArray(paths)) { + paths = paths.split(' '); + } + + return paths.some(path => Object.hasOwn(this.$__.activePaths.getStatePaths('init'), path)); +}; + +/** + * Checks if `path` was selected in the source query which initialized this document. + * + * #### Example: + * + * const doc = await Thing.findOne().select('name'); + * doc.isSelected('name') // true + * doc.isSelected('age') // false + * + * @param {string|string[]} path + * @return {boolean} + * @api public + */ + +Document.prototype.isSelected = function isSelected(path) { + if (this.$__.selected == null) { + return true; + } + if (!path) { + return false; + } + if (path === '_id') { + return this.$__.selected._id !== 0; + } + + if (path.indexOf(' ') !== -1) { + path = path.split(' '); + } + if (Array.isArray(path)) { + return path.some(p => this.$__isSelected(p)); + } + + const index = _getProjectionIndex(this); + const paths = index.paths; + const inclusive = index.inclusive; + + if (index.onlyId) { + // only _id was selected. + return this.$__.selected._id === 0; + } + + if (inclusive === null) { + return true; + } + + if (path in this.$__.selected) { + return inclusive; + } + + const pathHasDot = path.indexOf('.') !== -1; + + if (!index.hasNestedKey) { + // No projection key is nested, so no key can start with `path + '.'` and + // only the "is an ancestor of `path` projected?" check below can match. + // Every ancestor that matches returns the same value, so we can walk + // `path`'s ancestors instead of scanning every projection key. This keeps + // `isSelected()` O(depth of path) rather than O(number of projected paths), + // which matters because `toObject({ getters: true })` calls this once per + // schema path. Re: gh-16373 + if (pathHasDot) { + for (let dot = path.indexOf('.'); dot !== -1; dot = path.indexOf('.', dot + 1)) { + const ancestor = path.slice(0, dot); + if (ancestor !== '_id' && Object.hasOwn(this.$__.selected, ancestor)) { + return inclusive; + } + } + } + return !inclusive; + } + + for (const cur of paths) { + if (cur === '_id') { + continue; + } + + if (cur.charAt(path.length) === '.' && cur.slice(0, path.length) === path) { + return inclusive || cur !== path + '.'; + } + + if (pathHasDot && path.charAt(cur.length) === '.' && path.slice(0, cur.length) === cur) { + return inclusive; + } + } + return !inclusive; +}; + +/*! + * Computes and caches the derived properties of `doc.$__.selected` that + * `isSelected()` and `isDirectSelected()` would otherwise recompute on every + * call. `$__.selected` is assigned once in the Document constructor and never + * mutated afterwards, so this can safely be cached for the document's lifetime. + */ + +function _getProjectionIndex(doc) { + if (doc.$__.selectedIndex !== undefined) { + return doc.$__.selectedIndex; + } + + const selected = doc.$__.selected; + const paths = Object.keys(selected); + let inclusive = null; + let hasNestedKey = false; + + for (const cur of paths) { + if (cur === '_id') { + continue; + } + if (cur.indexOf('.') !== -1) { + hasNestedKey = true; + } + if (inclusive === null && isDefiningProjection(selected[cur])) { + inclusive = !!selected[cur]; + } + } + + return (doc.$__.selectedIndex = { + paths, + inclusive, + hasNestedKey, + onlyId: paths.length === 1 && paths[0] === '_id' + }); +} + +Document.prototype.$__isSelected = Document.prototype.isSelected; + +/** + * Checks if `path` was explicitly selected. If no projection, always returns + * true. + * + * #### Example: + * + * Thing.findOne().select('nested.name').exec(function (err, doc) { + * doc.isDirectSelected('nested.name') // true + * doc.isDirectSelected('nested.otherName') // false + * doc.isDirectSelected('nested') // false + * }) + * + * @param {string} path + * @return {boolean} + * @api public + */ + +Document.prototype.isDirectSelected = function isDirectSelected(path) { + if (this.$__.selected == null) { + return true; + } + + if (path === '_id') { + return this.$__.selected._id !== 0; + } + + if (path.indexOf(' ') !== -1) { + path = path.split(' '); + } + if (Array.isArray(path)) { + return path.some(p => this.isDirectSelected(p)); + } + + const index = _getProjectionIndex(this); + + if (index.onlyId) { + // only _id was selected. + return this.$__.selected._id === 0; + } + + if (index.inclusive === null) { + return true; + } + + if (Object.hasOwn(this.$__.selected, path)) { + return index.inclusive; + } + + return !index.inclusive; +}; + +/** + * Executes registered validation rules for this document. + * + * #### Note: + * + * This method is called `pre` save and if a validation rule is violated, [save](https://mongoosejs.com/docs/api/model.html#Model.prototype.save()) is aborted and the error is thrown. + * + * #### Example: + * + * await doc.validate({ validateModifiedOnly: false, pathsToSkip: ['name', 'email']}); + * + * @param {Array|string} [pathsToValidate] list of paths to validate. If set, Mongoose will validate only the modified paths that are in the given list. + * @param {object} [options] internal options + * @param {boolean} [options.validateModifiedOnly=false] if `true` mongoose validates only modified paths. + * @param {Array|string} [options.pathsToSkip] list of paths to skip. If set, Mongoose will validate every modified path that is not in this list. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @return {Promise} Returns a Promise. + * @api public + */ + +Document.prototype.validate = async function validate(pathsToValidate, options) { + if (typeof pathsToValidate === 'function' || typeof options === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Document.prototype.validate() no longer accepts a callback'); + } + this.$op = 'validate'; + + if (arguments.length === 1) { + if (typeof arguments[0] === 'object' && !Array.isArray(arguments[0])) { + options = arguments[0]; + pathsToValidate = null; + } + } + if (options && typeof options.pathsToSkip === 'string') { + const isOnePathOnly = options.pathsToSkip.indexOf(' ') === -1; + options.pathsToSkip = isOnePathOnly ? [options.pathsToSkip] : options.pathsToSkip.split(' '); + } + const _skipParallelValidateCheck = options?._skipParallelValidateCheck; + + if (this.$isSubdocument != null) { + // Skip parallel validate check for subdocuments + } else if (this.$__.validating && !_skipParallelValidateCheck) { + throw new ParallelValidateError(this); + } else if (!_skipParallelValidateCheck) { + this.$__.validating = true; + } + + const hasValidateHooks = this.$__middleware.hasHooks('validate'); + try { + try { + if (hasValidateHooks) { + [options] = await this._execDocumentPreHooks('validate', options, [options]); + } else if (!_skipParallelValidateCheck) { + // Even with no validate hooks, preserve the async boundary that the pre + // hook `await` used to provide so that the parallel validate check still + // observes `$__.validating` across a tick (gh-8468). insertMany's per-doc + // validate passes `_skipParallelValidateCheck` and stays fully synchronous. + await Promise.resolve(); + } + } catch (error) { + if (hasValidateHooks) { + await this._execDocumentPostHooks('validate', options, error); + } + return; + } + + if (this.$__.saveOptions && this.$__.saveOptions.pathsToSave && !pathsToValidate) { + pathsToValidate = [...this.$__.saveOptions.pathsToSave]; + } + + const hasValidateModifiedOnlyOption = options && + (typeof options === 'object') && + ('validateModifiedOnly' in options); + + const pathsToSkip = options?.pathsToSkip || null; + + let shouldValidateModifiedOnly; + if (hasValidateModifiedOnlyOption) { + shouldValidateModifiedOnly = !!options.validateModifiedOnly; + } else { + shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly; + } + this.$__.validateModifiedOnly = shouldValidateModifiedOnly; + + const validateAllPaths = options?.validateAllPaths; + if (validateAllPaths) { + if (pathsToSkip) { + throw new TypeError('Cannot set both `validateAllPaths` and `pathsToSkip`'); + } + if (pathsToValidate) { + throw new TypeError('Cannot set both `validateAllPaths` and `pathsToValidate`'); + } + if (hasValidateModifiedOnlyOption && shouldValidateModifiedOnly) { + throw new TypeError('Cannot set both `validateAllPaths` and `validateModifiedOnly`'); + } + } + + const _this = this; + + // only validate required fields when necessary + let paths; + let doValidateOptionsByPath; + if (validateAllPaths) { + paths = new Set(Object.keys(this.$__schema.paths)); + // gh-661: if a whole array is modified, make sure to run validation on all + // the children as well + for (const path of paths) { + const schemaType = this.$__schema.path(path); + if (!schemaType?.$isMongooseArray) { + continue; + } + const val = this.$__getValue(path); + if (!val) { + continue; + } + _pushNestedArrayPaths(val, paths, path); + } + paths = [...paths]; + doValidateOptionsByPath = {}; + } else { + const pathDetails = _getPathsToValidate(this, pathsToValidate, pathsToSkip, options?._nestedValidate); + paths = shouldValidateModifiedOnly ? + pathDetails[0].filter((path) => this.$isModified(path)) : + pathDetails[0]; + doValidateOptionsByPath = pathDetails[1]; + } + + if (typeof pathsToValidate === 'string') { + pathsToValidate = pathsToValidate.split(' '); + } + + if (paths.length === 0) { + const error = _completeValidate(this); + + if (hasValidateHooks) { + await this._execDocumentPostHooks('validate', options, error); + } else if (error != null) { + throw error; + } + return; + } + + const validated = {}; + + const pathsToSave = Array.isArray(this.$__.saveOptions?.pathsToSave) ? + new Set(this.$__.saveOptions.pathsToSave) : + null; + const promises = []; + for (let i = 0; i < paths.length; ++i) { + const path = paths[i]; + if (pathsToSave != null && !pathsToSave.has(path)) { + promises.push(Promise.resolve(null)); + continue; + } + if (path == null || validated[path]) { + promises.push(Promise.resolve(null)); + continue; + } + + validated[path] = true; + const schemaType = _this.$__schema.path(path); + + if (!schemaType) { + promises.push(Promise.resolve(null)); + continue; + } + + // If user marked as invalid or there was a cast error, don't validate + if (!_this.$isValid(path)) { + promises.push(Promise.resolve(null)); + continue; + } + + // If setting a path under a mixed path, avoid using the mixed path validator (gh-10141) + if (schemaType[schemaMixedSymbol] != null && path !== schemaType.path) { + promises.push(Promise.resolve(null)); + continue; + } + + let val = _this.$__getValue(path); + + // If you `populate()` and get back a null value, required validators + // shouldn't fail (gh-8018). We should always fall back to the populated + // value. + let pop; + if ((pop = _this.$populated(path))) { + val = pop; + } else if (val?.$__?.wasPopulated) { + // Array paths, like `somearray.1`, do not show up as populated with `$populated()`, + // so in that case pull out the document's id + val = val._doc._id; + } + const scope = _this.$__.pathsToScopes != null && path in _this.$__.pathsToScopes ? + _this.$__.pathsToScopes[path] : + _this; + + const doValidateOptions = { + ...doValidateOptionsByPath[path], + path: path, + validateAllPaths, + _nestedValidate: true + }; + + promises.push( + schemaType.doValidate(val, scope, doValidateOptions).then( + () => null, + err => { + const isSubdoc = schemaType.$isSingleNested || + schemaType.$isArraySubdocument || + schemaType.$isMongooseDocumentArray; + if (isSubdoc && err instanceof ValidationError) { + return null; + } + + return err; + } + ) + ); + } + const validationErrors = await Promise.all(promises); + for (let i = 0; i < validationErrors.length; ++i) { + const validationError = validationErrors[i]; + if (validationError == null) { + continue; + } + if (this.$__.validationError == null) { + this.$__.validationError = new ValidationError(this); + } + _this.invalidate(paths[i], validationError, undefined, true); + } + + const error = _completeValidate(this); + + if (hasValidateHooks) { + await this._execDocumentPostHooks('validate', options, error); + } else if (error != null) { + throw error; + } + } finally { + // Assign rather than `delete` to avoid putting `$__` in dictionary mode + this.$__.validateModifiedOnly = undefined; + this.$op = null; + this.$__.validating = null; + } +}; + +/** + * Alias of [`.validate`](https://mongoosejs.com/docs/api/document.html#Document.prototype.validate()) + * + * @method $validate + * @memberOf Document + * @api public + */ + +Document.prototype.$validate = Document.prototype.validate; + +/*! + * Event emitting and error persisting logic that needs to happen in both the `paths.length === 0` + * and `paths.length > 0` cases in `Document.prototype.validate()`. + * + * @param {Document} doc + * @return {Error} + * @private + */ + +function _completeValidate(doc) { + let error = doc.$__.validationError; + doc.$__.validationError = null; + doc.$__.validating = null; + + if (doc.$__.validateModifiedOnly && error != null) { + // Remove any validation errors that aren't from modified paths + const errors = Object.keys(error.errors); + for (const errPath of errors) { + if (!doc.$isModified(errPath)) { + delete error.errors[errPath]; + } + } + if (utils.hasOwnKeys(error.errors) === false) { + error = void 0; + } + } + + doc.$__.cachedRequired = null; + doc.$emit('validate', doc); + doc.constructor.emit('validate', doc); + + if (error) { + for (const key in error.errors) { + // Make sure cast errors persist + if (!doc[documentArrayParent] && + error.errors[key] instanceof MongooseError.CastError) { + doc.invalidate(key, error.errors[key]); + } + } + } + + return error; +} + +const STATES_TO_VALIDATE = Object.freeze(['init', 'default', 'modify']); +const STAR_CHAR_CODE = '*'.charCodeAt(0); + +/*! + * ignore + */ + +function _getPathsToValidate(doc, pathsToValidate, pathsToSkip, isNestedValidate) { + const doValidateOptions = {}; + const schema = doc.$__schema; + const schemaPaths = schema.paths; + const activeStates = doc.$__.activePaths.states; + + // gh-16379: compute the modified-path set at most once and reuse it below, so + // checking many required paths doesn't rebuild it per-path (O(required x modified)). + let _modifiedPaths; + const getModifiedPaths = () => (_modifiedPaths ??= doc.modifiedPaths()); + + // only validate required fields when necessary + let paths = []; + const requireStates = activeStates.require; + if (requireStates != null) { + let modifiedPaths = null; + for (const path in requireStates) { + // Evaluate function-valued `required` for every required path, before any + // filtering, so `invalidate()` calls and `cachedRequired` entries stay + // consistent no matter which paths end up validated. + const type = Object.hasOwn(schemaPaths, path) ? schemaPaths[path] : schema.path(path); + if (typeof type?.originalRequiredValue === 'function') { + const cachedRequired = doc.$__.cachedRequired ?? (doc.$__.cachedRequired = {}); + try { + cachedRequired[path] = type.originalRequiredValue.call(doc, doc); + } catch (err) { + doc.invalidate(path, err); + } + } + + if (!doc.$__isSelected(path)) { + if (modifiedPaths === null) { + modifiedPaths = doc.modifiedPaths(); + } + if (!doc.$isModified(path, null, modifiedPaths)) { + continue; + } + } + if (path.charCodeAt(path.length - 1) === STAR_CHAR_CODE && path.endsWith('.$*')) { + // Skip $* paths - they represent map schemas, not actual document paths + continue; + } + const cachedRequired = doc.$__.cachedRequired; + if (cachedRequired != null && path in cachedRequired) { + if (cachedRequired[path]) { + paths.push(path); + } + } else { + paths.push(path); + } + } + } + + for (let i = 0; i < STATES_TO_VALIDATE.length; ++i) { + const statePaths = activeStates[STATES_TO_VALIDATE[i]]; + if (statePaths == null) { + continue; + } + for (const p in statePaths) { + if (p.charCodeAt(p.length - 1) === STAR_CHAR_CODE && p.endsWith('.$*')) { + // Skip $* paths - they represent map schemas, not actual document paths + continue; + } + + const _pathType = Object.hasOwn(schemaPaths, p) ? schemaPaths[p] : schema.path(p); + + // Optimization: if primitive path with no validators, or array of primitives + // with no validators, skip validating this path entirely. + // Note: paths with no _pathType (e.g. sub-paths under Mixed) must still be + // added, as they trigger validation of the parent Mixed path. + if (_pathType) { + if (!_pathType.schema && + !_pathType.embeddedSchemaType && + _pathType.validators.length === 0 && + !_pathType.$parentSchemaDocArray && + // gh-15957: skip this optimization for SchemaMap as maps can contain subdocuments + // that need validation even if the map itself has no validators + !_pathType.$isSchemaMap && + !_pathType.$isSchemaUnion) { + continue; + } else if (_pathType.$isMongooseArray && + !_pathType.$isMongooseDocumentArray && // Skip document arrays... + !_pathType.embeddedSchemaType.$isMongooseArray && // and arrays of arrays + _pathType.validators.length === 0 && // and arrays with top-level validators + _pathType.embeddedSchemaType.validators.length === 0) { + continue; + } + } + + paths.push(p); + } + } + + if (paths.length === 0 && doc.$__hasOnlyPrimitiveValues()) { + return [paths, doValidateOptions]; + } + + paths = new Set(paths); + + if (!isNestedValidate) { + // If we're validating a subdocument, all this logic will run anyway on the top-level document, so skip for subdocuments. + // But only run for top-level subdocuments, because we're looking for subdocuments that are not modified at top-level but + // have a modified path. If that is the case, we will run validation on the top-level subdocument, and via that run validation + // on any subdocuments down to the modified path. + const topLevelSubdocs = []; + for (const path of Object.keys(doc.$__schema.paths)) { + const schemaType = doc.$__schema.path(path); + if (schemaType.$isSingleNested) { + const subdoc = doc.$get(path); + if (subdoc) { + topLevelSubdocs.push(subdoc); + } + } else if (schemaType.$isMongooseDocumentArray) { + const arr = doc.$get(path); + if (arr?.length) { + for (const subdoc of arr) { + if (subdoc) { + topLevelSubdocs.push(subdoc); + } + } + } + } + } + const modifiedPaths = getModifiedPaths(); + + // gh-6818: if a document array that has array-level validators has any + // modified element, validate the array itself so those validators run. + for (const modifiedPath of modifiedPaths) { + const modifiedPathType = doc.$__schema.path(modifiedPath); + if (modifiedPathType != null && + modifiedPathType.$isMongooseDocumentArray && + modifiedPathType.validators.length > 0) { + paths.add(modifiedPath); + } + } + + for (const subdoc of topLevelSubdocs) { + if (subdoc.$basePath) { + const fullPathToSubdoc = subdoc.$__pathRelativeToParent(); + + // Remove child paths for now, because we'll be validating the whole + // subdoc. + // The following is a faster take on looping through every path in `paths` + // and checking if the path starts with `fullPathToSubdoc` re: gh-13191 + for (const modifiedPath of subdoc.modifiedPaths()) { + paths.delete(fullPathToSubdoc + '.' + modifiedPath); + } + + const subdocParent = subdoc.$parent(); + if (subdocParent == null) { + throw new Error('Cannot validate subdocument that does not have a parent'); + } + if (doc.$isModified(fullPathToSubdoc, null, modifiedPaths) && + // Avoid using isDirectModified() here because that does additional checks on whether the parent path + // is direct modified, which can cause performance issues re: gh-14897 + !Object.hasOwn(subdocParent.$__.activePaths.getStatePaths('modify'), fullPathToSubdoc) && + !subdocParent.$isDefault(fullPathToSubdoc)) { + paths.add(fullPathToSubdoc); + + if (doc.$__.pathsToScopes == null) { + doc.$__.pathsToScopes = {}; + } + doc.$__.pathsToScopes[fullPathToSubdoc] = subdoc.$isDocumentArrayElement ? + subdoc.__parentArray : + subdoc.$parent(); + + doValidateOptions[fullPathToSubdoc] = { skipSchemaValidators: true }; + if (subdoc.$isDocumentArrayElement && subdoc.__index != null) { + doValidateOptions[fullPathToSubdoc].index = subdoc.__index; + } + } + } + } + } + + if (!doc.$__hasOnlyPrimitiveValues()) { + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + if (_pathType && _pathType.$isMongooseDocumentArray) { + for (const p of paths) { + if (p == null || p.startsWith(_pathType.path + '.')) { + paths.delete(p); + } + } + } + } + } + + + if (Array.isArray(pathsToValidate)) { + paths = _handlePathsToValidate(paths, pathsToValidate); + } else if (Array.isArray(pathsToSkip)) { + paths = _handlePathsToSkip(paths, pathsToSkip); + } + + // from here on we're not removing items from paths + + // gh-661: if a whole array is modified, make sure to run validation on all + // the children as well + _addArrayPathsToValidate(doc, paths); + + const flattenOptions = { skipArrays: true }; + for (const pathToCheck of paths) { + if (doc.$__schema.nested[pathToCheck]) { + let _v = doc.$__getValue(pathToCheck); + if (isMongooseObject(_v)) { + _v = _v.toObject({ transform: false }); + } + const flat = flatten(_v, pathToCheck, flattenOptions, doc.$__schema); + // Single nested paths (paths embedded under single nested subdocs) will + // be validated on their own when we call `validate()` on the subdoc itself. + // Re: gh-8468 + const singleNestedPaths = doc.$__schema.singleNestedPaths; + for (const path of Object.keys(flat)) { + if (!Object.hasOwn(singleNestedPaths, path) && !path.endsWith('.$*')) { + paths.add(path); + } + } + } + } + + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + + if (!_pathType) { + continue; + } + + // If underneath a document array, may need to re-validate the parent + // array re: gh-6818. Do this _after_ adding subpaths, because + // we don't want to add every array subpath. + if (_pathType.$parentSchemaDocArray && typeof _pathType.$parentSchemaDocArray.path === 'string') { + paths.add(_pathType.$parentSchemaDocArray.path); + } + + if (!_pathType.$isSchemaMap) { + continue; + } + + const val = doc.$__getValue(path); + if (val == null) { + continue; + } + for (const key of val.keys()) { + paths.add(path + '.' + key); + } + } + + paths = Array.from(paths); + return [paths, doValidateOptions]; +} + +function _addArrayPathsToValidate(doc, paths) { + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + if (!_pathType) { + continue; + } + + if (!_pathType.$isMongooseArray || + // To avoid potential performance issues, skip doc arrays whose children + // are not required. `getPositionalPathType()` may be slow, so avoid + // it unless we have a case of #6364 + (!Array.isArray(_pathType) && + _pathType.$isMongooseDocumentArray && + !_pathType?.schemaOptions?.required)) { + continue; + } + + // gh-11380: optimization. If the array isn't a document array and there's no validators + // on the array type, there's no need to run validation on the individual array elements. + if (_pathType.$isMongooseArray && + !_pathType.$isMongooseDocumentArray && // Skip document arrays... + !_pathType.embeddedSchemaType.$isMongooseArray && // and arrays of arrays + _pathType.embeddedSchemaType.validators.length === 0) { + continue; + } + + const val = doc.$__getValue(path); + _pushNestedArrayPaths(val, paths, path); + } +} + +function _pushNestedArrayPaths(val, paths, path) { + if (val != null) { + const numElements = val.length; + for (let j = 0; j < numElements; ++j) { + if (Array.isArray(val[j])) { + _pushNestedArrayPaths(val[j], paths, path + '.' + j); + } else { + paths.add(path + '.' + j); + } + } + } +} + +/*! + * ignore + */ + +Document.prototype._execDocumentPreHooks = function _execDocumentPreHooks(opName, options, argsForHooks) { + const filter = buildMiddlewareFilter(options, 'pre'); + return this.$__middleware.execPre(opName, this, argsForHooks || [], { filter }); +}; + +/*! + * ignore + */ + +Document.prototype._execDocumentPostHooks = function _execDocumentPostHooks(opName, options, error) { + const filter = buildMiddlewareFilter(options, 'post'); + return this.$__middleware.execPost(opName, this, [this], { error, filter }); +}; + +/*! + * ignore + */ + +function _handlePathsToValidate(paths, pathsToValidate) { + const _pathsToValidate = new Set(pathsToValidate); + const parentPaths = new Map([]); + for (const path of pathsToValidate) { + if (path.indexOf('.') === -1) { + continue; + } + const pieces = path.split('.'); + let cur = pieces[0]; + for (let i = 1; i < pieces.length; ++i) { + // Since we skip subpaths under single nested subdocs to + // avoid double validation, we need to add back the + // single nested subpath if the user asked for it (gh-8626) + parentPaths.set(cur, path); + cur = cur + '.' + pieces[i]; + } + } + + const ret = new Set(); + for (const path of paths) { + if (_pathsToValidate.has(path)) { + ret.add(path); + } else if (parentPaths.has(path)) { + ret.add(parentPaths.get(path)); + } + } + return ret; +} + +/*! + * ignore + */ + +function _handlePathsToSkip(paths, pathsToSkip) { + pathsToSkip = new Set(pathsToSkip); + paths = Array.from(paths).filter(p => !pathsToSkip.has(p)); + return new Set(paths); +} + +/** + * Executes registered validation rules (skipping asynchronous validators) for this document. + * + * **Deprecated.** Use [`validate()`](https://mongoosejs.com/docs/api/document.html#Document.prototype.validate()) instead. + * `validateSync()` does not run validation middleware and will be removed in Mongoose 10. + * + * #### Note: + * + * This method is useful if you need synchronous validation. + * + * #### Example: + * + * const err = doc.validateSync(); + * if (err) { + * handleError(err); + * } else { + * // validation passed + * } + * + * @param {Array|string} [pathsToValidate] only validate the given paths + * @param {object} [options] options for validation + * @param {boolean} [options.validateModifiedOnly=false] If `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths. + * @param {Array|string} [options.pathsToSkip] list of paths to skip. If set, Mongoose will validate every modified path that is not in this list. + * @return {ValidationError|undefined} ValidationError if there are errors during validation, or undefined if there is no error. + * @deprecated Use `validate()` instead. `validateSync()` does not run middleware and will be removed in Mongoose 10. + * @api public + */ + +Document.prototype.validateSync = function() { + utils.warn('Mongoose: `Document.prototype.validateSync()` is deprecated and will be removed in Mongoose 10. Use `Document.prototype.validate()` instead.'); + return this.$__validateSync.apply(this, arguments); +}; + +/*! + * ignore + */ + +Document.prototype.$__validateSync = function(pathsToValidate, options) { + const _this = this; + + if (arguments.length === 1 && typeof arguments[0] === 'object' && !Array.isArray(arguments[0])) { + options = arguments[0]; + pathsToValidate = null; + } + + const hasValidateModifiedOnlyOption = options && + (typeof options === 'object') && + ('validateModifiedOnly' in options); + + let shouldValidateModifiedOnly; + if (hasValidateModifiedOnlyOption) { + shouldValidateModifiedOnly = !!options.validateModifiedOnly; + } else { + shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly; + } + + let pathsToSkip = options?.pathsToSkip; + + const validateAllPaths = options?.validateAllPaths; + if (validateAllPaths) { + if (pathsToSkip) { + throw new TypeError('Cannot set both `validateAllPaths` and `pathsToSkip`'); + } + if (pathsToValidate) { + throw new TypeError('Cannot set both `validateAllPaths` and `pathsToValidate`'); + } + } + + if (typeof pathsToValidate === 'string') { + const isOnePathOnly = pathsToValidate.indexOf(' ') === -1; + pathsToValidate = isOnePathOnly ? [pathsToValidate] : pathsToValidate.split(' '); + } else if (typeof pathsToSkip === 'string' && pathsToSkip.indexOf(' ') !== -1) { + pathsToSkip = pathsToSkip.split(' '); + } + + // only validate required fields when necessary + let paths; + let skipSchemaValidators; + if (validateAllPaths) { + paths = new Set(Object.keys(this.$__schema.paths)); + // gh-661: if a whole array is modified, make sure to run validation on all + // the children as well + for (const path of paths) { + const schemaType = this.$__schema.path(path); + if (!schemaType?.$isMongooseArray) { + continue; + } + const val = this.$__getValue(path); + if (!val) { + continue; + } + _pushNestedArrayPaths(val, paths, path); + } + paths = [...paths]; + skipSchemaValidators = {}; + } else { + const pathDetails = _getPathsToValidate(this, pathsToValidate, pathsToSkip); + paths = shouldValidateModifiedOnly ? + pathDetails[0].filter((path) => this.$isModified(path)) : + pathDetails[0]; + skipSchemaValidators = pathDetails[1]; + } + + const validating = {}; + + for (let i = 0, len = paths.length; i < len; ++i) { + const path = paths[i]; + + if (validating[path]) { + continue; + } + + validating[path] = true; + + const p = _this.$__schema.path(path); + if (!p) { + continue; + } + if (!_this.$isValid(path)) { + continue; + } + + const val = _this.$__getValue(path); + const err = p.doValidateSync(val, _this, { + skipSchemaValidators: skipSchemaValidators[path], + path: path, + validateModifiedOnly: shouldValidateModifiedOnly, + validateAllPaths + }); + if (err) { + const isSubdoc = p.$isSingleNested || + p.$isArraySubdocument || + p.$isMongooseDocumentArray; + if (isSubdoc && err instanceof ValidationError) { + continue; + } + _this.invalidate(path, err, undefined, true); + } + } + + const err = _this.$__.validationError; + _this.$__.validationError = undefined; + _this.$emit('validate', _this); + _this.constructor.emit('validate', _this); + + if (err) { + for (const key in err.errors) { + // Make sure cast errors persist + if (err.errors[key] instanceof MongooseError.CastError) { + _this.invalidate(key, err.errors[key]); + } + } + } + + return err; +}; + +/** + * Marks a path as invalid, causing validation to fail. + * + * The `errorMsg` argument will become the message of the `ValidationError`. + * + * The `value` argument (if passed) will be available through the `ValidationError.value` property. + * + * doc.invalidate('size', 'must be less than 20', 14); + * + * doc.validate(function (err) { + * console.log(err) + * // prints + * { message: 'Validation failed', + * name: 'ValidationError', + * errors: + * { size: + * { message: 'must be less than 20', + * name: 'ValidatorError', + * path: 'size', + * type: 'user defined', + * value: 14 } } } + * }) + * + * @param {string} path the field to invalidate. For array elements, use the `array.i.field` syntax, where `i` is the 0-based index in the array. + * @param {string|Error} err the error which states the reason `path` was invalid + * @param {object|string|number|any} val optional invalid value + * @param {string} [kind] optional `kind` property for the error + * @return {ValidationError} the current ValidationError, with all currently invalidated paths + * @api public + */ + +Document.prototype.invalidate = function(path, err, val, kind) { + if (!this.$__.validationError) { + this.$__.validationError = new ValidationError(this); + } + + if (this.$__.validationError.errors[path]) { + return; + } + + if (!err || typeof err === 'string') { + err = new ValidatorError({ + path: path, + message: err, + type: kind || 'user defined', + value: val + }); + } + + if (this.$__.validationError === err) { + return this.$__.validationError; + } + + // Set the model on cast errors with a custom message so `{MODEL}` gets + // replaced for document validation, not just query casting (gh-8300) + if (typeof err.setModel === 'function') { + const owner = this.ownerDocument(); + if (getConstructorName(owner) === 'model') { + err.setModel(owner.constructor); + } + } + + this.$__.validationError.addError(path, err); + return this.$__.validationError; +}; + +/** + * Marks a path as valid, removing existing validation errors. + * + * @param {string} path the field to mark as valid + * @api public + * @memberOf Document + * @instance + * @method $markValid + */ + +Document.prototype.$markValid = function(path) { + if (!this.$__.validationError?.errors[path]) { + return; + } + + delete this.$__.validationError.errors[path]; + if (utils.hasOwnKeys(this.$__.validationError.errors) === false) { + this.$__.validationError = null; + } +}; + +/*! + * ignore + */ + +function _markValidSubpaths(doc, path) { + if (!doc.$__.validationError) { + return; + } + + const keys = Object.keys(doc.$__.validationError.errors); + for (const key of keys) { + if (key.startsWith(path + '.')) { + delete doc.$__.validationError.errors[key]; + } + } + if (utils.hasOwnKeys(doc.$__.validationError.errors) === false) { + doc.$__.validationError = null; + } +} + +/*! + * ignore + */ + +function _checkImmutableSubpaths(subdoc, schematype, priorVal) { + const schema = schematype.schema; + if (schema == null) { + return; + } + + for (const key of Object.keys(schema.paths)) { + const path = schema.paths[key]; + if (path.$immutableSetter == null) { + continue; + } + const oldVal = priorVal == null ? void 0 : priorVal.$__getValue(key); + // Calling immutableSetter with `oldVal` even though it expects `newVal` + // is intentional. That's because `$immutableSetter` compares its param + // to the current value. + path.$immutableSetter.call(subdoc, oldVal); + } +} + +/** + * Saves this document by inserting a new document into the database if [document.isNew](https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew()) is `true`, + * or sends an [updateOne](https://mongoosejs.com/docs/api/document.html#Document.prototype.updateOne()) operation **only** with the modifications to the database, it does not replace the whole document in the latter case. + * + * #### Example: + * + * product.sold = Date.now(); + * product = await product.save(); + * + * If save is successful, the returned promise will fulfill with the document + * saved. + * + * #### Example: + * + * const newProduct = await product.save(); + * newProduct === product; // true + * + * @param {object} [options] options optional options + * @param {Session} [options.session=null] the [session](https://www.mongodb.com/docs/manual/reference/server-sessions/) associated with this save operation. If not specified, defaults to the [document's associated session](https://mongoosejs.com/docs/api/document.html#Document.prototype.$session()). + * @param {object} [options.safe] (DEPRECATED) overrides [schema's safe option](https://mongoosejs.com/docs/guide.html#safe). Use the `w` option instead. + * @param {boolean} [options.validateBeforeSave] set to false to save without validating. + * @param {boolean} [options.validateModifiedOnly=false] If `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths. + * @param {number|string} [options.w] set the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/#w-option). Overrides the [schema-level `writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.j] set to true for MongoDB to wait until this `save()` has been [journaled before resolving the returned promise](https://www.mongodb.com/docs/manual/reference/write-concern/#j-option). Overrides the [schema-level `writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {number} [options.wtimeout] sets a [timeout for the write concern](https://www.mongodb.com/docs/manual/reference/write-concern/#wtimeout). Overrides the [schema-level `writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern). + * @param {boolean} [options.checkKeys=true] the MongoDB driver prevents you from saving keys that start with '$' or contain '.' by default. Set this option to `false` to skip that check. See [restrictions on field names](https://www.mongodb.com/docs/manual/reference/limits/#Restrictions-on-Field-Names) + * @param {boolean} [options.timestamps=true] if `false` and [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this `save()`. + * @param {Array} [options.pathsToSave] An array of paths that tell mongoose to only validate and save the paths in `pathsToSave`. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @method save + * @memberOf Document + * @instance + * @throws {DocumentNotFoundError} if this [save updates an existing document](https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew()) but the document doesn't exist in the database. For example, you will get this error if the document is [deleted between when you retrieved the document and when you saved it](documents.html#updating). + * @return {Promise} + * @api public + * @see middleware https://mongoosejs.com/docs/middleware.html + */ + +/** + * Checks if a path is invalid + * + * @param {string|string[]} [path] the field to check. If unset will always return "false" + * @method $isValid + * @memberOf Document + * @instance + * @api private + */ + +Document.prototype.$isValid = function(path) { + if (this.$__.validationError == null || utils.hasOwnKeys(this.$__.validationError.errors) === false) { + return true; + } + if (path == null) { + return false; + } + + if (path.indexOf(' ') !== -1) { + path = path.split(' '); + } + if (Array.isArray(path)) { + return path.some(p => this.$__.validationError.errors[p] == null); + } + + return this.$__.validationError.errors[path] == null; +}; + +/** + * Resets the internal modified state of this document. + * + * @api private + * @param {boolean} [skipBackup] If `true`, skips the backup of modified paths for performance + * @param {boolean} [hasOnlyPrimitiveValues] Precalculate `$__hasOnlyPrimitiveValues()` for performance + * @return {Document} this + * @method $__reset + * @memberOf Document + * @instance + */ + +Document.prototype.$__reset = function reset(skipBackup, hasOnlyPrimitiveValues) { + hasOnlyPrimitiveValues = hasOnlyPrimitiveValues ?? this.$__hasOnlyPrimitiveValues(); + + // Skip for subdocuments. Also skip if doc only has primitive values, + // because primitives can't be subdocs. + const subdocs = !this.$isSubdocument && !hasOnlyPrimitiveValues ? this.$getAllSubdocs({ useCache: true }) : null; + if (subdocs?.length > 0) { + for (const subdoc of subdocs) { + subdoc.$__reset(skipBackup); + } + } + + // Clear atomics on dirty paths. Walk the modified and default paths + // directly instead of calling $__dirty(), which builds intermediate + // arrays, a Map, and does parent-path deduplication we don't need here. + // Skip entirely if the doc only has primitive values, because only arrays + // and maps have atomics. + if (!hasOnlyPrimitiveValues) { + this.$__resetAtomics(); + } + + if (!skipBackup) { + this.$__.backup = {}; + this.$__.backup.activePaths = { + modify: Object.assign({}, this.$__.activePaths.getStatePaths('modify')), + default: Object.assign({}, this.$__.activePaths.getStatePaths('default')) + }; + this.$__.backup.validationError = this.$__.validationError; + this.$__.backup.errors = this.$errors; + } + + // Clear 'dirty' cache + this.$__.activePaths.clearAllExcept('init'); + if (this.$__.validationError) { + this.$__.validationError = undefined; + } + if (this.$errors) { + this.$errors = undefined; + } + + for (const path of this.$__schema.requiredPaths()) { + this.$__.activePaths.require(path); + } + + return this; +}; + +/*! + * Clear atomics on all dirty (modified + default) paths. This is a lighter + * alternative to calling `$__dirty()` when we only need to clear atomics + * and don't need the full {path, value, schema} objects or parent-path + * deduplication. + */ + +Document.prototype.$__resetAtomics = function $__resetAtomics() { + const activePaths = this.$__.activePaths; + const modifyPaths = activePaths.getStatePaths('modify'); + const defaultPaths = activePaths.getStatePaths('default'); + + _clearAtomicsOnPaths(this, modifyPaths); + _clearAtomicsOnPaths(this, defaultPaths); +}; + +function _clearAtomicsOnPaths(doc, paths) { + if (paths == null) { + return; + } + const keys = Object.keys(paths); + for (let i = 0; i < keys.length; ++i) { + const type = doc.$__getValue(keys[i]); + if (type != null) { + if (typeof type.clearAtomics === 'function') { + type.clearAtomics(); + } else if (type[arrayAtomicsSymbol]) { + type[arrayAtomicsBackupSymbol] = type[arrayAtomicsSymbol]; + type[arrayAtomicsSymbol] = {}; + } + } + } +} + +/*! + * ignore + */ + +Document.prototype.$__undoReset = function $__undoReset() { + if (this.$__.backup?.activePaths == null) { + return; + } + + this.$__.activePaths.states.modify = this.$__.backup.activePaths.modify; + this.$__.activePaths.states.default = this.$__.backup.activePaths.default; + + this.$__.validationError = this.$__.backup.validationError; + this.$errors = this.$__.backup.errors; + + for (const dirt of this.$__dirty()) { + const type = dirt.value; + + if (type?.[arrayAtomicsSymbol] && type[arrayAtomicsBackupSymbol]) { + type[arrayAtomicsSymbol] = type[arrayAtomicsBackupSymbol]; + } + } + + if (!this.$isSubdocument) { + for (const subdoc of this.$getAllSubdocs()) { + subdoc.$__undoReset(); + } + } +}; + +/** + * Returns this documents dirty paths / vals. + * + * @return {Array} + * @api private + * @method $__dirty + * @memberOf Document + * @instance + */ + +Document.prototype.$__dirty = function() { + const _this = this; + let all = this.$__.activePaths.map('modify', function(path) { + return { + path: path, + value: _this.$__getValue(path), + schema: _this.$__path(path) + }; + }); + + // gh-2558: if we had to set a default and the value is not undefined, + // we have to save as well + all = all.concat(this.$__.activePaths.map('default', function(path) { + if (path === '_id' || _this.$__getValue(path) == null) { + return; + } + return { + path: path, + value: _this.$__getValue(path), + schema: _this.$__path(path) + }; + })); + + const allPaths = new Map(all.filter((el) => el != null).map((el) => [el.path, el.value])); + // Ignore "foo.a" if "foo" is dirty already. + const minimal = []; + + all.forEach(function(item) { + if (!item) { + return; + } + + let top = null; + let foundParent = false; + + const array = parentPaths(item.path); + for (let i = 0; i < array.length - 1; i++) { + if (allPaths.has(array[i])) { + top = allPaths.get(array[i]); + foundParent = true; + break; + } + } + if (!foundParent) { + minimal.push(item); + } else if (top != null && + top[arrayAtomicsSymbol] != null && + top.hasAtomics()) { + // special case for top level MongooseArrays + // the `top` array itself and a sub path of `top` are being set. + // the only way to honor all of both modifications is through a $set + // of entire array. + top[arrayAtomicsSymbol] = {}; + top[arrayAtomicsSymbol].$set = top; + } + }); + return minimal; +}; + +/** + * Assigns/compiles `schema` into this documents prototype. + * + * @param {Schema} schema + * @api private + * @method $__setSchema + * @memberOf Document + * @instance + */ + +Document.prototype.$__setSchema = function(schema) { + compile(schema.tree, this, undefined, schema.options); + + // Apply default getters if virtual doesn't have any (gh-6262) + for (const key of Object.keys(schema.virtuals)) { + schema.virtuals[key]._applyDefaultGetters(); + } + if (schema.path('schema') == null) { + this.schema = schema; + } + this.$__schema = schema; + this.$__middleware = schema._getDocumentMiddleware(); + this[documentSchemaSymbol] = schema; +}; + + +/** + * Get active path that were changed and are arrays + * + * @return {Array} + * @api private + * @method $__getArrayPathsToValidate + * @memberOf Document + * @instance + */ + +Document.prototype.$__getArrayPathsToValidate = function() { + DocumentArray || (DocumentArray = require('./types/documentArray')); + + // validate all document arrays. + return this.$__.activePaths + .map('init', 'modify', function(i) { + return this.$__getValue(i); + }.bind(this)) + .filter(function(val) { + return val && Array.isArray(val) && utils.isMongooseDocumentArray(val) && val.length; + }).reduce(function(seed, array) { + return seed.concat(array); + }, []) + .filter(function(doc) { + return doc; + }); +}; + + +/** + * Get all subdocs (by bfs) + * + * @param {object} [options] options. Currently for internal use. + * @return {Array} + * @api public + * @method $getAllSubdocs + * @memberOf Document + * @instance + */ + +Document.prototype.$getAllSubdocs = function(options) { + if (options?.useCache && this.$__.saveOptions?.__subdocs) { + return this.$__.saveOptions.__subdocs; + } + + DocumentArray || (DocumentArray = require('./types/documentArray')); + Embedded = Embedded || require('./types/arraySubdocument'); + + const subDocs = []; + function getSubdocs(doc) { + const newSubdocs = []; + + for (const { model } of doc.$__schema.childSchemas) { + // Avoid using `childSchemas.path` to avoid compatibility versions with pre-8.8 versions of Mongoose + const val = doc.$__getValue(model.path); + if (val == null) { + continue; + } + if (val.$__) { + newSubdocs.push(val); + } + if (Array.isArray(val)) { + for (const el of val) { + if (el?.$__) { + newSubdocs.push(el); + } + } + } + if (val instanceof Map) { + for (const el of val.values()) { + if (el?.$__) { + newSubdocs.push(el); + } + } + } + } + + for (const subdoc of newSubdocs) { + getSubdocs(subdoc); + } + subDocs.push(...newSubdocs); + } + + getSubdocs(this); + + if (this.$__.saveOptions) { + this.$__.saveOptions.__subdocs = subDocs; + } + + return subDocs; +}; + +/*! + * Runs queued functions + */ + +function applyQueue(doc) { + const q = doc.$__schema && doc.$__schema.callQueue; + if (!q.length) { + return; + } + + for (const pair of q) { + if (pair[0] !== 'pre' && pair[0] !== 'post' && pair[0] !== 'on') { + doc[pair[0]].apply(doc, pair[1]); + } + } +} + +/*! + * ignore + */ + +Document.prototype.$__handleReject = function handleReject(err) { + // emit on the Model if listening + if (this.$listeners('error').length) { + this.$emit('error', err); + } else if (this.constructor.listeners?.('error').length) { + this.constructor.emit('error', err); + } +}; + +/** + * Internal common logic for toObject() and toJSON() + * + * @return {object} + * @api private + * @method $toObject + * @memberOf Document + * @instance + */ + +Document.prototype.$toObject = function(options, json) { + const defaultOptions = this.$__schema._defaultToObjectOptions(json); + + const hasOnlyPrimitiveValues = this.$__hasOnlyPrimitiveValues(); + + // If options do not exist or is not an object, set it to empty object + options = utils.isPOJO(options) ? { ...options } : {}; + options._calledWithOptions = options._calledWithOptions || { ...options }; + + let _minimize; + if (options._calledWithOptions.minimize != null) { + _minimize = options.minimize; + } else if (this.$__schemaTypeOptions?.minimize != null) { + _minimize = this.$__schemaTypeOptions.minimize; + } else if (defaultOptions?.minimize != null) { + _minimize = defaultOptions.minimize; + } else { + _minimize = this.$__schema.options.minimize; + } + + options.minimize = _minimize; + if (!hasOnlyPrimitiveValues) { + options._seen = options._seen || new Map(); + } + + const depopulate = options._calledWithOptions.depopulate + ?? defaultOptions?.depopulate + ?? options.depopulate + ?? false; + // _isNested will only be true if this is not the top level document, we + // should never depopulate the top-level document + if (depopulate && options._isNested && this.$__.wasPopulated) { + return clone(this.$__.wasPopulated.value || this._doc._id, options); + } + + // merge default options with input options. + if (defaultOptions != null) { + for (const key of Object.keys(defaultOptions)) { + if (options[key] == null) { + options[key] = defaultOptions[key]; + } + } + } + options._isNested = true; + options.json = json; + + const parentOptions = options._parentOptions; + // Parent options should only bubble down for subdocuments, not populated docs + options._parentOptions = this.$isSubdocument ? options : null; + + const schemaFieldsOnly = options._calledWithOptions.schemaFieldsOnly + ?? options.schemaFieldsOnly + ?? defaultOptions?.schemaFieldsOnly + ?? false; + + let ret; + if (hasOnlyPrimitiveValues && !options.flattenObjectIds) { + // Fast path: if we don't have any nested objects or arrays, we only need a + // shallow clone. + ret = this.$__toObjectShallow(schemaFieldsOnly); + } else if (schemaFieldsOnly) { + ret = {}; + for (const path of Object.keys(this.$__schema.paths)) { + const value = this.$__getValue(path); + if (value === undefined) { + continue; + } + let pathToSet = path; + let objToSet = ret; + if (path.indexOf('.') !== -1) { + const segments = path.split('.'); + pathToSet = segments[segments.length - 1]; + for (let i = 0; i < segments.length - 1; ++i) { + objToSet[segments[i]] = objToSet[segments[i]] ?? {}; + objToSet = objToSet[segments[i]]; + } + } + if (value === null) { + objToSet[pathToSet] = null; + continue; + } + objToSet[pathToSet] = clone(value, options); + } + } else { + ret = clone(this._doc, options) || {}; + } + + const getters = options._calledWithOptions.getters + ?? options.getters + ?? defaultOptions?.getters + ?? false; + + if (getters) { + applyGetters(this, ret); + + if (options.minimize) { + ret = minimize(ret) || {}; + } + } + + const virtuals = options._calledWithOptions.virtuals + ?? defaultOptions?.virtuals + ?? parentOptions?.virtuals + ?? undefined; + + if (virtuals || (getters && virtuals !== false)) { + applyVirtuals(this, ret, options, options); + } + + if (options.versionKey === false && this.$__schema.options.versionKey) { + delete ret[this.$__schema.options.versionKey]; + } + + const transform = options._calledWithOptions.transform ?? true; + let transformFunction = undefined; + if (transform === true) { + transformFunction = defaultOptions?.transform; + } else if (typeof transform === 'function') { + transformFunction = transform; + } + + // In the case where a subdocument has its own transform function, we need to + // check and see if the parent has a transform (options.transform) and if the + // child schema has a transform (this.schema.options.toObject) In this case, + // we need to adjust options.transform to be the child schema's transform and + // not the parent schema's + if (transform) { + applySchemaTypeTransforms(this, ret); + } + + if (options.useProjection) { + omitDeselectedFields(this, ret); + } + + if (typeof transformFunction === 'function') { + const xformed = transformFunction(this, ret, options); + if (typeof xformed !== 'undefined') { + ret = xformed; + } + } + + return ret; +}; + +/*! + * Internal shallow clone alternative to `$toObject()`: much faster, no options processing + */ + +Document.prototype.$__toObjectShallow = function $__toObjectShallow(schemaFieldsOnly) { + const ret = {}; + if (this._doc != null) { + const keys = schemaFieldsOnly ? Object.keys(this.$__schema.paths) : Object.keys(this._doc); + for (const key of keys) { + // Safe to do this even in the schemaFieldsOnly case because we assume there's no nested paths + const value = this._doc[key]; + if (value instanceof Date) { + ret[key] = new Date(value); + } else if (value !== undefined) { + ret[key] = value; + } + } + } + + return ret; +}; + +/** + * Converts this document into a plain-old JavaScript object ([POJO](https://masteringjs.io/tutorials/fundamentals/pojo)). + * + * Buffers are converted to instances of [mongodb.Binary](https://mongodb.github.io/node-mongodb-native/7.0/classes/BSON.Binary.html) for proper storage. + * + * #### Getters/Virtuals + * + * Example of only applying path getters + * + * doc.toObject({ getters: true, virtuals: false }) + * + * Example of only applying virtual getters + * + * doc.toObject({ virtuals: true }) + * + * Example of applying both path and virtual getters + * + * doc.toObject({ getters: true }) + * + * To apply these options to every document of your schema by default, set your [schemas](https://mongoosejs.com/docs/api/schema.html#Schema()) `toObject` option to the same argument. + * + * schema.set('toObject', { virtuals: true }) + * + * #### Transform: + * + * We may need to perform a transformation of the resulting object based on some criteria, say to remove some sensitive information or return a custom object. In this case we set the optional `transform` function. + * + * Transform functions receive three arguments + * + * function (doc, ret, options) {} + * + * - `doc` The mongoose document which is being converted + * - `ret` The plain object representation which has been converted + * - `options` The options in use (either schema options or the options passed inline) + * + * #### Example: + * + * // specify the transform schema option + * if (!schema.options.toObject) schema.options.toObject = {}; + * schema.options.toObject.transform = function (doc, ret, options) { + * // remove the _id of every document before returning the result + * delete ret._id; + * return ret; + * } + * + * // without the transformation in the schema + * doc.toObject(); // { _id: 'anId', name: 'Wreck-it Ralph' } + * + * // with the transformation + * doc.toObject(); // { name: 'Wreck-it Ralph' } + * + * With transformations we can do a lot more than remove properties. We can even return completely new customized objects: + * + * if (!schema.options.toObject) schema.options.toObject = {}; + * schema.options.toObject.transform = function (doc, ret, options) { + * return { movie: ret.name } + * } + * + * // without the transformation in the schema + * doc.toObject(); // { _id: 'anId', name: 'Wreck-it Ralph' } + * + * // with the transformation + * doc.toObject(); // { movie: 'Wreck-it Ralph' } + * + * _Note: if a transform function returns `undefined`, the return value will be ignored._ + * + * Transformations may also be applied inline, overridding any transform set in the schema options. + * Any transform function specified in `toObject` options also propagates to any subdocuments. + * + * function deleteId(doc, ret, options) { + * delete ret._id; + * return ret; + * } + * + * const schema = mongoose.Schema({ name: String, docArr: [{ name: String }] }); + * const TestModel = mongoose.model('Test', schema); + * + * const doc = new TestModel({ name: 'test', docArr: [{ name: 'test' }] }); + * + * // pass the transform as an inline option. Deletes `_id` property + * // from both the top-level document and the subdocument. + * const obj = doc.toObject({ transform: deleteId }); + * obj._id; // undefined + * obj.docArr[0]._id; // undefined + * + * If you want to skip transformations, use `transform: false`: + * + * schema.options.toObject = { + * hide: '_id', + * transform: function(doc, ret, options) { + * if (options.hide) { + * options.hide.split(' ').forEach(function(prop) { + * delete ret[prop]; + * }); + * } + * return ret; + * } + * }; + * + * const doc = new Doc({ _id: 'anId', secret: 47, name: 'Wreck-it Ralph' }); + * doc.toObject(); // { secret: 47, name: 'Wreck-it Ralph' } + * doc.toObject({ hide: 'secret _id', transform: false });// { _id: 'anId', secret: 47, name: 'Wreck-it Ralph' } + * doc.toObject({ hide: 'secret _id', transform: true }); // { name: 'Wreck-it Ralph' } + * + * If you pass a transform in `toObject()` options, Mongoose will apply the transform + * to [subdocuments](https://mongoosejs.com/docs/subdocs.html) in addition to the top-level document. + * Similarly, `transform: false` skips transforms for all subdocuments. + * Note that this behavior is different for transforms defined in the schema: + * if you define a transform in `schema.options.toObject.transform`, that transform + * will **not** apply to subdocuments. + * + * const memberSchema = new Schema({ name: String, email: String }); + * const groupSchema = new Schema({ members: [memberSchema], name: String, email }); + * const Group = mongoose.model('Group', groupSchema); + * + * const doc = new Group({ + * name: 'Engineering', + * email: 'dev@mongoosejs.io', + * members: [{ name: 'Val', email: 'val@mongoosejs.io' }] + * }); + * + * // Removes `email` from both top-level document **and** array elements + * // { name: 'Engineering', members: [{ name: 'Val' }] } + * doc.toObject({ transform: (doc, ret) => { delete ret.email; return ret; } }); + * + * Transforms, like all of these options, are also available for `toJSON`. See [this guide to `JSON.stringify()`](https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript.html) to learn why `toJSON()` and `toObject()` are separate functions. + * + * See [schema options](https://mongoosejs.com/docs/guide.html#toObject) for some more details. + * + * _During save, no custom options are applied to the document before being sent to the database._ + * + * @param {object} [options] + * @param {boolean} [options.getters=false] if true, apply all getters, including virtuals + * @param {boolean|object} [options.virtuals=false] if true, apply virtuals, including aliases. Use `{ getters: true, virtuals: false }` to just apply getters, not virtuals. An object of the form `{ pathsToSkip: ['someVirtual'] }` may also be used to omit specific virtuals. + * @param {boolean} [options.aliases=true] if `options.virtuals = true`, you can set `options.aliases = false` to skip applying aliases. This option is a no-op if `options.virtuals = false`. + * @param {boolean} [options.minimize=true] if true, omit any empty objects from the output + * @param {Function|null} [options.transform=null] if set, mongoose will call this function to allow you to transform the returned object + * @param {boolean} [options.depopulate=false] if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths. + * @param {boolean} [options.versionKey=true] if false, exclude the version key (`__v` by default) from the output + * @param {boolean} [options.flattenMaps=false] if true, convert Maps to POJOs. Useful if you want to `JSON.stringify()` the result of `toObject()`. + * @param {boolean} [options.flattenObjectIds=false] if true, convert any ObjectIds in the result to 24 character hex strings. + * @param {boolean} [options.flattenUUIDs=false] if true, convert any UUIDs in the result to 36-character UUID strings in 8-4-4-4-12 format. + * @param {boolean} [options.useProjection=false] - If true, omits fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema. + * @param {boolean} [options.schemaFieldsOnly=false] - If true, the resulting object will only have fields that are defined in the document's schema. By default, `toObject()` returns all fields in the underlying document from MongoDB, including ones that are not listed in the schema. + * @return {object} document as a plain old JavaScript object (POJO). This object may contain ObjectIds, Maps, Dates, mongodb.Binary, Buffers, and other non-POJO values. + * @see mongodb.Binary https://mongodb.github.io/node-mongodb-native/7.0/classes/BSON.Binary.html + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.toObject = function(options) { + return this.$toObject(options); +}; + +/*! + * Applies virtuals properties to `json`. + */ + +function applyVirtuals(self, json, options, toObjectOptions) { + const schema = self.$__schema; + const virtuals = schema.virtuals; + const paths = Object.keys(virtuals); + let i = paths.length; + const numPaths = i; + let path; + let assignPath; + let cur = self._doc; + let v; + const aliases = typeof toObjectOptions?.aliases === 'boolean' + ? toObjectOptions.aliases + : true; + + options = options || {}; + let virtualsToApply = null; + if (Array.isArray(options.virtuals)) { + virtualsToApply = new Set(options.virtuals); + } else if (options.virtuals?.pathsToSkip) { + virtualsToApply = new Set(paths); + for (let i = 0; i < options.virtuals.pathsToSkip.length; i++) { + if (virtualsToApply.has(options.virtuals.pathsToSkip[i])) { + virtualsToApply.delete(options.virtuals.pathsToSkip[i]); + } + } + } + + if (!cur) { + return json; + } + + for (i = 0; i < numPaths; ++i) { + path = paths[i]; + + if (virtualsToApply != null && !virtualsToApply.has(path)) { + continue; + } + + // Allow skipping aliases with `toObject({ virtuals: true, aliases: false })` + if (!aliases && Object.hasOwn(schema.aliases, path)) { + continue; + } + + // We may be applying virtuals to a nested object, for example if calling + // `doc.nestedProp.toJSON()`. If so, the path we assign to, `assignPath`, + // will be a trailing substring of the `path`. + assignPath = path; + if (options.path != null) { + if (!path.startsWith(options.path + '.')) { + continue; + } + assignPath = path.substring(options.path.length + 1); + } + if (assignPath.indexOf('.') === -1 && assignPath === path) { + v = virtuals[path].applyGetters(void 0, self); + if (v === void 0) { + continue; + } + v = clone(v, options); + json[assignPath] = v; + continue; + } + const parts = assignPath.split('.'); + v = clone(self.get(path), options); + if (v === void 0) { + continue; + } + const plen = parts.length; + cur = json; + for (let j = 0; j < plen - 1; ++j) { + cur[parts[j]] = cur[parts[j]] || {}; + cur = cur[parts[j]]; + } + cur[parts[plen - 1]] = v; + } + + return json; +} + + +/** + * Applies virtuals properties to `json`. + * + * @param {Document} self + * @param {object} json + * @return {object} `json` + * @api private + */ + +function applyGetters(self, json) { + const schema = self.$__schema; + const paths = Object.keys(schema.paths); + let i = paths.length; + let path; + let cur = self._doc; + let v; + + if (!cur) { + return json; + } + + while (i--) { + path = paths[i]; + + const schemaType = schema.paths[path]; + // Skip if no getters, including `$__isSelected()` because that can be expensive + if (!schemaType.getters?.length && !schemaType.embeddedSchemaType?.getters?.length) { + continue; + } + + if (!self.$__isSelected(path)) { + continue; + } + + if (path.indexOf('.') === -1) { + json[path] = schemaType.applyGetters( + json[path], + self + ); + if (Array.isArray(json[path]) && schemaType.embeddedSchemaType) { + for (let i = 0; i < json[path].length; ++i) { + json[path][i] = schemaType.embeddedSchemaType.applyGetters( + json[path][i], + self + ); + } + } + continue; + } + + const parts = path.split('.'); + + const plen = parts.length; + const last = plen - 1; + let branch = json; + let part; + cur = self._doc; + + for (let ii = 0; ii < plen; ++ii) { + part = parts[ii]; + v = cur[part]; + // If we've reached a non-object part of the branch, continuing would + // cause "Cannot create property 'foo' on string 'bar'" error. + // Necessary for mongoose-intl plugin re: gh-14446 + if (branch != null && typeof branch !== 'object') { + break; + } else if (ii === last) { + branch[part] = schemaType.applyGetters( + branch[part], + self + ); + if (Array.isArray(branch[part]) && schemaType.embeddedSchemaType) { + for (let i = 0; i < branch[part].length; ++i) { + branch[part][i] = schemaType.embeddedSchemaType.applyGetters( + branch[part][i], + self + ); + } + } + } else if (v == null) { + if (part in cur) { + branch[part] = v; + } + break; + } else { + branch = branch[part] || (branch[part] = {}); + } + cur = v; + } + } + + return json; +} + +/** + * Applies schema type transforms to `json`. + * + * @param {Document} self + * @param {object} json + * @return {object} `json` + * @api private + */ + +function applySchemaTypeTransforms(self, json) { + const schema = self.$__schema; + const paths = schema.pathsWithTransforms(); + const cur = self._doc; + + if (!cur || !paths) { + return json; + } + + for (const path of paths) { + const schematype = schema.paths[path]; + const topLevelTransformFunction = schematype.options.transform ?? schematype.constructor?.defaultOptions?.transform; + const embeddedSchemaTypeTransformFunction = schematype.embeddedSchemaType?.options?.transform + ?? schematype.embeddedSchemaType?.constructor?.defaultOptions?.transform; + if (typeof topLevelTransformFunction === 'function') { + const val = self.$get(path); + if (val === undefined) { + continue; + } + const transformedValue = topLevelTransformFunction.call(self, val); + throwErrorIfPromise(path, transformedValue); + utils.setValue(path, transformedValue, json); + } else if (typeof embeddedSchemaTypeTransformFunction === 'function') { + const val = self.$get(path); + if (val === undefined) { + continue; + } + const vals = [].concat(val); + for (let i = 0; i < vals.length; ++i) { + const transformedValue = embeddedSchemaTypeTransformFunction.call(self, vals[i]); + vals[i] = transformedValue; + throwErrorIfPromise(path, transformedValue); + } + + json[path] = vals; + } + } + + return json; +} + +function throwErrorIfPromise(path, transformedValue) { + if (isPromise(transformedValue)) { + throw new Error('`transform` function must be synchronous, but the transform on path `' + path + '` returned a promise.'); + } +} + +/*! + * ignore + */ + +function omitDeselectedFields(self, json) { + const schema = self.$__schema; + const paths = Object.keys(schema.paths || {}); + const cur = self._doc; + + if (!cur) { + return json; + } + + let selected = self.$__.selected; + if (selected === void 0) { + selected = {}; + queryhelpers.applyPaths(selected, schema); + } + if (selected == null || utils.hasOwnKeys(selected) === false) { + return json; + } + + for (const path of paths) { + if (selected[path] != null && !selected[path]) { + delete json[path]; + } + } + + return json; +} + +/** + * The return value of this method is used in calls to [`JSON.stringify(doc)`](https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript#the-tojson-function). + * + * This method accepts the same options as [Document#toObject](https://mongoosejs.com/docs/api/document.html#Document.prototype.toObject()). To apply the options to every document of your schema by default, set your [schemas](https://mongoosejs.com/docs/api/schema.html#Schema()) `toJSON` option to the same argument. + * + * schema.set('toJSON', { virtuals: true }); + * + * There is one difference between `toJSON()` and `toObject()` options. + * When you call `toJSON()`, the [`flattenMaps` option](https://mongoosejs.com/docs/api/document.html#Document.prototype.toObject()) defaults to `true`, because `JSON.stringify()` doesn't convert maps to objects by default. + * When you call `toObject()`, the `flattenMaps` option is `false` by default. + * + * See [schema options](https://mongoosejs.com/docs/guide.html#toJSON) for more information on setting `toJSON` option defaults. + * + * @param {object} options + * @param {boolean} [options.flattenMaps=true] if true, convert Maps to [POJOs](https://masteringjs.io/tutorials/fundamentals/pojo). Useful if you want to `JSON.stringify()` the result. + * @param {boolean} [options.flattenObjectIds=false] if true, convert any ObjectIds in the result to 24 character hex strings. + * @param {boolean} [options.flattenUUIDs=false] if true, convert any UUIDs in the result to 36-character UUID strings in 8-4-4-4-12 format. + * @param {boolean} [options.schemaFieldsOnly=false] - If true, the resulting object will only have fields that are defined in the document's schema. By default, `toJSON()` returns all fields in the underlying document from MongoDB, including ones that are not listed in the schema. + * @return {object} + * @see Document#toObject https://mongoosejs.com/docs/api/document.html#Document.prototype.toObject() + * @see JSON.stringify() in JavaScript https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript.html + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.toJSON = function(options) { + return this.$toObject(options, true); +}; + +/*! + * ignore + */ + +Document.prototype.ownerDocument = function() { + return this; +}; + + +/** + * If this document is a subdocument or populated document, returns the document's + * parent. Returns the original document if there is no parent. + * + * @return {Document} + * @api public + * @method parent + * @memberOf Document + * @instance + */ + +Document.prototype.parent = function() { + if (this.$isSubdocument || this.$__.wasPopulated) { + return this.$__.parent; + } + return this; +}; + +/** + * Alias for [`parent()`](https://mongoosejs.com/docs/api/document.html#Document.prototype.parent()). If this document is a subdocument or populated + * document, returns the document's parent. Returns `undefined` otherwise. + * + * @return {Document} + * @api public + * @method $parent + * @memberOf Document + * @instance + */ + +Document.prototype.$parent = Document.prototype.parent; + +/** + * Set the parent of this document. + * + * @param {Document} parent + * @api private + * @method $__setParent + * @memberOf Document + * @instance + */ + +Document.prototype.$__setParent = function $__setParent(parent) { + this.$__.parent = parent; + this.$__parent = parent; +}; + +/** + * Helper for console.log + * + * @return {string} + * @api public + * @method inspect + * @memberOf Document + * @instance + */ + +Document.prototype.inspect = function(options) { + const isPOJO = utils.isPOJO(options); + let opts; + if (isPOJO) { + opts = options; + opts.minimize = false; + } + + const ret = arguments.length > 0 ? this.toObject(opts) : this.toObject(); + + if (ret == null) { + // If `toObject()` returns null, `this` is still an object, so if `inspect()` + // prints out null this can cause some serious confusion. See gh-7942. + return 'MongooseDocument { ' + ret + ' }'; + } + + return ret; +}; + +if (inspect.custom) { + // Avoid Node deprecation warning DEP0079 + Document.prototype[inspect.custom] = Document.prototype.inspect; +} + +/** + * Helper for console.log + * + * @return {string} + * @api public + * @method toString + * @memberOf Document + * @instance + */ + +Document.prototype.toString = function() { + const ret = this.inspect(); + if (typeof ret === 'string') { + return ret; + } + return inspect(ret); +}; + +/** + * Returns true if this document is equal to another document. + * + * Documents are considered equal when they have matching `_id`s, unless neither + * document has an `_id`, in which case this function falls back to using + * `deepEqual()`. + * + * @param {Document} [doc] a document to compare. If falsy, will always return "false". + * @return {boolean} + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.equals = function(doc) { + if (!doc) { + return false; + } + + const tid = this.$__getValue('_id'); + const docid = doc.$__ != null ? doc.$__getValue('_id') : doc; + if (!tid && !docid) { + return deepEqual(this, doc); + } + return tid && tid.equals + ? tid.equals(docid) + : tid === docid; +}; + +/** + * Populates paths on an existing document. + * + * #### Example: + * + * // Given a document, `populate()` lets you pull in referenced docs + * await doc.populate([ + * 'stories', + * { path: 'fans', sort: { name: -1 } } + * ]); + * doc.populated('stories'); // Array of ObjectIds + * doc.stories[0].title; // 'Casino Royale' + * doc.populated('fans'); // Array of ObjectIds + * + * // If the referenced doc has been deleted, `populate()` will + * // remove that entry from the array. + * await Story.delete({ title: 'Casino Royale' }); + * await doc.populate('stories'); // Empty array + * + * // You can also pass additional query options to `populate()`, + * // like projections: + * await doc.populate('fans', '-email'); + * doc.fans[0].email // undefined because of 2nd param `select` + * + * @param {string|object|Array} path either the path to populate or an object specifying all parameters, or either an array of those + * @param {object|string} [select] Field selection for the population query + * @param {Model} [model] The model you wish to use for population. If not specified, populate will look up the model by the name in the Schema's `ref` field. + * @param {object} [match] Conditions for the population query + * @param {object} [options] Options for the population query (sort, etc) + * @param {string} [options.path=null] The path to populate. + * @param {string|PopulateOptions} [options.populate=null] Recursively populate paths in the populated documents. See [deep populate docs](https://mongoosejs.com/docs/populate.html#deep-populate). + * @param {boolean} [options.retainNullValues=false] by default, Mongoose removes null and undefined values from populated arrays. Use this option to make `populate()` retain `null` and `undefined` array entries. + * @param {boolean} [options.getters=false] if true, Mongoose will call any getters defined on the `localField`. By default, Mongoose gets the raw value of `localField`. For example, you would need to set this option to `true` if you wanted to [add a `lowercase` getter to your `localField`](https://mongoosejs.com/docs/schematypes.html#schematype-options). + * @param {boolean} [options.clone=false] When you do `BlogPost.find().populate('author')`, blog posts with the same author will share 1 copy of an `author` doc. Enable this option to make Mongoose clone populated docs before assigning them. + * @param {object|Function} [options.match=null] Add an additional filter to the populate query. Can be a filter object containing [MongoDB query syntax](https://www.mongodb.com/docs/manual/tutorial/query-documents/), or a function that returns a filter object. + * @param {boolean} [options.skipInvalidIds=false] By default, Mongoose throws a cast error if `localField` and `foreignField` schemas don't line up. If you enable this option, Mongoose will instead filter out any `localField` properties that cannot be casted to `foreignField`'s schema type. + * @param {number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results when populating multiple parent documents because it executes a single query for all parents. If you set `perDocumentLimit`, Mongoose will execute a separate query per parent document to ensure correct per-document `limit`. + * @param {boolean} [options.strictPopulate=true] Set to false to allow populating paths that aren't defined in the given model's schema. + * @param {Function} [options.transform=null] Function that Mongoose will call on every populated document that allows you to transform the populated document. + * @param {object} [options.options=null] Additional options like `limit` and `lean`. + * @param {boolean} [options.forceRepopulate=true] Set to `false` to prevent Mongoose from repopulating paths that are already populated + * @param {boolean} [options.ordered=false] Set to `true` to execute any populate queries one at a time, as opposed to in parallel. We recommend setting this option to `true` if using transactions, especially if also populating multiple paths or paths with multiple models. MongoDB server does **not** support multiple operations in parallel on a single transaction. + * @param {Function} [callback] Callback + * @see population https://mongoosejs.com/docs/populate.html + * @see Query#select https://mongoosejs.com/docs/api/query.html#Query.prototype.select() + * @see Model.populate https://mongoosejs.com/docs/api/model.html#Model.populate() + * @memberOf Document + * @instance + * @return {Promise|null} Returns a Promise if no `callback` is given. + * @api public + */ + +Document.prototype.populate = async function populate() { + const pop = {}; + const args = [...arguments]; + if (typeof args[args.length - 1] === 'function') { + throw new MongooseError('Document.prototype.populate() no longer accepts a callback'); + } + + if (args.length !== 0) { + // use hash to remove duplicate paths + const res = utils.populate.apply(null, args); + for (const populateOptions of res) { + pop[populateOptions.path] = populateOptions; + } + } + + const paths = utils.object.vals(pop); + + let topLevelModel = this.constructor; + if (this.$__isNested) { + topLevelModel = this.$__[scopeSymbol].constructor; + const nestedPath = this.$__.nestedPath; + paths.forEach(function(populateOptions) { + populateOptions.path = nestedPath + '.' + populateOptions.path; + }); + } + + // Use `$session()` by default if the document has an associated session + // See gh-6754 + if (this.$session() != null) { + const session = this.$session(); + paths.forEach(path => { + if (path.options == null) { + path.options = { session: session }; + return; + } + if (!('session' in path.options)) { + path.options.session = session; + } + }); + } + + paths.forEach(p => { + p._localModel = topLevelModel; + }); + + return topLevelModel.populate(this, paths); +}; + +/** + * Gets all populated documents associated with this document. + * + * @api public + * @return {Document[]} array of populated documents. Empty array if there are no populated documents associated with this document. + * @memberOf Document + * @method $getPopulatedDocs + * @instance + */ + +Document.prototype.$getPopulatedDocs = function $getPopulatedDocs() { + let keys = []; + if (this.$__.populated != null) { + keys = keys.concat(Object.keys(this.$__.populated)); + } + let result = []; + for (const key of keys) { + const value = this.$get(key); + if (Array.isArray(value)) { + result = result.concat(value); + } else if (value instanceof Document) { + result.push(value); + } + } + return result; +}; + +/** + * Gets _id(s) used during population of the given `path`. + * + * #### Example: + * + * const doc = await Model.findOne().populate('author'); + * + * console.log(doc.author.name); // Dr.Seuss + * console.log(doc.populated('author')); // '5144cf8050f071d979c118a7' + * + * If the path was not populated, returns `undefined`. + * + * @param {string} path + * @param {any} [val] + * @param {object} [options] + * @return {Array|ObjectId|number|Buffer|string|undefined} + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.populated = function(path, val, options) { + // val and options are internal + if (val == null || val === true) { + if (!this.$__.populated) { + return undefined; + } + if (typeof path !== 'string') { + return undefined; + } + + // Map paths can be populated with either `path.$*` or just `path` + const _path = path.endsWith('.$*') ? path.replace(/\.\$\*$/, '') : path; + + const v = this.$__.populated[_path]; + if (v) { + return val === true ? v : v.value; + } + return undefined; + } + + this.$__.populated || (this.$__.populated = {}); + this.$__.populated[path] = { value: val, options: options }; + + // If this was a nested populate, make sure each populated doc knows + // about its populated children (gh-7685) + const pieces = path.split('.'); + for (let i = 0; i < pieces.length - 1; ++i) { + const subpath = pieces.slice(0, i + 1).join('.'); + const subdoc = this.$get(subpath); + if (subdoc?.$__ != null && this.$populated(subpath)) { + const rest = pieces.slice(i + 1).join('.'); + subdoc.$populated(rest, val, options); + // No need to continue because the above recursion should take care of + // marking the rest of the docs as populated + break; + } + } + + return val; +}; + +/** + * Alias of [`.populated`](https://mongoosejs.com/docs/api/document.html#Document.prototype.populated()). + * + * @method $populated + * @memberOf Document + * @api public + */ + +Document.prototype.$populated = Document.prototype.populated; + +/** + * Throws an error if a given path is not populated + * + * #### Example: + * + * const doc = await Model.findOne().populate('author'); + * + * doc.$assertPopulated('author'); // does not throw + * doc.$assertPopulated('other path'); // throws an error + * + * // Manually populate and assert in one call. The following does + * // `doc.$set({ likes })` before asserting. + * doc.$assertPopulated('likes', { likes }); + * + * + * @param {string|string[]} path path or array of paths to check. `$assertPopulated` throws if any of the given paths is not populated. + * @param {object} [values] optional values to `$set()`. Convenient if you want to manually populate a path and assert that the path was populated in 1 call. + * @return {Document} this + * @memberOf Document + * @method $assertPopulated + * @instance + * @api public + */ + +Document.prototype.$assertPopulated = function $assertPopulated(path, values) { + if (Array.isArray(path)) { + path.forEach(p => this.$assertPopulated(p, values)); + return this; + } + + if (arguments.length > 1) { + this.$set(values); + } + + if (!this.$populated(path)) { + throw new MongooseError(`Expected path "${path}" to be populated`); + } + + return this; +}; + +/** + * Takes a populated field and returns it to its unpopulated state. + * + * #### Example: + * + * Model.findOne().populate('author').exec(function (err, doc) { + * console.log(doc.author.name); // Dr.Seuss + * console.log(doc.depopulate('author')); + * console.log(doc.author); // '5144cf8050f071d979c118a7' + * }) + * + * If the path was not provided, then all populated fields are returned to their unpopulated state. + * + * @param {string|string[]} [path] Specific Path to depopulate. If unset, will depopulate all paths on the Document. Or multiple space-delimited paths. + * @return {Document} this + * @see Document.populate https://mongoosejs.com/docs/api/document.html#Document.prototype.populate() + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.depopulate = function(path) { + if (typeof path === 'string') { + path = path.indexOf(' ') === -1 ? [path] : path.split(' '); + } + + let populatedIds; + const virtualKeys = this.$$populatedVirtuals ? Object.keys(this.$$populatedVirtuals) : []; + const populated = this.$__?.populated || {}; + + if (arguments.length === 0) { + // Depopulate all + for (const virtualKey of virtualKeys) { + delete this.$$populatedVirtuals[virtualKey]; + delete this._doc[virtualKey]; + delete populated[virtualKey]; + } + + const keys = Object.keys(populated); + + for (const key of keys) { + populatedIds = this.$populated(key); + if (!populatedIds) { + continue; + } + delete populated[key]; + if (Array.isArray(populatedIds)) { + const arr = utils.getValue(key, this._doc); + if (arr.isMongooseArray) { + const rawArray = arr.__array; + for (let i = 0; i < rawArray.length; ++i) { + const subdoc = rawArray[i]; + if (subdoc == null) { + continue; + } + rawArray[i] = subdoc instanceof Document ? subdoc._doc._id : subdoc._id; + } + } else { + utils.setValue(key, populatedIds, this._doc); + } + } else { + utils.setValue(key, populatedIds, this._doc); + } + } + return this; + } + + for (const singlePath of path) { + populatedIds = this.$populated(singlePath); + delete populated[singlePath]; + + if (virtualKeys.indexOf(singlePath) !== -1) { + delete this.$$populatedVirtuals[singlePath]; + delete this._doc[singlePath]; + } else if (populatedIds) { + if (Array.isArray(populatedIds)) { + const arr = utils.getValue(singlePath, this._doc); + if (arr.isMongooseArray) { + const rawArray = arr.__array; + for (let i = 0; i < rawArray.length; ++i) { + const subdoc = rawArray[i]; + if (subdoc == null) { + continue; + } + rawArray[i] = subdoc instanceof Document ? subdoc._doc._id : subdoc._id; + } + } else { + utils.setValue(singlePath, populatedIds, this._doc); + } + } else { + utils.setValue(singlePath, populatedIds, this._doc); + } + } + } + return this; +}; + + +/** + * Returns the full path to this document. + * + * @param {string} [path] + * @return {string} + * @api private + * @method $__fullPath + * @memberOf Document + * @instance + */ + +Document.prototype.$__fullPath = function(path) { + // overridden in SubDocuments + return path || ''; +}; + +/** + * Returns the changes that happened to the document + * in the format that will be sent to MongoDB. + * + * #### Example: + * + * const userSchema = new Schema({ + * name: String, + * age: Number, + * country: String + * }); + * const User = mongoose.model('User', userSchema); + * const user = await User.create({ + * name: 'Hafez', + * age: 25, + * country: 'Egypt' + * }); + * + * // returns an empty object, no changes happened yet + * user.$getChanges(); // { } + * + * user.country = undefined; + * user.age = 26; + * + * user.$getChanges(); // { $set: { age: 26 }, { $unset: { country: 1 } } } + * + * await user.save(); + * + * user.$getChanges(); // { } + * + * Modifying the object that `$getChanges()` returns does not affect the document's + * change tracking state. Even if you `delete user.$getChanges().$set`, Mongoose + * will still send a `$set` to the server. + * + * @return {object} + * @api public + * @method $getChanges + * @memberOf Document + * @instance + */ + +Document.prototype.$getChanges = function() { + const delta = this.$__delta(); + const changes = delta ? delta[1] : {}; + return changes; +}; + +/** + * **Deprecated.** Use `$getChanges()` instead. + * + * Returns the changes that happened to the document + * in the format that will be sent to MongoDB. + * + * @return {Object} + * @deprecated Use `$getChanges()` instead. `getChanges` does not use the `$` prefix convention and may conflict with user-defined schema methods/properties. + * @api public + * @method getChanges + * @memberOf Document + * @instance + */ + +Document.prototype.getChanges = function() { + utils.warn('`getChanges()` is deprecated, use `$getChanges()` instead.'); + return this.$getChanges(); +}; + +/** + * Produces a special query document of the modified properties used in updates. + * + * @param {string[]|null} [pathsToSave] paths to include in delta generation + * @param {Set|null} [pathsToSaveSet] pre-built Set of pathsToSave for O(1) exact lookup + * @api private + * @method $__delta + * @memberOf Document + * @instance + */ + +Document.prototype.$__delta = function $__delta(pathsToSave, pathsToSaveSet) { + const allDirty = this.$__dirty(); + let dirty = allDirty; + let unsavedDirty = null; + if (pathsToSave != null) { + dirty = []; + unsavedDirty = []; + for (const data of allDirty) { + if (isInPathsToSave(data.path, pathsToSaveSet, pathsToSave)) { + dirty.push(data); + } else { + unsavedDirty.push(data); + } + } + } + const optimisticConcurrency = this.$__schema.options.optimisticConcurrency; + if (optimisticConcurrency) { + if (Array.isArray(optimisticConcurrency)) { + if (!this.$__schema.options._optimisticConcurrencyTrie) { + this.$__schema.options._optimisticConcurrencyTrie = new PathTrie(optimisticConcurrency); + } + const optimisticConcurrencyTrie = this.$__schema.options._optimisticConcurrencyTrie; + const modPaths = this.directModifiedPaths(); + const hasRelevantModPaths = pathsToSave == null ? + modPaths.find(path => optimisticConcurrencyTrie.overlapsPath(path.indexOf('.') === -1 ? path : path.split('.'))) : + modPaths.find(path => optimisticConcurrencyTrie.overlapsPath(path.indexOf('.') === -1 ? path : path.split('.')) && isInPathsToSave(path, pathsToSaveSet, pathsToSave)); + if (hasRelevantModPaths) { + this.$__.version = dirty.length ? VERSION_ALL : VERSION_WHERE; + } + } else if (Array.isArray(optimisticConcurrency?.exclude)) { + if (!this.$__schema.options._optimisticConcurrencyExcludeTrie) { + this.$__schema.options._optimisticConcurrencyExcludeTrie = new PathTrie(optimisticConcurrency.exclude); + } + const optimisticConcurrencyExcludeTrie = this.$__schema.options._optimisticConcurrencyExcludeTrie; + const modPaths = this.directModifiedPaths(); + const hasRelevantModPaths = pathsToSave == null ? + modPaths.find(path => !optimisticConcurrencyExcludeTrie.matchesPathOrAncestor(path.indexOf('.') === -1 ? path : path.split('.'))) : + modPaths.find(path => !optimisticConcurrencyExcludeTrie.matchesPathOrAncestor(path.indexOf('.') === -1 ? path : path.split('.')) && isInPathsToSave(path, pathsToSaveSet, pathsToSave)); + if (hasRelevantModPaths) { + this.$__.version = dirty.length ? VERSION_ALL : VERSION_WHERE; + } + } else { + this.$__.version = dirty.length ? VERSION_ALL : VERSION_WHERE; + } + } + + if (!dirty.length && VERSION_ALL !== this.$__.version) { + return; + } + const where = {}; + const delta = {}; + const len = dirty.length; + const divergent = []; + let d = 0; + + where._id = this._doc._id; + // If `_id` is an object, need to depopulate, but also need to be careful + // because `_id` can technically be null (see gh-6406) + if (where?._id?.$__ != null) { + where._id = where._id.toObject({ transform: false, depopulate: true }); + } + for (; d < len; ++d) { + const data = dirty[d]; + let value = data.value; + const match = checkDivergentArray(this, data.path, value); + if (match) { + divergent.push(match); + continue; + } + + const pop = this.$populated(data.path, true); + if (!pop && this.$__.selected) { + // If any array was selected using an $elemMatch projection, we alter the path and where clause + // NOTE: MongoDB only supports projected $elemMatch on top level array. + const pathSplit = data.path.split('.'); + const top = pathSplit[0]; + if (this.$__.selected[top] && this.$__.selected[top].$elemMatch) { + // If the selected array entry was modified + if (pathSplit.length > 1 && pathSplit[1] == 0 && typeof where[top] === 'undefined') { + where[top] = this.$__.selected[top]; + pathSplit[1] = '$'; + data.path = pathSplit.join('.'); + } + // if the selected array was modified in any other way throw an error + else { + divergent.push(data.path); + continue; + } + } + } + + // If this path is set to default, and either this path or one of + // its parents is excluded, don't treat this path as dirty. + if (this.$isDefault(data.path) && this.$__.selected) { + if (data.path.indexOf('.') === -1 && isPathExcluded(this.$__.selected, data.path)) { + continue; + } + + const pathsToCheck = parentPaths(data.path); + if (pathsToCheck.find(path => isPathExcluded(this.$__.isSelected, path))) { + continue; + } + } + + if (divergent.length) continue; + if (value === undefined) { + operand(this, where, delta, data, 1, '$unset'); + } else if (value === null) { + operand(this, where, delta, data, null); + } else if (typeof value.getAtomics === 'function') { + // arrays and other custom container types + handleAtomics(this, where, delta, data, value); + } else if (value[MongooseBuffer.pathSymbol] && Buffer.isBuffer(value)) { + // MongooseBuffer + value = value.toObject(); + operand(this, where, delta, data, value); + } else { + if (this.$__.primitiveAtomics?.[data.path] != null) { + const val = this.$__.primitiveAtomics[data.path]; + const op = firstKey(val); + operand(this, where, delta, data, val[op], op); + } else { + value = clone(value, { + depopulate: true, + transform: false, + virtuals: false, + getters: false, + omitUndefined: true, + _isNested: true + }); + operand(this, where, delta, data, value); + } + } + } + + if (divergent.length) { + throw new DivergentArrayError(divergent); + } + + if (this.$__.version) { + this.$__version(where, delta); + } + + if (utils.hasOwnKeys(delta) === false) { + return [where, null, unsavedDirty]; + } + + return [where, delta, unsavedDirty]; +}; + +/** + * Determine if array was populated with some form of filter and is now + * being updated in a manner which could overwrite data unintentionally. + * + * @see https://github.com/Automattic/mongoose/issues/1334 + * @param {Document} doc + * @param {string} path + * @param {any} array + * @return {string|undefined} + * @api private + */ + +function checkDivergentArray(doc, path, array) { + // see if we populated this path + const pop = doc.$populated(path, true); + + if (!pop && doc.$__.selected) { + // If any array was selected using an $elemMatch projection, we deny the update. + // NOTE: MongoDB only supports projected $elemMatch on top level array. + const top = path.split('.')[0]; + if (doc.$__.selected[top] && doc.$__.selected[top].$slice != null && utils.isMongooseArray(array)) { + const atomics = array[arrayAtomicsSymbol]; + if (atomics.$set) { + return top; + } + } + if (doc.$__.selected[top + '.$']) { + return top; + } + } + + if (!(pop && utils.isMongooseArray(array))) return; + + // If the array was populated using options that prevented all + // documents from being returned (match, skip, limit) or they + // deselected the _id field, $pop and $set of the array are + // not safe operations. If _id was deselected, we do not know + // how to remove elements. $pop will pop off the _id from the end + // of the array in the db which is not guaranteed to be the + // same as the last element we have here. $set of the entire array + // would be similarly destructive as we never received all + // elements of the array and potentially would overwrite data. + const check = pop.options.match || + pop.options.options && Object.hasOwn(pop.options.options, 'limit') || // 0 is not permitted + pop.options.options?.skip || // 0 is permitted + pop.options.select && // deselected _id? + (pop.options.select._id === 0 || + /\s?-_id\s?/.test(pop.options.select)); + + if (check) { + const atomics = array[arrayAtomicsSymbol]; + if (utils.hasOwnKeys(atomics) === false || atomics.$set || atomics.$pop) { + return path; + } + } +} + +/** + * Apply the operation to the delta (update) clause as + * well as track versioning for our where clause. + * + * @param {Document} self + * @param {object} where Unused + * @param {object} delta + * @param {object} data + * @param {Mixed} val + * @param {string} [op] + * @api private + */ + +function operand(self, where, delta, data, val, op) { + // delta + op || (op = '$set'); + if (!delta[op]) delta[op] = {}; + delta[op][data.path] = val; + // disabled versioning? + if (self.$__schema.options.versionKey === false) return; + + // path excluded from versioning? + if (shouldSkipVersioning(self, data.path)) return; + + // already marked for versioning? + if (VERSION_ALL === (VERSION_ALL & self.$__.version)) return; + + if ( + self.$__schema.options.optimisticConcurrency === true || + Array.isArray(self.$__schema.options.optimisticConcurrency) || + Array.isArray(self.$__schema.options.optimisticConcurrency?.exclude) + ) { + return; + } + + switch (op) { + case '$set': + case '$unset': + case '$pop': + case '$pull': + case '$pullAll': + case '$push': + case '$addToSet': + case '$inc': + break; + default: + // nothing to do + return; + } + + // ensure updates sent with positional notation are + // editing the correct array element. + // only increment the version if an array position changes. + // modifying elements of an array is ok if position does not change. + if (op === '$push' || op === '$addToSet' || op === '$pullAll' || op === '$pull') { + if (/\.\d+\.|\.\d+$/.test(data.path)) { + self.$__.version = VERSION_ALL; + } else { + self.$__.version |= VERSION_INC; + } + } else if (/^\$p/.test(op)) { + // potentially changing array positions + self.$__.version = VERSION_ALL; + } else if (Array.isArray(val)) { + // $set an array + self.$__.version = VERSION_ALL; + } else if (/\.\d+\.|\.\d+$/.test(data.path)) { + // now handling $set, $unset + // subpath of array + self.$__.version |= VERSION_WHERE; + } +} + +/** + * Compiles an update and where clause for a `val` with _atomics. + * + * @param {Document} self + * @param {object} where + * @param {object} delta + * @param {object} data + * @param {Array} value + * @api private + */ + +function handleAtomics(self, where, delta, data, value) { + if (delta.$set?.[data.path]) { + // $set has precedence over other atomics + return; + } + + if (typeof value.getAtomics === 'function') { + value.getAtomics().forEach(function(atomic) { + const op = atomic[0]; + const val = atomic[1]; + operand(self, where, delta, data, val, op); + }); + return; + } + + if (typeof value.$__getAtomics === 'function') { + value.$__getAtomics().forEach(function(atomic) { + const op = atomic[0]; + const val = atomic[1]; + operand(self, where, delta, data, val, op); + }); + return; + } + + // legacy support for plugins + + const atomics = value[arrayAtomicsSymbol]; + const ops = Object.keys(atomics); + let i = ops.length; + let val; + let op; + + if (i === 0) { + // $set + + if (utils.isMongooseObject(value)) { + value = value.toObject({ depopulate: 1, _isNested: true }); + } else if (value.valueOf) { + value = value.valueOf(); + } + + return operand(self, where, delta, data, value); + } + + function iter(mem) { + return utils.isMongooseObject(mem) + ? mem.toObject({ depopulate: 1, _isNested: true }) + : mem; + } + + while (i--) { + op = ops[i]; + val = atomics[op]; + + if (utils.isMongooseObject(val)) { + val = val.toObject({ depopulate: true, transform: false, _isNested: true }); + } else if (Array.isArray(val)) { + val = val.map(iter); + } else if (val.valueOf) { + val = val.valueOf(); + } + + if (op === '$addToSet') { + val = { $each: val }; + } + + operand(self, where, delta, data, val, op); + } +} + +/** + * Determines whether versioning should be skipped for the given path + * + * @param {Document} self + * @param {string} path + * @return {boolean} true if versioning should be skipped for the given path + * @api private + */ +function shouldSkipVersioning(self, path) { + const skipVersioning = self.$__schema.options.skipVersioning; + if (!skipVersioning) return false; + + // Remove any array indexes from the path + path = path.replace(/\.\d+\./, '.'); + + return skipVersioning[path]; +} + +/** + * Returns a copy of this document with a deep clone of `_doc` and `$__`. + * + * @return {Document} a copy of this document + * @api public + * @method $clone + * @memberOf Document + * @instance + */ + +Document.prototype.$clone = function() { + const Model = this.constructor; + const clonedDoc = new Model(); + clonedDoc.$isNew = this.$isNew; + if (this._doc) { + clonedDoc._doc = clone(this._doc, { retainDocuments: true, parentDoc: clonedDoc }); + } + if (this.$__) { + const Cache = this.$__.constructor; + const clonedCache = new Cache(); + for (const key of Object.getOwnPropertyNames(this.$__)) { + if (key === 'activePaths') { + continue; + } + clonedCache[key] = clone(this.$__[key]); + } + Object.assign( + clonedCache.activePaths, + clone({ ...this.$__.activePaths }) + ); + clonedDoc.$__ = clonedCache; + } + return clonedDoc; +}; + +/** + * Creates a snapshot of this document's internal change tracking state. You can later + * reset this document's change tracking state using `$restoreModifiedPathsSnapshot()`. + * + * #### Example: + * + * const doc = await TestModel.findOne(); + * const snapshot = doc.$createModifiedPathsSnapshot(); + * + * @return {ModifiedPathsSnapshot} a copy of this document's internal change tracking state + * @api public + * @method $createModifiedPathsSnapshot + * @memberOf Document + * @instance + */ + +Document.prototype.$createModifiedPathsSnapshot = function $createModifiedPathsSnapshot() { + const subdocSnapshot = new WeakMap(); + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + subdocSnapshot.set(child, child.$__.activePaths.clone()); + } + } + + return new ModifiedPathsSnapshot( + subdocSnapshot, + this.$__.activePaths.clone(), + this.$__.version + ); +}; + +/** + * Restore this document's change tracking state to the given snapshot. + * Note that `$restoreModifiedPathsSnapshot()` does **not** modify the document's + * properties, just resets the change tracking state. + * + * This method is especially useful when writing [custom transaction wrappers](https://github.com/Automattic/mongoose/issues/14268#issuecomment-2100505554) that need to restore change tracking when aborting a transaction. + * + * #### Example: + * + * const doc = await TestModel.findOne(); + * const snapshot = doc.$createModifiedPathsSnapshot(); + * + * doc.name = 'test'; + * doc.$restoreModifiedPathsSnapshot(snapshot); + * doc.$isModified('name'); // false because `name` was not modified when snapshot was taken + * doc.name; // 'test', `$restoreModifiedPathsSnapshot()` does **not** modify the document's data, only change tracking + * + * @param {ModifiedPathsSnapshot} snapshot of the document's internal change tracking state snapshot to restore + * @api public + * @method $restoreModifiedPathsSnapshot + * @return {Document} this + * @memberOf Document + * @instance + */ + +Document.prototype.$restoreModifiedPathsSnapshot = function $restoreModifiedPathsSnapshot(snapshot) { + this.$__.activePaths = snapshot.activePaths.clone(); + this.$__.version = snapshot.version; + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + if (snapshot.subdocSnapshot.has(child)) { + child.$__.activePaths = snapshot.subdocSnapshot.get(child); + } + } + } + + return this; +}; + +/** + * Clear the document's modified paths. + * + * #### Example: + * + * const doc = await TestModel.findOne(); + * + * doc.name = 'test'; + * doc.$isModified('name'); // true + * + * doc.$clearModifiedPaths(); + * doc.name; // 'test', `$clearModifiedPaths()` does **not** modify the document's data, only change tracking + * + * @api public + * @return {Document} this + * @method $clearModifiedPaths + * @memberOf Document + * @instance + */ + +Document.prototype.$clearModifiedPaths = function $clearModifiedPaths() { + this.$__.activePaths.clear('modify'); + this.$__.activePaths.clear('init'); + this.$__.version = 0; + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + child.$clearModifiedPaths(); + } + } + + return this; +}; + +/*! + * Check if the given document only has primitive values + */ + +Document.prototype.$__hasOnlyPrimitiveValues = function $__hasOnlyPrimitiveValues() { + if (this.$__.populated) { + return false; + } + const doc = this._doc; + for (const key in doc) { + const v = doc[key]; + if (v == null || typeof v !== 'object') { + continue; + } + // Equivalent to `isNativeObject(v) && !Array.isArray(v)`, plus the + // `isBsonType()` checks below, but without the helper calls or the + // repeated `Array.isArray()`. This runs for every key of every document + // that `toObject()` touches, so the call overhead is measurable. + if (Array.isArray(v)) { + return false; + } + if (v instanceof Date || v instanceof Boolean || v instanceof Number || v instanceof String) { + continue; + } + const bsontype = v._bsontype; + if (bsontype === 'ObjectId' || bsontype === 'Decimal128') { + continue; + } + return false; + } + return true; +}; + +/*! + * Increment this document's version if necessary. + */ + +Document.prototype._applyVersionIncrement = function _applyVersionIncrement() { + if (!this.$__.version) return; + const doIncrement = VERSION_INC === (VERSION_INC & this.$__.version); + + this.$__.version = undefined; + if (doIncrement) { + const key = this.$__schema.options.versionKey; + const version = this.$__getValue(key) || 0; + this.$__setValue(key, version + 1); // increment version if was successful + } +}; + +/*! + * Module exports. + */ + +Document.VERSION_WHERE = VERSION_WHERE; +Document.VERSION_INC = VERSION_INC; +Document.VERSION_ALL = VERSION_ALL; +Document.ValidationError = ValidationError; +module.exports = exports = Document; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/driver.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/driver.js new file mode 100644 index 00000000..cf7ca3d7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/driver.js @@ -0,0 +1,15 @@ +'use strict'; + +/*! + * ignore + */ + +let driver = null; + +module.exports.get = function() { + return driver; +}; + +module.exports.set = function(v) { + driver = v; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/SPEC.md b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/SPEC.md new file mode 100644 index 00000000..64646931 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/SPEC.md @@ -0,0 +1,4 @@ + +# Driver Spec + +TODO diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js new file mode 100644 index 00000000..e3c79b7e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js @@ -0,0 +1,5 @@ +'use strict'; + +const BulkWriteResult = require('mongodb/lib/bulk/common').BulkWriteResult; + +module.exports = BulkWriteResult; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js new file mode 100644 index 00000000..5db2e309 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js @@ -0,0 +1,426 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseCollection = require('../../collection'); +const MongooseError = require('../../error/mongooseError'); +const Collection = require('mongodb').Collection; +const ObjectId = require('../../types/objectid'); +const getConstructorName = require('../../helpers/getConstructorName'); +const internalToObjectOptions = require('../../options').internalToObjectOptions; +const stream = require('stream'); +const util = require('util'); + +const formatToObjectOptions = Object.freeze({ ...internalToObjectOptions, copyTrustedSymbol: false }); + +/** + * A [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) collection implementation. + * + * All methods methods from the [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) driver are copied and wrapped in queue management. + * + * @inherits Collection https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html + * @api private + */ + +function NativeCollection(name, conn, options) { + this.collection = null; + this.Promise = options.Promise || Promise; + this.modelName = options.modelName; + delete options.modelName; + this._closed = false; + MongooseCollection.apply(this, arguments); +} + +/*! + * Inherit from abstract Collection. + */ + +Object.setPrototypeOf(NativeCollection.prototype, MongooseCollection.prototype); + +/** + * Called when the connection opens. + * + * @api private + */ + +NativeCollection.prototype.onOpen = function() { + this.collection = this.conn.db.collection(this.name); + MongooseCollection.prototype.onOpen.call(this); + return this.collection; +}; + +/** + * Called when the connection closes + * + * @api private + */ + +NativeCollection.prototype.onClose = function(force) { + MongooseCollection.prototype.onClose.call(this, force); +}; + +/** + * Helper to get the collection, in case `this.collection` isn't set yet. + * May happen if `bufferCommands` is false and created the model when + * Mongoose was disconnected. + * + * @api private + */ + +NativeCollection.prototype._getCollection = function _getCollection() { + if (this.collection) { + return this.collection; + } + if (this.conn.db != null) { + this.collection = this.conn.db.collection(this.name); + return this.collection; + } + return null; +}; + +/** + * Copy the collection methods and make them subject to queues + * @param {number|string} I + * @api private + */ + +function iter(i) { + NativeCollection.prototype[i] = function() { + const collection = this._getCollection(); + const args = arguments; + const _this = this; + const globalDebug = _this?.conn?.base?.options?.debug; + const connectionDebug = _this?.conn?.options?.debug; + const debug = connectionDebug == null ? globalDebug : connectionDebug; + + // If user force closed, queueing will hang forever. See #5664 + if (this.conn.$wasForceClosed) { + const error = new MongooseError('Connection was force closed'); + if (args.length > 0 && + typeof args[args.length - 1] === 'function') { + args[args.length - 1](error); + return; + } else { + throw error; + } + } + + // Lazily generate opId and argsArray only if necessary because they have + // a non-trivial performance cost. + let opId = null; + let argsArray = null; + const hasOperationListeners = this.conn.listenerCount('operation-start') > 0 || this.conn.listenerCount('operation-end') > 0; + if (hasOperationListeners || debug) { + opId = new ObjectId(); + } + + let timeout = null; + let waitForBufferPromise = null; + if (this._shouldBufferCommands() && this.buffer) { + if (opId == null) { + opId = new ObjectId(); + } + this.conn.emit('buffer', { + _id: opId, + modelName: _this.modelName, + collectionName: _this.name, + method: i, + args: args + }); + + const bufferTimeoutMS = this._getBufferTimeoutMS(); + waitForBufferPromise = new Promise((resolve, reject) => { + this.addQueue(resolve); + + timeout = setTimeout(() => { + const removed = this.removeQueue(resolve); + if (removed) { + const message = 'Operation `' + this.name + '.' + i + '()` buffering timed out after ' + + bufferTimeoutMS + 'ms'; + const err = new MongooseError(message); + this.conn.emit('buffer-end', { _id: opId, modelName: _this.modelName, collectionName: _this.name, method: i, error: err }); + reject(err); + } + }, bufferTimeoutMS); + }); + + return waitForBufferPromise.then(() => { + if (timeout) { + clearTimeout(timeout); + } + return this[i].apply(this, args); + }); + } + + if (debug) { + if (typeof debug === 'function') { + if (argsArray == null) { + argsArray = Array.from(args); + } + let argsToAdd = null; + if (typeof argsArray[argsArray.length - 1] == 'function') { + argsToAdd = argsArray.slice(0, argsArray.length - 1); + } else { + argsToAdd = argsArray; + } + debug.apply(_this, + [_this.name, i].concat(argsToAdd)); + } else if (debug instanceof stream.Writable) { + this.$printToStream(_this.name, i, args, debug); + } else { + const color = debug.color == null ? true : debug.color; + const shell = debug.shell == null ? false : debug.shell; + const timestamp = debug.timestamp == null ? false : debug.timestamp; + this.$print(_this.name, i, args, color, shell, timestamp); + } + } + + if (hasOperationListeners) { + if (argsArray == null) { + argsArray = Array.from(args); + } + this.conn.emit('operation-start', { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i, params: argsArray }); + } + + try { + if (collection == null) { + const message = 'Cannot call `' + this.name + '.' + i + '()` before initial connection ' + + 'is complete if `bufferCommands = false`. Make sure you `await mongoose.connect()` if ' + + 'you have `bufferCommands = false`.'; + throw new MongooseError(message); + } + + const ret = collection[i].apply(collection, args); + if (typeof ret?.then === 'function') { + return ret.then( + result => { + if (timeout != null) { + clearTimeout(timeout); + } + if (hasOperationListeners) { + this.conn.emit('operation-end', { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i, result }); + } + return result; + }, + error => { + if (timeout != null) { + clearTimeout(timeout); + } + if (hasOperationListeners) { + this.conn.emit('operation-end', { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i, error }); + } + throw error; + } + ); + } + + if (hasOperationListeners) { + this.conn.emit('operation-end', { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i, result: ret }); + } + if (timeout != null) { + clearTimeout(timeout); + } + return ret; + } catch (error) { + if (timeout != null) { + clearTimeout(timeout); + } + if (hasOperationListeners) { + this.conn.emit('operation-end', { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i, error: error }); + } + throw error; + } + }; +} + +for (const key of Object.getOwnPropertyNames(Collection.prototype)) { + // Janky hack to work around gh-3005 until we can get rid of the mongoose + // collection abstraction + const descriptor = Object.getOwnPropertyDescriptor(Collection.prototype, key); + // Skip properties with getters because they may throw errors (gh-8528) + if (descriptor.get !== undefined) { + continue; + } + if (typeof Collection.prototype[key] !== 'function') { + continue; + } + + iter(key); +} + +/** + * Debug print helper + * + * @api public + * @method $print + */ + +NativeCollection.prototype.$print = function(name, i, args, color, shell, timestamp) { + let prefix = ''; + if (timestamp) { + const ts = new Date().toISOString(); + prefix = color ? `\x1B[0;90m[${ts}]\x1B[0m ` : `[${ts}] `; + } + const moduleName = color ? '\x1B[0;36mMongoose:\x1B[0m ' : 'Mongoose: '; + const functionCall = [name, i].join('.'); + const _args = []; + for (let j = args.length - 1; j >= 0; --j) { + if (this.$format(args[j]) || _args.length) { + _args.unshift(this.$format(args[j], color, shell)); + } + } + const params = '(' + _args.join(', ') + ')'; + + console.info(prefix + moduleName + functionCall + params); +}; + +/** + * Debug print helper + * + * @api public + * @method $printToStream + */ + +NativeCollection.prototype.$printToStream = function(name, i, args, stream) { + const functionCall = [name, i].join('.'); + const _args = []; + for (let j = args.length - 1; j >= 0; --j) { + if (this.$format(args[j]) || _args.length) { + _args.unshift(this.$format(args[j])); + } + } + const params = '(' + _args.join(', ') + ')'; + + stream.write(functionCall + params, 'utf8'); +}; + +/** + * Formatter for debug print args + * + * @api public + * @method $format + */ + +NativeCollection.prototype.$format = function(arg, color, shell) { + const type = typeof arg; + if (type === 'function' || type === 'undefined') return ''; + return format(arg, false, color, shell); +}; + +/** + * Debug print helper + * @param {any} representation + * @api private + */ + +function inspectable(representation) { + const ret = { + inspect: function() { return representation; } + }; + if (util.inspect.custom) { + ret[util.inspect.custom] = ret.inspect; + } + return ret; +} +function map(o) { + return format(o, true); +} +function formatObjectId(x, key) { + x[key] = inspectable('ObjectId("' + x[key].toHexString() + '")'); +} +function formatDate(x, key, shell) { + if (shell) { + x[key] = inspectable('ISODate("' + x[key].toUTCString() + '")'); + } else { + x[key] = inspectable('new Date("' + x[key].toUTCString() + '")'); + } +} +function format(obj, sub, color, shell) { + if (typeof obj?.toBSON === 'function') { + obj = obj.toBSON(); + } + if (obj == null) { + return obj; + } + + const clone = require('../../helpers/clone'); + // `sub` indicates `format()` was called recursively, so skip cloning because we already + // did a deep clone on the top-level object. + let x = sub ? obj : clone(obj, formatToObjectOptions); + const constructorName = getConstructorName(x); + + if (constructorName === 'Binary') { + x = 'BinData(' + x.sub_type + ', "' + x.toString('base64') + '")'; + } else if (constructorName === 'ObjectId') { + x = inspectable('ObjectId("' + x.toHexString() + '")'); + } else if (constructorName === 'Date') { + x = inspectable('new Date("' + x.toUTCString() + '")'); + } else if (constructorName === 'Object') { + const keys = Object.keys(x); + const numKeys = keys.length; + let key; + for (let i = 0; i < numKeys; ++i) { + key = keys[i]; + if (x[key]) { + let error; + if (typeof x[key].toBSON === 'function') { + try { + // `session.toBSON()` throws an error. This means we throw errors + // in debug mode when using transactions, see gh-6712. As a + // workaround, catch `toBSON()` errors, try to serialize without + // `toBSON()`, and rethrow if serialization still fails. + x[key] = x[key].toBSON(); + } catch (_error) { + error = _error; + } + } + const _constructorName = getConstructorName(x[key]); + if (_constructorName === 'Binary') { + x[key] = 'BinData(' + x[key].sub_type + ', "' + + x[key].buffer.toString('base64') + '")'; + } else if (_constructorName === 'Object') { + x[key] = format(x[key], true); + } else if (_constructorName === 'ObjectId') { + formatObjectId(x, key); + } else if (_constructorName === 'Date') { + formatDate(x, key, shell); + } else if (_constructorName === 'ClientSession') { + x[key] = inspectable('ClientSession("' + + (x[key]?.id?.id?.buffer || '').toString('hex') + '")'); + } else if (Array.isArray(x[key])) { + x[key] = x[key].map(map); + } else if (error != null) { + // If there was an error with `toBSON()` and the object wasn't + // already converted to a string representation, rethrow it. + // Open to better ideas on how to handle this. + throw error; + } + } + } + } + if (sub) { + return x; + } + + return util. + inspect(x, false, 10, color). + replace(/\n/g, ''). + replace(/\s{2,}/g, ' '); +} + +/** + * Retrieves information about this collections indexes. + * + * @method getIndexes + * @api public + */ + +NativeCollection.prototype.getIndexes = NativeCollection.prototype.indexInformation; + +/*! + * Module exports. + */ + +module.exports = NativeCollection; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js new file mode 100644 index 00000000..362d41f9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js @@ -0,0 +1,519 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseConnection = require('../../connection'); +const MongooseError = require('../../error/index'); +const STATES = require('../../connectionState'); +const mongodb = require('mongodb'); +const pkg = require('../../../package.json'); +const processConnectionOptions = require('../../helpers/processConnectionOptions'); +const setTimeout = require('../../helpers/timers').setTimeout; +const utils = require('../../utils'); +const Schema = require('../../schema'); + +// Snapshot the native Date constructor to ensure Date.now() +// bypasses timer mocks such as those set up by useFakeTimers(). +const Date = globalThis.Date; + +/** + * A [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) connection implementation. + * + * @inherits Connection + * @api private + */ + +function NativeConnection() { + MongooseConnection.apply(this, arguments); + this._listening = false; + // Tracks the last time (as unix timestamp) the connection received a + // serverHeartbeatSucceeded or serverHeartbeatFailed event from the underlying MongoClient. + // If we haven't received one in a while (like due to a frozen AWS Lambda container) then + // `readyState` is likely stale. + this._lastHeartbeatAt = null; +} + +/** + * Expose the possible connection states. + * @api public + */ + +NativeConnection.STATES = STATES; + +/*! + * Inherits from Connection. + */ + +Object.setPrototypeOf(NativeConnection.prototype, MongooseConnection.prototype); + +/** + * Switches to a different database using the same connection pool. + * + * Returns a new connection object, with the new db. If you set the `useCache` + * option, `useDb()` will cache connections by `name`. + * + * **Note:** Calling `close()` on a `useDb()` connection will close the base connection as well. + * + * @param {string} name The database name + * @param {object} [options] + * @param {boolean} [options.useCache=false] If true, cache results so calling `useDb()` multiple times with the same name only creates 1 connection object. + * @return {Connection} New Connection Object + * @api public + */ + +NativeConnection.prototype.useDb = function(name, options) { + // Return immediately if cached + options = options || {}; + if (options.useCache && this.relatedDbs[name]) { + return this.relatedDbs[name]; + } + + // we have to manually copy all of the attributes... + const newConn = new this.constructor(); + newConn.name = name; + newConn.base = this.base; + newConn.collections = {}; + newConn.models = {}; + newConn.replica = this.replica; + newConn.config = Object.assign({}, this.config, newConn.config); + newConn.name = this.name; + newConn.options = this.options; + newConn._readyState = this._readyState; + newConn._closeCalled = this._closeCalled; + newConn._hasOpened = this._hasOpened; + newConn._listening = false; + newConn._parent = this; + + newConn.host = this.host; + newConn.port = this.port; + newConn.user = this.user; + newConn.pass = this.pass; + + // First, when we create another db object, we are not guaranteed to have a + // db object to work with. So, in the case where we have a db object and it + // is connected, we can just proceed with setting everything up. However, if + // we do not have a db or the state is not connected, then we need to wait on + // the 'open' event of the connection before doing the rest of the setup + // the 'connected' event is the first time we'll have access to the db object + + const _this = this; + + newConn.client = _this.client; + + if (this.db && this._readyState === STATES.connected) { + wireup(); + } else { + this._queue.push({ fn: wireup }); + } + + function wireup() { + newConn.client = _this.client; + newConn.db = _this.client.db(name); + newConn._lastHeartbeatAt = _this._lastHeartbeatAt; + newConn.onOpen(); + } + + newConn.name = name; + + // push onto the otherDbs stack, this is used when state changes + this.otherDbs.push(newConn); + newConn.otherDbs.push(this); + + // push onto the relatedDbs cache, this is used when state changes + if (options?.useCache) { + this.relatedDbs[newConn.name] = newConn; + newConn.relatedDbs = this.relatedDbs; + } + + return newConn; +}; + +/** + * Runs a [db-level aggregate()](https://www.mongodb.com/docs/manual/reference/method/db.aggregate/) on this connection's underlying `db` + * + * @param {Array} pipeline + * @param {object} [options] + */ + +NativeConnection.prototype.aggregate = function aggregate(pipeline, options) { + return new this.base.Aggregate(null, this).append(pipeline).option(options ?? {}); +}; + +/** + * Removes the database connection with the given name created with `useDb()`. + * + * Throws an error if the database connection was not found. + * + * #### Example: + * + * // Connect to `initialdb` first + * const conn = await mongoose.createConnection('mongodb://127.0.0.1:27017/initialdb').asPromise(); + * + * // Creates an un-cached connection to `mydb` + * const db = conn.useDb('mydb'); + * + * // Closes `db`, and removes `db` from `conn.relatedDbs` and `conn.otherDbs` + * await conn.removeDb('mydb'); + * + * @method removeDb + * @memberOf Connection + * @param {string} name The database name + * @return {Connection} this + */ + +NativeConnection.prototype.removeDb = function removeDb(name) { + const dbs = this.otherDbs.filter(db => db.name === name); + if (!dbs.length) { + throw new MongooseError(`No connections to database "${name}" found`); + } + + for (const db of dbs) { + db._closeCalled = true; + db._destroyCalled = true; + db._readyState = STATES.disconnected; + db.$wasForceClosed = true; + } + delete this.relatedDbs[name]; + this.otherDbs = this.otherDbs.filter(db => db.name !== name); +}; + +/** + * Closes the connection + * + * @param {boolean} [force] + * @return {Connection} this + * @api private + */ + +NativeConnection.prototype.doClose = async function doClose(force) { + if (this.client == null) { + return this; + } + + let skipCloseClient = false; + if (force != null && typeof force === 'object') { + skipCloseClient = force.skipCloseClient; + force = force.force; + } + + if (skipCloseClient) { + return this; + } + + await this.client.close(force); + // Defer because the driver will wait at least 1ms before finishing closing + // the pool, see https://github.com/mongodb-js/mongodb-core/blob/a8f8e4ce41936babc3b9112bf42d609779f03b39/lib/connection/pool.js#L1026-L1030. + // If there's queued operations, you may still get some background work + // after the callback is called. + await new Promise(resolve => setTimeout(resolve, 1)); + + return this; +}; + +/** + * Implementation of `listDatabases()` for MongoDB driver + * + * @return {Promise} + * @api public + */ + +NativeConnection.prototype.listDatabases = async function listDatabases() { + await this._waitForConnect(); + + return await this.db.admin().listDatabases(); +}; + +/*! + * ignore + */ + +NativeConnection.prototype.createClient = async function createClient(uri, options) { + if (typeof uri !== 'string') { + throw new MongooseError('The `uri` parameter to `openUri()` must be a ' + + `string, got "${typeof uri}". Make sure the first parameter to ` + + '`mongoose.connect()` or `mongoose.createConnection()` is a string.'); + } + + if (this._destroyCalled) { + throw new MongooseError( + 'Connection has been closed and destroyed, and cannot be used for re-opening the connection. ' + + 'Please create a new connection with `mongoose.createConnection()` or `mongoose.connect()`.' + ); + } + + if (this.readyState === STATES.connecting || this.readyState === STATES.connected) { + if (this._connectionString !== uri) { + throw new MongooseError('Can\'t call `openUri()` on an active connection with ' + + 'different connection strings. Make sure you aren\'t calling `mongoose.connect()` ' + + 'multiple times. See: https://mongoosejs.com/docs/connections.html#multiple_connections'); + } + } + + options = processConnectionOptions(uri, options); + + if (options) { + + const autoIndex = options.config?.autoIndex ?? options.autoIndex; + if (autoIndex != null) { + this.config.autoIndex = autoIndex !== false; + delete options.config; + delete options.autoIndex; + } + + if ('autoCreate' in options) { + this.config.autoCreate = !!options.autoCreate; + delete options.autoCreate; + } + + if ('sanitizeFilter' in options) { + this.config.sanitizeFilter = options.sanitizeFilter; + delete options.sanitizeFilter; + } + + if ('autoSearchIndex' in options) { + this.config.autoSearchIndex = options.autoSearchIndex; + delete options.autoSearchIndex; + } + + if ('bufferTimeoutMS' in options) { + this.config.bufferTimeoutMS = options.bufferTimeoutMS; + delete options.bufferTimeoutMS; + } + + // Backwards compat + if (options.user || options.pass) { + options.auth = options.auth || {}; + options.auth.username = options.user; + options.auth.password = options.pass; + + this.user = options.user; + this.pass = options.pass; + } + delete options.user; + delete options.pass; + + if (options.bufferCommands != null) { + this.config.bufferCommands = options.bufferCommands; + delete options.bufferCommands; + } + } else { + options = {}; + } + + this._connectionOptions = options; + const dbName = options.dbName; + if (dbName != null) { + this.$dbName = dbName; + } + delete options.dbName; + + if (!utils.hasUserDefinedProperty(options, 'driverInfo')) { + options.driverInfo = { + name: 'Mongoose', + version: pkg.version + }; + } + + const { schemaMap, encryptedFieldsMap } = this._buildEncryptionSchemas(); + + if ((utils.hasOwnKeys(schemaMap) || utils.hasOwnKeys(encryptedFieldsMap)) && !options.autoEncryption) { + throw new Error('Must provide `autoEncryption` when connecting with encrypted schemas.'); + } + + if (utils.hasOwnKeys(schemaMap)) { + options.autoEncryption.schemaMap = schemaMap; + } + + if (utils.hasOwnKeys(encryptedFieldsMap)) { + options.autoEncryption.encryptedFieldsMap = encryptedFieldsMap; + } + + this.readyState = STATES.connecting; + this._connectionString = uri; + + let client; + try { + client = new mongodb.MongoClient(uri, options); + } catch (error) { + this.readyState = STATES.disconnected; + throw error; + } + this.client = client; + + client.setMaxListeners(0); + await client.connect(); + + _setClient(this, client, options, dbName); + + for (const db of this.otherDbs) { + _setClient(db, client, {}, db.name); + } + return this; +}; + +/** + * Given a connection, which may or may not have encrypted models, build + * a schemaMap and/or an encryptedFieldsMap for the connection, combining all models + * into a single schemaMap and encryptedFields map. + * + * @returns {object} the generated schemaMap and encryptedFieldsMap + */ +NativeConnection.prototype._buildEncryptionSchemas = function() { + const qeMappings = {}; + const csfleMappings = {}; + + const encryptedModels = Object.values(this.models).filter(model => model.schema._hasEncryptedFields()); + + // If discriminators are configured for the collection, there might be multiple models + // pointing to the same namespace. For this scenario, we merge all the schemas for each namespace + // into a single schema and then generate a schemaMap/encryptedFieldsMap for the combined schema. + for (const model of encryptedModels) { + const { schema, collection: { collectionName } } = model; + const namespace = `${this.$dbName}.${collectionName}`; + const mappings = schema.encryptionType() === 'csfle' ? csfleMappings : qeMappings; + + mappings[namespace] ??= new Schema({}, { encryptionType: schema.encryptionType() }); + + const isNonRootDiscriminator = schema.discriminatorMapping && !schema.discriminatorMapping.isRoot; + if (isNonRootDiscriminator) { + const rootSchema = schema._baseSchema; + schema.eachPath((pathname) => { + if (rootSchema.path(pathname)) return; + if (!mappings[namespace]._hasEncryptedField(pathname)) return; + + throw new Error(`Cannot have duplicate keys in discriminators with encryption. key=${pathname}`); + }); + } + + mappings[namespace].add(schema); + } + + const schemaMap = Object.fromEntries(Object.entries(csfleMappings).map( + ([namespace, schema]) => ([namespace, schema._buildSchemaMap()]) + )); + + const encryptedFieldsMap = Object.fromEntries(Object.entries(qeMappings).map( + ([namespace, schema]) => ([namespace, schema._buildEncryptedFields()]) + )); + + return { + schemaMap, encryptedFieldsMap + }; +}; + +/*! + * ignore + */ + +NativeConnection.prototype.setClient = function setClient(client) { + if (!(client instanceof mongodb.MongoClient)) { + throw new MongooseError('Must call `setClient()` with an instance of MongoClient'); + } + if (this.readyState !== STATES.disconnected) { + throw new MongooseError('Cannot call `setClient()` on a connection that is already connected.'); + } + if (client.topology == null) { + throw new MongooseError('Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.'); + } + + this._connectionString = client.s.url; + _setClient(this, client, {}, client.s.options.dbName); + + for (const model of Object.values(this.models)) { + // Errors handled internally, so safe to ignore error + model.init().catch(function $modelInitNoop() {}); + } + + return this; +}; + +/*! + * ignore + */ + +function _setClient(conn, client, options, dbName) { + const db = dbName != null ? client.db(dbName) : client.db(); + conn.db = db; + conn.client = client; + conn.host = client?.s?.options?.hosts?.[0]?.host; + conn.port = client?.s?.options?.hosts?.[0]?.port; + conn.name = dbName != null ? dbName : db.databaseName; + conn._closeCalled = client._closeCalled; + + const _handleReconnect = () => { + // If we aren't disconnected, we assume this reconnect is due to a + // socket timeout. If there's no activity on a socket for + // `socketTimeoutMS`, the driver will attempt to reconnect and emit + // this event. + if (conn.readyState !== STATES.connected) { + conn.readyState = STATES.connected; + conn.emit('reconnect'); + conn.emit('reconnected'); + conn.onOpen(); + } + }; + + const type = client?.topology?.description?.type || ''; + + if (type === 'Single') { + client.on('serverDescriptionChanged', ev => { + const newDescription = ev.newDescription; + if (newDescription.type === 'Unknown') { + conn.readyState = STATES.disconnected; + } else { + _handleReconnect(); + } + }); + } else if (type.startsWith('ReplicaSet')) { + client.on('topologyDescriptionChanged', ev => { + // Emit disconnected if we've lost connectivity to the primary + const description = ev.newDescription; + if (conn.readyState === STATES.connected && description.type !== 'ReplicaSetWithPrimary') { + // Implicitly emits 'disconnected' + conn.readyState = STATES.disconnected; + } else if (conn.readyState === STATES.disconnected && description.type === 'ReplicaSetWithPrimary') { + _handleReconnect(); + } + }); + } + + conn._lastHeartbeatAt = null; + + client.on('serverHeartbeatSucceeded', () => { + conn._lastHeartbeatAt = Date.now(); + for (const otherDb of conn.otherDbs) { + otherDb._lastHeartbeatAt = conn._lastHeartbeatAt; + } + // Flush buffered operations if the connection is no longer stale (gh-16183) + if (conn._queue.length > 0 && conn.readyState === STATES.connected) { + conn._flushQueue(); + } + for (const otherDb of conn.otherDbs) { + if (otherDb._queue.length > 0 && otherDb.readyState === STATES.connected) { + otherDb._flushQueue(); + } + } + }); + + if (options.monitorCommands) { + client.on('commandStarted', (data) => conn.emit('commandStarted', data)); + client.on('commandFailed', (data) => conn.emit('commandFailed', data)); + client.on('commandSucceeded', (data) => conn.emit('commandSucceeded', data)); + } + + conn.onOpen(); + + for (const i in conn.collections) { + if (Object.hasOwn(conn.collections, i)) { + conn.collections[i].onOpen(); + } + } +} + +/*! + * Module exports. + */ + +module.exports = NativeConnection; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js new file mode 100644 index 00000000..6274187f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js @@ -0,0 +1,10 @@ +/*! + * Module exports. + */ + +'use strict'; + +exports.BulkWriteResult = require('./bulkWriteResult'); +exports.Collection = require('./collection'); +exports.Connection = require('./connection'); +exports.ClientEncryption = require('mongodb').ClientEncryption; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/browserMissingSchema.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/browserMissingSchema.js new file mode 100644 index 00000000..ffeffc77 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/browserMissingSchema.js @@ -0,0 +1,29 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * MissingSchema Error constructor. + */ + +class MissingSchemaError extends MongooseError { + + constructor() { + super('Schema hasn\'t been registered for document.\n' + + 'Use mongoose.Document(name, schema)'); + } +} + +Object.defineProperty(MissingSchemaError.prototype, 'name', { + value: 'MongooseError' +}); + +/*! + * exports + */ + +module.exports = MissingSchemaError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkSaveIncompleteError.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkSaveIncompleteError.js new file mode 100644 index 00000000..c4b88e5d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkSaveIncompleteError.js @@ -0,0 +1,44 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + + +/** + * If the underwriting `bulkWrite()` for `bulkSave()` succeeded, but wasn't able to update or + * insert all documents, we throw this error. + * + * @api private + */ + +class MongooseBulkSaveIncompleteError extends MongooseError { + constructor(modelName, documents, bulkWriteResult) { + const matchedCount = bulkWriteResult?.matchedCount ?? 0; + const insertedCount = bulkWriteResult?.insertedCount ?? 0; + let preview = documents.map(doc => doc._id).join(', '); + if (preview.length > 100) { + preview = preview.slice(0, 100) + '...'; + } + + const numDocumentsNotUpdated = documents.length - matchedCount - insertedCount; + super(`${modelName}.bulkSave() was not able to update ${numDocumentsNotUpdated} of the given documents due to incorrect version or optimistic concurrency, document ids: ${preview}`); + + this.modelName = modelName; + this.documents = documents; + this.bulkWriteResult = bulkWriteResult; + this.numDocumentsNotUpdated = numDocumentsNotUpdated; + } +} + +Object.defineProperty(MongooseBulkSaveIncompleteError.prototype, 'name', { + value: 'MongooseBulkSaveIncompleteError' +}); + +/*! + * exports + */ + +module.exports = MongooseBulkSaveIncompleteError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkWriteError.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkWriteError.js new file mode 100644 index 00000000..1711b03b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/bulkWriteError.js @@ -0,0 +1,41 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +/** + * If `bulkWrite()` or `insertMany()` has validation errors, but + * all valid operations succeed, and 'throwOnValidationError' is true, + * Mongoose will throw this error. + * + * @api private + */ + +class MongooseBulkWriteError extends MongooseError { + constructor(validationErrors, results, rawResult, operation) { + let preview = validationErrors.map(e => e.message).join(', '); + if (preview.length > 200) { + preview = preview.slice(0, 200) + '...'; + } + super(`${operation} failed with ${validationErrors.length} Mongoose validation errors: ${preview}`); + + this.validationErrors = validationErrors; + this.results = results; + this.rawResult = rawResult; + this.operation = operation; + } +} + +Object.defineProperty(MongooseBulkWriteError.prototype, 'name', { + value: 'MongooseBulkWriteError' +}); + +/*! + * exports + */ + +module.exports = MongooseBulkWriteError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/cast.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/cast.js new file mode 100644 index 00000000..41d00745 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/cast.js @@ -0,0 +1,167 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); +const util = require('util'); + +/** + * Casting Error constructor. + * + * @param {string} type + * @param {string} value + * @inherits MongooseError + * @api private + */ + +class CastError extends MongooseError { + constructor(type, value, path, reason, schemaType) { + // If no args, assume we'll `init()` later. + if (arguments.length > 0) { + const valueType = getValueType(value); + const messageFormat = getMessageFormat(schemaType); + const msg = formatMessage(null, type, value, path, messageFormat, valueType, reason); + super(msg); + this.init(type, value, path, reason, schemaType); + } else { + super(formatMessage()); + } + } + + toJSON() { + return { + stringValue: this.stringValue, + valueType: this.valueType, + kind: this.kind, + value: this.value, + path: this.path, + reason: this.reason, + name: this.name, + message: this.message + }; + } + + /*! + * ignore + */ + init(type, value, path, reason, schemaType) { + this.stringValue = getStringValue(value); + this.messageFormat = getMessageFormat(schemaType); + this.kind = type; + this.value = value; + this.path = path; + this.reason = reason; + this.valueType = getValueType(value); + } + + /** + * ignore + * @param {Readonly} other + * @api private + */ + copy(other) { + this.messageFormat = other.messageFormat; + this.stringValue = other.stringValue; + this.kind = other.kind; + this.value = other.value; + this.path = other.path; + this.reason = other.reason; + this.message = other.message; + this.valueType = other.valueType; + } + + /*! + * ignore + */ + setModel(model) { + this.message = formatMessage(model, this.kind, this.value, this.path, + this.messageFormat, this.valueType, this.reason); + } +} + +Object.defineProperty(CastError.prototype, 'name', { + value: 'CastError' +}); + +function getStringValue(value) { + let stringValue = util.inspect(value); + stringValue = stringValue.replace(/^'|'$/g, '"'); + if (!stringValue.startsWith('"')) { + stringValue = '"' + stringValue + '"'; + } + return stringValue; +} + +function getValueType(value) { + if (value == null) { + return '' + value; + } + + const t = typeof value; + if (t !== 'object') { + return t; + } + if (typeof value.constructor !== 'function') { + return t; + } + return value.constructor.name; +} + +function getMessageFormat(schemaType) { + const messageFormat = schemaType?._castErrorMessage || null; + if (typeof messageFormat === 'string' || typeof messageFormat === 'function') { + return messageFormat; + } +} + +/*! + * ignore + */ + +function formatMessage(model, kind, value, path, messageFormat, valueType, reason) { + if (typeof messageFormat === 'string') { + const stringValue = getStringValue(value); + let ret = messageFormat + .replace('{KIND}', kind) + .replace('{VALUE}', stringValue) + .replace('{PATH}', path); + + if (model != null) { + ret = ret.replace('{MODEL}', model.modelName); + } + + return ret; + } else if (typeof messageFormat === 'function') { + return messageFormat(value, path, model, kind); + } else { + const stringValue = getStringValue(value); + const valueTypeMsg = valueType ? ' (type ' + valueType + ')' : ''; + + let ret = 'Cast to ' + kind + ' failed for value ' + + stringValue + valueTypeMsg + ' at path "' + path + '"'; + + if (model != null) { + ret += ' for model "' + model.modelName + '"'; + } + + if ( + reason != null && + typeof reason.constructor === 'function' && + reason.constructor.name !== 'AssertionError' && + reason.constructor.name !== 'Error' && + reason.constructor.name !== 'BSONError' + ) { + ret += ' because of "' + reason.constructor.name + '"'; + } + + return ret; + } +} + +/*! + * exports + */ + +module.exports = CastError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/createCollectionsError.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/createCollectionsError.js new file mode 100644 index 00000000..e82ab22f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/createCollectionsError.js @@ -0,0 +1,26 @@ +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * createCollections Error constructor + * + * @param {string} message + * @param {string} errorsMap + * @inherits MongooseError + * @api private + */ + +class CreateCollectionsError extends MongooseError { + constructor(message, errorsMap) { + super(message); + this.errors = errorsMap; + } +} + +Object.defineProperty(CreateCollectionsError.prototype, 'name', { + value: 'CreateCollectionsError' +}); + +module.exports = CreateCollectionsError; + diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/divergentArray.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/divergentArray.js new file mode 100644 index 00000000..5ef399d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/divergentArray.js @@ -0,0 +1,40 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * DivergentArrayError constructor. + * @param {string[]} paths + * @api private + */ + +class DivergentArrayError extends MongooseError { + + constructor(paths) { + const msg = 'For your own good, using `document.save()` to update an array ' + + 'which was selected using an $elemMatch or $slice projection OR ' + + 'populated using skip, limit, query conditions, or exclusion of ' + + 'the _id field when the operation results in a $pop or $set of ' + + 'the entire array is not supported. The following ' + + 'path(s) would have been modified unsafely:\n' + + ' ' + paths.join('\n ') + '\n' + + 'Use Model.updateOne() to update these arrays instead. ' + + 'See https://mongoosejs.com/docs/faq.html#divergent-array-error for more information.'; + super(msg); + } +} + +Object.defineProperty(DivergentArrayError.prototype, 'name', { + value: 'DivergentArrayError' +}); + +/*! + * exports + */ + +module.exports = DivergentArrayError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/eachAsyncMultiError.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/eachAsyncMultiError.js new file mode 100644 index 00000000..b732437b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/eachAsyncMultiError.js @@ -0,0 +1,41 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + + +/** + * If `eachAsync()` is called with `continueOnError: true`, there can be + * multiple errors. This error class contains an `errors` property, which + * contains an array of all errors that occurred in `eachAsync()`. + * + * @api private + */ + +class EachAsyncMultiError extends MongooseError { + /** + * @param {string} connectionString + */ + constructor(errors) { + let preview = errors.map(e => e.message).join(', '); + if (preview.length > 50) { + preview = preview.slice(0, 50) + '...'; + } + super(`eachAsync() finished with ${errors.length} errors: ${preview}`); + + this.errors = errors; + } +} + +Object.defineProperty(EachAsyncMultiError.prototype, 'name', { + value: 'EachAsyncMultiError' +}); + +/*! + * exports + */ + +module.exports = EachAsyncMultiError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/index.js new file mode 100644 index 00000000..97a83780 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/index.js @@ -0,0 +1,237 @@ +'use strict'; + +/** + * MongooseError constructor. MongooseError is the base class for all + * Mongoose-specific errors. + * + * #### Example: + * + * const Model = mongoose.model('Test', new mongoose.Schema({ answer: Number })); + * const doc = new Model({ answer: 'not a number' }); + * const err = doc.validateSync(); + * + * err instanceof mongoose.Error.ValidationError; // true + * + * @constructor Error + * @param {string} msg Error message + * @inherits Error https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error + */ + +const MongooseError = require('./mongooseError'); + +/** + * The name of the error. The name uniquely identifies this Mongoose error. The + * possible values are: + * + * - `MongooseError`: general Mongoose error + * - `CastError`: Mongoose could not convert a value to the type defined in the schema path. May be in a `ValidationError` class' `errors` property. + * - `DivergentArrayError`: You attempted to `save()` an array that was modified after you loaded it with a `$elemMatch` or similar projection + * - `MissingSchemaError`: You tried to access a model with [`mongoose.model()`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.model()) that was not defined + * - `DocumentNotFoundError`: The document you tried to [`save()`](https://mongoosejs.com/docs/api/document.html#Document.prototype.save()) was not found + * - `ValidatorError`: error from an individual schema path's validator + * - `ValidationError`: error returned from [`validate()`](https://mongoosejs.com/docs/api/document.html#Document.prototype.validate()) or [`validateSync()`](https://mongoosejs.com/docs/api/document.html#Document.prototype.validateSync()). Contains zero or more `ValidatorError` instances in `.errors` property. + * - `MissingSchemaError`: You called `mongoose.Document()` without a schema + * - `ObjectExpectedError`: Thrown when you set a nested path to a non-object value with [strict mode set](https://mongoosejs.com/docs/guide.html#strict). + * - `ObjectParameterError`: Thrown when you pass a non-object value to a function which expects an object as a parameter + * - `OverwriteModelError`: Thrown when you call [`mongoose.model()`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.model()) to re-define a model that was already defined. + * - `ParallelSaveError`: Thrown when you call [`save()`](https://mongoosejs.com/docs/api/model.html#Model.prototype.save()) on a document when the same document instance is already saving. + * - `StrictModeError`: Thrown when you set a path that isn't the schema and [strict mode](https://mongoosejs.com/docs/guide.html#strict) is set to `throw`. + * - `VersionError`: Thrown when the [document is out of sync](https://mongoosejs.com/docs/guide.html#versionKey) + * + * @api public + * @property {string} name + * @memberOf Error + * @instance + */ + +/*! + * Module exports. + */ + +module.exports = exports = MongooseError; + +/** + * The default built-in validator error messages. + * + * @see Error.messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + * @memberOf Error + * @static + */ + +MongooseError.messages = require('./messages'); + +// backward compat +MongooseError.Messages = MongooseError.messages; + +/** + * An instance of this error class will be thrown when mongoose failed to + * cast a value. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.CastError = require('./cast'); + +/** + * An instance of this error class will be thrown when `save()` fails + * because the underlying + * document was not found. The constructor takes one parameter, the + * conditions that mongoose passed to `updateOne()` when trying to update + * the document. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.DocumentNotFoundError = require('./notFound'); + +/** + * An instance of this error class will be thrown when [validation](https://mongoosejs.com/docs/validation.html) failed. + * The `errors` property contains an object whose keys are the paths that failed and whose values are + * instances of CastError or ValidationError. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.ValidationError = require('./validation'); + +/** + * A `ValidationError` has a hash of `errors` that contain individual + * `ValidatorError` instances. + * + * #### Example: + * + * const schema = Schema({ name: { type: String, required: true } }); + * const Model = mongoose.model('Test', schema); + * const doc = new Model({}); + * + * // Top-level error is a ValidationError, **not** a ValidatorError + * const err = doc.validateSync(); + * err instanceof mongoose.Error.ValidationError; // true + * + * // A ValidationError `err` has 0 or more ValidatorErrors keyed by the + * // path in the `err.errors` property. + * err.errors['name'] instanceof mongoose.Error.ValidatorError; + * + * err.errors['name'].kind; // 'required' + * err.errors['name'].path; // 'name' + * err.errors['name'].value; // undefined + * + * Instances of `ValidatorError` have the following properties: + * + * - `kind`: The validator's `type`, like `'required'` or `'regexp'` + * - `path`: The path that failed validation + * - `value`: The value that failed validation + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.ValidatorError = require('./validator'); + +/** + * An instance of this error class will be thrown when you call `save()` after + * the document in the database was changed in a potentially unsafe way. See + * the [`versionKey` option](https://mongoosejs.com/docs/guide.html#versionKey) for more information. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.VersionError = require('./version'); + +/** + * An instance of this error class will be thrown when you call `save()` multiple + * times on the same document in parallel. See the [FAQ](https://mongoosejs.com/docs/faq.html) for more + * information. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.ParallelSaveError = require('./parallelSave'); + +/** + * Thrown when a model with the given name was already registered on the connection. + * See [the FAQ about `OverwriteModelError`](https://mongoosejs.com/docs/faq.html#overwrite-model-error). + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.OverwriteModelError = require('./overwriteModel'); + +/** + * Thrown when you try to access a model that has not been registered yet + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.MissingSchemaError = require('./missingSchema'); + +/** + * Thrown when some documents failed to save when calling `bulkSave()` + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.MongooseBulkSaveIncompleteError = require('./bulkSaveIncompleteError'); + +/** + * Thrown when the MongoDB Node driver can't connect to a valid server + * to send an operation to. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.MongooseServerSelectionError = require('./serverSelection'); + +/** + * An instance of this error will be thrown if you used an array projection + * and then modified the array in an unsafe way. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.DivergentArrayError = require('./divergentArray'); + +/** + * Thrown when your try to pass values to model constructor that + * were not specified in schema or change immutable properties when + * `strict` mode is `"throw"` + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.StrictModeError = require('./strict'); + +/** + * An instance of this error class will be returned when mongoose failed to + * populate with a path that is not existing. + * + * @api public + * @memberOf Error + * @static + */ + +MongooseError.StrictPopulateError = require('./strictPopulate'); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/invalidSchemaOption.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/invalidSchemaOption.js new file mode 100644 index 00000000..5d094192 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/invalidSchemaOption.js @@ -0,0 +1,32 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * InvalidSchemaOption Error constructor. + * @param {string} name + * @api private + */ + +class InvalidSchemaOptionError extends MongooseError { + + constructor(name, option) { + const msg = `Cannot create use schema for property "${name}" because the schema has the ${option} option enabled.`; + super(msg); + } +} + +Object.defineProperty(InvalidSchemaOptionError.prototype, 'name', { + value: 'InvalidSchemaOptionError' +}); + +/*! + * exports + */ + +module.exports = InvalidSchemaOptionError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/messages.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/messages.js new file mode 100644 index 00000000..bc0283f5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/messages.js @@ -0,0 +1,48 @@ + +/** + * The default built-in validator error messages. These may be customized. + * + * // customize within each schema or globally like so + * const mongoose = require('mongoose'); + * mongoose.Error.messages.String.enum = "Your custom message for {PATH}."; + * + * Error messages support basic templating. Mongoose will replace the following strings with the corresponding value. + * + * - `{PATH}` is replaced with the invalid document path + * - `{VALUE}` is replaced with the invalid value + * - `{TYPE}` is replaced with the validator type such as "regexp", "min", or "user defined" + * - `{MIN}` is replaced with the declared min value for the Number.min validator + * - `{MAX}` is replaced with the declared max value for the Number.max validator + * + * Click the "show code" link below to see all defaults. + * + * @static + * @memberOf MongooseError + * @api public + */ + +'use strict'; + +const msg = module.exports = exports = {}; + +msg.DocumentNotFoundError = null; + +msg.general = {}; +msg.general.default = 'Validator failed for path `{PATH}` with value `{VALUE}`'; +msg.general.required = 'Path `{PATH}` is required.'; +msg.general.allowNull = 'Path `{PATH}` does not allow null values.'; + +msg.Number = {}; +msg.Number.min = 'Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).'; +msg.Number.max = 'Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).'; +msg.Number.enum = '`{VALUE}` is not a valid enum value for path `{PATH}`.'; + +msg.Date = {}; +msg.Date.min = 'Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).'; +msg.Date.max = 'Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).'; + +msg.String = {}; +msg.String.enum = '`{VALUE}` is not a valid enum value for path `{PATH}`.'; +msg.String.match = 'Path `{PATH}` is invalid ({VALUE}).'; +msg.String.minlength = 'Path `{PATH}` (`{VALUE}`, length {LENGTH}) is shorter than the minimum allowed length ({MINLENGTH}).'; +msg.String.maxlength = 'Path `{PATH}` (`{VALUE}`, length {LENGTH}) is longer than the maximum allowed length ({MAXLENGTH}).'; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/missingSchema.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/missingSchema.js new file mode 100644 index 00000000..de21f25f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/missingSchema.js @@ -0,0 +1,33 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * MissingSchema Error constructor. + * @param {string} name + * @api private + */ + +class MissingSchemaError extends MongooseError { + + constructor(name) { + const msg = 'Schema hasn\'t been registered for model "' + name + '".\n' + + 'Use mongoose.model(name, schema)'; + super(msg); + } +} + +Object.defineProperty(MissingSchemaError.prototype, 'name', { + value: 'MissingSchemaError' +}); + +/*! + * exports + */ + +module.exports = MissingSchemaError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/mongooseError.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/mongooseError.js new file mode 100644 index 00000000..5505105c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/mongooseError.js @@ -0,0 +1,13 @@ +'use strict'; + +/*! + * ignore + */ + +class MongooseError extends Error { } + +Object.defineProperty(MongooseError.prototype, 'name', { + value: 'MongooseError' +}); + +module.exports = MongooseError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/notFound.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/notFound.js new file mode 100644 index 00000000..87fdd8bc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/notFound.js @@ -0,0 +1,47 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); +const util = require('util'); + +/** + * OverwriteModel Error constructor. + * @api private + */ + +class DocumentNotFoundError extends MongooseError { + + constructor(filter, model, numAffected, result) { + let msg; + const messages = MongooseError.messages; + if (messages.DocumentNotFoundError != null) { + msg = typeof messages.DocumentNotFoundError === 'function' ? + messages.DocumentNotFoundError(filter, model) : + messages.DocumentNotFoundError; + } else { + msg = 'No document found for query "' + util.inspect(filter) + + '" on model "' + model + '"'; + } + + super(msg); + + this.result = result; + this.numAffected = numAffected; + this.filter = filter; + // Backwards compat + this.query = filter; + } +} + +Object.defineProperty(DocumentNotFoundError.prototype, 'name', { + value: 'DocumentNotFoundError' +}); + +/*! + * exports + */ + +module.exports = DocumentNotFoundError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectExpected.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectExpected.js new file mode 100644 index 00000000..bd89ffc7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectExpected.js @@ -0,0 +1,31 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * Strict mode error constructor + * + * @param {string} type + * @param {string} value + * @api private + */ + +class ObjectExpectedError extends MongooseError { + + constructor(path, val) { + const typeDescription = Array.isArray(val) ? 'array' : 'primitive value'; + super('Tried to set nested object field `' + path + + `\` to ${typeDescription} \`` + val + '`'); + this.path = path; + } +} + +Object.defineProperty(ObjectExpectedError.prototype, 'name', { + value: 'ObjectExpectedError' +}); + +module.exports = ObjectExpectedError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectParameter.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectParameter.js new file mode 100644 index 00000000..9070acfc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/objectParameter.js @@ -0,0 +1,31 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * Constructor for errors that happen when a parameter that's expected to be + * an object isn't an object + * + * @param {any} value + * @param {string} paramName + * @param {string} fnName + * @api private + */ + +class ObjectParameterError extends MongooseError { + constructor(value, paramName, fnName) { + super('Parameter "' + paramName + '" to ' + fnName + + '() must be an object, got "' + (value == null ? value : value.toString()) + '" (type ' + typeof value + ')'); + } +} + + +Object.defineProperty(ObjectParameterError.prototype, 'name', { + value: 'ObjectParameterError' +}); + +module.exports = ObjectParameterError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/overwriteModel.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/overwriteModel.js new file mode 100644 index 00000000..b013d285 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/overwriteModel.js @@ -0,0 +1,31 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * OverwriteModel Error constructor. + * @param {string} name + * @api private + */ + +class OverwriteModelError extends MongooseError { + + constructor(name) { + super('Cannot overwrite `' + name + '` model once compiled.'); + } +} + +Object.defineProperty(OverwriteModelError.prototype, 'name', { + value: 'OverwriteModelError' +}); + +/*! + * exports + */ + +module.exports = OverwriteModelError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelSave.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelSave.js new file mode 100644 index 00000000..fd554fa3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelSave.js @@ -0,0 +1,33 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); + + +/** + * ParallelSave Error constructor. + * + * @param {Document} doc + * @api private + */ + +class ParallelSaveError extends MongooseError { + + constructor(doc) { + const msg = 'Can\'t save() the same doc multiple times in parallel. Document: '; + super(msg + doc._doc._id); + } +} + +Object.defineProperty(ParallelSaveError.prototype, 'name', { + value: 'ParallelSaveError' +}); + +/*! + * exports + */ + +module.exports = ParallelSaveError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelValidate.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelValidate.js new file mode 100644 index 00000000..d70e296e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/parallelValidate.js @@ -0,0 +1,33 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); + + +/** + * ParallelValidate Error constructor. + * + * @param {Document} doc + * @api private + */ + +class ParallelValidateError extends MongooseError { + + constructor(doc) { + const msg = 'Can\'t validate() the same doc multiple times in parallel. Document: '; + super(msg + doc._doc._id); + } +} + +Object.defineProperty(ParallelValidateError.prototype, 'name', { + value: 'ParallelValidateError' +}); + +/*! + * exports + */ + +module.exports = ParallelValidateError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/serverSelection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/serverSelection.js new file mode 100644 index 00000000..493ac462 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/serverSelection.js @@ -0,0 +1,62 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); +const allServersUnknown = require('../helpers/topology/allServersUnknown'); +const isAtlas = require('../helpers/topology/isAtlas'); +const isSSLError = require('../helpers/topology/isSSLError'); + +/*! + * ignore + */ + +const atlasMessage = 'Could not connect to any servers in your MongoDB Atlas cluster. ' + + 'One common reason is that you\'re trying to access the database from ' + + 'an IP that isn\'t whitelisted. Make sure your current IP address is on your Atlas ' + + 'cluster\'s IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/'; + +const sslMessage = 'Mongoose is connecting with SSL enabled, but the server is ' + + 'not accepting SSL connections. Please ensure that the MongoDB server you are ' + + 'connecting to is configured to accept SSL connections. Learn more: ' + + 'https://mongoosejs.com/docs/tutorials/ssl.html'; + +class MongooseServerSelectionError extends MongooseError { + /** + * MongooseServerSelectionError constructor + * + * @api private + */ + assimilateError(err) { + const reason = err.reason; + // Special message for a case that is likely due to IP whitelisting issues. + const isAtlasWhitelistError = isAtlas(reason) && + allServersUnknown(reason) && + err.message.indexOf('bad auth') === -1 && + err.message.indexOf('Authentication failed') === -1; + + if (isAtlasWhitelistError) { + this.message = atlasMessage; + } else if (isSSLError(reason)) { + this.message = sslMessage; + } else { + this.message = err.message; + } + for (const key in err) { + if (key !== 'name') { + this[key] = err[key]; + } + } + this.cause = reason; + + return this; + } +} + +Object.defineProperty(MongooseServerSelectionError.prototype, 'name', { + value: 'MongooseServerSelectionError' +}); + +module.exports = MongooseServerSelectionError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/setOptionError.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/setOptionError.js new file mode 100644 index 00000000..6644fa74 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/setOptionError.js @@ -0,0 +1,103 @@ +/*! + * Module requirements + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); +const util = require('util'); +const combinePathErrors = require('../helpers/error/combinePathErrors'); + +/** + * Mongoose.set Error + * + * @api private + * @inherits MongooseError + */ + +class SetOptionError extends MongooseError { + + constructor() { + super(''); + + this.errors = {}; + } + + /** + * Console.log helper + */ + toString() { + return combinePathErrors(this); + } + + /** + * inspect helper + * @api private + */ + inspect() { + return Object.assign(new Error(this.message), this); + } + + /** + * add message + * @param {string} key + * @param {string|Error} error + * @api private + */ + addError(key, error) { + if (error instanceof SetOptionError) { + const { errors } = error; + for (const optionKey of Object.keys(errors)) { + this.addError(optionKey, errors[optionKey]); + } + + return; + } + + this.errors[key] = error; + this.message = combinePathErrors(this); + } +} + + +if (util.inspect.custom) { + // Avoid Node deprecation warning DEP0079 + SetOptionError.prototype[util.inspect.custom] = SetOptionError.prototype.inspect; +} + +/** + * Helper for JSON.stringify + * Ensure `name` and `message` show up in toJSON output re: gh-9847 + * @api private + */ +Object.defineProperty(SetOptionError.prototype, 'toJSON', { + enumerable: false, + writable: false, + configurable: true, + value: function() { + return Object.assign({}, this, { name: this.name, message: this.message }); + } +}); + + +Object.defineProperty(SetOptionError.prototype, 'name', { + value: 'SetOptionError' +}); + +class SetOptionInnerError extends MongooseError { + /** + * Error for the "errors" array in "SetOptionError" with consistent message + * @param {string} key + */ + constructor(key) { + super(`"${key}" is not a valid option to set`); + } +} + +SetOptionError.SetOptionInnerError = SetOptionInnerError; + +/*! + * Module exports + */ + +module.exports = SetOptionError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strict.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strict.js new file mode 100644 index 00000000..039a0bb8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strict.js @@ -0,0 +1,35 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * Strict mode error constructor + * + * @param {string} path + * @param {string} [msg] + * @param {boolean} [immutable] + * @inherits MongooseError + * @api private + */ + + +class StrictModeError extends MongooseError { + + constructor(path, msg, immutable) { + msg = msg || 'Field `' + path + '` is not in schema and strict ' + + 'mode is set to throw.'; + super(msg); + this.isImmutableError = !!immutable; + this.path = path; + } +} + +Object.defineProperty(StrictModeError.prototype, 'name', { + value: 'StrictModeError' +}); + +module.exports = StrictModeError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strictPopulate.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strictPopulate.js new file mode 100644 index 00000000..a711385f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/strictPopulate.js @@ -0,0 +1,31 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * Strict mode error constructor + * + * @param {string} path + * @param {string} [msg] + * @inherits MongooseError + * @api private + */ + +class StrictPopulateError extends MongooseError { + + constructor(path, msg) { + msg = msg || 'Cannot populate path `' + path + '` because it is not in your schema. ' + 'Set the `strictPopulate` option to false to override.'; + super(msg); + this.path = path; + } +} + +Object.defineProperty(StrictPopulateError.prototype, 'name', { + value: 'StrictPopulateError' +}); + +module.exports = StrictPopulateError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/syncIndexes.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/syncIndexes.js new file mode 100644 index 00000000..fc1ca2d8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/syncIndexes.js @@ -0,0 +1,30 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); + +/** + * SyncIndexes Error constructor. + * + * @param {string} message + * @param {string} errorsMap + * @inherits MongooseError + * @api private + */ + +class SyncIndexesError extends MongooseError { + constructor(message, errorsMap) { + super(message); + this.errors = errorsMap; + } +} + +Object.defineProperty(SyncIndexesError.prototype, 'name', { + value: 'SyncIndexesError' +}); + + +module.exports = SyncIndexesError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validation.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validation.js new file mode 100644 index 00000000..5da1cbe3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validation.js @@ -0,0 +1,97 @@ +/*! + * Module requirements + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); +const getConstructorName = require('../helpers/getConstructorName'); +const util = require('util'); +const combinePathErrors = require('../helpers/error/combinePathErrors'); + +/** + * Document Validation Error + * + * @api private + * @param {Document} [instance] + * @inherits MongooseError + */ + +class ValidationError extends MongooseError { + + constructor(instance) { + let _message; + if (getConstructorName(instance) === 'model') { + _message = instance.constructor.modelName + ' validation failed'; + } else { + _message = 'Validation failed'; + } + + super(_message); + + this.errors = {}; + this._message = _message; + + if (instance) { + instance.$errors = this.errors; + } + } + + /** + * Console.log helper + */ + toString() { + return this.name + ': ' + combinePathErrors(this); + } + + /** + * add message + * @param {string} path + * @param {string|Error} error + * @api private + */ + addError(path, error) { + if (error instanceof ValidationError) { + const { errors } = error; + for (const errorPath of Object.keys(errors)) { + this.addError(`${path}.${errorPath}`, errors[errorPath]); + } + + return; + } + + this.errors[path] = error; + this.message = this._message + ': ' + combinePathErrors(this); + } +} + + +if (util.inspect.custom) { + // Avoid Node deprecation warning DEP0079 + ValidationError.prototype[util.inspect.custom] = ValidationError.prototype.inspect; +} + +/** + * Helper for JSON.stringify + * Ensure `name` and `message` show up in toJSON output re: gh-9847 + * @api private + */ +Object.defineProperty(ValidationError.prototype, 'toJSON', { + enumerable: false, + writable: false, + configurable: true, + value: function() { + return Object.assign({}, this, { name: this.name, message: this.message }); + } +}); + + +Object.defineProperty(ValidationError.prototype, 'name', { + value: 'ValidationError' +}); + +/*! + * Module exports + */ + +module.exports = ValidationError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validator.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validator.js new file mode 100644 index 00000000..4ada3014 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/validator.js @@ -0,0 +1,100 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); + +/** + * Schema validator error + * + * @param {object} properties + * @param {Document} doc + * @api private + */ + +class ValidatorError extends MongooseError { + + constructor(properties, doc) { + let msg = properties.message; + if (!msg) { + msg = MongooseError.messages.general.default; + } + + const message = formatMessage(msg, properties, doc); + super(message); + + properties = Object.assign({}, properties, { message: message }); + this.properties = properties; + this.kind = properties.type; + this.path = properties.path; + this.value = properties.value; + this.reason = properties.reason; + } + + /** + * toString helper + * TODO remove? This defaults to `${this.name}: ${this.message}` + * @api private + */ + toString() { + return this.message; + } + + /** + * Ensure `name` and `message` show up in toJSON output re: gh-9296 + * @api private + */ + + toJSON() { + return Object.assign({ name: this.name, message: this.message }, this); + } +} + + +Object.defineProperty(ValidatorError.prototype, 'name', { + value: 'ValidatorError' +}); + +/** + * The object used to define this validator. Not enumerable to hide + * it from `require('util').inspect()` output re: gh-3925 + * @api private + */ + +Object.defineProperty(ValidatorError.prototype, 'properties', { + enumerable: false, + writable: true, + value: null +}); + +// Exposed for testing +ValidatorError.prototype.formatMessage = formatMessage; + +/** + * Formats error messages + * @api private + */ + +function formatMessage(msg, properties, doc) { + if (typeof msg === 'function') { + return msg(properties, doc); + } + + const propertyNames = Object.keys(properties); + for (const propertyName of propertyNames) { + if (propertyName === 'message') { + continue; + } + msg = msg.replace('{' + propertyName.toUpperCase() + '}', properties[propertyName]); + } + + return msg; +} + +/*! + * exports + */ + +module.exports = ValidatorError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/version.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/version.js new file mode 100644 index 00000000..67ad2c3e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/error/version.js @@ -0,0 +1,38 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); + +/** + * Version Error constructor. + * + * @param {Document} doc + * @param {number} currentVersion + * @param {string[]} modifiedPaths + * @api private + */ + +class VersionError extends MongooseError { + + constructor(doc, currentVersion, modifiedPaths) { + const modifiedPathsStr = modifiedPaths.join(', '); + super('No matching document found for id "' + doc._doc._id + + '" version ' + currentVersion + ' modifiedPaths "' + modifiedPathsStr + '"'); + this.version = currentVersion; + this.modifiedPaths = modifiedPaths; + } +} + + +Object.defineProperty(VersionError.prototype, 'name', { + value: 'VersionError' +}); + +/*! + * exports + */ + +module.exports = VersionError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js new file mode 100644 index 00000000..e8e86406 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js @@ -0,0 +1,39 @@ +'use strict'; + +module.exports = function prepareDiscriminatorPipeline(pipeline, schema, prefix) { + const discriminatorMapping = schema?.discriminatorMapping; + prefix = prefix || ''; + + if (discriminatorMapping && !discriminatorMapping.isRoot) { + const originalPipeline = pipeline; + const filterKey = (prefix.length > 0 ? prefix + '.' : prefix) + discriminatorMapping.key; + const discriminatorValue = discriminatorMapping.value; + + // If the first pipeline stage is a match and it doesn't specify a `__t` + // key, add the discriminator key to it. This allows for potential + // aggregation query optimizations not to be disturbed by this feature. + if (originalPipeline[0] != null && + originalPipeline[0].$match && + (originalPipeline[0].$match[filterKey] === undefined || originalPipeline[0].$match[filterKey] === discriminatorValue)) { + originalPipeline[0].$match[filterKey] = discriminatorValue; + // `originalPipeline` is a ref, so there's no need for + // aggregate._pipeline = originalPipeline + } else if (originalPipeline[0]?.$geoNear) { + originalPipeline[0].$geoNear.query = + originalPipeline[0].$geoNear.query || {}; + originalPipeline[0].$geoNear.query[filterKey] = discriminatorValue; + } else if (originalPipeline[0]?.$search) { + if (originalPipeline[1]?.$match != null) { + originalPipeline[1].$match[filterKey] = originalPipeline[1].$match[filterKey] || discriminatorValue; + } else { + const match = {}; + match[filterKey] = discriminatorValue; + originalPipeline.splice(1, 0, { $match: match }); + } + } else { + const match = {}; + match[filterKey] = discriminatorValue; + originalPipeline.unshift({ $match: match }); + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js new file mode 100644 index 00000000..1f5d1e39 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js @@ -0,0 +1,50 @@ +'use strict'; + +module.exports = function stringifyFunctionOperators(pipeline) { + if (!Array.isArray(pipeline)) { + return; + } + + for (const stage of pipeline) { + if (stage == null) { + continue; + } + + const canHaveAccumulator = stage.$group || stage.$bucket || stage.$bucketAuto; + if (canHaveAccumulator != null) { + for (const key of Object.keys(canHaveAccumulator)) { + handleAccumulator(canHaveAccumulator[key]); + } + } + + const stageType = Object.keys(stage)[0]; + if (stageType && typeof stage[stageType] === 'object') { + const stageOptions = stage[stageType]; + for (const key of Object.keys(stageOptions)) { + if (stageOptions[key] != null && + stageOptions[key].$function != null && + typeof stageOptions[key].$function.body === 'function') { + stageOptions[key].$function.body = stageOptions[key].$function.body.toString(); + } + } + } + + if (stage.$facet != null) { + for (const key of Object.keys(stage.$facet)) { + stringifyFunctionOperators(stage.$facet[key]); + } + } + } +}; + +function handleAccumulator(operator) { + if (operator == null || operator.$accumulator == null) { + return; + } + + for (const key of ['init', 'accumulate', 'merge', 'finalize']) { + if (typeof operator.$accumulator[key] === 'function') { + operator.$accumulator[key] = String(operator.$accumulator[key]); + } + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/arrayDepth.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/arrayDepth.js new file mode 100644 index 00000000..16b92c13 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/arrayDepth.js @@ -0,0 +1,33 @@ +'use strict'; + +module.exports = arrayDepth; + +function arrayDepth(arr) { + if (!Array.isArray(arr)) { + return { min: 0, max: 0, containsNonArrayItem: true }; + } + if (arr.length === 0) { + return { min: 1, max: 1, containsNonArrayItem: false }; + } + if (arr.length === 1 && !Array.isArray(arr[0])) { + return { min: 1, max: 1, containsNonArrayItem: false }; + } + + const res = arrayDepth(arr[0]); + + for (let i = 1; i < arr.length; ++i) { + const _res = arrayDepth(arr[i]); + if (_res.min < res.min) { + res.min = _res.min; + } + if (_res.max > res.max) { + res.max = _res.max; + } + res.containsNonArrayItem = res.containsNonArrayItem || _res.containsNonArrayItem; + } + + res.min = res.min + 1; + res.max = res.max + 1; + + return res; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/buildMiddlewareFilter.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/buildMiddlewareFilter.js new file mode 100644 index 00000000..0ceecd73 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/buildMiddlewareFilter.js @@ -0,0 +1,42 @@ +'use strict'; + +const isPOJO = require('./isPOJO'); +const symbols = require('../schema/symbols'); + +/** + * Filter predicate that returns true for built-in middleware (marked with `builtInMiddleware` symbol). + */ +const isBuiltInMiddleware = hook => hook.fn[symbols.builtInMiddleware]; + +/** + * Builds a filter for kareem's execPre/execPost based on middleware options. + * + * @param {object} options - Options object that may contain `middleware` setting + * @param {string} phase - Either 'pre' or 'post' + * @returns {Function|null} - null runs all middleware, isBuiltInMiddleware skips user middleware + */ +function buildMiddlewareFilter(options, phase) { + const shouldSkip = options?.middleware === false || options?.middleware?.[phase] === false; + return shouldSkip ? isBuiltInMiddleware : null; +} + +/** + * kareem `getOptions` implementation for custom statics and methods: reads the + * `middleware` option from the call's last argument if it is a plain object. + * + * @param {Array} args - Arguments the custom static or method was called with + * @returns {object} - Per-call kareem options with pre/post filters + */ +function middlewareFiltersFromLastArg(args) { + const lastArg = args[args.length - 1]; + const options = isPOJO(lastArg) ? lastArg : null; + return { + pre: { filter: buildMiddlewareFilter(options, 'pre') }, + post: { filter: buildMiddlewareFilter(options, 'post') } + }; +} + +module.exports = { + buildMiddlewareFilter, + middlewareFiltersFromLastArg +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/clone.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/clone.js new file mode 100644 index 00000000..ccd56531 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/clone.js @@ -0,0 +1,262 @@ +'use strict'; + +const Decimal = require('../types/decimal128'); +const ObjectId = require('../types/objectid'); +const specialProperties = require('./specialProperties'); +const isMongooseObject = require('./isMongooseObject'); +const getFunctionName = require('./getFunctionName'); +const isBsonType = require('./isBsonType'); +const isMongooseArray = require('../types/array/isMongooseArray').isMongooseArray; +const isObject = require('./isObject'); +const isPOJO = require('./isPOJO'); +const symbols = require('./symbols'); +const trustedSymbol = require('./query/trusted').trustedSymbol; +const BSON = require('mongodb/lib/bson'); +const UUID = BSON.UUID; + +const Binary = BSON.Binary; + +/** + * Object clone with Mongoose natives support. + * + * If options.minimize is true, creates a minimal data object. Empty objects and undefined values will not be cloned. This makes the data payload sent to MongoDB as small as possible. + * + * Functions and primitives are never cloned. + * + * @param {object} obj the object to clone + * @param {object} options + * @param {boolean} isArrayChild true if cloning immediately underneath an array. Special case for minimize. + * @return {object} the cloned object + * @api private + */ + +function clone(obj, options, isArrayChild) { + if (obj == null) { + return obj; + } + + if (isBsonType(obj, 'Double')) { + return new BSON.Double(obj.value); + } + if (typeof obj === 'number' || typeof obj === 'string' || typeof obj === 'boolean' || typeof obj === 'bigint') { + return obj; + } + + if (Array.isArray(obj)) { + return cloneArray(obj, options); + } + + if (isMongooseObject(obj)) { + if (options) { + if (options.flattenUUIDs) { + if (obj instanceof Binary && obj._subtype === Binary.SUBTYPE_UUID) { + return obj.toString(); + } + if (obj?.isMongooseBuffer && obj._subtype === Binary.SUBTYPE_UUID) { + return obj.toUUID().toString(); + } + } + if (options.retainDocuments && obj.$__ != null) { + const clonedDoc = obj.$clone(); + if (obj.__index != null) { + clonedDoc.__index = obj.__index; + } + if (obj.__parentArray != null) { + clonedDoc.__parentArray = options.parentArray ?? obj.__parentArray; + } + clonedDoc.$__setParent(options.parentDoc ?? obj.$__parent); + return clonedDoc; + } + if (options.retainDocuments && obj.$isMongooseMap) { + const clonedParent = options.parentDoc ?? obj.$__parent; + const MongooseMap = obj.constructor; + const ret = new MongooseMap({}, obj.$__path, clonedParent, obj.$__schemaType); + for (const [key, value] of obj) { + ret.$__set(key, clone(value, { ...options, parentDoc: clonedParent })); + } + return ret; + } + } + + if (isPOJO(obj) && obj.$__ != null && obj._doc != null) { + return obj._doc; + } + + let ret; + if (options?.json && typeof obj.toJSON === 'function') { + ret = obj.toJSON(options); + } else { + ret = obj.toObject(options); + } + + return ret; + } + + const objConstructor = obj.constructor; + + if (objConstructor) { + switch (getFunctionName(objConstructor)) { + case 'Object': + return cloneObject(obj, options, isArrayChild); + case 'Date': + return new objConstructor(+obj); + case 'RegExp': + return cloneRegExp(obj); + default: + // ignore + break; + } + } + + if (isBsonType(obj, 'ObjectId')) { + if (options?.flattenObjectIds) { + return obj.toJSON(); + } + return new ObjectId(obj.id); + } + + if (isBsonType(obj, 'Decimal128')) { + if (options?.flattenDecimals) { + return obj.toJSON(); + } + return Decimal.fromString(obj.toString()); + } + + if (obj instanceof UUID) { + if (options?.flattenUUIDs) { + return obj.toJSON(); + } + return new UUID(obj.buffer); + } + + // object created with Object.create(null) + if (!objConstructor && isObject(obj)) { + return cloneObject(obj, options, isArrayChild); + } + + if (typeof obj === 'object' && obj[symbols.schemaTypeSymbol]) { + return obj.clone(); + } + + // If we're cloning this object to go into a MongoDB command, + // and there's a `toBSON()` function, assume this object will be + // stored as a primitive in MongoDB and doesn't need to be cloned. + if (options?.bson && typeof obj.toBSON === 'function') { + return obj; + } + + if (typeof obj.valueOf === 'function') { + return obj.valueOf(); + } + + return cloneObject(obj, options, isArrayChild); +} +module.exports = clone; + +/*! + * ignore + */ + +function cloneObject(obj, options, isArrayChild) { + const minimize = options?.minimize; + const omitUndefined = options?.omitUndefined; + const seen = options?._seen; + const ret = {}; + let hasKeys; + + if (seen && seen.has(obj)) { + return seen.get(obj); + } else if (seen) { + seen.set(obj, ret); + } + if (trustedSymbol in obj && options?.copyTrustedSymbol !== false) { + ret[trustedSymbol] = obj[trustedSymbol]; + } + + const keys = Object.keys(obj); + const len = keys.length; + + for (let i = 0; i < len; ++i) { + const key = keys[i]; + if (specialProperties.has(key)) { + continue; + } + + // Don't pass `isArrayChild` down + const val = clone(obj[key], options, false); + + if ((minimize === false || omitUndefined) && typeof val === 'undefined') { + delete ret[key]; + } else if (minimize !== true || (typeof val !== 'undefined')) { + hasKeys || (hasKeys = true); + ret[key] = val; + } + } + + return minimize && !isArrayChild ? hasKeys && ret : ret; +} + +function cloneArray(arr, options) { + const seen = options?._seen; + if (seen && seen.has(arr)) { + return seen.get(arr); + } + + let i = 0; + const len = arr.length; + + let ret = null; + if (options?.retainDocuments) { + // Use the cloned parent doc (options.parentDoc) when available so the new + // array is wired up to the clone, not the source. Falling back to the + // source's parent preserves the previous behavior for callers that don't + // pass parentDoc. + const newParent = options.parentDoc ?? (arr.isMongooseArray ? arr.$parent() : undefined); + if (arr.isMongooseDocumentArray) { + ret = new (arr.$schemaType().schema.base.Types.DocumentArray)([], arr.$path(), newParent, arr.$schemaType()); + } else if (arr.isMongooseArray) { + ret = new (arr.$parent().schema.base.Types.Array)([], arr.$path(), newParent, arr.$schemaType()); + } else { + ret = new Array(len); + } + } else { + ret = new Array(len); + } + + if (seen) { + seen.set(arr, ret); + } + + arr = isMongooseArray(arr) ? arr.__array : arr; + if (ret.isMongooseDocumentArray) { + // Create new options object to avoid mutating the shared options. + // Subdocs need parentArray to point to their own cloned array. + options = { ...options, parentArray: ret }; + // Skip change-tracking while populating the freshly cloned array: every + // index assignment would otherwise call markModified on the cloned parent + // doc and (before this guard) on the source parent doc. + for (i = 0; i < len; ++i) { + const doc = clone(arr[i], options, true); + // Document arrays can contain null entries, so only restamp actual subdocs. + if (typeof doc?.$setIndex === 'function') { + doc.$setIndex(i); + } + ret.set(i, doc, true); + } + } else { + for (i = 0; i < len; ++i) { + ret[i] = clone(arr[i], options, true); + } + } + + return ret; +} + +function cloneRegExp(regexp) { + const ret = new RegExp(regexp.source, regexp.flags); + + if (ret.lastIndex !== regexp.lastIndex) { + ret.lastIndex = regexp.lastIndex; + } + return ret; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/common.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/common.js new file mode 100644 index 00000000..b067b9ab --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/common.js @@ -0,0 +1,127 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const Binary = require('mongodb/lib/bson').Binary; +const isBsonType = require('./isBsonType'); +const isMongooseObject = require('./isMongooseObject'); +const MongooseError = require('../error'); +const util = require('util'); + +exports.flatten = flatten; +exports.modifiedPaths = modifiedPaths; + +/*! + * ignore + */ + +function flatten(update, path, options, schema) { + let keys; + if (update && isMongooseObject(update) && !Buffer.isBuffer(update)) { + keys = Object.keys(update.toObject({ transform: false, virtuals: false }) || {}); + } else { + keys = Object.keys(update || {}); + } + + const numKeys = keys.length; + const result = {}; + path = path ? path + '.' : ''; + + for (let i = 0; i < numKeys; ++i) { + const key = keys[i]; + const val = update[key]; + result[path + key] = val; + + // Avoid going into mixed paths if schema is specified + const keySchema = schema?.path?.(path + key); + const isNested = schema?.nested?.[path + key]; + if (keySchema?.instance === 'Mixed') continue; + + if (shouldFlatten(val)) { + if (options?.skipArrays && Array.isArray(val)) { + continue; + } + const flat = flatten(val, path + key, options, schema); + for (const k in flat) { + result[k] = flat[k]; + } + if (Array.isArray(val)) { + result[path + key] = val; + } + } + + if (isNested) { + const paths = Object.keys(schema.paths); + for (const p of paths) { + if (p.startsWith(path + key + '.') && !Object.hasOwn(result, p)) { + result[p] = void 0; + } + } + } + } + + return result; +} + +/*! + * ignore + */ + +function modifiedPaths(update, path, result, recursion = null) { + if (update == null || typeof update !== 'object') { + return; + } + + if (recursion == null) { + recursion = { + raw: { update, path }, + trace: new WeakSet() + }; + } + + if (recursion.trace.has(update)) { + throw new MongooseError(`a circular reference in the update value, updateValue: +${util.inspect(recursion.raw.update, { showHidden: false, depth: 1 })} +updatePath: '${recursion.raw.path}'`); + } + recursion.trace.add(update); + + const keys = Object.keys(update || {}); + const numKeys = keys.length; + result = result || {}; + path = path ? path + '.' : ''; + + for (let i = 0; i < numKeys; ++i) { + const key = keys[i]; + let val = update[key]; + + const _path = path + key; + result[_path] = true; + if (!Buffer.isBuffer(val) && isMongooseObject(val)) { + val = val.toObject({ transform: false, virtuals: false }); + } + if (shouldFlatten(val)) { + modifiedPaths(val, path + key, result, recursion); + } + } + recursion.trace.delete(update); + + return result; +} + +/*! + * ignore + */ + +function shouldFlatten(val) { + return val && + typeof val === 'object' && + !(val instanceof Date) && + !isBsonType(val, 'ObjectId') && + (!Array.isArray(val) || val.length !== 0) && + !(val instanceof Buffer) && + !isBsonType(val, 'Decimal128') && + !(val instanceof Binary); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/cursor/eachAsync.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/cursor/eachAsync.js new file mode 100644 index 00000000..90a76326 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/cursor/eachAsync.js @@ -0,0 +1,225 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EachAsyncMultiError = require('../../error/eachAsyncMultiError'); +const immediate = require('../immediate'); + +/** + * Execute `fn` for every document in the cursor. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * + * @param {Function} next the thunk to call to get the next document + * @param {Function} fn + * @param {object} options + * @param {number} [options.batchSize=null] if set, Mongoose will call `fn` with an array of at most `batchSize` documents, instead of a single document + * @param {number} [options.parallel=1] maximum number of `fn` calls that Mongoose will run in parallel + * @param {AbortSignal} [options.signal] allow cancelling this eachAsync(). Once the abort signal is fired, `eachAsync()` will immediately fulfill the returned promise (or call the callback) and not fetch any more documents. + * @return {Promise} + * @api public + * @method eachAsync + */ + +module.exports = async function eachAsync(next, fn, options) { + const parallel = options.parallel || 1; + const batchSize = options.batchSize; + const signal = options.signal; + const continueOnError = options.continueOnError; + const aggregatedErrors = []; + const enqueue = asyncQueue(); + + let aborted = false; + + return new Promise((resolve, reject) => { + if (signal != null) { + if (signal.aborted) { + return resolve(null); + } + + signal.addEventListener('abort', () => { + aborted = true; + return resolve(null); + }, { once: true }); + } + + if (batchSize != null) { + if (typeof batchSize !== 'number') { + throw new TypeError('batchSize must be a number'); + } else if (!Number.isInteger(batchSize)) { + throw new TypeError('batchSize must be an integer'); + } else if (batchSize < 1) { + throw new TypeError('batchSize must be at least 1'); + } + } + + iterate((err, res) => { + if (err != null) { + return reject(err); + } + resolve(res); + }); + }); + + function iterate(finalCallback) { + let handleResultsInProgress = 0; + let currentDocumentIndex = 0; + + let error = null; + for (let i = 0; i < parallel; ++i) { + enqueue(createFetch()); + } + + function createFetch() { + let documentsBatch = []; + let drained = false; + + return fetch; + + function fetch(done) { + if (drained || aborted) { + return done(); + } else if (error) { + return done(); + } + + next(function(err, doc) { + if (error != null) { + return done(); + } + if (err != null) { + if (err.name === 'MongoCursorExhaustedError') { + // We may end up calling `next()` multiple times on an exhausted + // cursor, which leads to an error. In case cursor is exhausted, + // just treat it as if the cursor returned no document, which is + // how a cursor indicates it is exhausted. + doc = null; + } else if (continueOnError) { + aggregatedErrors.push(err); + } else { + error = err; + finalCallback(err); + return done(); + } + } + if (doc == null) { + drained = true; + if (handleResultsInProgress <= 0) { + const finalErr = continueOnError ? + createEachAsyncMultiError(aggregatedErrors) : + error; + + finalCallback(finalErr); + } else if (batchSize && documentsBatch.length) { + handleNextResult(documentsBatch, currentDocumentIndex++, handleNextResultCallBack); + } + return done(); + } + + ++handleResultsInProgress; + + // Kick off the subsequent `next()` before handling the result, but + // make sure we know that we still have a result to handle re: #8422 + immediate(() => done()); + + if (batchSize) { + documentsBatch.push(doc); + } + + // If the current documents size is less than the provided batch size don't process the documents yet + if (batchSize && documentsBatch.length !== batchSize) { + immediate(() => enqueue(fetch)); + return; + } + + const docsToProcess = batchSize ? documentsBatch : doc; + + function handleNextResultCallBack(err) { + if (batchSize) { + handleResultsInProgress -= documentsBatch.length; + documentsBatch = []; + } else { + --handleResultsInProgress; + } + if (err != null) { + if (continueOnError) { + aggregatedErrors.push(err); + } else { + error = err; + return finalCallback(err); + } + } + if ((drained || aborted) && handleResultsInProgress <= 0) { + const finalErr = continueOnError ? + createEachAsyncMultiError(aggregatedErrors) : + error; + return finalCallback(finalErr); + } + + immediate(() => enqueue(fetch)); + } + + handleNextResult(docsToProcess, currentDocumentIndex++, handleNextResultCallBack); + }); + } + } + } + + function handleNextResult(doc, i, callback) { + let maybePromise; + try { + maybePromise = fn(doc, i); + } catch (err) { + return callback(err); + } + if (typeof maybePromise?.then === 'function') { + maybePromise.then( + function() { callback(null); }, + function(error) { + callback(error || new Error('`eachAsync()` promise rejected without error')); + }); + } else { + callback(null); + } + } +}; + +// `next()` can only execute one at a time, so make sure we always execute +// `next()` in series, while still allowing multiple `fn()` instances to run +// in parallel. +function asyncQueue() { + const _queue = []; + let inProgress = null; + let id = 0; + + return function enqueue(fn) { + if ( + inProgress === null && + _queue.length === 0 + ) { + inProgress = id++; + return fn(_step); + } + _queue.push(fn); + }; + + function _step() { + if (_queue.length !== 0) { + inProgress = id++; + const fn = _queue.shift(); + fn(_step); + } else { + inProgress = null; + } + } +} + +function createEachAsyncMultiError(aggregatedErrors) { + if (aggregatedErrors.length === 0) { + return null; + } + + return new EachAsyncMultiError(aggregatedErrors); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js new file mode 100644 index 00000000..01593a9b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js @@ -0,0 +1,36 @@ +'use strict'; + +module.exports = applyEmbeddedDiscriminators; + +function applyEmbeddedDiscriminators(schema, seen = new WeakSet(), overwriteExisting = false) { + if (seen.has(schema)) { + return; + } + seen.add(schema); + for (const path of Object.keys(schema.paths)) { + const schemaType = schema.paths[path]; + if (!schemaType.schema) { + continue; + } + applyEmbeddedDiscriminators(schemaType.schema, seen); + if (!schemaType.schema._applyDiscriminators) { + continue; + } + if (schemaType._appliedDiscriminators && !overwriteExisting) { + continue; + } + for (const discriminatorKey of schemaType.schema._applyDiscriminators.keys()) { + const { + schema: discriminatorSchema, + options + } = schemaType.schema._applyDiscriminators.get(discriminatorKey); + applyEmbeddedDiscriminators(discriminatorSchema, seen); + schemaType.discriminator( + discriminatorKey, + discriminatorSchema, + overwriteExisting ? { ...options, overwriteExisting: true } : options + ); + } + schemaType._appliedDiscriminators = true; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js new file mode 100644 index 00000000..1b81a48f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js @@ -0,0 +1,16 @@ +'use strict'; + +const isBsonType = require('../isBsonType'); + +module.exports = function areDiscriminatorValuesEqual(a, b) { + if (typeof a === 'string' && typeof b === 'string') { + return a === b; + } + if (typeof a === 'number' && typeof b === 'number') { + return a === b; + } + if (isBsonType(a, 'ObjectId') && isBsonType(b, 'ObjectId')) { + return a.toString() === b.toString(); + } + return false; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js new file mode 100644 index 00000000..4eb56de4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function checkEmbeddedDiscriminatorKeyProjection(userProjection, path, schema, selected, addedPaths) { + const userProjectedInPath = Object.keys(userProjection). + reduce((cur, key) => cur || key.startsWith(path + '.'), false); + const _discriminatorKey = path + '.' + schema.options.discriminatorKey; + if (!userProjectedInPath && + addedPaths.length === 1 && + addedPaths[0] === _discriminatorKey) { + selected.splice(selected.indexOf(_discriminatorKey), 1); + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js new file mode 100644 index 00000000..a649a960 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js @@ -0,0 +1,29 @@ +'use strict'; + +const getDiscriminatorByValue = require('./getDiscriminatorByValue'); + +/** + * Find the correct constructor, taking into account discriminators + * @api private + */ + +module.exports = function getConstructor(Constructor, value, defaultDiscriminatorValue) { + const discriminatorKey = Constructor.schema.options.discriminatorKey; + let discriminatorValue = value?.[discriminatorKey]; + if (discriminatorValue == null) { + discriminatorValue = defaultDiscriminatorValue; + } + if (Constructor.discriminators && + discriminatorValue != null) { + if (Constructor.discriminators[discriminatorValue]) { + Constructor = Constructor.discriminators[discriminatorValue]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, discriminatorValue); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + + return Constructor; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js new file mode 100644 index 00000000..f66038d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js @@ -0,0 +1,28 @@ +'use strict'; + +const areDiscriminatorValuesEqual = require('./areDiscriminatorValuesEqual'); + +/** + * returns discriminator by discriminatorMapping.value + * + * @param {object} discriminators + * @param {string} value + * @api private + */ + +module.exports = function getDiscriminatorByValue(discriminators, value) { + if (discriminators == null) { + return null; + } + for (const name of Object.keys(discriminators)) { + const it = discriminators[name]; + if ( + it.schema && + it.schema.discriminatorMapping && + areDiscriminatorValuesEqual(it.schema.discriminatorMapping.value, value) + ) { + return it; + } + } + return null; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js new file mode 100644 index 00000000..3f9a678e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js @@ -0,0 +1,27 @@ +'use strict'; + +const areDiscriminatorValuesEqual = require('./areDiscriminatorValuesEqual'); + +/** + * returns discriminator by discriminatorMapping.value + * + * @param {Schema} schema + * @param {string} value + * @api private + */ + +module.exports = function getSchemaDiscriminatorByValue(schema, value) { + if (schema?.discriminators == null) { + return null; + } + for (const key of Object.keys(schema.discriminators)) { + const discriminatorSchema = schema.discriminators[key]; + if (discriminatorSchema.discriminatorMapping == null) { + continue; + } + if (areDiscriminatorValuesEqual(discriminatorSchema.discriminatorMapping.value, value)) { + return discriminatorSchema; + } + } + return null; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js new file mode 100644 index 00000000..7f21a7e4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js @@ -0,0 +1,96 @@ +'use strict'; +const schemaMerge = require('../schema/merge'); +const specialProperties = require('../../helpers/specialProperties'); +const isBsonType = require('../../helpers/isBsonType'); +const ObjectId = require('../../types/objectid'); +const SchemaType = require('../../schemaType'); +const isObject = require('../../helpers/isObject'); +/** + * Merges `from` into `to` without overwriting existing properties. + * + * @param {object} to + * @param {object} from + * @param {string} [path] + * @api private + */ + +module.exports = function mergeDiscriminatorSchema(to, from, path, seen) { + const keys = Object.keys(from); + let i = 0; + const len = keys.length; + let key; + + path = path || ''; + seen = seen || new WeakSet(); + + if (seen.has(from)) { + return; + } + seen.add(from); + + while (i < len) { + key = keys[i++]; + if (!path) { + if (key === 'discriminators' || + key === 'base' || + key === '_applyDiscriminators' || + key === '_userProvidedOptions' || + key === 'options' || + key === 'tree') { + continue; + } + } + if (path === 'tree' && from?.instanceOfSchema) { + continue; + } + if (specialProperties.has(key)) { + continue; + } + if (key === 'parentSchema') { + // Skip parentSchema to avoid merging parent schema multiple times + // through child paths' back-references (gh-15966) + continue; + } + if (to[key] == null) { + to[key] = from[key]; + } else if (isObject(from[key])) { + if (!isObject(to[key])) { + to[key] = {}; + } + if (from[key] != null) { + // Skip merging schemas if we're creating a discriminator schema and + // base schema has a given path as a single nested but discriminator schema + // has the path as a document array, or vice versa (gh-9534) + if ((from[key].$isSingleNested && to[key].$isMongooseDocumentArray) || + (from[key].$isMongooseDocumentArray && to[key].$isSingleNested) || + (from[key].$isMongooseDocumentArrayElement && to[key].$isMongooseDocumentArrayElement)) { + continue; + } else if (from[key].instanceOfSchema) { + if (to[key].instanceOfSchema) { + schemaMerge(to[key], from[key].clone(), true); + } else { + to[key] = from[key].clone(); + } + continue; + } else if (isBsonType(from[key], 'ObjectId')) { + to[key] = new ObjectId(from[key]); + continue; + } else if (from[key] instanceof SchemaType) { + if (to[key] == null) { + to[key] = from[key].clone(); + } + // For container types with nested schemas, we need to continue to the + // recursive merge below to properly merge the nested schemas + if (!from[key].$isMongooseDocumentArray && !from[key].$isSingleNested) { + continue; + } + } + } + mergeDiscriminatorSchema(to[key], from[key], path ? path + '.' + key : key, seen); + } + } + + if (from?.instanceOfSchema) { + to.tree = Object.assign({}, from.tree, to.tree); + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyDefaults.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyDefaults.js new file mode 100644 index 00000000..f7f1aa46 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyDefaults.js @@ -0,0 +1,201 @@ +'use strict'; + +const isNestedProjection = require('../projection/isNestedProjection'); + +module.exports = function applyDefaults(doc, fields, exclude, hasIncludedChildren, isBeforeSetters, pathsToSkip, options) { + const schemaPaths = doc.$__schema.paths; + const skipParentChangeTracking = options?.skipParentChangeTracking; + const skipId = doc.$__.skipId; + // Whether any path has a function default that must run **after** setters, + // so callers doing a before-setters pass can skip the after-setters pass + // entirely when this comes back `false`. + let hasPostSetterDefaults = false; + + for (const p in schemaPaths) { + let def; + let curPath = ''; + + if (p === '_id' && skipId) { + continue; + } + + const type = schemaPaths[p]; + // `getDefault()` returns undefined when `defaultValue` is undefined, in which + // case this loop never modifies the doc, so skip traversing the path entirely. + if (type.defaultValue === undefined) { + continue; + } + if (typeof type.defaultValue === 'function' && !type.defaultValue.$runBeforeSetters) { + hasPostSetterDefaults = true; + } + const path = type.splitPath(); + const len = path.length; + if (path[len - 1] === '$*') { + continue; + } + + let included = false; + let doc_ = doc._doc; + + if (len === 1) { + if (exclude === true) { + if (p in fields) { + continue; + } + } else if (exclude === false && fields) { + const hasSubpaths = type.$isSingleNested || type.$isMongooseDocumentArray; + if ((p in fields && !isNestedProjection(fields[p])) || (hasSubpaths && hasIncludedChildren != null && hasIncludedChildren[p])) { + included = true; + } else if (hasIncludedChildren != null && !hasIncludedChildren[p]) { + continue; + } + } + + if (doc_[p] !== void 0) { + continue; + } + + if (isBeforeSetters != null) { + if (typeof type.defaultValue === 'function') { + if (!type.defaultValue.$runBeforeSetters && isBeforeSetters) { + continue; + } + if (type.defaultValue.$runBeforeSetters && !isBeforeSetters) { + continue; + } + } else if (!isBeforeSetters) { + // Non-function defaults should always run **before** setters + continue; + } + } + + if (pathsToSkip && pathsToSkip[p]) { + continue; + } + + if (fields && exclude !== null && !(exclude === true || included)) { + continue; + } + + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p, err); + continue; + } + + if (typeof def !== 'undefined') { + doc_[p] = def; + applyChangeTracking(doc, p, skipParentChangeTracking); + } + continue; + } + + for (let j = 0; j < len; ++j) { + if (doc_ == null) { + break; + } + + const piece = path[j]; + curPath = curPath.length ? curPath + '.' + piece : piece; + + if (exclude === true) { + if (curPath in fields) { + break; + } + } else if (exclude === false && fields && !included) { + const hasSubpaths = type.$isSingleNested || type.$isMongooseDocumentArray; + if ((curPath in fields && !isNestedProjection(fields[curPath])) || (j === len - 1 && hasSubpaths && hasIncludedChildren != null && hasIncludedChildren[curPath])) { + included = true; + } else if (hasIncludedChildren != null && !hasIncludedChildren[curPath]) { + break; + } + } + + if (j === len - 1) { + if (doc_[piece] !== void 0) { + break; + } + + if (isBeforeSetters != null) { + if (typeof type.defaultValue === 'function') { + if (!type.defaultValue.$runBeforeSetters && isBeforeSetters) { + break; + } + if (type.defaultValue.$runBeforeSetters && !isBeforeSetters) { + break; + } + } else if (!isBeforeSetters) { + // Non-function defaults should always run **before** setters + continue; + } + } + + if (pathsToSkip && pathsToSkip[curPath]) { + break; + } + + if (fields && exclude !== null) { + if (exclude === true) { + // apply defaults to all non-excluded fields + if (p in fields) { + continue; + } + + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p, err); + break; + } + + if (typeof def !== 'undefined') { + doc_[piece] = def; + applyChangeTracking(doc, p, skipParentChangeTracking); + } + } else if (included) { + // selected field + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p, err); + break; + } + + if (typeof def !== 'undefined') { + doc_[piece] = def; + applyChangeTracking(doc, p, skipParentChangeTracking); + } + } + } else { + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p, err); + break; + } + + if (typeof def !== 'undefined') { + doc_[piece] = def; + applyChangeTracking(doc, p, skipParentChangeTracking); + } + } + } else { + doc_ = doc_[piece]; + } + } + } + + return hasPostSetterDefaults; +}; + +/*! + * ignore + */ + +function applyChangeTracking(doc, fullPath, skipParentChangeTracking) { + doc.$__.activePaths.default(fullPath); + if (!skipParentChangeTracking && doc.$isSubdocument && doc.$isSingleNested && doc.$parent() != null) { + doc.$parent().$__.activePaths.default(doc.$__pathRelativeToParent(fullPath)); + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyTimestamps.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyTimestamps.js new file mode 100644 index 00000000..83e221dc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyTimestamps.js @@ -0,0 +1,106 @@ +'use strict'; + +const handleTimestampOption = require('../schema/handleTimestampOption'); +const mpath = require('mpath'); +const utils = require('../../utils'); + +module.exports = applyTimestamps; + +/** + * Apply a given schema's timestamps to the given POJO + * + * @param {Schema} schema + * @param {object} obj + * @param {object} [options] + * @param {boolean} [options.isUpdate=false] if true, treat this as an update: just set updatedAt, skip setting createdAt. If false, set both createdAt and updatedAt + * @param {Function} [options.currentTime] if set, Mongoose will call this function to get the current time. + */ + +function applyTimestamps(schema, obj, options) { + if (obj == null) { + return obj; + } + + applyTimestampsToChildren(schema, obj, options); + return applyTimestampsToDoc(schema, obj, options); +} + +/** + * Apply timestamps to any subdocuments + * + * @param {Schema} schema subdocument schema + * @param {object} res subdocument + * @param {object} [options] + * @param {boolean} [options.isUpdate=false] if true, treat this as an update: just set updatedAt, skip setting createdAt. If false, set both createdAt and updatedAt + * @param {Function} [options.currentTime] if set, Mongoose will call this function to get the current time. + */ + +function applyTimestampsToChildren(schema, res, options) { + for (const childSchema of schema.childSchemas) { + const _path = childSchema.model.path; + const _schema = childSchema.schema; + if (!_path) { + continue; + } + const _obj = mpath.get(_path, res); + if (_obj == null || (Array.isArray(_obj) && _obj.flat(Infinity).length === 0)) { + continue; + } + + applyTimestamps(_schema, _obj, options); + } +} + +/** + * Apply timestamps to a given document. Does not apply timestamps to subdocuments: use `applyTimestampsToChildren` instead + * + * @param {Schema} schema + * @param {object} obj + * @param {object} [options] + * @param {boolean} [options.isUpdate=false] if true, treat this as an update: just set updatedAt, skip setting createdAt. If false, set both createdAt and updatedAt + * @param {Function} [options.currentTime] if set, Mongoose will call this function to get the current time. + */ + +function applyTimestampsToDoc(schema, obj, options) { + if (obj == null || typeof obj !== 'object') { + return; + } + if (Array.isArray(obj)) { + for (const el of obj) { + applyTimestampsToDoc(schema, el, options); + } + return; + } + + if (schema.discriminators && utils.hasOwnKeys(schema.discriminators)) { + for (const discriminatorKey of Object.keys(schema.discriminators)) { + const discriminator = schema.discriminators[discriminatorKey]; + const key = discriminator.discriminatorMapping.key; + const value = discriminator.discriminatorMapping.value; + if (obj[key] == value) { + schema = discriminator; + break; + } + } + } + + const createdAt = handleTimestampOption(schema.options.timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(schema.options.timestamps, 'updatedAt'); + const currentTime = options?.currentTime; + + let ts = null; + if (currentTime != null) { + ts = currentTime(); + } else if (schema.base?.now) { + ts = schema.base.now(); + } else { + ts = new Date(); + } + + if (createdAt && obj[createdAt] == null && !options?.isUpdate) { + obj[createdAt] = ts; + } + if (updatedAt) { + obj[updatedAt] = ts; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyVirtuals.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyVirtuals.js new file mode 100644 index 00000000..7b7c4e7c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/applyVirtuals.js @@ -0,0 +1,147 @@ +'use strict'; + +const mpath = require('mpath'); +const utils = require('../../utils'); + +module.exports = applyVirtuals; + +/** + * Apply a given schema's virtuals to a given POJO + * + * @param {Schema} schema + * @param {object} obj + * @param {string[]} [virtuals] optional whitelist of virtuals to apply + * @returns + */ + +function applyVirtuals(schema, obj, virtuals) { + if (obj == null) { + return obj; + } + + let virtualsForChildren = virtuals; + let toApply = null; + + if (Array.isArray(virtuals)) { + virtualsForChildren = []; + toApply = []; + for (const virtual of virtuals) { + if (virtual.length === 1) { + toApply.push(virtual[0]); + } else { + virtualsForChildren.push(virtual); + } + } + } + + applyVirtualsToChildren(schema, obj, virtualsForChildren); + return applyVirtualsToDoc(schema, obj, toApply); +} + +/** + * Apply virtuals to any subdocuments + * + * @param {Schema} schema subdocument schema + * @param {object} res subdocument + * @param {string[]} [virtuals] optional whitelist of virtuals to apply + */ + +function applyVirtualsToChildren(schema, res, virtuals) { + let attachedVirtuals = false; + for (const childSchema of schema.childSchemas) { + const _path = childSchema.model.path; + const _schema = childSchema.schema; + if (!_path) { + continue; + } + const _obj = mpath.get(_path, res); + if (_obj == null || (Array.isArray(_obj) && _obj.flat(Infinity).length === 0)) { + continue; + } + + let virtualsForChild = null; + if (Array.isArray(virtuals)) { + virtualsForChild = []; + for (const virtual of virtuals) { + if (virtual[0] == _path) { + virtualsForChild.push(virtual.slice(1)); + } + } + + if (virtualsForChild.length === 0) { + continue; + } + } + + applyVirtuals(_schema, _obj, virtualsForChild); + attachedVirtuals = true; + } + + if (virtuals?.length && !attachedVirtuals) { + applyVirtualsToDoc(schema, res, virtuals); + } +} + +/** + * Apply virtuals to a given document. Does not apply virtuals to subdocuments: use `applyVirtualsToChildren` instead + * + * @param {Schema} schema + * @param {object} doc + * @param {string[]} [virtuals] optional whitelist of virtuals to apply + * @returns + */ + +function applyVirtualsToDoc(schema, obj, virtuals) { + if (obj == null || typeof obj !== 'object') { + return; + } + if (Array.isArray(obj)) { + for (const el of obj) { + applyVirtualsToDoc(schema, el, virtuals); + } + return; + } + + if (schema.discriminators && utils.hasOwnKeys(schema.discriminators)) { + for (const discriminatorKey of Object.keys(schema.discriminators)) { + const discriminator = schema.discriminators[discriminatorKey]; + const key = discriminator.discriminatorMapping.key; + const value = discriminator.discriminatorMapping.value; + if (obj[key] == value) { + schema = discriminator; + break; + } + } + } + + if (virtuals == null) { + virtuals = Object.keys(schema.virtuals); + } + for (const virtual of virtuals) { + if (schema.virtuals[virtual] == null) { + continue; + } + const virtualType = schema.virtuals[virtual]; + const sp = Array.isArray(virtual) + ? virtual + : virtual.indexOf('.') === -1 + ? [virtual] + : virtual.split('.'); + let cur = obj; + for (let i = 0; i < sp.length - 1; ++i) { + cur[sp[i]] = sp[i] in cur ? cur[sp[i]] : {}; + cur = cur[sp[i]]; + } + let val = virtualType.applyGetters(cur[sp[sp.length - 1]], obj); + const isPopulateVirtual = + virtualType.options?.ref || virtualType.options?.refPath; + if (isPopulateVirtual && val === undefined) { + if (virtualType.options.justOne) { + val = null; + } else { + val = []; + } + } + cur[sp[sp.length - 1]] = val; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js new file mode 100644 index 00000000..bbf0c456 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js @@ -0,0 +1,45 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function cleanModifiedSubpaths(doc, path, options) { + options = options || {}; + const skipDocArrays = options.skipDocArrays; + + let deleted = 0; + if (!doc) { + return deleted; + } + + for (const modifiedPath of Object.keys(doc.$__.activePaths.getStatePaths('modify'))) { + if (skipDocArrays) { + const schemaType = doc.$__schema.path(modifiedPath); + if (schemaType?.$isMongooseDocumentArray) { + continue; + } + } + if (modifiedPath.startsWith(path + '.')) { + doc.$__.activePaths.clearPath(modifiedPath); + ++deleted; + + if (doc.$isSubdocument) { + cleanParent(doc, modifiedPath); + } + } + } + return deleted; +}; + +function cleanParent(doc, path, seen = new Set()) { + if (seen.has(doc)) { + throw new Error('Infinite subdocument loop: subdoc with _id ' + doc._id + ' is a parent of itself'); + } + const parent = doc.$parent(); + const newPath = doc.$__pathRelativeToParent(void 0, false) + '.' + path; + parent.$__.activePaths.clearPath(newPath); + if (parent.$isSubdocument) { + cleanParent(parent, newPath, seen); + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/compile.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/compile.js new file mode 100644 index 00000000..c13a15c2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/compile.js @@ -0,0 +1,241 @@ +'use strict'; + +const clone = require('../../helpers/clone'); +const documentSchemaSymbol = require('../../helpers/symbols').documentSchemaSymbol; +const internalToObjectOptions = require('../../options').internalToObjectOptions; +const utils = require('../../utils'); + +let Document; +const getSymbol = require('../../helpers/symbols').getSymbol; +const scopeSymbol = require('../../helpers/symbols').scopeSymbol; + +const isPOJO = utils.isPOJO; + +/*! + * exports + */ + +exports.compile = compile; +exports.defineKey = defineKey; + +const _isEmptyOptions = Object.freeze({ + minimize: true, + virtuals: false, + getters: false, + transform: false +}); + +const noDottedPathGetOptions = Object.freeze({ + noDottedPath: true +}); + +/** + * Compiles schemas. + * @param {object} tree + * @param {any} proto + * @param {string} prefix + * @param {object} options + * @api private + */ + +function compile(tree, proto, prefix, options) { + Document = Document || require('../../document'); + const typeKey = options.typeKey; + + for (const key of Object.keys(tree)) { + const limb = tree[key]; + + const hasSubprops = isPOJO(limb) && + utils.hasOwnKeys(limb) && + (!limb[typeKey] || (typeKey === 'type' && isPOJO(limb.type) && limb.type.type)); + const subprops = hasSubprops ? limb : null; + + defineKey({ prop: key, subprops: subprops, prototype: proto, prefix: prefix, options: options }); + } +} + +/** + * Defines the accessor named prop on the incoming prototype. + * @param {object} options + * @param {string} options.prop + * @param {boolean} options.subprops + * @param {any} options.prototype + * @param {string} [options.prefix] + * @param {object} options.options + * @api private + */ + +function defineKey({ prop, subprops, prototype, prefix, options }) { + Document = Document || require('../../document'); + const path = (prefix ? prefix + '.' : '') + prop; + prefix = prefix || ''; + const useGetOptions = prefix ? Object.freeze({}) : noDottedPathGetOptions; + + if (subprops) { + Object.defineProperty(prototype, prop, { + enumerable: true, + configurable: true, + get: function() { + if (!this.$__) { + return undefined; + } + const _this = this; + if (!this.$__.getters) { + this.$__.getters = {}; + } + + if (!this.$__.getters[path]) { + const nested = Object.create(Document.prototype, getOwnPropertyDescriptors(this)); + + // save scope for nested getters/setters + if (!prefix) { + nested.$__[scopeSymbol] = this; + } + nested.$__.nestedPath = path; + + Object.defineProperty(nested, 'schema', { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + + Object.defineProperty(nested, '$__schema', { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + + Object.defineProperty(nested, documentSchemaSymbol, { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + + Object.defineProperty(nested, 'toObject', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return clone(_this.get(path, null, { + virtuals: this && + this.schema && + this.schema.options && + this.schema.options.toObject && + this.schema.options.toObject.virtuals || null + })); + } + }); + + Object.defineProperty(nested, '$__get', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return _this.get(path, null, { + virtuals: this?.schema?.options?.toObject?.virtuals || null + }); + } + }); + + Object.defineProperty(nested, 'toJSON', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return _this.get(path, null, { + virtuals: this?.schema?.options?.toJSON?.virtuals || null + }); + } + }); + + Object.defineProperty(nested, '$__isNested', { + enumerable: false, + configurable: true, + writable: false, + value: true + }); + + Object.defineProperty(nested, '$isEmpty', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return Object.keys(this.get(path, null, _isEmptyOptions) || {}).length === 0; + } + }); + + Object.defineProperty(nested, '$__parent', { + enumerable: false, + configurable: true, + writable: false, + value: this + }); + + compile(subprops, nested, path, options); + this.$__.getters[path] = nested; + } + + return this.$__.getters[path]; + }, + set: function(v) { + if (v?.$__isNested) { + // Convert top-level to POJO, but leave subdocs hydrated so `$set` + // can handle them. See gh-9293. + v = v.$__get(); + } else if (v instanceof Document && !v.$__isNested) { + v = v.$toObject(internalToObjectOptions); + } + const doc = this.$__[scopeSymbol] || this; + doc.$set(path, v); + } + }); + } else { + Object.defineProperty(prototype, prop, { + enumerable: true, + configurable: true, + get: function() { + return this[getSymbol].call( + this.$__[scopeSymbol] || this, + path, + null, + useGetOptions + ); + }, + set: function(v) { + this.$set.call(this.$__[scopeSymbol] || this, path, v); + } + }); + } +} + +// gets descriptors for all properties of `object` +// makes all properties non-enumerable to match previous behavior to #2211 +function getOwnPropertyDescriptors(object) { + const result = {}; + + Object.getOwnPropertyNames(object).forEach(function(key) { + const skip = [ + 'isNew', + '$__', + '$errors', + 'errors', + '_doc', + '$locals', + '$op', + '__parentArray', + '__index', + '$isDocumentArrayElement' + ].indexOf(key) === -1; + if (skip) { + return; + } + + result[key] = Object.getOwnPropertyDescriptor(object, key); + result[key].enumerable = false; + }); + + return result; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js new file mode 100644 index 00000000..346a51b5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js @@ -0,0 +1,38 @@ +'use strict'; + +/** + * Find the deepest subdocument along a given path to ensure setter functions run + * with the correct subdocument as `this`. If no subdocuments, returns the top-level + * document. + * + * @param {Document} doc + * @param {string[]} parts + * @param {Schema} schema + * @returns {Document} + */ + +module.exports = function getDeepestSubdocumentForPath(doc, parts, schema) { + let curPath = parts[0]; + let curSchema = schema; + let subdoc = doc; + for (let i = 0; i < parts.length - 1; ++i) { + const curSchemaType = curSchema.path(curPath); + if (curSchemaType?.schema) { + let newSubdoc = subdoc.get(curPath); + curSchema = curSchemaType.schema; + curPath = parts[i + 1]; + if (Array.isArray(newSubdoc) && !isNaN(curPath)) { + newSubdoc = newSubdoc[curPath]; + curPath = ''; + } + if (newSubdoc == null) { + break; + } + subdoc = newSubdoc; + } else { + curPath += curPath.length ? '.' + parts[i + 1] : parts[i + 1]; + } + } + + return subdoc; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js new file mode 100644 index 00000000..a398cf92 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js @@ -0,0 +1,53 @@ +'use strict'; + +const get = require('../get'); +const getSchemaDiscriminatorByValue = require('../discriminator/getSchemaDiscriminatorByValue'); + +/** + * Like `schema.path()`, except with a document, because impossible to + * determine path type without knowing the embedded discriminator key. + * + * @param {Document} doc + * @param {string|string[]} path + * @param {object} [options] + * @api private + */ + +module.exports = function getEmbeddedDiscriminatorPath(doc, path, options) { + options = options || {}; + const typeOnly = options.typeOnly; + const parts = Array.isArray(path) ? + path : + (path.indexOf('.') === -1 ? [path] : path.split('.')); + let schemaType = null; + let type = 'adhocOrUndefined'; + + const schema = getSchemaDiscriminatorByValue(doc.schema, doc.get(doc.schema.options.discriminatorKey)) || doc.schema; + + for (let i = 0; i < parts.length; ++i) { + const subpath = parts.slice(0, i + 1).join('.'); + schemaType = schema.path(subpath); + if (schemaType == null) { + type = 'adhocOrUndefined'; + continue; + } + if (schemaType.instance === 'Mixed') { + return typeOnly ? 'real' : schemaType; + } + type = schema.pathType(subpath); + if ((schemaType.$isSingleNested || schemaType.$isMongooseDocumentArrayElement) && + schemaType.schema.discriminators != null) { + const discriminators = schemaType.schema.discriminators; + const discriminatorKey = doc.get(subpath + '.' + + get(schemaType, 'schema.options.discriminatorKey')); + if (discriminatorKey == null || discriminators[discriminatorKey] == null) { + continue; + } + const rest = parts.slice(i + 1).join('.'); + return getEmbeddedDiscriminatorPath(doc.get(subpath), rest, options); + } + } + + // Are we getting the whole schema or just the type, 'real', 'nested', etc. + return typeOnly ? type : schemaType; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js new file mode 100644 index 00000000..5f715171 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js @@ -0,0 +1,35 @@ +'use strict'; + +const utils = require('../../utils'); + +const keysToSkip = new Set(['__index', '__parentArray', '_doc']); + +/** + * Using spread operator on a Mongoose document gives you a + * POJO that has a tendency to cause infinite recursion. So + * we use this function on `set()` to prevent that. + */ + +module.exports = function handleSpreadDoc(v, includeExtraKeys) { + if (utils.isPOJO(v) && v.$__ != null && v._doc != null) { + if (includeExtraKeys) { + const extraKeys = {}; + for (const key of Object.keys(v)) { + if (typeof key === 'symbol') { + continue; + } + if (key[0] === '$') { + continue; + } + if (keysToSkip.has(key)) { + continue; + } + extraKeys[key] = v[key]; + } + return { ...v._doc, ...extraKeys }; + } + return v._doc; + } + + return v; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/isInPathsToSave.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/isInPathsToSave.js new file mode 100644 index 00000000..3d8e0d6e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/document/isInPathsToSave.js @@ -0,0 +1,24 @@ +'use strict'; + +/** + * Returns true if `path` is included by the `pathsToSave` filter. + * Matches exact paths and child paths (e.g. 'metadata.views' is included by 'metadata'). + * + * @param {string} path + * @param {Set} pathsToSaveSet - pre-built Set of pathsToSave for O(1) exact lookup + * @param {string[]} pathsToSave - original array, used for prefix matching + * @returns {boolean} + */ +module.exports = function isInPathsToSave(path, pathsToSaveSet, pathsToSave) { + if (pathsToSaveSet.has(path)) { + return true; + } + + for (const pathToSave of pathsToSave) { + if (path.slice(0, pathToSave.length) === pathToSave && path.charAt(pathToSave.length) === '.') { + return true; + } + } + + return false; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/each.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/each.js new file mode 100644 index 00000000..9ce5cc62 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/each.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function each(arr, cb, done) { + if (arr.length === 0) { + return done(); + } + + let remaining = arr.length; + let err = null; + for (const v of arr) { + cb(v, function(_err) { + if (err != null) { + return; + } + if (_err != null) { + err = _err; + return done(err); + } + + if (--remaining <= 0) { + return done(); + } + }); + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/error/combinePathErrors.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/error/combinePathErrors.js new file mode 100644 index 00000000..841dbc0a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/error/combinePathErrors.js @@ -0,0 +1,22 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function combinePathErrors(err) { + const keys = Object.keys(err.errors || {}); + const len = keys.length; + const msgs = []; + let key; + + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (err === err.errors[key]) { + continue; + } + msgs.push(key + ': ' + err.errors[key].message); + } + + return msgs.join(', '); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/firstKey.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/firstKey.js new file mode 100644 index 00000000..4495d2a8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/firstKey.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function firstKey(obj) { + if (obj == null) { + return null; + } + return Object.keys(obj)[0]; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/get.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/get.js new file mode 100644 index 00000000..2a914419 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/get.js @@ -0,0 +1,65 @@ +'use strict'; + +/** + * Simplified lodash.get to work around the annoying null quirk. See: + * https://github.com/lodash/lodash/issues/3659 + * @api private + */ + +module.exports = function get(obj, path, def) { + let parts; + let isPathArray = false; + if (typeof path === 'string') { + if (path.indexOf('.') === -1) { + const _v = getProperty(obj, path); + if (_v == null) { + return def; + } + return _v; + } + + parts = path.split('.'); + } else { + isPathArray = true; + parts = path; + + if (parts.length === 1) { + const _v = getProperty(obj, parts[0]); + if (_v == null) { + return def; + } + return _v; + } + } + let rest = path; + let cur = obj; + for (const part of parts) { + if (cur == null) { + return def; + } + + // `lib/cast.js` depends on being able to get dotted paths in updates, + // like `{ $set: { 'a.b': 42 } }` + if (!isPathArray && cur[rest] != null) { + return cur[rest]; + } + + cur = getProperty(cur, part); + + if (!isPathArray) { + rest = rest.substring(part.length + 1); + } + } + + return cur == null ? def : cur; +}; + +function getProperty(obj, prop) { + if (obj == null) { + return obj; + } + if (obj instanceof Map) { + return obj.get(prop); + } + return obj[prop]; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getConstructorName.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getConstructorName.js new file mode 100644 index 00000000..5ebe7bb0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getConstructorName.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * If `val` is an object, returns constructor name, if possible. Otherwise returns undefined. + * @api private + */ + +module.exports = function getConstructorName(val) { + if (val == null) { + return void 0; + } + if (typeof val.constructor !== 'function') { + return void 0; + } + return val.constructor.name; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js new file mode 100644 index 00000000..52ed5bfe --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js @@ -0,0 +1,18 @@ +'use strict'; + +function getDefaultBulkwriteResult() { + return { + ok: 1, + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [], + writeErrors: [], + insertedIds: [], + writeConcernErrors: [] + }; +} + +module.exports = getDefaultBulkwriteResult; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getFunctionName.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getFunctionName.js new file mode 100644 index 00000000..d1f3a5a6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/getFunctionName.js @@ -0,0 +1,10 @@ +'use strict'; + +const functionNameRE = /^function\s*([^\s(]+)/; + +module.exports = function(fn) { + return ( + fn.name || + (fn.toString().trim().match(functionNameRE) || [])[1] + ); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/immediate.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/immediate.js new file mode 100644 index 00000000..73085f7d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/immediate.js @@ -0,0 +1,16 @@ +/*! + * Centralize this so we can more easily work around issues with people + * stubbing out `process.nextTick()` in tests using sinon: + * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time + * See gh-6074 + */ + +'use strict'; + +const nextTick = typeof process !== 'undefined' && typeof process.nextTick === 'function' ? + process.nextTick.bind(process) : + cb => setTimeout(cb, 0); // Fallback for browser build + +module.exports = function immediate(cb) { + return nextTick(cb); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js new file mode 100644 index 00000000..464210e1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js @@ -0,0 +1,13 @@ +'use strict'; + +const isTextIndex = require('./isTextIndex'); + +module.exports = function applySchemaCollation(indexKeys, indexOptions, schemaOptions) { + if (isTextIndex(indexKeys)) { + return; + } + + if (Object.hasOwn(schemaOptions, 'collation') && !Object.hasOwn(indexOptions, 'collation')) { + indexOptions.collation = schemaOptions.collation; + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js new file mode 100644 index 00000000..b18cf566 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function decorateDiscriminatorIndexOptions(schema, indexOptions) { + // If the model is a discriminator and has an index, add a + // partialFilterExpression by default so the index will only apply + // to that discriminator. + const discriminatorName = schema.discriminatorMapping?.value; + if (discriminatorName && !('sparse' in indexOptions)) { + const discriminatorKey = schema.options.discriminatorKey; + indexOptions.partialFilterExpression = indexOptions.partialFilterExpression || {}; + indexOptions.partialFilterExpression[discriminatorKey] = discriminatorName; + } + return indexOptions; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js new file mode 100644 index 00000000..e68cb8d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js @@ -0,0 +1,63 @@ +'use strict'; + +const hasDollarKeys = require('../query/hasDollarKeys'); + +function getRelatedSchemaIndexes(model, schemaIndexes) { + return getRelatedIndexes({ + baseModelName: model.baseModelName, + discriminatorMapping: model.schema.discriminatorMapping, + indexes: schemaIndexes, + indexesType: 'schema' + }); +} + +function getRelatedDBIndexes(model, dbIndexes) { + return getRelatedIndexes({ + baseModelName: model.baseModelName, + discriminatorMapping: model.schema.discriminatorMapping, + indexes: dbIndexes, + indexesType: 'db' + }); +} + +module.exports = { + getRelatedSchemaIndexes, + getRelatedDBIndexes +}; + +function getRelatedIndexes({ + baseModelName, + discriminatorMapping, + indexes, + indexesType +}) { + const discriminatorKey = discriminatorMapping?.key; + const discriminatorValue = discriminatorMapping?.value; + + if (!discriminatorKey) { + return indexes; + } + + const isChildDiscriminatorModel = Boolean(baseModelName); + if (isChildDiscriminatorModel) { + return indexes.filter(index => { + const partialFilterExpression = getPartialFilterExpression(index, indexesType); + return partialFilterExpression && partialFilterExpression[discriminatorKey] === discriminatorValue; + }); + } + + return indexes.filter(index => { + const partialFilterExpression = getPartialFilterExpression(index, indexesType); + return !partialFilterExpression + || !partialFilterExpression[discriminatorKey] + || (hasDollarKeys(partialFilterExpression[discriminatorKey]) && !('$eq' in partialFilterExpression[discriminatorKey])); + }); +} + +function getPartialFilterExpression(index, indexesType) { + if (indexesType === 'schema') { + const options = index[1]; + return options?.partialFilterExpression; + } + return index.partialFilterExpression; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js new file mode 100644 index 00000000..8123dfc7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js @@ -0,0 +1,18 @@ +'use strict'; + +const get = require('../get'); + +module.exports = function isDefaultIdIndex(index) { + if (Array.isArray(index)) { + // Mongoose syntax + const keys = Object.keys(index[0]); + return keys.length === 1 && keys[0] === '_id' && index[0]._id !== 'hashed'; + } + + if (typeof index !== 'object') { + return false; + } + + const key = get(index, 'key', {}); + return Object.keys(key).length === 1 && Object.hasOwn(key, '_id'); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js new file mode 100644 index 00000000..22d42123 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js @@ -0,0 +1,95 @@ +'use strict'; + +const get = require('../get'); +const utils = require('../../utils'); +/** + * Given a Mongoose index definition (key + options objects) and a MongoDB server + * index definition, determine if the two indexes are equal. + * + * @param {object} schemaIndexKeysObject the Mongoose index spec + * @param {object} options the Mongoose index definition's options + * @param {object} dbIndex the index in MongoDB as returned by `listIndexes()` + * @api private + */ + +module.exports = function isIndexEqual(schemaIndexKeysObject, options, dbIndex) { + // Special case: text indexes have a special format in the db. For example, + // `{ name: 'text' }` becomes: + // { + // v: 2, + // key: { _fts: 'text', _ftsx: 1 }, + // name: 'name_text', + // ns: 'test.tests', + // weights: { name: 1 }, + // default_language: 'english', + // language_override: 'language', + // textIndexVersion: 3 + // } + if (dbIndex.textIndexVersion != null) { + delete dbIndex.key._fts; + delete dbIndex.key._ftsx; + const weights = { ...dbIndex.weights, ...dbIndex.key }; + if (Object.keys(weights).length !== Object.keys(schemaIndexKeysObject).length) { + return false; + } + for (const prop of Object.keys(weights)) { + if (!(prop in schemaIndexKeysObject)) { + return false; + } + const weight = weights[prop]; + if (weight !== get(options, 'weights.' + prop) && !(weight === 1 && get(options, 'weights.' + prop) == null)) { + return false; + } + } + + if (options['default_language'] !== dbIndex['default_language']) { + return dbIndex['default_language'] === 'english' && options['default_language'] == null; + } + + return true; + } + + const optionKeys = [ + 'unique', + 'partialFilterExpression', + 'sparse', + 'expireAfterSeconds', + 'collation' + ]; + for (const key of optionKeys) { + if (!(key in options) && !(key in dbIndex)) { + continue; + } + if (key === 'collation') { + if (options[key] == null || dbIndex[key] == null) { + return options[key] == null && dbIndex[key] == null; + } + const definedKeys = Object.keys(options.collation); + const schemaCollation = options.collation; + const dbCollation = dbIndex.collation; + for (const opt of definedKeys) { + if (get(schemaCollation, opt) !== get(dbCollation, opt)) { + return false; + } + } + } else if (!utils.deepEqual(options[key], dbIndex[key])) { + return false; + } + } + + const schemaIndexKeys = Object.keys(schemaIndexKeysObject); + const dbIndexKeys = Object.keys(dbIndex.key); + if (schemaIndexKeys.length !== dbIndexKeys.length) { + return false; + } + for (let i = 0; i < schemaIndexKeys.length; ++i) { + if (schemaIndexKeys[i] !== dbIndexKeys[i]) { + return false; + } + if (!utils.deepEqual(schemaIndexKeysObject[schemaIndexKeys[i]], dbIndex.key[dbIndexKeys[i]])) { + return false; + } + } + + return true; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js new file mode 100644 index 00000000..32b2a190 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js @@ -0,0 +1,32 @@ +'use strict'; + +/** + * Compares two index specifications to determine if they are equal. + * + * #### Example: + * isIndexSpecEqual({ a: 1, b: 1 }, { a: 1, b: 1 }); // true + * isIndexSpecEqual({ a: 1, b: 1 }, { b: 1, a: 1 }); // false + * isIndexSpecEqual({ a: 1, b: -1 }, { a: 1, b: 1 }); // false + * + * @param {object} spec1 The first index specification to compare. + * @param {object} spec2 The second index specification to compare. + * @returns {boolean} Returns true if the index specifications are equal, otherwise returns false. + */ + +module.exports = function isIndexSpecEqual(spec1, spec2) { + const spec1Keys = Object.keys(spec1); + const spec2Keys = Object.keys(spec2); + + if (spec1Keys.length !== spec2Keys.length) { + return false; + } + + for (let i = 0; i < spec1Keys.length; i++) { + const key = spec1Keys[i]; + if (key !== spec2Keys[i] || spec1[key] !== spec2[key]) { + return false; + } + } + + return true; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js new file mode 100644 index 00000000..fdd98d45 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * Returns `true` if the given index options have a `text` option. + */ + +module.exports = function isTextIndex(indexKeys) { + let isTextIndex = false; + for (const key of Object.keys(indexKeys)) { + if (indexKeys[key] === 'text') { + isTextIndex = true; + } + } + + return isTextIndex; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js new file mode 100644 index 00000000..0a4512b9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * Returns `true` if the given index matches the schema's `timestamps` options + */ + +module.exports = function isTimeseriesIndex(dbIndex, schemaOptions) { + if (schemaOptions.timeseries == null) { + return false; + } + const { timeField, metaField } = schemaOptions.timeseries; + if (typeof timeField !== 'string' || typeof metaField !== 'string') { + return false; + } + return Object.keys(dbIndex.key).length === 2 && dbIndex.key[timeField] === 1 && dbIndex.key[metaField] === 1; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isAsyncFunction.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isAsyncFunction.js new file mode 100644 index 00000000..679590e5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isAsyncFunction.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function isAsyncFunction(v) { + return ( + typeof v === 'function' && + v.constructor && + v.constructor.name === 'AsyncFunction' + ); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isBsonType.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isBsonType.js new file mode 100644 index 00000000..d3a71f01 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isBsonType.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Determines if `obj` has the given BSON type. + * @api private + */ + +function isBsonType(obj, typename) { + return ( + obj != null && + obj._bsontype === typename + ); +} + +module.exports = isBsonType; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isMongooseObject.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isMongooseObject.js new file mode 100644 index 00000000..85466a10 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isMongooseObject.js @@ -0,0 +1,22 @@ +'use strict'; + +const isMongooseArray = require('../types/array/isMongooseArray').isMongooseArray; +/** + * Returns if `v` is a mongoose object that has a `toObject()` method we can use. + * + * This is for compatibility with libs like Date.js which do foolish things to Natives. + * + * @param {any} v + * @api private + */ + +module.exports = function(v) { + return ( + v != null && ( + isMongooseArray(v) || // Array or Document Array + v.$__ != null || // Document + v.isMongooseBuffer || // Buffer + v.$isMongooseMap // Map + ) + ); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isObject.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isObject.js new file mode 100644 index 00000000..9d887889 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isObject.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * Determines if `arg` is an object. + * + * @param {object|Array|string|Function|RegExp|any} arg + * @api private + * @return {boolean} + */ + +module.exports = function(arg) { + return ( + Buffer.isBuffer(arg) || + Object.prototype.toString.call(arg) === '[object Object]' + ); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPOJO.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPOJO.js new file mode 100644 index 00000000..2f1a00f0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPOJO.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function isPOJO(arg) { + if (arg == null || typeof arg !== 'object') { + return false; + } + const proto = Object.getPrototypeOf(arg); + // Prototype may be null if you used `Object.create(null)` + // Checking `proto`'s constructor is safe because `getPrototypeOf()` + // explicitly crosses the boundary from object data to object metadata + return !proto || proto.constructor.name === 'Object'; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPromise.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPromise.js new file mode 100644 index 00000000..0da827e2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isPromise.js @@ -0,0 +1,6 @@ +'use strict'; +function isPromise(val) { + return !!val && (typeof val === 'object' || typeof val === 'function') && typeof val.then === 'function'; +} + +module.exports = isPromise; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isSimpleValidator.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isSimpleValidator.js new file mode 100644 index 00000000..07aadcd6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/isSimpleValidator.js @@ -0,0 +1,22 @@ +'use strict'; + +/** + * Determines if `arg` is a flat object. + * + * @param {object|Array|string|Function|RegExp|any} arg + * @api private + * @return {boolean} + */ + +module.exports = function isSimpleValidator(obj) { + const keys = Object.keys(obj); + let result = true; + for (let i = 0, len = keys.length; i < len; ++i) { + if (typeof obj[keys[i]] === 'object' && obj[keys[i]] !== null) { + result = false; + break; + } + } + + return result; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/minimize.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/minimize.js new file mode 100644 index 00000000..6bee18d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/minimize.js @@ -0,0 +1,41 @@ +'use strict'; + +const { isPOJO } = require('../utils'); + +module.exports = minimize; + +/** + * Minimizes an object, removing undefined values and empty objects + * + * @param {object} object to minimize + * @return {object|undefined} + * @api private + */ + +function minimize(obj) { + const keys = Object.keys(obj); + let i = keys.length; + let hasKeys; + let key; + let val; + + while (i--) { + key = keys[i]; + val = obj[key]; + + if (isPOJO(val)) { + obj[key] = minimize(val); + } + + if (undefined === obj[key]) { + delete obj[key]; + continue; + } + + hasKeys = true; + } + + return hasKeys + ? obj + : undefined; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js new file mode 100644 index 00000000..0570c69d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js @@ -0,0 +1,52 @@ +'use strict'; + +module.exports = function applyDefaultsToPOJO(doc, schema) { + const paths = Object.keys(schema.paths); + const plen = paths.length; + + for (let i = 0; i < plen; ++i) { + let curPath = ''; + const p = paths[i]; + + const type = schema.paths[p]; + const path = type.splitPath(); + const len = path.length; + let doc_ = doc; + for (let j = 0; j < len; ++j) { + if (doc_ == null) { + break; + } + + const piece = path[j]; + curPath += (!curPath.length ? '' : '.') + piece; + + if (j === len - 1) { + if (typeof doc_[piece] !== 'undefined') { + if (type.$isSingleNested) { + applyDefaultsToPOJO(doc_[piece], type.schema); + } else if (type.$isMongooseDocumentArray && Array.isArray(doc_[piece])) { + doc_[piece].forEach(el => applyDefaultsToPOJO(el, type.schema)); + } + + break; + } + + const def = type.getDefault(doc, false, { skipCast: true }); + if (typeof def !== 'undefined') { + doc_[piece] = def; + + if (type.$isSingleNested) { + applyDefaultsToPOJO(def, type.schema); + } else if (type.$isMongooseDocumentArray && Array.isArray(def)) { + def.forEach(el => applyDefaultsToPOJO(el, type.schema)); + } + } + } else { + if (doc_[piece] == null) { + doc_[piece] = {}; + } + doc_ = doc_[piece]; + } + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyHooks.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyHooks.js new file mode 100644 index 00000000..9755de56 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyHooks.js @@ -0,0 +1,158 @@ +'use strict'; + +const { buildMiddlewareFilter, middlewareFiltersFromLastArg } = require('../buildMiddlewareFilter'); + +/*! + * ignore + */ + +module.exports = applyHooks; + +/*! + * ignore + */ + +applyHooks.middlewareFunctions = [ + 'deleteOne', + 'remove', + 'save', + 'updateOne', + 'validate', + 'init' +]; + +/*! + * ignore + */ + +const alreadyHookedFunctions = new Set(applyHooks.middlewareFunctions.flatMap(fn => ([fn, `$__${fn}`]))); + +/** + * Register hooks for this model + * + * @param {Model} model + * @param {Schema} schema + * @param {object} options + * @api private + */ + +function applyHooks(model, schema, options) { + options = options || {}; + + const kareemOptions = { + useErrorHandlers: true, + numCallbackParams: 1, + nullResultByDefault: true, + contextParameter: true + }; + const objToDecorate = options.decorateDoc ? model : model.prototype; + model.$appliedHooks = true; + for (const key of Object.keys(schema.paths)) { + let type = schema.paths[key]; + let childModel = null; + + const result = findChildModel(type); + if (result) { + childModel = result.childModel; + type = result.type; + } else { + continue; + } + + if (childModel.$appliedHooks) { + continue; + } + + applyHooks(childModel, type.schema, { + ...options, + decorateDoc: false, + isChildSchema: true + }); + if (childModel.discriminators != null) { + const keys = Object.keys(childModel.discriminators); + for (const key of keys) { + applyHooks(childModel.discriminators[key], + childModel.discriminators[key].schema, options); + } + } + } + + // Built-in hooks rely on hooking internal functions in order to support + // promises and make it so that `doc.save.toString()` provides meaningful + // information. + + const middleware = schema._getDocumentMiddleware(); + + model._middleware = middleware; + + objToDecorate.$__init = middleware. + createWrapperSync('init', objToDecorate.$__init, null, { + ...kareemOptions, + getOptions: (args) => { + const opts = args[1]; + return { + pre: { filter: buildMiddlewareFilter(opts, 'pre') }, + post: { filter: buildMiddlewareFilter(opts, 'post') } + }; + } + }); + + // Support hooks for custom methods + const customMethods = Object.keys(schema.methods); + const customMethodOptions = Object.assign({}, kareemOptions, { + // Only use `checkForPromise` for custom methods, because mongoose + // query thunks are not as consistent as I would like about returning + // a nullish value rather than the query. If a query thunk returns + // a query, `checkForPromise` causes infinite recursion + checkForPromise: true + }); + for (const method of customMethods) { + if (alreadyHookedFunctions.has(method)) { + continue; + } + if (!middleware.hasHooks(method)) { + // Don't wrap if there are no hooks for the custom method to avoid + // surprises. Also, `createWrapper()` enforces consistent async, + // so wrapping a sync method would break it. + continue; + } + const originalMethod = objToDecorate[method]; + objToDecorate[`$__${method}`] = objToDecorate[method]; + // Only read the `middleware` option from the method's last argument if + // the method opts in via `supportsMiddlewareOption`. Custom methods have + // arbitrary signatures, so the last argument may be an object with an + // unrelated `middleware` property. + const methodOptions = originalMethod.supportsMiddlewareOption === true ? + { ...customMethodOptions, getOptions: middlewareFiltersFromLastArg } : + customMethodOptions; + objToDecorate[method] = middleware. + createWrapper(method, originalMethod, null, methodOptions); + } +} + +/** + * Check if there is an embedded schematype in the given schematype. Handles drilling down into primitive + * arrays and maps in case of array of array of subdocs or map of subdocs. + * + * @param {SchemaType} curType + * @returns {{ childModel: Model | typeof Subdocument, curType: SchemaType } | null} + */ + +function findChildModel(curType) { + if (curType.$isSingleNested || curType.$isMongooseDocumentArray) { + return { childModel: curType.Constructor, type: curType }; + } + if (curType.instance === 'Array') { + const embedded = curType.getEmbeddedSchemaType(); + if (embedded) { + return findChildModel(embedded); + } + } + if (curType.instance === 'Map') { + const mapType = curType.getEmbeddedSchemaType(); + if (mapType) { + return findChildModel(mapType); + } + } + return null; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyMethods.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyMethods.js new file mode 100644 index 00000000..748315ae --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyMethods.js @@ -0,0 +1,70 @@ +'use strict'; + +const get = require('../get'); +const utils = require('../../utils'); + +/** + * Register methods for this model + * + * @param {Model} model + * @param {Schema} schema + * @api private + */ + +module.exports = function applyMethods(model, schema) { + const Model = require('../../model'); + + function apply(method, schema) { + Object.defineProperty(model.prototype, method, { + get: function() { + const h = {}; + for (const k in schema.methods[method]) { + h[k] = schema.methods[method][k].bind(this); + } + return h; + }, + configurable: true + }); + } + for (const method of Object.keys(schema.methods)) { + const fn = schema.methods[method]; + if (Object.hasOwn(schema.tree, method)) { + throw new Error('You have a method and a property in your schema both ' + + 'named "' + method + '"'); + } + + // Avoid making custom methods if user sets a method to itself, e.g. + // `schema.method(save, Document.prototype.save)`. Can happen when + // calling `loadClass()` with a class that `extends Document`. See gh-12254 + if (typeof fn === 'function' && + Model.prototype[method] === fn) { + delete schema.methods[method]; + continue; + } + + if (schema.reserved[method] && + !get(schema, `methodOptions.${method}.suppressWarning`, false)) { + utils.warn(`mongoose: the method name "${method}" is used by mongoose ` + + 'internally, overwriting it may cause bugs. If you\'re sure you know ' + + 'what you\'re doing, you can suppress this error by using ' + + `\`schema.method('${method}', fn, { suppressWarning: true })\`.`); + } + if (typeof fn === 'function') { + model.prototype[method] = fn; + } else { + apply(method, schema); + } + } + + // Recursively call `applyMethods()` on child schemas + model.$appliedMethods = true; + for (const key of Object.keys(schema.paths)) { + const type = schema.paths[key]; + if (type.$isSingleNested && !type.Constructor.$appliedMethods) { + applyMethods(type.Constructor, type.schema); + } + if (type.$isMongooseDocumentArray && !type.Constructor.$appliedMethods) { + applyMethods(type.Constructor, type.schema); + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js new file mode 100644 index 00000000..e56bab27 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js @@ -0,0 +1,41 @@ +'use strict'; + +const { middlewareFiltersFromLastArg } = require('../buildMiddlewareFilter'); +const { queryMiddlewareFunctions, aggregateMiddlewareFunctions, modelMiddlewareFunctions, documentMiddlewareFunctions } = require('../../constants'); + +const middlewareFunctions = Array.from( + new Set([ + ...queryMiddlewareFunctions, + ...aggregateMiddlewareFunctions, + ...modelMiddlewareFunctions, + ...documentMiddlewareFunctions + ]) +); + +module.exports = function applyStaticHooks(model, hooks, statics) { + hooks = hooks.filter(hook => { + // If the custom static overwrites an existing middleware, don't apply + // middleware to it by default. This avoids a potential backwards breaking + // change with plugins like `mongoose-delete` that use statics to overwrite + // built-in Mongoose functions. + if (middlewareFunctions.indexOf(hook.name) !== -1) { + return !!hook.model; + } + return hook.model !== false; + }); + + for (const key of Object.keys(statics)) { + if (hooks.hasHooks(key)) { + const original = model[key]; + + // Only read the `middleware` option from the static's last argument if + // the static opts in via `supportsMiddlewareOption`. Custom statics have + // arbitrary signatures, so the last argument may be an object with an + // unrelated `middleware` property. + const wrapperOptions = original.supportsMiddlewareOption === true ? + { getOptions: middlewareFiltersFromLastArg } : + undefined; + model[key] = hooks.createWrapper(key, original, null, wrapperOptions); + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStatics.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStatics.js new file mode 100644 index 00000000..d94d91c7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/applyStatics.js @@ -0,0 +1,13 @@ +'use strict'; + +/** + * Register statics for this model + * @param {Model} model + * @param {Schema} schema + * @api private + */ +module.exports = function applyStatics(model, schema) { + for (const i in schema.statics) { + model[i] = schema.statics[i]; + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/castBulkWrite.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/castBulkWrite.js new file mode 100644 index 00000000..f415331a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/castBulkWrite.js @@ -0,0 +1,322 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); +const getDiscriminatorByValue = require('../../helpers/discriminator/getDiscriminatorByValue'); +const applyTimestampsToChildren = require('../update/applyTimestampsToChildren'); +const applyTimestampsToUpdate = require('../update/applyTimestampsToUpdate'); +const cast = require('../../cast'); +const castUpdate = require('../query/castUpdate'); +const clone = require('../clone'); +const decorateUpdateWithVersionKey = require('../update/decorateUpdateWithVersionKey'); +const { inspect } = require('util'); +const setDefaultsOnInsert = require('../setDefaultsOnInsert'); + +/** + * Given a model and a bulkWrite op, return a thunk that handles casting and + * validating the individual op. + * @param {Model} originalModel + * @param {object} op + * @param {object} [options] + * @api private + */ + +module.exports = function castBulkWrite(originalModel, op, options) { + let now; + const timestampOpts = originalModel.schema.get('timestamps'); + if (typeof timestampOpts?.currentTime === 'function') { + now = timestampOpts.currentTime(); + } else { + now = originalModel.base.now(); + } + + if (op['insertOne']) { + return callback => module.exports.castInsertOne(originalModel, op['insertOne'], options).then(() => callback(null), err => callback(err)); + } else if (op['updateOne']) { + return (callback) => { + try { + module.exports.castUpdateOne(originalModel, op['updateOne'], options, now); + callback(null); + } catch (err) { + callback(err); + } + }; + } else if (op['updateMany']) { + return (callback) => { + try { + module.exports.castUpdateMany(originalModel, op['updateMany'], options, now); + callback(null); + } catch (err) { + callback(err); + } + }; + } else if (op['replaceOne']) { + return (callback) => { + module.exports.castReplaceOne(originalModel, op['replaceOne'], options).then(() => callback(null), err => callback(err)); + }; + } else if (op['deleteOne']) { + return (callback) => { + try { + module.exports.castDeleteOne(originalModel, op['deleteOne']); + callback(null); + } catch (err) { + callback(err); + } + }; + } else if (op['deleteMany']) { + return (callback) => { + try { + module.exports.castDeleteMany(originalModel, op['deleteMany']); + callback(null); + } catch (err) { + callback(err); + } + }; + } else { + return (callback) => { + const error = new MongooseError(`Invalid op passed to \`bulkWrite()\`: ${inspect(op)}`); + callback(error, null); + }; + } +}; + +module.exports.castInsertOne = async function castInsertOne(originalModel, insertOne, options) { + const model = decideModelByObject(originalModel, insertOne['document']); + + const doc = new model(insertOne['document']); + if (model.schema.options.timestamps && getTimestampsOpt(insertOne, options)) { + doc.initializeTimestamps(); + } + if (options.session != null) { + doc.$session(options.session); + } + const versionKey = model?.schema?.options?.versionKey; + if (versionKey && doc[versionKey] == null) { + doc[versionKey] = 0; + } + insertOne['document'] = doc; + + if (options.skipValidation || insertOne.skipValidation) { + return insertOne; + } + + await insertOne['document'].$validate(); + return insertOne; +}; + +module.exports.castUpdateOne = function castUpdateOne(originalModel, updateOne, options, now) { + if (!updateOne['filter']) { + throw new Error('Must provide a filter object.'); + } + if (!updateOne['update']) { + throw new Error('Must provide an update object.'); + } + + const model = decideModelByObject(originalModel, updateOne['filter']); + const schema = model.schema; + const strict = options.strict ?? model.schema.options.strict; + + const update = clone(updateOne['update']); + + _addDiscriminatorToObject(schema, updateOne['filter']); + + const doInitTimestamps = getTimestampsOpt(updateOne, options); + + if (model.schema.$timestamps != null && doInitTimestamps) { + const createdAt = model.schema.$timestamps.createdAt; + const updatedAt = model.schema.$timestamps.updatedAt; + applyTimestampsToUpdate(now, createdAt, updatedAt, update, { + timestamps: updateOne.timestamps, + overwriteImmutable: updateOne.overwriteImmutable + }, updateOne.upsert); + } + + if (doInitTimestamps) { + applyTimestampsToChildren(now, update, model.schema); + } + + const globalSetDefaultsOnInsert = originalModel.base.options.setDefaultsOnInsert; + const shouldSetDefaultsOnInsert = updateOne.setDefaultsOnInsert ?? globalSetDefaultsOnInsert; + if (shouldSetDefaultsOnInsert !== false) { + setDefaultsOnInsert(updateOne['filter'], model.schema, update, { + setDefaultsOnInsert: true, + upsert: updateOne.upsert + }); + } + + decorateUpdateWithVersionKey( + update, + updateOne, + model.schema.options.versionKey + ); + + updateOne['filter'] = cast(model.schema, updateOne['filter'], { + strict: strict, + upsert: updateOne.upsert + }); + updateOne['update'] = castUpdate(model.schema, update, { + strict: strict, + upsert: updateOne.upsert, + arrayFilters: updateOne.arrayFilters, + overwriteDiscriminatorKey: updateOne.overwriteDiscriminatorKey, + overwriteImmutable: updateOne.overwriteImmutable + }, model, updateOne['filter']); + + return updateOne; +}; + +module.exports.castUpdateMany = function castUpdateMany(originalModel, updateMany, options, now) { + if (!updateMany['filter']) { + throw new Error('Must provide a filter object.'); + } + if (!updateMany['update']) { + throw new Error('Must provide an update object.'); + } + + const model = decideModelByObject(originalModel, updateMany['filter']); + const schema = model.schema; + const strict = options.strict ?? model.schema.options.strict; + + const globalSetDefaultsOnInsert = originalModel.base.options.setDefaultsOnInsert; + const shouldSetDefaultsOnInsert = updateMany.setDefaultsOnInsert ?? globalSetDefaultsOnInsert; + + if (shouldSetDefaultsOnInsert !== false) { + setDefaultsOnInsert(updateMany['filter'], model.schema, updateMany['update'], { + setDefaultsOnInsert: true, + upsert: updateMany.upsert + }); + } + + const doInitTimestamps = getTimestampsOpt(updateMany, options); + + if (model.schema.$timestamps != null && doInitTimestamps) { + const createdAt = model.schema.$timestamps.createdAt; + const updatedAt = model.schema.$timestamps.updatedAt; + applyTimestampsToUpdate(now, createdAt, updatedAt, updateMany['update'], { + timestamps: updateMany.timestamps, + overwriteImmutable: updateMany.overwriteImmutable + }, updateMany.upsert); + } + if (doInitTimestamps) { + applyTimestampsToChildren(now, updateMany['update'], model.schema); + } + + _addDiscriminatorToObject(schema, updateMany['filter']); + + decorateUpdateWithVersionKey( + updateMany['update'], + updateMany, + model.schema.options.versionKey + ); + + updateMany['filter'] = cast(model.schema, updateMany['filter'], { + strict: strict, + upsert: updateMany.upsert + }); + + updateMany['update'] = castUpdate(model.schema, updateMany['update'], { + strict: strict, + upsert: updateMany.upsert, + arrayFilters: updateMany.arrayFilters, + overwriteDiscriminatorKey: updateMany.overwriteDiscriminatorKey, + overwriteImmutable: updateMany.overwriteImmutable + }, model, updateMany['filter']); +}; + +module.exports.castReplaceOne = async function castReplaceOne(originalModel, replaceOne, options) { + const model = decideModelByObject(originalModel, replaceOne['filter']); + const schema = model.schema; + const strict = options.strict ?? model.schema.options.strict; + + _addDiscriminatorToObject(schema, replaceOne['filter']); + replaceOne['filter'] = cast(model.schema, replaceOne['filter'], { + strict: strict, + upsert: replaceOne.upsert + }); + + // set `skipId`, otherwise we get "_id field cannot be changed" + const doc = new model(replaceOne['replacement'], strict, { skipId: true }); + if (model.schema.options.timestamps && getTimestampsOpt(replaceOne, options)) { + doc.initializeTimestamps(); + } + if (options.session != null) { + doc.$session(options.session); + } + const versionKey = model?.schema?.options?.versionKey; + if (versionKey && doc[versionKey] == null) { + doc[versionKey] = 0; + } + replaceOne['replacement'] = doc; + + if (options.skipValidation || replaceOne.skipValidation) { + replaceOne['replacement'] = replaceOne['replacement'].toBSON(); + return; + } + + await replaceOne['replacement'].$validate(); + replaceOne['replacement'] = replaceOne['replacement'].toBSON(); +}; + +module.exports.castDeleteOne = function castDeleteOne(originalModel, deleteOne) { + const model = decideModelByObject(originalModel, deleteOne['filter']); + const schema = model.schema; + + _addDiscriminatorToObject(schema, deleteOne['filter']); + + deleteOne['filter'] = cast(model.schema, deleteOne['filter']); +}; + +module.exports.castDeleteMany = function castDeleteMany(originalModel, deleteMany) { + const model = decideModelByObject(originalModel, deleteMany['filter']); + const schema = model.schema; + + _addDiscriminatorToObject(schema, deleteMany['filter']); + + deleteMany['filter'] = cast(model.schema, deleteMany['filter']); +}; + +module.exports.cast = { + insertOne: module.exports.castInsertOne, + updateOne: module.exports.castUpdateOne, + updateMany: module.exports.castUpdateMany, + replaceOne: module.exports.castReplaceOne, + deleteOne: module.exports.castDeleteOne, + deleteMany: module.exports.castDeleteMany +}; + +function _addDiscriminatorToObject(schema, obj) { + if (schema == null) { + return; + } + if (schema.discriminatorMapping && !schema.discriminatorMapping.isRoot) { + obj[schema.discriminatorMapping.key] = schema.discriminatorMapping.value; + } +} + +/** + * gets discriminator model if discriminator key is present in object + * @api private + */ + +function decideModelByObject(model, object) { + const discriminatorKey = model.schema.options.discriminatorKey; + if (object != null && Object.hasOwn(object, discriminatorKey)) { + model = getDiscriminatorByValue(model.discriminators, object[discriminatorKey]) || model; + } + return model; +} + +/** + * gets timestamps option for a given operation. If the option is set within an individual operation, use it. Otherwise, use the global timestamps option configured in the `bulkWrite` options. Overall default is `true`. + * @api private + */ + +function getTimestampsOpt(opCommand, options) { + const opLevelOpt = opCommand.timestamps; + const bulkLevelOpt = options.timestamps; + if (opLevelOpt != null) { + return opLevelOpt; + } else if (bulkLevelOpt != null) { + return bulkLevelOpt; + } + return true; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js new file mode 100644 index 00000000..6cc92635 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function decorateBulkWriteResult(resultOrError, validationErrors, results) { + resultOrError.mongoose = resultOrError.mongoose || {}; + resultOrError.mongoose.validationErrors = validationErrors; + resultOrError.mongoose.results = results; + return resultOrError; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/discriminator.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/discriminator.js new file mode 100644 index 00000000..7faea758 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/discriminator.js @@ -0,0 +1,265 @@ +'use strict'; + +const Mixed = require('../../schema/mixed'); +const applyBuiltinPlugins = require('../schema/applyBuiltinPlugins'); +const clone = require('../clone'); +const defineKey = require('../document/compile').defineKey; +const get = require('../get'); +const utils = require('../../utils'); +const mergeDiscriminatorSchema = require('../../helpers/discriminator/mergeDiscriminatorSchema'); + +const CUSTOMIZABLE_DISCRIMINATOR_OPTIONS = { + toJSON: true, + toObject: true, + _id: true, + id: true, + virtuals: true, + methods: true, + statics: true +}; + +/** + * Validate fields declared on the child schema when either schema is configured for encryption. Specifically, this function ensures that: + * + * - any encrypted fields are declared on exactly one of the schemas (not both) + * - encrypted fields cannot be declared on either the parent or child schema, where the other schema declares the same field without encryption. + * + * @param {Schema} parentSchema + * @param {Schema} childSchema + */ +function validateDiscriminatorSchemasForEncryption(parentSchema, childSchema) { + if (parentSchema.encryptionType() == null && childSchema.encryptionType() == null) return; + + const allSharedNestedPaths = setIntersection( + allNestedPaths(parentSchema), + allNestedPaths(childSchema) + ); + + for (const path of allSharedNestedPaths) { + if (parentSchema._hasEncryptedField(path) && childSchema._hasEncryptedField(path)) { + throw new Error(`encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=${path}`); + } + + if (parentSchema._hasEncryptedField(path) || childSchema._hasEncryptedField(path)) { + throw new Error(`encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=${path}`); + } + } + + function allNestedPaths(schema) { + return [...Object.keys(schema.paths), ...Object.keys(schema.singleNestedPaths)]; + } + + /** + * @param {Iterable} i1 + * @param {Iterable} i2 + */ + function* setIntersection(i1, i2) { + const s1 = new Set(i1); + for (const item of i2) { + if (s1.has(item)) { + yield item; + } + } + } +} + +/*! + * ignore + */ + +module.exports = function discriminator(model, name, schema, tiedValue, applyPlugins, mergeHooks, overwriteExisting) { + if (!schema?.instanceOfSchema) { + throw new Error('You must pass a valid discriminator Schema'); + } + + mergeHooks = mergeHooks == null ? true : mergeHooks; + + if (model.schema.discriminatorMapping && + !model.schema.discriminatorMapping.isRoot) { + throw new Error('Discriminator "' + name + + '" can only be a discriminator of the root model'); + } + + if (applyPlugins) { + const applyPluginsToDiscriminators = get(model.base, + 'options.applyPluginsToDiscriminators', false) || !mergeHooks; + // Even if `applyPluginsToDiscriminators` isn't set, we should still apply + // global plugins to schemas embedded in the discriminator schema (gh-7370) + model.base._applyPlugins(schema, { + skipTopLevel: !applyPluginsToDiscriminators + }); + } else if (!mergeHooks) { + applyBuiltinPlugins(schema); + } + + const key = model.schema.options.discriminatorKey; + + const existingPath = model.schema.path(key); + if (existingPath != null) { + if (!utils.hasUserDefinedProperty(existingPath.options, 'select')) { + existingPath.options.select = true; + } + existingPath.options.$skipDiscriminatorCheck = true; + } else { + const baseSchemaAddition = {}; + baseSchemaAddition[key] = { + default: void 0, + select: true, + $skipDiscriminatorCheck: true + }; + baseSchemaAddition[key][model.schema.options.typeKey] = String; + model.schema.add(baseSchemaAddition); + defineKey({ + prop: key, + prototype: model.prototype, + options: model.schema.options + }); + } + + if (schema.path(key) && schema.path(key).options.$skipDiscriminatorCheck !== true) { + throw new Error('Discriminator "' + name + + '" cannot have field with name "' + key + '"'); + } + + let value = name; + if ((typeof tiedValue === 'string' && tiedValue.length) || tiedValue != null) { + value = tiedValue; + } + + validateDiscriminatorSchemasForEncryption(model.schema, schema); + + function merge(schema, baseSchema) { + // Retain original schema before merging base schema + schema._baseSchema = baseSchema; + if (baseSchema.paths._id && + baseSchema.paths._id.options && + !baseSchema.paths._id.options.auto) { + schema.remove('_id'); + } + + // Find conflicting paths: if something is a path in the base schema + // and a nested path in the child schema, overwrite the base schema path. + // See gh-6076 + const baseSchemaPaths = Object.keys(baseSchema.paths); + const conflictingPaths = []; + + for (const path of baseSchemaPaths) { + if (schema.nested[path]) { + conflictingPaths.push(path); + continue; + } + + if (path.indexOf('.') === -1) { + continue; + } + const sp = path.split('.').slice(0, -1); + let cur = ''; + for (const piece of sp) { + cur += (cur.length ? '.' : '') + piece; + if (schema.paths[cur] instanceof Mixed || + schema.singleNestedPaths[cur] instanceof Mixed) { + conflictingPaths.push(path); + } + } + } + + // Shallow clone `obj` so we can add additional properties without modifying original + // schema. `Schema.prototype.clone()` copies `obj` by reference, no cloning. + schema.obj = { ...schema.obj }; + mergeDiscriminatorSchema(schema, baseSchema); + schema._gatherChildSchemas(); + + // Clean up conflicting paths _after_ merging re: gh-6076 + for (const conflictingPath of conflictingPaths) { + delete schema.paths[conflictingPath]; + } + + // Rebuild schema models because schemas may have been merged re: #7884 + schema.childSchemas.forEach(obj => { + obj.model.prototype.$__setSchema(obj.schema); + }); + + const obj = {}; + obj[key] = { + default: value, + select: true, + set: function(newName) { + if (newName === value || (Array.isArray(value) && utils.deepEqual(newName, value))) { + return value; + } + throw new Error('Can\'t set discriminator key "' + key + '"'); + }, + $skipDiscriminatorCheck: true + }; + obj[key][schema.options.typeKey] = existingPath ? existingPath.options[schema.options.typeKey] : String; + schema.add(obj); + + schema.discriminatorMapping = { key: key, value: value, isRoot: false }; + + if (baseSchema.options.collection) { + schema.options.collection = baseSchema.options.collection; + } + const toJSON = schema.options.toJSON; + const toObject = schema.options.toObject; + const _id = schema.options._id; + const id = schema.options.id; + + const keys = Object.keys(schema.options); + schema.options.discriminatorKey = baseSchema.options.discriminatorKey; + const userProvidedOptions = schema._userProvidedOptions; + for (const _key of keys) { + if (!CUSTOMIZABLE_DISCRIMINATOR_OPTIONS[_key]) { + // Use `schema.options` in `deepEqual()` because of `discriminatorKey` + // set above. We don't allow customizing discriminator key, always + // overwrite. See gh-9238 + if (_key in userProvidedOptions && !utils.deepEqual(schema.options[_key], baseSchema.options[_key])) { + throw new Error('Can\'t customize discriminator option ' + _key + + ' (can only modify ' + + Object.keys(CUSTOMIZABLE_DISCRIMINATOR_OPTIONS).join(', ') + + ')'); + } + } + } + schema.options = clone(baseSchema.options); + + for (const _key of Object.keys(userProvidedOptions)) { + schema.options[_key] = userProvidedOptions[_key]; + } + if (toJSON) schema.options.toJSON = toJSON; + if (toObject) schema.options.toObject = toObject; + if (typeof _id !== 'undefined') { + schema.options._id = _id; + } + schema.options.id = id; + if (mergeHooks) { + schema.s.hooks = model.schema.s.hooks.merge(schema.s.hooks); + } + if (applyPlugins) { + schema.plugins = Array.prototype.slice.call(baseSchema.plugins); + } + schema.callQueue = baseSchema.callQueue.concat(schema.callQueue); + delete schema._requiredpaths; // reset just in case Schema#requiredPaths() was called on either schema + } + + // merges base schema into new discriminator schema and sets new type field. + merge(schema, model.schema); + + if (!model.discriminators) { + model.discriminators = {}; + } + + if (!model.schema.discriminatorMapping) { + model.schema.discriminatorMapping = { key: key, value: null, isRoot: true }; + } + if (!model.schema.discriminators) { + model.schema.discriminators = {}; + } + + model.schema.discriminators[name] = schema; + + if (model.discriminators[name] && !schema.options.overwriteModels && !overwriteExisting) { + throw new Error('Discriminator with name "' + name + '" already exists'); + } + + return schema; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js new file mode 100644 index 00000000..7f234faa --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function pushNestedArrayPaths(paths, nestedArray, path) { + if (nestedArray == null) { + return; + } + + for (let i = 0; i < nestedArray.length; ++i) { + if (Array.isArray(nestedArray[i])) { + pushNestedArrayPaths(paths, nestedArray[i], path + '.' + i); + } else { + paths.push(path + '.' + i); + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/omitUndefined.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/omitUndefined.js new file mode 100644 index 00000000..5c9eb885 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/omitUndefined.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = function omitUndefined(val) { + if (val == null || typeof val !== 'object') { + return val; + } + if (Array.isArray(val)) { + for (let i = val.length - 1; i >= 0; --i) { + if (val[i] === undefined) { + val.splice(i, 1); + } + } + } + for (const key of Object.keys(val)) { + if (val[key] === void 0) { + delete val[key]; + } + } + return val; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/once.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/once.js new file mode 100644 index 00000000..dfa5ee71 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/once.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function once(fn) { + let called = false; + return function() { + if (called) { + return; + } + called = true; + return fn.apply(null, arguments); + }; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/parallelLimit.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/parallelLimit.js new file mode 100644 index 00000000..ad542f5a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/parallelLimit.js @@ -0,0 +1,62 @@ +'use strict'; + +module.exports = parallelLimit; + +/*! + * Run `fn` over every entry of `params` with at most `limit` calls in flight at + * a time, resolving to the results in input order. Currently only used by + * `Model.insertMany()` to bound how many documents validate concurrently. + */ + +async function parallelLimit(params, fn, limit) { + if (limit <= 0) { + throw new Error('Limit must be positive'); + } + + const length = params.length; + if (length === 0) { + return []; + } + + const results = new Array(length); + // Fast path: there's nothing to bound, so kick everything off and wait once. + // Avoids the per-task `Set` + `Promise.race` bookkeeping of a sliding window. + if (limit >= length) { + for (let i = 0; i < length; ++i) { + results[i] = fn(params[i], i); + } + return Promise.all(results); + } + + let nextIndex = 0; + let firstError = null; + + function worker() { + if (nextIndex >= length || firstError !== null) { + return undefined; + } + const index = nextIndex++; + return Promise.resolve(fn(params[index], index)).then( + (val) => { + results[index] = val; + return worker(); + }, + (err) => { + if (firstError === null) { + firstError = err; + } + } + ); + } + + const workers = new Array(Math.min(limit, length)); + for (let i = 0; i < workers.length; ++i) { + workers[i] = worker(); + } + await Promise.all(workers); + + if (firstError !== null) { + throw firstError; + } + return results; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/parentPaths.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/parentPaths.js new file mode 100644 index 00000000..6822c8ce --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/parentPaths.js @@ -0,0 +1,18 @@ +'use strict'; + +const dotRE = /\./g; +module.exports = function parentPaths(path) { + if (path.indexOf('.') === -1) { + return [path]; + } + const pieces = path.split(dotRE); + const len = pieces.length; + const ret = new Array(len); + let cur = ''; + for (let i = 0; i < len; ++i) { + cur += (cur.length !== 0) ? '.' + pieces[i] : pieces[i]; + ret[i] = cur; + } + + return ret; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/setDottedPath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/setDottedPath.js new file mode 100644 index 00000000..b17d5490 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/path/setDottedPath.js @@ -0,0 +1,33 @@ +'use strict'; + +const specialProperties = require('../specialProperties'); + + +module.exports = function setDottedPath(obj, path, val) { + if (path.indexOf('.') === -1) { + if (specialProperties.has(path)) { + return; + } + + obj[path] = val; + return; + } + const parts = path.split('.'); + + const last = parts.pop(); + let cur = obj; + for (const part of parts) { + if (specialProperties.has(part)) { + continue; + } + if (cur[part] == null) { + cur[part] = {}; + } + + cur = cur[part]; + } + + if (!specialProperties.has(last)) { + cur[last] = val; + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pathTrie.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pathTrie.js new file mode 100644 index 00000000..51ed06c1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pathTrie.js @@ -0,0 +1,167 @@ +'use strict'; + +const wildcardSegment = '$*'; +const numericSegmentRegex = /^\d+$/; + +class PathTrieNode { + constructor() { + this.children = new Map(); + this.terminal = false; + this.hasWildcard = false; + } +} + +/** + * Trie of dotted paths for efficient path matching. Supports the map wildcard + * segment `$*`, which matches any single segment. For example, a trie + * containing `settings.$*` matches `settings.theme` but not `settings` or + * `profile.theme`. In array lookups, numeric segments like array indexes are + * ignorable: a trie containing `comments.text` matches `comments.0.text`. + * Single-segment string lookups skip the numeric check entirely. + * + * @api private + */ + +class PathTrie { + /** + * @param {string[]} [paths] paths to add to the trie + */ + constructor(paths) { + this.root = new PathTrieNode(); + if (paths != null) { + for (const path of paths) { + this.add(path); + } + } + } + + /** + * Add a dotted path, like `settings.$*` or `profile.firstName`, to the trie. + * + * @param {string} path + */ + + add(path) { + if (path.indexOf('.') === -1) { + this._addSegment(this.root, path).terminal = true; + return; + } + let node = this.root; + for (const segment of path.split('.')) { + node = this._addSegment(node, segment); + } + node.terminal = true; + } + + /** + * @param {PathTrieNode} node + * @param {string} segment + */ + _addSegment(node, segment) { + let child = node.children.get(segment); + if (child == null) { + child = new PathTrieNode(); + node.children.set(segment, child); + if (segment === wildcardSegment) { + node.hasWildcard = true; + } + } + return child; + } + + /** + * Check if `path` or any of its ancestor paths exist in the trie. `path` is + * either a single segment string or a pre-split array of segments — lookups + * never split, callers are responsible for splitting dotted paths. + * For example, with a trie containing 'profile': + * matchesPathOrAncestor(['profile', 'firstName']) === true + * matchesPathOrAncestor('profile') === true + * But with a trie containing 'profile.firstName': + * matchesPathOrAncestor('profile') === false + * + * @param {string|string[]} path + */ + + matchesPathOrAncestor(path) { + return this._walk(path) === true; + } + + /** + * Check if `path`, any of its ancestor paths, or any of its descendant paths + * exist in the trie. `path` is either a single segment string or a pre-split + * array of segments — lookups never split, callers are responsible for + * splitting dotted paths. For example: + * new PathTrie(['profile']).overlapsPath(['profile', 'firstName']) === true + * new PathTrie(['profile.firstName']).overlapsPath('profile') === true + * + * @param {string|string[]} path + */ + + overlapsPath(path) { + return this._walk(path) !== false; + } + + /** + * Walk `path` through the trie. `path` is assumed to be pre-split - if the + * path has multiple segments, pass in an array of strings. Returns `true` if + * a terminal node was found at `path` or one of its ancestors, `false` if the + * walk dead-ended, and the array of reached nodes if `path` is a strict prefix + * of entries in the trie. + * + * @param {string|string[]} path + */ + + _walk(path) { + if (typeof path === 'string') { + const next = []; + const literal = this.root.children.get(path); + if (literal != null) { + if (literal.terminal) { + return true; + } + next.push(literal); + } + if (this.root.hasWildcard) { + const wildcard = this.root.children.get(wildcardSegment); + if (wildcard.terminal) { + return true; + } + next.push(wildcard); + } + return next.length === 0 ? false : next; + } + let nodes = [this.root]; + for (const segment of path) { + const next = []; + const isNumericSegment = numericSegmentRegex.test(segment); + for (const node of nodes) { + if (isNumericSegment) { + // Numeric segments like array indexes are ignorable: `comments.text` + // in the trie matches the modified path `comments.0.text`. + next.push(node); + } + const literal = node.children.get(segment); + if (literal != null) { + if (literal.terminal) { + return true; + } + next.push(literal); + } + if (node.hasWildcard) { + const wildcard = node.children.get(wildcardSegment); + if (wildcard.terminal) { + return true; + } + next.push(wildcard); + } + } + if (next.length === 0) { + return false; + } + nodes = next; + } + return nodes; + } +} + +module.exports = PathTrie; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pluralize.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pluralize.js new file mode 100644 index 00000000..b06a8dfa --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/pluralize.js @@ -0,0 +1,95 @@ +'use strict'; + +module.exports = pluralize; + +/** + * Pluralization rules. + */ + +exports.pluralization = [ + [/human$/gi, 'humans'], + [/(m|wom)an$/gi, '$1en'], + [/(pe)rson$/gi, '$1ople'], + [/(child)$/gi, '$1ren'], + [/^(ox)$/gi, '$1en'], + [/(ax|test)is$/gi, '$1es'], + [/(octop|cact|foc|fung|nucle)us$/gi, '$1i'], + [/(alias|status|virus)$/gi, '$1es'], + [/(bu)s$/gi, '$1ses'], + [/(buffal|tomat|potat)o$/gi, '$1oes'], + [/([ti])um$/gi, '$1a'], + [/sis$/gi, 'ses'], + [/(?:([^f])fe|([lr])f)$/gi, '$1$2ves'], + [/(hive)$/gi, '$1s'], + [/([^aeiouy]|qu)y$/gi, '$1ies'], + [/(x|ch|ss|sh)$/gi, '$1es'], + [/(matr|vert|ind)ix|ex$/gi, '$1ices'], + [/([m|l])ouse$/gi, '$1ice'], + [/(kn|w|l)ife$/gi, '$1ives'], + [/(quiz)$/gi, '$1zes'], + [/^goose$/i, 'geese'], + [/s$/gi, 's'], + [/([^a-z])$/, '$1'], + [/$/gi, 's'] +]; +const rules = exports.pluralization; + +/** + * Uncountable words. + * + * These words are applied while processing the argument to `toCollectionName`. + * @api public + */ + +exports.uncountables = [ + 'advice', + 'energy', + 'excretion', + 'digestion', + 'cooperation', + 'health', + 'justice', + 'labour', + 'machinery', + 'equipment', + 'information', + 'pollution', + 'sewage', + 'paper', + 'money', + 'species', + 'series', + 'rain', + 'rice', + 'fish', + 'sheep', + 'moose', + 'deer', + 'news', + 'expertise', + 'status', + 'media' +]; +const uncountables = exports.uncountables; + +/** + * Pluralize function. + * + * @author TJ Holowaychuk (extracted from _ext.js_) + * @param {string} string to pluralize + * @api private + */ + +function pluralize(str) { + let found; + str = str.toLowerCase(); + if (!~uncountables.indexOf(str)) { + found = rules.filter(function(rule) { + return str.match(rule[0]); + }); + if (found[0]) { + return str.replace(found[0][0], found[0][1]); + } + } + return str; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js new file mode 100644 index 00000000..18cd3d3f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js @@ -0,0 +1,129 @@ +'use strict'; + +const clone = require('../../helpers/clone'); +const leanPopulateMap = require('./leanPopulateMap'); +const modelSymbol = require('../symbols').modelSymbol; +const utils = require('../../utils'); + +module.exports = assignRawDocsToIdStructure; + +const kHasArray = Symbol('mongoose#assignRawDocsToIdStructure#hasArray'); + +/** + * Assign `vals` returned by mongo query to the `rawIds` + * structure returned from utils.getVals() honoring + * query sort order if specified by user. + * + * This can be optimized. + * + * Rules: + * + * if the value of the path is not an array, use findOne rules, else find. + * for findOne the results are assigned directly to doc path (including null results). + * for find, if user specified sort order, results are assigned directly + * else documents are put back in original order of array if found in results + * + * @param {Array} rawIds + * @param {Array} resultDocs + * @param {Array} resultOrder + * @param {object} options + * @param {boolean} recursed + * @api private + */ + +function assignRawDocsToIdStructure(rawIds, resultDocs, resultOrder, options, recursed) { + // honor user specified sort order, unless we're populating a single + // virtual underneath an array (e.g. populating `employees.mostRecentShift` where + // `mostRecentShift` is a virtual with `justOne`) + const newOrder = []; + const sorting = options.isVirtual && options.justOne && rawIds.length > 1 + ? false : + options.sort && rawIds.length > 1; + const nullIfNotFound = options.$nullIfNotFound; + let doc; + let sid; + let id; + + if (utils.isMongooseArray(rawIds)) { + rawIds = rawIds.__array; + } + + let i = 0; + const len = rawIds.length; + + if (sorting && recursed && options[kHasArray] === undefined) { + options[kHasArray] = false; + for (const key in resultOrder) { + if (Array.isArray(resultOrder[key])) { + options[kHasArray] = true; + break; + } + } + } + + for (i = 0; i < len; ++i) { + id = rawIds[i]; + + if (Array.isArray(id)) { + // handle [ [id0, id2], [id3] ] + assignRawDocsToIdStructure(id, resultDocs, resultOrder, options, true); + newOrder.push(id); + continue; + } + + if (id === null && sorting === false) { + // keep nulls for findOne unless sorting, which always + // removes them (backward compat) + newOrder.push(id); + continue; + } + + sid = String(id); + doc = resultDocs[sid]; + // If user wants separate copies of same doc, use this option + if (options.clone && doc != null) { + if (options.lean) { + const _model = leanPopulateMap.get(doc); + doc = clone(doc); + leanPopulateMap.set(doc, _model); + } else { + doc = doc.constructor.hydrate(doc._doc); + } + } + + if (recursed) { + if (doc) { + if (sorting) { + const _resultOrder = resultOrder[sid]; + if (options[kHasArray]) { + // If result arrays, rely on the MongoDB server response for ordering + newOrder.push(doc); + } else { + newOrder[_resultOrder] = doc; + } + } else { + newOrder.push(doc); + } + } else if (id?.[modelSymbol] != null) { + newOrder.push(id); + } else { + newOrder.push(options.retainNullValues || nullIfNotFound ? null : id); + } + } else { + // apply findOne behavior - if document in results, assign, else assign null + newOrder[i] = doc || null; + } + } + + rawIds.length = 0; + if (newOrder.length) { + // reassign the documents based on corrected order + + // forEach skips over sparse entries in arrays so we + // can safely use this to our advantage dealing with sorted + // result sets too. + newOrder.forEach(function(doc, i) { + rawIds[i] = doc; + }); + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignVals.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignVals.js new file mode 100644 index 00000000..06b097a2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/assignVals.js @@ -0,0 +1,360 @@ +'use strict'; + +const MongooseMap = require('../../types/map'); +const SkipPopulateValue = require('./skipPopulateValue'); +const assignRawDocsToIdStructure = require('./assignRawDocsToIdStructure'); +const get = require('../get'); +const getVirtual = require('./getVirtual'); +const leanPopulateMap = require('./leanPopulateMap'); +const lookupLocalFields = require('./lookupLocalFields'); +const markArraySubdocsPopulated = require('./markArraySubdocsPopulated'); +const mpath = require('mpath'); +const sift = require('sift').default; +const utils = require('../../utils'); +const { populateModelSymbol } = require('../symbols'); + +module.exports = function assignVals(o) { + // Options that aren't explicitly listed in `populateOptions` + const userOptions = Object.assign({}, get(o, 'allOptions.options.options'), get(o, 'allOptions.options')); + // `o.options` contains options explicitly listed in `populateOptions`, like + // `match` and `limit`. + const populateOptions = Object.assign({}, o.options, userOptions, { + justOne: o.justOne, + isVirtual: o.isVirtual + }); + populateOptions.$nullIfNotFound = o.isVirtual; + const populatedModel = o.populatedModel; + + const originalIds = [].concat(o.rawIds); + + // replace the original ids in our intermediate _ids structure + // with the documents found by query + o.allIds = [].concat(o.allIds); + assignRawDocsToIdStructure(o.rawIds, o.rawDocs, o.rawOrder, populateOptions); + + // now update the original documents being populated using the + // result structure that contains real documents. + const docs = o.docs; + const rawIds = o.rawIds; + const options = o.options; + const count = o.count && o.isVirtual; + let i; + let setValueIndex = 0; + + function setValue(val) { + ++setValueIndex; + if (count) { + return val; + } + if (val instanceof SkipPopulateValue) { + return val.val; + } + if (val === void 0) { + return val; + } + + const _allIds = o.allIds[i]; + + if (o.path.endsWith('.$*')) { + // Skip maps re: gh-12494 + return valueFilter(val, options, populateOptions, _allIds); + } + + if (o.justOne === true && Array.isArray(val)) { + // Might be an embedded discriminator (re: gh-9244) with multiple models, so make sure to pick the right + // model before assigning. + const ret = []; + for (const doc of val) { + const _docPopulatedModel = leanPopulateMap.get(doc); + if (_docPopulatedModel == null || _docPopulatedModel === populatedModel) { + ret.push(doc); + } + } + // Since we don't want to have to create a new mongoosearray, make sure to + // modify the array in place + while (val.length > ret.length) { + Array.prototype.pop.apply(val, []); + } + for (let i = 0; i < ret.length; ++i) { + val[i] = ret[i]; + } + + return valueFilter(val[0], options, populateOptions, _allIds); + } else if (o.justOne === false && !Array.isArray(val)) { + return valueFilter([val], options, populateOptions, _allIds); + } else if (o.justOne === true && !Array.isArray(val) && Array.isArray(_allIds)) { + return valueFilter(val, options, populateOptions, val == null ? val : _allIds[setValueIndex - 1]); + } + return valueFilter(val, options, populateOptions, _allIds); + } + + for (i = 0; i < docs.length; ++i) { + setValueIndex = 0; + const _path = o.path.endsWith('.$*') ? o.path.slice(0, -3) : o.path; + const existingVal = mpath.get(_path, docs[i], lookupLocalFields); + if (existingVal == null && !getVirtual(o.originalModel.schema, _path)) { + continue; + } + + let valueToSet; + if (count) { + valueToSet = numDocs(rawIds[i]); + } else if (Array.isArray(o.match)) { + valueToSet = Array.isArray(rawIds[i]) ? + rawIds[i].filter(v => v == null || sift(o.match[i])(v)) : + [rawIds[i]].filter(v => v == null || sift(o.match[i])(v))[0]; + } else { + valueToSet = rawIds[i]; + } + + // If we're populating a map, the existing value will be an object, so + // we need to transform again + const originalSchema = o.originalModel.schema; + const isDoc = get(docs[i], '$__', null) != null; + let isMap = isDoc ? + existingVal instanceof Map : + utils.isPOJO(existingVal); + // If we pass the first check, also make sure the local field's schematype + // is map (re: gh-6460) + isMap = isMap && get(originalSchema._getSchema(_path), '$isSchemaMap'); + if (!o.isVirtual && isMap) { + const _keys = existingVal instanceof Map ? + Array.from(existingVal.keys()) : + Object.keys(existingVal); + valueToSet = valueToSet.reduce((cur, v, i) => { + cur.set(_keys[i], v); + return cur; + }, new Map()); + } + + if (isDoc && Array.isArray(valueToSet)) { + for (const val of valueToSet) { + if (val?.$__ != null) { + val.$__.parent = docs[i]; + } + } + } else if (isDoc && valueToSet?.$__ != null) { + valueToSet.$__.parent = docs[i]; + } + + if (o.isVirtual && isDoc) { + docs[i].$populated(_path, o.justOne ? originalIds[0] : originalIds, o.allOptions); + // If virtual populate and doc is already init-ed, need to walk through + // the actual doc to set rather than setting `_doc` directly + if (Array.isArray(valueToSet)) { + valueToSet = valueToSet.map(v => v == null ? void 0 : v); + } + mpath.set( + _path, + valueToSet, + docs[i], + // Handle setting paths underneath maps using $* by converting arrays into maps of values + function lookup(obj, part, val) { + if (arguments.length >= 3) { + obj[part] = val; + return obj[part]; + } + if (obj instanceof Map && part === '$*') { + return [...obj.values()]; + } + return obj[part]; + }, + setValue, + false + ); + continue; + } + + const parts = _path.split('.'); + let cur = docs[i]; + for (let j = 0; j < parts.length - 1; ++j) { + // If we get to an array with a dotted path, like `arr.foo`, don't set + // `foo` on the array. + if (Array.isArray(cur) && !utils.isArrayIndex(parts[j])) { + break; + } + + if (parts[j] === '$*') { + break; + } + + if (cur[parts[j]] == null) { + // If nothing to set, avoid creating an unnecessary array. Otherwise + // we'll end up with a single doc in the array with only defaults. + // See gh-8342, gh-8455 + const curPath = parts.slice(0, j + 1).join('.'); + const schematype = originalSchema._getSchema(curPath); + if (valueToSet == null && schematype?.$isMongooseArray) { + break; + } + cur[parts[j]] = {}; + } + cur = cur[parts[j]]; + // If the property in MongoDB is a primitive, we won't be able to populate + // the nested path, so skip it. See gh-7545 + if (typeof cur !== 'object') { + break; + } + } + if (docs[i].$__) { + o.allOptions.options[populateModelSymbol] = o.allOptions.model; + docs[i].$populated(_path, o.unpopulatedValues[i], o.allOptions.options); + + if (valueToSet?.$__ != null) { + valueToSet.$__.wasPopulated = { value: o.unpopulatedValues[i] }; + } + + if (valueToSet instanceof Map && !valueToSet.$isMongooseMap) { + valueToSet = new MongooseMap(valueToSet, _path, docs[i], docs[i].schema.path(_path).$__schemaType); + } + } + + // If lean, need to check that each individual virtual respects + // `justOne`, because you may have a populated virtual with `justOne` + // underneath an array. See gh-6867 + mpath.set(_path, valueToSet, docs[i], lookupLocalFields, setValue, false); + + if (docs[i].$__) { + markArraySubdocsPopulated(docs[i], [o.allOptions.options]); + } + } +}; + +function numDocs(v) { + if (Array.isArray(v)) { + // If setting underneath an array of populated subdocs, we may have an + // array of arrays. See gh-7573 + if (v.some(el => Array.isArray(el) || el === null)) { + return v.map(el => { + if (el == null) { + return 0; + } + if (Array.isArray(el)) { + return el.filter(el => el != null).length; + } + return 1; + }); + } + return v.filter(el => el != null).length; + } + return v == null ? 0 : 1; +} + +/** + * 1) Apply backwards compatible find/findOne behavior to sub documents + * + * find logic: + * a) filter out non-documents + * b) remove _id from sub docs when user specified + * + * findOne + * a) if no doc found, set to null + * b) remove _id from sub docs when user specified + * + * 2) Remove _ids when specified by users query. + * + * background: + * _ids are left in the query even when user excludes them so + * that population mapping can occur. + * @param {any} val + * @param {object} assignmentOpts + * @param {object} populateOptions + * @param {Function} [populateOptions.transform] + * @param {boolean} allIds + * @api private + */ + +function valueFilter(val, assignmentOpts, populateOptions, allIds) { + const userSpecifiedTransform = typeof populateOptions.transform === 'function'; + const transform = userSpecifiedTransform ? populateOptions.transform : v => v; + if (Array.isArray(val)) { + // find logic + const ret = []; + const numValues = val.length; + for (let i = 0; i < numValues; ++i) { + let subdoc = val[i]; + const _allIds = Array.isArray(allIds) ? allIds[i] : allIds; + if (!isPopulatedObject(subdoc) && (!populateOptions.retainNullValues || subdoc != null) && !userSpecifiedTransform) { + continue; + } else if (!populateOptions.retainNullValues && subdoc == null) { + continue; + } else if (userSpecifiedTransform) { + subdoc = transform(isPopulatedObject(subdoc) ? subdoc : null, _allIds); + } + maybeRemoveId(subdoc, assignmentOpts); + ret.push(subdoc); + if (assignmentOpts.originalLimit && + ret.length >= assignmentOpts.originalLimit) { + break; + } + } + + const rLen = ret.length; + // Since we don't want to have to create a new mongoosearray, make sure to + // modify the array in place + while (val.length > rLen) { + Array.prototype.pop.apply(val, []); + } + let i = 0; + if (utils.isMongooseArray(val)) { + for (i = 0; i < rLen; ++i) { + val.set(i, ret[i], true); + } + } else { + for (i = 0; i < rLen; ++i) { + val[i] = ret[i]; + } + } + return val; + } + + // findOne + if (isPopulatedObject(val) || utils.isPOJO(val)) { + maybeRemoveId(val, assignmentOpts); + return transform(val, allIds); + } + if (val instanceof Map) { + return val; + } + + if (populateOptions.justOne === false) { + return []; + } + + return val == null ? transform(val, allIds) : transform(null, allIds); +} + +/** + * Remove _id from `subdoc` if user specified "lean" query option + * @param {Document} subdoc + * @param {object} assignmentOpts + * @api private + */ + +function maybeRemoveId(subdoc, assignmentOpts) { + if (subdoc != null && assignmentOpts.excludeId) { + if (typeof subdoc.$__setValue === 'function') { + delete subdoc._doc._id; + } else { + delete subdoc._id; + } + } +} + +/** + * Determine if `obj` is something we can set a populated path to. Can be a + * document, a lean document, or an array/map that contains docs. + * @param {any} obj + * @api private + */ + +function isPopulatedObject(obj) { + if (obj == null) { + return false; + } + + return Array.isArray(obj) || + obj.$isMongooseMap || + obj.$__ != null || + leanPopulateMap.has(obj); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js new file mode 100644 index 00000000..df4268a1 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js @@ -0,0 +1,105 @@ +'use strict'; + +const SkipPopulateValue = require('./skipPopulateValue'); +const parentPaths = require('../path/parentPaths'); +const { trusted } = require('../query/trusted'); +const hasDollarKeys = require('../query/hasDollarKeys'); + +module.exports = function createPopulateQueryFilter(ids, _match, _foreignField, model, skipInvalidIds) { + const match = _formatMatch(_match); + + if (_foreignField.size === 1) { + const foreignField = Array.from(_foreignField)[0]; + const foreignSchemaType = model.schema.path(foreignField); + if (foreignField !== '_id' || !match['_id']) { + ids = _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds); + match[foreignField] = trusted({ $in: ids }); + } else if (foreignField === '_id' && match['_id']) { + const userSpecifiedMatch = hasDollarKeys(match[foreignField]) ? + match[foreignField] : + { $eq: match[foreignField] }; + match[foreignField] = { ...trusted({ $in: ids }), ...userSpecifiedMatch }; + } + + const _parentPaths = parentPaths(foreignField); + for (let i = 0; i < _parentPaths.length - 1; ++i) { + const cur = _parentPaths[i]; + if (match[cur] != null && match[cur].$elemMatch != null) { + // Copy rather than mutate so the user's `match` stays unchanged and split populate + // queries (gh-5890) each get their own `$in` rather than sharing one object + match[cur] = { + ...match[cur], + $elemMatch: { + ...match[cur].$elemMatch, + [foreignField.slice(cur.length + 1)]: trusted({ $in: ids }) + } + }; + delete match[foreignField]; + break; + } + } + } else { + const $or = []; + if (Array.isArray(match.$or)) { + match.$and = [{ $or: match.$or }, { $or: $or }]; + delete match.$or; + } else { + match.$or = $or; + } + for (const foreignField of _foreignField) { + if (foreignField !== '_id' || !match['_id']) { + const foreignSchemaType = model.schema.path(foreignField); + ids = _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds); + $or.push({ [foreignField]: { $in: ids } }); + } else if (foreignField === '_id' && match['_id']) { + const userSpecifiedMatch = hasDollarKeys(match[foreignField]) ? + match[foreignField] : + { $eq: match[foreignField] }; + match[foreignField] = { ...trusted({ $in: ids }), ...userSpecifiedMatch }; + } + } + } + + return match; +}; + +/** + * Optionally filter out invalid ids that don't conform to foreign field's schema + * to avoid cast errors (gh-7706) + * @param {Array} ids + * @param {SchemaType} foreignSchemaType + * @param {boolean} [skipInvalidIds] + * @api private + */ + +function _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds) { + ids = ids.filter(v => !(v instanceof SkipPopulateValue)); + if (!skipInvalidIds) { + return ids; + } + return ids.filter(id => { + try { + foreignSchemaType.cast(id); + return true; + } catch { + return false; + } + }); +} + +/** + * Format `mod.match` given that it may be an array that we need to $or if + * the client has multiple docs with match functions + * @param {Array|any} match + * @api private + */ + +function _formatMatch(match) { + if (Array.isArray(match)) { + if (match.length > 1) { + return { $or: [].concat(match.map(m => Object.assign({}, m))) }; + } + return Object.assign({}, match[0]); + } + return Object.assign({}, match); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js new file mode 100644 index 00000000..eb66a82a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js @@ -0,0 +1,896 @@ +'use strict'; + +const MongooseError = require('../../error/index'); +const SkipPopulateValue = require('./skipPopulateValue'); +const clone = require('../clone'); +const get = require('../get'); +const getDiscriminatorByValue = require('../discriminator/getDiscriminatorByValue'); +const getConstructorName = require('../getConstructorName'); +const getSchemaTypes = require('./getSchemaTypes'); +const getVirtual = require('./getVirtual'); +const lookupLocalFields = require('./lookupLocalFields'); +const mpath = require('mpath'); +const modelNamesFromRefPath = require('./modelNamesFromRefPath'); +const utils = require('../../utils'); + +const modelSymbol = require('../symbols').modelSymbol; +const populateModelSymbol = require('../symbols').populateModelSymbol; +const schemaMixedSymbol = require('../../schema/symbols').schemaMixedSymbol; +const StrictPopulate = require('../../error/strictPopulate'); +const numericPathSegmentPattern = '\\.\\d+(?=\\.|$)'; +const hasNumericPathSegmentRE = new RegExp(numericPathSegmentPattern); +const numericPathSegmentRE = new RegExp(numericPathSegmentPattern, 'g'); + +module.exports = function getModelsMapForPopulate(model, docs, options) { + let doc; + const len = docs.length; + const map = []; + const modelNameFromQuery = options.model?.modelName || options.model; + let schema; + let refPath; + let modelNames; + let modelNamesSet; + const available = {}; + + const modelSchema = model.schema; + + // Populating a nested path should always be a no-op re: #9073. + // People shouldn't do this, but apparently they do. + if (options._localModel != null && options._localModel.schema.nested[options.path]) { + return []; + } + + const _virtualRes = getVirtual(model.schema, options.path); + const virtual = _virtualRes == null ? null : _virtualRes.virtual; + if (virtual != null) { + return _virtualPopulate(model, docs, options, _virtualRes); + } + + const parts = modelSchema.paths[options.path]?.splitPath() ?? options.path.split('.'); + let allSchemaTypes = getSchemaTypes(model, modelSchema, null, options.path, parts); + allSchemaTypes = Array.isArray(allSchemaTypes) ? allSchemaTypes : [allSchemaTypes].filter(v => v != null); + + const isStrictPopulateDisabled = options.strictPopulate === false || options.options?.strictPopulate === false; + if (!isStrictPopulateDisabled && allSchemaTypes.length === 0 && options._localModel != null) { + return new StrictPopulate(options._fullPath || options.path); + } + + for (let i = 0; i < len; i++) { + doc = docs[i]; + let justOne = null; + + if (doc.$__ != null && doc.populated(options.path)) { + const forceRepopulate = options.forceRepopulate ?? doc.constructor.base.options.forceRepopulate; + if (forceRepopulate === false) { + continue; + } + } + + const docSchema = doc?.$__ != null ? doc.$__schema : modelSchema; + schema = getSchemaTypes(model, docSchema, doc, options.path, parts); + + // Special case: populating a path that's a DocumentArray unless + // there's an explicit `ref` or `refPath` re: gh-8946 + if (schema != null && + schema.$isMongooseDocumentArray && + schema.options.ref == null && + schema.options.refPath == null) { + continue; + } + const isUnderneathDocArray = schema?.$parentSchemaDocArray; + if (isUnderneathDocArray && get(options, 'options.sort') != null) { + return new MongooseError('Cannot populate with `sort` on path ' + options.path + + ' because it is a subproperty of a document array'); + } + + modelNames = null; + let isRefPath = false; + let normalizedRefPath = null; + let schemaOptions = null; + let modelNamesInOrder = null; + + if (schema?.instance === 'Embedded') { + if (schema.options.ref) { + const data = { + localField: options.path + '._id', + foreignField: '_id', + justOne: true + }; + const res = _getModelNames(doc, schema, modelNameFromQuery, model); + + const unpopulatedValue = mpath.get(options.path, doc); + const id = mpath.get('_id', unpopulatedValue); + addModelNamesToMap(model, map, available, res.modelNames, options, data, id, doc, schemaOptions, unpopulatedValue); + } + // No-op if no `ref` set. See gh-11538 + continue; + } + + if (Array.isArray(schema)) { + const schemasArray = schema; + for (const _schema of schemasArray) { + let _modelNames; + let res; + try { + res = _getModelNames(doc, _schema, modelNameFromQuery, model); + _modelNames = res.modelNames; + isRefPath = isRefPath || res.isRefPath; + normalizedRefPath = normalizedRefPath || res.refPath; + justOne = res.justOne; + } catch (error) { + return error; + } + + if (isRefPath && !res.isRefPath) { + continue; + } + if (!_modelNames) { + continue; + } + modelNames = modelNames || []; + modelNamesSet = modelNamesSet || new Set(); + for (const modelName of _modelNames) { + if (modelNamesSet.has(modelName) === false) { + modelNamesSet.add(modelName); + modelNames.push(modelName); + } + } + } + } else { + try { + const res = _getModelNames(doc, schema, modelNameFromQuery, model); + modelNames = res.modelNames; + isRefPath = res.isRefPath; + normalizedRefPath = normalizedRefPath || res.refPath; + justOne = res.justOne; + schemaOptions = get(schema, 'options.populate', null); + // Dedupe, because `refPath` can return duplicates of the same model name, + // and that causes perf issues. + if (isRefPath) { + modelNamesInOrder = modelNames; + modelNames = Array.from(new Set(modelNames)); + } + } catch (error) { + return error; + } + + if (!modelNames) { + continue; + } + } + + const data = {}; + const localField = options.path; + const foreignField = '_id'; + + // `justOne = null` means we don't know from the schema whether the end + // result should be an array or a single doc. This can result from + // populating a POJO using `Model.populate()` + if ('justOne' in options && options.justOne !== void 0) { + justOne = options.justOne; + } else if (schema && !schema[schemaMixedSymbol]) { + // Skip Mixed types because we explicitly don't do casting on those. + if (options.path.endsWith('.' + schema.path) || options.path === schema.path) { + justOne = Array.isArray(schema) ? + schema.every(schema => !schema.$isMongooseArray) : + !schema.$isMongooseArray; + } + } + + if (!modelNames) { + continue; + } + + data.isVirtual = false; + data.justOne = justOne; + data.localField = localField; + data.foreignField = foreignField; + + // Get local fields + const ret = _getLocalFieldValues(doc, localField, model, options, null, schema); + + const id = String(utils.getValue(foreignField, doc)); + options._docs[id] = Array.isArray(ret) ? ret.slice() : ret; + + let match = get(options, 'match', null); + + const hasMatchFunction = typeof match === 'function'; + if (hasMatchFunction) { + match = match.call(doc, doc); + } + throwOn$where(match); + data.match = match; + data.hasMatchFunction = hasMatchFunction; + data.isRefPath = isRefPath; + data.modelNamesInOrder = modelNamesInOrder; + + if (isRefPath) { + const normalizedRefPathForDiscriminators = typeof normalizedRefPath === 'string' ? + normalizedRefPath.replace(numericPathSegmentRE, '') : + normalizedRefPath; + const embeddedDiscriminatorModelNames = _findRefPathForDiscriminators(doc, + modelSchema, data, options, normalizedRefPathForDiscriminators, ret); + + modelNames = embeddedDiscriminatorModelNames || modelNames; + } + + try { + addModelNamesToMap(model, map, available, modelNames, options, data, ret, doc, schemaOptions); + } catch (err) { + return err; + } + } + return map; + + function _getModelNames(doc, schemaType, modelNameFromQuery, model) { + let modelNames; + let isRefPath = false; + let justOne = null; + + const originalSchema = schemaType; + if (schemaType?.instance === 'Array') { + schemaType = schemaType.embeddedSchemaType; + } + if (schemaType?.$isSchemaMap) { + schemaType = schemaType.$__schemaType; + } + + const ref = schemaType?.options?.ref; + refPath = schemaType?.options?.refPath; + if (schemaType != null && + schemaType[schemaMixedSymbol] && + !ref && + !refPath && + !modelNameFromQuery) { + return { modelNames: null }; + } + + if (modelNameFromQuery) { + modelNames = [modelNameFromQuery]; // query options + } else if (refPath != null) { + if (typeof refPath === 'function') { + const res = _getModelNamesFromFunctionRefPath(refPath, doc, schemaType, options.path, modelSchema, options._queryProjection); + modelNames = res.modelNames; + refPath = res.refPath; + } else { + modelNames = modelNamesFromRefPath(refPath, doc, options.path, modelSchema, options._queryProjection); + } + + isRefPath = true; + } else { + let ref; + let refPath; + let schemaForCurrentDoc; + let discriminatorValue; + let modelForCurrentDoc = model; + const discriminatorKey = model.schema.options.discriminatorKey; + + if (!schemaType && discriminatorKey && (discriminatorValue = utils.getValue(discriminatorKey, doc))) { + // `modelNameForFind` is the discriminator value, so we might need + // find the discriminated model name + const discriminatorModel = getDiscriminatorByValue(model.discriminators, discriminatorValue) || model; + if (discriminatorModel != null) { + modelForCurrentDoc = discriminatorModel; + } else { + try { + modelForCurrentDoc = _getModelFromConn(model.db, discriminatorValue); + } catch (error) { + return error; + } + } + + schemaForCurrentDoc = modelForCurrentDoc.schema._getSchema(options.path); + + if (schemaForCurrentDoc?.embeddedSchemaType) { + schemaForCurrentDoc = schemaForCurrentDoc.embeddedSchemaType; + } + } else { + schemaForCurrentDoc = schemaType; + } + + if (originalSchema && originalSchema.path.endsWith('.$*')) { + justOne = !originalSchema.$isMongooseArray && !originalSchema._arrayPath; + } else if (schemaForCurrentDoc != null) { + justOne = !schemaForCurrentDoc.$isMongooseArray && !schemaForCurrentDoc._arrayPath; + } + + if ((ref = get(schemaForCurrentDoc, 'options.ref')) != null) { + if (schemaForCurrentDoc != null && + typeof ref === 'function' && + options.path.endsWith('.' + schemaForCurrentDoc.path)) { + // Ensure correct context for ref functions: subdoc, not top-level doc. See gh-8469 + modelNames = new Set(); + + const subdocPath = options.path.slice(0, options.path.length - schemaForCurrentDoc.path.length - 1); + const vals = mpath.get(subdocPath, doc, lookupLocalFields); + const subdocsBeingPopulated = Array.isArray(vals) ? + utils.array.flatten(vals) : + (vals ? [vals] : []); + for (const subdoc of subdocsBeingPopulated) { + modelNames.add(handleRefFunction(ref, subdoc)); + } + + if (subdocsBeingPopulated.length === 0) { + modelNames = [handleRefFunction(ref, doc)]; + } else { + modelNames = Array.from(modelNames); + } + } else { + ref = handleRefFunction(ref, doc); + modelNames = [ref]; + } + } else if ((refPath = get(schemaForCurrentDoc, 'options.refPath')) != null) { + isRefPath = true; + if (typeof refPath === 'function') { + const res = _getModelNamesFromFunctionRefPath(refPath, doc, schemaForCurrentDoc, options.path, modelSchema, options._queryProjection); + modelNames = res.modelNames; + refPath = res.refPath; + } else { + modelNames = modelNamesFromRefPath(refPath, doc, options.path, modelSchema, options._queryProjection); + } + } + } + + if (!modelNames) { + // `Model.populate()` on a POJO with no known local model. Default to using the `Model` + if (options._localModel == null) { + modelNames = [model.modelName]; + } else { + return { modelNames: modelNames, justOne: justOne, isRefPath: isRefPath, refPath: refPath }; + } + } + + if (!Array.isArray(modelNames)) { + modelNames = [modelNames]; + } + + return { modelNames: modelNames, justOne: justOne, isRefPath: isRefPath, refPath: refPath }; + } +}; + +/** + * Resolve model names for function-style `refPath` and return the first + * resolved refPath value so discriminator handling can inspect it later. + * + * @param {Function} refPath + * @param {Document|object} doc + * @param {SchemaType} schema + * @param {string} populatePath + * @param {Schema} modelSchema + * @param {object} queryProjection + * @returns {{modelNames: string[], refPath: string|null}} + * @private + */ +function _getModelNamesFromFunctionRefPath(refPath, doc, schemaType, populatePath, modelSchema, queryProjection) { + const modelNames = []; + let normalizedRefPath = null; + const schemaPath = schemaType?.path; + + if (schemaPath != null && + populatePath.length > schemaPath.length + 1 && + populatePath.charAt(populatePath.length - schemaPath.length - 1) === '.' && + populatePath.slice(populatePath.length - schemaPath.length) === schemaPath + ) { + const subdocPath = populatePath.slice(0, populatePath.length - schemaPath.length - 1); + const segments = subdocPath.indexOf('.') === -1 ? [subdocPath] : subdocPath.split('.'); + let hasSubdoc = false; + + walkSubdocs(doc, '', 0); + if (hasSubdoc) { + return { modelNames, refPath: normalizedRefPath }; + } + + function walkSubdocs(currentSubdoc, indexedPathPrefix, segmentIndex) { + if (currentSubdoc == null) { + return; + } + + if (segmentIndex >= segments.length) { + hasSubdoc = true; + const indexedPath = indexedPathPrefix + '.' + schemaPath; + const subdocRefPath = refPath.call(currentSubdoc, currentSubdoc, indexedPath); + normalizedRefPath = normalizedRefPath || subdocRefPath; + modelNames.push(..._getModelNamesFromRefPath(subdocRefPath, doc, populatePath, indexedPath, modelSchema, queryProjection)); + return; + } + + const segment = segments[segmentIndex]; + const source = currentSubdoc?._doc ?? currentSubdoc; + + if (segment === '$*') { + if (source instanceof Map) { + for (const [key, value] of source.entries()) { + if (value != null) { + const valuePath = indexedPathPrefix.length === 0 ? + key : + indexedPathPrefix + '.' + key; + walkSubdocs(value, valuePath, segmentIndex + 1); + } + } + return; + } + + if (source != null && typeof source === 'object') { + for (const key of Object.keys(source)) { + const value = source[key]; + if (value != null) { + const valuePath = indexedPathPrefix.length === 0 ? + key : + indexedPathPrefix + '.' + key; + walkSubdocs(value, valuePath, segmentIndex + 1); + } + } + } + return; + } + + const child = source[segment]; + const childPath = indexedPathPrefix.length === 0 ? + segment : + indexedPathPrefix + '.' + segment; + + if (Array.isArray(child)) { + for (let i = 0; i < child.length; ++i) { + if (child[i] != null) { + walkSubdocs(child[i], childPath + '.' + i, segmentIndex + 1); + } + } + } else if (child != null) { + walkSubdocs(child, childPath, segmentIndex + 1); + } + } + } + + const topLevelRefPath = refPath.call(doc, doc, populatePath); + normalizedRefPath = normalizedRefPath || topLevelRefPath; + modelNames.push(...modelNamesFromRefPath(topLevelRefPath, doc, populatePath, modelSchema, queryProjection)); + + return { modelNames, refPath: normalizedRefPath }; +} + +/** + * Resolve model names from a refPath, preferring the indexed populated path + * for array subdocuments and falling back to the original populate path if + * normalization fails. + * + * @param {string|Function} refPath + * @param {Document|object} doc + * @param {string} populatePath + * @param {string} indexedPath + * @param {Schema} modelSchema + * @param {object} queryProjection + * @returns {string[]} + * @private + */ +function _getModelNamesFromRefPath(refPath, doc, populatePath, indexedPath, modelSchema, queryProjection) { + const populatedPath = typeof refPath === 'string' && hasNumericPathSegmentRE.test(refPath) ? + populatePath : + indexedPath; + + try { + return modelNamesFromRefPath(refPath, doc, populatedPath, modelSchema, queryProjection); + } catch (error) { + if (populatedPath === indexedPath && + typeof error?.message === 'string' && + error.message.startsWith('Could not normalize ref path')) { + return modelNamesFromRefPath(refPath, doc, populatePath, modelSchema, queryProjection); + } + throw error; + } +} + +/*! + * ignore + */ + +function _virtualPopulate(model, docs, options, _virtualRes) { + const map = []; + const available = {}; + const virtual = _virtualRes.virtual; + + for (const doc of docs) { + let modelNames = null; + const data = {}; + + // localField and foreignField + let localField; + const virtualPrefix = _virtualRes.nestedSchemaPath ? + _virtualRes.nestedSchemaPath + '.' : ''; + if (typeof options.localField === 'string') { + localField = options.localField; + } else if (typeof virtual.options.localField === 'function') { + localField = virtualPrefix + virtual.options.localField.call(doc, doc); + } else if (Array.isArray(virtual.options.localField)) { + localField = virtual.options.localField.map(field => virtualPrefix + field); + } else { + localField = virtualPrefix + virtual.options.localField; + } + data.count = virtual.options.count; + + if (virtual.options.skip != null && !Object.hasOwn(options, 'skip')) { + options.skip = virtual.options.skip; + } + if (virtual.options.limit != null && !Object.hasOwn(options, 'limit')) { + options.limit = virtual.options.limit; + } + if (virtual.options.perDocumentLimit != null && !Object.hasOwn(options, 'perDocumentLimit')) { + options.perDocumentLimit = virtual.options.perDocumentLimit; + } + let foreignField = virtual.options.foreignField; + + if (!localField || !foreignField) { + return new MongooseError(`Cannot populate virtual \`${options.path}\` on model \`${model.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`); + } + + if (typeof localField === 'function') { + localField = localField.call(doc, doc); + } + if (typeof foreignField === 'function') { + foreignField = foreignField.call(doc, doc); + } + + data.isRefPath = false; + + // `justOne = null` means we don't know from the schema whether the end + // result should be an array or a single doc. This can result from + // populating a POJO using `Model.populate()` + let justOne = null; + if ('justOne' in options && options.justOne !== void 0) { + justOne = options.justOne; + } + + // Use the correct target doc/sub-doc for dynamic ref on nested schema. See gh-12363 + if (_virtualRes.nestedSchemaPath && typeof virtual.options.ref === 'function') { + const subdocs = utils.getValue(_virtualRes.nestedSchemaPath, doc); + modelNames = Array.isArray(subdocs) + ? subdocs.flatMap(subdoc => virtual._getModelNamesForPopulate(subdoc)) + : virtual._getModelNamesForPopulate(subdocs); + } else { + modelNames = virtual._getModelNamesForPopulate(doc); + } + if (virtual.options.refPath) { + justOne = !!virtual.options.justOne; + data.isRefPath = true; + } else if (virtual.options.ref) { + justOne = !!virtual.options.justOne; + } + + data.isVirtual = true; + data.virtual = virtual; + data.justOne = justOne; + + // `match` + const baseMatch = get(data, 'virtual.options.match', null) || + get(data, 'virtual.options.options.match', null); + let match = get(options, 'match', null) || baseMatch; + + let hasMatchFunction = typeof match === 'function'; + if (hasMatchFunction) { + match = match.call(doc, doc, data.virtual); + } + + if (Array.isArray(localField) && Array.isArray(foreignField) && localField.length === foreignField.length) { + match = Object.assign({}, match); + for (let i = 1; i < localField.length; ++i) { + match[foreignField[i]] = convertTo_id(mpath.get(localField[i], doc, lookupLocalFields), model.schema); + hasMatchFunction = true; + } + + localField = localField[0]; + foreignField = foreignField[0]; + } + data.localField = localField; + data.foreignField = foreignField; + data.match = match; + data.hasMatchFunction = hasMatchFunction; + + throwOn$where(match); + + // Get local fields + const ret = _getLocalFieldValues(doc, localField, model, options, virtual); + + try { + addModelNamesToMap(model, map, available, modelNames, options, data, ret, doc); + } catch (err) { + return err; + } + } + + return map; +} + +/*! + * ignore + */ + +function addModelNamesToMap(model, map, available, modelNames, options, data, ret, doc, schemaOptions, unpopulatedValue) { + // `PopulateOptions#connection`: if the model is passed as a string, the + // connection matters because different connections have different models. + const connection = options.connection ?? model.db; + + unpopulatedValue = unpopulatedValue === void 0 ? ret : unpopulatedValue; + if (Array.isArray(unpopulatedValue)) { + unpopulatedValue = utils.cloneArrays(unpopulatedValue); + } + + if (modelNames == null) { + return; + } + + const flatModelNames = utils.array.flatten(modelNames); + let k = flatModelNames.length; + while (k--) { + let modelName = flatModelNames[k]; + if (modelName == null) { + continue; + } + + let Model; + if (options.model && options.model[modelSymbol]) { + Model = options.model; + } else if (modelName[modelSymbol]) { + Model = modelName; + modelName = Model.modelName; + } else { + try { + Model = _getModelFromConn(connection, modelName); + } catch (err) { + if (ret !== void 0) { + throw err; + } + Model = null; + } + } + + let ids = ret; + + const modelNamesForRefPath = data.modelNamesInOrder || modelNames; + if (data.isRefPath && Array.isArray(ret) && ret.length === modelNamesForRefPath.length) { + ids = matchIdsToRefPaths(ret, modelNamesForRefPath, modelName); + } + + if (!available[modelName]) { + const currentOptions = { + model: Model + }; + if (data.isVirtual && get(data.virtual, 'options.options')) { + currentOptions.options = clone(data.virtual.options.options); + } else if (schemaOptions != null) { + currentOptions.options = Object.assign({}, schemaOptions); + } + utils.merge(currentOptions, options); + + // Used internally for checking what model was used to populate this + // path. + options[populateModelSymbol] = Model; + currentOptions[populateModelSymbol] = Model; + available[modelName] = { + model: Model, + options: currentOptions, + match: data.hasMatchFunction ? [data.match] : data.match, + docs: [doc], + ids: [ids], + allIds: [ret], + unpopulatedValues: [unpopulatedValue], + localField: new Set([data.localField]), + foreignField: new Set([data.foreignField]), + justOne: data.justOne, + isVirtual: data.isVirtual, + virtual: data.virtual, + count: data.count, + isRefPath: !!data.isRefPath, + [populateModelSymbol]: Model + }; + map.push(available[modelName]); + } else { + available[modelName].localField.add(data.localField); + available[modelName].foreignField.add(data.foreignField); + available[modelName].docs.push(doc); + available[modelName].ids.push(ids); + available[modelName].allIds.push(ret); + available[modelName].unpopulatedValues.push(unpopulatedValue); + available[modelName].isRefPath = available[modelName].isRefPath || !!data.isRefPath; + if (data.hasMatchFunction) { + available[modelName].match.push(data.match); + } + } + } +} + +function _getModelFromConn(conn, modelName) { + /* If this connection has a parent from `useDb()`, bubble up to parent's models */ + if (conn.models[modelName] == null && conn._parent != null) { + return _getModelFromConn(conn._parent, modelName); + } + + return conn.model(modelName); +} + +function matchIdsToRefPaths(ids, refPaths, refPathToFind) { + if (!Array.isArray(refPaths)) { + return refPaths === refPathToFind + ? Array.isArray(ids) + ? utils.array.flatten(ids) + : [ids] + : []; + } + if (Array.isArray(ids) && Array.isArray(refPaths)) { + return ids.flatMap((id, index) => matchIdsToRefPaths(id, refPaths[index], refPathToFind)); + } + return []; +} + +/*! + * ignore + */ + +function handleRefFunction(ref, doc) { + if (typeof ref === 'function' && !ref[modelSymbol]) { + return ref.call(doc, doc); + } + return ref; +} + +/*! + * ignore + */ + +function _getLocalFieldValues(doc, localField, model, options, virtual, schema) { + // Get Local fields + const localFieldPathType = model.schema._getPathType(localField); + const localFieldPath = localFieldPathType === 'real' ? + model.schema.path(localField) : + localFieldPathType.schema; + const localFieldGetters = localFieldPath?.getters || []; + + localField = localFieldPath?.instance === 'Embedded' ? localField + '._id' : localField; + + const _populateOptions = get(options, 'options', {}); + + const getters = 'getters' in _populateOptions ? + _populateOptions.getters : + get(virtual, 'options.getters', false); + if (localFieldGetters.length !== 0 && getters) { + const hydratedDoc = (doc.$__ != null) ? doc : model.hydrate(doc); + const localFieldValue = utils.getValue(localField, doc); + if (Array.isArray(localFieldValue)) { + const localFieldHydratedValue = utils.getValue(localField.split('.').slice(0, -1), hydratedDoc); + return localFieldValue.map((localFieldArrVal, localFieldArrIndex) => + localFieldPath.applyGetters(localFieldArrVal, localFieldHydratedValue[localFieldArrIndex])); + } else { + return localFieldPath.applyGetters(localFieldValue, hydratedDoc); + } + } else { + return convertTo_id(mpath.get(localField, doc, lookupLocalFields), schema); + } +} + +/** + * Retrieve the _id of `val` if a Document or Array of Documents. + * + * @param {Array|Document|any} val + * @param {Schema} schema + * @return {Array|Document|any} + * @api private + */ + +function convertTo_id(val, schema) { + if (val?.$__ != null) { + return val._doc._id; + } + if (val?._id != null && !schema?.$isSchemaMap) { + return val._id; + } + + if (Array.isArray(val)) { + const rawVal = val.__array ?? val; + for (let i = 0; i < rawVal.length; ++i) { + if (rawVal[i]?.$__ != null) { + rawVal[i] = rawVal[i]._doc._id; + } + } + if (utils.isMongooseArray(val) && val.$schema()) { + return val.$schema()._castForPopulate(val, val.$parent()); + } + + return [].concat(val); + } + + // `populate('map')` may be an object if populating on a doc that hasn't + // been hydrated yet + if (getConstructorName(val) === 'Object' && + // The intent here is we should only flatten the object if we expect + // to get a Map in the end. Avoid doing this for mixed types. + schema?.[schemaMixedSymbol] == null) { + const ret = []; + for (const key of Object.keys(val)) { + ret.push(val[key]); + } + return ret; + } + // If doc has already been hydrated, e.g. `doc.populate('map')` + // then `val` will already be a map + if (val instanceof Map) { + return Array.from(val.values()); + } + + return val; +} + +/*! + * ignore + */ + +function _findRefPathForDiscriminators(doc, modelSchema, data, options, normalizedRefPath, ret) { + // Re: gh-8452. Embedded discriminators may not have `refPath`, so clear + // out embedded discriminator docs that don't have a `refPath` on the + // populated path. + if (!data.isRefPath || normalizedRefPath == null) { + return; + } + + const pieces = normalizedRefPath.split('.'); + let cur = ''; + let modelNames = void 0; + for (let i = 0; i < pieces.length; ++i) { + const piece = pieces[i]; + cur = cur + (cur.length === 0 ? '' : '.') + piece; + const schematype = modelSchema.path(cur); + if (schematype != null && + schematype.$isMongooseDocumentArray && + schematype.Constructor.discriminators != null && + utils.hasOwnKeys(schematype.Constructor.discriminators)) { + const subdocs = utils.getValue(cur, doc); + const remnant = options.path.substring(cur.length + 1); + const discriminatorKey = schematype.Constructor.schema.options.discriminatorKey; + modelNames = []; + for (const subdoc of subdocs) { + const discriminatorName = utils.getValue(discriminatorKey, subdoc); + const discriminator = schematype.Constructor.discriminators[discriminatorName]; + const discriminatorSchema = discriminator?.schema; + if (discriminatorSchema == null) { + continue; + } + const _path = discriminatorSchema.path(remnant); + if (_path == null || _path.options.refPath == null) { + const docValue = utils.getValue(data.localField.substring(cur.length + 1), subdoc); + ret.forEach((v, i) => { + if (v === docValue) { + ret[i] = SkipPopulateValue(v); + } + }); + continue; + } + const modelName = utils.getValue(pieces.slice(i + 1).join('.'), subdoc); + modelNames.push(modelName); + } + } + } + + return modelNames; +} + +/** + * Throw an error if there are any $where keys to defend against [CVE-2024-53900](https://nvd.nist.gov/vuln/detail/CVE-2024-53900) + * + * Note that this is ONLY for $where because sift executes $where in Node.js memory. + * Other forms of MongoDB server-side execution, like $expr, are NOT filtered out. + * This function is not meant to protect against server-side execution in MongoDB. + */ + +function throwOn$where(match) { + if (match == null) { + return; + } + if (typeof match !== 'object') { + return; + } + for (const key of Object.keys(match)) { + if (key === '$where') { + throw new MongooseError('Cannot use $where filter with populate() match'); + } + if (match[key] != null && typeof match[key] === 'object') { + throwOn$where(match[key]); + } + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js new file mode 100644 index 00000000..4887b2bc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js @@ -0,0 +1,229 @@ +'use strict'; + +/*! + * ignore + */ + +const Mixed = require('../../schema/mixed'); +const get = require('../get'); +const getDiscriminatorByValue = require('../discriminator/getDiscriminatorByValue'); +const leanPopulateMap = require('./leanPopulateMap'); +const mpath = require('mpath'); + +const populateModelSymbol = require('../symbols').populateModelSymbol; + +/** + * Given a model and its schema, find all possible schema types for `path`, + * including searching through discriminators. If `doc` is specified, will + * use the doc's values for discriminator keys when searching, otherwise + * will search all discriminators. + * + * @param {Model} model + * @param {Schema} schema + * @param {object} doc POJO + * @param {string} path + * @param {string[]} [parts] pass in pre-split `path` to avoid extra splitting + * @api private + */ + +module.exports = function getSchemaTypes(model, schema, doc, path, parts) { + const pathschema = schema.path(path); + const topLevelDoc = doc; + if (pathschema) { + return pathschema; + } + + const discriminatorKey = schema.discriminatorMapping?.key; + if (discriminatorKey && model != null) { + if (doc?.[discriminatorKey] != null) { + const discriminator = getDiscriminatorByValue(model.discriminators, doc[discriminatorKey]); + schema = discriminator?.schema || schema; + } else if (model.discriminators != null) { + return Object.keys(model.discriminators).reduce((arr, name) => { + const disc = model.discriminators[name]; + return arr.concat(getSchemaTypes(disc, disc.schema, null, path)); + }, []); + } + } + + function search(parts, schema, subdoc, nestedPath) { + let p = parts.length + 1; + let foundschema; + let trypath; + + while (p--) { + trypath = parts.slice(0, p).join('.'); + foundschema = schema.path(trypath); + if (foundschema == null) { + continue; + } + + if (foundschema.embeddedSchemaType || foundschema.schema) { + // array of Mixed? + if (foundschema.embeddedSchemaType instanceof Mixed) { + return foundschema.embeddedSchemaType; + } + + let schemas = null; + if (foundschema.schema?.discriminators != null) { + const discriminators = foundschema.schema.discriminators; + const discriminatorKeyPath = trypath + '.' + + foundschema.schema.options.discriminatorKey; + const keys = subdoc ? mpath.get(discriminatorKeyPath, subdoc) || [] : []; + schemas = Object.keys(discriminators). + reduce(function(cur, discriminator) { + const tiedValue = discriminators[discriminator].discriminatorMapping.value; + if (doc == null || keys.indexOf(discriminator) !== -1 || keys.indexOf(tiedValue) !== -1) { + cur.push(discriminators[discriminator]); + } + return cur; + }, []); + } + + // Now that we found the array, we need to check if there + // are remaining document paths to look up for casting. + // Also we need to handle array.$.path since schema.path + // doesn't work for that. + // If there is no foundschema.schema we are dealing with + // a path like array.$ + if (p !== parts.length && foundschema.schema) { + let ret; + if (parts[p] === '$') { + if (p + 1 === parts.length) { + // comments.$ + return foundschema; + } + // comments.$.comments.$.title + ret = search( + parts.slice(p + 1), + schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || + (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + + if (schemas != null && schemas.length > 0) { + ret = []; + for (const schema of schemas) { + const _ret = search( + parts.slice(p), + schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + if (_ret != null) { + _ret.$parentSchemaDocArray = _ret.$parentSchemaDocArray || + (foundschema.schema.$isSingleNested ? null : foundschema); + if (_ret.$parentSchemaDocArray) { + ret.$parentSchemaDocArray = _ret.$parentSchemaDocArray; + } + ret.push(_ret); + } + } + return ret; + } else { + ret = search( + parts.slice(p), + foundschema.schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || + (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + } else if (p !== parts.length && + foundschema.$isMongooseArray && + foundschema.embeddedSchemaType.$isMongooseArray) { + // Nested arrays. Drill down to the bottom of the nested array. + let type = foundschema; + while (type.$isMongooseArray && !type.$isMongooseDocumentArray) { + type = type.embeddedSchemaType; + } + + const ret = search( + parts.slice(p), + type.schema, + null, + nestedPath.concat(parts.slice(0, p)) + ); + if (ret != null) { + return ret; + } + + if (type.schema.discriminators) { + const discriminatorPaths = []; + for (const discriminatorName of Object.keys(type.schema.discriminators)) { + const _schema = type.schema.discriminators[discriminatorName] || type.schema; + const ret = search(parts.slice(p), _schema, null, nestedPath.concat(parts.slice(0, p))); + if (ret != null) { + discriminatorPaths.push(ret); + } + } + if (discriminatorPaths.length > 0) { + return discriminatorPaths; + } + } + } + } else if (foundschema.$isSchemaMap && foundschema.$__schemaType instanceof Mixed) { + return foundschema.$__schemaType; + } + + const fullPath = nestedPath.concat([trypath]).join('.'); + if (topLevelDoc?.$__ && topLevelDoc.$populated(fullPath, true) && p < parts.length) { + const model = topLevelDoc.$populated(fullPath, true).options[populateModelSymbol]; + if (model != null) { + const ret = search( + parts.slice(p), + model.schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + + return ret; + } + } + + const _val = get(topLevelDoc, trypath); + if (_val != null) { + const model = Array.isArray(_val) && _val.length > 0 ? + leanPopulateMap.get(_val[0]) : + leanPopulateMap.get(_val); + // Populated using lean, `leanPopulateMap` value is the foreign model + const schema = model?.schema ?? null; + if (schema != null) { + const ret = search( + parts.slice(p), + schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + + if (ret != null) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || + (schema.$isSingleNested ? null : schema); + return ret; + } + } + } + return foundschema; + } + } + // look for arrays + parts = parts || path.split('.'); + for (let i = 0; i < parts.length; ++i) { + if (parts[i] === '$') { + // Re: gh-5628, because `schema.path()` doesn't take $ into account. + parts[i] = '0'; + } + } + return search(parts, schema, doc, []); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getVirtual.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getVirtual.js new file mode 100644 index 00000000..00f958e0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/getVirtual.js @@ -0,0 +1,103 @@ +'use strict'; + +module.exports = getVirtual; + +/*! + * ignore + */ + +function getVirtual(schema, name) { + if (schema.virtuals[name]) { + return { virtual: schema.virtuals[name], path: void 0 }; + } + + const parts = name.split('.'); + let cur = ''; + let nestedSchemaPath = ''; + for (let i = 0; i < parts.length; ++i) { + cur += (cur.length > 0 ? '.' : '') + parts[i]; + if (schema.virtuals[cur]) { + if (i === parts.length - 1) { + return { virtual: schema.virtuals[cur], path: nestedSchemaPath }; + } + continue; + } + + if (schema.nested[cur]) { + continue; + } + + if (schema.paths[cur] && schema.paths[cur].schema) { + schema = schema.paths[cur].schema; + const rest = parts.slice(i + 1).join('.'); + + if (schema.virtuals[rest]) { + if (i === parts.length - 2) { + return { + virtual: schema.virtuals[rest], + nestedSchemaPath: [nestedSchemaPath, cur].filter(v => !!v).join('.') + }; + } + continue; + } + + if (i + 1 < parts.length && schema.discriminators) { + for (const key of Object.keys(schema.discriminators)) { + const res = getVirtual(schema.discriminators[key], rest); + if (res != null) { + const _path = [nestedSchemaPath, cur, res.nestedSchemaPath]. + filter(v => !!v).join('.'); + return { + virtual: res.virtual, + nestedSchemaPath: _path + }; + } + } + } + + nestedSchemaPath += (nestedSchemaPath.length > 0 ? '.' : '') + cur; + cur = ''; + continue; + } else if (schema.paths[cur]?.$isSchemaMap && schema.paths[cur].$__schemaType?.schema) { + schema = schema.paths[cur].$__schemaType.schema; + ++i; + const rest = parts.slice(i + 1).join('.'); + + if (schema.virtuals[rest]) { + if (i === parts.length - 2) { + return { + virtual: schema.virtuals[rest], + nestedSchemaPath: [nestedSchemaPath, cur, '$*'].filter(v => !!v).join('.') + }; + } + continue; + } + + if (i + 1 < parts.length && schema.discriminators) { + for (const key of Object.keys(schema.discriminators)) { + const res = getVirtual(schema.discriminators[key], rest); + if (res != null) { + const _path = [nestedSchemaPath, cur, res.nestedSchemaPath, '$*']. + filter(v => !!v).join('.'); + return { + virtual: res.virtual, + nestedSchemaPath: _path + }; + } + } + } + + nestedSchemaPath += (nestedSchemaPath.length > 0 ? '.' : '') + '$*' + cur; + cur = ''; + } + + if (schema.discriminators) { + for (const discriminatorKey of Object.keys(schema.discriminators)) { + const virtualFromDiscriminator = getVirtual(schema.discriminators[discriminatorKey], name); + if (virtualFromDiscriminator) return virtualFromDiscriminator; + } + } + + return null; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js new file mode 100644 index 00000000..9ff9b135 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js @@ -0,0 +1,7 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = new WeakMap(); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js new file mode 100644 index 00000000..b85d8d75 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js @@ -0,0 +1,40 @@ +'use strict'; + +module.exports = function lookupLocalFields(cur, path, val) { + if (cur == null) { + return cur; + } + + if (cur._doc != null) { + cur = cur._doc; + } + + if (arguments.length >= 3) { + if (typeof cur !== 'object') { + return void 0; + } + if (val === void 0) { + return void 0; + } + if (cur instanceof Map) { + cur.set(path, val); + } else { + cur[path] = val; + } + return val; + } + + + // Support populating paths under maps using `map.$*.subpath` + if (path === '$*') { + return cur instanceof Map ? + Array.from(cur.values()) : + Object.keys(cur).map(key => cur[key]); + } + + if (cur instanceof Map) { + return cur.get(path); + } + + return cur[path]; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js new file mode 100644 index 00000000..59673852 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js @@ -0,0 +1,49 @@ +'use strict'; + +const utils = require('../../utils'); + +/** + * If populating a path within a document array, make sure each + * subdoc within the array knows its subpaths are populated. + * + * #### Example: + * + * const doc = await Article.findOne().populate('comments.author'); + * doc.comments[0].populated('author'); // Should be set + * + * @param {Document} doc + * @param {object} [populated] + * @api private + */ + +module.exports = function markArraySubdocsPopulated(doc, populated) { + if (doc._doc._id == null || populated == null || populated.length === 0) { + return; + } + + const id = String(doc._doc._id); + for (const item of populated) { + if (item.isVirtual) { + continue; + } + const path = item.path; + const pieces = path.split('.'); + for (let i = 0; i < pieces.length - 1; ++i) { + const subpath = pieces.slice(0, i + 1).join('.'); + const rest = pieces.slice(i + 1).join('.'); + const val = doc.get(subpath); + if (val == null) { + continue; + } + + if (utils.isMongooseDocumentArray(val)) { + for (let j = 0; j < val.length; ++j) { + if (val[j]) { + val[j].populated(rest, item._docs[id] == null ? void 0 : item._docs[id][j], item); + } + } + break; + } + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js new file mode 100644 index 00000000..ff8a1a03 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js @@ -0,0 +1,74 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); +const isPathExcluded = require('../projection/isPathExcluded'); +const lookupLocalFields = require('./lookupLocalFields'); +const mpath = require('mpath'); +const util = require('util'); +const utils = require('../../utils'); + +const hasNumericPropRE = /(\.\d+$|\.\d+\.)/g; + +module.exports = function modelNamesFromRefPath(refPath, doc, populatedPath, modelSchema, queryProjection) { + if (refPath == null) { + return []; + } + + if (typeof refPath !== 'string') { + throw new MongooseError('`refPath` must be a string or a function that returns a string, got ' + util.inspect(refPath)); + } + + if (queryProjection != null && isPathExcluded(queryProjection, refPath)) { + throw new MongooseError('refPath `' + refPath + '` must not be excluded in projection, got ' + + util.inspect(queryProjection)); + } + + // If populated path has numerics, the end `refPath` should too. For example, + // if populating `a.0.b` instead of `a.b` and `b` has `refPath = a.c`, we + // should return `a.0.c` for the refPath. + + if (hasNumericPropRE.test(populatedPath)) { + const chunks = populatedPath.split(hasNumericPropRE); + + if (chunks[chunks.length - 1] === '') { + throw new Error('Can\'t populate individual element in an array'); + } + + let _refPath = ''; + let _remaining = refPath; + // 2nd, 4th, etc. will be numeric props. For example: `[ 'a', '.0.', 'b' ]` + for (let i = 0; i < chunks.length; i += 2) { + const chunk = chunks[i]; + if ( + _remaining.length >= chunk.length + 1 && + _remaining.charAt(chunk.length) === '.' && + _remaining.slice(0, chunk.length) === chunk + ) { + _refPath += _remaining.substring(0, chunk.length) + chunks[i + 1]; + _remaining = _remaining.substring(chunk.length + 1); + } else if (i === chunks.length - 1) { + _refPath += _remaining; + _remaining = ''; + break; + } else { + throw new Error('Could not normalize ref path, chunk ' + chunk + ' not in populated path'); + } + } + + const refValue = mpath.get(_refPath, doc, lookupLocalFields); + let modelNames = Array.isArray(refValue) ? refValue : [refValue]; + modelNames = utils.array.flatten(modelNames); + return modelNames; + } + + const refValue = mpath.get(refPath, doc, lookupLocalFields); + + let modelNames; + if (modelSchema != null && Object.hasOwn(modelSchema.virtuals, refPath)) { + modelNames = [modelSchema.virtuals[refPath].applyGetters(void 0, doc)]; + } else { + modelNames = Array.isArray(refValue) ? refValue : [refValue]; + } + + return modelNames; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js new file mode 100644 index 00000000..069adec7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js @@ -0,0 +1,31 @@ +'use strict'; + +const get = require('../get'); +const mpath = require('mpath'); +const parseProjection = require('../projection/parseProjection'); + +/*! + * ignore + */ + +module.exports = function removeDeselectedForeignField(foreignFields, options, docs) { + const projection = parseProjection(get(options, 'select', null), true) || + parseProjection(get(options, 'options.select', null), true); + + if (projection == null) { + return; + } + for (const foreignField of foreignFields) { + if (!Object.hasOwn(projection, '-' + foreignField)) { + continue; + } + + for (const val of docs) { + if (val.$__ != null) { + mpath.unset(foreignField, val._doc); + } else { + mpath.unset(foreignField, val); + } + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js new file mode 100644 index 00000000..c629ab1f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js @@ -0,0 +1,33 @@ +'use strict'; + +/** + * Set a populated virtual value on a document's `$$populatedVirtuals` value + * + * @param {object} populatedVirtuals A document's `$$populatedVirtuals` + * @param {string} name The virtual name + * @param {any} v The result of the populate query + * @param {object} options The populate options. This function handles `justOne` and `count` options. + * @returns {Document[]|Document|object|object[]} the populated virtual value that was set + */ + +module.exports = function setPopulatedVirtualValue(populatedVirtuals, name, v, options) { + if (options.justOne || options.count) { + populatedVirtuals[name] = Array.isArray(v) ? + v[0] : + v; + + if (typeof populatedVirtuals[name] !== 'object') { + populatedVirtuals[name] = options.count ? v : null; + } + } else { + populatedVirtuals[name] = Array.isArray(v) ? + v : + v == null ? [] : [v]; + + populatedVirtuals[name] = populatedVirtuals[name].filter(function(doc) { + return doc && typeof doc === 'object'; + }); + } + + return populatedVirtuals[name]; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js new file mode 100644 index 00000000..38f3f390 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function SkipPopulateValue(val) { + if (!(this instanceof SkipPopulateValue)) { + return new SkipPopulateValue(val); + } + + this.val = val; + return this; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/splitPopulateQuery.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/splitPopulateQuery.js new file mode 100644 index 00000000..bb1044b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/splitPopulateQuery.js @@ -0,0 +1,81 @@ +'use strict'; + +const createPopulateQueryFilter = require('./createPopulateQueryFilter'); +const get = require('../get'); +const utils = require('../../utils'); + +module.exports = splitPopulateQuery; + +/*! + * If a single populate query would have more than this many elements in its `$in` filter, + * Mongoose splits the populate into a separate query per document to avoid going over + * MongoDB's 16 MB BSON size limit on queries. Overwritable for testing purposes. See gh-5890. + */ + +splitPopulateQuery.maxInFilterLength = 50000; + +/*! + * Split a populate models-map entry into a separate query per document if either: + * + * 1. The `perDocumentLimit` option is set, so each document needs its own query with its + * own `limit` (gh-7318), or + * 2. A single populate query for `mod` would have too many elements in its `$in` filter + * (gh-5890). With multiple foreign fields, `createPopulateQueryFilter()` repeats the ids + * under `$or` once per foreign field, so the threshold counts one copy of `ids` per + * foreign field. + * + * Returns a list of `[mod, match, select, assignmentOpts]` params, one per document, for + * `_execPopulateQuery()`. Returns `null` if the populate query doesn't need to be split. + * A `null` `match` means the document has no ids to query: `_execPopulateQuery()` skips + * executing a query, and `_assign()` just sets the document's populated path to the + * default value. + * + * Splitting on document boundaries means each document's populated value is the result of + * exactly one query, so split entries can typically be assigned from only their own query's + * results (`_assignFromOwnResults`) rather than scanning every populate query's results. + * refPath is the exception: a single document's array can contain ids for multiple models, + * so assigning refPath populate results relies on every query's results being available for + * every document. refPath entries are therefore only split when `perDocumentLimit` requires + * it, not to keep the `$in` filter small. A single document whose ids alone overflow the + * BSON size limit cannot be split. + */ + +function splitPopulateQuery(mod, ids, select, assignmentOpts) { + if (mod.docs.length <= 1) { + return null; + } + const perDocumentLimit = mod.options.perDocumentLimit == null ? + get(mod.options, 'options.perDocumentLimit', null) : + mod.options.perDocumentLimit; + const numInFilterElements = ids.length * mod.foreignField.size; + if (perDocumentLimit == null && (numInFilterElements <= splitPopulateQuery.maxInFilterLength || mod.isRefPath)) { + return null; + } + + return mod.docs.map((doc, i) => { + const subMod = { + ...mod, + docs: [doc], + ids: [mod.ids[i]], + allIds: [mod.allIds[i]], + unpopulatedValues: [mod.unpopulatedValues[i]], + match: Array.isArray(mod.match) ? [mod.match[i]] : mod.match, + _assignFromOwnResults: !mod.isRefPath + }; + let subIds = utils.array.flatten(subMod.ids, flatten); + subIds = utils.array.unique(subIds); + const match = subIds.length === 0 || subIds.every(utils.isNullOrUndefined) ? + null : + createPopulateQueryFilter(subIds, subMod.match, subMod.foreignField, subMod.model, subMod.options.skipInvalidIds); + return [subMod, match, select, assignmentOpts]; + }); +} + +/*! + * ignore + */ + +function flatten(item) { + // no need to include undefined values in our query + return undefined !== item; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/validateRef.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/validateRef.js new file mode 100644 index 00000000..2b58e166 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/populate/validateRef.js @@ -0,0 +1,19 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); +const util = require('util'); + +module.exports = validateRef; + +function validateRef(ref, path) { + if (typeof ref === 'string') { + return; + } + + if (typeof ref === 'function') { + return; + } + + throw new MongooseError('Invalid ref at path "' + path + '". Got ' + + util.inspect(ref, { depth: 0 })); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/printJestWarning.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/printJestWarning.js new file mode 100644 index 00000000..c0c9a0a2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/printJestWarning.js @@ -0,0 +1,21 @@ +'use strict'; + +const utils = require('../utils'); + +if (typeof jest !== 'undefined' && !process.env.SUPPRESS_JEST_WARNINGS) { + if (typeof window !== 'undefined') { + utils.warn('Mongoose: looks like you\'re trying to test a Mongoose app ' + + 'with Jest\'s default jsdom test environment. Please make sure you read ' + + 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' + + 'https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true ' + + 'to hide this warning.'); + } + + if (typeof setTimeout.clock?.Date === 'function') { + utils.warn('Mongoose: looks like you\'re trying to test a Mongoose app ' + + 'with Jest\'s mock timers enabled. Please make sure you read ' + + 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' + + 'https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true ' + + 'to hide this warning.'); + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/processConnectionOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/processConnectionOptions.js new file mode 100644 index 00000000..e99f951e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/processConnectionOptions.js @@ -0,0 +1,65 @@ +'use strict'; + +const clone = require('./clone'); +const MongooseError = require('../error/index'); + +function processConnectionOptions(uri, options) { + const opts = options ? options : {}; + const readPreference = opts.readPreference + ? opts.readPreference + : getUriReadPreference(uri); + + const clonedOpts = clone(opts); + const resolvedOpts = (readPreference && readPreference !== 'primary' && readPreference !== 'primaryPreferred') + ? resolveOptsConflicts(readPreference, clonedOpts) + : clonedOpts; + + return resolvedOpts; +} + +function resolveOptsConflicts(pref, opts) { + // don't silently override user-provided indexing options + if (setsIndexOptions(opts) && setsSecondaryRead(pref)) { + throwReadPreferenceError(); + } + + // if user has not explicitly set any auto-indexing options, + // we can silently default them all to false + else { + return defaultIndexOptsToFalse(opts); + } +} + +function setsIndexOptions(opts) { + const configIdx = opts.config?.autoIndex; + const { autoCreate, autoIndex } = opts; + return !!(configIdx || autoCreate || autoIndex); +} + +function setsSecondaryRead(prefString) { + return !!(prefString === 'secondary' || prefString === 'secondaryPreferred'); +} + +function getUriReadPreference(connectionString) { + const exp = /(?:&|\?)readPreference=(\w+)(?:&|$)/; + const match = exp.exec(connectionString); + return match ? match[1] : null; +} + +function defaultIndexOptsToFalse(opts) { + opts.config = { autoIndex: false }; + opts.autoCreate = false; + opts.autoIndex = false; + return opts; +} + +function throwReadPreferenceError() { + throw new MongooseError( + 'MongoDB prohibits index creation on connections that read from ' + + 'non-primary replicas. Connections that set "readPreference" to "secondary" or ' + + '"secondaryPreferred" may not opt-in to the following connection options: ' + + 'autoCreate, autoIndex' + ); +} + +module.exports = processConnectionOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/applyProjection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/applyProjection.js new file mode 100644 index 00000000..7b8b1a3d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/applyProjection.js @@ -0,0 +1,83 @@ +'use strict'; + +const hasIncludedChildren = require('./hasIncludedChildren'); +const isExclusive = require('./isExclusive'); +const isInclusive = require('./isInclusive'); +const isPOJO = require('../../utils').isPOJO; + +module.exports = function applyProjection(doc, projection, _hasIncludedChildren) { + if (projection == null) { + return doc; + } + if (doc == null) { + return doc; + } + + let exclude = null; + if (isInclusive(projection)) { + exclude = false; + } else if (isExclusive(projection)) { + exclude = true; + } + + if (exclude == null) { + return doc; + } else if (exclude) { + _hasIncludedChildren = _hasIncludedChildren || hasIncludedChildren(projection); + return applyExclusiveProjection(doc, projection, _hasIncludedChildren); + } else { + _hasIncludedChildren = _hasIncludedChildren || hasIncludedChildren(projection); + return applyInclusiveProjection(doc, projection, _hasIncludedChildren); + } +}; + +function applyExclusiveProjection(doc, projection, hasIncludedChildren, projectionLimb, prefix) { + if (doc == null || typeof doc !== 'object') { + return doc; + } + if (Array.isArray(doc)) { + return doc.map(el => applyExclusiveProjection(el, projection, hasIncludedChildren, projectionLimb, prefix)); + } + const ret = { ...doc }; + projectionLimb = prefix ? (projectionLimb || {}) : projection; + + for (const key of Object.keys(ret)) { + const fullPath = prefix ? prefix + '.' + key : key; + if (Object.hasOwn(projection, fullPath) || Object.hasOwn(projectionLimb, key)) { + if (isPOJO(projection[fullPath]) || isPOJO(projectionLimb[key])) { + ret[key] = applyExclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } else { + delete ret[key]; + } + } else if (hasIncludedChildren[fullPath]) { + ret[key] = applyExclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } + } + return ret; +} + +function applyInclusiveProjection(doc, projection, hasIncludedChildren, projectionLimb, prefix) { + if (doc == null || typeof doc !== 'object') { + return doc; + } + if (Array.isArray(doc)) { + return doc.map(el => applyInclusiveProjection(el, projection, hasIncludedChildren, projectionLimb, prefix)); + } + const ret = { ...doc }; + projectionLimb = prefix ? (projectionLimb || {}) : projection; + + for (const key of Object.keys(ret)) { + const fullPath = prefix ? prefix + '.' + key : key; + if (Object.hasOwn(projection, fullPath) || Object.hasOwn(projectionLimb, key)) { + if (isPOJO(projection[fullPath]) || isPOJO(projectionLimb[key])) { + ret[key] = applyInclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } + continue; + } else if (hasIncludedChildren[fullPath]) { + ret[key] = applyInclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } else { + delete ret[key]; + } + } + return ret; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js new file mode 100644 index 00000000..8198345f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js @@ -0,0 +1,41 @@ +'use strict'; + +/** + * Creates an object that precomputes whether a given path has child fields in + * the projection. + * + * #### Example: + * + * const res = hasIncludedChildren({ 'a.b.c': 0 }); + * res.a; // 1 + * res['a.b']; // 1 + * res['a.b.c']; // 1 + * res['a.c']; // undefined + * + * @param {object} fields + * @api private + */ + +module.exports = function hasIncludedChildren(fields) { + const hasIncludedChildren = {}; + const keys = Object.keys(fields); + + for (const key of keys) { + + if (key.indexOf('.') === -1) { + hasIncludedChildren[key] = 1; + continue; + } + const parts = key.split('.'); + let c = parts[0]; + + for (let i = 0; i < parts.length; ++i) { + hasIncludedChildren[c] = 1; + if (i + 1 < parts.length) { + c = c + '.' + parts[i + 1]; + } + } + } + + return hasIncludedChildren; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js new file mode 100644 index 00000000..67dfb39f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js @@ -0,0 +1,18 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function isDefiningProjection(val) { + if (val == null) { + // `undefined` or `null` become exclusive projections + return true; + } + if (typeof val === 'object') { + // Only cases where a value does **not** define whether the whole projection + // is inclusive or exclusive are `$meta` and `$slice`. + return !('$meta' in val) && !('$slice' in val); + } + return true; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isExclusive.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isExclusive.js new file mode 100644 index 00000000..e6ca3cad --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isExclusive.js @@ -0,0 +1,37 @@ +'use strict'; + +const isDefiningProjection = require('./isDefiningProjection'); +const isPOJO = require('../isPOJO'); + +/*! + * ignore + */ + +module.exports = function isExclusive(projection) { + if (projection == null) { + return null; + } + + const keys = Object.keys(projection); + let exclude = null; + + if (keys.length === 1 && keys[0] === '_id') { + exclude = !projection._id; + } else { + for (let ki = 0; ki < keys.length; ++ki) { + // Does this projection explicitly define inclusion/exclusion? + // Explicitly avoid `$meta` and `$slice` + const key = keys[ki]; + if (key !== '_id' && isDefiningProjection(projection[key])) { + exclude = isPOJO(projection[key]) ? + (isExclusive(projection[key]) ?? exclude) : + !projection[key]; + if (exclude != null) { + break; + } + } + } + } + + return exclude; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isInclusive.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isInclusive.js new file mode 100644 index 00000000..c53bac02 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isInclusive.js @@ -0,0 +1,39 @@ +'use strict'; + +const isDefiningProjection = require('./isDefiningProjection'); +const isPOJO = require('../isPOJO'); + +/*! + * ignore + */ + +module.exports = function isInclusive(projection) { + if (projection == null) { + return false; + } + + const props = Object.keys(projection); + const numProps = props.length; + if (numProps === 0) { + return false; + } + + for (let i = 0; i < numProps; ++i) { + const prop = props[i]; + // Plus paths can't define the projection (see gh-7050) + if (prop.startsWith('+')) { + continue; + } + // If field is truthy (1, true, etc.) and not an object, then this + // projection must be inclusive. If object, assume its $meta, $slice, etc. + if (isDefiningProjection(projection[prop]) && !!projection[prop]) { + if (isPOJO(projection[prop])) { + return isInclusive(projection[prop]); + } else { + return !!projection[prop]; + } + } + } + + return false; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js new file mode 100644 index 00000000..f53d9cdd --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function isNestedProjection(val) { + if (val == null || typeof val !== 'object') { + return false; + } + return val.$slice == null && val.$elemMatch == null && val.$meta == null && val.$ == null; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js new file mode 100644 index 00000000..698e1c43 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js @@ -0,0 +1,40 @@ +'use strict'; + +const isDefiningProjection = require('./isDefiningProjection'); + +/** + * Determines if `path` is excluded by `projection` + * + * @param {object} projection + * @param {string} path + * @return {boolean} + * @api private + */ + +module.exports = function isPathExcluded(projection, path) { + if (projection == null) { + return false; + } + + if (path === '_id') { + return projection._id === 0; + } + + const paths = Object.keys(projection); + let type = null; + + for (const _path of paths) { + if (isDefiningProjection(projection[_path])) { + type = projection[path] === 1 ? 'inclusive' : 'exclusive'; + break; + } + } + + if (type === 'inclusive') { + return projection[path] !== 1; + } + if (type === 'exclusive') { + return projection[path] === 0; + } + return false; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js new file mode 100644 index 00000000..5951d9fb --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js @@ -0,0 +1,18 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function isPathSelectedInclusive(fields, path) { + const chunks = path.split('.'); + let cur = ''; + for (let i = 0; i < chunks.length; ++i) { + cur += cur.length ? '.' + chunks[i] : chunks[i]; + if (fields[cur]) { + return true; + } + } + + return false; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isSubpath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isSubpath.js new file mode 100644 index 00000000..635065df --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/isSubpath.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines if `path2` is a subpath of or equal to `path1` + * + * @param {string} path1 + * @param {string} path2 + * @return {boolean} + * @api private + */ + +module.exports = function isSubpath(path1, path2) { + return path1 === path2 || path2.startsWith(path1 + '.'); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/parseProjection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/parseProjection.js new file mode 100644 index 00000000..432de16a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/projection/parseProjection.js @@ -0,0 +1,38 @@ +'use strict'; + +/** + * Convert a string or array into a projection object. Treats `-foo` as + * equivalent to `foo: 0` depending on `retainMinusPaths`. If `retainMinusPaths` + * is true, then `-foo` will be included in the projection as `'-foo': 0`. + * + * @param {object|string|string[]} v + * @param {boolean} [retainMinusPaths] + * @return {object} + */ + +module.exports = function parseProjection(v, retainMinusPaths) { + const type = typeof v; + + if (type === 'string') { + v = v.split(/\s+/); + } + if (!Array.isArray(v) && Object.prototype.toString.call(v) !== '[object Arguments]') { + return v; + } + + const len = v.length; + const ret = {}; + for (let i = 0; i < len; ++i) { + let field = v[i]; + if (!field) { + continue; + } + const include = field.charAt(0) === '-' ? 0 : 1; + if (!retainMinusPaths && include === 0) { + field = field.slice(1); + } + ret[field] = include; + } + + return ret; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js new file mode 100644 index 00000000..e93fa73d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js @@ -0,0 +1,29 @@ +'use strict'; + +const utils = require('../../utils'); + +function applyGlobalMaxTimeMS(options, connectionOptions, baseOptions) { + applyGlobalOption(options, connectionOptions, baseOptions, 'maxTimeMS'); +} + +function applyGlobalDiskUse(options, connectionOptions, baseOptions) { + applyGlobalOption(options, connectionOptions, baseOptions, 'allowDiskUse'); +} + +module.exports = { + applyGlobalMaxTimeMS, + applyGlobalDiskUse +}; + + +function applyGlobalOption(options, connectionOptions, baseOptions, optionName) { + if (utils.hasUserDefinedProperty(options, optionName)) { + return; + } + + if (utils.hasUserDefinedProperty(connectionOptions, optionName)) { + options[optionName] = connectionOptions[optionName]; + } else if (utils.hasUserDefinedProperty(baseOptions, optionName)) { + options[optionName] = baseOptions[optionName]; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/cast$expr.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/cast$expr.js new file mode 100644 index 00000000..d78fb445 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/cast$expr.js @@ -0,0 +1,287 @@ +'use strict'; + +const CastError = require('../../error/cast'); +const StrictModeError = require('../../error/strict'); +const castNumber = require('../../cast/number'); +const omitUndefined = require('../omitUndefined'); + +const booleanComparison = new Set(['$and', '$or']); +const comparisonOperator = new Set(['$cmp', '$eq', '$lt', '$lte', '$gt', '$gte']); +const arithmeticOperatorArray = new Set([ + // avoid casting '$add' or '$subtract', because expressions can be either number or date, + // and we don't have a good way of inferring which arguments should be numbers and which should + // be dates. + '$multiply', + '$divide', + '$log', + '$mod', + '$trunc', + '$avg', + '$max', + '$min', + '$stdDevPop', + '$stdDevSamp', + '$sum' +]); +const arithmeticOperatorNumber = new Set([ + '$abs', + '$exp', + '$ceil', + '$floor', + '$ln', + '$log10', + '$sqrt', + '$sin', + '$cos', + '$tan', + '$asin', + '$acos', + '$atan', + '$atan2', + '$asinh', + '$acosh', + '$atanh', + '$sinh', + '$cosh', + '$tanh', + '$degreesToRadians', + '$radiansToDegrees' +]); +const arrayElementOperators = new Set([ + '$arrayElemAt', + '$first', + '$last' +]); +const dateOperators = new Set([ + '$year', + '$month', + '$week', + '$dayOfMonth', + '$dayOfYear', + '$hour', + '$minute', + '$second', + '$isoDayOfWeek', + '$isoWeekYear', + '$isoWeek', + '$millisecond' +]); +const expressionOperator = new Set(['$not']); + +module.exports = function cast$expr(val, schema, strictQuery) { + if (typeof val === 'boolean') { + return val; + } + if (typeof val !== 'object' || val === null) { + throw new Error('`$expr` must be an object or boolean literal'); + } + + return _castExpression(val, schema, strictQuery); +}; + +function _castExpression(val, schema, strictQuery) { + // Preserve the value if it represents a path or if it's null + if (isPath(val) || val === null) { + return val; + } + + if (val.$cond != null) { + if (Array.isArray(val.$cond)) { + val.$cond = val.$cond.map(expr => _castExpression(expr, schema, strictQuery)); + } else { + val.$cond.if = _castExpression(val.$cond.if, schema, strictQuery); + val.$cond.then = _castExpression(val.$cond.then, schema, strictQuery); + val.$cond.else = _castExpression(val.$cond.else, schema, strictQuery); + } + } else if (val.$ifNull != null) { + val.$ifNull.map(v => _castExpression(v, schema, strictQuery)); + } else if (val.$switch != null) { + if (Array.isArray(val.$switch.branches)) { + val.$switch.branches = val.$switch.branches.map(v => _castExpression(v, schema, strictQuery)); + } + if ('default' in val.$switch) { + val.$switch.default = _castExpression(val.$switch.default, schema, strictQuery); + } + } + + const keys = Object.keys(val); + for (const key of keys) { + if (booleanComparison.has(key)) { + val[key] = val[key].map(v => _castExpression(v, schema, strictQuery)); + } else if (comparisonOperator.has(key)) { + val[key] = castComparison(val[key], schema, strictQuery); + } else if (arithmeticOperatorArray.has(key)) { + val[key] = castArithmetic(val[key], schema, strictQuery); + } else if (arithmeticOperatorNumber.has(key)) { + val[key] = castNumberOperator(val[key], schema, strictQuery); + } else if (expressionOperator.has(key)) { + val[key] = _castExpression(val[key], schema, strictQuery); + } + } + + if (val.$in) { + val.$in = castIn(val.$in, schema, strictQuery); + } + if (val.$size) { + val.$size = castNumberOperator(val.$size, schema, strictQuery); + } + if (val.$round) { + const $round = val.$round; + if (!Array.isArray($round) || $round.length < 1 || $round.length > 2) { + throw new CastError('Array', $round, '$round'); + } + val.$round = $round.map(v => castNumberOperator(v, schema, strictQuery)); + } + + omitUndefined(val); + + return val; +} + +// { $op: } +function castNumberOperator(val) { + if (!isLiteral(val)) { + return val; + } + + try { + return castNumber(val); + } catch { + throw new CastError('Number', val); + } +} + +function castIn(val, schema, strictQuery) { + const path = val[1]; + if (!isPath(path)) { + return val; + } + const search = val[0]; + + const schematype = schema.path(path.slice(1)); + if (schematype === null) { + if (strictQuery === false) { + return val; + } else if (strictQuery === 'throw') { + throw new StrictModeError('$in'); + } + + return void 0; + } + + if (!schematype.$isMongooseArray) { + throw new Error('Path must be an array for $in'); + } + + return [ + schematype.embeddedSchemaType.cast(search), + path + ]; +} + +// { $op: [, ] } +function castArithmetic(val) { + if (!Array.isArray(val)) { + if (!isLiteral(val)) { + return val; + } + try { + return castNumber(val); + } catch { + throw new CastError('Number', val); + } + } + + return val.map(v => { + if (!isLiteral(v)) { + return v; + } + try { + return castNumber(v); + } catch { + throw new CastError('Number', v); + } + }); +} + +// { $op: [expression, expression] } +function castComparison(val, schema, strictQuery) { + if (!Array.isArray(val) || val.length !== 2) { + throw new Error('Comparison operator must be an array of length 2'); + } + + val[0] = _castExpression(val[0], schema, strictQuery); + const lhs = val[0]; + + if (isLiteral(val[1])) { + let path = null; + let schematype = null; + let caster = null; + if (isPath(lhs)) { + path = lhs.slice(1); + schematype = schema.path(path); + } else if (typeof lhs === 'object' && lhs != null) { + for (const key of Object.keys(lhs)) { + if (dateOperators.has(key) && isPath(lhs[key])) { + path = lhs[key].slice(1) + '.' + key; + caster = castNumber; + } else if (arrayElementOperators.has(key) && isPath(lhs[key])) { + path = lhs[key].slice(1) + '.' + key; + schematype = schema.path(lhs[key].slice(1)); + if (schematype != null) { + if (schematype.$isMongooseArray) { + schematype = schematype.embeddedSchemaType; + } + } + } + } + } + + const is$literal = typeof val[1] === 'object' && val[1] != null && val[1].$literal != null; + if (schematype != null) { + if (is$literal) { + val[1] = { $literal: schematype.cast(val[1].$literal) }; + } else { + val[1] = schematype.cast(val[1]); + } + } else if (caster != null) { + if (is$literal) { + try { + val[1] = { $literal: caster(val[1].$literal) }; + } catch { + throw new CastError(caster.name.replace(/^cast/, ''), val[1], path + '.$literal'); + } + } else { + try { + val[1] = caster(val[1]); + } catch { + throw new CastError(caster.name.replace(/^cast/, ''), val[1], path); + } + } + } else if (path != null && strictQuery === true) { + return void 0; + } else if (path != null && strictQuery === 'throw') { + throw new StrictModeError(path); + } + } else { + val[1] = _castExpression(val[1], schema, strictQuery); + } + + return val; +} + +function isPath(val) { + return typeof val === 'string' && val[0] === '$'; +} + +function isLiteral(val) { + if (typeof val === 'string' && val[0] === '$') { + return false; + } + if (typeof val === 'object' && val !== null && Object.keys(val).find(key => key[0] === '$')) { + // The `$literal` expression can make an object a literal + // https://www.mongodb.com/docs/manual/reference/operator/aggregation/literal/#mongodb-expression-exp.-literal + return val.$literal != null; + } + return true; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castFilterPath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castFilterPath.js new file mode 100644 index 00000000..53038521 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castFilterPath.js @@ -0,0 +1,54 @@ +'use strict'; + +const isOperator = require('./isOperator'); + +module.exports = function castFilterPath(ctx, schematype, val) { + const any$conditionals = Object.keys(val).some(isOperator); + + if (!any$conditionals) { + return schematype.castForQuery( + null, + val, + ctx + ); + } + + const ks = Object.keys(val); + + let k = ks.length; + + while (k--) { + const $cond = ks[k]; + const nested = val[$cond]; + + if ($cond === '$not') { + if (nested && schematype && !schematype.embeddedSchemaType && !schematype.Constructor) { + const _keys = Object.keys(nested); + if (_keys.length && isOperator(_keys[0])) { + for (const key of Object.keys(nested)) { + nested[key] = schematype.castForQuery( + key, + nested[key], + ctx + ); + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + ctx + ); + } + continue; + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + ctx + ); + } + } + + return val; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castUpdate.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castUpdate.js new file mode 100644 index 00000000..6d6e6c3f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/castUpdate.js @@ -0,0 +1,664 @@ +'use strict'; + +const CastError = require('../../error/cast'); +const MongooseError = require('../../error/mongooseError'); +const SchemaString = require('../../schema/string'); +const StrictModeError = require('../../error/strict'); +const ValidationError = require('../../error/validation'); +const castNumber = require('../../cast/number'); +const cast = require('../../cast'); +const getConstructorName = require('../getConstructorName'); +const getDiscriminatorByValue = require('../discriminator/getDiscriminatorByValue'); +const getEmbeddedDiscriminatorPath = require('./getEmbeddedDiscriminatorPath'); +const handleImmutable = require('./handleImmutable'); +const isOperator = require('./isOperator'); +const moveImmutableProperties = require('../update/moveImmutableProperties'); +const schemaMixedSymbol = require('../../schema/symbols').schemaMixedSymbol; +const setDottedPath = require('../path/setDottedPath'); +const utils = require('../../utils'); +const { internalToObjectOptions } = require('../../options'); + +const mongodbUpdateOperators = new Set([ + '$currentDate', + '$inc', + '$min', + '$max', + '$mul', + '$rename', + '$set', + '$setOnInsert', + '$unset', + '$addToSet', + '$pop', + '$pull', + '$push', + '$pullAll', + '$bit' +]); + +/** + * Casts an update op based on the given schema + * + * @param {Schema} schema + * @param {object} obj + * @param {object} [options] + * @param {boolean|'throw'} [options.strict] defaults to true + * @param {Query} context passed to setters + * @return {boolean} true iff the update is non-empty + * @api private + */ +module.exports = function castUpdate(schema, obj, options, context, filter) { + if (obj == null) { + return undefined; + } + options = options || {}; + // Update pipeline + if (Array.isArray(obj)) { + const len = obj.length; + for (let i = 0; i < len; ++i) { + const ops = Object.keys(obj[i]); + for (const op of ops) { + obj[i][op] = castPipelineOperator(op, obj[i][op]); + } + } + return obj; + } + + if (schema != null && + filter != null && + utils.hasUserDefinedProperty(filter, schema.options.discriminatorKey) && + typeof filter[schema.options.discriminatorKey] !== 'object' && + schema.discriminators != null) { + const discriminatorValue = filter[schema.options.discriminatorKey]; + const byValue = getDiscriminatorByValue(context.model.discriminators, discriminatorValue); + schema = schema.discriminators[discriminatorValue] || + byValue?.schema || + schema; + } else if (schema != null && + options.overwriteDiscriminatorKey && + utils.hasUserDefinedProperty(obj, schema.options.discriminatorKey) && + schema.discriminators != null) { + const discriminatorValue = obj[schema.options.discriminatorKey]; + const byValue = getDiscriminatorByValue(context.model.discriminators, discriminatorValue); + schema = schema.discriminators[discriminatorValue] || + byValue?.schema || + schema; + } else if (schema != null && + options.overwriteDiscriminatorKey && + obj.$set != null && + utils.hasUserDefinedProperty(obj.$set, schema.options.discriminatorKey) && + schema.discriminators != null) { + const discriminatorValue = obj.$set[schema.options.discriminatorKey]; + const byValue = getDiscriminatorByValue(context.model.discriminators, discriminatorValue); + schema = schema.discriminators[discriminatorValue] || + byValue?.schema || + schema; + } + + if (options.upsert) { + moveImmutableProperties(schema, obj, context); + } + + if (obj?.$__ && typeof obj.toObject === 'function') { + obj = obj.toObject(internalToObjectOptions); + } + + const ops = Object.keys(obj); + let i = ops.length; + const ret = {}; + let val; + let hasDollarKey = false; + + filter = filter || {}; + while (i--) { + const op = ops[i]; + if (!mongodbUpdateOperators.has(op)) { + // fix up $set sugar + if (!ret.$set) { + if (obj.$set) { + ret.$set = obj.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op] = obj[op]; + ops.splice(i, 1); + if (!~ops.indexOf('$set')) ops.push('$set'); + } else if (op === '$set') { + if (!ret.$set) { + ret[op] = obj[op]; + } + } else { + ret[op] = obj[op]; + } + } + // cast each value + i = ops.length; + while (i--) { + const op = ops[i]; + val = ret[op]; + hasDollarKey = hasDollarKey || op.startsWith('$'); + if (val?.$__) { + val = val.toObject(internalToObjectOptions); + ret[op] = val; + } + if (val && + typeof val === 'object' && + !Buffer.isBuffer(val) && + mongodbUpdateOperators.has(op)) { + walkUpdatePath(schema, val, op, options, context, filter); + } else { + const msg = 'Invalid atomic update value for ' + op + '. ' + + 'Expected an object, received ' + typeof val; + throw new Error(msg); + } + + if (op.startsWith('$') && utils.isEmptyObject(val)) { + delete ret[op]; + } + } + + if (utils.hasOwnKeys(ret) === false && + options.upsert && + utils.hasOwnKeys(filter)) { + // Trick the driver into allowing empty upserts to work around + // https://github.com/mongodb/node-mongodb-native/pull/2490 + // Shallow clone to avoid passing defaults in re: gh-13962 + return { $setOnInsert: { ...filter } }; + } + return ret; +}; + +/*! + * ignore + */ + +function castPipelineOperator(op, val) { + if (op === '$unset') { + if (typeof val !== 'string' && (!Array.isArray(val) || val.find(v => typeof v !== 'string'))) { + throw new MongooseError('Invalid $unset in pipeline, must be ' + + ' a string or an array of strings'); + } + return val; + } + if (op === '$project') { + if (val == null || typeof val !== 'object') { + throw new MongooseError('Invalid $project in pipeline, must be an object'); + } + return val; + } + if (op === '$addFields' || op === '$set') { + if (val == null || typeof val !== 'object') { + throw new MongooseError('Invalid ' + op + ' in pipeline, must be an object'); + } + return val; + } else if (op === '$replaceRoot' || op === '$replaceWith') { + if (val == null || typeof val !== 'object') { + throw new MongooseError('Invalid ' + op + ' in pipeline, must be an object'); + } + return val; + } + + throw new MongooseError('Invalid update pipeline operator: "' + op + '"'); +} + +/** + * Walk each path of obj and cast its values + * according to its schema. + * + * @param {Schema} schema + * @param {object} obj part of a query + * @param {string} op the atomic operator ($pull, $set, etc) + * @param {object} [options] + * @param {boolean|'throw'} [options.strict] + * @param {Query} context + * @param {object} filter + * @param {string} pref path prefix (internal only) + * @return {Bool} true if this path has keys to update + * @api private + */ + +function walkUpdatePath(schema, obj, op, options, context, filter, prefix) { + const strict = options.strict; + prefix = prefix ? prefix + '.' : ''; + const keys = Object.keys(obj); + let i = keys.length; + let hasKeys = false; + let schematype; + let key; + let val; + + let aggregatedError = null; + + const strictMode = strict ?? schema.options.strict; + + while (i--) { + key = keys[i]; + val = obj[key]; + + const fullPath = prefix + key; + const isTopLevelOperator = !prefix && isOperator(key); + let fullPathSchema = isTopLevelOperator ? schema._getSchema(fullPath) : null; + const isTopLevelNestedDollarPath = isTopLevelOperator && Object.hasOwn(schema.nested, key); + if (isTopLevelOperator && + fullPathSchema == null && + !isTopLevelNestedDollarPath) { + throw new MongooseError('Invalid update: Unexpected modifier "' + key + '" as a key in operator "' + op + '". ' + + 'Did you mean something like { ' + op + ': { fieldName: { ' + key + ': [...] } } }? ' + + 'Modifiers must appear under a valid field path.'); + } + + // `$pull` is special because we need to cast the RHS as a query, not as + // an update. + if (op === '$pull') { + if (!isTopLevelOperator) { + fullPathSchema = schema._getSchema(fullPath); + } + schematype = fullPathSchema; + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, prefix + key, options); + if (_res.schematype != null) { + schematype = _res.schematype; + } + } + if (schematype?.schema != null) { + obj[key] = cast(schematype.schema, obj[key], options, context); + hasKeys = true; + continue; + } + } + + const discriminatorKey = (prefix ? prefix + key : key); + if ( + schema.discriminatorMapping != null && + discriminatorKey === schema.options.discriminatorKey && + schema.discriminatorMapping.value !== obj[key] && + !options.overwriteDiscriminatorKey + ) { + if (strictMode === 'throw') { + const err = new Error('Can\'t modify discriminator key "' + discriminatorKey + '" on discriminator model'); + aggregatedError = _appendError(err, context, discriminatorKey, aggregatedError); + continue; + } else if (strictMode) { + delete obj[key]; + continue; + } + } + + if (!isTopLevelOperator && op !== '$pull') { + fullPathSchema = schema._getSchema(fullPath); + } + schematype = fullPathSchema; + + if (getConstructorName(val) === 'Object') { + // watch for embedded doc schemas + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, prefix + key, options); + if (_res.schematype != null) { + schematype = _res.schematype; + } + } + + if (op !== '$setOnInsert' && + handleImmutable(schematype, strict, obj, key, prefix + key, options, context)) { + continue; + } + + if (schematype && (schematype.embeddedSchemaType || schematype.Constructor) && op in castOps) { + // embedded doc schema + if ('$each' in val) { + hasKeys = true; + try { + obj[key] = { + $each: castUpdateVal(schematype, val.$each, op, key, context, prefix + key) + }; + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + + if (val.$slice != null) { + obj[key].$slice = val.$slice | 0; + } + + if (val.$sort) { + obj[key].$sort = val.$sort; + } + + if (val.$position != null) { + obj[key].$position = castNumber(val.$position); + } + } else { + if (schematype?.$isSingleNested) { + const _strict = strict == null ? schematype.schema.options.strict : strict; + try { + obj[key] = schematype.castForQuery(null, val, context, { strict: _strict }); + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + } else { + try { + obj[key] = castUpdateVal(schematype, val, op, key, context, prefix + key); + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + } + + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + + hasKeys = true; + } + } else if ((op === '$currentDate') || (op in castOps && schematype)) { + // $currentDate can take an object + try { + obj[key] = castUpdateVal(schematype, val, op, key, context, prefix + key); + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + + hasKeys = true; + } else if (op === '$rename') { + const schematype = new SchemaString(`${prefix}${key}.$rename`); + try { + obj[key] = castUpdateVal(schematype, val, op, key, context, prefix + key); + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + + hasKeys = true; + } else { + const pathToCheck = (prefix + key); + const v = schema._getPathType(pathToCheck); + let _strict = strict; + if (v?.schema && _strict == null) { + _strict = v.schema.options.strict; + } + + if (v.pathType === 'undefined') { + if (_strict === 'throw') { + throw new StrictModeError(pathToCheck); + } else if (_strict) { + delete obj[key]; + continue; + } + } + + // gh-2314 + // we should be able to set a schema-less field + // to an empty object literal + hasKeys |= walkUpdatePath(schema, val, op, options, context, filter, prefix + key) || + (utils.isObject(val) && utils.hasOwnKeys(val) === false); + } + } else { + const isModifier = !isTopLevelNestedDollarPath && schematype == null && + (key === '$each' || key === '$or' || key === '$and' || key === '$in'); + const checkPath = isModifier ? prefix : fullPath; + if (isModifier) { + schematype = schema._getSchema(checkPath); + } + + // You can use `$setOnInsert` with immutable keys + if (op !== '$setOnInsert' && + handleImmutable(schematype, strict, obj, key, prefix + key, options, context)) { + continue; + } + + let pathDetails = schema._getPathType(checkPath); + + // If no schema type, check for embedded discriminators because the + // filter or update may imply an embedded discriminator type. See #8378 + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, checkPath, options); + if (_res.schematype != null) { + schematype = _res.schematype; + pathDetails = _res.type; + } + } + + let isStrict = strict; + if (pathDetails?.schema && strict == null) { + isStrict = pathDetails.schema.options.strict; + } + + const skip = isStrict && + !schematype && + !/real|nested/.test(pathDetails.pathType); + + if (skip) { + // Even if strict is `throw`, avoid throwing an error because of + // virtuals because of #6731 + if (isStrict === 'throw' && schema.virtuals[checkPath] == null) { + throw new StrictModeError(prefix + key); + } else { + delete obj[key]; + } + } else { + if (op === '$rename') { + if (obj[key] == null) { + throw new CastError('String', obj[key], `${prefix}${key}.$rename`); + } + const schematype = new SchemaString(`${prefix}${key}.$rename`, null, null, schema); + obj[key] = schematype.castForQuery(null, obj[key], context); + continue; + } + + try { + if (prefix.length === 0 || key.indexOf('.') === -1) { + obj[key] = castUpdateVal(schematype, val, op, key, context, prefix + key); + } else if (isStrict !== false || schematype != null) { + // Setting a nested dotted path that's in the schema. We don't allow paths with '.' in + // a schema, so replace the dotted path with a nested object to avoid ending up with + // dotted properties in the updated object. See (gh-10200) + setDottedPath(obj, key, castUpdateVal(schematype, val, op, key, context, prefix + key)); + delete obj[key]; + } + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + + if (Array.isArray(obj[key]) && (op === '$addToSet' || op === '$push') && key !== '$each') { + if (schematype && + schematype.embeddedSchemaType && + !schematype.embeddedSchemaType.$isMongooseArray && + !schematype.embeddedSchemaType[schemaMixedSymbol]) { + obj[key] = { $each: obj[key] }; + } + } + + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + + hasKeys = true; + } + } + } + + if (aggregatedError != null) { + throw aggregatedError; + } + + return hasKeys; +} + +/*! + * ignore + */ + +function _appendError(error, query, key, aggregatedError) { + if (typeof query !== 'object' || !query.options.multipleCastError) { + throw error; + } + aggregatedError = aggregatedError || new ValidationError(); + aggregatedError.addError(key, error); + return aggregatedError; +} + +/** + * These operators should be cast to numbers instead + * of their path schema type. + * @api private + */ + +const numberOps = { + $pop: 1, + $inc: 1 +}; + +/** + * These ops require no casting because the RHS doesn't do anything. + * @api private + */ + +const noCastOps = { + $unset: 1 +}; + +/** + * These operators require casting docs + * to real Documents for Update operations. + * @api private + */ + +const castOps = { + $push: 1, + $addToSet: 1, + $set: 1, + $setOnInsert: 1 +}; + +/*! + * ignore + */ + +const overwriteOps = { + $set: 1, + $setOnInsert: 1 +}; + +/** + * Casts `val` according to `schema` and atomic `op`. + * + * @param {SchemaType} schema + * @param {object} val + * @param {string} op the atomic operator ($pull, $set, etc) + * @param {string} $conditional + * @param {Query} context + * @param {string} path + * @api private + */ + +function castUpdateVal(schema, val, op, $conditional, context, path) { + if (!schema) { + // non-existing schema path + if (op in numberOps) { + try { + return castNumber(val); + } catch { + throw new CastError('number', val, path); + } + } + return val; + } + + const cond = schema.$isMongooseArray + && op in castOps + && (utils.isObject(val) || Array.isArray(val)); + if (cond && !overwriteOps[op]) { + // Cast values for ops that add data to MongoDB. + // Ensures embedded documents get ObjectIds etc. + let schemaArrayDepth = 0; + let cur = schema; + while (cur.$isMongooseArray) { + ++schemaArrayDepth; + cur = cur.embeddedSchemaType; + } + let arrayDepth = 0; + let _val = val; + while (Array.isArray(_val)) { + ++arrayDepth; + _val = _val[0]; + } + + const additionalNesting = schemaArrayDepth - arrayDepth; + while (arrayDepth < schemaArrayDepth) { + val = [val]; + ++arrayDepth; + } + + let tmp = schema.applySetters(Array.isArray(val) ? val : [val], context); + + for (let i = 0; i < additionalNesting; ++i) { + tmp = tmp[0]; + } + return tmp; + } + + if (op in noCastOps) { + return val; + } + if (op in numberOps) { + // Null and undefined not allowed for $pop, $inc + if (val == null) { + throw new CastError('number', val, schema.path); + } + if (op === '$inc') { + // Support `$inc` with long, int32, etc. (gh-4283) + return schema.castForQuery( + null, + val, + context + ); + } + try { + return castNumber(val); + } catch { + throw new CastError('number', val, schema.path); + } + } + if (op === '$currentDate') { + if (typeof val === 'object') { + return { $type: val.$type }; + } + return Boolean(val); + } + + if (mongodbUpdateOperators.has($conditional)) { + return schema.castForQuery( + $conditional, + val, + context + ); + } + + if (overwriteOps[op]) { + const skipQueryCastForUpdate = val != null + && schema.$isMongooseArray + && schema.$fullPath != null + && !schema.$fullPath.match(/\d+$/); + const applySetters = schema[schemaMixedSymbol] != null; + if (skipQueryCastForUpdate || applySetters) { + return schema.applySetters(val, context); + } + return schema.castForQuery( + null, + val, + context + ); + } + + return schema.castForQuery(null, val, context); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js new file mode 100644 index 00000000..3b468e47 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js @@ -0,0 +1,103 @@ +'use strict'; + +const cleanPositionalOperators = require('../schema/cleanPositionalOperators'); +const get = require('../get'); +const getDiscriminatorByValue = require('../discriminator/getDiscriminatorByValue'); +const updatedPathsByArrayFilter = require('../update/updatedPathsByArrayFilter'); + +/** + * Like `schema.path()`, except with a document, because impossible to + * determine path type without knowing the embedded discriminator key. + * @param {Schema} schema + * @param {object} [update] + * @param {object} [filter] + * @param {string} path + * @param {object} [options] + * @api private + */ + +module.exports = function getEmbeddedDiscriminatorPath(schema, update, filter, path, options) { + const parts = path.indexOf('.') === -1 ? [path] : path.split('.'); + let schematype = null; + let type = 'adhocOrUndefined'; + + filter = filter || {}; + update = update || {}; + const arrayFilters = Array.isArray(options?.arrayFilters) ? + options.arrayFilters : []; + const updatedPathsByFilter = updatedPathsByArrayFilter(update); + let startIndex = 0; + + for (let i = 0; i < parts.length; ++i) { + const originalSubpath = parts.slice(startIndex, i + 1).join('.'); + const subpath = cleanPositionalOperators(originalSubpath); + schematype = schema.path(subpath); + if (schematype == null) { + continue; + } + + type = schema.pathType(subpath); + if ((schematype.$isSingleNested || schematype.$isMongooseDocumentArrayElement) && + schematype.schema.discriminators != null) { + const key = get(schematype, 'schema.options.discriminatorKey'); + const discriminatorValuePath = subpath + '.' + key; + const discriminatorFilterPath = + discriminatorValuePath.replace(/\.\d+\./, '.'); + let discriminatorKey = null; + + if (discriminatorValuePath in filter) { + discriminatorKey = filter[discriminatorValuePath]; + } + if (discriminatorFilterPath in filter) { + discriminatorKey = filter[discriminatorFilterPath]; + } + + const wrapperPath = subpath.replace(/\.\d+$/, ''); + if (schematype.$isMongooseDocumentArrayElement && + get(filter[wrapperPath], '$elemMatch.' + key) != null) { + discriminatorKey = filter[wrapperPath].$elemMatch[key]; + } + + const discriminatorKeyUpdatePath = originalSubpath + '.' + key; + if (discriminatorKeyUpdatePath in update) { + discriminatorKey = update[discriminatorKeyUpdatePath]; + } + + if (discriminatorValuePath in update) { + discriminatorKey = update[discriminatorValuePath]; + } + + for (const filterKey of Object.keys(updatedPathsByFilter)) { + const schemaKey = updatedPathsByFilter[filterKey] + '.' + key; + const arrayFilterKey = filterKey + '.' + key; + if (schemaKey === discriminatorFilterPath) { + const filter = arrayFilters.find(filter => Object.hasOwn(filter, arrayFilterKey)); + if (filter != null) { + discriminatorKey = filter[arrayFilterKey]; + } + } + } + + if (discriminatorKey == null) { + continue; + } + + const discriminator = getDiscriminatorByValue(schematype.Constructor.discriminators, discriminatorKey); + const discriminatorSchema = discriminator?.schema; + if (discriminatorSchema == null) { + continue; + } + + const rest = parts.slice(i + 1).join('.'); + schematype = discriminatorSchema._getSchema(rest); + schema = discriminatorSchema; + startIndex = i + 1; + if (schematype != null) { + type = discriminatorSchema._getPathType(rest); + break; + } + } + } + + return { type: type, schematype: schematype }; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleImmutable.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleImmutable.js new file mode 100644 index 00000000..65d29aa7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleImmutable.js @@ -0,0 +1,44 @@ +'use strict'; + +const StrictModeError = require('../../error/strict'); + +/** + * Handle immutable option for a given path when casting updates based on options + * + * @param {SchemaType} schematype the resolved schematype for this path + * @param {boolean | 'throw' | null} strict whether strict mode is set for this query + * @param {object} obj the object containing the value being checked so we can delete + * @param {string} key the key in `obj` which we are checking for immutability + * @param {string} fullPath the full path being checked + * @param {object} options the query options + * @param {Query} ctx the query. Passed as `this` and first param to the `immutable` option, if `immutable` is a function + * @returns {boolean} true if field was removed, false otherwise + */ + +module.exports = function handleImmutable(schematype, strict, obj, key, fullPath, options, ctx) { + if (!schematype?.options?.immutable) { + return false; + } + let immutable = schematype.options.immutable; + + if (typeof immutable === 'function') { + immutable = immutable.call(ctx, ctx); + } + if (!immutable) { + return false; + } + + if (options?.overwriteImmutable) { + return false; + } + if (strict === false) { + return false; + } + if (strict === 'throw') { + throw new StrictModeError(null, + `Field ${fullPath} is immutable and strict = 'throw'`); + } + + delete obj[key]; + return true; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js new file mode 100644 index 00000000..c3af278b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = function handleReadPreferenceAliases(pref) { + switch (pref) { + case 'p': + pref = 'primary'; + break; + case 'pp': + pref = 'primaryPreferred'; + break; + case 's': + pref = 'secondary'; + break; + case 'sp': + pref = 'secondaryPreferred'; + break; + case 'n': + pref = 'nearest'; + break; + } + + return pref; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js new file mode 100644 index 00000000..3e3b188c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js @@ -0,0 +1,23 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function hasDollarKeys(obj) { + + if (typeof obj !== 'object' || obj === null) { + return false; + } + + const keys = Object.keys(obj); + const len = keys.length; + + for (let i = 0; i < len; ++i) { + if (keys[i][0] === '$') { + return true; + } + } + + return false; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/isOperator.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/isOperator.js new file mode 100644 index 00000000..04488591 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/isOperator.js @@ -0,0 +1,14 @@ +'use strict'; + +const specialKeys = new Set([ + '$ref', + '$id', + '$db' +]); + +module.exports = function isOperator(path) { + return ( + path[0] === '$' && + !specialKeys.has(path) + ); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js new file mode 100644 index 00000000..ac6e0985 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js @@ -0,0 +1,41 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); +const hasDollarKeys = require('./hasDollarKeys'); +const { trustedSymbol } = require('./trusted'); + +module.exports = function sanitizeFilter(filter) { + if (filter == null || typeof filter !== 'object') { + return filter; + } + if (Array.isArray(filter)) { + for (const subfilter of filter) { + sanitizeFilter(subfilter); + } + return filter; + } + + const filterKeys = Object.keys(filter); + for (const key of filterKeys) { + const value = filter[key]; + if (value?.[trustedSymbol]) { + continue; + } + if (key === '$and' || key === '$or' || key === '$nor') { + sanitizeFilter(value); + continue; + } else if (key === '$jsonSchema' || key === '$where' || key === '$expr' || key === '$text') { + throw new MongooseError(key + ' is not allowed with sanitizeFilter'); + } + + if (hasDollarKeys(value)) { + const keys = Object.keys(value); + if (keys.length === 1 && keys[0] === '$eq') { + continue; + } + filter[key] = { $eq: filter[key] }; + } + } + + return filter; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js new file mode 100644 index 00000000..0c034875 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function sanitizeProjection(projection) { + if (projection == null) { + return; + } + + const keys = Object.keys(projection); + for (let i = 0; i < keys.length; ++i) { + if (typeof projection[keys[i]] === 'string') { + projection[keys[i]] = 1; + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js new file mode 100644 index 00000000..dc96caf6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js @@ -0,0 +1,62 @@ +'use strict'; + +const isExclusive = require('../projection/isExclusive'); +const isInclusive = require('../projection/isInclusive'); + +/*! + * ignore + */ + +module.exports = function selectPopulatedFields(fields, userProvidedFields, populateOptions) { + if (populateOptions == null) { + return; + } + + const paths = Object.keys(populateOptions); + userProvidedFields = userProvidedFields || {}; + if (isInclusive(fields)) { + for (const path of paths) { + if (!isPathInFields(userProvidedFields, path)) { + fields[path] = 1; + } else if (userProvidedFields[path] === 0) { + delete fields[path]; + } + + const refPath = populateOptions[path]?.refPath; + if (typeof refPath === 'string') { + if (!isPathInFields(userProvidedFields, refPath)) { + fields[refPath] = 1; + } else if (userProvidedFields[refPath] === 0) { + delete fields[refPath]; + } + } + } + } else if (isExclusive(fields)) { + for (const path of paths) { + if (userProvidedFields[path] == null) { + delete fields[path]; + } + const refPath = populateOptions[path]?.refPath; + if (typeof refPath === 'string' && userProvidedFields[refPath] == null) { + delete fields[refPath]; + } + } + } +}; + +/*! + * ignore + */ + +function isPathInFields(userProvidedFields, path) { + const pieces = path.split('.'); + const len = pieces.length; + let cur = pieces[0]; + for (let i = 1; i < len; ++i) { + if (userProvidedFields[cur] != null || userProvidedFields[cur + '.$'] != null) { + return true; + } + cur += '.' + pieces[i]; + } + return userProvidedFields[cur] != null || userProvidedFields[cur + '.$'] != null; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/trusted.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/trusted.js new file mode 100644 index 00000000..87a2cfa9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/trusted.js @@ -0,0 +1,13 @@ +'use strict'; + +const trustedSymbol = Symbol('mongoose#trustedSymbol'); + +exports.trustedSymbol = trustedSymbol; + +exports.trusted = function trusted(obj) { + if (obj == null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return obj; + } + obj[trustedSymbol] = true; + return obj; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/validOps.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/validOps.js new file mode 100644 index 00000000..2d1aa477 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/query/validOps.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../../constants').queryMiddlewareFunctions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/addAutoId.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/addAutoId.js new file mode 100644 index 00000000..82c0c603 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/addAutoId.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function addAutoId(schema) { + const _obj = { _id: { auto: true } }; + _obj._id[schema.options.typeKey] = 'ObjectId'; + schema.add(_obj); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js new file mode 100644 index 00000000..8bd7319c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js @@ -0,0 +1,12 @@ +'use strict'; + +const builtinPlugins = require('../../plugins'); + +module.exports = function applyBuiltinPlugins(schema) { + for (const plugin of Object.values(builtinPlugins)) { + plugin(schema, { deduplicate: true }); + } + schema.plugins = Object.values(builtinPlugins). + map(fn => ({ fn, opts: { deduplicate: true } })). + concat(schema.plugins); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyPlugins.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyPlugins.js new file mode 100644 index 00000000..22b72246 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyPlugins.js @@ -0,0 +1,55 @@ +'use strict'; + +module.exports = function applyPlugins(schema, plugins, options, cacheKey) { + if (schema[cacheKey]) { + return; + } + schema[cacheKey] = true; + + if (!options?.skipTopLevel) { + let pluginTags = null; + for (const plugin of plugins) { + const tags = plugin[1] == null ? null : plugin[1].tags; + if (!Array.isArray(tags)) { + schema.plugin(plugin[0], plugin[1]); + continue; + } + + pluginTags = pluginTags || new Set(schema.options.pluginTags || []); + if (!tags.find(tag => pluginTags.has(tag))) { + continue; + } + schema.plugin(plugin[0], plugin[1]); + } + } + + options = Object.assign({}, options); + delete options.skipTopLevel; + + if (options.applyPluginsToChildSchemas !== false) { + for (const path of Object.keys(schema.paths)) { + const type = schema.paths[path]; + if (type.schema != null) { + applyPlugins(type.schema, plugins, options, cacheKey); + + // Recompile schema because plugins may have changed it, see gh-7572 + type.Constructor.prototype.$__setSchema(type.schema); + } + } + } + + const discriminators = schema.discriminators; + if (discriminators == null) { + return; + } + + const applyPluginsToDiscriminators = options.applyPluginsToDiscriminators; + + const keys = Object.keys(discriminators); + for (const discriminatorKey of keys) { + const discriminatorSchema = discriminators[discriminatorKey]; + + applyPlugins(discriminatorSchema, plugins, + { skipTopLevel: !applyPluginsToDiscriminators }, cacheKey); + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js new file mode 100644 index 00000000..1367368a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = function applyReadConcern(schema, options) { + if (options.readConcern !== undefined) { + return; + } + + // Don't apply default read concern to operations in transactions, + // because you shouldn't set read concern on individual operations + // within a transaction. + // See: https://www.mongodb.com/docs/manual/reference/read-concern/ + if (options?.session?.transaction) { + return; + } + + const level = schema.options?.readConcern?.level; + if (level != null) { + options.readConcern = { level }; + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js new file mode 100644 index 00000000..2b741371 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js @@ -0,0 +1,39 @@ +'use strict'; + +const utils = require('../../utils'); + +module.exports = function applyWriteConcern(schema, options) { + if (options.writeConcern != null) { + return; + } + // Don't apply default write concern to operations in transactions, + // because setting write concern on an operation in a transaction is an error + // See: https://www.mongodb.com/docs/manual/reference/write-concern/ + if (options?.session?.transaction) { + return; + } + const writeConcern = schema.options.writeConcern ?? {}; + if (utils.hasOwnKeys(writeConcern)) { + options.writeConcern = {}; + if (!('w' in options) && writeConcern.w != null) { + options.writeConcern.w = writeConcern.w; + } + if (!('j' in options) && writeConcern.j != null) { + options.writeConcern.j = writeConcern.j; + } + if (!('wtimeout' in options) && writeConcern.wtimeout != null) { + options.writeConcern.wtimeout = writeConcern.wtimeout; + } + } + else { + if (!('w' in options) && writeConcern.w != null) { + options.w = writeConcern.w; + } + if (!('j' in options) && writeConcern.j != null) { + options.j = writeConcern.j; + } + if (!('wtimeout' in options) && writeConcern.wtimeout != null) { + options.wtimeout = writeConcern.wtimeout; + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js new file mode 100644 index 00000000..f104d039 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js @@ -0,0 +1,12 @@ +'use strict'; + +/** + * For consistency's sake, we replace positional operator `$` and array filters + * `$[]` and `$[foo]` with `0` when looking up schema paths. + */ + +module.exports = function cleanPositionalOperators(path) { + return path. + replace(/\.\$(\[[^\]]*\])?(?=\.)/g, '.0'). + replace(/\.\$(\[[^\]]*\])?$/g, '.0'); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getIndexes.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getIndexes.js new file mode 100644 index 00000000..8c79744b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getIndexes.js @@ -0,0 +1,171 @@ +'use strict'; + +const get = require('../get'); +const helperIsObject = require('../isObject'); +const decorateDiscriminatorIndexOptions = require('../indexes/decorateDiscriminatorIndexOptions'); + +/** + * Gather all indexes defined in the schema, including single nested, + * document arrays, and embedded discriminators. + * @param {Schema} schema + * @api private + */ + +module.exports = function getIndexes(schema) { + let indexes = []; + const schemaStack = new WeakMap(); + const indexTypes = schema.constructor.indexTypes; + const indexByName = new Map(); + + collectIndexes(schema); + return indexes; + + function collectIndexes(schema, prefix, baseSchema) { + // Ignore infinitely nested schemas, if we've already seen this schema + // along this path there must be a cycle + if (schemaStack.has(schema)) { + return; + } + schemaStack.set(schema, true); + + prefix = prefix || ''; + const keys = Object.keys(schema.paths); + + for (const key of keys) { + const path = schema.paths[key]; + if (baseSchema != null && baseSchema.paths[key]) { + // If looking at an embedded discriminator schema, don't look at paths + // that the + continue; + } + + if (path._duplicateKeyErrorMessage != null) { + schema._duplicateKeyErrorMessagesByPath = schema._duplicateKeyErrorMessagesByPath || {}; + schema._duplicateKeyErrorMessagesByPath[key] = path._duplicateKeyErrorMessage; + } + + if (path.$isMongooseDocumentArray || path.$isSingleNested) { + if (get(path, 'options.excludeIndexes') !== true && + get(path, 'schemaOptions.excludeIndexes') !== true && + get(path, 'schema.options.excludeIndexes') !== true) { + collectIndexes(path.schema, prefix + key + '.'); + } + + if (path.schema.discriminators != null) { + const discriminators = path.schema.discriminators; + const discriminatorKeys = Object.keys(discriminators); + for (const discriminatorKey of discriminatorKeys) { + collectIndexes(discriminators[discriminatorKey], + prefix + key + '.', path.schema); + } + } + + // Retained to minimize risk of backwards breaking changes due to + // gh-6113 + if (path.$isMongooseDocumentArray) { + continue; + } + } + + const index = path._index || (path.embeddedSchemaType && path.embeddedSchemaType._index); + + if (index !== false && index != null) { + const field = {}; + const isObject = helperIsObject(index); + const options = isObject ? { ...index } : {}; + const type = typeof index === 'string' ? index : + isObject ? index.type : + false; + + if (type && indexTypes.indexOf(type) !== -1) { + field[prefix + key] = type; + } else if (options.text) { + field[prefix + key] = 'text'; + delete options.text; + } else { + let isDescendingIndex = false; + if (index === 'descending' || index === 'desc') { + isDescendingIndex = true; + } else if (index === 'ascending' || index === 'asc') { + isDescendingIndex = false; + } else { + isDescendingIndex = Number(index) === -1; + } + + field[prefix + key] = isDescendingIndex ? -1 : 1; + } + + delete options.type; + if (schema.options.autoIndex != null) { + options._autoIndex = schema.options.autoIndex; + } + + const indexName = options?.name; + + if (typeof indexName === 'string') { + if (indexByName.has(indexName)) { + Object.assign(indexByName.get(indexName), field); + } else { + indexes.push([field, options]); + indexByName.set(indexName, field); + } + } else { + indexes.push([field, options]); + indexByName.set(indexName, field); + } + } + } + + schemaStack.delete(schema); + + if (prefix) { + fixSubIndexPaths(schema, prefix); + } else { + schema._indexes.forEach(function(index) { + const options = index[1]; + decorateDiscriminatorIndexOptions(schema, options); + }); + indexes = indexes.concat(schema._indexes); + } + } + + /** + * Checks for indexes added to subdocs using Schema.index(). + * These indexes need their paths prefixed properly. + * + * schema._indexes = [ [indexObj, options], [indexObj, options] ..] + * @param {Schema} schema + * @param {string} prefix + * @api private + */ + + function fixSubIndexPaths(schema, prefix) { + const subindexes = schema._indexes; + const len = subindexes.length; + for (let i = 0; i < len; ++i) { + const indexObj = subindexes[i][0]; + const indexOptions = subindexes[i][1]; + const keys = Object.keys(indexObj); + const klen = keys.length; + const newindex = {}; + + // use forward iteration, order matters + for (let j = 0; j < klen; ++j) { + const key = keys[j]; + newindex[prefix + key] = indexObj[key]; + } + + const newIndexOptions = Object.assign({}, indexOptions); + if (indexOptions?.partialFilterExpression != null) { + newIndexOptions.partialFilterExpression = {}; + const partialFilterExpression = indexOptions.partialFilterExpression; + for (const key of Object.keys(partialFilterExpression)) { + newIndexOptions.partialFilterExpression[prefix + key] = + partialFilterExpression[key]; + } + } + + indexes.push([newindex, newIndexOptions]); + } + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js new file mode 100644 index 00000000..c6fb6baa --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js @@ -0,0 +1,25 @@ +'use strict'; + +const get = require('../get'); + +module.exports = function getKeysInSchemaOrder(schema, val, path) { + const valKeys = Object.keys(val); + if (valKeys.length <= 1) { + return valKeys; + } + + const schemaKeys = path != null ? Object.keys(get(schema.tree, path, {})) : Object.keys(schema.tree); + const remaining = new Set(valKeys); + + const keys = []; + for (const key of schemaKeys) { + if (remaining.delete(key)) { + keys.push(key); + } + } + for (const key of remaining) { + keys.push(key); + } + + return keys; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getPath.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getPath.js new file mode 100644 index 00000000..ca145208 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getPath.js @@ -0,0 +1,43 @@ +'use strict'; + +const numberRE = /^\d+$/; + +/** + * Behaves like `Schema#path()`, except for it also digs into arrays without + * needing to put `.0.`, so `getPath(schema, 'docArr.elProp')` works. + * @api private + */ + +module.exports = function getPath(schema, path, discriminatorValueMap) { + let schematype = schema.path(path); + if (schematype != null) { + return schematype; + } + const pieces = path.split('.'); + let cur = ''; + let isArray = false; + + for (const piece of pieces) { + if (isArray && numberRE.test(piece)) { + continue; + } + cur = cur.length === 0 ? piece : cur + '.' + piece; + + schematype = schema.path(cur); + if (schematype?.schema) { + schema = schematype.schema; + if (!isArray && schematype.$isMongooseDocumentArray) { + isArray = true; + } + if (discriminatorValueMap && discriminatorValueMap[cur]) { + schema = schema.discriminators[discriminatorValueMap[cur]] ?? schema; + } + cur = ''; + } else if (schematype?.instance === 'Mixed') { + // If we found a mixed path, no point in digging further, the end result is always Mixed + break; + } + } + + return schematype; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js new file mode 100644 index 00000000..ed5a4bd5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js @@ -0,0 +1,32 @@ +'use strict'; + +/** + * Find the `strict` mode setting for the deepest subdocument along a given path + * to ensure we have the correct default value for `strict`. When setting values + * underneath a subdocument, we should use the subdocument's `strict` setting by + * default, not the top-level document's. + * + * @param {Schema} schema + * @param {string[]} parts + * @returns {boolean | 'throw' | undefined} + */ + +module.exports = function getSubdocumentStrictValue(schema, parts) { + if (parts.length === 1) { + return undefined; + } + let cur = parts[0]; + let strict = undefined; + for (let i = 0; i < parts.length - 1; ++i) { + const curSchemaType = schema.path(cur); + if (curSchemaType?.schema) { + strict = curSchemaType.schema.options.strict; + schema = curSchemaType.schema; + cur = curSchemaType.$isMongooseDocumentArray && !isNaN(parts[i + 1]) ? '' : parts[i + 1]; + } else { + cur += cur.length ? ('.' + parts[i + 1]) : parts[i + 1]; + } + } + + return strict; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleIdOption.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleIdOption.js new file mode 100644 index 00000000..0e4264f8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleIdOption.js @@ -0,0 +1,20 @@ +'use strict'; + +const addAutoId = require('./addAutoId'); + +module.exports = function handleIdOption(schema, options) { + if (options?._id == null) { + return schema; + } + + schema = schema.clone(); + if (!options._id) { + schema.remove('_id'); + schema.options._id = false; + } else if (!schema.paths['_id']) { + addAutoId(schema); + schema.options._id = true; + } + + return schema; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js new file mode 100644 index 00000000..0f9c30c3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = handleTimestampOption; + +/*! + * ignore + */ + +function handleTimestampOption(arg, prop) { + if (arg == null) { + return null; + } + + if (typeof arg === 'boolean') { + return prop; + } + if (typeof arg[prop] === 'boolean') { + return arg[prop] ? prop : null; + } + if (!(prop in arg)) { + return prop; + } + return arg[prop]; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/idGetter.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/idGetter.js new file mode 100644 index 00000000..fe609fcf --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/idGetter.js @@ -0,0 +1,37 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function addIdGetter(schema) { + // ensure the documents receive an id getter unless disabled + const autoIdGetter = !schema.paths['id'] && + schema.paths['_id'] && + schema.options.id; + if (!autoIdGetter) { + return schema; + } + if (schema.aliases?.id) { + return schema; + } + schema.virtual('id').get(idGetter); + + return schema; +}; + +/** + * Returns this documents _id cast to a string. + * @api private + */ + +function idGetter() { + if (this._doc) { + return this._doc._id?.toString() ?? null; + } + if (this._id != null) { + return this._id.toString(); + } + + return null; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/merge.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/merge.js new file mode 100644 index 00000000..e7bb91f6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schema/merge.js @@ -0,0 +1,36 @@ +'use strict'; + +module.exports = function merge(s1, s2, skipConflictingPaths) { + const paths = Object.keys(s2.tree); + const pathsToAdd = {}; + for (const key of paths) { + if (skipConflictingPaths && (s1.paths[key] || s1.nested[key] || s1.singleNestedPaths[key])) { + continue; + } + pathsToAdd[key] = s2.tree[key]; + } + s1.options._isMerging = true; + s1.add(pathsToAdd, null); + delete s1.options._isMerging; + + s1.callQueue = s1.callQueue.concat(s2.callQueue); + s1.method(s2.methods); + s1.static(s2.statics); + + for (const [option, value] of Object.entries(s2._userProvidedOptions)) { + if (!(option in s1._userProvidedOptions)) { + s1.set(option, value); + } + } + + for (const query in s2.query) { + s1.query[query] = s2.query[query]; + } + + for (const virtual in s2.virtuals) { + s1.virtuals[virtual] = s2.virtuals[virtual].clone(); + } + + s1._indexes = s1._indexes.concat(s2._indexes || []); + s1.s.hooks.merge(s2.s.hooks, false); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js new file mode 100644 index 00000000..4bb5a930 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js @@ -0,0 +1,50 @@ +'use strict'; + +const StrictModeError = require('../../error/strict'); + +/*! + * ignore + */ + +module.exports = function(schematype) { + if (schematype.$immutable) { + schematype.$immutableSetter = createImmutableSetter(schematype.path, + schematype.options.immutable); + schematype.set(schematype.$immutableSetter); + } else if (schematype.$immutableSetter) { + schematype.setters = schematype.setters. + filter(fn => fn !== schematype.$immutableSetter); + delete schematype.$immutableSetter; + } +}; + +function createImmutableSetter(path, immutable) { + return function immutableSetter(v, _priorVal, _doc, options) { + if (this == null || this.$__ == null) { + return v; + } + if (this.isNew) { + return v; + } + if (options?.overwriteImmutable) { + return v; + } + + const _immutable = typeof immutable === 'function' ? + immutable.call(this, this) : + immutable; + if (!_immutable) { + return v; + } + + const _value = this.$__.priorDoc != null ? + this.$__.priorDoc.$__getValue(path) : + this.$__getValue(path); + if (this.$__.strictMode === 'throw' && v !== _value) { + throw new StrictModeError(path, 'Path `' + path + '` is immutable ' + + 'and strict mode is set to throw.', true); + } + + return _value; + }; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js new file mode 100644 index 00000000..e2ab6a08 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js @@ -0,0 +1,174 @@ +'use strict'; +const get = require('./get'); + +/** + * Applies defaults to update and findOneAndUpdate operations. + * + * @param {object} filter + * @param {Schema} schema + * @param {object} castedDoc + * @param {object} options + * @param {object} queryMongooseOptions + * @param {object | null} [context] the context to pass to default functions as `this` + * @method setDefaultsOnInsert + * @api private + */ + +module.exports = function(filter, schema, castedDoc, options, queryMongooseOptions, context) { + const shouldSetDefaultsOnInsert = options?.setDefaultsOnInsert ?? + queryMongooseOptions?.setDefaultsOnInsert ?? + schema.base.options.setDefaultsOnInsert; + + if (!options.upsert || shouldSetDefaultsOnInsert === false) { + return castedDoc; + } + + const keys = Object.keys(castedDoc || {}); + const updatedKeys = Object.create(null); + const updatedValues = {}; + const numKeys = keys.length; + + let hasDollarUpdate = false; + + for (let i = 0; i < numKeys; ++i) { + if (keys[i].charAt(0) === '$') { + hasDollarUpdate = true; + break; + } + } + + const paths = Object.keys(filter); + const numPaths = paths.length; + for (let i = 0; i < numPaths; ++i) { + const path = paths[i]; + const condition = filter[path]; + if (condition && typeof condition === 'object') { + const conditionKeys = Object.keys(condition); + const numConditionKeys = conditionKeys.length; + let hasDollarKey = false; + for (let j = 0; j < numConditionKeys; ++j) { + if (conditionKeys[j].charAt(0) === '$') { + hasDollarKey = true; + break; + } + } + if (hasDollarKey) { + continue; + } + } + updatedKeys[path] = true; + if (path.indexOf('.') === -1) { + continue; + } + // Also mark all parent prefixes so child-path lookups are O(1). + // e.g. 'extraProps.location' also marks 'extraProps' + const pieces = schema.paths[path] ? + // If the SchemaType already split for us, use that to avoid the extra overhead + schema.paths[path].splitPath() : + path.split('.'); + let cur = pieces[0]; + for (let j = 1; j < pieces.length; ++j) { + updatedKeys[cur] = true; + cur += '.' + pieces[j]; + } + } + + if (options?.overwrite && !hasDollarUpdate) { + // Defaults will be set later, since we're overwriting we'll cast + // the whole update to a document + return castedDoc; + } + + schema.eachPath(function(path, schemaType) { + // Skip single nested paths if underneath a map + if (schemaType.path === '_id' && schemaType.options.auto) { + return; + } + const def = schemaType.getDefault(null, true, { context }); + if (typeof def === 'undefined') { + return; + } + const pathPieces = schemaType.splitPath(); + if (pathPieces.includes('$*')) { + // Skip defaults underneath maps. We should never do `$setOnInsert` on a path with `$*` + return; + } + if (isModified(castedDoc, updatedKeys, path, pathPieces, hasDollarUpdate)) { + return; + } + + castedDoc = castedDoc || {}; + castedDoc.$setOnInsert = castedDoc.$setOnInsert || {}; + if (get(castedDoc, path) == null) { + castedDoc.$setOnInsert[path] = def; + } + updatedValues[path] = def; + }); + + return castedDoc; +}; + +function isModified(castedDoc, updatedKeys, path, pathPieces, hasDollarUpdate) { + // Check if path is in filter (updatedKeys) + if (updatedKeys[path]) { + return true; + } + + // Check if any parent path is in filter + let cur = pathPieces[0]; + for (let i = 1; i < pathPieces.length; ++i) { + if (updatedKeys[cur]) { + return true; + } + cur += '.' + pathPieces[i]; + } + + // Check if path is modified in the update + if (hasDollarUpdate) { + // Check each update operator + for (const key in castedDoc) { + if (key.charAt(0) === '$') { + if (pathExistsInUpdate(castedDoc[key], path, pathPieces)) { + return true; + } + } + } + } else { + // No dollar operators, check the castedDoc directly + if (pathExistsInUpdate(castedDoc, path, pathPieces)) { + return true; + } + } + + return false; +} + +function pathExistsInUpdate(update, targetPath, pathPieces) { + if (update == null || typeof update !== 'object') { + return false; + } + + // Check exact match + if (Object.hasOwn(update, targetPath)) { + return true; + } + + // Check if any parent path exists + let cur = pathPieces[0]; + for (let i = 1; i < pathPieces.length; ++i) { + if (Object.hasOwn(update, cur)) { + return true; + } + cur += '.' + pathPieces[i]; + } + + // Check if any child path exists (e.g., path is "a" and update has "a.b") + const prefix = targetPath + '.'; + for (const key in update) { + if (key.startsWith(prefix)) { + return true; + } + } + + return false; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/specialProperties.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/specialProperties.js new file mode 100644 index 00000000..8a961e4e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/specialProperties.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = new Set(['__proto__', 'constructor', 'prototype']); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/symbols.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/symbols.js new file mode 100644 index 00000000..a9af890a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/symbols.js @@ -0,0 +1,20 @@ +'use strict'; + +exports.arrayAtomicsBackupSymbol = Symbol('mongoose#Array#atomicsBackup'); +exports.arrayAtomicsSymbol = Symbol('mongoose#Array#_atomics'); +exports.arrayParentSymbol = Symbol('mongoose#Array#_parent'); +exports.arrayPathSymbol = Symbol('mongoose#Array#_path'); +exports.arraySchemaSymbol = Symbol('mongoose#Array#_schema'); +exports.documentArrayParent = Symbol('mongoose#documentArrayParent'); +exports.documentIsSelected = Symbol('mongoose#Document#isSelected'); +exports.documentIsModified = Symbol('mongoose#Document#isModified'); +exports.documentModifiedPaths = Symbol('mongoose#Document#modifiedPaths'); +exports.documentSchemaSymbol = Symbol('mongoose#Document#schema'); +exports.getSymbol = Symbol('mongoose#Document#get'); +exports.modelSymbol = Symbol('mongoose#Model'); +exports.objectIdSymbol = Symbol('mongoose#ObjectId'); +exports.populateModelSymbol = Symbol('mongoose#PopulateOptions#Model'); +exports.schemaTypeSymbol = Symbol('mongoose#schemaType'); +exports.sessionNewDocuments = Symbol('mongoose#ClientSession#newDocuments'); +exports.scopeSymbol = Symbol('mongoose#Document#scope'); +exports.validatorErrorSymbol = Symbol('mongoose#validatorError'); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timers.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timers.js new file mode 100644 index 00000000..eb7e6453 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timers.js @@ -0,0 +1,3 @@ +'use strict'; + +exports.setTimeout = setTimeout; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js new file mode 100644 index 00000000..c4af1f08 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js @@ -0,0 +1,26 @@ +'use strict'; + +module.exports = function setDocumentTimestamps(doc, timestampOption, currentTime, createdAt, updatedAt) { + const skipUpdatedAt = timestampOption?.updatedAt === false; + const skipCreatedAt = timestampOption?.createdAt === false; + + const defaultTimestamp = currentTime != null ? + currentTime() : + doc.ownerDocument().constructor.base.now(); + + if (!skipCreatedAt && + (doc.isNew || doc.$isSubdocument) && + createdAt && + !doc.$__getValue(createdAt) && + doc.$__isSelected(createdAt)) { + doc.$set(createdAt, defaultTimestamp, undefined, { overwriteImmutable: true }); + } + + if (!skipUpdatedAt && updatedAt && (doc.isNew || doc.$isModified())) { + let ts = defaultTimestamp; + if (doc.isNew && createdAt != null) { + ts = doc.$__getValue(createdAt); + } + doc.$set(updatedAt, ts); + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js new file mode 100644 index 00000000..2072dd8d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js @@ -0,0 +1,133 @@ +'use strict'; + +const applyTimestampsToChildren = require('../update/applyTimestampsToChildren'); +const applyTimestampsToUpdate = require('../update/applyTimestampsToUpdate'); +const handleTimestampOption = require('../schema/handleTimestampOption'); +const setDocumentTimestamps = require('./setDocumentTimestamps'); +const symbols = require('../../schema/symbols'); + +const replaceOps = new Set([ + 'replaceOne', + 'findOneAndReplace' +]); + +module.exports = function setupTimestamps(schema, timestamps) { + const childHasTimestamp = schema.childSchemas.find(withTimestamp); + function withTimestamp(s) { + const ts = s.schema.options.timestamps; + return !!ts; + } + if (!timestamps && !childHasTimestamp) { + return; + } + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + const currentTime = timestamps != null && Object.hasOwn(timestamps, 'currentTime') ? + timestamps.currentTime : + null; + const schemaAdditions = {}; + + schema.$timestamps = { createdAt: createdAt, updatedAt: updatedAt }; + + if (createdAt && !schema.paths[createdAt]) { + const baseImmutableCreatedAt = schema.base?.get('timestamps.createdAt.immutable') ?? null; + const immutable = baseImmutableCreatedAt ?? true; + schemaAdditions[createdAt] = { [schema.options.typeKey || 'type']: Date, immutable }; + } + + if (updatedAt && !schema.paths[updatedAt]) { + schemaAdditions[updatedAt] = Date; + } + + schema.add(schemaAdditions); + + schema.pre('save', timestampsPreSave); + + schema.methods.initializeTimestamps = function(timestampsOptions) { + if (timestampsOptions === false) { + return this; + } + const ts = currentTime != null ? + currentTime() : this.constructor.base.now(); + + const initTimestampsCreatedAt = timestampsOptions != null ? + handleTimestampOption(timestampsOptions, 'createdAt') : + createdAt; + const initTimestampsUpdatedAt = timestampsOptions != null ? + handleTimestampOption(timestampsOptions, 'updatedAt') : + updatedAt; + + if (initTimestampsCreatedAt && !this.get(initTimestampsCreatedAt)) { + this.$set(createdAt, ts); + } + if (initTimestampsUpdatedAt && !this.get(initTimestampsUpdatedAt)) { + this.$set(updatedAt, ts); + } + if (this.$isSubdocument) { + return this; + } + + const subdocs = this.$getAllSubdocs(); + for (const subdoc of subdocs) { + if (subdoc.initializeTimestamps) { + subdoc.initializeTimestamps(timestampsOptions); + } + } + + return this; + }; + + const opts = { query: true, model: false }; + schema.pre('findOneAndReplace', opts, _setTimestampsOnUpdate); + schema.pre('findOneAndUpdate', opts, _setTimestampsOnUpdate); + schema.pre('replaceOne', opts, _setTimestampsOnUpdate); + schema.pre('update', opts, _setTimestampsOnUpdate); + schema.pre('updateOne', opts, _setTimestampsOnUpdate); + schema.pre('updateMany', opts, _setTimestampsOnUpdate); +}; + +function timestampsPreSave() { + const timestampOption = this.$__?.saveOptions?.timestamps; + if (timestampOption === false) { + return; + } + + const schema = this.$__schema; + const { createdAt, updatedAt } = schema.$timestamps; + const timestamps = schema.options.timestamps; + const currentTime = timestamps != null && Object.hasOwn(timestamps, 'currentTime') ? + timestamps.currentTime : + null; + + setDocumentTimestamps(this, timestampOption, currentTime, createdAt, updatedAt); +} + +function _setTimestampsOnUpdate() { + const schema = this.model.schema; + const { createdAt, updatedAt } = schema.$timestamps; + const timestamps = schema.options.timestamps; + const currentTime = timestamps != null && Object.hasOwn(timestamps, 'currentTime') ? + timestamps.currentTime : + null; + + const now = currentTime != null ? + currentTime() : + this.model.base.now(); + // Replacing with null update should still trigger timestamps + if (replaceOps.has(this.op) && this.getUpdate() == null) { + this.setUpdate({}); + } + applyTimestampsToUpdate( + now, + createdAt, + updatedAt, + this.getUpdate(), + this._mongooseOptions, + this.options.upsert, + replaceOps.has(this.op) + ); + applyTimestampsToChildren(now, this.getUpdate(), this.model.schema); +} + +timestampsPreSave[symbols.builtInMiddleware] = true; +_setTimestampsOnUpdate[symbols.builtInMiddleware] = true; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js new file mode 100644 index 00000000..45c40ba4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js @@ -0,0 +1,12 @@ +'use strict'; + +const getConstructorName = require('../getConstructorName'); + +module.exports = function allServersUnknown(topologyDescription) { + if (getConstructorName(topologyDescription) !== 'TopologyDescription') { + return false; + } + + const servers = Array.from(topologyDescription.servers.values()); + return servers.length > 0 && servers.every(server => server.type === 'Unknown'); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isAtlas.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isAtlas.js new file mode 100644 index 00000000..445a8b49 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isAtlas.js @@ -0,0 +1,31 @@ +'use strict'; + +const getConstructorName = require('../getConstructorName'); + +/** + * @typedef { import('mongodb').TopologyDescription } TopologyDescription + */ + +/** + * Checks if topologyDescription contains servers connected to an atlas instance + * + * @param {TopologyDescription} topologyDescription + * @returns {boolean} + */ +module.exports = function isAtlas(topologyDescription) { + if (getConstructorName(topologyDescription) !== 'TopologyDescription') { + return false; + } + + if (topologyDescription.servers.size === 0) { + return false; + } + + for (const server of topologyDescription.servers.values()) { + if (server.host.endsWith('.mongodb.net') === false || server.port !== 27017) { + return false; + } + } + + return true; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isSSLError.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isSSLError.js new file mode 100644 index 00000000..17c1c501 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/topology/isSSLError.js @@ -0,0 +1,16 @@ +'use strict'; + +const getConstructorName = require('../getConstructorName'); + +const nonSSLMessage = 'Client network socket disconnected before secure TLS ' + + 'connection was established'; + +module.exports = function isSSLError(topologyDescription) { + if (getConstructorName(topologyDescription) !== 'TopologyDescription') { + return false; + } + + const descriptions = Array.from(topologyDescription.servers.values()); + return descriptions.length > 0 && + descriptions.every(descr => descr.error && descr.error.message.indexOf(nonSSLMessage) !== -1); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js new file mode 100644 index 00000000..5b8e7deb --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js @@ -0,0 +1,193 @@ +'use strict'; + +const cleanPositionalOperators = require('../schema/cleanPositionalOperators'); +const handleTimestampOption = require('../schema/handleTimestampOption'); + +module.exports = applyTimestampsToChildren; + +/*! + * ignore + */ + +function applyTimestampsToChildren(now, update, schema) { + if (update == null) { + return; + } + + const keys = Object.keys(update); + const hasDollarKey = keys.some(key => key[0] === '$'); + + if (hasDollarKey) { + if (update.$push) { + _applyTimestampToUpdateOperator(update.$push); + } + if (update.$addToSet) { + _applyTimestampToUpdateOperator(update.$addToSet); + } + if (update.$set != null) { + const keys = Object.keys(update.$set); + for (const key of keys) { + applyTimestampsToUpdateKey(schema, key, update.$set, now); + } + } + if (update.$setOnInsert != null) { + const keys = Object.keys(update.$setOnInsert); + for (const key of keys) { + applyTimestampsToUpdateKey(schema, key, update.$setOnInsert, now); + } + } + } + + const updateKeys = Object.keys(update).filter(key => key[0] !== '$'); + for (const key of updateKeys) { + applyTimestampsToUpdateKey(schema, key, update, now); + } + + function _applyTimestampToUpdateOperator(op) { + for (const key of Object.keys(op)) { + const $path = schema.path(key.replace(/\.\$\./i, '.').replace(/.\$$/, '')); + if (op[key] && + $path && + $path.$isMongooseDocumentArray && + $path.schema.options.timestamps) { + const timestamps = $path.schema.options.timestamps; + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + if (op[key].$each) { + op[key].$each.forEach(function(subdoc) { + if (updatedAt != null) { + subdoc[updatedAt] = now; + } + if (createdAt != null) { + subdoc[createdAt] = now; + } + + applyTimestampsToChildren(now, subdoc, $path.schema); + }); + } else { + if (updatedAt != null) { + op[key][updatedAt] = now; + } + if (createdAt != null) { + op[key][createdAt] = now; + } + + applyTimestampsToChildren(now, op[key], $path.schema); + } + } + } + } +} + +function applyTimestampsToDocumentArray(arr, schematype, now) { + const timestamps = schematype.schema.options.timestamps; + + const len = arr.length; + + if (!timestamps) { + for (let i = 0; i < len; ++i) { + applyTimestampsToChildren(now, arr[i], schematype.schema); + } + return; + } + + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + for (let i = 0; i < len; ++i) { + if (updatedAt != null) { + arr[i][updatedAt] = now; + } + if (createdAt != null) { + arr[i][createdAt] = now; + } + + applyTimestampsToChildren(now, arr[i], schematype.schema); + } +} + +function applyTimestampsToSingleNested(subdoc, schematype, now) { + const timestamps = schematype.schema.options.timestamps; + if (!timestamps) { + applyTimestampsToChildren(now, subdoc, schematype.schema); + return; + } + + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + if (updatedAt != null) { + subdoc[updatedAt] = now; + } + if (createdAt != null) { + subdoc[createdAt] = now; + } + + applyTimestampsToChildren(now, subdoc, schematype.schema); +} + +function applyTimestampsToUpdateKey(schema, key, update, now) { + // Replace positional operator `$` and array filters `$[]` and `$[.*]` + const keyToSearch = cleanPositionalOperators(key); + const path = schema.path(keyToSearch); + if (!path) { + return; + } + + const parentSchemaTypes = []; + const pieces = keyToSearch.split('.'); + for (let i = pieces.length - 1; i > 0; --i) { + const s = schema.path(pieces.slice(0, i).join('.')); + if (s != null && + (s.$isMongooseDocumentArray || s.$isSingleNested)) { + parentSchemaTypes.push({ parentPath: key.split('.').slice(0, i).join('.'), parentSchemaType: s }); + } + } + + if (Array.isArray(update[key]) && path.$isMongooseDocumentArray) { + applyTimestampsToDocumentArray(update[key], path, now); + } else if (update[key] && path.$isSingleNested) { + applyTimestampsToSingleNested(update[key], path, now); + } else if (parentSchemaTypes.length > 0) { + for (const item of parentSchemaTypes) { + const parentPath = item.parentPath; + const parentSchemaType = item.parentSchemaType; + const timestamps = parentSchemaType.schema.options.timestamps; + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + + if (!timestamps || updatedAt == null) { + continue; + } + + if (parentSchemaType.$isSingleNested) { + // Single nested is easy + update[parentPath + '.' + updatedAt] = now; + } else if (parentSchemaType.$isMongooseDocumentArray) { + let childPath = key.substring(parentPath.length + 1); + + if (/^\d+$/.test(childPath)) { + update[parentPath + '.' + childPath][updatedAt] = now; + continue; + } + + const firstDot = childPath.indexOf('.'); + childPath = firstDot !== -1 ? childPath.substring(0, firstDot) : childPath; + + update[parentPath + '.' + childPath + '.' + updatedAt] = now; + } + } + } else if (path.schema != null && path.schema != schema && update[key]) { + const timestamps = path.schema.options.timestamps; + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + + if (!timestamps) { + return; + } + + if (updatedAt != null) { + update[key][updatedAt] = now; + } + if (createdAt != null) { + update[key][createdAt] = now; + } + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js new file mode 100644 index 00000000..3948d2fc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js @@ -0,0 +1,132 @@ +'use strict'; + +/*! + * ignore + */ + +const utils = require('../../utils'); + +module.exports = applyTimestampsToUpdate; + +/*! + * ignore + */ + +function applyTimestampsToUpdate(now, createdAt, updatedAt, currentUpdate, options, upsert, isReplace) { + const updates = currentUpdate; + let _updates = updates; + const timestamps = options?.timestamps ?? true; + + // Support skipping timestamps at the query level, see gh-6980 + if (!timestamps || updates == null) { + return currentUpdate; + } + + const skipCreatedAt = timestamps?.createdAt === false; + const skipUpdatedAt = timestamps?.updatedAt === false; + + if (isReplace) { + if (currentUpdate?.$set) { + currentUpdate = currentUpdate.$set; + updates.$set = {}; + _updates = updates.$set; + } + if (!skipUpdatedAt && updatedAt && !currentUpdate[updatedAt]) { + _updates[updatedAt] = now; + } + if (!skipCreatedAt && createdAt && !currentUpdate[createdAt]) { + _updates[createdAt] = now; + } + return updates; + } + currentUpdate = currentUpdate || {}; + + if (Array.isArray(updates)) { + // Update with aggregation pipeline + if (updatedAt == null) { + return updates; + } + updates.push({ $set: { [updatedAt]: now } }); + return updates; + } + updates.$set = updates.$set || {}; + if (!skipUpdatedAt && updatedAt && + !currentUpdate.$currentDate?.[updatedAt]) { + let timestampSet = false; + if (updatedAt.indexOf('.') !== -1) { + const pieces = updatedAt.split('.'); + for (let i = 1; i < pieces.length; ++i) { + const remnant = pieces.slice(-i).join('.'); + const start = pieces.slice(0, -i).join('.'); + if (currentUpdate[start] != null) { + currentUpdate[start][remnant] = now; + timestampSet = true; + break; + } else if (currentUpdate.$set?.[start]) { + currentUpdate.$set[start][remnant] = now; + timestampSet = true; + break; + } + } + } + + if (!timestampSet) { + updates.$set[updatedAt] = now; + } + + if (Object.hasOwn(updates, updatedAt)) { + delete updates[updatedAt]; + } + } + + if (!skipCreatedAt && createdAt) { + const overwriteImmutable = options?.overwriteImmutable; + const hasUserCreatedAt = currentUpdate[createdAt] != null + || currentUpdate.$set?.[createdAt] != null + || currentUpdate.$setOnInsert?.[createdAt] != null; + + // If overwriteImmutable is true and user provided createdAt, keep their value + if (overwriteImmutable && hasUserCreatedAt) { + // Move createdAt from top-level to $set if needed + if (currentUpdate[createdAt] != null) { + updates.$set[createdAt] = currentUpdate[createdAt]; + delete currentUpdate[createdAt]; + } + // User's value is already in $set or $setOnInsert, nothing more to do + } else { + if (currentUpdate[createdAt]) { + delete currentUpdate[createdAt]; + } + if (currentUpdate.$set?.[createdAt]) { + delete currentUpdate.$set[createdAt]; + } + let timestampSet = false; + if (createdAt.indexOf('.') !== -1) { + const pieces = createdAt.split('.'); + for (let i = 1; i < pieces.length; ++i) { + const remnant = pieces.slice(-i).join('.'); + const start = pieces.slice(0, -i).join('.'); + if (currentUpdate[start] != null) { + currentUpdate[start][remnant] = now; + timestampSet = true; + break; + } else if (currentUpdate.$set?.[start]) { + currentUpdate.$set[start][remnant] = now; + timestampSet = true; + break; + } + } + } + + if (!timestampSet && upsert) { + updates.$setOnInsert = updates.$setOnInsert || {}; + updates.$setOnInsert[createdAt] = now; + } + } + } + + if (utils.hasOwnKeys(updates.$set) === false) { + delete updates.$set; + } + return updates; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/castArrayFilters.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/castArrayFilters.js new file mode 100644 index 00000000..381efe75 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/castArrayFilters.js @@ -0,0 +1,113 @@ +'use strict'; + +const castFilterPath = require('../query/castFilterPath'); +const cleanPositionalOperators = require('../schema/cleanPositionalOperators'); +const getPath = require('../schema/getPath'); +const updatedPathsByArrayFilter = require('./updatedPathsByArrayFilter'); +const utils = require('../../utils'); + +module.exports = function castArrayFilters(query) { + const arrayFilters = query.options.arrayFilters; + if (!Array.isArray(arrayFilters)) { + return; + } + const update = query.getUpdate(); + const schema = query.schema; + const updatedPathsByFilter = updatedPathsByArrayFilter(update); + + let strictQuery = schema.options.strict; + if (query._mongooseOptions.strict != null) { + strictQuery = query._mongooseOptions.strict; + } + if (query.model?.base.options.strictQuery != null) { + strictQuery = query.model.base.options.strictQuery; + } + if (schema._userProvidedOptions.strictQuery != null) { + strictQuery = schema._userProvidedOptions.strictQuery; + } + if (query._mongooseOptions.strictQuery != null) { + strictQuery = query._mongooseOptions.strictQuery; + } + + _castArrayFilters(arrayFilters, schema, strictQuery, updatedPathsByFilter, query); +}; + +function _castArrayFilters(arrayFilters, schema, strictQuery, updatedPathsByFilter, query) { + // Map to store discriminator values for embedded documents in the array filters. + // This is used to handle cases where array filters target specific embedded document types. + const discriminatorValueMap = {}; + + for (const filter of arrayFilters) { + if (filter == null) { + throw new Error(`Got null array filter in ${arrayFilters}`); + } + const keys = Object.keys(filter).filter(key => filter[key] != null); + if (keys.length === 0) { + continue; + } + + const firstKey = keys[0]; + if (firstKey === '$and' || firstKey === '$or') { + for (const key of keys) { + _castArrayFilters(filter[key], schema, strictQuery, updatedPathsByFilter, query); + } + continue; + } + const dot = firstKey.indexOf('.'); + const filterWildcardPath = dot === -1 ? firstKey : firstKey.substring(0, dot); + if (updatedPathsByFilter[filterWildcardPath] == null) { + continue; + } + const baseFilterPath = cleanPositionalOperators( + updatedPathsByFilter[filterWildcardPath] + ); + + const baseSchematype = getPath(schema, baseFilterPath, discriminatorValueMap); + let filterBaseSchema = baseSchematype != null ? baseSchematype.schema : null; + if (filterBaseSchema?.discriminators != null && + filter[filterWildcardPath + '.' + filterBaseSchema.options.discriminatorKey]) { + filterBaseSchema = filterBaseSchema.discriminators[filter[filterWildcardPath + '.' + filterBaseSchema.options.discriminatorKey]] || filterBaseSchema; + discriminatorValueMap[baseFilterPath] = filter[filterWildcardPath + '.' + filterBaseSchema.options.discriminatorKey]; + } + + for (const key of keys) { + if (updatedPathsByFilter[key] === null) { + continue; + } + if (utils.hasOwnKeys(updatedPathsByFilter) === false) { + continue; + } + const dot = key.indexOf('.'); + + let filterPathRelativeToBase = dot === -1 ? null : key.substring(dot); + let schematype; + if (filterPathRelativeToBase == null || filterBaseSchema == null) { + schematype = baseSchematype; + } else { + // If there are multiple array filters in the path being updated, make sure + // to replace them so we can get the schema path. + filterPathRelativeToBase = cleanPositionalOperators(filterPathRelativeToBase); + schematype = getPath(filterBaseSchema, filterPathRelativeToBase, discriminatorValueMap); + } + + if (schematype == null) { + if (!strictQuery) { + return; + } + const filterPath = filterPathRelativeToBase == null ? + baseFilterPath + '.0' : + baseFilterPath + '.0' + filterPathRelativeToBase; + // For now, treat `strictQuery = true` and `strictQuery = 'throw'` as + // equivalent for casting array filters. `strictQuery = true` doesn't + // quite work in this context because we never want to silently strip out + // array filters, even if the path isn't in the schema. + throw new Error(`Could not find path "${filterPath}" in schema`); + } + if (typeof filter[key] === 'object') { + filter[key] = castFilterPath(query, schematype, filter[key]); + } else { + filter[key] = schematype.castForQuery(null, filter[key]); + } + } + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js new file mode 100644 index 00000000..266996cc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js @@ -0,0 +1,35 @@ +'use strict'; + +/** + * Decorate the update with a version key, if necessary + * @api private + */ + +module.exports = function decorateUpdateWithVersionKey(update, options, versionKey) { + if (!versionKey || !options?.upsert) { + return; + } + + if (options.overwrite) { + if (!hasKey(update, versionKey)) { + update[versionKey] = 0; + } + } else if ( + !hasKey(update, versionKey) && + !hasKey(update?.$set, versionKey) && + !hasKey(update?.$inc, versionKey) && + !hasKey(update?.$setOnInsert, versionKey) + ) { + if (!update.$setOnInsert) { + update.$setOnInsert = {}; + } + update.$setOnInsert[versionKey] = 0; + } +}; + +function hasKey(obj, key) { + if (obj == null || typeof obj !== 'object') { + return false; + } + return Object.hasOwn(obj, key); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/modifiedPaths.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/modifiedPaths.js new file mode 100644 index 00000000..916456df --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/modifiedPaths.js @@ -0,0 +1,33 @@ +'use strict'; + +const _modifiedPaths = require('../common').modifiedPaths; + +/** + * Given an update document with potential update operators (`$set`, etc.) + * returns an object whose keys are the directly modified paths. + * + * If there are any top-level keys that don't start with `$`, we assume those + * will get wrapped in a `$set`. The Mongoose Query is responsible for wrapping + * top-level keys in `$set`. + * + * @param {object} update + * @return {object} modified + */ + +module.exports = function modifiedPaths(update) { + const keys = Object.keys(update); + const res = {}; + + const withoutDollarKeys = {}; + for (const key of keys) { + if (key.startsWith('$')) { + _modifiedPaths(update[key], '', res); + continue; + } + withoutDollarKeys[key] = update[key]; + } + + _modifiedPaths(withoutDollarKeys, '', res); + + return res; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js new file mode 100644 index 00000000..81a62a82 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js @@ -0,0 +1,53 @@ +'use strict'; + +const get = require('../get'); + +/** + * Given an update, move all $set on immutable properties to $setOnInsert. + * This should only be called for upserts, because $setOnInsert bypasses the + * strictness check for immutable properties. + */ + +module.exports = function moveImmutableProperties(schema, update, ctx) { + if (update == null) { + return; + } + + const keys = Object.keys(update); + for (const key of keys) { + const isDollarKey = key.startsWith('$'); + + if (key === '$set') { + const updatedPaths = Object.keys(update[key]); + for (const path of updatedPaths) { + _walkUpdatePath(schema, update[key], path, update, ctx); + } + } else if (!isDollarKey) { + _walkUpdatePath(schema, update, key, update, ctx); + } + + } +}; + +function _walkUpdatePath(schema, op, path, update, ctx) { + const schematype = schema.path(path); + if (schematype == null) { + return; + } + + let immutable = get(schematype, 'options.immutable', null); + if (immutable == null) { + return; + } + if (typeof immutable === 'function') { + immutable = immutable.call(ctx, ctx); + } + + if (!immutable) { + return; + } + + update.$setOnInsert = update.$setOnInsert || {}; + update.$setOnInsert[path] = op[path]; + delete op[path]; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js new file mode 100644 index 00000000..eaa9a3de --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js @@ -0,0 +1,37 @@ +'use strict'; + +/** + * MongoDB throws an error if there's unused array filters. That is, if `options.arrayFilters` defines + * a filter, but none of the `update` keys use it. This should be enough to filter out all unused array + * filters. + */ + +module.exports = function removeUnusedArrayFilters(update, options) { + const arrayFilters = options?.arrayFilters; + if (!Array.isArray(arrayFilters)) { + return; + } + + const updateKeys = Object.keys(update). + map(key => Object.keys(update[key])). + reduce((cur, arr) => cur.concat(arr), []); + options.arrayFilters = options.arrayFilters.filter(obj => { + return _checkSingleFilterKey(obj, updateKeys); + }); +}; + +function _checkSingleFilterKey(arrayFilter, updateKeys) { + const firstKey = Object.keys(arrayFilter)[0]; + + if (firstKey === '$and' || firstKey === '$or') { + if (!Array.isArray(arrayFilter[firstKey])) { + return false; + } + return arrayFilter[firstKey].find(filter => _checkSingleFilterKey(filter, updateKeys)) != null; + } + + const firstDot = firstKey.indexOf('.'); + const arrayFilterKey = firstDot === -1 ? firstKey : firstKey.slice(0, firstDot); + + return updateKeys.find(key => key.includes('$[' + arrayFilterKey + ']')) != null; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js new file mode 100644 index 00000000..fe7d3b68 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js @@ -0,0 +1,27 @@ +'use strict'; + +const modifiedPaths = require('./modifiedPaths'); + +module.exports = function updatedPathsByArrayFilter(update) { + if (update == null) { + return {}; + } + const updatedPaths = modifiedPaths(update); + + return Object.keys(updatedPaths).reduce((cur, path) => { + const matches = path.match(/\$\[[^\]]+\]/g); + if (matches == null) { + return cur; + } + for (const match of matches) { + const firstMatch = path.indexOf(match); + if (firstMatch !== path.lastIndexOf(match)) { + throw new Error(`Path '${path}' contains the same array filter multiple times`); + } + cur[match.substring(2, match.length - 1)] = path. + substring(0, firstMatch - 1). + replace(/\$\[[^\]]+\]/g, '0'); + } + return cur; + }, {}); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/updateValidators.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/updateValidators.js new file mode 100644 index 00000000..e87d9cab --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/helpers/updateValidators.js @@ -0,0 +1,186 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ValidationError = require('../error/validation'); +const cleanPositionalOperators = require('./schema/cleanPositionalOperators'); +const flatten = require('./common').flatten; + +/** + * Applies validators and defaults to update and findOneAndUpdate operations, + * specifically passing a null doc as `this` to validators and defaults + * + * @param {Query} query + * @param {Schema} schema + * @param {object} castedDoc + * @param {object} options + * @method runValidatorsOnUpdate + * @api private + */ + +module.exports = async function updateValidators(query, schema, castedDoc, options) { + const keys = Object.keys(castedDoc || {}); + let updatedKeys = {}; + let updatedValues = {}; + const isPull = {}; + const arrayAtomicUpdates = {}; + const numKeys = keys.length; + let hasDollarUpdate = false; + let currentUpdate; + let key; + + for (let i = 0; i < numKeys; ++i) { + if (keys[i].startsWith('$')) { + hasDollarUpdate = true; + if (keys[i] === '$push' || keys[i] === '$addToSet') { + const _keys = Object.keys(castedDoc[keys[i]]); + for (let ii = 0; ii < _keys.length; ++ii) { + currentUpdate = castedDoc[keys[i]][_keys[ii]]; + if (currentUpdate?.$each) { + arrayAtomicUpdates[_keys[ii]] = (arrayAtomicUpdates[_keys[ii]] || []). + concat(currentUpdate.$each); + } else { + arrayAtomicUpdates[_keys[ii]] = (arrayAtomicUpdates[_keys[ii]] || []). + concat([currentUpdate]); + } + } + continue; + } + const flat = flatten(castedDoc[keys[i]], null, null, schema); + const paths = Object.keys(flat); + const numPaths = paths.length; + for (let j = 0; j < numPaths; ++j) { + const updatedPath = cleanPositionalOperators(paths[j]); + key = keys[i]; + // With `$pull` we might flatten `$in`. Skip stuff nested under `$in` + // for the rest of the logic, it will get handled later. + if (updatedPath.includes('$')) { + continue; + } + if (key === '$set' || key === '$setOnInsert' || + key === '$pull' || key === '$pullAll') { + updatedValues[updatedPath] = flat[paths[j]]; + isPull[updatedPath] = key === '$pull' || key === '$pullAll'; + } else if (key === '$unset') { + updatedValues[updatedPath] = undefined; + } + updatedKeys[updatedPath] = true; + } + } + } + + if (!hasDollarUpdate) { + updatedValues = flatten(castedDoc, null, null, schema); + updatedKeys = Object.keys(updatedValues); + } + + const updates = Object.keys(updatedValues); + const numUpdates = updates.length; + const validatorsToExecute = []; + const validationErrors = []; + + const alreadyValidated = []; + + const context = query; + for (let i = 0; i < numUpdates; ++i) { + const v = updatedValues[updates[i]]; + const schemaPath = schema._getSchema(updates[i]); + if (schemaPath == null) { + continue; + } + if (schemaPath.instance === 'Mixed' && schemaPath.path !== updates[i]) { + continue; + } + + if (v && Array.isArray(v.$in)) { + v.$in.forEach((v, i) => { + validatorsToExecute.push( + schemaPath.doValidate(v, context, { updateValidator: true }).catch(err => { + err.path = updates[i] + '.$in.' + i; + validationErrors.push(err); + }) + ); + }); + } else { + if (isPull[updates[i]] && + schemaPath.$isMongooseArray) { + continue; + } + + if (schemaPath.$isMongooseDocumentArrayElement && v?.$__ != null) { + alreadyValidated.push(updates[i]); + validatorsToExecute.push( + schemaPath.doValidate(v, context, { updateValidator: true }).catch(err => { + if (err.errors) { + for (const key of Object.keys(err.errors)) { + const _err = err.errors[key]; + _err.path = updates[i] + '.' + key; + validationErrors.push(_err); + } + } else { + err.path = updates[i]; + validationErrors.push(err); + } + }) + ); + } else { + const isAlreadyValidated = alreadyValidated.find(path => updates[i].startsWith(path + '.')); + if (isAlreadyValidated) { + continue; + } + if (schemaPath.$isSingleNested) { + alreadyValidated.push(updates[i]); + } + validatorsToExecute.push( + schemaPath.doValidate(v, context, { updateValidator: true }).catch(err => { + if (schemaPath.schema != null && + schemaPath.schema.options.storeSubdocValidationError === false && + err instanceof ValidationError) { + return; + } + + if (err) { + err.path = updates[i]; + validationErrors.push(err); + } + }) + ); + } + } + } + + const arrayUpdates = Object.keys(arrayAtomicUpdates); + for (const arrayUpdate of arrayUpdates) { + let schemaPath = schema._getSchema(arrayUpdate); + if (schemaPath && schemaPath.$isMongooseDocumentArray) { + validatorsToExecute.push( + schemaPath.doValidate( + arrayAtomicUpdates[arrayUpdate], + options?.context === 'query' ? query : null + ).catch(err => { + err.path = arrayUpdate; + validationErrors.push(err); + }) + ); + } else { + schemaPath = schema._getSchema(arrayUpdate + '.0'); + for (const atomicUpdate of arrayAtomicUpdates[arrayUpdate]) { + validatorsToExecute.push( + schemaPath.doValidate( + atomicUpdate, + options?.context === 'query' ? query : null, + { updateValidator: true } + ).catch(err => { + err.path = arrayUpdate; + validationErrors.push(err); + }) + ); + } + } + } + + await Promise.all(validatorsToExecute); + return validationErrors; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/index.js new file mode 100644 index 00000000..67534e9e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/index.js @@ -0,0 +1,17 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const mongodbDriver = require('./drivers/node-mongodb-native'); + +require('./driver').set(mongodbDriver); + +const mongoose = require('./mongoose'); + +mongoose.setDriver(mongodbDriver); + +mongoose.Mongoose.prototype.mongo = require('mongodb'); + +module.exports = mongoose; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/internal.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/internal.js new file mode 100644 index 00000000..de866690 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/internal.js @@ -0,0 +1,48 @@ +/*! + * Dependencies + */ + +'use strict'; + +const StateMachine = require('./stateMachine'); +const ActiveRoster = StateMachine.ctor('require', 'modify', 'init', 'default', 'ignore'); + +module.exports = exports = InternalCache; + +function InternalCache() { + this.activePaths = new ActiveRoster(); +} + +InternalCache.prototype.strictMode = true; + +InternalCache.prototype.fullPath = undefined; +InternalCache.prototype.selected = undefined; +// Lazily computed index over `selected`, see `_getProjectionIndex()` in document.js +InternalCache.prototype.selectedIndex = undefined; +InternalCache.prototype.shardval = undefined; +InternalCache.prototype.saveError = undefined; +InternalCache.prototype.validationError = undefined; +InternalCache.prototype.adhocPaths = undefined; +InternalCache.prototype.removing = undefined; +InternalCache.prototype.inserting = undefined; +InternalCache.prototype.saving = undefined; +InternalCache.prototype.version = undefined; +InternalCache.prototype._id = undefined; +InternalCache.prototype.ownerDocument = undefined; +InternalCache.prototype.populate = undefined; // what we want to populate in this doc +InternalCache.prototype.populated = undefined;// the _ids that have been populated +InternalCache.prototype.primitiveAtomics = undefined; + +/** + * If `false`, this document was not the result of population. + * If `true`, this document is a populated doc underneath another doc + * If an object, this document is a populated doc and the `value` property of the + * object contains the original depopulated value. + */ +InternalCache.prototype.wasPopulated = false; + +InternalCache.prototype.scope = undefined; + +InternalCache.prototype.session = null; +InternalCache.prototype.pathsToScopes = null; +InternalCache.prototype.cachedRequired = null; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/model.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/model.js new file mode 100644 index 00000000..d32d662d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/model.js @@ -0,0 +1,5407 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const Aggregate = require('./aggregate'); +const ChangeStream = require('./cursor/changeStream'); +const Document = require('./document'); +const { createTracedChannel } = require('./tracing'); +const { trace: traceSave } = createTracedChannel('mongoose:model:save'); +const { trace: traceInsertMany } = createTracedChannel('mongoose:model:insertMany'); +const { trace: traceBulkWrite } = createTracedChannel('mongoose:model:bulkWrite'); +const DocumentNotFoundError = require('./error/notFound'); +const EventEmitter = require('events').EventEmitter; +const Kareem = require('kareem'); +const MongooseBulkWriteError = require('./error/bulkWriteError'); +const MongooseError = require('./error/index'); +const ObjectParameterError = require('./error/objectParameter'); +const OverwriteModelError = require('./error/overwriteModel'); +const Query = require('./query'); +const SaveOptions = require('./options/saveOptions'); +const Schema = require('./schema'); +const ValidationError = require('./error/validation'); +const VersionError = require('./error/version'); +const ParallelSaveError = require('./error/parallelSave'); +const applyDefaultsHelper = require('./helpers/document/applyDefaults'); +const isInPathsToSave = require('./helpers/document/isInPathsToSave'); +const applyDefaultsToPOJO = require('./helpers/model/applyDefaultsToPOJO'); +const applyEmbeddedDiscriminators = require('./helpers/discriminator/applyEmbeddedDiscriminators'); +const applyHooks = require('./helpers/model/applyHooks'); +const applyMethods = require('./helpers/model/applyMethods'); +const applyProjection = require('./helpers/projection/applyProjection'); +const applyReadConcern = require('./helpers/schema/applyReadConcern'); +const applySchemaCollation = require('./helpers/indexes/applySchemaCollation'); +const applyStaticHooks = require('./helpers/model/applyStaticHooks'); +const applyStatics = require('./helpers/model/applyStatics'); +const applyTimestampsHelper = require('./helpers/document/applyTimestamps'); +const applyWriteConcern = require('./helpers/schema/applyWriteConcern'); +const applyVirtualsHelper = require('./helpers/document/applyVirtuals'); +const assignVals = require('./helpers/populate/assignVals'); +const castBulkWrite = require('./helpers/model/castBulkWrite'); +const clone = require('./helpers/clone'); +const convertErrorToStandardSchemaIssues = require('./standardSchema/convertErrorToIssues'); +const createPopulateQueryFilter = require('./helpers/populate/createPopulateQueryFilter'); +const decorateUpdateWithVersionKey = require('./helpers/update/decorateUpdateWithVersionKey'); +const getDefaultBulkwriteResult = require('./helpers/getDefaultBulkwriteResult'); +const getSchemaDiscriminatorByValue = require('./helpers/discriminator/getSchemaDiscriminatorByValue'); +const discriminator = require('./helpers/model/discriminator'); +const each = require('./helpers/each'); +const get = require('./helpers/get'); +const getConstructorName = require('./helpers/getConstructorName'); +const getDiscriminatorByValue = require('./helpers/discriminator/getDiscriminatorByValue'); +const getModelsMapForPopulate = require('./helpers/populate/getModelsMapForPopulate'); +const immediate = require('./helpers/immediate'); +const internalToObjectOptions = require('./options').internalToObjectOptions; +const isDefaultIdIndex = require('./helpers/indexes/isDefaultIdIndex'); +const isIndexEqual = require('./helpers/indexes/isIndexEqual'); +const isIndexSpecEqual = require('./helpers/indexes/isIndexSpecEqual'); +const isTimeseriesIndex = require('./helpers/indexes/isTimeseriesIndex'); +const { + getRelatedDBIndexes, + getRelatedSchemaIndexes +} = require('./helpers/indexes/getRelatedIndexes'); +const decorateDiscriminatorIndexOptions = require('./helpers/indexes/decorateDiscriminatorIndexOptions'); +const isPathSelectedInclusive = require('./helpers/projection/isPathSelectedInclusive'); +const leanPopulateMap = require('./helpers/populate/leanPopulateMap'); +const parallelLimit = require('./helpers/parallelLimit'); +const parseProjection = require('./helpers/projection/parseProjection'); +const prepareDiscriminatorPipeline = require('./helpers/aggregate/prepareDiscriminatorPipeline'); +const pushNestedArrayPaths = require('./helpers/model/pushNestedArrayPaths'); +const removeDeselectedForeignField = require('./helpers/populate/removeDeselectedForeignField'); +const setDottedPath = require('./helpers/path/setDottedPath'); +const splitPopulateQuery = require('./helpers/populate/splitPopulateQuery'); +const { buildMiddlewareFilter } = require('./helpers/buildMiddlewareFilter'); +const util = require('util'); +const utils = require('./utils'); +const minimize = require('./helpers/minimize'); +const MongooseBulkSaveIncompleteError = require('./error/bulkSaveIncompleteError'); +const ObjectExpectedError = require('./error/objectExpected'); +const decorateBulkWriteResult = require('./helpers/model/decorateBulkWriteResult'); +const modelCollectionSymbol = Symbol('mongoose#Model#collection'); +const modelDbSymbol = Symbol('mongoose#Model#db'); +const { + arrayAtomicsBackupSymbol, + arrayAtomicsSymbol, + modelSymbol +} = require('./helpers/symbols'); +const subclassedSymbol = Symbol('mongoose#Model#subclassed'); + +const { VERSION_INC, VERSION_WHERE, VERSION_ALL } = Document; + +const saveToObjectOptions = Object.assign({}, internalToObjectOptions, { + bson: true +}); + +/** + * A Model is a class that's your primary tool for interacting with MongoDB. + * An instance of a Model is called a [Document](https://mongoosejs.com/docs/api/document.html#Document). + * + * In Mongoose, the term "Model" refers to subclasses of the `mongoose.Model` + * class. You should not use the `mongoose.Model` class directly. The + * [`mongoose.model()`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.model()) and + * [`connection.model()`](https://mongoosejs.com/docs/api/connection.html#Connection.prototype.model()) functions + * create subclasses of `mongoose.Model` as shown below. + * + * #### Example: + * + * // `UserModel` is a "Model", a subclass of `mongoose.Model`. + * const UserModel = mongoose.model('User', new Schema({ name: String })); + * + * // You can use a Model to create new documents using `new`: + * const userDoc = new UserModel({ name: 'Foo' }); + * await userDoc.save(); + * + * // You also use a model to create queries: + * const userFromDb = await UserModel.findOne({ name: 'Foo' }); + * + * @param {object} doc values for initial set + * @param {object} [fields] optional object containing the fields that were selected in the query which returned this document. You do **not** need to set this parameter to ensure Mongoose handles your [query projection](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()). + * @param {object} [options] optional object containing the options for the document. + * @param {boolean} [options.defaults=true] if `false`, skip applying default values to this document. + * @param {boolean} [options.skipId=false] By default, Mongoose document if one is not provided and the document's schema does not override Mongoose's default `_id`. Set `skipId` to `true` to skip this generation step. + * @inherits Document https://mongoosejs.com/docs/api/document.html + * @event `error`: If listening to this event, 'error' is emitted when a document was saved and an `error` occurred. If not listening, the event bubbles to the connection used to create this Model. + * @event `index`: Emitted after `Model#ensureIndexes` completes. If an error occurred it is passed with the event. + * @event `index-single-start`: Emitted when an individual index starts within `Model#ensureIndexes`. The fields and options being used to build the index are also passed with the event. + * @event `index-single-done`: Emitted when an individual index finishes within `Model#ensureIndexes`. If an error occurred it is passed with the event. The fields, options, and index name are also passed. + * @api public + */ + +function Model(doc, fields, options) { + if (fields instanceof Schema) { + throw new TypeError('2nd argument to `Model` constructor must be a POJO or string, ' + + '**not** a schema. Make sure you\'re calling `mongoose.model()`, not ' + + '`mongoose.Model()`.'); + } + if (typeof doc === 'string') { + throw new TypeError('First argument to `Model` constructor must be an object, ' + + '**not** a string. Make sure you\'re calling `mongoose.model()`, not ' + + '`mongoose.Model()`.'); + } + Document.call(this, doc, fields, options); +} + +/** + * Inherits from Document. + * + * All Model.prototype features are available on + * top level (non-sub) documents. + * @api private + */ + +Object.setPrototypeOf(Model.prototype, Document.prototype); +Model.prototype.$isMongooseModelPrototype = true; + +/** + * Connection the model uses. + * + * @api public + * @property db + * @memberOf Model + * @instance + */ + +Model.prototype.db; + +/** + * Changes the Connection instance this model uses to make requests to MongoDB. + * This function is most useful for changing the Connection that a Model defined using `mongoose.model()` uses + * after initialization. + * + * #### Example: + * + * await mongoose.connect('mongodb://127.0.0.1:27017/db1'); + * const UserModel = mongoose.model('User', mongoose.Schema({ name: String })); + * UserModel.connection === mongoose.connection; // true + * + * const conn2 = await mongoose.createConnection('mongodb://127.0.0.1:27017/db2').asPromise(); + * UserModel.useConnection(conn2); // `UserModel` now stores documents in `db2`, not `db1` + * + * UserModel.connection === mongoose.connection; // false + * UserModel.connection === conn2; // true + * + * conn2.model('User') === UserModel; // true + * mongoose.model('User'); // Throws 'MissingSchemaError' + * + * Note: `useConnection()` does **not** apply any [connection-level plugins](https://mongoosejs.com/docs/api/connection.html#Connection.prototype.plugin()) from the new connection. + * If you use `useConnection()` to switch a model's connection, the model will still have the old connection's plugins. + * + * @function useConnection + * @param {Connection} connection The new connection to use + * @return {Model} this + * @api public + */ + +Model.useConnection = function useConnection(connection) { + if (typeof connection?.model !== 'function' || typeof connection.collection !== 'function' || typeof connection.base?.version !== 'string') { + throw new MongooseError('`useConnection()` requires a Mongoose connection.'); + } + if (this.db?.base?.version && this.db?.base?.version !== connection.base?.version) { + throw new MongooseError(`The connection passed to \`useConnection()\` has a different version of Mongoose (${connection.base?.version}) than the model you are using (${this.db?.base?.version}).`); + } + if (this.db) { + delete this.db.models[this.modelName]; + delete this.prototype.db; + delete this.prototype[modelDbSymbol]; + delete this.prototype.collection; + delete this.prototype.$collection; + delete this.prototype[modelCollectionSymbol]; + } + + this.db = connection; + const collection = connection.collection(this.collection.collectionName, connection.options); + this.prototype.collection = collection; + this.prototype.$collection = collection; + this.prototype[modelCollectionSymbol] = collection; + this.prototype.db = connection; + this.prototype[modelDbSymbol] = connection; + this.collection = collection; + this.$__collection = collection; + connection.models[this.modelName] = this; + + return this; +}; + +/** + * The collection instance this model uses. + * A Mongoose collection is a thin wrapper around a [MongoDB Node.js driver collection]([MongoDB Node.js driver collection](https://mongodb.github.io/node-mongodb-native/Next/classes/Collection.html)). + * Using `Model.collection` means you bypass Mongoose middleware, validation, and casting. + * + * This property is read-only. Modifying this property is a no-op. + * + * @api public + * @property collection + * @memberOf Model + * @instance + */ + +Model.prototype.collection; + +/** + * Internal collection the model uses. + * + * This property is read-only. Modifying this property is a no-op. + * + * @api private + * @property collection + * @memberOf Model + * @instance + */ + + +Model.prototype.$__collection; + +/** + * The name of the model + * + * @api public + * @property modelName + * @memberOf Model + * @instance + */ + +Model.prototype.modelName; + +/** + * Additional properties to attach to the query when calling `save()` and + * `isNew` is false. + * + * @api public + * @property $where + * @memberOf Model + * @instance + */ + +Model.prototype.$where; + +/** + * If this is a discriminator model, `baseModelName` is the name of + * the base model. + * + * @api public + * @property baseModelName + * @memberOf Model + * @instance + */ + +Model.prototype.baseModelName; + +/** + * Event emitter that reports any errors that occurred. Useful for global error + * handling. + * + * #### Example: + * + * MyModel.events.on('error', err => console.log(err.message)); + * + * // Prints a 'CastError' because of the above handler + * await MyModel.findOne({ _id: 'Not a valid ObjectId' }).catch(noop); + * + * @api public + * @property events + * @fires error whenever any query or model function errors + * @memberOf Model + * @static + */ + +Model.events; + +/** + * Compiled middleware for this model. Set in `applyHooks()`. + * + * @api private + * @property _middleware + * @memberOf Model + * @static + */ + +Model._middleware; + +/*! + * ignore + */ + +function _applyCustomWhere(doc, where) { + if (doc.$where == null) { + return; + } + for (const key of Object.keys(doc.$where)) { + where[key] = doc.$where[key]; + } +} + +/*! + * ignore + */ +function _createSaveOptions(doc, options) { + const saveOptions = {}; + + applyWriteConcern(doc.$__schema, options); + if (typeof options.writeConcern !== 'undefined') { + saveOptions.writeConcern = {}; + if ('w' in options.writeConcern) { + saveOptions.writeConcern.w = options.writeConcern.w; + } + if ('j' in options.writeConcern) { + saveOptions.writeConcern.j = options.writeConcern.j; + } + if ('wtimeout' in options.writeConcern) { + saveOptions.writeConcern.wtimeout = options.writeConcern.wtimeout; + } + } else { + if ('w' in options) { + saveOptions.w = options.w; + } + if ('j' in options) { + saveOptions.j = options.j; + } + if ('wtimeout' in options) { + saveOptions.wtimeout = options.wtimeout; + } + } + if ('checkKeys' in options) { + saveOptions.checkKeys = options.checkKeys; + } + + const session = doc.$session(); + const asyncLocalStorage = doc[modelDbSymbol].base.transactionAsyncLocalStorage?.getStore(); + if (session != null) { + saveOptions.session = session; + } else if (!Object.hasOwn(options, 'session') && asyncLocalStorage?.session != null) { + // Only set session from asyncLocalStorage if `session` option wasn't originally passed in options + saveOptions.session = asyncLocalStorage.session; + } + + return saveOptions; +} + +/*! + * ignore + */ + +Model.prototype.$__save = async function $__save(options) { + try { + const hasValidateBeforeSaveOption = options && + (typeof options === 'object') && + ('validateBeforeSave' in options); + const shouldValidateBeforeSave = hasValidateBeforeSaveOption ? + !!options.validateBeforeSave : + this.$__schema.options.validateBeforeSave; + if (shouldValidateBeforeSave) { + const hasValidateModifiedOnlyOption = options != null && + typeof options === 'object' && + Object.hasOwn(options, 'validateModifiedOnly'); + const validateOptions = hasValidateModifiedOnlyOption ? + { validateModifiedOnly: options.validateModifiedOnly } : + null; + await this.$validate(validateOptions); + this.$op = 'save'; + } + + await this._execDocumentPreHooks('save', options, [options]); + } catch (error) { + await this._execDocumentPostHooks('save', options, error); + return; + } + + + let result = null; + let where = null; + try { + const saveOptions = _createSaveOptions(this, options); + + if (this.$isNew) { + const hasOnlyPrimitiveValues = this.$__hasOnlyPrimitiveValues(); + // send entire doc + const obj = hasOnlyPrimitiveValues ? + this.$__toObjectShallow() : + this.toObject(saveToObjectOptions); + if ((obj || {})._id === void 0) { + // documents must have an _id else mongoose won't know + // what to update later if more changes are made. the user + // wouldn't know what _id was generated by mongodb either + // nor would the ObjectId generated by mongodb necessarily + // match the schema definition. + throw new MongooseError('document must have an _id before saving'); + } + + this.$__version(true, obj); + this.$__reset(); + _setIsNew(this, false, hasOnlyPrimitiveValues); + // Make it possible to retry the insert + this.$__.inserting = true; + result = await this[modelCollectionSymbol].insertOne(obj, saveOptions).catch(err => { + _setIsNew(this, true, hasOnlyPrimitiveValues); + throw err; + }); + } else { + // Make sure we don't treat it as a new object on error, + // since it already exists + this.$__.inserting = false; + const pathsToSave = Array.isArray(options.pathsToSave) ? options.pathsToSave : null; + const pathsToSaveSet = pathsToSave != null ? new Set(pathsToSave) : null; + const delta = this.$__delta(pathsToSave, pathsToSaveSet); + const unsavedDirty = pathsToSave != null ? (delta != null ? delta[2] : this.$__dirty()) : null; + const unsavedDefaultPaths = pathsToSave != null + ? Object.keys(this.$__.activePaths.getStatePaths('default')).filter(path => !isInPathsToSave(path, pathsToSaveSet, pathsToSave)) + : null; + + if (delta) { + where = this.$__where(delta[0]); + _applyCustomWhere(this, where); + + const update = delta[1]; + if (this.$__schema.options.minimize) { + for (const updateOp of Object.values(update)) { + if (updateOp == null) { + continue; + } + for (const key of Object.keys(updateOp)) { + if (updateOp[key] == null || typeof updateOp[key] !== 'object') { + continue; + } + if (!utils.isPOJO(updateOp[key])) { + continue; + } + minimize(updateOp[key]); + if (utils.hasOwnKeys(updateOp[key]) === false) { + delete updateOp[key]; + update.$unset = update.$unset || {}; + update.$unset[key] = 1; + } + } + } + } + + // store the modified paths before the document is reset + this.$__.modifiedPaths = this.modifiedPaths(); + this.$__reset(); + restoreUnsavedState(this, unsavedDirty, unsavedDefaultPaths); + + _setIsNew(this, false); + result = await this[modelCollectionSymbol].updateOne(where, update, saveOptions).catch(err => { + this.$__undoReset(); + throw err; + }); + } else { + where = this.$__where(); + _applyCustomWhere(this, where); + if (this.$__.version) { + this.$__version(where, delta); + } + + applyReadConcern(this.$__schema, saveOptions); + result = await this.constructor.collection.findOne(where, { ...saveOptions, projection: { _id: 1 } }) + .then(documentExists => ({ matchedCount: !documentExists ? 0 : 1 })); + } + } + } catch (err) { + const error = this.$__schema._transformDuplicateKeyError(err); + await this._execDocumentPostHooks('save', options, error); + return; + } + + let numAffected = 0; + const writeConcern = options != null ? + options.writeConcern != null ? + options.writeConcern.w : + options.w : + 0; + if (writeConcern !== 0) { + // Skip checking if write succeeded if writeConcern is set to + // unacknowledged writes, because otherwise `numAffected` will always be 0 + if (result != null) { + if (Array.isArray(result)) { + numAffected = result.length; + } else if (result.matchedCount != null) { + numAffected = result.matchedCount; + } else { + numAffected = result; + } + } + + const versionBump = this.$__.version; + // was this an update that required a version bump? + if (versionBump && !this.$__.inserting) { + const doIncrement = VERSION_INC === (VERSION_INC & this.$__.version); + this.$__.version = undefined; + const key = this.$__schema.options.versionKey; + const version = this.$__getValue(key) || 0; + if (numAffected <= 0) { + // the update failed. pass an error back + this.$__undoReset(); + const err = this.$__.$versionError || + new VersionError(this, version, this.$__.modifiedPaths); + await this._execDocumentPostHooks('save', options, err); + return; + } + + // increment version if was successful + if (doIncrement) { + this.$__setValue(key, version + 1); + } + } + if (result != null && numAffected <= 0) { + this.$__undoReset(); + const error = new DocumentNotFoundError(where, this.constructor.modelName, numAffected, result); + await this._execDocumentPostHooks('save', options, error); + return; + } + } + this.$__.saving = undefined; + this.$__.savedState = {}; + this.$emit('save', this, numAffected); + this.constructor.emit('save', this, numAffected); + await this._execDocumentPostHooks('save', options); +}; + +/*! + * Restores $__.activePaths state and any atomics for paths that failed + * to save. + * + * @param {Document} doc + * @param {object[]} unsavedDirty + * @param {string[]} unsavedDefaultPaths + */ + +function restoreUnsavedState(doc, unsavedDirty, unsavedDefaultPaths) { + if (unsavedDirty == null) { + return; + } + + for (const dirty of unsavedDirty) { + doc.$__.activePaths.modify(dirty.path); + if (dirty.value?.[arrayAtomicsBackupSymbol]) { + dirty.value[arrayAtomicsSymbol] = dirty.value[arrayAtomicsBackupSymbol]; + dirty.value[arrayAtomicsBackupSymbol] = null; + } + } + + for (const path of unsavedDefaultPaths) { + doc.$__.activePaths.default(path); + } +} + +/*! + * ignore + */ + +function generateVersionError(doc, modifiedPaths, defaultPaths) { + const key = doc.$__schema.options.versionKey; + if (!key) { + return null; + } + const version = doc.$__getValue(key) || 0; + return new VersionError(doc, version, modifiedPaths.concat(defaultPaths)); +} + +/** + * Saves this document by inserting a new document into the database if [document.isNew](https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew) is `true`, + * or sends an [updateOne](https://mongoosejs.com/docs/api/document.html#Document.prototype.updateOne()) operation with just the modified paths if `isNew` is `false`. + * + * #### Example: + * + * product.sold = Date.now(); + * product = await product.save(); + * + * If save is successful, the returned promise will fulfill with the document + * saved. + * + * #### Example: + * + * const newProduct = await product.save(); + * newProduct === product; // true + * + * @param {object} [options] options optional options + * @param {Session} [options.session=null] the [session](https://www.mongodb.com/docs/manual/reference/server-sessions/) associated with this save operation. If not specified, defaults to the [document's associated session](https://mongoosejs.com/docs/api/document.html#Document.prototype.session()). + * @param {object} [options.safe] (DEPRECATED) overrides [schema's safe option](https://mongoosejs.com/docs/guide.html#safe). Use the `w` option instead. + * @param {boolean} [options.validateBeforeSave] set to false to save without validating. + * @param {boolean} [options.validateModifiedOnly=false] if `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths. + * @param {number|string} [options.w] set the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/#w-option). Overrides the [schema-level `writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.j] set to true for MongoDB to wait until this `save()` has been [journaled before resolving the returned promise](https://www.mongodb.com/docs/manual/reference/write-concern/#j-option). Overrides the [schema-level `writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {number} [options.wtimeout] sets a [timeout for the write concern](https://www.mongodb.com/docs/manual/reference/write-concern/#wtimeout). Overrides the [schema-level `writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern). + * @param {boolean} [options.checkKeys=true] the MongoDB driver prevents you from saving keys that start with '$' or contain '.' by default. Set this option to `false` to skip that check. See [restrictions on field names](https://docs.mongodb.com/manual/reference/limits/#mongodb-limit-Restrictions-on-Field-Names) + * @param {boolean} [options.timestamps=true] if `false` and [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this `save()`. + * @param {Array} [options.pathsToSave] An array of paths that tell mongoose to only validate and save the paths in `pathsToSave`. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @throws {DocumentNotFoundError} if this [save updates an existing document](https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew) but the document doesn't exist in the database. For example, you will get this error if the document is [deleted between when you retrieved the document and when you saved it](documents.html#updating). + * @return {Promise} + * @api public + * @see middleware https://mongoosejs.com/docs/middleware.html + */ + +Model.prototype.save = async function save(options) { + if (typeof options === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Model.prototype.save() no longer accepts a callback'); + } + + let parallelSave; + this.$op = 'save'; + + if (this.$__.saving) { + parallelSave = new ParallelSaveError(this); + } else { + this.$__.saving = true; + } + + options = new SaveOptions(options); + if (Object.hasOwn(options, 'session')) { + this.$session(options.session); + } + if (this.$__.timestamps != null) { + options.timestamps = this.$__.timestamps; + } + if (!this.$isNew) { + this.$__.$versionError = generateVersionError( + this, + this.modifiedPaths(), + Object.keys(this.$__.activePaths.getStatePaths('default')) + ); + } + + if (parallelSave) { + this.$__handleReject(parallelSave); + throw parallelSave; + } + + this.$__.saveOptions = options; + + const _this = this; + return traceSave(async function maybeTracedSave() { + try { + await _this.$__save(options); + } catch (error) { + _this.$__handleReject(error); + throw error; + } finally { + _this.$__.saving = null; + _this.$__.saveOptions = null; + _this.$__.$versionError = null; + _this.$op = null; + } + + return _this; + }, () => ({ + operation: 'save', + collection: _this.constructor.collection.name, + database: _this.constructor.db?.name, + serverAddress: _this.constructor.db?.host, + serverPort: _this.constructor.db?.port, + args: { options } + })); +}; + +Model.prototype.$save = Model.prototype.save; + +/** + * Appends versioning to the where and update clauses. + * + * @api private + * @method $__version + * @memberOf Model + * @instance + */ + +Model.prototype.$__version = function(where, delta) { + const key = this.$__schema.options.versionKey; + if (where === true) { + // this is an insert + if (key) { + setDottedPath(delta, key, 0); + this.$__setValue(key, 0); + } + return; + } + + if (key === false) { + return; + } + + // updates + + // only apply versioning if our versionKey was selected. else + // there is no way to select the correct version. we could fail + // fast here and force them to include the versionKey but + // thats a bit intrusive. can we do this automatically? + + if (!this.$__isSelected(key)) { + return; + } + + // $push $addToSet don't need the where clause set + if (VERSION_WHERE === (VERSION_WHERE & this.$__.version)) { + const value = this.$__getValue(key); + if (value != null) where[key] = value; + } + + if (VERSION_INC === (VERSION_INC & this.$__.version)) { + if (get(delta.$set, key, null) != null) { + // Version key is getting set, means we'll increment the doc's version + // after a successful save, so we should set the incremented version so + // future saves don't fail (gh-5779) + ++delta.$set[key]; + } else { + delta.$inc = delta.$inc || {}; + delta.$inc[key] = 1; + } + } +}; + +/** + * Signal that we desire an increment of this documents version. + * + * #### Example: + * + * const doc = await Model.findById(id); + * doc.increment(); + * await doc.save(); + * + * @see versionKeys https://mongoosejs.com/docs/guide.html#versionKey + * @memberOf Model + * @method increment + * @api public + */ + +Model.prototype.increment = function increment() { + this.$__.version = VERSION_ALL; + return this; +}; + +/** + * Returns a query object + * + * @api private + * @method $__where + * @memberOf Model + * @instance + */ + +Model.prototype.$__where = function _where(where) { + where || (where = {}); + + if (!where._id) { + where._id = this._doc._id; + } + + if (this._doc._id === void 0) { + throw new MongooseError('No _id found on document!'); + } + + return where; +}; + +/** + * Delete this document from the db. Returns a Query instance containing a `deleteOne` operation by this document's `_id`. + * + * #### Example: + * + * await product.deleteOne(); + * await Product.findById(product._id); // null + * + * Since `deleteOne()` returns a Query, the `deleteOne()` will **not** execute unless you use either `await`, `.then()`, `.catch()`, or [`.exec()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.exec()) + * + * #### Example: + * + * product.deleteOne(); // Doesn't do anything + * product.deleteOne().exec(); // Deletes the document, returns a promise + * + * @return {Query} Query + * @api public + */ + +Model.prototype.deleteOne = function deleteOne(options) { + if (typeof options === 'function' || + typeof arguments[1] === 'function') { + throw new MongooseError('Model.prototype.deleteOne() no longer accepts a callback'); + } + + if (!options) { + options = {}; + } + + if (Object.hasOwn(options, 'session')) { + this.$session(options.session); + } + + const self = this; + const where = this.$__where(); + const query = self.constructor.deleteOne(); + + if (this.$session() != null) { + if (!('session' in query.options)) { + query.options.session = this.$session(); + } + } + + const preFilter = buildMiddlewareFilter(options, 'pre'); + const postFilter = buildMiddlewareFilter(options, 'post'); + + query.pre(async function queryPreDeleteOne() { + const res = await self.constructor._middleware.execPre('deleteOne', self, [self, options], { filter: preFilter }); + // `self` is passed to pre hooks as argument for backwards compatibility, but that + // isn't the actual arguments passed to the wrapped function. + if (res[0] !== self || res[1] !== options) { + throw new MongooseError('Document deleteOne pre hooks cannot overwrite arguments'); + } + query.deleteOne(where, options); + // Apply custom where conditions _after_ document deleteOne middleware for + // consistency with save() - sharding plugin needs to set $where + if (self.$where != null) { + this.where(self.$where); + } + return res; + }); + query.pre(function callSubdocPreHooks() { + return Promise.all(self.$getAllSubdocs().map(subdoc => subdoc.constructor._middleware.execPre('deleteOne', subdoc, [subdoc], { filter: preFilter }))); + }); + query.pre(function skipIfAlreadyDeleted() { + if (self.$__.isDeleted) { + throw new Kareem.skipWrappedFunction(); + } + }); + query.post(function callSubdocPostHooks() { + return Promise.all(self.$getAllSubdocs().map(subdoc => subdoc.constructor._middleware.execPost('deleteOne', subdoc, [subdoc], { filter: postFilter }))); + }); + query.post(function queryPostDeleteOne() { + return self.constructor._middleware.execPost('deleteOne', self, [self], { filter: postFilter }); + }); + query.transform(function setIsDeleted(result) { + if (result?.deletedCount > 0) { + self.$isDeleted(true); + } + return result; + }); + + return query; +}; + +/** + * Returns the model instance used to create this document if no `name` specified. + * If `name` specified, returns the model with the given `name`. + * + * #### Example: + * + * const doc = new Tank({}); + * doc.$model() === Tank; // true + * await doc.$model('User').findById(id); + * + * @param {string} [name] model name + * @method $model + * @api public + * @return {Model} + */ + +Model.prototype.$model = function $model(name) { + if (arguments.length === 0) { + return this.constructor; + } + return this[modelDbSymbol].model(name); +}; + +/** + * Returns the model instance used to create this document if no `name` specified. + * If `name` specified, returns the model with the given `name`. + * + * #### Example: + * + * const doc = new Tank({}); + * doc.$model() === Tank; // true + * await doc.$model('User').findById(id); + * + * @param {string} [name] model name + * @method model + * @api public + * @return {Model} + */ + +Model.prototype.model = Model.prototype.$model; + +/** + * Returns a document with `_id` only if at least one document exists in the database that matches + * the given `filter`, and `null` otherwise. + * + * Under the hood, `MyModel.exists({ answer: 42 })` is equivalent to + * `MyModel.findOne({ answer: 42 }).select({ _id: 1 }).lean()` + * + * #### Example: + * + * await Character.deleteMany({}); + * await Character.create({ name: 'Jean-Luc Picard' }); + * + * await Character.exists({ name: /picard/i }); // { _id: ... } + * await Character.exists({ name: /riker/i }); // null + * + * This function triggers the following middleware. + * + * - `findOne()` + * + * @param {object} filter + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @return {Query} + */ + +Model.exists = function exists(filter, options) { + _checkContext(this, 'exists'); + if (typeof arguments[2] === 'function') { + throw new MongooseError('Model.exists() no longer accepts a callback'); + } + + const query = this.findOne(filter). + select({ _id: 1 }). + lean(). + setOptions(options); + + return query; +}; + +/** + * Adds a discriminator type. + * + * #### Example: + * + * function BaseSchema() { + * Schema.apply(this, arguments); + * + * this.add({ + * name: String, + * createdAt: Date + * }); + * } + * util.inherits(BaseSchema, Schema); + * + * const PersonSchema = new BaseSchema(); + * const BossSchema = new BaseSchema({ department: String }); + * + * const Person = mongoose.model('Person', PersonSchema); + * const Boss = Person.discriminator('Boss', BossSchema); + * new Boss().__t; // "Boss". `__t` is the default `discriminatorKey` + * + * const employeeSchema = new Schema({ boss: ObjectId }); + * const Employee = Person.discriminator('Employee', employeeSchema, 'staff'); + * new Employee().__t; // "staff" because of 3rd argument above + * + * @param {string} name discriminator model name + * @param {Schema} schema discriminator model schema + * @param {object|string} [options] If string, same as `options.value`. + * @param {string} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @param {boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning. + * @param {boolean} [options.overwriteModels=false] by default, Mongoose does not allow you to define a discriminator with the same name as another discriminator. Set this to allow overwriting discriminators with the same name. + * @param {boolean} [options.mergeHooks=true] By default, Mongoose merges the base schema's hooks with the discriminator schema's hooks. Set this option to `false` to make Mongoose use the discriminator schema's hooks instead. + * @param {boolean} [options.mergePlugins=true] By default, Mongoose merges the base schema's plugins with the discriminator schema's plugins. Set this option to `false` to make Mongoose use the discriminator schema's plugins instead. + * @return {Model} The newly created discriminator model + * @api public + */ + +Model.discriminator = function(name, schema, options) { + let model; + if (typeof name === 'function') { + model = name; + name = utils.getFunctionName(model); + if (!(model.prototype instanceof Model)) { + throw new MongooseError('The provided class ' + name + ' must extend Model'); + } + } + + options = options || {}; + const value = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === 'boolean' ? options.clone : true; + const mergePlugins = typeof options.mergePlugins === 'boolean' ? options.mergePlugins : true; + const overwriteModels = typeof options.overwriteModels === 'boolean' ? options.overwriteModels : false; + + _checkContext(this, 'discriminator'); + + if (utils.isObject(schema) && !schema.instanceOfSchema) { + schema = new Schema(schema); + } + if (schema instanceof Schema && clone) { + schema = schema.clone(); + } + + schema = discriminator(this, name, schema, value, mergePlugins, options.mergeHooks, overwriteModels); + if (this.db.models[name] && !schema.options.overwriteModels && !overwriteModels) { + throw new OverwriteModelError(name); + } + + schema.$isRootDiscriminator = true; + schema.$globalPluginsApplied = true; + + model = this.db.model(model || name, schema, this.$__collection.name); + this.discriminators[name] = model; + const d = this.discriminators[name]; + Object.setPrototypeOf(d.prototype, this.prototype); + Object.defineProperty(d, 'baseModelName', { + value: this.modelName, + configurable: true, + writable: false + }); + + // apply methods and statics + applyMethods(d, schema); + applyStatics(d, schema); + + if (this[subclassedSymbol] != null) { + for (const submodel of this[subclassedSymbol]) { + submodel.discriminators = submodel.discriminators || {}; + submodel.discriminators[name] = + model.__subclass(model.db, schema, submodel.collection.name); + } + } + + return d; +}; + +/** + * Make sure `this` is a model + * @api private + */ + +function _checkContext(ctx, fnName) { + // Check context, because it is easy to mistakenly type + // `new Model.discriminator()` and get an incomprehensible error + if (ctx == null || ctx === global) { + throw new MongooseError('`Model.' + fnName + '()` cannot run without a ' + + 'model as `this`. Make sure you are calling `MyModel.' + fnName + '()` ' + + 'where `MyModel` is a Mongoose model.'); + } else if (ctx[modelSymbol] == null) { + throw new MongooseError('`Model.' + fnName + '()` cannot run without a ' + + 'model as `this`. Make sure you are not calling ' + + '`new Model.' + fnName + '()`'); + } +} + +// Model (class) features + +/*! + * Give the constructor the ability to emit events. + */ + +for (const i in EventEmitter.prototype) { + Model[i] = EventEmitter.prototype[i]; +} + +/** + * This function is responsible for initializing the underlying connection in MongoDB based on schema options. + * This function performs the following operations: + * + * - `createCollection()` unless [`autoCreate`](https://mongoosejs.com/docs/guide.html#autoCreate) option is turned off + * - `ensureIndexes()` unless [`autoIndex`](https://mongoosejs.com/docs/guide.html#autoIndex) option is turned off + * - `createSearchIndex()` on all schema search indexes if `autoSearchIndex` is enabled. + * + * Mongoose calls this function automatically when a model is a created using + * [`mongoose.model()`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.model()) or + * [`connection.model()`](https://mongoosejs.com/docs/api/connection.html#Connection.prototype.model()), so you + * don't need to call `init()` to trigger index builds. + * + * However, you _may_ need to call `init()` to get back a promise that will resolve when your indexes are finished. + * Calling `await Model.init()` is helpful if you need to wait for indexes to build before continuing. + * For example, if you want to wait for unique indexes to build before continuing with a test case. + * + * #### Example: + * + * const eventSchema = new Schema({ thing: { type: 'string', unique: true } }) + * // This calls `Event.init()` implicitly, so you don't need to call + * // `Event.init()` on your own. + * const Event = mongoose.model('Event', eventSchema); + * + * await Event.init(); + * console.log('Indexes are done building!'); + * + * @api public + * @returns {Promise} + */ + +Model.init = function init() { + _checkContext(this, 'init'); + if (typeof arguments[0] === 'function') { + throw new MongooseError('Model.init() no longer accepts a callback'); + } + + this.schema.emit('init', this); + + if (this.$init != null) { + return this.$init; + } + + const conn = this.db; + const _ensureIndexes = async() => { + const autoIndex = utils.getOption( + 'autoIndex', + this.schema.options, + conn.config, + conn.base.options + ); + if (!autoIndex) { + return; + } + return await this.ensureIndexes({ _automatic: true }); + }; + const _createSearchIndexes = async() => { + const autoSearchIndex = utils.getOption( + 'autoSearchIndex', + this.schema.options, + conn.config, + conn.base.options + ); + if (!autoSearchIndex) { + return; + } + + return await this.createSearchIndexes(); + }; + const _createCollection = async() => { + let autoCreate = utils.getOption( + 'autoCreate', + this.schema.options, + conn.config + // No base.options here because we don't want to take the base value if the connection hasn't + // set it yet + ); + if (autoCreate == null) { + // `autoCreate` may later be set when the connection is opened, so wait for connect before checking + await conn._waitForConnect(true); + autoCreate = utils.getOption( + 'autoCreate', + this.schema.options, + conn.config, + conn.base.options + ); + } + + if (!autoCreate) { + return; + } + + return await this.createCollection(); + }; + + this.$init = _createCollection(). + then(() => _ensureIndexes()). + then(() => _createSearchIndexes()); + + const _catch = this.$init.catch; + const _this = this; + this.$init.catch = function() { + _this.$caught = true; + return _catch.apply(_this.$init, arguments); + }; + + return this.$init; +}; + + +/** + * Create the collection for this model. By default, if no indexes are specified, + * mongoose will not create the collection for the model until any documents are + * created. Use this method to create the collection explicitly. + * + * Note 1: You may need to call this before starting a transaction + * See https://www.mongodb.com/docs/manual/core/transactions/#transactions-and-operations + * + * Note 2: You don't have to call this if your schema contains index or unique field. + * In that case, just use `Model.init()` + * + * #### Example: + * + * const userSchema = new Schema({ name: String }) + * const User = mongoose.model('User', userSchema); + * + * User.createCollection().then(function(collection) { + * console.log('Collection is created!'); + * }); + * + * @api public + * @param {object} [options] see [MongoDB driver docs](https://mongodb.github.io/node-mongodb-native/7.0/classes/Db.html#createCollection) + * @returns {Promise} + */ + +Model.createCollection = async function createCollection(options) { + _checkContext(this, 'createCollection'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Model.createCollection() no longer accepts a callback'); + } + + const preFilter = buildMiddlewareFilter(options, 'pre'); + const postFilter = buildMiddlewareFilter(options, 'post'); + + // Remove middleware option before passing to MongoDB + if (options?.middleware != null) { + const { middleware, ...driverOptions } = options; + options = driverOptions; + } + + [options] = await this.hooks.execPre('createCollection', this, [options], { filter: preFilter }).catch(err => { + if (err instanceof Kareem.skipWrappedFunction) { + return [err]; + } + throw err; + }); + + const collectionOptions = this?.schema?.options?.collectionOptions; + if (collectionOptions != null) { + options = Object.assign({}, collectionOptions, options); + } + + const schemaCollation = this?.schema?.options?.collation; + if (schemaCollation != null) { + options = Object.assign({ collation: schemaCollation }, options); + } + const capped = this?.schema?.options?.capped; + if (capped != null) { + if (typeof capped === 'number') { + options = Object.assign({ capped: true, size: capped }, options); + } else if (typeof capped === 'object') { + options = Object.assign({ capped: true }, capped, options); + } + } + const timeseries = this?.schema?.options?.timeseries; + if (timeseries != null) { + options = Object.assign({ timeseries }, options); + if (options.expireAfterSeconds != null) { + // do nothing + } else if (options.expires != null) { + utils.expires(options); + } else if (this.schema.options.expireAfterSeconds != null) { + options.expireAfterSeconds = this.schema.options.expireAfterSeconds; + } else if (this.schema.options.expires != null) { + options.expires = this.schema.options.expires; + utils.expires(options); + } + } + + const clusteredIndex = this?.schema?.options?.clusteredIndex; + if (clusteredIndex != null) { + options = Object.assign({ clusteredIndex: { ...clusteredIndex, unique: true } }, options); + } + + try { + if (!(options instanceof Kareem.skipWrappedFunction)) { + await this.db.createCollection(this.$__collection.collectionName, options); + } + } catch (err) { + if (err != null && (err.name !== 'MongoServerError' || err.code !== 48)) { + await this.hooks.execPost('createCollection', this, [null], { error: err, filter: postFilter }); + } + } + + await this.hooks.execPost('createCollection', this, [this.$__collection], { filter: postFilter }); + + return this.$__collection; +}; + +/** + * Makes the indexes in MongoDB match the indexes defined in this model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + * + * See the [introductory blog post](https://thecodebarbarian.com/whats-new-in-mongoose-5-2-syncindexes) + * for more information. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, unique: true } }); + * const Customer = mongoose.model('Customer', schema); + * await Customer.collection.createIndex({ age: 1 }); // Index is not in schema + * // Will drop the 'age' index and create an index on `name` + * await Customer.syncIndexes(); + * + * You should be careful about running `syncIndexes()` on production applications under heavy load, + * because index builds are expensive operations, and unexpected index drops can lead to degraded + * performance. Before running `syncIndexes()`, you can use the [`diffIndexes()` function](#Model.diffIndexes()) + * to check what indexes `syncIndexes()` will drop and create. + * + * #### Example: + * + * const { toDrop, toCreate } = await Model.diffIndexes(); + * toDrop; // Array of strings containing names of indexes that `syncIndexes()` will drop + * toCreate; // Array of strings containing names of indexes that `syncIndexes()` will create + * + * @param {object} [options] options to pass to `ensureIndexes()` + * @param {boolean} [options.hideIndexes=false] set to `true` to hide indexes instead of dropping. Requires MongoDB server 4.4 or higher + * @return {Promise} + * @api public + */ + +Model.syncIndexes = async function syncIndexes(options) { + _checkContext(this, 'syncIndexes'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Model.syncIndexes() no longer accepts a callback'); + } + + const autoCreate = options?.autoCreate ?? + this.schema.options?.autoCreate ?? + this.db.config.autoCreate ?? + this.db.base?.options?.autoCreate ?? + true; + + if (autoCreate) { + try { + await this.createCollection(); + } catch (err) { + if (err != null && (err.name !== 'MongoServerError' || err.code !== 48)) { + throw err; + } + } + } + + const diffIndexesResult = await this.diffIndexes({ indexOptionsToCreate: true }); + const dropped = await this.cleanIndexes({ ...options, toDrop: diffIndexesResult.toDrop }); + await this.createIndexes({ ...options, toCreate: diffIndexesResult.toCreate }); + + return dropped; +}; + +/** + * Create an [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). + * This function only works when connected to MongoDB Atlas. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, unique: true } }); + * const Customer = mongoose.model('Customer', schema); + * await Customer.createSearchIndex({ name: 'test', definition: { mappings: { dynamic: true } } }); + * + * @param {object} description index options, including `name` and `definition` + * @param {string} description.name + * @param {object} description.definition + * @return {Promise} + * @api public + */ + +Model.createSearchIndex = async function createSearchIndex(description) { + _checkContext(this, 'createSearchIndex'); + + return await this.$__collection.createSearchIndex(description); +}; + +/** + * Update an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). + * This function only works when connected to MongoDB Atlas. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, unique: true } }); + * const Customer = mongoose.model('Customer', schema); + * await Customer.updateSearchIndex('test', { mappings: { dynamic: true } }); + * + * @param {string} name + * @param {object} definition + * @return {Promise} + * @api public + */ + +Model.updateSearchIndex = async function updateSearchIndex(name, definition) { + _checkContext(this, 'updateSearchIndex'); + + return await this.$__collection.updateSearchIndex(name, definition); +}; + +/** + * Delete an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) by name. + * This function only works when connected to MongoDB Atlas. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, unique: true } }); + * const Customer = mongoose.model('Customer', schema); + * await Customer.dropSearchIndex('test'); + * + * @param {string} name + * @return {Promise} + * @api public + */ + +Model.dropSearchIndex = async function dropSearchIndex(name) { + _checkContext(this, 'dropSearchIndex'); + + return await this.$__collection.dropSearchIndex(name); +}; + +/** + * List all [Atlas search indexes](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) on this model's collection. + * This function only works when connected to MongoDB Atlas. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, unique: true } }); + * const Customer = mongoose.model('Customer', schema); + * + * await Customer.createSearchIndex({ name: 'test', definition: { mappings: { dynamic: true } } }); + * const res = await Customer.listSearchIndexes(); // Includes `[{ id: '...', name: 'test', status: 'READY', queryable: true, latestDefinition: { ... } }]` + * + * @param {object} [options] + * @return {Promise} + * @api public + */ + +Model.listSearchIndexes = async function listSearchIndexes(options) { + _checkContext(this, 'listSearchIndexes'); + + const cursor = await this.$__collection.listSearchIndexes(options); + + return await cursor.toArray(); +}; + +/** + * Does a dry-run of `Model.syncIndexes()`, returning the indexes that `syncIndexes()` would drop and create if you were to run `syncIndexes()`. + * + * #### Example: + * + * const { toDrop, toCreate } = await Model.diffIndexes(); + * toDrop; // Array of strings containing names of indexes that `syncIndexes()` will drop + * toCreate; // Array of index specs containing the keys of indexes that `syncIndexes()` will create + * + * @param {object} [options] + * @param {boolean} [options.indexOptionsToCreate=false] If true, `toCreate` will include both the index spec and the index options, not just the index spec + * @return {Promise} contains the indexes that would be dropped in MongoDB and indexes that would be created in MongoDB as `{ toDrop: string[], toCreate: string[] }`. + */ + +Model.diffIndexes = async function diffIndexes(options) { + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Model.syncIndexes() no longer accepts a callback'); + } + + const model = this; + + let dbIndexes = await model.listIndexes().catch(err => { + if (err.codeName == 'NamespaceNotFound') { + return undefined; + } + throw err; + }); + if (dbIndexes === undefined) { + dbIndexes = []; + } + dbIndexes = getRelatedDBIndexes(model, dbIndexes); + + const schema = model.schema; + const schemaIndexes = getRelatedSchemaIndexes(model, schema.indexes()); + + const toDrop = getIndexesToDrop(schema, schemaIndexes, dbIndexes); + const toCreate = getIndexesToCreate(schema, schemaIndexes, dbIndexes, toDrop, options); + + return { toDrop, toCreate }; +}; + +function getIndexesToCreate(schema, schemaIndexes, dbIndexes, toDrop, options) { + const toCreate = []; + const indexOptionsToCreate = options?.indexOptionsToCreate ?? false; + + for (const [schemaIndexKeysObject, schemaIndexOptions] of schemaIndexes) { + let found = false; + + const options = decorateDiscriminatorIndexOptions(schema, clone(schemaIndexOptions)); + + for (const index of dbIndexes) { + if (isDefaultIdIndex(index)) { + continue; + } + if ( + isIndexEqual(schemaIndexKeysObject, options, index) && + !toDrop.includes(index.name) + ) { + found = true; + break; + } + } + + if (!found) { + if (indexOptionsToCreate) { + toCreate.push([schemaIndexKeysObject, schemaIndexOptions]); + } else { + toCreate.push(schemaIndexKeysObject); + } + } + } + + return toCreate; +} + +function getIndexesToDrop(schema, schemaIndexes, dbIndexes) { + const toDrop = []; + + for (const dbIndex of dbIndexes) { + let found = false; + // Never try to drop `_id` index, MongoDB server doesn't allow it + if (isDefaultIdIndex(dbIndex)) { + continue; + } + // Timeseries collections have a default index on { timeField: 1, metaField: 1 }. + if (isTimeseriesIndex(dbIndex, schema.options)) { + continue; + } + + for (const [schemaIndexKeysObject, schemaIndexOptions] of schemaIndexes) { + const options = decorateDiscriminatorIndexOptions(schema, clone(schemaIndexOptions)); + applySchemaCollation(schemaIndexKeysObject, options, schema.options); + + if (isIndexEqual(schemaIndexKeysObject, options, dbIndex)) { + found = true; + break; + } + } + + if (found) { + continue; + } + + toDrop.push(dbIndex.name); + } + + return toDrop; +} +/** + * Deletes all indexes that aren't defined in this model's schema. Used by + * `syncIndexes()`. + * + * The returned promise resolves to a list of the dropped indexes' names as an array + * + * @param {object} [options] + * @param {string[]} [options.toDrop] if specified, contains a list of index names to drop + * @param {boolean} [options.hideIndexes=false] set to `true` to hide indexes instead of dropping. Requires MongoDB server 4.4 or higher + * @return {Promise} list of dropped or hidden index names + * @api public + */ + +Model.cleanIndexes = async function cleanIndexes(options) { + _checkContext(this, 'cleanIndexes'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Model.cleanIndexes() no longer accepts a callback'); + } + const model = this; + + if (Array.isArray(options?.toDrop)) { + const res = await _dropIndexes(options.toDrop, model, options); + return res; + } + + const res = await model.diffIndexes(); + return await _dropIndexes(res.toDrop, model, options); +}; + +async function _dropIndexes(toDrop, model, options) { + if (toDrop.length === 0) { + return []; + } + + const collection = model.$__collection; + if (options?.hideIndexes) { + await Promise.all(toDrop.map(indexName => { + return model.db.db.command({ + collMod: collection.collectionName, + index: { name: indexName, hidden: true } + }); + })); + } else { + await Promise.all(toDrop.map(indexName => collection.dropIndex(indexName))); + } + + return toDrop; +} + +/** + * Lists the indexes currently defined in MongoDB. This may or may not be + * the same as the indexes defined in your schema depending on whether you + * use the [`autoIndex` option](https://mongoosejs.com/docs/guide.html#autoIndex) and if you + * build indexes manually. + * + * @return {Promise} + * @api public + */ + +Model.listIndexes = async function listIndexes() { + _checkContext(this, 'listIndexes'); + if (typeof arguments[0] === 'function') { + throw new MongooseError('Model.listIndexes() no longer accepts a callback'); + } + + if (this.$__collection.buffer) { + await new Promise(resolve => { + this.$__collection.addQueue(resolve); + }); + } + + return this.$__collection.listIndexes().toArray(); +}; + +/** + * Sends `createIndex` commands to mongo for each index declared in the schema. + * The `createIndex` commands are sent in series. + * + * #### Example: + * + * await Event.ensureIndexes(); + * + * After completion, an `index` event is emitted on this `Model` passing an error if one occurred. + * + * #### Example: + * + * const eventSchema = new Schema({ thing: { type: 'string', unique: true } }) + * const Event = mongoose.model('Event', eventSchema); + * + * Event.on('index', function (err) { + * if (err) console.error(err); // error occurred during index creation + * }); + * + * _NOTE: It is not recommended that you run this in production. Index creation may impact database performance depending on your load. Use with caution._ + * + * @param {object} [options] internal options + * @return {Promise} + * @api public + */ + +Model.ensureIndexes = async function ensureIndexes(options) { + _checkContext(this, 'ensureIndexes'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Model.ensureIndexes() no longer accepts a callback'); + } + + await new Promise((resolve, reject) => { + _ensureIndexes(this, options, (err) => { + if (err != null) { + return reject(err); + } + resolve(); + }); + }); +}; + +/** + * Similar to `ensureIndexes()`, except for it uses the [`createIndex`](https://mongodb.github.io/node-mongodb-native/7.0/classes/Db.html#createIndex) + * function. + * + * @param {object} [options] internal options + * @return {Promise} + * @api public + */ + +Model.createIndexes = async function createIndexes(options) { + _checkContext(this, 'createIndexes'); + + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function') { + throw new MongooseError('Model.createIndexes() no longer accepts a callback'); + } + + return this.ensureIndexes(options); +}; + + +/*! + * ignore + */ + +function _ensureIndexes(model, options, callback) { + const indexes = Array.isArray(options?.toCreate) ? options.toCreate : model.schema.indexes(); + let indexError; + + options = options || {}; + const done = function(err) { + if (err && !model.$caught) { + model.emit('error', err); + } + model.emit('index', err || indexError); + callback && callback(err || indexError); + }; + + for (const index of indexes) { + if (isDefaultIdIndex(index)) { + utils.warn('mongoose: Cannot specify a custom index on `_id` for ' + + 'model name "' + model.modelName + '", ' + + 'MongoDB does not allow overwriting the default `_id` index. See ' + + 'https://bit.ly/mongodb-id-index'); + } + } + + // Check for duplicate index definitions (gh-15056) + const seenIndexes = []; + for (const index of indexes) { + const fields = index[0]; + const indexOptions = index[1]; + if (indexOptions.name == null) { + for (const existingIndex of seenIndexes) { + if (existingIndex[1].name == null && isIndexSpecEqual(existingIndex[0], fields)) { + utils.warn('mongoose: Duplicate schema index on ' + JSON.stringify(fields) + + ' for model "' + model.modelName + '". ' + + 'This is often due to declaring an index using both "index: true" and "schema.index()". ' + + 'MongoDB will not create the duplicate index and options on the duplicate definition (such as expireAfterSeconds or unique) will not be applied. ' + + 'Please remove the duplicate index definition.'); + break; + } + } + } + seenIndexes.push(index); + } + + if (!indexes.length) { + immediate(function() { + done(); + }); + return; + } + // Indexes are created one-by-one + + const indexSingleDone = function(err, fields, options, name) { + model.emit('index-single-done', err, fields, options, name); + }; + const indexSingleStart = function(fields, options) { + model.emit('index-single-start', fields, options); + }; + + const baseSchema = model.schema._baseSchema; + const baseSchemaIndexes = baseSchema ? baseSchema.indexes() : []; + + immediate(function() { + // If buffering is off, do this manually. + if (options._automatic && !model.collection.collection) { + model.collection.addQueue(create, []); + } else { + create(); + } + }); + + + function create() { + if (options._automatic) { + if (model.schema.options.autoIndex === false || + (model.schema.options.autoIndex == null && model.db.config.autoIndex === false)) { + return done(); + } + } + + const index = indexes.shift(); + if (!index) { + return done(); + } + if (options._automatic && index[1]._autoIndex === false) { + return create(); + } + + if (baseSchemaIndexes.find(i => utils.deepEqual(i, index))) { + return create(); + } + + const indexFields = clone(index[0]); + const indexOptions = clone(index[1]); + + delete indexOptions._autoIndex; + decorateDiscriminatorIndexOptions(model.schema, indexOptions); + applyWriteConcern(model.schema, indexOptions); + applySchemaCollation(indexFields, indexOptions, model.schema.options); + + indexSingleStart(indexFields, options); + + // Just in case `createIndex()` throws a sync error + let promise = null; + try { + promise = model.collection.createIndex(indexFields, indexOptions); + } catch (err) { + if (!indexError) { + indexError = err; + } + if (!model.$caught) { + model.emit('error', err); + } + + indexSingleDone(err, indexFields, indexOptions); + create(); + return; + } + + promise.then( + name => { + indexSingleDone(null, indexFields, indexOptions, name); + create(); + }, + err => { + if (!indexError) { + indexError = err; + } + if (!model.$caught) { + model.emit('error', err); + } + + indexSingleDone(err, indexFields, indexOptions); + create(); + } + ); + } +} + +/** + * Creates all [Atlas search indexes](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) defined in this model's schema. + * This function only works when connected to MongoDB Atlas. + * + * #### Example: + * + * const schema = new Schema({ + * name: String, + * description: String + * }); + * schema.searchIndex({ name: 'test', definition: { mappings: { dynamic: true } } }); + * const Product = mongoose.model('Product', schema); + * + * // Creates the search index defined in the schema + * await Product.createSearchIndexes(); + * + * @api public + * @return {Promise} resolves to the results of creating the search indexes + */ + +Model.createSearchIndexes = async function createSearchIndexes() { + _checkContext(this, 'createSearchIndexes'); + const results = []; + for (const searchIndex of this.schema._searchIndexes) { + results.push(await this.createSearchIndex(searchIndex)); + } + return results; +}; + +/** + * Schema the model uses. + * + * @property schema + * @static + * @api public + * @memberOf Model + */ + +Model.schema; + +/** + * Connection instance the model uses. + * + * @property db + * @static + * @api public + * @memberOf Model + */ + +Model.db; + +/** + * Collection the model uses. + * + * @property collection + * @api public + * @memberOf Model + */ + +Model.collection; + +/** + * Internal collection the model uses. + * + * @property collection + * @api private + * @memberOf Model + */ +Model.$__collection; + +/** + * Base Mongoose instance the model uses. + * + * @property base + * @api public + * @memberOf Model + */ + +Model.base; + +/** + * Registered discriminators for this model. + * + * @property discriminators + * @api public + * @memberOf Model + */ + +Model.discriminators; + +/** + * Translate any aliases fields/conditions so the final query or document object is pure + * + * #### Example: + * + * await Character.find(Character.translateAliases({ + * '名': 'Eddard Stark' // Alias for 'name' + * }); + * + * By default, `translateAliases()` overwrites raw fields with aliased fields. + * So if `n` is an alias for `name`, `{ n: 'alias', name: 'raw' }` will resolve to `{ name: 'alias' }`. + * However, you can set the `errorOnDuplicates` option to throw an error if there are potentially conflicting paths. + * The `translateAliases` option for queries uses `errorOnDuplicates`. + * + * #### Note: + * + * Only translate arguments of object type anything else is returned raw + * + * @param {object} fields fields/conditions that may contain aliased keys + * @param {boolean} [errorOnDuplicates] if true, throw an error if there's both a key and an alias for that key in `fields` + * @return {object} the translated 'pure' fields/conditions + */ +Model.translateAliases = function translateAliases(fields, errorOnDuplicates) { + _checkContext(this, 'translateAliases'); + + const translate = (key, value) => { + let alias; + const translated = []; + const fieldKeys = key.split('.'); + let currentSchema = this.schema; + for (const i in fieldKeys) { + const name = fieldKeys[i]; + if (currentSchema?.aliases[name]) { + alias = currentSchema.aliases[name]; + if (errorOnDuplicates && alias in fields) { + throw new MongooseError(`Provided object has both field "${name}" and its alias "${alias}"`); + } + // Alias found, + translated.push(alias); + } else { + alias = name; + // Alias not found, so treat as un-aliased key + translated.push(name); + } + + // Check if aliased path is a schema + if (currentSchema?.paths[alias]) { + currentSchema = currentSchema.paths[alias].schema; + } + else + currentSchema = null; + } + + const translatedKey = translated.join('.'); + if (fields instanceof Map) + fields.set(translatedKey, value); + else + fields[translatedKey] = value; + + if (translatedKey !== key) { + // We'll be using the translated key instead + if (fields instanceof Map) { + // Delete from map + fields.delete(key); + } else { + // Delete from object + delete fields[key]; // We'll be using the translated key instead + } + } + return fields; + }; + + if (typeof fields === 'object') { + // Fields is an object (query conditions or document fields) + if (fields instanceof Map) { + // A Map was supplied + for (const field of new Map(fields)) { + fields = translate(field[0], field[1]); + } + } else { + // Infer a regular object was supplied + for (const key of Object.keys(fields)) { + fields = translate(key, fields[key]); + if (key[0] === '$') { + if (Array.isArray(fields[key])) { + for (const i in fields[key]) { + // Recursively translate nested queries + fields[key][i] = this.translateAliases(fields[key][i]); + } + } else { + this.translateAliases(fields[key]); + } + } + } + } + + return fields; + } else { + // Don't know typeof fields + return fields; + } +}; + +/** + * Deletes the first document that matches `conditions` from the collection. + * It returns an object with the property `deletedCount` indicating how many documents were deleted. + * + * #### Example: + * + * await Character.deleteOne({ name: 'Eddard Stark' }); // returns {deletedCount: 1} + * + * #### Note: + * + * This function triggers `deleteOne` query hooks. Read the + * [middleware docs](https://mongoosejs.com/docs/middleware.html#naming) to learn more. + * + * @param {object} conditions + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @api public + */ + +Model.deleteOne = function deleteOne(conditions, options) { + _checkContext(this, 'deleteOne'); + + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.prototype.deleteOne() no longer accepts a callback'); + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.setOptions(options); + + return mq.deleteOne(conditions); +}; + +/** + * Deletes all of the documents that match `conditions` from the collection. + * It returns an object with the property `deletedCount` containing the number of documents deleted. + * + * #### Example: + * + * await Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }); // returns {deletedCount: x} where x is the number of documents deleted. + * + * #### Note: + * + * This function triggers `deleteMany` query hooks. Read the + * [middleware docs](https://mongoosejs.com/docs/middleware.html#naming) to learn more. + * + * @param {object} conditions + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @api public + */ + +Model.deleteMany = function deleteMany(conditions, options) { + _checkContext(this, 'deleteMany'); + + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.deleteMany() no longer accepts a callback'); + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.setOptions(options); + + return mq.deleteMany(conditions); +}; + +/** + * Finds documents. + * + * Mongoose casts the `filter` to match the model's schema before the command is sent. + * See our [query casting tutorial](https://mongoosejs.com/docs/tutorials/query_casting.html) for + * more information on how Mongoose casts `filter`. + * + * #### Example: + * + * // find all documents + * await MyModel.find({}); + * + * // find all documents named john and at least 18 + * await MyModel.find({ name: 'john', age: { $gte: 18 } }).exec(); + * + * // executes, name LIKE john and only selecting the "name" and "friends" fields + * await MyModel.find({ name: /john/i }, 'name friends').exec(); + * + * // passing options + * await MyModel.find({ name: /john/i }, null, { skip: 10 }).exec(); + * + * @param {object|ObjectId} filter + * @param {object|string|string[]} [projection] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()) + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @see field selection https://mongoosejs.com/docs/api/query.html#Query.prototype.select() + * @see query casting https://mongoosejs.com/docs/tutorials/query_casting.html + * @api public + */ + +Model.find = function find(conditions, projection, options) { + _checkContext(this, 'find'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function' || typeof arguments[3] === 'function') { + throw new MongooseError('Model.find() no longer accepts a callback'); + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(projection); + mq.setOptions(options); + + return mq.find(conditions); +}; + +/** + * Finds documents and counts the number of documents matching the filter. + * + * This function fires both `find` and `countDocuments` middleware. + * + * #### Example: + * + * const [adventures, total] = await Adventure.findAndCount( + * { type: 'jungle' }, + * null, + * { sort: { name: 1 }, skip: 10, limit: 10 } + * ); + * + * adventures; // Array of at most 10 documents matching type 'jungle' + * total; // Number of documents matching type 'jungle' + * + * @param {object|ObjectId} filter + * @param {object|string|string[]} [projection] optional fields to return + * @param {object} [options] optional query options + * @return {Promise} a promise that resolves to `[documents, total]` + * @api public + */ + +Model.findAndCount = async function findAndCount(conditions, projection, options) { + _checkContext(this, 'findAndCount'); + + if (options == null) { + throw new MongooseError('Model.findAndCount() requires an `options` argument with `sort` and `limit`'); + } + if (options.sort == null) { + throw new MongooseError('Model.findAndCount() requires `options.sort`'); + } + if (options.limit == null) { + throw new MongooseError('Model.findAndCount() requires `options.limit`'); + } + + const findQuery = this.find(conditions, projection, options); + const countQuery = findQuery.clone().countDocuments().skip(0).limit(null); + + return Promise.all([findQuery.exec(), countQuery.exec()]); +}; + +/** + * Finds a single document by its _id field. `findById(id)` is equivalent to `findOne({ _id: id })`. + * + * The `id` is cast based on the Schema before sending the command. + * + * This function triggers the following middleware. + * + * - `findOne()` + * + * #### Example: + * + * // Find the adventure with the given `id`, or `null` if not found + * await Adventure.findById(id).exec(); + * + * // select only the adventures name and length + * await Adventure.findById(id, 'name length').exec(); + * + * @param {any} id value of `_id` to query by + * @param {object|string|string[]} [projection] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()) + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @return {Query} + * @see field selection https://mongoosejs.com/docs/api/query.html#Query.prototype.select() + * @see lean queries https://mongoosejs.com/docs/tutorials/lean.html + * @see findById in Mongoose https://masteringjs.io/tutorials/mongoose/find-by-id + * @api public + */ + +Model.findById = function findById(id, projection, options) { + _checkContext(this, 'findById'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.findById() no longer accepts a callback'); + } + + return this.findOne({ _id: id }, projection, options); +}; + +/** + * Finds one document. + * + * The `conditions` are cast to their respective SchemaTypes before the command is sent. + * + * *Note:* `conditions` is optional, and if `conditions` is null or undefined, + * mongoose will send an empty `findOne` command to MongoDB, which will return + * an arbitrary document. If you're querying by `_id`, use `findById()` instead. + * + * #### Example: + * + * // Find one adventure whose `country` is 'Croatia', otherwise `null` + * await Adventure.findOne({ country: 'Croatia' }).exec(); + * + * // Model.findOne() no longer accepts a callback + * + * // Select only the adventures name and length + * await Adventure.findOne({ country: 'Croatia' }, 'name length').exec(); + * + * @param {object} [conditions] + * @param {object|string|string[]} [projection] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()) + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @see field selection https://mongoosejs.com/docs/api/query.html#Query.prototype.select() + * @see lean queries https://mongoosejs.com/docs/tutorials/lean.html + * @api public + */ + +Model.findOne = function findOne(conditions, projection, options) { + _checkContext(this, 'findOne'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.findOne() no longer accepts a callback'); + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(projection); + mq.setOptions(options); + + return mq.findOne(conditions); +}; + +/** + * Estimates the number of documents in the MongoDB collection. Faster than + * using `countDocuments()` for large collections because + * `estimatedDocumentCount()` uses collection metadata rather than scanning + * the entire collection. + * + * #### Example: + * + * const numAdventures = await Adventure.estimatedDocumentCount(); + * + * @param {object} [options] + * @return {Query} + * @api public + */ + +Model.estimatedDocumentCount = function estimatedDocumentCount(options) { + _checkContext(this, 'estimatedDocumentCount'); + + const mq = new this.Query({}, {}, this, this.$__collection); + + return mq.estimatedDocumentCount(options); +}; + +/** + * Counts number of documents matching `filter` in a database collection. + * + * #### Example: + * + * const count = await Adventure.countDocuments({ type: 'jungle' }); + * console.log('there are %d jungle adventures', count); + * + * If you want to count all documents in a large collection, + * use the [`estimatedDocumentCount()` function](https://mongoosejs.com/docs/api/model.html#Model.estimatedDocumentCount()) + * instead. If you call `countDocuments({})`, MongoDB will always execute + * a full collection scan and **not** use any indexes. + * + * The `countDocuments()` function is similar to `count()`, but there are a + * [few operators that `countDocuments()` does not support](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#countDocuments). + * Below are the operators that `count()` supports but `countDocuments()` does not, + * and the suggested replacement: + * + * - `$where`: [`$expr`](https://www.mongodb.com/docs/manual/reference/operator/query/expr/) + * - `$near`: [`$geoWithin`](https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/) with [`$center`](https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center) + * - `$nearSphere`: [`$geoWithin`](https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/) with [`$centerSphere`](https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere) + * + * @param {object} filter + * @return {Query} + * @api public + */ + +Model.countDocuments = function countDocuments(conditions, options) { + _checkContext(this, 'countDocuments'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.countDocuments() no longer accepts a callback'); + } + + const mq = new this.Query({}, {}, this, this.$__collection); + if (options != null) { + mq.setOptions(options); + } + + return mq.countDocuments(conditions); +}; + + +/** + * Creates a Query for a `distinct` operation. + * + * #### Example: + * + * const query = Link.distinct('url'); + * query.exec(); + * + * @param {string} field + * @param {object} [conditions] optional + * @param {object} [options] optional + * @return {Query} + * @api public + */ + +Model.distinct = function distinct(field, conditions, options) { + _checkContext(this, 'distinct'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.distinct() no longer accepts a callback'); + } + + const mq = new this.Query({}, {}, this, this.$__collection); + if (options != null) { + mq.setOptions(options); + } + + return mq.distinct(field, conditions); +}; + +/** + * Creates a Query, applies the passed conditions, and returns the Query. + * + * For example, instead of writing: + * + * User.find({ age: { $gte: 21, $lte: 65 } }); + * + * we can instead write: + * + * User.where('age').gte(21).lte(65).exec(); + * + * Since the Query class also supports `where` you can continue chaining + * + * User + * .where('age').gte(21).lte(65) + * .where('name', /^b/i) + * ... etc + * + * @param {string} path + * @param {object} [val] optional value + * @return {Query} + * @api public + */ + +Model.where = function where(path, val) { + _checkContext(this, 'where'); + + void val; // eslint + const mq = new this.Query({}, {}, this, this.$__collection).find({}); + return mq.where.apply(mq, arguments); +}; + +/** + * Creates a `Query` and specifies a `$where` condition. + * + * Sometimes you need to query for things in mongodb using a JavaScript expression. You can do so via `find({ $where: javascript })`, or you can use the mongoose shortcut method $where via a Query chain or from your mongoose Model. + * + * const result = await Blog.$where('this.username.indexOf("val") !== -1').exec(); + * + * @param {string|Function} argument is a javascript string or anonymous function + * @method $where + * @memberOf Model + * @return {Query} + * @see Query.$where https://mongoosejs.com/docs/api/query.html#Query.prototype.$where + * @api public + */ + +Model.$where = function $where() { + _checkContext(this, '$where'); + + const mq = new this.Query({}, {}, this, this.$__collection).find({}); + return mq.$where.apply(mq, arguments); +}; + +/** + * Issues a mongodb findOneAndUpdate command. + * + * Finds a matching document, updates it according to the `update` arg, passing any `options`. A Query object is returned. + * + * #### Example: + * + * A.findOneAndUpdate(filter, update, options); // returns Query + * A.findOneAndUpdate(filter, update); // returns Query + * A.findOneAndUpdate(filter); // returns Query + * A.findOneAndUpdate(); // returns Query + * + * // Other supported syntaxes + * // Note that calling `Query#findOneAndUpdate()` with 1 arg will treat the arg as `update`, NOT `filter` + * A.find(filter).findOneAndUpdate(update); + * + * #### Note: + * + * All top level update keys which are not `atomic` operation names are treated as set operations: + * + * #### Example: + * + * const query = { name: 'borne' }; + * Model.findOneAndUpdate(query, { name: 'jason bourne' }, options); + * + * // is sent as + * Model.findOneAndUpdate(query, { $set: { name: 'jason bourne' }}, options); + * + * #### Note: + * + * `findOneAndX` and `findByIdAndX` functions support limited validation that + * you can enable by setting the `runValidators` option. + * + * If you need full-fledged validation, use the traditional approach of first + * retrieving the document. + * + * const doc = await Model.findById(id); + * doc.name = 'jason bourne'; + * await doc.save(); + * + * @param {object} [conditions] + * @param {object} [update] + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {'before'|'after'} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and [the Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {object|string|string[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()) + * @param {boolean} [options.new=false] if true, return the modified document rather than the original + * @param {object|string} [options.fields] Field selection. Equivalent to `.select(fields).findOneAndUpdate()` + * @param {number} [options.maxTimeMS] puts a time limit on the query - requires mongodb >= 2.6.0 + * @param {object|string} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. + * @param {boolean} [options.runValidators] if true, runs [update validators](https://mongoosejs.com/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema + * @param {boolean} [options.setDefaultsOnInsert=true] If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created + * @param {boolean} [options.includeResultMetadata] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @return {Query} + * @see Tutorial https://mongoosejs.com/docs/tutorials/findoneandupdate.html + * @see mongodb https://www.mongodb.com/docs/manual/reference/command/findAndModify/ + * @api public + */ + +Model.findOneAndUpdate = function(conditions, update, options) { + _checkContext(this, 'findOneAndUpdate'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function' || typeof arguments[3] === 'function') { + throw new MongooseError('Model.findOneAndUpdate() no longer accepts a callback'); + } + + let fields; + if (options) { + fields = options.fields || options.projection; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + + return mq.findOneAndUpdate(conditions, update, options); +}; + +/** + * Issues a mongodb findOneAndUpdate command by a document's _id field. + * `findByIdAndUpdate(id, ...)` is equivalent to `findOneAndUpdate({ _id: id }, ...)`. + * + * Finds a matching document, updates it according to the `update` arg, + * passing any `options`, and returns the found document (if any). + * + * This function triggers the following middleware. + * + * - `findOneAndUpdate()` + * + * #### Example: + * + * A.findByIdAndUpdate(id, update, options) // returns Query + * A.findByIdAndUpdate(id, update) // returns Query + * A.findByIdAndUpdate() // returns Query + * + * #### Note: + * + * All top level update keys which are not `atomic` operation names are treated as set operations: + * + * #### Example: + * + * Model.findByIdAndUpdate(id, { name: 'jason bourne' }, options) + * + * // is sent as + * Model.findByIdAndUpdate(id, { $set: { name: 'jason bourne' }}, options) + * + * #### Note: + * + * `findOneAndX` and `findByIdAndX` functions support limited validation. You can + * enable validation by setting the `runValidators` option. + * + * If you need full-fledged validation, use the traditional approach of first + * retrieving the document. + * + * const doc = await Model.findById(id) + * doc.name = 'jason bourne'; + * await doc.save(); + * + * @param {object|number|string} id value of `_id` to query by + * @param {object} [update] + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {'before'|'after'} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and [the Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {object|string} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. + * @param {boolean} [options.runValidators] if true, runs [update validators](https://mongoosejs.com/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema + * @param {boolean} [options.setDefaultsOnInsert=true] If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {boolean} [options.new=false] if true, return the modified document rather than the original + * @param {object|string} [options.select] sets the document fields to return. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @return {Query} + * @see Model.findOneAndUpdate https://mongoosejs.com/docs/api/model.html#Model.findOneAndUpdate() + * @see mongodb https://www.mongodb.com/docs/manual/reference/command/findAndModify/ + * @api public + */ + +Model.findByIdAndUpdate = function(id, update, options) { + _checkContext(this, 'findByIdAndUpdate'); + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function' || typeof arguments[3] === 'function') { + throw new MongooseError('Model.findByIdAndUpdate() no longer accepts a callback'); + } + + // if a model is passed in instead of an id + if (id instanceof Document) { + id = id._doc._id; + } + + return this.findOneAndUpdate.call(this, { _id: id }, update, options); +}; + +/** + * Issue a MongoDB `findOneAndDelete()` command. + * + * Finds a matching document, removes it, and returns the found document (if any). + * + * This function triggers the following middleware. + * + * - `findOneAndDelete()` + * + * #### Example: + * + * A.findOneAndDelete(conditions, options) // return Query + * A.findOneAndDelete(conditions) // returns Query + * A.findOneAndDelete() // returns Query + * + * `findOneAndX` and `findByIdAndX` functions support limited validation. You can + * enable validation by setting the `runValidators` option. + * + * If you need full-fledged validation, use the traditional approach of first + * retrieving the document. + * + * const doc = await Model.findById(id) + * doc.name = 'jason bourne'; + * await doc.save(); + * + * @param {object} conditions + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {object|string|string[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {object|string} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. + * @param {object|string} [options.select] sets the document fields to return. + * @param {number} [options.maxTimeMS] puts a time limit on the query - requires mongodb >= 2.6.0 + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @api public + */ + +Model.findOneAndDelete = function(conditions, options) { + _checkContext(this, 'findOneAndDelete'); + + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.findOneAndDelete() no longer accepts a callback'); + } + + let fields; + if (options) { + fields = options.select; + options.select = undefined; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + + return mq.findOneAndDelete(conditions, options); +}; + +/** + * Issue a MongoDB `findOneAndDelete()` command by a document's _id field. + * In other words, `findByIdAndDelete(id)` is a shorthand for + * `findOneAndDelete({ _id: id })`. + * + * This function triggers the following middleware. + * + * - `findOneAndDelete()` + * + * @param {object|number|string} id value of `_id` to query by + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @see Model.findOneAndDelete https://mongoosejs.com/docs/api/model.html#Model.findOneAndDelete() + * @see mongodb https://www.mongodb.com/docs/manual/reference/command/findAndModify/ + */ + +Model.findByIdAndDelete = function(id, options) { + _checkContext(this, 'findByIdAndDelete'); + + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.findByIdAndDelete() no longer accepts a callback'); + } + + return this.findOneAndDelete({ _id: id }, options); +}; + +/** + * Issue a MongoDB `findOneAndReplace()` command. + * + * Finds a matching document, replaces it with the provided doc, and returns the document. + * + * This function triggers the following query middleware. + * + * - `findOneAndReplace()` + * + * #### Example: + * + * A.findOneAndReplace(filter, replacement, options) // return Query + * A.findOneAndReplace(filter, replacement) // returns Query + * A.findOneAndReplace() // returns Query + * + * @param {object} filter Replace the first document that matches this filter + * @param {object} [replacement] Replace with this document + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {'before'|'after'} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and [the Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {object|string|string[]} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.select()) + * @param {object|string} [options.sort] if multiple docs are found by the conditions, sets the sort order to choose which doc to update. + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {object|string} [options.select] sets the document fields to return. + * @param {number} [options.maxTimeMS] puts a time limit on the query - requires mongodb >= 2.6.0 + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @api public + */ + +Model.findOneAndReplace = function(filter, replacement, options) { + _checkContext(this, 'findOneAndReplace'); + + if (typeof arguments[0] === 'function' || typeof arguments[1] === 'function' || typeof arguments[2] === 'function' || typeof arguments[3] === 'function') { + throw new MongooseError('Model.findOneAndReplace() no longer accepts a callback'); + } + + let fields; + if (options) { + fields = options.select; + options.select = undefined; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + + return mq.findOneAndReplace(filter, replacement, options); +}; + +/** + * Shortcut for saving one or more documents to the database. + * `MyModel.create(docs)` does `new MyModel(doc).save()` for every doc in + * docs. + * + * This function triggers the following middleware. + * + * - `save()` + * + * #### Example: + * + * // Insert one new `Character` document + * await Character.create({ name: 'Jean-Luc Picard' }); + * + * // Insert multiple new `Character` documents + * await Character.create([{ name: 'Will Riker' }, { name: 'Geordi LaForge' }]); + * + * // Create a new character within a transaction. Note that you **must** + * // pass an array as the first parameter to `create()` if you want to + * // specify options. + * await Character.create([{ name: 'Jean-Luc Picard' }], { session }); + * + * @param {Array|object} docs Documents to insert, as a spread or array + * @param {object} [options] Options passed down to `save()`. To specify `options`, `docs` **must** be an array, not a spread. See [Model.save](https://mongoosejs.com/docs/api/model.html#Model.prototype.save()) for available options. + * @param {boolean} [options.ordered] saves the docs in series rather than parallel. + * @param {boolean} [options.aggregateErrors] Aggregate Errors instead of throwing the first one that occurs. Default: false + * @return {Promise} + * @api public + */ + +Model.create = async function create(doc, options) { + if (typeof options === 'function' || + typeof arguments[2] === 'function') { + throw new MongooseError('Model.create() no longer accepts a callback'); + } + + _checkContext(this, 'create'); + + let args; + const discriminatorKey = this.schema.options.discriminatorKey; + + if (Array.isArray(doc)) { + args = doc; + options = options != null && typeof options === 'object' ? options : {}; + } else { + const last = arguments[arguments.length - 1]; + options = {}; + const hasCallback = typeof last === 'function' || + typeof options === 'function' || + typeof arguments[2] === 'function'; + if (hasCallback) { + throw new MongooseError('Model.create() no longer accepts a callback'); + } else { + args = [...arguments]; + // For backwards compatibility with 6.x, because of gh-5061 Mongoose 6.x and + // older would treat a falsy last arg as a callback. We don't want to throw + // an error here, because it would look strange if `Test.create({}, void 0)` + // threw a callback error. But we also don't want to create an unnecessary document. + if (args.length > 1 && !last) { + args.pop(); + } + } + + if (args.length === 2 && + args[0] != null && + args[1] != null && + args[0].session == null && + last && + getConstructorName(last.session) === 'ClientSession' && + !this.schema.path('session')) { + // Probably means the user is running into the common mistake of trying + // to use a spread to specify options, see gh-7535 + utils.warn('WARNING: to pass a `session` to `Model.create()` in ' + + 'Mongoose, you **must** pass an array as the first argument. See: ' + + 'https://mongoosejs.com/docs/api/model.html#Model.create()'); + } + } + + if (args.length === 0) { + return Array.isArray(doc) ? [] : null; + } + let res = []; + const immediateError = typeof options.aggregateErrors === 'boolean' ? !options.aggregateErrors : true; + + delete options.aggregateErrors; // dont pass on the option to "$save" + + if (options.session && !options.ordered && args.length > 1) { + throw new MongooseError('Cannot call `create()` with a session and multiple documents unless `ordered: true` is set'); + } + + if (!Array.isArray(doc) && args.length === 1) { + let toSave = doc; + + const Model = this.discriminators && doc[discriminatorKey] != null ? + this.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc[discriminatorKey]) : + this; + if (Model == null) { + throw new MongooseError(`Discriminator "${doc[discriminatorKey]}" not ` + + `found for model "${this.modelName}"`); + } + + if (!(toSave instanceof Model)) { + toSave = new Model(toSave); + } + + await toSave.$save(options); + + return toSave; + } + + if (options.ordered) { + for (let i = 0; i < args.length; i++) { + try { + const doc = args[i]; + const Model = this.discriminators && doc[discriminatorKey] != null ? + this.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc[discriminatorKey]) : + this; + if (Model == null) { + throw new MongooseError(`Discriminator "${doc[discriminatorKey]}" not ` + + `found for model "${this.modelName}"`); + } + let toSave = doc; + if (!(toSave instanceof Model)) { + toSave = new Model(toSave); + } + + await toSave.$save(options); + res.push(toSave); + } catch (err) { + if (!immediateError) { + res.push(err); + } else { + throw err; + } + } + } + return res; + } else if (!immediateError) { + res = await Promise.allSettled(args.map(async doc => { + const Model = this.discriminators && doc[discriminatorKey] != null ? + this.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc[discriminatorKey]) : + this; + if (Model == null) { + throw new MongooseError(`Discriminator "${doc[discriminatorKey]}" not ` + + `found for model "${this.modelName}"`); + } + let toSave = doc; + + if (!(toSave instanceof Model)) { + toSave = new Model(toSave); + } + + await toSave.$save(options); + + return toSave; + })); + res = res.map(result => result.status === 'fulfilled' ? result.value : result.reason); + } else { + let firstError = null; + res = await Promise.all(args.map(async doc => { + const Model = this.discriminators && doc[discriminatorKey] != null ? + this.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc[discriminatorKey]) : + this; + if (Model == null) { + throw new MongooseError(`Discriminator "${doc[discriminatorKey]}" not ` + + `found for model "${this.modelName}"`); + } + try { + let toSave = doc; + + if (!(toSave instanceof Model)) { + toSave = new Model(toSave); + } + + await toSave.$save(options); + + return toSave; + } catch (err) { + if (!firstError) { + firstError = err; + } + } + })); + if (firstError) { + throw firstError; + } + } + + return res; +}; + +/** + * Shortcut for saving one document to the database. + * `MyModel.insertOne(obj, options)` is almost equivalent to `new MyModel(obj).save(options)`. + * The difference is that `insertOne()` checks if `obj` is already a document, and checks for discriminators. + * + * This function triggers the following middleware. + * + * - `save()` + * + * #### Example: + * + * // Insert one new `Character` document + * const character = await Character.insertOne({ name: 'Jean-Luc Picard' }); + * character.name; // 'Jean-Luc Picard' + * + * // Create a new character within a transaction. + * await Character.insertOne({ name: 'Jean-Luc Picard' }, { session }); + * + * @param {object|Document} doc Document to insert, as a POJO or Mongoose document + * @param {object} [options] Options passed down to `save()`. + * @return {Promise} resolves to the saved document + * @api public + */ + +Model.insertOne = async function insertOne(doc, options) { + _checkContext(this, 'insertOne'); + + if (doc == null || typeof doc !== 'object') { + throw new ObjectParameterError(doc, 'doc', 'insertOne'); + } + + const discriminatorKey = this.schema.options.discriminatorKey; + const Model = this.discriminators && doc[discriminatorKey] != null ? + this.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc[discriminatorKey]) : + this; + if (Model == null) { + throw new MongooseError( + `Discriminator "${doc[discriminatorKey]}" not found for model "${this.modelName}"` + ); + } + if (!(doc instanceof Model)) { + doc = new Model(doc); + } + + return await doc.$save(options); +}; + +/** + * _Requires a replica set running MongoDB >= 3.6.0._ Watches the + * underlying collection for changes using + * [MongoDB change streams](https://www.mongodb.com/docs/manual/changeStreams/). + * + * This function does **not** trigger any middleware. In particular, it + * does **not** trigger aggregate middleware. + * + * The ChangeStream object is an event emitter that emits the following events: + * + * - 'change': A change occurred, see below example + * - 'error': An unrecoverable error occurred. In particular, change streams currently error out if they lose connection to the replica set primary. Follow [this GitHub issue](https://github.com/Automattic/mongoose/issues/6799) for updates. + * - 'end': Emitted if the underlying stream is closed + * - 'close': Emitted if the underlying stream is closed + * + * #### Example: + * + * const doc = await Person.create({ name: 'Ned Stark' }); + * const changeStream = Person.watch().on('change', change => console.log(change)); + * // Will print from the above `console.log()`: + * // { _id: { _data: ... }, + * // operationType: 'delete', + * // ns: { db: 'mydb', coll: 'Person' }, + * // documentKey: { _id: 5a51b125c5500f5aa094c7bd } } + * await doc.deleteOne(); + * + * @param {Array} [pipeline] + * @param {object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#watch) + * @param {boolean} [options.hydrate=false] if true and `fullDocument: 'updateLookup'` is set, Mongoose will automatically hydrate `fullDocument` into a fully fledged Mongoose document + * @return {ChangeStream} mongoose-specific change stream wrapper, inherits from EventEmitter + * @api public + */ + +Model.watch = function(pipeline, options) { + _checkContext(this, 'watch'); + + options = options || {}; + const watchOptions = options?.hydrate !== undefined ? + utils.omit(options, ['hydrate']) : + { ...options }; + options.model = this; + + + pipeline = pipeline || []; + prepareDiscriminatorPipeline(pipeline, this.schema, 'fullDocument'); + + const changeStreamPromise = this.db._waitForConnect().then( + () => this.$__collection.watch(pipeline, watchOptions) + ); + + return new ChangeStream(changeStreamPromise, pipeline, options); +}; + +/** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://www.mongodb.com/docs/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://www.mongodb.com/docs/manual/core/retryable-writes/), + * and [transactions](https://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + * + * Calling `MyModel.startSession()` is equivalent to calling `MyModel.db.startSession()`. + * + * This function does not trigger any middleware. + * + * #### Example: + * + * const session = await Person.startSession(); + * let doc = await Person.findOne({ name: 'Ned Stark' }, null, { session }); + * await doc.deleteOne(); + * // `doc` will always be null, even if reading from a replica set + * // secondary. Without causal consistency, it is possible to + * // get a doc back from the below query if the query reads from a + * // secondary that is experiencing replication lag. + * doc = await Person.findOne({ name: 'Ned Stark' }, null, { session, readPreference: 'secondary' }); + * + * @param {object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html#startSession) + * @param {boolean} [options.causalConsistency=true] set to false to disable causal consistency + * @return {Promise} promise that resolves to a MongoDB driver `ClientSession` + * @api public + */ + +Model.startSession = function() { + _checkContext(this, 'startSession'); + + return this.db.startSession.apply(this.db, arguments); +}; + +/** + * Shortcut for validating an array of documents and inserting them into + * MongoDB if they're all valid. This function is faster than `.create()` + * because it only sends one operation to the server, rather than one for each + * document. + * + * Mongoose always validates each document **before** sending `insertMany` + * to MongoDB. So if one document has a validation error, no documents will + * be saved, unless you set + * [the `ordered` option to false](https://www.mongodb.com/docs/manual/reference/method/db.collection.insertMany/#error-handling). + * + * This function does **not** trigger save middleware. + * + * This function triggers the following middleware. + * + * - `insertMany()` + * + * #### Example: + * + * const docs = await Movies.insertMany([ + * { name: 'Star Wars' }, + * { name: 'The Empire Strikes Back' } + * ]); + * docs[0].name; // 'Star Wars' + * + * // Return raw result from MongoDB + * const result = await Movies.insertMany([ + * { name: 'Star Wars' }, + * { name: 'The Empire Strikes Back' } + * ], { rawResult: true }); + * + * @param {Array|object|any} doc(s) + * @param {object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#insertMany) + * @param {boolean} [options.ordered=true] if true, will fail fast on the first error encountered. If false, will insert all the documents it can and report errors later. An `insertMany()` with `ordered = false` is called an "unordered" `insertMany()`. + * @param {boolean} [options.rawResult=false] if false, the returned promise resolves to the documents that passed mongoose document validation. If `true`, will return the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/InsertManyResult.html) with a `mongoose` property that contains `validationErrors` and `results` if this is an unordered `insertMany`. + * @param {boolean} [options.lean=false] if `true`, skips hydrating the documents. This means Mongoose will **not** cast, validate, or apply defaults to any of the documents passed to `insertMany()`. This option is useful if you need the extra performance, but comes with data integrity risk. Consider using with [`castObject()`](https://mongoosejs.com/docs/api/model.html#Model.castObject()) and [`applyDefaults()`](https://mongoosejs.com/docs/api/model.html#Model.applyDefaults()). + * @param {number} [options.limit=null] this limits the number of documents being processed (validation/casting) by mongoose in parallel, this does **NOT** send the documents in batches to MongoDB. Use this option if you're processing a large number of documents and your app is running out of memory. + * @param {string|object|Array} [options.populate=null] populates the result documents. This option is a no-op if `rawResult` is set. + * @param {boolean} [options.throwOnValidationError=false] If true and `ordered: false`, throw an error if one of the operations failed validation, but all valid operations completed successfully. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @return {Promise} resolving to the raw result from the MongoDB driver if `options.rawResult` was `true`, or the documents that passed validation, otherwise + * @api public + */ + +Model.insertMany = async function insertMany(arr, options) { + _checkContext(this, 'insertMany'); + if (typeof options === 'function' || + typeof arguments[2] === 'function') { + throw new MongooseError('Model.insertMany() no longer accepts a callback'); + } + + const ThisModel = this; + return traceInsertMany(function maybeTracedInsertMany() { return _insertMany.call(ThisModel, arr, options); }, () => ({ + operation: 'insertMany', + collection: ThisModel.collection.name, + database: ThisModel.db?.name, + serverAddress: ThisModel.db?.host, + serverPort: ThisModel.db?.port, + args: { docs: arr, options } + })); +}; + +async function _insertMany(arr, options) { + options = options || {}; + const hasInsertManyHooks = this._middleware.hasHooks('insertMany'); + const preFilter = hasInsertManyHooks ? buildMiddlewareFilter(options, 'pre') : null; + const postFilter = hasInsertManyHooks ? buildMiddlewareFilter(options, 'post') : null; + + if (hasInsertManyHooks) { + try { + [arr] = await this._middleware.execPre('insertMany', this, [arr], { filter: preFilter }); + } catch (error) { + await this._middleware.execPost('insertMany', this, [arr], { error, filter: postFilter }); + } + } + const ThisModel = this; + const limit = options.limit || 1000; + const rawResult = !!options.rawResult; + const ordered = options.ordered == null ? true : !!options.ordered; + const throwOnValidationError = !!options.throwOnValidationError; + const lean = !!options.lean; + + const asyncLocalStorage = this.db.base.transactionAsyncLocalStorage?.getStore(); + if (!Object.hasOwn(options, 'session') && asyncLocalStorage?.session != null) { + options = { ...options, session: asyncLocalStorage.session }; + } + + if (!Array.isArray(arr)) { + arr = [arr]; + } + + const validationErrors = []; + const results = ordered ? null : new Array(arr.length); + const session = options.session; + function validateDoc(doc, index) { + // If option `lean` is set to true bypass validation and hydration + if (lean) { + return doc; + } + let createdNewDoc = false; + if (!(doc instanceof ThisModel)) { + if (doc != null && typeof doc !== 'object') { + return Promise.reject(new ObjectParameterError(doc, 'arr.' + index, 'insertMany')); + } + doc = new ThisModel(doc); + createdNewDoc = true; + } + + if (session != null) { + doc.$session(session); + } + return doc.$validate(createdNewDoc ? { _skipParallelValidateCheck: true } : null) + .then(() => doc) + .catch(error => { + if (ordered === false) { + error.index = index; + validationErrors.push(error); + results[index] = error; + return; + } + throw error; + }); + } + + const docs = await parallelLimit(arr, validateDoc, limit); + + const validDocIndexToOriginalIndex = {}; + const docAttributes = []; + const docObjects = lean ? docAttributes : []; + const versionKeyPath = ThisModel.schema.options.versionKey + ? ThisModel.schema.paths[ThisModel.schema.options.versionKey]?.splitPath() + : null; + const timestamps = options.timestamps; + for (let i = 0; i < docs.length; ++i) { + const doc = docs[i]; + if (doc == null) { + continue; + } + validDocIndexToOriginalIndex[docAttributes.length] = i; + docAttributes.push(doc); + + // In lean mode `docObjects === docAttributes`, so the push above is enough. + if (lean) { + continue; + } + if (versionKeyPath) { + doc.$__setValue(versionKeyPath, 0); + } + const shouldSetTimestamps = timestamps !== false && doc.initializeTimestamps && (!doc.$__ || doc.$__.timestamps !== false); + if (shouldSetTimestamps) { + doc.initializeTimestamps(timestamps); + } + docObjects.push(doc.$__hasOnlyPrimitiveValues() ? doc.$__toObjectShallow() : doc.toObject(internalToObjectOptions)); + } + + // Make sure validation errors are in the same order as the + // original documents, so if both doc1 and doc2 both fail validation, + // `Model.insertMany([doc1, doc2])` will always have doc1's validation + // error before doc2's. Re: gh-12791. + if (validationErrors.length > 0 && ordered === false) { + validationErrors.sort((err1, err2) => { + return err1.index - err2.index; + }); + } + + // Quickly escape while there aren't any valid docAttributes + if (docAttributes.length === 0) { + if (throwOnValidationError) { + throw new MongooseBulkWriteError( + validationErrors, + results, + null, + 'insertMany' + ); + } + if (rawResult) { + const res = { + acknowledged: true, + insertedCount: 0, + insertedIds: {} + }; + decorateBulkWriteResult(res, validationErrors, validationErrors); + return res; + } + return []; + } + + let res; + try { + res = await this.$__collection.insertMany(docObjects, options); + } catch (error) { + // `writeErrors` is a property reported by the MongoDB driver, + // just not if there's only 1 error. + if (error.writeErrors == null && + error.result?.result?.writeErrors != null) { + error.writeErrors = error.result.result.writeErrors; + } + + // `insertedDocs` is a Mongoose-specific property + const hasWriteErrors = error?.writeErrors; + const erroredIndexes = new Set((error?.writeErrors || []).map(err => err.index)); + + if (error.writeErrors != null) { + for (let i = 0; i < error.writeErrors.length; ++i) { + const originalIndex = validDocIndexToOriginalIndex[error.writeErrors[i].index]; + error.writeErrors[i] = { ...error.writeErrors[i], index: originalIndex }; + if (!ordered) { + results[originalIndex] = error.writeErrors[i]; + } + } + } + + if (!ordered) { + for (let i = 0; i < results.length; ++i) { + if (results[i] === void 0) { + results[i] = docs[i]; + } + } + + error.results = results; + } + + let firstErroredIndex = -1; + error.insertedDocs = docAttributes. + filter((doc, i) => { + const isErrored = !hasWriteErrors || erroredIndexes.has(i); + + if (ordered) { + if (firstErroredIndex > -1) { + return i < firstErroredIndex; + } + + if (isErrored) { + firstErroredIndex = i; + } + } + + return !isErrored; + }). + map(function setIsNewForInsertedDoc(doc) { + if (lean) { + return doc; + } + doc.$__reset(true); + _setIsNew(doc, false); + return doc; + }); + + if (rawResult && ordered === false) { + decorateBulkWriteResult(error, validationErrors, results); + } + + if (hasInsertManyHooks) { + await this._middleware.execPost('insertMany', this, [arr], { error, filter: postFilter }); + } else { + throw error; + } + } + + if (!lean) { + for (const attribute of docAttributes) { + const hasOnlyPrimitiveValues = attribute.$__hasOnlyPrimitiveValues(); + attribute.$__reset(true, hasOnlyPrimitiveValues); + _setIsNew(attribute, false, hasOnlyPrimitiveValues); + } + } + + if (ordered === false && throwOnValidationError && validationErrors.length > 0) { + for (let i = 0; i < results.length; ++i) { + if (results[i] === void 0) { + results[i] = docs[i]; + } + } + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + 'insertMany' + ); + } + + if (rawResult) { + if (ordered === false) { + for (let i = 0; i < results.length; ++i) { + if (results[i] === void 0) { + results[i] = docs[i]; + } + } + + // Decorate with mongoose validation errors in case of unordered, + // because then still do `insertMany()` + decorateBulkWriteResult(res, validationErrors, results); + } + return res; + } + + if (options.populate != null) { + return this.populate(docAttributes, options.populate).catch(err => { + if (err != null) { + err.insertedDocs = docAttributes; + } + throw err; + }); + } + + if (hasInsertManyHooks) { + const [result] = await this._middleware.execPost('insertMany', this, [docAttributes], { filter: postFilter }); + return result; + } + return docAttributes; +} + +/*! + * @param {Document} doc The document to set `$isNew` on. + * @param {boolean} val The value to set `$isNew` to. + * @param {boolean} [hasOnlyPrimitiveValues] Skip getting subdocs for performance if we know there are none. + * @api private + */ + +function _setIsNew(doc, val, hasOnlyPrimitiveValues) { + doc.$isNew = val; + doc.$emit('isNew', val); + doc.constructor.emit('isNew', val); + + if (hasOnlyPrimitiveValues) { + return; + } + const subdocs = doc.$getAllSubdocs({ useCache: true }); + for (const subdoc of subdocs) { + subdoc.$isNew = val; + subdoc.$emit('isNew', val); + } +} + +/** + * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, + * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one + * command. This is faster than sending multiple independent operations (e.g. + * if you use `create()`) because with `bulkWrite()` there is only one round + * trip to MongoDB. + * + * Mongoose will perform casting on all operations you provide. + * The only exception is [setting the `update` operator for `updateOne` or `updateMany` to a pipeline](https://www.mongodb.com/docs/manual/reference/method/db.collection.bulkWrite/#updateone-and-updatemany): Mongoose does **not** cast update pipelines. + * + * This function does **not** trigger any middleware, neither `save()`, nor `update()`. + * If you need to trigger + * `save()` middleware for every document use [`create()`](https://mongoosejs.com/docs/api/model.html#Model.create()) instead. + * + * #### Example: + * + * Character.bulkWrite([ + * { + * insertOne: { + * document: { + * name: 'Eddard Stark', + * title: 'Warden of the North' + * } + * } + * }, + * { + * updateOne: { + * filter: { name: 'Eddard Stark' }, + * // If you were using the MongoDB driver directly, you'd need to do + * // `update: { $set: { title: ... } }` but mongoose adds $set for + * // you. + * update: { title: 'Hand of the King' } + * } + * }, + * { + * deleteOne: { + * filter: { name: 'Eddard Stark' } + * } + * } + * ]).then(res => { + * // Prints "1 1 1" + * console.log(res.insertedCount, res.modifiedCount, res.deletedCount); + * }); + * + * // Mongoose does **not** cast update pipelines, so no casting for the `update` option below. + * // Mongoose does still cast `filter` + * await Character.bulkWrite([{ + * updateOne: { + * filter: { name: 'Annika Hansen' }, + * update: [{ $set: { name: 7 } }] // Array means update pipeline, so Mongoose skips casting + * } + * }]); + * + * The [supported operations](https://www.mongodb.com/docs/manual/reference/method/db.collection.bulkWrite/#db.collection.bulkWrite) are: + * + * - `insertOne` + * - `updateOne` + * - `updateMany` + * - `deleteOne` + * - `deleteMany` + * - `replaceOne` + * + * @param {Array} ops + * @param {object} [ops.insertOne.document] The document to insert + * @param {object} [ops.insertOne.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation + * @param {object} [ops.updateOne.filter] Update the first document that matches this filter + * @param {object} [ops.updateOne.update] An object containing [update operators](https://www.mongodb.com/docs/manual/reference/operator/update/) + * @param {boolean} [ops.updateOne.upsert=false] If true, insert a doc if none match + * @param {boolean} [ops.updateOne.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation + * @param {boolean} [ops.updateOne.overwriteImmutable=false] Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators. + * @param {object} [ops.updateOne.collation] The [MongoDB collation](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-collations) to use + * @param {Array} [ops.updateOne.arrayFilters] The [array filters](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-36-array-filters.html) used in `update` + * @param {object} [ops.updateMany.filter] Update all the documents that match this filter + * @param {object} [ops.updateMany.update] An object containing [update operators](https://www.mongodb.com/docs/manual/reference/operator/update/) + * @param {boolean} [ops.updateMany.upsert=false] If true, insert a doc if no documents match `filter` + * @param {boolean} [ops.updateMany.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation + * @param {boolean} [ops.updateMany.overwriteImmutable=false] Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators. + * @param {object} [ops.updateMany.collation] The [MongoDB collation](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-collations) to use + * @param {Array} [ops.updateMany.arrayFilters] The [array filters](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-36-array-filters.html) used in `update` + * @param {object} [ops.deleteOne.filter] Delete the first document that matches this filter + * @param {object} [ops.deleteMany.filter] Delete all documents that match this filter + * @param {object} [ops.replaceOne.filter] Replace the first document that matches this filter + * @param {object} [ops.replaceOne.replacement] The replacement document + * @param {boolean} [ops.replaceOne.upsert=false] If true, insert a doc if no documents match `filter` + * @param {object} [ops.replaceOne.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation + * @param {object} [options] + * @param {boolean} [options.ordered=true] If true, execute writes in order and stop at the first error. If false, execute writes in parallel and continue until all writes have either succeeded or errored. + * @param {boolean} [options.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to any operations. Can be overridden at the operation-level. + * @param {ClientSession} [options.session=null] The session associated with this bulk write. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {string|number} [options.w=1] The [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/). See [`Query#w()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.w()) for more information. + * @param {number} [options.wtimeout=null] The [write concern timeout](https://www.mongodb.com/docs/manual/reference/write-concern/#wtimeout). + * @param {boolean} [options.j=true] If false, disable [journal acknowledgement](https://www.mongodb.com/docs/manual/reference/write-concern/#j-option) + * @param {boolean} [options.skipValidation=false] Set to true to skip Mongoose schema validation on bulk write operations. Mongoose currently runs validation on `insertOne` and `replaceOne` operations by default. + * @param {boolean} [options.bypassDocumentValidation=false] If true, disable [MongoDB server-side schema validation](https://www.mongodb.com/docs/manual/core/schema-validation/) for all writes in this bulk. + * @param {boolean} [options.throwOnValidationError=false] If true and `ordered: false`, throw an error if one of the operations failed validation, but all valid operations completed successfully. Note that Mongoose will still send all valid operations to the MongoDB server. + * @param {boolean|"throw"} [options.strict=null] Overwrites the [`strict` option](https://mongoosejs.com/docs/guide.html#strict) on schema. If false, allows filtering and writing fields not defined in the schema for all writes in this bulk. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @return {Promise} resolves to a [`BulkWriteOpResult`](https://mongodb.github.io/node-mongodb-native/7.0/classes/BulkWriteResult.html) if the operation succeeds + * @api public + */ + +Model.bulkWrite = async function bulkWrite(ops, options) { + _checkContext(this, 'bulkWrite'); + + if (typeof options === 'function' || + typeof arguments[2] === 'function') { + throw new MongooseError('Model.bulkWrite() no longer accepts a callback'); + } + + const ThisModel = this; + return traceBulkWrite(function maybeTracedBulkWrite() { return _bulkWrite.call(ThisModel, ops, options); }, () => ({ + operation: 'bulkWrite', + collection: ThisModel.collection.name, + database: ThisModel.db?.name, + serverAddress: ThisModel.db?.host, + serverPort: ThisModel.db?.port, + args: { ops, options } + })); +}; + +async function _bulkWrite(ops, options) { + options = options || {}; + const preFilter = buildMiddlewareFilter(options, 'pre'); + const postFilter = buildMiddlewareFilter(options, 'post'); + + try { + [ops, options] = await this.hooks.execPre('bulkWrite', this, [ops, options], { filter: preFilter }); + } catch (err) { + if (err instanceof Kareem.skipWrappedFunction) { + ops = err; + } else { + await this.hooks.execPost('bulkWrite', this, [null], { error: err, filter: postFilter }); + } + } + + if (ops instanceof Kareem.skipWrappedFunction) { + return ops.args[0]; + } + + const ordered = options.ordered == null ? true : options.ordered; + + if (ops.length === 0) { + const BulkWriteResult = this.base.driver.get().BulkWriteResult; + const bulkWriteResult = new BulkWriteResult(getDefaultBulkwriteResult(), false); + bulkWriteResult.n = 0; + decorateBulkWriteResult(bulkWriteResult, [], []); + return bulkWriteResult; + } + + const validations = options?._skipCastBulkWrite ? [] : ops.map(op => castBulkWrite(this, op, options)); + const asyncLocalStorage = this.db.base.transactionAsyncLocalStorage?.getStore(); + if ((!options || !Object.hasOwn(options, 'session')) && asyncLocalStorage?.session != null) { + options = { ...options, session: asyncLocalStorage.session }; + } + + let res = null; + if (ordered) { + await new Promise((resolve, reject) => { + each(validations, (fn, cb) => fn(cb), error => { + if (error) { + return reject(error); + } + + resolve(); + }); + }); + + try { + res = await this.$__collection.bulkWrite(ops, options); + } catch (error) { + await this.hooks.execPost('bulkWrite', this, [null], { error, filter: postFilter }); + } + } else { + let validOpIndexes = []; + let validationErrors = []; + const results = []; + if (validations.length > 0) { + validOpIndexes = await Promise.all(ops.map((op, i) => { + if (i >= validations.length) { + return i; + } + return new Promise((resolve) => { + validations[i]((err) => { + if (err == null) { + resolve(i); + } else { + validationErrors.push({ index: i, error: err }); + results[i] = err; + } + resolve(); + }); + }); + })); + validOpIndexes = validOpIndexes.filter(index => index != null); + } else { + validOpIndexes = ops.map((op, i) => i); + } + + validationErrors = validationErrors. + sort((v1, v2) => v1.index - v2.index). + map(v => v.error); + + const validOps = validOpIndexes.sort((a, b) => a - b).map(index => ops[index]); + + if (validOps.length === 0) { + if (options.throwOnValidationError && validationErrors.length) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + 'bulkWrite' + ); + } + const BulkWriteResult = this.base.driver.get().BulkWriteResult; + const bulkWriteResult = new BulkWriteResult(getDefaultBulkwriteResult(), false); + bulkWriteResult.result = getDefaultBulkwriteResult(); + decorateBulkWriteResult(bulkWriteResult, validationErrors, results); + return bulkWriteResult; + } + + let error; + [res, error] = await this.$__collection.bulkWrite(validOps, options). + then(res => ([res, null])). + catch(error => ([null, error])); + + const writeErrorsByIndex = {}; + if (error?.writeErrors) { + for (const writeError of error.writeErrors) { + writeErrorsByIndex[writeError.err.index] = writeError; + } + } + for (let i = 0; i < validOpIndexes.length; ++i) { + results[validOpIndexes[i]] = writeErrorsByIndex[i] ?? null; + } + if (error) { + if (validationErrors.length > 0) { + decorateBulkWriteResult(error, validationErrors, results); + } + + await this.hooks.execPost('bulkWrite', this, [null], { error, filter: postFilter }); + } + + if (validationErrors.length > 0) { + if (options.throwOnValidationError) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + 'bulkWrite' + ); + } else { + decorateBulkWriteResult(res, validationErrors, results); + } + } + } + + await this.hooks.execPost('bulkWrite', this, [res], { filter: postFilter }); + + return res; +} + +/** + * Takes an array of documents, gets the changes and inserts/updates documents in the database + * according to whether or not the document is new, or whether it has changes or not. + * + * `bulkSave` uses `bulkWrite` under the hood, so it's mostly useful when dealing with many documents (10K+) + * + * `bulkSave()` throws errors under the following conditions: + * + * - one of the provided documents fails validation. In this case, `bulkSave()` does not send a `bulkWrite()`, and throws the first validation error. + * - `bulkWrite()` fails (for example, due to being unable to connect to MongoDB or due to duplicate key error) + * - `bulkWrite()` did not insert or update **any** documents. In this case, `bulkSave()` will throw a DocumentNotFound error. + * + * Note that `bulkSave()` will **not** throw an error if only some of the `save()` calls succeeded. + * + * @param {Document[]} documents + * @param {object} [options] options passed to the underlying `bulkWrite()` + * @param {boolean} [options.timestamps] defaults to `null`, when set to false, mongoose will not add/update timestamps to the documents. + * @param {ClientSession} [options.session=null] The session associated with this bulk write. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {string|number} [options.w=1] The [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/). See [`Query#w()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.w()) for more information. + * @param {number} [options.wtimeout=null] The [write concern timeout](https://www.mongodb.com/docs/manual/reference/write-concern/#wtimeout). + * @param {boolean} [options.j=true] If false, disable [journal acknowledgement](https://www.mongodb.com/docs/manual/reference/write-concern/#j-option) + * @param {boolean} [options.validateBeforeSave=true] set to `false` to skip Mongoose validation on all documents + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @return {BulkWriteResult} the return value from `bulkWrite()` + */ +Model.bulkSave = async function bulkSave(documents, options) { + options = options || {}; + + if (options.timestamps != null) { + for (const document of documents) { + document.$__.saveOptions = document.$__.saveOptions || {}; + document.$__.saveOptions.timestamps = options.timestamps; + } + } else { + for (const document of documents) { + if (document.$__.timestamps != null) { + document.$__.saveOptions = document.$__.saveOptions || {}; + document.$__.saveOptions.timestamps = document.$__.timestamps; + } + } + } + + // Associate the documents with the session like `save()` does, so built-in + // `pre('save')` middleware like `trackTransaction` can snapshot document + // state and restore it between transaction retries. Re: gh-16432 + if (Object.hasOwn(options, 'session')) { + for (const document of documents) { + document.$session(options.session); + } + } + + await Promise.all(documents.map(doc => buildPreSavePromise(doc, options))); + + const writeOperations = this.buildBulkWriteOperations(documents, options); + const opts = { skipValidation: true, _skipCastBulkWrite: true, ...options }; + const { bulkWriteResult, bulkWriteError } = await this.bulkWrite(writeOperations, opts).then( + (res) => ({ bulkWriteResult: res, bulkWriteError: null }), + (err) => ({ bulkWriteResult: null, bulkWriteError: err }) + ); + // If not a MongoBulkWriteError, treat this as all documents failed to save. + if (bulkWriteError != null && bulkWriteError.name !== 'MongoBulkWriteError') { + throw bulkWriteError; + } + + const matchedCount = bulkWriteResult?.matchedCount ?? 0; + const insertedCount = bulkWriteResult?.insertedCount ?? 0; + if (writeOperations.length > 0 && matchedCount + insertedCount < writeOperations.length && !bulkWriteError) { + throw new MongooseBulkSaveIncompleteError( + this.modelName, + documents, + bulkWriteResult + ); + } + + const failedDocumentIds = documents.length >= 25 ? new Set(bulkWriteError?.writeErrors?.map(writeError => { + const writeErrorDocumentId = writeError.err.op._id || writeError.err.op.q._id; + return writeErrorDocumentId.toString(); + })) : null; + const successfulDocuments = []; + for (let i = 0; i < documents.length; i++) { + const document = documents[i]; + const documentId = document._doc._id.toString(); + const failed = failedDocumentIds == null ? bulkWriteError?.writeErrors.find(writeError => { + const writeErrorDocumentId = writeError.err.op._id || writeError.err.op.q._id; + return writeErrorDocumentId.toString() === documentId; + }) != null : failedDocumentIds.has(documentId); + if (!failed) { + successfulDocuments.push(document); + } + } + await Promise.all(successfulDocuments.map(document => handleSuccessfulWrite(document, options))); + + if (bulkWriteError != null) { + throw bulkWriteError; + } + + return bulkWriteResult; +}; + +async function buildPreSavePromise(document, options) { + const preFilter = buildMiddlewareFilter(options, 'pre'); + const [newOptions] = await document.schema.s.hooks.execPre('save', document, [options], { filter: preFilter }); + if (newOptions !== options) { + throw new MongooseError('Cannot overwrite options in pre("save") hook on bulkSave()'); + } +} + +async function handleSuccessfulWrite(document, options) { + const wasNew = document.$isNew; + if (wasNew) { + _setIsNew(document, false); + } + + document.$__reset(); + // version key gets initialized to 0 when inserting a new document so avoid incrementing version key here + if (!wasNew) { + document._applyVersionIncrement(); + } + const postFilter = buildMiddlewareFilter(options, 'post'); + return document.schema.s.hooks.execPost('save', document, [document], { filter: postFilter }); +} + +/** + * Apply defaults to the given document or POJO. + * + * @param {object|Document} obj object or document to apply defaults on + * @returns {object|Document} + * @api public + */ + +Model.applyDefaults = function applyDefaults(doc) { + if (doc == null) { + return doc; + } + if (doc.$__ != null) { + applyDefaultsHelper(doc, doc.$__.fields, doc.$__.exclude); + + for (const subdoc of doc.$getAllSubdocs()) { + applyDefaults(subdoc, subdoc.$__.fields, subdoc.$__.exclude); + } + + return doc; + } + + applyDefaultsToPOJO(doc, this.schema); + + return doc; +}; + +/** + * Apply this model's virtuals to a given POJO. Virtuals execute with the POJO as the context `this`. + * + * #### Example: + * + * const userSchema = new Schema({ name: String }); + * userSchema.virtual('upper').get(function() { return this.name.toUpperCase(); }); + * const User = mongoose.model('User', userSchema); + * + * const obj = { name: 'John' }; + * User.applyVirtuals(obj); + * obj.name; // 'John' + * obj.upper; // 'JOHN', Mongoose applied the return value of the virtual to the given object + * + * @param {object} obj object or document to apply virtuals on + * @param {string[]} [virtualsToApply] optional whitelist of virtuals to apply + * @returns {object} obj + * @api public + */ + +Model.applyVirtuals = function applyVirtuals(obj, virtualsToApply) { + if (obj == null) { + return obj; + } + // Nothing to do if this is already a hydrated document - it should already have virtuals + if (obj.$__ != null) { + return obj; + } + + applyVirtualsHelper(this.schema, obj, virtualsToApply); + + return obj; +}; + +/** + * Apply this model's timestamps to a given POJO, including subdocument timestamps + * + * #### Example: + * + * const userSchema = new Schema({ name: String }, { timestamps: true }); + * const User = mongoose.model('User', userSchema); + * + * const obj = { name: 'John' }; + * User.applyTimestamps(obj); + * obj.createdAt; // 2024-06-01T18:00:00.000Z + * obj.updatedAt; // 2024-06-01T18:00:00.000Z + * + * @param {object} obj object or document to apply virtuals on + * @param {object} [options] + * @param {boolean} [options.isUpdate=false] if true, treat this as an update: just set updatedAt, skip setting createdAt. If false, set both createdAt and updatedAt + * @param {Function} [options.currentTime] if set, Mongoose will call this function to get the current time. + * @returns {object} obj + * @api public + */ + +Model.applyTimestamps = function applyTimestamps(obj, options) { + if (obj == null) { + return obj; + } + // Nothing to do if this is already a hydrated document - it should already have timestamps + if (obj.$__ != null) { + return obj; + } + + applyTimestampsHelper(this.schema, obj, options); + + return obj; +}; + +/** + * Cast the given POJO to the model's schema + * + * #### Example: + * + * const Test = mongoose.model('Test', Schema({ num: Number })); + * + * const obj = Test.castObject({ num: '42' }); + * obj.num; // 42 as a number + * + * Test.castObject({ num: 'not a number' }); // Throws a ValidationError + * + * @param {object} obj object or document to cast + * @param {object} options options passed to castObject + * @param {boolean} options.ignoreCastErrors If set to `true` will not throw a ValidationError and only return values that were successfully cast. + * @returns {object} POJO casted to the model's schema + * @throws {ValidationError} if casting failed for at least one path + * @api public + */ + +Model.castObject = function castObject(obj, options) { + options = options || {}; + const ret = {}; + + let schema = this.schema; + const discriminatorKey = schema.options.discriminatorKey; + if (schema.discriminators != null && obj != null && obj[discriminatorKey] != null) { + schema = getSchemaDiscriminatorByValue(schema, obj[discriminatorKey]) || schema; + } + const paths = Object.keys(schema.paths); + + for (const path of paths) { + const schemaType = schema.path(path); + if (!schemaType?.$isMongooseArray) { + continue; + } + + const val = get(obj, path); + pushNestedArrayPaths(paths, val, path); + } + + let error = null; + + for (const path of paths) { + const schemaType = schema.path(path); + if (schemaType == null) { + continue; + } + + let val = get(obj, path, void 0); + + if (val == null) { + continue; + } + + const pieces = path.indexOf('.') === -1 ? [path] : path.split('.'); + let cur = ret; + for (let i = 0; i < pieces.length - 1; ++i) { + if (cur[pieces[i]] == null) { + cur[pieces[i]] = isNaN(pieces[i + 1]) ? {} : []; + } + cur = cur[pieces[i]]; + } + + if (schemaType.$isMongooseDocumentArray) { + const castNonArraysOption = schemaType.options?.castNonArrays ?? schemaType.constructor.options.castNonArrays; + if (!Array.isArray(val)) { + if (!castNonArraysOption) { + if (!options.ignoreCastErrors) { + error = error || new ValidationError(); + error.addError(path, new ObjectExpectedError(path, val)); + } + } else { + cur[pieces[pieces.length - 1]] = [ + Model.castObject.call(schemaType.Constructor, val) + ]; + } + + continue; + } + } + if (schemaType.$isSingleNested || schemaType.$isMongooseDocumentArrayElement) { + try { + val = Model.castObject.call(schemaType.Constructor, val); + } catch (err) { + if (!options.ignoreCastErrors) { + error = error || new ValidationError(); + error.addError(path, err); + } + continue; + } + + cur[pieces[pieces.length - 1]] = val; + continue; + } + + try { + val = schemaType.cast(val); + cur[pieces[pieces.length - 1]] = val; + } catch (err) { + if (!options.ignoreCastErrors) { + error = error || new ValidationError(); + error.addError(path, err); + } + + continue; + } + } + + if (error != null) { + // `{MODEL}` is replaced for query casting and document validation, so do it + // here too. Only the top-level call knows the model: the recursive calls for + // subdocuments are invoked on the subdocument constructor, which has no + // `modelName`, so this runs once over every collected error. (gh-8300) + if (this.modelName != null) { + for (const key of Object.keys(error.errors)) { + const err = error.errors[key]; + if (typeof err.setModel === 'function') { + err.setModel(this); + } + } + } + throw error; + } + + return ret; +}; + +/** + * Build bulk write operations for `bulkSave()`. + * + * @param {Document[]} documents The array of documents to build write operations of + * @param {object} options + * @param {boolean} options.skipValidation defaults to `false`, when set to true, building the write operations will bypass validating the documents. + * @param {boolean} options.timestamps defaults to `null`, when set to false, mongoose will not add/update timestamps to the documents. + * @return {Promise[]} Returns a array of all Promises the function executes to be awaited. + * @api private + */ + +Model.buildBulkWriteOperations = function buildBulkWriteOperations(documents, options) { + if (!Array.isArray(documents)) { + throw new MongooseError(`bulkSave expects an array of documents to be passed, received \`${documents}\` instead`); + } + + setDefaultOptions(); + + const writeOperations = documents.map((document, i) => { + if (!options.skipValidation) { + if (!(document instanceof Document)) { + throw new MongooseError(`documents.${i} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`); + } + if (options.validateBeforeSave == null || options.validateBeforeSave) { + const err = document.$__validateSync(); + if (err != null) { + throw err; + } + } + } + + const isANewDocument = document.isNew; + if (isANewDocument) { + // Like `$__version()` on insert, initialize the version key so + // inserted documents get the same shape as `save()` gives them + const versionKey = document.$__schema.options.versionKey; + if (versionKey) { + document.$__setValue(versionKey, 0); + } + const writeOperation = { insertOne: { document } }; + utils.injectTimestampsOption(writeOperation.insertOne, options.timestamps); + return writeOperation; + } + + const delta = document.$__delta(); + const isDocumentWithChanges = delta != null && !utils.isEmptyObject(delta[0]); + + if (isDocumentWithChanges) { + const where = document.$__where(delta[0]); + const changes = delta[1]; + + _applyCustomWhere(document, where); + + // If shard key is set, add shard keys to _filter_ condition to right shard is targeted + const shardKey = this.schema.options.shardKey; + if (shardKey) { + const paths = Object.keys(shardKey); + const len = paths.length; + + for (let i = 0; i < len; ++i) { + where[paths[i]] = document[paths[i]]; + } + } + + document.$__version(where, delta); + const writeOperation = { updateOne: { filter: where, update: changes } }; + utils.injectTimestampsOption(writeOperation.updateOne, options.timestamps); + return writeOperation; + } + + return null; + }).filter(op => op !== null); + + return writeOperations; + + + function setDefaultOptions() { + options = options || {}; + if (options.skipValidation == null) { + options.skipValidation = false; + } + } +}; + + +/** + * Shortcut for creating a new Document from existing raw data, pre-saved in the DB. + * The document returned has no paths marked as modified initially. + * + * #### Example: + * + * // hydrate previous data into a Mongoose document + * const mongooseCandy = Candy.hydrate({ _id: '54108337212ffb6d459f854c', type: 'jelly bean' }); + * + * @param {object} obj + * @param {object|string|string[]} [projection] optional projection containing which fields should be selected for this document + * @param {object} [options] optional options + * @param {boolean} [options.setters=false] if true, apply schema setters when hydrating + * @param {boolean} [options.hydratedPopulatedDocs=false] if true, populates the docs if passing pre-populated data + * @param {boolean} [options.virtuals=false] if true, sets any virtuals present on `obj` + * @param {boolean|'throw'} [options.strict=false] configure strict mode for the hydrated document. In particular, if strict is false, fields not in the schema won't be stripped out; if strict is 'throw', `hydrate()` will throw an error if there are any fields that are not in the schema. Defaults to true (silently strip out fields not in the schema). + * @return {Document} document instance + * @api public + */ + +Model.hydrate = function hydrate(obj, projection, options) { + _checkContext(this, 'hydrate'); + + if (options?.virtuals && options?.hydratedPopulatedDocs === false) { + throw new MongooseError('Cannot set `hydratedPopulatedDocs` option to false if `virtuals` option is truthy because `virtuals: true` also sets populated virtuals'); + } + + if (projection != null) { + if (obj?.$__ != null) { + obj = obj.toObject(internalToObjectOptions); + } + projection = parseProjection(projection); + obj = applyProjection(obj, projection); + } + const document = require('./queryHelpers').createModel(this, obj, projection, projection, options); + document.$init(obj, options); + return document; +}; + +/** + * Same as `updateOne()`, except MongoDB will update _all_ documents that match + * `filter` (as opposed to just the first one) regardless of the value of + * the `multi` option. + * + * **Note** updateMany will _not_ fire update middleware. Use `pre('updateMany')` + * and `post('updateMany')` instead. + * + * #### Example: + * + * const res = await Person.updateMany({ name: /Stark$/ }, { isDeleted: true }); + * res.matchedCount; // Number of documents matched + * res.modifiedCount; // Number of documents modified + * res.acknowledged; // Boolean indicating the MongoDB server received the operation. This may be false if Mongoose did not send an update to the server because the update was empty. + * res.upsertedId; // null or an id containing a document that had to be upserted. + * res.upsertedCount; // Number indicating how many documents had to be upserted. Will either be 0 or 1. + * + * // Other supported syntaxes + * await Person.find({ name: /Stark$/ }).updateMany({ isDeleted: true }); // Using chaining syntax + * await Person.find().updateMany({ isDeleted: true }); // Set `isDeleted` on _all_ Person documents + * + * This function triggers the following middleware. + * + * - `updateMany()` + * + * @param {object} filter + * @param {object|Array} update. If array, this update will be treated as an update pipeline and not casted. + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {object} [options.writeConcern=null] sets the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @return {Query} + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see MongoDB docs https://www.mongodb.com/docs/manual/reference/command/update/#update-command-output + * @see UpdateResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/UpdateResult.html + * @api public + */ + +Model.updateMany = function updateMany(conditions, update, options) { + _checkContext(this, 'updateMany'); + + if (update == null) { + throw new MongooseError('updateMany `update` parameter cannot be nullish'); + } + + return _update(this, 'updateMany', conditions, update, options); +}; + +/** + * Update _only_ the first document that matches `filter`. + * + * - Use `replaceOne()` if you want to overwrite an entire document rather than using atomic operators like `$set`. + * + * #### Example: + * + * const res = await Person.updateOne({ name: 'Jean-Luc Picard' }, { ship: 'USS Enterprise' }); + * res.matchedCount; // Number of documents matched + * res.modifiedCount; // Number of documents modified + * res.acknowledged; // Boolean indicating the MongoDB server received the operation. This may be false if Mongoose did not send an update to the server because the update was empty. + * res.upsertedId; // null or an id containing a document that had to be upserted. + * res.upsertedCount; // Number indicating how many documents had to be upserted. Will either be 0 or 1. + * + * // Other supported syntaxes + * await Person.findOne({ name: 'Jean-Luc Picard' }).updateOne({ ship: 'USS Enterprise' }); // Using chaining syntax + * await Person.updateOne({ ship: 'USS Enterprise' }); // Updates first doc's `ship` property + * + * This function triggers the following middleware. + * + * - `updateOne()` + * + * @param {object} filter + * @param {object|Array} update. If array, this update will be treated as an update pipeline and not casted. + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {object} [options.writeConcern=null] sets the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @return {Query} + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see MongoDB docs https://www.mongodb.com/docs/manual/reference/command/update/#update-command-output + * @see UpdateResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/UpdateResult.html + * @api public + */ + +Model.updateOne = function updateOne(conditions, doc, options) { + _checkContext(this, 'updateOne'); + + return _update(this, 'updateOne', conditions, doc, options); +}; + +/** + * Replace the existing document with the given document (no atomic operators like `$set`). + * + * #### Example: + * + * const res = await Person.replaceOne({ _id: 24601 }, { name: 'Jean Valjean' }); + * res.matchedCount; // Number of documents matched + * res.modifiedCount; // Number of documents modified + * res.acknowledged; // Boolean indicating the MongoDB server received the operation. + * res.upsertedId; // null or an id containing a document that had to be upserted. + * res.upsertedCount; // Number indicating how many documents had to be upserted. Will either be 0 or 1. + * + * This function triggers the following middleware. + * + * - `replaceOne()` + * + * @param {object} filter + * @param {object} doc + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {object} [options.writeConcern=null] sets the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see UpdateResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/UpdateResult.html + * @return {Query} + * @api public + */ + +Model.replaceOne = function replaceOne(conditions, doc, options) { + _checkContext(this, 'replaceOne'); + + const versionKey = this?.schema?.options?.versionKey || null; + if (versionKey && !doc[versionKey]) { + doc[versionKey] = 0; + } + + return _update(this, 'replaceOne', conditions, doc, options); +}; + +/** + * Common code for `updateOne()`, `updateMany()`, `replaceOne()`, and `update()` + * because they need to do the same thing + * @api private + */ + +function _update(model, op, conditions, doc, options) { + const mq = new model.Query({}, {}, model, model.collection); + + // gh-2406 + // make local deep copy of conditions + if (conditions instanceof Document) { + conditions = conditions.toObject(); + } else { + conditions = clone(conditions); + } + options = typeof options === 'function' ? options : clone(options); + + const versionKey = model?.schema?.options?.versionKey ?? null; + decorateUpdateWithVersionKey(doc, options, versionKey); + + return mq[op](conditions, doc, options); +} + +/** + * Performs [aggregations](https://www.mongodb.com/docs/manual/aggregation/) on the models collection. + * + * The `aggregate` itself is returned. + * + * This function triggers the following middleware. + * + * - `aggregate()` + * + * #### Example: + * + * // Find the max balance of all accounts + * const res = await Users.aggregate([ + * { $group: { _id: null, maxBalance: { $max: '$balance' }}}, + * { $project: { _id: 0, maxBalance: 1 }} + * ]); + * + * console.log(res); // [ { maxBalance: 98000 } ] + * + * // Or use the aggregation pipeline builder. + * const res = await Users.aggregate(). + * group({ _id: null, maxBalance: { $max: '$balance' } }). + * project('-id maxBalance'). + * exec(); + * console.log(res); // [ { maxBalance: 98 } ] + * + * #### Note: + * + * - Mongoose does **not** cast aggregation pipelines to the model's schema because `$project` and `$group` operators allow redefining the "shape" of the documents at any stage of the pipeline, which may leave documents in an incompatible format. You can use the [mongoose-cast-aggregation plugin](https://github.com/AbdelrahmanHafez/mongoose-cast-aggregation) to enable minimal casting for aggregation pipelines. + * - The documents returned are plain javascript objects, not mongoose documents (since any shape of document can be returned). + * + * #### More About Aggregations: + * + * - [Mongoose `Aggregate`](https://mongoosejs.com/docs/api/aggregate.html) + * - [An Introduction to Mongoose Aggregate](https://masteringjs.io/tutorials/mongoose/aggregate) + * - [MongoDB Aggregation docs](https://www.mongodb.com/docs/manual/applications/aggregation/) + * + * @see Aggregate https://mongoosejs.com/docs/api/aggregate.html#Aggregate() + * @see MongoDB https://www.mongodb.com/docs/manual/applications/aggregation/ + * @param {Array} [pipeline] aggregation pipeline as an array of objects + * @param {object} [options] aggregation options + * @return {Aggregate} + * @api public + */ + +Model.aggregate = function aggregate(pipeline, options) { + _checkContext(this, 'aggregate'); + + if (typeof options === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.aggregate() no longer accepts a callback'); + } + + const aggregate = new Aggregate(pipeline || []); + aggregate.model(this); + if (options != null) { + aggregate.option(options); + } + + return aggregate; +}; + +/** + * Casts and validates the given object against this model's schema, passing the + * given `context` to custom validators. + * + * #### Example: + * + * const Model = mongoose.model('Test', Schema({ + * name: { type: String, required: true }, + * age: { type: Number, required: true } + * }); + * + * // Succeeds + * await Model.validate({ name: 'John Smith', age: 31 }); + * + * try { + * await Model.validate({ name: null }); + * } catch (err) { + * err instanceof mongoose.Error.ValidationError; // true + * Object.keys(err.errors); // ['name'] + * } + * + * Note: the `pathsToSkip` and `pathsToValidate` options **only** apply to validation, not + * casting. This function will still throw an error for values that cannot be casted to the + * schema-specified type. Remove any paths you do not want to cast. + * + * // The following will still throw an error because the value of `age` cannot be + * // casted to a number. Remove the `age` property before calling `validate()`. + * await Model.validate({ name: 'Test', age: 'not a number' }, ['name']); + * + * @param {object} obj + * @param {object|Array|string} pathsOrOptions + * @param {object} [context] + * @return {Promise} casted and validated copy of `obj` if validation succeeded + * @api public + */ + +Model.validate = async function validate(obj, pathsOrOptions, context) { + if ((arguments.length < 3) || (arguments.length === 3 && typeof arguments[2] === 'function')) { + // For convenience, if we're validating a document or an object, make `context` default to + // the model so users don't have to always pass `context`, re: gh-10132, gh-10346 + context = obj; + } + if (typeof context === 'function' || typeof arguments[3] === 'function') { + throw new MongooseError('Model.validate() no longer accepts a callback'); + } + + let schema = this.schema; + const discriminatorKey = schema.options.discriminatorKey; + if (schema.discriminators != null && obj != null && obj[discriminatorKey] != null) { + schema = getSchemaDiscriminatorByValue(schema, obj[discriminatorKey]) || schema; + } + let paths = Object.keys(schema.paths); + + if (pathsOrOptions != null) { + const _pathsToValidate = typeof pathsOrOptions === 'string' ? new Set(pathsOrOptions.split(' ')) : Array.isArray(pathsOrOptions) ? new Set(pathsOrOptions) : new Set(paths); + paths = paths.filter(p => { + if (pathsOrOptions.pathsToSkip) { + if (Array.isArray(pathsOrOptions.pathsToSkip)) { + if (pathsOrOptions.pathsToSkip.find(x => x == p)) { + return false; + } + } else if (typeof pathsOrOptions.pathsToSkip == 'string') { + if (pathsOrOptions.pathsToSkip.includes(p)) { + return false; + } + } + } + const pieces = p.split('.'); + let cur = pieces[0]; + + for (const piece of pieces) { + if (_pathsToValidate.has(cur)) { + return true; + } + cur += '.' + piece; + } + + return _pathsToValidate.has(p); + }); + } + + for (const path of paths) { + const schemaType = schema.path(path); + if (!schemaType?.$isMongooseArray || schemaType.$isMongooseDocumentArray) { + continue; + } + + const val = get(obj, path); + pushNestedArrayPaths(paths, val, path); + } + + let error = null; + paths = new Set(paths); + + try { + obj = this.castObject(obj); + } catch (err) { + error = err; + for (const key of Object.keys(error.errors || {})) { + paths.delete(key); + } + } + + const promises = []; + for (const path of paths) { + const schemaType = schema.path(path); + if (schemaType == null) { + continue; + } + + const pieces = path.indexOf('.') === -1 ? [path] : path.split('.'); + let cur = obj; + for (let i = 0; i < pieces.length - 1; ++i) { + cur = cur[pieces[i]]; + } + + const val = get(obj, path, void 0); + promises.push( + schemaType.doValidate(val, context, { path: path }).catch(err => { + error = error || new ValidationError(); + error.addError(path, err); + }) + ); + } + + await Promise.all(promises); + if (error != null) { + throw error; + } + + return obj; +}; + +/** + * Standard Schema adapter for this model. + * Calls [`Model.validate()`](https://mongoosejs.com/docs/api/model.html#Model.validate()) internally with the provided `libraryOptions` + * to cast and validate the given value. + * + * @api public + * @property ~standard + * @memberOf Model + * @static + */ + +Object.defineProperty(Model, '~standard', { + configurable: true, + get() { + return { + version: 1, + vendor: 'mongoose', + validate: (value, options) => { + return this.validate(value, options?.libraryOptions).then( + value => ({ value }), + error => ({ issues: convertErrorToStandardSchemaIssues(error) }) + ); + } + }; + } +}); + +/** + * Populates document references. + * + * Changed in Mongoose 6: the model you call `populate()` on should be the + * "local field" model, **not** the "foreign field" model. + * + * #### Available top-level options: + * + * - path: space delimited path(s) to populate + * - select: optional fields to select + * - match: optional query conditions to match + * - model: optional name of the model to use for population + * - options: optional query options like sort, limit, etc + * - justOne: optional boolean, if true Mongoose will always set `path` to a document, or `null` if no document was found. If false, Mongoose will always set `path` to an array, which will be empty if no documents are found. Inferred from schema by default. + * - strictPopulate: optional boolean, set to `false` to allow populating paths that aren't in the schema. + * - forceRepopulate: optional boolean, defaults to `true`. Set to `false` to prevent Mongoose from repopulating paths that are already populated + * + * #### Example: + * + * const Dog = mongoose.model('Dog', new Schema({ name: String, breed: String })); + * const Person = mongoose.model('Person', new Schema({ + * name: String, + * pet: { type: mongoose.ObjectId, ref: 'Dog' } + * })); + * + * const pets = await Pet.create([ + * { name: 'Daisy', breed: 'Beagle' }, + * { name: 'Einstein', breed: 'Catalan Sheepdog' } + * ]); + * + * // populate many plain objects + * const users = [ + * { name: 'John Wick', dog: pets[0]._id }, + * { name: 'Doc Brown', dog: pets[1]._id } + * ]; + * await User.populate(users, { path: 'dog', select: 'name' }); + * users[0].dog.name; // 'Daisy' + * users[0].dog.breed; // undefined because of `select` + * + * @param {Document|Array} docs Either a single document or array of documents to populate. + * @param {object|string} options Either the paths to populate or an object specifying all parameters + * @param {string} [options.path=null] The path to populate. + * @param {string|PopulateOptions} [options.populate=null] Recursively populate paths in the populated documents. See [deep populate docs](https://mongoosejs.com/docs/populate.html#deep-populate). + * @param {boolean} [options.retainNullValues=false] By default, Mongoose removes null and undefined values from populated arrays. Use this option to make `populate()` retain `null` and `undefined` array entries. + * @param {boolean} [options.getters=false] If true, Mongoose will call any getters defined on the `localField`. By default, Mongoose gets the raw value of `localField`. For example, you would need to set this option to `true` if you wanted to [add a `lowercase` getter to your `localField`](https://mongoosejs.com/docs/schematypes.html#schematype-options). + * @param {boolean} [options.clone=false] When you do `BlogPost.find().populate('author')`, blog posts with the same author will share 1 copy of an `author` doc. Enable this option to make Mongoose clone populated docs before assigning them. + * @param {object|Function} [options.match=null] Add an additional filter to the populate query. Can be a filter object containing [MongoDB query syntax](https://www.mongodb.com/docs/manual/tutorial/query-documents/), or a function that returns a filter object. + * @param {boolean} [options.skipInvalidIds=false] By default, Mongoose throws a cast error if `localField` and `foreignField` schemas don't line up. If you enable this option, Mongoose will instead filter out any `localField` properties that cannot be casted to `foreignField`'s schema type. + * @param {number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents. + * @param {boolean} [options.strictPopulate=true] Set to false to allow populating paths that aren't defined in the given model's schema. + * @param {object} [options.options=null] Additional options like `limit` and `lean`. + * @param {Function} [options.transform=null] Function that Mongoose will call on every populated document that allows you to transform the populated document. + * @param {boolean} [options.forceRepopulate=true] Set to `false` to prevent Mongoose from repopulating paths that are already populated + * @param {boolean} [options.ordered=false] Set to `true` to execute any populate queries one at a time, as opposed to in parallel. Set this option to `true` if populating multiple paths or paths with multiple models in transactions. + * @return {Promise} + * @api public + */ + +Model.populate = async function populate(docs, paths) { + _checkContext(this, 'populate'); + if (typeof paths === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Model.populate() no longer accepts a callback'); + } + // normalized paths + paths = utils.populate(paths); + + if (paths.length === 0) { + return docs; + } + + // each path has its own query options and must be executed separately + if (paths.find(p => p.ordered)) { + // Populate in series, primarily for transactions because MongoDB doesn't support multiple operations on + // one transaction in parallel. + // Note that if _any_ path has `ordered`, we make the top-level populate `ordered` as well. + for (const path of paths) { + await _populatePath(this, docs, path); + } + } else { + // By default, populate in parallel + const promises = []; + for (const path of paths) { + promises.push(_populatePath(this, docs, path)); + } + await Promise.all(promises); + } + + return docs; +}; + +/*! + * Populates `docs` for a single `populateOptions` instance. + */ +const excludeIdReg = /\s?-_id\s?/; +const excludeIdRegGlobal = /\s?-_id\s?/g; + +async function _populatePath(model, docs, populateOptions) { + if (populateOptions.strictPopulate == null) { + if (populateOptions._localModel?.schema._userProvidedOptions.strictPopulate != null) { + populateOptions.strictPopulate = populateOptions._localModel.schema._userProvidedOptions.strictPopulate; + } else if (populateOptions._localModel != null && model.base.options.strictPopulate != null) { + populateOptions.strictPopulate = model.base.options.strictPopulate; + } else if (model.base.options.strictPopulate != null) { + populateOptions.strictPopulate = model.base.options.strictPopulate; + } + } + + // normalize single / multiple docs passed + if (!Array.isArray(docs)) { + docs = [docs]; + } + if (docs.length === 0 || docs.every(utils.isNullOrUndefined)) { + return; + } + + const modelsMap = getModelsMapForPopulate(model, docs, populateOptions); + if (modelsMap instanceof MongooseError) { + throw modelsMap; + } + const len = modelsMap.length; + let vals = []; + + function flatten(item) { + // no need to include undefined values in our query + return undefined !== item; + } + + let hasOne = false; + const params = []; + for (let i = 0; i < len; ++i) { + const mod = modelsMap[i]; + let select = mod.options.select; + let ids = utils.array.flatten(mod.ids, flatten); + ids = utils.array.unique(ids); + + const assignmentOpts = {}; + assignmentOpts.sort = mod && + mod.options && + mod.options.options && + mod.options.options.sort || void 0; + assignmentOpts.excludeId = excludeIdReg.test(select) || (select && select._id === 0); + + // Lean transform may delete `_id`, which would cause assignment + // to fail. So delay running lean transform until _after_ + // `_assign()` + if (mod.options && + mod.options.options && + mod.options.options.lean && + mod.options.options.lean.transform) { + mod.options.options._leanTransform = mod.options.options.lean.transform; + mod.options.options.lean = true; + } + + if (ids.length === 0 || ids.every(utils.isNullOrUndefined)) { + // Ensure that we set to 0 or empty array even + // if we don't actually execute a query to make sure there's a value + // and we know this path was populated for future sets. See gh-7731, gh-8230 + _assign(model, [], mod, assignmentOpts); + continue; + } + + hasOne = true; + if (typeof populateOptions.foreignField === 'string') { + mod.foreignField.clear(); + mod.foreignField.add(populateOptions.foreignField); + } + if (assignmentOpts.excludeId) { + // override the exclusion from the query so we can use the _id + // for document matching during assignment. we'll delete the + // _id back off before returning the result. + if (typeof select === 'string') { + select = select.replace(excludeIdRegGlobal, ' '); + } else if (Array.isArray(select)) { + select = select.filter(field => field !== '-_id'); + } else { + // preserve original select conditions by copying + const { _id, ...selectWithoutId } = select; + select = selectWithoutId; + } + } + + if (mod.options.options?.limit != null) { + assignmentOpts.originalLimit = mod.options.options.limit; + } else if (mod.options.limit != null) { + assignmentOpts.originalLimit = mod.options.limit; + } + + // Execute a separate query per document if `perDocumentLimit` is set (gh-7318), or if + // there are so many ids that the `$in` filter may overflow MongoDB's 16 MB BSON size + // limit on queries (gh-5890). + const splitParams = splitPopulateQuery(mod, ids, select, assignmentOpts); + if (splitParams != null) { + params.push(...splitParams); + continue; + } + + const match = createPopulateQueryFilter(ids, mod.match, mod.foreignField, mod.model, mod.options.skipInvalidIds); + params.push([mod, match, select, assignmentOpts]); + } + if (!hasOne) { + // If models but no docs, skip further deep populate. + if (modelsMap.length !== 0) { + return; + } + // If no models and no docs to populate but we have a nested populate, + // probably a case of unnecessarily populating a non-ref path re: gh-8946 + if (populateOptions.populate != null) { + const opts = utils.populate(populateOptions.populate).map(pop => Object.assign({}, pop, { + path: populateOptions.path + '.' + pop.path + })); + return model.populate(docs, opts); + } + return; + } + + // Track deferred populates per-param (per model) to avoid mixing them + const deferredPopulatesPerParam = new Map(); + // Query results per param. Batches that were split off of a large populate query (gh-5890) + // are assigned from only their own query's results rather than the combined `vals`. + const valsByParam = []; + + if (populateOptions.ordered) { + // Populate in series, primarily for transactions because MongoDB doesn't support multiple operations on + // one transaction in parallel. + for (let i = 0; i < params.length; i++) { + const arr = params[i]; + const { docs, deferredPopulates } = await _execPopulateQuery.apply(null, arr); + valsByParam.push(docs); + if (!arr[0]._assignFromOwnResults) { + vals = vals.concat(docs); + } + if (deferredPopulates.length > 0) { + deferredPopulatesPerParam.set(i, deferredPopulates); + } + } + } else { + // By default, populate in parallel + const promises = []; + for (const arr of params) { + promises.push(_execPopulateQuery.apply(null, arr)); + } + + const results = await Promise.all(promises); + for (let i = 0; i < results.length; i++) { + const { docs, deferredPopulates } = results[i]; + valsByParam.push(docs); + if (!params[i][0]._assignFromOwnResults) { + vals = vals.concat(docs); + } + if (deferredPopulates.length > 0) { + deferredPopulatesPerParam.set(i, deferredPopulates); + } + } + } + + + for (let i = 0; i < params.length; i++) { + const arr = params[i]; + const mod = arr[0]; + const assignmentOpts = arr[3]; + const valsForMod = mod._assignFromOwnResults ? valsByParam[i] : vals; + for (const val of valsForMod) { + mod.options._childDocs.push(val); + } + _assign(model, valsForMod, mod, assignmentOpts); + } + + // Handle deferred populate for cases with per-document match functions. + // We defer populate so sift filtering can compare ObjectIds (not populated docs). + // This handles both explicit sub-populate and populate added by pre('find') hooks. + // Each param's deferred populates are tracked separately to avoid mixing them + // between different models (e.g., when using refPath with multiple model types). + if (deferredPopulatesPerParam.size > 0) { + for (let i = 0; i < params.length; i++) { + const arr = params[i]; + const mod = arr[0]; + if (!Array.isArray(mod.match)) { + continue; + } + + const paramDeferredPopulates = deferredPopulatesPerParam.get(i); + if (!paramDeferredPopulates || paramDeferredPopulates.length === 0) { + continue; + } + + // Get the assigned (filtered) children from parent docs + const childDocsToPopulate = []; + for (const doc of mod.docs) { + const childVal = doc.$__ != null ? doc.get(mod.options.path) : doc[mod.options.path]; + if (Array.isArray(childVal)) { + childDocsToPopulate.push(...childVal); + } else if (childVal != null) { + childDocsToPopulate.push(childVal); + } + } + + if (childDocsToPopulate.length > 0) { + for (const pop of paramDeferredPopulates) { + await mod.model.populate(childDocsToPopulate, pop); + } + } + } + } + + for (let i = 0; i < params.length; i++) { + const mod = params[i][0]; + removeDeselectedForeignField(mod.foreignField, mod.options, mod._assignFromOwnResults ? valsByParam[i] : vals); + } + for (let i = 0; i < params.length; i++) { + const mod = params[i][0]; + if (mod.options?.options?._leanTransform) { + const valsForMod = mod._assignFromOwnResults ? valsByParam[i] : vals; + for (const doc of valsForMod) { + mod.options.options._leanTransform(doc); + } + } + } +} + +/*! + * ignore + */ + +function _execPopulateQuery(mod, match, select) { + // `null` match means `mod`'s documents have no ids to query, possible if a large populate + // was split into a query per document (gh-5890). Skip executing a query: `_assign()` still + // sets the documents' populated paths to the appropriate default value. + if (match == null) { + return Promise.resolve({ docs: [], deferredPopulates: [] }); + } + let subPopulate = clone(mod.options.populate); + const queryOptions = {}; + if (mod.options.skip !== undefined) { + queryOptions.skip = mod.options.skip; + } + if (mod.options.limit !== undefined) { + queryOptions.limit = mod.options.limit; + } + if (mod.options.perDocumentLimit !== undefined) { + queryOptions.perDocumentLimit = mod.options.perDocumentLimit; + } + Object.assign(queryOptions, mod.options.options); + + if (mod.count) { + delete queryOptions.skip; + } + + if (queryOptions.perDocumentLimit != null) { + queryOptions.limit = queryOptions.perDocumentLimit; + delete queryOptions.perDocumentLimit; + } else if (queryOptions.limit != null) { + queryOptions.limit = queryOptions.limit * mod.ids.length; + } + + // When there's a per-document match function, defer any populate (including from hooks) + // until after sift filtering, otherwise sift compares ObjectIds against populated docs. + if (Array.isArray(mod.match)) { + queryOptions._deferPopulate = true; + } + + const query = mod.model.find(match, select, queryOptions); + // If we're doing virtual populate and projection is inclusive and foreign + // field is not selected, automatically select it because mongoose needs it. + // If projection is exclusive and client explicitly unselected the foreign + // field, that's the client's fault. + for (const foreignField of mod.foreignField) { + if (foreignField !== '_id' && + query.selectedInclusively() && + !isPathSelectedInclusive(query._fields, foreignField)) { + query.select(foreignField); + } + } + + // If using count, still need the `foreignField` so we can match counts + // to documents, otherwise we would need a separate `count()` for every doc. + if (mod.count) { + for (const foreignField of mod.foreignField) { + query.select(foreignField); + } + } + + // If we need to sub-populate, call populate recursively. + // However, if we have a per-document match function (Array.isArray(mod.match)), + // defer sub-populate until after sift filtering, otherwise sift compares + // ObjectIds against already-populated docs and fails to match. + const shouldDeferSubPopulate = subPopulate && Array.isArray(mod.match); + + // Prepare sub-populate options with necessary metadata (_fullPath, strictPopulate, _localModel). + // This must be done for both immediate and deferred sub-populate cases. + if (subPopulate) { + // If subpopulating on a discriminator, skip check for non-existent + // paths. Because the discriminator may not have the path defined. + if (mod.model.baseModelName != null) { + if (Array.isArray(subPopulate)) { + subPopulate.forEach(pop => { pop.strictPopulate = false; }); + } else if (typeof subPopulate === 'string') { + subPopulate = { path: subPopulate, strictPopulate: false }; + } else { + subPopulate.strictPopulate = false; + } + } + const basePath = mod.options._fullPath || mod.options.path; + + if (Array.isArray(subPopulate)) { + for (const pop of subPopulate) { + pop._fullPath = basePath + '.' + pop.path; + // Set _localModel for deferred populates so strictPopulate works correctly + if (shouldDeferSubPopulate && pop._localModel == null) { + pop._localModel = mod.model; + } + } + } else if (typeof subPopulate === 'object') { + subPopulate._fullPath = basePath + '.' + subPopulate.path; + // Set _localModel for deferred populates so strictPopulate works correctly + if (shouldDeferSubPopulate && subPopulate._localModel == null) { + subPopulate._localModel = mod.model; + } + } + } + + if (subPopulate && !shouldDeferSubPopulate) { + query.populate(subPopulate); + } + + return query.exec().then( + docs => { + for (const val of docs) { + leanPopulateMap.set(val, mod.model); + } + // Return both docs and any deferred populates (from hooks or explicit sub-populate) + const deferredPopulates = []; + if (query._deferredPopulate) { + deferredPopulates.push(...query._deferredPopulate); + delete query._deferredPopulate; + } + if (shouldDeferSubPopulate) { + deferredPopulates.push(subPopulate); + } + return { docs, deferredPopulates }; + } + ); +} + +/*! + * ignore + */ + +function _assign(model, vals, mod, assignmentOpts) { + const options = mod.options; + const isVirtual = mod.isVirtual; + const justOne = mod.justOne; + let _val; + const lean = options && + options.options && + options.options.lean || false; + const len = vals.length; + const rawOrder = {}; + const rawDocs = {}; + let key; + let val; + + // Clone because `assignRawDocsToIdStructure` will mutate the array + const allIds = clone(mod.allIds); + // optimization: + // record the document positions as returned by + // the query result. + for (let i = 0; i < len; i++) { + val = vals[i]; + if (val == null) { + continue; + } + for (const foreignField of mod.foreignField) { + _val = utils.getValue(foreignField, val); + if (Array.isArray(_val)) { + _val = utils.array.unique(utils.array.flatten(_val)); + + for (let __val of _val) { + if (__val instanceof Document) { + __val = __val._doc._id; + } + key = String(__val); + if (rawDocs[key]) { + if (Array.isArray(rawDocs[key])) { + rawDocs[key].push(val); + rawOrder[key].push(i); + } else { + rawDocs[key] = [rawDocs[key], val]; + rawOrder[key] = [rawOrder[key], i]; + } + } else { + if (isVirtual && !justOne) { + rawDocs[key] = [val]; + rawOrder[key] = [i]; + } else { + rawDocs[key] = val; + rawOrder[key] = i; + } + } + } + } else { + if (_val instanceof Document) { + _val = _val._doc._id; + } + key = String(_val); + if (rawDocs[key]) { + if (Array.isArray(rawDocs[key])) { + rawDocs[key].push(val); + rawOrder[key].push(i); + } else if (isVirtual || + rawDocs[key].constructor !== val.constructor || + (rawDocs[key] instanceof Document ? String(rawDocs[key]._doc._id) : String(rawDocs[key]._id)) !== (val instanceof Document ? String(val._doc._id) : String(val._id))) { + // May need to store multiple docs with the same id if there's multiple models + // if we have discriminators or a ref function. But avoid converting to an array + // if we have multiple queries on the same model because of `perDocumentLimit` re: gh-9906 + rawDocs[key] = [rawDocs[key], val]; + rawOrder[key] = [rawOrder[key], i]; + } + } else { + rawDocs[key] = val; + rawOrder[key] = i; + } + } + // flag each as result of population + if (!lean) { + val.$__.wasPopulated = val.$__.wasPopulated || { value: _val }; + } + } + } + + assignVals({ + originalModel: model, + // If virtual, make sure to not mutate original field + rawIds: mod.isVirtual ? allIds : mod.allIds, + allIds: allIds, + unpopulatedValues: mod.unpopulatedValues, + foreignField: mod.foreignField, + rawDocs: rawDocs, + rawOrder: rawOrder, + docs: mod.docs, + path: options.path, + options: assignmentOpts, + justOne: mod.justOne, + isVirtual: mod.isVirtual, + allOptions: mod, + populatedModel: mod.model, + lean: lean, + virtual: mod.virtual, + count: mod.count, + match: mod.match + }); +} + +/** + * Compiler utility. + * + * @param {string|Function} name model name or class extending Model + * @param {Schema} schema + * @param {string} collectionName + * @param {Connection} connection + * @param {Mongoose} base mongoose instance + * @api private + */ + +Model.compile = function compile(name, schema, collectionName, connection, base) { + const versioningEnabled = schema.options.versionKey !== false; + + if (versioningEnabled && !schema.paths[schema.options.versionKey]) { + // add versioning to top level documents only + const o = {}; + o[schema.options.versionKey] = Number; + schema.add(o); + } + let model; + if (typeof name === 'function' && name.prototype instanceof Model) { + model = name; + name = model.name; + schema.loadClass(model, false); + model.prototype.$isMongooseModelPrototype = true; + } else { + // generate new class + model = function model(doc, fields, skipId) { + model.hooks.execPreSync('createModel', doc); + if (!(this instanceof model)) { + return new model(doc, fields, skipId); + } + const discriminatorKey = model.schema.options.discriminatorKey; + + if (model.discriminators == null || doc == null || doc[discriminatorKey] == null) { + Model.call(this, doc, fields, skipId); + return; + } + + // If discriminator key is set, use the discriminator instead (gh-7586) + const Discriminator = model.discriminators[doc[discriminatorKey]] || + getDiscriminatorByValue(model.discriminators, doc[discriminatorKey]); + if (Discriminator != null) { + return new Discriminator(doc, fields, skipId); + } + + // Otherwise, just use the top-level model + Model.call(this, doc, fields, skipId); + }; + } + + model.hooks = schema.s.hooks.clone(); + model.base = base; + model.modelName = name; + + if (!(model.prototype instanceof Model)) { + Object.setPrototypeOf(model, Model); + Object.setPrototypeOf(model.prototype, Model.prototype); + } + model.model = function model(name) { + return this.db.model(name); + }; + + model.db = connection; + model.prototype.db = connection; + model.prototype[modelDbSymbol] = connection; + model.discriminators = model.prototype.discriminators = undefined; + model[modelSymbol] = true; + model.events = new EventEmitter(); + + schema._preCompile(); + const _userProvidedOptions = schema._userProvidedOptions || {}; + + const collectionOptions = { + schemaUserProvidedOptions: _userProvidedOptions, + capped: schema.options.capped, + Promise: model.base.Promise, + modelName: name + }; + if (schema.options.autoCreate !== void 0) { + collectionOptions.autoCreate = schema.options.autoCreate; + } + + const collection = connection.collection( + collectionName, + collectionOptions + ); + + model.prototype.collection = collection; + model.prototype.$collection = collection; + model.prototype[modelCollectionSymbol] = collection; + + model.prototype.$__setSchema(schema); + + // apply methods and statics + applyMethods(model, schema); + applyStatics(model, schema); + applyHooks(model, schema); + applyStaticHooks(model, schema.s.hooks, schema.statics); + + model.schema = model.prototype.$__schema; + model.collection = collection; + model.$__collection = collection; + + // Create custom query constructor + model.Query = function() { + Query.apply(this, arguments); + }; + Object.setPrototypeOf(model.Query.prototype, Query.prototype); + model.Query.base = Query.base; + model.Query.prototype.constructor = Query; + model._applyQueryMiddleware(); + applyQueryMethods(model, schema.query); + + return model; +}; + +/** + * If auto encryption is enabled, returns a ClientEncryption instance that is configured with the same settings that + * Mongoose's underlying MongoClient is using. If the client has not yet been configured, returns null. + * + * @returns {ClientEncryption | null} + */ +Model.clientEncryption = function clientEncryption() { + const ClientEncryption = this.base.driver.get().ClientEncryption; + if (!ClientEncryption) { + throw new MongooseError('The mongodb driver must be used to obtain a ClientEncryption object.'); + } + + const client = this.collection?.conn?.client; + + if (!client) return null; + + const autoEncryptionOptions = client.options.autoEncryption; + + if (!autoEncryptionOptions) return null; + + const { + keyVaultNamespace, + keyVaultClient, + kmsProviders, + credentialProviders, + proxyOptions, + tlsOptions + } = autoEncryptionOptions; + return new ClientEncryption(keyVaultClient ?? client, + { keyVaultNamespace, kmsProviders, credentialProviders, proxyOptions, tlsOptions } + ); +}; + +/** + * Update this model to use the new connection, including updating all internal + * references and creating a new `Collection` instance using the new connection. + * Not for external use, only used by `setDriver()` to ensure that you can still + * call `setDriver()` after creating a model using `mongoose.model()`. + * + * @param {Connection} newConnection the new connection to use + * @api private + */ + +Model.$__updateConnection = function $__updateConnection(newConnection) { + this.db = newConnection; + this.prototype.db = newConnection; + this.prototype[modelDbSymbol] = newConnection; + + const collection = newConnection.collection( + this.collection.collectionName, + this.collection.opts + ); + + this.prototype.collection = collection; + this.prototype.$collection = collection; + this.prototype[modelCollectionSymbol] = collection; + + this.collection = collection; + this.$__collection = collection; +}; + +/** + * Register custom query methods for this model + * + * @param {Model} model + * @param {Schema} schema + * @api private + */ + +function applyQueryMethods(model, methods) { + for (const i in methods) { + model.Query.prototype[i] = methods[i]; + } +} + +/** + * Subclass this model with `conn`, `schema`, and `collection` settings. + * + * @param {Connection} conn + * @param {Schema} [schema] + * @param {string} [collection] + * @return {Model} + * @api private + * @memberOf Model + * @static + * @method __subclass + */ + +Model.__subclass = function subclass(conn, schema, collection) { + // subclass model using this connection and collection name + const _this = this; + + const Model = function Model(doc, fields, skipId) { + if (!(this instanceof Model)) { + return new Model(doc, fields, skipId); + } + _this.call(this, doc, fields, skipId); + }; + + Object.setPrototypeOf(Model, _this); + Object.setPrototypeOf(Model.prototype, _this.prototype); + Model.db = conn; + Model.prototype.db = conn; + Model.prototype[modelDbSymbol] = conn; + + _this[subclassedSymbol] = _this[subclassedSymbol] || []; + _this[subclassedSymbol].push(Model); + if (_this.discriminators != null) { + Model.discriminators = {}; + for (const key of Object.keys(_this.discriminators)) { + Model.discriminators[key] = _this.discriminators[key]. + __subclass(_this.db, _this.discriminators[key].schema, collection); + } + } + + const s = schema && typeof schema !== 'string' + ? schema + : _this.prototype.$__schema; + + const options = s.options || {}; + const _userProvidedOptions = s._userProvidedOptions || {}; + + if (!collection) { + collection = _this.prototype.$__schema.get('collection') || + utils.toCollectionName(_this.modelName, this.base.pluralize()); + } + + const collectionOptions = { + schemaUserProvidedOptions: _userProvidedOptions, + capped: s && options.capped + }; + + Model.prototype.collection = conn.collection(collection, collectionOptions); + Model.prototype.$collection = Model.prototype.collection; + Model.prototype[modelCollectionSymbol] = Model.prototype.collection; + Model.collection = Model.prototype.collection; + Model.$__collection = Model.collection; + // Errors handled internally, so ignore + Model.init().catch(() => {}); + return Model; +}; + +/** + * Apply changes made to this model's schema after this model was compiled. + * By default, adding virtuals and other properties to a schema after the model is compiled does nothing. + * Call this function to apply virtuals and properties that were added later. + * + * #### Example: + * + * const schema = new mongoose.Schema({ field: String }); + * const TestModel = mongoose.model('Test', schema); + * TestModel.schema.virtual('myVirtual').get(function() { + * return this.field + ' from myVirtual'; + * }); + * const doc = new TestModel({ field: 'Hello' }); + * doc.myVirtual; // undefined + * + * TestModel.recompileSchema(); + * doc.myVirtual; // 'Hello from myVirtual' + * + * @return {undefined} + * @api public + * @memberOf Model + * @static + * @method recompileSchema + */ + +Model.recompileSchema = function recompileSchema() { + this.prototype.$__setSchema(this.schema); + + if (this.schema._applyDiscriminators != null) { + for (const disc of this.schema._applyDiscriminators.keys()) { + this.discriminator(disc, this.schema._applyDiscriminators.get(disc)); + } + } + + delete this.schema._defaultToObjectOptionsMap; + + applyEmbeddedDiscriminators(this.schema, new WeakSet(), true); +}; + +/** + * Helper for console.log. Given a model named 'MyModel', returns the string + * `'Model { MyModel }'`. + * + * #### Example: + * + * const MyModel = mongoose.model('Test', Schema({ name: String })); + * MyModel.inspect(); // 'Model { Test }' + * console.log(MyModel); // Prints 'Model { Test }' + * + * @api public + */ + +Model.inspect = function() { + return `Model { ${this.modelName} }`; +}; + +/** + * Return the MongoDB namespace for this model as a string. The namespace is the database name, followed by '.', followed by the collection name. + * + * #### Example: + * + * const conn = mongoose.createConnection('mongodb://127.0.0.1:27017/mydb'); + * const TestModel = conn.model('Test', mongoose.Schema({ name: String })); + * + * TestModel.namespace(); // 'mydb.tests' + * + * @api public + */ + +Model.namespace = function namespace() { + return this.db.name + '.' + this.collection.collectionName; +}; + +if (util.inspect.custom) { + // Avoid Node deprecation warning DEP0079 + Model[util.inspect.custom] = Model.inspect; +} + +/*! + * Applies query middleware from this model's schema to this model's + * Query constructor. + */ + +Model._applyQueryMiddleware = function _applyQueryMiddleware() { + const Query = this.Query; + const queryMiddleware = this.schema.s.hooks.filter(hook => { + const contexts = _getContexts(hook); + if (hook.name === 'validate') { + return !!contexts.query; + } + if (hook.name === 'deleteOne' || hook.name === 'updateOne') { + return !!contexts.query || utils.hasOwnKeys(contexts) === false; + } + if (hook.query != null || hook.document != null) { + return !!hook.query; + } + return true; + }); + + Query.prototype._queryMiddleware = queryMiddleware; +}; + +function _getContexts(hook) { + const ret = {}; + if (Object.hasOwn(hook, 'query')) { + ret.query = hook.query; + } + if (Object.hasOwn(hook, 'document')) { + ret.document = hook.document; + } + return ret; +} + +/*! + * Module exports. + */ + +module.exports = exports = Model; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/modifiedPathsSnapshot.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/modifiedPathsSnapshot.js new file mode 100644 index 00000000..54d6b30d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/modifiedPathsSnapshot.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = class ModifiedPathsSnapshot { + constructor(subdocSnapshot, activePaths, version) { + this.subdocSnapshot = subdocSnapshot; + this.activePaths = activePaths; + this.version = version; + } +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/mongoose.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/mongoose.js new file mode 100644 index 00000000..833e35fb --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/mongoose.js @@ -0,0 +1,1435 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const Document = require('./document'); +const EventEmitter = require('events').EventEmitter; +const Kareem = require('kareem'); +const Schema = require('./schema'); +const SchemaType = require('./schemaType'); +const SchemaTypes = require('./schema/index'); +const VirtualType = require('./virtualType'); +const STATES = require('./connectionState'); +const VALID_OPTIONS = require('./validOptions'); +const Types = require('./types'); +const Query = require('./query'); +const Model = require('./model'); +const applyPlugins = require('./helpers/schema/applyPlugins'); +const builtinPlugins = require('./plugins'); +const driver = require('./driver'); +const legacyPluralize = require('./helpers/pluralize'); +const utils = require('./utils'); +const pkg = require('../package.json'); +const cast = require('./cast'); + +const Aggregate = require('./aggregate'); +const trusted = require('./helpers/query/trusted').trusted; +const sanitizeFilter = require('./helpers/query/sanitizeFilter'); +const isBsonType = require('./helpers/isBsonType'); +const MongooseError = require('./error/mongooseError'); +const SetOptionError = require('./error/setOptionError'); +const applyEmbeddedDiscriminators = require('./helpers/discriminator/applyEmbeddedDiscriminators'); + +const defaultMongooseSymbol = Symbol.for('mongoose:default'); +const defaultConnectionSymbol = Symbol('mongoose:defaultConnection'); + +require('./helpers/printJestWarning'); + +const objectIdHexRegexp = /^[0-9A-Fa-f]{24}$/; + +const { AsyncLocalStorage } = require('async_hooks'); + +/** + * Mongoose constructor. + * + * The exports object of the `mongoose` module is an instance of this class. + * Most apps will only use this one instance. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * mongoose instanceof mongoose.Mongoose; // true + * + * // Create a new Mongoose instance with its own `connect()`, `set()`, `model()`, etc. + * const m = new mongoose.Mongoose(); + * + * @api public + * @param {object} options see [`Mongoose#set()` docs](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.set()) + */ +function Mongoose(options) { + this.connections = []; + this.nextConnectionId = 0; + this.models = {}; + this.events = new EventEmitter(); + this.__driver = driver.get(); + // default global options + this.options = Object.assign({ + pluralization: true, + autoIndex: true, + autoCreate: true, + autoSearchIndex: false + }, options); + const createInitialConnection = utils.getOption('createInitialConnection', this.options) ?? true; + if (createInitialConnection && this.__driver != null) { + _createDefaultConnection(this); + } + + if (this.options.pluralization) { + this._pluralize = legacyPluralize; + } + + // If a user creates their own Mongoose instance, give them a separate copy + // of the `Schema` constructor so they get separate custom types. (gh-6933) + if (!options?.[defaultMongooseSymbol]) { + const _this = this; + this.Schema = function() { + this.base = _this; + return Schema.apply(this, arguments); + }; + this.Schema.prototype = Object.create(Schema.prototype); + + Object.assign(this.Schema, Schema); + this.Schema.base = this; + this.Schema.Types = Object.assign({}, Schema.Types); + } else { + // Hack to work around babel's strange behavior with + // `import mongoose, { Schema } from 'mongoose'`. Because `Schema` is not + // an own property of a Mongoose global, Schema will be undefined. See gh-5648 + for (const key of ['Schema', 'model']) { + this[key] = Mongoose.prototype[key]; + } + } + this.Schema.prototype.base = this; + + if (options?.transactionAsyncLocalStorage) { + this.transactionAsyncLocalStorage = new AsyncLocalStorage(); + } + + Object.defineProperty(this, 'plugins', { + configurable: false, + enumerable: true, + writable: false, + value: Object.values(builtinPlugins).map(plugin => ([plugin, { deduplicate: true }])) + }); +} + +Mongoose.prototype.cast = cast; +/** + * Expose connection states for user-land + * + * @memberOf Mongoose + * @property STATES + * @api public + */ +Mongoose.prototype.STATES = STATES; + +/** + * Expose connection states for user-land + * + * @memberOf Mongoose + * @property ConnectionStates + * @api public + */ +Mongoose.prototype.ConnectionStates = STATES; + +/** + * Object with `get()` and `set()` containing the underlying driver this Mongoose instance + * uses to communicate with the database. A driver is a Mongoose-specific interface that defines functions + * like `find()`. + * + * @deprecated + * @memberOf Mongoose + * @property driver + * @api public + */ + +Mongoose.prototype.driver = driver; + +/** + * Overwrites the current driver used by this Mongoose instance. A driver is a + * Mongoose-specific interface that defines functions like `find()`. + * + * @memberOf Mongoose + * @method setDriver + * @api public + */ + +Mongoose.prototype.setDriver = function setDriver(driver) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (_mongoose.__driver === driver) { + return _mongoose; + } + + const openConnection = _mongoose.connections && _mongoose.connections.find(conn => conn.readyState !== STATES.disconnected); + if (openConnection) { + const msg = 'Cannot modify Mongoose driver if a connection is already open. ' + + 'Call `mongoose.disconnect()` before modifying the driver'; + throw new MongooseError(msg); + } + _mongoose.__driver = driver; + + if (Array.isArray(driver.plugins)) { + for (const plugin of driver.plugins) { + if (typeof plugin === 'function') { + _mongoose.plugin(plugin); + } + } + } + + if (driver.SchemaTypes != null) { + Object.assign(mongoose.Schema.Types, driver.SchemaTypes); + } + + const Connection = driver.Connection; + const oldDefaultConnection = _mongoose.connections[0]; + _mongoose.connections = [new Connection(_mongoose)]; + _mongoose.connections[0].models = _mongoose.models; + if (oldDefaultConnection == null) { + return _mongoose; + } + + // Update all models that pointed to the old default connection to + // the new default connection, including collections + for (const model of Object.values(_mongoose.models)) { + if (model.db !== oldDefaultConnection) { + continue; + } + model.$__updateConnection(_mongoose.connections[0]); + } + + return _mongoose; +}; + +/** + * Sets mongoose options + * + * `key` can be used as an object to set multiple options at once. + * If an error gets thrown for one option, other options will still be evaluated. + * + * #### Example: + * + * mongoose.set('test', value) // sets the 'test' option to `value` + * + * mongoose.set('debug', true) // enable logging collection methods + arguments to the console/file + * + * mongoose.set('debug', function(collectionName, methodName, ...methodArgs) {}); // use custom function to log collection methods + arguments + * + * mongoose.set({ debug: true, autoIndex: false }); // set multiple options at once + * + * Currently supported options are: + * - `allowDiskUse`: Set to `true` to set `allowDiskUse` to true to all aggregation operations by default. + * - `applyPluginsToChildSchemas`: `true` by default. Set to false to skip applying global plugins to child schemas + * - `applyPluginsToDiscriminators`: `false` by default. Set to true to apply global plugins to discriminator schemas. This typically isn't necessary because plugins are applied to the base schema and discriminators copy all middleware, methods, statics, and properties from the base schema. + * - `autoCreate`: Set to `true` to make Mongoose call [`Model.createCollection()`](https://mongoosejs.com/docs/api/model.html#Model.createCollection()) automatically when you create a model with `mongoose.model()` or `conn.model()`. This is useful for testing transactions, change streams, and other features that require the collection to exist. + * - `autoIndex`: `true` by default. Set to false to disable automatic index creation for all models associated with this Mongoose instance. + * - `bufferCommands`: enable/disable mongoose's buffering mechanism for all connections and models + * - `bufferTimeoutMS`: If bufferCommands is on, this option sets the maximum amount of time Mongoose buffering will wait before throwing an error. If not specified, Mongoose will use 10000 (10 seconds). + * - `cloneSchemas`: `false` by default. Set to `true` to `clone()` all schemas before compiling into a model. + * - `debug`: If `true`, prints the operations mongoose sends to MongoDB to the console. If an object is passed, you can set `color`, `shell`, and `timestamp` options. If `timestamp` is `true`, Mongoose prefixes console debug output with an ISO timestamp in brackets. If a writable stream is passed, it will log to that stream, without colorization. If a callback function is passed, it will receive the collection name, the method name, then all arguments passed to the method. For example, if you wanted to replicate the default logging, you could output from the callback `Mongoose: ${collectionName}.${methodName}(${methodArgs.join(', ')})`. + * - `id`: If `true`, adds a `id` virtual to all schemas unless overwritten on a per-schema basis. + * - `maxTimeMS`: If set, attaches [maxTimeMS](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) to every query + * - `objectIdGetter`: `true` by default. Mongoose adds a getter to MongoDB ObjectId's called `_id` that returns `this` for convenience with populate. Set this to false to remove the getter. + * - `overwriteModels`: Set to `true` to default to overwriting models with the same name when calling `mongoose.model()`, as opposed to throwing an `OverwriteModelError`. + * - `returnDocument`: Set to `'before'` or `'after'` to set the default value for the `returnDocument` option to `findOneAndUpdate()`, `findByIdAndUpdate()`, and `findOneAndReplace()`. Defaults to `'before'`, which returns the document before the update was applied. Read our [`findOneAndUpdate()` tutorial](https://mongoosejs.com/docs/tutorials/findoneandupdate.html) for more information. + * - `returnOriginal`: **Deprecated.** Use `returnDocument` instead. If `false`, changes the default `returnOriginal` option to `findOneAndUpdate()`, `findByIdAndUpdate`, and `findOneAndReplace()` to false. This is equivalent to setting the `new` option to `true` for `findOneAndX()` calls by default. Read our [`findOneAndUpdate()` tutorial](https://mongoosejs.com/docs/tutorials/findoneandupdate.html) for more information. + * - `runValidators`: `false` by default. Set to true to enable [update validators](https://mongoosejs.com/docs/validation.html#update-validators) for all validators by default. + * - `sanitizeFilter`: `false` by default. Set to true to enable the [sanitization of the query filters](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.sanitizeFilter()) against query selector injection attacks by wrapping any nested objects that have a property whose name starts with `$` in a `$eq`. + * - `selectPopulatedPaths`: `true` by default. Set to false to opt out of Mongoose adding all fields that you `populate()` to your `select()`. The schema-level option `selectPopulatedPaths` overwrites this one. + * - `strictQuery`: `false` by default. May be `false`, `true`, or `'throw'`. Sets the default [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery) mode for schemas. + * - `strict`: `true` by default, may be `false`, `true`, or `'throw'`. Sets the default strict mode for schemas. + * - `timestamps.createdAt.immutable`: `true` by default. If `false`, it will change the `createdAt` field to be [`immutable: false`](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.immutable) which means you can update the `createdAt` + * - `toJSON`: `{ transform: true, flattenDecimals: true }` by default. Overwrites default objects to [`toJSON()`](https://mongoosejs.com/docs/api/document.html#Document.prototype.toJSON()), for determining how Mongoose documents get serialized by `JSON.stringify()` + * - `toObject`: `{ transform: true, flattenDecimals: true }` by default. Overwrites default objects to [`toObject()`](https://mongoosejs.com/docs/api/document.html#Document.prototype.toObject()) + * - `transactionAsyncLocalStorage`: `false` by default. If `true`, Mongoose will automatically pass the `session` to any operation executing within a transaction executor function. See [transaction AsyncLocalStorage documentation](https://mongoosejs.com/docs/transactions.html#asynclocalstorage) + * - `translateAliases`: `false` by default. If `true`, Mongoose will automatically translate aliases to their original paths before sending the query to MongoDB. + * - `updatePipeline`: `false` by default. If `true`, allows passing update pipelines (arrays) to update operations by default without explicitly setting `updatePipeline: true` in each query. + * + * @param {string|object} key The name of the option or an object of multiple key-value pairs + * @param {string|Function|boolean} value The value of the option, unused if "key" is an object + * @returns {Mongoose} The used Mongoose instance + * @api public + */ + +Mongoose.prototype.set = function getsetOptions(key, value) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (key == null) { + const error = new SetOptionError(); + error.addError(String(key), new SetOptionError.SetOptionInnerError(String(key))); + throw error; + } + + if (arguments.length === 1 && typeof key !== 'object') { + if (VALID_OPTIONS.indexOf(key) === -1) { + const error = new SetOptionError(); + error.addError(key, new SetOptionError.SetOptionInnerError(key)); + throw error; + } + + return _mongoose.options[key]; + } + + let options = {}; + + if (arguments.length === 2) { + options = { [key]: value }; + } + + if (arguments.length === 1 && typeof key === 'object') { + options = key; + } + + // array for errors to collect all errors for all key-value pairs, like ".validate" + let error = undefined; + + for (const [optionKey, optionValue] of Object.entries(options)) { + if (VALID_OPTIONS.indexOf(optionKey) === -1) { + if (!error) { + error = new SetOptionError(); + } + error.addError(optionKey, new SetOptionError.SetOptionInnerError(optionKey)); + continue; + } + + _mongoose.options[optionKey] = optionValue; + + if (optionKey === 'objectIdGetter') { + if (optionValue) { + Object.defineProperty(_mongoose.Types.ObjectId.prototype, '_id', { + enumerable: false, + configurable: true, + get: function() { + return this; + } + }); + } else { + delete _mongoose.Types.ObjectId.prototype._id; + } + } else if (optionKey === 'transactionAsyncLocalStorage') { + if (optionValue && !_mongoose.transactionAsyncLocalStorage) { + _mongoose.transactionAsyncLocalStorage = new AsyncLocalStorage(); + } else if (!optionValue && _mongoose.transactionAsyncLocalStorage) { + delete _mongoose.transactionAsyncLocalStorage; + } + } else if (optionKey === 'createInitialConnection') { + if (optionValue && !_mongoose.connection) { + _createDefaultConnection(_mongoose); + } else if (optionValue === false && _mongoose.connection?.[defaultConnectionSymbol]) { + if (_mongoose.connection.readyState === STATES.disconnected && utils.hasOwnKeys(_mongoose.connection.models) === false) { + _mongoose.connections.shift(); + } + } + } else if (optionKey === 'returnOriginal') { + if (_mongoose.options.returnDocument != null) { + throw new MongooseError( + 'Cannot set `returnOriginal` when `returnDocument` is already set. Use `returnDocument` instead.' + ); + } + const replacement = optionValue === true ? '\'before\'' : '\'after\''; + utils.warn( + 'Mongoose: the `returnOriginal` option for `mongoose.set()` is deprecated. ' + + 'Use `mongoose.set(\'returnDocument\', ' + replacement + ')` instead.' + ); + } else if (optionKey === 'returnDocument') { + if (_mongoose.options.returnOriginal != null) { + throw new MongooseError( + 'Cannot set `returnDocument` when `returnOriginal` is already set. Use `returnDocument` instead of `returnOriginal`.' + ); + } + } + } + + if (error) { + throw error; + } + + return _mongoose; +}; + +/** + * Gets mongoose options + * + * #### Example: + * + * mongoose.get('test') // returns the 'test' value + * + * @param {string} key + * @method get + * @api public + */ + +Mongoose.prototype.get = Mongoose.prototype.set; + +/** + * Creates a Connection instance. + * + * Each `connection` instance maps to a single database. This method is helpful when managing multiple db connections. + * + * + * _Options passed take precedence over options included in connection strings._ + * + * #### Example: + * + * // with mongodb:// URI + * db = mongoose.createConnection('mongodb://user:pass@127.0.0.1:port/database'); + * + * // and options + * const opts = { db: { native_parser: true }} + * db = mongoose.createConnection('mongodb://user:pass@127.0.0.1:port/database', opts); + * + * // replica sets + * db = mongoose.createConnection('mongodb://user:pass@127.0.0.1:port,anotherhost:port,yetanother:port/database'); + * + * // and options + * const opts = { replset: { strategy: 'ping', rs_name: 'testSet' }} + * db = mongoose.createConnection('mongodb://user:pass@127.0.0.1:port,anotherhost:port,yetanother:port/database', opts); + * + * // initialize now, connect later + * db = mongoose.createConnection(); + * await db.openUri('mongodb://127.0.0.1:27017/database'); + * + * @param {string} uri mongodb URI to connect to + * @param {object} [options] passed down to the [MongoDB driver's `connect()` function](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/MongoClientOptions.html), except for 4 mongoose-specific options explained below. + * @param {boolean} [options.bufferCommands=true] Mongoose specific option. Set to false to [disable buffering](https://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. + * @param {string} [options.dbName] The name of the database you want to use. If not provided, Mongoose uses the database name from connection string. + * @param {string} [options.user] username for authentication, equivalent to `options.auth.username`. Maintained for backwards compatibility. + * @param {string} [options.pass] password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. + * @param {boolean} [options.autoIndex=true] Mongoose-specific option. Set to false to disable automatic index creation for all models associated with this connection. + * @param {number} [options.maxPoolSize=100] The maximum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {number} [options.minPoolSize=0] The minimum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {number} [options.socketTimeoutMS=0] How long the MongoDB driver will wait before killing a socket due to inactivity _after initial connection_. Defaults to 0, which means Node.js will not time out the socket due to inactivity. A socket may be inactive because of either no activity or a long-running operation. This option is passed to [Node.js `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) after the MongoDB driver successfully completes. + * @param {number} [options.family=0] Passed transparently to [Node.js' `dns.lookup()`](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback) function. May be either `0`, `4`, or `6`. `4` means use IPv4 only, `6` means use IPv6 only, `0` means try both. + * @return {Connection} the created Connection object. Connections are not thenable, so you can't do `await mongoose.createConnection()`. To await use `mongoose.createConnection(uri).asPromise()` instead. + * @api public + */ + +Mongoose.prototype.createConnection = function createConnection(uri, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + const Connection = _mongoose.__driver.Connection; + const conn = new Connection(_mongoose); + _mongoose.connections.push(conn); + _mongoose.nextConnectionId++; + _mongoose.events.emit('createConnection', conn); + + if (arguments.length > 0) { + conn.openUri(uri, { ...options, _fireAndForget: true }); + } + + return conn; +}; + +/** + * Opens the default mongoose connection. + * + * #### Example: + * + * mongoose.connect('mongodb://user:pass@127.0.0.1:port/database'); + * + * // replica sets + * const uri = 'mongodb://user:pass@127.0.0.1:port,anotherhost:port,yetanother:port/mydatabase'; + * mongoose.connect(uri); + * + * // with options + * mongoose.connect(uri, options); + * + * // Using `await` throws "MongooseServerSelectionError: Server selection timed out after 30000 ms" + * // if Mongoose can't connect. + * const uri = 'mongodb://nonexistent.domain:27000'; + * await mongoose.connect(uri); + * + * @param {string} uri mongodb URI to connect to + * @param {object} [options] passed down to the [MongoDB driver's `connect()` function](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/MongoClientOptions.html), except for 4 mongoose-specific options explained below. + * @param {boolean} [options.bufferCommands=true] Mongoose specific option. Set to false to [disable buffering](https://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. + * @param {number} [options.bufferTimeoutMS=10000] Mongoose specific option. If `bufferCommands` is true, Mongoose will throw an error after `bufferTimeoutMS` if the operation is still buffered. + * @param {string} [options.dbName] The name of the database we want to use. If not provided, use database name from connection string. + * @param {string} [options.user] username for authentication, equivalent to `options.auth.username`. Maintained for backwards compatibility. + * @param {string} [options.pass] password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. + * @param {number} [options.maxPoolSize=100] The maximum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {number} [options.minPoolSize=0] The minimum number of sockets the MongoDB driver will keep open for this connection. + * @param {number} [options.serverSelectionTimeoutMS] If `useUnifiedTopology = true`, the MongoDB driver will try to find a server to send any given operation to, and keep retrying for `serverSelectionTimeoutMS` milliseconds before erroring out. If not set, the MongoDB driver defaults to using `30000` (30 seconds). + * @param {number} [options.heartbeatFrequencyMS] If `useUnifiedTopology = true`, the MongoDB driver sends a heartbeat every `heartbeatFrequencyMS` to check on the status of the connection. A heartbeat is subject to `serverSelectionTimeoutMS`, so the MongoDB driver will retry failed heartbeats for up to 30 seconds by default. Mongoose only emits a `'disconnected'` event after a heartbeat has failed, so you may want to decrease this setting to reduce the time between when your server goes down and when Mongoose emits `'disconnected'`. We recommend you do **not** set this setting below 1000, too many heartbeats can lead to performance degradation. + * @param {boolean} [options.autoIndex=true] Mongoose-specific option. Set to false to disable automatic index creation for all models associated with this connection. + * @param {number} [options.socketTimeoutMS=0] How long the MongoDB driver will wait before killing a socket due to inactivity _after initial connection_. A socket may be inactive because of either no activity or a long-running operation. `socketTimeoutMS` defaults to 0, which means Node.js will not time out the socket due to inactivity. This option is passed to [Node.js `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) after the MongoDB driver successfully completes. + * @param {number} [options.family=0] Passed transparently to [Node.js' `dns.lookup()`](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback) function. May be either `0`, `4`, or `6`. `4` means use IPv4 only, `6` means use IPv6 only, `0` means try both. + * @param {boolean} [options.autoCreate=false] Set to `true` to make Mongoose automatically call `createCollection()` on every model created on this connection. + * @see Mongoose#createConnection https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.createConnection() + * @api public + * @return {Promise} resolves to `this` if connection succeeded + */ + +Mongoose.prototype.connect = async function connect(uri, options) { + if (typeof options === 'function' || (arguments.length >= 3 && typeof arguments[2] === 'function')) { + throw new MongooseError('Mongoose.prototype.connect() no longer accepts a callback'); + } + + const _mongoose = this instanceof Mongoose ? this : mongoose; + if (_mongoose.connection == null) { + _createDefaultConnection(_mongoose); + } + const conn = _mongoose.connection; + + return conn.openUri(uri, options).then(() => _mongoose); +}; + +/** + * Runs `.close()` on all connections in parallel. + * + * @return {Promise} resolves when all connections are closed, or rejects with the first error that occurred. + * @api public + */ + +Mongoose.prototype.disconnect = async function disconnect() { + if (arguments.length >= 1 && typeof arguments[0] === 'function') { + throw new MongooseError('Mongoose.prototype.disconnect() no longer accepts a callback'); + } + + const _mongoose = this instanceof Mongoose ? this : mongoose; + + const remaining = _mongoose.connections.length; + if (remaining <= 0) { + return; + } + await Promise.all(_mongoose.connections.map(conn => conn.close())); +}; + +/** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://www.mongodb.com/docs/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://www.mongodb.com/docs/manual/core/retryable-writes/), + * and [transactions](https://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + * + * Calling `mongoose.startSession()` is equivalent to calling `mongoose.connection.startSession()`. + * Sessions are scoped to a connection, so calling `mongoose.startSession()` + * starts a session on the [default mongoose connection](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.connection). + * + * @param {object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html#startSession) + * @param {boolean} [options.causalConsistency=true] set to false to disable causal consistency + * @return {Promise} promise that resolves to a MongoDB driver `ClientSession` + * @api public + */ + +Mongoose.prototype.startSession = function startSession() { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + return _mongoose.connection.startSession.apply(_mongoose.connection, arguments); +}; + +/** + * Getter/setter around function for pluralizing collection names. + * + * @param {Function|null} [fn] overwrites the function used to pluralize collection names + * @return {Function|null} the current function used to pluralize collection names, defaults to the legacy function from `mongoose-legacy-pluralize`. + * @api public + */ + +Mongoose.prototype.pluralize = function pluralize(fn) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (arguments.length > 0) { + _mongoose._pluralize = fn; + } + return _mongoose._pluralize; +}; + +/** + * Defines a model or retrieves it. + * + * Models defined on the `mongoose` instance are available to all connection + * created by the same `mongoose` instance. + * + * If you call `mongoose.model()` with twice the same name but a different schema, + * you will get an `OverwriteModelError`. If you call `mongoose.model()` with + * the same name and same schema, you'll get the same schema back. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * + * // define an Actor model with this mongoose instance + * const schema = new Schema({ name: String }); + * mongoose.model('Actor', schema); + * + * // create a new connection + * const conn = mongoose.createConnection(..); + * + * // create Actor model + * const Actor = conn.model('Actor', schema); + * conn.model('Actor') === Actor; // true + * conn.model('Actor', schema) === Actor; // true, same schema + * conn.model('Actor', schema, 'actors') === Actor; // true, same schema and collection name + * + * // This throws an `OverwriteModelError` because the schema is different. + * conn.model('Actor', new Schema({ name: String })); + * + * _When no `collection` argument is passed, Mongoose uses the model name. If you don't like this behavior, either pass a collection name, use `mongoose.pluralize()`, or set your schemas collection name option._ + * + * #### Example: + * + * const schema = new Schema({ name: String }, { collection: 'actor' }); + * + * // or + * + * schema.set('collection', 'actor'); + * + * // or + * + * const collectionName = 'actor'; + * const M = mongoose.model('Actor', schema, collectionName); + * + * @param {string|Function} name model name or class extending Model + * @param {Schema} [schema] the schema to use. + * @param {string} [collection] name (optional, inferred from model name) + * @param {object} [options] + * @param {boolean} [options.overwriteModels=false] If true, overwrite existing models with the same name to avoid `OverwriteModelError` + * @return {Model} The model associated with `name`. Mongoose will create the model if it doesn't already exist. + * @api public + */ + +Mongoose.prototype.model = function model(name, schema, collection, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (typeof schema === 'string') { + collection = schema; + schema = false; + } + + if (arguments.length === 1) { + const model = _mongoose.models[name]; + if (!model) { + throw new _mongoose.Error.MissingSchemaError(name); + } + return model; + } + + if (utils.isObject(schema) && !(schema instanceof Schema)) { + schema = new Schema(schema); + } + if (schema && !(schema instanceof Schema)) { + throw new _mongoose.Error('The 2nd parameter to `mongoose.model()` should be a ' + + 'schema or a POJO'); + } + + // handle internal options from connection.model() + options = options || {}; + + const originalSchema = schema; + if (schema) { + if (_mongoose.get('cloneSchemas')) { + schema = schema.clone(); + } + _mongoose._applyPlugins(schema); + } + + // connection.model() may be passing a different schema for + // an existing model name. in this case don't read from cache. + const overwriteModels = Object.hasOwn(_mongoose.options, 'overwriteModels') ? + _mongoose.options.overwriteModels : + options.overwriteModels; + if (Object.hasOwn(_mongoose.models, name) && options.cache !== false && overwriteModels !== true) { + if (originalSchema?.instanceOfSchema && + originalSchema !== _mongoose.models[name].schema) { + throw new _mongoose.Error.OverwriteModelError(name); + } + if (collection && collection !== _mongoose.models[name].collection.name) { + // subclass current model with alternate collection + const model = _mongoose.models[name]; + schema = model.prototype.schema; + const sub = model.__subclass(_mongoose.connection, schema, collection); + // do not cache the sub model + return sub; + } + return _mongoose.models[name]; + } + if (schema == null) { + throw new _mongoose.Error.MissingSchemaError(name); + } + + const model = _mongoose._model(name, schema, collection, options); + _mongoose.connection.models[name] = model; + _mongoose.models[name] = model; + + return model; +}; + +/*! + * ignore + */ + +Mongoose.prototype._model = function _model(name, schema, collection, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + let model; + if (typeof name === 'function') { + model = name; + name = model.name; + if (!(model.prototype instanceof Model)) { + throw new _mongoose.Error('The provided class ' + name + ' must extend Model'); + } + } + + if (schema) { + if (_mongoose.get('cloneSchemas')) { + schema = schema.clone(); + } + _mongoose._applyPlugins(schema); + } + + // Apply relevant "global" options to the schema + if (schema == null || !('pluralization' in schema.options)) { + schema.options.pluralization = _mongoose.options.pluralization; + } + + if (!collection) { + collection = schema.get('collection') || + utils.toCollectionName(name, _mongoose.pluralize()); + } + + applyEmbeddedDiscriminators(schema); + + const connection = options.connection || _mongoose.connection; + model = _mongoose.Model.compile(model || name, schema, collection, connection, _mongoose); + // Errors handled internally, so safe to ignore error + model.init().catch(function $modelInitNoop() {}); + + connection.emit('model', model); + + if (schema._applyDiscriminators != null) { + for (const disc of schema._applyDiscriminators.keys()) { + const { + schema: discriminatorSchema, + options + } = schema._applyDiscriminators.get(disc); + model.discriminator(disc, discriminatorSchema, options); + } + } + + return model; +}; + +/** + * Removes the model named `name` from the default connection, if it exists. + * You can use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + * + * Equivalent to `mongoose.connection.deleteModel(name)`. + * + * #### Example: + * + * mongoose.model('User', new Schema({ name: String })); + * console.log(mongoose.model('User')); // Model object + * mongoose.deleteModel('User'); + * console.log(mongoose.model('User')); // undefined + * + * // Usually useful in a Mocha `afterEach()` hook + * afterEach(function() { + * mongoose.deleteModel(/.+/); // Delete every model + * }); + * + * @api public + * @param {string|RegExp} name if string, the name of the model to remove. If regexp, removes all models whose name matches the regexp. + * @return {Mongoose} this + */ + +Mongoose.prototype.deleteModel = function deleteModel(name) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + _mongoose.connection.deleteModel(name); + delete _mongoose.models[name]; + return _mongoose; +}; + +/** + * Returns an array of model names created on this instance of Mongoose. + * + * #### Note: + * + * _Does not include names of models created using `connection.model()`._ + * + * @api public + * @return {Array} + */ + +Mongoose.prototype.modelNames = function modelNames() { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + const names = Object.keys(_mongoose.models); + return names; +}; + +/** + * Applies global plugins to `schema`. + * + * @param {Schema} schema + * @api private + */ + +Mongoose.prototype._applyPlugins = function _applyPlugins(schema, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + options = options || {}; + options.applyPluginsToDiscriminators = _mongoose.options?.applyPluginsToDiscriminators || false; + options.applyPluginsToChildSchemas = typeof _mongoose.options?.applyPluginsToChildSchemas === 'boolean' ? + _mongoose.options.applyPluginsToChildSchemas : + true; + applyPlugins(schema, _mongoose.plugins, options, '$globalPluginsApplied'); +}; + +/** + * Declares a global plugin executed on all Schemas. + * + * Equivalent to calling `.plugin(fn)` on each Schema you create. + * + * @param {Function} fn plugin callback + * @param {object} [opts] optional options + * @return {Mongoose} this + * @see plugins https://mongoosejs.com/docs/plugins.html + * @api public + */ + +Mongoose.prototype.plugin = function plugin(fn, opts) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + _mongoose.plugins.push([fn, opts]); + return _mongoose; +}; + +/** + * The Mongoose module's default connection. Equivalent to `mongoose.connections[0]`, see [`connections`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.connections). + * + * #### Example: + * + * const mongoose = require('mongoose'); + * mongoose.connect(...); + * mongoose.connection.on('error', cb); + * + * This is the connection used by default for every model created using [mongoose.model](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.model()). + * + * To create a new connection, use [`createConnection()`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.createConnection()). + * + * @memberOf Mongoose + * @instance + * @property {Connection} connection + * @api public + */ + +Mongoose.prototype.__defineGetter__('connection', function() { + return this.connections[0]; +}); + +Mongoose.prototype.__defineSetter__('connection', function(v) { + if (v instanceof this.__driver.Connection) { + this.connections[0] = v; + this.models = v.models; + } +}); + +/** + * An array containing all [connections](connection.html) associated with this + * Mongoose instance. By default, there is 1 connection. Calling + * [`createConnection()`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.createConnection()) adds a connection + * to this array. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * mongoose.connections.length; // 1, just the default connection + * mongoose.connections[0] === mongoose.connection; // true + * + * mongoose.createConnection('mongodb://127.0.0.1:27017/test'); + * mongoose.connections.length; // 2 + * + * @memberOf Mongoose + * @instance + * @property {Array} connections + * @api public + */ + +Mongoose.prototype.connections; + +/** + * An integer containing the value of the next connection id. Calling + * [`createConnection()`](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.createConnection()) increments + * this value. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * mongoose.createConnection(); // id `0`, `nextConnectionId` becomes `1` + * mongoose.createConnection(); // id `1`, `nextConnectionId` becomes `2` + * mongoose.connections[0].destroy() // Removes connection with id `0` + * mongoose.createConnection(); // id `2`, `nextConnectionId` becomes `3` + * + * @memberOf Mongoose + * @instance + * @property {number} nextConnectionId + * @api private + */ + +Mongoose.prototype.nextConnectionId; + +/** + * The Mongoose Aggregate constructor + * + * @method Aggregate + * @api public + */ + +Mongoose.prototype.Aggregate = Aggregate; + +/** + * The Base Mongoose Collection class. `mongoose.Collection` extends from this class. + * + * @memberOf Mongoose + * @instance + * @method Collection + * @api public + */ + +Mongoose.prototype.BaseCollection = require('./collection'); + +/** + * The Mongoose Collection constructor + * + * @memberOf Mongoose + * @instance + * @method Collection + * @api public + */ + +Object.defineProperty(Mongoose.prototype, 'Collection', { + get: function() { + return this.__driver.Collection; + }, + set: function(Collection) { + this.__driver.Collection = Collection; + } +}); + +/** + * The Mongoose [Connection](https://mongoosejs.com/docs/api/connection.html#Connection()) constructor + * + * @memberOf Mongoose + * @instance + * @method Connection + * @api public + */ + +Object.defineProperty(Mongoose.prototype, 'Connection', { + get: function() { + return this.__driver.Connection; + }, + set: function(Connection) { + if (Connection === this.__driver.Connection) { + return; + } + + this.__driver.Connection = Connection; + } +}); + +/** + * The Base Mongoose Connection class. `mongoose.Connection` extends from this class. + * + * @memberOf Mongoose + * @instance + * @method Connection + * @api public + */ + +Mongoose.prototype.BaseConnection = require('./connection'); + +/** + * The Mongoose version + * + * #### Example: + * + * console.log(mongoose.version); // '5.x.x' + * + * @property version + * @api public + */ + +Mongoose.prototype.version = pkg.version; + +/** + * The Mongoose constructor + * + * The exports of the mongoose module is an instance of this class. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const mongoose2 = new mongoose.Mongoose(); + * + * @method Mongoose + * @api public + */ + +Mongoose.prototype.Mongoose = Mongoose; + +/** + * The Mongoose [Schema](https://mongoosejs.com/docs/api/schema.html#Schema()) constructor + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const Schema = mongoose.Schema; + * const CatSchema = new Schema(..); + * + * @method Schema + * @api public + */ + +Mongoose.prototype.Schema = Schema; + +/** + * The Mongoose [SchemaType](https://mongoosejs.com/docs/api/schematype.html#SchemaType()) constructor + * + * @method SchemaType + * @api public + */ + +Mongoose.prototype.SchemaType = SchemaType; + +/** + * The various Mongoose SchemaTypes. + * + * #### Note: + * + * _Alias of mongoose.Schema.Types for backwards compatibility._ + * + * @property SchemaTypes + * @see Schema.SchemaTypes https://mongoosejs.com/docs/schematypes.html + * @api public + */ + +Mongoose.prototype.SchemaTypes = Schema.Types; + +/** + * The Mongoose [VirtualType](https://mongoosejs.com/docs/api/virtualtype.html#VirtualType()) constructor + * + * @method VirtualType + * @api public + */ + +Mongoose.prototype.VirtualType = VirtualType; + +/** + * The various Mongoose Types. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const array = mongoose.Types.Array; + * + * #### Types: + * + * - [Array](https://mongoosejs.com/docs/schematypes.html#arrays) + * - [Buffer](https://mongoosejs.com/docs/schematypes.html#buffers) + * - [Embedded](https://mongoosejs.com/docs/schematypes.html#schemas) + * - [DocumentArray](https://mongoosejs.com/docs/api/documentarray.html) + * - [Decimal128](https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.Decimal128) + * - [ObjectId](https://mongoosejs.com/docs/schematypes.html#objectids) + * - [Map](https://mongoosejs.com/docs/schematypes.html#maps) + * - [Subdocument](https://mongoosejs.com/docs/schematypes.html#schemas) + * - [Int32](https://mongoosejs.com/docs/schematypes.html#int32) + * + * Using this exposed access to the `ObjectId` type, we can construct ids on demand. + * + * const ObjectId = mongoose.Types.ObjectId; + * const id1 = new ObjectId; + * + * @property Types + * @api public + */ + +Mongoose.prototype.Types = Types; + +/** + * The Mongoose [Query](https://mongoosejs.com/docs/api/query.html#Query()) constructor. + * + * @method Query + * @api public + */ + +Mongoose.prototype.Query = Query; + +/** + * The Mongoose [Model](https://mongoosejs.com/docs/api/model.html#Model()) constructor. + * + * @method Model + * @api public + */ + +Mongoose.prototype.Model = Model; + +/** + * The Mongoose [Document](https://mongoosejs.com/docs/api/document.html#Document()) constructor. + * + * @method Document + * @api public + */ + +Mongoose.prototype.Document = Document; + +/** + * The Mongoose ObjectId [SchemaType](https://mongoosejs.com/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [MongoDB ObjectIds](https://www.mongodb.com/docs/manual/reference/method/ObjectId/). + * Do not use this to create a new ObjectId instance, use `mongoose.Types.ObjectId` + * instead. + * + * #### Example: + * + * const childSchema = new Schema({ parentId: mongoose.ObjectId }); + * + * @property ObjectId + * @api public + */ + +Mongoose.prototype.ObjectId = SchemaTypes.ObjectId; + +/** + * Returns true if Mongoose can cast the given value to an ObjectId, or + * false otherwise. + * + * #### Example: + * + * mongoose.isValidObjectId(new mongoose.Types.ObjectId()); // true + * mongoose.isValidObjectId('0123456789ab'); // true + * mongoose.isValidObjectId(6); // true + * mongoose.isValidObjectId(new User({ name: 'test' })); // true + * + * mongoose.isValidObjectId({ test: 42 }); // false + * + * @method isValidObjectId + * @param {any} v + * @returns {boolean} true if `v` is something Mongoose can coerce to an ObjectId + * @api public + */ + +Mongoose.prototype.isValidObjectId = function isValidObjectId(v) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + return _mongoose.Types.ObjectId.isValid(v); +}; + +/** + * Returns true if the given value is a Mongoose ObjectId (using `instanceof`) or if the + * given value is a 24 character hex string, which is the most commonly used string representation + * of an ObjectId. + * + * This function is similar to `isValidObjectId()`, but considerably more strict, because + * `isValidObjectId()` will return `true` for _any_ value that Mongoose can convert to an + * ObjectId. That includes Mongoose documents, any string of length 12, and any number. + * `isObjectIdOrHexString()` returns true only for `ObjectId` instances or 24 character hex + * strings, and will return false for numbers, documents, and strings of length 12. + * + * #### Example: + * + * mongoose.isObjectIdOrHexString(new mongoose.Types.ObjectId()); // true + * mongoose.isObjectIdOrHexString('62261a65d66c6be0a63c051f'); // true + * + * mongoose.isObjectIdOrHexString('0123456789ab'); // false + * mongoose.isObjectIdOrHexString(6); // false + * mongoose.isObjectIdOrHexString(new User({ name: 'test' })); // false + * mongoose.isObjectIdOrHexString({ test: 42 }); // false + * + * @method isObjectIdOrHexString + * @param {any} v + * @returns {boolean} true if `v` is an ObjectId instance _or_ a 24 char hex string + * @api public + */ + +Mongoose.prototype.isObjectIdOrHexString = function isObjectIdOrHexString(v) { + return isBsonType(v, 'ObjectId') || (typeof v === 'string' && objectIdHexRegexp.test(v)); +}; + +/** + * + * Syncs all the indexes for the models registered with this connection. + * + * @param {object} options + * @param {boolean} options.continueOnError `false` by default. If set to `true`, mongoose will not throw an error if one model syncing failed, and will return an object where the keys are the names of the models, and the values are the results/errors for each model. + * @return {Promise} Returns a Promise, when the Promise resolves the value is a list of the dropped indexes. + */ +Mongoose.prototype.syncIndexes = function syncIndexes(options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + return _mongoose.connection.syncIndexes(options); +}; + +/** + * The Mongoose Decimal128 [SchemaType](https://mongoosejs.com/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [128-bit decimal floating points](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-decimal.html). + * Do not use this to create a new Decimal128 instance, use `mongoose.Types.Decimal128` + * instead. + * + * #### Example: + * + * const vehicleSchema = new Schema({ fuelLevel: mongoose.Decimal128 }); + * + * @property Decimal128 + * @api public + */ + +Mongoose.prototype.Decimal128 = SchemaTypes.Decimal128; + + +/** + * The Mongoose Mixed [SchemaType](https://mongoosejs.com/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose's change tracking, casting, + * and validation should ignore. + * + * #### Example: + * + * const schema = new Schema({ arbitrary: mongoose.Mixed }); + * + * @property Mixed + * @api public + */ + +Mongoose.prototype.Mixed = SchemaTypes.Mixed; + +/** + * The Mongoose Date [SchemaType](https://mongoosejs.com/docs/schematypes.html). + * + * #### Example: + * + * const schema = new Schema({ test: Date }); + * schema.path('test') instanceof mongoose.Date; // true + * + * @property Date + * @api public + */ + +Mongoose.prototype.Date = SchemaTypes.Date; + +/** + * The Mongoose Number [SchemaType](https://mongoosejs.com/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose should cast to numbers. + * + * #### Example: + * + * const schema = new Schema({ num: mongoose.Number }); + * // Equivalent to: + * const schema = new Schema({ num: 'number' }); + * + * @property Number + * @api public + */ + +Mongoose.prototype.Number = SchemaTypes.Number; + +/** + * The [MongooseError](https://mongoosejs.com/docs/api/error.html#Error()) constructor. + * + * @method Error + * @api public + */ + +Mongoose.prototype.Error = MongooseError; +Mongoose.prototype.MongooseError = MongooseError; + +/** + * Mongoose uses this function to get the current time when setting + * [timestamps](https://mongoosejs.com/docs/guide.html#timestamps). You may stub out this function + * using a tool like [Sinon](https://www.npmjs.com/package/sinon) for testing. + * + * @method now + * @returns {Date} the current time + * @api public + */ + +Mongoose.prototype.now = function now() { return new Date(); }; + +/** + * The Mongoose CastError constructor + * + * @method CastError + * @param {string} type The name of the type + * @param {any} value The value that failed to cast + * @param {string} path The path `a.b.c` in the doc where this cast error occurred + * @param {Error} [reason] The original error that was thrown + * @api public + */ + +Mongoose.prototype.CastError = MongooseError.CastError; + +/** + * The constructor used for schematype options + * + * @method SchemaTypeOptions + * @api public + */ + +Mongoose.prototype.SchemaTypeOptions = require('./options/schemaTypeOptions'); + +/** + * The [mquery](https://github.com/aheckmann/mquery) query builder Mongoose uses. + * + * @property mquery + * @api public + */ + +Mongoose.prototype.mquery = require('mquery'); + +/** + * Sanitizes query filters against [query selector injection attacks](https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html) + * by wrapping any nested objects that have a property whose name starts with `$` in a `$eq`. + * + * ```javascript + * const obj = { username: 'val', pwd: { $ne: null } }; + * sanitizeFilter(obj); + * obj; // { username: 'val', pwd: { $eq: { $ne: null } } }); + * ``` + * + * @method sanitizeFilter + * @param {object} filter + * @returns {object} the sanitized object + * @api public + */ + +Mongoose.prototype.sanitizeFilter = sanitizeFilter; + +/** + * Tells `sanitizeFilter()` to skip the given object when filtering out potential [query selector injection attacks](https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html). + * Use this method when you have a known query selector that you want to use. + * + * ```javascript + * const obj = { username: 'val', pwd: trusted({ $type: 'string', $eq: 'my secret' }) }; + * sanitizeFilter(obj); + * + * // Note that `sanitizeFilter()` did not add `$eq` around `$type`. + * obj; // { username: 'val', pwd: { $type: 'string', $eq: 'my secret' } }); + * ``` + * + * @method trusted + * @param {object} obj + * @returns {object} the passed in object + * @api public + */ + +Mongoose.prototype.trusted = trusted; + +/** + * Use this function in `pre()` middleware to skip calling the wrapped function. + * + * #### Example: + * + * schema.pre('save', function() { + * // Will skip executing `save()`, but will execute post hooks as if + * // `save()` had executed with the result `{ matchedCount: 0 }` + * return mongoose.skipMiddlewareFunction({ matchedCount: 0 }); + * }); + * + * @method skipMiddlewareFunction + * @param {any} result + * @api public + */ + +Mongoose.prototype.skipMiddlewareFunction = Kareem.skipWrappedFunction; + +/** + * Use this function in `post()` middleware to replace the result + * + * #### Example: + * + * schema.post('find', function(res) { + * // Normally you have to modify `res` in place. But with + * // `overwriteMiddlewarResult()`, you can make `find()` return a + * // completely different value. + * return mongoose.overwriteMiddlewareResult(res.filter(doc => !doc.isDeleted)); + * }); + * + * @method overwriteMiddlewareResult + * @param {any} result + * @api public + */ + +Mongoose.prototype.overwriteMiddlewareResult = Kareem.overwriteResult; + +/** + * Use this function in `pre()` middleware to replace the arguments passed to the next middleware or hook. + * + * #### Example: + * + * // Suppose you have a schema for time in "HH:MM" string format, but you want to store it as an object { hours, minutes } + * const timeStringToObject = (time) => { + * if (typeof time !== 'string') return time; + * const [hours, minutes] = time.split(':'); + * return { hours: parseInt(hours), minutes: parseInt(minutes) }; + * }; + * + * const timeSchema = new Schema({ + * hours: { type: Number, required: true }, + * minutes: { type: Number, required: true }, + * }); + * + * // In a pre('init') hook, replace raw string doc with custom object form + * timeSchema.pre('init', function(doc) { + * if (typeof doc === 'string') { + * return mongoose.overwriteMiddlewareArguments(timeStringToObject(doc)); + * } + * }); + * + * // Now, initializing with a time string gets auto-converted by the hook + * const userSchema = new Schema({ time: timeSchema }); + * const User = mongoose.model('User', userSchema); + * const doc = new User({}); + * doc.$init({ time: '12:30' }); + * + * @method overwriteMiddlewareArguments + * @param {...any} args The new arguments to be passed to the next middleware. Pass multiple arguments as a spread, **not** as an array. + * @api public + */ + +Mongoose.prototype.overwriteMiddlewareArguments = Kareem.overwriteArguments; + +/** + * Takes in an object and deletes any keys from the object whose values + * are strictly equal to `undefined`. + * This function is useful for query filters because Mongoose treats + * `TestModel.find({ name: undefined })` as `TestModel.find({ name: null })`. + * + * #### Example: + * + * const filter = { name: 'John', age: undefined, status: 'active' }; + * mongoose.omitUndefined(filter); // { name: 'John', status: 'active' } + * filter; // { name: 'John', status: 'active' } + * + * await UserModel.findOne(mongoose.omitUndefined(filter)); + * + * @method omitUndefined + * @param {object} [val] the object to remove undefined keys from + * @returns {object} the object passed in + * @api public + */ + +Mongoose.prototype.omitUndefined = require('./helpers/omitUndefined'); + +/*! + * Create a new default connection (`mongoose.connection`) for a Mongoose instance. + * No-op if there is already a default connection. + */ + +function _createDefaultConnection(mongoose) { + if (mongoose.connection) { + return; + } + const conn = mongoose.createConnection(); // default connection + conn[defaultConnectionSymbol] = true; + conn.models = mongoose.models; +} + +/** + * The exports object is an instance of Mongoose. + * + * @api private + */ + +const mongoose = module.exports = exports = new Mongoose({ + [defaultMongooseSymbol]: true +}); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options.js new file mode 100644 index 00000000..3651dd6d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options.js @@ -0,0 +1,18 @@ +'use strict'; + +/*! + * ignore + */ + +exports.internalToObjectOptions = { + transform: false, + virtuals: false, + getters: false, + _skipDepopulateTopLevel: true, + depopulate: true, + flattenDecimals: false, + useProjection: false, + versionKey: true, + flattenObjectIds: false, + flattenUUIDs: false +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/populateOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/populateOptions.js new file mode 100644 index 00000000..ad743fe0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/populateOptions.js @@ -0,0 +1,36 @@ +'use strict'; + +const clone = require('../helpers/clone'); + +class PopulateOptions { + constructor(obj) { + this._docs = {}; + this._childDocs = []; + + if (obj == null) { + return; + } + obj = clone(obj); + Object.assign(this, obj); + if (typeof obj.subPopulate === 'object') { + this.populate = obj.subPopulate; + } + + + if (obj.perDocumentLimit != null && obj.limit != null) { + throw new Error('Can not use `limit` and `perDocumentLimit` at the same time. Path: `' + obj.path + '`.'); + } + } +} + +/** + * The connection used to look up models by name. If not specified, Mongoose + * will default to using the connection associated with the model in + * `PopulateOptions#model`. + * + * @memberOf PopulateOptions + * @property {Connection} connection + * @api public + */ + +module.exports = PopulateOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/propertyOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/propertyOptions.js new file mode 100644 index 00000000..cb95f35e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/propertyOptions.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = Object.freeze({ + enumerable: true, + configurable: true, + writable: true, + value: void 0 +}); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/saveOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/saveOptions.js new file mode 100644 index 00000000..286987ee --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/saveOptions.js @@ -0,0 +1,16 @@ +'use strict'; + +const clone = require('../helpers/clone'); + +class SaveOptions { + constructor(obj) { + if (obj == null) { + return; + } + Object.assign(this, clone(obj)); + } +} + +SaveOptions.prototype.__subdocs = null; + +module.exports = SaveOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaArrayOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaArrayOptions.js new file mode 100644 index 00000000..b10d38c2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaArrayOptions.js @@ -0,0 +1,78 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on an Array schematype. + * + * #### Example: + * + * const schema = new Schema({ tags: [String] }); + * schema.path('tags').options; // SchemaArrayOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaArrayOptions + */ + +class SchemaArrayOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If this is an array of strings, an array of allowed values for this path. + * Throws an error if this array isn't an array of strings. + * + * @api public + * @property enum + * @memberOf SchemaArrayOptions + * @type {Array} + * @instance + */ + +Object.defineProperty(SchemaArrayOptions.prototype, 'enum', opts); + +/** + * If set, specifies the type of this array's values. Equivalent to setting + * `type` to an array whose first element is `of`. + * + * #### Example: + * + * // `arr` is an array of numbers. + * new Schema({ arr: [Number] }); + * // Equivalent way to define `arr` as an array of numbers + * new Schema({ arr: { type: Array, of: Number } }); + * + * @api public + * @property of + * @memberOf SchemaArrayOptions + * @type {Function|string} + * @instance + */ + +Object.defineProperty(SchemaArrayOptions.prototype, 'of', opts); + +/** + * If set to `false`, will always deactivate casting non-array values to arrays. + * If set to `true`, will cast non-array values to arrays if `init` and `SchemaArray.options.castNonArrays` are also `true` + * + * #### Example: + * + * const Model = db.model('Test', new Schema({ x1: { castNonArrays: false, type: [String] } })); + * const doc = new Model({ x1: "some non-array value" }); + * await doc.validate(); // Errors with "CastError" + * + * @api public + * @property castNonArrays + * @memberOf SchemaArrayOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(SchemaArrayOptions.prototype, 'castNonArrays', opts); + +/*! + * ignore + */ + +module.exports = SchemaArrayOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaBufferOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaBufferOptions.js new file mode 100644 index 00000000..dcdc1ef6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaBufferOptions.js @@ -0,0 +1,38 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on a Buffer schematype. + * + * #### Example: + * + * const schema = new Schema({ bitmap: Buffer }); + * schema.path('bitmap').options; // SchemaBufferOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaBufferOptions + */ + +class SchemaBufferOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * Set the default subtype for this buffer. + * + * @api public + * @property subtype + * @memberOf SchemaBufferOptions + * @type {number} + * @instance + */ + +Object.defineProperty(SchemaBufferOptions.prototype, 'subtype', opts); + +/*! + * ignore + */ + +module.exports = SchemaBufferOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDateOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDateOptions.js new file mode 100644 index 00000000..a4ef62bb --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDateOptions.js @@ -0,0 +1,71 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on a Date schematype. + * + * #### Example: + * + * const schema = new Schema({ startedAt: Date }); + * schema.path('startedAt').options; // SchemaDateOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaDateOptions + */ + +class SchemaDateOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, Mongoose adds a validator that checks that this path is after the + * given `min`. + * + * @api public + * @property min + * @memberOf SchemaDateOptions + * @type {Date} + * @instance + */ + +Object.defineProperty(SchemaDateOptions.prototype, 'min', opts); + +/** + * If set, Mongoose adds a validator that checks that this path is before the + * given `max`. + * + * @api public + * @property max + * @memberOf SchemaDateOptions + * @type {Date} + * @instance + */ + +Object.defineProperty(SchemaDateOptions.prototype, 'max', opts); + +/** + * If set, Mongoose creates a TTL index on this path. + * + * mongo TTL index `expireAfterSeconds` value will take 'expires' value expressed in seconds. + * + * #### Example: + * + * const schema = new Schema({ "expireAt": { type: Date, expires: 11 } }); + * // if 'expireAt' is set, then document expires at expireAt + 11 seconds + * + * @api public + * @property expires + * @memberOf SchemaDateOptions + * @type {Date} + * @instance + */ + +Object.defineProperty(SchemaDateOptions.prototype, 'expires', opts); + +/*! + * ignore + */ + +module.exports = SchemaDateOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js new file mode 100644 index 00000000..9cf409fc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js @@ -0,0 +1,91 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on an Document Array schematype. + * + * #### Example: + * + * const schema = new Schema({ users: [{ name: string }] }); + * schema.path('users').options; // SchemaDocumentArrayOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaDocumentOptions + */ + +class SchemaDocumentArrayOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If `true`, Mongoose will skip building any indexes defined in this array's schema. + * If not set, Mongoose will build all indexes defined in this array's schema. + * + * #### Example: + * + * const childSchema = Schema({ name: { type: String, index: true } }); + * // If `excludeIndexes` is `true`, Mongoose will skip building an index + * // on `arr.name`. Otherwise, Mongoose will build an index on `arr.name`. + * const parentSchema = Schema({ + * arr: { type: [childSchema], excludeIndexes: true } + * }); + * + * @api public + * @property excludeIndexes + * @memberOf SchemaDocumentArrayOptions + * @type {Array} + * @instance + */ + +Object.defineProperty(SchemaDocumentArrayOptions.prototype, 'excludeIndexes', opts); + +/** + * If set, overwrites the child schema's `_id` option. + * + * #### Example: + * + * const childSchema = Schema({ name: String }); + * const parentSchema = Schema({ + * child: { type: childSchema, _id: false } + * }); + * parentSchema.path('child').schema.options._id; // false + * + * @api public + * @property _id + * @memberOf SchemaDocumentArrayOptions + * @type {Array} + * @instance + */ + +Object.defineProperty(SchemaDocumentArrayOptions.prototype, '_id', opts); + +/** + * Defines embedded discriminators for this document array path. + * + * #### Example: + * + * const eventSchema = Schema({ message: String }, { discriminatorKey: 'kind' }); + * const clickedSchema = Schema({ element: String }); + * const parentSchema = Schema({ + * events: [{ + * type: eventSchema, + * discriminators: { Clicked: clickedSchema } + * }] + * }); + * + * @api public + * @property discriminators + * @memberOf SchemaDocumentArrayOptions + * @type {Object} + * @instance + */ + +Object.defineProperty(SchemaDocumentArrayOptions.prototype, 'discriminators', opts); + +/*! + * ignore + */ + +module.exports = SchemaDocumentArrayOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaMapOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaMapOptions.js new file mode 100644 index 00000000..d6de6a4c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaMapOptions.js @@ -0,0 +1,43 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on a Map schematype. + * + * #### Example: + * + * const schema = new Schema({ socialMediaHandles: { type: Map, of: String } }); + * schema.path('socialMediaHandles').options; // SchemaMapOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaMapOptions + */ + +class SchemaMapOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, specifies the type of this map's values. Mongoose will cast + * this map's values to the given type. + * + * If not set, Mongoose will not cast the map's values. + * + * #### Example: + * + * // Mongoose will cast `socialMediaHandles` values to strings + * const schema = new Schema({ socialMediaHandles: { type: Map, of: String } }); + * schema.path('socialMediaHandles').options.of; // String + * + * @api public + * @property of + * @memberOf SchemaMapOptions + * @type {Function|string} + * @instance + */ + +Object.defineProperty(SchemaMapOptions.prototype, 'of', opts); + +module.exports = SchemaMapOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaNumberOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaNumberOptions.js new file mode 100644 index 00000000..f30f6690 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaNumberOptions.js @@ -0,0 +1,101 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on a Number schematype. + * + * #### Example: + * + * const schema = new Schema({ count: Number }); + * schema.path('count').options; // SchemaNumberOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaNumberOptions + */ + +class SchemaNumberOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, Mongoose adds a validator that checks that this path is at least the + * given `min`. + * + * @api public + * @property min + * @memberOf SchemaNumberOptions + * @type {number} + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'min', opts); + +/** + * If set, Mongoose adds a validator that checks that this path is less than the + * given `max`. + * + * @api public + * @property max + * @memberOf SchemaNumberOptions + * @type {number} + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'max', opts); + +/** + * If set, Mongoose adds a validator that checks that this path is strictly + * equal to one of the given values. + * + * #### Example: + * + * const schema = new Schema({ + * favoritePrime: { + * type: Number, + * enum: [3, 5, 7] + * } + * }); + * schema.path('favoritePrime').options.enum; // [3, 5, 7] + * + * @api public + * @property enum + * @memberOf SchemaNumberOptions + * @type {Array} + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'enum', opts); + +/** + * Sets default [populate options](https://mongoosejs.com/docs/populate.html#query-conditions). + * + * #### Example: + * + * const schema = new Schema({ + * child: { + * type: Number, + * ref: 'Child', + * populate: { select: 'name' } + * } + * }); + * const Parent = mongoose.model('Parent', schema); + * + * // Automatically adds `.select('name')` + * Parent.findOne().populate('child'); + * + * @api public + * @property populate + * @memberOf SchemaNumberOptions + * @type {object} + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'populate', opts); + +/*! + * ignore + */ + +module.exports = SchemaNumberOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaObjectIdOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaObjectIdOptions.js new file mode 100644 index 00000000..776beef4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaObjectIdOptions.js @@ -0,0 +1,64 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on an ObjectId schematype. + * + * #### Example: + * + * const schema = new Schema({ testId: mongoose.ObjectId }); + * schema.path('testId').options; // SchemaObjectIdOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaObjectIdOptions + */ + +class SchemaObjectIdOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If truthy, uses Mongoose's default built-in ObjectId path. + * + * @api public + * @property auto + * @memberOf SchemaObjectIdOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(SchemaObjectIdOptions.prototype, 'auto', opts); + +/** + * Sets default [populate options](https://mongoosejs.com/docs/populate.html#query-conditions). + * + * #### Example: + * + * const schema = new Schema({ + * child: { + * type: 'ObjectId', + * ref: 'Child', + * populate: { select: 'name' } + * } + * }); + * const Parent = mongoose.model('Parent', schema); + * + * // Automatically adds `.select('name')` + * Parent.findOne().populate('child'); + * + * @api public + * @property populate + * @memberOf SchemaObjectIdOptions + * @type {object} + * @instance + */ + +Object.defineProperty(SchemaObjectIdOptions.prototype, 'populate', opts); + +/*! + * ignore + */ + +module.exports = SchemaObjectIdOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaStringOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaStringOptions.js new file mode 100644 index 00000000..23c790fb --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaStringOptions.js @@ -0,0 +1,138 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on a string schematype. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * schema.path('name').options; // SchemaStringOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaStringOptions + */ + +class SchemaStringOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * Array of allowed values for this path + * + * @api public + * @property enum + * @memberOf SchemaStringOptions + * @type {Array} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'enum', opts); + +/** + * Attach a validator that succeeds if the data string matches the given regular + * expression, and fails otherwise. + * + * @api public + * @property match + * @memberOf SchemaStringOptions + * @type {RegExp} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'match', opts); + +/** + * If truthy, Mongoose will add a [custom setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()) that lowercases this string + * using JavaScript's built-in `String#toLowerCase()`. + * + * @api public + * @property lowercase + * @memberOf SchemaStringOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'lowercase', opts); + +/** + * If truthy, Mongoose will add a [custom setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()) that removes leading and trailing + * whitespace using [JavaScript's built-in `String#trim()`](https://masteringjs.io/tutorials/fundamentals/trim-string). + * + * @api public + * @property trim + * @memberOf SchemaStringOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'trim', opts); + +/** + * If truthy, Mongoose will add a custom setter that uppercases this string + * using JavaScript's built-in [`String#toUpperCase()`](https://masteringjs.io/tutorials/fundamentals/uppercase). + * + * @api public + * @property uppercase + * @memberOf SchemaStringOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'uppercase', opts); + +/** + * If set, Mongoose will add a custom validator that ensures the given + * string's `length` is at least the given number. + * + * Mongoose supports two different spellings for this option: `minLength` and `minlength`. + * `minLength` is the recommended way to specify this option, but Mongoose also supports + * `minlength` (lowercase "l"). + * + * @api public + * @property minLength + * @memberOf SchemaStringOptions + * @type {number} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'minLength', opts); +Object.defineProperty(SchemaStringOptions.prototype, 'minlength', opts); + +/** + * If set, Mongoose will add a custom validator that ensures the given + * string's `length` is at most the given number. + * + * Mongoose supports two different spellings for this option: `maxLength` and `maxlength`. + * `maxLength` is the recommended way to specify this option, but Mongoose also supports + * `maxlength` (lowercase "l"). + * + * @api public + * @property maxLength + * @memberOf SchemaStringOptions + * @type {number} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'maxLength', opts); +Object.defineProperty(SchemaStringOptions.prototype, 'maxlength', opts); + +/** + * Sets default [populate options](https://mongoosejs.com/docs/populate.html#query-conditions). + * + * @api public + * @property populate + * @memberOf SchemaStringOptions + * @type {object} + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'populate', opts); + +/*! + * ignore + */ + +module.exports = SchemaStringOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js new file mode 100644 index 00000000..e5d581ba --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js @@ -0,0 +1,89 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on a single nested schematype. + * + * #### Example: + * + * const schema = Schema({ child: Schema({ name: String }) }); + * schema.path('child').options; // SchemaSubdocumentOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaSubdocumentOptions + */ + +class SchemaSubdocumentOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, overwrites the child schema's `_id` option. + * + * #### Example: + * + * const childSchema = Schema({ name: String }); + * const parentSchema = Schema({ + * child: { type: childSchema, _id: false } + * }); + * parentSchema.path('child').schema.options._id; // false + * + * @api public + * @property _id + * @memberOf SchemaSubdocumentOptions + * @type {Function|string} + * @instance + */ + +Object.defineProperty(SchemaSubdocumentOptions.prototype, '_id', opts); + +/** + * If set, overwrites the child schema's `minimize` option. In addition, configures whether the entire + * subdocument can be minimized out. + * + * #### Example: + * + * const childSchema = Schema({ name: String }); + * const parentSchema = Schema({ + * child: { type: childSchema, minimize: false } + * }); + * const ParentModel = mongoose.model('Parent', parentSchema); + * // Saves `{ child: {} }` to the db. Without `minimize: false`, Mongoose would remove the empty + * // object and save `{}` to the db. + * await ParentModel.create({ child: {} }); + * + * @api public + * @property minimize + * @memberOf SchemaSubdocumentOptions + * @type {Function|string} + * @instance + */ + +Object.defineProperty(SchemaSubdocumentOptions.prototype, 'minimize', opts); + +/** + * Defines embedded discriminators for this single nested path. + * + * #### Example: + * + * const eventSchema = Schema({ message: String }, { discriminatorKey: 'kind' }); + * const clickedSchema = Schema({ element: String }); + * const parentSchema = Schema({ + * event: { + * type: eventSchema, + * discriminators: { Clicked: clickedSchema } + * } + * }); + * + * @api public + * @property discriminators + * @memberOf SchemaSubdocumentOptions + * @type {Object} + * @instance + */ + +Object.defineProperty(SchemaSubdocumentOptions.prototype, 'discriminators', opts); + +module.exports = SchemaSubdocumentOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaTypeOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaTypeOptions.js new file mode 100644 index 00000000..93bed2d8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaTypeOptions.js @@ -0,0 +1,258 @@ +'use strict'; + +const clone = require('../helpers/clone'); + +/** + * The options defined on a schematype. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * schema.path('name').options instanceof mongoose.SchemaTypeOptions; // true + * + * @api public + * @constructor SchemaTypeOptions + */ + +class SchemaTypeOptions { + constructor(obj) { + if (obj == null) { + return this; + } + Object.assign(this, clone(obj)); + } +} + +const opts = require('./propertyOptions'); + +/** + * The type to cast this path to. + * + * @api public + * @property type + * @memberOf SchemaTypeOptions + * @type {Function|string|object} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'type', opts); + +/** + * Function or object describing how to validate this schematype. + * + * @api public + * @property validate + * @memberOf SchemaTypeOptions + * @type {Function|object} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'validate', opts); + +/** + * Allows overriding casting logic for this individual path. If a string, the + * given string overwrites Mongoose's default cast error message. + * + * #### Example: + * + * const schema = new Schema({ + * num: { + * type: Number, + * cast: '{VALUE} is not a valid number' + * } + * }); + * + * // Throws 'CastError: "bad" is not a valid number' + * schema.path('num').cast('bad'); + * + * const Model = mongoose.model('Test', schema); + * const doc = new Model({ num: 'fail' }); + * const err = doc.validateSync(); + * + * err.errors['num']; // 'CastError: "fail" is not a valid number' + * + * @api public + * @property cast + * @memberOf SchemaTypeOptions + * @type {string} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'cast', opts); + +/** + * If true, attach a required validator to this path, which ensures this path + * cannot be set to a nullish value. If a function, Mongoose calls the + * function and only checks for nullish values if the function returns a truthy value. + * + * @api public + * @property required + * @memberOf SchemaTypeOptions + * @type {Function|boolean} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'required', opts); + +/** + * Controls whether this path may be set to `null`. By default, Mongoose allows + * `null` for non-required paths. Set `allowNull: false` to allow `undefined` + * but disallow `null`. + * + * @api public + * @property allowNull + * @memberOf SchemaTypeOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'allowNull', opts); + +/** + * The default value for this path. If a function, Mongoose executes the function + * and uses the return value as the default. + * + * @api public + * @property default + * @memberOf SchemaTypeOptions + * @type {Function|any} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'default', opts); + +/** + * The model that `populate()` should use if populating this path. + * + * @api public + * @property ref + * @memberOf SchemaTypeOptions + * @type {Function|string} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'ref', opts); + +/** + * The path in the document that `populate()` should use to find the model + * to use. + * + * @api public + * @property ref + * @memberOf SchemaTypeOptions + * @type {Function|string} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'refPath', opts); + +/** + * Whether to include or exclude this path by default when loading documents + * using `find()`, `findOne()`, etc. + * + * @api public + * @property select + * @memberOf SchemaTypeOptions + * @type {boolean|number} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'select', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build an index on this path when the model is compiled. + * + * @api public + * @property index + * @memberOf SchemaTypeOptions + * @type {boolean|number|object} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'index', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a unique index on this path when the + * model is compiled. [The `unique` option is **not** a validator](https://mongoosejs.com/docs/validation.html#the-unique-option-is-not-a-validator). + * + * @api public + * @property unique + * @memberOf SchemaTypeOptions + * @type {boolean|number} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'unique', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * disallow changes to this path once the document + * is saved to the database for the first time. Read more about [immutability in Mongoose here](https://thecodebarbarian.com/whats-new-in-mongoose-5-6-immutable-properties.html). + * + * @api public + * @property immutable + * @memberOf SchemaTypeOptions + * @type {Function|boolean} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'immutable', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build a sparse index on this path. + * + * @api public + * @property sparse + * @memberOf SchemaTypeOptions + * @type {boolean|number} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'sparse', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a text index on this path. + * + * @api public + * @property text + * @memberOf SchemaTypeOptions + * @type {boolean|number|object} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'text', opts); + +/** + * Define a transform function for this individual schema type. + * Only called when calling `toJSON()` or `toObject()`. + * + * #### Example: + * + * const schema = Schema({ + * myDate: { + * type: Date, + * transform: v => v.getFullYear() + * } + * }); + * const Model = mongoose.model('Test', schema); + * + * const doc = new Model({ myDate: new Date('2019/06/01') }); + * doc.myDate instanceof Date; // true + * + * const res = doc.toObject({ transform: true }); + * res.myDate; // 2019 + * + * @api public + * @property transform + * @memberOf SchemaTypeOptions + * @type {Function} + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'transform', opts); + +module.exports = SchemaTypeOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaUnionOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaUnionOptions.js new file mode 100644 index 00000000..1fcbc658 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/schemaUnionOptions.js @@ -0,0 +1,32 @@ +'use strict'; + +const SchemaTypeOptions = require('./schemaTypeOptions'); + +/** + * The options defined on a Union schematype. + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaUnionOptions + */ + +class SchemaUnionOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, specifies the types that this union can take. Mongoose will cast + * the value to one of the given types. + * + * If not set, Mongoose will not cast the value to any specific type. + * + * @api public + * @property of + * @memberOf SchemaUnionOptions + * @type {Function|Function[]|string|string[]} + * @instance + */ + +Object.defineProperty(SchemaUnionOptions.prototype, 'of', opts); + +module.exports = SchemaUnionOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/virtualOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/virtualOptions.js new file mode 100644 index 00000000..3c4080e5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/options/virtualOptions.js @@ -0,0 +1,164 @@ +'use strict'; + +const opts = require('./propertyOptions'); + +class VirtualOptions { + constructor(obj) { + Object.assign(this, obj); + + if (obj?.options != null) { + this.options = Object.assign({}, obj.options); + } + } +} + +/** + * Marks this virtual as a populate virtual, and specifies the model to + * use for populate. + * + * @api public + * @property ref + * @memberOf VirtualOptions + * @type {string|Model|Function} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'ref', opts); + +/** + * Marks this virtual as a populate virtual, and specifies the path that + * contains the name of the model to populate + * + * @api public + * @property refPath + * @memberOf VirtualOptions + * @type {string|Function} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'refPath', opts); + +/** + * The name of the property in the local model to match to `foreignField` + * in the foreign model. + * + * @api public + * @property localField + * @memberOf VirtualOptions + * @type {string|Function} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'localField', opts); + +/** + * The name of the property in the foreign model to match to `localField` + * in the local model. + * + * @api public + * @property foreignField + * @memberOf VirtualOptions + * @type {string|Function} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'foreignField', opts); + +/** + * Whether to populate this virtual as a single document (true) or an + * array of documents (false). + * + * @api public + * @property justOne + * @memberOf VirtualOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'justOne', opts); + +/** + * If true, populate just the number of documents where `localField` + * matches `foreignField`, as opposed to the documents themselves. + * + * If `count` is set, it overrides `justOne`. + * + * @api public + * @property count + * @memberOf VirtualOptions + * @type {boolean} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'count', opts); + +/** + * Add an additional filter to populate, in addition to `localField` + * matches `foreignField`. + * + * @api public + * @property match + * @memberOf VirtualOptions + * @type {object|Function} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'match', opts); + +/** + * Additional options to pass to the query used to `populate()`: + * + * - `sort` + * - `skip` + * - `limit` + * + * @api public + * @property options + * @memberOf VirtualOptions + * @type {object} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'options', opts); + +/** + * If true, add a `skip` to the query used to `populate()`. + * + * @api public + * @property skip + * @memberOf VirtualOptions + * @type {number} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'skip', opts); + +/** + * If true, add a `limit` to the query used to `populate()`. + * + * @api public + * @property limit + * @memberOf VirtualOptions + * @type {number} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'limit', opts); + +/** + * The `limit` option for `populate()` has [some unfortunate edge cases](https://mongoosejs.com/docs/populate.html#query-conditions) + * when working with multiple documents, like `.find().populate()`. The + * `perDocumentLimit` option makes `populate()` execute a separate query + * for each document returned from `find()` to ensure each document + * gets up to `perDocumentLimit` populated docs if possible. + * + * @api public + * @property perDocumentLimit + * @memberOf VirtualOptions + * @type {number} + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'perDocumentLimit', opts); + +module.exports = VirtualOptions; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/index.js new file mode 100644 index 00000000..c0714f87 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/index.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.saveSubdocs = require('./saveSubdocs'); +exports.sharding = require('./sharding'); +exports.trackTransaction = require('./trackTransaction'); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/saveSubdocs.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/saveSubdocs.js new file mode 100644 index 00000000..ba923b5c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/saveSubdocs.js @@ -0,0 +1,97 @@ +'use strict'; + +const symbols = require('../schema/symbols'); + +/*! + * ignore + */ + +module.exports = function saveSubdocs(schema) { + const unshift = true; + + schema.s.hooks.pre('save', false, saveSubdocsPreSave, null, unshift); + schema.s.hooks.post('save', saveSubdocsPostSave, null, unshift); + schema.s.hooks.pre('save', saveSubdocsPreDeleteOne); + schema.s.hooks.post('save', saveSubdocsPostDeleteOne); +}; + + +// These hooks are deliberately not `async` so that they don't allocate a +// promise and force an extra microtask hop on every `save()` when there are +// no subdocuments. kareem only awaits hooks that return a promise. +function saveSubdocsPreSave() { + if (this.$isSubdocument) { + return; + } + + const subdocs = this.$getAllSubdocs({ useCache: true }); + + if (!subdocs.length) { + return; + } + + const options = this.$__.saveOptions; + return Promise.all(subdocs.map(subdoc => subdoc._execDocumentPreHooks('save', options, [options]))).then(() => { + // Invalidate subdocs cache because subdoc pre hooks can add new subdocuments + if (this.$__.saveOptions) { + this.$__.saveOptions.__subdocs = null; + } + }); +} + +function saveSubdocsPostSave() { + if (this.$isSubdocument) { + return; + } + + const subdocs = this.$getAllSubdocs({ useCache: true }); + + if (!subdocs.length) { + return; + } + + const options = this.$__.saveOptions; + const promises = []; + for (const subdoc of subdocs) { + promises.push(subdoc._execDocumentPostHooks('save', options)); + } + + return Promise.all(promises); +} + +function saveSubdocsPreDeleteOne() { + const removedSubdocs = this.$__.removedSubdocs; + if (!removedSubdocs?.length) { + return; + } + + const options = this.$__.saveOptions; + const promises = []; + for (const subdoc of removedSubdocs) { + promises.push(subdoc._execDocumentPreHooks('deleteOne', options)); + } + + return Promise.all(promises); +} + +function saveSubdocsPostDeleteOne() { + const removedSubdocs = this.$__.removedSubdocs; + if (!removedSubdocs?.length) { + return; + } + + const options = this.$__.saveOptions; + const promises = []; + for (const subdoc of removedSubdocs) { + promises.push(subdoc._execDocumentPostHooks('deleteOne', options)); + } + + this.$__.removedSubdocs = null; + return Promise.all(promises); +} + + +saveSubdocsPreSave[symbols.builtInMiddleware] = true; +saveSubdocsPostSave[symbols.builtInMiddleware] = true; +saveSubdocsPreDeleteOne[symbols.builtInMiddleware] = true; +saveSubdocsPostDeleteOne[symbols.builtInMiddleware] = true; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/sharding.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/sharding.js new file mode 100644 index 00000000..21beb22d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/sharding.js @@ -0,0 +1,101 @@ +'use strict'; + +const objectIdSymbol = require('../helpers/symbols').objectIdSymbol; +const symbols = require('../schema/symbols'); +const utils = require('../utils'); + +/*! + * ignore + */ + +module.exports = function shardingPlugin(schema) { + schema.post('init', shardingPluginPostInit); + schema.pre('save', shardingPluginPreSave); + schema.post('save', shardingPluginPostSave); + schema.pre('deleteOne', { document: true, query: false }, shardingPluginPreDeleteOne); + schema.pre('updateOne', { document: true, query: false }, shardingPluginPreUpdateOne); +}; + +function shardingPluginPostInit() { + storeShard.call(this); + return this; +} + +function shardingPluginPreSave() { + applyWhere.call(this); +} + +function shardingPluginPostSave() { + storeShard.call(this); +} + +function shardingPluginPreDeleteOne() { + applyWhere.call(this); +} + +function shardingPluginPreUpdateOne() { + applyWhere.call(this); +} + +/*! + * ignore + */ + +function applyWhere() { + let paths; + let len; + + if (this.$__.shardval) { + paths = Object.keys(this.$__.shardval); + len = paths.length; + + this.$where = this.$where || {}; + for (let i = 0; i < len; ++i) { + this.$where[paths[i]] = this.$__.shardval[paths[i]]; + } + } +} + +/*! + * ignore + */ + +module.exports.storeShard = storeShard; + +/*! + * ignore + */ + +function storeShard() { + // backwards compat + const key = this.$__schema.options.shardKey || this.$__schema.options.shardkey; + if (!utils.isPOJO(key)) { + return; + } + + const orig = this.$__.shardval = {}; + const paths = Object.keys(key); + const len = paths.length; + let val; + + for (let i = 0; i < len; ++i) { + val = this.$__getValue(paths[i]); + if (val == null) { + orig[paths[i]] = val; + } else if (utils.isMongooseObject(val)) { + orig[paths[i]] = val.toObject({ depopulate: true, _isNested: true }); + } else if (val instanceof Date || val[objectIdSymbol]) { + orig[paths[i]] = val; + } else if (typeof val.valueOf === 'function') { + orig[paths[i]] = val.valueOf(); + } else { + orig[paths[i]] = val; + } + } +} + +shardingPluginPostInit[symbols.builtInMiddleware] = true; +shardingPluginPreSave[symbols.builtInMiddleware] = true; +shardingPluginPostSave[symbols.builtInMiddleware] = true; +shardingPluginPreDeleteOne[symbols.builtInMiddleware] = true; +shardingPluginPreUpdateOne[symbols.builtInMiddleware] = true; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/trackTransaction.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/trackTransaction.js new file mode 100644 index 00000000..caac7d91 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/plugins/trackTransaction.js @@ -0,0 +1,104 @@ +'use strict'; + +const arrayAtomicsSymbol = require('../helpers/symbols').arrayAtomicsSymbol; +const sessionNewDocuments = require('../helpers/symbols').sessionNewDocuments; +const symbols = require('../schema/symbols'); +const utils = require('../utils'); + +module.exports = function trackTransaction(schema) { + schema.pre('save', trackTransactionPreSave); + schema.pre('deleteOne', { document: true, query: false }, trackTransactionPreDeleteOne); +}; + +function trackTransactionPreSave() { + _getInitialState(this); +} + +function trackTransactionPreDeleteOne() { + const initialState = _getInitialState(this); + if (initialState != null && !Object.hasOwn(initialState, 'isDeleted')) { + initialState.isDeleted = this.$isDeleted(); + } +} + +function _getInitialState(doc) { + const session = doc.$session(); + if (session == null) { + return null; + } + if (session.transaction == null || session[sessionNewDocuments] == null) { + return null; + } + + if (!session[sessionNewDocuments].has(doc)) { + const initialState = {}; + if (doc.isNew) { + initialState.isNew = true; + } + if (doc.$__schema.options.versionKey) { + initialState.versionKey = doc.get(doc.$__schema.options.versionKey); + } + + initialState.modifiedPaths = new Set(Object.keys(doc.$__.activePaths.getStatePaths('modify'))); + initialState.atomics = _getAtomics(doc); + + session[sessionNewDocuments].set(doc, initialState); + } + + return session[sessionNewDocuments].get(doc); +} + +function _getAtomics(doc, previous) { + const pathToAtomics = new Map(); + previous = previous || new Map(); + + const pathsToCheck = Object.keys(doc.$__.activePaths.init).concat(Object.keys(doc.$__.activePaths.modify)); + + for (const path of pathsToCheck) { + const val = doc.$__getValue(path); + if (Array.isArray(val) && + utils.isMongooseDocumentArray(val) && + val.length && + val[arrayAtomicsSymbol] != null && + utils.hasOwnKeys(val[arrayAtomicsSymbol])) { + const existing = previous.get(path) || {}; + pathToAtomics.set(path, mergeAtomics(existing, val[arrayAtomicsSymbol])); + } + } + + const dirty = doc.$__dirty(); + for (const dirt of dirty) { + const path = dirt.path; + + const val = dirt.value; + if (val?.[arrayAtomicsSymbol] != null && utils.hasOwnKeys(val[arrayAtomicsSymbol])) { + const existing = previous.get(path) || {}; + pathToAtomics.set(path, mergeAtomics(existing, val[arrayAtomicsSymbol])); + } + } + + return pathToAtomics; +} + +function mergeAtomics(destination, source) { + destination = destination || {}; + + if (source.$pullAll != null) { + destination.$pullAll = (destination.$pullAll || []).concat(source.$pullAll); + } + if (source.$push != null) { + destination.$push = destination.$push || {}; + destination.$push.$each = (destination.$push.$each || []).concat(source.$push.$each); + } + if (source.$addToSet != null) { + destination.$addToSet = (destination.$addToSet || []).concat(source.$addToSet); + } + if (source.$set != null) { + destination.$set = Array.isArray(source.$set) ? [...source.$set] : Object.assign({}, source.$set); + } + + return destination; +} + +trackTransactionPreSave[symbols.builtInMiddleware] = true; +trackTransactionPreDeleteOne[symbols.builtInMiddleware] = true; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/query.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/query.js new file mode 100644 index 00000000..270c06dc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/query.js @@ -0,0 +1,5872 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('./error/cast'); +const DocumentNotFoundError = require('./error/notFound'); +const Kareem = require('kareem'); +const MongooseError = require('./error/mongooseError'); +const ObjectParameterError = require('./error/objectParameter'); +const QueryCursor = require('./cursor/queryCursor'); +const ValidationError = require('./error/validation'); +const { applyGlobalMaxTimeMS, applyGlobalDiskUse } = require('./helpers/query/applyGlobalOption'); +const handleReadPreferenceAliases = require('./helpers/query/handleReadPreferenceAliases'); +const applyReadConcern = require('./helpers/schema/applyReadConcern'); +const applyWriteConcern = require('./helpers/schema/applyWriteConcern'); +const cast = require('./cast'); +const castArrayFilters = require('./helpers/update/castArrayFilters'); +const castNumber = require('./cast/number'); +const castUpdate = require('./helpers/query/castUpdate'); +const clone = require('./helpers/clone'); +const decorateUpdateWithVersionKey = require('./helpers/update/decorateUpdateWithVersionKey'); +const getDiscriminatorByValue = require('./helpers/discriminator/getDiscriminatorByValue'); +const helpers = require('./queryHelpers'); +const internalToObjectOptions = require('./options').internalToObjectOptions; +const isExclusive = require('./helpers/projection/isExclusive'); +const isInclusive = require('./helpers/projection/isInclusive'); +const isPathSelectedInclusive = require('./helpers/projection/isPathSelectedInclusive'); +const isSubpath = require('./helpers/projection/isSubpath'); +const mpath = require('mpath'); +const mquery = require('mquery'); +const parseProjection = require('./helpers/projection/parseProjection'); +const removeUnusedArrayFilters = require('./helpers/update/removeUnusedArrayFilters'); +const sanitizeFilter = require('./helpers/query/sanitizeFilter'); +const sanitizeProjection = require('./helpers/query/sanitizeProjection'); +const { buildMiddlewareFilter } = require('./helpers/buildMiddlewareFilter'); +const selectPopulatedFields = require('./helpers/query/selectPopulatedFields'); +const setDefaultsOnInsert = require('./helpers/setDefaultsOnInsert'); +const specialProperties = require('./helpers/specialProperties'); +const updateValidators = require('./helpers/updateValidators'); +const util = require('util'); +const utils = require('./utils'); +const queryMiddlewareFunctions = require('./constants').queryMiddlewareFunctions; +const { createTracedChannel } = require('./tracing'); +const { trace: traceQuery } = createTracedChannel('mongoose:query'); + +const queryOptionMethods = new Set([ + 'allowDiskUse', + 'batchSize', + 'collation', + 'comment', + 'explain', + 'hint', + 'j', + 'lean', + 'limit', + 'maxTimeMS', + 'populate', + 'projection', + 'read', + 'select', + 'skip', + 'slice', + 'sort', + 'tailable', + 'w', + 'writeConcern', + 'wtimeout' +]); + +// Map from operation name to the name of the function that executes the actual operation against MongoDB. +// Called a thunk for legacy reasons, "thunk" means function that takes exactly 1 param, a callback. +// Currently `_countDocuments()`, etc. are async functions that take no params. +const opToThunk = new Map([ + ['countDocuments', '_countDocuments'], + ['distinct', '__distinct'], + ['estimatedDocumentCount', '_estimatedDocumentCount'], + ['find', '_find'], + ['findOne', '_findOne'], + ['findOneAndReplace', '_findOneAndReplace'], + ['findOneAndUpdate', '_findOneAndUpdate'], + ['replaceOne', '_replaceOne'], + ['updateMany', '_updateMany'], + ['updateOne', '_updateOne'], + ['deleteMany', '_deleteMany'], + ['deleteOne', '_deleteOne'], + ['findOneAndDelete', '_findOneAndDelete'] +]); + +const queryUpdateSymbol = Symbol('mongoose#Query#update'); + +/** + * Query constructor used for building queries. You do not need + * to instantiate a `Query` directly. Instead use Model functions like + * [`Model.find()`](https://mongoosejs.com/docs/api/model.html#Model.find()). + * + * #### Example: + * + * const query = MyModel.find(); // `query` is an instance of `Query` + * query.setOptions({ lean : true }); + * query.collection(MyModel.collection); + * query.where('age').gte(21).exec(callback); + * + * // You can instantiate a query directly. There is no need to do + * // this unless you're an advanced user with a very good reason to. + * const query = new mongoose.Query(); + * + * @param {object} [options] + * @param {object} [model] + * @param {object} [conditions] + * @param {object} [collection] Mongoose collection + * @api public + */ + +function Query(conditions, options, model, collection) { + // this stuff is for dealing with custom queries created by #toConstructor + if (!this._mongooseOptions) { + this._mongooseOptions = {}; + } + options = options || {}; + + this._transforms = []; + this._hooks = new Kareem(); + this._execCount = 0; + + // this is the case where we have a CustomQuery, we need to check if we got + // options passed in, and if we did, merge them in + const keys = Object.keys(options); + for (const key of keys) { + this._mongooseOptions[key] = options[key]; + } + + if (collection) { + this.mongooseCollection = collection; + } + + if (model) { + this.model = model; + this.schema = model.schema; + } + + // this is needed because map reduce returns a model that can be queried, but + // all of the queries on said model should be lean + if (this.model?._mapreduce) { + this.lean(); + } + + // inherit mquery + mquery.call(this, null, options); + if (collection) { + this.collection(collection); + } + + if (conditions) { + this.find(conditions); + } + + this.options = this.options || {}; + + // For gh-6880. mquery still needs to support `fields` by default for old + // versions of MongoDB + this.$useProjection = true; + + const collation = this?.schema?.options?.collation || null; + if (collation != null) { + this.options.collation = collation; + } +} + +// Helper function to check if an object is empty or contains only empty objects/arrays +function isEmptyFilter(obj) { + if (obj == null) return true; + if (typeof obj !== 'object') return true; + if (utils.hasOwnKeys(obj) === false) return true; + + // Check $and, $or, $nor arrays + for (const key of ['$and', '$or', '$nor']) { + if (Array.isArray(obj[key])) { + // If array is empty or all elements are empty objects, consider it empty + if (obj[key].length === 0 || obj[key].every(item => isEmptyFilter(item))) { + return true; + } + } + } + + return false; +} + +// Helper function to check for empty/invalid filter +function checkRequireFilter(filter, options) { + if (options?.requireFilter && isEmptyFilter(filter)) { + throw new MongooseError('Empty or invalid filter not allowed with requireFilter enabled'); + } +} + +/*! + * inherit mquery + */ + +Query.prototype = new mquery(); +Query.prototype.constructor = Query; + +Object.defineProperty(Query.prototype, '_update', { + configurable: true, + enumerable: true, + get: function() { + _cloneUpdateIfShared(this); + return this[queryUpdateSymbol]; + }, + set: function(v) { + this[queryUpdateSymbol] = v; + } +}); + +// Remove some legacy methods that we removed in Mongoose 8, but +// are still in mquery 5. +Query.prototype.count = undefined; +Query.prototype.findOneAndRemove = undefined; + +Query.base = mquery.prototype; + +/*! + * Overwrite mquery's `_distinct`, because Mongoose uses that name + * to store the field to apply distinct on. + */ + +Object.defineProperty(Query.prototype, '_distinct', { + configurable: true, + writable: true, + enumerable: true, + value: undefined +}); + +/** + * Flag to opt out of using `$geoWithin`. + * + * ```javascript + * mongoose.Query.use$geoWithin = false; + * ``` + * + * MongoDB 2.4 deprecated the use of `$within`, replacing it with `$geoWithin`. Mongoose uses `$geoWithin` by default (which is 100% backward compatible with `$within`). If you are running an older version of MongoDB, set this flag to `false` so your `within()` queries continue to work. + * + * @see geoWithin https://www.mongodb.com/docs/manual/reference/operator/geoWithin/ + * @default true + * @property use$geoWithin + * @memberOf Query + * @static + * @api public + */ + +Query.use$geoWithin = mquery.use$geoWithin; + +/** + * Converts this query to a customized, reusable query constructor with all arguments and options retained. + * + * #### Example: + * + * // Create a query for adventure movies and read from the primary + * // node in the replica-set unless it is down, in which case we'll + * // read from a secondary node. + * const query = Movie.find({ tags: 'adventure' }).read('primaryPreferred'); + * + * // create a custom Query constructor based off these settings + * const Adventure = query.toConstructor(); + * + * // further narrow down our query results while still using the previous settings + * await Adventure().where({ name: /^Life/ }).exec(); + * + * // since Adventure is a stand-alone constructor we can also add our own + * // helper methods and getters without impacting global queries + * Adventure.prototype.startsWith = function (prefix) { + * this.where({ name: new RegExp('^' + prefix) }) + * return this; + * } + * Object.defineProperty(Adventure.prototype, 'highlyRated', { + * get: function () { + * this.where({ rating: { $gt: 4.5 }}); + * return this; + * } + * }) + * await Adventure().highlyRated.startsWith('Life').exec(); + * + * @return {Query} subclass-of-Query + * @api public + */ + +Query.prototype.toConstructor = function toConstructor() { + const model = this.model; + const coll = this.mongooseCollection; + + const CustomQuery = function(criteria, options) { + if (!(this instanceof CustomQuery)) { + return new CustomQuery(criteria, options); + } + this._mongooseOptions = clone(p._mongooseOptions); + Query.call(this, criteria, options || null, model, coll); + }; + + util.inherits(CustomQuery, model.Query); + + // set inherited defaults + const p = CustomQuery.prototype; + + p.options = {}; + + // Need to handle `sort()` separately because entries-style `sort()` syntax + // `sort([['prop1', 1]])` confuses mquery into losing the outer nested array. + // See gh-8159 + const options = Object.assign({}, this.options); + if (options.sort != null) { + p.sort(options.sort); + delete options.sort; + } + p.setOptions(options); + + p.op = this.op; + p._conditions = clone(this._conditions); + p._fields = clone(this._fields); + p[queryUpdateSymbol] = clone(this[queryUpdateSymbol], { + flattenDecimals: false + }); + p._path = this._path; + p._distinct = this._distinct; + p._collection = this._collection; + p._mongooseOptions = this._mongooseOptions; + + return CustomQuery; +}; + +/** + * Make a copy of this query so you can re-execute it. + * + * #### Example: + * + * const q = Book.findOne({ title: 'Casino Royale' }); + * await q.exec(); + * await q.exec(); // Throws an error because you can't execute a query twice + * + * await q.clone().exec(); // Works + * + * @method clone + * @return {Query} copy + * @memberOf Query + * @instance + * @api public + */ + +Query.prototype.clone = function() { + const model = this.model; + const collection = this.mongooseCollection; + + const q = new this.model.Query({}, {}, model, collection); + + // Need to handle `sort()` separately because entries-style `sort()` syntax + // `sort([['prop1', 1]])` confuses mquery into losing the outer nested array. + // See gh-8159 + const options = Object.assign({}, this.options); + if (options.sort != null) { + q.sort(options.sort); + delete options.sort; + } + q.setOptions(options); + + q.op = this.op; + q._conditions = clone(this._conditions); + q._fields = clone(this._fields); + q[queryUpdateSymbol] = clone(this[queryUpdateSymbol], { + flattenDecimals: false + }); + q._path = this._path; + q._distinct = this._distinct; + q._collection = this._collection; + q._mongooseOptions = this._mongooseOptions; + + return q; +}; + +/** + * Specifies a javascript function or expression to pass to MongoDBs query system. + * + * #### Example: + * + * query.$where('this.comments.length === 10 || this.name.length === 5') + * + * // or + * + * query.$where(function () { + * return this.comments.length === 10 || this.name.length === 5; + * }) + * + * #### Note: + * + * Only use `$where` when you have a condition that cannot be met using other MongoDB operators like `$lt`. + * **Be sure to read about all of [its caveats](https://www.mongodb.com/docs/manual/reference/operator/where/) before using.** + * + * @see $where https://www.mongodb.com/docs/manual/reference/operator/where/ + * @method $where + * @param {string|Function} js javascript string or function + * @return {Query} this + * @memberOf Query + * @instance + * @method $where + * @api public + */ + +/** + * Specifies a `path` for use with chaining. + * + * #### Example: + * + * // instead of writing: + * User.find({age: {$gte: 21, $lte: 65}}); + * + * // we can instead write: + * User.where('age').gte(21).lte(65); + * + * // passing query conditions is permitted + * User.find().where({ name: 'vonderful' }) + * + * // chaining + * User + * .where('age').gte(21).lte(65) + * .where('name', /^vonderful/i) + * .where('friends').slice(10) + * .exec() + * + * @method where + * @memberOf Query + * @instance + * @param {string|object} [path] + * @param {any} [val] + * @return {Query} this + * @api public + */ + +/** + * Specifies a `$slice` projection for an array. + * + * #### Example: + * + * query.slice('comments', 5); // Returns the first 5 comments + * query.slice('comments', -5); // Returns the last 5 comments + * query.slice('comments', [10, 5]); // Returns the first 5 comments after the 10-th + * query.where('comments').slice(5); // Returns the first 5 comments + * query.where('comments').slice([-10, 5]); // Returns the first 5 comments after the 10-th to last + * + * **Note:** If the absolute value of the number of elements to be sliced is greater than the number of elements in the array, all array elements will be returned. + * + * // Given `arr`: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * query.slice('arr', 20); // Returns [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * query.slice('arr', -20); // Returns [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * + * **Note:** If the number of elements to skip is positive and greater than the number of elements in the array, an empty array will be returned. + * + * // Given `arr`: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * query.slice('arr', [20, 5]); // Returns [] + * + * **Note:** If the number of elements to skip is negative and its absolute value is greater than the number of elements in the array, the starting position is the start of the array. + * + * // Given `arr`: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * query.slice('arr', [-20, 5]); // Returns [1, 2, 3, 4, 5] + * + * @method slice + * @memberOf Query + * @instance + * @param {string} [path] + * @param {number|Array} val number of elements to slice or array with number of elements to skip and number of elements to slice + * @return {Query} this + * @see mongodb https://www.mongodb.com/docs/manual/tutorial/query-documents/#projection + * @see $slice https://www.mongodb.com/docs/manual/reference/projection/slice/#prj._S_slice + * @api public + */ + +Query.prototype.slice = function(...args) { + if (args.length === 0) { + return this; + } + + this._validate('slice'); + + let path; + let val; + + if (args.length === 1) { + const arg = args[0]; + if (typeof arg === 'object' && !Array.isArray(arg)) { + const keys = Object.keys(arg); + const numKeys = keys.length; + for (let i = 0; i < numKeys; ++i) { + this.slice(keys[i], arg[keys[i]]); + } + return this; + } + this._ensurePath('slice'); + path = this._path; + val = args[0]; + } else if (args.length === 2) { + if ('number' === typeof args[0]) { + this._ensurePath('slice'); + path = this._path; + val = [args[0], args[1]]; + } else { + path = args[0]; + val = args[1]; + } + } else if (args.length === 3) { + path = args[0]; + val = [args[1], args[2]]; + } + + const p = {}; + p[path] = { $slice: val }; + this.select(p); + + return this; +}; + +/*! + * ignore + */ + +const validOpsSet = new Set(queryMiddlewareFunctions); + +Query.prototype._validateOp = function() { + if (this.op != null && !validOpsSet.has(this.op)) { + this.error(new Error('Query has invalid `op`: "' + this.op + '"')); + } + + if (this.op !== 'estimatedDocumentCount' && this._conditions == null) { + throw new ObjectParameterError(this._conditions, 'filter', this.op); + } +}; + +/** + * Specifies the complementary comparison value for paths specified with `where()` + * + * #### Example: + * + * User.where('age').equals(49); + * + * // is the same as + * + * User.where('age', 49); + * + * @method equals + * @memberOf Query + * @instance + * @param {object} val + * @return {Query} this + * @api public + */ + +/** + * Specifies arguments for an `$or` condition. + * + * #### Example: + * + * query.or([{ color: 'red' }, { status: 'emergency' }]); + * + * @see $or https://www.mongodb.com/docs/manual/reference/operator/or/ + * @method or + * @memberOf Query + * @instance + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +/** + * Specifies arguments for a `$nor` condition. + * + * #### Example: + * + * query.nor([{ color: 'green' }, { status: 'ok' }]); + * + * @see $nor https://www.mongodb.com/docs/manual/reference/operator/nor/ + * @method nor + * @memberOf Query + * @instance + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +/** + * Specifies arguments for a `$and` condition. + * + * #### Example: + * + * query.and([{ color: 'green' }, { status: 'ok' }]) + * + * @method and + * @memberOf Query + * @instance + * @see $and https://www.mongodb.com/docs/manual/reference/operator/and/ + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +/** + * Specifies a `$gt` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * #### Example: + * + * Thing.find().where('age').gt(21); + * + * // or + * Thing.find().gt('age', 21); + * + * @method gt + * @memberOf Query + * @instance + * @param {string} [path] + * @param {number} val + * @see $gt https://www.mongodb.com/docs/manual/reference/operator/gt/ + * @api public + */ + +/** + * Specifies a `$gte` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method gte + * @memberOf Query + * @instance + * @param {string} [path] + * @param {number} val + * @see $gte https://www.mongodb.com/docs/manual/reference/operator/gte/ + * @api public + */ + +/** + * Specifies a `$lt` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lt + * @memberOf Query + * @instance + * @param {string} [path] + * @param {number} val + * @see $lt https://www.mongodb.com/docs/manual/reference/operator/lt/ + * @api public + */ + +/** + * Specifies a `$lte` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lte + * @see $lte https://www.mongodb.com/docs/manual/reference/operator/lte/ + * @memberOf Query + * @instance + * @param {string} [path] + * @param {number} val + * @api public + */ + +/** + * Specifies a `$ne` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $ne https://www.mongodb.com/docs/manual/reference/operator/ne/ + * @method ne + * @memberOf Query + * @instance + * @param {string} [path] + * @param {any} val + * @api public + */ + +/** + * Specifies an `$in` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $in https://www.mongodb.com/docs/manual/reference/operator/in/ + * @method in + * @memberOf Query + * @instance + * @param {string} [path] + * @param {Array} val + * @api public + */ + +/** + * Specifies an `$nin` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $nin https://www.mongodb.com/docs/manual/reference/operator/nin/ + * @method nin + * @memberOf Query + * @instance + * @param {string} [path] + * @param {Array} val + * @api public + */ + +/** + * Specifies an `$all` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * #### Example: + * + * MyModel.find().where('pets').all(['dog', 'cat', 'ferret']); + * // Equivalent: + * MyModel.find().all('pets', ['dog', 'cat', 'ferret']); + * + * @see $all https://www.mongodb.com/docs/manual/reference/operator/all/ + * @method all + * @memberOf Query + * @instance + * @param {string} [path] + * @param {Array} val + * @api public + */ + +/** + * Specifies a `$size` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * #### Example: + * + * const docs = await MyModel.where('tags').size(0).exec(); + * assert(Array.isArray(docs)); + * console.log('documents with 0 tags', docs); + * + * @see $size https://www.mongodb.com/docs/manual/reference/operator/size/ + * @method size + * @memberOf Query + * @instance + * @param {string} [path] + * @param {number} val + * @api public + */ + +/** + * Specifies a `$regex` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $regex https://www.mongodb.com/docs/manual/reference/operator/regex/ + * @method regex + * @memberOf Query + * @instance + * @param {string} [path] + * @param {string|RegExp} val + * @api public + */ + +/** + * Specifies a `maxDistance` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $maxDistance https://www.mongodb.com/docs/manual/reference/operator/maxDistance/ + * @method maxDistance + * @memberOf Query + * @instance + * @param {string} [path] + * @param {number} val + * @api public + */ + +/** + * Specifies a `$mod` condition, filters documents for documents whose + * `path` property is a number that is equal to `remainder` modulo `divisor`. + * + * #### Example: + * + * // All find products whose inventory is odd + * Product.find().mod('inventory', [2, 1]); + * Product.find().where('inventory').mod([2, 1]); + * // This syntax is a little strange, but supported. + * Product.find().where('inventory').mod(2, 1); + * + * @method mod + * @memberOf Query + * @instance + * @param {string} [path] + * @param {Array} val must be of length 2, first element is `divisor`, 2nd element is `remainder`. + * @return {Query} this + * @see $mod https://www.mongodb.com/docs/manual/reference/operator/mod/ + * @api public + */ + +Query.prototype.mod = function() { + let val; + let path; + + if (arguments.length === 1) { + this._ensurePath('mod'); + val = arguments[0]; + path = this._path; + } else if (arguments.length === 2 && !Array.isArray(arguments[1])) { + this._ensurePath('mod'); + val = [arguments[0], arguments[1]]; + path = this._path; + } else if (arguments.length === 3) { + val = [arguments[1], arguments[2]]; + path = arguments[0]; + } else { + val = arguments[1]; + path = arguments[0]; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$mod = val; + return this; +}; + +/** + * Specifies an `$exists` condition + * + * #### Example: + * + * // { name: { $exists: true }} + * Thing.where('name').exists() + * Thing.where('name').exists(true) + * Thing.find().exists('name') + * + * // { name: { $exists: false }} + * Thing.where('name').exists(false); + * Thing.find().exists('name', false); + * + * @method exists + * @memberOf Query + * @instance + * @param {string} [path] + * @param {boolean} val + * @return {Query} this + * @see $exists https://www.mongodb.com/docs/manual/reference/operator/exists/ + * @api public + */ + +/** + * Specifies an `$elemMatch` condition + * + * #### Example: + * + * query.elemMatch('comment', { author: 'autobot', votes: {$gte: 5}}) + * + * query.where('comment').elemMatch({ author: 'autobot', votes: {$gte: 5}}) + * + * query.elemMatch('comment', function (elem) { + * elem.where('author').equals('autobot'); + * elem.where('votes').gte(5); + * }) + * + * query.where('comment').elemMatch(function (elem) { + * elem.where({ author: 'autobot' }); + * elem.where('votes').gte(5); + * }) + * + * @method elemMatch + * @memberOf Query + * @instance + * @param {string|object|Function} path + * @param {object|Function} filter + * @return {Query} this + * @see $elemMatch https://www.mongodb.com/docs/manual/reference/operator/elemMatch/ + * @api public + */ + +/** + * Defines a `$within` or `$geoWithin` argument for geo-spatial queries. + * + * #### Example: + * + * query.where(path).within().box() + * query.where(path).within().circle() + * query.where(path).within().geometry() + * + * query.where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); + * query.where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); + * query.where('loc').within({ polygon: [[],[],[],[]] }); + * + * query.where('loc').within([], [], []) // polygon + * query.where('loc').within([], []) // box + * query.where('loc').within({ type: 'LineString', coordinates: [...] }); // geometry + * + * **MUST** be used after `where()`. + * + * #### Note: + * + * As of Mongoose 3.7, `$geoWithin` is always used for queries. To change this behavior, see [Query.use$geoWithin](https://mongoosejs.com/docs/api/query.html#Query.prototype.use$geoWithin). + * + * #### Note: + * + * In Mongoose 3.7, `within` changed from a getter to a function. If you need the old syntax, use [this](https://github.com/ebensing/mongoose-within). + * + * @method within + * @see $polygon https://www.mongodb.com/docs/manual/reference/operator/polygon/ + * @see $box https://www.mongodb.com/docs/manual/reference/operator/box/ + * @see $geometry https://www.mongodb.com/docs/manual/reference/operator/geometry/ + * @see $center https://www.mongodb.com/docs/manual/reference/operator/center/ + * @see $centerSphere https://www.mongodb.com/docs/manual/reference/operator/centerSphere/ + * @memberOf Query + * @instance + * @return {Query} this + * @api public + */ + +/** + * Specifies the maximum number of documents the query will return. + * + * #### Example: + * + * query.limit(20); + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method limit + * @memberOf Query + * @instance + * @param {number} val + * @api public + */ + +Query.prototype.limit = function limit(v) { + this._validate('limit'); + + if (typeof v === 'string') { + try { + v = castNumber(v); + } catch { + throw new CastError('Number', v, 'limit'); + } + } + + this.options.limit = v; + return this; +}; + +/** + * Specifies the number of documents to skip. + * + * #### Example: + * + * query.skip(100).limit(20); + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method skip + * @memberOf Query + * @instance + * @param {number} val + * @see cursor.skip https://www.mongodb.com/docs/manual/reference/method/cursor.skip/ + * @api public + */ + +Query.prototype.skip = function skip(v) { + this._validate('skip'); + + if (typeof v === 'string') { + try { + v = castNumber(v); + } catch { + throw new CastError('Number', v, 'skip'); + } + } + + this.options.skip = v; + return this; +}; + +/** + * Specifies the batchSize option. + * + * #### Example: + * + * query.batchSize(100) + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method batchSize + * @memberOf Query + * @instance + * @param {number} val + * @see batchSize https://www.mongodb.com/docs/manual/reference/method/cursor.batchSize/ + * @api public + */ + +/** + * Specifies the `comment` option. + * + * #### Example: + * + * query.comment('login query') + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method comment + * @memberOf Query + * @instance + * @param {string} val + * @see comment https://www.mongodb.com/docs/manual/reference/operator/comment/ + * @api public + */ + +/** + * Sets query hints. + * + * #### Example: + * + * query.hint({ indexA: 1, indexB: -1 }); + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method hint + * @memberOf Query + * @instance + * @param {object} val a hint object + * @return {Query} this + * @see $hint https://www.mongodb.com/docs/manual/reference/operator/hint/ + * @api public + */ + +/** + * Get/set the current projection (AKA fields). Pass `null` to remove the + * current projection. + * + * Unlike `projection()`, the `select()` function modifies the current + * projection in place. This function overwrites the existing projection. + * + * #### Example: + * + * const q = Model.find(); + * q.projection(); // null + * + * q.select('a b'); + * q.projection(); // { a: 1, b: 1 } + * + * q.projection({ c: 1 }); + * q.projection(); // { c: 1 } + * + * q.projection(null); + * q.projection(); // null + * + * + * @method projection + * @memberOf Query + * @instance + * @param {object|null} arg + * @return {object} the current projection + * @api public + */ + +Query.prototype.projection = function(arg) { + if (arguments.length === 0) { + return this._fields; + } + + this._fields = {}; + this._userProvidedFields = {}; + this.select(arg); + return this._fields; +}; + +/** + * Specifies which document fields to include or exclude (also known as the query "projection") + * + * When using string syntax, prefixing a path with `-` will flag that path as excluded. When a path does not have the `-` prefix, it is included. Lastly, if a path is prefixed with `+`, it forces inclusion of the path, which is useful for paths excluded at the [schema level](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.select()). + * + * A projection _must_ be either inclusive or exclusive. In other words, you must + * either list the fields to include (which excludes all others), or list the fields + * to exclude (which implies all other fields are included). The [`_id` field is the only exception because MongoDB includes it by default](https://www.mongodb.com/docs/manual/tutorial/project-fields-from-query-results/#suppress-id-field). + * + * #### Example: + * + * // include a and b, exclude other fields + * query.select('a b'); + * // Equivalent syntaxes: + * query.select(['a', 'b']); + * query.select({ a: 1, b: 1 }); + * + * // exclude c and d, include other fields + * query.select('-c -d'); + * + * // Use `+` to override schema-level `select: false` without making the + * // projection inclusive. + * const schema = new Schema({ + * foo: { type: String, select: false }, + * bar: String + * }); + * // ... + * query.select('+foo'); // Override foo's `select: false` without excluding `bar` + * + * // or you may use object notation, useful when + * // you have keys already prefixed with a "-" + * query.select({ a: 1, b: 1 }); + * query.select({ c: 0, d: 0 }); + * + * Additional calls to select can override the previous selection: + * query.select({ a: 1, b: 1 }).select({ b: 0 }); // selection is now { a: 1 } + * query.select({ a: 0, b: 0 }).select({ b: 1 }); // selection is now { a: 0 } + * + * + * @method select + * @memberOf Query + * @instance + * @param {object|string|Array} arg + * @return {Query} this + * @see SchemaType https://mongoosejs.com/docs/api/schematype.html + * @api public + */ + +Query.prototype.select = function select() { + let arg = arguments[0]; + if (!arg) return this; + + if (arguments.length !== 1) { + throw new MongooseError('Invalid select: select only takes 1 argument'); + } + + this._validate('select'); + + const fields = this._fields || (this._fields = {}); + const userProvidedFields = this._userProvidedFields || (this._userProvidedFields = {}); + let sanitizeProjection = undefined; + if (this.model != null && utils.hasUserDefinedProperty(this.model.db.options, 'sanitizeProjection')) { + sanitizeProjection = this.model.db.options.sanitizeProjection; + } else if (this.model != null && utils.hasUserDefinedProperty(this.model.base.options, 'sanitizeProjection')) { + sanitizeProjection = this.model.base.options.sanitizeProjection; + } else { + sanitizeProjection = this._mongooseOptions.sanitizeProjection; + } + + function sanitizeValue(value) { + return typeof value === 'string' && sanitizeProjection ? value = 1 : value; + } + arg = parseProjection(arg, true); // we want to keep the minus and pluses, so add boolean arg. + if (utils.isObject(arg)) { + if (this.selectedInclusively()) { + Object.entries(arg).forEach(([key, value]) => { + if (value) { + // Add the field to the projection + if (fields['-' + key] != null) { + delete fields['-' + key]; + } + fields[key] = userProvidedFields[key] = sanitizeValue(value); + } else { + // Remove the field from the projection + Object.keys(userProvidedFields).forEach(field => { + if (isSubpath(key, field)) { + delete fields[field]; + delete userProvidedFields[field]; + } + }); + } + }); + } else if (this.selectedExclusively()) { + Object.entries(arg).forEach(([key, value]) => { + if (!value) { + // Add the field to the projection + if (fields['+' + key] != null) { + delete fields['+' + key]; + } + fields[key] = userProvidedFields[key] = sanitizeValue(value); + } else { + // Remove the field from the projection + Object.keys(userProvidedFields).forEach(field => { + if (isSubpath(key, field)) { + delete fields[field]; + delete userProvidedFields[field]; + } + }); + } + }); + } else { + const keys = Object.keys(arg); + for (let i = 0; i < keys.length; ++i) { + const value = arg[keys[i]]; + const key = keys[i]; + fields[key] = sanitizeValue(value); + userProvidedFields[key] = sanitizeValue(value); + } + } + + return this; + } + + throw new TypeError('Invalid select() argument. Must be string or object.'); +}; + +/** + * Enable or disable schema level projections for this query. Enabled by default. + * Set to `false` to include fields with `select: false` in the query result by default. + * + * #### Example: + * + * const userSchema = new Schema({ + * email: { type: String, required: true }, + * passwordHash: { type: String, select: false, required: true } + * }); + * const UserModel = mongoose.model('User', userSchema); + * + * const doc = await UserModel.findOne().orFail().schemaLevelProjections(false); + * + * // Contains password hash, because `schemaLevelProjections()` overrides `select: false` + * doc.passwordHash; + * + * @method schemaLevelProjections + * @memberOf Query + * @instance + * @param {boolean} value + * @return {Query} this + * @see SchemaTypeOptions https://mongoosejs.com/docs/schematypes.html#all-schema-types + * @api public + */ + +Query.prototype.schemaLevelProjections = function schemaLevelProjections(value) { + this._mongooseOptions.schemaLevelProjections = value; + + return this; +}; + +/** + * Sets this query's `sanitizeProjection` option. If set, `sanitizeProjection` does + * two things: + * + * 1. Enforces that projection values are numbers, not strings. + * 2. Prevents using `+` syntax to override properties that are deselected by default. + * + * With `sanitizeProjection()`, you can pass potentially untrusted user data to `.select()`. + * + * #### Example + * + * const userSchema = new Schema({ + * name: String, + * password: { type: String, select: false } + * }); + * const UserModel = mongoose.model('User', userSchema); + * const { _id } = await UserModel.create({ name: 'John', password: 'secret' }) + * + * // The MongoDB server has special handling for string values that start with '$' + * // in projections, which can lead to unexpected leaking of sensitive data. + * let doc = await UserModel.findOne().select({ name: '$password' }); + * doc.name; // 'secret' + * doc.password; // undefined + * + * // With `sanitizeProjection`, Mongoose forces all projection values to be numbers + * doc = await UserModel.findOne().sanitizeProjection(true).select({ name: '$password' }); + * doc.name; // 'John' + * doc.password; // undefined + * + * // By default, Mongoose supports projecting in `password` using `+password` + * doc = await UserModel.findOne().select('+password'); + * doc.password; // 'secret' + * + * // With `sanitizeProjection`, Mongoose prevents projecting in `password` and other + * // fields that have `select: false` in the schema. + * doc = await UserModel.findOne().sanitizeProjection(true).select('+password'); + * doc.password; // undefined + * + * @method sanitizeProjection + * @memberOf Query + * @instance + * @param {boolean} value + * @return {Query} this + * @see sanitizeProjection https://thecodebarbarian.com/whats-new-in-mongoose-5-13-sanitizeprojection.html + * @api public + */ + +Query.prototype.sanitizeProjection = function sanitizeProjection(value) { + this._mongooseOptions.sanitizeProjection = value; + + return this; +}; + +/** + * Determines the MongoDB nodes from which to read. + * + * #### Preferences: + * + * ``` + * primary - (default) Read from primary only. Operations will produce an error if primary is unavailable. Cannot be combined with tags. + * secondary Read from secondary if available, otherwise error. + * primaryPreferred Read from primary if available, otherwise a secondary. + * secondaryPreferred Read from a secondary if available, otherwise read from the primary. + * nearest All operations read from among the nearest candidates, but unlike other modes, this option will include both the primary and all secondaries in the random selection. + * ``` + * + * Aliases + * + * ``` + * p primary + * pp primaryPreferred + * s secondary + * sp secondaryPreferred + * n nearest + * ``` + * + * #### Example: + * + * new Query().read('primary') + * new Query().read('p') // same as primary + * + * new Query().read('primaryPreferred') + * new Query().read('pp') // same as primaryPreferred + * + * new Query().read('secondary') + * new Query().read('s') // same as secondary + * + * new Query().read('secondaryPreferred') + * new Query().read('sp') // same as secondaryPreferred + * + * new Query().read('nearest') + * new Query().read('n') // same as nearest + * + * // read from secondaries with matching tags + * new Query().read('s', [{ dc:'sf', s: 1 },{ dc:'ma', s: 2 }]) + * + * Read more about how to use read preferences [here](https://www.mongodb.com/docs/manual/applications/replication/#read-preference). + * + * @method read + * @memberOf Query + * @instance + * @param {string} mode one of the listed preference options or aliases + * @param {Array} [tags] optional tags for this query + * @see mongodb https://www.mongodb.com/docs/manual/applications/replication/#read-preference + * @return {Query} this + * @api public + */ + +Query.prototype.read = function read(mode, tags) { + if (typeof mode === 'string') { + mode = handleReadPreferenceAliases(mode); + this.options.readPreference = { mode, tags }; + } else { + this.options.readPreference = mode; + } + return this; +}; + +/** + * Overwrite default `.toString` to make logging more useful + * + * @memberOf Query + * @instance + * @method toString + * @api private + */ + +Query.prototype.toString = function toString() { + if (this.op === 'count' || + this.op === 'countDocuments' || + this.op === 'find' || + this.op === 'findOne' || + this.op === 'deleteMany' || + this.op === 'deleteOne' || + this.op === 'findOneAndDelete' || + this.op === 'remove') { + return `${this.model.modelName}.${this.op}(${util.inspect(this._conditions)})`; + } + if (this.op === 'distinct') { + return `${this.model.modelName}.distinct('${this._distinct}', ${util.inspect(this._conditions)})`; + } + if (this.op === 'findOneAndReplace' || + this.op === 'findOneAndUpdate' || + this.op === 'replaceOne' || + this.op === 'update' || + this.op === 'updateMany' || + this.op === 'updateOne') { + return `${this.model.modelName}.${this.op}(${util.inspect(this._conditions)}, ${util.inspect(this[queryUpdateSymbol])})`; + } + + // 'estimatedDocumentCount' or any others + return `${this.model.modelName}.${this.op}()`; +}; + +/** + * Sets the [MongoDB session](https://www.mongodb.com/docs/manual/reference/server-sessions/) + * associated with this query. Sessions are how you mark a query as part of a + * [transaction](https://mongoosejs.com/docs/transactions.html). + * + * Calling `session(null)` removes the session from this query. + * + * #### Example: + * + * const s = await mongoose.startSession(); + * await mongoose.model('Person').findOne({ name: 'Axl Rose' }).session(s); + * + * @method session + * @memberOf Query + * @instance + * @param {ClientSession} [session] from `await conn.startSession()` + * @see Connection.prototype.startSession() https://mongoosejs.com/docs/api/connection.html#Connection.prototype.startSession() + * @see mongoose.startSession() https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.startSession() + * @return {Query} this + * @api public + */ + +Query.prototype.session = function session(v) { + if (v == null) { + delete this.options.session; + } + this.options.session = v; + return this; +}; + +/** + * Sets the 3 write concern parameters for this query: + * + * - `w`: Sets the specified number of `mongod` servers, or tag set of `mongod` servers, that must acknowledge this write before this write is considered successful. + * - `j`: Boolean, set to `true` to request acknowledgement that this operation has been persisted to MongoDB's on-disk journal. + * - `wtimeout`: If [`w > 1`](https://mongoosejs.com/docs/api/query.html#Query.prototype.w()), the maximum amount of time to wait for this write to propagate through the replica set before this operation fails. The default is `0`, which means no timeout. + * + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * + * #### Example: + * + * // The 'majority' option means the `deleteOne()` promise won't resolve + * // until the `deleteOne()` has propagated to the majority of the replica set + * await mongoose.model('Person'). + * deleteOne({ name: 'Ned Stark' }). + * writeConcern({ w: 'majority' }); + * + * @method writeConcern + * @memberOf Query + * @instance + * @param {object} writeConcern the write concern value to set + * @see WriteConcernSettings https://mongodb.github.io/node-mongodb-native/7.0/interfaces/WriteConcernSettings.html + * @return {Query} this + * @api public + */ + +Query.prototype.writeConcern = function writeConcern(val) { + if (val == null) { + delete this.options.writeConcern; + return this; + } + this.options.writeConcern = val; + return this; +}; + +/** + * Sets the specified number of `mongod` servers, or tag set of `mongod` servers, + * that must acknowledge this write before this write is considered successful. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern.w` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * + * #### Example: + * + * // The 'majority' option means the `deleteOne()` promise won't resolve + * // until the `deleteOne()` has propagated to the majority of the replica set + * await mongoose.model('Person'). + * deleteOne({ name: 'Ned Stark' }). + * w('majority'); + * + * @method w + * @memberOf Query + * @instance + * @param {string|number} val 0 for fire-and-forget, 1 for acknowledged by one server, 'majority' for majority of the replica set, or [any of the more advanced options](https://www.mongodb.com/docs/manual/reference/write-concern/#w-option). + * @see mongodb https://www.mongodb.com/docs/manual/reference/write-concern/#w-option + * @return {Query} this + * @api public + */ + +Query.prototype.w = function w(val) { + if (val == null) { + delete this.options.w; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.w = val; + } else { + this.options.w = val; + } + return this; +}; + +/** + * Requests acknowledgement that this operation has been persisted to MongoDB's + * on-disk journal. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern.j` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * + * #### Example: + * + * await mongoose.model('Person').deleteOne({ name: 'Ned Stark' }).j(true); + * + * @method j + * @memberOf Query + * @instance + * @param {boolean} val + * @see mongodb https://www.mongodb.com/docs/manual/reference/write-concern/#j-option + * @return {Query} this + * @api public + */ + +Query.prototype.j = function j(val) { + if (val == null) { + delete this.options.j; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.j = val; + } else { + this.options.j = val; + } + return this; +}; + +/** + * If [`w > 1`](https://mongoosejs.com/docs/api/query.html#Query.prototype.w()), the maximum amount of time to + * wait for this write to propagate through the replica set before this + * operation fails. The default is `0`, which means no timeout. + * + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern.wtimeout` option](https://mongoosejs.com/docs/guide.html#writeConcern) + * + * #### Example: + * + * // The `deleteOne()` promise won't resolve until this `deleteOne()` has + * // propagated to at least `w = 2` members of the replica set. If it takes + * // longer than 1 second, this `deleteOne()` will fail. + * await mongoose.model('Person'). + * deleteOne({ name: 'Ned Stark' }). + * w(2). + * wtimeout(1000); + * + * @method wtimeout + * @memberOf Query + * @instance + * @param {number} ms number of milliseconds to wait + * @see mongodb https://www.mongodb.com/docs/manual/reference/write-concern/#wtimeout + * @return {Query} this + * @api public + */ + +Query.prototype.wtimeout = function wtimeout(ms) { + if (ms == null) { + delete this.options.wtimeout; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.wtimeout = ms; + } else { + this.options.wtimeout = ms; + } + return this; +}; + +/** + * Sets the readConcern option for the query. + * + * #### Example: + * + * new Query().readConcern('local') + * new Query().readConcern('l') // same as local + * + * new Query().readConcern('available') + * new Query().readConcern('a') // same as available + * + * new Query().readConcern('majority') + * new Query().readConcern('m') // same as majority + * + * new Query().readConcern('linearizable') + * new Query().readConcern('lz') // same as linearizable + * + * new Query().readConcern('snapshot') + * new Query().readConcern('s') // same as snapshot + * + * + * #### Read Concern Level: + * + * ``` + * local MongoDB 3.2+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * available MongoDB 3.6+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * majority MongoDB 3.2+ The query returns the data that has been acknowledged by a majority of the replica set members. The documents returned by the read operation are durable, even in the event of failure. + * linearizable MongoDB 3.4+ The query returns data that reflects all successful majority-acknowledged writes that completed prior to the start of the read operation. The query may wait for concurrently executing writes to propagate to a majority of replica set members before returning results. + * snapshot MongoDB 4.0+ Only available for operations within multi-document transactions. Upon transaction commit with write concern "majority", the transaction operations are guaranteed to have read from a snapshot of majority-committed data. + * ``` + * + * Aliases + * + * ``` + * l local + * a available + * m majority + * lz linearizable + * s snapshot + * ``` + * + * Read more about how to use read concern [here](https://www.mongodb.com/docs/manual/reference/read-concern/). + * + * @memberOf Query + * @method readConcern + * @param {'local'|'available'|'majority'|'snapshot'|'linearizable'|'l'|'a'|'m'|'s'|'lz'} level one of the listed read concern level or their aliases + * @see mongodb https://www.mongodb.com/docs/manual/reference/read-concern/ + * @return {Query} this + * @api public + */ + +/** + * Gets query options. + * + * #### Example: + * + * const query = new Query(); + * query.limit(10); + * query.setOptions({ maxTimeMS: 1000 }); + * query.getOptions(); // { limit: 10, maxTimeMS: 1000 } + * + * @return {object} the options + * @api public + */ + +Query.prototype.getOptions = function() { + return this.options; +}; + +/** + * Sets query options. Some options only make sense for certain operations. + * + * #### Options: + * + * The following options are only for `find()`: + * + * - [tailable](https://www.mongodb.com/docs/manual/core/tailable-cursors/) + * - [limit](https://www.mongodb.com/docs/manual/reference/method/cursor.limit/) + * - [skip](https://www.mongodb.com/docs/manual/reference/method/cursor.skip/) + * - [allowDiskUse](https://www.mongodb.com/docs/manual/reference/method/cursor.allowDiskUse/) + * - [batchSize](https://www.mongodb.com/docs/manual/reference/method/cursor.batchSize/) + * - [readPreference](https://www.mongodb.com/docs/manual/applications/replication/#read-preference) + * - [hint](https://www.mongodb.com/docs/manual/reference/method/cursor.hint/) + * - [comment](https://www.mongodb.com/docs/manual/reference/method/cursor.comment/) + * + * The following options are only for write operations: `updateOne()`, `updateMany()`, `replaceOne()`, `findOneAndUpdate()`, and `findByIdAndUpdate()`: + * + * - [upsert](https://www.mongodb.com/docs/manual/reference/method/db.collection.update/) + * - [writeConcern](https://www.mongodb.com/docs/manual/reference/method/db.collection.update/) + * - [timestamps](https://mongoosejs.com/docs/guide.html#timestamps): If `timestamps` is set in the schema, set this option to `false` to skip timestamps for that particular update. Has no effect if `timestamps` is not enabled in the schema options. + * - cloneUpdate: set to `false` to skip cloning the update before executing the query. + * - overwriteDiscriminatorKey: allow setting the discriminator key in the update. Will use the correct discriminator schema if the update changes the discriminator key. + * - overwriteImmutable: allow overwriting properties that are set to `immutable` in the schema. Defaults to false. + * + * The following options are only for `find()`, `findOne()`, `findById()`, `findOneAndUpdate()`, `findOneAndReplace()`, `findOneAndDelete()`, and `findByIdAndUpdate()`: + * + * - [lean](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) + * - [populate](https://mongoosejs.com/docs/populate.html) + * - [projection](https://mongoosejs.com/docs/api/query.html#Query.prototype.projection()) + * - sanitizeProjection + * - useBigInt64 + * - defaults: if `false`, skip applying default values to the returned document(s). Defaults to true. + * + * The following options are only for all operations **except** `updateOne()`, `updateMany()`, `deleteOne()`, and `deleteMany()`: + * + * - [maxTimeMS](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) + * + * The following options are for `find()`, `findOne()`, `findOneAndUpdate()`, `findOneAndDelete()`, `updateOne()`, and `deleteOne()`: + * + * - [sort](https://www.mongodb.com/docs/manual/reference/method/cursor.sort/) + * + * The following options are for `findOneAndUpdate()` and `findOneAndDelete()` + * + * - includeResultMetadata + * + * The following options are for all operations: + * + * - [strict](https://mongoosejs.com/docs/guide.html#strict) + * - [collation](https://www.mongodb.com/docs/manual/reference/collation/) + * - [session](https://www.mongodb.com/docs/manual/reference/server-sessions/) + * - [explain](https://www.mongodb.com/docs/manual/reference/method/cursor.explain/) + * - [middleware](https://mongoosejs.com/docs/middleware.html#skipping): set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks + * + * @param {object} options + * @return {Query} this + * @api public + */ + +Query.prototype.setOptions = function(options, overwrite) { + // overwrite is only for internal use + if (overwrite) { + // ensure that _mongooseOptions & options are two different objects + this._mongooseOptions = (options && clone(options)) || {}; + this.options = options || {}; + + if ('populate' in options) { + this.populate(this._mongooseOptions); + } + return this; + } + if (options == null) { + return this; + } + if (typeof options !== 'object') { + throw new MongooseError('Options must be an object, got "' + options + '"'); + } + + options = Object.assign({}, options); + + if (Array.isArray(options.populate)) { + const populate = options.populate; + delete options.populate; + const _numPopulate = populate.length; + for (let i = 0; i < _numPopulate; ++i) { + this.populate(populate[i]); + } + } + + if ('cloneUpdate' in options) { + this._mongooseOptions.cloneUpdate = options.cloneUpdate; + delete options.cloneUpdate; + } + if ('defaults' in options) { + this._mongooseOptions.defaults = options.defaults; + // deleting options.defaults will cause 7287 to fail + } + if (options.lean == null && this.schema && 'lean' in this.schema.options) { + this._mongooseOptions.lean = this.schema.options.lean; + } + if ('overwriteDiscriminatorKey' in options) { + this._mongooseOptions.overwriteDiscriminatorKey = options.overwriteDiscriminatorKey; + delete options.overwriteDiscriminatorKey; + } + if ('overwriteImmutable' in options) { + this._mongooseOptions.overwriteImmutable = options.overwriteImmutable; + delete options.overwriteImmutable; + } + if ('sanitizeFilter' in options) { + this._mongooseOptions.sanitizeFilter = options.sanitizeFilter; + delete options.sanitizeFilter; + } + if ('sanitizeProjection' in options) { + if (options.sanitizeProjection && !this._mongooseOptions.sanitizeProjection) { + sanitizeProjection(this._fields); + } + + this._mongooseOptions.sanitizeProjection = options.sanitizeProjection; + delete options.sanitizeProjection; + } + if ('schemaLevelProjections' in options) { + this._mongooseOptions.schemaLevelProjections = options.schemaLevelProjections; + delete options.schemaLevelProjections; + } + if ('setDefaultsOnInsert' in options) { + this._mongooseOptions.setDefaultsOnInsert = options.setDefaultsOnInsert; + delete options.setDefaultsOnInsert; + } + if ('strict' in options) { + this._mongooseOptions.strict = options.strict; + delete options.strict; + } + if ('strictQuery' in options) { + this._mongooseOptions.strictQuery = options.strictQuery; + delete options.strictQuery; + } + if ('timestamps' in options) { + this._mongooseOptions.timestamps = options.timestamps; + delete options.timestamps; + } + if ('translateAliases' in options) { + this._mongooseOptions.translateAliases = options.translateAliases; + delete options.translateAliases; + } + if ('updatePipeline' in options) { + this._mongooseOptions.updatePipeline = options.updatePipeline; + delete options.updatePipeline; + } + + if (typeof options.limit === 'string') { + try { + options.limit = castNumber(options.limit); + } catch { + throw new CastError('Number', options.limit, 'limit'); + } + } + if (typeof options.skip === 'string') { + try { + options.skip = castNumber(options.skip); + } catch { + throw new CastError('Number', options.skip, 'skip'); + } + } + + // set arbitrary options + for (const key of Object.keys(options)) { + if (queryOptionMethods.has(key)) { + const args = Array.isArray(options[key]) ? + options[key] : + [options[key]]; + this[key].apply(this, args); + } else { + this.options[key] = options[key]; + } + } + + return this; +}; + +/** + * Sets the [`explain` option](https://www.mongodb.com/docs/manual/reference/method/cursor.explain/), + * which makes this query return detailed execution stats instead of the actual + * query result. This method is useful for determining what index your queries + * use. + * + * Calling `query.explain(v)` is equivalent to `query.setOptions({ explain: v })` + * + * #### Example: + * + * const query = new Query(); + * const res = await query.find({ a: 1 }).explain('queryPlanner'); + * console.log(res); + * + * @param {'queryPlanner'|'executionStats'|'allPlansExecution'} [verbose] The verbosity mode. The default is 'queryPlanner' + * @return {Query} this + * @api public + */ + +Query.prototype.explain = function explain(verbose) { + if (arguments.length === 0) { + this.options.explain = true; + } else if (verbose === false) { + delete this.options.explain; + } else { + this.options.explain = verbose; + } + return this; +}; + +/** + * Sets the [`allowDiskUse` option](https://www.mongodb.com/docs/manual/reference/method/cursor.allowDiskUse/), + * which allows the MongoDB server to use more than 100 MB for this query's `sort()`. This option can + * let you work around `QueryExceededMemoryLimitNoDiskUseAllowed` errors from the MongoDB server. + * + * Note that this option requires MongoDB server >= 4.4. Setting this option is a no-op for MongoDB 4.2 + * and earlier. + * + * Calling `query.allowDiskUse(v)` is equivalent to `query.setOptions({ allowDiskUse: v })` + * + * #### Example: + * + * await query.find().sort({ name: 1 }).allowDiskUse(true); + * // Equivalent: + * await query.find().sort({ name: 1 }).allowDiskUse(); + * + * @param {boolean} [v] Enable/disable `allowDiskUse`. If called with 0 arguments, sets `allowDiskUse: true` + * @return {Query} this + * @api public + */ + +Query.prototype.allowDiskUse = function(v) { + if (arguments.length === 0) { + this.options.allowDiskUse = true; + } else if (v === false) { + delete this.options.allowDiskUse; + } else { + this.options.allowDiskUse = v; + } + return this; +}; + +/** + * Sets the [maxTimeMS](https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/) + * option. This will tell the MongoDB server to abort if the query or write op + * has been running for more than `ms` milliseconds. + * + * Calling `query.maxTimeMS(v)` is equivalent to `query.setOptions({ maxTimeMS: v })` + * + * #### Example: + * + * const query = new Query(); + * // Throws an error 'operation exceeded time limit' as long as there's + * // >= 1 doc in the queried collection + * const res = await query.find({ $where: 'sleep(1000) || true' }).maxTimeMS(100); + * + * @param {number} [ms] The number of milliseconds + * @return {Query} this + * @api public + */ + +Query.prototype.maxTimeMS = function(ms) { + this.options.maxTimeMS = ms; + return this; +}; + +/** + * Returns the current query filter (also known as conditions) as a [POJO](https://masteringjs.io/tutorials/fundamentals/pojo). + * + * #### Example: + * + * const query = new Query(); + * query.find({ a: 1 }).where('b').gt(2); + * query.getFilter(); // { a: 1, b: { $gt: 2 } } + * + * @return {object} current query filter + * @api public + */ + +Query.prototype.getFilter = function() { + return this._conditions; +}; + +/** + * Returns the current query filter. Equivalent to `getFilter()`. + * + * You should use `getFilter()` instead of `getQuery()` where possible. `getQuery()` + * will likely be deprecated in a future release. + * + * #### Example: + * + * const query = new Query(); + * query.find({ a: 1 }).where('b').gt(2); + * query.getQuery(); // { a: 1, b: { $gt: 2 } } + * + * @return {object} current query filter + * @api public + */ + +Query.prototype.getQuery = function() { + return this._conditions; +}; + +/** + * Sets the query conditions to the provided JSON object. + * + * #### Example: + * + * const query = new Query(); + * query.find({ a: 1 }) + * query.setQuery({ a: 2 }); + * query.getQuery(); // { a: 2 } + * + * @param {object} new query conditions + * @return {undefined} + * @api public + */ + +Query.prototype.setQuery = function(val) { + this._conditions = val; +}; + +/** + * Returns the current update operations as a JSON object. + * + * #### Example: + * + * const query = new Query(); + * query.updateOne({}, { $set: { a: 5 } }); + * query.getUpdate(); // { $set: { a: 5 } } + * + * @return {object} current update operations + * @api public + */ + +Query.prototype.getUpdate = function() { + return this._update; +}; + +/** + * Sets the current update operation to new value. + * + * #### Example: + * + * const query = new Query(); + * query.updateOne({}, { $set: { a: 5 } }); + * query.setUpdate({ $set: { b: 6 } }); + * query.getUpdate(); // { $set: { b: 6 } } + * + * @param {object} new update operation + * @param {boolean} [cloneUpdate=true] if `false`, Mongoose will not clone the update + * @return {undefined} + * @api public + */ + +Query.prototype.setUpdate = function(val, cloneUpdate) { + this[queryUpdateSymbol] = cloneUpdate === false ? val : clone(val); + if (cloneUpdate != null) { + this._mongooseOptions.cloneUpdate = cloneUpdate; + } + this._updateIsShared = false; +}; + +/** + * Returns fields selection for this query. + * + * @method _fieldsForExec + * @return {object} + * @api private + * @memberOf Query + */ + +Query.prototype._fieldsForExec = function() { + if (this._fields == null) { + return null; + } + if (utils.hasOwnKeys(this._fields) === false) { + return null; + } + return clone(this._fields); +}; + + +/** + * Return an update document with corrected `$set` operations. + * + * @method _updateForExec + * @return {object} + * @api private + * @memberOf Query + */ + +Query.prototype._updateForExec = function() { + const update = clone(this[queryUpdateSymbol], { + transform: false, + depopulate: true + }); + const ops = Object.keys(update); + let i = ops.length; + const ret = {}; + + while (i--) { + const op = ops[i]; + + if ('$' !== op[0]) { + // fix up $set sugar + if (!ret.$set) { + if (update.$set) { + ret.$set = update.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op] = update[op]; + ops.splice(i, 1); + if (!~ops.indexOf('$set')) ops.push('$set'); + } else if ('$set' === op) { + if (!ret.$set) { + ret[op] = update[op]; + } + } else { + ret[op] = update[op]; + } + } + + return ret; +}; + +/** + * Makes sure _path is set. + * + * This method is inherited by `mquery` + * + * @method _ensurePath + * @param {string} method + * @api private + * @memberOf Query + */ + +/** + * Determines if `conds` can be merged using `mquery().merge()` + * + * @method canMerge + * @memberOf Query + * @instance + * @param {object} conds + * @return {boolean} + * @api private + */ + +/** + * Returns default options for this query. + * + * @param {Model} model + * @api private + */ + +Query.prototype._optionsForExec = function(model) { + const options = clone(this.options); + delete options.populate; + model = model || this.model; + + if (!model) { + return options; + } + applyReadConcern(model.schema, options); + // Apply schema-level `writeConcern` option + applyWriteConcern(model.schema, options); + + const asyncLocalStorage = this.model?.db?.base.transactionAsyncLocalStorage?.getStore(); + if (!Object.hasOwn(this.options, 'session') && asyncLocalStorage?.session != null) { + options.session = asyncLocalStorage.session; + } + + const readPreference = model?.schema?.options?.read; + if (!('readPreference' in options) && readPreference) { + options.readPreference = readPreference; + } + + if (options.upsert !== void 0) { + options.upsert = !!options.upsert; + } + if (options.writeConcern) { + if (options.j) { + options.writeConcern.j = options.j; + delete options.j; + } + if (options.w) { + options.writeConcern.w = options.w; + delete options.w; + } + if (options.wtimeout) { + options.writeConcern.wtimeout = options.wtimeout; + delete options.wtimeout; + } + } + + this._applyPaths(); + if (this._fields != null) { + this._fields = this._castFields(this._fields); + const projection = this._fieldsForExec(); + if (projection != null) { + options.projection = projection; + } + } + + if (this._mongooseOptions.populate) { + if (options.readPreference) { + for (const pop of Object.values(this._mongooseOptions.populate)) { + if (pop.options?.readPreference === undefined) { + if (!pop.options) { + pop.options = {}; + } + pop.options.readPreference = options.readPreference; + } + } + } + if (options.readConcern) { + for (const pop of Object.values(this._mongooseOptions.populate)) { + if (pop.options?.readConcern === undefined) { + if (!pop.options) { + pop.options = {}; + } + pop.options.readConcern = options.readConcern; + } + } + } + } + + return options; +}; + +/** + * Sets the lean option. + * + * Documents returned from queries with the `lean` option enabled are plain + * javascript objects, not [Mongoose Documents](https://mongoosejs.com/docs/api/document.html). They have no + * `save` method, getters/setters, virtuals, or other Mongoose features. + * + * #### Example: + * + * new Query().lean() // true + * new Query().lean(true) + * new Query().lean(false) + * + * const docs = await Model.find().lean(); + * docs[0] instanceof mongoose.Document; // false + * + * [Lean is great for high-performance, read-only cases](https://mongoosejs.com/docs/tutorials/lean.html), + * especially when combined + * with [cursors](https://mongoosejs.com/docs/queries.html#streaming). + * + * If you need virtuals, getters/setters, or defaults with `lean()`, you need + * to use a plugin. See: + * + * - [mongoose-lean-virtuals](https://plugins.mongoosejs.io/plugins/lean-virtuals) + * - [mongoose-lean-getters](https://plugins.mongoosejs.io/plugins/lean-getters) + * - [mongoose-lean-defaults](https://www.npmjs.com/package/mongoose-lean-defaults) + * + * @param {boolean|object} bool defaults to true + * @return {Query} this + * @api public + */ + +Query.prototype.lean = function(v) { + this._mongooseOptions.lean = arguments.length ? v : true; + return this; +}; + +/** + * Adds a `$set` to this query's update without changing the operation. + * This is useful for query middleware so you can add an update regardless + * of whether you use `updateOne()`, `updateMany()`, `findOneAndUpdate()`, etc. + * + * #### Example: + * + * // Updates `{ $set: { updatedAt: new Date() } }` + * new Query().updateOne({}, {}).set('updatedAt', new Date()); + * new Query().updateMany({}, {}).set({ updatedAt: new Date() }); + * + * @param {string|object} path path or object of key/value pairs to set + * @param {any} [val] the value to set + * @return {Query} this + * @api public + */ + +Query.prototype.set = function(path, val) { + _cloneUpdateIfShared(this); + + if (typeof path === 'object') { + const keys = Object.keys(path); + for (const key of keys) { + this.set(key, path[key]); + } + return this; + } + + let update = this[queryUpdateSymbol]; + if (update == null) { + update = {}; + this[queryUpdateSymbol] = update; + } + if (path in update) { + delete update[path]; + } + update.$set = update.$set || {}; + update.$set[path] = val; + return this; +}; + +/** + * For update operations, returns the value of a path in the update's `$set`. + * Useful for writing getters/setters that can work with both update operations + * and `save()`. + * + * #### Example: + * + * const query = Model.updateOne({}, { $set: { name: 'Jean-Luc Picard' } }); + * query.get('name'); // 'Jean-Luc Picard' + * + * @param {string|object} path path or object of key/value pairs to get + * @return {Query} this + * @api public + */ + +Query.prototype.get = function get(path) { + const update = this[queryUpdateSymbol]; + if (update == null) { + return void 0; + } + const $set = update.$set; + if ($set == null) { + return update[path]; + } + + if (utils.hasUserDefinedProperty(update, path)) { + return update[path]; + } + if (utils.hasUserDefinedProperty($set, path)) { + return $set[path]; + } + + return void 0; +}; + +/** + * Gets/sets the error flag on this query. If this flag is not null or + * undefined, the `exec()` promise will reject without executing. + * + * #### Example: + * + * Query().error(); // Get current error value + * Query().error(null); // Unset the current error + * Query().error(new Error('test')); // `exec()` will resolve with test + * Schema.pre('find', function() { + * if (!this.getQuery().userId) { + * this.error(new Error('Not allowed to query without setting userId')); + * } + * }); + * + * Note that query casting runs **after** hooks, so cast errors will override + * custom errors. + * + * #### Example: + * + * const TestSchema = new Schema({ num: Number }); + * const TestModel = db.model('Test', TestSchema); + * TestModel.find({ num: 'not a number' }).error(new Error('woops')).exec(function(error) { + * // `error` will be a cast error because `num` failed to cast + * }); + * + * @param {Error|null} err if set, `exec()` will fail fast before sending the query to MongoDB + * @return {Query} this + * @api public + */ + +Query.prototype.error = function error(err) { + if (arguments.length === 0) { + return this._error; + } + + this._error = err; + return this; +}; + +/** + * ignore + * @method _unsetCastError + * @instance + * @memberOf Query + * @api private + */ + +Query.prototype._unsetCastError = function _unsetCastError() { + if (this._error == null || !(this._error instanceof CastError)) { + return; + } + return this.error(null); +}; + +/** + * Getter/setter around the current mongoose-specific options for this query + * Below are the current Mongoose-specific options. + * + * - `cloneUpdate`: if `false`, Mongoose will not clone updates before executing the query + * - `defaults`: if `false`, Mongoose will not apply defaults to the returned document(s) + * - `lean`: if truthy, Mongoose will not [hydrate](https://mongoosejs.com/docs/api/model.html#Model.hydrate()) any documents that are returned from this query. See [`Query.prototype.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) for more information. + * - `nearSphere`: use `$nearSphere` instead of `near()`. See the [`Query.prototype.nearSphere()` docs](https://mongoosejs.com/docs/api/query.html#Query.prototype.nearSphere()) + * - `overwriteDiscriminatorKey`: allow setting the discriminator key in the update + * - `overwriteImmutable`: allow overwriting properties that are set to `immutable` in the schema + * - `populate`: an array representing what paths will be populated. Should have one entry for each call to [`Query.prototype.populate()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.populate()) + * - `sanitizeFilter`: if truthy, Mongoose will sanitize query filters before executing the query + * - `sanitizeProjection`: if truthy, Mongoose will sanitize projections before executing the query + * - `schemaLevelProjections`: if `false`, Mongoose will not apply schema-level `select: false` or `select: true` for this query + * - `setDefaultsOnInsert`: if `true`, Mongoose will apply defaults to upserted documents + * - `strict`: controls how Mongoose handles keys that aren't in the schema for updates. This option is `true` by default, which means Mongoose will silently strip any paths in the update that aren't in the schema. See the [`strict` mode docs](https://mongoosejs.com/docs/guide.html#strict) for more information. + * - `strictQuery`: controls how Mongoose handles keys that aren't in the schema for the query `filter`. This option is `false` by default, which means Mongoose will allow `Model.find({ foo: 'bar' })` even if `foo` is not in the schema. See the [`strictQuery` docs](https://mongoosejs.com/docs/guide.html#strictQuery) for more information. + * - `timestamps`: if `false`, Mongoose will not apply timestamps to the update + * - `translateAliases`: if `true`, Mongoose will translate schema aliases in the query + * - `updatePipeline`: if `true`, Mongoose will treat the update as an update pipeline + * + * Mongoose maintains a separate object for internal options because + * Mongoose sends `Query.prototype.options` to the MongoDB server, and the + * above options are not relevant for the MongoDB server. + * + * @param {object} options if specified, overwrites the current options + * @return {object} the options + * @api public + */ + +Query.prototype.mongooseOptions = function(v) { + if (arguments.length > 0) { + this._mongooseOptions = v; + } + return this._mongooseOptions; +}; + +/** + * ignore + * @method _castConditions + * @memberOf Query + * @api private + * @instance + */ + +Query.prototype._castConditions = function() { + let sanitizeFilterOpt = undefined; + if (this.model?.db.options?.sanitizeFilter != null) { + sanitizeFilterOpt = this.model.db.options.sanitizeFilter; + } else if (this.model?.base.options?.sanitizeFilter != null) { + sanitizeFilterOpt = this.model.base.options.sanitizeFilter; + } else { + sanitizeFilterOpt = this._mongooseOptions.sanitizeFilter; + } + + if (sanitizeFilterOpt) { + sanitizeFilter(this._conditions); + } + + try { + this.cast(this.model); + this._unsetCastError(); + } catch (err) { + this.error(err); + } +}; + +/*! + * ignore + */ + +function _castArrayFilters(query) { + try { + castArrayFilters(query); + } catch (err) { + query.error(err); + } +} + +/** + * Execute a `find()` + * + * @return {Query} this + * @api private + */ +Query.prototype._find = async function _find() { + this._applyTranslateAliases(); + this._castConditions(); + + if (this.error() != null) { + throw this.error(); + } + + const mongooseOptions = this._mongooseOptions; + const userProvidedFields = this._userProvidedFields || {}; + + const dbOptions = this.model.db.options; + const baseOptions = this.model.base.options; + applyGlobalMaxTimeMS(this.options, dbOptions, baseOptions); + applyGlobalDiskUse(this.options, dbOptions, baseOptions); + + // Separate options to pass down to `completeMany()` in case we need to + // set a session on the document + const completeManyOptions = { + session: this?.options?.session || null, + lean: mongooseOptions.lean || null + }; + + // Only pass `defaults` through when it is non-nullish; `null` and + // `undefined` are treated as "not set" and omitted from `createModel()`. + if (mongooseOptions.defaults != null) { + completeManyOptions.defaults = mongooseOptions.defaults; + } + + const options = this._optionsForExec(); + + const filter = this._conditions; + const fields = options.projection; + + const cursor = await this.mongooseCollection.find(filter, options); + if (options.explain) { + return cursor.explain(); + } + + let docs = await cursor.toArray(); + if (docs.length === 0) { + return docs; + } + + if (!mongooseOptions.populate) { + const versionKey = this.schema.options.versionKey; + if (mongooseOptions.lean?.versionKey === false && versionKey) { + docs.forEach((doc) => { + if (versionKey in doc) { + delete doc[versionKey]; + } + }); + } + return mongooseOptions.lean ? + _completeManyLean(this.model.schema, docs, null, completeManyOptions) : + this._completeMany(docs, fields, userProvidedFields, completeManyOptions); + } + + const pop = helpers.preparePopulationOptionsMQ(this, mongooseOptions); + + // _deferPopulate is used internally when we need to defer populate until after + // filtering (when using match functions with nested populate via hooks) + if (this.options?._deferPopulate) { + docs = mongooseOptions.lean ? + docs : + await this._completeMany(docs, fields, userProvidedFields, completeManyOptions); + this._deferredPopulate = pop; + return docs; + } + + if (mongooseOptions.lean) { + return this.model.populate(docs, pop); + } + + docs = await this._completeMany(docs, fields, userProvidedFields, completeManyOptions); + await this.model.populate(docs, pop); + + return docs; +}; + +/** + * Find all documents that match `selector`. The result will be an array of documents. + * + * If there are too many documents in the result to fit in memory, use + * [`Query.prototype.cursor()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.cursor()) + * + * #### Example: + * + * const arr = await Movie.find({ year: { $gte: 1980, $lte: 1989 } }); + * + * @param {object|ObjectId} [filter] mongodb filter. If not specified, returns all documents. + * @return {Query} this + * @api public + */ + +Query.prototype.find = function(conditions) { + if (typeof conditions === 'function' || + typeof arguments[1] === 'function') { + throw new MongooseError('Query.prototype.find() no longer accepts a callback'); + } + + this.op = 'find'; + + if (canMerge(conditions)) { + this.merge(conditions); + + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, 'filter', 'find')); + } + + return this; +}; + +/** + * Merges another Query or conditions object into this one. + * + * When a Query is passed, conditions, field selection and options are merged. + * + * @param {Query|object} source + * @return {Query} this + */ + +Query.prototype.merge = function(source) { + if (!source) { + if (source === null) { + this._conditions = null; + } + return this; + } + + this._conditions = this._conditions ?? {}; + + const opts = { overwrite: true }; + + if (source instanceof Query) { + // if source has a feature, apply it to ourselves + + if (source._conditions) { + opts.omit = {}; + if (this._conditions && this._conditions.$and && source._conditions.$and) { + opts.omit['$and'] = true; + this._conditions.$and = this._conditions.$and.concat(source._conditions.$and); + } + if (this._conditions && this._conditions.$or && source._conditions.$or) { + opts.omit['$or'] = true; + this._conditions.$or = this._conditions.$or.concat(source._conditions.$or); + } + utils.merge(this._conditions, source._conditions, opts); + } + + if (source._fields) { + this._fields || (this._fields = {}); + utils.merge(this._fields, source._fields, opts); + } + + if (source.options) { + this.options || (this.options = {}); + utils.merge(this.options, source.options, opts); + } + + if (source[queryUpdateSymbol] != null) { + _cloneUpdateIfShared(this); + this[queryUpdateSymbol] || (this[queryUpdateSymbol] = {}); + utils.mergeClone(this[queryUpdateSymbol], source[queryUpdateSymbol]); + } + + if (source._distinct) { + this._distinct = source._distinct; + } + + utils.merge(this._mongooseOptions, source._mongooseOptions); + + return this; + } else if (this.model != null && source instanceof this.model.base.Types.ObjectId) { + utils.merge(this._conditions, { _id: source }, opts); + + return this; + } else if (source?.$__) { + source = source.toObject(internalToObjectOptions); + } + + opts.omit = {}; + if (Array.isArray(source.$and)) { + opts.omit['$and'] = true; + if (!this._conditions) { + this._conditions = {}; + } + this._conditions.$and = (this._conditions.$and || []).concat( + source.$and.map(el => utils.isPOJO(el) ? utils.merge({}, el) : el) + ); + } + if (Array.isArray(source.$or)) { + opts.omit['$or'] = true; + if (!this._conditions) { + this._conditions = {}; + } + this._conditions.$or = (this._conditions.$or || []).concat( + source.$or.map(el => utils.isPOJO(el) ? utils.merge({}, el) : el) + ); + } + + // plain object + utils.merge(this._conditions, source, opts); + + return this; +}; + +/** + * Adds a collation to this op (MongoDB 3.4 and up) + * + * @param {object} value + * @return {Query} this + * @see MongoDB docs https://www.mongodb.com/docs/manual/reference/method/cursor.collation/#cursor.collation + * @api public + */ + +Query.prototype.collation = function(value) { + if (this.options == null) { + this.options = {}; + } + this.options.collation = value; + return this; +}; + +/** + * Hydrate a single doc from `findOne()`, `findOneAndUpdate()`, etc. + * + * @api private + */ + +Query.prototype._completeOne = function(doc, res, projection, callback) { + if (!doc && !this.options.includeResultMetadata) { + return callback(null, null); + } + + const model = this.model; + const userProvidedFields = this._userProvidedFields || {}; + // `populate`, `lean` + const mongooseOptions = this._mongooseOptions; + + const options = this.options; + if (!options.lean && mongooseOptions.lean) { + options.lean = mongooseOptions.lean; + } + + if (options.explain) { + return callback(null, doc); + } + + if (!mongooseOptions.populate) { + const versionKey = this.schema.options.versionKey; + if (mongooseOptions.lean?.versionKey === false && versionKey) { + if (versionKey in doc) { + delete doc[versionKey]; + } + } + return mongooseOptions.lean ? + _completeOneLean(model.schema, doc, null, res, options, callback) : + completeOne(model, doc, res, options, projection, userProvidedFields, + null, callback); + } + + const pop = helpers.preparePopulationOptionsMQ(this, this._mongooseOptions); + if (mongooseOptions.lean) { + return model.populate(doc, pop).then( + doc => { + _completeOneLean(model.schema, doc, null, res, options, callback); + }, + error => { + callback(error); + } + ); + } + + completeOne(model, doc, res, options, projection, userProvidedFields, [], (err, doc) => { + if (err != null) { + return callback(err); + } + model.populate(doc, pop).then(res => { callback(null, res); }, err => { callback(err); }); + }); +}; + +/** + * Given a model and an array of docs, hydrates all the docs to be instances + * of the model. Used to initialize docs returned from the db from `find()` + * + * @param {Array} docs + * @param {object} fields the projection used, including `select` from schemas + * @param {object} userProvidedFields the user-specified projection + * @param {object} [opts] + * @param {Array} [opts.populated] + * @param {ClientSession} [opts.session] + * @api private + */ + +Query.prototype._completeMany = async function _completeMany(docs, fields, userProvidedFields, opts) { + const model = this.model; + return Promise.all(docs.map(doc => new Promise((resolve, reject) => { + const rawDoc = doc; + doc = helpers.createModel(model, doc, fields, userProvidedFields, opts); + if (opts.session != null) { + doc.$session(opts.session); + } + doc.$init(rawDoc, opts, (err) => { + if (err != null) { + return reject(err); + } + resolve(doc); + }); + }))); +}; + +/** + * Internal helper to execute a findOne() operation + * + * @see findOne https://www.mongodb.com/docs/manual/reference/method/db.collection.findOne/ + * @api private + */ + +Query.prototype._findOne = async function _findOne() { + this._applyTranslateAliases(); + this._castConditions(); + + if (this.error()) { + const err = this.error(); + throw err; + } + + const dbOptions = this.model.db.options; + const baseOptions = this.model.base.options; + applyGlobalMaxTimeMS(this.options, dbOptions, baseOptions); + applyGlobalDiskUse(this.options, dbOptions, baseOptions); + + const options = this._optionsForExec(); + + // don't pass in the conditions because we already merged them in + const doc = await this.mongooseCollection.findOne(this._conditions, options); + return new Promise((resolve, reject) => { + this._completeOne(doc, null, options.projection, (err, res) => { + if (err) { + return reject(err); + } + resolve(res); + }); + }); +}; + +/** + * Declares the query a findOne operation. When executed, the first found document is passed to the callback. + * + * The result of the query is a single document, or `null` if no document was found. + * + * * *Note:* `conditions` is optional, and if `conditions` is null or undefined, + * mongoose will send an empty `findOne` command to MongoDB, which will return + * an arbitrary document. If you're querying by `_id`, use `Model.findById()` + * instead. + * + * This function triggers the following middleware. + * + * - `findOne()` + * + * #### Example: + * + * const query = Kitten.where({ color: 'white' }); + * const kitten = await query.findOne(); + * + * @param {object} [filter] mongodb selector + * @param {object} [projection] optional fields to return + * @param {object} [options] see [`setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} this + * @see findOne https://www.mongodb.com/docs/manual/reference/method/db.collection.findOne/ + * @see Query.select https://mongoosejs.com/docs/api/query.html#Query.prototype.select() + * @api public + */ + +Query.prototype.findOne = function(conditions, projection, options) { + if (typeof conditions === 'function' || + typeof projection === 'function' || + typeof options === 'function' || + typeof arguments[3] === 'function') { + throw new MongooseError('Query.prototype.findOne() no longer accepts a callback'); + } + + this.op = 'findOne'; + + if (options) { + this.setOptions(options); + } + + if (projection) { + this.select(projection); + } + + if (canMerge(conditions)) { + this.merge(conditions); + + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, 'filter', 'findOne')); + } + + return this; +}; + + +/** + * Execute a countDocuments query + * + * @see countDocuments https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#countDocuments + * @api private + */ + +Query.prototype._countDocuments = async function _countDocuments() { + this._applyTranslateAliases(); + this._castConditions(); + + if (this.error()) { + throw this.error(); + } + + const dbOptions = this.model.db.options; + const baseOptions = this.model.base.options; + applyGlobalMaxTimeMS(this.options, dbOptions, baseOptions); + applyGlobalDiskUse(this.options, dbOptions, baseOptions); + + const options = this._optionsForExec(); + + const conds = this._conditions; + + return this.mongooseCollection.countDocuments(conds, options); +}; + +/*! + * If `translateAliases` option is set, call `Model.translateAliases()` + * on the following query properties: filter, projection, update, distinct. + */ + +Query.prototype._applyTranslateAliases = function _applyTranslateAliases() { + let applyTranslateAliases = false; + if ('translateAliases' in this._mongooseOptions) { + applyTranslateAliases = this._mongooseOptions.translateAliases; + } else if (this.model?.schema?._userProvidedOptions?.translateAliases != null) { + applyTranslateAliases = this.model.schema._userProvidedOptions.translateAliases; + } else if (this.model?.base?.options?.translateAliases != null) { + applyTranslateAliases = this.model.base.options.translateAliases; + } + if (!applyTranslateAliases) { + return; + } + + if (this.model?.schema?.aliases && utils.hasOwnKeys(this.model.schema.aliases)) { + _cloneUpdateIfShared(this); + this.model.translateAliases(this._conditions, true); + this.model.translateAliases(this._fields, true); + this.model.translateAliases(this[queryUpdateSymbol], true); + if (this._distinct != null && this.model.schema.aliases[this._distinct] != null) { + this._distinct = this.model.schema.aliases[this._distinct]; + } + } +}; + +/** + * Execute a estimatedDocumentCount() query + * + * @see estimatedDocumentCount https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#estimatedDocumentCount + * @api private + */ + +Query.prototype._estimatedDocumentCount = async function _estimatedDocumentCount() { + if (this.error()) { + throw this.error(); + } + + const options = this._optionsForExec(); + + return this.mongooseCollection.estimatedDocumentCount(options); +}; + +/** + * Specifies this query as a `estimatedDocumentCount()` query. Faster than + * using `countDocuments()` for large collections because + * `estimatedDocumentCount()` uses collection metadata rather than scanning + * the entire collection. + * + * `estimatedDocumentCount()` does **not** accept a filter. `Model.find({ foo: bar }).estimatedDocumentCount()` + * is equivalent to `Model.find().estimatedDocumentCount()` + * + * This function triggers the following middleware. + * + * - `estimatedDocumentCount()` + * + * #### Example: + * + * await Model.find().estimatedDocumentCount(); + * + * @param {object} [options] passed transparently to the [MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/EstimatedDocumentCountOptions.html) + * @return {Query} this + * @see estimatedDocumentCount https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#estimatedDocumentCount + * @api public + */ + +Query.prototype.estimatedDocumentCount = function(options) { + if (typeof options === 'function' || + typeof arguments[1] === 'function') { + throw new MongooseError('Query.prototype.estimatedDocumentCount() no longer accepts a callback'); + } + + this.op = 'estimatedDocumentCount'; + + if (options != null) { + this.setOptions(options); + } + + return this; +}; + +/** + * Specifies this query as a `countDocuments()` query. Behaves like `count()`, + * except it always does a full collection scan when passed an empty filter `{}`. + * + * There are also minor differences in how `countDocuments()` handles + * [`$where` and a couple geospatial operators](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#countDocuments). + * versus `count()`. + * + * This function triggers the following middleware. + * + * - `countDocuments()` + * + * #### Example: + * + * const countQuery = model.where({ 'color': 'black' }).countDocuments(); + * + * query.countDocuments({ color: 'black' }).count().exec(); + * + * await query.countDocuments({ color: 'black' }); + * + * query.where('color', 'black').countDocuments().exec(); + * + * The `countDocuments()` function is similar to `count()`, but there are a + * [few operators that `countDocuments()` does not support](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#countDocuments). + * Below are the operators that `count()` supports but `countDocuments()` does not, + * and the suggested replacement: + * + * - `$where`: [`$expr`](https://www.mongodb.com/docs/manual/reference/operator/query/expr/) + * - `$near`: [`$geoWithin`](https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/) with [`$center`](https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center) + * - `$nearSphere`: [`$geoWithin`](https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/) with [`$centerSphere`](https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere) + * + * @param {object} [filter] mongodb selector + * @param {object} [options] + * @return {Query} this + * @see countDocuments https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#countDocuments + * @api public + */ + +Query.prototype.countDocuments = function(conditions, options) { + if (typeof conditions === 'function' || + typeof options === 'function' || + typeof arguments[2] === 'function') { + throw new MongooseError('Query.prototype.countDocuments() no longer accepts a callback'); + } + + this.op = 'countDocuments'; + + if (canMerge(conditions)) { + this.merge(conditions); + } + + if (options != null) { + this.setOptions(options); + } + + return this; +}; + +/** + * Execute a `distinct()` query + * + * @see distinct https://www.mongodb.com/docs/manual/reference/method/db.collection.distinct/ + * @api private + */ + +Query.prototype.__distinct = async function __distinct() { + this._applyTranslateAliases(); + this._castConditions(); + + if (this.error()) { + throw this.error(); + } + + const dbOptions = this.model.db.options; + const baseOptions = this.model.base.options; + applyGlobalMaxTimeMS(this.options, dbOptions, baseOptions); + applyGlobalDiskUse(this.options, dbOptions, baseOptions); + + const options = this._optionsForExec(); + + return this.mongooseCollection. + distinct(this._distinct, this._conditions, options); +}; + +/** + * Declares or executes a distinct() operation. + * + * This function does not trigger any middleware. + * + * #### Example: + * + * distinct(field, conditions, options) + * distinct(field, conditions) + * distinct(field) + * distinct() + * + * @param {string} [field] + * @param {object|Query} [filter] + * @param {object} [options] + * @return {Query} this + * @see distinct https://www.mongodb.com/docs/manual/reference/method/db.collection.distinct/ + * @api public + */ + +Query.prototype.distinct = function(field, conditions, options) { + if (typeof field === 'function' || + typeof conditions === 'function' || + typeof options === 'function' || + typeof arguments[3] === 'function') { + throw new MongooseError('Query.prototype.distinct() no longer accepts a callback'); + } + + this.op = 'distinct'; + + if (canMerge(conditions)) { + this.merge(conditions); + + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, 'filter', 'distinct')); + } + + if (field != null) { + this._distinct = field; + } + + if (options != null) { + this.setOptions(options); + } + + return this; +}; + +/** + * Sets the sort order + * + * If an object is passed, values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. + * + * If a string is passed, it must be a space delimited list of path names. The + * sort order of each path is ascending unless the path name is prefixed with `-` + * which will be treated as descending. + * + * #### Example: + * + * // sort by "field" ascending and "test" descending + * query.sort({ field: 'asc', test: -1 }); + * + * // equivalent + * query.sort('field -test'); + * + * // also possible is to use a array with array key-value pairs + * query.sort([['field', 'asc']]); + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @param {object|string|Array>} arg + * @param {object} [options] + * @param {boolean} [options.override=false] If true, replace existing sort options with `arg` + * @return {Query} this + * @see cursor.sort https://www.mongodb.com/docs/manual/reference/method/cursor.sort/ + * @api public + */ + +Query.prototype.sort = function(arg, options) { + if (arguments.length > 2) { + throw new MongooseError('sort() takes at most 2 arguments'); + } + if (options != null && typeof options !== 'object') { + throw new MongooseError('sort() options argument must be an object or nullish'); + } + + if (this.options.sort == null) { + this.options.sort = {}; + } + if (options?.override) { + this.options.sort = {}; + } + const sort = this.options.sort; + if (typeof arg === 'string') { + const properties = arg.indexOf(' ') === -1 ? [arg] : arg.split(' '); + for (let property of properties) { + const ascend = '-' == property[0] ? -1 : 1; + if (ascend === -1) { + property = property.slice(1); + } + if (specialProperties.has(property)) { + continue; + } + sort[property] = ascend; + } + } else if (Array.isArray(arg)) { + for (const pair of arg) { + if (!Array.isArray(pair)) { + throw new TypeError('Invalid sort() argument, must be array of arrays'); + } + const key = '' + pair[0]; + if (specialProperties.has(key)) { + continue; + } + sort[key] = _handleSortValue(pair[1], key); + } + } else if (typeof arg === 'object' && arg != null && !(arg instanceof Map)) { + for (const key of Object.keys(arg)) { + if (specialProperties.has(key)) { + continue; + } + sort[key] = _handleSortValue(arg[key], key); + } + } else if (arg instanceof Map) { + for (let key of arg.keys()) { + key = '' + key; + if (specialProperties.has(key)) { + continue; + } + sort[key] = _handleSortValue(arg.get(key), key); + } + } else if (arg != null) { + throw new TypeError('Invalid sort() argument. Must be a string, object, array, or map.'); + } + + return this; +}; + +/*! + * Convert sort values + */ + +function _handleSortValue(val, key) { + if (val === 1 || val === 'asc' || val === 'ascending') { + return 1; + } + if (val === -1 || val === 'desc' || val === 'descending') { + return -1; + } + if (val?.$meta != null) { + return { $meta: val.$meta }; + } + throw new TypeError('Invalid sort value: { ' + key + ': ' + val + ' }'); +} + +/** + * Declare and/or execute this query as a `deleteOne()` operation. Works like + * remove, except it deletes at most one document regardless of the `single` + * option. + * + * This function triggers `deleteOne` middleware. + * + * #### Example: + * + * await Character.deleteOne({ name: 'Eddard Stark' }); + * + * This function calls the MongoDB driver's [`Collection#deleteOne()` function](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#deleteOne). + * The returned [promise](https://mongoosejs.com/docs/queries.html) resolves to an + * object that contains 2 properties: + * + * - `acknowledged`: boolean + * - `deletedCount`: the number of documents deleted + * + * #### Example: + * + * const res = await Character.deleteOne({ name: 'Eddard Stark' }); + * // `1` if MongoDB deleted a doc, `0` if no docs matched the filter `{ name: ... }` + * res.deletedCount; + * + * @param {object|Query} [filter] mongodb selector + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @return {Query} this + * @see DeleteResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/DeleteResult.html + * @see deleteOne https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#deleteOne + * @api public + */ + +Query.prototype.deleteOne = function deleteOne(filter, options) { + if (typeof filter === 'function' || typeof options === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Query.prototype.deleteOne() no longer accepts a callback'); + } + this.op = 'deleteOne'; + this.setOptions(options); + + if (canMerge(filter)) { + this.merge(filter); + + prepareDiscriminatorCriteria(this); + } else if (filter != null) { + this.error(new ObjectParameterError(filter, 'filter', 'deleteOne')); + } + + return this; +}; + +/** + * Internal thunk for `deleteOne()` + * + * @method _deleteOne + * @instance + * @memberOf Query + * @api private + */ + +Query.prototype._deleteOne = async function _deleteOne() { + this._applyTranslateAliases(); + this._castConditions(); + + // Check for empty/invalid filter with requireFilter option + checkRequireFilter(this._conditions, this.options); + + if (this.error() != null) { + throw this.error(); + } + + const options = this._optionsForExec(); + + return this.mongooseCollection.deleteOne(this._conditions, options); +}; + +/** + * Declare and/or execute this query as a `deleteMany()` operation. Works like + * remove, except it deletes _every_ document that matches `filter` in the + * collection, regardless of the value of `single`. + * + * This function triggers `deleteMany` middleware. + * + * #### Example: + * + * await Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }); + * + * This function calls the MongoDB driver's [`Collection#deleteMany()` function](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#deleteMany). + * The returned [promise](https://mongoosejs.com/docs/queries.html) resolves to an + * object that contains 2 properties: + * + * - `acknowledged`: boolean + * - `deletedCount`: the number of documents deleted + * + * #### Example: + * + * const res = await Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }); + * // `0` if no docs matched the filter, number of docs deleted otherwise + * res.deletedCount; + * + * @param {object|Query} [filter] mongodb selector + * @param {object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @return {Query} this + * @see DeleteResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/DeleteResult.html + * @see deleteMany https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#deleteMany + * @api public + */ + +Query.prototype.deleteMany = function(filter, options) { + if (typeof filter === 'function' || typeof options === 'function' || typeof arguments[2] === 'function') { + throw new MongooseError('Query.prototype.deleteMany() no longer accepts a callback'); + } + this.setOptions(options); + this.op = 'deleteMany'; + + if (canMerge(filter)) { + this.merge(filter); + + prepareDiscriminatorCriteria(this); + } else if (filter != null) { + this.error(new ObjectParameterError(filter, 'filter', 'deleteMany')); + } + + return this; +}; + +/** + * Execute a `deleteMany()` query + * + * @method _deleteMany + * @instance + * @memberOf Query + * @api private + */ + +Query.prototype._deleteMany = async function _deleteMany() { + this._applyTranslateAliases(); + this._castConditions(); + + // Check for empty/invalid filter with requireFilter option + checkRequireFilter(this._conditions, this.options); + + if (this.error() != null) { + throw this.error(); + } + + const options = this._optionsForExec(); + + return this.mongooseCollection.deleteMany(this._conditions, options); +}; + +/** + * hydrates a document + * + * @param {Model} model + * @param {Document} doc + * @param {object} res 3rd parameter to callback + * @param {object} fields + * @param {Query} self + * @param {Array} [pop] array of paths used in population + * @param {Function} callback + * @api private + */ + +function completeOne(model, doc, res, options, fields, userProvidedFields, pop, callback) { + if (options.includeResultMetadata && doc == null) { + _init(null); + return null; + } + + helpers.createModelAndInit(model, doc, fields, userProvidedFields, options, pop, _init); + + function _init(err, casted) { + if (err) { + return callback(err); + } + + + if (options.includeResultMetadata) { + if (doc && casted) { + if (options.session != null) { + casted.$session(options.session); + } + res.value = casted; + } else { + res.value = null; + } + return callback(null, res); + } + if (options.session != null) { + casted.$session(options.session); + } + callback(null, casted); + } +} + +/** + * If the model is a discriminator type and not root, then add the key & value to the criteria. + * @param {Query} query + * @api private + */ + +function prepareDiscriminatorCriteria(query) { + if (!query?.model?.schema) { + return; + } + + const schema = query.model.schema; + + if (schema?.discriminatorMapping && !schema.discriminatorMapping.isRoot) { + query._conditions[schema.discriminatorMapping.key] = schema.discriminatorMapping.value; + } +} + +/** + * Issues a mongodb `findOneAndUpdate()` command. + * + * Finds a matching document, updates it according to the `update` arg, passing any `options`, and returns the found + * document (if any). + * + * This function triggers the following middleware. + * + * - `findOneAndUpdate()` + * + * #### Available options + * + * - `new`: bool - if true, return the modified document rather than the original. defaults to false (changed in 4.0) + * - `upsert`: bool - creates the object if it doesn't exist. defaults to false. + * - `fields`: {Object|String} - Field selection. Equivalent to `.select(fields).findOneAndUpdate()` + * - `sort`: if multiple docs are found by the filter, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `runValidators`: if true, runs [update validators](https://mongoosejs.com/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema. + * - `setDefaultsOnInsert`: `true` by default. If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created. + * - `requireFilter`: bool - if true, throws an error if the filter is empty (`{}`). Defaults to false. + * + * #### Example: + * + * query.findOneAndUpdate(filter, update, options); // returns Query + * query.findOneAndUpdate(filter, update); // returns Query + * // Note that `Query#findOneAndUpdate()` with 1 arg treats the first arg as the `update`, NOT the `filter`. + * query.findOneAndUpdate(update); // returns Query + * query.findOneAndUpdate(); // returns Query + * + * @method findOneAndUpdate + * @memberOf Query + * @instance + * @param {object|Query} [filter] + * @param {object} [update] + * @param {object} [options] + * @param {boolean} [options.cloneUpdate=true] if `false`, Mongoose will not clone the update before executing the query + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {boolean} [options.new=false] By default, `findOneAndUpdate()` returns the document as it was **before** `update` was applied. If you set `new: true`, `findOneAndUpdate()` will instead give you the object after `update` was applied. **Deprecated:** Use `returnDocument: 'after'` instead of `new: true`, or `returnDocument: 'before'` instead of `new: false`. + * @param {object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and [the Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html). + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.returnOriginal=null] An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`. **Deprecated:** Use `returnDocument: 'after'` instead of `returnOriginal: false`, or `returnDocument: 'before'` instead of `returnOriginal: true`. + * @param {'before'|'after'} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @param {boolean} [options.overwriteImmutable=false] Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators. + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @see Tutorial https://mongoosejs.com/docs/tutorials/findoneandupdate.html + * @see findAndModify command https://www.mongodb.com/docs/manual/reference/command/findAndModify/ + * @see ModifyResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html + * @see findOneAndUpdate https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#findOneAndUpdate + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndUpdate = function(filter, update, options) { + if (typeof filter === 'function' || + typeof update === 'function' || + typeof options === 'function' || + typeof arguments[3] === 'function') { + throw new MongooseError('Query.prototype.findOneAndUpdate() no longer accepts a callback'); + } + + this.op = 'findOneAndUpdate'; + this._validate(); + + switch (arguments.length) { + case 2: + options = undefined; + break; + case 1: + update = filter; + filter = options = undefined; + break; + } + + if (canMerge(filter)) { + this.merge(filter); + } else if (filter != null) { + this.error( + new ObjectParameterError(filter, 'filter', 'findOneAndUpdate') + ); + } + + options = options ? clone(options) : {}; + + if (options.projection) { + this.select(options.projection); + delete options.projection; + } + if (options.fields) { + this.select(options.fields); + delete options.fields; + } + + const globalReturnDocument = this?.model?.base?.options?.returnDocument; + const globalReturnOriginal = this?.model?.base?.options?.returnOriginal; + if (options.new == null && options.returnDocument == null && options.returnOriginal == null) { + if (globalReturnDocument != null) { + options.returnDocument = globalReturnDocument; + } else if (globalReturnOriginal != null) { + options.returnOriginal = globalReturnOriginal; + } + } + + const updatePipeline = this?.model?.base?.options?.updatePipeline; + if (options.updatePipeline == null && updatePipeline != null) { + options.updatePipeline = updatePipeline; + } + + if (!options.updatePipeline && Array.isArray(update)) { + throw new MongooseError('Cannot pass an array to query updates unless the `updatePipeline` option is set.'); + } + + this.setOptions(options); + + // apply doc + if (update) { + if (this[queryUpdateSymbol] == null || utils.isEmptyObject(this[queryUpdateSymbol])) { + this[queryUpdateSymbol] = update; + this._updateIsShared = true; + } else { + this._mergeUpdate(update); + } + } + + return this; +}; + +/** + * Execute a findOneAndUpdate operation + * + * @method _findOneAndUpdate + * @memberOf Query + * @api private + */ + +Query.prototype._findOneAndUpdate = async function _findOneAndUpdate() { + this._applyTranslateAliases(); + this._castConditions(); + + // Check for empty/invalid filter with requireFilter option + checkRequireFilter(this._conditions, this.options); + + _castArrayFilters(this); + + if (this.error()) { + throw this.error(); + } + + const dbOptions = this.model.db.options; + const baseOptions = this.model.base.options; + applyGlobalMaxTimeMS(this.options, dbOptions, baseOptions); + applyGlobalDiskUse(this.options, dbOptions, baseOptions); + + const options = this._optionsForExec(this.model); + convertNewToReturnDocument(options); + + this[queryUpdateSymbol] = this._castUpdate(this[queryUpdateSymbol]); + this._updateIsShared = false; + decorateUpdateWithVersionKey(this[queryUpdateSymbol], options, this.schema.options.versionKey); + + this[queryUpdateSymbol] = setDefaultsOnInsert( + this._conditions, + this.model.schema, + this[queryUpdateSymbol], + options, + this._mongooseOptions, + this + ); + + if (!this[queryUpdateSymbol] || utils.hasOwnKeys(this[queryUpdateSymbol]) === false) { + if (options.upsert) { + // still need to do the upsert to empty doc + const $set = clone(this[queryUpdateSymbol]); + delete $set._id; + this[queryUpdateSymbol] = { $set }; + } else { + this._execCount = 0; + const res = await this._findOne(); + return res; + } + } else if (this[queryUpdateSymbol] instanceof Error) { + throw this[queryUpdateSymbol]; + } else { + // In order to make MongoDB 2.6 happy (see + // https://jira.mongodb.org/browse/SERVER-12266 and related issues) + // if we have an actual update document but $set is empty, junk the $set. + if (this[queryUpdateSymbol].$set && utils.hasOwnKeys(this[queryUpdateSymbol].$set) === false) { + delete this[queryUpdateSymbol].$set; + } + } + + const runValidators = _getOption(this, 'runValidators', false); + if (runValidators) { + await this.validate(this[queryUpdateSymbol], options, false); + } + + if (typeof this[queryUpdateSymbol].toBSON === 'function') { + this[queryUpdateSymbol] = this[queryUpdateSymbol].toBSON(); + } + + let res = await this.mongooseCollection.findOneAndUpdate(this._conditions, this[queryUpdateSymbol], options); + for (const fn of this._transforms) { + res = fn(res); + } + const doc = !options.includeResultMetadata ? res : res.value; + + return new Promise((resolve, reject) => { + this._completeOne(doc, res, options.projection, (err, res) => { + if (err) { + return reject(err); + } + resolve(res); + }); + }); +}; + +/** + * Issues a MongoDB [findOneAndDelete](https://www.mongodb.com/docs/manual/reference/method/db.collection.findOneAndDelete/) command. + * + * Finds a matching document, removes it, and returns the found document (if any). + * + * This function triggers the following middleware. + * + * - `findOneAndDelete()` + * + * #### Available options + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `requireFilter`: bool - if true, throws an error if the filter is empty (`{}`). Defaults to false. + * + * #### Example: + * + * A.where().findOneAndDelete(conditions, options) // return Query + * A.where().findOneAndDelete(conditions) // returns Query + * A.where().findOneAndDelete() // returns Query + * + * @method findOneAndDelete + * @memberOf Query + * @param {object} [filter] + * @param {object} [options] + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @return {Query} this + * @see findAndModify command https://www.mongodb.com/docs/manual/reference/command/findAndModify/ + * @api public + */ + +Query.prototype.findOneAndDelete = function(filter, options) { + if (typeof filter === 'function' || + typeof options === 'function' || + typeof arguments[2] === 'function') { + throw new MongooseError('Query.prototype.findOneAndDelete() no longer accepts a callback'); + } + + this.op = 'findOneAndDelete'; + this._validate(); + + if (canMerge(filter)) { + this.merge(filter); + } + + options && this.setOptions(options); + + return this; +}; + +/** + * Execute a `findOneAndDelete()` query + * + * @return {Query} this + * @method _findOneAndDelete + * @memberOf Query + * @api private + */ +Query.prototype._findOneAndDelete = async function _findOneAndDelete() { + this._applyTranslateAliases(); + this._castConditions(); + + // Check for empty/invalid filter with requireFilter option + checkRequireFilter(this._conditions, this.options); + + if (this.error() != null) { + throw this.error(); + } + + const includeResultMetadata = this.options.includeResultMetadata; + + const filter = this._conditions; + const options = this._optionsForExec(this.model); + + let res = await this.mongooseCollection.findOneAndDelete(filter, options); + for (const fn of this._transforms) { + res = fn(res); + } + const doc = !includeResultMetadata ? res : res.value; + + return new Promise((resolve, reject) => { + this._completeOne(doc, res, options.projection, (err, res) => { + if (err) { + return reject(err); + } + resolve(res); + }); + }); +}; + +/** + * Issues a MongoDB [findOneAndReplace](https://www.mongodb.com/docs/manual/reference/method/db.collection.findOneAndReplace/) command. + * + * Finds a matching document, removes it, and returns the found document (if any). + * + * This function triggers the following middleware. + * + * - `findOneAndReplace()` + * + * #### Available options + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `includeResultMetadata`: if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * - `requireFilter`: bool - if true, throws an error if the filter is empty (`{}`). Defaults to false. + * + * #### Example: + * + * A.where().findOneAndReplace(filter, replacement, options); // return Query + * A.where().findOneAndReplace(filter); // returns Query + * A.where().findOneAndReplace(); // returns Query + * + * @method findOneAndReplace + * @memberOf Query + * @param {object} [filter] + * @param {object} [replacement] + * @param {object} [options] + * @param {boolean} [options.cloneUpdate=true] if `false`, Mongoose will not clone the update before executing the query + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.new=false] By default, `findOneAndUpdate()` returns the document as it was **before** `update` was applied. If you set `new: true`, `findOneAndUpdate()` will instead give you the object after `update` was applied. **Deprecated:** Use `returnDocument: 'after'` instead of `new: true`, or `returnDocument: 'before'` instead of `new: false`. + * @param {object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and [the Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.returnOriginal=null] An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`. **Deprecated:** Use `returnDocument: 'after'` instead of `returnOriginal: false`, or `returnDocument: 'before'` instead of `returnOriginal: true`. + * @param {'before'|'after'} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndReplace = function(filter, replacement, options) { + if (typeof filter === 'function' || + typeof replacement === 'function' || + typeof options === 'function' || + typeof arguments[4] === 'function') { + throw new MongooseError('Query.prototype.findOneAndReplace() no longer accepts a callback'); + } + + this.op = 'findOneAndReplace'; + this._validate(); + + if (canMerge(filter)) { + this.merge(filter); + } else if (filter != null) { + this.error( + new ObjectParameterError(filter, 'filter', 'findOneAndReplace') + ); + } + + if (replacement != null) { + this._mergeUpdate(replacement); + } + + options = options || {}; + + const globalReturnDocument = this?.model?.base?.options?.returnDocument; + const globalReturnOriginal = this?.model?.base?.options?.returnOriginal; + if (options.new == null && options.returnDocument == null && options.returnOriginal == null) { + if (globalReturnDocument != null) { + options.returnDocument = globalReturnDocument; + } else if (globalReturnOriginal != null) { + options.returnOriginal = globalReturnOriginal; + } + } + + this.setOptions(options); + + return this; +}; + +/** + * Execute a findOneAndReplace() query + * + * @return {Query} this + * @method _findOneAndReplace + * @instance + * @memberOf Query + * @api private + */ +Query.prototype._findOneAndReplace = async function _findOneAndReplace() { + this._applyTranslateAliases(); + this._castConditions(); + + // Check for empty/invalid filter with requireFilter option + checkRequireFilter(this._conditions, this.options); + + if (this.error() != null) { + throw this.error(); + } + + const filter = this._conditions; + const options = this._optionsForExec(); + convertNewToReturnDocument(options); + + const includeResultMetadata = this.options.includeResultMetadata; + + const modelOpts = { skipId: true }; + if ('strict' in this._mongooseOptions) { + modelOpts.strict = this._mongooseOptions.strict; + } + + const runValidators = _getOption(this, 'runValidators', false); + + try { + const update = new this.model(this[queryUpdateSymbol], null, modelOpts); + if (runValidators) { + await update.validate(); + } else if (update.$__.validationError) { + throw update.$__.validationError; + } + this[queryUpdateSymbol] = update.toBSON(); + } catch (err) { + if (err instanceof ValidationError) { + throw err; + } + const validationError = new ValidationError(); + validationError.errors[err.path] = err; + throw validationError; + } + + let res = await this.mongooseCollection.findOneAndReplace(filter, this[queryUpdateSymbol], options); + + for (const fn of this._transforms) { + res = fn(res); + } + + const doc = !includeResultMetadata ? res : res.value; + return new Promise((resolve, reject) => { + this._completeOne(doc, res, options.projection, (err, res) => { + if (err) { + return reject(err); + } + resolve(res); + }); + }); +}; + +/** + * Finds a single document by its _id field. `findById(id)` is equivalent to + * `findOne({ _id: id })`. + * + * The `id` is cast based on the Schema before sending the command. + * + * This function triggers the following middleware. + * + * - `findOne()` + * + * @method findById + * @memberOf Query + * @instance + * @param {any} id value of `_id` to query by + * @param {object} [projection] optional fields to return + * @param {object} [options] see [`setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions()) + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @return {Query} this + * @see findOne https://www.mongodb.com/docs/manual/reference/method/db.collection.findOne/ + * @see Query.select https://mongoosejs.com/docs/api/query.html#Query.prototype.select() + * @api public + */ + +Query.prototype.findById = function(id, projection, options) { + return this.findOne({ _id: id }, projection, options); +}; + + +/** + * Issues a mongodb findOneAndUpdate command by a document's _id field. + * `findByIdAndUpdate(id, ...)` is equivalent to `findOneAndUpdate({ _id: id }, ...)`. + * + * Finds a matching document, updates it according to the `update` arg, + * passing any `options`, and returns the found document (if any). + * + * This function triggers the following middleware. + * + * - `findOneAndUpdate()` + * + * @method findByIdAndUpdate + * @memberOf Query + * @instance + * @param {any} id value of `_id` to query by + * @param {object} [doc] + * @param {object} [options] + * @param {boolean} [options.cloneUpdate=true] if `false`, Mongoose will not clone the update before executing the query + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {boolean} [options.new=false] By default, `findOneAndUpdate()` returns the document as it was **before** `update` was applied. If you set `new: true`, `findOneAndUpdate()` will instead give you the object after `update` was applied. **Deprecated:** Use `returnDocument: 'after'` instead of `new: true`, or `returnDocument: 'before'` instead of `new: false`. + * @param {object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.lean()) and [the Mongoose lean tutorial](https://mongoosejs.com/docs/tutorials/lean.html). + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.returnOriginal=null] An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`. **Deprecated:** Use `returnDocument: 'after'` instead of `returnOriginal: false`, or `returnDocument: 'before'` instead of `returnOriginal: true`. + * @param {'before'|'after'} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @param {boolean} [options.overwriteImmutable=false] Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators. + * @see Tutorial https://mongoosejs.com/docs/tutorials/findoneandupdate.html + * @see findAndModify command https://www.mongodb.com/docs/manual/reference/command/findAndModify/ + * @see ModifyResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html + * @see findOneAndUpdate https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#findOneAndUpdate + * @return {Query} this + * @api public + */ + +Query.prototype.findByIdAndUpdate = function(id, update, options) { + return this.findOneAndUpdate({ _id: id }, update, options); +}; + +/** + * Issue a MongoDB `findOneAndDelete()` command by a document's _id field. + * In other words, `findByIdAndDelete(id)` is a shorthand for + * `findOneAndDelete({ _id: id })`. + * + * This function triggers the following middleware. + * + * - `findOneAndDelete()` + * + * @method findByIdAndDelete + * @memberOf Query + * @param {any} id value of `_id` to query by + * @param {object} [options] + * @param {boolean} [options.includeResultMetadata] if true, returns the full [ModifyResult from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/7.0/interfaces/ModifyResult.html) rather than just the document + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](https://mongoosejs.com/docs/transactions.html). + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @return {Query} this + * @see findAndModify command https://www.mongodb.com/docs/manual/reference/command/findAndModify/ + * @api public + */ + +Query.prototype.findByIdAndDelete = function(id, options) { + return this.findOneAndDelete({ _id: id }, options); +}; + +/** + * Support the `new` option as an alternative to `returnOriginal` for backwards + * compat. + * @api private + */ + +function convertNewToReturnDocument(options) { + if ('new' in options) { + const replacement = options['new'] ? '\'after\'' : '\'before\''; + utils.warn( + 'mongoose: the `new` option for `findOneAndUpdate()` and `findOneAndReplace()` is deprecated. ' + + 'Use `returnDocument: ' + replacement + '` instead.' + ); + options.returnDocument = options['new'] ? 'after' : 'before'; + delete options['new']; + } + if ('returnOriginal' in options) { + const replacement = options['returnOriginal'] ? '\'before\'' : '\'after\''; + utils.warn( + 'mongoose: the `returnOriginal` option for `findOneAndUpdate()` and `findOneAndReplace()` is deprecated. ' + + 'Use `returnDocument: ' + replacement + '` instead.' + ); + options.returnDocument = options['returnOriginal'] ? 'before' : 'after'; + delete options['returnOriginal']; + } + // Temporary since driver 4.0.0-beta does not support `returnDocument` + if (typeof options.returnDocument === 'string') { + options.returnOriginal = options.returnDocument === 'before'; + } +} + +/** + * Get options from query opts, falling back to the base mongoose object. + * @param {Query} query + * @param {object} option + * @param {any} def + * @api private + */ + +function _getOption(query, option, def) { + const opts = query._optionsForExec(query.model); + + if (option in opts) { + return opts[option]; + } + if (option in query.model.base.options) { + return query.model.base.options[option]; + } + return def; +} + +/*! + * ignore + */ + +function _completeOneLean(schema, doc, path, res, opts, callback) { + if (opts.lean && typeof opts.lean.transform === 'function') { + opts.lean.transform(doc); + + for (let i = 0; i < schema.childSchemas.length; i++) { + const childPath = path ? path + '.' + schema.childSchemas[i].model.path : schema.childSchemas[i].model.path; + const _schema = schema.childSchemas[i].schema; + const obj = mpath.get(childPath, doc); + if (obj == null) { + continue; + } + if (Array.isArray(obj)) { + for (let i = 0; i < obj.length; i++) { + opts.lean.transform(obj[i]); + } + } else { + opts.lean.transform(obj); + } + _completeOneLean(_schema, obj, childPath, res, opts); + } + if (callback) { + return callback(null, doc); + } else { + return; + } + } + if (opts.includeResultMetadata) { + return callback(null, res); + } + return callback(null, doc); +} + +/*! + * ignore + */ + +function _completeManyLean(schema, docs, path, opts) { + if (opts.lean && typeof opts.lean.transform === 'function') { + for (const doc of docs) { + opts.lean.transform(doc); + } + + for (let i = 0; i < schema.childSchemas.length; i++) { + const childPath = path ? path + '.' + schema.childSchemas[i].model.path : schema.childSchemas[i].model.path; + const _schema = schema.childSchemas[i].schema; + let doc = mpath.get(childPath, docs); + if (doc == null) { + continue; + } + doc = doc.flat(); + for (let i = 0; i < doc.length; i++) { + opts.lean.transform(doc[i]); + } + _completeManyLean(_schema, doc, childPath, opts); + } + } + + return docs; +} +/** + * Override mquery.prototype._mergeUpdate to handle mongoose objects in + * updates. + * + * @param {object} update + * @method _mergeUpdate + * @memberOf Query + * @instance + * @api private + */ + +Query.prototype._mergeUpdate = function(update) { + _cloneUpdateIfShared(this); + + const updatePipeline = this._mongooseOptions.updatePipeline; + if (!updatePipeline && Array.isArray(update)) { + throw new MongooseError('Cannot pass an array to query updates unless the `updatePipeline` option is set.'); + } + if (!this[queryUpdateSymbol]) { + this[queryUpdateSymbol] = Array.isArray(update) ? [] : {}; + } + + if (update == null || (typeof update === 'object' && utils.hasOwnKeys(update) === false)) { + return; + } + + if (update instanceof Query) { + if (Array.isArray(this[queryUpdateSymbol])) { + throw new MongooseError(`Cannot mix array and object updates (current: ${_previewUpdate(this[queryUpdateSymbol])}, incoming: ${_previewUpdate(update[queryUpdateSymbol])})`); + } + if (update[queryUpdateSymbol]) { + utils.mergeClone(this[queryUpdateSymbol], update[queryUpdateSymbol]); + } + } else if (Array.isArray(update)) { + if (!Array.isArray(this[queryUpdateSymbol])) { + // `_update` may be empty object by default, like in `doc.updateOne()` + // because we create the query first, then run hooks, then apply the update. + if (this[queryUpdateSymbol] == null || utils.isEmptyObject(this[queryUpdateSymbol])) { + this[queryUpdateSymbol] = []; + } else { + throw new MongooseError(`Cannot mix array and object updates (current: ${_previewUpdate(this[queryUpdateSymbol])}, incoming: ${_previewUpdate(update)})`); + } + } + this[queryUpdateSymbol] = this[queryUpdateSymbol].concat(update); + } else { + if (Array.isArray(this[queryUpdateSymbol])) { + throw new MongooseError(`Cannot mix array and object updates (current: ${_previewUpdate(this[queryUpdateSymbol])}, incoming: ${_previewUpdate(update)})`); + } + utils.mergeClone(this[queryUpdateSymbol], update); + } +}; + +function _previewUpdate(update) { + const preview = util.inspect(update, { + depth: 2, + maxArrayLength: 5, + breakLength: 80, + compact: true + }); + + if (preview.length > 200) { + return `${preview.slice(0, 197)}...`; + } + + return preview; +} + +/** + * Mongoose calls this function internally to validate the query if + * `runValidators` is set + * + * @param {object} castedDoc the update, after casting + * @param {object} options the options from `_optionsForExec()` + * @param {boolean} isOverwriting + * @method validate + * @memberOf Query + * @instance + * @api private + */ + +Query.prototype.validate = async function validate(castedDoc, options, isOverwriting) { + if (typeof arguments[3] === 'function') { + throw new MongooseError('Query.prototype.validate() no longer accepts a callback'); + } + + await _executePreHooks(this, 'validate'); + + if (isOverwriting) { + await castedDoc.$validate(); + } else { + const validationErrors = await updateValidators(this, this.model.schema, castedDoc, options); + if (validationErrors.length > 0) { + const err = new ValidationError(null); + for (const validationError of validationErrors) { + err.addError(validationError.path, validationError); + } + throw err; + } + } + + await _executePostHooks(this, null, null, 'validate'); +}; + +/** + * Execute an updateMany query + * + * @see Model.update https://mongoosejs.com/docs/api/model.html#Model.update() + * @method _updateMany + * @memberOf Query + * @instance + * @api private + */ +Query.prototype._updateMany = async function _updateMany() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + _castArrayFilters(this); + if (this.error() != null) { + throw this.error(); + } + + const options = this._optionsForExec(this.model); + _cloneUpdateIfShared(this); + this[queryUpdateSymbol] = this._castUpdate(this[queryUpdateSymbol]); + if (this[queryUpdateSymbol] == null || utils.hasOwnKeys(this[queryUpdateSymbol]) === false) { + return { acknowledged: false }; + } + removeUnusedArrayFilters(this[queryUpdateSymbol], options); + + this[queryUpdateSymbol] = setDefaultsOnInsert( + this._conditions, + this.model.schema, + this[queryUpdateSymbol], + options, + this._mongooseOptions, + this + ); + + if (_getOption(this, 'runValidators', false)) { + await this.validate(this[queryUpdateSymbol], options, false); + } + + if (typeof this[queryUpdateSymbol].toBSON === 'function') { + this[queryUpdateSymbol] = this[queryUpdateSymbol].toBSON(); + } + + return this.mongooseCollection.updateMany(this._conditions, this[queryUpdateSymbol], options); +}; + +/** + * Execute an updateOne query + * + * @see Model.update https://mongoosejs.com/docs/api/model.html#Model.update() + * @method _updateOne + * @memberOf Query + * @instance + * @api private + */ +Query.prototype._updateOne = async function _updateOne() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + _castArrayFilters(this); + if (this.error() != null) { + throw this.error(); + } + + const options = this._optionsForExec(this.model); + _cloneUpdateIfShared(this); + this[queryUpdateSymbol] = this._castUpdate(this[queryUpdateSymbol]); + if (this[queryUpdateSymbol] == null || utils.hasOwnKeys(this[queryUpdateSymbol]) === false) { + return { acknowledged: false }; + } + removeUnusedArrayFilters(this[queryUpdateSymbol], options); + + this[queryUpdateSymbol] = setDefaultsOnInsert( + this._conditions, + this.model.schema, + this[queryUpdateSymbol], + options, + this._mongooseOptions, + this + ); + + if (_getOption(this, 'runValidators', false)) { + await this.validate(this[queryUpdateSymbol], options, false); + } + + if (typeof this[queryUpdateSymbol].toBSON === 'function') { + this[queryUpdateSymbol] = this[queryUpdateSymbol].toBSON(); + } + + return this.mongooseCollection.updateOne(this._conditions, this[queryUpdateSymbol], options); +}; + +/** + * Execute a replaceOne query + * + * @see Model.replaceOne https://mongoosejs.com/docs/api/model.html#Model.replaceOne() + * @method _replaceOne + * @memberOf Query + * @instance + * @api private + */ +Query.prototype._replaceOne = async function _replaceOne() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + _castArrayFilters(this); + if (this.error() != null) { + throw this.error(); + } + + const options = this._optionsForExec(this.model); + this[queryUpdateSymbol] = new this.model(this[queryUpdateSymbol], null, { skipId: true }); + removeUnusedArrayFilters(this[queryUpdateSymbol], options); + + if (_getOption(this, 'runValidators', false)) { + await this.validate(this[queryUpdateSymbol], options, true); + } + + if (typeof this[queryUpdateSymbol].toBSON === 'function') { + this[queryUpdateSymbol] = this[queryUpdateSymbol].toBSON(); + } + + return this.mongooseCollection.replaceOne(this._conditions, this[queryUpdateSymbol], options); +}; + +/** + * Declare and/or execute this query as an updateMany() operation. + * MongoDB will update _all_ documents that match `filter` (as opposed to just the first one). + * + * **Note** updateMany will _not_ fire update middleware. Use `pre('updateMany')` + * and `post('updateMany')` instead. + * + * #### Example: + * + * const res = await Person.updateMany({ name: /Stark$/ }, { isDeleted: true }); + * res.n; // Number of documents matched + * res.nModified; // Number of documents modified + * + * // Other supported syntaxes + * await Person.find({ name: /Stark$/ }).updateMany({ isDeleted: true }); // Using chaining syntax + * await Person.find().updateMany({ isDeleted: true }); // Set `isDeleted` on _all_ Person documents + * + * This function triggers the following middleware. + * + * - `updateMany()` + * + * @param {object} [filter] + * @param {object|Array} [update] the update command. If array, this update will be treated as an update pipeline and not casted. + * @param {object} [options] + * @param {boolean} [options.cloneUpdate=true] if `false`, Mongoose will not clone the update before executing the query + * @param {boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {object} [options.writeConcern=null] sets the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @param {boolean} [options.overwriteImmutable=false] Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators. + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @return {Query} this + * @see Model.update https://mongoosejs.com/docs/api/model.html#Model.update() + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see update https://www.mongodb.com/docs/manual/reference/method/db.collection.update/ + * @see UpdateResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/UpdateResult.html + * @see MongoDB docs https://www.mongodb.com/docs/manual/reference/command/update/#update-command-output + * @api public + */ + +Query.prototype.updateMany = function(conditions, doc, options, callback) { + if (typeof options === 'function') { + // .update(conditions, doc, callback) + callback = options; + options = undefined; + } else if (typeof doc === 'function') { + // .update(doc, callback); + callback = doc; + doc = conditions; + conditions = {}; + options = undefined; + } else if (typeof conditions === 'function') { + // .update(callback) + callback = conditions; + conditions = undefined; + doc = undefined; + options = undefined; + } else if (typeof conditions === 'object' && !doc && !options && !callback) { + // .update(doc) + doc = conditions; + conditions = undefined; + options = undefined; + callback = undefined; + } + + return _update(this, 'updateMany', conditions, doc, options, callback); +}; + +/** + * Declare and/or execute this query as an updateOne() operation. + * MongoDB will update _only_ the first document that matches `filter`. + * + * - Use `replaceOne()` if you want to overwrite an entire document rather than using [atomic operators](https://www.mongodb.com/docs/manual/tutorial/model-data-for-atomic-operations/#pattern) like `$set`. + * + * **Note** updateOne will _not_ fire update middleware. Use `pre('updateOne')` + * and `post('updateOne')` instead. + * + * #### Example: + * + * const res = await Person.updateOne({ name: 'Jean-Luc Picard' }, { ship: 'USS Enterprise' }); + * res.acknowledged; // Indicates if this write result was acknowledged. If not, then all other members of this result will be undefined. + * res.matchedCount; // Number of documents that matched the filter + * res.modifiedCount; // Number of documents that were modified + * res.upsertedCount; // Number of documents that were upserted + * res.upsertedId; // Identifier of the inserted document (if an upsert took place) + * + * // Other supported syntaxes + * await Person.findOne({ name: 'Jean-Luc Picard' }).updateOne({ ship: 'USS Enterprise' }); // Using chaining syntax + * await Person.updateOne({ ship: 'USS Enterprise' }); // Updates first doc's `ship` property + * + * This function triggers the following middleware. + * + * - `updateOne()` + * + * @param {object} [filter] + * @param {object|Array} [update] the update command. If array, this update will be treated as an update pipeline and not casted. + * @param {object} [options] + * @param {boolean} [options.cloneUpdate=true] if `false`, Mongoose will not clone the update before executing the query + * @param {boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {object} [options.writeConcern=null] sets the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.overwriteDiscriminatorKey=false] Mongoose removes discriminator key updates from `update` by default, set `overwriteDiscriminatorKey` to `true` to allow updating the discriminator key + * @param {boolean} [options.overwriteImmutable=false] Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators. + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @return {Query} this + * @see Model.update https://mongoosejs.com/docs/api/model.html#Model.update() + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see update https://www.mongodb.com/docs/manual/reference/method/db.collection.update/ + * @see UpdateResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/UpdateResult.html + * @see MongoDB docs https://www.mongodb.com/docs/manual/reference/command/update/#update-command-output + * @api public + */ + +Query.prototype.updateOne = function(conditions, doc, options, callback) { + if (typeof options === 'function') { + // .update(conditions, doc, callback) + callback = options; + options = undefined; + } else if (typeof doc === 'function') { + // .update(doc, callback); + callback = doc; + doc = conditions; + conditions = {}; + options = undefined; + } else if (typeof conditions === 'function') { + // .update(callback) + callback = conditions; + conditions = undefined; + doc = undefined; + options = undefined; + } else if (typeof conditions === 'object' && !doc && !options && !callback) { + // .update(doc) + doc = conditions; + conditions = undefined; + options = undefined; + callback = undefined; + } + + return _update(this, 'updateOne', conditions, doc, options, callback); +}; + +/** + * Declare and/or execute this query as a replaceOne() operation. + * MongoDB will replace the existing document and will not accept any [atomic operators](https://www.mongodb.com/docs/manual/tutorial/model-data-for-atomic-operations/#pattern) (`$set`, etc.) + * + * **Note** replaceOne will _not_ fire update middleware. Use `pre('replaceOne')` + * and `post('replaceOne')` instead. + * + * #### Example: + * + * const res = await Person.replaceOne({ _id: 24601 }, { name: 'Jean Valjean' }); + * res.acknowledged; // Indicates if this write result was acknowledged. If not, then all other members of this result will be undefined. + * res.matchedCount; // Number of documents that matched the filter + * res.modifiedCount; // Number of documents that were modified + * res.upsertedCount; // Number of documents that were upserted + * res.upsertedId; // Identifier of the inserted document (if an upsert took place) + * + * This function triggers the following middleware. + * + * - `replaceOne()` + * + * @param {object} [filter] + * @param {object} [doc] the update command + * @param {object} [options] + * @param {boolean} [options.cloneUpdate=true] if `false`, Mongoose will not clone the update before executing the query + * @param {boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {boolean|'throw'} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {object} [options.writeConcern=null] sets the [write concern](https://www.mongodb.com/docs/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](https://mongoosejs.com/docs/guide.html#writeConcern) + * @param {boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](https://mongoosejs.com/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {boolean} [options.translateAliases=null] If set to `true`, translates any schema-defined aliases in `filter`, `projection`, `update`, and `distinct`. Throws an error if there are any conflicts where both alias and raw property are defined on the same object. + * @param {boolean} [options.requireFilter=false] If true, throws an error if the filter is empty (`{}`) + * @return {Query} this + * @see Model.update https://mongoosejs.com/docs/api/model.html#Model.update() + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see update https://www.mongodb.com/docs/manual/reference/method/db.collection.update/ + * @see UpdateResult https://mongodb.github.io/node-mongodb-native/7.0/interfaces/UpdateResult.html + * @see MongoDB docs https://www.mongodb.com/docs/manual/reference/command/update/#update-command-output + * @api public + */ + +Query.prototype.replaceOne = function(conditions, doc, options, callback) { + if (typeof options === 'function') { + // .update(conditions, doc, callback) + callback = options; + options = undefined; + } else if (typeof doc === 'function') { + // .update(doc, callback); + callback = doc; + doc = conditions; + conditions = {}; + options = undefined; + } else if (typeof conditions === 'function') { + // .update(callback) + callback = conditions; + conditions = undefined; + doc = undefined; + options = undefined; + } else if (typeof conditions === 'object' && !doc && !options && !callback) { + // .update(doc) + doc = conditions; + conditions = undefined; + options = undefined; + callback = undefined; + } + + return _update(this, 'replaceOne', conditions, doc, options, callback); +}; + +/** + * Internal helper for update, updateMany, updateOne, replaceOne + * @param {Query} query + * @param {string} op + * @param {object} filter + * @param {Document} [doc] + * @param {object} [options] + * @param {Function} callback + * @api private + */ + +function _update(query, op, filter, doc, options, callback) { + // make sure we don't send in the whole Document to merge() + query.op = op; + doc = doc || {}; + + if (!(filter instanceof Query) && + filter != null && + filter.toString() !== '[object Object]') { + query.error(new ObjectParameterError(filter, 'filter', op)); + } else { + query.merge(filter); + } + + const updatePipeline = query?.model?.base?.options?.updatePipeline; + if (updatePipeline != null && options?.updatePipeline == null) { + options = options || {}; + options.updatePipeline = updatePipeline; + } + + if (!options?.updatePipeline && Array.isArray(doc)) { + throw new MongooseError('Cannot pass an array to query updates unless the `updatePipeline` option is set.'); + } + + if (utils.isObject(options)) { + query.setOptions(options); + } + + if (query[queryUpdateSymbol] == null || utils.isEmptyObject(query[queryUpdateSymbol])) { + query[queryUpdateSymbol] = doc; + query._updateIsShared = true; + } else { + query._mergeUpdate(doc); + } + + // Hooks + if (callback) { + query.exec(callback); + + return query; + } + + return query; +} + +/** + * Runs a function `fn` and treats the return value of `fn` as the new value + * for the query to resolve to. + * + * Any functions you pass to `transform()` will run **after** any post hooks. + * + * #### Example: + * + * const res = await MyModel.findOne().transform(res => { + * // Sets a `loadedAt` property on the doc that tells you the time the + * // document was loaded. + * return res == null ? + * res : + * Object.assign(res, { loadedAt: new Date() }); + * }); + * + * @method transform + * @memberOf Query + * @instance + * @param {Function} fn function to run to transform the query result + * @return {Query} this + */ + +Query.prototype.transform = function(fn) { + this._transforms.push(fn); + return this; +}; + +/** + * Make this query throw an error if no documents match the given `filter`. + * This is handy for integrating with async/await, because `orFail()` saves you + * an extra `if` statement to check if no document was found. + * + * #### Example: + * + * // Throws if no doc returned + * await Model.findOne({ foo: 'bar' }).orFail(); + * + * // Throws if no document was updated. Note that `orFail()` will still + * // throw if the only document that matches is `{ foo: 'bar', name: 'test' }`, + * // because `orFail()` will throw if no document was _updated_, not + * // if no document was _found_. + * await Model.updateOne({ foo: 'bar' }, { name: 'test' }).orFail(); + * + * // Throws "No docs found!" error if no docs match `{ foo: 'bar' }` + * await Model.find({ foo: 'bar' }).orFail(new Error('No docs found!')); + * + * // Throws "Not found" error if no document was found + * await Model.findOneAndUpdate({ foo: 'bar' }, { name: 'test' }). + * orFail(() => Error('Not found')); + * + * @method orFail + * @memberOf Query + * @instance + * @param {Function|Error} [err] optional error to throw if no docs match `filter`. If not specified, `orFail()` will throw a `DocumentNotFoundError` + * @return {Query} this + */ + +Query.prototype.orFail = function(err) { + this.transform(res => { + switch (this.op) { + case 'find': + if (res.length === 0) { + throw _orFailError(err, this); + } + break; + case 'findOne': + if (res == null) { + throw _orFailError(err, this); + } + break; + case 'replaceOne': + case 'updateMany': + case 'updateOne': + if (res?.matchedCount === 0) { + throw _orFailError(err, this); + } + break; + case 'findOneAndDelete': + case 'findOneAndUpdate': + case 'findOneAndReplace': + if (this.options.includeResultMetadata && res != null && res.value == null) { + throw _orFailError(err, this); + } + if (!this.options.includeResultMetadata && res == null) { + throw _orFailError(err, this); + } + break; + case 'deleteMany': + case 'deleteOne': + if (res.deletedCount === 0) { + throw _orFailError(err, this); + } + break; + default: + break; + } + + return res; + }); + return this; +}; + +/** + * Get the error to throw for `orFail()` + * @param {Error|undefined} err + * @param {Query} query + * @api private + */ + +function _orFailError(err, query) { + if (typeof err === 'function') { + err = err.call(query); + } + + if (err == null) { + err = new DocumentNotFoundError(query.getQuery(), query.model.modelName); + } + + return err; +} + +/** + * Wrapper function to call isPathSelectedInclusive on a query. + * @param {string} path + * @return {boolean} + * @api public + */ + +Query.prototype.isPathSelectedInclusive = function(path) { + return isPathSelectedInclusive(this._fields, path); +}; + +/** + * Executes the query + * + * #### Example: + * + * const promise = query.exec(); + * const promise = query.exec('update'); + * + * @param {string|Function} [operation] + * @return {Promise} + * @api public + */ + +Query.prototype.exec = async function exec(op) { + if (typeof op === 'function' || (arguments.length >= 2 && typeof arguments[1] === 'function')) { + throw new MongooseError('Query.prototype.exec() no longer accepts a callback'); + } + + this._validateOp(); + if (typeof op === 'string') { + this.op = op; + } + + if (this.op == null) { + throw new MongooseError('Query must have `op` before executing'); + } + if (this.model == null) { + throw new MongooseError('Query must have an associated model before executing'); + } + + const thunk = opToThunk.get(this.op); + if (!thunk) { + throw new MongooseError('Query has invalid `op`: "' + this.op + '"'); + } + + if (this.options?.sort && typeof this.options.sort === 'object' && Object.hasOwn(this.options.sort, '')) { + throw new MongooseError('Invalid field "" passed to sort()'); + } + + if (this._execCount > 0) { + let str = this.toString(); + if (str.length > 60) { + str = str.slice(0, 60) + '...'; + } + throw new MongooseError('Query was already executed: ' + str); + } + this._execCount++; + + const _this = this; + return traceQuery(async function maybeTracedQueryExec() { + let skipWrappedFunction = null; + try { + await _this._hooks.execPre('exec', _this, []); + } catch (err) { + if (err instanceof Kareem.skipWrappedFunction) { + skipWrappedFunction = err; + } else { + throw err; + } + } + + let res; + + let error = null; + try { + await _executePreHooks(_this); + res = skipWrappedFunction ? skipWrappedFunction.args[0] : await _this[thunk](); + + for (const fn of _this._transforms) { + res = fn(res); + } + } catch (err) { + if (err instanceof Kareem.skipWrappedFunction) { + res = err.args[0]; + } else { + error = err; + } + + error = _this.model.schema._transformDuplicateKeyError(error); + } + + res = await _executePostHooks(_this, res, error); + + await _this._hooks.execPost('exec', _this, []); + + return res; + }, () => ({ + operation: _this.op, + collection: _this.mongooseCollection.name, + database: _this.model.db?.name, + serverAddress: _this.model.db?.host, + serverPort: _this.model.db?.port, + args: { + filter: _this.getFilter(), + fields: _this._fields, + options: _this._mongooseOptions + } + })); +}; + +/*! + * ignore + */ + +async function _executePostHooks(query, res, error, op) { + if (query._queryMiddleware == null) { + if (error != null) { + throw error; + } + return res; + } + const filter = buildMiddlewareFilter(query.options, 'post'); + const opts = { filter }; + if (error) { + opts.error = error; + } + + // `result` is array of return args, but queries only return one result. + const [result] = await query._queryMiddleware.execPost( + op || query.op, + query, + [res], + opts + ); + return result; +} + +/*! + * ignore + */ + +function _executePreHooks(query, op) { + if (query._queryMiddleware == null) { + return; + } + const filter = buildMiddlewareFilter(query.options, 'pre'); + return query._queryMiddleware.execPre( + op || query.op, + query, + [], + { filter } + ); +} + +function _cloneUpdateIfShared(query) { + if (!query._updateIsShared) { + return; + } + if (query.mongooseOptions().cloneUpdate === false) { + return; + } + + query[queryUpdateSymbol] = clone(query[queryUpdateSymbol], { + flattenDecimals: false + }); + query._updateIsShared = false; +} + +/** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * + * More about [`then()` in JavaScript](https://masteringjs.io/tutorials/fundamentals/then). + * + * @param {Function} [resolve] + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Query.prototype.then = function(resolve, reject) { + return this.exec().then(resolve, reject); +}; + +/** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like `.then()`, but only takes a rejection handler. + * + * More about [Promise `catch()` in JavaScript](https://masteringjs.io/tutorials/fundamentals/catch). + * + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Query.prototype.catch = function(reject) { + return this.exec().then(null, reject); +}; + +/** + * Executes the query returning a `Promise` which will be + * resolved with `.finally()` chained. + * + * More about [Promise `finally()` in JavaScript](https://thecodebarbarian.com/using-promise-finally-in-node-js.html). + * + * @param {Function} [onFinally] + * @return {Promise} + * @api public + */ + +Query.prototype.finally = function(onFinally) { + return this.exec().finally(onFinally); +}; + +/** + * Returns a string representation of this query. + * + * More about [`toString()` in JavaScript](https://masteringjs.io/tutorials/fundamentals/tostring). + * + * #### Example: + * const q = Model.find(); + * console.log(q); // Prints "Query { find }" + * + * @return {string} + * @api public + * @method [Symbol.toStringTag] + * @memberOf Query + */ + +Query.prototype[Symbol.toStringTag] = function toString() { + return `Query { ${this.op} }`; +}; + +/** + * Add pre [middleware](https://mongoosejs.com/docs/middleware.html) to this query instance. Doesn't affect + * other queries. + * + * #### Example: + * + * const q1 = Question.find({ answer: 42 }); + * q1.pre(function middleware() { + * console.log(this.getFilter()); + * }); + * await q1.exec(); // Prints "{ answer: 42 }" + * + * // Doesn't print anything, because `middleware()` is only + * // registered on `q1`. + * await Question.find({ answer: 42 }); + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +Query.prototype.pre = function(fn) { + this._hooks.pre('exec', fn); + return this; +}; + +/** + * Add post [middleware](https://mongoosejs.com/docs/middleware.html) to this query instance. Doesn't affect + * other queries. + * + * #### Example: + * + * const q1 = Question.find({ answer: 42 }); + * q1.post(function middleware() { + * console.log(this.getFilter()); + * }); + * await q1.exec(); // Prints "{ answer: 42 }" + * + * // Doesn't print anything, because `middleware()` is only + * // registered on `q1`. + * await Question.find({ answer: 42 }); + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +Query.prototype.post = function(fn) { + this._hooks.post('exec', fn); + return this; +}; + +/** + * Casts obj for an update command. + * + * @param {object} obj + * @return {object} obj after casting its values + * @method _castUpdate + * @memberOf Query + * @instance + * @api private + */ + +Query.prototype._castUpdate = function _castUpdate(obj) { + let schema = this.schema; + + const discriminatorKey = schema.options.discriminatorKey; + const baseSchema = schema._baseSchema || schema; + if (this._mongooseOptions.overwriteDiscriminatorKey && + obj[discriminatorKey] != null && + baseSchema.discriminators) { + const _schema = Object.values(baseSchema.discriminators).find( + discriminator => discriminator.discriminatorMapping.value === obj[discriminatorKey] + ); + if (_schema != null) { + schema = _schema; + } + } + + let upsert; + if ('upsert' in this.options) { + upsert = this.options.upsert; + } + + return castUpdate(schema, obj, { + strict: this._mongooseOptions.strict, + upsert: upsert, + arrayFilters: this.options.arrayFilters, + overwriteDiscriminatorKey: this._mongooseOptions.overwriteDiscriminatorKey, + overwriteImmutable: this._mongooseOptions.overwriteImmutable + }, this, this._conditions); +}; + +/** + * Specifies paths which should be populated with other documents. + * + * #### Example: + * + * let book = await Book.findOne().populate('authors'); + * book.title; // 'Node.js in Action' + * book.authors[0].name; // 'TJ Holowaychuk' + * book.authors[1].name; // 'Nathan Rajlich' + * + * let books = await Book.find().populate({ + * path: 'authors', + * // `match` and `sort` apply to the Author model, + * // not the Book model. These options do not affect + * // which documents are in `books`, just the order and + * // contents of each book document's `authors`. + * match: { name: new RegExp('.*h.*', 'i') }, + * sort: { name: -1 } + * }); + * books[0].title; // 'Node.js in Action' + * // Each book's `authors` are sorted by name, descending. + * books[0].authors[0].name; // 'TJ Holowaychuk' + * books[0].authors[1].name; // 'Marc Harter' + * + * books[1].title; // 'Professional AngularJS' + * // Empty array, no authors' name has the letter 'h' + * books[1].authors; // [] + * + * Paths are populated after the query executes and a response is received. A + * separate query is then executed for each path specified for population. After + * a response for each query has also been returned, the results are passed to + * the callback. + * + * @param {object|string|Array} path either the path(s) to populate or an object specifying all parameters + * @param {object|string} [select] Field selection for the population query + * @param {Model} [model] The model you wish to use for population. If not specified, populate will look up the model by the name in the Schema's `ref` field. + * @param {object} [match] Conditions for the population query + * @param {object} [options] Options for the population query (sort, etc) + * @param {string} [options.path=null] The path to populate. + * @param {string|PopulateOptions} [options.populate=null] Recursively populate paths in the populated documents. See [deep populate docs](https://mongoosejs.com/docs/populate.html#deep-populate). + * @param {boolean} [options.retainNullValues=false] by default, Mongoose removes null and undefined values from populated arrays. Use this option to make `populate()` retain `null` and `undefined` array entries. + * @param {boolean} [options.getters=false] if true, Mongoose will call any getters defined on the `localField`. By default, Mongoose gets the raw value of `localField`. For example, you would need to set this option to `true` if you wanted to [add a `lowercase` getter to your `localField`](https://mongoosejs.com/docs/schematypes.html#schematype-options). + * @param {boolean} [options.clone=false] When you do `BlogPost.find().populate('author')`, blog posts with the same author will share 1 copy of an `author` doc. Enable this option to make Mongoose clone populated docs before assigning them. + * @param {object|Function} [options.match=null] Add an additional filter to the populate query. Can be a filter object containing [MongoDB query syntax](https://www.mongodb.com/docs/manual/tutorial/query-documents/), or a function that returns a filter object. + * @param {boolean} [options.skipInvalidIds=false] By default, Mongoose throws a cast error if `localField` and `foreignField` schemas don't line up. If you enable this option, Mongoose will instead filter out any `localField` properties that cannot be casted to `foreignField`'s schema type. + * @param {number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents. + * @param {boolean} [options.strictPopulate=true] Set to false to allow populating paths that aren't defined in the given model's schema. + * @param {Function} [options.transform=null] Function that Mongoose will call on every populated document that allows you to transform the populated document. + * @param {object} [options.options=null] Additional options like `limit` and `lean`. + * @param {boolean} [options.ordered=false] Set to `true` to execute any populate queries one at a time, as opposed to in parallel. Set this option to `true` if populating multiple paths or paths with multiple models in transactions. + * @see population https://mongoosejs.com/docs/populate.html + * @see Query#select https://mongoosejs.com/docs/api/query.html#Query.prototype.select() + * @see Model.populate https://mongoosejs.com/docs/api/model.html#Model.populate() + * @return {Query} this + * @api public + */ + +Query.prototype.populate = function(...args) { + // Bail when given no truthy arguments + if (!args.some(Boolean)) { + return this; + } + + const res = utils.populate.apply(null, args); + + const opts = this._mongooseOptions; + + if (opts.lean != null) { + const lean = opts.lean; + for (const populateOptions of res) { + if (populateOptions?.options?.lean == null) { + populateOptions.options = populateOptions.options || {}; + populateOptions.options.lean = lean; + } + } + } + + if (!utils.isObject(opts.populate)) { + opts.populate = {}; + } + + const pop = opts.populate; + + for (const populateOptions of res) { + const path = populateOptions.path; + if (pop[path]?.populate && populateOptions.populate) { + populateOptions.populate = pop[path].populate.concat(populateOptions.populate); + } + + pop[populateOptions.path] = populateOptions; + } + return this; +}; + +/** + * Gets a list of paths to be populated by this query + * + * #### Example: + * + * bookSchema.pre('findOne', function() { + * let keys = this.getPopulatedPaths(); // ['author'] + * }); + * ... + * Book.findOne({}).populate('author'); + * + * #### Example: + * + * // Deep populate + * const q = L1.find().populate({ + * path: 'level2', + * populate: { path: 'level3' } + * }); + * q.getPopulatedPaths(); // ['level2', 'level2.level3'] + * + * @return {Array} an array of strings representing populated paths + * @api public + */ + +Query.prototype.getPopulatedPaths = function getPopulatedPaths() { + const obj = this._mongooseOptions.populate || {}; + const ret = Object.keys(obj); + for (const path of Object.keys(obj)) { + const pop = obj[path]; + if (!Array.isArray(pop.populate)) { + continue; + } + _getPopulatedPaths(ret, pop.populate, path + '.'); + } + return ret; +}; + +/*! + * ignore + */ + +function _getPopulatedPaths(list, arr, prefix) { + for (const pop of arr) { + list.push(prefix + pop.path); + if (!Array.isArray(pop.populate)) { + continue; + } + _getPopulatedPaths(list, pop.populate, prefix + pop.path + '.'); + } +} + +/** + * Casts this query to the schema of `model` + * + * #### Note: + * + * If `obj` is present, it is cast instead of this query. + * + * @param {Model} [model] the model to cast to. If not set, defaults to `this.model` + * @param {object} [obj] + * @return {object} + * @api public + */ + +Query.prototype.cast = function(model, obj) { + obj || (obj = this._conditions); + model = model || this.model; + const discriminatorKey = model.schema.options.discriminatorKey; + if (obj != null && + Object.hasOwn(obj, discriminatorKey)) { + model = getDiscriminatorByValue(model.discriminators, obj[discriminatorKey]) || model; + } + + const opts = { upsert: this.options?.upsert }; + if ('strict' in this._mongooseOptions) { + opts.strict = this._mongooseOptions.strict; + } + if ('strictQuery' in this._mongooseOptions) { + opts.strictQuery = this._mongooseOptions.strictQuery; + } + if ('sanitizeFilter' in this._mongooseOptions) { + opts.sanitizeFilter = this._mongooseOptions.sanitizeFilter; + } + + try { + return cast(model.schema, obj, opts, this); + } catch (err) { + // CastError, assign model + if (typeof err.setModel === 'function') { + err.setModel(model); + } + throw err; + } +}; + +/** + * Casts selected field arguments for field selection with mongo 2.2 + * + * query.select({ ids: { $elemMatch: { $in: [hexString] }}) + * + * @param {object} fields + * @see https://github.com/Automattic/mongoose/issues/1091 + * @see https://www.mongodb.com/docs/manual/reference/projection/elemMatch/ + * @api private + */ + +Query.prototype._castFields = function _castFields(fields) { + let selected, + elemMatchKeys, + keys, + key, + out; + + if (fields) { + keys = Object.keys(fields); + elemMatchKeys = []; + + // collect $elemMatch args + for (let i = 0; i < keys.length; ++i) { + key = keys[i]; + if (fields[key].$elemMatch) { + selected || (selected = {}); + selected[key] = fields[key]; + elemMatchKeys.push(key); + } + } + } + + if (selected) { + // they passed $elemMatch, cast em + try { + out = this.cast(this.model, selected); + } catch (err) { + return err; + } + + // apply the casted field args + for (let i = 0; i < elemMatchKeys.length; ++i) { + key = elemMatchKeys[i]; + fields[key] = out[key]; + } + } + + return fields; +}; + +/** + * Applies schematype selected options to this query. + * @api private + */ + +Query.prototype._applyPaths = function applyPaths() { + if (!this.model) { + return; + } + this._fields = this._fields || {}; + + let sanitizeProjection = undefined; + if (this.model != null && utils.hasUserDefinedProperty(this.model.db.options, 'sanitizeProjection')) { + sanitizeProjection = this.model.db.options.sanitizeProjection; + } else if (this.model != null && utils.hasUserDefinedProperty(this.model.base.options, 'sanitizeProjection')) { + sanitizeProjection = this.model.base.options.sanitizeProjection; + } else { + sanitizeProjection = this._mongooseOptions.sanitizeProjection; + } + + const schemaLevelProjections = this._mongooseOptions.schemaLevelProjections ?? true; + + if (schemaLevelProjections) { + helpers.applyPaths(this._fields, this.model.schema, sanitizeProjection); + } + + let _selectPopulatedPaths = true; + + if ('selectPopulatedPaths' in this.model.base.options) { + _selectPopulatedPaths = this.model.base.options.selectPopulatedPaths; + } + if ('selectPopulatedPaths' in this.model.schema.options) { + _selectPopulatedPaths = this.model.schema.options.selectPopulatedPaths; + } + + if (_selectPopulatedPaths) { + selectPopulatedFields(this._fields, this._userProvidedFields, this._mongooseOptions.populate); + } +}; + +/** + * Returns a wrapper around a [mongodb driver cursor](https://mongodb.github.io/node-mongodb-native/7.0/classes/FindCursor.html). + * A QueryCursor exposes a Streams3 interface, as well as a `.next()` function. + * + * The `.cursor()` function triggers pre find hooks before opening the cursor + * and post find hooks once per document, with an array containing that document. + * + * #### Example: + * + * // There are 2 ways to use a cursor. First, as a stream: + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * on('data', function(doc) { console.log(doc); }). + * on('end', function() { console.log('Done!'); }); + * + * // Or you can use `.next()` to manually get the next doc in the stream. + * // `.next()` returns a promise, so you can use promises or callbacks. + * const cursor = Thing.find({ name: /^hello/ }).cursor(); + * cursor.next(function(error, doc) { + * console.log(doc); + * }); + * + * // Because `.next()` returns a promise, you can use co + * // to easily iterate through all documents without loading them + * // all into memory. + * const cursor = Thing.find({ name: /^hello/ }).cursor(); + * for (let doc = await cursor.next(); doc != null; doc = await cursor.next()) { + * console.log(doc); + * } + * + * #### Valid options + * + * - `transform`: optional function which accepts a mongoose document. The return value of the function will be emitted on `data` and returned by `.next()`. + * - [`middleware`](https://mongoosejs.com/docs/middleware.html#skipping): set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post find hooks + * + * @return {QueryCursor} + * @param {object} [options] + * @param {Function} [options.transform] optional function which accepts a mongoose document. The return value of the function will be emitted on `data` and returned by `.next()`. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @see QueryCursor https://mongoosejs.com/docs/api/querycursor.html + * @api public + */ + +Query.prototype.cursor = function cursor(opts) { + if (opts) { + this.setOptions(opts); + } + + try { + this._castConditions(); + } catch (err) { + // `_castConditions()` reports cast errors on the query, but `sanitizeFilter` + // throws for filters it refuses outright, like `$where`. + return (new QueryCursor(this))._markError(err); + } + + if (this.error()) { + return (new QueryCursor(this))._markError(this.error()); + } + + return new QueryCursor(this); +}; + +// the rest of these are basically to support older Mongoose syntax with mquery + +/** + * Sets the tailable option (for use with capped collections). + * + * #### Example: + * + * query.tailable(); // true + * query.tailable(true); + * query.tailable(false); + * + * // Set both `tailable` and `awaitData` options + * query.tailable({ awaitData: true }); + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @param {boolean} bool defaults to true + * @param {object} [opts] options to set + * @param {boolean} [opts.awaitData] false by default. Set to true to keep the cursor open even if there's no data. + * @param {number} [opts.maxAwaitTimeMS] the maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true + * @see tailable https://www.mongodb.com/docs/manual/tutorial/create-tailable-cursor/ + * @api public + */ + +Query.prototype.tailable = function(val, opts) { + // we need to support the tailable({ awaitData : true }) as well as the + // tailable(true, {awaitData :true}) syntax that mquery does not support + if (typeof val?.constructor === 'function' && val.constructor.name === 'Object') { + opts = val; + val = true; + } + + if (val === undefined) { + val = true; + } + + if (opts && typeof opts === 'object') { + for (const key of Object.keys(opts)) { + if (key === 'awaitData' || key === 'awaitdata') { // backwards compat, see gh-10875 + // For backwards compatibility + this.options['awaitData'] = !!opts[key]; + } else { + this.options[key] = opts[key]; + } + } + } + + this.options.tailable = arguments.length ? !!val : true; + + return this; +}; + +/** + * Declares an intersects query for `geometry()`. + * + * #### Example: + * + * query.where('path').intersects().geometry({ + * type: 'LineString', + * coordinates: [[180.0, 11.0], [180, 9.0]] + * }); + * + * query.where('path').intersects({ + * type: 'LineString', + * coordinates: [[180.0, 11.0], [180, 9.0]] + * }); + * + * #### Note: + * + * **MUST** be used after `where()`. + * + * #### Note: + * + * In Mongoose 3.7, `intersects` changed from a getter to a function. If you need the old syntax, use [this](https://github.com/ebensing/mongoose-within). + * + * @method intersects + * @memberOf Query + * @instance + * @param {object} [arg] + * @return {Query} this + * @see $geometry https://www.mongodb.com/docs/manual/reference/operator/geometry/ + * @see geoIntersects https://www.mongodb.com/docs/manual/reference/operator/geoIntersects/ + * @api public + */ + +/** + * Specifies a `$geometry` condition + * + * #### Example: + * + * const polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] + * query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) + * + * // or + * const polyB = [[ 0, 0 ], [ 1, 1 ]] + * query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) + * + * // or + * const polyC = [ 0, 0 ] + * query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) + * + * // or + * query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) + * + * The argument is assigned to the most recent path passed to `where()`. + * + * #### Note: + * + * `geometry()` **must** come after either `intersects()` or `within()`. + * + * The `object` argument must contain `type` and `coordinates` properties. + * - type {String} + * - coordinates {Array} + * + * @method geometry + * @memberOf Query + * @instance + * @param {object} object Must contain a `type` property which is a String and a `coordinates` property which is an Array. See the examples. + * @return {Query} this + * @see $geometry https://www.mongodb.com/docs/manual/reference/operator/geometry/ + * @see Geospatial Support Enhancements https://www.mongodb.com/docs/manual/release-notes/2.4/#geospatial-support-enhancements + * @see MongoDB Geospatial Indexing https://www.mongodb.com/docs/manual/core/geospatial-indexes/ + * @api public + */ + +/** + * Specifies a `$near` or `$nearSphere` condition + * + * These operators return documents sorted by distance. + * + * #### Example: + * + * query.where('loc').near({ center: [10, 10] }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5 }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5, spherical: true }); + * query.near('loc', { center: [10, 10], maxDistance: 5 }); + * + * @method near + * @memberOf Query + * @instance + * @param {string} [path] + * @param {object} val + * @return {Query} this + * @see $near https://www.mongodb.com/docs/manual/reference/operator/near/ + * @see $nearSphere https://www.mongodb.com/docs/manual/reference/operator/nearSphere/ + * @see $maxDistance https://www.mongodb.com/docs/manual/reference/operator/maxDistance/ + * @see MongoDB Geospatial Indexing https://www.mongodb.com/docs/manual/core/geospatial-indexes/ + * @api public + */ + +/** + * Overwriting mquery is needed to support a couple different near() forms found in older + * versions of mongoose + * near([1,1]) + * near(1,1) + * near(field, [1,2]) + * near(field, 1, 2) + * In addition to all of the normal forms supported by mquery + * + * @method near + * @memberOf Query + * @instance + * @api private + */ + +Query.prototype.near = function() { + const params = []; + const sphere = this._mongooseOptions.nearSphere; + + // TODO refactor + + if (arguments.length === 1) { + if (Array.isArray(arguments[0])) { + params.push({ center: arguments[0], spherical: sphere }); + } else if (typeof arguments[0] === 'string') { + // just passing a path + params.push(arguments[0]); + } else if (utils.isObject(arguments[0])) { + if (typeof arguments[0].spherical !== 'boolean') { + arguments[0].spherical = sphere; + } + params.push(arguments[0]); + } else { + throw new TypeError('invalid argument'); + } + } else if (arguments.length === 2) { + if (typeof arguments[0] === 'number' && typeof arguments[1] === 'number') { + params.push({ center: [arguments[0], arguments[1]], spherical: sphere }); + } else if (typeof arguments[0] === 'string' && Array.isArray(arguments[1])) { + params.push(arguments[0]); + params.push({ center: arguments[1], spherical: sphere }); + } else if (typeof arguments[0] === 'string' && utils.isObject(arguments[1])) { + params.push(arguments[0]); + if (typeof arguments[1].spherical !== 'boolean') { + arguments[1].spherical = sphere; + } + params.push(arguments[1]); + } else { + throw new TypeError('invalid argument'); + } + } else if (arguments.length === 3) { + if (typeof arguments[0] === 'string' && typeof arguments[1] === 'number' + && typeof arguments[2] === 'number') { + params.push(arguments[0]); + params.push({ center: [arguments[1], arguments[2]], spherical: sphere }); + } else { + throw new TypeError('invalid argument'); + } + } else { + throw new TypeError('invalid argument'); + } + + return Query.base.near.apply(this, params); +}; + +/** + * _DEPRECATED_ Specifies a `$nearSphere` condition + * + * #### Example: + * + * query.where('loc').nearSphere({ center: [10, 10], maxDistance: 5 }); + * + * **Deprecated.** Use `query.near()` instead with the `spherical` option set to `true`. + * + * #### Example: + * + * query.where('loc').near({ center: [10, 10], spherical: true }); + * + * @deprecated + * @see near() https://mongoosejs.com/docs/api/query.html#Query.prototype.near() + * @see $near https://www.mongodb.com/docs/manual/reference/operator/near/ + * @see $nearSphere https://www.mongodb.com/docs/manual/reference/operator/nearSphere/ + * @see $maxDistance https://www.mongodb.com/docs/manual/reference/operator/maxDistance/ + */ + +Query.prototype.nearSphere = function() { + this._mongooseOptions.nearSphere = true; + this.near.apply(this, arguments); + return this; +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js) + * This function *only* works for `find()` queries. + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example: + * + * for await (const doc of Model.aggregate([{ $sort: { name: 1 } }])) { + * console.log(doc.name); + * } + * + * @method [Symbol.asyncIterator] + * @memberOf Query + * @instance + * @api public + */ + +Query.prototype[Symbol.asyncIterator] = function queryAsyncIterator() { + // Set so QueryCursor knows it should transform results for async iterators into `{ value, done }` syntax + this._mongooseOptions._asyncIterator = true; + return this.cursor(); +}; + +/** + * Specifies a `$polygon` condition + * + * #### Example: + * + * query.where('loc').within().polygon([10, 20], [13, 25], [7, 15]); + * query.polygon('loc', [10, 20], [13, 25], [7, 15]); + * + * @method polygon + * @memberOf Query + * @instance + * @param {string|Array} [path] + * @param {...Array|object} [coordinatePairs] + * @return {Query} this + * @see $polygon https://www.mongodb.com/docs/manual/reference/operator/polygon/ + * @see MongoDB Geospatial Indexing https://www.mongodb.com/docs/manual/core/geospatial-indexes/ + * @api public + */ + +/** + * Specifies a `$box` condition + * + * #### Example: + * + * const lowerLeft = [40.73083, -73.99756] + * const upperRight= [40.741404, -73.988135] + * + * query.where('loc').within().box(lowerLeft, upperRight) + * query.box({ ll : lowerLeft, ur : upperRight }) + * + * @method box + * @memberOf Query + * @instance + * @see $box https://www.mongodb.com/docs/manual/reference/operator/box/ + * @see within() Query#within https://mongoosejs.com/docs/api/query.html#Query.prototype.within() + * @see MongoDB Geospatial Indexing https://www.mongodb.com/docs/manual/core/geospatial-indexes/ + * @param {object|Array} val1 Lower Left Coordinates OR an object of lower-left(ll) and upper-right(ur) Coordinates + * @param {Array} [val2] Upper Right Coordinates + * @return {Query} this + * @api public + */ + +/** + * this is needed to support the mongoose syntax of: + * box(field, { ll : [x,y], ur : [x2,y2] }) + * box({ ll : [x,y], ur : [x2,y2] }) + * + * @method box + * @memberOf Query + * @instance + * @api private + */ + +Query.prototype.box = function(ll, ur) { + if (!Array.isArray(ll) && utils.isObject(ll)) { + ur = ll.ur; + ll = ll.ll; + } + return Query.base.box.call(this, ll, ur); +}; + +/** + * Specifies a `$center` or `$centerSphere` condition. + * + * #### Example: + * + * const area = { center: [50, 50], radius: 10, unique: true } + * query.where('loc').within().circle(area) + * // alternatively + * query.circle('loc', area); + * + * // spherical calculations + * const area = { center: [50, 50], radius: 10, unique: true, spherical: true } + * query.where('loc').within().circle(area) + * // alternatively + * query.circle('loc', area); + * + * @method circle + * @memberOf Query + * @instance + * @param {string} [path] + * @param {object} area + * @return {Query} this + * @see $center https://www.mongodb.com/docs/manual/reference/operator/center/ + * @see $centerSphere https://www.mongodb.com/docs/manual/reference/operator/centerSphere/ + * @see $geoWithin https://www.mongodb.com/docs/manual/reference/operator/geoWithin/ + * @see MongoDB Geospatial Indexing https://www.mongodb.com/docs/manual/core/geospatial-indexes/ + * @api public + */ + +/** + * _DEPRECATED_ Alias for [circle](https://mongoosejs.com/docs/api/query.html#Query.prototype.circle()) + * + * **Deprecated.** Use [circle](https://mongoosejs.com/docs/api/query.html#Query.prototype.circle()) instead. + * + * @deprecated + * @method center + * @memberOf Query + * @instance + * @api public + */ + +Query.prototype.center = Query.base.circle; + +/** + * _DEPRECATED_ Specifies a `$centerSphere` condition + * + * **Deprecated.** Use [circle](https://mongoosejs.com/docs/api/query.html#Query.prototype.circle()) instead. + * + * #### Example: + * + * const area = { center: [50, 50], radius: 10 }; + * query.where('loc').within().centerSphere(area); + * + * @deprecated + * @param {string} [path] + * @param {object} val + * @return {Query} this + * @see MongoDB Geospatial Indexing https://www.mongodb.com/docs/manual/core/geospatial-indexes/ + * @see $centerSphere https://www.mongodb.com/docs/manual/reference/operator/centerSphere/ + * @api public + */ + +Query.prototype.centerSphere = function() { + if (typeof arguments[0]?.constructor === 'function' && arguments[0].constructor.name === 'Object') { + arguments[0].spherical = true; + } + + if (typeof arguments[1]?.constructor === 'function' && arguments[1].constructor.name === 'Object') { + arguments[1].spherical = true; + } + + Query.base.circle.apply(this, arguments); +}; + +/** + * Determines if field selection has been made. + * + * @method selected + * @memberOf Query + * @instance + * @return {boolean} + * @api public + */ + +/** + * Determines if inclusive field selection has been made. + * + * query.selectedInclusively(); // false + * query.select('name'); + * query.selectedInclusively(); // true + * + * @method selectedInclusively + * @memberOf Query + * @instance + * @return {boolean} + * @api public + */ + +Query.prototype.selectedInclusively = function selectedInclusively() { + return isInclusive(this._fields); +}; + +/** + * Determines if exclusive field selection has been made. + * + * query.selectedExclusively(); // false + * query.select('-name'); + * query.selectedExclusively(); // true + * query.selectedInclusively(); // false + * + * @method selectedExclusively + * @memberOf Query + * @instance + * @return {boolean} + * @api public + */ + +Query.prototype.selectedExclusively = function selectedExclusively() { + return isExclusive(this._fields); +}; + +/** + * The model this query is associated with. + * + * #### Example: + * + * const q = MyModel.find(); + * q.model === MyModel; // true + * + * @api public + * @property model + * @memberOf Query + * @instance + */ + +Query.prototype.model; + +/** + * Determine if we can merge the given value as a query filter. Override for mquery.canMerge() to allow null + */ + +function canMerge(value) { + return value instanceof Query || utils.isObject(value) || value === null; + +} + +/*! + * Export + */ + +module.exports = Query; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/queryHelpers.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/queryHelpers.js new file mode 100644 index 00000000..efba750d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/queryHelpers.js @@ -0,0 +1,418 @@ +'use strict'; + +/*! + * Module dependencies + */ + +const PopulateOptions = require('./options/populateOptions'); +const checkEmbeddedDiscriminatorKeyProjection = + require('./helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection'); +const get = require('./helpers/get'); +const getDiscriminatorByValue = + require('./helpers/discriminator/getDiscriminatorByValue'); +const isDefiningProjection = require('./helpers/projection/isDefiningProjection'); +const clone = require('./helpers/clone'); +const isPathSelectedInclusive = require('./helpers/projection/isPathSelectedInclusive'); + +/** + * Prepare a set of path options for query population. This is the MongooseQuery + * version + * + * @param {Query} query + * @param {object} options + * @return {Array} + */ + +exports.preparePopulationOptionsMQ = function preparePopulationOptionsMQ(query, options) { + const _populate = query._mongooseOptions.populate; + const pop = Object.keys(_populate).reduce((vals, key) => vals.concat([_populate[key]]), []); + + // lean options should trickle through all queries + if (options.lean != null) { + pop + .filter(p => p?.options?.lean == null) + .forEach(makeLean(options.lean)); + } + + const session = query?.options?.session || null; + if (session != null) { + pop.forEach(path => { + if (path.options == null) { + path.options = { session: session }; + return; + } + if (!('session' in path.options)) { + path.options.session = session; + } + }); + } + + const projection = query._fieldsForExec(); + for (let i = 0; i < pop.length; ++i) { + if (pop[i] instanceof PopulateOptions) { + pop[i] = new PopulateOptions({ + ...pop[i], + _queryProjection: projection, + _localModel: query.model + }); + } else { + pop[i]._queryProjection = projection; + pop[i]._localModel = query.model; + } + } + + return pop; +}; + +/** + * If the document is a mapped discriminator type, it returns a model instance for that type, otherwise, + * it returns an instance of the given model. + * + * @param {Model} model + * @param {object} doc + * @param {object} fields + * + * @return {Document} + */ +exports.createModel = function createModel(model, doc, fields, userProvidedFields, options) { + model.hooks.execPreSync('createModel', doc); + const discriminatorMapping = model.schema ? + model.schema.discriminatorMapping : + null; + + const key = discriminatorMapping?.isRoot ? + discriminatorMapping.key : + null; + + const _opts = { + skipId: true, + isNew: false, + willInit: true + }; + if (options?.defaults != null) { + _opts.defaults = options.defaults; + } + if (options?.strict != null) { + _opts.strict = options.strict; + } + + const value = doc[key]; + if (key && value && model.discriminators) { + const discriminator = model.discriminators[value] || getDiscriminatorByValue(model.discriminators, value); + if (discriminator) { + const _fields = clone(userProvidedFields); + exports.applyPaths(_fields, discriminator.schema); + + return new discriminator(undefined, _fields, _opts); + } + } + + return new model(undefined, fields, _opts); +}; + +/*! + * ignore + */ + +exports.createModelAndInit = function createModelAndInit(model, doc, fields, userProvidedFields, options, populatedIds, callback) { + const initOpts = {}; + if (populatedIds) { + initOpts.populated = populatedIds; + } + if (options?.middleware != null) { + initOpts.middleware = options.middleware; + } + + const casted = exports.createModel(model, doc, fields, userProvidedFields, options); + try { + casted.$init(doc, initOpts, callback); + } catch (error) { + callback(error, casted); + } +}; + +/*! + * ignore + */ + +exports.applyPaths = function applyPaths(fields, schema, sanitizeProjection) { + // determine if query is selecting or excluding fields + let exclude; + let keys; + const minusPathsToSkip = new Set(); + + if (fields) { + keys = Object.keys(fields); + + // Collapse minus paths + const minusPaths = []; + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (keys[i][0] !== '-') { + continue; + } + + delete fields[key]; + if (key === '-_id') { + fields['_id'] = 0; + } else { + minusPaths.push(key.slice(1)); + } + } + + keys = Object.keys(fields); + for (let keyIndex = 0; keyIndex < keys.length; ++keyIndex) { + if (keys[keyIndex][0] === '+') { + continue; + } + const field = fields[keys[keyIndex]]; + // Skip `$meta` and `$slice` + if (!isDefiningProjection(field)) { + continue; + } + if (keys[keyIndex] === '_id' && keys.length > 1) { + continue; + } + if (keys[keyIndex] === schema.options.discriminatorKey && keys.length > 1 && field != null && !field) { + continue; + } + exclude = !field; + break; + } + + // Potentially add back minus paths based on schema-level path config + // and whether the projection is inclusive + for (const path of minusPaths) { + const type = schema.path(path); + // If the path isn't selected by default or the projection is not + // inclusive, minus path is treated as equivalent to `key: 0`. + // But we also allow using `-name` to remove `name` from an inclusive + // projection if `name` has schema-level `select: true`. + if (!type?.selected || exclude !== false) { + fields[path] = 0; + exclude = true; + } else if (type?.selected && exclude === false) { + // Make a note of minus paths that are overwriting paths that are + // included by default. + minusPathsToSkip.add(path); + } + } + } + + // if selecting, apply default schematype select:true fields + // if excluding, apply schematype select:false fields + const selected = []; + const excluded = []; + const stack = []; + + analyzeSchema(schema); + switch (exclude) { + case true: + for (const fieldName of excluded) { + // Skip if an ancestor path is already excluded in `fields` (for + // example the user did `.select('-subd')` and `subd.raw` has + // schema-level `select: false`) to avoid MongoDB's "Path collision" + // error from projecting both `subd` and `subd.raw`. See gh-12798 + if (hasExcludedAncestor(fields, fieldName)) { + continue; + } + fields[fieldName] = 0; + } + break; + case false: + if (schema?.paths['_id']?.options?.select === false) { + fields._id = 0; + } + + for (const fieldName of selected) { + if (minusPathsToSkip.has(fieldName)) { + continue; + } + if (isPathSelectedInclusive(fields, fieldName)) { + continue; + } + fields[fieldName] = fields[fieldName] || 1; + } + break; + case undefined: + if (fields == null) { + break; + } + // Any leftover plus paths must in the schema, so delete them (gh-7017) + for (const key of Object.keys(fields || {})) { + if (key.startsWith('+')) { + delete fields[key]; + } + } + + // user didn't specify fields, implies returning all fields. + // only need to apply excluded fields and delete any plus paths + for (const fieldName of excluded) { + if (fields[fieldName] != null) { + // Skip applying default projections to fields with non-defining + // projections, like `$slice` + continue; + } + fields[fieldName] = 0; + } + break; + } + + function analyzeSchema(schema, prefix) { + prefix || (prefix = ''); + + // avoid recursion + if (stack.indexOf(schema) !== -1) { + return []; + } + stack.push(schema); + + const addedPaths = []; + schema.eachPath(function(path, type) { + if (prefix) path = prefix + '.' + path; + if (type.$isSchemaMap || path.endsWith('.$*')) { + const plusPath = '+' + path; + const hasPlusPath = fields && plusPath in fields; + if (type.options?.select === false && !hasPlusPath) { + excluded.push(path); + } + return; + } + let addedPath = analyzePath(path, type); + // arrays + if (addedPath == null && !Array.isArray(type) && type.$isMongooseArray && !type.$isMongooseDocumentArray) { + addedPath = analyzePath(path, type.embeddedSchemaType); + } + if (addedPath != null) { + addedPaths.push(addedPath); + } + + // nested schemas + if (type.schema) { + const _addedPaths = analyzeSchema(type.schema, path); + + // Special case: if discriminator key is the only field that would + // be projected in, remove it. + if (exclude === false) { + checkEmbeddedDiscriminatorKeyProjection(fields, path, type.schema, + selected, _addedPaths); + } + } + }); + stack.pop(); + return addedPaths; + } + + function analyzePath(path, type) { + if (fields == null) { + return; + } + + // If schema-level selected not set, nothing to do + if (typeof type.selected !== 'boolean') { + return; + } + + // User overwriting default exclusion + if (type.selected === false && fields[path]) { + if (sanitizeProjection) { + fields[path] = 0; + } + + return; + } + + // If set to 0, we're explicitly excluding the discriminator key. Can't do this for all fields, + // because we have tests that assert that using `-path` to exclude schema-level `select: true` + // fields counts as an exclusive projection. See gh-11546 + if (!exclude && type.selected && path === schema.options.discriminatorKey && fields[path] != null && !fields[path]) { + delete fields[path]; + return; + } + + if (exclude === false && type.selected && fields[path] != null && !fields[path]) { + delete fields[path]; + return; + } + + const plusPath = '+' + path; + const hasPlusPath = fields && plusPath in fields; + if (hasPlusPath) { + // forced inclusion + delete fields[plusPath]; + + // if there are other fields being included, add this one + // if no other included fields, leave this out (implied inclusion) + if (exclude === false && keys.length > 1 && !~keys.indexOf(path) && !sanitizeProjection) { + fields[path] = 1; + } else if (exclude == null && sanitizeProjection && type.selected === false) { + fields[path] = 0; + } + + return; + } + + // check for parent exclusions + const pieces = path.split('.'); + let cur = ''; + for (let i = 0; i < pieces.length; ++i) { + cur += cur.length ? '.' + pieces[i] : pieces[i]; + if (excluded.indexOf(cur) !== -1) { + return; + } + } + + // Special case: if user has included a parent path of a discriminator key, + // don't explicitly project in the discriminator key because that will + // project out everything else under the parent path + if (!exclude && (type?.options?.$skipDiscriminatorCheck || false)) { + let cur = ''; + for (let i = 0; i < pieces.length; ++i) { + cur += (cur.length === 0 ? '' : '.') + pieces[i]; + const projection = get(fields, cur, false) || get(fields, cur + '.$', false); + if (projection && typeof projection !== 'object') { + return; + } + } + } + + (type.selected ? selected : excluded).push(path); + return path; + } + + function hasExcludedAncestor(fields, path) { + let i = -1; + while ((i = path.indexOf('.', i + 1)) !== -1) { + const ancestor = fields[path.slice(0, i)]; + // Any falsy defining value (`0`, `false`, `''`, `NaN`) excludes a + // path, matching how `exclude` itself is derived above (`!field`). + // `ancestor == null` means the key isn't present at all, which is + // not an exclusion. See gh-12798 + if (ancestor != null && !ancestor) { + return true; + } + } + return false; + } +}; + +/** + * Set each path query option to lean + * + * @param {object} option + */ + +function makeLean(val) { + return function(option) { + option.options || (option.options = {}); + + if (Array.isArray(val?.virtuals)) { + val = Object.assign({}, val); + val.virtuals = val.virtuals. + filter(path => typeof path === 'string' && path.startsWith(option.path + '.')). + map(path => path.slice(option.path.length + 1)); + } + + option.options.lean = val; + }; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema.js new file mode 100644 index 00000000..a726d69c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema.js @@ -0,0 +1,3382 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EventEmitter = require('events').EventEmitter; +const Kareem = require('kareem'); +const MongooseError = require('./error/mongooseError'); +const PathTrie = require('./helpers/pathTrie'); +const SchemaType = require('./schemaType'); +const SchemaTypeOptions = require('./options/schemaTypeOptions'); +const VirtualOptions = require('./options/virtualOptions'); +const VirtualType = require('./virtualType'); +const addAutoId = require('./helpers/schema/addAutoId'); +const clone = require('./helpers/clone'); +const get = require('./helpers/get'); +const getConstructorName = require('./helpers/getConstructorName'); +const getIndexes = require('./helpers/schema/getIndexes'); +const handleReadPreferenceAliases = require('./helpers/query/handleReadPreferenceAliases'); +const idGetter = require('./helpers/schema/idGetter'); +const isIndexSpecEqual = require('./helpers/indexes/isIndexSpecEqual'); +const merge = require('./helpers/schema/merge'); +const mpath = require('mpath'); +const setPopulatedVirtualValue = require('./helpers/populate/setPopulatedVirtualValue'); +const setupTimestamps = require('./helpers/timestamps/setupTimestamps'); +const symbols = require('./schema/symbols'); +const utils = require('./utils'); +const validateRef = require('./helpers/populate/validateRef'); + +const hasNumericSubpathRegex = /\.\d+(\.|$)/; + +let MongooseTypes; + +const queryHooks = require('./constants').queryMiddlewareFunctions; +const documentHooks = require('./constants').documentMiddlewareFunctions; +const hookNames = queryHooks.concat(documentHooks). + reduce((s, hook) => s.add(hook), new Set()); + +const isPOJO = utils.isPOJO; + +let id = 0; + +const numberRE = /^\d+$/; + +/** + * Schema constructor. + * + * #### Example: + * + * const child = new Schema({ name: String }); + * const schema = new Schema({ name: String, age: Number, children: [child] }); + * const Tree = mongoose.model('Tree', schema); + * + * // setting schema options + * new Schema({ name: String }, { id: false, autoIndex: false }) + * + * #### Options: + * + * - [autoIndex](https://mongoosejs.com/docs/guide.html#autoIndex): bool - defaults to null (which means use the connection's autoIndex option) + * - [autoCreate](https://mongoosejs.com/docs/guide.html#autoCreate): bool - defaults to null (which means use the connection's autoCreate option) + * - [bufferCommands](https://mongoosejs.com/docs/guide.html#bufferCommands): bool - defaults to true + * - [bufferTimeoutMS](https://mongoosejs.com/docs/guide.html#bufferTimeoutMS): number - defaults to 10000 (10 seconds). If `bufferCommands` is enabled, the amount of time Mongoose will wait for connectivity to be established before erroring out. + * - [capped](https://mongoosejs.com/docs/guide.html#capped): bool | number | object - defaults to false + * - [collection](https://mongoosejs.com/docs/guide.html#collection): string - no default + * - [discriminatorKey](https://mongoosejs.com/docs/guide.html#discriminatorKey): string - defaults to `__t` + * - [id](https://mongoosejs.com/docs/guide.html#id): bool - defaults to true + * - [_id](https://mongoosejs.com/docs/guide.html#_id): bool - defaults to true + * - [minimize](https://mongoosejs.com/docs/guide.html#minimize): bool - controls [document#toObject](https://mongoosejs.com/docs/api/document.html#Document.prototype.toObject()) behavior when called manually - defaults to true + * - [read](https://mongoosejs.com/docs/guide.html#read): string + * - [readConcern](https://mongoosejs.com/docs/guide.html#readConcern): object - defaults to null, use to set a default [read concern](https://www.mongodb.com/docs/manual/reference/read-concern/) for all queries. + * - [writeConcern](https://mongoosejs.com/docs/guide.html#writeConcern): object - defaults to null, use to override [the MongoDB server's default write concern settings](https://www.mongodb.com/docs/manual/reference/write-concern/) + * - [shardKey](https://mongoosejs.com/docs/guide.html#shardKey): object - defaults to `null` + * - [strict](https://mongoosejs.com/docs/guide.html#strict): bool - defaults to true + * - [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery): bool - defaults to false + * - [strictRead](https://mongoosejs.com/docs/guide.html#strictRead): bool or 'throw' - defaults to false. If set to `true`, fields not in the schema will be stripped when hydrating documents from MongoDB. If set to `'throw'`, an error will be thrown when a field not in the schema is encountered during document hydration. + * - [toJSON](https://mongoosejs.com/docs/guide.html#toJSON) - object - no default + * - [toObject](https://mongoosejs.com/docs/guide.html#toObject) - object - no default + * - [typeKey](https://mongoosejs.com/docs/guide.html#typeKey) - string - defaults to 'type' + * - [validateBeforeSave](https://mongoosejs.com/docs/guide.html#validateBeforeSave) - bool - defaults to `true` + * - [validateModifiedOnly](https://mongoosejs.com/docs/api/document.html#Document.prototype.validate()) - bool - defaults to `false` + * - [versionKey](https://mongoosejs.com/docs/guide.html#versionKey): string or object - defaults to "__v" + * - [optimisticConcurrency](https://mongoosejs.com/docs/guide.html#optimisticConcurrency): bool or string[] or { exclude: string[] } - defaults to false. Set to true to enable [optimistic concurrency](https://thecodebarbarian.com/whats-new-in-mongoose-5-10-optimistic-concurrency.html) for all fields. Set to a string array to enable optimistic concurrency only for the specified fields; note that this **replaces** the default array versioning behavior. Set to `{ exclude: string[] }` to enable optimistic concurrency for all fields except the specified ones; this also replaces the default array versioning. Paths may include the map wildcard `$*`, like `'settings.$*'`, to match all keys of a map. + * - [collation](https://mongoosejs.com/docs/guide.html#collation): object - defaults to null (which means use no collation) + * - [timeseries](https://mongoosejs.com/docs/guide.html#timeseries): object - defaults to null (which means this schema's collection won't be a timeseries collection) + * - [selectPopulatedPaths](https://mongoosejs.com/docs/guide.html#selectPopulatedPaths): boolean - defaults to `true` + * - [skipVersioning](https://mongoosejs.com/docs/guide.html#skipVersioning): object - paths to exclude from versioning + * - [timestamps](https://mongoosejs.com/docs/guide.html#timestamps): object or boolean - defaults to `false`. If true, Mongoose adds `createdAt` and `updatedAt` properties to your schema and manages those properties for you. + * - [pluginTags](https://mongoosejs.com/docs/guide.html#pluginTags): array of strings - defaults to `undefined`. If set and plugin called with `tags` option, will only apply that plugin to schemas with a matching tag. + * - [virtuals](https://mongoosejs.com/docs/tutorials/virtuals.html#virtuals-via-schema-options): object - virtuals to define, alias for [`.virtual`](https://mongoosejs.com/docs/api/schema.html#Schema.prototype.virtual()) + * - [collectionOptions]: object with options passed to [`createCollection()`](https://www.mongodb.com/docs/manual/reference/method/db.createCollection/) when calling `Model.createCollection()` or `autoCreate` set to true. + * - [encryptionType]: the encryption type for the schema. Valid options are `csfle` or `queryableEncryption`. See https://mongoosejs.com/docs/field-level-encryption.html. + * - [lean]: boolean - set to true to make all queries use [lean](https://mongoosejs.com/docs/tutorials/lean.html) by default. Defaults to false. + * + * #### Options for Nested Schemas: + * + * - `excludeIndexes`: bool - defaults to `false`. If `true`, skip building indexes on this schema's paths. + * + * #### Note: + * + * _When nesting schemas, (`children` in the example above), always declare the child schema first before passing it into its parent._ + * + * @param {object|Schema|Array} [definition] Can be one of: object describing schema paths, or schema to copy, or array of objects and schemas + * @param {object} [options] + * @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#class-eventemitter + * @event `init`: Emitted after the schema is compiled into a `Model`. + * @api public + */ + +function Schema(obj, options) { + if (!(this instanceof Schema)) { + return new Schema(obj, options); + } + + this.obj = obj; + this.paths = {}; + this.aliases = {}; + this.subpaths = {}; + this.virtuals = {}; + this.singleNestedPaths = {}; + this.nested = {}; + this.inherits = {}; + this.callQueue = []; + this._indexes = []; + this._searchIndexes = []; + this.methods = options?.methods || {}; + this.methodOptions = {}; + this.statics = options?.statics || {}; + this.tree = {}; + this.query = options?.query || {}; + this.childSchemas = []; + this.plugins = []; + // For internal debugging. Do not use this to try to save a schema in MDB. + this.$id = ++id; + this.mapPaths = []; + this.encryptedFields = {}; + + this.s = { + hooks: new Kareem() + }; + this.options = this.defaultOptions(options); + + // build paths + if (Array.isArray(obj)) { + for (const definition of obj) { + this.add(definition); + } + } else if (obj) { + this.add(obj); + } + + // build virtual paths + if (options?.virtuals) { + const virtuals = options.virtuals; + const pathNames = Object.keys(virtuals); + for (const pathName of pathNames) { + const pathOptions = virtuals[pathName].options ? virtuals[pathName].options : undefined; + const virtual = this.virtual(pathName, pathOptions); + + if (virtuals[pathName].get) { + virtual.get(virtuals[pathName].get); + } + + if (virtuals[pathName].set) { + virtual.set(virtuals[pathName].set); + } + } + } + + // check if _id's value is a subdocument (gh-2276) + const _idSubDoc = obj?._id && utils.isObject(obj._id); + + // ensure the documents get an auto _id unless disabled + const auto_id = !this.paths['_id'] && + (this.options._id) && !_idSubDoc; + + if (auto_id) { + addAutoId(this); + } + + this.setupTimestamp(this.options.timestamps); +} + +/** + * Create virtual properties with alias field + * @api private + */ +function aliasFields(schema, paths) { + for (const path of Object.keys(paths)) { + let alias = null; + if (paths[path] != null) { + alias = paths[path]; + } else { + const options = get(schema.paths[path], 'options'); + if (options == null) { + continue; + } + + alias = options.alias; + } + + if (!alias) { + continue; + } + + const prop = schema.paths[path].path; + if (Array.isArray(alias)) { + for (const a of alias) { + if (typeof a !== 'string') { + throw new MongooseError('Invalid value for alias option on ' + prop + ', got ' + a); + } + + schema.aliases[a] = prop; + + schema. + virtual(a). + get((function(p) { + return function() { + if (typeof this.get === 'function') { + return this.get(p); + } + return this[p]; + }; + })(prop)). + set((function(p) { + return function(v) { + return this.$set(p, v); + }; + })(prop)); + } + + continue; + } + + if (typeof alias !== 'string') { + throw new MongooseError('Invalid value for alias option on ' + prop + ', got ' + alias); + } + + schema.aliases[alias] = prop; + + schema. + virtual(alias). + get((function(p) { + return function() { + if (typeof this.get === 'function') { + return this.get(p); + } + return this[p]; + }; + })(prop)). + set((function(p) { + return function(v) { + return this.$set(p, v); + }; + })(prop)); + } +} + +/*! + * Inherit from EventEmitter. + */ +Schema.prototype = Object.create(EventEmitter.prototype); +Schema.prototype.constructor = Schema; +Schema.prototype.instanceOfSchema = true; + +/*! + * ignore + */ + +Object.defineProperty(Schema.prototype, '$schemaType', { + configurable: false, + enumerable: false, + writable: true +}); + +/** + * Array of child schemas (from document arrays and single nested subdocs) + * and their corresponding compiled models. Each element of the array is + * an object with 2 properties: `schema` and `model`. + * + * This property is typically only useful for plugin authors and advanced users. + * You do not need to interact with this property at all to use mongoose. + * + * @api public + * @property childSchemas + * @memberOf Schema + * @instance + */ + +Object.defineProperty(Schema.prototype, 'childSchemas', { + configurable: false, + enumerable: true, + writable: true +}); + +/** + * Object containing all virtuals defined on this schema. + * The objects' keys are the virtual paths and values are instances of `VirtualType`. + * + * This property is typically only useful for plugin authors and advanced users. + * You do not need to interact with this property at all to use mongoose. + * + * #### Example: + * + * const schema = new Schema({}); + * schema.virtual('answer').get(() => 42); + * + * console.log(schema.virtuals); // { answer: VirtualType { path: 'answer', ... } } + * console.log(schema.virtuals['answer'].getters[0].call()); // 42 + * + * @api public + * @property virtuals + * @memberOf Schema + * @instance + */ + +Object.defineProperty(Schema.prototype, 'virtuals', { + configurable: false, + enumerable: true, + writable: true +}); + +/** + * The original object passed to the schema constructor + * + * #### Example: + * + * const schema = new Schema({ a: String }).add({ b: String }); + * schema.obj; // { a: String } + * + * @api public + * @property obj + * @memberOf Schema + * @instance + */ + +Schema.prototype.obj; + +/** + * The paths defined on this schema. The keys are the top-level paths + * in this schema, and the values are instances of the SchemaType class. + * + * #### Example: + * + * const schema = new Schema({ name: String }, { _id: false }); + * schema.paths; // { name: SchemaString { ... } } + * + * schema.add({ age: Number }); + * schema.paths; // { name: SchemaString { ... }, age: SchemaNumber { ... } } + * + * @api public + * @property paths + * @memberOf Schema + * @instance + */ + +Schema.prototype.paths; + +/** + * Schema as a tree + * + * #### Example: + * + * { + * '_id' : ObjectId + * , 'nested' : { + * 'key' : String + * } + * } + * + * @api private + * @property tree + * @memberOf Schema + * @instance + */ + +Schema.prototype.tree; + +/** + * Creates a new schema with the given definition and options. Equivalent to `new Schema(definition, options)`. + * + * `Schema.create()` is primarily useful for automatic schema type inference in TypeScript. + * + * #### Example: + * + * const schema = Schema.create({ name: String }, { toObject: { virtuals: true } }); + * // Equivalent: + * const schema2 = new Schema({ name: String }, { toObject: { virtuals: true } }); + * + * @param {object} definition + * @param {object} [options] + * @return {Schema} the new schema + * @api public + * @memberOf Schema + * @static + */ + +Schema.create = function create(definition, options) { + return new Schema(definition, options); +}; + +/** + * Returns a deep copy of the schema + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * const clone = schema.clone(); + * clone === schema; // false + * clone.path('name'); // SchemaString { ... } + * + * @return {Schema} the cloned schema + * @api public + * @memberOf Schema + * @instance + */ + +Schema.prototype.clone = function() { + const s = this._clone(); + + // Bubble up `init` for backwards compat + s.on('init', v => this.emit('init', v)); + + return s; +}; + +/*! + * ignore + */ + +Schema.prototype._clone = function _clone(Constructor) { + Constructor = Constructor || (this.base == null ? Schema : this.base.Schema); + + const s = new Constructor({}, this._userProvidedOptions); + s.base = this.base; + s.obj = this.obj; + s.options = clone(this.options); + s.callQueue = this.callQueue.map(function(f) { return f; }); + s.methods = clone(this.methods); + s.methodOptions = clone(this.methodOptions); + s.statics = clone(this.statics); + s.query = clone(this.query); + s.plugins = Array.prototype.slice.call(this.plugins); + s._indexes = clone(this._indexes); + s._searchIndexes = clone(this._searchIndexes); + s.s.hooks = this.s.hooks.clone(); + + s.tree = clone(this.tree); + s.paths = Object.fromEntries( + Object.entries(this.paths).map(([key, value]) => ([key, value.clone()])) + ); + s.nested = clone(this.nested); + s.subpaths = clone(this.subpaths); + + s.mapPaths = []; + for (const [path, schemaType] of Object.entries(s.paths)) { + const mapPath = path + '.$*'; + if (!schemaType.$isSchemaMap || !Object.hasOwn(s.paths, mapPath)) { + continue; + } + s.paths[mapPath] = schemaType.$__schemaType; + s.mapPaths.push(s.paths[mapPath]); + } + for (const schemaType of Object.values(s.paths)) { + if (schemaType.$isSingleNested) { + const path = schemaType.path; + for (const key of Object.keys(schemaType.schema.paths)) { + s.singleNestedPaths[path + '.' + key] = schemaType.schema.paths[key]; + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + s.singleNestedPaths[path + '.' + key] = + schemaType.schema.singleNestedPaths[key]; + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + s.singleNestedPaths[path + '.' + key] = + schemaType.schema.subpaths[key]; + } + for (const key of Object.keys(schemaType.schema.nested)) { + s.singleNestedPaths[path + '.' + key] = 'nested'; + } + } + } + s._gatherChildSchemas(); + + s.virtuals = clone(this.virtuals); + s.$globalPluginsApplied = this.$globalPluginsApplied; + s.$isRootDiscriminator = this.$isRootDiscriminator; + s.$implicitlyCreated = this.$implicitlyCreated; + s.$id = ++id; + s.$originalSchemaId = this.$id; + + if (this.discriminatorMapping != null) { + s.discriminatorMapping = Object.assign({}, this.discriminatorMapping); + } + if (this.discriminators != null) { + s.discriminators = Object.assign({}, this.discriminators); + } + if (this._applyDiscriminators != null) { + s._applyDiscriminators = new Map(this._applyDiscriminators); + } + + s.aliases = Object.assign({}, this.aliases); + + s.encryptedFields = clone(this.encryptedFields); + + return s; +}; + +/** + * Returns a new schema that has the picked `paths` from this schema. + * + * This method is analagous to [Lodash's `pick()` function](https://lodash.com/docs/4.17.15#pick) for Mongoose schemas. + * + * #### Example: + * + * const schema = Schema({ name: String, age: Number }); + * // Creates a new schema with the same `name` path as `schema`, + * // but no `age` path. + * const newSchema = schema.pick(['name']); + * + * newSchema.path('name'); // SchemaString { ... } + * newSchema.path('age'); // undefined + * + * @param {string[]} paths List of Paths to pick for the new Schema + * @param {object} [options] Options to pass to the new Schema Constructor (same as `new Schema(.., Options)`). Defaults to `this.options` if not set. + * @return {Schema} + * @api public + */ + +Schema.prototype.pick = function(paths, options) { + const newSchema = new Schema({}, options || this.options); + if (!Array.isArray(paths)) { + throw new MongooseError('Schema#pick() only accepts an array argument, ' + + 'got "' + typeof paths + '"'); + } + + for (const path of paths) { + if (this._hasEncryptedField(path)) { + const encrypt = this.encryptedFields[path]; + const schemaType = this.path(path); + newSchema.add({ + [path]: { + encrypt, + [this.options.typeKey]: schemaType + } + }); + } else if (this.nested[path]) { + newSchema.add({ [path]: get(this.tree, path) }); + } else { + const schematype = this.path(path); + if (schematype == null) { + throw new MongooseError('Path `' + path + '` is not in the schema'); + } + newSchema.add({ [path]: schematype }); + } + } + + if (!this._hasEncryptedFields()) { + newSchema.options.encryptionType = null; + } + + return newSchema; +}; + +/** + * Returns a new schema that has the `paths` from the original schema, minus the omitted ones. + * + * This method is analagous to [Lodash's `omit()` function](https://lodash.com/docs/#omit) for Mongoose schemas. + * + * #### Example: + * + * const schema = Schema({ name: String, age: Number }); + * // Creates a new schema omitting the `age` path + * const newSchema = schema.omit(['age']); + * + * newSchema.path('name'); // SchemaString { ... } + * newSchema.path('age'); // undefined + * + * @param {string[]} paths List of Paths to omit for the new Schema + * @param {object} [options] Options to pass to the new Schema Constructor (same as `new Schema(.., Options)`). Defaults to `this.options` if not set. + * @return {Schema} + * @api public + */ + +Schema.prototype.omit = function(paths, options) { + const newSchema = new Schema(this, options || this.options); + if (!Array.isArray(paths)) { + throw new MongooseError( + 'Schema#omit() only accepts an array argument, ' + + 'got "' + + typeof paths + + '"' + ); + } + + newSchema.remove(paths); + + return newSchema; +}; + +/** + * Returns default options for this schema, merged with `options`. + * + * @param {object} [options] Options to overwrite the default options + * @return {object} The merged options of `options` and the default options + * @api private + */ + +Schema.prototype.defaultOptions = function(options) { + this._userProvidedOptions = options == null ? {} : clone(options); + const baseOptions = this.base?.options || {}; + const defaultStrict = baseOptions.strict ?? true; + const defaultStrictQuery = baseOptions.strictQuery ?? false; + const defaultStrictRead = baseOptions.strictRead ?? false; + const defaultId = baseOptions.id ?? true; + options = { + strict: defaultStrict, + strictQuery: defaultStrictQuery, + strictRead: defaultStrictRead, + bufferCommands: true, + capped: false, // { size, max, autoIndexId } + versionKey: '__v', + optimisticConcurrency: false, + minimize: true, + autoIndex: null, + discriminatorKey: '__t', + shardKey: null, + read: null, + validateBeforeSave: true, + validateModifiedOnly: false, + // the following are only applied at construction time + _id: true, + id: defaultId, + typeKey: 'type', + ...options + }; + + // Treat `undefined` as "not provided" for these options + options.strict ??= defaultStrict; + options.strictQuery ??= defaultStrictQuery; + options.id ??= defaultId; + + if (options.versionKey && typeof options.versionKey !== 'string') { + throw new MongooseError('`versionKey` must be falsy or string, got `' + (typeof options.versionKey) + '`'); + } + + if (typeof options.read === 'string') { + options.read = handleReadPreferenceAliases(options.read); + } else if (Array.isArray(options.read) && typeof options.read[0] === 'string') { + options.read = { + mode: handleReadPreferenceAliases(options.read[0]), + tags: options.read[1] + }; + } + + if (options.optimisticConcurrency && !options.versionKey) { + throw new MongooseError('Must set `versionKey` if using `optimisticConcurrency`'); + } + + return options; +}; + +/** + * Inherit a Schema by applying a discriminator on an existing Schema. + * + * + * #### Example: + * + * const eventSchema = new mongoose.Schema({ timestamp: Date }, { discriminatorKey: 'kind' }); + * + * const clickedEventSchema = new mongoose.Schema({ element: String }, { discriminatorKey: 'kind' }); + * const ClickedModel = eventSchema.discriminator('clicked', clickedEventSchema); + * + * const Event = mongoose.model('Event', eventSchema); + * + * Event.discriminators['clicked']; // Model { clicked } + * + * const doc = await Event.create({ kind: 'clicked', element: '#hero' }); + * doc.element; // '#hero' + * doc instanceof ClickedModel; // true + * + * @param {string} name the name of the discriminator + * @param {Schema} schema the discriminated Schema + * @param {object} [options] discriminator options + * @param {string} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @param {boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning. + * @param {boolean} [options.overwriteModels=false] by default, Mongoose does not allow you to define a discriminator with the same name as another discriminator. Set this to allow overwriting discriminators with the same name. + * @param {boolean} [options.mergeHooks=true] By default, Mongoose merges the base schema's hooks with the discriminator schema's hooks. Set this option to `false` to make Mongoose use the discriminator schema's hooks instead. + * @param {boolean} [options.mergePlugins=true] By default, Mongoose merges the base schema's plugins with the discriminator schema's plugins. Set this option to `false` to make Mongoose use the discriminator schema's plugins instead. + * @return {Schema} the Schema instance + * @api public + */ +Schema.prototype.discriminator = function(name, schema, options) { + this._applyDiscriminators = this._applyDiscriminators || new Map(); + this._applyDiscriminators.set(name, { schema, options }); + + return this; +}; + +/*! + * Get the document middleware for this schema, filtering out any hooks that are specific to queries. + */ +Schema.prototype._getDocumentMiddleware = function _getDocumentMiddleware() { + return this.s.hooks. + filter(hook => { + if (hook.name === 'updateOne' || hook.name === 'deleteOne') { + return !!hook['document']; + } + if (hook.name === 'remove' || hook.name === 'init') { + return hook['document'] == null || !!hook['document']; + } + if (hook.query != null || hook.document != null) { + return hook.document !== false; + } + return true; + }). + filter(hook => { + // If user has overwritten the method, don't apply built-in middleware + if (this.methods[hook.name]) { + return !hook.fn[symbols.builtInMiddleware]; + } + + return true; + }); +}; + +/*! + * Get this schema's default toObject/toJSON options, including Mongoose global + * options. + */ + +Schema.prototype._defaultToObjectOptions = function(json) { + const path = json ? 'toJSON' : 'toObject'; + if (this._defaultToObjectOptionsMap && path in this._defaultToObjectOptionsMap) { + return this._defaultToObjectOptionsMap[path]; + } + + const baseOptions = this.base?.options?.[path] || {}; + const schemaOptions = this.options[path] || {}; + // merge base default options with Schema's set default options if available. + // `clone` is necessary here because `utils.options` directly modifies the second input. + const defaultOptions = Object.assign({}, baseOptions, schemaOptions); + + this._defaultToObjectOptionsMap = this._defaultToObjectOptionsMap || {}; + this._defaultToObjectOptionsMap[path] = utils.hasOwnKeys(defaultOptions) ? defaultOptions : null; + return defaultOptions; +}; + +/** + * Sets the encryption type of the schema, if a value is provided, otherwise + * returns the encryption type. + * + * @param {'csfle' | 'queryableEncryption' | null | undefined} encryptionType plain object with paths to add, or another schema + */ +Schema.prototype.encryptionType = function encryptionType(encryptionType) { + if (arguments.length === 0) { + return this.options.encryptionType; + } + if (!(typeof encryptionType === 'string' || encryptionType === null)) { + throw new MongooseError(`invalid \`encryptionType\`: ${encryptionType}`); + } + this.options.encryptionType = encryptionType; +}; + +/** + * Adds key path / schema type pairs to this schema. + * + * #### Example: + * + * const ToySchema = new Schema(); + * ToySchema.add({ name: 'string', color: 'string', price: 'number' }); + * + * const TurboManSchema = new Schema(); + * // You can also `add()` another schema and copy over all paths, virtuals, + * // getters, setters, indexes, methods, and statics. + * TurboManSchema.add(ToySchema).add({ year: Number }); + * + * @param {object|Schema} obj plain object with paths to add, or another schema + * @param {string} [prefix] path to prefix the newly added paths with + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.add = function add(obj, prefix) { + if (obj instanceof Schema || obj?.instanceOfSchema) { + merge(this, obj); + return this; + } + + // Special case: setting top-level `_id` to false should convert to disabling + // the `_id` option. This behavior never worked before 5.4.11 but numerous + // codebases use it (see gh-7516, gh-7512). + if (obj._id === false && prefix == null) { + this.options._id = false; + } + + prefix = prefix || ''; + // avoid prototype pollution + if (prefix === '__proto__.' || prefix === 'constructor.' || prefix === 'prototype.') { + return this; + } + + const keys = Object.keys(obj); + const typeKey = this.options.typeKey; + for (const key of keys) { + if (utils.specialProperties.has(key)) { + continue; + } + + const fullPath = prefix + key; + const val = obj[key]; + + if (val == null) { + throw new TypeError('Invalid value for schema path `' + fullPath + + '`, got value "' + val + '"'); + } + // Retain `_id: false` but don't set it as a path, re: gh-8274. + if (key === '_id' && val === false) { + continue; + } + // Deprecate setting schema paths to primitive types (gh-7558) + let isMongooseTypeString = false; + if (typeof val === 'string') { + // Handle the case in which the type is specified as a string (eg. 'date', 'oid', ...) + const MongooseTypes = this.base?.Schema.Types ?? Schema.Types; + const upperVal = val.charAt(0).toUpperCase() + val.substring(1); + isMongooseTypeString = MongooseTypes[upperVal] != null; + } + if ( + key !== '_id' && + ((typeof val !== 'object' && typeof val !== 'function' && !isMongooseTypeString) || + val == null) + ) { + throw new TypeError(`Invalid schema configuration: \`${val}\` is not ` + + `a valid type at path \`${key}\`. See ` + + 'https://bit.ly/mongoose-schematypes for a list of valid schema types.'); + } + if (val instanceof VirtualType || (val.constructor?.name ?? null) === 'VirtualType') { + this.virtual(val); + continue; + } + + if (Array.isArray(val) && val.length === 1 && val[0] == null) { + throw new TypeError('Invalid value for schema Array path `' + fullPath + + '`, got value "' + val[0] + '"'); + } + + if (!(isPOJO(val) || val instanceof SchemaTypeOptions)) { + // Special-case: Non-options definitely a path so leaf at this node + // Examples: Schema instances, SchemaType instances + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(prefix + key, val); + if (!val[0]?.instanceOfSchema && utils.isPOJO(val[0]?.discriminators)) { + const schemaType = this.path(prefix + key); + for (const key in val[0].discriminators) { + schemaType.discriminator(key, val[0].discriminators[key]); + } + } + } else if (utils.hasOwnKeys(val) === false) { + // Special-case: {} always interpreted as Mixed path so leaf at this node + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(fullPath, val); // mixed type + } else if (!val[typeKey] || (typeKey === 'type' && isPOJO(val.type) && val.type.type)) { + // Special-case: POJO with no bona-fide type key - interpret as tree of deep paths so recurse + // nested object `{ last: { name: String } }`. Avoid functions with `.type` re: #10807 because + // NestJS sometimes adds `Date.type`. + this.nested[fullPath] = true; + this.add(val, fullPath + '.'); + } else { + // There IS a bona-fide type key that may also be a POJO + const _typeDef = val[typeKey]; + if (isPOJO(_typeDef) && utils.hasOwnKeys(_typeDef)) { + // If a POJO is the value of a type key, make it a subdocument + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + + const childSchemaOptions = {}; + if (this._userProvidedOptions.typeKey) { + childSchemaOptions.typeKey = this._userProvidedOptions.typeKey; + } + // propagate 'strict' option to child schema + if (this._userProvidedOptions.strict != null) { + childSchemaOptions.strict = this._userProvidedOptions.strict; + } + if (this._userProvidedOptions.toObject != null) { + childSchemaOptions.toObject = utils.omit(this._userProvidedOptions.toObject, ['transform']); + } + if (this._userProvidedOptions.toJSON != null) { + childSchemaOptions.toJSON = utils.omit(this._userProvidedOptions.toJSON, ['transform']); + } + + const _schema = new Schema(_typeDef, childSchemaOptions); + _schema.$implicitlyCreated = true; + const schemaWrappedPath = Object.assign({}, val, { [typeKey]: _schema }); + this.path(prefix + key, schemaWrappedPath); + } else { + // Either the type is non-POJO or we interpret it as Mixed anyway + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(prefix + key, val); + if (!val?.instanceOfSchema && utils.isPOJO(val?.discriminators)) { + const schemaType = this.path(prefix + key); + for (const key in val.discriminators) { + schemaType.discriminator(key, val.discriminators[key]); + } + } + } + } + + if (val.instanceOfSchema && val.encryptionType() != null) { + // schema.add({ field: }) + if (this.encryptionType() != val.encryptionType()) { + throw new MongooseError('encryptionType of a nested schema must match the encryption type of the parent schema.'); + } + + for (const [encryptedField, encryptedFieldConfig] of Object.entries(val.encryptedFields)) { + const path = fullPath + '.' + encryptedField; + this._addEncryptedField(path, encryptedFieldConfig); + } + } else if (typeof val === 'object' && 'encrypt' in val) { + // schema.add({ field: { type: , encrypt: { ... }}}) + const { encrypt } = val; + + if (this.encryptionType() == null) { + throw new MongooseError('encryptionType must be provided'); + } + + this._addEncryptedField(fullPath, encrypt); + } else { + // if the field was already encrypted and we re-configure it to be unencrypted, remove + // the encrypted field configuration + this._removeEncryptedField(fullPath); + } + } + + const aliasObj = Object.fromEntries( + Object.entries(obj).map(([key]) => ([prefix + key, null])) + ); + aliasFields(this, aliasObj); + return this; +}; + +/** + * @param {string} path + * @param {object} fieldConfig + * + * @api private + */ +Schema.prototype._addEncryptedField = function _addEncryptedField(path, fieldConfig) { + const type = this.path(path).autoEncryptionType(); + if (type == null) { + throw new MongooseError(`Invalid BSON type for FLE field: '${path}'`); + } + + this.encryptedFields[path] = clone(fieldConfig); +}; + +/** + * @param {string} path + * + * @api private + */ +Schema.prototype._removeEncryptedField = function _removeEncryptedField(path) { + delete this.encryptedFields[path]; +}; + +/** + * @api private + * + * @returns {boolean} + */ +Schema.prototype._hasEncryptedFields = function _hasEncryptedFields() { + return utils.hasOwnKeys(this.encryptedFields); +}; + +/** + * @param {string} path + * @returns {boolean} + * + * @api private + */ +Schema.prototype._hasEncryptedField = function _hasEncryptedField(path) { + return path in this.encryptedFields; +}; + + +/** + * Builds an encryptedFieldsMap for the schema. + * + * @api private + */ +Schema.prototype._buildEncryptedFields = function() { + const fields = Object.entries(this.encryptedFields).map( + ([path, config]) => { + const bsonType = this.path(path).autoEncryptionType(); + // { path, bsonType, keyId, queries? } + return { path, bsonType, ...config }; + }); + + return { fields }; +}; + +/** + * Builds a schemaMap for the schema, if the schema is configured for client-side field level encryption. + * + * @api private + */ +Schema.prototype._buildSchemaMap = function() { + /** + * `schemaMap`s are JSON schemas, which use the following structure to represent objects: + * { field: { bsonType: 'object', properties: { ... } } } + * + * for example, a schema that looks like this `{ a: { b: int32 } }` would be encoded as + * `{ a: { bsonType: 'object', properties: { b: < encryption configuration > } } }` + * + * This function takes an array of path segments, an output object (that gets mutated) and + * a value to be associated with the full path, and constructs a valid CSFLE JSON schema path for + * the object. This works for deeply nested properties as well. + * + * @param {string[]} path array of path components + * @param {object} object the object in which to build a JSON schema of `path`'s properties + * @param {object} value the value to associate with the path in object + */ + function buildNestedPath(path, object, value) { + let i = 0, component = path[i]; + for (; i < path.length - 1; ++i, component = path[i]) { + object[component] = object[component] == null ? { + bsonType: 'object', + properties: {} + } : object[component]; + object = object[component].properties; + } + object[component] = value; + } + + const schemaMapPropertyReducer = (accum, [path, propertyConfig]) => { + const bsonType = this.path(path).autoEncryptionType(); + const pathComponents = path.split('.'); + const configuration = { encrypt: { ...propertyConfig, bsonType } }; + buildNestedPath(pathComponents, accum, configuration); + return accum; + }; + + const properties = Object.entries(this.encryptedFields).reduce( + schemaMapPropertyReducer, + {}); + + return { + bsonType: 'object', + properties + }; +}; + +/** + * Add an alias for `path`. This means getting or setting the `alias` + * is equivalent to getting or setting the `path`. + * + * #### Example: + * + * const toySchema = new Schema({ n: String }); + * + * // Make 'name' an alias for 'n' + * toySchema.alias('n', 'name'); + * + * const Toy = mongoose.model('Toy', toySchema); + * const turboMan = new Toy({ n: 'Turbo Man' }); + * + * turboMan.name; // 'Turbo Man' + * turboMan.n; // 'Turbo Man' + * + * turboMan.name = 'Turbo Man Action Figure'; + * turboMan.n; // 'Turbo Man Action Figure' + * + * await turboMan.save(); // Saves { _id: ..., n: 'Turbo Man Action Figure' } + * + * + * @param {string} path real path to alias + * @param {string|string[]} alias the path(s) to use as an alias for `path` + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.alias = function alias(path, alias) { + aliasFields(this, { [path]: alias }); + return this; +}; + +/** + * Remove an index by name or index specification. + * + * removeIndex only removes indexes from your schema object. Does **not** affect the indexes + * in MongoDB. + * + * #### Example: + * + * const ToySchema = new Schema({ name: String, color: String, price: Number }); + * + * // Add a new index on { name, color } + * ToySchema.index({ name: 1, color: 1 }); + * + * // Remove index on { name, color } + * // Keep in mind that order matters! `removeIndex({ color: 1, name: 1 })` won't remove the index + * ToySchema.removeIndex({ name: 1, color: 1 }); + * + * // Add an index with a custom name + * ToySchema.index({ color: 1 }, { name: 'my custom index name' }); + * // Remove index by name + * ToySchema.removeIndex('my custom index name'); + * + * @param {object|string} index name or index specification + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.removeIndex = function removeIndex(index) { + if (arguments.length > 1) { + throw new MongooseError('removeIndex() takes only 1 argument'); + } + + if (typeof index !== 'object' && typeof index !== 'string') { + throw new MongooseError('removeIndex() may only take either an object or a string as an argument'); + } + + if (typeof index === 'object') { + for (let i = this._indexes.length - 1; i >= 0; --i) { + if (isIndexSpecEqual(this._indexes[i][0], index)) { + this._indexes.splice(i, 1); + } + } + } else { + for (let i = this._indexes.length - 1; i >= 0; --i) { + if (this._indexes[i][1] != null && this._indexes[i][1].name === index) { + this._indexes.splice(i, 1); + } + } + } + + return this; +}; + +/** + * Remove all indexes from this schema. + * + * clearIndexes only removes indexes from your schema object. Does **not** affect the indexes + * in MongoDB. + * + * #### Example: + * + * const ToySchema = new Schema({ name: String, color: String, price: Number }); + * ToySchema.index({ name: 1 }); + * ToySchema.index({ color: 1 }); + * + * // Remove all indexes on this schema + * ToySchema.clearIndexes(); + * + * ToySchema.indexes(); // [] + * + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.clearIndexes = function clearIndexes() { + this._indexes.length = 0; + + return this; +}; + +/** + * Add an [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) that Mongoose will create using `Model.createSearchIndex()`. + * This function only works when connected to MongoDB Atlas. + * + * #### Example: + * + * const ToySchema = new Schema({ name: String, color: String, price: Number }); + * ToySchema.searchIndex({ name: 'test', definition: { mappings: { dynamic: true } } }); + * + * @param {object} description index options, including `name` and `definition` + * @param {string} description.name + * @param {object} description.definition + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.searchIndex = function searchIndex(description) { + this._searchIndexes.push(description); + + return this; +}; + +/** + * Reserved document keys. + * + * Keys in this object are names that are warned in schema declarations + * because they have the potential to break Mongoose/ Mongoose plugins functionality. If you create a schema + * using `new Schema()` with one of these property names, Mongoose will log a warning. + * + * - _posts + * - _pres + * - collection + * - emit + * - errors + * - get + * - init + * - isModified + * - isNew + * - listeners + * - modelName + * - on + * - once + * - populated + * - prototype + * - remove + * - removeListener + * - save + * - schema + * - toObject + * - validate + * + * _NOTE:_ Use of these terms as method names is permitted, but play at your own risk, as they may be existing mongoose document methods you are stomping on. + * + * const schema = new Schema(..); + * schema.methods.init = function () {} // potentially breaking + * + * @property reserved + * @memberOf Schema + * @static + */ + +Schema.reserved = Object.create(null); +Schema.prototype.reserved = Schema.reserved; + +const reserved = Schema.reserved; +// Core object +reserved['prototype'] = +// EventEmitter +reserved.emit = +reserved.listeners = +reserved.removeListener = + +// document properties and functions +reserved.collection = +reserved.errors = +reserved.get = +reserved.init = +reserved.isModified = +reserved.isNew = +reserved.populated = +reserved.remove = +reserved.save = +reserved.toObject = +reserved.validate = 1; +reserved.collection = 1; + +/** + * Gets/sets schema paths. + * + * Sets a path (if arity 2) + * Gets a path (if arity 1) + * + * #### Example: + * + * schema.path('name') // returns a SchemaType + * schema.path('name', Number) // changes the schemaType of `name` to Number + * + * @param {string} path The name of the Path to get / set + * @param {object} [obj] The Type to set the path to, if provided the path will be SET, otherwise the path will be GET + * @api public + */ + +Schema.prototype.path = function(path, obj) { + if (obj === undefined) { + if (Object.hasOwn(this.paths, path)) { + return this.paths[path]; + } + // Convert to '.$' to check subpaths re: gh-6405 + const cleanPath = _pathToPositionalSyntax(path); + let schematype = _getPath(this, path, cleanPath); + if (schematype != null) { + return schematype; + } + + // Look for maps + const mapPath = getMapPath(this, path); + if (mapPath != null) { + return mapPath; + } + + // Look if a parent of this path is mixed + schematype = this.hasMixedParent(cleanPath); + if (schematype != null) { + return schematype; + } + + // subpaths? + return hasNumericSubpathRegex.test(path) + ? getPositionalPath(this, path, cleanPath) + : undefined; + } + + const subpaths = path.indexOf('.') === -1 ? [path] : path.split('.'); + const last = subpaths.pop(); + if (utils.specialProperties.has(last)) { + throw new MongooseError('Cannot set special property `' + last + '` on a schema'); + } + + // some path names conflict with document methods + const firstPieceOfPath = subpaths.length === 0 ? last : subpaths[0]; + if (Object.hasOwn(reserved, firstPieceOfPath) && !this.options.suppressReservedKeysWarning) { + const errorMessage = `\`${firstPieceOfPath}\` is a reserved schema pathname and may break some functionality. ` + + 'You are allowed to use it, but use at your own risk. ' + + 'To disable this warning pass `suppressReservedKeysWarning` as a schema option.'; + + utils.warn(errorMessage); + } + + if (typeof obj === 'object' && utils.hasUserDefinedProperty(obj, 'ref')) { + validateRef(obj.ref, path); + } + + // update the tree + let branch = this.tree; + let fullPath = ''; + + for (const sub of subpaths) { + if (utils.specialProperties.has(sub)) { + throw new MongooseError('Cannot set special property `' + sub + '` on a schema'); + } + fullPath = fullPath += (fullPath.length > 0 ? '.' : '') + sub; + if (!branch[sub]) { + this.nested[fullPath] = true; + branch[sub] = {}; + } + if (typeof branch[sub] !== 'object') { + const msg = 'Cannot set nested path `' + path + '`. ' + + 'Parent path `' + + fullPath + + '` already set to type ' + branch[sub].name + + '.'; + throw new MongooseError(msg); + } + branch = branch[sub]; + } + + branch[last] = clone(obj); + + this.paths[path] = this.interpretAsType(path, obj, this.options); + const schemaType = this.paths[path]; + + // If overwriting an existing path, make sure to clear the childSchemas + this.childSchemas = this.childSchemas.filter(childSchema => childSchema.path !== path); + + if (schemaType.$isSchemaMap) { + // Maps can have arbitrary keys, so `$*` is internal shorthand for "any key" + // The '$' is to imply this path should never be stored in MongoDB so we + // can easily build a regexp out of this path, and '*' to imply "any key." + const mapPath = path + '.$*'; + + this.paths[mapPath] = schemaType.$__schemaType; + this.mapPaths.push(this.paths[mapPath]); + if (schemaType.$__schemaType.$isSingleNested) { + this.childSchemas.push({ + schema: schemaType.$__schemaType.schema, + model: schemaType.$__schemaType.Constructor, + path: path + }); + } + } + + if (schemaType.$isSingleNested) { + for (const key of Object.keys(schemaType.schema.paths)) { + this.singleNestedPaths[path + '.' + key] = schemaType.schema.paths[key]; + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + this.singleNestedPaths[path + '.' + key] = + schemaType.schema.singleNestedPaths[key]; + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + this.singleNestedPaths[path + '.' + key] = + schemaType.schema.subpaths[key]; + } + for (const key of Object.keys(schemaType.schema.nested)) { + this.singleNestedPaths[path + '.' + key] = 'nested'; + } + + Object.defineProperty(schemaType.schema, 'base', { + configurable: true, + enumerable: false, + writable: false, + value: this.base + }); + + schemaType.Constructor.base = this.base; + this.childSchemas.push({ + schema: schemaType.schema, + model: schemaType.Constructor, + path: path + }); + } else if (schemaType.$isMongooseDocumentArray) { + Object.defineProperty(schemaType.schema, 'base', { + configurable: true, + enumerable: false, + writable: false, + value: this.base + }); + + schemaType.Constructor.base = this.base; + this.childSchemas.push({ + schema: schemaType.schema, + model: schemaType.Constructor, + path: path + }); + } + + if (schemaType.$isMongooseArray && !schemaType.$isMongooseDocumentArray) { + let arrayPath = path; + let _schemaType = schemaType; + + const toAdd = []; + while (_schemaType.$isMongooseArray) { + arrayPath = arrayPath + '.$'; + + _schemaType.embeddedSchemaType._arrayPath = arrayPath; + _schemaType.embeddedSchemaType._arrayParentPath = path; + _schemaType = _schemaType.embeddedSchemaType; + + this.subpaths[arrayPath] = _schemaType; + } + + for (const _schemaType of toAdd) { + this.subpaths[_schemaType.path] = _schemaType; + } + } + + if (schemaType.$isMongooseDocumentArray) { + for (const key of Object.keys(schemaType.schema.paths)) { + const _schemaType = schemaType.schema.paths[key]; + this.subpaths[path + '.' + key] = _schemaType; + if (typeof _schemaType === 'object' && _schemaType != null && _schemaType.$parentSchemaDocArray == null) { + _schemaType.$parentSchemaDocArray = schemaType; + } + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + const _schemaType = schemaType.schema.subpaths[key]; + this.subpaths[path + '.' + key] = _schemaType; + if (typeof _schemaType === 'object' && _schemaType != null && _schemaType.$parentSchemaDocArray == null) { + _schemaType.$parentSchemaDocArray = schemaType; + } + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + const _schemaType = schemaType.schema.singleNestedPaths[key]; + this.subpaths[path + '.' + key] = _schemaType; + if (typeof _schemaType === 'object' && _schemaType != null && _schemaType.$parentSchemaDocArray == null) { + _schemaType.$parentSchemaDocArray = schemaType; + } + } + } + + return this; +}; + +/*! + * ignore + */ + +Schema.prototype._gatherChildSchemas = function _gatherChildSchemas() { + const childSchemas = []; + + for (const path of Object.keys(this.paths)) { + if (typeof path !== 'string') { + continue; + } + const schematype = this.paths[path]; + if (schematype.$isMongooseDocumentArray || schematype.$isSingleNested) { + childSchemas.push({ + schema: schematype.schema, + model: schematype.Constructor, + path: path + }); + } else if (schematype.$isSchemaMap && schematype.$__schemaType.$isSingleNested) { + childSchemas.push({ + schema: schematype.$__schemaType.schema, + model: schematype.$__schemaType.Constructor, + path: path + }); + } + } + + this.childSchemas = childSchemas; + return childSchemas; +}; + +/*! + * ignore + */ + +function _getPath(schema, path, cleanPath) { + if (Object.hasOwn(schema.paths, path)) { + return schema.paths[path]; + } + if (Object.hasOwn(schema.subpaths, cleanPath)) { + const subpath = schema.subpaths[cleanPath]; + if (subpath === 'nested') { + return undefined; + } + return subpath; + } + if (Object.hasOwn(schema.singleNestedPaths, cleanPath) && typeof schema.singleNestedPaths[cleanPath] === 'object') { + const singleNestedPath = schema.singleNestedPaths[cleanPath]; + if (singleNestedPath === 'nested') { + return undefined; + } + return singleNestedPath; + } + + return null; +} + +/*! + * ignore + */ + +function _pathToPositionalSyntax(path) { + if (!/\.\d+/.test(path)) { + return path; + } + return path.replace(/\.\d+\./g, '.$.').replace(/\.\d+$/, '.$'); +} + +/*! + * ignore + */ + +function getMapPath(schema, path) { + if (schema.mapPaths.length === 0) { + return null; + } + for (const val of schema.mapPaths) { + const cleanPath = val.path.replace(/\.\$\*/g, ''); + if (path === cleanPath || (path.startsWith(cleanPath + '.') && path.slice(cleanPath.length + 1).indexOf('.') === -1)) { + return val; + } else if (val.schema && path.startsWith(cleanPath + '.')) { + let remnant = path.slice(cleanPath.length + 1); + remnant = remnant.slice(remnant.indexOf('.') + 1); + return val.schema.path(remnant); + } else if (val.$isSchemaMap && path.startsWith(cleanPath + '.')) { + let remnant = path.slice(cleanPath.length + 1); + remnant = remnant.slice(remnant.indexOf('.') + 1); + const presplitPath = val.$__schemaType._presplitPath; + if (remnant.indexOf('.') === -1 && presplitPath[presplitPath.length - 1] === '$*') { + // Handle map of map of primitives + return val.$__schemaType; + } else if (remnant.indexOf('.') !== -1 && val.$__schemaType.schema && presplitPath[presplitPath.length - 1] === '$*') { + // map of map of subdocs (recursive) + return val.$__schemaType.schema.path(remnant.slice(remnant.indexOf('.') + 1)); + } + } + } + + return null; +} + +/** + * The Mongoose instance this schema is associated with + * + * @property base + * @api private + */ + +Object.defineProperty(Schema.prototype, 'base', { + configurable: true, + enumerable: false, + writable: true, + value: null +}); + +/** + * Converts type arguments into Mongoose Types. + * + * @param {string} path + * @param {object} obj constructor + * @param {object} options schema options + * @api private + */ + +Schema.prototype.interpretAsType = function(path, obj, options) { + if (obj instanceof SchemaType) { + if (obj.path === path) { + return obj; + } + const clone = obj.clone(); + clone.path = path; + return clone; + } + + // If this schema has an associated Mongoose object, use the Mongoose object's + // copy of SchemaTypes re: gh-7158 gh-6933 + const MongooseTypes = this.base?.Schema.Types ?? Schema.Types; + const Types = this.base?.Types ?? require('./types'); + + if (!utils.isPOJO(obj) && !(obj instanceof SchemaTypeOptions)) { + const constructorName = utils.getFunctionName(obj.constructor); + if (constructorName !== 'Object') { + const oldObj = obj; + obj = {}; + obj[options.typeKey] = oldObj; + } + } + + // Get the type making sure to allow keys named "type" + // and default to mixed if not specified. + // { type: { type: String, default: 'freshcut' } } + let type = obj[options.typeKey] && (obj[options.typeKey] instanceof Function || options.typeKey !== 'type' || !obj.type.type) + ? obj[options.typeKey] + : {}; + + if (type instanceof SchemaType) { + if (type.path === path) { + return type; + } + const clone = type.clone(); + clone.path = path; + return clone; + } + + let name; + + if (utils.isPOJO(type) || type === 'mixed') { + return new MongooseTypes.Mixed(path, obj, null, this); + } + + if (Array.isArray(type) || type === Array || type === 'array' || type === MongooseTypes.Array) { + // if it was specified through { type } look for `cast` + let cast = (type === Array || type === 'array') + ? obj.cast || obj.of + : type[0]; + + // new Schema({ path: [new Schema({ ... })] }) + if (cast?.instanceOfSchema) { + if (!(cast instanceof Schema)) { + if (this.options._isMerging) { + cast = new Schema(cast); + } else { + throw new TypeError('Schema for array path `' + path + + '` is from a different copy of the Mongoose module. ' + + 'Please make sure you\'re using the same version ' + + 'of Mongoose everywhere with `npm list mongoose`. If you are still ' + + 'getting this error, please add `new Schema()` around the path: ' + + `${path}: new Schema(...)`); + } + } + return new MongooseTypes.DocumentArray(path, cast, obj, null, this); + } + if (cast && + cast[options.typeKey] && + cast[options.typeKey].instanceOfSchema) { + if (!(cast[options.typeKey] instanceof Schema)) { + if (this.options._isMerging) { + cast[options.typeKey] = new Schema(cast[options.typeKey]); + } else { + throw new TypeError('Schema for array path `' + path + + '` is from a different copy of the Mongoose module. ' + + 'Please make sure you\'re using the same version ' + + 'of Mongoose everywhere with `npm list mongoose`. If you are still ' + + 'getting this error, please add `new Schema()` around the path: ' + + `${path}: new Schema(...)`); + } + } + return new MongooseTypes.DocumentArray(path, cast[options.typeKey], obj, cast, this); + } + if (typeof cast !== 'undefined') { + if (Array.isArray(cast) || cast.type === Array || cast.type == 'Array') { + if (cast?.type == 'Array') { + cast.type = Array; + } + return new MongooseTypes.Array(path, this.interpretAsType(path, cast, options), obj, null, this); + } + } + + // Handle both `new Schema({ arr: [{ subpath: String }] })` and `new Schema({ arr: [{ type: { subpath: string } }] })` + const castFromTypeKey = (cast != null && cast[options.typeKey] && (options.typeKey !== 'type' || !cast.type.type)) ? + cast[options.typeKey] : + cast; + if (typeof cast === 'string') { + cast = MongooseTypes[cast.charAt(0).toUpperCase() + cast.substring(1)]; + } else if (utils.isPOJO(castFromTypeKey)) { + if (utils.hasOwnKeys(castFromTypeKey)) { + // The `minimize` and `typeKey` options propagate to child schemas + // declared inline, like `{ arr: [{ val: { $type: String } }] }`. + // See gh-3560 + const childSchemaOptions = { minimize: options.minimize }; + if (options.typeKey) { + childSchemaOptions.typeKey = options.typeKey; + } + // propagate 'strict' option to child schema + if (Object.hasOwn(options, 'strict')) { + childSchemaOptions.strict = options.strict; + } + if (Object.hasOwn(options, 'strictQuery')) { + childSchemaOptions.strictQuery = options.strictQuery; + } + if (Object.hasOwn(options, 'toObject')) { + childSchemaOptions.toObject = utils.omit(options.toObject, ['transform']); + } + if (Object.hasOwn(options, 'toJSON')) { + childSchemaOptions.toJSON = utils.omit(options.toJSON, ['transform']); + } + + if (Object.hasOwn(this._userProvidedOptions, '_id')) { + childSchemaOptions._id = this._userProvidedOptions._id; + } else if (Schema.Types.DocumentArray.defaultOptions._id != null) { + childSchemaOptions._id = Schema.Types.DocumentArray.defaultOptions._id; + } + + const childSchema = new Schema(castFromTypeKey, childSchemaOptions); + childSchema.$implicitlyCreated = true; + return new MongooseTypes.DocumentArray(path, childSchema, obj, null, this); + } else { + // Special case: empty object becomes mixed + return new MongooseTypes.Array(path, MongooseTypes.Mixed, obj, null, this); + } + } + + if (cast) { + type = cast[options.typeKey] && (options.typeKey !== 'type' || !cast.type.type) + ? cast[options.typeKey] + : cast; + if (Array.isArray(type)) { + return new MongooseTypes.Array(path, this.interpretAsType(path, type, options), obj, null, this); + } + + name = typeof type === 'string' + ? type + : type.schemaName || utils.getFunctionName(type); + + // For Jest 26+, see #10296 + if (name === 'ClockDate') { + name = 'Date'; + } + + if (name === void 0) { + throw new TypeError('Invalid schema configuration: ' + + `Could not determine the embedded type for array \`${path}\`. ` + + 'See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.'); + } + if (!Object.hasOwn(MongooseTypes, name)) { + throw new TypeError('Invalid schema configuration: ' + + `\`${name}\` is not a valid type within the array \`${path}\`.` + + 'See https://bit.ly/mongoose-schematypes for a list of valid schema types.'); + } + + if (name === 'Union' && typeof cast === 'object') { + cast.parentSchema = this; + } + } + + return new MongooseTypes.Array(path, cast || MongooseTypes.Mixed, obj, options, this); + } + + if (type?.instanceOfSchema) { + return new MongooseTypes.Subdocument(type, path, obj, this); + } + + if (Buffer.isBuffer(type)) { + name = 'Buffer'; + } else if (typeof type === 'function' || typeof type === 'object') { + name = type.schemaName || utils.getFunctionName(type); + } else if (type === Types.ObjectId) { + name = 'ObjectId'; + } else if (type === Types.Decimal128) { + name = 'Decimal128'; + } else { + name = type == null ? '' + type : type.toString(); + } + + if (name) { + name = name.charAt(0).toUpperCase() + name.substring(1); + } + // Special case re: gh-7049 because the bson `ObjectID` class' capitalization + // doesn't line up with Mongoose's. + if (name === 'ObjectID') { + name = 'ObjectId'; + } + // For Jest 26+, see #10296 + if (name === 'ClockDate') { + name = 'Date'; + } + + if (name === void 0) { + throw new TypeError(`Invalid schema configuration: \`${path}\` schematype definition is ` + + 'invalid. See ' + + 'https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.'); + } + if (MongooseTypes[name] == null) { + throw new TypeError(`Invalid schema configuration: \`${name}\` is not ` + + `a valid type at path \`${path}\`. See ` + + 'https://bit.ly/mongoose-schematypes for a list of valid schema types.'); + } + + const schemaType = new MongooseTypes[name](path, obj, options, this); + + return schemaType; +}; + +/** + * Iterates the schemas paths similar to Array#forEach. + * + * The callback is passed the pathname and the schemaType instance. + * + * #### Example: + * + * const userSchema = new Schema({ name: String, registeredAt: Date }); + * userSchema.eachPath((pathname, schematype) => { + * // Prints twice: + * // name SchemaString { ... } + * // registeredAt SchemaDate { ... } + * console.log(pathname, schematype); + * }); + * + * @param {Function} fn callback function + * @return {Schema} this + * @api public + */ + +Schema.prototype.eachPath = function(fn) { + const keys = Object.keys(this.paths); + const len = keys.length; + + for (let i = 0; i < len; ++i) { + fn(keys[i], this.paths[keys[i]]); + } + + return this; +}; + +/** + * Returns an Array of path strings that are required by this schema. + * + * #### Example: + * + * const s = new Schema({ + * name: { type: String, required: true }, + * age: { type: String, required: true }, + * notes: String + * }); + * s.requiredPaths(); // [ 'age', 'name' ] + * + * @api public + * @param {boolean} invalidate Refresh the cache + * @return {Array} + */ + +Schema.prototype.requiredPaths = function requiredPaths(invalidate) { + if (this._requiredpaths && !invalidate) { + return this._requiredpaths; + } + + const paths = Object.keys(this.paths); + let i = paths.length; + const ret = []; + + while (i--) { + const path = paths[i]; + if (this.paths[path].isRequired) { + ret.push(path); + } + } + this._requiredpaths = ret; + return this._requiredpaths; +}; + +/** + * Returns an Array of path strings that have a `transform` option, either on the + * path itself or on the path's `embeddedSchemaType` for arrays. + * + * #### Example: + * + * const s = new Schema({ + * name: { type: String, transform: v => v.toLowerCase() }, + * tags: [{ type: String, transform: v => v.trim() }], + * age: { type: Number, required: true }, + * notes: String + * }); + * s.pathsWithTransforms(); // [ 'name', 'tags' ] + * + * @api private + * @param {boolean} invalidate Refresh the cache + * @return {Array|null} + */ + +Schema.prototype.pathsWithTransforms = function pathsWithTransforms(invalidate) { + if (this._pathsWithTransforms !== undefined && !invalidate) { + return this._pathsWithTransforms; + } + + const paths = Object.keys(this.paths); + const ret = []; + + for (const path of paths) { + const schematype = this.paths[path]; + const topLevelTransformFunction = schematype.options.transform ?? schematype.constructor?.defaultOptions?.transform; + const embeddedSchemaTypeTransformFunction = schematype.embeddedSchemaType?.options?.transform + ?? schematype.embeddedSchemaType?.constructor?.defaultOptions?.transform; + if (topLevelTransformFunction || embeddedSchemaTypeTransformFunction) { + ret.push(path); + } + } + this._pathsWithTransforms = ret.length ? ret : null; + return this._pathsWithTransforms; +}; + +/** + * Returns indexes from fields and schema-level indexes (cached). + * + * @api private + * @return {Array} + */ + +Schema.prototype.indexedPaths = function indexedPaths() { + if (this._indexedpaths) { + return this._indexedpaths; + } + this._indexedpaths = this.indexes(); + return this._indexedpaths; +}; + +/** + * Returns the pathType of `path` for this schema. + * + * Given a path, returns whether it is a real, virtual, nested, or ad-hoc/undefined path. + * + * #### Example: + * + * const s = new Schema({ name: String, nested: { foo: String } }); + * s.virtual('foo').get(() => 42); + * s.pathType('name'); // "real" + * s.pathType('nested'); // "nested" + * s.pathType('foo'); // "virtual" + * s.pathType('fail'); // "adhocOrUndefined" + * + * @param {string} path + * @return {string} + * @api public + */ + +Schema.prototype.pathType = function(path) { + if (Object.hasOwn(this.paths, path)) { + return 'real'; + } + if (Object.hasOwn(this.virtuals, path)) { + return 'virtual'; + } + if (Object.hasOwn(this.nested, path)) { + return 'nested'; + } + + // Convert to '.$' to check subpaths re: gh-6405 + const cleanPath = _pathToPositionalSyntax(path); + + if (Object.hasOwn(this.subpaths, cleanPath) || Object.hasOwn(this.subpaths, path)) { + return 'real'; + } + + const singleNestedPath = Object.hasOwn(this.singleNestedPaths, cleanPath) || Object.hasOwn(this.singleNestedPaths, path); + if (singleNestedPath) { + return singleNestedPath === 'nested' ? 'nested' : 'real'; + } + + // Look for maps + const mapPath = getMapPath(this, path); + if (mapPath != null) { + return 'real'; + } + + if (/\.\d+\.|\.\d+$/.test(path)) { + return getPositionalPathType(this, path, cleanPath); + } + return 'adhocOrUndefined'; +}; + +/** + * Returns true iff this path is a child of a mixed schema. + * + * @param {string} path + * @return {boolean} + * @api private + */ + +Schema.prototype.hasMixedParent = function(path) { + const subpaths = path.split(/\./g); + path = ''; + for (let i = 0; i < subpaths.length; ++i) { + path = i > 0 ? path + '.' + subpaths[i] : subpaths[i]; + if (Object.hasOwn(this.paths, path) && + this.paths[path] instanceof MongooseTypes.Mixed) { + return this.paths[path]; + } + } + + return null; +}; + +/** + * Setup updatedAt and createdAt timestamps to documents if enabled + * + * @param {boolean|object} timestamps timestamps options + * @api private + */ +Schema.prototype.setupTimestamp = function(timestamps) { + return setupTimestamps(this, timestamps); +}; + +/** + * ignore. Deprecated re: #6405 + * @param {any} self + * @param {string} path + * @api private + */ + +function getPositionalPathType(self, path, cleanPath) { + const subpaths = path.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean); + if (subpaths.length < 2) { + return Object.hasOwn(self.paths, subpaths[0]) ? + self.paths[subpaths[0]] : + 'adhocOrUndefined'; + } + + let val = self.path(subpaths[0]); + let isNested = false; + if (!val) { + return 'adhocOrUndefined'; + } + + const last = subpaths.length - 1; + + for (let i = 1; i < subpaths.length; ++i) { + isNested = false; + const subpath = subpaths[i]; + + if (i === last && val && !/\D/.test(subpath)) { + if (val.$isMongooseDocumentArray) { + val = val.embeddedSchemaType; + } else if (val instanceof MongooseTypes.Array) { + // StringSchema, NumberSchema, etc + val = val.embeddedSchemaType; + } else { + val = undefined; + } + break; + } + + // ignore if its just a position segment: path.0.subpath + if (!/\D/.test(subpath)) { + // Nested array + if (val instanceof MongooseTypes.Array && i !== last) { + val = val.embeddedSchemaType; + } + continue; + } + + if (!val?.schema) { + val = undefined; + break; + } + + const type = val.schema.pathType(subpath); + isNested = (type === 'nested'); + val = val.schema.path(subpath); + } + + self.subpaths[cleanPath] = val; + if (val) { + return 'real'; + } + if (isNested) { + return 'nested'; + } + return 'adhocOrUndefined'; +} + + +/*! + * ignore + */ + +function getPositionalPath(self, path, cleanPath) { + getPositionalPathType(self, path, cleanPath); + return self.subpaths[cleanPath]; +} + +/** + * Adds a method call to the queue. + * + * #### Example: + * + * schema.methods.print = function() { console.log(this); }; + * schema.queue('print', []); // Print the doc every one is instantiated + * + * const Model = mongoose.model('Test', schema); + * new Model({ name: 'test' }); // Prints '{"_id": ..., "name": "test" }' + * + * @param {string} name name of the document method to call later + * @param {Array} args arguments to pass to the method + * @api public + */ + +Schema.prototype.queue = function(name, args) { + this.callQueue.push([name, args]); + return this; +}; + +/** + * Defines a pre hook for the model. + * + * #### Example: + * + * const toySchema = new Schema({ name: String, created: Date }); + * + * toySchema.pre('save', function() { + * if (!this.created) this.created = new Date; + * }); + * + * toySchema.pre('validate', function() { + * if (this.name !== 'Woody') this.name = 'Woody'; + * }); + * + * // Equivalent to calling `pre()` on `find`, `findOne`, `findOneAndUpdate`. + * toySchema.pre(/^find/, function() { + * console.log(this.getFilter()); + * }); + * + * // Equivalent to calling `pre()` on `updateOne`, `findOneAndUpdate`. + * toySchema.pre(['updateOne', 'findOneAndUpdate'], function() { + * console.log(this.getFilter()); + * }); + * + * toySchema.pre('deleteOne', function() { + * // Runs when you call `Toy.deleteOne()` + * }); + * + * toySchema.pre('deleteOne', { document: true }, function() { + * // Runs when you call `doc.deleteOne()` + * }); + * + * @param {string|RegExp|string[]} methodName The method name or regular expression to match method name + * @param {object} [options] + * @param {boolean} [options.document] If `name` is a hook for both document and query middleware, set to `true` to run on document middleware. For example, set `options.document` to `true` to apply this hook to `Document#deleteOne()` rather than `Query#deleteOne()`. + * @param {boolean} [options.query] If `name` is a hook for both document and query middleware, set to `true` to run on query middleware. + * @param {Function} callback + * @api public + */ + +Schema.prototype.pre = function(name) { + if (name instanceof RegExp) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const fn of hookNames) { + if (name.test(fn)) { + this.pre.apply(this, [fn].concat(remainingArgs)); + } + } + return this; + } + if (Array.isArray(name)) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const el of name) { + this.pre.apply(this, [el].concat(remainingArgs)); + } + return this; + } + this.s.hooks.pre.apply(this.s.hooks, arguments); + return this; +}; + +/** + * Defines a post hook for the document + * + * const schema = new Schema(..); + * schema.post('save', function (doc) { + * console.log('this fired after a document was saved'); + * }); + * + * schema.post('find', function(docs) { + * console.log('this fired after you ran a find query'); + * }); + * + * schema.post(/Many$/, function(res) { + * console.log('this fired after you ran `updateMany()` or `deleteMany()`'); + * }); + * + * const Model = mongoose.model('Model', schema); + * + * const m = new Model(..); + * await m.save(); + * console.log('this fires after the `post` hook'); + * + * await m.find(); + * console.log('this fires after the post find hook'); + * + * @param {string|RegExp|string[]} methodName The method name or regular expression to match method name + * @param {object} [options] + * @param {boolean} [options.document] If `name` is a hook for both document and query middleware, set to `true` to run on document middleware. + * @param {boolean} [options.query] If `name` is a hook for both document and query middleware, set to `true` to run on query middleware. + * @param {Function} fn callback + * @see middleware https://mongoosejs.com/docs/middleware.html + * @see kareem https://npmjs.org/package/kareem + * @api public + */ + +Schema.prototype.post = function(name) { + if (name instanceof RegExp) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const fn of hookNames) { + if (name.test(fn)) { + this.post.apply(this, [fn].concat(remainingArgs)); + } + } + return this; + } + if (Array.isArray(name)) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const el of name) { + this.post.apply(this, [el].concat(remainingArgs)); + } + return this; + } + this.s.hooks.post.apply(this.s.hooks, arguments); + return this; +}; + +/** + * Registers a plugin for this schema. + * + * #### Example: + * + * const s = new Schema({ name: String }); + * s.plugin(schema => console.log(schema.path('name').path)); + * mongoose.model('Test', s); // Prints 'name' + * + * Or with Options: + * + * const s = new Schema({ name: String }); + * s.plugin((schema, opts) => console.log(opts.text, schema.path('name').path), { text: "Schema Path Name:" }); + * mongoose.model('Test', s); // Prints 'Schema Path Name: name' + * + * @param {Function} plugin The Plugin's callback + * @param {object} [opts] Options to pass to the plugin + * @param {boolean} [opts.deduplicate=false] If true, ignore duplicate plugins (same `fn` argument using `===`) + * @see plugins https://mongoosejs.com/docs/plugins.html + * @api public + */ + +Schema.prototype.plugin = function(fn, opts) { + if (typeof fn !== 'function') { + throw new MongooseError('First param to `schema.plugin()` must be a function, ' + + 'got "' + (typeof fn) + '"'); + } + + + if (opts?.deduplicate) { + for (const plugin of this.plugins) { + if (plugin.fn === fn) { + return this; + } + } + } + this.plugins.push({ fn: fn, opts: opts }); + + fn(this, opts); + return this; +}; + +/** + * Adds a query helper to this schema. Equivalent to `schema.query[name] = fn`. + * + * #### Example: + * + * schema.queryHelper('byName', function(name) { + * return this.where({ name }); + * }); + * const Test = mongoose.model('Test', schema); + * await Test.find().byName('John'); // Equivalent to `Test.find({ name: 'John' })` + * + * @param {string} name The query helper name. + * @param {Function} fn The query helper function. + * @return {Schema} this + * @api public + */ + +Schema.prototype.queryHelper = function queryHelper(name, fn) { + if (typeof name !== 'string') { + throw new MongooseError('First param to `schema.queryHelper()` must be a string, ' + + 'got "' + (typeof name) + '"'); + } + if (typeof fn !== 'function') { + throw new MongooseError('Second param to `schema.queryHelper()` must be a function, ' + + 'got "' + (typeof fn) + '"'); + } + + this.query[name] = fn; + return this; +}; + +/** + * Adds an instance method to documents constructed from Models compiled from this schema. + * + * #### Example: + * + * const schema = kittySchema = new Schema(..); + * + * schema.method('meow', function () { + * console.log('meeeeeoooooooooooow'); + * }) + * + * const Kitty = mongoose.model('Kitty', schema); + * + * const fizz = new Kitty; + * fizz.meow(); // meeeeeooooooooooooow + * + * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods. + * + * schema.method({ + * purr: function () {} + * , scratch: function () {} + * }); + * + * // later + * const fizz = new Kitty; + * fizz.purr(); + * fizz.scratch(); + * + * NOTE: `Schema.method()` adds instance methods to the `Schema.methods` object. You can also add instance methods directly to the `Schema.methods` object as seen in the [guide](https://mongoosejs.com/docs/guide.html#methods) + * + * If the method has hooks registered via `schema.pre('meow')` or `schema.post('meow')`, you can allow callers + * to skip them for a single call by setting `supportsMiddlewareOption = true` on the function: + * + * schema.method('meow', function(options = {}) { + * console.log('meeeeeoooooooooooow'); + * }); + * schema.methods.meow.supportsMiddlewareOption = true; + * + * // Skips `pre('meow')` and `post('meow')` hooks + * await fizz.meow({ middleware: false }); + * + * @param {string|object} name The Method Name for a single function, or an Object of "string-function" pairs. + * @param {Function} [fn] The Function in a single-function definition. + * @api public + * @see Skip Middleware https://mongoosejs.com/docs/middleware.html#skip-custom-statics-and-methods + */ + +Schema.prototype.method = function(name, fn, options) { + if (typeof name !== 'string') { + for (const i in name) { + this.methods[i] = name[i]; + this.methodOptions[i] = clone(options); + } + } else { + this.methods[name] = fn; + this.methodOptions[name] = clone(options); + } + return this; +}; + +/** + * Adds static "class" methods to Models compiled from this schema. + * + * #### Example: + * + * const schema = new Schema(..); + * // Equivalent to `schema.statics.findByName = function(name) {}`; + * schema.static('findByName', function(name) { + * return this.find({ name: name }); + * }); + * + * const Drink = mongoose.model('Drink', schema); + * await Drink.findByName('LaCroix'); + * + * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods. + * + * schema.static({ + * findByName: function () {..} + * , findByCost: function () {..} + * }); + * + * const Drink = mongoose.model('Drink', schema); + * await Drink.findByName('LaCroix'); + * await Drink.findByCost(3); + * + * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as statics. + * + * If the static has hooks registered via `schema.pre('findByName')` or `schema.post('findByName')`, you can allow + * callers to skip them for a single call by setting `supportsMiddlewareOption = true` on the function: + * + * schema.static('findByName', function(name, options = {}) { + * return this.find({ name: name }); + * }); + * schema.statics.findByName.supportsMiddlewareOption = true; + * + * // Skips `pre('findByName')` and `post('findByName')` hooks + * await Drink.findByName('LaCroix', { middleware: false }); + * + * @param {string|object} name The Method Name for a single function, or an Object of "string-function" pairs. + * @param {Function} [fn] The Function in a single-function definition. + * @api public + * @see Statics https://mongoosejs.com/docs/guide.html#statics + * @see Skip Middleware https://mongoosejs.com/docs/middleware.html#skip-custom-statics-and-methods + */ + +Schema.prototype.static = function(name, fn) { + if (typeof name !== 'string') { + for (const i in name) { + this.statics[i] = name[i]; + } + } else { + this.statics[name] = fn; + } + return this; +}; + +/** + * Defines an index (most likely compound) for this schema. + * + * #### Example: + * + * schema.index({ first: 1, last: -1 }) + * + * @param {object} fields The Fields to index, with the order, available values: `1 | -1 | '2d' | '2dsphere' | 'geoHaystack' | 'hashed' | 'text'` + * @param {object} [options] Options to pass to [MongoDB driver's `createIndex()` function](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#createIndex) + * @param {string | number} [options.expires=null] Mongoose-specific syntactic sugar, uses [ms](https://www.npmjs.com/package/ms) to convert `expires` option into seconds for the `expireAfterSeconds` in the above link. + * @param {string} [options.language_override=null] Tells mongodb to use the specified field instead of `language` for parsing text indexes. + * @api public + */ + +Schema.prototype.index = function(fields, options) { + fields || (fields = {}); + options || (options = {}); + + if (options.expires) { + utils.expires(options); + } + for (const key in fields) { + if (this.aliases[key]) { + fields = utils.renameObjKey(fields, key, this.aliases[key]); + } + } + for (const field of Object.keys(fields)) { + if (fields[field] === 'ascending' || fields[field] === 'asc') { + fields[field] = 1; + } else if (fields[field] === 'descending' || fields[field] === 'desc') { + fields[field] = -1; + } + } + + this._indexes.push([fields, options]); + return this; +}; + +/** + * Sets a schema option. + * + * #### Example: + * + * schema.set('strict'); // 'true' by default + * schema.set('strict', false); // Sets 'strict' to false + * schema.set('strict'); // 'false' + * + * @param {string} key The name of the option to set the value to + * @param {object} [value] The value to set the option to, if not passed, the option will be reset to default + * @param {string[]} [tags] tags to add to read preference if key === 'read' + * @see Schema https://mongoosejs.com/docs/api/schema.html#Schema() + * @api public + */ + +Schema.prototype.set = function(key, value, tags) { + if (arguments.length === 1) { + return this.options[key]; + } + + switch (key) { + case 'read': + if (typeof value === 'string') { + this.options[key] = { mode: handleReadPreferenceAliases(value), tags }; + } else if (Array.isArray(value) && typeof value[0] === 'string') { + this.options[key] = { + mode: handleReadPreferenceAliases(value[0]), + tags: value[1] + }; + } else { + this.options[key] = value; + } + this._userProvidedOptions[key] = this.options[key]; + break; + case 'timestamps': + this.setupTimestamp(value); + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + break; + case '_id': + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + + if (value && !this.paths['_id']) { + addAutoId(this); + } else if (!value && this.paths['_id'] != null && this.paths['_id'].auto) { + this.remove('_id'); + } + break; + default: + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + break; + } + + // Propagate `strict` and `strictQuery` changes down to implicitly created schemas + if (key === 'strict') { + _propagateOptionsToImplicitlyCreatedSchemas(this, { strict: value }); + } + if (key === 'strictQuery') { + _propagateOptionsToImplicitlyCreatedSchemas(this, { strictQuery: value }); + } + if (key === 'toObject') { + value = { ...value }; + // Avoid propagating transform to implicitly created schemas re: gh-3279 + delete value.transform; + _propagateOptionsToImplicitlyCreatedSchemas(this, { toObject: value }); + } + if (key === 'toJSON') { + value = { ...value }; + // Avoid propagating transform to implicitly created schemas re: gh-3279 + delete value.transform; + _propagateOptionsToImplicitlyCreatedSchemas(this, { toJSON: value }); + } + + return this; +}; + +/*! + * Recursively set options on implicitly created schemas + */ + +function _propagateOptionsToImplicitlyCreatedSchemas(baseSchema, options) { + for (const { schema } of baseSchema.childSchemas) { + if (!schema.$implicitlyCreated) { + continue; + } + Object.assign(schema.options, options); + _propagateOptionsToImplicitlyCreatedSchemas(schema, options); + } +} + +/** + * Gets a schema option. + * + * #### Example: + * + * schema.get('strict'); // true + * schema.set('strict', false); + * schema.get('strict'); // false + * + * @param {string} key The name of the Option to get the current value for + * @api public + * @return {any} the option's value + */ + +Schema.prototype.get = function(key) { + return this.options[key]; +}; + +const indexTypes = '2d 2dsphere hashed text'.split(' '); + +/** + * The allowed index types + * + * @property {string[]} indexTypes + * @memberOf Schema + * @static + * @api public + */ + +Object.defineProperty(Schema, 'indexTypes', { + get: function() { + return indexTypes; + }, + set: function() { + throw new MongooseError('Cannot overwrite Schema.indexTypes'); + } +}); + +/** + * Returns a list of indexes that this schema declares, via `schema.index()` or by `index: true` in a path's options. + * Indexes are expressed as an array `[spec, options]`. + * + * #### Example: + * + * const userSchema = new Schema({ + * email: { type: String, required: true, unique: true }, + * registeredAt: { type: Date, index: true } + * }); + * + * // [ [ { email: 1 }, { unique: true } ], + * // [ { registeredAt: 1 }, {} ] ] + * userSchema.indexes(); + * + * [Plugins](https://mongoosejs.com/docs/plugins.html) can use the return value of this function to modify a schema's indexes. + * For example, the below plugin makes every index unique by default. + * + * function myPlugin(schema) { + * for (const index of schema.indexes()) { + * if (index[1].unique === undefined) { + * index[1].unique = true; + * } + * } + * } + * + * @api public + * @return {Array} list of indexes defined in the schema + */ + +Schema.prototype.indexes = function() { + return getIndexes(this); +}; + +/** + * Creates a virtual type with the given name. + * + * @param {string} name The name of the Virtual + * @param {object} [options] + * @param {string|Model} [options.ref] model name or model instance. Marks this as a [populate virtual](https://mongoosejs.com/docs/populate.html#populate-virtuals). + * @param {string|Function} [options.localField] Required for populate virtuals. See [populate virtual docs](https://mongoosejs.com/docs/populate.html#populate-virtuals) for more information. + * @param {string|Function} [options.foreignField] Required for populate virtuals. See [populate virtual docs](https://mongoosejs.com/docs/populate.html#populate-virtuals) for more information. + * @param {boolean|Function} [options.justOne=false] Only works with populate virtuals. If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), will be a single doc or `null`. Otherwise, the populate virtual will be an array. + * @param {boolean} [options.count=false] Only works with populate virtuals. If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), this populate virtual will contain the number of documents rather than the documents themselves when you `populate()`. + * @param {Function|null} [options.get=null] Adds a [getter](https://mongoosejs.com/docs/tutorials/getters-setters.html) to this virtual to transform the populated doc. + * @param {object|Function} [options.match=null] Apply a default [`match` option to populate](https://mongoosejs.com/docs/populate.html#match), adding an additional filter to the populate query. + * @param {boolean} [options.applyToArray=false] If true and the given `name` is a direct child of an array, apply the virtual to the array rather than the elements. + * @return {VirtualType} + */ + +Schema.prototype.virtual = function(name, options) { + if (name instanceof VirtualType || getConstructorName(name) === 'VirtualType') { + return this.virtual(name.path, name.options); + } + options = new VirtualOptions(options); + + if (utils.hasUserDefinedProperty(options, ['ref', 'refPath'])) { + if (options.localField == null) { + throw new MongooseError('Reference virtuals require `localField` option'); + } + + if (options.foreignField == null) { + throw new MongooseError('Reference virtuals require `foreignField` option'); + } + + const virtual = this.virtual(name); + virtual.options = options; + + this.pre('init', function virtualPreInit(obj, opts) { + if (mpath.has(name, obj)) { + const _v = mpath.get(name, obj); + if (!this.$$populatedVirtuals) { + this.$$populatedVirtuals = {}; + } + + if (options.justOne || options.count) { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? + _v[0] : + _v; + } else { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? + _v : + _v == null ? [] : [_v]; + } + + if (opts?.hydratedPopulatedDocs && !options.count) { + const modelNames = virtual._getModelNamesForPopulate(this); + const populatedVal = this.$$populatedVirtuals[name]; + if (!Array.isArray(populatedVal) && !populatedVal.$__ && modelNames?.length === 1) { + const PopulateModel = this.db.model(modelNames[0]); + this.$$populatedVirtuals[name] = PopulateModel.hydrate(populatedVal); + } else if (Array.isArray(populatedVal) && modelNames?.length === 1) { + const PopulateModel = this.db.model(modelNames[0]); + for (let i = 0; i < populatedVal.length; ++i) { + if (!populatedVal[i].$__) { + populatedVal[i] = PopulateModel.hydrate(populatedVal[i], null, { hydratedPopulatedDocs: true }); + } + } + const foreignField = options.foreignField; + this.$populated( + name, + populatedVal.map(doc => doc == null ? doc : doc.get(typeof foreignField === 'function' ? foreignField.call(doc, doc) : foreignField)), + { populateModelSymbol: PopulateModel } + ); + } + } + + mpath.unset(name, obj); + } + }); + + virtual. + set(function(v) { + if (!this.$$populatedVirtuals) { + this.$$populatedVirtuals = {}; + } + + return setPopulatedVirtualValue( + this.$$populatedVirtuals, + name, + v, + options + ); + }); + + if (typeof options.get === 'function') { + virtual.get(options.get); + } + + // Workaround for gh-8198: if virtual is under document array, make a fake + // virtual. See gh-8210, gh-13189 + const parts = name.split('.'); + let cur = parts[0]; + for (let i = 0; i < parts.length - 1; ++i) { + if (this.paths[cur] == null) { + continue; + } + + if (this.paths[cur].$isMongooseDocumentArray || this.paths[cur].$isSingleNested) { + const remnant = parts.slice(i + 1).join('.'); + this.paths[cur].schema.virtual(remnant, options); + break; + } else if (this.paths[cur].$isSchemaMap) { + const remnant = parts.slice(i + 2).join('.'); + this.paths[cur].$__schemaType.schema.virtual(remnant, options); + break; + } + + cur += '.' + parts[i + 1]; + } + + return virtual; + } + + const virtuals = this.virtuals; + const parts = name.split('.'); + + if (this.pathType(name) === 'real') { + throw new MongooseError('Virtual path "' + name + '"' + + ' conflicts with a real path in the schema'); + } + + virtuals[name] = parts.reduce(function(mem, part, i) { + mem[part] || (mem[part] = (i === parts.length - 1) + ? new VirtualType(options, name) + : {}); + return mem[part]; + }, this.tree); + + if (options?.applyToArray && parts.length > 1) { + const path = this.path(parts.slice(0, -1).join('.')); + if (path?.$isMongooseArray) { + return path.virtual(parts[parts.length - 1], options); + } else { + throw new MongooseError(`Path "${path}" is not an array`); + } + } + + return virtuals[name]; +}; + +/** + * Returns the virtual type with the given `name`. + * + * @param {string} name The name of the Virtual to get + * @return {VirtualType|null} + */ + +Schema.prototype.virtualpath = function(name) { + return Object.hasOwn(this.virtuals, name) ? this.virtuals[name] : null; +}; + +/** + * Removes the given `path` (or [`paths`]). + * + * #### Example: + * + * const schema = new Schema({ name: String, age: Number }); + * schema.remove('name'); + * schema.path('name'); // Undefined + * schema.path('age'); // SchemaNumber { ... } + * + * Or as a Array: + * + * schema.remove(['name', 'age']); + * schema.path('name'); // Undefined + * schema.path('age'); // Undefined + * + * @param {string|Array} path The Path(s) to remove + * @return {Schema} the Schema instance + * @api public + */ +Schema.prototype.remove = function(path) { + if (typeof path === 'string') { + path = [path]; + } + if (Array.isArray(path)) { + path.forEach(function(name) { + if (this.path(name) == null && !this.nested[name]) { + return; + } + if (this.nested[name]) { + const allKeys = Object.keys(this.paths). + concat(Object.keys(this.nested)); + for (const path of allKeys) { + if (path.startsWith(name + '.')) { + delete this.paths[path]; + delete this.nested[path]; + _deletePath(this, path); + } + } + + this.mapPaths = this.mapPaths.filter( + schemaType => !schemaType.path.startsWith(name + '.') + ); + _deleteSubpaths(this, name); + + delete this.nested[name]; + _deletePath(this, name); + return; + } + + delete this.paths[name]; + // A map registers its values under `.$*`, both in `paths` and in + // `mapPaths`. Left behind, they keep answering `pathType()` and casting queries + // for a path the schema no longer has. + for (const subpath of Object.keys(this.paths)) { + if (subpath.startsWith(name + '.')) { + delete this.paths[subpath]; + } + } + this.mapPaths = this.mapPaths.filter( + schemaType => !schemaType.path.startsWith(name + '.') + ); + // A document array registers its element paths under `subpaths` and a + // single nested subdocument registers its paths under `singleNestedPaths`. + // Left behind, they keep answering `path()` and `pathType()`, and queries + // on the removed path keep being cast. + _deleteSubpaths(this, name); + _deletePath(this, name); + + this._removeEncryptedField(name); + }, this); + } + return this; +}; + +/*! + * ignore + */ + +function _deleteSubpaths(schema, name) { + const prefix = name + '.'; + for (const subpath of Object.keys(schema.subpaths)) { + if (subpath === name || subpath.startsWith(prefix)) { + delete schema.subpaths[subpath]; + } + } + for (const subpath of Object.keys(schema.singleNestedPaths)) { + if (subpath === name || subpath.startsWith(prefix)) { + delete schema.singleNestedPaths[subpath]; + } + } +} + +function _deletePath(schema, name) { + const pieces = name.split('.'); + const last = pieces.pop(); + + let branch = schema.tree; + + for (const piece of pieces) { + branch = branch[piece]; + if (branch == null) { + return; + } + } + + delete branch[last]; +} + +/** + * Removes the given virtual or virtuals from the schema. + * + * @param {string|Array} path The virutal path(s) to remove. + * @returns {Schema} the Schema instance, or a mongoose error if the virtual does not exist. + * @api public + */ + +Schema.prototype.removeVirtual = function(path) { + if (typeof path === 'string') { + path = [path]; + } + if (Array.isArray(path)) { + for (const virtual of path) { + if (this.virtuals[virtual] == null) { + throw new MongooseError(`Attempting to remove virtual "${virtual}" that does not exist.`); + } + } + + for (const virtual of path) { + delete this.paths[virtual]; + delete this.virtuals[virtual]; + if (virtual.indexOf('.') !== -1) { + mpath.unset(virtual, this.tree); + } else { + delete this.tree[virtual]; + } + } + } + return this; +}; + +/** + * Loads an ES6 class into a schema. Maps [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) + [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get), [static methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static), + * and [instance methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Class_body_and_method_definitions) + * to schema [virtuals](https://mongoosejs.com/docs/guide.html#virtuals), + * [statics](https://mongoosejs.com/docs/guide.html#statics), and + * [methods](https://mongoosejs.com/docs/guide.html#methods). + * + * #### Example: + * + * ```javascript + * const md5 = require('md5'); + * const userSchema = new Schema({ email: String }); + * class UserClass { + * // `gravatarImage` becomes a virtual + * get gravatarImage() { + * const hash = md5(this.email.toLowerCase()); + * return `https://www.gravatar.com/avatar/${hash}`; + * } + * + * // `getProfileUrl()` becomes a document method + * getProfileUrl() { + * return `https://mysite.com/${this.email}`; + * } + * + * // `findByEmail()` becomes a static + * static findByEmail(email) { + * return this.findOne({ email }); + * } + * } + * + * // `schema` will now have a `gravatarImage` virtual, a `getProfileUrl()` method, + * // and a `findByEmail()` static + * userSchema.loadClass(UserClass); + * ``` + * + * @param {Function} model The Class to load + * @param {boolean} [virtualsOnly] if truthy, only pulls virtuals from the class, not methods or statics + */ +Schema.prototype.loadClass = function(model, virtualsOnly) { + // Stop copying when hit certain base classes + if (model === Object.prototype || + model === Function.prototype || + Object.hasOwn(model.prototype, '$isMongooseModelPrototype') || + Object.hasOwn(model.prototype, '$isMongooseDocumentPrototype')) { + return this; + } + + this.loadClass(Object.getPrototypeOf(model), virtualsOnly); + + // Add static methods + if (!virtualsOnly) { + Object.getOwnPropertyNames(model).forEach(function(name) { + if (name.match(/^(length|name|prototype|constructor|__proto__)$/)) { + return; + } + const prop = Object.getOwnPropertyDescriptor(model, name); + if (Object.hasOwn(prop, 'value')) { + this.static(name, prop.value); + } + }, this); + } + + // Add methods and virtuals + Object.getOwnPropertyNames(model.prototype).forEach(function(name) { + if (name.match(/^(constructor)$/)) { + return; + } + const method = Object.getOwnPropertyDescriptor(model.prototype, name); + if (!virtualsOnly) { + if (typeof method.value === 'function') { + this.method(name, method.value); + } + } + if (typeof method.get === 'function') { + if (this.virtuals[name]) { + this.virtuals[name].getters = []; + } + this.virtual(name).get(method.get); + } + if (typeof method.set === 'function') { + if (this.virtuals[name]) { + this.virtuals[name].setters = []; + } + this.virtual(name).set(method.set); + } + }, this); + + return this; +}; + +/*! + * ignore + */ + +Schema.prototype._getSchema = function(path) { + const _this = this; + const pathschema = _this.path(path); + const resultPath = []; + + if (pathschema) { + pathschema.$fullPath = path; + return pathschema; + } + + function search(parts, schema) { + let p = parts.length + 1; + let foundschema; + let trypath; + + while (p--) { + trypath = parts.slice(0, p).join('.'); + foundschema = schema.path(trypath); + if (foundschema) { + resultPath.push(trypath); + + if (foundschema.embeddedSchemaType || foundschema.Constructor) { + // array of Mixed? + if (foundschema.embeddedSchemaType instanceof MongooseTypes.Mixed) { + foundschema.embeddedSchemaType.$fullPath = resultPath.join('.'); + return foundschema.embeddedSchemaType; + } + + // Now that we found the array, we need to check if there + // are remaining document paths to look up for casting. + // Also we need to handle array.$.path since schema.path + // doesn't work for that. + // If there is no foundschema.schema we are dealing with + // a path like array.$ + if (p !== parts.length) { + if (p + 1 === parts.length && foundschema.embeddedSchemaType && (parts[p] === '$' || isArrayFilter(parts[p]))) { + return foundschema.embeddedSchemaType; + } + + if (foundschema.schema) { + let ret; + if (parts[p] === '$' || isArrayFilter(parts[p])) { + if (p + 1 === parts.length) { + // comments.$ + return foundschema.embeddedSchemaType; + } + // comments.$.comments.$.title + ret = search(parts.slice(p + 1), foundschema.schema); + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || + (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + // this is the last path of the selector + ret = search(parts.slice(p), foundschema.schema); + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || + (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + } + } else if (foundschema.$isSchemaMap) { + if (p >= parts.length) { + return foundschema; + } + // Any path in the map will be an instance of the map's embedded schematype + if (p + 1 >= parts.length) { + return foundschema.$__schemaType; + } + + if (foundschema.$__schemaType instanceof MongooseTypes.Mixed) { + return foundschema.$__schemaType; + } + if (foundschema.$__schemaType.schema != null) { + // Map of docs + const ret = search(parts.slice(p + 1), foundschema.$__schemaType.schema); + return ret; + } + } + + foundschema.$fullPath = resultPath.join('.'); + + return foundschema; + } + } + } + + // look for arrays + const parts = path.split('.'); + for (let i = 0; i < parts.length; ++i) { + if (parts[i] === '$' || isArrayFilter(parts[i])) { + // Re: gh-5628, because `schema.path()` doesn't take $ into account. + parts[i] = '0'; + } + if (numberRE.test(parts[i])) { + parts[i] = '$'; + } + } + return search(parts, _this); +}; + +/*! + * ignore + */ + +Schema.prototype._getPathType = function(path) { + const _this = this; + const pathschema = _this.path(path); + + if (pathschema) { + return 'real'; + } + + function search(parts, schema) { + let p = parts.length + 1, + foundschema, + trypath; + + while (p--) { + trypath = parts.slice(0, p).join('.'); + foundschema = schema.path(trypath); + if (foundschema) { + if (foundschema.embeddedSchemaType || foundschema.Constructor) { + // array of Mixed? + if (foundschema.embeddedSchemaType instanceof MongooseTypes.Mixed) { + return { schema: foundschema, pathType: 'mixed' }; + } + + // Now that we found the array, we need to check if there + // are remaining document paths to look up for casting. + // Also we need to handle array.$.path since schema.path + // doesn't work for that. + // If there is no foundschema.schema we are dealing with + // a path like array.$ + if (p !== parts.length && foundschema.schema) { + if (parts[p] === '$' || isArrayFilter(parts[p])) { + if (p === parts.length - 1) { + return { schema: foundschema, pathType: 'nested' }; + } + // comments.$.comments.$.title + return search(parts.slice(p + 1), foundschema.schema); + } + // this is the last path of the selector + return search(parts.slice(p), foundschema.schema); + } + return { + schema: foundschema, + pathType: foundschema.$isSingleNested ? 'nested' : 'array' + }; + } + return { schema: foundschema, pathType: 'real' }; + } else if (p === parts.length && Object.hasOwn(schema.nested, trypath)) { + return { schema: schema, pathType: 'nested' }; + } + } + return { schema: foundschema || schema, pathType: 'undefined' }; + } + + // look for arrays + return search(path.split('.'), _this); +}; + +/** + * Transforms the duplicate key error by checking for duplicate key error messages by path. + * If no duplicate key error messages are found, returns the original error. + * + * @param {Error} error The error to transform + * @returns {Error} The transformed error + * @api private + */ + +Schema.prototype._transformDuplicateKeyError = function _transformDuplicateKeyError(error) { + if (!this._duplicateKeyErrorMessagesByPath) { + return error; + } + if (error.code !== 11000 && error.code !== 11001) { + return error; + } + + if (error.keyPattern != null) { + const keyPattern = error.keyPattern; + const keys = Object.keys(keyPattern); + if (keys.length !== 1) { + return error; + } + const firstKey = keys[0]; + if (!Object.hasOwn(this._duplicateKeyErrorMessagesByPath, firstKey)) { + return error; + } + return new MongooseError(this._duplicateKeyErrorMessagesByPath[firstKey], { cause: error }); + } + + return error; +}; + +/*! + * ignore + */ + +function isArrayFilter(piece) { + return piece.startsWith('$[') && piece.endsWith(']'); +} + +/** + * Called by `compile()` _right before_ compiling. Good for making any changes to + * the schema that should respect options set by plugins, like `id` + * @method _preCompile + * @memberOf Schema + * @instance + * @api private + */ + +Schema.prototype._preCompile = function _preCompile() { + this.plugin(idGetter, { deduplicate: true }); + _precomputeOptimisticConcurrency(this); + // Cache paths that have transforms + this.pathsWithTransforms(); +}; + +/*! + * Build precomputed path tries for optimisticConcurrency include/exclude so + * that lookups at save time are a single trie walk that handles nested paths + * and map wildcards like `settings.$*`. + */ + +function _precomputeOptimisticConcurrency(schema) { + const opt = schema.options.optimisticConcurrency; + if (!opt || opt === true) { + return; + } + if (Array.isArray(opt)) { + schema.options._optimisticConcurrencyTrie = new PathTrie(opt); + } else if (Array.isArray(opt.exclude)) { + schema.options._optimisticConcurrencyExcludeTrie = new PathTrie(opt.exclude); + } +} + +/** + * Returns a JSON schema representation of this Schema. + * + * By default, returns normal [JSON schema representation](https://json-schema.org/learn/getting-started-step-by-step), which is not typically what you want to use with + * [MongoDB's `$jsonSchema` collection option](https://www.mongodb.com/docs/manual/core/schema-validation/specify-json-schema/). + * Use the `useBsonType: true` option to return MongoDB `$jsonSchema` syntax instead. + * + * In addition to types, `jsonSchema()` supports the following Mongoose validators: + * - `enum` for strings and numbers + * + * #### Example: + * const schema = new Schema({ name: String }); + * // { required: ['_id'], properties: { name: { type: ['string', 'null'] }, _id: { type: 'string' } } } + * schema.toJSONSchema(); + * + * // { required: ['_id'], properties: { name: { bsonType: ['string', 'null'] }, _id: { bsonType: 'objectId' } } } + * schema.toJSONSchema({ useBsonType: true }); + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] if true, specify each path's type using `bsonType` rather than `type` for MongoDB $jsonSchema support + */ + +Schema.prototype.toJSONSchema = function toJSONSchema(options) { + const useBsonType = options?.useBsonType ?? false; + const result = useBsonType ? { required: [], properties: {} } : { type: 'object', required: [], properties: {} }; + for (const path of Object.keys(this.paths)) { + const schemaType = this.paths[path]; + + // Skip Map embedded paths, maps will be handled separately. + if (schemaType._presplitPath.indexOf('$*') !== -1) { + continue; + } + + // Nested paths are stored as `nested.path` in the schema type, so create nested paths in the json schema + // when necessary. + const isNested = schemaType._presplitPath.length > 1; + let jsonSchemaForPath = result; + if (isNested) { + for (let i = 0; i < schemaType._presplitPath.length - 1; ++i) { + const subpath = schemaType._presplitPath[i]; + if (jsonSchemaForPath.properties[subpath] == null) { + jsonSchemaForPath.properties[subpath] = useBsonType + ? { + bsonType: ['object', 'null'], + properties: {} + } + : { + type: ['object', 'null'], + properties: {} + }; + } + jsonSchemaForPath = jsonSchemaForPath.properties[subpath]; + } + } + + const lastSubpath = schemaType._presplitPath[schemaType._presplitPath.length - 1]; + if (path === '_id') { + if (!jsonSchemaForPath.required) { + jsonSchemaForPath.required = []; + } + jsonSchemaForPath.required.push('_id'); + } else if (schemaType.options.required && typeof schemaType.options.required !== 'function') { + if (!jsonSchemaForPath.required) { + jsonSchemaForPath.required = []; + } + // Only `required: true` paths are required, conditional required is not required + jsonSchemaForPath.required.push(lastSubpath); + } + jsonSchemaForPath.properties[lastSubpath] = schemaType.toJSONSchema(options); + } + + // Otherwise MongoDB errors with "$jsonSchema keyword 'required' cannot be an empty array" + if (result.required.length === 0) { + delete result.required; + } + return result; +}; + +/*! + * Module exports. + */ + +module.exports = exports = Schema; + +// require down here because of reference issues + +/** + * The various built-in Mongoose Schema Types. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const ObjectId = mongoose.Schema.Types.ObjectId; + * + * #### Types: + * + * - [String](https://mongoosejs.com/docs/schematypes.html#strings) + * - [Number](https://mongoosejs.com/docs/schematypes.html#numbers) + * - [Boolean](https://mongoosejs.com/docs/schematypes.html#booleans) | Bool + * - [Array](https://mongoosejs.com/docs/schematypes.html#arrays) + * - [Buffer](https://mongoosejs.com/docs/schematypes.html#buffers) + * - [Date](https://mongoosejs.com/docs/schematypes.html#dates) + * - [ObjectId](https://mongoosejs.com/docs/schematypes.html#objectids) | Oid + * - [Mixed](https://mongoosejs.com/docs/schematypes.html#mixed) + * - [UUID](https://mongoosejs.com/docs/schematypes.html#uuid) + * - [BigInt](https://mongoosejs.com/docs/schematypes.html#bigint) + * - [Double] (https://mongoosejs.com/docs/schematypes.html#double) + * - [Int32](https://mongoosejs.com/docs/schematypes.html#int32) + * + * Using this exposed access to the `Mixed` SchemaType, we can use them in our schema. + * + * const Mixed = mongoose.Schema.Types.Mixed; + * new mongoose.Schema({ _user: Mixed }) + * + * @api public + */ + +Schema.Types = MongooseTypes = require('./schema/index'); + +/*! + * ignore + */ + +exports.ObjectId = MongooseTypes.ObjectId; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/array.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/array.js new file mode 100644 index 00000000..9e461ff5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/array.js @@ -0,0 +1,708 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const $exists = require('./operators/exists'); +const $type = require('./operators/type'); +const MongooseError = require('../error/mongooseError'); +const SchemaArrayOptions = require('../options/schemaArrayOptions'); +const SchemaType = require('../schemaType'); +const CastError = SchemaType.CastError; +const Mixed = require('./mixed'); +const VirtualOptions = require('../options/virtualOptions'); +const VirtualType = require('../virtualType'); +const arrayDepth = require('../helpers/arrayDepth'); +const cast = require('../cast'); +const clone = require('../helpers/clone'); +const getConstructorName = require('../helpers/getConstructorName'); +const isOperator = require('../helpers/query/isOperator'); +const util = require('util'); +const utils = require('../utils'); +const castToNumber = require('./operators/helpers').castToNumber; +const geospatial = require('./operators/geospatial'); +const getDiscriminatorByValue = require('../helpers/discriminator/getDiscriminatorByValue'); + +let MongooseArray; +let EmbeddedDoc; + +const emptyOpts = Object.freeze({}); + +/** + * Array SchemaType constructor + * + * @param {string} key + * @param {SchemaType} cast + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaArray(key, cast, options, schemaOptions, parentSchema) { + // lazy load + EmbeddedDoc || (EmbeddedDoc = require('../types').Embedded); + + let typeKey = 'type'; + if (schemaOptions?.typeKey) { + typeKey = schemaOptions.typeKey; + } + this.schemaOptions = schemaOptions; + + if (cast) { + let castOptions = {}; + + if (utils.isPOJO(cast)) { + if (cast[typeKey]) { + // support { type: Woot } + castOptions = clone(cast); // do not alter user arguments + delete castOptions[typeKey]; + cast = cast[typeKey]; + } else { + cast = Mixed; + } + } + + if (options?.ref != null && castOptions.ref == null) { + castOptions.ref = options.ref; + } + + if (cast === Object) { + cast = Mixed; + } + + // support { type: 'String' } + const name = typeof cast === 'string' + ? cast + : utils.getFunctionName(cast); + + const Types = require('./index.js'); + const schemaTypeDefinition = Object.hasOwn(Types, name) ? Types[name] : cast; + + if (typeof schemaTypeDefinition === 'function') { + if (schemaTypeDefinition === SchemaArray) { + this.embeddedSchemaType = new schemaTypeDefinition(key, castOptions, schemaOptions, null, parentSchema); + } else { + this.embeddedSchemaType = new schemaTypeDefinition(key, castOptions, schemaOptions, parentSchema); + } + } else if (schemaTypeDefinition instanceof SchemaType) { + this.embeddedSchemaType = schemaTypeDefinition; + if (!(this.embeddedSchemaType instanceof EmbeddedDoc)) { + this.embeddedSchemaType.path = key; + } + } + + } + + this.$isMongooseArray = true; + + SchemaType.call(this, key, options, 'Array', parentSchema); + + let defaultArr; + let fn; + + if (this.defaultValue != null) { + defaultArr = this.defaultValue; + fn = typeof defaultArr === 'function'; + } + + if (!('defaultValue' in this) || this.defaultValue != null) { + const defaultFn = function() { + // Leave it up to `cast()` to convert the array + return fn + ? defaultArr.call(this) + : defaultArr != null + ? [].concat(defaultArr) + : []; + }; + defaultFn.$runBeforeSetters = !fn; + this.default(defaultFn); + } +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaArray.schemaName = 'Array'; + + +/** + * Options for all arrays. + * + * - `castNonArrays`: `true` by default. If `false`, Mongoose will throw a CastError when a value isn't an array. If `true`, Mongoose will wrap the provided value in an array before casting. + * + * @static + * @api public + */ + +SchemaArray.options = { castNonArrays: true }; + +/*! + * ignore + */ + +SchemaArray.defaultOptions = {}; + +/** + * Sets a default option for all Array instances. + * + * #### Example: + * + * // Make all Array instances have `required` of true by default. + * mongoose.Schema.Types.Array.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: Array })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @api public + */ +SchemaArray.set = SchemaType.set; + +SchemaArray.setters = []; + +/** + * Attaches a getter for all Array instances + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaArray.get = SchemaType.get; + +/*! + * Inherits from SchemaType. + */ +SchemaArray.prototype = Object.create(SchemaType.prototype); +SchemaArray.prototype.constructor = SchemaArray; +SchemaArray.prototype.OptionsConstructor = SchemaArrayOptions; + +/*! + * ignore + */ + +SchemaArray._checkRequired = SchemaType.prototype.checkRequired; + +/** + * Override the function the required validator uses to check whether an array + * passes the `required` check. + * + * #### Example: + * + * // Require non-empty array to pass `required` check + * mongoose.Schema.Types.Array.checkRequired(v => Array.isArray(v) && v.length); + * + * const M = mongoose.model({ arr: { type: Array, required: true } }); + * new M({ arr: [] }).validateSync(); // `null`, validation fails! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @api public + */ + +SchemaArray.checkRequired = SchemaType.checkRequired; + +/*! + * Virtuals defined on this array itself. + */ + +SchemaArray.prototype.virtuals = null; + +/** + * Check if the given value satisfies the `required` validator. + * + * @param {any} value + * @param {Document} doc + * @return {boolean} + * @api public + */ + +SchemaArray.prototype.checkRequired = function checkRequired(value, doc) { + if (typeof value === 'object' && SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaArray.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Adds an enum validator if this is an array of strings or numbers. Equivalent to + * `SchemaString.prototype.enum()` or `SchemaNumber.prototype.enum()` + * + * @param {...string|object} [args] enumeration values + * @return {SchemaArray} this + */ + +SchemaArray.prototype.enum = function() { + let arr = this; + while (true) { + const instance = arr?.embeddedSchemaType?.instance; + if (instance === 'Array') { + arr = arr.embeddedSchemaType; + continue; + } + if (instance !== 'String' && instance !== 'Number') { + throw new Error('`enum` can only be set on an array of strings or numbers ' + + ', not ' + instance); + } + break; + } + + let enumArray = arguments; + if (!Array.isArray(arguments) && utils.isObject(arguments)) { + enumArray = utils.object.vals(enumArray); + } + + arr.embeddedSchemaType.enum.apply(arr.embeddedSchemaType, enumArray); + return this; +}; + +/** + * Overrides the getters application for the population special-case + * + * @param {object} value + * @param {object} scope + * @api private + */ + +SchemaArray.prototype.applyGetters = function(value, scope) { + if (scope?.$__ != null && scope.$populated(this.path)) { + // means the object id was populated + return value; + } + + const ret = SchemaType.prototype.applyGetters.call(this, value, scope); + return ret; +}; + +SchemaArray.prototype._applySetters = function(value, scope, init, priorVal) { + if (this.embeddedSchemaType.$isMongooseArray && + SchemaArray.options.castNonArrays) { + // Check nesting levels and wrap in array if necessary + let depth = 0; + let arr = this; + while (arr != null && + arr.$isMongooseArray && + !arr.$isMongooseDocumentArray) { + ++depth; + arr = arr.embeddedSchemaType; + } + + // No need to wrap empty arrays + if (value != null && value.length !== 0) { + const valueDepth = arrayDepth(value); + if (valueDepth.min === valueDepth.max && valueDepth.max < depth && valueDepth.containsNonArrayItem) { + for (let i = valueDepth.max; i < depth; ++i) { + value = [value]; + } + } + } + } + + return SchemaType.prototype._applySetters.call(this, value, scope, init, priorVal); +}; + +/** + * Casts values for set(). + * + * @param {object} value + * @param {Document} doc document that triggers the casting + * @param {boolean} init whether this is an initialization cast + * @api private + */ + +SchemaArray.prototype.cast = function(value, doc, init, prev, options) { + // lazy load + MongooseArray || (MongooseArray = require('../types').Array); + + let i; + let l; + + if (Array.isArray(value)) { + const len = value.length; + if (!len && doc) { + const indexes = doc.schema.indexedPaths(); + + const arrayPath = this.path; + for (i = 0, l = indexes.length; i < l; ++i) { + const pathIndex = indexes[i][0][arrayPath]; + if (pathIndex === '2dsphere' || pathIndex === '2d') { + return; + } + } + + // Special case: if this index is on the parent of what looks like + // GeoJSON, skip setting the default to empty array re: #1668, #3233 + const arrayGeojsonPath = this.path.endsWith('.coordinates') ? + this.path.substring(0, this.path.lastIndexOf('.')) : null; + if (arrayGeojsonPath != null) { + for (i = 0, l = indexes.length; i < l; ++i) { + const pathIndex = indexes[i][0][arrayGeojsonPath]; + if (pathIndex === '2dsphere') { + return; + } + } + } + } + + options = options || emptyOpts; + + let rawValue = utils.isMongooseArray(value) ? value.__array : value; + let path = options.path || this.path; + if (options.arrayPathIndex != null) { + path += '.' + options.arrayPathIndex; + } + value = MongooseArray(rawValue, path, doc, this); + rawValue = value.__array; + + if (init && doc?.$__ != null && doc.$populated(this.path)) { + return value; + } + + const caster = this.embeddedSchemaType; + const isMongooseArray = caster.$isMongooseArray; + if (caster && this.embeddedSchemaType.constructor !== Mixed) { + try { + const len = rawValue.length; + for (i = 0; i < len; i++) { + const opts = {}; + // Perf: creating `arrayPath` is expensive for large arrays. + // We only need `arrayPath` if this is a nested array, so + // skip if possible. + if (isMongooseArray) { + if (options.arrayPath != null) { + opts.arrayPathIndex = i; + } else if (caster._arrayParentPath != null) { + opts.arrayPathIndex = i; + } + } + if (options.hydratedPopulatedDocs) { + opts.hydratedPopulatedDocs = options.hydratedPopulatedDocs; + } + if (options.virtuals) { + opts.virtuals = options.virtuals; + } + if (rawValue[i] === undefined && caster.defaultValue !== undefined) { + // No need to add _skipMarkModified to opts here (fallback for `getDefault()` opts parameter) + // because array setters don't rely on Document.prototype.set() - subdocuments do rely on + // Document.prototype.set() when applying setters, which is why _skipMarkModified is necessary + // for subdocuments. But here we know that `caster` is an array not a subdocument. + rawValue[i] = caster.getDefault(doc, init, null, opts); + } else { + rawValue[i] = caster.applySetters(rawValue[i], doc, init, void 0, opts); + } + } + } catch (e) { + // rethrow + throw new CastError('[' + e.kind + ']', util.inspect(value), this.path + '.' + i, e, this); + } + } + + return value; + } + + const castNonArraysOption = this.options.castNonArrays ?? SchemaArray.options.castNonArrays; + if (init || castNonArraysOption) { + // gh-2442: if we're loading this from the db and its not an array, mark + // the whole array as modified. + if (doc && init) { + doc.markModified(this.path); + } + return this.cast([value], doc, init); + } + + throw new CastError('Array', util.inspect(value), this.path, null, this); +}; + +/*! + * ignore + */ + +SchemaArray.prototype._castForPopulate = function _castForPopulate(value, doc) { + // lazy load + MongooseArray || (MongooseArray = require('../types').Array); + + if (Array.isArray(value)) { + let i; + const rawValue = value.__array ? value.__array : value; + const len = rawValue.length; + + if (this.embeddedSchemaType && this.embeddedSchemaType.constructor !== Mixed) { + try { + for (i = 0; i < len; i++) { + const opts = {}; + // Perf: creating `arrayPath` is expensive for large arrays. + // We only need `arrayPath` if this is a nested array, so + // skip if possible. + if (this.embeddedSchemaType.$isMongooseArray && this.embeddedSchemaType._arrayParentPath != null) { + opts.arrayPathIndex = i; + } + + rawValue[i] = this.embeddedSchemaType.cast(rawValue[i], doc, false, void 0, opts); + } + } catch (e) { + // rethrow + throw new CastError('[' + e.kind + ']', util.inspect(value), this.path + '.' + i, e, this); + } + } + + return value; + } + + throw new CastError('Array', util.inspect(value), this.path, null, this); +}; + +SchemaArray.prototype.$toObject = SchemaArray.prototype.toObject; + +/*! + * ignore + */ + +SchemaArray.prototype.discriminator = function(...args) { + let arr = this; + while (arr.$isMongooseArray && !arr.$isMongooseDocumentArray) { + arr = arr.embeddedSchemaType; + } + if (!arr.$isMongooseDocumentArray) { + throw new MongooseError('You can only add an embedded discriminator on a document array, ' + this.path + ' is a plain array'); + } + return arr.discriminator(...args); +}; + +/*! + * ignore + */ + +SchemaArray.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.path, this.embeddedSchemaType, options, this.schemaOptions, this.parentSchema); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) { + schematype.requiredValidator = this.requiredValidator; + } + return schematype; +}; + +SchemaArray.prototype._castForQuery = function(val, context) { + let embeddedSchemaType = this.embeddedSchemaType; + const discriminatorKey = embeddedSchemaType?.schema?.options?.discriminatorKey; + const discriminators = embeddedSchemaType?.discriminators; + + if (val && discriminators && typeof discriminatorKey === 'string') { + if (discriminators[val[discriminatorKey]]) { + embeddedSchemaType = discriminators[val[discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(discriminators, val[discriminatorKey]); + if (constructorByValue) { + embeddedSchemaType = constructorByValue; + } + } + } + + if (Array.isArray(val)) { + for (let i = this.setters.length - 1; i >= 0; i--) { + val = this.setters[i].call(this, val, this); + } + val = val.map(function(v) { + if (utils.isObject(v) && v.$elemMatch) { + return v; + } + return embeddedSchemaType.castForQuery(null, v, context); + }); + } else { + val = embeddedSchemaType.castForQuery(null, val, context); + } + + return val; +}; + +/** + * Casts values for queries. + * + * @param {string} $conditional + * @param {any} [value] + * @api private + */ + +SchemaArray.prototype.castForQuery = function($conditional, val, context) { + let handler; + + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with Array.'); + } + + return handler.call(this, val, context); + } else { + return this._castForQuery(val, context); + } +}; + +/** + * Add a virtual to this array. Specifically to this array, not the individual elements. + * + * @param {string} name + * @param {object} [options] + * @api private + */ + +SchemaArray.prototype.virtual = function virtual(name, options) { + if (name instanceof VirtualType || getConstructorName(name) === 'VirtualType') { + return this.virtual(name.path, name.options); + } + options = new VirtualOptions(options); + + if (utils.hasUserDefinedProperty(options, ['ref', 'refPath'])) { + throw new MongooseError('Cannot set populate virtual as a property of an array'); + } + + const virtual = new VirtualType(options, name); + if (this.virtuals === null) { + this.virtuals = {}; + } + this.virtuals[name] = virtual; + return virtual; +}; + +function cast$all(val, context) { + if (!Array.isArray(val)) { + val = [val]; + } + + val = val.map((v) => { + if (!utils.isObject(v)) { + return v; + } + if (v.$elemMatch != null) { + return { $elemMatch: cast(this.embeddedSchemaType.schema, v.$elemMatch, null, this?.$$context) }; + } + + const o = {}; + o[this.path] = v; + return cast(this.embeddedSchemaType.schema, o, null, this?.$$context)[this.path]; + }, this); + + return this.castForQuery(null, val, context); +} + +function cast$elemMatch(val, context) { + const keys = Object.keys(val); + const numKeys = keys.length; + for (let i = 0; i < numKeys; ++i) { + const key = keys[i]; + const value = val[key]; + if (isOperator(key) && value != null) { + val[key] = this.castForQuery(key, value, context); + } + } + + return val; +} + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$all` is the function Mongoose calls to cast `$all` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaArray + * @instance + * @api public + */ + +const handle = SchemaArray.prototype.$conditionalHandlers = {}; + +handle.$all = cast$all; +handle.$options = String; +handle.$elemMatch = cast$elemMatch; +handle.$geoIntersects = geospatial.cast$geoIntersects; +handle.$or = createLogicalQueryOperatorHandler('$or'); +handle.$and = createLogicalQueryOperatorHandler('$and'); +handle.$nor = createLogicalQueryOperatorHandler('$nor'); + +function createLogicalQueryOperatorHandler(op) { + return function logicalQueryOperatorHandler(val, context) { + if (!Array.isArray(val)) { + throw new TypeError('conditional ' + op + ' requires an array'); + } + + const ret = []; + for (const obj of val) { + ret.push(cast(this.embeddedSchemaType.schema ?? context.schema, obj, null, this?.$$context)); + } + + return ret; + }; +} + +handle.$near = +handle.$nearSphere = geospatial.cast$near; + +handle.$within = +handle.$geoWithin = geospatial.cast$within; + +handle.$size = +handle.$minDistance = +handle.$maxDistance = castToNumber; + +handle.$exists = $exists; +handle.$type = $type; + +handle.$eq = +handle.$gt = +handle.$gte = +handle.$lt = +handle.$lte = +handle.$not = +handle.$regex = +handle.$ne = SchemaArray.prototype._castForQuery; + +// `$in` is special because you can also include an empty array in the query +// like `$in: [1, []]`, see gh-5913 +handle.$nin = SchemaType.prototype.$conditionalHandlers.$nin; +handle.$in = SchemaType.prototype.$conditionalHandlers.$in; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaArray.prototype.toJSONSchema = function toJSONSchema(options) { + const embeddedSchemaType = this.getEmbeddedSchemaType(); + return { + ...this._createJSONSchemaTypeDefinition('array', 'array', options), + items: embeddedSchemaType.toJSONSchema(options) + }; +}; + +SchemaArray.prototype.autoEncryptionType = function autoEncryptionType() { + return 'array'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaArray; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/bigint.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/bigint.js new file mode 100644 index 00000000..af71de4b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/bigint.js @@ -0,0 +1,280 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const SchemaType = require('../schemaType'); +const castBigInt = require('../cast/bigint'); + +/** + * BigInt SchemaType constructor. + * + * @param {string} path + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaBigInt(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, 'BigInt', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaBigInt.schemaName = 'BigInt'; + +SchemaBigInt.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaBigInt.prototype = Object.create(SchemaType.prototype); +SchemaBigInt.prototype.constructor = SchemaBigInt; + +/*! + * ignore + */ + +SchemaBigInt._cast = castBigInt; + +/** + * Sets a default option for all BigInt instances. + * + * #### Example: + * + * // Make all bigints required by default + * mongoose.Schema.Types.BigInt.set('required', true); + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaBigInt.set = SchemaType.set; + +SchemaBigInt.setters = []; + +/** + * Attaches a getter for all BigInt instances + * + * #### Example: + * + * // Convert bigints to numbers + * mongoose.Schema.Types.BigInt.get(v => v == null ? v : Number(v)); + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaBigInt.get = SchemaType.get; + +/** + * Get/set the function used to cast arbitrary values to bigints. + * + * #### Example: + * + * // Make Mongoose cast empty string '' to false. + * const original = mongoose.Schema.Types.BigInt.cast(); + * mongoose.Schema.Types.BigInt.cast(v => { + * if (v === '') { + * return false; + * } + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Schema.Types.BigInt.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaBigInt.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaBigInt._checkRequired = v => v != null; + +/** + * Override the function the required validator uses to check whether a value + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaBigInt.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {any} value + * @return {boolean} + * @api public + */ + +SchemaBigInt.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); +}; + +/** + * Casts to bigint + * + * @param {object} value + * @param {object} model this value is optional + * @api private + */ + +SchemaBigInt.prototype.cast = function(value) { + let castBigInt; + if (typeof this._castFunction === 'function') { + castBigInt = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castBigInt = this.constructor.cast(); + } else { + castBigInt = SchemaBigInt.cast(); + } + + try { + return castBigInt(value); + } catch (error) { + throw new CastError('BigInt', value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$in` is the function Mongoose calls to cast `$in` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaBigInt + * @instance + * @api public + */ + +Object.defineProperty(SchemaBigInt.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/*! + * ignore + */ + +function handleSingle(val, context) { + return this.castForQuery(null, val, context); +} + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} val + * @api private + */ + +SchemaBigInt.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + + if (handler) { + return handler.call(this, val); + } + + return this.applySetters(val, context); + } + + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } +}; + +/** + * + * @api private + */ + +SchemaBigInt.prototype._castNullish = function _castNullish(v) { + if (typeof v === 'undefined') { + return v; + } + const castBigInt = typeof this.constructor.cast === 'function' ? + this.constructor.cast() : + SchemaBigInt.cast(); + if (castBigInt == null) { + return v; + } + return v; +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaBigInt.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('string', 'long', options); +}; + +SchemaBigInt.prototype.autoEncryptionType = function autoEncryptionType() { + return 'long'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaBigInt; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/boolean.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/boolean.js new file mode 100644 index 00000000..428c88c4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/boolean.js @@ -0,0 +1,330 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const SchemaType = require('../schemaType'); +const castBoolean = require('../cast/boolean'); + +/** + * Boolean SchemaType constructor. + * + * @param {string} path + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaBoolean(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, 'Boolean', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaBoolean.schemaName = 'Boolean'; + +SchemaBoolean.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaBoolean.prototype = Object.create(SchemaType.prototype); +SchemaBoolean.prototype.constructor = SchemaBoolean; + +/*! + * ignore + */ + +SchemaBoolean._cast = castBoolean; + +/** + * Sets a default option for all Boolean instances. + * + * #### Example: + * + * // Make all booleans have `default` of false. + * mongoose.Schema.Types.Boolean.set('default', false); + * + * const Order = mongoose.model('Order', new Schema({ isPaid: Boolean })); + * new Order({ }).isPaid; // false + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaBoolean.set = SchemaType.set; + +SchemaBoolean.setters = []; + +/** + * Attaches a getter for all Boolean instances + * + * #### Example: + * + * mongoose.Schema.Types.Boolean.get(v => v === true ? 'yes' : 'no'); + * + * const Order = mongoose.model('Order', new Schema({ isPaid: Boolean })); + * new Order({ isPaid: false }).isPaid; // 'no' + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaBoolean.get = SchemaType.get; + +/** + * Get/set the function used to cast arbitrary values to booleans. + * + * #### Example: + * + * // Make Mongoose cast empty string '' to false. + * const original = mongoose.Schema.Types.Boolean.cast(); + * mongoose.Schema.Types.Boolean.cast(v => { + * if (v === '') { + * return false; + * } + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Schema.Types.Boolean.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaBoolean.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaBoolean._defaultCaster = v => { + if (v != null && typeof v !== 'boolean') { + throw new Error(); + } + return v; +}; + +/*! + * ignore + */ + +SchemaBoolean._checkRequired = v => v === true || v === false; + +/** + * Override the function the required validator uses to check whether a boolean + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaBoolean.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. For a boolean + * to satisfy a required validator, it must be strictly equal to true or to + * false. + * + * @param {any} value + * @return {boolean} + * @api public + */ + +SchemaBoolean.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); +}; + +/** + * Configure which values get casted to `true`. + * + * #### Example: + * + * const M = mongoose.model('Test', new Schema({ b: Boolean })); + * new M({ b: 'affirmative' }).b; // undefined + * mongoose.Schema.Types.Boolean.convertToTrue.add('affirmative'); + * new M({ b: 'affirmative' }).b; // true + * + * @property convertToTrue + * @static + * @memberOf SchemaBoolean + * @type {Set} + * @api public + */ + +Object.defineProperty(SchemaBoolean, 'convertToTrue', { + get: () => castBoolean.convertToTrue, + set: v => { castBoolean.convertToTrue = v; } +}); + +/** + * Configure which values get casted to `false`. + * + * #### Example: + * + * const M = mongoose.model('Test', new Schema({ b: Boolean })); + * new M({ b: 'nay' }).b; // undefined + * mongoose.Schema.Types.Boolean.convertToFalse.add('nay'); + * new M({ b: 'nay' }).b; // false + * + * @property convertToFalse + * @static + * @memberOf SchemaBoolean + * @type {Set} + * @api public + */ + +Object.defineProperty(SchemaBoolean, 'convertToFalse', { + get: () => castBoolean.convertToFalse, + set: v => { castBoolean.convertToFalse = v; } +}); + +/** + * Casts to boolean + * + * @param {object} value + * @param {object} model this value is optional + * @api private + */ + +SchemaBoolean.prototype.cast = function(value) { + let castBoolean; + if (typeof this._castFunction === 'function') { + castBoolean = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castBoolean = this.constructor.cast(); + } else { + castBoolean = SchemaBoolean.cast(); + } + + try { + return castBoolean(value); + } catch (error) { + throw new CastError('Boolean', value, this.path, error, this); + } +}; + +const $conditionalHandlers = { ...SchemaType.prototype.$conditionalHandlers }; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$in` is the function Mongoose calls to cast `$in` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaBoolean + * @instance + * @api public + */ + +Object.defineProperty(SchemaBoolean.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} val + * @api private + */ + +SchemaBoolean.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + + if (handler) { + return handler.call(this, val); + } + + return this.applySetters(val, context); + } + + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } +}; + +/** + * + * @api private + */ + +SchemaBoolean.prototype._castNullish = function _castNullish(v) { + if (typeof v === 'undefined') { + return v; + } + const castBoolean = typeof this.constructor.cast === 'function' ? + this.constructor.cast() : + SchemaBoolean.cast(); + if (castBoolean == null) { + return v; + } + if (castBoolean.convertToFalse instanceof Set && castBoolean.convertToFalse.has(v)) { + return false; + } + if (castBoolean.convertToTrue instanceof Set && castBoolean.convertToTrue.has(v)) { + return true; + } + return v; +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaBoolean.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('boolean', 'bool', options); +}; + +SchemaBoolean.prototype.autoEncryptionType = function autoEncryptionType() { + return 'bool'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaBoolean; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/buffer.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/buffer.js new file mode 100644 index 00000000..55e7c027 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/buffer.js @@ -0,0 +1,341 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseBuffer = require('../types/buffer'); +const SchemaBufferOptions = require('../options/schemaBufferOptions'); +const SchemaType = require('../schemaType'); +const handleBitwiseOperator = require('./operators/bitwise'); +const utils = require('../utils'); + +const Binary = MongooseBuffer.Binary; +const CastError = SchemaType.CastError; + +/** + * Buffer SchemaType constructor + * + * @param {string} key + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaBuffer(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, 'Buffer', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaBuffer.schemaName = 'Buffer'; + +SchemaBuffer.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaBuffer.prototype = Object.create(SchemaType.prototype); +SchemaBuffer.prototype.constructor = SchemaBuffer; +SchemaBuffer.prototype.OptionsConstructor = SchemaBufferOptions; + +/*! + * ignore + */ + +SchemaBuffer._checkRequired = v => !!v?.length; + +/** + * Sets a default option for all Buffer instances. + * + * #### Example: + * + * // Make all buffers have `required` of true by default. + * mongoose.Schema.Types.Buffer.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: Buffer })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaBuffer.set = SchemaType.set; + +SchemaBuffer.setters = []; + +/** + * Attaches a getter for all Buffer instances + * + * #### Example: + * + * // Always convert to string when getting an ObjectId + * mongoose.Schema.Types.Buffer.get(v => v.toString('hex')); + * + * const Model = mongoose.model('Test', new Schema({ buf: Buffer } })); + * typeof (new Model({ buf: Buffer.fromString('hello') }).buf); // 'string' + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaBuffer.get = SchemaType.get; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * #### Example: + * + * // Allow empty strings to pass `required` check + * mongoose.Schema.Types.String.checkRequired(v => v != null); + * + * const M = mongoose.model({ buf: { type: Buffer, required: true } }); + * new M({ buf: Buffer.from('') }).validateSync(); // validation passes! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaBuffer.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. To satisfy a + * required validator, a buffer must not be null or undefined and have + * non-zero length. + * + * @param {any} value + * @param {Document} doc + * @return {boolean} + * @api public + */ + +SchemaBuffer.prototype.checkRequired = function(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + return this.constructor._checkRequired(value); +}; + +/** + * Casts contents + * + * @param {object} value + * @param {Document} doc document that triggers the casting + * @param {boolean} init + * @api private + */ + +SchemaBuffer.prototype.cast = function(value, doc, init, prev, options) { + let ret; + if (SchemaType._isRef(this, value, doc, init)) { + if (value?.isMongooseBuffer) { + return value; + } + + if (Buffer.isBuffer(value)) { + if (!value?.isMongooseBuffer) { + value = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + value._subtype = this.options.subtype; + } + } + return value; + } + + if (value instanceof Binary) { + ret = new MongooseBuffer(value.value(true), [this.path, doc]); + if (typeof value.sub_type !== 'number') { + throw new CastError('Buffer', value, this.path, null, this); + } + ret._subtype = value.sub_type; + return ret; + } + + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init, options); + } + } + + // documents + if (value?._id) { + value = value._id; + } + + if (value?.isMongooseBuffer) { + return value; + } + + if (Buffer.isBuffer(value)) { + if (!value?.isMongooseBuffer) { + value = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + value._subtype = this.options.subtype; + } + } + return value; + } + + if (value instanceof Binary) { + ret = new MongooseBuffer(value.value(true), [this.path, doc]); + if (typeof value.sub_type !== 'number') { + throw new CastError('Buffer', value, this.path, null, this); + } + ret._subtype = value.sub_type; + return ret; + } + + if (value === null) { + return value; + } + + + const type = typeof value; + if ( + type === 'string' || type === 'number' || Array.isArray(value) || + (type === 'object' && value.type === 'Buffer' && Array.isArray(value.data)) // gh-6863 + ) { + if (type === 'number') { + value = [value]; + } + ret = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + ret._subtype = this.options.subtype; + } + return ret; + } + + if (utils.isPOJO(value) && (value.$binary instanceof Binary || typeof value.$binary === 'string')) { + const buf = this.cast(Buffer.from(value.$binary, 'base64')); + if (value.$type != null) { + buf._subtype = value.$type; + return buf; + } + } + + throw new CastError('Buffer', value, this.path, null, this); +}; + +/** + * Sets the default [subtype](https://studio3t.com/whats-new/best-practices-uuid-mongodb/) + * for this buffer. You can find a [list of allowed subtypes here](https://www.mongodb.com/docs/manual/reference/bson-types/#binary-data). + * + * #### Example: + * + * const s = new Schema({ uuid: { type: Buffer, subtype: 4 }); + * const M = db.model('M', s); + * const m = new M({ uuid: 'test string' }); + * m.uuid._subtype; // 4 + * + * @param {number} subtype the default subtype + * @return {SchemaType} this + * @api public + */ + +SchemaBuffer.prototype.subtype = function(subtype) { + this.options.subtype = subtype; + return this; +}; + +/*! + * ignore + */ +function handleSingle(val, context) { + return this.castForQuery(null, val, context); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaBuffer + * @instance + * @api public + */ + +Object.defineProperty(SchemaBuffer.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} [value] + * @api private + */ + +SchemaBuffer.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with Buffer.'); + } + return handler.call(this, val); + } + + let casted; + try { + casted = this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + return casted ? casted.toObject({ transform: false, virtuals: false }) : casted; +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaBuffer.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('string', 'binData', options); +}; + +SchemaBuffer.prototype.autoEncryptionType = function autoEncryptionType() { + return 'binData'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaBuffer; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/date.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/date.js new file mode 100644 index 00000000..7ebf1659 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/date.js @@ -0,0 +1,467 @@ +/*! + * Module requirements. + */ + +'use strict'; + +const MongooseError = require('../error/index'); +const SchemaDateOptions = require('../options/schemaDateOptions'); +const SchemaType = require('../schemaType'); +const castDate = require('../cast/date'); +const getConstructorName = require('../helpers/getConstructorName'); +const utils = require('../utils'); + +const CastError = SchemaType.CastError; + +/** + * Date SchemaType constructor. + * + * @param {string} key + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaDate(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, 'Date', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaDate.schemaName = 'Date'; + +SchemaDate.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaDate.prototype = Object.create(SchemaType.prototype); +SchemaDate.prototype.constructor = SchemaDate; +SchemaDate.prototype.OptionsConstructor = SchemaDateOptions; + +/*! + * ignore + */ + +SchemaDate._cast = castDate; + +/** + * Sets a default option for all Date instances. + * + * #### Example: + * + * // Make all dates have `required` of true by default. + * mongoose.Schema.Types.Date.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: Date })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaDate.set = SchemaType.set; + +SchemaDate.setters = []; + +/** + * Attaches a getter for all Date instances + * + * #### Example: + * + * // Always convert Dates to string + * mongoose.Schema.Types.Date.get(v => v.toString()); + * + * const Model = mongoose.model('Test', new Schema({ date: { type: Date, default: () => new Date() } })); + * typeof (new Model({}).date); // 'string' + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaDate.get = SchemaType.get; + +/** + * Get/set the function used to cast arbitrary values to dates. + * + * #### Example: + * + * // Mongoose converts empty string '' into `null` for date types. You + * // can create a custom caster to disable it. + * const original = mongoose.Schema.Types.Date.cast(); + * mongoose.Schema.Types.Date.cast(v => { + * assert.ok(v !== ''); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Schema.Types.Date.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaDate.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaDate._defaultCaster = v => { + if (v != null && !(v instanceof Date)) { + throw new Error(); + } + return v; +}; + +/** + * Declares a TTL index (rounded to the nearest second) for _Date_ types only. + * + * This sets the `expireAfterSeconds` index option available in MongoDB >= 2.1.2. + * This index type is only compatible with Date types. + * + * #### Example: + * + * // expire in 24 hours + * new Schema({ createdAt: { type: Date, expires: 60*60*24 }}); + * + * `expires` utilizes the `ms` module from [vercel](https://github.com/vercel/ms) allowing us to use a friendlier syntax: + * + * #### Example: + * + * // expire in 24 hours + * new Schema({ createdAt: { type: Date, expires: '24h' }}); + * + * // expire in 1.5 hours + * new Schema({ createdAt: { type: Date, expires: '1.5h' }}); + * + * // expire in 7 days + * const schema = new Schema({ createdAt: Date }); + * schema.path('createdAt').expires('7d'); + * + * @param {number|string} when + * @added 3.0.0 + * @return {SchemaType} this + * @api public + */ + +SchemaDate.prototype.expires = function(when) { + if (getConstructorName(this._index) !== 'Object') { + this._index = {}; + } + + this._index.expires = when; + utils.expires(this._index); + return this; +}; + +/*! + * ignore + */ + +SchemaDate._checkRequired = v => v instanceof Date; + +/** + * Override the function the required validator uses to check whether a date + * passes the `required` check. + * + * #### Example: + * + * // Disallow "invalid date" + * mongoose.Schema.Types.Date.checkRequired(v => v instanceof Date && !isNaN(v.valueOf())); + * + * const schema = new mongoose.Schema({ myDate: { type: Date, required: true } }); + * const M = mongoose.model('Test', schema); + * // returns a ValidationError due to date being invalid + * new M({ myDate: new Date('invalid') }).validateSync(); + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaDate.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. To satisfy + * a required validator, the given value must be an instance of `Date`. + * + * @param {any} value + * @param {Document} doc + * @return {boolean} + * @api public + */ + +SchemaDate.prototype.checkRequired = function(value, doc) { + if (typeof value === 'object' && SchemaType._isRef(this, value, doc, true)) { + return value != null; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaDate.checkRequired(); + return _checkRequired(value); +}; + +/** + * Sets a minimum date validator. + * + * #### Example: + * + * const s = new Schema({ d: { type: Date, min: Date('1970-01-01') }) + * const M = db.model('M', s) + * const m = new M({ d: Date('1969-12-31') }) + * m.save(function (err) { + * console.error(err) // validator error + * m.d = Date('2014-12-08'); + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MIN} token which will be replaced with the invalid value + * const min = [Date('1970-01-01'), 'The value of path `{PATH}` ({VALUE}) is beneath the limit ({MIN}).']; + * const schema = new Schema({ d: { type: Date, min: min }) + * const M = mongoose.model('M', schema); + * const s= new M({ d: Date('1969-12-31') }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `d` (1969-12-31) is before the limit (1970-01-01). + * }) + * + * @param {Date} value minimum date + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaDate.prototype.min = function(value, message) { + if (this.minValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.minValidator; + }, this); + } + + if (value) { + let msg = message || MongooseError.messages.Date.min; + if (typeof msg === 'string') { + msg = msg.replace(/{MIN}/, (value === Date.now ? 'Date.now()' : value.toString())); + } + const _this = this; + this.validators.push({ + validator: this.minValidator = function(val) { + let _value = value; + if (typeof value === 'function' && value !== Date.now) { + _value = _value.call(this); + } + const min = (_value === Date.now ? _value() : _this.cast(_value)); + return val === null || val.valueOf() >= min.valueOf(); + }, + message: msg, + type: 'min', + min: value + }); + } + + return this; +}; + +/** + * Sets a maximum date validator. + * + * #### Example: + * + * const s = new Schema({ d: { type: Date, max: Date('2014-01-01') }) + * const M = db.model('M', s) + * const m = new M({ d: Date('2014-12-08') }) + * m.save(function (err) { + * console.error(err) // validator error + * m.d = Date('2013-12-31'); + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MAX} token which will be replaced with the invalid value + * const max = [Date('2014-01-01'), 'The value of path `{PATH}` ({VALUE}) exceeds the limit ({MAX}).']; + * const schema = new Schema({ d: { type: Date, max: max }) + * const M = mongoose.model('M', schema); + * const s= new M({ d: Date('2014-12-08') }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `d` (2014-12-08) exceeds the limit (2014-01-01). + * }) + * + * @param {Date} maximum date + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaDate.prototype.max = function(value, message) { + if (this.maxValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.maxValidator; + }, this); + } + + if (value) { + let msg = message || MongooseError.messages.Date.max; + if (typeof msg === 'string') { + msg = msg.replace(/{MAX}/, (value === Date.now ? 'Date.now()' : value.toString())); + } + const _this = this; + this.validators.push({ + validator: this.maxValidator = function(val) { + let _value = value; + if (typeof _value === 'function' && _value !== Date.now) { + _value = _value.call(this); + } + const max = (_value === Date.now ? _value() : _this.cast(_value)); + return val === null || val.valueOf() <= max.valueOf(); + }, + message: msg, + type: 'max', + max: value + }); + } + + return this; +}; + +/** + * Casts to date + * + * @param {object} value to cast + * @api private + */ + +SchemaDate.prototype.cast = function(value) { + let castDate; + if (typeof this._castFunction === 'function') { + castDate = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castDate = this.constructor.cast(); + } else { + castDate = SchemaDate.cast(); + } + + try { + return castDate(value); + } catch (error) { + throw new CastError('date', value, this.path, error, this); + } +}; + +/** + * Date Query casting. + * + * @param {any} val + * @api private + */ + +function handleSingle(val) { + return this.cast(val); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$gte` is the function Mongoose calls to cast `$gte` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaDate + * @instance + * @api public + */ + +Object.defineProperty(SchemaDate.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} [value] + * @api private + */ + +SchemaDate.prototype.castForQuery = function($conditional, val, context) { + if ($conditional == null) { + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + } + + const handler = this.$conditionalHandlers[$conditional]; + + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with Date.'); + } + + return handler.call(this, val); +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaDate.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('string', 'date', options); +}; + +SchemaDate.prototype.autoEncryptionType = function autoEncryptionType() { + return 'date'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaDate; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/decimal128.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/decimal128.js new file mode 100644 index 00000000..8be2ad30 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/decimal128.js @@ -0,0 +1,261 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const SchemaType = require('../schemaType'); +const CastError = SchemaType.CastError; +const castDecimal128 = require('../cast/decimal128'); +const isBsonType = require('../helpers/isBsonType'); + +/** + * Decimal128 SchemaType constructor. + * + * @param {string} key + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaDecimal128(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, 'Decimal128', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaDecimal128.schemaName = 'Decimal128'; + +SchemaDecimal128.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaDecimal128.prototype = Object.create(SchemaType.prototype); +SchemaDecimal128.prototype.constructor = SchemaDecimal128; + +/*! + * ignore + */ + +SchemaDecimal128._cast = castDecimal128; + +/** + * Sets a default option for all Decimal128 instances. + * + * #### Example: + * + * // Make all decimal 128s have `required` of true by default. + * mongoose.Schema.Types.Decimal128.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: mongoose.Decimal128 })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaDecimal128.set = SchemaType.set; + +SchemaDecimal128.setters = []; + +/** + * Attaches a getter for all Decimal128 instances + * + * #### Example: + * + * // Automatically convert Decimal128s to Numbers + * mongoose.Schema.Types.Decimal128.get(v => v == null ? v : Number(v)); + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaDecimal128.get = SchemaType.get; + +/** + * Get/set the function used to cast arbitrary values to decimals. + * + * #### Example: + * + * // Make Mongoose only refuse to cast numbers as decimal128 + * const original = mongoose.Schema.Types.Decimal128.cast(); + * mongoose.Decimal128.cast(v => { + * assert.ok(typeof v !== 'number'); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Decimal128.cast(false); + * + * @param {Function} [caster] + * @return {Function} + * @function get + * @static + * @api public + */ + +SchemaDecimal128.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaDecimal128._defaultCaster = v => { + if (v != null && !isBsonType(v, 'Decimal128')) { + throw new Error(); + } + return v; +}; + +/*! + * ignore + */ + +SchemaDecimal128._checkRequired = v => isBsonType(v, 'Decimal128'); + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaDecimal128.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {any} value + * @param {Document} doc + * @return {boolean} + * @api public + */ + +SchemaDecimal128.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaDecimal128.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Casts to Decimal128 + * + * @param {object} value + * @param {object} doc + * @param {boolean} init whether this is an initialization cast + * @api private + */ + +SchemaDecimal128.prototype.cast = function(value, doc, init, prev, options) { + if (SchemaType._isRef(this, value, doc, init)) { + if (isBsonType(value, 'Decimal128')) { + return value; + } + + return this._castRef(value, doc, init, options); + } + + let castDecimal128; + if (typeof this._castFunction === 'function') { + castDecimal128 = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castDecimal128 = this.constructor.cast(); + } else { + castDecimal128 = SchemaDecimal128.cast(); + } + + try { + return castDecimal128(value); + } catch (error) { + throw new CastError('Decimal128', value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$lte` is the function Mongoose calls to cast `$lte` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaDecimal128 + * @instance + * @api public + */ + +Object.defineProperty(SchemaDecimal128.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaDecimal128.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('string', 'decimal', options); +}; + +SchemaDecimal128.prototype.autoEncryptionType = function autoEncryptionType() { + return 'decimal'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaDecimal128; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArray.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArray.js new file mode 100644 index 00000000..bbc66534 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArray.js @@ -0,0 +1,664 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const DocumentArrayElement = require('./documentArrayElement'); +const EventEmitter = require('events').EventEmitter; +const SchemaArray = require('./array'); +const SchemaDocumentArrayOptions = + require('../options/schemaDocumentArrayOptions'); +const SchemaType = require('../schemaType'); +const cast = require('../cast'); +const discriminator = require('../helpers/model/discriminator'); +const handleIdOption = require('../helpers/schema/handleIdOption'); +const handleSpreadDoc = require('../helpers/document/handleSpreadDoc'); +const isOperator = require('../helpers/query/isOperator'); +const utils = require('../utils'); +const getConstructor = require('../helpers/discriminator/getConstructor'); +const InvalidSchemaOptionError = require('../error/invalidSchemaOption'); + +const arrayAtomicsSymbol = require('../helpers/symbols').arrayAtomicsSymbol; +const arrayPathSymbol = require('../helpers/symbols').arrayPathSymbol; +const documentArrayParent = require('../helpers/symbols').documentArrayParent; + +let MongooseDocumentArray; +let Subdocument; + +/** + * SubdocsArray SchemaType constructor + * + * @param {string} key + * @param {Schema} schema + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaArray + * @api public + */ + +function SchemaDocumentArray(key, schema, options, schemaOptions, parentSchema) { + if (schema.options?.timeseries) { + throw new InvalidSchemaOptionError(key, 'timeseries'); + } + const schemaTypeIdOption = SchemaDocumentArray.defaultOptions?._id; + if (schemaTypeIdOption != null) { + schemaOptions = schemaOptions || {}; + schemaOptions._id = schemaTypeIdOption; + } + + if (schemaOptions?._id != null) { + schema = handleIdOption(schema, schemaOptions); + } else if (options?._id != null) { + schema = handleIdOption(schema, options); + } + + const Constructor = _createConstructor(schema, options); + Constructor.prototype.$basePath = key; + Constructor.path = key; + + const $parentSchemaType = this; + const embeddedSchemaType = new DocumentArrayElement(key + '.$', schema, { + ...(schemaOptions || {}), + $parentSchemaType, + Constructor + }); + + SchemaArray.call(this, key, embeddedSchemaType, options, null, parentSchema); + + this.schema = schema; + // EmbeddedDocument schematype options + this.schemaOptions = schemaOptions || {}; + this.$isMongooseDocumentArray = true; + this.Constructor = Constructor; + + Constructor.base = schema.base; + + const fn = this.defaultValue; + + if (!('defaultValue' in this) || fn != null) { + this.default(function() { + let arr = fn.call(this); + if (arr != null && !Array.isArray(arr)) { + arr = [arr]; + } + // Leave it up to `cast()` to convert this to a documentarray + return arr; + }); + } +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaDocumentArray.schemaName = 'DocumentArray'; + +/** + * Options for all document arrays. + * + * - `castNonArrays`: `true` by default. If `false`, Mongoose will throw a CastError when a value isn't an array. If `true`, Mongoose will wrap the provided value in an array before casting. + * + * @api public + */ + +SchemaDocumentArray.options = { castNonArrays: true }; + +/*! + * Inherits from SchemaArray. + */ +SchemaDocumentArray.prototype = Object.create(SchemaArray.prototype); +SchemaDocumentArray.prototype.constructor = SchemaDocumentArray; +SchemaDocumentArray.prototype.OptionsConstructor = SchemaDocumentArrayOptions; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$size` is the function Mongoose calls to cast `$size` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaDocumentArray + * @instance + * @api public + */ + +Object.defineProperty(SchemaDocumentArray.prototype, '$conditionalHandlers', { + enumerable: false, + value: { ...SchemaArray.prototype.$conditionalHandlers } +}); + +/*! + * ignore + */ + +function _createConstructor(schema, options, baseClass) { + Subdocument || (Subdocument = require('../types/arraySubdocument')); + + // compile an embedded document for this schema + function EmbeddedDocument() { + Subdocument.apply(this, arguments); + if (this.__parentArray == null || this.__parentArray.getArrayParent() == null) { + return; + } + this.$session(this.__parentArray.getArrayParent().$session()); + } + + schema._preCompile(); + + const proto = baseClass?.prototype ?? Subdocument.prototype; + EmbeddedDocument.prototype = Object.create(proto); + EmbeddedDocument.prototype.$__setSchema(schema); + EmbeddedDocument.schema = schema; + EmbeddedDocument.prototype.constructor = EmbeddedDocument; + EmbeddedDocument.$isArraySubdocument = true; + EmbeddedDocument.events = new EventEmitter(); + EmbeddedDocument.base = schema.base; + + // apply methods + for (const i in schema.methods) { + EmbeddedDocument.prototype[i] = schema.methods[i]; + } + + // apply statics + for (const i in schema.statics) { + EmbeddedDocument[i] = schema.statics[i]; + } + + for (const i in EventEmitter.prototype) { + EmbeddedDocument[i] = EventEmitter.prototype[i]; + } + + EmbeddedDocument.options = options; + + return EmbeddedDocument; +} + +/** + * Adds a discriminator to this document array. + * + * #### Example: + * + * const shapeSchema = Schema({ name: String }, { discriminatorKey: 'kind' }); + * const schema = Schema({ shapes: [shapeSchema] }); + * + * const docArrayPath = parentSchema.path('shapes'); + * docArrayPath.discriminator('Circle', Schema({ radius: Number })); + * + * @param {string} name + * @param {Schema} schema fields to add to the schema for instances of this sub-class + * @param {object|string} [options] If string, same as `options.value`. + * @param {string} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @param {boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning. + * @see discriminators https://mongoosejs.com/docs/discriminators.html + * @return {Function} the constructor Mongoose will use for creating instances of this discriminator model + * @api public + */ + +SchemaDocumentArray.prototype.discriminator = function(name, schema, options) { + if (typeof name === 'function') { + name = utils.getFunctionName(name); + } + + options = options || {}; + const tiedValue = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === 'boolean' ? options.clone : true; + + if (schema.instanceOfSchema && clone) { + schema = schema.clone(); + } + + schema = discriminator(this.Constructor, name, schema, tiedValue, null, null, options?.overwriteExisting); + + const EmbeddedDocument = _createConstructor(schema, null, this.Constructor); + EmbeddedDocument.baseCasterConstructor = this.Constructor; + + Object.defineProperty(EmbeddedDocument, 'name', { + value: name + }); + + this.Constructor.discriminators[name] = EmbeddedDocument; + + return this.Constructor.discriminators[name]; +}; + +/** + * Performs local validations first, then validations on each embedded doc + * + * @api public + */ + +SchemaDocumentArray.prototype.doValidate = async function doValidate(array, scope, options) { + // lazy load + MongooseDocumentArray || (MongooseDocumentArray = require('../types/documentArray')); + + await SchemaType.prototype.doValidate.call(this, array, scope); + if (options?.updateValidator) { + return; + } + if (!utils.isMongooseDocumentArray(array)) { + array = new MongooseDocumentArray(array, this.path, scope); + } + + const promises = []; + for (let i = 0; i < array.length; ++i) { + // handle sparse arrays, do not use array.forEach which does not + // iterate over sparse elements yet reports array.length including + // them :( + let doc = array[i]; + if (doc == null) { + continue; + } + // If you set the array index directly, the doc might not yet be + // a full fledged mongoose subdoc, so make it into one. + if (!(doc instanceof Subdocument)) { + const Constructor = getConstructor(this.Constructor, array[i]); + doc = array[i] = new Constructor(doc, array, undefined, undefined, i); + } + + if (options?.validateModifiedOnly && !doc.$isModified()) { + continue; + } + + promises.push(doc.validate(null, options)); + } + + await Promise.all(promises); +}; + +/** + * Performs local validations first, then validations on each embedded doc. + * + * #### Note: + * + * This method ignores the asynchronous validators. + * + * @return {MongooseError|undefined} + * @api private + */ + +SchemaDocumentArray.prototype.doValidateSync = function(array, scope, options) { + const schemaTypeError = SchemaType.prototype.doValidateSync.call(this, array, scope); + if (schemaTypeError != null) { + return schemaTypeError; + } + + const count = array?.length; + let resultError = null; + + if (!count) { + return; + } + + // handle sparse arrays, do not use array.forEach which does not + // iterate over sparse elements yet reports array.length including + // them :( + + for (let i = 0, len = count; i < len; ++i) { + // sidestep sparse entries + let doc = array[i]; + if (!doc) { + continue; + } + + // If you set the array index directly, the doc might not yet be + // a full fledged mongoose subdoc, so make it into one. + if (!(doc instanceof Subdocument)) { + const Constructor = getConstructor(this.Constructor, array[i]); + doc = array[i] = new Constructor(doc, array, undefined, undefined, i); + } + + if (options?.validateModifiedOnly && !doc.$isModified()) { + continue; + } + + const subdocValidateError = doc.$__validateSync(options); + + if (subdocValidateError && resultError == null) { + resultError = subdocValidateError; + } + } + + return resultError; +}; + +/*! + * ignore + */ + +SchemaDocumentArray.prototype.getDefault = function(scope, init, options) { + let ret = typeof this.defaultValue === 'function' + ? this.defaultValue.call(scope) + : this.defaultValue; + + if (ret == null) { + return ret; + } + + if (options?.skipCast) { + return ret; + } + + // lazy load + MongooseDocumentArray || (MongooseDocumentArray = require('../types/documentArray')); + + if (!Array.isArray(ret)) { + ret = [ret]; + } + + ret = new MongooseDocumentArray(ret, this.path, scope); + + for (let i = 0; i < ret.length; ++i) { + const Constructor = getConstructor(this.Constructor, ret[i]); + const _subdoc = new Constructor({}, ret, undefined, + undefined, i); + _subdoc.$init(ret[i]); + _subdoc.isNew = true; + + // Make sure all paths in the subdoc are set to `default` instead + // of `init` since we used `init`. + Object.assign(_subdoc.$__.activePaths.default, _subdoc.$__.activePaths.init); + _subdoc.$__.activePaths.init = {}; + + ret[i] = _subdoc; + } + + return ret; +}; + +const _toObjectOptions = Object.freeze({ transform: false, virtuals: false }); +const initDocumentOptions = Object.freeze({ skipId: false, willInit: true }); + +/** + * Casts contents + * + * @param {object} value + * @param {Document} document that triggers the casting + * @api private + */ + +SchemaDocumentArray.prototype.cast = function(value, doc, init, prev, options) { + // lazy load + MongooseDocumentArray || (MongooseDocumentArray = require('../types/documentArray')); + + // Skip casting if `value` is the same as the previous value, no need to cast. See gh-9266 + if (value?.[arrayPathSymbol] != null && value === prev) { + return value; + } + + let selected; + let subdoc; + + options = options || {}; + + const path = options.path || this.path; + + if (!Array.isArray(value)) { + if (!init && !SchemaDocumentArray.options.castNonArrays) { + throw new CastError('DocumentArray', value, this.path, null, this); + } + // gh-2442 mark whole array as modified if we're initializing a doc from + // the db and the path isn't an array in the document + if (!!doc && init) { + doc.markModified(path); + } + return this.cast([value], doc, init, prev, options); + } + + // We need to create a new array, otherwise change tracking will + // update the old doc (gh-4449) + if (!options.skipDocumentArrayCast || utils.isMongooseDocumentArray(value)) { + value = new MongooseDocumentArray(value, path, doc, this); + } + + if (prev != null) { + value[arrayAtomicsSymbol] = prev[arrayAtomicsSymbol] || {}; + } + + if (options.arrayPathIndex != null) { + value[arrayPathSymbol] = path + '.' + options.arrayPathIndex; + } + + const rawArray = utils.isMongooseDocumentArray(value) ? value.__array : value; + const len = rawArray.length; + + for (let i = 0; i < len; ++i) { + if (!rawArray[i]) { + continue; + } + + const Constructor = getConstructor(this.Constructor, rawArray[i]); + + const spreadDoc = handleSpreadDoc(rawArray[i], true); + if (rawArray[i] !== spreadDoc) { + rawArray[i] = spreadDoc; + } + + if (rawArray[i] instanceof Subdocument) { + // gh-15973: Clone if subdocument has a different parent, or if it already has a + // different __index (e.g. reordered or duplicated in the array). If __index is null, + // we can safely set it without cloning. + if (rawArray[i][documentArrayParent] !== doc || + (rawArray[i].__index != null && rawArray[i].__index !== i)) { + if (init) { + const subdoc = new Constructor(null, value, initDocumentOptions, selected, i); + rawArray[i] = subdoc.$init(rawArray[i]); + } else { + const subdoc = new Constructor(rawArray[i], value, undefined, undefined, i); + rawArray[i] = subdoc; + } + } + // Might not have the correct index yet, so ensure it does. + if (rawArray[i].__index == null) { + rawArray[i].$setIndex(i); + } + } else if (rawArray[i] != null) { + if (init) { + if (doc) { + selected || (selected = scopePaths(this, doc.$__.selected, init)); + } else { + selected = true; + } + + subdoc = new Constructor(null, value, initDocumentOptions, selected, i); + // Don't pass `path` to $init - it's only for this DocumentArray itself, not its element fields. + // Element subdocuments use relative paths internally for change tracking. + if (options.path != null) { + const { path, ...initOptions } = options; + options = initOptions; + } + rawArray[i] = subdoc.$init(rawArray[i], options); + } else { + if (typeof prev?.id === 'function') { + subdoc = prev.id(rawArray[i]._id); + } + + if (prev && subdoc && utils.deepEqual(subdoc.toObject(_toObjectOptions), rawArray[i])) { + // handle resetting doc with existing id and same data + subdoc.set(rawArray[i]); + // if set() is hooked it will have no return value + // see gh-746 + rawArray[i] = subdoc; + } else { + try { + subdoc = new Constructor(rawArray[i], value, undefined, + undefined, i); + // if set() is hooked it will have no return value + // see gh-746 + rawArray[i] = subdoc; + } catch (error) { + throw new CastError('embedded', rawArray[i], + value[arrayPathSymbol], error, this); + } + } + } + } + } + + return value; +}; + +/*! + * ignore + */ + +SchemaDocumentArray.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor( + this.path, + this.schema, + options, + this.schemaOptions, + this.parentSchema + ); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) { + schematype.requiredValidator = this.requiredValidator; + } + schematype.Constructor.discriminators = Object.assign({}, + this.Constructor.discriminators); + schematype._appliedDiscriminators = this._appliedDiscriminators; + return schematype; +}; + +/*! + * ignore + */ + +SchemaDocumentArray.prototype.applyGetters = function(value, scope) { + return SchemaType.prototype.applyGetters.call(this, value, scope); +}; + +/** + * Scopes paths selected in a query to this array. + * Necessary for proper default application of subdocument values. + * + * @param {DocumentArrayPath} array the array to scope `fields` paths + * @param {object|undefined} fields the root fields selected in the query + * @param {boolean|undefined} init if we are being created part of a query result + * @api private + */ + +function scopePaths(array, fields, init) { + if (!(init && fields)) { + return undefined; + } + + const path = array.path + '.'; + const keys = Object.keys(fields); + let i = keys.length; + const selected = {}; + let hasKeys; + let key; + let sub; + + while (i--) { + key = keys[i]; + if (key.startsWith(path)) { + sub = key.substring(path.length); + if (sub === '$') { + continue; + } + if (sub.startsWith('$.')) { + sub = sub.substring(2); + } + hasKeys || (hasKeys = true); + selected[sub] = fields[key]; + } + } + + return hasKeys && selected || undefined; +} + +/*! + * ignore + */ + +SchemaDocumentArray.defaultOptions = {}; + +/** + * Sets a default option for all DocumentArray instances. + * + * #### Example: + * + * // Make all document arrays not have `_id` by default. + * mongoose.Schema.Types.DocumentArray.set('_id', false); + * + * @param {string} option The name of the option you'd like to set (e.g. trim, lowercase, etc...) + * @param {any} value The value of the option you'd like to set. + * @return {void} + * @function set + * @static + * @api public + */ + +SchemaDocumentArray.set = SchemaType.set; + +SchemaDocumentArray.setters = []; + +/** + * Attaches a getter for all DocumentArrayPath instances + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaDocumentArray.get = SchemaType.get; + +/*! + * Handle casting $elemMatch operators + */ + +SchemaDocumentArray.prototype.$conditionalHandlers.$elemMatch = cast$elemMatch; + +function cast$elemMatch(val, context) { + const keys = Object.keys(val); + const numKeys = keys.length; + for (let i = 0; i < numKeys; ++i) { + const key = keys[i]; + const value = val[key]; + if (isOperator(key) && value != null) { + val[key] = this.castForQuery(key, value, context); + } + } + + // Is this an embedded discriminator and is the discriminator key set? + // If so, use the discriminator schema. See gh-7449 + const discriminatorKey = this?.Constructor?.schema?.options?.discriminatorKey; + const discriminators = this?.Constructor?.schema?.discriminators || {}; + if (discriminatorKey != null && + val[discriminatorKey] != null && + discriminators[val[discriminatorKey]] != null) { + return cast(discriminators[val[discriminatorKey]], val, null, this?.$$context); + } + + const schema = this.Constructor.schema ?? context.schema; + return cast(schema, val, null, this?.$$context); +} + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaDocumentArray.prototype.toJSONSchema = function toJSONSchema(options) { + const itemsTypeDefinition = this._createJSONSchemaTypeDefinition('object', 'object', { ...options, _overrideRequired: false }); + return { + ...this._createJSONSchemaTypeDefinition('array', 'array', options), + items: { ...itemsTypeDefinition, ...this.schema.toJSONSchema(options) } + }; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaDocumentArray; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArrayElement.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArrayElement.js new file mode 100644 index 00000000..cbc41f28 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/documentArrayElement.js @@ -0,0 +1,148 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('../error/mongooseError'); +const SchemaType = require('../schemaType'); +const SchemaSubdocument = require('./subdocument'); +const getConstructor = require('../helpers/discriminator/getConstructor'); + +/** + * DocumentArrayElement SchemaType constructor. Mongoose calls this internally when you define a new document array in your schema. + * + * #### Example: + * const schema = new Schema({ users: [{ name: String }] }); + * schema.path('users.$'); // SchemaDocumentArrayElement with schema `new Schema({ name: String })` + * + * @param {string} path + * @param {Schema} schema + * @param {object} options + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaDocumentArrayElement(path, schema, options, parentSchema) { + this.$parentSchemaType = options?.$parentSchemaType; + if (!this.$parentSchemaType) { + throw new MongooseError('Cannot create DocumentArrayElement schematype without a parent'); + } + delete options.$parentSchemaType; + + SchemaType.call(this, path, options, 'DocumentArrayElement', parentSchema); + + this.$isMongooseDocumentArrayElement = true; + this.Constructor = options?.Constructor; + this.schema = schema; +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaDocumentArrayElement.schemaName = 'DocumentArrayElement'; + +SchemaDocumentArrayElement.defaultOptions = {}; + +/** + * Sets a default option for all SchemaDocumentArrayElement instances. + * + * #### Example: + * + * // Make all document array elements have option `_id` equal to false. + * mongoose.Schema.Types.DocumentArrayElement.set('_id', false); + * + * @param {string} option The name of the option you'd like to set + * @param {any} value The value of the option you'd like to set. + * @return {void} + * @function set + * @static + * @api public + */ + +SchemaDocumentArrayElement.set = SchemaType.set; + +/** + * Attaches a getter for all DocumentArrayElement instances + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaDocumentArrayElement.get = SchemaType.get; + +/*! + * Inherits from SchemaType. + */ +SchemaDocumentArrayElement.prototype = Object.create(SchemaType.prototype); +SchemaDocumentArrayElement.prototype.constructor = SchemaDocumentArrayElement; + +/** + * Casts `val` for DocumentArrayElement. + * + * @param {object} value to cast + * @api private + */ + +SchemaDocumentArrayElement.prototype.cast = function(...args) { + return this.$parentSchemaType.cast(...args)[0]; +}; + +/** + * Async validation on this individual array element + * + * @api public + */ + +SchemaDocumentArrayElement.prototype.doValidate = async function doValidate(value, scope, options) { + const Constructor = getConstructor(this.Constructor, value); + + if (value && !(value instanceof Constructor)) { + value = new Constructor(value, scope, null, null, options?.index ?? null); + } + + return SchemaSubdocument.prototype.doValidate.call(this, value, scope, options); +}; + +/** + * Clone the current SchemaType + * + * @return {DocumentArrayElement} The cloned instance + * @api private + */ + +SchemaDocumentArrayElement.prototype.clone = function() { + // This schematype takes the subdocument schema where `SchemaType` takes the + // options, so it cannot go through `SchemaType.prototype.clone()`: the + // arguments would land in the wrong parameters and `$parentSchemaType` would + // never reach the constructor. + const options = Object.assign({}, this.options, { + $parentSchemaType: this.$parentSchemaType, + Constructor: this.Constructor + }); + const schematype = new this.constructor( + this.path, + this.schema, + options, + this.parentSchema + ); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) { + schematype.requiredValidator = this.requiredValidator; + } + + return schematype; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaDocumentArrayElement; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/double.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/double.js new file mode 100644 index 00000000..282c9360 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/double.js @@ -0,0 +1,244 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const SchemaType = require('../schemaType'); +const castDouble = require('../cast/double'); + +/** + * Double SchemaType constructor. + * + * @param {string} path + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaDouble(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, 'Double', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaDouble.schemaName = 'Double'; + +SchemaDouble.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaDouble.prototype = Object.create(SchemaType.prototype); +SchemaDouble.prototype.constructor = SchemaDouble; + +/*! + * ignore + */ + +SchemaDouble._cast = castDouble; + +/** + * Sets a default option for all Double instances. + * + * #### Example: + * + * // Make all Double fields required by default + * mongoose.Schema.Types.Double.set('required', true); + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaDouble.set = SchemaType.set; + +SchemaDouble.setters = []; + +/** + * Attaches a getter for all Double instances + * + * #### Example: + * + * // Converts Double to be a represent milliseconds upon access + * mongoose.Schema.Types.Double.get(v => v == null ? '0.000 ms' : v.toString() + ' ms'); + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaDouble.get = SchemaType.get; + +/*! + * ignore + */ + +SchemaDouble._defaultCaster = v => { + if (v != null) { + if (v._bsontype !== 'Double') { + throw new Error(); + } + } + + return v; +}; + +/** + * Get/set the function used to cast arbitrary values to IEEE 754-2008 floating points + * + * #### Example: + * + * // Make Mongoose cast any NaNs to 0 + * const defaultCast = mongoose.Schema.Types.Double.cast(); + * mongoose.Schema.Types.Double.cast(v => { + * if (isNaN(v)) { + * return 0; + * } + * return defaultCast(v); + * }); + * + * // Or disable casting for Doubles entirely (only JS numbers are permitted) + * mongoose.Schema.Types.Double.cast(false); + * + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaDouble.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + + this._cast = caster; + + return this._cast; +}; + + +/*! + * ignore + */ + +SchemaDouble._checkRequired = v => v != null; +/** + * Override the function the required validator uses to check whether a value + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaDouble.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {any} value + * @return {boolean} + * @api public + */ + +SchemaDouble.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); +}; + +/** + * Casts to Double + * + * @param {object} value + * @param {object} model this value is optional + * @api private + */ + +SchemaDouble.prototype.cast = function(value) { + let castDouble; + if (typeof this._castFunction === 'function') { + castDouble = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castDouble = this.constructor.cast(); + } else { + castDouble = SchemaDouble.cast(); + } + + try { + return castDouble(value); + } catch (error) { + throw new CastError('Double', value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$lt` is the function Mongoose calls to cast `$lt` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaDouble + * @instance + * @api public + */ + +Object.defineProperty(SchemaDouble.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaDouble.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('number', 'double', options); +}; + +SchemaDouble.prototype.autoEncryptionType = function autoEncryptionType() { + return 'double'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaDouble; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/index.js new file mode 100644 index 00000000..23aee05c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/index.js @@ -0,0 +1,32 @@ + +/*! + * Module exports. + */ + +'use strict'; + +exports.Array = require('./array'); +exports.BigInt = require('./bigint'); +exports.Boolean = require('./boolean'); +exports.Buffer = require('./buffer'); +exports.Date = require('./date'); +exports.Decimal128 = exports.Decimal = require('./decimal128'); +exports.DocumentArray = require('./documentArray'); +exports.DocumentArrayElement = require('./documentArrayElement'); +exports.Double = require('./double'); +exports.Int32 = require('./int32'); +exports.Map = require('./map'); +exports.Mixed = require('./mixed'); +exports.Number = require('./number'); +exports.ObjectId = require('./objectId'); +exports.String = require('./string'); +exports.Subdocument = require('./subdocument'); +exports.UUID = require('./uuid'); +exports.Union = require('./union'); + +// alias + +exports.Oid = exports.ObjectId; +exports.Object = exports.Mixed; +exports.Bool = exports.Boolean; +exports.ObjectID = exports.ObjectId; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/int32.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/int32.js new file mode 100644 index 00000000..9dd6e7a4 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/int32.js @@ -0,0 +1,287 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const SchemaType = require('../schemaType'); +const castInt32 = require('../cast/int32'); +const handleBitwiseOperator = require('./operators/bitwise'); + +/** + * Int32 SchemaType constructor. + * + * @param {string} path + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaInt32(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, 'Int32', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaInt32.schemaName = 'Int32'; + +SchemaInt32.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaInt32.prototype = Object.create(SchemaType.prototype); +SchemaInt32.prototype.constructor = SchemaInt32; + +/*! + * ignore + */ + +SchemaInt32._cast = castInt32; + +/** + * Sets a default option for all Int32 instances. + * + * #### Example: + * + * // Make all Int32 fields required by default + * mongoose.Schema.Types.Int32.set('required', true); + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaInt32.set = SchemaType.set; + +SchemaInt32.setters = []; + +/** + * Attaches a getter for all Int32 instances + * + * #### Example: + * + * // Converts int32 to be a represent milliseconds upon access + * mongoose.Schema.Types.Int32.get(v => v == null ? '0 ms' : v.toString() + ' ms'); + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaInt32.get = SchemaType.get; + +/*! + * ignore + */ + +SchemaInt32._defaultCaster = v => { + const INT32_MAX = 0x7FFFFFFF; + const INT32_MIN = -0x80000000; + + if (v != null) { + if (typeof v !== 'number' || v !== (v | 0) || v < INT32_MIN || v > INT32_MAX) { + throw new Error(); + } + } + + return v; +}; + +/** + * Get/set the function used to cast arbitrary values to 32-bit integers + * + * #### Example: + * + * // Make Mongoose cast NaN to 0 + * const defaultCast = mongoose.Schema.Types.Int32.cast(); + * mongoose.Schema.Types.Int32.cast(v => { + * if (isNaN(v)) { + * return 0; + * } + * return defaultCast(v); + * }); + * + * // Or disable casting for Int32s entirely (only JS numbers within 32-bit integer bounds and null-ish values are permitted) + * mongoose.Schema.Types.Int32.cast(false); + * + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaInt32.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + + this._cast = caster; + + return this._cast; +}; + + +/*! + * ignore + */ + +SchemaInt32._checkRequired = v => v != null; +/** + * Override the function the required validator uses to check whether a value + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaInt32.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {any} value + * @return {boolean} + * @api public + */ + +SchemaInt32.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); +}; + +/** + * Casts to Int32 + * + * @param {object} value + * @param {object} model this value is optional + * @api private + */ + +SchemaInt32.prototype.cast = function(value) { + let castInt32; + if (typeof this._castFunction === 'function') { + castInt32 = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castInt32 = this.constructor.cast(); + } else { + castInt32 = SchemaInt32.cast(); + } + + try { + return castInt32(value); + } catch (error) { + throw new CastError('Int32', value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$gt` is the function Mongoose calls to cast `$gt` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaInt32 + * @instance + * @api public + */ + +Object.defineProperty(SchemaInt32.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/*! + * ignore + */ + +function handleSingle(val, context) { + return this.castForQuery(null, val, context); +} + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} val + * @api private + */ + +SchemaInt32.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + + if (handler) { + return handler.call(this, val); + } + + return this.applySetters(val, context); + } + + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaInt32.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('number', 'int', options); +}; + +SchemaInt32.prototype.autoEncryptionType = function autoEncryptionType() { + return 'int'; +}; + + +/*! + * Module exports. + */ + +module.exports = SchemaInt32; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/map.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/map.js new file mode 100644 index 00000000..d888ab57 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/map.js @@ -0,0 +1,193 @@ +'use strict'; + +/*! + * ignore + */ + +const MongooseMap = require('../types/map'); +const SchemaMapOptions = require('../options/schemaMapOptions'); +const SchemaType = require('../schemaType'); +const MongooseError = require('../error/mongooseError'); +const Schema = require('../schema'); +const utils = require('../utils'); + +class SchemaMap extends SchemaType { + /** + * Map SchemaType constructor. + * + * @param {string} path + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + + constructor(key, options, schemaOptions, parentSchema) { + super(key, options, 'Map', parentSchema); + this.$isSchemaMap = true; + // Create the nested schema type for the map values + this._createNestedSchemaType(parentSchema, key, options, schemaOptions); + } + + /** + * Casts to Map + * + * @param {object} value + * @param {object} model this value is optional + * @api private + */ + + cast(val, doc, init, prev, options) { + if (val instanceof MongooseMap) { + return val; + } + + const path = options?.path ?? this.path; + + if (init) { + const map = new MongooseMap({}, path, doc, this.$__schemaType); + + if (val instanceof global.Map) { + for (const key of val.keys()) { + let _val = val.get(key); + if (_val == null) { + _val = map.$__schemaType._castNullish(_val); + } else { + _val = map.$__schemaType.cast(_val, doc, true, null, { ...options, path: path + '.' + key }); + } + map.$init(key, _val); + } + } else { + for (const key of Object.keys(val)) { + let _val = val[key]; + if (_val == null) { + _val = map.$__schemaType._castNullish(_val); + } else { + _val = map.$__schemaType.cast(_val, doc, true, null, { ...options, path: path + '.' + key }); + } + map.$init(key, _val); + } + } + + return map; + } + + return new MongooseMap(val, path, doc, this.$__schemaType); + } + + /** + * Creates a copy of this map schema type. + * + * @api private + */ + + clone() { + const schematype = super.clone(); + + if (this.$__schemaType != null) { + schematype.$__schemaType = this.$__schemaType.clone(); + } + return schematype; + } + + /** + * Returns the embedded schema type (i.e. the `.$*` path) + * + * @api public + */ + + getEmbeddedSchemaType() { + return this.$__schemaType; + } + + /** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + + toJSONSchema(options) { + const embeddedSchemaType = this.getEmbeddedSchemaType(); + + const result = this._createJSONSchemaTypeDefinition('object', 'object', options); + result.additionalProperties = embeddedSchemaType.toJSONSchema(options); + + return result; + } + + /** + * Returns the auto encryption type for this schema type. + * + * @api public + */ + + autoEncryptionType() { + return 'object'; + } +} + +/** + * Sets a default option for all Map instances. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaMap.set = SchemaType.set; + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ + +SchemaMap.schemaName = 'Map'; + +SchemaMap.prototype.OptionsConstructor = SchemaMapOptions; + +SchemaMap.defaultOptions = {}; + +/*! + * ignore + */ + +SchemaMap.prototype._createNestedSchemaType = function _createNestedSchemaType(schema, path, obj, options) { + const mapPath = path + '.$*'; + let _mapType = { type: {} }; + if (utils.hasUserDefinedProperty(obj, 'of')) { + const isInlineSchema = utils.isPOJO(obj.of) && + utils.hasOwnKeys(obj.of) && + !utils.hasUserDefinedProperty(obj.of, schema.options.typeKey); + if (isInlineSchema) { + _mapType = { [schema.options.typeKey]: new Schema(obj.of) }; + } else if (utils.isPOJO(obj.of)) { + _mapType = Object.assign({}, obj.of); + } else { + _mapType = { [schema.options.typeKey]: obj.of }; + } + + if (_mapType[schema.options.typeKey] && _mapType[schema.options.typeKey].instanceOfSchema) { + const subdocumentSchema = _mapType[schema.options.typeKey]; + subdocumentSchema.eachPath((subpath, type) => { + if (type.options.select === true || type.options.select === false) { + throw new MongooseError('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "' + path + '.' + subpath + '"'); + } + }); + } + + if (utils.hasUserDefinedProperty(obj, 'ref')) { + _mapType.ref = obj.ref; + } + } + this.$__schemaType = schema.interpretAsType(mapPath, _mapType, options); +}; + +module.exports = SchemaMap; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/mixed.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/mixed.js new file mode 100644 index 00000000..7445e64e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/mixed.js @@ -0,0 +1,146 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const SchemaType = require('../schemaType'); +const symbols = require('./symbols'); +const isObject = require('../helpers/isObject'); +const utils = require('../utils'); + +/** + * Mixed SchemaType constructor. + * + * @param {string} path + * @param {object} options + * @param {object} _schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaMixed(path, options, _schemaOptions, parentSchema) { + if (options?.default) { + const def = options.default; + if (Array.isArray(def) && def.length === 0) { + // make sure empty array defaults are handled + options.default = Array; + } else if (!options.shared && isObject(def) && utils.hasOwnKeys(def) === false) { + // prevent odd "shared" objects between documents + options.default = function() { + return {}; + }; + } + } + + SchemaType.call(this, path, options, 'Mixed', parentSchema); + + this[symbols.schemaMixedSymbol] = true; +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaMixed.schemaName = 'Mixed'; + +SchemaMixed.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaMixed.prototype = Object.create(SchemaType.prototype); +SchemaMixed.prototype.constructor = SchemaMixed; + +/** + * Attaches a getter for all Mixed paths. + * + * #### Example: + * + * // Hide the 'hidden' path + * mongoose.Schema.Types.Mixed.get(v => Object.assign({}, v, { hidden: null })); + * + * const Model = mongoose.model('Test', new Schema({ test: {} })); + * new Model({ test: { hidden: 'Secret!' } }).test.hidden; // null + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaMixed.get = SchemaType.get; + +/** + * Sets a default option for all Mixed instances. + * + * #### Example: + * + * // Make all mixed instances have `required` of true by default. + * mongoose.Schema.Types.Mixed.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: mongoose.Mixed })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaMixed.set = SchemaType.set; + +SchemaMixed.setters = []; + +/** + * Casts `val` for Mixed. + * + * _this is a no-op_ + * + * @param {object} value to cast + * @api private + */ + +SchemaMixed.prototype.cast = function(val) { + if (val instanceof Error) { + return utils.errorToPOJO(val); + } + return val; +}; + +/** + * Casts contents for queries. + * + * @param {string} $cond + * @param {any} [val] + * @api private + */ + +SchemaMixed.prototype.castForQuery = function($cond, val) { + return val; +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +// eslint-disable-next-line no-unused-vars +SchemaMixed.prototype.toJSONSchema = function toJSONSchema(_options) { + return {}; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaMixed; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/number.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/number.js new file mode 100644 index 00000000..03a7a4ab --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/number.js @@ -0,0 +1,508 @@ +'use strict'; + +/*! + * Module requirements. + */ + +const MongooseError = require('../error/index'); +const SchemaNumberOptions = require('../options/schemaNumberOptions'); +const SchemaType = require('../schemaType'); +const castNumber = require('../cast/number'); +const handleBitwiseOperator = require('./operators/bitwise'); +const utils = require('../utils'); + +const CastError = SchemaType.CastError; + +/** + * Number SchemaType constructor. + * + * @param {string} key + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaNumber(key, options, _schemaOptions, parentSchema) { + this.enumValues = []; + SchemaType.call(this, key, options, 'Number', parentSchema); +} + +/** + * Attaches a getter for all Number instances. + * + * #### Example: + * + * // Make all numbers round down + * mongoose.Number.get(function(v) { return Math.floor(v); }); + * + * const Model = mongoose.model('Test', new Schema({ test: Number })); + * new Model({ test: 3.14 }).test; // 3 + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaNumber.get = SchemaType.get; + +/** + * Sets a default option for all Number instances. + * + * #### Example: + * + * // Make all numbers have option `min` equal to 0. + * mongoose.Schema.Types.Number.set('min', 0); + * + * const Order = mongoose.model('Order', new Schema({ amount: Number })); + * new Order({ amount: -10 }).validateSync().errors.amount.message; // Path `amount` must be larger than 0. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaNumber.set = SchemaType.set; + +SchemaNumber.setters = []; + +/*! + * ignore + */ + +SchemaNumber._cast = castNumber; + +/** + * Get/set the function used to cast arbitrary values to numbers. + * + * #### Example: + * + * // Make Mongoose cast empty strings '' to 0 for paths declared as numbers + * const original = mongoose.Number.cast(); + * mongoose.Number.cast(v => { + * if (v === '') { return 0; } + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Number.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaNumber.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaNumber._defaultCaster = v => { + if (typeof v !== 'number') { + throw new Error(); + } + return v; +}; + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaNumber.schemaName = 'Number'; + +SchemaNumber.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaNumber.prototype = Object.create(SchemaType.prototype); +SchemaNumber.prototype.constructor = SchemaNumber; +SchemaNumber.prototype.OptionsConstructor = SchemaNumberOptions; + +/*! + * ignore + */ + +SchemaNumber._checkRequired = v => typeof v === 'number' || v instanceof Number; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaNumber.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {any} value + * @param {Document} doc + * @return {boolean} + * @api public + */ + +SchemaNumber.prototype.checkRequired = function checkRequired(value, doc) { + if (typeof value === 'object' && SchemaType._isRef(this, value, doc, true)) { + return value != null; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaNumber.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Sets a minimum number validator. + * + * #### Example: + * + * const s = new Schema({ n: { type: Number, min: 10 }) + * const M = db.model('M', s) + * const m = new M({ n: 9 }) + * m.save(function (err) { + * console.error(err) // validator error + * m.n = 10; + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MIN} token which will be replaced with the invalid value + * const min = [10, 'The value of path `{PATH}` ({VALUE}) is beneath the limit ({MIN}).']; + * const schema = new Schema({ n: { type: Number, min: min }) + * const M = mongoose.model('Measurement', schema); + * const s= new M({ n: 4 }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `n` (4) is beneath the limit (10). + * }) + * + * @param {number} value minimum number + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaNumber.prototype.min = function(value, message) { + if (this.minValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.minValidator; + }, this); + } + + if (value != null) { + let msg = message || MongooseError.messages.Number.min; + msg = msg.replace(/{MIN}/, value); + this.validators.push({ + validator: this.minValidator = function(v) { + return v == null || v >= value; + }, + message: msg, + type: 'min', + min: value + }); + } + + return this; +}; + +/** + * Sets a maximum number validator. + * + * #### Example: + * + * const s = new Schema({ n: { type: Number, max: 10 }) + * const M = db.model('M', s) + * const m = new M({ n: 11 }) + * m.save(function (err) { + * console.error(err) // validator error + * m.n = 10; + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MAX} token which will be replaced with the invalid value + * const max = [10, 'The value of path `{PATH}` ({VALUE}) exceeds the limit ({MAX}).']; + * const schema = new Schema({ n: { type: Number, max: max }) + * const M = mongoose.model('Measurement', schema); + * const s= new M({ n: 4 }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `n` (4) exceeds the limit (10). + * }) + * + * @param {number} maximum number + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaNumber.prototype.max = function(value, message) { + if (this.maxValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.maxValidator; + }, this); + } + + if (value != null) { + let msg = message || MongooseError.messages.Number.max; + msg = msg.replace(/{MAX}/, value); + this.validators.push({ + validator: this.maxValidator = function(v) { + return v == null || v <= value; + }, + message: msg, + type: 'max', + max: value + }); + } + + return this; +}; + +/** + * Sets a enum validator + * + * #### Example: + * + * const s = new Schema({ n: { type: Number, enum: [1, 2, 3] }); + * const M = db.model('M', s); + * + * const m = new M({ n: 4 }); + * await m.save(); // throws validation error + * + * m.n = 3; + * await m.save(); // succeeds + * + * @param {Array} values allowed values + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaNumber.prototype.enum = function(values, message) { + if (this.enumValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.enumValidator; + }, this); + this.enumValidator = false; + } + + if (values === void 0 || values === false) { + return this; + } + + if (!Array.isArray(values)) { + const isObjectSyntax = utils.isPOJO(values) && values.values != null; + if (isObjectSyntax) { + message = values.message; + values = values.values; + } else if (typeof values === 'number') { + values = Array.prototype.slice.call(arguments); + message = null; + } + + if (utils.isPOJO(values)) { + // TypeScript numeric enums produce objects with reverse + // mappings, e.g. { 0: 'Zero', 1: 'One', Zero: 0, One: 1 }. + // Object.values on that will yield ['Zero','One',0,1]. + // For Number schema enums we only want the numeric values, + // otherwise casting the name strings to Number will throw. + const keys = Object.keys(values).sort(); + const objVals = Object.values(values).sort(); + // If keys and values are equal and half of values are numbers, + // this is likely a TS enum with reverse mapping, so use only the numbers. + if ( + keys.length === objVals.length && + keys.every((k, i) => k === String(objVals[i])) && + objVals.filter(v => typeof v === 'number').length === Math.floor(objVals.length / 2) + ) { + values = objVals.filter(v => typeof v === 'number'); + } else { + // Avoid sorting the values to preserve user-specified order + values = Object.values(values); + } + } + message = message || MongooseError.messages.Number.enum; + } + + message = message == null ? MongooseError.messages.Number.enum : message; + + for (const value of values) { + if (value !== undefined) { + this.enumValues.push(this.cast(value)); + } + } + + const vals = this.enumValues; + this.enumValidator = v => v == null || vals.indexOf(v) !== -1; + this.validators.push({ + validator: this.enumValidator, + message: message, + type: 'enum', + enumValues: vals + }); + + return this; +}; + +/** + * Casts to number + * + * @param {object} value value to cast + * @param {Document} doc document that triggers the casting + * @param {boolean} init + * @api private + */ + +SchemaNumber.prototype.cast = function(value, doc, init, prev, options) { + if (typeof value !== 'number' && SchemaType._isRef(this, value, doc, init)) { + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init, options); + } + } + + const val = value?._id !== undefined ? + value._id : // documents + value; + + let castNumber; + if (typeof this._castFunction === 'function') { + castNumber = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castNumber = this.constructor.cast(); + } else { + castNumber = SchemaNumber.cast(); + } + + try { + return castNumber(val); + } catch (err) { + throw new CastError('Number', val, this.path, err, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +function handleArray(val) { + const _this = this; + if (!Array.isArray(val)) { + return [this.cast(val)]; + } + return val.map(function(m) { + return _this.cast(m); + }); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $mod: handleArray +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$gte` is the function Mongoose calls to cast `$gte` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaNumber + * @instance + * @api public + */ + +Object.defineProperty(SchemaNumber.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} [value] + * @api private + */ + +SchemaNumber.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new MongooseError('Can\'t use ' + $conditional + ' with Number.'); + } + return handler.call(this, val, context); + } + + try { + val = this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + + return val; +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaNumber.prototype.toJSONSchema = function toJSONSchema(options) { + return this._addJSONSchemaEnum(this._createJSONSchemaTypeDefinition('number', 'number', options)); +}; + +/*! + * Module exports. + */ + +module.exports = SchemaNumber; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/objectId.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/objectId.js new file mode 100644 index 00000000..a62d4452 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/objectId.js @@ -0,0 +1,337 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const SchemaObjectIdOptions = require('../options/schemaObjectIdOptions'); +const SchemaType = require('../schemaType'); +const castObjectId = require('../cast/objectid'); +const getConstructorName = require('../helpers/getConstructorName'); +const oid = require('../types/objectid'); +const isBsonType = require('../helpers/isBsonType'); +const utils = require('../utils'); + +const CastError = SchemaType.CastError; +let Document; + +/** + * ObjectId SchemaType constructor. + * + * @param {string} key + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaObjectId(key, options, _schemaOptions, parentSchema) { + const isKeyHexStr = typeof key === 'string' && key.length === 24 && /^[a-f0-9]+$/i.test(key); + const suppressWarning = options?.suppressWarning; + if ((isKeyHexStr || typeof key === 'undefined') && !suppressWarning) { + utils.warn('mongoose: To create a new ObjectId please try ' + + '`Mongoose.Types.ObjectId` instead of using ' + + '`Mongoose.Schema.Types.ObjectId`. Set the `suppressWarning` option if ' + + 'you\'re trying to create a hex char path in your schema.'); + } + SchemaType.call(this, key, options, 'ObjectId', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaObjectId.schemaName = 'ObjectId'; + +SchemaObjectId.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaObjectId.prototype = Object.create(SchemaType.prototype); +SchemaObjectId.prototype.constructor = SchemaObjectId; +SchemaObjectId.prototype.OptionsConstructor = SchemaObjectIdOptions; + +/** + * Attaches a getter for all ObjectId instances + * + * #### Example: + * + * // Always convert to string when getting an ObjectId + * mongoose.ObjectId.get(v => v.toString()); + * + * const Model = mongoose.model('Test', new Schema({})); + * typeof (new Model({})._id); // 'string' + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaObjectId.get = SchemaType.get; + +/** + * Sets a default option for all ObjectId instances. + * + * #### Example: + * + * // Make all object ids have option `required` equal to true. + * mongoose.Schema.Types.ObjectId.set('required', true); + * + * const Order = mongoose.model('Order', new Schema({ userId: ObjectId })); + * new Order({ }).validateSync().errors.userId.message; // Path `userId` is required. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaObjectId.set = SchemaType.set; + +SchemaObjectId.setters = []; + +/** + * Adds an auto-generated ObjectId default if turnOn is true. + * @param {boolean} turnOn auto generated ObjectId defaults + * @api public + * @return {SchemaType} this + */ + +SchemaObjectId.prototype.auto = function(turnOn) { + if (turnOn) { + this.default(defaultId); + this.set(resetId); + } + + return this; +}; + +/*! + * ignore + */ + +SchemaObjectId._checkRequired = v => isBsonType(v, 'ObjectId'); + +/*! + * ignore + */ + +SchemaObjectId._cast = castObjectId; + +/** + * Get/set the function used to cast arbitrary values to objectids. + * + * #### Example: + * + * // Make Mongoose only try to cast length 24 strings. By default, any 12 + * // char string is a valid ObjectId. + * const original = mongoose.ObjectId.cast(); + * mongoose.ObjectId.cast(v => { + * assert.ok(typeof v !== 'string' || v.length === 24); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.ObjectId.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaObjectId.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaObjectId._defaultCaster = v => { + if (!(isBsonType(v, 'ObjectId'))) { + throw new Error(v + ' is not an instance of ObjectId'); + } + return v; +}; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * #### Example: + * + * // Allow empty strings to pass `required` check + * mongoose.Schema.Types.String.checkRequired(v => v != null); + * + * const M = mongoose.model({ str: { type: String, required: true } }); + * new M({ str: '' }).validateSync(); // `null`, validation passes! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaObjectId.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {any} value + * @param {Document} doc + * @return {boolean} + * @api public + */ + +SchemaObjectId.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaObjectId.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Casts to ObjectId + * + * @param {object} value + * @param {object} doc + * @param {boolean} init whether this is an initialization cast + * @api private + */ + +SchemaObjectId.prototype.cast = function(value, doc, init, prev, options) { + if (!(isBsonType(value, 'ObjectId')) && SchemaType._isRef(this, value, doc, init)) { + // wait! we may need to cast this to a document + if ((getConstructorName(value) || '').toLowerCase() === 'objectid') { + return new oid(value.toHexString()); + } + + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init, options); + } + } + + let castObjectId; + if (typeof this._castFunction === 'function') { + castObjectId = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castObjectId = this.constructor.cast(); + } else { + castObjectId = SchemaObjectId.cast(); + } + + try { + return castObjectId(value); + } catch (error) { + throw new CastError('ObjectId', value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$in` is the function Mongoose calls to cast `$in` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaObjectId + * @instance + * @api public + */ + +Object.defineProperty(SchemaObjectId.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/*! + * ignore + */ + +function defaultId() { + return new oid(); +} + +defaultId.$runBeforeSetters = true; + +function resetId(v) { + Document || (Document = require('../document')); + + if (this instanceof Document) { + if (v === void 0) { + const _v = new oid(); + return _v; + } + } + + return v; +} + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + * @api public + */ + +SchemaObjectId.prototype.toJSONSchema = function toJSONSchema(options) { + const jsonSchema = this._createJSONSchemaTypeDefinition('string', 'objectId', options); + // `bsonType: 'objectId'` already validates ObjectIds, so the regex is only useful + // for the portable `type: 'string'` representation (e.g. for ajv, zod, etc.) + if (!options?.useBsonType) { + jsonSchema.pattern = '^[A-Fa-f0-9]{24}$'; + } + return jsonSchema; +}; + +SchemaObjectId.prototype.autoEncryptionType = function autoEncryptionType() { + return 'objectId'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaObjectId; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/bitwise.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/bitwise.js new file mode 100644 index 00000000..07e18cd0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/bitwise.js @@ -0,0 +1,38 @@ +/*! + * Module requirements. + */ + +'use strict'; + +const CastError = require('../../error/cast'); + +/*! + * ignore + */ + +function handleBitwiseOperator(val) { + const _this = this; + if (Array.isArray(val)) { + return val.map(function(v) { + return _castNumber(_this.path, v); + }); + } else if (Buffer.isBuffer(val)) { + return val; + } + // Assume trying to cast to number + return _castNumber(_this.path, val); +} + +/*! + * ignore + */ + +function _castNumber(path, num) { + const v = Number(num); + if (isNaN(v)) { + throw new CastError('number', num, path); + } + return v; +} + +module.exports = handleBitwiseOperator; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/exists.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/exists.js new file mode 100644 index 00000000..a1dddddc --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/exists.js @@ -0,0 +1,12 @@ +'use strict'; + +const castBoolean = require('../../cast/boolean'); + +/*! + * ignore + */ + +module.exports = function(val) { + const path = this?.path ?? null; + return castBoolean(val, path); +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/geospatial.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/geospatial.js new file mode 100644 index 00000000..b3207e84 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/geospatial.js @@ -0,0 +1,107 @@ +/*! + * Module requirements. + */ + +'use strict'; + +const castArraysOfNumbers = require('./helpers').castArraysOfNumbers; +const castToNumber = require('./helpers').castToNumber; + +/*! + * ignore + */ + +exports.cast$geoIntersects = cast$geoIntersects; +exports.cast$near = cast$near; +exports.cast$within = cast$within; + +function cast$near(val) { + const SchemaArray = require('../array'); + + if (Array.isArray(val)) { + castArraysOfNumbers(val, this); + return val; + } + + _castMinMaxDistance(this, val); + + if (val?.$geometry) { + return cast$geometry(val, this); + } + + if (!Array.isArray(val)) { + throw new TypeError('$near must be either an array or an object ' + + 'with a $geometry property'); + } + + return SchemaArray.prototype.castForQuery.call(this, null, val); +} + +function cast$geometry(val, self) { + switch (val.$geometry.type) { + case 'Polygon': + case 'LineString': + case 'Point': + castArraysOfNumbers(val.$geometry.coordinates, self); + break; + default: + // ignore unknowns + break; + } + + _castMinMaxDistance(self, val); + + return val; +} + +function cast$within(val) { + _castMinMaxDistance(this, val); + + if (val.$box || val.$polygon) { + const type = val.$box ? '$box' : '$polygon'; + val[type].forEach(arr => { + if (!Array.isArray(arr)) { + const msg = 'Invalid $within $box argument. ' + + 'Expected an array, received ' + arr; + throw new TypeError(msg); + } + arr.forEach((v, i) => { + arr[i] = castToNumber.call(this, v); + }); + }); + } else if (val.$center || val.$centerSphere) { + const type = val.$center ? '$center' : '$centerSphere'; + val[type].forEach((item, i) => { + if (Array.isArray(item)) { + item.forEach((v, j) => { + item[j] = castToNumber.call(this, v); + }); + } else { + val[type][i] = castToNumber.call(this, item); + } + }); + } else if (val.$geometry) { + cast$geometry(val, this); + } + + return val; +} + +function cast$geoIntersects(val) { + const geo = val.$geometry; + if (!geo) { + return; + } + + cast$geometry(val, this); + return val; +} + +function _castMinMaxDistance(self, val) { + if (val.$maxDistance) { + val.$maxDistance = castToNumber.call(self, val.$maxDistance); + } + if (val.$minDistance) { + val.$minDistance = castToNumber.call(self, val.$minDistance); + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/helpers.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/helpers.js new file mode 100644 index 00000000..4690ca3c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/helpers.js @@ -0,0 +1,32 @@ +'use strict'; + +/*! + * Module requirements. + */ + +const SchemaNumber = require('../number'); + +/*! + * ignore + */ + +exports.castToNumber = castToNumber; +exports.castArraysOfNumbers = castArraysOfNumbers; + +/*! + * ignore + */ + +function castToNumber(val) { + return SchemaNumber.cast()(val); +} + +function castArraysOfNumbers(arr, self) { + arr.forEach(function(v, i) { + if (Array.isArray(v)) { + castArraysOfNumbers(v, self); + } else { + arr[i] = castToNumber.call(self, v); + } + }); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/text.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/text.js new file mode 100644 index 00000000..5059ca81 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/text.js @@ -0,0 +1,39 @@ +'use strict'; + +const CastError = require('../../error/cast'); +const castBoolean = require('../../cast/boolean'); +const castString = require('../../cast/string'); + +/** + * Casts val to an object suitable for `$text`. Throws an error if the object + * can't be casted. + * + * @param {any} val value to cast + * @param {string} [path] path to associate with any errors that occurred + * @return {object} casted object + * @see https://www.mongodb.com/docs/manual/reference/operator/query/text/ + * @api private + */ + +module.exports = function castTextSearch(val, path) { + if (val == null || typeof val !== 'object') { + throw new CastError('$text', val, path); + } + + if (val.$search != null) { + val.$search = castString(val.$search, path + '.$search'); + } + if (val.$language != null) { + val.$language = castString(val.$language, path + '.$language'); + } + if (val.$caseSensitive != null) { + val.$caseSensitive = castBoolean(val.$caseSensitive, + path + '.$caseSensitive'); + } + if (val.$diacriticSensitive != null) { + val.$diacriticSensitive = castBoolean(val.$diacriticSensitive, + path + '.$diacriticSensitive'); + } + + return val; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/type.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/type.js new file mode 100644 index 00000000..952c7900 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/operators/type.js @@ -0,0 +1,20 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function(val) { + if (Array.isArray(val)) { + if (!val.every(v => typeof v === 'number' || typeof v === 'string')) { + throw new Error('$type array values must be strings or numbers'); + } + return val; + } + + if (typeof val !== 'number' && typeof val !== 'string') { + throw new Error('$type parameter must be number, string, or array of numbers and strings'); + } + + return val; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/string.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/string.js new file mode 100644 index 00000000..c7ccfc53 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/string.js @@ -0,0 +1,748 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const SchemaType = require('../schemaType'); +const MongooseError = require('../error/index'); +const SchemaStringOptions = require('../options/schemaStringOptions'); +const castString = require('../cast/string'); +const utils = require('../utils'); +const isBsonType = require('../helpers/isBsonType'); + +const CastError = SchemaType.CastError; + +/** + * String SchemaType constructor. + * + * @param {string} key + * @param {object} options + * @param {object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaString(key, options, _schemaOptions, parentSchema) { + this.enumValues = []; + this.regExp = null; + SchemaType.call(this, key, options, 'String', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaString.schemaName = 'String'; + +SchemaString.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaString.prototype = Object.create(SchemaType.prototype); +SchemaString.prototype.constructor = SchemaString; +Object.defineProperty(SchemaString.prototype, 'OptionsConstructor', { + configurable: false, + enumerable: false, + writable: false, + value: SchemaStringOptions +}); + +/*! + * ignore + */ + +SchemaString._cast = castString; + +/** + * Get/set the function used to cast arbitrary values to strings. + * + * #### Example: + * + * // Throw an error if you pass in an object. Normally, Mongoose allows + * // objects with custom `toString()` functions. + * const original = mongoose.Schema.Types.String.cast(); + * mongoose.Schema.Types.String.cast(v => { + * assert.ok(v == null || typeof v !== 'object'); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Schema.Types.String.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function cast + * @static + * @api public + */ + +SchemaString.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaString._defaultCaster = v => { + if (v != null && typeof v !== 'string') { + throw new Error(); + } + return v; +}; + +/** + * Attaches a getter for all String instances. + * + * #### Example: + * + * // Make all numbers round down + * mongoose.Schema.Types.String.get(v => v.toLowerCase()); + * + * const Model = mongoose.model('Test', new Schema({ test: String })); + * new Model({ test: 'FOO' }).test; // 'foo' + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaString.get = SchemaType.get; + +/** + * Sets a default option for all String instances. + * + * #### Example: + * + * // Make all strings have option `trim` equal to true. + * mongoose.Schema.Types.String.set('trim', true); + * + * const User = mongoose.model('User', new Schema({ name: String })); + * new User({ name: ' John Doe ' }).name; // 'John Doe' + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaString.set = SchemaType.set; + +SchemaString.setters = []; + +/*! + * ignore + */ + +SchemaString._checkRequired = v => (v instanceof String || typeof v === 'string') && v.length; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * #### Example: + * + * // Allow empty strings to pass `required` check + * mongoose.Schema.Types.String.checkRequired(v => v != null); + * + * const M = mongoose.model({ str: { type: String, required: true } }); + * new M({ str: '' }).validateSync(); // `null`, validation passes! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaString.checkRequired = SchemaType.checkRequired; + +/** + * Adds an enum validator + * + * #### Example: + * + * const states = ['opening', 'open', 'closing', 'closed'] + * const s = new Schema({ state: { type: String, enum: states }}) + * const M = db.model('M', s) + * const m = new M({ state: 'invalid' }) + * await m.save() + * .catch((err) => console.error(err)); // ValidationError: `invalid` is not a valid enum value for path `state`. + * m.state = 'open'; + * await m.save(); + * // success + * + * // or with custom error messages + * const enum = { + * values: ['opening', 'open', 'closing', 'closed'], + * message: 'enum validator failed for path `{PATH}` with value `{VALUE}`' + * } + * const s = new Schema({ state: { type: String, enum: enum }) + * const M = db.model('M', s) + * const m = new M({ state: 'invalid' }) + * await m.save() + * .catch((err) => console.error(err)); // ValidationError: enum validator failed for path `state` with value `invalid` + * m.state = 'open'; + * await m.save(); + * // success + * + * @param {...string|object} [args] enumeration values + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @see Enums in JavaScript https://masteringjs.io/tutorials/fundamentals/enum + * @api public + */ + +SchemaString.prototype.enum = function() { + if (this.enumValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.enumValidator; + }, this); + this.enumValidator = false; + } + + if (arguments[0] === void 0 || arguments[0] === false) { + return this; + } + + let values; + let errorMessage; + + if (utils.isObject(arguments[0])) { + if (Array.isArray(arguments[0].values)) { + values = arguments[0].values; + errorMessage = arguments[0].message; + } else { + values = utils.object.vals(arguments[0]); + errorMessage = MongooseError.messages.String.enum; + } + } else { + values = arguments; + errorMessage = MongooseError.messages.String.enum; + } + + for (const value of values) { + if (value !== undefined) { + this.enumValues.push(this.cast(value)); + } + } + + const vals = this.enumValues; + this.enumValidator = function(v) { + return null == v || ~vals.indexOf(v); + }; + this.validators.push({ + validator: this.enumValidator, + message: errorMessage, + type: 'enum', + enumValues: vals + }); + + return this; +}; + +/** + * Adds a lowercase [setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()). + * + * #### Example: + * + * const s = new Schema({ email: { type: String, lowercase: true }}) + * const M = db.model('M', s); + * const m = new M({ email: 'SomeEmail@example.COM' }); + * console.log(m.email) // someemail@example.com + * M.find({ email: 'SomeEmail@example.com' }); // Queries by 'someemail@example.com' + * + * Note that `lowercase` does **not** affect regular expression queries: + * + * #### Example: + * + * // Still queries for documents whose `email` matches the regular + * // expression /SomeEmail/. Mongoose does **not** convert the RegExp + * // to lowercase. + * M.find({ email: /SomeEmail/ }); + * + * @api public + * @return {SchemaType} this + */ + +SchemaString.prototype.lowercase = function(shouldApply) { + if (arguments.length > 0 && !shouldApply) { + return this; + } + return this.set(v => { + if (typeof v !== 'string') { + v = this.cast(v); + } + if (v) { + return v.toLowerCase(); + } + return v; + }); +}; + +/** + * Adds an uppercase [setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()). + * + * #### Example: + * + * const s = new Schema({ caps: { type: String, uppercase: true }}) + * const M = db.model('M', s); + * const m = new M({ caps: 'an example' }); + * console.log(m.caps) // AN EXAMPLE + * M.find({ caps: 'an example' }) // Matches documents where caps = 'AN EXAMPLE' + * + * Note that `uppercase` does **not** affect regular expression queries: + * + * #### Example: + * + * // Mongoose does **not** convert the RegExp to uppercase. + * M.find({ email: /an example/ }); + * + * @api public + * @return {SchemaType} this + */ + +SchemaString.prototype.uppercase = function(shouldApply) { + if (arguments.length > 0 && !shouldApply) { + return this; + } + return this.set(v => { + if (typeof v !== 'string') { + v = this.cast(v); + } + if (v) { + return v.toUpperCase(); + } + return v; + }); +}; + +/** + * Adds a trim [setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()). + * + * The string value will be [trimmed](https://masteringjs.io/tutorials/fundamentals/trim-string) when set. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, trim: true }}); + * const M = db.model('M', s); + * const string = ' some name '; + * console.log(string.length); // 11 + * const m = new M({ name: string }); + * console.log(m.name.length); // 9 + * + * // Equivalent to `findOne({ name: string.trim() })` + * M.findOne({ name: string }); + * + * Note that `trim` does **not** affect regular expression queries: + * + * #### Example: + * + * // Mongoose does **not** trim whitespace from the RegExp. + * M.find({ name: / some name / }); + * + * @api public + * @return {SchemaType} this + */ + +SchemaString.prototype.trim = function(shouldTrim) { + if (arguments.length > 0 && !shouldTrim) { + return this; + } + return this.set(v => { + if (typeof v !== 'string') { + v = this.cast(v); + } + if (v) { + return v.trim(); + } + return v; + }); +}; + +/** + * Sets a minimum length validator. + * + * #### Example: + * + * const schema = new Schema({ postalCode: { type: String, minLength: 5 }) + * const Address = db.model('Address', schema) + * const address = new Address({ postalCode: '9512' }) + * address.save(function (err) { + * console.error(err) // validator error + * address.postalCode = '95125'; + * address.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MINLENGTH} token which will be replaced with the minimum allowed length + * const minLength = [5, 'The value of path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).']; + * const schema = new Schema({ postalCode: { type: String, minLength: minLength }) + * const Address = mongoose.model('Address', schema); + * const address = new Address({ postalCode: '9512' }); + * address.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `postalCode` (`9512`) is shorter than the minimum length (5). + * }) + * + * @param {number} value minimum string length + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaString.prototype.minlength = function(value, message) { + if (this.minlengthValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.minlengthValidator; + }, this); + } + + if (value != null) { + let msg = message || MongooseError.messages.String.minlength; + msg = msg.replace(/{MINLENGTH}/, value); + this.validators.push({ + validator: this.minlengthValidator = function(v) { + return v === null || v.length >= value; + }, + message: msg, + type: 'minlength', + minlength: value + }); + } + + return this; +}; + +SchemaString.prototype.minLength = SchemaString.prototype.minlength; + +/** + * Sets a maximum length validator. + * + * #### Example: + * + * const schema = new Schema({ postalCode: { type: String, maxlength: 9 }) + * const Address = db.model('Address', schema) + * const address = new Address({ postalCode: '9512512345' }) + * address.save(function (err) { + * console.error(err) // validator error + * address.postalCode = '95125'; + * address.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MAXLENGTH} token which will be replaced with the maximum allowed length + * const maxlength = [9, 'The value of path `{PATH}` (`{VALUE}`) exceeds the maximum allowed length ({MAXLENGTH}).']; + * const schema = new Schema({ postalCode: { type: String, maxlength: maxlength }) + * const Address = mongoose.model('Address', schema); + * const address = new Address({ postalCode: '9512512345' }); + * address.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `postalCode` (`9512512345`) exceeds the maximum allowed length (9). + * }) + * + * @param {number} value maximum string length + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaString.prototype.maxlength = function(value, message) { + if (this.maxlengthValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.maxlengthValidator; + }, this); + } + + if (value != null) { + let msg = message || MongooseError.messages.String.maxlength; + if (typeof msg !== 'function') { + msg = msg.replace(/{MAXLENGTH}/, value); + } + this.validators.push({ + validator: this.maxlengthValidator = function(v) { + return v === null || v.length <= value; + }, + message: formatMaxLengthValidatorMessage(msg), + type: 'maxlength', + maxlength: value + }); + } + + return this; +}; + +SchemaString.prototype.maxLength = SchemaString.prototype.maxlength; + +/** + * Sets a regexp validator. + * + * Any value that does not pass `regExp`.test(val) will fail validation. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, match: /^a/ }}) + * const M = db.model('M', s) + * const m = new M({ name: 'I am invalid' }) + * m.validate(function (err) { + * console.error(String(err)) // "ValidationError: Path `name` is invalid (I am invalid)." + * m.name = 'apples' + * m.validate(function (err) { + * assert.ok(err) // success + * }) + * }) + * + * // using a custom error message + * const match = [ /\.html$/, "That file doesn't end in .html ({VALUE})" ]; + * const s = new Schema({ file: { type: String, match: match }}) + * const M = db.model('M', s); + * const m = new M({ file: 'invalid' }); + * m.validate(function (err) { + * console.log(String(err)) // "ValidationError: That file doesn't end in .html (invalid)" + * }) + * + * Empty strings, `undefined`, and `null` values always pass the match validator. If you require these values, enable the `required` validator also. + * + * const s = new Schema({ name: { type: String, match: /^a/, required: true }}) + * + * @param {RegExp} regExp regular expression to test against + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @api public + */ + +SchemaString.prototype.match = function match(regExp, message) { + // yes, we allow multiple match validators + + const msg = message || MongooseError.messages.String.match; + + const matchValidator = function(v) { + if (!regExp) { + return false; + } + + // In case RegExp happens to have `/g` flag set, we need to reset the + // `lastIndex`, otherwise `match` will intermittently fail. + regExp.lastIndex = 0; + + const ret = ((v != null && v !== '') + ? regExp.test(v) + : true); + return ret; + }; + + this.validators.push({ + validator: matchValidator, + message: msg, + type: 'regexp', + regexp: regExp + }); + return this; +}; + +/** + * Check if the given value satisfies the `required` validator. The value is + * considered valid if it is a string (that is, not `null` or `undefined`) and + * has positive length. The `required` validator **will** fail for empty + * strings. + * + * @param {any} value + * @param {Document} doc + * @return {boolean} + * @api public + */ + +SchemaString.prototype.checkRequired = function checkRequired(value, doc) { + if (typeof value === 'object' && SchemaType._isRef(this, value, doc, true)) { + return value != null; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaString.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Casts to String + * + * @api private + */ + +SchemaString.prototype.cast = function(value, doc, init, prev, options) { + if (typeof value !== 'string' && SchemaType._isRef(this, value, doc, init)) { + return this._castRef(value, doc, init, options); + } + + let castString; + if (typeof this._castFunction === 'function') { + castString = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castString = this.constructor.cast(); + } else { + castString = SchemaString.cast(); + } + + try { + return castString(value); + } catch { + throw new CastError('string', value, this.path, null, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val, context) { + return this.castForQuery(null, val, context); +} + +/*! + * ignore + */ + +function handleArray(val, context) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(null, val, context)]; + } + return val.map(function(m) { + return _this.castForQuery(null, m, context); + }); +} + +/*! + * ignore + */ + +function handleSingleNoSetters(val) { + if (val == null) { + return this._castNullish(val); + } + + return this.cast(val, this); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $all: handleArray, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $options: handleSingleNoSetters, + $regex: function handle$regex(val) { + if (Object.prototype.toString.call(val) === '[object RegExp]') { + return val; + } + + return handleSingleNoSetters.call(this, val); + }, + $not: handleSingle +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaString + * @instance + * @api public + */ + +Object.defineProperty(SchemaString.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} [val] + * @api private + */ + +SchemaString.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with String.'); + } + return handler.call(this, val, context); + } + + if (Object.prototype.toString.call(val) === '[object RegExp]' || isBsonType(val, 'BSONRegExp')) { + return val; + } + + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaString.prototype.toJSONSchema = function toJSONSchema(options) { + return this._addJSONSchemaEnum(this._createJSONSchemaTypeDefinition('string', 'string', options)); +}; + +SchemaString.prototype.autoEncryptionType = function autoEncryptionType() { + return 'string'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaString; + +function formatMaxLengthValidatorMessage(msg) { + return function(props, doc) { + if (typeof msg === 'function') { + return MongooseError.ValidatorError.prototype.formatMessage(msg, props, doc); + } + + if (typeof msg === 'string' && typeof props.value === 'string' && props.value.length > 30) { + props = Object.assign({}, props, { + value: props.value.slice(0, 30) + '...' + }); + } + return MongooseError.ValidatorError.prototype.formatMessage(msg, props, doc); + }; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/subdocument.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/subdocument.js new file mode 100644 index 00000000..66aa7e92 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/subdocument.js @@ -0,0 +1,434 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const EventEmitter = require('events').EventEmitter; +const ObjectExpectedError = require('../error/objectExpected'); +const SchemaSubdocumentOptions = require('../options/schemaSubdocumentOptions'); +const SchemaType = require('../schemaType'); +const applyDefaults = require('../helpers/document/applyDefaults'); +const $exists = require('./operators/exists'); +const castToNumber = require('./operators/helpers').castToNumber; +const discriminator = require('../helpers/model/discriminator'); +const geospatial = require('./operators/geospatial'); +const getConstructor = require('../helpers/discriminator/getConstructor'); +const handleIdOption = require('../helpers/schema/handleIdOption'); +const internalToObjectOptions = require('../options').internalToObjectOptions; +const isExclusive = require('../helpers/projection/isExclusive'); +const utils = require('../utils'); +const InvalidSchemaOptionError = require('../error/invalidSchemaOption'); + +let SubdocumentType; + +module.exports = SchemaSubdocument; + +/** + * Single nested subdocument SchemaType constructor. + * + * @param {Schema} schema + * @param {string} path + * @param {object} options + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaSubdocument(schema, path, options, parentSchema) { + if (schema.options.timeseries) { + throw new InvalidSchemaOptionError(path, 'timeseries'); + } + const schemaTypeIdOption = SchemaSubdocument.defaultOptions?._id; + if (schemaTypeIdOption != null) { + options = options || {}; + options._id = schemaTypeIdOption; + } + + schema = handleIdOption(schema, options); + + this.Constructor = _createConstructor(schema, null, options); + this.Constructor.path = path; + this.Constructor.prototype.$basePath = path; + this.schema = schema; + this.$isSingleNested = true; + this.base = schema.base; + SchemaType.call(this, path, options, 'Embedded', parentSchema); +} + +/*! + * ignore + */ + +SchemaSubdocument.prototype = Object.create(SchemaType.prototype); +SchemaSubdocument.prototype.constructor = SchemaSubdocument; +SchemaSubdocument.prototype.OptionsConstructor = SchemaSubdocumentOptions; + +/*! + * ignore + */ + +function _createConstructor(schema, baseClass, options) { + // lazy load + SubdocumentType || (SubdocumentType = require('../types/subdocument')); + + const _embedded = function SingleNested(value, path, parent) { + this.$__parent = parent; + SubdocumentType.apply(this, arguments); + + if (parent == null) { + return; + } + this.$session(parent.$session()); + }; + + schema._preCompile(); + + const proto = baseClass?.prototype ?? SubdocumentType.prototype; + _embedded.prototype = Object.create(proto); + _embedded.prototype.$__setSchema(schema); + _embedded.prototype.constructor = _embedded; + _embedded.prototype.$__schemaTypeOptions = options; + _embedded.$__required = options?.required; + _embedded.base = schema.base; + _embedded.schema = schema; + _embedded.$isSingleNested = true; + _embedded.events = new EventEmitter(); + _embedded.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); + }; + + // apply methods + for (const i in schema.methods) { + _embedded.prototype[i] = schema.methods[i]; + } + + // apply statics + for (const i in schema.statics) { + _embedded[i] = schema.statics[i]; + } + + for (const i in EventEmitter.prototype) { + _embedded[i] = EventEmitter.prototype[i]; + } + + return _embedded; +} + +/*! + * ignore + */ +const $conditionalHandlers = { ...SchemaType.prototype.$conditionalHandlers }; + +/** + * Special case for when users use a common location schema to represent + * locations for use with $geoWithin. + * https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * + * @param {object} val + * @api private + */ + +$conditionalHandlers.$geoWithin = function handle$geoWithin(val, context) { + return { $geometry: this.castForQuery(null, val.$geometry, context) }; +}; + +/*! + * ignore + */ + +$conditionalHandlers.$near = +$conditionalHandlers.$nearSphere = geospatial.cast$near; + +$conditionalHandlers.$within = +$conditionalHandlers.$geoWithin = geospatial.cast$within; + +$conditionalHandlers.$geoIntersects = + geospatial.cast$geoIntersects; + +$conditionalHandlers.$minDistance = castToNumber; +$conditionalHandlers.$maxDistance = castToNumber; + +$conditionalHandlers.$exists = $exists; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaSubdocument + * @instance + * @api public + */ + +Object.defineProperty(SchemaSubdocument.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Casts contents + * + * @param {object} value + * @api private + */ + +SchemaSubdocument.prototype.cast = function(val, doc, init, priorVal, options) { + if (val?.$isSingleNested && val.parent === doc) { + return val; + } + + if (!init && val != null && (typeof val !== 'object' || Array.isArray(val))) { + throw new ObjectExpectedError(this.path, val); + } + + const discriminatorKeyPath = this.schema.path(this.schema.options.discriminatorKey); + const defaultDiscriminatorValue = discriminatorKeyPath == null ? null : discriminatorKeyPath.getDefault(doc); + const Constructor = getConstructor(this.Constructor, val, defaultDiscriminatorValue); + + let subdoc; + + // Only pull relevant selected paths and pull out the base path + const parentSelected = doc?.$__?.selected; + const path = this.path; + const selected = parentSelected == null ? null : Object.keys(parentSelected).reduce((obj, key) => { + if (key.startsWith(path + '.')) { + obj = obj || {}; + obj[key.substring(path.length + 1)] = parentSelected[key]; + } + return obj; + }, null); + if (init) { + subdoc = new Constructor(void 0, selected, doc, { defaults: false }); + delete subdoc.$__.defaults; + // Don't pass `path` to $init - it's only for the subdocument itself, not its fields. + // For change tracking, subdocuments use relative paths internally. + // Here, `options.path` contains the absolute path and is only used by the subdocument constructor, not by $init. + if (options.path != null) { + const { path, ...initOptions } = options; + options = initOptions; + } + subdoc.$init(val, options); + const exclude = isExclusive(selected); + applyDefaults(subdoc, selected, exclude); + } else { + options = Object.assign({}, options, { priorDoc: priorVal }); + if (utils.hasOwnKeys(val) === false) { + return new Constructor({}, selected, doc, options); + } + + return new Constructor(val, selected, doc, options); + } + + return subdoc; +}; + +/** + * Casts contents for query + * + * @param {string} [$conditional] optional query operator (like `$eq` or `$in`) + * @param {any} value + * @api private + */ + +SchemaSubdocument.prototype.castForQuery = function($conditional, val, context, options) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new Error('Can\'t use ' + $conditional); + } + return handler.call(this, val); + } + if (val == null) { + return val; + } + + const Constructor = getConstructor(this.Constructor, val); + if (val instanceof Constructor) { + return val; + } + + if (this.options.runSetters) { + val = this._applySetters(val, context); + } + + const overrideStrict = options?.strict ?? void 0; + + try { + val = new Constructor(val, overrideStrict); + } catch (error) { + // Make sure we always wrap in a CastError (gh-6803) + if (!(error instanceof CastError)) { + throw new CastError('Embedded', val, this.path, error, this); + } + throw error; + } + return val; +}; + +/** + * Async validation on this single nested doc. + * + * @api public + */ + +SchemaSubdocument.prototype.doValidate = async function doValidate(value, scope, options) { + const Constructor = getConstructor(this.Constructor, value); + + if (value && !(value instanceof Constructor)) { + value = new Constructor(value, null, scope?.$__ != null ? scope : null); + } + + if (options?.skipSchemaValidators) { + if (!value) { + return; + } + return value.validate(); + } + + await SchemaType.prototype.doValidate.call(this, value, scope, options); + if (value != null) { + await value.validate(); + } +}; + +/** + * Synchronously validate this single nested doc + * + * @api private + */ + +SchemaSubdocument.prototype.doValidateSync = function(value, scope, options) { + if (!options?.skipSchemaValidators) { + const schemaTypeError = SchemaType.prototype.doValidateSync.call(this, value, scope); + if (schemaTypeError) { + return schemaTypeError; + } + } + if (!value) { + return; + } + return value.$__validateSync(); +}; + +/** + * Adds a discriminator to this single nested subdocument. + * + * #### Example: + * + * const shapeSchema = Schema({ name: String }, { discriminatorKey: 'kind' }); + * const schema = Schema({ shape: shapeSchema }); + * + * const singleNestedPath = parentSchema.path('shape'); + * singleNestedPath.discriminator('Circle', Schema({ radius: Number })); + * + * @param {string} name + * @param {Schema} schema fields to add to the schema for instances of this sub-class + * @param {object|string} [options] If string, same as `options.value`. + * @param {string} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @param {boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning. + * @return {Function} the constructor Mongoose will use for creating instances of this discriminator model + * @see discriminators https://mongoosejs.com/docs/discriminators.html + * @api public + */ + +SchemaSubdocument.prototype.discriminator = function(name, schema, options) { + options = options || {}; + const value = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === 'boolean' + ? options.clone + : true; + + if (schema.instanceOfSchema && clone) { + schema = schema.clone(); + } + + schema = discriminator(this.Constructor, name, schema, value, null, null, options.overwriteExisting); + + this.Constructor.discriminators[name] = _createConstructor(schema, this.Constructor); + + return this.Constructor.discriminators[name]; +}; + +/*! + * ignore + */ + +SchemaSubdocument.defaultOptions = {}; + +/** + * Sets a default option for all Subdocument instances. + * + * #### Example: + * + * // Make all subdocuments required by default. + * mongoose.Schema.Types.Subdocument.set('required', true); + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {void} + * @function set + * @static + * @api public + */ + +SchemaSubdocument.set = SchemaType.set; + +SchemaSubdocument.setters = []; + +/** + * Attaches a getter for all Subdocument instances + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaSubdocument.get = SchemaType.get; + +/*! + * ignore + */ + +SchemaSubdocument.prototype.toJSON = function toJSON() { + return { path: this.path, options: this.options }; +}; + +/*! + * ignore + */ + +SchemaSubdocument.prototype.clone = function() { + const schematype = new this.constructor( + this.schema, + this.path, + { ...this.options, _skipApplyDiscriminators: true }, + this.parentSchema + ); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) { + schematype.requiredValidator = this.requiredValidator; + } + schematype.Constructor.discriminators = Object.assign({}, this.Constructor.discriminators); + schematype._appliedDiscriminators = this._appliedDiscriminators; + return schematype; +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaSubdocument.prototype.toJSONSchema = function toJSONSchema(options) { + return { + ...this.schema.toJSONSchema(options), + ...this._createJSONSchemaTypeDefinition('object', 'object', options) + }; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/symbols.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/symbols.js new file mode 100644 index 00000000..7ae0e9e3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/symbols.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.schemaMixedSymbol = Symbol.for('mongoose:schema_mixed'); + +exports.builtInMiddleware = Symbol.for('mongoose:built-in-middleware'); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/union.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/union.js new file mode 100644 index 00000000..8ef0b460 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/union.js @@ -0,0 +1,163 @@ +'use strict'; + +/*! + * ignore + */ + +const SchemaUnionOptions = require('../options/schemaUnionOptions'); +const SchemaType = require('../schemaType'); + +const firstValueSymbol = Symbol('firstValue'); + +/*! + * ignore + */ + +class Union extends SchemaType { + /** + * Create a Union schema type. + * + * @param {string} key the path in the schema for this schema type + * @param {object} options SchemaType-specific options (must have 'of' as array) + * @param {object} schemaOptions additional options from the schema this schematype belongs to + * @param {Schema} parentSchema the schema this schematype belongs to + */ + constructor(key, options, schemaOptions, parentSchema) { + super(key, options, 'Union', parentSchema); + if (!Array.isArray(options?.of) || options.of.length === 0) { + throw new Error('Union schema type requires an array of types'); + } + this.schemaTypes = options.of.map(obj => parentSchema.interpretAsType(key, obj, schemaOptions)); + this.$isSchemaUnion = true; + } + + cast(val, doc, init, prev, options) { + let firstValue = firstValueSymbol; + let lastError; + // Loop through each schema type in the union. If one of the schematypes returns a value that is `=== val`, then + // use `val`. Otherwise, if one of the schematypes casted successfully, use the first successfully casted value. + // Finally, if none of the schematypes casted successfully, throw the error from the last schema type in the union. + // The `=== val` check is a workaround to ensure that the original value is returned if it matches one of the schema types, + // avoiding cases like where numbers are casted to strings or dates even if the schema type is a number. + for (let i = 0; i < this.schemaTypes.length; ++i) { + try { + const casted = this.schemaTypes[i].cast(val, doc, init, prev, options); + if (casted === val) { + return casted; + } + if (firstValue === firstValueSymbol) { + firstValue = casted; + } + } catch (error) { + lastError = error; + } + } + if (firstValue !== firstValueSymbol) { + return firstValue; + } + throw lastError; + } + + // Setters also need to be aware of casting - we need to apply the setters of the entry in the union we choose. + applySetters(val, doc, init, prev, options) { + let firstValue = firstValueSymbol; + let lastError; + // Loop through each schema type in the union. If one of the schematypes returns a value that is `=== val`, then + // use `val`. Otherwise, if one of the schematypes casted successfully, use the first successfully casted value. + // Finally, if none of the schematypes casted successfully, throw the error from the last schema type in the union. + // The `=== val` check is a workaround to ensure that the original value is returned if it matches one of the schema types, + // avoiding cases like where numbers are casted to strings or dates even if the schema type is a number. + for (let i = 0; i < this.schemaTypes.length; ++i) { + try { + let castedVal = this.schemaTypes[i]._applySetters(val, doc, init, prev, options); + if (castedVal == null) { + castedVal = this.schemaTypes[i]._castNullish(castedVal); + } else { + castedVal = this.schemaTypes[i].cast(castedVal, doc, init, prev, options); + } + if (castedVal === val) { + return castedVal; + } + if (firstValue === firstValueSymbol) { + firstValue = castedVal; + } + } catch (error) { + lastError = error; + } + } + if (firstValue !== firstValueSymbol) { + return firstValue; + } + throw lastError; + } + + async doValidate(value, scope, options) { + if (options && options.skipSchemaValidators) { + if (value != null && typeof value.validate === 'function') { + return value.validate(); + } + return; + } + + await super.doValidate(value, scope, options); + if (value != null && typeof value.validate === 'function') { + await value.validate(); + } + } + + doValidateSync(value, scope, options) { + if (!options || !options.skipSchemaValidators) { + const schemaTypeError = super.doValidateSync(value, scope, options); + if (schemaTypeError) { + return schemaTypeError; + } + } + if (value != null && typeof value.$__validateSync === 'function') { + return value.$__validateSync(); + } + } + + clone() { + const schematype = super.clone(); + + schematype.schemaTypes = this.schemaTypes.map(schemaType => schemaType.clone()); + return schematype; + } + + /** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== 'function'; + const childOptions = { ...options, _overrideRequired: true }; + const jsonSchemas = this.schemaTypes.map(schemaType => schemaType.toJSONSchema(childOptions)); + if (isRequired) { + return { anyOf: jsonSchemas }; + } + + return { + anyOf: [ + options?.useBsonType ? { bsonType: 'null' } : { type: 'null' }, + ...jsonSchemas + ] + }; + } +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +Union.schemaName = 'Union'; + +Union.defaultOptions = {}; + +Union.prototype.OptionsConstructor = SchemaUnionOptions; + +module.exports = Union; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/uuid.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/uuid.js new file mode 100644 index 00000000..efb7a6e2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schema/uuid.js @@ -0,0 +1,303 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const SchemaType = require('../schemaType'); +const CastError = SchemaType.CastError; +const castUUID = require('../cast/uuid'); +const utils = require('../utils'); +const handleBitwiseOperator = require('./operators/bitwise'); + +const UUID_FORMAT = castUUID.UUID_FORMAT; + +/** + * Convert binary to a uuid string + * @param {Buffer|Binary|string} uuidBin The value to process + * @returns {string} The completed uuid-string + * @api private + */ +function binaryToString(uuidBin) { + // i(hasezoey) dont quite know why, but "uuidBin" may sometimes also be the already processed string + let hex; + if (typeof uuidBin !== 'string' && uuidBin != null) { + hex = uuidBin.toString('hex'); + const uuidStr = hex.substring(0, 8) + '-' + hex.substring(8, 8 + 4) + '-' + hex.substring(12, 12 + 4) + '-' + hex.substring(16, 16 + 4) + '-' + hex.substring(20, 20 + 12); + return uuidStr; + } + return uuidBin; +} + +/** + * UUIDv1 SchemaType constructor. + * + * @param {string} key + * @param {object} options + * @param {object} _schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + +function SchemaUUID(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, 'UUID', parentSchema); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaUUID.schemaName = 'UUID'; + +SchemaUUID.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaUUID.prototype = Object.create(SchemaType.prototype); +SchemaUUID.prototype.constructor = SchemaUUID; + +/*! + * ignore + */ + +SchemaUUID._cast = castUUID; + +/** + * Attaches a getter for all UUID instances. + * + * #### Example: + * + * // Note that `v` is a string by default + * mongoose.Schema.UUID.get(v => v.toUpperCase()); + * + * const Model = mongoose.model('Test', new Schema({ test: 'UUID' })); + * new Model({ test: uuid.v4() }).test; // UUID with all uppercase + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaUUID.get = SchemaType.get; + +/** + * Sets a default option for all UUID instances. + * + * #### Example: + * + * // Make all UUIDs have `required` of true by default. + * mongoose.Schema.UUID.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: mongoose.UUID })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {string} option The option you'd like to set the value for + * @param {any} value value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaUUID.set = SchemaType.set; + +SchemaUUID.setters = []; + +/** + * Get/set the function used to cast arbitrary values to UUIDs. + * + * #### Example: + * + * // Make Mongoose refuse to cast UUIDs with 0 length + * const original = mongoose.Schema.Types.UUID.cast(); + * mongoose.UUID.cast(v => { + * assert.ok(typeof v === "string" && v.length > 0); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.UUID.cast(false); + * + * @param {Function} [caster] + * @return {Function} + * @function get + * @static + * @api public + */ + +SchemaUUID.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaUUID._checkRequired = v => v != null; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaUUID.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {any} value + * @return {boolean} + * @api public + */ + +SchemaUUID.prototype.checkRequired = function checkRequired(value) { + if (Buffer.isBuffer(value)) { + value = binaryToString(value); + } + return value != null && UUID_FORMAT.test(value); +}; + +/** + * Casts to UUID + * + * @param {object} value + * @param {object} doc + * @param {boolean} init whether this is an initialization cast + * @api private + */ + +SchemaUUID.prototype.cast = function(value, doc, init, prev, options) { + if (utils.isNonBuiltinObject(value) && + SchemaType._isRef(this, value, doc, init)) { + return this._castRef(value, doc, init, options); + } + + let castFn; + if (typeof this._castFunction === 'function') { + castFn = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castFn = this.constructor.cast(); + } else { + castFn = SchemaUUID.cast(); + } + + try { + return castFn(value); + } catch (error) { + throw new CastError(SchemaUUID.schemaName, value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +/*! + * ignore + */ + +function handleArray(val) { + return val.map((m) => { + return this.cast(m); + }); +} + +const $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $all: handleArray, + $in: handleArray, + $ne: handleSingle, + $nin: handleArray +}; + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaUUID + * @instance + * @api public + */ + +Object.defineProperty(SchemaUUID.prototype, '$conditionalHandlers', { + enumerable: false, + value: $conditionalHandlers +}); + +/** + * Casts contents for queries. + * + * @param {string} $conditional + * @param {any} val + * @api private + */ + +SchemaUUID.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) + throw new Error('Can\'t use ' + $conditional + ' with UUID.'); + return handler.call(this, val, context); + } + + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } +}; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaUUID.prototype.toJSONSchema = function toJSONSchema(options) { + return this._createJSONSchemaTypeDefinition('string', 'binData', options); +}; + +SchemaUUID.prototype.autoEncryptionType = function autoEncryptionType() { + return 'binData'; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaUUID; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schemaType.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schemaType.js new file mode 100644 index 00000000..1b4fecc6 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/schemaType.js @@ -0,0 +1,1955 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./error/index'); +const SchemaTypeOptions = require('./options/schemaTypeOptions'); +const $exists = require('./schema/operators/exists'); +const $type = require('./schema/operators/type'); +const clone = require('./helpers/clone'); +const handleImmutable = require('./helpers/schematype/handleImmutable'); +const isAsyncFunction = require('./helpers/isAsyncFunction'); +const isSimpleValidator = require('./helpers/isSimpleValidator'); +const schemaTypeSymbol = require('./helpers/symbols').schemaTypeSymbol; +const utils = require('./utils'); +const validatorErrorSymbol = require('./helpers/symbols').validatorErrorSymbol; +const documentIsModified = require('./helpers/symbols').documentIsModified; + +const populateModelSymbol = require('./helpers/symbols').populateModelSymbol; + +const CastError = MongooseError.CastError; +const ValidatorError = MongooseError.ValidatorError; + +const setOptionsForDefaults = { _skipMarkModified: true }; + +/** + * SchemaType constructor. Do **not** instantiate `SchemaType` directly. + * Mongoose converts your schema paths into SchemaTypes automatically. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * schema.path('name') instanceof SchemaType; // true + * + * @param {string} path + * @param {SchemaTypeOptions} [options] See [SchemaTypeOptions docs](https://mongoosejs.com/docs/api/schematypeoptions.html) + * @param {string} [instance] + * @param {Schema} [parentSchema] + * @api public + */ + +function SchemaType(path, options, instance, parentSchema) { + this[schemaTypeSymbol] = true; + this.path = path; + this.instance = instance; + this.schemaName = this.constructor.schemaName; + this.validators = []; + this.getters = Object.hasOwn(this.constructor, 'getters') ? + this.constructor.getters.slice() : + []; + this.setters = Object.hasOwn(this.constructor, 'setters') ? + this.constructor.setters.slice() : + []; + + this.splitPath(); + + options = options || {}; + const defaultOptions = this.constructor.defaultOptions || {}; + const defaultOptionsKeys = Object.keys(defaultOptions); + + for (const option of defaultOptionsKeys) { + if (option === 'validate') { + this.validate(defaultOptions.validate); + } else if (Object.hasOwn(defaultOptions, option) && !Object.hasOwn(options, option)) { + options[option] = defaultOptions[option]; + } + } + + if (options.select == null) { + delete options.select; + } + + const Options = this.OptionsConstructor || SchemaTypeOptions; + this.options = new Options(options); + this.parentSchema = parentSchema; + this._index = null; + + if (utils.hasUserDefinedProperty(this.options, 'immutable')) { + this.$immutable = this.options.immutable; + + handleImmutable(this); + } + + const keys = Object.keys(this.options); + for (const prop of keys) { + if (prop === 'cast') { + if (Array.isArray(this.options[prop])) { + this.castFunction.apply(this, this.options[prop]); + } else { + this.castFunction(this.options[prop]); + } + continue; + } + if (utils.hasUserDefinedProperty(this.options, prop) && typeof this[prop] === 'function') { + // { unique: true, index: true } + if (prop === 'index' && this._index) { + if (options.index === false) { + const index = this._index; + if (typeof index === 'object' && index != null) { + if (index.unique) { + throw new MongooseError('Path "' + this.path + '" may not have `index` ' + + 'set to false and `unique` set to true'); + } + if (index.sparse) { + throw new MongooseError('Path "' + this.path + '" may not have `index` ' + + 'set to false and `sparse` set to true'); + } + } + + this._index = false; + } + continue; + } + + const val = options[prop]; + // Special case so we don't screw up array defaults, see gh-5780 + if (prop === 'default') { + this.default(val); + continue; + } + + const opts = Array.isArray(val) ? val : [val]; + + this[prop].apply(this, opts); + } + } + + Object.defineProperty(this, '$$context', { + enumerable: false, + configurable: false, + writable: true, + value: null + }); +} + +/** + * The class that Mongoose uses internally to instantiate this SchemaType's `options` property. + * @memberOf SchemaType + * @instance + * @api private + */ + +SchemaType.prototype.OptionsConstructor = SchemaTypeOptions; + +/** + * The path to this SchemaType in a Schema. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * schema.path('name').path; // 'name' + * + * @property path + * @api public + * @memberOf SchemaType + */ + +SchemaType.prototype.path; + +/** + * Returns a plain JavaScript object representing this SchemaType. + * + * Typically used by `JSON.stringify()` or when calling `.toJSON()` on a SchemaType instance. + * Omits certain internal properties such as `parentSchema` that can cause circular references. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * const schematype = schema.path('name'); + * console.log(schematype.toJSON()); + * + * @memberOf SchemaType + * @instance + * @api public + */ + +SchemaType.prototype.toJSON = function toJSON() { + const { parentSchema, ...res } = this; + return res; +}; + +/** + * Helper for creating `{ type: 'object' }` vs `{ bsonType: 'object' }` vs nullable variants. + * + * @param {string} type + * @param {string} bsonType + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] + * @param {boolean} [options._defaultRequired=false] + * @param {boolean} [options._overrideRequired] + * @returns {object} + * @api private + */ + +SchemaType.prototype._createJSONSchemaTypeDefinition = function _createJSONSchemaTypeDefinition(type, bsonType, options) { + const useBsonType = options?.useBsonType; + const isRequired = options?._overrideRequired ?? + (this.options.required == null ? + (options?._defaultRequired === true || this.path === '_id') : + this.options.required && typeof this.options.required !== 'function'); + const allowNull = this.options.allowNull !== false; + + if (useBsonType) { + if (isRequired || !allowNull) { + return { bsonType }; + } + return { bsonType: [bsonType, 'null'] }; + } + + if (isRequired || !allowNull) { + return { type }; + } + return { type: [type, 'null'] }; +}; + +/** + * Helper for adding this SchemaType's enum values to a JSON schema type definition. + * Reads `enumValues` rather than `options.enum` because `enum` also accepts an object. + * + * @param {object} definition the type definition from `_createJSONSchemaTypeDefinition()` + * @returns {object} the same definition + * @api private + */ + +SchemaType.prototype._addJSONSchemaEnum = function _addJSONSchemaEnum(definition) { + if (!Array.isArray(this.enumValues) || this.enumValues.length === 0) { + return definition; + } + + // The enum validator allows nullish values, so allow `null` wherever the type does. + // Skip that when the user already listed `null`: MongoDB refuses a `$jsonSchema` + // whose `enum` repeats a value, and so does Ajv. + const allowsNull = Array.isArray(definition.type ?? definition.bsonType); + definition.enum = allowsNull && !this.enumValues.includes(null) + ? [...this.enumValues, null] + : [...this.enumValues]; + + return definition; +}; + +/** + * The validators that Mongoose should run to validate properties at this SchemaType's path. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, required: true } }); + * schema.path('name').validators.length; // 1, the `required` validator + * + * @property validators + * @api public + * @memberOf SchemaType + */ + +SchemaType.prototype.validators; + +/** + * True if this SchemaType has a required validator. False otherwise. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, required: true } }); + * schema.path('name').isRequired; // true + * + * schema.path('name').required(false); + * schema.path('name').isRequired; // false + * + * @property isRequired + * @api public + * @memberOf SchemaType + */ + +SchemaType.prototype.isRequired; + +/** + * Split the current dotted path into segments + * + * @return {string[]|undefined} + * @api private + */ + +SchemaType.prototype.splitPath = function() { + if (this._presplitPath != null) { + return this._presplitPath; + } + if (this.path == null) { + return undefined; + } + + this._presplitPath = this.path.indexOf('.') === -1 ? [this.path] : this.path.split('.'); + return this._presplitPath; +}; + +/** + * Get/set the function used to cast arbitrary values to this type. + * + * #### Example: + * + * // Disallow `null` for numbers, and don't try to cast any values to + * // numbers, so even strings like '123' will cause a CastError. + * mongoose.Number.cast(function(v) { + * assert.ok(v === undefined || typeof v === 'number'); + * return v; + * }); + * + * @param {Function|false} caster Function that casts arbitrary values to this type, or throws an error if casting failed + * @return {Function} + * @static + * @memberOf SchemaType + * @function cast + * @api public + */ + +SchemaType.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = v => v; + } + this._cast = caster; + + return this._cast; +}; + +/** + * Get/set the function used to cast arbitrary values to this particular schematype instance. + * Overrides `SchemaType.cast()`. + * + * #### Example: + * + * // Disallow `null` for numbers, and don't try to cast any values to + * // numbers, so even strings like '123' will cause a CastError. + * const number = new mongoose.Number('mypath', {}); + * number.cast(function(v) { + * assert.ok(v === undefined || typeof v === 'number'); + * return v; + * }); + * + * @param {Function|false} caster Function that casts arbitrary values to this type, or throws an error if casting failed + * @return {Function} + * @memberOf SchemaType + * @api public + */ + +SchemaType.prototype.castFunction = function castFunction(caster, message) { + if (arguments.length === 0) { + return this._castFunction; + } + + if (caster === false) { + caster = this.constructor._defaultCaster || (v => v); + } + if (typeof caster === 'string') { + this._castErrorMessage = caster; + return this._castFunction; + } + if (caster != null) { + this._castFunction = caster; + } + if (message != null) { + this._castErrorMessage = message; + } + + return this._castFunction; +}; + +/** + * The function that Mongoose calls to cast arbitrary values to this SchemaType. + * + * @param {object} value value to cast + * @param {Document} doc document that triggers the casting + * @param {boolean} init + * @api public + */ + +SchemaType.prototype.cast = function cast() { + throw new MongooseError('Base SchemaType class does not implement a `cast()` function'); +}; + +/** + * Sets a default option for this schema type. + * + * #### Example: + * + * // Make all strings be trimmed by default + * mongoose.SchemaTypes.String.set('trim', true); + * + * @param {string} option The name of the option you'd like to set (e.g. trim, lowercase, etc...) + * @param {any} value The value of the option you'd like to set. + * @return {void} + * @static + * @memberOf SchemaType + * @function set + * @api public + */ + +SchemaType.set = function set(option, value) { + if (!Object.hasOwn(this, 'defaultOptions')) { + this.defaultOptions = Object.assign({}, this.defaultOptions); + } + this.defaultOptions[option] = value; +}; + +/** + * Attaches a getter for all instances of this schema type. + * + * #### Example: + * + * // Make all numbers round down + * mongoose.Number.get(function(v) { return Math.floor(v); }); + * + * @param {Function} getter + * @return {this} + * @static + * @memberOf SchemaType + * @function get + * @api public + */ + +SchemaType.get = function(getter) { + this.getters = Object.hasOwn(this, 'getters') ? this.getters : []; + this.getters.push(getter); +}; + +/** + * Sets a default value for this SchemaType. + * + * #### Example: + * + * const schema = new Schema({ n: { type: Number, default: 10 }) + * const M = db.model('M', schema) + * const m = new M; + * console.log(m.n) // 10 + * + * Defaults can be either `functions` which return the value to use as the default or the literal value itself. Either way, the value will be cast based on its schema type before being set during document creation. + * + * #### Example: + * + * // values are cast: + * const schema = new Schema({ num: { type: Number, default: 4.815162342 }}) + * const M = db.model('M', schema) + * const m = new M; + * console.log(m.num) // 4.815162342 + * + * // default unique objects for Mixed types: + * const schema = new Schema({ mixed: Schema.Types.Mixed }); + * schema.path('mixed').default(function () { + * return {}; + * }); + * + * // if we don't use a function to return object literals for Mixed defaults, + * // each document will receive a reference to the same object literal creating + * // a "shared" object instance: + * const schema = new Schema({ mixed: Schema.Types.Mixed }); + * schema.path('mixed').default({}); + * const M = db.model('M', schema); + * const m1 = new M; + * m1.mixed.added = 1; + * console.log(m1.mixed); // { added: 1 } + * const m2 = new M; + * console.log(m2.mixed); // { added: 1 } + * + * @param {Function|any} val The default value to set + * @return {any|undefined} Returns the set default value. + * @api public + */ + +SchemaType.prototype.default = function(val) { + if (arguments.length === 1) { + if (val === void 0) { + this.defaultValue = void 0; + return void 0; + } + + if (val?.instanceOfSchema) { + throw new MongooseError('Cannot set default value of path `' + this.path + + '` to a mongoose Schema instance.'); + } + + this.defaultValue = val; + return this.defaultValue; + } else if (arguments.length > 1) { + this.defaultValue = [...arguments]; + } + return this.defaultValue; +}; + +/** + * Declares the index options for this schematype. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, index: true }) + * const s = new Schema({ name: { type: String, index: -1 }) + * const s = new Schema({ loc: { type: [Number], index: 'hashed' }) + * const s = new Schema({ loc: { type: [Number], index: '2d', sparse: true }) + * const s = new Schema({ loc: { type: [Number], index: { type: '2dsphere', sparse: true }}) + * const s = new Schema({ date: { type: Date, index: { unique: true, expires: '1d' }}) + * s.path('my.path').index(true); + * s.path('my.date').index({ expires: 60 }); + * s.path('my.path').index({ unique: true, sparse: true }); + * + * @param {object|boolean|string|number} options + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.index = function(options) { + this._index = options; + utils.expires(this._index); + return this; +}; + +/** + * Declares an unique index. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, unique: true } }); + * s.path('name').index({ unique: true }); + * + * _NOTE: violating the constraint returns an `E11000` error from MongoDB when saving, not a Mongoose validation error._ + * + * You can optionally specify an error message to replace MongoDB's default `E11000 duplicate key error` message. + * The following will throw a "Email must be unique" error if `save()`, `updateOne()`, `updateMany()`, `replaceOne()`, + * `findOneAndUpdate()`, or `findOneAndReplace()` throws a duplicate key error: + * + * ```javascript + * new Schema({ + * email: { + * type: String, + * unique: [true, 'Email must be unique'] + * } + * }); + * ``` + * + * Note that the above syntax does **not** work for `bulkWrite()` or `insertMany()`. `bulkWrite()` and `insertMany()` + * will still throw MongoDB's default `E11000 duplicate key error` message. + * + * @param {boolean} value + * @param {string} [message] + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.unique = function unique(value, message) { + if (this._index === false) { + if (!value) { + return; + } + throw new MongooseError('Path "' + this.path + '" may not have `index` set to ' + + 'false and `unique` set to true'); + } + + if (!Object.hasOwn(this.options, 'index') && value === false) { + return this; + } + + if (this._index == null || this._index === true) { + this._index = {}; + } else if (typeof this._index === 'string') { + this._index = { type: this._index }; + } + + this._index.unique = !!value; + if (typeof message === 'string') { + this._duplicateKeyErrorMessage = message; + } + return this; +}; + +/** + * Declares a full text index. + * + * ### Example: + * + * const s = new Schema({ name : { type: String, text : true } }) + * s.path('name').index({ text : true }); + * + * @param {boolean} bool + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.text = function(bool) { + if (this._index === false) { + if (!bool) { + return this; + } + throw new MongooseError('Path "' + this.path + '" may not have `index` set to ' + + 'false and `text` set to true'); + } + + if (!Object.hasOwn(this.options, 'index') && bool === false) { + return this; + } + + if (this._index === null || this._index === undefined || + typeof this._index === 'boolean') { + this._index = {}; + } else if (typeof this._index === 'string') { + this._index = { type: this._index }; + } + + this._index.text = bool; + return this; +}; + +/** + * Declares a sparse index. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, sparse: true } }); + * s.path('name').index({ sparse: true }); + * + * @param {boolean} bool + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.sparse = function(bool) { + if (this._index === false) { + if (!bool) { + return this; + } + throw new MongooseError('Path "' + this.path + '" may not have `index` set to ' + + 'false and `sparse` set to true'); + } + + if (!Object.hasOwn(this.options, 'index') && bool === false) { + return this; + } + + if (this._index == null || typeof this._index === 'boolean') { + this._index = {}; + } else if (typeof this._index === 'string') { + this._index = { type: this._index }; + } + + this._index.sparse = bool; + return this; +}; + +/** + * Defines this path as immutable. Mongoose prevents you from changing + * immutable paths unless the parent document has [`isNew: true`](https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew()). + * + * #### Example: + * + * const schema = new Schema({ + * name: { type: String, immutable: true }, + * age: Number + * }); + * const Model = mongoose.model('Test', schema); + * + * await Model.create({ name: 'test' }); + * const doc = await Model.findOne(); + * + * doc.isNew; // false + * doc.name = 'new name'; + * doc.name; // 'test', because `name` is immutable + * + * Mongoose also prevents changing immutable properties using `updateOne()` + * and `updateMany()` based on [strict mode](https://mongoosejs.com/docs/guide.html#strict). + * + * #### Example: + * + * // Mongoose will strip out the `name` update, because `name` is immutable + * Model.updateOne({}, { $set: { name: 'test2' }, $inc: { age: 1 } }); + * + * // If `strict` is set to 'throw', Mongoose will throw an error if you + * // update `name` + * const err = await Model.updateOne({}, { name: 'test2' }, { strict: 'throw' }). + * then(() => null, err => err); + * err.name; // StrictModeError + * + * // If `strict` is `false`, Mongoose allows updating `name` even though + * // the property is immutable. + * Model.updateOne({}, { name: 'test2' }, { strict: false }); + * + * @param {boolean} bool + * @return {SchemaType} this + * @see isNew https://mongoosejs.com/docs/api/document.html#Document.prototype.isNew() + * @api public + */ + +SchemaType.prototype.immutable = function(bool) { + this.$immutable = bool; + handleImmutable(this); + + return this; +}; + +/** + * Defines a custom function for transforming this path when converting a document to JSON. + * + * Mongoose calls this function with one parameter: the current `value` of the path. Mongoose + * then uses the return value in the JSON output. + * + * #### Example: + * + * const schema = new Schema({ + * date: { type: Date, transform: v => v.getFullYear() } + * }); + * const Model = mongoose.model('Test', schema); + * + * await Model.create({ date: new Date('2016-06-01') }); + * const doc = await Model.findOne(); + * + * doc.date instanceof Date; // true + * + * doc.toJSON().date; // 2016 as a number + * JSON.stringify(doc); // '{"_id":...,"date":2016}' + * + * @param {Function} fn + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.transform = function(fn) { + this.options.transform = fn; + + return this; +}; + +/** + * Adds a setter to this schematype. + * + * #### Example: + * + * function capitalize (val) { + * if (typeof val !== 'string') val = ''; + * return val.charAt(0).toUpperCase() + val.substring(1); + * } + * + * // defining within the schema + * const s = new Schema({ name: { type: String, set: capitalize }}); + * + * // or with the SchemaType + * const s = new Schema({ name: String }) + * s.path('name').set(capitalize); + * + * Setters allow you to transform the data before it gets to the raw mongodb + * document or query. + * + * Suppose you are implementing user registration for a website. Users provide + * an email and password, which gets saved to mongodb. The email is a string + * that you will want to normalize to lower case, in order to avoid one email + * having more than one account -- e.g., otherwise, avenue@q.com can be registered for 2 accounts via avenue@q.com and AvEnUe@Q.CoM. + * + * You can set up email lower case normalization easily via a Mongoose setter. + * + * function toLower(v) { + * return v.toLowerCase(); + * } + * + * const UserSchema = new Schema({ + * email: { type: String, set: toLower } + * }); + * + * const User = db.model('User', UserSchema); + * + * const user = new User({email: 'AVENUE@Q.COM'}); + * console.log(user.email); // 'avenue@q.com' + * + * // or + * const user = new User(); + * user.email = 'Avenue@Q.com'; + * console.log(user.email); // 'avenue@q.com' + * User.updateOne({ _id: _id }, { $set: { email: 'AVENUE@Q.COM' } }); // update to 'avenue@q.com' + * + * // Setters also transform query filters + * const user = await User.find({ email: 'AVENUE@Q.COM' }); // query for 'avenue@q.com' + * + * As you can see above, setters allow you to transform the data before it + * stored in MongoDB, or before executing a query. + * + * _NOTE: we could have also just used the built-in [`lowercase: true` SchemaType option](https://mongoosejs.com/docs/api/schemastringoptions.html#SchemaStringOptions.prototype.lowercase) instead of defining our own function._ + * + * new Schema({ email: { type: String, lowercase: true }}) + * + * Setters are also passed a second argument, the schematype on which the setter was defined. This allows for tailored behavior based on options passed in the schema. + * + * function inspector (val, priorValue, schematype) { + * if (schematype.options.required) { + * return schematype.path + ' is required'; + * } else { + * return val; + * } + * } + * + * const VirusSchema = new Schema({ + * name: { type: String, required: true, set: inspector }, + * taxonomy: { type: String, set: inspector } + * }) + * + * const Virus = db.model('Virus', VirusSchema); + * const v = new Virus({ name: 'Parvoviridae', taxonomy: 'Parvovirinae' }); + * + * console.log(v.name); // name is required + * console.log(v.taxonomy); // Parvovirinae + * + * You can also use setters to modify other properties on the document. If + * you're setting a property `name` on a document, the setter will run with + * `this` as the document. Be careful, in mongoose 5 setters will also run + * when querying by `name` with `this` as the query. + * + * const nameSchema = new Schema({ name: String, keywords: [String] }); + * nameSchema.path('name').set(function(v) { + * // Need to check if `this` is a document, because in mongoose 5 + * // setters will also run on queries, in which case `this` will be a + * // mongoose query object. + * if (this instanceof Document && v != null) { + * this.keywords = v.split(' '); + * } + * return v; + * }); + * + * @param {Function} fn + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.set = function(fn) { + if (typeof fn !== 'function') { + throw new TypeError('A setter must be a function.'); + } + this.setters.push(fn); + return this; +}; + +/** + * Adds a getter to this schematype. + * + * #### Example: + * + * function dob (val) { + * if (!val) return val; + * return (val.getMonth() + 1) + "/" + val.getDate() + "/" + val.getFullYear(); + * } + * + * // defining within the schema + * const s = new Schema({ born: { type: Date, get: dob }) + * + * // or by retrieving its SchemaType + * const s = new Schema({ born: Date }) + * s.path('born').get(dob) + * + * Getters allow you to transform the representation of the data as it travels from the raw mongodb document to the value that you see. + * + * Suppose you are storing credit card numbers and you want to hide everything except the last 4 digits to the mongoose user. You can do so by defining a getter in the following way: + * + * function obfuscate (cc) { + * return '****-****-****-' + cc.slice(cc.length-4, cc.length); + * } + * + * const AccountSchema = new Schema({ + * creditCardNumber: { type: String, get: obfuscate } + * }); + * + * const Account = db.model('Account', AccountSchema); + * + * Account.findById(id, function (err, found) { + * console.log(found.creditCardNumber); // '****-****-****-1234' + * }); + * + * Getters are also passed a second argument, the schematype on which the getter was defined. This allows for tailored behavior based on options passed in the schema. + * + * function inspector (val, priorValue, schematype) { + * if (schematype.options.required) { + * return schematype.path + ' is required'; + * } else { + * return schematype.path + ' is not'; + * } + * } + * + * const VirusSchema = new Schema({ + * name: { type: String, required: true, get: inspector }, + * taxonomy: { type: String, get: inspector } + * }) + * + * const Virus = db.model('Virus', VirusSchema); + * + * Virus.findById(id, function (err, virus) { + * console.log(virus.name); // name is required + * console.log(virus.taxonomy); // taxonomy is not + * }) + * + * @param {Function} fn + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.get = function(fn) { + if (typeof fn !== 'function') { + throw new TypeError('A getter must be a function.'); + } + this.getters.push(fn); + return this; +}; + +/** + * Adds multiple validators for this document path. + * Calls `validate()` for every element in validators. + * + * @param {(RegExp|Function|object)[]} validators + * @returns {SchemaType} + */ + +SchemaType.prototype.validateAll = function(validators) { + for (let i = 0; i < validators.length; i++) { + this.validate(validators[i]); + } + return this; +}; + +/** + * Adds validator(s) for this document path. + * + * Validators always receive the value to validate as their first argument and + * must return `Boolean`. Returning `false` or throwing an error means + * validation failed. + * + * The error message argument is optional. If not passed, the [default generic error message template](https://mongoosejs.com/docs/api/error.html#Error.messages) will be used. + * + * #### Example: + * + * // make sure every value is equal to "something" + * function validator (val) { + * return val === 'something'; + * } + * new Schema({ name: { type: String, validate: validator }}); + * + * // with a custom error message + * + * const custom = [validator, 'Uh oh, {PATH} does not equal "something".'] + * new Schema({ name: { type: String, validate: custom }}); + * + * // adding many validators at a time + * + * const many = [ + * { validator: validator, message: 'uh oh' } + * , { validator: anotherValidator, message: 'failed' } + * ] + * new Schema({ name: { type: String, validate: many }}); + * + * // or utilizing SchemaType methods directly: + * + * const schema = new Schema({ name: 'string' }); + * schema.path('name').validate(validator, 'validation of `{PATH}` failed with value `{VALUE}`'); + * + * #### Error message templates: + * + * Below is a list of supported template keywords: + * + * - PATH: The schema path where the error is being triggered. + * - VALUE: The value assigned to the PATH that is triggering the error. + * - KIND: The validation property that triggered the error i.e. required. + * - REASON: The error object that caused this error if there was one. + * + * If Mongoose's built-in error message templating isn't enough, Mongoose + * supports setting the `message` property to a function. + * + * schema.path('name').validate({ + * validator: function(v) { return v.length > 5; }, + * // `errors['name']` will be "name must have length 5, got 'foo'" + * message: function(props) { + * return `${props.path} must have length 5, got '${props.value}'`; + * } + * }); + * + * To bypass Mongoose's error messages and just copy the error message that + * the validator throws, do this: + * + * schema.path('name').validate({ + * validator: function() { throw new Error('Oops!'); }, + * // `errors['name'].message` will be "Oops!" + * message: function(props) { return props.reason.message; } + * }); + * + * #### Asynchronous validation: + * + * Mongoose supports validators that return a promise. A validator that returns + * a promise is called an _async validator_. Async validators run in + * parallel, and `validate()` will wait until all async validators have settled. + * + * schema.path('name').validate({ + * validator: function (value) { + * return new Promise(function (resolve, reject) { + * resolve(false); // validation failed + * }); + * } + * }); + * + * You might use asynchronous validators to retrieve other documents from the database to validate against or to meet other I/O bound validation needs. + * + * Validation occurs `pre('save')` or whenever you manually execute [document#validate](https://mongoosejs.com/docs/api/document.html#Document.prototype.validate()). + * + * If validation fails during `pre('save')` and no callback was passed to receive the error, an `error` event will be emitted on your Models associated db [connection](https://mongoosejs.com/docs/api/connection.html#Connection()), passing the validation error object along. + * + * const conn = mongoose.createConnection(..); + * conn.on('error', handleError); + * + * const Product = conn.model('Product', yourSchema); + * const dvd = new Product(..); + * dvd.save(); // emits error on the `conn` above + * + * If you want to handle these errors at the Model level, add an `error` + * listener to your Model as shown below. + * + * // registering an error listener on the Model lets us handle errors more locally + * Product.on('error', handleError); + * + * @param {RegExp|Function|object} obj validator function, or hash describing options + * @param {Function} [obj.validator] validator function. If the validator function returns `undefined` or a truthy value, validation succeeds. If it returns [falsy](https://masteringjs.io/tutorials/fundamentals/falsy) (except `undefined`) or throws an error, validation fails. + * @param {string|Function} [obj.message] optional error message. If function, should return the error message as a string + * @param {boolean} [obj.propsParameter=false] If true, Mongoose will pass the validator properties object (with the `validator` function, `message`, etc.) as the 2nd arg to the validator function. This is disabled by default because many validators [rely on positional args](https://github.com/chriso/validator.js#validators), so turning this on may cause unpredictable behavior in external validators. + * @param {string|Function} [errorMsg] optional error message. If function, should return the error message as a string + * @param {string} [type] optional validator type + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.validate = function(obj, message, type) { + if (typeof obj === 'function' || obj && utils.getFunctionName(obj.constructor) === 'RegExp') { + let properties; + if (typeof message === 'function') { + properties = { validator: obj, message: message }; + properties.type = type || 'user defined'; + } else if (message instanceof Object && !type) { + properties = isSimpleValidator(message) ? Object.assign({}, message) : clone(message); + if (!properties.message) { + properties.message = properties.msg; + } + properties.validator = obj; + properties.type = properties.type || 'user defined'; + } else { + if (message == null) { + message = MongooseError.messages.general.default; + } + if (!type) { + type = 'user defined'; + } + properties = { message: message, type: type, validator: obj }; + } + + this.validators.push(properties); + return this; + } + + let i; + let length; + let arg; + + for (i = 0, length = arguments.length; i < length; i++) { + arg = arguments[i]; + if (!utils.isPOJO(arg)) { + const msg = 'Invalid validator. Received (' + typeof arg + ') ' + + arg + + '. See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()'; + + throw new MongooseError(msg); + } + this.validate(arg.validator, arg); + } + + return this; +}; + +/** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using `unshift()`. + * + * #### Example: + * + * const s = new Schema({ born: { type: Date, required: true }) + * + * // or with custom error message + * + * const s = new Schema({ born: { type: Date, required: '{PATH} is required!' }) + * + * // or with a function + * + * const s = new Schema({ + * userId: ObjectId, + * username: { + * type: String, + * required: function() { return this.userId != null; } + * } + * }) + * + * // or with a function and a custom message + * const s = new Schema({ + * userId: ObjectId, + * username: { + * type: String, + * required: [ + * function() { return this.userId != null; }, + * 'username is required if id is specified' + * ] + * } + * }) + * + * // or through the path API + * + * s.path('name').required(true); + * + * // with custom error messaging + * + * s.path('name').required(true, 'grrr :( '); + * + * // or make a path conditionally required based on a function + * const isOver18 = function() { return this.age >= 18; }; + * s.path('voterRegistrationId').required(isOver18); + * + * The required validator uses the SchemaType's `checkRequired` function to + * determine whether a given value satisfies the required validator. By default, + * a value satisfies the required validator if `val != null` (that is, if + * the value is not null nor undefined). However, most built-in mongoose schema + * types override the default `checkRequired` function: + * + * @param {boolean|Function|object} required enable/disable the validator, or function that returns required boolean, or options object + * @param {boolean|Function} [options.isRequired] enable/disable the validator, or function that returns required boolean + * @param {Function} [options.ErrorConstructor] custom error constructor. The constructor receives 1 parameter, an object containing the validator properties. + * @param {string} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages https://mongoosejs.com/docs/api/error.html#Error.messages + * @see SchemaArray#checkRequired https://mongoosejs.com/docs/api/schemaarray.html#SchemaArray.prototype.checkRequired() + * @see SchemaBoolean#checkRequired https://mongoosejs.com/docs/api/schemaboolean.html#SchemaBoolean.prototype.checkRequired() + * @see SchemaBuffer#checkRequired https://mongoosejs.com/docs/api/schemabuffer.html#SchemaBuffer.prototype.checkRequired() + * @see SchemaNumber#checkRequired https://mongoosejs.com/docs/api/schemanumber.html#SchemaNumber.prototype.checkRequired() + * @see SchemaObjectId#checkRequired https://mongoosejs.com/docs/api/schemaobjectid.html#ObjectId.prototype.checkRequired() + * @see SchemaString#checkRequired https://mongoosejs.com/docs/api/schemastring.html#SchemaString.prototype.checkRequired() + * @api public + */ + +SchemaType.prototype.required = function(required, message) { + let customOptions = {}; + + if (arguments.length > 0 && required == null) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.requiredValidator; + }, this); + + this.isRequired = false; + delete this.originalRequiredValue; + return this; + } + + if (typeof required === 'object') { + customOptions = required; + message = customOptions.message || message; + required = required.isRequired; + } + + if (required === false) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.requiredValidator; + }, this); + + this.isRequired = false; + delete this.originalRequiredValue; + return this; + } + + const _this = this; + this.isRequired = true; + this.originalRequiredValue = required; + + if (typeof this.originalRequiredValue !== 'function' && + (utils.hasUserDefinedProperty(this.options, 'allowNull') || this.allowNullValidator != null)) { + throw new MongooseError('Path "' + this.path + '" may not have `allowNull` specified when `required` is true'); + } + + this.requiredValidator = function(v) { + const cachedRequired = this?.$__?.cachedRequired; + + // no validation when this path wasn't selected in the query. + if (cachedRequired != null && !this.$__isSelected(_this.path) && !this[documentIsModified](_this.path)) { + return true; + } + + // `$cachedRequired` gets set in `_getPathsToValidate()` so we + // don't call required functions multiple times in one validate call + // See gh-6801 + if (cachedRequired != null && _this.path in cachedRequired) { + const res = cachedRequired[_this.path] ? + _this.checkRequired(v, this) : + true; + delete cachedRequired[_this.path]; + return res; + } else if (typeof required === 'function') { + return required.apply(this) ? _this.checkRequired(v, this) : true; + } + + return _this.checkRequired(v, this); + }; + if (typeof required === 'string') { + message = required; + required = undefined; + } + + const msg = message || MongooseError.messages.general.required; + this.validators.unshift(Object.assign({}, customOptions, { + validator: this.requiredValidator, + message: msg, + type: 'required' + })); + + return this; +}; + +/** + * Adds a validator that disallows `null` for this path without making the path + * required. `undefined` values still pass validation. + * + * #### Example: + * + * const schema = new Schema({ + * name: { type: String, allowNull: false } + * }); + * + * new Model({}).validateSync(); // OK + * new Model({ name: undefined }).validateSync(); // OK, Mongoose strips out `name` when its value is `undefined` + * new Model({ name: null }).validateSync(); // ValidationError + * + * @param {boolean} allowNull + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.allowNull = function(allowNull) { + if (arguments.length > 0 && this.isRequired && typeof this.originalRequiredValue !== 'function') { + throw new MongooseError('Path "' + this.path + '" may not have `allowNull` specified when `required` is true'); + } + + this.validators = this.validators.filter(function(v) { + return v.validator !== this.allowNullValidator; + }, this); + + if (allowNull !== false) { + delete this.options.allowNull; + delete this.allowNullValidator; + return this; + } + + this.options.allowNull = false; + this.allowNullValidator = function(v) { + return v !== null; + }; + + this.validators.push({ + validator: this.allowNullValidator, + message: MongooseError.messages.general.allowNull, + type: 'allowNull' + }); + + return this; +}; + +/** + * Set the model that this path refers to. This is the option that [populate](https://mongoosejs.com/docs/populate.html) + * looks at to determine the foreign collection it should query. + * + * #### Example: + * + * const userSchema = new Schema({ name: String }); + * const User = mongoose.model('User', userSchema); + * + * const postSchema = new Schema({ user: mongoose.ObjectId }); + * postSchema.path('user').ref('User'); // Can set ref to a model name + * postSchema.path('user').ref(User); // Or a model class + * postSchema.path('user').ref(() => 'User'); // Or a function that returns the model name + * postSchema.path('user').ref(() => User); // Or a function that returns the model class + * + * // Or you can just declare the `ref` inline in your schema + * const postSchema2 = new Schema({ + * user: { type: mongoose.ObjectId, ref: User } + * }); + * + * @param {string|Model|Function} ref either a model name, a [Model](https://mongoosejs.com/docs/models.html), or a function that returns a model name or model. + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.ref = function(ref) { + this.options.ref = ref; + return this; +}; + +/** + * Gets the default value + * + * @param {object} parentDoc + * @param {boolean} init + * @param {object} options + * @param {object} [options.context] + * @param {boolean} [options.skipCast] + * @param {object} [applySettersOptions] passed to applySetters + * @return {any} The Stored default value. + * @api private + */ + +SchemaType.prototype.getDefault = function getDefault(parentDoc, init, options, applySettersOptions) { + let ret; + if (this.defaultValue == null) { + return this.defaultValue; + } + if (typeof this.defaultValue === 'function') { + // In setDefaultsOnInsert, we pass the Query as `context` option. This is used to + // avoid passing the query as the parent doc to `applySetters()` below, because + // applySetters assumes parentDoc is a document or null. Queries run setters + // separately anyway. + const context = options?.context ?? parentDoc; + if ( + this.defaultValue === Date.now || + this.defaultValue === Array || + this.defaultValue.name === 'ObjectId' || + this.defaultValue.name === 'ObjectID' + ) { + ret = this.defaultValue.call(context); + } else { + ret = this.defaultValue.call(context, context); + } + } else { + ret = this.defaultValue; + } + + if (ret != null) { + if (typeof ret === 'object' && ret != null && ret._bsontype !== 'ObjectId' && !this.options?.shared) { + ret = clone(ret); + } + + if (options?.skipCast) { + return this._applySetters(ret, parentDoc); + } + + const casted = this.applySetters( + ret, + parentDoc, + init, + undefined, + applySettersOptions ?? setOptionsForDefaults + ); + if (casted && !Array.isArray(casted) && casted.$isSingleNested) { + casted.$__parent = parentDoc; + } + return casted; + } + return ret; +}; + +/** + * Applies setters without casting + * + * @param {any} value + * @param {any} scope + * @param {boolean} init + * @param {any} priorVal + * @param {object} [options] + * @instance + * @api private + */ + +SchemaType.prototype._applySetters = function(value, scope, init, priorVal, options) { + let v = value; + if (init) { + return v; + } + const setters = this.setters; + + for (let i = setters.length - 1; i >= 0; i--) { + v = setters[i].call(scope, v, priorVal, this, options); + } + + return v; +}; + +/*! + * ignore + */ + +SchemaType.prototype._castNullish = function _castNullish(v) { + return v; +}; + +/** + * Applies setters + * + * @param {any} value + * @param {object} scope + * @param {boolean} init + * @return {any} + * @api private + */ + +SchemaType.prototype.applySetters = function(value, scope, init, priorVal, options) { + let v = this._applySetters(value, scope, init, priorVal, options); + if (v == null) { + return this._castNullish(v); + } + // do not cast until all setters are applied #665 + v = this.cast(v, scope, init, priorVal, options); + + return v; +}; + +/** + * Applies getters to a value + * + * @param {object} value + * @param {object} scope + * @return {any} + * @api private + */ + +SchemaType.prototype.applyGetters = function(value, scope) { + let v = value; + const getters = this.getters; + const len = getters.length; + + if (len === 0) { + return v; + } + + for (let i = 0; i < len; ++i) { + v = getters[i].call(scope, v, this); + } + + return v; +}; + +/** + * Sets default `select()` behavior for this path. + * + * Set to `true` if this path should always be included in the results, `false` if it should be excluded by default. This setting can be overridden at the query level. + * + * #### Example: + * + * T = db.model('T', new Schema({ x: { type: String, select: true }})); + * T.find(..); // field x will always be selected .. + * // .. unless overridden; + * T.find().select('-x').exec(callback); + * + * @param {boolean} val + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.select = function select(val) { + this.selected = !!val; + return this; +}; + +/** + * Performs a validation of `value` using the validators declared for this SchemaType. + * + * @param {any} value + * @param {object} scope + * @param {object} [options] + * @param {string} [options.path] + * @return {any} If no validators, returns the output from calling `fn`, otherwise no return + * @api public + */ + +SchemaType.prototype.doValidate = async function doValidate(value, scope, options) { + let err = false; + const path = this.path; + + // Avoid non-object `validators` + const validators = this.validators. + filter(v => typeof v === 'object' && v !== null); + + if (!validators.length) { + return; + } + + const promises = []; + for (let i = 0, len = validators.length; i < len; ++i) { + const v = validators[i]; + const validator = v.validator; + let ok; + + const validatorProperties = isSimpleValidator(v) ? Object.assign({}, v) : clone(v); + validatorProperties.path = options?.path || path; + validatorProperties.fullPath = this.$fullPath; + validatorProperties.value = value; + if (typeof value === 'string') { + validatorProperties.length = value.length; + } + + if (value === undefined && validator !== this.requiredValidator) { + continue; + } + if (validator instanceof RegExp) { + ok = validator.test(value); + if (ok === false) { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + err = new ErrorConstructor(validatorProperties, scope); + err[validatorErrorSymbol] = true; + throw err; + } + continue; + } else if (typeof validator !== 'function') { + continue; + } + + try { + if (validatorProperties.propsParameter) { + ok = validator.call(scope, value, validatorProperties); + } else { + ok = validator.call(scope, value); + } + } catch (error) { + ok = false; + validatorProperties.reason = error; + if (error.message) { + validatorProperties.message = error.message; + } + } + + if (typeof ok?.then === 'function') { + promises.push( + ok.then( + function(ok) { + if (ok === false) { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + err = new ErrorConstructor(validatorProperties, scope); + err[validatorErrorSymbol] = true; + throw err; + } + }, + function(error) { + validatorProperties.reason = error; + validatorProperties.message = error.message; + ok = false; + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + err = new ErrorConstructor(validatorProperties, scope); + err[validatorErrorSymbol] = true; + throw err; + }) + ); + } else if (ok !== undefined && !ok) { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + err = new ErrorConstructor(validatorProperties, scope); + err[validatorErrorSymbol] = true; + throw err; + } + } + + await Promise.all(promises); +}; + + +function _validate(ok, validatorProperties) { + if (ok !== undefined && !ok) { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + const err = new ErrorConstructor(validatorProperties); + err[validatorErrorSymbol] = true; + return err; + } +} + +/** + * Performs a validation of `value` using the validators declared for this SchemaType. + * + * #### Note: + * + * This method ignores the asynchronous validators. + * + * @param {any} value + * @param {object} scope + * @param {object} [options] + * @param {string} [options.path] + * @return {MongooseError|null} + * @api private + */ + +SchemaType.prototype.doValidateSync = function(value, scope, options) { + const path = this.path; + const count = this.validators.length; + + if (!count) { + return null; + } + + let validators = this.validators; + if (value === void 0) { + if (this.validators.length !== 0 && this.validators[0].type === 'required') { + validators = [this.validators[0]]; + } else { + return null; + } + } + + let err = null; + let i = 0; + const len = validators.length; + for (i = 0; i < len; ++i) { + const v = validators[i]; + + if (v === null || typeof v !== 'object') { + continue; + } + + const validator = v.validator; + const validatorProperties = isSimpleValidator(v) ? Object.assign({}, v) : clone(v); + validatorProperties.path = options?.path || path; + validatorProperties.fullPath = this.$fullPath; + validatorProperties.value = value; + if (typeof value === 'string') { + validatorProperties.length = value.length; + } + let ok = false; + + // Skip any explicit async validators. Validators that return a promise + // will still run, but won't trigger any errors. + if (isAsyncFunction(validator)) { + continue; + } + + if (validator instanceof RegExp) { + err = _validate(validator.test(value), validatorProperties); + continue; + } + + if (typeof validator !== 'function') { + continue; + } + + try { + if (validatorProperties.propsParameter) { + ok = validator.call(scope, value, validatorProperties); + } else { + ok = validator.call(scope, value); + } + } catch (error) { + ok = false; + validatorProperties.reason = error; + } + + // Skip any validators that return a promise, we can't handle those + // synchronously + if (typeof ok?.then === 'function') { + continue; + } + err = _validate(ok, validatorProperties); + if (err) { + break; + } + } + + return err; +}; + +/** + * Determines if value is a valid Reference. + * + * @param {SchemaType} self + * @param {object} value + * @param {Document} doc + * @param {boolean} init + * @return {boolean} + * @api private + */ + +SchemaType._isRef = function(self, value, doc, init) { + // fast path + let ref = init && (self.options?.ref || self.options?.refPath); + + if (!ref && doc?.$__ != null) { + // checks for + // - this populated with adhoc model and no ref was set in schema OR + // - setting / pushing values after population + const path = doc.$__fullPath(self.path, true); + + const owner = doc.ownerDocument(); + ref = (path != null && owner.$populated(path)) || doc.$populated(self.path); + } + + if (ref) { + if (value == null) { + return true; + } + if (!Buffer.isBuffer(value) && // buffers are objects too + value._bsontype !== 'Binary' // raw binary value from the db + && utils.isObject(value) // might have deselected _id in population query + ) { + return true; + } + + return init; + } + + return false; +}; + +/*! + * ignore + */ + +SchemaType.prototype._castRef = function _castRef(value, doc, init, options) { + if (value == null) { + return value; + } + + if (value.$__ != null) { + value.$__.wasPopulated = value.$__.wasPopulated || { value: value._doc._id }; + return value; + } + + // setting a populated path + if (Buffer.isBuffer(value) || !utils.isObject(value)) { + if (init) { + return value; + } + throw new CastError(this.instance, value, this.path, null, this); + } + + // Handle the case where user directly sets a populated + // path to a plain object; cast to the Model used in + // the population query. + const path = doc.$__fullPath(this.path, true); + const owner = doc.ownerDocument(); + const pop = owner.$populated(path, true); + + let ret = value; + if (!doc.$__.populated || + !doc.$__.populated[path] || + !doc.$__.populated[path].options || + !doc.$__.populated[path].options.options || + !doc.$__.populated[path].options.options.lean) { + const PopulatedModel = pop ? pop.options[populateModelSymbol] : owner.constructor.db.model(this.options.ref); + ret = PopulatedModel.hydrate(value, null, options); + ret.$__.wasPopulated = { value: ret._doc._id, options: { [populateModelSymbol]: PopulatedModel } }; + } + + return ret; +}; + +/*! + * ignore + */ + +function handleSingle(val, context) { + return this.castForQuery(null, val, context); +} + +/*! + * ignore + */ + +function handleArray(val, context) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(null, val, context)]; + } + return val.map(function(m) { + return _this.castForQuery(null, m, context); + }); +} + +/** + * Just like handleArray, except also allows `[]` because surprisingly + * `$in: [1, []]` works fine + * @api private + */ + +function handle$in(val, context) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(null, val, context)]; + } + return val.map(function(m) { + if (Array.isArray(m) && m.length === 0) { + return m; + } + return _this.castForQuery(null, m, context); + }); +} + +/** + * Contains the handlers for different query operators for this schema type. + * For example, `$conditionalHandlers.$exists` is the function Mongoose calls to cast `$exists` filter operators. + * + * @property $conditionalHandlers + * @memberOf SchemaType + * @instance + * @api public + */ + +SchemaType.prototype.$conditionalHandlers = { + $all: handleArray, + $eq: handleSingle, + $in: handle$in, + $ne: handleSingle, + $nin: handle$in, + $exists: $exists, + $type: $type +}; + +/** + * Cast the given value with the given optional query operator. + * + * @param {string} [$conditional] query operator, like `$eq` or `$in` + * @param {any} val + * @param {Query} context + * @return {any} + * @api private + */ + +SchemaType.prototype.castForQuery = function($conditional, val, context) { + let handler; + if ($conditional != null) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new MongooseError('Can\'t use ' + $conditional); + } + return handler.call(this, val, context); + } + + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } +}; + +/** + * Set & Get the `checkRequired` function + * Override the function the required validator uses to check whether a value + * passes the `required` check. Override this on the individual SchemaType. + * + * #### Example: + * + * // Use this to allow empty strings to pass the `required` validator + * mongoose.Schema.Types.String.checkRequired(v => typeof v === 'string'); + * + * @param {Function} [fn] If set, will overwrite the current set function + * @return {Function} The input `fn` or the already set function + * @static + * @memberOf SchemaType + * @function checkRequired + * @api public + */ + +SchemaType.checkRequired = function(fn) { + if (arguments.length !== 0) { + this._checkRequired = fn; + } + + return this._checkRequired; +}; + +/** + * Default check for if this path satisfies the `required` validator. + * + * @param {any} val + * @return {boolean} `true` when the value is not `null`, `false` otherwise + * @api private + */ + +SchemaType.prototype.checkRequired = function(val) { + return val != null; +}; + +/** + * Clone the current SchemaType + * + * @return {SchemaType} The cloned SchemaType instance + * @api private + */ + +SchemaType.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.path, options, this.instance, this.parentSchema); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) schematype.requiredValidator = this.requiredValidator; + if (this.allowNullValidator !== undefined) schematype.allowNullValidator = this.allowNullValidator; + if (this.defaultValue !== undefined) schematype.defaultValue = this.defaultValue; + if (this.$immutable !== undefined && this.options.immutable === undefined) { + schematype.$immutable = this.$immutable; + + handleImmutable(schematype); + } + if (this._index !== undefined) schematype._index = this._index; + if (this.selected !== undefined) schematype.selected = this.selected; + if (this.isRequired !== undefined) schematype.isRequired = this.isRequired; + if (this.originalRequiredValue !== undefined) schematype.originalRequiredValue = this.originalRequiredValue; + schematype.getters = this.getters.slice(); + schematype.setters = this.setters.slice(); + return schematype; +}; + +/** + * Returns the embedded schema type, if any. For arrays, document arrays, and maps, `getEmbeddedSchemaType()` + * returns the schema type of the array's elements (or map's elements). For other types, `getEmbeddedSchemaType()` + * returns `undefined`. + * + * #### Example: + * + * const schema = new Schema({ name: String, tags: [String] }); + * schema.path('name').getEmbeddedSchemaType(); // undefined + * schema.path('tags').getEmbeddedSchemaType(); // SchemaString { path: 'tags', ... } + * + * @returns {SchemaType} embedded schematype + * @api public + */ + +SchemaType.prototype.getEmbeddedSchemaType = function getEmbeddedSchemaType() { + return this.embeddedSchemaType; +}; + +/*! + * If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string. + * + * @api private + */ + +SchemaType.prototype._duplicateKeyErrorMessage = null; + +/** + * Returns this schema type's representation in a JSON schema. + * + * @param {object} [options] + * @param {boolean} [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {object} JSON schema properties + */ + +SchemaType.prototype.toJSONSchema = function toJSONSchema(_options) { // eslint-disable-line no-unused-vars + throw new MongooseError(`Converting unsupported SchemaType to JSON Schema: ${this.instance} at path "${this.path}"`); +}; + +/** + * Returns the BSON type that the schema corresponds to, for automatic encryption. + * @api private + */ +SchemaType.prototype.autoEncryptionType = function autoEncryptionType() { + return null; +}; + +/*! + * Module exports. + */ + +module.exports = exports = SchemaType; + +exports.CastError = CastError; + +exports.ValidatorError = ValidatorError; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/standardSchema/convertErrorToIssues.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/standardSchema/convertErrorToIssues.js new file mode 100644 index 00000000..62aaaa66 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/standardSchema/convertErrorToIssues.js @@ -0,0 +1,20 @@ +'use strict'; + +const ValidationError = require('../error/validation'); + +module.exports = function convertErrorToIssues(error) { + if (error instanceof ValidationError) { + return Object.keys(error.errors).map(path => { + const err = error.errors[path]; + return { + message: err.message, + path: path.split('.').map(part => { + const num = +part; + return Number.isInteger(num) && String(num) === part ? num : part; + }) + }; + }); + } + + return [{ message: error.message }]; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/stateMachine.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/stateMachine.js new file mode 100644 index 00000000..b8a2dc30 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/stateMachine.js @@ -0,0 +1,253 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const utils = require('./utils'); // eslint-disable-line no-unused-vars + +/** + * StateMachine represents a minimal `interface` for the + * constructors it builds via StateMachine.ctor(...). + * + * @api private + */ + +const StateMachine = module.exports = exports = function StateMachine() { +}; + +/** + * StateMachine.ctor('state1', 'state2', ...) + * A factory method for subclassing StateMachine. + * The arguments are a list of states. For each state, + * the constructor's prototype gets state transition + * methods named after each state. These transition methods + * place their path argument into the given state. + * + * @param {...string} state one or more state names + * @return {Function} subclass constructor + * @api private + */ + +StateMachine.ctor = function() { + const states = [...arguments]; + + const ctor = function() { + this.paths = {}; + this.states = {}; + }; + + ctor.prototype = new StateMachine(); + ctor.prototype.constructor = ctor; + + ctor.prototype.stateNames = states; + + states.forEach(function(state) { + // Changes the `path`'s state to `state`. + ctor.prototype[state] = function(path) { + this._changeState(path, state); + }; + }); + + return ctor; +}; + +/** + * This function is wrapped by the state change functions: + * + * - `require(path)` + * - `modify(path)` + * - `init(path)` + * + * @api private + */ + +StateMachine.prototype._changeState = function _changeState(path, nextState) { + const prevState = this.paths[path]; + if (prevState === nextState) { + return; + } + if (prevState !== undefined) { + const prevBucket = this.states[prevState]; + if (prevBucket) delete prevBucket[path]; + } + + this.paths[path] = nextState; + this.states[nextState] = this.states[nextState] || {}; + this.states[nextState][path] = true; +}; + +/*! + * ignore + */ + +StateMachine.prototype.clearAllExcept = function clearAllExcept(state) { + // State buckets are created lazily, so `states[state]` may not exist yet. + const bucket = this.states[state]; + const keys = bucket == null ? [] : Object.keys(bucket); + if (keys.length === 0) { + this.paths = {}; + this.states = {}; + return; + } + this.paths = {}; + for (const path of keys) { + this.paths[path] = state; + } + this.states = { + [state]: this.states[state] + }; +}; + +/*! + * ignore + */ + +StateMachine.prototype.clear = function clear(state) { + if (this.states[state] == null) { + return; + } + const keys = Object.keys(this.states[state]); + if (keys.length === 0) { + return; + } + this.states[state] = {}; + let i = keys.length; + + while (i--) { + delete this.paths[keys[i]]; + } +}; + +/*! + * ignore + */ + +StateMachine.prototype.clearPath = function clearPath(path) { + const state = this.paths[path]; + if (!state) { + return; + } + delete this.paths[path]; + delete this.states[state][path]; +}; + +/** + * Gets the paths for the given state, or empty object `{}` if none. + * @api private + */ + +StateMachine.prototype.getStatePaths = function getStatePaths(state) { + if (this.states[state] != null) { + return this.states[state]; + } + return {}; +}; + +/** + * Checks to see if at least one path is in the states passed in via `arguments` + * e.g., this.some('required', 'inited') + * + * @param {string} state that we want to check for. + * @api private + */ + +StateMachine.prototype.some = function some() { + const _this = this; + const what = arguments.length ? arguments : this.stateNames; + return Array.prototype.some.call(what, function(state) { + if (_this.states[state] == null) { + return false; + } + return Object.keys(_this.states[state]).length; + }); +}; + +/** + * This function builds the functions that get assigned to `forEach` and `map`, + * since both of those methods share a lot of the same logic. + * + * @param {string} iterMethod is either 'forEach' or 'map' + * @return {Function} + * @api private + */ + +StateMachine.prototype._iter = function _iter(iterMethod) { + return function() { + let states = [...arguments]; + const callback = states.pop(); + + if (!states.length) states = this.stateNames; + + const _this = this; + + const paths = states.reduce(function(paths, state) { + if (_this.states[state] == null) { + return paths; + } + return paths.concat(Object.keys(_this.states[state])); + }, []); + + return paths[iterMethod](function(path, i, paths) { + return callback(path, i, paths); + }); + }; +}; + +/** + * Iterates over the paths that belong to one of the parameter states. + * + * The function profile can look like: + * this.forEach(state1, fn); // iterates over all paths in state1 + * this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2 + * this.forEach(fn); // iterates over all paths in all states + * + * @param {...string} [state] one or more state names to filter by + * @param {Function} callback + * @api private + */ + +StateMachine.prototype.forEach = function forEach() { + this.forEach = this._iter('forEach'); + return this.forEach.apply(this, arguments); +}; + +/** + * Maps over the paths that belong to one of the parameter states. + * + * The function profile can look like: + * this.forEach(state1, fn); // iterates over all paths in state1 + * this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2 + * this.forEach(fn); // iterates over all paths in all states + * + * @param {...string} [state] one or more state names to filter by + * @param {Function} callback + * @return {Array} + * @api private + */ + +StateMachine.prototype.map = function map() { + this.map = this._iter('map'); + return this.map.apply(this, arguments); +}; + +/** + * Returns a copy of this state machine + * + * @param {Function} callback + * @return {StateMachine} + * @api private + */ + +StateMachine.prototype.clone = function clone() { + const result = new this.constructor(); + result.paths = { ...this.paths }; + for (const state of this.stateNames) { + if (!(state in this.states)) { + continue; + } + result.states[state] = this.states[state] == null ? this.states[state] : { ...this.states[state] }; + } + return result; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/tracing.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/tracing.js new file mode 100644 index 00000000..fb1f949c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/tracing.js @@ -0,0 +1,38 @@ +'use strict'; + +let dc; +try { + dc = (typeof process !== 'undefined' && 'getBuiltinModule' in process) + ? process.getBuiltinModule('node:diagnostics_channel') + : require('node:diagnostics_channel'); +} catch { + // diagnostics_channel not available +} + +const hasTracingChannel = !!dc && typeof dc.tracingChannel === 'function'; + +function shouldTrace(channel) { + // Node 18 and Bun don't expose hasSubscribers on TracingChannel + // so undefined means it may or may not have subscribers, so we'll trace anyway + return !!channel && channel.hasSubscribers !== false; +} + +function createTracedChannel(name) { + const ch = hasTracingChannel ? dc.tracingChannel(name) : undefined; + + function trace(fn, contextFactory) { + if (!shouldTrace(ch)) { + return fn(); + } + + const traced = ch.tracePromise(fn, contextFactory()); + return traced; + } + + return { channel: ch, trace }; +} + +module.exports = { + createTracedChannel, + cursorNextChannel: createTracedChannel('mongoose:cursor:next') +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/index.js new file mode 100644 index 00000000..b069be7a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/index.js @@ -0,0 +1,119 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const mongooseArrayMethods = require('./methods'); + +const arrayAtomicsSymbol = require('../../helpers/symbols').arrayAtomicsSymbol; +const arrayAtomicsBackupSymbol = require('../../helpers/symbols').arrayAtomicsBackupSymbol; +const arrayParentSymbol = require('../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../helpers/symbols').arraySchemaSymbol; + +/** + * Mongoose Array constructor. + * + * #### Note: + * + * _Values always have to be passed to the constructor to initialize, otherwise `MongooseArray#push` will mark the array as modified._ + * + * @param {Array} values + * @param {string} path + * @param {Document} doc parent document + * @api private + * @inherits Array https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array + * @see https://bit.ly/f6CnZU + */ +const _basePush = Array.prototype.push; +const numberRE = /^\d+$/; + +function MongooseArray(values, path, doc, schematype) { + let __array; + + if (Array.isArray(values)) { + const len = values.length; + + // Perf optimizations for small arrays: much faster to use `...` than `for` + `push`, + // but large arrays may cause stack overflows. And for arrays of length 0/1, just + // modifying the array is faster. Seems small, but adds up when you have a document + // with thousands of nested arrays. + if (len === 0) { + __array = new Array(); + } else if (len === 1) { + __array = new Array(1); + __array[0] = values[0]; + } else if (len < 10000) { + __array = new Array(); + _basePush.apply(__array, values); + } else { + __array = new Array(); + for (let i = 0; i < len; ++i) { + _basePush.call(__array, values[i]); + } + } + } else { + __array = []; + } + + const internals = { + [arrayAtomicsSymbol]: {}, + [arrayAtomicsBackupSymbol]: void 0, + [arrayPathSymbol]: path, + [arraySchemaSymbol]: schematype, + [arrayParentSymbol]: void 0, + isMongooseArray: true, + isMongooseArrayProxy: true, + __array: __array + }; + + if (values && values[arrayAtomicsSymbol] != null) { + internals[arrayAtomicsSymbol] = values[arrayAtomicsSymbol]; + } + + if (doc?.$__) { + internals[arrayParentSymbol] = doc; + internals[arraySchemaSymbol] = schematype || doc.schema.path(path); + } + + const proxy = new Proxy(__array, { + get: function(target, prop) { + if (Object.hasOwn(internals, prop)) { + return internals[prop]; + } + if (Object.hasOwn(mongooseArrayMethods, prop)) { + return mongooseArrayMethods[prop]; + } + if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + return schematype.virtuals[prop].applyGetters(undefined, target); + } + if (typeof prop === 'string' && numberRE.test(prop) && schematype?.embeddedSchemaType != null) { + return schematype.embeddedSchemaType.applyGetters(__array[prop], doc); + } + + return __array[prop]; + }, + set: function(target, prop, value) { + if (typeof prop === 'string' && numberRE.test(prop)) { + mongooseArrayMethods.set.call(proxy, prop, value, false); + } else if (Object.hasOwn(internals, prop)) { + internals[prop] = value; + } else if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + schematype.virtuals[prop].applySetters(value, target); + } else { + __array[prop] = value; + } + + return true; + } + }); + + return proxy; +} + +/*! + * Module exports. + */ + +module.exports = exports = MongooseArray; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/isMongooseArray.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/isMongooseArray.js new file mode 100644 index 00000000..89326136 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/isMongooseArray.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.isMongooseArray = function(mongooseArray) { + return Array.isArray(mongooseArray) && mongooseArray.isMongooseArray; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/methods/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/methods/index.js new file mode 100644 index 00000000..3a5d7d2b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/array/methods/index.js @@ -0,0 +1,1095 @@ +'use strict'; + +const Document = require('../../../document'); +const ArraySubdocument = require('../../arraySubdocument'); +const MongooseError = require('../../../error/mongooseError'); +const cleanModifiedSubpaths = require('../../../helpers/document/cleanModifiedSubpaths'); +const clone = require('../../../helpers/clone'); +const internalToObjectOptions = require('../../../options').internalToObjectOptions; +const mpath = require('mpath'); +const utils = require('../../../utils'); +const isBsonType = require('../../../helpers/isBsonType'); + +const arrayAtomicsBackupSymbol = require('../../../helpers/symbols').arrayAtomicsBackupSymbol; +const arrayAtomicsSymbol = require('../../../helpers/symbols').arrayAtomicsSymbol; +const arrayParentSymbol = require('../../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../../helpers/symbols').arraySchemaSymbol; +const populateModelSymbol = require('../../../helpers/symbols').populateModelSymbol; +const slicedSymbol = Symbol('mongoose#Array#sliced'); + +const _basePush = Array.prototype.push; + +/*! + * ignore + */ + +const methods = { + /** + * Depopulates stored atomic operation values as necessary for direct insertion to MongoDB. + * + * If no atomics exist, we return all array values after conversion. + * + * @return {Array} + * @method $__getAtomics + * @memberOf MongooseArray + * @instance + * @api private + */ + + $__getAtomics() { + const ret = []; + const keys = Object.keys(this[arrayAtomicsSymbol] || {}); + let i = keys.length; + + const opts = Object.assign({}, internalToObjectOptions, { _isNested: true }); + + if (i === 0) { + ret[0] = ['$set', this.toObject(opts)]; + return ret; + } + + while (i--) { + const op = keys[i]; + let val = this[arrayAtomicsSymbol][op]; + + // the atomic values which are arrays are not MongooseArrays. we + // need to convert their elements as if they were MongooseArrays + // to handle populated arrays versus DocumentArrays properly. + if (utils.isMongooseObject(val)) { + val = val.toObject(opts); + } else if (Array.isArray(val)) { + val = this.toObject.call(val, opts); + } else if (Array.isArray(val?.$each)) { + val.$each = this.toObject.call(val.$each, opts); + } else if (typeof val?.valueOf === 'function') { + val = val.valueOf(); + } + + if (op === '$addToSet') { + val = { $each: val }; + } + + ret.push([op, val]); + } + + return ret; + }, + + /** + * Public API for getting atomics. Alias for $__getAtomics() that can be + * implemented by custom container types. + * + * @return {Array} + * @method getAtomics + * @memberOf MongooseArray + * @instance + * @api public + */ + + getAtomics() { + return this.$__getAtomics(); + }, + + /** + * Clears all pending atomic operations. Called by Mongoose after save(). + * + * @return {void} + * @method clearAtomics + * @memberOf MongooseArray + * @instance + * @api public + */ + + clearAtomics() { + this[arrayAtomicsBackupSymbol] = this[arrayAtomicsSymbol]; + this[arrayAtomicsSymbol] = {}; + }, + + /*! + * ignore + */ + + $atomics() { + return this[arrayAtomicsSymbol]; + }, + + /*! + * ignore + */ + + $parent() { + return this[arrayParentSymbol]; + }, + + /*! + * ignore + */ + + $path() { + return this[arrayPathSymbol]; + }, + + /*! + * ignore + */ + $schemaType() { + return this[arraySchemaSymbol]; + }, + + /** + * Atomically shifts the array at most one time per document `save()`. + * + * #### Note: + * + * _Calling this multiple times on an array before saving sends the same command as calling it once._ + * _This update is implemented using the MongoDB [$pop](https://www.mongodb.com/docs/manual/reference/operator/update/pop/) method which enforces this restriction._ + * + * doc.array = [1,2,3]; + * + * const shifted = doc.array.$shift(); + * console.log(shifted); // 1 + * console.log(doc.array); // [2,3] + * + * // no affect + * shifted = doc.array.$shift(); + * console.log(doc.array); // [2,3] + * + * doc.save(function (err) { + * if (err) return handleError(err); + * + * // we saved, now $shift works again + * shifted = doc.array.$shift(); + * console.log(shifted ); // 2 + * console.log(doc.array); // [3] + * }) + * + * @api public + * @memberOf MongooseArray + * @instance + * @method $shift + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pop/ + */ + + $shift() { + this._registerAtomic('$pop', -1); + this._markModified(); + + // only allow shifting once + const __array = this.__array; + if (__array._shifted) { + return; + } + __array._shifted = true; + + return [].shift.call(__array); + }, + + /** + * Pops the array atomically at most one time per document `save()`. + * + * #### NOTE: + * + * _Calling this multiple times on an array before saving sends the same command as calling it once._ + * _This update is implemented using the MongoDB [$pop](https://www.mongodb.com/docs/manual/reference/operator/update/pop/) method which enforces this restriction._ + * + * doc.array = [1,2,3]; + * + * const popped = doc.array.$pop(); + * console.log(popped); // 3 + * console.log(doc.array); // [1,2] + * + * // no affect + * popped = doc.array.$pop(); + * console.log(doc.array); // [1,2] + * + * doc.save(function (err) { + * if (err) return handleError(err); + * + * // we saved, now $pop works again + * popped = doc.array.$pop(); + * console.log(popped); // 2 + * console.log(doc.array); // [1] + * }) + * + * @api public + * @method $pop + * @memberOf MongooseArray + * @instance + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pop/ + * @method $pop + * @memberOf MongooseArray + */ + + $pop() { + this._registerAtomic('$pop', 1); + this._markModified(); + + // only allow popping once + if (this._popped) { + return; + } + this._popped = true; + + return [].pop.call(this); + }, + + /*! + * ignore + */ + + $schema() { + return this[arraySchemaSymbol]; + }, + + /** + * Casts a member based on this arrays schema. + * + * @param {any} value + * @return {any} the casted value + * @method _cast + * @api private + * @memberOf MongooseArray + */ + + _cast(value) { + let populated = false; + let Model; + + const parent = this[arrayParentSymbol]; + if (parent) { + populated = parent.$populated(this[arrayPathSymbol], true); + } + + if (populated && value != null) { + // cast to the populated Models schema + Model = populated.options[populateModelSymbol]; + if (Model == null) { + throw new MongooseError('No populated model found for path `' + this[arrayPathSymbol] + '`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.'); + } + + // only objects are permitted so we can safely assume that + // non-objects are to be interpreted as _id + if (Buffer.isBuffer(value) || + isBsonType(value, 'ObjectId') || !utils.isObject(value)) { + value = { _id: value }; + } + + // gh-2399 + // we should cast model only when it's not a discriminator + const isDisc = value.schema?.discriminatorMapping?.key !== undefined; + if (!isDisc) { + value = new Model(value); + } + return this[arraySchemaSymbol].embeddedSchemaType.applySetters(value, parent, true); + } + + return this[arraySchemaSymbol].embeddedSchemaType.applySetters(value, parent, false); + }, + + /** + * Internal helper for .map() + * + * @api private + * @return {number} + * @method _mapCast + * @memberOf MongooseArray + */ + + _mapCast(val, index) { + return this._cast(val, this.length + index); + }, + + /** + * Marks this array as modified. + * + * If it bubbles up from an embedded document change, then it takes the following arguments (otherwise, takes 0 arguments) + * + * @param {ArraySubdocument} subdoc the embedded doc that invoked this method on the Array + * @param {string} embeddedPath the path which changed in the subdoc + * @method _markModified + * @api private + * @memberOf MongooseArray + */ + + _markModified(elem) { + const parent = this[arrayParentSymbol]; + let dirtyPath; + + if (parent) { + dirtyPath = this[arrayPathSymbol]; + + if (arguments.length) { + dirtyPath = dirtyPath + '.' + elem; + } + + if (dirtyPath != null && dirtyPath.endsWith('.$')) { + return this; + } + + parent.markModified(dirtyPath, arguments.length !== 0 ? elem : parent); + } + + return this; + }, + + /** + * Register an atomic operation with the parent. + * + * @param {Array} op operation + * @param {any} val + * @method _registerAtomic + * @api private + * @memberOf MongooseArray + */ + + _registerAtomic(op, val) { + if (this[slicedSymbol]) { + return; + } + if (op === '$set') { + // $set takes precedence over all other ops. + // mark entire array modified. + this[arrayAtomicsSymbol] = { $set: val }; + cleanModifiedSubpaths(this[arrayParentSymbol], this[arrayPathSymbol]); + this._markModified(); + return this; + } + + const atomics = this[arrayAtomicsSymbol]; + + // reset pop/shift after save + if (op === '$pop' && !('$pop' in atomics)) { + const _this = this; + this[arrayParentSymbol].once('save', function() { + _this._popped = _this._shifted = null; + }); + } + + // check for impossible $atomic combos (Mongo denies more than one + // $atomic op on a single path + if (atomics.$set || utils.hasOwnKeys(atomics) && !(op in atomics)) { + // a different op was previously registered. + // save the entire thing. + this[arrayAtomicsSymbol] = { $set: this }; + return this; + } + + let selector; + + if (op === '$pullAll' || op === '$addToSet') { + atomics[op] || (atomics[op] = []); + atomics[op] = atomics[op].concat(val); + } else if (op === '$pullDocs') { + const pullOp = atomics['$pull'] || (atomics['$pull'] = {}); + if (val[0] instanceof ArraySubdocument) { + selector = pullOp['$or'] || (pullOp['$or'] = []); + Array.prototype.push.apply(selector, val.map(v => { + return v.toObject({ + transform: (doc, ret) => { + if (v == null || v.$__ == null) { + return ret; + } + + Object.keys(v.$__.activePaths.getStatePaths('default')).forEach(path => { + mpath.unset(path, ret); + + _minimizePath(ret, path); + }); + + return ret; + }, + virtuals: false + }); + })); + } else { + selector = pullOp['_id'] || (pullOp['_id'] = { $in: [] }); + selector['$in'] = selector['$in'].concat(val); + } + } else if (op === '$push') { + atomics.$push = atomics.$push || { $each: [] }; + if (val != null && utils.hasUserDefinedProperty(val, '$each')) { + atomics.$push = val; + } else { + if (val.length === 1) { + atomics.$push.$each.push(val[0]); + } else if (val.length < 10000) { + atomics.$push.$each.push(...val); + } else { + for (const v of val) { + atomics.$push.$each.push(v); + } + } + } + } else { + atomics[op] = val; + } + + return this; + }, + + /** + * Adds values to the array if not already present. + * + * #### Example: + * + * console.log(doc.array) // [2,3,4] + * const added = doc.array.addToSet(4,5); + * console.log(doc.array) // [2,3,4,5] + * console.log(added) // [5] + * + * @param {...any} [args] + * @return {Array} the values that were added + * @memberOf MongooseArray + * @api public + * @method addToSet + */ + + addToSet() { + _checkManualPopulation(this, arguments); + _depopulateIfNecessary(this, arguments); + + const values = [].map.call(arguments, this._mapCast, this); + const added = []; + let type = ''; + if (values[0] instanceof ArraySubdocument) { + type = 'doc'; + } else if (values[0] instanceof Date) { + type = 'date'; + } else if (isBsonType(values[0], 'ObjectId')) { + type = 'ObjectId'; + } + + const rawValues = utils.isMongooseArray(values) ? values.__array : values; + const rawArray = utils.isMongooseArray(this) ? this.__array : this; + + rawValues.forEach(function(v) { + let found; + const val = +v; + switch (type) { + case 'doc': + found = this.some(function(doc) { + return doc.equals(v); + }); + break; + case 'date': + found = this.some(function(d) { + return +d === val; + }); + break; + case 'ObjectId': + found = this.find(o => o.toString() === v.toString()); + break; + default: + found = ~this.indexOf(v); + break; + } + + if (!found) { + this._markModified(); + rawArray.push(v); + this._registerAtomic('$addToSet', v); + [].push.call(added, v); + } + }, this); + + return added; + }, + + /** + * Returns the number of pending atomic operations to send to the db for this array. + * + * @api private + * @return {number} + * @method hasAtomics + * @memberOf MongooseArray + */ + + hasAtomics() { + if (!utils.isPOJO(this[arrayAtomicsSymbol])) { + return 0; + } + + return Object.keys(this[arrayAtomicsSymbol]).length; + }, + + /** + * Return whether or not the `obj` is included in the array. + * + * @param {object} obj the item to check + * @param {number} fromIndex + * @return {boolean} + * @api public + * @method includes + * @memberOf MongooseArray + */ + + includes(obj, fromIndex) { + const ret = this.indexOf(obj, fromIndex); + return ret !== -1; + }, + + /** + * Return the index of `obj` or `-1` if not found. + * + * @param {object} obj the item to look for + * @param {number} fromIndex + * @return {number} + * @api public + * @method indexOf + * @memberOf MongooseArray + */ + + indexOf(obj, fromIndex) { + if (isBsonType(obj, 'ObjectId')) { + obj = obj.toString(); + } + + fromIndex = fromIndex == null ? 0 : fromIndex; + const len = this.length; + for (let i = fromIndex; i < len; ++i) { + if (obj == this[i]) { + return i; + } + } + return -1; + }, + + /** + * Helper for console.log + * + * @api public + * @method inspect + * @memberOf MongooseArray + */ + + inspect() { + return JSON.stringify(this); + }, + + /** + * Pushes items to the array non-atomically. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @param {...any} [args] + * @api public + * @method nonAtomicPush + * @memberOf MongooseArray + */ + + nonAtomicPush() { + const values = [].map.call(arguments, this._mapCast, this); + this._markModified(); + const ret = [].push.apply(this, values); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Wraps [`Array#pop`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/pop) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified which will pass the entire thing to $set potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @see MongooseArray#$pop https://mongoosejs.com/docs/api/array.html#MongooseArray.prototype.$pop() + * @api public + * @method pop + * @memberOf MongooseArray + */ + + pop() { + this._markModified(); + const ret = [].pop.call(this); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Pulls items from the array atomically. Equality is determined by casting + * the provided value to an embedded document and comparing using + * [the `Document.equals()` function.](https://mongoosejs.com/docs/api/document.html#Document.prototype.equals()) + * + * #### Example: + * + * doc.array.pull(ObjectId) + * doc.array.pull({ _id: 'someId' }) + * doc.array.pull(36) + * doc.array.pull('tag 1', 'tag 2') + * + * To remove a document from a subdocument array we may pass an object with a matching `_id`. + * + * doc.subdocs.push({ _id: 4815162342 }) + * doc.subdocs.pull({ _id: 4815162342 }) // removed + * + * Or we may passing the _id directly and let mongoose take care of it. + * + * doc.subdocs.push({ _id: 4815162342 }) + * doc.subdocs.pull(4815162342); // works + * + * The first pull call will result in a atomic operation on the database, if pull is called repeatedly without saving the document, a $set operation is used on the complete array instead, overwriting possible changes that happened on the database in the meantime. + * + * @param {...any} [args] + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pull/ + * @api public + * @method pull + * @memberOf MongooseArray + */ + + pull() { + const values = [].map.call(arguments, (v, i) => this._cast(v, i, { defaults: false }), this); + let cur = this; + if (utils.isMongooseArray(cur)) { + cur = cur.__array; + } + let i = cur.length; + let mem; + this._markModified(); + + while (i--) { + mem = cur[i]; + if (mem instanceof Document) { + const some = values.some(function(v) { + return mem.equals(v); + }); + if (some) { + cur.splice(i, 1); + } + } else if (~this.indexOf.call(values, mem)) { + cur.splice(i, 1); + } + } + + if (values[0] instanceof ArraySubdocument) { + this._registerAtomic('$pullDocs', values.map(function(v) { + const _id = v.$__getValue('_id'); + if (_id === undefined || v.$isDefault('_id')) { + return v; + } + return _id; + })); + } else { + this._registerAtomic('$pullAll', values); + } + + + // Might have modified child paths and then pulled, like + // `doc.children[1].name = 'test';` followed by + // `doc.children.remove(doc.children[0]);`. In this case we fall back + // to a `$set` on the whole array. See #3511 + if (cleanModifiedSubpaths(this[arrayParentSymbol], this[arrayPathSymbol]) > 0) { + this._registerAtomic('$set', this); + } + + return this; + }, + + /** + * Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. + * + * #### Example: + * + * const schema = Schema({ nums: [Number] }); + * const Model = mongoose.model('Test', schema); + * + * const doc = await Model.create({ nums: [3, 4] }); + * doc.nums.push(5); // Add 5 to the end of the array + * await doc.save(); + * + * // You can also pass an object with `$each` as the + * // first parameter to use MongoDB's `$position` + * doc.nums.push({ + * $each: [1, 2], + * $position: 0 + * }); + * doc.nums; // [1, 2, 3, 4, 5] + * + * @param {...object} [args] + * @api public + * @method push + * @memberOf MongooseArray + */ + + push() { + let values = arguments; + let atomic = values; + const isOverwrite = values[0] != null && + utils.hasUserDefinedProperty(values[0], '$each'); + const arr = utils.isMongooseArray(this) ? this.__array : this; + if (isOverwrite) { + atomic = values[0]; + values = values[0].$each; + } + + if (this[arraySchemaSymbol] == null) { + return _basePush.apply(this, values); + } + + _checkManualPopulation(this, values); + _depopulateIfNecessary(this, values); + + values = [].map.call(values, this._mapCast, this); + let ret; + const atomics = this[arrayAtomicsSymbol]; + this._markModified(); + if (isOverwrite) { + atomic.$each = values; + + if ((atomics.$push && atomics.$push.$each && atomics.$push.$each.length || 0) !== 0 && + atomics.$push.$position != atomic.$position) { + if (atomic.$position != null) { + [].splice.apply(arr, [atomic.$position, 0].concat(values)); + ret = arr.length; + } else { + ret = [].push.apply(arr, values); + } + + this._registerAtomic('$set', this); + } else if (atomic.$position != null) { + [].splice.apply(arr, [atomic.$position, 0].concat(values)); + ret = this.length; + } else { + ret = [].push.apply(arr, values); + } + } else { + atomic = values; + ret = _basePush.apply(arr, values); + } + + this._registerAtomic('$push', atomic); + + return ret; + }, + + /** + * Alias of [pull](https://mongoosejs.com/docs/api/array.html#MongooseArray.prototype.pull()) + * + * @see MongooseArray#pull https://mongoosejs.com/docs/api/array.html#MongooseArray.prototype.pull() + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pull/ + * @api public + * @memberOf MongooseArray + * @instance + * @method remove + */ + + remove() { + return this.pull.apply(this, arguments); + }, + + /** + * Sets the casted `val` at index `i` and marks the array modified. + * + * #### Example: + * + * // given documents based on the following + * const Doc = mongoose.model('Doc', new Schema({ array: [Number] })); + * + * const doc = new Doc({ array: [2,3,4] }) + * + * console.log(doc.array) // [2,3,4] + * + * doc.array.set(1,"5"); + * console.log(doc.array); // [2,5,4] // properly cast to number + * doc.save() // the change is saved + * + * // VS not using array#set + * doc.array[1] = "5"; + * console.log(doc.array); // [2,"5",4] // no casting + * doc.save() // change is not saved + * + * @return {Array} this + * @api public + * @method set + * @memberOf MongooseArray + */ + + set(i, val, skipModified) { + const arr = this.__array; + if (skipModified) { + arr[i] = val; + return this; + } + const value = methods._cast.call(this, val, i); + methods._markModified.call(this, i); + arr[i] = value; + return this; + }, + + /** + * Wraps [`Array#shift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + * + * #### Example: + * + * doc.array = [2,3]; + * const res = doc.array.shift(); + * console.log(res) // 2 + * console.log(doc.array) // [3] + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method shift + * @memberOf MongooseArray + */ + + shift() { + const arr = utils.isMongooseArray(this) ? this.__array : this; + this._markModified(); + const ret = [].shift.call(arr); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Wraps [`Array#sort`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method sort + * @memberOf MongooseArray + * @see MasteringJS: Array sort https://masteringjs.io/tutorials/fundamentals/array-sort + */ + + sort() { + const arr = utils.isMongooseArray(this) ? this.__array : this; + const ret = [].sort.apply(arr, arguments); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Wraps [`Array#splice`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice) with proper change tracking and casting. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method splice + * @memberOf MongooseArray + * @see MasteringJS: Array splice https://masteringjs.io/tutorials/fundamentals/array-splice + */ + + splice() { + let ret; + const arr = utils.isMongooseArray(this) ? this.__array : this; + + this._markModified(); + _checkManualPopulation(this, Array.prototype.slice.call(arguments, 2)); + + if (arguments.length) { + let vals; + if (this[arraySchemaSymbol] == null) { + vals = arguments; + } else { + vals = []; + for (let i = 0; i < arguments.length; ++i) { + vals[i] = i < 2 ? + arguments[i] : + this._cast(arguments[i], arguments[0] + (i - 2)); + } + } + + ret = [].splice.apply(arr, vals); + this._registerAtomic('$set', this); + } + + return ret; + }, + + /*! + * ignore + */ + + toBSON() { + return this.toObject(internalToObjectOptions); + }, + + /** + * Returns a native js Array. + * + * @param {object} options + * @return {Array} + * @api public + * @method toObject + * @memberOf MongooseArray + */ + + toObject(options) { + const arr = utils.isMongooseArray(this) ? this.__array : this; + if (options?.depopulate) { + options = clone(options); + options._isNested = true; + // Ensure return value is a vanilla array, because in Node.js 6+ `map()` + // is smart enough to use the inherited array's constructor. + return [].concat(arr).map(function(doc) { + return doc instanceof Document + ? doc.toObject(options) + : doc; + }); + } + + return [].concat(arr); + }, + + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + }, + /** + * Wraps [`Array#unshift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method unshift + * @memberOf MongooseArray + */ + + unshift() { + _checkManualPopulation(this, arguments); + + let values; + if (this[arraySchemaSymbol] == null) { + values = arguments; + } else { + values = [].map.call(arguments, this._cast, this); + } + + const arr = utils.isMongooseArray(this) ? this.__array : this; + this._markModified(); + [].unshift.apply(arr, values); + this._registerAtomic('$set', this); + return this.length; + } +}; + +/*! + * ignore + */ + +function _isAllSubdocs(docs, ref) { + if (!ref) { + return false; + } + + for (const arg of docs) { + if (arg == null) { + return false; + } + const model = arg.constructor; + if (!(arg instanceof Document) || + (model.modelName !== ref && model.baseModelName !== ref)) { + return false; + } + } + + return true; +} + +/*! + * Minimize _just_ empty objects along the path chain specified + * by `parts`, ignoring all other paths. Useful in cases where + * you want to minimize after unsetting a path. + * + * #### Example: + * + * const obj = { foo: { bar: { baz: {} } }, a: {} }; + * _minimizePath(obj, 'foo.bar.baz'); + * obj; // { a: {} } + */ + +function _minimizePath(obj, parts, i) { + if (typeof parts === 'string') { + if (parts.indexOf('.') === -1) { + return; + } + + parts = mpath.stringToParts(parts); + } + i = i || 0; + if (i >= parts.length) { + return; + } + if (obj == null || typeof obj !== 'object') { + return; + } + + _minimizePath(obj[parts[0]], parts, i + 1); + if (obj[parts[0]] != null && typeof obj[parts[0]] === 'object' && utils.hasOwnKeys(obj[parts[0]]) === false) { + delete obj[parts[0]]; + } +} + +/*! + * ignore + */ + +function _checkManualPopulation(arr, docs) { + const ref = arr == null ? + null : + arr[arraySchemaSymbol]?.embeddedSchemaType?.options?.ref || null; + if (arr.length === 0 && + docs.length !== 0) { + if (_isAllSubdocs(docs, ref)) { + arr[arrayParentSymbol].$populated(arr[arrayPathSymbol], [], { + [populateModelSymbol]: docs[0].constructor + }); + } + } +} + +/*! + * If `docs` isn't all instances of the right model, depopulate `arr` + */ + +function _depopulateIfNecessary(arr, docs) { + const ref = arr == null ? + null : + arr[arraySchemaSymbol]?.embeddedSchemaType?.options?.ref || null; + const parentDoc = arr[arrayParentSymbol]; + const path = arr[arrayPathSymbol]; + if (!ref || !parentDoc.populated(path)) { + return; + } + for (const doc of docs) { + if (doc == null) { + continue; + } + if (typeof doc !== 'object' || doc instanceof String || doc instanceof Number || doc instanceof Buffer || utils.isMongooseType(doc)) { + parentDoc.depopulate(path); + break; + } + } +} + +const returnVanillaArrayMethods = [ + 'filter', + 'flat', + 'flatMap', + 'map', + 'slice' +]; +for (const method of returnVanillaArrayMethods) { + if (Array.prototype[method] == null) { + continue; + } + + methods[method] = function() { + const _arr = utils.isMongooseArray(this) ? this.__array : this; + const arr = [].concat(_arr); + + return arr[method].apply(arr, arguments); + }; +} + +module.exports = methods; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/arraySubdocument.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/arraySubdocument.js new file mode 100644 index 00000000..6dc69aca --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/arraySubdocument.js @@ -0,0 +1,208 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const EventEmitter = require('events').EventEmitter; +const Subdocument = require('./subdocument'); +const utils = require('../utils'); + +const documentArrayParent = require('../helpers/symbols').documentArrayParent; + +/** + * A constructor. + * + * @param {object} obj js object returned from the db + * @param {MongooseDocumentArray} parentArr the parent array of this document + * @param {boolean} skipId + * @param {object} fields + * @param {number} index + * @inherits Document + * @api private + */ + +function ArraySubdocument(obj, parentArr, skipId, fields, index) { + if (utils.isMongooseDocumentArray(parentArr)) { + this.__parentArray = parentArr; + this[documentArrayParent] = parentArr.$parent(); + } else { + this.__parentArray = undefined; + this[documentArrayParent] = undefined; + } + this.$setIndex(index); + this.$__parent = this[documentArrayParent]; + + let options; + if (typeof skipId === 'object' && skipId != null) { + options = { isNew: true, ...skipId }; + skipId = undefined; + } else { + options = { isNew: true }; + } + + Subdocument.call(this, obj, fields, this[documentArrayParent], options); +} + +/*! + * Inherit from Subdocument + */ +ArraySubdocument.prototype = Object.create(Subdocument.prototype); +ArraySubdocument.prototype.constructor = ArraySubdocument; + +Object.defineProperty(ArraySubdocument.prototype, '$isSingleNested', { + configurable: false, + writable: false, + value: false +}); + +Object.defineProperty(ArraySubdocument.prototype, '$isDocumentArrayElement', { + configurable: false, + writable: false, + value: true +}); + +for (const i in EventEmitter.prototype) { + ArraySubdocument[i] = EventEmitter.prototype[i]; +} + +/*! + * ignore + */ + +ArraySubdocument.prototype.$setIndex = function(index) { + this.__index = index; + + if (this.$__?.validationError != null) { + const keys = Object.keys(this.$__.validationError.errors); + for (const key of keys) { + this.invalidate(key, this.$__.validationError.errors[key]); + } + } +}; + +/*! + * ignore + */ + +ArraySubdocument.prototype.populate = function() { + throw new Error('Mongoose does not support calling populate() on nested ' + + 'docs. Instead of `doc.arr[0].populate("path")`, use ' + + '`doc.populate("arr.0.path")`'); +}; + +/*! + * ignore + */ + +ArraySubdocument.prototype.$__removeFromParent = function() { + const _id = this._doc._id; + if (!_id) { + throw new Error('For your own good, Mongoose does not know ' + + 'how to remove an ArraySubdocument that has no _id'); + } + this.__parentArray.pull({ _id: _id }); +}; + +/** + * Returns the full path to this document. If optional `path` is passed, it is appended to the full path. + * + * @param {string} [path] + * @param {boolean} [skipIndex] Skip adding the array index. For example `arr.foo` instead of `arr.0.foo`. + * @return {string} + * @api private + * @method $__fullPath + * @memberOf ArraySubdocument + * @instance + */ + +ArraySubdocument.prototype.$__fullPath = function(path, skipIndex) { + if (this.__index == null) { + return null; + } + if (!this.$__.fullPath) { + this.ownerDocument(); + } + + if (skipIndex) { + return path ? + this.$__.fullPath + '.' + path : + this.$__.fullPath; + } + + return path ? + this.$__.fullPath + '.' + this.__index + '.' + path : + this.$__.fullPath + '.' + this.__index; +}; + +/** + * Given a path relative to this document, return the path relative + * to the top-level document. + * @method $__pathRelativeToParent + * @memberOf ArraySubdocument + * @instance + * @api private + */ + +ArraySubdocument.prototype.$__pathRelativeToParent = function(path, skipIndex) { + if (this.__index == null || !this.__parentArray?.$path) { + return null; + } + if (skipIndex) { + return path == null ? this.__parentArray.$path() : this.__parentArray.$path() + '.' + path; + } + if (path == null) { + return this.__parentArray.$path() + '.' + this.__index; + } + return this.__parentArray.$path() + '.' + this.__index + '.' + path; +}; + +/** + * Returns this sub-documents parent document. + * @method $parent + * @memberOf ArraySubdocument + * @instance + * @api public + */ + +ArraySubdocument.prototype.$parent = function() { + return this[documentArrayParent]; +}; + +/*! + * Sets this sub-documents parent document. + * + * @api private + */ + +ArraySubdocument.prototype.$__setParent = function $__setParent(parent) { + this[documentArrayParent] = parent; + this.$__parent = parent; +}; + +/** + * Returns this subdocument's parent array. + * + * #### Example: + * + * const Test = mongoose.model('Test', new Schema({ + * docArr: [{ name: String }] + * })); + * const doc = new Test({ docArr: [{ name: 'test subdoc' }] }); + * + * doc.docArr[0].parentArray() === doc.docArr; // true + * + * @api public + * @method parentArray + * @returns {DocumentArray} + */ + +ArraySubdocument.prototype.parentArray = function() { + return this.__parentArray; +}; + +/*! + * Module exports. + */ + +module.exports = ArraySubdocument; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/buffer.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/buffer.js new file mode 100644 index 00000000..e9692c52 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/buffer.js @@ -0,0 +1,294 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const Binary = require('mongodb/lib/bson').Binary; +const UUID = require('mongodb/lib/bson').UUID; +const utils = require('../utils'); + +/** + * Mongoose Buffer constructor. + * + * Values always have to be passed to the constructor to initialize. + * + * @param {Buffer} value + * @param {string} encode + * @param {number} offset + * @api private + * @inherits Buffer https://nodejs.org/api/buffer.html + * @see https://bit.ly/f6CnZU + */ + +function MongooseBuffer(value, encode, offset) { + let val = value; + if (value == null) { + val = 0; + } + + let encoding; + let path; + let doc; + + if (Array.isArray(encode)) { + // internal casting + path = encode[0]; + doc = encode[1]; + } else { + encoding = encode; + } + + let buf; + if (typeof val === 'number' || val instanceof Number) { + buf = Buffer.alloc(val); + } else { // string, array or object { type: 'Buffer', data: [...] } + buf = Buffer.from(val, encoding, offset); + } + utils.decorate(buf, MongooseBuffer.mixin); + buf.isMongooseBuffer = true; + + // make sure these internal props don't show up in Object.keys() + buf[MongooseBuffer.pathSymbol] = path; + buf[parentSymbol] = doc; + + buf._subtype = 0; + return buf; +} + +const pathSymbol = Symbol.for('mongoose#Buffer#_path'); +const parentSymbol = Symbol.for('mongoose#Buffer#_parent'); +MongooseBuffer.pathSymbol = pathSymbol; + +/*! + * Inherit from Buffer. + */ + +MongooseBuffer.mixin = { + + /** + * Default subtype for the Binary representing this Buffer + * + * @api private + * @property _subtype + * @memberOf MongooseBuffer.mixin + * @static + */ + + _subtype: undefined, + + /** + * Marks this buffer as modified. + * + * @api private + * @method _markModified + * @memberOf MongooseBuffer.mixin + * @static + */ + + _markModified: function() { + const parent = this[parentSymbol]; + + if (parent) { + parent.markModified(this[MongooseBuffer.pathSymbol]); + } + return this; + }, + + /** + * Writes the buffer. + * + * @api public + * @method write + * @memberOf MongooseBuffer.mixin + * @static + */ + + write: function() { + const written = Buffer.prototype.write.apply(this, arguments); + + if (written > 0) { + this._markModified(); + } + + return written; + }, + + /** + * Copies the buffer. + * + * #### Note: + * + * `Buffer#copy` does not mark `target` as modified so you must copy from a `MongooseBuffer` for it to work as expected. This is a work around since `copy` modifies the target, not this. + * + * @return {number} The number of bytes copied. + * @param {Buffer} target + * @method copy + * @memberOf MongooseBuffer.mixin + * @static + */ + + copy: function(target) { + const ret = Buffer.prototype.copy.apply(this, arguments); + + if (target?.isMongooseBuffer) { + target._markModified(); + } + + return ret; + } +}; + +/*! + * Compile other Buffer methods marking this buffer as modified. + */ + +utils.each( + [ + // node < 0.5 + 'writeUInt8', 'writeUInt16', 'writeUInt32', 'writeInt8', 'writeInt16', 'writeInt32', + 'writeFloat', 'writeDouble', 'fill', + 'utf8Write', 'binaryWrite', 'asciiWrite', 'set', + + // node >= 0.5 + 'writeUInt16LE', 'writeUInt16BE', 'writeUInt32LE', 'writeUInt32BE', + 'writeInt16LE', 'writeInt16BE', 'writeInt32LE', 'writeInt32BE', 'writeFloatLE', 'writeFloatBE', 'writeDoubleLE', 'writeDoubleBE'] + , function(method) { + if (!Buffer.prototype[method]) { + return; + } + MongooseBuffer.mixin[method] = function() { + const ret = Buffer.prototype[method].apply(this, arguments); + this._markModified(); + return ret; + }; + }); + +/** + * Converts this buffer to its Binary type representation. + * + * #### SubTypes: + * + * const mongodb = require('mongodb') + * mongodb.BSON.BSON_BINARY_SUBTYPE_DEFAULT + * mongodb.BSON.BSON_BINARY_SUBTYPE_FUNCTION + * mongodb.BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY + * mongodb.BSON.BSON_BINARY_SUBTYPE_UUID + * mongodb.BSON.BSON_BINARY_SUBTYPE_MD5 + * mongodb.BSON.BSON_BINARY_SUBTYPE_USER_DEFINED + * doc.buffer.toObject(mongodb.BSON.BSON_BINARY_SUBTYPE_USER_DEFINED); + * + * @see bsonspec https://bsonspec.org/#/specification + * @param {Hex} [subtype] + * @return {Binary} + * @api public + * @method toObject + * @memberOf MongooseBuffer + */ + +MongooseBuffer.mixin.toObject = function(options) { + const subtype = typeof options === 'number' + ? options + : (this._subtype || 0); + return new Binary(Buffer.from(this), subtype); +}; + +MongooseBuffer.mixin.$toObject = MongooseBuffer.mixin.toObject; + +/** + * Converts this buffer for storage in MongoDB, including subtype + * + * @return {Binary} + * @api public + * @method toBSON + * @memberOf MongooseBuffer + */ + +MongooseBuffer.mixin.toBSON = function() { + return new Binary(this, this._subtype || 0); +}; + +/** + * Converts this buffer to a UUID. Throws an error if subtype is not 4. + * + * @return {UUID} + * @api public + * @method toUUID + * @memberOf MongooseBuffer + */ + +MongooseBuffer.mixin.toUUID = function() { + if (this._subtype !== 4) { + throw new Error('Cannot convert a Buffer with subtype ' + this._subtype + ' to a UUID'); + } + return new UUID(this); +}; + +/** + * Determines if this buffer is equals to `other` buffer + * + * @param {Buffer} other + * @return {boolean} + * @method equals + * @memberOf MongooseBuffer + */ + +MongooseBuffer.mixin.equals = function(other) { + if (!Buffer.isBuffer(other)) { + return false; + } + + if (this.length !== other.length) { + return false; + } + + for (let i = 0; i < this.length; ++i) { + if (this[i] !== other[i]) { + return false; + } + } + + return true; +}; + +/** + * Sets the subtype option and marks the buffer modified. + * + * #### SubTypes: + * + * const bson = require('bson') + * bson.BSON_BINARY_SUBTYPE_DEFAULT + * bson.BSON_BINARY_SUBTYPE_FUNCTION + * bson.BSON_BINARY_SUBTYPE_BYTE_ARRAY + * bson.BSON_BINARY_SUBTYPE_UUID + * bson.BSON_BINARY_SUBTYPE_MD5 + * bson.BSON_BINARY_SUBTYPE_USER_DEFINED + * + * doc.buffer.subtype(bson.BSON_BINARY_SUBTYPE_UUID); + * + * @see bsonspec https://bsonspec.org/#/specification + * @param {Hex} subtype + * @api public + * @method subtype + * @memberOf MongooseBuffer + */ + +MongooseBuffer.mixin.subtype = function(subtype) { + if (typeof subtype !== 'number') { + throw new TypeError('Invalid subtype. Expected a number'); + } + + if (this._subtype !== subtype) { + this._markModified(); + } + + this._subtype = subtype; +}; + +/*! + * Module exports. + */ + +MongooseBuffer.Binary = Binary; + +module.exports = MongooseBuffer; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/decimal128.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/decimal128.js new file mode 100644 index 00000000..ab7b27b0 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/decimal128.js @@ -0,0 +1,13 @@ +/** + * Decimal128 type constructor + * + * #### Example: + * + * const id = new mongoose.Types.Decimal128('3.1415'); + * + * @constructor Decimal128 + */ + +'use strict'; + +module.exports = require('mongodb/lib/bson').Decimal128; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/index.js new file mode 100644 index 00000000..93e2a583 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/index.js @@ -0,0 +1,113 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ArrayMethods = require('../array/methods'); +const DocumentArrayMethods = require('./methods'); + +const arrayAtomicsSymbol = require('../../helpers/symbols').arrayAtomicsSymbol; +const arrayAtomicsBackupSymbol = require('../../helpers/symbols').arrayAtomicsBackupSymbol; +const arrayParentSymbol = require('../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../helpers/symbols').arraySchemaSymbol; + +const _basePush = Array.prototype.push; +const numberRE = /^\d+$/; +/** + * DocumentArray constructor + * + * @param {Array} values + * @param {string} path the path to this array + * @param {Document} doc parent document + * @api private + * @return {MongooseDocumentArray} + * @inherits MongooseArray + * @see https://bit.ly/f6CnZU + */ + +function MongooseDocumentArray(values, path, doc, schematype) { + const __array = []; + + const internals = { + [arrayAtomicsSymbol]: {}, + [arrayAtomicsBackupSymbol]: void 0, + [arrayPathSymbol]: path, + [arraySchemaSymbol]: void 0, + [arrayParentSymbol]: void 0 + }; + + if (Array.isArray(values)) { + if (values[arrayPathSymbol] === path && + values[arrayParentSymbol] === doc) { + internals[arrayAtomicsSymbol] = Object.assign({}, values[arrayAtomicsSymbol]); + } + values.forEach(v => { + _basePush.call(__array, v); + }); + } + internals[arrayPathSymbol] = path; + internals.__array = __array; + + if (doc?.$__) { + internals[arrayParentSymbol] = doc; + internals[arraySchemaSymbol] = doc.$__schema.path(path); + + // `schema.path()` doesn't drill into nested arrays properly yet, see + // gh-6398, gh-6602. This is a workaround because nested arrays are + // always plain non-document arrays, so once you get to a document array + // nesting is done. Matryoshka code. + while (internals[arraySchemaSymbol] != null && + internals[arraySchemaSymbol].$isMongooseArray && + !internals[arraySchemaSymbol].$isMongooseDocumentArray) { + internals[arraySchemaSymbol] = internals[arraySchemaSymbol].embeddedSchemaType; + } + } + + const proxy = new Proxy(__array, { + get: function(target, prop) { + if (prop === 'isMongooseArray' || + prop === 'isMongooseArrayProxy' || + prop === 'isMongooseDocumentArray' || + prop === 'isMongooseDocumentArrayProxy') { + return true; + } + if (Object.hasOwn(internals, prop)) { + return internals[prop]; + } + if (Object.hasOwn(DocumentArrayMethods, prop)) { + return DocumentArrayMethods[prop]; + } + if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + return schematype.virtuals[prop].applyGetters(undefined, target); + } + if (Object.hasOwn(ArrayMethods, prop)) { + return ArrayMethods[prop]; + } + + return __array[prop]; + }, + set: function(target, prop, value) { + if (typeof prop === 'string' && numberRE.test(prop)) { + DocumentArrayMethods.set.call(proxy, prop, value, false); + } else if (Object.hasOwn(internals, prop)) { + internals[prop] = value; + } else if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + schematype.virtuals[prop].applySetters(value, target); + } else { + __array[prop] = value; + } + + return true; + } + }); + + return proxy; +} + +/*! + * Module exports. + */ + +module.exports = MongooseDocumentArray; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js new file mode 100644 index 00000000..6e6a1690 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.isMongooseDocumentArray = function(mongooseDocumentArray) { + return Array.isArray(mongooseDocumentArray) && mongooseDocumentArray.isMongooseDocumentArray; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/methods/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/methods/index.js new file mode 100644 index 00000000..886e9ac3 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/documentArray/methods/index.js @@ -0,0 +1,549 @@ +'use strict'; + +const ArrayMethods = require('../../array/methods'); +const Document = require('../../../document'); +const getDiscriminatorByValue = require('../../../helpers/discriminator/getDiscriminatorByValue'); +const internalToObjectOptions = require('../../../options').internalToObjectOptions; +const utils = require('../../../utils'); +const isBsonType = require('../../../helpers/isBsonType'); + +const arrayParentSymbol = require('../../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../../helpers/symbols').arraySchemaSymbol; +const documentArrayParent = require('../../../helpers/symbols').documentArrayParent; + +const _baseReverse = Array.prototype.reverse; +const _baseToString = Array.prototype.toString; + +const methods = { + /*! + * ignore + */ + + toBSON() { + return this.toObject(internalToObjectOptions); + }, + + toString() { + return _baseToString.call(this.__array.map(subdoc => { + if (subdoc?.$__ != null) { + return subdoc.toString(); + } + return subdoc; + })); + }, + + /*! + * ignore + */ + + getArrayParent() { + return this[arrayParentSymbol]; + }, + + /*! + * ignore + */ + $schemaType() { + return this[arraySchemaSymbol]; + }, + + /** + * Overrides MongooseArray#cast + * + * @method _cast + * @api private + * @memberOf MongooseDocumentArray + */ + + _cast(value, index, options) { + if (this[arraySchemaSymbol] == null) { + return value; + } + let Constructor = this[arraySchemaSymbol].Constructor; + const isInstance = Constructor.$isMongooseDocumentArray ? + utils.isMongooseDocumentArray(value) : + value instanceof Constructor; + if (isInstance || + // Hack re: #5001, see #5005 + value?.constructor?.baseCasterConstructor === Constructor) { + if (!(value[documentArrayParent] && value.__parentArray)) { + // value may have been created using array.create() + value[documentArrayParent] = this[arrayParentSymbol]; + value.__parentArray = this; + } + value.$setIndex(index); + return value; + } + + if (value == null) { + return null; + } + + // handle cast('string') or cast(ObjectId) etc. + // only objects are permitted so we can safely assume that + // non-objects are to be interpreted as _id + if (Buffer.isBuffer(value) || + isBsonType(value, 'ObjectId') || !utils.isObject(value)) { + value = { _id: value }; + } + + if (value && + Constructor.discriminators && + Constructor.schema && + Constructor.schema.options && + Constructor.schema.options.discriminatorKey) { + if (typeof value[Constructor.schema.options.discriminatorKey] === 'string' && + Constructor.discriminators[value[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[value[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, value[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + + if (Constructor.$isMongooseDocumentArray) { + return Constructor.cast(value, this, undefined, undefined, index); + } + const ret = new Constructor(value, this, options, undefined, index); + ret.isNew = true; + return ret; + }, + + /** + * Searches array items for the first document with a matching _id. + * + * #### Example: + * + * const embeddedDoc = m.array.id(some_id); + * + * @return {EmbeddedDocument|null} the subdocument or null if not found. + * @param {ObjectId|string|number|Buffer} id + * @method id + * @api public + * @memberOf MongooseDocumentArray + */ + + id(id) { + if (id == null) { + return null; + } + + const schemaType = this[arraySchemaSymbol]; + let idSchemaType = null; + + if (schemaType?.schema) { + idSchemaType = schemaType.schema.path('_id'); + } else if (schemaType?.casterConstructor?.schema) { + idSchemaType = schemaType.casterConstructor.schema.path('_id'); + } + + let castedId = null; + if (idSchemaType) { + try { + castedId = idSchemaType.cast(id); + } catch { + // ignore error + } + } + + let _id; + + for (const val of this) { + if (!val) { + continue; + } + + _id = val.get('_id'); + + if (_id == null) { + continue; + } else if (_id instanceof Document) { + _id = _id.get('_id'); + if (castedId != null && utils.deepEqual(castedId, _id)) { + return val; + } else if (castedId == null && (id == _id || utils.deepEqual(id, _id))) { + // Backwards compat: compare user-specified param to _id using loose equality + return val; + } + } else if (castedId != null && utils.deepEqual(castedId, _id)) { + return val; + } else if (castedId == null && (_id == id || utils.deepEqual(id, _id))) { + // Backwards compat: compare user-specified param to _id using loose equality + return val; + } + } + + return null; + }, + + /** + * Returns a native js Array of plain js objects + * + * #### Note: + * + * _Each sub-document is converted to a plain object by calling its `#toObject` method._ + * + * @param {object} [options] optional options to pass to each documents `toObject` method call during conversion + * @return {Array} + * @method toObject + * @api public + * @memberOf MongooseDocumentArray + */ + + toObject(options) { + // `[].concat` coerces the return value into a vanilla JS array, rather + // than a Mongoose array. + return [].concat(this.map(function(doc) { + if (doc == null) { + return null; + } + if (typeof doc.toObject !== 'function') { + return doc; + } + return doc.toObject(options); + })); + }, + + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + }, + + /** + * Wraps [`MongooseArray#addToSet`](https://mongoosejs.com/docs/api/array.html#MongooseArray.prototype.addToSet()) + * with proper change tracking. + * + * @param {...object} [args] + * @api public + * @method addToSet + * @memberOf MongooseDocumentArray + */ + + addToSet() { + // Arguments are cast before duplicates are skipped, so any value added + // after a skipped duplicate is cast with an index that is too high. + const ret = ArrayMethods.addToSet.apply(this, arguments); + + _updateSubdocIndexes(this); + + return ret; + }, + + /** + * Wraps [`Array#push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. + * + * @param {...object} [args] + * @api public + * @method push + * @memberOf MongooseDocumentArray + */ + + push() { + const shouldReindex = _shouldReindexAfterPush(arguments); + const ret = ArrayMethods.push.apply(this, arguments); + + if (shouldReindex) { + _updateSubdocIndexes(this); + } + _updateParentPopulated(this); + + return ret; + }, + + /** + * Wraps [`Array#pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) with proper change tracking. + * @api private + */ + + pop() { + const ret = ArrayMethods.pop.apply(this, arguments); + + _updateParentPopulated(this); + + return ret; + }, + + /*! + * ignore + */ + + $pop() { + const ret = ArrayMethods.$pop.apply(this, arguments); + + _updateParentPopulated(this); + + return ret; + }, + + /** + * Pulls items from the array atomically. + * + * @param {...object} [args] + * @api public + * @method pull + * @memberOf MongooseDocumentArray + */ + + pull() { + const ret = ArrayMethods.pull.apply(this, arguments); + + _updateSubdocIndexes(this); + _updateParentPopulated(this); + + return ret; + }, + + /** + * Wraps [`Array#shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) with proper change tracking. + * @api private + */ + + shift() { + const ret = ArrayMethods.shift.apply(this, arguments); + + _updateSubdocIndexes(this); + _updateParentPopulated(this); + + return ret; + }, + + /*! + * ignore + */ + + $shift() { + const ret = ArrayMethods.$shift.apply(this, arguments); + + _updateSubdocIndexes(this); + _updateParentPopulated(this); + + return ret; + }, + + /** + * Wraps [`Array#splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) with proper change tracking and casting. + * @api private + */ + + splice() { + const ret = ArrayMethods.splice.apply(this, arguments); + + _updateSubdocIndexes(this); + _updateParentPopulated(this); + + return ret; + }, + + /** + * Wraps [`Array#reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) + * with proper change tracking. + * @api private + */ + + reverse() { + _baseReverse.call(this.__array); + this._registerAtomic('$set', this); + + _updateSubdocIndexes(this); + _updateParentPopulated(this); + + return this; + }, + + /** + * Wraps [`Array#sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) + * with proper change tracking. + * + * @param {Function} [compareFunction] + * @api private + */ + + sort() { + const ret = ArrayMethods.sort.apply(this, arguments); + + _updateSubdocIndexes(this); + _updateParentPopulated(this); + + return ret; + }, + + /** + * Wraps [`Array#unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) + * with proper change tracking. + * @api private + */ + + unshift() { + const ret = ArrayMethods.unshift.apply(this, arguments); + + _updateSubdocIndexes(this); + _updateParentPopulated(this); + + return ret; + }, + + /** + * Helper for console.log + * + * @method inspect + * @api public + * @memberOf MongooseDocumentArray + */ + + inspect() { + return this.toObject(); + }, + + /** + * Creates a subdocument casted to this schema. + * + * This is the same subdocument constructor used for casting. + * + * @param {object} obj the value to cast to this arrays SubDocument schema + * @method create + * @api public + * @memberOf MongooseDocumentArray + */ + + create(obj) { + let Constructor = this[arraySchemaSymbol].Constructor; + if (obj && + Constructor.discriminators && + Constructor.schema && + Constructor.schema.options && + Constructor.schema.options.discriminatorKey) { + if (typeof obj[Constructor.schema.options.discriminatorKey] === 'string' && + Constructor.discriminators[obj[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[obj[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, obj[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + + return new Constructor(obj, this); + }, + + /*! + * ignore + */ + + notify(event) { + const _this = this; + return function notify(val, _arr) { + _arr = _arr || _this; + let i = _arr.length; + while (i--) { + if (_arr[i] == null) { + continue; + } + switch (event) { + // only swap for save event for now, we may change this to all event types later + case 'save': + val = _this[i]; + break; + default: + // NO-OP + break; + } + + if (utils.isMongooseArray(_arr[i])) { + notify(val, _arr[i]); + } else if (_arr[i]) { + _arr[i].emit(event, val); + } + } + }; + }, + + set(i, val, skipModified) { + const arr = this.__array; + if (skipModified) { + arr[i] = val; + return this; + } + const value = methods._cast.call(this, val, i); + methods._markModified.call(this, i); + arr[i] = value; + return this; + }, + + _markModified(elem, embeddedPath) { + const parent = this[arrayParentSymbol]; + let dirtyPath; + + if (parent) { + dirtyPath = this[arrayPathSymbol]; + + if (arguments.length) { + if (embeddedPath != null) { + // an embedded doc bubbled up the change + const index = elem.__index; + dirtyPath = dirtyPath + '.' + index + '.' + embeddedPath; + } else { + // directly set an index + dirtyPath = dirtyPath + '.' + elem; + } + } + + if (dirtyPath != null && dirtyPath.endsWith('.$')) { + return this; + } + + parent.markModified(dirtyPath, arguments.length !== 0 ? elem : parent); + } + + return this; + } +}; + +module.exports = methods; + +/*! + * ignore + */ + +function _updateSubdocIndexes(arr) { + const rawArray = utils.isMongooseArray(arr) ? arr.__array : arr; + + for (let i = 0; i < rawArray.length; ++i) { + if (typeof rawArray[i]?.$setIndex === 'function') { + rawArray[i].$setIndex(i); + } + } +} + +function _shouldReindexAfterPush(args) { + return args[0] != null && + utils.hasUserDefinedProperty(args[0], '$each') && + args[0].$position != null; +} + +/** + * If this is a document array, each element may contain single + * populated paths, so we need to modify the top-level document's + * populated cache. See gh-8247, gh-8265. + * @param {Array} arr + * @api private + */ + +function _updateParentPopulated(arr) { + const parent = arr[arrayParentSymbol]; + if (!parent || parent.$__.populated == null) return; + + const populatedPaths = Object.keys(parent.$__.populated). + filter(p => p.startsWith(arr[arrayPathSymbol] + '.')); + + for (const path of populatedPaths) { + const remnant = path.slice((arr[arrayPathSymbol] + '.').length); + if (!Array.isArray(parent.$__.populated[path].value)) { + continue; + } + + parent.$__.populated[path].value = arr.map(val => val.$populated(remnant)); + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/double.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/double.js new file mode 100644 index 00000000..65a38929 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/double.js @@ -0,0 +1,13 @@ +/** + * Double type constructor + * + * #### Example: + * + * const pi = new mongoose.Types.Double(3.1415); + * + * @constructor Double + */ + +'use strict'; + +module.exports = require('mongodb/lib/bson').Double; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/index.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/index.js new file mode 100644 index 00000000..8252aabf --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/index.js @@ -0,0 +1,23 @@ + +/*! + * Module exports. + */ + +'use strict'; + +exports.Array = require('./array'); +exports.Buffer = require('./buffer'); + +exports.Document = // @deprecate +exports.Embedded = require('./arraySubdocument'); + +exports.DocumentArray = require('./documentArray'); +exports.Double = require('./double'); +exports.Decimal128 = require('./decimal128'); +exports.ObjectId = require('./objectid'); + +exports.Map = require('./map'); + +exports.Subdocument = require('./subdocument'); + +exports.UUID = require('./uuid'); diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/map.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/map.js new file mode 100644 index 00000000..8912cc24 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/map.js @@ -0,0 +1,368 @@ +'use strict'; + +const Mixed = require('../schema/mixed'); +const MongooseError = require('../error/mongooseError'); +const clone = require('../helpers/clone'); +const deepEqual = require('../utils').deepEqual; +const getConstructorName = require('../helpers/getConstructorName'); +const handleSpreadDoc = require('../helpers/document/handleSpreadDoc'); +const util = require('util'); +const specialProperties = require('../helpers/specialProperties'); +const isBsonType = require('../helpers/isBsonType'); +const cleanModifiedSubpaths = require('../helpers/document/cleanModifiedSubpaths'); + +const populateModelSymbol = require('../helpers/symbols').populateModelSymbol; + +/*! + * ignore + */ + +class MongooseMap extends Map { + constructor(v, path, doc, schemaType) { + if (getConstructorName(v) === 'Object') { + v = Object.keys(v).reduce((arr, key) => arr.concat([[key, v[key]]]), []); + } + super(v); + this.$__parent = doc?.$__ != null ? doc : null; + this.$__path = path; + this.$__schemaType = schemaType == null ? new Mixed(path) : schemaType; + + this.$__runDeferred(); + } + + $init(key, value) { + checkValidKey(key); + + super.set(key, value); + + if (value?.$isSingleNested) { + value.$basePath = this.$__path + '.' + key; + } + } + + $__set(key, value) { + super.set(key, value); + } + + /** + * Overwrites native Map's `get()` function to support Mongoose getters. + * + * @api public + * @method get + * @memberOf Map + */ + + get(key, options) { + if (isBsonType(key, 'ObjectId')) { + key = key.toString(); + } + + options = options || {}; + if (options.getters === false) { + return super.get(key); + } + return this.$__schemaType.applyGetters(super.get(key), this.$__parent); + } + + /** + * Overwrites native Map's `set()` function to support setters, `populate()`, + * and change tracking. Note that Mongoose maps _only_ support strings and + * ObjectIds as keys. + * + * Keys also cannot: + * - be named after special properties `prototype`, `constructor`, and `__proto__` + * - start with a dollar sign (`$`) + * - contain any dots (`.`) + * + * #### Example: + * + * doc.myMap.set('test', 42); // works + * doc.myMap.set({ obj: 42 }, 42); // Throws "Mongoose maps only support string keys" + * doc.myMap.set(10, 42); // Throws "Mongoose maps only support string keys" + * doc.myMap.set("$test", 42); // Throws "Mongoose maps do not support keys that start with "$", got "$test"" + * + * @api public + * @method set + * @memberOf Map + */ + + set(key, value) { + if (isBsonType(key, 'ObjectId')) { + key = key.toString(); + } + + checkValidKey(key); + value = handleSpreadDoc(value); + + // Weird, but because you can't assign to `this` before calling `super()` + // you can't get access to `$__schemaType` to cast in the initial call to + // `set()` from the `super()` constructor. + + if (this.$__schemaType == null) { + this.$__deferred = this.$__deferred || []; + this.$__deferred.push({ key: key, value: value }); + return; + } + + let _fullPath; + const parent = this.$__parent; + const populated = parent?.$__?.populated ? + parent.$populated(fullPath.call(this), true) || parent.$populated(this.$__path, true) : + null; + const priorVal = this.get(key); + + if (populated != null) { + if (this.$__schemaType.$isSingleNested) { + throw new MongooseError( + 'Cannot manually populate single nested subdoc underneath Map ' + + `at path "${this.$__path}". Try using an array instead of a Map.` + ); + } + if (Array.isArray(value) && this.$__schemaType.$isMongooseArray) { + value = value.map(v => { + if (v.$__ == null) { + v = new populated.options[populateModelSymbol](v); + } + // Doesn't support single nested "in-place" populate + v.$__.wasPopulated = { value: v._doc._id }; + return v; + }); + } else if (value != null) { + if (value.$__ == null) { + value = new populated.options[populateModelSymbol](value); + } + // Doesn't support single nested "in-place" populate + value.$__.wasPopulated = { value: value._doc._id }; + } + } else { + try { + const options = this.$__schemaType.$isMongooseDocumentArray || this.$__schemaType.$isSingleNested || this.$__schemaType.$isMongooseArray || this.$__schemaType.$isSchemaMap ? + { path: fullPath.call(this) } : + null; + value = this.$__schemaType.applySetters( + value, + this.$__parent, + false, + this.get(key), + options + ); + } catch (error) { + if (this.$__parent?.$__ != null) { + this.$__parent.invalidate(fullPath.call(this), error); + return; + } + throw error; + } + } + + super.set(key, value); + + if (parent?.$__ != null && !deepEqual(value, priorVal)) { + const path = fullPath.call(this); + parent.markModified(path); + // If overwriting the full document array or subdoc, make sure to clean up any paths that were modified + // before re: #15108 + if (this.$__schemaType.$isMongooseDocumentArray || this.$__schemaType.$isSingleNested) { + cleanModifiedSubpaths(parent, path); + } + } + + // Delay calculating full path unless absolutely necessary, because string + // concatenation is a bottleneck re: #13171 + function fullPath() { + if (_fullPath) { + return _fullPath; + } + _fullPath = this.$__path + '.' + key; + return _fullPath; + } + } + + /** + * Overwrites native Map's `clear()` function to support change tracking. + * + * @api public + * @method clear + * @memberOf Map + */ + + clear() { + super.clear(); + const parent = this.$__parent; + if (parent != null) { + parent.markModified(this.$__path); + } + } + + /** + * Overwrites native Map's `delete()` function to support change tracking. + * + * @api public + * @method delete + * @memberOf Map + */ + + delete(key) { + if (isBsonType(key, 'ObjectId')) { + key = key.toString(); + } + + this.set(key, undefined); + return super.delete(key); + } + + /** + * Converts this map to a native JavaScript Map so the MongoDB driver can serialize it. + * + * @api public + * @method toBSON + * @memberOf Map + */ + + toBSON() { + return new Map(this); + } + + toObject(options) { + if (options?.flattenMaps) { + const ret = {}; + const keys = this.keys(); + for (const key of keys) { + ret[key] = clone(this.get(key), options); + } + return ret; + } + + return new Map(this); + } + + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + } + + /** + * Converts this map to a native JavaScript Map for `JSON.stringify()`. Set + * the `flattenMaps` option to convert this map to a POJO instead. + * + * #### Example: + * + * doc.myMap.toJSON() instanceof Map; // true + * doc.myMap.toJSON({ flattenMaps: true }) instanceof Map; // false + * + * @api public + * @method toJSON + * @param {object} [options] + * @param {boolean} [options.flattenMaps=false] set to `true` to convert the map to a POJO rather than a native JavaScript map + * @memberOf Map + */ + + toJSON(options) { + if (typeof options?.flattenMaps === 'boolean' ? options.flattenMaps : true) { + const ret = {}; + const keys = this.keys(); + for (const key of keys) { + ret[key] = clone(this.get(key), options); + } + return ret; + } + + return new Map(this); + } + + inspect() { + return new Map(this); + } + + $__runDeferred() { + if (!this.$__deferred) { + return; + } + + for (const keyValueObject of this.$__deferred) { + this.set(keyValueObject.key, keyValueObject.value); + } + + this.$__deferred = null; + } +} + +if (util.inspect.custom) { + Object.defineProperty(MongooseMap.prototype, util.inspect.custom, { + enumerable: false, + writable: false, + configurable: false, + value: MongooseMap.prototype.inspect + }); +} + +Object.defineProperty(MongooseMap.prototype, '$__set', { + enumerable: false, + writable: true, + configurable: false +}); + +Object.defineProperty(MongooseMap.prototype, '$__parent', { + enumerable: false, + writable: true, + configurable: false +}); + +Object.defineProperty(MongooseMap.prototype, '$__path', { + enumerable: false, + writable: true, + configurable: false +}); + +Object.defineProperty(MongooseMap.prototype, '$__schemaType', { + enumerable: false, + writable: true, + configurable: false +}); + +/** + * Set to `true` for all Mongoose map instances + * + * @api public + * @property $isMongooseMap + * @memberOf MongooseMap + * @instance + */ + +Object.defineProperty(MongooseMap.prototype, '$isMongooseMap', { + enumerable: false, + writable: false, + configurable: false, + value: true +}); + +Object.defineProperty(MongooseMap.prototype, '$__deferredCalls', { + enumerable: false, + writable: false, + configurable: false, + value: true +}); + +/** + * Since maps are stored as objects under the hood, keys must be strings + * and can't contain any invalid characters + * @param {string} key + * @api private + */ + +function checkValidKey(key) { + const keyType = typeof key; + if (keyType !== 'string') { + throw new TypeError(`Mongoose maps only support string keys, got ${keyType}`); + } + if (key.startsWith('$')) { + throw new Error(`Mongoose maps do not support keys that start with "$", got "${key}"`); + } + if (key.includes('.')) { + throw new Error(`Mongoose maps do not support keys that contain ".", got "${key}"`); + } + if (specialProperties.has(key)) { + throw new Error(`Mongoose maps do not support reserved key name "${key}"`); + } +} + +module.exports = MongooseMap; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/objectid.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/objectid.js new file mode 100644 index 00000000..f0a9b259 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/objectid.js @@ -0,0 +1,41 @@ +/** + * ObjectId type constructor + * + * #### Example: + * + * const id = new mongoose.Types.ObjectId; + * + * @constructor ObjectId + */ + +'use strict'; + +const ObjectId = require('mongodb/lib/bson').ObjectId; +const objectIdSymbol = require('../helpers/symbols').objectIdSymbol; + +/** + * Getter for convenience with populate, see gh-6115 + * @api private + */ + +Object.defineProperty(ObjectId.prototype, '_id', { + enumerable: false, + configurable: true, + get: function() { + return this; + } +}); + +/*! + * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299 + */ + +if (!Object.hasOwn(ObjectId.prototype, 'valueOf')) { + ObjectId.prototype.valueOf = function objectIdValueOf() { + return this.toString(); + }; +} + +ObjectId.prototype[objectIdSymbol] = true; + +module.exports = ObjectId; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/subdocument.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/subdocument.js new file mode 100644 index 00000000..a374dc7f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/subdocument.js @@ -0,0 +1,445 @@ +'use strict'; + +const Document = require('../document'); +const internalToObjectOptions = require('../options').internalToObjectOptions; +const util = require('util'); +const utils = require('../utils'); + +module.exports = Subdocument; + +/** + * Subdocument constructor. + * + * @inherits Document + * @api private + */ + +function Subdocument(value, fields, parent, options) { + if (parent != null) { + // If setting a nested path, should copy isNew from parent re: gh-7048 + const parentOptions = { isNew: parent.isNew }; + if ('defaults' in parent.$__) { + parentOptions.defaults = parent.$__.defaults; + } + options = Object.assign(parentOptions, options); + } + if (options?.path != null) { + this.$basePath = options.path; + } + Document.call(this, value, fields, options); + + delete this.$__.priorDoc; +} + +Subdocument.prototype = Object.create(Document.prototype); + +Object.defineProperty(Subdocument.prototype, '$isSubdocument', { + configurable: false, + writable: false, + value: true +}); + +Object.defineProperty(Subdocument.prototype, '$isSingleNested', { + configurable: false, + writable: false, + value: true +}); + +/*! + * ignore + */ + +Subdocument.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); +}; + +/** + * Used as a stub for middleware + * + * #### Note: + * + * _This is a no-op. Does not actually save the doc to the db._ + * + * @param {object} [options] + * @param {boolean} [options.suppressWarning=false] If `true`, suppress the warning about calling `save()` on a subdoc. + * @param {boolean|object} [options.middleware=true] set to `false` to skip all user-defined middleware + * @param {boolean} [options.middleware.pre=true] set to `false` to skip only pre hooks + * @param {boolean} [options.middleware.post=true] set to `false` to skip only post hooks + * @return {Promise} resolved Promise + * @api private + */ + +Subdocument.prototype.save = async function save(options) { + options = options || {}; + + if (!options.suppressWarning) { + utils.warn('mongoose: calling `save()` on a subdoc does **not** save ' + + 'the document to MongoDB, it only runs save middleware. ' + + 'Use `subdoc.save({ suppressWarning: true })` to hide this warning ' + + 'if you\'re sure this behavior is right for your app.'); + } + + return await this.$__save(options); +}; + +/** + * Given a path relative to this document, return the path relative + * to the top-level document. + * @param {string} path + * @method $__fullPath + * @memberOf Subdocument + * @instance + * @returns {string} + * @api private + */ + +Subdocument.prototype.$__fullPath = function(path) { + if (!this.$__.fullPath) { + this.ownerDocument(); + } + + return path ? + this.$__.fullPath + '.' + path : + this.$__.fullPath; +}; + +/** + * Given a path relative to this document, return the path relative + * to the parent document. + * @param {string} p + * @returns {string} + * @method $__pathRelativeToParent + * @memberOf Subdocument + * @instance + * @api private + */ + +Subdocument.prototype.$__pathRelativeToParent = function(p) { + if (p == null) { + return this.$basePath; + } + if (!this.$basePath) { + return p; + } + return [this.$basePath, p].join('.'); +}; + +/** + * Used as a stub for middleware + * + * #### Note: + * + * _This is a no-op. Does not actually save the doc to the db._ + * + * @param {Function} [fn] + * @method $__save + * @api private + */ + +Subdocument.prototype.$__save = async function $__save(options) { + try { + await this._execDocumentPreHooks('save', options, [options]); + } catch (error) { + await this._execDocumentPostHooks('save', options, error); + return; + } + + await this._execDocumentPostHooks('save', options); +}; + +/*! + * ignore + */ + +Subdocument.prototype.$isValid = function(path) { + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + return parent.$isValid(fullPath); + } + return Document.prototype.$isValid.call(this, path); +}; + +/*! + * ignore + */ + +Subdocument.prototype.markModified = function(path) { + Document.prototype.markModified.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + + if (parent == null || fullPath == null) { + return; + } + + const myPath = this.$__pathRelativeToParent().replace(/\.$/, ''); + if (parent.isDirectModified(myPath) || this.isNew) { + return; + } + this.$__parent.markModified(fullPath, this); +}; + +/*! + * ignore + */ + +Subdocument.prototype.isModified = function(paths, options, modifiedPaths) { + const parent = this.$parent(); + if (parent != null) { + if (Array.isArray(paths) || typeof paths === 'string') { + paths = (Array.isArray(paths) ? paths : paths.split(' ')); + paths = paths.map(p => this.$__pathRelativeToParent(p)).filter(p => p != null); + } else if (!paths) { + paths = this.$__pathRelativeToParent(); + } + + return parent.$isModified(paths, options, modifiedPaths); + } + + return Document.prototype.isModified.call(this, paths, options, modifiedPaths); +}; + +/** + * Marks a path as valid, removing existing validation errors. + * + * @param {string} path the field to mark as valid + * @api private + * @method $markValid + * @memberOf Subdocument + */ + +Subdocument.prototype.$markValid = function(path) { + Document.prototype.$markValid.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.$markValid(fullPath); + } +}; + +/*! + * ignore + */ + +Subdocument.prototype.invalidate = function(path, err, val) { + Document.prototype.invalidate.call(this, path, err, val); + + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.invalidate(fullPath, err, val); + } else if (err.kind === 'cast' || err.name === 'CastError' || fullPath == null) { + throw err; + } + + return this.ownerDocument().$__.validationError; +}; + +/*! + * ignore + */ + +Subdocument.prototype.$ignore = function(path) { + Document.prototype.$ignore.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.$ignore(fullPath); + } +}; + +/** + * Returns the top level document of this sub-document. + * + * @return {Document} + */ + +Subdocument.prototype.ownerDocument = function() { + if (this.$__.ownerDocument) { + return this.$__.ownerDocument; + } + + let parent = this; + const paths = []; + const seenDocs = new Set([parent]); + + while (true) { + if (typeof parent.$__pathRelativeToParent !== 'function') { + break; + } + paths.unshift(parent.$__pathRelativeToParent(void 0, true)); + const _parent = parent.$parent(); + if (_parent == null) { + break; + } + parent = _parent; + if (seenDocs.has(parent)) { + throw new Error('Infinite subdocument loop: subdoc with _id ' + parent._id + ' is a parent of itself'); + } + + seenDocs.add(parent); + } + + this.$__.fullPath = paths.join('.'); + + this.$__.ownerDocument = parent; + return this.$__.ownerDocument; +}; + +/*! + * ignore + */ + +Subdocument.prototype.$__fullPathWithIndexes = function() { + let parent = this; + const paths = []; + const seenDocs = new Set([parent]); + + while (true) { + if (typeof parent.$__pathRelativeToParent !== 'function') { + break; + } + paths.unshift(parent.$__pathRelativeToParent(void 0, false)); + const _parent = parent.$parent(); + if (_parent == null) { + break; + } + parent = _parent; + if (seenDocs.has(parent)) { + throw new Error('Infinite subdocument loop: subdoc with _id ' + parent._id + ' is a parent of itself'); + } + + seenDocs.add(parent); + } + + return paths.join('.'); +}; + +/** + * Returns this sub-documents parent document. + * + * @api public + */ + +Subdocument.prototype.parent = function() { + return this.$__parent; +}; + +/** + * Returns this sub-documents parent document. + * + * @api public + * @method $parent + */ + +Subdocument.prototype.$parent = Subdocument.prototype.parent; + +/*! + * Sets this sub-documents parent document. + * + * @api private + */ + +Subdocument.prototype.$__setParent = function $__setParent(parent) { + this.$__parent = parent; +}; + +/** + * ignore + * @method $__removeFromParent + * @memberOf Subdocument + * @instance + * @api private + */ + +Subdocument.prototype.$__removeFromParent = function() { + this.$__parent.set(this.$basePath, null); +}; + +/** + * Null-out this subdoc + * + * @param {object} [options] + */ + +Subdocument.prototype.deleteOne = function deleteOne(options) { + registerRemoveListener(this); + + // If removing entire doc, no need to remove subdoc + if (!options?.noop) { + this.$__removeFromParent(); + + const owner = this.ownerDocument(); + owner.$__.removedSubdocs = owner.$__.removedSubdocs || []; + owner.$__.removedSubdocs.push(this); + } +}; + +/*! + * ignore + */ + +Subdocument.prototype.populate = function() { + throw new Error('Mongoose does not support calling populate() on nested ' + + 'docs. Instead of `doc.nested.populate("path")`, use ' + + '`doc.populate("nested.path")`'); +}; + +/** + * Helper for console.log + * + * @api public + */ + +Subdocument.prototype.inspect = function() { + return this.toObject(); +}; + +if (util.inspect.custom) { + // Avoid Node deprecation warning DEP0079 + Subdocument.prototype[util.inspect.custom] = Subdocument.prototype.inspect; +} + +/** + * Override `$toObject()` to handle minimizing the whole path. Should not minimize if schematype-level minimize + * is set to false re: gh-11247, gh-14058, gh-14151. Should not minimize document array elements: an array + * element cannot be removed without shifting the array, so minimizing it to `undefined` makes the BSON + * serializer store `null` re: gh-7322. + */ + +Subdocument.prototype.$toObject = function $toObject(options, json) { + const ret = Document.prototype.$toObject.call(this, options, json); + + // If `$toObject()` was called recursively, respect the minimize option, including schematype level minimize. + // If minimize is set, then we can minimize out the whole object. + if (utils.hasOwnKeys(ret) === false && options?._calledWithOptions != null) { + const minimize = options._calledWithOptions?.minimize ?? this?.$__schemaTypeOptions?.minimize ?? options.minimize; + if (minimize && !this.constructor.$__required && !this.$isDocumentArrayElement) { + return undefined; + } + } + return ret; +}; + +/** + * Registers remove event listeners for triggering + * on subdocuments. + * + * @param {Subdocument} sub + * @api private + */ + +function registerRemoveListener(sub) { + const owner = sub.ownerDocument(); + + function emitRemove() { + owner.$removeListener('save', emitRemove); + owner.$removeListener('deleteOne', emitRemove); + sub.emit('deleteOne', sub); + sub.constructor.emit('deleteOne', sub); + } + + owner.$on('save', emitRemove); + owner.$on('deleteOne', emitRemove); +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/uuid.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/uuid.js new file mode 100644 index 00000000..382c93e5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/types/uuid.js @@ -0,0 +1,13 @@ +/** + * UUID type constructor + * + * #### Example: + * + * const id = new mongoose.Types.UUID(); + * + * @constructor UUID + */ + +'use strict'; + +module.exports = require('mongodb/lib/bson').UUID; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/utils.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/utils.js new file mode 100644 index 00000000..65dd0f87 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/utils.js @@ -0,0 +1,1055 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const UUID = require('mongodb/lib/bson').UUID; +const ms = require('ms'); +const mpath = require('mpath'); +const ObjectId = require('./types/objectid'); +const PopulateOptions = require('./options/populateOptions'); +const clone = require('./helpers/clone'); +const immediate = require('./helpers/immediate'); +const isObject = require('./helpers/isObject'); +const isMongooseArray = require('./types/array/isMongooseArray'); +const isMongooseDocumentArray = require('./types/documentArray/isMongooseDocumentArray'); +const isBsonType = require('./helpers/isBsonType'); +const isPOJO = require('./helpers/isPOJO'); +const getFunctionName = require('./helpers/getFunctionName'); +const isMongooseObject = require('./helpers/isMongooseObject'); +const schemaMerge = require('./helpers/schema/merge'); +const specialProperties = require('./helpers/specialProperties'); +const { trustedSymbol } = require('./helpers/query/trusted'); + +let Document; + +exports.specialProperties = specialProperties; + +exports.isMongooseArray = isMongooseArray.isMongooseArray; +exports.isMongooseDocumentArray = isMongooseDocumentArray.isMongooseDocumentArray; +exports.registerMongooseArray = isMongooseArray.registerMongooseArray; +exports.registerMongooseDocumentArray = isMongooseDocumentArray.registerMongooseDocumentArray; + +const oneSpaceRE = /\s/; +const manySpaceRE = /\s+/; + +/** + * Produces a collection name from model `name`. By default, just returns + * the model name + * + * @param {string} name a model name + * @param {Function} pluralize function that pluralizes the collection name + * @return {string} a collection name + * @api private + */ + +exports.toCollectionName = function(name, pluralize) { + if (name === 'system.profile') { + return name; + } + if (name === 'system.indexes') { + return name; + } + if (typeof pluralize === 'function') { + if (typeof name !== 'string') { + throw new TypeError('Collection name must be a string'); + } + if (name.length === 0) { + throw new TypeError('Collection name cannot be empty'); + } + return pluralize(name); + } + return name; +}; + +/** + * Determines if `a` and `b` are deep equal. + * + * Modified from node/lib/assert.js + * + * @param {any} a a value to compare to `b` + * @param {any} b a value to compare to `a` + * @return {boolean} + * @api private + */ + +exports.deepEqual = function deepEqual(a, b) { + if (a === b) { + return true; + } + + if (typeof a !== 'object' || typeof b !== 'object') { + return a === b; + } + + if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime(); + } + + if ((isBsonType(a, 'ObjectId') && isBsonType(b, 'ObjectId')) || + (isBsonType(a, 'Decimal128') && isBsonType(b, 'Decimal128'))) { + return a.toString() === b.toString(); + } + + if (a instanceof RegExp && b instanceof RegExp) { + return a.source === b.source && + a.ignoreCase === b.ignoreCase && + a.multiline === b.multiline && + a.global === b.global && + a.dotAll === b.dotAll && + a.unicode === b.unicode && + a.sticky === b.sticky && + a.hasIndices === b.hasIndices; + } + + if (a == null || b == null) { + return false; + } + + if (a.prototype !== b.prototype) { + return false; + } + + if (a instanceof Map || b instanceof Map) { + if (!(a instanceof Map) || !(b instanceof Map)) { + return false; + } + return deepEqual(Array.from(a.keys()), Array.from(b.keys())) && + deepEqual(Array.from(a.values()), Array.from(b.values())); + } + + if (a instanceof Set || b instanceof Set) { + if (!(a instanceof Set) || !(b instanceof Set)) { + return false; + } + if (a.size !== b.size) { + return false; + } + return deepEqual(Array.from(a.values()), Array.from(b.values())); + } + + // Handle MongooseNumbers + if (a instanceof Number && b instanceof Number) { + return a.valueOf() === b.valueOf(); + } + + if (Buffer.isBuffer(a)) { + return exports.buffer.areEqual(a, b); + } + + if (Array.isArray(a) || Array.isArray(b)) { + if (!Array.isArray(a) || !Array.isArray(b)) { + return false; + } + const len = a.length; + if (len !== b.length) { + return false; + } + for (let i = 0; i < len; ++i) { + if (!deepEqual(a[i], b[i])) { + return false; + } + } + return true; + } + + if (a.$__ != null) { + a = a._doc; + } else if (isMongooseObject(a)) { + a = a.toObject(); + } + + if (b.$__ != null) { + b = b._doc; + } else if (isMongooseObject(b)) { + b = b.toObject(); + } + + const ka = Object.keys(a); + const kb = Object.keys(b); + const kaLength = ka.length; + + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (kaLength !== kb.length) { + return false; + } + + // ~~~cheap key test + for (let i = kaLength - 1; i >= 0; i--) { + if (ka[i] !== kb[i]) { + return false; + } + } + + // equivalent values for every corresponding key, and + // ~~~possibly expensive deep test + for (const key of ka) { + if (!deepEqual(a[key], b[key])) { + return false; + } + } + + return true; +}; + +/** + * Get the last element of an array + * @param {Array} arr + */ + +exports.last = function(arr) { + if (arr == null) { + return void 0; + } + if (arr.length > 0) { + return arr[arr.length - 1]; + } + return void 0; +}; + +/*! + * ignore + */ + +exports.cloneArrays = function cloneArrays(arr) { + if (!Array.isArray(arr)) { + return arr; + } + + return arr.map(el => exports.cloneArrays(el)); +}; + +/*! + * ignore + */ + +exports.omit = function omit(obj, keys) { + if (keys == null) { + return Object.assign({}, obj); + } + if (!Array.isArray(keys)) { + keys = [keys]; + } + + const ret = Object.assign({}, obj); + for (const key of keys) { + delete ret[key]; + } + return ret; +}; + +/** + * Simplified version of `clone()` that only clones POJOs and arrays. Skips documents, dates, objectids, etc. + * @param {any} val + * @returns +*/ + +exports.clonePOJOsAndArrays = function clonePOJOsAndArrays(val) { + if (val == null) { + return val; + } + // Skip documents because we assume they'll be cloned later. See gh-15312 for how documents are handled with `merge()`. + if (val.$__ != null) { + return val; + } + if (isPOJO(val)) { + val = { ...val }; + for (const key of Object.keys(val)) { + val[key] = exports.clonePOJOsAndArrays(val[key]); + } + return val; + } + if (Array.isArray(val)) { + val = [...val]; + for (let i = 0; i < val.length; ++i) { + val[i] = exports.clonePOJOsAndArrays(val[i]); + } + return val; + } + + return val; +}; + +/** + * Merges `from` into `to` without overwriting existing properties. + * + * @param {object} to + * @param {object} from + * @param {object} [options] + * @param {string} [path] + * @api private + */ + +exports.merge = function merge(to, from, options, path) { + options = options || {}; + + if (from == null) { + return to; + } + + const keys = Object.keys(from); + let i = 0; + const len = keys.length; + let key; + + if (from[trustedSymbol]) { + to[trustedSymbol] = from[trustedSymbol]; + } + + path = path || ''; + const omitNested = options.omitNested || {}; + + while (i < len) { + key = keys[i++]; + if (options.omit && options.omit[key]) { + continue; + } + if (omitNested[path]) { + continue; + } + if (specialProperties.has(key)) { + continue; + } + if (to[key] == null) { + to[key] = exports.clonePOJOsAndArrays(from[key]); + } else if (exports.isObject(from[key])) { + if (!exports.isObject(to[key])) { + to[key] = {}; + } + if (from[key] != null) { + // Skip merging schemas if we're creating a discriminator schema and + // base schema has a given path as a single nested but discriminator schema + // has the path as a document array, or vice versa (gh-9534) + if (options.isDiscriminatorSchemaMerge && + ((from[key].$isSingleNested && to[key].$isMongooseDocumentArray) || + (from[key].$isMongooseDocumentArray && to[key].$isSingleNested))) { + continue; + } else if (from[key].instanceOfSchema) { + if (to[key].instanceOfSchema) { + schemaMerge(to[key], from[key].clone(), options.isDiscriminatorSchemaMerge); + } else { + to[key] = from[key].clone(); + } + continue; + } else if (isBsonType(from[key], 'ObjectId')) { + to[key] = new ObjectId(from[key]); + continue; + } + } + merge(to[key], from[key], options, path ? path + '.' + key : key); + } else if (options.overwrite) { + to[key] = from[key]; + } + } + + return to; +}; + +/** + * Applies toObject recursively. + * + * @param {Document|Array|object} obj + * @return {object} + * @api private + */ + +exports.toObject = function toObject(obj) { + Document || (Document = require('./document')); + let ret; + + if (obj == null) { + return obj; + } + + if (obj instanceof Document) { + return obj.toObject(); + } + + if (Array.isArray(obj)) { + ret = []; + + for (const doc of obj) { + ret.push(toObject(doc)); + } + + return ret; + } + + if (exports.isPOJO(obj)) { + ret = {}; + + if (obj[trustedSymbol]) { + ret[trustedSymbol] = obj[trustedSymbol]; + } + + for (const k of Object.keys(obj)) { + if (specialProperties.has(k)) { + continue; + } + ret[k] = toObject(obj[k]); + } + + return ret; + } + + return obj; +}; + +exports.isObject = isObject; + +/** + * Determines if `arg` is a plain old JavaScript object (POJO). Specifically, + * `arg` must be an object but not an instance of any special class, like String, + * ObjectId, etc. + * + * `Object.getPrototypeOf()` is part of ES5: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf + * + * @param {object|Array|string|Function|RegExp|any} arg + * @api private + * @return {boolean} + */ + +exports.isPOJO = require('./helpers/isPOJO'); + +/** + * Determines if `arg` is an object that isn't an instance of a built-in value + * class, like Array, Buffer, ObjectId, etc. + * @param {any} val + */ + +exports.isNonBuiltinObject = function isNonBuiltinObject(val) { + return typeof val === 'object' && + !Array.isArray(val) && + !(val instanceof Date) && + !(val instanceof Boolean) && + !(val instanceof Number) && + !(val instanceof String) && + !exports.isMongooseType(val) && + !(val instanceof UUID) && + val != null; +}; + +/** + * Determines if `val` is an object that has no own keys + * @param {any} val + */ + +exports.isEmptyObject = function isEmptyObject(val) { + if (val == null || typeof val !== 'object') { + return false; + } + return exports.hasOwnKeys(val) === false; +}; + +/** + * Determines if `obj` has any own keys. Assumes obj is already an object. + * Faster than Object.keys(obj).length > 0. + * @param {object} obj + */ + +exports.hasOwnKeys = function hasOwnKeys(obj) { + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + return true; + } + } + return false; +}; + +/** + * Search if `obj` or any POJOs nested underneath `obj` has a property named + * `key` + * @param {object} obj + * @param {string} key + */ + +exports.hasKey = function hasKey(obj, key) { + const props = Object.keys(obj); + for (const prop of props) { + if (prop === key) { + return true; + } + if (exports.isPOJO(obj[prop]) && exports.hasKey(obj[prop], key)) { + return true; + } + } + return false; +}; + +/** + * process.nextTick helper. + * + * Wraps `callback` in a try/catch + nextTick. + * + * node-mongodb-native has a habit of state corruption when an error is immediately thrown from within a collection callback. + * + * @param {Function} callback + * @api private + */ + +exports.tick = function tick(callback) { + if (typeof callback !== 'function') { + return; + } + return function() { + try { + callback.apply(this, arguments); + } catch (err) { + // only nextTick on err to get out of + // the event loop and avoid state corruption. + immediate(function() { + throw err; + }); + } + }; +}; + +/** + * Returns true if `v` is an object that can be serialized as a primitive in + * MongoDB + * @param {any} v + */ + +exports.isMongooseType = function(v) { + return isBsonType(v, 'ObjectId') || isBsonType(v, 'Decimal128') || v instanceof Buffer; +}; + +exports.isMongooseObject = isMongooseObject; + +/** + * Converts `expires` options of index objects to `expiresAfterSeconds` options for MongoDB. + * + * @param {object} object + * @api private + */ + +exports.expires = function expires(object) { + if (!(object && object.constructor.name === 'Object')) { + return; + } + if (!('expires' in object)) { + return; + } + + object.expireAfterSeconds = (typeof object.expires !== 'string') + ? object.expires + : Math.round(ms(object.expires) / 1000); + delete object.expires; +}; + +/** + * populate helper + * @param {string} path + * @param {string} select + * @param {Model} model + * @param {object} match + * @param {object} options + * @param {any} subPopulate + * @param {boolean} justOne + * @param {boolean} count + */ + +exports.populate = function populate(path, select, model, match, options, subPopulate, justOne, count) { + // might have passed an object specifying all arguments + let obj = null; + if (arguments.length === 1) { + if (path instanceof PopulateOptions) { + // If reusing old populate docs, avoid reusing `_docs` because that may + // lead to bugs and memory leaks. See gh-11641 + path._docs = {}; + path._childDocs = []; + return [path]; + } + + if (Array.isArray(path)) { + const singles = makeSingles(path); + return singles.map(o => exports.populate(o)[0]); + } + + if (exports.isObject(path)) { + obj = Object.assign({}, path); + } else { + obj = { path: path }; + } + } else if (typeof model === 'object') { + obj = { + path: path, + select: select, + match: model, + options: match + }; + } else { + obj = { + path: path, + select: select, + model: model, + match: match, + options: options, + populate: subPopulate, + justOne: justOne, + count: count + }; + } + + if (typeof obj.path !== 'string' && !(Array.isArray(obj.path) && obj.path.every(el => typeof el === 'string'))) { + throw new TypeError('utils.populate: invalid path. Expected string or array of strings. Got typeof `' + typeof path + '`'); + } + + return _populateObj(obj); + + // The order of select/conditions args is opposite Model.find but + // necessary to keep backward compatibility (select could be + // an array, string, or object literal). + function makeSingles(arr) { + const ret = []; + arr.forEach(function(obj) { + if (oneSpaceRE.test(obj.path)) { + const paths = obj.path.split(manySpaceRE); + paths.forEach(function(p) { + const copy = Object.assign({}, obj); + copy.path = p; + ret.push(copy); + }); + } else { + ret.push(obj); + } + }); + + return ret; + } +}; + +function _populateObj(obj) { + if (Array.isArray(obj.populate)) { + const ret = []; + obj.populate.forEach(function(obj) { + if (oneSpaceRE.test(obj.path)) { + const copy = Object.assign({}, obj); + const paths = copy.path.split(manySpaceRE); + paths.forEach(function(p) { + copy.path = p; + ret.push(exports.populate(copy)[0]); + }); + } else { + ret.push(exports.populate(obj)[0]); + } + }); + obj.populate = exports.populate(ret); + } else if (obj.populate != null && typeof obj.populate === 'object') { + obj.populate = exports.populate(obj.populate); + } + + const ret = []; + const paths = oneSpaceRE.test(obj.path) + ? obj.path.split(manySpaceRE) + : Array.isArray(obj.path) + ? obj.path + : [obj.path]; + if (obj.options != null) { + obj.options = clone(obj.options); + } + + for (const path of paths) { + ret.push(new PopulateOptions(Object.assign({}, obj, { path: path }))); + } + + return ret; +} + +/** + * Return the value of `obj` at the given `path`. + * + * @param {string} path + * @param {object} obj + * @param {any} map + */ + +exports.getValue = function(path, obj, map) { + return mpath.get(path, obj, getValueLookup, map); +}; + +/*! + * ignore + */ + +const mapGetterOptions = Object.freeze({ getters: false }); + +function getValueLookup(obj, part) { + if (part === '$*' && obj instanceof Map) { + return obj; + } + let _from = obj?._doc || obj; + if (_from?.isMongooseArrayProxy) { + _from = _from.__array; + } + return _from instanceof Map ? + _from.get(part, mapGetterOptions) : + _from[part]; +} + +/** + * Sets the value of `obj` at the given `path`. + * + * @param {string} path + * @param {Anything} val + * @param {object} obj + * @param {any} map + * @param {any} _copying + */ + +exports.setValue = function(path, val, obj, map, _copying) { + mpath.set(path, val, obj, '_doc', map, _copying); +}; + +/** + * Returns an array of values from object `o`. + * + * @param {object} o + * @return {Array} + * @api private + */ + +exports.object = {}; +exports.object.vals = function vals(o) { + if (o == null) { + return []; + } + const keys = Object.keys(o); + let i = keys.length; + const ret = []; + + while (i--) { + ret.push(o[keys[i]]); + } + + return ret; +}; + + +/** + * Determine if `val` is null or undefined + * + * @param {any} val + * @return {boolean} + */ + +exports.isNullOrUndefined = function(val) { + return val == null; +}; + +/*! + * ignore + */ + +exports.array = {}; + +/** + * Flattens an array. + * + * [ 1, [ 2, 3, [4] ]] -> [1,2,3,4] + * + * @param {Array} arr + * @param {Function} [filter] If passed, will be invoked with each item in the array. If `filter` returns a falsy value, the item will not be included in the results. + * @param {Array} ret + * @return {Array} + * @api private + */ + +exports.array.flatten = function flatten(arr, filter, ret) { + ret || (ret = []); + + arr.forEach(function(item) { + if (Array.isArray(item)) { + flatten(item, filter, ret); + } else { + if (!filter || filter(item)) { + ret.push(item); + } + } + }); + + return ret; +}; + +/*! + * ignore + */ + +exports.hasUserDefinedProperty = function(obj, key) { + if (obj == null) { + return false; + } + + if (Array.isArray(key)) { + for (const k of key) { + if (exports.hasUserDefinedProperty(obj, k)) { + return true; + } + } + return false; + } + + if (Object.hasOwn(obj, key)) { + return true; + } + if (typeof obj === 'object' && key in obj) { + const v = obj[key]; + return v !== Object.prototype[key] && v !== Array.prototype[key]; + } + + return false; +}; + +/*! + * ignore + */ + +const MAX_ARRAY_INDEX = Math.pow(2, 32) - 1; + +exports.isArrayIndex = function(val) { + if (typeof val === 'number') { + return val >= 0 && val <= MAX_ARRAY_INDEX; + } + if (typeof val === 'string') { + if (!/^\d+$/.test(val)) { + return false; + } + val = +val; + return val >= 0 && val <= MAX_ARRAY_INDEX; + } + + return false; +}; + +/** + * Removes duplicate values from an array + * + * [1, 2, 3, 3, 5] => [1, 2, 3, 5] + * [ ObjectId("550988ba0c19d57f697dc45e"), ObjectId("550988ba0c19d57f697dc45e") ] + * => [ObjectId("550988ba0c19d57f697dc45e")] + * + * @param {Array} arr + * @return {Array} + * @api private + */ + +exports.array.unique = function(arr) { + const primitives = new Set(); + const ids = new Set(); + const ret = []; + + for (const item of arr) { + if (typeof item === 'number' || typeof item === 'string' || item == null) { + if (primitives.has(item)) { + continue; + } + ret.push(item); + primitives.add(item); + } else if (isBsonType(item, 'ObjectId')) { + const idStr = item.toString(); + if (ids.has(idStr)) { + continue; + } + ret.push(item); + ids.add(idStr); + } else { + ret.push(item); + } + } + + return ret; +}; + +exports.buffer = {}; + +/** + * Determines if two buffers are equal. + * + * @param {Buffer} a + * @param {object} b + */ + +exports.buffer.areEqual = function(a, b) { + if (!Buffer.isBuffer(a)) { + return false; + } + if (!Buffer.isBuffer(b)) { + return false; + } + return a.equals(b); +}; + +exports.getFunctionName = getFunctionName; + +/** + * Decorate buffers + * @param {object} destination + * @param {object} source + */ + +exports.decorate = function(destination, source) { + for (const key in source) { + if (specialProperties.has(key)) { + continue; + } + destination[key] = source[key]; + } +}; + +/** + * merges to with a copy of from + * + * @param {object} to + * @param {object} fromObj + * @api private + */ + +exports.mergeClone = function(to, fromObj) { + if (isMongooseObject(fromObj)) { + fromObj = fromObj.toObject({ + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } + const keys = Object.keys(fromObj); + const len = keys.length; + let i = 0; + let key; + + while (i < len) { + key = keys[i++]; + if (specialProperties.has(key)) { + continue; + } + if (typeof to[key] === 'undefined') { + to[key] = clone(fromObj[key], { + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } else { + let val = fromObj[key]; + if (val?.valueOf && !(val instanceof Date)) { + val = val.valueOf(); + } + if (exports.isObject(val)) { + let obj = val; + if (isMongooseObject(val) && !val.isMongooseBuffer) { + obj = obj.toObject({ + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } + if (val.isMongooseBuffer) { + obj = Buffer.from(obj); + } + exports.mergeClone(to[key], obj); + } else { + to[key] = clone(val, { + flattenDecimals: false + }); + } + } + } +}; + +/** + * Executes a function on each element of an array (like _.each) + * + * @param {Array} arr + * @param {Function} fn + * @api private + */ + +exports.each = function(arr, fn) { + for (const item of arr) { + fn(item); + } +}; + +/** + * Rename an object key, while preserving its position in the object + * + * @param {object} oldObj + * @param {string|number} oldKey + * @param {string|number} newKey + * @api private + */ +exports.renameObjKey = function(oldObj, oldKey, newKey) { + const keys = Object.keys(oldObj); + return keys.reduce( + (acc, val) => { + if (val === oldKey) { + acc[newKey] = oldObj[oldKey]; + } else { + acc[val] = oldObj[val]; + } + return acc; + }, + {} + ); +}; + +/*! + * ignore + */ + +exports.getOption = function(name) { + const sources = Array.prototype.slice.call(arguments, 1); + + for (const source of sources) { + if (source == null) { + continue; + } + if (source[name] != null) { + return source[name]; + } + } + + return null; +}; + +/*! + * ignore + */ + +exports.noop = function() {}; + +exports.errorToPOJO = function errorToPOJO(error) { + const isError = error instanceof Error; + if (!isError) { + throw new Error('`error` must be `instanceof Error`.'); + } + + const ret = {}; + for (const properyName of Object.getOwnPropertyNames(error)) { + ret[properyName] = error[properyName]; + } + return ret; +}; + +/*! + * ignore + */ + +exports.warn = function warn(message) { + return process.emitWarning(message, { code: 'MONGOOSE' }); +}; + + +exports.injectTimestampsOption = function injectTimestampsOption(writeOperation, timestampsOption) { + if (timestampsOption == null) { + return; + } + writeOperation.timestamps = timestampsOption; +}; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/validOptions.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/validOptions.js new file mode 100644 index 00000000..cb392b6e --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/validOptions.js @@ -0,0 +1,44 @@ + +/*! + * Valid mongoose options + */ + +'use strict'; + +const VALID_OPTIONS = Object.freeze([ + 'allowDiskUse', + 'applyPluginsToChildSchemas', + 'applyPluginsToDiscriminators', + 'autoCreate', + 'autoIndex', + 'autoSearchIndex', + 'bufferCommands', + 'bufferTimeoutMS', + 'cloneSchemas', + 'createInitialConnection', + 'debug', + 'forceRepopulate', + 'id', + 'maxTimeMS', + 'objectIdGetter', + 'overwriteModels', + 'returnDocument', + 'returnOriginal', + 'runValidators', + 'sanitizeFilter', + 'sanitizeProjection', + 'selectPopulatedPaths', + 'setDefaultsOnInsert', + 'strict', + 'strictPopulate', + 'strictQuery', + 'strictRead', + 'timestamps.createdAt.immutable', + 'toJSON', + 'toObject', + 'transactionAsyncLocalStorage', + 'translateAliases', + 'updatePipeline' +]); + +module.exports = VALID_OPTIONS; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/virtualType.js b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/virtualType.js new file mode 100644 index 00000000..ac85196b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/lib/virtualType.js @@ -0,0 +1,204 @@ +'use strict'; + +const modelNamesFromRefPath = require('./helpers/populate/modelNamesFromRefPath'); +const utils = require('./utils'); + +const modelSymbol = require('./helpers/symbols').modelSymbol; + +/** + * VirtualType constructor + * + * This is what mongoose uses to define virtual attributes via `Schema.prototype.virtual`. + * + * #### Example: + * + * const fullname = schema.virtual('fullname'); + * fullname instanceof mongoose.VirtualType // true + * + * @param {object} options + * @param {string|Function} [options.ref] if `ref` is not nullish, this becomes a [populated virtual](https://mongoosejs.com/docs/populate.html#populate-virtuals) + * @param {string|Function} [options.localField] the local field to populate on if this is a populated virtual. + * @param {string|Function} [options.foreignField] the foreign field to populate on if this is a populated virtual. + * @param {boolean} [options.justOne=false] by default, a populated virtual is an array. If you set `justOne`, the populated virtual will be a single doc or `null`. + * @param {boolean} [options.getters=false] if you set this to `true`, Mongoose will call any custom getters you defined on this virtual + * @param {boolean} [options.count=false] if you set this to `true`, `populate()` will set this virtual to the number of populated documents, as opposed to the documents themselves, using [`Query#countDocuments()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.countDocuments()) + * @param {object|Function} [options.match=null] add an extra match condition to `populate()` + * @param {number} [options.limit=null] add a default `limit` to the `populate()` query + * @param {number} [options.skip=null] add a default `skip` to the `populate()` query + * @param {number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents. + * @param {object} [options.options=null] Additional options like `limit` and `lean`. + * @param {string} name + * @api public + */ + +function VirtualType(options, name) { + this.path = name; + this.getters = []; + this.setters = []; + this.options = Object.assign({}, options); +} + +/** + * If no getters/setters, add a default + * + * @api private + */ + +VirtualType.prototype._applyDefaultGetters = function() { + if (this.getters.length > 0 || this.setters.length > 0) { + return; + } + + const path = this.path; + const internalProperty = '$' + path; + this.getters.push(function() { + return this.$locals[internalProperty]; + }); + this.setters.push(function(v) { + this.$locals[internalProperty] = v; + }); +}; + +/*! + * ignore + */ + +VirtualType.prototype.clone = function() { + const clone = new VirtualType(this.options, this.path); + clone.getters = [].concat(this.getters); + clone.setters = [].concat(this.setters); + return clone; +}; + +/** + * Adds a custom getter to this virtual. + * + * Mongoose calls the getter function with the below 3 parameters. + * + * - `value`: the value returned by the previous getter. If there is only one getter, `value` will be `undefined`. + * - `virtual`: the virtual object you called `.get()` on. + * - `doc`: the document this virtual is attached to. Equivalent to `this`. + * + * #### Example: + * + * const virtual = schema.virtual('fullname'); + * virtual.get(function(value, virtual, doc) { + * return this.name.first + ' ' + this.name.last; + * }); + * + * @param {Function} fn + * @return {VirtualType} this + * @api public + */ + +VirtualType.prototype.get = function(fn) { + this.getters.push(fn); + return this; +}; + +/** + * Adds a custom setter to this virtual. + * + * Mongoose calls the setter function with the below 3 parameters. + * + * - `value`: the value being set. + * - `virtual`: the virtual object you're calling `.set()` on. + * - `doc`: the document this virtual is attached to. Equivalent to `this`. + * + * #### Example: + * + * const virtual = schema.virtual('fullname'); + * virtual.set(function(value, virtual, doc) { + * const parts = value.split(' '); + * this.name.first = parts[0]; + * this.name.last = parts[1]; + * }); + * + * const Model = mongoose.model('Test', schema); + * const doc = new Model(); + * // Calls the setter with `value = 'Jean-Luc Picard'` + * doc.fullname = 'Jean-Luc Picard'; + * doc.name.first; // 'Jean-Luc' + * doc.name.last; // 'Picard' + * + * @param {Function} fn + * @return {VirtualType} this + * @api public + */ + +VirtualType.prototype.set = function(fn) { + this.setters.push(fn); + return this; +}; + +/** + * Applies getters to `value`. + * + * @param {any} value + * @param {Document} doc The document this virtual is attached to + * @return {any} the value after applying all getters + * @api public + */ + +VirtualType.prototype.applyGetters = function(value, doc) { + if (utils.hasUserDefinedProperty(this.options, ['ref', 'refPath']) && + doc.$$populatedVirtuals && + Object.hasOwn(doc.$$populatedVirtuals, this.path)) { + value = doc.$$populatedVirtuals[this.path]; + } + + let v = value; + for (const getter of this.getters) { + v = getter.call(doc, v, this, doc); + } + return v; +}; + +/** + * Applies setters to `value`. + * + * @param {object} value + * @param {Document} doc + * @return {any} the value after applying all setters + * @api public + */ + +VirtualType.prototype.applySetters = function(value, doc) { + let v = value; + for (const setter of this.setters) { + v = setter.call(doc, v, this, doc); + } + return v; +}; + +/** + * Get the names of models used to populate this model given a doc + * + * @param {Document} doc + * @return {string[] | null} + * @api private + */ + +VirtualType.prototype._getModelNamesForPopulate = function _getModelNamesForPopulate(doc) { + if (this.options.refPath) { + return modelNamesFromRefPath(this.options.refPath, doc, this.path); + } + + let normalizedRef = null; + if (typeof this.options.ref === 'function' && !this.options.ref[modelSymbol]) { + normalizedRef = this.options.ref.call(doc, doc); + } else { + normalizedRef = this.options.ref; + } + if (normalizedRef != null && !Array.isArray(normalizedRef)) { + return [normalizedRef]; + } + + return normalizedRef; +}; + +/*! + * exports + */ + +module.exports = VirtualType; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/package.json b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/package.json new file mode 100644 index 00000000..c69cca91 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/package.json @@ -0,0 +1,141 @@ +{ + "name": "mongoose", + "description": "Mongoose MongoDB ODM", + "version": "9.10.2", + "author": "Guillermo Rauch ", + "keywords": [ + "mongodb", + "document", + "model", + "schema", + "database", + "odm", + "data", + "datastore", + "query", + "nosql", + "orm", + "db" + ], + "type": "commonjs", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "kareem": "3.4.0", + "mongodb": "~7.6", + "mpath": "0.9.0", + "mquery": "6.0.0", + "ms": "2.1.3", + "sift": "17.1.3" + }, + "devDependencies": { + "@ark/attest": "0.56.3", + "@eslint/js": "^9.39.3", + "@mongodb-js/mongodb-downloader": "^1.0.0", + "@types/node": "^20.19.0", + "acquit": "1.4.0", + "acquit-ignore": "0.2.2", + "acquit-require": "0.1.1", + "ajv": "8.20.0", + "c8": "12.0.0", + "cheerio": "1.2.0", + "dox": "1.0.0", + "eslint": "10.9.1", + "eslint-plugin-mocha-no-only": "1.2.0", + "express": "5.2.1", + "fs-extra": "~11.4.0", + "glob": "^13.0.6", + "globals": "^17.4.0", + "highlight.js": "11.12.0", + "linkinator": "8.x", + "lodash.isequal": "4.5.0", + "lodash.isequalwith": "4.4.0", + "markdownlint-cli2": "0.23.2", + "marked": "18.0.11", + "mkdirp": "^3.0.1", + "mocha": "12.0.0-rc.6", + "moment": "2.30.1", + "mongodb-client-encryption": "^7.2.0", + "mongodb-memory-server": "11.2.0", + "mongodb-runner": "^6.0.0", + "ncp": "^2.0.0", + "pug": "3.0.4", + "sinon": "22.1.0", + "tstyche": "^7.0.0", + "typescript": "5.9.3", + "typescript-eslint": "^8.31.1", + "uuid": "14.0.2", + "xss": "1.0.15" + }, + "directories": { + "lib": "./lib/mongoose" + }, + "scripts": { + "docs:clean": "npm run docs:clean:stable", + "docs:clean:stable": "rm -rf index.html && rm -rf ./docs/*.html && rm -rf ./docs/api && rm -rf ./docs/tutorials/*.html && rm -rf ./docs/typescript/*.html && rm -rf ./docs/*.html && rm -rf ./docs/source/_docs && rm -rf ./tmp", + "docs:clean:5x": "rm -rf index.html && rm -rf ./docs/5.x && rm -rf ./docs/source/_docs && rm -rf ./tmp", + "docs:clean:6x": "rm -rf index.html && rm -rf ./docs/6.x && rm -rf ./docs/source/_docs && rm -rf ./tmp", + "docs:copy:tmp": "mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && mkdirp ./tmp/docs/api && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/", + "docs:copy:tmp:5x": "rm -rf ./docs/5.x && ncp ./tmp ./docs/5.x", + "docs:copy:tmp:6x": "rm -rf ./docs/6.x && ncp ./tmp ./docs/6.x", + "docs:generate": "node ./scripts/website.js", + "docs:generate:sponsorData": "node ./scripts/loadSponsorData.js", + "docs:test": "npm run docs:generate", + "docs:view": "node ./scripts/static.js", + "docs:prepare:publish:stable": "git checkout gh-pages && git merge master && env GENERATE_SEARCH=true npm run docs:generate", + "docs:prepare:publish:5x": "git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x", + "docs:prepare:publish:6x": "git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x", + "docs:prepare:publish:7x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rm -rf ./docs/7.x && mv ./tmp ./docs/7.x", + "docs:prepare:publish:8x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rm -rf ./docs/8.x && mv ./tmp ./docs/8.x", + "docs:check-links": "linkinator http://127.0.0.1:8089 --silent --recurse --skip cdn.carbonads.com --skip m.servedby-buysellads.com --skip \"127\\.0\\.0\\.1:8089/docs/\\d+.x\"", + "docs:update-mongodb-links": "node ./scripts/update-mongodb-links.js", + "lint": "eslint .", + "lint-js": "eslint . --ext .js --ext .cjs", + "lint-ts": "eslint . --ext .ts", + "lint-md": "markdownlint-cli2 \"docs/**/*.md\" \"docs/*.md\" \"*.md\"", + "release": "git pull && git push origin master --tags && npm publish", + "release-5x": "git pull origin 5.x && git push origin 5.x && git push origin 5.x --tags && npm publish --tag 5x", + "release-6x": "git pull origin 6.x && git push origin 6.x && git push origin 6.x --tags && npm publish --tag 6x", + "mongo": "node ./tools/repl.js", + "publish-7x": "npm publish --tag 7x", + "create-separate-require-instance": "rm -rf ./node_modules/mongoose-separate-require-instance && node ./scripts/create-tarball && tar -xzf mongoose.tgz -C ./node_modules && mv ./node_modules/package ./node_modules/mongoose-separate-require-instance", + "test": "mocha --exit --ignore \"test/encryption/**/*.test.js\" \"./test/**/*.test.js\"", + "test:ci": "npm run test -- --reporter min --timeout 10000", + "test-deno": "deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.mjs", + "test-deno:ci": "npm run test-deno -- --reporter min", + "test-rs": "START_REPLICA_SET=1 mocha --timeout 30000 --exit --ignore \"test/encryption/**/*.test.js\" \"./test/**/*.test.js\"", + "test-rs:ci": "npm run test-rs -- --reporter min", + "test:types": "tstyche", + "setup-test-encryption": "node scripts/setup-encryption-tests.js", + "test-encryption": "mocha --exit ./test/encryption/*.test.js", + "test-encryption:ci": "npm run test-encryption -- --reporter min", + "tdd": "mocha --watch --inspect --ignore \"test/encryption/**/*.test.js\" \"./test/**/*.test.js\" --watch-files lib/**/*.js test/**/*.js", + "test-coverage": "c8 --reporter=html --reporter=text npm test", + "test-coverage:ci": "c8 --reporter=html --reporter=text npm run test:ci", + "ts-benchmark": "cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check", + "ts-benchmark:local": "node ./scripts/create-tarball && cd ./benchmarks/typescript/simple && rm -rf ./node_modules && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check", + "attest-benchmark": "node ./benchmarks/typescript/infer.bench.mts" + }, + "main": "./index.js", + "types": "./types/index.d.ts", + "engines": { + "node": ">=20.19.0" + }, + "bugs": { + "url": "https://github.com/Automattic/mongoose/issues/new" + }, + "repository": { + "type": "git", + "url": "git://github.com/Automattic/mongoose.git" + }, + "homepage": "https://mongoosejs.com", + "config": { + "mongodbMemoryServer": { + "disablePostinstall": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/tstyche.json b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/tstyche.json new file mode 100644 index 00000000..5a02c9c5 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/tstyche.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://tstyche.org/schemas/config.json", + "testFileMatch": [ + "test/types/*.test.*", + "test/types/**/*.test.*" + ] +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/aggregate.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/aggregate.d.ts new file mode 100644 index 00000000..e5809c09 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/aggregate.d.ts @@ -0,0 +1,198 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** Extract generic type from Aggregate class */ + type AggregateExtract

= P extends Aggregate ? T : never; + + interface AggregateOptions extends Omit, SessionOption { + /** set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks */ + middleware?: boolean | SkipMiddlewareOptions; + [key: string]: any; + } + + interface AggregateCursorMiddlewareOptions { + /** If `false`, skip pre aggregate middleware. Aggregate cursors do not run post aggregate middleware. */ + pre?: boolean; + post?: never; + } + + interface AggregateCursorOptions extends Omit, SessionOption { + middleware?: boolean | AggregateCursorMiddlewareOptions; + transform?: (doc: any) => any; + useMongooseAggCursor?: boolean; + [key: string]: unknown; + } + + class Aggregate implements SessionOperation { + /** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js) + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + + // Returns a string representation of this aggregation. + [Symbol.toStringTag]: string; + + options: AggregateOptions; + + /** + * Sets an option on this aggregation. This function will be deprecated in a + * future release. + * + * @deprecated + */ + addCursorFlag(flag: CursorFlag, value: boolean): this; + + /** + * Appends a new $addFields operator to this aggregate pipeline. + * Requires MongoDB v3.4+ to work + */ + addFields(arg: PipelineStage.AddFields['$addFields']): this; + + /** Sets the allowDiskUse option for the aggregation query */ + allowDiskUse(value: boolean): this; + + /** Appends new operators to this aggregate pipeline */ + append(...args: PipelineStage[]): this; + + /** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like [`.then()`](#query_Query-then), but only takes a rejection handler. + */ + catch: Promise['catch']; + + /** Set the collation. */ + collation(options: mongodb.CollationOptions): this; + + /** Appends a new $count operator to this aggregate pipeline. */ + count(fieldName: PipelineStage.Count['$count']): this; + + /** Appends a new $densify operator to this aggregate pipeline */ + densify(arg: PipelineStage.Densify['$densify']): this; + + /** + * Sets the cursor option for the aggregation query + */ + cursor(options?: AggregateCursorOptions): Cursor; + + + /** Executes the aggregate pipeline on the currently bound Model. */ + exec(): Promise; + + /** Execute the aggregation with explain */ + explain(verbosity: mongodb.ExplainVerbosityLike): Promise; + explain(): Promise; + + /** Combines multiple aggregation pipelines. */ + facet(options: PipelineStage.Facet['$facet']): this; + + /** Appends a new $fill operator to this aggregate pipeline */ + fill(arg: PipelineStage.Fill['$fill']): this; + + /** + * Executes the aggregation returning a `Promise` which will be + * resolved with `.finally()` chained. + */ + finally: Promise['finally']; + + /** Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection. */ + graphLookup(options: PipelineStage.GraphLookup['$graphLookup']): this; + + /** Appends new custom $group operator to this aggregate pipeline. */ + group(arg: PipelineStage.Group['$group']): this; + + /** Sets the hint option for the aggregation query */ + hint(value: Record | string): this; + + /** + * Appends a new $limit operator to this aggregate pipeline. + * @param num maximum number of records to pass to the next stage + */ + limit(num: PipelineStage.Limit['$limit']): this; + + /** Appends new custom $lookup operator to this aggregate pipeline. */ + lookup(options: PipelineStage.Lookup['$lookup']): this; + + /** + * Appends a new custom $match operator to this aggregate pipeline. + * @param arg $match operator contents + */ + match(arg: PipelineStage.Match['$match']): this; + + /** + * Binds this aggregate to a model. + * @param model the model to which the aggregate is to be bound + */ + model(model: Model): this; + + /** + * Returns the current model bound to this aggregate object + */ + model(): Model; + + /** Appends a new $geoNear operator to this aggregate pipeline. */ + near(arg: PipelineStage.GeoNear['$geoNear']): this; + + /** Returns the current pipeline */ + pipeline(): PipelineStage[]; + + /** Returns the current pipeline typed for use in `$unionWith` */ + pipelineForUnionWith(): PipelineStage.UnionWithPipelineStage[]; + + /** Appends a new $project operator to this aggregate pipeline. */ + project(arg: PipelineStage.Project['$project'] | string): this; + + /** Sets the readPreference option for the aggregation query. */ + read(pref: mongodb.ReadPreferenceLike): this; + + /** Sets the readConcern level for the aggregation query. */ + readConcern(level: string): this; + + /** Appends a new $redact operator to this aggregate pipeline. */ + redact(expression: PipelineStage.Redact['$redact'], thenExpr: '$$DESCEND' | '$$PRUNE' | '$$KEEP' | AnyObject, elseExpr: '$$DESCEND' | '$$PRUNE' | '$$KEEP' | AnyObject): this; + + /** Appends a new $replaceRoot operator to this aggregate pipeline. */ + replaceRoot(newRoot: PipelineStage.ReplaceRoot['$replaceRoot']['newRoot'] | string): this; + + /** + * Helper for [Atlas Text Search](https://www.mongodb.com/docs/atlas/atlas-search/tutorial/)'s + * `$search` stage. + */ + search(options: PipelineStage.Search['$search']): this; + + /** Lets you set arbitrary options, for middlewares or plugins. */ + option(value: AggregateOptions): this; + + /** Appends new custom $sample operator to this aggregate pipeline. */ + sample(arg: PipelineStage.Sample['$sample']['size']): this; + + /** Sets the session for this aggregation. Useful for [transactions](/docs/transactions.html). */ + session(session: mongodb.ClientSession | null): this; + + /** + * Appends a new $skip operator to this aggregate pipeline. + * @param num number of records to skip before next stage + */ + skip(num: PipelineStage.Skip['$skip']): this; + + /** Appends a new $sort operator to this aggregate pipeline. */ + sort(arg: string | Record | PipelineStage.Sort['$sort']): this; + + /** Provides promise for aggregate. */ + then: Promise['then']; + + /** + * Appends a new $sortByCount operator to this aggregate pipeline. Accepts either a string field name + * or a pipeline object. + */ + sortByCount(arg: string | PipelineStage.SortByCount['$sortByCount']): this; + + /** Appends new $unionWith operator to this aggregate pipeline. */ + unionWith(options: PipelineStage.UnionWith['$unionWith']): this; + + /** Appends new custom $unwind operator(s) to this aggregate pipeline. */ + unwind(...args: PipelineStage.Unwind['$unwind'][]): this; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/augmentations.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/augmentations.d.ts new file mode 100644 index 00000000..4d10d066 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/augmentations.d.ts @@ -0,0 +1,9 @@ +// this import is required so that types get merged instead of completely overwritten +import 'mongodb'; + +declare module 'mongodb' { + interface ObjectId { + /** Mongoose automatically adds a conveniency "_id" getter on the base ObjectId class */ + _id: this; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/callback.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/callback.d.ts new file mode 100644 index 00000000..370379ab --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/callback.d.ts @@ -0,0 +1,8 @@ +declare module 'mongoose' { + type CallbackError = NativeError | null; + + type Callback = (error: CallbackError, result: T) => void; + + type CallbackWithoutResult = (error: CallbackError) => void; + type CallbackWithoutResultAndOptionalError = (error?: CallbackError) => void; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/collection.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/collection.d.ts new file mode 100644 index 00000000..7b610793 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/collection.d.ts @@ -0,0 +1,49 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + export class BaseCollection extends mongodb.Collection { + /** + * Collection constructor + * @param name name of the collection + * @param conn A MongooseConnection instance + * @param opts optional collection options + */ + constructor(name: string, conn: Connection, opts?: any); + + /* + * Abstract methods. Some of these are already defined on the + * mongodb.Collection interface so they've been commented out. + */ + ensureIndex(...args: any[]): any; + findAndModify(...args: any[]): any; + getIndexes(...args: any[]): any; + + /** Formatter for debug print args */ + $format(arg: any, color?: boolean, shell?: boolean): string; + /** Debug print helper */ + $print(name: string, i: string | number, args: any[], color?: boolean, shell?: boolean): void; + + /** The collection name */ + get collectionName(): string; + /** The Connection instance */ + conn: Connection; + /** The collection name */ + name: string; + } + + /* + * section drivers/node-mongodb-native/collection.js + */ + class Collection extends BaseCollection { + /** + * Collection constructor + * @param name name of the collection + * @param conn A MongooseConnection instance + * @param opts optional collection options + */ + constructor(name: string, conn: Connection, opts?: any); + + /** Retrieves information about this collections indexes. */ + getIndexes(): ReturnType['indexInformation']>; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/connection.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/connection.d.ts new file mode 100644 index 00000000..e18e337a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/connection.d.ts @@ -0,0 +1,297 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + import events = require('events'); + + /** The Mongoose module's default connection. Equivalent to `mongoose.connections[0]`, see [`connections`](#mongoose_Mongoose-connections). */ + const connection: Connection; + + /** An array containing all connections associated with this Mongoose instance. */ + const connections: Connection[]; + + /** Opens Mongoose's default connection to MongoDB, see [connections docs](https://mongoosejs.com/docs/connections.html) */ + function connect(uri: string, options?: ConnectOptions): Promise; + + /** Creates a Connection instance. */ + function createConnection(uri: string, options?: ConnectOptions): Connection; + function createConnection(): Connection; + + function disconnect(): Promise; + + /** + * Connection ready state + * + * - 0 = disconnected + * - 1 = connected + * - 2 = connecting + * - 3 = disconnecting + * - 99 = uninitialized + */ + enum ConnectionStates { + disconnected = 0, + connected = 1, + connecting = 2, + disconnecting = 3, + uninitialized = 99, + } + + /** Expose connection states for user-land */ + const STATES: typeof ConnectionStates; + + interface ConnectOptions extends mongodb.MongoClientOptions { + /** Set to false to [disable buffering](http://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. */ + bufferCommands?: boolean; + /** The name of the database you want to use. If not provided, Mongoose uses the database name from connection string. */ + dbName?: string; + /** username for authentication, equivalent to `options.auth.user`. Maintained for backwards compatibility. */ + user?: string; + /** password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. */ + pass?: string; + /** Set to false to disable automatic index creation for all models associated with this connection. */ + autoIndex?: boolean; + /** Set to `false` to disable Mongoose automatically calling `createCollection()` on every model created on this connection. */ + autoCreate?: boolean; + /** + * Sanitizes query filters against [query selector injection attacks]( + * https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html + * ) by wrapping any nested objects that have a property whose name starts with $ in a $eq. + */ + sanitizeFilter?: boolean; + } + + export type AnyConnectionBulkWriteModel = Omit, 'namespace'> + | Omit, 'namespace'> + | Omit, 'namespace'> + | Omit, 'namespace'> + | Omit, 'namespace'> + | Omit, 'namespace'>; + + export type ConnectionBulkWriteModel = Record> = { + [ModelName in keyof SchemaMap]: AnyConnectionBulkWriteModel & { + model: ModelName; + }; + }[keyof SchemaMap]; + + class Connection extends events.EventEmitter implements SessionStarter { + /** Runs a [db-level aggregate()](https://www.mongodb.com/docs/manual/reference/method/db.aggregate/) on this connection's underlying `db` */ + aggregate(pipeline?: PipelineStage[] | null, options?: AggregateOptions): Aggregate>; + + /** Returns a promise that resolves when this connection successfully connects to MongoDB */ + asPromise(): Promise; + + /** The Mongoose instance this connection is associated with */ + base: Mongoose; + + bulkWrite>( + ops: Array>, + options: mongodb.ClientBulkWriteOptions & { ordered: false } + ): Promise } }>; + bulkWrite>( + ops: Array>, + options?: mongodb.ClientBulkWriteOptions + ): Promise; + + /** Closes the connection */ + close(force?: boolean): Promise; + + /** Closes and destroys the connection. Connection once destroyed cannot be reopened */ + destroy(force?: boolean): Promise; + + /** Retrieves a collection, creating it if not cached. */ + collection(name: string, options?: mongodb.CreateCollectionOptions): Collection; + + /** A hash of the collections associated with this connection */ + readonly collections: { [index: string]: Collection }; + + /** A hash of the global options that are associated with this connection */ + readonly config: any; + + /** The mongodb.Db instance, set when the connection is opened */ + readonly db: mongodb.Db | undefined; + + /** + * Helper for `createCollection()`. Will explicitly create the given collection + * with specified options. Used to create [capped collections](https://www.mongodb.com/docs/manual/core/capped-collections/) + * and [views](https://www.mongodb.com/docs/manual/core/views/) from mongoose. + */ + createCollection(name: string, options?: mongodb.CreateCollectionOptions): Promise>; + + /** + * https://mongoosejs.com/docs/api/connection.html#Connection.prototype.createCollections() + */ + createCollections(continueOnError?: boolean): Promise>>; + + /** + * Removes the model named `name` from this connection, if it exists. You can + * use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + */ + deleteModel(name: string | RegExp): this; + + /** + * Helper for `dropCollection()`. Will delete the given collection, including + * all documents and indexes. + */ + dropCollection(collection: string): Promise; + + /** + * Helper for `dropDatabase()`. Deletes the given database, including all + * collections, documents, and indexes. + */ + dropDatabase(): Promise; + + /** Gets the value of the option `key`. */ + get(key: string): any; + + /** + * Returns the [MongoDB driver `MongoClient`](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html) instance + * that this connection uses to talk to MongoDB. + */ + getClient(): mongodb.MongoClient; + + /** + * The host name portion of the URI. If multiple hosts, such as a replica set, + * this will contain the first host name in the URI + */ + readonly host: string; + + /** + * A number identifier for this connection. Used for debugging when + * you have [multiple connections](/docs/connections.html#multiple_connections). + */ + readonly id: number; + + /** + * Helper for MongoDB Node driver's `listCollections()`. + * Returns an array of collection names. + */ + listCollections(): Promise[]>; + + /** + * Helper for MongoDB Node driver's `listDatabases()`. + * Returns an array of database names. + */ + listDatabases(): Promise; + + /** + * A [POJO](https://masteringjs.io/tutorials/fundamentals/pojo) containing + * a map from model names to models. Contains all models that have been + * added to this connection using [`Connection#model()`](/docs/api/connection.html#connection_Connection-model). + */ + readonly models: Readonly<{ [index: string]: Model }>; + + /** Defines or retrieves a model. */ + model( + name: string, + schema?: TSchema, + collection?: string, + options?: CompileModelOptions + ): Model< + InferSchemaType, + ObtainSchemaGeneric, + ObtainSchemaGeneric, + ObtainSchemaGeneric, + // If first schema generic param is set, that means we have an explicit raw doc type, + // so user should also specify a hydrated doc type if the auto inferred one isn't correct. + IsItRecordAndNotAny> extends true + ? ObtainSchemaGeneric + : HydratedDocument< + InferSchemaType, + ObtainSchemaGeneric & ObtainSchemaGeneric, + ObtainSchemaGeneric, + ObtainSchemaGeneric, + InferSchemaType, + ObtainSchemaGeneric + >, + TSchema, + ObtainSchemaGeneric + > & ObtainSchemaGeneric; + model( + name: string, + schema?: Schema, + collection?: string, + options?: CompileModelOptions + ): U; + model(name: string, schema?: Schema, collection?: string, options?: CompileModelOptions): Model; + + /** Returns an array of model names created on this connection. */ + modelNames(): Array; + + /** The name of the database this connection points to. */ + readonly name: string; + + /** Opens the connection with a URI using `MongoClient.connect()`. */ + openUri(uri: string, options?: ConnectOptions): Promise; + + /** The password specified in the URI */ + readonly pass: string; + + /** + * The port portion of the URI. If multiple hosts, such as a replica set, + * this will contain the port from the first host name in the URI. + */ + readonly port: number; + + /** Declares a plugin executed on all schemas you pass to `conn.model()` */ + plugin(fn: (schema: S, opts?: any) => void, opts?: O): Connection; + + /** The plugins that will be applied to all models created on this connection. */ + plugins: Array; + + /** + * Connection ready state + * + * - 0 = disconnected + * - 1 = connected + * - 2 = connecting + * - 3 = disconnecting + * - 99 = uninitialized + */ + readonly readyState: ConnectionStates; + + /** Sets the value of the option `key`. */ + set(key: string, value: any): any; + + /** + * Set the [MongoDB driver `MongoClient`](https://mongodb.github.io/node-mongodb-native/7.0/classes/MongoClient.html) instance + * that this connection uses to talk to MongoDB. This is useful if you already have a MongoClient instance, and want to + * reuse it. + */ + setClient(client: mongodb.MongoClient): this; + + /** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://www.mongodb.com/docs/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://www.mongodb.com/docs/manual/core/retryable-writes/), + * and [transactions](http://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + */ + startSession(options?: ClientSessionOptions): Promise; + + /** + * Makes the indexes in MongoDB match the indexes defined in every model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + */ + syncIndexes(options?: SyncIndexesOptions): Promise; + + /** + * _Requires MongoDB >= 3.6.0._ Executes the wrapped async function + * in a transaction. Mongoose will commit the transaction if the + * async function executes successfully and attempt to retry if + * there was a retryable error. + */ + transaction(fn: (session: mongodb.ClientSession) => Promise, options?: mongodb.TransactionOptions): Promise; + + /** Switches to a different database using the same connection pool. */ + useDb(name: string, options?: { useCache?: boolean }): Connection; + + /** The username specified in the URI */ + readonly user: string; + + /** Watches the entire underlying database for changes. Similar to [`Model.watch()`](/docs/api/model.html#model_Model-watch). */ + watch(pipeline?: Array, options?: mongodb.ChangeStreamOptions): mongodb.ChangeStream; + + withSession(executor: (session: ClientSession) => Promise): Promise; + } + + export class BaseConnection extends Connection {} +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/cursor.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/cursor.d.ts new file mode 100644 index 00000000..ced66e56 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/cursor.d.ts @@ -0,0 +1,67 @@ +declare module 'mongoose' { + + import stream = require('stream'); + + type CursorFlag = 'tailable' | 'oplogReplay' | 'noCursorTimeout' | 'awaitData' | 'partial'; + + interface EachAsyncOptions { + parallel?: number; + batchSize?: number; + continueOnError?: boolean; + signal?: AbortSignal; + } + + class Cursor extends stream.Readable { + [Symbol.asyncIterator](): Cursor, Options, IteratorResult>; + + [Symbol.asyncDispose](): Promise; + + /** + * Adds a [cursor flag](https://mongodb.github.io/node-mongodb-native/7.0/classes/FindCursor.html#addCursorFlag). + * Useful for setting the `noCursorTimeout` and `tailable` flags. + */ + addCursorFlag(flag: CursorFlag, value: boolean): this; + + /** + * Marks this cursor as closed. Will stop streaming and subsequent calls to + * `next()` will error. + */ + close(): Promise; + + /** + * Destroy this cursor, closing the underlying cursor. Will stop streaming + * and subsequent calls to `next()` will error. + */ + destroy(): this; + + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind(): this; + + /** + * Execute `fn` for every document(s) in the cursor. If batchSize is provided + * `fn` will be executed for each batch of documents. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + */ + eachAsync(fn: (doc: DocType[], i: number) => any, options: EachAsyncOptions & { batchSize: number }): Promise; + eachAsync(fn: (doc: DocType, i: number) => any, options?: EachAsyncOptions): Promise; + + /** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or `.next()` + */ + map(fn: (res: DocType) => ResultType): Cursor; + + /** + * Get the next document from this cursor. Will return `null` when there are + * no documents left. + */ + next(): Promise; + + options: Options; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/document.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/document.d.ts new file mode 100644 index 00000000..276cb3d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/document.d.ts @@ -0,0 +1,345 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** A list of paths to skip. If set, Mongoose will validate every modified path that is not in this list. */ + type pathsToSkip = string[] | string; + + interface ValidateOptions { + /** List of paths to skip. If set, Mongoose will validate every modified path that is not in this list. */ + pathsToSkip?: pathsToSkip; + /** set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks */ + middleware?: boolean | SkipMiddlewareOptions; + } + + interface ValidateSyncOptions extends Omit { + /** `validateSync()` does not run middleware. Use `validate()` if you need middleware. */ + middleware?: never; + [k: string]: any; + } + + interface DocumentSetOptions { + merge?: boolean; + + [key: string]: any; + } + + class ModifiedPathsSnapshot {} + + /** + * Generic types for Document: + * * T - the type of _id + * * TQueryHelpers - Object with any helpers that should be mixed into the Query type + * * DocType - the type of the actual Document created + */ + class Document, TSchemaOptions = {}> { + constructor(doc?: any); + + /** This documents _id. */ + _id: T; + + /** Assert that a given path or paths is populated. Throws an error if not populated. */ + $assertPopulated(path: string | string[], values?: Partial): PopulateDocumentResult, DocType>; + + /** Clear the document's modified paths. */ + $clearModifiedPaths(): this; + + /** Returns a deep clone of this document */ + $clone(): this; + + /** + * Creates a snapshot of this document's internal change tracking state. You can later + * reset this document's change tracking state using `$restoreModifiedPathsSnapshot()`. + */ + $createModifiedPathsSnapshot(): ModifiedPathsSnapshot; + + /* Get all subdocs (by bfs) */ + $getAllSubdocs(): Document[]; + + /** Don't run validation on this path or persist changes to this path. */ + $ignore(path: string): void; + + /** Checks if a path is set to its default. If no path set, checks if any path is set to its default. */ + $isDefault(path?: string): boolean; + + /** Getter/setter, determines whether the document was removed or not. */ + $isDeleted(val?: boolean): boolean; + + /** Returns an array of all populated documents associated with the query */ + $getPopulatedDocs(): Document[]; + + /** + * Increments the numeric value at `path` by the given `val`. + * When you call `save()` on this document, Mongoose will send a + * `$inc` as opposed to a `$set`. + */ + $inc(path: string | string[], val?: number): this; + + /** + * Returns true if the given path is nullish or only contains empty objects. + * Useful for determining whether this subdoc will get stripped out by the + * [minimize option](/docs/guide.html#minimize). + */ + $isEmpty(path: string): boolean; + + /** Checks if a path is invalid */ + $isValid(path: string): boolean; + + /** + * Empty object that you can use for storing properties on the document. This + * is handy for passing data to middleware without conflicting with Mongoose + * internals. + */ + $locals: Record; + + /** Marks a path as valid, removing existing validation errors. */ + $markValid(path: string): void; + + /** Returns the model with the given name on this document's associated connection. */ + $model>(name: string): ModelType; + $model>(): ModelType; + + /** + * A string containing the current operation that Mongoose is executing + * on this document. Can be `null`, `'save'`, `'validate'`, or `'remove'`. + */ + $op: 'save' | 'validate' | 'remove' | null; + + /** + * Restore this document's change tracking state to the given snapshot. + * Note that `$restoreModifiedPathsSnapshot()` does **not** modify the document's + * properties, just resets the change tracking state. + */ + $restoreModifiedPathsSnapshot(snapshot: ModifiedPathsSnapshot): this; + + /** + * Getter/setter around the session associated with this document. Used to + * automatically set `session` if you `save()` a doc that you got from a + * query with an associated session. + */ + $session(session?: ClientSession | null): ClientSession | null; + + /** Alias for `set()`, used internally to avoid conflicts */ + $set(path: string | Record, val: any, type: any, options?: DocumentSetOptions): this; + $set(path: string | Record, val: any, options?: DocumentSetOptions): this; + $set(value: string | Record): this; + + /** Set this property to add additional query filters when Mongoose saves this document and `isNew` is false. */ + $where: Record; + + /** If this is a discriminator model, `baseModelName` is the name of the base model. */ + baseModelName?: string; + + /** Collection the model uses. */ + collection: Collection; + + /** Connection the model uses. */ + db: Connection; + + /** Removes this document from the db. */ + deleteOne(options?: QueryOptions): QueryWithHelpers< + mongodb.DeleteResult, + this, + TQueryHelpers, + DocType, + 'deleteOne' + >; + + /** + * Takes a populated field and returns it to its unpopulated state. If called with + * no arguments, then all populated fields are returned to their unpopulated state. + */ + depopulate(path?: string | string[]): MergeType; + + /** + * Returns the list of paths that have been directly modified. A direct + * modified path is a path that you explicitly set, whether via `doc.foo = 'bar'`, + * `Object.assign(doc, { foo: 'bar' })`, or `doc.set('foo', 'bar')`. + */ + directModifiedPaths(): Array; + + /** + * Returns true if this document is equal to another document. + * + * Documents are considered equal when they have matching `_id`s, unless neither + * document has an `_id`, in which case this function falls back to using + * `deepEqual()`. + */ + equals(doc: Document): boolean; + + /** Returns the current validation errors. */ + errors?: Error.ValidationError; + + /** Returns the value of a path. */ + get(path: T, type?: any, options?: any): DocType[T]; + get(path: string, type?: any, options?: any): any; + + /** + * Returns the changes that happened to the document + * in the format that will be sent to MongoDB. + */ + $getChanges(): UpdateQuery; + + /** + * Returns the changes that happened to the document + * in the format that will be sent to MongoDB. + * @deprecated Use `$getChanges()` instead. + */ + getChanges(): UpdateQuery; + + /** Signal that we desire an increment of this documents version. */ + increment(): this; + + /** + * Initializes the document without setters or marking anything modified. + * Called internally after a document is returned from mongodb. Normally, + * you do **not** need to call this function on your own. + */ + init(obj: AnyObject, opts?: AnyObject): this; + + /** Marks a path as invalid, causing validation to fail. */ + invalidate(path: T, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null; + invalidate(path: string, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null; + + /** Returns true if `path` was directly set and modified, else false. */ + isDirectModified(path: T | Array): boolean; + isDirectModified(path: string | Array): boolean; + + /** Checks if `path` was explicitly selected. If no projection, always returns true. */ + isDirectSelected(path: T): boolean; + isDirectSelected(path: string): boolean; + + /** Checks if `path` is in the `init` state, that is, it was set by `Document#init()` and not modified since. */ + isInit(path: T): boolean; + isInit(path: string): boolean; + + /** + * Returns true if any of the given paths are modified, else false. If no arguments, returns `true` if any path + * in this document is modified. + */ + isModified(path?: T | Array, options?: { ignoreAtomics?: boolean } | null): boolean; + isModified(path?: string | Array, options?: { ignoreAtomics?: boolean } | null): boolean; + + /** Boolean flag specifying if the document is new. */ + isNew: boolean; + + /** Checks if `path` was selected in the source query which initialized this document. */ + isSelected(path: T): boolean; + isSelected(path: string): boolean; + + /** Marks the path as having pending changes to write to the db. */ + markModified(path: T, scope?: any): void; + markModified(path: string, scope?: any): void; + + /** Returns the model with the given name on this document's associated connection. */ + model>(name: string): ModelType; + model>(): ModelType; + + /** Returns the list of paths that have been modified. */ + modifiedPaths(options?: { includeChildren?: boolean }): Array; + + /** + * Overwrite all values in this document with the values of `obj`, except + * for immutable properties. Behaves similarly to `set()`, except for it + * unsets all properties that aren't in `obj`. + */ + overwrite(obj: AnyObject): this; + + /** + * If this document is a subdocument or populated document, returns the + * document's parent. Returns undefined otherwise. + */ + $parent(): Document | undefined; + + /** Populates document references. */ + populate(path: string | PopulateOptions | (string | PopulateOptions)[]): Promise, DocType>>; + populate(path: string, select?: string | AnyObject, model?: Model, match?: AnyObject, options?: PopulateOptions): Promise, DocType>>; + + /** Gets _id(s) used during population of the given `path`. If the path was not populated, returns `undefined`. */ + populated(path: string): any; + + /** Sends a replaceOne command with this document `_id` as the query selector. */ + replaceOne(replacement?: AnyObject, options?: QueryOptions | null): Query; + + /** Saves this document by inserting a new document into the database if [document.isNew](/docs/api/document.html#document_Document-isNew) is `true`, or sends an [updateOne](/docs/api/document.html#document_Document-updateOne) operation with just the modified paths if `isNew` is `false`. */ + save(options?: SaveOptions): Promise; + + /** The document's schema. */ + schema: Schema; + + /** Sets the value of a path, or many paths. */ + set(path: T, val: DocType[T], type: any, options?: DocumentSetOptions): this; + set(path: string | Record, val: any, type: any, options?: DocumentSetOptions): this; + set(path: string | Record, val: any, options?: DocumentSetOptions): this; + set(value: string | Record): this; + + toBSON(): Require_id; + + /** The return value of this method is used in calls to JSON.stringify(doc). */ + toJSON( + this: PopulatedDocumentMarker, + options: { depopulate: true } + ): Default__v, TSchemaOptions>; + toJSON( + this: PopulatedDocumentMarker, + options: O + ): ToObjectReturnType; + toJSON( + this: PopulatedDocumentMarker, + options: O + ): ToObjectReturnType; + toJSON( + this: PopulatedDocumentMarker + ): DefaultToObjectReturnType; + toJSON(options: O): ToObjectReturnType; + toJSON(options?: ToObjectOptions): DefaultToObjectReturnType; + toJSON(options?: ToObjectOptions): Default__v, ResolveSchemaOptions>; + + /** Converts this document into a plain-old JavaScript object ([POJO](https://masteringjs.io/tutorials/fundamentals/pojo)). */ + toObject( + this: PopulatedDocumentMarker, + options: { depopulate: true } + ): Default__v, TSchemaOptions>; + toObject( + this: PopulatedDocumentMarker, + options: O + ): ToObjectReturnType; + toObject( + this: PopulatedDocumentMarker, + options: O + ): ToObjectReturnType; + toObject( + this: PopulatedDocumentMarker + ): DefaultToObjectReturnType; + toObject(options: O): ToObjectReturnType; + toObject(options?: ToObjectOptions): DefaultToObjectReturnType; + toObject(options?: ToObjectOptions): Default__v, ResolveSchemaOptions>; + + /** Clears the modified state on the specified path. */ + unmarkModified(path: T): void; + unmarkModified(path: string): void; + + /** Sends an updateOne command with this document `_id` as the query selector. */ + updateOne(update?: UpdateQuery | UpdateWithAggregationPipeline, options?: QueryOptions | null): Query; + + /** Executes registered validation rules for this document. */ + validate(pathsToValidate?: T | T[], options?: Omit & AnyObject): Promise; + validate(pathsToValidate?: pathsToValidate, options?: Omit & AnyObject): Promise; + validate(options: ValidateOptions): Promise; + + /** + * Executes registered validation rules (skipping asynchronous validators) for this document. + * @deprecated Use `validate()` instead. `validateSync()` does not run middleware and will be removed in Mongoose 10. + */ + validateSync(options: ValidateSyncOptions): Error.ValidationError | null; + /** + * Executes registered validation rules (skipping asynchronous validators) for this document. + * @deprecated Use `validate()` instead. `validateSync()` does not run middleware and will be removed in Mongoose 10. + */ + validateSync(pathsToValidate?: T | T[], options?: Omit): Error.ValidationError | null; + /** + * Executes registered validation rules (skipping asynchronous validators) for this document. + * @deprecated Use `validate()` instead. `validateSync()` does not run middleware and will be removed in Mongoose 10. + */ + validateSync(pathsToValidate?: pathsToValidate, options?: Omit): Error.ValidationError | null; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/error.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/error.d.ts new file mode 100644 index 00000000..cf34cb69 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/error.d.ts @@ -0,0 +1,143 @@ +declare class NativeError extends global.Error { } + +declare module 'mongoose' { + import mongodb = require('mongodb'); + + type CastError = Error.CastError; + type SyncIndexesError = Error.SyncIndexesError; + + export class MongooseError extends global.Error { + constructor(msg: string); + + /** The type of error. "MongooseError" for generic errors. */ + name: string; + + static messages: any; + + static Messages: any; + } + + class Error extends MongooseError { } + + namespace Error { + + export class CastError extends MongooseError { + name: 'CastError'; + stringValue: string; + kind: string; + value: any; + path: string; + reason?: NativeError | null; + + constructor(type: string, value: any, path: string, reason?: NativeError, schemaType?: SchemaType); + } + export class SyncIndexesError extends MongooseError { + name: 'SyncIndexesError'; + errors?: Record; + + constructor(type: string, value: any, path: string, reason?: NativeError, schemaType?: SchemaType); + } + + export class DivergentArrayError extends MongooseError { + name: 'DivergentArrayError'; + } + + export class MissingSchemaError extends MongooseError { + name: 'MissingSchemaError'; + } + + export class DocumentNotFoundError extends MongooseError { + name: 'DocumentNotFoundError'; + result: any; + numAffected: number; + filter: any; + query: any; + } + + export class ObjectExpectedError extends MongooseError { + name: 'ObjectExpectedError'; + path: string; + } + + export class ObjectParameterError extends MongooseError { + name: 'ObjectParameterError'; + } + + export class OverwriteModelError extends MongooseError { + name: 'OverwriteModelError'; + } + + export class ParallelSaveError extends MongooseError { + name: 'ParallelSaveError'; + } + + export class ParallelValidateError extends MongooseError { + name: 'ParallelValidateError'; + } + + export class MongooseServerSelectionError extends MongooseError { + name: 'MongooseServerSelectionError'; + } + + export class StrictModeError extends MongooseError { + name: 'StrictModeError'; + isImmutableError: boolean; + path: string; + } + + export class ValidationError extends MongooseError { + name: 'ValidationError'; + + errors: { [path: string]: ValidatorError | CastError }; + addError: (path: string, error: ValidatorError | CastError) => void; + + /** Index of the document in insertMany() that failed validation (only set for unordered insertMany) */ + index?: number; + + constructor(instance?: MongooseError); + } + + export class ValidatorError extends MongooseError { + name: 'ValidatorError'; + properties: { + message: string, + type?: string, + path?: string, + value?: any, + reason?: any + }; + kind: string; + path: string; + value: any; + reason?: MongooseError | null; + + constructor(properties: { + message?: string, + type?: string, + path?: string, + value?: any, + reason?: any + }); + } + + export class VersionError extends MongooseError { + name: 'VersionError'; + version: number; + modifiedPaths: Array; + + constructor(doc: Document, currentVersion: number, modifiedPaths: Array); + } + + export class StrictPopulateError extends MongooseError { + name: 'StrictPopulateError'; + path: string; + } + + export class MongooseBulkSaveIncompleteError extends MongooseError { + name: 'MongooseBulkSaveIncompleteError'; + modelName: string; + bulkWriteResult: mongodb.BulkWriteResult; + numDocumentsNotUpdated: number; + } + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/expressions.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/expressions.d.ts new file mode 100644 index 00000000..4a56c833 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/expressions.d.ts @@ -0,0 +1,3069 @@ +declare module 'mongoose' { + + /** + * [Expressions reference](https://www.mongodb.com/docs/manual/meta/aggregation-quick-reference/#expressions) + */ + type AggregationVariables = + SpecialPathVariables | + '$$NOW' | + '$$CLUSTER_TIME' | + '$$DESCEND' | + '$$PRUNE' | + '$$KEEP'; + + type SpecialPathVariables = + '$$ROOT' | + '$$CURRENT' | + '$$REMOVE'; + + export namespace Expression { + export interface Abs { + /** + * Returns the absolute value of a number. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/abs/#mongodb-expression-exp.-abs + */ + $abs: Path | ArithmeticExpressionOperator; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/add/#mongodb-expression-exp.-add + */ + $add: Expression[]; + } + + export interface Ceil { + /** + * Returns the smallest integer greater than or equal to the specified number. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/ceil/#mongodb-expression-exp.-ceil + */ + $ceil: NumberExpression; + } + + export interface Divide { + /** + * Returns the result of dividing the first number by the second. Accepts two argument expressions. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/divide/#mongodb-expression-exp.-divide + */ + $divide: NumberExpression[]; + } + + export interface Exp { + /** + * Raises e to the specified exponent. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/exp/#mongodb-expression-exp.-exp + */ + $exp: NumberExpression; + } + + export interface Floor { + /** + * Returns the largest integer less than or equal to the specified number. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/floor/#mongodb-expression-exp.-floor + */ + $floor: NumberExpression; + } + + export interface Ln { + /** + * Calculates the natural log of a number. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/ln/#mongodb-expression-exp.-ln + */ + $ln: NumberExpression; + } + + export interface Log { + /** + * Calculates the log of a number in the specified base. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/log/#mongodb-expression-exp.-log + */ + $log: [NumberExpression, NumberExpression]; + } + + export interface Log10 { + /** + * Calculates the log base 10 of a number. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/log10/#mongodb-expression-exp.-log10 + */ + $log10: NumberExpression; + } + + export interface Mod { + /** + * Returns the remainder of the first number divided by the second. Accepts two argument expressions. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/mod/#mongodb-expression-exp.-mod + */ + $mod: [NumberExpression, NumberExpression]; + } + export interface Multiply { + /** + * Multiplies numbers to return the product. Accepts any number of argument expressions. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/multiply/#mongodb-expression-exp.-multiply + */ + $multiply: NumberExpression[]; + } + + export interface Pow { + /** + * Raises a number to the specified exponent. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/pow/#mongodb-expression-exp.-pow + */ + $pow: [NumberExpression, NumberExpression]; + } + + export interface Round { + /** + * Rounds a number to to a whole integer or to a specified decimal place. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/round/#mongodb-expression-exp.-round + */ + $round: [NumberExpression, NumberExpression?]; + } + + export interface Sqrt { + /** + * Calculates the square root. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/sqrt/#mongodb-expression-exp.-sqrt + */ + $sqrt: NumberExpression; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/subtract/#mongodb-expression-exp.-subtract + */ + $subtract: (NumberExpression | DateExpression)[]; + } + + export interface Trunc { + /** + * Truncates a number to a whole integer or to a specified decimal place. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/trunc/#mongodb-expression-exp.-trunc + */ + $trunc: [NumberExpression, NumberExpression?]; + } + + export interface Sin { + /** + * Returns the sine of a value that is measured in radians. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/sin/#mongodb-expression-exp.-sin + */ + $sin: NumberExpression; + } + + export interface Cos { + /** + * Returns the cosine of a value that is measured in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/cos/#mongodb-expression-exp.-cos + */ + $cos: NumberExpression; + } + + export interface Tan { + /** + * Returns the tangent of a value that is measured in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/tan/#mongodb-expression-exp.-tan + */ + $tan: NumberExpression; + } + + export interface Asin { + /** + * Returns the inverse sin (arc sine) of a value in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/asin/#mongodb-expression-exp.-asin + */ + $asin: NumberExpression; + } + + export interface Acos { + /** + * Returns the inverse cosine (arc cosine) of a value in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/acos/#mongodb-expression-exp.-acos + */ + $acos: NumberExpression; + } + + export interface Atan { + /** + * Returns the inverse tangent (arc tangent) of a value in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan/#mongodb-expression-exp.-atan + */ + $atan: NumberExpression; + } + + 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. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan2/#mongodb-expression-exp.-atan2 + */ + $atan2: NumberExpression; + } + + export interface Asinh { + /** + * Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/asinh/#mongodb-expression-exp.-asinh + */ + $asinh: NumberExpression; + } + + export interface Acosh { + /** + * Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/acosh/#mongodb-expression-exp.-acosh + */ + $acosh: NumberExpression; + } + + export interface Atanh { + + /** + * Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/atanh/#mongodb-expression-exp.-atanh + */ + $atanh: NumberExpression; + } + + export interface Sinh { + /** + * Returns the hyperbolic sine of a value that is measured in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/sinh/#mongodb-expression-exp.-sinh + */ + $sinh: NumberExpression; + } + + export interface Cosh { + /** + * Returns the hyperbolic cosine of a value that is measured in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/cosh/#mongodb-expression-exp.-cosh + */ + $cosh: NumberExpression; + } + + export interface Tanh { + /** + * Returns the hyperbolic tangent of a value that is measured in radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/tanh/#mongodb-expression-exp.-tanh + */ + $tanh: NumberExpression; + } + + export interface DegreesToRadians { + /** + * Converts a value from degrees to radians. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/degreesToRadians/#mongodb-expression-exp.-degreesToRadians + */ + $degreesToRadians: NumberExpression; + } + + export interface RadiansToDegrees { + /** + * Converts a value from radians to degrees. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/radiansToDegrees/#mongodb-expression-exp.-radiansToDegrees + */ + $radiansToDegrees: NumberExpression; + } + + export interface Meta { + /** + * Access available per-document metadata related to the aggregation operation. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta + */ + $meta: 'textScore' | 'indexKey'; + } + + export interface DateAdd { + /** + * Adds a number of time units to a date object. + * + * @version 5.0.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateAdd/#mongodb-expression-exp.-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: DateExpression; + /** + * The unit used to measure the amount of time added to the startDate. The unit is an expression that resolves to one of the following strings: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + */ + unit: StringExpression; + /** + * The number of units added to the startDate. The amount is an expression that resolves to an integer or long. The amount can also resolve to an integral decimal or a double if that value can be converted to a long without loss of precision. + */ + amount: NumberExpression; + /** + * The timezone to carry out the operation. 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?: tzExpression; + }; + } + + export interface DateDiff { + /** + * Returns the difference between two dates. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateDiff/#mongodb-expression-exp.-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: DateExpression; + /** + * The end of the time period. The endDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + endDate: DateExpression; + /** + * The time measurement unit between the startDate and endDate. It is an expression that resolves to a string: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + */ + unit: StringExpression; + /** + * The timezone to carry out the operation. 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?: tzExpression; + /** + * Used when the unit is equal to week. Defaults to Sunday. The startOfWeek parameter is an expression that resolves to a case insensitive string: + * - monday (or mon) + * - tuesday (or tue) + * - wednesday (or wed) + * - thursday (or thu) + * - friday (or fri) + * - saturday (or sat) + * - sunday (or sun) + */ + startOfWeek?: StringExpression; + } + } + + // TODO: Can be done better + export interface DateFromParts { + /** + * Constructs a BSON Date object given the date's constituent parts. + * + * @version 3.6 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromParts/#mongodb-expression-exp.-dateFromParts + */ + $dateFromParts: { + /** + * ISO Week Date Year. Can be any expression that evaluates to a number. + * + * Value range: 1-9999 + * + * If the number specified is outside this range, $dateFromParts errors. Starting in MongoDB 4.4, the lower bound for this value is 1. In previous versions of MongoDB, the lower bound was 0. + */ + isoWeekYear?: NumberExpression; + /** + * Week of year. Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-53 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + isoWeek?: NumberExpression; + /** + * Day of week (Monday 1 - Sunday 7). Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-7 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + isoDayOfWeek?: NumberExpression; + /** + * Calendar year. Can be any expression that evaluates to a number. + * + * Value range: 1-9999 + * + * If the number specified is outside this range, $dateFromParts errors. Starting in MongoDB 4.4, the lower bound for this value is 1. In previous versions of MongoDB, the lower bound was 0. + */ + year?: NumberExpression; + /** + * Month. Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-12 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + month?: NumberExpression; + /** + * Day of month. Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-31 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + day?: NumberExpression; + /** + * Hour. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-23 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + hour?: NumberExpression; + /** + * Minute. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-59 Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + minute?: NumberExpression; + /** + * Second. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-59 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + second?: NumberExpression; + /** + * Millisecond. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-999 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + millisecond?: NumberExpression; + /** + * The timezone to carry out the operation. 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?: tzExpression; + }; + } + + export interface DateFromString { + /** + * Converts a date/time string to a date object. + * + * @version 3.6 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromString/#mongodb-expression-exp.-dateFromString + */ + $dateFromString: { + dateString: StringExpression; + /** + * 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. For a list of specifiers available, see Format Specifiers. + * + * If unspecified, $dateFromString uses "%Y-%m-%dT%H:%M:%S.%LZ" as the default format. + * @version 4.0 + */ + format?: FormatString; + /** + * The time zone to use to format the date. + * + * Note: If the dateString argument is formatted like '2017-02-08T12:10:40.787Z', in which the 'Z' at the end indicates Zulu time (UTC time zone), you cannot specify the timezone argument. + */ + timezone?: tzExpression; + /** + * Optional. 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; + /** + * Optional. 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; + }; + } + + export interface DateSubtract { + /** + * Subtracts a number of time units from a date object. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateSubtract/#mongodb-expression-exp.-dateSubtract + */ + $dateSubtract: { + /** + * The beginning date, in UTC, for the subtraction operation. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + startDate: DateExpression; + /** + * The unit of time, specified as an expression that must resolve to one of these strings: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + * + * Together, binSize and unit specify the time period used in the $dateTrunc calculation. + */ + unit: StringExpression; + /** + * The number of units subtracted from the startDate. The amount is an expression that resolves to an integer or long. The amount can also resolve to an integral decimal and or a double if that value can be converted to a long without loss of precision. + */ + amount: NumberExpression; + /** + * The timezone to carry out the operation. 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?: tzExpression; + }; + } + + export interface DateToParts { + /** + * Returns a document containing the constituent parts of a date. + * + * @version 3.6 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToParts/#mongodb-expression-exp.-dateToParts + */ + $dateToParts: { + /** + * The input date for which to return parts. can be any expression that resolves to a Date, a Timestamp, or an ObjectID. For more information on expressions, see Expressions. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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. + * + * @version 3.6 + */ + timezone?: tzExpression; + /** + * If set to true, modifies the output document to use ISO week date fields. Defaults to false. + */ + iso8601?: boolean; + }; + } + + export interface DateToString { + /** + * Returns the date as a formatted string. + * + * @version 3.6 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToString/#mongodb-expression-exp.-dateToString + */ + $dateToString: { + /** + * The date to convert to string. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The date format specification. can be any string literal, containing 0 or more format specifiers. For a list of specifiers available, see Format Specifiers. + * + * If unspecified, $dateToString uses "%Y-%m-%dT%H:%M:%S.%LZ" as the default format. + * + * Changed in version 4.0: The format field is optional if featureCompatibilityVersion (fCV) is set to "4.0" or greater. For more information on fCV, see setFeatureCompatibilityVersion. + */ + format?: FormatString; + /** + * The timezone of the operation result. 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. + * + * @version 3.6 + */ + timezone?: tzExpression; + /** + * The value to return if the date is null or missing. The arguments can be any valid expression. + * + * If unspecified, $dateToString returns null if the date is null or missing. + * + * Changed in version 4.0: Requires featureCompatibilityVersion (fCV) set to "4.0" or greater. For more information on fCV, see setFeatureCompatibilityVersion. + */ + onNull?: Expression; + }; + } + + export interface DateTrunc { + /** + * Truncates a date. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateTrunc/#mongodb-expression-exp.-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: DateExpression; + /** + * The unit of time, specified as an expression that must resolve to one of these strings: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + * + * Together, binSize and unit specify the time period used in the $dateTrunc calculation. + */ + unit: StringExpression; + /** + * 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?: NumberExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + /** + * Used when the unit is equal to week. Defaults to Sunday. The startOfWeek parameter is an expression that resolves to a case insensitive string: + * - monday (or mon) + * - tuesday (or tue) + * - wednesday (or wed) + * - thursday (or thu) + * - friday (or fri) + * - saturday (or sat) + * - sunday (or sun) + */ + startOfWeek?: StringExpression; + } + } + + export interface DayOfMonth { + /** + * Returns the day of the month for a date as a number between 1 and 31. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfMonth/#mongodb-expression-exp.-dayOfMonth + */ + $dayOfMonth: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface DayOfWeek { + /** + * Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday). + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfWeek/#mongodb-expression-exp.-dayOfWeek + */ + $dayOfWeek: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface DayOfYear { + /** + * Returns the day of the year for a date as a number between 1 and 366 (leap year). + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfYear/#mongodb-expression-exp.-dayOfYear + */ + $dayOfYear: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface Hour { + /** + * Returns the hour for a date as a number between 0 and 23. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/hour/#mongodb-expression-exp.-hour + */ + $hour: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface IsoDayOfWeek { + /** + * Returns the weekday number in ISO 8601 format, ranging from 1 (for Monday) to 7 (for Sunday). + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoDayOfWeek/#mongodb-expression-exp.-isoDayOfWeek + */ + $isoDayOfWeek: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + 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. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeek/#mongodb-expression-exp.-isoWeek + */ + $isoWeek: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + 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). + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeekYear/#mongodb-expression-exp.-isoWeekYear + */ + $isoWeekYear: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface Millisecond { + /** + * Returns the milliseconds of a date as a number between 0 and 999. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/millisecond/#mongodb-expression-exp.-millisecond + */ + $millisecond: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface Minute { + /** + * Returns the minute for a date as a number between 0 and 59. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/minute/#mongodb-expression-exp.-minute + */ + $minute: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface Month { + /** + * Returns the month for a date as a number between 1 (January) and 12 (December). + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/month/#mongodb-expression-exp.-month + */ + $month: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface Second { + /** + * Returns the seconds for a date as a number between 0 and 60 (leap seconds). + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/second/#mongodb-expression-exp.-second + */ + $second: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface ToDate { + /** + * Converts value to a Date. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDate/#mongodb-expression-exp.-toDate + */ + $toDate: Expression; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/week/#mongodb-expression-exp.-week + */ + $week: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface Year { + /** + * Returns the year for a date as a number (e.g. 2014). + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/year/#mongodb-expression-exp.-year + */ + $year: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. 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?: tzExpression; + }; + } + + export interface And { + /** + * Returns true only when all its expressions evaluate to true. Accepts any number of argument expressions. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/and/#mongodb-expression-exp.-and + */ + $and: (Expression | Record)[]; + } + + export interface Not { + /** + * Returns the boolean value that is the opposite of its argument expression. Accepts a single argument expression. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/not/#mongodb-expression-exp.-not + */ + $not: [Expression]; + } + + export interface Or { + /** + * Returns true when any of its expressions evaluates to true. Accepts any number of argument expressions. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/or/#mongodb-expression-exp.-or + */ + $or: (Expression | Record)[]; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/cmp/#mongodb-expression-exp.-cmp + */ + $cmp: [Record | Expression, Record | Expression]; + } + + export interface Eq { + /** + * Returns true if the values are equivalent. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/eq/#mongodb-expression-exp.-eq + */ + $eq: AnyExpression | [AnyExpression, AnyExpression]; + } + + export interface Gt { + /** + * Returns true if the first value is greater than the second. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/gt/#mongodb-expression-exp.-gt + */ + $gt: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Gte { + /** + * Returns true if the first value is greater than or equal to the second. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/gte/#mongodb-expression-exp.-gte + */ + $gte: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Lt { + /** + * Returns true if the first value is less than the second. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/lt/#mongodb-expression-exp.-lt + */ + $lt: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Lte { + /** + * Returns true if the first value is less than or equal to the second. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/lte/#mongodb-expression-exp.-lte + */ + $lte: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Ne { + /** + * Returns true if the values are not equivalent. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/ne/#mongodb-expression-exp.-ne + */ + $ne: Expression | [Expression, Expression | NullExpression] | null; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/#mongodb-expression-exp.-cond + */ + $cond: { if: Expression, then: AnyExpression, else: AnyExpression } | [BooleanExpression, AnyExpression, AnyExpression]; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/ifNull/#mongodb-expression-exp.-ifNull + */ + $ifNull: Expression[]; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/#mongodb-expression-exp.-switch + */ + $switch: { + /** + * An array of control branch documents. Each branch is a document with the following fields: + * - $case + * - $then + */ + branches: { case: Expression, then: Expression }[]; + /** + * 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; + }; + } + + export interface ArrayElemAt { + /** + * Returns the element at the specified array index. + * + * @version 3.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayElemAt/#mongodb-expression-exp.-arrayElemAt + */ + $arrayElemAt: [ArrayExpression, NumberExpression]; + } + + export interface ArrayToObject { + /** + * Converts an array of key value pairs to a document. + * + * @version 3.4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayToObject/#mongodb-expression-exp.-arrayToObject + */ + $arrayToObject: ArrayExpression; + } + + export interface ConcatArrays { + /** + * Concatenates arrays to return the concatenated array. + * + * @version 3.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/concatArrays/#mongodb-expression-exp.-concatArrays + */ + $concatArrays: Expression[]; + } + + export interface Filter { + /** + * Selects a subset of the array to return an array with only the elements that match the filter condition. + * + * @version 3.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/filter/#mongodb-expression-exp.-filter + */ + $filter: { + /** + * An expression that resolves to an array. + */ + input: ArrayExpression; + /** + * 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; + /** + * 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: BooleanExpression; + /** + * 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. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/filter/#using-the-limit-field + */ + limit?: NumberExpression; + } + } + + export interface First { + /** + * Returns the first array element. Distinct from $first accumulator. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/#mongodb-expression-exp.-first + */ + $first: Expression; + } + + export interface FirstN { + /** + * $firstN can be used as an aggregation accumulator or array operator. + * As an aggregation accumulator, it returns an aggregation of the first n elements within a group. + * As an array operator, it returns the specified number of elements from the beginning of an array. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/#mongodb-expression-exp.-first + */ + $firstN: { + input: Expression + n: Expression, + }; + } + + export interface In { + /** + * Returns a boolean indicating whether a specified value is in an array. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/in/#mongodb-expression-exp.-in + */ + $in: [Expression, ArrayExpression]; + } + + export interface IndexOfArray { + /** + * Searches an array for an occurrence of a specified value and returns the array index of the first occurrence. If the substring is not found, returns -1. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfArray/#mongodb-expression-exp.-indexOfArray + */ + $indexOfArray: [ArrayExpression, Expression] | [ArrayExpression, Expression, NumberExpression] | [ArrayExpression, Expression, NumberExpression, NumberExpression]; + } + + export interface IsArray { + /** + * Determines if the operand is an array. Returns a boolean. + * + * @version 3.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/isArray/#mongodb-expression-exp.-isArray + */ + $isArray: [Expression]; + } + + export interface Last { + /** + * Returns the last array element. Distinct from $last accumulator. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/#mongodb-expression-exp.-last + */ + $last: Expression; + } + + export interface LastN { + /** + * $lastN can be used as an aggregation accumulator or array operator. + * As an aggregation accumulator, it an aggregation of the last n elements within a group. + * As an array operator, it returns the specified number of elements from the end of an array. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/#mongodb-group-grp.-lastN + */ + $lastN: { + input: Expression + n: Expression, + }; + } + + export interface LinearFill { + /** + * Fills null and missing fields in a window using linear interpolation based on surrounding field values. + * + * @version 5.3 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/linearFill + */ + $linearFill: Expression + } + + 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. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/locf + */ + $locf: Expression + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/map/#mongodb-expression-exp.-map + */ + $map: { + /** + * An expression that resolves to an array. + */ + input: ArrayExpression; + /** + * 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; + /** + * 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; + }; + } + + export interface ObjectToArray { + /** + * Converts a document to an array of documents representing key-value pairs. + * + * @version 3.4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/objectToArray/#mongodb-expression-exp.-objectToArray + */ + $objectToArray: ObjectExpression; + } + + export interface Range { + /** + * Outputs an array containing a sequence of integers according to user-defined inputs. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/range/#mongodb-expression-exp.-range + */ + $range: [NumberExpression, NumberExpression] | [NumberExpression, NumberExpression, NumberExpression]; + } + + export interface Reduce { + /** + * Applies an expression to each element in an array and combines them into a single value. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/reduce/#mongodb-expression-exp.-reduce + */ + $reduce: { + /** + * Can be any valid expression that resolves to an array. For more information on expressions, see Expressions. + * + * 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: ArrayExpression; + /** + * 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; + }; + } + + export interface ReverseArray { + /** + * Returns an array with the elements in reverse order. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/reverseArray/#mongodb-expression-exp.-reverseArray + */ + $reverseArray: ArrayExpression; + } + + export interface Size { + /** + * Returns the number of elements in the array. Accepts a single expression as argument. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/size/#mongodb-expression-exp.-size + */ + $size: ArrayExpression; + } + + export interface Slice { + /** + * Returns a subset of an array. + * + * @version 3.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/slice/#mongodb-expression-exp.-slice + */ + $slice: [ArrayExpression, NumberExpression] | [ArrayExpression, NumberExpression, NumberExpression]; + } + + export interface Zip { + /** + * Merge two arrays together. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/zip/#mongodb-expression-exp.-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: ArrayExpression[]; + /** + * 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?: ArrayExpression; + }; + } + + export interface Concat { + /** + * Concatenates any number of strings. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/#mongodb-expression-exp.-concat + */ + $concat: StringExpression[]; + } + + 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. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfBytes/#mongodb-expression-exp.-indexOfBytes + */ + $indexOfBytes: [StringExpression, StringExpression] | [StringExpression, StringExpression, NumberExpression] | [StringExpression, StringExpression, NumberExpression, NumberExpression]; + } + + 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 + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfCP/#mongodb-expression-exp.-indexOfCP + */ + $indexOfCP: [StringExpression, StringExpression] | [StringExpression, StringExpression, NumberExpression] | [StringExpression, StringExpression, NumberExpression, NumberExpression]; + } + + export interface Ltrim { + /** + * Removes whitespace or the specified characters from the beginning of a string. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/#mongodb-expression-exp.-ltrim + */ + $ltrim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. For more information on expressions, see Expressions. + */ + input: StringExpression; + /** + * 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. For the list of whitespace characters, see Whitespace Characters. + */ + chars?: StringExpression; + }; + } + + export interface RegexFind { + /** + * Applies a regular expression (regex) to a string and returns information on the first matched substring. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFind/#mongodb-expression-exp.-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: Expression; // TODO: Resolving to string, which ones? + /** + * 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): + * - "pattern" + * - /pattern/ + * - /pattern/options + * + * Alternatively, you can also specify the regex options with the options field. To specify the s or x options, you must use the options field. + * + * You cannot specify options in both the regex and the options field. + */ + regex: RegExp | string; + /** + * The following are available for use with regular expression. + * + * Note: You cannot specify options in both the regex and the options field. + * + * Option Description + * + * `i` Case insensitivity to match both upper and lower cases. You can specify the option in the options field or as part of the regex field. + * + * `m` For patterns that include anchors (i.e. ^ for the start, $ for the end), match at the beginning or end of each line for strings with multiline values. Without this option, these anchors match at beginning or end of the string. + * If the pattern contains no anchors or if the string value has no newline characters (e.g. \n), the m option has no effect. + * + * `x` "Extended" capability to ignore all white space characters in the pattern unless escaped or included in a character class. + * Additionally, it ignores characters in-between and including an un-escaped hash/pound (#) character and the next new line, so that you may include comments in complicated patterns. This only applies to data characters; white space characters may never appear within special character sequences in a pattern. + * The x option does not affect the handling of the VT character (i.e. code 11). + * You can specify the option only in the options field. + * + * `s` Allows the dot character (i.e. .) to match all characters including newline characters. + * You can specify the option only in the options field. + */ + options?: RegexOptions; + }; + } + + export interface RegexFindAll { + /** + * Applies a regular expression (regex) to a string and returns information on the all matched substrings. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFindAll/#mongodb-expression-exp.-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: Expression; // TODO: Resolving to string, which ones? + /** + * 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): + * - "pattern" + * - /pattern/ + * - /pattern/options + * + * Alternatively, you can also specify the regex options with the options field. To specify the s or x options, you must use the options field. + * + * You cannot specify options in both the regex and the options field. + */ + regex: RegExp | string; + /** + * The following are available for use with regular expression. + * + * Note: You cannot specify options in both the regex and the options field. + * + * Option Description + * + * `i` Case insensitivity to match both upper and lower cases. You can specify the option in the options field or as part of the regex field. + * + * `m` For patterns that include anchors (i.e. ^ for the start, $ for the end), match at the beginning or end of each line for strings with multiline values. Without this option, these anchors match at beginning or end of the string. + * If the pattern contains no anchors or if the string value has no newline characters (e.g. \n), the m option has no effect. + * + * `x` "Extended" capability to ignore all white space characters in the pattern unless escaped or included in a character class. + * Additionally, it ignores characters in-between and including an un-escaped hash/pound (#) character and the next new line, so that you may include comments in complicated patterns. This only applies to data characters; white space characters may never appear within special character sequences in a pattern. + * The x option does not affect the handling of the VT character (i.e. code 11). + * You can specify the option only in the options field. + * + * `s` Allows the dot character (i.e. .) to match all characters including newline characters. + * You can specify the option only in the options field. + */ + options?: RegexOptions; + }; + } + + export interface RegexMatch { + /** + * Applies a regular expression (regex) to a string and returns a boolean that indicates if a match is found or not. + * + * @version 4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexMatch/#mongodb-expression-exp.-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: Expression; // TODO: Resolving to string, which ones? + /** + * 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): + * - "pattern" + * - /pattern/ + * - /pattern/options + * + * Alternatively, you can also specify the regex options with the options field. To specify the s or x options, you must use the options field. + * + * You cannot specify options in both the regex and the options field. + */ + regex: RegExp | string; + /** + * The following are available for use with regular expression. + * + * Note: You cannot specify options in both the regex and the options field. + * + * Option Description + * + * `i` Case insensitivity to match both upper and lower cases. You can specify the option in the options field or as part of the regex field. + * + * `m` For patterns that include anchors (i.e. ^ for the start, $ for the end), match at the beginning or end of each line for strings with multiline values. Without this option, these anchors match at beginning or end of the string. + * If the pattern contains no anchors or if the string value has no newline characters (e.g. \n), the m option has no effect. + * + * `x` "Extended" capability to ignore all white space characters in the pattern unless escaped or included in a character class. + * Additionally, it ignores characters in-between and including an un-escaped hash/pound (#) character and the next new line, so that you may include comments in complicated patterns. This only applies to data characters; white space characters may never appear within special character sequences in a pattern. + * The x option does not affect the handling of the VT character (i.e. code 11). + * You can specify the option only in the options field. + * + * `s` Allows the dot character (i.e. .) to match all characters including newline characters. + * You can specify the option only in the options field. + */ + options?: RegexOptions; + }; + } + + export interface ReplaceOne { + /** + * Replaces the first instance of a matched string in a given input. + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/#mongodb-expression-exp.-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, $replaceOne returns null. + */ + input: StringExpression; + /** + * 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, $replaceOne returns null. + */ + find: StringExpression; + /** + * The string to use to replace the first matched instance of find in input. Can be any valid expression that resolves to a string or a null. + */ + replacement: StringExpression; + }; + } + + export interface ReplaceAll { + /** + * Replaces all instances of a matched string in a given input. + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/#mongodb-expression-exp.-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: StringExpression; + /** + * 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: StringExpression; + /** + * 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: StringExpression; + }; + } + + export interface Rtrim { + /** + * Removes whitespace or the specified characters from the end of a string. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/#mongodb-expression-exp.-rtrim + */ + $rtrim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. For more information on expressions, see Expressions. + */ + input: StringExpression; + /** + * The character(s) to trim from the beginning of the input. + * + * The argument can be any valid expression that resolves to a string. The $rtrim operator breaks down the string into individual UTF code point to trim from input. + * + * If unspecified, $rtrim removes whitespace characters, including the null character. For the list of whitespace characters, see Whitespace Characters. + */ + chars?: StringExpression; + }; + } + + 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. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/#mongodb-expression-exp.-split + */ + $split: [StringExpression, StringExpression]; + } + + export interface StrLenBytes { + /** + * Returns the number of UTF-8 encoded bytes in a string. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenBytes/#mongodb-expression-exp.-strLenBytes + */ + $strLenBytes: StringExpression; + } + + export interface StrLenCP { + /** + * Returns the number of UTF-8 code points in a string. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenCP/#mongodb-expression-exp.-strLenCP + */ + $strLenCP: StringExpression; + } + + 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 https://www.mongodb.com/docs/manual/reference/operator/aggregation/strcasecmp/#mongodb-expression-exp.-strcasecmp + */ + $strcasecmp: [StringExpression, StringExpression]; + } + + export interface Substr { + /** + * Deprecated. Use $substrBytes or $substrCP. + * + * @deprecated 3.4 + * @alias {Expression.SubstrBytes} + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/substr/#mongodb-expression-exp.-substr + */ + $substr: [StringExpression, number, number]; + } + + 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. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrBytes/#mongodb-expression-exp.-substrBytes + */ + $substrBytes: [StringExpression, number, number]; + } + + 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. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrCP/#mongodb-expression-exp.-substrCP + */ + $substrCP: [StringExpression, number, number]; + } + + export interface ToLower { + /** + * Converts a string to lowercase. Accepts a single argument expression. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLower/#mongodb-expression-exp.-toLower + */ + $toLower: StringExpression; + } + + export interface ToString { + /** + * Converts value to a string. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toString/#mongodb-expression-exp.-toString + */ + $toString: Expression; + } + + export interface Trim { + /** + * Removes whitespace or the specified characters from the beginning and end of a string. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/#mongodb-expression-exp.-trim + */ + $trim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. For more information on expressions, see Expressions. + */ + input: StringExpression; + /** + * The character(s) to trim from the beginning of the input. + * + * The argument can be any valid expression that resolves to a string. The $trim operator breaks down the string into individual UTF code point to trim from input. + * + * If unspecified, $trim removes whitespace characters, including the null character. For the list of whitespace characters, see Whitespace Characters. + */ + chars?: StringExpression; + }; + } + + export interface ToUpper { + /** + * Converts a string to uppercase. Accepts a single argument expression. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toUpper/#mongodb-expression-exp.-toUpper + */ + $toUpper: StringExpression; + } + + export interface Literal { + + /** + * Returns a value without parsing. Use for values that the aggregation pipeline may interpret as an + * expression. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/literal/#mongodb-expression-exp.-literal + */ + $literal: any; + } + + export interface GetField { + + /** + * Returns the value of a specified field from a document. If you don't specify an object, $getField returns + * the value of the field from $$CURRENT. + * + * @version 4.4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/getField/#mongodb-expression-exp.-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. + */ + field: StringExpression; + /** + * 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?: ObjectExpression | SpecialPathVariables | NullExpression; + } + } + + export interface Rand { + + /** + * Returns a random float between 0 and 1 each time it is called. + * + * @version 4.4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/rand/#mongodb-expression-exp.-rand + */ + $rand: Record; + } + + export interface SampleRate { + + /** + * Matches a random selection of input documents. The number of documents selected approximates the sample + * rate expressed as a percentage of the total number of documents. + * + * @version 4.4.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/sampleRate/#mongodb-expression-exp.-sampleRate + */ + $sampleRate: number; + } + + export interface MergeObjects { + + /** + * Combines multiple documents into a single document. + * + * @version 3.6 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/#mongodb-expression-exp.-mergeObjects + */ + $mergeObjects: ObjectExpression | ObjectExpression[] | ArrayExpression | Record; + } + + export interface SetField { + + /** + * Adds, updates, or removes a specified field in a document. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/setField/#mongodb-expression-exp.-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: StringExpression; + /** + * Document that contains the field that you want to add or update. input must resolve to an object, missing, + * null, or undefined + */ + input?: ObjectExpression | NullExpression; + /** + * The value that you want to assign to field. value can be any valid expression. + */ + value?: Expression | SpecialPathVariables; + } + } + + export interface UnsetField { + + /** + * Removes a specified field in a document. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/unsetField/#mongodb-expression-exp.-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: StringExpression; + /** + * Document that contains the field that you want to add or update. input must resolve to an object, missing, + * null, or undefined. + */ + input?: ObjectExpression | SpecialPathVariables | NullExpression; + } + } + + export interface Let { + + /** + * Binds variables for use in the specified expression, and returns the result of the expression. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/let/#mongodb-expression-exp.-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. + */ + vars: { [key: string]: Expression; }; + /** + * The expression to evaluate. + */ + in: Expression; + } + } + + export interface AllElementsTrue { + /** + * Evaluates an array as a set and returns true if no element in the array is false. Otherwise, returns false. An + * empty array returns true. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/allElementsTrue/#mongodb-expression-exp.-allElementsTrue + */ + $allElementsTrue: ArrayExpression; + } + + export interface AnyElementsTrue { + /** + * Evaluates an array as a set and returns true if any of the elements are true and false otherwise. An empty + * array returns false. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/anyElementsTrue/#mongodb-expression-exp.-anyElementsTrue + */ + $anyElementTrue: ArrayExpression; + } + + export interface SetDifference { + /** + * Takes two sets and returns an array containing the elements that only exist in the first set; i.e. performs a + * relative complement of the second set relative to the first. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/setDifference/#mongodb-expression-exp.-setDifference + */ + $setDifference: [ArrayExpression, ArrayExpression]; + } + + export interface SetEquals { + /** + * Compares two or more arrays and returns true if they have the same distinct elements and false otherwise. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/setEquals/#mongodb-expression-exp.-setEquals + */ + $setEquals: ArrayExpression[]; + } + + export interface SetIntersection { + /** + * Takes two or more arrays and returns an array that contains the elements that appear in every input array. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIntersection/#mongodb-expression-exp.-setIntersection + */ + $setIntersection: ArrayExpression[]; + } + + export interface SetIsSubset { + /** + * Takes two arrays and returns true when the first array is a subset of the second, including when the first + * array equals the second array, and false otherwise. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIsSubset/#mongodb-expression-exp.-setIsSubset + */ + $setIsSubset: [ArrayExpression, ArrayExpression]; + } + + export interface SetUnion { + /** + * Takes two or more arrays and returns an array containing the elements that appear in any input array. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/setUnion/#mongodb-expression-exp.-setUnion + */ + $setUnion: ArrayExpression[]; + } + + export interface Accumulator { + /** + * Defines a custom accumulator operator. Accumulators are operators that maintain their state (e.g. totals, + * maximums, minimums, and related data) as documents progress through the pipeline. Use the $accumulator operator + * to execute your own JavaScript functions to implement behavior not supported by the MongoDB Query Language. See + * also $function. + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/#mongodb-expression-exp.-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: CodeExpression; + /** + * Arguments passed to the init function. + */ + initArgs?: ArrayExpression; + /** + * 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: CodeExpression; + /** + * Arguments passed to the accumulate function. You can use accumulateArgs to specify what field value(s) to + * pass to the accumulate function. + */ + accumulateArgs: ArrayExpression; + /** + * 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: CodeExpression; + /** + * Function used to update the result of the accumulation. + */ + finalize?: CodeExpression; + /** + * The language used in the $accumulator code. + */ + lang: 'js'; + } + } + + export interface AddToSet { + /** + * Returns an array of all unique values that results from applying an expression to each document in a group. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/#mongodb-expression-exp.-addToSet + */ + $addToSet: Expression | Record; + } + + export interface Avg { + /** + * Returns the average value of the numeric values. $avg ignores non-numeric values. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/#mongodb-expression-exp.-avg + */ + $avg: Expression; + } + + export interface Bottom { + /** + * Returns the bottom element within a group according to the specified sort order. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/#mongodb-group-grp.-bottom + */ + $bottom: { + sortBy: AnyObject, + output: Expression + }; + } + + 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. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottomN/#mongodb-group-grp.-bottomN + */ + $bottomN: { + n: Expression, + sortBy: AnyObject, + output: Expression + }; + } + + export interface Count { + /** + * Returns the number of documents in a group. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/count/#mongodb-expression-exp.-count + */ + $count: Record | Path; + } + + export interface CovariancePop { + /** + * Returns the population covariance of two numeric expressions that are evaluated using documents in the + * $setWindowFields stage window. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/covariancePop/#mongodb-expression-exp.-covariancePop + */ + $covariancePop: [NumberExpression, NumberExpression]; + } + + export interface CovarianceSamp { + /** + * Returns the sample covariance of two numeric expressions that are evaluated using documents in the + * $setWindowFields stage window. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/covarianceSamp/#mongodb-expression-exp.-covarianceSamp + */ + $covarianceSamp: [NumberExpression, NumberExpression]; + } + + export interface DenseRank { + /** + * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage + * partition. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/denseRank/#mongodb-expression-exp.-denseRank + */ + $denseRank: Record; + } + + export interface Derivative { + /** + * Returns the average rate of change within the specified window, which is calculated using the: + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/derivative/#mongodb-expression-exp.-derivative + */ + $derivative: { + /** + * Specifies the expression to evaluate. The expression must evaluate to a number. + */ + input: NumberExpression; + /** + * A string that specifies the time unit. + */ + unit?: DateUnit; + } + } + + export interface DocumentNumber { + /** + * Returns the position of a document (known as the document number) in the $setWindowFields stage partition. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/documentNumber/#mongodb-expression-exp.-documentNumber + */ + $documentNumber: Record; + } + + export interface ExpMovingAvg { + /** + * Returns the exponential moving average of numeric expressions applied to documents in a partition defined in + * the $setWindowFields stage. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/expMovingAvg/#mongodb-expression-exp.-expMovingAvg + */ + $expMovingAvg: { + /** + * Specifies the expression to evaluate. Non-numeric expressions are ignored. + */ + input: Expression; + + /** + * 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. + */ + N: NumberExpression; + + /** + * 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?: never; + } | + { + /** + * Specifies the expression to evaluate. Non-numeric expressions are ignored. + */ + input: Expression; + + /** + * 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. + */ + N?: never; + + /** + * 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: NumberExpression; + } + } + + export interface Integral { + /** + * Returns the approximation of the area under a curve, which is calculated using the trapezoidal rule where each + * set of adjacent documents form a trapezoid using the: + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/integral/#mongodb-expression-exp.-integral + */ + $integral: { + /** + * Specifies the expression to evaluate. You must provide an expression that returns a number. + */ + input: NumberExpression; + + /** + * A string that specifies the time unit. + */ + unit?: DateUnit; + } + } + + export interface Max { + /** + * Returns the maximum value. $max compares both value and type, using the specified BSON comparison order for + * values of different types. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/#mongodb-expression-exp.-max + */ + $max: Expression | Expression[]; + } + + export interface MaxN { + /** + * Returns an aggregation of the maxmimum value n elements within a group. + * If the group contains fewer than n elements, $maxN returns all elements in the group. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN/#mongodb-group-grp.-maxN + */ + $maxN: { + input: Expression + n: Expression, + }; + } + + export interface Min { + /** + * Returns the minimum value. $min compares both value and type, using the specified BSON comparison order for + * values of different types. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/#mongodb-expression-exp.-min + */ + $min: Expression | Expression[]; + } + + export interface MinN { + /** + * Returns an aggregation of the minimum value n elements within a group. + * If the group contains fewer than n elements, $minN returns all elements in the group. + * + * @version 5.2 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN/#mongodb-group-grp.-minN + */ + $minN: { + input: Expression + n: Expression, + }; + } + + export interface Push { + /** + * Returns an array of all values that result from applying an expression to documents. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/push/#mongodb-expression-exp.-push + */ + $push: Expression | Record; + } + + export interface Rank { + /** + * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage + * partition. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/rank/#mongodb-expression-exp.-rank + */ + $rank: Record; + } + + 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. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/shift/#mongodb-expression-exp.-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. + */ + by: number; + /** + * 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. + */ + default?: Expression; + } + } + + export interface Median { + /** + * Returns an approximation of the median, the 50th percentile, as a scalar value. + * + * @see https://www.mongodb.com/docs/v7.0/reference/operator/aggregation/median/ + */ + $median: { + input: number | Expression, + method: 'approximate' + } + } + + export interface Percentile { + /** + * Returns an array of scalar values that correspond to specified percentile values. + * + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/ + */ + $percentile: { + input: number | Expression, + p: (number | Expression)[], + method: 'approximate' + } + } + + 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. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/#mongodb-expression-exp.-stdDevPop + */ + $stdDevPop: Expression; + } + + 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. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/#mongodb-expression-exp.-stdDevSamp + */ + $stdDevSamp: Expression; + } + + export interface Sum { + /** + * Calculates and returns the collective sum of numeric values. $sum ignores non-numeric values. + * + * @version 5.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/#mongodb-expression-exp.-sum + */ + $sum: number | Expression | Expression[]; + } + + export interface Convert { + /** + * Checks if the specified expression resolves to one of the following numeric + * - Integer + * - Decimal + * - Double + * - Long + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert + */ + $convert: { + input: Expression; + to: K; + onError?: Expression; + onNull?: Expression; + }; + } + + export interface IsNumber { + /** + * Checks if the specified expression resolves to one of the following numeric + * - Integer + * - Decimal + * - Double + * - Long + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/isNumber/#mongodb-expression-exp.-isNumber + */ + $isNumber: Expression; + } + + export interface ToBool { + /** + * Converts a value to a boolean. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toBool/#mongodb-expression-exp.-toBool + */ + $toBool: Expression; + } + + export interface ToDecimal { + /** + * Converts a value to a decimal. If the value cannot be converted to a decimal, $toDecimal errors. If the value + * is null or missing, $toDecimal returns null. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDecimal/#mongodb-expression-exp.-toDecimal + */ + $toDecimal: Expression; + } + + export interface ToDouble { + /** + * Converts a value to a double. If the value cannot be converted to an double, $toDouble errors. If the value is + * null or missing, $toDouble returns null. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDouble/#mongodb-expression-exp.-toDouble + */ + $toDouble: Expression; + } + + export interface ToInt { + /** + * Converts a value to a long. If the value cannot be converted to a long, $toLong errors. If the value is null or + * missing, $toLong returns null. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toInt/#mongodb-expression-exp.-toInt + */ + $toInt: Expression; + } + + export interface ToLong { + /** + * Converts a value to a long. If the value cannot be converted to a long, $toLong errors. If the value is null or + * missing, $toLong returns null. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLong/#mongodb-expression-exp.-toLong + */ + $toLong: Expression; + } + + export interface ToObjectId { + /** + * Converts a value to an ObjectId(). If the value cannot be converted to an ObjectId, $toObjectId errors. If the + * value is null or missing, $toObjectId returns null. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toObjectId/#mongodb-expression-exp.-toObjectId + */ + $toObjectId: Expression; + } + + export interface Top { + $top: { + sortBy: AnyObject, + output: Expression + }; + } + + export interface TopN { + $topN: { + n: Expression, + sortBy: AnyObject, + output: Expression + }; + } + + export interface ToString { + /** + * Converts a value to a string. If the value cannot be converted to a string, $toString errors. If the value is + * null or missing, $toString returns null. + * + * @version 4.0 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/toString/#mongodb-expression-exp.-toString + */ + $toString: Expression; + } + + export interface Type { + /** + * Returns a string that specifies the BSON type of the argument. + * + * @version 3.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/type/#mongodb-expression-exp.-type + */ + $type: Expression; + } + + export interface BinarySize { + /** + * Returns the size of a given string or binary data value's content in bytes. + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/binarySize/#mongodb-expression-exp.-binarySize + */ + $binarySize: NullExpression | StringExpression | BinaryExpression; + } + + export interface BsonSize { + /** + * Returns the size in bytes of a given document (i.e. bsontype Object) when encoded as BSON. You can use + * $bsonSize as an alternative to the Object.bsonSize() method. + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/bsonSize/#mongodb-expression-exp.-bsonSize + */ + $bsonSize: NullExpression | ObjectExpression; + } + + export interface Function { + /** + * Defines a custom aggregation function or expression in JavaScript. + * + * @version 4.4 + * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/function/#mongodb-expression-exp.-function + */ + $function: { + /** + * The function definition. You can specify the function definition as either BSON type Code or String. + */ + body: CodeExpression; + /** + * Arguments passed to the function body. If the body function does not take an argument, you can specify an + * empty array [ ] + */ + args: ArrayExpression; + /** + * The language used in the body. You must specify lang: "js". + */ + lang: 'js' + }; + } + } + + type Path = string; + + + export type Expression = + Path | + ArithmeticExpressionOperator | + ArrayExpressionOperator | + BooleanExpressionOperator | + ComparisonExpressionOperator | + ConditionalExpressionOperator | + CustomAggregationExpressionOperator | + DataSizeOperator | + DateExpressionOperator | + LiteralExpressionOperator | + MiscellaneousExpressionOperator | + ObjectExpressionOperator | + SetExpressionOperator | + StringExpressionOperator | + TextExpressionOperator | + TrigonometryExpressionOperator | + TypeExpressionOperator | + AccumulatorOperator | + VariableExpressionOperator | + WindowOperator | + Expression.Top | + Expression.TopN | + any; + + export type NullExpression = null; + + export type CodeExpression = + string | + Function; + + export type BinaryExpression = + Path; + + export type FunctionExpression = + Expression.Function; + + export type AnyExpression = + ArrayExpression | + BooleanExpression | + NumberExpression | + ObjectExpression | + StringExpression | + DateExpression | + BinaryExpression | + FunctionExpression | + ObjectIdExpression | + ConditionalExpressionOperator | + any; + + export type ObjectIdExpression = + TypeExpressionOperatorReturningObjectId; + + export type ArrayExpression = + T[] | + Path | + ArrayExpressionOperatorReturningAny | + ArrayExpressionOperatorReturningArray | + StringExpressionOperatorReturningArray | + ObjectExpressionOperatorReturningArray | + SetExpressionOperatorReturningArray | + LiteralExpressionOperatorReturningAny | + WindowOperatorReturningArray | + CustomAggregationExpressionOperatorReturningAny | + WindowOperatorReturningAny; + + export type BooleanExpression = + boolean | + Path | + BooleanExpressionOperator | + ArrayExpressionOperatorReturningAny | + ComparisonExpressionOperatorReturningBoolean | + StringExpressionOperatorReturningBoolean | + SetExpressionOperatorReturningBoolean | + LiteralExpressionOperatorReturningAny | + CustomAggregationExpressionOperatorReturningAny | + TypeExpressionOperatorReturningBoolean; + + export type NumberExpression = + number | + Path | + ArrayExpressionOperatorReturningAny | + ArrayExpressionOperatorReturningNumber | + ArithmeticExpressionOperator | + ComparisonExpressionOperatorReturningNumber | + TrigonometryExpressionOperator | + MiscellaneousExpressionOperatorReturningNumber | + StringExpressionOperatorReturningNumber | + LiteralExpressionOperatorReturningAny | + ObjectExpressionOperator | + SetExpressionOperator | + WindowOperatorReturningNumber | + WindowOperatorReturningAny | + DataSizeOperatorReturningNumber | + CustomAggregationExpressionOperatorReturningAny | + TypeExpressionOperatorReturningNumber | + DateExpression | + DateExpressionOperatorReturningNumber; + + export type ObjectExpression = + Path | + ArrayExpressionOperatorReturningAny | + DateExpressionOperatorReturningObject | + StringExpressionOperatorReturningObject | + ObjectExpressionOperatorReturningObject | + CustomAggregationExpressionOperatorReturningAny | + LiteralExpressionOperatorReturningAny; + + export type StringExpression = + Path | + ArrayExpressionOperatorReturningAny | + DateExpressionOperatorReturningString | + StringExpressionOperatorReturningString | + LiteralExpressionReturningAny | + CustomAggregationExpressionOperatorReturningAny | + TypeExpressionOperatorReturningString | + T; + + export type DateExpression = + Path | + NativeDate | + DateExpressionOperatorReturningDate | + TypeExpressionOperatorReturningDate | + LiteralExpressionReturningAny; + + export type ArithmeticExpressionOperator = + Expression.Abs | + Expression.Add | + Expression.Ceil | + Expression.Divide | + Expression.Exp | + Expression.Floor | + Expression.Ln | + Expression.Log | + Expression.Log10 | + Expression.Mod | + Expression.Multiply | + Expression.Pow | + Expression.Round | + Expression.Sqrt | + Expression.Subtract | + Expression.Trunc; + + export type ArrayExpressionOperator = + ArrayExpressionOperatorReturningAny | + ArrayExpressionOperatorReturningBoolean | + ArrayExpressionOperatorReturningNumber | + ArrayExpressionOperatorReturningObject; + + export type LiteralExpressionOperator = + Expression.Literal; + + export type LiteralExpressionReturningAny = + LiteralExpressionOperatorReturningAny; + + export type LiteralExpressionOperatorReturningAny = + Expression.Literal; + + export type MiscellaneousExpressionOperator = + Expression.Rand | + Expression.SampleRate; + + export type MiscellaneousExpressionOperatorReturningNumber = + Expression.Rand; + + export type ArrayExpressionOperatorReturningAny = + Expression.ArrayElemAt | + Expression.First | + Expression.Last | + Expression.Reduce; + + export type ArrayExpressionOperatorReturningArray = + Expression.ConcatArrays | + Expression.Filter | + Expression.FirstN | + Expression.LastN | + Expression.Map | + Expression.ObjectToArray | + Expression.Range | + Expression.ReverseArray | + Expression.Slice | + Expression.Zip; + + export type ArrayExpressionOperatorReturningNumber = + Expression.IndexOfArray | + Expression.Size; + + export type ArrayExpressionOperatorReturningObject = + Expression.ArrayToObject; + + export type ArrayExpressionOperatorReturningBoolean = + Expression.In | + Expression.IsArray; + + export type BooleanExpressionOperator = + Expression.And | + Expression.Or | + Expression.Not; + + export type ComparisonExpressionOperator = + ComparisonExpressionOperatorReturningBoolean | + ComparisonExpressionOperatorReturningNumber; + + export type ComparisonExpressionOperatorReturningBoolean = + Expression.Eq | + Expression.Gt | + Expression.Gte | + Expression.Lt | + Expression.Lte | + Expression.Ne; + + export type ComparisonExpressionOperatorReturningNumber = + Expression.Cmp; + + export type ConditionalExpressionOperator = + Expression.Cond | + Expression.IfNull | + Expression.Switch; + + export type StringExpressionOperator = + StringExpressionOperatorReturningArray | + StringExpressionOperatorReturningBoolean | + StringExpressionOperatorReturningNumber | + StringExpressionOperatorReturningObject | + StringExpressionOperatorReturningString; + + export type StringExpressionOperatorReturningArray = + Expression.RegexFindAll | + Expression.Split; + + export type StringExpressionOperatorReturningBoolean = + Expression.RegexMatch; + + export type StringExpressionOperatorReturningNumber = + Expression.IndexOfBytes | + Expression.IndexOfCP | + Expression.Strcasecmp | + Expression.StrLenBytes | + Expression.StrLenCP; + + export type StringExpressionOperatorReturningObject = + Expression.RegexFind; + + export type StringExpressionOperatorReturningString = + Expression.Concat | + Expression.Ltrim | + Expression.Ltrim | + Expression.ReplaceOne | + Expression.ReplaceAll | + Expression.Substr | + Expression.SubstrBytes | + Expression.SubstrCP | + Expression.ToLower | + Expression.ToString | + Expression.ToUpper | + Expression.Trim; + + export type ObjectExpressionOperator = + Expression.MergeObjects | + Expression.ObjectToArray | + Expression.SetField | + Expression.UnsetField; + + export type ObjectExpressionOperatorReturningArray = + Expression.ObjectToArray; + + export type ObjectExpressionOperatorReturningObject = + Expression.MergeObjects | + Expression.SetField | + Expression.UnsetField; + + export type VariableExpressionOperator = + Expression.Let; + + export type VariableExpressionOperatorReturningAny = + Expression.Let; + + export type SetExpressionOperator = + Expression.AllElementsTrue | + Expression.AnyElementsTrue | + Expression.SetDifference | + Expression.SetEquals | + Expression.SetIntersection | + Expression.SetIsSubset | + Expression.SetUnion; + + export type SetExpressionOperatorReturningBoolean = + Expression.AllElementsTrue | + Expression.AnyElementsTrue | + Expression.SetEquals | + Expression.SetIsSubset; + + export type SetExpressionOperatorReturningArray = + Expression.SetDifference | + Expression.SetIntersection | + Expression.SetUnion; + + /** + * Trigonometry expressions perform trigonometric operations on numbers. + * Values that represent angles are always input or output in radians. + * Use $degreesToRadians and $radiansToDegrees to convert between degree + * and radian measurements. + */ + export type TrigonometryExpressionOperator = + Expression.Sin | + Expression.Cos | + Expression.Tan | + Expression.Asin | + Expression.Acos | + Expression.Atan | + Expression.Atan2 | + Expression.Asinh | + Expression.Acosh | + Expression.Atanh | + Expression.Sinh | + Expression.Cosh | + Expression.Tanh | + Expression.DegreesToRadians | + Expression.RadiansToDegrees; + + export type TextExpressionOperator = + Expression.Meta; + + export type WindowOperator = + Expression.AddToSet | + Expression.Avg | + Expression.Count | + Expression.CovariancePop | + Expression.CovarianceSamp | + Expression.DenseRank | + Expression.Derivative | + Expression.DocumentNumber | + Expression.ExpMovingAvg | + Expression.First | + Expression.FirstN | + Expression.Integral | + Expression.Last | + Expression.LastN | + Expression.LinearFill | + Expression.Locf | + Expression.Max | + Expression.MaxN | + Expression.Median | + Expression.Min | + Expression.MinN | + Expression.Percentile | + Expression.Push | + Expression.Rank | + Expression.Shift | + Expression.StdDevPop | + Expression.StdDevSamp | + Expression.Sum; + + export type WindowOperatorReturningAny = + Expression.First | + Expression.Last | + Expression.Shift; + + export type WindowOperatorReturningArray = + Expression.AddToSet | + Expression.FirstN | + Expression.LastN | + Expression.MaxN | + Expression.MinN | + Expression.Push; + + export type WindowOperatorReturningNumber = + Expression.Avg | + Expression.Count | + Expression.CovariancePop | + Expression.CovarianceSamp | + Expression.DenseRank | + Expression.DocumentNumber | + Expression.ExpMovingAvg | + Expression.Integral | + Expression.Max | + Expression.Median | + Expression.Min | + Expression.Percentile | + Expression.StdDevPop | + Expression.StdDevSamp | + Expression.Sum; + + export type TypeExpressionOperator = + Expression.Convert | + Expression.IsNumber | + Expression.ToBool | + Expression.ToDate | + Expression.ToDecimal | + Expression.ToDouble | + Expression.ToInt | + Expression.ToLong | + Expression.ToObjectId | + Expression.ToString | + Expression.Type; + + export type TypeExpressionOperatorReturningNumber = + Expression.Convert<'double' | 1 | 'int' | 16 | 'long' | 18 | 'decimal' | 19> | + Expression.ToDecimal | + Expression.ToDouble | + Expression.ToInt | + Expression.ToLong; + + export type TypeExpressionOperatorReturningBoolean = + Expression.Convert<'bool' | 8> | + Expression.IsNumber | + Expression.ToBool; + + + export type TypeExpressionOperatorReturningString = + Expression.Convert<'string' | 2> | + Expression.ToString | + Expression.Type; + + export type TypeExpressionOperatorReturningObjectId = + Expression.Convert<'objectId' | 7> | + Expression.ToObjectId; + + export type TypeExpressionOperatorReturningDate = + Expression.Convert<'date' | 9> | + Expression.ToDate; + + export type DataSizeOperator = + Expression.BinarySize | + Expression.BsonSize; + + export type DataSizeOperatorReturningNumber = + Expression.BinarySize | + Expression.BsonSize; + + export type CustomAggregationExpressionOperator = + Expression.Accumulator | + Expression.Function; + + export type CustomAggregationExpressionOperatorReturningAny = + Expression.Function; + + export type AccumulatorOperator = + Expression.Accumulator | + Expression.AddToSet | + Expression.Avg | + Expression.Bottom | + Expression.BottomN | + Expression.Count | + Expression.First | + Expression.FirstN | + Expression.Last | + Expression.LastN | + Expression.Max | + Expression.MaxN | + Expression.Median | + Expression.MergeObjects | + Expression.Min | + Expression.MinN | + Expression.Percentile | + Expression.Push | + Expression.StdDevPop | + Expression.StdDevSamp | + Expression.Sum | + Expression.Top | + Expression.TopN; + + export type tzExpression = UTCOffset | StringExpressionOperatorReturningBoolean | string; + + type hh = '-00' | '-01' | '-02' | '-03' | '-04' | '-05' | '-06' | '-07' | '-08' | '-09' | '-10' | '-11' | '-12' | + '+00' | '+01' | '+02' | '+03' | '+04' | '+05' | '+06' | '+07' | '+08' | '+09' | '+10' | '+11' | '+12' | '+13' | '+14'; + type mm = '00' | '30' | '45'; + + type UTCOffset = `${hh}` | `${hh}${mm}` | `${hh}:${mm}`; + + type RegexOptions = + 'i' | 'm' | 's' | 'x' | + 'is' | 'im' | 'ix' | 'si' | 'sm' | 'sx' | 'mi' | 'ms' | 'mx' | 'xi' | 'xs' | 'xm' | + 'ism' | 'isx' | 'ims' | 'imx' | 'ixs' | 'ixm' | 'sim' | 'six' | 'smi' | 'smx' | 'sxi' | 'sxm' | 'mis' | 'mix' | 'msi' | 'msx' | 'mxi' | 'mxs' | 'xis' | 'xim' | 'xsi' | 'xsm' | 'xmi' | 'xms' | + 'ismx' | 'isxm' | 'imsx' | 'imxs' | 'ixsm' | 'ixms' | 'simx' | 'sixm' | 'smix' | 'smxi' | 'sxim' | 'sxmi' | 'misx' | 'mixs' | 'msix' | 'msxi' | 'mxis' | 'mxsi' | 'xism' | 'xims' | 'xsim' | 'xsmi' | 'xmis' | 'xmsi'; + + type StartOfWeek = + 'monday' | 'mon' | + 'tuesday' | 'tue' | + 'wednesday' | 'wed' | + 'thursday' | 'thu' | + 'friday' | 'fri' | + 'saturday' | 'sat' | + 'sunday' | 'sun'; + + type DateUnit = 'year' | 'quarter' | 'week' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'; + + type FormatString = string; + + export type DateExpressionOperator = + DateExpressionOperatorReturningDate | + DateExpressionOperatorReturningNumber | + DateExpressionOperatorReturningString | + DateExpressionOperatorReturningObject; + + export type DateExpressionOperatorReturningObject = + Expression.DateToParts; + + export type DateExpressionOperatorReturningNumber = + Expression.DateDiff | + Expression.DayOfMonth | + Expression.DayOfWeek | + Expression.DayOfYear | + Expression.IsoDayOfWeek | + Expression.IsoWeek | + Expression.IsoWeekYear | + Expression.Millisecond | + Expression.Second | + Expression.Minute | + Expression.Hour | + Expression.Month | + Expression.Year; + + export type DateExpressionOperatorReturningDate = + Expression.DateAdd | + Expression.DateFromParts | + Expression.DateFromString | + Expression.DateSubtract | + Expression.DateTrunc | + Expression.ToDate; + + export type DateExpressionOperatorReturningString = + Expression.DateToString; + +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/helpers.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/helpers.d.ts new file mode 100644 index 00000000..91e2ea27 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/helpers.d.ts @@ -0,0 +1,32 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** + * Mongoose uses this function to get the current time when setting + * [timestamps](/docs/guide.html#timestamps). You may stub out this function + * using a tool like [Sinon](https://www.npmjs.com/package/sinon) for testing. + */ + function now(): NativeDate; + + /** + * Tells `sanitizeFilter()` to skip the given object when filtering out potential query selector injection attacks. + * Use this method when you have a known query selector that you want to use. + */ + function trusted(obj: T): T; + + /** + * Returns true if the given value is a Mongoose ObjectId (using `instanceof`) or if the + * given value is a 24 character hex string, which is the most commonly used string representation + * of an ObjectId. + */ + function isObjectIdOrHexString(v: mongodb.ObjectId): true; + function isObjectIdOrHexString(v: mongodb.ObjectId | string): boolean; + function isObjectIdOrHexString(v: any): false; + + /** + * Returns true if Mongoose can cast the given value to an ObjectId, or + * false otherwise. + */ + function isValidObjectId(v: mongodb.ObjectId | Types.ObjectId): true; + function isValidObjectId(v: any): boolean; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/index.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/index.d.ts new file mode 100644 index 00000000..814b15ad --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/index.d.ts @@ -0,0 +1,1239 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +declare class NativeDate extends globalThis.Date { } + +declare module 'mongoose' { + import Kareem = require('kareem'); + import events = require('events'); + import mongodb = require('mongodb'); + import mongoose = require('mongoose'); + + export type Mongoose = typeof mongoose; + + /** + * Mongoose constructor. The exports object of the `mongoose` module is an instance of this + * class. Most apps will only use this one instance. + */ + export const Mongoose: new (options?: MongooseOptions | null) => Mongoose; + + export let Promise: any; + + /** + * Can be extended to explicitly type specific models. + */ + export interface Models { + [modelName: string]: Model + } + + /** An array containing all models associated with this Mongoose instance. */ + export const models: Models; + + /** + * Removes the model named `name` from the default connection, if it exists. + * You can use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + */ + export function deleteModel(name: string | RegExp): Mongoose; + + /** + * Sanitizes query filters against query selector injection attacks by wrapping + * any nested objects that have a property whose name starts with `$` in a `$eq`. + */ + export function sanitizeFilter(filter: QueryFilter): QueryFilter; + + /** Gets mongoose options */ + export function get(key: K): MongooseOptions[K]; + + export function omitUndefined>(val: T): T; + + export type HydratedDocFromModel> = ReturnType; + + /* ! ignore */ + export type CompileModelOptions = { + overwriteModels?: boolean, + connection?: Connection + }; + + export function model( + name: string, + schema?: TSchema, + collection?: string, + options?: CompileModelOptions + ): Model< + InferSchemaType, + ObtainSchemaGeneric, + ObtainSchemaGeneric, + ObtainSchemaGeneric, + // If first schema generic param is set, that means we have an explicit raw doc type, + // so user should also specify a hydrated doc type if the auto inferred one isn't correct. + IsItRecordAndNotAny> extends true + ? ObtainSchemaGeneric + : HydratedDocument< + InferSchemaType, + ObtainSchemaGeneric & ObtainSchemaGeneric, + ObtainSchemaGeneric, + ObtainSchemaGeneric, + InferSchemaType, + ObtainSchemaGeneric + >, + TSchema, + ObtainSchemaGeneric + > & ObtainSchemaGeneric; + + export function model(name: string, schema?: Schema | Schema, collection?: string, options?: CompileModelOptions): Model; + + export function model( + name: string, + schema?: Schema, + collection?: string, + options?: CompileModelOptions + ): U; + + /** Returns an array of model names created on this instance of Mongoose. */ + export function modelNames(): Array; + + /** + * Overwrites the current driver used by this Mongoose instance. A driver is a + * Mongoose-specific interface that defines functions like `find()`. + */ + export function setDriver(driver: any): Mongoose; + + /** The node-mongodb-native driver Mongoose uses. */ + export { mongodb as mongo }; + + /** Declares a global plugin executed on all Schemas. */ + export function plugin(fn: (schema: Schema, opts?: any) => void, opts?: any): Mongoose; + + /** Getter/setter around function for pluralizing collection names. */ + export function pluralize(fn?: ((str: string) => string) | null): ((str: string) => string) | null; + + /** Sets mongoose options */ + export function set(key: K, value: MongooseOptions[K]): Mongoose; + export function set(options: { [K in keyof MongooseOptions]: MongooseOptions[K] }): Mongoose; + + /** The Mongoose version */ + export const version: string; + + export type AnyKeys = { [P in keyof T]?: T[P] | any }; + export interface AnyObject { + [k: string]: any + } + + export type Require_id = T extends { _id?: infer U } + ? IfAny> + : T & { _id: Types.ObjectId }; + + export type Default_id = TSchemaOptions extends { _id: false } ? T : Require_id; + + export type Default__v = TSchemaOptions extends { versionKey: false } + ? T + : TSchemaOptions extends { versionKey: infer VK } + ? ( + // If VK is a *literal* string, add that property + T & { + [K in VK as K extends string + ? (string extends K ? never : K) // drop if wide string + : never + ]: number + } + ) + : T extends { __v?: infer U } + ? T + : T & { __v: number }; + + /** Helper type for getting the hydrated document type from the raw document type. The hydrated document type is what `new MyModel()` returns. */ + export type HydratedDocument< + HydratedDocPathsType, + TOverrides = {}, + TQueryHelpers = {}, + TVirtuals = {}, + RawDocType = HydratedDocPathsType, + TSchemaOptions = DefaultSchemaOptions + > = IfAny< + HydratedDocPathsType, + any, + TOverrides extends Record ? + Document & + Default__v, TSchemaOptions> & + IfEquals< + TVirtuals, + {}, + AddDefaultId, + TVirtuals + > : + IfAny< + TOverrides, + Document & Default__v, TSchemaOptions>, + Document & MergeType< + Default__v, TSchemaOptions>, + HydratedDocumentOverrides< + IfEquals< + TOverrides, + {}, + TOverrides, + TOverrides & AddDefaultId + > + > + > + > + >; + + export type HydratedSingleSubdocument< + DocType, + TOverrides = {} + > = IfAny< + DocType, + any, + TOverrides extends Record ? + Types.Subdocument, DocType> & Require_id : + IfAny< + TOverrides, + Types.Subdocument, DocType> & Require_id, + Types.Subdocument, DocType> & MergeType< + Require_id, + TOverrides + > + > + >; + export type HydratedArraySubdocument = IfAny< + DocType, + any, + TOverrides extends Record ? + Types.ArraySubdocument, DocType> & Require_id : + IfAny< + TOverrides, + Types.ArraySubdocument, DocType> & Require_id, + Types.ArraySubdocument, DocType> & MergeType< + Require_id, + TOverrides + > + > + >; + + export type HydratedDocumentFromSchema = HydratedDocument< + InferSchemaType, + ObtainSchemaGeneric & ObtainSchemaGeneric, + ObtainSchemaGeneric, + ObtainSchemaGeneric, + InferSchemaType, + ObtainSchemaGeneric + >; + + export interface TagSet { + [k: string]: string; + } + + export interface ToObjectOptions> { + /** if `options.virtuals = true`, you can set `options.aliases = false` to skip applying aliases. This option is a no-op if `options.virtuals = false`. */ + aliases?: boolean; + /** if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths. */ + depopulate?: boolean; + /** if true, convert Maps to POJOs. Useful if you want to `JSON.stringify()` the result of `toObject()`. */ + flattenMaps?: boolean; + /** if true, convert any ObjectIds in the result to 24 character hex strings. */ + flattenObjectIds?: boolean; + /** if true, convert any UUIDs in the result to 36 character hex strings. */ + flattenUUIDs?: boolean; + /** apply all getters (path and virtual getters) */ + getters?: boolean; + /** remove empty objects (defaults to true) */ + minimize?: boolean; + /** If true, the resulting object will only have fields that are defined in the document's schema. By default, `toJSON()` & `toObject()` returns all fields in the underlying document from MongoDB, including ones that are not listed in the schema. */ + schemaFieldsOnly?: boolean; + /** if set, mongoose will call this function to allow you to transform the returned object */ + transform?: boolean | (( + doc: THydratedDocumentType, + ret: Default__v>, + options: ToObjectOptions + ) => any); + /** If true, omits fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema. */ + useProjection?: boolean; + /** if false, exclude the version key (`__v` by default) from the output */ + versionKey?: boolean; + /** apply virtual getters (can override getters option) */ + virtuals?: boolean | string[]; + } + + export type DiscriminatorModel = T extends Model + ? + M extends Model + ? Model & T, MQueryHelpers | TQueryHelpers, MInstanceMethods | TInstanceMethods, MVirtuals | TVirtuals> + : M + : M; + + export type DiscriminatorSchema = + DisSchema extends Schema + ? Schema, DiscriminatorModel, DisSchemaInstanceMethods | TInstanceMethods, DisSchemaQueryhelpers | TQueryHelpers, DisSchemaVirtuals | TVirtuals, DisSchemaStatics & TStaticMethods> + : Schema; + + type QueryResultType = T extends Query ? ResultType : never; + + type PluginFunction< + DocType, + M, + TInstanceMethods, + TQueryHelpers, + TVirtuals, + TStaticMethods> = (schema: Schema, opts?: any) => void; + + export class Schema< + RawDocType = any, + TModelType = Model, + TInstanceMethods = {}, + TQueryHelpers = {}, + TVirtuals = {}, + TStaticMethods = {}, + TSchemaOptions = DefaultSchemaOptions, + DocType extends ApplySchemaOptions< + ObtainDocumentType>, + ResolveSchemaOptions + > = ApplySchemaOptions< + ObtainDocumentType>, + ResolveSchemaOptions + >, + THydratedDocumentType = HydratedDocument< + DocType, + AddDefaultId & TInstanceMethods, + TQueryHelpers, + AddDefaultId, + IsItRecordAndNotAny extends true ? RawDocType : DocType, + ResolveSchemaOptions + >, + TSchemaDefinition = IfAny, RawDocType, THydratedDocumentType>>, + LeanResultType = IsItRecordAndNotAny extends true ? RawDocType : Default__v>>> + > + extends events.EventEmitter { + /** + * Create a new schema + */ + constructor( + definition?: SchemaDefinition, RawDocType, THydratedDocumentType> | DocType, + options?: SchemaOptions< + FlatRecord, + TInstanceMethods, + TQueryHelpers, + TStaticMethods, + TVirtuals, + THydratedDocumentType, + IfEquals< + TModelType, + Model, + Model, + TModelType + > + > | ResolveSchemaOptions + ); + + /* Creates a new schema with the given definition and options. Equivalent to `new Schema(definition, options)`, but with better automatic type inference. */ + static create< + TSchemaDefinition extends SchemaDefinition, + TSchemaOptions extends DefaultSchemaOptions, + RawDocType extends ApplySchemaOptions< + InferRawDocType>, + ResolveSchemaOptions + >, + THydratedDocumentType extends AnyObject = HydratedDocument< + InferHydratedDocType>, + TSchemaOptions extends { methods: infer M } ? M : {}, + TSchemaOptions extends { query: any } ? TSchemaOptions['query'] : {}, + ResolveVirtuals, + RawDocType, + ResolveSchemaOptions + > + >(def: TSchemaDefinition): Schema< + RawDocType, + Model, + TSchemaOptions extends { methods: infer M } ? M : {}, + TSchemaOptions extends { query: any } ? TSchemaOptions['query'] : {}, + ResolveVirtuals, + TSchemaOptions extends { statics: any } ? TSchemaOptions['statics'] : {}, + TSchemaOptions, + ApplySchemaOptions< + ObtainDocumentType>, + ResolveSchemaOptions + >, + THydratedDocumentType, + TSchemaDefinition, + ApplySchemaOptions< + InferRawDocType, { bufferToBinary: true }>, + ResolveSchemaOptions + > + >; + + static create< + TSchemaDefinition extends SchemaDefinition, + TSchemaOptions extends SchemaOptions>, + RawDocType extends ApplySchemaOptions< + InferRawDocType>, + ResolveSchemaOptions + >, + TMethods = TSchemaOptions extends { methods: infer M } ? { [K in keyof M]: OmitThisParameter } : {}, + TStatics = TSchemaOptions extends { statics: infer S } ? { [K in keyof S]: OmitThisParameter } : {} + >(def: TSchemaDefinition, options: TSchemaOptions & { + statics?: SchemaOptionsStaticsPropertyType< + TStatics, + Model + > + }): Schema< + RawDocType, + Model, + TMethods, + TSchemaOptions extends { query: any } ? TSchemaOptions['query'] : {}, + ResolveVirtuals, + TStatics, + TSchemaOptions, + ApplySchemaOptions< + ObtainDocumentType>, + ResolveSchemaOptions + >, + HydratedDocument< + InferHydratedDocType>, + TMethods, + TSchemaOptions extends { query: any } ? TSchemaOptions['query'] : {}, + ResolveVirtuals, + RawDocType, + ResolveSchemaOptions + >, + TSchemaDefinition, + ApplySchemaOptions< + InferRawDocType, { bufferToBinary: true }>, + ResolveSchemaOptions + > + >; + + /** Adds key path / schema type pairs to this schema. */ + add(obj: SchemaDefinition, RawDocType> | Schema, prefix?: string): this; + + /** + * Add an alias for `path`. This means getting or setting the `alias` + * is equivalent to getting or setting the `path`. + */ + alias(path: string, alias: string | string[]): this; + + /** + * Array of child schemas (from document arrays and single nested subdocs) + * and their corresponding compiled models. Each element of the array is + * an object with 2 properties: `schema` and `model`. + */ + childSchemas: { schema: Schema, model: any }[]; + + /** Removes all indexes on this schema */ + clearIndexes(): this; + + /** Returns a copy of this schema */ + clone(): this; + + discriminator(name: string | number, schema: DisSchema, options?: DiscriminatorOptions): this; + + /** Returns a new schema that has the picked `paths` from this schema. */ + pick(paths: string[], options?: SchemaOptions): T; + + /** Object containing discriminators defined on this schema */ + discriminators?: { [name: string]: Schema }; + + /** Iterates the schemas paths similar to Array#forEach. */ + eachPath(fn: (path: string, type: SchemaType) => void): this; + + /** Defines an index (most likely compound) for this schema. */ + index(fields: IndexDefinition, options?: Omit & { unique?: boolean | [true, string] }): this; + + /** + * Define a search index for this schema. + * + * @remarks Search indexes are only supported when used against a 7.0+ Mongo Atlas cluster. + */ + searchIndex(description: SearchIndexDescription): this; + + /** + * Returns a list of indexes that this schema declares, via `schema.index()` + * or by `index: true` in a path's options. + */ + indexes(): Array<[IndexDefinition, IndexOptions]>; + + /** Gets a schema option. */ + get(key: K): SchemaOptions[K]; + + /** + * Loads an ES6 class into a schema. Maps [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) + [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get), [static methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static), + * and [instance methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Class_body_and_method_definitions) + * to schema [virtuals](http://mongoosejs.com/docs/guide.html#virtuals), + * [statics](http://mongoosejs.com/docs/guide.html#statics), and + * [methods](http://mongoosejs.com/docs/guide.html#methods). + */ + loadClass(model: Function, onlyVirtuals?: boolean): this; + + /** Adds an instance method to documents constructed from Models compiled from this schema. */ + method(name: string, fn: (this: Context, ...args: any[]) => any, opts?: any): this; + method(obj: Partial): this; + + /** Adds a query helper to this schema. */ + queryHelper, ...args: any[]) => any>( + name: Name, + fn: Fn + ): Schema< + RawDocType, + TModelType, + TInstanceMethods, + TQueryHelpers & { [K in Name]: Fn }, + TVirtuals, + TStaticMethods, + TSchemaOptions, + DocType, + THydratedDocumentType, + TSchemaDefinition, + LeanResultType + >; + + /** Object of currently defined methods on this schema. */ + methods: AddThisParameter & AnyObject; + + /** The original object passed to the schema constructor */ + obj: SchemaDefinition, RawDocType>; + + /** Returns a new schema that has the `paths` from the original schema, minus the omitted ones. */ + omit(paths: string[], options?: SchemaOptions): T; + + options: SchemaOptions; + + /** Gets/sets schema paths. */ + path>(path: string): ResultType; + path(path: pathGeneric): SchemaType; + path(path: string, constructor: any): this; + + /** Lists all paths and their type in the schema. */ + paths: { + [key: string]: SchemaType; + }; + + /** Returns the pathType of `path` for this schema. */ + pathType(path: string): string; + + /** Registers a plugin for this schema. */ + plugin, POptions extends Parameters[1] = Parameters[1]>(fn: PFunc, opts?: POptions): this; + plugin, any, any, any, any>, POptions extends Parameters[1] = Parameters[1]>(fn: PFunc, opts?: POptions): this; + + /** Defines a post hook for the model. */ + + // PostMiddlewareFunction + // with errorHandler set to true + post>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, options: SchemaPostOptions & { errorHandler: true }, fn: ErrorHandlingMiddlewareWithOption): this; + post(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { errorHandler: true }, fn: ErrorHandlingMiddlewareWithOption): this; + post>(method: 'aggregate' | RegExp, options: SchemaPostOptions & { errorHandler: true }, fn: ErrorHandlingMiddlewareWithOption>): this; + post(method: 'insertMany' | RegExp, options: SchemaPostOptions & { errorHandler: true }, fn: ErrorHandlingMiddlewareWithOption): this; + + // this = never since it never happens + post(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: false, query: false }, fn: PostMiddlewareFunction): this; + post(method: MongooseDistinctQueryMiddleware|MongooseDistinctQueryMiddleware[], options: SchemaPostOptions & { document: boolean, query: false }, fn: PostMiddlewareFunction>): this; + post(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: false, query: true }, fn: PostMiddlewareFunction): this; + // this = Document + post(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction): this; + post(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], options: SchemaPostOptions & SchemaPostOptions, fn: PostMiddlewareFunction): this; + post(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: true, query: false }, fn: PostMiddlewareFunction): this; + post(method: 'init', fn: PostMiddlewareFunction): this; + + // this = Query + post>(method: MongooseRawResultQueryMiddleware|MongooseRawResultQueryMiddleware[], fn: PostMiddlewareFunction | ModifyResult>>): this; + post>(method: MongooseDefaultQueryMiddleware|MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction>): this; + post>(method: MongooseDistinctQueryMiddleware|MongooseDistinctQueryMiddleware[], options: SchemaPostOptions, fn: PostMiddlewareFunction>): this; + post>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: false, query: true }, fn: PostMiddlewareFunction>): this; + // this = Union of Document and Query, could be called with any of them + post>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: true, query: true }, fn: PostMiddlewareFunction>): this; + post>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction>): this; + + // ErrorHandlingMiddlewareFunction + // this = never since it never happens + post(method: MongooseDistinctQueryMiddleware|MongooseDistinctQueryMiddleware[], options: SchemaPostOptions & { document: boolean, query: false }, fn: ErrorHandlingMiddlewareFunction): this; + post(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], options: SchemaPostOptions & { document: false, query: boolean }, fn: ErrorHandlingMiddlewareFunction): this; + post(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: false, query: false }, fn: ErrorHandlingMiddlewareFunction): this; + // this = Document + post(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], fn: ErrorHandlingMiddlewareFunction): this; + post(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction): this; + post(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: true, query: false }, fn: ErrorHandlingMiddlewareFunction): this; + // this = Query + post>(method: MongooseDefaultQueryMiddleware|MongooseDefaultQueryMiddleware[], fn: ErrorHandlingMiddlewareFunction): this; + post>(method: MongooseDistinctQueryMiddleware|MongooseDistinctQueryMiddleware[], options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction): this; + post>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: false, query: true }, fn: ErrorHandlingMiddlewareFunction): this; + // this = Union of Document and Query, could be called with any of them + post>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPostOptions & { document: true, query: true }, fn: ErrorHandlingMiddlewareFunction): this; + post>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction): this; + + // method aggregate and insertMany with PostMiddlewareFunction + post>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction>>): this; + post>(method: 'aggregate' | RegExp, options: SchemaPostOptions, fn: PostMiddlewareFunction>>): this; + post(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction): this; + post(method: 'insertMany' | RegExp, options: SchemaPostOptions, fn: PostMiddlewareFunction): this; + + // method aggregate and insertMany with ErrorHandlingMiddlewareFunction + post>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction>): this; + post>(method: 'aggregate' | RegExp, options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction>): this; + post(method: 'bulkWrite' | 'createCollection' | 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction): this; + post(method: 'bulkWrite' | 'createCollection' | 'insertMany' | RegExp, options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction): this; + + /** Defines a pre hook for the model. */ + // this = never since it never happens + pre(method: 'save', options: SchemaPreOptions & { document: false, query: boolean }, fn: PreSaveMiddlewareFunction): this; + pre(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPreOptions & { document: false, query: false }, fn: PreMiddlewareFunction): this; + pre(method: MongooseDistinctQueryMiddleware|MongooseDistinctQueryMiddleware[], options: SchemaPreOptions & { document: boolean, query: false }, fn: PreMiddlewareFunction): this; + pre(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExp, options: SchemaPreOptions & { document: false, query: boolean }, fn: PreMiddlewareFunction): this; + // this = Union of Document and Query, could be called with any of them + pre>( + method: 'updateOne' | RegExp, + options: SchemaPreOptions & { document: true, query: true }, + fn: PreUpdateOneMiddlewareFunction + ): this; + pre>( + method: 'deleteOne' | RegExp, + options: SchemaPreOptions & { document: true, query: true }, + fn: PreDeleteOneMiddlewareFunction + ): this; + // this = Document + pre(method: 'save', fn: PreSaveMiddlewareFunction): this; + pre(method: 'init', fn: (this: T, doc: U) => void): this; + pre(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction): this; + pre(method: MongooseDistinctDocumentMiddleware|MongooseDistinctDocumentMiddleware[], options: SchemaPreOptions, fn: PreMiddlewareFunction): this; + pre( + method: 'updateOne' | RegExp, + options: SchemaPreOptions & { document: true }, + fn: PreUpdateOneMiddlewareFunction + ): this; + pre( + method: 'deleteOne' | RegExp, + options: SchemaPreOptions & { document: true }, + fn: PreDeleteOneMiddlewareFunction + ): this; + pre(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPreOptions & { document: true, query: false }, fn: PreMiddlewareFunction): this; + // this = Query + pre>(method: MongooseDefaultQueryMiddleware|MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction): this; + pre>(method: MongooseDistinctQueryMiddleware|MongooseDistinctQueryMiddleware[], options: SchemaPreOptions, fn: PreMiddlewareFunction): this; + pre>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPreOptions & { document: false, query: true }, fn: PreMiddlewareFunction): this; + // this = Union of Document and Query, could be called with any of them + pre>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, options: SchemaPreOptions & { document: true, query: true }, fn: PreMiddlewareFunction): this; + pre>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction): this; + // method aggregate + pre>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction): this; + /* method insertMany */ + pre( + method: 'insertMany' | RegExp, + fn: ( + this: TModelType, + docs: any | Array, + options?: InsertManyOptions & { lean?: boolean } + ) => void | Promise + ): this; + /* method bulkWrite */ + pre( + method: 'bulkWrite' | RegExp, + fn: ( + this: TModelType, + ops: Array>, + options?: mongodb.BulkWriteOptions & MongooseBulkWriteOptions + ) => void | Promise + ): this; + /* method createCollection */ + pre( + method: 'createCollection' | RegExp, + fn: ( + this: TModelType, + options?: mongodb.CreateCollectionOptions & Pick + ) => void | Promise + ): this; + + /** Object of currently defined query helpers on this schema. */ + query: TQueryHelpers; + + /** Adds a method call to the queue. */ + queue(name: string, args: any[]): this; + + /** Removes the given `path` (or [`paths`]). */ + remove(paths: string | Array): this; + + /** Removes index by name or index spec */ + removeIndex(index: string | AnyObject): this; + + /** Returns an Array of path strings that are required by this schema. */ + requiredPaths(invalidate?: boolean): string[]; + + /** Sets a schema option. */ + set(key: K, value: SchemaOptions[K], _tags?: any): this; + + /** Adds static "class" methods to Models compiled from this schema. */ + static(name: K, fn: TStaticMethods[K]): this; + static & { [name: string]: (this: TModelType, ...args: any[]) => any }>( + obj: Fns + ): Schema< + RawDocType, + TModelType, + TInstanceMethods, + TQueryHelpers, + TVirtuals, + TStaticMethods & Fns, + TSchemaOptions, + DocType, + THydratedDocumentType, + TSchemaDefinition, + LeanResultType + >; + static any>( + name: Name, + fn: Fn + ): Schema< + RawDocType, + TModelType, + TInstanceMethods, + TQueryHelpers, + TVirtuals, + TStaticMethods & { [K in Name]: Fn }, + TSchemaOptions, + DocType, + THydratedDocumentType, + TSchemaDefinition, + LeanResultType + >; + + /** Object of currently defined statics on this schema. */ + statics: { [F in keyof TStaticMethods]: TStaticMethods[F] } & + { [name: string]: ((this: TModelType, ...args: any[]) => unknown) & SupportsMiddlewareOption }; + + toJSONSchema(options?: { useBsonType?: boolean }): Record; + + /** Creates a virtual type with the given name. */ + virtual( + name: keyof TVirtuals | string, + options?: VirtualTypeOptions + ): VirtualType; + + /** Object of currently defined virtuals on this schema */ + virtuals: TVirtuals; + + /** Returns the virtual type with the given `name`. */ + virtualpath(name: string): VirtualType | null; + + static ObjectId: typeof Schema.Types.ObjectId; + } + + export type NumberSchemaDefinition = typeof Number | 'number' | 'Number' | typeof Schema.Types.Number | Schema.Types.Number; + export type StringSchemaDefinition = typeof String | 'string' | 'String' | typeof Schema.Types.String | Schema.Types.String; + export type BooleanSchemaDefinition = typeof Boolean | 'boolean' | 'Boolean' | typeof Schema.Types.Boolean | Schema.Types.Boolean; + export type DateSchemaDefinition = DateConstructor | 'date' | 'Date' | typeof Schema.Types.Date | Schema.Types.Date; + export type ObjectIdSchemaDefinition = 'ObjectId' | 'ObjectID' | typeof Schema.Types.ObjectId | Schema.Types.ObjectId | Types.ObjectId | typeof Types.ObjectId; + export type BufferSchemaDefinition = typeof Buffer | 'buffer' | 'Buffer' | typeof Schema.Types.Buffer; + export type Decimal128SchemaDefinition = 'decimal128' | 'Decimal128' | typeof Schema.Types.Decimal128 | Schema.Types.Decimal128 | Types.Decimal128; + export type BigintSchemaDefinition = 'bigint' | 'BigInt' | typeof Schema.Types.BigInt | Schema.Types.BigInt | typeof BigInt | BigInt; + export type UuidSchemaDefinition = 'uuid' | 'UUID' | typeof Schema.Types.UUID | Schema.Types.UUID; + export type MapSchemaDefinition = MapConstructor | 'Map' | typeof Schema.Types.Map; + export type UnionSchemaDefinition = 'Union' | 'union' | typeof Schema.Types.Union | Schema.Types.Union; + export type DoubleSchemaDefinition = 'double' | 'Double' | typeof Schema.Types.Double | Schema.Types.Double; + + export type SchemaDefinitionWithBuiltInClass = T extends number + ? NumberSchemaDefinition + : T extends string + ? StringSchemaDefinition + : T extends boolean + ? BooleanSchemaDefinition + : T extends NativeDate + ? DateSchemaDefinition + : (Function | string); + + export type SchemaDefinitionProperty> = + // ThisType intersection here avoids corrupting ThisType for SchemaTypeOptions (see test gh11828) + | SchemaDefinitionWithBuiltInClass & ThisType + | SchemaTypeOptions + | typeof SchemaType + | Schema + | Schema[] + | SchemaTypeOptions, EnforcedDocType, THydratedDocumentType>[] + | Function[] + | SchemaDefinition + | SchemaDefinition, EnforcedDocType, THydratedDocumentType>[] + | typeof Schema.Types.Mixed + | MixedSchemaTypeOptions; + + export type SchemaDefinition> = T extends undefined + ? { [path: string]: SchemaDefinitionProperty; } + : { [path in keyof T]?: SchemaDefinitionProperty; }; + + export type AnyArray = T[] | ReadonlyArray; + export type ExtractMongooseArray = T extends Types.Array ? AnyArray> : T; + + export interface MixedSchemaTypeOptions extends SchemaTypeOptions { + type: typeof Schema.Types.Mixed; + } + + export type RefType = + | number + | string + | Buffer + | undefined + | Types.ObjectId + | Types.Buffer + | typeof Schema.Types.Number + | typeof Schema.Types.String + | typeof Schema.Types.Buffer + | typeof Schema.Types.ObjectId + | typeof Schema.Types.UUID; + + + export type InferId = mongodb.InferIdType; + + export interface VirtualTypeOptions { + /** If `ref` is not nullish, this becomes a populated virtual. */ + ref?: string | Function; + + /** The local field to populate on if this is a populated virtual. */ + localField?: string | ((this: HydratedDocType, doc: HydratedDocType) => string); + + /** The foreign field to populate on if this is a populated virtual. */ + foreignField?: string | ((this: HydratedDocType, doc: HydratedDocType) => string); + + /** + * By default, a populated virtual is an array. If you set `justOne`, + * the populated virtual will be a single doc or `null`. + */ + justOne?: boolean; + + /** If you set this to `true`, Mongoose will call any custom getters you defined on this virtual. */ + getters?: boolean; + + /** + * If you set this to `true`, `populate()` will set this virtual to the number of populated + * documents, as opposed to the documents themselves, using `Query#countDocuments()`. + */ + count?: boolean; + + /** Add an extra match condition to `populate()`. */ + match?: QueryFilter | ((doc: Record, virtual?: this) => Record | null); + + /** Add a default `limit` to the `populate()` query. */ + limit?: number; + + /** Add a default `skip` to the `populate()` query. */ + skip?: number; + + /** + * For legacy reasons, `limit` with `populate()` may give incorrect results because it only + * executes a single query for every document being populated. If you set `perDocumentLimit`, + * Mongoose will ensure correct `limit` per document by executing a separate query for each + * document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` + * will execute 2 additional queries if `.find()` returns 2 documents. + */ + perDocumentLimit?: number; + + /** Additional options like `limit` and `lean`. */ + options?: QueryOptions & { match?: AnyObject }; + + /** If true and the given `name` is a direct child of an array, apply the virtual to the array rather than the elements. */ + applyToArray?: boolean; + + /** Additional options for plugins */ + [extra: string]: any; + } + + export class VirtualType { + /** Applies getters to `value`. */ + applyGetters(value: any, doc: Document): any; + + /** Applies setters to `value`. */ + applySetters(value: any, doc: Document): any; + + /** Adds a custom getter to this virtual. */ + get(fn: (this: T, value: any, virtualType: VirtualType, doc: T) => any): this; + + /** Adds a custom setter to this virtual. */ + set(fn: (this: T, value: any, virtualType: VirtualType, doc: T) => void): this; + } + + export type ReturnsNewDoc = { new: true } | { returnOriginal: false } | { returnDocument: 'after' }; + + export type ArrayProjectionOperators = { $slice: number | [number, number]; $elemMatch?: never } | { $elemMatch: Record; $slice?: never }; + export type ProjectionOperators = { $meta: string }; + /** + * This Type Assigns `Element | undefined` recursively to the `T` type. + * if it is an array it will do this to the element of the array, if it is an object it will do this for the properties of the object. + * `Element` is the truthy or falsy values that are going to be used as the value of the projection.(1 | true or 0 | false) + * For the elements of the array we will use: `Element | `undefined` | `ArrayProjectionOperators` + * @example + * type CalculatedType = Projector<{ a: string, b: number, c: { d: string }, d: string[] }, true> + * type CalculatedType = { + a?: true | undefined; + b?: true | undefined; + c?: true | { + d?: true | undefined; + } | undefined; + d?: true | ArrayProjectionOperators | undefined; + } + */ + export type Projector = T extends Array + ? Projector | ArrayProjectionOperators | ProjectionOperators + : T extends TreatAsPrimitives + ? Element | ProjectionOperators + : T extends Record + ? { + [K in keyof T]?: T[K] extends Record ? Projector | Element | ProjectionOperators : Element | ProjectionOperators; + } + : Element | ProjectionOperators; + type _IDType = { _id?: boolean | number }; + export type InclusionProjection = IsItRecordAndNotAny extends true + ? Omit, boolean | number>, '_id'> & _IDType + : AnyObject; + export type ExclusionProjection = IsItRecordAndNotAny extends true + ? Omit, false | 0>, '_id'> & _IDType + : AnyObject; + + export type ProjectionType = (InclusionProjection & AnyObject) + | (ExclusionProjection & AnyObject) + | string; + export type SortValues = SortOrder; + + export type SortOrder = -1 | 1 | 'asc' | 'ascending' | 'desc' | 'descending'; + + type _UpdateQuery = { + /** @see https://www.mongodb.com/docs/manual/reference/operator/update-field/ */ + $currentDate?: AnyKeys & AdditionalProperties; + $inc?: AnyKeys & AdditionalProperties; + $min?: AnyKeys & AdditionalProperties; + $max?: AnyKeys & AdditionalProperties; + $mul?: AnyKeys & AdditionalProperties; + $rename?: Record; + $set?: AnyKeys & AdditionalProperties; + $setOnInsert?: AnyKeys & AdditionalProperties; + $unset?: AnyKeys & AdditionalProperties; + + /** @see https://www.mongodb.com/docs/manual/reference/operator/update-array/ */ + $addToSet?: AnyKeys & AdditionalProperties; + $pop?: AnyKeys & AdditionalProperties; + $pull?: AnyKeys & AdditionalProperties; + $push?: AnyKeys & AdditionalProperties; + $pullAll?: AnyKeys & AdditionalProperties; + + /** @see https://www.mongodb.com/docs/manual/reference/operator/update-bitwise/ */ + $bit?: AnyKeys; + }; + + export type UpdateWithAggregationPipeline = UpdateAggregationStage[]; + export type UpdateAggregationStage = { $addFields: any } | + { $set: any } | + { $project: any } | + { $unset: any } | + { $replaceRoot: any } | + { $replaceWith: any }; + + /** + * Update query command to perform on the document + * @example + * ```js + * { age: 30 } + * ``` + */ + export type UpdateQuery = AnyKeys & _UpdateQuery & AnyObject; + + /** + * A more strict form of UpdateQuery that enforces updating only + * known top-level properties. + * @example + * ```ts + * function updateUser(_id: mongoose.Types.ObjectId, update: UpdateQueryKnownOnly) { + * return User.updateOne({ _id }, update); + * } + * ``` + */ + export type UpdateQueryKnownOnly = _UpdateQuery; + + export type FlattenMaps = { + [K in keyof T]: FlattenProperty; + }; + + export type BufferToBinaryProperty = unknown extends Buffer + ? T + : T extends Buffer + ? mongodb.Binary + : T extends Types.DocumentArray + ? Types.DocumentArray> + : T extends Types.Subdocument + ? HydratedSingleSubdocument> + : BufferToBinary; + + /** + * Converts any Buffer properties into mongodb.Binary instances, which is what `lean()` returns + */ + export type BufferToBinary = unknown extends Buffer + ? T + : T extends Buffer + ? mongodb.Binary + : T extends Document + ? T + : T extends TreatAsPrimitives + ? T + : T extends Record + ? { + [K in keyof T]: BufferToBinaryProperty + } + : T; + + /** + * Converts any Buffer properties into { type: 'buffer', data: [1, 2, 3] } format for JSON serialization + */ + export type BufferToJSON = unknown extends Buffer + ? T + : T extends Buffer + ? { type: 'buffer', data: number[] } + : T extends Document + ? T + : T extends TreatAsPrimitives + ? T + : T extends Record ? { + [K in keyof T]: T[K] extends Buffer + ? { type: 'buffer', data: number[] } + : T[K] extends Types.DocumentArray + ? Types.DocumentArray> + : T[K] extends Types.Subdocument + ? HydratedSingleSubdocument + : BufferToBinary; + } : T; + + /** + * Converts any UUID properties into strings for JSON serialization + */ + export type UUIDToString = T extends Types.UUID + ? string + : T extends mongodb.UUID + ? string + : T extends Document + ? T + : T extends TreatAsPrimitives + ? T + : T extends Record ? { + [K in keyof T]: T[K] extends Types.UUID + ? string + : T[K] extends mongodb.UUID + ? string + : T[K] extends Types.DocumentArray + ? Types.DocumentArray> + : T[K] extends Types.Subdocument + ? HydratedSingleSubdocument> + : UUIDToString; + } : T; + + /** + * Alias for UUIDToString for backwards compatibility. + * @deprecated Use UUIDToString instead. + */ + export type UUIDToJSON = UUIDToString; + + /** + * Converts any ObjectId properties into strings for JSON serialization + */ + export type ObjectIdToString = T extends mongodb.ObjectId + ? string + : T extends Document + ? T + : T extends TreatAsPrimitives + ? T + : T extends Record ? { + [K in keyof T]: T[K] extends mongodb.ObjectId + ? string + : T[K] extends Types.DocumentArray + ? Types.DocumentArray> + : T[K] extends Types.Subdocument + ? HydratedSingleSubdocument> + : ObjectIdToString; + } : T; + + /** + * Converts any Date properties into strings for JSON serialization + */ + export type DateToString = T extends NativeDate + ? string + : T extends Document + ? T + : T extends TreatAsPrimitives + ? T + : T extends Record ? { + [K in keyof T]: T[K] extends NativeDate + ? string + : T[K] extends (NativeDate | null | undefined) + ? string | null | undefined + : T[K] extends Types.DocumentArray + ? Types.DocumentArray> + : T[K] extends Types.Subdocument + ? HydratedSingleSubdocument> + : DateToString; + } : T; + + /** + * Converts any Mongoose subdocuments (single nested or doc arrays) into POJO equivalents + */ + export type SubdocsToPOJOs = T extends Document + ? T + : T extends TreatAsPrimitives + ? T + : T extends Record ? { + [K in keyof T]: T[K] extends Types.DocumentArray + ? ItemType[] + : T[K] extends Types.Subdocument + ? SubdocType + : SubdocsToPOJOs; + } : T; + + export type JSONSerialized = SubdocsToPOJOs< + FlattenMaps< + BufferToJSON< + ObjectIdToString< + UUIDToJSON< + DateToString + > + > + > + > + >; + + /** + * Helper types for computing toObject/toJSON return types based on options. + * These compose transforms conditionally to avoid combinatorial explosion of overloads. + */ + type ApplyVirtuals = + O extends { virtuals: true } ? T & TVirtuals : T; + + type GetVersionKeyName = + TSchemaOptions extends { versionKey: infer VK } + ? VK extends string ? VK : '__v' + : '__v'; + + type ApplyVersionKey = + O extends { versionKey: false } ? Omit> : T; + + /** + * Single-pass type that applies all flatten transforms (flattenMaps, flattenObjectIds, flattenUUIDs) + * in one recursive traversal. This avoids TypeScript's "union type too complex" error that occurs + * when nesting separate recursive transform types. + * + * By handling all transforms in one pass, we correctly handle ObjectIds/UUIDs nested inside Maps + * since we recurse into Map values during the same traversal that converts ObjectIds/UUIDs. + */ + type ApplyFlattenTransforms = + // Handle ObjectId first (before TreatAsPrimitives since ObjectId is in TreatAsPrimitives) + T extends mongodb.ObjectId + ? O extends { flattenObjectIds: true } ? string : T + // Handle UUID (both Types.UUID and mongodb.UUID) + : T extends Types.UUID + ? O extends { flattenUUIDs: true } ? string : T + : T extends mongodb.UUID + ? O extends { flattenUUIDs: true } ? string : T + // Handle Map - flatten to Record and recurse into values + : T extends Map + ? O extends { flattenMaps: true } + ? Record> + : T + // Don't recurse into Documents + : T extends Document + ? T + // Don't modify primitives + : T extends TreatAsPrimitives + ? T + // Handle DocumentArray - recurse into items + : T extends Types.DocumentArray + ? Types.DocumentArray> + // Handle plain arrays - recurse into items + : T extends Array + ? ApplyFlattenTransforms[] + // Handle Subdocument - recurse into subdoc type + : T extends Types.Subdocument + ? HydratedSingleSubdocument> + // Handle regular objects - recurse into properties + : T extends Record + ? { [K in keyof T]: ApplyFlattenTransforms } + : T; + + /** + * Extracts the `toObject` or `toJSON` options declared in the schema options. + * The runtime applies these as defaults when the corresponding method is + * called without arguments. + */ + export type SchemaDeclaredToObjectOptions = + Key extends keyof TSchemaOptions + ? NonNullable extends infer O extends ToObjectOptions + ? O + : {} + : {}; + + /** + * Computes the return type of toObject/toJSON when called without arguments, + * applying the options declared in the schema like the runtime does. When the + * schema declares no options for the method, the plain document shape is + * returned without running it through the option transforms. + */ + export type DefaultToObjectReturnType = + SchemaDeclaredToObjectOptions extends infer O extends ToObjectOptions + ? keyof O extends never + ? Default__v, TSchemaOptions> + : ToObjectReturnType + : Default__v, TSchemaOptions>; + + /** + * Computes the return type of toObject/toJSON based on the provided options. + * Uses a single-pass transform for flatten operations to correctly handle all combinations. + */ + export type ToObjectReturnType = + ApplyVersionKey< + Default__v< + ApplyFlattenTransforms< + ApplyVirtuals, TVirtuals, O>, + O + >, + TSchemaOptions + >, + O, + TSchemaOptions + >; + + /** + * Separate type is needed for properties of union type (for example, Types.DocumentArray | undefined) to apply conditional check to each member of it + * https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types + */ + type FlattenProperty = T extends Map + ? Record : T extends TreatAsPrimitives + ? T : T extends Document ? T : T extends Types.DocumentArray + ? Types.DocumentArray> : FlattenMaps; + + export type actualPrimitives = string | boolean | number | bigint | symbol | null | undefined; + export type TreatAsPrimitives = actualPrimitives | NativeDate | RegExp | symbol | Error | BigInt | Types.ObjectId | Buffer | Function | mongodb.Binary | mongodb.ClientSession; + + export type SchemaDefinitionType = T extends Document ? Omit> : T; + + /* for ts-mongoose */ + export class mquery { } + + export function overwriteMiddlewareResult(val: any): Kareem.OverwriteResult; + + export function skipMiddlewareFunction(val: any): Kareem.SkipWrappedFunction; + + export function overwriteMiddlewareArguments(val: any): Kareem.OverwriteArguments; + + export default mongoose; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/indexes.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/indexes.d.ts new file mode 100644 index 00000000..e61e99d2 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/indexes.d.ts @@ -0,0 +1,170 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** + * Makes the indexes in MongoDB match the indexes defined in every model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + */ + function syncIndexes(options?: SyncIndexesOptions): Promise; + + interface IndexManager { + /* Deletes all indexes that aren't defined in this model's schema. Used by `syncIndexes()`. Returns list of dropped index names. */ + cleanIndexes(options?: { toDrop?: string[], hideIndexes?: boolean }): Promise; + + /** + * Similar to `ensureIndexes()`, except for it uses the [`createIndex`](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#createIndex) + * function. + */ + createIndexes(options?: mongodb.CreateIndexesOptions): Promise; + + /** + * Does a dry-run of Model.syncIndexes(), meaning that + * the result of this function would be the result of + * Model.syncIndexes(). + */ + diffIndexes(options?: Record): Promise + + /** + * Sends `createIndex` commands to mongo for each index declared in the schema. + * The `createIndex` commands are sent in series. + */ + ensureIndexes(options?: mongodb.CreateIndexesOptions): Promise; + + /** + * Lists the indexes currently defined in MongoDB. This may or may not be + * the same as the indexes defined in your schema depending on whether you + * use the [`autoIndex` option](/docs/guide.html#autoIndex) and if you + * build indexes manually. + */ + listIndexes(): Promise>; + + /** + * Makes the indexes in MongoDB match the indexes defined in this model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + */ + syncIndexes(options?: SyncIndexesOptions): Promise>; + } + + interface IndexesDiff { + /** Indexes that would be created in mongodb. */ + toCreate: Array + /** Indexes that would be dropped in mongodb. */ + toDrop: Array + } + + type IndexDirection = 1 | -1 | '2d' | '2dsphere' | 'geoHaystack' | 'hashed' | 'text' | 'ascending' | 'asc' | 'descending' | 'desc'; + type IndexDefinition = Record; + + interface SyncIndexesOptions extends mongodb.CreateIndexesOptions { + continueOnError?: boolean; + hideIndexes?: boolean; + } + type ConnectionSyncIndexesResult = Record; + type OneCollectionSyncIndexesResult = Array & mongodb.MongoServerError; + + type IndexOptions = Omit & { + /** + * `expires` utilizes the `ms` module from [vercel](https://github.com/vercel/ms) allowing us to use a friendlier syntax: + * + * @example + * ```js + * const schema = new Schema({ prop1: Date }); + * + * // expire in 24 hours + * schema.index({ prop1: 1 }, { expires: 60*60*24 }) + * + * // expire in 24 hours + * schema.index({ prop1: 1 }, { expires: '24h' }) + * + * // expire in 1.5 hours + * schema.index({ prop1: 1 }, { expires: '1.5h' }) + * + * // expire in 7 days + * schema.index({ prop1: 1 }, { expires: '7d' }) + * ``` + */ + expires?: number | string; + weights?: Record; + + unique?: boolean | [true, string] + }; + + type SearchIndexDescription = mongodb.SearchIndexDescription; + + type SearchIndexStatus = 'BUILDING' | 'DELETING' | 'DOES_NOT_EXIST' | 'FAILED' | 'PENDING' | 'READY' | 'STALE'; + + type SearchIndexSynonymMappingStatus = 'BUILDING' | 'FAILED' | 'READY'; + + /** The status of one synonym mapping on one search node. */ + interface SearchIndexSynonymMappingDetail { + /** The build state of the synonym mapping. */ + status: SearchIndexSynonymMappingStatus; + /** Whether the synonym mapping can serve queries. */ + queryable: boolean; + /** The error that made the synonym mapping fail, only returned when its status is `FAILED`. */ + message?: string; + } + + /** The status of one index generation, active or staged, on one search node. */ + interface SearchIndexGenerationDetail { + /** The build state of this index generation. */ + status: SearchIndexStatus; + /** Whether this index generation is ready to serve queries. */ + queryable: boolean; + /** When the definition this generation builds with was created, and its version number. */ + definitionVersion: { version: number, createdAt: NativeDate }; + /** The definition this generation builds with. */ + definition: AnyObject; + /** The status of this generation's synonym mappings, only returned when the index defines any. */ + synonymMappingStatus?: SearchIndexSynonymMappingStatus; + /** The status of each of this generation's synonym mappings, keyed by mapping name. */ + synonymMappingStatusDetail?: Array>; + } + + /** The status of the index on one search node (`mongot`). */ + interface SearchIndexStatusDetail { + /** The hostname of the search node, in the form `..`. */ + hostname: string; + /** The build state of the index on this search node. */ + status: SearchIndexStatus; + /** Whether the index is ready to serve queries on this search node. */ + queryable: boolean; + /** The active index on this search node. */ + mainIndex: SearchIndexGenerationDetail; + /** The index being built in the background, only returned while an existing index is being updated. */ + stagedIndex?: SearchIndexGenerationDetail; + } + + /** + * A single entry of the [`$listSearchIndexes`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSearchIndexes/) + * output, as returned by `Model.listSearchIndexes()`. + */ + interface SearchIndexInfo { + /** The index's unique identifier, a hex string rather than an ObjectId. */ + id: string; + /** The name of the index. */ + name: string; + /** The type of the index. Only returned for Atlas deployments. */ + type?: 'search' | 'vectorSearch'; + /** The build state of the index. */ + status: SearchIndexStatus; + /** Whether the index is ready to serve queries. */ + queryable: boolean; + /** The version number of the most recent definition. */ + latestVersion?: number; + /** When the most recent definition was created, and its version number. */ + latestDefinitionVersion?: { version: number, createdAt: NativeDate }; + /** The most recent definition of the index. */ + latestDefinition: AnyObject; + /** The status of the index on each individual search node. */ + statusDetail?: SearchIndexStatusDetail[]; + /** The status of the index's synonym mappings, only returned when the index defines any. */ + synonymMappingStatus?: SearchIndexSynonymMappingStatus; + /** The status of each synonym mapping on each search node, keyed by mapping name. */ + synonymMappingStatusDetail?: Array>; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferhydrateddoctype.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferhydrateddoctype.d.ts new file mode 100644 index 00000000..b1789cec --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferhydrateddoctype.d.ts @@ -0,0 +1,151 @@ +import { + IsPathRequired, + IsSchemaTypeFromBuiltinClass, + RequiredPaths, + OptionalPaths, + PathEnumOrString +} from './inferschematype'; +import { UUID } from 'mongodb'; + +declare module 'mongoose' { + export type InferHydratedDocTypeFromSchema> = ObtainSchemaGeneric; + + /** + * Given a schema definition, returns the hydrated document type from the schema definition. + */ + export type InferHydratedDocType< + DocDefinition, + TSchemaOptions extends Record = DefaultSchemaOptions + > = Require_id & + OptionalPaths) + ]: IsPathRequired extends true + ? ObtainHydratedDocumentPathType + : ObtainHydratedDocumentPathType | null; + }, TSchemaOptions>>; + + /** + * @summary Obtains schema Path type. + * @description Obtains Path type by separating path type from other options and calling {@link ResolveHydratedPathType} + * @param {PathValueType} PathValueType Document definition path type. + * @param {TypeKey} TypeKey A generic refers to document definition. + */ + type ObtainHydratedDocumentPathType< + PathValueType, + TypeKey extends string = DefaultTypeKey + > = ResolveHydratedPathType< + TypeKey extends keyof PathValueType + ? TypeKey extends keyof PathValueType[TypeKey] + ? PathValueType + : PathValueType[TypeKey] + : PathValueType, + TypeKey extends keyof PathValueType + ? TypeKey extends keyof PathValueType[TypeKey] + ? {} + : Omit + : {}, + TypeKey, + HydratedDocTypeHint, + HydratedDiscriminatorEnumType + >; + + /** + * @summary Allows users to optionally choose their own type for a schema field for stronger typing. + */ + type HydratedDocTypeHint = T extends { __hydratedDocTypeHint: infer U } ? U + : never; + + type DiscriminatorHydratedKey = + ObtainSchemaGeneric extends infer TSchemaOptions ? + 'discriminatorKey' extends keyof TSchemaOptions ? + TSchemaOptions['discriminatorKey'] extends string ? TSchemaOptions['discriminatorKey'] : '__t' + : '__t' + : '__t'; + + type DiscriminatorHydratedBaseType = + InferHydratedDocTypeFromSchema extends Record, any> ? + InferHydratedDocTypeFromSchema + : MergeType, { [K in DiscriminatorHydratedKey]?: null }>; + + type ResolveDiscriminatorHydratedPathType = + IsAny extends true ? never + : TDiscriminators extends Record ? + DiscriminatorHydratedBaseType | + { + [K in keyof TDiscriminators]: TDiscriminators[K] extends Schema ? + MergeType, InferHydratedDocTypeFromSchema> & + { [KDiscriminatorKey in DiscriminatorHydratedKey]: K } + : never + }[keyof TDiscriminators] + : never; + + type HydratedDiscriminatorEnumType = string extends keyof T ? never + : number extends keyof T ? never + : T extends { type: infer BaseType; discriminators: infer TDiscriminators } ? + IsAny extends true ? never + : BaseType extends Schema ? + ResolveDiscriminatorHydratedPathType + : never + : never; + + /** + * Same as inferSchemaType, except: + * + * 1. Replace `Types.DocumentArray` and `Types.Array` with vanilla `Array` + * 2. Replace `ObtainDocumentPathType` with `ObtainHydratedDocumentPathType` + * 3. Replace `ResolvePathType` with `ResolveHydratedPathType` + * + * @summary Resolve path type by returning the corresponding type. + * @param {PathValueType} PathValueType Document definition path type. + * @param {Options} Options Document definition path options except path type. + * @param {TypeKey} TypeKey A generic of literal string type. Refers to the property used for path type definition. + * @returns Type + */ + type ResolveHydratedPathType = {}, TypeKey extends string = DefaultSchemaOptions['typeKey'], TypeHint = never, TDiscriminatorEnumType = never> = + IsNotNever extends true ? TypeHint + : IsNotNever extends true ? TDiscriminatorEnumType + : PathValueType extends Schema ? + THydratedDocumentType : + PathValueType extends AnyArray ? + IfEquals ? + IsItRecordAndNotAny extends true ? + Types.DocumentArray & EmbeddedHydratedDocType> : + Types.DocumentArray, Types.Subdocument['_id'], unknown, InferHydratedDocType> & InferHydratedDocType> : + Item extends Record ? + Item[TypeKey] extends Function | String ? + Types.Array> : + Types.DocumentArray< + InferRawDocType, + Types.Subdocument['_id'], unknown, InferHydratedDocType> & InferHydratedDocType + >: + IsSchemaTypeFromBuiltinClass extends true ? + Types.Array }, TypeKey>> : + IsItRecordAndNotAny extends true ? + Item extends Record ? + Types.Array> : + Types.DocumentArray< + InferRawDocType, + Types.Subdocument['_id'], unknown, InferHydratedDocType> & InferHydratedDocType + > : + Types.Array> + > + : PathValueType extends StringSchemaDefinition ? PathEnumOrString + : IfEquals extends true ? PathEnumOrString + : PathValueType extends NumberSchemaDefinition ? Options['enum'] extends ReadonlyArray ? Options['enum'][number] : number + : PathValueType extends DateSchemaDefinition ? NativeDate + : PathValueType extends BufferSchemaDefinition ? Buffer + : PathValueType extends BooleanSchemaDefinition ? boolean + : PathValueType extends ObjectIdSchemaDefinition ? Types.ObjectId + : PathValueType extends Decimal128SchemaDefinition ? Types.Decimal128 + : PathValueType extends BigintSchemaDefinition ? bigint + : PathValueType extends UuidSchemaDefinition ? UUID + : PathValueType extends DoubleSchemaDefinition ? Types.Double + : PathValueType extends typeof Schema.Types.Mixed ? any + : PathValueType extends MapSchemaDefinition ? Map> + : IfEquals extends true ? any + : PathValueType extends typeof SchemaType ? PathValueType['prototype'] + : PathValueType extends ArrayConstructor ? Types.Array + : PathValueType extends Record ? InferHydratedDocType + : unknown; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferrawdoctype.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferrawdoctype.d.ts new file mode 100644 index 00000000..a783951c --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferrawdoctype.d.ts @@ -0,0 +1,201 @@ +import { + IsSchemaTypeFromBuiltinClass, + PathEnumOrString, + OptionalPaths, + RequiredPaths, + IsPathRequired, + PathAllowsNull +} from './inferschematype'; +import { Binary, UUID } from 'mongodb'; + +declare module 'mongoose' { + export type InferRawDocTypeFromSchema> = IsItRecordAndNotAny> extends true + ? ObtainSchemaGeneric + : unknown extends ObtainSchemaGeneric + ? Require_id>>> + : InferRawDocType>; + + export type InferRawDocTypeWithout_id< + SchemaDefinition, + TSchemaOptions extends Record = DefaultSchemaOptions, + TTransformOptions = { bufferToBinary: false } + > = ApplySchemaOptions<{ + [ + K in keyof (RequiredPaths & + OptionalPaths) + ]: IsPathRequired extends true + ? ObtainRawDocumentPathType + : PathAllowsNull extends true + ? ObtainRawDocumentPathType | null + : ObtainRawDocumentPathType; + }, TSchemaOptions>; + + export type InferRawDocType< + SchemaDefinition, + TSchemaOptions extends Record = DefaultSchemaOptions, + TTransformOptions = { bufferToBinary: false } + > = TSchemaOptions extends { _id: false } + ? InferRawDocTypeWithout_id + : Require_id>; + + /** + * @summary Allows users to optionally choose their own type for a schema field for stronger typing. + * Make sure to check for `any` because `T extends { __rawDocTypeHint: infer U }` will infer `unknown` if T is `any`. + */ + type RawDocTypeHint = IsAny extends true ? never + : T extends { __rawDocTypeHint: infer U } ? U: never; + + type DiscriminatorRawKey = + ObtainSchemaGeneric extends infer TSchemaOptions ? + 'discriminatorKey' extends keyof TSchemaOptions ? + TSchemaOptions['discriminatorKey'] extends string ? TSchemaOptions['discriminatorKey'] : '__t' + : '__t' + : '__t'; + + type DiscriminatorRawBaseType = + InferRawDocTypeFromSchema extends Record, any> ? + InferRawDocTypeFromSchema + : MergeType, { [K in DiscriminatorRawKey]?: null }>; + + type ResolveDiscriminatorRawPathType = + IsAny extends true ? never + : TDiscriminators extends Record ? + DiscriminatorRawBaseType | + { + [K in keyof TDiscriminators]: TDiscriminators[K] extends Schema ? + MergeType, InferRawDocTypeFromSchema> & + { [KDiscriminatorKey in DiscriminatorRawKey]: K } + : never + }[keyof TDiscriminators] + : never; + + type RawDiscriminatorEnumType = string extends keyof T ? never + : number extends keyof T ? never + : T extends { type: infer BaseType; discriminators: infer TDiscriminators } ? + IsAny extends true ? never + : BaseType extends Schema ? + ResolveDiscriminatorRawPathType + : never + : never; + + /** + * @summary Obtains schema Path type. + * @description Obtains Path type by separating path type from other options and calling {@link ResolveRawPathType} + * @param {PathValueType} PathValueType Document definition path type. + * @param {TypeKey} TypeKey A generic refers to document definition. + */ + type ObtainRawDocumentPathType< + PathValueType, + TypeKey extends string = DefaultTypeKey, + TTransformOptions = { bufferToBinary: false } + > = ResolveRawPathType< + TypeKey extends keyof PathValueType ? + TypeKey extends keyof PathValueType[TypeKey] ? + PathValueType + : PathValueType[TypeKey] + : PathValueType, + TypeKey extends keyof PathValueType ? + TypeKey extends keyof PathValueType[TypeKey] ? + {} + : Omit + : {}, + TypeKey, + TTransformOptions, + RawDocTypeHint, + RawDiscriminatorEnumType, + TypeKey extends keyof PathValueType ? false : true + >; + + type neverOrAny = ' ~neverOrAny~'; + + /** + * Same as inferSchemaType, except: + * + * 1. Replace `Types.DocumentArray` and `Types.Array` with vanilla `Array` + * 2. Replace `ObtainDocumentPathType` with `ObtainRawDocumentPathType` + * 3. Replace `ResolvePathType` with `ResolveRawPathType` + * + * @summary Resolve path type by returning the corresponding type. + * @param {PathValueType} PathValueType Document definition path type. + * @param {Options} Options Document definition path options except path type. + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + * @returns Number, "Number" or "number" will be resolved to number type. + */ + type ResolveRawPathType< + PathValueType, + Options extends SchemaTypeOptions = {}, + TypeKey extends string = DefaultSchemaOptions['typeKey'], + TTransformOptions = { bufferToBinary: false }, + TypeHint = never, + TDiscriminatorEnumType = never, + IsNestedPath extends boolean = false + > = + IsNotNever extends true ? TypeHint + : IsNotNever extends true ? TDiscriminatorEnumType + : [PathValueType] extends [neverOrAny] ? PathValueType + : PathValueType extends Schema ? + IsItRecordAndNotAny extends true ? + RawDocType : + unknown extends TSchemaDefinition ? + TSchemaOptions extends { _id: false } ? + FlattenMaps> : + Require_id>> : + InferRawDocType, TTransformOptions> + : PathValueType extends ReadonlyArray ? + IfEquals extends true ? any[] + : Item extends Schema ? + // If Item is a schema, infer its type. + Array extends true ? + RawDocType : + unknown extends TSchemaDefinition ? + TSchemaOptions extends { _id: false } ? + FlattenMaps> : + Require_id>> : + InferRawDocType, TTransformOptions>> + : TypeKey extends keyof Item ? + Item[TypeKey] extends Function | String ? + // If Item has a type key that's a string or a callable, it must be a scalar, + // so we can directly obtain its path type. + ObtainRawDocumentPathType[] + : // If the type key isn't callable, then this is an array of objects, in which case + // we need to call InferRawDocType to correctly infer its type. + Array> + : IsSchemaTypeFromBuiltinClass extends true ? ResolveRawPathType }, TypeKey, TTransformOptions>[] + : IsItRecordAndNotAny extends true ? + Item extends Record ? + ObtainRawDocumentPathType[] + : Array> + : ObtainRawDocumentPathType[] + : PathValueType extends StringSchemaDefinition ? PathEnumOrString + : IfEquals extends true ? PathEnumOrString + : PathValueType extends NumberSchemaDefinition ? + Options['enum'] extends ReadonlyArray ? + Options['enum'][number] + : number + : PathValueType extends DateSchemaDefinition ? NativeDate + : PathValueType extends BufferSchemaDefinition ? (TTransformOptions extends { bufferToBinary: true } ? Binary : Buffer) + : PathValueType extends BooleanSchemaDefinition ? boolean + : PathValueType extends ObjectIdSchemaDefinition ? Types.ObjectId + : PathValueType extends Decimal128SchemaDefinition ? Types.Decimal128 + : PathValueType extends BigintSchemaDefinition ? bigint + : PathValueType extends UuidSchemaDefinition ? Types.UUID + : PathValueType extends MapSchemaDefinition ? Record> + : PathValueType extends DoubleSchemaDefinition ? Types.Double + : PathValueType extends UnionSchemaDefinition ? + ResolveRawPathType ? Item : never> + : PathValueType extends ArrayConstructor ? any[] + : PathValueType extends typeof Schema.Types.Mixed ? any + : IfEquals extends true ? any + : IfEquals extends true ? any + : PathValueType extends typeof SchemaType ? PathValueType['prototype'] + : PathValueType extends Record ? + IsNestedPath extends true ? + // Nested path (no type key) - no _id + InferRawDocTypeWithout_id + : Options extends { _id: false } ? + // Subdocument with _id: false + InferRawDocTypeWithout_id + : // Subdocument with _id (default) + InferRawDocType + : unknown; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferschematype.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferschematype.d.ts new file mode 100644 index 00000000..259865ed --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/inferschematype.d.ts @@ -0,0 +1,387 @@ +import { + AnyArray, + BooleanSchemaDefinition, + BigintSchemaDefinition, + BufferSchemaDefinition, + DateSchemaDefinition, + Decimal128SchemaDefinition, + DefaultSchemaOptions, + DefaultTypeKey, + DoubleSchemaDefinition, + IfAny, + IfEquals, + InferSchemaType, + IsItRecordAndNotAny, + MapSchemaDefinition, + MergeType, + NumberSchemaDefinition, + ObjectIdSchemaDefinition, + ObtainDocumentType, + Schema, + SchemaType, + SchemaTypeOptions, + StringSchemaDefinition, + Types, + UnionSchemaDefinition, + UuidSchemaDefinition +} from 'mongoose'; + +declare module 'mongoose' { + /** + * @summary Obtains document schema type. + * @description Obtains document schema type from document Definition OR returns enforced schema type if it's provided. + * @param {DocDefinition} DocDefinition A generic equals to the type of document definition "provided in as first parameter in Schema constructor". + * @param {EnforcedDocType} EnforcedDocType A generic type enforced by user "provided before schema constructor". + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + */ + type ObtainDocumentType< + DocDefinition, + EnforcedDocType = any, + TSchemaOptions extends Record = DefaultSchemaOptions + > = + IsItRecordAndNotAny extends true ? EnforcedDocType + : { + [K in keyof (RequiredPaths & + OptionalPaths)]: IsPathRequired< + DocDefinition[K], + TSchemaOptions['typeKey'] + > extends true ? + ObtainDocumentPathType + : PathAllowsNull extends true ? + ObtainDocumentPathType | null + : ObtainDocumentPathType; + }; + + /** + * @summary Obtains document schema type from Schema instance. + * @param {Schema} TSchema `typeof` a schema instance. + * @example + * const userSchema = new Schema({userName:String}); + * type UserType = InferSchemaType; + * // result + * type UserType = {userName?: string} + */ + export type InferSchemaType = IfAny>; + + export type DefaultIdVirtual = { id: string }; + export type AddDefaultId = (DocType extends { id: any } ? TVirtuals : TSchemaOptions extends { id: false } ? TVirtuals : TVirtuals & { id: string }); + + /** + * @summary Obtains schema Generic type by using generic alias. + * @param {TSchema} TSchema A generic of schema type instance. + * @param {alias} alias Targeted generic alias. + */ + type ObtainSchemaGeneric< + TSchema, + alias extends + | 'EnforcedDocType' + | 'M' + | 'TInstanceMethods' + | 'TQueryHelpers' + | 'TVirtuals' + | 'TStaticMethods' + | 'TSchemaOptions' + | 'DocType' + | 'THydratedDocumentType' + | 'TSchemaDefinition' + | 'TLeanResultType' + > = + TSchema extends ( + Schema< + infer EnforcedDocType, + infer M, + infer TInstanceMethods, + infer TQueryHelpers, + infer TVirtuals, + infer TStaticMethods, + infer TSchemaOptions, + infer DocType, + infer THydratedDocumentType, + infer TSchemaDefinition, + infer TLeanResultType + > + ) ? + { + EnforcedDocType: EnforcedDocType; + M: M; + TInstanceMethods: IfEquals; + TQueryHelpers: IfEquals; + TVirtuals: AddDefaultId, TSchemaOptions>; + TStaticMethods: IfEquals; + TSchemaOptions: TSchemaOptions; + DocType: DocType; + THydratedDocumentType: THydratedDocumentType; + TSchemaDefinition: TSchemaDefinition; + TLeanResultType: TLeanResultType; + }[alias] + : unknown; + + type TypesAreEqual = [A] extends [B] ? [B] extends [A] ? true : false : false; + + type ResolveSchemaOptions = + keyof T extends never ? DefaultSchemaOptions : + TypesAreEqual extends true ? DefaultSchemaOptions : + MergeType; + + /*! + * ResolveVirtuals resolves the virtuals option from the schema options. + * Adds the default `id` virtual if it is not disabled in schema options or + * overwritten in the RawDocType. + */ + type ResolveVirtuals = + ResolveSchemaOptions extends { virtuals: infer V } + ? AddDefaultId> + : {}; + + type ApplySchemaOptions = ResolveTimestamps; + + type DefaultTimestampProps = { + createdAt: NativeDate; + updatedAt: NativeDate; + }; + + type ResolveTimestamps = + O extends { timestamps?: false } ? T + : O extends { timestamps: infer TimestampOptions } ? + TimestampOptions extends true ? T & DefaultTimestampProps + : TimestampOptions extends SchemaTimestampsConfig ? + Show< + T & { + [K in keyof TimestampOptions & keyof DefaultTimestampProps as TimestampOptions[K] extends true ? K + : TimestampOptions[K] & string]: NativeDate; + } + > + : T + : T; +} + +type RequiredPropertyDefinition = + | { + required: true | string | [true, string | undefined] | { isRequired: true }; + } + | ArrayConstructor + | any[]; + +/** + * @summary Checks if a document path is required or optional. + * @param {P} P Document path. + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + */ +type IsPathRequired = + P extends RequiredPropertyDefinition ? true + : P extends { required: boolean } ? + P extends { required: false } ? + false + : true + : P extends { default: undefined | null | ((...args: any[]) => undefined) | ((...args: any[]) => null) } ? false + : P extends { default: any } ? true + : P extends Record ? true + : false; + +// Internal type used to efficiently check for never or any types +// can be efficiently checked like: +// `[T] extends [neverOrAny] ? T : ...` +// to avoid edge cases +type neverOrAny = ' ~neverOrAny~'; + +/** + * @summary A Utility to obtain schema's required path keys. + * @param {T} T A generic refers to document definition. + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + * @returns required paths keys of document definition. + */ +type RequiredPathKeys = Exclude>; + +/** + * @summary A Utility to obtain schema's required paths. + * @param {T} T A generic refers to document definition. + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + * @returns a record contains required paths with the corresponding type. + */ +type RequiredPaths = Pick< + { -readonly [K in keyof T]: T[K] }, + RequiredPathKeys +>; + +/** + * @summary A Utility to obtain schema's optional path keys. + * @param {T} T A generic refers to document definition. + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + * @returns optional paths keys of document definition. + */ +type OptionalPathKeys = { + [K in keyof T]: IsPathRequired extends true ? never : K; +}[keyof T]; + +/** + * @summary A Utility to obtain schema's optional paths. + * @param {T} T A generic refers to document definition. + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + * @returns a record contains optional paths with the corresponding type. + */ +type OptionalPaths = Pick< + { -readonly [K in keyof T]?: T[K] }, + OptionalPathKeys +>; + +/** + * @summary Checks if a document path allows `null` values. + * @param {P} P Document path. + */ +export type PathAllowsNull

= P extends { allowNull: false } ? false : true; + +/** + * @summary Allows users to optionally choose their own type for a schema field for stronger typing. + */ +type TypeHint = T extends { __typehint: infer U } ? U : never; + +/** + * @summary Obtains schema Path type. + * @description Obtains Path type by separating path type from other options and calling {@link ResolvePathType} + * @param {PathValueType} PathValueType Document definition path type. + * @param {TypeKey} TypeKey A generic refers to document definition. + */ +type ObtainDocumentPathType = ResolvePathType< + TypeKey extends keyof PathValueType ? + TypeKey extends keyof PathValueType[TypeKey] ? + PathValueType + : PathValueType[TypeKey] + : PathValueType, + TypeKey extends keyof PathValueType ? + TypeKey extends keyof PathValueType[TypeKey] ? + {} + : Omit + : {}, + TypeKey, + TypeHint, + DiscriminatorEnumType +>; + +/** + * @param {T} T A generic refers to string path enums. + * @returns Path enum values type as literal strings or string. + */ +type PathEnumOrString['enum']> = + T extends ReadonlyArray ? E + : T extends { values: any } ? PathEnumOrString + : T extends Record ? V + : string; + +type UnionToType = T[number] extends infer U + ? ResolvePathType + : never; + +type ResolveDiscriminatorPathType = + IfAny ? + TDiscriminators[keyof TDiscriminators] extends Schema ? + MergeType, InferSchemaType> + : never + : never>; + +type DiscriminatorEnumType = string extends keyof T ? never + : number extends keyof T ? never + : T extends { type: infer BaseType; discriminators: infer TDiscriminators } ? + IfAny + : never> + : never; + +type IsSchemaTypeFromBuiltinClass = + T extends typeof String ? true + : unknown extends Buffer ? false + : T extends typeof Number ? true + : T extends typeof Boolean ? true + : T extends typeof Buffer ? true + : T extends typeof Schema.Types.ObjectId ? true + : T extends typeof Schema.Types.UUID ? true + : T extends typeof Schema.Types.Decimal128 ? true + : T extends typeof Schema.Types.Int32 ? true + : T extends typeof Schema.Types.String ? true + : T extends typeof Schema.Types.Number ? true + : T extends typeof Schema.Types.Date ? true + : T extends typeof Schema.Types.Double ? true + : T extends typeof Schema.Types.Boolean ? true + : T extends Types.ObjectId ? true + : T extends Types.Decimal128 ? true + : T extends NativeDate ? true + : T extends typeof Schema.Types.Mixed ? true + : T extends Types.UUID ? true + : T extends Buffer ? true + : false; + +/** + * @summary Resolve path type by returning the corresponding type. + * @param {PathValueType} PathValueType Document definition path type. + * @param {Options} Options Document definition path options except path type. + * @param {TypeKey} TypeKey A generic of literal string type."Refers to the property used for path type definition". + * @returns Number, "Number" or "number" will be resolved to number type. + */ +type ResolvePathType< + PathValueType, + Options extends SchemaTypeOptions = {}, + TypeKey extends string = DefaultSchemaOptions['typeKey'], + TypeHint = never, + TDiscriminatorEnumType = never +> = [TypeHint] extends [never] + ? [TDiscriminatorEnumType] extends [never] + ? PathValueType extends Schema ? + InferSchemaType + : PathValueType extends AnyArray ? + [Item] extends [never] + ? any[] + : Item extends Schema ? + // If Item is a schema, infer its type. + Types.DocumentArray> + : Item extends Record ? + Item[TypeKey] extends Schema ? + Types.DocumentArray< + [DiscriminatorEnumType] extends [never] ? InferSchemaType : DiscriminatorEnumType + > + : Item[TypeKey] extends Function | String ? + // If Item has a type key that's a string or a callable, it must be a scalar, + // so we can directly obtain its path type. + ObtainDocumentPathType[] + : // If the type key isn't callable, then this is an array of objects, in which case + // we need to call ObtainDocumentType to correctly infer its type. + Types.DocumentArray> + : IsSchemaTypeFromBuiltinClass extends true ? ResolvePathType }, TypeKey>[] + : IsItRecordAndNotAny extends true ? + Item extends Record ? + ObtainDocumentPathType[] + : Types.DocumentArray> + : ObtainDocumentPathType[] + : PathValueType extends StringSchemaDefinition ? PathEnumOrString + : IfEquals extends true ? PathEnumOrString + : PathValueType extends NumberSchemaDefinition ? + Options['enum'] extends ReadonlyArray ? + Options['enum'][number] + : number + : PathValueType extends DateSchemaDefinition ? NativeDate + : PathValueType extends UuidSchemaDefinition ? Types.UUID + : PathValueType extends BufferSchemaDefinition ? Buffer + : PathValueType extends BooleanSchemaDefinition ? boolean + : PathValueType extends ObjectIdSchemaDefinition ? Types.ObjectId + : PathValueType extends Decimal128SchemaDefinition ? Types.Decimal128 + : PathValueType extends BigintSchemaDefinition ? bigint + : PathValueType extends DoubleSchemaDefinition ? Types.Double + : PathValueType extends MapSchemaDefinition ? Map> + : PathValueType extends UnionSchemaDefinition ? + Options['of'] extends AnyArray ? ResolvePathType + : never + : PathValueType extends ArrayConstructor ? any[] + : PathValueType extends typeof Schema.Types.Mixed ? any + : PathValueType extends ObjectConstructor ? any + : IfEquals extends true ? any + : PathValueType extends typeof SchemaType ? PathValueType['prototype'] + : PathValueType extends Record ? + ObtainDocumentType< + PathValueType, + any, + { + typeKey: TypeKey; + } + > + : unknown + : TDiscriminatorEnumType + : TypeHint; diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/middlewares.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/middlewares.d.ts new file mode 100644 index 00000000..d2d5d10b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/middlewares.d.ts @@ -0,0 +1,75 @@ +declare module 'mongoose' { + import Kareem = require('kareem'); + + type MongooseQueryAndDocumentMiddleware = 'updateOne' | 'deleteOne'; + + type MongooseDistinctDocumentMiddleware = 'save' | 'validate'; + type MongooseDocumentMiddleware = MongooseDistinctDocumentMiddleware | MongooseQueryAndDocumentMiddleware; + + type MongooseRawResultQueryMiddleware = 'findOneAndUpdate' | 'findOneAndReplace' | 'findOneAndDelete'; + type MongooseDistinctQueryMiddleware = 'estimatedDocumentCount' | 'countDocuments' | 'deleteMany' | 'distinct' | 'find' | 'findOne' | 'findOneAndDelete' | 'findOneAndReplace' | 'findOneAndUpdate' | 'replaceOne' | 'updateMany'; + + type MongooseDefaultQueryMiddleware = MongooseDistinctQueryMiddleware | 'updateOne' | 'deleteOne'; + type MongooseQueryMiddleware = MongooseDistinctQueryMiddleware | MongooseQueryAndDocumentMiddleware; + + type MongooseQueryOrDocumentMiddleware = MongooseDistinctQueryMiddleware|MongooseDistinctDocumentMiddleware|MongooseQueryAndDocumentMiddleware; + + type MiddlewareOptions = { + /** + * Enable this Hook for the Document Methods + * @default true + */ + document?: boolean, + /** + * Enable this Hook for the Query Methods + * @default true + */ + query?: boolean, + /** + * Explicitly set this function to be a Error handler instead of based on how many arguments are used + * @default false + */ + errorHandler?: boolean + }; + type SchemaPreOptions = MiddlewareOptions; + type SchemaPostOptions = MiddlewareOptions; + + interface SkipMiddlewareOptions { + /** If `false`, skip pre middleware. */ + pre?: boolean; + /** If `false`, skip post middleware. */ + post?: boolean; + } + + interface SupportsMiddlewareOption { + /** + * Set to `true` to let callers skip this custom static's or method's middleware + * by passing `{ middleware: false }` as the last argument. + * See [skipping middleware for custom statics and methods](https://mongoosejs.com/docs/middleware.html#skip-custom-statics-and-methods). + */ + supportsMiddlewareOption?: boolean; + } + + type PreMiddlewareFunction = ( + this: ThisType, + opts?: Record + ) => void | Promise | Kareem.SkipWrappedFunction; + type PreDeleteOneMiddlewareFunction = ( + this: ThisType, + doc: ThisType, + opts?: Record + ) => void | Promise | Kareem.SkipWrappedFunction; + type PreUpdateOneMiddlewareFunction = ( + this: ThisType, + doc: ThisType, + update?: Record, + opts?: Record + ) => void | Promise | Kareem.SkipWrappedFunction; + type PreSaveMiddlewareFunction = ( + this: ThisType, + opts: SaveOptions + ) => void | Promise | Kareem.SkipWrappedFunction; + type PostMiddlewareFunction = (this: ThisType, res: ResType, next: CallbackWithoutResultAndOptionalError) => void | Promise | Kareem.OverwriteResult; + type ErrorHandlingMiddlewareFunction = (this: ThisType, err: NativeError, res: ResType, next: CallbackWithoutResultAndOptionalError) => void; + type ErrorHandlingMiddlewareWithOption = (this: ThisType, err: NativeError, res: ResType | null, next: CallbackWithoutResultAndOptionalError) => void | Promise | Kareem.OverwriteResult; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/models.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/models.d.ts new file mode 100644 index 00000000..c28d0f4d --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/models.d.ts @@ -0,0 +1,1736 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + import { StandardSchemaV1 as StandardSchemaV1Spec, StandardTypedV1 as StandardTypedV1Spec } from '@standard-schema/spec'; + + export interface DiscriminatorOptions { + value?: string | number | ObjectId; + clone?: boolean; + overwriteModels?: boolean; + mergeHooks?: boolean; + mergePlugins?: boolean; + } + + export interface AcceptsDiscriminator { + /** Adds a discriminator type. */ + discriminator( + name: string | number, + schema: Schema, + value?: string | number | ObjectId | DiscriminatorOptions + ): Model; + discriminator( + name: string | number, + schema: Schema, + value?: string | number | ObjectId | DiscriminatorOptions + ): Model; + } + + export type MongooseBulkWriteResult = mongodb.BulkWriteResult & { + mongoose?: { + validationErrors: Error[], + results: Array + } + }; + + export interface MongooseBulkWriteOptions extends mongodb.BulkWriteOptions { + session?: ClientSession; + skipValidation?: boolean; + throwOnValidationError?: boolean; + strict?: boolean | 'throw'; + /** When false, do not add timestamps to documents. Can be overridden at the operation level. */ + timestamps?: boolean; + /** set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks */ + middleware?: boolean | SkipMiddlewareOptions; + } + + interface MongooseBulkSaveOptions extends mongodb.BulkWriteOptions { + timestamps?: boolean; + session?: ClientSession; + validateBeforeSave?: boolean; + /** set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks */ + middleware?: boolean | SkipMiddlewareOptions; + } + + /** + * @deprecated use AnyBulkWriteOperation instead + */ + interface MongooseBulkWritePerWriteOptions { + timestamps?: boolean; + strict?: boolean | 'throw'; + session?: ClientSession; + skipValidation?: boolean; + } + + interface HydrateOptions { + setters?: boolean; + hydratedPopulatedDocs?: boolean; + virtuals?: boolean; + strict?: boolean | 'throw'; + } + + interface InsertManyOptions extends + PopulateOption, + SessionOption { + limit?: number; + // @deprecated, use includeResultMetadata instead + rawResult?: boolean; + includeResultMetadata?: boolean; + ordered?: boolean; + lean?: boolean; + throwOnValidationError?: boolean; + /** set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks */ + middleware?: boolean | SkipMiddlewareOptions; + timestamps?: boolean | QueryTimestampsConfig; + } + + interface InsertManyResult extends mongodb.InsertManyResult { + mongoose?: { validationErrors?: Array }; + } + + type UpdateWriteOpResult = mongodb.UpdateResult; + type UpdateResult = mongodb.UpdateResult; + type DeleteResult = mongodb.DeleteResult; + + interface ModifyResult { + value: Default__v> | null; + /** see https://www.mongodb.com/docs/manual/reference/command/findAndModify/#lasterrorobject */ + lastErrorObject?: { + updatedExisting?: boolean; + upserted?: mongodb.ObjectId; + }; + ok: 0 | 1; + } + + type WriteConcern = mongodb.WriteConcern; + + /** A list of paths to validate. If set, Mongoose will validate only the modified paths that are in the given list. */ + type PathsToValidate = string[] | string; + /** + * @deprecated + */ + type pathsToValidate = PathsToValidate; + + export import StandardTypedV1 = StandardTypedV1Spec; + export import StandardSchemaV1 = StandardSchemaV1Spec; + + interface SaveOptions extends + SessionOption { + checkKeys?: boolean; + j?: boolean; + /** An array of paths that tell mongoose to only validate and save the paths in `pathsToSave`. */ + pathsToSave?: string[]; + safe?: boolean | WriteConcern; + timestamps?: boolean | QueryTimestampsConfig; + validateBeforeSave?: boolean; + validateModifiedOnly?: boolean; + w?: number | string; + wtimeout?: number; + /** set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks */ + middleware?: boolean | SkipMiddlewareOptions; + } + + interface CreateOptions extends SaveOptions { + ordered?: boolean; + aggregateErrors?: boolean; + } + + interface RemoveOptions extends SessionOption, Omit {} + + interface MongooseBulkWritePerOperationOptions { + /** Skip validation for this operation. */ + skipValidation?: boolean; + /** When false, do not add timestamps. When true, overrides the `timestamps` option set in the `bulkWrite` options. */ + timestamps?: boolean; + } + + interface MongooseBulkUpdatePerOperationOptions extends MongooseBulkWritePerOperationOptions { + /** When true, allows updating fields that are marked as `immutable` in the schema. */ + overwriteImmutable?: boolean; + /** When false, do not set default values on insert. */ + setDefaultsOnInsert?: boolean; + } + + export type InsertOneModel = + mongodb.InsertOneModel & MongooseBulkWritePerOperationOptions; + + export type ReplaceOneModel = + Omit, 'filter'> & + { filter: QueryFilter } & + MongooseBulkUpdatePerOperationOptions; + + export type UpdateOneModel = + Omit, 'filter'> & + { filter: QueryFilter } & + MongooseBulkUpdatePerOperationOptions; + + export type UpdateManyModel = + Omit, 'filter'> & + { filter: QueryFilter } & + MongooseBulkUpdatePerOperationOptions; + + export type DeleteOneModel = + Omit, 'filter'> & + { filter: QueryFilter }; + + export type DeleteManyModel = + Omit, 'filter'> & + { filter: QueryFilter }; + + export type AnyBulkWriteOperation = + | { insertOne: InsertOneModel } + | { replaceOne: ReplaceOneModel } + | { updateOne: UpdateOneModel } + | { updateMany: UpdateManyModel } + | { deleteOne: DeleteOneModel } + | { deleteMany: DeleteManyModel }; + + const Model: Model; + + /* + * Apply common casting logic to the given type, allowing: + * - strings for ObjectIds + * - strings and numbers for Dates + * - strings for Buffers + * - strings for UUIDs + * - POJOs for subdocuments + * - vanilla arrays of POJOs for document arrays + * - POJOs and array of arrays for maps + */ + type CreateObjectWithExtraKeys = T | (T & Record); + type ApplyBasicCreateCasting = { + [K in keyof T]: NonNullable extends Map + ? (Record | Array<[KeyType, ValueType]> | T[K] | QueryTypeCasting>) + : NonNullable extends Types.DocumentArray + ? RawSubdocType[] | T[K] | QueryTypeCasting> + : NonNullable extends Document + ? CreateObjectWithExtraKeys> | T[K] | QueryTypeCasting> + : NonNullable extends TreatAsPrimitives + ? QueryTypeCasting + : NonNullable extends object + ? CreateObjectWithExtraKeys> | T[K] | QueryTypeCasting> + : QueryTypeCasting; + }; + + type HasLeanOption = 'lean' extends keyof ObtainSchemaGeneric ? + ObtainSchemaGeneric['lean'] extends Record ? + true : + ObtainSchemaGeneric['lean'] : + false; + + /** + * Models are fancy constructors compiled from `Schema` definitions. + * An instance of a model is called a document. + * Models are responsible for creating and reading documents from the underlying MongoDB database + */ + export interface Model< + TRawDocType, + TQueryHelpers = {}, + TInstanceMethods = {}, + TVirtuals = {}, + THydratedDocumentType = HydratedDocument, + TSchema = any, + TLeanResultType = TRawDocType> extends + NodeJS.EventEmitter, + IndexManager, + SessionStarter { + new >(doc?: DocType, fields?: any | null, options?: AnyObject): THydratedDocumentType; + + aggregate(pipeline?: PipelineStage[], options?: AggregateOptions): Aggregate>; + aggregate(pipeline: PipelineStage[]): Aggregate>; + + /** Base Mongoose instance the model uses. */ + base: Mongoose; + + /** Standard Schema adapter for validating input with this model's schema. */ + readonly '~standard': StandardSchemaV1.Props< + Default__v< + Default_id>, + ObtainSchemaGeneric + > + >; + + /** + * If this is a discriminator model, `baseModelName` is the name of + * the base model. + */ + baseModelName: string | undefined; + + /* Cast the given POJO to the model's schema */ + castObject(obj: AnyObject, options?: { ignoreCastErrors?: boolean }): TRawDocType; + + /* Apply defaults to the given document or POJO. */ + applyDefaults(obj: AnyObject): AnyObject; + applyDefaults(obj: TRawDocType): TRawDocType; + + /* Apply virtuals to the given POJO. */ + applyVirtuals(obj: AnyObject, virtalsToApply?: string[]): AnyObject; + + /** + * Apply this model's timestamps to a given POJO, including subdocument timestamps + */ + applyTimestamps(obj: AnyObject, options?: { isUpdate?: boolean, currentTime?: () => Date }): AnyObject; + + /** + * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, + * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one + * command. This is faster than sending multiple independent operations (e.g. + * if you use `create()`) because with `bulkWrite()` there is only one network + * round trip to the MongoDB server. + */ + bulkWrite( + writes: Array>, + options: mongodb.BulkWriteOptions & MongooseBulkWriteOptions & { ordered: false } + ): Promise; + bulkWrite( + writes: Array>, + options?: mongodb.BulkWriteOptions & MongooseBulkWriteOptions + ): Promise; + + /** + * Sends multiple `save()` calls in a single `bulkWrite()`. This is faster than + * sending multiple `save()` calls because with `bulkSave()` there is only one + * network round trip to the MongoDB server. + */ + bulkSave(documents: Array, options?: MongooseBulkSaveOptions): Promise; + + /** Collection the model uses. */ + collection: Collection; + + /** Creates a `countDocuments` query: counts the number of documents that match `filter`. */ + countDocuments( + filter?: QueryFilter, + options?: (mongodb.CountOptions & MongooseBaseQueryOptions & mongodb.Abortable) | null + ): QueryWithHelpers< + number, + THydratedDocumentType, + TQueryHelpers, + TRawDocType, + 'countDocuments', + TInstanceMethods & TVirtuals + >; + countDocuments( + filter?: Query, + options?: (mongodb.CountOptions & MongooseBaseQueryOptions & mongodb.Abortable) | null + ): QueryWithHelpers< + number, + THydratedDocumentType, + TQueryHelpers, + TRawDocType, + 'countDocuments', + TInstanceMethods & TVirtuals + >; + + /** Creates a new document or documents */ + create(): Promise; + create(doc: Partial): Promise; + create(docs: Array>): Promise; + create(docs: Array>>>, options: CreateOptions & { aggregateErrors: true }): Promise<(THydratedDocumentType | Error)[]>; + create(docs: Array>>>, options?: CreateOptions): Promise; + create(doc: DeepPartial>>): Promise; + create(...docs: Array>>>): Promise; + + /** + * Create the collection for this model. By default, if no indexes are specified, + * mongoose will not create the collection for the model until any documents are + * created. Use this method to create the collection explicitly. + */ + createCollection(options?: mongodb.CreateCollectionOptions & Pick & { middleware?: boolean | SkipMiddlewareOptions }): Promise>; + + /** + * Create an [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). + * This function only works when connected to MongoDB Atlas. + */ + createSearchIndex(description: SearchIndexDescription): Promise; + + /** + * Creates all [Atlas search indexes](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) defined in this model's schema. + * This function only works when connected to MongoDB Atlas. + */ + createSearchIndexes(): Promise; + + /** Connection the model uses. */ + db: Connection; + + /** + * Deletes all of the documents that match `conditions` from the collection. + * Behaves like `remove()`, but deletes all documents that match `conditions` + * regardless of the `single` option. + */ + deleteMany( + filter?: QueryFilter, + options?: (mongodb.DeleteOptions & MongooseBaseQueryOptions) | null + ): QueryWithHelpers< + mongodb.DeleteResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'deleteMany', + TInstanceMethods & TVirtuals + >; + deleteMany( + filter?: Query, + options?: (mongodb.DeleteOptions & MongooseBaseQueryOptions) | null + ): QueryWithHelpers< + mongodb.DeleteResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'deleteMany', + TInstanceMethods & TVirtuals + >; + + /** + * Deletes the first document that matches `conditions` from the collection. + * Behaves like `remove()`, but deletes at most one document regardless of the + * `single` option. + */ + deleteOne( + filter?: QueryFilter, + options?: (mongodb.DeleteOptions & MongooseBaseQueryOptions) | null + ): QueryWithHelpers< + mongodb.DeleteResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'deleteOne', + TInstanceMethods & TVirtuals + >; + deleteOne( + filter?: Query, + options?: (mongodb.DeleteOptions & MongooseBaseQueryOptions) | null + ): QueryWithHelpers< + mongodb.DeleteResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'deleteOne', + TInstanceMethods & TVirtuals + >; + + /** Adds a discriminator type. */ + discriminator>( + name: string | number, + schema: TDiscriminatorSchema, + value?: string | number | ObjectId | DiscriminatorOptions + ): Model< + TRawDocType & InferSchemaType, + TQueryHelpers & ObtainSchemaGeneric, + TInstanceMethods & ObtainSchemaGeneric, + TVirtuals & ObtainSchemaGeneric + > & ObtainSchemaGeneric & ObtainSchemaGeneric; + discriminator( + name: string | number, + schema: Schema, + value?: string | number | ObjectId | DiscriminatorOptions + ): Model; + discriminator( + name: string | number, + schema: Schema, + value?: string | number | ObjectId | DiscriminatorOptions + ): U; + + /** + * Delete an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) by name. + * This function only works when connected to MongoDB Atlas. + */ + dropSearchIndex(name: string): Promise; + + /** + * Event emitter that reports any errors that occurred. Useful for global error + * handling. + */ + events: NodeJS.EventEmitter; + + /** + * Finds a single document by its _id field. `findById(id)` is almost* + * equivalent to `findOne({ _id: id })`. If you want to query by a document's + * `_id`, use `findById()` instead of `findOne()`. + */ + findById>( + id: any, + projection: Projection, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findById( + id: any, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + TLeanResultType | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findById( + id: any, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findById( + id?: any, + projection?: ProjectionType | null | undefined, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + + /** Finds one document. */ + findOne>( + filter: QueryFilter, + projection: Projection, + options?: QueryOptions & { lean?: false } & mongodb.Abortable + ): QueryWithHelpers< + ProjectedHydratedDocument | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne>( + filter: QueryFilter, + projection: undefined | null, + options: QueryOptions & { projection: Projection; lean?: false } & mongodb.Abortable + ): QueryWithHelpers< + ProjectedHydratedDocument | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne>( + filter: QueryFilter, + projection: Projection, + options: QueryOptions & { lean: true } & mongodb.Abortable + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne>( + filter: QueryFilter, + projection: undefined | null, + options: QueryOptions & { projection: Projection; lean: true } & mongodb.Abortable + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne( + filter: QueryFilter, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: true } & mongodb.Abortable + ): QueryWithHelpers< + TLeanResultType | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne( + filter: Query, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: true } & mongodb.Abortable + ): QueryWithHelpers< + TLeanResultType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne( + filter: QueryFilter, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: false } & mongodb.Abortable + ): QueryWithHelpers< + ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne( + filter?: QueryFilter, + projection?: ProjectionType | null | undefined, + options?: QueryOptions & mongodb.Abortable | null | undefined + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + findOne( + filter?: Query, + projection?: ProjectionType | null | undefined, + options?: QueryOptions & mongodb.Abortable | null | undefined + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : THydratedDocumentType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + + /** + * Shortcut for creating a new Document from existing raw data, pre-saved in the DB. + * The document returned has no paths marked as modified initially. + * With `strict: false`, fields not in the schema are kept on the document; pass + * `ExtraFields` to describe their types, e.g. + * `Model.hydrate<{ totalOrders: number }>(obj, null, { strict: false })`. + */ + hydrate( + obj: any, + projection: ProjectionType | null | undefined, + options: HydrateOptions & { strict: false } + ): THydratedDocumentType & ExtraFields; + hydrate(obj: any, projection?: ProjectionType | null | undefined, options?: HydrateOptions): THydratedDocumentType; + + /** + * This function is responsible for building [indexes](https://www.mongodb.com/docs/manual/indexes/), + * unless [`autoIndex`](http://mongoosejs.com/docs/guide.html#autoIndex) is turned off. + * Mongoose calls this function automatically when a model is created using + * [`mongoose.model()`](/docs/api/mongoose.html#mongoose_Mongoose-model) or + * [`connection.model()`](/docs/api/connection.html#connection_Connection-model), so you + * don't need to call it. + */ + init(): Promise; + + /** Inserts one or more new documents as a single `insertMany` call to the MongoDB server. */ + insertMany( + docs: Array + ): Promise>; + insertMany( + doc: Array, + options: InsertManyOptions & { ordered: false; rawResult: true; } + ): Promise> & { + mongoose: { + validationErrors: (CastError | Error.ValidatorError)[]; + results: Array< + Error | + Object | + THydratedDocumentType + > + } + }>; + insertMany( + docs: Array, + options: InsertManyOptions & { lean: true, rawResult: true; } + ): Promise>>; + insertMany( + doc: DocContents | TRawDocType, + options: InsertManyOptions & { ordered: false; rawResult: true; } + ): Promise> & { + mongoose: { + validationErrors: (CastError | Error.ValidatorError)[]; + results: Array< + Error | + Object | + MergeType + > + } + }>; + insertMany( + docs: Array, + options: InsertManyOptions & { lean: true; } + ): Promise>>; + insertMany( + docs: Array, + options: InsertManyOptions & { rawResult: true; } + ): Promise>>; + insertMany( + docs: Array, + options: InsertManyOptions & { lean: true; } + ): Promise>>; + insertMany( + docs: Array, + options: InsertManyOptions & { rawResult: true; } + ): Promise>>; + insertMany( + doc: DocContents, + options: InsertManyOptions & { lean: true; } + ): Promise>>; + insertMany( + doc: DocContents, + options: InsertManyOptions & { rawResult: true; } + ): Promise>>; + insertMany( + doc: Array, + options: InsertManyOptions + ): Promise>; + insertMany( + docs: Array + ): Promise>>>; + insertMany( + doc: DocContents, + options: InsertManyOptions + ): Promise>>>; + insertMany( + docs: Array, + options: InsertManyOptions + ): Promise>>>; + insertMany( + doc: DocContents + ): Promise< + Array>> + >; + + /** + * Shortcut for saving one document to the database. + * `MyModel.insertOne(obj, options)` is almost equivalent to `new MyModel(obj).save(options)`. + * The difference is that `insertOne()` checks if `obj` is already a document, and checks for discriminators. + */ + insertOne(doc: Partial>, options?: SaveOptions): Promise; + + /** + * List all [Atlas search indexes](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) on this model's collection. + * This function only works when connected to MongoDB Atlas. + */ + listSearchIndexes(options?: mongodb.ListSearchIndexesOptions): Promise>; + + /** The name of the model */ + modelName: string; + + /** Populates document references. */ + populate( + docs: Array, + options: PopulateOptions | Array | string + ): Promise>; + populate( + doc: any, options: PopulateOptions | Array | string + ): Promise; + populate( + docs: Array, + options: PopulateOptions | Array | string + ): Promise, TRawDocType>>>; + populate( + doc: any, options: PopulateOptions | Array | string + ): Promise, TRawDocType>>; + + /** + * Update an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). + * This function only works when connected to MongoDB Atlas. + */ + updateSearchIndex(name: string, definition: AnyObject): Promise; + + /** + * Changes the Connection instance this model uses to make requests to MongoDB. + * This function is most useful for changing the Connection that a Model defined using `mongoose.model()` uses + * after initialization. + */ + useConnection(connection: Connection): this; + + /** Casts and validates the given object against this model's schema, returning the casted-and-validated copy of `obj`, passing the given `context` to custom validators. */ + validate(): Promise; + validate(obj: any): Promise; + validate(obj: any, pathsOrOptions: PathsToValidate): Promise; + validate(obj: any, pathsOrOptions: { pathsToSkip?: pathsToSkip }): Promise; + + /** Watches the underlying collection for changes using [MongoDB change streams](https://www.mongodb.com/docs/manual/changeStreams/). */ + watch(pipeline?: Array>, options?: mongodb.ChangeStreamOptions & { hydrate?: boolean }): mongodb.ChangeStream; + + /** Adds a `$where` clause to this query */ + $where(argument: string | Function): QueryWithHelpers, THydratedDocumentType, TQueryHelpers, TRawDocType, 'find', TInstanceMethods & TVirtuals>; + + /** Registered discriminators for this model. */ + discriminators: { [name: string]: Model } | undefined; + + /** Translate any aliases fields/conditions so the final query or document object is pure */ + translateAliases(raw: any): any; + + /** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */ + distinct( + field: DocKey, + filter?: QueryFilter, + options?: QueryOptions + ): QueryWithHelpers< + Array< + DocKey extends keyof WithLevel1NestedPaths + ? WithoutUndefined[DocKey]>> + : unknown + >, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'distinct', + TInstanceMethods & TVirtuals + >; + distinct( + field: DocKey, + filter?: Query, + options?: QueryOptions + ): QueryWithHelpers< + Array< + DocKey extends keyof WithLevel1NestedPaths + ? WithoutUndefined[DocKey]>> + : unknown + >, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'distinct', + TInstanceMethods & TVirtuals + >; + + /** Creates a `estimatedDocumentCount` query: counts the number of documents in the collection. */ + estimatedDocumentCount(options?: QueryOptions): QueryWithHelpers< + number, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'estimatedDocumentCount', + TInstanceMethods & TVirtuals + >; + + /** + * Returns a document with its `_id` if at least one document exists in the database that matches + * the given `filter`, and `null` otherwise. + */ + exists( + filter: QueryFilter + ): QueryWithHelpers< + { _id: InferId } | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + exists( + filter: Query + ): QueryWithHelpers< + { _id: InferId } | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOne', + TInstanceMethods & TVirtuals + >; + + /** Creates a `find` query: gets a list of documents that match `filter`. */ + find>( + filter: QueryFilter, + projection: Projection, + options?: QueryOptions & { lean?: false } & mongodb.Abortable + ): QueryWithHelpers< + ProjectedHydratedDocument[], + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find>( + filter: QueryFilter, + projection: undefined | null, + options: QueryOptions & { projection: Projection; lean?: false } & mongodb.Abortable + ): QueryWithHelpers< + ProjectedHydratedDocument[], + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find>( + filter: QueryFilter, + projection: Projection, + options: QueryOptions & { lean: true } & mongodb.Abortable + ): QueryWithHelpers< + ApplyProjection[], + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find>( + filter: QueryFilter, + projection: undefined | null, + options: QueryOptions & { projection: Projection; lean: true } & mongodb.Abortable + ): QueryWithHelpers< + ApplyProjection[], + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find( + filter: QueryFilter, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: true } & mongodb.Abortable + ): QueryWithHelpers< + GetLeanResultType, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find( + filter: Query, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: true } & mongodb.Abortable + ): QueryWithHelpers< + GetLeanResultType, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find( + filter: QueryFilter, + projection: ProjectionType | null | undefined, + options: QueryOptions & { lean: false } & mongodb.Abortable + ): QueryWithHelpers< + ResultDoc[], + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find( + filter?: QueryFilter, + projection?: ProjectionType | null | undefined, + options?: QueryOptions & mongodb.Abortable + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType[] : ResultDoc[], + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + find( + filter?: Query, + projection?: ProjectionType | null | undefined, + options?: QueryOptions & mongodb.Abortable + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType[] : THydratedDocumentType[], + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + + /** Finds documents and counts the number of documents matching `filter`. */ + findAndCount>( + filter: QueryFilter, + projection: Projection, + options: QueryOptions & { sort: any; limit: number; lean: true } & mongodb.Abortable + ): Promise<[ApplyProjection[], number]>; + findAndCount( + filter: QueryFilter, + projection: ProjectionType | null | undefined, + options: QueryOptions & { sort: any; limit: number; lean: true } & mongodb.Abortable + ): Promise<[GetLeanResultType, number]>; + findAndCount( + filter: QueryFilter, + projection: ProjectionType | null | undefined, + options: QueryOptions & { sort: any; limit: number; lean: false } & mongodb.Abortable + ): Promise<[ResultDoc[], number]>; + findAndCount( + filter: QueryFilter, + projection: ProjectionType | null | undefined, + options: QueryOptions & { sort: any; limit: number } & mongodb.Abortable + ): Promise<[HasLeanOption extends true ? TLeanResultType[] : ResultDoc[], number]>; + + /** Creates a `findByIdAndDelete` query, filtering by the given `_id`. */ + findByIdAndDelete>( + id: mongodb.ObjectId | any, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata?: false } + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findByIdAndDelete>( + id: mongodb.ObjectId | any, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findByIdAndDelete( + id: mongodb.ObjectId | any, + options: QueryOptions & { includeResultMetadata: true, lean: true } + ): QueryWithHelpers< + ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findByIdAndDelete( + id: mongodb.ObjectId | any, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + TLeanResultType | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findByIdAndDelete( + id: mongodb.ObjectId | any, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findByIdAndDelete( + id: mongodb.ObjectId | any, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findByIdAndDelete( + id?: mongodb.ObjectId | any, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + + + /** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */ + findByIdAndUpdate>( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata?: false } + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate>( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true, lean: true } + ): QueryWithHelpers< + ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true, lean: true } + ): QueryWithHelpers< + ModifyResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + TLeanResultType | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType : ResultDoc, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findByIdAndUpdate( + id?: mongodb.ObjectId | any, + update?: UpdateQuery, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + + /** Creates a `findOneAndDelete` query: atomically finds the given document, deletes it, and returns the document as it was before deletion. */ + findOneAndDelete>( + filter: QueryFilter, + options: QueryOptions & { projection: Projection; lean?: false; includeResultMetadata?: false } + ): QueryWithHelpers< + ProjectedHydratedDocument | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete>( + filter: QueryFilter, + options: QueryOptions & { projection: Projection; lean?: false; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete>( + filter: QueryFilter, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata?: false } + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete>( + filter: QueryFilter, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter: QueryFilter, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + TLeanResultType | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter: Query, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + TLeanResultType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter: QueryFilter, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter: Query, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + THydratedDocumentType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter: QueryFilter, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter: Query, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter?: QueryFilter | null, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + findOneAndDelete( + filter?: Query | null, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : THydratedDocumentType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndDelete', + TInstanceMethods & TVirtuals + >; + + /** Creates a `findOneAndReplace` query: atomically finds the given document and replaces it with `replacement`. */ + findOneAndReplace>( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { projection: Projection; lean?: false; includeResultMetadata?: false } + ): QueryWithHelpers< + ProjectedHydratedDocument | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace>( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { projection: Projection; lean?: false; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace>( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata?: false } + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace>( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + TLeanResultType | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: Query, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + TLeanResultType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: Query, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + THydratedDocumentType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: Query, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: QueryFilter, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType : ResultDoc, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter: Query, + replacement: TRawDocType | AnyObject, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType : THydratedDocumentType, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter?: QueryFilter, + replacement?: TRawDocType | AnyObject, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + findOneAndReplace( + filter?: Query, + replacement?: TRawDocType | AnyObject, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : THydratedDocumentType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndReplace', + TInstanceMethods & TVirtuals + >; + + /** Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`. */ + findOneAndUpdate>( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { projection: Projection; lean?: false; includeResultMetadata?: false } + ): QueryWithHelpers< + ProjectedHydratedDocument | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate>( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { projection: Projection; lean?: false; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate>( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata?: false } + ): QueryWithHelpers< + ApplyProjection | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate>( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { projection: Projection; lean: true; includeResultMetadata: true } + ): QueryWithHelpers< + ModifyResult>, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true, lean: true } + ): QueryWithHelpers< + ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true, lean: true } + ): QueryWithHelpers< + ModifyResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + GetLeanResultType | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { lean: true } + ): QueryWithHelpers< + GetLeanResultType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { lean: false } + ): QueryWithHelpers< + THydratedDocumentType | null, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers< + HasLeanOption extends true ? ModifyResult : ModifyResult, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType : ResultDoc, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType : THydratedDocumentType, + THydratedDocumentType, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter?: QueryFilter, + update?: UpdateQuery, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + findOneAndUpdate( + filter?: Query, + update?: UpdateQuery, + options?: QueryOptions | null + ): QueryWithHelpers< + HasLeanOption extends true ? TLeanResultType | null : ResultDoc | null, + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'findOneAndUpdate', + TInstanceMethods & TVirtuals + >; + + /** Creates a `replaceOne` query: finds the first document that matches `filter` and replaces it with `replacement`. */ + replaceOne( + filter?: QueryFilter, + replacement?: TRawDocType | AnyObject, + options?: (mongodb.ReplaceOptions & QueryOptions) | null + ): QueryWithHelpers; + replaceOne( + filter?: Query, + replacement?: TRawDocType | AnyObject, + options?: (mongodb.ReplaceOptions & QueryOptions) | null + ): QueryWithHelpers; + + /** Apply changes made to this model's schema after this model was compiled. */ + recompileSchema(): void; + + /** Schema the model uses. */ + schema: IfAny< + TSchema, + Schema, TInstanceMethods, TQueryHelpers, TVirtuals>, + TSchema + >; + + /** Creates a `updateMany` query: updates all documents that match `filter` with `update`. */ + updateMany( + filter: QueryFilter, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: (mongodb.UpdateOptions & MongooseUpdateQueryOptions) | null + ): QueryWithHelpers; + updateMany( + filter: Query, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: (mongodb.UpdateOptions & MongooseUpdateQueryOptions) | null + ): QueryWithHelpers; + + /** Creates a `updateOne` query: updates the first document that matches `filter` with `update`. */ + updateOne( + filter: QueryFilter, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: (mongodb.UpdateOptions & MongooseUpdateQueryOptions) | null + ): QueryWithHelpers; + updateOne( + filter: Query, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: (mongodb.UpdateOptions & MongooseUpdateQueryOptions) | null + ): QueryWithHelpers; + + /** Creates a Query, applies the passed conditions, and returns the Query. */ + where( + path: string, + val?: any + ): QueryWithHelpers extends true ? TRawDocType[] : ResultDoc[], ResultDoc, TQueryHelpers, TRawDocType, 'find', TInstanceMethods>; + where(obj: object): QueryWithHelpers< + HasLeanOption extends true ? TRawDocType[] : ResultDoc[], + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + where(): QueryWithHelpers< + HasLeanOption extends true ? TRawDocType[] : ResultDoc[], + ResultDoc, + TQueryHelpers, + TLeanResultType, + 'find', + TInstanceMethods & TVirtuals + >; + + /** + * If auto encryption is enabled, returns a ClientEncryption instance that is configured with the same settings that + * Mongoose's underlying MongoClient is using. If the client has not yet been configured, returns null. + */ + clientEncryption(): mongodb.ClientEncryption | null; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/mongooseoptions.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/mongooseoptions.d.ts new file mode 100644 index 00000000..b7c0bff8 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/mongooseoptions.d.ts @@ -0,0 +1,240 @@ +declare module 'mongoose' { + import stream = require('stream'); + + interface MongooseOptions { + /** + * Set to `true` to set `allowDiskUse` to true to all aggregation operations by default. + * + * @default false + */ + allowDiskUse?: boolean; + /** + * Set to `false` to skip applying global plugins to child schemas. + * + * @default true + */ + applyPluginsToChildSchemas?: boolean; + + /** + * Set to `true` to apply global plugins to discriminator schemas. + * This typically isn't necessary because plugins are applied to the base schema and + * discriminators copy all middleware, methods, statics, and properties from the base schema. + * + * @default false + */ + applyPluginsToDiscriminators?: boolean; + + /** + * autoCreate is `true` by default unless readPreference is secondary or secondaryPreferred, + * which means Mongoose will attempt to create every model's underlying collection before + * creating indexes. If readPreference is secondary or secondaryPreferred, Mongoose will + * default to false for both autoCreate and autoIndex because both createCollection() and + * createIndex() will fail when connected to a secondary. + */ + autoCreate?: boolean; + + /** + * Set to `false` to disable automatic index creation for all models associated with this Mongoose instance. + * + * @default true + */ + autoIndex?: boolean; + + /** + * enable/disable mongoose's buffering mechanism for all connections and models. + * + * @default true + */ + bufferCommands?: boolean; + + /** + * If bufferCommands is on, this option sets the maximum amount of time Mongoose + * buffering will wait before throwing an error. + * If not specified, Mongoose will use 10000 (10 seconds). + * + * @default 10000 + */ + bufferTimeoutMS?: number; + + /** + * Set to `true` to `clone()` all schemas before compiling into a model. + * + * @default false + */ + cloneSchemas?: boolean; + + /** + * Set to `false` to disable the creation of the initial default connection. + * + * @default true + */ + createInitialConnection?: boolean; + + /** + * If `true`, prints the operations mongoose sends to MongoDB to the console. + * If a writable stream is passed, it will log to that stream, without colorization. + * If a callback function is passed, it will receive the collection name, the method + * name, then all arguments passed to the method. For example, if you wanted to + * replicate the default logging, you could output from the callback + * `Mongoose: ${collectionName}.${methodName}(${methodArgs.join(', ')})`. + * + * @default false + */ + debug?: + | boolean + | { color?: boolean; shell?: boolean; timestamp?: boolean; } + | stream.Writable + | ((collectionName: string, methodName: string, ...methodArgs: any[]) => void); + + /** + * If `true`, adds a `id` virtual to all schemas unless overwritten on a per-schema basis. + * @defaultValue true + */ + id?: boolean; + + /** + * If `false`, it will change the `createdAt` field to be [`immutable: false`](https://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-immutable) + * which means you can update the `createdAt`. + * + * @default true + */ + 'timestamps.createdAt.immutable'?: boolean + + /** If set, attaches [maxTimeMS](https://www.mongodb.com/docs/manual/reference/operator/meta/maxTimeMS/) to every query */ + maxTimeMS?: number; + + /** + * Mongoose adds a getter to MongoDB ObjectId's called `_id` that + * returns `this` for convenience with populate. Set this to false to remove the getter. + * + * @default true + */ + objectIdGetter?: boolean; + + /** + * Set to `true` to default to overwriting models with the same name when calling + * `mongoose.model()`, as opposed to throwing an `OverwriteModelError`. + * + * @default false + */ + overwriteModels?: boolean; + + /** + * Set the default value for the `returnDocument` option to `findOneAndUpdate()`, + * `findByIdAndUpdate()`, and `findOneAndReplace()`. + * - `'before'`: Return the document before the update was applied. + * - `'after'`: Return the document after the update was applied. + * + * @default 'before' + */ + returnDocument?: 'before' | 'after'; + + /** + * @deprecated Use `returnDocument` instead. + */ + returnOriginal?: boolean; + + /** + * Set to true to enable [update validators]( + * https://mongoosejs.com/docs/validation.html#update-validators + * ) for all validators by default. + * + * @default false + */ + runValidators?: boolean; + + /** + * Sanitizes query filters against [query selector injection attacks]( + * https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html + * ) by wrapping any nested objects that have a property whose name starts with $ in a $eq. + */ + sanitizeFilter?: boolean; + + sanitizeProjection?: boolean; + + /** + * Set to false to opt out of Mongoose adding all fields that you `populate()` + * to your `select()`. The schema-level option `selectPopulatedPaths` overwrites this one. + * + * @default true + */ + selectPopulatedPaths?: boolean; + + /** + * Mongoose also sets defaults on update() and findOneAndUpdate() when the upsert option is + * set by adding your schema's defaults to a MongoDB $setOnInsert operator. You can disable + * this behavior by setting the setDefaultsOnInsert option to false. + * + * @default true + */ + setDefaultsOnInsert?: boolean; + + /** + * Sets the default strict mode for schemas. + * May be `false`, `true`, or `'throw'`. + * + * @default true + */ + strict?: boolean | 'throw'; + + /** + * Set to `false` to allow populating paths that aren't in the schema. + * + * @default true + */ + strictPopulate?: boolean; + + /** + * Sets the default [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery) mode for schemas. + * May be `false`, `true`, or `'throw'`. + * + * @default false + */ + strictQuery?: boolean | 'throw'; + + /** + * Sets the default [strictRead](https://mongoosejs.com/docs/guide.html#strictRead) mode for schemas. + * May be `false`, `true`, or `'throw'`. + * + * @default false + */ + strictRead?: boolean | 'throw'; + + /** + * Overwrites default objects to `toJSON()`, for determining how Mongoose + * documents get serialized by `JSON.stringify()` + * + * @default { transform: true, flattenDecimals: true } + */ + toJSON?: ToObjectOptions; + + /** + * Overwrites default objects to `toObject()` + * + * @default { transform: true, flattenDecimals: true } + */ + toObject?: ToObjectOptions; + + /** + * Set to true to make Mongoose use Node.js' built-in AsyncLocalStorage (Node >= 16.0.0) + * to set `session` option on all operations within a `connection.transaction(fn)` call + * by default. Defaults to false. + */ + transactionAsyncLocalStorage?: boolean; + + /** + * If `true`, convert any aliases in filter, projection, update, and distinct + * to their database property names. Defaults to false. + */ + translateAliases?: boolean; + + /** + * If `true`, allows passing update pipelines (arrays) to update operations by default + * without explicitly setting `updatePipeline: true` in each query. This is the global + * default for the `updatePipeline` query option. + * + * @default false + */ + updatePipeline?: boolean; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/pipelinestage.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/pipelinestage.d.ts new file mode 100644 index 00000000..a998ee09 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/pipelinestage.d.ts @@ -0,0 +1,334 @@ +declare module 'mongoose' { + /** + * [Stages reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/#aggregation-pipeline-stages) + */ + export type PipelineStage = + | PipelineStage.AddFields + | PipelineStage.Bucket + | PipelineStage.BucketAuto + | PipelineStage.CollStats + | PipelineStage.Count + | PipelineStage.Densify + | PipelineStage.Documents + | PipelineStage.Facet + | PipelineStage.Fill + | PipelineStage.GeoNear + | PipelineStage.GraphLookup + | PipelineStage.Group + | PipelineStage.IndexStats + | PipelineStage.Limit + | PipelineStage.ListSessions + | PipelineStage.Lookup + | PipelineStage.Match + | PipelineStage.Merge + | PipelineStage.Out + | PipelineStage.PlanCacheStats + | PipelineStage.Project + | PipelineStage.Redact + | PipelineStage.ReplaceRoot + | PipelineStage.ReplaceWith + | PipelineStage.Sample + | PipelineStage.Search + | PipelineStage.SearchMeta + | PipelineStage.Set + | PipelineStage.SetWindowFields + | PipelineStage.Skip + | PipelineStage.Sort + | PipelineStage.SortByCount + | PipelineStage.UnionWith + | PipelineStage.Unset + | PipelineStage.Unwind + | PipelineStage.VectorSearch; + + export namespace PipelineStage { + export interface AddFields { + /** [`$addFields` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/) */ + $addFields: Record + } + + export interface Bucket { + /** [`$bucket` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucket/) */ + $bucket: { + groupBy: Expression; + boundaries: any[]; + default?: any + output?: Record + } + } + + export interface BucketAuto { + /** [`$bucketAuto` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucketAuto/) */ + $bucketAuto: { + groupBy: Expression | Record; + buckets: number; + output?: Record; + granularity?: 'R5' | 'R10' | 'R20' | 'R40' | 'R80' | '1-2-5' | 'E6' | 'E12' | 'E24' | 'E48' | 'E96' | 'E192' | 'POWERSOF2'; + } + } + + export interface CollStats { + /** [`$collStats` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/) */ + $collStats: { + latencyStats?: { histograms?: boolean }; + storageStats?: { scale?: number }; + count?: Record; + queryExecStats?: Record; + } + } + + export interface Count { + /** [`$count` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/count/) */ + $count: string; + } + + export interface Densify{ + /** [`$densify` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/densify/) */ + $densify: { + field: string, + partitionByFields?: string[], + range: { + step: number, + unit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year', + bounds: number[] | globalThis.Date[] | 'full' | 'partition' + } + } + } + + export interface Documents { + /** [`$documents` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/documents/) */ + $documents: Record[] + } + + export interface Fill { + /** [`$fill` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/fill/) */ + $fill: { + partitionBy?: Expression, + partitionByFields?: string[], + sortBy?: Record, + output: Record + } + } + + export interface Facet { + /** [`$facet` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/facet/) */ + $facet: Record; + } + + export type FacetPipelineStage = Exclude; + export type UnionWithPipelineStage = Exclude; + + export interface GeoNear { + /** [`$geoNear` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/) */ + $geoNear: { + near: { type: 'Point'; coordinates: [number, number] } | [number, number]; + distanceField: string; + distanceMultiplier?: number; + includeLocs?: string; + key?: string; + maxDistance?: number; + minDistance?: number; + query?: AnyObject; + spherical?: boolean; + /** + * Deprecated. Use only with MondoDB below 4.2 (removed in 4.2) + * @deprecated + */ + num?: number; + } + } + + export interface GraphLookup { + /** [`$graphLookup` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/) */ + $graphLookup: { + from: string; + startWith: any + connectFromField: string; + connectToField: string; + as: string; + maxDepth?: number; + depthField?: string; + restrictSearchWithMatch?: AnyObject; + } + } + + export interface Group { + /** [`$group` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/group) */ + $group: { _id: any } | { [key: string]: AccumulatorOperator } + } + + export interface IndexStats { + /** [`$indexStats` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats/) */ + $indexStats: Record; + } + + export interface Limit { + /** [`$limit` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/limit/) */ + $limit: number + } + + export interface ListSessions { + /** [`$listSessions` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSessions/) */ + $listSessions: { users?: { user: string; db: string }[] } | { allUsers?: true } + } + + export interface Lookup { + /** [`$lookup` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/) */ + $lookup: { + from: string + as: string + localField?: string + foreignField?: string + let?: Record + pipeline?: Exclude[] + } + } + + export interface Match { + /** [`$match` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/match/) */ + $match: QueryFilter; + } + + export interface Merge { + /** [`$merge` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/) */ + $merge: { + into: string | { db: string; coll: string } + on?: string | string[] + let?: Record + whenMatched?: 'replace' | 'keepExisting' | 'merge' | 'fail' | Extract[] + whenNotMatched?: 'insert' | 'discard' | 'fail' + } + } + + export interface Out { + /** [`$out` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/) */ + $out: string | { db: string; coll: string } + } + + export interface PlanCacheStats { + /** [`$planCacheStats` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/) */ + $planCacheStats: Record + } + + export interface Project { + /** [`$project` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/project/) */ + $project: { [field: string]: AnyExpression | Expression | Project['$project'] } + } + + export interface Redact { + /** [`$redact` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/redact/) */ + $redact: Expression; + } + + export interface ReplaceRoot { + /** [`$replaceRoot` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceRoot/) */ + $replaceRoot: { newRoot: AnyExpression } + } + + export interface ReplaceWith { + /** [`$replaceWith` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceWith/) */ + $replaceWith: ObjectExpressionOperator | { [field: string]: Expression } | `$${string}`; + } + + export interface Sample { + /** [`$sample` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/sample/) */ + $sample: { size: number } + } + + export interface Search { + /** [`$search` reference](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/) */ + $search: { + index?: string; + highlight?: { + /** [`highlightPath` reference](https://docs.atlas.mongodb.com/atlas-search/path-construction/#multiple-field-search) */ + path: string | string[] | { value: string, multi: string }; + maxCharsToExamine?: number; + maxNumPassages?: number; + }; + [operator: string]: any; + } + } + + export interface SearchMeta { + /** [`$searchMeta` reference](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#mongodb-pipeline-pipe.-searchMeta) */ + $searchMeta: { + index?: string; + highlight?: { + /** [`highlightPath` reference](https://docs.atlas.mongodb.com/atlas-search/path-construction/#multiple-field-search) */ + path: string | string[] | { value: string, multi: string }; + maxCharsToExamine?: number; + maxNumPassages?: number; + }; + [operator: string]: any; + } + } + + export interface Set { + /** [`$set` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/) */ + $set: Record + } + + export interface SetWindowFields { + /** [`$setWindowFields` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/setWindowFields/) */ + $setWindowFields: { + partitionBy?: any + sortBy?: Record + output: Record< + string, + WindowOperator & { + window?: { + documents?: [string | number, string | number] + range?: [string | number, string | number] + unit?: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' + } + } + > + } + } + + export interface Skip { + /** [`$skip` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/skip/) */ + $skip: number + } + + export interface Sort { + /** [`$sort` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/sort/) */ + $sort: Record + } + + export interface SortByCount { + /** [`$sortByCount` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortByCount/) */ + $sortByCount: Expression; + } + + export interface UnionWith { + /** [`$unionWith` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/) */ + $unionWith: + | string + | { coll: string; pipeline?: UnionWithPipelineStage[] } + | { coll?: string; pipeline: UnionWithPipelineStage[] } + } + + export interface Unset { + /** [`$unset` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unset/) */ + $unset: string | string[] + } + + export interface Unwind { + /** [`$unwind` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/) */ + $unwind: string | { path: string; includeArrayIndex?: string; preserveNullAndEmptyArrays?: boolean } + } + export interface VectorSearch { + /** [`$vectorSearch` reference](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/) */ + $vectorSearch: { + exact?: boolean; + index: string, + path: string, + queryVector: number[], + numCandidates?: number, + limit: number, + filter?: Expression, + } + } + + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/populate.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/populate.d.ts new file mode 100644 index 00000000..8beb1d71 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/populate.d.ts @@ -0,0 +1,105 @@ +declare module 'mongoose' { + + /** + * Reference another Model + */ + type PopulatedDoc< + PopulatedType, + RawId extends RefType = (PopulatedType extends { _id?: RefType; } ? NonNullable : Types.ObjectId) | undefined + > = PopulatedType | RawId; + + const mongoosePopulatedDocumentMarker: unique symbol; + + type ExtractDocumentObjectType = T extends infer ObjectType & Document ? FlatRecord : T; + + type PopulatePathToRawDocType = + T extends Types.DocumentArray + ? PopulatePathToRawDocType[] + : T extends Array + ? PopulatePathToRawDocType[] + : T extends Document + ? SubdocsToPOJOs> + : T extends Record + ? { [K in keyof T]: PopulatePathToRawDocType } + : T; + + type PopulatedPathsDocumentType = UnpackedIntersection>; + + type PopulatedDocumentMarker< + PopulatedRawDocType, + DepopulatedRawDocType, + > = { + [mongoosePopulatedDocumentMarker]?: { + populated: PopulatedRawDocType, + depopulated: DepopulatedRawDocType + } + }; + + type ResolvePopulatedRawDocType< + ThisType, + FallbackRawDocType, + O = never + > = ThisType extends PopulatedDocumentMarker + ? O extends { depopulate: true } + ? DepopulatedRawDocType + : PopulatedRawDocType + : FallbackRawDocType; + + type PopulateDocumentResult< + Doc, + Paths, + PopulatedRawDocType, + DepopulatedRawDocType = PopulatedRawDocType + > = MergeType & PopulatedDocumentMarker; + + interface PopulateOptions { + /** space delimited path(s) to populate */ + path: string; + /** fields to select */ + select?: any; + /** query conditions to match */ + match?: any; + /** optional model to use for population */ + model?: string | Model; + /** by default, Mongoose removes null and undefined values from populated arrays. Use this option to make `populate()` retain `null` and `undefined` array entries. */ + retainNullValues?: boolean; + /** if true, Mongoose will call any getters defined on the `localField`. By default, Mongoose gets the raw value of `localField`. */ + getters?: boolean; + /** if true, Mongoose will clone populated docs before assigning them, so docs that are populated onto multiple parents don't share 1 copy. */ + clone?: boolean; + /** By default, Mongoose throws a cast error if `localField` and `foreignField` schemas don't line up. If you enable this option, Mongoose will instead filter out any `localField` properties that cannot be casted to `foreignField`'s schema type. */ + skipInvalidIds?: boolean; + /** optional query options like sort, limit, etc */ + options?: QueryOptions; + /** correct limit on populated array */ + perDocumentLimit?: number; + /** optional boolean, set to `false` to allow populating paths that aren't in the schema */ + strictPopulate?: boolean; + /** deep populate */ + populate?: string | PopulateOptions | (string | PopulateOptions)[]; + /** + * If true Mongoose will always set `path` to a document, or `null` if no document was found. + * If false Mongoose will always set `path` to an array, which will be empty if no documents are found. + * Inferred from schema by default. + */ + justOne?: boolean; + /** transform function to call on every populated doc */ + transform?: (doc: any, id: any) => any; + /** Overwrite the schema-level local field to populate on if this is a populated virtual. */ + localField?: string; + /** Overwrite the schema-level foreign field to populate on if this is a populated virtual. */ + foreignField?: string; + /** Set to `false` to prevent Mongoose from repopulating paths that are already populated */ + forceRepopulate?: boolean; + /** + * Set to `true` to execute any populate queries one at a time, as opposed to in parallel. + * We recommend setting this option to `true` if using transactions, especially if also populating multiple paths or paths with multiple models. + * MongoDB server does **not** support multiple operations in parallel on a single transaction. + */ + ordered?: boolean; + } + + interface PopulateOption { + populate?: string | string[] | PopulateOptions | PopulateOptions[]; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/query.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/query.d.ts new file mode 100644 index 00000000..b736e3ef --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/query.d.ts @@ -0,0 +1,982 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + type StringQueryTypeCasting = string extends T ? string | RegExp : T | RegExp; + type ObjectIdQueryTypeCasting = Types.ObjectId | string; + type DateQueryTypeCasting = string | number | NativeDate; + type UUIDQueryTypeCasting = Types.UUID | string; + type BufferQueryCasting = Buffer | mongodb.Binary | number[] | string | { $binary: string | mongodb.Binary }; + type QueryTypeCasting = T extends string + ? StringQueryTypeCasting + : T extends Types.ObjectId + ? ObjectIdQueryTypeCasting + : T extends Types.UUID + ? UUIDQueryTypeCasting + : T extends Buffer + ? BufferQueryCasting + : T extends NativeDate + ? DateQueryTypeCasting + : T; + + export type ApplyBasicQueryCasting = QueryTypeCasting | QueryTypeCasting[] | (T extends (infer U)[] ? QueryTypeCasting : T) | null; + + type RemoveIndexSignature = { + [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: T[K]; + }; + + type StrictFilterOperators = RemoveIndexSignature>; + + type StrictCondition = mongodb.AlternativeType | StrictFilterOperators>; + + type _StrictFilter = { + [P in keyof TSchema]?: StrictCondition>; + } & StrictRootFilterOperators; + + type StrictRootFilterOperators = Omit, '$and' | '$or' | '$nor'> & { + $and?: _StrictFilter[]; + $or?: _StrictFilter[]; + $nor?: _StrictFilter[]; + }; + + type _QueryFilter = ( + { [P in keyof T]?: StrictCondition>; } & + StrictRootFilterOperators<{ [P in keyof mongodb.WithId]?: ApplyBasicQueryCasting[P]>; }> + ); + type _QueryFilterLooseId = ( + { [P in keyof T]?: StrictCondition>; } & + StrictRootFilterOperators< + { [P in keyof T]?: ApplyBasicQueryCasting; } + > + ); + type QueryFilter = IsItRecordAndNotAny extends true ? _QueryFilter> : _QueryFilterLooseId>; + + type MongooseBaseQueryOptionKeys = + | 'cloneUpdate' + | 'context' + | 'middleware' + | 'multipleCastError' + | 'overwriteDiscriminatorKey' + | 'overwriteImmutable' + | 'populate' + | 'runValidators' + | 'sanitizeProjection' + | 'sanitizeFilter' + | 'schemaLevelProjections' + | 'setDefaultsOnInsert' + | 'strict' + | 'strictQuery' + | 'translateAliases' + | 'updatePipeline'; + + type MongooseBaseQueryOptions = Pick, MongooseBaseQueryOptionKeys | 'timestamps' | 'lean'> & { + [other: string]: any; + }; + + type MongooseUpdateQueryOptions = Pick, MongooseBaseQueryOptionKeys | 'timestamps'>; + + type ProjectionFields = { [Key in keyof DocType]?: any } & Record; + + type QueryWithHelpers< + ResultType, + DocType, + THelpers = {}, + RawDocType = DocType, + QueryOp = 'find', + TDocOverrides = Record + > = Query & THelpers; + + interface QueryTimestampsConfig { + createdAt?: boolean; + updatedAt?: boolean; + } + + // Options that can be passed to Query.prototype.lean() + interface LeanOptions { + // Set to false to strip out the version key + versionKey?: boolean; + // Transform the result document in place. `doc` is the raw document being transformed. + // Typed as `Record` because TypeScript gets confused when handling Document.prototype.deleteOne() + // and other document methods that try to infer the raw doc type from the Document class. + transform?: (doc: Record) => void; + [key: string]: any; + } + + interface QueryOptions extends + PopulateOption, + SessionOption { + arrayFilters?: AnyObject[]; + batchSize?: number; + collation?: mongodb.CollationOptions; + comment?: any; + context?: string; + /** + * If `false`, Mongoose will not clone the update before executing the query. + */ + cloneUpdate?: boolean; + explain?: mongodb.ExplainVerbosityLike; + fields?: any | string; + hint?: mongodb.Hint; + /** + * If truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. + */ + lean?: boolean | LeanOptions; + limit?: number; + maxTimeMS?: number; + multi?: boolean; + multipleCastError?: boolean; + /** + * By default, `findOneAndUpdate()` returns the document as it was **before** + * `update` was applied. If you set `new: true`, `findOneAndUpdate()` will + * instead give you the object after `update` was applied. + * Use `returnDocument: 'after'` instead of `new: true`, or `returnDocument: 'before'` instead of `new: false`. + * + * @deprecated + */ + new?: boolean; + + /** + * If `false`, skip applying default schema values to the returned document(s). + * @default true + */ + defaults?: boolean; + overwriteDiscriminatorKey?: boolean; + /** + * Mongoose removes updated immutable properties from `update` by default (excluding $setOnInsert). + * Set `overwriteImmutable` to `true` to allow updating immutable properties using other update operators. + */ + overwriteImmutable?: boolean; + projection?: AnyObject | string; + /** + * if true, returns the full ModifyResult rather than just the document + */ + includeResultMetadata?: boolean; + readPreference?: string | mongodb.ReadPreferenceMode; + /** + * An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`. + * Use `returnDocument: 'after'` instead of `returnOriginal: false`, or `returnDocument: 'before'` instead of `returnOriginal: true`. + * + * @deprecated + */ + returnOriginal?: boolean; + /** + * Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @default 'before' + */ + returnDocument?: 'before' | 'after'; + /** + * Set to true to enable `update validators` + * (https://mongoosejs.com/docs/validation.html#update-validators). Defaults to false. + */ + runValidators?: boolean; + /* Set to `true` to automatically sanitize potentially unsafe user-generated query projections */ + sanitizeProjection?: boolean; + /** + * Set to `true` to automatically sanitize potentially unsafe query filters by stripping out query selectors that + * aren't explicitly allowed using `mongoose.trusted()`. + */ + sanitizeFilter?: boolean; + /** + * Enable or disable schema level projections for this query. Enabled by default. + * Set to `false` to include fields with `select: false` in the query result by default. + */ + schemaLevelProjections?: boolean; + setDefaultsOnInsert?: boolean; + skip?: number; + sort?: any; + /** overwrites the schema's strict mode option */ + strict?: boolean | string; + /** + * equal to `strict` by default, may be `false`, `true`, or `'throw'`. Sets the default + * [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery) mode for schemas. + */ + strictQuery?: boolean | 'throw'; + tailable?: number; + /** + * If set to `false` and schema-level timestamps are enabled, + * skip timestamps for this update. Note that this allows you to overwrite + * timestamps. Does nothing if schema-level timestamps are not set. + */ + timestamps?: boolean | QueryTimestampsConfig; + /** + * If `true`, convert any aliases in filter, projection, update, and distinct + * to their database property names. Defaults to false. + */ + translateAliases?: boolean; + upsert?: boolean; + useBigInt64?: boolean; + /** + * Set to true to allow passing in an update pipeline instead of an update document. + * Mongoose disallows update pipelines by default because Mongoose does not cast update pipelines. + */ + updatePipeline?: boolean; + writeConcern?: mongodb.WriteConcern; + + /** set to `false` to skip all user-defined middleware, or `{ pre: false }` / `{ post: false }` to skip only pre or post hooks */ + middleware?: boolean | SkipMiddlewareOptions; + + [other: string]: any; + } + + type QueryOpThatReturnsDocument = 'find' | 'findOne' | 'findOneAndUpdate' | 'findOneAndReplace' | 'findOneAndDelete'; + + type GetLeanResultType = QueryOp extends QueryOpThatReturnsDocument + ? (ResultType extends any[] ? Default__v>[] : Default__v>) + : ResultType; + + type MergePopulatePaths> = QueryOp extends QueryOpThatReturnsDocument + ? ResultType extends null + ? ResultType + : ResultType extends (infer U)[] + ? U extends Document + ? PopulateDocumentResult, RawDocType>[] + : (MergeType)[] + : ResultType extends Document + ? PopulateDocumentResult, RawDocType> + : MergeType + : MergeType; + + class Query> implements SessionOperation { + _mongooseOptions: QueryOptions; + + /** + * Returns a wrapper around a [mongodb driver cursor](https://mongodb.github.io/node-mongodb-native/7.0/classes/FindCursor.html). + * A QueryCursor exposes a Streams3 interface, as well as a `.next()` function. + * This is equivalent to calling `.cursor()` with no arguments. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + + /** Executes the query */ + exec(): Promise; + + $where(argument: string | Function): QueryWithHelpers< + DocType[], + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + + /** Specifies an `$all` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + all(path: string, val: Array): this; + all(val: Array): this; + + /** Sets the allowDiskUse option for the query (ignored for < 4.4.0) */ + allowDiskUse(value: boolean): this; + + /** Specifies arguments for an `$and` condition. */ + and(array: QueryFilter[]): this; + + /** Specifies the batchSize option. */ + batchSize(val: number): this; + + /** Specifies a `$box` condition */ + box(lower: number[], upper: number[]): this; + box(val: any): this; + + /** + * Casts this query to the schema of `model`. + * + * @param {Model} [model] the model to cast to. If not set, defaults to `this.model` + * @param {Object} [obj] If not set, defaults to this query's conditions + * @return {Object} the casted `obj` + */ + cast(model?: Model | null, obj?: any): any; + + /** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like `.then()`, but only takes a rejection handler. + */ + catch: Promise['catch']; + + /** + * Executes the query returning a `Promise` which will be + * resolved with `.finally()` chained. + */ + finally: Promise['finally']; + + // Returns a string representation of this query. + [Symbol.toStringTag]: string; + + /** Specifies a `$center` or `$centerSphere` condition. */ + circle(path: string, area: any): this; + circle(area: any): this; + + /** Make a copy of this query so you can re-execute it. */ + clone(): this; + + /** Adds a collation to this op (MongoDB 3.4 and up) */ + collation(value: mongodb.CollationOptions): this; + + /** Specifies the `comment` option. */ + comment(val: string): this; + + /** Specifies this query as a `countDocuments` query. */ + countDocuments( + criteria?: QueryFilter, + options?: QueryOptions + ): QueryWithHelpers; + countDocuments( + criteria?: Query, + options?: QueryOptions + ): QueryWithHelpers; + + /** + * Returns a wrapper around a [mongodb driver cursor](https://mongodb.github.io/node-mongodb-native/7.0/classes/FindCursor.html). + * A QueryCursor exposes a Streams3 interface, as well as a `.next()` function. + */ + cursor(options?: QueryOptions): Cursor, QueryOptions>; + + /** + * Declare and/or execute this query as a `deleteMany()` operation. Works like + * remove, except it deletes _every_ document that matches `filter` in the + * collection, regardless of the value of `single`. + */ + deleteMany( + filter?: QueryFilter, + options?: QueryOptions + ): QueryWithHelpers; + deleteMany( + filter?: Query, + options?: QueryOptions + ): QueryWithHelpers; + deleteMany(filter: QueryFilter): QueryWithHelpers< + any, + DocType, + THelpers, + RawDocType, + 'deleteMany', + TDocOverrides + >; + deleteMany(filter: Query): QueryWithHelpers< + any, + DocType, + THelpers, + RawDocType, + 'deleteMany', + TDocOverrides + >; + deleteMany(): QueryWithHelpers; + + /** + * Declare and/or execute this query as a `deleteOne()` operation. Works like + * remove, except it deletes at most one document regardless of the `single` + * option. + */ + deleteOne( + filter?: QueryFilter, + options?: QueryOptions + ): QueryWithHelpers; + deleteOne( + filter?: Query, + options?: QueryOptions + ): QueryWithHelpers; + deleteOne(filter: QueryFilter): QueryWithHelpers< + any, + DocType, + THelpers, + RawDocType, + 'deleteOne', + TDocOverrides + >; + deleteOne(filter: Query): QueryWithHelpers< + any, + DocType, + THelpers, + RawDocType, + 'deleteOne', + TDocOverrides + >; + deleteOne(): QueryWithHelpers; + + /** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */ + distinct( + field: DocKey, + filter?: QueryFilter, + options?: QueryOptions + ): QueryWithHelpers< + Array< + DocKey extends keyof WithLevel1NestedPaths + ? WithoutUndefined[DocKey]>> + : ResultType + >, + DocType, + THelpers, + RawDocType, + 'distinct', + TDocOverrides + >; + distinct( + field: DocKey, + filter?: Query, + options?: QueryOptions + ): QueryWithHelpers< + Array< + DocKey extends keyof WithLevel1NestedPaths + ? WithoutUndefined[DocKey]>> + : ResultType + >, + DocType, + THelpers, + RawDocType, + 'distinct', + TDocOverrides + >; + + /** Specifies a `$elemMatch` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + elemMatch(path: string, val: any): this; + elemMatch(val: Function | any): this; + + /** + * Gets/sets the error flag on this query. If this flag is not null or + * undefined, the `exec()` promise will reject without executing. + */ + error(): NativeError | null; + error(val: NativeError | null): this; + + /** Specifies the complementary comparison value for paths specified with `where()` */ + equals(val: any): this; + + /** Creates a `estimatedDocumentCount` query: counts the number of documents in the collection. */ + estimatedDocumentCount(options?: QueryOptions): QueryWithHelpers< + number, + DocType, + THelpers, + RawDocType, + 'estimatedDocumentCount', + TDocOverrides + >; + + /** Specifies a `$exists` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + exists(path: string, val: boolean): this; + exists(val: boolean): this; + + /** + * Sets the [`explain` option](https://www.mongodb.com/docs/manual/reference/method/cursor.explain/), + * which makes this query return detailed execution stats instead of the actual + * query result. This method is useful for determining what index your queries + * use. + */ + explain(verbose?: mongodb.ExplainVerbosityLike): this; + + /** Creates a `find` query: gets a list of documents that match `filter`. */ + find( + filter?: QueryFilter, + projection?: ProjectionType | null, + options?: QueryOptions | null + ): QueryWithHelpers, DocType, THelpers, RawDocType, 'find', TDocOverrides>; + find( + filter?: Query, + projection?: ProjectionType | null, + options?: QueryOptions | null + ): QueryWithHelpers, DocType, THelpers, RawDocType, 'find', TDocOverrides>; + + /** Declares the query a findOne operation. When executed, returns the first found document. */ + findOne( + filter?: QueryFilter, + projection?: ProjectionType | null, + options?: QueryOptions | null + ): QueryWithHelpers; + findOne( + filter?: Query, + projection?: ProjectionType | null, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** Creates a `findOneAndDelete` query: atomically finds the given document, deletes it, and returns the document as it was before deletion. */ + findOneAndDelete( + filter?: QueryFilter, + options?: QueryOptions | null + ): QueryWithHelpers; + findOneAndDelete( + filter?: Query, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`. */ + findOneAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers, DocType, THelpers, RawDocType, 'findOneAndUpdate', TDocOverrides>; + findOneAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers, DocType, THelpers, RawDocType, 'findOneAndUpdate', TDocOverrides>; + findOneAndUpdate( + filter: QueryFilter, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers; + findOneAndUpdate( + filter: Query, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers; + findOneAndUpdate( + filter?: QueryFilter, + update?: UpdateQuery, + options?: QueryOptions | null + ): QueryWithHelpers; + findOneAndUpdate( + filter?: Query, + update?: UpdateQuery, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** Declares the query a findById operation. When executed, returns the document with the given `_id`. */ + findById( + id: mongodb.ObjectId | any, + projection?: ProjectionType | null, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** Creates a `findByIdAndDelete` query, filtering by the given `_id`. */ + findByIdAndDelete( + id: mongodb.ObjectId | any, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers, DocType, THelpers, RawDocType, 'findOneAndDelete', TDocOverrides>; + findByIdAndDelete( + id?: mongodb.ObjectId | any, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */ + findByIdAndUpdate( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { includeResultMetadata: true } + ): QueryWithHelpers; + findByIdAndUpdate( + id: mongodb.ObjectId | any, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc + ): QueryWithHelpers; + findByIdAndUpdate( + id?: mongodb.ObjectId | any, + update?: UpdateQuery, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** Specifies a `$geometry` condition */ + geometry(object: { type: string, coordinates: any[] }): this; + + /** + * For update operations, returns the value of a path in the update's `$set`. + * Useful for writing getters/setters that can work with both update operations + * and `save()`. + */ + get(path: string): any; + + /** Returns the current query filter (also known as conditions) as a POJO. */ + getFilter(): QueryFilter; + + /** Gets query options. */ + getOptions(): QueryOptions; + + /** Gets a list of paths to be populated by this query */ + getPopulatedPaths(): Array; + + /** Returns the current query filter. Equivalent to `getFilter()`. */ + getQuery(): QueryFilter; + + /** Returns the current update operations as a JSON object. */ + getUpdate(): UpdateQuery | UpdateWithAggregationPipeline | null; + + /** Specifies a `$gt` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + gt(path: string, val: any): this; + gt(val: number): this; + + /** Specifies a `$gte` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + gte(path: string, val: any): this; + gte(val: number): this; + + /** Sets query hints. */ + hint(val: any): this; + + /** Specifies an `$in` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + in(path: string, val: any[]): this; + in(val: Array): this; + + /** Declares an intersects query for `geometry()`. */ + intersects(arg?: any): this; + + /** Requests acknowledgement that this operation has been persisted to MongoDB's on-disk journal. */ + j(val: boolean | null): this; + + /** Sets the lean option. */ + lean(): QueryWithHelpers< + ResultType extends null + ? GetLeanResultType | null + : GetLeanResultType, + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + lean( + val: true | LeanOptions + ): QueryWithHelpers< + ResultType extends null + ? GetLeanResultType | null + : GetLeanResultType, + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + lean( + val: false + ): QueryWithHelpers< + ResultType extends AnyArray + ? DocType[] + : ResultType extends null + ? DocType | null + : DocType, + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + lean(): QueryWithHelpers< + ResultType extends null + ? LeanResultType | null + : LeanResultType, + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + lean( + val: boolean | LeanOptions + ): QueryWithHelpers< + ResultType extends null + ? LeanResultType | null + : LeanResultType, + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + + /** Specifies the maximum number of documents the query will return. */ + limit(val: number): this; + + /** Specifies a `$lt` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + lt(path: string, val: any): this; + lt(val: number): this; + + /** Specifies a `$lte` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + lte(path: string, val: any): this; + lte(val: number): this; + + /** + * Runs a function `fn` and treats the return value of `fn` as the new value + * for the query to resolve to. + */ + transform(fn: (doc: ResultType) => MappedType): QueryWithHelpers; + + /** Specifies an `$maxDistance` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + maxDistance(path: string, val: number): this; + maxDistance(val: number): this; + + /** + * Sets the [maxTimeMS](https://www.mongodb.com/docs/manual/reference/method/cursor.maxTimeMS/) + * option. This will tell the MongoDB server to abort if the query or write op + * has been running for more than `ms` milliseconds. + */ + maxTimeMS(ms: number): this; + + /** Merges another Query or conditions object into this one. */ + merge(source: QueryFilter): this; + merge(source: Query): this; + + /** Specifies a `$mod` condition, filters documents for documents whose `path` property is a number that is equal to `remainder` modulo `divisor`. */ + mod(path: string, val: number): this; + mod(val: Array): this; + + /** The model this query was created from */ + model: Model; // Can't use DocType, causes "Type instantiation is excessively deep" + + /** + * Getter/setter around the current mongoose-specific options for this query + * Below are the current Mongoose-specific options. + */ + mongooseOptions(val?: QueryOptions): QueryOptions; + + /** Specifies a `$ne` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + ne(path: string, val: any): this; + ne(val: any): this; + + /** Specifies a `$near` or `$nearSphere` condition */ + near(path: string, val: any): this; + near(val: any): this; + + /** Specifies an `$nin` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + nin(path: string, val: any[]): this; + nin(val: Array): this; + + /** Specifies arguments for an `$nor` condition. */ + nor(array: Array>): this; + + /** Specifies arguments for an `$or` condition. */ + or(array: Array>): this; + + /** + * Make this query throw an error if no documents match the given `filter`. + * This is handy for integrating with async/await, because `orFail()` saves you + * an extra `if` statement to check if no document was found. + */ + orFail(err?: NativeError | (() => NativeError)): QueryWithHelpers, DocType, THelpers, RawDocType, QueryOp, TDocOverrides>; + + /** Specifies a `$polygon` condition */ + polygon(path: string, ...coordinatePairs: number[][]): this; + polygon(...coordinatePairs: number[][]): this; + + /** Specifies paths which should be populated with other documents. */ + populate( + path: string | string[], + select?: string | any, + model?: string | Model, + match?: any + ): QueryWithHelpers< + ResultType, + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + populate( + options: PopulateOptions | (PopulateOptions | string)[] + ): QueryWithHelpers< + ResultType, + DocType, + THelpers, + RawDocType, + QueryOp, + TDocOverrides + >; + populate( + path: string | string[], + select?: string | any, + model?: string | Model, + match?: any + ): QueryWithHelpers< + MergePopulatePaths, + DocType, + THelpers, + UnpackedIntersection, + QueryOp, + TDocOverrides + >; + populate( + options: PopulateOptions | (PopulateOptions | string)[] + ): QueryWithHelpers< + MergePopulatePaths, + DocType, + THelpers, + UnpackedIntersection, + QueryOp, + TDocOverrides + >; + + /** Add pre middleware to this query instance. Doesn't affect other queries. */ + pre(fn: Function): this; + + /** Add post middleware to this query instance. Doesn't affect other queries. */ + post(fn: Function): this; + + /** Get/set the current projection (AKA fields). Pass `null` to remove the current projection. */ + projection(fields?: ProjectionFields | string): ProjectionFields; + projection(fields: null): null; + projection(): ProjectionFields | null; + + /** Determines the MongoDB nodes from which to read. */ + read(mode: string | mongodb.ReadPreferenceMode, tags?: any[]): this; + + /** Sets the readConcern option for the query. */ + readConcern(level: string): this; + + /** Specifies a `$regex` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + regex(path: string, val: RegExp): this; + regex(val: string | RegExp): this; + + /** + * Declare and/or execute this query as a replaceOne() operation. Same as + * `update()`, except MongoDB will replace the existing document and will + * not accept any [atomic](https://www.mongodb.com/docs/manual/tutorial/model-data-for-atomic-operations/#pattern) operators (`$set`, etc.) + */ + replaceOne( + filter?: QueryFilter, + replacement?: DocType | AnyObject, + options?: QueryOptions | null + ): QueryWithHelpers; + replaceOne( + filter?: Query, + replacement?: DocType | AnyObject, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** + * Sets this query's `sanitizeProjection` option. With `sanitizeProjection()`, you can pass potentially untrusted user data to `.select()`. + */ + sanitizeProjection(value: boolean): this; + + /** + * Enable or disable schema level projections for this query. Enabled by default. + * Set to `false` to include fields with `select: false` in the query result by default. + */ + schemaLevelProjections(value: boolean): this; + + /** Specifies which document fields to include or exclude (also known as the query "projection") */ + select( + arg: string | readonly string[] | Record + ): QueryWithHelpers< + IfEquals< + RawDocTypeOverride, + {}, + ResultType, + ResultType extends any[] + ? ResultType extends HydratedDocument[] + ? HydratedDocument[] + : RawDocTypeOverride[] + : (ResultType extends HydratedDocument + ? HydratedDocument + : RawDocTypeOverride) | (null extends ResultType ? null : never) + >, + DocType, + THelpers, + IfEquals< + RawDocTypeOverride, + {}, + RawDocType, + RawDocTypeOverride + >, + QueryOp, + TDocOverrides + >; + + /** Determines if field selection has been made. */ + selected(): boolean; + + /** Determines if exclusive field selection has been made. */ + selectedExclusively(): boolean; + + /** Determines if inclusive field selection has been made. */ + selectedInclusively(): boolean; + + /** + * Sets the [MongoDB session](https://www.mongodb.com/docs/manual/reference/server-sessions/) + * associated with this query. Sessions are how you mark a query as part of a + * [transaction](/docs/transactions.html). + */ + session(session: mongodb.ClientSession | null): this; + + /** + * Adds a `$set` to this query's update without changing the operation. + * This is useful for query middleware so you can add an update regardless + * of whether you use `updateOne()`, `updateMany()`, `findOneAndUpdate()`, etc. + */ + set(path: string | Record, value?: any): this; + + /** Sets query options. Some options only make sense for certain operations. */ + setOptions(options: QueryOptions, overwrite?: boolean): this; + + /** Sets the query conditions to the provided JSON object. */ + setQuery(val: QueryFilter | null): void; + setQuery(val: Query | null): void; + + setUpdate(update: UpdateQuery | UpdateWithAggregationPipeline, cloneUpdate?: boolean): void; + + /** Specifies an `$size` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + size(path: string, val: number): this; + size(val: number): this; + + /** Specifies the number of documents to skip. */ + skip(val: number): this; + + /** Specifies a `$slice` projection for an array. */ + slice(path: string, val: number | Array): this; + slice(val: number | Array): this; + + /** Sets the sort order. If an object is passed, values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. */ + sort( + arg?: string | Record | [string, SortOrder][] | undefined | null, + options?: { override?: boolean } + ): this; + + /** Sets the tailable option (for use with capped collections). */ + tailable(bool?: boolean, opts?: { + numberOfRetries?: number; + tailableRetryInterval?: number; + }): this; + + /** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + */ + then: Promise['then']; + + /** Converts this query to a customized, reusable query constructor with all arguments and options retained. */ + toConstructor(): RetType; + + /** + * Declare and/or execute this query as an updateMany() operation. Same as + * `update()`, except MongoDB will update _all_ documents that match `filter` + */ + updateMany( + filter: QueryFilter, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: QueryOptions | null + ): QueryWithHelpers; + updateMany( + filter: Query, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** + * Declare and/or execute this query as an updateOne() operation. Same as + * `update()`, except it does not support the `multi` or `overwrite` options. + */ + updateOne( + filter: QueryFilter, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: QueryOptions | null + ): QueryWithHelpers; + updateOne( + filter: Query, + update: UpdateQuery | UpdateWithAggregationPipeline, + options?: QueryOptions | null + ): QueryWithHelpers; + + /** + * Sets the specified number of `mongod` servers, or tag set of `mongod` servers, + * that must acknowledge this write before this write is considered successful. + */ + w(val: string | number | null): this; + + /** Specifies a path for use with chaining. */ + where(path: string, val?: any): this; + where(obj: object): this; + where(): this; + + /** Defines a `$within` or `$geoWithin` argument for geo-spatial queries. */ + within(val?: any): this; + + /** + * If [`w > 1`](/docs/api/query.html#query_Query-w), the maximum amount of time to + * wait for this write to propagate through the replica set before this + * operation fails. The default is `0`, which means no timeout. + */ + wtimeout(ms: number): this; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schemaoptions.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schemaoptions.d.ts new file mode 100644 index 00000000..9d1db85b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schemaoptions.d.ts @@ -0,0 +1,290 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + interface SchemaTimestampsConfig { + createdAt?: boolean | string; + updatedAt?: boolean | string; + currentTime?: () => (NativeDate | number); + } + + type SchemaOptionsStaticsPropertyType = IfEquals< + TStaticMethods, + {}, + Record unknown> & ThisType, + { [K in keyof TStaticMethods]: OmitThisParameter } & ThisType + >; + + type TypeKeyBaseType = string; + + type DefaultTypeKey = 'type'; + interface SchemaOptions< + DocType = unknown, + TInstanceMethods = {}, + QueryHelpers = {}, + TStaticMethods = {}, + TVirtuals = {}, + THydratedDocumentType = HydratedDocument, + TModelType = Model + > { + /** + * By default, Mongoose's init() function creates all the indexes defined in your model's schema by + * calling Model.createIndexes() after you successfully connect to MongoDB. If you want to disable + * automatic index builds, you can set autoIndex to false. + */ + autoIndex?: boolean; + /** + * Similar to autoIndex, except for automatically creates any Atlas search indexes defined in your + * schema. Unlike autoIndex, this option defaults to false. + */ + autoSearchIndex?: boolean; + /** + * If set to `true`, Mongoose will call Model.createCollection() to create the underlying collection + * in MongoDB if autoCreate is set to true. Calling createCollection() sets the collection's default + * collation based on the collation option and establishes the collection as a capped collection if + * you set the capped schema option. + */ + autoCreate?: boolean; + /** + * By default, mongoose buffers commands when the connection goes down until the driver manages to reconnect. + * To disable buffering, set bufferCommands to false. + */ + bufferCommands?: boolean; + /** + * If bufferCommands is on, this option sets the maximum amount of time Mongoose buffering will wait before + * throwing an error. If not specified, Mongoose will use 10000 (10 seconds). + */ + bufferTimeoutMS?: number; + /** + * Mongoose supports MongoDBs capped collections. To specify the underlying MongoDB collection be capped, set + * the capped option to the maximum size of the collection in bytes. + */ + capped?: boolean | number | { size?: number; max?: number; autoIndexId?: boolean; }; + /** Sets a default collation for every query and aggregation. */ + collation?: mongodb.CollationOptions; + + /** Arbitrary options passed to `createCollection()` */ + collectionOptions?: mongodb.CreateCollectionOptions; + + /** Default lean options for queries */ + lean?: boolean | LeanOptions; + + /** The timeseries option to use when creating the model's collection. */ + timeseries?: mongodb.TimeSeriesCollectionOptions; + + /** The number of seconds after which a document in a timeseries collection expires. */ + expireAfterSeconds?: number; + + /** The time after which a document in a timeseries collection expires. */ + expires?: number | string; + + /** + * Mongoose by default produces a collection name by passing the model name to the utils.toCollectionName + * method. This method pluralizes the name. Set this option if you need a different name for your collection. + */ + collection?: string; + /** + * When you define a [discriminator](/docs/discriminators.html), Mongoose adds a path to your + * schema that stores which discriminator a document is an instance of. By default, Mongoose + * adds an `__t` path, but you can set `discriminatorKey` to overwrite this default. + * + * @default '__t' + */ + discriminatorKey?: string; + + /** + * Option for nested Schemas. + * + * If true, skip building indexes on this schema's path. + * + * @default false + */ + excludeIndexes?: boolean; + /** + * Mongoose assigns each of your schemas an id virtual getter by default which returns the document's _id field + * cast to a string, or in the case of ObjectIds, its hexString. + */ + id?: boolean; + /** + * Mongoose assigns each of your schemas an _id field by default if one is not passed into the Schema + * constructor. The type assigned is an ObjectId to coincide with MongoDB's default behavior. If you + * don't want an _id added to your schema at all, you may disable it using this option. + */ + _id?: boolean; + /** + * Mongoose will, by default, "minimize" schemas by removing empty objects. This behavior can be + * overridden by setting minimize option to false. It will then store empty objects. + */ + minimize?: boolean; + /** + * Optimistic concurrency is a strategy to ensure the document you're updating didn't change between when you + * loaded it using find() or findOne(), and when you update it using save(). Set to `true` to enable + * optimistic concurrency for all fields. Set to a string array to enable optimistic concurrency only for + * the specified fields; note that this **replaces** the default array versioning behavior. Set to + * `{ exclude: string[] }` to enable optimistic concurrency for all fields except the specified ones; + * this also **replaces** the default array versioning. + */ + optimisticConcurrency?: boolean | string[] | { exclude: string[] }; + /** + * If `plugin()` called with tags, Mongoose will only apply plugins to schemas that have + * a matching tag in `pluginTags` + */ + pluginTags?: string[]; + /** + * Allows setting query#read options at the schema level, providing us a way to apply default ReadPreferences + * to all queries derived from a model. + */ + read?: string; + /** + * Set a default readConcern for all queries at the schema level + */ + readConcern?: { level: 'local' | 'available' | 'majority' | 'snapshot' | 'linearizable' } + /** Allows setting write concern at the schema level. */ + writeConcern?: WriteConcern; + /** defaults to true. */ + safe?: boolean | { w?: number | string; wtimeout?: number; j?: boolean }; + /** + * The shardKey option is used when we have a sharded MongoDB architecture. Each sharded collection is + * given a shard key which must be present in all insert/update operations. We just need to set this + * schema option to the same shard key and we'll be all set. + */ + shardKey?: Record; + /** + * The strict option, (enabled by default), ensures that values passed to our model constructor that were not + * specified in our schema do not get saved to the db. + */ + strict?: boolean | 'throw'; + /** + * equal to `strict` by default, may be `false`, `true`, or `'throw'`. Sets the default + * [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery) mode for schemas. + */ + strictQuery?: boolean | 'throw'; + /** + * May be `false`, `true`, or `'throw'`. Sets the default + * [strictRead](https://mongoosejs.com/docs/guide.html#strictRead) mode for schemas. + */ + strictRead?: boolean | 'throw'; + /** Exactly the same as the toObject option but only applies when the document's toJSON method is called. */ + toJSON?: ToObjectOptions; + /** + * Documents have a toObject method which converts the mongoose document into a plain JavaScript object. + * This method accepts a few options. Instead of applying these options on a per-document basis, we may + * declare the options at the schema level and have them applied to all of the schema's documents by + * default. + */ + toObject?: ToObjectOptions; + /** + * By default, if you have an object with key 'type' in your schema, mongoose will interpret it as a + * type declaration. However, for applications like geoJSON, the 'type' property is important. If you want to + * control which key mongoose uses to find type declarations, set the 'typeKey' schema option. + */ + typeKey?: string; + + /** + * By default, documents are automatically validated before they are saved to the database. This is to + * prevent saving an invalid document. If you want to handle validation manually, and be able to save + * objects which don't pass validation, you can set validateBeforeSave to false. + */ + validateBeforeSave?: boolean; + /** + * By default, validation will run on modified and required paths before saving to the database. + * You can choose to have Mongoose only validate modified paths by setting validateModifiedOnly to true. + */ + validateModifiedOnly?: boolean; + /** + * The versionKey is a property set on each document when first created by Mongoose. This keys value + * contains the internal revision of the document. The versionKey option is a string that represents + * the path to use for versioning. The default is '__v'. + * + * @default '__v' + */ + versionKey?: string | false; + /** + * By default, Mongoose will automatically select() any populated paths for you, unless you explicitly exclude them. + * + * @default true + */ + selectPopulatedPaths?: boolean; + /** + * skipVersioning allows excluding paths from versioning (i.e., the internal revision will not be + * incremented even if these paths are updated). DO NOT do this unless you know what you're doing. + * For subdocuments, include this on the parent document using the fully qualified path. + */ + skipVersioning?: { [key: string]: boolean; }; + /** + * Validation errors in a single nested schema are reported + * both on the child and on the parent schema. + * Set storeSubdocValidationError to false on the child schema + * to make Mongoose only report the parent error. + */ + storeSubdocValidationError?: boolean; + /** + * The timestamps option tells mongoose to assign createdAt and updatedAt fields to your schema. The type + * assigned is Date. By default, the names of the fields are createdAt and updatedAt. Customize the + * field names by setting timestamps.createdAt and timestamps.updatedAt. + */ + timestamps?: boolean | SchemaTimestampsConfig; + + /** + * Using `save`, `isNew`, and other Mongoose reserved names as schema path names now triggers a warning, not an error. + * You can suppress the warning by setting { suppressReservedKeysWarning: true } schema options. Keep in mind that this + * can break plugins that rely on these reserved names. + */ + suppressReservedKeysWarning?: boolean, + + /** + * Model Statics methods. + */ + statics?: SchemaOptionsStaticsPropertyType + + /** + * Document instance methods. + */ + methods?: IfEquals< + TInstanceMethods, + {}, + Record unknown>, + AddThisParameter & AnyObject + > + + /** + * Query helper functions. + */ + query?: IfEquals< + QueryHelpers, + {}, + Record>(this: T, ...args: any) => T>, + QueryHelpers + > + + /** + * Set whether to cast non-array values to arrays. + * @default true + */ + castNonArrays?: boolean; + + /** + * Virtual paths. + */ + virtuals?: SchemaOptionsVirtualsPropertyType, + + /** + * Set to `true` to default to overwriting models with the same name when calling `mongoose.model()`, as opposed to throwing an `OverwriteModelError`. + * @default false + */ + overwriteModels?: boolean; + + /** + * Required when the schema is encrypted. + */ + encryptionType?: 'csfle' | 'queryableEncryption'; + } + + interface DefaultSchemaOptions { + typeKey: 'type'; + id: true; + _id: true; + discriminatorKey: '__t'; + timestamps: false; + versionKey: '__v' + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schematypes.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schematypes.d.ts new file mode 100644 index 00000000..ff48225b --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/schematypes.d.ts @@ -0,0 +1,667 @@ +import { BSON } from 'mongodb'; + +declare module 'mongoose' { + /** The Mongoose Date [SchemaType](/docs/schematypes.html). */ + type Date = Schema.Types.Date; + + /** + * The Mongoose Decimal128 [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [128-bit decimal floating points](http://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-decimal.html). + * Do not use this to create a new Decimal128 instance, use `mongoose.Types.Decimal128` + * instead. + */ + type Decimal128 = Schema.Types.Decimal128; + + /** + * The Mongoose Int32 [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * 32-bit integers + * Do not use this to create a new Int32 instance, use `mongoose.Types.Int32` + * instead. + */ + type Int32 = Schema.Types.Int32; + + /** + * The Mongoose Mixed [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose's change tracking, casting, + * and validation should ignore. + */ + type Mixed = Schema.Types.Mixed; + + /** + * The Mongoose Number [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose should cast to numbers. + */ + type Number = Schema.Types.Number; + + /** + * The Mongoose Double [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose should cast to doubles (IEEE 754-2008)/ + */ + type Double = Schema.Types.Double; + + /** + * The Mongoose ObjectId [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [MongoDB ObjectIds](https://www.mongodb.com/docs/manual/reference/method/ObjectId/). + * Do not use this to create a new ObjectId instance, use `mongoose.Types.ObjectId` + * instead. + */ + type ObjectId = Schema.Types.ObjectId; + + /** The various Mongoose SchemaTypes. */ + const SchemaTypes: typeof Schema.Types; + + type DefaultType = T extends Schema.Types.Mixed ? any : Partial>; + + class SchemaTypeOptions> { + type?: T extends string ? StringSchemaDefinition + : T extends number ? NumberSchemaDefinition + : T extends boolean ? BooleanSchemaDefinition + : T extends NativeDate ? DateSchemaDefinition + : T extends Map ? SchemaDefinition + : T extends Buffer ? SchemaDefinition + : T extends Types.ObjectId ? ObjectIdSchemaDefinition + : T extends Types.ObjectId[] ? + AnyArray | AnyArray> + : T extends object[] ? + | AnyArray> + | AnyArray, EnforcedDocType, THydratedDocumentType>> + | AnyArray, EnforcedDocType, THydratedDocumentType>> + : T extends string[] ? + AnyArray | AnyArray> + : T extends number[] ? + AnyArray | AnyArray> + : T extends boolean[] ? + AnyArray | AnyArray> + : T extends Function[] ? + AnyArray | AnyArray, EnforcedDocType, THydratedDocumentType>> + : T | typeof SchemaType | Schema | SchemaDefinition | Function | AnyArray; + + /** Defines a virtual with the given name that gets/sets this path. */ + alias?: string | string[]; + + /** Function or object describing how to validate this schematype. See [validation docs](https://mongoosejs.com/docs/validation.html). */ + validate?: SchemaValidator | AnyArray>; + + /** Allows overriding casting logic for this individual path. If a string, the given string overwrites Mongoose's default cast error message. */ + cast?: + | string + | boolean + | ((value: any) => T) + | [(value: any) => T, string] + | [((value: any) => T) | null, (value: any, path: string, model: Model, kind: string) => string]; + + /** + * If true, attach a required validator to this path, which ensures this path + * cannot be set to a nullish value. If a function, Mongoose calls the + * function and only checks for nullish values if the function returns a truthy value. + */ + required?: + | boolean + | ((this: THydratedDocumentType) => boolean) + | [boolean, string] + | [(this: THydratedDocumentType) => boolean, string]; + + /** + * Controls whether this path may be set to `null`. By default, Mongoose allows + * `null` for non-required paths. Set `allowNull: false` to allow `undefined` + * but disallow `null`. + */ + allowNull?: boolean; + + /** + * The default value for this path. If a function, Mongoose executes the function + * and uses the return value as the default. + */ + default?: DefaultType | ((this: THydratedDocumentType, doc: THydratedDocumentType) => DefaultType | null | undefined) | null | undefined; + + /** + * The model that `populate()` should use if populating this path. + */ + ref?: string | Model | ((this: any, doc: any) => string | Model); + + /** + * The path in the document that `populate()` should use to find the model + * to use. + */ + + refPath?: string | ((this: any, doc: any) => string); + + /** + * Whether to include or exclude this path by default when loading documents + * using `find()`, `findOne()`, etc. + */ + select?: boolean | number; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build an index on this path when the model is compiled. + */ + index?: boolean | IndexDirection | IndexOptions; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a unique index on this path when the + * model is compiled. [The `unique` option is **not** a validator](/docs/validation.html#the-unique-option-is-not-a-validator). + */ + unique?: boolean | number | [true, string]; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * disallow changes to this path once the document is saved to the database for the first time. Read more + * about [immutability in Mongoose here](http://thecodebarbarian.com/whats-new-in-mongoose-5-6-immutable-properties.html). + */ + immutable?: boolean | ((this: any, doc: any) => boolean); + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build a sparse index on this path. + */ + sparse?: boolean | number; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a text index on this path. + */ + text?: boolean | number | any; + + /** + * Define a transform function for this individual schema type. + * Only called when calling `toJSON()` or `toObject()`. + */ + transform?: (this: any, val: T) => any; + + /** defines a custom getter for this property using [`Object.defineProperty()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty). */ + get?: (value: any, doc?: this) => T | undefined; + + /** defines a custom setter for this property using [`Object.defineProperty()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty). */ + set?: (value: any, priorVal?: T, doc?: this) => any; + + /** array of allowed values for this path. Allowed for strings, numbers, and arrays of strings */ + enum?: + | Array + | ReadonlyArray + | { values: Array | ReadonlyArray; message?: string } + | { [path: string]: string | number | null }; + + /** The default [subtype](http://bsonspec.org/spec.html) associated with this buffer when it is stored in MongoDB. Only allowed for buffer paths */ + subtype?: number; + + /** The minimum value allowed for this path. Only allowed for numbers and dates. */ + min?: + | number + | NativeDate + | [number, string] + | [NativeDate, string] + | readonly [number, string] + | readonly [NativeDate, string]; + + /** The maximum value allowed for this path. Only allowed for numbers and dates. */ + max?: + | number + | NativeDate + | [number, string] + | [NativeDate, string] + | readonly [number, string] + | readonly [NativeDate, string]; + + /** Set to false to disable minimizing empty single nested subdocuments by default */ + minimize?: boolean; + + /** Defines a TTL index on this path. Only allowed for dates. */ + expires?: string | number; + + /** If `true`, Mongoose will skip gathering indexes on subpaths. Only allowed for subdocuments and subdocument arrays. */ + excludeIndexes?: boolean; + + /** If set, overrides the child schema's `_id` option. Only allowed for subdocuments and subdocument arrays. */ + _id?: boolean; + + /** Embedded discriminators for this path. Only allowed for subdocuments and subdocument arrays. */ + discriminators?: Record>; + + /** If set, specifies the type of this map's values. Mongoose will cast this map's values to the given type. */ + of?: Function | SchemaDefinitionProperty | (Function | SchemaDefinitionProperty)[]; + + /** If true, uses Mongoose's default `_id` settings. Only allowed for ObjectIds */ + auto?: boolean; + + /** Attaches a validator that succeeds if the data string matches the given regular expression, and fails otherwise. */ + match?: RegExp | [RegExp, string] | readonly [RegExp, string]; + + /** If truthy, Mongoose will add a [custom setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()) that lowercases this string using JavaScript's built-in `String#toLowerCase()`. */ + lowercase?: boolean; + + /** If truthy, Mongoose will add a [custom setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()) that removes leading and trailing whitespace using JavaScript's built-in `String#trim()`. */ + trim?: boolean; + + /** If truthy, Mongoose will add a [custom setter](https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.set()) that uppercases this string using JavaScript's built-in `String#toUpperCase()`. */ + uppercase?: boolean; + + /** If set, Mongoose will add a custom validator that ensures the given string's `length` is at least the given number. */ + minlength?: number | [number, string] | readonly [number, string]; + minLength?: number | [number, string] | readonly [number, string]; + + /** If set, Mongoose will add a custom validator that ensures the given string's `length` is at most the given number. */ + maxlength?: number | [number, string] | readonly [number, string]; + maxLength?: number | [number, string] | readonly [number, string]; + + [other: string]: any; + + /** + * If set, configures the field for automatic encryption. + */ + encrypt?: EncryptSchemaTypeOptions; + } + + interface Validator { + message?: string | ((props: ValidatorProps) => string); + type?: string; + validator?: ValidatorFunction; + reason?: Error; + } + + type ValidatorFunction = (this: DocType, value: any, validatorProperties?: Validator) => any; + + interface QueryEncryptionEncryptOptions { + /** The id of the dataKey to use for encryption. Must be a BSON binary subtype 4 (UUID). */ + keyId: BSON.Binary; + + /** + * Specifies the type of queries that the field can be queried on the encrypted field. + */ + queries?: 'equality' | 'range'; + } + + interface ClientSideEncryptionEncryptOptions { + /** The id of the dataKey to use for encryption. Must be a BSON binary subtype 4 (UUID). */ + keyId: [BSON.Binary]; + + /** + * The algorithm to use for encryption. + */ + algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'; + } + + export type EncryptSchemaTypeOptions = QueryEncryptionEncryptOptions | ClientSideEncryptionEncryptOptions; + + class SchemaType { + /** SchemaType constructor */ + constructor(path: string, options?: AnyObject, instance?: string); + + /** Get/set the function used to cast arbitrary values to this type. */ + static cast(caster?: Function | boolean): Function; + + static checkRequired(checkRequired?: (v: any) => boolean): (v: any) => boolean; + + /** Sets a default option for this schema type. */ + static set(option: string, value: any): void; + + /** Attaches a getter for all instances of this schema type. */ + static get(getter: (value: any) => any): void; + + /** Array containing default setters for all instances of this SchemaType */ + static setters: (( + val?: unknown, + priorVal?: unknown, + doc?: Document, + options?: Record | null + ) => unknown)[]; + + /** Contains the handlers for different query operators for this schema type. */ + $conditionalHandlers: { [op: string]: (val: any, context: any) => any }; + + /** The class that Mongoose uses internally to instantiate this SchemaType's `options` property. */ + OptionsConstructor: SchemaTypeOptions; + + /** Cast `val` to this schema type. Each class that inherits from schema type should implement this function. */ + cast(val: any, doc?: Document, init?: boolean, prev?: any, options?: any): any; + cast(val: any, doc?: Document, init?: boolean, prev?: any, options?: any): ResultType; + + /** Sets a default value for this SchemaType. */ + default(val: any): any; + + /** Adds a getter to this schematype. */ + get(fn: Function): this; + + /** Gets this SchemaType's embedded SchemaType, if any */ + getEmbeddedSchemaType(): SchemaType | undefined; + + /** + * Defines this path as immutable. Mongoose prevents you from changing + * immutable paths unless the parent document has [`isNew: true`](/docs/api/document.html#document_Document-isNew). + */ + immutable(bool: boolean): this; + + /** Declares the index options for this schematype. */ + index(options: any): this; + + /** String representation of what type this is, like 'ObjectID' or 'Number' */ + instance: string; + + /** True if this SchemaType has a required validator. False otherwise. */ + isRequired?: boolean; + + /** The options this SchemaType was instantiated with */ + options: AnyObject; + + /** The path to this SchemaType in a Schema. */ + path: string; + + /** + * Set the model that this path refers to. This is the option that [populate](https://mongoosejs.com/docs/populate.html) + * looks at to determine the foreign collection it should query. + */ + ref(ref: string | boolean | Model): this; + + /** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using unshift(). + */ + required(required: boolean, message?: string): this; + + /** Adds or removes a validator that disallows `null` without making this path required. */ + allowNull(allowNull: boolean): this; + + /** If the SchemaType is a subdocument or document array, this is the schema of that subdocument */ + schema?: Schema; + + /** Sets default select() behavior for this path. */ + select(val: boolean): this; + + /** Adds a setter to this schematype. */ + set(fn: Function): this; + + /** Declares a sparse index. */ + sparse(bool: boolean): this; + + /** Declares a full text index. */ + text(bool: boolean): this; + + toJSONSchema(options?: { useBsonType?: boolean }): Record; + + /** Defines a custom function for transforming this path when converting a document to JSON. */ + transform(fn: (value: any) => any): this; + + /** Declares an unique index. */ + unique(bool: boolean): this; + + /** The validators that Mongoose should run to validate properties at this SchemaType's path. */ + validators: Validator[]; + + /** Adds validator(s) for this document path. */ + validate(obj: RegExp | ValidatorFunction | Validator, errorMsg?: string, type?: string): this; + + /** Adds multiple validators for this document path. */ + validateAll(validators: Array | Validator>): this; + + /** Default options for this SchemaType */ + static defaultOptions?: Record; + } + + namespace Schema { + namespace Types { + class Array extends SchemaType implements AcceptsDiscriminator { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Array'; + readonly schemaName: 'Array'; + + static options: { castNonArrays: boolean }; + + discriminator(name: string | number, schema: Schema, value?: string): U; + discriminator(name: string | number, schema: Schema, value?: string): Model; + + /** The schematype embedded in this array */ + embeddedSchemaType: SchemaType; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + + /** + * Adds an enum validator if this is an array of strings or numbers. Equivalent to + * `SchemaString.prototype.enum()` or `SchemaNumber.prototype.enum()` + */ + enum(vals: string[] | number[]): this; + } + + class BigInt extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'BigInt'; + readonly schemaName: 'BigInt'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Boolean extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Boolean'; + readonly schemaName: 'Boolean'; + + /** Configure which values get casted to `true`. */ + static convertToTrue: Set; + + /** Configure which values get casted to `false`. */ + static convertToFalse: Set; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Buffer extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Buffer'; + readonly schemaName: 'Buffer'; + + /** + * Sets the default [subtype](https://studio3t.com/whats-new/best-practices-uuid-mongodb/) + * for this buffer. You can find a [list of allowed subtypes here](http://api.mongodb.com/python/current/api/bson/binary.html). + */ + subtype(subtype: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 128): this; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Date extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Date'; + readonly schemaName: 'Date'; + + /** Declares a TTL index (rounded to the nearest second) for _Date_ types only. */ + expires(when: number | string): this; + + /** Sets a maximum date validator. */ + max(value: NativeDate, message?: string): this; + + /** Sets a minimum date validator. */ + min(value: NativeDate, message?: string): this; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Decimal128 extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Decimal128'; + readonly schemaName: 'Decimal128'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Int32 extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Int32'; + readonly schemaName: 'Int32'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class DocumentArray extends SchemaType implements AcceptsDiscriminator { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'DocumentArray'; + readonly schemaName: 'DocumentArray'; + + static options: { castNonArrays: boolean }; + + schemaOptions?: SchemaOptions; + + discriminator(name: string | number, schema: Schema, value?: string): Model; + discriminator(name: string | number, schema: Schema, value?: string): U; + + /** The schema used for documents in this array */ + schema: Schema; + + /** The schematype embedded in this array */ + embeddedSchemaType: Subdocument; + + /** The constructor used for subdocuments in this array */ + Constructor: typeof Types.Subdocument; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class DocumentArrayElement extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'DocumentArrayElement'; + readonly schemaName: 'DocumentArrayElement'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Map extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Map'; + readonly schemaName: 'Map'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Mixed extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Mixed'; + readonly schemaName: 'Mixed'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Number extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Number'; + readonly schemaName: 'Number'; + + /** Sets a enum validator */ + enum(vals: number[]): this; + + /** Sets a maximum number validator. */ + max(value: number, message?: string): this; + + /** Sets a minimum number validator. */ + min(value: number, message?: string): this; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Double extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Double'; + readonly schemaName: 'Double'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class ObjectId extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'ObjectId'; + readonly schemaName: 'ObjectId'; + + /** Adds an auto-generated ObjectId default if turnOn is true. */ + auto(turnOn: boolean): this; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Subdocument extends SchemaType implements AcceptsDiscriminator { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + + /** The document's schema */ + schema: Schema; + + /** The constructor used to create subdocuments based on this schematype */ + Constructor: typeof Types.Subdocument; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + + discriminator(name: string | number, schema: Schema, value?: string): U; + discriminator(name: string | number, schema: Schema, value?: string): Model; + + cast( + val: any, + doc?: Document, + init?: boolean, + prev?: any, + options?: any + ): HydratedSingleSubdocument; + } + + class String extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'String'; + readonly schemaName: 'String'; + + /** Adds an enum validator */ + enum(vals: string[] | any): this; + + /** Adds a lowercase [setter](http://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-set). */ + lowercase(shouldApply?: boolean): this; + + /** Sets a regexp validator. */ + match(value: RegExp, message: string): this; + + /** Sets a maximum length validator. */ + maxlength(value: number, message: string): this; + + /** Sets a minimum length validator. */ + minlength(value: number, message: string): this; + + /** Adds a trim [setter](http://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-set). */ + trim(shouldTrim?: boolean): this; + + /** Adds an uppercase [setter](http://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-set). */ + uppercase(shouldApply?: boolean): this; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class Union extends SchemaType { + static schemaName: 'Union'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + + class UUID extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'UUID'; + readonly schemaName: 'UUID'; + + /** Default options for this SchemaType */ + static defaultOptions: Record; + } + } + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/session.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/session.d.ts new file mode 100644 index 00000000..e7f41f73 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/session.d.ts @@ -0,0 +1,32 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + type ClientSessionOptions = mongodb.ClientSessionOptions; + type ClientSession = mongodb.ClientSession; + + /** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://www.mongodb.com/docs/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://www.mongodb.com/docs/manual/core/retryable-writes/), + * and [transactions](http://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + */ + function startSession(options?: ClientSessionOptions): Promise; + + interface SessionOperation { + /** Sets the session. Useful for [transactions](/docs/transactions.html). */ + session(session: mongodb.ClientSession | null): this; + } + + interface SessionStarter { + + /** + * Starts a [MongoDB session](https://www.mongodb.com/docs/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://www.mongodb.com/docs/manual/core/retryable-writes/), + * and [transactions](http://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + */ + startSession(options?: ClientSessionOptions): Promise; + } + + interface SessionOption { + session?: ClientSession | null; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/tracing.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/tracing.d.ts new file mode 100644 index 00000000..9a12cb20 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/tracing.d.ts @@ -0,0 +1,10 @@ +declare module 'mongoose' { + interface TracingContext { + operation: string; + collection: string; + database: string; + serverAddress: string; + serverPort: number; + args: Record; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/types.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/types.d.ts new file mode 100644 index 00000000..2a15ab99 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/types.d.ts @@ -0,0 +1,109 @@ + +declare module 'mongoose' { + import mongodb = require('mongodb'); + + class NativeBuffer extends Buffer {} + + namespace Types { + class Array extends global.Array { + /** Pops the array atomically at most one time per document `save()`. */ + $pop(): T; + + /** Atomically shifts the array at most one time per document `save()`. */ + $shift(): T; + + /** Adds values to the array if not already present. */ + addToSet(...args: any[]): any[]; + + isMongooseArray: true; + + /** Pushes items to the array non-atomically. */ + nonAtomicPush(...args: any[]): number; + + /** Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. */ + push(...args: any[]): number; + + /** + * Pulls items from the array atomically. Equality is determined by casting + * the provided value to an embedded document and comparing using + * [the `Document.equals()` function.](./api/document.html#document_Document-equals) + */ + pull(...args: any[]): this; + + /** + * Alias of [pull](#mongoosearray_MongooseArray-pull) + */ + remove(...args: any[]): this; + + /** Sets the casted `val` at index `i` and marks the array modified. */ + set(index: number, val: T): this; + + /** Atomically shifts the array at most one time per document `save()`. */ + shift(): T; + + /** Returns a native js Array. */ + toObject(options?: ToObjectOptions): any; + toObject(options?: ToObjectOptions): T; + + /** Wraps [`Array#unshift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. */ + unshift(...args: any[]): number; + } + + class Buffer extends NativeBuffer { + /** Sets the subtype option and marks the buffer modified. */ + subtype(subtype: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 128 | ToObjectOptions): void; + + /** Converts this buffer to its Binary type representation. */ + toObject(subtype?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 128): mongodb.Binary; + } + + class Decimal128 extends mongodb.Decimal128 { } + + class DocumentArray = Types.Subdocument, unknown, T> & T> extends Types.Array { + /** DocumentArray constructor */ + constructor(values: AnyObject[]); + + isMongooseDocumentArray: true; + + /** Creates a subdocument casted to this schema. */ + create(obj: any): THydratedDocumentType; + + /** Searches array items for the first document with a matching _id. */ + id(id: ObjectId | string | number | Buffer): THydratedDocumentType | null; + + push(...args: (AnyKeys & AnyObject)[]): number; + + splice(start: number, deleteCount?: number, ...args: (AnyKeys & AnyObject)[]): THydratedDocumentType[]; + } + + class Map extends global.Map { + /** Converts a Mongoose map into a vanilla JavaScript map. */ + toObject(options?: ToObjectOptions & { flattenMaps?: boolean }): any; + } + + class ObjectId extends mongodb.ObjectId { + } + + class Subdocument extends Document { + $isSingleNested: true; + + /** Returns the top level document of this sub-document. */ + ownerDocument(): Document; + + /** Returns this sub-documents parent document. */ + parent(): Document; + + /** Returns this sub-documents parent document. */ + $parent(): Document; + } + + class ArraySubdocument extends Subdocument { + /** Returns this sub-documents parent array. */ + parentArray(): Types.DocumentArray; + } + + class UUID extends mongodb.UUID {} + + class Double extends mongodb.Double {} + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/utility.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/utility.d.ts new file mode 100644 index 00000000..5dfef185 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/utility.d.ts @@ -0,0 +1,224 @@ +declare module 'mongoose' { + type IsNonDefiningProjection = Value extends { $slice: any } | { $meta: any } + ? true + : Key extends '_id' + ? Value extends 0 | false + ? false + // Including `_id` only defines inclusion when it is the sole projected field. + : Exclude extends never ? false : true + : false; + type ProjectionPath = Key extends `${infer Parent}.$` ? Parent : Key; + type DefiningProjectionKeys = { + [Key in keyof Projection]-?: Key extends string + ? IsNonDefiningProjection extends true ? never : ProjectionPath + : never + }[keyof Projection]; + type DefiningProjectionValues = { + [Key in keyof Projection]-?: IsNonDefiningProjection extends true ? never : Projection[Key] + }[keyof Projection]; + + export type ApplyProjection = Projection extends string + ? T + : Projection extends AnyObject + ? [DefiningProjectionKeys] extends [never] + ? T + : Exclude, 0 | false | undefined> extends never + ? Omit, keyof T>> + : Pick, keyof T>> & + (Projection extends { _id?: infer Id } + ? Id extends 0 | false + ? unknown + : Pick> + : Pick>) + : T; + + export type ProjectedHydratedDocument = + Projection extends { _id?: infer Id } + ? Id extends 0 | false + ? Omit, TInstanceMethods, TQueryHelpers, TVirtuals>, '_id'> + : HydratedDocument, TInstanceMethods, TQueryHelpers, TVirtuals> + : HydratedDocument, TInstanceMethods, TQueryHelpers, TVirtuals>; + + type IfAny = 0 extends 1 & IFTYPE + ? THENTYPE + : ELSETYPE; + type IsUnknown = unknown extends T ? true : false; + + type IsNotNever = [T] extends [never] ? false : true; + type IsAny = 0 extends 1 & T ? true : false; + + type WithLevel1NestedPaths = IsItRecordAndNotAny extends true ? { + [P in K | NestedPaths, K>]: P extends K + // Handle top-level paths + // First, drill into documents so we don't end up surfacing `$assertPopulated`, etc. + ? Extract, Document> extends never + // If not a document, then return the type. Otherwise, get the DocType. + ? NonNullable + : Extract, Document> extends Document + ? DocType | Exclude, Document> + : never + // Handle nested paths + : P extends `${infer Key}.${infer Rest}` + ? Key extends keyof T + ? NonNullable extends (infer U)[] + ? NonNullable extends Types.DocumentArray + ? Rest extends keyof NonNullable + ? NonNullable[Rest] + : never + : Rest extends keyof NonNullable + ? NonNullable[Rest] + : never + : Rest extends keyof NonNullable + ? NonNullable[Rest] + : never + : never + : never; + } : T; + + type HasStringIndex = + string extends Extract ? true : false; + + type SafeObjectKeys = + HasStringIndex extends true ? never : Extract; + + type NestedPaths = + K extends string + ? T[K] extends TreatAsPrimitives + ? never + : Extract, Document> extends never + ? NonNullable extends Array + ? NonNullable extends Types.DocumentArray + ? SafeObjectKeys> extends never + ? never + : `${K}.${SafeObjectKeys>}` + : NonNullable extends Record + ? SafeObjectKeys> extends never + ? never + : `${K}.${SafeObjectKeys>}` + : never + : NonNullable extends object + ? SafeObjectKeys> extends never + ? never + : `${K}.${SafeObjectKeys>}` + : never + : Extract, Document> extends Document + ? DocType extends object + ? SafeObjectKeys> extends never + ? never + : `${K}.${SafeObjectKeys>}` + : never + : never + : never; + + type WithoutUndefined = T extends undefined ? never : T; + + /** + * @summary Removes keys from a type + * @description It helps to exclude keys from a type + * @param {T} T A generic type to be checked. + * @param {K} K Keys from T that are to be excluded from the generic type + * @returns T with the keys in K excluded + */ + type ExcludeKeys = { + [P in keyof T as P extends K ? never : P]: T[P]; + }; + + type Unpacked = T extends (infer U)[] + ? U + : T extends ReadonlyArray + ? U + : T; + + type DeepPartial = + T extends TreatAsPrimitives ? T : + T extends Array ? DeepPartial[] : + T extends Record ? { [K in keyof T]?: DeepPartial } : + T; + + type UnpackedIntersection = T extends null + ? null + : T extends (infer A)[] + ? (A extends any ? (Omit & U) : never)[] + : keyof U extends never + ? T + : T extends any ? (Omit & U) : never; + + type MergeType = A extends unknown ? Omit & B : never; + + /** + * @summary Converts Unions to one record "object". + * @description It makes intellisense dialog box easier to read as a single object instead of showing that in multiple object unions. + * @param {T} T The type to be converted. + */ + type FlatRecord = { [K in keyof T]: T[K] }; + + /** Force an operation like `{ a: 0 } & { b: 1 }` to be computed so that it displays `{ a: 0; b: 1 }`. */ + export type Show = { [k in keyof t]: t[k] } & unknown; + + /** + * @summary Checks if a type is "Record" or "any". + * @description It Helps to check if user has provided schema type "EnforcedDocType" + * @param {T} T A generic type to be checked. + * @returns true if {@link T} is Record OR false if {@link T} is of any type. + */ + type IsItRecordAndNotAny = IfEquals< + T, + any, + false, + T extends Record ? true : false + >; + + /** + * @summary Checks if two types are identical. + * @param {T} T The first type to be compared with {@link U}. + * @param {U} U The second type to be compared with {@link T}. + * @param {Y} Y A type to be returned if {@link T} & {@link U} are identical. + * @param {N} N A type to be returned if {@link T} & {@link U} are not identical. + */ + type IfEquals = (() => G extends T + ? 1 + : 0) extends () => G extends U ? 1 : 0 + ? Y + : N; + + /** + * @summary Extracts 'this' parameter from a function, if it exists. Otherwise, returns fallback. + * @param {T} T Function type to extract 'this' parameter from. + * @param {F} F Fallback type to return if 'this' parameter does not exist. + */ + type ThisParameter = T extends { (this: infer This, ...args: never): void } ? This : F; + + /** + * @summary Decorates all functions in an object with 'this' parameter. + * @param {T} T Object with functions as values to add 'D' parameter to as 'this'. {@link D} + * @param {D} D The type to be added as 'this' parameter to all functions in {@link T}. + */ + type AddThisParameter = { + [K in keyof T]: T[K] extends (...args: infer A) => infer R + ? IsUnknown> extends true + ? (this: D, ...args: A) => R + : T[K] + : T[K]; + }; + + type OmitThisParameterIfFunction = T extends (...args: any[]) => any ? OmitThisParameter : T; + + // Strip explicit `this` parameter from methods in schema type options. The `this` parameter + // is just for type-checking the function body. Keeping the explicit 'this' typing can cause + // compiler errors on the method calls, so remove it for the hydrated document definition. + type HydratedDocumentOverrides = { + [K in keyof T]: OmitThisParameterIfFunction; + }; + + /** + * @summary Adds timestamp fields to a type + * @description Adds createdAt and updatedAt fields of type Date, or custom timestamp fields if specified + * @param {T} T The type to add timestamp fields to + * @param {P} P Optional SchemaTimestampsConfig or boolean to customize timestamp field names + * @returns T with timestamp fields added + */ + export type WithTimestamps< + T, + P extends SchemaTimestampsConfig | boolean = true + > = ResolveTimestamps; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/validation.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/validation.d.ts new file mode 100644 index 00000000..1300afa7 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/validation.d.ts @@ -0,0 +1,39 @@ +declare module 'mongoose' { + type SchemaValidator = RegExp | + [RegExp, string] | + Function | + [Function, string] | + ValidateOpts | + ValidateOpts[]; + + interface ValidatorProps { + path: string; + fullPath: string; + value: any; + reason?: Error; + } + + interface ValidatorMessageFn { + (props: ValidatorProps): string; + } + + type ValidateFn = ( + this: THydratedDocumentType | Query, + value: any, + props?: ValidatorProps & Record + ) => boolean; + + type AsyncValidateFn = ( + this: THydratedDocumentType | Query, + value: any, + props?: ValidatorProps & Record + ) => Promise; + + interface ValidateOpts { + msg?: string; + message?: string | ValidatorMessageFn; + type?: string; + validator: ValidateFn | AsyncValidateFn; + propsParameter?: boolean; + } +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/virtuals.d.ts b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/virtuals.d.ts new file mode 100644 index 00000000..de008309 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mongoose/types/virtuals.d.ts @@ -0,0 +1,14 @@ +declare module 'mongoose' { + type VirtualPathFunctions = { + get?: TVirtualPathFN; + set?: TVirtualPathFN; + options?: VirtualTypeOptions; + }; + + type TVirtualPathFN = + (value: PathType, virtual: VirtualType, doc: THydratedDocumentType) => TReturn; + + type SchemaOptionsVirtualsPropertyType, THydratedDocumentType = any> = { + [K in keyof VirtualPaths]: VirtualPathFunctions + } & ThisType; +} diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mpath b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mpath new file mode 120000 index 00000000..f146b69a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mpath @@ -0,0 +1 @@ +../../mpath@0.9.0/node_modules/mpath \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mquery b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mquery new file mode 120000 index 00000000..20c4756f --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/mquery @@ -0,0 +1 @@ +../../mquery@6.0.0/node_modules/mquery \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/ms b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/ms new file mode 120000 index 00000000..e1d50296 --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/ms @@ -0,0 +1 @@ +../../ms@2.1.3/node_modules/ms \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/sift b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/sift new file mode 120000 index 00000000..1fe0be1a --- /dev/null +++ b/backend/node_modules/.pnpm/mongoose@9.10.2/node_modules/sift @@ -0,0 +1 @@ +../../sift@17.1.3/node_modules/sift \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/.travis.yml b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/.travis.yml new file mode 100644 index 00000000..9bdf212d --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "4" + - "5" + - "6" + - "7" + - "8" + - "9" + - "10" diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/History.md b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/History.md new file mode 100644 index 00000000..5235d689 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/History.md @@ -0,0 +1,88 @@ +0.9.0 / 2022-04-17 +================== + * feat: export `stringToParts()` + +0.8.4 / 2021-09-01 +================== + * fix: throw error if `parts` contains an element that isn't a string or number #13 + +0.8.3 / 2020-12-30 +================== + * fix: use var instead of let/const for Node.js 4.x support + +0.8.2 / 2020-12-30 +================== + * fix(stringToParts): fall back to legacy treatment for square brackets if square brackets contents aren't a number Automattic/mongoose#9640 + * chore: add eslint + +0.8.1 / 2020-12-10 +================== + * fix(stringToParts): handle empty string and trailing dot the same way that `split()` does for backwards compat + +0.8.0 / 2020-11-14 +================== + * feat: support square bracket indexing for `get()`, `set()`, `has()`, and `unset()` + +0.7.0 / 2020-03-24 +================== + * BREAKING CHANGE: remove `component.json` #9 [AlexeyGrigorievBoost](https://github.com/AlexeyGrigorievBoost) + +0.6.0 / 2019-05-01 +================== + * feat: support setting dotted paths within nested arrays + +0.5.2 / 2019-04-25 +================== + * fix: avoid using subclassed array constructor when doing `map()` + +0.5.1 / 2018-08-30 +================== + * fix: prevent writing to constructor and prototype as well as __proto__ + +0.5.0 / 2018-08-30 +================== + * BREAKING CHANGE: disallow setting/unsetting __proto__ properties + * feat: re-add support for Node < 4 for this release + +0.4.1 / 2018-04-08 +================== + * fix: allow opting out of weird `$` set behavior re: Automattic/mongoose#6273 + +0.4.0 / 2018-03-27 +================== + * feat: add support for ES6 maps + * BREAKING CHANGE: drop support for Node < 4 + +0.3.0 / 2017-06-05 +================== + * feat: add has() and unset() functions + +0.2.1 / 2013-03-22 +================== + + * test; added for #5 + * fix typo that breaks set #5 [Contra](https://github.com/Contra) + +0.2.0 / 2013-03-15 +================== + + * added; adapter support for set + * added; adapter support for get + * add basic benchmarks + * add support for using module as a component #2 [Contra](https://github.com/Contra) + +0.1.1 / 2012-12-21 +================== + + * added; map support + +0.1.0 / 2012-12-13 +================== + + * added; set('array.property', val, object) support + * added; get('array.property', object) support + +0.0.1 / 2012-11-03 +================== + + * initial release diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/LICENSE b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/LICENSE new file mode 100644 index 00000000..38c529da --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/README.md b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/README.md new file mode 100644 index 00000000..9831dd06 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/README.md @@ -0,0 +1,278 @@ +#mpath + +{G,S}et javascript object values using MongoDB-like path notation. + +###Getting + +```js +var mpath = require('mpath'); + +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.get('comments.1.title', obj) // 'exciting!' +``` + +`mpath.get` supports array property notation as well. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.get('comments.title', obj) // ['funny', 'exciting!'] +``` + +Array property and indexing syntax, when used together, are very powerful. + +```js +var obj = { + array: [ + { o: { array: [{x: {b: [4,6,8]}}, { y: 10} ] }} + , { o: { array: [{x: {b: [1,2,3]}}, { x: {z: 10 }}, { x: 'Turkey Day' }] }} + , { o: { array: [{x: {b: null }}, { x: { b: [null, 1]}}] }} + , { o: { array: [{x: null }] }} + , { o: { array: [{y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ]; +} + +var found = mpath.get('array.o.array.x.b.1', obj); + +console.log(found); // prints.. + + [ [6, undefined] + , [2, undefined, undefined] + , [null, 1] + , [null] + , [undefined] + , [undefined, undefined, undefined] + , undefined + ] + +``` + +#####Field selection rules: + +The following rules are iteratively applied to each `segment` in the passed `path`. For example: + +```js +var path = 'one.two.14'; // path +'one' // segment 0 +'two' // segment 1 +14 // segment 2 +``` + +- 1) when value of the segment parent is not an array, return the value of `parent.segment` +- 2) when value of the segment parent is an array + - a) if the segment is an integer, replace the parent array with the value at `parent[segment]` + - b) if not an integer, keep the array but replace each array `item` with the value returned from calling `get(remainingSegments, item)` or undefined if falsey. + +#####Maps + +`mpath.get` also accepts an optional `map` argument which receives each individual found value. The value returned from the `map` function will be used in the original found values place. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.get('comments.title', obj, function (val) { + return 'funny' == val + ? 'amusing' + : val; +}); +// ['amusing', 'exciting!'] +``` + +###Setting + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.1.title', 'hilarious', obj) +console.log(obj.comments[1].title) // 'hilarious' +``` + +`mpath.set` supports the same array property notation as `mpath.get`. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.title', ['hilarious', 'fruity'], obj); + +console.log(obj); // prints.. + + { comments: [ + { title: 'hilarious' }, + { title: 'fruity' } + ]} +``` + +Array property and indexing syntax can be used together also when setting. + +```js +var obj = { + array: [ + { o: { array: [{x: {b: [4,6,8]}}, { y: 10} ] }} + , { o: { array: [{x: {b: [1,2,3]}}, { x: {z: 10 }}, { x: 'Turkey Day' }] }} + , { o: { array: [{x: {b: null }}, { x: { b: [null, 1]}}] }} + , { o: { array: [{x: null }] }} + , { o: { array: [{y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ] +} + +mpath.set('array.1.o', 'this was changed', obj); + +console.log(require('util').inspect(obj, false, 1000)); // prints.. + +{ + array: [ + { o: { array: [{x: {b: [4,6,8]}}, { y: 10} ] }} + , { o: 'this was changed' } + , { o: { array: [{x: {b: null }}, { x: { b: [null, 1]}}] }} + , { o: { array: [{x: null }] }} + , { o: { array: [{y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ]; +} + +mpath.set('array.o.array.x', 'this was changed too', obj); + +console.log(require('util').inspect(obj, false, 1000)); // prints.. + +{ + array: [ + { o: { array: [{x: 'this was changed too'}, { y: 10, x: 'this was changed too'} ] }} + , { o: 'this was changed' } + , { o: { array: [{x: 'this was changed too'}, { x: 'this was changed too'}] }} + , { o: { array: [{x: 'this was changed too'}] }} + , { o: { array: [{x: 'this was changed too', y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ]; +} +``` + +####Setting arrays + +By default, setting a property within an array to another array results in each element of the new array being set to the item in the destination array at the matching index. An example is helpful. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.title', ['hilarious', 'fruity'], obj); + +console.log(obj); // prints.. + + { comments: [ + { title: 'hilarious' }, + { title: 'fruity' } + ]} +``` + +If we do not desire this destructuring-like assignment behavior we may instead specify the `$` operator in the path being set to force the array to be copied directly. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.$.title', ['hilarious', 'fruity'], obj); + +console.log(obj); // prints.. + + { comments: [ + { title: ['hilarious', 'fruity'] }, + { title: ['hilarious', 'fruity'] } + ]} +``` + +####Field assignment rules + +The rules utilized mirror those used on `mpath.get`, meaning we can take values returned from `mpath.get`, update them, and reassign them using `mpath.set`. Note that setting nested arrays of arrays can get unweildy quickly. Check out the [tests](https://github.com/aheckmann/mpath/blob/master/test/index.js) for more extreme examples. + +#####Maps + +`mpath.set` also accepts an optional `map` argument which receives each individual value being set. The value returned from the `map` function will be used in the original values place. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.title', ['hilarious', 'fruity'], obj, function (val) { + return val.length; +}); + +console.log(obj); // prints.. + + { comments: [ + { title: 9 }, + { title: 6 } + ]} +``` + +### Custom object types + +Sometimes you may want to enact the same functionality on custom object types that store all their real data internally, say for an ODM type object. No fear, `mpath` has you covered. Simply pass the name of the property being used to store the internal data and it will be traversed instead: + +```js +var mpath = require('mpath'); + +var obj = { + comments: [ + { title: 'exciting!', _doc: { title: 'great!' }} + ] +} + +mpath.get('comments.0.title', obj, '_doc') // 'great!' +mpath.set('comments.0.title', 'nov 3rd', obj, '_doc') +mpath.get('comments.0.title', obj, '_doc') // 'nov 3rd' +mpath.get('comments.0.title', obj) // 'exciting' +``` + +When used with a `map`, the `map` argument comes last. + +```js +mpath.get(path, obj, '_doc', map); +mpath.set(path, val, obj, '_doc', map); +``` + +[LICENSE](https://github.com/aheckmann/mpath/blob/master/LICENSE) + diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/SECURITY.md b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/SECURITY.md new file mode 100644 index 00000000..1c916a34 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/SECURITY.md @@ -0,0 +1,5 @@ +# Reporting a Vulnerability + +Please report suspected security vulnerabilities to val [at] karpov [dot] io. +You will receive a response from us within 72 hours. +If the issue is confirmed, we will release a patch as soon as possible depending on complexity. diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/index.js b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/index.js new file mode 100644 index 00000000..47c17cdc --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = exports = require('./lib'); diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/index.js b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/index.js new file mode 100644 index 00000000..3f21cdc8 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/index.js @@ -0,0 +1,336 @@ +/* eslint strict:off */ +/* eslint no-var: off */ +/* eslint no-redeclare: off */ + +var stringToParts = require('./stringToParts'); + +// These properties are special and can open client libraries to security +// issues +var ignoreProperties = ['__proto__', 'constructor', 'prototype']; + +/** + * Returns the value of object `o` at the given `path`. + * + * ####Example: + * + * var obj = { + * comments: [ + * { title: 'exciting!', _doc: { title: 'great!' }} + * , { title: 'number dos' } + * ] + * } + * + * mpath.get('comments.0.title', o) // 'exciting!' + * mpath.get('comments.0.title', o, '_doc') // 'great!' + * mpath.get('comments.title', o) // ['exciting!', 'number dos'] + * + * // summary + * mpath.get(path, o) + * mpath.get(path, o, special) + * mpath.get(path, o, map) + * mpath.get(path, o, special, map) + * + * @param {String} path + * @param {Object} o + * @param {String} [special] When this property name is present on any object in the path, walking will continue on the value of this property. + * @param {Function} [map] Optional function which receives each individual found value. The value returned from `map` is used in the original values place. + */ + +exports.get = function(path, o, special, map) { + var lookup; + + if ('function' == typeof special) { + if (special.length < 2) { + map = special; + special = undefined; + } else { + lookup = special; + special = undefined; + } + } + + map || (map = K); + + var parts = 'string' == typeof path + ? stringToParts(path) + : path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + var obj = o, + part; + + for (var i = 0; i < parts.length; ++i) { + part = parts[i]; + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `get()` must be a string or number, got ' + typeof parts[i]); + } + + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + // reading a property from the array items + var paths = parts.slice(i); + + // Need to `concat()` to avoid `map()` calling a constructor of an array + // subclass + return [].concat(obj).map(function(item) { + return item + ? exports.get(paths, item, special || lookup, map) + : map(undefined); + }); + } + + if (lookup) { + obj = lookup(obj, part); + } else { + var _from = special && obj[special] ? obj[special] : obj; + obj = _from instanceof Map ? + _from.get(part) : + _from[part]; + } + + if (!obj) return map(obj); + } + + return map(obj); +}; + +/** + * Returns true if `in` returns true for every piece of the path + * + * @param {String} path + * @param {Object} o + */ + +exports.has = function(path, o) { + var parts = typeof path === 'string' ? + stringToParts(path) : + path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + var len = parts.length; + var cur = o; + for (var i = 0; i < len; ++i) { + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `has()` must be a string or number, got ' + typeof parts[i]); + } + if (cur == null || typeof cur !== 'object' || !(parts[i] in cur)) { + return false; + } + cur = cur[parts[i]]; + } + + return true; +}; + +/** + * Deletes the last piece of `path` + * + * @param {String} path + * @param {Object} o + */ + +exports.unset = function(path, o) { + var parts = typeof path === 'string' ? + stringToParts(path) : + path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + var len = parts.length; + var cur = o; + for (var i = 0; i < len; ++i) { + if (cur == null || typeof cur !== 'object' || !(parts[i] in cur)) { + return false; + } + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `unset()` must be a string or number, got ' + typeof parts[i]); + } + // Disallow any updates to __proto__ or special properties. + if (ignoreProperties.indexOf(parts[i]) !== -1) { + return false; + } + if (i === len - 1) { + delete cur[parts[i]]; + return true; + } + cur = cur instanceof Map ? cur.get(parts[i]) : cur[parts[i]]; + } + + return true; +}; + +/** + * Sets the `val` at the given `path` of object `o`. + * + * @param {String} path + * @param {Anything} val + * @param {Object} o + * @param {String} [special] When this property name is present on any object in the path, walking will continue on the value of this property. + * @param {Function} [map] Optional function which is passed each individual value before setting it. The value returned from `map` is used in the original values place. + */ + +exports.set = function(path, val, o, special, map, _copying) { + var lookup; + + if ('function' == typeof special) { + if (special.length < 2) { + map = special; + special = undefined; + } else { + lookup = special; + special = undefined; + } + } + + map || (map = K); + + var parts = 'string' == typeof path + ? stringToParts(path) + : path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + if (null == o) return; + + for (var i = 0; i < parts.length; ++i) { + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `set()` must be a string or number, got ' + typeof parts[i]); + } + // Silently ignore any updates to `__proto__`, these are potentially + // dangerous if using mpath with unsanitized data. + if (ignoreProperties.indexOf(parts[i]) !== -1) { + return; + } + } + + // the existance of $ in a path tells us if the user desires + // the copying of an array instead of setting each value of + // the array to the one by one to matching positions of the + // current array. Unless the user explicitly opted out by passing + // false, see Automattic/mongoose#6273 + var copy = _copying || (/\$/.test(path) && _copying !== false), + obj = o, + part; + + for (var i = 0, len = parts.length - 1; i < len; ++i) { + part = parts[i]; + + if ('$' == part) { + if (i == len - 1) { + break; + } else { + continue; + } + } + + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + var paths = parts.slice(i); + if (!copy && Array.isArray(val)) { + for (var j = 0; j < obj.length && j < val.length; ++j) { + // assignment of single values of array + exports.set(paths, val[j], obj[j], special || lookup, map, copy); + } + } else { + for (var j = 0; j < obj.length; ++j) { + // assignment of entire value + exports.set(paths, val, obj[j], special || lookup, map, copy); + } + } + return; + } + + if (lookup) { + obj = lookup(obj, part); + } else { + var _to = special && obj[special] ? obj[special] : obj; + obj = _to instanceof Map ? + _to.get(part) : + _to[part]; + } + + if (!obj) return; + } + + // process the last property of the path + + part = parts[len]; + + // use the special property if exists + if (special && obj[special]) { + obj = obj[special]; + } + + // set the value on the last branch + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + if (!copy && Array.isArray(val)) { + _setArray(obj, val, part, lookup, special, map); + } else { + for (var j = 0; j < obj.length; ++j) { + var item = obj[j]; + if (item) { + if (lookup) { + lookup(item, part, map(val)); + } else { + if (item[special]) item = item[special]; + item[part] = map(val); + } + } + } + } + } else { + if (lookup) { + lookup(obj, part, map(val)); + } else if (obj instanceof Map) { + obj.set(part, map(val)); + } else { + obj[part] = map(val); + } + } +}; + +/*! + * Split a string path into components delimited by '.' or + * '[\d+]' + * + * #### Example: + * stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1'] + */ + +exports.stringToParts = stringToParts; + +/*! + * Recursively set nested arrays + */ + +function _setArray(obj, val, part, lookup, special, map) { + for (var item, j = 0; j < obj.length && j < val.length; ++j) { + item = obj[j]; + if (Array.isArray(item) && Array.isArray(val[j])) { + _setArray(item, val[j], part, lookup, special, map); + } else if (item) { + if (lookup) { + lookup(item, part, map(val[j])); + } else { + if (item[special]) item = item[special]; + item[part] = map(val[j]); + } + } + } +} + +/*! + * Returns the value passed to it. + */ + +function K(v) { + return v; +} diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/stringToParts.js b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/stringToParts.js new file mode 100644 index 00000000..f70f3333 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/lib/stringToParts.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = function stringToParts(str) { + const result = []; + + let curPropertyName = ''; + let state = 'DEFAULT'; + for (let i = 0; i < str.length; ++i) { + // Fall back to treating as property name rather than bracket notation if + // square brackets contains something other than a number. + if (state === 'IN_SQUARE_BRACKETS' && !/\d/.test(str[i]) && str[i] !== ']') { + state = 'DEFAULT'; + curPropertyName = result[result.length - 1] + '[' + curPropertyName; + result.splice(result.length - 1, 1); + } + + if (str[i] === '[') { + if (state !== 'IMMEDIATELY_AFTER_SQUARE_BRACKETS') { + result.push(curPropertyName); + curPropertyName = ''; + } + state = 'IN_SQUARE_BRACKETS'; + } else if (str[i] === ']') { + if (state === 'IN_SQUARE_BRACKETS') { + state = 'IMMEDIATELY_AFTER_SQUARE_BRACKETS'; + result.push(curPropertyName); + curPropertyName = ''; + } else { + state = 'DEFAULT'; + curPropertyName += str[i]; + } + } else if (str[i] === '.') { + if (state !== 'IMMEDIATELY_AFTER_SQUARE_BRACKETS') { + result.push(curPropertyName); + curPropertyName = ''; + } + state = 'DEFAULT'; + } else { + curPropertyName += str[i]; + } + } + + if (state !== 'IMMEDIATELY_AFTER_SQUARE_BRACKETS') { + result.push(curPropertyName); + } + + return result; +}; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/package.json b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/package.json new file mode 100644 index 00000000..6d1242d4 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/package.json @@ -0,0 +1,144 @@ +{ + "name": "mpath", + "version": "0.9.0", + "description": "{G,S}et object values using MongoDB-like path notation", + "main": "index.js", + "scripts": { + "lint": "eslint .", + "test": "mocha test/*" + }, + "engines": { + "node": ">=4.0.0" + }, + "repository": "git://github.com/aheckmann/mpath.git", + "keywords": [ + "mongodb", + "path", + "get", + "set" + ], + "author": "Aaron Heckmann ", + "license": "MIT", + "devDependencies": { + "mocha": "5.x", + "benchmark": "~1.0.0", + "eslint": "7.16.0" + }, + "eslintConfig": { + "extends": [ + "eslint:recommended" + ], + "parserOptions": { + "ecmaVersion": 2015 + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "comma-style": "error", + "indent": [ + "error", + 2, + { + "SwitchCase": 1, + "VariableDeclarator": 2 + } + ], + "keyword-spacing": "error", + "no-whitespace-before-property": "error", + "no-buffer-constructor": "warn", + "no-console": "off", + "no-multi-spaces": "error", + "no-constant-condition": "off", + "func-call-spacing": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-unneeded-ternary": "error", + "no-const-assign": "error", + "no-useless-rename": "error", + "no-dupe-keys": "error", + "space-in-parens": [ + "error", + "never" + ], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": [ + "!" + ], + "balanced": true + } + } + ], + "key-spacing": [ + "error", + { + "beforeColon": false, + "afterColon": true + } + ], + "comma-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "array-bracket-spacing": 1, + "arrow-spacing": [ + "error", + { + "before": true, + "after": true + } + ], + "object-curly-spacing": [ + "error", + "always" + ], + "comma-dangle": [ + "error", + "never" + ], + "no-unreachable": "error", + "quotes": [ + "error", + "single" + ], + "quote-props": [ + "error", + "as-needed" + ], + "semi": "error", + "no-extra-semi": "error", + "semi-spacing": "error", + "no-spaced-func": "error", + "no-throw-literal": "error", + "space-before-blocks": "error", + "space-before-function-paren": [ + "error", + "never" + ], + "space-infix-ops": "error", + "space-unary-ops": "error", + "no-var": "warn", + "prefer-const": "warn", + "strict": [ + "error", + "global" + ], + "no-restricted-globals": [ + "error", + { + "name": "context", + "message": "Don't use Mocha's global context" + } + ], + "no-prototype-builtins": "off" + } + } +} diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/.eslintrc.yml b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/.eslintrc.yml new file mode 100644 index 00000000..c0c68038 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/.eslintrc.yml @@ -0,0 +1,4 @@ +env: + mocha: true +rules: + no-unused-vars: off \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/index.js b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/index.js new file mode 100644 index 00000000..ce07b198 --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/index.js @@ -0,0 +1,1879 @@ +'use strict'; + +/** + * Test dependencies. + */ + +const mpath = require('../'); +const assert = require('assert'); + +/** + * logging helper + */ + +function log(o) { + console.log(); + console.log(require('util').inspect(o, false, 1000)); +} + +/** + * special path for override tests + */ + +const special = '_doc'; + +/** + * Tests + */ + +describe('mpath', function() { + + /** + * test doc creator + */ + + function doc() { + const o = { first: { second: { third: [3, { name: 'aaron' }, 9] } } }; + o.comments = [ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } } + ]; + o.name = 'jiro'; + o.array = [ + { o: { array: [{ x: { b: [4, 6, 8] } }, { y: 10 }] } }, + { o: { array: [{ x: { b: [1, 2, 3] } }, { x: { z: 10 } }, { x: { b: 'hi' } }] } }, + { o: { array: [{ x: { b: null } }, { x: { b: [null, 1] } }] } }, + { o: { array: [{ x: null }] } }, + { o: { array: [{ y: 3 }] } }, + { o: { array: [3, 0, null] } }, + { o: { name: 'ha' } } + ]; + o.arr = [ + { arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true } + ]; + return o; + } + + describe('get', function() { + const o = doc(); + + it('`path` must be a string or array', function(done) { + assert.throws(function() { + mpath.get({}, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(4, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(function() {}, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(/asdf/, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(Math, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(Buffer, o); + }, /Must be either string or array/); + assert.doesNotThrow(function() { + mpath.get('string', o); + }); + assert.doesNotThrow(function() { + mpath.get([], o); + }); + done(); + }); + + describe('without `special`', function() { + it('works', function(done) { + assert.equal('jiro', mpath.get('name', o)); + + assert.deepEqual( + { second: { third: [3, { name: 'aaron' }, 9] } } + , mpath.get('first', o) + ); + + assert.deepEqual( + { third: [3, { name: 'aaron' }, 9] } + , mpath.get('first.second', o) + ); + + assert.deepEqual( + [3, { name: 'aaron' }, 9] + , mpath.get('first.second.third', o) + ); + + assert.deepEqual( + 3 + , mpath.get('first.second.third.0', o) + ); + + assert.deepEqual( + 9 + , mpath.get('first.second.third.2', o) + ); + + assert.deepEqual( + { name: 'aaron' } + , mpath.get('first.second.third.1', o) + ); + + assert.deepEqual( + 'aaron' + , mpath.get('first.second.third.1.name', o) + ); + + assert.deepEqual([ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } }], + mpath.get('comments', o)); + + assert.deepEqual({ name: 'one' }, mpath.get('comments.0', o)); + assert.deepEqual('one', mpath.get('comments.0.name', o)); + assert.deepEqual('two', mpath.get('comments.1.name', o)); + assert.deepEqual('three', mpath.get('comments.2.name', o)); + + assert.deepEqual([{}, { comments: [{ val: 'twoo' }] }] + , mpath.get('comments.2.comments', o)); + + assert.deepEqual({ comments: [{ val: 'twoo' }] } + , mpath.get('comments.2.comments.1', o)); + + assert.deepEqual('twoo', mpath.get('comments.2.comments.1.comments.0.val', o)); + + done(); + }); + + it('handles array.property dot-notation', function(done) { + assert.deepEqual( + ['one', 'two', 'three'] + , mpath.get('comments.name', o) + ); + done(); + }); + + it('handles array.array notation', function(done) { + assert.deepEqual( + [undefined, undefined, [{}, { comments: [{ val: 'twoo' }] }]] + , mpath.get('comments.comments', o) + ); + done(); + }); + + it('handles prop.prop.prop.arrayProperty notation', function(done) { + assert.deepEqual( + [undefined, 'aaron', undefined] + , mpath.get('first.second.third.name', o) + ); + assert.deepEqual( + [1, 'aaron', 1] + , mpath.get('first.second.third.name', o, function(v) { + return undefined === v ? 1 : v; + }) + ); + done(); + }); + + it('handles array.prop.array', function(done) { + assert.deepEqual( + [[{ x: { b: [4, 6, 8] } }, { y: 10 }], + [{ x: { b: [1, 2, 3] } }, { x: { z: 10 } }, { x: { b: 'hi' } }], + [{ x: { b: null } }, { x: { b: [null, 1] } }], + [{ x: null }], + [{ y: 3 }], + [3, 0, null], + undefined + ] + , mpath.get('array.o.array', o) + ); + done(); + }); + + it('handles array.prop.array.index', function(done) { + assert.deepEqual( + [{ x: { b: [4, 6, 8] } }, + { x: { b: [1, 2, 3] } }, + { x: { b: null } }, + { x: null }, + { y: 3 }, + 3, + undefined + ] + , mpath.get('array.o.array.0', o) + ); + done(); + }); + + it('handles array.prop.array.index.prop', function(done) { + assert.deepEqual( + [{ b: [4, 6, 8] }, + { b: [1, 2, 3] }, + { b: null }, + null, + undefined, + undefined, + undefined + ] + , mpath.get('array.o.array.0.x', o) + ); + done(); + }); + + it('handles array.prop.array.prop', function(done) { + assert.deepEqual( + [[undefined, 10], + [undefined, undefined, undefined], + [undefined, undefined], + [undefined], + [3], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.y', o) + ); + assert.deepEqual( + [[{ b: [4, 6, 8] }, undefined], + [{ b: [1, 2, 3] }, { z: 10 }, { b: 'hi' }], + [{ b: null }, { b: [null, 1] }], + [null], + [undefined], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.x', o) + ); + done(); + }); + + it('handles array.prop.array.prop.prop', function(done) { + assert.deepEqual( + [[[4, 6, 8], undefined], + [[1, 2, 3], undefined, 'hi'], + [null, [null, 1]], + [null], + [undefined], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.x.b', o) + ); + done(); + }); + + it('handles array.prop.array.prop.prop.index', function(done) { + assert.deepEqual( + [[6, undefined], + [2, undefined, 'i'], // undocumented feature (string indexing) + [null, 1], + [null], + [undefined], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.x.b.1', o) + ); + assert.deepEqual( + [[6, 0], + [2, 0, 'i'], // undocumented feature (string indexing) + [null, 1], + [null], + [0], + [0, 0, 0], + 0 + ] + , mpath.get('array.o.array.x.b.1', o, function(v) { + return undefined === v ? 0 : v; + }) + ); + done(); + }); + + it('handles array.index.prop.prop', function(done) { + assert.deepEqual( + [{ x: { b: [1, 2, 3] } }, { x: { z: 10 } }, { x: { b: 'hi' } }] + , mpath.get('array.1.o.array', o) + ); + assert.deepEqual( + ['hi', 'hi', 'hi'] + , mpath.get('array.1.o.array', o, function(v) { + if (Array.isArray(v)) { + return v.map(function(val) { + return 'hi'; + }); + } + return v; + }) + ); + done(); + }); + + it('handles array.array.index', function(done) { + assert.deepEqual( + [{ a: { c: 48 } }, undefined] + , mpath.get('arr.arr.1', o) + ); + assert.deepEqual( + ['woot', undefined] + , mpath.get('arr.arr.1', o, function(v) { + if (v && v.a && v.a.c) return 'woot'; + return v; + }) + ); + done(); + }); + + it('handles array.array.index.prop', function(done) { + assert.deepEqual( + [{ c: 48 }, 'woot'] + , mpath.get('arr.arr.1.a', o, function(v) { + if (undefined === v) return 'woot'; + return v; + }) + ); + assert.deepEqual( + [{ c: 48 }, undefined] + , mpath.get('arr.arr.1.a', o) + ); + mpath.set('arr.arr.1.a', [{ c: 49 }, undefined], o); + assert.deepEqual( + [{ c: 49 }, undefined] + , mpath.get('arr.arr.1.a', o) + ); + mpath.set('arr.arr.1.a', [{ c: 48 }, undefined], o); + done(); + }); + + it('handles array.array.index.prop.prop', function(done) { + assert.deepEqual( + [48, undefined] + , mpath.get('arr.arr.1.a.c', o) + ); + assert.deepEqual( + [48, 'woot'] + , mpath.get('arr.arr.1.a.c', o, function(v) { + if (undefined === v) return 'woot'; + return v; + }) + ); + done(); + }); + + }); + + describe('with `special`', function() { + describe('that is a string', function() { + it('works', function(done) { + assert.equal('jiro', mpath.get('name', o, special)); + + assert.deepEqual( + { second: { third: [3, { name: 'aaron' }, 9] } } + , mpath.get('first', o, special) + ); + + assert.deepEqual( + { third: [3, { name: 'aaron' }, 9] } + , mpath.get('first.second', o, special) + ); + + assert.deepEqual( + [3, { name: 'aaron' }, 9] + , mpath.get('first.second.third', o, special) + ); + + assert.deepEqual( + 3 + , mpath.get('first.second.third.0', o, special) + ); + + assert.deepEqual( + 4 + , mpath.get('first.second.third.0', o, special, function(v) { + return 3 === v ? 4 : v; + }) + ); + + assert.deepEqual( + 9 + , mpath.get('first.second.third.2', o, special) + ); + + assert.deepEqual( + { name: 'aaron' } + , mpath.get('first.second.third.1', o, special) + ); + + assert.deepEqual( + 'aaron' + , mpath.get('first.second.third.1.name', o, special) + ); + + assert.deepEqual([ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } }], + mpath.get('comments', o, special)); + + assert.deepEqual({ name: 'one' }, mpath.get('comments.0', o, special)); + assert.deepEqual('one', mpath.get('comments.0.name', o, special)); + assert.deepEqual('2', mpath.get('comments.1.name', o, special)); + assert.deepEqual('3', mpath.get('comments.2.name', o, special)); + assert.deepEqual('nice', mpath.get('comments.2.name', o, special, function(v) { + return '3' === v ? 'nice' : v; + })); + + assert.deepEqual([{}, { _doc: { comments: [{ val: 2 }] } }] + , mpath.get('comments.2.comments', o, special)); + + assert.deepEqual({ _doc: { comments: [{ val: 2 }] } } + , mpath.get('comments.2.comments.1', o, special)); + + assert.deepEqual(2, mpath.get('comments.2.comments.1.comments.0.val', o, special)); + done(); + }); + + it('handles array.property dot-notation', function(done) { + assert.deepEqual( + ['one', '2', '3'] + , mpath.get('comments.name', o, special) + ); + assert.deepEqual( + ['one', 2, '3'] + , mpath.get('comments.name', o, special, function(v) { + return '2' === v ? 2 : v; + }) + ); + done(); + }); + + it('handles array.array notation', function(done) { + assert.deepEqual( + [undefined, undefined, [{}, { _doc: { comments: [{ val: 2 }] } }]] + , mpath.get('comments.comments', o, special) + ); + done(); + }); + + it('handles array.array.index.array', function(done) { + assert.deepEqual( + [undefined, undefined, [{ val: 2 }]] + , mpath.get('comments.comments.1.comments', o, special) + ); + done(); + }); + + it('handles array.array.index.array.prop', function(done) { + assert.deepEqual( + [undefined, undefined, [2]] + , mpath.get('comments.comments.1.comments.val', o, special) + ); + assert.deepEqual( + ['nil', 'nil', [2]] + , mpath.get('comments.comments.1.comments.val', o, special, function(v) { + return undefined === v ? 'nil' : v; + }) + ); + done(); + }); + }); + + describe('that is a function', function() { + const special = function(obj, key) { + return obj[key]; + }; + + it('works', function(done) { + assert.equal('jiro', mpath.get('name', o, special)); + + assert.deepEqual( + { second: { third: [3, { name: 'aaron' }, 9] } } + , mpath.get('first', o, special) + ); + + assert.deepEqual( + { third: [3, { name: 'aaron' }, 9] } + , mpath.get('first.second', o, special) + ); + + assert.deepEqual( + [3, { name: 'aaron' }, 9] + , mpath.get('first.second.third', o, special) + ); + + assert.deepEqual( + 3 + , mpath.get('first.second.third.0', o, special) + ); + + assert.deepEqual( + 4 + , mpath.get('first.second.third.0', o, special, function(v) { + return 3 === v ? 4 : v; + }) + ); + + assert.deepEqual( + 9 + , mpath.get('first.second.third.2', o, special) + ); + + assert.deepEqual( + { name: 'aaron' } + , mpath.get('first.second.third.1', o, special) + ); + + assert.deepEqual( + 'aaron' + , mpath.get('first.second.third.1.name', o, special) + ); + + assert.deepEqual([ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } }], + mpath.get('comments', o, special)); + + assert.deepEqual({ name: 'one' }, mpath.get('comments.0', o, special)); + assert.deepEqual('one', mpath.get('comments.0.name', o, special)); + assert.deepEqual('two', mpath.get('comments.1.name', o, special)); + assert.deepEqual('three', mpath.get('comments.2.name', o, special)); + assert.deepEqual('nice', mpath.get('comments.2.name', o, special, function(v) { + return 'three' === v ? 'nice' : v; + })); + + assert.deepEqual([{}, { comments: [{ val: 'twoo' }] }] + , mpath.get('comments.2.comments', o, special)); + + assert.deepEqual({ comments: [{ val: 'twoo' }] } + , mpath.get('comments.2.comments.1', o, special)); + + assert.deepEqual('twoo', mpath.get('comments.2.comments.1.comments.0.val', o, special)); + + let overide = false; + assert.deepEqual('twoo', mpath.get('comments.8.comments.1.comments.0.val', o, function(obj, path) { + if (Array.isArray(obj) && 8 == path) { + overide = true; + return obj[2]; + } + return obj[path]; + })); + assert.ok(overide); + + done(); + }); + + it('in combination with map', function(done) { + const special = function(obj, key) { + if (Array.isArray(obj)) return obj[key]; + return obj.mpath; + }; + const map = function(val) { + return 'convert' == val + ? 'mpath' + : val; + }; + const o = { mpath: [{ mpath: 'converse' }, { mpath: 'convert' }] }; + + assert.equal('mpath', mpath.get('something.1.kewl', o, special, map)); + done(); + }); + }); + }); + }); + + describe('set', function() { + it('prevents writing to __proto__', function() { + const obj = {}; + mpath.set('__proto__.x', 'foobar', obj); + assert.ok(!({}.x)); + + mpath.set('constructor.prototype.x', 'foobar', obj); + assert.ok(!({}.x)); + }); + + describe('without `special`', function() { + const o = doc(); + + it('works', function(done) { + mpath.set('name', 'a new val', o, function(v) { + return 'a new val' === v ? 'changed' : v; + }); + assert.deepEqual('changed', o.name); + + mpath.set('name', 'changed', o); + assert.deepEqual('changed', o.name); + + mpath.set('first.second.third', [1, { name: 'x' }, 9], o); + assert.deepEqual([1, { name: 'x' }, 9], o.first.second.third); + + mpath.set('first.second.third.1.name', 'y', o); + assert.deepEqual([1, { name: 'y' }, 9], o.first.second.third); + + mpath.set('comments.1.name', 'ttwwoo', o); + assert.deepEqual({ name: 'ttwwoo', _doc: { name: '2' } }, o.comments[1]); + + mpath.set('comments.2.comments.1.comments.0.expand', 'added', o); + assert.deepEqual( + { val: 'twoo', expand: 'added' } + , o.comments[2].comments[1].comments[0]); + + mpath.set('comments.2.comments.1.comments.2', 'added', o); + assert.equal(3, o.comments[2].comments[1].comments.length); + assert.deepEqual( + { val: 'twoo', expand: 'added' } + , o.comments[2].comments[1].comments[0]); + assert.deepEqual( + undefined + , o.comments[2].comments[1].comments[1]); + assert.deepEqual( + 'added' + , o.comments[2].comments[1].comments[2]); + + done(); + }); + + describe('array.path', function() { + describe('with single non-array value', function() { + it('works', function(done) { + mpath.set('arr.yep', false, o, function(v) { + return false === v ? true : v; + }); + assert.deepEqual([ + { yep: true, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true } + ], o.arr); + + mpath.set('arr.yep', false, o); + + assert.deepEqual([ + { yep: false, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: false } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('that are equal in length', function(done) { + mpath.set('arr.yep', ['one', 2], o, function(v) { + return 'one' === v ? 1 : v; + }); + assert.deepEqual([ + { yep: 1, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + mpath.set('arr.yep', ['one', 2], o); + + assert.deepEqual([ + { yep: 'one', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + + done(); + }); + + it('that is less than length', function(done) { + mpath.set('arr.yep', [47], o, function(v) { + return 47 === v ? 4 : v; + }); + assert.deepEqual([ + { yep: 4, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + + mpath.set('arr.yep', [47], o); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + + done(); + }); + + it('that is greater than length', function(done) { + mpath.set('arr.yep', [5, 6, 7], o, function(v) { + return 5 === v ? 'five' : v; + }); + assert.deepEqual([ + { yep: 'five', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 6 } + ], o.arr); + + mpath.set('arr.yep', [5, 6, 7], o); + assert.deepEqual([ + { yep: 5, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 6 } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.$.path', function() { + describe('with single non-array value', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', { xtra: 'double good' }, o, function(v) { + return v && v.xtra ? 'hi' : v; + }); + assert.deepEqual([ + { yep: 'hi', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 'hi' } + ], o.arr); + + mpath.set('arr.$.yep', { xtra: 'double good' }, o); + assert.deepEqual([ + { yep: { xtra: 'double good' }, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: { xtra: 'double good' } } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', [15], o, function(v) { + return v.length === 1 ? [] : v; + }); + assert.deepEqual([ + { yep: [], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: [] } + ], o.arr); + + mpath.set('arr.$.yep', [15], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: [15] } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.index.path', function() { + it('works', function(done) { + mpath.set('arr.1.yep', 0, o, function(v) { + return 0 === v ? 'zero' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 'zero' } + ], o.arr); + + mpath.set('arr.1.yep', 0, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.e', 35, o, function(v) { + return 35 === v ? 3 : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 3 }, { a: { c: 48 }, e: 3 }, { d: 'yep', e: 3 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.e', 35, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 35 }, { a: { c: 48 }, e: 35 }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.e', ['a', 'b'], o, function(v) { + return 'a' === v ? 'x' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 'x' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.e', ['a', 'b'], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 'a' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.a.b', 36, o, function(v) { + return 36 === v ? 3 : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 3 }, e: 'a' }, { a: { c: 48, b: 3 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.a.b', 36, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 36 }, e: 'a' }, { a: { c: 48, b: 36 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o, function(v) { + return 2 === v ? 'two' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 1 }, e: 'a' }, { a: { c: 48, b: 'two' }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 1 }, e: 'a' }, { a: { c: 48, b: 2 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.$.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.$.a.b', '$', o, function(v) { + return '$' === v ? 'dolla billz' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 'dolla billz' }, e: 'a' }, { a: { c: 48, b: 'dolla billz' }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', '$', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: '$' }, e: 'a' }, { a: { c: 48, b: '$' }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.$.a.b', [1], o, function(v) { + return Array.isArray(v) ? {} : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: {} }, e: 'a' }, { a: { c: 48, b: {} }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', [1], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: [1] }, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.array.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.0.a', 'single', o, function(v) { + return 'single' === v ? 'double' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'double', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.0.a', 'single', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o, function(v) { + return 4 === v ? 3 : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 3, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: false } + ], o.arr); + + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 4, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: false } + ], o.arr); + + done(); + }); + }); + + describe('array.array.$.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.$.0.a', 'singles', o, function(v) { + return 0; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 0, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.$.0.a', 'singles', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'singles', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('$.arr.arr.0.a', 'single', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o, function(v) { + return 'nope'; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'nope', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.$.arr.0.a', [4, 8, 15, 16, 23, 42, 108], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.array.path.index', function() { + it('with single value', function(done) { + mpath.set('arr.arr.a.7', 47, o, function(v) { + return 1; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, 1], e: 'a' }, { a: { c: 48, b: [1], 7: 1 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.a.7', 47, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, 47], e: 'a' }, { a: { c: 48, b: [1], 7: 47 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + o.arr[1].arr = [{ a: [] }, { a: [] }, { a: null }]; + mpath.set('arr.arr.a.7', [[null, 46], [undefined, 'woot']], o); + + const a1 = []; + const a2 = []; + a1[7] = undefined; + a2[7] = 'woot'; + + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, null], e: 'a' }, { a: { c: 48, b: [1], 7: 46 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0, arr: [{ a: a1 }, { a: a2 }, { a: null }] } + ], o.arr); + + done(); + }); + }); + + describe('handles array.array.path', function() { + it('with single', function(done) { + o.arr[1].arr = [{}, {}]; + assert.deepEqual([{}, {}], o.arr[1].arr); + o.arr.push({ arr: 'something else' }); + o.arr.push({ arr: ['something else'] }); + o.arr.push({ arr: [[]] }); + o.arr.push({ arr: [5] }); + + const weird = []; + weird.e = 'xmas'; + + // test + mpath.set('arr.arr.e', 47, o, function(v) { + return 'xmas'; + }); + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 'xmas' }, + { a: { c: 48, b: [1], 7: 46 }, e: 'xmas' }, + { d: 'yep', e: 'xmas' } + ] + }, + { yep: 0, arr: [{ e: 'xmas' }, { e: 'xmas' }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + weird.e = 47; + + mpath.set('arr.arr.e', 47, o); + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 47 }, + { a: { c: 48, b: [1], 7: 46 }, e: 47 }, + { d: 'yep', e: 47 } + ] + }, + { yep: 0, arr: [{ e: 47 }, { e: 47 }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + done(); + }); + it('with arrays', function(done) { + mpath.set('arr.arr.e', [[1, 2, 3], [4, 5], null, [], [6], [7, 8, 9]], o, function(v) { + return 10; + }); + + const weird = []; + weird.e = 10; + + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 10 }, + { a: { c: 48, b: [1], 7: 46 }, e: 10 }, + { d: 'yep', e: 10 } + ] + }, + { yep: 0, arr: [{ e: 10 }, { e: 10 }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + mpath.set('arr.arr.e', [[1, 2, 3], [4, 5], null, [], [6], [7, 8, 9]], o); + + weird.e = 6; + + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 1 }, + { a: { c: 48, b: [1], 7: 46 }, e: 2 }, + { d: 'yep', e: 3 } + ] + }, + { yep: 0, arr: [{ e: 4 }, { e: 5 }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + done(); + }); + }); + }); + + describe('with `special`', function() { + const o = doc(); + + it('works', function(done) { + mpath.set('name', 'chan', o, special, function(v) { + return 'hi'; + }); + assert.deepEqual('hi', o.name); + + mpath.set('name', 'changer', o, special); + assert.deepEqual('changer', o.name); + + mpath.set('first.second.third', [1, { name: 'y' }, 9], o, special); + assert.deepEqual([1, { name: 'y' }, 9], o.first.second.third); + + mpath.set('first.second.third.1.name', 'z', o, special); + assert.deepEqual([1, { name: 'z' }, 9], o.first.second.third); + + mpath.set('comments.1.name', 'ttwwoo', o, special); + assert.deepEqual({ name: 'two', _doc: { name: 'ttwwoo' } }, o.comments[1]); + + mpath.set('comments.2.comments.1.comments.0.expander', 'adder', o, special, function(v) { + return 'super'; + }); + assert.deepEqual( + { val: 2, expander: 'super' } + , o.comments[2]._doc.comments[1]._doc.comments[0]); + + mpath.set('comments.2.comments.1.comments.0.expander', 'adder', o, special); + assert.deepEqual( + { val: 2, expander: 'adder' } + , o.comments[2]._doc.comments[1]._doc.comments[0]); + + mpath.set('comments.2.comments.1.comments.2', 'set', o, special); + assert.equal(3, o.comments[2]._doc.comments[1]._doc.comments.length); + assert.deepEqual( + { val: 2, expander: 'adder' } + , o.comments[2]._doc.comments[1]._doc.comments[0]); + assert.deepEqual( + undefined + , o.comments[2]._doc.comments[1]._doc.comments[1]); + assert.deepEqual( + 'set' + , o.comments[2]._doc.comments[1]._doc.comments[2]); + done(); + }); + + describe('array.path', function() { + describe('with single non-array value', function() { + it('works', function(done) { + o.arr[1]._doc = { special: true }; + + mpath.set('arr.yep', false, o, special, function(v) { + return 'yes'; + }); + assert.deepEqual([ + { yep: 'yes', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 'yes' } } + ], o.arr); + + mpath.set('arr.yep', false, o, special); + assert.deepEqual([ + { yep: false, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: false } } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('that are equal in length', function(done) { + mpath.set('arr.yep', ['one', 2], o, special, function(v) { + return 2 === v ? 20 : v; + }); + assert.deepEqual([ + { yep: 'one', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 20 } } + ], o.arr); + + mpath.set('arr.yep', ['one', 2], o, special); + assert.deepEqual([ + { yep: 'one', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + done(); + }); + + it('that is less than length', function(done) { + mpath.set('arr.yep', [47], o, special, function(v) { + return 80; + }); + assert.deepEqual([ + { yep: 80, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + mpath.set('arr.yep', [47], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + // add _doc to first element + o.arr[0]._doc = { yep: 46, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }; + + mpath.set('arr.yep', [20], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], _doc: { yep: 20, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + done(); + }); + + it('that is greater than length', function(done) { + mpath.set('arr.yep', [5, 6, 7], o, special, function() { + return 'x'; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], _doc: { yep: 'x', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 'x' } } + ], o.arr); + + mpath.set('arr.yep', [5, 6, 7], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], _doc: { yep: 5, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 6 } } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.$.path', function() { + describe('with single non-array value', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', { xtra: 'double good' }, o, special, function(v) { + return 9; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: 9, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 9 } } + ], o.arr); + + mpath.set('arr.$.yep', { xtra: 'double good' }, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: { xtra: 'double good' }, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: { xtra: 'double good' } } } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', [15], o, special, function(v) { + return 'array'; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: 'array', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 'array' } } + ], o.arr); + + mpath.set('arr.$.yep', [15], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: [15] } } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.index.path', function() { + it('works', function(done) { + mpath.set('arr.1.yep', 0, o, special, function(v) { + return 1; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 1 } } + ], o.arr); + + mpath.set('arr.1.yep', 0, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.e', 35, o, special, function(v) { + return 30; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 30 }, { a: { c: 48 }, e: 30 }, { d: 'yep', e: 30 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.e', 35, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 35 }, { a: { c: 48 }, e: 35 }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.e', ['a', 'b'], o, special, function(v) { + return 'a' === v ? 'A' : v; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 'A' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.e', ['a', 'b'], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 'a' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.a.b', 36, o, special, function(v) { + return 20; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 20 }, e: 'a' }, { a: { c: 48, b: 20 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.a.b', 36, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 36 }, e: 'a' }, { a: { c: 48, b: 36 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o, special, function(v) { + return v * 2; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 2 }, e: 'a' }, { a: { c: 48, b: 4 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 1 }, e: 'a' }, { a: { c: 48, b: 2 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.$.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.$.a.b', '$', o, special, function(v) { + return 'dollaz'; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 'dollaz' }, e: 'a' }, { a: { c: 48, b: 'dollaz' }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', '$', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: '$' }, e: 'a' }, { a: { c: 48, b: '$' }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.$.a.b', [1], o, special, function(v) { + return {}; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: {} }, e: 'a' }, { a: { c: 48, b: {} }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', [1], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: [1] }, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.array.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.0.a', 'single', o, special, function(v) { + return 88; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 88, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.0.a', 'single', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o, special, function(v) { + return v * 2; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 8, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 4, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.array.$.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.$.0.a', 'singles', o, special, function(v) { + return v.toUpperCase(); + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'SINGLES', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.$.0.a', 'singles', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'singles', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('$.arr.arr.0.a', 'single', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o, special, function(v) { + return Array; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: Array, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.$.arr.0.a', [4, 8, 15, 16, 23, 42, 108], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.array.path.index', function() { + it('with single value', function(done) { + mpath.set('arr.arr.a.7', 47, o, special, function(v) { + return Object; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, Object], e: 'a' }, { a: { c: 48, b: [1], 7: Object }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.a.7', 47, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, 47], e: 'a' }, { a: { c: 48, b: [1], 7: 47 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + o.arr[1]._doc.arr = [{ a: [] }, { a: [] }, { a: null }]; + mpath.set('arr.arr.a.7', [[null, 46], [undefined, 'woot']], o, special, function(v) { + return undefined === v ? 'nope' : v; + }); + + const a1 = []; + const a2 = []; + a1[7] = 'nope'; + a2[7] = 'woot'; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, null], e: 'a' }, { a: { c: 48, b: [1], 7: 46 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { arr: [{ a: a1 }, { a: a2 }, { a: null }], special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.a.7', [[null, 46], [undefined, 'woot']], o, special); + + a1[7] = undefined; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, null], e: 'a' }, { a: { c: 48, b: [1], 7: 46 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { arr: [{ a: a1 }, { a: a2 }, { a: null }], special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('handles array.array.path', function() { + it('with single', function(done) { + o.arr[1]._doc.arr = [{}, {}]; + assert.deepEqual([{}, {}], o.arr[1]._doc.arr); + o.arr.push({ _doc: { arr: 'something else' } }); + o.arr.push({ _doc: { arr: ['something else'] } }); + o.arr.push({ _doc: { arr: [[]] } }); + o.arr.push({ _doc: { arr: [5] } }); + + // test + mpath.set('arr.arr.e', 47, o, special); + + const weird = []; + weird.e = 47; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { + yep: [15], + arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 47 }, + { a: { c: 48, b: [1], 7: 46 }, e: 47 }, + { d: 'yep', e: 47 } + ] + } + }, + { yep: true, + _doc: { + arr: [ + { e: 47 }, + { e: 47 } + ], + special: true, + yep: 0 + } + }, + { _doc: { arr: 'something else' } }, + { _doc: { arr: ['something else'] } }, + { _doc: { arr: [weird] } }, + { _doc: { arr: [5] } } + ] + , o.arr); + + done(); + }); + it('with arrays', function(done) { + mpath.set('arr.arr.e', [[1, 2, 3], [4, 5], null, [], [6], [7, 8, 9]], o, special); + + const weird = []; + weird.e = 6; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { + yep: [15], + arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 1 }, + { a: { c: 48, b: [1], 7: 46 }, e: 2 }, + { d: 'yep', e: 3 } + ] + } + }, + { yep: true, + _doc: { + arr: [ + { e: 4 }, + { e: 5 } + ], + special: true, + yep: 0 + } + }, + { _doc: { arr: 'something else' } }, + { _doc: { arr: ['something else'] } }, + { _doc: { arr: [weird] } }, + { _doc: { arr: [5] } } + ] + , o.arr); + + done(); + }); + }); + + describe('that is a function', function() { + describe('without map', function() { + it('works on array value', function(done) { + const o = { hello: { world: [{ how: 'are' }, { you: '?' }] } }; + const special = function(obj, key, val) { + if (val) { + obj[key] = val; + } else { + return 'thing' == key + ? obj.world + : obj[key]; + } + }; + mpath.set('hello.thing.how', 'arrrr', o, special); + assert.deepEqual(o, { hello: { world: [{ how: 'arrrr' }, { you: '?', how: 'arrrr' }] } }); + done(); + }); + it('works on non-array value', function(done) { + const o = { hello: { world: { how: 'are you' } } }; + const special = function(obj, key, val) { + if (val) { + obj[key] = val; + } else { + return 'thing' == key + ? obj.world + : obj[key]; + } + }; + mpath.set('hello.thing.how', 'RU', o, special); + assert.deepEqual(o, { hello: { world: { how: 'RU' } } }); + done(); + }); + }); + it('works with map', function(done) { + const o = { hello: { world: [{ how: 'are' }, { you: '?' }] } }; + const special = function(obj, key, val) { + if (val) { + obj[key] = val; + } else { + return 'thing' == key + ? obj.world + : obj[key]; + } + }; + const map = function(val) { + return 'convert' == val + ? 'ºº' + : val; + }; + mpath.set('hello.thing.how', 'convert', o, special, map); + assert.deepEqual(o, { hello: { world: [{ how: 'ºº' }, { you: '?', how: 'ºº' }] } }); + done(); + }); + }); + + }); + + describe('get/set integration', function() { + const o = doc(); + + it('works', function(done) { + const vals = mpath.get('array.o.array.x.b', o); + + vals[0][0][2] = 10; + vals[1][0][1] = 0; + vals[1][1] = 'Rambaldi'; + vals[1][2] = [12, 14]; + vals[2] = [{ changed: true }, [null, ['changed', 'to', 'array']]]; + + mpath.set('array.o.array.x.b', vals, o); + + const t = [ + { o: { array: [{ x: { b: [4, 6, 10] } }, { y: 10 }] } }, + { o: { array: [{ x: { b: [1, 0, 3] } }, { x: { b: 'Rambaldi', z: 10 } }, { x: { b: [12, 14] } }] } }, + { o: { array: [{ x: { b: { changed: true } } }, { x: { b: [null, ['changed', 'to', 'array']] } }] } }, + { o: { array: [{ x: null }] } }, + { o: { array: [{ y: 3 }] } }, + { o: { array: [3, 0, null] } }, + { o: { name: 'ha' } } + ]; + assert.deepEqual(t, o.array); + done(); + }); + + it('array.prop', function(done) { + mpath.set('comments.name', ['this', 'was', 'changed'], o); + + assert.deepEqual([ + { name: 'this' }, + { name: 'was', _doc: { name: '2' } }, + { name: 'changed', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } } + ], o.comments); + + mpath.set('comments.name', ['also', 'changed', 'this'], o, special); + + assert.deepEqual([ + { name: 'also' }, + { name: 'was', _doc: { name: 'changed' } }, + { name: 'changed', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: 'this', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } } + ], o.comments); + + done(); + }); + + it('nested array', function(done) { + const obj = { arr: [[{ test: 41 }]] }; + mpath.set('arr.test', [[42]], obj); + assert.deepEqual(obj.arr, [[{ test: 42 }]]); + done(); + }); + }); + + describe('multiple $ use', function() { + const o = doc(); + it('is ok', function(done) { + assert.doesNotThrow(function() { + mpath.set('arr.$.arr.$.a', 35, o); + }); + done(); + }); + }); + + it('has', function(done) { + assert.ok(mpath.has('a', { a: 1 })); + assert.ok(mpath.has('a', { a: undefined })); + assert.ok(!mpath.has('a', {})); + assert.ok(!mpath.has('a', null)); + + assert.ok(mpath.has('a.b', { a: { b: 1 } })); + assert.ok(mpath.has('a.b', { a: { b: undefined } })); + assert.ok(!mpath.has('a.b', { a: 1 })); + assert.ok(!mpath.has('a.b', { a: null })); + + done(); + }); + + it('underneath a map', function(done) { + if (!global.Map) { + done(); + return; + } + assert.equal(mpath.get('a.b', { a: new Map([['b', 1]]) }), 1); + + const m = new Map([['b', 1]]); + const obj = { a: m }; + mpath.set('a.c', 2, obj); + assert.equal(m.get('c'), 2); + + done(); + }); + + it('unset', function(done) { + let o = { a: 1 }; + mpath.unset('a', o); + assert.deepEqual(o, {}); + + o = { a: { b: 1 } }; + mpath.unset('a.b', o); + assert.deepEqual(o, { a: {} }); + + o = { a: null }; + mpath.unset('a.b', o); + assert.deepEqual(o, { a: null }); + + done(); + }); + + it('unset with __proto__', function(done) { + // Should refuse to set __proto__ + function Clazz() {} + Clazz.prototype.foobar = true; + + mpath.unset('__proto__.foobar', new Clazz()); + assert.ok(Clazz.prototype.foobar); + + mpath.unset('constructor.prototype.foobar', new Clazz()); + assert.ok(Clazz.prototype.foobar); + + done(); + }); + + it('get() underneath subclassed array', function(done) { + class MyArray extends Array {} + + const obj = { + arr: new MyArray() + }; + obj.arr.push({ test: 2 }); + + const arr = mpath.get('arr.test', obj); + assert.equal(arr.constructor.name, 'Array'); + assert.ok(!(arr instanceof MyArray)); + + done(); + }); + + it('ignores setting a nested path that doesnt exist', function(done) { + const o = doc(); + assert.doesNotThrow(function() { + mpath.set('thing.that.is.new', 10, o); + }); + done(); + }); + }); +}); diff --git a/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/stringToParts.js b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/stringToParts.js new file mode 100644 index 00000000..09940dfa --- /dev/null +++ b/backend/node_modules/.pnpm/mpath@0.9.0/node_modules/mpath/test/stringToParts.js @@ -0,0 +1,30 @@ +'use strict'; + +const assert = require('assert'); +const stringToParts = require('../lib/stringToParts'); + +describe('stringToParts', function() { + it('handles brackets for numbers', function() { + assert.deepEqual(stringToParts('list[0].name'), ['list', '0', 'name']); + assert.deepEqual(stringToParts('list[0][1].name'), ['list', '0', '1', 'name']); + }); + + it('handles dot notation', function() { + assert.deepEqual(stringToParts('a.b.c'), ['a', 'b', 'c']); + assert.deepEqual(stringToParts('a..b.d'), ['a', '', 'b', 'd']); + }); + + it('ignores invalid numbers in square brackets', function() { + assert.deepEqual(stringToParts('foo[1mystring]'), ['foo[1mystring]']); + assert.deepEqual(stringToParts('foo[1mystring].bar[1]'), ['foo[1mystring]', 'bar', '1']); + assert.deepEqual(stringToParts('foo[1mystring][2]'), ['foo[1mystring]', '2']); + }); + + it('handles empty string', function() { + assert.deepEqual(stringToParts(''), ['']); + }); + + it('handles trailing dot', function() { + assert.deepEqual(stringToParts('a.b.'), ['a', 'b', '']); + }); +}); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/ISSUE_TEMPLATE.md b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..20412e65 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ + + +**Do you want to request a *feature* or report a *bug*?** + +**What is the current behavior?** + +**If the current behavior is a bug, please provide the steps to reproduce.** + +**What is the expected behavior?** + +**What are the versions of Node.js and mquery are you are using? Note that "latest" is not a version.** diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..eb1a69d9 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ + + +**Summary** + + + +**Examples** + + diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/History.md b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/History.md new file mode 100644 index 00000000..4aac5e3d --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/History.md @@ -0,0 +1,393 @@ +6.0.0 / 2025-11-18 +================== + * BREAKING CHANGE: Make calling updateOne(), updateMany(), and findOneAndX() with one arg set the query filter rather than the update to line up with modern expectations of optional arguments + * BREAKING CHANGE: remove debug dependency, use node debuglog instead + * BREAKING CHANGE: remove count() and findOneAndRemove(): use countDocuments() and findOneAndDelete() instead + * BREAKING CHANGE: require Node >= 20.19.0 + * feat: add findOneAndDelete, findOneAndReplace, countDocuments, estimatedDocumentCount + * feat: use mongodb driver 6 in tests + +5.0.0 / 2023-02-23 +================== + * BREAKING CHANGE: drop callback support #137 [hasezoey](https://github.com/hasezoey) + * BREAKING CHANGE: remove custom promise library support #137 [hasezoey](https://github.com/hasezoey) + * BREAKING CHANGE: remove long deprecated `update`, `remove` functions #136 [hasezoey](https://github.com/hasezoey) + * BREAKING CHANGE: remove collection ducktyping: first param to `mquery()` is now always the query filter #138 + * feat: support MongoDB Node driver 5 #137 [hasezoey](https://github.com/hasezoey) + +4.0.3 / 2022-05-17 +================== + * fix: allow using `comment` with `findOneAndUpdate()`, `count()`, `distinct()` and `hint` with `findOneAndUpdate()` Automattic/mongoose#11793 + +4.0.2 / 2022-01-23 +================== + * perf: replace regexp-clone with native functionality #131 [Uzlopak](https://github.com/Uzlopak) + +4.0.1 / 2022-01-20 +================== + * perf: remove sliced, add various microoptimizations #130 [Uzlopak](https://github.com/Uzlopak) + * refactor: convert NodeCollection to a class #128 [jimmywarting](https://github.com/jimmywarting) + +4.0.0 / 2021-08-24 + +4.0.0-rc0 / 2021-08-19 +====================== + * BREAKING CHANGE: drop support for Node < 12 #123 + * BREAKING CHANGE: upgrade to mongodb driver 4.x: drop support for `findAndModify()`, use native `findOneAndUpdate/Delete` #124 + * BREAKING CHANGE: rename findStream -> findCursor #124 + * BREAKING CHANGE: use native ES6 promises by default, remove bluebird dependency #123 + +3.2.5 / 2021-03-29 +================== + * fix(utils): make `mergeClone()` skip special properties like `__proto__` #121 [zpbrent](https://github.com/zpbrent) + +3.2.4 / 2021-02-12 +================== + * fix(utils): make clone() only copy own properties Automattic/mongoose#9876 + +3.2.3 / 2020-12-10 +================== + * fix(utils): avoid copying special properties like `__proto__` when merging and cloning. Fix CVE-2020-35149 + +3.2.2 / 2019-09-22 +================== + * fix: dont re-call setOptions() when pulling base class options Automattic/mongoose#8159 + +3.2.1 / 2018-08-24 +================== + * chore: upgrade deps + +3.2.0 / 2018-08-24 +================== + * feat: add $useProjection to opt in to using `projection` instead of `fields` re: MongoDB deprecation warnings Automattic/mongoose#6880 + +3.1.2 / 2018-08-01 +================== + * chore: move eslint to devDependencies #110 [jakesjews](https://github.com/jakesjews) + +3.1.1 / 2018-07-30 +================== + * chore: add eslint #107 [Fonger](https://github.com/Fonger) + * docs: clean up readConcern docs #106 [Fonger](https://github.com/Fonger) + +3.1.0 / 2018-07-29 +================== + * feat: add `readConcern()` helper #105 [Fonger](https://github.com/Fonger) + * feat: add `maxTimeMS()` as alias of `maxTime()` #105 [Fonger](https://github.com/Fonger) + * feat: add `collation()` helper #105 [Fonger](https://github.com/Fonger) + +3.0.1 / 2018-07-02 +================== + * fix: parse sort array options correctly #103 #102 [Fonger](https://github.com/Fonger) + +3.0.0 / 2018-01-20 +================== + * chore: upgrade deps and add nsp + +3.0.0-rc0 / 2017-12-06 +====================== + * BREAKING CHANGE: remove support for node < 4 + * BREAKING CHANGE: remove support for retainKeyOrder, will always be true by default re: Automattic/mongoose#2749 + +2.3.3 / 2017-11-19 +================== + * fixed; catch sync errors in cursor.toArray() re: Automattic/mongoose#5812 + +2.3.2 / 2017-09-27 +================== + * fixed; bumped debug -> 2.6.9 re: #89 + +2.3.1 / 2017-05-22 +================== + * fixed; bumped debug -> 2.6.7 re: #86 + +2.3.0 / 2017-03-05 +================== + * added; replaceOne function + * added; deleteOne and deleteMany functions + +2.2.3 / 2017-01-31 +================== + * fixed; throw correct error when passing incorrectly formatted array to sort() + +2.2.2 / 2017-01-31 +================== + * fixed; allow passing maps to sort() + +2.2.1 / 2017-01-29 +================== + * fixed; allow passing string to hint() + +2.2.0 / 2017-01-08 +================== + * added; updateOne and updateMany functions + +2.1.0 / 2016-12-22 +================== + * added; ability to pass an array to select() #81 [dciccale](https://github.com/dciccale) + +2.0.0 / 2016-09-25 +================== + * added; support for mongodb driver 2.0 streams + +1.12.0 / 2016-09-25 +=================== + * added; `retainKeyOrder` option re: Automattic/mongoose#4542 + +1.11.0 / 2016-06-04 +=================== + * added; `.minDistance()` helper and minDistance for `.near()` Automattic/mongoose#4179 + +1.10.1 / 2016-04-26 +=================== + * fixed; ensure conditions is an object before assigning #75 + +1.10.0 / 2016-03-16 +================== + + * updated; bluebird to latest 2.10.2 version #74 [matskiv](https://github.com/matskiv) + +1.9.0 / 2016-03-15 +================== + * added; `.eq` as a shortcut for `.equals` #72 [Fonger](https://github.com/Fonger) + * added; ability to use array syntax for sort re: https://jira.mongodb.org/browse/NODE-578 #67 + +1.8.0 / 2016-03-01 +================== + * fixed; dont throw an error if count used with sort or select Automattic/mongoose#3914 + +1.7.0 / 2016-02-23 +================== + * fixed; don't treat objects with a length property as argument objects #70 + * added; `.findCursor()` method #69 [nswbmw](https://github.com/nswbmw) + * added; `_compiledUpdate` property #68 [nswbmw](https://github.com/nswbmw) + +1.6.2 / 2015-07-12 +================== + + * fixed; support exec cb being called synchronously #66 + +1.6.1 / 2015-06-16 +================== + + * fixed; do not treat $meta projection as inclusive [vkarpov15](https://github.com/vkarpov15) + +1.6.0 / 2015-05-27 +================== + + * update dependencies #65 [bachp](https://github.com/bachp) + +1.5.0 / 2015-03-31 +================== + + * fixed; debug output + * fixed; allow hint usage with count #61 [trueinsider](https://github.com/trueinsider) + +1.4.0 / 2015-03-29 +================== + + * added; object support to slice() #60 [vkarpov15](https://github.com/vkarpov15) + * debug; improved output #57 [flyvictor](https://github.com/flyvictor) + +1.3.0 / 2014-11-06 +================== + + * added; setTraceFunction() #53 from [jlai](https://github.com/jlai) + +1.2.1 / 2014-09-26 +================== + + * fixed; distinct assignment in toConstructor() #51 from [esco](https://github.com/esco) + +1.2.0 / 2014-09-18 +================== + + * added; stream() support for find() + +1.1.0 / 2014-09-15 +================== + + * add #then for co / koa support + * start checking code coverage + +1.0.0 / 2014-07-07 +================== + + * Remove broken require() calls until they're actually implemented #48 [vkarpov15](https://github.com/vkarpov15) + +0.9.0 / 2014-05-22 +================== + + * added; thunk() support + * release 0.8.0 + +0.8.0 / 2014-05-15 +================== + + * added; support for maxTimeMS #44 [yoitsro](https://github.com/yoitsro) + * updated; devDependency (driver to 1.4.4) + +0.7.0 / 2014-05-02 +================== + + * fixed; pass $maxDistance in $near object as described in docs #43 [vkarpov15](https://github.com/vkarpov15) + * fixed; cloning buffers #42 [gjohnson](https://github.com/gjohnson) + * tests; a little bit more `mongodb` agnostic #34 [refack](https://github.com/refack) + +0.6.0 / 2014-04-01 +================== + + * fixed; Allow $meta args in sort() so text search sorting works #37 [vkarpov15](https://github.com/vkarpov15) + +0.5.3 / 2014-02-22 +================== + + * fixed; cloning mongodb.Binary + +0.5.2 / 2014-01-30 +================== + + * fixed; cloning ObjectId constructors + * fixed; cloning of ReadPreferences #30 [ashtuchkin](https://github.com/ashtuchkin) + * tests; use specific mongodb version #29 [AvianFlu](https://github.com/AvianFlu) + * tests; remove dependency on ObjectId #28 [refack](https://github.com/refack) + * tests; add failing ReadPref test + +0.5.1 / 2014-01-17 +================== + + * added; deprecation notice to tags parameter #27 [ashtuchkin](https://github.com/ashtuchkin) + * readme; add links + +0.5.0 / 2014-01-16 +================== + + * removed; mongodb driver dependency #26 [ashtuchkin](https://github.com/ashtuchkin) + * removed; first class support of read preference tags #26 (still supported though) [ashtuchkin](https://github.com/ashtuchkin) + * added; better ObjectId clone support + * fixed; cloning objects that have no constructor #21 + * docs; cleaned up [ashtuchkin](https://github.com/ashtuchkin) + +0.4.2 / 2014-01-08 +================== + + * updated; debug module 0.7.4 [refack](https://github.com/refack) + +0.4.1 / 2014-01-07 +================== + + * fixed; inclusive/exclusive logic + +0.4.0 / 2014-01-06 +================== + + * added; selected() + * added; selectedInclusively() + * added; selectedExclusively() + +0.3.3 / 2013-11-14 +================== + + * Fix Mongo DB Dependency #20 [rschmukler](https://github.com/rschmukler) + +0.3.2 / 2013-09-06 +================== + + * added; geometry support for near() + +0.3.1 / 2013-08-22 +================== + + * fixed; update retains key order #19 + +0.3.0 / 2013-08-22 +================== + + * less hardcoded isNode env detection #18 [vshulyak](https://github.com/vshulyak) + * added; validation of findAndModify varients + * clone update doc before execution + * stricter env checks + +0.2.7 / 2013-08-2 +================== + + * Now support GeoJSON point values for Query#near + +0.2.6 / 2013-07-30 +================== + + * internally, 'asc' and 'desc' for sorts are now converted into 1 and -1, respectively + +0.2.5 / 2013-07-30 +================== + + * updated docs + * changed internal representation of `sort` to use objects instead of arrays + +0.2.4 / 2013-07-25 +================== + + * updated; sliced to 0.0.5 + +0.2.3 / 2013-07-09 +================== + + * now using a callback in collection.find instead of directly calling toArray() on the cursor [ebensing](https://github.com/ebensing) + +0.2.2 / 2013-07-09 +================== + + * now exposing mongodb export to allow for better testing [ebensing](https://github.com/ebensing) + +0.2.1 / 2013-07-08 +================== + + * select no longer accepts arrays as parameters [ebensing](https://github.com/ebensing) + +0.2.0 / 2013-07-05 +================== + + * use $geoWithin by default + +0.1.2 / 2013-07-02 +================== + + * added use$geoWithin flag [ebensing](https://github.com/ebensing) + * fix read preferences typo [ebensing](https://github.com/ebensing) + * fix reference to old param name in exists() [ebensing](https://github.com/ebensing) + +0.1.1 / 2013-06-24 +================== + + * fixed; $intersects -> $geoIntersects #14 [ebensing](https://github.com/ebensing) + * fixed; Retain key order when copying objects #15 [ebensing](https://github.com/ebensing) + * bump mongodb dev dep + +0.1.0 / 2013-05-06 +================== + + * findAndModify; return the query + * move mquery.proto.canMerge to mquery.canMerge + * overwrite option now works with non-empty objects + * use strict mode + * validate count options + * validate distinct options + * add aggregate to base collection methods + * clone merge arguments + * clone merged update arguments + * move subclass to mquery.prototype.toConstructor + * fixed; maxScan casing + * use regexp-clone + * added; geometry/intersects support + * support $and + * near: do not use "radius" + * callbacks always fire on next turn of loop + * defined collection interface + * remove time from tests + * clarify goals + * updated docs; + +0.0.1 / 2012-12-15 +================== + + * initial release diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/LICENSE b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/LICENSE new file mode 100644 index 00000000..38c529da --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/README.md b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/README.md new file mode 100644 index 00000000..86a06ebc --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/README.md @@ -0,0 +1,1387 @@ +# mquery + +`mquery` is a fluent mongodb query builder designed to run in multiple environments. + +[![Build Status](https://travis-ci.org/aheckmann/mquery.svg?branch=master)](https://travis-ci.org/aheckmann/mquery) +[![NPM version](https://badge.fury.io/js/mquery.svg)](http://badge.fury.io/js/mquery) + +[![npm](https://nodei.co/npm/mquery.png)](https://www.npmjs.com/package/mquery) + +## Features + +- fluent query builder api +- custom base query support +- MongoDB 2.4 geoJSON support +- method + option combinations validation +- node.js driver compatibility +- environment detection +- [debug](https://github.com/visionmedia/debug) support +- separated collection implementations for maximum flexibility + +## Use + +```js +const mongo = require('mongodb'); + +const client = new mongo.MongoClient(uri); +await client.connect(); +// get a collection +const collection = client.collection('artists'); + +// pass it to the constructor +await mquery(collection).find({...}); + +// or pass it to the collection method +const docs = await mquery().find({...}).collection(collection); + +// or better yet, create a custom query constructor that has it always set +const Artist = mquery(collection).toConstructor(); +const docs = await Artist().find(...).where(...); +``` + +`mquery` requires a collection object to work with. In the example above we just pass the collection object created using the official [MongoDB driver](https://github.com/mongodb/node-mongodb-native). + +## Fluent API + +- [mquery](#mquery) + - [Features](#features) + - [Use](#use) + - [Fluent API](#fluent-api) + - [Helpers](#helpers) + - [find()](#find) + - [findOne()](#findone) + - [countDocuments()](#countdocuments) + - [estimatedDocumentCount()](#estimateddocumentcount) + - [findOneAndUpdate()](#findoneandupdate) + - [findOneAndUpdate() options](#findoneandupdate-options) + - [findOneAndReplace()](#findoneandreplace) + - [findOneAndReplace() options](#findoneandreplace-options) + - [findOneAndRemove()](#findoneandremove) + - [findOneAndRemove() options](#findoneandremove-options) + - [distinct()](#distinct) + - [updateMany()](#updatemany) + - [updateOne()](#updateone) + - [replaceOne()](#replaceone) + - [deleteOne()](#deleteone) + - [deleteMany()](#deletemany) + - [exec()](#exec) + - [cursor()](#cursor) + - [stream()](#stream) + - [all()](#all) + - [and()](#and) + - [box()](#box) + - [circle()](#circle) + - [elemMatch()](#elemmatch) + - [equals()](#equals) + - [eq()](#eq) + - [exists()](#exists) + - [geometry()](#geometry) + - [gt()](#gt) + - [gte()](#gte) + - [in()](#in) + - [intersects()](#intersects) + - [lt()](#lt) + - [lte()](#lte) + - [maxDistance()](#maxdistance) + - [mod()](#mod) + - [ne()](#ne) + - [nin()](#nin) + - [nor()](#nor) + - [near()](#near) + - [Example](#example) + - [or()](#or) + - [polygon()](#polygon) + - [regex()](#regex) + - [select()](#select) + - [String syntax](#string-syntax) + - [selected()](#selected) + - [selectedInclusively()](#selectedinclusively) + - [selectedExclusively()](#selectedexclusively) + - [size()](#size) + - [slice()](#slice) + - [within()](#within) + - [where()](#where) + - [$where()](#where-1) + - [batchSize()](#batchsize) + - [collation()](#collation) + - [comment()](#comment) + - [hint()](#hint) + - [j()](#j) + - [limit()](#limit) + - [maxTime()](#maxtime) + - [skip()](#skip) + - [sort()](#sort) + - [read()](#read) + - [Preferences:](#preferences) + - [Preference Tags:](#preference-tags) + - [readConcern()](#readconcern) + - [Read Concern Level:](#read-concern-level) + - [writeConcern()](#writeconcern) + - [Write Concern:](#write-concern) + - [slaveOk()](#slaveok) + - [tailable()](#tailable) + - [wtimeout()](#wtimeout) + - [Helpers](#helpers-1) + - [collection()](#collection) + - [then()](#then) + - [merge(object)](#mergeobject) + - [setOptions(options)](#setoptionsoptions) + - [setOptions() options](#setoptions-options) + - [setTraceFunction(func)](#settracefunctionfunc) + - [mquery.setGlobalTraceFunction(func)](#mquerysetglobaltracefunctionfunc) + - [mquery.canMerge(conditions)](#mquerycanmergeconditions) + - [mquery.use$geoWithin](#mqueryusegeowithin) + - [Custom Base Queries](#custom-base-queries) + - [Validation](#validation) + - [Debug support](#debug-support) + - [General compatibility](#general-compatibility) + - [ObjectIds](#objectids) + - [Read Preferences](#read-preferences) + - [Future goals](#future-goals) + - [Installation](#installation) + - [License](#license) + +## Helpers + +- [collection](#collection) +- [then](#then) +- [merge](#mergeobject) +- [setOptions](#setoptionsoptions) +- [setTraceFunction](#settracefunctionfunc) +- [mquery.setGlobalTraceFunction](#mquerysetglobaltracefunctionfunc) +- [mquery.canMerge](#mquerycanmergeconditions) +- [mquery.use$geoWithin](#mqueryusegeowithin) + +### find() + +Declares this query a _find_ query. Optionally pass a match clause. + +```js +mquery().find() +mquery().find(match) +await mquery().find() +const docs = await mquery().find(match); +assert(Array.isArray(docs)); +``` + +### findOne() + +Declares this query a _findOne_ query. Optionally pass a match clause. + +```js +mquery().findOne() +mquery().findOne(match) +await mquery().findOne() +const doc = await mquery().findOne(match); +if (doc) { + // the document may not be found + console.log(doc); +} +``` + +### countDocuments() + +Declares this query a _countDocuments_ query. Optionally pass a match clause. + +```js +mquery().countDocuments() +mquery().countDocuments(match) +await mquery().countDocuments() +const number = await mquery().countDocuments(match); +console.log('we found %d matching documents', number); +``` + +### estimatedDocumentCount() + +Declares this query an _estimatedDocumentCount_ query. Gets an estimated count of documents in a collection using collection metadata. + +```js +mquery().estimatedDocumentCount() +const number = await mquery().estimatedDocumentCount(); +console.log('estimated documents: %d', number); +``` + +### findOneAndUpdate() + +Declares this query a _findAndModify_ with update query. Optionally pass a match clause, update document, options. + +When executed, the first matching document (if found) is modified according to the update document and passed back. + +#### findOneAndUpdate() options + +Options are passed to the `setOptions()` method. + +- `new`: boolean - true to return the modified document rather than the original. defaults to false +- `upsert`: boolean - creates the object if it doesn't exist. defaults to false +- `sort`: if multiple docs are found by the match condition, sets the sort order to choose which doc to update + +```js +query.findOneAndUpdate() +query.findOneAndUpdate(updateDocument) +query.findOneAndUpdate(match, updateDocument) +query.findOneAndUpdate(match, updateDocument, options) + +// the following all execute the command +await query.findOneAndUpdate() +await query.findOneAndUpdate(updateDocument) +await query.findOneAndUpdate(match, updateDocument) +const doc = await query.findOneAndUpdate(match, updateDocument, options); +if (doc) { + // the document may not be found + console.log(doc); +} +``` + +### findOneAndReplace() + +Declares this query a _findOneAndReplace_ query. Finds a matching document, replaces it with the provided replacement, and returns the found document (if any). + +#### findOneAndReplace() options + +Options are passed to the `setOptions()` method. + +- `new`: boolean - true to return the modified document rather than the original. defaults to false +- `upsert`: boolean - creates the object if it doesn't exist. defaults to false +- `sort`: if multiple docs are found by the match condition, sets the sort order to choose which doc to replace + +```js +query.findOneAndReplace() +query.findOneAndReplace(replacement) +query.findOneAndReplace(match, replacement) +query.findOneAndReplace(match, replacement, options) + +// the following all execute the command +await query.findOneAndReplace() +await query.findOneAndReplace(replacement) +await query.findOneAndReplace(match, replacement) +const doc = await query.findOneAndReplace(match, replacement, options); +if (doc) { + // the document may not be found + console.log(doc); +} +``` + +### findOneAndRemove() + +Declares this query a _findAndModify_ with remove query. Alias of findOneAndDelete. +Optionally pass a match clause, options. + +When executed, the first matching document (if found) is modified according to the update document, removed from the collection and passed as a result. + +#### findOneAndRemove() options + +Options are passed to the `setOptions()` method. + +- `sort`: if multiple docs are found by the condition, sets the sort order to choose which doc to modify and remove + +```js +A.where().findOneAndDelete() +A.where().findOneAndRemove() +A.where().findOneAndRemove(match) +A.where().findOneAndRemove(match, options) + +// the following all execute the command +await A.where().findOneAndRemove() +await A.where().findOneAndRemove(match) +const doc = await A.where().findOneAndRemove(match, options); +if (doc) { + // the document may not be found + console.log(doc); +} +``` + +### distinct() + +Declares this query a _distinct_ query. Optionally pass the distinct field, a match clause. + +```js +mquery().distinct() +mquery().distinct(match) +mquery().distinct(match, field) +mquery().distinct(field) + +// the following all execute the command +await mquery().distinct() +await mquery().distinct(field) +await mquery().distinct(match) +const result = await mquery().distinct(match, field); +console.log(result); +``` + +### updateMany() + +Declares this query an _updateMany_ query. Updates all documents that match `criteria`. + +When executed, the first argument is the query, and the second argument is the update document. + +_All paths passed that are not $atomic operations will become $set ops._ + +```js +mquery().updateMany({ name: /^match/ }, { field: 'value' }) +await mquery().updateMany({ name: /^match/ }, { field: 'value' }) +await mquery().where({ name: /^match/ }).updateMany({ field: 'value' }) +``` + +### updateOne() + +Declares this query an _updateOne_ query. Updates only the first document that matches `criteria`. + +When executed, the first argument is the query, and the second argument is the update document. + +_All paths passed that are not $atomic operations will become $set ops._ + +```js +mquery().updateOne({ name: 'match' }, { field: 'value' }) +await mquery().updateOne({ name: 'match' }, { field: 'value' }) +await mquery().where({ name: 'match' }).updateOne({ field: 'value' }) +``` + +### replaceOne() + +Declares this query a _replaceOne_ query. Replaces the first document that matches `criteria` with the provided replacement document. + +Similar to `updateOne()`, except `replaceOne()` is not allowed to use atomic modifiers (`$set`, `$push`, etc.). Calling `replaceOne()` will always replace the existing doc. + +```js +mquery().replaceOne({ _id: 1 }, { name: 'new name', age: 25 }) +await mquery().replaceOne({ _id: 1 }, { name: 'new name', age: 25 }) +``` + +### deleteOne() + +Declares this query a _deleteOne_ query. Deletes the first document that matches `criteria`. + +```js +mquery().deleteOne({ name: 'match' }) +await mquery().deleteOne({ name: 'match' }) +await mquery().where({ name: 'match' }).deleteOne() +``` + +### deleteMany() + +Declares this query a _deleteMany_ query. Deletes all documents that match `criteria`. + +```js +mquery().deleteMany({ name: /^match/ }) +await mquery().deleteMany({ name: /^match/ }) +await mquery().where({ name: /^match/ }).deleteMany() +``` + +### exec() + +Executes the query. + +```js +const docs = await mquery().findOne().where('route').intersects(polygon).exec() +``` + +### cursor() + +Returns a cursor for the given `find` query. + +```js +const cursor = mquery().find({ name: /^match/ }).cursor(); +cursor.on('data', function(doc) { + console.log(doc); +}); +cursor.on('end', function() { + console.log('done'); +}); +``` + +Note: this only works with `find()` operations. + +### stream() + +Executes the query and returns a stream. + +```js +var stream = mquery().find().stream(options); +stream.on('data', cb); +stream.on('close', fn); +``` + +Note: this only works with `find()` operations. + +Note: returns the stream object directly from the node-mongodb-native driver. (currently streams1 type stream). Any options will be passed along to the [driver method](http://mongodb.github.io/node-mongodb-native/api-generated/cursor.html#stream). + +--- + +### all() + +Specifies an `$all` query condition + +```js +mquery().where('permission').all(['read', 'write']) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/all/) + +### and() + +Specifies arguments for an `$and` condition + +```js +mquery().and([{ color: 'green' }, { status: 'ok' }]) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/and/) + +### box() + +Specifies a `$box` condition + +```js +var lowerLeft = [40.73083, -73.99756] +var upperRight= [40.741404, -73.988135] + +mquery().where('location').within().box(lowerLeft, upperRight) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/box/) + +### circle() + +Specifies a `$center` or `$centerSphere` condition. + +```js +var area = { center: [50, 50], radius: 10, unique: true } +query.where('loc').within().circle(area) +query.circle('loc', area); + +// for spherical calculations +var area = { center: [50, 50], radius: 10, unique: true, spherical: true } +query.where('loc').within().circle(area) +query.circle('loc', area); +``` + +- [MongoDB Documentation - center](http://docs.mongodb.org/manual/reference/operator/center/) +- [MongoDB Documentation - centerSphere](http://docs.mongodb.org/manual/reference/operator/centerSphere/) + +### elemMatch() + +Specifies an `$elemMatch` condition + +```js +query.where('comment').elemMatch({ author: 'autobot', votes: {$gte: 5}}) + +query.elemMatch('comment', function (elem) { + elem.where('author').equals('autobot'); + elem.where('votes').gte(5); +}) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/elemMatch/) + +### equals() + +Specifies the complementary comparison value for the path specified with `where()`. + +```js +mquery().where('age').equals(49); + +// is the same as + +mquery().where({ 'age': 49 }); +``` + +### eq() + +Alias of `equals()`. Specifies the complementary comparison value for the path specified with `where()`. + +```js +mquery().where('age').eq(49); + +// is the same as + +mquery().where('age').equals(49); + +// is the same as + +mquery().where({ 'age': 49 }); +``` + +### exists() + +Specifies an `$exists` condition + +```js +// { name: { $exists: true }} +mquery().where('name').exists() +mquery().where('name').exists(true) +mquery().exists('name') + +// { name: { $exists: false }} +mquery().where('name').exists(false); +mquery().exists('name', false); +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/exists/) + +### geometry() + +Specifies a `$geometry` condition + +```js +var polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] +query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) + +// or +var polyB = [[ 0, 0 ], [ 1, 1 ]] +query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) + +// or +var polyC = [ 0, 0 ] +query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) + +// or +query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) + +// or +query.where('loc').near().geometry({ type: 'Point', coordinates: [3,5] }) +``` + +`geometry()` **must** come after `intersects()`, `within()`, or `near()`. + +The `object` argument must contain `type` and `coordinates` properties. + +- type `String` +- coordinates `Array` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/geometry/) + +### gt() + +Specifies a `$gt` query condition. + +```js +mquery().where('clicks').gt(999) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/gt/) + +### gte() + +Specifies a `$gte` query condition. + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/gte/) + +```js +mquery().where('clicks').gte(1000) +``` + +### in() + +Specifies an `$in` query condition. + +```js +mquery().where('author_id').in([3, 48901, 761]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/in/) + +### intersects() + +Declares an `$geoIntersects` query for `geometry()`. + +```js +query.where('path').intersects().geometry({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}) + +// geometry arguments are supported +query.where('path').intersects({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}) +``` + +**Must** be used after `where()`. + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/geoIntersects/) + +### lt() + +Specifies a `$lt` query condition. + +```js +mquery().where('clicks').lt(50) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/lt/) + +### lte() + +Specifies a `$lte` query condition. + +```js +mquery().where('clicks').lte(49) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/lte/) + +### maxDistance() + +Specifies a `$maxDistance` query condition. + +```js +mquery().where('location').near({ center: [139, 74.3] }).maxDistance(5) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/maxDistance/) + +### mod() + +Specifies a `$mod` condition + +```js +mquery().where('count').mod(2, 0) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/mod/) + +### ne() + +Specifies a `$ne` query condition. + +```js +mquery().where('status').ne('ok') +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/ne/) + +### nin() + +Specifies an `$nin` query condition. + +```js +mquery().where('author_id').nin([3, 48901, 761]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/nin/) + +### nor() + +Specifies arguments for an `$nor` condition. + +```js +mquery().nor([{ color: 'green' }, { status: 'ok' }]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/nor/) + +### near() + +Specifies arguments for a `$near` or `$nearSphere` condition. + +These operators return documents sorted by distance. + +#### Example + +```js +query.where('loc').near({ center: [10, 10] }); +query.where('loc').near({ center: [10, 10], maxDistance: 5 }); +query.near('loc', { center: [10, 10], maxDistance: 5 }); + +// GeoJSON +query.where('loc').near({ center: { type: 'Point', coordinates: [10, 10] }}); +query.where('loc').near({ center: { type: 'Point', coordinates: [10, 10] }, maxDistance: 5, spherical: true }); +query.where('loc').near().geometry({ type: 'Point', coordinates: [10, 10] }); + +// For a $nearSphere condition, pass the `spherical` option. +query.near({ center: [10, 10], maxDistance: 5, spherical: true }); +``` + +[MongoDB Documentation](http://www.mongodb.org/display/DOCS/Geospatial+Indexing) + +### or() + +Specifies arguments for an `$or` condition. + +```js +mquery().or([{ color: 'red' }, { status: 'emergency' }]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/or/) + +### polygon() + +Specifies a `$polygon` condition + +```js +mquery().where('loc').within().polygon([10,20], [13, 25], [7,15]) +mquery().polygon('loc', [10,20], [13, 25], [7,15]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/polygon/) + +### regex() + +Specifies a `$regex` query condition. + +```js +mquery().where('name').regex(/^sixstepsrecords/) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/regex/) + +### select() + +Specifies which document fields to include or exclude + +```js +// 1 means include, 0 means exclude +mquery().select({ name: 1, address: 1, _id: 0 }) + +// or + +mquery().select('name address -_id') +``` + +#### String syntax + +When passing a string, prefixing a path with `-` will flag that path as excluded. When a path does not have the `-` prefix, it is included. + +```js +// include a and b, exclude c +query.select('a b -c'); + +// or you may use object notation, useful when +// you have keys already prefixed with a "-" +query.select({a: 1, b: 1, c: 0}); +``` + +_Cannot be used with `distinct()`._ + +### selected() + +Determines if the query has selected any fields. + +```js +var query = mquery(); +query.selected() // false +query.select('-name'); +query.selected() // true +``` + +### selectedInclusively() + +Determines if the query has selected any fields inclusively. + +```js +var query = mquery().select('name'); +query.selectedInclusively() // true + +var query = mquery(); +query.selected() // false +query.select('-name'); +query.selectedInclusively() // false +query.selectedExclusively() // true +``` + +### selectedExclusively() + +Determines if the query has selected any fields exclusively. + +```js +var query = mquery().select('-name'); +query.selectedExclusively() // true + +var query = mquery(); +query.selected() // false +query.select('name'); +query.selectedExclusively() // false +query.selectedInclusively() // true +``` + +### size() + +Specifies a `$size` query condition. + +```js +mquery().where('someArray').size(6) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/size/) + +### slice() + +Specifies a `$slice` projection for a `path` + +```js +mquery().where('comments').slice(5) +mquery().where('comments').slice(-5) +mquery().where('comments').slice([-10, 5]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/projection/slice/) + +### within() + +Sets a `$geoWithin` or `$within` argument for geo-spatial queries. + +```js +mquery().within().box() +mquery().within().circle() +mquery().within().geometry() + +mquery().where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); +mquery().where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); +mquery().where('loc').within({ polygon: [[],[],[],[]] }); + +mquery().where('loc').within([], [], []) // polygon +mquery().where('loc').within([], []) // box +mquery().where('loc').within({ type: 'LineString', coordinates: [...] }); // geometry +``` + +As of mquery 2.0, `$geoWithin` is used by default. This impacts you if running MongoDB < 2.4. To alter this behavior, see [mquery.use$geoWithin](#mqueryusegeowithin). + +**Must** be used after `where()`. + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/geoWithin/) + +### where() + +Specifies a `path` for use with chaining + +```js +// instead of writing: +mquery().find({age: {$gte: 21, $lte: 65}}); + +// we can instead write: +mquery().where('age').gte(21).lte(65); + +// passing query conditions is permitted too +mquery().find().where({ name: 'vonderful' }) + +// chaining +await mquery() + .where('age').gte(21).lte(65) + .where({ 'name': /^vonderful/i }) + .where('friends').slice(10) + .exec() +``` + +### $where() + +Specifies a `$where` condition. + +Use `$where` when you need to select documents using a JavaScript expression. + +```js +await query.$where('this.comments.length > 10 || this.name.length > 5').exec() + +query.$where(function () { + return this.comments.length > 10 || this.name.length > 5; +}) +``` + +Only use `$where` when you have a condition that cannot be met using other MongoDB operators like `$lt`. Be sure to read about all of [its caveats](http://docs.mongodb.org/manual/reference/operator/where/) before using. + +--- + +### batchSize() + +Specifies the batchSize option. + +```js +query.batchSize(100) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.batchSize/) + +### collation() + +Specifies the collation option. + +```js +query.collation({ locale: "en_US", strength: 1 }) +``` + +[MongoDB documentation](https://docs.mongodb.com/manual/reference/method/cursor.collation/#cursor.collation) + +### comment() + +Specifies the comment option. + +```js +query.comment('login query'); +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/) + +### hint() + +Sets query hints. + +```js +mquery().hint({ indexA: 1, indexB: -1 }) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/hint/) + +### j() + +Requests acknowledgement that this operation has been persisted to MongoDB's on-disk journal. + +This option is only valid for operations that write to the database: + +- `deleteOne()` +- `deleteMany()` +- `findOneAndDelete()` +- `findOneAndUpdate()` +- `updateOne()` +- `updateMany()` + +Defaults to the `j` value if it is specified in [writeConcern](#writeconcern) + +```js +mquery().j(true); +``` + +### limit() + +Specifies the limit option. + +```js +query.limit(20) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.limit/) + +### maxTime() + +Specifies the maxTimeMS option. + +```js +query.maxTime(100) +query.maxTimeMS(100) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.maxTimeMS/) + +### skip() + +Specifies the skip option. + +```js +query.skip(100).limit(20) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.skip/) + +### sort() + +Sets the query sort order. + +If an object is passed, key values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. + +If a string is passed, it must be a space delimited list of path names. The sort order of each path is ascending unless the path name is prefixed with `-` which will be treated as descending. + +```js +// these are equivalent +query.sort({ field: 'asc', test: -1 }); +query.sort('field -test'); +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.sort/) + +### read() + +Sets the readPreference option for the query. + +```js +mquery().read('primary') +mquery().read('p') // same as primary + +mquery().read('primaryPreferred') +mquery().read('pp') // same as primaryPreferred + +mquery().read('secondary') +mquery().read('s') // same as secondary + +mquery().read('secondaryPreferred') +mquery().read('sp') // same as secondaryPreferred + +mquery().read('nearest') +mquery().read('n') // same as nearest + +mquery().setReadPreference('primary') // alias of .read() +``` + +#### Preferences: + +- `primary` - (default) Read from primary only. Operations will produce an error if primary is unavailable. Cannot be combined with tags. +- `secondary` - Read from secondary if available, otherwise error. +- `primaryPreferred` - Read from primary if available, otherwise a secondary. +- `secondaryPreferred` - Read from a secondary if available, otherwise read from the primary. +- `nearest` - All operations read from among the nearest candidates, but unlike other modes, this option will include both the primary and all secondaries in the random selection. + +Aliases + +- `p` primary +- `pp` primaryPreferred +- `s` secondary +- `sp` secondaryPreferred +- `n` nearest + +#### Preference Tags: + +To keep the separation of concerns between `mquery` and your driver +clean, `mquery#read()` no longer handles specifying a second `tags` argument as of version 0.5. +If you need to specify tags, pass any non-string argument as the first argument. +`mquery` will pass this argument untouched to your collections methods later. +For example: + +```js +// example of specifying tags using the Node.js driver +var ReadPref = require('mongodb').ReadPreference; +var preference = new ReadPref('secondary', [{ dc:'sf', s: 1 },{ dc:'ma', s: 2 }]); +mquery(...).read(preference).exec(); +``` + +Read more about how to use read preferences [here](http://docs.mongodb.org/manual/applications/replication/#read-preference) and [here](http://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences). + +### readConcern() + +Sets the readConcern option for the query. + +```js +// local +mquery().readConcern('local') +mquery().readConcern('l') +mquery().r('l') + +// available +mquery().readConcern('available') +mquery().readConcern('a') +mquery().r('a') + +// majority +mquery().readConcern('majority') +mquery().readConcern('m') +mquery().r('m') + +// linearizable +mquery().readConcern('linearizable') +mquery().readConcern('lz') +mquery().r('lz') + +// snapshot +mquery().readConcern('snapshot') +mquery().readConcern('s') +mquery().r('s') +``` + +#### Read Concern Level: + +- `local` - The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). (MongoDB 3.2+) +- `available` - The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). (MongoDB 3.6+) +- `majority` - The query returns the data that has been acknowledged by a majority of the replica set members. The documents returned by the read operation are durable, even in the event of failure. (MongoDB 3.2+) +- `linearizable` - The query returns data that reflects all successful majority-acknowledged writes that completed prior to the start of the read operation. The query may wait for concurrently executing writes to propagate to a majority of replica set members before returning results. (MongoDB 3.4+) +- `snapshot` - Only available for operations within multi-document transactions. Upon transaction commit with write concern "majority", the transaction operations are guaranteed to have read from a snapshot of majority-committed data. (MongoDB 4.0+) + +Aliases + +- `l` local +- `a` available +- `m` majority +- `lz` linearizable +- `s` snapshot + +Read more about how to use read concern [here](https://docs.mongodb.com/manual/reference/read-concern/). + +### writeConcern() + +Sets the writeConcern option for the query. + +This option is only valid for operations that write to the database: + +- `deleteOne()` +- `deleteMany()` +- `findOneAndDelete()` +- `findOneAndUpdate()` +- `updateOne()` +- `updateMany()` + +```js +mquery().writeConcern(0) +mquery().writeConcern(1) +mquery().writeConcern({ w: 1, j: true, wtimeout: 2000 }) +mquery().writeConcern('majority') +mquery().writeConcern('m') // same as majority +mquery().writeConcern('tagSetName') // if the tag set is 'm', use .writeConcern({ w: 'm' }) instead +mquery().w(1) // w is alias of writeConcern +``` + +#### Write Concern: + +writeConcern({ w: ``, j: ``, wtimeout: `` }`) + +- the w option to request acknowledgement that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags +- the j option to request acknowledgement that the write operation has been written to the journal +- the wtimeout option to specify a time limit to prevent write operations from blocking indefinitely + +Can be break down to use the following syntax: + +mquery().w(``).j(``).wtimeout(``) + +Read more about how to use write concern [here](https://docs.mongodb.com/manual/reference/write-concern/) + +### slaveOk() + +Sets the slaveOk option. `true` allows reading from secondaries. + +**deprecated** use [read()](#read) preferences instead if on mongodb >= 2.2 + +```js +query.slaveOk() // true +query.slaveOk(true) +query.slaveOk(false) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/rs.slaveOk/) + +### tailable() + +Sets tailable option. + +```js +mquery().tailable() <== true +mquery().tailable(true) +mquery().tailable(false) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB Documentation](http://docs.mongodb.org/manual/tutorial/create-tailable-cursor/) + +### wtimeout() + +Specifies a time limit, in milliseconds, for the write concern. If `w > 1`, it is maximum amount of time to +wait for this write to propagate through the replica set before this operation fails. The default is `0`, which means no timeout. + +This option is only valid for operations that write to the database: + +- `deleteOne()` +- `deleteMany()` +- `findOneAndDelete()` +- `findOneAndUpdate()` +- `updateOne()` +- `updateMany()` + +Defaults to `wtimeout` value if it is specified in [writeConcern](#writeconcern) + +```js +mquery().wtimeout(2000) +mquery().wTimeout(2000) +``` + +## Helpers + +### collection() + +Sets the querys collection. + +```js +mquery().collection(aCollection) +``` + +### then() + +Executes the query and returns a promise which will be resolved with the query results or rejected if the query responds with an error. + +```js +mquery().find(..).then(success, error); +``` + +This is very useful when combined with [co](https://github.com/visionmedia/co) or [koa](https://github.com/koajs/koa), which automatically resolve promise-like objects for you. + +```js +co(function*(){ + var doc = yield mquery().findOne({ _id: 499 }); + console.log(doc); // { _id: 499, name: 'amazing', .. } +})(); +``` + +_NOTE_: +The returned promise is a [bluebird](https://github.com/petkaantonov/bluebird/) promise but this is customizable. If you want to +use your favorite promise library, simply set `mquery.Promise = YourPromiseConstructor`. +Your `Promise` must be [promises A+](http://promisesaplus.com/) compliant. + +### merge(object) + +Merges other mquery or match condition objects into this one. When an mquery instance is passed, its match conditions, field selection and options are merged. + +```js +const drum = mquery({ type: 'drum' }).collection(instruments); +const redDrum = mquery({ color: 'red' }).merge(drum); +const n = await redDrum.count(); +console.log('there are %d red drums', n); +``` + +Internally uses `mquery.canMerge` to determine validity. + +### setOptions(options) + +Sets query options. + +```js +mquery().setOptions({ collection: coll, limit: 20 }) +``` + +#### setOptions() options + +- [tailable](#tailable) * +- [sort](#sort) * +- [limit](#limit) * +- [skip](#skip) * +- [maxTime](#maxtime) * +- [batchSize](#batchsize) * +- [comment](#comment) * +- [hint](#hint) * +- [collection](#collection): the collection to query against + +_* denotes a query helper method is also available_ + +### setTraceFunction(func) + +Set a function to trace this query. Useful for profiling or logging. + +```js +function traceFunction (method, queryInfo, query) { + console.log('starting ' + method + ' query'); + + return function (err, result, millis) { + console.log('finished ' + method + ' query in ' + millis + 'ms'); + }; +} + +mquery().setTraceFunction(traceFunction).findOne({name: 'Joe'}, cb); +``` + +The trace function is passed (method, queryInfo, query) + +- method is the name of the method being called (e.g. findOne) +- queryInfo contains information about the query: + - conditions: query conditions/criteria + - options: options such as sort, fields, etc + - doc: document being updated +- query is the query object + +The trace function should return a callback function which accepts: +- err: error, if any +- result: result, if any +- millis: time spent waiting for query result + +NOTE: stream requests are not traced. + +### mquery.setGlobalTraceFunction(func) + +Similar to `setTraceFunction()` but automatically applied to all queries. + +```js +mquery.setTraceFunction(traceFunction); +``` + +### mquery.canMerge(conditions) + +Determines if `conditions` can be merged using `mquery().merge()`. + +```js +var query = mquery({ type: 'drum' }); +var okToMerge = mquery.canMerge(anObject) +if (okToMerge) { + query.merge(anObject); +} +``` + +## mquery.use$geoWithin + +MongoDB 2.4 introduced the `$geoWithin` operator which replaces and is 100% backward compatible with `$within`. As of mquery 0.2, we default to using `$geoWithin` for all `within()` calls. + +If you are running MongoDB < 2.4 this will be problematic. To force `mquery` to be backward compatible and always use `$within`, set the `mquery.use$geoWithin` flag to `false`. + +```js +mquery.use$geoWithin = false; +``` + +## Custom Base Queries + +Often times we want custom base queries that encapsulate predefined criteria. With `mquery` this is easy. First create the query you want to reuse and call its `toConstructor()` method which returns a new subclass of `mquery` that retains all options and criteria of the original. + +```js +var greatMovies = mquery(movieCollection).where('rating').gte(4.5).toConstructor(); + +// use it! +const n = await greatMovies().count(); +console.log('There are %d great movies', n); + +const docs = await greatMovies().where({ name: /^Life/ }).select('name').find(); +console.log(docs); +``` + +## Validation + +Method and options combinations are checked for validity at runtime to prevent creation of invalid query constructs. For example, a `distinct` query does not support specifying options like `hint` or field selection. In this case an error will be thrown so you can catch these mistakes in development. + +## Debug support + +Debug mode is provided through the use of the [debug](https://github.com/visionmedia/debug) module. To enable: + +```sh +DEBUG=mquery node yourprogram.js +``` + +Read the debug module documentation for more details. + +## General compatibility + +### ObjectIds + +`mquery` clones query arguments before passing them to a `collection` method for execution. +This prevents accidental side-affects to the objects you pass. +To clone `ObjectIds` we need to make some assumptions. + +First, to check if an object is an `ObjectId`, we check its constructors name. If it matches either +`ObjectId` or `ObjectID` we clone it. + +To clone `ObjectIds`, we call its optional `clone` method. If a `clone` method does not exist, we fall +back to calling `new obj.constructor(obj.id)`. We assume, for compatibility with the +Node.js driver, that the `ObjectId` instance has a public `id` property and that +when creating an `ObjectId` instance we can pass that `id` as an argument. + +#### Read Preferences + +`mquery` supports specifying [Read Preferences](https://www.mongodb.com/docs/manual/core/read-preference/) to control from which MongoDB node your query will read. +The Read Preferences spec also support specifying tags. To pass tags, some +drivers (Node.js driver) require passing a special constructor that handles both the read preference and its tags. +If you need to specify tags, pass an instance of your drivers ReadPreference constructor or roll your own. `mquery` will store whatever you provide and pass later to your collection during execution. + +## Future goals + +- mongo shell compatibility +- browser compatibility + +## Installation + +```sh +npm install mquery +``` + +## License + +[MIT](https://github.com/aheckmann/mquery/blob/master/LICENSE) diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/SECURITY.md b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/SECURITY.md new file mode 100644 index 00000000..41b89d83 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/SECURITY.md @@ -0,0 +1 @@ +Please follow the instructions on [Tidelift's security page](https://tidelift.com/docs/security) to report a security issue. diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/collection.js b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/collection.js new file mode 100644 index 00000000..10366ca9 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/collection.js @@ -0,0 +1,47 @@ +'use strict'; + +/** + * methods a collection must implement + */ + +const methods = [ + 'find', + 'findOne', + 'updateMany', + 'updateOne', + 'replaceOne', + 'countDocuments', + 'estimatedDocumentCount', + 'distinct', + 'findOneAndDelete', + 'findOneAndReplace', + 'findOneAndUpdate', + 'aggregate', + 'findCursor', + 'deleteOne', + 'deleteMany' +]; + +/** + * Collection base class from which implementations inherit + */ + +function Collection() {} + +for (let i = 0, len = methods.length; i < len; ++i) { + const method = methods[i]; + Collection.prototype[method] = notImplemented(method); +} + +module.exports = exports = Collection; +Collection.methods = methods; + +/** + * creates a function which throws an implementation error + */ + +function notImplemented(method) { + return function() { + throw new Error('collection.' + method + ' not implemented'); + }; +} diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/index.js b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/index.js new file mode 100644 index 00000000..4faa0322 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/index.js @@ -0,0 +1,13 @@ +'use strict'; + +const env = require('../env'); + +if ('unknown' == env.type) { + throw new Error('Unknown environment'); +} + +module.exports = + env.isNode ? require('./node') : + env.isMongo ? require('./collection') : + require('./collection'); + diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/node.js b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/node.js new file mode 100644 index 00000000..d12983c5 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/collection/node.js @@ -0,0 +1,128 @@ +'use strict'; + +/** + * Module dependencies + */ + +const Collection = require('./collection'); + +class NodeCollection extends Collection { + constructor(col) { + super(); + + this.collection = col; + this.collectionName = col.collectionName; + } + + /** + * find(match, options) + */ + async find(match, options) { + const cursor = this.collection.find(match, options); + + return cursor.toArray(); + } + + /** + * findOne(match, options) + */ + async findOne(match, options) { + return this.collection.findOne(match, options); + } + + /** + * countDocuments(match, options) + */ + async countDocuments(match, options) { + return this.collection.countDocuments(match, options); + } + + /** + * estimatedDocumentCount(match, options) + */ + async estimatedDocumentCount(match, options) { + return this.collection.estimatedDocumentCount(match, options); + } + + /** + * distinct(prop, match, options) + */ + async distinct(prop, match, options) { + return this.collection.distinct(prop, match, options); + } + + /** + * updateMany(match, update, options) + */ + async updateMany(match, update, options) { + return this.collection.updateMany(match, update, options); + } + + /** + * updateOne(match, update, options) + */ + async updateOne(match, update, options) { + return this.collection.updateOne(match, update, options); + } + + /** + * replaceOne(match, update, options) + */ + async replaceOne(match, update, options) { + return this.collection.replaceOne(match, update, options); + } + + /** + * deleteOne(match, options) + */ + async deleteOne(match, options) { + return this.collection.deleteOne(match, options); + } + + /** + * deleteMany(match, options) + */ + async deleteMany(match, options) { + return this.collection.deleteMany(match, options); + } + + /** + * findOneAndDelete(match, options, function(err[, result]) + */ + async findOneAndDelete(match, options) { + return this.collection.findOneAndDelete(match, options); + } + + /** + * findOneAndUpdate(match, update, options) + */ + async findOneAndUpdate(match, update, options) { + return this.collection.findOneAndUpdate(match, update, options); + } + + /** + * findOneAndReplace(match, update, options) + */ + async findOneAndReplace(match, update, options) { + return this.collection.findOneAndReplace(match, update, options); + } + + /** + * var cursor = findCursor(match, options) + */ + findCursor(match, options) { + return this.collection.find(match, options); + } + + /** + * aggregation(operators...) + * TODO + */ +} + + +/** + * Expose + */ + +module.exports = exports = NodeCollection; diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/env.js b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/env.js new file mode 100644 index 00000000..d3d225b7 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/env.js @@ -0,0 +1,22 @@ +'use strict'; + +exports.isNode = 'undefined' != typeof process + && 'object' == typeof module + && 'object' == typeof global + && 'function' == typeof Buffer + && process.argv; + +exports.isMongo = !exports.isNode + && 'function' == typeof printjson + && 'function' == typeof ObjectId + && 'function' == typeof rs + && 'function' == typeof sh; + +exports.isBrowser = !exports.isNode + && !exports.isMongo + && 'undefined' != typeof window; + +exports.type = exports.isNode ? 'node' + : exports.isMongo ? 'mongo' + : exports.isBrowser ? 'browser' + : 'unknown'; diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/mquery.js b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/mquery.js new file mode 100644 index 00000000..3aae9f45 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/mquery.js @@ -0,0 +1,2748 @@ +'use strict'; + +/** + * Dependencies + */ + +const assert = require('assert'); +const util = require('util'); +const utils = require('./utils'); + +const debug = util.debuglog('mquery'); + +/** + * Query constructor used for building queries. + * + * #### Example: + * + * var query = new Query({ name: 'mquery' }); + * query.setOptions({ collection: moduleCollection }) + * await query.where('age').gte(21).exec(); + * + * @param {Object} [criteria] criteria for the query OR the collection instance to use + * @param {Object} [options] + * @api public + */ + +function Query(criteria, options) { + if (!(this instanceof Query)) + return new Query(criteria, options); + + const proto = this.constructor.prototype; + + this.op = proto.op || undefined; + + this.options = Object.assign({}, proto.options); + + this._conditions = proto._conditions + ? utils.clone(proto._conditions) + : {}; + + this._fields = proto._fields + ? utils.clone(proto._fields) + : undefined; + + this._updateDoc = proto._updateDoc + ? utils.clone(proto._updateDoc) + : undefined; + + this._path = proto._path || undefined; + this._distinctDoc = proto._distinctDoc || undefined; + this._collection = proto._collection || undefined; + this._traceFunction = proto._traceFunction || undefined; + + if (options) { + this.setOptions(options); + } + + if (criteria) { + this.find(criteria); + } +} + +/** + * Converts this query to a constructor function with all arguments and options retained. + * + * #### Example: + * + * // Create a query that will read documents with a "video" category from + * // `aCollection` on the primary node in the replica-set unless it is down, + * // in which case we'll read from a secondary node. + * var query = mquery({ category: 'video' }) + * query.setOptions({ collection: aCollection, read: 'primaryPreferred' }); + * + * // create a constructor based off these settings + * var Video = query.toConstructor(); + * + * // Video is now a subclass of mquery() and works the same way but with the + * // default query parameters and options set. + * + * // run a query with the previous settings but filter for movies with names + * // that start with "Life". + * Video().where({ name: /^Life/ }).exec(cb); + * + * @return {Query} new Query + * @api public + */ + +Query.prototype.toConstructor = function toConstructor() { + function CustomQuery(criteria, options) { + if (!(this instanceof CustomQuery)) + return new CustomQuery(criteria, options); + Query.call(this, criteria, options); + } + + utils.inherits(CustomQuery, Query); + + // set inherited defaults + const p = CustomQuery.prototype; + + p.options = {}; + p.setOptions(this.options); + + p.op = this.op; + p._conditions = utils.clone(this._conditions); + p._fields = utils.clone(this._fields); + p._updateDoc = utils.clone(this._updateDoc); + p._path = this._path; + p._distinctDoc = this._distinctDoc; + p._collection = this._collection; + p._traceFunction = this._traceFunction; + + return CustomQuery; +}; + +/** + * Sets query options. + * + * #### Options: + * + * - [tailable](http://www.mongodb.org/display/DOCS/Tailable+Cursors) * + * - [sort](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsort(\)%7D%7D) * + * - [limit](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Blimit%28%29%7D%7D) * + * - [skip](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D) * + * - [maxTime](http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS/#op._S_maxTimeMS) * + * - [batchSize](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7BbatchSize%28%29%7D%7D) * + * - [comment](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24comment) * + * - [hint](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24hint) * + * - [slaveOk](http://docs.mongodb.org/manual/applications/replication/#read-preference) * + * - [safe](http://www.mongodb.org/display/DOCS/getLastError+Command) + * - collection the collection to query against + * + * _* denotes a query helper method is also available_ + * + * @param {Object} options + * @api public + */ + +Query.prototype.setOptions = function(options) { + if (!(options && utils.isObject(options))) + return this; + + // set arbitrary options + const methods = utils.keys(options); + let method; + + for (let i = 0; i < methods.length; ++i) { + method = methods[i]; + + // use methods if exist (safer option manipulation) + if ('function' == typeof this[method]) { + const args = Array.isArray(options[method]) + ? options[method] + : [options[method]]; + this[method].apply(this, args); + } else { + this.options[method] = options[method]; + } + } + + return this; +}; + +/** + * Sets this Querys collection. + * + * @param {Collection} coll + * @return {Query} this + */ + +Query.prototype.collection = function collection(coll) { + this._collection = new Query.Collection(coll); + + return this; +}; + +/** + * Adds a collation to this op (MongoDB 3.4 and up) + * + * #### Example: + * + * query.find().collation({ locale: "en_US", strength: 1 }) + * + * @param {Object} value + * @return {Query} this + * @see MongoDB docs https://docs.mongodb.com/manual/reference/method/cursor.collation/#cursor.collation + * @api public + */ + +Query.prototype.collation = function(value) { + this.options.collation = value; + return this; +}; + +/** + * Specifies a `$where` condition + * + * Use `$where` when you need to select documents using a JavaScript expression. + * + * #### Example: + * + * query.$where('this.comments.length > 10 || this.name.length > 5') + * + * query.$where(function () { + * return this.comments.length > 10 || this.name.length > 5; + * }) + * + * @param {String|Function} js javascript string or function + * @return {Query} this + * @memberOf Query + * @method $where + * @api public + */ + +Query.prototype.$where = function(js) { + this._conditions.$where = js; + return this; +}; + +/** + * Specifies a `path` for use with chaining. + * + * #### Example: + * + * // instead of writing: + * await User.find({age: {$gte: 21, $lte: 65}}); + * + * // we can instead write: + * User.where('age').gte(21).lte(65); + * + * // passing query conditions is permitted + * User.find().where({ name: 'vonderful' }) + * + * // chaining + * await User + * .where('age').gte(21).lte(65) + * .where('name', /^vonderful/i) + * .where('friends').slice(10) + * .exec() + * + * @param {String} [path] + * @param {Object} [val] + * @return {Query} this + * @api public + */ + +Query.prototype.where = function() { + if (!arguments.length) return this; + if (!this.op) this.op = 'find'; + + const type = typeof arguments[0]; + + if ('string' == type) { + this._path = arguments[0]; + + if (2 === arguments.length) { + this._conditions[this._path] = arguments[1]; + } + + return this; + } + + if ('object' == type && !Array.isArray(arguments[0])) { + return this.merge(arguments[0]); + } + + throw new TypeError('path must be a string or object'); +}; + +/** + * Specifies the complementary comparison value for paths specified with `where()` + * + * #### Example: + * + * User.where('age').equals(49); + * + * // is the same as + * + * User.where('age', 49); + * + * @param {Object} val + * @return {Query} this + * @api public + */ + +Query.prototype.equals = function equals(val) { + this._ensurePath('equals'); + const path = this._path; + this._conditions[path] = val; + return this; +}; + +/** + * Specifies the complementary comparison value for paths specified with `where()` + * This is alias of `equals` + * + * #### Example: + * + * User.where('age').eq(49); + * + * // is the same as + * + * User.shere('age').equals(49); + * + * // is the same as + * + * User.where('age', 49); + * + * @param {Object} val + * @return {Query} this + * @api public + */ + +Query.prototype.eq = function eq(val) { + this._ensurePath('eq'); + const path = this._path; + this._conditions[path] = val; + return this; +}; + +/** + * Specifies arguments for an `$or` condition. + * + * #### Example: + * + * query.or([{ color: 'red' }, { status: 'emergency' }]) + * + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +Query.prototype.or = function or(array) { + const or = this._conditions.$or || (this._conditions.$or = []); + if (!Array.isArray(array)) array = [array]; + or.push.apply(or, array); + return this; +}; + +/** + * Specifies arguments for a `$nor` condition. + * + * #### Example: + * + * query.nor([{ color: 'green' }, { status: 'ok' }]) + * + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +Query.prototype.nor = function nor(array) { + const nor = this._conditions.$nor || (this._conditions.$nor = []); + if (!Array.isArray(array)) array = [array]; + nor.push.apply(nor, array); + return this; +}; + +/** + * Specifies arguments for a `$and` condition. + * + * #### Example: + * + * query.and([{ color: 'green' }, { status: 'ok' }]) + * + * @see $and http://docs.mongodb.org/manual/reference/operator/and/ + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +Query.prototype.and = function and(array) { + const and = this._conditions.$and || (this._conditions.$and = []); + if (!Array.isArray(array)) array = [array]; + and.push.apply(and, array); + return this; +}; + +/** + * Specifies a $gt query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * #### Example: + * + * Thing.find().where('age').gt(21) + * + * // or + * Thing.find().gt('age', 21) + * + * @method gt + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $gte query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method gte + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $lt query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lt + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $lte query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lte + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $ne query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method ne + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies an $in query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method in + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies an $nin query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method nin + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies an $all query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method all + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $size query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method size + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $regex query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method regex + * @memberOf Query + * @param {String} [path] + * @param {String|RegExp} val + * @api public + */ + +/** + * Specifies a $maxDistance query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method maxDistance + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/*! + * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance + * + * Thing.where('type').nin(array) + */ + +'gt gte lt lte ne in nin all regex size maxDistance minDistance'.split(' ').forEach(function($conditional) { + Query.prototype[$conditional] = function() { + let path, val; + + if (1 === arguments.length) { + this._ensurePath($conditional); + val = arguments[0]; + path = this._path; + } else { + val = arguments[1]; + path = arguments[0]; + } + + const conds = this._conditions[path] === null || typeof this._conditions[path] === 'object' ? + this._conditions[path] : + (this._conditions[path] = {}); + conds['$' + $conditional] = val; + return this; + }; +}); + +/** + * Specifies a `$mod` condition + * + * @param {String} [path] + * @param {Number} val + * @return {Query} this + * @api public + */ + +Query.prototype.mod = function() { + let val, path; + + if (1 === arguments.length) { + this._ensurePath('mod'); + val = arguments[0]; + path = this._path; + } else if (2 === arguments.length && !Array.isArray(arguments[1])) { + this._ensurePath('mod'); + val = [arguments[0], arguments[1]]; + path = this._path; + } else if (3 === arguments.length) { + val = [arguments[1], arguments[2]]; + path = arguments[0]; + } else { + val = arguments[1]; + path = arguments[0]; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$mod = val; + return this; +}; + +/** + * Specifies an `$exists` condition + * + * #### Example: + * + * // { name: { $exists: true }} + * Thing.where('name').exists() + * Thing.where('name').exists(true) + * Thing.find().exists('name') + * + * // { name: { $exists: false }} + * Thing.where('name').exists(false); + * Thing.find().exists('name', false); + * + * @param {String} [path] + * @param {Number} val + * @return {Query} this + * @api public + */ + +Query.prototype.exists = function() { + let path, val; + + if (0 === arguments.length) { + this._ensurePath('exists'); + path = this._path; + val = true; + } else if (1 === arguments.length) { + if ('boolean' === typeof arguments[0]) { + this._ensurePath('exists'); + path = this._path; + val = arguments[0]; + } else { + path = arguments[0]; + val = true; + } + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$exists = val; + return this; +}; + +/** + * Specifies an `$elemMatch` condition + * + * #### Example: + * + * query.elemMatch('comment', { author: 'autobot', votes: {$gte: 5}}) + * + * query.where('comment').elemMatch({ author: 'autobot', votes: {$gte: 5}}) + * + * query.elemMatch('comment', function (elem) { + * elem.where('author').equals('autobot'); + * elem.where('votes').gte(5); + * }) + * + * query.where('comment').elemMatch(function (elem) { + * elem.where({ author: 'autobot' }); + * elem.where('votes').gte(5); + * }) + * + * @param {String|Object|Function} path + * @param {Object|Function} criteria + * @return {Query} this + * @api public + */ + +Query.prototype.elemMatch = function() { + if (null == arguments[0]) + throw new TypeError('Invalid argument'); + + let fn, path, criteria; + + if ('function' === typeof arguments[0]) { + this._ensurePath('elemMatch'); + path = this._path; + fn = arguments[0]; + } else if (utils.isObject(arguments[0])) { + this._ensurePath('elemMatch'); + path = this._path; + criteria = arguments[0]; + } else if ('function' === typeof arguments[1]) { + path = arguments[0]; + fn = arguments[1]; + } else if (arguments[1] && utils.isObject(arguments[1])) { + path = arguments[0]; + criteria = arguments[1]; + } else { + throw new TypeError('Invalid argument'); + } + + if (fn) { + criteria = new Query; + fn(criteria); + criteria = criteria._conditions; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$elemMatch = criteria; + return this; +}; + +// Spatial queries + +/** + * Sugar for geo-spatial queries. + * + * #### Example: + * + * query.within().box() + * query.within().circle() + * query.within().geometry() + * + * query.where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); + * query.where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); + * query.where('loc').within({ polygon: [[],[],[],[]] }); + * + * query.where('loc').within([], [], []) // polygon + * query.where('loc').within([], []) // box + * query.where('loc').within({ type: 'LineString', coordinates: [...] }); // geometry + * + * #### Note: + * + * Must be used after `where()`. + * + * @memberOf Query + * @return {Query} this + * @api public + */ + +Query.prototype.within = function within() { + // opinionated, must be used after where + this._ensurePath('within'); + this._geoComparison = '$geoWithin'; + + if (0 === arguments.length) { + return this; + } + + if (2 === arguments.length) { + return this.box.apply(this, arguments); + } else if (2 < arguments.length) { + return this.polygon.apply(this, arguments); + } + + const area = arguments[0]; + + if (!area) + throw new TypeError('Invalid argument'); + + if (area.center) + return this.circle(area); + + if (area.box) + return this.box.apply(this, area.box); + + if (area.polygon) + return this.polygon.apply(this, area.polygon); + + if (area.type && area.coordinates) + return this.geometry(area); + + throw new TypeError('Invalid argument'); +}; + +/** + * Specifies a $box condition + * + * #### Example: + * + * var lowerLeft = [40.73083, -73.99756] + * var upperRight= [40.741404, -73.988135] + * + * query.where('loc').within().box(lowerLeft, upperRight) + * query.box('loc', lowerLeft, upperRight ) + * + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @see Query#within #query_Query-within + * @param {String} path + * @param {Object} val + * @return {Query} this + * @api public + */ + +Query.prototype.box = function() { + let path, box; + + if (3 === arguments.length) { + // box('loc', [], []) + path = arguments[0]; + box = [arguments[1], arguments[2]]; + } else if (2 === arguments.length) { + // box([], []) + this._ensurePath('box'); + path = this._path; + box = [arguments[0], arguments[1]]; + } else { + throw new TypeError('Invalid argument'); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison || '$geoWithin'] = { $box: box }; + return this; +}; + +/** + * Specifies a $polygon condition + * + * #### Example: + * + * query.where('loc').within().polygon([10,20], [13, 25], [7,15]) + * query.polygon('loc', [10,20], [13, 25], [7,15]) + * + * @param {String|Array} [path] + * @param {Array|Object} [val] + * @return {Query} this + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +Query.prototype.polygon = function() { + let val, path; + + if ('string' == typeof arguments[0]) { + // polygon('loc', [],[],[]) + val = Array.from(arguments); + path = val.shift(); + } else { + // polygon([],[],[]) + this._ensurePath('polygon'); + path = this._path; + val = Array.from(arguments); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison || '$geoWithin'] = { $polygon: val }; + return this; +}; + +/** + * Specifies a $center or $centerSphere condition. + * + * #### Example: + * + * var area = { center: [50, 50], radius: 10, unique: true } + * query.where('loc').within().circle(area) + * query.center('loc', area); + * + * // for spherical calculations + * var area = { center: [50, 50], radius: 10, unique: true, spherical: true } + * query.where('loc').within().circle(area) + * query.center('loc', area); + * + * @param {String} [path] + * @param {Object} area + * @return {Query} this + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +Query.prototype.circle = function() { + let path, val; + + if (1 === arguments.length) { + this._ensurePath('circle'); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } else { + throw new TypeError('Invalid argument'); + } + + if (!('radius' in val && val.center)) + throw new Error('center and radius are required'); + + const conds = this._conditions[path] || (this._conditions[path] = {}); + + const type = val.spherical + ? '$centerSphere' + : '$center'; + + const wKey = this._geoComparison || '$geoWithin'; + conds[wKey] = {}; + conds[wKey][type] = [val.center, val.radius]; + + if ('unique' in val) + conds[wKey].$uniqueDocs = !!val.unique; + + return this; +}; + +/** + * Specifies a `$near` or `$nearSphere` condition + * + * These operators return documents sorted by distance. + * + * #### Example: + * + * query.where('loc').near({ center: [10, 10] }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5 }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5, spherical: true }); + * query.near('loc', { center: [10, 10], maxDistance: 5 }); + * query.near({ center: { type: 'Point', coordinates: [..] }}) + * query.near().geometry({ type: 'Point', coordinates: [..] }) + * + * @param {String} [path] + * @param {Object} val + * @return {Query} this + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +Query.prototype.near = function near() { + let path, val; + + this._geoComparison = '$near'; + + if (0 === arguments.length) { + return this; + } else if (1 === arguments.length) { + this._ensurePath('near'); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } else { + throw new TypeError('Invalid argument'); + } + + if (!val.center) { + throw new Error('center is required'); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + + const type = val.spherical + ? '$nearSphere' + : '$near'; + + // center could be a GeoJSON object or an Array + if (Array.isArray(val.center)) { + conds[type] = val.center; + + const radius = 'maxDistance' in val + ? val.maxDistance + : null; + + if (null != radius) { + conds.$maxDistance = radius; + } + if (null != val.minDistance) { + conds.$minDistance = val.minDistance; + } + } else { + // GeoJSON? + if (val.center.type != 'Point' || !Array.isArray(val.center.coordinates)) { + throw new Error(util.format('Invalid GeoJSON specified for %s', type)); + } + conds[type] = { $geometry: val.center }; + + // MongoDB 2.6 insists on maxDistance being in $near / $nearSphere + if ('maxDistance' in val) { + conds[type]['$maxDistance'] = val.maxDistance; + } + if ('minDistance' in val) { + conds[type]['$minDistance'] = val.minDistance; + } + } + + return this; +}; + +/** + * Declares an intersects query for `geometry()`. + * + * #### Example: + * + * query.where('path').intersects().geometry({ + * type: 'LineString' + * , coordinates: [[180.0, 11.0], [180, 9.0]] + * }) + * + * query.where('path').intersects({ + * type: 'LineString' + * , coordinates: [[180.0, 11.0], [180, 9.0]] + * }) + * + * @param {Object} [arg] + * @return {Query} this + * @api public + */ + +Query.prototype.intersects = function intersects() { + // opinionated, must be used after where + this._ensurePath('intersects'); + + this._geoComparison = '$geoIntersects'; + + if (0 === arguments.length) { + return this; + } + + const area = arguments[0]; + + if (null != area && area.type && area.coordinates) + return this.geometry(area); + + throw new TypeError('Invalid argument'); +}; + +/** + * Specifies a `$geometry` condition + * + * #### Example: + * + * var polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] + * query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) + * + * // or + * var polyB = [[ 0, 0 ], [ 1, 1 ]] + * query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) + * + * // or + * var polyC = [ 0, 0 ] + * query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) + * + * // or + * query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) + * + * #### Note: + * + * `geometry()` **must** come after either `intersects()` or `within()`. + * + * The `object` argument must contain `type` and `coordinates` properties. + * - type {String} + * - coordinates {Array} + * + * The most recent path passed to `where()` is used. + * + * @param {Object} object Must contain a `type` property which is a String and a `coordinates` property which is an Array. See the examples. + * @return {Query} this + * @see http://docs.mongodb.org/manual/release-notes/2.4/#new-geospatial-indexes-with-geojson-and-improved-spherical-geometry + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @see $geometry http://docs.mongodb.org/manual/reference/operator/geometry/ + * @api public + */ + +Query.prototype.geometry = function geometry() { + if (!('$within' == this._geoComparison || + '$geoWithin' == this._geoComparison || + '$near' == this._geoComparison || + '$geoIntersects' == this._geoComparison)) { + throw new Error('geometry() must come after `within()`, `intersects()`, or `near()'); + } + + let val, path; + + if (1 === arguments.length) { + this._ensurePath('geometry'); + path = this._path; + val = arguments[0]; + } else { + throw new TypeError('Invalid argument'); + } + + if (!(val.type && Array.isArray(val.coordinates))) { + throw new TypeError('Invalid argument'); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison] = { $geometry: val }; + + return this; +}; + +// end spatial + +/** + * Specifies which document fields to include or exclude + * + * #### String syntax + * + * When passing a string, prefixing a path with `-` will flag that path as excluded. When a path does not have the `-` prefix, it is included. + * + * #### Example: + * + * // include a and b, exclude c + * query.select('a b -c'); + * + * // or you may use object notation, useful when + * // you have keys already prefixed with a "-" + * query.select({a: 1, b: 1, c: 0}); + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @param {Object|String} arg + * @return {Query} this + * @see SchemaType + * @api public + */ + +Query.prototype.select = function select() { + let arg = arguments[0]; + if (!arg) return this; + + if (arguments.length !== 1) { + throw new Error('Invalid select: select only takes 1 argument'); + } + + this._validate('select'); + + const fields = this._fields || (this._fields = {}); + const type = typeof arg; + let i, len; + + if (('string' == type || utils.isArgumentsObject(arg)) && + 'number' == typeof arg.length || Array.isArray(arg)) { + if ('string' == type) + arg = arg.split(/\s+/); + + for (i = 0, len = arg.length; i < len; ++i) { + let field = arg[i]; + if (!field) continue; + const include = '-' == field[0] ? 0 : 1; + if (include === 0) field = field.substring(1); + fields[field] = include; + } + + return this; + } + + if (utils.isObject(arg)) { + const keys = utils.keys(arg); + for (i = 0; i < keys.length; ++i) { + fields[keys[i]] = arg[keys[i]]; + } + return this; + } + + throw new TypeError('Invalid select() argument. Must be string or object.'); +}; + +/** + * Specifies a $slice condition for a `path` + * + * #### Example: + * + * query.slice('comments', 5) + * query.slice('comments', -5) + * query.slice('comments', [10, 5]) + * query.where('comments').slice(5) + * query.where('comments').slice([-10, 5]) + * + * @param {String} [path] + * @param {Number} val number/range of elements to slice + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields#RetrievingaSubsetofFields-RetrievingaSubrangeofArrayElements + * @api public + */ + +Query.prototype.slice = function() { + if (0 === arguments.length) + return this; + + this._validate('slice'); + + let path, val; + + if (1 === arguments.length) { + const arg = arguments[0]; + if (typeof arg === 'object' && !Array.isArray(arg)) { + const keys = Object.keys(arg); + const numKeys = keys.length; + for (let i = 0; i < numKeys; ++i) { + this.slice(keys[i], arg[keys[i]]); + } + return this; + } + this._ensurePath('slice'); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + if ('number' === typeof arguments[0]) { + this._ensurePath('slice'); + path = this._path; + val = [arguments[0], arguments[1]]; + } else { + path = arguments[0]; + val = arguments[1]; + } + } else if (3 === arguments.length) { + path = arguments[0]; + val = [arguments[1], arguments[2]]; + } + + const myFields = this._fields || (this._fields = {}); + myFields[path] = { $slice: val }; + return this; +}; + +/** + * Sets the sort order + * + * If an object is passed, values allowed are 'asc', 'desc', 'ascending', 'descending', 1, and -1. + * + * If a string is passed, it must be a space delimited list of path names. The sort order of each path is ascending unless the path name is prefixed with `-` which will be treated as descending. + * + * #### Example: + * + * // these are equivalent + * query.sort({ field: 'asc', test: -1 }); + * query.sort('field -test'); + * query.sort([['field', 1], ['test', -1]]); + * + * #### Note: + * + * - The array syntax `.sort([['field', 1], ['test', -1]])` can only be used with [mongodb driver >= 2.0.46](https://github.com/mongodb/node-mongodb-native/blob/2.1/HISTORY.md#2046-2015-10-15). + * - Cannot be used with `distinct()` + * + * @param {Object|String|Array} arg + * @return {Query} this + * @api public + */ + +Query.prototype.sort = function(arg) { + if (!arg) return this; + let i, len, field; + + this._validate('sort'); + + const type = typeof arg; + + // .sort([['field', 1], ['test', -1]]) + if (Array.isArray(arg)) { + len = arg.length; + for (i = 0; i < arg.length; ++i) { + if (!Array.isArray(arg[i])) { + throw new Error('Invalid sort() argument, must be array of arrays'); + } + _pushArr(this.options, arg[i][0], arg[i][1]); + } + return this; + } + + // .sort('field -test') + if (1 === arguments.length && 'string' == type) { + arg = arg.split(/\s+/); + len = arg.length; + for (i = 0; i < len; ++i) { + field = arg[i]; + if (!field) continue; + const ascend = '-' == field[0] ? -1 : 1; + if (ascend === -1) field = field.substring(1); + push(this.options, field, ascend); + } + + return this; + } + + // .sort({ field: 1, test: -1 }) + if (utils.isObject(arg)) { + const keys = utils.keys(arg); + for (i = 0; i < keys.length; ++i) { + field = keys[i]; + push(this.options, field, arg[field]); + } + + return this; + } + + if (typeof Map !== 'undefined' && arg instanceof Map) { + _pushMap(this.options, arg); + return this; + } + throw new TypeError('Invalid sort() argument. Must be a string, object, or array.'); +}; + +/*! + * @ignore + */ + +const _validSortValue = { + 1: 1, + '-1': -1, + asc: 1, + ascending: 1, + desc: -1, + descending: -1 +}; + +function push(opts, field, value) { + if (Array.isArray(opts.sort)) { + throw new TypeError('Can\'t mix sort syntaxes. Use either array or object:' + + '\n- `.sort([[\'field\', 1], [\'test\', -1]])`' + + '\n- `.sort({ field: 1, test: -1 })`'); + } + + let s; + if (value && value.$meta) { + s = opts.sort || (opts.sort = {}); + s[field] = { $meta: value.$meta }; + return; + } + + s = opts.sort || (opts.sort = {}); + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError('Invalid sort value: { ' + field + ': ' + value + ' }'); + + s[field] = val; +} + +function _pushArr(opts, field, value) { + opts.sort = opts.sort || []; + if (!Array.isArray(opts.sort)) { + throw new TypeError('Can\'t mix sort syntaxes. Use either array or object:' + + '\n- `.sort([[\'field\', 1], [\'test\', -1]])`' + + '\n- `.sort({ field: 1, test: -1 })`'); + } + + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError('Invalid sort value: [ ' + field + ', ' + value + ' ]'); + + opts.sort.push([field, val]); +} + +function _pushMap(opts, map) { + opts.sort = opts.sort || new Map(); + if (!(opts.sort instanceof Map)) { + throw new TypeError('Can\'t mix sort syntaxes. Use either array or ' + + 'object or map consistently'); + } + map.forEach(function(value, key) { + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError('Invalid sort value: < ' + key + ': ' + value + ' >'); + + opts.sort.set(key, val); + }); +} + + +/** + * Specifies the limit option. + * + * #### Example: + * + * query.limit(20) + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method limit + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Blimit%28%29%7D%7D + * @api public + */ +/** + * Specifies the skip option. + * + * #### Example: + * + * query.skip(100).limit(20) + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method skip + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D + * @api public + */ +/** + * Specifies the batchSize option. + * + * #### Example: + * + * query.batchSize(100) + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method batchSize + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7BbatchSize%28%29%7D%7D + * @api public + */ +/** + * Specifies the `comment` option. + * + * #### Example: + * + * query.comment('login query') + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @method comment + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24comment + * @api public + */ + +/*! + * limit, skip, batchSize, comment + * + * Sets these associated options. + * + * query.comment('feed query'); + */ + +['limit', 'skip', 'batchSize', 'comment'].forEach(function(method) { + Query.prototype[method] = function(v) { + this._validate(method); + this.options[method] = v; + return this; + }; +}); + +/** + * Specifies the maxTimeMS option. + * + * #### Example: + * + * query.maxTime(100) + * query.maxTimeMS(100) + * + * @method maxTime + * @memberOf Query + * @param {Number} ms + * @see mongodb http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS/#op._S_maxTimeMS + * @api public + */ + +Query.prototype.maxTime = Query.prototype.maxTimeMS = function(ms) { + this._validate('maxTime'); + this.options.maxTimeMS = ms; + return this; +}; + +/** + * Sets query hints. + * + * #### Example: + * + * query.hint({ indexA: 1, indexB: -1}); + * query.hint('indexA_1_indexB_1'); + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @param {Object|string} val a hint object or the index name + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24hint + * @api public + */ + +Query.prototype.hint = function() { + if (0 === arguments.length) return this; + + this._validate('hint'); + + const arg = arguments[0]; + if (utils.isObject(arg)) { + const hint = this.options.hint || (this.options.hint = {}); + + // must keep object keys in order so don't use Object.keys() + for (const k in arg) { + hint[k] = arg[k]; + } + + return this; + } + if (typeof arg === 'string') { + this.options.hint = arg; + return this; + } + + throw new TypeError('Invalid hint. ' + arg); +}; + +/** + * Requests acknowledgement that this operation has been persisted to MongoDB's + * on-disk journal. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndUpdate()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the `j` value if it is specified in writeConcern options + * + * #### Example: + * + * mquery().w(2).j(true).wtimeout(2000); + * + * @method j + * @memberOf Query + * @instance + * @param {boolean} val + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#j-option + * @return {Query} this + * @api public + */ + +Query.prototype.j = function j(val) { + this.options.j = val; + return this; +}; + +/** + * Sets the slaveOk option. _Deprecated_ in MongoDB 2.2 in favor of read preferences. + * + * #### Example: + * + * query.slaveOk() // true + * query.slaveOk(true) + * query.slaveOk(false) + * + * @deprecated use read() preferences instead if on mongodb >= 2.2 + * @param {Boolean} v defaults to true + * @see mongodb http://docs.mongodb.org/manual/applications/replication/#read-preference + * @see read() + * @return {Query} this + * @api public + */ + +Query.prototype.slaveOk = function(v) { + this.options.slaveOk = arguments.length ? !!v : true; + return this; +}; + +/** + * Sets the readPreference option for the query. + * + * #### Example: + * + * new Query().read('primary') + * new Query().read('p') // same as primary + * + * new Query().read('primaryPreferred') + * new Query().read('pp') // same as primaryPreferred + * + * new Query().read('secondary') + * new Query().read('s') // same as secondary + * + * new Query().read('secondaryPreferred') + * new Query().read('sp') // same as secondaryPreferred + * + * new Query().read('nearest') + * new Query().read('n') // same as nearest + * + * // you can also use mongodb.ReadPreference class to also specify tags + * new Query().read(mongodb.ReadPreference('secondary', [{ dc:'sf', s: 1 },{ dc:'ma', s: 2 }])) + * + * new Query().setReadPreference('primary') // alias of .read() + * + * #### Preferences: + * + * primary - (default) Read from primary only. Operations will produce an error if primary is unavailable. Cannot be combined with tags. + * secondary Read from secondary if available, otherwise error. + * primaryPreferred Read from primary if available, otherwise a secondary. + * secondaryPreferred Read from a secondary if available, otherwise read from the primary. + * nearest All operations read from among the nearest candidates, but unlike other modes, this option will include both the primary and all secondaries in the random selection. + * + * Aliases + * + * p primary + * pp primaryPreferred + * s secondary + * sp secondaryPreferred + * n nearest + * + * Read more about how to use read preferences [here](http://docs.mongodb.org/manual/applications/replication/#read-preference) and [here](http://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences). + * + * @param {String|ReadPreference} pref one of the listed preference options or their aliases + * @see mongodb http://docs.mongodb.org/manual/applications/replication/#read-preference + * @see driver http://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences + * @return {Query} this + * @api public + */ + +Query.prototype.read = Query.prototype.setReadPreference = function(pref) { + if (arguments.length > 1 && !Query.prototype.read.deprecationWarningIssued) { + console.error('Deprecation warning: \'tags\' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead.'); + Query.prototype.read.deprecationWarningIssued = true; + } + this.options.readPreference = utils.readPref(pref); + return this; +}; + +/** + * Sets the readConcern option for the query. + * + * #### Example: + * + * new Query().readConcern('local') + * new Query().readConcern('l') // same as local + * + * new Query().readConcern('available') + * new Query().readConcern('a') // same as available + * + * new Query().readConcern('majority') + * new Query().readConcern('m') // same as majority + * + * new Query().readConcern('linearizable') + * new Query().readConcern('lz') // same as linearizable + * + * new Query().readConcern('snapshot') + * new Query().readConcern('s') // same as snapshot + * + * new Query().r('s') // r is alias of readConcern + * + * + * #### Read Concern Level: + * + * local MongoDB 3.2+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * available MongoDB 3.6+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * majority MongoDB 3.2+ The query returns the data that has been acknowledged by a majority of the replica set members. The documents returned by the read operation are durable, even in the event of failure. + * linearizable MongoDB 3.4+ The query returns data that reflects all successful majority-acknowledged writes that completed prior to the start of the read operation. The query may wait for concurrently executing writes to propagate to a majority of replica set members before returning results. + * snapshot MongoDB 4.0+ Only available for operations within multi-document transactions. Upon transaction commit with write concern "majority", the transaction operations are guaranteed to have read from a snapshot of majority-committed data. + * + * Aliases + * + * l local + * a available + * m majority + * lz linearizable + * s snapshot + * + * Read more about how to use read concern [here](https://docs.mongodb.com/manual/reference/read-concern/). + * + * @param {String} level one of the listed read concern level or their aliases + * @see mongodb https://docs.mongodb.com/manual/reference/read-concern/ + * @return {Query} this + * @api public + */ + +Query.prototype.readConcern = Query.prototype.r = function(level) { + this.options.readConcern = utils.readConcern(level); + return this; +}; + +/** + * Sets tailable option. + * + * #### Example: + * + * query.tailable() <== true + * query.tailable(true) + * query.tailable(false) + * + * #### Note: + * + * Cannot be used with `distinct()` + * + * @param {Boolean} v defaults to true + * @see mongodb http://www.mongodb.org/display/DOCS/Tailable+Cursors + * @api public + */ + +Query.prototype.tailable = function() { + this._validate('tailable'); + + this.options.tailable = arguments.length + ? !!arguments[0] + : true; + + return this; +}; + +/** + * Sets the specified number of `mongod` servers, or tag set of `mongod` servers, + * that must acknowledge this write before this write is considered successful. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndUpdate()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the `w` value if it is specified in writeConcern options + * + * #### Example: + * + * mquery().writeConcern(0) + * mquery().writeConcern(1) + * mquery().writeConcern({ w: 1, j: true, wtimeout: 2000 }) + * mquery().writeConcern('majority') + * mquery().writeConcern('m') // same as majority + * mquery().writeConcern('tagSetName') // if the tag set is 'm', use .writeConcern({ w: 'm' }) instead + * mquery().w(1) // w is alias of writeConcern + * + * @method writeConcern + * @memberOf Query + * @instance + * @param {String|number|object} concern 0 for fire-and-forget, 1 for acknowledged by one server, 'majority' for majority of the replica set, or [any of the more advanced options](https://docs.mongodb.com/manual/reference/write-concern/#w-option). + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#w-option + * @return {Query} this + * @api public + */ + +Query.prototype.writeConcern = Query.prototype.w = function writeConcern(concern) { + if ('object' === typeof concern) { + if ('undefined' !== typeof concern.j) this.options.j = concern.j; + if ('undefined' !== typeof concern.w) this.options.w = concern.w; + if ('undefined' !== typeof concern.wtimeout) this.options.wtimeout = concern.wtimeout; + } else { + this.options.w = 'm' === concern ? 'majority' : concern; + } + return this; +}; + +/** + * Specifies a time limit, in milliseconds, for the write concern. + * If `ms > 1`, it is maximum amount of time to wait for this write + * to propagate through the replica set before this operation fails. + * The default is `0`, which means no timeout. + * + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndUpdate()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to `wtimeout` value if it is specified in writeConcern + * + * #### Example: + * + * mquery().w(2).j(true).wtimeout(2000) + * + * @method wtimeout + * @memberOf Query + * @instance + * @param {number} ms number of milliseconds to wait + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#wtimeout + * @return {Query} this + * @api public + */ + +Query.prototype.wtimeout = Query.prototype.wTimeout = function wtimeout(ms) { + this.options.wtimeout = ms; + return this; +}; + +/** + * Merges another Query or conditions object into this one. + * + * When a Query is passed, conditions, field selection and options are merged. + * + * @param {Query|Object} source + * @return {Query} this + */ + +Query.prototype.merge = function(source) { + if (!source) + return this; + + if (!Query.canMerge(source)) + throw new TypeError('Invalid argument. Expected instanceof mquery or plain object'); + + if (source instanceof Query) { + // if source has a feature, apply it to ourselves + + if (source._conditions) { + utils.merge(this._conditions, source._conditions); + } + + if (source._fields) { + this._fields || (this._fields = {}); + utils.merge(this._fields, source._fields); + } + + if (source.options) { + this.options || (this.options = {}); + utils.merge(this.options, source.options); + } + + if (source._updateDoc) { + this._updateDoc || (this._updateDoc = {}); + utils.mergeClone(this._updateDoc, source._updateDoc); + } + + if (source._distinctDoc) { + this._distinctDoc = source._distinctDoc; + } + + return this; + } + + // plain object + utils.merge(this._conditions, source); + + return this; +}; + +/** + * Finds documents. + * + * #### Example: + * + * query.find() + * await query.find() + * await query.find({ name: 'Burning Lights' }) + * + * @param {Object} [criteria] mongodb selector + * @return {Query} this + * @api public + */ + +Query.prototype.find = function(criteria) { + this.op = 'find'; + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + return this; +}; + +/** + * Executes a `find` Query + * @returns the result + */ +Query.prototype._find = async function _find() { + const conds = this._conditions; + const options = this._optionsForExec(); + + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + debug('find', this._collection.collectionName, conds, options); + + return this._collection.find(conds, options); +}; + +/** + * Returns the query cursor + * + * #### Examples: + * + * query.find().cursor(); + * query.cursor({ name: 'Burning Lights' }); + * + * @param {Object} [criteria] mongodb selector + * @return {Object} cursor + * @api public + */ + +Query.prototype.cursor = function cursor(criteria) { + if (this.op) { + if (this.op !== 'find') { + throw new TypeError('.cursor only support .find method'); + } + } else { + this.find(criteria); + } + + const conds = this._conditions; + const options = this._optionsForExec(); + + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + debug('findCursor', this._collection.collectionName, conds, options); + + return this._collection.findCursor(conds, options); +}; + +/** + * Executes the query as a findOne() operation. + * + * #### Example: + * + * query.findOne().where('name', /^Burning/); + * + * query.findOne({ name: /^Burning/ }) + * + * await query.findOne({ name: /^Burning/ }); // executes + * + * @param {Object|Query} [criteria] mongodb selector + * @return {Query} this + * @api public + */ + +Query.prototype.findOne = function(criteria) { + this.op = 'findOne'; + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + return this; +}; + +/** + * Executes a `findOne` Query + * @returns the results + */ +Query.prototype._findOne = async function _findOne() { + const conds = this._conditions; + const options = this._optionsForExec(); + + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + debug('findOne', this._collection.collectionName, conds, options); + + return this._collection.findOne(conds, options); +}; + +/** + * Executes the query as a countDocuments() operation. + * + * #### Example: + * + * query.countDocuments().where('color', 'black').exec(); + * + * query.countDocuments({ color: 'black' }) + * + * await query.countDocuments({ color: 'black' }); + * + * const count = await query.where('color', 'black').countDocuments(); + * console.log('there are %d kittens', count); + * + * @param {Object} [filter] mongodb selector + * @return {Query} this + * @api public + */ + +Query.prototype.countDocuments = function(filter) { + this.op = 'countDocuments'; + this._validate(); + + if (Query.canMerge(filter)) { + this.merge(filter); + } + + return this; +}; + +/** + * Executes a `countDocuments` Query + * @returns the results + */ +Query.prototype._countDocuments = async function _countDocuments() { + const conds = this._conditions; + const options = this._optionsForExec(); + + debug('countDocuments', this._collection.collectionName, conds, options); + + return this._collection.countDocuments(conds, options); +}; + +/** + * Executes the query as a estimatedDocumentCount() operation. + * + * #### Example: + * + * query.estimatedDocumentCount(); + * + * const count = await query.estimatedDocumentCount(); + * console.log('there are %d kittens', count); + * + * @return {Query} this + * @api public + */ + +Query.prototype.estimatedDocumentCount = function() { + this.op = 'estimatedDocumentCount'; + this._validate(); + + return this; +}; + +/** + * Executes a `count` Query + * @returns the results + */ +Query.prototype._estimatedDocumentCount = async function _estimatedDocumentCount() { + const conds = this._conditions; + const options = this._optionsForExec(); + debug('estimatedDocumentCount', this._collection.collectionName, conds, options); + return this._collection.estimatedDocumentCount(conds, options); +}; + +/** + * Declares or executes a distinct() operation. + * + * #### Example: + * + * await distinct(criteria, field) + * distinct(criteria, field) + * await distinct(field) + * distinct(field) + * await distinct() + * distinct() + * + * @param {Object|Query} [criteria] + * @param {String} [field] + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Distinct + * @api public + */ + +Query.prototype.distinct = function(criteria, field) { + this.op = 'distinct'; + this._validate(); + + if (!field && typeof criteria === 'string') { + field = criteria; + criteria = undefined; + } + + if ('string' == typeof field) { + this._distinctDoc = field; + } + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + return this; +}; + +/** + * Executes a `distinct` Query + * @returns the results + */ +Query.prototype._distinct = async function _distinct() { + if (!this._distinctDoc) { + throw new Error('No value for `distinct` has been declared'); + } + + const conds = this._conditions, + options = this._optionsForExec(); + + return this._collection.distinct(this._distinctDoc, conds, options); +}; + +/** + * Declare and/or execute this query as an `updateMany()` operation. This function will update _all_ documents that match + * `criteria`, rather than just the first one. + * + * _All paths passed that are not $atomic operations will become $set ops._ + * + * #### Example: + * + * // Update every document whose `title` contains 'test' + * mquery().updateMany({ title: /test/ }, { year: 2017 }) + * + * @param {Object} [criteria] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @return {Query} this + * @api public + */ + +Query.prototype.updateMany = function updateMany(criteria, doc, options) { + return _update(this, 'updateMany', criteria, doc, options); +}; + +/** + * Executes a `updateMany` Query + * @returns the results + */ +Query.prototype._updateMany = async function() { + return _updateExec(this, 'updateMany'); +}; + +/** + * Declare and/or execute this query as an `updateOne()` operation. This function will _always_ update just one document, + * regardless of the `multi` option. + * + * _All paths passed that are not $atomic operations will become $set ops._ + * + * #### Example: + * + * // Update the first document whose `title` contains 'test' + * mquery().updateMany({ title: /test/ }, { year: 2017 }) + * + * @param {Object} [criteria] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @return {Query} this + * @api public + */ + +Query.prototype.updateOne = function updateOne(criteria, doc, options) { + return _update(this, 'updateOne', criteria, doc, options); +}; + +/** + * Executes a `updateOne` Query + * @returns the results + */ +Query.prototype._updateOne = async function() { + return _updateExec(this, 'updateOne'); +}; + +/** + * Declare and/or execute this query as an `replaceOne()` operation. Similar + * to `updateOne()`, except `replaceOne()` is not allowed to use atomic + * modifiers (`$set`, `$push`, etc.). Calling `replaceOne()` will always + * replace the existing doc. + * + * #### Example: + * + * // Replace the document with `_id` 1 with `{ _id: 1, year: 2017 }` + * mquery().replaceOne({ _id: 1 }, { year: 2017 }) + * + * @param {Object} [criteria] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @return {Query} this + * @api public + */ + +Query.prototype.replaceOne = function replaceOne(criteria, doc, options) { + this.setOptions({ overwrite: true }); + return _update(this, 'replaceOne', criteria, doc, options); +}; + +/** + * Executes a `replaceOne` Query + * @returns the results + */ +Query.prototype._replaceOne = async function() { + return _updateExec(this, 'replaceOne'); +}; + +/*! + * Internal helper for updateMany, updateOne + */ + +function _update(query, op, criteria, doc, options) { + query.op = op; + + if (Query.canMerge(criteria)) { + query.merge(criteria); + } + + if (doc) { + query._mergeUpdate(doc); + } + + if (utils.isObject(options)) { + // { overwrite: true } + query.setOptions(options); + } + + return query; +} + +/** + * Helper for de-duplicating "update*" functions + * @param {Query} query The Query Object (replacement for "this") + * @param {String} op The Operation to be done + * @returns the results + */ +async function _updateExec(query, op) { + const options = query._optionsForExec(); + + const criteria = query._conditions; + const doc = query._updateForExec(); + + debug(op, query._collection.collectionName, criteria, doc, options); + return query._collection[op](criteria, doc, options); +} + +/** + * Declare and/or execute this query as a `deleteOne()` operation. + * + * #### Example: + * + * await mquery(collection).deleteOne({ artist: 'Anne Murray' }) + * + * @param {Object|Query} [criteria] mongodb selector + * @return {Query} this + * @api public + */ + +Query.prototype.deleteOne = function(criteria) { + this.op = 'deleteOne'; + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + return this; +}; + +/** + * Executes a `deleteOne` Query + * @returns the results + */ +Query.prototype._deleteOne = async function() { + const options = this._optionsForExec(); + delete options.justOne; + + const conds = this._conditions; + + debug('deleteOne', this._collection.collectionName, conds, options); + return this._collection.deleteOne(conds, options); +}; + +/** + * Declare and/or execute this query as a `deleteMany()` operation. Always deletes + * _every_ document that matches `criteria`. + * + * #### Example: + * + * await mquery(collection).deleteMany({ artist: 'Anne Murray' }) + * + * @param {Object|Query} [criteria] mongodb selector + * @return {Query} this + * @api public + */ + +Query.prototype.deleteMany = function(criteria) { + this.op = 'deleteMany'; + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + return this; +}; + +/** + * Executes a `deleteMany` Query + * @returns the results + */ +Query.prototype._deleteMany = async function() { + const options = this._optionsForExec(); + delete options.justOne; + + const conds = this._conditions; + + return this._collection.deleteMany(conds, options); +}; + +/** + * Issues a mongodb findOneAndUpdate command. + * + * Finds a matching document, updates it according to the `update` arg, passing any `options`, and returns the found document (if any). + * + * #### Available options + * + * - `new`: bool - true to return the modified document rather than the original. defaults to true + * - `upsert`: bool - creates the object if it doesn't exist. defaults to false. + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * + * #### Examples: + * + * await query.findOneAndUpdate(conditions, update, options) // executes + * query.findOneAndUpdate(conditions, update, options) // returns Query + * await query.findOneAndUpdate(conditions, update) // executes + * query.findOneAndUpdate(conditions, update) // returns Query + * await query.findOneAndUpdate(update) // returns Query + * query.findOneAndUpdate(update) // returns Query + * await query.findOneAndUpdate() // executes + * query.findOneAndUpdate() // returns Query + * + * @param {Object|Query} [query] + * @param {Object} [doc] + * @param {Object} [options] + * @see mongodb http://www.mongodb.org/display/DOCS/findAndModify+Command + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndUpdate = function(criteria, doc, options) { + this.op = 'findOneAndUpdate'; + this._validate(); + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + // apply doc + if (doc) { + this._mergeUpdate(doc); + } + + options && this.setOptions(options); + + return this; +}; + +/** + * Executes a `findOneAndUpdate` Query + * @returns the results + */ +Query.prototype._findOneAndUpdate = async function() { + const conds = this._conditions; + const update = this._updateForExec(); + const options = this._optionsForExec(); + + return this._collection.findOneAndUpdate(conds, update, options); +}; + +/** + * Issues a mongodb findOneAndReplace command. + * + * Finds a matching document, replaces it according to the `replacement` arg, passing any `options`, and returns the found document (if any). + * + * #### Available options + * + * - `new`: bool - true to return the modified document rather than the original. defaults to true + * - `upsert`: bool - creates the object if it doesn't exist. defaults to false. + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * + * #### Examples: + * + * await query.findOneAndReplace(conditions, replacement, options) // executes + * query.findOneAndReplace(conditions, replacement, options) // returns Query + * await query.findOneAndReplace(conditions, replacement) // executes + * query.findOneAndReplace(conditions, replacement) // returns Query + * await query.findOneAndReplace(replacement) // returns Query + * query.findOneAndReplace(replacement) // returns Query + * await query.findOneAndReplace() // executes + * query.findOneAndReplace() // returns Query + * + * @param {Object|Query} [query] + * @param {Object} [replacement] + * @param {Object} [options] + * @see mongodb http://www.mongodb.org/display/DOCS/findAndModify+Command + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndReplace = function(criteria, replacement, options) { + this.op = 'findOneAndReplace'; + this._validate(); + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + // apply replacement + if (replacement) { + this._updateDoc = replacement; + this.options = this.options || {}; + this.options.overwrite = true; + } + + options && this.setOptions(options); + + return this; +}; + +/** + * Executes a `findOneAndReplace` Query + * @returns the results + */ +Query.prototype._findOneAndReplace = async function() { + const conds = this._conditions; + const replacement = this._updateForExec(); + const options = this._optionsForExec(); + + debug('findOneAndReplace', this._collection.collectionName, conds, replacement, options); + return this._collection.findOneAndReplace(conds, replacement, options); +}; + +/** + * Issues a mongodb findOneAndDelete. + * + * Finds a matching document, removes it, returning the found document (if any). + * + * #### Available options + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * + * #### Examples: + * + * await A.where().findOneAndDelete(conditions, options) // executes + * A.where().findOneAndDelete(conditions, options) // return Query + * await A.where().findOneAndDelete(conditions) // executes + * A.where().findOneAndDelete(conditions) // returns Query + * await A.where().findOneAndDelete() // executes + * A.where().findOneAndDelete() // returns Query + * + * @param {Object} [filter] + * @param {Object} [options] + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndDelete = function(filter, options) { + this.op = 'findOneAndDelete'; + this._validate(); + + if (Query.canMerge(filter)) { + this.merge(filter); + } + + // apply options + options && this.setOptions(options); + + return this; +}; + +/** + * Executes a `findOneAndRemove` Query + * @returns the results + */ +Query.prototype._findOneAndDelete = async function() { + const options = this._optionsForExec(); + const conds = this._conditions; + + debug('findOneAndDelete', this._collection.collectionName, conds, options); + return this._collection.findOneAndDelete(conds, options); +}; + +/** + * Add trace function that gets called when the query is executed. + * The function will be called with (method, queryInfo, query) and + * should return a callback function which will be called + * with (err, result, millis) when the query is complete. + * + * queryInfo is an object containing: { + * collectionName: , + * conditions: , + * options: , + * doc: [document to update, if applicable] + * } + * + * NOTE: Does not trace stream queries. + * + * @param {Function} traceFunction + * @return {Query} this + * @api public + */ +Query.prototype.setTraceFunction = function(traceFunction) { + this._traceFunction = traceFunction; + return this; +}; + +/** + * Executes the query + * + * #### Examples: + * + * query.exec(); + * await query.exec(); + * query.exec('update'); + * await query.exec('find'); + * + * @param {String|Function} [operation] + * @api public + */ + +Query.prototype.exec = async function exec(op) { + if (typeof op === 'string') { + this.op = op; + } + + assert.ok(this.op, 'Missing query type: (find, etc)'); + + const fnName = '_' + this.op; + + // better error, because default would list it as "this[fnName] is not a function" + if (typeof this[fnName] !== 'function') { + throw new TypeError(`this[${fnName}] is not a function`); + } + + return this[fnName](); +}; + +/** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * + * @param {Function} [resolve] + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Query.prototype.then = async function(res, rej) { + return this.exec().then(res, rej); +}; + +/** + * Returns a cursor for the given `find` query. + * + * @throws Error if operation is not a find + * @returns {Cursor} MongoDB driver cursor + */ + +Query.prototype.cursor = function() { + if ('find' != this.op) + throw new Error('cursor() is only available for find'); + + const conds = this._conditions; + + const options = this._optionsForExec(); + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + return this._collection.findCursor(conds, options); +}; + +/** + * Determines if field selection has been made. + * + * @return {Boolean} + * @api public + */ + +Query.prototype.selected = function selected() { + return !!(this._fields && Object.keys(this._fields).length > 0); +}; + +/** + * Determines if inclusive field selection has been made. + * + * query.selectedInclusively() // false + * query.select('name') + * query.selectedInclusively() // true + * query.selectedExlusively() // false + * + * @returns {Boolean} + */ + +Query.prototype.selectedInclusively = function selectedInclusively() { + if (!this._fields) return false; + + const keys = Object.keys(this._fields); + if (0 === keys.length) return false; + + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (0 === this._fields[key]) return false; + if (this._fields[key] && + typeof this._fields[key] === 'object' && + this._fields[key].$meta) { + return false; + } + } + + return true; +}; + +/** + * Determines if exclusive field selection has been made. + * + * query.selectedExlusively() // false + * query.select('-name') + * query.selectedExlusively() // true + * query.selectedInclusively() // false + * + * @returns {Boolean} + */ + +Query.prototype.selectedExclusively = function selectedExclusively() { + if (!this._fields) return false; + + const keys = Object.keys(this._fields); + if (0 === keys.length) return false; + + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (0 === this._fields[key]) return true; + } + + return false; +}; + +/** + * Merges `doc` with the current update object. + * + * @param {Object} doc + */ + +Query.prototype._mergeUpdate = function(doc) { + if (!this._updateDoc) this._updateDoc = {}; + if (doc instanceof Query) { + if (doc._updateDoc) { + utils.mergeClone(this._updateDoc, doc._updateDoc); + } + } else { + utils.mergeClone(this._updateDoc, doc); + } +}; + +/** + * Returns default options. + * + * @return {Object} + * @api private + */ + +Query.prototype._optionsForExec = function() { + const options = utils.clone(this.options); + return options; +}; + +/** + * Returns fields selection for this query. + * + * @return {Object} + * @api private + */ + +Query.prototype._fieldsForExec = function() { + return utils.clone(this._fields); +}; + +/** + * Return an update document with corrected $set operations. + * + * @api private + */ + +Query.prototype._updateForExec = function() { + const update = this._updateDoc == null ? {} : utils.clone(this._updateDoc); + const ops = utils.keys(update); + const ret = {}; + + for (const op of ops) { + if (this.options.overwrite) { + ret[op] = update[op]; + continue; + } + + if ('$' !== op[0]) { + // fix up $set sugar + if (!ret.$set) { + if (update.$set) { + ret.$set = update.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op] = update[op]; + if (!~ops.indexOf('$set')) ops.push('$set'); + } else if ('$set' === op) { + if (!ret.$set) { + ret[op] = update[op]; + } + } else { + ret[op] = update[op]; + } + } + + this._compiledUpdate = ret; + return ret; +}; + +/** + * Make sure _path is set. + * + * @parmam {String} method + */ + +Query.prototype._ensurePath = function(method) { + if (!this._path) { + const msg = method + '() must be used after where() ' + + 'when called with these arguments'; + throw new Error(msg); + } +}; + +/*! + * Permissions + */ + +Query.permissions = require('./permissions'); + +Query._isPermitted = function(a, b) { + const denied = Query.permissions[b]; + if (!denied) return true; + return true !== denied[a]; +}; + +Query.prototype._validate = function(action) { + let fail; + let validator; + + if (undefined === action) { + + validator = Query.permissions[this.op]; + if ('function' != typeof validator) return true; + + fail = validator(this); + + } else if (!Query._isPermitted(action, this.op)) { + fail = action; + } + + if (fail) { + throw new Error(fail + ' cannot be used with ' + this.op); + } +}; + +/** + * Determines if `conds` can be merged using `mquery().merge()` + * + * @param {Object} conds + * @return {Boolean} + */ + +Query.canMerge = function(conds) { + return conds instanceof Query || utils.isObject(conds); +}; + +/** + * Set a trace function that will get called whenever a + * query is executed. + * + * See `setTraceFunction()` for details. + * + * @param {Object} conds + * @return {Boolean} + */ +Query.setGlobalTraceFunction = function(traceFunction) { + Query.traceFunction = traceFunction; +}; + +/*! + * Exports. + */ + +Query.utils = utils; +Query.env = require('./env'); +Query.Collection = require('./collection'); +Query.BaseCollection = require('./collection/collection'); +module.exports = exports = Query; + +// TODO +// test utils diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/permissions.js b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/permissions.js new file mode 100644 index 00000000..b7ea0f39 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/permissions.js @@ -0,0 +1,93 @@ +'use strict'; + +const denied = exports; + +denied.distinct = function(self) { + if (self._fields && Object.keys(self._fields).length > 0) { + return 'field selection and slice'; + } + + const keys = Object.keys(denied.distinct); + let err; + + keys.every(function(option) { + if (self.options[option]) { + err = option; + return false; + } + return true; + }); + + return err; +}; +denied.distinct.select = +denied.distinct.slice = +denied.distinct.sort = +denied.distinct.limit = +denied.distinct.skip = +denied.distinct.batchSize = +denied.distinct.hint = +denied.distinct.tailable = true; + + +// aggregation integration + + +denied.findOneAndUpdate = +denied.findOneAndDelete = function(self) { + const keys = Object.keys(denied.findOneAndUpdate); + let err; + + keys.every(function(option) { + if (self.options[option]) { + err = option; + return false; + } + return true; + }); + + return err; +}; +denied.findOneAndUpdate.limit = +denied.findOneAndUpdate.skip = +denied.findOneAndUpdate.batchSize = +denied.findOneAndUpdate.tailable = true; + +denied.findOneAndReplace = function(self) { + const keys = Object.keys(denied.findOneAndUpdate); + let err; + + keys.every(function(option) { + if (self.options[option]) { + err = option; + return false; + } + return true; + }); + + return err; +}; + + +denied.countDocuments = function(self) { + if (self._fields && Object.keys(self._fields).length > 0) { + return 'field selection and slice'; + } + + const keys = Object.keys(denied.countDocuments); + let err; + + keys.every(function(option) { + if (self.options[option]) { + err = option; + return false; + } + return true; + }); + + return err; +}; + +denied.countDocuments.slice = +denied.countDocuments.batchSize = +denied.countDocuments.tailable = true; diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/utils.js b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/utils.js new file mode 100644 index 00000000..dbaec255 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/lib/utils.js @@ -0,0 +1,297 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const specialProperties = ['__proto__', 'constructor', 'prototype']; + +/** + * Clones objects + * + * @param {Object} obj the object to clone + * @param {Object} options + * @return {Object} the cloned object + * @api private + */ + +const clone = exports.clone = function clone(obj, options) { + if (obj === undefined || obj === null) + return obj; + + if (Array.isArray(obj)) + return exports.cloneArray(obj, options); + + if (obj.constructor) { + if (/ObjectI[dD]$/.test(obj.constructor.name)) { + return 'function' == typeof obj.clone + ? obj.clone() + : new obj.constructor(obj.id); + } + + if (obj.constructor.name === 'ReadPreference') { + return new obj.constructor(obj.mode, clone(obj.tags, options)); + } + + if ('Binary' == obj._bsontype && obj.buffer && obj.value) { + return 'function' == typeof obj.clone + ? obj.clone() + : new obj.constructor(obj.value(true), obj.sub_type); + } + + if ('Date' === obj.constructor.name || 'Function' === obj.constructor.name) + return new obj.constructor(+obj); + + if ('RegExp' === obj.constructor.name) + return new RegExp(obj); + + if ('Buffer' === obj.constructor.name) + return Buffer.from(obj); + } + + if (isObject(obj)) + return exports.cloneObject(obj, options); + + if (obj.valueOf) + return obj.valueOf(); +}; + +/*! + * ignore + */ + +exports.cloneObject = function cloneObject(obj, options) { + const minimize = options && options.minimize, + ret = {}, + keys = Object.keys(obj), + len = keys.length; + let hasKeys = false, + val, + k = '', + i = 0; + + for (i = 0; i < len; ++i) { + k = keys[i]; + // Not technically prototype pollution because this wouldn't merge properties + // onto `Object.prototype`, but avoid properties like __proto__ as a precaution. + if (specialProperties.indexOf(k) !== -1) { + continue; + } + + val = clone(obj[k], options); + + if (!minimize || ('undefined' !== typeof val)) { + hasKeys || (hasKeys = true); + ret[k] = val; + } + } + + return minimize + ? hasKeys && ret + : ret; +}; + +exports.cloneArray = function cloneArray(arr, options) { + const ret = [], + l = arr.length; + let i = 0; + for (; i < l; i++) + ret.push(clone(arr[i], options)); + return ret; +}; + +/** + * Merges `from` into `to` without overwriting existing properties. + * + * @param {Object} to + * @param {Object} from + * @api private + */ + +exports.merge = function merge(to, from) { + const keys = Object.keys(from); + + for (const key of keys) { + if (specialProperties.indexOf(key) !== -1) { + continue; + } + if ('undefined' === typeof to[key]) { + to[key] = from[key]; + } else { + if (exports.isObject(from[key])) { + merge(to[key], from[key]); + } else { + to[key] = from[key]; + } + } + } +}; + +/** + * Same as merge but clones the assigned values. + * + * @param {Object} to + * @param {Object} from + * @api private + */ + +exports.mergeClone = function mergeClone(to, from) { + const keys = Object.keys(from); + + for (const key of keys) { + if (specialProperties.indexOf(key) !== -1) { + continue; + } + if ('undefined' === typeof to[key]) { + to[key] = clone(from[key]); + } else { + if (exports.isObject(from[key])) { + mergeClone(to[key], from[key]); + } else { + to[key] = clone(from[key]); + } + } + } +}; + +/** + * Read pref helper (mongo 2.2 drivers support this) + * + * Allows using aliases instead of full preference names: + * + * p primary + * pp primaryPreferred + * s secondary + * sp secondaryPreferred + * n nearest + * + * @param {String} pref + */ + +exports.readPref = function readPref(pref) { + switch (pref) { + case 'p': + pref = 'primary'; + break; + case 'pp': + pref = 'primaryPreferred'; + break; + case 's': + pref = 'secondary'; + break; + case 'sp': + pref = 'secondaryPreferred'; + break; + case 'n': + pref = 'nearest'; + break; + } + + return pref; +}; + + +/** + * Read Concern helper (mongo 3.2 drivers support this) + * + * Allows using string to specify read concern level: + * + * local 3.2+ + * available 3.6+ + * majority 3.2+ + * linearizable 3.4+ + * snapshot 4.0+ + * + * @param {String|Object} concern + */ + +exports.readConcern = function readConcern(concern) { + if ('string' === typeof concern) { + switch (concern) { + case 'l': + concern = 'local'; + break; + case 'a': + concern = 'available'; + break; + case 'm': + concern = 'majority'; + break; + case 'lz': + concern = 'linearizable'; + break; + case 's': + concern = 'snapshot'; + break; + } + concern = { level: concern }; + } + return concern; +}; + +/** + * Object.prototype.toString.call helper + */ + +const _toString = Object.prototype.toString; +exports.toString = function(arg) { + return _toString.call(arg); +}; + +/** + * Determines if `arg` is an object. + * + * @param {Object|Array|String|Function|RegExp|any} arg + * @return {Boolean} + */ + +const isObject = exports.isObject = function(arg) { + return '[object Object]' == exports.toString(arg); +}; + +/** + * Object.keys helper + */ + +exports.keys = Object.keys; + +/** + * Basic Object.create polyfill. + * Only one argument is supported. + * + * Based on https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create + */ + +exports.create = 'function' == typeof Object.create + ? Object.create + : create; + +function create(proto) { + if (arguments.length > 1) { + throw new Error('Adding properties is not supported'); + } + + function F() { } + F.prototype = proto; + return new F; +} + +/** + * inheritance + */ + +exports.inherits = function(ctor, superCtor) { + ctor.prototype = exports.create(superCtor.prototype); + ctor.prototype.constructor = ctor; +}; + +/** + * Check if this object is an arguments object + * + * @param {Any} v + * @return {Boolean} + */ + +exports.isArgumentsObject = function(v) { + return Object.prototype.toString.call(v) === '[object Arguments]'; +}; diff --git a/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/package.json b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/package.json new file mode 100644 index 00000000..f4582175 --- /dev/null +++ b/backend/node_modules/.pnpm/mquery@6.0.0/node_modules/mquery/package.json @@ -0,0 +1,35 @@ +{ + "name": "mquery", + "version": "6.0.0", + "description": "Expressive query building for MongoDB", + "main": "lib/mquery.js", + "scripts": { + "test": "mocha --exit test/index.js test/*.test.js", + "fix-lint": "eslint . --fix", + "lint": "eslint ." + }, + "repository": { + "type": "git", + "url": "git://github.com/aheckmann/mquery.git" + }, + "engines": { + "node": ">=20.19.0" + }, + "devDependencies": { + "eslint": "8.x", + "eslint-plugin-mocha-no-only": "1.1.1", + "mocha": "11.x", + "mongodb": "6.x" + }, + "bugs": { + "url": "https://github.com/aheckmann/mquery/issues/new" + }, + "author": "Aaron Heckmann ", + "license": "MIT", + "keywords": [ + "mongodb", + "query", + "builder" + ], + "homepage": "https://github.com/aheckmann/mquery/" +} diff --git a/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js new file mode 100644 index 00000000..ea734fb7 --- /dev/null +++ b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/license.md b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/license.md new file mode 100644 index 00000000..fa5d39b6 --- /dev/null +++ b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/package.json b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/package.json new file mode 100644 index 00000000..49971890 --- /dev/null +++ b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/package.json @@ -0,0 +1,38 @@ +{ + "name": "ms", + "version": "2.1.3", + "description": "Tiny millisecond conversion utility", + "repository": "vercel/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" + } +} diff --git a/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/readme.md b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/readme.md new file mode 100644 index 00000000..0fc1abb3 --- /dev/null +++ b/backend/node_modules/.pnpm/ms@2.1.3/node_modules/ms/readme.md @@ -0,0 +1,59 @@ +# ms + +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/content-type b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/content-type new file mode 120000 index 00000000..5850a329 --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/content-type @@ -0,0 +1 @@ +../../content-type@2.1.0/node_modules/content-type \ No newline at end of file diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/LICENSE b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/LICENSE new file mode 100644 index 00000000..ea6b9e2e --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Federico Romero +Copyright (c) 2012-2014 Isaac Z. Schlueter +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/README.md b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/README.md new file mode 100644 index 00000000..6fb7f2db --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/README.md @@ -0,0 +1,212 @@ +# negotiator + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +An HTTP content negotiator for Node.js + +## Installation + +```sh +$ npm install negotiator +``` + +## API + +```js +var Negotiator = require('negotiator') +``` + +### Accept Negotiation + +```js +availableMediaTypes = ['text/html', 'text/plain', 'application/json'] + +// The negotiator constructor receives a request object +negotiator = new Negotiator(request) + +// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8' + +negotiator.mediaTypes() +// -> ['text/html', 'image/jpeg', 'application/*'] + +negotiator.mediaTypes(availableMediaTypes) +// -> ['text/html', 'application/json'] + +negotiator.mediaType(availableMediaTypes) +// -> 'text/html' +``` + +You can check a working example at `examples/accept.js`. + +#### Methods + +##### mediaType() + +Returns the most preferred media type from the client. + +##### mediaType(availableMediaType) + +Returns the most preferred media type from a list of available media types. + +##### mediaTypes() + +Returns an array of preferred media types ordered by the client preference. + +##### mediaTypes(availableMediaTypes) + +Returns an array of preferred media types ordered by priority from a list of +available media types. + +### Accept-Language Negotiation + +```js +negotiator = new Negotiator(request) + +availableLanguages = ['en', 'es', 'fr'] + +// Let's say Accept-Language header is 'en;q=0.8, es, pt' + +negotiator.languages() +// -> ['es', 'pt', 'en'] + +negotiator.languages(availableLanguages) +// -> ['es', 'en'] + +language = negotiator.language(availableLanguages) +// -> 'es' +``` + +You can check a working example at `examples/language.js`. + +#### Methods + +##### language() + +Returns the most preferred language from the client. + +##### language(availableLanguages) + +Returns the most preferred language from a list of available languages. + +##### languages() + +Returns an array of preferred languages ordered by the client preference. + +##### languages(availableLanguages) + +Returns an array of preferred languages ordered by priority from a list of +available languages. + +### Accept-Charset Negotiation + +```js +availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2' + +negotiator.charsets() +// -> ['utf-8', 'iso-8859-1', 'utf-7'] + +negotiator.charsets(availableCharsets) +// -> ['utf-8', 'iso-8859-1'] + +negotiator.charset(availableCharsets) +// -> 'utf-8' +``` + +You can check a working example at `examples/charset.js`. + +#### Methods + +##### charset() + +Returns the most preferred charset from the client. + +##### charset(availableCharsets) + +Returns the most preferred charset from a list of available charsets. + +##### charsets() + +Returns an array of preferred charsets ordered by the client preference. + +##### charsets(availableCharsets) + +Returns an array of preferred charsets ordered by priority from a list of +available charsets. + +### Accept-Encoding Negotiation + +```js +availableEncodings = ['identity', 'gzip'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5' + +negotiator.encodings() +// -> ['gzip', 'identity', 'compress'] + +negotiator.encodings(availableEncodings) +// -> ['gzip', 'identity'] + +negotiator.encoding(availableEncodings) +// -> 'gzip' +``` + +You can check a working example at `examples/encoding.js`. + +#### Methods + +##### encoding() + +Returns the most preferred encoding from the client. + +##### encoding(availableEncodings) + +Returns the most preferred encoding from a list of available encodings. + +##### encoding(availableEncodings, { preferred }) + +Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings. + +##### encodings() + +Returns an array of preferred encodings ordered by the client preference. + +##### encodings(availableEncodings) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings. + +##### encodings(availableEncodings, { preferred }) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings, while prioritizing based on `preferred` array between same-quality encodings. + +## See Also + +The [accepts](https://npmjs.org/package/accepts#readme) module builds on +this module and provides an alternative interface, mime type validation, +and more. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/negotiator.svg +[npm-url]: https://npmjs.org/package/negotiator +[node-version-image]: https://img.shields.io/node/v/negotiator.svg +[node-version-url]: https://nodejs.org/en/download/ +[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master +[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg +[downloads-url]: https://npmjs.org/package/negotiator +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/index.js b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/index.js new file mode 100644 index 00000000..4f51315d --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/index.js @@ -0,0 +1,83 @@ +/*! + * negotiator + * Copyright(c) 2012 Federico Romero + * Copyright(c) 2012-2014 Isaac Z. Schlueter + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +var preferredCharsets = require('./lib/charset') +var preferredEncodings = require('./lib/encoding') +var preferredLanguages = require('./lib/language') +var preferredMediaTypes = require('./lib/mediaType') + +/** + * Module exports. + * @public + */ + +module.exports = Negotiator; +module.exports.Negotiator = Negotiator; + +/** + * Create a Negotiator instance from a request. + * @param {object} request + * @public + */ + +function Negotiator(request) { + if (!(this instanceof Negotiator)) { + return new Negotiator(request); + } + + this.request = request; +} + +Negotiator.prototype.charset = function charset(available) { + var set = this.charsets(available); + return set && set[0]; +}; + +Negotiator.prototype.charsets = function charsets(available) { + return preferredCharsets(this.request.headers['accept-charset'], available); +}; + +Negotiator.prototype.encoding = function encoding(available, opts) { + var set = this.encodings(available, opts); + return set && set[0]; +}; + +Negotiator.prototype.encodings = function encodings(available, options) { + var opts = options || {}; + return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred); +}; + +Negotiator.prototype.language = function language(available) { + var set = this.languages(available); + return set && set[0]; +}; + +Negotiator.prototype.languages = function languages(available) { + return preferredLanguages(this.request.headers['accept-language'], available); +}; + +Negotiator.prototype.mediaType = function mediaType(available) { + var set = this.mediaTypes(available); + return set && set[0]; +}; + +Negotiator.prototype.mediaTypes = function mediaTypes(available) { + return preferredMediaTypes(this.request.headers.accept, available); +}; + +// Backwards compatibility +Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; +Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; +Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; +Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; +Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; +Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; +Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; +Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/accept.js b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/accept.js new file mode 100644 index 00000000..91ceb177 --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/accept.js @@ -0,0 +1,54 @@ +/*! + * negotiator + * Copyright(c) 2026 Blake Embrey + * MIT Licensed + */ + +'use strict'; + +var contentType = require('content-type'); + +/** + * Module exports. + * @private + */ + +module.exports = parseAccept; + +/** + * Parse an Accept-style header. + * @private + */ + +function parseAccept(header) { + var values = []; + var index = 0; + + while (index < header.length) { + var start = skipOptionalWhitespace(header, index); + var parsed = contentType.parse(header, { comma: true, start: start }); + + // `content-type` normalizes the type, but accept methods return original casing. + parsed.type = header.slice(start, start + parsed.type.length); + values.push(parsed); + + index = parsed.index + 1; + } + + return values; +} + +/** + * Skip optional whitespace. + * @private + */ + +function skipOptionalWhitespace(header, index) { + var cursor = index; + + while (header.charCodeAt(cursor) === 0x20 || header.charCodeAt(cursor) === 0x09) { + cursor++; + } + + return cursor; +} diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/charset.js b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/charset.js new file mode 100644 index 00000000..10596ffa --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/charset.js @@ -0,0 +1,145 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +var parseAccept = require('./accept'); + +/** + * Module exports. + * @public + */ + +module.exports = preferredCharsets; +module.exports.preferredCharsets = preferredCharsets; + +/** + * Module variables. + * @private + */ + +function parseAcceptCharset(accept) { + var accepts = parseAccept(accept); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var charset = formatCharset(accepts[i], i); + if (charset) accepts[j++] = charset; + } + + accepts.length = j; + return accepts; +} + +/** + * Format a parsed charset for negotiation. + * @private + */ + +function formatCharset(parsed, i) { + if (!parsed.type) return null; + + return { + charset: parsed.type, + q: parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1, + i: i + }; +} + +/** + * Get the priority of a charset. + * @private + */ + +function getCharsetPriority(charset, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(charset, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the charset. + * @private + */ + +function specify(charset, spec, index) { + var s = 0; + if(spec.charset.toLowerCase() === charset.toLowerCase()){ + s |= 1; + } else if (spec.charset !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +} + +/** + * Get the preferred charsets from an Accept-Charset header. + * @public + */ + +function preferredCharsets(accept, provided) { + // RFC 2616 sec 14.2: no header = * + var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all charsets + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullCharset); + } + + var priorities = provided.map(function getPriority(type, index) { + return getCharsetPriority(type, accepts, index); + }); + + // sorted list of accepted charsets + return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full charset string. + * @private + */ + +function getFullCharset(spec) { + return spec.charset; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/encoding.js b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/encoding.js new file mode 100644 index 00000000..ec2f5862 --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/encoding.js @@ -0,0 +1,184 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +var parseAccept = require('./accept'); + +/** + * Module exports. + * @public + */ + +module.exports = preferredEncodings; +module.exports.preferredEncodings = preferredEncodings; + +/** + * Module variables. + * @private + */ + +function parseAcceptEncoding(accept) { + var accepts = parseAccept(accept); + var hasIdentity = false; + var minQuality = 1; + + for (var i = 0, j = 0; i < accepts.length; i++) { + var encoding = formatEncoding(accepts[i], i); + + if (encoding) { + accepts[j++] = encoding; + hasIdentity = hasIdentity || specify('identity', encoding); + minQuality = Math.min(minQuality, encoding.q || 1); + } + } + + if (!hasIdentity) { + /* + * If identity doesn't explicitly appear in the accept-encoding header, + * it's added to the list of acceptable encoding with the lowest q + */ + accepts[j++] = { + encoding: 'identity', + q: minQuality, + i: i + }; + } + + accepts.length = j; + return accepts; +} + +/** + * Format a parsed encoding for negotiation. + * @private + */ + +function formatEncoding(parsed, i) { + if (!parsed.type) return null; + + return { + encoding: parsed.type, + q: parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1, + i: i + }; +} + +/** + * Get the priority of an encoding. + * @private + */ + +function getEncodingPriority(encoding, accepted, index) { + var priority = {encoding: encoding, o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(encoding, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the encoding. + * @private + */ + +function specify(encoding, spec, index) { + var s = 0; + if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ + s |= 1; + } else if (spec.encoding !== '*' ) { + return null + } + + return { + encoding: encoding, + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred encodings from an Accept-Encoding header. + * @public + */ + +function preferredEncodings(accept, provided, preferred) { + var accepts = parseAcceptEncoding(accept || ''); + + var comparator = preferred ? function comparator (a, b) { + if (a.q !== b.q) { + return b.q - a.q // higher quality first + } + + var aPreferred = preferred.indexOf(a.encoding) + var bPreferred = preferred.indexOf(b.encoding) + + if (aPreferred === -1 && bPreferred === -1) { + // consider the original specifity/order + return (b.s - a.s) || (a.o - b.o) || (a.i - b.i) + } + + if (aPreferred !== -1 && bPreferred !== -1) { + return aPreferred - bPreferred // consider the preferred order + } + + return aPreferred === -1 ? 1 : -1 // preferred first + } : compareSpecs; + + if (!provided) { + // sorted list of all encodings + return accepts + .filter(isQuality) + .sort(comparator) + .map(getFullEncoding); + } + + var priorities = provided.map(function getPriority(type, index) { + return getEncodingPriority(type, accepts, index); + }); + + // sorted list of accepted encodings + return priorities.filter(isQuality).sort(comparator).map(function getEncoding(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i); +} + +/** + * Get full encoding string. + * @private + */ + +function getFullEncoding(spec) { + return spec.encoding; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/language.js b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/language.js new file mode 100644 index 00000000..e602244b --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/language.js @@ -0,0 +1,158 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +var contentType = require('content-type'); +var parseAccept = require('./accept'); + +/** + * Module exports. + * @public + */ + +module.exports = preferredLanguages; +module.exports.preferredLanguages = preferredLanguages; + +/** + * Module variables. + * @private + */ + +function parseAcceptLanguage(accept) { + var accepts = parseAccept(accept); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var language = formatLanguage(accepts[i], i); + if (language) accepts[j++] = language; + } + + accepts.length = j; + return accepts; +} + +/** + * Format a parsed language for negotiation. + * @private + */ + +function formatLanguage(parsed, i) { + if (!parsed.type) return null; + + var hyphen = parsed.type.indexOf('-'); + var prefix = hyphen === -1 ? parsed.type : parsed.type.slice(0, hyphen); + var suffix = hyphen === -1 ? undefined : parsed.type.slice(hyphen + 1); + + return { + prefix: prefix, + suffix: suffix, + q: parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1, + i: i, + full: parsed.type + }; +} + +/** + * Get the priority of a language. + * @private + */ + +function getLanguagePriority(language, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(language, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the language. + * @private + */ + +function specify(language, spec, index) { + var p = formatLanguage(contentType.parse(language), 0) + if (!p) return null; + var s = 0; + if(spec.full.toLowerCase() === p.full.toLowerCase()){ + s |= 4; + } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { + s |= 2; + } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { + s |= 1; + } else if (spec.full !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred languages from an Accept-Language header. + * @public + */ + +function preferredLanguages(accept, provided) { + // RFC 2616 sec 14.4: no header = * + var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all languages + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullLanguage); + } + + var priorities = provided.map(function getPriority(type, index) { + return getLanguagePriority(type, accepts, index); + }); + + // sorted list of accepted languages + return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full language string. + * @private + */ + +function getFullLanguage(spec) { + return spec.full; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/mediaType.js b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/mediaType.js new file mode 100644 index 00000000..5b772952 --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/lib/mediaType.js @@ -0,0 +1,176 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +var contentType = require('content-type'); +var parseAcceptHeader = require('./accept'); + +/** + * Module exports. + * @public + */ + +module.exports = preferredMediaTypes; +module.exports.preferredMediaTypes = preferredMediaTypes; + +/** + * Module variables. + * @private + */ + +function parseAccept(accept) { + var accepts = parseAcceptHeader(accept); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var mediaType = formatMediaType(accepts[i], i); + if (mediaType) accepts[j++] = mediaType; + } + + accepts.length = j; + return accepts; +} + +/** + * Format a parsed content type for negotiation. + * @private + */ + +function formatMediaType(parsed, i) { + var slash = parsed.type.indexOf('/'); + if (slash === -1) return null; + + var q = parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1; + + delete parsed.parameters.q; + + return { + type: parsed.type.slice(0, slash), + subtype: parsed.type.slice(slash + 1), + params: parsed.parameters, + q: q, + i: i + }; +} + +/** + * Get the priority of a media type. + * @private + */ + +function getMediaTypePriority(type, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(type, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the media type. + * @private + */ + +function specify(type, spec, index) { + var p = formatMediaType(contentType.parse(type), 0); + var s = 0; + + if (!p) { + return null; + } + + if(spec.type.toLowerCase() == p.type.toLowerCase()) { + s |= 4 + } else if(spec.type != '*') { + return null; + } + + if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { + s |= 2 + } else if(spec.subtype != '*') { + return null; + } + + var keys = Object.keys(spec.params); + if (keys.length > 0) { + if (keys.every(function (k) { + return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); + })) { + s |= 1 + } else { + return null + } + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s, + } +} + +/** + * Get the preferred media types from an Accept header. + * @public + */ + +function preferredMediaTypes(accept, provided) { + // RFC 2616 sec 14.2: no header = */* + var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); + + if (!provided) { + // sorted list of all types + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullType); + } + + var priorities = provided.map(function getPriority(type, index) { + return getMediaTypePriority(type, accepts, index); + }); + + // sorted list of accepted types + return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full type string. + * @private + */ + +function getFullType(spec) { + return spec.type + '/' + spec.subtype; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/package.json b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/package.json new file mode 100644 index 00000000..5cf21691 --- /dev/null +++ b/backend/node_modules/.pnpm/negotiator@1.1.0/node_modules/negotiator/package.json @@ -0,0 +1,49 @@ +{ + "name": "negotiator", + "description": "HTTP content negotiation", + "version": "1.1.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Federico Romero ", + "Isaac Z. Schlueter (http://blog.izs.me/)" + ], + "license": "MIT", + "keywords": [ + "http", + "content negotiation", + "accept", + "accept-language", + "accept-encoding", + "accept-charset" + ], + "repository": "jshttp/negotiator", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "content-type": "^2.1.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "^11.7.0", + "nyc": "^17.1.0", + "vitest": "3.2.4" + }, + "files": [ + "lib/", + "index.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "bench": "vitest bench", + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/backend/node_modules/.pnpm/node_modules/.bin/apollo-pbjs b/backend/node_modules/.pnpm/node_modules/.bin/apollo-pbjs new file mode 100755 index 00000000..b947625f --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/.bin/apollo-pbjs @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/.." +else + export NODE_PATH="$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/..:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +else + exec node "$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs" "$@" +fi +# cmd-shim-target=../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbjs diff --git a/backend/node_modules/.pnpm/node_modules/.bin/apollo-pbts b/backend/node_modules/.pnpm/node_modules/.bin/apollo-pbts new file mode 100755 index 00000000..254486c2 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/.bin/apollo-pbts @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/.." +else + export NODE_PATH="$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/node_modules:$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules:$basedir_abs/..:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +else + exec node "$basedir_abs/../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts" "$@" +fi +# cmd-shim-target=../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs/bin/pbts diff --git a/backend/node_modules/.pnpm/node_modules/.bin/sha.js b/backend/node_modules/.pnpm/node_modules/.bin/sha.js new file mode 100755 index 00000000..09895267 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/.bin/sha.js @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/../../sha.js@2.4.12/node_modules/sha.js/node_modules:$basedir_abs/../../sha.js@2.4.12/node_modules:$basedir_abs/.." +else + export NODE_PATH="$basedir_abs/../../sha.js@2.4.12/node_modules/sha.js/node_modules:$basedir_abs/../../sha.js@2.4.12/node_modules:$basedir_abs/..:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +else + exec node "$basedir_abs/../../sha.js@2.4.12/node_modules/sha.js/bin.js" "$@" +fi +# cmd-shim-target=../../sha.js@2.4.12/node_modules/sha.js/bin.js diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/cache-control-types b/backend/node_modules/.pnpm/node_modules/@apollo/cache-control-types new file mode 120000 index 00000000..31fc445d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/cache-control-types @@ -0,0 +1 @@ +../../@apollo+cache-control-types@1.0.3_graphql@17.0.2/node_modules/@apollo/cache-control-types \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/protobufjs b/backend/node_modules/.pnpm/node_modules/@apollo/protobufjs new file mode 120000 index 00000000..1b163c95 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/protobufjs @@ -0,0 +1 @@ +../../@apollo+protobufjs@1.2.8/node_modules/@apollo/protobufjs \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/server-gateway-interface b/backend/node_modules/.pnpm/node_modules/@apollo/server-gateway-interface new file mode 120000 index 00000000..38766e43 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/server-gateway-interface @@ -0,0 +1 @@ +../../@apollo+server-gateway-interface@2.0.0_graphql@17.0.2/node_modules/@apollo/server-gateway-interface \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/usage-reporting-protobuf b/backend/node_modules/.pnpm/node_modules/@apollo/usage-reporting-protobuf new file mode 120000 index 00000000..b50b7eeb --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/usage-reporting-protobuf @@ -0,0 +1 @@ +../../@apollo+usage-reporting-protobuf@4.1.2/node_modules/@apollo/usage-reporting-protobuf \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.createhash b/backend/node_modules/.pnpm/node_modules/@apollo/utils.createhash new file mode 120000 index 00000000..aa9b3d4d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.createhash @@ -0,0 +1 @@ +../../@apollo+utils.createhash@3.0.1/node_modules/@apollo/utils.createhash \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.dropunuseddefinitions b/backend/node_modules/.pnpm/node_modules/@apollo/utils.dropunuseddefinitions new file mode 120000 index 00000000..c50ad5e2 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.dropunuseddefinitions @@ -0,0 +1 @@ +../../@apollo+utils.dropunuseddefinitions@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.dropunuseddefinitions \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.fetcher b/backend/node_modules/.pnpm/node_modules/@apollo/utils.fetcher new file mode 120000 index 00000000..ac0df7f2 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.fetcher @@ -0,0 +1 @@ +../../@apollo+utils.fetcher@3.1.0/node_modules/@apollo/utils.fetcher \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.isnodelike b/backend/node_modules/.pnpm/node_modules/@apollo/utils.isnodelike new file mode 120000 index 00000000..fa8a1ba6 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.isnodelike @@ -0,0 +1 @@ +../../@apollo+utils.isnodelike@3.0.0/node_modules/@apollo/utils.isnodelike \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.keyvaluecache b/backend/node_modules/.pnpm/node_modules/@apollo/utils.keyvaluecache new file mode 120000 index 00000000..f5278662 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.keyvaluecache @@ -0,0 +1 @@ +../../@apollo+utils.keyvaluecache@4.0.0/node_modules/@apollo/utils.keyvaluecache \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.logger b/backend/node_modules/.pnpm/node_modules/@apollo/utils.logger new file mode 120000 index 00000000..60000413 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.logger @@ -0,0 +1 @@ +../../@apollo+utils.logger@3.0.0/node_modules/@apollo/utils.logger \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.printwithreducedwhitespace b/backend/node_modules/.pnpm/node_modules/@apollo/utils.printwithreducedwhitespace new file mode 120000 index 00000000..523daa91 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.printwithreducedwhitespace @@ -0,0 +1 @@ +../../@apollo+utils.printwithreducedwhitespace@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.printwithreducedwhitespace \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.removealiases b/backend/node_modules/.pnpm/node_modules/@apollo/utils.removealiases new file mode 120000 index 00000000..dca6430a --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.removealiases @@ -0,0 +1 @@ +../../@apollo+utils.removealiases@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.removealiases \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.sortast b/backend/node_modules/.pnpm/node_modules/@apollo/utils.sortast new file mode 120000 index 00000000..25bc8349 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.sortast @@ -0,0 +1 @@ +../../@apollo+utils.sortast@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.sortast \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.stripsensitiveliterals b/backend/node_modules/.pnpm/node_modules/@apollo/utils.stripsensitiveliterals new file mode 120000 index 00000000..8f26fcbe --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.stripsensitiveliterals @@ -0,0 +1 @@ +../../@apollo+utils.stripsensitiveliterals@2.0.1_graphql@17.0.2/node_modules/@apollo/utils.stripsensitiveliterals \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.usagereporting b/backend/node_modules/.pnpm/node_modules/@apollo/utils.usagereporting new file mode 120000 index 00000000..a3e6f267 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.usagereporting @@ -0,0 +1 @@ +../../@apollo+utils.usagereporting@2.1.0_graphql@17.0.2/node_modules/@apollo/utils.usagereporting \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@apollo/utils.withrequired b/backend/node_modules/.pnpm/node_modules/@apollo/utils.withrequired new file mode 120000 index 00000000..709ef203 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@apollo/utils.withrequired @@ -0,0 +1 @@ +../../@apollo+utils.withrequired@3.0.0/node_modules/@apollo/utils.withrequired \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@graphql-tools/merge b/backend/node_modules/.pnpm/node_modules/@graphql-tools/merge new file mode 120000 index 00000000..0b4567c0 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@graphql-tools/merge @@ -0,0 +1 @@ +../../@graphql-tools+merge@9.2.4_graphql@17.0.2/node_modules/@graphql-tools/merge \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@graphql-tools/schema b/backend/node_modules/.pnpm/node_modules/@graphql-tools/schema new file mode 120000 index 00000000..3fb0ed6c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@graphql-tools/schema @@ -0,0 +1 @@ +../../@graphql-tools+schema@10.1.1_graphql@17.0.2/node_modules/@graphql-tools/schema \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@graphql-tools/utils b/backend/node_modules/.pnpm/node_modules/@graphql-tools/utils new file mode 120000 index 00000000..03eed52d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@graphql-tools/utils @@ -0,0 +1 @@ +../../@graphql-tools+utils@12.0.1_graphql@17.0.2/node_modules/@graphql-tools/utils \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@graphql-typed-document-node/core b/backend/node_modules/.pnpm/node_modules/@graphql-typed-document-node/core new file mode 120000 index 00000000..ebc23ce4 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@graphql-typed-document-node/core @@ -0,0 +1 @@ +../../@graphql-typed-document-node+core@3.2.0_graphql@17.0.2/node_modules/@graphql-typed-document-node/core \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@mongodb-js/saslprep b/backend/node_modules/.pnpm/node_modules/@mongodb-js/saslprep new file mode 120000 index 00000000..6bb86a36 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@mongodb-js/saslprep @@ -0,0 +1 @@ +../../@mongodb-js+saslprep@1.5.4/node_modules/@mongodb-js/saslprep \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/aspromise b/backend/node_modules/.pnpm/node_modules/@protobufjs/aspromise new file mode 120000 index 00000000..769f59a1 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/aspromise @@ -0,0 +1 @@ +../../@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/base64 b/backend/node_modules/.pnpm/node_modules/@protobufjs/base64 new file mode 120000 index 00000000..60b4939c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/base64 @@ -0,0 +1 @@ +../../@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64 \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/codegen b/backend/node_modules/.pnpm/node_modules/@protobufjs/codegen new file mode 120000 index 00000000..cd52194c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/codegen @@ -0,0 +1 @@ +../../@protobufjs+codegen@2.0.5/node_modules/@protobufjs/codegen \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/eventemitter b/backend/node_modules/.pnpm/node_modules/@protobufjs/eventemitter new file mode 120000 index 00000000..5c89b70c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/eventemitter @@ -0,0 +1 @@ +../../@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/fetch b/backend/node_modules/.pnpm/node_modules/@protobufjs/fetch new file mode 120000 index 00000000..31edb911 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/fetch @@ -0,0 +1 @@ +../../@protobufjs+fetch@1.1.1/node_modules/@protobufjs/fetch \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/float b/backend/node_modules/.pnpm/node_modules/@protobufjs/float new file mode 120000 index 00000000..f124d8c4 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/float @@ -0,0 +1 @@ +../../@protobufjs+float@1.0.2/node_modules/@protobufjs/float \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/inquire b/backend/node_modules/.pnpm/node_modules/@protobufjs/inquire new file mode 120000 index 00000000..75c54c63 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/inquire @@ -0,0 +1 @@ +../../@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/path b/backend/node_modules/.pnpm/node_modules/@protobufjs/path new file mode 120000 index 00000000..96d29578 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/path @@ -0,0 +1 @@ +../../@protobufjs+path@1.1.2/node_modules/@protobufjs/path \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/pool b/backend/node_modules/.pnpm/node_modules/@protobufjs/pool new file mode 120000 index 00000000..debdfe01 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/pool @@ -0,0 +1 @@ +../../@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@protobufjs/utf8 b/backend/node_modules/.pnpm/node_modules/@protobufjs/utf8 new file mode 120000 index 00000000..21e3bda8 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@protobufjs/utf8 @@ -0,0 +1 @@ +../../@protobufjs+utf8@1.1.2/node_modules/@protobufjs/utf8 \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@standard-schema/spec b/backend/node_modules/.pnpm/node_modules/@standard-schema/spec new file mode 120000 index 00000000..ddfb8a47 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@standard-schema/spec @@ -0,0 +1 @@ +../../@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@types/long b/backend/node_modules/.pnpm/node_modules/@types/long new file mode 120000 index 00000000..846000c0 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@types/long @@ -0,0 +1 @@ +../../@types+long@4.0.2/node_modules/@types/long \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@types/webidl-conversions b/backend/node_modules/.pnpm/node_modules/@types/webidl-conversions new file mode 120000 index 00000000..da899135 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@types/webidl-conversions @@ -0,0 +1 @@ +../../@types+webidl-conversions@7.0.3/node_modules/@types/webidl-conversions \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@types/whatwg-url b/backend/node_modules/.pnpm/node_modules/@types/whatwg-url new file mode 120000 index 00000000..24f37dcb --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@types/whatwg-url @@ -0,0 +1 @@ +../../@types+whatwg-url@13.0.0/node_modules/@types/whatwg-url \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/@whatwg-node/promise-helpers b/backend/node_modules/.pnpm/node_modules/@whatwg-node/promise-helpers new file mode 120000 index 00000000..76412474 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/@whatwg-node/promise-helpers @@ -0,0 +1 @@ +../../@whatwg-node+promise-helpers@1.3.2/node_modules/@whatwg-node/promise-helpers \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/async-retry b/backend/node_modules/.pnpm/node_modules/async-retry new file mode 120000 index 00000000..43575eb8 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/async-retry @@ -0,0 +1 @@ +../async-retry@1.3.3/node_modules/async-retry \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/available-typed-arrays b/backend/node_modules/.pnpm/node_modules/available-typed-arrays new file mode 120000 index 00000000..975aca59 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/available-typed-arrays @@ -0,0 +1 @@ +../available-typed-arrays@1.0.7/node_modules/available-typed-arrays \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/body-parser b/backend/node_modules/.pnpm/node_modules/body-parser new file mode 120000 index 00000000..3728db9d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/body-parser @@ -0,0 +1 @@ +../body-parser@2.3.0/node_modules/body-parser \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/bson b/backend/node_modules/.pnpm/node_modules/bson new file mode 120000 index 00000000..19e5f04f --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/bson @@ -0,0 +1 @@ +../bson@7.3.3/node_modules/bson \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/bytes b/backend/node_modules/.pnpm/node_modules/bytes new file mode 120000 index 00000000..0002eee0 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/bytes @@ -0,0 +1 @@ +../bytes@3.1.2/node_modules/bytes \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/call-bind b/backend/node_modules/.pnpm/node_modules/call-bind new file mode 120000 index 00000000..8f4b0ca1 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/call-bind @@ -0,0 +1 @@ +../call-bind@1.0.9/node_modules/call-bind \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/call-bind-apply-helpers b/backend/node_modules/.pnpm/node_modules/call-bind-apply-helpers new file mode 120000 index 00000000..581b3f1b --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/call-bind-apply-helpers @@ -0,0 +1 @@ +../call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/call-bound b/backend/node_modules/.pnpm/node_modules/call-bound new file mode 120000 index 00000000..56bed038 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/call-bound @@ -0,0 +1 @@ +../call-bound@1.0.4/node_modules/call-bound \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/content-type b/backend/node_modules/.pnpm/node_modules/content-type new file mode 120000 index 00000000..6bbf36b2 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/content-type @@ -0,0 +1 @@ +../content-type@1.0.5/node_modules/content-type \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/cors b/backend/node_modules/.pnpm/node_modules/cors new file mode 120000 index 00000000..da56060d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/cors @@ -0,0 +1 @@ +../cors@2.8.6/node_modules/cors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/cross-inspect b/backend/node_modules/.pnpm/node_modules/cross-inspect new file mode 120000 index 00000000..4b5da6ce --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/cross-inspect @@ -0,0 +1 @@ +../cross-inspect@1.0.1/node_modules/cross-inspect \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/debug b/backend/node_modules/.pnpm/node_modules/debug new file mode 120000 index 00000000..070935b8 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/debug @@ -0,0 +1 @@ +../debug@4.4.3/node_modules/debug \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/define-data-property b/backend/node_modules/.pnpm/node_modules/define-data-property new file mode 120000 index 00000000..c3e2bbf8 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/define-data-property @@ -0,0 +1 @@ +../define-data-property@1.1.4/node_modules/define-data-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/depd b/backend/node_modules/.pnpm/node_modules/depd new file mode 120000 index 00000000..cf84e7c8 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/depd @@ -0,0 +1 @@ +../depd@2.0.0/node_modules/depd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/dunder-proto b/backend/node_modules/.pnpm/node_modules/dunder-proto new file mode 120000 index 00000000..d6327b96 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/dunder-proto @@ -0,0 +1 @@ +../dunder-proto@1.0.1/node_modules/dunder-proto \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/ee-first b/backend/node_modules/.pnpm/node_modules/ee-first new file mode 120000 index 00000000..e97f45cb --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/ee-first @@ -0,0 +1 @@ +../ee-first@1.1.1/node_modules/ee-first \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/encodeurl b/backend/node_modules/.pnpm/node_modules/encodeurl new file mode 120000 index 00000000..8c692c6f --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/encodeurl @@ -0,0 +1 @@ +../encodeurl@2.0.0/node_modules/encodeurl \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/es-define-property b/backend/node_modules/.pnpm/node_modules/es-define-property new file mode 120000 index 00000000..dab9eff7 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/es-define-property @@ -0,0 +1 @@ +../es-define-property@1.0.1/node_modules/es-define-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/es-errors b/backend/node_modules/.pnpm/node_modules/es-errors new file mode 120000 index 00000000..c3f76ff7 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/es-errors @@ -0,0 +1 @@ +../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/es-object-atoms b/backend/node_modules/.pnpm/node_modules/es-object-atoms new file mode 120000 index 00000000..e7dcb1b5 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/es-object-atoms @@ -0,0 +1 @@ +../es-object-atoms@1.1.2/node_modules/es-object-atoms \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/escape-html b/backend/node_modules/.pnpm/node_modules/escape-html new file mode 120000 index 00000000..62be3c2f --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/escape-html @@ -0,0 +1 @@ +../escape-html@1.0.3/node_modules/escape-html \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/finalhandler b/backend/node_modules/.pnpm/node_modules/finalhandler new file mode 120000 index 00000000..d6b6e6fc --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/finalhandler @@ -0,0 +1 @@ +../finalhandler@2.1.1/node_modules/finalhandler \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/for-each b/backend/node_modules/.pnpm/node_modules/for-each new file mode 120000 index 00000000..1354ace5 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/for-each @@ -0,0 +1 @@ +../for-each@0.3.5/node_modules/for-each \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/function-bind b/backend/node_modules/.pnpm/node_modules/function-bind new file mode 120000 index 00000000..e5175259 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/function-bind @@ -0,0 +1 @@ +../function-bind@1.1.2/node_modules/function-bind \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/get-intrinsic b/backend/node_modules/.pnpm/node_modules/get-intrinsic new file mode 120000 index 00000000..6a0fbefe --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/get-intrinsic @@ -0,0 +1 @@ +../get-intrinsic@1.3.0/node_modules/get-intrinsic \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/get-proto b/backend/node_modules/.pnpm/node_modules/get-proto new file mode 120000 index 00000000..f6bb0a6c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/get-proto @@ -0,0 +1 @@ +../get-proto@1.0.1/node_modules/get-proto \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/gopd b/backend/node_modules/.pnpm/node_modules/gopd new file mode 120000 index 00000000..55e0b5bd --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/gopd @@ -0,0 +1 @@ +../gopd@1.2.0/node_modules/gopd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/has-property-descriptors b/backend/node_modules/.pnpm/node_modules/has-property-descriptors new file mode 120000 index 00000000..a742992d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/has-property-descriptors @@ -0,0 +1 @@ +../has-property-descriptors@1.0.2/node_modules/has-property-descriptors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/has-symbols b/backend/node_modules/.pnpm/node_modules/has-symbols new file mode 120000 index 00000000..64c7e9e5 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/has-symbols @@ -0,0 +1 @@ +../has-symbols@1.1.0/node_modules/has-symbols \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/has-tostringtag b/backend/node_modules/.pnpm/node_modules/has-tostringtag new file mode 120000 index 00000000..e0ffa0da --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/has-tostringtag @@ -0,0 +1 @@ +../has-tostringtag@1.0.2/node_modules/has-tostringtag \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/hasown b/backend/node_modules/.pnpm/node_modules/hasown new file mode 120000 index 00000000..e528add2 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/hasown @@ -0,0 +1 @@ +../hasown@2.0.4/node_modules/hasown \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/http-errors b/backend/node_modules/.pnpm/node_modules/http-errors new file mode 120000 index 00000000..fa090c6c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/http-errors @@ -0,0 +1 @@ +../http-errors@2.0.1/node_modules/http-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/iconv-lite b/backend/node_modules/.pnpm/node_modules/iconv-lite new file mode 120000 index 00000000..15b636e8 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/iconv-lite @@ -0,0 +1 @@ +../iconv-lite@0.7.3/node_modules/iconv-lite \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/inherits b/backend/node_modules/.pnpm/node_modules/inherits new file mode 120000 index 00000000..5c52954a --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/inherits @@ -0,0 +1 @@ +../inherits@2.0.4/node_modules/inherits \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/is-callable b/backend/node_modules/.pnpm/node_modules/is-callable new file mode 120000 index 00000000..0101e9fc --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/is-callable @@ -0,0 +1 @@ +../is-callable@1.2.7/node_modules/is-callable \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/is-typed-array b/backend/node_modules/.pnpm/node_modules/is-typed-array new file mode 120000 index 00000000..59652039 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/is-typed-array @@ -0,0 +1 @@ +../is-typed-array@1.1.15/node_modules/is-typed-array \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/isarray b/backend/node_modules/.pnpm/node_modules/isarray new file mode 120000 index 00000000..b7bd13a2 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/isarray @@ -0,0 +1 @@ +../isarray@2.0.5/node_modules/isarray \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/kareem b/backend/node_modules/.pnpm/node_modules/kareem new file mode 120000 index 00000000..0c7686dd --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/kareem @@ -0,0 +1 @@ +../kareem@3.4.0/node_modules/kareem \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/lodash.sortby b/backend/node_modules/.pnpm/node_modules/lodash.sortby new file mode 120000 index 00000000..5c8cf26a --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/lodash.sortby @@ -0,0 +1 @@ +../lodash.sortby@4.7.0/node_modules/lodash.sortby \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/loglevel b/backend/node_modules/.pnpm/node_modules/loglevel new file mode 120000 index 00000000..3dad16b7 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/loglevel @@ -0,0 +1 @@ +../loglevel@1.9.2/node_modules/loglevel \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/long b/backend/node_modules/.pnpm/node_modules/long new file mode 120000 index 00000000..769d82f7 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/long @@ -0,0 +1 @@ +../long@4.0.0/node_modules/long \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/lru-cache b/backend/node_modules/.pnpm/node_modules/lru-cache new file mode 120000 index 00000000..4b94077d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/lru-cache @@ -0,0 +1 @@ +../lru-cache@11.5.3/node_modules/lru-cache \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/math-intrinsics b/backend/node_modules/.pnpm/node_modules/math-intrinsics new file mode 120000 index 00000000..8b700554 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/math-intrinsics @@ -0,0 +1 @@ +../math-intrinsics@1.1.0/node_modules/math-intrinsics \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/media-typer b/backend/node_modules/.pnpm/node_modules/media-typer new file mode 120000 index 00000000..b2114816 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/media-typer @@ -0,0 +1 @@ +../media-typer@1.1.1/node_modules/media-typer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/memory-pager b/backend/node_modules/.pnpm/node_modules/memory-pager new file mode 120000 index 00000000..34fecd14 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/memory-pager @@ -0,0 +1 @@ +../memory-pager@1.5.0/node_modules/memory-pager \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/mime-db b/backend/node_modules/.pnpm/node_modules/mime-db new file mode 120000 index 00000000..a94ea4a9 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/mime-db @@ -0,0 +1 @@ +../mime-db@1.54.0/node_modules/mime-db \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/mime-types b/backend/node_modules/.pnpm/node_modules/mime-types new file mode 120000 index 00000000..49b86321 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/mime-types @@ -0,0 +1 @@ +../mime-types@3.0.2/node_modules/mime-types \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/mongodb b/backend/node_modules/.pnpm/node_modules/mongodb new file mode 120000 index 00000000..2fa95896 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/mongodb @@ -0,0 +1 @@ +../mongodb@7.6.0/node_modules/mongodb \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/mongodb-connection-string-url b/backend/node_modules/.pnpm/node_modules/mongodb-connection-string-url new file mode 120000 index 00000000..70172ec9 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/mongodb-connection-string-url @@ -0,0 +1 @@ +../mongodb-connection-string-url@7.0.2/node_modules/mongodb-connection-string-url \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/mpath b/backend/node_modules/.pnpm/node_modules/mpath new file mode 120000 index 00000000..90131e8e --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/mpath @@ -0,0 +1 @@ +../mpath@0.9.0/node_modules/mpath \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/mquery b/backend/node_modules/.pnpm/node_modules/mquery new file mode 120000 index 00000000..876ef678 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/mquery @@ -0,0 +1 @@ +../mquery@6.0.0/node_modules/mquery \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/ms b/backend/node_modules/.pnpm/node_modules/ms new file mode 120000 index 00000000..8fe8ed9c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/ms @@ -0,0 +1 @@ +../ms@2.1.3/node_modules/ms \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/negotiator b/backend/node_modules/.pnpm/node_modules/negotiator new file mode 120000 index 00000000..5fa7367d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/negotiator @@ -0,0 +1 @@ +../negotiator@1.1.0/node_modules/negotiator \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/object-assign b/backend/node_modules/.pnpm/node_modules/object-assign new file mode 120000 index 00000000..edca1540 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/object-assign @@ -0,0 +1 @@ +../object-assign@4.1.1/node_modules/object-assign \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/object-inspect b/backend/node_modules/.pnpm/node_modules/object-inspect new file mode 120000 index 00000000..ae8752be --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/object-inspect @@ -0,0 +1 @@ +../object-inspect@1.13.4/node_modules/object-inspect \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/on-finished b/backend/node_modules/.pnpm/node_modules/on-finished new file mode 120000 index 00000000..2382cdda --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/on-finished @@ -0,0 +1 @@ +../on-finished@2.4.1/node_modules/on-finished \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/parseurl b/backend/node_modules/.pnpm/node_modules/parseurl new file mode 120000 index 00000000..6eaaeab5 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/parseurl @@ -0,0 +1 @@ +../parseurl@1.3.3/node_modules/parseurl \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/possible-typed-array-names b/backend/node_modules/.pnpm/node_modules/possible-typed-array-names new file mode 120000 index 00000000..0526aeb8 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/possible-typed-array-names @@ -0,0 +1 @@ +../possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/punycode b/backend/node_modules/.pnpm/node_modules/punycode new file mode 120000 index 00000000..089b7d71 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/punycode @@ -0,0 +1 @@ +../punycode@2.3.1/node_modules/punycode \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/qs b/backend/node_modules/.pnpm/node_modules/qs new file mode 120000 index 00000000..93193fb6 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/qs @@ -0,0 +1 @@ +../qs@6.16.0/node_modules/qs \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/raw-body b/backend/node_modules/.pnpm/node_modules/raw-body new file mode 120000 index 00000000..bfcdc468 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/raw-body @@ -0,0 +1 @@ +../raw-body@3.0.2/node_modules/raw-body \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/retry b/backend/node_modules/.pnpm/node_modules/retry new file mode 120000 index 00000000..aff74d89 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/retry @@ -0,0 +1 @@ +../retry@0.13.1/node_modules/retry \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/safe-buffer b/backend/node_modules/.pnpm/node_modules/safe-buffer new file mode 120000 index 00000000..d65f2504 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/safe-buffer @@ -0,0 +1 @@ +../safe-buffer@5.2.1/node_modules/safe-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/safer-buffer b/backend/node_modules/.pnpm/node_modules/safer-buffer new file mode 120000 index 00000000..11a0ff5c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/safer-buffer @@ -0,0 +1 @@ +../safer-buffer@2.1.2/node_modules/safer-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/set-function-length b/backend/node_modules/.pnpm/node_modules/set-function-length new file mode 120000 index 00000000..6d38705a --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/set-function-length @@ -0,0 +1 @@ +../set-function-length@1.2.2/node_modules/set-function-length \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/setprototypeof b/backend/node_modules/.pnpm/node_modules/setprototypeof new file mode 120000 index 00000000..12ccc191 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/setprototypeof @@ -0,0 +1 @@ +../setprototypeof@1.2.0/node_modules/setprototypeof \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/sha.js b/backend/node_modules/.pnpm/node_modules/sha.js new file mode 120000 index 00000000..6b40369d --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/sha.js @@ -0,0 +1 @@ +../sha.js@2.4.12/node_modules/sha.js \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/side-channel b/backend/node_modules/.pnpm/node_modules/side-channel new file mode 120000 index 00000000..af0038a4 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/side-channel @@ -0,0 +1 @@ +../side-channel@1.1.1/node_modules/side-channel \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/side-channel-list b/backend/node_modules/.pnpm/node_modules/side-channel-list new file mode 120000 index 00000000..9b1dc136 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/side-channel-list @@ -0,0 +1 @@ +../side-channel-list@1.0.1/node_modules/side-channel-list \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/side-channel-map b/backend/node_modules/.pnpm/node_modules/side-channel-map new file mode 120000 index 00000000..2096421c --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/side-channel-map @@ -0,0 +1 @@ +../side-channel-map@1.0.1/node_modules/side-channel-map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/side-channel-weakmap b/backend/node_modules/.pnpm/node_modules/side-channel-weakmap new file mode 120000 index 00000000..8c117684 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/side-channel-weakmap @@ -0,0 +1 @@ +../side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/sift b/backend/node_modules/.pnpm/node_modules/sift new file mode 120000 index 00000000..c41dc2c1 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/sift @@ -0,0 +1 @@ +../sift@17.1.3/node_modules/sift \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/sparse-bitfield b/backend/node_modules/.pnpm/node_modules/sparse-bitfield new file mode 120000 index 00000000..b7bb667a --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/sparse-bitfield @@ -0,0 +1 @@ +../sparse-bitfield@3.0.3/node_modules/sparse-bitfield \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/statuses b/backend/node_modules/.pnpm/node_modules/statuses new file mode 120000 index 00000000..30c19810 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/statuses @@ -0,0 +1 @@ +../statuses@2.0.2/node_modules/statuses \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/to-buffer b/backend/node_modules/.pnpm/node_modules/to-buffer new file mode 120000 index 00000000..67c93cdd --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/to-buffer @@ -0,0 +1 @@ +../to-buffer@1.2.2/node_modules/to-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/toidentifier b/backend/node_modules/.pnpm/node_modules/toidentifier new file mode 120000 index 00000000..bf6adae1 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/toidentifier @@ -0,0 +1 @@ +../toidentifier@1.0.1/node_modules/toidentifier \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/tr46 b/backend/node_modules/.pnpm/node_modules/tr46 new file mode 120000 index 00000000..a787e172 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/tr46 @@ -0,0 +1 @@ +../tr46@5.1.1/node_modules/tr46 \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/tslib b/backend/node_modules/.pnpm/node_modules/tslib new file mode 120000 index 00000000..9e1c1d38 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/tslib @@ -0,0 +1 @@ +../tslib@2.8.1/node_modules/tslib \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/type-is b/backend/node_modules/.pnpm/node_modules/type-is new file mode 120000 index 00000000..a5575975 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/type-is @@ -0,0 +1 @@ +../type-is@2.1.0/node_modules/type-is \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/typed-array-buffer b/backend/node_modules/.pnpm/node_modules/typed-array-buffer new file mode 120000 index 00000000..d0833d16 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/typed-array-buffer @@ -0,0 +1 @@ +../typed-array-buffer@1.0.3/node_modules/typed-array-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/unpipe b/backend/node_modules/.pnpm/node_modules/unpipe new file mode 120000 index 00000000..5f5cc3e3 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/unpipe @@ -0,0 +1 @@ +../unpipe@1.0.0/node_modules/unpipe \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/vary b/backend/node_modules/.pnpm/node_modules/vary new file mode 120000 index 00000000..b6ed933e --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/vary @@ -0,0 +1 @@ +../vary@1.1.2/node_modules/vary \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/webidl-conversions b/backend/node_modules/.pnpm/node_modules/webidl-conversions new file mode 120000 index 00000000..5f8c4c88 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/webidl-conversions @@ -0,0 +1 @@ +../webidl-conversions@7.0.0/node_modules/webidl-conversions \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/whatwg-mimetype b/backend/node_modules/.pnpm/node_modules/whatwg-mimetype new file mode 120000 index 00000000..cac90be7 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/whatwg-mimetype @@ -0,0 +1 @@ +../whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/whatwg-url b/backend/node_modules/.pnpm/node_modules/whatwg-url new file mode 120000 index 00000000..a746abc7 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/whatwg-url @@ -0,0 +1 @@ +../whatwg-url@14.2.0/node_modules/whatwg-url \ No newline at end of file diff --git a/backend/node_modules/.pnpm/node_modules/which-typed-array b/backend/node_modules/.pnpm/node_modules/which-typed-array new file mode 120000 index 00000000..80deabd3 --- /dev/null +++ b/backend/node_modules/.pnpm/node_modules/which-typed-array @@ -0,0 +1 @@ +../which-typed-array@1.1.24/node_modules/which-typed-array \ No newline at end of file diff --git a/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js new file mode 100644 index 00000000..0930cf88 --- /dev/null +++ b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/license b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/package.json b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/package.json new file mode 100644 index 00000000..503eb1e6 --- /dev/null +++ b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/package.json @@ -0,0 +1,42 @@ +{ + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } +} diff --git a/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/readme.md b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/readme.md new file mode 100644 index 00000000..1be09d35 --- /dev/null +++ b/backend/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.eslintrc b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.eslintrc new file mode 100644 index 00000000..21f90392 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.eslintrc @@ -0,0 +1,53 @@ +{ + "root": true, + "extends": "@ljharb", + "rules": { + "complexity": 0, + "func-style": [2, "declaration"], + "indent": [2, 4], + "max-lines": 1, + "max-lines-per-function": 1, + "max-params": [2, 4], + "max-statements": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": 0, + "no-param-reassign": 1, + "strict": 0, // TODO + }, + "overrides": [ + { + "files": ["test/**", "test-*", "example/**"], + "extends": "@ljharb/eslint-config/tests", + "rules": { + "id-length": 0, + }, + }, + { + "files": ["example/**"], + "rules": { + "no-console": 0, + }, + }, + { + "files": ["test/browser/**"], + "env": { + "browser": true, + }, + }, + { + "files": ["test/bigint*"], + "rules": { + "new-cap": [2, { "capIsNewExceptions": ["BigInt"] }], + }, + }, + { + "files": "index.js", + "globals": { + "HTMLElement": false, + }, + "rules": { + "no-use-before-define": 1, + }, + }, + ], +} diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.github/FUNDING.yml b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.github/FUNDING.yml new file mode 100644 index 00000000..730276bd --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/object-inspect +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.nycrc b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.nycrc new file mode 100644 index 00000000..58a5db78 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "instrumentation": false, + "sourceMap": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "example", + "test", + "test-core-js.js" + ] +} diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/CHANGELOG.md b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/CHANGELOG.md new file mode 100644 index 00000000..bdf90027 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/CHANGELOG.md @@ -0,0 +1,424 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.13.4](https://github.com/inspect-js/object-inspect/compare/v1.13.3...v1.13.4) - 2025-02-04 + +### Commits + +- [Fix] avoid being fooled by a `Symbol.toStringTag` [`fa5870d`](https://github.com/inspect-js/object-inspect/commit/fa5870da468a525d2f20193700f70752f506cbf7) +- [Tests] fix tests in node v6.0 - v6.4 [`2abfe1b`](https://github.com/inspect-js/object-inspect/commit/2abfe1bc3c69f9293c07c5cd65a9d7d87a628b84) +- [Dev Deps] update `es-value-fixtures`, `for-each`, `has-symbols` [`3edfb01`](https://github.com/inspect-js/object-inspect/commit/3edfb01cc8cce220fba0dfdfe2dc8bc955758cdd) + +## [v1.13.3](https://github.com/inspect-js/object-inspect/compare/v1.13.2...v1.13.3) - 2024-11-09 + +### Commits + +- [actions] split out node 10-20, and 20+ [`44395a8`](https://github.com/inspect-js/object-inspect/commit/44395a8fc1deda6718a5e125e86b9ffcaa1c7580) +- [Fix] `quoteStyle`: properly escape only the containing quotes [`5137f8f`](https://github.com/inspect-js/object-inspect/commit/5137f8f7bea69a7fc671bb683fd35f244f38fc52) +- [Refactor] clean up `quoteStyle` code [`450680c`](https://github.com/inspect-js/object-inspect/commit/450680cd50de4e689ee3b8e1d6db3a1bcf3fc18c) +- [Tests] add `quoteStyle` escaping tests [`e997c59`](https://github.com/inspect-js/object-inspect/commit/e997c595aeaea84fd98ca35d7e1c3b5ab3ae26e0) +- [Dev Deps] update `auto-changelog`, `es-value-fixtures`, `tape` [`d5a469c`](https://github.com/inspect-js/object-inspect/commit/d5a469c99ec07ccaeafc36ac4b36a93285086d48) +- [Tests] replace `aud` with `npm audit` [`fb7815f`](https://github.com/inspect-js/object-inspect/commit/fb7815f9b72cae277a04f65bbb0543f85b88be62) +- [Dev Deps] update `mock-property` [`11c817b`](https://github.com/inspect-js/object-inspect/commit/11c817bf10392aa017755962ba6bc89d731359ee) + +## [v1.13.2](https://github.com/inspect-js/object-inspect/compare/v1.13.1...v1.13.2) - 2024-06-21 + +### Commits + +- [readme] update badges [`8a51e6b`](https://github.com/inspect-js/object-inspect/commit/8a51e6bedaf389ec40cc4659e9df53e8543d176e) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`ef05f58`](https://github.com/inspect-js/object-inspect/commit/ef05f58c9761a41416ab907299bf0fa79517014b) +- [Dev Deps] update `error-cause`, `has-tostringtag`, `tape` [`c0c6c26`](https://github.com/inspect-js/object-inspect/commit/c0c6c26c44cee6671f7c5d43d2b91d27c5c00d90) +- [Fix] Don't throw when `global` is not defined [`d4d0965`](https://github.com/inspect-js/object-inspect/commit/d4d096570f7dbd0e03266a96de11d05eb7b63e0f) +- [meta] add missing `engines.node` [`17a352a`](https://github.com/inspect-js/object-inspect/commit/17a352af6fe1ba6b70a19081674231eb1a50c940) +- [Dev Deps] update `globalthis` [`9c08884`](https://github.com/inspect-js/object-inspect/commit/9c08884aa662a149e2f11403f413927736b97da7) +- [Dev Deps] update `error-cause` [`6af352d`](https://github.com/inspect-js/object-inspect/commit/6af352d7c3929a4cc4c55768c27bf547a5e900f4) +- [Dev Deps] update `npmignore` [`94e617d`](https://github.com/inspect-js/object-inspect/commit/94e617d38831722562fa73dff4c895746861d267) +- [Dev Deps] update `mock-property` [`2ac24d7`](https://github.com/inspect-js/object-inspect/commit/2ac24d7e58cd388ad093c33249e413e05bbfd6c3) +- [Dev Deps] update `tape` [`46125e5`](https://github.com/inspect-js/object-inspect/commit/46125e58f1d1dcfb170ed3d1ea69da550ea8d77b) + +## [v1.13.1](https://github.com/inspect-js/object-inspect/compare/v1.13.0...v1.13.1) - 2023-10-19 + +### Commits + +- [Fix] in IE 8, global can !== window despite them being prototypes of each other [`30d0859`](https://github.com/inspect-js/object-inspect/commit/30d0859dc4606cf75c2410edcd5d5c6355f8d372) + +## [v1.13.0](https://github.com/inspect-js/object-inspect/compare/v1.12.3...v1.13.0) - 2023-10-14 + +### Commits + +- [New] add special handling for the global object [`431bab2`](https://github.com/inspect-js/object-inspect/commit/431bab21a490ee51d35395966a504501e8c685da) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`fd4f619`](https://github.com/inspect-js/object-inspect/commit/fd4f6193562b4b0e95dcf5c0201b4e8cbbc4f58d) +- [Dev Deps] update `mock-property`, `tape` [`b453f6c`](https://github.com/inspect-js/object-inspect/commit/b453f6ceeebf8a1b738a1029754092e0367a4134) +- [Dev Deps] update `error-cause` [`e8ffc57`](https://github.com/inspect-js/object-inspect/commit/e8ffc577d73b92bb6a4b00c44f14e3319e374888) +- [Dev Deps] update `tape` [`054b8b9`](https://github.com/inspect-js/object-inspect/commit/054b8b9b98633284cf989e582450ebfbbe53503c) +- [Dev Deps] temporarily remove `aud` due to breaking change in transitive deps [`2476845`](https://github.com/inspect-js/object-inspect/commit/2476845e0678dd290c541c81cd3dec8420782c52) +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` [`383fa5e`](https://github.com/inspect-js/object-inspect/commit/383fa5eebc0afd705cc778a4b49d8e26452e49a8) +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 [`68c244c`](https://github.com/inspect-js/object-inspect/commit/68c244c5174cdd877e5dcb8ee90aa3f44b2f25be) + +## [v1.12.3](https://github.com/inspect-js/object-inspect/compare/v1.12.2...v1.12.3) - 2023-01-12 + +### Commits + +- [Fix] in eg FF 24, collections lack forEach [`75fc226`](https://github.com/inspect-js/object-inspect/commit/75fc22673c82d45f28322b1946bb0eb41b672b7f) +- [actions] update rebase action to use reusable workflow [`250a277`](https://github.com/inspect-js/object-inspect/commit/250a277a095e9dacc029ab8454dcfc15de549dcd) +- [Dev Deps] update `aud`, `es-value-fixtures`, `tape` [`66a19b3`](https://github.com/inspect-js/object-inspect/commit/66a19b3209ccc3c5ef4b34c3cb0160e65d1ce9d5) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `error-cause` [`c43d332`](https://github.com/inspect-js/object-inspect/commit/c43d3324b48384a16fd3dc444e5fc589d785bef3) +- [Tests] add `@pkgjs/support` to `postlint` [`e2618d2`](https://github.com/inspect-js/object-inspect/commit/e2618d22a7a3fa361b6629b53c1752fddc9c4d80) + +## [v1.12.2](https://github.com/inspect-js/object-inspect/compare/v1.12.1...v1.12.2) - 2022-05-26 + +### Commits + +- [Fix] use `util.inspect` for a custom inspection symbol method [`e243bf2`](https://github.com/inspect-js/object-inspect/commit/e243bf2eda6c4403ac6f1146fddb14d12e9646c1) +- [meta] add support info [`ca20ba3`](https://github.com/inspect-js/object-inspect/commit/ca20ba35713c17068ca912a86c542f5e8acb656c) +- [Fix] ignore `cause` in node v16.9 and v16.10 where it has a bug [`86aa553`](https://github.com/inspect-js/object-inspect/commit/86aa553a4a455562c2c56f1540f0bf857b9d314b) + +## [v1.12.1](https://github.com/inspect-js/object-inspect/compare/v1.12.0...v1.12.1) - 2022-05-21 + +### Commits + +- [Tests] use `mock-property` [`4ec8893`](https://github.com/inspect-js/object-inspect/commit/4ec8893ea9bfd28065ca3638cf6762424bf44352) +- [meta] use `npmignore` to autogenerate an npmignore file [`07f868c`](https://github.com/inspect-js/object-inspect/commit/07f868c10bd25a9d18686528339bb749c211fc9a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b05244b`](https://github.com/inspect-js/object-inspect/commit/b05244b4f331e00c43b3151bc498041be77ccc91) +- [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `es-value-fixtures`, `functions-have-names`, `tape` [`d037398`](https://github.com/inspect-js/object-inspect/commit/d037398dcc5d531532e4c19c4a711ed677f579c1) +- [Fix] properly handle callable regexes in older engines [`848fe48`](https://github.com/inspect-js/object-inspect/commit/848fe48bd6dd0064ba781ee6f3c5e54a94144c37) + +## [v1.12.0](https://github.com/inspect-js/object-inspect/compare/v1.11.1...v1.12.0) - 2021-12-18 + +### Commits + +- [New] add `numericSeparator` boolean option [`2d2d537`](https://github.com/inspect-js/object-inspect/commit/2d2d537f5359a4300ce1c10241369f8024f89e11) +- [Robustness] cache more prototype methods [`191533d`](https://github.com/inspect-js/object-inspect/commit/191533da8aec98a05eadd73a5a6e979c9c8653e8) +- [New] ensure an Error’s `cause` is displayed [`53bc2ce`](https://github.com/inspect-js/object-inspect/commit/53bc2cee4e5a9cc4986f3cafa22c0685f340715e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`bc164b6`](https://github.com/inspect-js/object-inspect/commit/bc164b6e2e7d36b263970f16f54de63048b84a36) +- [Robustness] cache `RegExp.prototype.test` [`a314ab8`](https://github.com/inspect-js/object-inspect/commit/a314ab8271b905cbabc594c82914d2485a8daf12) +- [meta] fix auto-changelog settings [`5ed0983`](https://github.com/inspect-js/object-inspect/commit/5ed0983be72f73e32e2559997517a95525c7e20d) + +## [v1.11.1](https://github.com/inspect-js/object-inspect/compare/v1.11.0...v1.11.1) - 2021-12-05 + +### Commits + +- [meta] add `auto-changelog` [`7dbdd22`](https://github.com/inspect-js/object-inspect/commit/7dbdd228401d6025d8b7391476d88aee9ea9bbdf) +- [actions] reuse common workflows [`c8823bc`](https://github.com/inspect-js/object-inspect/commit/c8823bc0a8790729680709d45fb6e652432e91aa) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`7532b12`](https://github.com/inspect-js/object-inspect/commit/7532b120598307497b712890f75af8056f6d37a6) +- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`94abb5d`](https://github.com/inspect-js/object-inspect/commit/94abb5d4e745bf33253942dea86b3e538d2ff6c6) +- [actions] update codecov uploader [`5ed5102`](https://github.com/inspect-js/object-inspect/commit/5ed51025267a00e53b1341357315490ac4eb0874) +- [Dev Deps] update `eslint`, `tape` [`37b2ad2`](https://github.com/inspect-js/object-inspect/commit/37b2ad26c08d94bfd01d5d07069a0b28ef4e2ad7) +- [meta] add `sideEffects` flag [`d341f90`](https://github.com/inspect-js/object-inspect/commit/d341f905ef8bffa6a694cda6ddc5ba343532cd4f) + +## [v1.11.0](https://github.com/inspect-js/object-inspect/compare/v1.10.3...v1.11.0) - 2021-07-12 + +### Commits + +- [New] `customInspect`: add `symbol` option, to mimic modern util.inspect behavior [`e973a6e`](https://github.com/inspect-js/object-inspect/commit/e973a6e21f8140c5837cf25e9d89bdde88dc3120) +- [Dev Deps] update `eslint` [`05f1cb3`](https://github.com/inspect-js/object-inspect/commit/05f1cb3cbcfe1f238e8b51cf9bc294305b7ed793) + +## [v1.10.3](https://github.com/inspect-js/object-inspect/compare/v1.10.2...v1.10.3) - 2021-05-07 + +### Commits + +- [Fix] handle core-js Symbol shams [`4acfc2c`](https://github.com/inspect-js/object-inspect/commit/4acfc2c4b503498759120eb517abad6d51c9c5d6) +- [readme] update badges [`95c323a`](https://github.com/inspect-js/object-inspect/commit/95c323ad909d6cbabb95dd6015c190ba6db9c1f2) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`cb38f48`](https://github.com/inspect-js/object-inspect/commit/cb38f485de6ec7a95109b5a9bbd0a1deba2f6611) + +## [v1.10.2](https://github.com/inspect-js/object-inspect/compare/v1.10.1...v1.10.2) - 2021-04-17 + +### Commits + +- [Fix] use a robust check for a boxed Symbol [`87f12d6`](https://github.com/inspect-js/object-inspect/commit/87f12d6e69ce530be04659c81a4cd502943acac5) + +## [v1.10.1](https://github.com/inspect-js/object-inspect/compare/v1.10.0...v1.10.1) - 2021-04-17 + +### Commits + +- [Fix] use a robust check for a boxed bigint [`d5ca829`](https://github.com/inspect-js/object-inspect/commit/d5ca8298b6d2e5c7b9334a5b21b96ed95d225c91) + +## [v1.10.0](https://github.com/inspect-js/object-inspect/compare/v1.9.0...v1.10.0) - 2021-04-17 + +### Commits + +- [Tests] increase coverage [`d8abb8a`](https://github.com/inspect-js/object-inspect/commit/d8abb8a62c2f084919df994a433b346e0d87a227) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`4bfec2e`](https://github.com/inspect-js/object-inspect/commit/4bfec2e30aaef6ddef6cbb1448306f9f8b9520b7) +- [New] respect `Symbol.toStringTag` on objects [`799b58f`](https://github.com/inspect-js/object-inspect/commit/799b58f536a45e4484633a8e9daeb0330835f175) +- [Fix] do not allow Symbol.toStringTag to masquerade as builtins [`d6c5b37`](https://github.com/inspect-js/object-inspect/commit/d6c5b37d7e94427796b82432fb0c8964f033a6ab) +- [New] add `WeakRef` support [`b6d898e`](https://github.com/inspect-js/object-inspect/commit/b6d898ee21868c780a7ee66b28532b5b34ed7f09) +- [meta] do not publish github action workflow files [`918cdfc`](https://github.com/inspect-js/object-inspect/commit/918cdfc4b6fe83f559ff6ef04fe66201e3ff5cbd) +- [meta] create `FUNDING.yml` [`0bb5fc5`](https://github.com/inspect-js/object-inspect/commit/0bb5fc516dbcd2cd728bd89cee0b580acc5ce301) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`22c8dc0`](https://github.com/inspect-js/object-inspect/commit/22c8dc0cac113d70f4781e49a950070923a671be) +- [meta] use `prepublishOnly` script for npm 7+ [`e52ee09`](https://github.com/inspect-js/object-inspect/commit/e52ee09e8050b8dbac94ef57f786675567728223) +- [Dev Deps] update `eslint` [`7c4e6fd`](https://github.com/inspect-js/object-inspect/commit/7c4e6fdedcd27cc980e13c9ad834d05a96f3d40c) + +## [v1.9.0](https://github.com/inspect-js/object-inspect/compare/v1.8.0...v1.9.0) - 2020-11-30 + +### Commits + +- [Tests] migrate tests to Github Actions [`d262251`](https://github.com/inspect-js/object-inspect/commit/d262251e13e16d3490b5473672f6b6d6ff86675d) +- [New] add enumerable own Symbols to plain object output [`ee60c03`](https://github.com/inspect-js/object-inspect/commit/ee60c033088cff9d33baa71e59a362a541b48284) +- [Tests] add passing tests [`01ac3e4`](https://github.com/inspect-js/object-inspect/commit/01ac3e4b5a30f97875a63dc9b1416b3bd626afc9) +- [actions] add "Require Allow Edits" action [`c2d7746`](https://github.com/inspect-js/object-inspect/commit/c2d774680cde4ca4af332d84d4121b26f798ba9e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `core-js` [`70058de`](https://github.com/inspect-js/object-inspect/commit/70058de1579fc54d1d15ed6c2dbe246637ce70ff) +- [Fix] hex characters in strings should be uppercased, to match node `assert` [`6ab8faa`](https://github.com/inspect-js/object-inspect/commit/6ab8faaa0abc08fe7a8e2afd8b39c6f1f0e00113) +- [Tests] run `nyc` on all tests [`4c47372`](https://github.com/inspect-js/object-inspect/commit/4c473727879ddc8e28b599202551ddaaf07b6210) +- [Tests] node 0.8 has an unpredictable property order; fix `groups` test by removing property [`f192069`](https://github.com/inspect-js/object-inspect/commit/f192069a978a3b60e6f0e0d45ac7df260ab9a778) +- [New] add enumerable properties to Function inspect result, per node’s `assert` [`fd38e1b`](https://github.com/inspect-js/object-inspect/commit/fd38e1bc3e2a1dc82091ce3e021917462eee64fc) +- [Tests] fix tests for node < 10, due to regex match `groups` [`2ac6462`](https://github.com/inspect-js/object-inspect/commit/2ac6462cc4f72eaa0b63a8cfee9aabe3008b2330) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`44b59e2`](https://github.com/inspect-js/object-inspect/commit/44b59e2676a7f825ef530dfd19dafb599e3b9456) +- [Robustness] cache `Symbol.prototype.toString` [`f3c2074`](https://github.com/inspect-js/object-inspect/commit/f3c2074d8f32faf8292587c07c9678ea931703dd) +- [Dev Deps] update `eslint` [`9411294`](https://github.com/inspect-js/object-inspect/commit/94112944b9245e3302e25453277876402d207e7f) +- [meta] `require-allow-edits` no longer requires an explicit github token [`36c0220`](https://github.com/inspect-js/object-inspect/commit/36c02205de3c2b0e84d53777c5c9fd54a36c48ab) +- [actions] update rebase checkout action to v2 [`55a39a6`](https://github.com/inspect-js/object-inspect/commit/55a39a64e944f19c6a7d8efddf3df27700f20d14) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`f59fd3c`](https://github.com/inspect-js/object-inspect/commit/f59fd3cf406c3a7c7ece140904a80bbc6bacfcca) +- [Dev Deps] update `eslint` [`a492bec`](https://github.com/inspect-js/object-inspect/commit/a492becec644b0155c9c4bc1caf6f9fac11fb2c7) + +## [v1.8.0](https://github.com/inspect-js/object-inspect/compare/v1.7.0...v1.8.0) - 2020-06-18 + +### Fixed + +- [New] add `indent` option [`#27`](https://github.com/inspect-js/object-inspect/issues/27) + +### Commits + +- [Tests] add codecov [`4324cbb`](https://github.com/inspect-js/object-inspect/commit/4324cbb1a2bd7710822a4151ff373570db22453e) +- [New] add `maxStringLength` option [`b3995cb`](https://github.com/inspect-js/object-inspect/commit/b3995cb71e15b5ee127a3094c43994df9d973502) +- [New] add `customInspect` option, to disable custom inspect methods [`28b9179`](https://github.com/inspect-js/object-inspect/commit/28b9179ee802bb3b90810100c11637db90c2fb6d) +- [Tests] add Date and RegExp tests [`3b28eca`](https://github.com/inspect-js/object-inspect/commit/3b28eca57b0367aeadffac604ea09e8bdae7d97b) +- [actions] add automatic rebasing / merge commit blocking [`0d9c6c0`](https://github.com/inspect-js/object-inspect/commit/0d9c6c044e83475ff0bfffb9d35b149834c83a2e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape`; add `aud` [`7c204f2`](https://github.com/inspect-js/object-inspect/commit/7c204f22b9e41bc97147f4d32d4cb045b17769a6) +- [readme] fix repo URLs, remove testling [`34ca9a0`](https://github.com/inspect-js/object-inspect/commit/34ca9a0dabfe75bd311f806a326fadad029909a3) +- [Fix] when truncating a deep array, note it as `[Array]` instead of just `[Object]` [`f74c82d`](https://github.com/inspect-js/object-inspect/commit/f74c82dd0b35386445510deb250f34c41be3ec0e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1a8a5ea`](https://github.com/inspect-js/object-inspect/commit/1a8a5ea069ea2bee89d77caedad83ffa23d35711) +- [Fix] do not be fooled by a function’s own `toString` method [`7cb5c65`](https://github.com/inspect-js/object-inspect/commit/7cb5c657a976f94715c19c10556a30f15bb7d5d7) +- [patch] indicate explicitly that anon functions are anonymous, to match node [`81ebdd4`](https://github.com/inspect-js/object-inspect/commit/81ebdd4215005144074bbdff3f6bafa01407910a) +- [Dev Deps] loosen the `core-js` dep [`e7472e8`](https://github.com/inspect-js/object-inspect/commit/e7472e8e242117670560bd995830c2a4d12080f5) +- [Dev Deps] update `tape` [`699827e`](https://github.com/inspect-js/object-inspect/commit/699827e6b37258b5203c33c78c009bf4b0e6a66d) +- [meta] add `safe-publish-latest` [`c5d2868`](https://github.com/inspect-js/object-inspect/commit/c5d2868d6eb33c472f37a20f89ceef2787046088) +- [Dev Deps] update `@ljharb/eslint-config` [`9199501`](https://github.com/inspect-js/object-inspect/commit/919950195d486114ccebacbdf9d74d7f382693b0) + +## [v1.7.0](https://github.com/inspect-js/object-inspect/compare/v1.6.0...v1.7.0) - 2019-11-10 + +### Commits + +- [Tests] use shared travis-ci configs [`19899ed`](https://github.com/inspect-js/object-inspect/commit/19899edbf31f4f8809acf745ce34ad1ce1bfa63b) +- [Tests] add linting [`a00f057`](https://github.com/inspect-js/object-inspect/commit/a00f057d917f66ea26dd37769c6b810ec4af97e8) +- [Tests] lint last file [`2698047`](https://github.com/inspect-js/object-inspect/commit/2698047b58af1e2e88061598ef37a75f228dddf6) +- [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`589e87a`](https://github.com/inspect-js/object-inspect/commit/589e87a99cadcff4b600e6a303418e9d922836e8) +- [New] add support for `WeakMap` and `WeakSet` [`3ddb3e4`](https://github.com/inspect-js/object-inspect/commit/3ddb3e4e0c8287130c61a12e0ed9c104b1549306) +- [meta] clean up license so github can detect it properly [`27527bb`](https://github.com/inspect-js/object-inspect/commit/27527bb801520c9610c68cc3b55d6f20a2bee56d) +- [Tests] cover `util.inspect.custom` [`36d47b9`](https://github.com/inspect-js/object-inspect/commit/36d47b9c59056a57ef2f1491602c726359561800) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape` [`b614eaa`](https://github.com/inspect-js/object-inspect/commit/b614eaac901da0e5c69151f534671f990a94cace) +- [Tests] fix coverage thresholds [`7b7b176`](https://github.com/inspect-js/object-inspect/commit/7b7b176e15f8bd6e8b2f261ff5a493c2fe78d9c2) +- [Tests] bigint tests now can run on unflagged node [`063af31`](https://github.com/inspect-js/object-inspect/commit/063af31ce9cd13c202e3b67c07ba06dc9b7c0f81) +- [Refactor] add early bailout to `isMap` and `isSet` checks [`fc51047`](https://github.com/inspect-js/object-inspect/commit/fc5104714a3671d37e225813db79470d6335683b) +- [meta] add `funding` field [`7f9953a`](https://github.com/inspect-js/object-inspect/commit/7f9953a113eec7b064a6393cf9f90ba15f1d131b) +- [Tests] Fix invalid strict-mode syntax with hexadecimal [`a8b5425`](https://github.com/inspect-js/object-inspect/commit/a8b542503b4af1599a275209a1a99f5fdedb1ead) +- [Dev Deps] update `@ljharb/eslint-config` [`98df157`](https://github.com/inspect-js/object-inspect/commit/98df1577314d9188a3fc3f17fdcf2fba697ae1bd) +- add copyright to LICENSE [`bb69fd0`](https://github.com/inspect-js/object-inspect/commit/bb69fd017a062d299e44da1f9b2c7dcd67f621e6) +- [Tests] use `npx aud` in `posttest` [`4838353`](https://github.com/inspect-js/object-inspect/commit/4838353593974cf7f905b9ef04c03c094f0cdbe2) +- [Tests] move `0.6` to allowed failures, because it won‘t build on travis [`1bff32a`](https://github.com/inspect-js/object-inspect/commit/1bff32aa52e8aea687f0856b28ba754b3e43ebf7) + +## [v1.6.0](https://github.com/inspect-js/object-inspect/compare/v1.5.0...v1.6.0) - 2018-05-02 + +### Commits + +- [New] add support for boxed BigInt primitives [`356c66a`](https://github.com/inspect-js/object-inspect/commit/356c66a410e7aece7162c8319880a5ef647beaa9) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`c77b65b`](https://github.com/inspect-js/object-inspect/commit/c77b65bba593811b906b9ec57561c5cba92e2db3) +- [New] Add support for upcoming `BigInt` [`1ac548e`](https://github.com/inspect-js/object-inspect/commit/1ac548e4b27e26466c28c9a5e63e5d4e0591c31f) +- [Tests] run bigint tests in CI with --harmony-bigint flag [`d31b738`](https://github.com/inspect-js/object-inspect/commit/d31b73831880254b5c6cf5691cda9a149fbc5f04) +- [Dev Deps] update `core-js`, `tape` [`ff9eff6`](https://github.com/inspect-js/object-inspect/commit/ff9eff67113341ee1aaf80c1c22d683f43bfbccf) +- [Docs] fix example to use `safer-buffer` [`48cae12`](https://github.com/inspect-js/object-inspect/commit/48cae12a73ec6cacc955175bc56bbe6aee6a211f) + +## [v1.5.0](https://github.com/inspect-js/object-inspect/compare/v1.4.1...v1.5.0) - 2017-12-25 + +### Commits + +- [New] add `quoteStyle` option [`f5a72d2`](https://github.com/inspect-js/object-inspect/commit/f5a72d26edb3959b048f74c056ca7100a6b091e4) +- [Tests] add more test coverage [`30ebe4e`](https://github.com/inspect-js/object-inspect/commit/30ebe4e1fa943b99ecbb85be7614256d536e2759) +- [Tests] require 0.6 to pass [`99a008c`](https://github.com/inspect-js/object-inspect/commit/99a008ccace189a60fd7da18bf00e32c9572b980) + +## [v1.4.1](https://github.com/inspect-js/object-inspect/compare/v1.4.0...v1.4.1) - 2017-12-19 + +### Commits + +- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12` [`6674476`](https://github.com/inspect-js/object-inspect/commit/6674476cc56acaac1bde96c84fed5ef631911906) +- [Fix] `inspect(Object(-0))` should be “Object(-0)”, not “Object(0)” [`d0a031f`](https://github.com/inspect-js/object-inspect/commit/d0a031f1cbb3024ee9982bfe364dd18a7e4d1bd3) + +## [v1.4.0](https://github.com/inspect-js/object-inspect/compare/v1.3.0...v1.4.0) - 2017-10-24 + +### Commits + +- [Tests] add `npm run coverage` [`3b48fb2`](https://github.com/inspect-js/object-inspect/commit/3b48fb25db037235eeb808f0b2830aad7aa36f70) +- [Tests] remove commented-out osx builds [`71e24db`](https://github.com/inspect-js/object-inspect/commit/71e24db8ad6ee3b9b381c5300b0475f2ba595a73) +- [New] add support for `util.inspect.custom`, in node only. [`20cca77`](https://github.com/inspect-js/object-inspect/commit/20cca7762d7e17f15b21a90793dff84acce155df) +- [Tests] up to `node` `v8.6`; use `nvm install-latest-npm` to ensure new npm doesn’t break old node [`252952d`](https://github.com/inspect-js/object-inspect/commit/252952d230d8065851dd3d4d5fe8398aae068529) +- [Tests] up to `node` `v8.8` [`4aa868d`](https://github.com/inspect-js/object-inspect/commit/4aa868d3a62914091d489dd6ec6eed194ee67cd3) +- [Dev Deps] update `core-js`, `tape` [`59483d1`](https://github.com/inspect-js/object-inspect/commit/59483d1df418f852f51fa0db7b24aa6b0209a27a) + +## [v1.3.0](https://github.com/inspect-js/object-inspect/compare/v1.2.2...v1.3.0) - 2017-07-31 + +### Fixed + +- [Fix] Map/Set: work around core-js bug < v2.5.0 [`#9`](https://github.com/inspect-js/object-inspect/issues/9) + +### Commits + +- [New] add support for arrays with additional object keys [`0d19937`](https://github.com/inspect-js/object-inspect/commit/0d199374ee37959e51539616666f420ccb29acb9) +- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; fix new npm breaking on older nodes [`e24784a`](https://github.com/inspect-js/object-inspect/commit/e24784a90c49117787157a12a63897c49cf89bbb) +- Only apps should have lockfiles [`c6faebc`](https://github.com/inspect-js/object-inspect/commit/c6faebcb2ee486a889a4a1c4d78c0776c7576185) +- [Dev Deps] update `tape` [`7345a0a`](https://github.com/inspect-js/object-inspect/commit/7345a0aeba7e91b888a079c10004d17696a7f586) + +## [v1.2.2](https://github.com/inspect-js/object-inspect/compare/v1.2.1...v1.2.2) - 2017-03-24 + +### Commits + +- [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; improve test matrix [`a2ddc15`](https://github.com/inspect-js/object-inspect/commit/a2ddc15a1f2c65af18076eea1c0eb9cbceb478a0) +- [Tests] up to `node` `v7.0`, `v6.9`, `v5.12`, `v4.6`, `io.js` `v3.3`; improve test matrix [`a48949f`](https://github.com/inspect-js/object-inspect/commit/a48949f6b574b2d4d2298109d8e8d0eb3e7a83e7) +- [Performance] check for primitive types as early as possible. [`3b8092a`](https://github.com/inspect-js/object-inspect/commit/3b8092a2a4deffd0575f94334f00194e2d48dad3) +- [Refactor] remove unneeded `else`s. [`7255034`](https://github.com/inspect-js/object-inspect/commit/725503402e08de4f96f6bf2d8edef44ac36f26b6) +- [Refactor] avoid recreating `lowbyte` function every time. [`81edd34`](https://github.com/inspect-js/object-inspect/commit/81edd3475bd15bdd18e84de7472033dcf5004aaa) +- [Fix] differentiate -0 from 0 [`521d345`](https://github.com/inspect-js/object-inspect/commit/521d3456b009da7bf1c5785c8a9df5a9f8718264) +- [Refactor] move object key gathering into separate function [`aca6265`](https://github.com/inspect-js/object-inspect/commit/aca626536eaeef697196c6e9db3e90e7e0355b6a) +- [Refactor] consolidate wrapping logic for boxed primitives into a function. [`4e440cd`](https://github.com/inspect-js/object-inspect/commit/4e440cd9065df04802a2a1dead03f48c353ca301) +- [Robustness] use `typeof` instead of comparing to literal `undefined` [`5ca6f60`](https://github.com/inspect-js/object-inspect/commit/5ca6f601937506daff8ed2fcf686363b55807b69) +- [Refactor] consolidate Map/Set notations. [`4e576e5`](https://github.com/inspect-js/object-inspect/commit/4e576e5d7ed2f9ec3fb7f37a0d16732eb10758a9) +- [Tests] ensure that this function remains anonymous, despite ES6 name inference. [`7540ae5`](https://github.com/inspect-js/object-inspect/commit/7540ae591278756db614fa4def55ca413150e1a3) +- [Refactor] explicitly coerce Error objects to strings. [`7f4ca84`](https://github.com/inspect-js/object-inspect/commit/7f4ca8424ee8dc2c0ca5a422d94f7fac40327261) +- [Refactor] split up `var` declarations for debuggability [`6f2c11e`](https://github.com/inspect-js/object-inspect/commit/6f2c11e6a85418586a00292dcec5e97683f89bc3) +- [Robustness] cache `Object.prototype.toString` [`df44a20`](https://github.com/inspect-js/object-inspect/commit/df44a20adfccf31529d60d1df2079bfc3c836e27) +- [Dev Deps] update `tape` [`3ec714e`](https://github.com/inspect-js/object-inspect/commit/3ec714eba57bc3f58a6eb4fca1376f49e70d300a) +- [Dev Deps] update `tape` [`beb72d9`](https://github.com/inspect-js/object-inspect/commit/beb72d969653747d7cde300393c28755375329b0) + +## [v1.2.1](https://github.com/inspect-js/object-inspect/compare/v1.2.0...v1.2.1) - 2016-04-09 + +### Fixed + +- [Fix] fix Boolean `false` object inspection. [`#7`](https://github.com/substack/object-inspect/pull/7) + +## [v1.2.0](https://github.com/inspect-js/object-inspect/compare/v1.1.0...v1.2.0) - 2016-04-09 + +### Fixed + +- [New] add support for inspecting String/Number/Boolean objects. [`#6`](https://github.com/inspect-js/object-inspect/issues/6) + +### Commits + +- [Dev Deps] update `tape` [`742caa2`](https://github.com/inspect-js/object-inspect/commit/742caa262cf7af4c815d4821c8bd0129c1446432) + +## [v1.1.0](https://github.com/inspect-js/object-inspect/compare/1.0.2...v1.1.0) - 2015-12-14 + +### Merged + +- [New] add ES6 Map/Set support. [`#4`](https://github.com/inspect-js/object-inspect/pull/4) + +### Fixed + +- [New] add ES6 Map/Set support. [`#3`](https://github.com/inspect-js/object-inspect/issues/3) + +### Commits + +- Update `travis.yml` to test on bunches of `iojs` and `node` versions. [`4c1fd65`](https://github.com/inspect-js/object-inspect/commit/4c1fd65cc3bd95307e854d114b90478324287fd2) +- [Dev Deps] update `tape` [`88a907e`](https://github.com/inspect-js/object-inspect/commit/88a907e33afbe408e4b5d6e4e42a33143f88848c) + +## [1.0.2](https://github.com/inspect-js/object-inspect/compare/1.0.1...1.0.2) - 2015-08-07 + +### Commits + +- [Fix] Cache `Object.prototype.hasOwnProperty` in case it's deleted later. [`1d0075d`](https://github.com/inspect-js/object-inspect/commit/1d0075d3091dc82246feeb1f9871cb2b8ed227b3) +- [Dev Deps] Update `tape` [`ca8d5d7`](https://github.com/inspect-js/object-inspect/commit/ca8d5d75635ddbf76f944e628267581e04958457) +- gitignore node_modules since this is a reusable modules. [`ed41407`](https://github.com/inspect-js/object-inspect/commit/ed41407811743ca530cdeb28f982beb96026af82) + +## [1.0.1](https://github.com/inspect-js/object-inspect/compare/1.0.0...1.0.1) - 2015-07-19 + +### Commits + +- Make `inspect` work with symbol primitives and objects, including in node 0.11 and 0.12. [`ddf1b94`](https://github.com/inspect-js/object-inspect/commit/ddf1b94475ab951f1e3bccdc0a48e9073cfbfef4) +- bump tape [`103d674`](https://github.com/inspect-js/object-inspect/commit/103d67496b504bdcfdd765d303a773f87ec106e2) +- use newer travis config [`d497276`](https://github.com/inspect-js/object-inspect/commit/d497276c1da14234bb5098a59cf20de75fbc316a) + +## [1.0.0](https://github.com/inspect-js/object-inspect/compare/0.4.0...1.0.0) - 2014-08-05 + +### Commits + +- error inspect works properly [`260a22d`](https://github.com/inspect-js/object-inspect/commit/260a22d134d3a8a482c67d52091c6040c34f4299) +- seen coverage [`57269e8`](https://github.com/inspect-js/object-inspect/commit/57269e8baa992a7439047f47325111fdcbcb8417) +- htmlelement instance coverage [`397ffe1`](https://github.com/inspect-js/object-inspect/commit/397ffe10a1980350868043ef9de65686d438979f) +- more element coverage [`6905cc2`](https://github.com/inspect-js/object-inspect/commit/6905cc2f7df35600177e613b0642b4df5efd3eca) +- failing test for type errors [`385b615`](https://github.com/inspect-js/object-inspect/commit/385b6152e49b51b68449a662f410b084ed7c601a) +- fn name coverage [`edc906d`](https://github.com/inspect-js/object-inspect/commit/edc906d40fca6b9194d304062c037ee8e398c4c2) +- server-side element test [`362d1d3`](https://github.com/inspect-js/object-inspect/commit/362d1d3e86f187651c29feeb8478110afada385b) +- custom inspect fn [`e89b0f6`](https://github.com/inspect-js/object-inspect/commit/e89b0f6fe6d5e03681282af83732a509160435a6) +- fixed browser test [`b530882`](https://github.com/inspect-js/object-inspect/commit/b5308824a1c8471c5617e394766a03a6977102a9) +- depth test, matches node [`1cfd9e0`](https://github.com/inspect-js/object-inspect/commit/1cfd9e0285a4ae1dff44101ad482915d9bf47e48) +- exercise hasOwnProperty path [`8d753fb`](https://github.com/inspect-js/object-inspect/commit/8d753fb362a534fa1106e4d80f2ee9bea06a66d9) +- more cases covered for errors [`c5c46a5`](https://github.com/inspect-js/object-inspect/commit/c5c46a569ec4606583497e8550f0d8c7ad39a4a4) +- \W obj key test case [`b0eceee`](https://github.com/inspect-js/object-inspect/commit/b0eceeea6e0eb94d686c1046e99b9e25e5005f75) +- coverage for explicit depth param [`e12b91c`](https://github.com/inspect-js/object-inspect/commit/e12b91cd59683362f3a0e80f46481a0211e26c15) + +## [0.4.0](https://github.com/inspect-js/object-inspect/compare/0.3.1...0.4.0) - 2014-03-21 + +### Commits + +- passing lowbyte interpolation test [`b847511`](https://github.com/inspect-js/object-inspect/commit/b8475114f5def7e7961c5353d48d3d8d9a520985) +- lowbyte test [`4a2b0e1`](https://github.com/inspect-js/object-inspect/commit/4a2b0e142667fc933f195472759385ac08f3946c) + +## [0.3.1](https://github.com/inspect-js/object-inspect/compare/0.3.0...0.3.1) - 2014-03-04 + +### Commits + +- sort keys [`a07b19c`](https://github.com/inspect-js/object-inspect/commit/a07b19cc3b1521a82d4fafb6368b7a9775428a05) + +## [0.3.0](https://github.com/inspect-js/object-inspect/compare/0.2.0...0.3.0) - 2014-03-04 + +### Commits + +- [] and {} instead of [ ] and { } [`654c44b`](https://github.com/inspect-js/object-inspect/commit/654c44b2865811f3519e57bb8526e0821caf5c6b) + +## [0.2.0](https://github.com/inspect-js/object-inspect/compare/0.1.3...0.2.0) - 2014-03-04 + +### Commits + +- failing holes test [`99cdfad`](https://github.com/inspect-js/object-inspect/commit/99cdfad03c6474740275a75636fe6ca86c77737a) +- regex already work [`e324033`](https://github.com/inspect-js/object-inspect/commit/e324033267025995ec97d32ed0a65737c99477a6) +- failing undef/null test [`1f88a00`](https://github.com/inspect-js/object-inspect/commit/1f88a00265d3209719dda8117b7e6360b4c20943) +- holes in the all example [`7d345f3`](https://github.com/inspect-js/object-inspect/commit/7d345f3676dcbe980cff89a4f6c243269ebbb709) +- check for .inspect(), fixes Buffer use-case [`c3f7546`](https://github.com/inspect-js/object-inspect/commit/c3f75466dbca125347d49847c05262c292f12b79) +- fixes for holes [`ce25f73`](https://github.com/inspect-js/object-inspect/commit/ce25f736683de4b92ff27dc5471218415e2d78d8) +- weird null behavior [`405c1ea`](https://github.com/inspect-js/object-inspect/commit/405c1ea72cd5a8cf3b498c3eaa903d01b9fbcab5) +- tape is actually a devDependency, upgrade [`703b0ce`](https://github.com/inspect-js/object-inspect/commit/703b0ce6c5817b4245a082564bccd877e0bb6990) +- put date in the example [`a342219`](https://github.com/inspect-js/object-inspect/commit/a3422190eeaa013215f46df2d0d37b48595ac058) +- passing the null test [`4ab737e`](https://github.com/inspect-js/object-inspect/commit/4ab737ebf862a75d247ebe51e79307a34d6380d4) + +## [0.1.3](https://github.com/inspect-js/object-inspect/compare/0.1.1...0.1.3) - 2013-07-26 + +### Commits + +- special isElement() check [`882768a`](https://github.com/inspect-js/object-inspect/commit/882768a54035d30747be9de1baf14e5aa0daa128) +- oh right old IEs don't have indexOf either [`36d1275`](https://github.com/inspect-js/object-inspect/commit/36d12756c38b08a74370b0bb696c809e529913a5) + +## [0.1.1](https://github.com/inspect-js/object-inspect/compare/0.1.0...0.1.1) - 2013-07-26 + +### Commits + +- tests! [`4422fd9`](https://github.com/inspect-js/object-inspect/commit/4422fd95532c2745aa6c4f786f35f1090be29998) +- fix for ie<9, doesn't have hasOwnProperty [`6b7d611`](https://github.com/inspect-js/object-inspect/commit/6b7d61183050f6da801ea04473211da226482613) +- fix for all IEs: no f.name [`4e0c2f6`](https://github.com/inspect-js/object-inspect/commit/4e0c2f6dfd01c306d067d7163319acc97c94ee50) +- badges [`5ed0d88`](https://github.com/inspect-js/object-inspect/commit/5ed0d88e4e407f9cb327fa4a146c17921f9680f3) + +## [0.1.0](https://github.com/inspect-js/object-inspect/compare/0.0.0...0.1.0) - 2013-07-26 + +### Commits + +- [Function] for functions [`ad5c485`](https://github.com/inspect-js/object-inspect/commit/ad5c485098fc83352cb540a60b2548ca56820e0b) + +## 0.0.0 - 2013-07-26 + +### Commits + +- working browser example [`34be6b6`](https://github.com/inspect-js/object-inspect/commit/34be6b6548f9ce92bdc3c27572857ba0c4a1218d) +- package.json etc [`cad51f2`](https://github.com/inspect-js/object-inspect/commit/cad51f23fc6bcf1a456ed6abe16088256c2f632f) +- docs complete [`b80cce2`](https://github.com/inspect-js/object-inspect/commit/b80cce2490c4e7183a9ee11ea89071f0abec4446) +- circular example [`4b4a7b9`](https://github.com/inspect-js/object-inspect/commit/4b4a7b92209e4e6b4630976cb6bcd17d14165a59) +- string rep [`7afb479`](https://github.com/inspect-js/object-inspect/commit/7afb479baa798d27f09e0a178b72ea327f60f5c8) diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/LICENSE b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/LICENSE new file mode 100644 index 00000000..ca64cc1e --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/all.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/all.js new file mode 100644 index 00000000..2f3355c5 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/all.js @@ -0,0 +1,23 @@ +'use strict'; + +var inspect = require('../'); +var Buffer = require('safer-buffer').Buffer; + +var holes = ['a', 'b']; +holes[4] = 'e'; +holes[6] = 'g'; + +var obj = { + a: 1, + b: [3, 4, undefined, null], + c: undefined, + d: null, + e: { + regex: /^x/i, + buf: Buffer.from('abc'), + holes: holes + }, + now: new Date() +}; +obj.self = obj; +console.log(inspect(obj)); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/circular.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/circular.js new file mode 100644 index 00000000..487a7c16 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/circular.js @@ -0,0 +1,6 @@ +'use strict'; + +var inspect = require('../'); +var obj = { a: 1, b: [3, 4] }; +obj.c = obj; +console.log(inspect(obj)); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/fn.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/fn.js new file mode 100644 index 00000000..9b5db8de --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/fn.js @@ -0,0 +1,5 @@ +'use strict'; + +var inspect = require('../'); +var obj = [1, 2, function f(n) { return n + 5; }, 4]; +console.log(inspect(obj)); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/inspect.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/inspect.js new file mode 100644 index 00000000..e2df7c9f --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/example/inspect.js @@ -0,0 +1,10 @@ +'use strict'; + +/* eslint-env browser */ +var inspect = require('../'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js new file mode 100644 index 00000000..a4b2d4cd --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js @@ -0,0 +1,544 @@ +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; +var gOPS = Object.getOwnPropertySymbols; +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +// ie, `has-tostringtag/shams +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') + ? Symbol.toStringTag + : null; +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( + [].__proto__ === Array.prototype // eslint-disable-line no-proto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); + +function addNumericSeparator(num, str) { + if ( + num === Infinity + || num === -Infinity + || num !== num + || (num && num > -1000 && num < 1000) + || $test.call(/e/, str) + ) { + return str; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + return $replace.call(str, sepRegex, '$&_'); +} + +var utilInspect = require('./util.inspect'); +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + +var quotes = { + __proto__: null, + 'double': '"', + single: "'" +}; +var quoteREs = { + __proto__: null, + 'double': /(["\\])/g, + single: /(['\\])/g +}; + +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if ( + has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' + ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity + : opts.maxStringLength !== null + ) + ) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); + } + + if ( + has(opts, 'indent') + && opts.indent !== null + && opts.indent !== '\t' + && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) + ) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; + } + if (typeof obj === 'bigint') { + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } + + var indent = getIndent(opts, depth); + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += ''; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + var xs = arrObjKeys(obj, inspect); + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + return '[ ' + $join.call(xs, ', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; + } + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + } + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + } + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isWeakRef(obj)) { + return weakCollectionOf('WeakRef'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other + /* eslint-env browser */ + if (typeof window !== 'undefined' && obj === window) { + return '{ [object Window] }'; + } + if ( + (typeof globalThis !== 'undefined' && obj === globalThis) + || (typeof global !== 'undefined' && obj === global) + ) { + return '{ [object globalThis] }'; + } + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? '' : 'null prototype'; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); + if (ys.length === 0) { return tag + '{}'; } + if (indent) { + return tag + '{' + indentedJoin(ys, indent) + '}'; + } + return tag + '{ ' + $join.call(ys, ', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes(s, defaultStyle, opts) { + var style = opts.quoteStyle || defaultStyle; + var quoteChar = quotes[style]; + return quoteChar + s + quoteChar; +} + +function quote(s) { + return $replace.call(String(s), /"/g, '"'); +} + +function canTrustToString(obj) { + return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); +} +function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } +function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } +function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } +function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } +function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } + +// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives +function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === 'object' && obj instanceof Symbol; + } + if (typeof obj === 'symbol') { + return true; + } + if (!obj || typeof obj !== 'object' || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e) {} + return false; +} + +function isBigInt(obj) { + if (!obj || typeof obj !== 'object' || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e) {} + return false; +} + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has(obj, key) { + return hasOwn.call(obj, key); +} + +function toStr(obj) { + return objectToString.call(obj); +} + +function nameOf(f) { + if (f.name) { return f.name; } + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; +} + +function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; +} + +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakRef(x) { + if (!weakRefDeref || !x || typeof x !== 'object') { + return false; + } + try { + weakRefDeref.call(x); + return true; + } catch (e) {} + return false; +} + +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} + +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; + } + var quoteRE = quoteREs[opts.quoteStyle || 'single']; + quoteRE.lastIndex = 0; + // eslint-disable-next-line no-control-regex + var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', + 9: 't', + 10: 'n', + 12: 'f', + 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); +} + +function markBoxed(str) { + return 'Object(' + str + ')'; +} + +function weakCollectionOf(type) { + return type + ' { ? }'; +} + +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} + +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + return true; +} + +function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), ' '); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; +} + +function indentedJoin(xs, indent) { + if (xs.length === 0) { return ''; } + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; +} + +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + var syms = typeof gOPS === 'function' ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k = 0; k < syms.length; k++) { + symMap['$' + syms[k]] = syms[k]; + } + } + + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { + // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section + continue; // eslint-disable-line no-restricted-syntax, no-continue + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + if (typeof gOPS === 'function') { + for (var j = 0; j < syms.length; j++) { + if (isEnumerable.call(obj, syms[j])) { + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); + } + } + } + return xs; +} diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package-support.json b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package-support.json new file mode 100644 index 00000000..5cc12d05 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package-support.json @@ -0,0 +1,20 @@ +{ + "versions": [ + { + "version": "*", + "target": { + "node": "all" + }, + "response": { + "type": "time-permitting" + }, + "backing": { + "npm-funding": true, + "donations": [ + "https://github.com/ljharb", + "https://tidelift.com/funding/github/npm/object-inspect" + ] + } + } + ] +} diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package.json b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package.json new file mode 100644 index 00000000..9fd97ff7 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/package.json @@ -0,0 +1,105 @@ +{ + "name": "object-inspect", + "version": "1.13.4", + "description": "string representations of objects in node and the browser", + "main": "index.js", + "sideEffects": false, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "@pkgjs/support": "^0.0.6", + "auto-changelog": "^2.5.0", + "core-js": "^2.6.12", + "error-cause": "^1.0.8", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "for-each": "^0.3.4", + "functions-have-names": "^1.2.3", + "glob": "=10.3.7", + "globalthis": "^1.0.4", + "has-symbols": "^1.1.0", + "has-tostringtag": "^1.0.2", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "make-arrow-function": "^1.2.0", + "mock-property": "^1.1.0", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "semver": "^6.3.1", + "string.prototype.repeat": "^1.0.0", + "tape": "^5.9.0" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "pretest": "npm run lint", + "lint": "eslint --ext=js,mjs .", + "postlint": "npx @pkgjs/support validate", + "test": "npm run tests-only && npm run test:corejs", + "tests-only": "nyc tape 'test/*.js'", + "test:corejs": "nyc tape test-core-js.js 'test/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "testling": { + "files": [ + "test/*.js", + "test/browser/*.js" + ], + "browsers": [ + "ie/6..latest", + "chrome/latest", + "firefox/latest", + "safari/latest", + "opera/latest", + "iphone/latest", + "ipad/latest", + "android/latest" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/object-inspect.git" + }, + "homepage": "https://github.com/inspect-js/object-inspect", + "keywords": [ + "inspect", + "util.inspect", + "object", + "stringify", + "pretty" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "browser": { + "./util.inspect.js": false + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "./test-core-js.js" + ] + }, + "support": true, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/readme.markdown b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/readme.markdown new file mode 100644 index 00000000..f91617df --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/readme.markdown @@ -0,0 +1,84 @@ +# object-inspect [![Version Badge][npm-version-svg]][package-url] + +string representations of objects in node and the browser + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +# example + +## circular + +``` js +var inspect = require('object-inspect'); +var obj = { a: 1, b: [3,4] }; +obj.c = obj; +console.log(inspect(obj)); +``` + +## dom element + +``` js +var inspect = require('object-inspect'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); +``` + +output: + +``` +[

...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ] +``` + +# methods + +``` js +var inspect = require('object-inspect') +``` + +## var s = inspect(obj, opts={}) + +Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`. + +Additional options: + - `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements. + - `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`. + - `customInspect`: When `true`, a custom inspect method function will be invoked (either undere the `util.inspect.custom` symbol, or the `inspect` property). When the string `'symbol'`, only the symbol method will be invoked. Default `true`. + - `indent`: must be "\t", `null`, or a positive integer. Default `null`. + - `numericSeparator`: must be a boolean, if present. Default `false`. If `true`, all numbers will be printed with numeric separators (eg, `1234.5678` will be printed as `'1_234.567_8'`) + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install object-inspect +``` + +# license + +MIT + +[package-url]: https://npmjs.org/package/object-inspect +[npm-version-svg]: https://versionbadg.es/inspect-js/object-inspect.svg +[deps-svg]: https://david-dm.org/inspect-js/object-inspect.svg +[deps-url]: https://david-dm.org/inspect-js/object-inspect +[dev-deps-svg]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/object-inspect.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg +[downloads-url]: https://npm-stat.com/charts.html?package=object-inspect +[codecov-image]: https://codecov.io/gh/inspect-js/object-inspect/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/object-inspect/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/object-inspect +[actions-url]: https://github.com/inspect-js/object-inspect/actions diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test-core-js.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test-core-js.js new file mode 100644 index 00000000..e53c4002 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test-core-js.js @@ -0,0 +1,26 @@ +'use strict'; + +require('core-js'); + +var inspect = require('./'); +var test = require('tape'); + +test('Maps', function (t) { + t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}'); + t.end(); +}); + +test('WeakMaps', function (t) { + t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }'); + t.end(); +}); + +test('Sets', function (t) { + t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}'); + t.end(); +}); + +test('WeakSets', function (t) { + t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }'); + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/bigint.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/bigint.js new file mode 100644 index 00000000..4ecc31df --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/bigint.js @@ -0,0 +1,58 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); + +test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) { + t.test('primitives', function (st) { + st.plan(3); + + st.equal(inspect(BigInt(-256)), '-256n'); + st.equal(inspect(BigInt(0)), '0n'); + st.equal(inspect(BigInt(256)), '256n'); + }); + + t.test('objects', function (st) { + st.plan(3); + + st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)'); + st.equal(inspect(Object(BigInt(0))), 'Object(0n)'); + st.equal(inspect(Object(BigInt(256))), 'Object(256n)'); + }); + + t.test('syntactic primitives', function (st) { + st.plan(3); + + /* eslint-disable no-new-func */ + st.equal(inspect(Function('return -256n')()), '-256n'); + st.equal(inspect(Function('return 0n')()), '0n'); + st.equal(inspect(Function('return 256n')()), '256n'); + }); + + t.test('toStringTag', { skip: !hasToStringTag }, function (st) { + st.plan(1); + + var faker = {}; + faker[Symbol.toStringTag] = 'BigInt'; + st.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'BigInt\' }', + 'object lying about being a BigInt inspects as an object' + ); + }); + + t.test('numericSeparator', function (st) { + st.equal(inspect(BigInt(0), { numericSeparator: false }), '0n', '0n, numericSeparator false'); + st.equal(inspect(BigInt(0), { numericSeparator: true }), '0n', '0n, numericSeparator true'); + + st.equal(inspect(BigInt(1234), { numericSeparator: false }), '1234n', '1234n, numericSeparator false'); + st.equal(inspect(BigInt(1234), { numericSeparator: true }), '1_234n', '1234n, numericSeparator true'); + st.equal(inspect(BigInt(-1234), { numericSeparator: false }), '-1234n', '1234n, numericSeparator false'); + st.equal(inspect(BigInt(-1234), { numericSeparator: true }), '-1_234n', '1234n, numericSeparator true'); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/browser/dom.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/browser/dom.js new file mode 100644 index 00000000..210c0b23 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/browser/dom.js @@ -0,0 +1,15 @@ +var inspect = require('../../'); +var test = require('tape'); + +test('dom element', function (t) { + t.plan(1); + + var d = document.createElement('div'); + d.setAttribute('id', 'beep'); + d.innerHTML = 'woooiiiii'; + + t.equal( + inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]), + '[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]' + ); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/circular.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/circular.js new file mode 100644 index 00000000..5df4233c --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/circular.js @@ -0,0 +1,16 @@ +var inspect = require('../'); +var test = require('tape'); + +test('circular', function (t) { + t.plan(2); + var obj = { a: 1, b: [3, 4] }; + obj.c = obj; + t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); + + var double = {}; + double.a = [double]; + double.b = {}; + double.b.inner = double.b; + double.b.obj = double; + t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }'); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/deep.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/deep.js new file mode 100644 index 00000000..99ce32a0 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/deep.js @@ -0,0 +1,12 @@ +var inspect = require('../'); +var test = require('tape'); + +test('deep', function (t) { + t.plan(4); + var obj = [[[[[[500]]]]]]; + t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]'); + t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]'); + t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]'); + + t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]'); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/element.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/element.js new file mode 100644 index 00000000..47fa9e24 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/element.js @@ -0,0 +1,53 @@ +var inspect = require('../'); +var test = require('tape'); + +test('element', function (t) { + t.plan(3); + var elem = { + nodeName: 'div', + attributes: [{ name: 'class', value: 'row' }], + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1,
, 3 ]"); + t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1,
, 3 ]'); +}); + +test('element no attr', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); +}); + +test('element with contents', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [{ nodeName: 'b' }] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
...
, 3 ]'); +}); + +test('element instance', function (t) { + t.plan(1); + var h = global.HTMLElement; + global.HTMLElement = function (name, attr) { + this.nodeName = name; + this.attributes = attr; + }; + global.HTMLElement.prototype.getAttribute = function () {}; + + var elem = new global.HTMLElement('div', []); + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + global.HTMLElement = h; +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/err.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/err.js new file mode 100644 index 00000000..cc1d884a --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/err.js @@ -0,0 +1,48 @@ +var test = require('tape'); +var ErrorWithCause = require('error-cause/Error'); + +var inspect = require('../'); + +test('type error', function (t) { + t.plan(1); + var aerr = new TypeError(); + aerr.foo = 555; + aerr.bar = [1, 2, 3]; + + var berr = new TypeError('tuv'); + berr.baz = 555; + + var cerr = new SyntaxError(); + cerr.message = 'whoa'; + cerr['a-b'] = 5; + + var withCause = new ErrorWithCause('foo', { cause: 'bar' }); + var withCausePlus = new ErrorWithCause('foo', { cause: 'bar' }); + withCausePlus.foo = 'bar'; + var withUndefinedCause = new ErrorWithCause('foo', { cause: undefined }); + var withEnumerableCause = new Error('foo'); + withEnumerableCause.cause = 'bar'; + + var obj = [ + new TypeError(), + new TypeError('xxx'), + aerr, + berr, + cerr, + withCause, + withCausePlus, + withUndefinedCause, + withEnumerableCause + ]; + t.equal(inspect(obj), '[ ' + [ + '[TypeError]', + '[TypeError: xxx]', + '{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }', + '{ [TypeError: tuv] baz: 555 }', + '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }', + 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: \'bar\' }', + '{ [Error: foo] ' + ('cause' in Error.prototype ? '' : '[cause]: \'bar\', ') + 'foo: \'bar\' }', + 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: undefined }', + '{ [Error: foo] cause: \'bar\' }' + ].join(', ') + ' ]'); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fakes.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fakes.js new file mode 100644 index 00000000..a65c08c1 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fakes.js @@ -0,0 +1,29 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); + +test('fakes', { skip: !hasToStringTag }, function (t) { + forEach([ + 'Array', + 'Boolean', + 'Date', + 'Error', + 'Number', + 'RegExp', + 'String' + ], function (expected) { + var faker = {}; + faker[Symbol.toStringTag] = expected; + + t.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }', + 'faker masquerading as ' + expected + ' is not shown as one' + ); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fn.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fn.js new file mode 100644 index 00000000..de3ca625 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/fn.js @@ -0,0 +1,76 @@ +var inspect = require('../'); +var test = require('tape'); +var arrow = require('make-arrow-function')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +test('function', function (t) { + t.plan(1); + var obj = [1, 2, function f(n) { return n; }, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); +}); + +test('function name', function (t) { + t.plan(1); + var f = (function () { + return function () {}; + }()); + f.toString = function toStr() { return 'function xxx () {}'; }; + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]'); +}); + +test('anon function', function (t) { + var f = (function () { + return function () {}; + }()); + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); + + t.end(); +}); + +test('arrow function', { skip: !arrow }, function (t) { + t.equal(inspect(arrow), '[Function (anonymous)]'); + + t.end(); +}); + +test('truly nameless function', { skip: !arrow || !functionsHaveConfigurableNames }, function (t) { + function f() {} + Object.defineProperty(f, 'name', { value: false }); + t.equal(f.name, false); + t.equal( + inspect(f), + '[Function: f]', + 'named function with falsy `.name` does not hide its original name' + ); + + function g() {} + Object.defineProperty(g, 'name', { value: true }); + t.equal(g.name, true); + t.equal( + inspect(g), + '[Function: true]', + 'named function with truthy `.name` hides its original name' + ); + + var anon = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon, 'name', { value: null }); + t.equal(anon.name, null); + t.equal( + inspect(anon), + '[Function (anonymous)]', + 'anon function with falsy `.name` does not hide its anonymity' + ); + + var anon2 = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon2, 'name', { value: 1 }); + t.equal(anon2.name, 1); + t.equal( + inspect(anon2), + '[Function: 1]', + 'anon function with truthy `.name` hides its anonymity' + ); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/global.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/global.js new file mode 100644 index 00000000..c57216ae --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/global.js @@ -0,0 +1,17 @@ +'use strict'; + +var inspect = require('../'); + +var test = require('tape'); +var globalThis = require('globalthis')(); + +test('global object', function (t) { + /* eslint-env browser */ + var expected = typeof window === 'undefined' ? 'globalThis' : 'Window'; + t.equal( + inspect([globalThis]), + '[ { [object ' + expected + '] } ]' + ); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/has.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/has.js new file mode 100644 index 00000000..01800dee --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/has.js @@ -0,0 +1,15 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var mockProperty = require('mock-property'); + +test('when Object#hasOwnProperty is deleted', function (t) { + t.plan(1); + var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays + + t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty" + t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); + + t.equal(inspect(arr), '[ 1, , 3 ]'); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/holes.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/holes.js new file mode 100644 index 00000000..87fc8c84 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/holes.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var inspect = require('../'); + +var xs = ['a', 'b']; +xs[5] = 'f'; +xs[7] = 'j'; +xs[8] = 'k'; + +test('holes', function (t) { + t.plan(1); + t.equal( + inspect(xs), + "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" + ); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/indent-option.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/indent-option.js new file mode 100644 index 00000000..89d8fced --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/indent-option.js @@ -0,0 +1,271 @@ +var test = require('tape'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('bad indent options', function (t) { + forEach([ + undefined, + true, + false, + -1, + 1.2, + Infinity, + -Infinity, + NaN + ], function (indent) { + t['throws']( + function () { inspect('', { indent: indent }); }, + TypeError, + inspect(indent) + ' is invalid' + ); + }); + + t.end(); +}); + +test('simple object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: 2 }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('two deep object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: { c: 3, d: 4 } }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('simple array with all single line elements', function (t) { + t.plan(2); + + var obj = [1, 2, 3, 'asdf\nsdf']; + + var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]'; + + t.equal(inspect(obj, { indent: 2 }), expected, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs'); +}); + +test('array with complex elements', function (t) { + t.plan(2); + + var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf']; + + var expectedSpaces = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('values', function (t) { + t.plan(2); + var obj = [{}, [], { 'a-b': 5 }]; + + var expectedSpaces = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + + var expectedStringSpaces = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabsDoubleQuotes = [ + 'Map (2) {', + ' { a: 1 } => [ "b" ],', + ' 3 => NaN', + '}' + ].join('\n'); + + t.equal( + inspect(map, { indent: 2 }), + expectedStringSpaces, + 'Map keys are not indented (two)' + ); + t.equal( + inspect(map, { indent: '\t' }), + expectedStringTabs, + 'Map keys are not indented (tabs)' + ); + t.equal( + inspect(map, { indent: '\t', quoteStyle: 'double' }), + expectedStringTabsDoubleQuotes, + 'Map keys are not indented (tabs + double quotes)' + ); + + t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)'); + t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + var expectedNestedSpaces = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)'); + t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedStringSpaces = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)'); + t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)'); + + t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)'); + t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + var expectedNestedSpaces = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)'); + t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/inspect.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/inspect.js new file mode 100644 index 00000000..1abf81b1 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/inspect.js @@ -0,0 +1,139 @@ +var test = require('tape'); +var hasSymbols = require('has-symbols/shams')(); +var utilInspect = require('../util.inspect'); +var repeat = require('string.prototype.repeat'); + +var inspect = require('..'); + +test('inspect', function (t) { + t.plan(5); + + var obj = [{ inspect: function xyzInspect() { return '!XYZ¡'; } }, []]; + var stringResult = '[ !XYZ¡, [] ]'; + var falseResult = '[ { inspect: [Function: xyzInspect] }, [] ]'; + + t.equal(inspect(obj), stringResult); + t.equal(inspect(obj, { customInspect: true }), stringResult); + t.equal(inspect(obj, { customInspect: 'symbol' }), falseResult); + t.equal(inspect(obj, { customInspect: false }), falseResult); + t['throws']( + function () { inspect(obj, { customInspect: 'not a boolean or "symbol"' }); }, + TypeError, + '`customInspect` must be a boolean or the string "symbol"' + ); +}); + +test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspect.custom }, function (t) { + t.plan(4); + + var obj = { inspect: function stringInspect() { return 'string'; } }; + obj[utilInspect.custom] = function custom() { return 'symbol'; }; + + var symbolResult = '[ symbol, [] ]'; + var stringResult = '[ string, [] ]'; + var falseResult = '[ { inspect: [Function: stringInspect]' + (utilInspect.custom ? ', [' + inspect(utilInspect.custom) + ']: [Function: custom]' : '') + ' }, [] ]'; + + var symbolStringFallback = utilInspect.custom ? symbolResult : stringResult; + var symbolFalseFallback = utilInspect.custom ? symbolResult : falseResult; + + t.equal(inspect([obj, []]), symbolStringFallback); + t.equal(inspect([obj, []], { customInspect: true }), symbolStringFallback); + t.equal(inspect([obj, []], { customInspect: 'symbol' }), symbolFalseFallback); + t.equal(inspect([obj, []], { customInspect: false }), falseResult); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + t.plan(2); + + var obj = { a: 1 }; + obj[Symbol('test')] = 2; + obj[Symbol.iterator] = 3; + Object.defineProperty(obj, Symbol('non-enum'), { + enumerable: false, + value: 4 + }); + + if (typeof Symbol.iterator === 'symbol') { + t.equal(inspect(obj), '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }', 'object with symbols'); + t.equal(inspect([obj, []]), '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]', 'object with symbols in array'); + } else { + // symbol sham key ordering is unreliable + t.match( + inspect(obj), + /^(?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 })$/, + 'object with symbols (nondeterministic symbol sham key ordering)' + ); + t.match( + inspect([obj, []]), + /^\[ (?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 }), \[\] \]$/, + 'object with symbols in array (nondeterministic symbol sham key ordering)' + ); + } +}); + +test('maxStringLength', function (t) { + t['throws']( + function () { inspect('', { maxStringLength: -1 }); }, + TypeError, + 'maxStringLength must be >= 0, or Infinity, not negative' + ); + + var str = repeat('a', 1e8); + + t.equal( + inspect([str], { maxStringLength: 10 }), + '[ \'aaaaaaaaaa\'... 99999990 more characters ]', + 'maxStringLength option limits output' + ); + + t.equal( + inspect(['f'], { maxStringLength: null }), + '[ \'\'... 1 more character ]', + 'maxStringLength option accepts `null`' + ); + + t.equal( + inspect([str], { maxStringLength: Infinity }), + '[ \'' + str + '\' ]', + 'maxStringLength option accepts ∞' + ); + + t.end(); +}); + +test('inspect options', { skip: !utilInspect.custom }, function (t) { + var obj = {}; + obj[utilInspect.custom] = function () { + return JSON.stringify(arguments); + }; + t.equal( + inspect(obj), + utilInspect(obj, { depth: 5 }), + 'custom symbols will use node\'s inspect' + ); + t.equal( + inspect(obj, { depth: 2 }), + utilInspect(obj, { depth: 2 }), + 'a reduced depth will be passed to node\'s inspect' + ); + t.equal( + inspect({ d1: obj }, { depth: 3 }), + '{ d1: ' + utilInspect(obj, { depth: 2 }) + ' }', + 'deep objects will receive a reduced depth' + ); + t.equal( + inspect({ d1: obj }, { depth: 1 }), + '{ d1: [Object] }', + 'unlike nodejs inspect, customInspect will not be used once the depth is exceeded.' + ); + t.end(); +}); + +test('inspect URL', { skip: typeof URL === 'undefined' }, function (t) { + t.match( + inspect(new URL('https://nodejs.org')), + /nodejs\.org/, // Different environments stringify it differently + 'url can be inspected' + ); + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/lowbyte.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/lowbyte.js new file mode 100644 index 00000000..68a345d8 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/lowbyte.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' }; + +test('interpolate low bytes', function (t) { + t.plan(1); + t.equal( + inspect(obj), + "{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }" + ); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/number.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/number.js new file mode 100644 index 00000000..8f287e8e --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/number.js @@ -0,0 +1,58 @@ +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('negative zero', function (t) { + t.equal(inspect(0), '0', 'inspect(0) === "0"'); + t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"'); + + t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"'); + t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"'); + + t.end(); +}); + +test('numericSeparator', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { inspect(true, { numericSeparator: nonBoolean }); }, + TypeError, + inspect(nonBoolean) + ' is not a boolean' + ); + }); + + t.test('3 digit numbers', function (st) { + var failed = false; + for (var i = -999; i < 1000; i += 1) { + var actual = inspect(i); + var actualSepNo = inspect(i, { numericSeparator: false }); + var actualSepYes = inspect(i, { numericSeparator: true }); + var expected = String(i); + if (actual !== expected || actualSepNo !== expected || actualSepYes !== expected) { + failed = true; + t.equal(actual, expected); + t.equal(actualSepNo, expected); + t.equal(actualSepYes, expected); + } + } + + st.notOk(failed, 'all 3 digit numbers passed'); + + st.end(); + }); + + t.equal(inspect(1e3), '1000', '1000'); + t.equal(inspect(1e3, { numericSeparator: false }), '1000', '1000, numericSeparator false'); + t.equal(inspect(1e3, { numericSeparator: true }), '1_000', '1000, numericSeparator true'); + t.equal(inspect(-1e3), '-1000', '-1000'); + t.equal(inspect(-1e3, { numericSeparator: false }), '-1000', '-1000, numericSeparator false'); + t.equal(inspect(-1e3, { numericSeparator: true }), '-1_000', '-1000, numericSeparator true'); + + t.equal(inspect(1234.5678, { numericSeparator: true }), '1_234.567_8', 'fractional numbers get separators'); + t.equal(inspect(1234.56789, { numericSeparator: true }), '1_234.567_89', 'fractional numbers get separators'); + t.equal(inspect(1234.567891, { numericSeparator: true }), '1_234.567_891', 'fractional numbers get separators'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/quoteStyle.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/quoteStyle.js new file mode 100644 index 00000000..da23e630 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/quoteStyle.js @@ -0,0 +1,26 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); + +test('quoteStyle option', function (t) { + t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); + + t.equal(inspect('"', { quoteStyle: 'single' }), '\'"\'', 'double quote, quoteStyle: "single"'); + t.equal(inspect('"', { quoteStyle: 'double' }), '"\\""', 'double quote, quoteStyle: "double"'); + + t.equal(inspect('\'', { quoteStyle: 'single' }), '\'\\\'\'', 'single quote, quoteStyle: "single"'); + t.equal(inspect('\'', { quoteStyle: 'double' }), '"\'"', 'single quote, quoteStyle: "double"'); + + t.equal(inspect('`', { quoteStyle: 'single' }), '\'`\'', 'backtick, quoteStyle: "single"'); + t.equal(inspect('`', { quoteStyle: 'double' }), '"`"', 'backtick, quoteStyle: "double"'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/toStringTag.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/toStringTag.js new file mode 100644 index 00000000..95f82703 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/toStringTag.js @@ -0,0 +1,40 @@ +'use strict'; + +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); + +var inspect = require('../'); + +test('Symbol.toStringTag', { skip: !hasToStringTag }, function (t) { + t.plan(4); + + var obj = { a: 1 }; + t.equal(inspect(obj), '{ a: 1 }', 'object, no Symbol.toStringTag'); + + obj[Symbol.toStringTag] = 'foo'; + t.equal(inspect(obj), '{ a: 1, [Symbol(Symbol.toStringTag)]: \'foo\' }', 'object with Symbol.toStringTag'); + + t.test('null objects', { skip: 'toString' in { __proto__: null } }, function (st) { + st.plan(2); + + var dict = { __proto__: null, a: 1 }; + st.equal(inspect(dict), '[Object: null prototype] { a: 1 }', 'null object with Symbol.toStringTag'); + + dict[Symbol.toStringTag] = 'Dict'; + st.equal(inspect(dict), '[Dict: null prototype] { a: 1, [Symbol(Symbol.toStringTag)]: \'Dict\' }', 'null object with Symbol.toStringTag'); + }); + + t.test('instances', function (st) { + st.plan(4); + + function C() { + this.a = 1; + } + st.equal(Object.prototype.toString.call(new C()), '[object Object]', 'instance, no toStringTag, Object.prototype.toString'); + st.equal(inspect(new C()), 'C { a: 1 }', 'instance, no toStringTag'); + + C.prototype[Symbol.toStringTag] = 'Class!'; + st.equal(Object.prototype.toString.call(new C()), '[object Class!]', 'instance, with toStringTag, Object.prototype.toString'); + st.equal(inspect(new C()), 'C [Class!] { a: 1 }', 'instance, with toStringTag'); + }); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/undef.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/undef.js new file mode 100644 index 00000000..e3f49612 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/undef.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; + +test('undef and null', function (t) { + t.plan(1); + t.equal( + inspect(obj), + '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' + ); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/values.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/values.js new file mode 100644 index 00000000..15986cd0 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/test/values.js @@ -0,0 +1,261 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var mockProperty = require('mock-property'); +var hasSymbols = require('has-symbols/shams')(); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); +var semver = require('semver'); + +test('values', function (t) { + t.plan(1); + var obj = [{}, [], { 'a-b': 5 }]; + t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]'); +}); + +test('arrays with properties', function (t) { + t.plan(1); + var arr = [3]; + arr.foo = 'bar'; + var obj = [1, 2, arr]; + obj.baz = 'quux'; + obj.index = -1; + t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]'); +}); + +test('has', function (t) { + t.plan(1); + t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); + + t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }'); +}); + +test('indexOf seen', function (t) { + t.plan(1); + var xs = [1, 2, 3, {}]; + xs.push(xs); + + var seen = []; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[ 1, 2, 3, {}, [Circular] ]' + ); +}); + +test('seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('seen seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [5, xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + var sym = Symbol('foo'); + t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); + if (typeof sym === 'symbol') { + // Symbol shams are incapable of differentiating boxed from unboxed symbols + t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); + } + + t.test('toStringTag', { skip: !hasToStringTag }, function (st) { + st.plan(1); + + var faker = {}; + faker[Symbol.toStringTag] = 'Symbol'; + st.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'Symbol\' }', + 'object lying about being a Symbol inspects as an object' + ); + }); + + t.end(); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}'; + t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents'); + t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work'); + + t.end(); +}); + +test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) { + var map = new WeakMap(); + map.set({ a: 1 }, ['b']); + var expectedString = 'WeakMap { ? }'; + t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents'); + t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}'; + t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents'); + t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work'); + + t.end(); +}); + +test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) { + var map = new WeakSet(); + map.add({ a: 1 }); + var expectedString = 'WeakSet { ? }'; + t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents'); + t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty'); + + t.end(); +}); + +test('WeakRef', { skip: typeof WeakRef !== 'function' }, function (t) { + var ref = new WeakRef({ a: 1 }); + var expectedString = 'WeakRef { ? }'; + t.equal(inspect(ref), expectedString, 'new WeakRef({ a: 1 }) should not show contents'); + + t.end(); +}); + +test('FinalizationRegistry', { skip: typeof FinalizationRegistry !== 'function' }, function (t) { + var registry = new FinalizationRegistry(function () {}); + var expectedString = 'FinalizationRegistry [FinalizationRegistry] {}'; + t.equal(inspect(registry), expectedString, 'new FinalizationRegistry(function () {}) should work normallys'); + + t.end(); +}); + +test('Strings', function (t) { + var str = 'abc'; + + t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such'); + t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted'); + t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted'); + t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such'); + t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted'); + t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted'); + + t.end(); +}); + +test('Numbers', function (t) { + var num = 42; + + t.equal(inspect(num), String(num), 'primitive number shows as such'); + t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such'); + + t.end(); +}); + +test('Booleans', function (t) { + t.equal(inspect(true), String(true), 'primitive true shows as such'); + t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such'); + + t.equal(inspect(false), String(false), 'primitive false shows as such'); + t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such'); + + t.end(); +}); + +test('Date', function (t) { + var now = new Date(); + t.equal(inspect(now), String(now), 'Date shows properly'); + t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly'); + + t.end(); +}); + +test('RegExps', function (t) { + t.equal(inspect(/a/g), '/a/g', 'regex shows properly'); + t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly'); + + var match = 'abc abc'.match(/[ab]+/); + delete match.groups; // for node < 10 + t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly'); + + t.end(); +}); + +test('Proxies', { skip: typeof Proxy !== 'function' || !hasToStringTag }, function (t) { + var target = { proxy: true }; + var fake = new Proxy(target, { has: function () { return false; } }); + + // needed to work around a weird difference in node v6.0 - v6.4 where non-present properties are not logged + var isNode60 = semver.satisfies(process.version, '6.0 - 6.4'); + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(fake), + '{ ' + (isNode60 ? '' : 'proxy: true, ') + '[Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Proxy for + ' + tag + ' shows as the target, which has no slots' + ); + }); + + t.end(); +}); + +test('fakers', { skip: !hasToStringTag }, function (t) { + var target = { proxy: false }; + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(target), + '{ proxy: false, [Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Object pretending to be ' + tag + ' does not trick us' + ); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js new file mode 100644 index 00000000..7784fab5 --- /dev/null +++ b/backend/node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js @@ -0,0 +1 @@ +module.exports = require('util').inspect; diff --git a/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/ee-first b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/ee-first new file mode 120000 index 00000000..5fff6248 --- /dev/null +++ b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/ee-first @@ -0,0 +1 @@ +../../ee-first@1.1.1/node_modules/ee-first \ No newline at end of file diff --git a/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/HISTORY.md b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/HISTORY.md new file mode 100644 index 00000000..1917595a --- /dev/null +++ b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/HISTORY.md @@ -0,0 +1,98 @@ +2.4.1 / 2022-02-22 +================== + + * Fix error on early async hooks implementations + +2.4.0 / 2022-02-21 +================== + + * Prevent loss of async hooks context + +2.3.0 / 2015-05-26 +================== + + * Add defined behavior for HTTP `CONNECT` requests + * Add defined behavior for HTTP `Upgrade` requests + * deps: ee-first@1.1.1 + +2.2.1 / 2015-04-22 +================== + + * Fix `isFinished(req)` when data buffered + +2.2.0 / 2014-12-22 +================== + + * Add message object to callback arguments + +2.1.1 / 2014-10-22 +================== + + * Fix handling of pipelined requests + +2.1.0 / 2014-08-16 +================== + + * Check if `socket` is detached + * Return `undefined` for `isFinished` if state unknown + +2.0.0 / 2014-08-16 +================== + + * Add `isFinished` function + * Move to `jshttp` organization + * Remove support for plain socket argument + * Rename to `on-finished` + * Support both `req` and `res` as arguments + * deps: ee-first@1.0.5 + +1.2.2 / 2014-06-10 +================== + + * Reduce listeners added to emitters + - avoids "event emitter leak" warnings when used multiple times on same request + +1.2.1 / 2014-06-08 +================== + + * Fix returned value when already finished + +1.2.0 / 2014-06-05 +================== + + * Call callback when called on already-finished socket + +1.1.4 / 2014-05-27 +================== + + * Support node.js 0.8 + +1.1.3 / 2014-04-30 +================== + + * Make sure errors passed as instanceof `Error` + +1.1.2 / 2014-04-18 +================== + + * Default the `socket` to passed-in object + +1.1.1 / 2014-01-16 +================== + + * Rename module to `finished` + +1.1.0 / 2013-12-25 +================== + + * Call callback when called on already-errored socket + +1.0.1 / 2013-12-20 +================== + + * Actually pass the error to the callback + +1.0.0 / 2013-12-20 +================== + + * Initial release diff --git a/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/LICENSE b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/LICENSE new file mode 100644 index 00000000..5931fd23 --- /dev/null +++ b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/README.md b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/README.md new file mode 100644 index 00000000..8973cded --- /dev/null +++ b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/README.md @@ -0,0 +1,162 @@ +# on-finished + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Execute a callback when a HTTP request closes, finishes, or errors. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install on-finished +``` + +## API + +```js +var onFinished = require('on-finished') +``` + +### onFinished(res, listener) + +Attach a listener to listen for the response to finish. The listener will +be invoked only once when the response finished. If the response finished +to an error, the first argument will contain the error. If the response +has already finished, the listener will be invoked. + +Listening to the end of a response would be used to close things associated +with the response, like open files. + +Listener is invoked as `listener(err, res)`. + + + +```js +onFinished(res, function (err, res) { + // clean up open fds, etc. + // err contains the error if request error'd +}) +``` + +### onFinished(req, listener) + +Attach a listener to listen for the request to finish. The listener will +be invoked only once when the request finished. If the request finished +to an error, the first argument will contain the error. If the request +has already finished, the listener will be invoked. + +Listening to the end of a request would be used to know when to continue +after reading the data. + +Listener is invoked as `listener(err, req)`. + + + +```js +var data = '' + +req.setEncoding('utf8') +req.on('data', function (str) { + data += str +}) + +onFinished(req, function (err, req) { + // data is read unless there is err +}) +``` + +### onFinished.isFinished(res) + +Determine if `res` is already finished. This would be useful to check and +not even start certain operations if the response has already finished. + +### onFinished.isFinished(req) + +Determine if `req` is already finished. This would be useful to check and +not even start certain operations if the request has already finished. + +## Special Node.js requests + +### HTTP CONNECT method + +The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: + +> The CONNECT method requests that the recipient establish a tunnel to +> the destination origin server identified by the request-target and, +> if successful, thereafter restrict its behavior to blind forwarding +> of packets, in both directions, until the tunnel is closed. Tunnels +> are commonly used to create an end-to-end virtual connection, through +> one or more proxies, which can then be secured using TLS (Transport +> Layer Security, [RFC5246]). + +In Node.js, these request objects come from the `'connect'` event on +the HTTP server. + +When this module is used on a HTTP `CONNECT` request, the request is +considered "finished" immediately, **due to limitations in the Node.js +interface**. This means if the `CONNECT` request contains a request entity, +the request will be considered "finished" even before it has been read. + +There is no such thing as a response object to a `CONNECT` request in +Node.js, so there is no support for one. + +### HTTP Upgrade request + +The meaning of the `Upgrade` header from RFC 7230, section 6.1: + +> The "Upgrade" header field is intended to provide a simple mechanism +> for transitioning from HTTP/1.1 to some other protocol on the same +> connection. + +In Node.js, these request objects come from the `'upgrade'` event on +the HTTP server. + +When this module is used on a HTTP request with an `Upgrade` header, the +request is considered "finished" immediately, **due to limitations in the +Node.js interface**. This means if the `Upgrade` request contains a request +entity, the request will be considered "finished" even before it has been +read. + +There is no such thing as a response object to a `Upgrade` request in +Node.js, so there is no support for one. + +## Example + +The following code ensures that file descriptors are always closed +once the response finishes. + +```js +var destroy = require('destroy') +var fs = require('fs') +var http = require('http') +var onFinished = require('on-finished') + +http.createServer(function onRequest (req, res) { + var stream = fs.createReadStream('package.json') + stream.pipe(res) + onFinished(res, function () { + destroy(stream) + }) +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/on-finished/master?label=ci +[ci-url]: https://github.com/jshttp/on-finished/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-finished/master +[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master +[node-image]: https://badgen.net/npm/node/on-finished +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/on-finished +[npm-url]: https://npmjs.org/package/on-finished +[npm-version-image]: https://badgen.net/npm/v/on-finished diff --git a/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js new file mode 100644 index 00000000..e68df7bd --- /dev/null +++ b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js @@ -0,0 +1,234 @@ +/*! + * on-finished + * Copyright(c) 2013 Jonathan Ong + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = onFinished +module.exports.isFinished = isFinished + +/** + * Module dependencies. + * @private + */ + +var asyncHooks = tryRequireAsyncHooks() +var first = require('ee-first') + +/** + * Variables. + * @private + */ + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } + +/** + * Invoke callback when the response has finished, useful for + * cleaning up resources afterwards. + * + * @param {object} msg + * @param {function} listener + * @return {object} + * @public + */ + +function onFinished (msg, listener) { + if (isFinished(msg) !== false) { + defer(listener, null, msg) + return msg + } + + // attach the listener to the message + attachListener(msg, wrap(listener)) + + return msg +} + +/** + * Determine if message is already finished. + * + * @param {object} msg + * @return {boolean} + * @public + */ + +function isFinished (msg) { + var socket = msg.socket + + if (typeof msg.finished === 'boolean') { + // OutgoingMessage + return Boolean(msg.finished || (socket && !socket.writable)) + } + + if (typeof msg.complete === 'boolean') { + // IncomingMessage + return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) + } + + // don't know + return undefined +} + +/** + * Attach a finished listener to the message. + * + * @param {object} msg + * @param {function} callback + * @private + */ + +function attachFinishedListener (msg, callback) { + var eeMsg + var eeSocket + var finished = false + + function onFinish (error) { + eeMsg.cancel() + eeSocket.cancel() + + finished = true + callback(error) + } + + // finished on first message event + eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) + + function onSocket (socket) { + // remove listener + msg.removeListener('socket', onSocket) + + if (finished) return + if (eeMsg !== eeSocket) return + + // finished on first socket event + eeSocket = first([[socket, 'error', 'close']], onFinish) + } + + if (msg.socket) { + // socket already assigned + onSocket(msg.socket) + return + } + + // wait for socket to be assigned + msg.on('socket', onSocket) + + if (msg.socket === undefined) { + // istanbul ignore next: node.js 0.8 patch + patchAssignSocket(msg, onSocket) + } +} + +/** + * Attach the listener to the message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function attachListener (msg, listener) { + var attached = msg.__onFinished + + // create a private single listener with queue + if (!attached || !attached.queue) { + attached = msg.__onFinished = createListener(msg) + attachFinishedListener(msg, attached) + } + + attached.queue.push(listener) +} + +/** + * Create listener on message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function createListener (msg) { + function listener (err) { + if (msg.__onFinished === listener) msg.__onFinished = null + if (!listener.queue) return + + var queue = listener.queue + listener.queue = null + + for (var i = 0; i < queue.length; i++) { + queue[i](err, msg) + } + } + + listener.queue = [] + + return listener +} + +/** + * Patch ServerResponse.prototype.assignSocket for node.js 0.8. + * + * @param {ServerResponse} res + * @param {function} callback + * @private + */ + +// istanbul ignore next: node.js 0.8 patch +function patchAssignSocket (res, callback) { + var assignSocket = res.assignSocket + + if (typeof assignSocket !== 'function') return + + // res.on('socket', callback) is broken in 0.8 + res.assignSocket = function _assignSocket (socket) { + assignSocket.call(this, socket) + callback(socket) + } +} + +/** + * Try to require async_hooks + * @private + */ + +function tryRequireAsyncHooks () { + try { + return require('async_hooks') + } catch (e) { + return {} + } +} + +/** + * Wrap function with async resource, if possible. + * AsyncResource.bind static method backported. + * @private + */ + +function wrap (fn) { + var res + + // create anonymous resource + if (asyncHooks.AsyncResource) { + res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') + } + + // incompatible node.js + if (!res || !res.runInAsyncScope) { + return fn + } + + // return bound function + return res.runInAsyncScope.bind(res, fn, null) +} diff --git a/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/package.json b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/package.json new file mode 100644 index 00000000..644cd814 --- /dev/null +++ b/backend/node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/package.json @@ -0,0 +1,39 @@ +{ + "name": "on-finished", + "description": "Execute a callback when a request closes, finishes, or errors", + "version": "2.4.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/on-finished", + "dependencies": { + "ee-first": "1.1.1" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.1", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/HISTORY.md b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/HISTORY.md new file mode 100644 index 00000000..8e409541 --- /dev/null +++ b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/HISTORY.md @@ -0,0 +1,58 @@ +1.3.3 / 2019-04-15 +================== + + * Fix Node.js 0.8 return value inconsistencies + +1.3.2 / 2017-09-09 +================== + + * perf: reduce overhead for full URLs + * perf: unroll the "fast-path" `RegExp` + +1.3.1 / 2016-01-17 +================== + + * perf: enable strict mode + +1.3.0 / 2014-08-09 +================== + + * Add `parseurl.original` for parsing `req.originalUrl` with fallback + * Return `undefined` if `req.url` is `undefined` + +1.2.0 / 2014-07-21 +================== + + * Cache URLs based on original value + * Remove no-longer-needed URL mis-parse work-around + * Simplify the "fast-path" `RegExp` + +1.1.3 / 2014-07-08 +================== + + * Fix typo + +1.1.2 / 2014-07-08 +================== + + * Seriously fix Node.js 0.8 compatibility + +1.1.1 / 2014-07-08 +================== + + * Fix Node.js 0.8 compatibility + +1.1.0 / 2014-07-08 +================== + + * Incorporate URL href-only parse fast-path + +1.0.1 / 2014-03-08 +================== + + * Add missing `require` + +1.0.0 / 2014-03-08 +================== + + * Genesis from `connect` diff --git a/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/LICENSE b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/LICENSE new file mode 100644 index 00000000..27653d3d --- /dev/null +++ b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/LICENSE @@ -0,0 +1,24 @@ + +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/README.md b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/README.md new file mode 100644 index 00000000..443e716b --- /dev/null +++ b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/README.md @@ -0,0 +1,133 @@ +# parseurl + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Parse a URL with memoization. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install parseurl +``` + +## API + +```js +var parseurl = require('parseurl') +``` + +### parseurl(req) + +Parse the URL of the given request object (looks at the `req.url` property) +and return the result. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.url` does +not change will return a cached parsed object, rather than parsing again. + +### parseurl.original(req) + +Parse the original URL of the given request object and return the result. +This works by trying to parse `req.originalUrl` if it is a string, otherwise +parses `req.url`. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.originalUrl` +does not change will return a cached parsed object, rather than parsing again. + +## Benchmark + +```bash +$ npm run-script bench + +> parseurl@1.3.3 bench nodejs-parseurl +> node benchmark/index.js + + http_parser@2.8.0 + node@10.6.0 + v8@6.7.288.46-node.13 + uv@1.21.0 + zlib@1.2.11 + ares@1.14.0 + modules@64 + nghttp2@1.32.0 + napi@3 + openssl@1.1.0h + icu@61.1 + unicode@10.0 + cldr@33.0 + tz@2018c + +> node benchmark/fullurl.js + + Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" + + 4 tests completed. + + fasturl x 2,207,842 ops/sec ±3.76% (184 runs sampled) + nativeurl - legacy x 507,180 ops/sec ±0.82% (191 runs sampled) + nativeurl - whatwg x 290,044 ops/sec ±1.96% (189 runs sampled) + parseurl x 488,907 ops/sec ±2.13% (192 runs sampled) + +> node benchmark/pathquery.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" + + 4 tests completed. + + fasturl x 3,812,564 ops/sec ±3.15% (188 runs sampled) + nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled) + nativeurl - whatwg x 161,837 ops/sec ±2.26% (189 runs sampled) + parseurl x 4,166,338 ops/sec ±2.23% (184 runs sampled) + +> node benchmark/samerequest.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object + + 4 tests completed. + + fasturl x 3,821,651 ops/sec ±2.42% (185 runs sampled) + nativeurl - legacy x 2,651,162 ops/sec ±1.90% (187 runs sampled) + nativeurl - whatwg x 175,166 ops/sec ±1.44% (188 runs sampled) + parseurl x 14,912,606 ops/sec ±3.59% (183 runs sampled) + +> node benchmark/simplepath.js + + Parsing URL "/foo/bar" + + 4 tests completed. + + fasturl x 12,421,765 ops/sec ±2.04% (191 runs sampled) + nativeurl - legacy x 7,546,036 ops/sec ±1.41% (188 runs sampled) + nativeurl - whatwg x 198,843 ops/sec ±1.83% (189 runs sampled) + parseurl x 24,244,006 ops/sec ±0.51% (194 runs sampled) + +> node benchmark/slash.js + + Parsing URL "/" + + 4 tests completed. + + fasturl x 17,159,456 ops/sec ±3.25% (188 runs sampled) + nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled) + nativeurl - whatwg x 240,693 ops/sec ±0.83% (189 runs sampled) + parseurl x 42,279,067 ops/sec ±0.55% (190 runs sampled) +``` + +## License + + [MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/parseurl/master +[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master +[node-image]: https://badgen.net/npm/node/parseurl +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/parseurl +[npm-url]: https://npmjs.org/package/parseurl +[npm-version-image]: https://badgen.net/npm/v/parseurl +[travis-image]: https://badgen.net/travis/pillarjs/parseurl/master +[travis-url]: https://travis-ci.org/pillarjs/parseurl diff --git a/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js new file mode 100644 index 00000000..ece72232 --- /dev/null +++ b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js @@ -0,0 +1,158 @@ +/*! + * parseurl + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var url = require('url') +var parse = url.parse +var Url = url.Url + +/** + * Module exports. + * @public + */ + +module.exports = parseurl +module.exports.original = originalurl + +/** + * Parse the `req` url with memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function parseurl (req) { + var url = req.url + + if (url === undefined) { + // URL is undefined + return undefined + } + + var parsed = req._parsedUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedUrl = parsed) +}; + +/** + * Parse the `req` original url with fallback and memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function originalurl (req) { + var url = req.originalUrl + + if (typeof url !== 'string') { + // Fallback + return parseurl(req) + } + + var parsed = req._parsedOriginalUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedOriginalUrl = parsed) +}; + +/** + * Parse the `str` url with fast-path short-cut. + * + * @param {string} str + * @return {Object} + * @private + */ + +function fastparse (str) { + if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) { + return parse(str) + } + + var pathname = str + var query = null + var search = null + + // This takes the regexp from https://github.com/joyent/node/pull/7878 + // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/ + // And unrolls it into a for loop + for (var i = 1; i < str.length; i++) { + switch (str.charCodeAt(i)) { + case 0x3f: /* ? */ + if (search === null) { + pathname = str.substring(0, i) + query = str.substring(i + 1) + search = str.substring(i) + } + break + case 0x09: /* \t */ + case 0x0a: /* \n */ + case 0x0c: /* \f */ + case 0x0d: /* \r */ + case 0x20: /* */ + case 0x23: /* # */ + case 0xa0: + case 0xfeff: + return parse(str) + } + } + + var url = Url !== undefined + ? new Url() + : {} + + url.path = str + url.href = str + url.pathname = pathname + + if (search !== null) { + url.query = query + url.search = search + } + + return url +} + +/** + * Determine if parsed is still fresh for url. + * + * @param {string} url + * @param {object} parsedUrl + * @return {boolean} + * @private + */ + +function fresh (url, parsedUrl) { + return typeof parsedUrl === 'object' && + parsedUrl !== null && + (Url === undefined || parsedUrl instanceof Url) && + parsedUrl._raw === url +} diff --git a/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/package.json b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/package.json new file mode 100644 index 00000000..6b443ca7 --- /dev/null +++ b/backend/node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "parseurl", + "description": "parse a url with memoization", + "version": "1.3.3", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "repository": "pillarjs/parseurl", + "license": "MIT", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.1", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "fast-url-parser": "1.1.3", + "istanbul": "0.4.5", + "mocha": "6.1.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --check-leaks --bail --reporter spec test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" + } +} diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.eslintrc b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.eslintrc new file mode 100644 index 00000000..3b5d9e90 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.github/FUNDING.yml b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.github/FUNDING.yml new file mode 100644 index 00000000..7afce20a --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/possible-typed-array-names +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/CHANGELOG.md b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/CHANGELOG.md new file mode 100644 index 00000000..e3bf2a10 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/ljharb/possible-typed-array-names/compare/v1.0.0...v1.1.0) - 2025-02-06 + +### Commits + +- [types] use shared tsconfig [`7d3057f`](https://github.com/ljharb/possible-typed-array-names/commit/7d3057f723d221c032951e618f45ad9044cae80d) +- [actions] split out node 10-20, and 20+ [`3cc8138`](https://github.com/ljharb/possible-typed-array-names/commit/3cc81385d6af59c096475080d76a4c78e6fef664) +- [actions] remove redundant finisher; use reusable workflows [`b46fe5d`](https://github.com/ljharb/possible-typed-array-names/commit/b46fe5d2d47054922f7be81acc0f3c2b7882ddab) +- [New] add `Float16Array` [`77df613`](https://github.com/ljharb/possible-typed-array-names/commit/77df61313d3491acfd23da0d4452673cca476644) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `tape` [`85bba2e`](https://github.com/ljharb/possible-typed-array-names/commit/85bba2e359add86b19ef058d4a0560d369bf55a2) +- [Tests] tiny refactor [`b2ddd5a`](https://github.com/ljharb/possible-typed-array-names/commit/b2ddd5a9bc86b63631d9f2c17f21f0503492dbb3) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape` [`ed4447f`](https://github.com/ljharb/possible-typed-array-names/commit/ed4447f9ef1ad8657186282140a74ab474240d4e) +- [Tests] add attw; `postlint` [`b5b808c`](https://github.com/ljharb/possible-typed-array-names/commit/b5b808cebf0bc0bdb8636f4981cc8ffabb58bbbb) +- [Tests] replace `aud` with `npm audit` [`ce71c4e`](https://github.com/ljharb/possible-typed-array-names/commit/ce71c4e993e03b41034a4ca96fb8531dd8b8cc14) + +## v1.0.0 - 2024-02-19 + +### Commits + +- Initial implementation, tests, readme, types [`c279f55`](https://github.com/ljharb/possible-typed-array-names/commit/c279f550021896afa50c1169b3111618a96cf898) +- Initial commit [`0f22bf2`](https://github.com/ljharb/possible-typed-array-names/commit/0f22bf24d16fc8ea29483ed7ed378afb3758a4df) +- npm init [`25d6cff`](https://github.com/ljharb/possible-typed-array-names/commit/25d6cffe4091921e4e210704dabed37ae3d7b261) +- Only apps should have lockfiles [`a1bd592`](https://github.com/ljharb/possible-typed-array-names/commit/a1bd592fa037430d401b1d6d26cfea2c2d6789db) diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/LICENSE b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/README.md b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/README.md new file mode 100644 index 00000000..0580d2f7 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/README.md @@ -0,0 +1,50 @@ +# possible-typed-array-names [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A simple list of possible Typed Array names. + +## Example + +```js +const assert = require('assert'); + +const names = require('possible-typed-array-names'); + +assert(Array.isArray(names)); +assert(names.every(name => ( + typeof name === 'string' + && (( + typeof globalThis[name] === 'function' + && globalThis[name].name === name + ) || typeof globalThis[name] === 'undefined') +))); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/possible-typed-array-names +[npm-version-svg]: https://versionbadg.es/ljharb/possible-typed-array-names.svg +[deps-svg]: https://david-dm.org/ljharb/possible-typed-array-names.svg +[deps-url]: https://david-dm.org/ljharb/possible-typed-array-names +[dev-deps-svg]: https://david-dm.org/ljharb/possible-typed-array-names/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/possible-typed-array-names#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/possible-typed-array-names.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/possible-typed-array-names.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/possible-typed-array-names.svg +[downloads-url]: https://npm-stat.com/charts.html?package=possible-typed-array-names +[codecov-image]: https://codecov.io/gh/ljharb/possible-typed-array-names/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/possible-typed-array-names/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/possible-typed-array-names +[actions-url]: https://github.com/ljharb/possible-typed-array-names/actions diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.d.ts b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.d.ts new file mode 100644 index 00000000..92131596 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.d.ts @@ -0,0 +1,16 @@ +declare const names: [ + 'Float16Array', + 'Float32Array', + 'Float64Array', + 'Int8Array', + 'Int16Array', + 'Int32Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Uint16Array', + 'Uint32Array', + 'BigInt64Array', + 'BigUint64Array' +]; + +export = names; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.js b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.js new file mode 100644 index 00000000..5551ab60 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.js @@ -0,0 +1,17 @@ +'use strict'; + +/** @type {import('.')} */ +module.exports = [ + 'Float16Array', + 'Float32Array', + 'Float64Array', + 'Int8Array', + 'Int16Array', + 'Int32Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Uint16Array', + 'Uint32Array', + 'BigInt64Array', + 'BigUint64Array' +]; diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/package.json b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/package.json new file mode 100644 index 00000000..5285efa4 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/package.json @@ -0,0 +1,84 @@ +{ + "name": "possible-typed-array-names", + "version": "1.1.0", + "description": "A simple list of possible Typed Array names.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>= 10.2' audit --production", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/possible-typed-array-names.git" + }, + "keywords": [ + "typed", + "array", + "typedarray", + "Float32Array", + "Float64Array", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "BigInt64Array", + "BigUint64Array" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/possible-typed-array-names/issues" + }, + "homepage": "https://github.com/ljharb/possible-typed-array-names#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.3", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/test/index.js b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/test/index.js new file mode 100644 index 00000000..e115695a --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/test/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var test = require('tape'); + +var names = require('../'); + +test('typed array names', function (t) { + for (var i = 0; i < names.length; i++) { + var name = names[i]; + + t.equal(typeof name, 'string', 'is string'); + t.equal(names.indexOf(name), i, 'is unique (from start)'); + t.equal(names.lastIndexOf(name), i, 'is unique (from end)'); + + t.match(typeof global[name], /^(?:function|undefined)$/, 'is a global function, or `undefined`'); + } + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/tsconfig.json b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/tsconfig.json new file mode 100644 index 00000000..4e940905 --- /dev/null +++ b/backend/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ESNext", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/LICENSE-MIT.txt b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 00000000..a41e0a7e --- /dev/null +++ b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/README.md b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/README.md new file mode 100644 index 00000000..f611016b --- /dev/null +++ b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/README.md @@ -0,0 +1,148 @@ +# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/punycode) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode) + +Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). + +This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1). + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install punycode --save +``` + +In [Node.js](https://nodejs.org/): + +> ⚠️ Note that userland modules don't hide core modules. +> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`. +> Use `require('punycode/')` to import userland modules rather than core modules. + +```js +const punycode = require('punycode/'); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## For maintainers + +### How to publish a new release + +1. On the `main` branch, bump the version number in `package.json`: + + ```sh + npm version patch -m 'Release v%s' + ``` + + Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/). + + Note that this produces a Git commit + tag. + +1. Push the release commit and tag: + + ```sh + git push && git push --tags + ``` + + Our CI then automatically publishes the new release to npm, under both the [`punycode`](https://www.npmjs.com/package/punycode) and [`punycode.js`](https://www.npmjs.com/package/punycode.js) names. + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/package.json b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/package.json new file mode 100644 index 00000000..b8b76fc7 --- /dev/null +++ b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/package.json @@ -0,0 +1,58 @@ +{ + "name": "punycode", + "version": "2.3.1", + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "homepage": "https://mths.be/punycode", + "main": "punycode.js", + "jsnext:main": "punycode.es6.js", + "module": "punycode.es6.js", + "engines": { + "node": ">=6" + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/punycode.js.git" + }, + "bugs": "https://github.com/mathiasbynens/punycode.js/issues", + "files": [ + "LICENSE-MIT.txt", + "punycode.js", + "punycode.es6.js" + ], + "scripts": { + "test": "mocha tests", + "build": "node scripts/prepublish.js" + }, + "devDependencies": { + "codecov": "^3.8.3", + "nyc": "^15.1.0", + "mocha": "^10.2.0" + }, + "jspm": { + "map": { + "./punycode.js": { + "node": "@node/punycode" + } + } + } +} diff --git a/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.es6.js b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.es6.js new file mode 100644 index 00000000..dadece25 --- /dev/null +++ b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.es6.js @@ -0,0 +1,444 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.3.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode }; +export default punycode; diff --git a/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.js b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.js new file mode 100644 index 00000000..a1ef2519 --- /dev/null +++ b/backend/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.js @@ -0,0 +1,443 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.3.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +module.exports = punycode; diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/es-define-property b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/es-define-property new file mode 120000 index 00000000..21a4f5d0 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/es-define-property @@ -0,0 +1 @@ +../../es-define-property@1.0.1/node_modules/es-define-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.editorconfig b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.editorconfig new file mode 100644 index 00000000..dd5a8d84 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.editorconfig @@ -0,0 +1,46 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 180 +quote_type = single + +[test/*] +max_line_length = off + +[LICENSE.md] +indent_size = off + +[*.md] +max_line_length = off + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[LICENSE] +indent_size = 2 +max_line_length = off + +[coverage/**/*] +indent_size = off +indent_style = off +indent = off +max_line_length = off + +[.nycrc] +indent_style = tab + +[tea.yaml] +indent_size = 2 diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/FUNDING.yml b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/FUNDING.yml new file mode 100644 index 00000000..0355f4f5 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/qs +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/SECURITY.md b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/SECURITY.md new file mode 100644 index 00000000..b499cb68 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/SECURITY.md @@ -0,0 +1,11 @@ +# Security + +Please file a private vulnerability report via GitHub, email [@ljharb](https://github.com/ljharb), or see https://tidelift.com/security if you have a potential security vulnerability to report. + +## Incident Response Plan + +Please see our [Incident Response Plan](https://github.com/ljharb/.github/blob/main/INCIDENT_RESPONSE_PLAN.md). + +## Threat Model + +Please see [THREAT_MODEL.md](./THREAT_MODEL.md). diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/THREAT_MODEL.md b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/THREAT_MODEL.md new file mode 100644 index 00000000..804235ba --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.github/THREAT_MODEL.md @@ -0,0 +1,78 @@ +## Threat Model for qs (querystring parsing library) + +### 1. Library Overview + +- **Library Name:** qs +- **Brief Description:** A JavaScript library for parsing and stringifying URL query strings, supporting nested objects and arrays. It is widely used in Node.js and web applications for processing query parameters[2][6][8]. +- **Key Public APIs/Functions:** `qs.parse()`, `qs.stringify()` + +### 2. Define Scope + +This threat model focuses on the core parsing and stringifying functionality, specifically the handling of nested objects and arrays, option validation, and cycle management in stringification. + +### 3. Conceptual System Diagram + +``` +Caller Application → qs.parse(input, options) → Parsing Engine → Output Object + │ + └→ Options Handling + +Caller Application → qs.stringify(obj, options) → Stringifying Engine → Output String + │ + └→ Options Handling + └→ Cycle Tracking +``` + +**Trust Boundaries:** +- **Input string (parse):** May come from untrusted sources (e.g., user input, network requests) +- **Input object (stringify):** The calling application's own data, not a direct untrusted channel. May contain cycles (handled by the cycle detector). Deeply-nested non-cyclic input surfaces as a catchable synchronous `RangeError` (stack overflow), not unbounded resource consumption; callers that serialize externally-influenced objects should bound their depth/size beforehand. +- **Options:** Provided by the caller +- **Cycle Tracking:** Used only during stringification to detect and handle circular references + +### 4. Identify Assets + +- **Integrity of parsed output:** Prevent malicious manipulation of the output object structure, especially ensuring builtins/globals are not modified as a result of parse[3][4][8]. +- **Confidentiality of processed data:** Avoid leaking sensitive information through errors or output. +- **Availability/performance for host application:** Prevent crashes or resource exhaustion in the consuming application. +- **Security of host application:** Prevent the library from being a vector for attacks (e.g., prototype pollution, DoS). +- **Reputation of library:** Maintain trust by avoiding supply chain attacks and vulnerabilities[1]. + +### 5. Identify Threats + +| Component / API / Interaction | S | T | R | I | D | E | +|---------------------------------------|----|----|----|----|----|----| +| Public API Call (`parse`) | – | ✓ | – | ✓ | ✓ | ✓ | +| Public API Call (`stringify`) | – | ✓ | – | ✓ | ✓ | – | +| Options Handling | ✓ | ✓ | – | ✓ | – | ✓ | +| Dependency Interaction | – | – | – | – | ✓ | – | + +**Key Threats:** +- **Tampering:** Malicious input can, if not prevented, alter parsed output (e.g., prototype pollution via `__proto__`, modification of builtins/globals)[3][4][8]. +- **Information Disclosure:** Error messages may expose internal details or sensitive data. +- **Denial of Service:** Large or malformed input can exhaust memory or CPU. +- **Elevation of Privilege:** Prototype pollution can lead to unintended privilege escalation in the host application[3][4][8]. + +### 6. Mitigation/Countermeasures + +| Threat Identified | Proposed Mitigation | +|---------------------------------------------------|---------------------| +| Tampering (malicious input, prototype pollution) | Strict input validation; keep `allowPrototypes: false` by default; use `plainObjects` for output; ensure builtins/globals are never modified by parse[4][8]. | +| Information Disclosure (error messages) | Generic error messages without stack traces or internal paths. | +| Denial of Service (memory/CPU exhaustion) | `arrayLimit`, `parameterLimit`, and depth limiting apply with safe defaults. Note that `arrayLimit` is a representation threshold (array vs. object), and `parameterLimit` bounds only the number of `&`-delimited parameters - neither caps the elements produced by `comma: true` splitting. For a hard cap that rejects oversized untrusted input, opt in to `throwOnLimitExceeded: true` (default `false`), and always bound input size at the transport layer[7]. On the `stringify` side, the input is the caller's own object rather than an untrusted string, so unbounded nesting manifests as a catchable `RangeError` (stack overflow) rather than exhaustion; callers serializing externally-influenced objects should bound depth/size beforehand, and may opt into `stringify`'s `depth` option (default `Infinity`) for a deterministic, catchable error. | +| Elevation of Privilege (prototype pollution) | Keep `allowPrototypes: false`; validate options against allowlist; use `plainObjects` to avoid prototype pollution[4][8]. | + +### 7. Risk Ranking + +- **High:** Denial of Service via array parsing or malformed input (historical vulnerability) +- **Medium:** Prototype pollution via options or input (if `allowPrototypes` enabled) +- **Low:** Information disclosure in errors + +### 8. Next Steps & Review + +1. **Audit option validation logic.** +2. **Depth limiting:** `parse` enforces a `depth` bound by default (with `strictDepth` to throw); `stringify` offers an opt-in `depth` bound (default `Infinity`, since its input is caller-produced) for defense-in-depth. +3. **Implement fuzz testing for parser and stringifier edge cases.** +4. **Regularly review dependencies for vulnerabilities.** +5. **Keep documentation and threat model up to date.** +6. **Ensure builtins/globals are never modified as a result of parse.** +7. **Support round-trip consistency between parse and stringify as a non-security goal, with the right options[5][9].** diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.nycrc b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.nycrc new file mode 100644 index 00000000..1d57cabe --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "dist" + ] +} diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/CHANGELOG.md b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/CHANGELOG.md new file mode 100644 index 00000000..8d459c21 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/CHANGELOG.md @@ -0,0 +1,848 @@ +## **6.16.0** + - [New] `stringify`: add a `depth` option to bound recursion depth (default `Infinity`) + - [Fix] stringify: serialize Date values when a filter is provided + - [Fix] `parse`: enforce `arrayLimit` on comma groups under `[]=` when `throwOnLimitExceeded` is set + - [Fix] `parse`: flatten a collection appended to an overflowed array (#571) + - [Fix] `utils`: `isBuffer`: do not invoke a non-callable `constructor.isBuffer` + - [Fix] `stringify`: do not let `allowEmptyArrays` skip cycle detection (or drop own keys) on an empty array with own properties + - [Fix] `stringify`: encode dots in a top-level key with a primitive value when encodeDotInKeys is set (#562) + - [Docs] threat model: clarify `stringify` deep-nesting DoS is caller-bounded + - [Docs] clarify `arrayLimit` is a representation threshold, not an element-count cap + - [Tests] `parse`: remove a test that pinned `[]=` comma groups escaping `arrayLimit` + - [Tests] `stringify`: pin current `encodeDotInKeys` separator-dot behavior + - [Dev Deps] update `@ljharb/eslint-config`, `eslint` + - [Dev Deps] update `eslint`, `evalmd` + +## **6.15.3** +- [Fix] `parse`: enforce `throwOnLimitExceeded` for cumulative array growth via `combine`/`merge` +- [Fix] `utils`: respect encoding of surrogate pairs across chunks (#559) +- [Robustness] `parse`: throw the `arrayLimit` error before splitting oversized comma values +- [Robustness] `utils.merge` / `utils.assign`: avoid invoking `__proto__` setter when copying own properties +- [Robustness] `utils`: enforce `arrayLimit` consistently across `merge`'s array paths +- [Perf] `utils`: make `compact` O(n) via a side-channel visited-set instead of `Array.indexOf` +- [Deps] update `side-channel` +- [Dev Deps] update `eslint`, `mock-property`, `tape` +- [Tests] `parse`: characterize current lenient handling of unbalanced bracket keys (#558) + +## **6.15.2** +- [Fix] `stringify`: skip null/undefined entries in `arrayFormat: 'comma'` + `encodeValuesOnly` instead of crashing in `encoder` +- [Fix] `stringify`: use configured `delimiter` after `charsetSentinel` (#555) +- [Fix] `stringify`: apply `formatter` to encoded key under `strictNullHandling` (#554) +- [Fix] `stringify`: skip null/undefined filter-array entries instead of crashing in `encoder` (#551) +- [Fix] `parse`: handle nested bracket groups and add regression tests (#530) +- [readme] fix grammar (#550) +- [Dev Deps] update `@ljharb/eslint-config` +- [Tests] add regression tests for keys containing percent-encoded bracket text + +## **6.15.1** +- [Fix] `parse`: `parameterLimit: Infinity` with `throwOnLimitExceeded: true` silently drops all parameters +- [Deps] update `@ljharb/eslint-config` +- [Dev Deps] update `@ljharb/eslint-config`, `iconv-lite` +- [Tests] increase coverage + +## **6.15.0** +- [New] `parse`: add `strictMerge` option to wrap object/primitive conflicts in an array (#425, #122) +- [Fix] `duplicates` option should not apply to bracket notation keys (#514) + +## **6.14.2** +- [Fix] `parse`: mark overflow objects for indexed notation exceeding `arrayLimit` (#546) +- [Fix] `arrayLimit` means max count, not max index, in `combine`/`merge`/`parseArrayValue` +- [Fix] `parse`: throw on `arrayLimit` exceeded with indexed notation when `throwOnLimitExceeded` is true (#529) +- [Fix] `parse`: enforce `arrayLimit` on `comma`-parsed values +- [Fix] `parse`: fix error message to reflect arrayLimit as max index; remove extraneous comments (#545) +- [Robustness] avoid `.push`, use `void` +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [meta] fix changelog typo (`arrayLength` → `arrayLimit`) +- [actions] fix rebase workflow permissions + +## **6.14.1** +- [Fix] ensure `arrayLimit` applies to `[]` notation as well +- [Fix] `parse`: when a custom decoder returns `null` for a key, ignore that key +- [Refactor] `parse`: extract key segment splitting helper +- [meta] add threat model +- [actions] add workflow permissions +- [Tests] `stringify`: increase coverage +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `npmignore`, `es-value-fixtures`, `for-each`, `object-inspect` + +## **6.14.0** +- [New] `parse`: add `throwOnParameterLimitExceeded` option (#517) +- [Refactor] `parse`: use `utils.combine` more +- [patch] `parse`: add explicit `throwOnLimitExceeded` default +- [actions] use shared action; re-add finishers +- [meta] Fix changelog formatting bug +- [Deps] update `side-channel` +- [Dev Deps] update `es-value-fixtures`, `has-bigints`, `has-proto`, `has-symbols` +- [Tests] increase coverage + +## **6.13.3** +[Fix] fix regressions from robustness refactor +[actions] update reusable workflows + +## **6.13.2** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.13.1** +- [Fix] `stringify`: avoid a crash when a `filter` key is `null` +- [Fix] `utils.merge`: functions should not be stringified into keys +- [Fix] `parse`: avoid a crash with interpretNumericEntities: true, comma: true, and iso charset +- [Fix] `stringify`: ensure a non-string `filter` does not crash +- [Refactor] use `__proto__` syntax instead of `Object.create` for null objects +- [Refactor] misc cleanup +- [Tests] `utils.merge`: add some coverage +- [Tests] fix a test case +- [actions] split out node 10-20, and 20+ +- [Dev Deps] update `es-value-fixtures`, `mock-property`, `object-inspect`, `tape` + +## **6.13.0** +- [New] `parse`: add `strictDepth` option (#511) +- [Tests] use `npm audit` instead of `aud` + +## **6.12.5** +- [Fix] fix regressions from robustness refactor +- [actions] update reusable workflows + +## **6.12.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.12.3** +- [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` +- [meta] fix changelog indentation + +## **6.12.2** +- [Fix] `parse`: parse encoded square brackets (#506) +- [readme] add CII best practices badge + +## **6.12.1** +- [Fix] `parse`: Disable `decodeDotInKeys` by default to restore previous behavior (#501) +- [Performance] `utils`: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502) +- [Refactor] `utils`: use `+=` +- [Tests] increase coverage + +## **6.12.0** + +- [New] `parse`/`stringify`: add `decodeDotInKeys`/`encodeDotKeys` options (#488) +- [New] `parse`: add `duplicates` option +- [New] `parse`/`stringify`: add `allowEmptyArrays` option to allow [] in object values (#487) +- [Refactor] `parse`/`stringify`: move allowDots config logic to its own variable +- [Refactor] `stringify`: move option-handling code into `normalizeStringifyOptions` +- [readme] update readme, add logos (#484) +- [readme] `stringify`: clarify default `arrayFormat` behavior +- [readme] fix line wrapping +- [readme] remove dead badges +- [Deps] update `side-channel` +- [meta] make the dist build 50% smaller +- [meta] add `sideEffects` flag +- [meta] run build in prepack, not prepublish +- [Tests] `parse`: remove useless tests; add coverage +- [Tests] `stringify`: increase coverage +- [Tests] use `mock-property` +- [Tests] `stringify`: improve coverage +- [Dev Deps] update `@ljharb/eslint-config `, `aud`, `has-override-mistake`, `has-property-descriptors`, `mock-property`, `npmignore`, `object-inspect`, `tape` +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 + +## **6.11.4** +- [Fix] fix regressions from robustness refactor +- [actions] update reusable workflows + +## **6.11.3** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.11.2** +- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) +- [Tests] add passing test cases with empty keys (#473) + +## **6.11.1** +- [Fix] `stringify`: encode comma values more consistently (#463) +- [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447) +- [meta] remove extraneous code backticks (#457) +- [meta] fix changelog markdown +- [actions] update checkout action +- [actions] restrict action permissions +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` + +## **6.11.0** +- [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) +- [readme] fix version badge + +## **6.10.7** +- [Fix] fix regressions from robustness refactor +- [actions] update reusable workflows + +## **6.10.6** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.10.5** +- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434) + +## **6.10.4** +- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441) +- [meta] use `npmignore` to autogenerate an npmignore file +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape` + +## **6.10.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [actions] reuse common workflows +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape` + +## **6.10.2** +- [Fix] `stringify`: actually fix cyclic references (#426) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [actions] update codecov uploader +- [actions] update workflows +- [Tests] clean up stringify tests slightly +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape` + +## **6.10.1** +- [Fix] `stringify`: avoid exception on repeated object values (#402) + +## **6.10.0** +- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393) +- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312) +- [meta] fix README.md (#399) +- [meta] only run `npm run dist` in publish, not install +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` +- [Tests] fix tests on node v0.6 +- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` +- [Tests] Revert "[meta] ignore eclint transitive audit warning" + +## **6.9.9** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.9.8** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.9.7** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [Tests] clean up stringify tests slightly +- [meta] fix README.md (#399) +- Revert "[meta] ignore eclint transitive audit warning" +- [actions] backport actions from main +- [Dev Deps] backport updates from main + +## **6.9.6** +- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 + +## **6.9.5** +- [Fix] `stringify`: do not encode parens for RFC1738 +- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350) +- [Refactor] `format`: remove `util.assign` call +- [meta] add "Allow Edits" workflow; update rebase workflow +- [actions] switch Automatic Rebase workflow to `pull_request_target` event +- [Tests] `stringify`: add tests for #378 +- [Tests] migrate tests to Github Actions +- [Tests] run `nyc` on all tests; use `tape` runner +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud` + +## **6.9.4** +- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364) +- [Refactor] `stringify`: reduce branching (part of #350) +- [Refactor] move `maybeMap` to `utils` +- [Dev Deps] update `browserify`, `tape` + +## **6.9.3** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.9.2** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [meta] ignore eclint transitive audit warning +- [meta] fix indentation in package.json +- [meta] add tidelift marketing copy +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite` +- [actions] add automatic rebasing / merge commit blocking + +## **6.9.1** +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [Fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` +- [Tests] use shared travis-ci config + +## **6.9.0** +- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray + +## **6.8.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.8.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.8.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Tests] clean up stringify tests slightly +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Refactor] `stringify`: reduce branching +- [meta] do not publish workflow files + +## **6.8.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.8.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [actions] add automatic rebasing / merge commit blocking + +## **6.8.0** +- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326) +- [New] [Fix] stringify symbols and bigints +- [Fix] ensure node 0.12 can stringify Symbols +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape` +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326) +- [Tests] use `eclint` instead of `editorconfig-tools` +- [docs] readme: add security note +- [meta] add github sponsorship +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause + +## **6.7.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.7.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.7.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Tests] use `nyc` for coverage +- [Tests] clean up stringify tests slightly + +## **6.7.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.7.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- readme: add security note +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended +- [Tests] use `eclint` instead of `editorconfig-tools` +- [actions] add automatic rebasing / merge commit blocking + +## **6.7.0** +- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) +- [Fix] correctly parse nested arrays (#212) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] `stringify`/`utils`: cache `Array.isArray` +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] temporarily allow coverage to fail + +## **6.6.3** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.6.2** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.6.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `formats`: tiny bit of cleanup. +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor]: `stringify`/`utils`: cache `Array.isArray` +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [meta] Fixes typo in CHANGELOG.md +- [actions] backport actions from main +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] always use `String(x)` over `x.toString()` +- [Dev Deps] backport from main + +## **6.6.0** +- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) +- [New] move two-value combine to a `utils` function (#189) +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) +- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults +- [Refactor] add missing defaults +- [Refactor] `parse`: one less `concat` call +- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` +- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS + +## **6.5.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.5.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.5.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clean up license text so it’s properly detected as BSD-3-Clause +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.5.2** +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) +- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify` + +## **6.5.1** +- [Fix] Fix parsing & compacting very deep objects (#224) +- [Refactor] name utils functions +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` +- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node +- [Tests] Use precise dist for Node.js 0.6 runtime (#225) +- [Tests] make 0.6 required, now that it’s passing +- [Tests] on `node` `v8.2`; fix npm on node 0.6 + +## **6.5.0** +- [New] add `utils.assign` +- [New] pass default encoder/decoder to custom encoder/decoder functions (#206) +- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213) +- [Fix] Handle stringifying empty objects with addQueryPrefix (#217) +- [Fix] do not mutate `options` argument (#207) +- [Refactor] `parse`: cache index to reuse in else statement (#182) +- [Docs] add various badges to readme (#208) +- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape` +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 +- [Tests] add `editorconfig-tools` + +## **6.4.3** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.4.2** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace runkit CI badge with shields.io check-runs badge +- [readme] replace travis CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.4.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.4.0** +- [New] `qs.stringify`: add `encodeValuesOnly` option +- [Fix] follow `allowPrototypes` option during merge (#201, #201) +- [Fix] support keys starting with brackets (#202, #200) +- [Fix] chmod a-x +- [Dev Deps] update `eslint` +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds +- [eslint] reduce warnings + +## **6.3.5** +- [Fix] fix regressions from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.3.4** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.3.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.3.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Dev Deps] update `eslint` +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.3.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` +- [Tests] on all node minors; improve test matrix +- [Docs] document stringify option `allowDots` (#195) +- [Docs] add empty object and array values example (#195) +- [Docs] Fix minor inconsistency/typo (#192) +- [Docs] document stringify option `sort` (#191) +- [Refactor] `stringify`: throw faster with an invalid encoder +- [Refactor] remove unnecessary escapes (#184) +- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) + +## **6.3.0** +- [New] Add support for RFC 1738 (#174, #173) +- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) +- [Fix] ensure `utils.merge` handles merging two arrays +- [Refactor] only constructors should be capitalized +- [Refactor] capitalized var names are for constructors only +- [Refactor] avoid using a sparse array +- [Robustness] `formats`: cache `String#replace` +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` +- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix +- [Tests] flesh out arrayLimit/arrayFormat tests (#107) +- [Tests] skip Object.create tests when null objects are not available +- [Tests] Turn on eslint for test files (#175) + +## **6.2.6** +- [Fix] fix regression from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.2.5** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge +- [actions] fix rebase workflow permissions + +## **6.2.4** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.2.3** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.2.2** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## **6.1.4** +- [Fix] fix regression from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.1.3** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge + +## **6.1.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.1.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) +- [New] allowDots option for `stringify` (#151) +- [Fix] "sort" option should work at a depth of 3 or more (#151) +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## **6.0.6** +- [Fix] fix regression from robustness refactor +- [meta] add `npmignore` to autogenerate an npmignore file +- [actions] update reusable workflows + +## **6.0.5** +- [Robustness] avoid `.push`, use `void` +- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) +- [readme] replace travis CI badge with shields.io check-runs badge + +## **6.0.4** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.0.3** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) +- Revert ES6 requirement and restore support for node down to v0.8. + +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json + +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 + +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + +## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) +- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string + +## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) +- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify + +## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm + +## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional + +## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" + +## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost +- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign +- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute + +## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function + +## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option + +## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/LICENSE.md b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/LICENSE.md new file mode 100644 index 00000000..fecf6b69 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/LICENSE.md @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/README.md b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/README.md new file mode 100644 index 00000000..e3a839f0 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/README.md @@ -0,0 +1,776 @@ +

+ qs +

+ +# qs [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9058/badge)](https://bestpractices.coreinfrastructure.org/projects/9058) + +[![npm badge][npm-badge-png]][package-url] + +A querystring parsing and stringifying library with some added security. + +Lead Maintainer: [Jordan Harband](https://github.com/ljharb) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var qs = require('qs'); +var assert = require('assert'); + +var obj = qs.parse('a=c'); +assert.deepEqual(obj, { a: 'c' }); + +var str = qs.stringify(obj); +assert.equal(str, 'a=c'); +``` + +### Parsing Objects + +[](#preventEval) +```javascript +qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +assert.deepEqual(qs.parse('foo[bar]=baz'), { + foo: { + bar: 'baz' + } +}); +``` + +When using the `plainObjects` option the parsed value is returned as a null object, created via `{ __proto__: null }` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); +assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. +*WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. +Always be careful with this option. + +```javascript +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); +``` + +URI encoded strings work too: + +```javascript +assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } +}); +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' + } + } +}); +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. +This means if you attempt to parse a string like `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +}; +var string = 'a[b][c][d][e][f][g][h][i]=j'; +assert.deepEqual(qs.parse(string), expected); +``` + +This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: + +```javascript +var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); +``` + +You can configure **qs** to throw an error when parsing nested input beyond this depth using the `strictDepth` option (defaulted to false): + +```javascript +try { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); +} catch (err) { + assert(err instanceof RangeError); + assert.strictEqual(err.message, 'Input depth exceeded depth option of 1 and strictDepth is true'); +} +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. The strictDepth option adds a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); +``` + +If you want an error to be thrown whenever the a limit is exceeded (eg, `parameterLimit`, `arrayLimit`), set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. +```javascript +try { + qs.parse('a=1&b=2&c=3&d=4', { parameterLimit: 3, throwOnLimitExceeded: true }); +} catch (err) { + assert(err instanceof Error); + assert.strictEqual(err.message, 'Parameter limit exceeded. Only 3 parameters allowed.'); +} +``` + +When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `parameterLimit` and ignore the rest without throwing an error. + +Note that `parameterLimit` only bounds the number of `&`-delimited parameters; it does not limit how many values a single parameter expands into. In particular, when `comma: true` is enabled, a single parameter's value is split on commas into arbitrarily many elements, which `parameterLimit` does not constrain. To bound the total element count from untrusted input, set `throwOnLimitExceeded: true` (see `arrayLimit` below), and always bound the input size at the transport layer (e.g. an HTTP body-size limit). + +To bypass the leading question mark, use `ignoreQueryPrefix`: + +```javascript +var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true }); +assert.deepEqual(prefixed, { a: 'b', c: 'd' }); +``` + +An optional delimiter can also be passed: + +```javascript +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { a: 'b', c: 'd' }); +``` + +Delimiters can be a regular expression too: + +```javascript +var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); +``` + +Option `decodeDotInKeys` can be used to decode dots in keys +Note: it implies `allowDots`, so `parse` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. + +```javascript +var withDots = qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { decodeDotInKeys: true }); +assert.deepEqual(withDots, { 'name.obj': { first: 'John', last: 'Doe' }}); +``` + +Option `allowEmptyArrays` can be used to allow empty array values in an object +```javascript +var withEmptyArrays = qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }); +assert.deepEqual(withEmptyArrays, { foo: [], bar: 'baz' }); +``` + +Option `duplicates` can be used to change the behavior when duplicate keys are encountered +```javascript +assert.deepEqual(qs.parse('foo=bar&foo=baz'), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'bar' }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); +``` + +Note that keys with bracket notation (`[]`) always combine into arrays, regardless of the `duplicates` setting: +```javascript +assert.deepEqual(qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }), { a: '2', b: ['1', '2'] }); +``` + +If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: + +```javascript +var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); +assert.deepEqual(oldCharset, { a: '§' }); +``` + +Some services add an initial `utf8=✓` value to forms so that old Internet Explorer versions are more likely to submit the form as utf-8. +Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string or `application/x-www-form-urlencoded` body was *not* sent as utf-8, eg. if the form had an `accept-charset` parameter or the containing page had a different character set. + +**qs** supports this mechanism via the `charsetSentinel` option. +If specified, the `utf8` parameter will be omitted from the returned object. +It will be used to switch to `iso-8859-1`/`utf-8` mode depending on how the checkmark is encoded. + +**Important**: When you specify both the `charset` option and the `charsetSentinel` option, the `charset` will be overridden when the request contains a `utf8` parameter from which the actual charset can be deduced. +In that sense the `charset` will behave as the default charset rather than the authoritative charset. + +```javascript +var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { + charset: 'iso-8859-1', + charsetSentinel: true +}); +assert.deepEqual(detectedAsUtf8, { a: 'ø' }); + +// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: +var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { + charset: 'utf-8', + charsetSentinel: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); +``` + +If you want to decode the `&#...;` syntax to the actual character, you can specify the `interpretNumericEntities` option as well: + +```javascript +var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { + charset: 'iso-8859-1', + interpretNumericEntities: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); +``` + +It also works when the charset has been detected in `charsetSentinel` mode. + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); +``` + +You may specify an index as well: + +```javascript +var withIndexes = qs.parse('a[1]=c&a[0]=b'); +assert.deepEqual(withIndexes, { a: ['b', 'c'] }); +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number to create an array. +When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving their order: + +```javascript +var noSparse = qs.parse('a[1]=b&a[15]=c'); +assert.deepEqual(noSparse, { a: ['b', 'c'] }); +``` + +You may also use `allowSparse` option to parse sparse arrays: + +```javascript +var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true }); +assert.deepEqual(sparseArray, { a: [, '2', , '5'] }); +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +var withEmptyString = qs.parse('a[]=&a[]=b'); +assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + +var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); +assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); +``` + +**qs** will also limit arrays to a maximum of `20` elements. +Any array members with an index of `20` or greater will instead be converted to an object with the index as the key. +This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. + +```javascript +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); +assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); +``` + +If you want to throw an error whenever the array limit is exceeded, set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. +```javascript +try { + qs.parse('a[1]=b', { arrayLimit: 0, throwOnLimitExceeded: true }); +} catch (err) { + assert(err instanceof Error); + assert.strictEqual(err.message, 'Array limit exceeded. Only 0 elements allowed in an array.'); +} +``` + +When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `arrayLimit` and if the limit is exceeded, the array will instead be converted to an object with the index as the key. + +Note that `arrayLimit` is a *representation* threshold that controls when a numerically-indexed collection switches from an array to an object — it is **not** a hard cap on the total number of elements parsed. With the default `throwOnLimitExceeded: false`, exceeding `arrayLimit` never rejects or truncates input; it only changes the container type, and the resulting object still holds every element (so its size stays proportional to the input). This conversion is itself a safeguard: it avoids allocating a huge sparse array for input like `a[999999999]`. If you need a hard limit that rejects oversized input from untrusted sources, set `throwOnLimitExceeded: true`. + +To prevent array syntax (`a[]`, `a[0]`) from being parsed as arrays, set `parseArrays` to `false`. +Note that duplicate keys (e.g. `a=b&a=c`) may still produce arrays when `duplicates` is `'combine'` (the default). + +```javascript +var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); +assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +var mixedNotation = qs.parse('a[0]=b&a[b]=c'); +assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); +``` + +When a key appears as both a plain value and an object, **qs** will by default wrap the conflicting values in an array (`strictMerge` defaults to `true`): + +```javascript +assert.deepEqual(qs.parse('a[b]=c&a=d'), { a: [{ b: 'c' }, 'd'] }); +assert.deepEqual(qs.parse('a=d&a[b]=c'), { a: ['d', { b: 'c' }] }); +``` + +To restore the legacy behavior (where the primitive is used as a key with value `true`), set `strictMerge` to `false`: + +```javascript +assert.deepEqual(qs.parse('a[b]=c&a=d', { strictMerge: false }), { a: { b: 'c', d: true } }); +``` + +You can also create arrays of objects: + +```javascript +var arraysOfObjects = qs.parse('a[][b]=c'); +assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); +``` + +Some people use comma to join array, **qs** can parse it: +```javascript +var arraysOfObjects = qs.parse('a=b,c', { comma: true }) +assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) +``` +(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) + +### Parsing primitive/scalar values (numbers, booleans, null, etc) + +By default, all values are parsed as strings. +This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). + +```javascript +var primitiveValues = qs.parse('a=15&b=true&c=null'); +assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' }); +``` + +If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters. + +### Stringifying + +[](#preventEval) +```javascript +qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); +assert.equal(unencoded, 'a[b]=c'); +``` + +Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: +```javascript +var encodedValues = qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true } +); +assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); +``` + +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +By default, `qs.stringify` serializes an object of any nesting depth. +For backwards compatibility, and because its input is the caller's own object rather than a query string parsed by **qs**, this is unbounded. +If you serialize objects whose nesting can be influenced by untrusted input, bound it with the numeric `depth` option (default `Infinity`); +exceeding it throws a catchable `RangeError` instead of eventually overflowing the call stack: + +```javascript +try { + qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: 2 }); +} catch (err) { + assert(err instanceof RangeError); + assert.strictEqual(err.message, 'Input depth exceeded depth option of 2'); +} +``` + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + +You can encode keys and values using different logic by using the type argument provided to the encoder: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return // Encoded key + } else if (type === 'value') { + return // Encoded value + } +}}) +``` + +The type argument is also provided to the decoder: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return // Decoded key + } else if (type === 'value') { + return // Decoded value + } +}}) +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. +Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array: + +```javascript +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) +// 'a=b,c' +``` + +Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse. + +When objects are stringified, by default they use bracket notation: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); +// 'a[b][c]=d&a[b][e]=f' +``` + +You may override this to use dot notation by setting the `allowDots` option to `true`: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); +// 'a.b.c=d&a.b.e=f' +``` + +You may encode the dot notation in the keys of object with option `encodeDotInKeys` by setting it to `true`: +Note: it implies `allowDots`, so `stringify` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. +Caveat: when `encodeValuesOnly` is `true` as well as `encodeDotInKeys`, only dots in keys and nothing else will be encoded. +```javascript +qs.stringify({ "name.obj": { "first": "John", "last": "Doe" } }, { allowDots: true, encodeDotInKeys: true }) +// 'name%252Eobj.first=John&name%252Eobj.last=Doe' +``` + +You may allow empty array values by setting the `allowEmptyArrays` option to `true`: +```javascript +qs.stringify({ foo: [], bar: 'baz' }, { allowEmptyArrays: true }); +// 'foo[]&bar=baz' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +assert.equal(qs.stringify({ a: '' }), 'a='); +``` + +Key with no values (such as an empty object or array) will return nothing: + +```javascript +assert.equal(qs.stringify({ a: [] }), ''); +assert.equal(qs.stringify({ a: {} }), ''); +assert.equal(qs.stringify({ a: [{}] }), ''); +assert.equal(qs.stringify({ a: { b: []} }), ''); +assert.equal(qs.stringify({ a: { b: {}} }), ''); +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); +``` + +The query string may optionally be prepended with a question mark: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d'); +``` + +Note that when the output is an empty string, the prefix will not be added: + +```javascript +assert.equal(qs.stringify({}, { addQueryPrefix: true }), ''); +``` + +The delimiter may be overridden with stringify as well: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); +``` + +If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: + +```javascript +var date = new Date(7); +assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); +assert.equal( + qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), + 'a=7' +); +``` + +You may use the `sort` option to affect the order of parameter keys: + +```javascript +function alphabeticalSort(a, b) { + return a.localeCompare(b); +} +assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. +Otherwise, if you pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); +// 'a=b&c=d&e[f]=123&e[g][0]=4' +qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); +// 'a=b&e=f' +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); +// 'a[0]=b&a[2]=d' +``` + +You could also use `filter` to inject custom serialization for user defined types. +Consider you're working with some api that expects query strings of the format for ranges: + +``` +https://domain.com/endpoint?range=30...70 +``` + +For which you model as: + +```javascript +class Range { + constructor(from, to) { + this.from = from; + this.to = to; + } +} +``` + +You could _inject_ a custom serializer to handle values of this type: + +```javascript +qs.stringify( + { + range: new Range(30, 70), + }, + { + filter: (prefix, value) => { + if (value instanceof Range) { + return `${value.from}...${value.to}`; + } + // serialize the usual way + return value; + }, + } +); +// range=30...70 +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +var withNull = qs.stringify({ a: null, b: '' }); +assert.equal(withNull, 'a=&b='); +``` + +Parsing does not distinguish between parameters with and without equal signs. +Both are converted to empty strings. + +```javascript +var equalsInsensitive = qs.parse('a&b='); +assert.deepEqual(equalsInsensitive, { a: '', b: '' }); +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +assert.equal(strictNull, 'a&b='); +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); +assert.deepEqual(parsedStrictNull, { a: null, b: '' }); +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); +assert.equal(nullsSkipped, 'a=b'); +``` + +If you're communicating with legacy systems, you can switch to `iso-8859-1` using the `charset` option: + +```javascript +var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); +assert.equal(iso, '%E6=%E6'); +``` + +Characters that don't exist in `iso-8859-1` will be converted to numeric entities, similar to what browsers do: + +```javascript +var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); +assert.equal(numeric, 'a=%26%239786%3B'); +``` + +You can use the `charsetSentinel` option to announce the character by including an `utf8=✓` parameter with the proper encoding if the checkmark, similar to what Ruby on Rails and others do when submitting forms. + +```javascript +var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); +assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); + +var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); +assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); +``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`, and `iso-8859-1` support is also built in via the `charset` parameter. + +If you wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` + +### RFC 3986 and RFC 1738 space encoding + +RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. +In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. + +``` +assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); +``` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +## qs for enterprise + +Available as part of the Tidelift Subscription + +The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. +Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. +[Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +[package-url]: https://npmjs.org/package/qs +[npm-version-svg]: https://versionbadg.es/ljharb/qs.svg +[deps-svg]: https://david-dm.org/ljharb/qs.svg +[deps-url]: https://david-dm.org/ljharb/qs +[dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/qs.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/qs.svg +[downloads-url]: https://npm-stat.com/charts.html?package=qs +[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/qs/ +[actions-image]: https://img.shields.io/github/check-runs/ljharb/qs/main +[actions-url]: https://github.com/ljharb/qs/actions + +## Acknowledgements + +qs logo by [NUMI](https://github.com/numi-hq/open-design): + +[NUMI Logo](https://numi.tech/?ref=qs) diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/dist/qs.js b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/dist/qs.js new file mode 100644 index 00000000..1419e8d6 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/dist/qs.js @@ -0,0 +1,141 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i-1){if(t.throwOnLimitExceeded)for(var i=0,a=e.indexOf(",");a>-1;){if((i+=1)>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");a=e.indexOf(",",a+1)}return e.split(",")}if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded&&void 0!==a?a+1:a);if(t.throwOnLimitExceeded&&void 0!==a&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(c=isArray(c)?[c]:c),t.comma&&isArray(c)&&c.length>t.arrayLimit&&(c=utils.combine([],c,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded)),null!==d){var f=has.call(r,d);f&&("combine"===t.duplicates||p.indexOf("[]=")>-1)?r[d]=utils.combine(r[d],c,t.arrayLimit,t.plainObjects,t.throwOnLimitExceeded):f&&"last"!==t.duplicates||(r[d]=c)}}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=utils.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{s=r.plainObjects?{__proto__:null}:{};var c="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,p=r.decodeDotInKeys?c.replace(/%2E/g,"."):c,u=parseInt(p,10),y=!isNaN(u)&&d!==p&&String(u)===p&&u>=0&&r.parseArrays;if(r.parseArrays||""!==p)if(y&&u=0?r.slice(0,a):r;if(o){if(!t.plainObjects&&has.call(Object.prototype,o)&&!t.allowPrototypes)return;i[i.length]=o}for(var l=r.length,n=a,s=0;n>=0&&s=0){if(!0===t.strictDepth)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");i[i.length]="["+r.slice(n)+"]"}return i},parseKeys=function parseQueryStringKeys(e,t,r,i){if(e){var a=splitKeyIntoSegments(e,r);if(a)return parseObject(a,t,r,i)}},normalizeParseOptions=function normalizeParseOptions(e){if(!e)return defaults;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?defaults.charset:e.charset,r=void 0===e.duplicates?defaults.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||defaults.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:defaults.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:defaults.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:defaults.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:defaults.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:defaults.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:defaults.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:defaults.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:defaults.decoder,delimiter:"string"==typeof e.delimiter||utils.isRegExp(e.delimiter)?e.delimiter:defaults.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:defaults.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:defaults.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:defaults.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:defaults.strictDepth,strictMerge:"boolean"==typeof e.strictMerge?!!e.strictMerge:defaults.strictMerge,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:defaults.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}};module.exports=function(e,t){var r=normalizeParseOptions(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var i="string"==typeof e?parseValues(e,r):e,a=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),l=0;lg)throw new RangeError("Input depth exceeded depth option of "+g);for(var D=v,A=0,S=!1;void 0!==(D=D.get(sentinel))&&!S;){var E=D.get(e);if(A+=1,void 0!==E){if(E===A)throw new RangeError("Cyclic object value");S=!0}void 0===D.get(sentinel)&&(A=0)}if((b="function"==typeof f?f(r,b):b)instanceof Date?b=y(b):"comma"===t&&isArray(b)&&(b=utils.maybeMap(b,function(e){return e instanceof Date?y(e):e})),null===b){if(a)return p(s&&!m?s(r,defaults.encoder,h,"key",c):r);b=""}if(isNonNullishPrimitive(b)||utils.isBuffer(b))return s?[p(m?r:s(r,defaults.encoder,h,"key",c))+"="+p(s(b,defaults.encoder,h,"value",c))]:[p(r)+"="+p(String(b))];var N,O=[];if(void 0===b)return O;if("comma"===t&&isArray(b))m&&s&&(b=utils.maybeMap(b,function(e){return null==e?e:s(e)})),N=[{value:b.length>0?b.join(",")||null:void 0}];else if(isArray(f))N=f;else{var T=Object.keys(b);N=u?T.sort(u):T}var k=l?String(r).replace(/\./g,"%2E"):String(r),I=o&&isArray(b)&&1===b.length?k+"[]":k;if(n&&isArray(b)&&0===b.length&&0===Object.keys(b).length)return I+"[]";for(var P=0;P0?p+c:""}; + +},{"1":1,"46":46,"5":5}],5:[function(require,module,exports){ +"use strict";var formats=require(1),getSideChannel=require(46),defineProperty=require(14),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,overflowChannel=getSideChannel(),markOverflow=function markOverflow(e,r){return overflowChannel.set(e,r),e},isOverflow=function isOverflow(e){return overflowChannel.has(e)},getMaxIndex=function getMaxIndex(e){return overflowChannel.get(e)},setMaxIndex=function setMaxIndex(e,r){overflowChannel.set(e,r)},hexTable=function(){for(var e=[],r=0;r<256;++r)e[e.length]="%"+((r<16?"0":"")+r.toString(16)).toUpperCase();return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var n=[],a=0;a=t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return markOverflow(arrayToObject(e.concat(r),t),n)}e[n]=r}else{if(!e||"object"!=typeof e)return[e,r];if(isOverflow(e)){var a=getMaxIndex(e)+1;e[a]=r,setMaxIndex(e,a)}else{if(t&&t.strictMerge)return[e,r];(t&&(t.plainObjects||t.allowPrototypes)||!has.call(Object.prototype,r))&&(e[r]=!0)}}return e}if(!e||"object"!=typeof e){if(isOverflow(r)){for(var o=Object.keys(r),i=t&&t.plainObjects?{__proto__:null,0:e}:{0:e},l=0;lt.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return markOverflow(arrayToObject(c,t),c.length-1)}return c}var f=e;if(isArray(e)&&!isArray(r)&&(f=arrayToObject(e,t)),isArray(e)&&isArray(r)){if(r.forEach(function(r,n){if(has.call(e,n)){var a=e[n];a&&"object"==typeof a&&r&&"object"==typeof r?e[n]=merge(a,r,t):e[e.length]=r}else e[n]=r}),t&&"number"==typeof t.arrayLimit&&e.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return markOverflow(arrayToObject(e,t),e.length-1)}return e}return Object.keys(r).reduce(function(e,n){var a=r[n];if(has.call(e,n)?setProperty(e,n,merge(e[n],a,t)):setProperty(e,n,a),isOverflow(r)&&!isOverflow(e)&&markOverflow(e,getMaxIndex(r)),isOverflow(e)){var o=parseInt(n,10);String(o)===n&&o>=0&&o>getMaxIndex(e)&&setMaxIndex(e,o)}return e},f)},assign=function assignSingleSource(e,r){return Object.keys(r).reduce(function(e,t){return setProperty(e,t,r[t]),e},e)},decode=function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},limit=1024,encode=function encode(e,r,t,n,a){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===t)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",l=0;l=limit?o.slice(l,l+limit):o;if(l+limit=55296&&f<=56319&&(c=c.slice(0,-1),l-=1)}for(var s=[],u=0;u=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||a===formats.RFC1738&&(40===y||41===y)?s[s.length]=c.charAt(u):y<128?s[s.length]=hexTable[y]:y<2048?s[s.length]=hexTable[192|y>>6]+hexTable[128|63&y]:y<55296||y>=57344?s[s.length]=hexTable[224|y>>12]+hexTable[128|y>>6&63]+hexTable[128|63&y]:(u+=1,y=65536+((1023&y)<<10|1023&c.charCodeAt(u)),s[s.length]=hexTable[240|y>>18]+hexTable[128|y>>12&63]+hexTable[128|y>>6&63]+hexTable[128|63&y])}i+=s.join("")}return i},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=getSideChannel(),n=0;nt){if(a)throw new RangeError("Array limit exceeded. Only "+t+" element"+(1===t?"":"s")+" allowed in an array.");return markOverflow(arrayToObject(c,{plainObjects:n}),c.length-1)}return c},maybeMap=function maybeMap(e,r){if(isArray(e)){for(var t=[],n=0;n-1?callBindBasic([t]):t}; + +},{"10":10,"25":25}],25:[function(require,module,exports){ +"use strict";var undefined,$Object=require(22),$Error=require(16),$EvalError=require(15),$RangeError=require(17),$ReferenceError=require(18),$SyntaxError=require(19),$TypeError=require(20),$URIError=require(21),abs=require(34),floor=require(35),max=require(37),min=require(38),pow=require(39),round=require(40),sign=require(41),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=require(30),$defineProperty=require(14),throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(31)(),getProto=require(28),$ObjectGPO=require(26),$ReflectGPO=require(27),$apply=require(8),$call=require(9),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float16Array%":"undefined"==typeof Float16Array?undefined:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round,"%Math.sign%":sign,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(24),hasOwn=require(33),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r}),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,i=n.value,y=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var d=1,s=!0;d=t.length){var c=$gOPD(i,f);i=(s=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:i[f]}else s=hasOwn(i,f),i=i[f];s&&!y&&(INTRINSICS[a]=i)}}return i}; + +},{"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"24":24,"26":26,"27":27,"28":28,"30":30,"31":31,"33":33,"34":34,"35":35,"37":37,"38":38,"39":39,"40":40,"41":41,"8":8,"9":9}],13:[function(require,module,exports){ +"use strict";var hasProtoAccessor,callBind=require(10),gOPD=require(30);try{hasProtoAccessor=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,"__proto__"),$Object=Object,$getPrototypeOf=$Object.getPrototypeOf;module.exports=desc&&"function"==typeof desc.get?callBind([desc.get]):"function"==typeof $getPrototypeOf&&function getDunder(t){return $getPrototypeOf(null==t?t:$Object(t))}; + +},{"10":10,"30":30}],30:[function(require,module,exports){ +"use strict";var $gOPD=require(29);if($gOPD)try{$gOPD([],"length")}catch(g){$gOPD=null}module.exports=$gOPD; + +},{"29":29}],15:[function(require,module,exports){ +"use strict";module.exports=EvalError; + +},{}],16:[function(require,module,exports){ +"use strict";module.exports=Error; + +},{}],17:[function(require,module,exports){ +"use strict";module.exports=RangeError; + +},{}],18:[function(require,module,exports){ +"use strict";module.exports=ReferenceError; + +},{}],19:[function(require,module,exports){ +"use strict";module.exports=SyntaxError; + +},{}],21:[function(require,module,exports){ +"use strict";module.exports=URIError; + +},{}],22:[function(require,module,exports){ +"use strict";module.exports=Object; + +},{}],23:[function(require,module,exports){ +"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function wrapQuotes(t,e,r){var n=r.quoteStyle||e,o=quotes[n];return o+t+o}function quote(t){return $replace.call(String(t),/"/g,""")}function canTrustToString(t){return!toStringTag||!("object"==typeof t&&(toStringTag in t||void 0!==t[toStringTag]))}function isArray(t){return"[object Array]"===toStr(t)&&canTrustToString(t)}function isDate(t){return"[object Date]"===toStr(t)&&canTrustToString(t)}function isRegExp(t){return"[object RegExp]"===toStr(t)&&canTrustToString(t)}function isError(t){return"[object Error]"===toStr(t)&&canTrustToString(t)}function isString(t){return"[object String]"===toStr(t)&&canTrustToString(t)}function isNumber(t){return"[object Number]"===toStr(t)&&canTrustToString(t)}function isBoolean(t){return"[object Boolean]"===toStr(t)&&canTrustToString(t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&!has(quotes,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var u=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=u&&u>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var p=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var s=nameOf(t),f=arrObjKeys(t,inspect);return"[Function"+(s?": "+s:" (anonymous)")+"]"+(f.length>0?" { "+$join.call(f,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],m=0;m"}if(isArray(t)){if(0===t.length)return"[]";var b=arrObjKeys(t,inspect);return p&&!singleLineValues(b)?"["+indentedJoin(b,p)+"]":"[ "+$join.call(b,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:u-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))}),collectionOf("Map",mapSize.call(t),d,p)}if(isSet(t)){var O=[];return setForEach&&setForEach.call(t,function(e){O.push(inspect(e,t))}),collectionOf("Set",setSize.call(t),O,p)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var j=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",v=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",k=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(v||$?"["+$join.call($concat.call([],v||[],$||[]),": ")+"] ":"");return 0===j.length?k+"{}":p?k+"{"+indentedJoin(j,p)+"}":k+"{ "+$join.call(j,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}var o=quoteREs[e.quoteStyle||"single"];return o.lastIndex=0,wrapQuotes($replace.call($replace.call(t,o,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o -1) { + if (options.throwOnLimitExceeded) { + var commaCount = 0; + var commaIndex = val.indexOf(','); + while (commaIndex > -1) { + commaCount += 1; + if (commaCount >= options.arrayLimit) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + commaIndex = val.indexOf(',', commaIndex + 1); + } + } + return val.split(','); + } + + if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + + return val; +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = { __proto__: null }; + + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + + var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit; + var parts = cleanStr.split( + options.delimiter, + options.throwOnLimitExceeded && typeof limit !== 'undefined' ? limit + 1 : limit + ); + + if (options.throwOnLimitExceeded && typeof limit !== 'undefined' && parts.length > limit) { + throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); + } + + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key; + var val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + + if (key !== null) { + val = utils.maybeMap( + parseArrayValue( + part.slice(pos + 1), + options, + isArray(obj[key]) ? obj[key].length : 0 + ), + function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + } + ); + } + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(String(val)); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + if (options.comma && isArray(val) && val.length > options.arrayLimit) { + val = utils.combine([], val, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded); + } + + if (key !== null) { + var existing = has.call(obj, key); + if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) { + obj[key] = utils.combine( + obj[key], + val, + options.arrayLimit, + options.plainObjects, + options.throwOnLimitExceeded + ); + } else if (!existing || options.duplicates === 'last') { + obj[key] = val; + } + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var currentArrayLength = 0; + if (chain.length > 0 && chain[chain.length - 1] === '[]') { + var parentKey = chain.slice(0, -1).join(''); + currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; + } + + var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + if (utils.isOverflow(leaf)) { + // leaf is already an overflow object, preserve it + obj = leaf; + } else { + obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) + ? [] + : utils.combine( + [], + leaf, + options.arrayLimit, + options.plainObjects, + options.throwOnLimitExceeded + ); + } + } else { + obj = options.plainObjects ? { __proto__: null } : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + var isValidArrayIndex = !isNaN(index) + && root !== decodedRoot + && String(index) === decodedRoot + && index >= 0 + && options.parseArrays; + if (!options.parseArrays && decodedRoot === '') { + obj = { 0: leaf }; + } else if (isValidArrayIndex && index < options.arrayLimit) { + obj = []; + obj[index] = leaf; + } else if (isValidArrayIndex && options.throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } else if (isValidArrayIndex) { + obj[index] = leaf; + utils.markOverflow(obj, index); + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +// Split a key like "a[b][c[]]" into ['a', '[b]', '[c[]]'] while preserving +// qs parse semantics for depth/prototype guards. +var splitKeyIntoSegments = function splitKeyIntoSegments(originalKey, options) { + var key = options.allowDots ? originalKey.replace(/\.([^.[]+)/g, '[$1]') : originalKey; + + // depth <= 0 keeps the whole key as one segment + if (options.depth <= 0) { + if (!options.plainObjects && has.call(Object.prototype, key)) { + if (!options.allowPrototypes) { + return; + } + } + + return [key]; + } + + var segments = []; + + // parent before the first '[' (may be empty if key starts with '[') + var first = key.indexOf('['); + var parent = first >= 0 ? key.slice(0, first) : key; + if (parent) { + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + segments[segments.length] = parent; + } + + var n = key.length; + var open = first; + var collected = 0; + + while (open >= 0 && collected < options.depth) { + var level = 1; + var i = open + 1; + var close = -1; + + // balance nested '[' and ']' inside this bracket group using a nesting level counter + while (i < n && close < 0) { + var cu = key.charCodeAt(i); + if (cu === 0x5B) { // '[' + level += 1; + } else if (cu === 0x5D) { // ']' + level -= 1; + if (level === 0) { + close = i; // found matching close; loop will exit by condition + } + } + i += 1; + } + + if (close < 0) { + // Unterminated group: wrap the raw remainder in one bracket pair so it stays + // a single literal segment (e.g. "[[]b" -> "[[]b]"); we do not infer missing ']'. + segments[segments.length] = '[' + key.slice(open) + ']'; + return segments; + } + + var seg = key.slice(open, close + 1); + // prototype guard for the content of this group + var content = seg.slice(1, -1); + if (!options.plainObjects && has.call(Object.prototype, content) && !options.allowPrototypes) { + return; + } + + segments[segments.length] = seg; + collected += 1; + + // find the next '[' after this balanced group + open = key.indexOf('[', close + 1); + } + + if (open >= 0) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } + + segments[segments.length] = '[' + key.slice(open) + ']'; + } + + return segments; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + + var keys = splitKeyIntoSegments(givenKey, options); + + if (!keys) { + return; + } + + return parseObject(keys, val, options, valuesParsed); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { + throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); + } + + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, + strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, + throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? { __proto__: null } : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? { __proto__: null } : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + + if (options.allowSparse === true) { + return obj; + } + + return utils.compact(obj); +}; diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/stringify.js b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/stringify.js new file mode 100644 index 00000000..b55858a1 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/stringify.js @@ -0,0 +1,378 @@ +'use strict'; + +var getSideChannel = require('side-channel'); +var utils = require('./utils'); +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; + +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + commaRoundTrip: false, + delimiter: '&', + depth: Infinity, + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + filter: void undefined, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; + +var sentinel = {}; + +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + sideChannel, + depth, + currentDepth +) { + var obj = object; + + if (currentDepth > depth) { + throw new RangeError('Input depth exceeded depth option of ' + depth); + } + + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + // Where object last appeared in the ref tree + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; // Break while + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + + obj = typeof filter === 'function' ? filter(prefix, obj) : obj; + + if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return formatter(encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix); + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (generateArrayPrefix === 'comma' && isArray(obj)) { + // we need to join elements in + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, function (v) { + return v == null ? v : encoder(v); + }); + } + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + + if (allowEmptyArrays && isArray(obj) && obj.length === 0 && Object.keys(obj).length === 0) { + return adjustedPrefix + '[]'; + } + + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && key && typeof key.value !== 'undefined' + ? key.value + : obj[key]; + + if (skipNulls && value === null) { + continue; + } + + var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); + var keyPrefix = isArray(obj) + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); + + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel, + depth, + currentDepth + 1 + )); + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + depth: typeof opts.depth === 'number' ? opts.depth : defaults.depth, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (typeof key === 'undefined' || key === null) { + continue; + } + + var value = obj[key]; + + if (options.skipNulls && value === null) { + continue; + } + + var encodedKey = options.encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); + + pushToArray(keys, stringify( + value, + encodedKey, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel, + options.depth, + 0 + )); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B' + options.delimiter; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93' + options.delimiter; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/utils.js b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/utils.js new file mode 100644 index 00000000..ce82e223 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/lib/utils.js @@ -0,0 +1,388 @@ +'use strict'; + +var formats = require('./formats'); +var getSideChannel = require('side-channel'); +var defineProperty = require('es-define-property'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +// Track objects created from arrayLimit overflow using side-channel +// Stores the current max numeric index for O(1) lookup +var overflowChannel = getSideChannel(); + +var markOverflow = function markOverflow(obj, maxIndex) { + overflowChannel.set(obj, maxIndex); + return obj; +}; + +var isOverflow = function isOverflow(obj) { + return overflowChannel.has(obj); +}; + +var getMaxIndex = function getMaxIndex(obj) { + return overflowChannel.get(obj); +}; + +var setMaxIndex = function setMaxIndex(obj, maxIndex) { + overflowChannel.set(obj, maxIndex); +}; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); + } + + return array; +}()); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted[compacted.length] = obj[j]; + } + } + + item.obj[item.prop] = compacted; + } + } +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? { __proto__: null } : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +var setProperty = function setProperty(obj, key, value) { + if (key === '__proto__' && defineProperty) { + defineProperty(obj, key, { + configurable: true, + enumerable: true, + value: value, + writable: true + }); + } else { + obj[key] = value; + } +}; + +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; + } + + if (typeof source !== 'object' && typeof source !== 'function') { + if (isArray(target)) { + var nextIndex = target.length; + if (options && typeof options.arrayLimit === 'number' && nextIndex >= options.arrayLimit) { + if (options.throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + return markOverflow(arrayToObject(target.concat(source), options), nextIndex); + } + target[nextIndex] = source; + } else if (target && typeof target === 'object') { + if (isOverflow(target)) { + // Add at next numeric index for overflow objects + var newIndex = getMaxIndex(target) + 1; + target[newIndex] = source; + setMaxIndex(target, newIndex); + } else if (options && options.strictMerge) { + return [target, source]; + } else if ( + (options && (options.plainObjects || options.allowPrototypes)) + || !has.call(Object.prototype, source) + ) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + if (isOverflow(source)) { + // Create new object with target at 0, source values shifted by 1 + var sourceKeys = Object.keys(source); + var result = options && options.plainObjects + ? { __proto__: null, 0: target } + : { 0: target }; + for (var m = 0; m < sourceKeys.length; m++) { + var oldKey = parseInt(sourceKeys[m], 10); + result[oldKey + 1] = source[sourceKeys[m]]; + } + return markOverflow(result, getMaxIndex(source) + 1); + } + var combined = [target].concat(source); + if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) { + if (options.throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + return markOverflow(arrayToObject(combined, options), combined.length - 1); + } + return combined; + } + + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target[target.length] = item; + } + } else { + target[i] = item; + } + }); + if (options && typeof options.arrayLimit === 'number' && target.length > options.arrayLimit) { + if (options.throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + return markOverflow(arrayToObject(target, options), target.length - 1); + } + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (has.call(acc, key)) { + setProperty(acc, key, merge(acc[key], value, options)); + } else { + setProperty(acc, key, value); + } + + if (isOverflow(source) && !isOverflow(acc)) { + markOverflow(acc, getMaxIndex(source)); + } + if (isOverflow(acc)) { + var keyNum = parseInt(key, 10); + if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) { + setMaxIndex(acc, keyNum); + } + } + + return acc; + }, mergeTarget); +}; + +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + setProperty(acc, key, source[key]); + return acc; + }, target); +}; + +var decode = function (str, defaultDecoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; + +var limit = 1024; + +/* eslint operator-linebreak: [2, "before"] */ + +var encode = function encode(str, defaultEncoder, charset, kind, format) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + var out = ''; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + if (j + limit < string.length) { + var last = segment.charCodeAt(segment.length - 1); + if (last >= 0xD800 && last <= 0xDBFF) { + segment = segment.slice(0, -1); + j -= 1; + } + } + var arr = []; + + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; + } + + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } + + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | (c >> 6)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); + + arr[arr.length] = hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } + + out += arr.join(''); + } + + return out; +}; + +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = getSideChannel(); + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && !refs.has(val)) { + queue[queue.length] = { obj: obj, prop: key }; + refs.set(val, true); + } + } + } + + compactQueue(queue); + + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b, arrayLimit, plainObjects, throwOnLimitExceeded) { + // If 'a' is already an overflow object, add to it + if (isOverflow(a)) { + if (throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + arrayLimit + ' element' + (arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + // spread `b` one level, matching the `[].concat(a, b)` used below, so a + // collection appended to an already-overflowed object is flattened + // rather than nested under a single index + var bValues = isArray(b) ? b : [b]; + var newIndex = getMaxIndex(a); + for (var i = 0; i < bValues.length; ++i) { + newIndex += 1; + a[newIndex] = bValues[i]; + } + setMaxIndex(a, newIndex); + return a; + } + + var result = [].concat(a, b); + if (result.length > arrayLimit) { + if (throwOnLimitExceeded) { + throw new RangeError('Array limit exceeded. Only ' + arrayLimit + ' element' + (arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1); + } + return result; +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped[mapped.length] = fn(val[i]); + } + return mapped; + } + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isOverflow: isOverflow, + isRegExp: isRegExp, + markOverflow: markOverflow, + maybeMap: maybeMap, + merge: merge +}; diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/package.json b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/package.json new file mode 100644 index 00000000..bb56dbbc --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/package.json @@ -0,0 +1,95 @@ +{ + "name": "qs", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/ljharb/qs", + "version": "6.16.0", + "repository": { + "type": "git", + "url": "https://github.com/ljharb/qs.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "lib/index.js", + "sideEffects": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "keywords": [ + "querystring", + "qs", + "query", + "url", + "parse", + "stringify" + ], + "engines": { + "node": ">=0.6" + }, + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "devDependencies": { + "@browserify/envify": "^6.0.0", + "@browserify/uglifyify": "^6.0.0", + "@ljharb/eslint-config": "^22.2.4", + "browserify": "^16.5.2", + "bundle-collapser": "^1.4.0", + "common-shakeify": "~1.0.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.7.1", + "eslint": "^10.9.0", + "evalmd": "^0.0.22", + "for-each": "^0.3.5", + "glob": "=10.3.7", + "has-bigints": "^1.1.0", + "has-override-mistake": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "iconv-lite": "^0.5.2", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "jiti": "^0.0.0", + "mkdirp": "^0.5.5", + "mock-property": "^1.1.2", + "module-deps": "^6.2.3", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "object-inspect": "^1.13.4", + "qs-iconv": "^1.0.4", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "tape": "^5.10.2", + "unassertify": "^3.0.1" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent readme && npm run --silent lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "readme": "evalmd README.md", + "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint .", + "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" + }, + "license": "BSD-3-Clause", + "publishConfig": { + "ignore": [ + "!dist/*", + "bower.json", + "component.json", + ".github/workflows", + "logos", + "tea.yaml" + ] + } +} diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/empty-keys-cases.js b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/empty-keys-cases.js new file mode 100644 index 00000000..2b1190ef --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/empty-keys-cases.js @@ -0,0 +1,267 @@ +'use strict'; + +module.exports = { + emptyTestCases: [ + { + input: '&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&=', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=&', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '=', + withEmptyKeys: { '': '' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + } + }, + { + input: '=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&&&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&=&=&', + withEmptyKeys: { '': ['', '', ''] }, + stringifyOutput: { + brackets: '[]=&[]=&[]=', + indices: '[0]=&[1]=&[2]=', + repeat: '=&=&=' + }, + noEmptyKeys: {} + }, + { + input: '=&a[]=b&a[1]=c', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '=a', + withEmptyKeys: { '': 'a' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=a', + indices: '=a', + repeat: '=a' + } + }, + { + input: 'a==a', + withEmptyKeys: { a: '=a' }, + noEmptyKeys: { a: '=a' }, + stringifyOutput: { + brackets: 'a==a', + indices: 'a==a', + repeat: 'a==a' + } + }, + { + input: '=&a[]=b', + withEmptyKeys: { '': '', a: ['b'] }, + stringifyOutput: { + brackets: '=&a[]=b', + indices: '=&a[0]=b', + repeat: '=&a=b' + }, + noEmptyKeys: { a: ['b'] } + }, + { + input: '=&a[]=b&a[]=c&a[2]=d', + withEmptyKeys: { '': '', a: ['b', 'c', 'd'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c&a[]=d', + indices: '=&a[0]=b&a[1]=c&a[2]=d', + repeat: '=&a=b&a=c&a=d' + }, + noEmptyKeys: { a: ['b', 'c', 'd'] } + }, + { + input: '=a&=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: {} + }, + { + input: '=a&foo=b', + withEmptyKeys: { '': 'a', foo: 'b' }, + noEmptyKeys: { foo: 'b' }, + stringifyOutput: { + brackets: '=a&foo=b', + indices: '=a&foo=b', + repeat: '=a&foo=b' + } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[0]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[0]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '[]=a&[]=b& []=1', + withEmptyKeys: { '': ['a', 'b'], ' ': ['1'] }, + stringifyOutput: { + brackets: '[]=a&[]=b& []=1', + indices: '[0]=a&[1]=b& [0]=1', + repeat: '=a&=b& =1' + }, + noEmptyKeys: { 0: 'a', 1: 'b', ' ': ['1'] } + }, + { + input: '[0]=a&[1]=b&a[0]=1&a[1]=2', + withEmptyKeys: { '': ['a', 'b'], a: ['1', '2'] }, + noEmptyKeys: { 0: 'a', 1: 'b', a: ['1', '2'] }, + stringifyOutput: { + brackets: '[]=a&[]=b&a[]=1&a[]=2', + indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', + repeat: '=a&=b&a=1&a=2' + } + }, + { + input: '[deep]=a&[deep]=2', + withEmptyKeys: { '': { deep: ['a', '2'] } + }, + stringifyOutput: { + brackets: '[deep][]=a&[deep][]=2', + indices: '[deep][0]=a&[deep][1]=2', + repeat: '[deep]=a&[deep]=2' + }, + noEmptyKeys: { deep: ['a', '2'] } + }, + { + input: '%5B0%5D=a&%5B1%5D=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: { 0: 'a', 1: 'b' } + } + ] +}; diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/parse.js b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/parse.js new file mode 100644 index 00000000..b5f02619 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/parse.js @@ -0,0 +1,2122 @@ +'use strict'; + +var test = require('tape'); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iconv = require('iconv-lite'); +var mockProperty = require('mock-property'); +var hasOverrideMistake = require('has-override-mistake')(); +var SaferBuffer = require('safer-buffer').Buffer; +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); + +var qs = require('../'); +var utils = require('../lib/utils'); + +var characterizeParse = function characterizeParse(st, input, opts, expected, label) { + var result; + st.doesNotThrow(function () { result = qs.parse(input, opts); }, label + ': does not throw'); + st.deepEqual(result, expected, label + ': parses to the current lenient output'); +}; + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + st.end(); + }); + + t.test('comma: false', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); + st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('comma: true', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + + st.end(); + }); + + t.test('decode dot keys correctly', function (st) { + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { name: { obj: { first: 'John', last: 'Doe' } } }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { 'name%2Eobj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), + { 'name.obj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: false, decodeDotInKeys: false } + ), + { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + { allowDots: true, decodeDotInKeys: false } + ), + { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: true, decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots and decodeDotInKeys undefined' + ); + + st.end(); + }); + + t.test('decodes dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots undefined and decodeDotInKeys true' + ); + + st.end(); + }); + + t.test('throws when decodeDotInKeys is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allows empty arrays in obj values', function (st) { + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); + + st.end(); + }); + + t.test('throws when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.deepEqual( + qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), + { testEmptyArray: [] } + ); + + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); + + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); + }); + + t.test('uses original key when depth = 0', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.deepEqual(qs.parse('a.b=c', { depth: 0, allowDots: true }), { 'a[b]': 'c' }, 'normalizes dots before applying depth-0 behavior'); + st.deepEqual(qs.parse('toString=foo', { depth: 0 }), {}, 'respects prototype guard at depth 0'); + st.deepEqual(qs.parse('toString=foo', { depth: 0, allowPrototypes: true }), { toString: 'foo' }, 'allows prototypes at depth 0 when enabled'); + st.end(); + }); + + t.test('ignores prototype keys when depth = 0 and allowPrototypes is false', function (st) { + st.deepEqual(qs.parse('toString=foo', { depth: 0 }), {}); + st.deepEqual(qs.parse('hasOwnProperty=bar', { depth: 0 }), {}); + st.deepEqual(qs.parse('toString=foo&a=b', { depth: 0 }), { a: 'b' }); + st.end(); + }); + + t.test('allows prototype keys when depth = 0 and allowPrototypes is true', function (st) { + st.deepEqual(qs.parse('toString=foo', { depth: 0, allowPrototypes: true }), { toString: 'foo' }); + st.end(); + }); + + t.test('uses original key when depth = false', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); + + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); + }); + + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + + st.end(); + }); + + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); + }); + + t.test('parses keys with literal [] inside a bracket group (#493)', function (st) { + // A bracket pair inside a bracket group should be treated literally as part of the key + st.deepEqual( + qs.parse('search[withbracket[]]=foobar'), + { search: { 'withbracket[]': 'foobar' } }, + 'treats inner [] literally when inside a bracket group' + ); + + // Single-level variant + st.deepEqual( + qs.parse('a[b[]]=c'), + { a: { 'b[]': 'c' } }, + 'keeps "b[]" as a literal key' + ); + + // Nested with an array push on the outer level + st.deepEqual( + qs.parse('list[][x[]]=y'), + { list: [{ 'x[]': 'y' }] }, + 'preserves inner [] while still treating outer [] as array push' + ); + + // Multiple nested bracket pairs: inner [] remains literal as part of the key + st.deepEqual( + qs.parse('a[b[c[]]]=d'), + { a: { 'b[c[]]': 'd' } }, + 'treats "b[c[]]" as a literal key inside the bracket group' + ); + + // Depth limits with literal brackets: preserve inner [] while limiting bracket-group parsing + st.deepEqual( + qs.parse('a[b[c[]]][d]=e', { depth: 1 }), + { a: { 'b[c[]]': { '[d]': 'e' } } }, + 'respects depth: 1 and preserves literal inner [] in the parsed key' + ); + + // Unterminated inner bracket group is wrapped as a literal remainder segment + st.deepEqual( + qs.parse('a[[]b=c'), + { a: { '[[]b': 'c' } }, + 'handles unterminated inner bracket groups without throwing' + ); + + st.end(); + }); + + t.test('currently parses unbalanced bracket keys after a parent leniently to literal segments (issue #558)', function (st) { + characterizeParse(st, 'a[bc=v', undefined, { a: { '[bc': 'v' } }, 'unclosed group after a parent'); + characterizeParse(st, 'a[=v', undefined, { a: { '[': 'v' } }, 'bare unclosed bracket after a parent'); + characterizeParse(st, 'a[b][c=v', undefined, { a: { b: { '[c': 'v' } } }, 'unclosed group after a valid one'); + characterizeParse(st, 'a[b]c[d=v', undefined, { a: { b: { '[d': 'v' } } }, 'unclosed group after text following a valid one'); + characterizeParse(st, 'filters[customtags:Env: Prod=v', undefined, { filters: { '[customtags:Env: Prod': 'v' } }, 'the issue #558 reproduction'); + characterizeParse(st, '][a=v', undefined, { ']': { '[a': 'v' } }, 'stray close bracket before an unclosed group'); + characterizeParse(st, 'a][b=v', undefined, { 'a]': { '[b': 'v' } }, 'stray close bracket inside the parent'); + st.end(); + }); + + t.test('currently parses unbalanced bracket keys containing inner brackets leniently (issue #558)', function (st) { + characterizeParse(st, 'a[b[c=v', undefined, { a: { '[b[c': 'v' } }, 'unclosed group containing an inner bracket'); + characterizeParse(st, 'a[b[c]=v', undefined, { a: { '[b[c]': 'v' } }, 'unbalanced group with an inner bracket and one close'); + characterizeParse(st, 'a[b][c[d=v', undefined, { a: { b: { '[c[d': 'v' } } }, 'unclosed inner-bracket group after a valid one'); + st.end(); + }); + + t.test('currently parses bracket-prefixed unbalanced keys leniently (issue #558)', function (st) { + characterizeParse(st, '[abc=v', undefined, { '[abc': 'v' }, 'key starting with an unclosed bracket'); + characterizeParse(st, '[[]b=v', undefined, { '[[]b': 'v' }, 'key starting with an unbalanced bracket group'); + st.end(); + }); + + t.test('lenient unbalanced-bracket handling currently depends on the depth option (issue #558)', function (st) { + characterizeParse(st, 'a[b]c[d]e[f=v', { depth: 5 }, { a: { b: { d: { '[f': 'v' } } } }, 'consumes groups up to the depth budget then keeps the unclosed remainder literal'); + characterizeParse(st, 'a[b]c[d]e[f=v', { depth: 1 }, { a: { b: { '[d]e[f': 'v' } } }, 'a lower depth keeps more of the unclosed remainder literal'); + characterizeParse(st, 'a[bc=v', { depth: 0 }, { 'a[bc': 'v' }, 'depth 0 keeps the entire key literal'); + st.end(); + }); + + t.test('currently parses an allowDots key with a trailing unclosed bracket leniently (issue #558)', function (st) { + characterizeParse(st, 'a.b[c=v', { allowDots: true }, { a: { b: { '[c': 'v' } } }, 'allowDots expands the dot then keeps the unclosed bracket literal'); + st.end(); + }); + + t.test('valid and stray-close bracket keys are unaffected by unbalanced-bracket handling', function (st) { + characterizeParse(st, 'a]b=v', undefined, { 'a]b': 'v' }, 'stray close bracket with no open bracket stays a flat key'); + characterizeParse(st, 'a[b]extra=v', undefined, { a: { b: 'v' } }, 'text after a balanced group is ignored'); + st.end(); + }); + + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); + }); + + t.test('limits specific array indices to arrayLimit', function (st) { + st.deepEqual(qs.parse('a[19]=a', { arrayLimit: 20 }), { a: ['a'] }); + st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: { 20: 'a' } }); + + st.deepEqual(qs.parse('a[19]=a'), { a: ['a'] }); + st.deepEqual(qs.parse('a[20]=a'), { a: { 20: 'a' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); + + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); + }); + + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); + }); + + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); + }); + + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); + }); + + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); + st.end(); + }); + + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); + }); + + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); + st.end(); + }); + + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); + }); + + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); + st.end(); + }); + + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); + }); + + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); + }); + + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: { 0: 'b', 1: null, 2: 'c', 3: '' } }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: { 0: 'b', 1: '', 2: 'c', 3: null } }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); + st.end(); + }); + + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); + st.end(); + }); + + t.test('parses sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); + st.end(); + }); + + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); + }); + + t.test('parses buffers correctly', function (st) { + var b = SaferBuffer.from('test'); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); + }); + + t.test('parses jquery-param strings', function (st) { + // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' + var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; + var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; + st.deepEqual(qs.parse(encoded), expected); + st.end(); + }); + + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); + }); + + t.test('does not error when parsing a very long array', function (st) { + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str = str + '&' + str; + } + + st.doesNotThrow(function () { + qs.parse(str); + }); + + st.end(); + }); + + t.test('does not throw when a native prototype has an enumerable property', function (st) { + st.intercept(Object.prototype, 'crash', { value: '' }); + st.intercept(Array.prototype, 'crash', { value: '' }); + + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + + st.end(); + }); + + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); + }); + + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: { 0: 'b' } }); + + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); + + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + + st.end(); + }); + + t.test('allows disabling array parsing', function (st) { + var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); + st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); + st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); + + var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); + st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); + st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); + + st.end(); + }); + + t.test('allows for query string prefix', function (st) { + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); + + st.end(); + }); + + t.test('parses an object', function (st) { + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses string with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); + st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); + st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); + + // test cases inversed from from stringify tests + st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] }); + + st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] }); + + st.end(); + }); + + t.test('parses values with comma as array divider', function (st) { + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); + st.end(); + }); + + t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (!isNaN(Number(str))) { + return parseFloat(str); + } + return defaultDecoder(str, defaultDecoder, charset, type); + }; + + st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); + st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); + + st.end(); + }); + + t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { + st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); + st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); + st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); + + st.end(); + }); + + t.test('parses an object in dot notation', function (st) { + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input, { allowDots: true }); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object and not child values', function (st) { + var input = { + 'user[name]': { 'pop[bob]': { test: 3 } }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': { test: 3 } }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.parse('a=b&c=d'); + + restore(); + + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); + }); + + t.test('does not crash on multi-step circular references', function (st) { + var a = {}; + a.b = { c: { d: a } }; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ foo: a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal(parsed.foo.b.c.d, parsed.foo, 'the multi-step cycle is preserved'); + st.end(); + }); + + t.test('does not crash when parsing deep objects', function (st) { + var parsed; + var str = 'foo'; + + for (var i = 0; i < 5000; i++) { + str += '[p]'; + } + + str += '=bar'; + + st.doesNotThrow(function () { + parsed = qs.parse(str, { depth: 5000 }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + + var depth = 0; + var ref = parsed.foo; + while ((ref = ref.p)) { + depth += 1; + } + + st.equal(depth, 5000, 'parsed is 5000 properties deep'); + + st.end(); + }); + + t.test('parses null objects correctly', { skip: !hasProto }, function (st) { + var a = { __proto__: null, b: 'c' }; + + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); + }); + + t.test('parses dates correctly', function (st) { + var now = new Date(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); + }); + + t.test('parses regular expressions correctly', function (st) { + var re = /^test$/; + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); + }); + + t.test('does not allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: false }), + {}, + 'bare "toString" results in {}' + ); + + st.end(); + }); + + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: true }), + { toString: '' }, + 'bare "toString" results in { toString: "" }' + ); + + st.end(); + }); + + t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { + // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it + // can't be unfrozen. Instead, we add a new non-writable property to simulate this. + st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); + + st['throws']( + function () { + var obj = {}; + obj.frozenProp = 'bar'; + }, + // node < 6 has a different error message + /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, + 'regular assignment of an inherited non-writable property throws' + ); + + var parsed; + st.doesNotThrow( + function () { + parsed = qs.parse('frozenProp', { allowPrototypes: false }); + }, + 'parsing a nonwritable Object.prototype property does not throw' + ); + + st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); + + st.end(); + }); + + t.test('params starting with a closing bracket', function (st) { + st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); + st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); + st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); + st.end(); + }); + + t.test('params starting with a starting bracket', function (st) { + st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); + st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); + st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); + st.end(); + }); + + t.test('add keys to objects', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d', { strictMerge: false }), + { a: { b: 'c', d: true } }, + 'can add keys to objects' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { strictMerge: false }), + { a: { b: 'c' } }, + 'can not overwrite prototype' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { strictMerge: false, allowPrototypes: true }), + { a: { b: 'c', toString: true } }, + 'can overwrite prototype with allowPrototypes true' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { strictMerge: false, plainObjects: true }), + { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, + 'can overwrite prototype with plainObjects true' + ); + + st.end(); + }); + + t.test('strictMerge wraps object and primitive into an array', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d'), + { a: [{ b: 'c' }, 'd'] }, + 'object then primitive produces array' + ); + + st.deepEqual( + qs.parse('a=d&a[b]=c'), + { a: ['d', { b: 'c' }] }, + 'primitive then object produces array' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString'), + { a: [{ b: 'c' }, 'toString'] }, + 'prototype-colliding value is preserved in array' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { plainObjects: true }), + { __proto__: null, a: [{ __proto__: null, b: 'c' }, 'toString'] }, + 'plainObjects preserved in array wrapping' + ); + + st.end(); + }); + + t.test('dunder proto is ignored', function (st) { + var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42'; + var result = qs.parse(payload, { allowPrototypes: true }); + + st.deepEqual( + result, + { + categories: { + length: '42' + } + }, + 'silent [[Prototype]] payload' + ); + + var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true }); + + st.deepEqual( + plainResult, + { + __proto__: null, + categories: { + __proto__: null, + length: '42' + } + }, + 'silent [[Prototype]] payload: plain objects' + ); + + var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true }); + + st.notOk(Array.isArray(query.categories), 'is not an array'); + st.notOk(query.categories instanceof Array, 'is not instanceof an array'); + st.deepEqual(query.categories, { some: { json: 'toInject' } }); + st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array'); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }), + { + foo: { + bar: 'stuffs' + } + }, + 'hidden values' + ); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }), + { + __proto__: null, + foo: { + __proto__: null, + bar: 'stuffs' + } + }, + 'hidden values: plain objects' + ); + + st.end(); + }); + + t.test('object-valued input with own `__proto__` does not mutate sub-object [[Prototype]]', function (st) { + // JSON.parse creates own data `__proto__` properties (via CreateDataProperty), + // which would trigger the Object.prototype.__proto__ accessor if merged via `acc[key] = value`. + var out = qs.parse({ + 'user[name]': 'alice', + user: JSON.parse('{"__proto__":{"isAdmin":true}}') + }, { allowPrototypes: false }); + + st.equal(out.user.name, 'alice', 'name from bracket key is preserved'); + st.equal(out.user.isAdmin, undefined, 'attacker-controlled inherited property is not exposed'); + st.equal(Object.getPrototypeOf(out.user), Object.prototype, 'sub-object [[Prototype]] is unchanged'); + st.equal(Object.prototype.isAdmin, undefined, 'Object.prototype is not polluted'); + + st.end(); + }); + + t.test('can return null objects', { skip: !hasProto }, function (st) { + var expected = { + __proto__: null, + a: { + __proto__: null, + b: 'c', + hasOwnProperty: 'd' + } + }; + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), { __proto__: null }); + var expectedArray = { + __proto__: null, + a: { + __proto__: null, + 0: 'b', + c: 'd' + } + }; + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); + }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /%([0-9A-F]{2})/ig; + var result = []; + var parts = reg.exec(str); + while (parts) { + result.push(parseInt(parts[1], 16)); + parts = reg.exec(str); + } + return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('receives the default decoder as a second argument', function (st) { + st.plan(1); + qs.parse('a', { + decoder: function (str, defaultDecoder) { + st.equal(defaultDecoder, utils.decode); + } + }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st['throws'](function () { + qs.parse({}, { decoder: 'string' }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.parse('a[b]=true', options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.parse('a=b', { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('parses an iso-8859-1 string if asked to', function (st) { + st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); + st.end(); + }); + + var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; + var urlEncodedOSlashInUtf8 = '%C3%B8'; + var urlEncodedNumCheckmark = '%26%2310003%3B'; + var urlEncodedNumSmiley = '%26%239786%3B'; + + t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); + st.end(); + }); + + t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { + st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); + st.end(); + }); + + t.test('ignores an utf8 sentinel with an unknown value', function (st) { + st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { + charset: 'iso-8859-1', + decoder: function (str, defaultDecoder, charset) { + return str ? defaultDecoder(str, defaultDecoder, charset) : null; + }, + interpretNumericEntities: true + }), { foo: null, bar: '☺' }); + st.end(); + }); + + t.test('handles a custom decoder returning `null`, with a string key of `null`', function (st) { + st.deepEqual( + qs.parse('null=1&ToNull=2', { + decoder: function (str, defaultDecoder, charset) { + return str === 'ToNull' ? null : defaultDecoder(str, defaultDecoder, charset); + } + }), + { 'null': '1' }, + '"null" key is not overridden by `null` decoder result' + ); + + st.end(); + }); + + t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('interpretNumericEntities with comma:true and iso charset does not crash', function (st) { + st.deepEqual( + qs.parse('b&a[]=1,' + urlEncodedNumSmiley, { comma: true, charset: 'iso-8859-1', interpretNumericEntities: true }), + { b: '', a: ['1,☺'] } + ); + + st.end(); + }); + + t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { + st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); + st.end(); + }); + + t.test('allows for decoding keys and values differently', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); + + var noopDecoder = function () { return 'x'; }; + noopDecoder(); + st['throws']( + function () { decoder('x', noopDecoder, 'utf-8', 'unknown'); }, + 'this should never happen! type: unknown', + 'decoder throws for unexpected type' + ); + + st.end(); + }); + + t.test('parameter limit tests', function (st) { + st.test('does not throw error when within parameter limit', function (sst) { + var result = qs.parse('a=1&b=2&c=3', { parameterLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean' + ); + sst.end(); + }); + + st.test('throws error when parameter limit exceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Parameter limit exceeded. Only 3 parameters allowed.'), + 'throws error when parameter limit is exceeded' + ); + + sst['throws']( + function () { + qs.parse('a=1&b=2', { parameterLimit: 1, throwOnLimitExceeded: true }); + }, + new RangeError('Parameter limit exceeded. Only 1 parameter allowed.'), + 'throws error with singular "parameter" when parameterLimit is 1' + ); + sst.end(); + }); + + st.test('silently truncates when throwOnLimitExceeded is not given', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3 }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('silently truncates when parameter limit exceeded without error', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3, throwOnLimitExceeded: false }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('allows unlimited parameters when parameterLimit set to Infinity', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity }); + sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation'); + sst.end(); + }); + + st.test('allows unlimited parameters when parameterLimit is Infinity and throwOnLimitExceeded is true', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation or throwing'); + sst.end(); + }); + + st.end(); + }); + + t.test('array limit tests', function (st) { + st.test('does not throw error when array is within limit', function (sst) { + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: ['1', '2', '3'] }, 'parses array without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean for array limit', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean for array limit' + ); + sst.end(); + }); + + st.test('throws error when array limit exceeded', function (sst) { + // 4 elements exceeds limit of 3 + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws error when array limit is exceeded' + ); + sst.end(); + }); + + st.test('does not throw when at limit', function (sst) { + // 3 elements = limit of 3, should not throw + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 3, throwOnLimitExceeded: true }); + sst.ok(Array.isArray(result.a), 'result is an array'); + sst.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + sst.end(); + }); + + st.test('converts array to object if length is greater than limit', function (sst) { + var result = qs.parse('a[1]=1&a[2]=2&a[3]=3&a[4]=4&a[5]=5&a[6]=6', { arrayLimit: 5 }); + + sst.deepEqual(result, { a: { 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6' } }, 'parses into object if array length is greater than limit'); + sst.end(); + }); + + st.test('throws error when indexed notation exceeds arrayLimit with throwOnLimitExceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a[1001]=b', { arrayLimit: 1000, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 1000 elements allowed in an array.'), + 'throws error for a single index exceeding arrayLimit' + ); + + sst['throws']( + function () { + qs.parse('a[0]=1&a[1]=2&a[2]=3&a[10]=4', { arrayLimit: 6, throwOnLimitExceeded: true, allowSparse: true }); + }, + new RangeError('Array limit exceeded. Only 6 elements allowed in an array.'), + 'throws error when a sparse index exceeds arrayLimit' + ); + + sst['throws']( + function () { + qs.parse('a[2]=b', { arrayLimit: 1, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'throws error with singular "element" when arrayLimit is 1' + ); + + sst.end(); + }); + + st.test('does not throw for indexed notation within arrayLimit with throwOnLimitExceeded', function (sst) { + var result = qs.parse('a[4]=b', { arrayLimit: 5, throwOnLimitExceeded: true, allowSparse: true }); + sst.ok(Array.isArray(result.a), 'result is an array'); + sst.equal(result.a.length, 5, 'array has correct length'); + sst.equal(result.a[4], 'b', 'value at index 4 is correct'); + sst.end(); + }); + + st.test('silently converts to object for indexed notation exceeding arrayLimit without throwOnLimitExceeded', function (sst) { + var result = qs.parse('a[1001]=b', { arrayLimit: 1000 }); + sst.deepEqual(result, { a: { 1001: 'b' } }, 'converts to object without throwing'); + sst.end(); + }); + + st.test('throws when duplicate bracket keys exceed arrayLimit with throwOnLimitExceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4&a[]=5&a[]=6', { arrayLimit: 5, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'), + 'throws error when duplicate bracket notation exceeds array limit' + ); + sst.end(); + }); + + st.test('throws when cumulative comma + duplicate-key combine exceeds arrayLimit', function (sst) { + sst['throws']( + function () { + qs.parse('a=1,2,3&a=4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'), + 'throws when comma groups within the limit cumulatively exceed it across duplicate keys' + ); + + sst['throws']( + function () { + qs.parse('a=v,v,v,v,v&a=v,v,v,v,v&a=v,v,v,v,v', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'), + 'throws on a subsequent part once the cumulative array is already over the limit' + ); + sst.end(); + }); + + st.test('throws when plain duplicate keys combine past arrayLimit at the boundary', function (sst) { + sst['throws']( + function () { qs.parse('a=x&a=y', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'duplicate scalar keys' + ); + + sst['throws']( + function () { qs.parse('a[]=x&a[]=y', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'duplicate bracket keys' + ); + sst.end(); + }); + + st.test('throws when mixed index and key notation merge past arrayLimit', function (sst) { + sst['throws']( + function () { qs.parse('a=x&a[0]=y', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'scalar then index that overflows on merge' + ); + + sst['throws']( + function () { qs.parse('a[0]=1&a[1]=2&a=3', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'indexed array then scalar that overflows on merge' + ); + sst.end(); + }); + + st.test('enforces arrayLimit on merge at the boundary, consistently with combine', function (sst) { + sst['throws']( + function () { qs.parse('a[0]=x&a=y', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'a trailing scalar merged into an at-limit array throws' + ); + sst.deepEqual( + qs.parse('a[0]=x&a=y', { arrayLimit: 1 }), + { a: { 0: 'x', 1: 'y' } }, + 'and converts to an overflow object without throwOnLimitExceeded' + ); + + sst['throws']( + function () { qs.parse('a[0]=x&a[]=y', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'mixed index and bracket notation merged past the limit throws' + ); + sst.deepEqual( + qs.parse('a[0]=x&a[]=y', { arrayLimit: 1 }), + { a: { 0: 'x', 1: 'y' } }, + 'mixed index and bracket notation converts like duplicate-bracket combine' + ); + + sst.end(); + }); + + st.test('does not throw when cumulative comma combine stays within arrayLimit', function (sst) { + var result = qs.parse('a=1,2,3&a=4', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: ['1', '2', '3', '4'] }, 'combined array within limit is preserved'); + sst.end(); + }); + + st.test('silently combines to an overflow object when throwOnLimitExceeded is not set', function (sst) { + var result = qs.parse('a=1,2,3&a=4,5,6', { comma: true, arrayLimit: 5 }); + sst.deepEqual(result, { a: { 0: '1', 1: '2', 2: '3', 3: '4', 4: '5', 5: '6' } }, 'converts to object without throwing'); + sst.end(); + }); + + st.test('spreads a comma group appended to an already-overflowed object', function (sst) { + var result = qs.parse('a=1,2,3,4,5,6&a=7,8', { comma: true, arrayLimit: 5 }); + sst.deepEqual( + result, + { a: { 0: '1', 1: '2', 2: '3', 3: '4', 4: '5', 5: '6', 6: '7', 7: '8' } }, + 'appended comma values are flattened, not nested' + ); + sst.end(); + }); + + st.test('keeps a `[]=` comma group as one element when appended to an already-overflowed key', function (sst) { + var result = qs.parse('a[]=1&a[]=2&a[]=3&a[]=4,5', { comma: true, arrayLimit: 2 }); + sst.deepEqual( + result, + { a: { 0: '1', 1: '2', 2: '3', 3: ['4', '5'] } }, + 'nested comma group stays a single element, not double-nested' + ); + sst.end(); + }); + + st.test('spreads every later comma group appended to an already-overflowed object', function (sst) { + var result = qs.parse('a=1,2,3,4,5,6&a=7,8&a=9,10', { comma: true, arrayLimit: 5 }); + sst.deepEqual( + result, + { a: { 0: '1', 1: '2', 2: '3', 3: '4', 4: '5', 5: '6', 6: '7', 7: '8', 8: '9', 9: '10' } }, + 'each appended group is flattened in order' + ); + sst.end(); + }); + + st.test('spreads a comma group appended to an object overflowed under the default arrayLimit', function (sst) { + var values = []; + for (var i = 0; i <= 20; i += 1) { + values[values.length] = String(i); + } + var expected = {}; + for (var j = 0; j < values.length; j += 1) { + expected[j] = values[j]; + } + expected[21] = 'x'; + expected[22] = 'y'; + + var result = qs.parse('a=' + values.join(',') + '&a=x,y', { comma: true }); + sst.deepEqual(result, { a: expected }, 'appended values land at indices 21 and 22'); + sst.end(); + }); + + st.test('spreads a comma group appended to an already-overflowed object with plainObjects', function (sst) { + var result = qs.parse('a=1,2,3,4,5,6&a=7,8', { comma: true, arrayLimit: 5, plainObjects: true }); + sst.deepEqual( + result, + { __proto__: null, a: { __proto__: null, 0: '1', 1: '2', 2: '3', 3: '4', 4: '5', 5: '6', 6: '7', 7: '8' } }, + 'appended comma values are flattened into the null object' + ); + sst.end(); + }); + + st.test('still throws with throwOnLimitExceeded when a comma group is appended to an already-overflowed object', function (sst) { + sst['throws']( + function () { + qs.parse('a=1,2,3,4,5,6&a=7,8', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + }, + /Array limit exceeded/, + 'throws before spreading the appended group' + ); + sst.end(); + }); + st.test('does not throw for comma groups nested under bracket notation, counting each group as one element', function (sst) { + var result = qs.parse('a[]=1,2,3&a[]=4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: [['1', '2', '3'], ['4', '5', '6']] }, 'nested comma groups count as one element each'); + sst.end(); + }); + + st.test('throws before splitting when a single comma value exceeds arrayLimit', function (sst) { + sst['throws']( + function () { + qs.parse('a=1,2,3,4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'), + 'a flat comma value over the limit throws' + ); + + sst['throws']( + function () { + qs.parse('a=1,2', { comma: true, arrayLimit: 1, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'singular message at arrayLimit 1' + ); + + sst['throws']( + function () { + qs.parse('a[b]=1,2,3,4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'), + 'a non-bracket nested key comma value over the limit throws' + ); + sst.end(); + }); + + st.test('does not throw for a single comma value within arrayLimit', function (sst) { + sst.deepEqual( + qs.parse('a=1,2,3', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }), + { a: ['1', '2', '3'] }, + 'within the limit' + ); + sst.deepEqual( + qs.parse('a=1,2,3,4,5', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }), + { a: ['1', '2', '3', '4', '5'] }, + 'exactly at the limit' + ); + sst.end(); + }); + + st.test('throws before splitting when a bracketed comma group exceeds arrayLimit', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1,2,3,4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'), + 'the inner group is itself an array and is subject to arrayLimit' + ); + sst.end(); + }); + + st.test('throws before splitting when a comma group under `[]=` exceeds arrayLimit', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'a bracket-push comma group over the limit throws like the flat form' + ); + + sst['throws']( + function () { + qs.parse('a[]=1,2', { comma: true, arrayLimit: 1, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'singular message at arrayLimit 1' + ); + + sst['throws']( + function () { + qs.parse('a[b][]=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'a nested bracket-push key throws' + ); + + sst['throws']( + function () { + qs.parse('a[][]=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'a doubly bracket-pushed key throws' + ); + + sst['throws']( + function () { + qs.parse('a[]=5&a[]=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'an oversized group appended after a scalar throws' + ); + + sst['throws']( + function () { + qs.parse('a[]=1,2,3,4&a[]=5', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'an oversized group throws even when a later part would fit' + ); + + sst['throws']( + function () { + qs.parse('a[]=1,2,3,4&a[]=5', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true, duplicates: 'first' }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws with duplicates: first' + ); + + sst['throws']( + function () { + qs.parse('a[]=5&a[]=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true, duplicates: 'last' }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws with duplicates: last' + ); + + sst['throws']( + function () { + qs.parse({ a: '1,2,3,4' }, { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'an oversized comma value in object input throws' + ); + + var big = 'a[]=' + new Array(1e5 + 1).join('1,') + '1'; + sst['throws']( + function () { + qs.parse(big, { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'a very long bracket-push comma group throws' + ); + sst.end(); + }); + + st.test('does not throw for a comma group under `[]=` within arrayLimit', function (sst) { + sst.deepEqual( + qs.parse('a[]=1,2,3', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }), + { a: [['1', '2', '3']] }, + 'an inner group exactly at the limit stays a single nested element' + ); + sst.deepEqual( + qs.parse('a[]=1,2,3&a[]=4,5,6&a[]=7', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }), + { a: [['1', '2', '3'], ['4', '5', '6'], '7'] }, + 'each group counts as one element of the outer array' + ); + sst.deepEqual( + qs.parse('a[b][]=1,2,3', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }), + { a: { b: [['1', '2', '3']] } }, + 'nested bracket-push key within the limit' + ); + sst.deepEqual( + qs.parse({ a: '1,2,3' }, { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }), + { a: ['1', '2', '3'] }, + 'object input within the limit' + ); + sst.end(); + }); + + st.test('keeps an oversized comma group under `[]=` as a nested array without throwOnLimitExceeded', function (sst) { + sst.deepEqual( + qs.parse('a[]=1,2,3,4', { comma: true, arrayLimit: 3 }), + { a: [['1', '2', '3', '4']] }, + 'the inner group is not converted to an overflow object' + ); + sst.end(); + }); + + st.test('throws for a bracketed comma group when arrayLimit is 0', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1,2,3', { comma: true, arrayLimit: 0, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 0 elements allowed in an array.'), + 'a single bracketed element still exceeds arrayLimit 0' + ); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('parses empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('skips empty string key with ' + testCase.input, function (st) { + st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); + + st.end(); + }); + }); +}); + +test('`duplicates` option', function (t) { + v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { + if (typeof invalidOption !== 'undefined') { + t['throws']( + function () { qs.parse('', { duplicates: invalidOption }); }, + TypeError, + 'throws on invalid option: ' + inspect(invalidOption) + ); + } + }); + + t.deepEqual( + qs.parse('foo=bar&foo=baz'), + { foo: ['bar', 'baz'] }, + 'duplicates: default, combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), + { foo: ['bar', 'baz'] }, + 'duplicates: combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), + { foo: 'bar' }, + 'duplicates: first' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), + { foo: 'baz' }, + 'duplicates: last' + ); + + t.test('bracket notation always combines regardless of duplicates', function (st) { + st.deepEqual( + qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }), + { a: '2', b: ['1', '2'] }, + 'duplicates last: unbracketed takes last, bracketed combines' + ); + + st.deepEqual( + qs.parse('b[]=1&b[]=2', { duplicates: 'last' }), + { b: ['1', '2'] }, + 'duplicates last: bracketed always combines' + ); + + st.deepEqual( + qs.parse('b[]=1&b[]=2', { duplicates: 'first' }), + { b: ['1', '2'] }, + 'duplicates first: bracketed always combines' + ); + + st.deepEqual( + qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'first' }), + { a: '1', b: ['1', '2'] }, + 'duplicates first: unbracketed takes first, bracketed combines' + ); + + st.end(); + }); + + t.end(); +}); + +test('qs strictDepth option - throw cases', function (t) { + t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for different types of values with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + +}); + +test('qs strictDepth option - non-throw cases', function (t) { + t.test('when depth is 0 and strictDepth true, do not throw', function (st) { + st.doesNotThrow( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); + }, + RangeError, + 'does not throw RangeError' + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); + st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'parses with depth limit'); + } + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1 }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); + st.deepEqual(result, { a: { b: { c: 'd' } } }, 'parses correctly'); + } + ); + st.end(); + }); +}); + +test('DOS', function (t) { + var arr = []; + for (var i = 0; i < 105; i++) { + arr[arr.length] = 'x'; + } + var attack = 'a[]=' + arr.join('&a[]='); + var result = qs.parse(attack, { arrayLimit: 100 }); + + t.notOk(Array.isArray(result.a), 'arrayLimit is respected: result is an object, not an array'); + t.equal(Object.keys(result.a).length, 105, 'all values are preserved'); + + t.end(); +}); + +test('arrayLimit boundary conditions', function (t) { + // arrayLimit is the max number of elements allowed in an array + t.test('exactly at the limit stays as array', function (st) { + // 3 elements = limit of 3 + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 3 }); + st.ok(Array.isArray(result.a), 'result is an array when count equals limit'); + st.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + st.end(); + }); + + t.test('one over the limit converts to object', function (st) { + // 4 elements exceeds limit of 3 + var result = qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3 }); + st.notOk(Array.isArray(result.a), 'result is not an array when over limit'); + st.deepEqual(result.a, { 0: '1', 1: '2', 2: '3', 3: '4' }, 'all values preserved as object'); + st.end(); + }); + + t.test('arrayLimit 1 with one value', function (st) { + // 1 element = limit of 1 + var result = qs.parse('a[]=1', { arrayLimit: 1 }); + st.ok(Array.isArray(result.a), 'result is an array when count equals limit'); + st.deepEqual(result.a, ['1'], 'value preserved as array'); + st.end(); + }); + + t.test('arrayLimit 1 with two values converts to object', function (st) { + // 2 elements exceeds limit of 1 + var result = qs.parse('a[]=1&a[]=2', { arrayLimit: 1 }); + st.notOk(Array.isArray(result.a), 'result is not an array'); + st.deepEqual(result.a, { 0: '1', 1: '2' }, 'all values preserved as object'); + st.end(); + }); + + t.end(); +}); + +test('comma + arrayLimit', function (t) { + t.test('comma-separated values within arrayLimit stay as array', function (st) { + var result = qs.parse('a=1,2,3', { comma: true, arrayLimit: 5 }); + st.ok(Array.isArray(result.a), 'result is an array'); + st.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + st.end(); + }); + + t.test('comma-separated values exceeding arrayLimit convert to object', function (st) { + var result = qs.parse('a=1,2,3,4', { comma: true, arrayLimit: 3 }); + st.notOk(Array.isArray(result.a), 'result is not an array when over limit'); + st.deepEqual(result.a, { 0: '1', 1: '2', 2: '3', 3: '4' }, 'all values preserved as object'); + st.end(); + }); + + t.test('comma-separated values exceeding arrayLimit with throwOnLimitExceeded throws', function (st) { + st['throws']( + function () { + qs.parse('a=1,2,3,4', { comma: true, arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws error when comma-split exceeds array limit' + ); + + st['throws']( + function () { + qs.parse('a=1,2,3', { comma: true, arrayLimit: 1, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'throws error with singular "element" when arrayLimit is 1' + ); + st.end(); + }); + + t.test('comma-separated values at exactly arrayLimit stay as array', function (st) { + var result = qs.parse('a=1,2,3', { comma: true, arrayLimit: 3 }); + st.ok(Array.isArray(result.a), 'result is an array when exactly at limit'); + st.deepEqual(result.a, ['1', '2', '3'], 'all values present'); + st.end(); + }); + + t.end(); +}); + +test('mixed array and object notation', function (t) { + t.test('array brackets with object key - under limit', function (st) { + st.deepEqual( + qs.parse('a[]=b&a[c]=d'), + { a: { 0: 'b', c: 'd' } }, + 'mixing [] and [key] converts to object' + ); + st.end(); + }); + + t.test('array index with object key - under limit', function (st) { + st.deepEqual( + qs.parse('a[0]=b&a[c]=d'), + { a: { 0: 'b', c: 'd' } }, + 'mixing [0] and [key] produces object' + ); + st.end(); + }); + + t.test('plain value with array brackets - under limit', function (st) { + st.deepEqual( + qs.parse('a=b&a[]=c', { arrayLimit: 20 }), + { a: ['b', 'c'] }, + 'plain value combined with [] stays as array under limit' + ); + st.end(); + }); + + t.test('array brackets with plain value - under limit', function (st) { + st.deepEqual( + qs.parse('a[]=b&a=c', { arrayLimit: 20 }), + { a: ['b', 'c'] }, + '[] combined with plain value stays as array under limit' + ); + st.end(); + }); + + t.test('plain value with array index - under limit', function (st) { + st.deepEqual( + qs.parse('a=b&a[0]=c', { arrayLimit: 20 }), + { a: ['b', 'c'] }, + 'plain value combined with [0] stays as array under limit' + ); + st.end(); + }); + + t.test('multiple plain values with duplicates combine', function (st) { + st.deepEqual( + qs.parse('a=b&a=c&a=d', { arrayLimit: 20 }), + { a: ['b', 'c', 'd'] }, + 'duplicate plain keys combine into array' + ); + st.end(); + }); + + t.test('multiple plain values exceeding limit', function (st) { + // 3 elements (indices 0-2), max index 2 > limit 1 + st.deepEqual( + qs.parse('a=b&a=c&a=d', { arrayLimit: 1 }), + { a: { 0: 'b', 1: 'c', 2: 'd' } }, + 'duplicate plain keys convert to object when exceeding limit' + ); + st.end(); + }); + + t.test('mixed notation produces consistent results when arrayLimit is exceeded', function (st) { + var expected = { a: { 0: 'b', 1: 'c', 2: 'd' } }; + + st.deepEqual( + qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: -1 }), + expected, + 'arrayLimit -1' + ); + + st.deepEqual( + qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: 0 }), + expected, + 'arrayLimit 0' + ); + + st.deepEqual( + qs.parse('a[]=b&a[1]=c&a=d', { arrayLimit: 1 }), + expected, + 'arrayLimit 1' + ); + + st.end(); + }); + + t.test('uses existing array length for currentArrayLength when parsing object input with bracket keys', function (st) { + var input = {}; + var arr = ['x', 'y']; + arr.a = ['z', 'w']; + input['a[]'] = arr; + st.deepEqual(qs.parse(input), { a: ['x', 'y'] }, 'parses object input with bracket keys using existing array values'); + st.end(); + }); + + t.test('throws with singular message when object input bracket key exceeds arrayLimit of 1', function (st) { + var input = {}; + var arr = ['x']; + arr.a = ['z', 'w']; + input['a[]'] = arr; + st['throws']( + function () { + qs.parse(input, { throwOnLimitExceeded: true, arrayLimit: 1 }); + }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'throws singular error for object input exceeding arrayLimit 1' + ); + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/stringify.js b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/stringify.js new file mode 100644 index 00000000..3c8e4080 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/stringify.js @@ -0,0 +1,1765 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var utils = require('../lib/utils'); +var iconv = require('iconv-lite'); +var SaferBuffer = require('safer-buffer').Buffer; +var hasSymbols = require('has-symbols'); +var mockProperty = require('mock-property'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); +var hasBigInt = require('has-bigints')(); + +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); + }); + + t.test('stringifies falsy values', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(null, { strictNullHandling: true }), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(0), ''); + st.end(); + }); + + t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { + st.equal(qs.stringify(Symbol.iterator), ''); + st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); + st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); + st.equal( + qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=Symbol%28Symbol.iterator%29' + ); + st.end(); + }); + + t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { + var three = BigInt(3); + var encodeWithN = function (value, defaultEncoder, charset) { + var result = defaultEncoder(value, defaultEncoder, charset); + return typeof value === 'bigint' ? result + 'n' : result; + }; + st.equal(qs.stringify(three), ''); + st.equal(qs.stringify([three]), '0=3'); + st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); + st.equal(qs.stringify({ a: three }), 'a=3'); + st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=3' + ); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), + 'a[]=3n' + ); + st.end(); + }); + + t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.first=John&name.obj.last=Doe', + 'with allowDots true and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.end(); + }); + + t.test('encodes dot in key of object with a primitive value when encodeDotInKeys and allowDots is provided', function (st) { + st.equal( + qs.stringify( + { 'name.obj': 'John' }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj=John', + 'with allowDots true and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': 'John' }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj=John', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': 'John' }, + { encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true } + ), + 'name%2Eobj=John', + 'with encodeValuesOnly true' + ); + + // With `encodeValuesOnly` the key encoder is skipped, so the dot is encoded once + // (`%2E`) rather than twice. That single `%2E` decodes back to a structural dot, so + // unlike the default output below this does not round-trip to the original dotted key + // (a pre-existing `encodeValuesOnly` + `encodeDotInKeys` limitation, not new here). + st.deepEqual( + qs.parse( + qs.stringify( + { 'name.obj': 'John' }, + { encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true } + ), + { allowDots: true, decodeDotInKeys: true } + ), + { name: { obj: 'John' } }, + 'with encodeValuesOnly the single-encoded dot decodes structurally (does not round-trip)' + ); + + st.deepEqual( + qs.parse( + qs.stringify({ 'name.obj': 'John' }, { allowDots: true, encodeDotInKeys: true }), + { allowDots: true, decodeDotInKeys: true } + ), + { 'name.obj': 'John' }, + 'round-trips a dotted key with a primitive value' + ); + + st.equal( + qs.stringify({ 'a.b': null }, { allowDots: true, encodeDotInKeys: true, strictNullHandling: true }), + 'a%252Eb', + 'encodes a dotted key with a null value' + ); + st.equal( + qs.stringify({ 'a.b': '1', 'c.d': '2' }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb=1&c%252Ed=2', + 'encodes dots in every top-level key, not just the first' + ); + st.equal( + qs.stringify({ 'a.b.c': 'x' }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb%252Ec=x', + 'encodes every dot in a key' + ); + var primitiveKey = qs.stringify({ 'a.b': 'c' }, { allowDots: true, encodeDotInKeys: true }).split('=')[0]; + st.equal( + qs.stringify({ 'a.b': { x: 'c' } }, { allowDots: true, encodeDotInKeys: true }).indexOf(primitiveKey + '.'), + 0, + 'a top-level dotted key encodes identically for primitive and object values' + ); + + st.end(); + }); + + // Characterization of the CURRENT (buggy) behavior: with `allowDots` + `encodeDotInKeys`, + // `stringify` percent-encodes the structural `.` separators that `allowDots` inserts between + // nested keys, not just the literal dots inside a key, which breaks the stringify -> parse + // round-trip. These assertions pin that behavior so it cannot change silently: the fix in + // https://github.com/ljharb/qs/pull/564 changes every output below, so landing that fix MUST + // update this test (that is the point — it forces the behavior change to be explicit). + t.test('[characterization] encodeDotInKeys currently over-encodes structural separator dots (pre-#564)', function (st) { + st.equal( + qs.stringify({ a: { b: { c: 'd' } } }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb.c=d', + 'over-encodes the a->b separator (#564: should become a.b.c=d)' + ); + st.equal( + qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb%252Ec.d=e', + 'clobbers every separator but the last (#564: should become a.b.c.d=e)' + ); + st.equal( + qs.stringify({ 'a.b': { c: { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb%252Ec.d=e', + 'top-level dotted key: deeper separators also get encoded (#564: should become a%252Eb.c.d=e)' + ); + st.equal( + qs.stringify({ a: { 'b.c': { d: 'e' } } }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb%252Ec.d=e', + 'nested dotted key + object value: the separator around it is encoded (#564: should become a.b%252Ec.d=e)' + ); + st.equal( + qs.stringify({ a: { b: { 'c.d': { e: 'f' } } } }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb%252Ec%252Ed.e=f', + 'deeply nested dotted key: all separators encoded (#564: should become a.b.c%252Ed.e=f)' + ); + + st.equal( + qs.stringify({ a: { b: [1, 2] } }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb%5B0%5D=1&a%252Eb%5B1%5D=2', + 'array value under nested keys: separator encoded (#564: should become a.b%5B0%5D=1&a.b%5B1%5D=2)' + ); + st.equal( + qs.stringify({ a: { 'b.c': [1, 2] } }, { allowDots: true, encodeDotInKeys: true }), + 'a%252Eb%252Ec%5B0%5D=1&a%252Eb%252Ec%5B1%5D=2', + 'array value under nested dotted key (#564: should become a.b%252Ec%5B0%5D=1&a.b%252Ec%5B1%5D=2)' + ); + + st.equal( + qs.stringify({ a: { 'b.c': { d: 'e' } } }, { allowDots: false, encodeDotInKeys: true }), + 'a%5Bb%252Ec%5D%5Bd%5D=e', + 'allowDots:false object value encodes the nested-key dot, unlike the primitive-value case (#564: should become a%5Bb.c%5D%5Bd%5D=e)' + ); + + st.deepEqual( + qs.parse( + qs.stringify({ a: { b: { c: 'd' } } }, { allowDots: true, encodeDotInKeys: true }), + { allowDots: true, decodeDotInKeys: true } + ), + { 'a.b': { c: 'd' } }, + 'the over-encoding breaks the round-trip: {a:{b:{c}}} comes back as {"a.b":{c}} (#564 restores it)' + ); + + st.end(); + }); + + t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots undefined and encodeDotInKeys true' + ); + st.end(); + }); + + t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { + st.equal( + qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { + encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true + }), + 'name%2Eobj.first=John&name%2Eobj.last=Doe' + ); + + st.equal( + qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), + 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' + ); + + st.end(); + }); + + t.test('throws when `commaRoundTrip` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, + TypeError, + 'throws when `commaRoundTrip` is not a boolean' + ); + + st.end(); + }); + + t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('adds query prefix', function (st) { + st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); + st.end(); + }); + + t.test('with query prefix, outputs blank string given an empty object', function (st) { + st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); + st.end(); + }); + + t.test('stringifies nested falsy values', function (st) { + st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); + st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); + st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); + }); + + t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); + st.end(); + }); + + t.test('stringifies an array value', function (st) { + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), + 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), + 'a=b%2Cc%2Cd', + 'comma => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), + 'a=b%2Cc%2Cd', + 'comma round trip => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'default => indices' + ); + st.end(); + }); + + t.test('`skipNulls` option', function (st) { + st.equal( + qs.stringify({ a: 'b', c: null }, { skipNulls: true }), + 'a=b', + 'omits nulls when asked' + ); + + st.equal( + qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), + 'a%5Bb%5D=c', + 'omits nested nulls when asked' + ); + + st.end(); + }); + + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + + st.end(); + }); + + t.test('omits object key/value pair when value is empty array', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + + st.end(); + }); + + t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.equal( + qs.stringify( + { testEmptyArray: [] }, + { strictNullHandling: true, allowEmptyArrays: true } + ), + 'testEmptyArray[]' + ); + + st.end(); + }); + + t.test('allowEmptyArrays only short-circuits arrays with no own keys', function (st) { + st.equal( + qs.stringify({ a: [] }, { allowEmptyArrays: true }), + 'a[]', + 'a genuinely empty array is still emitted as `[]`' + ); + + var withKey = []; + withKey.extra = 'x'; + st.equal( + qs.stringify({ a: withKey }, { allowEmptyArrays: true }), + 'a%5Bextra%5D=x', + 'an own key on an empty array is serialized rather than dropped' + ); + st.equal( + qs.stringify({ a: withKey }, { allowEmptyArrays: true }), + qs.stringify({ a: withKey }), + 'the allowEmptyArrays fast path matches the default path when the array has own keys' + ); + + var container = {}; + var cyclic = []; + cyclic.back = container; + container.a = cyclic; + st['throws']( + function () { qs.stringify(container, { allowEmptyArrays: true }); }, + RangeError, + 'a cycle through an empty array with an own key is still detected' + ); + + st.end(); + }); + + t.test('stringifies an array value with one item vs multiple items', function (st) { + st.test('non-array item', function (s2t) { + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); + + s2t.end(); + }); + + st.test('array with a single item', function (s2t) { + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); + + s2t.end(); + }); + + st.test('array with multiple items', function (s2t) { + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); + + s2t.end(); + }); + + st.test('array with multiple items with a comma inside', function (s2t) { + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); + + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); + + s2t.end(); + }); + + st.end(); + }); + + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d'); + st.end(); + }); + + t.test('stringifies comma and empty array values', function (st) { + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies comma and empty non-array values', function (st) { + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies a nested array value with dots notation', function (st) { + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a.b[0]=c&a.b[1]=d', + 'indices: stringifies with dots + indices' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a.b[]=c&a.b[]=d', + 'brackets: stringifies with dots + brackets' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' } + ), + 'a.b=c,d', + 'comma: stringifies with dots + comma' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true } + ), + 'a.b[0]=c&a.b[1]=d', + 'default: stringifies with dots + indices' + ); + st.end(); + }); + + t.test('stringifies an object inside an array', function (st) { + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b]=c', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b]=c', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b]=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), + 'a[0][b]=c', + 'default => indices' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b][c]=1', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b][c][]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[][b]=1&a[]=2&a[]=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), + '???', + 'brackets => brackets', + { skip: 'TODO: figure out what this should do' } + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an object inside an array with dots notation', function (st) { + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b=c', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false } + ), + 'a[0].b=c', + 'default => indices' + ); + + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b.c[0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b.c[]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false } + ), + 'a[0].b.c[0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); + }); + + t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); + }); + + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); + + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); + + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); + + st.end(); + }); + + t.test('stringifies an empty array in different arrayFormat', function (st) { + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); + // arrayFormat default + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c'); + // with strictNullHandling + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c'); + // with skipNulls + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); + + st.end(); + }); + + t.test('does not crash on null/undefined entries in arrayFormat=comma with encodeValuesOnly', function (st) { + st.doesNotThrow( + function () { qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); }, + 'does not pass a raw null array entry to the encoder' + ); + st.doesNotThrow( + function () { qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); }, + 'does not pass a raw undefined array entry to the encoder' + ); + st.doesNotThrow( + function () { qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }); }, + 'does not crash on a single-null array' + ); + + st.equal( + qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }), + 'a=,b', + 'null entry joins as empty, comma stays unencoded under encodeValuesOnly' + ); + st.equal( + qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }), + 'a=,b', + 'undefined entry joins as empty, comma stays unencoded under encodeValuesOnly' + ); + st.equal( + qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }), + 'a=', + 'single-null array stringifies as empty value' + ); + st.equal( + qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true, strictNullHandling: true }), + 'a', + 'strictNullHandling drops the equals sign for a single-null array' + ); + st.equal( + qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true, skipNulls: true }), + '', + 'skipNulls drops a single-null array entirely' + ); + + st.end(); + }); + + t.test('stringifies a null object', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ __proto__: null, a: 'b' }), 'a=b'); + st.end(); + }); + + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); + }); + + t.test('stringifies an object with a null object as a child', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ a: { __proto__: null, b: 'c' } }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); + + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); + }); + + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('stringifies a date', function (st) { + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + st.equal(qs.stringify({ a: now }), str); + st.end(); + }); + + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); + }); + + t.test('skips properties that are part of the object prototype', function (st) { + st.intercept(Object.prototype, 'crash', { value: 'test' }); + + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + + st.end(); + }); + + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); + st.end(); + }); + + t.test('does not throw on a non-callable `constructor.isBuffer` key', function (st) { + var input = { a: { constructor: { isBuffer: 'x' } } }; + st.doesNotThrow(function () { qs.stringify(input); }); + st.equal(qs.stringify(input), 'a%5Bconstructor%5D%5BisBuffer%5D=x'); + st.equal(qs.stringify({ a: { constructor: { isBuffer: { b: 'c' } } } }), 'a%5Bconstructor%5D%5BisBuffer%5D%5Bb%5D=c'); + st.equal(qs.stringify({ a: { constructor: { isBuffer: ['b'] } } }), 'a%5Bconstructor%5D%5BisBuffer%5D%5B0%5D=b'); + st.equal(qs.stringify({ a: { constructor: { isBuffer: true } } }), 'a%5Bconstructor%5D%5BisBuffer%5D=true'); + st.end(); + }); + + t.test('round-trips a parsed `constructor[isBuffer]` key', function (st) { + var str = 'x%5Bconstructor%5D%5BisBuffer%5D=y'; + + var plain = qs.parse(str, { plainObjects: true }); + st.deepEqual(plain, { __proto__: null, x: { __proto__: null, constructor: { __proto__: null, isBuffer: 'y' } } }, 'plainObjects keeps the key'); + st.doesNotThrow(function () { qs.stringify(plain); }); + st.equal(qs.stringify(plain), str, 'plainObjects round-trips'); + + var proto = qs.parse(str, { allowPrototypes: true }); + st.deepEqual(proto, { x: { constructor: { isBuffer: 'y' } } }, 'allowPrototypes keeps the key'); + st.doesNotThrow(function () { qs.stringify(proto); }); + st.equal(qs.stringify(proto), str, 'allowPrototypes round-trips'); + + st.equal(qs.stringify(qs.parse(str)), '', 'default options drop the key'); + st.end(); + }); + + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.stringify({ a: 'b', c: 'd' }); + + restore(); + + st.equal(result, 'a=b&c=d'); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + st['throws']( + function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var circular = { + a: 'value' + }; + circular.a = circular; + st['throws']( + function () { qs.stringify(circular); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var arr = ['a']; + st.doesNotThrow( + function () { qs.stringify({ x: arr, y: arr }); }, + 'non-cyclic values do not throw' + ); + + st.end(); + }); + + t.test('non-circular duplicated references can still work', function (st) { + var hourOfDay = { + 'function': 'hour_of_day' + }; + + var p1 = { + 'function': 'gte', + arguments: [hourOfDay, 0] + }; + var p2 = { + 'function': 'lte', + arguments: [hourOfDay, 23] + }; + + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), + 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' + ); + + st.end(); + }); + + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } + ), + 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2] } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('skips null/undefined entries in filter=array', function (st) { + st.doesNotThrow( + function () { qs.stringify({ a: 'b', undefined: 'x' }, { filter: ['a', undefined] }); }, + 'does not pass a raw undefined filter entry to the encoder' + ); + st.doesNotThrow( + function () { qs.stringify({ a: 'b', 'null': 'x' }, { filter: ['a', null] }); }, + 'does not pass a raw null filter entry to the encoder' + ); + + st.equal( + qs.stringify({ a: 'b', undefined: 'x', c: 'd' }, { filter: ['a', undefined, 'c'] }), + 'a=b&c=d', + 'undefined filter entry is skipped, remaining keys are kept' + ); + st.equal( + qs.stringify({ a: 'b', 'null': 'x', c: 'd' }, { filter: ['a', null, 'c'] }), + 'a=b&c=d', + 'null filter entry is skipped, remaining keys are kept' + ); + st.equal( + qs.stringify({ a: 'b', 'null': 'x' }, { filter: [null] }), + '', + 'filter array containing only null yields empty string' + ); + + st.end(); + }); + + t.test('supports custom representations when filter=function', function (st) { + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + calls += 1; + if (calls === 1) { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { + return void 0; + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); + return value.getTime(); + } + return value; + }; + + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); + }); + + t.test('serializes Date values unless filter transforms them', function (st) { + var obj = { + a: new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260)), + b: [new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260))] + }; + var iso = '2023-03-07T09%3A02%3A41.260Z'; + st.equal( + qs.stringify(obj, { filter: function (prefix, value) { return value; } }), + 'a=' + iso + '&b%5B0%5D=' + iso, + 'Dates returned unchanged by a filter are serialized' + ); + st.equal( + qs.stringify({ a: new Date(0) }, { filter: function (prefix, value) { return value instanceof Date ? 'kept' : value; } }), + 'a=kept', + 'a filter that transforms a Date wins over default serialization' + ); + st.end(); + }); + + t.test('applies default Date handling to whatever a filter function returns', function (st) { + var date = new Date(Date.UTC(2023, 2, 7, 9, 2, 41, 260)); + var iso = '2023-03-07T09%3A02%3A41.260Z'; + var identity = function (prefix, value) { return value; }; + + st.equal( + qs.stringify({ a: { b: date } }, { filter: identity }), + 'a%5Bb%5D=' + iso, + 'a nested Date is serialized through a filter' + ); + st.equal( + qs.stringify( + { a: date }, + { filter: identity, serializeDate: function (d) { return String(d.getTime()); } } + ), + 'a=1678179761260', + '`serializeDate` is honored after a filter' + ); + st.equal( + qs.stringify({ a: [date, 'x'] }, { filter: identity, arrayFormat: 'comma' }), + 'a=' + iso + '%2Cx', + 'Dates inside a comma array are serialized through a filter, not stringified as locale text' + ); + st.equal( + qs.stringify({ a: 'x' }, { filter: function (prefix, value) { return prefix === 'a' ? date : value; } }), + 'a=' + iso, + 'a Date produced by the filter is serialized' + ); + st.equal( + qs.stringify({ a: date, b: 1 }, { filter: ['a'] }), + 'a=' + iso, + 'an array filter still serializes Dates' + ); + st['throws']( + function () { qs.stringify({ a: new Date(NaN) }, { filter: identity }); }, + RangeError, + 'an invalid Date through a filter throws like the no-filter path' + ); + st.end(); + }); + + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); + + t.test('can sort the keys', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); + }); + + t.test('can sort the keys at depth 3 or more too', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: sort, encode: false } + ), + 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' + ); + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: null, encode: false } + ), + 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' + ); + st.end(); + }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': '' }, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i = 0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(8); + + qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { + encoder: function (str) { + st.match(typeof str, /^(?:string|number|boolean)$/); + return ''; + } + }); + + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(2); + + qs.stringify({ a: 1 }, { + encoder: function (str, defaultEncoder) { + st.equal(defaultEncoder, utils.encode); + } + }); + + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st['throws'](function () { + qs.stringify({}, { encoder: 'string' }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + + st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { + encoder: function (buffer) { + return buffer; + } + }), 'a=a b'); + st.end(); + }); + + t.test('serializeDate option', function (st) { + var date = new Date(); + st.equal( + qs.stringify({ a: date }), + 'a=' + date.toISOString().replace(/:/g, '%3A'), + 'default is toISOString' + ); + + var mutatedDate = new Date(); + mutatedDate.toISOString = function () { + throw new SyntaxError(); + }; + st['throws'](function () { + mutatedDate.toISOString(); + }, SyntaxError); + st.equal( + qs.stringify({ a: mutatedDate }), + 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), + 'toISOString works even when method is not locally present' + ); + + var specificDate = new Date(6); + st.equal( + qs.stringify( + { a: specificDate }, + { serializeDate: function (d) { return d.getTime() * 7; } } + ), + 'a=42', + 'custom serializeDate function called' + ); + + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma' + } + ), + 'a=' + date.getTime(), + 'works with arrayFormat comma' + ); + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma', + commaRoundTrip: true + } + ), + 'a%5B%5D=' + date.getTime(), + 'works with arrayFormat comma' + ); + + st.end(); + }); + + t.test('RFC 1738 serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); + + st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); + + st.end(); + }); + + t.test('RFC 3986 spaces serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Backward compatibility to RFC 3986', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Edge cases and unknown formats', function (st) { + ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { + st['throws']( + function () { + qs.stringify({ a: 'b c' }, { format: format }); + }, + new TypeError('Unknown format option provided.') + ); + }); + st.end(); + }); + + t.test('encodeValuesOnly', function (st) { + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', + 'encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', + 'encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e%3Df&f=g&f=h', + 'encodeValuesOnly + repeat' + ); + + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'indices' } + ), + 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', + 'no encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'brackets' } + ), + 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', + 'no encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e&f=g&f=h', + 'no encodeValuesOnly + repeat' + ); + + st.end(); + }); + + t.test('encodeValuesOnly - strictNullHandling', function (st) { + st.equal( + qs.stringify( + { a: { b: null } }, + { encodeValuesOnly: true, strictNullHandling: true } + ), + 'a[b]' + ); + st.end(); + }); + + t.test('strictNullHandling: applies the formatter to the encoded key (RFC1738)', function (st) { + st.equal( + qs.stringify( + { 'a b': null, 'c d': 'e f' }, + { strictNullHandling: false, format: 'RFC1738' } + ), + 'a+b=&c+d=e+f', + 'without: as expected' + ); + + st.equal( + qs.stringify( + { 'a b': null, 'c d': 'e f' }, + { strictNullHandling: true, format: 'RFC1738' } + ), + 'a+b&c+d=e+f', + 'with: as expected' + ); + + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.stringify({ a: 'b' }, { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('respects a charset of iso-8859-1', function (st) { + st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); + st.end(); + }); + + t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { + st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); + st.end(); + }); + + t.test('respects an explicit charset of utf-8 (the default)', function (st) { + st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); + st.end(); + }); + + t.test('`charsetSentinel` option', function (st) { + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), + 'utf8=%E2%9C%93&a=%C3%A6', + 'adds the right sentinel when instructed to and the charset is utf-8' + ); + + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), + 'utf8=%26%2310003%3B&a=%E6', + 'adds the right sentinel when instructed to and the charset is iso-8859-1' + ); + + st.equal( + qs.stringify({ a: 1, b: 2 }, { charsetSentinel: true, delimiter: ';' }), + 'utf8=%E2%9C%93;a=1;b=2', + 'uses the configured delimiter after the sentinel' + ); + + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.stringify({}, options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('strictNullHandling works with custom filter', function (st) { + var filter = function (prefix, value) { + return value; + }; + + var options = { strictNullHandling: true, filter: filter }; + st.equal(qs.stringify({ key: null }, options), 'key'); + st.end(); + }); + + t.test('strictNullHandling works with null serializeDate', function (st) { + var serializeDate = function () { + return null; + }; + var options = { strictNullHandling: true, serializeDate: serializeDate }; + var date = new Date(); + st.equal(qs.stringify({ key: date }, options), 'key'); + st.end(); + }); + + t.test('allows for encoding keys and values differently', function (st) { + var encoder = function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); + + var noopEncoder = function () { return 'x'; }; + noopEncoder(); + st['throws']( + function () { encoder('x', noopEncoder, 'utf-8', 'unknown'); }, + 'this should never happen! type: unknown', + 'encoder throws for unexpected type' + ); + + st.end(); + }); + + t.test('objects inside arrays', function (st) { + var obj = { a: { b: { c: 'd', e: 'f' } } }; + var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; + + st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); + + st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); + st.equal( + qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), + '???', + 'array, comma', + { skip: 'TODO: figure out what this should do' } + ); + + st.end(); + }); + + t.test('stringifies sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); + + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.end(); + }); + + t.test('encodes a very long string', function (st) { + var chars = []; + var expected = []; + for (var i = 0; i < 5e3; i++) { + chars.push(' ' + i); + + expected.push('%20' + i); + } + + var obj = { + foo: chars.join('') + }; + + st.equal( + qs.stringify(obj, { arrayFormat: 'brackets', charset: 'utf-8' }), + 'foo=' + expected.join('') + ); + + st.end(); + }); + + t.end(); +}); + +test('stringifies empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), + testCase.stringifyOutput.indices, + 'test case: ' + testCase.input + ', indices' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), + testCase.stringifyOutput.brackets, + 'test case: ' + testCase.input + ', brackets' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), + testCase.stringifyOutput.repeat, + 'test case: ' + testCase.input + ', repeat' + ); + + st.end(); + }); + }); + + t.test('edge case with object/arrays', function (st) { + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); + + st.end(); + }); + + t.test('stringifies non-string keys', function (st) { + var S = Object('abc'); + S.toString = function () { + return 'd'; + }; + var actual = qs.stringify({ a: 'b', 'false': {}, 1e+22: 'c', d: 'e' }, { + filter: ['a', false, null, 10000000000000000000000, S], + allowDots: true, + encodeDotInKeys: true + }); + + st.equal(actual, 'a=b&1e%2B22=c&d=e', 'stringifies correctly'); + + st.end(); + }); + + t.test('round-trips keys containing percent-encoded bracket text', function (st) { + var cases = [ + { 'a%5Bb': 'c' }, + { 'a%5Db': 'c' }, + { 'a%255Bb': 'c' }, + { 'a%255Db': 'c' }, + { a: { 'b%5Bc': 'd' } }, + { a: { 'b%255Bc': 'd' } }, + { 'a%5B%255Bb': 'c' } + ]; + for (var i = 0; i < cases.length; i++) { + st.deepEqual( + qs.parse(qs.stringify(cases[i])), + cases[i], + 'round-trips ' + JSON.stringify(cases[i]) + ); + } + + st.end(); + }); + + t.test('parses input containing percent-encoded bracket text without mangling', function (st) { + st.deepEqual(qs.parse('a%25255Bb=c'), { 'a%255Bb': 'c' }, 'a%25255Bb decodes to a%255Bb, not a%5Bb'); + st.deepEqual(qs.parse('a%25255Db=c'), { 'a%255Db': 'c' }, 'a%25255Db decodes to a%255Db, not a%5Db'); + st.deepEqual(qs.parse('a%5Bb%25255Bc%5D=d'), { a: { 'b%255Bc': 'd' } }, 'nested %25255B decodes to %255B inside segment, not %5B'); + + st.end(); + }); + + t.test('limits nesting depth with the `depth` option', function (st) { + st.equal( + qs.stringify({ a: { b: { c: 'd' } } }), + 'a%5Bb%5D%5Bc%5D=d', + 'the default depth is unlimited and does not alter output' + ); + st.equal( + qs.stringify({ a: { b: { c: 'd' } } }, { depth: 2 }), + 'a%5Bb%5D%5Bc%5D=d', + 'does not throw when nesting is within the depth limit' + ); + st.equal( + qs.stringify({ a: { b: 'c' } }, { depth: Infinity }), + 'a%5Bb%5D=c', + 'an explicit Infinity depth is unlimited' + ); + st.equal( + qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: null }), + qs.stringify({ a: { b: { c: { d: 'e' } } } }), + 'a non-number depth is ignored and treated as unlimited' + ); + st.equal( + qs.stringify({ a: 'b' }, { depth: 0 }), + 'a=b', + 'a flat object serializes with a depth of 0' + ); + + var deep = {}; + var cursor = deep; + for (var i = 0; i < 250; i++) { + cursor.a = {}; + cursor = cursor.a; + } + cursor.b = 'c'; + st.equal(typeof qs.stringify(deep), 'string', 'the default depth serializes deeply nested objects without throwing'); + + st['throws']( + function () { qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: 2 }); }, + RangeError, + 'throws a RangeError when nesting exceeds the depth limit' + ); + st['throws']( + function () { qs.stringify({ a: { b: 'c' } }, { depth: 0 }); }, + RangeError, + 'a depth of 0 throws for any nested object' + ); + + var caught; + try { + qs.stringify({ a: { b: { c: { d: 'e' } } } }, { depth: 2 }); + } catch (e) { + caught = e; + } + st.ok(caught instanceof RangeError, 'the thrown value is a RangeError'); + st.equal(caught.message, 'Input depth exceeded depth option of 2', 'the RangeError names the exceeded depth'); + + st.end(); + }); +}); diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/utils.js b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/utils.js new file mode 100644 index 00000000..2bc1b8a1 --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/qs/test/utils.js @@ -0,0 +1,638 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var SaferBuffer = require('safer-buffer').Buffer; +var forEach = require('for-each'); +var v = require('es-value-fixtures'); + +var utils = require('../lib/utils'); + +test('merge()', function (t) { + t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); + + t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); + + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + + var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); + t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); + + var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); + t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); + + var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); + t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); + + var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); + t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); + + var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); + t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); + + var func = function f() {}; + func(); + t.deepEqual( + utils.merge(func, { foo: 'bar' }), + [func, { foo: 'bar' }], + 'functions can not be merged into' + ); + + func.bar = 'baz'; + t.deepEqual( + utils.merge({ foo: 'bar' }, func), + { foo: 'bar', bar: 'baz' }, + 'functions can be merge sources' + ); + + t.test( + 'avoids invoking array setters unnecessarily', + { skip: typeof Object.defineProperty !== 'function' }, + function (st) { + var setCount = 0; + var getCount = 0; + var observed = []; + Object.defineProperty(observed, 0, { + get: function () { + getCount += 1; + return { bar: 'baz' }; + }, + set: function () { setCount += 1; } + }); + utils.merge(observed, [null]); + st.equal(setCount, 0); + st.equal(getCount, 1); + observed[0] = observed[0]; // eslint-disable-line no-self-assign + st.equal(setCount, 1); + st.equal(getCount, 2); + + st.end(); + } + ); + + t.test('with overflow objects (from arrayLimit)', function (st) { + // arrayLimit is max index, so with limit 0, max index 0 is allowed (1 element) + // To create overflow, need 2+ elements with limit 0, or 3+ with limit 1, etc. + st.test('merges primitive into overflow object at next index', function (s2t) { + // Create an overflow object via combine: 3 elements (indices 0-2) with limit 0 + var overflow = utils.combine(['a', 'b'], 'c', 0, false); + s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); + var merged = utils.merge(overflow, 'd'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'adds primitive at next numeric index'); + + s2t.end(); + }); + + st.test('merges primitive into regular object with numeric keys normally', function (s2t) { + var obj = { 0: 'a', 1: 'b' }; + s2t.notOk(utils.isOverflow(obj), 'plain object is not marked as overflow'); + var merged = utils.merge(obj, 'c'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', c: true }, 'adds primitive as key (not at next index)'); + s2t.end(); + }); + + st.test('merges primitive into object with non-numeric keys normally', function (s2t) { + var obj = { foo: 'bar' }; + var merged = utils.merge(obj, 'baz'); + s2t.deepEqual(merged, { foo: 'bar', baz: true }, 'adds primitive as key with value true'); + + s2t.end(); + }); + + st.test('with strictMerge, wraps object and primitive in array', function (s2t) { + var obj = { foo: 'bar' }; + var merged = utils.merge(obj, 'baz', { strictMerge: true }); + s2t.deepEqual(merged, [{ foo: 'bar' }, 'baz'], 'wraps in array with strictMerge'); + s2t.end(); + }); + + st.test('merges overflow object into primitive', function (s2t) { + // Create an overflow object via combine: 2 elements (indices 0-1) with limit 0 + var overflow = utils.combine(['a'], 'b', 0, false); + s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); + var merged = utils.merge('c', overflow); + s2t.ok(utils.isOverflow(merged), 'result is also marked as overflow'); + s2t.deepEqual(merged, { 0: 'c', 1: 'a', 2: 'b' }, 'creates object with primitive at 0, source values shifted'); + + s2t.end(); + }); + + st.test('merges overflow object into primitive with plainObjects', function (s2t) { + var overflow = utils.combine(['a'], 'b', 0, false); + s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); + var merged = utils.merge('c', overflow, { plainObjects: true }); + s2t.ok(utils.isOverflow(merged), 'result is also marked as overflow'); + s2t.deepEqual(merged, { __proto__: null, 0: 'c', 1: 'a', 2: 'b' }, 'creates null-proto object with primitive at 0'); + + s2t.end(); + }); + + st.test('merges overflow object with multiple values into primitive', function (s2t) { + // Create an overflow object via combine: 3 elements (indices 0-2) with limit 0 + var overflow = utils.combine(['b', 'c'], 'd', 0, false); + s2t.ok(utils.isOverflow(overflow), 'overflow object is marked'); + var merged = utils.merge('a', overflow); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'shifts all source indices by 1'); + + s2t.end(); + }); + + st.test('merges regular object into primitive as array', function (s2t) { + var obj = { foo: 'bar' }; + var merged = utils.merge('a', obj); + s2t.deepEqual(merged, ['a', { foo: 'bar' }], 'creates array with primitive and object'); + + s2t.end(); + }); + + st.test('merges primitive into array that exceeds arrayLimit', function (s2t) { + var arr = ['a', 'b', 'c']; + var merged = utils.merge(arr, 'd', { arrayLimit: 1 }); + s2t.ok(utils.isOverflow(merged), 'result is marked as overflow'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'converts to overflow object with primitive appended'); + + s2t.end(); + }); + + st.test('merges array into primitive that exceeds arrayLimit', function (s2t) { + var merged = utils.merge('a', ['b', 'c'], { arrayLimit: 1 }); + s2t.ok(utils.isOverflow(merged), 'result is marked as overflow'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c' }, 'converts to overflow object'); + + s2t.end(); + }); + + st.test('merges primitive into array at the arrayLimit boundary, consistently with combine', function (s2t) { + var merged = utils.merge(['a'], 'b', { arrayLimit: 1 }); + s2t.ok(utils.isOverflow(merged), 'result is marked as overflow at the boundary'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b' }, 'converts to overflow object instead of a length-2 array'); + + s2t.end(); + }); + + st.test('merges two arrays that exceed arrayLimit into an overflow object', function (s2t) { + var merged = utils.merge(['a'], ['b'], { arrayLimit: 1 }); + s2t.ok(utils.isOverflow(merged), 'result is marked as overflow'); + s2t.deepEqual(merged, { 0: 'a', 1: 'b' }, 'array-into-array merge enforces arrayLimit like combine'); + + s2t.end(); + }); + + st.test('throws at the arrayLimit boundary when merging a primitive into an array with throwOnLimitExceeded', function (s2t) { + s2t['throws']( + function () { utils.merge(['a'], 'b', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'throws when the resulting length would exceed arrayLimit' + ); + + s2t.end(); + }); + + st.test('throws when merging two arrays past arrayLimit with throwOnLimitExceeded', function (s2t) { + s2t['throws']( + function () { utils.merge(['a'], ['b'], { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'array-into-array merge throws rather than silently exceeding arrayLimit' + ); + s2t['throws']( + function () { utils.merge(['a', 'b', 'c'], ['d', 'e', 'f'], { arrayLimit: 2, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 2 elements allowed in an array.'), + 'uses the plural message when arrayLimit is not 1' + ); + + s2t.end(); + }); + + st.test('throws instead of merging primitive into over-limit array when throwOnLimitExceeded is set', function (s2t) { + s2t['throws']( + function () { utils.merge(['a', 'b', 'c'], 'd', { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'throws rather than converting to an overflow object' + ); + s2t['throws']( + function () { utils.merge(['a', 'b', 'c'], 'd', { arrayLimit: 2, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 2 elements allowed in an array.'), + 'uses the plural message when arrayLimit is not 1' + ); + + s2t.end(); + }); + + st.test('throws instead of merging array into primitive when throwOnLimitExceeded is set', function (s2t) { + s2t['throws']( + function () { utils.merge('a', ['b', 'c'], { arrayLimit: 1, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'throws rather than converting to an overflow object' + ); + s2t['throws']( + function () { utils.merge('a', ['b', 'c', 'd'], { arrayLimit: 2, throwOnLimitExceeded: true }); }, + new RangeError('Array limit exceeded. Only 2 elements allowed in an array.'), + 'uses the plural message when arrayLimit is not 1' + ); + + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('assign()', function (t) { + var target = { a: 1, b: 2 }; + var source = { b: 3, c: 4 }; + var result = utils.assign(target, source); + + t.equal(result, target, 'returns the target'); + t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); + t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); + + t.end(); +}); + +test('combine()', function (t) { + t.test('both arrays', function (st) { + var a = [1]; + var b = [2]; + var combined = utils.combine(a, b); + + st.deepEqual(a, [1], 'a is not mutated'); + st.deepEqual(b, [2], 'b is not mutated'); + st.notEqual(a, combined, 'a !== combined'); + st.notEqual(b, combined, 'b !== combined'); + st.deepEqual(combined, [1, 2], 'combined is a + b'); + + st.end(); + }); + + t.test('one array, one non-array', function (st) { + var aN = 1; + var a = [aN]; + var bN = 2; + var b = [bN]; + + var combinedAnB = utils.combine(aN, b); + st.deepEqual(b, [bN], 'b is not mutated'); + st.notEqual(aN, combinedAnB, 'aN + b !== aN'); + st.notEqual(a, combinedAnB, 'aN + b !== a'); + st.notEqual(bN, combinedAnB, 'aN + b !== bN'); + st.notEqual(b, combinedAnB, 'aN + b !== b'); + st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); + + var combinedABn = utils.combine(a, bN); + st.deepEqual(a, [aN], 'a is not mutated'); + st.notEqual(aN, combinedABn, 'a + bN !== aN'); + st.notEqual(a, combinedABn, 'a + bN !== a'); + st.notEqual(bN, combinedABn, 'a + bN !== bN'); + st.notEqual(b, combinedABn, 'a + bN !== b'); + st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); + + st.end(); + }); + + t.test('neither is an array', function (st) { + var combined = utils.combine(1, 2); + st.notEqual(1, combined, '1 + 2 !== 1'); + st.notEqual(2, combined, '1 + 2 !== 2'); + st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); + + st.end(); + }); + + t.test('with arrayLimit', function (st) { + st.test('under the limit', function (s2t) { + var combined = utils.combine(['a', 'b'], 'c', 10, false); + s2t.deepEqual(combined, ['a', 'b', 'c'], 'returns array when under limit'); + s2t.ok(Array.isArray(combined), 'result is an array'); + s2t.end(); + }); + + st.test('exactly at the limit stays as array', function (s2t) { + var combined = utils.combine(['a', 'b'], 'c', 3, false); + s2t.deepEqual(combined, ['a', 'b', 'c'], 'stays as array when count equals limit'); + s2t.ok(Array.isArray(combined), 'result is an array'); + s2t.end(); + }); + + st.test('over the limit', function (s2t) { + var combined = utils.combine(['a', 'b', 'c'], 'd', 3, false); + s2t.deepEqual(combined, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'converts to object when over limit'); + s2t.notOk(Array.isArray(combined), 'result is not an array'); + s2t.end(); + }); + + st.test('with arrayLimit 1', function (s2t) { + var combined = utils.combine([], 'a', 1, false); + s2t.deepEqual(combined, ['a'], 'stays as array when count equals limit'); + s2t.ok(Array.isArray(combined), 'result is an array'); + s2t.end(); + }); + + st.test('with arrayLimit 0 converts single element to object', function (s2t) { + var combined = utils.combine([], 'a', 0, false); + s2t.deepEqual(combined, { 0: 'a' }, 'converts to object when count exceeds limit'); + s2t.notOk(Array.isArray(combined), 'result is not an array'); + s2t.end(); + }); + + st.test('with arrayLimit 0 and two elements converts to object', function (s2t) { + var combined = utils.combine(['a'], 'b', 0, false); + s2t.deepEqual(combined, { 0: 'a', 1: 'b' }, 'converts to object when count exceeds limit'); + s2t.notOk(Array.isArray(combined), 'result is not an array'); + s2t.end(); + }); + + st.test('with plainObjects option', function (s2t) { + var combined = utils.combine(['a', 'b'], 'c', 1, true); + var expected = { __proto__: null, 0: 'a', 1: 'b', 2: 'c' }; + s2t.deepEqual(combined, expected, 'converts to object with null prototype'); + s2t.equal(Object.getPrototypeOf(combined), null, 'result has null prototype when plainObjects is true'); + s2t.end(); + }); + + st.end(); + }); + + t.test('with throwOnLimitExceeded', function (st) { + st.test('throws when concatenation exceeds the limit', function (s2t) { + s2t['throws']( + function () { utils.combine(['a', 'b', 'c'], 'd', 3, false, true); }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws instead of converting to an overflow object' + ); + s2t['throws']( + function () { utils.combine([], 'a', 0, false, true); }, + new RangeError('Array limit exceeded. Only 0 elements allowed in an array.'), + 'throws with the correct count at arrayLimit 0' + ); + s2t.end(); + }); + + st.test('throws when adding to an existing overflow object', function (s2t) { + var overflow = utils.combine(['a', 'b'], 'c', 0, false); + s2t.ok(utils.isOverflow(overflow), 'initial object is marked as overflow'); + + s2t['throws']( + function () { utils.combine(overflow, 'd', 0, false, true); }, + new RangeError('Array limit exceeded. Only 0 elements allowed in an array.'), + 'throws rather than appending to the overflow object' + ); + s2t['throws']( + function () { utils.combine(overflow, 'd', 1, false, true); }, + new RangeError('Array limit exceeded. Only 1 element allowed in an array.'), + 'uses the singular message at arrayLimit 1' + ); + s2t.end(); + }); + + st.test('does not throw when within the limit', function (s2t) { + var combined = utils.combine(['a'], 'b', 5, false, true); + s2t.deepEqual(combined, ['a', 'b'], 'returns the array unchanged when under the limit'); + s2t.end(); + }); + + st.end(); + }); + + t.test('with existing overflow object', function (st) { + st.test('adds to existing overflow object at next index', function (s2t) { + // Create overflow object first via combine: 3 elements (indices 0-2) with limit 0 + var overflow = utils.combine(['a', 'b'], 'c', 0, false); + s2t.ok(utils.isOverflow(overflow), 'initial object is marked as overflow'); + + var combined = utils.combine(overflow, 'd', 10, false); + s2t.equal(combined, overflow, 'returns the same object (mutated)'); + s2t.deepEqual(combined, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'adds value at next numeric index'); + s2t.end(); + }); + + st.test('does not treat plain object with numeric keys as overflow', function (s2t) { + var plainObj = { 0: 'a', 1: 'b' }; + s2t.notOk(utils.isOverflow(plainObj), 'plain object is not marked as overflow'); + + // combine treats this as a regular value, not an overflow object to append to + var combined = utils.combine(plainObj, 'c', 10, false); + s2t.deepEqual(combined, [{ 0: 'a', 1: 'b' }, 'c'], 'concatenates as regular values'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('decode', function (t) { + t.equal( + utils.decode('a+b'), + 'a b', + 'decodes + to space' + ); + + t.equal( + utils.decode('name%2Eobj'), + 'name.obj', + 'decodes a string' + ); + t.equal( + utils.decode('name%2Eobj%2Efoo', null, 'iso-8859-1'), + 'name.obj.foo', + 'decodes a string in iso-8859-1' + ); + + t.end(); +}); + +test('encode', function (t) { + forEach(v.nullPrimitives, function (nullish) { + t['throws']( + function () { utils.encode(nullish); }, + TypeError, + inspect(nullish) + ' is not a string' + ); + }); + + t.equal(utils.encode(''), '', 'empty string returns itself'); + t.deepEqual(utils.encode([]), [], 'empty array returns itself'); + t.deepEqual(utils.encode({ length: 0 }), { length: 0 }, 'empty arraylike returns itself'); + + t.test('symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(utils.encode(Symbol('x')), 'Symbol%28x%29', 'symbol is encoded'); + + st.end(); + }); + + t.equal( + utils.encode('(abc)'), + '%28abc%29', + 'encodes parentheses' + ); + t.equal( + utils.encode({ toString: function () { return '(abc)'; } }), + '%28abc%29', + 'toStrings and encodes parentheses' + ); + + t.equal( + utils.encode('abc 123 💩', null, 'iso-8859-1'), + 'abc%20123%20%26%2355357%3B%26%2356489%3B', + 'encodes in iso-8859-1' + ); + + var longString = ''; + var expectedString = ''; + for (var i = 0; i < 1500; i++) { + longString += ' '; + expectedString += '%20'; + } + + t.equal( + utils.encode(longString), + expectedString, + 'encodes a long string' + ); + + var boundary = ''; + var expected = ''; + for (var j = 0; j < 1023; j++) { + boundary += 'a'; + expected += 'a'; + } + boundary += '😀'; + expected += '%F0%9F%98%80'; + + t.equal( + utils.encode(boundary), + expected, + 'encodes a surrogate pair split across long-string chunks' + ); + + var laterBoundary = ''; + var laterExpected = ''; + for (var k = 0; k < 2047; k++) { + laterBoundary += 'a'; + laterExpected += 'a'; + } + laterBoundary += '😀'; + laterExpected += '%F0%9F%98%80'; + + t.equal( + utils.encode(laterBoundary), + laterExpected, + 'encodes a surrogate pair split across a later chunk boundary' + ); + + var twoPairs = ''; + for (k = 0; k < 1023; k++) { + twoPairs += 'a'; + } + twoPairs += '😀'; + for (k = 0; k < 1022; k++) { + twoPairs += 'b'; + } + twoPairs += '😀'; + + t.equal( + (utils.encode(twoPairs).match(/%F0%9F%98%80/g) || []).length, + 2, + 'encodes two surrogate pairs each split across a chunk boundary' + ); + + var roundTrip = ''; + for (k = 0; k < 1023; k++) { + roundTrip += 'a'; + } + roundTrip += '😀'; + + t.equal( + decodeURIComponent(utils.encode(roundTrip)), + roundTrip, + 'a boundary-split surrogate pair round-trips through decodeURIComponent' + ); + + var loneBoundary = ''; + var loneExpected = ''; + for (k = 0; k < 1023; k++) { + loneBoundary += 'a'; + loneExpected += 'a'; + } + loneBoundary += '\uD83DX'; + loneExpected += '%F0%9F%91%98'; + + t.equal( + utils.encode(loneBoundary), + loneExpected, + 'a lone high surrogate at a chunk boundary encodes the same as mid-chunk' + ); + + t.equal( + utils.encode('\x28\x29'), + '%28%29', + 'encodes parens normally' + ); + t.equal( + utils.encode('\x28\x29', null, null, null, 'RFC1738'), + '()', + 'does not encode parens in RFC1738' + ); + + // todo RFC1738 format + + t.equal( + utils.encode('Āက豈'), + '%C4%80%E1%80%80%EF%A4%80', + 'encodes multibyte chars' + ); + + t.equal( + utils.encode('\uD83D \uDCA9'), + '%F0%9F%90%A0%F0%BA%90%80', + 'encodes lone surrogates' + ); + + t.end(); +}); + +test('isBuffer()', function (t) { + var fn = function () {}; + fn(); + forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], fn, /a/g], function (x) { + t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); + }); + + var fakeBuffer = { constructor: Buffer }; + t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); + + forEach(['x', 1, true, {}, [], { isBuffer: true }], function (notCallable) { + var obj = { constructor: { isBuffer: notCallable } }; + t.doesNotThrow(function () { utils.isBuffer(obj); }, 'non-callable `constructor.isBuffer` (' + inspect(notCallable) + ') does not throw'); + t.equal(utils.isBuffer(obj), false, 'non-callable `constructor.isBuffer` (' + inspect(notCallable) + ') is not a buffer'); + }); + + var nullObject = { __proto__: null, constructor: { __proto__: null, isBuffer: 'y' } }; + t.equal(utils.isBuffer(nullObject), false, 'null object with non-callable `constructor.isBuffer` is not a buffer'); + + var duckBuffer = { constructor: { isBuffer: function () { return true; } } }; + t.equal(utils.isBuffer(duckBuffer), true, 'callable `constructor.isBuffer` is still honored'); + + var saferBuffer = SaferBuffer.from('abc'); + t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); + + var buffer = SaferBuffer.from('abc'); + t.notEqual(saferBuffer, buffer, 'different buffer instances'); + t.equal(utils.isBuffer(buffer), true, 'another Buffer instance is a buffer'); + t.end(); +}); + +test('isRegExp()', function (t) { + t.equal(utils.isRegExp(/a/g), true, 'RegExp is a RegExp'); + t.equal(utils.isRegExp(new RegExp('a', 'g')), true, 'new RegExp is a RegExp'); + t.equal(utils.isRegExp(new Date()), false, 'Date is not a RegExp'); + + forEach(v.primitives, function (primitive) { + t.equal(utils.isRegExp(primitive), false, inspect(primitive) + ' is not a RegExp'); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/qs@6.16.0/node_modules/side-channel b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/side-channel new file mode 120000 index 00000000..91461c4b --- /dev/null +++ b/backend/node_modules/.pnpm/qs@6.16.0/node_modules/side-channel @@ -0,0 +1 @@ +../../side-channel@1.1.1/node_modules/side-channel \ No newline at end of file diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/bytes b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/bytes new file mode 120000 index 00000000..e5d8785b --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/bytes @@ -0,0 +1 @@ +../../bytes@3.1.2/node_modules/bytes \ No newline at end of file diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/http-errors b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/http-errors new file mode 120000 index 00000000..f0620318 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/http-errors @@ -0,0 +1 @@ +../../http-errors@2.0.1/node_modules/http-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/iconv-lite b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/iconv-lite new file mode 120000 index 00000000..b029e037 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/iconv-lite @@ -0,0 +1 @@ +../../iconv-lite@0.7.3/node_modules/iconv-lite \ No newline at end of file diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/LICENSE b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/LICENSE new file mode 100644 index 00000000..1029a7a7 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2013-2014 Jonathan Ong +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/README.md b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/README.md new file mode 100644 index 00000000..d9b36d61 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/README.md @@ -0,0 +1,223 @@ +# raw-body + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build status][github-actions-ci-image]][github-actions-ci-url] +[![Test coverage][coveralls-image]][coveralls-url] + +Gets the entire buffer of a stream either as a `Buffer` or a string. +Validates the stream's length against an expected length and maximum limit. +Ideal for parsing request bodies. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install raw-body +``` + +### TypeScript + +This module includes a [TypeScript](https://www.typescriptlang.org/) +declaration file to enable auto complete in compatible editors and type +information for TypeScript projects. This module depends on the Node.js +types, so install `@types/node`: + +```sh +$ npm install @types/node +``` + +## API + +```js +var getRawBody = require('raw-body') +``` + +### getRawBody(stream, [options], [callback]) + +**Returns a promise if no callback specified and global `Promise` exists.** + +Options: + +- `length` - The length of the stream. + If the contents of the stream do not add up to this length, + an `400` error code is returned. +- `limit` - The byte limit of the body. + This is the number of bytes or any string format supported by + [bytes](https://www.npmjs.com/package/bytes), + for example `1000`, `'500kb'` or `'3mb'`. + If the body ends up being larger than this limit, + a `413` error code is returned. +- `encoding` - The encoding to use to decode the body into a string. + By default, a `Buffer` instance will be returned when no encoding is specified. + Most likely, you want `utf-8`, so setting `encoding` to `true` will decode as `utf-8`. + You can use any type of encoding supported by [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme). + +You can also pass a string in place of options to just specify the encoding. + +If an error occurs, the stream will be paused, everything unpiped, +and you are responsible for correctly disposing the stream. +For HTTP requests, you may need to finish consuming the stream if +you want to keep the socket open for future requests. For streams +that use file descriptors, you should `stream.destroy()` or +`stream.close()` to prevent leaks. + +## Errors + +This module creates errors depending on the error condition during reading. +The error may be an error from the underlying Node.js implementation, but is +otherwise an error created by this module, which has the following attributes: + + * `limit` - the limit in bytes + * `length` and `expected` - the expected length of the stream + * `received` - the received bytes + * `encoding` - the invalid encoding + * `status` and `statusCode` - the corresponding status code for the error + * `type` - the error type + +### Types + +The errors from this module have a `type` property which allows for the programmatic +determination of the type of error returned. + +#### encoding.unsupported + +This error will occur when the `encoding` option is specified, but the value does +not map to an encoding supported by the [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme) +module. + +#### entity.too.large + +This error will occur when the `limit` option is specified, but the stream has +an entity that is larger. + +#### request.aborted + +This error will occur when the request stream is aborted by the client before +reading the body has finished. + +#### request.size.invalid + +This error will occur when the `length` option is specified, but the stream has +emitted more bytes. + +#### stream.encoding.set + +This error will occur when the given stream has an encoding set on it, making it +a decoded stream. The stream should not have an encoding set and is expected to +emit `Buffer` objects. + +#### stream.not.readable + +This error will occur when the given stream is not readable. + +## Examples + +### Simple Express example + +```js +var contentType = require('content-type') +var express = require('express') +var getRawBody = require('raw-body') + +var app = express() + +app.use(function (req, res, next) { + getRawBody(req, { + length: req.headers['content-length'], + limit: '1mb', + encoding: contentType.parse(req).parameters.charset + }, function (err, string) { + if (err) return next(err) + req.text = string + next() + }) +}) + +// now access req.text +``` + +### Simple Koa example + +```js +var contentType = require('content-type') +var getRawBody = require('raw-body') +var koa = require('koa') + +var app = koa() + +app.use(function * (next) { + this.text = yield getRawBody(this.req, { + length: this.req.headers['content-length'], + limit: '1mb', + encoding: contentType.parse(this.req).parameters.charset + }) + yield next +}) + +// now access this.text +``` + +### Using as a promise + +To use this library as a promise, simply omit the `callback` and a promise is +returned, provided that a global `Promise` is defined. + +```js +var getRawBody = require('raw-body') +var http = require('http') + +var server = http.createServer(function (req, res) { + getRawBody(req) + .then(function (buf) { + res.statusCode = 200 + res.end(buf.length + ' bytes submitted') + }) + .catch(function (err) { + res.statusCode = 500 + res.end(err.message) + }) +}) + +server.listen(3000) +``` + +### Using with TypeScript + +```ts +import * as getRawBody from 'raw-body'; +import * as http from 'http'; + +const server = http.createServer((req, res) => { + getRawBody(req) + .then((buf) => { + res.statusCode = 200; + res.end(buf.length + ' bytes submitted'); + }) + .catch((err) => { + res.statusCode = err.statusCode; + res.end(err.message); + }); +}); + +server.listen(3000); +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/raw-body.svg +[npm-url]: https://npmjs.org/package/raw-body +[node-version-image]: https://img.shields.io/node/v/raw-body.svg +[node-version-url]: https://nodejs.org/en/download/ +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/raw-body/master.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/raw-body?branch=master +[downloads-image]: https://img.shields.io/npm/dm/raw-body.svg +[downloads-url]: https://npmjs.org/package/raw-body +[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/stream-utils/raw-body/ci.yml?branch=master&label=ci +[github-actions-ci-url]: https://github.com/jshttp/stream-utils/raw-body?query=workflow%3Aci diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.d.ts b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.d.ts new file mode 100644 index 00000000..b5046118 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.d.ts @@ -0,0 +1,85 @@ +declare namespace getRawBody { + export type Encoding = string | true; + + export interface Options { + /** + * The expected length of the stream. + */ + length?: number | string | null; + /** + * The byte limit of the body. This is the number of bytes or any string + * format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`. + */ + limit?: number | string | null; + /** + * The encoding to use to decode the body into a string. By default, a + * `Buffer` instance will be returned when no encoding is specified. Most + * likely, you want `utf-8`, so setting encoding to `true` will decode as + * `utf-8`. You can use any type of encoding supported by `iconv-lite`. + */ + encoding?: Encoding | null; + } + + export interface RawBodyError extends Error { + /** + * The limit in bytes. + */ + limit?: number; + /** + * The expected length of the stream. + */ + length?: number; + expected?: number; + /** + * The received bytes. + */ + received?: number; + /** + * The encoding. + */ + encoding?: string; + /** + * The corresponding status code for the error. + */ + status: number; + statusCode: number; + /** + * The error type. + */ + type: string; + } +} + +/** + * Gets the entire buffer of a stream either as a `Buffer` or a string. + * Validates the stream's length against an expected length and maximum + * limit. Ideal for parsing request bodies. + */ +declare function getRawBody( + stream: NodeJS.ReadableStream, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding, + callback: (err: getRawBody.RawBodyError, body: string) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: getRawBody.Options, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding +): Promise; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options?: getRawBody.Options +): Promise; + +export = getRawBody; diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.js b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.js new file mode 100644 index 00000000..9cdcd122 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/index.js @@ -0,0 +1,336 @@ +/*! + * raw-body + * Copyright(c) 2013-2014 Jonathan Ong + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var asyncHooks = tryRequireAsyncHooks() +var bytes = require('bytes') +var createError = require('http-errors') +var iconv = require('iconv-lite') +var unpipe = require('unpipe') + +/** + * Module exports. + * @public + */ + +module.exports = getRawBody + +/** + * Module variables. + * @private + */ + +var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: / + +/** + * Get the decoder for a given encoding. + * + * @param {string} encoding + * @private + */ + +function getDecoder (encoding) { + if (!encoding) return null + + try { + return iconv.getDecoder(encoding) + } catch (e) { + // error getting decoder + if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e + + // the encoding was not found + throw createError(415, 'specified encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } +} + +/** + * Get the raw body of a stream (typically HTTP). + * + * @param {object} stream + * @param {object|string|function} [options] + * @param {function} [callback] + * @public + */ + +function getRawBody (stream, options, callback) { + var done = callback + var opts = options || {} + + // light validation + if (stream === undefined) { + throw new TypeError('argument stream is required') + } else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') { + throw new TypeError('argument stream must be a stream') + } + + if (options === true || typeof options === 'string') { + // short cut for encoding + opts = { + encoding: options + } + } + + if (typeof options === 'function') { + done = options + opts = {} + } + + // validate callback is a function, if provided + if (done !== undefined && typeof done !== 'function') { + throw new TypeError('argument callback must be a function') + } + + // require the callback without promises + if (!done && !global.Promise) { + throw new TypeError('argument callback is required') + } + + // get encoding + var encoding = opts.encoding !== true + ? opts.encoding + : 'utf-8' + + // convert the limit to an integer + var limit = bytes.parse(opts.limit) + + // convert the expected length to an integer + var length = opts.length != null && !isNaN(opts.length) + ? parseInt(opts.length, 10) + : null + + if (done) { + // classic callback style + return readStream(stream, encoding, length, limit, wrap(done)) + } + + return new Promise(function executor (resolve, reject) { + readStream(stream, encoding, length, limit, function onRead (err, buf) { + if (err) return reject(err) + resolve(buf) + }) + }) +} + +/** + * Halt a stream. + * + * @param {Object} stream + * @private + */ + +function halt (stream) { + // unpipe everything from the stream + unpipe(stream) + + // pause stream + if (typeof stream.pause === 'function') { + stream.pause() + } +} + +/** + * Read the data from the stream. + * + * @param {object} stream + * @param {string} encoding + * @param {number} length + * @param {number} limit + * @param {function} callback + * @public + */ + +function readStream (stream, encoding, length, limit, callback) { + var complete = false + var sync = true + + // check the length and limit options. + // note: we intentionally leave the stream paused, + // so users should handle the stream themselves. + if (limit !== null && length !== null && length > limit) { + return done(createError(413, 'request entity too large', { + expected: length, + length: length, + limit: limit, + type: 'entity.too.large' + })) + } + + // streams1: assert request encoding is buffer. + // streams2+: assert the stream encoding is buffer. + // stream._decoder: streams1 + // state.encoding: streams2 + // state.decoder: streams2, specifically < 0.10.6 + var state = stream._readableState + if (stream._decoder || (state && (state.encoding || state.decoder))) { + // developer error + return done(createError(500, 'stream encoding should not be set', { + type: 'stream.encoding.set' + })) + } + + if (typeof stream.readable !== 'undefined' && !stream.readable) { + return done(createError(500, 'stream is not readable', { + type: 'stream.not.readable' + })) + } + + var received = 0 + var decoder + + try { + decoder = getDecoder(encoding) + } catch (err) { + return done(err) + } + + var buffer = decoder + ? '' + : [] + + // attach listeners + stream.on('aborted', onAborted) + stream.on('close', cleanup) + stream.on('data', onData) + stream.on('end', onEnd) + stream.on('error', onEnd) + + // mark sync section complete + sync = false + + function done () { + var args = new Array(arguments.length) + + // copy arguments + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + // mark complete + complete = true + + if (sync) { + process.nextTick(invokeCallback) + } else { + invokeCallback() + } + + function invokeCallback () { + cleanup() + + if (args[0]) { + // halt the stream on error + halt(stream) + } + + callback.apply(null, args) + } + } + + function onAborted () { + if (complete) return + + done(createError(400, 'request aborted', { + code: 'ECONNABORTED', + expected: length, + length: length, + received: received, + type: 'request.aborted' + })) + } + + function onData (chunk) { + if (complete) return + + received += chunk.length + + if (limit !== null && received > limit) { + done(createError(413, 'request entity too large', { + limit: limit, + received: received, + type: 'entity.too.large' + })) + } else if (decoder) { + buffer += decoder.write(chunk) + } else { + buffer.push(chunk) + } + } + + function onEnd (err) { + if (complete) return + if (err) return done(err) + + if (length !== null && received !== length) { + done(createError(400, 'request size did not match content length', { + expected: length, + length: length, + received: received, + type: 'request.size.invalid' + })) + } else { + var string = decoder + ? buffer + (decoder.end() || '') + : Buffer.concat(buffer) + done(null, string) + } + } + + function cleanup () { + buffer = null + + stream.removeListener('aborted', onAborted) + stream.removeListener('data', onData) + stream.removeListener('end', onEnd) + stream.removeListener('error', onEnd) + stream.removeListener('close', cleanup) + } +} + +/** + * Try to require async_hooks + * @private + */ + +function tryRequireAsyncHooks () { + try { + return require('async_hooks') + } catch (e) { + return {} + } +} + +/** + * Wrap function with async resource, if possible. + * AsyncResource.bind static method backported. + * @private + */ + +function wrap (fn) { + var res + + // create anonymous resource + if (asyncHooks.AsyncResource) { + res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') + } + + // incompatible node.js + if (!res || !res.runInAsyncScope) { + return fn + } + + // return bound function + return res.runInAsyncScope.bind(res, fn, null) +} diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/package.json b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/package.json new file mode 100644 index 00000000..eab819f2 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/raw-body/package.json @@ -0,0 +1,46 @@ +{ + "name": "raw-body", + "description": "Get and validate the raw body of a readable stream.", + "version": "3.0.2", + "author": "Jonathan Ong (http://jongleberry.com)", + "contributors": [ + "Douglas Christopher Wilson ", + "Raynos " + ], + "license": "MIT", + "repository": "stream-utils/raw-body", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "devDependencies": { + "@stylistic/eslint-plugin": "^5.1.0", + "@stylistic/eslint-plugin-js": "^4.1.0", + "bluebird": "3.7.2", + "eslint": "^9.0.0", + "mocha": "10.7.0", + "neostandard": "^0.12.0", + "nyc": "17.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "README.md", + "index.d.ts", + "index.js" + ], + "scripts": { + "lint": "eslint", + "lint:fix": "eslint --fix", + "test": "mocha --trace-deprecation --reporter spec --check-leaks test/", + "test:ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test:cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/unpipe b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/unpipe new file mode 120000 index 00000000..011900f9 --- /dev/null +++ b/backend/node_modules/.pnpm/raw-body@3.0.2/node_modules/unpipe @@ -0,0 +1 @@ +../../unpipe@1.0.0/node_modules/unpipe \ No newline at end of file diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/License b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/License new file mode 100644 index 00000000..0b58de37 --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/License @@ -0,0 +1,21 @@ +Copyright (c) 2011: +Tim Koschützki (tim@debuggable.com) +Felix Geisendörfer (felix@debuggable.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/README.md b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/README.md new file mode 100644 index 00000000..6d541530 --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/README.md @@ -0,0 +1,227 @@ + +[![Build Status](https://secure.travis-ci.org/tim-kos/node-retry.svg?branch=master)](http://travis-ci.org/tim-kos/node-retry "Check this project's build status on TravisCI") +[![codecov](https://codecov.io/gh/tim-kos/node-retry/branch/master/graph/badge.svg)](https://codecov.io/gh/tim-kos/node-retry) + + +# retry + +Abstraction for exponential and custom retry strategies for failed operations. + +## Installation + + npm install retry + +## Current Status + +This module has been tested and is ready to be used. + +## Tutorial + +The example below will retry a potentially failing `dns.resolve` operation +`10` times using an exponential backoff strategy. With the default settings, this +means the last attempt is made after `17 minutes and 3 seconds`. + +``` javascript +var dns = require('dns'); +var retry = require('retry'); + +function faultTolerantResolve(address, cb) { + var operation = retry.operation(); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(err ? operation.mainError() : null, addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, addresses) { + console.log(err, addresses); +}); +``` + +Of course you can also configure the factors that go into the exponential +backoff. See the API documentation below for all available settings. +currentAttempt is an int representing the number of attempts so far. + +``` javascript +var operation = retry.operation({ + retries: 5, + factor: 3, + minTimeout: 1 * 1000, + maxTimeout: 60 * 1000, + randomize: true, +}); +``` + +## API + +### retry.operation([options]) + +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with three additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Whether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. +* `maxRetryTime`: The maximum time (in milliseconds) that the retried operation is allowed to run. Default is `Infinity`. + +### retry.timeouts([options]) + +Returns an array of timeouts. All time `options` and return values are in +milliseconds. If `options` is an array, a copy of that array is returned. + +`options` is a JS object that can contain any of the following keys: + +* `retries`: The maximum amount of times to retry the operation. Default is `10`. Seting this to `1` means `do it once, then retry it once`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. +* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. + +The formula used to calculate the individual timeouts is: + +``` +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) +``` + +Have a look at [this article][article] for a better explanation of approach. + +If you want to tune your `factor` / `times` settings to attempt the last retry +after a certain amount of time, you can use wolfram alpha. For example in order +to tune for `10` attempts in `5 minutes`, you can use this equation: + +![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) + +Explaining the various values from left to right: + +* `k = 0 ... 9`: The `retries` value (10) +* `1000`: The `minTimeout` value in ms (1000) +* `x^k`: No need to change this, `x` will be your resulting factor +* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) + +To make this a little easier for you, use wolfram alpha to do the calculations: + + + +[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html + +### retry.createTimeout(attempt, opts) + +Returns a new `timeout` (integer in milliseconds) based on the given parameters. + +`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). + +`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. + +`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). + +### retry.wrap(obj, [options], [methodNames]) + +Wrap all functions of the `obj` with retry. Optionally you can pass operation options and +an array of method names which need to be wrapped. + +``` +retry.wrap(obj) + +retry.wrap(obj, ['method1', 'method2']) + +retry.wrap(obj, {retries: 3}) + +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) +``` +The `options` object can take any options that the usual call to `retry.operation` can take. + +### new RetryOperation(timeouts, [options]) + +Creates a new `RetryOperation` where `timeouts` is an array where each value is +a timeout given in milliseconds. + +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. + +#### retryOperation.errors() + +Returns an array of all errors that have been passed to `retryOperation.retry()` so far. The +returning array has the errors ordered chronologically based on when they were passed to +`retryOperation.retry()`, which means the first passed error is at index zero and the last is +at the last index. + +#### retryOperation.mainError() + +A reference to the error object that occured most frequently. Errors are +compared using the `error.message` property. + +If multiple error messages occured the same amount of time, the last error +object with that message is returned. + +If no errors occured so far, the value is `null`. + +#### retryOperation.attempt(fn, timeoutOps) + +Defines the function `fn` that is to be retried and executes it for the first +time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. + +Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. +Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. + + +#### retryOperation.try(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.start(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.retry(error) + +Returns `false` when no `error` value is given, or the maximum amount of retries +has been reached. + +Otherwise it returns `true`, and retries the operation after the timeout for +the current attempt number. + +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + +#### retryOperation.reset() + +Resets the internal state of the operation object, so that you can call `attempt()` again as if this was a new operation object. + +#### retryOperation.attempts() + +Returns an int representing the number of attempts it took to call `fn` before it was successful. + +## License + +retry is licensed under the MIT license. + + +# Changelog + +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + +0.8.0 Implementing retry.wrap. + +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). + +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. + +0.5.0 Some minor refactoring. + +0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. + +0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). + +0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/dns.js b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/dns.js new file mode 100644 index 00000000..446729b6 --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/dns.js @@ -0,0 +1,31 @@ +var dns = require('dns'); +var retry = require('../lib/retry'); + +function faultTolerantResolve(address, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, errors, addresses) { + console.warn('err:'); + console.log(err); + + console.warn('addresses:'); + console.log(addresses); +}); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/stop.js b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/stop.js new file mode 100644 index 00000000..e1ceafee --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js new file mode 100644 index 00000000..ee62f3a1 --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js new file mode 100644 index 00000000..5e85e791 --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js @@ -0,0 +1,100 @@ +var RetryOperation = require('./retry_operation'); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && (options.forever || options.retries === Infinity), + unref: options && options.unref, + maxRetryTime: options && options.maxRetryTime + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper(original) { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments, 1); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }.bind(obj, original); + obj[method].options = options; + } +}; diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js new file mode 100644 index 00000000..105ce72b --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js @@ -0,0 +1,162 @@ +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); + this._timeouts = timeouts; + this._options = options || {}; + this._maxRetryTime = options && options.maxRetryTime || Infinity; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + this._operationStart = null; + this._timer = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.reset = function() { + this._attempts = 1; + this._timeouts = this._originalTimeouts.slice(0); +} + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + if (this._timer) { + clearTimeout(this._timer); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + var currentTime = new Date().getTime(); + if (err && currentTime - this._operationStart >= this._maxRetryTime) { + this._errors.push(err); + this._errors.unshift(new Error('RetryOperation timeout occurred')); + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(0, this._errors.length - 1); + timeout = this._cachedTimeouts.slice(-1); + } else { + return false; + } + } + + var self = this; + this._timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (self._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + this._timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._operationStart = new Date().getTime(); + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; diff --git a/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/package.json b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/package.json new file mode 100644 index 00000000..48f35e8c --- /dev/null +++ b/backend/node_modules/.pnpm/retry@0.13.1/node_modules/retry/package.json @@ -0,0 +1,36 @@ +{ + "author": "Tim Koschützki (http://debuggable.com/)", + "name": "retry", + "description": "Abstraction for exponential and custom retry strategies for failed operations.", + "license": "MIT", + "version": "0.13.1", + "homepage": "https://github.com/tim-kos/node-retry", + "repository": { + "type": "git", + "url": "git://github.com/tim-kos/node-retry.git" + }, + "files": [ + "lib", + "example" + ], + "directories": { + "lib": "./lib" + }, + "main": "index.js", + "engines": { + "node": ">= 4" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "istanbul": "^0.4.5", + "tape": "^4.8.0" + }, + "scripts": { + "test": "./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape ./test/integration/*.js", + "release:major": "env SEMANTIC=major npm run release", + "release:minor": "env SEMANTIC=minor npm run release", + "release:patch": "env SEMANTIC=patch npm run release", + "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish" + } +} diff --git a/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/LICENSE b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/LICENSE new file mode 100644 index 00000000..0c068cee --- /dev/null +++ b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/README.md b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/README.md new file mode 100644 index 00000000..e9a81afd --- /dev/null +++ b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.d.ts b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.d.ts new file mode 100644 index 00000000..e9fed809 --- /dev/null +++ b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js new file mode 100644 index 00000000..f8d3ec98 --- /dev/null +++ b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js @@ -0,0 +1,65 @@ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/package.json b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/package.json new file mode 100644 index 00000000..f2869e25 --- /dev/null +++ b/backend/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/package.json @@ -0,0 +1,51 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.2.1", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/LICENSE b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/LICENSE new file mode 100644 index 00000000..4fe9e6f1 --- /dev/null +++ b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Nikita Skovoroda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Porting-Buffer.md b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Porting-Buffer.md new file mode 100644 index 00000000..68d86bab --- /dev/null +++ b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Porting-Buffer.md @@ -0,0 +1,268 @@ +# Porting to the Buffer.from/Buffer.alloc API + + +## Overview + +- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) +- [Variant 2: Use a polyfill](#variant-2) +- [Variant 3: manual detection, with safeguards](#variant-3) + +### Finding problematic bits of code using grep + +Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. + +It will find all the potentially unsafe places in your own code (with some considerably unlikely +exceptions). + +### Finding problematic bits of code using Node.js 8 + +If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: + +- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. +- `--trace-deprecation` does the same thing, but only for deprecation warnings. +- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. + +You can set these flags using an environment variable: + +```console +$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' +$ cat example.js +'use strict'; +const foo = new Buffer('foo'); +$ node example.js +(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. + at showFlaggedDeprecation (buffer.js:127:13) + at new Buffer (buffer.js:148:3) + at Object. (/path/to/example.js:2:13) + [... more stack trace lines ...] +``` + +### Finding problematic bits of code using linters + +Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. + +There is a drawback, though, that it doesn't always +[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is +overriden e.g. with a polyfill, so recommended is a combination of this and some other method +described above. + + +## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. + +This is the recommended solution nowadays that would imply only minimal overhead. + +The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. + +What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: + +- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. +- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). +- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. + +Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than +`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended to avoid accidential unsafe Buffer API usage. + +There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) +for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. +Note that it currently only works with cases where the arguments are literals or where the +constructor is invoked with two arguments. + +_If you currently support those older Node.js versions and dropping them would be a semver-major change +for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) +or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive +the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and +your users will not observe a runtime deprecation warning when running your code on Node.js 10._ + + +## Variant 2: Use a polyfill + +Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older +Node.js versions. + +You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill +`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. + +Make sure that you do not use old `new Buffer` API — in any files where the line above is added, +using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. + +Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or +[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — +those are great, the only downsides being 4 deps in the tree and slightly more code changes to +migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only +`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. + +_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also +provides a polyfill, but takes a different approach which has +[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you +to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as +it is problematic, can cause issues in your code, and will start emitting runtime deprecation +warnings starting with Node.js 10._ + +Note that in either case, it is important that you also remove all calls to the old Buffer +API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides +a polyfill for the new API. I have seen people doing that mistake. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended. + +_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ + + +## Variant 3 — manual detection, with safeguards + +This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own +wrapper around them. + +### Buffer(0) + +This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which +returns the same result all the way down to Node.js 0.8.x. + +### Buffer(notNumber) + +Before: + +```js +var buf = new Buffer(notNumber, encoding); +``` + +After: + +```js +var buf; +if (Buffer.from && Buffer.from !== Uint8Array.from) { + buf = Buffer.from(notNumber, encoding); +} else { + if (typeof notNumber === 'number') + throw new Error('The "size" argument must be of type number.'); + buf = new Buffer(notNumber, encoding); +} +``` + +`encoding` is optional. + +Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not +hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the +Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous +security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create +problems ranging from DoS to leaking sensitive information to the attacker from the process memory. + +When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can +be omitted. + +Also note that using TypeScript does not fix this problem for you — when libs written in +`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as +all type checks are translation-time only and are not present in the actual JS code which TS +compiles to. + +### Buffer(number) + +For Node.js 0.10.x (and below) support: + +```js +var buf; +if (Buffer.alloc) { + buf = Buffer.alloc(number); +} else { + buf = new Buffer(number); + buf.fill(0); +} +``` + +Otherwise (Node.js ≥ 0.12.x): + +```js +const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); +``` + +## Regarding Buffer.allocUnsafe + +Be extra cautious when using `Buffer.allocUnsafe`: + * Don't use it if you don't have a good reason to + * e.g. you probably won't ever see a performance difference for small buffers, in fact, those + might be even faster with `Buffer.alloc()`, + * if your code is not in the hot code path — you also probably won't notice a difference, + * keep in mind that zero-filling minimizes the potential risks. + * If you use it, make sure that you never return the buffer in a partially-filled state, + * if you are writing to it sequentially — always truncate it to the actuall written length + +Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, +ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) +leaking to the remote attacker. + +_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js +version (and lacking type checks also adds DoS to the list of potential problems)._ + + +## FAQ + + +### What is wrong with the `Buffer` constructor? + +The `Buffer` constructor could be used to create a buffer in many different ways: + +- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained + *arbitrary memory* for performance reasons, which could include anything ranging from + program source code to passwords and encryption keys. +- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of + the string `'abc'`. A second argument could specify another encoding: For example, + `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original + sequence of bytes that it represents. +- There are several other combinations of arguments. + +This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell +what exactly the contents of the generated buffer are* without knowing the type of `foo`. + +Sometimes, the value of `foo` comes from an external source. For example, this function +could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: + +``` +function stringToBase64(req, res) { + // The request body should have the format of `{ string: 'foobar' }` + const rawBytes = new Buffer(req.body.string) + const encoded = rawBytes.toString('base64') + res.end({ encoded: encoded }) +} +``` + +Note that this code does *not* validate the type of `req.body.string`: + +- `req.body.string` is expected to be a string. If this is the case, all goes well. +- `req.body.string` is controlled by the client that sends the request. +- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: + - Before Node.js 8, the content would be uninitialized + - After Node.js 8, the content would be `50` bytes with the value `0` + +Because of the missing type check, an attacker could intentionally send a number +as part of the request. Using this, they can either: + +- Read uninitialized memory. This **will** leak passwords, encryption keys and other + kinds of sensitive information. (Information leak) +- Force the program to allocate a large amount of memory. For example, when specifying + `500000000` as the input value, each request will allocate 500MB of memory. + This can be used to either exhaust the memory available of a program completely + and make it crash, or slow it down significantly. (Denial of Service) + +Both of these scenarios are considered serious security issues in a real-world +web server context. + +when using `Buffer.from(req.body.string)` instead, passing a number will always +throw an exception instead, giving a controlled behaviour that can always be +handled by the program. + + +### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? + +Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still +widely used. This includes new code, and overall usage of such code has actually been +*increasing*. diff --git a/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Readme.md b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Readme.md new file mode 100644 index 00000000..14b08229 --- /dev/null +++ b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/Readme.md @@ -0,0 +1,156 @@ +# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url] + +[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master +[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer +[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg +[npm-url]: https://npmjs.org/package/safer-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com +[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg +[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md + +Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current. + +## How to use? + +First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API. + +Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use +`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new +Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._ + +Also, see the +[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide. + +## Do I need it? + +Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that +is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()` +though. + +See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) +for a better description. + +## Why not [safe-buffer](https://npmjs.com/safe-buffer)? + +_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and +itself contains footguns._ + +`safe-buffer` could be used safely to get the new API while still keeping support for older +Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API +I found out that `safe-buffer` is itself causing problems in some cases. + +For example, consider the following snippet: + +```console +$ cat example.unsafe.js +console.log(Buffer(20)) +$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js + +$ standard example.unsafe.js +standard: Use JavaScript Standard Style (https://standardjs.com) + /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead. +``` + +This is allocates and writes to console an uninitialized chunk of memory. +[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people +to avoid using unsafe API. + +Let's now throw in `safe-buffer`! + +```console +$ cat example.safe-buffer.js +const Buffer = require('safe-buffer').Buffer +console.log(Buffer(20)) +$ standard example.safe-buffer.js +$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js + +``` + +See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior +remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out +chunks of uninitialized memory. +_And this code will still emit runtime warnings on Node.js 10.x and above._ + +That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or +emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some +discussion, it was decided to move my approach into a separate package, and _this is that separate +package_. + +This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing, +«fixing» the lint warning by blindly including `safe-buffer` without any actual changes. + +Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request +can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go +unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even +pass CI. _I also observed that being done in popular packages._ + +Some examples: + * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31) + (a module with 548 759 downloads/month), + * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61) + (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)), + * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c) + (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)), + * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec) + (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)), + * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1) + (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)). + * And there are a lot more over the ecosystem. + +I filed a PR at +[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to +partially fix that (for cases when that lint rule is used), but it is a semver-major change for +linter rules and presets, so it would take significant time for that to reach actual setups. +_It also hasn't been released yet (2018-03-20)._ + +Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake. +It still supports it with an explicit concern barier, by placing it under +`require('safer-buffer/dangereous')`. + +## But isn't throwing bad? + +Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like +unguarded `new Buffer()` calls that end up receiving user input can do. + +This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so +it is really simple to keep track of things and make sure that you don't mix old API usage with that. +Also, CI should hint anything that you might have missed. + +New commits, if tested, won't land new usage of unsafe Buffer API this way. +_Node.js 10.x also deals with that by printing a runtime depecation warning._ + +### Would it affect third-party modules? + +No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`. +Don't do that. + +### But I don't want throwing… + +That is also fine! + +Also, it could be better in some cases when you don't comprehensive enough test coverage. + +In that case — just don't override `Buffer` and use +`var SaferBuffer = require('safer-buffer').Buffer` instead. + +That way, everything using `Buffer` natively would still work, but there would be two drawbacks: + +* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and + `SaferBuffer.alloc` instead. +* You are still open to accidentally using the insecure deprecated API — use a linter to catch that. + +Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly +recommended. `Buffer` is not overriden in this usecase, so linters won't get confused. + +## «Without footguns»? + +Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property +on older versions and duping things from there. You shouldn't do that in your code, probabably. + +The intention is to remove the most significant footguns that affect lots of packages in the +ecosystem, and to do it in the proper way. + +Also, this package doesn't protect against security issues affecting some Node.js versions, so for +usage in your own production code, it is still recommended to update to a Node.js version +[supported by upstream](https://github.com/nodejs/release#release-schedule). diff --git a/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/dangerous.js b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/dangerous.js new file mode 100644 index 00000000..ca41fdc5 --- /dev/null +++ b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/dangerous.js @@ -0,0 +1,58 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer +var safer = require('./safer.js') +var Safer = safer.Buffer + +var dangerous = {} + +var key + +for (key in safer) { + if (!safer.hasOwnProperty(key)) continue + dangerous[key] = safer[key] +} + +var Dangereous = dangerous.Buffer = {} + +// Copy Safer API +for (key in Safer) { + if (!Safer.hasOwnProperty(key)) continue + Dangereous[key] = Safer[key] +} + +// Copy those missing unsafe methods, if they are present +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (Dangereous.hasOwnProperty(key)) continue + Dangereous[key] = Buffer[key] +} + +if (!Dangereous.allocUnsafe) { + Dangereous.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return Buffer(size) + } +} + +if (!Dangereous.allocUnsafeSlow) { + Dangereous.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return buffer.SlowBuffer(size) + } +} + +module.exports = dangerous diff --git a/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/package.json b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/package.json new file mode 100644 index 00000000..d452b04a --- /dev/null +++ b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/package.json @@ -0,0 +1,34 @@ +{ + "name": "safer-buffer", + "version": "2.1.2", + "description": "Modern Buffer API polyfill without footguns", + "main": "safer.js", + "scripts": { + "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", + "test": "standard && tape tests.js" + }, + "author": { + "name": "Nikita Skovoroda", + "email": "chalkerx@gmail.com", + "url": "https://github.com/ChALkeR" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/ChALkeR/safer-buffer.git" + }, + "bugs": { + "url": "https://github.com/ChALkeR/safer-buffer/issues" + }, + "devDependencies": { + "standard": "^11.0.1", + "tape": "^4.9.0" + }, + "files": [ + "Porting-Buffer.md", + "Readme.md", + "tests.js", + "dangerous.js", + "safer.js" + ] +} diff --git a/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js new file mode 100644 index 00000000..37c7e1aa --- /dev/null +++ b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js @@ -0,0 +1,77 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer + +var safer = {} + +var key + +for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue + if (key === 'SlowBuffer' || key === 'Buffer') continue + safer[key] = buffer[key] +} + +var Safer = safer.Buffer = {} +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue + Safer[key] = Buffer[key] +} + +safer.Buffer.prototype = Buffer.prototype + +if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) + } + if (value && typeof value.length === 'undefined') { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) + } + return Buffer(value, encodingOrOffset, length) + } +} + +if (!Safer.alloc) { + Safer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + var buf = Buffer(size) + if (!fill || fill.length === 0) { + buf.fill(0) + } else if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + return buf + } +} + +if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding('buffer').kStringMaxLength + } catch (e) { + // we can't determine kStringMaxLength in environments where process.binding + // is unsupported, so let's not set it + } +} + +if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + } + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength + } +} + +module.exports = safer diff --git a/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/tests.js b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/tests.js new file mode 100644 index 00000000..7ed2777c --- /dev/null +++ b/backend/node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/tests.js @@ -0,0 +1,406 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var test = require('tape') + +var buffer = require('buffer') + +var index = require('./') +var safer = require('./safer') +var dangerous = require('./dangerous') + +/* Inheritance tests */ + +test('Default is Safer', function (t) { + t.equal(index, safer) + t.notEqual(safer, dangerous) + t.notEqual(index, dangerous) + t.end() +}) + +test('Is not a function', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'object') + }); + [buffer].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'function') + }) + t.end() +}) + +test('Constructor throws', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer() }) + t.throws(function () { impl.Buffer(0) }) + t.throws(function () { impl.Buffer('a') }) + t.throws(function () { impl.Buffer('a', 'utf-8') }) + t.throws(function () { return new impl.Buffer() }) + t.throws(function () { return new impl.Buffer(0) }) + t.throws(function () { return new impl.Buffer('a') }) + t.throws(function () { return new impl.Buffer('a', 'utf-8') }) + }) + t.end() +}) + +test('Safe methods exist', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') + t.equal(typeof impl.Buffer.from, 'function', 'from') + }) + t.end() +}) + +test('Unsafe methods exist only in Dangerous', function (t) { + [index, safer].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') + }); + [dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'function') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') + }) + t.end() +}) + +test('Generic methods/properties are defined and equal', function (t) { + ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in buffer static methods/properties are inherited', function (t) { + Object.keys(buffer).forEach(function (method) { + if (method === 'SlowBuffer' || method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], buffer[method], method) + t.notEqual(typeof impl[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in Buffer static methods/properties are inherited', function (t) { + Object.keys(buffer.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('.prototype property of Buffer is inherited', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') + t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') + }) + t.end() +}) + +test('All Safer methods are present in Dangerous', function (t) { + Object.keys(safer).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], safer[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(safer.Buffer).forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], safer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Safe methods from Dangerous methods are present in Safer', function (t) { + Object.keys(dangerous).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], dangerous[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(dangerous.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], dangerous.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +/* Behaviour tests */ + +test('Methods return Buffers', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) + }) + t.end() +}) + +test('Constructor is buffer.Buffer', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) + t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) + t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) + }); + [0, 10, 100].forEach(function (arg) { + t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) + t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) + }) + t.end() +}) + +test('Invalid calls throw', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer.from(0) }) + t.throws(function () { impl.Buffer.from(10) }) + t.throws(function () { impl.Buffer.from(10, 'utf-8') }) + t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) + t.throws(function () { impl.Buffer.from(-10) }) + t.throws(function () { impl.Buffer.from(1e90) }) + t.throws(function () { impl.Buffer.from(Infinity) }) + t.throws(function () { impl.Buffer.from(-Infinity) }) + t.throws(function () { impl.Buffer.from(NaN) }) + t.throws(function () { impl.Buffer.from(null) }) + t.throws(function () { impl.Buffer.from(undefined) }) + t.throws(function () { impl.Buffer.from() }) + t.throws(function () { impl.Buffer.from({}) }) + t.throws(function () { impl.Buffer.alloc('') }) + t.throws(function () { impl.Buffer.alloc('string') }) + t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) + t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) + t.throws(function () { impl.Buffer.alloc(-10) }) + t.throws(function () { impl.Buffer.alloc(1e90) }) + t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) + t.throws(function () { impl.Buffer.alloc(Infinity) }) + t.throws(function () { impl.Buffer.alloc(-Infinity) }) + t.throws(function () { impl.Buffer.alloc(null) }) + t.throws(function () { impl.Buffer.alloc(undefined) }) + t.throws(function () { impl.Buffer.alloc() }) + t.throws(function () { impl.Buffer.alloc([]) }) + t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) + t.throws(function () { impl.Buffer.alloc({}) }) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.throws(function () { dangerous.Buffer[method]('') }) + t.throws(function () { dangerous.Buffer[method]('string') }) + t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) + t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) + t.throws(function () { dangerous.Buffer[method](Infinity) }) + if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { + t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') + } else { + t.throws(function () { dangerous.Buffer[method](-10) }) + t.throws(function () { dangerous.Buffer[method](-1e90) }) + t.throws(function () { dangerous.Buffer[method](-Infinity) }) + } + t.throws(function () { dangerous.Buffer[method](null) }) + t.throws(function () { dangerous.Buffer[method](undefined) }) + t.throws(function () { dangerous.Buffer[method]() }) + t.throws(function () { dangerous.Buffer[method]([]) }) + t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) + t.throws(function () { dangerous.Buffer[method]({}) }) + }) + t.end() +}) + +test('Buffers have appropriate lengths', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).length, 0) + t.equal(impl.Buffer.alloc(10).length, 10) + t.equal(impl.Buffer.from('').length, 0) + t.equal(impl.Buffer.from('string').length, 6) + t.equal(impl.Buffer.from('string', 'utf-8').length, 6) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) + t.equal(impl.Buffer.from([0, 42, 3]).length, 3) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) + t.equal(impl.Buffer.from([]).length, 0) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.equal(dangerous.Buffer[method](0).length, 0) + t.equal(dangerous.Buffer[method](10).length, 10) + }) + t.end() +}) + +test('Buffers have appropriate lengths (2)', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true; + [ safer.Buffer.alloc, + dangerous.Buffer.allocUnsafe, + dangerous.Buffer.allocUnsafeSlow + ].forEach(function (method) { + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 1e5) + var buf = method(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + } + }) + t.ok(ok) + t.end() +}) + +test('.alloc(size) is zero-filled and has correct length', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = index.Buffer.alloc(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = dangerous.Buffer[method](length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + buf.fill(0, 0, length) + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1, 0, length) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok, method) + }) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) + t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) + + var tmp = new buffer.Buffer(2) + tmp.fill('ok') + if (tmp[1] === tmp[0]) { + // Outdated Node.js + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) + } else { + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) + } + t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) + + t.end() +}) + +test('safer.Buffer.from returns results same as Buffer constructor', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) + t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) + t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) + t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) + t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) + }) + t.end() +}) + +test('safer.Buffer.from returns consistent results', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) + t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) + }) + t.end() +}) diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/define-data-property b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/define-data-property new file mode 120000 index 00000000..bb314a43 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/define-data-property @@ -0,0 +1 @@ +../../define-data-property@1.1.4/node_modules/define-data-property \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/es-errors b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/function-bind b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/function-bind new file mode 120000 index 00000000..62a99de1 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/function-bind @@ -0,0 +1 @@ +../../function-bind@1.1.2/node_modules/function-bind \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/get-intrinsic b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/get-intrinsic new file mode 120000 index 00000000..0042f6aa --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/get-intrinsic @@ -0,0 +1 @@ +../../get-intrinsic@1.3.0/node_modules/get-intrinsic \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/gopd b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/gopd new file mode 120000 index 00000000..3e8fbc1b --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/gopd @@ -0,0 +1 @@ +../../gopd@1.2.0/node_modules/gopd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/has-property-descriptors b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/has-property-descriptors new file mode 120000 index 00000000..38ce4a83 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/has-property-descriptors @@ -0,0 +1 @@ +../../has-property-descriptors@1.0.2/node_modules/has-property-descriptors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.eslintrc b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.eslintrc new file mode 100644 index 00000000..7cff5071 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.eslintrc @@ -0,0 +1,27 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": "off", + "new-cap": ["error", { + "capIsNewExceptions": [ + "GetIntrinsic" + ], + }], + "no-extra-parens": "off", + }, + + "overrides": [ + { + "files": ["test/**/*.js"], + "rules": { + "id-length": "off", + "max-lines-per-function": "off", + "multiline-comment-style": "off", + "no-empty-function": "off", + }, + }, + ], +} diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.github/FUNDING.yml b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.github/FUNDING.yml new file mode 100644 index 00000000..92feb6f9 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/set-function-name +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.nycrc b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/CHANGELOG.md b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/CHANGELOG.md new file mode 100644 index 00000000..bac439d8 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/CHANGELOG.md @@ -0,0 +1,70 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.2.2](https://github.com/ljharb/set-function-length/compare/v1.2.1...v1.2.2) - 2024-03-09 + +### Commits + +- [types] use shared config [`027032f`](https://github.com/ljharb/set-function-length/commit/027032fe9cc439644a07248ea6a8d813fcc767cb) +- [actions] remove redundant finisher; use reusable workflow [`1fd4fb1`](https://github.com/ljharb/set-function-length/commit/1fd4fb1c58bd5170f0dcff7e320077c0aa2ffdeb) +- [types] use a handwritten d.ts file instead of emit [`01b9761`](https://github.com/ljharb/set-function-length/commit/01b9761742c95e1118e8c2d153ce2ae43d9731aa) +- [Deps] update `define-data-property`, `get-intrinsic`, `has-property-descriptors` [`bee8eaf`](https://github.com/ljharb/set-function-length/commit/bee8eaf7749f325357ade85cffeaeef679e513d4) +- [Dev Deps] update `call-bind`, `tape` [`5dae579`](https://github.com/ljharb/set-function-length/commit/5dae579fdc3aab91b14ebb58f9c19ee3f509d434) +- [Tests] use `@arethetypeswrong/cli` [`7e22425`](https://github.com/ljharb/set-function-length/commit/7e22425d15957fd3d6da0b6bca4afc0c8d255d2d) + +## [v1.2.1](https://github.com/ljharb/set-function-length/compare/v1.2.0...v1.2.1) - 2024-02-06 + +### Commits + +- [Dev Deps] update `call-bind`, `tape`, `typescript` [`d9a4601`](https://github.com/ljharb/set-function-length/commit/d9a460199c4c1fa37da9ebe055e2c884128f0738) +- [Deps] update `define-data-property`, `get-intrinsic` [`38d39ae`](https://github.com/ljharb/set-function-length/commit/38d39aed13a757ed36211d5b0437b88485090c6b) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`b4bfe5a`](https://github.com/ljharb/set-function-length/commit/b4bfe5ae0953b906d55b85f867eca5e7f673ebf4) + +## [v1.2.0](https://github.com/ljharb/set-function-length/compare/v1.1.1...v1.2.0) - 2024-01-14 + +### Commits + +- [New] add types [`f6d9088`](https://github.com/ljharb/set-function-length/commit/f6d9088b9283a3112b21c6776e8bef6d1f30558a) +- [Fix] ensure `env` properties are always booleans [`0c42f84`](https://github.com/ljharb/set-function-length/commit/0c42f84979086389b3229e1b4272697fd352275a) +- [Dev Deps] update `aud`, `call-bind`, `npmignore`, `tape` [`2b75f75`](https://github.com/ljharb/set-function-length/commit/2b75f75468093a4bb8ce8ca989b2edd2e80d95d1) +- [Deps] update `get-intrinsic`, `has-property-descriptors` [`19bf0fc`](https://github.com/ljharb/set-function-length/commit/19bf0fc4ffaa5ad425acbfa150516be9f3b6263a) +- [meta] add `sideEffects` flag [`8bb9b78`](https://github.com/ljharb/set-function-length/commit/8bb9b78c11c621123f725c9470222f43466c01d0) + +## [v1.1.1](https://github.com/ljharb/set-function-length/compare/v1.1.0...v1.1.1) - 2023-10-19 + +### Fixed + +- [Fix] move `define-data-property` to runtime deps [`#2`](https://github.com/ljharb/set-function-length/issues/2) + +### Commits + +- [Dev Deps] update `object-inspect`; add missing `call-bind` [`5aecf79`](https://github.com/ljharb/set-function-length/commit/5aecf79e7d6400957a5d9bd9ac20d4528908ca18) + +## [v1.1.0](https://github.com/ljharb/set-function-length/compare/v1.0.1...v1.1.0) - 2023-10-13 + +### Commits + +- [New] add `env` entry point [`475c87a`](https://github.com/ljharb/set-function-length/commit/475c87aa2f59b700aaed589d980624ec596acdcb) +- [Tests] add coverage with `nyc` [`14f0bf8`](https://github.com/ljharb/set-function-length/commit/14f0bf8c145ae60bf14a026420a06bb7be132c36) +- [eslint] fix linting failure [`fb516f9`](https://github.com/ljharb/set-function-length/commit/fb516f93c664057138c53559ef63c8622a093335) +- [Deps] update `define-data-property` [`d727e7c`](https://github.com/ljharb/set-function-length/commit/d727e7c6c9a40d7bf26797694e500ea68741feea) + +## [v1.0.1](https://github.com/ljharb/set-function-length/compare/v1.0.0...v1.0.1) - 2023-10-12 + +### Commits + +- [Refactor] use `get-intrinsic`, since it‘s in the dep graph anyways [`278a954`](https://github.com/ljharb/set-function-length/commit/278a954a06cd849051c569ff7aee56df6798933e) +- [meta] add `exports` [`72acfe5`](https://github.com/ljharb/set-function-length/commit/72acfe5a0310071fb205a72caba5ecbab24336a0) + +## v1.0.0 - 2023-10-12 + +### Commits + +- Initial implementation, tests, readme [`fce14e1`](https://github.com/ljharb/set-function-length/commit/fce14e17586460e4f294405173be72b6ffdf7e5f) +- Initial commit [`ca7ba85`](https://github.com/ljharb/set-function-length/commit/ca7ba857c7c283f9d26e21f14e71cd388f2cb722) +- npm init [`6a7e493`](https://github.com/ljharb/set-function-length/commit/6a7e493927736cebcaf5c1a84e69b8e6b7b744d8) +- Only apps should have lockfiles [`d2bf6c4`](https://github.com/ljharb/set-function-length/commit/d2bf6c43de8a51b02a0aa53e8d62cb50c4a2b0da) diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/LICENSE b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/LICENSE new file mode 100644 index 00000000..03149290 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Jordan Harband and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/README.md b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/README.md new file mode 100644 index 00000000..15e3ac4b --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/README.md @@ -0,0 +1,56 @@ +# set-function-length [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Set a function’s length. + +Arguments: + - `fn`: the function + - `length`: the new length. Must be an integer between 0 and 2**32. + - `loose`: Optional. If true, and the length fails to be set, do not throw. Default false. + +Returns `fn`. + +## Usage + +```javascript +var setFunctionLength = require('set-function-length'); +var assert = require('assert'); + +function zero() {} +function one(_) {} +function two(_, __) {} + +assert.equal(zero.length, 0); +assert.equal(one.length, 1); +assert.equal(two.length, 2); + +assert.equal(setFunctionLength(zero, 10), zero); +assert.equal(setFunctionLength(one, 11), one); +assert.equal(setFunctionLength(two, 12), two); + +assert.equal(zero.length, 10); +assert.equal(one.length, 11); +assert.equal(two.length, 12); +``` + +[package-url]: https://npmjs.org/package/set-function-length +[npm-version-svg]: https://versionbadg.es/ljharb/set-function-length.svg +[deps-svg]: https://david-dm.org/ljharb/set-function-length.svg +[deps-url]: https://david-dm.org/ljharb/set-function-length +[dev-deps-svg]: https://david-dm.org/ljharb/set-function-length/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/set-function-length#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/set-function-length.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/set-function-length.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/set-function-length.svg +[downloads-url]: https://npm-stat.com/charts.html?package=set-function-length +[codecov-image]: https://codecov.io/gh/ljharb/set-function-length/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/set-function-length/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/set-function-length +[actions-url]: https://github.com/ljharb/set-function-length/actions diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.d.ts b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.d.ts new file mode 100644 index 00000000..970ea535 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.d.ts @@ -0,0 +1,9 @@ +declare const env: { + __proto__: null, + boundFnsHaveConfigurableLengths: boolean; + boundFnsHaveWritableLengths: boolean; + functionsHaveConfigurableLengths: boolean; + functionsHaveWritableLengths: boolean; +}; + +export = env; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.js b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.js new file mode 100644 index 00000000..d9b0a299 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/env.js @@ -0,0 +1,25 @@ +'use strict'; + +var gOPD = require('gopd'); +var bind = require('function-bind'); + +var unbound = gOPD && gOPD(function () {}, 'length'); +// @ts-expect-error ts(2555) TS is overly strict with .call +var bound = gOPD && gOPD(bind.call(function () {}), 'length'); + +var functionsHaveConfigurableLengths = !!(unbound && unbound.configurable); + +var functionsHaveWritableLengths = !!(unbound && unbound.writable); + +var boundFnsHaveConfigurableLengths = !!(bound && bound.configurable); + +var boundFnsHaveWritableLengths = !!(bound && bound.writable); + +/** @type {import('./env')} */ +module.exports = { + __proto__: null, + boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths, + boundFnsHaveWritableLengths: boundFnsHaveWritableLengths, + functionsHaveConfigurableLengths: functionsHaveConfigurableLengths, + functionsHaveWritableLengths: functionsHaveWritableLengths +}; diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.d.ts b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.d.ts new file mode 100644 index 00000000..0451ecd3 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.d.ts @@ -0,0 +1,7 @@ +declare namespace setFunctionLength { + type Func = (...args: unknown[]) => unknown; +} + +declare function setFunctionLength(fn: T, length: number, loose?: boolean): T; + +export = setFunctionLength; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js new file mode 100644 index 00000000..14ce74da --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var define = require('define-data-property'); +var hasDescriptors = require('has-property-descriptors')(); +var gOPD = require('gopd'); + +var $TypeError = require('es-errors/type'); +var $floor = GetIntrinsic('%Math.floor%'); + +/** @type {import('.')} */ +module.exports = function setFunctionLength(fn, length) { + if (typeof fn !== 'function') { + throw new $TypeError('`fn` is not a function'); + } + if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { + throw new $TypeError('`length` must be a positive 32-bit integer'); + } + + var loose = arguments.length > 2 && !!arguments[2]; + + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ('length' in fn && gOPD) { + var desc = gOPD(fn, 'length'); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define(/** @type {Parameters[0]} */ (fn), 'length', length, true, true); + } else { + define(/** @type {Parameters[0]} */ (fn), 'length', length); + } + } + return fn; +}; diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/package.json b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/package.json new file mode 100644 index 00000000..f6b88819 --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/package.json @@ -0,0 +1,102 @@ +{ + "name": "set-function-length", + "version": "1.2.2", + "description": "Set a function's length property", + "main": "index.js", + "exports": { + ".": "./index.js", + "./env": "./env.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "directories": { + "test": "test" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "tsc": "tsc -p .", + "posttsc": "attw -P", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "npm run tsc", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/set-function-length.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "set", + "function", + "length", + "function.length" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/set-function-length/issues" + }, + "homepage": "https://github.com/ljharb/set-function-length#readme", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.15.1", + "@ljharb/eslint-config": "^21.1.0", + "@ljharb/tsconfig": "^0.1.1", + "@types/call-bind": "^1.0.5", + "@types/define-properties": "^1.1.5", + "@types/es-value-fixtures": "^1.4.4", + "@types/for-each": "^0.3.3", + "@types/function-bind": "^1.1.10", + "@types/gopd": "^1.0.3", + "@types/has-property-descriptors": "^1.0.3", + "@types/object-inspect": "^1.8.4", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "call-bind": "^1.0.7", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.5", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "test" + ] + } +} diff --git a/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/tsconfig.json b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/tsconfig.json new file mode 100644 index 00000000..d9a6668c --- /dev/null +++ b/backend/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/LICENSE b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/LICENSE new file mode 100644 index 00000000..61afa2f1 --- /dev/null +++ b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Wes Todd + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/README.md b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/README.md new file mode 100644 index 00000000..791eeff0 --- /dev/null +++ b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/README.md @@ -0,0 +1,31 @@ +# Polyfill for `Object.setPrototypeOf` + +[![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) +[![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) + +A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. + +## Usage: + +``` +$ npm install --save setprototypeof +``` + +```javascript +var setPrototypeOf = require('setprototypeof') + +var obj = {} +setPrototypeOf(obj, { + foo: function () { + return 'bar' + } +}) +obj.foo() // bar +``` + +TypeScript is also supported: + +```typescript +import setPrototypeOf from 'setprototypeof' +``` diff --git a/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.d.ts b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.d.ts new file mode 100644 index 00000000..f108ecd0 --- /dev/null +++ b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.d.ts @@ -0,0 +1,2 @@ +declare function setPrototypeOf(o: any, proto: object | null): any; +export = setPrototypeOf; diff --git a/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.js b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.js new file mode 100644 index 00000000..c5270551 --- /dev/null +++ b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/index.js @@ -0,0 +1,17 @@ +'use strict' +/* eslint no-proto: 0 */ +module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) + +function setProtoOf (obj, proto) { + obj.__proto__ = proto + return obj +} + +function mixinProperties (obj, proto) { + for (var prop in proto) { + if (!Object.prototype.hasOwnProperty.call(obj, prop)) { + obj[prop] = proto[prop] + } + } + return obj +} diff --git a/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/package.json b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/package.json new file mode 100644 index 00000000..f20915be --- /dev/null +++ b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/package.json @@ -0,0 +1,38 @@ +{ + "name": "setprototypeof", + "version": "1.2.0", + "description": "A small polyfill for Object.setprototypeof", + "main": "index.js", + "typings": "index.d.ts", + "scripts": { + "test": "standard && mocha", + "testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11", + "testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t", + "node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion", + "node4": "NODE_VER=4 npm run testversion", + "node6": "NODE_VER=6 npm run testversion", + "node9": "NODE_VER=9 npm run testversion", + "node11": "NODE_VER=11 npm run testversion", + "prepublishOnly": "npm t", + "postpublish": "git push origin && git push origin --tags" + }, + "repository": { + "type": "git", + "url": "https://github.com/wesleytodd/setprototypeof.git" + }, + "keywords": [ + "polyfill", + "object", + "setprototypeof" + ], + "author": "Wes Todd", + "license": "ISC", + "bugs": { + "url": "https://github.com/wesleytodd/setprototypeof/issues" + }, + "homepage": "https://github.com/wesleytodd/setprototypeof", + "devDependencies": { + "mocha": "^6.1.4", + "standard": "^13.0.2" + } +} diff --git a/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/test/index.js b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/test/index.js new file mode 100644 index 00000000..afeb4ddb --- /dev/null +++ b/backend/node_modules/.pnpm/setprototypeof@1.2.0/node_modules/setprototypeof/test/index.js @@ -0,0 +1,24 @@ +'use strict' +/* eslint-env mocha */ +/* eslint no-proto: 0 */ +var assert = require('assert') +var setPrototypeOf = require('..') + +describe('setProtoOf(obj, proto)', function () { + it('should merge objects', function () { + var obj = { a: 1, b: 2 } + var proto = { b: 3, c: 4 } + var mergeObj = setPrototypeOf(obj, proto) + + if (Object.getPrototypeOf) { + assert.strictEqual(Object.getPrototypeOf(obj), proto) + } else if ({ __proto__: [] } instanceof Array) { + assert.strictEqual(obj.__proto__, proto) + } else { + assert.strictEqual(obj.a, 1) + assert.strictEqual(obj.b, 2) + assert.strictEqual(obj.c, 4) + } + assert.strictEqual(mergeObj, obj) + }) +}) diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/inherits b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/inherits new file mode 120000 index 00000000..a2c96077 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/inherits @@ -0,0 +1 @@ +../../inherits@2.0.4/node_modules/inherits \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/safe-buffer b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/safe-buffer new file mode 120000 index 00000000..561a6c64 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/safe-buffer @@ -0,0 +1 @@ +../../safe-buffer@5.2.1/node_modules/safe-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/.eslintrc b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/.eslintrc new file mode 100644 index 00000000..33bd34c4 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/.eslintrc @@ -0,0 +1,76 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-style": "off", + "no-magic-numbers": "off", + }, + + "overrides": [ + { + "files": "bin.js", + "extends": "@ljharb/eslint-config/node/0.4", + "rules": { + "func-style": "off", + }, + }, + { + "files": [ + "hash.js", + "sha.js", + "sha1.js", + "sha224.js", + "sha256.js", + "sha384.js", + "sha512.js", + "test/vectors.js", + ], + "rules": { + "no-underscore-dangle": "off", + }, + }, + { + "files": [ + "sha.js", + "sha1.js", + "sha224.js", + ], + "rules": { + "max-params": "off", + }, + }, + { + "files": [ + "sha256.js", + "sha512.js", + ], + "rules": { + "max-statements": "off", + }, + }, + { + "files": [ + "sha512.js", + ], + "rules": { + "new-cap": "warn", + "max-lines": "off", + "max-lines-per-function": "off", + }, + }, + { + "files": "hash.js", + "globals": { + "Uint8Array": false, + }, + }, + { + "files": "test/test.js", + "globals": { + "Uint16Array": false, + }, + }, + ], +} diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/CHANGELOG.md b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/CHANGELOG.md new file mode 100644 index 00000000..6fe1d94e --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/CHANGELOG.md @@ -0,0 +1,423 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.4.12](https://github.com/browserify/sha.js/compare/v2.4.11...v2.4.12) - 2025-07-01 + +### Commits + +- [eslint] switch to eslint [`7acadfb`](https://github.com/browserify/sha.js/commit/7acadfbd3abb558880212b20669fcb09e1aa1c58) +- [meta] add `auto-changelog` [`b46e711`](https://github.com/browserify/sha.js/commit/b46e7116ebeaa82f34bbf2d7494fff7ef46eab3e) +- [eslint] fix package.json indentation [`df9d521`](https://github.com/browserify/sha.js/commit/df9d521e16ddf55dc877c43c05706d43c057fad4) +- [Tests] migrate from travis to GHA [`c43c64a`](https://github.com/browserify/sha.js/commit/c43c64adc6d3607d470538df72338fc02e63bc24) +- [Fix] support multi-byte wide typed arrays [`f2a258e`](https://github.com/browserify/sha.js/commit/f2a258e9f2d0fcd113bfbaa49706e1ac0d979ba5) +- [meta] reorder package.json [`d8d77c0`](https://github.com/browserify/sha.js/commit/d8d77c0a729c99593e304047f9d4335b498fd9ed) +- [meta] add `npmignore` [`35aec35`](https://github.com/browserify/sha.js/commit/35aec35c667b606b2495be3e4186bbe977b9e087) +- [Tests] avoid console logs [`73e33ae`](https://github.com/browserify/sha.js/commit/73e33ae0ca6bca232627cac7473028e1d218f67e) +- [Tests] fix tests run in batch [`2629130`](https://github.com/browserify/sha.js/commit/262913006e94616c8cd245ef6bd61bc4410b29e3) +- [Tests] drop node requirement to 0.10 [`00c7f23`](https://github.com/browserify/sha.js/commit/00c7f234aa3bdbd427ffeb929bacbb05334eb3e9) +- [Dev Deps] update `buffer`, `hash-test-vectors`, `standard`, `tape`, `typedarray` [`92b5de5`](https://github.com/browserify/sha.js/commit/92b5de5f67472d9f18413d38ad5b9aba29ff4c22) +- [Tests] drop node requirement to v3 [`9b5eca8`](https://github.com/browserify/sha.js/commit/9b5eca80fd9bb21cf05bdf43ce42661f1bbafeaa) +- [meta] set engines to `>= 4` [`807084c`](https://github.com/browserify/sha.js/commit/807084c5c0f943459e89838252cafbd175b549b7) +- Only apps should have lockfiles [`c72789c`](https://github.com/browserify/sha.js/commit/c72789c7a129cf453d44008ba27a88b90ac7989b) +- [Deps] update `inherits`, `safe-buffer` [`5428cfc`](https://github.com/browserify/sha.js/commit/5428cfc6f7177ad1a41c837b9387308848db96de) +- [Dev Deps] update `@ljharb/eslint-config` [`2dbe0aa`](https://github.com/browserify/sha.js/commit/2dbe0aab419e90add5032c70c9663b8fc562adb8) +- update README to reflect LICENSE [`8938256`](https://github.com/browserify/sha.js/commit/8938256dbb2241a7c749e4a399dbaff48cbe8e95) +- [Dev Deps] add missing peer dep [`d528896`](https://github.com/browserify/sha.js/commit/d52889688ce524e63570f35e448635a29e6dd791) +- [Dev Deps] remove unused `buffer` dep [`94ca724`](https://github.com/browserify/sha.js/commit/94ca7247f467ef045f41d534708bf7c700e03828) + +## [v2.4.11](https://github.com/browserify/sha.js/compare/v2.4.10...v2.4.11) - 2018-03-20 + +### Merged + +- Project is bound by MIT AND BSD-3-Clause licenses. [`#55`](https://github.com/browserify/sha.js/pull/55) + +## [v2.4.10](https://github.com/browserify/sha.js/compare/v2.4.9...v2.4.10) - 2018-01-22 + +### Merged + +- Modified greater than uint32 bits data test [`#53`](https://github.com/browserify/sha.js/pull/53) +- convert lowBits to unsigned in hash.js [`#51`](https://github.com/browserify/sha.js/pull/51) + +### Commits + +- Simplify bigData allocation [`107141a`](https://github.com/browserify/sha.js/commit/107141ac2c4ca61538e4ad9622cd0c2e21d38095) +- Modified large file test [`9d037bd`](https://github.com/browserify/sha.js/commit/9d037bd51e84d0d77aa56bb94ed2af2b436d9d66) + +## [v2.4.9](https://github.com/browserify/sha.js/compare/v2.4.8...v2.4.9) - 2017-09-25 + +### Merged + +- Buffer: use alloc/allocUnsafe/from instead new [`#50`](https://github.com/browserify/sha.js/pull/50) +- Change "new shajs.SHA256()" to lowercase to make it actually work. [`#48`](https://github.com/browserify/sha.js/pull/48) +- drop Node <4 [`#46`](https://github.com/browserify/sha.js/pull/46) +- hash: _update never returns anything [`#45`](https://github.com/browserify/sha.js/pull/45) +- README: remove typed array comments, re-format support algorithms [`#40`](https://github.com/browserify/sha.js/pull/40) +- Fix digesting of large data (more than MAX_UINT32 bits) [`#43`](https://github.com/browserify/sha.js/pull/43) +- use buffer module [`#41`](https://github.com/browserify/sha.js/pull/41) + +### Commits + +- tests: compare hex, not byte-by-byte (easier debugging) [`5d5a8d8`](https://github.com/browserify/sha.js/commit/5d5a8d882b614060b774e195821a43051f3345b7) +- hash: remove repeated remainder calculation [`158bc83`](https://github.com/browserify/sha.js/commit/158bc835fbffbbd80f93c97ba0db8e7da7db9c0e) +- tests: use safe-buffer constructors [`1ac913b`](https://github.com/browserify/sha.js/commit/1ac913b8e043d495c899a1c52258e8e4e970ee95) +- hash: increase readability of block-by-block hashing [`e9ff865`](https://github.com/browserify/sha.js/commit/e9ff865980615cb8ee2730c6868e7f6781af3c5b) +- use safe-buffer [`22adba6`](https://github.com/browserify/sha.js/commit/22adba6c745ca703cce356faa988dfe1d84eefa4) +- Add test for large data [`e963695`](https://github.com/browserify/sha.js/commit/e9636950b88c8e2a0b012c19f4957229d409b04f) +- tests: formatting [`678c338`](https://github.com/browserify/sha.js/commit/678c3380273516094e32eb79c50e4bce18da6346) +- Fix digesting of large data [`aee24f1`](https://github.com/browserify/sha.js/commit/aee24f1e0d7fefca68633e6c1be52670fb65a1a5) +- hash: update never returns anything [`d308cb0`](https://github.com/browserify/sha.js/commit/d308cb0004a0f3e0fcb7a27ea52868384c654c95) +- hash: rm unnecessary _s state [`388d45e`](https://github.com/browserify/sha.js/commit/388d45ec3a040e7f6ffeecd077498baf32e270e9) +- npmignore: ignore test/ [`03702a8`](https://github.com/browserify/sha.js/commit/03702a8032fe2bc0b033860bec37c09c1d4af44b) +- package: bump standard [`8551e53`](https://github.com/browserify/sha.js/commit/8551e53f389cbe3728b21cd62e2df917b4dad9d6) + +## [v2.4.8](https://github.com/browserify/sha.js/compare/v2.4.7...v2.4.8) - 2016-11-11 + +### Commits + +- travis: add 6 [`62a582c`](https://github.com/browserify/sha.js/commit/62a582ccebffa04f7b281c680095ffd7a7107e12) + +## [v2.4.7](https://github.com/browserify/sha.js/compare/v2.4.6...v2.4.7) - 2016-11-10 + +### Commits + +- re-add bin.js [`30546ca`](https://github.com/browserify/sha.js/commit/30546ca68e683e7fcb4d6c372e48c6b9fda35b4c) + +## [v2.4.6](https://github.com/browserify/sha.js/compare/v2.4.5...v2.4.6) - 2016-11-10 + +### Merged + +- use hash-base [`#36`](https://github.com/browserify/sha.js/pull/36) +- travis: add node 6 [`#38`](https://github.com/browserify/sha.js/pull/38) +- 2.4.5 [`#35`](https://github.com/browserify/sha.js/pull/35) + +### Commits + +- update implementations [`aba27f9`](https://github.com/browserify/sha.js/commit/aba27f9132de39dca4089a120b6c66e097fcd865) +- update tests [`8522be9`](https://github.com/browserify/sha.js/commit/8522be9bc5abc34adf3cf4b17c132471c0f4f80a) +- remove bin.js [`f7c86a7`](https://github.com/browserify/sha.js/commit/f7c86a70d6a70dd807cce06f811d3cbf9cbebff0) +- update README.md [`8eec0fb`](https://github.com/browserify/sha.js/commit/8eec0fbf2025cdf9c5d2f8877d3fe3e276dbda88) +- move shaX to lib directory [`cf2ab1d`](https://github.com/browserify/sha.js/commit/cf2ab1dc9bdd434dfd3afd043f0956894c931ad2) +- travis: add 6 [`891c962`](https://github.com/browserify/sha.js/commit/891c96228dd4cb9777fbae169e8ee8f2c3dc022c) + +## [v2.4.5](https://github.com/browserify/sha.js/compare/v2.4.4...v2.4.5) - 2016-02-26 + +### Merged + +- Improve performace [`#34`](https://github.com/browserify/sha.js/pull/34) +- Add node v4 and v5 to travis config [`#33`](https://github.com/browserify/sha.js/pull/33) + +### Commits + +- Update package.json [`2b250d6`](https://github.com/browserify/sha.js/commit/2b250d6358efed8c9476805ccb86e20c63e721a6) + +## [v2.4.4](https://github.com/browserify/sha.js/compare/v2.4.3...v2.4.4) - 2015-09-19 + +### Merged + +- inline Sigma functions [`#32`](https://github.com/browserify/sha.js/pull/32) + +## [v2.4.3](https://github.com/browserify/sha.js/compare/v2.4.2...v2.4.3) - 2015-09-15 + +### Merged + +- Remove testling [`#31`](https://github.com/browserify/sha.js/pull/31) + +### Fixed + +- Adds npm badge (resolves #28) [`#28`](https://github.com/browserify/sha.js/issues/28) + +### Commits + +- fix standard issues [`52659f7`](https://github.com/browserify/sha.js/commit/52659f73bdc9ce1147da010cb303f3f008428498) +- README: update badge paths [`66a0b4c`](https://github.com/browserify/sha.js/commit/66a0b4c50b3499e2db37c4d1b0545d6536bc2f3b) +- Update README.md [`ca03356`](https://github.com/browserify/sha.js/commit/ca03356cbf74ea5b57df4d4f5ccc1e5557a75966) + +## [v2.4.2](https://github.com/browserify/sha.js/compare/v2.4.1...v2.4.2) - 2015-06-05 + +### Merged + +- Use standard [`#26`](https://github.com/browserify/sha.js/pull/26) + +### Commits + +- sha*: adhere to standard [`74f5fc4`](https://github.com/browserify/sha.js/commit/74f5fc4741447385f5691cb3140cf716a1288312) +- tests: adhere to standard [`e6851ca`](https://github.com/browserify/sha.js/commit/e6851ca9bb0843fa90d8eee7d3f7b3f9d1bbe4fb) +- bin: adhere to standard [`d1a23ab`](https://github.com/browserify/sha.js/commit/d1a23ab987eed4a6b940161693a805fa67c6e16d) +- vectors: adhere to standard [`5657c76`](https://github.com/browserify/sha.js/commit/5657c76f23e92d268010e0fd5880d5c52014eab2) +- hexpp: adhere to stnadard [`2aa2707`](https://github.com/browserify/sha.js/commit/2aa27074799df136b6b49cd0cdb272fe39c742a9) +- tests: remove unused generateCount function [`4a0b095`](https://github.com/browserify/sha.js/commit/4a0b0958e287070efe0bc3d9addff9401e4bbf18) +- adds standard [`0041dbb`](https://github.com/browserify/sha.js/commit/0041dbbd440c0f2e279c6a965485d1d841db3e9e) +- index: adhere to standard [`1839fb7`](https://github.com/browserify/sha.js/commit/1839fb715518fb18077e2b02449ad3627efc3ecb) +- hash: adhere to standard [`1334d89`](https://github.com/browserify/sha.js/commit/1334d89fe96a5854c2871c6352bc6d1a7f843145) +- package: use standard 4.0.0 [`ace4747`](https://github.com/browserify/sha.js/commit/ace474780c743368934c63df64cf12f556bb86a6) +- example is sha256 not sha1 [`8eb102b`](https://github.com/browserify/sha.js/commit/8eb102b6c3faa4a87c134644d019e8c8806a5801) + +## [v2.4.1](https://github.com/browserify/sha.js/compare/v2.4.0...v2.4.1) - 2015-05-19 + +### Merged + +- Update README.md [`#22`](https://github.com/browserify/sha.js/pull/22) + +## [v2.4.0](https://github.com/browserify/sha.js/compare/v2.3.6...v2.4.0) - 2015-04-05 + +### Commits + +- sha0: add implementation [`ca6950d`](https://github.com/browserify/sha.js/commit/ca6950d53c064aa5d767e7166ea29dd0cb61a1b6) +- document legacyness of sha1 and sha0 [`4563da6`](https://github.com/browserify/sha.js/commit/4563da67ee0e86e4eea55b844c6ec73f677e094a) +- README: not just SHA1 anymore [`2a67456`](https://github.com/browserify/sha.js/commit/2a67456d5ab2c6197f8314a83ddb4a9dc59ebfd1) + +## [v2.3.6](https://github.com/browserify/sha.js/compare/v2.3.5...v2.3.6) - 2015-01-14 + +### Commits + +- transfer to crypto-browserify org [`40f1aa9`](https://github.com/browserify/sha.js/commit/40f1aa960c0e7ddc4dc933013d63df41e6362737) + +## [v2.3.5](https://github.com/browserify/sha.js/compare/v2.3.4...v2.3.5) - 2015-01-14 + +### Commits + +- sha512: same branch extraction as #18 [`f985426`](https://github.com/browserify/sha.js/commit/f9854264d841f7138f65eec36010f54043868fdd) +- sha256: extract branches out [`e5486fd`](https://github.com/browserify/sha.js/commit/e5486fde95542a1f79c568f010810b8c7b9889c4) + +## [v2.3.4](https://github.com/browserify/sha.js/compare/v2.3.3...v2.3.4) - 2015-01-13 + +### Commits + +- sha1: use a closure over separate loops [`26a75ec`](https://github.com/browserify/sha.js/commit/26a75eca5f841850a05384d8a3a95e22ee8d9617) + +## [v2.3.3](https://github.com/browserify/sha.js/compare/v2.3.2...v2.3.3) - 2015-01-13 + +### Commits + +- sha1: unroll conditionals [`f830142`](https://github.com/browserify/sha.js/commit/f8301422051bd82cdb490881904b4bd418d5049d) +- sha1: use a closure over seperate loops [`bf46619`](https://github.com/browserify/sha.js/commit/bf46619c437f14c8aec95049fc054a13ee42c779) +- sha1: inline _ft, _kt functions [`3b32ff2`](https://github.com/browserify/sha.js/commit/3b32ff2b18642d57c069152d0dba2dfdc8f6c3ac) + +## [v2.3.2](https://github.com/browserify/sha.js/compare/v2.3.1...v2.3.2) - 2015-01-12 + +### Commits + +- improve sha* code structuring consistency [`d35623d`](https://github.com/browserify/sha.js/commit/d35623d4eddad7bc6f74c6c4f20e59cfc582215d) +- sha*: avoid unnecessary var declaration separation [`d985016`](https://github.com/browserify/sha.js/commit/d9850165dd29f662ff5c9490f9922a2bc65fec73) +- sha1: format sha1_kt similar to sha1_ft for clarity [`c18e7eb`](https://github.com/browserify/sha.js/commit/c18e7eb5ea14c7f5bb99f2664b04e132feeff296) +- adds .gitignore for node_modules [`9dc2814`](https://github.com/browserify/sha.js/commit/9dc2814271d9f119f8b30367d823e72b4f98e1ed) + +## [v2.3.1](https://github.com/browserify/sha.js/compare/v2.3.0...v2.3.1) - 2015-01-12 + +### Commits + +- Use inherits module instead of util [`aef9b82`](https://github.com/browserify/sha.js/commit/aef9b82c629f6ebaf346dab15c2a9bd30fb05aa6) + +## [v2.3.0](https://github.com/browserify/sha.js/compare/v2.2.7...v2.3.0) - 2014-11-18 + +### Commits + +- clean up factories [`996be1c`](https://github.com/browserify/sha.js/commit/996be1cb6a62a479dfb4758c5c431c6381c226cd) +- sha224 and 384 [`56694e5`](https://github.com/browserify/sha.js/commit/56694e5db70844f11a6a4082a549339d3b24ea95) +- add prepublish safety script [`84bde3c`](https://github.com/browserify/sha.js/commit/84bde3cb011f2370034c135727d602522d34e078) + +## [v2.2.7](https://github.com/browserify/sha.js/compare/v2.2.6...v2.2.7) - 2014-11-06 + +### Commits + +- use hash-test-vectors module [`526e246`](https://github.com/browserify/sha.js/commit/526e246cd58f108b410eeae3982756acd06c659c) + +## [v2.2.6](https://github.com/browserify/sha.js/compare/v2.2.5...v2.2.6) - 2014-09-18 + +### Commits + +- don't use global module [`8734884`](https://github.com/browserify/sha.js/commit/87348845d238ba6d8609f22a0972a438d4fc6ab1) +- safely check for IntArray32 existance [`e2376fd`](https://github.com/browserify/sha.js/commit/e2376fd5824fa89ad571e0ea666367511d3a02b5) + +## [v2.2.5](https://github.com/browserify/sha.js/compare/v2.2.4...v2.2.5) - 2014-09-16 + +### Commits + +- move buffer and typedarray into devdeps [`68797f9`](https://github.com/browserify/sha.js/commit/68797f971f55bcf53014e13d9b83adcc0e113ea0) + +## [v2.2.4](https://github.com/browserify/sha.js/compare/v2.2.3...v2.2.4) - 2014-09-16 + +### Commits + +- merge [`7d8b28f`](https://github.com/browserify/sha.js/commit/7d8b28f7627c82ea289e9396d1b93139264e4e1f) +- Fall back to normal array if no typed arrays [`8ca8dfc`](https://github.com/browserify/sha.js/commit/8ca8dfc025e5b2de4a126235b2f3eb4a1046b2d6) +- Don't use console.error [`6e0bd2d`](https://github.com/browserify/sha.js/commit/6e0bd2d8f3db4c267fbaebcbd1b542bc03b1e356) + +## [v2.2.3](https://github.com/browserify/sha.js/compare/v2.2.2...v2.2.3) - 2014-09-16 + +### Commits + +- fix test [`b4e83fa`](https://github.com/browserify/sha.js/commit/b4e83fa8ef732e90c399fcde5f55f8417d623524) + +## [v2.2.2](https://github.com/browserify/sha.js/compare/v2.2.1...v2.2.2) - 2014-09-16 + +### Merged + +- Copyright to contributors [`#10`](https://github.com/browserify/sha.js/pull/10) + +### Commits + +- LICENSE: update to include all contributors [`ac05b4d`](https://github.com/browserify/sha.js/commit/ac05b4d8bfca0c67edd8f20808d61b1aea980ebd) + +## [v2.2.1](https://github.com/browserify/sha.js/compare/v2.2.0...v2.2.1) - 2014-09-16 + +### Commits + +- document implemented hashes [`d123901`](https://github.com/browserify/sha.js/commit/d123901fe28148dce55637ed7942cd4953c9f448) + +## [v2.2.0](https://github.com/browserify/sha.js/compare/v2.1.8...v2.2.0) - 2014-09-16 + +### Commits + +- sha512: add implementation [`3e19416`](https://github.com/browserify/sha.js/commit/3e1941651b20741579c4adfcf69aa0bd607ef932) +- fixtures: remove unused md4 data [`13e43c5`](https://github.com/browserify/sha.js/commit/13e43c59a7109d31147f45a6619af6f8bfa11923) +- get tests working correctly [`01e393f`](https://github.com/browserify/sha.js/commit/01e393fbc4253ce82cf1f57f10c76b087a4b7787) +- remove utils.js [`418d59d`](https://github.com/browserify/sha.js/commit/418d59d40315a50972244ab4103c6d2a59dd86a2) +- fixtures: cleanup of vectors generation [`40f50cc`](https://github.com/browserify/sha.js/commit/40f50ccc29db3f689a04ebfecac2753c895398be) +- sha: jshint cleanup [`a04fae0`](https://github.com/browserify/sha.js/commit/a04fae03acdfb3bbfc7fbf15d928244364b5083a) +- hash: adhere to NIST paper properly [`fb2e39f`](https://github.com/browserify/sha.js/commit/fb2e39f86ce80948b697ac7d0d5f9b7f99c0672c) +- hash: increase verbosity [`b431a1a`](https://github.com/browserify/sha.js/commit/b431a1a24d5d37f856592aabe4593196d60b3b7f) +- hash: use update() argument instead [`0703b9d`](https://github.com/browserify/sha.js/commit/0703b9d38e816d71794a6604060a30e26072b6b7) +- sha: remove unused POOL [`0299989`](https://github.com/browserify/sha.js/commit/02999896280b859d5526820716c737ecbc46d0f6) +- README: add newline before testling badge [`a184d68`](https://github.com/browserify/sha.js/commit/a184d680dae744e7a6adfb73839c3feb6bd5f840) +- LICENSE: update to include all contributors [`edf48c3`](https://github.com/browserify/sha.js/commit/edf48c3b12638cafd509d51b84c39d63f6f00d3b) +- index: remove unused export [`b4de630`](https://github.com/browserify/sha.js/commit/b4de630c9e2092072d0baa5a0a5e93d00ce43c44) + +## [v2.1.8](https://github.com/browserify/sha.js/compare/v2.1.7...v2.1.8) - 2014-08-31 + +### Merged + +- check if DataView exist before using instanceof check [`#6`](https://github.com/browserify/sha.js/pull/6) + +## [v2.1.7](https://github.com/browserify/sha.js/compare/v2.1.6...v2.1.7) - 2014-07-24 + +### Commits + +- check for streaming updates [`4fc22d2`](https://github.com/browserify/sha.js/commit/4fc22d239c87d62155292ed7ccef2e36819bd7a6) +- also test with 3 partial updates [`37981e0`](https://github.com/browserify/sha.js/commit/37981e0b751e4cbb0631472aa19f5facb220cc31) +- Fix streaming updates (limit writing so it doesn't go over block size) [`50b8ddb`](https://github.com/browserify/sha.js/commit/50b8ddb4a5ec8fdaef7c51a01540b237e14a9b5e) + +## [v2.1.6](https://github.com/browserify/sha.js/compare/v2.1.5...v2.1.6) - 2014-07-19 + +### Merged + +- Fixes disparity between 'SHA1' working on node but failing in browser [`#3`](https://github.com/browserify/sha.js/pull/3) + +## [v2.1.5](https://github.com/browserify/sha.js/compare/v2.1.4...v2.1.5) - 2014-06-07 + +### Commits + +- use buffer/ [`23ee33f`](https://github.com/browserify/sha.js/commit/23ee33f8d9ebd5226f6f2fcc6dfcbfddda18af17) + +## v2.1.4 - 2014-06-07 + +### Commits + +- add tests from NIST [`422aa1f`](https://github.com/browserify/sha.js/commit/422aa1fccbd4efc5d2a72fbe7404971c45348c16) +- code to prepare nist-vectors.json [`e799a6f`](https://github.com/browserify/sha.js/commit/e799a6f8b15a9a3796dce295d9485defc7246568) +- inject Buffer dep, so can test with different implementations [`3d89958`](https://github.com/browserify/sha.js/commit/3d8995821e8da1cbf85114589e15843b371b9285) +- initial [`c1cabff`](https://github.com/browserify/sha.js/commit/c1cabff65dc811bd9c7e7530aab90db3b1080f04) +- expose createHash, like node's crypto [`41a1c53`](https://github.com/browserify/sha.js/commit/41a1c531c7947f1bc16ff33ba8dc9335a1a932fd) +- update stuff, still one problem with finalizing some lengths... [`d91aabb`](https://github.com/browserify/sha.js/commit/d91aabb27b0320708aa19943626029510aab3cbb) +- inject Buffer dep into hash [`21df559`](https://github.com/browserify/sha.js/commit/21df55938c274a75d5d04dfd7a4c9abe41d0ce7c) +- refactor tests [`fa6f893`](https://github.com/browserify/sha.js/commit/fa6f893ea0459caa71cd603f244e35f11a617b3b) +- this is quite a bit faster [`84379b3`](https://github.com/browserify/sha.js/commit/84379b3651daca535cbc9aba987563c26d84816f) +- implement sha256! [`70a6101`](https://github.com/browserify/sha.js/commit/70a6101ba6c6a4ae2bf6b89a9feae41c2bcd9559) +- tidy [`dce6d28`](https://github.com/browserify/sha.js/commit/dce6d28d15672d8c95cfc855b8071398b8aaca67) +- move of string stuff, use dataview [`55c7003`](https://github.com/browserify/sha.js/commit/55c7003b99880e54bbd709138028f66c94f51c64) +- update to buffer incrementally [`8cbcade`](https://github.com/browserify/sha.js/commit/8cbcade0875305d3005b97b94b7cdaa61cb93f34) +- refactor, to use buffers in tests [`8e7119b`](https://github.com/browserify/sha.js/commit/8e7119b5c079f51e5c24bfa2d5c3e25536e8b677) +- this is a little faster, but not much... [`55dfc90`](https://github.com/browserify/sha.js/commit/55dfc909269e7b21fb748a5bb594ba3b92a3e03e) +- refactor util functions out [`283f192`](https://github.com/browserify/sha.js/commit/283f1923bdf0bfe48167f240062071cdd2340f78) +- more encodings [`e5071ca`](https://github.com/browserify/sha.js/commit/e5071ca79c80b4d10a2fac860026cdaa291aee27) +- more tests [`655a7be`](https://github.com/browserify/sha.js/commit/655a7be9914298ad63ea77ba4c85dc34ed5f7f9b) +- deal with endianness [`1331b1f`](https://github.com/browserify/sha.js/commit/1331b1f4a1a449c0314cdaec9b0c363a8d8357dd) +- remove custom encoding stuff - just use buffer [`b464d5b`](https://github.com/browserify/sha.js/commit/b464d5bf5cd34de2cb294108179e6967bf3aef28) +- add more encodings to write [`19ce345`](https://github.com/browserify/sha.js/commit/19ce345a06206dda644f21c602aa326597998822) +- separate basic stuff into Hash function [`fe59f0c`](https://github.com/browserify/sha.js/commit/fe59f0cb949fa9e4b5f162f54ebe7b3312b1fc0f) +- experiment using node buffers [`27f6767`](https://github.com/browserify/sha.js/commit/27f676750b9e6e042d2d2ea11ef2c4196f3b417c) +- Several Memory Related Performance Improvements [`9b9badc`](https://github.com/browserify/sha.js/commit/9b9badccae5585d0a1f563ce171635404f97108d) +- tidy [`51c40fa`](https://github.com/browserify/sha.js/commit/51c40fa0c632c5114b574199063f8366621eaaa8) +- use toggle to compare with forge, but inlining makes this the same perf, although removing safe_add improved perf a lot [`15f80b9`](https://github.com/browserify/sha.js/commit/15f80b9e7d1677962f4f0f930e13e0d90de2ef13) +- remove unused utils [`a331a15`](https://github.com/browserify/sha.js/commit/a331a1513efa3bc2cdebc955fa3832ff6306d34f) +- tests for Hash [`417c298`](https://github.com/browserify/sha.js/commit/417c29858090b53b74d91f91b8f8e830dc0384a8) +- for some reason, this is MUCH faster! [`91649a6`](https://github.com/browserify/sha.js/commit/91649a61d6fe8ab2b1f785c1833efa89feeff3b0) +- leaking globals [`7e94cf7`](https://github.com/browserify/sha.js/commit/7e94cf7758ebf70f4c876518495445e971e2eff0) +- delete fakebuffer.js [`e42d66c`](https://github.com/browserify/sha.js/commit/e42d66cf5190a8a0c45e19231ddcd2ef983f1380) +- use bigendian [`f633b94`](https://github.com/browserify/sha.js/commit/f633b94aef9504607b14a2c2805b1e491f3e61b8) +- fix digest [`fdee30b`](https://github.com/browserify/sha.js/commit/fdee30be69cc3fa58a25ae3e32d629251e0a005d) +- tidy [`6f03926`](https://github.com/browserify/sha.js/commit/6f0392697e73f03c8900ccebd4a7d706c77bdea9) +- test incremental update [`d11e6f6`](https://github.com/browserify/sha.js/commit/d11e6f69f4be8d2d1c89f8492d4de2cf2b42027b) +- fake buffer, based on DataView [`71a31b6`](https://github.com/browserify/sha.js/commit/71a31b642d3212076dbd9e54cf6b6072b03c61ad) +- command to hash a large file [`618f16d`](https://github.com/browserify/sha.js/commit/618f16de80ee4b499ab6a493e88845f161dbb0dc) +- { on end of line [`8c1a1a7`](https://github.com/browserify/sha.js/commit/8c1a1a743e740df2e04fa4a9d97a9aea5831529d) +- hammer in a piton, incase I fall off this cliff [`0a211b2`](https://github.com/browserify/sha.js/commit/0a211b2b0abda6252f59f6f3892df1411670c72f) +- basic tests for encoding [`dece220`](https://github.com/browserify/sha.js/commit/dece220424b1d2776a88b35f28d46001e13b10d7) +- tests for hex encoding [`f860f65`](https://github.com/browserify/sha.js/commit/f860f65c173ff92b07643ae55a76516de0b1dded) +- fix fakebuffer [`c421953`](https://github.com/browserify/sha.js/commit/c421953c135fbb1fa3b46df0c3710bc39e50ac4d) +- remove encoding utils [`b0a9d4b`](https://github.com/browserify/sha.js/commit/b0a9d4bc153bd8ffd23d85e5c6a51ac8d7f81d51) +- tidy [`72b825b`](https://github.com/browserify/sha.js/commit/72b825b5a071a37de7bf00f2701bc0af66618ec2) +- tests for fakebuffer [`391fc9f`](https://github.com/browserify/sha.js/commit/391fc9f84988ebc32e8e14687568d8a2418fa34f) +- avoid unnecessary overwrite, 5% improvement [`d061547`](https://github.com/browserify/sha.js/commit/d0615475d9d23ab97814f55fab2e7c6db7adb9bb) +- use dataview [`04b9dee`](https://github.com/browserify/sha.js/commit/04b9deefaf8b1646bc9191f6d955e50c36441da0) +- update vector test to cover sha256 [`aa0d4fa`](https://github.com/browserify/sha.js/commit/aa0d4faef9f05aedf388bf9ca0e5012c4fc14326) +- readme [`6a9992a`](https://github.com/browserify/sha.js/commit/6a9992a77747286d059f0335d5358a013cd0096b) +- toHex supports strings and buffers [`9e17355`](https://github.com/browserify/sha.js/commit/9e173551bba96b7a6d395311948a4887e1461e5e) +- remove redundant tests [`9c701f4`](https://github.com/browserify/sha.js/commit/9c701f4b390b25fd154f85f6b8a5b187542bc463) +- testling [`3515f2f`](https://github.com/browserify/sha.js/commit/3515f2f8c958e3b598a1b6be87ba33cd70ae1591) +- support hex encoding [`b1488b5`](https://github.com/browserify/sha.js/commit/b1488b5dd416c4525e6bc817d7b87da27b275c94) +- remove logging [`ce7d53a`](https://github.com/browserify/sha.js/commit/ce7d53af357062def163f895aa5386e3f6b7e605) +- the working buffer can use system default endianness [`3da2747`](https://github.com/browserify/sha.js/commit/3da27472f74929d223c9ca47c59c219748989981) +- use dataview [`bdba2ec`](https://github.com/browserify/sha.js/commit/bdba2ecbd5877d4e2db012eaaa489467a08fb143) +- support binary encoding [`7b0cae7`](https://github.com/browserify/sha.js/commit/7b0cae71407ec363dc0150c1676fcd0a96a7ea48) +- refactor tests, for createHash [`f424197`](https://github.com/browserify/sha.js/commit/f4241979e140b8317abeb84773136e92d8811ca6) +- Int32 is a little faster than Uint32 [`c61542e`](https://github.com/browserify/sha.js/commit/c61542e06a4c06245aca3860aa36d97e250f08b9) +- simplify bit manipulations [`7e2fc4c`](https://github.com/browserify/sha.js/commit/7e2fc4c06350b35c83d7336c4c36b0acef274373) +- tidy [`e34e8b5`](https://github.com/browserify/sha.js/commit/e34e8b540202f4f548a70d44600287f9e2bd6e82) +- load browserify.js to force native-buffer-browserify [`fd5e58a`](https://github.com/browserify/sha.js/commit/fd5e58a4caa4223fe8f69614d137f219cc11d640) +- tidyup [`12e401b`](https://github.com/browserify/sha.js/commit/12e401b47e7f62ac47edea70efa2db4a044df015) +- this tiny change make it 11% faster on 174mb file! [`f58c321`](https://github.com/browserify/sha.js/commit/f58c3212e40b9c65dc81dcf4765052d4181cf96d) +- support multiple encodings [`36506c6`](https://github.com/browserify/sha.js/commit/36506c6ded807f9a23014b4eb2385ec8ae5d681b) +- tidy [`2c664aa`](https://github.com/browserify/sha.js/commit/2c664aadf9008111c8f19d30f0b8125d0133b79c) +- update hash tests - for some reason, t.deepEqual doesn't work well on buffers? [`8e8e854`](https://github.com/browserify/sha.js/commit/8e8e8547612af4cb628400be0933edeb856f28a5) +- rename to Sha1 [`6620d1a`](https://github.com/browserify/sha.js/commit/6620d1a9a8598e7cf2799e72a786f5bafbaef7a2) +- tidy [`2313658`](https://github.com/browserify/sha.js/commit/2313658f0330b3b851ba55ada7f9ab8a11734802) +- use bops for encoding/decoding [`48d1eb9`](https://github.com/browserify/sha.js/commit/48d1eb9eeee33c2bf55aaae4112ffdf236e20fa2) +- handle large updates all at once, to pass NIST tests [`f2adc77`](https://github.com/browserify/sha.js/commit/f2adc77e49c74d34d8d6715f8b172f3d898bbe32) +- use bops [`5167411`](https://github.com/browserify/sha.js/commit/51674113e9dc35a54d1ec564c51374ad869252b9) +- use fakebuffer instead of buffer [`a6398fe`](https://github.com/browserify/sha.js/commit/a6398fe0582e88aa837a6058494ff7a9c783bd23) +- remove final, and force to Uint8Array [`c42eb76`](https://github.com/browserify/sha.js/commit/c42eb76a6afb318202fd63aff4e6de2145fe4d51) +- todo [`52ef73e`](https://github.com/browserify/sha.js/commit/52ef73e7db22937a2f47ad69e4c4e75fb03215a1) +- remove debugging stuff [`afeb954`](https://github.com/browserify/sha.js/commit/afeb95445f1aff601dba5436ef6024c818d5ed06) +- use bops@0.1.1 [`ccb7eaf`](https://github.com/browserify/sha.js/commit/ccb7eaf1f6e65d590fb4d56797f342e1139a643b) +- convert to string [`abe5373`](https://github.com/browserify/sha.js/commit/abe5373aaf0742cf10dc82b879c0848e22a611fe) +- work around tape/ff [`b95d57c`](https://github.com/browserify/sha.js/commit/b95d57c596a455b3a7b9ad8de95e4374a7d84cf8) +- remove bops [`4d9fb4d`](https://github.com/browserify/sha.js/commit/4d9fb4d8fd8332d69b055e9d1dd1ba5aad5ebb8c) +- this made no difference [`0a0ee38`](https://github.com/browserify/sha.js/commit/0a0ee38c5fead881b3bdb96c9b47a59b62451b13) +- drop support for legacy versions [`e7c530f`](https://github.com/browserify/sha.js/commit/e7c530f19a33aac5768e50dffc8fc93df4070af3) +- a few more test cases [`48ce51b`](https://github.com/browserify/sha.js/commit/48ce51b50b62bb53bd6effdfe42be232f31ffa52) +- use buffer methods [`6a572d2`](https://github.com/browserify/sha.js/commit/6a572d2a27e20c990f8a32d7c39606a0571f9fe7) +- getter for buffer length [`56c1e35`](https://github.com/browserify/sha.js/commit/56c1e35583aa53b1aaaff68d43a4bf4a0c206eea) +- more debuging [`f1c9d10`](https://github.com/browserify/sha.js/commit/f1c9d104d188fbc5ff447a8dc7976400646d3ffb) +- HAHA IT WORKS [`ee95185`](https://github.com/browserify/sha.js/commit/ee9518599957a64d46d8d45aeaae649ec85641c9) +- test coverage for binary encoding [`96e417c`](https://github.com/browserify/sha.js/commit/96e417cd12df156f6f0d3608bdd62ef9d661c41d) +- set debug mode to show time elapsed [`36d4639`](https://github.com/browserify/sha.js/commit/36d46393bde62248e5949b1954b61a96e7220c1c) +- interpret utf-8 as utf8 [`53bd808`](https://github.com/browserify/sha.js/commit/53bd8080ed929d408856b762a43076b1cad19584) +- use browserify edge case to get browser version of core module in node [`657c0a9`](https://github.com/browserify/sha.js/commit/657c0a94c914dee1a473b21f1f3c736a5e715a45) +- native-buffer-browserify -> buffer [`c6a2777`](https://github.com/browserify/sha.js/commit/c6a2777e3ec85de16215f79171fbf2b561556b17) +- do not run test/test.js in the browser, it depends on node.js [`d1d4ac8`](https://github.com/browserify/sha.js/commit/d1d4ac8d27ef65c3fb1dac6b7ef612fabceeea26) +- compute correct length for binary string [`c616d74`](https://github.com/browserify/sha.js/commit/c616d7435493c67d399954d8b5673691b5405e83) +- tidy [`d176073`](https://github.com/browserify/sha.js/commit/d176073dbba34810b86e656dac3a268b438abafe) +- this is twice as fast! turns out creating DataViews is quite slow! /cc @feross [`3ba9a1f`](https://github.com/browserify/sha.js/commit/3ba9a1fe2c33cc4e88ff953ba5c5544d4be311d1) +- use _blockLength property [`fdf1030`](https://github.com/browserify/sha.js/commit/fdf10309e4334347e8f668d6ec6d25ea16856f8e) +- allow subclass to give hash by _hash method [`d47673b`](https://github.com/browserify/sha.js/commit/d47673bc4b2b66f46f0eec342f5e424f5147c48d) +- use my toHex [`76ffe66`](https://github.com/browserify/sha.js/commit/76ffe66ba119e9e8fc88d6a5b5dcd5ffabf2a9da) +- didin't work [`254a4e8`](https://github.com/browserify/sha.js/commit/254a4e8c3e4fe79c8ce4cacd23a91426e9d8f32f) +- always run all tests [`18f39f8`](https://github.com/browserify/sha.js/commit/18f39f8e96ddebd86d32604b55c388e0c72306e1) +- remove hexpp [`e7f3030`](https://github.com/browserify/sha.js/commit/e7f30308c64bfc5f00a9b8ccf4c17ae65a3ddc55) +- make installable as a command [`f6842dd`](https://github.com/browserify/sha.js/commit/f6842dde37f0b37042e513fc63d214989417fff4) +- 0.11 is not working... [`a6aacc6`](https://github.com/browserify/sha.js/commit/a6aacc66f417ee17a4363cc1d20350bfa7a682cc) diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/LICENSE b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/LICENSE new file mode 100644 index 00000000..11888c13 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/LICENSE @@ -0,0 +1,49 @@ +Copyright (c) 2013-2018 sha.js contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +Copyright (c) 1998 - 2009, Paul Johnston & Contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +Neither the name of the author nor the names of its contributors may be used to +endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/README.md b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/README.md new file mode 100644 index 00000000..2a6ad74b --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/README.md @@ -0,0 +1,44 @@ +# sha.js +[![NPM Package](https://img.shields.io/npm/v/sha.js.svg?style=flat-square)](https://www.npmjs.org/package/sha.js) +[![Build Status](https://img.shields.io/travis/crypto-browserify/sha.js.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/sha.js) +[![Dependency status](https://img.shields.io/david/crypto-browserify/sha.js.svg?style=flat-square)](https://david-dm.org/crypto-browserify/sha.js#info=dependencies) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +Node style `SHA` on pure JavaScript. + +```js +var shajs = require('sha.js') + +console.log(shajs('sha256').update('42').digest('hex')) +// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 +console.log(new shajs.sha256().update('42').digest('hex')) +// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 + +var sha256stream = shajs('sha256') +sha256stream.end('42') +console.log(sha256stream.read().toString('hex')) +// => 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 +``` + +## supported hashes +`sha.js` currently implements: + + - SHA (SHA-0) -- **legacy, do not use in new systems** + - SHA-1 -- **legacy, do not use in new systems** + - SHA-224 + - SHA-256 + - SHA-384 + - SHA-512 + + +## Not an actual stream +Note, this doesn't actually implement a stream, but wrapping this in a stream is trivial. +It does update incrementally, so you can hash things larger than RAM, as it uses a constant amount of memory (except when using base64 or utf8 encoding, see code comments). + + +## Acknowledgements +This work is derived from Paul Johnston's [A JavaScript implementation of the Secure Hash Algorithm](http://pajhome.org.uk/crypt/md5/sha1.html). + + +## LICENSE [MIT AND BSD-3-Clause](LICENSE) diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/bin.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/bin.js new file mode 100755 index 00000000..596f292f --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/bin.js @@ -0,0 +1,44 @@ +#! /usr/bin/env node + +'use strict'; + +var createHash = require('./browserify'); +var argv = process.argv.slice(2); + +function pipe(algorithm, s) { + var start = Date.now(); + var hash = createHash(algorithm || 'sha1'); + + s.on('data', function (data) { + hash.update(data); + }); + + s.on('end', function () { + if (process.env.DEBUG) { + console.log(hash.digest('hex'), Date.now() - start); + } else { + console.log(hash.digest('hex')); + } + }); +} + +function usage() { + console.error('sha.js [algorithm=sha1] [filename] # hash filename with algorithm'); + console.error('input | sha.js [algorithm=sha1] # hash stdin with algorithm'); + console.error('sha.js --help # display this message'); +} + +if (!process.stdin.isTTY) { + pipe(argv[0], process.stdin); +} else if (argv.length) { + if ((/--help|-h/).test(argv[0])) { + usage(); + } else { + var filename = argv.pop(); + var algorithm = argv.pop(); + // eslint-disable-next-line global-require + pipe(algorithm, require('fs').createReadStream(filename)); + } +} else { + usage(); +} diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/hash.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/hash.js new file mode 100644 index 00000000..397b87a5 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/hash.js @@ -0,0 +1,84 @@ +'use strict'; + +var Buffer = require('safe-buffer').Buffer; +var toBuffer = require('to-buffer'); + +// prototype class for hash functions +function Hash(blockSize, finalSize) { + this._block = Buffer.alloc(blockSize); + this._finalSize = finalSize; + this._blockSize = blockSize; + this._len = 0; +} + +Hash.prototype.update = function (data, enc) { + /* eslint no-param-reassign: 0 */ + data = toBuffer(data, enc || 'utf8'); + + var block = this._block; + var blockSize = this._blockSize; + var length = data.length; + var accum = this._len; + + for (var offset = 0; offset < length;) { + var assigned = accum % blockSize; + var remainder = Math.min(length - offset, blockSize - assigned); + + for (var i = 0; i < remainder; i++) { + block[assigned + i] = data[offset + i]; + } + + accum += remainder; + offset += remainder; + + if ((accum % blockSize) === 0) { + this._update(block); + } + } + + this._len += length; + return this; +}; + +Hash.prototype.digest = function (enc) { + var rem = this._len % this._blockSize; + + this._block[rem] = 0x80; + + /* + * zero (rem + 1) trailing bits, where (rem + 1) is the smallest + * non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize + */ + this._block.fill(0, rem + 1); + + if (rem >= this._finalSize) { + this._update(this._block); + this._block.fill(0); + } + + var bits = this._len * 8; + + // uint32 + if (bits <= 0xffffffff) { + this._block.writeUInt32BE(bits, this._blockSize - 4); + + // uint64 + } else { + var lowBits = (bits & 0xffffffff) >>> 0; + var highBits = (bits - lowBits) / 0x100000000; + + this._block.writeUInt32BE(highBits, this._blockSize - 8); + this._block.writeUInt32BE(lowBits, this._blockSize - 4); + } + + this._update(this._block); + var hash = this._hash(); + + return enc ? hash.toString(enc) : hash; +}; + +Hash.prototype._update = function () { + throw new Error('_update must be implemented by subclass'); +}; + +module.exports = Hash; diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/index.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/index.js new file mode 100644 index 00000000..912e5976 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/index.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = function SHA(algorithm) { + var alg = algorithm.toLowerCase(); + + var Algorithm = module.exports[alg]; + if (!Algorithm) { + throw new Error(alg + ' is not supported (we accept pull requests)'); + } + + return new Algorithm(); +}; + +module.exports.sha = require('./sha'); +module.exports.sha1 = require('./sha1'); +module.exports.sha224 = require('./sha224'); +module.exports.sha256 = require('./sha256'); +module.exports.sha384 = require('./sha384'); +module.exports.sha512 = require('./sha512'); diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/node_modules/.bin/sha.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/node_modules/.bin/sha.js new file mode 100755 index 00000000..975da104 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/node_modules/.bin/sha.js @@ -0,0 +1,74 @@ +#!/bin/sh +# Resolve $0 through symlinks so basedir is the shim's real directory. +# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim. +# +# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed, +# uname, and printf go through `command -p`, which searches the system default +# path instead. A dependency's bin cannot stand in for one of them and take over +# the shim before it reaches its target. Directories come from `${link%/*}`, +# which needs no helper at all. +link="$0" +# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup +# and stands for a file in the current directory. +case "$link" in + */*|*\\*) ;; + *) link="./$link" ;; +esac +hops=0 +while [ -L "$link" ] && [ "$hops" -lt 40 ]; do + hops=$((hops+1)) + target=$(command -p readlink "$link") + case "$target" in + /*) link="$target" ;; + *) link="${link%/*}/$target" ;; + esac +done +basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g') +basedir="${basedir%/*}" +basedir_win="$basedir" +exe="" +msys="" + +case `command -p uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + elif command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if converted=$(command -p wslpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then + basedir_win="$converted" + exe=".exe" + elif command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $? +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="$basedir_abs/..:$basedir_abs/../../..:$basedir_abs/../../../../../node_modules" +else + export NODE_PATH="$basedir_abs/..:$basedir_abs/../../..:$basedir_abs/../../../../../node_modules:$NODE_PATH" +fi +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../../bin.js" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir_abs/../../bin.js" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir_abs/../../bin.js" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../../bin.js" "$@" +else + exec node "$basedir_abs/../../bin.js" "$@" +fi +# cmd-shim-target=../../bin.js diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/package.json b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/package.json new file mode 100644 index 00000000..16c91b5e --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/package.json @@ -0,0 +1,58 @@ +{ + "name": "sha.js", + "description": "Streamable SHA hashes in pure javascript", + "version": "2.4.12", + "repository": { + "type": "git", + "url": "git://github.com/crypto-browserify/sha.js.git" + }, + "bin": "./bin.js", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "lint": "eslint --ext=js,mjs .", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "tape 'test/**/*.js'", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "license": "(MIT AND BSD-3-Clause)", + "author": "Dominic Tarr (dominictarr.com)", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/crypto-browserify/sha.js", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.0" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.2.0", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "hash-test-vectors": "^1.3.2", + "npmignore": "^0.3.1", + "tape": "^5.9.0", + "typedarray": "^0.0.7" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + ".github" + ] + }, + "engines": { + "node": ">= 0.10" + } +} diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha.js new file mode 100644 index 00000000..fdfe4c14 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha.js @@ -0,0 +1,104 @@ +'use strict'; + +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined + * in FIPS PUB 180-1 + * This source code is derived from sha1.js of the same repository. + * The difference between SHA-0 and SHA-1 is just a bitwise rotate left + * operation was added. + */ + +var inherits = require('inherits'); +var Hash = require('./hash'); +var Buffer = require('safe-buffer').Buffer; + +var K = [ + 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 +]; + +var W = new Array(80); + +function Sha() { + this.init(); + this._w = W; + + Hash.call(this, 64, 56); +} + +inherits(Sha, Hash); + +Sha.prototype.init = function () { + this._a = 0x67452301; + this._b = 0xefcdab89; + this._c = 0x98badcfe; + this._d = 0x10325476; + this._e = 0xc3d2e1f0; + + return this; +}; + +function rotl5(num) { + return (num << 5) | (num >>> 27); +} + +function rotl30(num) { + return (num << 30) | (num >>> 2); +} + +function ft(s, b, c, d) { + if (s === 0) { + return (b & c) | (~b & d); + } + if (s === 2) { + return (b & c) | (b & d) | (c & d); + } + return b ^ c ^ d; +} + +Sha.prototype._update = function (M) { + var w = this._w; + + var a = this._a | 0; + var b = this._b | 0; + var c = this._c | 0; + var d = this._d | 0; + var e = this._e | 0; + + for (var i = 0; i < 16; ++i) { + w[i] = M.readInt32BE(i * 4); + } + for (; i < 80; ++i) { + w[i] = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]; + } + + for (var j = 0; j < 80; ++j) { + var s = ~~(j / 20); + var t = (rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s]) | 0; + + e = d; + d = c; + c = rotl30(b); + b = a; + a = t; + } + + this._a = (a + this._a) | 0; + this._b = (b + this._b) | 0; + this._c = (c + this._c) | 0; + this._d = (d + this._d) | 0; + this._e = (e + this._e) | 0; +}; + +Sha.prototype._hash = function () { + var H = Buffer.allocUnsafe(20); + + H.writeInt32BE(this._a | 0, 0); + H.writeInt32BE(this._b | 0, 4); + H.writeInt32BE(this._c | 0, 8); + H.writeInt32BE(this._d | 0, 12); + H.writeInt32BE(this._e | 0, 16); + + return H; +}; + +module.exports = Sha; diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha1.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha1.js new file mode 100644 index 00000000..0891453c --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha1.js @@ -0,0 +1,109 @@ +'use strict'; + +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS PUB 180-1 + * Version 2.1a Copyright Paul Johnston 2000 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ + +var inherits = require('inherits'); +var Hash = require('./hash'); +var Buffer = require('safe-buffer').Buffer; + +var K = [ + 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 +]; + +var W = new Array(80); + +function Sha1() { + this.init(); + this._w = W; + + Hash.call(this, 64, 56); +} + +inherits(Sha1, Hash); + +Sha1.prototype.init = function () { + this._a = 0x67452301; + this._b = 0xefcdab89; + this._c = 0x98badcfe; + this._d = 0x10325476; + this._e = 0xc3d2e1f0; + + return this; +}; + +function rotl1(num) { + return (num << 1) | (num >>> 31); +} + +function rotl5(num) { + return (num << 5) | (num >>> 27); +} + +function rotl30(num) { + return (num << 30) | (num >>> 2); +} + +function ft(s, b, c, d) { + if (s === 0) { + return (b & c) | (~b & d); + } + if (s === 2) { + return (b & c) | (b & d) | (c & d); + } + return b ^ c ^ d; +} + +Sha1.prototype._update = function (M) { + var w = this._w; + + var a = this._a | 0; + var b = this._b | 0; + var c = this._c | 0; + var d = this._d | 0; + var e = this._e | 0; + + for (var i = 0; i < 16; ++i) { + w[i] = M.readInt32BE(i * 4); + } + for (; i < 80; ++i) { + w[i] = rotl1(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); + } + + for (var j = 0; j < 80; ++j) { + var s = ~~(j / 20); + var t = (rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s]) | 0; + + e = d; + d = c; + c = rotl30(b); + b = a; + a = t; + } + + this._a = (a + this._a) | 0; + this._b = (b + this._b) | 0; + this._c = (c + this._c) | 0; + this._d = (d + this._d) | 0; + this._e = (e + this._e) | 0; +}; + +Sha1.prototype._hash = function () { + var H = Buffer.allocUnsafe(20); + + H.writeInt32BE(this._a | 0, 0); + H.writeInt32BE(this._b | 0, 4); + H.writeInt32BE(this._c | 0, 8); + H.writeInt32BE(this._d | 0, 12); + H.writeInt32BE(this._e | 0, 16); + + return H; +}; + +module.exports = Sha1; diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha224.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha224.js new file mode 100644 index 00000000..9cd0702c --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha224.js @@ -0,0 +1,55 @@ +'use strict'; + +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = require('inherits'); +var Sha256 = require('./sha256'); +var Hash = require('./hash'); +var Buffer = require('safe-buffer').Buffer; + +var W = new Array(64); + +function Sha224() { + this.init(); + + this._w = W; // new Array(64) + + Hash.call(this, 64, 56); +} + +inherits(Sha224, Sha256); + +Sha224.prototype.init = function () { + this._a = 0xc1059ed8; + this._b = 0x367cd507; + this._c = 0x3070dd17; + this._d = 0xf70e5939; + this._e = 0xffc00b31; + this._f = 0x68581511; + this._g = 0x64f98fa7; + this._h = 0xbefa4fa4; + + return this; +}; + +Sha224.prototype._hash = function () { + var H = Buffer.allocUnsafe(28); + + H.writeInt32BE(this._a, 0); + H.writeInt32BE(this._b, 4); + H.writeInt32BE(this._c, 8); + H.writeInt32BE(this._d, 12); + H.writeInt32BE(this._e, 16); + H.writeInt32BE(this._f, 20); + H.writeInt32BE(this._g, 24); + + return H; +}; + +module.exports = Sha224; diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha256.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha256.js new file mode 100644 index 00000000..6741589d --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha256.js @@ -0,0 +1,189 @@ +'use strict'; + +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = require('inherits'); +var Hash = require('./hash'); +var Buffer = require('safe-buffer').Buffer; + +var K = [ + 0x428A2F98, + 0x71374491, + 0xB5C0FBCF, + 0xE9B5DBA5, + 0x3956C25B, + 0x59F111F1, + 0x923F82A4, + 0xAB1C5ED5, + 0xD807AA98, + 0x12835B01, + 0x243185BE, + 0x550C7DC3, + 0x72BE5D74, + 0x80DEB1FE, + 0x9BDC06A7, + 0xC19BF174, + 0xE49B69C1, + 0xEFBE4786, + 0x0FC19DC6, + 0x240CA1CC, + 0x2DE92C6F, + 0x4A7484AA, + 0x5CB0A9DC, + 0x76F988DA, + 0x983E5152, + 0xA831C66D, + 0xB00327C8, + 0xBF597FC7, + 0xC6E00BF3, + 0xD5A79147, + 0x06CA6351, + 0x14292967, + 0x27B70A85, + 0x2E1B2138, + 0x4D2C6DFC, + 0x53380D13, + 0x650A7354, + 0x766A0ABB, + 0x81C2C92E, + 0x92722C85, + 0xA2BFE8A1, + 0xA81A664B, + 0xC24B8B70, + 0xC76C51A3, + 0xD192E819, + 0xD6990624, + 0xF40E3585, + 0x106AA070, + 0x19A4C116, + 0x1E376C08, + 0x2748774C, + 0x34B0BCB5, + 0x391C0CB3, + 0x4ED8AA4A, + 0x5B9CCA4F, + 0x682E6FF3, + 0x748F82EE, + 0x78A5636F, + 0x84C87814, + 0x8CC70208, + 0x90BEFFFA, + 0xA4506CEB, + 0xBEF9A3F7, + 0xC67178F2 +]; + +var W = new Array(64); + +function Sha256() { + this.init(); + + this._w = W; // new Array(64) + + Hash.call(this, 64, 56); +} + +inherits(Sha256, Hash); + +Sha256.prototype.init = function () { + this._a = 0x6a09e667; + this._b = 0xbb67ae85; + this._c = 0x3c6ef372; + this._d = 0xa54ff53a; + this._e = 0x510e527f; + this._f = 0x9b05688c; + this._g = 0x1f83d9ab; + this._h = 0x5be0cd19; + + return this; +}; + +function ch(x, y, z) { + return z ^ (x & (y ^ z)); +} + +function maj(x, y, z) { + return (x & y) | (z & (x | y)); +} + +function sigma0(x) { + return ((x >>> 2) | (x << 30)) ^ ((x >>> 13) | (x << 19)) ^ ((x >>> 22) | (x << 10)); +} + +function sigma1(x) { + return ((x >>> 6) | (x << 26)) ^ ((x >>> 11) | (x << 21)) ^ ((x >>> 25) | (x << 7)); +} + +function gamma0(x) { + return ((x >>> 7) | (x << 25)) ^ ((x >>> 18) | (x << 14)) ^ (x >>> 3); +} + +function gamma1(x) { + return ((x >>> 17) | (x << 15)) ^ ((x >>> 19) | (x << 13)) ^ (x >>> 10); +} + +Sha256.prototype._update = function (M) { + var w = this._w; + + var a = this._a | 0; + var b = this._b | 0; + var c = this._c | 0; + var d = this._d | 0; + var e = this._e | 0; + var f = this._f | 0; + var g = this._g | 0; + var h = this._h | 0; + + for (var i = 0; i < 16; ++i) { + w[i] = M.readInt32BE(i * 4); + } + for (; i < 64; ++i) { + w[i] = (gamma1(w[i - 2]) + w[i - 7] + gamma0(w[i - 15]) + w[i - 16]) | 0; + } + + for (var j = 0; j < 64; ++j) { + var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + w[j]) | 0; + var T2 = (sigma0(a) + maj(a, b, c)) | 0; + + h = g; + g = f; + f = e; + e = (d + T1) | 0; + d = c; + c = b; + b = a; + a = (T1 + T2) | 0; + } + + this._a = (a + this._a) | 0; + this._b = (b + this._b) | 0; + this._c = (c + this._c) | 0; + this._d = (d + this._d) | 0; + this._e = (e + this._e) | 0; + this._f = (f + this._f) | 0; + this._g = (g + this._g) | 0; + this._h = (h + this._h) | 0; +}; + +Sha256.prototype._hash = function () { + var H = Buffer.allocUnsafe(32); + + H.writeInt32BE(this._a, 0); + H.writeInt32BE(this._b, 4); + H.writeInt32BE(this._c, 8); + H.writeInt32BE(this._d, 12); + H.writeInt32BE(this._e, 16); + H.writeInt32BE(this._f, 20); + H.writeInt32BE(this._g, 24); + H.writeInt32BE(this._h, 28); + + return H; +}; + +module.exports = Sha256; diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha384.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha384.js new file mode 100644 index 00000000..ad260ddb --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha384.js @@ -0,0 +1,59 @@ +'use strict'; + +var inherits = require('inherits'); +var SHA512 = require('./sha512'); +var Hash = require('./hash'); +var Buffer = require('safe-buffer').Buffer; + +var W = new Array(160); + +function Sha384() { + this.init(); + this._w = W; + + Hash.call(this, 128, 112); +} + +inherits(Sha384, SHA512); + +Sha384.prototype.init = function () { + this._ah = 0xcbbb9d5d; + this._bh = 0x629a292a; + this._ch = 0x9159015a; + this._dh = 0x152fecd8; + this._eh = 0x67332667; + this._fh = 0x8eb44a87; + this._gh = 0xdb0c2e0d; + this._hh = 0x47b5481d; + + this._al = 0xc1059ed8; + this._bl = 0x367cd507; + this._cl = 0x3070dd17; + this._dl = 0xf70e5939; + this._el = 0xffc00b31; + this._fl = 0x68581511; + this._gl = 0x64f98fa7; + this._hl = 0xbefa4fa4; + + return this; +}; + +Sha384.prototype._hash = function () { + var H = Buffer.allocUnsafe(48); + + function writeInt64BE(h, l, offset) { + H.writeInt32BE(h, offset); + H.writeInt32BE(l, offset + 4); + } + + writeInt64BE(this._ah, this._al, 0); + writeInt64BE(this._bh, this._bl, 8); + writeInt64BE(this._ch, this._cl, 16); + writeInt64BE(this._dh, this._dl, 24); + writeInt64BE(this._eh, this._el, 32); + writeInt64BE(this._fh, this._fl, 40); + + return H; +}; + +module.exports = Sha384; diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha512.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha512.js new file mode 100644 index 00000000..9328a763 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/sha512.js @@ -0,0 +1,382 @@ +'use strict'; + +var inherits = require('inherits'); +var Hash = require('./hash'); +var Buffer = require('safe-buffer').Buffer; + +var K = [ + 0x428a2f98, + 0xd728ae22, + 0x71374491, + 0x23ef65cd, + 0xb5c0fbcf, + 0xec4d3b2f, + 0xe9b5dba5, + 0x8189dbbc, + 0x3956c25b, + 0xf348b538, + 0x59f111f1, + 0xb605d019, + 0x923f82a4, + 0xaf194f9b, + 0xab1c5ed5, + 0xda6d8118, + 0xd807aa98, + 0xa3030242, + 0x12835b01, + 0x45706fbe, + 0x243185be, + 0x4ee4b28c, + 0x550c7dc3, + 0xd5ffb4e2, + 0x72be5d74, + 0xf27b896f, + 0x80deb1fe, + 0x3b1696b1, + 0x9bdc06a7, + 0x25c71235, + 0xc19bf174, + 0xcf692694, + 0xe49b69c1, + 0x9ef14ad2, + 0xefbe4786, + 0x384f25e3, + 0x0fc19dc6, + 0x8b8cd5b5, + 0x240ca1cc, + 0x77ac9c65, + 0x2de92c6f, + 0x592b0275, + 0x4a7484aa, + 0x6ea6e483, + 0x5cb0a9dc, + 0xbd41fbd4, + 0x76f988da, + 0x831153b5, + 0x983e5152, + 0xee66dfab, + 0xa831c66d, + 0x2db43210, + 0xb00327c8, + 0x98fb213f, + 0xbf597fc7, + 0xbeef0ee4, + 0xc6e00bf3, + 0x3da88fc2, + 0xd5a79147, + 0x930aa725, + 0x06ca6351, + 0xe003826f, + 0x14292967, + 0x0a0e6e70, + 0x27b70a85, + 0x46d22ffc, + 0x2e1b2138, + 0x5c26c926, + 0x4d2c6dfc, + 0x5ac42aed, + 0x53380d13, + 0x9d95b3df, + 0x650a7354, + 0x8baf63de, + 0x766a0abb, + 0x3c77b2a8, + 0x81c2c92e, + 0x47edaee6, + 0x92722c85, + 0x1482353b, + 0xa2bfe8a1, + 0x4cf10364, + 0xa81a664b, + 0xbc423001, + 0xc24b8b70, + 0xd0f89791, + 0xc76c51a3, + 0x0654be30, + 0xd192e819, + 0xd6ef5218, + 0xd6990624, + 0x5565a910, + 0xf40e3585, + 0x5771202a, + 0x106aa070, + 0x32bbd1b8, + 0x19a4c116, + 0xb8d2d0c8, + 0x1e376c08, + 0x5141ab53, + 0x2748774c, + 0xdf8eeb99, + 0x34b0bcb5, + 0xe19b48a8, + 0x391c0cb3, + 0xc5c95a63, + 0x4ed8aa4a, + 0xe3418acb, + 0x5b9cca4f, + 0x7763e373, + 0x682e6ff3, + 0xd6b2b8a3, + 0x748f82ee, + 0x5defb2fc, + 0x78a5636f, + 0x43172f60, + 0x84c87814, + 0xa1f0ab72, + 0x8cc70208, + 0x1a6439ec, + 0x90befffa, + 0x23631e28, + 0xa4506ceb, + 0xde82bde9, + 0xbef9a3f7, + 0xb2c67915, + 0xc67178f2, + 0xe372532b, + 0xca273ece, + 0xea26619c, + 0xd186b8c7, + 0x21c0c207, + 0xeada7dd6, + 0xcde0eb1e, + 0xf57d4f7f, + 0xee6ed178, + 0x06f067aa, + 0x72176fba, + 0x0a637dc5, + 0xa2c898a6, + 0x113f9804, + 0xbef90dae, + 0x1b710b35, + 0x131c471b, + 0x28db77f5, + 0x23047d84, + 0x32caab7b, + 0x40c72493, + 0x3c9ebe0a, + 0x15c9bebc, + 0x431d67c4, + 0x9c100d4c, + 0x4cc5d4be, + 0xcb3e42b6, + 0x597f299c, + 0xfc657e2a, + 0x5fcb6fab, + 0x3ad6faec, + 0x6c44198c, + 0x4a475817 +]; + +var W = new Array(160); + +function Sha512() { + this.init(); + this._w = W; + + Hash.call(this, 128, 112); +} + +inherits(Sha512, Hash); + +Sha512.prototype.init = function () { + this._ah = 0x6a09e667; + this._bh = 0xbb67ae85; + this._ch = 0x3c6ef372; + this._dh = 0xa54ff53a; + this._eh = 0x510e527f; + this._fh = 0x9b05688c; + this._gh = 0x1f83d9ab; + this._hh = 0x5be0cd19; + + this._al = 0xf3bcc908; + this._bl = 0x84caa73b; + this._cl = 0xfe94f82b; + this._dl = 0x5f1d36f1; + this._el = 0xade682d1; + this._fl = 0x2b3e6c1f; + this._gl = 0xfb41bd6b; + this._hl = 0x137e2179; + + return this; +}; + +function Ch(x, y, z) { + return z ^ (x & (y ^ z)); +} + +function maj(x, y, z) { + return (x & y) | (z & (x | y)); +} + +function sigma0(x, xl) { + return ((x >>> 28) | (xl << 4)) ^ ((xl >>> 2) | (x << 30)) ^ ((xl >>> 7) | (x << 25)); +} + +function sigma1(x, xl) { + return ((x >>> 14) | (xl << 18)) ^ ((x >>> 18) | (xl << 14)) ^ ((xl >>> 9) | (x << 23)); +} + +function Gamma0(x, xl) { + return ((x >>> 1) | (xl << 31)) ^ ((x >>> 8) | (xl << 24)) ^ (x >>> 7); +} + +function Gamma0l(x, xl) { + return ((x >>> 1) | (xl << 31)) ^ ((x >>> 8) | (xl << 24)) ^ ((x >>> 7) | (xl << 25)); +} + +function Gamma1(x, xl) { + return ((x >>> 19) | (xl << 13)) ^ ((xl >>> 29) | (x << 3)) ^ (x >>> 6); +} + +function Gamma1l(x, xl) { + return ((x >>> 19) | (xl << 13)) ^ ((xl >>> 29) | (x << 3)) ^ ((x >>> 6) | (xl << 26)); +} + +function getCarry(a, b) { + return (a >>> 0) < (b >>> 0) ? 1 : 0; +} + +Sha512.prototype._update = function (M) { + var w = this._w; + + var ah = this._ah | 0; + var bh = this._bh | 0; + var ch = this._ch | 0; + var dh = this._dh | 0; + var eh = this._eh | 0; + var fh = this._fh | 0; + var gh = this._gh | 0; + var hh = this._hh | 0; + + var al = this._al | 0; + var bl = this._bl | 0; + var cl = this._cl | 0; + var dl = this._dl | 0; + var el = this._el | 0; + var fl = this._fl | 0; + var gl = this._gl | 0; + var hl = this._hl | 0; + + for (var i = 0; i < 32; i += 2) { + w[i] = M.readInt32BE(i * 4); + w[i + 1] = M.readInt32BE((i * 4) + 4); + } + for (; i < 160; i += 2) { + var xh = w[i - (15 * 2)]; + var xl = w[i - (15 * 2) + 1]; + var gamma0 = Gamma0(xh, xl); + var gamma0l = Gamma0l(xl, xh); + + xh = w[i - (2 * 2)]; + xl = w[i - (2 * 2) + 1]; + var gamma1 = Gamma1(xh, xl); + var gamma1l = Gamma1l(xl, xh); + + // w[i] = gamma0 + w[i - 7] + gamma1 + w[i - 16] + var Wi7h = w[i - (7 * 2)]; + var Wi7l = w[i - (7 * 2) + 1]; + + var Wi16h = w[i - (16 * 2)]; + var Wi16l = w[i - (16 * 2) + 1]; + + var Wil = (gamma0l + Wi7l) | 0; + var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0; + Wil = (Wil + gamma1l) | 0; + Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0; + Wil = (Wil + Wi16l) | 0; + Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0; + + w[i] = Wih; + w[i + 1] = Wil; + } + + for (var j = 0; j < 160; j += 2) { + Wih = w[j]; + Wil = w[j + 1]; + + var majh = maj(ah, bh, ch); + var majl = maj(al, bl, cl); + + var sigma0h = sigma0(ah, al); + var sigma0l = sigma0(al, ah); + var sigma1h = sigma1(eh, el); + var sigma1l = sigma1(el, eh); + + // t1 = h + sigma1 + ch + K[j] + w[j] + var Kih = K[j]; + var Kil = K[j + 1]; + + var chh = Ch(eh, fh, gh); + var chl = Ch(el, fl, gl); + + var t1l = (hl + sigma1l) | 0; + var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0; + t1l = (t1l + chl) | 0; + t1h = (t1h + chh + getCarry(t1l, chl)) | 0; + t1l = (t1l + Kil) | 0; + t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0; + t1l = (t1l + Wil) | 0; + t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0; + + // t2 = sigma0 + maj + var t2l = (sigma0l + majl) | 0; + var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0; + + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + getCarry(el, dl)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + getCarry(al, t1l)) | 0; + } + + this._al = (this._al + al) | 0; + this._bl = (this._bl + bl) | 0; + this._cl = (this._cl + cl) | 0; + this._dl = (this._dl + dl) | 0; + this._el = (this._el + el) | 0; + this._fl = (this._fl + fl) | 0; + this._gl = (this._gl + gl) | 0; + this._hl = (this._hl + hl) | 0; + + this._ah = (this._ah + ah + getCarry(this._al, al)) | 0; + this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0; + this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0; + this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0; + this._eh = (this._eh + eh + getCarry(this._el, el)) | 0; + this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0; + this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0; + this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0; +}; + +Sha512.prototype._hash = function () { + var H = Buffer.allocUnsafe(64); + + function writeInt64BE(h, l, offset) { + H.writeInt32BE(h, offset); + H.writeInt32BE(l, offset + 4); + } + + writeInt64BE(this._ah, this._al, 0); + writeInt64BE(this._bh, this._bl, 8); + writeInt64BE(this._ch, this._cl, 16); + writeInt64BE(this._dh, this._dl, 24); + writeInt64BE(this._eh, this._el, 32); + writeInt64BE(this._fh, this._fl, 40); + writeInt64BE(this._gh, this._gl, 48); + writeInt64BE(this._hh, this._hl, 56); + + return H; +}; + +module.exports = Sha512; diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/hash.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/hash.js new file mode 100644 index 00000000..fd844530 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/hash.js @@ -0,0 +1,80 @@ +'use strict'; + +var tape = require('tape'); +var Buffer = require('safe-buffer').Buffer; + +var Hash = require('../hash'); + +var hex = '0A1B2C3D4E5F6G7H'; + +function equal(t, a, b) { + t.equal(a.length, b.length); + t.equal(a.toString('hex'), b.toString('hex')); +} + +var hexBuf = Buffer.from('0A1B2C3D4E5F6G7H', 'utf8'); +var count16 = { + strings: ['0A1B2C3D4E5F6G7H'], + buffers: [ + hexBuf, + Buffer.from('80000000000000000000000000000080', 'hex') + ] +}; + +var empty = { + strings: [''], + buffers: [ + Buffer.from('80000000000000000000000000000000', 'hex') + ] +}; + +var multi = { + strings: ['abcd', 'efhijk', 'lmnopq'], + buffers: [ + Buffer.from('abcdefhijklmnopq', 'ascii'), + Buffer.from('80000000000000000000000000000080', 'hex') + ] +}; + +var long = { + strings: [hex + hex], + buffers: [ + hexBuf, + hexBuf, + Buffer.from('80000000000000000000000000000100', 'hex') + ] +}; + +function makeTest(name, data) { + tape(name, function (t) { + var h = new Hash(16, 8); + var hash = Buffer.alloc(20); + var n = 2; + var expected = data.buffers.slice(); + // t.plan(expected.length + 1) + + h._update = function (block) { + var e = expected.shift(); + equal(t, block, e); + + if (n < 0) { + throw new Error('expecting only 2 calls to _update'); + } + }; + h._hash = function () { + return hash; + }; + + data.strings.forEach(function (string) { + h.update(string, 'ascii'); + }); + + equal(t, h.digest(), hash); + t.end(); + }); +} + +makeTest('Hash#update 1 in 1', count16); +makeTest('empty Hash#update', empty); +makeTest('Hash#update 1 in 3', multi); +makeTest('Hash#update 2 in 1', long); diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/test.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/test.js new file mode 100644 index 00000000..f1732528 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/test.js @@ -0,0 +1,138 @@ +'use strict'; + +var crypto = require('crypto'); +var tape = require('tape'); +var Buffer = require('safe-buffer').Buffer; + +var Sha1 = require('../').sha1; + +var nodeSupportsUint16 = false; +try { + crypto.createHash('sha1').update(new Uint16Array()); + nodeSupportsUint16 = true; +} catch (err) {} + +var inputs = [ + ['', 'ascii'], + ['abc', 'ascii'], + ['123', 'ascii'], + ['123456789abcdef123456789abcdef123456789abcdef123456789abcdef', 'ascii'], + ['123456789abcdef123456789abcdef123456789abcdef123456789abc', 'ascii'], + ['123456789abcdef123456789abcdef123456789abcdef123456789ab', 'ascii'], + ['0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde', 'ascii'], + ['0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef', 'ascii'], + ['foobarbaz', 'ascii'], + [Buffer.from('buffer')], + nodeSupportsUint16 ? [new Uint16Array([1, 2, 3])] : null +].filter(Boolean); + +tape("hash is the same as node's crypto", function (t) { + inputs.forEach(function (v) { + var a = new Sha1().update(v[0], v[1]).digest('hex'); + var e = crypto.createHash('sha1').update(v[0], v[1]).digest('hex'); + t.equal(a, e, a + ' == ' + e); + }); + + t.end(); +}); + +tape('call update multiple times', function (t) { + inputs.forEach(function (v) { + var hash = new Sha1(); + var sha1hash = crypto.createHash('sha1'); + + for (var i = 0; i < v[0].length; i = (i + 1) * 2) { + var s = v[0].slice(i, (i + 1) * 2); + hash.update(s, v[1]); + sha1hash.update(s, v[1]); + } + + var a = hash.digest('hex'); + var e = sha1hash.digest('hex'); + t.equal(a, e, a + ' == ' + e); + }); + t.end(); +}); + +tape('call update twice', function (t) { + var sha1hash = crypto.createHash('sha1'); + var hash = new Sha1(); + + sha1hash.update('foo', 'ascii'); + hash.update('foo', 'ascii'); + + sha1hash.update('bar', 'ascii'); + hash.update('bar', 'ascii'); + + sha1hash.update('baz', 'ascii'); + hash.update('baz', 'ascii'); + + var a = hash.digest('hex'); + var e = sha1hash.digest('hex'); + + t.equal(a, e); + t.end(); +}); + +tape('hex encoding', function (t) { + inputs.forEach(function (v) { + var hash = new Sha1(); + var sha1hash = crypto.createHash('sha1'); + + for (var i = 0; i < v[0].length; i = (i + 1) * 2) { + var s = v[0].slice(i, (i + 1) * 2); + hash.update(Buffer.from(s, 'ascii').toString('hex'), 'hex'); + sha1hash.update(Buffer.from(s, 'ascii').toString('hex'), 'hex'); + } + var a = hash.digest('hex'); + var e = sha1hash.digest('hex'); + + t.equal(a, e, a + ' == ' + e); + }); + + t.end(); +}); + +tape('throws on invalid input', function (t) { + var invalid = [ + {}, // non-arrayish + { length: 20 }, // undefined values + [NaN], // non-numbers + [[]], // non-numbers + [1, 1.5], // non-integers + [1, 256], // out of bounds + [-1, 0] // out of bounds + ]; + + invalid.forEach(function (input) { + var hash = new Sha1(); + + t['throws'](function () { + hash.update(input); + hash.digest('hex'); + }); + }); + + t.end(); +}); + +tape('call digest for more than MAX_UINT32 bits of data', function (t) { + var sha1hash = crypto.createHash('sha1'); + var hash = new Sha1(); + var bigData; + try { + bigData = Buffer.alloc(0x1ffffffff / 8); + } catch (err) { + // node < 3 has a lower buffer size limit than node 3+. node 0.10 requires the `/8`, 0.12 - 2 are fine with `-8` + bigData = Buffer.alloc(0x3fffffff / 8); + } + + hash.update(bigData); + sha1hash.update(bigData); + + var a = hash.digest('hex'); + var e = sha1hash.digest('hex'); + + t.equal(a, e, a + ' == ' + e); + t.end(); +}); diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/vectors.js b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/vectors.js new file mode 100644 index 00000000..25874f06 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/test/vectors.js @@ -0,0 +1,72 @@ +'use strict'; + +var tape = require('tape'); +var vectors = require('hash-test-vectors'); +// var from = require('bops/typedarray/from') +var Buffer = require('safe-buffer').Buffer; + +var createHash = require('../'); + +function makeTest(alg, i, verbose) { + var v = vectors[i]; + + tape(alg + ': NIST vector ' + i, function (t) { + if (verbose) { + t.comment(v); + t.comment('VECTOR', i); + t.comment('INPUT', v.input); + t.comment(Buffer.from(v.input, 'base64').toString('hex')); + } + + var buf = Buffer.from(v.input, 'base64'); + t.equal(createHash(alg).update(buf).digest('hex'), v[alg]); + + // eslint-disable-next-line no-param-reassign + i = ~~(buf.length / 2); + var buf1 = buf.slice(0, i); + var buf2 = buf.slice(i, buf.length); + + t.comment(buf1.length + ', ' + buf2.length + ', ' + buf.length); + t.comment(createHash(alg)._block.length); + + t.equal( + createHash(alg) + .update(buf1) + .update(buf2) + .digest('hex'), + v[alg] + ); + + var j, buf3; + + // eslint-disable-next-line no-param-reassign + i = ~~(buf.length / 3); + j = ~~(buf.length * 2 / 3); + buf1 = buf.slice(0, i); + buf2 = buf.slice(i, j); + buf3 = buf.slice(j, buf.length); + + t.equal( + createHash(alg) + .update(buf1) + .update(buf2) + .update(buf3) + .digest('hex'), + v[alg] + ); + + setTimeout(function () { + // avoid "too much recursion" errors in tape in firefox + t.end(); + }); + }); +} + +vectors.forEach(function (v, i) { + makeTest('sha', i); + makeTest('sha1', i); + makeTest('sha224', i); + makeTest('sha256', i); + makeTest('sha384', i); + makeTest('sha512', i); +}); diff --git a/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/to-buffer b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/to-buffer new file mode 120000 index 00000000..d39b0379 --- /dev/null +++ b/backend/node_modules/.pnpm/sha.js@2.4.12/node_modules/to-buffer @@ -0,0 +1 @@ +../../to-buffer@1.2.2/node_modules/to-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/es-errors b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/object-inspect b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/object-inspect new file mode 120000 index 00000000..e3818d54 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/object-inspect @@ -0,0 +1 @@ +../../object-inspect@1.13.4/node_modules/object-inspect \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.editorconfig b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.editorconfig new file mode 100644 index 00000000..72e0ebaa --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.eslintrc b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.eslintrc new file mode 100644 index 00000000..93978e7d --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.github/FUNDING.yml b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.github/FUNDING.yml new file mode 100644 index 00000000..eaff7350 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-list +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.nycrc b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/CHANGELOG.md b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/CHANGELOG.md new file mode 100644 index 00000000..e68bcb9b --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/side-channel-list.git +/compare/v1.0.0...v1.0.1) - 2026-04-08 + +### Fixed + +- [Fix] `delete`: do not reset the list when deleting the head node of a multi-node list [`#3`](https://github.com/ljharb/side-channel-list.git +/issues/3) + +### Commits + +- [actions] update workflows [`9e79e6b`](https://github.com/ljharb/side-channel-list.git +/commit/9e79e6bf845532fafbf03b547429fe4f737214a3) +- [Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `eslint`, `npmignore` [`babf3ca`](https://github.com/ljharb/side-channel-list.git +/commit/babf3ca4849d2fd893a470a6b82c62a80ccc9307) +- [Deps] update `object-inspect` [`9f0f4b8`](https://github.com/ljharb/side-channel-list.git +/commit/9f0f4b88ff2aa8b7b7c9e589ac1513f133d64b9f) + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`5d6baee`](https://github.com/ljharb/side-channel-list.git +/commit/5d6baee5c9054a1238007f5a1dfc109a7a816251) +- Initial commit [`3ae784c`](https://github.com/ljharb/side-channel-list.git +/commit/3ae784c63a47895fbaeed2a91ab54a8029a7a100) +- npm init [`07055a4`](https://github.com/ljharb/side-channel-list.git +/commit/07055a4d139895565b199dba5fe2479c1a1b9e28) +- Only apps should have lockfiles [`9573058`](https://github.com/ljharb/side-channel-list.git +/commit/9573058a47494e2d68f8c6c77b5d7fbe441949c1) diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/LICENSE b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/README.md b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/README.md new file mode 100644 index 00000000..d9c7a137 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/README.md @@ -0,0 +1,62 @@ +# side-channel-list [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel, using a linked list. + +Warning: this implementation will leak memory until you `delete` the `key`. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-list +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelList = require('side-channel-list'); + +const channel = getSideChannelList(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-list +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-list.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-list.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-list +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-list/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-list#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-list.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-list.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-list.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-list +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-list/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-list/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-list +[actions-url]: https://github.com/ljharb/side-channel-list/actions diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.d.ts b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.d.ts new file mode 100644 index 00000000..c9cabc84 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.d.ts @@ -0,0 +1,13 @@ +declare namespace getSideChannelList { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + }; +} + +declare function getSideChannelList(): getSideChannelList.Channel; + +export = getSideChannelList; diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js new file mode 100644 index 00000000..44602294 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js @@ -0,0 +1,111 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var $TypeError = require('es-errors/type'); + +/* +* This function traverses the list returning the node corresponding to the given key. +* +* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. +* By doing so, all the recently used nodes can be accessed relatively quickly. +*/ +/** @type {import('./list.d.ts').listGetNode} */ +// eslint-disable-next-line consistent-return +var listGetNode = function (list, key, isDelete) { + /** @type {typeof list | NonNullable<(typeof list)['next']>} */ + var prev = list; + /** @type {(typeof list)['next']} */ + var curr; + // eslint-disable-next-line eqeqeq + for (; (curr = prev.next) != null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + if (!isDelete) { + // eslint-disable-next-line no-extra-parens + curr.next = /** @type {NonNullable} */ (list.next); + list.next = curr; // eslint-disable-line no-param-reassign + } + return curr; + } + } +}; + +/** @type {import('./list.d.ts').listGet} */ +var listGet = function (objects, key) { + if (!objects) { + return void undefined; + } + var node = listGetNode(objects, key); + return node && node.value; +}; +/** @type {import('./list.d.ts').listSet} */ +var listSet = function (objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + // Prepend the new node to the beginning of the list + objects.next = /** @type {import('./list.d.ts').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens + key: key, + next: objects.next, + value: value + }); + } +}; +/** @type {import('./list.d.ts').listHas} */ +var listHas = function (objects, key) { + if (!objects) { + return false; + } + return !!listGetNode(objects, key); +}; +/** @type {import('./list.d.ts').listDelete} */ +// eslint-disable-next-line consistent-return +var listDelete = function (objects, key) { + if (objects) { + return listGetNode(objects, key, true); + } +}; + +/** @type {import('.')} */ +module.exports = function getSideChannelList() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {import('./list.d.ts').RootNode | undefined} */ var $o; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + var deletedNode = listDelete($o, key); + if (deletedNode && $o && !$o.next) { + $o = void undefined; + } + return !!deletedNode; + }, + get: function (key) { + return listGet($o, key); + }, + has: function (key) { + return listHas($o, key); + }, + set: function (key, value) { + if (!$o) { + // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head + $o = { + next: void undefined + }; + } + // eslint-disable-next-line no-extra-parens + listSet(/** @type {NonNullable} */ ($o), key, value); + } + }; + return channel; +}; diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/list.d.ts b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/list.d.ts new file mode 100644 index 00000000..2c759e25 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/list.d.ts @@ -0,0 +1,14 @@ +type ListNode = { + key: K; + next: undefined | ListNode; + value: T; +}; +type RootNode = { + next: undefined | ListNode; +}; + +export function listGetNode(list: RootNode, key: ListNode['key'], isDelete?: boolean): ListNode | undefined; +export function listGet(objects: undefined | RootNode, key: ListNode['key']): T | undefined; +export function listSet(objects: RootNode, key: ListNode['key'], value: T): void; +export function listHas(objects: undefined | RootNode, key: ListNode['key']): boolean; +export function listDelete(objects: undefined | RootNode, key: ListNode['key']): ListNode | undefined; diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/package.json b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/package.json new file mode 100644 index 00000000..bc4c08ca --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/package.json @@ -0,0 +1,77 @@ +{ + "name": "side-channel-list", + "version": "1.0.1", + "description": "Store information about any JS value in a side channel, using a linked list", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-list.git" + }, + "keywords": [], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-list/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-list#readme", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.2", + "@ljharb/eslint-config": "^22.2.2", + "@ljharb/tsconfig": "^0.3.2", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "^8.57.1", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/test/index.js b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/test/index.js new file mode 100644 index 00000000..d1b915dd --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/test/index.js @@ -0,0 +1,154 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelList = require('../'); + +test('getSideChannelList', function (t) { + t.test('export', function (st) { + st.equal(typeof getSideChannelList, 'function', 'is a function'); + + st.equal(getSideChannelList.length, 0, 'takes no arguments'); + + var channel = getSideChannelList(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannelList(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannelList(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannelList(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannelList(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannelList(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.test('delete: first node in a multi-node list', function (st) { + var channel = getSideChannelList(); + + channel.set('a', 1); + channel.set('b', 2); + + st.equal(channel['delete']('b'), true, 'deleting first data node yields true'); + + st.equal(channel.has('a'), true, 'second node is still present after deleting first'); + st.equal(channel.get('a'), 1, 'second node value is intact after deleting first'); + st.equal(channel.has('b'), false, 'deleted node is gone'); + + st.end(); + }); + + t.test('delete: last remaining node empties the list', function (st) { + var channel = getSideChannelList(); + + channel.set('a', 1); + channel.set('b', 2); + + st.equal(channel['delete']('b'), true, 'delete first node'); + st.equal(channel['delete']('a'), true, 'delete second (last) node'); + + st.equal(channel.has('a'), false, 'a is gone'); + st.equal(channel.has('b'), false, 'b is gone'); + st.equal(channel.get('a'), undefined, 'get a yields undefined'); + + channel.set('c', 3); + st.equal(channel.get('c'), 3, 'can set new values after emptying'); + + st.end(); + }); + + t.test('delete: middle node in a multi-node list', function (st) { + var channel = getSideChannelList(); + + channel.set('a', 1); + channel.set('b', 2); + channel.set('c', 3); + + st.equal(channel['delete']('b'), true, 'deleting middle node yields true'); + + st.equal(channel.get('a'), 1, 'first node still intact'); + st.equal(channel.has('b'), false, 'middle node is gone'); + st.equal(channel.get('c'), 3, 'last node still intact'); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/tsconfig.json b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/tsconfig.json new file mode 100644 index 00000000..d9a6668c --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/call-bound b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/call-bound new file mode 120000 index 00000000..5171ab6f --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/call-bound @@ -0,0 +1 @@ +../../call-bound@1.0.4/node_modules/call-bound \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/es-errors b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/get-intrinsic b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/get-intrinsic new file mode 120000 index 00000000..0042f6aa --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/get-intrinsic @@ -0,0 +1 @@ +../../get-intrinsic@1.3.0/node_modules/get-intrinsic \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/object-inspect b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/object-inspect new file mode 120000 index 00000000..e3818d54 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/object-inspect @@ -0,0 +1 @@ +../../object-inspect@1.13.4/node_modules/object-inspect \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.editorconfig b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.editorconfig new file mode 100644 index 00000000..72e0ebaa --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.eslintrc b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.eslintrc new file mode 100644 index 00000000..93978e7d --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.github/FUNDING.yml b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.github/FUNDING.yml new file mode 100644 index 00000000..f2891bd6 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-map +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.nycrc b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/CHANGELOG.md b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/CHANGELOG.md new file mode 100644 index 00000000..b6ccea90 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/side-channel-map/compare/v1.0.0...v1.0.1) - 2024-12-10 + +### Commits + +- [Deps] update `call-bound` [`6d05aaa`](https://github.com/ljharb/side-channel-map/commit/6d05aaa4ce5f2be4e7825df433d650696f0ba40f) +- [types] fix generics ordering [`11c0184`](https://github.com/ljharb/side-channel-map/commit/11c0184132ac11fdc16857e12682e148e5e9ee74) + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`ad877b4`](https://github.com/ljharb/side-channel-map/commit/ad877b42926d46d63fff76a2bd01d2b4a01959a9) +- Initial commit [`28f8879`](https://github.com/ljharb/side-channel-map/commit/28f8879c512abe8fcf9b6a4dc7754a0287e5eba4) +- npm init [`2c9604e`](https://github.com/ljharb/side-channel-map/commit/2c9604e5aa40223e425ea7cea78f8a07697504bd) +- Only apps should have lockfiles [`5e7ba9c`](https://github.com/ljharb/side-channel-map/commit/5e7ba9cffe3ef42095815adc8ac1255b49bbadf5) diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/LICENSE b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/LICENSE new file mode 100644 index 00000000..f82f3896 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/README.md b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/README.md new file mode 100644 index 00000000..8fa6f77f --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/README.md @@ -0,0 +1,62 @@ +# side-channel-map [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel, using a Map. + +Warning: if the `key` is an object, this implementation will leak memory until you `delete` it. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-map +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelMap = require('side-channel-map'); + +const channel = getSideChannelMap(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-map +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-map.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-map.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-map +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-map/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-map#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-map.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-map.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-map.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-map +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-map/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-map/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-map +[actions-url]: https://github.com/ljharb/side-channel-map/actions diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.d.ts b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.d.ts new file mode 100644 index 00000000..de33e899 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.d.ts @@ -0,0 +1,15 @@ +declare namespace getSideChannelMap { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + }; +} + +declare function getSideChannelMap(): getSideChannelMap.Channel; + +declare const x: false | typeof getSideChannelMap; + +export = x; diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js new file mode 100644 index 00000000..e111100b --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); + +var $TypeError = require('es-errors/type'); +var $Map = GetIntrinsic('%Map%', true); + +/** @type {(thisArg: Map, key: K) => V} */ +var $mapGet = callBound('Map.prototype.get', true); +/** @type {(thisArg: Map, key: K, value: V) => void} */ +var $mapSet = callBound('Map.prototype.set', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapHas = callBound('Map.prototype.has', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapDelete = callBound('Map.prototype.delete', true); +/** @type {(thisArg: Map) => number} */ +var $mapSize = callBound('Map.prototype.size', true); + +/** @type {import('.')} */ +module.exports = !!$Map && /** @type {Exclude} */ function getSideChannelMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {Map | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($m) { + var result = $mapDelete($m, key); + if ($mapSize($m) === 0) { + $m = void undefined; + } + return result; + } + return false; + }, + get: function (key) { // eslint-disable-line consistent-return + if ($m) { + return $mapGet($m, key); + } + }, + has: function (key) { + if ($m) { + return $mapHas($m, key); + } + return false; + }, + set: function (key, value) { + if (!$m) { + // @ts-expect-error TS can't handle narrowing a variable inside a closure + $m = new $Map(); + } + $mapSet($m, key, value); + } + }; + + // @ts-expect-error TODO: figure out why TS is erroring here + return channel; +}; diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/package.json b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/package.json new file mode 100644 index 00000000..18e80805 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/package.json @@ -0,0 +1,80 @@ +{ + "name": "side-channel-map", + "version": "1.0.1", + "description": "Store information about any JS value in a side channel, using a Map", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-map.git" + }, + "keywords": [], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-map/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-map#readme", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/get-intrinsic": "^1.2.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/test/index.js b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/test/index.js new file mode 100644 index 00000000..17433239 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/test/index.js @@ -0,0 +1,114 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelMap = require('../'); + +test('getSideChannelMap', { skip: typeof Map !== 'function' }, function (t) { + var getSideChannel = getSideChannelMap || function () { + throw new EvalError('should never happen'); + }; + + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); + +test('getSideChannelMap, no Maps', { skip: typeof Map === 'function' }, function (t) { + t.equal(getSideChannelMap, false, 'is false'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/tsconfig.json b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/tsconfig.json new file mode 100644 index 00000000..d9a6668c --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/call-bound b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/call-bound new file mode 120000 index 00000000..5171ab6f --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/call-bound @@ -0,0 +1 @@ +../../call-bound@1.0.4/node_modules/call-bound \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/es-errors b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/get-intrinsic b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/get-intrinsic new file mode 120000 index 00000000..0042f6aa --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/get-intrinsic @@ -0,0 +1 @@ +../../get-intrinsic@1.3.0/node_modules/get-intrinsic \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/object-inspect b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/object-inspect new file mode 120000 index 00000000..e3818d54 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/object-inspect @@ -0,0 +1 @@ +../../object-inspect@1.13.4/node_modules/object-inspect \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-map b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-map new file mode 120000 index 00000000..198c8107 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-map @@ -0,0 +1 @@ +../../side-channel-map@1.0.1/node_modules/side-channel-map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.editorconfig b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.editorconfig new file mode 100644 index 00000000..72e0ebaa --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.eslintrc b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.eslintrc new file mode 100644 index 00000000..9b13ad8b --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.github/FUNDING.yml b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.github/FUNDING.yml new file mode 100644 index 00000000..2ae71cdb --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-weakmap +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.nycrc b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/CHANGELOG.md b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/CHANGELOG.md new file mode 100644 index 00000000..aba7ab04 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.1...v1.0.2) - 2024-12-10 + +### Commits + +- [types] fix generics ordering [`1b62e94`](https://github.com/ljharb/side-channel-weakmap/commit/1b62e94a2ad6ed30b640ba73c4a2535836c67289) + +## [v1.0.1](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.0...v1.0.1) - 2024-12-10 + +### Commits + +- [types] fix generics ordering [`08a4a5d`](https://github.com/ljharb/side-channel-weakmap/commit/08a4a5dbffedc3ebc79f1aaaf5a3dd6d2196dc1b) +- [Deps] update `side-channel-map` [`b53fe44`](https://github.com/ljharb/side-channel-weakmap/commit/b53fe447dfdd3a9aebedfd015b384eac17fce916) + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`53c0fa4`](https://github.com/ljharb/side-channel-weakmap/commit/53c0fa4788435a006f58b9d7b43cb65989ecee49) +- Initial commit [`a157947`](https://github.com/ljharb/side-channel-weakmap/commit/a157947f26fcaf2c4a941d3a044e76bf67343532) +- npm init [`54dfc55`](https://github.com/ljharb/side-channel-weakmap/commit/54dfc55bafb16265910d5aad4e743c43aee5bbbb) +- Only apps should have lockfiles [`0ddd6c7`](https://github.com/ljharb/side-channel-weakmap/commit/0ddd6c7b07fe8ee04d67b2e9f7255af7ce62c07d) diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/LICENSE b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/LICENSE new file mode 100644 index 00000000..3900dd7e --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/README.md b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/README.md new file mode 100644 index 00000000..856ee364 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/README.md @@ -0,0 +1,62 @@ +# side-channel-weakmap [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: this implementation will leak memory until you `delete` the `key`. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-weakmap +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelList = require('side-channel-weakmap'); + +const channel = getSideChannelList(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-weakmap +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-weakmap.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-weakmap +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-weakmap#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-weakmap.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-weakmap.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-weakmap.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-weakmap +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-weakmap/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-weakmap/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-weakmap +[actions-url]: https://github.com/ljharb/side-channel-weakmap/actions diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.d.ts b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.d.ts new file mode 100644 index 00000000..ce1bc2a4 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.d.ts @@ -0,0 +1,15 @@ +declare namespace getSideChannelWeakMap { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + } +} + +declare function getSideChannelWeakMap(): getSideChannelWeakMap.Channel; + +declare const x: false | typeof getSideChannelWeakMap; + +export = x; diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js new file mode 100644 index 00000000..e5b8183d --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js @@ -0,0 +1,84 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); +var getSideChannelMap = require('side-channel-map'); + +var $TypeError = require('es-errors/type'); +var $WeakMap = GetIntrinsic('%WeakMap%', true); + +/** @type {(thisArg: WeakMap, key: K) => V} */ +var $weakMapGet = callBound('WeakMap.prototype.get', true); +/** @type {(thisArg: WeakMap, key: K, value: V) => void} */ +var $weakMapSet = callBound('WeakMap.prototype.set', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapHas = callBound('WeakMap.prototype.has', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapDelete = callBound('WeakMap.prototype.delete', true); + +/** @type {import('.')} */ +module.exports = $WeakMap + ? /** @type {Exclude} */ function getSideChannelWeakMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {WeakMap | undefined} */ var $wm; + /** @type {Channel | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapDelete($wm, key); + } + } else if (getSideChannelMap) { + if ($m) { + return $m['delete'](key); + } + } + return false; + }, + get: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } + return $m && $m.get(key); + }, + has: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } + return !!$m && $m.has(key); + }, + set: function (key, value) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if (getSideChannelMap) { + if (!$m) { + $m = getSideChannelMap(); + } + // eslint-disable-next-line no-extra-parens + /** @type {NonNullable} */ ($m).set(key, value); + } + } + }; + + // @ts-expect-error TODO: figure out why this is erroring + return channel; + } + : getSideChannelMap; diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/package.json b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/package.json new file mode 100644 index 00000000..9ef65833 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/package.json @@ -0,0 +1,87 @@ +{ + "name": "side-channel-weakmap", + "version": "1.0.2", + "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-weakmap.git" + }, + "keywords": [ + "weakmap", + "map", + "side", + "channel", + "metadata" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-weakmap/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-weakmap#readme", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/call-bind": "^1.0.5", + "@types/get-intrinsic": "^1.2.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/test/index.js b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/test/index.js new file mode 100644 index 00000000..a01248b5 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/test/index.js @@ -0,0 +1,114 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelWeakMap = require('../'); + +test('getSideChannelMap', { skip: typeof WeakMap !== 'function' && typeof Map !== 'function' }, function (t) { + var getSideChannel = getSideChannelWeakMap || function () { + throw new EvalError('should never happen'); + }; + + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); + +test('getSideChannelMap, no WeakMaps and/or Maps', { skip: typeof WeakMap === 'function' || typeof Map === 'function' }, function (t) { + t.equal(getSideChannelWeakMap, false, 'is false'); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/tsconfig.json b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/tsconfig.json new file mode 100644 index 00000000..d9a6668c --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/es-errors b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/object-inspect b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/object-inspect new file mode 120000 index 00000000..e3818d54 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/object-inspect @@ -0,0 +1 @@ +../../object-inspect@1.13.4/node_modules/object-inspect \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-list b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-list new file mode 120000 index 00000000..6087a68c --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-list @@ -0,0 +1 @@ +../../side-channel-list@1.0.1/node_modules/side-channel-list \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-map b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-map new file mode 120000 index 00000000..198c8107 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-map @@ -0,0 +1 @@ +../../side-channel-map@1.0.1/node_modules/side-channel-map \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-weakmap b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-weakmap new file mode 120000 index 00000000..28447eef --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel-weakmap @@ -0,0 +1 @@ +../../side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap \ No newline at end of file diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.editorconfig b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.editorconfig new file mode 100644 index 00000000..72e0ebaa --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.eslintrc b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.eslintrc new file mode 100644 index 00000000..9b13ad8b --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.github/FUNDING.yml b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.github/FUNDING.yml new file mode 100644 index 00000000..2a94840c --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.nycrc b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/CHANGELOG.md b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/CHANGELOG.md new file mode 100644 index 00000000..decafe54 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/CHANGELOG.md @@ -0,0 +1,120 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.1](https://github.com/ljharb/side-channel/compare/v1.1.0...v1.1.1) - 2026-06-08 + +### Commits + +- [Fix] `assert`: do not observably access object keys when throwing [`fc17361`](https://github.com/ljharb/side-channel/commit/fc173615136e6a6c3194656e6088afbc0bd6f9b8) +- [actions] update workflows [`35b18c0`](https://github.com/ljharb/side-channel/commit/35b18c0bced5769d59226cd44a7e4003ad0aee81) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `eslint`, `npmignore` [`b456a01`](https://github.com/ljharb/side-channel/commit/b456a01396cfdd028e5d39ea84885fe9178a72cf) +- [Deps] update `object-inspect`, `side-channel-list` [`accf1a1`](https://github.com/ljharb/side-channel/commit/accf1a1a2767a22b1f5eeb5769a1db4c35a78090) +- [readme] replace runkit CI badge with shields.io check-runs badge [`7e0c956`](https://github.com/ljharb/side-channel/commit/7e0c956411cc29267197a49a155a3d9bd01bacac) + +## [v1.1.0](https://github.com/ljharb/side-channel/compare/v1.0.6...v1.1.0) - 2024-12-11 + +### Commits + +- [Refactor] extract implementations to `side-channel-weakmap`, `side-channel-map`, `side-channel-list` [`ada5955`](https://github.com/ljharb/side-channel/commit/ada595549a5c4c6c853756d598846b180941c6da) +- [New] add `channel.delete` [`c01d2d3`](https://github.com/ljharb/side-channel/commit/c01d2d3fd51dbb1ce6da72ad7916e61bd6172aad) +- [types] improve types [`0c54356`](https://github.com/ljharb/side-channel/commit/0c5435651417df41b8cc1a5f7cdce8bffae68cde) +- [readme] add content [`be24868`](https://github.com/ljharb/side-channel/commit/be248682ac294b0e22c883092c45985aa91c490a) +- [actions] split out node 10-20, and 20+ [`c4488e2`](https://github.com/ljharb/side-channel/commit/c4488e241ef3d49a19fe266ac830a2e644305911) +- [types] use shared tsconfig [`0e0d57c`](https://github.com/ljharb/side-channel/commit/0e0d57c2ff17c7b45c6cbd43ebcf553edc9e3adc) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `tape` [`fb4f622`](https://github.com/ljharb/side-channel/commit/fb4f622e64a99a1e40b6e5cd7691674a9dc429e4) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`b78336b`](https://github.com/ljharb/side-channel/commit/b78336b886172d1b457d414ac9e28de8c5fecc78) +- [Tests] replace `aud` with `npm audit` [`ee3ab46`](https://github.com/ljharb/side-channel/commit/ee3ab4690d954311c35115651bcfd45edd205aa1) +- [Dev Deps] add missing peer dep [`c03e21a`](https://github.com/ljharb/side-channel/commit/c03e21a7def3b67cdc15ae22316884fefcb2f6a8) + +## [v1.0.6](https://github.com/ljharb/side-channel/compare/v1.0.5...v1.0.6) - 2024-02-29 + +### Commits + +- add types [`9beef66`](https://github.com/ljharb/side-channel/commit/9beef6643e6d717ea57bedabf86448123a7dd9e9) +- [meta] simplify `exports` [`4334cf9`](https://github.com/ljharb/side-channel/commit/4334cf9df654151504c383b62a2f9ebdc8d9d5ac) +- [Deps] update `call-bind` [`d6043c4`](https://github.com/ljharb/side-channel/commit/d6043c4d8f4d7be9037dd0f0419c7a2e0e39ec6a) +- [Dev Deps] update `tape` [`6aca376`](https://github.com/ljharb/side-channel/commit/6aca3761868dc8cd5ff7fd9799bf6b95e09a6eb0) + +## [v1.0.5](https://github.com/ljharb/side-channel/compare/v1.0.4...v1.0.5) - 2024-02-06 + +### Commits + +- [actions] reuse common workflows [`3d2e1ff`](https://github.com/ljharb/side-channel/commit/3d2e1ffd16dd6eaaf3e40ff57951f840d2d63c04) +- [meta] use `npmignore` to autogenerate an npmignore file [`04296ea`](https://github.com/ljharb/side-channel/commit/04296ea17d1544b0a5d20fd5bfb31aa4f6513eb9) +- [meta] add `.editorconfig`; add `eclint` [`130f0a6`](https://github.com/ljharb/side-channel/commit/130f0a6adbc04d385c7456a601d38344dce3d6a9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`d480c2f`](https://github.com/ljharb/side-channel/commit/d480c2fbe757489ae9b4275491ffbcc3ac4725e9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ecbe70e`](https://github.com/ljharb/side-channel/commit/ecbe70e53a418234081a77971fec1fdfae20c841) +- [actions] update rebase action [`75240b9`](https://github.com/ljharb/side-channel/commit/75240b9963b816e8846400d2287cb68f88c7fba7) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`ae8d281`](https://github.com/ljharb/side-channel/commit/ae8d281572430099109870fd9430d2ca3f320b8d) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`7125b88`](https://github.com/ljharb/side-channel/commit/7125b885fd0eacad4fee9b073b72d14065ece278) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`82577c9`](https://github.com/ljharb/side-channel/commit/82577c9796304519139a570f82a317211b5f3b86) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`550aadf`](https://github.com/ljharb/side-channel/commit/550aadf20475a6081fd70304cc54f77259a5c8a8) +- [Tests] increase coverage [`5130877`](https://github.com/ljharb/side-channel/commit/5130877a7b27c862e64e6d1c12a178b28808859d) +- [Deps] update `get-intrinsic`, `object-inspect` [`ba0194c`](https://github.com/ljharb/side-channel/commit/ba0194c505b1a8a0427be14cadd5b8a46d4d01b8) +- [meta] add missing `engines.node` [`985fd24`](https://github.com/ljharb/side-channel/commit/985fd249663cb06617a693a94fe08cad12f5cb70) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`40227a8`](https://github.com/ljharb/side-channel/commit/40227a87b01709ad2c0eebf87eb4223a800099b9) +- [Deps] update `get-intrinsic` [`a989b40`](https://github.com/ljharb/side-channel/commit/a989b4024958737ae7be9fbffdeff2078f33a0fd) +- [Deps] update `object-inspect` [`aec42d2`](https://github.com/ljharb/side-channel/commit/aec42d2ec541a31aaa02475692c87d489237d9a3) + +## [v1.0.4](https://github.com/ljharb/side-channel/compare/v1.0.3...v1.0.4) - 2020-12-29 + +### Commits + +- [Tests] migrate tests to Github Actions [`10909cb`](https://github.com/ljharb/side-channel/commit/10909cbf8ce9c0bf96f604cf13d7ffd5a22c2d40) +- [Refactor] Use a linked list rather than an array, and move accessed nodes to the beginning [`195613f`](https://github.com/ljharb/side-channel/commit/195613f28b5c1e6072ef0b61b5beebaf2b6a304e) +- [meta] do not publish github action workflow files [`290ec29`](https://github.com/ljharb/side-channel/commit/290ec29cd21a60585145b4a7237ec55228c52c27) +- [Tests] run `nyc` on all tests; use `tape` runner [`ea6d030`](https://github.com/ljharb/side-channel/commit/ea6d030ff3fe6be2eca39e859d644c51ecd88869) +- [actions] add "Allow Edits" workflow [`d464d8f`](https://github.com/ljharb/side-channel/commit/d464d8fe52b5eddf1504a0ed97f0941a90f32c15) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`02daca8`](https://github.com/ljharb/side-channel/commit/02daca87c6809821c97be468d1afa2f5ef447383) +- [Refactor] use `call-bind` and `get-intrinsic` instead of `es-abstract` [`e09d481`](https://github.com/ljharb/side-channel/commit/e09d481528452ebafa5cdeae1af665c35aa2deee) +- [Deps] update `object.assign` [`ee83aa8`](https://github.com/ljharb/side-channel/commit/ee83aa81df313b5e46319a63adb05cf0c179079a) +- [actions] update rebase action to use checkout v2 [`7726b0b`](https://github.com/ljharb/side-channel/commit/7726b0b058b632fccea709f58960871defaaa9d7) + +## [v1.0.3](https://github.com/ljharb/side-channel/compare/v1.0.2...v1.0.3) - 2020-08-23 + +### Commits + +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`1f10561`](https://github.com/ljharb/side-channel/commit/1f105611ef3acf32dec8032ae5c0baa5e56bb868) +- [Deps] update `es-abstract`, `object-inspect` [`bc20159`](https://github.com/ljharb/side-channel/commit/bc201597949a505e37cef9eaf24c7010831e6f03) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`b9b2b22`](https://github.com/ljharb/side-channel/commit/b9b2b225f9e0ea72a6ec2b89348f0bd690bc9ed1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7055ab4`](https://github.com/ljharb/side-channel/commit/7055ab4de0860606efd2003674a74f1fe6ebc07e) +- [Dev Deps] update `auto-changelog`; add `aud` [`d278c37`](https://github.com/ljharb/side-channel/commit/d278c37d08227be4f84aa769fcd919e73feeba40) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`3bcf982`](https://github.com/ljharb/side-channel/commit/3bcf982faa122745b39c33ce83d32fdf003741c6) +- [Tests] only audit prod deps [`18d01c4`](https://github.com/ljharb/side-channel/commit/18d01c4015b82a3d75044c4d5ba7917b2eac01ec) +- [Deps] update `es-abstract` [`6ab096d`](https://github.com/ljharb/side-channel/commit/6ab096d9de2b482cf5e0717e34e212f5b2b9bc9a) +- [Dev Deps] update `tape` [`9dc174c`](https://github.com/ljharb/side-channel/commit/9dc174cc651dfd300b4b72da936a0a7eda5f9452) +- [Deps] update `es-abstract` [`431d0f0`](https://github.com/ljharb/side-channel/commit/431d0f0ff11fbd2ae6f3115582a356d3a1cfce82) +- [Deps] update `es-abstract` [`49869fd`](https://github.com/ljharb/side-channel/commit/49869fd323bf4453f0ba515c0fb265cf5ab7b932) +- [meta] Add package.json to package's exports [`77d9cdc`](https://github.com/ljharb/side-channel/commit/77d9cdceb2a9e47700074f2ae0c0a202e7dac0d4) + +## [v1.0.2](https://github.com/ljharb/side-channel/compare/v1.0.1...v1.0.2) - 2019-12-20 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`4a526df`](https://github.com/ljharb/side-channel/commit/4a526df44e4701566ed001ec78546193f818b082) +- [Deps] update `es-abstract` [`d4f6e62`](https://github.com/ljharb/side-channel/commit/d4f6e629b6fb93a07415db7f30d3c90fd7f264fe) + +## [v1.0.1](https://github.com/ljharb/side-channel/compare/v1.0.0...v1.0.1) - 2019-12-01 + +### Commits + +- [Fix] add missing "exports" [`d212907`](https://github.com/ljharb/side-channel/commit/d2129073abf0701a5343bf28aa2145617604dc2e) + +## v1.0.0 - 2019-12-01 + +### Commits + +- Initial implementation [`dbebd3a`](https://github.com/ljharb/side-channel/commit/dbebd3a4b5ed64242f9a6810efe7c4214cd8cde4) +- Initial tests [`73bdefe`](https://github.com/ljharb/side-channel/commit/73bdefe568c9076cf8c0b8719bc2141aec0e19b8) +- Initial commit [`43c03e1`](https://github.com/ljharb/side-channel/commit/43c03e1c2849ec50a87b7a5cd76238a62b0b8770) +- npm init [`5c090a7`](https://github.com/ljharb/side-channel/commit/5c090a765d66a5527d9889b89aeff78dee91348c) +- [meta] add `auto-changelog` [`a5c4e56`](https://github.com/ljharb/side-channel/commit/a5c4e5675ec02d5eb4d84b4243aeea2a1d38fbec) +- [actions] add automatic rebasing / merge commit blocking [`bab1683`](https://github.com/ljharb/side-channel/commit/bab1683d8f9754b086e94397699fdc645e0d7077) +- [meta] add `funding` field; create FUNDING.yml [`63d7aea`](https://github.com/ljharb/side-channel/commit/63d7aeaf34f5650650ae97ca4b9fae685bd0937c) +- [Tests] add `npm run lint` [`46a5a81`](https://github.com/ljharb/side-channel/commit/46a5a81705cd2664f83df232c01dbbf2ee952885) +- Only apps should have lockfiles [`8b16b03`](https://github.com/ljharb/side-channel/commit/8b16b0305f00895d90c4e2e5773c854cfea0e448) +- [meta] add `safe-publish-latest` [`2f098ef`](https://github.com/ljharb/side-channel/commit/2f098ef092a39399cfe548b19a1fc03c2fd2f490) diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/LICENSE b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/LICENSE new file mode 100644 index 00000000..3900dd7e --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/README.md b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/README.md new file mode 100644 index 00000000..73ba466c --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/README.md @@ -0,0 +1,61 @@ +# side-channel [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: in an environment that lacks `WeakMap`, this implementation will leak memory until you `delete` the `key`. + +## Getting started + +```sh +npm install --save side-channel +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannel = require('side-channel'); + +const channel = getSideChannel(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel.svg +[deps-url]: https://david-dm.org/ljharb/side-channel +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel +[codecov-image]: https://codecov.io/gh/ljharb/side-channel/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel/ +[actions-image]: https://img.shields.io/github/check-runs/ljharb/side-channel/main +[actions-url]: https://github.com/ljharb/side-channel/actions diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.d.ts b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.d.ts new file mode 100644 index 00000000..18c63171 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.d.ts @@ -0,0 +1,14 @@ +import getSideChannelList from 'side-channel-list'; +import getSideChannelMap from 'side-channel-map'; +import getSideChannelWeakMap from 'side-channel-weakmap'; + +declare namespace getSideChannel { + type Channel = + | getSideChannelList.Channel + | ReturnType, false>> + | ReturnType, false>>; +} + +declare function getSideChannel(): getSideChannel.Channel; + +export = getSideChannel; diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.js b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.js new file mode 100644 index 00000000..c5fe1fac --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/index.js @@ -0,0 +1,46 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); +var inspect = require('object-inspect'); +var getSideChannelList = require('side-channel-list'); +var getSideChannelMap = require('side-channel-map'); +var getSideChannelWeakMap = require('side-channel-weakmap'); + +var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; + +/** @type {import('.')} */ +module.exports = function getSideChannel() { + /** @typedef {ReturnType} Channel */ + + /** @type {Channel | undefined} */ var $channelData; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + var keyDesc = key && Object(key) === key + ? 'the given object key' + : inspect(key); + throw new $TypeError('Side channel does not contain ' + keyDesc); + } + }, + 'delete': function (key) { + return !!$channelData && $channelData['delete'](key); + }, + get: function (key) { + return $channelData && $channelData.get(key); + }, + has: function (key) { + return !!$channelData && $channelData.has(key); + }, + set: function (key, value) { + if (!$channelData) { + $channelData = makeChannel(); + } + + $channelData.set(key, value); + } + }; + + return channel; +}; diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/package.json b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/package.json new file mode 100644 index 00000000..e39158e5 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/package.json @@ -0,0 +1,85 @@ +{ + "name": "side-channel", + "version": "1.1.1", + "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel.git" + }, + "keywords": [ + "weakmap", + "map", + "side", + "channel", + "metadata" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel/issues" + }, + "homepage": "https://github.com/ljharb/side-channel#readme", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.3", + "@ljharb/eslint-config": "^22.2.3", + "@ljharb/tsconfig": "^0.3.2", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.6.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "^8.57.1", + "in-publish": "^2.0.1", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/test/index.js b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/test/index.js new file mode 100644 index 00000000..5d28efd8 --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/test/index.js @@ -0,0 +1,120 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannel = require('../'); + +test('getSideChannel', function (t) { + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + var accessed = false; + var trap = {}; + Object.defineProperty(trap, 'foo', { + enumerable: true, + get: function () { + accessed = true; + return 1; + } + }); + st['throws']( + function () { channel.assert(trap); }, + TypeError, + 'missing object key throws' + ); + st.equal(accessed, false, 'a missing object key is not observably accessed'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/tsconfig.json b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/tsconfig.json new file mode 100644 index 00000000..d9a6668c --- /dev/null +++ b/backend/node_modules/.pnpm/side-channel@1.1.1/node_modules/side-channel/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/MIT-LICENSE.txt b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/MIT-LICENSE.txt new file mode 100644 index 00000000..c080d2eb --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2015 Craig Condon + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/README.md b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/README.md new file mode 100755 index 00000000..0501d1a1 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/README.md @@ -0,0 +1,465 @@ +**Installation**: `npm install sift`, or `yarn add sift` + +## Sift is a tiny library for using MongoDB queries in Javascript + +[![Build Status](https://secure.travis-ci.org/crcn/sift.js.png)](https://secure.travis-ci.org/crcn/sift.js) + + + + +**For extended documentation, checkout http://docs.mongodb.org/manual/reference/operator/query/** + +## Features: + +- Supported operators: [\$in](#in), [\$nin](#nin), [\$exists](#exists), [\$gte](#gte), [\$gt](#gt), [\$lte](#lte), [\$lt](#lt), [\$eq](#eq), [\$ne](#ne), [\$mod](#mod), [\$all](#all), [\$and](#and), [\$or](#or), [\$nor](#nor), [\$not](#not), [\$size](#size), [\$type](#type), [\$regex](#regex), [\$where](#where), [\$elemMatch](#elemmatch) +- Regexp searches +- Supports node.js, and web +- Custom Operations +- Tree-shaking (omitting functionality from web app bundles) + +## Examples + +```javascript +import sift from "sift"; + +// intersecting arrays +const result1 = ["hello", "sifted", "array!"].filter( + sift({ $in: ["hello", "world"] }), +); // ['hello'] + +// regexp filter +const result2 = ["craig", "john", "jake"].filter(sift(/^j/)); //['john','jake'] + +// function filter +const testFilter = sift({ + //you can also filter against functions + name: function (value) { + return value.length == 5; + }, +}); + +const result3 = [ + { + name: "craig", + }, + { + name: "john", + }, + { + name: "jake", + }, +].filter(testFilter); // filtered: [{ name: 'craig' }] + +// you can test *single values* against your custom sifter +testFilter({ name: "sarah" }); //true +testFilter({ name: "tim" }); //false +``` + +## API + +### sift(query: MongoQuery, options?: Options): Function + +Creates a filter with all the built-in MongoDB query operations. + +- `query` - the filter to use against the target array +- `options` + - `operations` - [custom operations](#custom-operations) + - `compare` - compares difference between two values + +Example: + +```javascript +import sift from "sift"; + +const test = sift({ $gt: 5 }); + +console.log(test(6)); // true +console.log(test(4)); // false + +[3, 4, 5, 6, 7].filter(test); // [6, 7] +``` + +### createQueryTester(query: Query, options?: Options): Function + +Creates a filter function **without** built-in MongoDB query operations. This is useful +if you're looking to omit certain operations from application bundles. See [Omitting built-in operations](#omitting-built-in-operations) for more info. + +```javascript +import { createQueryTester, $eq, $in } from "sift"; +const filter = createQueryTester({ $eq: 5 }, { operations: { $eq, $in } }); +``` + +### createEqualsOperation(params: any, ownerQuery: Query, options: Options): Operation + +Used for [custom operations](#custom-operations). + +```javascript +import { createQueryTester, createEqualsOperation, $eq, $in } from "sift"; +const filter = createQueryTester( + { $mod: 5 }, + { + operations: { + $something(mod, ownerQuery, options) { + return createEqualsOperation( + (value) => value % mod === 0, + ownerQuery, + options, + ); + }, + }, + }, +); +filter(10); // true +filter(11); // false +``` + +## Supported Operators + +See MongoDB's [advanced queries](http://www.mongodb.org/display/DOCS/Advanced+Queries) for more info. + +### \$in + +array value must be _\$in_ the given query: + +Intersecting two arrays: + +```javascript +// filtered: ['Brazil'] +["Brazil", "Haiti", "Peru", "Chile"].filter( + sift({ $in: ["Costa Rica", "Brazil"] }), +); +``` + +Here's another example. This acts more like the \$or operator: + +```javascript +[{ name: "Craig", location: "Brazil" }].filter( + sift({ location: { $in: ["Costa Rica", "Brazil"] } }), +); +``` + +### \$nin + +Opposite of \$in: + +```javascript +// filtered: ['Haiti','Peru','Chile'] +["Brazil", "Haiti", "Peru", "Chile"].filter( + sift({ $nin: ["Costa Rica", "Brazil"] }), +); +``` + +### \$exists + +Checks if whether a value exists: + +```javascript +// filtered: ['Craig','Tim'] +sift({ $exists: true })(["Craig", null, "Tim"]); +``` + +You can also filter out values that don't exist + +```javascript +// filtered: [{ name: "Tim" }] +[{ name: "Craig", city: "Minneapolis" }, { name: "Tim" }].filter( + sift({ city: { $exists: false } }), +); +``` + +### \$gte + +Checks if a number is >= value: + +```javascript +// filtered: [2, 3] +[0, 1, 2, 3].filter(sift({ $gte: 2 })); +``` + +### \$gt + +Checks if a number is > value: + +```javascript +// filtered: [3] +[0, 1, 2, 3].filter(sift({ $gt: 2 })); +``` + +### \$lte + +Checks if a number is <= value. + +```javascript +// filtered: [0, 1, 2] +[0, 1, 2, 3].filter(sift({ $lte: 2 })); +``` + +### \$lt + +Checks if number is < value. + +```javascript +// filtered: [0, 1] +[0, 1, 2, 3].filter(sift({ $lt: 2 })); +``` + +### \$eq + +Checks if `query === value`. Note that **\$eq can be omitted**. For **\$eq**, and **\$ne** + +```javascript +// filtered: [{ state: 'MN' }] +[{ state: "MN" }, { state: "CA" }, { state: "WI" }].filter( + sift({ state: { $eq: "MN" } }), +); +``` + +Or: + +```javascript +// filtered: [{ state: 'MN' }] +[{ state: "MN" }, { state: "CA" }, { state: "WI" }].filter( + sift({ state: "MN" }), +); +``` + +### \$ne + +Checks if `query !== value`. + +```javascript +// filtered: [{ state: 'CA' }, { state: 'WI'}] +[{ state: "MN" }, { state: "CA" }, { state: "WI" }].filter( + sift({ state: { $ne: "MN" } }), +); +``` + +### \$mod + +Modulus: + +```javascript +// filtered: [300, 600] +[100, 200, 300, 400, 500, 600].filter(sift({ $mod: [3, 0] })); +``` + +### \$all + +values must match **everything** in array: + +```javascript +// filtered: [ { tags: ['books','programming','travel' ]} ] +[ + { tags: ["books", "programming", "travel"] }, + { tags: ["travel", "cooking"] }, +].filter(sift({ tags: { $all: ["books", "programming"] } })); +``` + +### \$and + +ability to use an array of expressions. All expressions must test true. + +```javascript +// filtered: [ { name: 'Craig', state: 'MN' }] + +[ + { name: "Craig", state: "MN" }, + { name: "Tim", state: "MN" }, + { name: "Joe", state: "CA" }, +].filter(sift({ $and: [{ name: "Craig" }, { state: "MN" }] })); +``` + +### \$or + +OR array of expressions. + +```javascript +// filtered: [ { name: 'Craig', state: 'MN' }, { name: 'Tim', state: 'MN' }] +[ + { name: "Craig", state: "MN" }, + { name: "Tim", state: "MN" }, + { name: "Joe", state: "CA" }, +].filter(sift({ $or: [{ name: "Craig" }, { state: "MN" }] })); +``` + +### \$nor + +opposite of or: + +```javascript +// filtered: [{ name: 'Joe', state: 'CA' }] +[ + { name: "Craig", state: "MN" }, + { name: "Tim", state: "MN" }, + { name: "Joe", state: "CA" }, +].filter(sift({ $nor: [{ name: "Craig" }, { state: "MN" }] })); +``` + +### \$size + +Matches an array - must match given size: + +```javascript +// filtered: ['food','cooking'] +[{ tags: ["food", "cooking"] }, { tags: ["traveling"] }].filter( + sift({ tags: { $size: 2 } }), +); +``` + +### \$type + +Matches a values based on the type + +```javascript +[new Date(), 4342, "hello world"].filter(sift({ $type: Date })); // returns single date +[new Date(), 4342, "hello world"].filter(sift({ $type: String })); // returns ['hello world'] +``` + +### \$regex + +Matches values based on the given regular expression + +```javascript +["frank", "fred", "sam", "frost"].filter( + sift({ $regex: /^f/i, $nin: ["frank"] }), +); // ["fred", "frost"] +["frank", "fred", "sam", "frost"].filter( + sift({ $regex: "^f", $options: "i", $nin: ["frank"] }), +); // ["fred", "frost"] +``` + +### \$where + +Matches based on some javascript comparison + +```javascript +[{ name: "frank" }, { name: "joe" }].filter( + sift({ $where: "this.name === 'frank'" }), +); // ["frank"] +[{ name: "frank" }, { name: "joe" }].filter( + sift({ + $where: function () { + return this.name === "frank"; + }, + }), +); // ["frank"] +``` + +### \$elemMatch + +Matches elements of array + +```javascript +var bills = [ + { + month: "july", + casts: [ + { + id: 1, + value: 200, + }, + { + id: 2, + value: 1000, + }, + ], + }, + { + month: "august", + casts: [ + { + id: 3, + value: 1000, + }, + { + id: 4, + value: 4000, + }, + ], + }, +]; + +var result = bills.filter( + sift({ + casts: { + $elemMatch: { + value: { $gt: 1000 }, + }, + }, + }), +); // {month:'august', casts:[{id:3, value: 1000},{id: 4, value: 4000}]} +``` + +### \$not + +Not expression: + +```javascript +["craig", "tim", "jake"].filter(sift({ $not: { $in: ["craig", "tim"] } })); // ['jake'] +["craig", "tim", "jake"].filter(sift({ $not: { $size: 5 } })); // ['tim','jake'] +``` + +### Date comparison + +Mongodb allows you to do date comparisons like so: + +```javascript +db.collection.find({ createdAt: { $gte: "2018-03-22T06:00:00Z" } }); +``` + +In Sift, you'll need to specify a Date object: + +```javascript +collection.find( + sift({ createdAt: { $gte: new Date("2018-03-22T06:00:00Z") } }), +); +``` + +## Custom behavior + +Sift works like MongoDB out of the box, but you're also able to modify the behavior to suite your needs. + +#### Custom operations + +You can register your own custom operations. Here's an example: + +```javascript +import sift, { createEqualsOperation } from "sift"; + +var filter = sift( + { + $customMod: 2, + }, + { + operations: { + $customMod(params, ownerQuery, options) { + return createEqualsOperation( + (value) => value % params !== 0, + ownerQuery, + options, + ); + }, + }, + }, +); + +[1, 2, 3, 4, 5].filter(filter); // [1, 3, 5] +``` + +#### Omitting built-in operations + +You can create a filter function that omits the built-in operations like so: + +```javascript +import { createQueryTester, $in, $all, $nin, $lt } from "sift"; +const test = createQueryTester( + { + $eq: 10, + }, + { operations: { $in, $all, $nin, $lt } }, +); + +[1, 2, 3, 4, 10].filter(test); +``` + +For bundlers like `Webpack` and `Rollup`, operations that aren't used are omitted from application bundles via tree-shaking. diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js new file mode 100644 index 00000000..8e0e9f06 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js @@ -0,0 +1,632 @@ +const typeChecker = (type) => { + const typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; +}; +const getClassName = (value) => Object.prototype.toString.call(value); +const comparable = (value) => { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; +}; +const coercePotentiallyNull = (value) => value == null ? null : value; +const isArray = typeChecker("Array"); +const isObject = typeChecker("Object"); +const isFunction = typeChecker("Function"); +const isProperty = (item, key) => { + return item.hasOwnProperty(key) && !isFunction(item[key]); +}; +const isVanillaObject = (value) => { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); +}; +const equals = (a, b) => { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (let i = 0, { length } = a; i < length; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; +}; + +/** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ +const walkKeyPathValues = (item, keyPath, next, depth, key, owner) => { + const currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && + isNaN(Number(currentKey)) && + !isProperty(item, currentKey)) { + for (let i = 0, { length } = item; i < length; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0, depth === keyPath.length); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); +}; +class BaseOperation { + constructor(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + init() { } + reset() { + this.done = false; + this.keep = false; + } +} +class GroupOperation extends BaseOperation { + constructor(params, owneryQuery, options, children) { + super(params, owneryQuery, options); + this.children = children; + } + /** + */ + reset() { + this.keep = false; + this.done = false; + for (let i = 0, { length } = this.children; i < length; i++) { + this.children[i].reset(); + } + } + /** + */ + childrenNext(item, key, owner, root, leaf) { + let done = true; + let keep = true; + for (let i = 0, { length } = this.children; i < length; i++) { + const childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root, leaf); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + } +} +class NamedGroupOperation extends GroupOperation { + constructor(params, owneryQuery, options, children, name) { + super(params, owneryQuery, options, children); + this.name = name; + } +} +class QueryOperation extends GroupOperation { + constructor() { + super(...arguments); + this.propop = true; + } + /** + */ + next(item, key, parent, root) { + this.childrenNext(item, key, parent, root); + } +} +class NestedOperation extends GroupOperation { + constructor(keyPath, params, owneryQuery, options, children) { + super(params, owneryQuery, options, children); + this.keyPath = keyPath; + this.propop = true; + /** + */ + this._nextNestedValue = (value, key, owner, root, leaf) => { + this.childrenNext(value, key, owner, root, leaf); + return !this.done; + }; + } + /** + */ + next(item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + } +} +const createTester = (a, compare) => { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return (b) => { + const result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + const comparableA = comparable(a); + return (b) => compare(comparableA, comparable(b)); +}; +class EqualsOperation extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._test = createTester(this.params, this.options.compare); + } + next(item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + } +} +const createEqualsOperation = (params, owneryQuery, options) => new EqualsOperation(params, owneryQuery, options); +const numericalOperationCreator = (createNumericalOperation) => (params, owneryQuery, options, name) => { + return createNumericalOperation(params, owneryQuery, options, name); +}; +const numericalOperation = (createTester) => numericalOperationCreator((params, owneryQuery, options, name) => { + const typeofParams = typeof comparable(params); + const test = createTester(params); + return new EqualsOperation((b) => { + const actualValue = coercePotentiallyNull(b); + return (typeof comparable(actualValue) === typeofParams && test(actualValue)); + }, owneryQuery, options, name); +}); +const createNamedOperation = (name, params, parentQuery, options) => { + const operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); +}; +const throwUnsupportedOperation = (name) => { + throw new Error(`Unsupported operation: ${name}`); +}; +const containsOperation = (query, options) => { + for (const key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; +}; +const createNestedOperation = (keyPath, nestedQuery, parentKey, owneryQuery, options) => { + if (containsOperation(nestedQuery, options)) { + const [selfOperations, nestedOperations] = createQueryOperations(nestedQuery, parentKey, options); + if (nestedOperations.length) { + throw new Error(`Property queries must contain only operations, or exact objects.`); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options), + ]); +}; +const createQueryOperation = (query, owneryQuery = null, { compare, operations } = {}) => { + const options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}), + }; + const [selfOperations, nestedOperations] = createQueryOperations(query, null, options); + const ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push(...nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); +}; +const createQueryOperations = (query, parentKey, options) => { + const selfOperations = []; + const nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (const key in query) { + if (options.operations.hasOwnProperty(key)) { + const op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error(`Malformed query. ${key} cannot be matched against property.`); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; +}; +const createOperationTester = (operation) => (item, key, owner) => { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; +}; +const createQueryTester = (query, options = {}) => { + return createOperationTester(createQueryOperation(query, null, options)); +}; + +class $Ne extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._test = createTester(this.params, this.options.compare); + } + reset() { + super.reset(); + this.keep = true; + } + next(item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + } +} +// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ +class $ElemMatch extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + if (!this.params || typeof this.params !== "object") { + throw new Error(`Malformed query. $elemMatch must by an object.`); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item) { + if (isArray(item)) { + for (let i = 0, { length } = item; i < length; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + const child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + } +} +class $Not extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + } +} +class $Size extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { } + next(item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + } +} +const assertGroupNotEmpty = (values) => { + if (values.length === 0) { + throw new Error(`$and/$or/$nor must be a nonempty array`); + } +}; +class $Or extends BaseOperation { + constructor() { + super(...arguments); + this.propop = false; + } + init() { + assertGroupNotEmpty(this.params); + this._ops = this.params.map((op) => createQueryOperation(op, null, this.options)); + } + reset() { + this.done = false; + this.keep = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + this._ops[i].reset(); + } + } + next(item, key, owner) { + let done = false; + let success = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + const op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + } +} +class $Nor extends $Or { + constructor() { + super(...arguments); + this.propop = false; + } + next(item, key, owner) { + super.next(item, key, owner); + this.keep = !this.keep; + } +} +class $In extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + const params = Array.isArray(this.params) ? this.params : [this.params]; + this._testers = params.map((value) => { + if (containsOperation(value, this.options)) { + throw new Error(`cannot nest $ under ${this.name.toLowerCase()}`); + } + return createTester(value, this.options.compare); + }); + } + next(item, key, owner) { + let done = false; + let success = false; + for (let i = 0, { length } = this._testers; i < length; i++) { + const test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + } +} +class $Nin extends BaseOperation { + constructor(params, ownerQuery, options, name) { + super(params, ownerQuery, options, name); + this.propop = true; + this._in = new $In(params, ownerQuery, options, name); + } + next(item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + } + reset() { + super.reset(); + this._in.reset(); + } +} +class $Exists extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + next(item, key, owner, root, leaf) { + if (!leaf) { + this.done = true; + this.keep = !this.params; + } + else if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + } +} +class $And extends NamedGroupOperation { + constructor(params, owneryQuery, options, name) { + super(params, owneryQuery, options, params.map((query) => createQueryOperation(query, owneryQuery, options)), name); + this.propop = false; + assertGroupNotEmpty(params); + } + next(item, key, owner, root) { + this.childrenNext(item, key, owner, root); + } +} +class $All extends NamedGroupOperation { + constructor(params, owneryQuery, options, name) { + super(params, owneryQuery, options, params.map((query) => createQueryOperation(query, owneryQuery, options)), name); + this.propop = true; + } + next(item, key, owner, root) { + this.childrenNext(item, key, owner, root); + } +} +const $eq = (params, owneryQuery, options) => new EqualsOperation(params, owneryQuery, options); +const $ne = (params, owneryQuery, options, name) => new $Ne(params, owneryQuery, options, name); +const $or = (params, owneryQuery, options, name) => new $Or(params, owneryQuery, options, name); +const $nor = (params, owneryQuery, options, name) => new $Nor(params, owneryQuery, options, name); +const $elemMatch = (params, owneryQuery, options, name) => new $ElemMatch(params, owneryQuery, options, name); +const $nin = (params, owneryQuery, options, name) => new $Nin(params, owneryQuery, options, name); +const $in = (params, owneryQuery, options, name) => { + return new $In(params, owneryQuery, options, name); +}; +const $lt = numericalOperation((params) => (b) => { + return b != null && b < params; +}); +const $lte = numericalOperation((params) => (b) => { + return b === params || b <= params; +}); +const $gt = numericalOperation((params) => (b) => { + return b != null && b > params; +}); +const $gte = numericalOperation((params) => (b) => { + return b === params || b >= params; +}); +const $mod = ([mod, equalsValue], owneryQuery, options) => new EqualsOperation((b) => comparable(b) % mod === equalsValue, owneryQuery, options); +const $exists = (params, owneryQuery, options, name) => new $Exists(params, owneryQuery, options, name); +const $regex = (pattern, owneryQuery, options) => new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); +const $not = (params, owneryQuery, options, name) => new $Not(params, owneryQuery, options, name); +const typeAliases = { + number: (v) => typeof v === "number", + string: (v) => typeof v === "string", + bool: (v) => typeof v === "boolean", + array: (v) => Array.isArray(v), + null: (v) => v === null, + timestamp: (v) => v instanceof Date, +}; +const $type = (clazz, owneryQuery, options) => new EqualsOperation((b) => { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error(`Type alias does not exist`); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; +}, owneryQuery, options); +const $and = (params, ownerQuery, options, name) => new $And(params, ownerQuery, options, name); +const $all = (params, ownerQuery, options, name) => new $All(params, ownerQuery, options, name); +const $size = (params, ownerQuery, options) => new $Size(params, ownerQuery, options, "$size"); +const $options = () => null; +const $where = (params, ownerQuery, options) => { + let test; + if (isFunction(params)) { + test = params; + } + else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } + else { + throw new Error(`In CSP mode, sift does not support strings in "$where" condition`); + } + return new EqualsOperation((b) => test.bind(b)(b), ownerQuery, options); +}; + +var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $all: $all, + $and: $and, + $elemMatch: $elemMatch, + $eq: $eq, + $exists: $exists, + $gt: $gt, + $gte: $gte, + $in: $in, + $lt: $lt, + $lte: $lte, + $mod: $mod, + $ne: $ne, + $nin: $nin, + $nor: $nor, + $not: $not, + $options: $options, + $or: $or, + $regex: $regex, + $size: $size, + $type: $type, + $where: $where +}); + +const createDefaultQueryOperation = (query, ownerQuery, { compare, operations } = {}) => { + return createQueryOperation(query, ownerQuery, { + compare, + operations: Object.assign({}, defaultOperations, operations || {}), + }); +}; +const createDefaultQueryTester = (query, options = {}) => { + const op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); +}; + +export { $Size, $all, $and, $elemMatch, $eq, $exists, $gt, $gte, $in, $lt, $lte, $mod, $ne, $nin, $nor, $not, $options, $or, $regex, $size, $type, $where, EqualsOperation, createDefaultQueryOperation, createEqualsOperation, createOperationTester, createQueryOperation, createQueryTester, createDefaultQueryTester as default }; +//# sourceMappingURL=index.js.map diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js.map b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js.map new file mode 100644 index 00000000..8a9ff1d4 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/utils.ts","../src/core.ts","../src/operations.ts","../src/index.ts"],"sourcesContent":[null,null,null,null],"names":[],"mappings":"AAEO,MAAM,WAAW,GAAG,CAAQ,IAAI,KAAI;AACzC,IAAA,MAAM,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,GAAG,CAAC;AAC3C,IAAA,OAAO,UAAU,KAAK,EAAA;AACpB,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC;AAC5C,KAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE/D,MAAM,UAAU,GAAG,CAAC,KAAU,KAAI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EAAE,UAAU,EAAuB,GAAA,EAAE,KAC5C;AACF,IAAA,OAAO,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE;QAC7C,OAAO;AACP,QAAA,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,IAAI,EAAE,CAAC;AACnE,KAAA,CAAC,CAAC;AACL,EAAE;AAEI,MAAA,wBAAwB,GAAG,CAC/B,KAAqB,EACrB,OAA4B,GAAA,EAAE,KAC5B;IACF,MAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7D,IAAA,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACnC;;;;"} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js new file mode 100644 index 00000000..afb74649 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js @@ -0,0 +1,743 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +var typeChecker = function (type) { + var typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; +}; +var getClassName = function (value) { return Object.prototype.toString.call(value); }; +var comparable = function (value) { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; +}; +var coercePotentiallyNull = function (value) { + return value == null ? null : value; +}; +var isArray = typeChecker("Array"); +var isObject = typeChecker("Object"); +var isFunction = typeChecker("Function"); +var isProperty = function (item, key) { + return item.hasOwnProperty(key) && !isFunction(item[key]); +}; +var isVanillaObject = function (value) { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); +}; +var equals = function (a, b) { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0, length_1 = a.length; i < length_1; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (var key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; +}; + +/** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ +var walkKeyPathValues = function (item, keyPath, next, depth, key, owner) { + var currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && + isNaN(Number(currentKey)) && + !isProperty(item, currentKey)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0, depth === keyPath.length); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); +}; +var BaseOperation = /** @class */ (function () { + function BaseOperation(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + BaseOperation.prototype.init = function () { }; + BaseOperation.prototype.reset = function () { + this.done = false; + this.keep = false; + }; + return BaseOperation; +}()); +var GroupOperation = /** @class */ (function (_super) { + __extends(GroupOperation, _super); + function GroupOperation(params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options) || this; + _this.children = children; + return _this; + } + /** + */ + GroupOperation.prototype.reset = function () { + this.keep = false; + this.done = false; + for (var i = 0, length_2 = this.children.length; i < length_2; i++) { + this.children[i].reset(); + } + }; + /** + */ + GroupOperation.prototype.childrenNext = function (item, key, owner, root, leaf) { + var done = true; + var keep = true; + for (var i = 0, length_3 = this.children.length; i < length_3; i++) { + var childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root, leaf); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + }; + return GroupOperation; +}(BaseOperation)); +var NamedGroupOperation = /** @class */ (function (_super) { + __extends(NamedGroupOperation, _super); + function NamedGroupOperation(params, owneryQuery, options, children, name) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.name = name; + return _this; + } + return NamedGroupOperation; +}(GroupOperation)); +var QueryOperation = /** @class */ (function (_super) { + __extends(QueryOperation, _super); + function QueryOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + /** + */ + QueryOperation.prototype.next = function (item, key, parent, root) { + this.childrenNext(item, key, parent, root); + }; + return QueryOperation; +}(GroupOperation)); +var NestedOperation = /** @class */ (function (_super) { + __extends(NestedOperation, _super); + function NestedOperation(keyPath, params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.keyPath = keyPath; + _this.propop = true; + /** + */ + _this._nextNestedValue = function (value, key, owner, root, leaf) { + _this.childrenNext(value, key, owner, root, leaf); + return !_this.done; + }; + return _this; + } + /** + */ + NestedOperation.prototype.next = function (item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + }; + return NestedOperation; +}(GroupOperation)); +var createTester = function (a, compare) { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return function (b) { + var result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + var comparableA = comparable(a); + return function (b) { return compare(comparableA, comparable(b)); }; +}; +var EqualsOperation = /** @class */ (function (_super) { + __extends(EqualsOperation, _super); + function EqualsOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + EqualsOperation.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + EqualsOperation.prototype.next = function (item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + }; + return EqualsOperation; +}(BaseOperation)); +var createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); }; +var numericalOperationCreator = function (createNumericalOperation) { + return function (params, owneryQuery, options, name) { + return createNumericalOperation(params, owneryQuery, options, name); + }; +}; +var numericalOperation = function (createTester) { + return numericalOperationCreator(function (params, owneryQuery, options, name) { + var typeofParams = typeof comparable(params); + var test = createTester(params); + return new EqualsOperation(function (b) { + var actualValue = coercePotentiallyNull(b); + return (typeof comparable(actualValue) === typeofParams && test(actualValue)); + }, owneryQuery, options, name); + }); +}; +var createNamedOperation = function (name, params, parentQuery, options) { + var operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); +}; +var throwUnsupportedOperation = function (name) { + throw new Error("Unsupported operation: ".concat(name)); +}; +var containsOperation = function (query, options) { + for (var key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; +}; +var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) { + if (containsOperation(nestedQuery, options)) { + var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1]; + if (nestedOperations.length) { + throw new Error("Property queries must contain only operations, or exact objects."); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options), + ]); +}; +var createQueryOperation = function (query, owneryQuery, _a) { + if (owneryQuery === void 0) { owneryQuery = null; } + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + var options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}), + }; + var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1]; + var ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push.apply(ops, nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); +}; +var createQueryOperations = function (query, parentKey, options) { + var selfOperations = []; + var nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (var key in query) { + if (options.operations.hasOwnProperty(key)) { + var op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error("Malformed query. ".concat(key, " cannot be matched against property.")); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; +}; +var createOperationTester = function (operation) { + return function (item, key, owner) { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; + }; +}; +var createQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + return createOperationTester(createQueryOperation(query, null, options)); +}; + +var $Ne = /** @class */ (function (_super) { + __extends($Ne, _super); + function $Ne() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Ne.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + $Ne.prototype.reset = function () { + _super.prototype.reset.call(this); + this.keep = true; + }; + $Ne.prototype.next = function (item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + }; + return $Ne; +}(BaseOperation)); +// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ +var $ElemMatch = /** @class */ (function (_super) { + __extends($ElemMatch, _super); + function $ElemMatch() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $ElemMatch.prototype.init = function () { + if (!this.params || typeof this.params !== "object") { + throw new Error("Malformed query. $elemMatch must by an object."); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $ElemMatch.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $ElemMatch.prototype.next = function (item) { + if (isArray(item)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + var child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + }; + return $ElemMatch; +}(BaseOperation)); +var $Not = /** @class */ (function (_super) { + __extends($Not, _super); + function $Not() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Not.prototype.init = function () { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $Not.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $Not.prototype.next = function (item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + }; + return $Not; +}(BaseOperation)); +var $Size = /** @class */ (function (_super) { + __extends($Size, _super); + function $Size() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Size.prototype.init = function () { }; + $Size.prototype.next = function (item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + }; + return $Size; +}(BaseOperation)); +var assertGroupNotEmpty = function (values) { + if (values.length === 0) { + throw new Error("$and/$or/$nor must be a nonempty array"); + } +}; +var $Or = /** @class */ (function (_super) { + __extends($Or, _super); + function $Or() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Or.prototype.init = function () { + var _this = this; + assertGroupNotEmpty(this.params); + this._ops = this.params.map(function (op) { + return createQueryOperation(op, null, _this.options); + }); + }; + $Or.prototype.reset = function () { + this.done = false; + this.keep = false; + for (var i = 0, length_2 = this._ops.length; i < length_2; i++) { + this._ops[i].reset(); + } + }; + $Or.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_3 = this._ops.length; i < length_3; i++) { + var op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + }; + return $Or; +}(BaseOperation)); +var $Nor = /** @class */ (function (_super) { + __extends($Nor, _super); + function $Nor() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Nor.prototype.next = function (item, key, owner) { + _super.prototype.next.call(this, item, key, owner); + this.keep = !this.keep; + }; + return $Nor; +}($Or)); +var $In = /** @class */ (function (_super) { + __extends($In, _super); + function $In() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $In.prototype.init = function () { + var _this = this; + var params = Array.isArray(this.params) ? this.params : [this.params]; + this._testers = params.map(function (value) { + if (containsOperation(value, _this.options)) { + throw new Error("cannot nest $ under ".concat(_this.name.toLowerCase())); + } + return createTester(value, _this.options.compare); + }); + }; + $In.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_4 = this._testers.length; i < length_4; i++) { + var test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + }; + return $In; +}(BaseOperation)); +var $Nin = /** @class */ (function (_super) { + __extends($Nin, _super); + function $Nin(params, ownerQuery, options, name) { + var _this = _super.call(this, params, ownerQuery, options, name) || this; + _this.propop = true; + _this._in = new $In(params, ownerQuery, options, name); + return _this; + } + $Nin.prototype.next = function (item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + }; + $Nin.prototype.reset = function () { + _super.prototype.reset.call(this); + this._in.reset(); + }; + return $Nin; +}(BaseOperation)); +var $Exists = /** @class */ (function (_super) { + __extends($Exists, _super); + function $Exists() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Exists.prototype.next = function (item, key, owner, root, leaf) { + if (!leaf) { + this.done = true; + this.keep = !this.params; + } + else if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Exists; +}(BaseOperation)); +var $And = /** @class */ (function (_super) { + __extends($And, _super); + function $And(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = false; + assertGroupNotEmpty(params); + return _this; + } + $And.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $And; +}(NamedGroupOperation)); +var $All = /** @class */ (function (_super) { + __extends($All, _super); + function $All(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = true; + return _this; + } + $All.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $All; +}(NamedGroupOperation)); +var $eq = function (params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); +}; +var $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); }; +var $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); }; +var $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); }; +var $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); }; +var $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); }; +var $in = function (params, owneryQuery, options, name) { + return new $In(params, owneryQuery, options, name); +}; +var $lt = numericalOperation(function (params) { return function (b) { + return b != null && b < params; +}; }); +var $lte = numericalOperation(function (params) { return function (b) { + return b === params || b <= params; +}; }); +var $gt = numericalOperation(function (params) { return function (b) { + return b != null && b > params; +}; }); +var $gte = numericalOperation(function (params) { return function (b) { + return b === params || b >= params; +}; }); +var $mod = function (_a, owneryQuery, options) { + var mod = _a[0], equalsValue = _a[1]; + return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options); +}; +var $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); }; +var $regex = function (pattern, owneryQuery, options) { + return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); +}; +var $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); }; +var typeAliases = { + number: function (v) { return typeof v === "number"; }, + string: function (v) { return typeof v === "string"; }, + bool: function (v) { return typeof v === "boolean"; }, + array: function (v) { return Array.isArray(v); }, + null: function (v) { return v === null; }, + timestamp: function (v) { return v instanceof Date; }, +}; +var $type = function (clazz, owneryQuery, options) { + return new EqualsOperation(function (b) { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error("Type alias does not exist"); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, owneryQuery, options); +}; +var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); }; +var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); }; +var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); }; +var $options = function () { return null; }; +var $where = function (params, ownerQuery, options) { + var test; + if (isFunction(params)) { + test = params; + } + else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } + else { + throw new Error("In CSP mode, sift does not support strings in \"$where\" condition"); + } + return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options); +}; + +var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $all: $all, + $and: $and, + $elemMatch: $elemMatch, + $eq: $eq, + $exists: $exists, + $gt: $gt, + $gte: $gte, + $in: $in, + $lt: $lt, + $lte: $lte, + $mod: $mod, + $ne: $ne, + $nin: $nin, + $nor: $nor, + $not: $not, + $options: $options, + $or: $or, + $regex: $regex, + $size: $size, + $type: $type, + $where: $where +}); + +var createDefaultQueryOperation = function (query, ownerQuery, _a) { + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + return createQueryOperation(query, ownerQuery, { + compare: compare, + operations: Object.assign({}, defaultOperations, operations || {}), + }); +}; +var createDefaultQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + var op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); +}; + +export { $Size, $all, $and, $elemMatch, $eq, $exists, $gt, $gte, $in, $lt, $lte, $mod, $ne, $nin, $nor, $not, $options, $or, $regex, $size, $type, $where, EqualsOperation, createDefaultQueryOperation, createEqualsOperation, createOperationTester, createQueryOperation, createQueryTester, createDefaultQueryTester as default }; +//# sourceMappingURL=index.js.map diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js.map b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js.map new file mode 100644 index 00000000..8523755e --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/es5m/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../src/utils.ts","../src/core.ts","../src/operations.ts","../src/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n",null,null,null,null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,C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U,EAAE,OAAO,CAAC,CAAC;AAC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpZA,IAAM,2BAA2B,GAAG,UAClC,KAAqB,EACrB,UAAe,EACf,EAA8C,EAAA;AAA9C,IAAA,IAAA,EAAA,GAAA,EAAA,KAAA,KAAA,CAAA,GAA4C,EAAE,GAAA,EAAA,EAA5C,OAAO,GAAA,EAAA,CAAA,OAAA,EAAE,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA;AAErB,IAAA,OAAO,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE;AAC7C,QAAA,OAAO,EAAA,OAAA;AACP,QAAA,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,IAAI,EAAE,CAAC;AACnE,KAAA,CAAC,CAAC;AACL,EAAE;AAEF,IAAM,wBAAwB,GAAG,UAC/B,KAAqB,EACrB,OAA8B,EAAA;AAA9B,IAAA,IAAA,OAAA,KAAA,KAAA,CAAA,EAAA,EAAA,OAA8B,GAAA,EAAA,CAAA,EAAA;IAE9B,IAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7D,IAAA,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACnC;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.d.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.d.ts new file mode 100644 index 00000000..2b825710 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.d.ts @@ -0,0 +1,4 @@ +import sift from "./lib"; + +export default sift; +export * from "./lib"; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.js b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.js new file mode 100644 index 00000000..449294a4 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/index.js @@ -0,0 +1,4 @@ +const lib = require("./lib"); + +module.exports = lib.default; +Object.assign(module.exports, lib); diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/core.d.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/core.d.ts new file mode 100644 index 00000000..1e801ae5 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/core.d.ts @@ -0,0 +1,116 @@ +import { Key, Comparator } from "./utils"; +export interface Operation { + readonly keep: boolean; + readonly done: boolean; + propop: boolean; + reset(): any; + next(item: TItem, key?: Key, owner?: any, root?: boolean, leaf?: boolean): any; +} +export type Tester = (item: any, key?: Key, owner?: any, root?: boolean, leaf?: boolean) => boolean; +export interface NamedOperation { + name: string; +} +export type OperationCreator = (params: any, parentQuery: any, options: Options, name: string) => Operation; +export type BasicValueQuery = { + $eq?: TValue; + $ne?: TValue; + $lt?: TValue; + $gt?: TValue; + $lte?: TValue; + $gte?: TValue; + $in?: TValue[]; + $nin?: TValue[]; + $all?: TValue[]; + $mod?: [number, number]; + $exists?: boolean; + $regex?: string | RegExp; + $size?: number; + $where?: ((this: TValue, obj: TValue) => boolean) | string; + $options?: "i" | "g" | "m" | "u"; + $type?: Function; + $not?: NestedQuery; + $or?: NestedQuery[]; + $nor?: NestedQuery[]; + $and?: NestedQuery[]; +}; +export type ArrayValueQuery = { + $elemMatch?: Query; +} & BasicValueQuery; +type Unpacked = T extends (infer U)[] ? U : T; +export type ValueQuery = TValue extends Array ? ArrayValueQuery> : BasicValueQuery; +type NotObject = string | number | Date | boolean | Array; +export type ShapeQuery = TItemSchema extends NotObject ? {} : { + [k in keyof TItemSchema]?: TItemSchema[k] | ValueQuery; +}; +export type NestedQuery = ValueQuery & ShapeQuery; +export type Query = TItemSchema | RegExp | NestedQuery; +export type QueryOperators = keyof ValueQuery; +export declare abstract class BaseOperation implements Operation { + readonly params: TParams; + readonly owneryQuery: any; + readonly options: Options; + readonly name?: string; + keep: boolean; + done: boolean; + abstract propop: boolean; + constructor(params: TParams, owneryQuery: any, options: Options, name?: string); + protected init(): void; + reset(): void; + abstract next(item: any, key: Key, parent: any, root: boolean, leaf?: boolean): any; +} +declare abstract class GroupOperation extends BaseOperation { + readonly children: Operation[]; + keep: boolean; + done: boolean; + constructor(params: any, owneryQuery: any, options: Options, children: Operation[]); + /** + */ + reset(): void; + abstract next(item: any, key: Key, owner: any, root: boolean): any; + /** + */ + protected childrenNext(item: any, key: Key, owner: any, root: boolean, leaf?: boolean): void; +} +export declare abstract class NamedGroupOperation extends GroupOperation implements NamedOperation { + readonly name: string; + abstract propop: boolean; + constructor(params: any, owneryQuery: any, options: Options, children: Operation[], name: string); +} +export declare class QueryOperation extends GroupOperation { + readonly propop = true; + /** + */ + next(item: TItem, key: Key, parent: any, root: boolean): void; +} +export declare class NestedOperation extends GroupOperation { + readonly keyPath: Key[]; + readonly propop = true; + constructor(keyPath: Key[], params: any, owneryQuery: any, options: Options, children: Operation[]); + /** + */ + next(item: any, key: Key, parent: any): void; + /** + */ + private _nextNestedValue; +} +export declare const createTester: (a: any, compare: Comparator) => any; +export declare class EqualsOperation extends BaseOperation { + readonly propop = true; + private _test; + init(): void; + next(item: any, key: Key, parent: any): void; +} +export declare const createEqualsOperation: (params: any, owneryQuery: any, options: Options) => EqualsOperation; +export declare const numericalOperationCreator: (createNumericalOperation: OperationCreator) => (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const numericalOperation: (createTester: (value: any) => Tester) => (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export type Options = { + operations: { + [identifier: string]: OperationCreator; + }; + compare: (a: any, b: any) => boolean; +}; +export declare const containsOperation: (query: any, options: Options) => boolean; +export declare const createQueryOperation: (query: Query, owneryQuery?: any, { compare, operations }?: Partial) => QueryOperation; +export declare const createOperationTester: (operation: Operation) => (item: TItem, key?: Key, owner?: any) => boolean; +export declare const createQueryTester: (query: Query, options?: Partial) => (item: TItem, key?: Key, owner?: any) => boolean; +export {}; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.d.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.d.ts new file mode 100644 index 00000000..6218e8be --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.d.ts @@ -0,0 +1,6 @@ +import { Query, QueryOperators, BasicValueQuery, ArrayValueQuery, ValueQuery, NestedQuery, ShapeQuery, Options, createQueryTester, EqualsOperation, createQueryOperation, createEqualsOperation, createOperationTester } from "./core"; +declare const createDefaultQueryOperation: (query: Query, ownerQuery: any, { compare, operations }?: Partial) => import("./core").QueryOperation; +declare const createDefaultQueryTester: (query: Query, options?: Partial) => (item: unknown, key?: import("./utils").Key, owner?: any) => boolean; +export { Query, QueryOperators, BasicValueQuery, ArrayValueQuery, ValueQuery, NestedQuery, ShapeQuery, EqualsOperation, createQueryTester, createOperationTester, createDefaultQueryOperation, createEqualsOperation, createQueryOperation, }; +export * from "./operations"; +export default createDefaultQueryTester; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js new file mode 100644 index 00000000..74b52895 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js @@ -0,0 +1,781 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sift = {})); +})(this, (function (exports) { 'use strict'; + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise, SuppressedError, Symbol */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + + var typeChecker = function (type) { + var typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; + }; + var getClassName = function (value) { return Object.prototype.toString.call(value); }; + var comparable = function (value) { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; + }; + var coercePotentiallyNull = function (value) { + return value == null ? null : value; + }; + var isArray = typeChecker("Array"); + var isObject = typeChecker("Object"); + var isFunction = typeChecker("Function"); + var isProperty = function (item, key) { + return item.hasOwnProperty(key) && !isFunction(item[key]); + }; + var isVanillaObject = function (value) { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); + }; + var equals = function (a, b) { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0, length_1 = a.length; i < length_1; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (var key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; + }; + + /** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ + var walkKeyPathValues = function (item, keyPath, next, depth, key, owner) { + var currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && + isNaN(Number(currentKey)) && + !isProperty(item, currentKey)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0, depth === keyPath.length); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); + }; + var BaseOperation = /** @class */ (function () { + function BaseOperation(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + BaseOperation.prototype.init = function () { }; + BaseOperation.prototype.reset = function () { + this.done = false; + this.keep = false; + }; + return BaseOperation; + }()); + var GroupOperation = /** @class */ (function (_super) { + __extends(GroupOperation, _super); + function GroupOperation(params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options) || this; + _this.children = children; + return _this; + } + /** + */ + GroupOperation.prototype.reset = function () { + this.keep = false; + this.done = false; + for (var i = 0, length_2 = this.children.length; i < length_2; i++) { + this.children[i].reset(); + } + }; + /** + */ + GroupOperation.prototype.childrenNext = function (item, key, owner, root, leaf) { + var done = true; + var keep = true; + for (var i = 0, length_3 = this.children.length; i < length_3; i++) { + var childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root, leaf); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + }; + return GroupOperation; + }(BaseOperation)); + var NamedGroupOperation = /** @class */ (function (_super) { + __extends(NamedGroupOperation, _super); + function NamedGroupOperation(params, owneryQuery, options, children, name) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.name = name; + return _this; + } + return NamedGroupOperation; + }(GroupOperation)); + var QueryOperation = /** @class */ (function (_super) { + __extends(QueryOperation, _super); + function QueryOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + /** + */ + QueryOperation.prototype.next = function (item, key, parent, root) { + this.childrenNext(item, key, parent, root); + }; + return QueryOperation; + }(GroupOperation)); + var NestedOperation = /** @class */ (function (_super) { + __extends(NestedOperation, _super); + function NestedOperation(keyPath, params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.keyPath = keyPath; + _this.propop = true; + /** + */ + _this._nextNestedValue = function (value, key, owner, root, leaf) { + _this.childrenNext(value, key, owner, root, leaf); + return !_this.done; + }; + return _this; + } + /** + */ + NestedOperation.prototype.next = function (item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + }; + return NestedOperation; + }(GroupOperation)); + var createTester = function (a, compare) { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return function (b) { + var result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + var comparableA = comparable(a); + return function (b) { return compare(comparableA, comparable(b)); }; + }; + var EqualsOperation = /** @class */ (function (_super) { + __extends(EqualsOperation, _super); + function EqualsOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + EqualsOperation.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + EqualsOperation.prototype.next = function (item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + }; + return EqualsOperation; + }(BaseOperation)); + var createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); }; + var numericalOperationCreator = function (createNumericalOperation) { + return function (params, owneryQuery, options, name) { + return createNumericalOperation(params, owneryQuery, options, name); + }; + }; + var numericalOperation = function (createTester) { + return numericalOperationCreator(function (params, owneryQuery, options, name) { + var typeofParams = typeof comparable(params); + var test = createTester(params); + return new EqualsOperation(function (b) { + var actualValue = coercePotentiallyNull(b); + return (typeof comparable(actualValue) === typeofParams && test(actualValue)); + }, owneryQuery, options, name); + }); + }; + var createNamedOperation = function (name, params, parentQuery, options) { + var operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); + }; + var throwUnsupportedOperation = function (name) { + throw new Error("Unsupported operation: ".concat(name)); + }; + var containsOperation = function (query, options) { + for (var key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; + }; + var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) { + if (containsOperation(nestedQuery, options)) { + var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1]; + if (nestedOperations.length) { + throw new Error("Property queries must contain only operations, or exact objects."); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options), + ]); + }; + var createQueryOperation = function (query, owneryQuery, _a) { + if (owneryQuery === void 0) { owneryQuery = null; } + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + var options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}), + }; + var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1]; + var ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push.apply(ops, nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); + }; + var createQueryOperations = function (query, parentKey, options) { + var selfOperations = []; + var nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (var key in query) { + if (options.operations.hasOwnProperty(key)) { + var op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error("Malformed query. ".concat(key, " cannot be matched against property.")); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; + }; + var createOperationTester = function (operation) { + return function (item, key, owner) { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; + }; + }; + var createQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + return createOperationTester(createQueryOperation(query, null, options)); + }; + + var $Ne = /** @class */ (function (_super) { + __extends($Ne, _super); + function $Ne() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Ne.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + $Ne.prototype.reset = function () { + _super.prototype.reset.call(this); + this.keep = true; + }; + $Ne.prototype.next = function (item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + }; + return $Ne; + }(BaseOperation)); + // https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ + var $ElemMatch = /** @class */ (function (_super) { + __extends($ElemMatch, _super); + function $ElemMatch() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $ElemMatch.prototype.init = function () { + if (!this.params || typeof this.params !== "object") { + throw new Error("Malformed query. $elemMatch must by an object."); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $ElemMatch.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $ElemMatch.prototype.next = function (item) { + if (isArray(item)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + var child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + }; + return $ElemMatch; + }(BaseOperation)); + var $Not = /** @class */ (function (_super) { + __extends($Not, _super); + function $Not() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Not.prototype.init = function () { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $Not.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $Not.prototype.next = function (item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + }; + return $Not; + }(BaseOperation)); + var $Size = /** @class */ (function (_super) { + __extends($Size, _super); + function $Size() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Size.prototype.init = function () { }; + $Size.prototype.next = function (item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + }; + return $Size; + }(BaseOperation)); + var assertGroupNotEmpty = function (values) { + if (values.length === 0) { + throw new Error("$and/$or/$nor must be a nonempty array"); + } + }; + var $Or = /** @class */ (function (_super) { + __extends($Or, _super); + function $Or() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Or.prototype.init = function () { + var _this = this; + assertGroupNotEmpty(this.params); + this._ops = this.params.map(function (op) { + return createQueryOperation(op, null, _this.options); + }); + }; + $Or.prototype.reset = function () { + this.done = false; + this.keep = false; + for (var i = 0, length_2 = this._ops.length; i < length_2; i++) { + this._ops[i].reset(); + } + }; + $Or.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_3 = this._ops.length; i < length_3; i++) { + var op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + }; + return $Or; + }(BaseOperation)); + var $Nor = /** @class */ (function (_super) { + __extends($Nor, _super); + function $Nor() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Nor.prototype.next = function (item, key, owner) { + _super.prototype.next.call(this, item, key, owner); + this.keep = !this.keep; + }; + return $Nor; + }($Or)); + var $In = /** @class */ (function (_super) { + __extends($In, _super); + function $In() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $In.prototype.init = function () { + var _this = this; + var params = Array.isArray(this.params) ? this.params : [this.params]; + this._testers = params.map(function (value) { + if (containsOperation(value, _this.options)) { + throw new Error("cannot nest $ under ".concat(_this.name.toLowerCase())); + } + return createTester(value, _this.options.compare); + }); + }; + $In.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_4 = this._testers.length; i < length_4; i++) { + var test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + }; + return $In; + }(BaseOperation)); + var $Nin = /** @class */ (function (_super) { + __extends($Nin, _super); + function $Nin(params, ownerQuery, options, name) { + var _this = _super.call(this, params, ownerQuery, options, name) || this; + _this.propop = true; + _this._in = new $In(params, ownerQuery, options, name); + return _this; + } + $Nin.prototype.next = function (item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + }; + $Nin.prototype.reset = function () { + _super.prototype.reset.call(this); + this._in.reset(); + }; + return $Nin; + }(BaseOperation)); + var $Exists = /** @class */ (function (_super) { + __extends($Exists, _super); + function $Exists() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Exists.prototype.next = function (item, key, owner, root, leaf) { + if (!leaf) { + this.done = true; + this.keep = !this.params; + } + else if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Exists; + }(BaseOperation)); + var $And = /** @class */ (function (_super) { + __extends($And, _super); + function $And(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = false; + assertGroupNotEmpty(params); + return _this; + } + $And.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $And; + }(NamedGroupOperation)); + var $All = /** @class */ (function (_super) { + __extends($All, _super); + function $All(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = true; + return _this; + } + $All.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $All; + }(NamedGroupOperation)); + var $eq = function (params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); + }; + var $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); }; + var $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); }; + var $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); }; + var $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); }; + var $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); }; + var $in = function (params, owneryQuery, options, name) { + return new $In(params, owneryQuery, options, name); + }; + var $lt = numericalOperation(function (params) { return function (b) { + return b != null && b < params; + }; }); + var $lte = numericalOperation(function (params) { return function (b) { + return b === params || b <= params; + }; }); + var $gt = numericalOperation(function (params) { return function (b) { + return b != null && b > params; + }; }); + var $gte = numericalOperation(function (params) { return function (b) { + return b === params || b >= params; + }; }); + var $mod = function (_a, owneryQuery, options) { + var mod = _a[0], equalsValue = _a[1]; + return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options); + }; + var $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); }; + var $regex = function (pattern, owneryQuery, options) { + return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); + }; + var $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); }; + var typeAliases = { + number: function (v) { return typeof v === "number"; }, + string: function (v) { return typeof v === "string"; }, + bool: function (v) { return typeof v === "boolean"; }, + array: function (v) { return Array.isArray(v); }, + null: function (v) { return v === null; }, + timestamp: function (v) { return v instanceof Date; }, + }; + var $type = function (clazz, owneryQuery, options) { + return new EqualsOperation(function (b) { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error("Type alias does not exist"); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, owneryQuery, options); + }; + var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); }; + var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); }; + var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); }; + var $options = function () { return null; }; + var $where = function (params, ownerQuery, options) { + var test; + if (isFunction(params)) { + test = params; + } + else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } + else { + throw new Error("In CSP mode, sift does not support strings in \"$where\" condition"); + } + return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options); + }; + + var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $all: $all, + $and: $and, + $elemMatch: $elemMatch, + $eq: $eq, + $exists: $exists, + $gt: $gt, + $gte: $gte, + $in: $in, + $lt: $lt, + $lte: $lte, + $mod: $mod, + $ne: $ne, + $nin: $nin, + $nor: $nor, + $not: $not, + $options: $options, + $or: $or, + $regex: $regex, + $size: $size, + $type: $type, + $where: $where + }); + + var createDefaultQueryOperation = function (query, ownerQuery, _a) { + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + return createQueryOperation(query, ownerQuery, { + compare: compare, + operations: Object.assign({}, defaultOperations, operations || {}), + }); + }; + var createDefaultQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + var op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); + }; + + exports.$Size = $Size; + exports.$all = $all; + exports.$and = $and; + exports.$elemMatch = $elemMatch; + exports.$eq = $eq; + exports.$exists = $exists; + exports.$gt = $gt; + exports.$gte = $gte; + exports.$in = $in; + exports.$lt = $lt; + exports.$lte = $lte; + exports.$mod = $mod; + exports.$ne = $ne; + exports.$nin = $nin; + exports.$nor = $nor; + exports.$not = $not; + exports.$options = $options; + exports.$or = $or; + exports.$regex = $regex; + exports.$size = $size; + exports.$type = $type; + exports.$where = $where; + exports.EqualsOperation = EqualsOperation; + exports.createDefaultQueryOperation = createDefaultQueryOperation; + exports.createEqualsOperation = createEqualsOperation; + exports.createOperationTester = createOperationTester; + exports.createQueryOperation = createQueryOperation; + exports.createQueryTester = createQueryTester; + exports.default = createDefaultQueryTester; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=index.js.map diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js.map b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js.map new file mode 100644 index 00000000..ca6a98b5 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../src/utils.ts","../src/core.ts","../src/operations.ts","../src/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r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,QAAM,wBAAwB,GAAG,UAC/B,KAAqB,EACrB,OAA8B,EAAA;IAA9B,IAAA,IAAA,OAAA,KAAA,KAAA,CAAA,EAAA,EAAA,OAA8B,GAAA,EAAA,CAAA,EAAA;QAE9B,IAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7D,IAAA,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/operations.d.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/operations.d.ts new file mode 100644 index 00000000..7e49f74e --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/operations.d.ts @@ -0,0 +1,88 @@ +import { BaseOperation, EqualsOperation, Options, Operation, Query, NamedGroupOperation } from "./core"; +import { Key } from "./utils"; +declare class $Ne extends BaseOperation { + readonly propop = true; + private _test; + init(): void; + reset(): void; + next(item: any): void; +} +declare class $ElemMatch extends BaseOperation> { + readonly propop = true; + private _queryOperation; + init(): void; + reset(): void; + next(item: any): void; +} +declare class $Not extends BaseOperation> { + readonly propop = true; + private _queryOperation; + init(): void; + reset(): void; + next(item: any, key: Key, owner: any, root: boolean): void; +} +export declare class $Size extends BaseOperation { + readonly propop = true; + init(): void; + next(item: any): void; +} +declare class $Or extends BaseOperation { + readonly propop = false; + private _ops; + init(): void; + reset(): void; + next(item: any, key: Key, owner: any): void; +} +declare class $Nor extends $Or { + readonly propop = false; + next(item: any, key: Key, owner: any): void; +} +declare class $In extends BaseOperation { + readonly propop = true; + private _testers; + init(): void; + next(item: any, key: Key, owner: any): void; +} +declare class $Nin extends BaseOperation { + readonly propop = true; + private _in; + constructor(params: any, ownerQuery: any, options: Options, name: string); + next(item: any, key: Key, owner: any, root: boolean): void; + reset(): void; +} +declare class $Exists extends BaseOperation { + readonly propop = true; + next(item: any, key: Key, owner: any, root: boolean, leaf?: boolean): void; +} +declare class $And extends NamedGroupOperation { + readonly propop = false; + constructor(params: Query[], owneryQuery: Query, options: Options, name: string); + next(item: any, key: Key, owner: any, root: boolean): void; +} +declare class $All extends NamedGroupOperation { + readonly propop = true; + constructor(params: Query[], owneryQuery: Query, options: Options, name: string); + next(item: any, key: Key, owner: any, root: boolean): void; +} +export declare const $eq: (params: any, owneryQuery: Query, options: Options) => EqualsOperation; +export declare const $ne: (params: any, owneryQuery: Query, options: Options, name: string) => $Ne; +export declare const $or: (params: Query[], owneryQuery: Query, options: Options, name: string) => $Or; +export declare const $nor: (params: Query[], owneryQuery: Query, options: Options, name: string) => $Nor; +export declare const $elemMatch: (params: any, owneryQuery: Query, options: Options, name: string) => $ElemMatch; +export declare const $nin: (params: any, owneryQuery: Query, options: Options, name: string) => $Nin; +export declare const $in: (params: any, owneryQuery: Query, options: Options, name: string) => $In; +export declare const $lt: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $lte: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $gt: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $gte: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $mod: ([mod, equalsValue]: number[], owneryQuery: Query, options: Options) => EqualsOperation<(b: any) => boolean>; +export declare const $exists: (params: boolean, owneryQuery: Query, options: Options, name: string) => $Exists; +export declare const $regex: (pattern: string, owneryQuery: Query, options: Options) => EqualsOperation; +export declare const $not: (params: any, owneryQuery: Query, options: Options, name: string) => $Not; +export declare const $type: (clazz: Function | string, owneryQuery: Query, options: Options) => EqualsOperation<(b: any) => any>; +export declare const $and: (params: Query[], ownerQuery: Query, options: Options, name: string) => $And; +export declare const $all: (params: Query[], ownerQuery: Query, options: Options, name: string) => $All; +export declare const $size: (params: number, ownerQuery: Query, options: Options) => $Size; +export declare const $options: () => any; +export declare const $where: (params: string | Function, ownerQuery: Query, options: Options) => EqualsOperation<(b: any) => any>; +export {}; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/utils.d.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/utils.d.ts new file mode 100644 index 00000000..4de9e746 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/lib/utils.d.ts @@ -0,0 +1,11 @@ +export type Key = string | number; +export type Comparator = (a: any, b: any) => boolean; +export declare const typeChecker: (type: any) => (value: any) => value is TType; +export declare const comparable: (value: any) => any; +export declare const coercePotentiallyNull: (value: any) => any; +export declare const isArray: (value: any) => value is any[]; +export declare const isObject: (value: any) => value is Object; +export declare const isFunction: (value: any) => value is Function; +export declare const isProperty: (item: any, key: any) => boolean; +export declare const isVanillaObject: (value: any) => boolean; +export declare const equals: (a: any, b: any) => boolean; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/package.json b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/package.json new file mode 100644 index 00000000..0784287e --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/package.json @@ -0,0 +1,61 @@ +{ + "name": "sift", + "description": "MongoDB query filtering in JavaScript", + "version": "17.1.3", + "repository": "crcn/sift.js", + "sideEffects": false, + "author": { + "name": "Craig Condon", + "email": "craig.j.condon@gmail.com" + }, + "license": "MIT", + "engines": {}, + "typings": "./index.d.ts", + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged" + } + }, + "devDependencies": { + "@rollup/plugin-replace": "^2.3.2", + "@rollup/plugin-typescript": "8.2.1", + "@types/node": "^13.7.0", + "bson": "^6.6.0", + "eval": "^0.1.8", + "husky": "^9.0.11", + "mocha": "10.4.0", + "mongodb": "^3.6.6", + "prettier": "3.2.5", + "pretty-quick": "^4.0.0", + "rimraf": "^5.0.5", + "rollup": "^4.14.2", + "@rollup/plugin-terser": "^0.4.4", + "tslib": "2.6.2", + "typescript": "5.4.5" + }, + "main": "./index.js", + "module": "./es5m/index.js", + "es2015": "./es/index.js", + "scripts": { + "clean": "rimraf lib es5m es", + "prebuild": "npm run clean && npm run build:types", + "build": "rollup -c", + "build:types": "tsc -p tsconfig.json --emitDeclarationOnly --outDir lib", + "test": "npm run test:spec && npm run test:types", + "test:spec": "mocha ./test -R spec", + "test:types": "cd test && tsc types.ts --noEmit", + "prepublishOnly": "npm run build && npm run test" + }, + "files": [ + "es", + "es5m", + "lib", + "src", + "*.d.ts", + "*.js.map", + "index.js", + "sift.csp.min.js", + "sift.min.js", + "MIT-LICENSE.txt" + ] +} diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js new file mode 100644 index 00000000..b80705d0 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js @@ -0,0 +1,778 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sift = {})); +})(this, (function (exports) { 'use strict'; + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise, SuppressedError, Symbol */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + + var typeChecker = function (type) { + var typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; + }; + var getClassName = function (value) { return Object.prototype.toString.call(value); }; + var comparable = function (value) { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; + }; + var coercePotentiallyNull = function (value) { + return value == null ? null : value; + }; + var isArray = typeChecker("Array"); + var isObject = typeChecker("Object"); + var isFunction = typeChecker("Function"); + var isProperty = function (item, key) { + return item.hasOwnProperty(key) && !isFunction(item[key]); + }; + var isVanillaObject = function (value) { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); + }; + var equals = function (a, b) { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0, length_1 = a.length; i < length_1; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (var key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; + }; + + /** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ + var walkKeyPathValues = function (item, keyPath, next, depth, key, owner) { + var currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && + isNaN(Number(currentKey)) && + !isProperty(item, currentKey)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0, depth === keyPath.length); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); + }; + var BaseOperation = /** @class */ (function () { + function BaseOperation(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + BaseOperation.prototype.init = function () { }; + BaseOperation.prototype.reset = function () { + this.done = false; + this.keep = false; + }; + return BaseOperation; + }()); + var GroupOperation = /** @class */ (function (_super) { + __extends(GroupOperation, _super); + function GroupOperation(params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options) || this; + _this.children = children; + return _this; + } + /** + */ + GroupOperation.prototype.reset = function () { + this.keep = false; + this.done = false; + for (var i = 0, length_2 = this.children.length; i < length_2; i++) { + this.children[i].reset(); + } + }; + /** + */ + GroupOperation.prototype.childrenNext = function (item, key, owner, root, leaf) { + var done = true; + var keep = true; + for (var i = 0, length_3 = this.children.length; i < length_3; i++) { + var childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root, leaf); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + }; + return GroupOperation; + }(BaseOperation)); + var NamedGroupOperation = /** @class */ (function (_super) { + __extends(NamedGroupOperation, _super); + function NamedGroupOperation(params, owneryQuery, options, children, name) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.name = name; + return _this; + } + return NamedGroupOperation; + }(GroupOperation)); + var QueryOperation = /** @class */ (function (_super) { + __extends(QueryOperation, _super); + function QueryOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + /** + */ + QueryOperation.prototype.next = function (item, key, parent, root) { + this.childrenNext(item, key, parent, root); + }; + return QueryOperation; + }(GroupOperation)); + var NestedOperation = /** @class */ (function (_super) { + __extends(NestedOperation, _super); + function NestedOperation(keyPath, params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.keyPath = keyPath; + _this.propop = true; + /** + */ + _this._nextNestedValue = function (value, key, owner, root, leaf) { + _this.childrenNext(value, key, owner, root, leaf); + return !_this.done; + }; + return _this; + } + /** + */ + NestedOperation.prototype.next = function (item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + }; + return NestedOperation; + }(GroupOperation)); + var createTester = function (a, compare) { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return function (b) { + var result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + var comparableA = comparable(a); + return function (b) { return compare(comparableA, comparable(b)); }; + }; + var EqualsOperation = /** @class */ (function (_super) { + __extends(EqualsOperation, _super); + function EqualsOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + EqualsOperation.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + EqualsOperation.prototype.next = function (item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + }; + return EqualsOperation; + }(BaseOperation)); + var createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); }; + var numericalOperationCreator = function (createNumericalOperation) { + return function (params, owneryQuery, options, name) { + return createNumericalOperation(params, owneryQuery, options, name); + }; + }; + var numericalOperation = function (createTester) { + return numericalOperationCreator(function (params, owneryQuery, options, name) { + var typeofParams = typeof comparable(params); + var test = createTester(params); + return new EqualsOperation(function (b) { + var actualValue = coercePotentiallyNull(b); + return (typeof comparable(actualValue) === typeofParams && test(actualValue)); + }, owneryQuery, options, name); + }); + }; + var createNamedOperation = function (name, params, parentQuery, options) { + var operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); + }; + var throwUnsupportedOperation = function (name) { + throw new Error("Unsupported operation: ".concat(name)); + }; + var containsOperation = function (query, options) { + for (var key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; + }; + var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) { + if (containsOperation(nestedQuery, options)) { + var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1]; + if (nestedOperations.length) { + throw new Error("Property queries must contain only operations, or exact objects."); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options), + ]); + }; + var createQueryOperation = function (query, owneryQuery, _a) { + if (owneryQuery === void 0) { owneryQuery = null; } + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + var options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}), + }; + var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1]; + var ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push.apply(ops, nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); + }; + var createQueryOperations = function (query, parentKey, options) { + var selfOperations = []; + var nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (var key in query) { + if (options.operations.hasOwnProperty(key)) { + var op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error("Malformed query. ".concat(key, " cannot be matched against property.")); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; + }; + var createOperationTester = function (operation) { + return function (item, key, owner) { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; + }; + }; + var createQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + return createOperationTester(createQueryOperation(query, null, options)); + }; + + var $Ne = /** @class */ (function (_super) { + __extends($Ne, _super); + function $Ne() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Ne.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + $Ne.prototype.reset = function () { + _super.prototype.reset.call(this); + this.keep = true; + }; + $Ne.prototype.next = function (item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + }; + return $Ne; + }(BaseOperation)); + // https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ + var $ElemMatch = /** @class */ (function (_super) { + __extends($ElemMatch, _super); + function $ElemMatch() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $ElemMatch.prototype.init = function () { + if (!this.params || typeof this.params !== "object") { + throw new Error("Malformed query. $elemMatch must by an object."); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $ElemMatch.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $ElemMatch.prototype.next = function (item) { + if (isArray(item)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + var child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + }; + return $ElemMatch; + }(BaseOperation)); + var $Not = /** @class */ (function (_super) { + __extends($Not, _super); + function $Not() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Not.prototype.init = function () { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $Not.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $Not.prototype.next = function (item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + }; + return $Not; + }(BaseOperation)); + var $Size = /** @class */ (function (_super) { + __extends($Size, _super); + function $Size() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Size.prototype.init = function () { }; + $Size.prototype.next = function (item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + }; + return $Size; + }(BaseOperation)); + var assertGroupNotEmpty = function (values) { + if (values.length === 0) { + throw new Error("$and/$or/$nor must be a nonempty array"); + } + }; + var $Or = /** @class */ (function (_super) { + __extends($Or, _super); + function $Or() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Or.prototype.init = function () { + var _this = this; + assertGroupNotEmpty(this.params); + this._ops = this.params.map(function (op) { + return createQueryOperation(op, null, _this.options); + }); + }; + $Or.prototype.reset = function () { + this.done = false; + this.keep = false; + for (var i = 0, length_2 = this._ops.length; i < length_2; i++) { + this._ops[i].reset(); + } + }; + $Or.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_3 = this._ops.length; i < length_3; i++) { + var op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + }; + return $Or; + }(BaseOperation)); + var $Nor = /** @class */ (function (_super) { + __extends($Nor, _super); + function $Nor() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Nor.prototype.next = function (item, key, owner) { + _super.prototype.next.call(this, item, key, owner); + this.keep = !this.keep; + }; + return $Nor; + }($Or)); + var $In = /** @class */ (function (_super) { + __extends($In, _super); + function $In() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $In.prototype.init = function () { + var _this = this; + var params = Array.isArray(this.params) ? this.params : [this.params]; + this._testers = params.map(function (value) { + if (containsOperation(value, _this.options)) { + throw new Error("cannot nest $ under ".concat(_this.name.toLowerCase())); + } + return createTester(value, _this.options.compare); + }); + }; + $In.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_4 = this._testers.length; i < length_4; i++) { + var test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + }; + return $In; + }(BaseOperation)); + var $Nin = /** @class */ (function (_super) { + __extends($Nin, _super); + function $Nin(params, ownerQuery, options, name) { + var _this = _super.call(this, params, ownerQuery, options, name) || this; + _this.propop = true; + _this._in = new $In(params, ownerQuery, options, name); + return _this; + } + $Nin.prototype.next = function (item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + }; + $Nin.prototype.reset = function () { + _super.prototype.reset.call(this); + this._in.reset(); + }; + return $Nin; + }(BaseOperation)); + var $Exists = /** @class */ (function (_super) { + __extends($Exists, _super); + function $Exists() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Exists.prototype.next = function (item, key, owner, root, leaf) { + if (!leaf) { + this.done = true; + this.keep = !this.params; + } + else if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Exists; + }(BaseOperation)); + var $And = /** @class */ (function (_super) { + __extends($And, _super); + function $And(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = false; + assertGroupNotEmpty(params); + return _this; + } + $And.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $And; + }(NamedGroupOperation)); + var $All = /** @class */ (function (_super) { + __extends($All, _super); + function $All(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = true; + return _this; + } + $All.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $All; + }(NamedGroupOperation)); + var $eq = function (params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); + }; + var $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); }; + var $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); }; + var $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); }; + var $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); }; + var $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); }; + var $in = function (params, owneryQuery, options, name) { + return new $In(params, owneryQuery, options, name); + }; + var $lt = numericalOperation(function (params) { return function (b) { + return b != null && b < params; + }; }); + var $lte = numericalOperation(function (params) { return function (b) { + return b === params || b <= params; + }; }); + var $gt = numericalOperation(function (params) { return function (b) { + return b != null && b > params; + }; }); + var $gte = numericalOperation(function (params) { return function (b) { + return b === params || b >= params; + }; }); + var $mod = function (_a, owneryQuery, options) { + var mod = _a[0], equalsValue = _a[1]; + return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options); + }; + var $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); }; + var $regex = function (pattern, owneryQuery, options) { + return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); + }; + var $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); }; + var typeAliases = { + number: function (v) { return typeof v === "number"; }, + string: function (v) { return typeof v === "string"; }, + bool: function (v) { return typeof v === "boolean"; }, + array: function (v) { return Array.isArray(v); }, + null: function (v) { return v === null; }, + timestamp: function (v) { return v instanceof Date; }, + }; + var $type = function (clazz, owneryQuery, options) { + return new EqualsOperation(function (b) { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error("Type alias does not exist"); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, owneryQuery, options); + }; + var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); }; + var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); }; + var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); }; + var $options = function () { return null; }; + var $where = function (params, ownerQuery, options) { + var test; + if (isFunction(params)) { + test = params; + } + else { + throw new Error("In CSP mode, sift does not support strings in \"$where\" condition"); + } + return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options); + }; + + var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $all: $all, + $and: $and, + $elemMatch: $elemMatch, + $eq: $eq, + $exists: $exists, + $gt: $gt, + $gte: $gte, + $in: $in, + $lt: $lt, + $lte: $lte, + $mod: $mod, + $ne: $ne, + $nin: $nin, + $nor: $nor, + $not: $not, + $options: $options, + $or: $or, + $regex: $regex, + $size: $size, + $type: $type, + $where: $where + }); + + var createDefaultQueryOperation = function (query, ownerQuery, _a) { + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + return createQueryOperation(query, ownerQuery, { + compare: compare, + operations: Object.assign({}, defaultOperations, operations || {}), + }); + }; + var createDefaultQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + var op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); + }; + + exports.$Size = $Size; + exports.$all = $all; + exports.$and = $and; + exports.$elemMatch = $elemMatch; + exports.$eq = $eq; + exports.$exists = $exists; + exports.$gt = $gt; + exports.$gte = $gte; + exports.$in = $in; + exports.$lt = $lt; + exports.$lte = $lte; + exports.$mod = $mod; + exports.$ne = $ne; + exports.$nin = $nin; + exports.$nor = $nor; + exports.$not = $not; + exports.$options = $options; + exports.$or = $or; + exports.$regex = $regex; + exports.$size = $size; + exports.$type = $type; + exports.$where = $where; + exports.EqualsOperation = EqualsOperation; + exports.createDefaultQueryOperation = createDefaultQueryOperation; + exports.createEqualsOperation = createEqualsOperation; + exports.createOperationTester = createOperationTester; + exports.createQueryOperation = createQueryOperation; + exports.createQueryTester = createQueryTester; + exports.default = createDefaultQueryTester; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=sift.csp.min.js.map diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js.map b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js.map new file mode 100644 index 00000000..681fb85b --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.csp.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sift.csp.min.js","sources":["node_modules/tslib/tslib.es6.js","src/utils.ts","src/core.ts","src/operations.ts","src/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n",null,null,null,null],"names":[],"mappings":";;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,C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A,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;YACtB,IAAI,GAAG,MAAM,CAAC;SACf;IAAM,SAEA;IACL,QAAA,MAAM,IAAI,KAAK,CACb,oEAAkE,CACnE,CAAC;SACH;QAED,OAAO,IAAI,eAAe,CAAC,UAAC,CAAC,EAAK,EAAA,OAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAf,EAAe,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpZA,QAAM,2BAA2B,GAAG,UAClC,KAAqB,EACrB,UAAe,EACf,EAA8C,EAAA;IAA9C,IAAA,IAAA,EAAA,GAAA,EAAA,KAAA,KAAA,CAAA,GAA4C,EAAE,GAAA,EAAA,EAA5C,OAAO,GAAA,EAAA,CAAA,OAAA,EAAE,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA;IAErB,IAAA,OAAO,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE;IAC7C,QAAA,OAAO,EAAA,OAAA;IACP,QAAA,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,IAAI,EAAE,CAAC;IACnE,KAAA,CAAC,CAAC;IACL,EAAE;AAEF,QAAM,wBAAwB,GAAG,UAC/B,KAAqB,EACrB,OAA8B,EAAA;IAA9B,IAAA,IAAA,OAAA,KAAA,KAAA,CAAA,EAAA,EAAA,OAA8B,GAAA,EAAA,CAAA,EAAA;QAE9B,IAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7D,IAAA,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js new file mode 100644 index 00000000..035d448a --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js @@ -0,0 +1,2 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).sift={})}(this,(function(n){"use strict";var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])},t(n,r)};function r(n,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}"function"==typeof SuppressedError&&SuppressedError;var i=function(n){var t="[object "+n+"]";return function(n){return u(n)===t}},u=function(n){return Object.prototype.toString.call(n)},e=function(n){return n instanceof Date?n.getTime():o(n)?n.map(e):n&&"function"==typeof n.toJSON?n.toJSON():n},o=i("Array"),f=i("Object"),s=i("Function"),c=function(n,t){if(null==n&&n==t)return!0;if(n===t)return!0;if(Object.prototype.toString.call(n)!==Object.prototype.toString.call(t))return!1;if(o(n)){if(n.length!==t.length)return!1;for(var r=0,i=n.length;rn}})),Q=d((function(n){return function(t){return t===n||t>=n}})),V=function(n,t,r){var i=n[0],u=n[1];return new y((function(n){return e(n)%i===u}),t,r)},W=function(n,t,r,i){return new N(n,t,r,i)},X=function(n,t,r){return new y(new RegExp(n,t.$options),t,r)},Y=function(n,t,r,i){return new M(n,t,r,i)},Z={number:function(n){return"number"==typeof n},string:function(n){return"string"==typeof n},bool:function(n){return"boolean"==typeof n},array:function(n){return Array.isArray(n)},null:function(n){return null===n},timestamp:function(n){return n instanceof Date}},nn=function(n,t,r){return new y((function(t){if("string"==typeof n){if(!Z[n])throw new Error("Type alias does not exist");return Z[n](t)}return null!=t&&(t instanceof n||t.constructor===n)}),t,r)},tn=function(n,t,r,i){return new C(n,t,r,i)},rn=function(n,t,r,i){return new D(n,t,r,i)},un=function(n,t,r){return new S(n,t,r,"$size")},en=function(){return null},on=function(n,t,r){var i;if(s(n))i=n;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');i=new Function("obj","return "+n)}return new y((function(n){return i.bind(n)(n)}),t,r)},fn=Object.freeze({__proto__:null,$Size:S,$all:rn,$and:tn,$elemMatch:B,$eq:P,$exists:W,$gt:L,$gte:Q,$in:H,$lt:J,$lte:K,$mod:V,$ne:R,$nin:G,$nor:U,$not:Y,$options:en,$or:I,$regex:X,$size:un,$type:nn,$where:on}),sn=function(n,t,r){var i=void 0===r?{}:r,u=i.compare,e=i.operations;return g(n,t,{compare:u,operations:Object.assign({},fn,e||{})})};n.$Size=S,n.$all=rn,n.$and=tn,n.$elemMatch=B,n.$eq=P,n.$exists=W,n.$gt=L,n.$gte=Q,n.$in=H,n.$lt=J,n.$lte=K,n.$mod=V,n.$ne=R,n.$nin=G,n.$nor=U,n.$not=Y,n.$options=en,n.$or=I,n.$regex=X,n.$size=un,n.$type=nn,n.$where=on,n.EqualsOperation=y,n.createDefaultQueryOperation=sn,n.createEqualsOperation=function(n,t,r){return new y(n,t,r)},n.createOperationTester=x,n.createQueryOperation=g,n.createQueryTester=function(n,t){return void 0===t&&(t={}),x(g(n,null,t))},n.default=function(n,t){void 0===t&&(t={});var r=sn(n,null,t);return x(r)},Object.defineProperty(n,"v",{value:!0})})); +//# sourceMappingURL=sift.min.js.map diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js.map b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js.map new file mode 100644 index 00000000..fd725378 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/sift.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sift.min.js","sources":["node_modules/tslib/tslib.es6.js","src/utils.ts","src/core.ts","src/operations.ts","src/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n",null,null,null,null],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","SuppressedError","typeChecker","type","typeString","value","getClassName","toString","comparable","Date","getTime","isArray","map","toJSON","isObject","isFunction","equals","a","length","i","length_1","keys","key","walkKeyPathValues","item","keyPath","next","depth","owner","currentKey","isNaN","Number","isProperty","BaseOperation","params","owneryQuery","options","name","init","reset","done","keep","GroupOperation","_super","children","_this","length_2","childrenNext","root","leaf","length_3","childOperation","NamedGroupOperation","QueryOperation","propop","parent","NestedOperation","_nextNestedValue","createTester","compare","Function","RegExp","result","test","lastIndex","comparableA","EqualsOperation","_test","numericalOperation","createNumericalOperation","typeofParams","actualValue","createNamedOperation","parentQuery","operationCreator","operations","throwUnsupportedOperation","Error","containsOperation","query","charAt","createNestedOperation","nestedQuery","parentKey","_a","createQueryOperations","selfOperations","createQueryOperation","_b","assign","_c","nestedOperations","ops","push","apply","op","split","createOperationTester","operation","$Ne","$ElemMatch","_queryOperation","child","$Not","$Size","assertGroupNotEmpty","values","$Or","_ops","success","$Nor","$In","_testers","concat","toLowerCase","length_4","$Nin","ownerQuery","_in","$Exists","$And","$All","$eq","$ne","$or","$nor","$elemMatch","$nin","$in","$lt","$lte","$gt","$gte","$mod","mod","equalsValue","$exists","$regex","pattern","$options","$not","typeAliases","number","v","string","bool","array","null","timestamp","$type","clazz","$and","$all","$size","$where","process","env","CSP_ENABLED","bind","createDefaultQueryOperation","defaultOperations"],"mappings":"4OAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAE,G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,IAAIC,YAGtB,MAAM,IAAIhF,MACR,oEAHFd,EAAO,IAAIH,SAAS,MAAO,UAAY1B,EAKxC,CAED,OAAO,IAAIgC,GAAgB,SAACjF,GAAM,OAAA8E,EAAK+F,KAAK7K,EAAV8E,CAAa9E,EAAE,GAAEoI,EAAYjF,EACjE,mNCpZM2H,GAA8B,SAClChF,EACAsC,EACAjC,GAAA,IAAAI,OAAA,IAAAJ,EAA4C,CAAA,EAAEA,EAA5CzB,EAAO6B,EAAA7B,QAAEgB,EAAUa,EAAAb,WAErB,OAAOY,EAAqBR,EAAOsC,EAAY,CAC7C1D,QAAOA,EACPgB,WAAYzF,OAAOuG,OAAO,CAAE,EAAEuE,GAAmBrF,GAAc,KAEnE,ySFgSqC,SACnCzC,EACAC,EACAC,GACG,OAAA,IAAI8B,EAAgBhC,EAAQC,EAAaC,EAAS,yEAwKtB,SAC/B2C,EACA3C,GAEA,YAFA,IAAAA,IAAAA,EAA8B,CAAA,GAEvB6D,EACLV,EAAqCR,EAAO,KAAM3C,GAEtD,YEjdiC,SAC/B2C,EACA3C,QAAA,IAAAA,IAAAA,EAA8B,CAAA,GAE9B,IAAM2D,EAAKgE,GAA4BhF,EAAO,KAAM3C,GACpD,OAAO6D,EAAsBF,EAC/B","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/core.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/core.ts new file mode 100644 index 00000000..68ecea9b --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/core.ts @@ -0,0 +1,494 @@ +import { + isArray, + Key, + Comparator, + isVanillaObject, + comparable, + equals, + coercePotentiallyNull, + isProperty, +} from "./utils"; + +export interface Operation { + readonly keep: boolean; + readonly done: boolean; + propop: boolean; + reset(); + next(item: TItem, key?: Key, owner?: any, root?: boolean, leaf?: boolean); +} + +export type Tester = ( + item: any, + key?: Key, + owner?: any, + root?: boolean, + leaf?: boolean, +) => boolean; + +export interface NamedOperation { + name: string; +} + +export type OperationCreator = ( + params: any, + parentQuery: any, + options: Options, + name: string, +) => Operation; + +export type BasicValueQuery = { + $eq?: TValue; + $ne?: TValue; + $lt?: TValue; + $gt?: TValue; + $lte?: TValue; + $gte?: TValue; + $in?: TValue[]; + $nin?: TValue[]; + $all?: TValue[]; + $mod?: [number, number]; + $exists?: boolean; + $regex?: string | RegExp; + $size?: number; + $where?: ((this: TValue, obj: TValue) => boolean) | string; + $options?: "i" | "g" | "m" | "u"; + $type?: Function; + $not?: NestedQuery; + $or?: NestedQuery[]; + $nor?: NestedQuery[]; + $and?: NestedQuery[]; +}; + +export type ArrayValueQuery = { + $elemMatch?: Query; +} & BasicValueQuery; +type Unpacked = T extends (infer U)[] ? U : T; + +export type ValueQuery = + TValue extends Array + ? ArrayValueQuery> + : BasicValueQuery; + +type NotObject = string | number | Date | boolean | Array; +export type ShapeQuery = TItemSchema extends NotObject + ? {} + : { [k in keyof TItemSchema]?: TItemSchema[k] | ValueQuery }; + +export type NestedQuery = ValueQuery & + ShapeQuery; +export type Query = + | TItemSchema + | RegExp + | NestedQuery; + +export type QueryOperators = keyof ValueQuery; + +/** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ + +const walkKeyPathValues = ( + item: any, + keyPath: Key[], + next: Tester, + depth: number, + key: Key, + owner: any, +) => { + const currentKey = keyPath[depth]; + + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if ( + isArray(item) && + isNaN(Number(currentKey)) && + !isProperty(item, currentKey) + ) { + for (let i = 0, { length } = item; i < length; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0, depth === keyPath.length); + } + + return walkKeyPathValues( + item[currentKey], + keyPath, + next, + depth + 1, + currentKey, + item, + ); +}; + +export abstract class BaseOperation + implements Operation +{ + keep: boolean; + done: boolean; + abstract propop: boolean; + constructor( + readonly params: TParams, + readonly owneryQuery: any, + readonly options: Options, + readonly name?: string, + ) { + this.init(); + } + protected init() {} + reset() { + this.done = false; + this.keep = false; + } + abstract next( + item: any, + key: Key, + parent: any, + root: boolean, + leaf?: boolean, + ); +} + +abstract class GroupOperation extends BaseOperation { + keep: boolean; + done: boolean; + + constructor( + params: any, + owneryQuery: any, + options: Options, + public readonly children: Operation[], + ) { + super(params, owneryQuery, options); + } + + /** + */ + + reset() { + this.keep = false; + this.done = false; + for (let i = 0, { length } = this.children; i < length; i++) { + this.children[i].reset(); + } + } + + abstract next(item: any, key: Key, owner: any, root: boolean); + + /** + */ + + protected childrenNext( + item: any, + key: Key, + owner: any, + root: boolean, + leaf?: boolean, + ) { + let done = true; + let keep = true; + for (let i = 0, { length } = this.children; i < length; i++) { + const childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root, leaf); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } else { + done = false; + } + } + this.done = done; + this.keep = keep; + } +} + +export abstract class NamedGroupOperation + extends GroupOperation + implements NamedOperation +{ + abstract propop: boolean; + constructor( + params: any, + owneryQuery: any, + options: Options, + children: Operation[], + readonly name: string, + ) { + super(params, owneryQuery, options, children); + } +} + +export class QueryOperation extends GroupOperation { + readonly propop = true; + /** + */ + + next(item: TItem, key: Key, parent: any, root: boolean) { + this.childrenNext(item, key, parent, root); + } +} + +export class NestedOperation extends GroupOperation { + readonly propop = true; + constructor( + readonly keyPath: Key[], + params: any, + owneryQuery: any, + options: Options, + children: Operation[], + ) { + super(params, owneryQuery, options, children); + } + /** + */ + + next(item: any, key: Key, parent: any) { + walkKeyPathValues( + item, + this.keyPath, + this._nextNestedValue, + 0, + key, + parent, + ); + } + + /** + */ + + private _nextNestedValue = ( + value: any, + key: Key, + owner: any, + root: boolean, + leaf: boolean, + ) => { + this.childrenNext(value, key, owner, root, leaf); + return !this.done; + }; +} + +export const createTester = (a, compare: Comparator) => { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return (b) => { + const result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + const comparableA = comparable(a); + return (b) => compare(comparableA, comparable(b)); +}; + +export class EqualsOperation extends BaseOperation { + readonly propop = true; + private _test: Tester; + init() { + this._test = createTester(this.params, this.options.compare); + } + next(item, key: Key, parent: any) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + } +} + +export const createEqualsOperation = ( + params: any, + owneryQuery: any, + options: Options, +) => new EqualsOperation(params, owneryQuery, options); + +export const numericalOperationCreator = + (createNumericalOperation: OperationCreator) => + (params: any, owneryQuery: any, options: Options, name: string) => { + return createNumericalOperation(params, owneryQuery, options, name); + }; + +export const numericalOperation = (createTester: (value: any) => Tester) => + numericalOperationCreator( + (params: any, owneryQuery: Query, options: Options, name: string) => { + const typeofParams = typeof comparable(params); + const test = createTester(params); + return new EqualsOperation( + (b) => { + const actualValue = coercePotentiallyNull(b); + return ( + typeof comparable(actualValue) === typeofParams && test(actualValue) + ); + }, + owneryQuery, + options, + name, + ); + }, + ); + +export type Options = { + operations: { + [identifier: string]: OperationCreator; + }; + compare: (a, b) => boolean; +}; + +const createNamedOperation = ( + name: string, + params: any, + parentQuery: any, + options: Options, +) => { + const operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); +}; + +const throwUnsupportedOperation = (name: string) => { + throw new Error(`Unsupported operation: ${name}`); +}; + +export const containsOperation = (query: any, options: Options) => { + for (const key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; +}; +const createNestedOperation = ( + keyPath: Key[], + nestedQuery: any, + parentKey: string, + owneryQuery: any, + options: Options, +) => { + if (containsOperation(nestedQuery, options)) { + const [selfOperations, nestedOperations] = createQueryOperations( + nestedQuery, + parentKey, + options, + ); + if (nestedOperations.length) { + throw new Error( + `Property queries must contain only operations, or exact objects.`, + ); + } + return new NestedOperation( + keyPath, + nestedQuery, + owneryQuery, + options, + selfOperations, + ); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options), + ]); +}; + +export const createQueryOperation = ( + query: Query, + owneryQuery: any = null, + { compare, operations }: Partial = {}, +): QueryOperation => { + const options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}), + }; + + const [selfOperations, nestedOperations] = createQueryOperations( + query, + null, + options, + ); + + const ops = []; + + if (selfOperations.length) { + ops.push( + new NestedOperation([], query, owneryQuery, options, selfOperations), + ); + } + + ops.push(...nestedOperations); + + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); +}; + +const createQueryOperations = ( + query: any, + parentKey: string, + options: Options, +) => { + const selfOperations = []; + const nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (const key in query) { + if (options.operations.hasOwnProperty(key)) { + const op = createNamedOperation(key, query[key], query, options); + + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error( + `Malformed query. ${key} cannot be matched against property.`, + ); + } + } + + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } else { + nestedOperations.push( + createNestedOperation(key.split("."), query[key], key, query, options), + ); + } + } + + return [selfOperations, nestedOperations]; +}; + +export const createOperationTester = + (operation: Operation) => + (item: TItem, key?: Key, owner?: any) => { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; + }; + +export const createQueryTester = ( + query: Query, + options: Partial = {}, +) => { + return createOperationTester( + createQueryOperation(query, null, options), + ); +}; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/index.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/index.ts new file mode 100644 index 00000000..ea733b9a --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/index.ts @@ -0,0 +1,54 @@ +import * as defaultOperations from "./operations"; +import { + Query, + QueryOperators, + BasicValueQuery, + ArrayValueQuery, + ValueQuery, + NestedQuery, + ShapeQuery, + Options, + createQueryTester, + EqualsOperation, + createQueryOperation, + createEqualsOperation, + createOperationTester, +} from "./core"; + +const createDefaultQueryOperation = ( + query: Query, + ownerQuery: any, + { compare, operations }: Partial = {}, +) => { + return createQueryOperation(query, ownerQuery, { + compare, + operations: Object.assign({}, defaultOperations, operations || {}), + }); +}; + +const createDefaultQueryTester = ( + query: Query, + options: Partial = {}, +) => { + const op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); +}; + +export { + Query, + QueryOperators, + BasicValueQuery, + ArrayValueQuery, + ValueQuery, + NestedQuery, + ShapeQuery, + EqualsOperation, + createQueryTester, + createOperationTester, + createDefaultQueryOperation, + createEqualsOperation, + createQueryOperation, +}; +export * from "./operations"; + +export default createDefaultQueryTester; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/operations.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/operations.ts new file mode 100644 index 00000000..68177b1a --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/operations.ts @@ -0,0 +1,422 @@ +import { + BaseOperation, + EqualsOperation, + Options, + createTester, + Tester, + createQueryOperation, + QueryOperation, + Operation, + Query, + NamedGroupOperation, + numericalOperation, + containsOperation, +} from "./core"; +import { Key, comparable, isFunction, isArray } from "./utils"; + +class $Ne extends BaseOperation { + readonly propop = true; + private _test: Tester; + init() { + this._test = createTester(this.params, this.options.compare); + } + reset() { + super.reset(); + this.keep = true; + } + next(item: any) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + } +} +// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ +class $ElemMatch extends BaseOperation> { + readonly propop = true; + private _queryOperation: QueryOperation; + init() { + if (!this.params || typeof this.params !== "object") { + throw new Error(`Malformed query. $elemMatch must by an object.`); + } + this._queryOperation = createQueryOperation( + this.params, + this.owneryQuery, + this.options, + ); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item: any) { + if (isArray(item)) { + for (let i = 0, { length } = item; i < length; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + + const child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } else { + this.done = false; + this.keep = false; + } + } +} + +class $Not extends BaseOperation> { + readonly propop = true; + private _queryOperation: QueryOperation; + init() { + this._queryOperation = createQueryOperation( + this.params, + this.owneryQuery, + this.options, + ); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item: any, key: Key, owner: any, root: boolean) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + } +} + +export class $Size extends BaseOperation { + readonly propop = true; + init() {} + next(item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + } +} + +const assertGroupNotEmpty = (values: any[]) => { + if (values.length === 0) { + throw new Error(`$and/$or/$nor must be a nonempty array`); + } +}; + +class $Or extends BaseOperation { + readonly propop = false; + private _ops: Operation[]; + init() { + assertGroupNotEmpty(this.params); + this._ops = this.params.map((op) => + createQueryOperation(op, null, this.options), + ); + } + reset() { + this.done = false; + this.keep = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + this._ops[i].reset(); + } + } + next(item: any, key: Key, owner: any) { + let done = false; + let success = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + const op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + + this.keep = success; + this.done = done; + } +} + +class $Nor extends $Or { + readonly propop = false; + next(item: any, key: Key, owner: any) { + super.next(item, key, owner); + this.keep = !this.keep; + } +} + +class $In extends BaseOperation { + readonly propop = true; + private _testers: Tester[]; + init() { + const params = Array.isArray(this.params) ? this.params : [this.params]; + this._testers = params.map((value) => { + if (containsOperation(value, this.options)) { + throw new Error(`cannot nest $ under ${this.name.toLowerCase()}`); + } + return createTester(value, this.options.compare); + }); + } + next(item: any, key: Key, owner: any) { + let done = false; + let success = false; + for (let i = 0, { length } = this._testers; i < length; i++) { + const test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + + this.keep = success; + this.done = done; + } +} + +class $Nin extends BaseOperation { + readonly propop = true; + private _in: $In; + constructor(params: any, ownerQuery: any, options: Options, name: string) { + super(params, ownerQuery, options, name); + this._in = new $In(params, ownerQuery, options, name); + } + next(item: any, key: Key, owner: any, root: boolean) { + this._in.next(item, key, owner); + + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } else { + this.keep = !this._in.keep; + this.done = true; + } + } + reset() { + super.reset(); + this._in.reset(); + } +} + +class $Exists extends BaseOperation { + readonly propop = true; + next(item: any, key: Key, owner: any, root: boolean, leaf?: boolean) { + if (!leaf) { + this.done = true; + this.keep = !this.params; + } else if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + } +} + +class $And extends NamedGroupOperation { + readonly propop = false; + constructor( + params: Query[], + owneryQuery: Query, + options: Options, + name: string, + ) { + super( + params, + owneryQuery, + options, + params.map((query) => createQueryOperation(query, owneryQuery, options)), + name, + ); + + assertGroupNotEmpty(params); + } + next(item: any, key: Key, owner: any, root: boolean) { + this.childrenNext(item, key, owner, root); + } +} + +class $All extends NamedGroupOperation { + readonly propop = true; + constructor( + params: Query[], + owneryQuery: Query, + options: Options, + name: string, + ) { + super( + params, + owneryQuery, + options, + params.map((query) => createQueryOperation(query, owneryQuery, options)), + name, + ); + } + next(item: any, key: Key, owner: any, root: boolean) { + this.childrenNext(item, key, owner, root); + } +} + +export const $eq = (params: any, owneryQuery: Query, options: Options) => + new EqualsOperation(params, owneryQuery, options); +export const $ne = ( + params: any, + owneryQuery: Query, + options: Options, + name: string, +) => new $Ne(params, owneryQuery, options, name); +export const $or = ( + params: Query[], + owneryQuery: Query, + options: Options, + name: string, +) => new $Or(params, owneryQuery, options, name); +export const $nor = ( + params: Query[], + owneryQuery: Query, + options: Options, + name: string, +) => new $Nor(params, owneryQuery, options, name); +export const $elemMatch = ( + params: any, + owneryQuery: Query, + options: Options, + name: string, +) => new $ElemMatch(params, owneryQuery, options, name); +export const $nin = ( + params: any, + owneryQuery: Query, + options: Options, + name: string, +) => new $Nin(params, owneryQuery, options, name); +export const $in = ( + params: any, + owneryQuery: Query, + options: Options, + name: string, +) => { + return new $In(params, owneryQuery, options, name); +}; + +export const $lt = numericalOperation((params) => (b) => { + return b != null && b < params; +}); +export const $lte = numericalOperation((params) => (b) => { + return b === params || b <= params; +}); +export const $gt = numericalOperation((params) => (b) => { + return b != null && b > params; +}); +export const $gte = numericalOperation((params) => (b) => { + return b === params || b >= params; +}); +export const $mod = ( + [mod, equalsValue]: number[], + owneryQuery: Query, + options: Options, +) => + new EqualsOperation( + (b) => comparable(b) % mod === equalsValue, + owneryQuery, + options, + ); +export const $exists = ( + params: boolean, + owneryQuery: Query, + options: Options, + name: string, +) => new $Exists(params, owneryQuery, options, name); +export const $regex = ( + pattern: string, + owneryQuery: Query, + options: Options, +) => + new EqualsOperation( + new RegExp(pattern, owneryQuery.$options), + owneryQuery, + options, + ); +export const $not = ( + params: any, + owneryQuery: Query, + options: Options, + name: string, +) => new $Not(params, owneryQuery, options, name); + +const typeAliases = { + number: (v) => typeof v === "number", + string: (v) => typeof v === "string", + bool: (v) => typeof v === "boolean", + array: (v) => Array.isArray(v), + null: (v) => v === null, + timestamp: (v) => v instanceof Date, +}; + +export const $type = ( + clazz: Function | string, + owneryQuery: Query, + options: Options, +) => + new EqualsOperation( + (b) => { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error(`Type alias does not exist`); + } + + return typeAliases[clazz](b); + } + + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, + owneryQuery, + options, + ); +export const $and = ( + params: Query[], + ownerQuery: Query, + options: Options, + name: string, +) => new $And(params, ownerQuery, options, name); + +export const $all = ( + params: Query[], + ownerQuery: Query, + options: Options, + name: string, +) => new $All(params, ownerQuery, options, name); +export const $size = ( + params: number, + ownerQuery: Query, + options: Options, +) => new $Size(params, ownerQuery, options, "$size"); +export const $options = () => null; +export const $where = ( + params: string | Function, + ownerQuery: Query, + options: Options, +) => { + let test; + + if (isFunction(params)) { + test = params; + } else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } else { + throw new Error( + `In CSP mode, sift does not support strings in "$where" condition`, + ); + } + + return new EqualsOperation((b) => test.bind(b)(b), ownerQuery, options); +}; diff --git a/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/utils.ts b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/utils.ts new file mode 100644 index 00000000..02e2a758 --- /dev/null +++ b/backend/node_modules/.pnpm/sift@17.1.3/node_modules/sift/src/utils.ts @@ -0,0 +1,74 @@ +export type Key = string | number; +export type Comparator = (a, b) => boolean; +export const typeChecker = (type) => { + const typeString = "[object " + type + "]"; + return function (value): value is TType { + return getClassName(value) === typeString; + }; +}; + +const getClassName = (value) => Object.prototype.toString.call(value); + +export const comparable = (value: any) => { + if (value instanceof Date) { + return value.getTime(); + } else if (isArray(value)) { + return value.map(comparable); + } else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + + return value; +}; + +export const coercePotentiallyNull = (value: any) => + value == null ? null : value; + +export const isArray = typeChecker>("Array"); +export const isObject = typeChecker("Object"); +export const isFunction = typeChecker("Function"); +export const isProperty = (item: any, key: any) => { + return item.hasOwnProperty(key) && !isFunction(item[key]); +}; +export const isVanillaObject = (value) => { + return ( + value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON + ); +}; + +export const equals = (a, b) => { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (let i = 0, { length } = a; i < length; i++) { + if (!equals(a[i], b[i])) return false; + } + return true; + } else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (!equals(a[key], b[key])) return false; + } + return true; + } + return false; +}; diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/memory-pager b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/memory-pager new file mode 120000 index 00000000..5cb4adf6 --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/memory-pager @@ -0,0 +1 @@ +../../memory-pager@1.5.0/node_modules/memory-pager \ No newline at end of file diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.npmignore b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.travis.yml b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.travis.yml new file mode 100644 index 00000000..c0428217 --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - '0.10' + - '0.12' + - '4.0' + - '5.0' diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/LICENSE b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/LICENSE new file mode 100644 index 00000000..bae9da7b --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/README.md b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/README.md new file mode 100644 index 00000000..7b6b8f9e --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/README.md @@ -0,0 +1,62 @@ +# sparse-bitfield + +Bitfield implementation that allocates a series of 1kb buffers to support sparse bitfields +without allocating a massive buffer. If you want to simple implementation of a flat bitfield +see the [bitfield](https://github.com/fb55/bitfield) module. + +This module is mostly useful if you need a big bitfield where you won't nessecarily set every bit. + +``` +npm install sparse-bitfield +``` + +[![build status](http://img.shields.io/travis/mafintosh/sparse-bitfield.svg?style=flat)](http://travis-ci.org/mafintosh/sparse-bitfield) + +## Usage + +``` js +var bitfield = require('sparse-bitfield') +var bits = bitfield() + +bits.set(0, true) // set first bit +bits.set(1, true) // set second bit +bits.set(1000000000000, true) // set the 1.000.000.000.000th bit +``` + +Running the above example will allocate two 1kb buffers internally. +Each 1kb buffer can hold information about 8192 bits so the first one will be used to store information about the first two bits and the second will be used to store the 1.000.000.000.000th bit. + +## API + +#### `var bits = bitfield([options])` + +Create a new bitfield. Options include + +``` js +{ + pageSize: 1024, // how big should the partial buffers be + buffer: anExistingBitfield, + trackUpdates: false // track when pages are being updated in the pager +} +``` + +#### `bits.set(index, value)` + +Set a bit to true or false. + +#### `bits.get(index)` + +Get the value of a bit. + +#### `bits.pages` + +A [memory-pager](https://github.com/mafintosh/memory-pager) instance that is managing the underlying memory. +If you set `trackUpdates` to true in the constructor you can use `.lastUpdate()` on this instance to get the last updated memory page. + +#### `var buffer = bits.toBuffer()` + +Get a single buffer representing the entire bitfield. + +## License + +MIT diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.js b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.js new file mode 100644 index 00000000..ff458c97 --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.js @@ -0,0 +1,95 @@ +var pager = require('memory-pager') + +module.exports = Bitfield + +function Bitfield (opts) { + if (!(this instanceof Bitfield)) return new Bitfield(opts) + if (!opts) opts = {} + if (Buffer.isBuffer(opts)) opts = {buffer: opts} + + this.pageOffset = opts.pageOffset || 0 + this.pageSize = opts.pageSize || 1024 + this.pages = opts.pages || pager(this.pageSize) + + this.byteLength = this.pages.length * this.pageSize + this.length = 8 * this.byteLength + + if (!powerOfTwo(this.pageSize)) throw new Error('The page size should be a power of two') + + this._trackUpdates = !!opts.trackUpdates + this._pageMask = this.pageSize - 1 + + if (opts.buffer) { + for (var i = 0; i < opts.buffer.length; i += this.pageSize) { + this.pages.set(i / this.pageSize, opts.buffer.slice(i, i + this.pageSize)) + } + this.byteLength = opts.buffer.length + this.length = 8 * this.byteLength + } +} + +Bitfield.prototype.get = function (i) { + var o = i & 7 + var j = (i - o) / 8 + + return !!(this.getByte(j) & (128 >> o)) +} + +Bitfield.prototype.getByte = function (i) { + var o = i & this._pageMask + var j = (i - o) / this.pageSize + var page = this.pages.get(j, true) + + return page ? page.buffer[o + this.pageOffset] : 0 +} + +Bitfield.prototype.set = function (i, v) { + var o = i & 7 + var j = (i - o) / 8 + var b = this.getByte(j) + + return this.setByte(j, v ? b | (128 >> o) : b & (255 ^ (128 >> o))) +} + +Bitfield.prototype.toBuffer = function () { + var all = alloc(this.pages.length * this.pageSize) + + for (var i = 0; i < this.pages.length; i++) { + var next = this.pages.get(i, true) + var allOffset = i * this.pageSize + if (next) next.buffer.copy(all, allOffset, this.pageOffset, this.pageOffset + this.pageSize) + } + + return all +} + +Bitfield.prototype.setByte = function (i, b) { + var o = i & this._pageMask + var j = (i - o) / this.pageSize + var page = this.pages.get(j, false) + + o += this.pageOffset + + if (page.buffer[o] === b) return false + page.buffer[o] = b + + if (i >= this.byteLength) { + this.byteLength = i + 1 + this.length = this.byteLength * 8 + } + + if (this._trackUpdates) this.pages.updated(page) + + return true +} + +function alloc (n) { + if (Buffer.alloc) return Buffer.alloc(n) + var b = new Buffer(n) + b.fill(0) + return b +} + +function powerOfTwo (x) { + return !(x & (x - 1)) +} diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/package.json b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/package.json new file mode 100644 index 00000000..092a23f6 --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/package.json @@ -0,0 +1,27 @@ +{ + "name": "sparse-bitfield", + "version": "3.0.3", + "description": "Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer", + "main": "index.js", + "dependencies": { + "memory-pager": "^1.0.2" + }, + "devDependencies": { + "buffer-alloc": "^1.1.0", + "standard": "^9.0.0", + "tape": "^4.6.3" + }, + "scripts": { + "test": "standard && tape test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/mafintosh/sparse-bitfield.git" + }, + "author": "Mathias Buus (@mafintosh)", + "license": "MIT", + "bugs": { + "url": "https://github.com/mafintosh/sparse-bitfield/issues" + }, + "homepage": "https://github.com/mafintosh/sparse-bitfield" +} diff --git a/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/test.js b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/test.js new file mode 100644 index 00000000..ae42ef46 --- /dev/null +++ b/backend/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/test.js @@ -0,0 +1,79 @@ +var alloc = require('buffer-alloc') +var tape = require('tape') +var bitfield = require('./') + +tape('set and get', function (t) { + var bits = bitfield() + + t.same(bits.get(0), false, 'first bit is false') + bits.set(0, true) + t.same(bits.get(0), true, 'first bit is true') + t.same(bits.get(1), false, 'second bit is false') + bits.set(0, false) + t.same(bits.get(0), false, 'first bit is reset') + t.end() +}) + +tape('set large and get', function (t) { + var bits = bitfield() + + t.same(bits.get(9999999999999), false, 'large bit is false') + bits.set(9999999999999, true) + t.same(bits.get(9999999999999), true, 'large bit is true') + t.same(bits.get(9999999999999 + 1), false, 'large bit + 1 is false') + bits.set(9999999999999, false) + t.same(bits.get(9999999999999), false, 'large bit is reset') + t.end() +}) + +tape('get and set buffer', function (t) { + var bits = bitfield({trackUpdates: true}) + + t.same(bits.pages.get(0, true), undefined) + t.same(bits.pages.get(Math.floor(9999999999999 / 8 / 1024), true), undefined) + bits.set(9999999999999, true) + + var bits2 = bitfield() + var upd = bits.pages.lastUpdate() + bits2.pages.set(Math.floor(upd.offset / 1024), upd.buffer) + t.same(bits2.get(9999999999999), true, 'bit is set') + t.end() +}) + +tape('toBuffer', function (t) { + var bits = bitfield() + + t.same(bits.toBuffer(), alloc(0)) + + bits.set(0, true) + + t.same(bits.toBuffer(), bits.pages.get(0).buffer) + + bits.set(9000, true) + + t.same(bits.toBuffer(), Buffer.concat([bits.pages.get(0).buffer, bits.pages.get(1).buffer])) + t.end() +}) + +tape('pass in buffer', function (t) { + var bits = bitfield() + + bits.set(0, true) + bits.set(9000, true) + + var clone = bitfield(bits.toBuffer()) + + t.same(clone.get(0), true) + t.same(clone.get(9000), true) + t.end() +}) + +tape('set small buffer', function (t) { + var buf = alloc(1) + buf[0] = 255 + var bits = bitfield(buf) + + t.same(bits.get(0), true) + t.same(bits.pages.get(0).buffer.length, bits.pageSize) + t.end() +}) diff --git a/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/HISTORY.md b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/HISTORY.md new file mode 100644 index 00000000..dc549b82 --- /dev/null +++ b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/HISTORY.md @@ -0,0 +1,87 @@ +2.0.2 / 2025-06-06 +================== + + * Migrate to `String.prototype.slice()` + +2.0.1 / 2021-01-03 +================== + + * Fix returning values from `Object.prototype` + +2.0.0 / 2020-04-19 +================== + + * Drop support for Node.js 0.6 + * Fix messaging casing of `418 I'm a Teapot` + * Remove code 306 + * Remove `status[code]` exports; use `status.message[code]` + * Remove `status[msg]` exports; use `status.code[msg]` + * Rename `425 Unordered Collection` to standard `425 Too Early` + * Rename `STATUS_CODES` export to `message` + * Return status message for `statuses(code)` when given code + +1.5.0 / 2018-03-27 +================== + + * Add `103 Early Hints` + +1.4.0 / 2017-10-20 +================== + + * Add `STATUS_CODES` export + +1.3.1 / 2016-11-11 +================== + + * Fix return type in JSDoc + +1.3.0 / 2016-05-17 +================== + + * Add `421 Misdirected Request` + * perf: enable strict mode + +1.2.1 / 2015-02-01 +================== + + * Fix message for status 451 + - `451 Unavailable For Legal Reasons` + +1.2.0 / 2014-09-28 +================== + + * Add `208 Already Repored` + * Add `226 IM Used` + * Add `306 (Unused)` + * Add `415 Unable For Legal Reasons` + * Add `508 Loop Detected` + +1.1.1 / 2014-09-24 +================== + + * Add missing 308 to `codes.json` + +1.1.0 / 2014-09-21 +================== + + * Add `codes.json` for universal support + +1.0.4 / 2014-08-20 +================== + + * Package cleanup + +1.0.3 / 2014-06-08 +================== + + * Add 308 to `.redirect` category + +1.0.2 / 2014-03-13 +================== + + * Add `.retry` category + +1.0.1 / 2014-03-12 +================== + + * Initial release diff --git a/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/LICENSE b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/LICENSE new file mode 100644 index 00000000..28a31618 --- /dev/null +++ b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/README.md b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/README.md new file mode 100644 index 00000000..89d542f6 --- /dev/null +++ b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/README.md @@ -0,0 +1,139 @@ +# statuses + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +HTTP status utility for node. + +This module provides a list of status codes and messages sourced from +a few different projects: + + * The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) + * The [Node.js project](https://nodejs.org/) + * The [NGINX project](https://www.nginx.com/) + * The [Apache HTTP Server project](https://httpd.apache.org/) + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install statuses +``` + +## API + + + +```js +var status = require('statuses') +``` + +### status(code) + +Returns the status message string for a known HTTP status code. The code +may be a number or a string. An error is thrown for an unknown status code. + + + +```js +status(403) // => 'Forbidden' +status('403') // => 'Forbidden' +status(306) // throws +``` + +### status(msg) + +Returns the numeric status code for a known HTTP status message. The message +is case-insensitive. An error is thrown for an unknown status message. + + + +```js +status('forbidden') // => 403 +status('Forbidden') // => 403 +status('foo') // throws +``` + +### status.codes + +Returns an array of all the status codes as `Integer`s. + +### status.code[msg] + +Returns the numeric status code for a known status message (in lower-case), +otherwise `undefined`. + + + +```js +status['not found'] // => 404 +``` + +### status.empty[code] + +Returns `true` if a status code expects an empty body. + + + +```js +status.empty[200] // => undefined +status.empty[204] // => true +status.empty[304] // => true +``` + +### status.message[code] + +Returns the string message for a known numeric status code, otherwise +`undefined`. This object is the same format as the +[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes). + + + +```js +status.message[404] // => 'Not Found' +``` + +### status.redirect[code] + +Returns `true` if a status code is a valid redirect status. + + + +```js +status.redirect[200] // => undefined +status.redirect[301] // => true +``` + +### status.retry[code] + +Returns `true` if you should retry the rest. + + + +```js +status.retry[501] // => undefined +status.retry[503] // => true +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci +[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master +[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master +[node-version-image]: https://badgen.net/npm/node/statuses +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/statuses +[npm-url]: https://npmjs.org/package/statuses +[npm-version-image]: https://badgen.net/npm/v/statuses +[ossf-scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/jshttp/statuses/badge +[ossf-scorecard-visualizer]: https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/jshttp/statuses diff --git a/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/codes.json b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/codes.json new file mode 100644 index 00000000..1333ed10 --- /dev/null +++ b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/codes.json @@ -0,0 +1,65 @@ +{ + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "103": "Early Hints", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a Teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Too Early", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" +} diff --git a/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js new file mode 100644 index 00000000..ea351c55 --- /dev/null +++ b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js @@ -0,0 +1,146 @@ +/*! + * statuses + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var codes = require('./codes.json') + +/** + * Module exports. + * @public + */ + +module.exports = status + +// status code to message map +status.message = codes + +// status message (lower-case) to code map +status.code = createMessageToStatusCodeMap(codes) + +// array of status codes +status.codes = createStatusCodeList(codes) + +// status codes for redirects +status.redirect = { + 300: true, + 301: true, + 302: true, + 303: true, + 305: true, + 307: true, + 308: true +} + +// status codes for empty bodies +status.empty = { + 204: true, + 205: true, + 304: true +} + +// status codes for when you should retry the request +status.retry = { + 502: true, + 503: true, + 504: true +} + +/** + * Create a map of message to status code. + * @private + */ + +function createMessageToStatusCodeMap (codes) { + var map = {} + + Object.keys(codes).forEach(function forEachCode (code) { + var message = codes[code] + var status = Number(code) + + // populate map + map[message.toLowerCase()] = status + }) + + return map +} + +/** + * Create a list of all status codes. + * @private + */ + +function createStatusCodeList (codes) { + return Object.keys(codes).map(function mapCode (code) { + return Number(code) + }) +} + +/** + * Get the status code for given message. + * @private + */ + +function getStatusCode (message) { + var msg = message.toLowerCase() + + if (!Object.prototype.hasOwnProperty.call(status.code, msg)) { + throw new Error('invalid status message: "' + message + '"') + } + + return status.code[msg] +} + +/** + * Get the status message for given code. + * @private + */ + +function getStatusMessage (code) { + if (!Object.prototype.hasOwnProperty.call(status.message, code)) { + throw new Error('invalid status code: ' + code) + } + + return status.message[code] +} + +/** + * Get the status code. + * + * Given a number, this will throw if it is not a known status + * code, otherwise the code will be returned. Given a string, + * the string will be parsed for a number and return the code + * if valid, otherwise will lookup the code assuming this is + * the status message. + * + * @param {string|number} code + * @returns {number} + * @public + */ + +function status (code) { + if (typeof code === 'number') { + return getStatusMessage(code) + } + + if (typeof code !== 'string') { + throw new TypeError('code must be a number or string') + } + + // '403' + var n = parseInt(code, 10) + if (!isNaN(n)) { + return getStatusMessage(n) + } + + return getStatusCode(code) +} diff --git a/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/package.json b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/package.json new file mode 100644 index 00000000..b5d016ed --- /dev/null +++ b/backend/node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/package.json @@ -0,0 +1,49 @@ +{ + "name": "statuses", + "description": "HTTP status utility", + "version": "2.0.2", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "repository": "jshttp/statuses", + "license": "MIT", + "keywords": [ + "http", + "status", + "code" + ], + "files": [ + "HISTORY.md", + "index.js", + "codes.json", + "LICENSE" + ], + "devDependencies": { + "csv-parse": "4.16.3", + "eslint": "7.19.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-markdown": "1.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "8.4.0", + "nyc": "15.1.0", + "raw-body": "2.5.2", + "stream-to-array": "2.3.0" + }, + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "build": "node scripts/build.js", + "fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/isarray b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/isarray new file mode 120000 index 00000000..453962fd --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/isarray @@ -0,0 +1 @@ +../../isarray@2.0.5/node_modules/isarray \ No newline at end of file diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/safe-buffer b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/safe-buffer new file mode 120000 index 00000000..561a6c64 --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/safe-buffer @@ -0,0 +1 @@ +../../safe-buffer@5.2.1/node_modules/safe-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/.github/FUNDING.yml b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/.github/FUNDING.yml new file mode 100644 index 00000000..4a0079cb --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb, mafintosh] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/to-buffer +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/CHANGELOG.md b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/CHANGELOG.md new file mode 100644 index 00000000..71a18729 --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/CHANGELOG.md @@ -0,0 +1,81 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.2.2](https://github.com/browserify/to-buffer/compare/v1.2.1...v1.2.2) - 2025-09-24 + +### Commits + +- [Fix] handle SlowBuffers in node 0.10 [`ca20eaa`](https://github.com/browserify/to-buffer/commit/ca20eaad8c9cbd6e3e6e99880b2b1c95abe62566) +- [Refactor] use `SafeBuffer.isBuffer` instead of `instanceof` [`81283c1`](https://github.com/browserify/to-buffer/commit/81283c14b585c0e921e04f327381e975cc8561bb) +- [Dev Deps] update `@ljharb/eslint-config` [`c7bc986`](https://github.com/browserify/to-buffer/commit/c7bc986d378ce4bdf2dac75612b45b0f618f26d6) +- [meta] since tests are npmignored, also npmignore test config files [`866639c`](https://github.com/browserify/to-buffer/commit/866639cf294799f8c0397153e5876ae1e6992a57) + +## [v1.2.1](https://github.com/browserify/to-buffer/compare/v1.2.0...v1.2.1) - 2025-06-19 + +### Commits + +- [Fix] handle non-Uint8Arrays in node < 3 [`7f8a881`](https://github.com/browserify/to-buffer/commit/7f8a881929133935f8e15ffd60d6dbbc513b2c5f) +- [Tests] add coverage [`286c96a`](https://github.com/browserify/to-buffer/commit/286c96a52cfeee14a2ba974d78071bdd667e9360) +- [Fix] provide a fallback for engines without `ArrayBuffer.isView` [`e336166`](https://github.com/browserify/to-buffer/commit/e336166b8f4bf13860bafa191ee1ec53fca2e331) +- [Fix] correct error message [`b45247e`](https://github.com/browserify/to-buffer/commit/b45247ed337fb44b2c8d74a14e8f86d985119fb9) + +## [v1.2.0](https://github.com/browserify/to-buffer/compare/v1.1.1...v1.2.0) - 2025-06-17 + +### Commits + +- [New] replace with implementation from cipher-base [`970adb5`](https://github.com/browserify/to-buffer/commit/970adb5523efdaa13f5ecb82967fc9f617865549) +- [Tests] migrate from travis to GHA [`8084393`](https://github.com/browserify/to-buffer/commit/808439337ca9ac3dbb8399079aaa2a4cb738627c) +- [eslint] fix whitespace [`a62e651`](https://github.com/browserify/to-buffer/commit/a62e651b661adf98c17e9e486b55bb8ff0ffb8c9) +- [eslint] fix semicolon usage [`4d85c63`](https://github.com/browserify/to-buffer/commit/4d85c6318c72feae8d19037937154f9b99ba266f) +- [meta] add `auto-changelog` [`aa0279c`](https://github.com/browserify/to-buffer/commit/aa0279c5199ca7fe39acfb950a4c824e97f06232) +- [readme] update URLs, add badges [`ff77d90`](https://github.com/browserify/to-buffer/commit/ff77d90b89de7b02538ecb2d6a89da086093bed8) +- [lint] switch to eslint [`e45f467`](https://github.com/browserify/to-buffer/commit/e45f467c7229e632cd3c10fc02895ba4d3204bbe) +- [Fix] validate that arrays contain valid byte values [`c2fb75e`](https://github.com/browserify/to-buffer/commit/c2fb75edf2fb113d58599e990f86574b4dfa62d8) +- [Fix] restore previous implementation Array behavior [`cb93b75`](https://github.com/browserify/to-buffer/commit/cb93b75a79caa9897f6c29ecde91f4ae35f704fe) +- [Tests] add nyc for coverage [`ab7026e`](https://github.com/browserify/to-buffer/commit/ab7026e36e3716c8101229f426e7f4571e55794b) +- [Refactor] use `safe-buffer`.from instead of `buffer-from` [`8e01307`](https://github.com/browserify/to-buffer/commit/8e01307191245044469e47695c5c2675b85e84e9) +- [Fix] Replace Buffer.from with `buffer-from` [`d652e54`](https://github.com/browserify/to-buffer/commit/d652e54e2396a47358a553c447e0f338b4c2dc67) +- [Tests] use `deepEqual` over `same` alias [`66a5548`](https://github.com/browserify/to-buffer/commit/66a55480258011bb5d81c5aad1360468f418d0b4) +- [meta] add `npmignore` [`90ce602`](https://github.com/browserify/to-buffer/commit/90ce6023737d50521aff44d87063db1e3f7e352a) +- [Tests] move into a test dir, update tape [`08aea81`](https://github.com/browserify/to-buffer/commit/08aea81b61b90d1fcb7e9275b5b0ba718531d9a8) +- Only apps should have lockfiles [`16ccceb`](https://github.com/browserify/to-buffer/commit/16ccceb23f350be16e80111188c90a3492916f5d) +- [Tests] add coverage [`d2cba2e`](https://github.com/browserify/to-buffer/commit/d2cba2ec76ed43c83e2a7a91f58fa7640aeb61e9) +- [meta] update description [`2cf2a20`](https://github.com/browserify/to-buffer/commit/2cf2a200a31f9543d2e8a24b5ea0e8bd843166c3) +- [Fix] add `safe-buffer`, missing from 970adb5 [`d9a0dea`](https://github.com/browserify/to-buffer/commit/d9a0dead7c638d188f8b48cdf2b5fd6cfa886071) +- [meta] temporarily limit support to node v0.10 [`8dca458`](https://github.com/browserify/to-buffer/commit/8dca458bd9a2c6b84d6e3a1996e41b242fe1c49a) +- [meta] add missing `engines.node` [`35bdfcb`](https://github.com/browserify/to-buffer/commit/35bdfcb3a71dfbd5b35d35250c9dac19c99f4197) +- [Dev Deps] add missing peer dep [`220143f`](https://github.com/browserify/to-buffer/commit/220143f1f6e47154380c27a2d88ce300104007fa) +- [meta] add `sideEffects` flag [`cd37473`](https://github.com/browserify/to-buffer/commit/cd374738d24b22b029862b3c27b9e247d4e62daf) + +## [v1.1.1](https://github.com/browserify/to-buffer/compare/v1.1.0...v1.1.1) - 2018-04-26 + +### Commits + +- use Buffer.from when avail [`eebe20e`](https://github.com/browserify/to-buffer/commit/eebe20e0603e2c6a542b00316f1661741fdf1124) + +## [v1.1.0](https://github.com/browserify/to-buffer/compare/v1.0.1...v1.1.0) - 2017-04-12 + +### Merged + +- Fix typo [`#2`](https://github.com/browserify/to-buffer/pull/2) + +### Commits + +- support arrays as well [`ef98c82`](https://github.com/browserify/to-buffer/commit/ef98c82791d71601077577e84c4614ec2d05f086) + +## [v1.0.1](https://github.com/browserify/to-buffer/compare/v1.0.0...v1.0.1) - 2016-02-15 + +### Commits + +- fix desc [`7d50a7c`](https://github.com/browserify/to-buffer/commit/7d50a7c69c3eef77448893744ada16601c44af6a) + +## v1.0.0 - 2016-02-15 + +### Commits + +- first commit [`8361941`](https://github.com/browserify/to-buffer/commit/8361941d7acb3b82c732ecd10bdb047da5af2028) +- add travis [`de911b5`](https://github.com/browserify/to-buffer/commit/de911b5364558561d84b4ec9e43c6a0fe1c8e904) diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/LICENSE b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/LICENSE new file mode 100644 index 00000000..bae9da7b --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/README.md b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/README.md new file mode 100644 index 00000000..c7ff8bf9 --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/README.md @@ -0,0 +1,44 @@ +# to-buffer [![Version Badge][2]][1] + +Pass in a string, array, Buffer, Data View, or Uint8Array, and get a Buffer back. + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + + +``` +npm install to-buffer +``` + +## Usage + +``` js +var toBuffer = require('to-buffer'); + +console.log(toBuffer('hi')); // +console.log(toBuffer(Buffer('hi'))); // +console.log(toBuffer('6869', 'hex')); // +console.log(toBuffer(43)); // throws +``` + +[1]: https://npmjs.org/package/to-buffer +[2]: https://versionbadg.es/browserify/to-buffer.svg +[5]: https://david-dm.org/browserify/to-buffer.svg +[6]: https://david-dm.org/browserify/to-buffer +[7]: https://david-dm.org/browserify/to-buffer/dev-status.svg +[8]: https://david-dm.org/browserify/to-buffer#info=devDependencies +[11]: https://nodei.co/npm/to-buffer.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/to-buffer.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/to-buffer.svg +[downloads-url]: https://npm-stat.com/charts.html?package=to-buffer +[codecov-image]: https://codecov.io/gh/browserify/to-buffer/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/browserify/to-buffer/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/to-buffer +[actions-url]: https://github.com/browserify/to-buffer/actions diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/index.js b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/index.js new file mode 100644 index 00000000..c4a348ce --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/index.js @@ -0,0 +1,109 @@ +'use strict'; + +var Buffer = require('safe-buffer').Buffer; +var isArray = require('isarray'); +var typedArrayBuffer = require('typed-array-buffer'); + +var isView = ArrayBuffer.isView || function isView(obj) { + try { + typedArrayBuffer(obj); + return true; + } catch (e) { + return false; + } +}; + +var useUint8Array = typeof Uint8Array !== 'undefined'; +var useArrayBuffer = typeof ArrayBuffer !== 'undefined' + && typeof Uint8Array !== 'undefined'; +var useFromArrayBuffer = useArrayBuffer && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT); + +module.exports = function toBuffer(data, encoding) { + if (Buffer.isBuffer(data)) { + if (data.constructor && !('isBuffer' in data)) { + // probably a SlowBuffer + return Buffer.from(data); + } + return data; + } + + if (typeof data === 'string') { + return Buffer.from(data, encoding); + } + + /* + * Wrap any TypedArray instances and DataViews + * Makes sense only on engines with full TypedArray support -- let Buffer detect that + */ + if (useArrayBuffer && isView(data)) { + // Bug in Node.js <6.3.1, which treats this as out-of-bounds + if (data.byteLength === 0) { + return Buffer.alloc(0); + } + + // When Buffer is based on Uint8Array, we can just construct it from ArrayBuffer + if (useFromArrayBuffer) { + var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + /* + * Recheck result size, as offset/length doesn't work on Node.js <5.10 + * We just go to Uint8Array case if this fails + */ + if (res.byteLength === data.byteLength) { + return res; + } + } + + // Convert to Uint8Array bytes and then to Buffer + var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength); + var result = Buffer.from(uint8); + + /* + * Let's recheck that conversion succeeded + * We have .length but not .byteLength when useFromArrayBuffer is false + */ + if (result.length === data.byteLength) { + return result; + } + } + + /* + * Uint8Array in engines where Buffer.from might not work with ArrayBuffer, just copy over + * Doesn't make sense with other TypedArray instances + */ + if (useUint8Array && data instanceof Uint8Array) { + return Buffer.from(data); + } + + var isArr = isArray(data); + if (isArr) { + for (var i = 0; i < data.length; i += 1) { + var x = data[i]; + if ( + typeof x !== 'number' + || x < 0 + || x > 255 + || ~~x !== x // NaN and integer check + ) { + throw new RangeError('Array items must be numbers in the range 0-255.'); + } + } + } + + /* + * Old Buffer polyfill on an engine that doesn't have TypedArray support + * Also, this is from a different Buffer polyfill implementation then we have, as instanceof check failed + * Convert to our current Buffer implementation + */ + if ( + isArr || ( + Buffer.isBuffer(data) + && data.constructor + && typeof data.constructor.isBuffer === 'function' + && data.constructor.isBuffer(data) + ) + ) { + return Buffer.from(data); + } + + throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.'); +}; diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/package.json b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/package.json new file mode 100644 index 00000000..55847c80 --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/package.json @@ -0,0 +1,62 @@ +{ + "name": "to-buffer", + "version": "1.2.2", + "description": "Pass in a string, array, Buffer, Data View, or Uint8Array, and get a Buffer back.", + "main": "index.js", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "lint": "eslint --ext=js,mjs .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*'", + "test": "npm run tests-only", + "posttest": "npx npm@\">= 10.2\" audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "https://github.com/browserify/to-buffer.git" + }, + "author": "Mathias Buus (@mafintosh)", + "license": "MIT", + "bugs": { + "url": "https://github.com/browserify/to-buffer/issues" + }, + "homepage": "https://github.com/browserify/to-buffer", + "dependencies": { + "isarray": "^2.0.5", + "safe-buffer": "^5.2.1", + "typed-array-buffer": "^1.0.3" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.2.0", + "auto-changelog": "^2.5.0", + "available-typed-arrays": "^1.0.7", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "for-each": "^0.3.5", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "tape": "^5.9.0" + }, + "engines": { + "node": ">= 0.4" + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + ".eslintrc", + ".nycrc", + "test" + ] + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + } +} diff --git a/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/typed-array-buffer b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/typed-array-buffer new file mode 120000 index 00000000..c3821e8b --- /dev/null +++ b/backend/node_modules/.pnpm/to-buffer@1.2.2/node_modules/typed-array-buffer @@ -0,0 +1 @@ +../../typed-array-buffer@1.0.3/node_modules/typed-array-buffer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/HISTORY.md b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/HISTORY.md new file mode 100644 index 00000000..cb7cc892 --- /dev/null +++ b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/HISTORY.md @@ -0,0 +1,9 @@ +1.0.1 / 2021-11-14 +================== + + * pref: enable strict mode + +1.0.0 / 2018-07-09 +================== + + * Initial release diff --git a/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/LICENSE b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/LICENSE new file mode 100644 index 00000000..de22d159 --- /dev/null +++ b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/README.md b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/README.md new file mode 100644 index 00000000..57e8a78a --- /dev/null +++ b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/README.md @@ -0,0 +1,61 @@ +# toidentifier + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][codecov-image]][codecov-url] + +> Convert a string of words to a JavaScript identifier + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install toidentifier +``` + +## Example + +```js +var toIdentifier = require('toidentifier') + +console.log(toIdentifier('Bad Request')) +// => "BadRequest" +``` + +## API + +This CommonJS module exports a single default function: `toIdentifier`. + +### toIdentifier(string) + +Given a string as the argument, it will be transformed according to +the following rules and the new string will be returned: + +1. Split into words separated by space characters (`0x20`). +2. Upper case the first character of each word. +3. Join the words together with no separator. +4. Remove all non-word (`[0-9a-z_]`) characters. + +## License + +[MIT](LICENSE) + +[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg +[codecov-url]: https://codecov.io/gh/component/toidentifier +[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg +[downloads-url]: https://npmjs.org/package/toidentifier +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci +[github-actions-ci-url]: https://github.com/component/toidentifier?query=workflow%3Aci +[npm-image]: https://img.shields.io/npm/v/toidentifier.svg +[npm-url]: https://npmjs.org/package/toidentifier + + +## + +[npm]: https://www.npmjs.com/ + +[yarn]: https://yarnpkg.com/ diff --git a/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/index.js b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/index.js new file mode 100644 index 00000000..9295d024 --- /dev/null +++ b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/index.js @@ -0,0 +1,32 @@ +/*! + * toidentifier + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = toIdentifier + +/** + * Trasform the given string into a JavaScript identifier + * + * @param {string} str + * @returns {string} + * @public + */ + +function toIdentifier (str) { + return str + .split(' ') + .map(function (token) { + return token.slice(0, 1).toUpperCase() + token.slice(1) + }) + .join('') + .replace(/[^ _0-9a-z]/gi, '') +} diff --git a/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/package.json b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/package.json new file mode 100644 index 00000000..42db1a66 --- /dev/null +++ b/backend/node_modules/.pnpm/toidentifier@1.0.1/node_modules/toidentifier/package.json @@ -0,0 +1,38 @@ +{ + "name": "toidentifier", + "description": "Convert a string of words to a JavaScript identifier", + "version": "1.0.1", + "author": "Douglas Christopher Wilson ", + "contributors": [ + "Douglas Christopher Wilson ", + "Nick Baugh (http://niftylettuce.com/)" + ], + "repository": "component/toidentifier", + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.3", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "license": "MIT", + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/punycode b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/punycode new file mode 120000 index 00000000..d07a3a17 --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/punycode @@ -0,0 +1 @@ +../../punycode@2.3.1/node_modules/punycode \ No newline at end of file diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/LICENSE.md b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/LICENSE.md new file mode 100644 index 00000000..62c0de28 --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sebastian Mayr + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/README.md b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/README.md new file mode 100644 index 00000000..7bd9ffda --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/README.md @@ -0,0 +1,76 @@ +# tr46 + +An JavaScript implementation of [Unicode Technical Standard #46: Unicode IDNA Compatibility Processing](https://unicode.org/reports/tr46/). + +## API + +### `toASCII(domainName[, options])` + +Converts a string of Unicode symbols to a case-folded Punycode string of ASCII symbols. + +Available options: + +* [`checkBidi`](#checkbidi) +* [`checkHyphens`](#checkhyphens) +* [`checkJoiners`](#checkjoiners) +* [`ignoreInvalidPunycode`](#ignoreinvalidpunycode) +* [`transitionalProcessing`](#transitionalprocessing) +* [`useSTD3ASCIIRules`](#usestd3asciirules) +* [`verifyDNSLength`](#verifydnslength) + +### `toUnicode(domainName[, options])` + +Converts a case-folded Punycode string of ASCII symbols to a string of Unicode symbols. + +Available options: + +* [`checkBidi`](#checkbidi) +* [`checkHyphens`](#checkhyphens) +* [`checkJoiners`](#checkjoiners) +* [`ignoreInvalidPunycode`](#ignoreinvalidpunycode) +* [`transitionalProcessing`](#transitionalprocessing) +* [`useSTD3ASCIIRules`](#usestd3asciirules) + +## Options + +### `checkBidi` + +Type: `boolean` +Default value: `false` +When set to `true`, any bi-directional text within the input will be checked for validation. + +### `checkHyphens` + +Type: `boolean` +Default value: `false` +When set to `true`, the positions of any hyphen characters within the input will be checked for validation. + +### `checkJoiners` + +Type: `boolean` +Default value: `false` +When set to `true`, any word joiner characters within the input will be checked for validation. + +### `ignoreInvalidPunycode` + +Type: `boolean` +Default value: `false` +When set to `true`, invalid Punycode strings within the input will be allowed. + +### `transitionalProcessing` + +Type: `boolean` +Default value: `false` +When set to `true`, uses [transitional (compatibility) processing](https://unicode.org/reports/tr46/#Compatibility_Processing) of the deviation characters. + +### `useSTD3ASCIIRules` + +Type: `boolean` +Default value: `false` +When set to `true`, input will be validated according to [STD3 Rules](http://unicode.org/reports/tr46/#STD3_Rules). + +### `verifyDNSLength` + +Type: `boolean` +Default value: `false` +When set to `true`, the length of each DNS label within the input will be checked for validation. diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.js b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.js new file mode 100644 index 00000000..9e53f058 --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.js @@ -0,0 +1,344 @@ +"use strict"; + +const punycode = require("punycode/"); +const regexes = require("./lib/regexes.js"); +const mappingTable = require("./lib/mappingTable.json"); +const { STATUS_MAPPING } = require("./lib/statusMapping.js"); + +function containsNonASCII(str) { + return /[^\x00-\x7F]/u.test(str); +} + +function findStatus(val) { + let start = 0; + let end = mappingTable.length - 1; + + while (start <= end) { + const mid = Math.floor((start + end) / 2); + + const target = mappingTable[mid]; + const min = Array.isArray(target[0]) ? target[0][0] : target[0]; + const max = Array.isArray(target[0]) ? target[0][1] : target[0]; + + if (min <= val && max >= val) { + return target.slice(1); + } else if (min > val) { + end = mid - 1; + } else { + start = mid + 1; + } + } + + return null; +} + +function mapChars(domainName, { transitionalProcessing }) { + let processed = ""; + + for (const ch of domainName) { + const [status, mapping] = findStatus(ch.codePointAt(0)); + + switch (status) { + case STATUS_MAPPING.disallowed: + processed += ch; + break; + case STATUS_MAPPING.ignored: + break; + case STATUS_MAPPING.mapped: + if (transitionalProcessing && ch === "ẞ") { + processed += "ss"; + } else { + processed += mapping; + } + break; + case STATUS_MAPPING.deviation: + if (transitionalProcessing) { + processed += mapping; + } else { + processed += ch; + } + break; + case STATUS_MAPPING.valid: + processed += ch; + break; + } + } + + return processed; +} + +function validateLabel(label, { + checkHyphens, + checkBidi, + checkJoiners, + transitionalProcessing, + useSTD3ASCIIRules, + isBidi +}) { + // "must be satisfied for a non-empty label" + if (label.length === 0) { + return true; + } + + // "1. The label must be in Unicode Normalization Form NFC." + if (label.normalize("NFC") !== label) { + return false; + } + + const codePoints = Array.from(label); + + // "2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character in both the + // third and fourth positions." + // + // "3. If CheckHyphens, the label must neither begin nor end with a U+002D HYPHEN-MINUS character." + if (checkHyphens) { + if ((codePoints[2] === "-" && codePoints[3] === "-") || + (label.startsWith("-") || label.endsWith("-"))) { + return false; + } + } + + // "4. If not CheckHyphens, the label must not begin with “xn--”." + if (!checkHyphens) { + if (label.startsWith("xn--")) { + return false; + } + } + + // "5. The label must not contain a U+002E ( . ) FULL STOP." + if (label.includes(".")) { + return false; + } + + // "6. The label must not begin with a combining mark, that is: General_Category=Mark." + if (regexes.combiningMarks.test(codePoints[0])) { + return false; + } + + // "7. Each code point in the label must only have certain Status values according to Section 5" + for (const ch of codePoints) { + const codePoint = ch.codePointAt(0); + const [status] = findStatus(codePoint); + if (transitionalProcessing) { + // "For Transitional Processing (deprecated), each value must be valid." + if (status !== STATUS_MAPPING.valid) { + return false; + } + } else if (status !== STATUS_MAPPING.valid && status !== STATUS_MAPPING.deviation) { + // "For Nontransitional Processing, each value must be either valid or deviation." + return false; + } + // "In addition, if UseSTD3ASCIIRules=true and the code point is an ASCII code point (U+0000..U+007F), then it must + // be a lowercase letter (a-z), a digit (0-9), or a hyphen-minus (U+002D). (Note: This excludes uppercase ASCII + // A-Z which are mapped in UTS #46 and disallowed in IDNA2008.)" + if (useSTD3ASCIIRules && codePoint <= 0x7F) { + if (!/^(?:[a-z]|[0-9]|-)$/u.test(ch)) { + return false; + } + } + } + + // "8. If CheckJoiners, the label must satisify the ContextJ rules" + // https://tools.ietf.org/html/rfc5892#appendix-A + if (checkJoiners) { + let last = 0; + for (const [i, ch] of codePoints.entries()) { + if (ch === "\u200C" || ch === "\u200D") { + if (i > 0) { + if (regexes.combiningClassVirama.test(codePoints[i - 1])) { + continue; + } + if (ch === "\u200C") { + // TODO: make this more efficient + const next = codePoints.indexOf("\u200C", i + 1); + const test = next < 0 ? codePoints.slice(last) : codePoints.slice(last, next); + if (regexes.validZWNJ.test(test.join(""))) { + last = i + 1; + continue; + } + } + } + return false; + } + } + } + + // "9. If CheckBidi, and if the domain name is a Bidi domain name, then the label must satisfy..." + // https://tools.ietf.org/html/rfc5893#section-2 + if (checkBidi && isBidi) { + let rtl; + + // 1 + if (regexes.bidiS1LTR.test(codePoints[0])) { + rtl = false; + } else if (regexes.bidiS1RTL.test(codePoints[0])) { + rtl = true; + } else { + return false; + } + + if (rtl) { + // 2-4 + if (!regexes.bidiS2.test(label) || + !regexes.bidiS3.test(label) || + (regexes.bidiS4EN.test(label) && regexes.bidiS4AN.test(label))) { + return false; + } + } else if (!regexes.bidiS5.test(label) || + !regexes.bidiS6.test(label)) { // 5-6 + return false; + } + } + + return true; +} + +function isBidiDomain(labels) { + const domain = labels.map(label => { + if (label.startsWith("xn--")) { + try { + return punycode.decode(label.substring(4)); + } catch { + return ""; + } + } + return label; + }).join("."); + return regexes.bidiDomain.test(domain); +} + +function processing(domainName, options) { + // 1. Map. + let string = mapChars(domainName, options); + + // 2. Normalize. + string = string.normalize("NFC"); + + // 3. Break. + const labels = string.split("."); + const isBidi = isBidiDomain(labels); + + // 4. Convert/Validate. + let error = false; + for (const [i, origLabel] of labels.entries()) { + let label = origLabel; + let transitionalProcessingForThisLabel = options.transitionalProcessing; + if (label.startsWith("xn--")) { + if (containsNonASCII(label)) { + error = true; + continue; + } + + try { + label = punycode.decode(label.substring(4)); + } catch { + if (!options.ignoreInvalidPunycode) { + error = true; + continue; + } + } + labels[i] = label; + + if (label === "" || !containsNonASCII(label)) { + error = true; + } + + transitionalProcessingForThisLabel = false; + } + + // No need to validate if we already know there is an error. + if (error) { + continue; + } + const validation = validateLabel(label, { + ...options, + transitionalProcessing: transitionalProcessingForThisLabel, + isBidi + }); + if (!validation) { + error = true; + } + } + + return { + string: labels.join("."), + error + }; +} + +function toASCII(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + verifyDNSLength = false, + transitionalProcessing = false, + ignoreInvalidPunycode = false +} = {}) { + const result = processing(domainName, { + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules, + transitionalProcessing, + ignoreInvalidPunycode + }); + let labels = result.string.split("."); + labels = labels.map(l => { + if (containsNonASCII(l)) { + try { + return `xn--${punycode.encode(l)}`; + } catch { + result.error = true; + } + } + return l; + }); + + if (verifyDNSLength) { + const total = labels.join(".").length; + if (total > 253 || total === 0) { + result.error = true; + } + + for (let i = 0; i < labels.length; ++i) { + if (labels[i].length > 63 || labels[i].length === 0) { + result.error = true; + break; + } + } + } + + if (result.error) { + return null; + } + return labels.join("."); +} + +function toUnicode(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + transitionalProcessing = false, + ignoreInvalidPunycode = false +} = {}) { + const result = processing(domainName, { + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules, + transitionalProcessing, + ignoreInvalidPunycode + }); + + return { + domain: result.string, + error: result.error + }; +} + +module.exports = { + toASCII, + toUnicode +}; diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.json b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.json new file mode 100644 index 00000000..30d29181 --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.json @@ -0,0 +1 @@ +[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"−"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"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[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,"\""],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69371],3],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118015],3],[[118016,118451],2],[[118452,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[[129674,129678],3],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[[129735,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[[129770,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]] \ No newline at end of file diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.js b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.js new file mode 100644 index 00000000..08cabf53 --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.js @@ -0,0 +1,29 @@ +"use strict"; + +const combiningMarks = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u; +const combiningClassVirama = /[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u; +const validZWNJ = /[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u; +const bidiDomain = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; +const bidiS1LTR = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB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u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-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u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u; +const bidiS1RTL = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; +const bidiS2 = /^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\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{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u; +const bidiS3 = /[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; +const bidiS4EN = /[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u; +const bidiS4AN = /[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u; +const bidiS5 = /^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-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-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u; +const bidiS6 = /[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0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E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-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}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; + +module.exports = { + combiningMarks, + combiningClassVirama, + validZWNJ, + bidiDomain, + bidiS1LTR, + bidiS1RTL, + bidiS2, + bidiS3, + bidiS4EN, + bidiS4AN, + bidiS5, + bidiS6 + }; diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.js b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.js new file mode 100644 index 00000000..e5399be4 --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports.STATUS_MAPPING = { + mapped: 1, + valid: 2, + disallowed: 3, + deviation: 6, + ignored: 7 +}; diff --git a/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/package.json b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/package.json new file mode 100644 index 00000000..bf5560a4 --- /dev/null +++ b/backend/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/package.json @@ -0,0 +1,44 @@ +{ + "name": "tr46", + "version": "5.1.1", + "engines": { + "node": ">=18" + }, + "description": "An implementation of the Unicode UTS #46: Unicode IDNA Compatibility Processing", + "main": "index.js", + "files": [ + "index.js", + "lib/" + ], + "scripts": { + "test": "node --test", + "lint": "eslint", + "pretest": "node scripts/getLatestTests.js", + "prepublish": "node scripts/generateMappingTable.js && node scripts/generateRegexes.js" + }, + "repository": "https://github.com/jsdom/tr46", + "keywords": [ + "unicode", + "tr46", + "uts46", + "punycode", + "url", + "whatwg" + ], + "author": "Sebastian Mayr ", + "contributors": [ + "Timothy Gu " + ], + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "devDependencies": { + "@domenic/eslint-config": "^4.0.1", + "@unicode/unicode-16.0.0": "^1.6.5", + "eslint": "^9.22.0", + "globals": "^16.0.0", + "regenerate": "^1.4.2" + }, + "unicodeVersion": "16.0.0" +} diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/CopyrightNotice.txt b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 00000000..0e425423 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/LICENSE.txt b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/LICENSE.txt new file mode 100644 index 00000000..bfe6430c --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/README.md b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/README.md new file mode 100644 index 00000000..290cc618 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/README.md @@ -0,0 +1,164 @@ +# tslib + +This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 3.9.2 or later +npm install tslib + +# TypeScript 3.8.4 or earlier +npm install tslib@^1 + +# TypeScript 2.3.2 or earlier +npm install tslib@1.6.1 +``` + +## yarn + +```sh +# TypeScript 3.9.2 or later +yarn add tslib + +# TypeScript 3.8.4 or earlier +yarn add tslib@^1 + +# TypeScript 2.3.2 or earlier +yarn add tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 3.9.2 or later +bower install tslib + +# TypeScript 3.8.4 or earlier +bower install tslib@^1 + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 3.9.2 or later +jspm install tslib + +# TypeScript 3.8.4 or earlier +jspm install tslib@^1 + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"] + } + } +} +``` + +## Deployment + +- Choose your new version number +- Set it in `package.json` and `bower.json` +- Create a tag: `git tag [version]` +- Push the tag: `git push --tags` +- Create a [release in GitHub](https://github.com/microsoft/tslib/releases) +- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow + +Done. + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Homepage](http://www.typescriptlang.org/) diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/SECURITY.md b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/SECURITY.md new file mode 100644 index 00000000..869fdfe2 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.d.ts b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.d.ts new file mode 100644 index 00000000..3244fabe --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.d.ts @@ -0,0 +1,38 @@ +// Note: named reexports are used instead of `export *` because +// TypeScript itself doesn't resolve the `export *` when checking +// if a particular helper exists. +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __createBinding, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +} from '../tslib.js'; +export * as default from '../tslib.js'; diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.js b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.js new file mode 100644 index 00000000..c91f6186 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/index.js @@ -0,0 +1,70 @@ +import tslib from '../tslib.js'; +const { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +} = tslib; +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +}; +export default tslib; diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/package.json b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/package.json new file mode 100644 index 00000000..aafa0e4b --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/modules/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/package.json b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/package.json new file mode 100644 index 00000000..57d05787 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/package.json @@ -0,0 +1,47 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "2.8.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts", + "sideEffects": false, + "exports": { + ".": { + "module": { + "types": "./modules/index.d.ts", + "default": "./tslib.es6.mjs" + }, + "import": { + "node": "./modules/index.js", + "default": { + "types": "./modules/index.d.ts", + "default": "./tslib.es6.mjs" + } + }, + "default": "./tslib.js" + }, + "./*": "./*", + "./": "./" + } +} diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts new file mode 100644 index 00000000..f23df559 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts @@ -0,0 +1,460 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/** + * Used to shim class extends. + * + * @param d The derived class. + * @param b The base class. + */ +export declare function __extends(d: Function, b: Function): void; + +/** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * + * @param t The target object to copy to. + * @param sources One or more source objects from which to copy properties + */ +export declare function __assign(t: any, ...sources: any[]): any; + +/** + * Performs a rest spread on an object. + * + * @param t The source value. + * @param propertyNames The property names excluded from the rest spread. + */ +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; + +/** + * Applies decorators to a target object + * + * @param decorators The set of decorators to apply. + * @param target The target object. + * @param key If specified, the own property to apply the decorators to. + * @param desc The property descriptor, defaults to fetching the descriptor from the target object. + * @experimental + */ +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; + +/** + * Creates an observing function decorator from a parameter decorator. + * + * @param paramIndex The parameter index to apply the decorator to. + * @param decorator The parameter decorator to apply. Note that the return value is ignored. + * @experimental + */ +export declare function __param(paramIndex: number, decorator: Function): Function; + +/** + * Applies decorators to a class or class member, following the native ECMAScript decorator specification. + * @param ctor For non-field class members, the class constructor. Otherwise, `null`. + * @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`. + * @param decorators The decorators to apply + * @param contextIn The `DecoratorContext` to clone for each decorator application. + * @param initializers An array of field initializer mutation functions into which new initializers are written. + * @param extraInitializers An array of extra initializer functions into which new initializers are written. + */ +export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void; + +/** + * Runs field initializers or extra initializers generated by `__esDecorate`. + * @param thisArg The `this` argument to use. + * @param initializers The array of initializers to evaluate. + * @param value The initial value to pass to the initializers. + */ +export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any; + +/** + * Converts a computed property name into a `string` or `symbol` value. + */ +export declare function __propKey(x: any): string | symbol; + +/** + * Assigns the name of a function derived from the left-hand side of an assignment. + * @param f The function to rename. + * @param name The new name for the function. + * @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name. + */ +export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function; + +/** + * Creates a decorator that sets metadata. + * + * @param metadataKey The metadata key + * @param metadataValue The metadata value + * @experimental + */ +export declare function __metadata(metadataKey: any, metadataValue: any): Function; + +/** + * Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`. + * + * @param thisArg The reference to use as the `this` value in the generator function + * @param _arguments The optional arguments array + * @param P The optional promise constructor argument, defaults to the `Promise` property of the global object. + * @param generator The generator function + */ +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + +/** + * Creates an Iterator object using the body as the implementation. + * + * @param thisArg The reference to use as the `this` value in the function + * @param body The generator state-machine based implementation. + * + * @see [./docs/generator.md] + */ +export declare function __generator(thisArg: any, body: Function): any; + +/** + * Creates bindings for all enumerable properties of `m` on `exports` + * + * @param m The source object + * @param o The `exports` object. + */ +export declare function __exportStar(m: any, o: any): void; + +/** + * Creates a value iterator from an `Iterable` or `ArrayLike` object. + * + * @param o The object. + * @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`. + */ +export declare function __values(o: any): any; + +/** + * Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array. + * + * @param o The object to read from. + * @param n The maximum number of arguments to read, defaults to `Infinity`. + */ +export declare function __read(o: any, n?: number): any[]; + +/** + * Creates an array from iterable spread. + * + * @param args The Iterable objects to spread. + * @deprecated since TypeScript 4.2 - Use `__spreadArray` + */ +export declare function __spread(...args: any[][]): any[]; + +/** + * Creates an array from array spread. + * + * @param args The ArrayLikes to spread into the resulting array. + * @deprecated since TypeScript 4.2 - Use `__spreadArray` + */ +export declare function __spreadArrays(...args: any[][]): any[]; + +/** + * Spreads the `from` array into the `to` array. + * + * @param pack Replace empty elements with `undefined`. + */ +export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[]; + +/** + * Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded, + * and instead should be awaited and the resulting value passed back to the generator. + * + * @param v The value to await. + */ +export declare function __await(v: any): any; + +/** + * Converts a generator function into an async generator function, by using `yield __await` + * in place of normal `await`. + * + * @param thisArg The reference to use as the `this` value in the generator function + * @param _arguments The optional arguments array + * @param generator The generator function + */ +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; + +/** + * Used to wrap a potentially async iterator in such a way so that it wraps the result + * of calling iterator methods of `o` in `__await` instances, and then yields the awaited values. + * + * @param o The potentially async iterator. + * @returns A synchronous iterator yielding `__await` instances on every odd invocation + * and returning the awaited `IteratorResult` passed to `next` every even invocation. + */ +export declare function __asyncDelegator(o: any): any; + +/** + * Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object. + * + * @param o The object. + * @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`. + */ +export declare function __asyncValues(o: any): any; + +/** + * Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays. + * + * @param cooked The cooked possibly-sparse array. + * @param raw The raw string content. + */ +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; + +/** + * Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS. + * + * ```js + * import Default, { Named, Other } from "mod"; + * // or + * import { default as Default, Named, Other } from "mod"; + * ``` + * + * @param mod The CommonJS module exports object. + */ +export declare function __importStar(mod: T): T; + +/** + * Used to shim default imports in ECMAScript Modules transpiled to CommonJS. + * + * ```js + * import Default from "mod"; + * ``` + * + * @param mod The CommonJS module exports object. + */ +export declare function __importDefault(mod: T): T | { default: T }; + +/** + * Emulates reading a private instance field. + * + * @param receiver The instance from which to read the private field. + * @param state A WeakMap containing the private field value for an instance. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldGet( + receiver: T, + state: { has(o: T): boolean, get(o: T): V | undefined }, + kind?: "f" +): V; + +/** + * Emulates reading a private static field. + * + * @param receiver The object from which to read the private static field. + * @param state The class constructor containing the definition of the static field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The descriptor that holds the static field value. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldGet unknown, V>( + receiver: T, + state: T, + kind: "f", + f: { value: V } +): V; + +/** + * Emulates evaluating a private instance "get" accessor. + * + * @param receiver The instance on which to evaluate the private "get" accessor. + * @param state A WeakSet used to verify an instance supports the private "get" accessor. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "get" accessor function to evaluate. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldGet( + receiver: T, + state: { has(o: T): boolean }, + kind: "a", + f: () => V +): V; + +/** + * Emulates evaluating a private static "get" accessor. + * + * @param receiver The object on which to evaluate the private static "get" accessor. + * @param state The class constructor containing the definition of the static "get" accessor. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "get" accessor function to evaluate. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldGet unknown, V>( + receiver: T, + state: T, + kind: "a", + f: () => V +): V; + +/** + * Emulates reading a private instance method. + * + * @param receiver The instance from which to read a private method. + * @param state A WeakSet used to verify an instance supports the private method. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The function to return as the private instance method. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldGet unknown>( + receiver: T, + state: { has(o: T): boolean }, + kind: "m", + f: V +): V; + +/** + * Emulates reading a private static method. + * + * @param receiver The object from which to read the private static method. + * @param state The class constructor containing the definition of the static method. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The function to return as the private static method. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldGet unknown, V extends (...args: any[]) => unknown>( + receiver: T, + state: T, + kind: "m", + f: V +): V; + +/** + * Emulates writing to a private instance field. + * + * @param receiver The instance on which to set a private field value. + * @param state A WeakMap used to store the private field value for an instance. + * @param value The value to store in the private field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldSet( + receiver: T, + state: { has(o: T): boolean, set(o: T, value: V): unknown }, + value: V, + kind?: "f" +): V; + +/** + * Emulates writing to a private static field. + * + * @param receiver The object on which to set the private static field. + * @param state The class constructor containing the definition of the private static field. + * @param value The value to store in the private field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The descriptor that holds the static field value. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldSet unknown, V>( + receiver: T, + state: T, + value: V, + kind: "f", + f: { value: V } +): V; + +/** + * Emulates writing to a private instance "set" accessor. + * + * @param receiver The instance on which to evaluate the private instance "set" accessor. + * @param state A WeakSet used to verify an instance supports the private "set" accessor. + * @param value The value to store in the private accessor. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "set" accessor function to evaluate. + * + * @throws {TypeError} If `state` doesn't have an entry for `receiver`. + */ +export declare function __classPrivateFieldSet( + receiver: T, + state: { has(o: T): boolean }, + value: V, + kind: "a", + f: (v: V) => void +): V; + +/** + * Emulates writing to a private static "set" accessor. + * + * @param receiver The object on which to evaluate the private static "set" accessor. + * @param state The class constructor containing the definition of the static "set" accessor. + * @param value The value to store in the private field. + * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. + * @param f The "set" accessor function to evaluate. + * + * @throws {TypeError} If `receiver` is not `state`. + */ +export declare function __classPrivateFieldSet unknown, V>( + receiver: T, + state: T, + value: V, + kind: "a", + f: (v: V) => void +): V; + +/** + * Checks for the existence of a private field/method/accessor. + * + * @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member. + * @param receiver The object for which to test the presence of the private member. + */ +export declare function __classPrivateFieldIn( + state: (new (...args: any[]) => unknown) | { has(o: any): boolean }, + receiver: unknown, +): boolean; + +/** + * Creates a re-export binding on `object` with key `objectKey` that references `target[key]`. + * + * @param object The local `exports` object. + * @param target The object to re-export from. + * @param key The property key of `target` to re-export. + * @param objectKey The property key to re-export as. Defaults to `key`. + */ +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; + +/** + * Adds a disposable resource to a resource-tracking environment object. + * @param env A resource-tracking environment object. + * @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`. + * @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added. + * @returns The {@link value} argument. + * + * @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not + * defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method. + */ +export declare function __addDisposableResource(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T; + +/** + * Disposes all resources in a resource-tracking environment object. + * @param env A resource-tracking environment object. + * @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`. + * + * @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the + * error recorded in the resource-tracking environment object. + * @seealso {@link __addDisposableResource} + */ +export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any; + +/** + * Transforms a relative import specifier ending in a non-declaration TypeScript file extension to its JavaScript file extension counterpart. + * @param path The import specifier. + * @param preserveJsx Causes '*.tsx' to transform to '*.jsx' instead of '*.js'. Should be true when `--jsx` is set to `preserve`. + */ +export declare function __rewriteRelativeImportExtension(path: string, preserveJsx?: boolean): string; \ No newline at end of file diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.html b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.html new file mode 100644 index 00000000..b122e41b --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js new file mode 100644 index 00000000..6c1739b3 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js @@ -0,0 +1,402 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +export function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +export function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +export function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +export function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +export function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +export function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +export function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +export function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +export function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +export function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + +export default { + __extends: __extends, + __assign: __assign, + __rest: __rest, + __decorate: __decorate, + __param: __param, + __esDecorate: __esDecorate, + __runInitializers: __runInitializers, + __propKey: __propKey, + __setFunctionName: __setFunctionName, + __metadata: __metadata, + __awaiter: __awaiter, + __generator: __generator, + __createBinding: __createBinding, + __exportStar: __exportStar, + __values: __values, + __read: __read, + __spread: __spread, + __spreadArrays: __spreadArrays, + __spreadArray: __spreadArray, + __await: __await, + __asyncGenerator: __asyncGenerator, + __asyncDelegator: __asyncDelegator, + __asyncValues: __asyncValues, + __makeTemplateObject: __makeTemplateObject, + __importStar: __importStar, + __importDefault: __importDefault, + __classPrivateFieldGet: __classPrivateFieldGet, + __classPrivateFieldSet: __classPrivateFieldSet, + __classPrivateFieldIn: __classPrivateFieldIn, + __addDisposableResource: __addDisposableResource, + __disposeResources: __disposeResources, + __rewriteRelativeImportExtension: __rewriteRelativeImportExtension, +}; diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs new file mode 100644 index 00000000..c17990a1 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs @@ -0,0 +1,401 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; + +export function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +export function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +export function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +export function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +export function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +export function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +export function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +export function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +export function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +export function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + +export default { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension, +}; diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.html b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.html new file mode 100644 index 00000000..44c9ba51 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.js b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.js new file mode 100644 index 00000000..5e12ace6 --- /dev/null +++ b/backend/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.js @@ -0,0 +1,484 @@ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __esDecorate; +var __runInitializers; +var __propKey; +var __setFunctionName; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __classPrivateFieldIn; +var __createBinding; +var __addDisposableResource; +var __disposeResources; +var __rewriteRelativeImportExtension; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + }; + + __runInitializers = function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + }; + + __propKey = function (x) { + return typeof x === "symbol" ? x : "".concat(x); + }; + + __setFunctionName = function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; + + __classPrivateFieldIn = function (state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + }; + + __addDisposableResource = function (env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + }; + + var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + + __disposeResources = function (env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); + }; + + __rewriteRelativeImportExtension = function (path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__esDecorate", __esDecorate); + exporter("__runInitializers", __runInitializers); + exporter("__propKey", __propKey); + exporter("__setFunctionName", __setFunctionName); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); + exporter("__classPrivateFieldIn", __classPrivateFieldIn); + exporter("__addDisposableResource", __addDisposableResource); + exporter("__disposeResources", __disposeResources); + exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension); +}); + +0 && (module.exports = { + __extends: __extends, + __assign: __assign, + __rest: __rest, + __decorate: __decorate, + __param: __param, + __esDecorate: __esDecorate, + __runInitializers: __runInitializers, + __propKey: __propKey, + __setFunctionName: __setFunctionName, + __metadata: __metadata, + __awaiter: __awaiter, + __generator: __generator, + __exportStar: __exportStar, + __createBinding: __createBinding, + __values: __values, + __read: __read, + __spread: __spread, + __spreadArrays: __spreadArrays, + __spreadArray: __spreadArray, + __await: __await, + __asyncGenerator: __asyncGenerator, + __asyncDelegator: __asyncDelegator, + __asyncValues: __asyncValues, + __makeTemplateObject: __makeTemplateObject, + __importStar: __importStar, + __importDefault: __importDefault, + __classPrivateFieldGet: __classPrivateFieldGet, + __classPrivateFieldSet: __classPrivateFieldSet, + __classPrivateFieldIn: __classPrivateFieldIn, + __addDisposableResource: __addDisposableResource, + __disposeResources: __disposeResources, + __rewriteRelativeImportExtension: __rewriteRelativeImportExtension, +}); diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/content-type b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/content-type new file mode 120000 index 00000000..5850a329 --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/content-type @@ -0,0 +1 @@ +../../content-type@2.1.0/node_modules/content-type \ No newline at end of file diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/media-typer b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/media-typer new file mode 120000 index 00000000..330b6a57 --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/media-typer @@ -0,0 +1 @@ +../../media-typer@1.1.1/node_modules/media-typer \ No newline at end of file diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/mime-types b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/mime-types new file mode 120000 index 00000000..1a17c094 --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/mime-types @@ -0,0 +1 @@ +../../mime-types@3.0.2/node_modules/mime-types \ No newline at end of file diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/HISTORY.md b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/HISTORY.md new file mode 100644 index 00000000..6812655c --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/HISTORY.md @@ -0,0 +1,292 @@ +2.0.1 / 2025-03-27 +========== + +2.0.0 / 2024-08-31 +========== + + * Drop node <18 + * Use `content-type@^1.0.5` and `media-typer@^1.0.0` for type validation + - No behavior changes, upgrades `media-typer` + * deps: mime-types@^3.0.0 + - Add `application/toml` with extension `.toml` + - Add `application/ubjson` with extension `.ubj` + - Add `application/x-keepass2` with extension `.kdbx` + - Add deprecated iWorks mime types and extensions + - Add extension `.amr` to `audio/amr` + - Add extension `.cjs` to `application/node` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extension `.opus` to `audio/ogg` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add extension `.trig` to `application/trig` + - Add extensions from IANA for `application/*+xml` types + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add `image/vnd.ms-dds` with extension `.dds` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +1.6.18 / 2019-04-26 +=================== + + * Fix regression passing request object to `typeis.is` + +1.6.17 / 2019-04-25 +=================== + + * deps: mime-types@~2.1.24 + - Add Apple file extensions from IANA + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add extension `.owl` to `application/rdf+xml` + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add extensions from IANA for `image/*` types + - Add extensions from IANA for `model/*` types + - Add extensions to HEIC image types + - Add new mime types + - Add `text/mdx` with extension `.mdx` + * perf: prevent internal `throw` on invalid type + +1.6.16 / 2018-02-16 +=================== + + * deps: mime-types@~2.1.18 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add extension `.mjs` to `application/javascript` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add glTF types and extensions + - Add new mime types + - Update extensions `.md` and `.markdown` to be `text/markdown` + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +1.6.15 / 2017-03-31 +=================== + + * deps: mime-types@~2.1.15 + - Add new mime types + +1.6.14 / 2016-11-18 +=================== + + * deps: mime-types@~2.1.13 + - Add new mime types + +1.6.13 / 2016-05-18 +=================== + + * deps: mime-types@~2.1.11 + - Add new mime types + +1.6.12 / 2016-02-28 +=================== + + * deps: mime-types@~2.1.10 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +1.6.11 / 2016-01-29 +=================== + + * deps: mime-types@~2.1.9 + - Add new mime types + +1.6.10 / 2015-12-01 +=================== + + * deps: mime-types@~2.1.8 + - Add new mime types + +1.6.9 / 2015-09-27 +================== + + * deps: mime-types@~2.1.7 + - Add new mime types + +1.6.8 / 2015-09-04 +================== + + * deps: mime-types@~2.1.6 + - Add new mime types + +1.6.7 / 2015-08-20 +================== + + * Fix type error when given invalid type to match against + * deps: mime-types@~2.1.5 + - Add new mime types + +1.6.6 / 2015-07-31 +================== + + * deps: mime-types@~2.1.4 + - Add new mime types + +1.6.5 / 2015-07-16 +================== + + * deps: mime-types@~2.1.3 + - Add new mime types + +1.6.4 / 2015-07-01 +================== + + * deps: mime-types@~2.1.2 + - Add new mime types + * perf: enable strict mode + * perf: remove argument reassignment + +1.6.3 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - Add new mime types + * perf: reduce try block size + * perf: remove bitwise operations + +1.6.2 / 2015-05-10 +================== + + * deps: mime-types@~2.0.11 + - Add new mime types + +1.6.1 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - Add new mime types + +1.6.0 / 2015-02-12 +================== + + * fix false-positives in `hasBody` `Transfer-Encoding` check + * support wildcard for both type and subtype (`*/*`) + +1.5.7 / 2015-02-09 +================== + + * fix argument reassignment + * deps: mime-types@~2.0.9 + - Add new mime types + +1.5.6 / 2015-01-29 +================== + + * deps: mime-types@~2.0.8 + - Add new mime types + +1.5.5 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - Add new mime types + - Fix missing extensions + - Fix various invalid MIME type entries + - Remove example template MIME types + - deps: mime-db@~1.5.0 + +1.5.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - Add new mime types + - deps: mime-db@~1.3.0 + +1.5.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - Add new mime types + - deps: mime-db@~1.2.0 + +1.5.2 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - Add new mime types + - deps: mime-db@~1.1.0 + +1.5.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + * deps: media-typer@0.3.0 + * deps: mime-types@~2.0.1 + - Support Node.js 0.6 + +1.5.0 / 2014-09-05 +================== + + * fix `hasbody` to be true for `content-length: 0` + +1.4.0 / 2014-09-02 +================== + + * update mime-types + +1.3.2 / 2014-06-24 +================== + + * use `~` range on mime-types + +1.3.1 / 2014-06-19 +================== + + * fix global variable leak + +1.3.0 / 2014-06-19 +================== + + * improve type parsing + + - invalid media type never matches + - media type not case-sensitive + - extra LWS does not affect results + +1.2.2 / 2014-06-19 +================== + + * fix behavior on unknown type argument + +1.2.1 / 2014-06-03 +================== + + * switch dependency from `mime` to `mime-types@1.0.0` + +1.2.0 / 2014-05-11 +================== + + * support suffix matching: + + - `+json` matches `application/vnd+json` + - `*/vnd+json` matches `application/vnd+json` + - `application/*+json` matches `application/vnd+json` + +1.1.0 / 2014-04-12 +================== + + * add non-array values support + * expose internal utilities: + + - `.is()` + - `.hasBody()` + - `.normalize()` + - `.match()` + +1.0.1 / 2014-03-30 +================== + + * add `multipart` as a shorthand diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/LICENSE b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/LICENSE new file mode 100644 index 00000000..386b7b69 --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/README.md b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/README.md new file mode 100644 index 00000000..d23946e6 --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/README.md @@ -0,0 +1,198 @@ +# type-is + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Infer the content-type of a request. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install type-is +``` + +## API + +```js +var http = require('http') +var typeis = require('type-is') + +http.createServer(function (req, res) { + var istext = typeis(req, ['text/*']) + res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text') +}) +``` + +### typeis(request, types) + +Checks if the `request` is one of the `types`. If the request has no body, +even if there is a `Content-Type` header, then `null` is returned. If the +`Content-Type` header is invalid or does not matches any of the `types`, then +`false` is returned. Otherwise, a string of the type that matched is returned. + +The `request` argument is expected to be a Node.js HTTP request. The `types` +argument is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +// req.headers.content-type = 'application/json' + +typeis(req, ['json']) // => 'json' +typeis(req, ['html', 'json']) // => 'json' +typeis(req, ['application/*']) // => 'application/json' +typeis(req, ['application/json']) // => 'application/json' + +typeis(req, ['html']) // => false +``` + +### typeis.hasBody(request) + +Returns a Boolean if the given `request` has a body, regardless of the +`Content-Type` header. + +Having a body has no relation to how large the body is (it may be 0 bytes). +This is similar to how file existence works. If a body does exist, then this +indicates that there is data to read from the Node.js request stream. + +```js +if (typeis.hasBody(req)) { + // read the body, since there is one + + req.on('data', function (chunk) { + // ... + }) +} +``` + +### typeis.is(mediaType, types) + +Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid +or does not matches any of the `types`, then `false` is returned. Otherwise, a +string of the type that matched is returned. + +The `mediaType` argument is expected to be a +[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument +is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +var mediaType = 'application/json' + +typeis.is(mediaType, ['json']) // => 'json' +typeis.is(mediaType, ['html', 'json']) // => 'json' +typeis.is(mediaType, ['application/*']) // => 'application/json' +typeis.is(mediaType, ['application/json']) // => 'application/json' + +typeis.is(mediaType, ['html']) // => false +``` + +### typeis.match(expected, actual) + +Match the type string `expected` with `actual`, taking in to account wildcards. +A wildcard can only be in the type of the subtype part of a media type and only +in the `expected` value (as `actual` should be the real media type to match). A +suffix can still be included even with a wildcard subtype. If an input is +malformed, `false` will be returned. + +```js +typeis.match('text/html', 'text/html') // => true +typeis.match('*/html', 'text/html') // => true +typeis.match('text/*', 'text/html') // => true +typeis.match('*/*', 'text/html') // => true +typeis.match('*/*+json', 'application/x-custom+json') // => true +``` + +### typeis.normalize(type) + +Normalize a `type` string. This works by performing the following: + +- If the `type` is not a string, `false` is returned. +- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`), + then it is expanded to contain the complete wildcard notation of `*/*+suffix`. +- If the string contains a `/`, then it is returned as the type. +- Else the string is assumed to be a file extension and the mapped media type is + returned, or `false` is there is no mapping. + +This includes two special mappings: + +- `'multipart'` -> `'multipart/*'` +- `'urlencoded'` -> `'application/x-www-form-urlencoded'` + +## Examples + +### Example body parser + +```js +var express = require('express') +var typeis = require('type-is') + +var app = express() + +app.use(function bodyParser (req, res, next) { + if (!typeis.hasBody(req)) { + return next() + } + + switch (typeis(req, ['urlencoded', 'json', 'multipart'])) { + case 'urlencoded': + // parse urlencoded body + throw new Error('implement urlencoded body parsing') + case 'json': + // parse json body + throw new Error('implement json body parsing') + case 'multipart': + // parse multipart body + throw new Error('implement multipart body parsing') + default: + // 415 error code + res.statusCode = 415 + res.end() + break + } +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci +[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master +[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master +[node-version-image]: https://badgen.net/npm/node/type-is +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/type-is +[npm-url]: https://npmjs.org/package/type-is +[npm-version-image]: https://badgen.net/npm/v/type-is +[travis-image]: https://badgen.net/travis/jshttp/type-is/master +[travis-url]: https://travis-ci.org/jshttp/type-is diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/index.js b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/index.js new file mode 100644 index 00000000..37d6da3c --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/index.js @@ -0,0 +1,240 @@ +/*! + * type-is + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var contentType = require('content-type') +var mime = require('mime-types') +var typer = require('media-typer') + +/** + * Module exports. + * @public + */ + +module.exports = typeofrequest +module.exports.is = typeis +module.exports.hasBody = hasbody +module.exports.normalize = normalize +module.exports.match = mimeMatch + +/** + * Compare a `value` content-type with `types`. + * Each `type` can be an extension like `html`, + * a special shortcut like `multipart` or `urlencoded`, + * or a mime type. + * + * If no types match, `false` is returned. + * Otherwise, the first `type` that matches is returned. + * + * @param {String} value + * @param {Array} types + * @public + */ + +function typeis (value, types_) { + // Backward compatibility. TODO: Remove. + if (value && typeof value === 'object') { + value = value.headers['content-type'] + } + + var i + var types = types_ + + // remove parameters and normalize + var val = normalizeType(value) + + // no type or invalid + if (!val) { + return false + } + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length - 1) + for (i = 0; i < types.length; i++) { + types[i] = arguments[i + 1] + } + } + + // no types, return the content type + if (!types || !types.length) { + return val + } + + var type + for (i = 0; i < types.length; i++) { + if (mimeMatch(normalize(type = types[i]), val)) { + return type[0] === '+' || type.indexOf('*') !== -1 + ? val + : type + } + } + + // no matches + return false +} + +/** + * Check if a request has a request body. + * A request with a body __must__ either have `transfer-encoding` + * or `content-length` headers set. + * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 + * + * @param {Object} request + * @return {Boolean} + * @public + */ + +function hasbody (req) { + return req.headers['transfer-encoding'] !== undefined || + !isNaN(req.headers['content-length']) +} + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains any of the give mime `type`s. + * If there is no request body, `null` is returned. + * If there is no content type, `false` is returned. + * Otherwise, it returns the first `type` that matches. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * this.is('html'); // => 'html' + * this.is('text/html'); // => 'text/html' + * this.is('text/*', 'application/json'); // => 'text/html' + * + * // When Content-Type is application/json + * this.is('json', 'urlencoded'); // => 'json' + * this.is('application/json'); // => 'application/json' + * this.is('html', 'application/*'); // => 'application/json' + * + * this.is('html'); // => false + * + * @param {Object} req + * @param {(String|Array)} types... + * @return {(String|false|null)} + * @public + */ + +function typeofrequest (req, types_) { + // no body + if (!hasbody(req)) return null + // support flattened arguments + var types = arguments.length > 2 + ? Array.prototype.slice.call(arguments, 1) + : types_ + // request content type + var value = req.headers['content-type'] + + return typeis(value, types) +} + +/** + * Normalize a mime type. + * If it's a shorthand, expand it to a valid mime type. + * + * In general, you probably want: + * + * var type = is(req, ['urlencoded', 'json', 'multipart']); + * + * Then use the appropriate body parsers. + * These three are the most common request body types + * and are thus ensured to work. + * + * @param {String} type + * @return {String|false|null} + * @public + */ + +function normalize (type) { + if (typeof type !== 'string') { + // invalid type + return false + } + + switch (type) { + case 'urlencoded': + return 'application/x-www-form-urlencoded' + case 'multipart': + return 'multipart/*' + } + + if (type[0] === '+') { + // "+json" -> "*/*+json" expando + return '*/*' + type + } + + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if `expected` mime type + * matches `actual` mime type with + * wildcard and +suffix support. + * + * @param {String} expected + * @param {String} actual + * @return {Boolean} + * @public + */ + +function mimeMatch (expected, actual) { + // invalid type + if (expected === false) { + return false + } + + // split types + var actualParts = actual.split('/') + var expectedParts = expected.split('/') + + // invalid format + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false + } + + // validate type + if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { + return false + } + + // validate suffix wildcard + if (expectedParts[1].slice(0, 2) === '*+') { + return expectedParts[1].length <= actualParts[1].length + 1 && + expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) + } + + // validate subtype + if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { + return false + } + + return true +} + +/** + * Normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function normalizeType (value) { + if (!value) return null + var type = contentType.parse(value, { parameters: false }).type + + return typer.test(type) ? type : null +} diff --git a/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/package.json b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/package.json new file mode 100644 index 00000000..07c623fc --- /dev/null +++ b/backend/node_modules/.pnpm/type-is@2.1.0/node_modules/type-is/package.json @@ -0,0 +1,51 @@ +{ + "name": "type-is", + "description": "Infer the content-type of a request.", + "version": "2.1.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/type-is", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 18" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "type", + "checking" + ] +} diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/call-bound b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/call-bound new file mode 120000 index 00000000..5171ab6f --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/call-bound @@ -0,0 +1 @@ +../../call-bound@1.0.4/node_modules/call-bound \ No newline at end of file diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/es-errors b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/es-errors new file mode 120000 index 00000000..fccce4e7 --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/es-errors @@ -0,0 +1 @@ +../../es-errors@1.3.0/node_modules/es-errors \ No newline at end of file diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/is-typed-array b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/is-typed-array new file mode 120000 index 00000000..52c7b2f9 --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/is-typed-array @@ -0,0 +1 @@ +../../is-typed-array@1.1.15/node_modules/is-typed-array \ No newline at end of file diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.eslintrc b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.eslintrc new file mode 100644 index 00000000..46f3b120 --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": ["error", { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.github/FUNDING.yml b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.github/FUNDING.yml new file mode 100644 index 00000000..bf630d0a --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/typed-array-buffer +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.nycrc b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/CHANGELOG.md b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/CHANGELOG.md new file mode 100644 index 00000000..bf2db589 --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.3](https://github.com/inspect-js/typed-array-buffer/compare/v1.0.2...v1.0.3) - 2024-12-18 + +### Commits + +- [meta] update URLs [`aca9484`](https://github.com/inspect-js/typed-array-buffer/commit/aca9484b41f96767408e26e63854b5d86f759de8) +- [types] use shared config [`fcdcb05`](https://github.com/inspect-js/typed-array-buffer/commit/fcdcb05941a771826e1478a77aadd89c582e37cd) +- [actions] split out node 10-20, and 20+ [`5f5a406`](https://github.com/inspect-js/typed-array-buffer/commit/5f5a4067752d7bccecbaa8f6e143863d55197af9) +- [types] improve types [`f45042c`](https://github.com/inspect-js/typed-array-buffer/commit/f45042c07c04007217404d73aa77c26a73885210) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `es-value-fixtures`, `object-inspect`, `tape` [`0c937e7`](https://github.com/inspect-js/typed-array-buffer/commit/0c937e72e93dccc359c08cf1a9ef060e5f5e1a8d) +- [Refactor] use `call-bound` directly [`cf4aba4`](https://github.com/inspect-js/typed-array-buffer/commit/cf4aba4d8c1702ee9130abaf8a6a72907ca96ce0) +- [Tests] replace `aud` with `npm audit` [`a3abb73`](https://github.com/inspect-js/typed-array-buffer/commit/a3abb739300d1de6e88736019d718d831c7a4cca) +- [Dev Deps] update `@types/tape` [`548ffdc`](https://github.com/inspect-js/typed-array-buffer/commit/548ffdc881726b060ac92fc0c59ab0bb150df91f) +- [Deps] update `is-typed-array` [`3b5deb1`](https://github.com/inspect-js/typed-array-buffer/commit/3b5deb191a1c942deced0273b07fe69bc8de39ab) +- [Deps] update `call-bind` [`02cbc0c`](https://github.com/inspect-js/typed-array-buffer/commit/02cbc0cca2f69d81cdeedf7beebae2a5dd9dd4f7) +- [Tests] add attw and `postlint` [`f6daa66`](https://github.com/inspect-js/typed-array-buffer/commit/f6daa6695a69878d845070b90ab0bbf6392ebb03) +- [Dev Deps] add missing peer dep [`c9faf2a`](https://github.com/inspect-js/typed-array-buffer/commit/c9faf2ac04fc78410aeb144405db110fe9b60b6c) + +## [v1.0.2](https://github.com/inspect-js/typed-array-buffer/compare/v1.0.1...v1.0.2) - 2024-02-19 + +### Commits + +- add types [`23c6fba`](https://github.com/inspect-js/typed-array-buffer/commit/23c6fba167dbc8c1e9291eed3f68e64a5651075a) +- [Deps] update `available-typed-arrays` [`5f68ba1`](https://github.com/inspect-js/typed-array-buffer/commit/5f68ba1fdcd004af46d529fbb08220de2254cf43) +- [Deps] update `call-bind` [`54a92ce`](https://github.com/inspect-js/typed-array-buffer/commit/54a92ce4caf023c8680ffe64534ba881b78cdc17) +- [Dev Deps] update `tape` [`b0b3342`](https://github.com/inspect-js/typed-array-buffer/commit/b0b3342bcbefae5f3dff01b0e3734b08ca927f58) + +## [v1.0.1](https://github.com/inspect-js/typed-array-buffer/compare/v1.0.0...v1.0.1) - 2024-02-06 + +### Commits + +- [Dev Deps] update `aud`, `available-typed-arrays`, `npmignore`, `object-inspect`, `tape` [`5334477`](https://github.com/inspect-js/typed-array-buffer/commit/53344773866f35820dc4deef1aa47ec7890f2b02) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`e2511e0`](https://github.com/inspect-js/typed-array-buffer/commit/e2511e011a2331bd4a36ad6003a98b1cf766bc26) +- [Deps] update `call-bind`, `get-intrinsic`, `is-typed-array` [`36c3b11`](https://github.com/inspect-js/typed-array-buffer/commit/36c3b11efc9bce98de8bee5f81dcae4305876893) +- [meta] add `sideEffects` flag [`46cc1f4`](https://github.com/inspect-js/typed-array-buffer/commit/46cc1f4a8b8875fc6e84b33182602ec37655bbbd) + +## v1.0.0 - 2023-06-05 + +### Commits + +- Initial implementation, tests, readme [`5bc2953`](https://github.com/inspect-js/typed-array-buffer/commit/5bc295337b4310659832fc08699a4d10c2dbbded) +- Initial commit [`98b8ac9`](https://github.com/inspect-js/typed-array-buffer/commit/98b8ac90f407c368effa25d395aeea1d72e1d4b6) +- npm init [`6a4a73c`](https://github.com/inspect-js/typed-array-buffer/commit/6a4a73c66b1f13fd17699c6500a4979003676696) +- Only apps should have lockfiles [`7226abf`](https://github.com/inspect-js/typed-array-buffer/commit/7226abfda329b99dc25526c48740b076d128a7be) diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/LICENSE b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/LICENSE new file mode 100644 index 00000000..b4213ac6 --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/README.md b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/README.md new file mode 100644 index 00000000..da71d75f --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/README.md @@ -0,0 +1,42 @@ +# typed-array-buffer [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Get the ArrayBuffer out of a TypedArray, robustly. + +This will work in node <= 0.10 and < 0.11.4, where there's no prototype accessor, only a nonconfigurable own property. +It will also work in modern engines where `TypedArray.prototype.buffer` has been deleted after this module has loaded. + +## Example + +```js +const typedArrayBuffer = require('typed-array-buffer'); +const assert = require('assert'); + +const arr = new Uint8Array(0); +assert.equal(arr.buffer, typedArrayBuffer(arr)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/typed-array-buffer +[npm-version-svg]: https://versionbadg.es/inspect-js/typed-array-buffer.svg +[deps-svg]: https://david-dm.org/inspect-js/typed-array-buffer.svg +[deps-url]: https://david-dm.org/inspect-js/typed-array-buffer +[dev-deps-svg]: https://david-dm.org/inspect-js/typed-array-buffer/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/typed-array-buffer#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/typed-array-buffer.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/typed-array-buffer.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/typed-array-buffer.svg +[downloads-url]: https://npm-stat.com/charts.html?package=typed-array-buffer +[codecov-image]: https://codecov.io/gh/inspect-js/typed-array-buffer/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/typed-array-buffer/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/typed-array-buffer +[actions-url]: https://github.com/inspect-js/typed-array-buffer/actions diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.d.ts b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.d.ts new file mode 100644 index 00000000..68ce88d6 --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.d.ts @@ -0,0 +1,9 @@ +import type { TypedArray } from 'is-typed-array'; + +declare namespace typedArrayBuffer{ + export type { TypedArray }; +} + +declare function typedArrayBuffer(x: typedArrayBuffer.TypedArray): ArrayBuffer; + +export = typedArrayBuffer; diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.js b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.js new file mode 100644 index 00000000..a27c2b97 --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +var callBound = require('call-bound'); + +/** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer)} */ +var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true); + +var isTypedArray = require('is-typed-array'); + +/** @type {import('.')} */ +// node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter +module.exports = $typedArrayBuffer || function typedArrayBuffer(x) { + if (!isTypedArray(x)) { + throw new $TypeError('Not a Typed Array'); + } + return x.buffer; +}; diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/package.json b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/package.json new file mode 100644 index 00000000..bef6fb8a --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/package.json @@ -0,0 +1,82 @@ +{ + "name": "typed-array-buffer", + "version": "1.0.3", + "description": "Get the ArrayBuffer out of a TypedArray, robustly.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/typed-array-buffer.git" + }, + "keywords": [ + "typed array", + "arraybuffer", + "buffer" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/typed-array-buffer/issues" + }, + "homepage": "https://github.com/inspect-js/typed-array-buffer#readme", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/es-value-fixtures": "^1.4.4", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "available-typed-arrays": "^1.0.7", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.5.0", + "eslint": "=8.8.0", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/test/index.js b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/test/index.js new file mode 100644 index 00000000..9596317e --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/test/index.js @@ -0,0 +1,23 @@ +'use strict'; + +var test = require('tape'); +var availableTypedArrays = require('available-typed-arrays')(); +var forEach = require('for-each'); +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); + +var typedArrayBuffer = require('../'); + +test('typedArrayBuffer', function (t) { + // @ts-expect-error TS sucks at concat + forEach([].concat(v.primitives, v.objects), function (nonTA) { + t['throws'](function () { typedArrayBuffer(nonTA); }, TypeError, inspect(nonTA) + ' is not a Typed Array'); + }); + + forEach(availableTypedArrays, function (TA) { + var ta = new global[TA](0); + t.equal(typedArrayBuffer(ta), ta.buffer, inspect(ta) + ' has the same buffer as its own buffer property'); + }); + + t.end(); +}); diff --git a/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/tsconfig.json b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/tsconfig.json new file mode 100644 index 00000000..d9a6668c --- /dev/null +++ b/backend/node_modules/.pnpm/typed-array-buffer@1.0.3/node_modules/typed-array-buffer/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/HISTORY.md b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/HISTORY.md new file mode 100644 index 00000000..85e0f8d7 --- /dev/null +++ b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/HISTORY.md @@ -0,0 +1,4 @@ +1.0.0 / 2015-06-14 +================== + + * Initial release diff --git a/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/LICENSE b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/LICENSE new file mode 100644 index 00000000..aed01382 --- /dev/null +++ b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/README.md b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/README.md new file mode 100644 index 00000000..e536ad2c --- /dev/null +++ b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/README.md @@ -0,0 +1,43 @@ +# unpipe + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Unpipe a stream from all destinations. + +## Installation + +```sh +$ npm install unpipe +``` + +## API + +```js +var unpipe = require('unpipe') +``` + +### unpipe(stream) + +Unpipes all destinations from a given stream. With stream 2+, this is +equivalent to `stream.unpipe()`. When used with streams 1 style streams +(typically Node.js 0.8 and below), this module attempts to undo the +actions done in `stream.pipe(dest)`. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/unpipe.svg +[npm-url]: https://npmjs.org/package/unpipe +[node-image]: https://img.shields.io/node/v/unpipe.svg +[node-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg +[travis-url]: https://travis-ci.org/stream-utils/unpipe +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master +[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg +[downloads-url]: https://npmjs.org/package/unpipe diff --git a/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/index.js b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/index.js new file mode 100644 index 00000000..15c3d97a --- /dev/null +++ b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/index.js @@ -0,0 +1,69 @@ +/*! + * unpipe + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = unpipe + +/** + * Determine if there are Node.js pipe-like data listeners. + * @private + */ + +function hasPipeDataListeners(stream) { + var listeners = stream.listeners('data') + + for (var i = 0; i < listeners.length; i++) { + if (listeners[i].name === 'ondata') { + return true + } + } + + return false +} + +/** + * Unpipe a stream from all destinations. + * + * @param {object} stream + * @public + */ + +function unpipe(stream) { + if (!stream) { + throw new TypeError('argument stream is required') + } + + if (typeof stream.unpipe === 'function') { + // new-style + stream.unpipe() + return + } + + // Node.js 0.8 hack + if (!hasPipeDataListeners(stream)) { + return + } + + var listener + var listeners = stream.listeners('close') + + for (var i = 0; i < listeners.length; i++) { + listener = listeners[i] + + if (listener.name !== 'cleanup' && listener.name !== 'onclose') { + continue + } + + // invoke the listener + listener.call(stream) + } +} diff --git a/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/package.json b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/package.json new file mode 100644 index 00000000..a2b73583 --- /dev/null +++ b/backend/node_modules/.pnpm/unpipe@1.0.0/node_modules/unpipe/package.json @@ -0,0 +1,27 @@ +{ + "name": "unpipe", + "description": "Unpipe a stream from all destinations", + "version": "1.0.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "stream-utils/unpipe", + "devDependencies": { + "istanbul": "0.3.15", + "mocha": "2.2.5", + "readable-stream": "1.1.13" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/HISTORY.md b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/HISTORY.md new file mode 100644 index 00000000..f6cbcf7f --- /dev/null +++ b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/HISTORY.md @@ -0,0 +1,39 @@ +1.1.2 / 2017-09-23 +================== + + * perf: improve header token parsing speed + +1.1.1 / 2017-03-20 +================== + + * perf: hoist regular expression + +1.1.0 / 2015-09-29 +================== + + * Only accept valid field names in the `field` argument + - Ensures the resulting string is a valid HTTP header value + +1.0.1 / 2015-07-08 +================== + + * Fix setting empty header from empty `field` + * perf: enable strict mode + * perf: remove argument reassignments + +1.0.0 / 2014-08-10 +================== + + * Accept valid `Vary` header string as `field` + * Add `vary.append` for low-level string manipulation + * Move to `jshttp` orgainzation + +0.1.0 / 2014-06-05 +================== + + * Support array of fields to set + +0.0.0 / 2014-06-04 +================== + + * Initial release diff --git a/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/LICENSE b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/LICENSE new file mode 100644 index 00000000..84441fbb --- /dev/null +++ b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/README.md b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/README.md new file mode 100644 index 00000000..cc000b34 --- /dev/null +++ b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/README.md @@ -0,0 +1,101 @@ +# vary + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Manipulate the HTTP Vary header + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install vary +``` + +## API + + + +```js +var vary = require('vary') +``` + +### vary(res, field) + +Adds the given header `field` to the `Vary` response header of `res`. +This can be a string of a single field, a string of a valid `Vary` +header, or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. + + + +```js +// Append "Origin" to the Vary header of the response +vary(res, 'Origin') +``` + +### vary.append(header, field) + +Adds the given header `field` to the `Vary` response header string `header`. +This can be a string of a single field, a string of a valid `Vary` header, +or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. The new header string is returned. + + + +```js +// Get header string appending "Origin" to "Accept, User-Agent" +vary.append('Accept, User-Agent', 'Origin') +``` + +## Examples + +### Updating the Vary header when content is based on it + +```js +var http = require('http') +var vary = require('vary') + +http.createServer(function onRequest (req, res) { + // about to user-agent sniff + vary(res, 'User-Agent') + + var ua = req.headers['user-agent'] || '' + var isMobile = /mobi|android|touch|mini/i.test(ua) + + // serve site, depending on isMobile + res.setHeader('Content-Type', 'text/html') + res.end('You are (probably) ' + (isMobile ? '' : 'not ') + 'a mobile user') +}) +``` + +## Testing + +```sh +$ npm test +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/vary.svg +[npm-url]: https://npmjs.org/package/vary +[node-version-image]: https://img.shields.io/node/v/vary.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/jshttp/vary/master.svg +[travis-url]: https://travis-ci.org/jshttp/vary +[coveralls-image]: https://img.shields.io/coveralls/jshttp/vary/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/vary +[downloads-image]: https://img.shields.io/npm/dm/vary.svg +[downloads-url]: https://npmjs.org/package/vary diff --git a/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js new file mode 100644 index 00000000..5b5e7412 --- /dev/null +++ b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js @@ -0,0 +1,149 @@ +/*! + * vary + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = vary +module.exports.append = append + +/** + * RegExp to match field-name in RFC 7230 sec 3.2 + * + * field-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + */ + +var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/ + +/** + * Append a field to a vary header. + * + * @param {String} header + * @param {String|Array} field + * @return {String} + * @public + */ + +function append (header, field) { + if (typeof header !== 'string') { + throw new TypeError('header argument is required') + } + + if (!field) { + throw new TypeError('field argument is required') + } + + // get fields array + var fields = !Array.isArray(field) + ? parse(String(field)) + : field + + // assert on invalid field names + for (var j = 0; j < fields.length; j++) { + if (!FIELD_NAME_REGEXP.test(fields[j])) { + throw new TypeError('field argument contains an invalid header name') + } + } + + // existing, unspecified vary + if (header === '*') { + return header + } + + // enumerate current values + var val = header + var vals = parse(header.toLowerCase()) + + // unspecified vary + if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) { + return '*' + } + + for (var i = 0; i < fields.length; i++) { + var fld = fields[i].toLowerCase() + + // append value (case-preserving) + if (vals.indexOf(fld) === -1) { + vals.push(fld) + val = val + ? val + ', ' + fields[i] + : fields[i] + } + } + + return val +} + +/** + * Parse a vary header into an array. + * + * @param {String} header + * @return {Array} + * @private + */ + +function parse (header) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = header.length; i < len; i++) { + switch (header.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(header.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(header.substring(start, end)) + + return list +} + +/** + * Mark that a request is varied on a header field. + * + * @param {Object} res + * @param {String|Array} field + * @public + */ + +function vary (res, field) { + if (!res || !res.getHeader || !res.setHeader) { + // quack quack + throw new TypeError('res argument is required') + } + + // get existing header + var val = res.getHeader('Vary') || '' + var header = Array.isArray(val) + ? val.join(', ') + : String(val) + + // set new header + if ((val = append(header, field))) { + res.setHeader('Vary', val) + } +} diff --git a/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/package.json b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/package.json new file mode 100644 index 00000000..028f72a9 --- /dev/null +++ b/backend/node_modules/.pnpm/vary@1.1.2/node_modules/vary/package.json @@ -0,0 +1,43 @@ +{ + "name": "vary", + "description": "Manipulate the HTTP Vary header", + "version": "1.1.2", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "http", + "res", + "vary" + ], + "repository": "jshttp/vary", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "2.5.3", + "supertest": "1.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/LICENSE.md b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/LICENSE.md new file mode 100644 index 00000000..d4a994f5 --- /dev/null +++ b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/LICENSE.md @@ -0,0 +1,12 @@ +# The BSD 2-Clause License + +Copyright (c) 2014, Domenic Denicola +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/README.md b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/README.md new file mode 100644 index 00000000..16cc3931 --- /dev/null +++ b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/README.md @@ -0,0 +1,99 @@ +# Web IDL Type Conversions on JavaScript Values + +This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [Web IDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types). + +The goal is that you should be able to write code like + +```js +"use strict"; +const conversions = require("webidl-conversions"); + +function doStuff(x, y) { + x = conversions["boolean"](x); + y = conversions["unsigned long"](y); + // actual algorithm code here +} +``` + +and your function `doStuff` will behave the same as a Web IDL operation declared as + +```webidl +undefined doStuff(boolean x, unsigned long y); +``` + +## API + +This package's main module's default export is an object with a variety of methods, each corresponding to a different Web IDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the Web IDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the Web IDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float). + +Each method also accepts a second, optional, parameter for miscellaneous options. For conversion methods that throw errors, a string option `{ context }` may be provided to provide more information in the error message. (For example, `conversions["float"](NaN, { context: "Argument 1 of Interface's operation" })` will throw an error with message `"Argument 1 of Interface's operation is not a finite floating-point value."`) + +If we are dealing with multiple JavaScript realms (such as those created using Node.js' [vm](https://nodejs.org/api/vm.html) module or the HTML `iframe` element), and exceptions from another realm need to be thrown, one can supply an object option `globals` containing the following properties: + +```js +{ + globals: { + Number, + String, + TypeError + } +} +``` + +Those specific functions will be used when throwing exceptions. + +Specific conversions may also accept other options, the details of which can be found below. + +## Conversions implemented + +Conversions for all of the basic types from the Web IDL specification are implemented: + +- [`any`](https://heycam.github.io/webidl/#es-any) +- [`undefined`](https://heycam.github.io/webidl/#es-undefined) +- [`boolean`](https://heycam.github.io/webidl/#es-boolean) +- [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter +- [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float) +- [`double`](https://heycam.github.io/webidl/#es-double), [`unrestricted double`](https://heycam.github.io/webidl/#es-unrestricted-double) +- [`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter +- [`ByteString`](https://heycam.github.io/webidl/#es-ByteString), [`USVString`](https://heycam.github.io/webidl/#es-USVString) +- [`object`](https://heycam.github.io/webidl/#es-object) +- [Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types), which can additionally be provided with the boolean option `{ allowShared }` as a second parameter + +Additionally, for convenience, the following derived type definitions are implemented: + +- [`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView), which can additionally be provided with the boolean option `{ allowShared }` as a second parameter +- [`BufferSource`](https://heycam.github.io/webidl/#BufferSource) +- [`DOMTimeStamp`](https://heycam.github.io/webidl/#DOMTimeStamp) + +Derived types, such as nullable types, promise types, sequences, records, etc. are not handled by this library. You may wish to investigate the [webidl2js](https://github.com/jsdom/webidl2js) project. + +### A note on the `long long` types + +The `long long` and `unsigned long long` Web IDL types can hold values that cannot be stored in JavaScript numbers. Conversions are still accurate as we make use of BigInt in the conversion process, but in the case of `unsigned long long` we simply cannot represent some possible output values in JavaScript. For example, converting the JavaScript number `-1` to a Web IDL `unsigned long long` is supposed to produce the Web IDL value `18446744073709551615`. Since we are representing our Web IDL values in JavaScript, we can't represent `18446744073709551615`, so we instead the best we could do is `18446744073709551616` as the output. + +To mitigate this, we could return the raw BigInt value from the conversion function, but right now it is not implemented. If your use case requires such precision, [file an issue](https://github.com/jsdom/webidl-conversions/issues/new). + +On the other hand, `long long` conversion is always accurate, since the input value can never be more precise than the output value. + +### A note on `BufferSource` types + +All of the `BufferSource` types will throw when the relevant `ArrayBuffer` has been detached. This technically is not part of the [specified conversion algorithm](https://heycam.github.io/webidl/#es-buffer-source-types), but instead part of the [getting a reference/getting a copy](https://heycam.github.io/webidl/#ref-for-dfn-get-buffer-source-reference%E2%91%A0) algorithms. We've consolidated them here for convenience and ease of implementation, but if there is a need to separate them in the future, please open an issue so we can investigate. + +## Background + +What's actually going on here, conceptually, is pretty weird. Let's try to explain. + +Web IDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on Web IDL values, i.e. instances of Web IDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a Web IDL value of [Web IDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules. + +Separately from its type system, Web IDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given Web IDL operation, how does that get converted into a Web IDL value? For example, a JavaScript `true` passed in the position of a Web IDL `boolean` argument becomes a Web IDL `true`. But, a JavaScript `true` passed in the position of a [Web IDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a Web IDL `1`. And so on. + +Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the Web IDL algorithms, they don't actually use Web IDL values, since those aren't "real" outside of specs. Instead, implementations apply the Web IDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`. + +The upside of all this is that implementations can abstract all the conversion logic away, letting Web IDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of Web IDL, in a nutshell. + +And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given Web IDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ Web IDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ Web IDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a Web IDL `1` in an unsigned long context, which then becomes a JavaScript `1`. + +## Don't use this + +Seriously, why would you ever use this? You really shouldn't. Web IDL is … strange, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from Web IDL. In general, your JavaScript should not be trying to become more like Web IDL; if anything, we should fix Web IDL to make it more like JavaScript. + +The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in Web IDL. Its main consumer is the [jsdom](https://github.com/jsdom/jsdom) project. diff --git a/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.js b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.js new file mode 100644 index 00000000..0229347c --- /dev/null +++ b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.js @@ -0,0 +1,450 @@ +"use strict"; + +function makeException(ErrorType, message, options) { + if (options.globals) { + ErrorType = options.globals[ErrorType.name]; + } + return new ErrorType(`${options.context ? options.context : "Value"} ${message}.`); +} + +function toNumber(value, options) { + if (typeof value === "bigint") { + throw makeException(TypeError, "is a BigInt which cannot be converted to a number", options); + } + if (!options.globals) { + return Number(value); + } + return options.globals.Number(value); +} + +// Round x to the nearest integer, choosing the even integer if it lies halfway between two. +function evenRound(x) { + // There are four cases for numbers with fractional part being .5: + // + // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example + // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0 + // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2 + // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0 + // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2 + // (where n is a non-negative integer) + // + // Branch here for cases 1 and 4 + if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) || + (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) { + return censorNegativeZero(Math.floor(x)); + } + + return censorNegativeZero(Math.round(x)); +} + +function integerPart(n) { + return censorNegativeZero(Math.trunc(n)); +} + +function sign(x) { + return x < 0 ? -1 : 1; +} + +function modulo(x, y) { + // https://tc39.github.io/ecma262/#eqn-modulo + // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos + const signMightNotMatch = x % y; + if (sign(y) !== sign(signMightNotMatch)) { + return signMightNotMatch + y; + } + return signMightNotMatch; +} + +function censorNegativeZero(x) { + return x === 0 ? 0 : x; +} + +function createIntegerConversion(bitLength, { unsigned }) { + let lowerBound, upperBound; + if (unsigned) { + lowerBound = 0; + upperBound = 2 ** bitLength - 1; + } else { + lowerBound = -(2 ** (bitLength - 1)); + upperBound = 2 ** (bitLength - 1) - 1; + } + + const twoToTheBitLength = 2 ** bitLength; + const twoToOneLessThanTheBitLength = 2 ** (bitLength - 1); + + return (value, options = {}) => { + let x = toNumber(value, options); + x = censorNegativeZero(x); + + if (options.enforceRange) { + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite number", options); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + + return x; + } + + if (!Number.isNaN(x) && options.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + x = integerPart(x); + + // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if + // possible. Hopefully it's an optimization for the non-64-bitLength cases too. + if (x >= lowerBound && x <= upperBound) { + return x; + } + + // These will not work great for bitLength of 64, but oh well. See the README for more details. + x = modulo(x, twoToTheBitLength); + if (!unsigned && x >= twoToOneLessThanTheBitLength) { + return x - twoToTheBitLength; + } + return x; + }; +} + +function createLongLongConversion(bitLength, { unsigned }) { + const upperBound = Number.MAX_SAFE_INTEGER; + const lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; + const asBigIntN = unsigned ? BigInt.asUintN : BigInt.asIntN; + + return (value, options = {}) => { + let x = toNumber(value, options); + x = censorNegativeZero(x); + + if (options.enforceRange) { + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite number", options); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + + return x; + } + + if (!Number.isNaN(x) && options.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + + let xBigInt = BigInt(integerPart(x)); + xBigInt = asBigIntN(bitLength, xBigInt); + return Number(xBigInt); + }; +} + +exports.any = value => { + return value; +}; + +exports.undefined = () => { + return undefined; +}; + +exports.boolean = value => { + return Boolean(value); +}; + +exports.byte = createIntegerConversion(8, { unsigned: false }); +exports.octet = createIntegerConversion(8, { unsigned: true }); + +exports.short = createIntegerConversion(16, { unsigned: false }); +exports["unsigned short"] = createIntegerConversion(16, { unsigned: true }); + +exports.long = createIntegerConversion(32, { unsigned: false }); +exports["unsigned long"] = createIntegerConversion(32, { unsigned: true }); + +exports["long long"] = createLongLongConversion(64, { unsigned: false }); +exports["unsigned long long"] = createLongLongConversion(64, { unsigned: true }); + +exports.double = (value, options = {}) => { + const x = toNumber(value, options); + + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + + return x; +}; + +exports["unrestricted double"] = (value, options = {}) => { + const x = toNumber(value, options); + + return x; +}; + +exports.float = (value, options = {}) => { + const x = toNumber(value, options); + + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + + if (Object.is(x, -0)) { + return x; + } + + const y = Math.fround(x); + + if (!Number.isFinite(y)) { + throw makeException(TypeError, "is outside the range of a single-precision floating-point value", options); + } + + return y; +}; + +exports["unrestricted float"] = (value, options = {}) => { + const x = toNumber(value, options); + + if (isNaN(x)) { + return x; + } + + if (Object.is(x, -0)) { + return x; + } + + return Math.fround(x); +}; + +exports.DOMString = (value, options = {}) => { + if (options.treatNullAsEmptyString && value === null) { + return ""; + } + + if (typeof value === "symbol") { + throw makeException(TypeError, "is a symbol, which cannot be converted to a string", options); + } + + const StringCtor = options.globals ? options.globals.String : String; + return StringCtor(value); +}; + +exports.ByteString = (value, options = {}) => { + const x = exports.DOMString(value, options); + let c; + for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw makeException(TypeError, "is not a valid ByteString", options); + } + } + + return x; +}; + +exports.USVString = (value, options = {}) => { + const S = exports.DOMString(value, options); + const n = S.length; + const U = []; + for (let i = 0; i < n; ++i) { + const c = S.charCodeAt(i); + if (c < 0xD800 || c > 0xDFFF) { + U.push(String.fromCodePoint(c)); + } else if (0xDC00 <= c && c <= 0xDFFF) { + U.push(String.fromCodePoint(0xFFFD)); + } else if (i === n - 1) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + const d = S.charCodeAt(i + 1); + if (0xDC00 <= d && d <= 0xDFFF) { + const a = c & 0x3FF; + const b = d & 0x3FF; + U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xFFFD)); + } + } + } + + return U.join(""); +}; + +exports.object = (value, options = {}) => { + if (value === null || (typeof value !== "object" && typeof value !== "function")) { + throw makeException(TypeError, "is not an object", options); + } + + return value; +}; + +const abByteLengthGetter = + Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; +const sabByteLengthGetter = + typeof SharedArrayBuffer === "function" ? + Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get : + null; + +function isNonSharedArrayBuffer(value) { + try { + // This will throw on SharedArrayBuffers, but not detached ArrayBuffers. + // (The spec says it should throw, but the spec conflicts with implementations: https://github.com/tc39/ecma262/issues/678) + abByteLengthGetter.call(value); + + return true; + } catch { + return false; + } +} + +function isSharedArrayBuffer(value) { + try { + sabByteLengthGetter.call(value); + return true; + } catch { + return false; + } +} + +function isArrayBufferDetached(value) { + try { + // eslint-disable-next-line no-new + new Uint8Array(value); + return false; + } catch { + return true; + } +} + +exports.ArrayBuffer = (value, options = {}) => { + if (!isNonSharedArrayBuffer(value)) { + if (options.allowShared && !isSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options); + } + throw makeException(TypeError, "is not an ArrayBuffer", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + + return value; +}; + +const dvByteLengthGetter = + Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; +exports.DataView = (value, options = {}) => { + try { + dvByteLengthGetter.call(value); + } catch (e) { + throw makeException(TypeError, "is not a DataView", options); + } + + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is backed by a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is backed by a detached ArrayBuffer", options); + } + + return value; +}; + +// Returns the unforgeable `TypedArray` constructor name or `undefined`, +// if the `this` value isn't a valid `TypedArray` object. +// +// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag +const typedArrayNameGetter = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf(Uint8Array).prototype, + Symbol.toStringTag +).get; +[ + Int8Array, + Int16Array, + Int32Array, + Uint8Array, + Uint16Array, + Uint32Array, + Uint8ClampedArray, + Float32Array, + Float64Array +].forEach(func => { + const { name } = func; + const article = /^[AEIOU]/u.test(name) ? "an" : "a"; + exports[name] = (value, options = {}) => { + if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) { + throw makeException(TypeError, `is not ${article} ${name} object`, options); + } + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + + return value; + }; +}); + +// Common definitions + +exports.ArrayBufferView = (value, options = {}) => { + if (!ArrayBuffer.isView(value)) { + throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options); + } + + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; +}; + +exports.BufferSource = (value, options = {}) => { + if (ArrayBuffer.isView(value)) { + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; + } + + if (!options.allowShared && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or a view on one", options); + } + if (options.allowShared && !isSharedArrayBuffer(value) && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer, SharedArrayBuffer, or a view on one", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + + return value; +}; + +exports.DOMTimeStamp = exports["unsigned long long"]; diff --git a/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/package.json b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/package.json new file mode 100644 index 00000000..20747bb4 --- /dev/null +++ b/backend/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/package.json @@ -0,0 +1,35 @@ +{ + "name": "webidl-conversions", + "version": "7.0.0", + "description": "Implements the WebIDL algorithms for converting to and from JavaScript values", + "main": "lib/index.js", + "scripts": { + "lint": "eslint .", + "test": "mocha test/*.js", + "test-no-sab": "mocha --parallel --jobs 2 --require test/helpers/delete-sab.js test/*.js", + "coverage": "nyc mocha test/*.js" + }, + "_scripts_comments": { + "test-no-sab": "Node.js internals are broken by deleting SharedArrayBuffer if you run tests on the main thread. Using Mocha's parallel mode avoids this." + }, + "repository": "jsdom/webidl-conversions", + "keywords": [ + "webidl", + "web", + "types" + ], + "files": [ + "lib/" + ], + "author": "Domenic Denicola (https://domenic.me/)", + "license": "BSD-2-Clause", + "devDependencies": { + "@domenic/eslint-config": "^1.3.0", + "eslint": "^7.32.0", + "mocha": "^9.1.1", + "nyc": "^15.1.0" + }, + "engines": { + "node": ">=12" + } +} diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/LICENSE.txt b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/LICENSE.txt new file mode 100644 index 00000000..4220dead --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright © Domenic Denicola + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/README.md b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/README.md new file mode 100644 index 00000000..1e1962ce --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/README.md @@ -0,0 +1,101 @@ +# Parse, serialize, and manipulate MIME types + +This package will parse [MIME types](https://mimesniff.spec.whatwg.org/#understanding-mime-types) into a structured format, which can then be manipulated and serialized: + +```js +const MIMEType = require("whatwg-mimetype"); + +const mimeType = new MIMEType(`Text/HTML;Charset="utf-8"`); + +console.assert(mimeType.toString() === "text/html;charset=utf-8"); + +console.assert(mimeType.type === "text"); +console.assert(mimeType.subtype === "html"); +console.assert(mimeType.essence === "text/html"); +console.assert(mimeType.parameters.get("charset") === "utf-8"); + +mimeType.parameters.set("charset", "windows-1252"); +console.assert(mimeType.parameters.get("charset") === "windows-1252"); +console.assert(mimeType.toString() === "text/html;charset=windows-1252"); + +console.assert(mimeType.isHTML() === true); +console.assert(mimeType.isXML() === false); +``` + +Parsing is a fairly complex process; see [the specification](https://mimesniff.spec.whatwg.org/#parsing-a-mime-type) for details (and similarly [for serialization](https://mimesniff.spec.whatwg.org/#serializing-a-mime-type)). + +This package's algorithms conform to those of the WHATWG [MIME Sniffing Standard](https://mimesniff.spec.whatwg.org/), and is aligned up to commit [8e9a7dd](https://github.com/whatwg/mimesniff/commit/8e9a7dd90717c595a4e4d982cd216e4411d33736). + +## `MIMEType` API + +This package's main module's default export is a class, `MIMEType`. Its constructor takes a string which it will attempt to parse into a MIME type; if parsing fails, an `Error` will be thrown. + +### The `parse()` static factory method + +As an alternative to the constructor, you can use `MIMEType.parse(string)`. The only difference is that `parse()` will return `null` on failed parsing, whereas the constructor will throw. It thus makes the most sense to use the constructor in cases where unparseable MIME types would be exceptional, and use `parse()` when dealing with input from some unconstrained source. + +### Properties + +- `type`: the MIME type's [type](https://mimesniff.spec.whatwg.org/#mime-type-type), e.g. `"text"` +- `subtype`: the MIME type's [subtype](https://mimesniff.spec.whatwg.org/#mime-type-subtype), e.g. `"html"` +- `essence`: the MIME type's [essence](https://mimesniff.spec.whatwg.org/#mime-type-essence), e.g. `"text/html"` +- `parameters`: an instance of `MIMETypeParameters`, containing this MIME type's [parameters](https://mimesniff.spec.whatwg.org/#mime-type-parameters) + +`type` and `subtype` can be changed. They will be validated to be non-empty and only contain [HTTP token code points](https://mimesniff.spec.whatwg.org/#http-token-code-point). + +`essence` is only a getter, and cannot be changed. + +`parameters` is also a getter, but the contents of the `MIMETypeParameters` object are mutable, as described below. + +### Methods + +- `toString()` serializes the MIME type to a string +- `isHTML()`: returns true if this instance represents [a HTML MIME type](https://mimesniff.spec.whatwg.org/#html-mime-type) +- `isXML()`: returns true if this instance represents [an XML MIME type](https://mimesniff.spec.whatwg.org/#xml-mime-type) +- `isJavaScript({ prohibitParameters })`: returns true if this instance represents [a JavaScript MIME type](https://html.spec.whatwg.org/multipage/scripting.html#javascript-mime-type). `prohibitParameters` can be set to true to disallow any parameters, i.e. to test if the MIME type's serialization is a [JavaScript MIME type essence match](https://mimesniff.spec.whatwg.org/#javascript-mime-type-essence-match). + +_Note: the `isHTML()`, `isXML()`, and `isJavaScript()` methods are speculative, and may be removed or changed in future major versions. See [whatwg/mimesniff#48](https://github.com/whatwg/mimesniff/issues/48) for brainstorming in this area. Currently we implement these mainly because they are useful in jsdom._ + +## `MIMETypeParameters` API + +The `MIMETypeParameters` class, instances of which are returned by `mimeType.parameters`, has equivalent surface API to a [JavaScript `Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). + +However, `MIMETypeParameters` methods will always interpret their arguments as appropriate for MIME types, so e.g. parameter names will be lowercased, and attempting to set invalid characters will throw. + +Some examples: + +```js +const mimeType = new MIMEType(`x/x;a=b;c=D;E="F"`); + +// Logs: +// a b +// c D +// e F +for (const [name, value] of mimeType.parameters) { + console.log(name, value); +} + +console.assert(mimeType.parameters.has("a")); +console.assert(mimeType.parameters.has("A")); +console.assert(mimeType.parameters.get("A") === "b"); + +mimeType.parameters.set("Q", "X"); +console.assert(mimeType.parameters.get("q") === "X"); +console.assert(mimeType.toString() === "x/x;a=b;c=d;e=F;q=X"); + +// Throws: +mimeType.parameters.set("@", "x"); +``` + +## Raw parsing/serialization APIs + +If you want primitives on which to build your own API, you can get direct access to the parsing and serialization algorithms as follows: + +```js +const parse = require("whatwg-mimetype/parser"); +const serialize = require("whatwg-mimetype/serialize"); +``` + +`parse(string)` returns an object containing the `type` and `subtype` strings, plus `parameters`, which is a `Map`. This is roughly our equivalent of the spec's [MIME type record](https://mimesniff.spec.whatwg.org/#mime-type). If parsing fails, it instead returns `null`. + +`serialize(record)` operates on the such an object, giving back a string according to the serialization algorithm. diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type-parameters.js b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type-parameters.js new file mode 100644 index 00000000..ea4b2f07 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type-parameters.js @@ -0,0 +1,70 @@ +"use strict"; +const { + asciiLowercase, + solelyContainsHTTPTokenCodePoints, + soleyContainsHTTPQuotedStringTokenCodePoints +} = require("./utils.js"); + +module.exports = class MIMETypeParameters { + constructor(map) { + this._map = map; + } + + get size() { + return this._map.size; + } + + get(name) { + name = asciiLowercase(String(name)); + return this._map.get(name); + } + + has(name) { + name = asciiLowercase(String(name)); + return this._map.has(name); + } + + set(name, value) { + name = asciiLowercase(String(name)); + value = String(value); + + if (!solelyContainsHTTPTokenCodePoints(name)) { + throw new Error(`Invalid MIME type parameter name "${name}": only HTTP token code points are valid.`); + } + if (!soleyContainsHTTPQuotedStringTokenCodePoints(value)) { + throw new Error(`Invalid MIME type parameter value "${value}": only HTTP quoted-string token code points are ` + + `valid.`); + } + + return this._map.set(name, value); + } + + clear() { + this._map.clear(); + } + + delete(name) { + name = asciiLowercase(String(name)); + return this._map.delete(name); + } + + forEach(callbackFn, thisArg) { + this._map.forEach(callbackFn, thisArg); + } + + keys() { + return this._map.keys(); + } + + values() { + return this._map.values(); + } + + entries() { + return this._map.entries(); + } + + [Symbol.iterator]() { + return this._map[Symbol.iterator](); + } +}; diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type.js b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type.js new file mode 100644 index 00000000..d0d0ddad --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/mime-type.js @@ -0,0 +1,127 @@ +"use strict"; +const MIMETypeParameters = require("./mime-type-parameters.js"); +const parse = require("./parser.js"); +const serialize = require("./serializer.js"); +const { + asciiLowercase, + solelyContainsHTTPTokenCodePoints +} = require("./utils.js"); + +module.exports = class MIMEType { + constructor(string) { + string = String(string); + const result = parse(string); + if (result === null) { + throw new Error(`Could not parse MIME type string "${string}"`); + } + + this._type = result.type; + this._subtype = result.subtype; + this._parameters = new MIMETypeParameters(result.parameters); + } + + static parse(string) { + try { + return new this(string); + } catch (e) { + return null; + } + } + + get essence() { + return `${this.type}/${this.subtype}`; + } + + get type() { + return this._type; + } + + set type(value) { + value = asciiLowercase(String(value)); + + if (value.length === 0) { + throw new Error("Invalid type: must be a non-empty string"); + } + if (!solelyContainsHTTPTokenCodePoints(value)) { + throw new Error(`Invalid type ${value}: must contain only HTTP token code points`); + } + + this._type = value; + } + + get subtype() { + return this._subtype; + } + + set subtype(value) { + value = asciiLowercase(String(value)); + + if (value.length === 0) { + throw new Error("Invalid subtype: must be a non-empty string"); + } + if (!solelyContainsHTTPTokenCodePoints(value)) { + throw new Error(`Invalid subtype ${value}: must contain only HTTP token code points`); + } + + this._subtype = value; + } + + get parameters() { + return this._parameters; + } + + toString() { + // The serialize function works on both "MIME type records" (i.e. the results of parse) and on this class, since + // this class's interface is identical. + return serialize(this); + } + + isJavaScript({ prohibitParameters = false } = {}) { + switch (this._type) { + case "text": { + switch (this._subtype) { + case "ecmascript": + case "javascript": + case "javascript1.0": + case "javascript1.1": + case "javascript1.2": + case "javascript1.3": + case "javascript1.4": + case "javascript1.5": + case "jscript": + case "livescript": + case "x-ecmascript": + case "x-javascript": { + return !prohibitParameters || this._parameters.size === 0; + } + default: { + return false; + } + } + } + case "application": { + switch (this._subtype) { + case "ecmascript": + case "javascript": + case "x-ecmascript": + case "x-javascript": { + return !prohibitParameters || this._parameters.size === 0; + } + default: { + return false; + } + } + } + default: { + return false; + } + } + } + isXML() { + return (this._subtype === "xml" && (this._type === "text" || this._type === "application")) || + this._subtype.endsWith("+xml"); + } + isHTML() { + return this._subtype === "html" && this._type === "text"; + } +}; diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/parser.js b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/parser.js new file mode 100644 index 00000000..8eddbaf1 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/parser.js @@ -0,0 +1,105 @@ +"use strict"; +const { + removeLeadingAndTrailingHTTPWhitespace, + removeTrailingHTTPWhitespace, + isHTTPWhitespaceChar, + solelyContainsHTTPTokenCodePoints, + soleyContainsHTTPQuotedStringTokenCodePoints, + asciiLowercase, + collectAnHTTPQuotedString +} = require("./utils.js"); + +module.exports = input => { + input = removeLeadingAndTrailingHTTPWhitespace(input); + + let position = 0; + let type = ""; + while (position < input.length && input[position] !== "/") { + type += input[position]; + ++position; + } + + if (type.length === 0 || !solelyContainsHTTPTokenCodePoints(type)) { + return null; + } + + if (position >= input.length) { + return null; + } + + // Skips past "/" + ++position; + + let subtype = ""; + while (position < input.length && input[position] !== ";") { + subtype += input[position]; + ++position; + } + + subtype = removeTrailingHTTPWhitespace(subtype); + + if (subtype.length === 0 || !solelyContainsHTTPTokenCodePoints(subtype)) { + return null; + } + + const mimeType = { + type: asciiLowercase(type), + subtype: asciiLowercase(subtype), + parameters: new Map() + }; + + while (position < input.length) { + // Skip past ";" + ++position; + + while (isHTTPWhitespaceChar(input[position])) { + ++position; + } + + let parameterName = ""; + while (position < input.length && input[position] !== ";" && input[position] !== "=") { + parameterName += input[position]; + ++position; + } + parameterName = asciiLowercase(parameterName); + + if (position < input.length) { + if (input[position] === ";") { + continue; + } + + // Skip past "=" + ++position; + } + + let parameterValue = null; + if (input[position] === "\"") { + [parameterValue, position] = collectAnHTTPQuotedString(input, position); + + while (position < input.length && input[position] !== ";") { + ++position; + } + } else { + parameterValue = ""; + while (position < input.length && input[position] !== ";") { + parameterValue += input[position]; + ++position; + } + + parameterValue = removeTrailingHTTPWhitespace(parameterValue); + + if (parameterValue === "") { + continue; + } + } + + if (parameterName.length > 0 && + solelyContainsHTTPTokenCodePoints(parameterName) && + soleyContainsHTTPQuotedStringTokenCodePoints(parameterValue) && + !mimeType.parameters.has(parameterName)) { + mimeType.parameters.set(parameterName, parameterValue); + } + } + + return mimeType; +}; diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/serializer.js b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/serializer.js new file mode 100644 index 00000000..2d7aaf00 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/serializer.js @@ -0,0 +1,25 @@ +"use strict"; +const { solelyContainsHTTPTokenCodePoints } = require("./utils.js"); + +module.exports = mimeType => { + let serialization = `${mimeType.type}/${mimeType.subtype}`; + + if (mimeType.parameters.size === 0) { + return serialization; + } + + for (let [name, value] of mimeType.parameters) { + serialization += ";"; + serialization += name; + serialization += "="; + + if (!solelyContainsHTTPTokenCodePoints(value) || value.length === 0) { + value = value.replace(/(["\\])/ug, "\\$1"); + value = `"${value}"`; + } + + serialization += value; + } + + return serialization; +}; diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.js b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.js new file mode 100644 index 00000000..5a814fc6 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/lib/utils.js @@ -0,0 +1,60 @@ +"use strict"; + +exports.removeLeadingAndTrailingHTTPWhitespace = string => { + return string.replace(/^[ \t\n\r]+/u, "").replace(/[ \t\n\r]+$/u, ""); +}; + +exports.removeTrailingHTTPWhitespace = string => { + return string.replace(/[ \t\n\r]+$/u, ""); +}; + +exports.isHTTPWhitespaceChar = char => { + return char === " " || char === "\t" || char === "\n" || char === "\r"; +}; + +exports.solelyContainsHTTPTokenCodePoints = string => { + return /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(string); +}; + +exports.soleyContainsHTTPQuotedStringTokenCodePoints = string => { + return /^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(string); +}; + +exports.asciiLowercase = string => { + return string.replace(/[A-Z]/ug, l => l.toLowerCase()); +}; + +// This variant only implements it with the extract-value flag set. +exports.collectAnHTTPQuotedString = (input, position) => { + let value = ""; + + position++; + + while (true) { + while (position < input.length && input[position] !== "\"" && input[position] !== "\\") { + value += input[position]; + ++position; + } + + if (position >= input.length) { + break; + } + + const quoteOrBackslash = input[position]; + ++position; + + if (quoteOrBackslash === "\\") { + if (position >= input.length) { + value += "\\"; + break; + } + + value += input[position]; + ++position; + } else { + break; + } + } + + return [value, position]; +}; diff --git a/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/package.json b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/package.json new file mode 100644 index 00000000..ff098c11 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-mimetype@4.0.0/node_modules/whatwg-mimetype/package.json @@ -0,0 +1,45 @@ +{ + "name": "whatwg-mimetype", + "description": "Parses, serializes, and manipulates MIME types, according to the WHATWG MIME Sniffing Standard", + "keywords": [ + "content-type", + "mime type", + "mimesniff", + "http", + "whatwg" + ], + "version": "4.0.0", + "author": "Domenic Denicola (https://domenic.me/)", + "license": "MIT", + "repository": "jsdom/whatwg-mimetype", + "main": "lib/mime-type.js", + "files": [ + "lib/" + ], + "scripts": { + "test": "node --test", + "coverage": "c8 node --test --experimental-test-coverage", + "lint": "eslint .", + "pretest": "node scripts/get-latest-platform-tests.js" + }, + "devDependencies": { + "@domenic/eslint-config": "^3.0.0", + "c8": "^8.0.1", + "eslint": "^8.53.0", + "printable-string": "^0.3.0", + "whatwg-encoding": "^3.0.0" + }, + "engines": { + "node": ">=18" + }, + "c8": { + "reporter": [ + "text", + "html" + ], + "exclude": [ + "scripts/", + "test/" + ] + } +} diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/tr46 b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/tr46 new file mode 120000 index 00000000..ea4d0197 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/tr46 @@ -0,0 +1 @@ +../../tr46@5.1.1/node_modules/tr46 \ No newline at end of file diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/webidl-conversions b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/webidl-conversions new file mode 120000 index 00000000..97511cc2 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/webidl-conversions @@ -0,0 +1 @@ +../../webidl-conversions@7.0.0/node_modules/webidl-conversions \ No newline at end of file diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/LICENSE.txt b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/LICENSE.txt new file mode 100644 index 00000000..8e8c25c3 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sebastian Mayr + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/README.md b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/README.md new file mode 100644 index 00000000..322766fb --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/README.md @@ -0,0 +1,106 @@ +# whatwg-url + +whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/jsdom/jsdom). + +## Specification conformance + +whatwg-url is currently up to date with the URL spec up to commit [6c78200](https://github.com/whatwg/url/commit/6c782003a2d53b1feecd072d1006eb8f1d65fb2d). + +For `file:` URLs, whose [origin is left unspecified](https://url.spec.whatwg.org/#concept-url-origin), whatwg-url chooses to use a new opaque origin (which serializes to `"null"`). + +whatwg-url does not yet implement any encoding handling beyond UTF-8. That is, the _encoding override_ parameter does not exist in our API. + +## API + +### The `URL` and `URLSearchParams` classes + +The main API is provided by the [`URL`](https://url.spec.whatwg.org/#url-class) and [`URLSearchParams`](https://url.spec.whatwg.org/#interface-urlsearchparams) exports, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use these. + +### Low-level URL Standard API + +The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They mostly operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type. + +- [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL })` +- [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, url, stateOverride })` +- [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)` +- [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)` +- [URL path serializer](https://url.spec.whatwg.org/#url-path-serializer): `serializePath(urlRecord)` +- [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)` +- [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin): `serializeURLOrigin(urlRecord)` +- [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)` +- [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)` +- [Has an opaque path](https://url.spec.whatwg.org/#url-opaque-path): `hasAnOpaquePath(urlRecord)` +- [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` +- [Percent decode bytes](https://url.spec.whatwg.org/#percent-decode): `percentDecodeBytes(uint8Array)` +- [Percent decode a string](https://url.spec.whatwg.org/#string-percent-decode): `percentDecodeString(string)` + +The `stateOverride` parameter is one of the following strings: + +- [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state) +- [`"scheme"`](https://url.spec.whatwg.org/#scheme-state) +- [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state) +- [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state) +- [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state) +- [`"relative"`](https://url.spec.whatwg.org/#relative-state) +- [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state) +- [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state) +- [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state) +- [`"authority"`](https://url.spec.whatwg.org/#authority-state) +- [`"host"`](https://url.spec.whatwg.org/#host-state) +- [`"hostname"`](https://url.spec.whatwg.org/#hostname-state) +- [`"port"`](https://url.spec.whatwg.org/#port-state) +- [`"file"`](https://url.spec.whatwg.org/#file-state) +- [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state) +- [`"file host"`](https://url.spec.whatwg.org/#file-host-state) +- [`"path start"`](https://url.spec.whatwg.org/#path-start-state) +- [`"path"`](https://url.spec.whatwg.org/#path-state) +- [`"opaque path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state) +- [`"query"`](https://url.spec.whatwg.org/#query-state) +- [`"fragment"`](https://url.spec.whatwg.org/#fragment-state) + +The URL record type has the following API: + +- [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme) +- [`username`](https://url.spec.whatwg.org/#concept-url-username) +- [`password`](https://url.spec.whatwg.org/#concept-url-password) +- [`host`](https://url.spec.whatwg.org/#concept-url-host) +- [`port`](https://url.spec.whatwg.org/#concept-url-port) +- [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array of strings, or a string) +- [`query`](https://url.spec.whatwg.org/#concept-url-query) +- [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment) + +These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state. + +The return value of "failure" in the spec is represented by `null`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ `null`. + +### `whatwg-url/webidl2js-wrapper` module + +This module exports the `URL` and `URLSearchParams` [interface wrappers API](https://github.com/jsdom/webidl2js#for-interfaces) generated by [webidl2js](https://github.com/jsdom/webidl2js). + +## Development instructions + +First, install [Node.js](https://nodejs.org/). Then, fetch the dependencies of whatwg-url, by running from this directory: + + npm install + +To run tests: + + npm test + +To generate a coverage report: + + npm run coverage + +To build and run the live viewer: + + npm run prepare + npm run build-live-viewer + +Serve the contents of the `live-viewer` directory using any web server. + +## Supporting whatwg-url + +The jsdom project (including whatwg-url) is a community-driven project maintained by a team of [volunteers](https://github.com/orgs/jsdom/people). You could support us by: + +- [Getting professional support for whatwg-url](https://tidelift.com/subscription/pkg/npm-whatwg-url?utm_source=npm-whatwg-url&utm_medium=referral&utm_campaign=readme) as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security. +- Contributing directly to the project. diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.js new file mode 100644 index 00000000..c470e48e --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.js @@ -0,0 +1,27 @@ +"use strict"; + +const { URL, URLSearchParams } = require("./webidl2js-wrapper"); +const urlStateMachine = require("./lib/url-state-machine"); +const percentEncoding = require("./lib/percent-encoding"); + +const sharedGlobalObject = { Array, Object, Promise, String, TypeError }; +URL.install(sharedGlobalObject, ["Window"]); +URLSearchParams.install(sharedGlobalObject, ["Window"]); + +exports.URL = sharedGlobalObject.URL; +exports.URLSearchParams = sharedGlobalObject.URLSearchParams; + +exports.parseURL = urlStateMachine.parseURL; +exports.basicURLParse = urlStateMachine.basicURLParse; +exports.serializeURL = urlStateMachine.serializeURL; +exports.serializePath = urlStateMachine.serializePath; +exports.serializeHost = urlStateMachine.serializeHost; +exports.serializeInteger = urlStateMachine.serializeInteger; +exports.serializeURLOrigin = urlStateMachine.serializeURLOrigin; +exports.setTheUsername = urlStateMachine.setTheUsername; +exports.setThePassword = urlStateMachine.setThePassword; +exports.cannotHaveAUsernamePasswordPort = urlStateMachine.cannotHaveAUsernamePasswordPort; +exports.hasAnOpaquePath = urlStateMachine.hasAnOpaquePath; + +exports.percentDecodeString = percentEncoding.percentDecodeString; +exports.percentDecodeBytes = percentEncoding.percentDecodeBytes; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.js new file mode 100644 index 00000000..ea8712fd --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.js @@ -0,0 +1,42 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (typeof value !== "function") { + throw new globalObject.TypeError(context + " is not a function"); + } + + function invokeTheCallbackFunction(...args) { + const thisArg = utils.tryWrapperForImpl(this); + let callResult; + + for (let i = 0; i < args.length; i++) { + args[i] = utils.tryWrapperForImpl(args[i]); + } + + callResult = Reflect.apply(value, thisArg, args); + + callResult = conversions["any"](callResult, { context: context, globals: globalObject }); + + return callResult; + } + + invokeTheCallbackFunction.construct = (...args) => { + for (let i = 0; i < args.length; i++) { + args[i] = utils.tryWrapperForImpl(args[i]); + } + + let callResult = Reflect.construct(value, args); + + callResult = conversions["any"](callResult, { context: context, globals: globalObject }); + + return callResult; + }; + + invokeTheCallbackFunction[utils.wrapperSymbol] = value; + invokeTheCallbackFunction.objectReference = value; + + return invokeTheCallbackFunction; +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.js new file mode 100644 index 00000000..06b0ddc3 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.js @@ -0,0 +1,233 @@ +"use strict"; +const usm = require("./url-state-machine"); +const urlencoded = require("./urlencoded"); +const URLSearchParams = require("./URLSearchParams"); + +exports.implementation = class URLImpl { + // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error + // messages in the constructor that distinguish between the different causes of failure. + constructor(globalObject, [url, base]) { + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + throw new TypeError(`Invalid base URL: ${base}`); + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${url}`); + } + + const query = parsedURL.query !== null ? parsedURL.query : ""; + + this._url = parsedURL; + + // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips + // question mark by default. Therefore the doNotStripQMark hack is used. + this._query = URLSearchParams.createImpl(globalObject, [query], { doNotStripQMark: true }); + this._query._url = this; + } + + static parse(globalObject, input, base) { + try { + return new URLImpl(globalObject, [input, base]); + } catch { + return null; + } + } + + static canParse(url, base) { + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + return false; + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + return false; + } + + return true; + } + + get href() { + return usm.serializeURL(this._url); + } + + set href(v) { + const parsedURL = usm.basicURLParse(v); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${v}`); + } + + this._url = parsedURL; + + this._query._list.splice(0); + const { query } = parsedURL; + if (query !== null) { + this._query._list = urlencoded.parseUrlencodedString(query); + } + } + + get origin() { + return usm.serializeURLOrigin(this._url); + } + + get protocol() { + return `${this._url.scheme}:`; + } + + set protocol(v) { + usm.basicURLParse(`${v}:`, { url: this._url, stateOverride: "scheme start" }); + } + + get username() { + return this._url.username; + } + + set username(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setTheUsername(this._url, v); + } + + get password() { + return this._url.password; + } + + set password(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setThePassword(this._url, v); + } + + get host() { + const url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return usm.serializeHost(url.host); + } + + return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`; + } + + set host(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); + } + + get hostname() { + if (this._url.host === null) { + return ""; + } + + return usm.serializeHost(this._url.host); + } + + set hostname(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); + } + + get port() { + if (this._url.port === null) { + return ""; + } + + return usm.serializeInteger(this._url.port); + } + + set port(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); + } + } + + get pathname() { + return usm.serializePath(this._url); + } + + set pathname(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + this._url.path = []; + usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); + } + + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return `?${this._url.query}`; + } + + set search(v) { + const url = this._url; + + if (v === "") { + url.query = null; + this._query._list = []; + return; + } + + const input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + this._query._list = urlencoded.parseUrlencodedString(input); + } + + get searchParams() { + return this._query; + } + + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return `#${this._url.fragment}`; + } + + set hash(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + const input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + + toJSON() { + return this.href; + } +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.js new file mode 100644 index 00000000..53a47f23 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.js @@ -0,0 +1,499 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +const implSymbol = utils.implSymbol; +const ctorRegistrySymbol = utils.ctorRegistrySymbol; + +const interfaceName = "URL"; + +exports.is = value => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; +}; +exports.isImpl = value => { + return utils.isObject(value) && value instanceof Impl.implementation; +}; +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URL'.`); +}; + +function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== undefined) { + proto = newTarget.prototype; + } + + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URL"].prototype; + } + + return Object.create(proto); +} + +exports.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports.setup(wrapper, globalObject, constructorArgs, privateData); +}; + +exports.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); +}; + +exports._internalSetup = (wrapper, globalObject) => {}; + +exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; +}; + +exports.new = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; +}; + +const exposed = new Set(["Window", "Worker"]); + +exports.install = (globalObject, globalNames) => { + if (!globalNames.some(globalName => exposed.has(globalName))) { + return; + } + + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URL { + constructor(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return exports.setup(Object.create(new.target.prototype), globalObject, args); + } + + toJSON() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol].toJSON(); + } + + get href() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["href"]; + } + + set href(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'href' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["href"] = V; + } + + toString() { + const esValue = this; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["href"]; + } + + get origin() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["origin"]; + } + + get protocol() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["protocol"]; + } + + set protocol(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'protocol' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["protocol"] = V; + } + + get username() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["username"]; + } + + set username(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'username' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["username"] = V; + } + + get password() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["password"]; + } + + set password(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'password' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["password"] = V; + } + + get host() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["host"]; + } + + set host(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'host' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["host"] = V; + } + + get hostname() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["hostname"]; + } + + set hostname(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'hostname' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["hostname"] = V; + } + + get port() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["port"]; + } + + set port(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'port' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["port"] = V; + } + + get pathname() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["pathname"]; + } + + set pathname(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'pathname' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["pathname"] = V; + } + + get search() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["search"]; + } + + set search(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'search' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["search"] = V; + } + + get searchParams() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL."); + } + + return utils.getSameObject(this, "searchParams", () => { + return utils.tryWrapperForImpl(esValue[implSymbol]["searchParams"]); + }); + } + + get hash() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["hash"]; + } + + set hash(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'hash' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["hash"] = V; + } + + static parse(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'parse' on 'URL': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'parse' on 'URL': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args)); + } + + static canParse(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'canParse' on 'URL': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'canParse' on 'URL': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return Impl.implementation.canParse(...args); + } + } + Object.defineProperties(URL.prototype, { + toJSON: { enumerable: true }, + href: { enumerable: true }, + toString: { enumerable: true }, + origin: { enumerable: true }, + protocol: { enumerable: true }, + username: { enumerable: true }, + password: { enumerable: true }, + host: { enumerable: true }, + hostname: { enumerable: true }, + port: { enumerable: true }, + pathname: { enumerable: true }, + search: { enumerable: true }, + searchParams: { enumerable: true }, + hash: { enumerable: true }, + [Symbol.toStringTag]: { value: "URL", configurable: true } + }); + Object.defineProperties(URL, { parse: { enumerable: true }, canParse: { enumerable: true } }); + ctorRegistry[interfaceName] = URL; + + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URL + }); + + if (globalNames.includes("Window")) { + Object.defineProperty(globalObject, "webkitURL", { + configurable: true, + writable: true, + value: URL + }); + } +}; + +const Impl = require("./URL-impl.js"); diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.js new file mode 100644 index 00000000..d929591f --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.js @@ -0,0 +1,135 @@ +"use strict"; +const urlencoded = require("./urlencoded"); + +exports.implementation = class URLSearchParamsImpl { + constructor(globalObject, constructorArgs, { doNotStripQMark = false }) { + let init = constructorArgs[0]; + this._list = []; + this._url = null; + + if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { + init = init.slice(1); + } + + if (Array.isArray(init)) { + for (const pair of init) { + if (pair.length !== 2) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " + + "contain exactly two elements."); + } + this._list.push([pair[0], pair[1]]); + } + } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { + for (const name of Object.keys(init)) { + const value = init[name]; + this._list.push([name, value]); + } + } else { + this._list = urlencoded.parseUrlencodedString(init); + } + } + + _updateSteps() { + if (this._url !== null) { + let serializedQuery = urlencoded.serializeUrlencoded(this._list); + if (serializedQuery === "") { + serializedQuery = null; + } + + this._url._url.query = serializedQuery; + } + } + + get size() { + return this._list.length; + } + + append(name, value) { + this._list.push([name, value]); + this._updateSteps(); + } + + delete(name, value) { + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name && (value === undefined || this._list[i][1] === value)) { + this._list.splice(i, 1); + } else { + i++; + } + } + this._updateSteps(); + } + + get(name) { + for (const tuple of this._list) { + if (tuple[0] === name) { + return tuple[1]; + } + } + return null; + } + + getAll(name) { + const output = []; + for (const tuple of this._list) { + if (tuple[0] === name) { + output.push(tuple[1]); + } + } + return output; + } + + has(name, value) { + for (const tuple of this._list) { + if (tuple[0] === name && (value === undefined || tuple[1] === value)) { + return true; + } + } + return false; + } + + set(name, value) { + let found = false; + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name) { + if (found) { + this._list.splice(i, 1); + } else { + found = true; + this._list[i][1] = value; + i++; + } + } else { + i++; + } + } + if (!found) { + this._list.push([name, value]); + } + this._updateSteps(); + } + + sort() { + this._list.sort((a, b) => { + if (a[0] < b[0]) { + return -1; + } + if (a[0] > b[0]) { + return 1; + } + return 0; + }); + + this._updateSteps(); + } + + [Symbol.iterator]() { + return this._list[Symbol.iterator](); + } + + toString() { + return urlencoded.serializeUrlencoded(this._list); + } +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.js new file mode 100644 index 00000000..a55587fa --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.js @@ -0,0 +1,505 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +const Function = require("./Function.js"); +const newObjectInRealm = utils.newObjectInRealm; +const implSymbol = utils.implSymbol; +const ctorRegistrySymbol = utils.ctorRegistrySymbol; + +const interfaceName = "URLSearchParams"; + +exports.is = value => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; +}; +exports.isImpl = value => { + return utils.isObject(value) && value instanceof Impl.implementation; +}; +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`); +}; + +exports.createDefaultIterator = (globalObject, target, kind) => { + const ctorRegistry = globalObject[ctorRegistrySymbol]; + const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"]; + const iterator = Object.create(iteratorPrototype); + Object.defineProperty(iterator, utils.iterInternalSymbol, { + value: { target, kind, index: 0 }, + configurable: true + }); + return iterator; +}; + +function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== undefined) { + proto = newTarget.prototype; + } + + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype; + } + + return Object.create(proto); +} + +exports.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports.setup(wrapper, globalObject, constructorArgs, privateData); +}; + +exports.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); +}; + +exports._internalSetup = (wrapper, globalObject) => {}; + +exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; +}; + +exports.new = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; +}; + +const exposed = new Set(["Window", "Worker"]); + +exports.install = (globalObject, globalNames) => { + if (!globalNames.some(globalName => exposed.has(globalName))) { + return; + } + + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URLSearchParams { + constructor() { + const args = []; + { + let curArg = arguments[0]; + if (curArg !== undefined) { + if (utils.isObject(curArg)) { + if (curArg[Symbol.iterator] !== undefined) { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object." + ); + } else { + const V = []; + const tmp = curArg; + for (let nextItem of tmp) { + if (!utils.isObject(nextItem)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + + " sequence" + + "'s element" + + " is not an iterable object." + ); + } else { + const V = []; + const tmp = nextItem; + for (let nextItem of tmp) { + nextItem = conversions["USVString"](nextItem, { + context: + "Failed to construct 'URLSearchParams': parameter 1" + + " sequence" + + "'s element" + + "'s element", + globals: globalObject + }); + + V.push(nextItem); + } + nextItem = V; + } + + V.push(nextItem); + } + curArg = V; + } + } else { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object." + ); + } else { + const result = Object.create(null); + for (const key of Reflect.ownKeys(curArg)) { + const desc = Object.getOwnPropertyDescriptor(curArg, key); + if (desc && desc.enumerable) { + let typedKey = key; + + typedKey = conversions["USVString"](typedKey, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key", + globals: globalObject + }); + + let typedValue = curArg[key]; + + typedValue = conversions["USVString"](typedValue, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value", + globals: globalObject + }); + + result[typedKey] = typedValue; + } + } + curArg = result; + } + } + } else { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URLSearchParams': parameter 1", + globals: globalObject + }); + } + } else { + curArg = ""; + } + args.push(curArg); + } + return exports.setup(Object.create(new.target.prototype), globalObject, args); + } + + append(name, value) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'append' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].append(...args)); + } + + delete(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'delete' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args)); + } + + get(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'get' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return esValue[implSymbol].get(...args); + } + + getAll(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'getAll' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args)); + } + + has(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return esValue[implSymbol].has(...args); + } + + set(name, value) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].set(...args)); + } + + sort() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams."); + } + + return utils.tryWrapperForImpl(esValue[implSymbol].sort()); + } + + toString() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'toString' called on an object that is not a valid instance of URLSearchParams." + ); + } + + return esValue[implSymbol].toString(); + } + + keys() { + if (!exports.is(this)) { + throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams."); + } + return exports.createDefaultIterator(globalObject, this, "key"); + } + + values() { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'values' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports.createDefaultIterator(globalObject, this, "value"); + } + + entries() { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'entries' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports.createDefaultIterator(globalObject, this, "key+value"); + } + + forEach(callback) { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'forEach' called on an object that is not a valid instance of URLSearchParams." + ); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + "Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present." + ); + } + callback = Function.convert(globalObject, callback, { + context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1" + }); + const thisArg = arguments[1]; + let pairs = Array.from(this[implSymbol]); + let i = 0; + while (i < pairs.length) { + const [key, value] = pairs[i].map(utils.tryWrapperForImpl); + callback.call(thisArg, value, key, this); + pairs = Array.from(this[implSymbol]); + i++; + } + } + + get size() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'get size' called on an object that is not a valid instance of URLSearchParams." + ); + } + + return esValue[implSymbol]["size"]; + } + } + Object.defineProperties(URLSearchParams.prototype, { + append: { enumerable: true }, + delete: { enumerable: true }, + get: { enumerable: true }, + getAll: { enumerable: true }, + has: { enumerable: true }, + set: { enumerable: true }, + sort: { enumerable: true }, + toString: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true }, + forEach: { enumerable: true }, + size: { enumerable: true }, + [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, + [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } + }); + ctorRegistry[interfaceName] = URLSearchParams; + + ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], { + [Symbol.toStringTag]: { + configurable: true, + value: "URLSearchParams Iterator" + } + }); + utils.define(ctorRegistry["URLSearchParams Iterator"], { + next() { + const internal = this && this[utils.iterInternalSymbol]; + if (!internal) { + throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object"); + } + + const { target, kind, index } = internal; + const values = Array.from(target[implSymbol]); + const len = values.length; + if (index >= len) { + return newObjectInRealm(globalObject, { value: undefined, done: true }); + } + + const pair = values[index]; + internal.index = index + 1; + return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind)); + } + }); + + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URLSearchParams + }); +}; + +const Impl = require("./URLSearchParams-impl.js"); diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/VoidFunction.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/VoidFunction.js new file mode 100644 index 00000000..9a00672a --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/VoidFunction.js @@ -0,0 +1,26 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (typeof value !== "function") { + throw new globalObject.TypeError(context + " is not a function"); + } + + function invokeTheCallbackFunction() { + const thisArg = utils.tryWrapperForImpl(this); + let callResult; + + callResult = Reflect.apply(value, thisArg, []); + } + + invokeTheCallbackFunction.construct = () => { + let callResult = Reflect.construct(value, []); + }; + + invokeTheCallbackFunction[utils.wrapperSymbol] = value; + invokeTheCallbackFunction.objectReference = value; + + return invokeTheCallbackFunction; +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.js new file mode 100644 index 00000000..cb66b8f1 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.js @@ -0,0 +1,16 @@ +"use strict"; +const utf8Encoder = new TextEncoder(); +const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); + +function utf8Encode(string) { + return utf8Encoder.encode(string); +} + +function utf8DecodeWithoutBOM(bytes) { + return utf8Decoder.decode(bytes); +} + +module.exports = { + utf8Encode, + utf8DecodeWithoutBOM +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.js new file mode 100644 index 00000000..4a984a3b --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.js @@ -0,0 +1,26 @@ +"use strict"; + +// Note that we take code points as JS numbers, not JS strings. + +function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; +} + +function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); +} + +function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); +} + +function isASCIIHex(c) { + return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); +} + +module.exports = { + isASCIIDigit, + isASCIIAlpha, + isASCIIAlphanumeric, + isASCIIHex +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.js new file mode 100644 index 00000000..8a89f12a --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.js @@ -0,0 +1,142 @@ +"use strict"; +const { isASCIIHex } = require("./infra"); +const { utf8Encode } = require("./encoding"); + +function p(char) { + return char.codePointAt(0); +} + +// https://url.spec.whatwg.org/#percent-encode +function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = `0${hex}`; + } + + return `%${hex}`; +} + +// https://url.spec.whatwg.org/#percent-decode +function percentDecodeBytes(input) { + const output = new Uint8Array(input.byteLength); + let outputIndex = 0; + for (let i = 0; i < input.byteLength; ++i) { + const byte = input[i]; + if (byte !== 0x25) { + output[outputIndex++] = byte; + } else if (byte === 0x25 && (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) { + output[outputIndex++] = byte; + } else { + const bytePoint = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16); + output[outputIndex++] = bytePoint; + i += 2; + } + } + + return output.slice(0, outputIndex); +} + +// https://url.spec.whatwg.org/#string-percent-decode +function percentDecodeString(input) { + const bytes = utf8Encode(input); + return percentDecodeBytes(bytes); +} + +// https://url.spec.whatwg.org/#c0-control-percent-encode-set +function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; +} + +// https://url.spec.whatwg.org/#fragment-percent-encode-set +const extraFragmentPercentEncodeSet = new Set([p(" "), p("\""), p("<"), p(">"), p("`")]); +function isFragmentPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#query-percent-encode-set +const extraQueryPercentEncodeSet = new Set([p(" "), p("\""), p("#"), p("<"), p(">")]); +function isQueryPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraQueryPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#special-query-percent-encode-set +function isSpecialQueryPercentEncode(c) { + return isQueryPercentEncode(c) || c === p("'"); +} + +// https://url.spec.whatwg.org/#path-percent-encode-set +const extraPathPercentEncodeSet = new Set([p("?"), p("`"), p("{"), p("}"), p("^")]); +function isPathPercentEncode(c) { + return isQueryPercentEncode(c) || extraPathPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#userinfo-percent-encode-set +const extraUserinfoPercentEncodeSet = + new Set([p("/"), p(":"), p(";"), p("="), p("@"), p("["), p("\\"), p("]"), p("|")]); +function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#component-percent-encode-set +const extraComponentPercentEncodeSet = new Set([p("$"), p("%"), p("&"), p("+"), p(",")]); +function isComponentPercentEncode(c) { + return isUserinfoPercentEncode(c) || extraComponentPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set +const extraURLEncodedPercentEncodeSet = new Set([p("!"), p("'"), p("("), p(")"), p("~")]); +function isURLEncodedPercentEncode(c) { + return isComponentPercentEncode(c) || extraURLEncodedPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#code-point-percent-encode-after-encoding +// https://url.spec.whatwg.org/#utf-8-percent-encode +// Assuming encoding is always utf-8 allows us to trim one of the logic branches. TODO: support encoding. +// The "-Internal" variant here has code points as JS strings. The external version used by other files has code points +// as JS numbers, like the rest of the codebase. +function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) { + const bytes = utf8Encode(codePoint); + let output = ""; + for (const byte of bytes) { + // Our percentEncodePredicate operates on bytes, not code points, so this is slightly different from the spec. + if (!percentEncodePredicate(byte)) { + output += String.fromCharCode(byte); + } else { + output += percentEncode(byte); + } + } + + return output; +} + +function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) { + return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate); +} + +// https://url.spec.whatwg.org/#string-percent-encode-after-encoding +// https://url.spec.whatwg.org/#string-utf-8-percent-encode +function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) { + let output = ""; + for (const codePoint of input) { + if (spaceAsPlus && codePoint === " ") { + output += "+"; + } else { + output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate); + } + } + return output; +} + +module.exports = { + isC0ControlPercentEncode, + isFragmentPercentEncode, + isQueryPercentEncode, + isSpecialQueryPercentEncode, + isPathPercentEncode, + isUserinfoPercentEncode, + isURLEncodedPercentEncode, + percentDecodeString, + percentDecodeBytes, + utf8PercentEncodeString, + utf8PercentEncodeCodePoint +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.js new file mode 100644 index 00000000..490cbab9 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.js @@ -0,0 +1,1274 @@ +"use strict"; +const tr46 = require("tr46"); + +const infra = require("./infra"); +const { utf8DecodeWithoutBOM } = require("./encoding"); +const { percentDecodeString, utf8PercentEncodeCodePoint, utf8PercentEncodeString, isC0ControlPercentEncode, + isFragmentPercentEncode, isQueryPercentEncode, isSpecialQueryPercentEncode, isPathPercentEncode, + isUserinfoPercentEncode } = require("./percent-encoding"); + +function p(char) { + return char.codePointAt(0); +} + +const specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +const failure = Symbol("failure"); + +function countSymbols(str) { + return [...str].length; +} + +function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); +} + +function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; +} + +function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; +} + +function isWindowsDriveLetterCodePoints(cp1, cp2) { + return infra.isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|")); +} + +function isWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); +} + +function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; +} + +function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; +} + +function containsForbiddenDomainCodePoint(string) { + return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1; +} + +function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; +} + +function isSpecial(url) { + return isSpecialScheme(url.scheme); +} + +function isNotSpecial(url) { + return !isSpecialScheme(url.scheme); +} + +function defaultPort(scheme) { + return specialSchemes[scheme]; +} + +function parseIPv4Number(input) { + if (input === "") { + return failure; + } + + let R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + let regex = /[^0-7]/u; + if (R === 10) { + regex = /[^0-9]/u; + } + if (R === 16) { + regex = /[^0-9A-Fa-f]/u; + } + + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); +} + +function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return failure; + } + + const numbers = []; + for (const part of parts) { + const n = parseIPv4Number(part); + if (n === failure) { + return failure; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * 256 ** (3 - counter); + ++counter; + } + + return ipv4; +} + +function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = `.${output}`; + } + n = Math.floor(n / 256); + } + + return output; +} + +function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = Array.from(input, c => c.codePointAt(0)); + + if (input[pointer] === p(":")) { + if (input[pointer + 1] !== p(":")) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === p(":")) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && infra.isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === p(".")) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === p(".") && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!infra.isASCIIDigit(input[pointer])) { + return failure; + } + + while (infra.isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === p(":")) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; +} + +function serializeIPv6(address) { + let output = ""; + const compress = findTheIPv6AddressCompressedPieceIndex(address); + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; +} + +function parseHost(input, isOpaque = false) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (isOpaque) { + return parseOpaqueHost(input); + } + + const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); + const asciiDomain = domainToASCII(domain); + if (asciiDomain === failure) { + return failure; + } + + if (endsInANumber(asciiDomain)) { + return parseIPv4(asciiDomain); + } + + return asciiDomain; +} + +function endsInANumber(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length === 1) { + return false; + } + parts.pop(); + } + + const last = parts[parts.length - 1]; + if (parseIPv4Number(last) !== failure) { + return true; + } + + if (/^[0-9]+$/u.test(last)) { + return true; + } + + return false; +} + +function parseOpaqueHost(input) { + if (containsForbiddenHostCodePoint(input)) { + return failure; + } + + return utf8PercentEncodeString(input, isC0ControlPercentEncode); +} + +function findTheIPv6AddressCompressedPieceIndex(address) { + let longestIndex = null; + let longestSize = 1; // only find elements > 1 + let foundIndex = null; + let foundSize = 0; + + for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) { + if (address[pieceIndex] !== 0) { + if (foundSize > longestSize) { + longestIndex = foundIndex; + longestSize = foundSize; + } + + foundIndex = null; + foundSize = 0; + } else { + if (foundIndex === null) { + foundIndex = pieceIndex; + } + ++foundSize; + } + } + + if (foundSize > longestSize) { + return foundIndex; + } + + return longestIndex; +} + +function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return `[${serializeIPv6(host)}]`; + } + + return host; +} + +function domainToASCII(domain, beStrict = false) { + const result = tr46.toASCII(domain, { + checkHyphens: beStrict, + checkBidi: true, + checkJoiners: true, + useSTD3ASCIIRules: beStrict, + transitionalProcessing: false, + verifyDNSLength: beStrict, + ignoreInvalidPunycode: false + }); + if (result === null) { + return failure; + } + + if (!beStrict) { + if (result === "") { + return failure; + } + if (containsForbiddenDomainCodePoint(result)) { + return failure; + } + } + return result; +} + +function trimControlChars(string) { + // Avoid using regexp because of this V8 bug: https://issues.chromium.org/issues/42204424 + + let start = 0; + let end = string.length; + for (; start < end; ++start) { + if (string.charCodeAt(start) > 0x20) { + break; + } + } + for (; end > start; --end) { + if (string.charCodeAt(end - 1) > 0x20) { + break; + } + } + return string.substring(start, end); +} + +function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/ug, ""); +} + +function shortenPath(url) { + const { path } = url; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); +} + +function includesCredentials(url) { + return url.username !== "" || url.password !== ""; +} + +function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.scheme === "file"; +} + +function hasAnOpaquePath(url) { + return typeof url.path === "string"; +} + +function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/u.test(string); +} + +function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = Array.from(this.input, c => c.codePointAt(0)); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this[`parse ${this.state}`](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } +} + +URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (infra.isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (infra.isASCIIAlphanumeric(c) || c === p("+") || c === p("-") || c === p(".")) { + this.buffer += cStr.toLowerCase(); + } else if (c === p(":")) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && this.url.host === "") { + return false; + } + } + this.url.scheme = this.buffer; + if (this.stateOverride) { + if (this.url.port === defaultPort(this.url.scheme)) { + this.url.port = null; + } + return false; + } + this.buffer = ""; + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== p("/") || this.input[this.pointer + 2] !== p("/")) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === p("/")) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.path = ""; + this.state = "opaque path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (hasAnOpaquePath(this.base) && c !== p("#"))) { + return failure; + } else if (hasAnOpaquePath(this.base) && c === p("#")) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path; + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === p("/") && this.input[this.pointer + 1] === p("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === p("/")) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (c === p("/")) { + this.state = "relative slash"; + } else if (isSpecial(this.url) && c === p("\\")) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c)) { + this.url.query = null; + this.url.path.pop(); + this.state = "path"; + --this.pointer; + } + } + + return true; +}; + +URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === p("/") || c === p("\\"))) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === p("/")) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === p("/") && this.input[this.pointer + 1] === p("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== p("/") && c !== p("\\")) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; +}; + +URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === p("@")) { + this.parseError = true; + if (this.atFlag) { + this.buffer = `%40${this.buffer}`; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === p(":") && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\"))) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse hostname"] = +URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === p(":") && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + if (this.stateOverride === "hostname") { + return false; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\"))) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === p("[")) { + this.arrFlag = true; + } else if (c === p("]")) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (infra.isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\")) || + this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > 2 ** 16 - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +const fileOtherwiseCodePoints = new Set([p("/"), p("\\"), p("?"), p("#")]); + +function startsWithWindowsDriveLetter(input, pointer) { + const length = input.length - pointer; + return length >= 2 && + isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && + (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); +} + +URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + this.url.host = ""; + + if (c === p("/") || c === p("\\")) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c)) { + this.url.query = null; + if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { + shortenPath(this.url); + } else { + this.parseError = true; + this.url.path = []; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === p("/") || c === p("\\")) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (!startsWithWindowsDriveLetter(this.input, this.pointer) && + isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } + this.url.host = this.base.host; + } + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === p("/") || c === p("\\") || c === p("?") || c === p("#")) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "path"; + + if (c !== p("/") && c !== p("\\")) { + --this.pointer; + } + } else if (!this.stateOverride && c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== p("/")) { + --this.pointer; + } + } else if (this.stateOverride && this.url.host === null) { + this.url.path.push(""); + } + + return true; +}; + +URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === p("/") || (isSpecial(this.url) && c === p("\\")) || + (!this.stateOverride && (c === p("?") || c === p("#")))) { + if (isSpecial(this.url) && c === p("\\")) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== p("/") && + !(isSpecial(this.url) && c === p("\\"))) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + this.buffer = `${this.buffer[0]}:`; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } + if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += utf8PercentEncodeCodePoint(c, isPathPercentEncode); + } + + return true; +}; + +URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) { + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c === p(" ")) { + const remaining = this.input[this.pointer + 1]; + if (remaining === p("?") || remaining === p("#")) { + this.url.path += "%20"; + } else { + this.url.path += " "; + } + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== p("%")) { + this.parseError = true; + } + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path += utf8PercentEncodeCodePoint(c, isC0ControlPercentEncode); + } + } + + return true; +}; + +URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + if ((!this.stateOverride && c === p("#")) || isNaN(c)) { + const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode; + this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate); + + this.buffer = ""; + + if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else if (!isNaN(c)) { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (!isNaN(c)) { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode); + } + + return true; +}; + +function serializeURL(url, excludeFragment) { + let output = `${url.scheme}:`; + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += `:${url.password}`; + } + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += `:${url.port}`; + } + } + + if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") { + output += "/."; + } + output += serializePath(url); + + if (url.query !== null) { + output += `?${url.query}`; + } + + if (!excludeFragment && url.fragment !== null) { + output += `#${url.fragment}`; + } + + return output; +} + +function serializeOrigin(tuple) { + let result = `${tuple.scheme}://`; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += `:${tuple.port}`; + } + + return result; +} + +function serializePath(url) { + if (hasAnOpaquePath(url)) { + return url.path; + } + + let output = ""; + for (const segment of url.path) { + output += `/${segment}`; + } + return output; +} + +module.exports.serializeURL = serializeURL; + +module.exports.serializePath = serializePath; + +module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": { + const pathURL = module.exports.parseURL(serializePath(url)); + if (pathURL === null) { + return "null"; + } + if (pathURL.scheme !== "http" && pathURL.scheme !== "https") { + return "null"; + } + return module.exports.serializeURLOrigin(pathURL); + } + case "ftp": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + // The spec says: + // > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin. + // Browsers tested so far: + // - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g. + // https://bugs.chromium.org/p/chromium/issues/detail?id=37586 + // - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see + // https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs + return "null"; + default: + // serializing an opaque origin returns "null" + return "null"; + } +}; + +module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return null; + } + + return usm.url; +}; + +module.exports.setTheUsername = function (url, username) { + url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode); +}; + +module.exports.setThePassword = function (url, password) { + url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode); +}; + +module.exports.serializeHost = serializeHost; + +module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + +module.exports.hasAnOpaquePath = hasAnOpaquePath; + +module.exports.serializeInteger = function (integer) { + return String(integer); +}; + +module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.js new file mode 100644 index 00000000..ed53310b --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.js @@ -0,0 +1,89 @@ +"use strict"; +const { utf8Encode, utf8DecodeWithoutBOM } = require("./encoding"); +const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = require("./percent-encoding"); + +function p(char) { + return char.codePointAt(0); +} + +// https://url.spec.whatwg.org/#concept-urlencoded-parser +function parseUrlencoded(input) { + const sequences = strictlySplitByteSequence(input, p("&")); + const output = []; + for (const bytes of sequences) { + if (bytes.length === 0) { + continue; + } + + let name, value; + const indexOfEqual = bytes.indexOf(p("=")); + + if (indexOfEqual >= 0) { + name = bytes.slice(0, indexOfEqual); + value = bytes.slice(indexOfEqual + 1); + } else { + name = bytes; + value = new Uint8Array(0); + } + + name = replaceByteInByteSequence(name, 0x2B, 0x20); + value = replaceByteInByteSequence(value, 0x2B, 0x20); + + const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name)); + const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value)); + + output.push([nameString, valueString]); + } + return output; +} + +// https://url.spec.whatwg.org/#concept-urlencoded-string-parser +function parseUrlencodedString(input) { + return parseUrlencoded(utf8Encode(input)); +} + +// https://url.spec.whatwg.org/#concept-urlencoded-serializer +function serializeUrlencoded(tuples) { + // TODO: accept and use encoding argument + + let output = ""; + for (const [i, tuple] of tuples.entries()) { + const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true); + const value = utf8PercentEncodeString(tuple[1], isURLEncodedPercentEncode, true); + + if (i !== 0) { + output += "&"; + } + output += `${name}=${value}`; + } + return output; +} + +function strictlySplitByteSequence(buf, cp) { + const list = []; + let last = 0; + let i = buf.indexOf(cp); + while (i >= 0) { + list.push(buf.slice(last, i)); + last = i + 1; + i = buf.indexOf(cp, last); + } + if (last !== buf.length) { + list.push(buf.slice(last)); + } + return list; +} + +function replaceByteInByteSequence(buf, from, to) { + let i = buf.indexOf(from); + while (i >= 0) { + buf[i] = to; + i = buf.indexOf(from, i + 1); + } + return buf; +} + +module.exports = { + parseUrlencodedString, + serializeUrlencoded +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.js new file mode 100644 index 00000000..3af17706 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.js @@ -0,0 +1,190 @@ +"use strict"; + +// Returns "Type(value) is Object" in ES terminology. +function isObject(value) { + return (typeof value === "object" && value !== null) || typeof value === "function"; +} + +const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + +// Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]` +// instead of `[[Get]]` and `[[Set]]` and only allowing objects +function define(target, source) { + for (const key of Reflect.ownKeys(source)) { + const descriptor = Reflect.getOwnPropertyDescriptor(source, key); + if (descriptor && !Reflect.defineProperty(target, key, descriptor)) { + throw new TypeError(`Cannot redefine property: ${String(key)}`); + } + } +} + +function newObjectInRealm(globalObject, object) { + const ctorRegistry = initCtorRegistry(globalObject); + return Object.defineProperties( + Object.create(ctorRegistry["%Object.prototype%"]), + Object.getOwnPropertyDescriptors(object) + ); +} + +const wrapperSymbol = Symbol("wrapper"); +const implSymbol = Symbol("impl"); +const sameObjectCaches = Symbol("SameObject caches"); +const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); + +const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype); + +function initCtorRegistry(globalObject) { + if (hasOwn(globalObject, ctorRegistrySymbol)) { + return globalObject[ctorRegistrySymbol]; + } + + const ctorRegistry = Object.create(null); + + // In addition to registering all the WebIDL2JS-generated types in the constructor registry, + // we also register a few intrinsics that we make use of in generated code, since they are not + // easy to grab from the globalObject variable. + ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype; + ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()) + ); + + try { + ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf( + globalObject.eval("(async function* () {})").prototype + ) + ); + } catch { + ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype; + } + + globalObject[ctorRegistrySymbol] = ctorRegistry; + return ctorRegistry; +} + +function getSameObject(wrapper, prop, creator) { + if (!wrapper[sameObjectCaches]) { + wrapper[sameObjectCaches] = Object.create(null); + } + + if (prop in wrapper[sameObjectCaches]) { + return wrapper[sameObjectCaches][prop]; + } + + wrapper[sameObjectCaches][prop] = creator(); + return wrapper[sameObjectCaches][prop]; +} + +function wrapperForImpl(impl) { + return impl ? impl[wrapperSymbol] : null; +} + +function implForWrapper(wrapper) { + return wrapper ? wrapper[implSymbol] : null; +} + +function tryWrapperForImpl(impl) { + const wrapper = wrapperForImpl(impl); + return wrapper ? wrapper : impl; +} + +function tryImplForWrapper(wrapper) { + const impl = implForWrapper(wrapper); + return impl ? impl : wrapper; +} + +const iterInternalSymbol = Symbol("internal"); + +function isArrayIndexPropName(P) { + if (typeof P !== "string") { + return false; + } + const i = P >>> 0; + if (i === 2 ** 32 - 1) { + return false; + } + const s = `${i}`; + if (P !== s) { + return false; + } + return true; +} + +const byteLengthGetter = + Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; +function isArrayBuffer(value) { + try { + byteLengthGetter.call(value); + return true; + } catch (e) { + return false; + } +} + +function iteratorResult([key, value], kind) { + let result; + switch (kind) { + case "key": + result = key; + break; + case "value": + result = value; + break; + case "key+value": + result = [key, value]; + break; + } + return { value: result, done: false }; +} + +const supportsPropertyIndex = Symbol("supports property index"); +const supportedPropertyIndices = Symbol("supported property indices"); +const supportsPropertyName = Symbol("supports property name"); +const supportedPropertyNames = Symbol("supported property names"); +const indexedGet = Symbol("indexed property get"); +const indexedSetNew = Symbol("indexed property set new"); +const indexedSetExisting = Symbol("indexed property set existing"); +const namedGet = Symbol("named property get"); +const namedSetNew = Symbol("named property set new"); +const namedSetExisting = Symbol("named property set existing"); +const namedDelete = Symbol("named property delete"); + +const asyncIteratorNext = Symbol("async iterator get the next iteration result"); +const asyncIteratorReturn = Symbol("async iterator return steps"); +const asyncIteratorInit = Symbol("async iterator initialization steps"); +const asyncIteratorEOI = Symbol("async iterator end of iteration"); + +module.exports = exports = { + isObject, + hasOwn, + define, + newObjectInRealm, + wrapperSymbol, + implSymbol, + getSameObject, + ctorRegistrySymbol, + initCtorRegistry, + wrapperForImpl, + implForWrapper, + tryWrapperForImpl, + tryImplForWrapper, + iterInternalSymbol, + isArrayBuffer, + isArrayIndexPropName, + supportsPropertyIndex, + supportedPropertyIndices, + supportsPropertyName, + supportedPropertyNames, + indexedGet, + indexedSetNew, + indexedSetExisting, + namedGet, + namedSetNew, + namedSetExisting, + namedDelete, + asyncIteratorNext, + asyncIteratorReturn, + asyncIteratorInit, + asyncIteratorEOI, + iteratorResult +}; diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/package.json b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/package.json new file mode 100644 index 00000000..d0ef78ae --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/package.json @@ -0,0 +1,53 @@ +{ + "name": "whatwg-url", + "version": "14.2.0", + "description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery", + "main": "index.js", + "files": [ + "index.js", + "webidl2js-wrapper.js", + "lib/*.js" + ], + "author": "Sebastian Mayr ", + "license": "MIT", + "repository": "jsdom/whatwg-url", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "devDependencies": { + "@domenic/eslint-config": "^4.0.1", + "benchmark": "^2.1.4", + "c8": "^10.1.3", + "esbuild": "^0.25.1", + "eslint": "^9.22.0", + "globals": "^16.0.0", + "webidl2js": "^18.0.0" + }, + "engines": { + "node": ">=18" + }, + "scripts": { + "coverage": "c8 node --test --experimental-test-coverage test/*.js", + "lint": "eslint", + "prepare": "node scripts/transform.js", + "pretest": "node scripts/get-latest-platform-tests.js && node scripts/transform.js", + "build-live-viewer": "esbuild --bundle --format=esm --sourcemap --outfile=live-viewer/whatwg-url.mjs index.js", + "test": "node --test test/*.js", + "bench": "node scripts/benchmark.js" + }, + "c8": { + "reporter": [ + "text", + "html" + ], + "exclude": [ + "lib/Function.js", + "lib/URL.js", + "lib/URLSearchParams.js", + "lib/utils.js", + "scripts/", + "test/" + ] + } +} diff --git a/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.js b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.js new file mode 100644 index 00000000..b731ace5 --- /dev/null +++ b/backend/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.js @@ -0,0 +1,7 @@ +"use strict"; + +const URL = require("./lib/URL"); +const URLSearchParams = require("./lib/URLSearchParams"); + +exports.URL = URL; +exports.URLSearchParams = URLSearchParams; diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/available-typed-arrays b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/available-typed-arrays new file mode 120000 index 00000000..733e2056 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/available-typed-arrays @@ -0,0 +1 @@ +../../available-typed-arrays@1.0.7/node_modules/available-typed-arrays \ No newline at end of file diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bind b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bind new file mode 120000 index 00000000..7e15771c --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bind @@ -0,0 +1 @@ +../../call-bind@1.0.9/node_modules/call-bind \ No newline at end of file diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bound b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bound new file mode 120000 index 00000000..5171ab6f --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/call-bound @@ -0,0 +1 @@ +../../call-bound@1.0.4/node_modules/call-bound \ No newline at end of file diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/for-each b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/for-each new file mode 120000 index 00000000..44a8882f --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/for-each @@ -0,0 +1 @@ +../../for-each@0.3.5/node_modules/for-each \ No newline at end of file diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/get-proto b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/get-proto new file mode 120000 index 00000000..aef0e9ea --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/get-proto @@ -0,0 +1 @@ +../../get-proto@1.0.1/node_modules/get-proto \ No newline at end of file diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/gopd b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/gopd new file mode 120000 index 00000000..3e8fbc1b --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/gopd @@ -0,0 +1 @@ +../../gopd@1.2.0/node_modules/gopd \ No newline at end of file diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/has-tostringtag b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/has-tostringtag new file mode 120000 index 00000000..5c739d36 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/has-tostringtag @@ -0,0 +1 @@ +../../has-tostringtag@1.0.2/node_modules/has-tostringtag \ No newline at end of file diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.editorconfig b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.editorconfig new file mode 100644 index 00000000..bc228f82 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.github/FUNDING.yml b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.github/FUNDING.yml new file mode 100644 index 00000000..d6aa1803 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/which-typed-array +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.nycrc b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.nycrc new file mode 100644 index 00000000..1826526e --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/CHANGELOG.md b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/CHANGELOG.md new file mode 100644 index 00000000..2f121540 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/CHANGELOG.md @@ -0,0 +1,301 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.24](https://github.com/inspect-js/which-typed-array/compare/v1.1.23...v1.1.24) - 2026-09-18 + +### Commits + +- [types] fix the types for good, hopefully [`d746946`](https://github.com/inspect-js/which-typed-array/commit/d746946a8a76dc6e58302de53856aff304dbdb98) + +## [v1.1.23](https://github.com/inspect-js/which-typed-array/compare/v1.1.22...v1.1.23) - 2026-09-16 + +### Commits + +- [types] handle a consumer `lib` that lacks `Float16Array` [`7fd78fb`](https://github.com/inspect-js/which-typed-array/commit/7fd78fb1f90d00d1e340457c7e6a00492c1c5e79) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `auto-changelog`, `eslint`, `tape` [`885ae7d`](https://github.com/inspect-js/which-typed-array/commit/885ae7d6888b21bcacaae883f86861258196888d) +- [readme] remove dead badges [`67844dd`](https://github.com/inspect-js/which-typed-array/commit/67844dd30a89dddfc98172672af6372ae2e74d13) + +## [v1.1.22](https://github.com/inspect-js/which-typed-array/compare/v1.1.21...v1.1.22) - 2026-06-05 + +### Commits + +- [types] improve typings [`5a60076`](https://github.com/inspect-js/which-typed-array/commit/5a60076ec334e32dcb41d38b1eb6c2c49d18d097) +- [Dev Deps] update `@arethetypeswrong/cli`, `auto-changelog`, `eslint` [`6fb45d2`](https://github.com/inspect-js/which-typed-array/commit/6fb45d27e29dc0384d142c3af95540dfe7409207) + +## [v1.1.21](https://github.com/inspect-js/which-typed-array/compare/v1.1.20...v1.1.21) - 2026-05-26 + +### Commits + +- [types] add Float16Array [`b3dac9f`](https://github.com/inspect-js/which-typed-array/commit/b3dac9f6931f463d10b7e21b1b5e5369602642c4) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`; migrate to flat config [`2dd9b04`](https://github.com/inspect-js/which-typed-array/commit/2dd9b04cd3f461a0f4b19c607124e134e12df135) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `eslint` [`b46f6a2`](https://github.com/inspect-js/which-typed-array/commit/b46f6a2f000e932f7b78c54b9dce0bf940379fea) +- [Tests] pin `fflate` to 0.8.2 [`06eb54e`](https://github.com/inspect-js/which-typed-array/commit/06eb54e4ee7369da3639a2291a1c6add642e53fb) +- [Dev Deps] update `eslint` [`2181d61`](https://github.com/inspect-js/which-typed-array/commit/2181d61990f20c82c84d06bcd4a91ba70b486bc1) +- [Deps] update `call-bind` [`ca58bca`](https://github.com/inspect-js/which-typed-array/commit/ca58bca5034adcbfc05797ffde7e9134c9df4a72) + +## [v1.1.20](https://github.com/inspect-js/which-typed-array/compare/v1.1.19...v1.1.20) - 2026-01-14 + +### Commits + +- [types] add Float16Array to TypedArray [`b04301f`](https://github.com/inspect-js/which-typed-array/commit/b04301f737aaa500ac2ee9a0578d6e3a52a65b94) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `eslint`, `make-generator-function`, `npmignore` [`215b3a1`](https://github.com/inspect-js/which-typed-array/commit/215b3a1a39300a3a305d9f9b6885d00d44387ef6) +- [readme] replace runkit CI badge with shields.io check-runs badge [`32def83`](https://github.com/inspect-js/which-typed-array/commit/32def83f46fdfe0d324ed32de2146554855ed140) + +## [v1.1.19](https://github.com/inspect-js/which-typed-array/compare/v1.1.18...v1.1.19) - 2025-03-08 + +### Commits + +- [Refactor] use `get-proto`, improve types [`e05d535`](https://github.com/inspect-js/which-typed-array/commit/e05d535fe4e4c4e674937718fe1cae90abff3606) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape` [`0dade9c`](https://github.com/inspect-js/which-typed-array/commit/0dade9c4c334f37ed14083a35724eea56a496991) +- [Deps] update `call-bound`, `for-each` [`490791a`](https://github.com/inspect-js/which-typed-array/commit/490791af49605390f9805660492976f86c64feb1) +- [Tests] skip `npm ls` in older nodes [`f83aaca`](https://github.com/inspect-js/which-typed-array/commit/f83aaca6b6634ce795f8caf9a1e14ab15d35161c) +- [Dev Deps] update `@ljharb/tsconfig` [`63c4795`](https://github.com/inspect-js/which-typed-array/commit/63c479564e5f3cb022c784ffe505673597341aab) + +## [v1.1.18](https://github.com/inspect-js/which-typed-array/compare/v1.1.17...v1.1.18) - 2024-12-18 + +### Commits + +- [types] improve types [`4b57173`](https://github.com/inspect-js/which-typed-array/commit/4b5717349976578c6b48966d581687df5dcc2e9b) +- [Dev Deps] update `@types/tape` [`81853b0`](https://github.com/inspect-js/which-typed-array/commit/81853b075c018538859a5533578be654fafecdae) + +## [v1.1.17](https://github.com/inspect-js/which-typed-array/compare/v1.1.16...v1.1.17) - 2024-12-18 + +### Commits + +- [types] improve types [`86bc612`](https://github.com/inspect-js/which-typed-array/commit/86bc61207e5970c2c7e13cdda4ccdeb0981ac40b) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape` [`2e9bed6`](https://github.com/inspect-js/which-typed-array/commit/2e9bed67f1d623b176b1a7f06c5eab006c21cf96) +- [Deps] update `call-bind`, `gopd` [`34579df`](https://github.com/inspect-js/which-typed-array/commit/34579df639e35ceb3a7e54f8e680a4077a950b8b) +- [Refactor] use `call-bound` directly [`2a2d84e`](https://github.com/inspect-js/which-typed-array/commit/2a2d84e91045266841ddb47afe594899bae2f483) + +## [v1.1.16](https://github.com/inspect-js/which-typed-array/compare/v1.1.15...v1.1.16) - 2024-11-27 + +### Commits + +- [actions] split out node 10-20, and 20+ [`8e289a9`](https://github.com/inspect-js/which-typed-array/commit/8e289a9665a32f7ea267c3ffed7451b154adbe26) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@types/node`, `@types/tape`, `auto-changelog`, `tape` [`3d4a678`](https://github.com/inspect-js/which-typed-array/commit/3d4a67872d0dbecb755e63ba4101e9ec030a5e7e) +- [Tests] replace `aud` with `npm audit` [`6fbada9`](https://github.com/inspect-js/which-typed-array/commit/6fbada976743192db47000e47eefc07708713ea0) +- [types] add an additional overload [`db5a791`](https://github.com/inspect-js/which-typed-array/commit/db5a791642cd8b4d78fe4ed4da151c4543ee0840) +- [Dev Deps] remove an unused DT package [`6bfff4c`](https://github.com/inspect-js/which-typed-array/commit/6bfff4c3b0c415cb32cd12be6fab3cbbe9e10e13) +- [Dev Deps] add missing peer dep [`05fd582`](https://github.com/inspect-js/which-typed-array/commit/05fd582a703cd68ee7613af0ef2c45546ea5d2ba) + +## [v1.1.15](https://github.com/inspect-js/which-typed-array/compare/v1.1.14...v1.1.15) - 2024-03-10 + +### Commits + +- [types] use a namespace; improve type [`f42bec3`](https://github.com/inspect-js/which-typed-array/commit/f42bec34d5c47bd9e4ab1b48dcde60c09c666712) +- [types] use shared config [`464a9e3`](https://github.com/inspect-js/which-typed-array/commit/464a9e358c2597253c747970b12032406a19b8d2) +- [actions] remove redundant finisher; use reusable workflow [`d114ee8`](https://github.com/inspect-js/which-typed-array/commit/d114ee83ceb6c7898386f4b5935a3ed9e2ec61e4) +- [Dev Deps] update `@types/node`, `tape`, `typescript`; add `@arethetypeswrong/cli` [`9cc63d8`](https://github.com/inspect-js/which-typed-array/commit/9cc63d8635e80ce6dabcb352d23050111040d747) +- [types] add a helpful hover description [`29ccf8d`](https://github.com/inspect-js/which-typed-array/commit/29ccf8dab0f805cdac6ec56d7b9cc27476708273) +- [Deps] update `available-typed-arrays`, `call-bind`, `has-tostringtag` [`7ecfd8e`](https://github.com/inspect-js/which-typed-array/commit/7ecfd8e29d09f8708f7cab7cc41fea9ae5a20867) + +## [v1.1.14](https://github.com/inspect-js/which-typed-array/compare/v1.1.13...v1.1.14) - 2024-02-01 + +### Commits + +- [patch] add types [`49c4d4c`](https://github.com/inspect-js/which-typed-array/commit/49c4d4c5db9bebb8d6f8c18a01047e44eea15e17) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`e5fab7b`](https://github.com/inspect-js/which-typed-array/commit/e5fab7b3dc9df2bceb88f15c3d0a2c0176cf2567) +- [Deps] update `available-typed-arrays`, `call-bind` [`97e2b44`](https://github.com/inspect-js/which-typed-array/commit/97e2b44bad85c9183f1219e28211b3abd167677c) +- [Deps] update `has-tostringtag` [`1efa8bf`](https://github.com/inspect-js/which-typed-array/commit/1efa8bf910c080c14f011aa7c645ac88bc7a7078) + +## [v1.1.13](https://github.com/inspect-js/which-typed-array/compare/v1.1.12...v1.1.13) - 2023-10-19 + +### Commits + +- [Refactor] avoid call-binding entirely when there is no method to bind [`9ff452b`](https://github.com/inspect-js/which-typed-array/commit/9ff452b88fbd8e4419bd768d86d0ea9a87d7e310) + +## [v1.1.12](https://github.com/inspect-js/which-typed-array/compare/v1.1.11...v1.1.12) - 2023-10-19 + +### Commits + +- [Fix] somehow node 0.12 - 3 can hit here, and they lack slice but have set [`c28e9b8`](https://github.com/inspect-js/which-typed-array/commit/c28e9b84d6d68ad5f52236ba59c26b06cde6300b) +- [Deps] update `call-bind` [`a648554`](https://github.com/inspect-js/which-typed-array/commit/a64855495106235352ebb3550a860d3bfd4a1ce1) +- [Dev Deps] update `tape` [`7a094d6`](https://github.com/inspect-js/which-typed-array/commit/7a094d6f9219b903c9a9e13c559e68f0e9672b59) + +## [v1.1.11](https://github.com/inspect-js/which-typed-array/compare/v1.1.10...v1.1.11) - 2023-07-17 + +### Commits + +- [Fix] `node < v0.6` lacks proper Object toString behavior [`b8fd654`](https://github.com/inspect-js/which-typed-array/commit/b8fd65479c0bd18385378cfae79750ebf7cb6ee7) +- [Dev Deps] update `tape` [`e1734c9`](https://github.com/inspect-js/which-typed-array/commit/e1734c99d79880ab11efa55220498a7a1e887834) + +## [v1.1.10](https://github.com/inspect-js/which-typed-array/compare/v1.1.9...v1.1.10) - 2023-07-10 + +### Commits + +- [actions] update rebase action to use reusable workflow [`2c10582`](https://github.com/inspect-js/which-typed-array/commit/2c105820d77274c079cb6d040cb348396e516ef5) +- [Robustness] use `call-bind` [`b2335fd`](https://github.com/inspect-js/which-typed-array/commit/b2335fdfca80840995eea5e6fcfffc6d712279a1) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`ad5e41b`](https://github.com/inspect-js/which-typed-array/commit/ad5e41ba18e7d23af1f9b211215c43a64bf75d70) + +## [v1.1.9](https://github.com/inspect-js/which-typed-array/compare/v1.1.8...v1.1.9) - 2022-11-02 + +### Commits + +- [Dev Deps] update `aud`, `is-callable`, `tape` [`9a20b3c`](https://github.com/inspect-js/which-typed-array/commit/9a20b3cb8f5d087789a8160395517bffe27b4339) +- [Refactor] use `gopd` instead of `es-abstract` helper [`00157af`](https://github.com/inspect-js/which-typed-array/commit/00157af909842b8b5affa5485d3574ec92d94065) +- [Deps] update `is-typed-array` [`6714240`](https://github.com/inspect-js/which-typed-array/commit/6714240e748cbbb634cb1e405ad762bc52acde66) +- [meta] add `sideEffects` flag [`89b96cc`](https://github.com/inspect-js/which-typed-array/commit/89b96cc3decc78d9621598e94fa1c2bb87eabf2e) + +## [v1.1.8](https://github.com/inspect-js/which-typed-array/compare/v1.1.7...v1.1.8) - 2022-05-14 + +### Commits + +- [actions] reuse common workflows [`95ea6c0`](https://github.com/inspect-js/which-typed-array/commit/95ea6c02dc5ec4ed0ee1b9c4692bb060108c8637) +- [meta] use `npmignore` to autogenerate an npmignore file [`d08436a`](https://github.com/inspect-js/which-typed-array/commit/d08436a19cdd76219732f5040a01cdb92ef2820e) +- [readme] add github actions/codecov badges [`35ae3af`](https://github.com/inspect-js/which-typed-array/commit/35ae3af6a0bb328c9d9b9bbb53e47122f269d81a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`86e6e3a`](https://github.com/inspect-js/which-typed-array/commit/86e6e3af60b2436f0ff34968d9d6240a23f40528) +- [actions] update codecov uploader [`0aa6e30`](https://github.com/inspect-js/which-typed-array/commit/0aa6e3026ab4198c4364737ed4f0315a2ecc432a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`a881a78`](https://github.com/inspect-js/which-typed-array/commit/a881a785f094e823e1cefe2ae9e4ebe31a8e996e) +- [Refactor] use `for-each` instead of `foreach` [`9dafa03`](https://github.com/inspect-js/which-typed-array/commit/9dafa0377fc5c690059a9d454f1dd4d365c5c902) +- [Deps] update `es-abstract`, `is-typed-array` [`0684022`](https://github.com/inspect-js/which-typed-array/commit/068402297608f321a4ec99ebce741b3eb38fcfdd) +- [Deps] update `es-abstract`, `is-typed-array` [`633a529`](https://github.com/inspect-js/which-typed-array/commit/633a529081b5c48d9675abb8aea425e6e33d528e) + +## [v1.1.7](https://github.com/inspect-js/which-typed-array/compare/v1.1.6...v1.1.7) - 2021-08-30 + +### Commits + +- [Refactor] use `globalThis` if available [`2a16d1f`](https://github.com/inspect-js/which-typed-array/commit/2a16d1fd520871ce6b23c60f0bd2113cf33b2533) +- [meta] changelog cleanup [`ba99f56`](https://github.com/inspect-js/which-typed-array/commit/ba99f56b45e6acde7aef4a1f34bb00e44088ccee) +- [Dev Deps] update `@ljharb/eslint-config` [`19a6e04`](https://github.com/inspect-js/which-typed-array/commit/19a6e04ce0094fb3fd6d0d2cbc58d320556ddf50) +- [Deps] update `available-typed-arrays` [`50dbc58`](https://github.com/inspect-js/which-typed-array/commit/50dbc5810a24c468b49409e1f0a79d03501e3dd6) +- [Deps] update `is-typed-array` [`c1b83ea`](https://github.com/inspect-js/which-typed-array/commit/c1b83eae65f042e46b6ae941ac4e814b7965a0f7) + +## [v1.1.6](https://github.com/inspect-js/which-typed-array/compare/v1.1.5...v1.1.6) - 2021-08-06 + +### Fixed + +- [Fix] if Symbol.toStringTag exists but is not present, use Object.prototype.toString [`#51`](https://github.com/inspect-js/which-typed-array/issues/51) [`#49`](https://github.com/inspect-js/which-typed-array/issues/49) + +### Commits + +- [Dev Deps] update `is-callable`, `tape` [`63eb1e3`](https://github.com/inspect-js/which-typed-array/commit/63eb1e3faede3f328bbbb4a5fcffc2e4769cf4ec) +- [Deps] update `is-typed-array` [`c5056f0`](https://github.com/inspect-js/which-typed-array/commit/c5056f0007d4c9434f1fa69eff183109468b4769) + +## [v1.1.5](https://github.com/inspect-js/which-typed-array/compare/v1.1.4...v1.1.5) - 2021-08-05 + +### Commits + +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`63fa8dd`](https://github.com/inspect-js/which-typed-array/commit/63fa8dd1dc9c0f0dbbaa16d1de0eb89797324c5d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `is-callable`, `tape` [`1107c74`](https://github.com/inspect-js/which-typed-array/commit/1107c74c52ed6eb4a719faec88e16c4343976d73) +- [Deps] update `available-typed-arrays`, `call-bind`, `es-abstract`, `is-typed-array` [`f953454`](https://github.com/inspect-js/which-typed-array/commit/f953454b2c6f589f09573ddc961431f970c2e1b6) +- [Fix] use `has-tostringtag` to behave correctly in the presence of symbol shams [`8aee720`](https://github.com/inspect-js/which-typed-array/commit/8aee7207abcd72c799ac324b214fbb6ca7ae4a28) +- [meta] use `prepublishOnly` script for npm 7+ [`6c5167b`](https://github.com/inspect-js/which-typed-array/commit/6c5167b4cd06cb62a5487a2e797d8e41cc2970b1) + +## [v1.1.4](https://github.com/inspect-js/which-typed-array/compare/v1.1.3...v1.1.4) - 2020-12-05 + +### Commits + +- [meta] npmignore github action workflows [`aa427e7`](https://github.com/inspect-js/which-typed-array/commit/aa427e79a230a985953695a8129ceb6bb7d42527) + +## [v1.1.3](https://github.com/inspect-js/which-typed-array/compare/v1.1.2...v1.1.3) - 2020-12-05 + +### Commits + +- [Tests] migrate tests to Github Actions [`803d4dd`](https://github.com/inspect-js/which-typed-array/commit/803d4ddb601ff03e587be792bd452de0e2783d03) +- [Tests] run `nyc` on all tests [`205a13f`](https://github.com/inspect-js/which-typed-array/commit/205a13f7aa172e014ddc2079c84af6ba575581c8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `is-callable`, `tape` [`97ceb07`](https://github.com/inspect-js/which-typed-array/commit/97ceb070d5aea1c3a696c6f695800ae468bafc0b) +- [actions] add "Allow Edits" workflow [`b140492`](https://github.com/inspect-js/which-typed-array/commit/b14049211eff32bd4149767def4f939483810051) +- [Deps] update `es-abstract`; use `call-bind` where applicable [`2abdb87`](https://github.com/inspect-js/which-typed-array/commit/2abdb871961b4e1b58925115a7d56a9cc5966a02) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`256d34b`](https://github.com/inspect-js/which-typed-array/commit/256d34b8bdb67b8af0e9f83c9a318e54f3340e3b) +- [Dev Deps] update `auto-changelog`; add `aud` [`ddea96f`](https://github.com/inspect-js/which-typed-array/commit/ddea96fe320dbdd0c7d7569812399a7f64d43e04) +- [meta] gitignore nyc output [`8a812bd`](https://github.com/inspect-js/which-typed-array/commit/8a812bd1ce7c5609988fb4fe2e9af2089eccd07d) + +## [v1.1.2](https://github.com/inspect-js/which-typed-array/compare/v1.1.1...v1.1.2) - 2020-04-07 + +### Commits + +- [Dev Deps] update `make-arrow-function`, `make-generator-function` [`28c61ef`](https://github.com/inspect-js/which-typed-array/commit/28c61eff4903ff6509f65c2f500858b9cb4636f1) +- [Dev Deps] update `@ljharb/eslint-config` [`a233879`](https://github.com/inspect-js/which-typed-array/commit/a2338798d3a4a3169cda54e322b2f2eb0e976ad0) +- [Dev Deps] update `auto-changelog` [`df0134c`](https://github.com/inspect-js/which-typed-array/commit/df0134c0e20ec6d94993988ad670e1b3cf350bea) +- [Fix] move `foreach` to dependencies [`6ef29c0`](https://github.com/inspect-js/which-typed-array/commit/6ef29c0dbb91a7ec21df7ce8736f99f41efea39e) +- [Tests] only audit prod deps [`eb21044`](https://github.com/inspect-js/which-typed-array/commit/eb210446bd7a433657204d2314ef56fe264c21ad) +- [Deps] update `es-abstract` [`5ef0236`](https://github.com/inspect-js/which-typed-array/commit/5ef02368d9876a1074123aa7725d6759b4f3e358) +- [Dev Deps] update `tape` [`7456037`](https://github.com/inspect-js/which-typed-array/commit/745603728c6c3da8bdddee321e8a9196f4827aa3) +- [Deps] update `available-typed-arrays` [`8a856c9`](https://github.com/inspect-js/which-typed-array/commit/8a856c9aa707c1e6f7a52e834485356b31395ea6) + +## [v1.1.1](https://github.com/inspect-js/which-typed-array/compare/v1.1.0...v1.1.1) - 2020-01-24 + +### Commits + +- [Tests] use shared travis-ci configs [`0a627d9`](https://github.com/inspect-js/which-typed-array/commit/0a627d9694d0eabdaee63b19e605584166995a79) +- [meta] add `auto-changelog` [`2a14c58`](https://github.com/inspect-js/which-typed-array/commit/2a14c58b79f72e32ef2078efb40d31a4bf8c197a) +- [meta] remove unused Makefile and associated utilities [`75f7f22`](https://github.com/inspect-js/which-typed-array/commit/75f7f222199f42618c290de363c542b11f5a5632) +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`4162327`](https://github.com/inspect-js/which-typed-array/commit/416232725e7d127cbd886af0f8988dae612a342f) +- [Refactor] use `es-abstract`’s `callBound`, `available-typed-arrays`, `has-symbols` [`9b04a2a`](https://github.com/inspect-js/which-typed-array/commit/9b04a2a14c758600cffcf59485b7b3c85839c266) +- [readme] fix repo URLs, remove testling [`03ed52f`](https://github.com/inspect-js/which-typed-array/commit/03ed52f3ae4fcd35614bcda7e947b14e62009c71) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `replace`, `semver`, `tape` [`bfbcf3e`](https://github.com/inspect-js/which-typed-array/commit/bfbcf3ec9c449bd0089ed805c01a32ba4e7e5938) +- [actions] add automatic rebasing / merge commit blocking [`cc88ac5`](https://github.com/inspect-js/which-typed-array/commit/cc88ac56bcfb71cb26c656ebde4c560a22fadd85) +- [meta] create FUNDING.yml [`acbc723`](https://github.com/inspect-js/which-typed-array/commit/acbc7230929b1256c83df28be4a456eed3e147e9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `is-callable`, `tape` [`f1ab63e`](https://github.com/inspect-js/which-typed-array/commit/f1ab63e9366027eae2e29398c035181dac164132) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` [`ac9f50b`](https://github.com/inspect-js/which-typed-array/commit/ac9f50b59558933292dff993df2e68eaa44b07e2) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`aaaa15d`](https://github.com/inspect-js/which-typed-array/commit/aaaa15dfb5bd8228c0cfb8f2aba267efb405b0a1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`602fc9a`](https://github.com/inspect-js/which-typed-array/commit/602fc9a0a7d708236f90c76f592e6a980ecde940) +- [Deps] update `available-typed-arrays`, `is-typed-array` [`b2d69b6`](https://github.com/inspect-js/which-typed-array/commit/b2d69b639bf14344d09f8512dbc060cd4f533161) +- [meta] add `funding` field [`156f613`](https://github.com/inspect-js/which-typed-array/commit/156f613d0ce547c4b15e1ae279198b66e3cef55e) + +## [v1.1.0](https://github.com/inspect-js/which-typed-array/compare/v1.0.1...v1.1.0) - 2019-02-16 + +### Commits + +- [Tests] remove `jscs` [`381c9b4`](https://github.com/inspect-js/which-typed-array/commit/381c9b4bd858da1adedf23d8555af3a3ed901a83) +- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v5.8`; improve matrix; newer npm breaks on older node [`7015c19`](https://github.com/inspect-js/which-typed-array/commit/7015c196ba86540b04d18d9b1d2c368909492023) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9`; use `nvm install-latest-npm` [`ad67885`](https://github.com/inspect-js/which-typed-array/commit/ad678853e245986720d7650be1c974a9ff3ac814) +- [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` [`dd94bfb`](https://github.com/inspect-js/which-typed-array/commit/dd94bfb6309a92d1537352f2d1100f9e913ebc01) +- [Refactor] use an array instead of an object for storing Typed Array names [`de98bc1`](https://github.com/inspect-js/which-typed-array/commit/de98bc1d44af92909a34212e276deb5d79ac428a) +- [meta] ignore `test.html` [`06cfb1b`](https://github.com/inspect-js/which-typed-array/commit/06cfb1bc0ca7881d1bd1621fa946a16366cd6afc) +- [Tests] up to `node` `v7.0`, `v6.9`, `v4.6`; improve test matrix [`df76eaa`](https://github.com/inspect-js/which-typed-array/commit/df76eaa39b94b28147e81a89bb587e8aa3e3dba3) +- [New] add `BigInt64Array` and `BigUint64Array` [`d6bca3a`](https://github.com/inspect-js/which-typed-array/commit/d6bca3a68ccfe33f6659a24b770068e89dab1592) +- [Dev Deps] update `jscs`, `nsp`, `eslint` [`f23b45b`](https://github.com/inspect-js/which-typed-array/commit/f23b45b2796bd1f63ddddf28b4b80b9709478cb3) +- [Dev Deps] update `@ljharb/eslint-config`, `eslint`, `semver`, `tape` [`ddb4484`](https://github.com/inspect-js/which-typed-array/commit/ddb4484adc3b45c4396632611556055f3b2f5990) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `is-callable`, `replace`, `semver`, `tape` [`4524e59`](https://github.com/inspect-js/which-typed-array/commit/4524e593e9387c185d5632696c62c1600c0b380f) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`1ec7056`](https://github.com/inspect-js/which-typed-array/commit/1ec70568565c479a6168b03e0a5aec6ec9ac5a21) +- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`799487d`](https://github.com/inspect-js/which-typed-array/commit/799487d666b32d1ae0d27cfededf2f5480c5faea) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`8092598`](https://github.com/inspect-js/which-typed-array/commit/8092598998a1f9f8005b4e3d299eb09c96fa2e21) +- [Tests] up to `node` `v11.10` [`a5aabb1`](https://github.com/inspect-js/which-typed-array/commit/a5aabb1910e8408f857a791253487824c7c758d3) +- [Dev Deps] update `@ljharb/eslint-config`, `eslint`, `nsp`, `semver`, `tape` [`277be33`](https://github.com/inspect-js/which-typed-array/commit/277be331d9f05ff95644d6bcd896547ca620cd8e) +- [Tests] use `npm audit` instead of `nsp` [`ee97dc7`](https://github.com/inspect-js/which-typed-array/commit/ee97dc7c5d384d68f60ce6cb5a85d9509e75f72b) +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` [`262ffb0`](https://github.com/inspect-js/which-typed-array/commit/262ffb025facb0795b33fbd5131183bdbc0a40f6) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`d6bbcfc`](https://github.com/inspect-js/which-typed-array/commit/d6bbcfc3eea427f0156fbdcf9ae11dbf3745a755) +- [Tests] up to `node` `v6.2` [`2ff89eb`](https://github.com/inspect-js/which-typed-array/commit/2ff89eb91754146c0bc1ae689f37458d84f6e690) +- Only apps should have lockfiles [`e2bc271`](https://github.com/inspect-js/which-typed-array/commit/e2bc271e1e9a6481a2836f892177825a808c331c) +- [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` [`b79e93b`](https://github.com/inspect-js/which-typed-array/commit/b79e93bf15c871ce0ff24fa3ad61001707eea463) +- [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` [`016dbff`](https://github.com/inspect-js/which-typed-array/commit/016dbff8c49c32cda7ec80d86006c8a7c43bc40c) +- [Dev Deps] update `eslint`, `tape` [`6ce4bbc`](https://github.com/inspect-js/which-typed-array/commit/6ce4bbc5f6caf632cbcf9ababbfe36e1bf4093d7) +- [Tests] on `node` `v10.1` [`f0683a0`](https://github.com/inspect-js/which-typed-array/commit/f0683a0c17e039e926ecaad4c4c341cd8e5878f1) +- [Tests] up to `node` `v7.2` [`2f29cef`](https://github.com/inspect-js/which-typed-array/commit/2f29cef42d30f87259cd6687c25a79ae4651d0c9) +- [Dev Deps] update `replace` [`73b5ba6`](https://github.com/inspect-js/which-typed-array/commit/73b5ba6e87638d13553985977cab9d1bad33e242) +- [Deps] update `function-bind` [`c8a18c2`](https://github.com/inspect-js/which-typed-array/commit/c8a18c2982e6b126ecc1d4655ec2e53b05535b20) +- [Tests] on `node` `v5.12` [`812102b`](https://github.com/inspect-js/which-typed-array/commit/812102bf223422da8f7a89e5a1308214dd158571) +- [Tests] on `node` `v5.10` [`271584f`](https://github.com/inspect-js/which-typed-array/commit/271584f3a8b10ef68a7d419ac0062b444e63d07c) + +## [v1.0.1](https://github.com/inspect-js/which-typed-array/compare/v1.0.0...v1.0.1) - 2016-03-19 + +### Commits + +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `is-callable` [`4a628c5`](https://github.com/inspect-js/which-typed-array/commit/4a628c520d8e080a9fa7e8218947d3b2ceedca72) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `is-callable` [`8e09372`](https://github.com/inspect-js/which-typed-array/commit/8e09372ded877a191cbf777060483227d5071e84) +- [Tests] up to `node` `v5.6`, `v4.3` [`3a35bf9`](https://github.com/inspect-js/which-typed-array/commit/3a35bf9fb9c7f8e6ac1b579ed2754087351ad1a5) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`9410d5e`](https://github.com/inspect-js/which-typed-array/commit/9410d5e35db4b834827b31ea1723bbeebbcde5ba) +- [Fix] `Symbol.toStringTag` is on the super-[[Prototype]] of Float32Array, not the [[Prototype]]. [`7c40a3a`](https://github.com/inspect-js/which-typed-array/commit/7c40a3a05046bbbd188340fb19471ad913e4af05) +- [Tests] up to `node` `v5.9`, `v4.4` [`07878e7`](https://github.com/inspect-js/which-typed-array/commit/07878e7cd23d586ddb9e85a03f675e0a574db246) +- Use the object form of "author" in package.json [`65caa56`](https://github.com/inspect-js/which-typed-array/commit/65caa560d1c0c15c1080b25a9df55c7373c73f08) +- [Tests] use pretest/posttest for linting/security [`c170f7e`](https://github.com/inspect-js/which-typed-array/commit/c170f7ebcf07475d6420f2d2d2d08b1646280cd4) +- [Deps] update `is-typed-array` [`9ab324e`](https://github.com/inspect-js/which-typed-array/commit/9ab324e746a7552b2d9363777fc5c9f5c2e31ce7) +- [Deps] update `function-bind` [`a723142`](https://github.com/inspect-js/which-typed-array/commit/a723142c70a5b6a4f8f5feecc9705619590f4eeb) +- [Deps] update `is-typed-array` [`ed82ce4`](https://github.com/inspect-js/which-typed-array/commit/ed82ce4e8ecc657fc6e839d23ef6347497bc93be) +- [Tests] on `node` `v4.2` [`f581c20`](https://github.com/inspect-js/which-typed-array/commit/f581c2031990668894a8e5a08eaf01a2548e822c) + +## v1.0.0 - 2015-10-05 + +### Commits + +- Dotfiles / Makefile [`667f89a`](https://github.com/inspect-js/which-typed-array/commit/667f89a9046502594e2559dbf5568e062af3b770) +- Tests. [`a14d05e`](https://github.com/inspect-js/which-typed-array/commit/a14d05ef443d2ac678cb0567befc0abf8cf21709) +- package.json [`560b1aa`](https://github.com/inspect-js/which-typed-array/commit/560b1aa4f8bbc5d41d9cee96c93faf08c25be0e5) +- Read me [`a22096e`](https://github.com/inspect-js/which-typed-array/commit/a22096e05773f93b34e672d3f743ec6f1963bc24) +- Implementation [`0b1ae28`](https://github.com/inspect-js/which-typed-array/commit/0b1ae2848372f6256cf075d687e3722878e67aca) +- Initial commit [`4b32f0a`](https://github.com/inspect-js/which-typed-array/commit/4b32f0a9d32165d6ab91797d6971ea83cf4ce9da) diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/LICENSE b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/LICENSE new file mode 100644 index 00000000..b43df444 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/README.md b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/README.md new file mode 100644 index 00000000..9cec943b --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/README.md @@ -0,0 +1,68 @@ +# which-typed-array [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Which kind of Typed Array is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag. + +## Example + +```js +var whichTypedArray = require('which-typed-array'); +var assert = require('assert'); + +assert.equal(false, whichTypedArray(undefined)); +assert.equal(false, whichTypedArray(null)); +assert.equal(false, whichTypedArray(false)); +assert.equal(false, whichTypedArray(true)); +assert.equal(false, whichTypedArray([])); +assert.equal(false, whichTypedArray({})); +assert.equal(false, whichTypedArray(/a/g)); +assert.equal(false, whichTypedArray(new RegExp('a', 'g'))); +assert.equal(false, whichTypedArray(new Date())); +assert.equal(false, whichTypedArray(42)); +assert.equal(false, whichTypedArray(NaN)); +assert.equal(false, whichTypedArray(Infinity)); +assert.equal(false, whichTypedArray(new Number(42))); +assert.equal(false, whichTypedArray('foo')); +assert.equal(false, whichTypedArray(Object('foo'))); +assert.equal(false, whichTypedArray(function () {})); +assert.equal(false, whichTypedArray(function* () {})); +assert.equal(false, whichTypedArray(x => x * x)); +assert.equal(false, whichTypedArray([])); + +assert.equal('Int8Array', whichTypedArray(new Int8Array())); +assert.equal('Uint8Array', whichTypedArray(new Uint8Array())); +assert.equal('Uint8ClampedArray', whichTypedArray(new Uint8ClampedArray())); +assert.equal('Int16Array', whichTypedArray(new Int16Array())); +assert.equal('Uint16Array', whichTypedArray(new Uint16Array())); +assert.equal('Int32Array', whichTypedArray(new Int32Array())); +assert.equal('Uint32Array', whichTypedArray(new Uint32Array())); +assert.equal('Float32Array', whichTypedArray(new Float32Array())); +assert.equal('Float64Array', whichTypedArray(new Float64Array())); +assert.equal('BigInt64Array', whichTypedArray(new BigInt64Array())); +assert.equal('BigUint64Array', whichTypedArray(new BigUint64Array())); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/which-typed-array +[npm-version-svg]: https://versionbadg.es/inspect-js/which-typed-array.svg +[deps-svg]: https://david-dm.org/inspect-js/which-typed-array.svg +[deps-url]: https://david-dm.org/inspect-js/which-typed-array +[dev-deps-svg]: https://david-dm.org/inspect-js/which-typed-array/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/which-typed-array#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/which-typed-array.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/which-typed-array.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/which-typed-array.svg +[downloads-url]: https://npm-stat.com/charts.html?package=which-typed-array +[codecov-image]: https://codecov.io/gh/inspect-js/which-typed-array/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/which-typed-array/ +[actions-image]: https://img.shields.io/github/check-runs/inspect-js/which-typed-array/main +[actions-url]: https://github.com/inspect-js/which-typed-array/actions diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.d.ts b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.d.ts new file mode 100644 index 00000000..0dcfe5aa --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.d.ts @@ -0,0 +1,312 @@ +/** + * Determines the type of the given collection, or returns false. + * + * @param {unknown} value The potential collection + * @returns {TypedArrayName | false | null} 'Int8Array' | 'Uint8Array' | 'Uint8ClampedArray' | 'Int16Array' | 'Uint16Array' | 'Int32Array' | 'Uint32Array' | 'Float32Array' | 'Float64Array' | 'BigInt64Array' | 'BigUint64Array' | false | null + */ +declare function whichTypedArray( + value: T & whichTypedArray.TypedArray, +): whichTypedArray.WhichTypedArray; +declare function whichTypedArray( + value: unknown, +): false | null | whichTypedArray.TypedArrayName; + +import TAs from 'available-typed-arrays'; + +/** the names the consumer's `lib` declares a global for, so there is a type to compare against */ +type DeclaredName = whichTypedArray.TypedArrayName & keyof typeof globalThis; + +/** the names it does not (eg, `Float16Array` under `lib: es2020`), which are still possible at runtime */ +type UndeclaredName = Exclude; + +type Instance = typeof globalThis[Name]['prototype']; + +type IsAny = 0 extends (1 & T) ? true : false; + +type RequiredKeys = { + [K in keyof T]-?: {} extends Pick ? never : K +}[keyof T]; + +/** the key types of `T`'s index signatures, found by `{}` having them covered already */ +type IndexKeys = { + [K in keyof T]-?: {} extends Record ? K : never +}[keyof T]; + +/** + * The keys of `T` that can be read off a value by name. An index signature is not a + * named member, but a `string`-keyed one cannot be told apart here from the named + * string members beside it, so it is left in and they are taken at face value. + */ +type NamedKeys = Exclude, string>>; + +/** `Object`'s members are on every object type, even though `keyof` does not list them */ +type Apparent = K extends keyof T + ? T[K] + : K extends keyof Object + ? Object[K] + : unknown; + +/** + * The typed arrays' symbol-keyed member whose value is a string, which is + * `Symbol.toStringTag` in a `lib` that declares symbols and `never` in one that + * does not (`lib: es5`). Deriving it this way leaves the tag comparisons below + * with no information to go on, rather than naming `Symbol` in a `lib` without it. + */ +type TagKey = { + [K in keyof whichTypedArray.TypedArray & symbol]: whichTypedArray.TypedArray[K] extends string ? K : never +}[keyof whichTypedArray.TypedArray & symbol]; + +/** `unknown` when `T` says nothing about its own tag, which rules no name out */ +type TagOf = [TagKey] extends [never] + ? unknown + : TagKey extends keyof T + ? T[TagKey & keyof T] + : unknown; + +/** one value can carry both tags when either is assignable to the other */ +type TagsMeet = IsAny extends true + ? true + : IsAny extends true + ? true + : [Extract] extends [never] + ? ([Extract] extends [never] ? false : true) + : true; + +/** how many levels of members `Related` walks before it stops looking for a conflict */ +type Prev = [ + never, + 0, + 1, + 2, + 3, +]; + +type Depth = 0 | 1 | 2 | 3 | 4; + +/** + * A rough stand-in for the comparability check TypeScript itself runs to decide + * whether `x === someTypedArray` is worth allowing. One value can be a `Source` and + * a `Target` at once if the two already share a constituent, or if neither is an + * object type and one is assignable to the other; failing that, `D` more levels of + * members and signatures are compared, in this direction only - `Meets` runs both. + * + * It is a heuristic, not that check, and it leans towards saying the two can meet. + * A conflict further down than `D` levels is not looked for, so a name can be left + * in that no value could produce. It also drops names TypeScript would have allowed: + * a `Source` that carries a call signature, or a member declared with its own type + * parameters, meets nothing, and only the last signature of an overloaded member is + * compared. + * + * `Stale` marks a comparison standing in for a name this `lib` has no type for, where + * a member the `lib` has never heard of is weaker evidence (see `GatedOn`). + */ +type Related = IsAny extends true + ? true + : IsAny extends true + ? true + : [Extract] extends [never] + ? (Widens extends true ? true : Deeply) + : true; + +/** neither side being an object type, one value fits both when either is assignable to the other */ +type Widens = [Source] extends [object] + ? false + : [Target] extends [object] + ? false + : ([Extract] extends [never] ? false : true); + +/** a union on either side only needs one part that can meet one part of the other */ +type Deeply = [D] extends [0] + ? true + : true extends (Source extends unknown + ? (Target extends unknown ? Structurally : never) + : never) + ? true + : false; + +type Structurally = [Source] extends [(...args: infer SP) => infer SR] + ? ([Target] extends [(...args: infer TP) => infer TR] + ? (Related extends true ? ParamsRelated : false) + : false) + : [Target] extends [Function] + ? false + : [Source] extends [object] + ? ([Target] extends [object] ? Membered : false) + : false; + +/** each pair of parameters only has to meet, in either direction, as with an overridden method */ +type ParamsRelated = false extends { + [K in keyof SP]: K extends keyof TP ? Related : true +}[number] + ? false + : true; + +type Membered = GatedOn extends true + ? (TagsMeet, TagOf> extends true ? EachMember : false) + : false; + +/** + * Whether a member `Target` requires but `Source` lacks counts against the two + * meeting. At the top of a comparison it does. Below that, in a comparison standing + * in for a name this `lib` has no type for, one side is the `lib`'s own type for a + * typed array or one of its members, and a member missing from that is as easily an + * older `lib`'s gap as a real conflict, so it is not counted - which is how such a + * name survives an input written in terms of a newer member, as + * `{ buffer: { byteLength: number } & { resizable: boolean } }` is. + */ +type GatedOn = [Stale, D] extends [true, 0 | 1 | 2 | 3] + ? true + : Compatible; + +/** the members of `Target` that `Source`, or `Object` behind it, also has */ +type SharedKeys = keyof Target & (keyof Source | keyof Object); + +type EachMember = false extends { + [K in SharedKeys]: Related, Target[K], Prev[D], Stale> +}[SharedKeys] + ? false + : true; + +/** + * `Source` has something to offer for every member `Target` requires. `Target`'s + * optional members are left out on purpose: one value can be a `Source` and a + * `Target` at once while having none of them. + */ +type Compatible = [Exclude, NamedKeys | keyof Object>] extends [never] + ? IndexesCovered + : false; + +/** + * Each index signature `Target` has needs one on `Source` with the same keys, or a + * value type of `any`, which anything satisfies. Numeric-string keys are the + * exception: they reach a `number` index signature, so `Source` having one of those + * covers them, as long as what it holds can be what `Target` asks for. + */ +type IndexesCovered = [{ + [K in IndexKeys]: IsAny extends true + ? never + : (K extends IndexKeys + ? never + : (string extends K + ? K + : (`${number}` extends K + ? (Related extends true ? never : K) + : K))) +}[IndexKeys]] extends [never] + ? true + : false; + +/** + * `T` is not assignable to a plain copy of its own members, which is what a + * `private`, `protected` or `#private` member does to a class, and what a call or + * construct signature does to any type - none of which a typed array has, so nothing + * outside that class can be one. + */ +type IsNominal = { + [K in keyof T]: T[K] +} extends T + ? false + : true; + +/** + * Whether a `T` and an `I` look like they could be one value. A nominal `T` only + * gets the one direction: nothing outside its class can be a `T`, but a `T` whose + * members are all there can still be a typed array. + */ +type Meets = Related extends true + ? true + : (Nominal extends true ? false : Related); + +type MayBe = TagsMeet>, TagOf> extends true + ? Meets, IsNominal, false> + : false; + +type PossibleNames = { + [Name in DeclaredName]: MayBe extends true ? Name : never +}[DeclaredName]; + +/** the members the typed arrays this `lib` declares actually have */ +type KnownKey = keyof Object | { + [Name in DeclaredName]: keyof Instance +}[DeclaredName]; + +type UnknownKeys = Exclude, KnownKey>; + +type WithoutUnknown = Pick>>; + +/** of those, the ones holding data rather than a method */ +type UnknownDataKeys = { + [K in UnknownKeys]: T[K & keyof T] extends Function ? never : K +}[UnknownKeys]; + +type MeetsAny = true extends { + [Name in DeclaredName]: Meets, Nominal, true> +}[DeclaredName] + ? true + : false; + +/** + * An undeclared name has no type in this `lib`, so there is nothing to compare `T` + * to: the declared typed arrays stand in for it, with the members `T` requires that + * none of them has set aside, so that a `T` asking for a member only a newer `lib` + * knows about - `at` under `lib: es2020` - can still be the name that `lib` lacks. + * + * Setting a member aside loses whatever it said, and a member the `lib` has not heard + * of further down is not counted either (see `GatedOn`), so this is looser than the + * test for a declared name. A member that is data rather than a method is kept as + * evidence, on the guess that a newer `lib` mostly adds methods; that guess, and the + * stand-in itself, are why an undeclared name is the one that survives most often - + * `DataView`, whose own methods are all set aside, keeps one. + */ +type MayBeUndeclared = IsAny extends true + ? true + : [unknown] extends [T] + ? true + : [T] extends [Function] + ? false + : [T] extends [object] + ? ([UnknownDataKeys] extends [never] ? MeetsAny, IsNominal> : false) + : false; + +/** a specific tag names the typed array outright; a `string` tag leaves it to the members */ +type PossibleUndeclaredNames = [UndeclaredName] extends [never] + ? never + : string extends TagOf + ? (MayBeUndeclared extends true ? UndeclaredName : never) + : Extract>; + +declare namespace whichTypedArray { + export type TypedArrayName = ReturnType[number]; + + // a consumer's `lib` may not declare every name (eg, `Float16Array`), so only look up the globals it has + export type TypedArrayConstructor = typeof globalThis[TypedArrayName & keyof typeof globalThis]; + + export type TypedArray = TypedArrayConstructor['prototype']; + + /** + * Distributes over `T`, so a subset of typed arrays maps to the matching + * subset of names (`Int8Array | Uint8Array` -> `'Int8Array' | 'Uint8Array'`, + * never a float16 or bigint name), and a `T` that is not definitely a typed + * array also gets `false | null`. + * + * For everything else - `object`, `ArrayBufferView`, `{ length: 0 }`, a + * duck-typed stand-in - it keeps the names that `T`'s own members do not rule + * out, so comparing the result to one of those names is usually not reported as a + * comparison that can never be true. The rule behind that is a heuristic (see + * `Related`), so it can keep a name no value of `T` could produce, and a `T` whose + * conflict with a name is buried deeply enough will keep that name too. A name + * this `lib` has no type for (see `MayBeUndeclared`) is kept more readily still. + * + * Derived entirely from `TypedArrayName`, so a new entry in `available-typed-arrays` flows through with no other change here. + */ + export type WhichTypedArray = T extends unknown + ? + | PossibleNames + | PossibleUndeclaredNames + | ([T] extends [TypedArray] + ? (IsAny extends true ? false | null : never) + : false | null) + : never; +} + +export = whichTypedArray; diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.js b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.js new file mode 100644 index 00000000..a0b2633b --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/index.js @@ -0,0 +1,134 @@ +'use strict'; + +var forEach = require('for-each'); +var availableTypedArrays = require('available-typed-arrays'); +var callBind = require('call-bind'); +var callBound = require('call-bound'); +var gOPD = require('gopd'); +var getProto = require('get-proto'); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = require('has-tostringtag/shams')(); + +var g = typeof globalThis === 'undefined' ? global : globalThis; +var typedArrays = availableTypedArrays(); + +var $slice = callBound('String.prototype.slice'); + +/** @import { BoundSet, BoundSlice, Cache, Getter } from './types' */ +/** @import { TypedArrayName } from '.' */ + +/** @type {(array: readonly T[], value: unknown) => number} */ +var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { + for (var i = 0; i < array.length; i += 1) { + if (array[i] === value) { + return i; + } + } + return -1; +}; + +/** @type {Cache} */ +var cache = { __proto__: null }; +if (hasToStringTag && gOPD && getProto) { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr && getProto) { + var proto = getProto(arr); + // @ts-expect-error TS won't narrow inside a closure + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor && proto) { + var superProto = getProto(proto); + // @ts-expect-error TS won't narrow inside a closure + descriptor = gOPD(superProto, Symbol.toStringTag); + } + if (descriptor && descriptor.get) { + var bound = callBind(descriptor.get); + cache[ + /** @type {`$${TypedArrayName}`} */ + ('$' + typedArray) + ] = bound; + } + } + }); +} else { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + var fn = arr.slice || arr.set; + if (fn) { + var bound = /** @type {typeof BoundSlice | typeof BoundSet} */ ( + // @ts-expect-error TODO FIXME + callBind(fn) + ); + cache[ + /** @type {`$${TypedArrayName}`} */ + ('$' + typedArray) + ] = bound; + } + }); +} + +/** @type {(value: object) => false | TypedArrayName} */ +function tryTypedArrays(value) { + /** @type {ReturnType} */ var found = false; + forEach( + /** @type {Record<`$${TypedArrayName}`, Getter>} */ (cache), + /** @param {Getter} getter @param {`$${TypedArrayName}`} typedArray */ + function (getter, typedArray) { + if (!found) { + try { + // @ts-expect-error a throw is fine here + if ('$' + getter(value) === typedArray) { + found = /** @type {TypedArrayName} */ ($slice(typedArray, 1)); + } + } catch (e) { /**/ } + } + } + ); + return found; +} + +/** @type {(value: object) => false | TypedArrayName} */ +function trySlices(value) { + /** @type {ReturnType} */ var found = false; + forEach( + /** @type {Record<`$${TypedArrayName}`, Getter>} */(cache), + /** @param {Getter} getter @param {`$${TypedArrayName}`} name */ function (getter, name) { + if (!found) { + try { + // @ts-expect-error a throw is fine here + getter(value); + found = /** @type {TypedArrayName} */ ($slice(name, 1)); + } catch (e) { /**/ } + } + } + ); + return found; +} + +/** @type {(tag: unknown) => tag is typeof typedArrays[number]} */ +function isTATag(tag) { + return $indexOf(typedArrays, tag) > -1; +} + +/** @type {(value: unknown) => ReturnType} */ +function whichTypedArray(value) { + if (!value || typeof value !== 'object') { + return false; + } + if (!hasToStringTag) { + var tag = $slice($toString(value), 8, -1); + if (isTATag(tag)) { + return tag; + } + if (tag !== 'Object') { + return false; + } + // node < 0.6 hits here on real Typed Arrays + return trySlices(value); + } + if (!gOPD) { return null; } // unknown engine + return tryTypedArrays(value); +} + +module.exports = whichTypedArray; diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/package.json b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/package.json new file mode 100644 index 00000000..6256c204 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/package.json @@ -0,0 +1,131 @@ +{ + "name": "which-typed-array", + "version": "1.1.24", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "description": "Which kind of Typed Array is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.", + "license": "MIT", + "main": "index.js", + "types": "./index.d.ts", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent lint", + "test": "npm run tests-only && npm run test:harmony", + "tests-only": "nyc tape test", + "test:harmony": "nyc node --harmony --es-staging test", + "posttest": "npx npm@'>=10.2' audit --production", + "lint": "eslint .", + "postlint": "tsc -p . && tsc -p test/es2020 && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "dependencies": "node -p \"process.env.npm_command\" | npx \"dt-clean@^1.2.2\" --auto" + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/which-typed-array.git" + }, + "keywords": [ + "array", + "TypedArray", + "typed array", + "which", + "typed", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "ES6", + "toStringTag", + "Symbol.toStringTag", + "@@toStringTag" + ], + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.5", + "@ljharb/eslint-config": "^22.2.4", + "@ljharb/tsconfig": "^0.3.2", + "@types/call-bind": "^1.0.5", + "@types/is-callable": "^1.1.2", + "@types/make-arrow-function": "^1.2.2", + "@types/make-generator-function": "^2.0.3", + "@types/node": "^22.20.3", + "auto-changelog": "^2.6.1", + "eslint": "^10.10.0", + "in-publish": "^2.0.1", + "is-callable": "^1.2.7", + "jiti": "^0.0.0", + "make-arrow-function": "^1.2.0", + "make-generator-function": "^2.1.0", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.10.2", + "typescript": "next" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "eslint.config.mjs", + "test", + "types.d.ts" + ] + } +} diff --git a/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/tsconfig.json b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/tsconfig.json new file mode 100644 index 00000000..dcdc3b08 --- /dev/null +++ b/backend/node_modules/.pnpm/which-typed-array@1.1.24/node_modules/which-typed-array/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ESNext", + }, + "exclude": [ + "coverage" + ] +} diff --git a/backend/node_modules/@apollo/server b/backend/node_modules/@apollo/server new file mode 120000 index 00000000..e990e205 --- /dev/null +++ b/backend/node_modules/@apollo/server @@ -0,0 +1 @@ +../.pnpm/@apollo+server@5.5.1_graphql@17.0.2/node_modules/@apollo/server \ No newline at end of file diff --git a/backend/node_modules/graphql b/backend/node_modules/graphql new file mode 120000 index 00000000..eb3a9984 --- /dev/null +++ b/backend/node_modules/graphql @@ -0,0 +1 @@ +.pnpm/graphql@17.0.2/node_modules/graphql \ No newline at end of file diff --git a/backend/node_modules/graphql-tag b/backend/node_modules/graphql-tag new file mode 120000 index 00000000..1877a468 --- /dev/null +++ b/backend/node_modules/graphql-tag @@ -0,0 +1 @@ +.pnpm/graphql-tag@2.12.7_graphql@17.0.2/node_modules/graphql-tag \ No newline at end of file diff --git a/backend/node_modules/mongoose b/backend/node_modules/mongoose new file mode 120000 index 00000000..03b9dcfc --- /dev/null +++ b/backend/node_modules/mongoose @@ -0,0 +1 @@ +.pnpm/mongoose@9.10.2/node_modules/mongoose \ No newline at end of file diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 00000000..4c8e1faa --- /dev/null +++ b/backend/package.json @@ -0,0 +1,27 @@ +{ + "name": "backend", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devEngines": { + "packageManager": { + "name": "pnpm", + "version": "12.6.0", + "onFail": "download" + } + }, + "packageManager": "pnpm@12.6.0", + "type": "module", + "dependencies": { + "@apollo/server": "^5.5.1", + "graphql": "^17.0.2", + "graphql-tag": "^2.12.7", + "mongoose": "^9.10.2" + } +} diff --git a/backend/pnpm-lock.yaml b/backend/pnpm-lock.yaml new file mode 100644 index 00000000..88fca776 --- /dev/null +++ b/backend/pnpm-lock.yaml @@ -0,0 +1,1247 @@ +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + pnpm: + specifier: 12.6.0 + version: 12.6.0 + +packages: + + '@pnpm/exe.android-arm64@12.6.0': + resolution: {integrity: sha512-kviIHft9h02q+7N2In7tSL9T/HRUSGwYmU74YPtsWU5ee7vgqPyC0JT6RRX6miW+NxX1CvHgQxg69qq1qTLJYQ==} + cpu: [arm64] + os: [android] + + '@pnpm/exe.android-x64@12.6.0': + resolution: {integrity: sha512-CT8aJKLq2mtZFE71pr4E5Z2xHL8uGnRGr+NclDqsXlVF4SVcQ2QAs14mWi0C8gjT4hbmi+Q0lJRRIkMAWfjjng==} + cpu: [x64] + os: [android] + + '@pnpm/exe.darwin-arm64@12.6.0': + resolution: {integrity: sha512-rafpVkjzugKBMxSvGQd5wK1x5eOTkD/+lcJIFHeQhvd+BJ8kDisOOvwhQDrpGd4vd2Fx+hhW0P2Ptt638OlhFg==} + cpu: [arm64] + os: [darwin] + + '@pnpm/exe.darwin-x64@12.6.0': + resolution: {integrity: sha512-72Jpuv1m24gI8zUNcaylYpBWEhBzz1VPhnDIU2GYM2eRP+KsOqVLwV78i+JrihI39zY2NNXmaN4eAKX1inpaDQ==} + cpu: [x64] + os: [darwin] + + '@pnpm/exe.freebsd-x64@12.6.0': + resolution: {integrity: sha512-LON4QgNy1w/XF4uySZIyC/5hEB0oGdelXsY9tSKqstER+2j2X2oHz67skD11RRd/HWFRtMr64shQZ4I9ZoZ0zg==} + cpu: [x64] + os: [freebsd] + + '@pnpm/exe.linux-arm64-musl@12.6.0': + resolution: {integrity: sha512-BdDpX+DeaMUc5x6WNcE6FkmFy36NwrBbBvwsZU737Zt3u1fTY+iKFPchjEQNCM4rT6q6xvF2oN3ZwExGsJCkxQ==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-arm64@12.6.0': + resolution: {integrity: sha512-8h2sNoIhHDpHDYqZZCh9PXr6krqW10btb0GHVGuw710muDHlFAHMtUG2ogmaHge6zJG1xgY4Y7mwX5g/LWvrYg==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-ppc64@12.6.0': + resolution: {integrity: sha512-ld6xgcEhFCFrsVsJhbmdmR714PnsEspO/Ij8w0/D7OSiz2hYGu3fZd5tKRxOI5m6H6Gl0/RRFAPncTHbsgXVjQ==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-riscv64@12.6.0': + resolution: {integrity: sha512-HIbImydoC3J8NFt+8MXfhTCf5rO6NjCMyinSAHac0VmV8uCHw+kbQkyAzxV84rzz9ZOzmBOnj0b1N461UIYGsw==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-s390x@12.6.0': + resolution: {integrity: sha512-DjSqT7+BZ/lWcDHwNMuzsRVfyxUimh+D54Xw4tSWbdVVQhtWtNMUyI93LVnwCmsoEpar2gC3SFeAgywx37svKQ==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-x64-musl@12.6.0': + resolution: {integrity: sha512-31lKeGPmRE6xfV6I3VjaEGVFRei14pl/zgoFDK4w+UkbJqOuNl2Ht3O1GuqNIg3Gl14qTEb4kZRAYFHXifDx9A==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-x64@12.6.0': + resolution: {integrity: sha512-qFWBneHJAJ73W4whtbaFOL1M/7DBC6ILHXuxc7ZPtEhfPuT1zeZiGrmKHoMAfJA+mcm6xhOFljqVTUS+00Jabw==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.win32-arm64@12.6.0': + resolution: {integrity: sha512-OhfefXEEykZlslSUhR8PPRe6MVPV3Oink/dVfIecE5velpc7j80cZYsHlaDrtRDcm3TPwQHkaRW1SJ1efX9oFg==} + cpu: [arm64] + os: [win32] + + '@pnpm/exe.win32-x64@12.6.0': + resolution: {integrity: sha512-L2tuyrD2+Imgxs3VK/ST/2L3xD6vDP0ktJQxM0TaGw7TbAQEMq+RMc8iK6Ew7Id579uzjJe8jSfJID2ZGsOHCA==} + cpu: [x64] + os: [win32] + + pnpm@12.6.0: + resolution: {integrity: sha512-PvaPlRyxEawgS0paFvCy3fDaVqluBBPoHYVdnwtV75JnFHCQKOHNAMQFwsX7e56OxNxGd3yAXQNzwvL/AP0g7A==} + engines: {node: '>=18.*'} + hasBin: true + +snapshots: + + '@pnpm/exe.android-arm64@12.6.0': + optional: true + + '@pnpm/exe.android-x64@12.6.0': + optional: true + + '@pnpm/exe.darwin-arm64@12.6.0': + optional: true + + '@pnpm/exe.darwin-x64@12.6.0': + optional: true + + '@pnpm/exe.freebsd-x64@12.6.0': + optional: true + + '@pnpm/exe.linux-arm64-musl@12.6.0': + optional: true + + '@pnpm/exe.linux-arm64@12.6.0': + optional: true + + '@pnpm/exe.linux-ppc64@12.6.0': + optional: true + + '@pnpm/exe.linux-riscv64@12.6.0': + optional: true + + '@pnpm/exe.linux-s390x@12.6.0': + optional: true + + '@pnpm/exe.linux-x64-musl@12.6.0': + optional: true + + '@pnpm/exe.linux-x64@12.6.0': + optional: true + + '@pnpm/exe.win32-arm64@12.6.0': + optional: true + + '@pnpm/exe.win32-x64@12.6.0': + optional: true + + pnpm@12.6.0: + optionalDependencies: + '@pnpm/exe.android-arm64': 12.6.0 + '@pnpm/exe.android-x64': 12.6.0 + '@pnpm/exe.darwin-arm64': 12.6.0 + '@pnpm/exe.darwin-x64': 12.6.0 + '@pnpm/exe.freebsd-x64': 12.6.0 + '@pnpm/exe.linux-arm64': 12.6.0 + '@pnpm/exe.linux-arm64-musl': 12.6.0 + '@pnpm/exe.linux-ppc64': 12.6.0 + '@pnpm/exe.linux-riscv64': 12.6.0 + '@pnpm/exe.linux-s390x': 12.6.0 + '@pnpm/exe.linux-x64': 12.6.0 + '@pnpm/exe.linux-x64-musl': 12.6.0 + '@pnpm/exe.win32-arm64': 12.6.0 + '@pnpm/exe.win32-x64': 12.6.0 + +--- +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@apollo/server': + specifier: ^5.5.1 + version: 5.5.1(graphql@17.0.2) + graphql: + specifier: ^17.0.2 + version: 17.0.2 + graphql-tag: + specifier: ^2.12.7 + version: 2.12.7(graphql@17.0.2) + mongoose: + specifier: ^9.10.2 + version: 9.10.2 + +packages: + + '@apollo/cache-control-types@1.0.3': + resolution: {integrity: sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g==} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/protobufjs@1.2.8': + resolution: {integrity: sha512-r7xNeUqZX+eBBEmyvaPw0/cSz6zgf5jdH8mjUz8ynKpNs/GU7vi2T7sNcZINk2ZID7wwjG91FCgdpCrQuJ8rzA==} + hasBin: true + + '@apollo/server-gateway-interface@2.0.0': + resolution: {integrity: sha512-3HEMD6fSantG2My3jWkb9dvfkF9vJ4BDLRjMgsnD790VINtuPaEp+h3Hg9HOHiWkML6QsOhnaRqZ+gvhp3y8Nw==} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/server@5.5.1': + resolution: {integrity: sha512-Rn3g5TJQsMSUY23CWZTghWdBWyjX7dP1eaEBPkvmM2RHi82cDcpgTIkSCbGvtTUEGjwopLv1AAooU/n7iIZ20A==} + engines: {node: '>=20'} + peerDependencies: + graphql: ^16.11.0 + + '@apollo/usage-reporting-protobuf@4.1.2': + resolution: {integrity: sha512-aTnAD41RYz0d5dawlyR5Iclkgzx0Xb0njUJmEfvZ6pS4f4HU8wCYyctPpWat/HWp2PmRwDfX5R1k4uVcDKZ4xA==} + + '@apollo/utils.createhash@3.0.1': + resolution: {integrity: sha512-CKrlySj4eQYftBE5MJ8IzKwIibQnftDT7yGfsJy5KSEEnLlPASX0UTpbKqkjlVEwPPd4mEwI7WOM7XNxEuO05A==} + engines: {node: '>=16'} + + '@apollo/utils.dropunuseddefinitions@2.0.1': + resolution: {integrity: sha512-EsPIBqsSt2BwDsv8Wu76LK5R1KtsVkNoO4b0M5aK0hx+dGg9xJXuqlr7Fo34Dl+y83jmzn+UvEW+t1/GP2melA==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.fetcher@3.1.0': + resolution: {integrity: sha512-Z3QAyrsQkvrdTuHAFwWDNd+0l50guwoQUoaDQssLOjkmnmVuvXlJykqlEJolio+4rFwBnWdoY1ByFdKaQEcm7A==} + engines: {node: '>=16'} + + '@apollo/utils.isnodelike@3.0.0': + resolution: {integrity: sha512-xrjyjfkzunZ0DeF6xkHaK5IKR8F1FBq6qV+uZ+h9worIF/2YSzA0uoBxGv6tbTeo9QoIQnRW4PVFzGix5E7n/g==} + engines: {node: '>=16'} + + '@apollo/utils.keyvaluecache@4.0.0': + resolution: {integrity: sha512-mKw1myRUkQsGPNB+9bglAuhviodJ2L2MRYLTafCMw5BIo7nbvCPNCkLnIHjZ1NOzH7SnMAr5c9LmXiqsgYqLZw==} + engines: {node: '>=20'} + + '@apollo/utils.logger@3.0.0': + resolution: {integrity: sha512-M8V8JOTH0F2qEi+ktPfw4RL7MvUycDfKp7aEap2eWXfL5SqWHN6jTLbj5f5fj1cceHpyaUSOZlvlaaryaxZAmg==} + engines: {node: '>=16'} + + '@apollo/utils.printwithreducedwhitespace@2.0.1': + resolution: {integrity: sha512-9M4LUXV/fQBh8vZWlLvb/HyyhjJ77/I5ZKu+NBWV/BmYGyRmoEP9EVAy7LCVoY3t8BDcyCAGfxJaLFCSuQkPUg==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.removealiases@2.0.1': + resolution: {integrity: sha512-0joRc2HBO4u594Op1nev+mUF6yRnxoUH64xw8x3bX7n8QBDYdeYgY4tF0vJReTy+zdn2xv6fMsquATSgC722FA==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.sortast@2.0.1': + resolution: {integrity: sha512-eciIavsWpJ09za1pn37wpsCGrQNXUhM0TktnZmHwO+Zy9O4fu/WdB4+5BvVhFiZYOXvfjzJUcc+hsIV8RUOtMw==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.stripsensitiveliterals@2.0.1': + resolution: {integrity: sha512-QJs7HtzXS/JIPMKWimFnUMK7VjkGQTzqD9bKD1h3iuPAqLsxd0mUNVbkYOPTsDhUKgcvUOfOqOJWYohAKMvcSA==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.usagereporting@2.1.0': + resolution: {integrity: sha512-LPSlBrn+S17oBy5eWkrRSGb98sWmnEzo3DPTZgp8IQc8sJe0prDgDuppGq4NeQlpoqEHz0hQeYHAOA0Z3aQsxQ==} + engines: {node: '>=14'} + peerDependencies: + graphql: 14.x || 15.x || 16.x + + '@apollo/utils.withrequired@3.0.0': + resolution: {integrity: sha512-aaxeavfJ+RHboh7c2ofO5HHtQobGX4AgUujXP4CXpREHp9fQ9jPi6K9T1jrAKe7HIipoP0OJ1gd6JamSkFIpvA==} + engines: {node: '>=16'} + + '@graphql-tools/merge@9.2.4': + resolution: {integrity: sha512-vV+8uWNWn0+OsqT0r22lZuoT0cTe6fBqBtpLHre2rriLjI/ZTrsOHmabLPTUOyzgFnRrS2PzFSYGL3zKL1Wj4Q==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/schema@10.1.1': + resolution: {integrity: sha512-24jJghRxEW+SG1lbJ45Zg9HEZ8ZKS923ihbFjOicspFLpryxJkWp6gZJ7D8tCVaSAhli4x1+1wDPAfhT8mLqxg==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-tools/utils@12.0.1': + resolution: {integrity: sha512-8YC6jn4xYDS6YTY6xDAgQAs/nGgvzRaIGHS8GeSfVItQzNK7Ms24CQtE3EJY+amvR+tBnhRSX0N83aGj+V/RIg==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@graphql-typed-document-node/core@3.2.0': + resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@mongodb-js/saslprep@1.5.4': + resolution: {integrity: sha512-05UC0jQsjKAOuXQ0H9Ud9vUTJpZIg+n/FinpR30tI5I8pY2inTfPOZ5OF/cg3Ce/N9MoD1xhRCeOsJtuTbFYlw==} + + '@protobufjs/aspromise@1.1.2': + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + + '@protobufjs/base64@1.1.2': + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + + '@protobufjs/codegen@2.0.5': + resolution: {integrity: sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==} + + '@protobufjs/eventemitter@1.1.1': + resolution: {integrity: sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==} + + '@protobufjs/fetch@1.1.1': + resolution: {integrity: sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==} + + '@protobufjs/float@1.0.2': + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + + '@protobufjs/inquire@1.1.2': + resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==} + + '@protobufjs/path@1.1.2': + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + + '@protobufjs/pool@1.1.0': + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + + '@protobufjs/utf8@1.1.2': + resolution: {integrity: sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@types/long@4.0.2': + resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + + '@types/webidl-conversions@7.0.3': + resolution: {integrity: sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==} + + '@types/whatwg-url@13.0.0': + resolution: {integrity: sha512-N8WXpbE6Wgri7KUSvrmQcqrMllKZ9uxkYWMt+mCSGwNc0Hsw9VQTW7ApqI4XNrx6/SaM2QQJCzMPDEXE058s+Q==} + + '@whatwg-node/promise-helpers@1.3.2': + resolution: {integrity: sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA==} + engines: {node: '>=16.0.0'} + + async-retry@1.3.3: + resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==} + + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + + body-parser@2.3.0: + resolution: {integrity: sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==} + engines: {node: '>=18'} + + bson@7.3.3: + resolution: {integrity: sha512-oz3LwE3qGEhTCSyhzQRLY3Bj1NLOsjFMf6tcmY5J8M+3R7EVcmoBfSHWvjUK3yXCLDUsGpIuB3aQL4nDZ1EV/g==} + engines: {node: '>=20.19.0'} + + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bind@1.0.9: + resolution: {integrity: sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + content-type@2.1.0: + resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==} + engines: {node: '>=18'} + + cors@2.8.6: + resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} + engines: {node: '>= 0.10'} + + cross-inspect@1.0.1: + resolution: {integrity: sha512-Pcw1JTvZLSJH83iiGWt6fRcT+BjZlCDRVwYLbUcHzv/CRpB7r0MlSrGbIyQvVSNyGnbt7G4AXuyCiDR3POvZ1A==} + engines: {node: '>=16.0.0'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.1.2: + resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} + engines: {node: '>= 0.4'} + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + finalhandler@2.1.1: + resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} + engines: {node: '>= 18.0.0'} + + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + graphql-tag@2.12.7: + resolution: {integrity: sha512-xnE/NFzy+0eIesvAsREJZ284zTl/wYuBAvpsFSDhRGRdRHdnE90M21Q3xAWyYInb0J756c6x0pIQ62+vtvOs1Q==} + engines: {node: '>=10'} + peerDependencies: + graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + graphql@17.0.2: + resolution: {integrity: sha512-FRWbddMxfkjiB7z+aQDWIR+E34xo9I8c9mtK2RPv8PmMzKRvrdsreHL/Ui/TmwHJfhHChEtsFPyMHKI+xuarQQ==} + engines: {node: ^22.0.0 || ^24.0.0 || ^25.0.0 || >=26.0.0} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.4: + resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} + engines: {node: '>= 0.4'} + + http-errors@2.0.1: + resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} + engines: {node: '>= 0.8'} + + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + + isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + + kareem@3.4.0: + resolution: {integrity: sha512-JAKhnR4S027v/8949QXNInRskgETCg9rFUMi1VjhGbjX+XltCAAEFcXykkSocNkom1kc66EMJfjWvhj87BDQKg==} + engines: {node: '>=18.0.0'} + + lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + + loglevel@1.9.2: + resolution: {integrity: sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==} + engines: {node: '>= 0.6.0'} + + long@4.0.0: + resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + + lru-cache@11.5.3: + resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} + engines: {node: 20 || >=22} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + media-typer@1.1.1: + resolution: {integrity: sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==} + engines: {node: '>= 0.8'} + + memory-pager@1.5.0: + resolution: {integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@3.0.2: + resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} + engines: {node: '>=18'} + + mongodb-connection-string-url@7.0.2: + resolution: {integrity: sha512-ZoS07RoFqpKYQwAk59qmrx8+jJHNHU30UjlU96QktiGn1ltvDr+vCznLX5DiUBLEpMAHatHNWV1nM/74ul66kA==} + engines: {node: '>=20.19.0'} + + mongodb@7.6.0: + resolution: {integrity: sha512-WbZ6OCjYw2c53LOjfkQa+reXr7kIiOVpXXglnASFuiMtif0BvsMwHe3ClJHLm1/r7wJFwaasfFtD6iYIktB01g==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@aws-sdk/credential-providers': ^3.806.0 + '@mongodb-js/zstd': ^7.0.0 + gcp-metadata: ^7.0.1 + kerberos: ^7.0.0 + mongodb-client-encryption: ^7.2.0 + snappy: ^7.3.2 + socks: ^2.8.6 + peerDependenciesMeta: + '@aws-sdk/credential-providers': + optional: true + '@mongodb-js/zstd': + optional: true + gcp-metadata: + optional: true + kerberos: + optional: true + mongodb-client-encryption: + optional: true + snappy: + optional: true + socks: + optional: true + + mongoose@9.10.2: + resolution: {integrity: sha512-oFcFL3dsX5tDzMwBD+GGoDqKIj6RNG3bu3oqlvcUIgPulHP14/6N7c07j3s0XgbrlT7U/lbiXOD89hmPtEXnfQ==} + engines: {node: '>=20.19.0'} + + mpath@0.9.0: + resolution: {integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==} + engines: {node: '>=4.0.0'} + + mquery@6.0.0: + resolution: {integrity: sha512-b2KQNsmgtkscfeDgkYMcWGn9vZI9YoXh802VDEwE6qc50zxBFQ0Oo8ROkawbPAsXCY1/Z1yp0MagqsZStPWJjw==} + engines: {node: '>=20.19.0'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + negotiator@1.1.0: + resolution: {integrity: sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==} + engines: {node: '>=18'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} + engines: {node: '>= 0.4'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + qs@6.16.0: + resolution: {integrity: sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==} + engines: {node: '>=0.6'} + + raw-body@3.0.2: + resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} + engines: {node: '>= 0.10'} + + retry@0.13.1: + resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} + engines: {node: '>= 4'} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + sha.js@2.4.12: + resolution: {integrity: sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==} + engines: {node: '>= 0.10'} + hasBin: true + + side-channel-list@1.0.1: + resolution: {integrity: sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.1: + resolution: {integrity: sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==} + engines: {node: '>= 0.4'} + + sift@17.1.3: + resolution: {integrity: sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==} + + sparse-bitfield@3.0.3: + resolution: {integrity: sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==} + + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + to-buffer@1.2.2: + resolution: {integrity: sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==} + engines: {node: '>= 0.4'} + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + + tr46@5.1.1: + resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} + engines: {node: '>=18'} + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + type-is@2.1.0: + resolution: {integrity: sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==} + engines: {node: '>= 18'} + + typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + + whatwg-mimetype@4.0.0: + resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} + engines: {node: '>=18'} + + whatwg-url@14.2.0: + resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} + engines: {node: '>=18'} + + which-typed-array@1.1.24: + resolution: {integrity: sha512-wk4Mf4pR5mRP7eYuuTBCIQ9d0ud2Fv2jRLQpfgnRjbOxAFHmjKFValgTpitVKzJJS8ajnYQV2Du1SZ8j6b/EUQ==} + engines: {node: '>= 0.4'} + +snapshots: + + '@apollo/cache-control-types@1.0.3(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/protobufjs@1.2.8': + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.5 + '@protobufjs/eventemitter': 1.1.1 + '@protobufjs/fetch': 1.1.1 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.2 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.2 + '@types/long': 4.0.2 + long: 4.0.0 + + '@apollo/server-gateway-interface@2.0.0(graphql@17.0.2)': + dependencies: + '@apollo/usage-reporting-protobuf': 4.1.2 + '@apollo/utils.fetcher': 3.1.0 + '@apollo/utils.keyvaluecache': 4.0.0 + '@apollo/utils.logger': 3.0.0 + graphql: 17.0.2 + + '@apollo/server@5.5.1(graphql@17.0.2)': + dependencies: + '@apollo/cache-control-types': 1.0.3(graphql@17.0.2) + '@apollo/server-gateway-interface': 2.0.0(graphql@17.0.2) + '@apollo/usage-reporting-protobuf': 4.1.2 + '@apollo/utils.createhash': 3.0.1 + '@apollo/utils.fetcher': 3.1.0 + '@apollo/utils.isnodelike': 3.0.0 + '@apollo/utils.keyvaluecache': 4.0.0 + '@apollo/utils.logger': 3.0.0 + '@apollo/utils.usagereporting': 2.1.0(graphql@17.0.2) + '@apollo/utils.withrequired': 3.0.0 + '@graphql-tools/schema': 10.1.1(graphql@17.0.2) + async-retry: 1.3.3 + body-parser: 2.3.0 + content-type: 1.0.5 + cors: 2.8.6 + finalhandler: 2.1.1 + graphql: 17.0.2 + loglevel: 1.9.2 + lru-cache: 11.5.3 + negotiator: 1.1.0 + whatwg-mimetype: 4.0.0 + transitivePeerDependencies: + - supports-color + + '@apollo/usage-reporting-protobuf@4.1.2': + dependencies: + '@apollo/protobufjs': 1.2.8 + + '@apollo/utils.createhash@3.0.1': + dependencies: + '@apollo/utils.isnodelike': 3.0.0 + sha.js: 2.4.12 + + '@apollo/utils.dropunuseddefinitions@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.fetcher@3.1.0': {} + + '@apollo/utils.isnodelike@3.0.0': {} + + '@apollo/utils.keyvaluecache@4.0.0': + dependencies: + '@apollo/utils.logger': 3.0.0 + lru-cache: 11.5.3 + + '@apollo/utils.logger@3.0.0': {} + + '@apollo/utils.printwithreducedwhitespace@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.removealiases@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.sortast@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + lodash.sortby: 4.7.0 + + '@apollo/utils.stripsensitiveliterals@2.0.1(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@apollo/utils.usagereporting@2.1.0(graphql@17.0.2)': + dependencies: + '@apollo/usage-reporting-protobuf': 4.1.2 + '@apollo/utils.dropunuseddefinitions': 2.0.1(graphql@17.0.2) + '@apollo/utils.printwithreducedwhitespace': 2.0.1(graphql@17.0.2) + '@apollo/utils.removealiases': 2.0.1(graphql@17.0.2) + '@apollo/utils.sortast': 2.0.1(graphql@17.0.2) + '@apollo/utils.stripsensitiveliterals': 2.0.1(graphql@17.0.2) + graphql: 17.0.2 + + '@apollo/utils.withrequired@3.0.0': {} + + '@graphql-tools/merge@9.2.4(graphql@17.0.2)': + dependencies: + '@graphql-tools/utils': 12.0.1(graphql@17.0.2) + graphql: 17.0.2 + tslib: 2.8.1 + + '@graphql-tools/schema@10.1.1(graphql@17.0.2)': + dependencies: + '@graphql-tools/merge': 9.2.4(graphql@17.0.2) + '@graphql-tools/utils': 12.0.1(graphql@17.0.2) + graphql: 17.0.2 + tslib: 2.8.1 + + '@graphql-tools/utils@12.0.1(graphql@17.0.2)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@17.0.2) + '@whatwg-node/promise-helpers': 1.3.2 + cross-inspect: 1.0.1 + graphql: 17.0.2 + tslib: 2.8.1 + + '@graphql-typed-document-node/core@3.2.0(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@mongodb-js/saslprep@1.5.4': + dependencies: + sparse-bitfield: 3.0.3 + + '@protobufjs/aspromise@1.1.2': {} + + '@protobufjs/base64@1.1.2': {} + + '@protobufjs/codegen@2.0.5': {} + + '@protobufjs/eventemitter@1.1.1': {} + + '@protobufjs/fetch@1.1.1': + dependencies: + '@protobufjs/aspromise': 1.1.2 + + '@protobufjs/float@1.0.2': {} + + '@protobufjs/inquire@1.1.2': {} + + '@protobufjs/path@1.1.2': {} + + '@protobufjs/pool@1.1.0': {} + + '@protobufjs/utf8@1.1.2': {} + + '@standard-schema/spec@1.1.0': {} + + '@types/long@4.0.2': {} + + '@types/webidl-conversions@7.0.3': {} + + '@types/whatwg-url@13.0.0': + dependencies: + '@types/webidl-conversions': 7.0.3 + + '@whatwg-node/promise-helpers@1.3.2': + dependencies: + tslib: 2.8.1 + + async-retry@1.3.3: + dependencies: + retry: 0.13.1 + + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.1.0 + + body-parser@2.3.0: + dependencies: + bytes: 3.1.2 + content-type: 2.1.0 + debug: 4.4.3 + http-errors: 2.0.1 + iconv-lite: 0.7.3 + on-finished: 2.4.1 + qs: 6.16.0 + raw-body: 3.0.2 + type-is: 2.1.0 + transitivePeerDependencies: + - supports-color + + bson@7.3.3: {} + + bytes@3.1.2: {} + + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bind@1.0.9: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + get-intrinsic: 1.3.0 + set-function-length: 1.2.2 + + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + + content-type@1.0.5: {} + + content-type@2.1.0: {} + + cors@2.8.6: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + + cross-inspect@1.0.1: + dependencies: + tslib: 2.8.1 + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + depd@2.0.0: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + ee-first@1.1.1: {} + + encodeurl@2.0.0: {} + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.1.2: + dependencies: + es-errors: 1.3.0 + + escape-html@1.0.3: {} + + finalhandler@2.1.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + for-each@0.3.5: + dependencies: + is-callable: 1.2.7 + + function-bind@1.1.2: {} + + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.2 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.4 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.2 + + gopd@1.2.0: {} + + graphql-tag@2.12.7(graphql@17.0.2): + dependencies: + graphql: 17.0.2 + tslib: 2.8.1 + + graphql@17.0.2: {} + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.4: + dependencies: + function-bind: 1.1.2 + + http-errors@2.0.1: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.2 + toidentifier: 1.0.1 + + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + + inherits@2.0.4: {} + + is-callable@1.2.7: {} + + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.24 + + isarray@2.0.5: {} + + kareem@3.4.0: {} + + lodash.sortby@4.7.0: {} + + loglevel@1.9.2: {} + + long@4.0.0: {} + + lru-cache@11.5.3: {} + + math-intrinsics@1.1.0: {} + + media-typer@1.1.1: {} + + memory-pager@1.5.0: {} + + mime-db@1.54.0: {} + + mime-types@3.0.2: + dependencies: + mime-db: 1.54.0 + + mongodb-connection-string-url@7.0.2: + dependencies: + '@types/whatwg-url': 13.0.0 + whatwg-url: 14.2.0 + + mongodb@7.6.0: + dependencies: + '@mongodb-js/saslprep': 1.5.4 + bson: 7.3.3 + mongodb-connection-string-url: 7.0.2 + + mongoose@9.10.2: + dependencies: + '@standard-schema/spec': 1.1.0 + kareem: 3.4.0 + mongodb: 7.6.0 + mpath: 0.9.0 + mquery: 6.0.0 + ms: 2.1.3 + sift: 17.1.3 + transitivePeerDependencies: + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks + + mpath@0.9.0: {} + + mquery@6.0.0: {} + + ms@2.1.3: {} + + negotiator@1.1.0: + dependencies: + content-type: 2.1.0 + + object-assign@4.1.1: {} + + object-inspect@1.13.4: {} + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + parseurl@1.3.3: {} + + possible-typed-array-names@1.1.0: {} + + punycode@2.3.1: {} + + qs@6.16.0: + dependencies: + es-define-property: 1.0.1 + side-channel: 1.1.1 + + raw-body@3.0.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.7.3 + unpipe: 1.0.0 + + retry@0.13.1: {} + + safe-buffer@5.2.1: {} + + safer-buffer@2.1.2: {} + + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.3.0 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + + setprototypeof@1.2.0: {} + + sha.js@2.4.12: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + to-buffer: 1.2.2 + + side-channel-list@1.0.1: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.1: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.1 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + sift@17.1.3: {} + + sparse-bitfield@3.0.3: + dependencies: + memory-pager: 1.5.0 + + statuses@2.0.2: {} + + to-buffer@1.2.2: + dependencies: + isarray: 2.0.5 + safe-buffer: 5.2.1 + typed-array-buffer: 1.0.3 + + toidentifier@1.0.1: {} + + tr46@5.1.1: + dependencies: + punycode: 2.3.1 + + tslib@2.8.1: {} + + type-is@2.1.0: + dependencies: + content-type: 2.1.0 + media-typer: 1.1.1 + mime-types: 3.0.2 + + typed-array-buffer@1.0.3: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-typed-array: 1.1.15 + + unpipe@1.0.0: {} + + vary@1.1.2: {} + + webidl-conversions@7.0.0: {} + + whatwg-mimetype@4.0.0: {} + + whatwg-url@14.2.0: + dependencies: + tr46: 5.1.1 + webidl-conversions: 7.0.0 + + which-typed-array@1.1.24: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.9 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 + has-tostringtag: 1.0.2 diff --git a/backend/pnpm-workspace.yaml b/backend/pnpm-workspace.yaml new file mode 100644 index 00000000..d4c555c0 --- /dev/null +++ b/backend/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +allowBuilds: + '@apollo/protobufjs': false diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 00000000..653fa867 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,78 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) + +## React Compiler + +The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information. + +Note: This will impact Vite dev & build performances. +You can also try [the experimental native React Compiler support in plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md#rust-react-compiler) by using `compiler: true` in the plugin options instead of using the Babel plugin. + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) + +``` + +You can also install [eslint-plugin-react-x](https://npmx.dev/package/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://npmx.dev/package/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) + +``` diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js new file mode 100644 index 00000000..ef614d25 --- /dev/null +++ b/frontend/eslint.config.js @@ -0,0 +1,22 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + globals: globals.browser, + }, + }, +]) diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 00000000..0fca6f04 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,13 @@ + + + + + + + frontend + + +
+ + + diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 00000000..dd3bc152 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,36 @@ +{ + "name": "frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@apollo/client": "^4.3.1", + "graphql": "^17.0.2", + "react": "^19.2.8", + "react-dom": "^19.2.8" + }, + "devDependencies": { + "@babel/core": "^7.29.7", + "@eslint/js": "^10.0.1", + "@rolldown/plugin-babel": "^0.2.3", + "@types/babel__core": "^7.20.5", + "@types/node": "^24.13.3", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", + "@vitejs/plugin-react": "^6.1.1", + "babel-plugin-react-compiler": "^1.0.0", + "eslint": "^10.10.0", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-plugin-react-refresh": "^0.5.6", + "globals": "^17.12.0", + "typescript": "~6.0.2", + "typescript-eslint": "^8.69.0", + "vite": "^8.3.0" + } +} diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml new file mode 100644 index 00000000..83e9d827 --- /dev/null +++ b/frontend/pnpm-lock.yaml @@ -0,0 +1,1932 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@apollo/client': + specifier: ^4.3.1 + version: 4.3.1(graphql@17.0.2)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(rxjs@7.8.2) + graphql: + specifier: ^17.0.2 + version: 17.0.2 + react: + specifier: ^19.2.8 + version: 19.3.0 + react-dom: + specifier: ^19.2.8 + version: 19.3.0(react@19.3.0) + devDependencies: + '@babel/core': + specifier: ^7.29.7 + version: 7.29.7 + '@eslint/js': + specifier: ^10.0.1 + version: 10.0.1(eslint@10.11.0) + '@rolldown/plugin-babel': + specifier: ^0.2.3 + version: 0.2.4(@babel/core@7.29.7)(rolldown@1.2.10)(vite@8.3.1(@types/node@24.13.6)) + '@types/babel__core': + specifier: ^7.20.5 + version: 7.20.5 + '@types/node': + specifier: ^24.13.3 + version: 24.13.6 + '@types/react': + specifier: ^19.2.18 + version: 19.3.0 + '@types/react-dom': + specifier: ^19.2.7 + version: 19.3.0(@types/react@19.3.0) + '@vitejs/plugin-react': + specifier: ^6.1.1 + version: 6.1.1(@rolldown/plugin-babel@0.2.4(@babel/core@7.29.7)(rolldown@1.2.10)(vite@8.3.1(@types/node@24.13.6)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.1(@types/node@24.13.6)) + babel-plugin-react-compiler: + specifier: ^1.0.0 + version: 1.0.0 + eslint: + specifier: ^10.10.0 + version: 10.11.0 + eslint-plugin-react-hooks: + specifier: ^7.1.1 + version: 7.1.1(eslint@10.11.0) + eslint-plugin-react-refresh: + specifier: ^0.5.6 + version: 0.5.7(eslint@10.11.0) + globals: + specifier: ^17.12.0 + version: 17.12.0 + typescript: + specifier: ~6.0.2 + version: 6.0.3 + typescript-eslint: + specifier: ^8.69.0 + version: 8.70.1(eslint@10.11.0)(typescript@6.0.3) + vite: + specifier: ^8.3.0 + version: 8.3.1(@types/node@24.13.6) + +packages: + + '@apollo/client@4.3.1': + resolution: {integrity: sha512-MFHzUfHxS+A6AzH+cS4896jHuSTRw5ACUANijz1gyesWZDLsbgZ17oCb/KfRAOUuoUr8AzCaBE+xJPi7R7ZOCA==} + peerDependencies: + graphql: ^16.0.0 || ^17.0.0 + graphql-ws: ^5.5.5 || ^6.0.3 + react: ^17.0.0 || ^18.0.0 || >=19.0.0-rc + react-dom: ^17.0.0 || ^18.0.0 || >=19.0.0-rc + rxjs: ^7.3.0 + subscriptions-transport-ws: ^0.9.0 || ^0.11.0 + peerDependenciesMeta: + graphql-ws: + optional: true + react: + optional: true + react-dom: + optional: true + subscriptions-transport-ws: + optional: true + + '@babel/code-frame@7.29.7': + resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.29.7': + resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.29.7': + resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.29.8': + resolution: {integrity: sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.29.7': + resolution: {integrity: sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-globals@7.29.7': + resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.29.7': + resolution: {integrity: sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.29.7': + resolution: {integrity: sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.29.7': + resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.29.7': + resolution: {integrity: sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.9': + resolution: {integrity: sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/template@7.29.7': + resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.29.8': + resolution: {integrity: sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.29.8': + resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} + engines: {node: '>=6.9.0'} + + '@cacheable/memory@2.2.0': + resolution: {integrity: sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==} + + '@cacheable/utils@2.5.0': + resolution: {integrity: sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==} + + '@eslint-community/eslint-utils@4.10.1': + resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/config-array@0.23.5': + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/config-helpers@0.7.0': + resolution: {integrity: sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/core@1.2.1': + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/js@10.0.1': + resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^10.0.0 + peerDependenciesMeta: + eslint: + optional: true + + '@eslint/object-schema@3.0.5': + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/plugin-kit@0.7.3': + resolution: {integrity: sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@graphql-typed-document-node/core@3.2.0': + resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@humanfs/core@0.19.2': + resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.8': + resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} + engines: {node: '>=18.18.0'} + + '@humanfs/types@0.15.0': + resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} + engines: {node: '>=18.18.0'} + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@keyv/bigmap@1.3.1': + resolution: {integrity: sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==} + engines: {node: '>= 18'} + peerDependencies: + keyv: ^5.6.0 + + '@keyv/serialize@1.1.1': + resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==} + + '@oxc-project/types@0.151.0': + resolution: {integrity: sha512-J1yXrIlNDZVzE3ada310xeAw7nH8yCAyLPuUIsjKatFPmfn5bS1oW+cM+QsGOtVWd5nhSpbwZWx/rue+r5Z+PA==} + + '@rolldown/binding-android-arm-eabi@1.2.10': + resolution: {integrity: sha512-bp9svZb+QurZeh+8H4BhrZkifEB0YBNvTVzNSJnJQkj4NrRwmQoDUCGP0vSN7PbvLeM7l1tK6GXL8mrTiH2myg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.2.10': + resolution: {integrity: sha512-wm6Dld3RXUAZ/gRWKyUy+4W1B5CB5UeFaOzsSWJWEdxZXHH8rCYiZ5dGe6oJmhsunAPWzL7FZV+VtvmN5Ye2eA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.2.10': + resolution: {integrity: sha512-UbEfXq/AqGNgRTV3ik+X/iR6mUxu2QdYAadwRxJWquUGnW6gDqdP1FtLtFXRow7RJx0ssRwi80XAPr4r+4DtsA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.2.10': + resolution: {integrity: sha512-7f5h17q5KZVx/ji1vb8OTq31ch1O2I7K8NPIr44GkyWTApXMIsmhWqZfgpOH10xeauqghDAvGlZktasCkcF6Eg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.2.10': + resolution: {integrity: sha512-ynOk/eEYhC6ZB2xCGvKrEOwE58oBy9LnrAqtkrDF9Fz1VTaNdGZTsV0VarJdhPwb+sOJTGjCLwcuyRJZ1dnMcQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.2.10': + resolution: {integrity: sha512-ERrAs185meZZhGan7a4l3RiiJK1ArSDlHdST++uvSxe+FDbR4TwUPahT/cbZJvaG6fIpDpF78surN+tX708Y4Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.2.10': + resolution: {integrity: sha512-KN7OHKD0J3jy1UzBwZWPxpwhODf9IARUIJcrH+yLYKOcmegZ8luEUM38lDP1bDVj40yP6PsSzCqOJF76vljFnQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.2.10': + resolution: {integrity: sha512-8l9wP8O+wa8zD6iw6egSfzVtu7oZVfH3hlUsMM4MwbLMhxleqeoXbZzjddyK3YyNlwLhqznq3tF7PkNJ8T/V2w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.2.10': + resolution: {integrity: sha512-SeXNKeQzA5kLhz/J0CH6ZP0/HJ3v1xm/0YbiYpE0kK7emfRC2OIGGIaE14xzkISEGv2aYuUSpiLiU5Gbq+OI0A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.2.10': + resolution: {integrity: sha512-mtht0nR+y8/hart4175Ll15w7lY8dg7CtQ+j2FDNTsDRspOWTK/2V3l0aj9sIj7XmvqxT8Yli/wq22e7feTTWg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.2.10': + resolution: {integrity: sha512-FSM94nGd55NYo48usCyM/nHfUKRnqc9+b0vJNuKV0oCCpIp/OGims7rO1Nv/DkFkt0S/s2rxsJ2kkS8J3HcpeA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.2.10': + resolution: {integrity: sha512-C3YxNB16myRLs7o+B+6PnQ6jBsdIS4+AE4Ah8glVGhDpEv9AOvxhZ/1duAb4B0UGczEK/lBbccksd8VI+p6zfw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.2.10': + resolution: {integrity: sha512-571TlE/F1eeTjjdjYAMMMPs1Mfv3MtX6s3+ZKVU6HiUjZ5Njc6c/qzNy/8K3zALTZnaw3JQVYrHxvNfjm43KAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-win32-arm64-msvc@1.2.10': + resolution: {integrity: sha512-QXW+ZWaiqs2c7Fi++D/SsW07LTPcUrncxcskJGfGNBoaLik1IU6fJymz4HsqwEO0u5Iq11yTO0B/mc4cPk7jrQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.2.10': + resolution: {integrity: sha512-5FQFGgah17YeMtG1Yd5a+rMxQpTksyNXxRtKz06FVTaQw3RKYUJQbUoKk0/5jrXBpDo+7makNP7UHA2LQyH64A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/plugin-babel@0.2.4': + resolution: {integrity: sha512-ygmm2j/mN+aCvstHo0x3IOu4uc6LqXT9SJ3q4kpfG/+Yhfz0B+E47FITcC0FljZADwUFARP6E2kiE+Lc26D8wg==} + engines: {node: '>=22.12.0 || ^24.0.0'} + peerDependencies: + '@babel/core': ^7.29.0 || ^8.0.0-rc.1 + '@babel/plugin-transform-runtime': ^7.29.0 || ^8.0.0-rc.1 + '@babel/runtime': ^7.27.0 || ^8.0.0-rc.1 + rolldown: ^1.0.0-rc.5 + vite: ^8.0.0 + peerDependenciesMeta: + '@babel/plugin-transform-runtime': + optional: true + '@babel/runtime': + optional: true + vite: + optional: true + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/node@24.13.6': + resolution: {integrity: sha512-SGrw/h3KPFshy3OE6ZL53LMBG5vGQQ8/gIpiqz/kRZhPJ7HgwCEs8LBuNtWLa8dvGZVpSF7+Bf+c11HUrCb/yg==} + + '@types/react-dom@19.3.0': + resolution: {integrity: sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==} + peerDependencies: + '@types/react': ^19.3.0 + + '@types/react@19.3.0': + resolution: {integrity: sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==} + + '@typescript-eslint/eslint-plugin@8.70.1': + resolution: {integrity: sha512-nDNrUQ/4ruSNYbu749TRY7cfrzPtoLHEXSNBI8aaNY32LlZCajixqRf3FqcKC4p5Cam4VOHYx/t+i5+nKXvrqA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.70.1 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/parser@8.70.1': + resolution: {integrity: sha512-nO974WLllwhSFWQXnMLj6nDGa8f0khKEz1JzpPJ1u7Vm/4X1X6ZHajpoknU4bb41vJyMB0HHVyS2GqdhWfIXZw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/project-service@8.70.1': + resolution: {integrity: sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/scope-manager@8.70.1': + resolution: {integrity: sha512-Pa0EeSeAusQc1WbjQMac+YfenewYTBu0KjgYvkUKwhXaHUKbFog23Dm/rp0DX/6tyYOQ3Xl1a+3EcFNZynGHCw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/tsconfig-utils@8.70.1': + resolution: {integrity: sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/type-utils@8.70.1': + resolution: {integrity: sha512-7zKTnyvaVWqzLZHPFQtX1hVHqgkMC+WebPWakNCSyrQVbIP1AM0L0TlBZtACldIRb6PptI8Odk+jyZ5kP3B1VA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/types@8.70.1': + resolution: {integrity: sha512-Dm1ypdhhrGCTyyehxElhgJ6kgk8MVCv5qXdoOVqPr1uqk42jX8KjrZqhROvdShczA8qrDoYiOWn1ykWlx2k81Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.70.1': + resolution: {integrity: sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/utils@8.70.1': + resolution: {integrity: sha512-Esgul8MsnKnRLdYU2Eb2cRV9bS5HJYtKj1ByJnOzzG2M58DGdSUQ1jUuILxipqcpB2h9WLrbD5GijIWUjX/Tqw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + '@typescript-eslint/visitor-keys@8.70.1': + resolution: {integrity: sha512-Vwj9lUIW5Xq3wQ9w6gv3R86g1hMK8f2zNOdGTAgeXUMMXFK78G9ruCjjqutHMNJc0+CH7LYRnHeUB9IT8wFmcw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@vitejs/plugin-react@6.1.1': + resolution: {integrity: sha512-yxLaQV9gkhS8ezJqCM6+ndU7mDY6gqAg75NQ+0IjwEI8IYOmQCgkRwHKVSfWXW076DsqMo0Dk+0FK1U+M5RgFw==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@rolldown/plugin-babel': ^0.1.7 || ^0.2.0 + babel-plugin-react-compiler: ^1.0.0 + oxc-transform-react: ^0.145.0 + vite: ^8.0.0 + peerDependenciesMeta: + '@rolldown/plugin-babel': + optional: true + babel-plugin-react-compiler: + optional: true + oxc-transform-react: + optional: true + + '@wry/caches@1.0.1': + resolution: {integrity: sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==} + engines: {node: '>=8'} + + '@wry/context@0.7.4': + resolution: {integrity: sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==} + engines: {node: '>=8'} + + '@wry/equality@0.5.7': + resolution: {integrity: sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==} + engines: {node: '>=8'} + + '@wry/trie@0.5.0': + resolution: {integrity: sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==} + engines: {node: '>=8'} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@8.18.0: + resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + + babel-plugin-react-compiler@1.0.0: + resolution: {integrity: sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==} + + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + baseline-browser-mapping@2.11.25: + resolution: {integrity: sha512-gMmEShwwq7FJqMwvfRwvCl00v4kN+KOfJqXn+f4nrufak5gNHJOksd/60Dvjuz7sI8Y5WiSFBa8FEYr+zoyqCw==} + engines: {node: '>=6.0.0'} + hasBin: true + + brace-expansion@5.0.12: + resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==} + engines: {node: 20 || >=22} + + browserslist@4.29.0: + resolution: {integrity: sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + cacheable@2.5.0: + resolution: {integrity: sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==} + + caniuse-lite@1.0.30001812: + resolution: {integrity: sha512-qN+QNNBr93TCmFrmte0bBCjSDMuRvt78VlHT99qIGPszm4QsqCX8lnyWUFkHi8B7ZBAPq8SH+UqyXNy/odMdng==} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + electron-to-chromium@1.5.438: + resolution: {integrity: sha512-AN9xMU1hJiT65LkCUPL1DZm5TCbOPb2Qsm5pYwFLEXp6/qj9SdT4yMiqs7Qqstwvkn1zF7l36SRGt+s6XcJ0FA==} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-plugin-react-hooks@7.1.1: + resolution: {integrity: sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0 + + eslint-plugin-react-refresh@0.5.7: + resolution: {integrity: sha512-XhJSzLljuYD4UjNuFGJu2v7aD3sqNVK12w5/DCUfrNfHWegZo2+TsavNx8MuxMwEquuFAzNbNfXKU0WoZ+YUIg==} + peerDependencies: + eslint: ^9 || ^10 + + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint@10.11.0: + resolution: {integrity: sha512-P7a6UEEqb9G95MYAtqkmsTbVXIYyzIfl6NGOIJk162PaahFxFyeGcrlXYFSiagECg4sEm8IseJdZBKR3rx6MsQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + file-entry-cache@11.1.5: + resolution: {integrity: sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@6.1.23: + resolution: {integrity: sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==} + + flatted@3.4.4: + resolution: {integrity: sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + globals@17.12.0: + resolution: {integrity: sha512-cezEd/DTyyht9cvSSURyygXPfy04GtWO/5e6ZPvH7fCtjKz9PYOmuawphw1Ctd1f6C+5JypXfGD7ahNMXvevBA==} + engines: {node: '>=18'} + + graphql-tag@2.12.7: + resolution: {integrity: sha512-xnE/NFzy+0eIesvAsREJZ284zTl/wYuBAvpsFSDhRGRdRHdnE90M21Q3xAWyYInb0J756c6x0pIQ62+vtvOs1Q==} + engines: {node: '>=10'} + peerDependencies: + graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + graphql@17.0.2: + resolution: {integrity: sha512-FRWbddMxfkjiB7z+aQDWIR+E34xo9I8c9mtK2RPv8PmMzKRvrdsreHL/Ui/TmwHJfhHChEtsFPyMHKI+xuarQQ==} + engines: {node: ^22.0.0 || ^24.0.0 || ^25.0.0 || >=26.0.0} + + hashery@1.5.1: + resolution: {integrity: sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==} + engines: {node: '>=20'} + + hermes-estree@0.25.1: + resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==} + + hermes-parser@0.25.1: + resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==} + + hookified@1.15.1: + resolution: {integrity: sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==} + + hookified@2.2.0: + resolution: {integrity: sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + ignore@7.0.10: + resolution: {integrity: sha512-HpbUakT7xp5miBUywCHf36ZEuAJNklBJDDsGpUIjMzOSmM8ELSfA9Sa/QDPeNeqeoN31u+UTCkL4klCOVvRm4Q==} + engines: {node: '>= 4'} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + keyv@5.6.0: + resolution: {integrity: sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} + engines: {node: '>= 12.0.0'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + minimatch@10.2.6: + resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} + engines: {node: 18 || 20 || >=22} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + nanoid@3.3.19: + resolution: {integrity: sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + node-releases@2.0.57: + resolution: {integrity: sha512-kQK9LGGFiHtrWiNhZtA7Qbw17AQz+dmsEKODRIVTXA9+e5MS/2gZEBhYJt13GrAz5/IOZKddH/0Z3TP/Zgo+yw==} + engines: {node: '>=18'} + + optimism@0.18.1: + resolution: {integrity: sha512-mLXNwWPa9dgFyDqkNi54sjDyNJ9/fTI6WGBLgnXku1vdKY/jovHfZT5r+aiVeFFLOz+foPNOm5YJ4mqgld2GBQ==} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + postcss@8.5.28: + resolution: {integrity: sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==} + engines: {node: ^10 || ^12 || >=14} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + qified@0.10.1: + resolution: {integrity: sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==} + engines: {node: '>=20'} + + react-dom@19.3.0: + resolution: {integrity: sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==} + peerDependencies: + react: ^19.3.0 + + react@19.3.0: + resolution: {integrity: sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==} + engines: {node: '>=0.10.0'} + + rolldown@1.2.10: + resolution: {integrity: sha512-OxkA08pSryMK7B3XiFA09B4OJ1xJMPgIYCBMY2xchzpqgBGsV1o0DetPAE+Sl3N3L4oCPiEzmHVSOj7iR04Zog==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + + scheduler@0.28.0: + resolution: {integrity: sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} + engines: {node: '>=10'} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + typescript-eslint@8.70.1: + resolution: {integrity: sha512-AcWG7KDjZ2THNXsgwttMaGmzVi0VFRlFYfqFHYQRbDpF3owuYbuiL8c7UUrd2k8s3PoSfIQrWfrGXfcElrWLYA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.18.2: + resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} + + update-browserslist-db@1.3.3: + resolution: {integrity: sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + vite@8.3.1: + resolution: {integrity: sha512-/bvH9E9tmCXRGp2uXY3WbOldqpTwFkbha/8ANaEQ6VkxhH60KyqLwgZq6lG2y+4uT55x9+9eUHMpQ7uGnOCKjA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.7.1 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zod-validation-error@4.0.2: + resolution: {integrity: sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==} + engines: {node: '>=18.0.0'} + peerDependencies: + zod: ^3.25.0 || ^4.0.0 + + zod@4.6.5: + resolution: {integrity: sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==} + +snapshots: + + '@apollo/client@4.3.1(graphql@17.0.2)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(rxjs@7.8.2)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@17.0.2) + '@wry/caches': 1.0.1 + '@wry/equality': 0.5.7 + '@wry/trie': 0.5.0 + graphql: 17.0.2 + graphql-tag: 2.12.7(graphql@17.0.2) + optimism: 0.18.1 + rxjs: 7.8.2 + tslib: 2.8.1 + optionalDependencies: + react: 19.3.0 + react-dom: 19.3.0(react@19.3.0) + + '@babel/code-frame@7.29.7': + dependencies: + '@babel/helper-validator-identifier': 7.29.7 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.29.7': {} + + '@babel/core@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-compilation-targets': 7.29.7 + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) + '@babel/helpers': 7.29.7 + '@babel/parser': 7.29.9 + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.8 + '@babel/types': 7.29.8 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.29.8': + dependencies: + '@babel/parser': 7.29.9 + '@babel/types': 7.29.8 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-compilation-targets@7.29.7': + dependencies: + '@babel/compat-data': 7.29.7 + '@babel/helper-validator-option': 7.29.7 + browserslist: 4.29.0 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-globals@7.29.7': {} + + '@babel/helper-module-imports@7.29.7': + dependencies: + '@babel/traverse': 7.29.8 + '@babel/types': 7.29.8 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-module-imports': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.8 + transitivePeerDependencies: + - supports-color + + '@babel/helper-string-parser@7.29.7': {} + + '@babel/helper-validator-identifier@7.29.7': {} + + '@babel/helper-validator-option@7.29.7': {} + + '@babel/helpers@7.29.7': + dependencies: + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + + '@babel/parser@7.29.9': + dependencies: + '@babel/types': 7.29.8 + + '@babel/template@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/parser': 7.29.9 + '@babel/types': 7.29.8 + + '@babel/traverse@7.29.8': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-globals': 7.29.7 + '@babel/parser': 7.29.9 + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.29.8': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@cacheable/memory@2.2.0': + dependencies: + '@cacheable/utils': 2.5.0 + '@keyv/bigmap': 1.3.1(keyv@5.6.0) + hookified: 1.15.1 + keyv: 5.6.0 + + '@cacheable/utils@2.5.0': + dependencies: + hashery: 1.5.1 + keyv: 5.6.0 + + '@eslint-community/eslint-utils@4.10.1(eslint@10.11.0)': + dependencies: + eslint: 10.11.0 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.2': {} + + '@eslint/config-array@0.23.5': + dependencies: + '@eslint/object-schema': 3.0.5 + debug: 4.4.3 + minimatch: 10.2.6 + transitivePeerDependencies: + - supports-color + + '@eslint/config-helpers@0.7.0': + dependencies: + '@eslint/core': 1.2.1 + + '@eslint/core@1.2.1': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/js@10.0.1(eslint@10.11.0)': + optionalDependencies: + eslint: 10.11.0 + + '@eslint/object-schema@3.0.5': {} + + '@eslint/plugin-kit@0.7.3': + dependencies: + '@eslint/core': 1.2.1 + levn: 0.4.1 + + '@graphql-typed-document-node/core@3.2.0(graphql@17.0.2)': + dependencies: + graphql: 17.0.2 + + '@humanfs/core@0.19.2': + dependencies: + '@humanfs/types': 0.15.0 + + '@humanfs/node@0.16.8': + dependencies: + '@humanfs/core': 0.19.2 + '@humanfs/types': 0.15.0 + '@humanwhocodes/retry': 0.4.3 + + '@humanfs/types@0.15.0': {} + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.4.3': {} + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.6.0 + + '@keyv/bigmap@1.3.1(keyv@5.6.0)': + dependencies: + hashery: 1.5.1 + hookified: 1.15.1 + keyv: 5.6.0 + + '@keyv/serialize@1.1.1': {} + + '@oxc-project/types@0.151.0': {} + + '@rolldown/binding-android-arm-eabi@1.2.10': + optional: true + + '@rolldown/binding-android-arm64@1.2.10': + optional: true + + '@rolldown/binding-darwin-arm64@1.2.10': + optional: true + + '@rolldown/binding-darwin-x64@1.2.10': + optional: true + + '@rolldown/binding-freebsd-x64@1.2.10': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.2.10': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.2.10': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.2.10': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.2.10': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.2.10': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.2.10': + optional: true + + '@rolldown/binding-linux-x64-musl@1.2.10': + optional: true + + '@rolldown/binding-openharmony-arm64@1.2.10': + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.2.10': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.2.10': + optional: true + + '@rolldown/plugin-babel@0.2.4(@babel/core@7.29.7)(rolldown@1.2.10)(vite@8.3.1(@types/node@24.13.6))': + dependencies: + '@babel/core': 7.29.7 + picomatch: 4.0.7 + rolldown: 1.2.10 + optionalDependencies: + vite: 8.3.1(@types/node@24.13.6) + + '@rolldown/pluginutils@1.0.1': {} + + '@types/babel__core@7.20.5': + dependencies: + '@babel/parser': 7.29.9 + '@babel/types': 7.29.8 + '@types/babel__generator': 7.27.0 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.28.0 + + '@types/babel__generator@7.27.0': + dependencies: + '@babel/types': 7.29.8 + + '@types/babel__template@7.4.4': + dependencies: + '@babel/parser': 7.29.9 + '@babel/types': 7.29.8 + + '@types/babel__traverse@7.28.0': + dependencies: + '@babel/types': 7.29.8 + + '@types/esrecurse@4.3.1': {} + + '@types/estree@1.0.9': {} + + '@types/json-schema@7.0.15': {} + + '@types/node@24.13.6': + dependencies: + undici-types: 7.18.2 + + '@types/react-dom@19.3.0(@types/react@19.3.0)': + dependencies: + '@types/react': 19.3.0 + + '@types/react@19.3.0': + dependencies: + csstype: 3.2.3 + + '@typescript-eslint/eslint-plugin@8.70.1(@typescript-eslint/parser@8.70.1(eslint@10.11.0)(typescript@6.0.3))(eslint@10.11.0)(typescript@6.0.3)': + dependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.70.1(eslint@10.11.0)(typescript@6.0.3) + '@typescript-eslint/scope-manager': 8.70.1 + '@typescript-eslint/type-utils': 8.70.1(eslint@10.11.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.70.1(eslint@10.11.0)(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.70.1 + eslint: 10.11.0 + ignore: 7.0.10 + natural-compare: 1.4.0 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.70.1(eslint@10.11.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.70.1 + '@typescript-eslint/types': 8.70.1 + '@typescript-eslint/typescript-estree': 8.70.1(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.70.1 + debug: 4.4.3 + eslint: 10.11.0 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.70.1(typescript@6.0.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.70.1(typescript@6.0.3) + '@typescript-eslint/types': 8.70.1 + debug: 4.4.3 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.70.1': + dependencies: + '@typescript-eslint/types': 8.70.1 + '@typescript-eslint/visitor-keys': 8.70.1 + + '@typescript-eslint/tsconfig-utils@8.70.1(typescript@6.0.3)': + dependencies: + typescript: 6.0.3 + + '@typescript-eslint/type-utils@8.70.1(eslint@10.11.0)(typescript@6.0.3)': + dependencies: + '@typescript-eslint/types': 8.70.1 + '@typescript-eslint/typescript-estree': 8.70.1(typescript@6.0.3) + '@typescript-eslint/utils': 8.70.1(eslint@10.11.0)(typescript@6.0.3) + debug: 4.4.3 + eslint: 10.11.0 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@8.70.1': {} + + '@typescript-eslint/typescript-estree@8.70.1(typescript@6.0.3)': + dependencies: + '@typescript-eslint/project-service': 8.70.1(typescript@6.0.3) + '@typescript-eslint/tsconfig-utils': 8.70.1(typescript@6.0.3) + '@typescript-eslint/types': 8.70.1 + '@typescript-eslint/visitor-keys': 8.70.1 + debug: 4.4.3 + minimatch: 10.2.6 + semver: 7.8.5 + tinyglobby: 0.2.17 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.70.1(eslint@10.11.0)(typescript@6.0.3)': + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.11.0) + '@typescript-eslint/scope-manager': 8.70.1 + '@typescript-eslint/types': 8.70.1 + '@typescript-eslint/typescript-estree': 8.70.1(typescript@6.0.3) + eslint: 10.11.0 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/visitor-keys@8.70.1': + dependencies: + '@typescript-eslint/types': 8.70.1 + eslint-visitor-keys: 5.0.1 + + '@vitejs/plugin-react@6.1.1(@rolldown/plugin-babel@0.2.4(@babel/core@7.29.7)(rolldown@1.2.10)(vite@8.3.1(@types/node@24.13.6)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.1(@types/node@24.13.6))': + dependencies: + '@rolldown/pluginutils': 1.0.1 + vite: 8.3.1(@types/node@24.13.6) + optionalDependencies: + '@rolldown/plugin-babel': 0.2.4(@babel/core@7.29.7)(rolldown@1.2.10)(vite@8.3.1(@types/node@24.13.6)) + babel-plugin-react-compiler: 1.0.0 + + '@wry/caches@1.0.1': + dependencies: + tslib: 2.8.1 + + '@wry/context@0.7.4': + dependencies: + tslib: 2.8.1 + + '@wry/equality@0.5.7': + dependencies: + tslib: 2.8.1 + + '@wry/trie@0.5.0': + dependencies: + tslib: 2.8.1 + + acorn-jsx@5.3.2(acorn@8.18.0): + dependencies: + acorn: 8.18.0 + + acorn@8.18.0: {} + + ajv@6.15.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + babel-plugin-react-compiler@1.0.0: + dependencies: + '@babel/types': 7.29.8 + + balanced-match@4.0.4: {} + + baseline-browser-mapping@2.11.25: {} + + brace-expansion@5.0.12: + dependencies: + balanced-match: 4.0.4 + + browserslist@4.29.0: + dependencies: + baseline-browser-mapping: 2.11.25 + caniuse-lite: 1.0.30001812 + electron-to-chromium: 1.5.438 + node-releases: 2.0.57 + update-browserslist-db: 1.3.3(browserslist@4.29.0) + + cacheable@2.5.0: + dependencies: + '@cacheable/memory': 2.2.0 + '@cacheable/utils': 2.5.0 + hookified: 1.15.1 + keyv: 5.6.0 + qified: 0.10.1 + + caniuse-lite@1.0.30001812: {} + + convert-source-map@2.0.0: {} + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + csstype@3.2.3: {} + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + deep-is@0.1.4: {} + + detect-libc@2.1.2: {} + + electron-to-chromium@1.5.438: {} + + escalade@3.2.0: {} + + escape-string-regexp@4.0.0: {} + + eslint-plugin-react-hooks@7.1.1(eslint@10.11.0): + dependencies: + '@babel/core': 7.29.7 + '@babel/parser': 7.29.9 + eslint: 10.11.0 + hermes-parser: 0.25.1 + zod: 4.6.5 + zod-validation-error: 4.0.2(zod@4.6.5) + transitivePeerDependencies: + - supports-color + + eslint-plugin-react-refresh@0.5.7(eslint@10.11.0): + dependencies: + eslint: 10.11.0 + + eslint-scope@9.1.2: + dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.9 + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@5.0.1: {} + + eslint@10.11.0: + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.11.0) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.23.5 + '@eslint/config-helpers': 0.7.0 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.3 + '@humanfs/node': 0.16.8 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.9 + ajv: 6.15.0 + cross-spawn: 7.0.6 + debug: 4.4.3 + escape-string-regexp: 4.0.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 11.1.5 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + minimatch: 10.2.6 + natural-compare: 1.4.0 + optionator: 0.9.4 + transitivePeerDependencies: + - supports-color + + espree@11.2.0: + dependencies: + acorn: 8.18.0 + acorn-jsx: 5.3.2(acorn@8.18.0) + eslint-visitor-keys: 5.0.1 + + esquery@1.7.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + esutils@2.0.3: {} + + fast-deep-equal@3.1.3: {} + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + + file-entry-cache@11.1.5: + dependencies: + flat-cache: 6.1.23 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@6.1.23: + dependencies: + cacheable: 2.5.0 + flatted: 3.4.4 + hookified: 1.15.1 + + flatted@3.4.4: {} + + fsevents@2.3.3: + optional: true + + gensync@1.0.0-beta.2: {} + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + globals@17.12.0: {} + + graphql-tag@2.12.7(graphql@17.0.2): + dependencies: + graphql: 17.0.2 + tslib: 2.8.1 + + graphql@17.0.2: {} + + hashery@1.5.1: + dependencies: + hookified: 1.15.1 + + hermes-estree@0.25.1: {} + + hermes-parser@0.25.1: + dependencies: + hermes-estree: 0.25.1 + + hookified@1.15.1: {} + + hookified@2.2.0: {} + + ignore@5.3.2: {} + + ignore@7.0.10: {} + + imurmurhash@0.1.4: {} + + is-extglob@2.1.1: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + isexe@2.0.0: {} + + js-tokens@4.0.0: {} + + jsesc@3.1.0: {} + + json-schema-traverse@0.4.1: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + json5@2.2.3: {} + + keyv@5.6.0: + dependencies: + '@keyv/serialize': 1.1.1 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lightningcss-android-arm64@1.33.0: + optional: true + + lightningcss-darwin-arm64@1.33.0: + optional: true + + lightningcss-darwin-x64@1.33.0: + optional: true + + lightningcss-freebsd-x64@1.33.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.33.0: + optional: true + + lightningcss-linux-arm64-gnu@1.33.0: + optional: true + + lightningcss-linux-arm64-musl@1.33.0: + optional: true + + lightningcss-linux-x64-gnu@1.33.0: + optional: true + + lightningcss-linux-x64-musl@1.33.0: + optional: true + + lightningcss-win32-arm64-msvc@1.33.0: + optional: true + + lightningcss-win32-x64-msvc@1.33.0: + optional: true + + lightningcss@1.33.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + minimatch@10.2.6: + dependencies: + brace-expansion: 5.0.12 + + ms@2.1.3: {} + + nanoid@3.3.19: {} + + natural-compare@1.4.0: {} + + node-releases@2.0.57: {} + + optimism@0.18.1: + dependencies: + '@wry/caches': 1.0.1 + '@wry/context': 0.7.4 + '@wry/trie': 0.5.0 + tslib: 2.8.1 + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + path-exists@4.0.0: {} + + path-key@3.1.1: {} + + picocolors@1.1.1: {} + + picomatch@4.0.7: {} + + postcss@8.5.28: + dependencies: + nanoid: 3.3.19 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + prelude-ls@1.2.1: {} + + punycode@2.3.1: {} + + qified@0.10.1: + dependencies: + hookified: 2.2.0 + + react-dom@19.3.0(react@19.3.0): + dependencies: + react: 19.3.0 + scheduler: 0.28.0 + + react@19.3.0: {} + + rolldown@1.2.10: + dependencies: + '@oxc-project/types': 0.151.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.2.10 + '@rolldown/binding-android-arm64': 1.2.10 + '@rolldown/binding-darwin-arm64': 1.2.10 + '@rolldown/binding-darwin-x64': 1.2.10 + '@rolldown/binding-freebsd-x64': 1.2.10 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.10 + '@rolldown/binding-linux-arm64-gnu': 1.2.10 + '@rolldown/binding-linux-arm64-musl': 1.2.10 + '@rolldown/binding-linux-ppc64-gnu': 1.2.10 + '@rolldown/binding-linux-s390x-gnu': 1.2.10 + '@rolldown/binding-linux-x64-gnu': 1.2.10 + '@rolldown/binding-linux-x64-musl': 1.2.10 + '@rolldown/binding-openharmony-arm64': 1.2.10 + '@rolldown/binding-win32-arm64-msvc': 1.2.10 + '@rolldown/binding-win32-x64-msvc': 1.2.10 + + rxjs@7.8.2: + dependencies: + tslib: 2.8.1 + + scheduler@0.28.0: {} + + semver@6.3.1: {} + + semver@7.8.5: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + source-map-js@1.2.1: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + + ts-api-utils@2.5.0(typescript@6.0.3): + dependencies: + typescript: 6.0.3 + + tslib@2.8.1: {} + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + typescript-eslint@8.70.1(eslint@10.11.0)(typescript@6.0.3): + dependencies: + '@typescript-eslint/eslint-plugin': 8.70.1(@typescript-eslint/parser@8.70.1(eslint@10.11.0)(typescript@6.0.3))(eslint@10.11.0)(typescript@6.0.3) + '@typescript-eslint/parser': 8.70.1(eslint@10.11.0)(typescript@6.0.3) + '@typescript-eslint/typescript-estree': 8.70.1(typescript@6.0.3) + '@typescript-eslint/utils': 8.70.1(eslint@10.11.0)(typescript@6.0.3) + eslint: 10.11.0 + typescript: 6.0.3 + transitivePeerDependencies: + - supports-color + + typescript@6.0.3: {} + + undici-types@7.18.2: {} + + update-browserslist-db@1.3.3(browserslist@4.29.0): + dependencies: + browserslist: 4.29.0 + escalade: 3.2.0 + picocolors: 1.1.1 + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + vite@8.3.1(@types/node@24.13.6): + dependencies: + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.28 + rolldown: 1.2.10 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 24.13.6 + fsevents: 2.3.3 + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + word-wrap@1.2.5: {} + + yallist@3.1.1: {} + + yocto-queue@0.1.0: {} + + zod-validation-error@4.0.2(zod@4.6.5): + dependencies: + zod: 4.6.5 + + zod@4.6.5: {} diff --git a/frontend/public/favicon.svg b/frontend/public/favicon.svg new file mode 100644 index 00000000..6893eb13 --- /dev/null +++ b/frontend/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/public/icons.svg b/frontend/public/icons.svg new file mode 100644 index 00000000..e9522193 --- /dev/null +++ b/frontend/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/App.css b/frontend/src/App.css new file mode 100644 index 00000000..f90339d8 --- /dev/null +++ b/frontend/src/App.css @@ -0,0 +1,184 @@ +.counter { + font-size: 16px; + padding: 5px 10px; + border-radius: 5px; + color: var(--accent); + background: var(--accent-bg); + border: 2px solid transparent; + transition: border-color 0.3s; + margin-bottom: 24px; + + &:hover { + border-color: var(--accent-border); + } + &:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; + } +} + +.hero { + position: relative; + + .base, + .framework, + .vite { + inset-inline: 0; + margin: 0 auto; + } + + .base { + width: 170px; + position: relative; + z-index: 0; + } + + .framework, + .vite { + position: absolute; + } + + .framework { + z-index: 1; + top: 34px; + height: 28px; + transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) + scale(1.4); + } + + .vite { + z-index: 0; + top: 107px; + height: 26px; + width: auto; + transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) + scale(0.8); + } +} + +#center { + display: flex; + flex-direction: column; + gap: 25px; + place-content: center; + place-items: center; + flex-grow: 1; + + @media (max-width: 1024px) { + padding: 32px 20px 24px; + gap: 18px; + } +} + +#next-steps { + display: flex; + border-top: 1px solid var(--border); + text-align: left; + + & > div { + flex: 1 1 0; + padding: 32px; + @media (max-width: 1024px) { + padding: 24px 20px; + } + } + + .icon { + margin-bottom: 16px; + width: 22px; + height: 22px; + } + + @media (max-width: 1024px) { + flex-direction: column; + text-align: center; + } +} + +#docs { + border-right: 1px solid var(--border); + + @media (max-width: 1024px) { + border-right: none; + border-bottom: 1px solid var(--border); + } +} + +#next-steps ul { + list-style: none; + padding: 0; + display: flex; + gap: 8px; + margin: 32px 0 0; + + .logo { + height: 18px; + } + + a { + color: var(--text-h); + font-size: 16px; + border-radius: 6px; + background: var(--social-bg); + display: flex; + padding: 6px 12px; + align-items: center; + gap: 8px; + text-decoration: none; + transition: box-shadow 0.3s; + + &:hover { + box-shadow: var(--shadow); + } + .button-icon { + height: 18px; + width: 18px; + } + } + + @media (max-width: 1024px) { + margin-top: 20px; + flex-wrap: wrap; + justify-content: center; + + li { + flex: 1 1 calc(50% - 8px); + } + + a { + width: 100%; + justify-content: center; + box-sizing: border-box; + } + } +} + +#spacer { + height: 88px; + border-top: 1px solid var(--border); + @media (max-width: 1024px) { + height: 48px; + } +} + +.ticks { + position: relative; + width: 100%; + + &::before, + &::after { + content: ''; + position: absolute; + top: -4.5px; + border: 5px solid transparent; + } + + &::before { + left: 0; + border-left-color: var(--border); + } + &::after { + right: 0; + border-right-color: var(--border); + } +} diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx new file mode 100644 index 00000000..9ca8e8d4 --- /dev/null +++ b/frontend/src/App.tsx @@ -0,0 +1,122 @@ +import { useState } from 'react' +import heroImg from './assets/hero.png' +import reactLogo from './assets/react.svg' +import viteLogo from './assets/vite.svg' +import './App.css' + +function App() { + const [count, setCount] = useState(0) + + return ( + <> +
+
+ + React logo + Vite logo +
+
+

Get started

+

+ Edit src/App.tsx and save to test HMR +

+
+ +
+ +
+ +
+ +
+
+ + ) +} + +export default App diff --git a/frontend/src/assets/hero.png b/frontend/src/assets/hero.png new file mode 100644 index 0000000000000000000000000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x9}3w@oU@EO}&cEzG?fu!!bLO->%zkcg;i9^j`S~=WKMnDi1f= P00000NkvXXu0mjft=yBf literal 0 HcmV?d00001 diff --git a/frontend/src/assets/react.svg b/frontend/src/assets/react.svg new file mode 100644 index 00000000..6c87de9b --- /dev/null +++ b/frontend/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/vite.svg b/frontend/src/assets/vite.svg new file mode 100644 index 00000000..5101b674 --- /dev/null +++ b/frontend/src/assets/vite.svg @@ -0,0 +1 @@ +Vite diff --git a/frontend/src/index.css b/frontend/src/index.css new file mode 100644 index 00000000..5fb33130 --- /dev/null +++ b/frontend/src/index.css @@ -0,0 +1,111 @@ +:root { + --text: #6b6375; + --text-h: #08060d; + --bg: #fff; + --border: #e5e4e7; + --code-bg: #f4f3ec; + --accent: #aa3bff; + --accent-bg: rgba(170, 59, 255, 0.1); + --accent-border: rgba(170, 59, 255, 0.5); + --social-bg: rgba(244, 243, 236, 0.5); + --shadow: + rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px; + + --sans: system-ui, 'Segoe UI', Roboto, sans-serif; + --heading: system-ui, 'Segoe UI', Roboto, sans-serif; + --mono: ui-monospace, Consolas, monospace; + + font: 18px/145% var(--sans); + letter-spacing: 0.18px; + color-scheme: light dark; + color: var(--text); + background: var(--bg); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + @media (max-width: 1024px) { + font-size: 16px; + } +} + +@media (prefers-color-scheme: dark) { + :root { + --text: #9ca3af; + --text-h: #f3f4f6; + --bg: #16171d; + --border: #2e303a; + --code-bg: #1f2028; + --accent: #c084fc; + --accent-bg: rgba(192, 132, 252, 0.15); + --accent-border: rgba(192, 132, 252, 0.5); + --social-bg: rgba(47, 48, 58, 0.5); + --shadow: + rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px; + } + + #social .button-icon { + filter: invert(1) brightness(2); + } +} + +#root { + width: 1126px; + max-width: 100%; + margin: 0 auto; + text-align: center; + border-inline: 1px solid var(--border); + min-height: 100svh; + display: flex; + flex-direction: column; + box-sizing: border-box; +} + +body { + margin: 0; +} + +h1, +h2 { + font-family: var(--heading); + font-weight: 500; + color: var(--text-h); +} + +h1 { + font-size: 56px; + letter-spacing: -1.68px; + margin: 32px 0; + @media (max-width: 1024px) { + font-size: 36px; + margin: 20px 0; + } +} +h2 { + font-size: 24px; + line-height: 118%; + letter-spacing: -0.24px; + margin: 0 0 8px; + @media (max-width: 1024px) { + font-size: 20px; + } +} +p { + margin: 0; +} + +code, +.counter { + font-family: var(--mono); + display: inline-flex; + border-radius: 4px; + color: var(--text-h); +} + +code { + font-size: 15px; + line-height: 135%; + padding: 4px 8px; + background: var(--code-bg); +} diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx new file mode 100644 index 00000000..bef5202a --- /dev/null +++ b/frontend/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import './index.css' +import App from './App.tsx' + +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json new file mode 100644 index 00000000..6830b6f7 --- /dev/null +++ b/frontend/tsconfig.app.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023", "DOM"], + "module": "esnext", + "types": ["vite/client"], + "allowArbitraryExtensions": true, + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json new file mode 100644 index 00000000..1ffef600 --- /dev/null +++ b/frontend/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/frontend/tsconfig.node.json b/frontend/tsconfig.node.json new file mode 100644 index 00000000..8455dcbc --- /dev/null +++ b/frontend/tsconfig.node.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023"], + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "module": "nodenext", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["vite.config.ts"] +} diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts new file mode 100644 index 00000000..d789a7cf --- /dev/null +++ b/frontend/vite.config.ts @@ -0,0 +1,11 @@ +import react, { reactCompilerPreset } from '@vitejs/plugin-react' +import babel from '@rolldown/plugin-babel' +import { defineConfig } from 'vite' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + react(), + babel({ presets: [reactCompilerPreset()] }) + ], +})
+ +
+ +

Connect with us

+

Join the Vite community

+ +
+